@codexhost/cli-linux-arm64 0.24.0 → 0.25.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/app/codexhost-distribution.json +1 -1
- package/app/console-server.mjs +3166 -3040
- package/app/console-web.js +1156 -585
- package/app/desktop-controller.mjs +645 -264
- package/app/host-runtime.mjs +10906 -10282
- package/app/plugins/antigravity/plugin.mjs +515 -369
- package/app/plugins/claude-code/plugin.mjs +583 -438
- package/app/plugins/codebuddy/plugin.mjs +551 -429
- package/app/plugins/codex-usage/plugin.mjs +344 -224
- package/app/plugins/copilot/plugin.mjs +408 -286
- package/app/plugins/cursor-cli/plugin.mjs +499 -360
- package/app/plugins/deepseek-harness/plugin.mjs +759 -520
- package/app/plugins/devin/plugin.mjs +385 -265
- package/app/plugins/grok/plugin.mjs +638 -516
- package/app/plugins/hermes/plugin.mjs +456 -334
- package/app/plugins/kimi-code/plugin.mjs +454 -332
- package/app/plugins/kiro-cli/plugin.mjs +445 -325
- package/app/plugins/omp/plugin.mjs +707 -339
- package/app/plugins/opencode/plugin.mjs +873 -741
- package/app/plugins/pi/plugin.mjs +481 -359
- package/app/plugins/qoder/plugin.mjs +682 -560
- package/app/plugins/qoder-cn/plugin.mjs +682 -560
- package/app/plugins/qwen-code/plugin.mjs +475 -355
- package/app/plugins/workbuddy/plugin.mjs +549 -429
- package/app/plugins/zcode/plugin.mjs +352 -232
- package/app/renderer-extension.js +1706 -945
- package/app/web/assets/{index-IvFk9KT-.js → index-DUOvhHbV.js} +82 -82
- package/app/web/codexhost-settings.js +416 -51
- package/app/web/index.html +1 -1
- package/app/web/plugins/deepseek-ai__dsh-api-remotes/client.js +64 -64
- package/app/web/plugins/deepseek-ai__dsh-api-session-controller/client.js +8 -8
- package/app/web/plugins/deepseek-ai__dsh-api-workspace-controller/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-client-shortcuts/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-client-ui-brand-official/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-client-ui-chat/client.js +74 -74
- package/app/web/plugins/deepseek-ai__dsh-client-ui-codexhost/client.js +72 -72
- package/app/web/plugins/deepseek-ai__dsh-client-ui-conversation/client.js +97 -97
- package/app/web/plugins/deepseek-ai__dsh-client-ui-layout/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-client-ui-sidebar/client.js +2 -2
- package/app/web/plugins/deepseek-ai__dsh-client-ui-sidebar-files/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-client-ui-tool/client.js +18 -18
- package/app/web/plugins/deepseek-ai__dsh-client-ui-workspace/client.js +8 -8
- package/app/web-modules/server.mjs +2132 -1312
- package/bin/codexhost +0 -0
- package/libexec/codexhost-shim +0 -0
- package/libexec/codexhost-updater +0 -0
- package/package.json +1 -1
|
@@ -147,8 +147,8 @@ var VERSION_MANAGER_ROOTS = "<version-managers>";
|
|
|
147
147
|
function installRootExtensions(platform) {
|
|
148
148
|
return platform === "win32" ? [".exe", ".cmd"] : [""];
|
|
149
149
|
}
|
|
150
|
-
function resolveHomeDirectory(
|
|
151
|
-
return
|
|
150
|
+
function resolveHomeDirectory(input2) {
|
|
151
|
+
return input2.homeDirectory ?? environmentValue(input2.environment, "HOME") ?? environmentValue(input2.environment, "USERPROFILE") ?? os.homedir();
|
|
152
152
|
}
|
|
153
153
|
function templateVariables(environment, platform, home) {
|
|
154
154
|
const pathFlavor = targetPath(platform);
|
|
@@ -181,36 +181,36 @@ function expandInstallRoot(template, environment, platform, home) {
|
|
|
181
181
|
});
|
|
182
182
|
return unresolved ? void 0 : joinTemplate(platform, substituted);
|
|
183
183
|
}
|
|
184
|
-
function installRootDirectories(spec,
|
|
184
|
+
function installRootDirectories(spec, input2, dependencies, platform, home) {
|
|
185
185
|
const templates = (platform === "win32" ? spec.installRoots?.windows : spec.installRoots?.posix) ?? [];
|
|
186
186
|
const directories = [];
|
|
187
187
|
for (const template of templates) {
|
|
188
188
|
if (template === VERSION_MANAGER_ROOTS) {
|
|
189
189
|
directories.push(...versionManagerBinaryDirectories({
|
|
190
190
|
platform,
|
|
191
|
-
environment:
|
|
191
|
+
environment: input2.environment,
|
|
192
192
|
home,
|
|
193
193
|
...dependencies.subdirectories ? { subdirectories: dependencies.subdirectories } : {}
|
|
194
194
|
}));
|
|
195
195
|
continue;
|
|
196
196
|
}
|
|
197
|
-
const directory = expandInstallRoot(template,
|
|
197
|
+
const directory = expandInstallRoot(template, input2.environment, platform, home);
|
|
198
198
|
if (directory !== void 0)
|
|
199
199
|
directories.push(directory);
|
|
200
200
|
}
|
|
201
201
|
return directories;
|
|
202
202
|
}
|
|
203
|
-
function harnessCandidates(spec,
|
|
204
|
-
const platform =
|
|
203
|
+
function harnessCandidates(spec, input2, dependencies = {}) {
|
|
204
|
+
const platform = input2.platform ?? process.platform;
|
|
205
205
|
const pathFlavor = targetPath(platform);
|
|
206
|
-
const configured =
|
|
206
|
+
const configured = input2.command ?? (spec.commandEnvironmentVariable ? environmentValue(input2.environment, spec.commandEnvironmentVariable) : void 0);
|
|
207
207
|
const command = configured ?? spec.command;
|
|
208
208
|
if (pathFlavor.isAbsolute(command) || command.includes("/") || command.includes("\\")) {
|
|
209
209
|
return [{ candidate: command, source: "configured" }];
|
|
210
210
|
}
|
|
211
211
|
const candidates = [];
|
|
212
|
-
const extensions = executableExtensions(command, platform,
|
|
213
|
-
for (const directory of pathDirectories(
|
|
212
|
+
const extensions = executableExtensions(command, platform, input2.environment);
|
|
213
|
+
for (const directory of pathDirectories(input2.environment, platform)) {
|
|
214
214
|
for (const extension of extensions) {
|
|
215
215
|
candidates.push({
|
|
216
216
|
candidate: pathFlavor.join(directory, command + extension),
|
|
@@ -220,8 +220,8 @@ function harnessCandidates(spec, input, dependencies = {}) {
|
|
|
220
220
|
}
|
|
221
221
|
if (configured !== void 0)
|
|
222
222
|
return candidates;
|
|
223
|
-
const home = resolveHomeDirectory(
|
|
224
|
-
for (const directory of installRootDirectories(spec,
|
|
223
|
+
const home = resolveHomeDirectory(input2);
|
|
224
|
+
for (const directory of installRootDirectories(spec, input2, dependencies, platform, home)) {
|
|
225
225
|
for (const extension of installRootExtensions(platform)) {
|
|
226
226
|
candidates.push({
|
|
227
227
|
candidate: pathFlavor.join(directory, spec.command + extension),
|
|
@@ -231,12 +231,12 @@ function harnessCandidates(spec, input, dependencies = {}) {
|
|
|
231
231
|
}
|
|
232
232
|
return candidates;
|
|
233
233
|
}
|
|
234
|
-
function resolveHarnessExecutable(spec,
|
|
235
|
-
const platform =
|
|
234
|
+
function resolveHarnessExecutable(spec, input2, dependencies = {}) {
|
|
235
|
+
const platform = input2.platform ?? process.platform;
|
|
236
236
|
const isExecutable = dependencies.isExecutable ?? ((candidate) => isExecutableFile(candidate, platform));
|
|
237
237
|
const runnable = spec.runnableCandidate ?? ((candidate) => candidate);
|
|
238
238
|
const context = { platform, isExecutable };
|
|
239
|
-
for (const { candidate, source } of harnessCandidates(spec,
|
|
239
|
+
for (const { candidate, source } of harnessCandidates(spec, input2, dependencies)) {
|
|
240
240
|
const executable = runnable(candidate, context);
|
|
241
241
|
if (executable !== void 0 && isExecutable(executable))
|
|
242
242
|
return { executable, source };
|
|
@@ -247,13 +247,13 @@ function resolveHarnessExecutable(spec, input, dependencies = {}) {
|
|
|
247
247
|
// ../../harness-discovery/dist/installation.js
|
|
248
248
|
import { execFile } from "node:child_process";
|
|
249
249
|
import { homedir } from "node:os";
|
|
250
|
-
function runInstallationCommand(command, args, environment, timeout = 3e4) {
|
|
250
|
+
function runInstallationCommand(command, args, environment, timeout = 3e4, cwd) {
|
|
251
251
|
const env = withNodeRuntimeOnPath(environment);
|
|
252
252
|
const invocation = /\.[cm]?js$/i.test(command) ? commandInvocation(process.execPath, [command, ...args], env) : commandInvocation(command, args, env);
|
|
253
253
|
return new Promise((resolve, reject) => {
|
|
254
254
|
const child = execFile(invocation.command, invocation.arguments, {
|
|
255
255
|
env,
|
|
256
|
-
cwd: env.HOME ?? env.USERPROFILE ?? homedir(),
|
|
256
|
+
cwd: cwd ?? env.HOME ?? env.USERPROFILE ?? homedir(),
|
|
257
257
|
encoding: "utf8",
|
|
258
258
|
timeout,
|
|
259
259
|
killSignal: "SIGKILL",
|
|
@@ -316,7 +316,7 @@ function createInstallationManager(options) {
|
|
|
316
316
|
const check2 = () => checking ??= options.check().finally(() => {
|
|
317
317
|
checking = void 0;
|
|
318
318
|
});
|
|
319
|
-
return (action) => {
|
|
319
|
+
return (action, confirmedVersion) => {
|
|
320
320
|
if (updating)
|
|
321
321
|
return updating;
|
|
322
322
|
if (action === "check")
|
|
@@ -327,6 +327,8 @@ function createInstallationManager(options) {
|
|
|
327
327
|
return before;
|
|
328
328
|
if (!before.canUpdate)
|
|
329
329
|
throw new Error(before.message ?? "This installation cannot be updated automatically");
|
|
330
|
+
if ((before.latestVerifiedVersion !== void 0 || confirmedVersion !== void 0) && before.latestVersion !== confirmedVersion)
|
|
331
|
+
return { ...before, confirmationRequired: true };
|
|
330
332
|
await options.update(before);
|
|
331
333
|
const after = await check2();
|
|
332
334
|
if (after.currentVersion === before.currentVersion)
|
|
@@ -1119,8 +1121,8 @@ function cached(getter) {
|
|
|
1119
1121
|
}
|
|
1120
1122
|
};
|
|
1121
1123
|
}
|
|
1122
|
-
function nullish(
|
|
1123
|
-
return
|
|
1124
|
+
function nullish(input2) {
|
|
1125
|
+
return input2 === null || input2 === void 0;
|
|
1124
1126
|
}
|
|
1125
1127
|
function cleanRegex(source) {
|
|
1126
1128
|
const start = source.startsWith("^") ? 1 : 0;
|
|
@@ -1207,8 +1209,8 @@ function randomString(length = 10) {
|
|
|
1207
1209
|
function esc(str) {
|
|
1208
1210
|
return JSON.stringify(str);
|
|
1209
1211
|
}
|
|
1210
|
-
function slugify(
|
|
1211
|
-
return
|
|
1212
|
+
function slugify(input2) {
|
|
1213
|
+
return input2.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, "");
|
|
1212
1214
|
}
|
|
1213
1215
|
var captureStackTrace = "captureStackTrace" in Error ? Error.captureStackTrace : (..._args) => {
|
|
1214
1216
|
};
|
|
@@ -1613,19 +1615,19 @@ function finalizeIssue(iss, ctx, config2) {
|
|
|
1613
1615
|
}
|
|
1614
1616
|
return rest;
|
|
1615
1617
|
}
|
|
1616
|
-
function getSizableOrigin(
|
|
1617
|
-
if (
|
|
1618
|
+
function getSizableOrigin(input2) {
|
|
1619
|
+
if (input2 instanceof Set)
|
|
1618
1620
|
return "set";
|
|
1619
|
-
if (
|
|
1621
|
+
if (input2 instanceof Map)
|
|
1620
1622
|
return "map";
|
|
1621
|
-
if (
|
|
1623
|
+
if (input2 instanceof File)
|
|
1622
1624
|
return "file";
|
|
1623
1625
|
return "unknown";
|
|
1624
1626
|
}
|
|
1625
|
-
function getLengthableOrigin(
|
|
1626
|
-
if (Array.isArray(
|
|
1627
|
+
function getLengthableOrigin(input2) {
|
|
1628
|
+
if (Array.isArray(input2))
|
|
1627
1629
|
return "array";
|
|
1628
|
-
if (typeof
|
|
1630
|
+
if (typeof input2 === "string")
|
|
1629
1631
|
return "string";
|
|
1630
1632
|
return "unknown";
|
|
1631
1633
|
}
|
|
@@ -1651,12 +1653,12 @@ function parsedType(data) {
|
|
|
1651
1653
|
return t;
|
|
1652
1654
|
}
|
|
1653
1655
|
function issue(...args) {
|
|
1654
|
-
const [iss,
|
|
1656
|
+
const [iss, input2, inst] = args;
|
|
1655
1657
|
if (typeof iss === "string") {
|
|
1656
1658
|
return {
|
|
1657
1659
|
message: iss,
|
|
1658
1660
|
code: "custom",
|
|
1659
|
-
input,
|
|
1661
|
+
input: input2,
|
|
1660
1662
|
inst
|
|
1661
1663
|
};
|
|
1662
1664
|
}
|
|
@@ -2200,23 +2202,23 @@ var $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat"
|
|
|
2200
2202
|
bag.pattern = integer;
|
|
2201
2203
|
});
|
|
2202
2204
|
inst._zod.check = (payload) => {
|
|
2203
|
-
const
|
|
2205
|
+
const input2 = payload.value;
|
|
2204
2206
|
if (isInt) {
|
|
2205
|
-
if (!Number.isInteger(
|
|
2207
|
+
if (!Number.isInteger(input2)) {
|
|
2206
2208
|
payload.issues.push({
|
|
2207
2209
|
expected: origin,
|
|
2208
2210
|
format: def.format,
|
|
2209
2211
|
code: "invalid_type",
|
|
2210
2212
|
continue: false,
|
|
2211
|
-
input,
|
|
2213
|
+
input: input2,
|
|
2212
2214
|
inst
|
|
2213
2215
|
});
|
|
2214
2216
|
return;
|
|
2215
2217
|
}
|
|
2216
|
-
if (!Number.isSafeInteger(
|
|
2217
|
-
if (
|
|
2218
|
+
if (!Number.isSafeInteger(input2)) {
|
|
2219
|
+
if (input2 > 0) {
|
|
2218
2220
|
payload.issues.push({
|
|
2219
|
-
input,
|
|
2221
|
+
input: input2,
|
|
2220
2222
|
code: "too_big",
|
|
2221
2223
|
maximum: Number.MAX_SAFE_INTEGER,
|
|
2222
2224
|
note: "Integers must be within the safe integer range.",
|
|
@@ -2227,7 +2229,7 @@ var $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat"
|
|
|
2227
2229
|
});
|
|
2228
2230
|
} else {
|
|
2229
2231
|
payload.issues.push({
|
|
2230
|
-
input,
|
|
2232
|
+
input: input2,
|
|
2231
2233
|
code: "too_small",
|
|
2232
2234
|
minimum: Number.MIN_SAFE_INTEGER,
|
|
2233
2235
|
note: "Integers must be within the safe integer range.",
|
|
@@ -2240,10 +2242,10 @@ var $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat"
|
|
|
2240
2242
|
return;
|
|
2241
2243
|
}
|
|
2242
2244
|
}
|
|
2243
|
-
if (
|
|
2245
|
+
if (input2 < minimum) {
|
|
2244
2246
|
payload.issues.push({
|
|
2245
2247
|
origin: "number",
|
|
2246
|
-
input,
|
|
2248
|
+
input: input2,
|
|
2247
2249
|
code: "too_small",
|
|
2248
2250
|
minimum,
|
|
2249
2251
|
inclusive: true,
|
|
@@ -2251,10 +2253,10 @@ var $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat"
|
|
|
2251
2253
|
continue: !def.abort
|
|
2252
2254
|
});
|
|
2253
2255
|
}
|
|
2254
|
-
if (
|
|
2256
|
+
if (input2 > maximum) {
|
|
2255
2257
|
payload.issues.push({
|
|
2256
2258
|
origin: "number",
|
|
2257
|
-
input,
|
|
2259
|
+
input: input2,
|
|
2258
2260
|
code: "too_big",
|
|
2259
2261
|
maximum,
|
|
2260
2262
|
inclusive: true,
|
|
@@ -2274,11 +2276,11 @@ var $ZodCheckBigIntFormat = /* @__PURE__ */ $constructor("$ZodCheckBigIntFormat"
|
|
|
2274
2276
|
bag.maximum = maximum;
|
|
2275
2277
|
});
|
|
2276
2278
|
inst._zod.check = (payload) => {
|
|
2277
|
-
const
|
|
2278
|
-
if (
|
|
2279
|
+
const input2 = payload.value;
|
|
2280
|
+
if (input2 < minimum) {
|
|
2279
2281
|
payload.issues.push({
|
|
2280
2282
|
origin: "bigint",
|
|
2281
|
-
input,
|
|
2283
|
+
input: input2,
|
|
2282
2284
|
code: "too_small",
|
|
2283
2285
|
minimum,
|
|
2284
2286
|
inclusive: true,
|
|
@@ -2286,10 +2288,10 @@ var $ZodCheckBigIntFormat = /* @__PURE__ */ $constructor("$ZodCheckBigIntFormat"
|
|
|
2286
2288
|
continue: !def.abort
|
|
2287
2289
|
});
|
|
2288
2290
|
}
|
|
2289
|
-
if (
|
|
2291
|
+
if (input2 > maximum) {
|
|
2290
2292
|
payload.issues.push({
|
|
2291
2293
|
origin: "bigint",
|
|
2292
|
-
input,
|
|
2294
|
+
input: input2,
|
|
2293
2295
|
code: "too_big",
|
|
2294
2296
|
maximum,
|
|
2295
2297
|
inclusive: true,
|
|
@@ -2312,16 +2314,16 @@ var $ZodCheckMaxSize = /* @__PURE__ */ $constructor("$ZodCheckMaxSize", (inst, d
|
|
|
2312
2314
|
inst2._zod.bag.maximum = def.maximum;
|
|
2313
2315
|
});
|
|
2314
2316
|
inst._zod.check = (payload) => {
|
|
2315
|
-
const
|
|
2316
|
-
const size =
|
|
2317
|
+
const input2 = payload.value;
|
|
2318
|
+
const size = input2.size;
|
|
2317
2319
|
if (size <= def.maximum)
|
|
2318
2320
|
return;
|
|
2319
2321
|
payload.issues.push({
|
|
2320
|
-
origin: getSizableOrigin(
|
|
2322
|
+
origin: getSizableOrigin(input2),
|
|
2321
2323
|
code: "too_big",
|
|
2322
2324
|
maximum: def.maximum,
|
|
2323
2325
|
inclusive: true,
|
|
2324
|
-
input,
|
|
2326
|
+
input: input2,
|
|
2325
2327
|
inst,
|
|
2326
2328
|
continue: !def.abort
|
|
2327
2329
|
});
|
|
@@ -2340,16 +2342,16 @@ var $ZodCheckMinSize = /* @__PURE__ */ $constructor("$ZodCheckMinSize", (inst, d
|
|
|
2340
2342
|
inst2._zod.bag.minimum = def.minimum;
|
|
2341
2343
|
});
|
|
2342
2344
|
inst._zod.check = (payload) => {
|
|
2343
|
-
const
|
|
2344
|
-
const size =
|
|
2345
|
+
const input2 = payload.value;
|
|
2346
|
+
const size = input2.size;
|
|
2345
2347
|
if (size >= def.minimum)
|
|
2346
2348
|
return;
|
|
2347
2349
|
payload.issues.push({
|
|
2348
|
-
origin: getSizableOrigin(
|
|
2350
|
+
origin: getSizableOrigin(input2),
|
|
2349
2351
|
code: "too_small",
|
|
2350
2352
|
minimum: def.minimum,
|
|
2351
2353
|
inclusive: true,
|
|
2352
|
-
input,
|
|
2354
|
+
input: input2,
|
|
2353
2355
|
inst,
|
|
2354
2356
|
continue: !def.abort
|
|
2355
2357
|
});
|
|
@@ -2369,13 +2371,13 @@ var $ZodCheckSizeEquals = /* @__PURE__ */ $constructor("$ZodCheckSizeEquals", (i
|
|
|
2369
2371
|
bag.size = def.size;
|
|
2370
2372
|
});
|
|
2371
2373
|
inst._zod.check = (payload) => {
|
|
2372
|
-
const
|
|
2373
|
-
const size =
|
|
2374
|
+
const input2 = payload.value;
|
|
2375
|
+
const size = input2.size;
|
|
2374
2376
|
if (size === def.size)
|
|
2375
2377
|
return;
|
|
2376
2378
|
const tooBig = size > def.size;
|
|
2377
2379
|
payload.issues.push({
|
|
2378
|
-
origin: getSizableOrigin(
|
|
2380
|
+
origin: getSizableOrigin(input2),
|
|
2379
2381
|
...tooBig ? { code: "too_big", maximum: def.size } : { code: "too_small", minimum: def.size },
|
|
2380
2382
|
inclusive: true,
|
|
2381
2383
|
exact: true,
|
|
@@ -2398,17 +2400,17 @@ var $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (ins
|
|
|
2398
2400
|
inst2._zod.bag.maximum = def.maximum;
|
|
2399
2401
|
});
|
|
2400
2402
|
inst._zod.check = (payload) => {
|
|
2401
|
-
const
|
|
2402
|
-
const length =
|
|
2403
|
+
const input2 = payload.value;
|
|
2404
|
+
const length = input2.length;
|
|
2403
2405
|
if (length <= def.maximum)
|
|
2404
2406
|
return;
|
|
2405
|
-
const origin = getLengthableOrigin(
|
|
2407
|
+
const origin = getLengthableOrigin(input2);
|
|
2406
2408
|
payload.issues.push({
|
|
2407
2409
|
origin,
|
|
2408
2410
|
code: "too_big",
|
|
2409
2411
|
maximum: def.maximum,
|
|
2410
2412
|
inclusive: true,
|
|
2411
|
-
input,
|
|
2413
|
+
input: input2,
|
|
2412
2414
|
inst,
|
|
2413
2415
|
continue: !def.abort
|
|
2414
2416
|
});
|
|
@@ -2427,17 +2429,17 @@ var $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (ins
|
|
|
2427
2429
|
inst2._zod.bag.minimum = def.minimum;
|
|
2428
2430
|
});
|
|
2429
2431
|
inst._zod.check = (payload) => {
|
|
2430
|
-
const
|
|
2431
|
-
const length =
|
|
2432
|
+
const input2 = payload.value;
|
|
2433
|
+
const length = input2.length;
|
|
2432
2434
|
if (length >= def.minimum)
|
|
2433
2435
|
return;
|
|
2434
|
-
const origin = getLengthableOrigin(
|
|
2436
|
+
const origin = getLengthableOrigin(input2);
|
|
2435
2437
|
payload.issues.push({
|
|
2436
2438
|
origin,
|
|
2437
2439
|
code: "too_small",
|
|
2438
2440
|
minimum: def.minimum,
|
|
2439
2441
|
inclusive: true,
|
|
2440
|
-
input,
|
|
2442
|
+
input: input2,
|
|
2441
2443
|
inst,
|
|
2442
2444
|
continue: !def.abort
|
|
2443
2445
|
});
|
|
@@ -2457,11 +2459,11 @@ var $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEquals"
|
|
|
2457
2459
|
bag.length = def.length;
|
|
2458
2460
|
});
|
|
2459
2461
|
inst._zod.check = (payload) => {
|
|
2460
|
-
const
|
|
2461
|
-
const length =
|
|
2462
|
+
const input2 = payload.value;
|
|
2463
|
+
const length = input2.length;
|
|
2462
2464
|
if (length === def.length)
|
|
2463
2465
|
return;
|
|
2464
|
-
const origin = getLengthableOrigin(
|
|
2466
|
+
const origin = getLengthableOrigin(input2);
|
|
2465
2467
|
const tooBig = length > def.length;
|
|
2466
2468
|
payload.issues.push({
|
|
2467
2469
|
origin,
|
|
@@ -3132,15 +3134,15 @@ var $ZodNumber = /* @__PURE__ */ $constructor("$ZodNumber", (inst, def) => {
|
|
|
3132
3134
|
payload.value = Number(payload.value);
|
|
3133
3135
|
} catch (_) {
|
|
3134
3136
|
}
|
|
3135
|
-
const
|
|
3136
|
-
if (typeof
|
|
3137
|
+
const input2 = payload.value;
|
|
3138
|
+
if (typeof input2 === "number" && !Number.isNaN(input2) && Number.isFinite(input2)) {
|
|
3137
3139
|
return payload;
|
|
3138
3140
|
}
|
|
3139
|
-
const received = typeof
|
|
3141
|
+
const received = typeof input2 === "number" ? Number.isNaN(input2) ? "NaN" : !Number.isFinite(input2) ? "Infinity" : void 0 : void 0;
|
|
3140
3142
|
payload.issues.push({
|
|
3141
3143
|
expected: "number",
|
|
3142
3144
|
code: "invalid_type",
|
|
3143
|
-
input,
|
|
3145
|
+
input: input2,
|
|
3144
3146
|
inst,
|
|
3145
3147
|
...received ? { received } : {}
|
|
3146
3148
|
});
|
|
@@ -3160,13 +3162,13 @@ var $ZodBoolean = /* @__PURE__ */ $constructor("$ZodBoolean", (inst, def) => {
|
|
|
3160
3162
|
payload.value = Boolean(payload.value);
|
|
3161
3163
|
} catch (_) {
|
|
3162
3164
|
}
|
|
3163
|
-
const
|
|
3164
|
-
if (typeof
|
|
3165
|
+
const input2 = payload.value;
|
|
3166
|
+
if (typeof input2 === "boolean")
|
|
3165
3167
|
return payload;
|
|
3166
3168
|
payload.issues.push({
|
|
3167
3169
|
expected: "boolean",
|
|
3168
3170
|
code: "invalid_type",
|
|
3169
|
-
input,
|
|
3171
|
+
input: input2,
|
|
3170
3172
|
inst
|
|
3171
3173
|
});
|
|
3172
3174
|
return payload;
|
|
@@ -3199,13 +3201,13 @@ var $ZodBigIntFormat = /* @__PURE__ */ $constructor("$ZodBigIntFormat", (inst, d
|
|
|
3199
3201
|
var $ZodSymbol = /* @__PURE__ */ $constructor("$ZodSymbol", (inst, def) => {
|
|
3200
3202
|
$ZodType.init(inst, def);
|
|
3201
3203
|
inst._zod.parse = (payload, _ctx) => {
|
|
3202
|
-
const
|
|
3203
|
-
if (typeof
|
|
3204
|
+
const input2 = payload.value;
|
|
3205
|
+
if (typeof input2 === "symbol")
|
|
3204
3206
|
return payload;
|
|
3205
3207
|
payload.issues.push({
|
|
3206
3208
|
expected: "symbol",
|
|
3207
3209
|
code: "invalid_type",
|
|
3208
|
-
input,
|
|
3210
|
+
input: input2,
|
|
3209
3211
|
inst
|
|
3210
3212
|
});
|
|
3211
3213
|
return payload;
|
|
@@ -3216,13 +3218,13 @@ var $ZodUndefined = /* @__PURE__ */ $constructor("$ZodUndefined", (inst, def) =>
|
|
|
3216
3218
|
inst._zod.pattern = _undefined;
|
|
3217
3219
|
inst._zod.values = /* @__PURE__ */ new Set([void 0]);
|
|
3218
3220
|
inst._zod.parse = (payload, _ctx) => {
|
|
3219
|
-
const
|
|
3220
|
-
if (typeof
|
|
3221
|
+
const input2 = payload.value;
|
|
3222
|
+
if (typeof input2 === "undefined")
|
|
3221
3223
|
return payload;
|
|
3222
3224
|
payload.issues.push({
|
|
3223
3225
|
expected: "undefined",
|
|
3224
3226
|
code: "invalid_type",
|
|
3225
|
-
input,
|
|
3227
|
+
input: input2,
|
|
3226
3228
|
inst
|
|
3227
3229
|
});
|
|
3228
3230
|
return payload;
|
|
@@ -3233,13 +3235,13 @@ var $ZodNull = /* @__PURE__ */ $constructor("$ZodNull", (inst, def) => {
|
|
|
3233
3235
|
inst._zod.pattern = _null;
|
|
3234
3236
|
inst._zod.values = /* @__PURE__ */ new Set([null]);
|
|
3235
3237
|
inst._zod.parse = (payload, _ctx) => {
|
|
3236
|
-
const
|
|
3237
|
-
if (
|
|
3238
|
+
const input2 = payload.value;
|
|
3239
|
+
if (input2 === null)
|
|
3238
3240
|
return payload;
|
|
3239
3241
|
payload.issues.push({
|
|
3240
3242
|
expected: "null",
|
|
3241
3243
|
code: "invalid_type",
|
|
3242
|
-
input,
|
|
3244
|
+
input: input2,
|
|
3243
3245
|
inst
|
|
3244
3246
|
});
|
|
3245
3247
|
return payload;
|
|
@@ -3268,13 +3270,13 @@ var $ZodNever = /* @__PURE__ */ $constructor("$ZodNever", (inst, def) => {
|
|
|
3268
3270
|
var $ZodVoid = /* @__PURE__ */ $constructor("$ZodVoid", (inst, def) => {
|
|
3269
3271
|
$ZodType.init(inst, def);
|
|
3270
3272
|
inst._zod.parse = (payload, _ctx) => {
|
|
3271
|
-
const
|
|
3272
|
-
if (typeof
|
|
3273
|
+
const input2 = payload.value;
|
|
3274
|
+
if (typeof input2 === "undefined")
|
|
3273
3275
|
return payload;
|
|
3274
3276
|
payload.issues.push({
|
|
3275
3277
|
expected: "void",
|
|
3276
3278
|
code: "invalid_type",
|
|
3277
|
-
input,
|
|
3279
|
+
input: input2,
|
|
3278
3280
|
inst
|
|
3279
3281
|
});
|
|
3280
3282
|
return payload;
|
|
@@ -3289,15 +3291,15 @@ var $ZodDate = /* @__PURE__ */ $constructor("$ZodDate", (inst, def) => {
|
|
|
3289
3291
|
} catch (_err) {
|
|
3290
3292
|
}
|
|
3291
3293
|
}
|
|
3292
|
-
const
|
|
3293
|
-
const isDate =
|
|
3294
|
-
const isValidDate = isDate && !Number.isNaN(
|
|
3294
|
+
const input2 = payload.value;
|
|
3295
|
+
const isDate = input2 instanceof Date;
|
|
3296
|
+
const isValidDate = isDate && !Number.isNaN(input2.getTime());
|
|
3295
3297
|
if (isValidDate)
|
|
3296
3298
|
return payload;
|
|
3297
3299
|
payload.issues.push({
|
|
3298
3300
|
expected: "date",
|
|
3299
3301
|
code: "invalid_type",
|
|
3300
|
-
input,
|
|
3302
|
+
input: input2,
|
|
3301
3303
|
...isDate ? { received: "Invalid Date" } : {},
|
|
3302
3304
|
inst
|
|
3303
3305
|
});
|
|
@@ -3313,20 +3315,20 @@ function handleArrayResult(result, final, index) {
|
|
|
3313
3315
|
var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
|
|
3314
3316
|
$ZodType.init(inst, def);
|
|
3315
3317
|
inst._zod.parse = (payload, ctx) => {
|
|
3316
|
-
const
|
|
3317
|
-
if (!Array.isArray(
|
|
3318
|
+
const input2 = payload.value;
|
|
3319
|
+
if (!Array.isArray(input2)) {
|
|
3318
3320
|
payload.issues.push({
|
|
3319
3321
|
expected: "array",
|
|
3320
3322
|
code: "invalid_type",
|
|
3321
|
-
input,
|
|
3323
|
+
input: input2,
|
|
3322
3324
|
inst
|
|
3323
3325
|
});
|
|
3324
3326
|
return payload;
|
|
3325
3327
|
}
|
|
3326
|
-
payload.value = Array(
|
|
3328
|
+
payload.value = Array(input2.length);
|
|
3327
3329
|
const proms = [];
|
|
3328
|
-
for (let i = 0; i <
|
|
3329
|
-
const item =
|
|
3330
|
+
for (let i = 0; i < input2.length; i++) {
|
|
3331
|
+
const item = input2[i];
|
|
3330
3332
|
const result = def.element._zod.run({
|
|
3331
3333
|
value: item,
|
|
3332
3334
|
issues: []
|
|
@@ -3343,8 +3345,8 @@ var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
|
|
|
3343
3345
|
return payload;
|
|
3344
3346
|
};
|
|
3345
3347
|
});
|
|
3346
|
-
function handlePropertyResult(result, final, key,
|
|
3347
|
-
const isPresent = key in
|
|
3348
|
+
function handlePropertyResult(result, final, key, input2, isOptionalIn, isOptionalOut) {
|
|
3349
|
+
const isPresent = key in input2;
|
|
3348
3350
|
if (result.issues.length) {
|
|
3349
3351
|
if (isOptionalIn && isOptionalOut && !isPresent) {
|
|
3350
3352
|
return;
|
|
@@ -3386,14 +3388,14 @@ function normalizeDef(def) {
|
|
|
3386
3388
|
optionalKeys: new Set(okeys)
|
|
3387
3389
|
};
|
|
3388
3390
|
}
|
|
3389
|
-
function handleCatchall(proms,
|
|
3391
|
+
function handleCatchall(proms, input2, payload, ctx, def, inst) {
|
|
3390
3392
|
const unrecognized = [];
|
|
3391
3393
|
const keySet = def.keySet;
|
|
3392
3394
|
const _catchall = def.catchall._zod;
|
|
3393
3395
|
const t = _catchall.def.type;
|
|
3394
3396
|
const isOptionalIn = _catchall.optin === "optional";
|
|
3395
3397
|
const isOptionalOut = _catchall.optout === "optional";
|
|
3396
|
-
for (const key in
|
|
3398
|
+
for (const key in input2) {
|
|
3397
3399
|
if (key === "__proto__")
|
|
3398
3400
|
continue;
|
|
3399
3401
|
if (keySet.has(key))
|
|
@@ -3402,18 +3404,18 @@ function handleCatchall(proms, input, payload, ctx, def, inst) {
|
|
|
3402
3404
|
unrecognized.push(key);
|
|
3403
3405
|
continue;
|
|
3404
3406
|
}
|
|
3405
|
-
const r = _catchall.run({ value:
|
|
3407
|
+
const r = _catchall.run({ value: input2[key], issues: [] }, ctx);
|
|
3406
3408
|
if (r instanceof Promise) {
|
|
3407
|
-
proms.push(r.then((r2) => handlePropertyResult(r2, payload, key,
|
|
3409
|
+
proms.push(r.then((r2) => handlePropertyResult(r2, payload, key, input2, isOptionalIn, isOptionalOut)));
|
|
3408
3410
|
} else {
|
|
3409
|
-
handlePropertyResult(r, payload, key,
|
|
3411
|
+
handlePropertyResult(r, payload, key, input2, isOptionalIn, isOptionalOut);
|
|
3410
3412
|
}
|
|
3411
3413
|
}
|
|
3412
3414
|
if (unrecognized.length) {
|
|
3413
3415
|
payload.issues.push({
|
|
3414
3416
|
code: "unrecognized_keys",
|
|
3415
3417
|
keys: unrecognized,
|
|
3416
|
-
input,
|
|
3418
|
+
input: input2,
|
|
3417
3419
|
inst
|
|
3418
3420
|
});
|
|
3419
3421
|
}
|
|
@@ -3457,12 +3459,12 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
|
3457
3459
|
let value;
|
|
3458
3460
|
inst._zod.parse = (payload, ctx) => {
|
|
3459
3461
|
value ?? (value = _normalized.value);
|
|
3460
|
-
const
|
|
3461
|
-
if (!isObject2(
|
|
3462
|
+
const input2 = payload.value;
|
|
3463
|
+
if (!isObject2(input2)) {
|
|
3462
3464
|
payload.issues.push({
|
|
3463
3465
|
expected: "object",
|
|
3464
3466
|
code: "invalid_type",
|
|
3465
|
-
input,
|
|
3467
|
+
input: input2,
|
|
3466
3468
|
inst
|
|
3467
3469
|
});
|
|
3468
3470
|
return payload;
|
|
@@ -3474,17 +3476,17 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
|
3474
3476
|
const el = shape[key];
|
|
3475
3477
|
const isOptionalIn = el._zod.optin === "optional";
|
|
3476
3478
|
const isOptionalOut = el._zod.optout === "optional";
|
|
3477
|
-
const r = el._zod.run({ value:
|
|
3479
|
+
const r = el._zod.run({ value: input2[key], issues: [] }, ctx);
|
|
3478
3480
|
if (r instanceof Promise) {
|
|
3479
|
-
proms.push(r.then((r2) => handlePropertyResult(r2, payload, key,
|
|
3481
|
+
proms.push(r.then((r2) => handlePropertyResult(r2, payload, key, input2, isOptionalIn, isOptionalOut)));
|
|
3480
3482
|
} else {
|
|
3481
|
-
handlePropertyResult(r, payload, key,
|
|
3483
|
+
handlePropertyResult(r, payload, key, input2, isOptionalIn, isOptionalOut);
|
|
3482
3484
|
}
|
|
3483
3485
|
}
|
|
3484
3486
|
if (!catchall) {
|
|
3485
3487
|
return proms.length ? Promise.all(proms).then(() => payload) : payload;
|
|
3486
3488
|
}
|
|
3487
|
-
return handleCatchall(proms,
|
|
3489
|
+
return handleCatchall(proms, input2, payload, ctx, _normalized.value, inst);
|
|
3488
3490
|
};
|
|
3489
3491
|
});
|
|
3490
3492
|
var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) => {
|
|
@@ -3593,12 +3595,12 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
|
|
|
3593
3595
|
let value;
|
|
3594
3596
|
inst._zod.parse = (payload, ctx) => {
|
|
3595
3597
|
value ?? (value = _normalized.value);
|
|
3596
|
-
const
|
|
3597
|
-
if (!isObject2(
|
|
3598
|
+
const input2 = payload.value;
|
|
3599
|
+
if (!isObject2(input2)) {
|
|
3598
3600
|
payload.issues.push({
|
|
3599
3601
|
expected: "object",
|
|
3600
3602
|
code: "invalid_type",
|
|
3601
|
-
input,
|
|
3603
|
+
input: input2,
|
|
3602
3604
|
inst
|
|
3603
3605
|
});
|
|
3604
3606
|
return payload;
|
|
@@ -3609,7 +3611,7 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
|
|
|
3609
3611
|
payload = fastpass(payload, ctx);
|
|
3610
3612
|
if (!catchall)
|
|
3611
3613
|
return payload;
|
|
3612
|
-
return handleCatchall([],
|
|
3614
|
+
return handleCatchall([], input2, payload, ctx, value, inst);
|
|
3613
3615
|
}
|
|
3614
3616
|
return superParse(payload, ctx);
|
|
3615
3617
|
};
|
|
@@ -3769,17 +3771,17 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
|
|
|
3769
3771
|
return map2;
|
|
3770
3772
|
});
|
|
3771
3773
|
inst._zod.parse = (payload, ctx) => {
|
|
3772
|
-
const
|
|
3773
|
-
if (!isObject(
|
|
3774
|
+
const input2 = payload.value;
|
|
3775
|
+
if (!isObject(input2)) {
|
|
3774
3776
|
payload.issues.push({
|
|
3775
3777
|
code: "invalid_type",
|
|
3776
3778
|
expected: "object",
|
|
3777
|
-
input,
|
|
3779
|
+
input: input2,
|
|
3778
3780
|
inst
|
|
3779
3781
|
});
|
|
3780
3782
|
return payload;
|
|
3781
3783
|
}
|
|
3782
|
-
const opt = disc.value.get(
|
|
3784
|
+
const opt = disc.value.get(input2?.[def.discriminator]);
|
|
3783
3785
|
if (opt) {
|
|
3784
3786
|
return opt._zod.run(payload, ctx);
|
|
3785
3787
|
}
|
|
@@ -3792,7 +3794,7 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
|
|
|
3792
3794
|
note: "No matching discriminator",
|
|
3793
3795
|
discriminator: def.discriminator,
|
|
3794
3796
|
options: Array.from(disc.value.keys()),
|
|
3795
|
-
input,
|
|
3797
|
+
input: input2,
|
|
3796
3798
|
path: [def.discriminator],
|
|
3797
3799
|
inst
|
|
3798
3800
|
});
|
|
@@ -3802,9 +3804,9 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
|
|
|
3802
3804
|
var $ZodIntersection = /* @__PURE__ */ $constructor("$ZodIntersection", (inst, def) => {
|
|
3803
3805
|
$ZodType.init(inst, def);
|
|
3804
3806
|
inst._zod.parse = (payload, ctx) => {
|
|
3805
|
-
const
|
|
3806
|
-
const left = def.left._zod.run({ value:
|
|
3807
|
-
const right = def.right._zod.run({ value:
|
|
3807
|
+
const input2 = payload.value;
|
|
3808
|
+
const left = def.left._zod.run({ value: input2, issues: [] }, ctx);
|
|
3809
|
+
const right = def.right._zod.run({ value: input2, issues: [] }, ctx);
|
|
3808
3810
|
const async = left instanceof Promise || right instanceof Promise;
|
|
3809
3811
|
if (async) {
|
|
3810
3812
|
return Promise.all([left, right]).then(([left2, right2]) => {
|
|
@@ -3901,10 +3903,10 @@ var $ZodTuple = /* @__PURE__ */ $constructor("$ZodTuple", (inst, def) => {
|
|
|
3901
3903
|
$ZodType.init(inst, def);
|
|
3902
3904
|
const items = def.items;
|
|
3903
3905
|
inst._zod.parse = (payload, ctx) => {
|
|
3904
|
-
const
|
|
3905
|
-
if (!Array.isArray(
|
|
3906
|
+
const input2 = payload.value;
|
|
3907
|
+
if (!Array.isArray(input2)) {
|
|
3906
3908
|
payload.issues.push({
|
|
3907
|
-
input,
|
|
3909
|
+
input: input2,
|
|
3908
3910
|
inst,
|
|
3909
3911
|
expected: "tuple",
|
|
3910
3912
|
code: "invalid_type"
|
|
@@ -3916,23 +3918,23 @@ var $ZodTuple = /* @__PURE__ */ $constructor("$ZodTuple", (inst, def) => {
|
|
|
3916
3918
|
const optinStart = getTupleOptStart(items, "optin");
|
|
3917
3919
|
const optoutStart = getTupleOptStart(items, "optout");
|
|
3918
3920
|
if (!def.rest) {
|
|
3919
|
-
if (
|
|
3921
|
+
if (input2.length < optinStart) {
|
|
3920
3922
|
payload.issues.push({
|
|
3921
3923
|
code: "too_small",
|
|
3922
3924
|
minimum: optinStart,
|
|
3923
3925
|
inclusive: true,
|
|
3924
|
-
input,
|
|
3926
|
+
input: input2,
|
|
3925
3927
|
inst,
|
|
3926
3928
|
origin: "array"
|
|
3927
3929
|
});
|
|
3928
3930
|
return payload;
|
|
3929
3931
|
}
|
|
3930
|
-
if (
|
|
3932
|
+
if (input2.length > items.length) {
|
|
3931
3933
|
payload.issues.push({
|
|
3932
3934
|
code: "too_big",
|
|
3933
3935
|
maximum: items.length,
|
|
3934
3936
|
inclusive: true,
|
|
3935
|
-
input,
|
|
3937
|
+
input: input2,
|
|
3936
3938
|
inst,
|
|
3937
3939
|
origin: "array"
|
|
3938
3940
|
});
|
|
@@ -3940,7 +3942,7 @@ var $ZodTuple = /* @__PURE__ */ $constructor("$ZodTuple", (inst, def) => {
|
|
|
3940
3942
|
}
|
|
3941
3943
|
const itemResults = new Array(items.length);
|
|
3942
3944
|
for (let i = 0; i < items.length; i++) {
|
|
3943
|
-
const r = items[i]._zod.run({ value:
|
|
3945
|
+
const r = items[i]._zod.run({ value: input2[i], issues: [] }, ctx);
|
|
3944
3946
|
if (r instanceof Promise) {
|
|
3945
3947
|
proms.push(r.then((rr) => {
|
|
3946
3948
|
itemResults[i] = rr;
|
|
@@ -3951,7 +3953,7 @@ var $ZodTuple = /* @__PURE__ */ $constructor("$ZodTuple", (inst, def) => {
|
|
|
3951
3953
|
}
|
|
3952
3954
|
if (def.rest) {
|
|
3953
3955
|
let i = items.length - 1;
|
|
3954
|
-
const rest =
|
|
3956
|
+
const rest = input2.slice(items.length);
|
|
3955
3957
|
for (const el of rest) {
|
|
3956
3958
|
i++;
|
|
3957
3959
|
const result = def.rest._zod.run({ value: el, issues: [] }, ctx);
|
|
@@ -3963,9 +3965,9 @@ var $ZodTuple = /* @__PURE__ */ $constructor("$ZodTuple", (inst, def) => {
|
|
|
3963
3965
|
}
|
|
3964
3966
|
}
|
|
3965
3967
|
if (proms.length) {
|
|
3966
|
-
return Promise.all(proms).then(() => handleTupleResults(itemResults, payload, items,
|
|
3968
|
+
return Promise.all(proms).then(() => handleTupleResults(itemResults, payload, items, input2, optoutStart));
|
|
3967
3969
|
}
|
|
3968
|
-
return handleTupleResults(itemResults, payload, items,
|
|
3970
|
+
return handleTupleResults(itemResults, payload, items, input2, optoutStart);
|
|
3969
3971
|
};
|
|
3970
3972
|
});
|
|
3971
3973
|
function getTupleOptStart(items, key) {
|
|
@@ -3981,10 +3983,10 @@ function handleTupleResult(result, final, index) {
|
|
|
3981
3983
|
}
|
|
3982
3984
|
final.value[index] = result.value;
|
|
3983
3985
|
}
|
|
3984
|
-
function handleTupleResults(itemResults, final, items,
|
|
3986
|
+
function handleTupleResults(itemResults, final, items, input2, optoutStart) {
|
|
3985
3987
|
for (let i = 0; i < items.length; i++) {
|
|
3986
3988
|
const r = itemResults[i];
|
|
3987
|
-
const isPresent = i <
|
|
3989
|
+
const isPresent = i < input2.length;
|
|
3988
3990
|
if (r.issues.length) {
|
|
3989
3991
|
if (!isPresent && i >= optoutStart) {
|
|
3990
3992
|
final.value.length = i;
|
|
@@ -3994,7 +3996,7 @@ function handleTupleResults(itemResults, final, items, input, optoutStart) {
|
|
|
3994
3996
|
}
|
|
3995
3997
|
final.value[i] = r.value;
|
|
3996
3998
|
}
|
|
3997
|
-
for (let i = final.value.length - 1; i >=
|
|
3999
|
+
for (let i = final.value.length - 1; i >= input2.length; i--) {
|
|
3998
4000
|
if (items[i]._zod.optout === "optional" && final.value[i] === void 0) {
|
|
3999
4001
|
final.value.length = i;
|
|
4000
4002
|
} else {
|
|
@@ -4006,12 +4008,12 @@ function handleTupleResults(itemResults, final, items, input, optoutStart) {
|
|
|
4006
4008
|
var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
4007
4009
|
$ZodType.init(inst, def);
|
|
4008
4010
|
inst._zod.parse = (payload, ctx) => {
|
|
4009
|
-
const
|
|
4010
|
-
if (!isPlainObject(
|
|
4011
|
+
const input2 = payload.value;
|
|
4012
|
+
if (!isPlainObject(input2)) {
|
|
4011
4013
|
payload.issues.push({
|
|
4012
4014
|
expected: "record",
|
|
4013
4015
|
code: "invalid_type",
|
|
4014
|
-
input,
|
|
4016
|
+
input: input2,
|
|
4015
4017
|
inst
|
|
4016
4018
|
});
|
|
4017
4019
|
return payload;
|
|
@@ -4040,7 +4042,7 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
4040
4042
|
continue;
|
|
4041
4043
|
}
|
|
4042
4044
|
const outKey = keyResult.value;
|
|
4043
|
-
const result = def.valueType._zod.run({ value:
|
|
4045
|
+
const result = def.valueType._zod.run({ value: input2[key], issues: [] }, ctx);
|
|
4044
4046
|
if (result instanceof Promise) {
|
|
4045
4047
|
proms.push(result.then((result2) => {
|
|
4046
4048
|
if (result2.issues.length) {
|
|
@@ -4057,7 +4059,7 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
4057
4059
|
}
|
|
4058
4060
|
}
|
|
4059
4061
|
let unrecognized;
|
|
4060
|
-
for (const key in
|
|
4062
|
+
for (const key in input2) {
|
|
4061
4063
|
if (!recordKeys.has(key)) {
|
|
4062
4064
|
unrecognized = unrecognized ?? [];
|
|
4063
4065
|
unrecognized.push(key);
|
|
@@ -4066,17 +4068,17 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
4066
4068
|
if (unrecognized && unrecognized.length > 0) {
|
|
4067
4069
|
payload.issues.push({
|
|
4068
4070
|
code: "unrecognized_keys",
|
|
4069
|
-
input,
|
|
4071
|
+
input: input2,
|
|
4070
4072
|
inst,
|
|
4071
4073
|
keys: unrecognized
|
|
4072
4074
|
});
|
|
4073
4075
|
}
|
|
4074
4076
|
} else {
|
|
4075
4077
|
payload.value = {};
|
|
4076
|
-
for (const key of Reflect.ownKeys(
|
|
4078
|
+
for (const key of Reflect.ownKeys(input2)) {
|
|
4077
4079
|
if (key === "__proto__")
|
|
4078
4080
|
continue;
|
|
4079
|
-
if (!Object.prototype.propertyIsEnumerable.call(
|
|
4081
|
+
if (!Object.prototype.propertyIsEnumerable.call(input2, key))
|
|
4080
4082
|
continue;
|
|
4081
4083
|
let keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);
|
|
4082
4084
|
if (keyResult instanceof Promise) {
|
|
@@ -4094,7 +4096,7 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
4094
4096
|
}
|
|
4095
4097
|
if (keyResult.issues.length) {
|
|
4096
4098
|
if (def.mode === "loose") {
|
|
4097
|
-
payload.value[key] =
|
|
4099
|
+
payload.value[key] = input2[key];
|
|
4098
4100
|
} else {
|
|
4099
4101
|
payload.issues.push({
|
|
4100
4102
|
code: "invalid_key",
|
|
@@ -4107,7 +4109,7 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
4107
4109
|
}
|
|
4108
4110
|
continue;
|
|
4109
4111
|
}
|
|
4110
|
-
const result = def.valueType._zod.run({ value:
|
|
4112
|
+
const result = def.valueType._zod.run({ value: input2[key], issues: [] }, ctx);
|
|
4111
4113
|
if (result instanceof Promise) {
|
|
4112
4114
|
proms.push(result.then((result2) => {
|
|
4113
4115
|
if (result2.issues.length) {
|
|
@@ -4132,27 +4134,27 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
4132
4134
|
var $ZodMap = /* @__PURE__ */ $constructor("$ZodMap", (inst, def) => {
|
|
4133
4135
|
$ZodType.init(inst, def);
|
|
4134
4136
|
inst._zod.parse = (payload, ctx) => {
|
|
4135
|
-
const
|
|
4136
|
-
if (!(
|
|
4137
|
+
const input2 = payload.value;
|
|
4138
|
+
if (!(input2 instanceof Map)) {
|
|
4137
4139
|
payload.issues.push({
|
|
4138
4140
|
expected: "map",
|
|
4139
4141
|
code: "invalid_type",
|
|
4140
|
-
input,
|
|
4142
|
+
input: input2,
|
|
4141
4143
|
inst
|
|
4142
4144
|
});
|
|
4143
4145
|
return payload;
|
|
4144
4146
|
}
|
|
4145
4147
|
const proms = [];
|
|
4146
4148
|
payload.value = /* @__PURE__ */ new Map();
|
|
4147
|
-
for (const [key, value] of
|
|
4149
|
+
for (const [key, value] of input2) {
|
|
4148
4150
|
const keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);
|
|
4149
4151
|
const valueResult = def.valueType._zod.run({ value, issues: [] }, ctx);
|
|
4150
4152
|
if (keyResult instanceof Promise || valueResult instanceof Promise) {
|
|
4151
4153
|
proms.push(Promise.all([keyResult, valueResult]).then(([keyResult2, valueResult2]) => {
|
|
4152
|
-
handleMapResult(keyResult2, valueResult2, payload, key,
|
|
4154
|
+
handleMapResult(keyResult2, valueResult2, payload, key, input2, inst, ctx);
|
|
4153
4155
|
}));
|
|
4154
4156
|
} else {
|
|
4155
|
-
handleMapResult(keyResult, valueResult, payload, key,
|
|
4157
|
+
handleMapResult(keyResult, valueResult, payload, key, input2, inst, ctx);
|
|
4156
4158
|
}
|
|
4157
4159
|
}
|
|
4158
4160
|
if (proms.length)
|
|
@@ -4160,7 +4162,7 @@ var $ZodMap = /* @__PURE__ */ $constructor("$ZodMap", (inst, def) => {
|
|
|
4160
4162
|
return payload;
|
|
4161
4163
|
};
|
|
4162
4164
|
});
|
|
4163
|
-
function handleMapResult(keyResult, valueResult, final, key,
|
|
4165
|
+
function handleMapResult(keyResult, valueResult, final, key, input2, inst, ctx) {
|
|
4164
4166
|
if (keyResult.issues.length) {
|
|
4165
4167
|
if (propertyKeyTypes.has(typeof key)) {
|
|
4166
4168
|
final.issues.push(...prefixIssues(key, keyResult.issues));
|
|
@@ -4168,7 +4170,7 @@ function handleMapResult(keyResult, valueResult, final, key, input, inst, ctx) {
|
|
|
4168
4170
|
final.issues.push({
|
|
4169
4171
|
code: "invalid_key",
|
|
4170
4172
|
origin: "map",
|
|
4171
|
-
input,
|
|
4173
|
+
input: input2,
|
|
4172
4174
|
inst,
|
|
4173
4175
|
issues: keyResult.issues.map((iss) => finalizeIssue(iss, ctx, config()))
|
|
4174
4176
|
});
|
|
@@ -4181,7 +4183,7 @@ function handleMapResult(keyResult, valueResult, final, key, input, inst, ctx) {
|
|
|
4181
4183
|
final.issues.push({
|
|
4182
4184
|
origin: "map",
|
|
4183
4185
|
code: "invalid_element",
|
|
4184
|
-
input,
|
|
4186
|
+
input: input2,
|
|
4185
4187
|
inst,
|
|
4186
4188
|
key,
|
|
4187
4189
|
issues: valueResult.issues.map((iss) => finalizeIssue(iss, ctx, config()))
|
|
@@ -4193,10 +4195,10 @@ function handleMapResult(keyResult, valueResult, final, key, input, inst, ctx) {
|
|
|
4193
4195
|
var $ZodSet = /* @__PURE__ */ $constructor("$ZodSet", (inst, def) => {
|
|
4194
4196
|
$ZodType.init(inst, def);
|
|
4195
4197
|
inst._zod.parse = (payload, ctx) => {
|
|
4196
|
-
const
|
|
4197
|
-
if (!(
|
|
4198
|
+
const input2 = payload.value;
|
|
4199
|
+
if (!(input2 instanceof Set)) {
|
|
4198
4200
|
payload.issues.push({
|
|
4199
|
-
input,
|
|
4201
|
+
input: input2,
|
|
4200
4202
|
inst,
|
|
4201
4203
|
expected: "set",
|
|
4202
4204
|
code: "invalid_type"
|
|
@@ -4205,7 +4207,7 @@ var $ZodSet = /* @__PURE__ */ $constructor("$ZodSet", (inst, def) => {
|
|
|
4205
4207
|
}
|
|
4206
4208
|
const proms = [];
|
|
4207
4209
|
payload.value = /* @__PURE__ */ new Set();
|
|
4208
|
-
for (const item of
|
|
4210
|
+
for (const item of input2) {
|
|
4209
4211
|
const result = def.valueType._zod.run({ value: item, issues: [] }, ctx);
|
|
4210
4212
|
if (result instanceof Promise) {
|
|
4211
4213
|
proms.push(result.then((result2) => handleSetResult(result2, payload)));
|
|
@@ -4230,14 +4232,14 @@ var $ZodEnum = /* @__PURE__ */ $constructor("$ZodEnum", (inst, def) => {
|
|
|
4230
4232
|
inst._zod.values = valuesSet;
|
|
4231
4233
|
inst._zod.pattern = new RegExp(`^(${values.filter((k) => propertyKeyTypes.has(typeof k)).map((o) => typeof o === "string" ? escapeRegex(o) : o.toString()).join("|")})$`);
|
|
4232
4234
|
inst._zod.parse = (payload, _ctx) => {
|
|
4233
|
-
const
|
|
4234
|
-
if (valuesSet.has(
|
|
4235
|
+
const input2 = payload.value;
|
|
4236
|
+
if (valuesSet.has(input2)) {
|
|
4235
4237
|
return payload;
|
|
4236
4238
|
}
|
|
4237
4239
|
payload.issues.push({
|
|
4238
4240
|
code: "invalid_value",
|
|
4239
4241
|
values,
|
|
4240
|
-
input,
|
|
4242
|
+
input: input2,
|
|
4241
4243
|
inst
|
|
4242
4244
|
});
|
|
4243
4245
|
return payload;
|
|
@@ -4252,14 +4254,14 @@ var $ZodLiteral = /* @__PURE__ */ $constructor("$ZodLiteral", (inst, def) => {
|
|
|
4252
4254
|
inst._zod.values = values;
|
|
4253
4255
|
inst._zod.pattern = new RegExp(`^(${def.values.map((o) => typeof o === "string" ? escapeRegex(o) : o ? escapeRegex(o.toString()) : String(o)).join("|")})$`);
|
|
4254
4256
|
inst._zod.parse = (payload, _ctx) => {
|
|
4255
|
-
const
|
|
4256
|
-
if (values.has(
|
|
4257
|
+
const input2 = payload.value;
|
|
4258
|
+
if (values.has(input2)) {
|
|
4257
4259
|
return payload;
|
|
4258
4260
|
}
|
|
4259
4261
|
payload.issues.push({
|
|
4260
4262
|
code: "invalid_value",
|
|
4261
4263
|
values: def.values,
|
|
4262
|
-
input,
|
|
4264
|
+
input: input2,
|
|
4263
4265
|
inst
|
|
4264
4266
|
});
|
|
4265
4267
|
return payload;
|
|
@@ -4268,13 +4270,13 @@ var $ZodLiteral = /* @__PURE__ */ $constructor("$ZodLiteral", (inst, def) => {
|
|
|
4268
4270
|
var $ZodFile = /* @__PURE__ */ $constructor("$ZodFile", (inst, def) => {
|
|
4269
4271
|
$ZodType.init(inst, def);
|
|
4270
4272
|
inst._zod.parse = (payload, _ctx) => {
|
|
4271
|
-
const
|
|
4272
|
-
if (
|
|
4273
|
+
const input2 = payload.value;
|
|
4274
|
+
if (input2 instanceof File)
|
|
4273
4275
|
return payload;
|
|
4274
4276
|
payload.issues.push({
|
|
4275
4277
|
expected: "file",
|
|
4276
4278
|
code: "invalid_type",
|
|
4277
|
-
input,
|
|
4279
|
+
input: input2,
|
|
4278
4280
|
inst
|
|
4279
4281
|
});
|
|
4280
4282
|
return payload;
|
|
@@ -4304,8 +4306,8 @@ var $ZodTransform = /* @__PURE__ */ $constructor("$ZodTransform", (inst, def) =>
|
|
|
4304
4306
|
return payload;
|
|
4305
4307
|
};
|
|
4306
4308
|
});
|
|
4307
|
-
function handleOptionalResult(result,
|
|
4308
|
-
if (
|
|
4309
|
+
function handleOptionalResult(result, input2) {
|
|
4310
|
+
if (input2 === void 0 && (result.issues.length || result.fallback)) {
|
|
4309
4311
|
return { issues: [], value: void 0 };
|
|
4310
4312
|
}
|
|
4311
4313
|
return result;
|
|
@@ -4323,11 +4325,11 @@ var $ZodOptional = /* @__PURE__ */ $constructor("$ZodOptional", (inst, def) => {
|
|
|
4323
4325
|
});
|
|
4324
4326
|
inst._zod.parse = (payload, ctx) => {
|
|
4325
4327
|
if (def.innerType._zod.optin === "optional") {
|
|
4326
|
-
const
|
|
4328
|
+
const input2 = payload.value;
|
|
4327
4329
|
const result = def.innerType._zod.run(payload, ctx);
|
|
4328
4330
|
if (result instanceof Promise)
|
|
4329
|
-
return result.then((r) => handleOptionalResult(r,
|
|
4330
|
-
return handleOptionalResult(result,
|
|
4331
|
+
return result.then((r) => handleOptionalResult(r, input2));
|
|
4332
|
+
return handleOptionalResult(result, input2);
|
|
4331
4333
|
}
|
|
4332
4334
|
if (payload.value === void 0) {
|
|
4333
4335
|
return payload;
|
|
@@ -4752,20 +4754,20 @@ var $ZodCustom = /* @__PURE__ */ $constructor("$ZodCustom", (inst, def) => {
|
|
|
4752
4754
|
return payload;
|
|
4753
4755
|
};
|
|
4754
4756
|
inst._zod.check = (payload) => {
|
|
4755
|
-
const
|
|
4756
|
-
const r = def.fn(
|
|
4757
|
+
const input2 = payload.value;
|
|
4758
|
+
const r = def.fn(input2);
|
|
4757
4759
|
if (r instanceof Promise) {
|
|
4758
|
-
return r.then((r2) => handleRefineResult(r2, payload,
|
|
4760
|
+
return r.then((r2) => handleRefineResult(r2, payload, input2, inst));
|
|
4759
4761
|
}
|
|
4760
|
-
handleRefineResult(r, payload,
|
|
4762
|
+
handleRefineResult(r, payload, input2, inst);
|
|
4761
4763
|
return;
|
|
4762
4764
|
};
|
|
4763
4765
|
});
|
|
4764
|
-
function handleRefineResult(result, payload,
|
|
4766
|
+
function handleRefineResult(result, payload, input2, inst) {
|
|
4765
4767
|
if (!result) {
|
|
4766
4768
|
const _iss = {
|
|
4767
4769
|
code: "custom",
|
|
4768
|
-
input,
|
|
4770
|
+
input: input2,
|
|
4769
4771
|
inst,
|
|
4770
4772
|
// incorporates params.error into issue reporting
|
|
4771
4773
|
path: [...inst._zod.def.path ?? []],
|
|
@@ -8052,8 +8054,8 @@ function ko_default() {
|
|
|
8052
8054
|
}
|
|
8053
8055
|
|
|
8054
8056
|
// ../../../node_modules/zod/v4/locales/lt.js
|
|
8055
|
-
var capitalizeFirstCharacter = (
|
|
8056
|
-
return
|
|
8057
|
+
var capitalizeFirstCharacter = (text3) => {
|
|
8058
|
+
return text3.charAt(0).toUpperCase() + text3.slice(1);
|
|
8057
8059
|
};
|
|
8058
8060
|
function getUnitTypeFromNumber(number4) {
|
|
8059
8061
|
const abs = Math.abs(number4);
|
|
@@ -11453,23 +11455,23 @@ function _overwrite(tx) {
|
|
|
11453
11455
|
}
|
|
11454
11456
|
// @__NO_SIDE_EFFECTS__
|
|
11455
11457
|
function _normalize(form) {
|
|
11456
|
-
return /* @__PURE__ */ _overwrite((
|
|
11458
|
+
return /* @__PURE__ */ _overwrite((input2) => input2.normalize(form));
|
|
11457
11459
|
}
|
|
11458
11460
|
// @__NO_SIDE_EFFECTS__
|
|
11459
11461
|
function _trim() {
|
|
11460
|
-
return /* @__PURE__ */ _overwrite((
|
|
11462
|
+
return /* @__PURE__ */ _overwrite((input2) => input2.trim());
|
|
11461
11463
|
}
|
|
11462
11464
|
// @__NO_SIDE_EFFECTS__
|
|
11463
11465
|
function _toLowerCase() {
|
|
11464
|
-
return /* @__PURE__ */ _overwrite((
|
|
11466
|
+
return /* @__PURE__ */ _overwrite((input2) => input2.toLowerCase());
|
|
11465
11467
|
}
|
|
11466
11468
|
// @__NO_SIDE_EFFECTS__
|
|
11467
11469
|
function _toUpperCase() {
|
|
11468
|
-
return /* @__PURE__ */ _overwrite((
|
|
11470
|
+
return /* @__PURE__ */ _overwrite((input2) => input2.toUpperCase());
|
|
11469
11471
|
}
|
|
11470
11472
|
// @__NO_SIDE_EFFECTS__
|
|
11471
11473
|
function _slugify() {
|
|
11472
|
-
return /* @__PURE__ */ _overwrite((
|
|
11474
|
+
return /* @__PURE__ */ _overwrite((input2) => slugify(input2));
|
|
11473
11475
|
}
|
|
11474
11476
|
// @__NO_SIDE_EFFECTS__
|
|
11475
11477
|
function _array(Class2, element, params) {
|
|
@@ -11774,8 +11776,8 @@ function _stringbool(Classes, _params) {
|
|
|
11774
11776
|
type: "pipe",
|
|
11775
11777
|
in: stringSchema,
|
|
11776
11778
|
out: booleanSchema,
|
|
11777
|
-
transform: ((
|
|
11778
|
-
let data =
|
|
11779
|
+
transform: ((input2, payload) => {
|
|
11780
|
+
let data = input2;
|
|
11779
11781
|
if (params.case !== "sensitive")
|
|
11780
11782
|
data = data.toLowerCase();
|
|
11781
11783
|
if (truthySet.has(data)) {
|
|
@@ -11794,8 +11796,8 @@ function _stringbool(Classes, _params) {
|
|
|
11794
11796
|
return {};
|
|
11795
11797
|
}
|
|
11796
11798
|
}),
|
|
11797
|
-
reverseTransform: ((
|
|
11798
|
-
if (
|
|
11799
|
+
reverseTransform: ((input2, _payload) => {
|
|
11800
|
+
if (input2 === true) {
|
|
11799
11801
|
return truthyArray[0] || "true";
|
|
11800
11802
|
} else {
|
|
11801
11803
|
return falsyArray[0] || "false";
|
|
@@ -12691,9 +12693,9 @@ var allProcessors = {
|
|
|
12691
12693
|
optional: optionalProcessor,
|
|
12692
12694
|
lazy: lazyProcessor
|
|
12693
12695
|
};
|
|
12694
|
-
function toJSONSchema(
|
|
12695
|
-
if ("_idmap" in
|
|
12696
|
-
const registry2 =
|
|
12696
|
+
function toJSONSchema(input2, params) {
|
|
12697
|
+
if ("_idmap" in input2) {
|
|
12698
|
+
const registry2 = input2;
|
|
12697
12699
|
const ctx2 = initializeContext({ ...params, processors: allProcessors });
|
|
12698
12700
|
const defs = {};
|
|
12699
12701
|
for (const entry of registry2._idmap.entries()) {
|
|
@@ -12721,9 +12723,9 @@ function toJSONSchema(input, params) {
|
|
|
12721
12723
|
return { schemas };
|
|
12722
12724
|
}
|
|
12723
12725
|
const ctx = initializeContext({ ...params, processors: allProcessors });
|
|
12724
|
-
process2(
|
|
12725
|
-
extractDefs(ctx,
|
|
12726
|
-
return finalize(ctx,
|
|
12726
|
+
process2(input2, ctx);
|
|
12727
|
+
extractDefs(ctx, input2);
|
|
12728
|
+
return finalize(ctx, input2);
|
|
12727
12729
|
}
|
|
12728
12730
|
|
|
12729
12731
|
// ../../../node_modules/zod/v4/core/json-schema-generator.js
|
|
@@ -15000,7 +15002,7 @@ var codexhostErrorSchema = external_exports.strictObject({
|
|
|
15000
15002
|
|
|
15001
15003
|
// ../../shared-contracts/dist/harness-presentation.js
|
|
15002
15004
|
var localeSchema = external_exports.string().max(64).regex(/^[a-z]{2,3}(?:-[A-Za-z0-9]{2,8})*$/u);
|
|
15003
|
-
var displayText = (maximum) => external_exports.string().min(1).max(maximum).refine((
|
|
15005
|
+
var displayText = (maximum) => external_exports.string().min(1).max(maximum).refine((text3) => text3.trim().length > 0);
|
|
15004
15006
|
var harnessLocalizationsSchema = external_exports.record(localeSchema, external_exports.object({
|
|
15005
15007
|
label: displayText(256).optional(),
|
|
15006
15008
|
description: displayText(1024).optional()
|
|
@@ -15089,7 +15091,7 @@ var usageMeasurementsSchema = external_exports.object({
|
|
|
15089
15091
|
outputTokensPerSecond: usageMeasurementSchema.refine((value) => value.version === 4).optional().catch(void 0),
|
|
15090
15092
|
timeToFirstOutputMs: usageMeasurementSchema.extend({ value: nonNegativeSafeIntegerSchema }).optional()
|
|
15091
15093
|
}).strict();
|
|
15092
|
-
var indicatorTextSchema = (maximum) => harnessLocalizedTextSchema.refine((entries) => Object.values(entries).every((
|
|
15094
|
+
var indicatorTextSchema = (maximum) => harnessLocalizedTextSchema.refine((entries) => Object.values(entries).every((text3) => text3.length <= maximum));
|
|
15093
15095
|
var composerIndicatorsSchema = external_exports.array(external_exports.object({
|
|
15094
15096
|
kind: external_exports.literal("countdown"),
|
|
15095
15097
|
id: external_exports.string().min(1).max(64),
|
|
@@ -15472,6 +15474,8 @@ var externalThreadInspectionSchema = external_exports.object({
|
|
|
15472
15474
|
effectiveThinkingOptionId: harnessThinkingOptionIdSchema.optional(),
|
|
15473
15475
|
availableThinkingOptions: harnessThinkingOptionsSchema.optional(),
|
|
15474
15476
|
effectivePermissionModeId: harnessPermissionModeIdSchema.optional(),
|
|
15477
|
+
/** Live Session catalog when it, not the Adapter inspection, contains `effectiveModel`. */
|
|
15478
|
+
catalog: harnessModelCatalogSchema.optional(),
|
|
15475
15479
|
history: harnessHistoryCapabilitiesSchema,
|
|
15476
15480
|
usage: threadUsageSnapshotSchema.optional(),
|
|
15477
15481
|
locked: external_exports.literal(true)
|
|
@@ -15530,9 +15534,9 @@ var threadSteeringInspectParamsSchema = external_exports.object({
|
|
|
15530
15534
|
}).strict();
|
|
15531
15535
|
var threadSteeringContextSchema = external_exports.object({
|
|
15532
15536
|
kind: external_exports.literal("application"),
|
|
15533
|
-
value: external_exports.string().transform((
|
|
15537
|
+
value: external_exports.string().transform((text3, context) => {
|
|
15534
15538
|
try {
|
|
15535
|
-
return JSON.parse(
|
|
15539
|
+
return JSON.parse(text3);
|
|
15536
15540
|
} catch {
|
|
15537
15541
|
context.addIssue({ code: "custom", message: "Invalid steering context JSON" });
|
|
15538
15542
|
return external_exports.NEVER;
|
|
@@ -15667,8 +15671,8 @@ var desktopExtensionHttpUrlSchema = external_exports.string().trim().max(2048).r
|
|
|
15667
15671
|
const { username, password } = new URL(value);
|
|
15668
15672
|
return !username && !password && !/[\\\s]/u.test(value);
|
|
15669
15673
|
}, "URL must not contain credentials, backslashes, or whitespace");
|
|
15670
|
-
function localizedText(
|
|
15671
|
-
return external_exports.strictObject({ en:
|
|
15674
|
+
function localizedText(text3) {
|
|
15675
|
+
return external_exports.strictObject({ en: text3, "zh-CN": text3 });
|
|
15672
15676
|
}
|
|
15673
15677
|
var desktopExtensionLocalizedTextSchema = localizedText(external_exports.string().trim().min(1));
|
|
15674
15678
|
var categoriesSchema = external_exports.array(desktopExtensionCategorySchema).max(desktopExtensionCategorySchema.options.length).refine((categories) => new Set(categories).size === categories.length, "Duplicate categories");
|
|
@@ -15785,8 +15789,8 @@ var desktopExtensionTrustTierSchema = external_exports.enum(["official", "commun
|
|
|
15785
15789
|
function isGitHubDesktopExtensionZipballUrl(url2) {
|
|
15786
15790
|
return url2.origin === "https://api.github.com" && /^\/repos\/[\w-]+\/[\w.-]+\/zipball(?:\/[^/]+)?\/?$/u.test(url2.pathname);
|
|
15787
15791
|
}
|
|
15788
|
-
var desktopExtensionZipUrlSchema = desktopExtensionHttpUrlSchema.refine((
|
|
15789
|
-
const url2 = new URL(
|
|
15792
|
+
var desktopExtensionZipUrlSchema = desktopExtensionHttpUrlSchema.refine((input2) => {
|
|
15793
|
+
const url2 = new URL(input2);
|
|
15790
15794
|
return /\.zip$/iu.test(url2.pathname) || isGitHubDesktopExtensionZipballUrl(url2) || url2.origin === "https://github.com" && /^\/[\w-]+\/[\w.-]+\/zipball(?:\/.+)?\/?$/u.test(url2.pathname) || url2.origin === "https://codeload.github.com" && /^\/[\w-]+\/[\w.-]+\/(?:zip|zipball|legacy\.zip)\/.+$/u.test(url2.pathname);
|
|
15791
15795
|
}, "Expected a .zip download URL or a GitHub zipball URL");
|
|
15792
15796
|
var desktopExtensionCatalogEntrySchema = external_exports.strictObject({
|
|
@@ -16137,6 +16141,8 @@ var CLIENT_CHANNEL_METHODS = [
|
|
|
16137
16141
|
"codexhost/workspace/read",
|
|
16138
16142
|
"codexhost/thread/tree/read",
|
|
16139
16143
|
"codexhost/thread/pins/list",
|
|
16144
|
+
"codexhost/thread/sections/list",
|
|
16145
|
+
"codexhost/thread/sections/move",
|
|
16140
16146
|
"codexhost/thread/pins/set",
|
|
16141
16147
|
"codexhost/harness/plugins/list",
|
|
16142
16148
|
"codexhost/harness/inspect",
|
|
@@ -16175,8 +16181,21 @@ var CLIENT_CHANNEL_METHODS = [
|
|
|
16175
16181
|
"codexhost/update/check",
|
|
16176
16182
|
"codexhost/update/start",
|
|
16177
16183
|
"codexhost/update/status",
|
|
16184
|
+
"codexhost/announcement/get",
|
|
16185
|
+
"codexhost/announcement/acknowledge",
|
|
16178
16186
|
"codexhost/sessions/loaded/list"
|
|
16179
16187
|
];
|
|
16188
|
+
var clientThreadSectionsSchema = external_exports.object({
|
|
16189
|
+
sections: external_exports.array(external_exports.object({
|
|
16190
|
+
id: external_exports.string().min(1),
|
|
16191
|
+
name: external_exports.string().min(1),
|
|
16192
|
+
threads: external_exports.array(jsonObjectSchema)
|
|
16193
|
+
}).strict())
|
|
16194
|
+
}).strict();
|
|
16195
|
+
var clientThreadSectionMoveSchema = external_exports.object({
|
|
16196
|
+
threadId: external_exports.string().min(1).max(1024),
|
|
16197
|
+
sectionId: external_exports.string().min(1).max(1024).nullable()
|
|
16198
|
+
}).strict();
|
|
16180
16199
|
var clientThreadPinsSchema = external_exports.object({ threadIds: external_exports.array(external_exports.string().min(1)) }).strict();
|
|
16181
16200
|
var clientThreadPinParamsSchema = external_exports.object({ threadId: external_exports.string().min(1).max(1024), pinned: external_exports.boolean() }).strict();
|
|
16182
16201
|
var clientThreadTreeReadParamsSchema = external_exports.object({}).strict();
|
|
@@ -16718,8 +16737,8 @@ var harnessPreferencePatchSchema = external_exports.strictObject({
|
|
|
16718
16737
|
operations: external_exports.array(harnessPreferenceOperationSchema).min(1).max(256),
|
|
16719
16738
|
initializeOnly: external_exports.boolean().optional(),
|
|
16720
16739
|
expectedRevision: external_exports.number().int().nonnegative().optional()
|
|
16721
|
-
}).superRefine((
|
|
16722
|
-
for (const operation of
|
|
16740
|
+
}).superRefine((input2, ctx) => {
|
|
16741
|
+
for (const operation of input2.operations) {
|
|
16723
16742
|
if (operation.kind === "newThread" && (!operation.lastHarness && !operation.configuration || Boolean(operation.harnessId) !== Boolean(operation.configuration)))
|
|
16724
16743
|
ctx.addIssue({
|
|
16725
16744
|
code: "custom",
|
|
@@ -17121,13 +17140,18 @@ var harnessLaunchSettingsSchema = external_exports.object({
|
|
|
17121
17140
|
// ../../shared-contracts/dist/harness-installation.js
|
|
17122
17141
|
var harnessInstallationParamsSchema = external_exports.object({
|
|
17123
17142
|
harnessId: harnessIdSchema,
|
|
17124
|
-
action: external_exports.enum(["check", "update", "install"])
|
|
17125
|
-
|
|
17143
|
+
action: external_exports.enum(["check", "update", "install"]),
|
|
17144
|
+
confirmedVersion: external_exports.string().min(1).max(128).optional()
|
|
17145
|
+
}).strict().refine(({ action, confirmedVersion }) => action === "update" || confirmedVersion === void 0);
|
|
17126
17146
|
var harnessInstallationStateSchema = external_exports.object({
|
|
17127
17147
|
currentVersion: external_exports.string().min(1).max(128),
|
|
17128
17148
|
latestVersion: external_exports.string().min(1).max(128),
|
|
17129
17149
|
updateAvailable: external_exports.boolean(),
|
|
17130
17150
|
canUpdate: external_exports.boolean(),
|
|
17151
|
+
/** Present when the Adapter has a verified list and the available target is outside it. */
|
|
17152
|
+
latestVerifiedVersion: external_exports.string().min(1).max(128).optional(),
|
|
17153
|
+
/** Update preflight stopped before running the installer; latestVersion needs confirmation. */
|
|
17154
|
+
confirmationRequired: external_exports.literal(true).optional(),
|
|
17131
17155
|
/** Defaults to CLI; some Harnesses ship only inside a desktop application. */
|
|
17132
17156
|
versionKind: external_exports.enum(["cli", "application"]).optional(),
|
|
17133
17157
|
/** Official download opened by the user; does not imply an automatic installation. */
|
|
@@ -17457,6 +17481,38 @@ var updateStatusResultSchema = external_exports.strictObject({
|
|
|
17457
17481
|
status: updateStatusSchema.nullable()
|
|
17458
17482
|
});
|
|
17459
17483
|
|
|
17484
|
+
// ../../shared-contracts/dist/release-announcement.js
|
|
17485
|
+
var RELEASE_ANNOUNCEMENT_MAX_THEMES = 12;
|
|
17486
|
+
var releaseAnnouncementThemeSchema = external_exports.strictObject({
|
|
17487
|
+
icon: external_exports.string().min(1).max(16).optional(),
|
|
17488
|
+
title: external_exports.string().min(1).max(120),
|
|
17489
|
+
body: external_exports.string().min(1).max(1200),
|
|
17490
|
+
contributors: external_exports.array(external_exports.string().min(1).max(39)).max(30)
|
|
17491
|
+
});
|
|
17492
|
+
var releaseAnnouncementContentSchema = external_exports.strictObject({
|
|
17493
|
+
summary: external_exports.string().min(1).max(600).optional(),
|
|
17494
|
+
themes: external_exports.array(releaseAnnouncementThemeSchema).min(1).max(RELEASE_ANNOUNCEMENT_MAX_THEMES)
|
|
17495
|
+
});
|
|
17496
|
+
var releaseAnnouncementSchema = external_exports.strictObject({
|
|
17497
|
+
version: updateSemanticVersionSchema,
|
|
17498
|
+
publishedAt: external_exports.iso.datetime(),
|
|
17499
|
+
url: external_exports.string().max(300).regex(/^https:\/\/github\.com\/BytePioneer-AI\/codex-host\/releases\/tag\/v[0-9A-Za-z.+-]+$/u),
|
|
17500
|
+
zh: releaseAnnouncementContentSchema.nullable(),
|
|
17501
|
+
en: releaseAnnouncementContentSchema.nullable()
|
|
17502
|
+
}).refine((value) => value.zh !== null || value.en !== null, {
|
|
17503
|
+
message: "an announcement needs at least one language"
|
|
17504
|
+
});
|
|
17505
|
+
var releaseAnnouncementGetParamsSchema = external_exports.strictObject({
|
|
17506
|
+
manual: external_exports.boolean().optional()
|
|
17507
|
+
});
|
|
17508
|
+
var releaseAnnouncementGetResultSchema = external_exports.strictObject({
|
|
17509
|
+
announcement: releaseAnnouncementSchema.nullable(),
|
|
17510
|
+
unread: external_exports.boolean()
|
|
17511
|
+
});
|
|
17512
|
+
var releaseAnnouncementAcknowledgeParamsSchema = external_exports.strictObject({
|
|
17513
|
+
version: updateSemanticVersionSchema
|
|
17514
|
+
});
|
|
17515
|
+
|
|
17460
17516
|
// ../../shared-contracts/dist/thread-watch-notice.js
|
|
17461
17517
|
var THREAD_WATCH_NOTICE_OUTCOMES = [
|
|
17462
17518
|
"completed",
|
|
@@ -17504,17 +17560,67 @@ var remoteSshSetupResultSchema = external_exports.object({ state: external_expor
|
|
|
17504
17560
|
|
|
17505
17561
|
// ../../shared-contracts/dist/remote-sessions.js
|
|
17506
17562
|
var REMOTE_CONTROLLER_REQUEST_MAX_BYTES = 16 * 1024;
|
|
17507
|
-
var
|
|
17563
|
+
var REMOTE_IDENTITY_MAX_LENGTH = 1024;
|
|
17564
|
+
var identity = external_exports.string().min(1).max(REMOTE_IDENTITY_MAX_LENGTH);
|
|
17508
17565
|
var target = { hostId: identity.regex(/^remote-(?:ssh(?:-|:)|control:)/u) };
|
|
17509
17566
|
var thread = { ...target, threadId: identity };
|
|
17567
|
+
var text = external_exports.string().min(1).max(8e3);
|
|
17568
|
+
var input = { text, requestId: identity };
|
|
17569
|
+
var remoteDeliveryReplySchema = external_exports.discriminatedUnion("accepted", [
|
|
17570
|
+
external_exports.object({ accepted: external_exports.literal(true), startQueuedItemId: identity.optional() }),
|
|
17571
|
+
external_exports.object({
|
|
17572
|
+
accepted: external_exports.literal(false),
|
|
17573
|
+
code: external_exports.enum([
|
|
17574
|
+
"remote/queue-unavailable",
|
|
17575
|
+
"remote/steer-unavailable",
|
|
17576
|
+
"remote/turn-changed",
|
|
17577
|
+
"remote/send-rejected",
|
|
17578
|
+
"session/queue-item-not-found",
|
|
17579
|
+
"session/queue-item-starting"
|
|
17580
|
+
]),
|
|
17581
|
+
message: external_exports.string()
|
|
17582
|
+
})
|
|
17583
|
+
]);
|
|
17584
|
+
var remoteQueueSnapshotSchema = external_exports.discriminatedUnion("available", [
|
|
17585
|
+
external_exports.object({ available: external_exports.literal(false) }),
|
|
17586
|
+
external_exports.object({
|
|
17587
|
+
available: external_exports.literal(true),
|
|
17588
|
+
items: external_exports.array(external_exports.object({ id: identity, clientUserMessageId: identity, preview: external_exports.string().max(801) })).max(100)
|
|
17589
|
+
})
|
|
17590
|
+
]);
|
|
17510
17591
|
var remoteSessionOperationSchema = external_exports.discriminatedUnion("kind", [
|
|
17511
17592
|
external_exports.strictObject({ kind: external_exports.literal("hosts") }),
|
|
17593
|
+
external_exports.strictObject({
|
|
17594
|
+
kind: external_exports.literal("create"),
|
|
17595
|
+
...target,
|
|
17596
|
+
cwd: external_exports.string().min(1).max(8192),
|
|
17597
|
+
epoch: identity
|
|
17598
|
+
}),
|
|
17599
|
+
external_exports.strictObject({ kind: external_exports.literal("projectHarnesses"), ...target, epoch: identity }),
|
|
17600
|
+
external_exports.strictObject({
|
|
17601
|
+
kind: external_exports.literal("inspectHarness"),
|
|
17602
|
+
...target,
|
|
17603
|
+
epoch: identity,
|
|
17604
|
+
cwd: external_exports.string().min(1).max(8192),
|
|
17605
|
+
harnessId: identity
|
|
17606
|
+
}),
|
|
17607
|
+
external_exports.strictObject({
|
|
17608
|
+
kind: external_exports.literal("startSelected"),
|
|
17609
|
+
...target,
|
|
17610
|
+
epoch: identity,
|
|
17611
|
+
cwd: external_exports.string().min(1).max(8192),
|
|
17612
|
+
harnessId: identity,
|
|
17613
|
+
model: external_exports.string().min(1).max(4096),
|
|
17614
|
+
serviceTier: external_exports.enum(["priority", "ultrafast"]).optional(),
|
|
17615
|
+
reasoningEffort: identity.optional()
|
|
17616
|
+
}),
|
|
17512
17617
|
external_exports.strictObject({ kind: external_exports.literal("status"), ...thread }),
|
|
17513
17618
|
external_exports.strictObject({
|
|
17514
17619
|
kind: external_exports.literal("list"),
|
|
17515
17620
|
...target,
|
|
17516
17621
|
cursor: external_exports.string().nullable(),
|
|
17517
|
-
archived: external_exports.boolean()
|
|
17622
|
+
archived: external_exports.boolean(),
|
|
17623
|
+
includeLoaded: external_exports.literal(true).optional()
|
|
17518
17624
|
}),
|
|
17519
17625
|
external_exports.strictObject({
|
|
17520
17626
|
kind: external_exports.literal("read"),
|
|
@@ -17544,9 +17650,25 @@ var remoteSessionOperationSchema = external_exports.discriminatedUnion("kind", [
|
|
|
17544
17650
|
kind: external_exports.literal("prompt"),
|
|
17545
17651
|
...thread,
|
|
17546
17652
|
epoch: identity,
|
|
17547
|
-
text
|
|
17653
|
+
text,
|
|
17548
17654
|
requestId: identity.optional()
|
|
17549
17655
|
}),
|
|
17656
|
+
external_exports.strictObject({ kind: external_exports.literal("queue"), ...thread, epoch: identity }),
|
|
17657
|
+
external_exports.strictObject({
|
|
17658
|
+
kind: external_exports.literal("delivery"),
|
|
17659
|
+
...thread,
|
|
17660
|
+
epoch: identity,
|
|
17661
|
+
action: external_exports.discriminatedUnion("kind", [
|
|
17662
|
+
external_exports.strictObject({ kind: external_exports.literal("enqueue"), ...input }),
|
|
17663
|
+
external_exports.strictObject({ kind: external_exports.literal("steer"), ...input, turnId: identity }),
|
|
17664
|
+
external_exports.strictObject({ kind: external_exports.literal("remove"), itemId: identity }),
|
|
17665
|
+
external_exports.strictObject({
|
|
17666
|
+
kind: external_exports.literal("start"),
|
|
17667
|
+
itemId: identity,
|
|
17668
|
+
onlyIfHead: external_exports.literal(true).optional()
|
|
17669
|
+
})
|
|
17670
|
+
])
|
|
17671
|
+
}),
|
|
17550
17672
|
external_exports.strictObject({ kind: external_exports.literal("interrupt"), ...thread, epoch: identity, turnId: identity }),
|
|
17551
17673
|
external_exports.strictObject({
|
|
17552
17674
|
kind: external_exports.literal("rename"),
|
|
@@ -18089,9 +18211,9 @@ function subagentConfiguration(value) {
|
|
|
18089
18211
|
if (typeof value !== "object" || value === null || Array.isArray(value))
|
|
18090
18212
|
return {};
|
|
18091
18213
|
const row = value;
|
|
18092
|
-
const
|
|
18093
|
-
const model2 = row.model === "inherit" ? void 0 :
|
|
18094
|
-
const reasoningEffort =
|
|
18214
|
+
const text3 = (value2) => typeof value2 === "string" && value2.trim() ? value2 : void 0;
|
|
18215
|
+
const model2 = row.model === "inherit" ? void 0 : text3(row.model);
|
|
18216
|
+
const reasoningEffort = text3(row.reasoningEffort) ?? text3(row.reasoning_effort) ?? text3(row.thinking);
|
|
18095
18217
|
return { ...model2 ? { model: model2 } : {}, ...reasoningEffort ? { reasoningEffort } : {} };
|
|
18096
18218
|
}
|
|
18097
18219
|
|
|
@@ -20785,7 +20907,7 @@ var LineBuffer = class {
|
|
|
20785
20907
|
};
|
|
20786
20908
|
|
|
20787
20909
|
// ../../../node_modules/@agentclientprotocol/sdk/dist/stream.js
|
|
20788
|
-
function ndJsonStream(output,
|
|
20910
|
+
function ndJsonStream(output, input2) {
|
|
20789
20911
|
const textEncoder = new TextEncoder();
|
|
20790
20912
|
const textDecoder = new TextDecoder();
|
|
20791
20913
|
let cancelled = false;
|
|
@@ -20808,7 +20930,7 @@ function ndJsonStream(output, input) {
|
|
|
20808
20930
|
}
|
|
20809
20931
|
}
|
|
20810
20932
|
};
|
|
20811
|
-
const reader =
|
|
20933
|
+
const reader = input2.getReader();
|
|
20812
20934
|
inputReader = reader;
|
|
20813
20935
|
try {
|
|
20814
20936
|
while (true) {
|
|
@@ -20891,8 +21013,8 @@ var zGuardCreateElicitationResponseCancel = object({
|
|
|
20891
21013
|
});
|
|
20892
21014
|
|
|
20893
21015
|
// ../../../node_modules/@agentclientprotocol/sdk/dist/acp.js
|
|
20894
|
-
function ndJsonStream2(output,
|
|
20895
|
-
return ndJsonStream(output,
|
|
21016
|
+
function ndJsonStream2(output, input2) {
|
|
21017
|
+
return ndJsonStream(output, input2);
|
|
20896
21018
|
}
|
|
20897
21019
|
function emptyObjectResponse(response) {
|
|
20898
21020
|
return response ?? {};
|
|
@@ -22666,9 +22788,9 @@ function createTwoFilesPatch(oldFileName, newFileName, oldStr, newStr, oldHeader
|
|
|
22666
22788
|
} }));
|
|
22667
22789
|
}
|
|
22668
22790
|
}
|
|
22669
|
-
function splitLines(
|
|
22670
|
-
const hasTrailingNl =
|
|
22671
|
-
const result =
|
|
22791
|
+
function splitLines(text3) {
|
|
22792
|
+
const hasTrailingNl = text3.endsWith("\n");
|
|
22793
|
+
const result = text3.split("\n").map((line) => line + "\n");
|
|
22672
22794
|
if (hasTrailingNl) {
|
|
22673
22795
|
result.pop();
|
|
22674
22796
|
} else {
|
|
@@ -22793,8 +22915,8 @@ function parseAndFormatAntigravityCommand(command, catalog = ANTIGRAVITY_COMMAND
|
|
|
22793
22915
|
};
|
|
22794
22916
|
}
|
|
22795
22917
|
}
|
|
22796
|
-
const
|
|
22797
|
-
if (descriptor.argumentMode === "none" &&
|
|
22918
|
+
const text3 = typeof args?.text === "string" ? args.text.trim() : "";
|
|
22919
|
+
if (descriptor.argumentMode === "none" && text3) {
|
|
22798
22920
|
return {
|
|
22799
22921
|
ok: false,
|
|
22800
22922
|
error: {
|
|
@@ -22804,7 +22926,7 @@ function parseAndFormatAntigravityCommand(command, catalog = ANTIGRAVITY_COMMAND
|
|
|
22804
22926
|
}
|
|
22805
22927
|
};
|
|
22806
22928
|
}
|
|
22807
|
-
const prompt =
|
|
22929
|
+
const prompt = text3.length > 0 ? `${descriptor.invocation} ${text3}` : descriptor.invocation;
|
|
22808
22930
|
return {
|
|
22809
22931
|
ok: true,
|
|
22810
22932
|
value: { prompt, descriptor }
|
|
@@ -22947,13 +23069,13 @@ function synthesizeAntigravityCommand(toolName, params, cwd) {
|
|
|
22947
23069
|
function record3(value) {
|
|
22948
23070
|
return value !== null && typeof value === "object" && !Array.isArray(value) ? value : {};
|
|
22949
23071
|
}
|
|
22950
|
-
function
|
|
23072
|
+
function text2(value) {
|
|
22951
23073
|
return typeof value === "string" ? value : "";
|
|
22952
23074
|
}
|
|
22953
23075
|
function bodyText(content) {
|
|
22954
23076
|
return (Array.isArray(content) ? content : []).map((part) => {
|
|
22955
23077
|
const block = record3(part);
|
|
22956
|
-
return
|
|
23078
|
+
return text2((block.type === "content" ? record3(block.content) : block).text);
|
|
22957
23079
|
}).filter(Boolean).join("\n");
|
|
22958
23080
|
}
|
|
22959
23081
|
function projectAcpSessionUpdate(rawUpdate) {
|
|
@@ -22965,7 +23087,7 @@ function projectAcpSessionUpdate(rawUpdate) {
|
|
|
22965
23087
|
if (content.type !== "text")
|
|
22966
23088
|
return null;
|
|
22967
23089
|
const type = rawUpdate.sessionUpdate === "user_message_chunk" ? "user.text" : rawUpdate.sessionUpdate === "agent_message_chunk" ? "agent.text" : "agent.thought";
|
|
22968
|
-
return { type, text:
|
|
23090
|
+
return { type, text: text2(content.text) };
|
|
22969
23091
|
}
|
|
22970
23092
|
case "tool_call":
|
|
22971
23093
|
case "tool_call_update": {
|
|
@@ -22974,8 +23096,8 @@ function projectAcpSessionUpdate(rawUpdate) {
|
|
|
22974
23096
|
return {
|
|
22975
23097
|
...tool,
|
|
22976
23098
|
type: rawUpdate.sessionUpdate === "tool_call" ? "tool.call" : "tool.update",
|
|
22977
|
-
toolCallId:
|
|
22978
|
-
...rawUpdate.sessionUpdate === "tool_call" ? { name:
|
|
23099
|
+
toolCallId: text2(rawUpdate.toolCallId),
|
|
23100
|
+
...rawUpdate.sessionUpdate === "tool_call" ? { name: text2(rawUpdate.name) || text2(rawUpdate.title) || "Tool" } : {},
|
|
22979
23101
|
...rawUpdate.args !== void 0 || rawUpdate.rawInput !== void 0 ? { args: rawUpdate.args ?? rawUpdate.rawInput } : {}
|
|
22980
23102
|
};
|
|
22981
23103
|
}
|
|
@@ -22991,7 +23113,7 @@ function projectAcpSessionUpdate(rawUpdate) {
|
|
|
22991
23113
|
configOptions: rawUpdate.configOptions
|
|
22992
23114
|
};
|
|
22993
23115
|
case "current_mode_update":
|
|
22994
|
-
return { type: "mode.update", currentModeId:
|
|
23116
|
+
return { type: "mode.update", currentModeId: text2(rawUpdate.currentModeId) };
|
|
22995
23117
|
case "available_commands_update":
|
|
22996
23118
|
return {
|
|
22997
23119
|
type: "commands.update",
|
|
@@ -23024,10 +23146,10 @@ function projectAcpApprovalInteraction(params) {
|
|
|
23024
23146
|
actionToOptionId.set(option.optionId, option.optionId);
|
|
23025
23147
|
return [{ id: option.optionId, label: option.name, effect }];
|
|
23026
23148
|
});
|
|
23027
|
-
const
|
|
23028
|
-
const command = synthesizeAntigravityCommand(toolCall.kind === "execute" ? "run_command" : name,
|
|
23149
|
+
const input2 = record3(toolCall).args ?? toolCall.rawInput;
|
|
23150
|
+
const command = synthesizeAntigravityCommand(toolCall.kind === "execute" ? "run_command" : name, input2, params.cwd);
|
|
23029
23151
|
const category = toolCall.kind === "execute" || command ? "Command execution" : toolCall.kind === "edit" || toolCall.kind === "delete" || isAntigravityFileMutatingTool(name) ? "File modification" : "Tool execution";
|
|
23030
|
-
const description = command?.command ?? (bodyText(toolCall.content) || (
|
|
23152
|
+
const description = command?.command ?? (bodyText(toolCall.content) || (input2 === void 0 ? "" : JSON.stringify(input2)));
|
|
23031
23153
|
return {
|
|
23032
23154
|
interaction: {
|
|
23033
23155
|
type: "approval",
|
|
@@ -23067,17 +23189,17 @@ function projectAcpQuestionInteraction(params) {
|
|
|
23067
23189
|
const optionValueToConst = /* @__PURE__ */ new Map();
|
|
23068
23190
|
const options = (Array.isArray(variants) ? variants : []).map((variant, index) => {
|
|
23069
23191
|
const entry = record3(variant);
|
|
23070
|
-
const native = typeof variant === "string" ? variant :
|
|
23192
|
+
const native = typeof variant === "string" ? variant : text2(entry.const);
|
|
23071
23193
|
const detail = record3(rawOptions[index]);
|
|
23072
23194
|
optionValueToConst.set(native, native);
|
|
23073
|
-
const description =
|
|
23195
|
+
const description = text2(entry.description) || text2(detail.description);
|
|
23074
23196
|
return {
|
|
23075
23197
|
value: native,
|
|
23076
|
-
label:
|
|
23198
|
+
label: text2(entry.title) || text2(detail.label) || native,
|
|
23077
23199
|
...description ? { description } : {}
|
|
23078
23200
|
};
|
|
23079
23201
|
});
|
|
23080
|
-
const prompt =
|
|
23202
|
+
const prompt = text2(prop.title) || text2(raw.question) || text2(prop.description) || text2(request.message) || key;
|
|
23081
23203
|
const otherKey = properties[`${key}_other`] ? `${key}_other` : void 0;
|
|
23082
23204
|
const optional2 = required2 ? !required2.has(key) : true;
|
|
23083
23205
|
mappings.push({
|
|
@@ -23110,7 +23232,7 @@ function projectAcpQuestionInteraction(params) {
|
|
|
23110
23232
|
interactionId: params.interactionId,
|
|
23111
23233
|
turnId: params.turnId,
|
|
23112
23234
|
...params.itemId ? { itemId: params.itemId } : {},
|
|
23113
|
-
title:
|
|
23235
|
+
title: text2(schema.title) || text2(request.message) || "Question",
|
|
23114
23236
|
questions
|
|
23115
23237
|
},
|
|
23116
23238
|
fieldMap: { questions: mappings }
|
|
@@ -23172,7 +23294,7 @@ var AntigravityToolTracker = class {
|
|
|
23172
23294
|
const name = tool.name ?? tool.title ?? "Tool";
|
|
23173
23295
|
const itemId = hostItemIdSchema.parse(`tool-${this.options.turnId}-${createHash("sha256").update(event.toolCallId).digest("hex").slice(0, 20)}`);
|
|
23174
23296
|
const args = tool.args ?? tool.rawInput;
|
|
23175
|
-
const
|
|
23297
|
+
const input2 = record3(args);
|
|
23176
23298
|
const fullOutput = tool.rawOutput === void 0 ? bodyText(tool.content) : typeof tool.rawOutput === "string" ? tool.rawOutput : JSON.stringify(tool.rawOutput);
|
|
23177
23299
|
const limit = this.options.outputLimit ?? 64e3;
|
|
23178
23300
|
const output = fullOutput.slice(0, limit);
|
|
@@ -23194,21 +23316,21 @@ var AntigravityToolTracker = class {
|
|
|
23194
23316
|
};
|
|
23195
23317
|
} else if (["invokesubagent", "sendmessage"].includes(compactToolName(name))) {
|
|
23196
23318
|
const result = record3(tool.rawOutput);
|
|
23197
|
-
const nativeId = uuidPattern.exec(
|
|
23198
|
-
const nativeConfiguration = subagentConfiguration(
|
|
23319
|
+
const nativeId = uuidPattern.exec(text2(result.subagent_id) || text2(result.agent_id) || text2(result.session_id) || text2(result.cascade_id))?.[0] ?? uuidPattern.exec(fullOutput)?.[0] ?? uuidPattern.exec(text2(input2.subagent_id) || text2(input2.agent_id) || text2(input2.session_id))?.[0];
|
|
23320
|
+
const nativeConfiguration = subagentConfiguration(input2);
|
|
23199
23321
|
state.item = {
|
|
23200
23322
|
type: "subagentDelegation",
|
|
23201
23323
|
itemId,
|
|
23202
23324
|
operation: compactToolName(name) === "sendmessage" ? "send" : "spawn",
|
|
23203
|
-
...
|
|
23325
|
+
...text2(input2.prompt) || text2(input2.message) ? { prompt: text2(input2.prompt) || text2(input2.message) } : {},
|
|
23204
23326
|
subagents: [
|
|
23205
23327
|
{
|
|
23206
23328
|
subagentId: nativeId ?? event.toolCallId,
|
|
23207
23329
|
...nativeId ? { nativeSubagentId: nativeId } : {},
|
|
23208
|
-
description:
|
|
23330
|
+
description: text2(input2.description) || tool.title || name,
|
|
23209
23331
|
...this.options.parentConfiguration,
|
|
23210
23332
|
...nativeConfiguration,
|
|
23211
|
-
background:
|
|
23333
|
+
background: input2.run_in_background === true,
|
|
23212
23334
|
status: terminal ? failed ? "failed" : "completed" : "running",
|
|
23213
23335
|
...output ? { resultSummary: output } : {}
|
|
23214
23336
|
}
|
|
@@ -23269,11 +23391,11 @@ var AntigravityToolTracker = class {
|
|
|
23269
23391
|
const diff = record3(value);
|
|
23270
23392
|
if (diff.type !== "diff")
|
|
23271
23393
|
return [];
|
|
23272
|
-
const path14 = displayPath(
|
|
23394
|
+
const path14 = displayPath(text2(diff.path), this.options.cwd)?.path;
|
|
23273
23395
|
if (!path14)
|
|
23274
23396
|
return [];
|
|
23275
|
-
const oldText =
|
|
23276
|
-
const newText =
|
|
23397
|
+
const oldText = text2(diff.oldText);
|
|
23398
|
+
const newText = text2(diff.newText);
|
|
23277
23399
|
const kind = diff.oldText == null ? "add" : diff.newText == null ? "delete" : "update";
|
|
23278
23400
|
const patch = createTwoFilesPatch(kind === "add" ? "/dev/null" : path14, kind === "delete" ? "/dev/null" : path14, oldText, newText, void 0, void 0, { context: 3 });
|
|
23279
23401
|
return [
|
|
@@ -23486,12 +23608,12 @@ var antigravityDiscoverySpec = {
|
|
|
23486
23608
|
windows: ["${LOCALAPPDATA}/agy/bin", "~/.local/bin"]
|
|
23487
23609
|
}
|
|
23488
23610
|
};
|
|
23489
|
-
function resolveAntigravityExecutable(
|
|
23490
|
-
const platform =
|
|
23611
|
+
function resolveAntigravityExecutable(input2 = {}) {
|
|
23612
|
+
const platform = input2.platform ?? process.platform;
|
|
23491
23613
|
const resolution = resolveHarnessExecutable(antigravityDiscoverySpec, {
|
|
23492
|
-
...
|
|
23493
|
-
environment:
|
|
23494
|
-
...
|
|
23614
|
+
...input2.command ? { command: input2.command } : {},
|
|
23615
|
+
environment: input2.environment ?? process.env,
|
|
23616
|
+
...input2.homeDirectory ? { homeDirectory: input2.homeDirectory } : {},
|
|
23495
23617
|
platform
|
|
23496
23618
|
});
|
|
23497
23619
|
if (!resolution)
|
|
@@ -23669,7 +23791,7 @@ var AntigravityAcpTransport = class {
|
|
|
23669
23791
|
throw this.#error(error51);
|
|
23670
23792
|
}
|
|
23671
23793
|
}
|
|
23672
|
-
async openSession(
|
|
23794
|
+
async openSession(input2) {
|
|
23673
23795
|
await this.initialize();
|
|
23674
23796
|
if (this.#closed || !this.#connection || this.#active || this.#opening || this.#sessionId)
|
|
23675
23797
|
throw new AntigravityTransportError("unavailable", "Close the current ACP session before opening another");
|
|
@@ -23678,23 +23800,23 @@ var AntigravityAcpTransport = class {
|
|
|
23678
23800
|
this.#opening = buffered;
|
|
23679
23801
|
this.#pendingEvents = [];
|
|
23680
23802
|
const params = {
|
|
23681
|
-
cwd:
|
|
23803
|
+
cwd: input2.cwd,
|
|
23682
23804
|
mcpServers: [],
|
|
23683
|
-
...
|
|
23684
|
-
...
|
|
23805
|
+
...input2.additionalDirectories?.length ? { additionalDirectories: input2.additionalDirectories } : {},
|
|
23806
|
+
...input2.systemPromptAppend ? { _meta: { antigravity: { systemPrompt: { append: input2.systemPromptAppend } } } } : {}
|
|
23685
23807
|
};
|
|
23686
23808
|
try {
|
|
23687
23809
|
let request;
|
|
23688
|
-
if (
|
|
23810
|
+
if (input2.kind === "create")
|
|
23689
23811
|
request = connection.newSession(params);
|
|
23690
23812
|
else {
|
|
23691
|
-
if (!
|
|
23813
|
+
if (!input2.sessionId)
|
|
23692
23814
|
throw new AntigravityTransportError("protocolError", "Session ID required for resume");
|
|
23693
|
-
request = connection.resumeSession({ ...params, sessionId:
|
|
23815
|
+
request = connection.resumeSession({ ...params, sessionId: input2.sessionId });
|
|
23694
23816
|
}
|
|
23695
|
-
const result = await this.#request(request, `session/${
|
|
23817
|
+
const result = await this.#request(request, `session/${input2.kind === "create" ? "new" : input2.kind}`);
|
|
23696
23818
|
const raw = result;
|
|
23697
|
-
const sessionId = raw.sessionId ??
|
|
23819
|
+
const sessionId = raw.sessionId ?? input2.sessionId;
|
|
23698
23820
|
if (!sessionId)
|
|
23699
23821
|
throw new AntigravityTransportError("protocolError", "Antigravity session/new returned no sessionId");
|
|
23700
23822
|
this.#sessionId = sessionId;
|
|
@@ -24000,8 +24122,8 @@ function generatorStepIndices(fields) {
|
|
|
24000
24122
|
function matchesUsage(fields, request) {
|
|
24001
24123
|
if (!fields)
|
|
24002
24124
|
return false;
|
|
24003
|
-
const
|
|
24004
|
-
return
|
|
24125
|
+
const input2 = unsigned(fields, 2), output = unsigned(fields, 3), cached2 = unsigned(fields, 5), thought = unsigned(fields, 9);
|
|
24126
|
+
return input2 !== null && output !== null && cached2 !== null && thought !== null && output >= thought && (request.reasoningOutputTokens === void 0 || thought === BigInt(request.reasoningOutputTokens)) && input2 + cached2 + BigInt(request.cacheWriteInputTokens ?? 0) === BigInt(request.inputTokens) && output === BigInt(request.outputTokens) && (request.cachedInputTokens === void 0 || cached2 === BigInt(request.cachedInputTokens));
|
|
24005
24127
|
}
|
|
24006
24128
|
function closeTo(left, right) {
|
|
24007
24129
|
const difference = left - right;
|
|
@@ -24141,8 +24263,8 @@ function promptUsage(raw) {
|
|
|
24141
24263
|
return null;
|
|
24142
24264
|
}
|
|
24143
24265
|
}
|
|
24144
|
-
function timing(
|
|
24145
|
-
const { firstOutputAtMs, completedAtMs } =
|
|
24266
|
+
function timing(input2) {
|
|
24267
|
+
const { firstOutputAtMs, completedAtMs } = input2;
|
|
24146
24268
|
return count2(firstOutputAtMs) && count2(completedAtMs) && completedAtMs >= firstOutputAtMs ? { startedAtMs: firstOutputAtMs, completedAtMs } : {};
|
|
24147
24269
|
}
|
|
24148
24270
|
function requestUsage(requests) {
|
|
@@ -24256,9 +24378,9 @@ var AntigravitySessionUsageTracker = class {
|
|
|
24256
24378
|
if (this.#pending && usageMatches(requestUsage([...this.#requests.values()]), addUsage(this.#pending.base, this.#pending.usage), false))
|
|
24257
24379
|
this.#pending = void 0;
|
|
24258
24380
|
}
|
|
24259
|
-
recordTurnPromptUsage(
|
|
24381
|
+
recordTurnPromptUsage(input2) {
|
|
24260
24382
|
this.endTurn();
|
|
24261
|
-
const usage = promptUsage(
|
|
24383
|
+
const usage = promptUsage(input2.usage);
|
|
24262
24384
|
if (usage) {
|
|
24263
24385
|
if (this.#requests.size === 0)
|
|
24264
24386
|
this.#tokens = usage;
|
|
@@ -24279,22 +24401,22 @@ var AntigravitySessionUsageTracker = class {
|
|
|
24279
24401
|
this.#reconcile();
|
|
24280
24402
|
return { requests, complete: this.#historyComplete(), usage: this.currentUsage() };
|
|
24281
24403
|
}
|
|
24282
|
-
async collectNewTranscriptRequests(
|
|
24283
|
-
const transcript = await this.#read(
|
|
24404
|
+
async collectNewTranscriptRequests(input2 = {}) {
|
|
24405
|
+
const transcript = await this.#read(input2.signal);
|
|
24284
24406
|
for (const step2 of transcript.steps.keys()) {
|
|
24285
24407
|
if (!this.#consumed.has(step2)) {
|
|
24286
24408
|
this.#turnCollectionSteps.add(step2);
|
|
24287
24409
|
this.#pending?.steps.add(step2);
|
|
24288
24410
|
}
|
|
24289
24411
|
}
|
|
24290
|
-
const usage = promptUsage(
|
|
24412
|
+
const usage = promptUsage(input2.promptUsage);
|
|
24291
24413
|
const hadPending = this.#pending !== void 0;
|
|
24292
24414
|
const cacheUsage = usage && this.#pending ? addUsage(this.#pending.usage, usage) : usage ?? this.#pending?.usage;
|
|
24293
24415
|
const { requests, timings } = this.#consume(transcript, false, cacheUsage);
|
|
24294
24416
|
const [step] = this.#turnCollectionSteps;
|
|
24295
|
-
if (step !== void 0 && this.#turnCollectionSteps.size === 1 && !hadPending && !
|
|
24417
|
+
if (step !== void 0 && this.#turnCollectionSteps.size === 1 && !hadPending && !input2.hasToolCalls && !transcript.toolCallSteps.has(step) && transcript.metadata === null && transcript.complete && !this.#invalidated && usage?.inputTokens !== void 0 && usage.outputTokens !== void 0) {
|
|
24296
24418
|
const single = this.#requests.get(step);
|
|
24297
|
-
const { startedAtMs, completedAtMs } = timing(
|
|
24419
|
+
const { startedAtMs, completedAtMs } = timing(input2);
|
|
24298
24420
|
if (single && single.startedAtMs === void 0 && (single.reasoningOutputTokens ?? usage.reasoningOutputTokens) === 0 && (usage.reasoningOutputTokens ?? 0) === 0 && usageMatches(requestUsage([single]), usage, true) && startedAtMs !== void 0 && completedAtMs !== void 0) {
|
|
24299
24421
|
const updated = parseHostUsageRequest({ ...single, startedAtMs, completedAtMs });
|
|
24300
24422
|
const index = requests.indexOf(single);
|
|
@@ -24714,6 +24836,10 @@ function textField(fields, number4) {
|
|
|
24714
24836
|
const bytes = messageField(fields, number4);
|
|
24715
24837
|
return bytes ? Buffer.from(bytes).toString("utf8") : "";
|
|
24716
24838
|
}
|
|
24839
|
+
function isPlanContinuation(step) {
|
|
24840
|
+
const eventType = textField(nested(step, 114), 3);
|
|
24841
|
+
return eventType === "plan_mode_handoff" || eventType === "plan_mode_handback";
|
|
24842
|
+
}
|
|
24717
24843
|
function argsValue(raw) {
|
|
24718
24844
|
if (!raw)
|
|
24719
24845
|
return void 0;
|
|
@@ -24779,6 +24905,7 @@ async function readNativeTurnCompactions(dbPath, afterStepIndex) {
|
|
|
24779
24905
|
return [];
|
|
24780
24906
|
const compactions = [];
|
|
24781
24907
|
let turnRun;
|
|
24908
|
+
let latestRun;
|
|
24782
24909
|
let seenUserInput = false;
|
|
24783
24910
|
const wakeRuns = /* @__PURE__ */ new Set();
|
|
24784
24911
|
for (const row of db.prepare(`SELECT idx, step_type, status, step_payload FROM steps
|
|
@@ -24789,12 +24916,19 @@ async function readNativeTurnCompactions(dbPath, afterStepIndex) {
|
|
|
24789
24916
|
const stepRun = textField(nested(step, 5), 12);
|
|
24790
24917
|
if (row.step_type === USER_INPUT) {
|
|
24791
24918
|
seenUserInput = true;
|
|
24792
|
-
turnRun = stepRun;
|
|
24919
|
+
turnRun = latestRun = stepRun;
|
|
24793
24920
|
continue;
|
|
24794
24921
|
}
|
|
24795
24922
|
if (row.step_type === SYSTEM_MESSAGE) {
|
|
24796
|
-
if (stepRun
|
|
24797
|
-
|
|
24923
|
+
if (!stepRun)
|
|
24924
|
+
continue;
|
|
24925
|
+
if (stepRun !== turnRun) {
|
|
24926
|
+
if (row.status === DONE && turnRun && latestRun === turnRun && !wakeRuns.has(stepRun) && isPlanContinuation(step)) {
|
|
24927
|
+
turnRun = stepRun;
|
|
24928
|
+
} else
|
|
24929
|
+
wakeRuns.add(stepRun);
|
|
24930
|
+
}
|
|
24931
|
+
latestRun = stepRun;
|
|
24798
24932
|
continue;
|
|
24799
24933
|
}
|
|
24800
24934
|
if (!seenUserInput)
|
|
@@ -24828,11 +24962,11 @@ function decodeNativeHistory(db) {
|
|
|
24828
24962
|
wake = void 0;
|
|
24829
24963
|
candidate = void 0;
|
|
24830
24964
|
};
|
|
24831
|
-
const append = (type,
|
|
24832
|
-
if (
|
|
24965
|
+
const append = (type, text3) => {
|
|
24966
|
+
if (text3)
|
|
24833
24967
|
events.push({ type, text: events.at(-1)?.type === type ? `
|
|
24834
24968
|
|
|
24835
|
-
${
|
|
24969
|
+
${text3}` : text3 });
|
|
24836
24970
|
};
|
|
24837
24971
|
if (db.prepare("PRAGMA user_version").get()?.user_version !== 1)
|
|
24838
24972
|
throw new Error("Unsupported Antigravity history database version");
|
|
@@ -24843,7 +24977,9 @@ ${text2}` : text2 });
|
|
|
24843
24977
|
const nativeTurnIndex = row.step_type === USER_INPUT ? turnCount++ : void 0;
|
|
24844
24978
|
if (nativeTurnIndex !== void 0) {
|
|
24845
24979
|
endWake();
|
|
24980
|
+
run = "";
|
|
24846
24981
|
finalPlanner = false;
|
|
24982
|
+
toolCalls.clear();
|
|
24847
24983
|
}
|
|
24848
24984
|
if (IN_FLIGHT.has(Number(row.status))) {
|
|
24849
24985
|
if (wake && row.step_type === PLANNER_RESPONSE)
|
|
@@ -24854,7 +24990,18 @@ ${text2}` : text2 });
|
|
|
24854
24990
|
const metadata = nested(step, 5);
|
|
24855
24991
|
const stepRun = textField(metadata, 12);
|
|
24856
24992
|
if (row.step_type === SYSTEM_MESSAGE) {
|
|
24857
|
-
if (row.status
|
|
24993
|
+
if (row.status !== DONE)
|
|
24994
|
+
continue;
|
|
24995
|
+
if (isPlanContinuation(step)) {
|
|
24996
|
+
if (stepRun) {
|
|
24997
|
+
if (candidate)
|
|
24998
|
+
candidate.run = stepRun;
|
|
24999
|
+
else
|
|
25000
|
+
run = stepRun;
|
|
25001
|
+
}
|
|
25002
|
+
continue;
|
|
25003
|
+
}
|
|
25004
|
+
if (stepRun ? stepRun !== run : finalPlanner) {
|
|
24858
25005
|
if (candidate?.run !== stepRun) {
|
|
24859
25006
|
endWake();
|
|
24860
25007
|
candidate = { stepIndex: idx, run: stepRun, events: [], calls: /* @__PURE__ */ new Map() };
|
|
@@ -24879,15 +25026,14 @@ ${text2}` : text2 });
|
|
|
24879
25026
|
switch (row.step_type) {
|
|
24880
25027
|
case USER_INPUT: {
|
|
24881
25028
|
const items = body.flatMap((field3) => field3.number === 3 && field3.wire === 2 ? [textField(message2(field3.value), 1)] : []);
|
|
24882
|
-
const
|
|
24883
|
-
|
|
24884
|
-
|
|
24885
|
-
events.push({ type: "user.text", text: text2, nativeTurnIndex });
|
|
25029
|
+
const text3 = items.join("") || textField(body, 2) || textField(body, 1);
|
|
25030
|
+
if (text3 && nativeTurnIndex !== void 0)
|
|
25031
|
+
events.push({ type: "user.text", text: text3, nativeTurnIndex });
|
|
24886
25032
|
break;
|
|
24887
25033
|
}
|
|
24888
25034
|
case PLANNER_RESPONSE: {
|
|
24889
25035
|
const thought = textField(body, 3);
|
|
24890
|
-
const
|
|
25036
|
+
const text3 = textField(body, 1);
|
|
24891
25037
|
const calls = body.filter((field3) => field3.number === 7 && field3.wire === 2);
|
|
24892
25038
|
if (candidate && candidate.run === stepRun) {
|
|
24893
25039
|
const { stepIndex, events: earlierTools, calls: earlierCalls } = candidate;
|
|
@@ -24900,11 +25046,11 @@ ${text2}` : text2 });
|
|
|
24900
25046
|
}
|
|
24901
25047
|
if (stepRun)
|
|
24902
25048
|
run = stepRun;
|
|
24903
|
-
finalPlanner = row.status === DONE && !!
|
|
25049
|
+
finalPlanner = row.status === DONE && !!text3.trim() && calls.length === 0;
|
|
24904
25050
|
if (wake)
|
|
24905
25051
|
wake.settled = finalPlanner;
|
|
24906
25052
|
append("agent.thought", thought);
|
|
24907
|
-
append("agent.text",
|
|
25053
|
+
append("agent.text", text3);
|
|
24908
25054
|
for (const field3 of body) {
|
|
24909
25055
|
if (field3.number !== 7 || field3.wire !== 2)
|
|
24910
25056
|
continue;
|
|
@@ -25111,18 +25257,18 @@ async function readAntigravityUsage(file2, signal) {
|
|
|
25111
25257
|
if (record4.type !== "PLANNER_RESPONSE")
|
|
25112
25258
|
continue;
|
|
25113
25259
|
const step = count3(record4.step_index);
|
|
25114
|
-
const
|
|
25260
|
+
const input2 = count3(record4.input_tokens);
|
|
25115
25261
|
const output = count3(record4.output_tokens);
|
|
25116
25262
|
const cached2 = count3(record4.cache_read_tokens);
|
|
25117
25263
|
const at = nativeTimeMs(record4.created_at);
|
|
25118
|
-
if (step === null ||
|
|
25264
|
+
if (step === null || input2 === null || output === null || at === null)
|
|
25119
25265
|
continue;
|
|
25120
25266
|
const identity2 = normalizeAntigravityUsageModel(record4.model);
|
|
25121
25267
|
requests.set(step, withUsageSession({
|
|
25122
|
-
id: `${String(record4.created_at)}:${step}:${
|
|
25268
|
+
id: `${String(record4.created_at)}:${step}:${input2}:${cached2 ?? "-"}:${output}`,
|
|
25123
25269
|
occurredAtMs: at,
|
|
25124
25270
|
...identity2,
|
|
25125
|
-
inputTokens:
|
|
25271
|
+
inputTokens: input2 + (cached2 ?? 0),
|
|
25126
25272
|
...cached2 !== null ? {
|
|
25127
25273
|
cachedInputTokens: cached2,
|
|
25128
25274
|
...hasImplicitZeroCacheWrite(identity2) ? { cacheWriteInputTokens: 0 } : {}
|
|
@@ -25381,8 +25527,8 @@ async function copyNativeBrainDirIfExists(sourceId, derivedId, home = os4.homedi
|
|
|
25381
25527
|
});
|
|
25382
25528
|
return true;
|
|
25383
25529
|
}
|
|
25384
|
-
async function openDerivedAntigravitySession(options,
|
|
25385
|
-
const environment = { ...options.adapterEnvironment, ...
|
|
25530
|
+
async function openDerivedAntigravitySession(options, input2, sourceRef, retained, fork) {
|
|
25531
|
+
const environment = { ...options.adapterEnvironment, ...input2.environment };
|
|
25386
25532
|
const home = antigravityHome(environment);
|
|
25387
25533
|
const derivedId = randomUUID();
|
|
25388
25534
|
let cloned = false;
|
|
@@ -25392,7 +25538,7 @@ async function openDerivedAntigravitySession(options, input, sourceRef, retained
|
|
|
25392
25538
|
if (fork?.activeTurnIndex === void 0)
|
|
25393
25539
|
await copyNativeBrainDirIfExists(sourceRef.nativeSessionId, derivedId, home);
|
|
25394
25540
|
const result = await options.openSession({
|
|
25395
|
-
...
|
|
25541
|
+
...input2,
|
|
25396
25542
|
environment,
|
|
25397
25543
|
nativeRef: { ...sourceRef, nativeSessionId: derivedId }
|
|
25398
25544
|
});
|
|
@@ -25425,8 +25571,8 @@ async function openDerivedAntigravitySession(options, input, sourceRef, retained
|
|
|
25425
25571
|
}
|
|
25426
25572
|
}
|
|
25427
25573
|
async function forkAntigravitySession(options) {
|
|
25428
|
-
const { input, harnessId: harnessId2 } = options;
|
|
25429
|
-
if (!validNativeSessionRef(
|
|
25574
|
+
const { input: input2, harnessId: harnessId2 } = options;
|
|
25575
|
+
if (!validNativeSessionRef(input2.sourceRef, harnessId2))
|
|
25430
25576
|
return {
|
|
25431
25577
|
ok: false,
|
|
25432
25578
|
error: {
|
|
@@ -25435,8 +25581,8 @@ async function forkAntigravitySession(options) {
|
|
|
25435
25581
|
retryable: false
|
|
25436
25582
|
}
|
|
25437
25583
|
};
|
|
25438
|
-
const checkpoint = nativeCheckpointRefSchema.safeParse(
|
|
25439
|
-
if (!checkpoint.success || checkpoint.data.harnessId !== harnessId2 || checkpoint.data.nativeSessionId !==
|
|
25584
|
+
const checkpoint = nativeCheckpointRefSchema.safeParse(input2.checkpoint);
|
|
25585
|
+
if (!checkpoint.success || checkpoint.data.harnessId !== harnessId2 || checkpoint.data.nativeSessionId !== input2.sourceRef.nativeSessionId)
|
|
25440
25586
|
return checkpointError();
|
|
25441
25587
|
const checkpointId = checkpoint.data.checkpointId;
|
|
25442
25588
|
const match = /^(turn|wake)-(0|[1-9]\d*)$/u.exec(checkpointId);
|
|
@@ -25447,16 +25593,16 @@ async function forkAntigravitySession(options) {
|
|
|
25447
25593
|
return checkpointError();
|
|
25448
25594
|
let activeTurnIndex;
|
|
25449
25595
|
if (options.sourceSession?.isActive) {
|
|
25450
|
-
activeTurnIndex = options.sourceSession.activeForkTurnIndex?.(checkpointId, antigravityHome({ ...options.adapterEnvironment, ...
|
|
25596
|
+
activeTurnIndex = options.sourceSession.activeForkTurnIndex?.(checkpointId, antigravityHome({ ...options.adapterEnvironment, ...input2.environment }));
|
|
25451
25597
|
if (match[1] !== "turn" || activeTurnIndex === void 0 || index >= activeTurnIndex)
|
|
25452
25598
|
return activeForkError("Fork requires a confirmed completed Turn before the running Antigravity Turn and no active Subagents; retry when idle");
|
|
25453
25599
|
}
|
|
25454
25600
|
return openDerivedAntigravitySession(options, {
|
|
25455
25601
|
kind: "resume",
|
|
25456
|
-
nativeRef:
|
|
25457
|
-
cwd:
|
|
25458
|
-
...
|
|
25459
|
-
},
|
|
25602
|
+
nativeRef: input2.sourceRef,
|
|
25603
|
+
cwd: input2.cwd,
|
|
25604
|
+
...input2.environment ? { environment: input2.environment } : {}
|
|
25605
|
+
}, input2.sourceRef, { checkpointId }, activeTurnIndex === void 0 ? {} : { activeTurnIndex });
|
|
25460
25606
|
}
|
|
25461
25607
|
function activeForkError(message3) {
|
|
25462
25608
|
return { ok: false, error: { code: "sessionBusy", message: message3, retryable: true } };
|
|
@@ -25990,8 +26136,8 @@ async function fetchAntigravityQuota(run, now = /* @__PURE__ */ new Date()) {
|
|
|
25990
26136
|
|
|
25991
26137
|
// dist/rollback.js
|
|
25992
26138
|
async function rollbackAntigravityLastTurn(options) {
|
|
25993
|
-
const { input, harnessId: harnessId2 } = options;
|
|
25994
|
-
if (!validNativeSessionRef(
|
|
26139
|
+
const { input: input2, harnessId: harnessId2 } = options;
|
|
26140
|
+
if (!validNativeSessionRef(input2.sourceRef, harnessId2))
|
|
25995
26141
|
return {
|
|
25996
26142
|
ok: false,
|
|
25997
26143
|
error: {
|
|
@@ -26010,7 +26156,7 @@ async function rollbackAntigravityLastTurn(options) {
|
|
|
26010
26156
|
}
|
|
26011
26157
|
};
|
|
26012
26158
|
try {
|
|
26013
|
-
const boundaries = await readDerivationBoundaries(nativeConversationDbPath(
|
|
26159
|
+
const boundaries = await readDerivationBoundaries(nativeConversationDbPath(input2.sourceRef.nativeSessionId, antigravityHome({ ...options.adapterEnvironment, ...input2.environment })));
|
|
26014
26160
|
const last = boundaries.at(-1);
|
|
26015
26161
|
if (!last)
|
|
26016
26162
|
return {
|
|
@@ -26023,13 +26169,13 @@ async function rollbackAntigravityLastTurn(options) {
|
|
|
26023
26169
|
};
|
|
26024
26170
|
return openDerivedAntigravitySession(options, {
|
|
26025
26171
|
kind: "resume",
|
|
26026
|
-
nativeRef:
|
|
26027
|
-
cwd:
|
|
26028
|
-
...
|
|
26029
|
-
...
|
|
26030
|
-
...
|
|
26031
|
-
...
|
|
26032
|
-
},
|
|
26172
|
+
nativeRef: input2.sourceRef,
|
|
26173
|
+
cwd: input2.cwd,
|
|
26174
|
+
...input2.environment ? { environment: input2.environment } : {},
|
|
26175
|
+
...input2.model ? { model: input2.model } : {},
|
|
26176
|
+
...input2.thinkingOptionId ? { thinkingOptionId: input2.thinkingOptionId } : {},
|
|
26177
|
+
...input2.permissionModeId ? { permissionModeId: input2.permissionModeId } : {}
|
|
26178
|
+
}, input2.sourceRef, { cutoff: boundaries.length === 1 ? 0 : last.idx });
|
|
26033
26179
|
} catch (error51) {
|
|
26034
26180
|
return { ok: false, error: nativeHistoryError(error51) };
|
|
26035
26181
|
}
|
|
@@ -26086,15 +26232,15 @@ function sessionImportTitle(value, maxLength = HARNESS_SESSION_IMPORT_TITLE_MAX_
|
|
|
26086
26232
|
return normalized;
|
|
26087
26233
|
return `${characters.slice(0, maxLength - 1).join("").trimEnd()}…`;
|
|
26088
26234
|
}
|
|
26089
|
-
function sessionImportCandidate(
|
|
26090
|
-
const time3 = typeof
|
|
26235
|
+
function sessionImportCandidate(input2) {
|
|
26236
|
+
const time3 = typeof input2.updatedAt === "number" ? input2.updatedAt : typeof input2.updatedAt === "string" ? Date.parse(input2.updatedAt) : Number.NaN;
|
|
26091
26237
|
const parsed = harnessSessionImportCandidateSchema.safeParse({
|
|
26092
|
-
nativeSessionId:
|
|
26093
|
-
cwd:
|
|
26094
|
-
title: typeof
|
|
26238
|
+
nativeSessionId: input2.nativeSessionId,
|
|
26239
|
+
cwd: input2.cwd,
|
|
26240
|
+
title: typeof input2.title === "string" && input2.title.trim().length > 0 ? input2.title : null,
|
|
26095
26241
|
updatedAt: Math.floor(time3),
|
|
26096
26242
|
// Unknown must stay unknown; only an explicit boolean is a native statement.
|
|
26097
|
-
running: typeof
|
|
26243
|
+
running: typeof input2.running === "boolean" ? input2.running : null
|
|
26098
26244
|
});
|
|
26099
26245
|
return parsed.success ? parsed.data : null;
|
|
26100
26246
|
}
|
|
@@ -26346,8 +26492,8 @@ function turnOutcome(status) {
|
|
|
26346
26492
|
}
|
|
26347
26493
|
return { status: "unknown", reason: "Antigravity Subagent is still running" };
|
|
26348
26494
|
}
|
|
26349
|
-
function parseSubagentTranscript(
|
|
26350
|
-
const lines =
|
|
26495
|
+
function parseSubagentTranscript(text3, parentId, childId, status, cwd, outputLimit) {
|
|
26496
|
+
const lines = text3.split("\n");
|
|
26351
26497
|
if (lines.at(-1)?.trim()) {
|
|
26352
26498
|
try {
|
|
26353
26499
|
JSON.parse(lines.at(-1) ?? "");
|
|
@@ -26444,36 +26590,36 @@ function parseSubagentTranscript(text2, parentId, childId, status, cwd, outputLi
|
|
|
26444
26590
|
current.outcome = turnOutcome(status === "completed" && steps.at(-1)?.status === "ERROR" ? "failed" : status);
|
|
26445
26591
|
return { turns };
|
|
26446
26592
|
}
|
|
26447
|
-
async function readSubagentTranscript(
|
|
26448
|
-
if (!nativeSubagentIdSchema.safeParse(
|
|
26593
|
+
async function readSubagentTranscript(input2) {
|
|
26594
|
+
if (!nativeSubagentIdSchema.safeParse(input2.childId).success) {
|
|
26449
26595
|
return {
|
|
26450
26596
|
ok: false,
|
|
26451
26597
|
error: { code: "invalidRequest", message: "Invalid Subagent ID", retryable: false }
|
|
26452
26598
|
};
|
|
26453
26599
|
}
|
|
26454
26600
|
try {
|
|
26455
|
-
const file2 = path12.join(nativeBrainDirPath(
|
|
26456
|
-
const brainRoot = await realpath(path12.dirname(nativeBrainDirPath(
|
|
26601
|
+
const file2 = path12.join(nativeBrainDirPath(input2.childId, input2.home), ".system_generated", "logs", "transcript.jsonl");
|
|
26602
|
+
const brainRoot = await realpath(path12.dirname(nativeBrainDirPath(input2.childId, input2.home)));
|
|
26457
26603
|
const resolved = await realpath(file2);
|
|
26458
|
-
const expected = path12.join(brainRoot,
|
|
26604
|
+
const expected = path12.join(brainRoot, input2.childId, ".system_generated", "logs", "transcript.jsonl");
|
|
26459
26605
|
const normalize = (value) => process.platform === "win32" ? value.toLowerCase() : value;
|
|
26460
26606
|
if (normalize(resolved) !== normalize(expected))
|
|
26461
26607
|
throw new Error("Subagent log redirects outside its native location");
|
|
26462
26608
|
const handle = await open2(resolved, "r");
|
|
26463
|
-
let
|
|
26609
|
+
let text3;
|
|
26464
26610
|
try {
|
|
26465
26611
|
const size = (await handle.stat()).size;
|
|
26466
26612
|
if (size > MAX_TRANSCRIPT_BYTES)
|
|
26467
26613
|
throw new Error("Subagent transcript too large");
|
|
26468
26614
|
const buffer = Buffer.alloc(size);
|
|
26469
26615
|
const { bytesRead } = await handle.read(buffer, 0, size, 0);
|
|
26470
|
-
|
|
26616
|
+
text3 = buffer.subarray(0, bytesRead).toString("utf8");
|
|
26471
26617
|
} finally {
|
|
26472
26618
|
await handle.close();
|
|
26473
26619
|
}
|
|
26474
26620
|
return {
|
|
26475
26621
|
ok: true,
|
|
26476
|
-
value: parseSubagentTranscript(
|
|
26622
|
+
value: parseSubagentTranscript(text3, input2.parentId, input2.childId, input2.status, input2.cwd, input2.outputLimit)
|
|
26477
26623
|
};
|
|
26478
26624
|
} catch {
|
|
26479
26625
|
return {
|
|
@@ -27596,8 +27742,8 @@ var AntigravitySession = class {
|
|
|
27596
27742
|
#isCurrent(turn) {
|
|
27597
27743
|
return this.#active === turn && !turn.ended;
|
|
27598
27744
|
}
|
|
27599
|
-
#appendText(turn, type,
|
|
27600
|
-
if (!
|
|
27745
|
+
#appendText(turn, type, text3) {
|
|
27746
|
+
if (!text3)
|
|
27601
27747
|
return;
|
|
27602
27748
|
if (turn.textItem?.type !== type)
|
|
27603
27749
|
this.#completeText(turn, { status: "succeeded" });
|
|
@@ -27605,12 +27751,12 @@ var AntigravitySession = class {
|
|
|
27605
27751
|
turn.textItem = { type, itemId: hostItemIdSchema.parse(randomUUID2()), text: "" };
|
|
27606
27752
|
this.#emit({ type: "item.started", turnId: turn.turnId, item: { ...turn.textItem } });
|
|
27607
27753
|
}
|
|
27608
|
-
turn.textItem.text +=
|
|
27754
|
+
turn.textItem.text += text3;
|
|
27609
27755
|
this.#emit({
|
|
27610
27756
|
type: "item.updated",
|
|
27611
27757
|
turnId: turn.turnId,
|
|
27612
27758
|
itemId: turn.textItem.itemId,
|
|
27613
|
-
update: { type: "text.append", text:
|
|
27759
|
+
update: { type: "text.append", text: text3 }
|
|
27614
27760
|
});
|
|
27615
27761
|
}
|
|
27616
27762
|
#completeText(turn, outcome) {
|
|
@@ -27838,25 +27984,25 @@ var AntigravityAdapter = class {
|
|
|
27838
27984
|
this.sessionImport = new AntigravitySessionImport(this.#environment);
|
|
27839
27985
|
this.usageStatistics = createAntigravityUsageStatistics(this.#environment);
|
|
27840
27986
|
}
|
|
27841
|
-
async inspect(
|
|
27987
|
+
async inspect(input2 = {}) {
|
|
27842
27988
|
if (this.#closed)
|
|
27843
27989
|
return {
|
|
27844
27990
|
status: "unavailable",
|
|
27845
27991
|
error: { code: "invalidState", message: "Adapter is closed", retryable: false }
|
|
27846
27992
|
};
|
|
27847
|
-
const cwd = path13.resolve(
|
|
27848
|
-
const key = `${cwd}\0${
|
|
27993
|
+
const cwd = path13.resolve(input2.cwd ?? process.cwd());
|
|
27994
|
+
const key = `${cwd}\0${input2.purpose ?? "catalog"}`;
|
|
27849
27995
|
const cached2 = this.#cache.get(key);
|
|
27850
27996
|
const inFlight = this.#inflight.get(key);
|
|
27851
|
-
if (!
|
|
27997
|
+
if (!input2.refresh && cached2)
|
|
27852
27998
|
return cached2;
|
|
27853
|
-
if (!
|
|
27999
|
+
if (!input2.refresh && inFlight)
|
|
27854
28000
|
return inFlight;
|
|
27855
|
-
if (
|
|
28001
|
+
if (input2.refresh) {
|
|
27856
28002
|
this.#cache.clear();
|
|
27857
28003
|
this.#inflight.clear();
|
|
27858
28004
|
}
|
|
27859
|
-
const pending = this.#inspect(cwd,
|
|
28005
|
+
const pending = this.#inspect(cwd, input2.purpose).then((result) => {
|
|
27860
28006
|
if (!this.#closed && this.#inflight.get(key) === pending && result.status === "ready")
|
|
27861
28007
|
this.#cache.set(key, result);
|
|
27862
28008
|
return result;
|
|
@@ -27911,20 +28057,20 @@ var AntigravityAdapter = class {
|
|
|
27911
28057
|
};
|
|
27912
28058
|
}
|
|
27913
28059
|
}
|
|
27914
|
-
async open(
|
|
28060
|
+
async open(input2) {
|
|
27915
28061
|
if (this.#closed)
|
|
27916
28062
|
return err("invalidState", "Adapter is closed");
|
|
27917
|
-
if (!
|
|
28063
|
+
if (!input2.cwd || !path13.isAbsolute(input2.cwd))
|
|
27918
28064
|
return err("invalidRequest", "cwd must be an absolute directory");
|
|
27919
28065
|
try {
|
|
27920
|
-
if (!(await stat2(
|
|
28066
|
+
if (!(await stat2(input2.cwd)).isDirectory())
|
|
27921
28067
|
return err("invalidRequest", "cwd is not a directory");
|
|
27922
28068
|
} catch {
|
|
27923
28069
|
return err("invalidRequest", "cwd is unavailable");
|
|
27924
28070
|
}
|
|
27925
|
-
if (
|
|
27926
|
-
const source = [...this.#sessions].find((session2) => session2.nativeRef?.nativeSessionId ===
|
|
27927
|
-
const liveSource =
|
|
28071
|
+
if (input2.kind === "fork" || input2.kind === "rollbackLastTurn") {
|
|
28072
|
+
const source = [...this.#sessions].find((session2) => session2.nativeRef?.nativeSessionId === input2.sourceRef.nativeSessionId);
|
|
28073
|
+
const liveSource = input2.kind === "fork" && source?.isActive ? source : void 0;
|
|
27928
28074
|
const release = liveSource ? void 0 : source?.reserveHistoryOperation();
|
|
27929
28075
|
if (source && !liveSource && !release)
|
|
27930
28076
|
return err("sessionBusy", "Source Session is busy; retry when idle", true);
|
|
@@ -27949,35 +28095,35 @@ var AntigravityAdapter = class {
|
|
|
27949
28095
|
}
|
|
27950
28096
|
};
|
|
27951
28097
|
try {
|
|
27952
|
-
return await (
|
|
28098
|
+
return await (input2.kind === "fork" ? forkAntigravitySession({
|
|
27953
28099
|
...common,
|
|
27954
|
-
input,
|
|
28100
|
+
input: input2,
|
|
27955
28101
|
...liveSource ? { sourceSession: liveSource } : {}
|
|
27956
|
-
}) : rollbackAntigravityLastTurn({ ...common, input }));
|
|
28102
|
+
}) : rollbackAntigravityLastTurn({ ...common, input: input2 }));
|
|
27957
28103
|
} finally {
|
|
27958
28104
|
release?.();
|
|
27959
28105
|
}
|
|
27960
28106
|
}
|
|
27961
|
-
if (
|
|
28107
|
+
if (input2.kind === "resume" && !validNativeSessionRef(input2.nativeRef, harnessId))
|
|
27962
28108
|
return err("invalidRequest", "Invalid Antigravity Native Session");
|
|
27963
|
-
const locator =
|
|
27964
|
-
const unattended =
|
|
27965
|
-
if (unattended &&
|
|
28109
|
+
const locator = input2.kind === "resume" ? input2.nativeRef.locator : void 0;
|
|
28110
|
+
const unattended = input2.kind === "create" ? input2.executionPolicy === "unattended-full-access" : !!locator && typeof locator === "object" && !Array.isArray(locator) && locator.executionPolicy === "unattended-full-access";
|
|
28111
|
+
if (unattended && input2.permissionModeId && input2.permissionModeId !== SKIP)
|
|
27966
28112
|
return err("invalidRequest", "Unattended execution requires Skip permissions");
|
|
27967
|
-
if (
|
|
28113
|
+
if (input2.permissionModeId) {
|
|
27968
28114
|
try {
|
|
27969
|
-
decodeAntigravityPermissionModeId(
|
|
28115
|
+
decodeAntigravityPermissionModeId(input2.permissionModeId);
|
|
27970
28116
|
} catch {
|
|
27971
28117
|
return err("invalidRequest", "Unknown Antigravity Permission Mode");
|
|
27972
28118
|
}
|
|
27973
28119
|
}
|
|
27974
28120
|
const session = new AntigravitySession({
|
|
27975
|
-
cwd:
|
|
27976
|
-
environment: { ...this.#environment, ...
|
|
27977
|
-
model:
|
|
27978
|
-
thinkingOptionId:
|
|
27979
|
-
permissionModeId: unattended || !
|
|
27980
|
-
...
|
|
28121
|
+
cwd: input2.cwd,
|
|
28122
|
+
environment: { ...this.#environment, ...input2.environment },
|
|
28123
|
+
model: input2.model,
|
|
28124
|
+
thinkingOptionId: input2.thinkingOptionId,
|
|
28125
|
+
permissionModeId: unattended || !input2.permissionModeId && locator && typeof locator === "object" && !Array.isArray(locator) && locator.permissionModeId === SKIP ? harnessPermissionModeIdSchema.parse(SKIP) : input2.permissionModeId,
|
|
28126
|
+
...input2.kind === "resume" ? { nativeRef: input2.nativeRef } : {},
|
|
27981
28127
|
unattended,
|
|
27982
28128
|
adapter: this.options,
|
|
27983
28129
|
onClosed: (closed) => this.#sessions.delete(closed)
|
|
@@ -27995,19 +28141,19 @@ var AntigravityAdapter = class {
|
|
|
27995
28141
|
}
|
|
27996
28142
|
}
|
|
27997
28143
|
subagents = {
|
|
27998
|
-
readSnapshot: async (
|
|
28144
|
+
readSnapshot: async (input2) => {
|
|
27999
28145
|
if (this.#closed)
|
|
28000
28146
|
return err("invalidState", "Adapter is closed");
|
|
28001
|
-
if (!validNativeSessionRef(
|
|
28147
|
+
if (!validNativeSessionRef(input2.parent, harnessId))
|
|
28002
28148
|
return err("invalidRequest", "Invalid parent Native Session");
|
|
28003
28149
|
const home = antigravityHome(this.#environment);
|
|
28004
|
-
const status = await readNativeSubagentStatus(home,
|
|
28150
|
+
const status = await readNativeSubagentStatus(home, input2.parent.nativeSessionId, input2.nativeSubagentId);
|
|
28005
28151
|
if (!status)
|
|
28006
28152
|
return err("sessionNotFound", "Native Subagent does not belong to this parent Session");
|
|
28007
28153
|
return readSubagentTranscript({
|
|
28008
|
-
parentId:
|
|
28009
|
-
childId:
|
|
28010
|
-
cwd:
|
|
28154
|
+
parentId: input2.parent.nativeSessionId,
|
|
28155
|
+
childId: input2.nativeSubagentId,
|
|
28156
|
+
cwd: input2.cwd,
|
|
28011
28157
|
status,
|
|
28012
28158
|
outputLimit: this.options.toolOutputLimit ?? 64e3,
|
|
28013
28159
|
home
|