@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 ?? ((candidate2) => isExecutableFile(candidate2, platform));
|
|
237
237
|
const runnable = spec.runnableCandidate ?? ((candidate2) => candidate2);
|
|
238
238
|
const context = { platform, isExecutable };
|
|
239
|
-
for (const { candidate: candidate2, source } of harnessCandidates(spec,
|
|
239
|
+
for (const { candidate: candidate2, source } of harnessCandidates(spec, input2, dependencies)) {
|
|
240
240
|
const executable = runnable(candidate2, 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)
|
|
@@ -361,8 +363,8 @@ function referencesNpmBin(shim, name, bin) {
|
|
|
361
363
|
if (bin.includes(".."))
|
|
362
364
|
return false;
|
|
363
365
|
const target2 = `node_modules/${name}/${bin.replace(/^\.\//, "")}`.toLowerCase();
|
|
364
|
-
const
|
|
365
|
-
return
|
|
366
|
+
const text2 = shim.replaceAll("\\", "/").toLowerCase();
|
|
367
|
+
return text2.includes(`%dp0%/${target2}"`) || text2.includes(`%~dp0/${target2}"`);
|
|
366
368
|
}
|
|
367
369
|
async function npmInstallation(command, packages, environment) {
|
|
368
370
|
let selected = await realpath(command);
|
|
@@ -371,7 +373,7 @@ async function npmInstallation(command, packages, environment) {
|
|
|
371
373
|
const root = path4.dirname(selected);
|
|
372
374
|
for (const name of packages) {
|
|
373
375
|
const directory2 = path4.join(root, "node_modules", ...name.split("/"));
|
|
374
|
-
const metadata = await readFile(path4.join(directory2, "package.json"), "utf8").then((
|
|
376
|
+
const metadata = await readFile(path4.join(directory2, "package.json"), "utf8").then((text2) => JSON.parse(text2)).catch(() => null);
|
|
375
377
|
const bins = typeof metadata?.bin === "string" ? [metadata.bin] : Object.values(metadata?.bin ?? {});
|
|
376
378
|
const bin = bins.find((entry) => referencesNpmBin(shim, name, entry));
|
|
377
379
|
if (bin) {
|
|
@@ -382,7 +384,7 @@ async function npmInstallation(command, packages, environment) {
|
|
|
382
384
|
}
|
|
383
385
|
let directory = path4.dirname(selected);
|
|
384
386
|
for (let depth = 0; depth < 8; depth++) {
|
|
385
|
-
const metadata = await readFile(path4.join(directory, "package.json"), "utf8").then((
|
|
387
|
+
const metadata = await readFile(path4.join(directory, "package.json"), "utf8").then((text2) => JSON.parse(text2)).catch(() => null);
|
|
386
388
|
if (metadata?.name && packages.includes(metadata.name)) {
|
|
387
389
|
const name = metadata.name;
|
|
388
390
|
const currentVersion = installationVersion(metadata.version);
|
|
@@ -1259,8 +1261,8 @@ function cached(getter) {
|
|
|
1259
1261
|
}
|
|
1260
1262
|
};
|
|
1261
1263
|
}
|
|
1262
|
-
function nullish(
|
|
1263
|
-
return
|
|
1264
|
+
function nullish(input2) {
|
|
1265
|
+
return input2 === null || input2 === void 0;
|
|
1264
1266
|
}
|
|
1265
1267
|
function cleanRegex(source) {
|
|
1266
1268
|
const start = source.startsWith("^") ? 1 : 0;
|
|
@@ -1347,8 +1349,8 @@ function randomString(length = 10) {
|
|
|
1347
1349
|
function esc(str) {
|
|
1348
1350
|
return JSON.stringify(str);
|
|
1349
1351
|
}
|
|
1350
|
-
function slugify(
|
|
1351
|
-
return
|
|
1352
|
+
function slugify(input2) {
|
|
1353
|
+
return input2.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, "");
|
|
1352
1354
|
}
|
|
1353
1355
|
var captureStackTrace = "captureStackTrace" in Error ? Error.captureStackTrace : (..._args) => {
|
|
1354
1356
|
};
|
|
@@ -1753,19 +1755,19 @@ function finalizeIssue(iss, ctx, config2) {
|
|
|
1753
1755
|
}
|
|
1754
1756
|
return rest;
|
|
1755
1757
|
}
|
|
1756
|
-
function getSizableOrigin(
|
|
1757
|
-
if (
|
|
1758
|
+
function getSizableOrigin(input2) {
|
|
1759
|
+
if (input2 instanceof Set)
|
|
1758
1760
|
return "set";
|
|
1759
|
-
if (
|
|
1761
|
+
if (input2 instanceof Map)
|
|
1760
1762
|
return "map";
|
|
1761
|
-
if (
|
|
1763
|
+
if (input2 instanceof File)
|
|
1762
1764
|
return "file";
|
|
1763
1765
|
return "unknown";
|
|
1764
1766
|
}
|
|
1765
|
-
function getLengthableOrigin(
|
|
1766
|
-
if (Array.isArray(
|
|
1767
|
+
function getLengthableOrigin(input2) {
|
|
1768
|
+
if (Array.isArray(input2))
|
|
1767
1769
|
return "array";
|
|
1768
|
-
if (typeof
|
|
1770
|
+
if (typeof input2 === "string")
|
|
1769
1771
|
return "string";
|
|
1770
1772
|
return "unknown";
|
|
1771
1773
|
}
|
|
@@ -1791,12 +1793,12 @@ function parsedType(data) {
|
|
|
1791
1793
|
return t;
|
|
1792
1794
|
}
|
|
1793
1795
|
function issue(...args) {
|
|
1794
|
-
const [iss,
|
|
1796
|
+
const [iss, input2, inst] = args;
|
|
1795
1797
|
if (typeof iss === "string") {
|
|
1796
1798
|
return {
|
|
1797
1799
|
message: iss,
|
|
1798
1800
|
code: "custom",
|
|
1799
|
-
input,
|
|
1801
|
+
input: input2,
|
|
1800
1802
|
inst
|
|
1801
1803
|
};
|
|
1802
1804
|
}
|
|
@@ -2340,23 +2342,23 @@ var $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat"
|
|
|
2340
2342
|
bag.pattern = integer;
|
|
2341
2343
|
});
|
|
2342
2344
|
inst._zod.check = (payload) => {
|
|
2343
|
-
const
|
|
2345
|
+
const input2 = payload.value;
|
|
2344
2346
|
if (isInt) {
|
|
2345
|
-
if (!Number.isInteger(
|
|
2347
|
+
if (!Number.isInteger(input2)) {
|
|
2346
2348
|
payload.issues.push({
|
|
2347
2349
|
expected: origin,
|
|
2348
2350
|
format: def.format,
|
|
2349
2351
|
code: "invalid_type",
|
|
2350
2352
|
continue: false,
|
|
2351
|
-
input,
|
|
2353
|
+
input: input2,
|
|
2352
2354
|
inst
|
|
2353
2355
|
});
|
|
2354
2356
|
return;
|
|
2355
2357
|
}
|
|
2356
|
-
if (!Number.isSafeInteger(
|
|
2357
|
-
if (
|
|
2358
|
+
if (!Number.isSafeInteger(input2)) {
|
|
2359
|
+
if (input2 > 0) {
|
|
2358
2360
|
payload.issues.push({
|
|
2359
|
-
input,
|
|
2361
|
+
input: input2,
|
|
2360
2362
|
code: "too_big",
|
|
2361
2363
|
maximum: Number.MAX_SAFE_INTEGER,
|
|
2362
2364
|
note: "Integers must be within the safe integer range.",
|
|
@@ -2367,7 +2369,7 @@ var $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat"
|
|
|
2367
2369
|
});
|
|
2368
2370
|
} else {
|
|
2369
2371
|
payload.issues.push({
|
|
2370
|
-
input,
|
|
2372
|
+
input: input2,
|
|
2371
2373
|
code: "too_small",
|
|
2372
2374
|
minimum: Number.MIN_SAFE_INTEGER,
|
|
2373
2375
|
note: "Integers must be within the safe integer range.",
|
|
@@ -2380,10 +2382,10 @@ var $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat"
|
|
|
2380
2382
|
return;
|
|
2381
2383
|
}
|
|
2382
2384
|
}
|
|
2383
|
-
if (
|
|
2385
|
+
if (input2 < minimum) {
|
|
2384
2386
|
payload.issues.push({
|
|
2385
2387
|
origin: "number",
|
|
2386
|
-
input,
|
|
2388
|
+
input: input2,
|
|
2387
2389
|
code: "too_small",
|
|
2388
2390
|
minimum,
|
|
2389
2391
|
inclusive: true,
|
|
@@ -2391,10 +2393,10 @@ var $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat"
|
|
|
2391
2393
|
continue: !def.abort
|
|
2392
2394
|
});
|
|
2393
2395
|
}
|
|
2394
|
-
if (
|
|
2396
|
+
if (input2 > maximum) {
|
|
2395
2397
|
payload.issues.push({
|
|
2396
2398
|
origin: "number",
|
|
2397
|
-
input,
|
|
2399
|
+
input: input2,
|
|
2398
2400
|
code: "too_big",
|
|
2399
2401
|
maximum,
|
|
2400
2402
|
inclusive: true,
|
|
@@ -2414,11 +2416,11 @@ var $ZodCheckBigIntFormat = /* @__PURE__ */ $constructor("$ZodCheckBigIntFormat"
|
|
|
2414
2416
|
bag.maximum = maximum;
|
|
2415
2417
|
});
|
|
2416
2418
|
inst._zod.check = (payload) => {
|
|
2417
|
-
const
|
|
2418
|
-
if (
|
|
2419
|
+
const input2 = payload.value;
|
|
2420
|
+
if (input2 < minimum) {
|
|
2419
2421
|
payload.issues.push({
|
|
2420
2422
|
origin: "bigint",
|
|
2421
|
-
input,
|
|
2423
|
+
input: input2,
|
|
2422
2424
|
code: "too_small",
|
|
2423
2425
|
minimum,
|
|
2424
2426
|
inclusive: true,
|
|
@@ -2426,10 +2428,10 @@ var $ZodCheckBigIntFormat = /* @__PURE__ */ $constructor("$ZodCheckBigIntFormat"
|
|
|
2426
2428
|
continue: !def.abort
|
|
2427
2429
|
});
|
|
2428
2430
|
}
|
|
2429
|
-
if (
|
|
2431
|
+
if (input2 > maximum) {
|
|
2430
2432
|
payload.issues.push({
|
|
2431
2433
|
origin: "bigint",
|
|
2432
|
-
input,
|
|
2434
|
+
input: input2,
|
|
2433
2435
|
code: "too_big",
|
|
2434
2436
|
maximum,
|
|
2435
2437
|
inclusive: true,
|
|
@@ -2452,16 +2454,16 @@ var $ZodCheckMaxSize = /* @__PURE__ */ $constructor("$ZodCheckMaxSize", (inst, d
|
|
|
2452
2454
|
inst2._zod.bag.maximum = def.maximum;
|
|
2453
2455
|
});
|
|
2454
2456
|
inst._zod.check = (payload) => {
|
|
2455
|
-
const
|
|
2456
|
-
const size =
|
|
2457
|
+
const input2 = payload.value;
|
|
2458
|
+
const size = input2.size;
|
|
2457
2459
|
if (size <= def.maximum)
|
|
2458
2460
|
return;
|
|
2459
2461
|
payload.issues.push({
|
|
2460
|
-
origin: getSizableOrigin(
|
|
2462
|
+
origin: getSizableOrigin(input2),
|
|
2461
2463
|
code: "too_big",
|
|
2462
2464
|
maximum: def.maximum,
|
|
2463
2465
|
inclusive: true,
|
|
2464
|
-
input,
|
|
2466
|
+
input: input2,
|
|
2465
2467
|
inst,
|
|
2466
2468
|
continue: !def.abort
|
|
2467
2469
|
});
|
|
@@ -2480,16 +2482,16 @@ var $ZodCheckMinSize = /* @__PURE__ */ $constructor("$ZodCheckMinSize", (inst, d
|
|
|
2480
2482
|
inst2._zod.bag.minimum = def.minimum;
|
|
2481
2483
|
});
|
|
2482
2484
|
inst._zod.check = (payload) => {
|
|
2483
|
-
const
|
|
2484
|
-
const size =
|
|
2485
|
+
const input2 = payload.value;
|
|
2486
|
+
const size = input2.size;
|
|
2485
2487
|
if (size >= def.minimum)
|
|
2486
2488
|
return;
|
|
2487
2489
|
payload.issues.push({
|
|
2488
|
-
origin: getSizableOrigin(
|
|
2490
|
+
origin: getSizableOrigin(input2),
|
|
2489
2491
|
code: "too_small",
|
|
2490
2492
|
minimum: def.minimum,
|
|
2491
2493
|
inclusive: true,
|
|
2492
|
-
input,
|
|
2494
|
+
input: input2,
|
|
2493
2495
|
inst,
|
|
2494
2496
|
continue: !def.abort
|
|
2495
2497
|
});
|
|
@@ -2509,13 +2511,13 @@ var $ZodCheckSizeEquals = /* @__PURE__ */ $constructor("$ZodCheckSizeEquals", (i
|
|
|
2509
2511
|
bag.size = def.size;
|
|
2510
2512
|
});
|
|
2511
2513
|
inst._zod.check = (payload) => {
|
|
2512
|
-
const
|
|
2513
|
-
const size =
|
|
2514
|
+
const input2 = payload.value;
|
|
2515
|
+
const size = input2.size;
|
|
2514
2516
|
if (size === def.size)
|
|
2515
2517
|
return;
|
|
2516
2518
|
const tooBig = size > def.size;
|
|
2517
2519
|
payload.issues.push({
|
|
2518
|
-
origin: getSizableOrigin(
|
|
2520
|
+
origin: getSizableOrigin(input2),
|
|
2519
2521
|
...tooBig ? { code: "too_big", maximum: def.size } : { code: "too_small", minimum: def.size },
|
|
2520
2522
|
inclusive: true,
|
|
2521
2523
|
exact: true,
|
|
@@ -2538,17 +2540,17 @@ var $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (ins
|
|
|
2538
2540
|
inst2._zod.bag.maximum = def.maximum;
|
|
2539
2541
|
});
|
|
2540
2542
|
inst._zod.check = (payload) => {
|
|
2541
|
-
const
|
|
2542
|
-
const length =
|
|
2543
|
+
const input2 = payload.value;
|
|
2544
|
+
const length = input2.length;
|
|
2543
2545
|
if (length <= def.maximum)
|
|
2544
2546
|
return;
|
|
2545
|
-
const origin = getLengthableOrigin(
|
|
2547
|
+
const origin = getLengthableOrigin(input2);
|
|
2546
2548
|
payload.issues.push({
|
|
2547
2549
|
origin,
|
|
2548
2550
|
code: "too_big",
|
|
2549
2551
|
maximum: def.maximum,
|
|
2550
2552
|
inclusive: true,
|
|
2551
|
-
input,
|
|
2553
|
+
input: input2,
|
|
2552
2554
|
inst,
|
|
2553
2555
|
continue: !def.abort
|
|
2554
2556
|
});
|
|
@@ -2567,17 +2569,17 @@ var $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (ins
|
|
|
2567
2569
|
inst2._zod.bag.minimum = def.minimum;
|
|
2568
2570
|
});
|
|
2569
2571
|
inst._zod.check = (payload) => {
|
|
2570
|
-
const
|
|
2571
|
-
const length =
|
|
2572
|
+
const input2 = payload.value;
|
|
2573
|
+
const length = input2.length;
|
|
2572
2574
|
if (length >= def.minimum)
|
|
2573
2575
|
return;
|
|
2574
|
-
const origin = getLengthableOrigin(
|
|
2576
|
+
const origin = getLengthableOrigin(input2);
|
|
2575
2577
|
payload.issues.push({
|
|
2576
2578
|
origin,
|
|
2577
2579
|
code: "too_small",
|
|
2578
2580
|
minimum: def.minimum,
|
|
2579
2581
|
inclusive: true,
|
|
2580
|
-
input,
|
|
2582
|
+
input: input2,
|
|
2581
2583
|
inst,
|
|
2582
2584
|
continue: !def.abort
|
|
2583
2585
|
});
|
|
@@ -2597,11 +2599,11 @@ var $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEquals"
|
|
|
2597
2599
|
bag.length = def.length;
|
|
2598
2600
|
});
|
|
2599
2601
|
inst._zod.check = (payload) => {
|
|
2600
|
-
const
|
|
2601
|
-
const length =
|
|
2602
|
+
const input2 = payload.value;
|
|
2603
|
+
const length = input2.length;
|
|
2602
2604
|
if (length === def.length)
|
|
2603
2605
|
return;
|
|
2604
|
-
const origin = getLengthableOrigin(
|
|
2606
|
+
const origin = getLengthableOrigin(input2);
|
|
2605
2607
|
const tooBig = length > def.length;
|
|
2606
2608
|
payload.issues.push({
|
|
2607
2609
|
origin,
|
|
@@ -3272,15 +3274,15 @@ var $ZodNumber = /* @__PURE__ */ $constructor("$ZodNumber", (inst, def) => {
|
|
|
3272
3274
|
payload.value = Number(payload.value);
|
|
3273
3275
|
} catch (_) {
|
|
3274
3276
|
}
|
|
3275
|
-
const
|
|
3276
|
-
if (typeof
|
|
3277
|
+
const input2 = payload.value;
|
|
3278
|
+
if (typeof input2 === "number" && !Number.isNaN(input2) && Number.isFinite(input2)) {
|
|
3277
3279
|
return payload;
|
|
3278
3280
|
}
|
|
3279
|
-
const received = typeof
|
|
3281
|
+
const received = typeof input2 === "number" ? Number.isNaN(input2) ? "NaN" : !Number.isFinite(input2) ? "Infinity" : void 0 : void 0;
|
|
3280
3282
|
payload.issues.push({
|
|
3281
3283
|
expected: "number",
|
|
3282
3284
|
code: "invalid_type",
|
|
3283
|
-
input,
|
|
3285
|
+
input: input2,
|
|
3284
3286
|
inst,
|
|
3285
3287
|
...received ? { received } : {}
|
|
3286
3288
|
});
|
|
@@ -3300,13 +3302,13 @@ var $ZodBoolean = /* @__PURE__ */ $constructor("$ZodBoolean", (inst, def) => {
|
|
|
3300
3302
|
payload.value = Boolean(payload.value);
|
|
3301
3303
|
} catch (_) {
|
|
3302
3304
|
}
|
|
3303
|
-
const
|
|
3304
|
-
if (typeof
|
|
3305
|
+
const input2 = payload.value;
|
|
3306
|
+
if (typeof input2 === "boolean")
|
|
3305
3307
|
return payload;
|
|
3306
3308
|
payload.issues.push({
|
|
3307
3309
|
expected: "boolean",
|
|
3308
3310
|
code: "invalid_type",
|
|
3309
|
-
input,
|
|
3311
|
+
input: input2,
|
|
3310
3312
|
inst
|
|
3311
3313
|
});
|
|
3312
3314
|
return payload;
|
|
@@ -3339,13 +3341,13 @@ var $ZodBigIntFormat = /* @__PURE__ */ $constructor("$ZodBigIntFormat", (inst, d
|
|
|
3339
3341
|
var $ZodSymbol = /* @__PURE__ */ $constructor("$ZodSymbol", (inst, def) => {
|
|
3340
3342
|
$ZodType.init(inst, def);
|
|
3341
3343
|
inst._zod.parse = (payload, _ctx) => {
|
|
3342
|
-
const
|
|
3343
|
-
if (typeof
|
|
3344
|
+
const input2 = payload.value;
|
|
3345
|
+
if (typeof input2 === "symbol")
|
|
3344
3346
|
return payload;
|
|
3345
3347
|
payload.issues.push({
|
|
3346
3348
|
expected: "symbol",
|
|
3347
3349
|
code: "invalid_type",
|
|
3348
|
-
input,
|
|
3350
|
+
input: input2,
|
|
3349
3351
|
inst
|
|
3350
3352
|
});
|
|
3351
3353
|
return payload;
|
|
@@ -3356,13 +3358,13 @@ var $ZodUndefined = /* @__PURE__ */ $constructor("$ZodUndefined", (inst, def) =>
|
|
|
3356
3358
|
inst._zod.pattern = _undefined;
|
|
3357
3359
|
inst._zod.values = /* @__PURE__ */ new Set([void 0]);
|
|
3358
3360
|
inst._zod.parse = (payload, _ctx) => {
|
|
3359
|
-
const
|
|
3360
|
-
if (typeof
|
|
3361
|
+
const input2 = payload.value;
|
|
3362
|
+
if (typeof input2 === "undefined")
|
|
3361
3363
|
return payload;
|
|
3362
3364
|
payload.issues.push({
|
|
3363
3365
|
expected: "undefined",
|
|
3364
3366
|
code: "invalid_type",
|
|
3365
|
-
input,
|
|
3367
|
+
input: input2,
|
|
3366
3368
|
inst
|
|
3367
3369
|
});
|
|
3368
3370
|
return payload;
|
|
@@ -3373,13 +3375,13 @@ var $ZodNull = /* @__PURE__ */ $constructor("$ZodNull", (inst, def) => {
|
|
|
3373
3375
|
inst._zod.pattern = _null;
|
|
3374
3376
|
inst._zod.values = /* @__PURE__ */ new Set([null]);
|
|
3375
3377
|
inst._zod.parse = (payload, _ctx) => {
|
|
3376
|
-
const
|
|
3377
|
-
if (
|
|
3378
|
+
const input2 = payload.value;
|
|
3379
|
+
if (input2 === null)
|
|
3378
3380
|
return payload;
|
|
3379
3381
|
payload.issues.push({
|
|
3380
3382
|
expected: "null",
|
|
3381
3383
|
code: "invalid_type",
|
|
3382
|
-
input,
|
|
3384
|
+
input: input2,
|
|
3383
3385
|
inst
|
|
3384
3386
|
});
|
|
3385
3387
|
return payload;
|
|
@@ -3408,13 +3410,13 @@ var $ZodNever = /* @__PURE__ */ $constructor("$ZodNever", (inst, def) => {
|
|
|
3408
3410
|
var $ZodVoid = /* @__PURE__ */ $constructor("$ZodVoid", (inst, def) => {
|
|
3409
3411
|
$ZodType.init(inst, def);
|
|
3410
3412
|
inst._zod.parse = (payload, _ctx) => {
|
|
3411
|
-
const
|
|
3412
|
-
if (typeof
|
|
3413
|
+
const input2 = payload.value;
|
|
3414
|
+
if (typeof input2 === "undefined")
|
|
3413
3415
|
return payload;
|
|
3414
3416
|
payload.issues.push({
|
|
3415
3417
|
expected: "void",
|
|
3416
3418
|
code: "invalid_type",
|
|
3417
|
-
input,
|
|
3419
|
+
input: input2,
|
|
3418
3420
|
inst
|
|
3419
3421
|
});
|
|
3420
3422
|
return payload;
|
|
@@ -3429,15 +3431,15 @@ var $ZodDate = /* @__PURE__ */ $constructor("$ZodDate", (inst, def) => {
|
|
|
3429
3431
|
} catch (_err) {
|
|
3430
3432
|
}
|
|
3431
3433
|
}
|
|
3432
|
-
const
|
|
3433
|
-
const isDate =
|
|
3434
|
-
const isValidDate = isDate && !Number.isNaN(
|
|
3434
|
+
const input2 = payload.value;
|
|
3435
|
+
const isDate = input2 instanceof Date;
|
|
3436
|
+
const isValidDate = isDate && !Number.isNaN(input2.getTime());
|
|
3435
3437
|
if (isValidDate)
|
|
3436
3438
|
return payload;
|
|
3437
3439
|
payload.issues.push({
|
|
3438
3440
|
expected: "date",
|
|
3439
3441
|
code: "invalid_type",
|
|
3440
|
-
input,
|
|
3442
|
+
input: input2,
|
|
3441
3443
|
...isDate ? { received: "Invalid Date" } : {},
|
|
3442
3444
|
inst
|
|
3443
3445
|
});
|
|
@@ -3453,20 +3455,20 @@ function handleArrayResult(result, final, index) {
|
|
|
3453
3455
|
var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
|
|
3454
3456
|
$ZodType.init(inst, def);
|
|
3455
3457
|
inst._zod.parse = (payload, ctx) => {
|
|
3456
|
-
const
|
|
3457
|
-
if (!Array.isArray(
|
|
3458
|
+
const input2 = payload.value;
|
|
3459
|
+
if (!Array.isArray(input2)) {
|
|
3458
3460
|
payload.issues.push({
|
|
3459
3461
|
expected: "array",
|
|
3460
3462
|
code: "invalid_type",
|
|
3461
|
-
input,
|
|
3463
|
+
input: input2,
|
|
3462
3464
|
inst
|
|
3463
3465
|
});
|
|
3464
3466
|
return payload;
|
|
3465
3467
|
}
|
|
3466
|
-
payload.value = Array(
|
|
3468
|
+
payload.value = Array(input2.length);
|
|
3467
3469
|
const proms = [];
|
|
3468
|
-
for (let i = 0; i <
|
|
3469
|
-
const item =
|
|
3470
|
+
for (let i = 0; i < input2.length; i++) {
|
|
3471
|
+
const item = input2[i];
|
|
3470
3472
|
const result = def.element._zod.run({
|
|
3471
3473
|
value: item,
|
|
3472
3474
|
issues: []
|
|
@@ -3483,8 +3485,8 @@ var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
|
|
|
3483
3485
|
return payload;
|
|
3484
3486
|
};
|
|
3485
3487
|
});
|
|
3486
|
-
function handlePropertyResult(result, final, key,
|
|
3487
|
-
const isPresent = key in
|
|
3488
|
+
function handlePropertyResult(result, final, key, input2, isOptionalIn, isOptionalOut) {
|
|
3489
|
+
const isPresent = key in input2;
|
|
3488
3490
|
if (result.issues.length) {
|
|
3489
3491
|
if (isOptionalIn && isOptionalOut && !isPresent) {
|
|
3490
3492
|
return;
|
|
@@ -3526,14 +3528,14 @@ function normalizeDef(def) {
|
|
|
3526
3528
|
optionalKeys: new Set(okeys)
|
|
3527
3529
|
};
|
|
3528
3530
|
}
|
|
3529
|
-
function handleCatchall(proms,
|
|
3531
|
+
function handleCatchall(proms, input2, payload, ctx, def, inst) {
|
|
3530
3532
|
const unrecognized = [];
|
|
3531
3533
|
const keySet = def.keySet;
|
|
3532
3534
|
const _catchall = def.catchall._zod;
|
|
3533
3535
|
const t = _catchall.def.type;
|
|
3534
3536
|
const isOptionalIn = _catchall.optin === "optional";
|
|
3535
3537
|
const isOptionalOut = _catchall.optout === "optional";
|
|
3536
|
-
for (const key in
|
|
3538
|
+
for (const key in input2) {
|
|
3537
3539
|
if (key === "__proto__")
|
|
3538
3540
|
continue;
|
|
3539
3541
|
if (keySet.has(key))
|
|
@@ -3542,18 +3544,18 @@ function handleCatchall(proms, input, payload, ctx, def, inst) {
|
|
|
3542
3544
|
unrecognized.push(key);
|
|
3543
3545
|
continue;
|
|
3544
3546
|
}
|
|
3545
|
-
const r = _catchall.run({ value:
|
|
3547
|
+
const r = _catchall.run({ value: input2[key], issues: [] }, ctx);
|
|
3546
3548
|
if (r instanceof Promise) {
|
|
3547
|
-
proms.push(r.then((r2) => handlePropertyResult(r2, payload, key,
|
|
3549
|
+
proms.push(r.then((r2) => handlePropertyResult(r2, payload, key, input2, isOptionalIn, isOptionalOut)));
|
|
3548
3550
|
} else {
|
|
3549
|
-
handlePropertyResult(r, payload, key,
|
|
3551
|
+
handlePropertyResult(r, payload, key, input2, isOptionalIn, isOptionalOut);
|
|
3550
3552
|
}
|
|
3551
3553
|
}
|
|
3552
3554
|
if (unrecognized.length) {
|
|
3553
3555
|
payload.issues.push({
|
|
3554
3556
|
code: "unrecognized_keys",
|
|
3555
3557
|
keys: unrecognized,
|
|
3556
|
-
input,
|
|
3558
|
+
input: input2,
|
|
3557
3559
|
inst
|
|
3558
3560
|
});
|
|
3559
3561
|
}
|
|
@@ -3597,12 +3599,12 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
|
3597
3599
|
let value;
|
|
3598
3600
|
inst._zod.parse = (payload, ctx) => {
|
|
3599
3601
|
value ?? (value = _normalized.value);
|
|
3600
|
-
const
|
|
3601
|
-
if (!isObject2(
|
|
3602
|
+
const input2 = payload.value;
|
|
3603
|
+
if (!isObject2(input2)) {
|
|
3602
3604
|
payload.issues.push({
|
|
3603
3605
|
expected: "object",
|
|
3604
3606
|
code: "invalid_type",
|
|
3605
|
-
input,
|
|
3607
|
+
input: input2,
|
|
3606
3608
|
inst
|
|
3607
3609
|
});
|
|
3608
3610
|
return payload;
|
|
@@ -3614,17 +3616,17 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
|
3614
3616
|
const el = shape[key];
|
|
3615
3617
|
const isOptionalIn = el._zod.optin === "optional";
|
|
3616
3618
|
const isOptionalOut = el._zod.optout === "optional";
|
|
3617
|
-
const r = el._zod.run({ value:
|
|
3619
|
+
const r = el._zod.run({ value: input2[key], issues: [] }, ctx);
|
|
3618
3620
|
if (r instanceof Promise) {
|
|
3619
|
-
proms.push(r.then((r2) => handlePropertyResult(r2, payload, key,
|
|
3621
|
+
proms.push(r.then((r2) => handlePropertyResult(r2, payload, key, input2, isOptionalIn, isOptionalOut)));
|
|
3620
3622
|
} else {
|
|
3621
|
-
handlePropertyResult(r, payload, key,
|
|
3623
|
+
handlePropertyResult(r, payload, key, input2, isOptionalIn, isOptionalOut);
|
|
3622
3624
|
}
|
|
3623
3625
|
}
|
|
3624
3626
|
if (!catchall) {
|
|
3625
3627
|
return proms.length ? Promise.all(proms).then(() => payload) : payload;
|
|
3626
3628
|
}
|
|
3627
|
-
return handleCatchall(proms,
|
|
3629
|
+
return handleCatchall(proms, input2, payload, ctx, _normalized.value, inst);
|
|
3628
3630
|
};
|
|
3629
3631
|
});
|
|
3630
3632
|
var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) => {
|
|
@@ -3733,12 +3735,12 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
|
|
|
3733
3735
|
let value;
|
|
3734
3736
|
inst._zod.parse = (payload, ctx) => {
|
|
3735
3737
|
value ?? (value = _normalized.value);
|
|
3736
|
-
const
|
|
3737
|
-
if (!isObject2(
|
|
3738
|
+
const input2 = payload.value;
|
|
3739
|
+
if (!isObject2(input2)) {
|
|
3738
3740
|
payload.issues.push({
|
|
3739
3741
|
expected: "object",
|
|
3740
3742
|
code: "invalid_type",
|
|
3741
|
-
input,
|
|
3743
|
+
input: input2,
|
|
3742
3744
|
inst
|
|
3743
3745
|
});
|
|
3744
3746
|
return payload;
|
|
@@ -3749,7 +3751,7 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
|
|
|
3749
3751
|
payload = fastpass(payload, ctx);
|
|
3750
3752
|
if (!catchall)
|
|
3751
3753
|
return payload;
|
|
3752
|
-
return handleCatchall([],
|
|
3754
|
+
return handleCatchall([], input2, payload, ctx, value, inst);
|
|
3753
3755
|
}
|
|
3754
3756
|
return superParse(payload, ctx);
|
|
3755
3757
|
};
|
|
@@ -3909,17 +3911,17 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
|
|
|
3909
3911
|
return map2;
|
|
3910
3912
|
});
|
|
3911
3913
|
inst._zod.parse = (payload, ctx) => {
|
|
3912
|
-
const
|
|
3913
|
-
if (!isObject(
|
|
3914
|
+
const input2 = payload.value;
|
|
3915
|
+
if (!isObject(input2)) {
|
|
3914
3916
|
payload.issues.push({
|
|
3915
3917
|
code: "invalid_type",
|
|
3916
3918
|
expected: "object",
|
|
3917
|
-
input,
|
|
3919
|
+
input: input2,
|
|
3918
3920
|
inst
|
|
3919
3921
|
});
|
|
3920
3922
|
return payload;
|
|
3921
3923
|
}
|
|
3922
|
-
const opt = disc.value.get(
|
|
3924
|
+
const opt = disc.value.get(input2?.[def.discriminator]);
|
|
3923
3925
|
if (opt) {
|
|
3924
3926
|
return opt._zod.run(payload, ctx);
|
|
3925
3927
|
}
|
|
@@ -3932,7 +3934,7 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
|
|
|
3932
3934
|
note: "No matching discriminator",
|
|
3933
3935
|
discriminator: def.discriminator,
|
|
3934
3936
|
options: Array.from(disc.value.keys()),
|
|
3935
|
-
input,
|
|
3937
|
+
input: input2,
|
|
3936
3938
|
path: [def.discriminator],
|
|
3937
3939
|
inst
|
|
3938
3940
|
});
|
|
@@ -3942,9 +3944,9 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
|
|
|
3942
3944
|
var $ZodIntersection = /* @__PURE__ */ $constructor("$ZodIntersection", (inst, def) => {
|
|
3943
3945
|
$ZodType.init(inst, def);
|
|
3944
3946
|
inst._zod.parse = (payload, ctx) => {
|
|
3945
|
-
const
|
|
3946
|
-
const left = def.left._zod.run({ value:
|
|
3947
|
-
const right = def.right._zod.run({ value:
|
|
3947
|
+
const input2 = payload.value;
|
|
3948
|
+
const left = def.left._zod.run({ value: input2, issues: [] }, ctx);
|
|
3949
|
+
const right = def.right._zod.run({ value: input2, issues: [] }, ctx);
|
|
3948
3950
|
const async = left instanceof Promise || right instanceof Promise;
|
|
3949
3951
|
if (async) {
|
|
3950
3952
|
return Promise.all([left, right]).then(([left2, right2]) => {
|
|
@@ -4041,10 +4043,10 @@ var $ZodTuple = /* @__PURE__ */ $constructor("$ZodTuple", (inst, def) => {
|
|
|
4041
4043
|
$ZodType.init(inst, def);
|
|
4042
4044
|
const items = def.items;
|
|
4043
4045
|
inst._zod.parse = (payload, ctx) => {
|
|
4044
|
-
const
|
|
4045
|
-
if (!Array.isArray(
|
|
4046
|
+
const input2 = payload.value;
|
|
4047
|
+
if (!Array.isArray(input2)) {
|
|
4046
4048
|
payload.issues.push({
|
|
4047
|
-
input,
|
|
4049
|
+
input: input2,
|
|
4048
4050
|
inst,
|
|
4049
4051
|
expected: "tuple",
|
|
4050
4052
|
code: "invalid_type"
|
|
@@ -4056,23 +4058,23 @@ var $ZodTuple = /* @__PURE__ */ $constructor("$ZodTuple", (inst, def) => {
|
|
|
4056
4058
|
const optinStart = getTupleOptStart(items, "optin");
|
|
4057
4059
|
const optoutStart = getTupleOptStart(items, "optout");
|
|
4058
4060
|
if (!def.rest) {
|
|
4059
|
-
if (
|
|
4061
|
+
if (input2.length < optinStart) {
|
|
4060
4062
|
payload.issues.push({
|
|
4061
4063
|
code: "too_small",
|
|
4062
4064
|
minimum: optinStart,
|
|
4063
4065
|
inclusive: true,
|
|
4064
|
-
input,
|
|
4066
|
+
input: input2,
|
|
4065
4067
|
inst,
|
|
4066
4068
|
origin: "array"
|
|
4067
4069
|
});
|
|
4068
4070
|
return payload;
|
|
4069
4071
|
}
|
|
4070
|
-
if (
|
|
4072
|
+
if (input2.length > items.length) {
|
|
4071
4073
|
payload.issues.push({
|
|
4072
4074
|
code: "too_big",
|
|
4073
4075
|
maximum: items.length,
|
|
4074
4076
|
inclusive: true,
|
|
4075
|
-
input,
|
|
4077
|
+
input: input2,
|
|
4076
4078
|
inst,
|
|
4077
4079
|
origin: "array"
|
|
4078
4080
|
});
|
|
@@ -4080,7 +4082,7 @@ var $ZodTuple = /* @__PURE__ */ $constructor("$ZodTuple", (inst, def) => {
|
|
|
4080
4082
|
}
|
|
4081
4083
|
const itemResults = new Array(items.length);
|
|
4082
4084
|
for (let i = 0; i < items.length; i++) {
|
|
4083
|
-
const r = items[i]._zod.run({ value:
|
|
4085
|
+
const r = items[i]._zod.run({ value: input2[i], issues: [] }, ctx);
|
|
4084
4086
|
if (r instanceof Promise) {
|
|
4085
4087
|
proms.push(r.then((rr) => {
|
|
4086
4088
|
itemResults[i] = rr;
|
|
@@ -4091,7 +4093,7 @@ var $ZodTuple = /* @__PURE__ */ $constructor("$ZodTuple", (inst, def) => {
|
|
|
4091
4093
|
}
|
|
4092
4094
|
if (def.rest) {
|
|
4093
4095
|
let i = items.length - 1;
|
|
4094
|
-
const rest =
|
|
4096
|
+
const rest = input2.slice(items.length);
|
|
4095
4097
|
for (const el of rest) {
|
|
4096
4098
|
i++;
|
|
4097
4099
|
const result = def.rest._zod.run({ value: el, issues: [] }, ctx);
|
|
@@ -4103,9 +4105,9 @@ var $ZodTuple = /* @__PURE__ */ $constructor("$ZodTuple", (inst, def) => {
|
|
|
4103
4105
|
}
|
|
4104
4106
|
}
|
|
4105
4107
|
if (proms.length) {
|
|
4106
|
-
return Promise.all(proms).then(() => handleTupleResults(itemResults, payload, items,
|
|
4108
|
+
return Promise.all(proms).then(() => handleTupleResults(itemResults, payload, items, input2, optoutStart));
|
|
4107
4109
|
}
|
|
4108
|
-
return handleTupleResults(itemResults, payload, items,
|
|
4110
|
+
return handleTupleResults(itemResults, payload, items, input2, optoutStart);
|
|
4109
4111
|
};
|
|
4110
4112
|
});
|
|
4111
4113
|
function getTupleOptStart(items, key) {
|
|
@@ -4121,10 +4123,10 @@ function handleTupleResult(result, final, index) {
|
|
|
4121
4123
|
}
|
|
4122
4124
|
final.value[index] = result.value;
|
|
4123
4125
|
}
|
|
4124
|
-
function handleTupleResults(itemResults, final, items,
|
|
4126
|
+
function handleTupleResults(itemResults, final, items, input2, optoutStart) {
|
|
4125
4127
|
for (let i = 0; i < items.length; i++) {
|
|
4126
4128
|
const r = itemResults[i];
|
|
4127
|
-
const isPresent = i <
|
|
4129
|
+
const isPresent = i < input2.length;
|
|
4128
4130
|
if (r.issues.length) {
|
|
4129
4131
|
if (!isPresent && i >= optoutStart) {
|
|
4130
4132
|
final.value.length = i;
|
|
@@ -4134,7 +4136,7 @@ function handleTupleResults(itemResults, final, items, input, optoutStart) {
|
|
|
4134
4136
|
}
|
|
4135
4137
|
final.value[i] = r.value;
|
|
4136
4138
|
}
|
|
4137
|
-
for (let i = final.value.length - 1; i >=
|
|
4139
|
+
for (let i = final.value.length - 1; i >= input2.length; i--) {
|
|
4138
4140
|
if (items[i]._zod.optout === "optional" && final.value[i] === void 0) {
|
|
4139
4141
|
final.value.length = i;
|
|
4140
4142
|
} else {
|
|
@@ -4146,12 +4148,12 @@ function handleTupleResults(itemResults, final, items, input, optoutStart) {
|
|
|
4146
4148
|
var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
4147
4149
|
$ZodType.init(inst, def);
|
|
4148
4150
|
inst._zod.parse = (payload, ctx) => {
|
|
4149
|
-
const
|
|
4150
|
-
if (!isPlainObject(
|
|
4151
|
+
const input2 = payload.value;
|
|
4152
|
+
if (!isPlainObject(input2)) {
|
|
4151
4153
|
payload.issues.push({
|
|
4152
4154
|
expected: "record",
|
|
4153
4155
|
code: "invalid_type",
|
|
4154
|
-
input,
|
|
4156
|
+
input: input2,
|
|
4155
4157
|
inst
|
|
4156
4158
|
});
|
|
4157
4159
|
return payload;
|
|
@@ -4180,7 +4182,7 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
4180
4182
|
continue;
|
|
4181
4183
|
}
|
|
4182
4184
|
const outKey = keyResult.value;
|
|
4183
|
-
const result = def.valueType._zod.run({ value:
|
|
4185
|
+
const result = def.valueType._zod.run({ value: input2[key], issues: [] }, ctx);
|
|
4184
4186
|
if (result instanceof Promise) {
|
|
4185
4187
|
proms.push(result.then((result2) => {
|
|
4186
4188
|
if (result2.issues.length) {
|
|
@@ -4197,7 +4199,7 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
4197
4199
|
}
|
|
4198
4200
|
}
|
|
4199
4201
|
let unrecognized;
|
|
4200
|
-
for (const key in
|
|
4202
|
+
for (const key in input2) {
|
|
4201
4203
|
if (!recordKeys.has(key)) {
|
|
4202
4204
|
unrecognized = unrecognized ?? [];
|
|
4203
4205
|
unrecognized.push(key);
|
|
@@ -4206,17 +4208,17 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
4206
4208
|
if (unrecognized && unrecognized.length > 0) {
|
|
4207
4209
|
payload.issues.push({
|
|
4208
4210
|
code: "unrecognized_keys",
|
|
4209
|
-
input,
|
|
4211
|
+
input: input2,
|
|
4210
4212
|
inst,
|
|
4211
4213
|
keys: unrecognized
|
|
4212
4214
|
});
|
|
4213
4215
|
}
|
|
4214
4216
|
} else {
|
|
4215
4217
|
payload.value = {};
|
|
4216
|
-
for (const key of Reflect.ownKeys(
|
|
4218
|
+
for (const key of Reflect.ownKeys(input2)) {
|
|
4217
4219
|
if (key === "__proto__")
|
|
4218
4220
|
continue;
|
|
4219
|
-
if (!Object.prototype.propertyIsEnumerable.call(
|
|
4221
|
+
if (!Object.prototype.propertyIsEnumerable.call(input2, key))
|
|
4220
4222
|
continue;
|
|
4221
4223
|
let keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);
|
|
4222
4224
|
if (keyResult instanceof Promise) {
|
|
@@ -4234,7 +4236,7 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
4234
4236
|
}
|
|
4235
4237
|
if (keyResult.issues.length) {
|
|
4236
4238
|
if (def.mode === "loose") {
|
|
4237
|
-
payload.value[key] =
|
|
4239
|
+
payload.value[key] = input2[key];
|
|
4238
4240
|
} else {
|
|
4239
4241
|
payload.issues.push({
|
|
4240
4242
|
code: "invalid_key",
|
|
@@ -4247,7 +4249,7 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
4247
4249
|
}
|
|
4248
4250
|
continue;
|
|
4249
4251
|
}
|
|
4250
|
-
const result = def.valueType._zod.run({ value:
|
|
4252
|
+
const result = def.valueType._zod.run({ value: input2[key], issues: [] }, ctx);
|
|
4251
4253
|
if (result instanceof Promise) {
|
|
4252
4254
|
proms.push(result.then((result2) => {
|
|
4253
4255
|
if (result2.issues.length) {
|
|
@@ -4272,27 +4274,27 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
4272
4274
|
var $ZodMap = /* @__PURE__ */ $constructor("$ZodMap", (inst, def) => {
|
|
4273
4275
|
$ZodType.init(inst, def);
|
|
4274
4276
|
inst._zod.parse = (payload, ctx) => {
|
|
4275
|
-
const
|
|
4276
|
-
if (!(
|
|
4277
|
+
const input2 = payload.value;
|
|
4278
|
+
if (!(input2 instanceof Map)) {
|
|
4277
4279
|
payload.issues.push({
|
|
4278
4280
|
expected: "map",
|
|
4279
4281
|
code: "invalid_type",
|
|
4280
|
-
input,
|
|
4282
|
+
input: input2,
|
|
4281
4283
|
inst
|
|
4282
4284
|
});
|
|
4283
4285
|
return payload;
|
|
4284
4286
|
}
|
|
4285
4287
|
const proms = [];
|
|
4286
4288
|
payload.value = /* @__PURE__ */ new Map();
|
|
4287
|
-
for (const [key, value] of
|
|
4289
|
+
for (const [key, value] of input2) {
|
|
4288
4290
|
const keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);
|
|
4289
4291
|
const valueResult = def.valueType._zod.run({ value, issues: [] }, ctx);
|
|
4290
4292
|
if (keyResult instanceof Promise || valueResult instanceof Promise) {
|
|
4291
4293
|
proms.push(Promise.all([keyResult, valueResult]).then(([keyResult2, valueResult2]) => {
|
|
4292
|
-
handleMapResult(keyResult2, valueResult2, payload, key,
|
|
4294
|
+
handleMapResult(keyResult2, valueResult2, payload, key, input2, inst, ctx);
|
|
4293
4295
|
}));
|
|
4294
4296
|
} else {
|
|
4295
|
-
handleMapResult(keyResult, valueResult, payload, key,
|
|
4297
|
+
handleMapResult(keyResult, valueResult, payload, key, input2, inst, ctx);
|
|
4296
4298
|
}
|
|
4297
4299
|
}
|
|
4298
4300
|
if (proms.length)
|
|
@@ -4300,7 +4302,7 @@ var $ZodMap = /* @__PURE__ */ $constructor("$ZodMap", (inst, def) => {
|
|
|
4300
4302
|
return payload;
|
|
4301
4303
|
};
|
|
4302
4304
|
});
|
|
4303
|
-
function handleMapResult(keyResult, valueResult, final, key,
|
|
4305
|
+
function handleMapResult(keyResult, valueResult, final, key, input2, inst, ctx) {
|
|
4304
4306
|
if (keyResult.issues.length) {
|
|
4305
4307
|
if (propertyKeyTypes.has(typeof key)) {
|
|
4306
4308
|
final.issues.push(...prefixIssues(key, keyResult.issues));
|
|
@@ -4308,7 +4310,7 @@ function handleMapResult(keyResult, valueResult, final, key, input, inst, ctx) {
|
|
|
4308
4310
|
final.issues.push({
|
|
4309
4311
|
code: "invalid_key",
|
|
4310
4312
|
origin: "map",
|
|
4311
|
-
input,
|
|
4313
|
+
input: input2,
|
|
4312
4314
|
inst,
|
|
4313
4315
|
issues: keyResult.issues.map((iss) => finalizeIssue(iss, ctx, config()))
|
|
4314
4316
|
});
|
|
@@ -4321,7 +4323,7 @@ function handleMapResult(keyResult, valueResult, final, key, input, inst, ctx) {
|
|
|
4321
4323
|
final.issues.push({
|
|
4322
4324
|
origin: "map",
|
|
4323
4325
|
code: "invalid_element",
|
|
4324
|
-
input,
|
|
4326
|
+
input: input2,
|
|
4325
4327
|
inst,
|
|
4326
4328
|
key,
|
|
4327
4329
|
issues: valueResult.issues.map((iss) => finalizeIssue(iss, ctx, config()))
|
|
@@ -4333,10 +4335,10 @@ function handleMapResult(keyResult, valueResult, final, key, input, inst, ctx) {
|
|
|
4333
4335
|
var $ZodSet = /* @__PURE__ */ $constructor("$ZodSet", (inst, def) => {
|
|
4334
4336
|
$ZodType.init(inst, def);
|
|
4335
4337
|
inst._zod.parse = (payload, ctx) => {
|
|
4336
|
-
const
|
|
4337
|
-
if (!(
|
|
4338
|
+
const input2 = payload.value;
|
|
4339
|
+
if (!(input2 instanceof Set)) {
|
|
4338
4340
|
payload.issues.push({
|
|
4339
|
-
input,
|
|
4341
|
+
input: input2,
|
|
4340
4342
|
inst,
|
|
4341
4343
|
expected: "set",
|
|
4342
4344
|
code: "invalid_type"
|
|
@@ -4345,7 +4347,7 @@ var $ZodSet = /* @__PURE__ */ $constructor("$ZodSet", (inst, def) => {
|
|
|
4345
4347
|
}
|
|
4346
4348
|
const proms = [];
|
|
4347
4349
|
payload.value = /* @__PURE__ */ new Set();
|
|
4348
|
-
for (const item of
|
|
4350
|
+
for (const item of input2) {
|
|
4349
4351
|
const result = def.valueType._zod.run({ value: item, issues: [] }, ctx);
|
|
4350
4352
|
if (result instanceof Promise) {
|
|
4351
4353
|
proms.push(result.then((result2) => handleSetResult(result2, payload)));
|
|
@@ -4370,14 +4372,14 @@ var $ZodEnum = /* @__PURE__ */ $constructor("$ZodEnum", (inst, def) => {
|
|
|
4370
4372
|
inst._zod.values = valuesSet;
|
|
4371
4373
|
inst._zod.pattern = new RegExp(`^(${values.filter((k) => propertyKeyTypes.has(typeof k)).map((o) => typeof o === "string" ? escapeRegex(o) : o.toString()).join("|")})$`);
|
|
4372
4374
|
inst._zod.parse = (payload, _ctx) => {
|
|
4373
|
-
const
|
|
4374
|
-
if (valuesSet.has(
|
|
4375
|
+
const input2 = payload.value;
|
|
4376
|
+
if (valuesSet.has(input2)) {
|
|
4375
4377
|
return payload;
|
|
4376
4378
|
}
|
|
4377
4379
|
payload.issues.push({
|
|
4378
4380
|
code: "invalid_value",
|
|
4379
4381
|
values,
|
|
4380
|
-
input,
|
|
4382
|
+
input: input2,
|
|
4381
4383
|
inst
|
|
4382
4384
|
});
|
|
4383
4385
|
return payload;
|
|
@@ -4392,14 +4394,14 @@ var $ZodLiteral = /* @__PURE__ */ $constructor("$ZodLiteral", (inst, def) => {
|
|
|
4392
4394
|
inst._zod.values = values;
|
|
4393
4395
|
inst._zod.pattern = new RegExp(`^(${def.values.map((o) => typeof o === "string" ? escapeRegex(o) : o ? escapeRegex(o.toString()) : String(o)).join("|")})$`);
|
|
4394
4396
|
inst._zod.parse = (payload, _ctx) => {
|
|
4395
|
-
const
|
|
4396
|
-
if (values.has(
|
|
4397
|
+
const input2 = payload.value;
|
|
4398
|
+
if (values.has(input2)) {
|
|
4397
4399
|
return payload;
|
|
4398
4400
|
}
|
|
4399
4401
|
payload.issues.push({
|
|
4400
4402
|
code: "invalid_value",
|
|
4401
4403
|
values: def.values,
|
|
4402
|
-
input,
|
|
4404
|
+
input: input2,
|
|
4403
4405
|
inst
|
|
4404
4406
|
});
|
|
4405
4407
|
return payload;
|
|
@@ -4408,13 +4410,13 @@ var $ZodLiteral = /* @__PURE__ */ $constructor("$ZodLiteral", (inst, def) => {
|
|
|
4408
4410
|
var $ZodFile = /* @__PURE__ */ $constructor("$ZodFile", (inst, def) => {
|
|
4409
4411
|
$ZodType.init(inst, def);
|
|
4410
4412
|
inst._zod.parse = (payload, _ctx) => {
|
|
4411
|
-
const
|
|
4412
|
-
if (
|
|
4413
|
+
const input2 = payload.value;
|
|
4414
|
+
if (input2 instanceof File)
|
|
4413
4415
|
return payload;
|
|
4414
4416
|
payload.issues.push({
|
|
4415
4417
|
expected: "file",
|
|
4416
4418
|
code: "invalid_type",
|
|
4417
|
-
input,
|
|
4419
|
+
input: input2,
|
|
4418
4420
|
inst
|
|
4419
4421
|
});
|
|
4420
4422
|
return payload;
|
|
@@ -4444,8 +4446,8 @@ var $ZodTransform = /* @__PURE__ */ $constructor("$ZodTransform", (inst, def) =>
|
|
|
4444
4446
|
return payload;
|
|
4445
4447
|
};
|
|
4446
4448
|
});
|
|
4447
|
-
function handleOptionalResult(result,
|
|
4448
|
-
if (
|
|
4449
|
+
function handleOptionalResult(result, input2) {
|
|
4450
|
+
if (input2 === void 0 && (result.issues.length || result.fallback)) {
|
|
4449
4451
|
return { issues: [], value: void 0 };
|
|
4450
4452
|
}
|
|
4451
4453
|
return result;
|
|
@@ -4463,11 +4465,11 @@ var $ZodOptional = /* @__PURE__ */ $constructor("$ZodOptional", (inst, def) => {
|
|
|
4463
4465
|
});
|
|
4464
4466
|
inst._zod.parse = (payload, ctx) => {
|
|
4465
4467
|
if (def.innerType._zod.optin === "optional") {
|
|
4466
|
-
const
|
|
4468
|
+
const input2 = payload.value;
|
|
4467
4469
|
const result = def.innerType._zod.run(payload, ctx);
|
|
4468
4470
|
if (result instanceof Promise)
|
|
4469
|
-
return result.then((r) => handleOptionalResult(r,
|
|
4470
|
-
return handleOptionalResult(result,
|
|
4471
|
+
return result.then((r) => handleOptionalResult(r, input2));
|
|
4472
|
+
return handleOptionalResult(result, input2);
|
|
4471
4473
|
}
|
|
4472
4474
|
if (payload.value === void 0) {
|
|
4473
4475
|
return payload;
|
|
@@ -4892,20 +4894,20 @@ var $ZodCustom = /* @__PURE__ */ $constructor("$ZodCustom", (inst, def) => {
|
|
|
4892
4894
|
return payload;
|
|
4893
4895
|
};
|
|
4894
4896
|
inst._zod.check = (payload) => {
|
|
4895
|
-
const
|
|
4896
|
-
const r = def.fn(
|
|
4897
|
+
const input2 = payload.value;
|
|
4898
|
+
const r = def.fn(input2);
|
|
4897
4899
|
if (r instanceof Promise) {
|
|
4898
|
-
return r.then((r2) => handleRefineResult(r2, payload,
|
|
4900
|
+
return r.then((r2) => handleRefineResult(r2, payload, input2, inst));
|
|
4899
4901
|
}
|
|
4900
|
-
handleRefineResult(r, payload,
|
|
4902
|
+
handleRefineResult(r, payload, input2, inst);
|
|
4901
4903
|
return;
|
|
4902
4904
|
};
|
|
4903
4905
|
});
|
|
4904
|
-
function handleRefineResult(result, payload,
|
|
4906
|
+
function handleRefineResult(result, payload, input2, inst) {
|
|
4905
4907
|
if (!result) {
|
|
4906
4908
|
const _iss = {
|
|
4907
4909
|
code: "custom",
|
|
4908
|
-
input,
|
|
4910
|
+
input: input2,
|
|
4909
4911
|
inst,
|
|
4910
4912
|
// incorporates params.error into issue reporting
|
|
4911
4913
|
path: [...inst._zod.def.path ?? []],
|
|
@@ -8192,8 +8194,8 @@ function ko_default() {
|
|
|
8192
8194
|
}
|
|
8193
8195
|
|
|
8194
8196
|
// ../../../node_modules/zod/v4/locales/lt.js
|
|
8195
|
-
var capitalizeFirstCharacter = (
|
|
8196
|
-
return
|
|
8197
|
+
var capitalizeFirstCharacter = (text2) => {
|
|
8198
|
+
return text2.charAt(0).toUpperCase() + text2.slice(1);
|
|
8197
8199
|
};
|
|
8198
8200
|
function getUnitTypeFromNumber(number4) {
|
|
8199
8201
|
const abs = Math.abs(number4);
|
|
@@ -11593,23 +11595,23 @@ function _overwrite(tx) {
|
|
|
11593
11595
|
}
|
|
11594
11596
|
// @__NO_SIDE_EFFECTS__
|
|
11595
11597
|
function _normalize(form) {
|
|
11596
|
-
return /* @__PURE__ */ _overwrite((
|
|
11598
|
+
return /* @__PURE__ */ _overwrite((input2) => input2.normalize(form));
|
|
11597
11599
|
}
|
|
11598
11600
|
// @__NO_SIDE_EFFECTS__
|
|
11599
11601
|
function _trim() {
|
|
11600
|
-
return /* @__PURE__ */ _overwrite((
|
|
11602
|
+
return /* @__PURE__ */ _overwrite((input2) => input2.trim());
|
|
11601
11603
|
}
|
|
11602
11604
|
// @__NO_SIDE_EFFECTS__
|
|
11603
11605
|
function _toLowerCase() {
|
|
11604
|
-
return /* @__PURE__ */ _overwrite((
|
|
11606
|
+
return /* @__PURE__ */ _overwrite((input2) => input2.toLowerCase());
|
|
11605
11607
|
}
|
|
11606
11608
|
// @__NO_SIDE_EFFECTS__
|
|
11607
11609
|
function _toUpperCase() {
|
|
11608
|
-
return /* @__PURE__ */ _overwrite((
|
|
11610
|
+
return /* @__PURE__ */ _overwrite((input2) => input2.toUpperCase());
|
|
11609
11611
|
}
|
|
11610
11612
|
// @__NO_SIDE_EFFECTS__
|
|
11611
11613
|
function _slugify() {
|
|
11612
|
-
return /* @__PURE__ */ _overwrite((
|
|
11614
|
+
return /* @__PURE__ */ _overwrite((input2) => slugify(input2));
|
|
11613
11615
|
}
|
|
11614
11616
|
// @__NO_SIDE_EFFECTS__
|
|
11615
11617
|
function _array(Class2, element, params) {
|
|
@@ -11914,8 +11916,8 @@ function _stringbool(Classes, _params) {
|
|
|
11914
11916
|
type: "pipe",
|
|
11915
11917
|
in: stringSchema,
|
|
11916
11918
|
out: booleanSchema,
|
|
11917
|
-
transform: ((
|
|
11918
|
-
let data =
|
|
11919
|
+
transform: ((input2, payload) => {
|
|
11920
|
+
let data = input2;
|
|
11919
11921
|
if (params.case !== "sensitive")
|
|
11920
11922
|
data = data.toLowerCase();
|
|
11921
11923
|
if (truthySet.has(data)) {
|
|
@@ -11934,8 +11936,8 @@ function _stringbool(Classes, _params) {
|
|
|
11934
11936
|
return {};
|
|
11935
11937
|
}
|
|
11936
11938
|
}),
|
|
11937
|
-
reverseTransform: ((
|
|
11938
|
-
if (
|
|
11939
|
+
reverseTransform: ((input2, _payload) => {
|
|
11940
|
+
if (input2 === true) {
|
|
11939
11941
|
return truthyArray[0] || "true";
|
|
11940
11942
|
} else {
|
|
11941
11943
|
return falsyArray[0] || "false";
|
|
@@ -12831,9 +12833,9 @@ var allProcessors = {
|
|
|
12831
12833
|
optional: optionalProcessor,
|
|
12832
12834
|
lazy: lazyProcessor
|
|
12833
12835
|
};
|
|
12834
|
-
function toJSONSchema(
|
|
12835
|
-
if ("_idmap" in
|
|
12836
|
-
const registry2 =
|
|
12836
|
+
function toJSONSchema(input2, params) {
|
|
12837
|
+
if ("_idmap" in input2) {
|
|
12838
|
+
const registry2 = input2;
|
|
12837
12839
|
const ctx2 = initializeContext({ ...params, processors: allProcessors });
|
|
12838
12840
|
const defs = {};
|
|
12839
12841
|
for (const entry of registry2._idmap.entries()) {
|
|
@@ -12861,9 +12863,9 @@ function toJSONSchema(input, params) {
|
|
|
12861
12863
|
return { schemas };
|
|
12862
12864
|
}
|
|
12863
12865
|
const ctx = initializeContext({ ...params, processors: allProcessors });
|
|
12864
|
-
process2(
|
|
12865
|
-
extractDefs(ctx,
|
|
12866
|
-
return finalize(ctx,
|
|
12866
|
+
process2(input2, ctx);
|
|
12867
|
+
extractDefs(ctx, input2);
|
|
12868
|
+
return finalize(ctx, input2);
|
|
12867
12869
|
}
|
|
12868
12870
|
|
|
12869
12871
|
// ../../../node_modules/zod/v4/core/json-schema-generator.js
|
|
@@ -15140,7 +15142,7 @@ var codexhostErrorSchema = external_exports.strictObject({
|
|
|
15140
15142
|
|
|
15141
15143
|
// ../../shared-contracts/dist/harness-presentation.js
|
|
15142
15144
|
var localeSchema = external_exports.string().max(64).regex(/^[a-z]{2,3}(?:-[A-Za-z0-9]{2,8})*$/u);
|
|
15143
|
-
var displayText = (maximum) => external_exports.string().min(1).max(maximum).refine((
|
|
15145
|
+
var displayText = (maximum) => external_exports.string().min(1).max(maximum).refine((text2) => text2.trim().length > 0);
|
|
15144
15146
|
var harnessLocalizationsSchema = external_exports.record(localeSchema, external_exports.object({
|
|
15145
15147
|
label: displayText(256).optional(),
|
|
15146
15148
|
description: displayText(1024).optional()
|
|
@@ -15229,7 +15231,7 @@ var usageMeasurementsSchema = external_exports.object({
|
|
|
15229
15231
|
outputTokensPerSecond: usageMeasurementSchema.refine((value) => value.version === 4).optional().catch(void 0),
|
|
15230
15232
|
timeToFirstOutputMs: usageMeasurementSchema.extend({ value: nonNegativeSafeIntegerSchema }).optional()
|
|
15231
15233
|
}).strict();
|
|
15232
|
-
var indicatorTextSchema = (maximum) => harnessLocalizedTextSchema.refine((entries) => Object.values(entries).every((
|
|
15234
|
+
var indicatorTextSchema = (maximum) => harnessLocalizedTextSchema.refine((entries) => Object.values(entries).every((text2) => text2.length <= maximum));
|
|
15233
15235
|
var composerIndicatorsSchema = external_exports.array(external_exports.object({
|
|
15234
15236
|
kind: external_exports.literal("countdown"),
|
|
15235
15237
|
id: external_exports.string().min(1).max(64),
|
|
@@ -15612,6 +15614,8 @@ var externalThreadInspectionSchema = external_exports.object({
|
|
|
15612
15614
|
effectiveThinkingOptionId: harnessThinkingOptionIdSchema.optional(),
|
|
15613
15615
|
availableThinkingOptions: harnessThinkingOptionsSchema.optional(),
|
|
15614
15616
|
effectivePermissionModeId: harnessPermissionModeIdSchema.optional(),
|
|
15617
|
+
/** Live Session catalog when it, not the Adapter inspection, contains `effectiveModel`. */
|
|
15618
|
+
catalog: harnessModelCatalogSchema.optional(),
|
|
15615
15619
|
history: harnessHistoryCapabilitiesSchema,
|
|
15616
15620
|
usage: threadUsageSnapshotSchema.optional(),
|
|
15617
15621
|
locked: external_exports.literal(true)
|
|
@@ -15670,9 +15674,9 @@ var threadSteeringInspectParamsSchema = external_exports.object({
|
|
|
15670
15674
|
}).strict();
|
|
15671
15675
|
var threadSteeringContextSchema = external_exports.object({
|
|
15672
15676
|
kind: external_exports.literal("application"),
|
|
15673
|
-
value: external_exports.string().transform((
|
|
15677
|
+
value: external_exports.string().transform((text2, context) => {
|
|
15674
15678
|
try {
|
|
15675
|
-
return JSON.parse(
|
|
15679
|
+
return JSON.parse(text2);
|
|
15676
15680
|
} catch {
|
|
15677
15681
|
context.addIssue({ code: "custom", message: "Invalid steering context JSON" });
|
|
15678
15682
|
return external_exports.NEVER;
|
|
@@ -15807,8 +15811,8 @@ var desktopExtensionHttpUrlSchema = external_exports.string().trim().max(2048).r
|
|
|
15807
15811
|
const { username, password } = new URL(value);
|
|
15808
15812
|
return !username && !password && !/[\\\s]/u.test(value);
|
|
15809
15813
|
}, "URL must not contain credentials, backslashes, or whitespace");
|
|
15810
|
-
function localizedText(
|
|
15811
|
-
return external_exports.strictObject({ en:
|
|
15814
|
+
function localizedText(text2) {
|
|
15815
|
+
return external_exports.strictObject({ en: text2, "zh-CN": text2 });
|
|
15812
15816
|
}
|
|
15813
15817
|
var desktopExtensionLocalizedTextSchema = localizedText(external_exports.string().trim().min(1));
|
|
15814
15818
|
var categoriesSchema = external_exports.array(desktopExtensionCategorySchema).max(desktopExtensionCategorySchema.options.length).refine((categories) => new Set(categories).size === categories.length, "Duplicate categories");
|
|
@@ -15925,8 +15929,8 @@ var desktopExtensionTrustTierSchema = external_exports.enum(["official", "commun
|
|
|
15925
15929
|
function isGitHubDesktopExtensionZipballUrl(url2) {
|
|
15926
15930
|
return url2.origin === "https://api.github.com" && /^\/repos\/[\w-]+\/[\w.-]+\/zipball(?:\/[^/]+)?\/?$/u.test(url2.pathname);
|
|
15927
15931
|
}
|
|
15928
|
-
var desktopExtensionZipUrlSchema = desktopExtensionHttpUrlSchema.refine((
|
|
15929
|
-
const url2 = new URL(
|
|
15932
|
+
var desktopExtensionZipUrlSchema = desktopExtensionHttpUrlSchema.refine((input2) => {
|
|
15933
|
+
const url2 = new URL(input2);
|
|
15930
15934
|
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);
|
|
15931
15935
|
}, "Expected a .zip download URL or a GitHub zipball URL");
|
|
15932
15936
|
var desktopExtensionCatalogEntrySchema = external_exports.strictObject({
|
|
@@ -16277,6 +16281,8 @@ var CLIENT_CHANNEL_METHODS = [
|
|
|
16277
16281
|
"codexhost/workspace/read",
|
|
16278
16282
|
"codexhost/thread/tree/read",
|
|
16279
16283
|
"codexhost/thread/pins/list",
|
|
16284
|
+
"codexhost/thread/sections/list",
|
|
16285
|
+
"codexhost/thread/sections/move",
|
|
16280
16286
|
"codexhost/thread/pins/set",
|
|
16281
16287
|
"codexhost/harness/plugins/list",
|
|
16282
16288
|
"codexhost/harness/inspect",
|
|
@@ -16315,8 +16321,21 @@ var CLIENT_CHANNEL_METHODS = [
|
|
|
16315
16321
|
"codexhost/update/check",
|
|
16316
16322
|
"codexhost/update/start",
|
|
16317
16323
|
"codexhost/update/status",
|
|
16324
|
+
"codexhost/announcement/get",
|
|
16325
|
+
"codexhost/announcement/acknowledge",
|
|
16318
16326
|
"codexhost/sessions/loaded/list"
|
|
16319
16327
|
];
|
|
16328
|
+
var clientThreadSectionsSchema = external_exports.object({
|
|
16329
|
+
sections: external_exports.array(external_exports.object({
|
|
16330
|
+
id: external_exports.string().min(1),
|
|
16331
|
+
name: external_exports.string().min(1),
|
|
16332
|
+
threads: external_exports.array(jsonObjectSchema)
|
|
16333
|
+
}).strict())
|
|
16334
|
+
}).strict();
|
|
16335
|
+
var clientThreadSectionMoveSchema = external_exports.object({
|
|
16336
|
+
threadId: external_exports.string().min(1).max(1024),
|
|
16337
|
+
sectionId: external_exports.string().min(1).max(1024).nullable()
|
|
16338
|
+
}).strict();
|
|
16320
16339
|
var clientThreadPinsSchema = external_exports.object({ threadIds: external_exports.array(external_exports.string().min(1)) }).strict();
|
|
16321
16340
|
var clientThreadPinParamsSchema = external_exports.object({ threadId: external_exports.string().min(1).max(1024), pinned: external_exports.boolean() }).strict();
|
|
16322
16341
|
var clientThreadTreeReadParamsSchema = external_exports.object({}).strict();
|
|
@@ -16858,8 +16877,8 @@ var harnessPreferencePatchSchema = external_exports.strictObject({
|
|
|
16858
16877
|
operations: external_exports.array(harnessPreferenceOperationSchema).min(1).max(256),
|
|
16859
16878
|
initializeOnly: external_exports.boolean().optional(),
|
|
16860
16879
|
expectedRevision: external_exports.number().int().nonnegative().optional()
|
|
16861
|
-
}).superRefine((
|
|
16862
|
-
for (const operation of
|
|
16880
|
+
}).superRefine((input2, ctx) => {
|
|
16881
|
+
for (const operation of input2.operations) {
|
|
16863
16882
|
if (operation.kind === "newThread" && (!operation.lastHarness && !operation.configuration || Boolean(operation.harnessId) !== Boolean(operation.configuration)))
|
|
16864
16883
|
ctx.addIssue({
|
|
16865
16884
|
code: "custom",
|
|
@@ -17261,13 +17280,18 @@ var harnessLaunchSettingsSchema = external_exports.object({
|
|
|
17261
17280
|
// ../../shared-contracts/dist/harness-installation.js
|
|
17262
17281
|
var harnessInstallationParamsSchema = external_exports.object({
|
|
17263
17282
|
harnessId: harnessIdSchema,
|
|
17264
|
-
action: external_exports.enum(["check", "update", "install"])
|
|
17265
|
-
|
|
17283
|
+
action: external_exports.enum(["check", "update", "install"]),
|
|
17284
|
+
confirmedVersion: external_exports.string().min(1).max(128).optional()
|
|
17285
|
+
}).strict().refine(({ action, confirmedVersion }) => action === "update" || confirmedVersion === void 0);
|
|
17266
17286
|
var harnessInstallationStateSchema = external_exports.object({
|
|
17267
17287
|
currentVersion: external_exports.string().min(1).max(128),
|
|
17268
17288
|
latestVersion: external_exports.string().min(1).max(128),
|
|
17269
17289
|
updateAvailable: external_exports.boolean(),
|
|
17270
17290
|
canUpdate: external_exports.boolean(),
|
|
17291
|
+
/** Present when the Adapter has a verified list and the available target is outside it. */
|
|
17292
|
+
latestVerifiedVersion: external_exports.string().min(1).max(128).optional(),
|
|
17293
|
+
/** Update preflight stopped before running the installer; latestVersion needs confirmation. */
|
|
17294
|
+
confirmationRequired: external_exports.literal(true).optional(),
|
|
17271
17295
|
/** Defaults to CLI; some Harnesses ship only inside a desktop application. */
|
|
17272
17296
|
versionKind: external_exports.enum(["cli", "application"]).optional(),
|
|
17273
17297
|
/** Official download opened by the user; does not imply an automatic installation. */
|
|
@@ -17597,6 +17621,38 @@ var updateStatusResultSchema = external_exports.strictObject({
|
|
|
17597
17621
|
status: updateStatusSchema.nullable()
|
|
17598
17622
|
});
|
|
17599
17623
|
|
|
17624
|
+
// ../../shared-contracts/dist/release-announcement.js
|
|
17625
|
+
var RELEASE_ANNOUNCEMENT_MAX_THEMES = 12;
|
|
17626
|
+
var releaseAnnouncementThemeSchema = external_exports.strictObject({
|
|
17627
|
+
icon: external_exports.string().min(1).max(16).optional(),
|
|
17628
|
+
title: external_exports.string().min(1).max(120),
|
|
17629
|
+
body: external_exports.string().min(1).max(1200),
|
|
17630
|
+
contributors: external_exports.array(external_exports.string().min(1).max(39)).max(30)
|
|
17631
|
+
});
|
|
17632
|
+
var releaseAnnouncementContentSchema = external_exports.strictObject({
|
|
17633
|
+
summary: external_exports.string().min(1).max(600).optional(),
|
|
17634
|
+
themes: external_exports.array(releaseAnnouncementThemeSchema).min(1).max(RELEASE_ANNOUNCEMENT_MAX_THEMES)
|
|
17635
|
+
});
|
|
17636
|
+
var releaseAnnouncementSchema = external_exports.strictObject({
|
|
17637
|
+
version: updateSemanticVersionSchema,
|
|
17638
|
+
publishedAt: external_exports.iso.datetime(),
|
|
17639
|
+
url: external_exports.string().max(300).regex(/^https:\/\/github\.com\/BytePioneer-AI\/codex-host\/releases\/tag\/v[0-9A-Za-z.+-]+$/u),
|
|
17640
|
+
zh: releaseAnnouncementContentSchema.nullable(),
|
|
17641
|
+
en: releaseAnnouncementContentSchema.nullable()
|
|
17642
|
+
}).refine((value) => value.zh !== null || value.en !== null, {
|
|
17643
|
+
message: "an announcement needs at least one language"
|
|
17644
|
+
});
|
|
17645
|
+
var releaseAnnouncementGetParamsSchema = external_exports.strictObject({
|
|
17646
|
+
manual: external_exports.boolean().optional()
|
|
17647
|
+
});
|
|
17648
|
+
var releaseAnnouncementGetResultSchema = external_exports.strictObject({
|
|
17649
|
+
announcement: releaseAnnouncementSchema.nullable(),
|
|
17650
|
+
unread: external_exports.boolean()
|
|
17651
|
+
});
|
|
17652
|
+
var releaseAnnouncementAcknowledgeParamsSchema = external_exports.strictObject({
|
|
17653
|
+
version: updateSemanticVersionSchema
|
|
17654
|
+
});
|
|
17655
|
+
|
|
17600
17656
|
// ../../shared-contracts/dist/thread-watch-notice.js
|
|
17601
17657
|
var THREAD_WATCH_NOTICE_OUTCOMES = [
|
|
17602
17658
|
"completed",
|
|
@@ -17644,17 +17700,67 @@ var remoteSshSetupResultSchema = external_exports.object({ state: external_expor
|
|
|
17644
17700
|
|
|
17645
17701
|
// ../../shared-contracts/dist/remote-sessions.js
|
|
17646
17702
|
var REMOTE_CONTROLLER_REQUEST_MAX_BYTES = 16 * 1024;
|
|
17647
|
-
var
|
|
17703
|
+
var REMOTE_IDENTITY_MAX_LENGTH = 1024;
|
|
17704
|
+
var identity = external_exports.string().min(1).max(REMOTE_IDENTITY_MAX_LENGTH);
|
|
17648
17705
|
var target = { hostId: identity.regex(/^remote-(?:ssh(?:-|:)|control:)/u) };
|
|
17649
17706
|
var thread = { ...target, threadId: identity };
|
|
17707
|
+
var text = external_exports.string().min(1).max(8e3);
|
|
17708
|
+
var input = { text, requestId: identity };
|
|
17709
|
+
var remoteDeliveryReplySchema = external_exports.discriminatedUnion("accepted", [
|
|
17710
|
+
external_exports.object({ accepted: external_exports.literal(true), startQueuedItemId: identity.optional() }),
|
|
17711
|
+
external_exports.object({
|
|
17712
|
+
accepted: external_exports.literal(false),
|
|
17713
|
+
code: external_exports.enum([
|
|
17714
|
+
"remote/queue-unavailable",
|
|
17715
|
+
"remote/steer-unavailable",
|
|
17716
|
+
"remote/turn-changed",
|
|
17717
|
+
"remote/send-rejected",
|
|
17718
|
+
"session/queue-item-not-found",
|
|
17719
|
+
"session/queue-item-starting"
|
|
17720
|
+
]),
|
|
17721
|
+
message: external_exports.string()
|
|
17722
|
+
})
|
|
17723
|
+
]);
|
|
17724
|
+
var remoteQueueSnapshotSchema = external_exports.discriminatedUnion("available", [
|
|
17725
|
+
external_exports.object({ available: external_exports.literal(false) }),
|
|
17726
|
+
external_exports.object({
|
|
17727
|
+
available: external_exports.literal(true),
|
|
17728
|
+
items: external_exports.array(external_exports.object({ id: identity, clientUserMessageId: identity, preview: external_exports.string().max(801) })).max(100)
|
|
17729
|
+
})
|
|
17730
|
+
]);
|
|
17650
17731
|
var remoteSessionOperationSchema = external_exports.discriminatedUnion("kind", [
|
|
17651
17732
|
external_exports.strictObject({ kind: external_exports.literal("hosts") }),
|
|
17733
|
+
external_exports.strictObject({
|
|
17734
|
+
kind: external_exports.literal("create"),
|
|
17735
|
+
...target,
|
|
17736
|
+
cwd: external_exports.string().min(1).max(8192),
|
|
17737
|
+
epoch: identity
|
|
17738
|
+
}),
|
|
17739
|
+
external_exports.strictObject({ kind: external_exports.literal("projectHarnesses"), ...target, epoch: identity }),
|
|
17740
|
+
external_exports.strictObject({
|
|
17741
|
+
kind: external_exports.literal("inspectHarness"),
|
|
17742
|
+
...target,
|
|
17743
|
+
epoch: identity,
|
|
17744
|
+
cwd: external_exports.string().min(1).max(8192),
|
|
17745
|
+
harnessId: identity
|
|
17746
|
+
}),
|
|
17747
|
+
external_exports.strictObject({
|
|
17748
|
+
kind: external_exports.literal("startSelected"),
|
|
17749
|
+
...target,
|
|
17750
|
+
epoch: identity,
|
|
17751
|
+
cwd: external_exports.string().min(1).max(8192),
|
|
17752
|
+
harnessId: identity,
|
|
17753
|
+
model: external_exports.string().min(1).max(4096),
|
|
17754
|
+
serviceTier: external_exports.enum(["priority", "ultrafast"]).optional(),
|
|
17755
|
+
reasoningEffort: identity.optional()
|
|
17756
|
+
}),
|
|
17652
17757
|
external_exports.strictObject({ kind: external_exports.literal("status"), ...thread }),
|
|
17653
17758
|
external_exports.strictObject({
|
|
17654
17759
|
kind: external_exports.literal("list"),
|
|
17655
17760
|
...target,
|
|
17656
17761
|
cursor: external_exports.string().nullable(),
|
|
17657
|
-
archived: external_exports.boolean()
|
|
17762
|
+
archived: external_exports.boolean(),
|
|
17763
|
+
includeLoaded: external_exports.literal(true).optional()
|
|
17658
17764
|
}),
|
|
17659
17765
|
external_exports.strictObject({
|
|
17660
17766
|
kind: external_exports.literal("read"),
|
|
@@ -17684,9 +17790,25 @@ var remoteSessionOperationSchema = external_exports.discriminatedUnion("kind", [
|
|
|
17684
17790
|
kind: external_exports.literal("prompt"),
|
|
17685
17791
|
...thread,
|
|
17686
17792
|
epoch: identity,
|
|
17687
|
-
text
|
|
17793
|
+
text,
|
|
17688
17794
|
requestId: identity.optional()
|
|
17689
17795
|
}),
|
|
17796
|
+
external_exports.strictObject({ kind: external_exports.literal("queue"), ...thread, epoch: identity }),
|
|
17797
|
+
external_exports.strictObject({
|
|
17798
|
+
kind: external_exports.literal("delivery"),
|
|
17799
|
+
...thread,
|
|
17800
|
+
epoch: identity,
|
|
17801
|
+
action: external_exports.discriminatedUnion("kind", [
|
|
17802
|
+
external_exports.strictObject({ kind: external_exports.literal("enqueue"), ...input }),
|
|
17803
|
+
external_exports.strictObject({ kind: external_exports.literal("steer"), ...input, turnId: identity }),
|
|
17804
|
+
external_exports.strictObject({ kind: external_exports.literal("remove"), itemId: identity }),
|
|
17805
|
+
external_exports.strictObject({
|
|
17806
|
+
kind: external_exports.literal("start"),
|
|
17807
|
+
itemId: identity,
|
|
17808
|
+
onlyIfHead: external_exports.literal(true).optional()
|
|
17809
|
+
})
|
|
17810
|
+
])
|
|
17811
|
+
}),
|
|
17690
17812
|
external_exports.strictObject({ kind: external_exports.literal("interrupt"), ...thread, epoch: identity, turnId: identity }),
|
|
17691
17813
|
external_exports.strictObject({
|
|
17692
17814
|
kind: external_exports.literal("rename"),
|
|
@@ -18137,7 +18259,7 @@ function parseHostUsageRequest(value) {
|
|
|
18137
18259
|
function v2UsageRequest(message, historical, timing) {
|
|
18138
18260
|
if (message.type !== "assistant" || !message.tokens)
|
|
18139
18261
|
return null;
|
|
18140
|
-
const { input, output, reasoning, cache } = message.tokens;
|
|
18262
|
+
const { input: input2, output, reasoning, cache } = message.tokens;
|
|
18141
18263
|
const { streamed } = message.time;
|
|
18142
18264
|
const firstOutputAtMs = timing?.firstOutputAtMs;
|
|
18143
18265
|
return parseHostUsageRequest({
|
|
@@ -18147,7 +18269,7 @@ function v2UsageRequest(message, historical, timing) {
|
|
|
18147
18269
|
// Built-in OpenCode providers use models.dev IDs. A custom provider ID matches no price
|
|
18148
18270
|
// entry, so Host falls back to the exact model ID.
|
|
18149
18271
|
provider: message.model.providerID,
|
|
18150
|
-
inputTokens:
|
|
18272
|
+
inputTokens: input2 + cache.read + cache.write,
|
|
18151
18273
|
cachedInputTokens: cache.read,
|
|
18152
18274
|
cacheWriteInputTokens: cache.write,
|
|
18153
18275
|
outputTokens: output + reasoning,
|
|
@@ -18478,12 +18600,12 @@ function completedItemOutcome(outcome) {
|
|
|
18478
18600
|
}
|
|
18479
18601
|
return { status: "succeeded" };
|
|
18480
18602
|
}
|
|
18481
|
-
function boundedToolOutput(
|
|
18482
|
-
if (!
|
|
18603
|
+
function boundedToolOutput(text2, limit) {
|
|
18604
|
+
if (!text2)
|
|
18483
18605
|
return void 0;
|
|
18484
|
-
const truncated =
|
|
18606
|
+
const truncated = text2.length > limit;
|
|
18485
18607
|
return {
|
|
18486
|
-
content: [{ type: "text", text: truncated ?
|
|
18608
|
+
content: [{ type: "text", text: truncated ? text2.slice(0, limit) : text2 }],
|
|
18487
18609
|
...truncated ? { truncated: true } : {}
|
|
18488
18610
|
};
|
|
18489
18611
|
}
|
|
@@ -18568,10 +18690,10 @@ function reliableOpenCodeFileChanges(diffs) {
|
|
|
18568
18690
|
});
|
|
18569
18691
|
}
|
|
18570
18692
|
function userText(entry) {
|
|
18571
|
-
return entry.parts.filter((part) => part.type === "text" && !part.ignored).map(({ text }) =>
|
|
18693
|
+
return entry.parts.filter((part) => part.type === "text" && !part.ignored).map(({ text: text2 }) => text2).join("");
|
|
18572
18694
|
}
|
|
18573
|
-
function projectOpenCodeHistory(
|
|
18574
|
-
const messages = activeMessages(
|
|
18695
|
+
function projectOpenCodeHistory(input2) {
|
|
18696
|
+
const messages = activeMessages(input2.session, input2.messages);
|
|
18575
18697
|
const turns = [];
|
|
18576
18698
|
for (let index = 0; index < messages.length; ) {
|
|
18577
18699
|
const userEntry = messages[index];
|
|
@@ -18586,8 +18708,8 @@ function projectOpenCodeHistory(input) {
|
|
|
18586
18708
|
const assistants = turnEntries.filter((entry) => entry.info.role === "assistant");
|
|
18587
18709
|
const terminal = assistants.at(-1)?.info;
|
|
18588
18710
|
const outcome = assistantOutcome(terminal);
|
|
18589
|
-
const items = assistants.flatMap((entry) => assistantItems(entry, assistantOutcome(entry.info),
|
|
18590
|
-
const changes = reliableOpenCodeFileChanges(
|
|
18711
|
+
const items = assistants.flatMap((entry) => assistantItems(entry, assistantOutcome(entry.info), input2.toolOutputLimit));
|
|
18712
|
+
const changes = reliableOpenCodeFileChanges(input2.diffsByUserMessageId?.get(userEntry.info.id) ?? []);
|
|
18591
18713
|
if (changes.length > 0) {
|
|
18592
18714
|
const item = {
|
|
18593
18715
|
type: "fileChange",
|
|
@@ -18599,7 +18721,7 @@ function projectOpenCodeHistory(input) {
|
|
|
18599
18721
|
}
|
|
18600
18722
|
const checkpoint = terminal ? nativeCheckpointRefSchema.parse({
|
|
18601
18723
|
harnessId: openCodeHarnessId,
|
|
18602
|
-
nativeSessionId:
|
|
18724
|
+
nativeSessionId: input2.session.id,
|
|
18603
18725
|
checkpointId: terminal.id,
|
|
18604
18726
|
formatVersion: 1
|
|
18605
18727
|
}) : void 0;
|
|
@@ -18607,7 +18729,7 @@ function projectOpenCodeHistory(input) {
|
|
|
18607
18729
|
turns.push({
|
|
18608
18730
|
nativeTurnRef: nativeTurnRefSchema.parse({
|
|
18609
18731
|
harnessId: openCodeHarnessId,
|
|
18610
|
-
nativeSessionId:
|
|
18732
|
+
nativeSessionId: input2.session.id,
|
|
18611
18733
|
nativeTurnKey: user.id,
|
|
18612
18734
|
formatVersion: 1
|
|
18613
18735
|
}),
|
|
@@ -18615,7 +18737,7 @@ function projectOpenCodeHistory(input) {
|
|
|
18615
18737
|
input: [{ type: "text", text: userText(userEntry) }],
|
|
18616
18738
|
items,
|
|
18617
18739
|
outcome,
|
|
18618
|
-
model: encodeOpenCodeModelRef(user.model,
|
|
18740
|
+
model: encodeOpenCodeModelRef(user.model, input2.modelIndex)
|
|
18619
18741
|
});
|
|
18620
18742
|
index = end;
|
|
18621
18743
|
}
|
|
@@ -19374,8 +19496,8 @@ var createClient = (config2 = {}) => {
|
|
|
19374
19496
|
data = await response[parseAs]();
|
|
19375
19497
|
break;
|
|
19376
19498
|
case "json": {
|
|
19377
|
-
const
|
|
19378
|
-
data =
|
|
19499
|
+
const text2 = await response.text();
|
|
19500
|
+
data = text2 ? JSON.parse(text2) : {};
|
|
19379
19501
|
break;
|
|
19380
19502
|
}
|
|
19381
19503
|
case "stream":
|
|
@@ -24151,12 +24273,12 @@ var openCodeDiscoverySpec = {
|
|
|
24151
24273
|
windows: ["~/.opencode/bin", "${APPDATA}/npm", "~/.local/bin", VERSION_MANAGER_ROOTS]
|
|
24152
24274
|
}
|
|
24153
24275
|
};
|
|
24154
|
-
function resolveOpenCodeExecutable(
|
|
24155
|
-
const platform =
|
|
24276
|
+
function resolveOpenCodeExecutable(input2 = {}, dependencies = {}) {
|
|
24277
|
+
const platform = input2.platform ?? process.platform;
|
|
24156
24278
|
const resolution = resolveHarnessExecutable(openCodeDiscoverySpec, {
|
|
24157
|
-
...
|
|
24158
|
-
environment:
|
|
24159
|
-
...
|
|
24279
|
+
...input2.command ? { command: input2.command } : {},
|
|
24280
|
+
environment: input2.environment ?? process.env,
|
|
24281
|
+
...input2.homeDirectory ? { homeDirectory: input2.homeDirectory } : {},
|
|
24160
24282
|
platform
|
|
24161
24283
|
}, dependencies);
|
|
24162
24284
|
if (!resolution)
|
|
@@ -24201,12 +24323,12 @@ function isMissingExecutable(error51) {
|
|
|
24201
24323
|
function classifySdkError(error51, operation) {
|
|
24202
24324
|
if (error51 instanceof OpenCodeTransportError)
|
|
24203
24325
|
return error51;
|
|
24204
|
-
const
|
|
24205
|
-
const lower =
|
|
24326
|
+
const text2 = errorText(error51);
|
|
24327
|
+
const lower = text2.toLowerCase();
|
|
24206
24328
|
if (lower.includes("unauthorized") || lower.includes("authentication")) {
|
|
24207
24329
|
return new OpenCodeTransportError("authenticationRequired", `OpenCode ${operation} requires authentication`, { cause: error51 });
|
|
24208
24330
|
}
|
|
24209
|
-
return new OpenCodeTransportError("unavailable", `OpenCode ${operation} failed: ${
|
|
24331
|
+
return new OpenCodeTransportError("unavailable", `OpenCode ${operation} failed: ${text2}`, {
|
|
24210
24332
|
cause: error51
|
|
24211
24333
|
});
|
|
24212
24334
|
}
|
|
@@ -24304,7 +24426,7 @@ var OpenCodeServerConnection = class {
|
|
|
24304
24426
|
#connection = null;
|
|
24305
24427
|
#stderrTail = "";
|
|
24306
24428
|
constructor(options = {}, dependencies = {
|
|
24307
|
-
createClient: (
|
|
24429
|
+
createClient: (input2) => createOpencodeClient(input2),
|
|
24308
24430
|
randomPassword: () => randomBytes(32).toString("base64url"),
|
|
24309
24431
|
spawn: (command, args, spawnOptions) => spawn(command, args, {
|
|
24310
24432
|
...spawnOptions,
|
|
@@ -24476,12 +24598,12 @@ var DEFAULT_RECONNECT_ATTEMPTS = 3;
|
|
|
24476
24598
|
function classifySdkError2(error51, operation) {
|
|
24477
24599
|
if (error51 instanceof OpenCodeTransportError)
|
|
24478
24600
|
return error51;
|
|
24479
|
-
const
|
|
24480
|
-
const lower =
|
|
24601
|
+
const text2 = error51 instanceof Error ? error51.message : String(error51);
|
|
24602
|
+
const lower = text2.toLowerCase();
|
|
24481
24603
|
if (lower.includes("unauthorized") || lower.includes("authentication")) {
|
|
24482
24604
|
return new OpenCodeTransportError("authenticationRequired", `OpenCode ${operation} requires authentication`, { cause: error51 });
|
|
24483
24605
|
}
|
|
24484
|
-
return new OpenCodeTransportError("unavailable", `OpenCode ${operation} failed: ${
|
|
24606
|
+
return new OpenCodeTransportError("unavailable", `OpenCode ${operation} failed: ${text2}`, {
|
|
24485
24607
|
cause: error51
|
|
24486
24608
|
});
|
|
24487
24609
|
}
|
|
@@ -24538,17 +24660,17 @@ var SdkOpenCodeTransport = class {
|
|
|
24538
24660
|
const client2 = await this.#getClient();
|
|
24539
24661
|
return responseData2(await withTimeout2(client2.provider.list(), this.#commandTimeoutMs, "OpenCode Provider list"), "Provider list");
|
|
24540
24662
|
}
|
|
24541
|
-
async createSession(
|
|
24663
|
+
async createSession(input2 = {}) {
|
|
24542
24664
|
const client2 = await this.#getClient();
|
|
24543
24665
|
return responseData2(await withTimeout2(client2.session.create({
|
|
24544
|
-
...
|
|
24666
|
+
...input2.model ? {
|
|
24545
24667
|
model: {
|
|
24546
|
-
id:
|
|
24547
|
-
providerID:
|
|
24548
|
-
...
|
|
24668
|
+
id: input2.model.modelID,
|
|
24669
|
+
providerID: input2.model.providerID,
|
|
24670
|
+
...input2.variant ? { variant: input2.variant } : {}
|
|
24549
24671
|
}
|
|
24550
24672
|
} : {},
|
|
24551
|
-
...
|
|
24673
|
+
...input2.permission ? { permission: input2.permission } : {}
|
|
24552
24674
|
}), this.#commandTimeoutMs, "OpenCode Session create"), "Session create");
|
|
24553
24675
|
}
|
|
24554
24676
|
async deleteSession(sessionID) {
|
|
@@ -24596,13 +24718,13 @@ var SdkOpenCodeTransport = class {
|
|
|
24596
24718
|
const client2 = await this.#getClient();
|
|
24597
24719
|
return responseData2(await withTimeout2(client2.session.unrevert({ sessionID }), this.#commandTimeoutMs, "OpenCode Session unrevert"), "Session unrevert");
|
|
24598
24720
|
}
|
|
24599
|
-
async promptAsync(
|
|
24721
|
+
async promptAsync(input2) {
|
|
24600
24722
|
const client2 = await this.#getClient();
|
|
24601
24723
|
responseAccepted(await withTimeout2(client2.session.promptAsync({
|
|
24602
|
-
sessionID:
|
|
24603
|
-
...
|
|
24604
|
-
...
|
|
24605
|
-
parts: [{ type: "text", text:
|
|
24724
|
+
sessionID: input2.sessionID,
|
|
24725
|
+
...input2.model ? { model: input2.model } : {},
|
|
24726
|
+
...input2.variant ? { variant: input2.variant } : {},
|
|
24727
|
+
parts: [{ type: "text", text: input2.text }]
|
|
24606
24728
|
}), this.#commandTimeoutMs, "OpenCode prompt admission"), "prompt admission");
|
|
24607
24729
|
}
|
|
24608
24730
|
async summarize(sessionID, model2) {
|
|
@@ -24968,7 +25090,7 @@ function sourceState(projection) {
|
|
|
24968
25090
|
};
|
|
24969
25091
|
}
|
|
24970
25092
|
async function deriveOpenCodeHistory(options) {
|
|
24971
|
-
const { transport, source, input, providers, modelIndex, toolOutputLimit } = options;
|
|
25093
|
+
const { transport, source, input: input2, providers, modelIndex, toolOutputLimit } = options;
|
|
24972
25094
|
const read = (id2) => readProjection(transport, id2, providers, toolOutputLimit, modelIndex, {
|
|
24973
25095
|
strictFileChanges: true
|
|
24974
25096
|
});
|
|
@@ -24979,8 +25101,8 @@ async function deriveOpenCodeHistory(options) {
|
|
|
24979
25101
|
const expectedSource = structuredClone(sourceState(before));
|
|
24980
25102
|
let messageID;
|
|
24981
25103
|
let retainedCount;
|
|
24982
|
-
if (
|
|
24983
|
-
const boundary = resolveOpenCodeForkBoundary(before.session, before.messages,
|
|
25104
|
+
if (input2.kind === "fork") {
|
|
25105
|
+
const boundary = resolveOpenCodeForkBoundary(before.session, before.messages, input2.checkpoint);
|
|
24984
25106
|
if (!boundary)
|
|
24985
25107
|
throw new OpenCodeTransportError("checkpointNotFound", "OpenCode Checkpoint is not on the source Session transcript");
|
|
24986
25108
|
messageID = boundary.messageID;
|
|
@@ -25039,17 +25161,17 @@ function normalizeError(error51, fallback) {
|
|
|
25039
25161
|
retryable: error51.code === "unavailable" || error51.code === "processExited" || error51.code === "authenticationRequired"
|
|
25040
25162
|
};
|
|
25041
25163
|
}
|
|
25042
|
-
const
|
|
25043
|
-
const lower =
|
|
25164
|
+
const text2 = error51 instanceof Error ? error51.message : String(error51);
|
|
25165
|
+
const lower = text2.toLowerCase();
|
|
25044
25166
|
if (lower.includes("sessionbusy") || lower.includes("session busy")) {
|
|
25045
|
-
return { code: "sessionBusy", message:
|
|
25167
|
+
return { code: "sessionBusy", message: text2, retryable: true };
|
|
25046
25168
|
}
|
|
25047
25169
|
if (lower.includes("not found")) {
|
|
25048
|
-
return { code: "sessionNotFound", message:
|
|
25170
|
+
return { code: "sessionNotFound", message: text2, retryable: false };
|
|
25049
25171
|
}
|
|
25050
25172
|
return {
|
|
25051
25173
|
code: fallback,
|
|
25052
|
-
message:
|
|
25174
|
+
message: text2,
|
|
25053
25175
|
retryable: fallback === "unavailable" || fallback === "nativeFailure"
|
|
25054
25176
|
};
|
|
25055
25177
|
}
|
|
@@ -25088,12 +25210,12 @@ var openCodeCommandCatalog = harnessCommandCatalogSchema.parse({
|
|
|
25088
25210
|
}
|
|
25089
25211
|
]
|
|
25090
25212
|
});
|
|
25091
|
-
function boundedOutput(
|
|
25092
|
-
if (!
|
|
25213
|
+
function boundedOutput(text2, limit) {
|
|
25214
|
+
if (!text2)
|
|
25093
25215
|
return void 0;
|
|
25094
|
-
const truncated =
|
|
25216
|
+
const truncated = text2.length > limit;
|
|
25095
25217
|
return {
|
|
25096
|
-
content: [{ type: "text", text: truncated ?
|
|
25218
|
+
content: [{ type: "text", text: truncated ? text2.slice(0, limit) : text2 }],
|
|
25097
25219
|
...truncated ? { truncated: true } : {}
|
|
25098
25220
|
};
|
|
25099
25221
|
}
|
|
@@ -25135,28 +25257,28 @@ var OpenCodeHarnessSession = class {
|
|
|
25135
25257
|
#state;
|
|
25136
25258
|
#usage;
|
|
25137
25259
|
#variant;
|
|
25138
|
-
constructor(
|
|
25139
|
-
this.#transport =
|
|
25140
|
-
this.#session =
|
|
25141
|
-
this.#snapshot =
|
|
25142
|
-
this.#providerCatalog =
|
|
25143
|
-
this.#modelCatalog =
|
|
25144
|
-
this.#model =
|
|
25145
|
-
this.#variant =
|
|
25146
|
-
this.#toolOutputLimit =
|
|
25147
|
-
this.#closeTimeoutMs =
|
|
25148
|
-
this.#uuid =
|
|
25149
|
-
this.#onClosed =
|
|
25150
|
-
this.#connection =
|
|
25151
|
-
this.#executionPolicy =
|
|
25152
|
-
this.#permissionMode =
|
|
25153
|
-
for (const { info } of
|
|
25260
|
+
constructor(input2) {
|
|
25261
|
+
this.#transport = input2.transport;
|
|
25262
|
+
this.#session = input2.projection.session;
|
|
25263
|
+
this.#snapshot = input2.projection.snapshot;
|
|
25264
|
+
this.#providerCatalog = input2.providerCatalog;
|
|
25265
|
+
this.#modelCatalog = input2.modelCatalog;
|
|
25266
|
+
this.#model = input2.projection.model;
|
|
25267
|
+
this.#variant = input2.projection.variant;
|
|
25268
|
+
this.#toolOutputLimit = input2.toolOutputLimit;
|
|
25269
|
+
this.#closeTimeoutMs = input2.closeTimeoutMs;
|
|
25270
|
+
this.#uuid = input2.randomUUID;
|
|
25271
|
+
this.#onClosed = input2.onClosed;
|
|
25272
|
+
this.#connection = input2.connection;
|
|
25273
|
+
this.#executionPolicy = input2.executionPolicy;
|
|
25274
|
+
this.#permissionMode = input2.permissionMode;
|
|
25275
|
+
for (const { info } of input2.projection.messages) {
|
|
25154
25276
|
if (info.role === "user")
|
|
25155
25277
|
this.#knownUserMessageIds.add(info.id);
|
|
25156
25278
|
}
|
|
25157
25279
|
this.#state = sessionState(this.#session, this.#modelCatalog, this.#model, this.#variant, this.#executionPolicy, harnessPermissionModeIdSchema.parse(this.#permissionMode));
|
|
25158
25280
|
this.initialState = this.#state;
|
|
25159
|
-
this.#usage =
|
|
25281
|
+
this.#usage = input2.projection.usage;
|
|
25160
25282
|
this.initialUsage = this.#usage;
|
|
25161
25283
|
const thinkingSelectable = this.#modelCatalog.catalog.thinkingOptions.length > 1;
|
|
25162
25284
|
this.capabilities = {
|
|
@@ -25229,8 +25351,8 @@ var OpenCodeHarnessSession = class {
|
|
|
25229
25351
|
}
|
|
25230
25352
|
};
|
|
25231
25353
|
}
|
|
25232
|
-
const
|
|
25233
|
-
if (!
|
|
25354
|
+
const text2 = command.input.map(({ text: part }) => part).join("\n");
|
|
25355
|
+
if (!text2) {
|
|
25234
25356
|
return {
|
|
25235
25357
|
ok: false,
|
|
25236
25358
|
error: {
|
|
@@ -25249,7 +25371,7 @@ var OpenCodeHarnessSession = class {
|
|
|
25249
25371
|
try {
|
|
25250
25372
|
const prompt = this.#transport.promptAsync({
|
|
25251
25373
|
sessionID: this.#session.id,
|
|
25252
|
-
text,
|
|
25374
|
+
text: text2,
|
|
25253
25375
|
...this.#model ? { model: this.#model } : {},
|
|
25254
25376
|
...this.#variant ? { variant: this.#variant } : {}
|
|
25255
25377
|
});
|
|
@@ -26176,24 +26298,24 @@ var OpenCodeAdapter = class {
|
|
|
26176
26298
|
this.#toolOutputLimit = options.toolOutputLimit ?? DEFAULT_TOOL_OUTPUT_LIMIT;
|
|
26177
26299
|
this.#closeTimeoutMs = options.closeTimeoutMs ?? DEFAULT_CLOSE_TIMEOUT_MS2;
|
|
26178
26300
|
}
|
|
26179
|
-
async inspect(
|
|
26180
|
-
const result = await this.#inspect(
|
|
26301
|
+
async inspect(input2 = {}, onModels) {
|
|
26302
|
+
const result = await this.#inspect(input2);
|
|
26181
26303
|
if (result.status !== "ready")
|
|
26182
26304
|
return result;
|
|
26183
26305
|
const { index, ...inspection } = result;
|
|
26184
26306
|
onModels?.({ catalog: result.catalog, index });
|
|
26185
26307
|
return inspection;
|
|
26186
26308
|
}
|
|
26187
|
-
async #inspect(
|
|
26309
|
+
async #inspect(input2) {
|
|
26188
26310
|
if (this.#closePromise) {
|
|
26189
26311
|
return {
|
|
26190
26312
|
status: "unavailable",
|
|
26191
26313
|
error: invalidState("OpenCode Adapter is closed")
|
|
26192
26314
|
};
|
|
26193
26315
|
}
|
|
26194
|
-
const cwd =
|
|
26316
|
+
const cwd = input2.cwd ?? process.cwd();
|
|
26195
26317
|
const inFlight = this.#inspectionInFlight.get(cwd);
|
|
26196
|
-
if (
|
|
26318
|
+
if (input2.refresh) {
|
|
26197
26319
|
this.#inspectionCache.clear();
|
|
26198
26320
|
this.#inspectionInFlight.clear();
|
|
26199
26321
|
if (inFlight)
|
|
@@ -26259,11 +26381,11 @@ var OpenCodeAdapter = class {
|
|
|
26259
26381
|
await connection.close().catch(() => void 0);
|
|
26260
26382
|
}
|
|
26261
26383
|
}
|
|
26262
|
-
async open(
|
|
26384
|
+
async open(input2) {
|
|
26263
26385
|
if (this.#closePromise) {
|
|
26264
26386
|
return { ok: false, error: invalidState("OpenCode Adapter is closed") };
|
|
26265
26387
|
}
|
|
26266
|
-
if (!
|
|
26388
|
+
if (!input2.cwd) {
|
|
26267
26389
|
return {
|
|
26268
26390
|
ok: false,
|
|
26269
26391
|
error: {
|
|
@@ -26273,7 +26395,7 @@ var OpenCodeAdapter = class {
|
|
|
26273
26395
|
}
|
|
26274
26396
|
};
|
|
26275
26397
|
}
|
|
26276
|
-
if (
|
|
26398
|
+
if (input2.kind === "create" && input2.thinkingOptionId && !input2.model) {
|
|
26277
26399
|
return {
|
|
26278
26400
|
ok: false,
|
|
26279
26401
|
error: {
|
|
@@ -26287,11 +26409,11 @@ var OpenCodeAdapter = class {
|
|
|
26287
26409
|
let transport;
|
|
26288
26410
|
let createdForCleanup;
|
|
26289
26411
|
try {
|
|
26290
|
-
const sourceRef =
|
|
26291
|
-
const executionPolicy =
|
|
26412
|
+
const sourceRef = input2.kind === "create" ? void 0 : parseOpenCodeSessionRef(input2.kind === "resume" ? input2.nativeRef : input2.sourceRef);
|
|
26413
|
+
const executionPolicy = input2.kind === "create" ? input2.executionPolicy ?? "default" : sourceRef?.executionPolicy ?? "default";
|
|
26292
26414
|
let requestedPermissionMode;
|
|
26293
|
-
if (
|
|
26294
|
-
const requestedPermissionModeId =
|
|
26415
|
+
if (input2.kind === "create") {
|
|
26416
|
+
const requestedPermissionModeId = input2.permissionModeId ?? (executionPolicy === "unattended-full-access" ? harnessPermissionModeIdSchema.parse("allow") : OPENCODE_DEFAULT_PERMISSION_MODE_ID);
|
|
26295
26417
|
try {
|
|
26296
26418
|
requestedPermissionMode = decodeOpenCodePermissionModeId(requestedPermissionModeId);
|
|
26297
26419
|
} catch {
|
|
@@ -26311,19 +26433,19 @@ var OpenCodeAdapter = class {
|
|
|
26311
26433
|
};
|
|
26312
26434
|
}
|
|
26313
26435
|
}
|
|
26314
|
-
const sessionEnvironment =
|
|
26436
|
+
const sessionEnvironment = input2.environment ?? this.#options.environment ?? process.env;
|
|
26315
26437
|
const serverOptions = {
|
|
26316
26438
|
...this.#options,
|
|
26317
26439
|
environment: managedOpenCodeEnvironment(sessionEnvironment, executionPolicy)
|
|
26318
26440
|
};
|
|
26319
26441
|
connection = this.#createConnection(serverOptions);
|
|
26320
|
-
transport = this.#createTransport(connection,
|
|
26442
|
+
transport = this.#createTransport(connection, input2.cwd, serverOptions);
|
|
26321
26443
|
const providers = await transport.providers();
|
|
26322
26444
|
const modelCatalog = normalizeOpenCodeModelCatalog(providers);
|
|
26323
26445
|
let session;
|
|
26324
|
-
if (
|
|
26325
|
-
const model2 =
|
|
26326
|
-
const variant =
|
|
26446
|
+
if (input2.kind === "create") {
|
|
26447
|
+
const model2 = input2.model ? decodeOpenCodeModelRef(input2.model, modelCatalog.index) : void 0;
|
|
26448
|
+
const variant = input2.thinkingOptionId ? decodeOpenCodeVariant(input2.thinkingOptionId) : void 0;
|
|
26327
26449
|
const permission = requestedPermissionMode && requestedPermissionMode !== "default" ? requestedPermissionRules(void 0, requestedPermissionMode) : void 0;
|
|
26328
26450
|
session = await transport.createSession({
|
|
26329
26451
|
...model2 ? { model: model2 } : {},
|
|
@@ -26351,7 +26473,7 @@ var OpenCodeAdapter = class {
|
|
|
26351
26473
|
if (source.id !== sourceRef.ref.nativeSessionId) {
|
|
26352
26474
|
throw new OpenCodeTransportError("protocolError", "OpenCode resumed Session identity changed");
|
|
26353
26475
|
}
|
|
26354
|
-
if (!sameCwd(source.directory,
|
|
26476
|
+
if (!sameCwd(source.directory, input2.cwd)) {
|
|
26355
26477
|
await transport.close().catch(() => void 0);
|
|
26356
26478
|
await connection.close().catch(() => void 0);
|
|
26357
26479
|
return {
|
|
@@ -26359,13 +26481,13 @@ var OpenCodeAdapter = class {
|
|
|
26359
26481
|
error: unsupported("OpenCode cross-cwd Fork and Resume are not supported")
|
|
26360
26482
|
};
|
|
26361
26483
|
}
|
|
26362
|
-
if (
|
|
26484
|
+
if (input2.kind === "resume") {
|
|
26363
26485
|
session = source;
|
|
26364
26486
|
} else {
|
|
26365
26487
|
session = await deriveOpenCodeHistory({
|
|
26366
26488
|
transport,
|
|
26367
26489
|
source,
|
|
26368
|
-
input,
|
|
26490
|
+
input: input2,
|
|
26369
26491
|
providers,
|
|
26370
26492
|
modelIndex: modelCatalog.index,
|
|
26371
26493
|
toolOutputLimit: this.#toolOutputLimit,
|
|
@@ -26890,10 +27012,10 @@ function make6(options) {
|
|
|
26890
27012
|
info: (requestOptions) => request({ method: "GET", path: `/api/info`, successStatus: 200, declaredStatuses: [400, 401], empty: false }, requestOptions)
|
|
26891
27013
|
},
|
|
26892
27014
|
location: {
|
|
26893
|
-
get: (
|
|
27015
|
+
get: (input2, requestOptions) => request({
|
|
26894
27016
|
method: "GET",
|
|
26895
27017
|
path: `/api/location`,
|
|
26896
|
-
query: { location:
|
|
27018
|
+
query: { location: input2?.["location"] },
|
|
26897
27019
|
successStatus: 200,
|
|
26898
27020
|
declaredStatuses: [400, 401],
|
|
26899
27021
|
empty: false
|
|
@@ -26907,111 +27029,111 @@ function make6(options) {
|
|
|
26907
27029
|
}, requestOptions)
|
|
26908
27030
|
},
|
|
26909
27031
|
agent: {
|
|
26910
|
-
list: (
|
|
27032
|
+
list: (input2, requestOptions) => request({
|
|
26911
27033
|
method: "GET",
|
|
26912
27034
|
path: `/api/agent`,
|
|
26913
|
-
query: { location:
|
|
27035
|
+
query: { location: input2?.["location"] },
|
|
26914
27036
|
successStatus: 200,
|
|
26915
27037
|
declaredStatuses: [400, 401],
|
|
26916
27038
|
empty: false
|
|
26917
27039
|
}, requestOptions),
|
|
26918
|
-
get: (
|
|
27040
|
+
get: (input2, requestOptions) => request({
|
|
26919
27041
|
method: "GET",
|
|
26920
|
-
path: `/api/agent/${encodeURIComponent(
|
|
26921
|
-
query: { location:
|
|
27042
|
+
path: `/api/agent/${encodeURIComponent(input2.agentID)}`,
|
|
27043
|
+
query: { location: input2["location"] },
|
|
26922
27044
|
successStatus: 200,
|
|
26923
27045
|
declaredStatuses: [400, 401, 404],
|
|
26924
27046
|
empty: false
|
|
26925
27047
|
}, requestOptions)
|
|
26926
27048
|
},
|
|
26927
27049
|
plugin: {
|
|
26928
|
-
list: (
|
|
27050
|
+
list: (input2, requestOptions) => request({
|
|
26929
27051
|
method: "GET",
|
|
26930
27052
|
path: `/api/plugin`,
|
|
26931
|
-
query: { location:
|
|
27053
|
+
query: { location: input2?.["location"] },
|
|
26932
27054
|
successStatus: 200,
|
|
26933
27055
|
declaredStatuses: [400, 401],
|
|
26934
27056
|
empty: false
|
|
26935
27057
|
}, requestOptions),
|
|
26936
|
-
check: (
|
|
27058
|
+
check: (input2, requestOptions) => request({
|
|
26937
27059
|
method: "POST",
|
|
26938
27060
|
path: `/api/plugin/check`,
|
|
26939
|
-
query: { location:
|
|
26940
|
-
body: { target:
|
|
27061
|
+
query: { location: input2?.["location"] },
|
|
27062
|
+
body: { target: input2?.["target"] },
|
|
26941
27063
|
successStatus: 200,
|
|
26942
27064
|
declaredStatuses: [400, 401],
|
|
26943
27065
|
empty: false
|
|
26944
27066
|
}, requestOptions),
|
|
26945
|
-
update: (
|
|
27067
|
+
update: (input2, requestOptions) => request({
|
|
26946
27068
|
method: "POST",
|
|
26947
27069
|
path: `/api/plugin/update`,
|
|
26948
|
-
query: { location:
|
|
26949
|
-
body: { targets:
|
|
27070
|
+
query: { location: input2["location"] },
|
|
27071
|
+
body: { targets: input2["targets"] },
|
|
26950
27072
|
successStatus: 204,
|
|
26951
27073
|
declaredStatuses: [400, 401, 503],
|
|
26952
27074
|
empty: true
|
|
26953
27075
|
}, requestOptions)
|
|
26954
27076
|
},
|
|
26955
27077
|
session: {
|
|
26956
|
-
list: (
|
|
27078
|
+
list: (input2, requestOptions) => request({
|
|
26957
27079
|
method: "GET",
|
|
26958
27080
|
path: `/api/session`,
|
|
26959
27081
|
query: {
|
|
26960
|
-
limit:
|
|
26961
|
-
order:
|
|
26962
|
-
search:
|
|
26963
|
-
parentID:
|
|
26964
|
-
directory:
|
|
26965
|
-
project:
|
|
26966
|
-
subpath:
|
|
26967
|
-
cursor:
|
|
27082
|
+
limit: input2?.["limit"],
|
|
27083
|
+
order: input2?.["order"],
|
|
27084
|
+
search: input2?.["search"],
|
|
27085
|
+
parentID: input2?.["parentID"],
|
|
27086
|
+
directory: input2?.["directory"],
|
|
27087
|
+
project: input2?.["project"],
|
|
27088
|
+
subpath: input2?.["subpath"],
|
|
27089
|
+
cursor: input2?.["cursor"]
|
|
26968
27090
|
},
|
|
26969
27091
|
successStatus: 200,
|
|
26970
27092
|
declaredStatuses: [400, 401],
|
|
26971
27093
|
empty: false
|
|
26972
27094
|
}, requestOptions),
|
|
26973
|
-
stats: (
|
|
27095
|
+
stats: (input2, requestOptions) => request({
|
|
26974
27096
|
method: "GET",
|
|
26975
27097
|
path: `/api/experimental/session/stats`,
|
|
26976
27098
|
query: {
|
|
26977
|
-
from:
|
|
26978
|
-
to:
|
|
26979
|
-
project:
|
|
26980
|
-
timezone:
|
|
26981
|
-
tools:
|
|
27099
|
+
from: input2?.["from"],
|
|
27100
|
+
to: input2?.["to"],
|
|
27101
|
+
project: input2?.["project"],
|
|
27102
|
+
timezone: input2?.["timezone"],
|
|
27103
|
+
tools: input2?.["tools"]
|
|
26982
27104
|
},
|
|
26983
27105
|
successStatus: 200,
|
|
26984
27106
|
declaredStatuses: [400, 401],
|
|
26985
27107
|
empty: false
|
|
26986
27108
|
}, requestOptions).then((value) => value.data),
|
|
26987
|
-
create: (
|
|
27109
|
+
create: (input2, requestOptions) => request({
|
|
26988
27110
|
method: "POST",
|
|
26989
27111
|
path: `/api/session`,
|
|
26990
27112
|
body: {
|
|
26991
|
-
id:
|
|
26992
|
-
title:
|
|
26993
|
-
agent:
|
|
26994
|
-
model:
|
|
26995
|
-
location:
|
|
26996
|
-
metadata:
|
|
26997
|
-
permissions:
|
|
27113
|
+
id: input2?.["id"],
|
|
27114
|
+
title: input2?.["title"],
|
|
27115
|
+
agent: input2?.["agent"],
|
|
27116
|
+
model: input2?.["model"],
|
|
27117
|
+
location: input2?.["location"],
|
|
27118
|
+
metadata: input2?.["metadata"],
|
|
27119
|
+
permissions: input2?.["permissions"]
|
|
26998
27120
|
},
|
|
26999
27121
|
successStatus: 200,
|
|
27000
27122
|
declaredStatuses: [400, 401],
|
|
27001
27123
|
empty: false
|
|
27002
27124
|
}, requestOptions).then((value) => value.data),
|
|
27003
|
-
import: (
|
|
27125
|
+
import: (input2, requestOptions) => request({
|
|
27004
27126
|
method: "POST",
|
|
27005
27127
|
path: `/api/experimental/session/import`,
|
|
27006
|
-
body: { info:
|
|
27128
|
+
body: { info: input2["info"], messages: input2["messages"], location: input2["location"] },
|
|
27007
27129
|
successStatus: 200,
|
|
27008
27130
|
declaredStatuses: [400, 401, 404, 409],
|
|
27009
27131
|
empty: false
|
|
27010
27132
|
}, requestOptions).then((value) => value.data),
|
|
27011
|
-
export: (
|
|
27133
|
+
export: (input2, requestOptions) => request({
|
|
27012
27134
|
method: "GET",
|
|
27013
|
-
path: `/api/experimental/session/${encodeURIComponent(
|
|
27014
|
-
query: { sanitize:
|
|
27135
|
+
path: `/api/experimental/session/${encodeURIComponent(input2.sessionID)}/export`,
|
|
27136
|
+
query: { sanitize: input2["sanitize"] },
|
|
27015
27137
|
successStatus: 200,
|
|
27016
27138
|
declaredStatuses: [400, 401, 404, 500],
|
|
27017
27139
|
empty: false
|
|
@@ -27023,196 +27145,196 @@ function make6(options) {
|
|
|
27023
27145
|
declaredStatuses: [400, 401],
|
|
27024
27146
|
empty: false
|
|
27025
27147
|
}, requestOptions).then((value) => value.data),
|
|
27026
|
-
get: (
|
|
27148
|
+
get: (input2, requestOptions) => request({
|
|
27027
27149
|
method: "GET",
|
|
27028
|
-
path: `/api/session/${encodeURIComponent(
|
|
27150
|
+
path: `/api/session/${encodeURIComponent(input2.sessionID)}`,
|
|
27029
27151
|
successStatus: 200,
|
|
27030
27152
|
declaredStatuses: [400, 401, 404],
|
|
27031
27153
|
empty: false
|
|
27032
27154
|
}, requestOptions).then((value) => value.data),
|
|
27033
|
-
remove: (
|
|
27155
|
+
remove: (input2, requestOptions) => request({
|
|
27034
27156
|
method: "DELETE",
|
|
27035
|
-
path: `/api/session/${encodeURIComponent(
|
|
27157
|
+
path: `/api/session/${encodeURIComponent(input2.sessionID)}`,
|
|
27036
27158
|
successStatus: 204,
|
|
27037
27159
|
declaredStatuses: [400, 401, 404],
|
|
27038
27160
|
empty: true
|
|
27039
27161
|
}, requestOptions),
|
|
27040
|
-
fork: (
|
|
27162
|
+
fork: (input2, requestOptions) => request({
|
|
27041
27163
|
method: "POST",
|
|
27042
|
-
path: `/api/session/${encodeURIComponent(
|
|
27043
|
-
body: { before:
|
|
27164
|
+
path: `/api/session/${encodeURIComponent(input2.sessionID)}/fork`,
|
|
27165
|
+
body: { before: input2["before"] },
|
|
27044
27166
|
successStatus: 200,
|
|
27045
27167
|
declaredStatuses: [400, 401, 404],
|
|
27046
27168
|
empty: false
|
|
27047
27169
|
}, requestOptions).then((value) => value.data),
|
|
27048
|
-
switchAgent: (
|
|
27170
|
+
switchAgent: (input2, requestOptions) => request({
|
|
27049
27171
|
method: "POST",
|
|
27050
|
-
path: `/api/session/${encodeURIComponent(
|
|
27051
|
-
body: { agent:
|
|
27172
|
+
path: `/api/session/${encodeURIComponent(input2.sessionID)}/agent`,
|
|
27173
|
+
body: { agent: input2["agent"] },
|
|
27052
27174
|
successStatus: 204,
|
|
27053
27175
|
declaredStatuses: [400, 401, 404],
|
|
27054
27176
|
empty: true
|
|
27055
27177
|
}, requestOptions),
|
|
27056
|
-
switchModel: (
|
|
27178
|
+
switchModel: (input2, requestOptions) => request({
|
|
27057
27179
|
method: "POST",
|
|
27058
|
-
path: `/api/session/${encodeURIComponent(
|
|
27059
|
-
body: { model:
|
|
27180
|
+
path: `/api/session/${encodeURIComponent(input2.sessionID)}/model`,
|
|
27181
|
+
body: { model: input2["model"] },
|
|
27060
27182
|
successStatus: 204,
|
|
27061
27183
|
declaredStatuses: [400, 401, 404],
|
|
27062
27184
|
empty: true
|
|
27063
27185
|
}, requestOptions),
|
|
27064
|
-
update: (
|
|
27186
|
+
update: (input2, requestOptions) => request({
|
|
27065
27187
|
method: "PATCH",
|
|
27066
|
-
path: `/api/session/${encodeURIComponent(
|
|
27067
|
-
body: { title:
|
|
27188
|
+
path: `/api/session/${encodeURIComponent(input2.sessionID)}`,
|
|
27189
|
+
body: { title: input2["title"], metadata: input2["metadata"], permissions: input2["permissions"] },
|
|
27068
27190
|
successStatus: 204,
|
|
27069
27191
|
declaredStatuses: [400, 401, 404],
|
|
27070
27192
|
empty: true
|
|
27071
27193
|
}, requestOptions),
|
|
27072
|
-
move: (
|
|
27194
|
+
move: (input2, requestOptions) => request({
|
|
27073
27195
|
method: "POST",
|
|
27074
|
-
path: `/api/session/${encodeURIComponent(
|
|
27075
|
-
body: { directory:
|
|
27196
|
+
path: `/api/session/${encodeURIComponent(input2.sessionID)}/move`,
|
|
27197
|
+
body: { directory: input2["directory"], delivery: input2["delivery"] },
|
|
27076
27198
|
successStatus: 204,
|
|
27077
27199
|
declaredStatuses: [400, 401, 404],
|
|
27078
27200
|
empty: true
|
|
27079
27201
|
}, requestOptions),
|
|
27080
|
-
prompt: (
|
|
27202
|
+
prompt: (input2, requestOptions) => request({
|
|
27081
27203
|
method: "POST",
|
|
27082
|
-
path: `/api/session/${encodeURIComponent(
|
|
27204
|
+
path: `/api/session/${encodeURIComponent(input2.sessionID)}/prompt`,
|
|
27083
27205
|
body: {
|
|
27084
|
-
id:
|
|
27085
|
-
text:
|
|
27086
|
-
files:
|
|
27087
|
-
agents:
|
|
27088
|
-
skills:
|
|
27089
|
-
metadata:
|
|
27090
|
-
delivery:
|
|
27091
|
-
resume:
|
|
27206
|
+
id: input2["id"],
|
|
27207
|
+
text: input2["text"],
|
|
27208
|
+
files: input2["files"],
|
|
27209
|
+
agents: input2["agents"],
|
|
27210
|
+
skills: input2["skills"],
|
|
27211
|
+
metadata: input2["metadata"],
|
|
27212
|
+
delivery: input2["delivery"],
|
|
27213
|
+
resume: input2["resume"]
|
|
27092
27214
|
},
|
|
27093
27215
|
successStatus: 200,
|
|
27094
27216
|
declaredStatuses: [400, 401, 404, 409],
|
|
27095
27217
|
empty: false
|
|
27096
27218
|
}, requestOptions).then((value) => value.data),
|
|
27097
|
-
command: (
|
|
27219
|
+
command: (input2, requestOptions) => request({
|
|
27098
27220
|
method: "POST",
|
|
27099
|
-
path: `/api/session/${encodeURIComponent(
|
|
27221
|
+
path: `/api/session/${encodeURIComponent(input2.sessionID)}/command`,
|
|
27100
27222
|
body: {
|
|
27101
|
-
name:
|
|
27102
|
-
text:
|
|
27103
|
-
files:
|
|
27104
|
-
agents:
|
|
27105
|
-
skills:
|
|
27106
|
-
delivery:
|
|
27223
|
+
name: input2["name"],
|
|
27224
|
+
text: input2["text"],
|
|
27225
|
+
files: input2["files"],
|
|
27226
|
+
agents: input2["agents"],
|
|
27227
|
+
skills: input2["skills"],
|
|
27228
|
+
delivery: input2["delivery"]
|
|
27107
27229
|
},
|
|
27108
27230
|
successStatus: 204,
|
|
27109
27231
|
declaredStatuses: [400, 401, 404, 500],
|
|
27110
27232
|
empty: true
|
|
27111
27233
|
}, requestOptions),
|
|
27112
|
-
skill: (
|
|
27234
|
+
skill: (input2, requestOptions) => request({
|
|
27113
27235
|
method: "POST",
|
|
27114
|
-
path: `/api/experimental/session/${encodeURIComponent(
|
|
27115
|
-
body: { id:
|
|
27236
|
+
path: `/api/experimental/session/${encodeURIComponent(input2.sessionID)}/skill`,
|
|
27237
|
+
body: { id: input2["id"], resume: input2["resume"] },
|
|
27116
27238
|
successStatus: 204,
|
|
27117
27239
|
declaredStatuses: [400, 401, 404],
|
|
27118
27240
|
empty: true
|
|
27119
27241
|
}, requestOptions),
|
|
27120
|
-
synthetic: (
|
|
27242
|
+
synthetic: (input2, requestOptions) => request({
|
|
27121
27243
|
method: "POST",
|
|
27122
|
-
path: `/api/session/${encodeURIComponent(
|
|
27244
|
+
path: `/api/session/${encodeURIComponent(input2.sessionID)}/synthetic`,
|
|
27123
27245
|
body: {
|
|
27124
|
-
id:
|
|
27125
|
-
text:
|
|
27126
|
-
description:
|
|
27127
|
-
metadata:
|
|
27128
|
-
delivery:
|
|
27129
|
-
resume:
|
|
27246
|
+
id: input2["id"],
|
|
27247
|
+
text: input2["text"],
|
|
27248
|
+
description: input2["description"],
|
|
27249
|
+
metadata: input2["metadata"],
|
|
27250
|
+
delivery: input2["delivery"],
|
|
27251
|
+
resume: input2["resume"]
|
|
27130
27252
|
},
|
|
27131
27253
|
successStatus: 200,
|
|
27132
27254
|
declaredStatuses: [400, 401, 404, 409],
|
|
27133
27255
|
empty: false
|
|
27134
27256
|
}, requestOptions).then((value) => value.data),
|
|
27135
|
-
shell: (
|
|
27257
|
+
shell: (input2, requestOptions) => request({
|
|
27136
27258
|
method: "POST",
|
|
27137
|
-
path: `/api/session/${encodeURIComponent(
|
|
27138
|
-
body: { id:
|
|
27259
|
+
path: `/api/session/${encodeURIComponent(input2.sessionID)}/shell`,
|
|
27260
|
+
body: { id: input2["id"], command: input2["command"] },
|
|
27139
27261
|
successStatus: 204,
|
|
27140
27262
|
declaredStatuses: [400, 401, 404],
|
|
27141
27263
|
empty: true
|
|
27142
27264
|
}, requestOptions),
|
|
27143
|
-
compact: (
|
|
27265
|
+
compact: (input2, requestOptions) => request({
|
|
27144
27266
|
method: "POST",
|
|
27145
|
-
path: `/api/session/${encodeURIComponent(
|
|
27146
|
-
body: { id:
|
|
27267
|
+
path: `/api/session/${encodeURIComponent(input2.sessionID)}/compact`,
|
|
27268
|
+
body: { id: input2["id"], delivery: input2["delivery"] },
|
|
27147
27269
|
successStatus: 200,
|
|
27148
27270
|
declaredStatuses: [400, 401, 404, 409],
|
|
27149
27271
|
empty: false
|
|
27150
27272
|
}, requestOptions).then((value) => value.data),
|
|
27151
|
-
wait: (
|
|
27273
|
+
wait: (input2, requestOptions) => request({
|
|
27152
27274
|
method: "POST",
|
|
27153
|
-
path: `/api/experimental/session/${encodeURIComponent(
|
|
27275
|
+
path: `/api/experimental/session/${encodeURIComponent(input2.sessionID)}/wait`,
|
|
27154
27276
|
successStatus: 204,
|
|
27155
27277
|
declaredStatuses: [400, 401, 404, 503],
|
|
27156
27278
|
empty: true
|
|
27157
27279
|
}, requestOptions),
|
|
27158
27280
|
revert: {
|
|
27159
|
-
stage: (
|
|
27281
|
+
stage: (input2, requestOptions) => request({
|
|
27160
27282
|
method: "POST",
|
|
27161
|
-
path: `/api/session/${encodeURIComponent(
|
|
27162
|
-
body: { messageID:
|
|
27283
|
+
path: `/api/session/${encodeURIComponent(input2.sessionID)}/revert/stage`,
|
|
27284
|
+
body: { messageID: input2["messageID"], files: input2["files"] },
|
|
27163
27285
|
successStatus: 200,
|
|
27164
27286
|
declaredStatuses: [400, 401, 404, 409, 500],
|
|
27165
27287
|
empty: false
|
|
27166
27288
|
}, requestOptions).then((value) => value.data),
|
|
27167
|
-
clear: (
|
|
27289
|
+
clear: (input2, requestOptions) => request({
|
|
27168
27290
|
method: "DELETE",
|
|
27169
|
-
path: `/api/session/${encodeURIComponent(
|
|
27291
|
+
path: `/api/session/${encodeURIComponent(input2.sessionID)}/revert`,
|
|
27170
27292
|
successStatus: 204,
|
|
27171
27293
|
declaredStatuses: [400, 401, 404, 409, 500],
|
|
27172
27294
|
empty: true
|
|
27173
27295
|
}, requestOptions),
|
|
27174
|
-
commit: (
|
|
27296
|
+
commit: (input2, requestOptions) => request({
|
|
27175
27297
|
method: "POST",
|
|
27176
|
-
path: `/api/session/${encodeURIComponent(
|
|
27298
|
+
path: `/api/session/${encodeURIComponent(input2.sessionID)}/revert/commit`,
|
|
27177
27299
|
successStatus: 204,
|
|
27178
27300
|
declaredStatuses: [400, 401, 404, 409],
|
|
27179
27301
|
empty: true
|
|
27180
27302
|
}, requestOptions)
|
|
27181
27303
|
},
|
|
27182
|
-
context: (
|
|
27304
|
+
context: (input2, requestOptions) => request({
|
|
27183
27305
|
method: "GET",
|
|
27184
|
-
path: `/api/session/${encodeURIComponent(
|
|
27306
|
+
path: `/api/session/${encodeURIComponent(input2.sessionID)}/context`,
|
|
27185
27307
|
successStatus: 200,
|
|
27186
27308
|
declaredStatuses: [400, 401, 404, 500],
|
|
27187
27309
|
empty: false
|
|
27188
27310
|
}, requestOptions).then((value) => value.data),
|
|
27189
|
-
diff: (
|
|
27311
|
+
diff: (input2, requestOptions) => request({
|
|
27190
27312
|
method: "GET",
|
|
27191
|
-
path: `/api/session/${encodeURIComponent(
|
|
27192
|
-
query: { from:
|
|
27313
|
+
path: `/api/session/${encodeURIComponent(input2.sessionID)}/diff`,
|
|
27314
|
+
query: { from: input2["from"], to: input2["to"], context: input2["context"] },
|
|
27193
27315
|
successStatus: 200,
|
|
27194
27316
|
declaredStatuses: [400, 401, 404, 500],
|
|
27195
27317
|
empty: false
|
|
27196
27318
|
}, requestOptions).then((value) => value.data),
|
|
27197
27319
|
inbox: {
|
|
27198
|
-
list: (
|
|
27320
|
+
list: (input2, requestOptions) => request({
|
|
27199
27321
|
method: "GET",
|
|
27200
|
-
path: `/api/session/${encodeURIComponent(
|
|
27322
|
+
path: `/api/session/${encodeURIComponent(input2.sessionID)}/inbox`,
|
|
27201
27323
|
successStatus: 200,
|
|
27202
27324
|
declaredStatuses: [400, 401, 404],
|
|
27203
27325
|
empty: false
|
|
27204
27326
|
}, requestOptions).then((value) => value.data),
|
|
27205
|
-
cancel: (
|
|
27327
|
+
cancel: (input2, requestOptions) => request({
|
|
27206
27328
|
method: "DELETE",
|
|
27207
|
-
path: `/api/session/${encodeURIComponent(
|
|
27329
|
+
path: `/api/session/${encodeURIComponent(input2.sessionID)}/inbox/${encodeURIComponent(input2.inboxID)}`,
|
|
27208
27330
|
successStatus: 204,
|
|
27209
27331
|
declaredStatuses: [400, 401, 404],
|
|
27210
27332
|
empty: true
|
|
27211
27333
|
}, requestOptions),
|
|
27212
|
-
update: (
|
|
27334
|
+
update: (input2, requestOptions) => request({
|
|
27213
27335
|
method: "PATCH",
|
|
27214
|
-
path: `/api/session/${encodeURIComponent(
|
|
27215
|
-
body: { delivery:
|
|
27336
|
+
path: `/api/session/${encodeURIComponent(input2.sessionID)}/inbox/${encodeURIComponent(input2.inboxID)}`,
|
|
27337
|
+
body: { delivery: input2["delivery"] },
|
|
27216
27338
|
successStatus: 204,
|
|
27217
27339
|
declaredStatuses: [400, 401, 404, 409],
|
|
27218
27340
|
empty: true
|
|
@@ -27220,279 +27342,279 @@ function make6(options) {
|
|
|
27220
27342
|
},
|
|
27221
27343
|
instructions: {
|
|
27222
27344
|
entry: {
|
|
27223
|
-
list: (
|
|
27345
|
+
list: (input2, requestOptions) => request({
|
|
27224
27346
|
method: "GET",
|
|
27225
|
-
path: `/api/experimental/session/${encodeURIComponent(
|
|
27347
|
+
path: `/api/experimental/session/${encodeURIComponent(input2.sessionID)}/instructions/entries`,
|
|
27226
27348
|
successStatus: 200,
|
|
27227
27349
|
declaredStatuses: [400, 401, 404],
|
|
27228
27350
|
empty: false
|
|
27229
27351
|
}, requestOptions).then((value) => value.data),
|
|
27230
|
-
put: (
|
|
27352
|
+
put: (input2, requestOptions) => request({
|
|
27231
27353
|
method: "PUT",
|
|
27232
|
-
path: `/api/experimental/session/${encodeURIComponent(
|
|
27233
|
-
body: { value:
|
|
27354
|
+
path: `/api/experimental/session/${encodeURIComponent(input2.sessionID)}/instructions/entries/${encodeURIComponent(input2.key)}`,
|
|
27355
|
+
body: { value: input2["value"] },
|
|
27234
27356
|
successStatus: 204,
|
|
27235
27357
|
declaredStatuses: [400, 401, 404, 413],
|
|
27236
27358
|
empty: true
|
|
27237
27359
|
}, requestOptions),
|
|
27238
|
-
remove: (
|
|
27360
|
+
remove: (input2, requestOptions) => request({
|
|
27239
27361
|
method: "DELETE",
|
|
27240
|
-
path: `/api/experimental/session/${encodeURIComponent(
|
|
27362
|
+
path: `/api/experimental/session/${encodeURIComponent(input2.sessionID)}/instructions/entries/${encodeURIComponent(input2.key)}`,
|
|
27241
27363
|
successStatus: 204,
|
|
27242
27364
|
declaredStatuses: [400, 401, 404],
|
|
27243
27365
|
empty: true
|
|
27244
27366
|
}, requestOptions)
|
|
27245
27367
|
}
|
|
27246
27368
|
},
|
|
27247
|
-
generate: (
|
|
27369
|
+
generate: (input2, requestOptions) => request({
|
|
27248
27370
|
method: "POST",
|
|
27249
|
-
path: `/api/session/${encodeURIComponent(
|
|
27250
|
-
body: { prompt:
|
|
27371
|
+
path: `/api/session/${encodeURIComponent(input2.sessionID)}/generate`,
|
|
27372
|
+
body: { prompt: input2["prompt"] },
|
|
27251
27373
|
successStatus: 200,
|
|
27252
27374
|
declaredStatuses: [400, 401, 404, 503],
|
|
27253
27375
|
empty: false
|
|
27254
27376
|
}, requestOptions).then((value) => value.data),
|
|
27255
|
-
log: (
|
|
27377
|
+
log: (input2, requestOptions) => sse({
|
|
27256
27378
|
method: "GET",
|
|
27257
|
-
path: `/api/experimental/session/${encodeURIComponent(
|
|
27258
|
-
query: { after:
|
|
27379
|
+
path: `/api/experimental/session/${encodeURIComponent(input2.sessionID)}/log`,
|
|
27380
|
+
query: { after: input2["after"], follow: input2["follow"] },
|
|
27259
27381
|
successStatus: 200,
|
|
27260
27382
|
declaredStatuses: [400, 401, 404],
|
|
27261
27383
|
empty: false
|
|
27262
27384
|
}, requestOptions),
|
|
27263
|
-
interrupt: (
|
|
27385
|
+
interrupt: (input2, requestOptions) => request({
|
|
27264
27386
|
method: "POST",
|
|
27265
|
-
path: `/api/session/${encodeURIComponent(
|
|
27266
|
-
query: { resume:
|
|
27387
|
+
path: `/api/session/${encodeURIComponent(input2.sessionID)}/interrupt`,
|
|
27388
|
+
query: { resume: input2["resume"] },
|
|
27267
27389
|
successStatus: 200,
|
|
27268
27390
|
declaredStatuses: [400, 401, 404],
|
|
27269
27391
|
empty: false
|
|
27270
27392
|
}, requestOptions),
|
|
27271
|
-
background: (
|
|
27393
|
+
background: (input2, requestOptions) => request({
|
|
27272
27394
|
method: "POST",
|
|
27273
|
-
path: `/api/session/${encodeURIComponent(
|
|
27395
|
+
path: `/api/session/${encodeURIComponent(input2.sessionID)}/background`,
|
|
27274
27396
|
successStatus: 204,
|
|
27275
27397
|
declaredStatuses: [400, 401, 404],
|
|
27276
27398
|
empty: true
|
|
27277
27399
|
}, requestOptions),
|
|
27278
27400
|
message: {
|
|
27279
|
-
get: (
|
|
27401
|
+
get: (input2, requestOptions) => request({
|
|
27280
27402
|
method: "GET",
|
|
27281
|
-
path: `/api/session/${encodeURIComponent(
|
|
27403
|
+
path: `/api/session/${encodeURIComponent(input2.sessionID)}/message/${encodeURIComponent(input2.messageID)}`,
|
|
27282
27404
|
successStatus: 200,
|
|
27283
27405
|
declaredStatuses: [400, 401, 404],
|
|
27284
27406
|
empty: false
|
|
27285
27407
|
}, requestOptions).then((value) => value.data)
|
|
27286
27408
|
},
|
|
27287
27409
|
form: {
|
|
27288
|
-
list: (
|
|
27410
|
+
list: (input2, requestOptions) => request({
|
|
27289
27411
|
method: "GET",
|
|
27290
|
-
path: `/api/session/${encodeURIComponent(
|
|
27412
|
+
path: `/api/session/${encodeURIComponent(input2.sessionID)}/form`,
|
|
27291
27413
|
successStatus: 200,
|
|
27292
27414
|
declaredStatuses: [400, 401, 404],
|
|
27293
27415
|
empty: false
|
|
27294
27416
|
}, requestOptions).then((value) => value.data),
|
|
27295
|
-
create: (
|
|
27417
|
+
create: (input2, requestOptions) => request({
|
|
27296
27418
|
method: "POST",
|
|
27297
|
-
path: `/api/session/${encodeURIComponent(
|
|
27298
|
-
body: { id:
|
|
27419
|
+
path: `/api/session/${encodeURIComponent(input2.sessionID)}/form`,
|
|
27420
|
+
body: { id: input2["id"], title: input2["title"], metadata: input2["metadata"], fields: input2["fields"] },
|
|
27299
27421
|
successStatus: 200,
|
|
27300
27422
|
declaredStatuses: [400, 401, 404, 409],
|
|
27301
27423
|
empty: false
|
|
27302
27424
|
}, requestOptions).then((value) => value.data),
|
|
27303
|
-
get: (
|
|
27425
|
+
get: (input2, requestOptions) => request({
|
|
27304
27426
|
method: "GET",
|
|
27305
|
-
path: `/api/session/${encodeURIComponent(
|
|
27427
|
+
path: `/api/session/${encodeURIComponent(input2.sessionID)}/form/${encodeURIComponent(input2.formID)}`,
|
|
27306
27428
|
successStatus: 200,
|
|
27307
27429
|
declaredStatuses: [400, 401, 404],
|
|
27308
27430
|
empty: false
|
|
27309
27431
|
}, requestOptions).then((value) => value.data),
|
|
27310
|
-
reply: (
|
|
27432
|
+
reply: (input2, requestOptions) => request({
|
|
27311
27433
|
method: "POST",
|
|
27312
|
-
path: `/api/session/${encodeURIComponent(
|
|
27313
|
-
body: { answer:
|
|
27434
|
+
path: `/api/session/${encodeURIComponent(input2.sessionID)}/form/${encodeURIComponent(input2.formID)}/reply`,
|
|
27435
|
+
body: { answer: input2["answer"] },
|
|
27314
27436
|
successStatus: 204,
|
|
27315
27437
|
declaredStatuses: [400, 401, 404, 409],
|
|
27316
27438
|
empty: true
|
|
27317
27439
|
}, requestOptions),
|
|
27318
|
-
cancel: (
|
|
27440
|
+
cancel: (input2, requestOptions) => request({
|
|
27319
27441
|
method: "DELETE",
|
|
27320
|
-
path: `/api/session/${encodeURIComponent(
|
|
27442
|
+
path: `/api/session/${encodeURIComponent(input2.sessionID)}/form/${encodeURIComponent(input2.formID)}`,
|
|
27321
27443
|
successStatus: 204,
|
|
27322
27444
|
declaredStatuses: [400, 401, 404, 409],
|
|
27323
27445
|
empty: true
|
|
27324
27446
|
}, requestOptions)
|
|
27325
27447
|
},
|
|
27326
|
-
environment: (
|
|
27448
|
+
environment: (input2, requestOptions) => request({
|
|
27327
27449
|
method: "PUT",
|
|
27328
|
-
path: `/api/session/${encodeURIComponent(
|
|
27329
|
-
body: { variables:
|
|
27450
|
+
path: `/api/session/${encodeURIComponent(input2.sessionID)}/environment`,
|
|
27451
|
+
body: { variables: input2["variables"] },
|
|
27330
27452
|
successStatus: 204,
|
|
27331
27453
|
declaredStatuses: [400, 401, 404],
|
|
27332
27454
|
empty: true
|
|
27333
27455
|
}, requestOptions),
|
|
27334
|
-
view: (
|
|
27456
|
+
view: (input2, requestOptions) => request({
|
|
27335
27457
|
method: "POST",
|
|
27336
|
-
path: `/api/session/${encodeURIComponent(
|
|
27337
|
-
body: { idle:
|
|
27458
|
+
path: `/api/session/${encodeURIComponent(input2.sessionID)}/view`,
|
|
27459
|
+
body: { idle: input2["idle"] },
|
|
27338
27460
|
successStatus: 204,
|
|
27339
27461
|
declaredStatuses: [400, 401, 404],
|
|
27340
27462
|
empty: true
|
|
27341
27463
|
}, requestOptions)
|
|
27342
27464
|
},
|
|
27343
27465
|
message: {
|
|
27344
|
-
list: (
|
|
27466
|
+
list: (input2, requestOptions) => request({
|
|
27345
27467
|
method: "GET",
|
|
27346
|
-
path: `/api/session/${encodeURIComponent(
|
|
27347
|
-
query: { limit:
|
|
27468
|
+
path: `/api/session/${encodeURIComponent(input2.sessionID)}/message`,
|
|
27469
|
+
query: { limit: input2["limit"], order: input2["order"], cursor: input2["cursor"], type: input2["type"] },
|
|
27348
27470
|
successStatus: 200,
|
|
27349
27471
|
declaredStatuses: [400, 401, 404, 500],
|
|
27350
27472
|
empty: false
|
|
27351
27473
|
}, requestOptions)
|
|
27352
27474
|
},
|
|
27353
27475
|
model: {
|
|
27354
|
-
list: (
|
|
27476
|
+
list: (input2, requestOptions) => request({
|
|
27355
27477
|
method: "GET",
|
|
27356
27478
|
path: `/api/model`,
|
|
27357
|
-
query: { location:
|
|
27479
|
+
query: { location: input2?.["location"] },
|
|
27358
27480
|
successStatus: 200,
|
|
27359
27481
|
declaredStatuses: [400, 401, 503],
|
|
27360
27482
|
empty: false
|
|
27361
27483
|
}, requestOptions),
|
|
27362
|
-
default: (
|
|
27484
|
+
default: (input2, requestOptions) => request({
|
|
27363
27485
|
method: "GET",
|
|
27364
27486
|
path: `/api/model/default`,
|
|
27365
|
-
query: { location:
|
|
27487
|
+
query: { location: input2?.["location"] },
|
|
27366
27488
|
successStatus: 200,
|
|
27367
27489
|
declaredStatuses: [400, 401, 503],
|
|
27368
27490
|
empty: false
|
|
27369
27491
|
}, requestOptions)
|
|
27370
27492
|
},
|
|
27371
27493
|
generate: {
|
|
27372
|
-
text: (
|
|
27494
|
+
text: (input2, requestOptions) => request({
|
|
27373
27495
|
method: "POST",
|
|
27374
27496
|
path: `/api/experimental/generate`,
|
|
27375
|
-
body: { prompt:
|
|
27497
|
+
body: { prompt: input2["prompt"], model: input2["model"] },
|
|
27376
27498
|
successStatus: 200,
|
|
27377
27499
|
declaredStatuses: [400, 401, 503],
|
|
27378
27500
|
empty: false
|
|
27379
27501
|
}, requestOptions).then((value) => value.data)
|
|
27380
27502
|
},
|
|
27381
27503
|
provider: {
|
|
27382
|
-
list: (
|
|
27504
|
+
list: (input2, requestOptions) => request({
|
|
27383
27505
|
method: "GET",
|
|
27384
27506
|
path: `/api/provider`,
|
|
27385
|
-
query: { location:
|
|
27507
|
+
query: { location: input2?.["location"] },
|
|
27386
27508
|
successStatus: 200,
|
|
27387
27509
|
declaredStatuses: [400, 401, 503],
|
|
27388
27510
|
empty: false
|
|
27389
27511
|
}, requestOptions),
|
|
27390
|
-
get: (
|
|
27512
|
+
get: (input2, requestOptions) => request({
|
|
27391
27513
|
method: "GET",
|
|
27392
|
-
path: `/api/provider/${encodeURIComponent(
|
|
27393
|
-
query: { location:
|
|
27514
|
+
path: `/api/provider/${encodeURIComponent(input2.providerID)}`,
|
|
27515
|
+
query: { location: input2["location"] },
|
|
27394
27516
|
successStatus: 200,
|
|
27395
27517
|
declaredStatuses: [400, 401, 404, 503],
|
|
27396
27518
|
empty: false
|
|
27397
27519
|
}, requestOptions)
|
|
27398
27520
|
},
|
|
27399
27521
|
integration: {
|
|
27400
|
-
list: (
|
|
27522
|
+
list: (input2, requestOptions) => request({
|
|
27401
27523
|
method: "GET",
|
|
27402
27524
|
path: `/api/integration`,
|
|
27403
|
-
query: { location:
|
|
27525
|
+
query: { location: input2?.["location"] },
|
|
27404
27526
|
successStatus: 200,
|
|
27405
27527
|
declaredStatuses: [400, 401],
|
|
27406
27528
|
empty: false
|
|
27407
27529
|
}, requestOptions),
|
|
27408
|
-
get: (
|
|
27530
|
+
get: (input2, requestOptions) => request({
|
|
27409
27531
|
method: "GET",
|
|
27410
|
-
path: `/api/integration/${encodeURIComponent(
|
|
27411
|
-
query: { location:
|
|
27532
|
+
path: `/api/integration/${encodeURIComponent(input2.integrationID)}`,
|
|
27533
|
+
query: { location: input2["location"] },
|
|
27412
27534
|
successStatus: 200,
|
|
27413
27535
|
declaredStatuses: [400, 401, 404],
|
|
27414
27536
|
empty: false
|
|
27415
27537
|
}, requestOptions),
|
|
27416
27538
|
wellknown: {
|
|
27417
|
-
add: (
|
|
27539
|
+
add: (input2, requestOptions) => request({
|
|
27418
27540
|
method: "POST",
|
|
27419
27541
|
path: `/api/experimental/integration/wellknown`,
|
|
27420
|
-
query: { location:
|
|
27421
|
-
body: { url:
|
|
27542
|
+
query: { location: input2["location"] },
|
|
27543
|
+
body: { url: input2["url"] },
|
|
27422
27544
|
successStatus: 204,
|
|
27423
27545
|
declaredStatuses: [400, 401],
|
|
27424
27546
|
empty: true
|
|
27425
27547
|
}, requestOptions)
|
|
27426
27548
|
},
|
|
27427
27549
|
connect: {
|
|
27428
|
-
key: (
|
|
27550
|
+
key: (input2, requestOptions) => request({
|
|
27429
27551
|
method: "POST",
|
|
27430
|
-
path: `/api/integration/${encodeURIComponent(
|
|
27431
|
-
query: { location:
|
|
27432
|
-
body: { key:
|
|
27552
|
+
path: `/api/integration/${encodeURIComponent(input2.integrationID)}/connect/key`,
|
|
27553
|
+
query: { location: input2["location"] },
|
|
27554
|
+
body: { key: input2["key"], answer: input2["answer"], label: input2["label"] },
|
|
27433
27555
|
successStatus: 204,
|
|
27434
27556
|
declaredStatuses: [400, 401, 404],
|
|
27435
27557
|
empty: true
|
|
27436
27558
|
}, requestOptions)
|
|
27437
27559
|
},
|
|
27438
27560
|
oauth: {
|
|
27439
|
-
connect: (
|
|
27561
|
+
connect: (input2, requestOptions) => request({
|
|
27440
27562
|
method: "POST",
|
|
27441
|
-
path: `/api/integration/${encodeURIComponent(
|
|
27442
|
-
query: { location:
|
|
27443
|
-
body: { methodID:
|
|
27563
|
+
path: `/api/integration/${encodeURIComponent(input2.integrationID)}/connect/oauth`,
|
|
27564
|
+
query: { location: input2["location"] },
|
|
27565
|
+
body: { methodID: input2["methodID"], answer: input2["answer"], label: input2["label"] },
|
|
27444
27566
|
successStatus: 200,
|
|
27445
27567
|
declaredStatuses: [400, 401],
|
|
27446
27568
|
empty: false
|
|
27447
27569
|
}, requestOptions),
|
|
27448
|
-
status: (
|
|
27570
|
+
status: (input2, requestOptions) => request({
|
|
27449
27571
|
method: "GET",
|
|
27450
|
-
path: `/api/integration/${encodeURIComponent(
|
|
27451
|
-
query: { location:
|
|
27572
|
+
path: `/api/integration/${encodeURIComponent(input2.integrationID)}/connect/oauth/${encodeURIComponent(input2.attemptID)}`,
|
|
27573
|
+
query: { location: input2["location"] },
|
|
27452
27574
|
successStatus: 200,
|
|
27453
27575
|
declaredStatuses: [400, 401, 404],
|
|
27454
27576
|
empty: false
|
|
27455
27577
|
}, requestOptions),
|
|
27456
|
-
complete: (
|
|
27578
|
+
complete: (input2, requestOptions) => request({
|
|
27457
27579
|
method: "POST",
|
|
27458
|
-
path: `/api/integration/${encodeURIComponent(
|
|
27459
|
-
query: { location:
|
|
27460
|
-
body: { code:
|
|
27580
|
+
path: `/api/integration/${encodeURIComponent(input2.integrationID)}/connect/oauth/${encodeURIComponent(input2.attemptID)}/complete`,
|
|
27581
|
+
query: { location: input2["location"] },
|
|
27582
|
+
body: { code: input2["code"] },
|
|
27461
27583
|
successStatus: 204,
|
|
27462
27584
|
declaredStatuses: [400, 401, 404],
|
|
27463
27585
|
empty: true
|
|
27464
27586
|
}, requestOptions),
|
|
27465
|
-
cancel: (
|
|
27587
|
+
cancel: (input2, requestOptions) => request({
|
|
27466
27588
|
method: "DELETE",
|
|
27467
|
-
path: `/api/integration/${encodeURIComponent(
|
|
27468
|
-
query: { location:
|
|
27589
|
+
path: `/api/integration/${encodeURIComponent(input2.integrationID)}/connect/oauth/${encodeURIComponent(input2.attemptID)}`,
|
|
27590
|
+
query: { location: input2["location"] },
|
|
27469
27591
|
successStatus: 204,
|
|
27470
27592
|
declaredStatuses: [400, 401],
|
|
27471
27593
|
empty: true
|
|
27472
27594
|
}, requestOptions)
|
|
27473
27595
|
},
|
|
27474
27596
|
command: {
|
|
27475
|
-
connect: (
|
|
27597
|
+
connect: (input2, requestOptions) => request({
|
|
27476
27598
|
method: "POST",
|
|
27477
|
-
path: `/api/integration/${encodeURIComponent(
|
|
27478
|
-
query: { location:
|
|
27479
|
-
body: { methodID:
|
|
27599
|
+
path: `/api/integration/${encodeURIComponent(input2.integrationID)}/connect/command`,
|
|
27600
|
+
query: { location: input2["location"] },
|
|
27601
|
+
body: { methodID: input2["methodID"], label: input2["label"] },
|
|
27480
27602
|
successStatus: 200,
|
|
27481
27603
|
declaredStatuses: [400, 401, 404],
|
|
27482
27604
|
empty: false
|
|
27483
27605
|
}, requestOptions),
|
|
27484
|
-
status: (
|
|
27606
|
+
status: (input2, requestOptions) => request({
|
|
27485
27607
|
method: "GET",
|
|
27486
|
-
path: `/api/integration/${encodeURIComponent(
|
|
27487
|
-
query: { location:
|
|
27608
|
+
path: `/api/integration/${encodeURIComponent(input2.integrationID)}/connect/command/${encodeURIComponent(input2.attemptID)}`,
|
|
27609
|
+
query: { location: input2["location"] },
|
|
27488
27610
|
successStatus: 200,
|
|
27489
27611
|
declaredStatuses: [400, 401, 404],
|
|
27490
27612
|
empty: false
|
|
27491
27613
|
}, requestOptions),
|
|
27492
|
-
cancel: (
|
|
27614
|
+
cancel: (input2, requestOptions) => request({
|
|
27493
27615
|
method: "DELETE",
|
|
27494
|
-
path: `/api/integration/${encodeURIComponent(
|
|
27495
|
-
query: { location:
|
|
27616
|
+
path: `/api/integration/${encodeURIComponent(input2.integrationID)}/connect/command/${encodeURIComponent(input2.attemptID)}`,
|
|
27617
|
+
query: { location: input2["location"] },
|
|
27496
27618
|
successStatus: 204,
|
|
27497
27619
|
declaredStatuses: [400, 401],
|
|
27498
27620
|
empty: true
|
|
@@ -27500,52 +27622,52 @@ function make6(options) {
|
|
|
27500
27622
|
}
|
|
27501
27623
|
},
|
|
27502
27624
|
mcp: {
|
|
27503
|
-
list: (
|
|
27625
|
+
list: (input2, requestOptions) => request({
|
|
27504
27626
|
method: "GET",
|
|
27505
27627
|
path: `/api/mcp`,
|
|
27506
|
-
query: { location:
|
|
27628
|
+
query: { location: input2?.["location"] },
|
|
27507
27629
|
successStatus: 200,
|
|
27508
27630
|
declaredStatuses: [400, 401],
|
|
27509
27631
|
empty: false
|
|
27510
27632
|
}, requestOptions),
|
|
27511
|
-
add: (
|
|
27633
|
+
add: (input2, requestOptions) => request({
|
|
27512
27634
|
method: "PUT",
|
|
27513
|
-
path: `/api/experimental/mcp/${encodeURIComponent(
|
|
27514
|
-
query: { location:
|
|
27515
|
-
body: { config:
|
|
27635
|
+
path: `/api/experimental/mcp/${encodeURIComponent(input2.server)}`,
|
|
27636
|
+
query: { location: input2["location"] },
|
|
27637
|
+
body: { config: input2["config"] },
|
|
27516
27638
|
successStatus: 204,
|
|
27517
27639
|
declaredStatuses: [400, 401],
|
|
27518
27640
|
empty: true
|
|
27519
27641
|
}, requestOptions),
|
|
27520
|
-
remove: (
|
|
27642
|
+
remove: (input2, requestOptions) => request({
|
|
27521
27643
|
method: "DELETE",
|
|
27522
|
-
path: `/api/experimental/mcp/${encodeURIComponent(
|
|
27523
|
-
query: { location:
|
|
27644
|
+
path: `/api/experimental/mcp/${encodeURIComponent(input2.server)}`,
|
|
27645
|
+
query: { location: input2["location"] },
|
|
27524
27646
|
successStatus: 204,
|
|
27525
27647
|
declaredStatuses: [400, 401, 404],
|
|
27526
27648
|
empty: true
|
|
27527
27649
|
}, requestOptions),
|
|
27528
|
-
connect: (
|
|
27650
|
+
connect: (input2, requestOptions) => request({
|
|
27529
27651
|
method: "POST",
|
|
27530
|
-
path: `/api/experimental/mcp/${encodeURIComponent(
|
|
27531
|
-
query: { location:
|
|
27652
|
+
path: `/api/experimental/mcp/${encodeURIComponent(input2.server)}/connect`,
|
|
27653
|
+
query: { location: input2["location"] },
|
|
27532
27654
|
successStatus: 204,
|
|
27533
27655
|
declaredStatuses: [400, 401, 404],
|
|
27534
27656
|
empty: true
|
|
27535
27657
|
}, requestOptions),
|
|
27536
|
-
disconnect: (
|
|
27658
|
+
disconnect: (input2, requestOptions) => request({
|
|
27537
27659
|
method: "POST",
|
|
27538
|
-
path: `/api/experimental/mcp/${encodeURIComponent(
|
|
27539
|
-
query: { location:
|
|
27660
|
+
path: `/api/experimental/mcp/${encodeURIComponent(input2.server)}/disconnect`,
|
|
27661
|
+
query: { location: input2["location"] },
|
|
27540
27662
|
successStatus: 204,
|
|
27541
27663
|
declaredStatuses: [400, 401, 404],
|
|
27542
27664
|
empty: true
|
|
27543
27665
|
}, requestOptions),
|
|
27544
27666
|
resource: {
|
|
27545
|
-
catalog: (
|
|
27667
|
+
catalog: (input2, requestOptions) => request({
|
|
27546
27668
|
method: "GET",
|
|
27547
27669
|
path: `/api/mcp/resource`,
|
|
27548
|
-
query: { location:
|
|
27670
|
+
query: { location: input2?.["location"] },
|
|
27549
27671
|
successStatus: 200,
|
|
27550
27672
|
declaredStatuses: [400, 401],
|
|
27551
27673
|
empty: false
|
|
@@ -27553,24 +27675,24 @@ function make6(options) {
|
|
|
27553
27675
|
}
|
|
27554
27676
|
},
|
|
27555
27677
|
credential: {
|
|
27556
|
-
update: (
|
|
27678
|
+
update: (input2, requestOptions) => request({
|
|
27557
27679
|
method: "PATCH",
|
|
27558
|
-
path: `/api/credential/${encodeURIComponent(
|
|
27559
|
-
body: { label:
|
|
27680
|
+
path: `/api/credential/${encodeURIComponent(input2.credentialID)}`,
|
|
27681
|
+
body: { label: input2["label"] },
|
|
27560
27682
|
successStatus: 204,
|
|
27561
27683
|
declaredStatuses: [400, 401],
|
|
27562
27684
|
empty: true
|
|
27563
27685
|
}, requestOptions),
|
|
27564
|
-
activate: (
|
|
27686
|
+
activate: (input2, requestOptions) => request({
|
|
27565
27687
|
method: "POST",
|
|
27566
|
-
path: `/api/credential/${encodeURIComponent(
|
|
27688
|
+
path: `/api/credential/${encodeURIComponent(input2.credentialID)}/activate`,
|
|
27567
27689
|
successStatus: 204,
|
|
27568
27690
|
declaredStatuses: [400, 401],
|
|
27569
27691
|
empty: true
|
|
27570
27692
|
}, requestOptions),
|
|
27571
|
-
remove: (
|
|
27693
|
+
remove: (input2, requestOptions) => request({
|
|
27572
27694
|
method: "DELETE",
|
|
27573
|
-
path: `/api/credential/${encodeURIComponent(
|
|
27695
|
+
path: `/api/credential/${encodeURIComponent(input2.credentialID)}`,
|
|
27574
27696
|
successStatus: 204,
|
|
27575
27697
|
declaredStatuses: [400, 401],
|
|
27576
27698
|
empty: true
|
|
@@ -27578,14 +27700,14 @@ function make6(options) {
|
|
|
27578
27700
|
},
|
|
27579
27701
|
project: {
|
|
27580
27702
|
list: (requestOptions) => request({ method: "GET", path: `/api/project`, successStatus: 200, declaredStatuses: [400, 401], empty: false }, requestOptions),
|
|
27581
|
-
update: (
|
|
27703
|
+
update: (input2, requestOptions) => request({
|
|
27582
27704
|
method: "PATCH",
|
|
27583
|
-
path: `/api/project/${encodeURIComponent(
|
|
27705
|
+
path: `/api/project/${encodeURIComponent(input2.projectID)}`,
|
|
27584
27706
|
body: {
|
|
27585
|
-
canonical:
|
|
27586
|
-
name:
|
|
27587
|
-
icon:
|
|
27588
|
-
commands:
|
|
27707
|
+
canonical: input2["canonical"],
|
|
27708
|
+
name: input2["name"],
|
|
27709
|
+
icon: input2["icon"],
|
|
27710
|
+
commands: input2["commands"]
|
|
27589
27711
|
},
|
|
27590
27712
|
successStatus: 200,
|
|
27591
27713
|
declaredStatuses: [400, 401, 404],
|
|
@@ -27593,10 +27715,10 @@ function make6(options) {
|
|
|
27593
27715
|
}, requestOptions)
|
|
27594
27716
|
},
|
|
27595
27717
|
form: {
|
|
27596
|
-
list: (
|
|
27718
|
+
list: (input2, requestOptions) => request({
|
|
27597
27719
|
method: "GET",
|
|
27598
27720
|
path: `/api/form`,
|
|
27599
|
-
query: { location:
|
|
27721
|
+
query: { location: input2?.["location"] },
|
|
27600
27722
|
successStatus: 200,
|
|
27601
27723
|
declaredStatuses: [400, 401],
|
|
27602
27724
|
empty: false
|
|
@@ -27604,102 +27726,102 @@ function make6(options) {
|
|
|
27604
27726
|
},
|
|
27605
27727
|
permission: {
|
|
27606
27728
|
request: {
|
|
27607
|
-
list: (
|
|
27729
|
+
list: (input2, requestOptions) => request({
|
|
27608
27730
|
method: "GET",
|
|
27609
27731
|
path: `/api/permission/request`,
|
|
27610
|
-
query: { location:
|
|
27732
|
+
query: { location: input2?.["location"] },
|
|
27611
27733
|
successStatus: 200,
|
|
27612
27734
|
declaredStatuses: [400, 401],
|
|
27613
27735
|
empty: false
|
|
27614
27736
|
}, requestOptions)
|
|
27615
27737
|
},
|
|
27616
27738
|
saved: {
|
|
27617
|
-
list: (
|
|
27739
|
+
list: (input2, requestOptions) => request({
|
|
27618
27740
|
method: "GET",
|
|
27619
27741
|
path: `/api/permission/saved`,
|
|
27620
|
-
query: { projectID:
|
|
27742
|
+
query: { projectID: input2?.["projectID"] },
|
|
27621
27743
|
successStatus: 200,
|
|
27622
27744
|
declaredStatuses: [400, 401],
|
|
27623
27745
|
empty: false
|
|
27624
27746
|
}, requestOptions).then((value) => value.data),
|
|
27625
|
-
remove: (
|
|
27747
|
+
remove: (input2, requestOptions) => request({
|
|
27626
27748
|
method: "DELETE",
|
|
27627
|
-
path: `/api/permission/saved/${encodeURIComponent(
|
|
27749
|
+
path: `/api/permission/saved/${encodeURIComponent(input2.id)}`,
|
|
27628
27750
|
successStatus: 204,
|
|
27629
27751
|
declaredStatuses: [400, 401],
|
|
27630
27752
|
empty: true
|
|
27631
27753
|
}, requestOptions)
|
|
27632
27754
|
},
|
|
27633
|
-
create: (
|
|
27755
|
+
create: (input2, requestOptions) => request({
|
|
27634
27756
|
method: "POST",
|
|
27635
|
-
path: `/api/session/${encodeURIComponent(
|
|
27757
|
+
path: `/api/session/${encodeURIComponent(input2.sessionID)}/permission`,
|
|
27636
27758
|
body: {
|
|
27637
|
-
id:
|
|
27638
|
-
action:
|
|
27639
|
-
resources:
|
|
27640
|
-
save:
|
|
27641
|
-
metadata:
|
|
27642
|
-
source:
|
|
27643
|
-
agent:
|
|
27759
|
+
id: input2["id"],
|
|
27760
|
+
action: input2["action"],
|
|
27761
|
+
resources: input2["resources"],
|
|
27762
|
+
save: input2["save"],
|
|
27763
|
+
metadata: input2["metadata"],
|
|
27764
|
+
source: input2["source"],
|
|
27765
|
+
agent: input2["agent"]
|
|
27644
27766
|
},
|
|
27645
27767
|
successStatus: 200,
|
|
27646
27768
|
declaredStatuses: [400, 401, 404],
|
|
27647
27769
|
empty: false
|
|
27648
27770
|
}, requestOptions).then((value) => value.data),
|
|
27649
|
-
list: (
|
|
27771
|
+
list: (input2, requestOptions) => request({
|
|
27650
27772
|
method: "GET",
|
|
27651
|
-
path: `/api/session/${encodeURIComponent(
|
|
27773
|
+
path: `/api/session/${encodeURIComponent(input2.sessionID)}/permission`,
|
|
27652
27774
|
successStatus: 200,
|
|
27653
27775
|
declaredStatuses: [400, 401, 404],
|
|
27654
27776
|
empty: false
|
|
27655
27777
|
}, requestOptions).then((value) => value.data),
|
|
27656
|
-
get: (
|
|
27778
|
+
get: (input2, requestOptions) => request({
|
|
27657
27779
|
method: "GET",
|
|
27658
|
-
path: `/api/session/${encodeURIComponent(
|
|
27780
|
+
path: `/api/session/${encodeURIComponent(input2.sessionID)}/permission/${encodeURIComponent(input2.requestID)}`,
|
|
27659
27781
|
successStatus: 200,
|
|
27660
27782
|
declaredStatuses: [400, 401, 404],
|
|
27661
27783
|
empty: false
|
|
27662
27784
|
}, requestOptions).then((value) => value.data),
|
|
27663
|
-
reply: (
|
|
27785
|
+
reply: (input2, requestOptions) => request({
|
|
27664
27786
|
method: "POST",
|
|
27665
|
-
path: `/api/session/${encodeURIComponent(
|
|
27666
|
-
body: { decision:
|
|
27787
|
+
path: `/api/session/${encodeURIComponent(input2.sessionID)}/permission/${encodeURIComponent(input2.requestID)}/reply`,
|
|
27788
|
+
body: { decision: input2["decision"], message: input2["message"] },
|
|
27667
27789
|
successStatus: 204,
|
|
27668
27790
|
declaredStatuses: [400, 401, 404],
|
|
27669
27791
|
empty: true
|
|
27670
27792
|
}, requestOptions)
|
|
27671
27793
|
},
|
|
27672
27794
|
file: {
|
|
27673
|
-
read: (
|
|
27795
|
+
read: (input2, requestOptions) => request({
|
|
27674
27796
|
method: "GET",
|
|
27675
|
-
path: `/api/fs/read/${encodePath(
|
|
27676
|
-
query: { location:
|
|
27797
|
+
path: `/api/fs/read/${encodePath(input2.path)}`,
|
|
27798
|
+
query: { location: input2["location"] },
|
|
27677
27799
|
successStatus: 200,
|
|
27678
27800
|
declaredStatuses: [400, 401, 404],
|
|
27679
27801
|
empty: false,
|
|
27680
27802
|
binary: true
|
|
27681
27803
|
}, requestOptions),
|
|
27682
|
-
list: (
|
|
27804
|
+
list: (input2, requestOptions) => request({
|
|
27683
27805
|
method: "GET",
|
|
27684
27806
|
path: `/api/fs/list`,
|
|
27685
|
-
query: { location:
|
|
27807
|
+
query: { location: input2?.["location"], path: input2?.["path"] },
|
|
27686
27808
|
successStatus: 200,
|
|
27687
27809
|
declaredStatuses: [400, 401],
|
|
27688
27810
|
empty: false
|
|
27689
27811
|
}, requestOptions),
|
|
27690
|
-
find: (
|
|
27812
|
+
find: (input2, requestOptions) => request({
|
|
27691
27813
|
method: "GET",
|
|
27692
27814
|
path: `/api/fs/find`,
|
|
27693
|
-
query: { location:
|
|
27815
|
+
query: { location: input2["location"], query: input2["query"], type: input2["type"], limit: input2["limit"] },
|
|
27694
27816
|
successStatus: 200,
|
|
27695
27817
|
declaredStatuses: [400, 401],
|
|
27696
27818
|
empty: false
|
|
27697
27819
|
}, requestOptions),
|
|
27698
|
-
write: (
|
|
27820
|
+
write: (input2, requestOptions) => request({
|
|
27699
27821
|
method: "POST",
|
|
27700
27822
|
path: `/api/experimental/fs/write`,
|
|
27701
|
-
query: { location:
|
|
27702
|
-
body:
|
|
27823
|
+
query: { location: input2["location"], path: input2["path"] },
|
|
27824
|
+
body: input2["payload"],
|
|
27703
27825
|
successStatus: 200,
|
|
27704
27826
|
declaredStatuses: [400, 401],
|
|
27705
27827
|
empty: false,
|
|
@@ -27707,31 +27829,31 @@ function make6(options) {
|
|
|
27707
27829
|
}, requestOptions)
|
|
27708
27830
|
},
|
|
27709
27831
|
command: {
|
|
27710
|
-
list: (
|
|
27832
|
+
list: (input2, requestOptions) => request({
|
|
27711
27833
|
method: "GET",
|
|
27712
27834
|
path: `/api/command`,
|
|
27713
|
-
query: { location:
|
|
27835
|
+
query: { location: input2?.["location"] },
|
|
27714
27836
|
successStatus: 200,
|
|
27715
27837
|
declaredStatuses: [400, 401],
|
|
27716
27838
|
empty: false
|
|
27717
27839
|
}, requestOptions)
|
|
27718
27840
|
},
|
|
27719
27841
|
skill: {
|
|
27720
|
-
list: (
|
|
27842
|
+
list: (input2, requestOptions) => request({
|
|
27721
27843
|
method: "GET",
|
|
27722
27844
|
path: `/api/skill`,
|
|
27723
|
-
query: { location:
|
|
27845
|
+
query: { location: input2?.["location"] },
|
|
27724
27846
|
successStatus: 200,
|
|
27725
27847
|
declaredStatuses: [400, 401],
|
|
27726
27848
|
empty: false
|
|
27727
27849
|
}, requestOptions)
|
|
27728
27850
|
},
|
|
27729
27851
|
rpc: {
|
|
27730
|
-
call: (
|
|
27852
|
+
call: (input2, requestOptions) => request({
|
|
27731
27853
|
method: "POST",
|
|
27732
|
-
path: `/api/rpc/${encodeURIComponent(
|
|
27733
|
-
query: { location:
|
|
27734
|
-
body: { input:
|
|
27854
|
+
path: `/api/rpc/${encodeURIComponent(input2.rpcID)}/${encodeURIComponent(input2.method)}`,
|
|
27855
|
+
query: { location: input2["location"] },
|
|
27856
|
+
body: { input: input2["input"] },
|
|
27735
27857
|
successStatus: 200,
|
|
27736
27858
|
declaredStatuses: [400, 401, 500],
|
|
27737
27859
|
empty: false
|
|
@@ -27741,60 +27863,60 @@ function make6(options) {
|
|
|
27741
27863
|
subscribe: (requestOptions) => sse({ method: "GET", path: `/api/event`, successStatus: 200, declaredStatuses: [400, 401], empty: false }, requestOptions)
|
|
27742
27864
|
},
|
|
27743
27865
|
pty: {
|
|
27744
|
-
list: (
|
|
27866
|
+
list: (input2, requestOptions) => request({
|
|
27745
27867
|
method: "GET",
|
|
27746
27868
|
path: `/api/pty`,
|
|
27747
|
-
query: { location:
|
|
27869
|
+
query: { location: input2?.["location"] },
|
|
27748
27870
|
successStatus: 200,
|
|
27749
27871
|
declaredStatuses: [400, 401],
|
|
27750
27872
|
empty: false
|
|
27751
27873
|
}, requestOptions),
|
|
27752
|
-
create: (
|
|
27874
|
+
create: (input2, requestOptions) => request({
|
|
27753
27875
|
method: "POST",
|
|
27754
27876
|
path: `/api/pty`,
|
|
27755
|
-
query: { location:
|
|
27877
|
+
query: { location: input2?.["location"] },
|
|
27756
27878
|
body: {
|
|
27757
|
-
command:
|
|
27758
|
-
args:
|
|
27759
|
-
cwd:
|
|
27760
|
-
title:
|
|
27761
|
-
env:
|
|
27879
|
+
command: input2?.["command"],
|
|
27880
|
+
args: input2?.["args"],
|
|
27881
|
+
cwd: input2?.["cwd"],
|
|
27882
|
+
title: input2?.["title"],
|
|
27883
|
+
env: input2?.["env"]
|
|
27762
27884
|
},
|
|
27763
27885
|
successStatus: 200,
|
|
27764
27886
|
declaredStatuses: [400, 401],
|
|
27765
27887
|
empty: false
|
|
27766
27888
|
}, requestOptions),
|
|
27767
|
-
get: (
|
|
27889
|
+
get: (input2, requestOptions) => request({
|
|
27768
27890
|
method: "GET",
|
|
27769
|
-
path: `/api/pty/${encodeURIComponent(
|
|
27770
|
-
query: { location:
|
|
27891
|
+
path: `/api/pty/${encodeURIComponent(input2.ptyID)}`,
|
|
27892
|
+
query: { location: input2["location"] },
|
|
27771
27893
|
successStatus: 200,
|
|
27772
27894
|
declaredStatuses: [400, 401, 404],
|
|
27773
27895
|
empty: false
|
|
27774
27896
|
}, requestOptions),
|
|
27775
|
-
update: (
|
|
27897
|
+
update: (input2, requestOptions) => request({
|
|
27776
27898
|
method: "PUT",
|
|
27777
|
-
path: `/api/pty/${encodeURIComponent(
|
|
27778
|
-
query: { location:
|
|
27779
|
-
body: { title:
|
|
27899
|
+
path: `/api/pty/${encodeURIComponent(input2.ptyID)}`,
|
|
27900
|
+
query: { location: input2["location"] },
|
|
27901
|
+
body: { title: input2["title"], size: input2["size"] },
|
|
27780
27902
|
successStatus: 200,
|
|
27781
27903
|
declaredStatuses: [400, 401, 404],
|
|
27782
27904
|
empty: false
|
|
27783
27905
|
}, requestOptions),
|
|
27784
|
-
remove: (
|
|
27906
|
+
remove: (input2, requestOptions) => request({
|
|
27785
27907
|
method: "DELETE",
|
|
27786
|
-
path: `/api/pty/${encodeURIComponent(
|
|
27787
|
-
query: { location:
|
|
27908
|
+
path: `/api/pty/${encodeURIComponent(input2.ptyID)}`,
|
|
27909
|
+
query: { location: input2["location"] },
|
|
27788
27910
|
successStatus: 204,
|
|
27789
27911
|
declaredStatuses: [400, 401, 404],
|
|
27790
27912
|
empty: true
|
|
27791
27913
|
}, requestOptions),
|
|
27792
27914
|
connect: {
|
|
27793
|
-
token: (
|
|
27915
|
+
token: (input2, requestOptions) => request({
|
|
27794
27916
|
method: "POST",
|
|
27795
|
-
path: `/api/pty/${encodeURIComponent(
|
|
27796
|
-
query: { location:
|
|
27797
|
-
headers: { "x-opencode-ticket":
|
|
27917
|
+
path: `/api/pty/${encodeURIComponent(input2.ptyID)}/connect-token`,
|
|
27918
|
+
query: { location: input2["location"] },
|
|
27919
|
+
headers: { "x-opencode-ticket": input2["x-opencode-ticket"] },
|
|
27798
27920
|
successStatus: 200,
|
|
27799
27921
|
declaredStatuses: [400, 401, 403, 404],
|
|
27800
27922
|
empty: false
|
|
@@ -27803,31 +27925,31 @@ function make6(options) {
|
|
|
27803
27925
|
},
|
|
27804
27926
|
experimental: {
|
|
27805
27927
|
persistentPty: {
|
|
27806
|
-
read: (
|
|
27928
|
+
read: (input2, requestOptions) => request({
|
|
27807
27929
|
method: "GET",
|
|
27808
|
-
path: `/api/experimental/session/${encodeURIComponent(
|
|
27809
|
-
query: { lines:
|
|
27930
|
+
path: `/api/experimental/session/${encodeURIComponent(input2.sessionID)}/terminal/read`,
|
|
27931
|
+
query: { lines: input2["lines"] },
|
|
27810
27932
|
successStatus: 200,
|
|
27811
27933
|
declaredStatuses: [400, 401, 503],
|
|
27812
27934
|
empty: false
|
|
27813
27935
|
}, requestOptions).then((value) => value.data),
|
|
27814
|
-
list: (
|
|
27936
|
+
list: (input2, requestOptions) => request({
|
|
27815
27937
|
method: "GET",
|
|
27816
|
-
path: `/api/experimental/session/${encodeURIComponent(
|
|
27938
|
+
path: `/api/experimental/session/${encodeURIComponent(input2.sessionID)}/terminal`,
|
|
27817
27939
|
successStatus: 200,
|
|
27818
27940
|
declaredStatuses: [400, 401, 503],
|
|
27819
27941
|
empty: false
|
|
27820
27942
|
}, requestOptions).then((value) => value.data),
|
|
27821
|
-
create: (
|
|
27943
|
+
create: (input2, requestOptions) => request({
|
|
27822
27944
|
method: "POST",
|
|
27823
|
-
path: `/api/experimental/session/${encodeURIComponent(
|
|
27945
|
+
path: `/api/experimental/session/${encodeURIComponent(input2.sessionID)}/terminal`,
|
|
27824
27946
|
body: {
|
|
27825
|
-
command:
|
|
27826
|
-
args:
|
|
27827
|
-
cwd:
|
|
27828
|
-
title:
|
|
27829
|
-
env:
|
|
27830
|
-
size:
|
|
27947
|
+
command: input2["command"],
|
|
27948
|
+
args: input2["args"],
|
|
27949
|
+
cwd: input2["cwd"],
|
|
27950
|
+
title: input2["title"],
|
|
27951
|
+
env: input2["env"],
|
|
27952
|
+
size: input2["size"]
|
|
27831
27953
|
},
|
|
27832
27954
|
successStatus: 200,
|
|
27833
27955
|
declaredStatuses: [400, 401, 503],
|
|
@@ -27847,39 +27969,39 @@ function make6(options) {
|
|
|
27847
27969
|
declaredStatuses: [400, 401, 503],
|
|
27848
27970
|
empty: false
|
|
27849
27971
|
}, requestOptions),
|
|
27850
|
-
get: (
|
|
27972
|
+
get: (input2, requestOptions) => request({
|
|
27851
27973
|
method: "GET",
|
|
27852
|
-
path: `/api/experimental/persistent-pty/${encodeURIComponent(
|
|
27974
|
+
path: `/api/experimental/persistent-pty/${encodeURIComponent(input2.ptyID)}`,
|
|
27853
27975
|
successStatus: 200,
|
|
27854
27976
|
declaredStatuses: [400, 401, 404, 503],
|
|
27855
27977
|
empty: false
|
|
27856
27978
|
}, requestOptions).then((value) => value.data),
|
|
27857
|
-
update: (
|
|
27979
|
+
update: (input2, requestOptions) => request({
|
|
27858
27980
|
method: "PUT",
|
|
27859
|
-
path: `/api/experimental/persistent-pty/${encodeURIComponent(
|
|
27860
|
-
body: { attachmentID:
|
|
27981
|
+
path: `/api/experimental/persistent-pty/${encodeURIComponent(input2.ptyID)}`,
|
|
27982
|
+
body: { attachmentID: input2["attachmentID"], size: input2["size"] },
|
|
27861
27983
|
successStatus: 200,
|
|
27862
27984
|
declaredStatuses: [400, 401, 404, 503],
|
|
27863
27985
|
empty: false
|
|
27864
27986
|
}, requestOptions).then((value) => value.data),
|
|
27865
|
-
snapshot: (
|
|
27987
|
+
snapshot: (input2, requestOptions) => request({
|
|
27866
27988
|
method: "GET",
|
|
27867
|
-
path: `/api/experimental/persistent-pty/${encodeURIComponent(
|
|
27989
|
+
path: `/api/experimental/persistent-pty/${encodeURIComponent(input2.ptyID)}/snapshot`,
|
|
27868
27990
|
successStatus: 200,
|
|
27869
27991
|
declaredStatuses: [400, 401, 404, 503],
|
|
27870
27992
|
empty: false
|
|
27871
27993
|
}, requestOptions).then((value) => value.data),
|
|
27872
|
-
remove: (
|
|
27994
|
+
remove: (input2, requestOptions) => request({
|
|
27873
27995
|
method: "DELETE",
|
|
27874
|
-
path: `/api/experimental/persistent-pty/${encodeURIComponent(
|
|
27996
|
+
path: `/api/experimental/persistent-pty/${encodeURIComponent(input2.ptyID)}`,
|
|
27875
27997
|
successStatus: 204,
|
|
27876
27998
|
declaredStatuses: [400, 401, 404, 503],
|
|
27877
27999
|
empty: true
|
|
27878
28000
|
}, requestOptions),
|
|
27879
|
-
connectToken: (
|
|
28001
|
+
connectToken: (input2, requestOptions) => request({
|
|
27880
28002
|
method: "POST",
|
|
27881
|
-
path: `/api/experimental/persistent-pty/${encodeURIComponent(
|
|
27882
|
-
headers: { "x-opencode-ticket":
|
|
28003
|
+
path: `/api/experimental/persistent-pty/${encodeURIComponent(input2.ptyID)}/connect-token`,
|
|
28004
|
+
headers: { "x-opencode-ticket": input2["x-opencode-ticket"] },
|
|
27883
28005
|
successStatus: 200,
|
|
27884
28006
|
declaredStatuses: [400, 401, 403, 404, 503],
|
|
27885
28007
|
empty: false
|
|
@@ -27887,142 +28009,142 @@ function make6(options) {
|
|
|
27887
28009
|
}
|
|
27888
28010
|
},
|
|
27889
28011
|
shell: {
|
|
27890
|
-
list: (
|
|
28012
|
+
list: (input2, requestOptions) => request({
|
|
27891
28013
|
method: "GET",
|
|
27892
28014
|
path: `/api/shell`,
|
|
27893
|
-
query: { location:
|
|
28015
|
+
query: { location: input2?.["location"] },
|
|
27894
28016
|
successStatus: 200,
|
|
27895
28017
|
declaredStatuses: [400, 401],
|
|
27896
28018
|
empty: false
|
|
27897
28019
|
}, requestOptions),
|
|
27898
|
-
create: (
|
|
28020
|
+
create: (input2, requestOptions) => request({
|
|
27899
28021
|
method: "POST",
|
|
27900
28022
|
path: `/api/shell`,
|
|
27901
|
-
query: { location:
|
|
28023
|
+
query: { location: input2["location"] },
|
|
27902
28024
|
body: {
|
|
27903
|
-
command:
|
|
27904
|
-
cwd:
|
|
27905
|
-
timeout:
|
|
27906
|
-
metadata:
|
|
28025
|
+
command: input2["command"],
|
|
28026
|
+
cwd: input2["cwd"],
|
|
28027
|
+
timeout: input2["timeout"],
|
|
28028
|
+
metadata: input2["metadata"]
|
|
27907
28029
|
},
|
|
27908
28030
|
successStatus: 200,
|
|
27909
28031
|
declaredStatuses: [400, 401],
|
|
27910
28032
|
empty: false
|
|
27911
28033
|
}, requestOptions),
|
|
27912
|
-
get: (
|
|
28034
|
+
get: (input2, requestOptions) => request({
|
|
27913
28035
|
method: "GET",
|
|
27914
|
-
path: `/api/shell/${encodeURIComponent(
|
|
27915
|
-
query: { location:
|
|
28036
|
+
path: `/api/shell/${encodeURIComponent(input2.id)}`,
|
|
28037
|
+
query: { location: input2["location"] },
|
|
27916
28038
|
successStatus: 200,
|
|
27917
28039
|
declaredStatuses: [400, 401, 404],
|
|
27918
28040
|
empty: false
|
|
27919
28041
|
}, requestOptions),
|
|
27920
|
-
output: (
|
|
28042
|
+
output: (input2, requestOptions) => request({
|
|
27921
28043
|
method: "GET",
|
|
27922
|
-
path: `/api/shell/${encodeURIComponent(
|
|
27923
|
-
query: { location:
|
|
28044
|
+
path: `/api/shell/${encodeURIComponent(input2.id)}/output`,
|
|
28045
|
+
query: { location: input2["location"], cursor: input2["cursor"], limit: input2["limit"] },
|
|
27924
28046
|
successStatus: 200,
|
|
27925
28047
|
declaredStatuses: [400, 401, 404],
|
|
27926
28048
|
empty: false
|
|
27927
28049
|
}, requestOptions),
|
|
27928
|
-
remove: (
|
|
28050
|
+
remove: (input2, requestOptions) => request({
|
|
27929
28051
|
method: "DELETE",
|
|
27930
|
-
path: `/api/shell/${encodeURIComponent(
|
|
27931
|
-
query: { location:
|
|
28052
|
+
path: `/api/shell/${encodeURIComponent(input2.id)}`,
|
|
28053
|
+
query: { location: input2["location"] },
|
|
27932
28054
|
successStatus: 204,
|
|
27933
28055
|
declaredStatuses: [400, 401],
|
|
27934
28056
|
empty: true
|
|
27935
28057
|
}, requestOptions)
|
|
27936
28058
|
},
|
|
27937
28059
|
reference: {
|
|
27938
|
-
list: (
|
|
28060
|
+
list: (input2, requestOptions) => request({
|
|
27939
28061
|
method: "GET",
|
|
27940
28062
|
path: `/api/reference`,
|
|
27941
|
-
query: { location:
|
|
28063
|
+
query: { location: input2?.["location"] },
|
|
27942
28064
|
successStatus: 200,
|
|
27943
28065
|
declaredStatuses: [400, 401],
|
|
27944
28066
|
empty: false
|
|
27945
28067
|
}, requestOptions)
|
|
27946
28068
|
},
|
|
27947
28069
|
worktree: {
|
|
27948
|
-
list: (
|
|
28070
|
+
list: (input2, requestOptions) => request({
|
|
27949
28071
|
method: "GET",
|
|
27950
28072
|
path: `/api/worktree`,
|
|
27951
|
-
query: { projectID:
|
|
28073
|
+
query: { projectID: input2["projectID"] },
|
|
27952
28074
|
successStatus: 200,
|
|
27953
28075
|
declaredStatuses: [400, 401, 404],
|
|
27954
28076
|
empty: false
|
|
27955
28077
|
}, requestOptions),
|
|
27956
|
-
create: (
|
|
28078
|
+
create: (input2, requestOptions) => request({
|
|
27957
28079
|
method: "POST",
|
|
27958
28080
|
path: `/api/worktree`,
|
|
27959
28081
|
body: {
|
|
27960
|
-
projectID:
|
|
27961
|
-
from:
|
|
27962
|
-
branch:
|
|
27963
|
-
directory:
|
|
27964
|
-
name:
|
|
28082
|
+
projectID: input2["projectID"],
|
|
28083
|
+
from: input2["from"],
|
|
28084
|
+
branch: input2["branch"],
|
|
28085
|
+
directory: input2["directory"],
|
|
28086
|
+
name: input2["name"]
|
|
27965
28087
|
},
|
|
27966
28088
|
successStatus: 200,
|
|
27967
28089
|
declaredStatuses: [400, 401, 404],
|
|
27968
28090
|
empty: false
|
|
27969
28091
|
}, requestOptions),
|
|
27970
|
-
remove: (
|
|
28092
|
+
remove: (input2, requestOptions) => request({
|
|
27971
28093
|
method: "DELETE",
|
|
27972
28094
|
path: `/api/worktree`,
|
|
27973
|
-
body: { projectID:
|
|
28095
|
+
body: { projectID: input2["projectID"], directory: input2["directory"], force: input2["force"] },
|
|
27974
28096
|
successStatus: 204,
|
|
27975
28097
|
declaredStatuses: [400, 401, 404],
|
|
27976
28098
|
empty: true
|
|
27977
28099
|
}, requestOptions),
|
|
27978
|
-
refresh: (
|
|
28100
|
+
refresh: (input2, requestOptions) => request({
|
|
27979
28101
|
method: "POST",
|
|
27980
28102
|
path: `/api/worktree/refresh`,
|
|
27981
|
-
body: { projectID:
|
|
28103
|
+
body: { projectID: input2["projectID"] },
|
|
27982
28104
|
successStatus: 204,
|
|
27983
28105
|
declaredStatuses: [400, 401, 404],
|
|
27984
28106
|
empty: true
|
|
27985
28107
|
}, requestOptions)
|
|
27986
28108
|
},
|
|
27987
28109
|
vcs: {
|
|
27988
|
-
get: (
|
|
28110
|
+
get: (input2, requestOptions) => request({
|
|
27989
28111
|
method: "GET",
|
|
27990
28112
|
path: `/api/vcs`,
|
|
27991
|
-
query: { location:
|
|
28113
|
+
query: { location: input2?.["location"] },
|
|
27992
28114
|
successStatus: 200,
|
|
27993
28115
|
declaredStatuses: [400, 401],
|
|
27994
28116
|
empty: false
|
|
27995
28117
|
}, requestOptions),
|
|
27996
|
-
base: (
|
|
28118
|
+
base: (input2, requestOptions) => request({
|
|
27997
28119
|
method: "GET",
|
|
27998
28120
|
path: `/api/vcs/base`,
|
|
27999
|
-
query: { location:
|
|
28121
|
+
query: { location: input2?.["location"] },
|
|
28000
28122
|
successStatus: 200,
|
|
28001
28123
|
declaredStatuses: [400, 401, 503],
|
|
28002
28124
|
empty: false
|
|
28003
28125
|
}, requestOptions),
|
|
28004
|
-
status: (
|
|
28126
|
+
status: (input2, requestOptions) => request({
|
|
28005
28127
|
method: "GET",
|
|
28006
28128
|
path: `/api/vcs/status`,
|
|
28007
|
-
query: { location:
|
|
28129
|
+
query: { location: input2?.["location"] },
|
|
28008
28130
|
successStatus: 200,
|
|
28009
28131
|
declaredStatuses: [400, 401],
|
|
28010
28132
|
empty: false
|
|
28011
28133
|
}, requestOptions),
|
|
28012
28134
|
branch: {
|
|
28013
|
-
list: (
|
|
28135
|
+
list: (input2, requestOptions) => request({
|
|
28014
28136
|
method: "GET",
|
|
28015
28137
|
path: `/api/vcs/branch`,
|
|
28016
|
-
query: { location:
|
|
28138
|
+
query: { location: input2?.["location"], search: input2?.["search"], limit: input2?.["limit"] },
|
|
28017
28139
|
successStatus: 200,
|
|
28018
28140
|
declaredStatuses: [400, 401],
|
|
28019
28141
|
empty: false
|
|
28020
28142
|
}, requestOptions)
|
|
28021
28143
|
},
|
|
28022
|
-
diff: (
|
|
28144
|
+
diff: (input2, requestOptions) => request({
|
|
28023
28145
|
method: "GET",
|
|
28024
28146
|
path: `/api/vcs/diff`,
|
|
28025
|
-
query: { location:
|
|
28147
|
+
query: { location: input2["location"], mode: input2["mode"], base: input2["base"], context: input2["context"] },
|
|
28026
28148
|
successStatus: 200,
|
|
28027
28149
|
declaredStatuses: [400, 401, 503],
|
|
28028
28150
|
empty: false
|
|
@@ -28037,10 +28159,10 @@ function make6(options) {
|
|
|
28037
28159
|
declaredStatuses: [400, 401],
|
|
28038
28160
|
empty: false
|
|
28039
28161
|
}, requestOptions),
|
|
28040
|
-
evict: (
|
|
28162
|
+
evict: (input2, requestOptions) => request({
|
|
28041
28163
|
method: "DELETE",
|
|
28042
28164
|
path: `/api/debug/location`,
|
|
28043
|
-
query: { location:
|
|
28165
|
+
query: { location: input2?.["location"] },
|
|
28044
28166
|
successStatus: 204,
|
|
28045
28167
|
declaredStatuses: [400, 401],
|
|
28046
28168
|
empty: true
|
|
@@ -28059,38 +28181,38 @@ function make6(options) {
|
|
|
28059
28181
|
}
|
|
28060
28182
|
},
|
|
28061
28183
|
websearch: {
|
|
28062
|
-
providers: (
|
|
28184
|
+
providers: (input2, requestOptions) => request({
|
|
28063
28185
|
method: "GET",
|
|
28064
28186
|
path: `/api/websearch/provider`,
|
|
28065
|
-
query: { location:
|
|
28187
|
+
query: { location: input2?.["location"] },
|
|
28066
28188
|
successStatus: 200,
|
|
28067
28189
|
declaredStatuses: [400, 401, 503],
|
|
28068
28190
|
empty: false
|
|
28069
28191
|
}, requestOptions),
|
|
28070
|
-
query: (
|
|
28192
|
+
query: (input2, requestOptions) => request({
|
|
28071
28193
|
method: "POST",
|
|
28072
28194
|
path: `/api/websearch`,
|
|
28073
|
-
query: { location:
|
|
28074
|
-
body: { query:
|
|
28195
|
+
query: { location: input2["location"] },
|
|
28196
|
+
body: { query: input2["query"], providerID: input2["providerID"] },
|
|
28075
28197
|
successStatus: 200,
|
|
28076
28198
|
declaredStatuses: [400, 401, 503],
|
|
28077
28199
|
empty: false
|
|
28078
28200
|
}, requestOptions)
|
|
28079
28201
|
},
|
|
28080
28202
|
config: {
|
|
28081
|
-
get: (
|
|
28203
|
+
get: (input2, requestOptions) => request({
|
|
28082
28204
|
method: "GET",
|
|
28083
28205
|
path: `/api/config`,
|
|
28084
|
-
query: { location:
|
|
28206
|
+
query: { location: input2?.["location"] },
|
|
28085
28207
|
successStatus: 200,
|
|
28086
28208
|
declaredStatuses: [400, 401],
|
|
28087
28209
|
empty: false
|
|
28088
28210
|
}, requestOptions),
|
|
28089
28211
|
shells: (requestOptions) => request({ method: "GET", path: `/api/config/shell`, successStatus: 200, declaredStatuses: [400, 401], empty: false }, requestOptions),
|
|
28090
|
-
update: (
|
|
28212
|
+
update: (input2, requestOptions) => request({
|
|
28091
28213
|
method: "PATCH",
|
|
28092
28214
|
path: `/api/experimental/config`,
|
|
28093
|
-
body: { shell:
|
|
28215
|
+
body: { shell: input2["shell"] },
|
|
28094
28216
|
successStatus: 204,
|
|
28095
28217
|
declaredStatuses: [400, 401],
|
|
28096
28218
|
empty: true
|
|
@@ -28128,16 +28250,16 @@ async function json2(response) {
|
|
|
28128
28250
|
}
|
|
28129
28251
|
throw new ClientError3("UnsupportedContentType", { detail: response.headers.get("content-type") });
|
|
28130
28252
|
}
|
|
28131
|
-
let
|
|
28253
|
+
let text2;
|
|
28132
28254
|
try {
|
|
28133
|
-
|
|
28255
|
+
text2 = await response.text();
|
|
28134
28256
|
} catch (cause) {
|
|
28135
28257
|
throw new ClientError3("Transport", { cause });
|
|
28136
28258
|
}
|
|
28137
|
-
if (
|
|
28259
|
+
if (text2 === "")
|
|
28138
28260
|
throw new ClientError3("MalformedResponse");
|
|
28139
28261
|
try {
|
|
28140
|
-
return JSON.parse(
|
|
28262
|
+
return JSON.parse(text2);
|
|
28141
28263
|
} catch (cause) {
|
|
28142
28264
|
throw new ClientError3("MalformedResponse", { cause });
|
|
28143
28265
|
}
|
|
@@ -28195,12 +28317,12 @@ function makeRpc2(raw, events) {
|
|
|
28195
28317
|
};
|
|
28196
28318
|
return Object.assign(Object.fromEntries(Object.keys(definition.methods).map((name) => [
|
|
28197
28319
|
name,
|
|
28198
|
-
async (
|
|
28320
|
+
async (input2, options) => {
|
|
28199
28321
|
try {
|
|
28200
28322
|
const result = await raw.rpc.call({
|
|
28201
28323
|
rpcID: definition.id,
|
|
28202
28324
|
method: name,
|
|
28203
|
-
input,
|
|
28325
|
+
input: input2,
|
|
28204
28326
|
location: options?.location
|
|
28205
28327
|
}, { signal: options?.signal, headers: options?.headers });
|
|
28206
28328
|
return result.output;
|
|
@@ -28421,7 +28543,7 @@ function assistantItems2(message, limit) {
|
|
|
28421
28543
|
};
|
|
28422
28544
|
}
|
|
28423
28545
|
const state = part.state;
|
|
28424
|
-
const
|
|
28546
|
+
const text2 = "content" in state ? state.content?.map((p) => p.type === "text" ? p.text : `[File: ${p.uri}]`).join("\n") : void 0;
|
|
28425
28547
|
return {
|
|
28426
28548
|
item: {
|
|
28427
28549
|
type: "toolExecution",
|
|
@@ -28429,10 +28551,10 @@ function assistantItems2(message, limit) {
|
|
|
28429
28551
|
toolName: part.name,
|
|
28430
28552
|
namespace: "opencode",
|
|
28431
28553
|
arguments: typeof state.input === "string" ? state.input : state.input,
|
|
28432
|
-
...
|
|
28554
|
+
...text2 ? {
|
|
28433
28555
|
output: {
|
|
28434
|
-
content: [{ type: "text", text:
|
|
28435
|
-
...
|
|
28556
|
+
content: [{ type: "text", text: text2.slice(0, limit) }],
|
|
28557
|
+
...text2.length > limit ? { truncated: true } : {}
|
|
28436
28558
|
}
|
|
28437
28559
|
} : {}
|
|
28438
28560
|
},
|
|
@@ -28573,15 +28695,15 @@ function sessionImportTitle(value, maxLength = HARNESS_SESSION_IMPORT_TITLE_MAX_
|
|
|
28573
28695
|
return normalized;
|
|
28574
28696
|
return `${characters.slice(0, maxLength - 1).join("").trimEnd()}…`;
|
|
28575
28697
|
}
|
|
28576
|
-
function sessionImportCandidate(
|
|
28577
|
-
const time3 = typeof
|
|
28698
|
+
function sessionImportCandidate(input2) {
|
|
28699
|
+
const time3 = typeof input2.updatedAt === "number" ? input2.updatedAt : typeof input2.updatedAt === "string" ? Date.parse(input2.updatedAt) : Number.NaN;
|
|
28578
28700
|
const parsed = harnessSessionImportCandidateSchema.safeParse({
|
|
28579
|
-
nativeSessionId:
|
|
28580
|
-
cwd:
|
|
28581
|
-
title: typeof
|
|
28701
|
+
nativeSessionId: input2.nativeSessionId,
|
|
28702
|
+
cwd: input2.cwd,
|
|
28703
|
+
title: typeof input2.title === "string" && input2.title.trim().length > 0 ? input2.title : null,
|
|
28582
28704
|
updatedAt: Math.floor(time3),
|
|
28583
28705
|
// Unknown must stay unknown; only an explicit boolean is a native statement.
|
|
28584
|
-
running: typeof
|
|
28706
|
+
running: typeof input2.running === "boolean" ? input2.running : null
|
|
28585
28707
|
});
|
|
28586
28708
|
return parsed.success ? parsed.data : null;
|
|
28587
28709
|
}
|
|
@@ -29033,8 +29155,12 @@ var V2Session = class {
|
|
|
29033
29155
|
}
|
|
29034
29156
|
}
|
|
29035
29157
|
#onEvent(event) {
|
|
29158
|
+
if (!("data" in event) || !("sessionID" in event.data) || event.data.sessionID !== this.info.id)
|
|
29159
|
+
return;
|
|
29160
|
+
if (event.type === "session.renamed")
|
|
29161
|
+
this.#publishTitle(event.data.title);
|
|
29036
29162
|
const active2 = this.#active;
|
|
29037
|
-
if (!active2
|
|
29163
|
+
if (!active2)
|
|
29038
29164
|
return;
|
|
29039
29165
|
if (FIRST_OUTPUT_EVENTS.has(event.type) && "assistantMessageID" in event.data && typeof event.data.assistantMessageID === "string" && !this.#meteredMessages.has(event.data.assistantMessageID) && (!event.type.endsWith(".delta") || "delta" in event.data && event.data.delta.length > 0)) {
|
|
29040
29166
|
const id2 = event.data.assistantMessageID;
|
|
@@ -29229,6 +29355,7 @@ var V2Session = class {
|
|
|
29229
29355
|
type: "session.state.changed",
|
|
29230
29356
|
state: v2State(this.info, this.models, this.policy)
|
|
29231
29357
|
});
|
|
29358
|
+
this.#publishTitle(this.info.title);
|
|
29232
29359
|
this.#emit({
|
|
29233
29360
|
type: "session.usage.changed",
|
|
29234
29361
|
usage: this.#usage(),
|
|
@@ -29243,6 +29370,11 @@ var V2Session = class {
|
|
|
29243
29370
|
});
|
|
29244
29371
|
active2.resolve();
|
|
29245
29372
|
}
|
|
29373
|
+
#publishTitle(value) {
|
|
29374
|
+
const title = sessionImportTitle(value);
|
|
29375
|
+
if (title && !/^New session - \d{4}-\d\d-\d\dT\d\d:\d\d:\d\d\.\d{3}Z$/u.test(title))
|
|
29376
|
+
this.#emit({ type: "session.title.changed", title });
|
|
29377
|
+
}
|
|
29246
29378
|
#closeInteraction(active2, id2, reason) {
|
|
29247
29379
|
const pending = active2.interactions.get(id2);
|
|
29248
29380
|
if (!pending)
|
|
@@ -29337,8 +29469,8 @@ var V2Adapter = class {
|
|
|
29337
29469
|
async #catalog(client2, cwd) {
|
|
29338
29470
|
return readCatalog(client2, cwd, this.options.startupTimeoutMs ?? 2e4);
|
|
29339
29471
|
}
|
|
29340
|
-
async inspect(
|
|
29341
|
-
const cwd =
|
|
29472
|
+
async inspect(input2 = {}, onModels) {
|
|
29473
|
+
const cwd = input2.cwd ?? process.cwd();
|
|
29342
29474
|
const connection = new V2Connection(this.options, cwd);
|
|
29343
29475
|
this.#connections.add(connection);
|
|
29344
29476
|
try {
|
|
@@ -29400,65 +29532,65 @@ var V2Adapter = class {
|
|
|
29400
29532
|
this.#connections.delete(connection);
|
|
29401
29533
|
}
|
|
29402
29534
|
}
|
|
29403
|
-
async open(
|
|
29535
|
+
async open(input2) {
|
|
29404
29536
|
try {
|
|
29405
|
-
|
|
29537
|
+
input2 = { ...input2, cwd: fs7.realpathSync(input2.cwd) };
|
|
29406
29538
|
} catch (error51) {
|
|
29407
29539
|
return errorResult(error51);
|
|
29408
29540
|
}
|
|
29409
29541
|
const connection = new V2Connection({
|
|
29410
29542
|
...this.options,
|
|
29411
|
-
environment: { ...this.options.environment ?? process.env, ...
|
|
29412
|
-
},
|
|
29543
|
+
environment: { ...this.options.environment ?? process.env, ...input2.environment }
|
|
29544
|
+
}, input2.cwd);
|
|
29413
29545
|
this.#connections.add(connection);
|
|
29414
29546
|
let created;
|
|
29415
29547
|
let client2;
|
|
29416
29548
|
try {
|
|
29417
29549
|
if (this.#closed)
|
|
29418
29550
|
throw new Error("OpenCode Adapter is closed");
|
|
29419
|
-
if (!
|
|
29551
|
+
if (!input2.cwd)
|
|
29420
29552
|
throw new Error("OpenCode requires a working directory");
|
|
29421
|
-
let policy =
|
|
29422
|
-
if (
|
|
29423
|
-
const locator = v2Locator(
|
|
29424
|
-
if (!sameDirectory(locator.directory,
|
|
29553
|
+
let policy = input2.kind === "create" ? input2.executionPolicy ?? "default" : "default";
|
|
29554
|
+
if (input2.kind !== "create") {
|
|
29555
|
+
const locator = v2Locator(input2.kind === "resume" ? input2.nativeRef : input2.sourceRef);
|
|
29556
|
+
if (!sameDirectory(locator.directory, input2.cwd))
|
|
29425
29557
|
throw new Error("OpenCode cannot resume or derive a Session across directories");
|
|
29426
29558
|
policy = locator.executionPolicy;
|
|
29427
29559
|
}
|
|
29428
29560
|
client2 = await connection.client();
|
|
29429
|
-
const models = await this.#catalog(client2,
|
|
29561
|
+
const models = await this.#catalog(client2, input2.cwd);
|
|
29430
29562
|
let info;
|
|
29431
|
-
if (
|
|
29432
|
-
const model2 = selectedModel(
|
|
29563
|
+
if (input2.kind === "create") {
|
|
29564
|
+
const model2 = selectedModel(input2, models);
|
|
29433
29565
|
info = await client2.session.create({
|
|
29434
|
-
location: { directory:
|
|
29566
|
+
location: { directory: input2.cwd },
|
|
29435
29567
|
...model2 ? { model: model2 } : {},
|
|
29436
|
-
permissions: v2Permissions([],
|
|
29568
|
+
permissions: v2Permissions([], input2.permissionModeId ?? harnessPermissionModeIdSchema.parse(policy === "unattended-full-access" ? "allow" : "default"))
|
|
29437
29569
|
});
|
|
29438
29570
|
created = info.id;
|
|
29439
29571
|
} else {
|
|
29440
|
-
const ref =
|
|
29572
|
+
const ref = input2.kind === "resume" ? input2.nativeRef : input2.sourceRef;
|
|
29441
29573
|
info = await client2.session.get({ sessionID: ref.nativeSessionId });
|
|
29442
|
-
if (info.id !== ref.nativeSessionId || !sameDirectory(info.location.directory,
|
|
29574
|
+
if (info.id !== ref.nativeSessionId || !sameDirectory(info.location.directory, input2.cwd))
|
|
29443
29575
|
throw new Error("OpenCode returned a different Native Session or directory");
|
|
29444
29576
|
if ((await client2.session.active())[info.id])
|
|
29445
29577
|
throw new Error("OpenCode Session is already running");
|
|
29446
29578
|
const source = await readHistory(client2, info, this.options.toolOutputLimit ?? 64e3, models.index);
|
|
29447
29579
|
if (source.snapshot.turns.some((turn) => turn.outcome.status === "unknown"))
|
|
29448
29580
|
throw new Error("OpenCode history contains an incomplete execution");
|
|
29449
|
-
if (
|
|
29581
|
+
if (input2.kind !== "resume") {
|
|
29450
29582
|
const parent = info;
|
|
29451
29583
|
const turns = source.snapshot.turns;
|
|
29452
29584
|
let count2;
|
|
29453
|
-
if (
|
|
29585
|
+
if (input2.kind === "rollbackLastTurn") {
|
|
29454
29586
|
if (!turns.length)
|
|
29455
29587
|
throw new Error("OpenCode history is empty");
|
|
29456
29588
|
count2 = turns.length - 1;
|
|
29457
29589
|
} else {
|
|
29458
|
-
if (
|
|
29590
|
+
if (input2.checkpoint.harnessId !== harnessId || input2.checkpoint.nativeSessionId !== info.id)
|
|
29459
29591
|
throw new Error("Checkpoint belongs to another Session");
|
|
29460
|
-
count2 = turns.findIndex((turn) => turn.checkpoint?.checkpointId ===
|
|
29461
|
-
if (!count2 || JSON.stringify(turns[count2 - 1]?.checkpoint) !== JSON.stringify(
|
|
29592
|
+
count2 = turns.findIndex((turn) => turn.checkpoint?.checkpointId === input2.checkpoint.checkpointId) + 1;
|
|
29593
|
+
if (!count2 || JSON.stringify(turns[count2 - 1]?.checkpoint) !== JSON.stringify(input2.checkpoint))
|
|
29462
29594
|
throw new Error("OpenCode checkpoint does not match native history");
|
|
29463
29595
|
}
|
|
29464
29596
|
const before = turns[count2]?.nativeTurnRef.nativeTurnKey;
|
|
@@ -29518,20 +29650,20 @@ var V2Adapter = class {
|
|
|
29518
29650
|
this.#connections.clear();
|
|
29519
29651
|
}
|
|
29520
29652
|
};
|
|
29521
|
-
function selectedModel(
|
|
29522
|
-
const selected =
|
|
29653
|
+
function selectedModel(input2, { catalog, index }) {
|
|
29654
|
+
const selected = input2.model ?? catalog.defaultModel;
|
|
29523
29655
|
if (!selected) {
|
|
29524
|
-
if (
|
|
29656
|
+
if (input2.thinkingOptionId)
|
|
29525
29657
|
throw new Error("Thinking selection requires a Model");
|
|
29526
29658
|
return void 0;
|
|
29527
29659
|
}
|
|
29528
29660
|
const entry = catalog.models.find((model3) => model3.ref.id === selected.id);
|
|
29529
29661
|
if (!entry)
|
|
29530
29662
|
throw new Error("OpenCode Model is not available");
|
|
29531
|
-
if (
|
|
29663
|
+
if (input2.thinkingOptionId && !entry.supportedThinkingOptionIds?.includes(input2.thinkingOptionId))
|
|
29532
29664
|
throw new Error("OpenCode Thinking option is not available for this Model");
|
|
29533
29665
|
const model2 = decodeOpenCodeModelRef(selected, index);
|
|
29534
|
-
const variant =
|
|
29666
|
+
const variant = input2.thinkingOptionId ? decodeOpenCodeVariant(input2.thinkingOptionId) : void 0;
|
|
29535
29667
|
return { providerID: model2.providerID, id: model2.modelID, ...variant ? { variant } : {} };
|
|
29536
29668
|
}
|
|
29537
29669
|
function historyContent(snapshot, identities = true) {
|
|
@@ -29575,7 +29707,7 @@ var OpenCodeAdapter2 = class {
|
|
|
29575
29707
|
this.dependencies = dependencies;
|
|
29576
29708
|
this.usageStatistics = createOpenCodeUsageStatistics(options.environment ?? process.env);
|
|
29577
29709
|
}
|
|
29578
|
-
async #select(environment,
|
|
29710
|
+
async #select(environment, input2) {
|
|
29579
29711
|
if (this.#closed)
|
|
29580
29712
|
throw new Error("OpenCode Adapter is closed");
|
|
29581
29713
|
const options = {
|
|
@@ -29585,8 +29717,8 @@ var OpenCodeAdapter2 = class {
|
|
|
29585
29717
|
const detected = this.dependencies ? { executable: options.command, major: 1 } : await detectOpenCode(options);
|
|
29586
29718
|
if (this.#closed)
|
|
29587
29719
|
throw new Error("OpenCode Adapter closed during version detection");
|
|
29588
|
-
if (
|
|
29589
|
-
const ref =
|
|
29720
|
+
if (input2 && input2.kind !== "create") {
|
|
29721
|
+
const ref = input2.kind === "resume" ? input2.nativeRef : input2.sourceRef;
|
|
29590
29722
|
const locator = ref.locator;
|
|
29591
29723
|
const nativeMajor = locator && typeof locator === "object" && !Array.isArray(locator) && locator.protocol === 2 ? 2 : 1;
|
|
29592
29724
|
if (nativeMajor !== detected.major)
|
|
@@ -29627,12 +29759,12 @@ var OpenCodeAdapter2 = class {
|
|
|
29627
29759
|
}
|
|
29628
29760
|
}
|
|
29629
29761
|
}
|
|
29630
|
-
async inspect(
|
|
29762
|
+
async inspect(input2 = {}) {
|
|
29631
29763
|
let adapter;
|
|
29632
29764
|
try {
|
|
29633
29765
|
adapter = await this.#select();
|
|
29634
|
-
const cwd =
|
|
29635
|
-
return await adapter.inspect({ ...
|
|
29766
|
+
const cwd = input2.cwd ?? process.cwd();
|
|
29767
|
+
return await adapter.inspect({ ...input2, cwd }, (models) => {
|
|
29636
29768
|
this.#inspectedModels.set(cwd, models);
|
|
29637
29769
|
});
|
|
29638
29770
|
} catch (error51) {
|
|
@@ -29647,11 +29779,11 @@ var OpenCodeAdapter2 = class {
|
|
|
29647
29779
|
}
|
|
29648
29780
|
}
|
|
29649
29781
|
}
|
|
29650
|
-
async open(
|
|
29782
|
+
async open(input2) {
|
|
29651
29783
|
let adapter;
|
|
29652
29784
|
try {
|
|
29653
|
-
adapter = await this.#select(
|
|
29654
|
-
const result = await adapter.open(
|
|
29785
|
+
adapter = await this.#select(input2.environment, input2);
|
|
29786
|
+
const result = await adapter.open(input2);
|
|
29655
29787
|
if (!result.ok) {
|
|
29656
29788
|
await adapter.close();
|
|
29657
29789
|
this.#adapters.delete(adapter);
|