@codexhost/cli-darwin-x64 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.
Files changed (52) hide show
  1. package/README.md +1 -1
  2. package/app/codexhost-distribution.json +1 -1
  3. package/app/console-server.mjs +3166 -3040
  4. package/app/console-web.js +1156 -585
  5. package/app/desktop-controller.mjs +645 -264
  6. package/app/host-runtime.mjs +10906 -10282
  7. package/app/plugins/antigravity/plugin.mjs +515 -369
  8. package/app/plugins/claude-code/plugin.mjs +583 -438
  9. package/app/plugins/codebuddy/plugin.mjs +551 -429
  10. package/app/plugins/codex-usage/plugin.mjs +344 -224
  11. package/app/plugins/copilot/plugin.mjs +408 -286
  12. package/app/plugins/cursor-cli/plugin.mjs +499 -360
  13. package/app/plugins/deepseek-harness/plugin.mjs +759 -520
  14. package/app/plugins/devin/plugin.mjs +385 -265
  15. package/app/plugins/grok/plugin.mjs +638 -516
  16. package/app/plugins/hermes/plugin.mjs +456 -334
  17. package/app/plugins/kimi-code/plugin.mjs +454 -332
  18. package/app/plugins/kiro-cli/plugin.mjs +445 -325
  19. package/app/plugins/omp/plugin.mjs +707 -339
  20. package/app/plugins/opencode/plugin.mjs +873 -741
  21. package/app/plugins/pi/plugin.mjs +481 -359
  22. package/app/plugins/qoder/plugin.mjs +682 -560
  23. package/app/plugins/qoder-cn/plugin.mjs +682 -560
  24. package/app/plugins/qwen-code/plugin.mjs +475 -355
  25. package/app/plugins/workbuddy/plugin.mjs +549 -429
  26. package/app/plugins/zcode/plugin.mjs +352 -232
  27. package/app/renderer-extension.js +1706 -945
  28. package/app/web/assets/{index-IvFk9KT-.js → index-DUOvhHbV.js} +82 -82
  29. package/app/web/codexhost-settings.js +416 -51
  30. package/app/web/index.html +1 -1
  31. package/app/web/plugins/deepseek-ai__dsh-api-remotes/client.js +64 -64
  32. package/app/web/plugins/deepseek-ai__dsh-api-session-controller/client.js +8 -8
  33. package/app/web/plugins/deepseek-ai__dsh-api-workspace-controller/client.js +1 -1
  34. package/app/web/plugins/deepseek-ai__dsh-client-shortcuts/client.js +1 -1
  35. package/app/web/plugins/deepseek-ai__dsh-client-ui-brand-official/client.js +1 -1
  36. package/app/web/plugins/deepseek-ai__dsh-client-ui-chat/client.js +74 -74
  37. package/app/web/plugins/deepseek-ai__dsh-client-ui-codexhost/client.js +72 -72
  38. package/app/web/plugins/deepseek-ai__dsh-client-ui-conversation/client.js +97 -97
  39. package/app/web/plugins/deepseek-ai__dsh-client-ui-layout/client.js +1 -1
  40. package/app/web/plugins/deepseek-ai__dsh-client-ui-sidebar/client.js +2 -2
  41. package/app/web/plugins/deepseek-ai__dsh-client-ui-sidebar-files/client.js +1 -1
  42. package/app/web/plugins/deepseek-ai__dsh-client-ui-tool/client.js +18 -18
  43. package/app/web/plugins/deepseek-ai__dsh-client-ui-workspace/client.js +8 -8
  44. package/app/web-modules/server.mjs +2132 -1312
  45. package/bin/codexhost +0 -0
  46. package/libexec/CodexHost.app/Contents/Info.plist +30 -0
  47. package/libexec/CodexHost.app/Contents/MacOS/CodexHost +0 -0
  48. package/libexec/CodexHost.app/Contents/PkgInfo +1 -0
  49. package/libexec/CodexHost.app/Contents/Resources/AppIcon.icns +0 -0
  50. package/libexec/codexhost-shim +0 -0
  51. package/libexec/codexhost-updater +0 -0
  52. 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(input) {
151
- return input.homeDirectory ?? environmentValue(input.environment, "HOME") ?? environmentValue(input.environment, "USERPROFILE") ?? os.homedir();
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, input, dependencies, platform, home) {
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: input.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, input.environment, platform, home);
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, input, dependencies = {}) {
204
- const platform = input.platform ?? process.platform;
203
+ function harnessCandidates(spec, input2, dependencies = {}) {
204
+ const platform = input2.platform ?? process.platform;
205
205
  const pathFlavor = targetPath(platform);
206
- const configured = input.command ?? (spec.commandEnvironmentVariable ? environmentValue(input.environment, spec.commandEnvironmentVariable) : void 0);
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, input.environment);
213
- for (const directory of pathDirectories(input.environment, platform)) {
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(input);
224
- for (const directory of installRootDirectories(spec, input, dependencies, platform, home)) {
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, input, dependencies = {}) {
235
- const platform = input.platform ?? process.platform;
234
+ function resolveHarnessExecutable(spec, input2, dependencies = {}) {
235
+ const platform = input2.platform ?? process.platform;
236
236
  const isExecutable = dependencies.isExecutable ?? ((candidate) => isExecutableFile(candidate, platform));
237
237
  const runnable = spec.runnableCandidate ?? ((candidate) => candidate);
238
238
  const context = { platform, isExecutable };
239
- for (const { candidate, source } of harnessCandidates(spec, input, dependencies)) {
239
+ for (const { candidate, source } of harnessCandidates(spec, input2, dependencies)) {
240
240
  const executable = runnable(candidate, context);
241
241
  if (executable !== void 0 && isExecutable(executable))
242
242
  return { executable, source };
@@ -247,13 +247,13 @@ function resolveHarnessExecutable(spec, input, dependencies = {}) {
247
247
  // ../../harness-discovery/dist/installation.js
248
248
  import { execFile } from "node:child_process";
249
249
  import { homedir } from "node:os";
250
- function runInstallationCommand(command, args, environment, timeout = 3e4) {
250
+ function runInstallationCommand(command, args, environment, timeout = 3e4, cwd) {
251
251
  const env = withNodeRuntimeOnPath(environment);
252
252
  const invocation = /\.[cm]?js$/i.test(command) ? commandInvocation(process.execPath, [command, ...args], env) : commandInvocation(command, args, env);
253
253
  return new Promise((resolve, reject) => {
254
254
  const child = execFile(invocation.command, invocation.arguments, {
255
255
  env,
256
- cwd: env.HOME ?? env.USERPROFILE ?? homedir(),
256
+ cwd: cwd ?? env.HOME ?? env.USERPROFILE ?? homedir(),
257
257
  encoding: "utf8",
258
258
  timeout,
259
259
  killSignal: "SIGKILL",
@@ -280,7 +280,7 @@ function createInstallationManager(options) {
280
280
  const check2 = () => checking ??= options.check().finally(() => {
281
281
  checking = void 0;
282
282
  });
283
- return (action) => {
283
+ return (action, confirmedVersion) => {
284
284
  if (updating)
285
285
  return updating;
286
286
  if (action === "check")
@@ -291,6 +291,8 @@ function createInstallationManager(options) {
291
291
  return before;
292
292
  if (!before.canUpdate)
293
293
  throw new Error(before.message ?? "This installation cannot be updated automatically");
294
+ if ((before.latestVerifiedVersion !== void 0 || confirmedVersion !== void 0) && before.latestVersion !== confirmedVersion)
295
+ return { ...before, confirmationRequired: true };
294
296
  await options.update(before);
295
297
  const after = await check2();
296
298
  if (after.currentVersion === before.currentVersion)
@@ -1077,8 +1079,8 @@ function cached(getter) {
1077
1079
  }
1078
1080
  };
1079
1081
  }
1080
- function nullish(input) {
1081
- return input === null || input === void 0;
1082
+ function nullish(input2) {
1083
+ return input2 === null || input2 === void 0;
1082
1084
  }
1083
1085
  function cleanRegex(source) {
1084
1086
  const start = source.startsWith("^") ? 1 : 0;
@@ -1165,8 +1167,8 @@ function randomString(length = 10) {
1165
1167
  function esc(str2) {
1166
1168
  return JSON.stringify(str2);
1167
1169
  }
1168
- function slugify(input) {
1169
- return input.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, "");
1170
+ function slugify(input2) {
1171
+ return input2.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, "");
1170
1172
  }
1171
1173
  var captureStackTrace = "captureStackTrace" in Error ? Error.captureStackTrace : (..._args) => {
1172
1174
  };
@@ -1571,19 +1573,19 @@ function finalizeIssue(iss, ctx, config2) {
1571
1573
  }
1572
1574
  return rest;
1573
1575
  }
1574
- function getSizableOrigin(input) {
1575
- if (input instanceof Set)
1576
+ function getSizableOrigin(input2) {
1577
+ if (input2 instanceof Set)
1576
1578
  return "set";
1577
- if (input instanceof Map)
1579
+ if (input2 instanceof Map)
1578
1580
  return "map";
1579
- if (input instanceof File)
1581
+ if (input2 instanceof File)
1580
1582
  return "file";
1581
1583
  return "unknown";
1582
1584
  }
1583
- function getLengthableOrigin(input) {
1584
- if (Array.isArray(input))
1585
+ function getLengthableOrigin(input2) {
1586
+ if (Array.isArray(input2))
1585
1587
  return "array";
1586
- if (typeof input === "string")
1588
+ if (typeof input2 === "string")
1587
1589
  return "string";
1588
1590
  return "unknown";
1589
1591
  }
@@ -1609,12 +1611,12 @@ function parsedType(data) {
1609
1611
  return t;
1610
1612
  }
1611
1613
  function issue(...args) {
1612
- const [iss, input, inst] = args;
1614
+ const [iss, input2, inst] = args;
1613
1615
  if (typeof iss === "string") {
1614
1616
  return {
1615
1617
  message: iss,
1616
1618
  code: "custom",
1617
- input,
1619
+ input: input2,
1618
1620
  inst
1619
1621
  };
1620
1622
  }
@@ -2158,23 +2160,23 @@ var $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat"
2158
2160
  bag.pattern = integer;
2159
2161
  });
2160
2162
  inst._zod.check = (payload) => {
2161
- const input = payload.value;
2163
+ const input2 = payload.value;
2162
2164
  if (isInt) {
2163
- if (!Number.isInteger(input)) {
2165
+ if (!Number.isInteger(input2)) {
2164
2166
  payload.issues.push({
2165
2167
  expected: origin,
2166
2168
  format: def.format,
2167
2169
  code: "invalid_type",
2168
2170
  continue: false,
2169
- input,
2171
+ input: input2,
2170
2172
  inst
2171
2173
  });
2172
2174
  return;
2173
2175
  }
2174
- if (!Number.isSafeInteger(input)) {
2175
- if (input > 0) {
2176
+ if (!Number.isSafeInteger(input2)) {
2177
+ if (input2 > 0) {
2176
2178
  payload.issues.push({
2177
- input,
2179
+ input: input2,
2178
2180
  code: "too_big",
2179
2181
  maximum: Number.MAX_SAFE_INTEGER,
2180
2182
  note: "Integers must be within the safe integer range.",
@@ -2185,7 +2187,7 @@ var $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat"
2185
2187
  });
2186
2188
  } else {
2187
2189
  payload.issues.push({
2188
- input,
2190
+ input: input2,
2189
2191
  code: "too_small",
2190
2192
  minimum: Number.MIN_SAFE_INTEGER,
2191
2193
  note: "Integers must be within the safe integer range.",
@@ -2198,10 +2200,10 @@ var $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat"
2198
2200
  return;
2199
2201
  }
2200
2202
  }
2201
- if (input < minimum) {
2203
+ if (input2 < minimum) {
2202
2204
  payload.issues.push({
2203
2205
  origin: "number",
2204
- input,
2206
+ input: input2,
2205
2207
  code: "too_small",
2206
2208
  minimum,
2207
2209
  inclusive: true,
@@ -2209,10 +2211,10 @@ var $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat"
2209
2211
  continue: !def.abort
2210
2212
  });
2211
2213
  }
2212
- if (input > maximum) {
2214
+ if (input2 > maximum) {
2213
2215
  payload.issues.push({
2214
2216
  origin: "number",
2215
- input,
2217
+ input: input2,
2216
2218
  code: "too_big",
2217
2219
  maximum,
2218
2220
  inclusive: true,
@@ -2232,11 +2234,11 @@ var $ZodCheckBigIntFormat = /* @__PURE__ */ $constructor("$ZodCheckBigIntFormat"
2232
2234
  bag.maximum = maximum;
2233
2235
  });
2234
2236
  inst._zod.check = (payload) => {
2235
- const input = payload.value;
2236
- if (input < minimum) {
2237
+ const input2 = payload.value;
2238
+ if (input2 < minimum) {
2237
2239
  payload.issues.push({
2238
2240
  origin: "bigint",
2239
- input,
2241
+ input: input2,
2240
2242
  code: "too_small",
2241
2243
  minimum,
2242
2244
  inclusive: true,
@@ -2244,10 +2246,10 @@ var $ZodCheckBigIntFormat = /* @__PURE__ */ $constructor("$ZodCheckBigIntFormat"
2244
2246
  continue: !def.abort
2245
2247
  });
2246
2248
  }
2247
- if (input > maximum) {
2249
+ if (input2 > maximum) {
2248
2250
  payload.issues.push({
2249
2251
  origin: "bigint",
2250
- input,
2252
+ input: input2,
2251
2253
  code: "too_big",
2252
2254
  maximum,
2253
2255
  inclusive: true,
@@ -2270,16 +2272,16 @@ var $ZodCheckMaxSize = /* @__PURE__ */ $constructor("$ZodCheckMaxSize", (inst, d
2270
2272
  inst2._zod.bag.maximum = def.maximum;
2271
2273
  });
2272
2274
  inst._zod.check = (payload) => {
2273
- const input = payload.value;
2274
- const size = input.size;
2275
+ const input2 = payload.value;
2276
+ const size = input2.size;
2275
2277
  if (size <= def.maximum)
2276
2278
  return;
2277
2279
  payload.issues.push({
2278
- origin: getSizableOrigin(input),
2280
+ origin: getSizableOrigin(input2),
2279
2281
  code: "too_big",
2280
2282
  maximum: def.maximum,
2281
2283
  inclusive: true,
2282
- input,
2284
+ input: input2,
2283
2285
  inst,
2284
2286
  continue: !def.abort
2285
2287
  });
@@ -2298,16 +2300,16 @@ var $ZodCheckMinSize = /* @__PURE__ */ $constructor("$ZodCheckMinSize", (inst, d
2298
2300
  inst2._zod.bag.minimum = def.minimum;
2299
2301
  });
2300
2302
  inst._zod.check = (payload) => {
2301
- const input = payload.value;
2302
- const size = input.size;
2303
+ const input2 = payload.value;
2304
+ const size = input2.size;
2303
2305
  if (size >= def.minimum)
2304
2306
  return;
2305
2307
  payload.issues.push({
2306
- origin: getSizableOrigin(input),
2308
+ origin: getSizableOrigin(input2),
2307
2309
  code: "too_small",
2308
2310
  minimum: def.minimum,
2309
2311
  inclusive: true,
2310
- input,
2312
+ input: input2,
2311
2313
  inst,
2312
2314
  continue: !def.abort
2313
2315
  });
@@ -2327,13 +2329,13 @@ var $ZodCheckSizeEquals = /* @__PURE__ */ $constructor("$ZodCheckSizeEquals", (i
2327
2329
  bag.size = def.size;
2328
2330
  });
2329
2331
  inst._zod.check = (payload) => {
2330
- const input = payload.value;
2331
- const size = input.size;
2332
+ const input2 = payload.value;
2333
+ const size = input2.size;
2332
2334
  if (size === def.size)
2333
2335
  return;
2334
2336
  const tooBig = size > def.size;
2335
2337
  payload.issues.push({
2336
- origin: getSizableOrigin(input),
2338
+ origin: getSizableOrigin(input2),
2337
2339
  ...tooBig ? { code: "too_big", maximum: def.size } : { code: "too_small", minimum: def.size },
2338
2340
  inclusive: true,
2339
2341
  exact: true,
@@ -2356,17 +2358,17 @@ var $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (ins
2356
2358
  inst2._zod.bag.maximum = def.maximum;
2357
2359
  });
2358
2360
  inst._zod.check = (payload) => {
2359
- const input = payload.value;
2360
- const length = input.length;
2361
+ const input2 = payload.value;
2362
+ const length = input2.length;
2361
2363
  if (length <= def.maximum)
2362
2364
  return;
2363
- const origin = getLengthableOrigin(input);
2365
+ const origin = getLengthableOrigin(input2);
2364
2366
  payload.issues.push({
2365
2367
  origin,
2366
2368
  code: "too_big",
2367
2369
  maximum: def.maximum,
2368
2370
  inclusive: true,
2369
- input,
2371
+ input: input2,
2370
2372
  inst,
2371
2373
  continue: !def.abort
2372
2374
  });
@@ -2385,17 +2387,17 @@ var $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (ins
2385
2387
  inst2._zod.bag.minimum = def.minimum;
2386
2388
  });
2387
2389
  inst._zod.check = (payload) => {
2388
- const input = payload.value;
2389
- const length = input.length;
2390
+ const input2 = payload.value;
2391
+ const length = input2.length;
2390
2392
  if (length >= def.minimum)
2391
2393
  return;
2392
- const origin = getLengthableOrigin(input);
2394
+ const origin = getLengthableOrigin(input2);
2393
2395
  payload.issues.push({
2394
2396
  origin,
2395
2397
  code: "too_small",
2396
2398
  minimum: def.minimum,
2397
2399
  inclusive: true,
2398
- input,
2400
+ input: input2,
2399
2401
  inst,
2400
2402
  continue: !def.abort
2401
2403
  });
@@ -2415,11 +2417,11 @@ var $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEquals"
2415
2417
  bag.length = def.length;
2416
2418
  });
2417
2419
  inst._zod.check = (payload) => {
2418
- const input = payload.value;
2419
- const length = input.length;
2420
+ const input2 = payload.value;
2421
+ const length = input2.length;
2420
2422
  if (length === def.length)
2421
2423
  return;
2422
- const origin = getLengthableOrigin(input);
2424
+ const origin = getLengthableOrigin(input2);
2423
2425
  const tooBig = length > def.length;
2424
2426
  payload.issues.push({
2425
2427
  origin,
@@ -3090,15 +3092,15 @@ var $ZodNumber = /* @__PURE__ */ $constructor("$ZodNumber", (inst, def) => {
3090
3092
  payload.value = Number(payload.value);
3091
3093
  } catch (_) {
3092
3094
  }
3093
- const input = payload.value;
3094
- if (typeof input === "number" && !Number.isNaN(input) && Number.isFinite(input)) {
3095
+ const input2 = payload.value;
3096
+ if (typeof input2 === "number" && !Number.isNaN(input2) && Number.isFinite(input2)) {
3095
3097
  return payload;
3096
3098
  }
3097
- const received = typeof input === "number" ? Number.isNaN(input) ? "NaN" : !Number.isFinite(input) ? "Infinity" : void 0 : void 0;
3099
+ const received = typeof input2 === "number" ? Number.isNaN(input2) ? "NaN" : !Number.isFinite(input2) ? "Infinity" : void 0 : void 0;
3098
3100
  payload.issues.push({
3099
3101
  expected: "number",
3100
3102
  code: "invalid_type",
3101
- input,
3103
+ input: input2,
3102
3104
  inst,
3103
3105
  ...received ? { received } : {}
3104
3106
  });
@@ -3118,13 +3120,13 @@ var $ZodBoolean = /* @__PURE__ */ $constructor("$ZodBoolean", (inst, def) => {
3118
3120
  payload.value = Boolean(payload.value);
3119
3121
  } catch (_) {
3120
3122
  }
3121
- const input = payload.value;
3122
- if (typeof input === "boolean")
3123
+ const input2 = payload.value;
3124
+ if (typeof input2 === "boolean")
3123
3125
  return payload;
3124
3126
  payload.issues.push({
3125
3127
  expected: "boolean",
3126
3128
  code: "invalid_type",
3127
- input,
3129
+ input: input2,
3128
3130
  inst
3129
3131
  });
3130
3132
  return payload;
@@ -3157,13 +3159,13 @@ var $ZodBigIntFormat = /* @__PURE__ */ $constructor("$ZodBigIntFormat", (inst, d
3157
3159
  var $ZodSymbol = /* @__PURE__ */ $constructor("$ZodSymbol", (inst, def) => {
3158
3160
  $ZodType.init(inst, def);
3159
3161
  inst._zod.parse = (payload, _ctx) => {
3160
- const input = payload.value;
3161
- if (typeof input === "symbol")
3162
+ const input2 = payload.value;
3163
+ if (typeof input2 === "symbol")
3162
3164
  return payload;
3163
3165
  payload.issues.push({
3164
3166
  expected: "symbol",
3165
3167
  code: "invalid_type",
3166
- input,
3168
+ input: input2,
3167
3169
  inst
3168
3170
  });
3169
3171
  return payload;
@@ -3174,13 +3176,13 @@ var $ZodUndefined = /* @__PURE__ */ $constructor("$ZodUndefined", (inst, def) =>
3174
3176
  inst._zod.pattern = _undefined;
3175
3177
  inst._zod.values = /* @__PURE__ */ new Set([void 0]);
3176
3178
  inst._zod.parse = (payload, _ctx) => {
3177
- const input = payload.value;
3178
- if (typeof input === "undefined")
3179
+ const input2 = payload.value;
3180
+ if (typeof input2 === "undefined")
3179
3181
  return payload;
3180
3182
  payload.issues.push({
3181
3183
  expected: "undefined",
3182
3184
  code: "invalid_type",
3183
- input,
3185
+ input: input2,
3184
3186
  inst
3185
3187
  });
3186
3188
  return payload;
@@ -3191,13 +3193,13 @@ var $ZodNull = /* @__PURE__ */ $constructor("$ZodNull", (inst, def) => {
3191
3193
  inst._zod.pattern = _null;
3192
3194
  inst._zod.values = /* @__PURE__ */ new Set([null]);
3193
3195
  inst._zod.parse = (payload, _ctx) => {
3194
- const input = payload.value;
3195
- if (input === null)
3196
+ const input2 = payload.value;
3197
+ if (input2 === null)
3196
3198
  return payload;
3197
3199
  payload.issues.push({
3198
3200
  expected: "null",
3199
3201
  code: "invalid_type",
3200
- input,
3202
+ input: input2,
3201
3203
  inst
3202
3204
  });
3203
3205
  return payload;
@@ -3226,13 +3228,13 @@ var $ZodNever = /* @__PURE__ */ $constructor("$ZodNever", (inst, def) => {
3226
3228
  var $ZodVoid = /* @__PURE__ */ $constructor("$ZodVoid", (inst, def) => {
3227
3229
  $ZodType.init(inst, def);
3228
3230
  inst._zod.parse = (payload, _ctx) => {
3229
- const input = payload.value;
3230
- if (typeof input === "undefined")
3231
+ const input2 = payload.value;
3232
+ if (typeof input2 === "undefined")
3231
3233
  return payload;
3232
3234
  payload.issues.push({
3233
3235
  expected: "void",
3234
3236
  code: "invalid_type",
3235
- input,
3237
+ input: input2,
3236
3238
  inst
3237
3239
  });
3238
3240
  return payload;
@@ -3247,15 +3249,15 @@ var $ZodDate = /* @__PURE__ */ $constructor("$ZodDate", (inst, def) => {
3247
3249
  } catch (_err) {
3248
3250
  }
3249
3251
  }
3250
- const input = payload.value;
3251
- const isDate = input instanceof Date;
3252
- const isValidDate = isDate && !Number.isNaN(input.getTime());
3252
+ const input2 = payload.value;
3253
+ const isDate = input2 instanceof Date;
3254
+ const isValidDate = isDate && !Number.isNaN(input2.getTime());
3253
3255
  if (isValidDate)
3254
3256
  return payload;
3255
3257
  payload.issues.push({
3256
3258
  expected: "date",
3257
3259
  code: "invalid_type",
3258
- input,
3260
+ input: input2,
3259
3261
  ...isDate ? { received: "Invalid Date" } : {},
3260
3262
  inst
3261
3263
  });
@@ -3271,20 +3273,20 @@ function handleArrayResult(result, final, index) {
3271
3273
  var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
3272
3274
  $ZodType.init(inst, def);
3273
3275
  inst._zod.parse = (payload, ctx) => {
3274
- const input = payload.value;
3275
- if (!Array.isArray(input)) {
3276
+ const input2 = payload.value;
3277
+ if (!Array.isArray(input2)) {
3276
3278
  payload.issues.push({
3277
3279
  expected: "array",
3278
3280
  code: "invalid_type",
3279
- input,
3281
+ input: input2,
3280
3282
  inst
3281
3283
  });
3282
3284
  return payload;
3283
3285
  }
3284
- payload.value = Array(input.length);
3286
+ payload.value = Array(input2.length);
3285
3287
  const proms = [];
3286
- for (let i = 0; i < input.length; i++) {
3287
- const item = input[i];
3288
+ for (let i = 0; i < input2.length; i++) {
3289
+ const item = input2[i];
3288
3290
  const result = def.element._zod.run({
3289
3291
  value: item,
3290
3292
  issues: []
@@ -3301,8 +3303,8 @@ var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
3301
3303
  return payload;
3302
3304
  };
3303
3305
  });
3304
- function handlePropertyResult(result, final, key, input, isOptionalIn, isOptionalOut) {
3305
- const isPresent = key in input;
3306
+ function handlePropertyResult(result, final, key, input2, isOptionalIn, isOptionalOut) {
3307
+ const isPresent = key in input2;
3306
3308
  if (result.issues.length) {
3307
3309
  if (isOptionalIn && isOptionalOut && !isPresent) {
3308
3310
  return;
@@ -3344,14 +3346,14 @@ function normalizeDef(def) {
3344
3346
  optionalKeys: new Set(okeys)
3345
3347
  };
3346
3348
  }
3347
- function handleCatchall(proms, input, payload, ctx, def, inst) {
3349
+ function handleCatchall(proms, input2, payload, ctx, def, inst) {
3348
3350
  const unrecognized = [];
3349
3351
  const keySet = def.keySet;
3350
3352
  const _catchall = def.catchall._zod;
3351
3353
  const t = _catchall.def.type;
3352
3354
  const isOptionalIn = _catchall.optin === "optional";
3353
3355
  const isOptionalOut = _catchall.optout === "optional";
3354
- for (const key in input) {
3356
+ for (const key in input2) {
3355
3357
  if (key === "__proto__")
3356
3358
  continue;
3357
3359
  if (keySet.has(key))
@@ -3360,18 +3362,18 @@ function handleCatchall(proms, input, payload, ctx, def, inst) {
3360
3362
  unrecognized.push(key);
3361
3363
  continue;
3362
3364
  }
3363
- const r = _catchall.run({ value: input[key], issues: [] }, ctx);
3365
+ const r = _catchall.run({ value: input2[key], issues: [] }, ctx);
3364
3366
  if (r instanceof Promise) {
3365
- proms.push(r.then((r2) => handlePropertyResult(r2, payload, key, input, isOptionalIn, isOptionalOut)));
3367
+ proms.push(r.then((r2) => handlePropertyResult(r2, payload, key, input2, isOptionalIn, isOptionalOut)));
3366
3368
  } else {
3367
- handlePropertyResult(r, payload, key, input, isOptionalIn, isOptionalOut);
3369
+ handlePropertyResult(r, payload, key, input2, isOptionalIn, isOptionalOut);
3368
3370
  }
3369
3371
  }
3370
3372
  if (unrecognized.length) {
3371
3373
  payload.issues.push({
3372
3374
  code: "unrecognized_keys",
3373
3375
  keys: unrecognized,
3374
- input,
3376
+ input: input2,
3375
3377
  inst
3376
3378
  });
3377
3379
  }
@@ -3415,12 +3417,12 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
3415
3417
  let value;
3416
3418
  inst._zod.parse = (payload, ctx) => {
3417
3419
  value ?? (value = _normalized.value);
3418
- const input = payload.value;
3419
- if (!isObject2(input)) {
3420
+ const input2 = payload.value;
3421
+ if (!isObject2(input2)) {
3420
3422
  payload.issues.push({
3421
3423
  expected: "object",
3422
3424
  code: "invalid_type",
3423
- input,
3425
+ input: input2,
3424
3426
  inst
3425
3427
  });
3426
3428
  return payload;
@@ -3432,17 +3434,17 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
3432
3434
  const el = shape[key];
3433
3435
  const isOptionalIn = el._zod.optin === "optional";
3434
3436
  const isOptionalOut = el._zod.optout === "optional";
3435
- const r = el._zod.run({ value: input[key], issues: [] }, ctx);
3437
+ const r = el._zod.run({ value: input2[key], issues: [] }, ctx);
3436
3438
  if (r instanceof Promise) {
3437
- proms.push(r.then((r2) => handlePropertyResult(r2, payload, key, input, isOptionalIn, isOptionalOut)));
3439
+ proms.push(r.then((r2) => handlePropertyResult(r2, payload, key, input2, isOptionalIn, isOptionalOut)));
3438
3440
  } else {
3439
- handlePropertyResult(r, payload, key, input, isOptionalIn, isOptionalOut);
3441
+ handlePropertyResult(r, payload, key, input2, isOptionalIn, isOptionalOut);
3440
3442
  }
3441
3443
  }
3442
3444
  if (!catchall) {
3443
3445
  return proms.length ? Promise.all(proms).then(() => payload) : payload;
3444
3446
  }
3445
- return handleCatchall(proms, input, payload, ctx, _normalized.value, inst);
3447
+ return handleCatchall(proms, input2, payload, ctx, _normalized.value, inst);
3446
3448
  };
3447
3449
  });
3448
3450
  var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) => {
@@ -3551,12 +3553,12 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
3551
3553
  let value;
3552
3554
  inst._zod.parse = (payload, ctx) => {
3553
3555
  value ?? (value = _normalized.value);
3554
- const input = payload.value;
3555
- if (!isObject2(input)) {
3556
+ const input2 = payload.value;
3557
+ if (!isObject2(input2)) {
3556
3558
  payload.issues.push({
3557
3559
  expected: "object",
3558
3560
  code: "invalid_type",
3559
- input,
3561
+ input: input2,
3560
3562
  inst
3561
3563
  });
3562
3564
  return payload;
@@ -3567,7 +3569,7 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
3567
3569
  payload = fastpass(payload, ctx);
3568
3570
  if (!catchall)
3569
3571
  return payload;
3570
- return handleCatchall([], input, payload, ctx, value, inst);
3572
+ return handleCatchall([], input2, payload, ctx, value, inst);
3571
3573
  }
3572
3574
  return superParse(payload, ctx);
3573
3575
  };
@@ -3727,17 +3729,17 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
3727
3729
  return map2;
3728
3730
  });
3729
3731
  inst._zod.parse = (payload, ctx) => {
3730
- const input = payload.value;
3731
- if (!isObject(input)) {
3732
+ const input2 = payload.value;
3733
+ if (!isObject(input2)) {
3732
3734
  payload.issues.push({
3733
3735
  code: "invalid_type",
3734
3736
  expected: "object",
3735
- input,
3737
+ input: input2,
3736
3738
  inst
3737
3739
  });
3738
3740
  return payload;
3739
3741
  }
3740
- const opt = disc.value.get(input?.[def.discriminator]);
3742
+ const opt = disc.value.get(input2?.[def.discriminator]);
3741
3743
  if (opt) {
3742
3744
  return opt._zod.run(payload, ctx);
3743
3745
  }
@@ -3750,7 +3752,7 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
3750
3752
  note: "No matching discriminator",
3751
3753
  discriminator: def.discriminator,
3752
3754
  options: Array.from(disc.value.keys()),
3753
- input,
3755
+ input: input2,
3754
3756
  path: [def.discriminator],
3755
3757
  inst
3756
3758
  });
@@ -3760,9 +3762,9 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
3760
3762
  var $ZodIntersection = /* @__PURE__ */ $constructor("$ZodIntersection", (inst, def) => {
3761
3763
  $ZodType.init(inst, def);
3762
3764
  inst._zod.parse = (payload, ctx) => {
3763
- const input = payload.value;
3764
- const left = def.left._zod.run({ value: input, issues: [] }, ctx);
3765
- const right = def.right._zod.run({ value: input, issues: [] }, ctx);
3765
+ const input2 = payload.value;
3766
+ const left = def.left._zod.run({ value: input2, issues: [] }, ctx);
3767
+ const right = def.right._zod.run({ value: input2, issues: [] }, ctx);
3766
3768
  const async = left instanceof Promise || right instanceof Promise;
3767
3769
  if (async) {
3768
3770
  return Promise.all([left, right]).then(([left2, right2]) => {
@@ -3859,10 +3861,10 @@ var $ZodTuple = /* @__PURE__ */ $constructor("$ZodTuple", (inst, def) => {
3859
3861
  $ZodType.init(inst, def);
3860
3862
  const items = def.items;
3861
3863
  inst._zod.parse = (payload, ctx) => {
3862
- const input = payload.value;
3863
- if (!Array.isArray(input)) {
3864
+ const input2 = payload.value;
3865
+ if (!Array.isArray(input2)) {
3864
3866
  payload.issues.push({
3865
- input,
3867
+ input: input2,
3866
3868
  inst,
3867
3869
  expected: "tuple",
3868
3870
  code: "invalid_type"
@@ -3874,23 +3876,23 @@ var $ZodTuple = /* @__PURE__ */ $constructor("$ZodTuple", (inst, def) => {
3874
3876
  const optinStart = getTupleOptStart(items, "optin");
3875
3877
  const optoutStart = getTupleOptStart(items, "optout");
3876
3878
  if (!def.rest) {
3877
- if (input.length < optinStart) {
3879
+ if (input2.length < optinStart) {
3878
3880
  payload.issues.push({
3879
3881
  code: "too_small",
3880
3882
  minimum: optinStart,
3881
3883
  inclusive: true,
3882
- input,
3884
+ input: input2,
3883
3885
  inst,
3884
3886
  origin: "array"
3885
3887
  });
3886
3888
  return payload;
3887
3889
  }
3888
- if (input.length > items.length) {
3890
+ if (input2.length > items.length) {
3889
3891
  payload.issues.push({
3890
3892
  code: "too_big",
3891
3893
  maximum: items.length,
3892
3894
  inclusive: true,
3893
- input,
3895
+ input: input2,
3894
3896
  inst,
3895
3897
  origin: "array"
3896
3898
  });
@@ -3898,7 +3900,7 @@ var $ZodTuple = /* @__PURE__ */ $constructor("$ZodTuple", (inst, def) => {
3898
3900
  }
3899
3901
  const itemResults = new Array(items.length);
3900
3902
  for (let i = 0; i < items.length; i++) {
3901
- const r = items[i]._zod.run({ value: input[i], issues: [] }, ctx);
3903
+ const r = items[i]._zod.run({ value: input2[i], issues: [] }, ctx);
3902
3904
  if (r instanceof Promise) {
3903
3905
  proms.push(r.then((rr) => {
3904
3906
  itemResults[i] = rr;
@@ -3909,7 +3911,7 @@ var $ZodTuple = /* @__PURE__ */ $constructor("$ZodTuple", (inst, def) => {
3909
3911
  }
3910
3912
  if (def.rest) {
3911
3913
  let i = items.length - 1;
3912
- const rest = input.slice(items.length);
3914
+ const rest = input2.slice(items.length);
3913
3915
  for (const el of rest) {
3914
3916
  i++;
3915
3917
  const result = def.rest._zod.run({ value: el, issues: [] }, ctx);
@@ -3921,9 +3923,9 @@ var $ZodTuple = /* @__PURE__ */ $constructor("$ZodTuple", (inst, def) => {
3921
3923
  }
3922
3924
  }
3923
3925
  if (proms.length) {
3924
- return Promise.all(proms).then(() => handleTupleResults(itemResults, payload, items, input, optoutStart));
3926
+ return Promise.all(proms).then(() => handleTupleResults(itemResults, payload, items, input2, optoutStart));
3925
3927
  }
3926
- return handleTupleResults(itemResults, payload, items, input, optoutStart);
3928
+ return handleTupleResults(itemResults, payload, items, input2, optoutStart);
3927
3929
  };
3928
3930
  });
3929
3931
  function getTupleOptStart(items, key) {
@@ -3939,10 +3941,10 @@ function handleTupleResult(result, final, index) {
3939
3941
  }
3940
3942
  final.value[index] = result.value;
3941
3943
  }
3942
- function handleTupleResults(itemResults, final, items, input, optoutStart) {
3944
+ function handleTupleResults(itemResults, final, items, input2, optoutStart) {
3943
3945
  for (let i = 0; i < items.length; i++) {
3944
3946
  const r = itemResults[i];
3945
- const isPresent = i < input.length;
3947
+ const isPresent = i < input2.length;
3946
3948
  if (r.issues.length) {
3947
3949
  if (!isPresent && i >= optoutStart) {
3948
3950
  final.value.length = i;
@@ -3952,7 +3954,7 @@ function handleTupleResults(itemResults, final, items, input, optoutStart) {
3952
3954
  }
3953
3955
  final.value[i] = r.value;
3954
3956
  }
3955
- for (let i = final.value.length - 1; i >= input.length; i--) {
3957
+ for (let i = final.value.length - 1; i >= input2.length; i--) {
3956
3958
  if (items[i]._zod.optout === "optional" && final.value[i] === void 0) {
3957
3959
  final.value.length = i;
3958
3960
  } else {
@@ -3964,12 +3966,12 @@ function handleTupleResults(itemResults, final, items, input, optoutStart) {
3964
3966
  var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
3965
3967
  $ZodType.init(inst, def);
3966
3968
  inst._zod.parse = (payload, ctx) => {
3967
- const input = payload.value;
3968
- if (!isPlainObject(input)) {
3969
+ const input2 = payload.value;
3970
+ if (!isPlainObject(input2)) {
3969
3971
  payload.issues.push({
3970
3972
  expected: "record",
3971
3973
  code: "invalid_type",
3972
- input,
3974
+ input: input2,
3973
3975
  inst
3974
3976
  });
3975
3977
  return payload;
@@ -3998,7 +4000,7 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
3998
4000
  continue;
3999
4001
  }
4000
4002
  const outKey = keyResult.value;
4001
- const result = def.valueType._zod.run({ value: input[key], issues: [] }, ctx);
4003
+ const result = def.valueType._zod.run({ value: input2[key], issues: [] }, ctx);
4002
4004
  if (result instanceof Promise) {
4003
4005
  proms.push(result.then((result2) => {
4004
4006
  if (result2.issues.length) {
@@ -4015,7 +4017,7 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
4015
4017
  }
4016
4018
  }
4017
4019
  let unrecognized;
4018
- for (const key in input) {
4020
+ for (const key in input2) {
4019
4021
  if (!recordKeys.has(key)) {
4020
4022
  unrecognized = unrecognized ?? [];
4021
4023
  unrecognized.push(key);
@@ -4024,17 +4026,17 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
4024
4026
  if (unrecognized && unrecognized.length > 0) {
4025
4027
  payload.issues.push({
4026
4028
  code: "unrecognized_keys",
4027
- input,
4029
+ input: input2,
4028
4030
  inst,
4029
4031
  keys: unrecognized
4030
4032
  });
4031
4033
  }
4032
4034
  } else {
4033
4035
  payload.value = {};
4034
- for (const key of Reflect.ownKeys(input)) {
4036
+ for (const key of Reflect.ownKeys(input2)) {
4035
4037
  if (key === "__proto__")
4036
4038
  continue;
4037
- if (!Object.prototype.propertyIsEnumerable.call(input, key))
4039
+ if (!Object.prototype.propertyIsEnumerable.call(input2, key))
4038
4040
  continue;
4039
4041
  let keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);
4040
4042
  if (keyResult instanceof Promise) {
@@ -4052,7 +4054,7 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
4052
4054
  }
4053
4055
  if (keyResult.issues.length) {
4054
4056
  if (def.mode === "loose") {
4055
- payload.value[key] = input[key];
4057
+ payload.value[key] = input2[key];
4056
4058
  } else {
4057
4059
  payload.issues.push({
4058
4060
  code: "invalid_key",
@@ -4065,7 +4067,7 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
4065
4067
  }
4066
4068
  continue;
4067
4069
  }
4068
- const result = def.valueType._zod.run({ value: input[key], issues: [] }, ctx);
4070
+ const result = def.valueType._zod.run({ value: input2[key], issues: [] }, ctx);
4069
4071
  if (result instanceof Promise) {
4070
4072
  proms.push(result.then((result2) => {
4071
4073
  if (result2.issues.length) {
@@ -4090,27 +4092,27 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
4090
4092
  var $ZodMap = /* @__PURE__ */ $constructor("$ZodMap", (inst, def) => {
4091
4093
  $ZodType.init(inst, def);
4092
4094
  inst._zod.parse = (payload, ctx) => {
4093
- const input = payload.value;
4094
- if (!(input instanceof Map)) {
4095
+ const input2 = payload.value;
4096
+ if (!(input2 instanceof Map)) {
4095
4097
  payload.issues.push({
4096
4098
  expected: "map",
4097
4099
  code: "invalid_type",
4098
- input,
4100
+ input: input2,
4099
4101
  inst
4100
4102
  });
4101
4103
  return payload;
4102
4104
  }
4103
4105
  const proms = [];
4104
4106
  payload.value = /* @__PURE__ */ new Map();
4105
- for (const [key, value] of input) {
4107
+ for (const [key, value] of input2) {
4106
4108
  const keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);
4107
4109
  const valueResult = def.valueType._zod.run({ value, issues: [] }, ctx);
4108
4110
  if (keyResult instanceof Promise || valueResult instanceof Promise) {
4109
4111
  proms.push(Promise.all([keyResult, valueResult]).then(([keyResult2, valueResult2]) => {
4110
- handleMapResult(keyResult2, valueResult2, payload, key, input, inst, ctx);
4112
+ handleMapResult(keyResult2, valueResult2, payload, key, input2, inst, ctx);
4111
4113
  }));
4112
4114
  } else {
4113
- handleMapResult(keyResult, valueResult, payload, key, input, inst, ctx);
4115
+ handleMapResult(keyResult, valueResult, payload, key, input2, inst, ctx);
4114
4116
  }
4115
4117
  }
4116
4118
  if (proms.length)
@@ -4118,7 +4120,7 @@ var $ZodMap = /* @__PURE__ */ $constructor("$ZodMap", (inst, def) => {
4118
4120
  return payload;
4119
4121
  };
4120
4122
  });
4121
- function handleMapResult(keyResult, valueResult, final, key, input, inst, ctx) {
4123
+ function handleMapResult(keyResult, valueResult, final, key, input2, inst, ctx) {
4122
4124
  if (keyResult.issues.length) {
4123
4125
  if (propertyKeyTypes.has(typeof key)) {
4124
4126
  final.issues.push(...prefixIssues(key, keyResult.issues));
@@ -4126,7 +4128,7 @@ function handleMapResult(keyResult, valueResult, final, key, input, inst, ctx) {
4126
4128
  final.issues.push({
4127
4129
  code: "invalid_key",
4128
4130
  origin: "map",
4129
- input,
4131
+ input: input2,
4130
4132
  inst,
4131
4133
  issues: keyResult.issues.map((iss) => finalizeIssue(iss, ctx, config()))
4132
4134
  });
@@ -4139,7 +4141,7 @@ function handleMapResult(keyResult, valueResult, final, key, input, inst, ctx) {
4139
4141
  final.issues.push({
4140
4142
  origin: "map",
4141
4143
  code: "invalid_element",
4142
- input,
4144
+ input: input2,
4143
4145
  inst,
4144
4146
  key,
4145
4147
  issues: valueResult.issues.map((iss) => finalizeIssue(iss, ctx, config()))
@@ -4151,10 +4153,10 @@ function handleMapResult(keyResult, valueResult, final, key, input, inst, ctx) {
4151
4153
  var $ZodSet = /* @__PURE__ */ $constructor("$ZodSet", (inst, def) => {
4152
4154
  $ZodType.init(inst, def);
4153
4155
  inst._zod.parse = (payload, ctx) => {
4154
- const input = payload.value;
4155
- if (!(input instanceof Set)) {
4156
+ const input2 = payload.value;
4157
+ if (!(input2 instanceof Set)) {
4156
4158
  payload.issues.push({
4157
- input,
4159
+ input: input2,
4158
4160
  inst,
4159
4161
  expected: "set",
4160
4162
  code: "invalid_type"
@@ -4163,7 +4165,7 @@ var $ZodSet = /* @__PURE__ */ $constructor("$ZodSet", (inst, def) => {
4163
4165
  }
4164
4166
  const proms = [];
4165
4167
  payload.value = /* @__PURE__ */ new Set();
4166
- for (const item of input) {
4168
+ for (const item of input2) {
4167
4169
  const result = def.valueType._zod.run({ value: item, issues: [] }, ctx);
4168
4170
  if (result instanceof Promise) {
4169
4171
  proms.push(result.then((result2) => handleSetResult(result2, payload)));
@@ -4188,14 +4190,14 @@ var $ZodEnum = /* @__PURE__ */ $constructor("$ZodEnum", (inst, def) => {
4188
4190
  inst._zod.values = valuesSet;
4189
4191
  inst._zod.pattern = new RegExp(`^(${values.filter((k) => propertyKeyTypes.has(typeof k)).map((o) => typeof o === "string" ? escapeRegex(o) : o.toString()).join("|")})$`);
4190
4192
  inst._zod.parse = (payload, _ctx) => {
4191
- const input = payload.value;
4192
- if (valuesSet.has(input)) {
4193
+ const input2 = payload.value;
4194
+ if (valuesSet.has(input2)) {
4193
4195
  return payload;
4194
4196
  }
4195
4197
  payload.issues.push({
4196
4198
  code: "invalid_value",
4197
4199
  values,
4198
- input,
4200
+ input: input2,
4199
4201
  inst
4200
4202
  });
4201
4203
  return payload;
@@ -4210,14 +4212,14 @@ var $ZodLiteral = /* @__PURE__ */ $constructor("$ZodLiteral", (inst, def) => {
4210
4212
  inst._zod.values = values;
4211
4213
  inst._zod.pattern = new RegExp(`^(${def.values.map((o) => typeof o === "string" ? escapeRegex(o) : o ? escapeRegex(o.toString()) : String(o)).join("|")})$`);
4212
4214
  inst._zod.parse = (payload, _ctx) => {
4213
- const input = payload.value;
4214
- if (values.has(input)) {
4215
+ const input2 = payload.value;
4216
+ if (values.has(input2)) {
4215
4217
  return payload;
4216
4218
  }
4217
4219
  payload.issues.push({
4218
4220
  code: "invalid_value",
4219
4221
  values: def.values,
4220
- input,
4222
+ input: input2,
4221
4223
  inst
4222
4224
  });
4223
4225
  return payload;
@@ -4226,13 +4228,13 @@ var $ZodLiteral = /* @__PURE__ */ $constructor("$ZodLiteral", (inst, def) => {
4226
4228
  var $ZodFile = /* @__PURE__ */ $constructor("$ZodFile", (inst, def) => {
4227
4229
  $ZodType.init(inst, def);
4228
4230
  inst._zod.parse = (payload, _ctx) => {
4229
- const input = payload.value;
4230
- if (input instanceof File)
4231
+ const input2 = payload.value;
4232
+ if (input2 instanceof File)
4231
4233
  return payload;
4232
4234
  payload.issues.push({
4233
4235
  expected: "file",
4234
4236
  code: "invalid_type",
4235
- input,
4237
+ input: input2,
4236
4238
  inst
4237
4239
  });
4238
4240
  return payload;
@@ -4262,8 +4264,8 @@ var $ZodTransform = /* @__PURE__ */ $constructor("$ZodTransform", (inst, def) =>
4262
4264
  return payload;
4263
4265
  };
4264
4266
  });
4265
- function handleOptionalResult(result, input) {
4266
- if (input === void 0 && (result.issues.length || result.fallback)) {
4267
+ function handleOptionalResult(result, input2) {
4268
+ if (input2 === void 0 && (result.issues.length || result.fallback)) {
4267
4269
  return { issues: [], value: void 0 };
4268
4270
  }
4269
4271
  return result;
@@ -4281,11 +4283,11 @@ var $ZodOptional = /* @__PURE__ */ $constructor("$ZodOptional", (inst, def) => {
4281
4283
  });
4282
4284
  inst._zod.parse = (payload, ctx) => {
4283
4285
  if (def.innerType._zod.optin === "optional") {
4284
- const input = payload.value;
4286
+ const input2 = payload.value;
4285
4287
  const result = def.innerType._zod.run(payload, ctx);
4286
4288
  if (result instanceof Promise)
4287
- return result.then((r) => handleOptionalResult(r, input));
4288
- return handleOptionalResult(result, input);
4289
+ return result.then((r) => handleOptionalResult(r, input2));
4290
+ return handleOptionalResult(result, input2);
4289
4291
  }
4290
4292
  if (payload.value === void 0) {
4291
4293
  return payload;
@@ -4710,20 +4712,20 @@ var $ZodCustom = /* @__PURE__ */ $constructor("$ZodCustom", (inst, def) => {
4710
4712
  return payload;
4711
4713
  };
4712
4714
  inst._zod.check = (payload) => {
4713
- const input = payload.value;
4714
- const r = def.fn(input);
4715
+ const input2 = payload.value;
4716
+ const r = def.fn(input2);
4715
4717
  if (r instanceof Promise) {
4716
- return r.then((r2) => handleRefineResult(r2, payload, input, inst));
4718
+ return r.then((r2) => handleRefineResult(r2, payload, input2, inst));
4717
4719
  }
4718
- handleRefineResult(r, payload, input, inst);
4720
+ handleRefineResult(r, payload, input2, inst);
4719
4721
  return;
4720
4722
  };
4721
4723
  });
4722
- function handleRefineResult(result, payload, input, inst) {
4724
+ function handleRefineResult(result, payload, input2, inst) {
4723
4725
  if (!result) {
4724
4726
  const _iss = {
4725
4727
  code: "custom",
4726
- input,
4728
+ input: input2,
4727
4729
  inst,
4728
4730
  // incorporates params.error into issue reporting
4729
4731
  path: [...inst._zod.def.path ?? []],
@@ -8010,8 +8012,8 @@ function ko_default() {
8010
8012
  }
8011
8013
 
8012
8014
  // ../../../node_modules/zod/v4/locales/lt.js
8013
- var capitalizeFirstCharacter = (text) => {
8014
- return text.charAt(0).toUpperCase() + text.slice(1);
8015
+ var capitalizeFirstCharacter = (text2) => {
8016
+ return text2.charAt(0).toUpperCase() + text2.slice(1);
8015
8017
  };
8016
8018
  function getUnitTypeFromNumber(number4) {
8017
8019
  const abs = Math.abs(number4);
@@ -11411,23 +11413,23 @@ function _overwrite(tx) {
11411
11413
  }
11412
11414
  // @__NO_SIDE_EFFECTS__
11413
11415
  function _normalize(form) {
11414
- return /* @__PURE__ */ _overwrite((input) => input.normalize(form));
11416
+ return /* @__PURE__ */ _overwrite((input2) => input2.normalize(form));
11415
11417
  }
11416
11418
  // @__NO_SIDE_EFFECTS__
11417
11419
  function _trim() {
11418
- return /* @__PURE__ */ _overwrite((input) => input.trim());
11420
+ return /* @__PURE__ */ _overwrite((input2) => input2.trim());
11419
11421
  }
11420
11422
  // @__NO_SIDE_EFFECTS__
11421
11423
  function _toLowerCase() {
11422
- return /* @__PURE__ */ _overwrite((input) => input.toLowerCase());
11424
+ return /* @__PURE__ */ _overwrite((input2) => input2.toLowerCase());
11423
11425
  }
11424
11426
  // @__NO_SIDE_EFFECTS__
11425
11427
  function _toUpperCase() {
11426
- return /* @__PURE__ */ _overwrite((input) => input.toUpperCase());
11428
+ return /* @__PURE__ */ _overwrite((input2) => input2.toUpperCase());
11427
11429
  }
11428
11430
  // @__NO_SIDE_EFFECTS__
11429
11431
  function _slugify() {
11430
- return /* @__PURE__ */ _overwrite((input) => slugify(input));
11432
+ return /* @__PURE__ */ _overwrite((input2) => slugify(input2));
11431
11433
  }
11432
11434
  // @__NO_SIDE_EFFECTS__
11433
11435
  function _array(Class2, element, params) {
@@ -11732,8 +11734,8 @@ function _stringbool(Classes, _params) {
11732
11734
  type: "pipe",
11733
11735
  in: stringSchema,
11734
11736
  out: booleanSchema,
11735
- transform: ((input, payload) => {
11736
- let data = input;
11737
+ transform: ((input2, payload) => {
11738
+ let data = input2;
11737
11739
  if (params.case !== "sensitive")
11738
11740
  data = data.toLowerCase();
11739
11741
  if (truthySet.has(data)) {
@@ -11752,8 +11754,8 @@ function _stringbool(Classes, _params) {
11752
11754
  return {};
11753
11755
  }
11754
11756
  }),
11755
- reverseTransform: ((input, _payload) => {
11756
- if (input === true) {
11757
+ reverseTransform: ((input2, _payload) => {
11758
+ if (input2 === true) {
11757
11759
  return truthyArray[0] || "true";
11758
11760
  } else {
11759
11761
  return falsyArray[0] || "false";
@@ -12649,9 +12651,9 @@ var allProcessors = {
12649
12651
  optional: optionalProcessor,
12650
12652
  lazy: lazyProcessor
12651
12653
  };
12652
- function toJSONSchema(input, params) {
12653
- if ("_idmap" in input) {
12654
- const registry2 = input;
12654
+ function toJSONSchema(input2, params) {
12655
+ if ("_idmap" in input2) {
12656
+ const registry2 = input2;
12655
12657
  const ctx2 = initializeContext({ ...params, processors: allProcessors });
12656
12658
  const defs = {};
12657
12659
  for (const entry of registry2._idmap.entries()) {
@@ -12679,9 +12681,9 @@ function toJSONSchema(input, params) {
12679
12681
  return { schemas };
12680
12682
  }
12681
12683
  const ctx = initializeContext({ ...params, processors: allProcessors });
12682
- process2(input, ctx);
12683
- extractDefs(ctx, input);
12684
- return finalize(ctx, input);
12684
+ process2(input2, ctx);
12685
+ extractDefs(ctx, input2);
12686
+ return finalize(ctx, input2);
12685
12687
  }
12686
12688
 
12687
12689
  // ../../../node_modules/zod/v4/core/json-schema-generator.js
@@ -14958,7 +14960,7 @@ var codexhostErrorSchema = external_exports.strictObject({
14958
14960
 
14959
14961
  // ../../shared-contracts/dist/harness-presentation.js
14960
14962
  var localeSchema = external_exports.string().max(64).regex(/^[a-z]{2,3}(?:-[A-Za-z0-9]{2,8})*$/u);
14961
- var displayText = (maximum) => external_exports.string().min(1).max(maximum).refine((text) => text.trim().length > 0);
14963
+ var displayText = (maximum) => external_exports.string().min(1).max(maximum).refine((text2) => text2.trim().length > 0);
14962
14964
  var harnessLocalizationsSchema = external_exports.record(localeSchema, external_exports.object({
14963
14965
  label: displayText(256).optional(),
14964
14966
  description: displayText(1024).optional()
@@ -15047,7 +15049,7 @@ var usageMeasurementsSchema = external_exports.object({
15047
15049
  outputTokensPerSecond: usageMeasurementSchema.refine((value) => value.version === 4).optional().catch(void 0),
15048
15050
  timeToFirstOutputMs: usageMeasurementSchema.extend({ value: nonNegativeSafeIntegerSchema }).optional()
15049
15051
  }).strict();
15050
- var indicatorTextSchema = (maximum) => harnessLocalizedTextSchema.refine((entries) => Object.values(entries).every((text) => text.length <= maximum));
15052
+ var indicatorTextSchema = (maximum) => harnessLocalizedTextSchema.refine((entries) => Object.values(entries).every((text2) => text2.length <= maximum));
15051
15053
  var composerIndicatorsSchema = external_exports.array(external_exports.object({
15052
15054
  kind: external_exports.literal("countdown"),
15053
15055
  id: external_exports.string().min(1).max(64),
@@ -15430,6 +15432,8 @@ var externalThreadInspectionSchema = external_exports.object({
15430
15432
  effectiveThinkingOptionId: harnessThinkingOptionIdSchema.optional(),
15431
15433
  availableThinkingOptions: harnessThinkingOptionsSchema.optional(),
15432
15434
  effectivePermissionModeId: harnessPermissionModeIdSchema.optional(),
15435
+ /** Live Session catalog when it, not the Adapter inspection, contains `effectiveModel`. */
15436
+ catalog: harnessModelCatalogSchema.optional(),
15433
15437
  history: harnessHistoryCapabilitiesSchema,
15434
15438
  usage: threadUsageSnapshotSchema.optional(),
15435
15439
  locked: external_exports.literal(true)
@@ -15488,9 +15492,9 @@ var threadSteeringInspectParamsSchema = external_exports.object({
15488
15492
  }).strict();
15489
15493
  var threadSteeringContextSchema = external_exports.object({
15490
15494
  kind: external_exports.literal("application"),
15491
- value: external_exports.string().transform((text, context) => {
15495
+ value: external_exports.string().transform((text2, context) => {
15492
15496
  try {
15493
- return JSON.parse(text);
15497
+ return JSON.parse(text2);
15494
15498
  } catch {
15495
15499
  context.addIssue({ code: "custom", message: "Invalid steering context JSON" });
15496
15500
  return external_exports.NEVER;
@@ -15625,8 +15629,8 @@ var desktopExtensionHttpUrlSchema = external_exports.string().trim().max(2048).r
15625
15629
  const { username, password } = new URL(value);
15626
15630
  return !username && !password && !/[\\\s]/u.test(value);
15627
15631
  }, "URL must not contain credentials, backslashes, or whitespace");
15628
- function localizedText(text) {
15629
- return external_exports.strictObject({ en: text, "zh-CN": text });
15632
+ function localizedText(text2) {
15633
+ return external_exports.strictObject({ en: text2, "zh-CN": text2 });
15630
15634
  }
15631
15635
  var desktopExtensionLocalizedTextSchema = localizedText(external_exports.string().trim().min(1));
15632
15636
  var categoriesSchema = external_exports.array(desktopExtensionCategorySchema).max(desktopExtensionCategorySchema.options.length).refine((categories) => new Set(categories).size === categories.length, "Duplicate categories");
@@ -15743,8 +15747,8 @@ var desktopExtensionTrustTierSchema = external_exports.enum(["official", "commun
15743
15747
  function isGitHubDesktopExtensionZipballUrl(url2) {
15744
15748
  return url2.origin === "https://api.github.com" && /^\/repos\/[\w-]+\/[\w.-]+\/zipball(?:\/[^/]+)?\/?$/u.test(url2.pathname);
15745
15749
  }
15746
- var desktopExtensionZipUrlSchema = desktopExtensionHttpUrlSchema.refine((input) => {
15747
- const url2 = new URL(input);
15750
+ var desktopExtensionZipUrlSchema = desktopExtensionHttpUrlSchema.refine((input2) => {
15751
+ const url2 = new URL(input2);
15748
15752
  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);
15749
15753
  }, "Expected a .zip download URL or a GitHub zipball URL");
15750
15754
  var desktopExtensionCatalogEntrySchema = external_exports.strictObject({
@@ -16095,6 +16099,8 @@ var CLIENT_CHANNEL_METHODS = [
16095
16099
  "codexhost/workspace/read",
16096
16100
  "codexhost/thread/tree/read",
16097
16101
  "codexhost/thread/pins/list",
16102
+ "codexhost/thread/sections/list",
16103
+ "codexhost/thread/sections/move",
16098
16104
  "codexhost/thread/pins/set",
16099
16105
  "codexhost/harness/plugins/list",
16100
16106
  "codexhost/harness/inspect",
@@ -16133,8 +16139,21 @@ var CLIENT_CHANNEL_METHODS = [
16133
16139
  "codexhost/update/check",
16134
16140
  "codexhost/update/start",
16135
16141
  "codexhost/update/status",
16142
+ "codexhost/announcement/get",
16143
+ "codexhost/announcement/acknowledge",
16136
16144
  "codexhost/sessions/loaded/list"
16137
16145
  ];
16146
+ var clientThreadSectionsSchema = external_exports.object({
16147
+ sections: external_exports.array(external_exports.object({
16148
+ id: external_exports.string().min(1),
16149
+ name: external_exports.string().min(1),
16150
+ threads: external_exports.array(jsonObjectSchema)
16151
+ }).strict())
16152
+ }).strict();
16153
+ var clientThreadSectionMoveSchema = external_exports.object({
16154
+ threadId: external_exports.string().min(1).max(1024),
16155
+ sectionId: external_exports.string().min(1).max(1024).nullable()
16156
+ }).strict();
16138
16157
  var clientThreadPinsSchema = external_exports.object({ threadIds: external_exports.array(external_exports.string().min(1)) }).strict();
16139
16158
  var clientThreadPinParamsSchema = external_exports.object({ threadId: external_exports.string().min(1).max(1024), pinned: external_exports.boolean() }).strict();
16140
16159
  var clientThreadTreeReadParamsSchema = external_exports.object({}).strict();
@@ -16676,8 +16695,8 @@ var harnessPreferencePatchSchema = external_exports.strictObject({
16676
16695
  operations: external_exports.array(harnessPreferenceOperationSchema).min(1).max(256),
16677
16696
  initializeOnly: external_exports.boolean().optional(),
16678
16697
  expectedRevision: external_exports.number().int().nonnegative().optional()
16679
- }).superRefine((input, ctx) => {
16680
- for (const operation of input.operations) {
16698
+ }).superRefine((input2, ctx) => {
16699
+ for (const operation of input2.operations) {
16681
16700
  if (operation.kind === "newThread" && (!operation.lastHarness && !operation.configuration || Boolean(operation.harnessId) !== Boolean(operation.configuration)))
16682
16701
  ctx.addIssue({
16683
16702
  code: "custom",
@@ -17079,13 +17098,18 @@ var harnessLaunchSettingsSchema = external_exports.object({
17079
17098
  // ../../shared-contracts/dist/harness-installation.js
17080
17099
  var harnessInstallationParamsSchema = external_exports.object({
17081
17100
  harnessId: harnessIdSchema,
17082
- action: external_exports.enum(["check", "update", "install"])
17083
- }).strict();
17101
+ action: external_exports.enum(["check", "update", "install"]),
17102
+ confirmedVersion: external_exports.string().min(1).max(128).optional()
17103
+ }).strict().refine(({ action, confirmedVersion }) => action === "update" || confirmedVersion === void 0);
17084
17104
  var harnessInstallationStateSchema = external_exports.object({
17085
17105
  currentVersion: external_exports.string().min(1).max(128),
17086
17106
  latestVersion: external_exports.string().min(1).max(128),
17087
17107
  updateAvailable: external_exports.boolean(),
17088
17108
  canUpdate: external_exports.boolean(),
17109
+ /** Present when the Adapter has a verified list and the available target is outside it. */
17110
+ latestVerifiedVersion: external_exports.string().min(1).max(128).optional(),
17111
+ /** Update preflight stopped before running the installer; latestVersion needs confirmation. */
17112
+ confirmationRequired: external_exports.literal(true).optional(),
17089
17113
  /** Defaults to CLI; some Harnesses ship only inside a desktop application. */
17090
17114
  versionKind: external_exports.enum(["cli", "application"]).optional(),
17091
17115
  /** Official download opened by the user; does not imply an automatic installation. */
@@ -17415,6 +17439,38 @@ var updateStatusResultSchema = external_exports.strictObject({
17415
17439
  status: updateStatusSchema.nullable()
17416
17440
  });
17417
17441
 
17442
+ // ../../shared-contracts/dist/release-announcement.js
17443
+ var RELEASE_ANNOUNCEMENT_MAX_THEMES = 12;
17444
+ var releaseAnnouncementThemeSchema = external_exports.strictObject({
17445
+ icon: external_exports.string().min(1).max(16).optional(),
17446
+ title: external_exports.string().min(1).max(120),
17447
+ body: external_exports.string().min(1).max(1200),
17448
+ contributors: external_exports.array(external_exports.string().min(1).max(39)).max(30)
17449
+ });
17450
+ var releaseAnnouncementContentSchema = external_exports.strictObject({
17451
+ summary: external_exports.string().min(1).max(600).optional(),
17452
+ themes: external_exports.array(releaseAnnouncementThemeSchema).min(1).max(RELEASE_ANNOUNCEMENT_MAX_THEMES)
17453
+ });
17454
+ var releaseAnnouncementSchema = external_exports.strictObject({
17455
+ version: updateSemanticVersionSchema,
17456
+ publishedAt: external_exports.iso.datetime(),
17457
+ url: external_exports.string().max(300).regex(/^https:\/\/github\.com\/BytePioneer-AI\/codex-host\/releases\/tag\/v[0-9A-Za-z.+-]+$/u),
17458
+ zh: releaseAnnouncementContentSchema.nullable(),
17459
+ en: releaseAnnouncementContentSchema.nullable()
17460
+ }).refine((value) => value.zh !== null || value.en !== null, {
17461
+ message: "an announcement needs at least one language"
17462
+ });
17463
+ var releaseAnnouncementGetParamsSchema = external_exports.strictObject({
17464
+ manual: external_exports.boolean().optional()
17465
+ });
17466
+ var releaseAnnouncementGetResultSchema = external_exports.strictObject({
17467
+ announcement: releaseAnnouncementSchema.nullable(),
17468
+ unread: external_exports.boolean()
17469
+ });
17470
+ var releaseAnnouncementAcknowledgeParamsSchema = external_exports.strictObject({
17471
+ version: updateSemanticVersionSchema
17472
+ });
17473
+
17418
17474
  // ../../shared-contracts/dist/thread-watch-notice.js
17419
17475
  var THREAD_WATCH_NOTICE_OUTCOMES = [
17420
17476
  "completed",
@@ -17462,17 +17518,67 @@ var remoteSshSetupResultSchema = external_exports.object({ state: external_expor
17462
17518
 
17463
17519
  // ../../shared-contracts/dist/remote-sessions.js
17464
17520
  var REMOTE_CONTROLLER_REQUEST_MAX_BYTES = 16 * 1024;
17465
- var identity = external_exports.string().min(1).max(1024);
17521
+ var REMOTE_IDENTITY_MAX_LENGTH = 1024;
17522
+ var identity = external_exports.string().min(1).max(REMOTE_IDENTITY_MAX_LENGTH);
17466
17523
  var target = { hostId: identity.regex(/^remote-(?:ssh(?:-|:)|control:)/u) };
17467
17524
  var thread = { ...target, threadId: identity };
17525
+ var text = external_exports.string().min(1).max(8e3);
17526
+ var input = { text, requestId: identity };
17527
+ var remoteDeliveryReplySchema = external_exports.discriminatedUnion("accepted", [
17528
+ external_exports.object({ accepted: external_exports.literal(true), startQueuedItemId: identity.optional() }),
17529
+ external_exports.object({
17530
+ accepted: external_exports.literal(false),
17531
+ code: external_exports.enum([
17532
+ "remote/queue-unavailable",
17533
+ "remote/steer-unavailable",
17534
+ "remote/turn-changed",
17535
+ "remote/send-rejected",
17536
+ "session/queue-item-not-found",
17537
+ "session/queue-item-starting"
17538
+ ]),
17539
+ message: external_exports.string()
17540
+ })
17541
+ ]);
17542
+ var remoteQueueSnapshotSchema = external_exports.discriminatedUnion("available", [
17543
+ external_exports.object({ available: external_exports.literal(false) }),
17544
+ external_exports.object({
17545
+ available: external_exports.literal(true),
17546
+ items: external_exports.array(external_exports.object({ id: identity, clientUserMessageId: identity, preview: external_exports.string().max(801) })).max(100)
17547
+ })
17548
+ ]);
17468
17549
  var remoteSessionOperationSchema = external_exports.discriminatedUnion("kind", [
17469
17550
  external_exports.strictObject({ kind: external_exports.literal("hosts") }),
17551
+ external_exports.strictObject({
17552
+ kind: external_exports.literal("create"),
17553
+ ...target,
17554
+ cwd: external_exports.string().min(1).max(8192),
17555
+ epoch: identity
17556
+ }),
17557
+ external_exports.strictObject({ kind: external_exports.literal("projectHarnesses"), ...target, epoch: identity }),
17558
+ external_exports.strictObject({
17559
+ kind: external_exports.literal("inspectHarness"),
17560
+ ...target,
17561
+ epoch: identity,
17562
+ cwd: external_exports.string().min(1).max(8192),
17563
+ harnessId: identity
17564
+ }),
17565
+ external_exports.strictObject({
17566
+ kind: external_exports.literal("startSelected"),
17567
+ ...target,
17568
+ epoch: identity,
17569
+ cwd: external_exports.string().min(1).max(8192),
17570
+ harnessId: identity,
17571
+ model: external_exports.string().min(1).max(4096),
17572
+ serviceTier: external_exports.enum(["priority", "ultrafast"]).optional(),
17573
+ reasoningEffort: identity.optional()
17574
+ }),
17470
17575
  external_exports.strictObject({ kind: external_exports.literal("status"), ...thread }),
17471
17576
  external_exports.strictObject({
17472
17577
  kind: external_exports.literal("list"),
17473
17578
  ...target,
17474
17579
  cursor: external_exports.string().nullable(),
17475
- archived: external_exports.boolean()
17580
+ archived: external_exports.boolean(),
17581
+ includeLoaded: external_exports.literal(true).optional()
17476
17582
  }),
17477
17583
  external_exports.strictObject({
17478
17584
  kind: external_exports.literal("read"),
@@ -17502,9 +17608,25 @@ var remoteSessionOperationSchema = external_exports.discriminatedUnion("kind", [
17502
17608
  kind: external_exports.literal("prompt"),
17503
17609
  ...thread,
17504
17610
  epoch: identity,
17505
- text: external_exports.string().min(1).max(8e3),
17611
+ text,
17506
17612
  requestId: identity.optional()
17507
17613
  }),
17614
+ external_exports.strictObject({ kind: external_exports.literal("queue"), ...thread, epoch: identity }),
17615
+ external_exports.strictObject({
17616
+ kind: external_exports.literal("delivery"),
17617
+ ...thread,
17618
+ epoch: identity,
17619
+ action: external_exports.discriminatedUnion("kind", [
17620
+ external_exports.strictObject({ kind: external_exports.literal("enqueue"), ...input }),
17621
+ external_exports.strictObject({ kind: external_exports.literal("steer"), ...input, turnId: identity }),
17622
+ external_exports.strictObject({ kind: external_exports.literal("remove"), itemId: identity }),
17623
+ external_exports.strictObject({
17624
+ kind: external_exports.literal("start"),
17625
+ itemId: identity,
17626
+ onlyIfHead: external_exports.literal(true).optional()
17627
+ })
17628
+ ])
17629
+ }),
17508
17630
  external_exports.strictObject({ kind: external_exports.literal("interrupt"), ...thread, epoch: identity, turnId: identity }),
17509
17631
  external_exports.strictObject({
17510
17632
  kind: external_exports.literal("rename"),
@@ -17977,9 +18099,9 @@ function subagentConfiguration(value) {
17977
18099
  if (typeof value !== "object" || value === null || Array.isArray(value))
17978
18100
  return {};
17979
18101
  const row = value;
17980
- const text = (value2) => typeof value2 === "string" && value2.trim() ? value2 : void 0;
17981
- const model2 = row.model === "inherit" ? void 0 : text(row.model);
17982
- const reasoningEffort = text(row.reasoningEffort) ?? text(row.reasoning_effort) ?? text(row.thinking);
18102
+ const text2 = (value2) => typeof value2 === "string" && value2.trim() ? value2 : void 0;
18103
+ const model2 = row.model === "inherit" ? void 0 : text2(row.model);
18104
+ const reasoningEffort = text2(row.reasoningEffort) ?? text2(row.reasoning_effort) ?? text2(row.thinking);
17983
18105
  return { ...model2 ? { model: model2 } : {}, ...reasoningEffort ? { reasoningEffort } : {} };
17984
18106
  }
17985
18107
  function inheritSubagentConfiguration(child, parent) {
@@ -18072,8 +18194,8 @@ function cursorCommandPrompt(command, catalog) {
18072
18194
  retryable: false
18073
18195
  }
18074
18196
  };
18075
- const text = typeof args?.text === "string" ? args.text.trim() : "";
18076
- return { ok: true, value: `${descriptor.invocation}${text ? ` ${text}` : ""}` };
18197
+ const text2 = typeof args?.text === "string" ? args.text.trim() : "";
18198
+ return { ok: true, value: `${descriptor.invocation}${text2 ? ` ${text2}` : ""}` };
18077
18199
  }
18078
18200
 
18079
18201
  // dist/command.js
@@ -18097,14 +18219,14 @@ function cursorDiscoverySpec(skipPinnedVersions) {
18097
18219
  var CursorNotInstalledError = class extends Error {
18098
18220
  };
18099
18221
  function resolveCursorExecutable(environment, command) {
18100
- const input = { environment, ...command ? { command } : {} };
18101
- const pinned = resolveHarnessExecutable(cursorDiscoverySpec(false), input);
18222
+ const input2 = { environment, ...command ? { command } : {} };
18223
+ const pinned = resolveHarnessExecutable(cursorDiscoverySpec(false), input2);
18102
18224
  if (!pinned)
18103
18225
  throw new CursorNotInstalledError("Cursor CLI is not installed; install cursor-agent or set CODEXHOST_CURSOR_COMMAND");
18104
18226
  const explicit = command?.trim() || environment.CODEXHOST_CURSOR_COMMAND?.trim();
18105
18227
  if (explicit || !PINNED_VERSION_AGENT.test(pinned.executable))
18106
18228
  return pinned;
18107
- return resolveHarnessExecutable(cursorDiscoverySpec(true), input) ?? pinned;
18229
+ return resolveHarnessExecutable(cursorDiscoverySpec(true), input2) ?? pinned;
18108
18230
  }
18109
18231
  function cursorInvocation(environment, command, args) {
18110
18232
  const resolution = resolveCursorExecutable(environment, command);
@@ -18210,17 +18332,17 @@ async function accessToken(environment) {
18210
18332
  const auth = record3(JSON.parse(await readFile(authPath, "utf8")));
18211
18333
  return typeof auth.accessToken === "string" && auth.accessToken.trim() ? auth.accessToken : void 0;
18212
18334
  }
18213
- async function fetchCursorAccount(input = {}) {
18335
+ async function fetchCursorAccount(input2 = {}) {
18214
18336
  try {
18215
- const environment = input.environment ?? process.env;
18337
+ const environment = input2.environment ?? process.env;
18216
18338
  if (environment.CURSOR_API_KEY?.trim() || environment.AGENT_CLI_CREDENTIAL_STORE === "memory")
18217
18339
  return null;
18218
- const token = await (input.readAccessToken ? input.readAccessToken() : accessToken(environment));
18340
+ const token = await (input2.readAccessToken ? input2.readAccessToken() : accessToken(environment));
18219
18341
  if (!token)
18220
18342
  return null;
18221
- const signal = input.signal ? AbortSignal.any([input.signal, AbortSignal.timeout(1e4)]) : AbortSignal.timeout(1e4);
18343
+ const signal = input2.signal ? AbortSignal.any([input2.signal, AbortSignal.timeout(1e4)]) : AbortSignal.timeout(1e4);
18222
18344
  const request = async (method) => {
18223
- const response = await (input.fetch ?? fetch)(ENDPOINT + method, {
18345
+ const response = await (input2.fetch ?? fetch)(ENDPOINT + method, {
18224
18346
  method: "POST",
18225
18347
  headers: {
18226
18348
  Authorization: `Bearer ${token}`,
@@ -18273,15 +18395,15 @@ function sessionImportTitle(value, maxLength = HARNESS_SESSION_IMPORT_TITLE_MAX_
18273
18395
  return normalized;
18274
18396
  return `${characters.slice(0, maxLength - 1).join("").trimEnd()}…`;
18275
18397
  }
18276
- function sessionImportCandidate(input) {
18277
- const time3 = typeof input.updatedAt === "number" ? input.updatedAt : typeof input.updatedAt === "string" ? Date.parse(input.updatedAt) : Number.NaN;
18398
+ function sessionImportCandidate(input2) {
18399
+ const time3 = typeof input2.updatedAt === "number" ? input2.updatedAt : typeof input2.updatedAt === "string" ? Date.parse(input2.updatedAt) : Number.NaN;
18278
18400
  const parsed = harnessSessionImportCandidateSchema.safeParse({
18279
- nativeSessionId: input.nativeSessionId,
18280
- cwd: input.cwd,
18281
- title: typeof input.title === "string" && input.title.trim().length > 0 ? input.title : null,
18401
+ nativeSessionId: input2.nativeSessionId,
18402
+ cwd: input2.cwd,
18403
+ title: typeof input2.title === "string" && input2.title.trim().length > 0 ? input2.title : null,
18282
18404
  updatedAt: Math.floor(time3),
18283
18405
  // Unknown must stay unknown; only an explicit boolean is a native statement.
18284
- running: typeof input.running === "boolean" ? input.running : null
18406
+ running: typeof input2.running === "boolean" ? input2.running : null
18285
18407
  });
18286
18408
  return parsed.success ? parsed.data : null;
18287
18409
  }
@@ -18726,6 +18848,12 @@ function cursorModels(info) {
18726
18848
  const models = option.options.flatMap((entry) => "value" in entry ? [entry] : entry.options);
18727
18849
  return { models, current: option.currentValue };
18728
18850
  }
18851
+ function isCursorFastOption(option) {
18852
+ if (option.id !== "fast" || option.category !== "model_config" || option.type !== "select")
18853
+ return false;
18854
+ const values = option.options.flatMap((entry) => "value" in entry ? [entry.value] : entry.options.map(({ value }) => value));
18855
+ return values.includes("true") && values.includes("false");
18856
+ }
18729
18857
  function cursorCatalog(info) {
18730
18858
  const native = cursorModels(info);
18731
18859
  const thinking = /* @__PURE__ */ new Map();
@@ -18735,12 +18863,12 @@ function cursorCatalog(info) {
18735
18863
  const options = cursorThinking(config2);
18736
18864
  for (const { id: id2, label } of options)
18737
18865
  thinking.set(id2, { id: id2, label });
18866
+ const fast = config2?.find(isCursorFastOption);
18867
+ const pinned = live ? config2 : fast ? [fast] : void 0;
18868
+ const withFast = (value) => cursorConfiguredModelRef(model2.value, pinned?.map((option) => option === fast ? { ...option, currentValue: value } : option));
18738
18869
  return {
18739
- // Only the live model's parameters reflect the user's Cursor settings. The parameterized
18740
- // catalog reports Cursor's built-in defaults for every other model (for example
18741
- // `fast=true`), so pinning them would override the user's remembered per-model parameters.
18742
- // A bare Ref selects only the model and lets Cursor apply those parameters itself.
18743
- ref: live ? cursorConfiguredModelRef(model2.value, config2) : cursorModelRef(model2.value),
18870
+ ref: fast ? withFast("false") : live ? cursorConfiguredModelRef(model2.value, config2) : cursorModelRef(model2.value),
18871
+ ...fast ? { fastModel: withFast("true") } : {},
18744
18872
  label: model2.name,
18745
18873
  supportedThinkingOptionIds: options.map(({ id: id2 }) => id2)
18746
18874
  };
@@ -18755,10 +18883,10 @@ function cursorCatalog(info) {
18755
18883
  ...current ? { defaultThinkingOptionId: current } : {}
18756
18884
  };
18757
18885
  }
18758
- function parseCursorNativeModels(input) {
18759
- if (!Array.isArray(input.models))
18886
+ function parseCursorNativeModels(input2) {
18887
+ if (!Array.isArray(input2.models))
18760
18888
  throw new Error("Cursor returned no parameterized model catalog");
18761
- return input.models.map((model2) => {
18889
+ return input2.models.map((model2) => {
18762
18890
  if (typeof model2 !== "object" || model2 === null || !("value" in model2) || !("name" in model2) || !("configOptions" in model2) || typeof model2.value !== "string" || typeof model2.name !== "string" || !Array.isArray(model2.configOptions))
18763
18891
  throw new Error("Invalid Cursor model metadata");
18764
18892
  return {
@@ -21514,7 +21642,7 @@ var LineBuffer = class {
21514
21642
  };
21515
21643
 
21516
21644
  // ../../../node_modules/@agentclientprotocol/sdk/dist/stream.js
21517
- function ndJsonStream(output, input) {
21645
+ function ndJsonStream(output, input2) {
21518
21646
  const textEncoder = new TextEncoder();
21519
21647
  const textDecoder = new TextDecoder();
21520
21648
  let cancelled = false;
@@ -21537,7 +21665,7 @@ function ndJsonStream(output, input) {
21537
21665
  }
21538
21666
  }
21539
21667
  };
21540
- const reader = input.getReader();
21668
+ const reader = input2.getReader();
21541
21669
  inputReader = reader;
21542
21670
  try {
21543
21671
  while (true) {
@@ -21620,8 +21748,8 @@ var zGuardCreateElicitationResponseCancel = object({
21620
21748
  });
21621
21749
 
21622
21750
  // ../../../node_modules/@agentclientprotocol/sdk/dist/acp.js
21623
- function ndJsonStream2(output, input) {
21624
- return ndJsonStream(output, input);
21751
+ function ndJsonStream2(output, input2) {
21752
+ return ndJsonStream(output, input2);
21625
21753
  }
21626
21754
  function emptyObjectResponse(response) {
21627
21755
  return response ?? {};
@@ -23135,13 +23263,13 @@ var CursorTransport = class {
23135
23263
  throw new Error("Cursor session is not open");
23136
23264
  return this.#bounded(this.#connection.setSessionConfigOption({ sessionId: this.sessionId, configId, value }));
23137
23265
  }
23138
- async prompt(text, callbacks) {
23266
+ async prompt(text2, callbacks) {
23139
23267
  if (!this.#connection || this.#closed || this.#callbacks)
23140
23268
  throw new Error("Cursor session is closed or busy");
23141
23269
  this.#callbacks = callbacks;
23142
23270
  try {
23143
23271
  return await Promise.race([
23144
- this.#connection.prompt({ sessionId: this.sessionId, prompt: [{ type: "text", text }] }),
23272
+ this.#connection.prompt({ sessionId: this.sessionId, prompt: [{ type: "text", text: text2 }] }),
23145
23273
  this.#failed
23146
23274
  ]);
23147
23275
  } finally {
@@ -23617,9 +23745,9 @@ function createTwoFilesPatch(oldFileName, newFileName, oldStr, newStr, oldHeader
23617
23745
  } }));
23618
23746
  }
23619
23747
  }
23620
- function splitLines(text) {
23621
- const hasTrailingNl = text.endsWith("\n");
23622
- const result = text.split("\n").map((line) => line + "\n");
23748
+ function splitLines(text2) {
23749
+ const hasTrailingNl = text2.endsWith("\n");
23750
+ const result = text2.split("\n").map((line) => line + "\n");
23623
23751
  if (hasTrailingNl) {
23624
23752
  result.pop();
23625
23753
  } else {
@@ -23632,8 +23760,8 @@ function splitLines(text) {
23632
23760
  import { createHash } from "node:crypto";
23633
23761
  var obj = (v) => typeof v === "object" && v !== null && !Array.isArray(v) ? v : {};
23634
23762
  var str = (v) => typeof v === "string" ? v : "";
23635
- function cursorTaskHandle(turnIndex, taskIndex, input) {
23636
- const args = obj(input);
23763
+ function cursorTaskHandle(turnIndex, taskIndex, input2) {
23764
+ const args = obj(input2);
23637
23765
  const digest = createHash("sha256").update(JSON.stringify([str(args.description), str(args.prompt)])).digest("hex").slice(0, 24);
23638
23766
  const handle = `task.v1.${turnIndex}.${taskIndex}.${digest}`;
23639
23767
  cursorTaskAddress(handle);
@@ -23651,8 +23779,8 @@ function role(value) {
23651
23779
  const fields = Object.keys(obj(value));
23652
23780
  return fields.length === 1 ? fields[0] : void 0;
23653
23781
  }
23654
- function cursorDelegation(nativeId, input) {
23655
- const args = obj(input), name = role(args.subagentType);
23782
+ function cursorDelegation(nativeId, input2) {
23783
+ const args = obj(input2), name = role(args.subagentType);
23656
23784
  return {
23657
23785
  type: "subagentDelegation",
23658
23786
  itemId: hostItemIdSchema.parse(`cursor-${nativeId}`),
@@ -23853,26 +23981,26 @@ var LONGEST_PREFIX = Math.max(...CLOSED_PREFIXES.map((prefix) => prefix.length))
23853
23981
  function isCursorWritableIterableClosed(message) {
23854
23982
  return /WritableIterable is closed/iu.test(message);
23855
23983
  }
23856
- function takeCursorWritableIterableClosed(text, atMessageStart = true) {
23857
- const match = text.match(CLOSED_ERROR);
23858
- if (!match || match.index === void 0 || match.index === 0 && !text.startsWith("\n\n") && !atMessageStart)
23859
- return { visible: text, closed: false };
23860
- return { visible: text.slice(0, match.index), closed: true };
23984
+ function takeCursorWritableIterableClosed(text2, atMessageStart = true) {
23985
+ const match = text2.match(CLOSED_ERROR);
23986
+ if (!match || match.index === void 0 || match.index === 0 && !text2.startsWith("\n\n") && !atMessageStart)
23987
+ return { visible: text2, closed: false };
23988
+ return { visible: text2.slice(0, match.index), closed: true };
23861
23989
  }
23862
- function holdCursorWritableIterablePrefix(text, atMessageStart = true) {
23863
- const taken = takeCursorWritableIterableClosed(text, atMessageStart);
23990
+ function holdCursorWritableIterablePrefix(text2, atMessageStart = true) {
23991
+ const taken = takeCursorWritableIterableClosed(text2, atMessageStart);
23864
23992
  if (taken.closed)
23865
- return { emit: taken.visible, hold: text.slice(taken.visible.length) };
23866
- for (let size = Math.min(text.length, LONGEST_PREFIX); size > 0; size -= 1) {
23867
- const suffix = text.slice(-size);
23868
- const start = text.length - size;
23869
- if (!suffix.startsWith("\n") && !(start === 0 && atMessageStart) && text.slice(Math.max(0, start - 2), start) !== "\n\n")
23993
+ return { emit: taken.visible, hold: text2.slice(taken.visible.length) };
23994
+ for (let size = Math.min(text2.length, LONGEST_PREFIX); size > 0; size -= 1) {
23995
+ const suffix = text2.slice(-size);
23996
+ const start = text2.length - size;
23997
+ if (!suffix.startsWith("\n") && !(start === 0 && atMessageStart) && text2.slice(Math.max(0, start - 2), start) !== "\n\n")
23870
23998
  continue;
23871
23999
  if (CLOSED_PREFIXES.some((candidate) => candidate.startsWith(suffix))) {
23872
- return { emit: text.slice(0, -size), hold: suffix };
24000
+ return { emit: text2.slice(0, -size), hold: suffix };
23873
24001
  }
23874
24002
  }
23875
- return { emit: text, hold: "" };
24003
+ return { emit: text2, hold: "" };
23876
24004
  }
23877
24005
 
23878
24006
  // dist/projection.js
@@ -23931,10 +24059,10 @@ var CursorTurnOutput = class {
23931
24059
  this.#hold = "";
23932
24060
  this.#appendText("agentMessage", held);
23933
24061
  }
23934
- #appendText(type, text) {
23935
- if (!text)
24062
+ #appendText(type, text2) {
24063
+ if (!text2)
23936
24064
  return;
23937
- if (type === "agentMessage" && text.trim())
24065
+ if (type === "agentMessage" && text2.trim())
23938
24066
  this.#visibleAssistantText = true;
23939
24067
  if (this.#text?.type !== type) {
23940
24068
  this.#finishText();
@@ -23948,12 +24076,12 @@ var CursorTurnOutput = class {
23948
24076
  }
23949
24077
  if (!this.#text)
23950
24078
  return;
23951
- this.#text.text += text;
24079
+ this.#text.text += text2;
23952
24080
  this.emit({
23953
24081
  type: "item.updated",
23954
24082
  turnId: this.turnId,
23955
24083
  itemId: this.#text.itemId,
23956
- update: { type: "text.append", text }
24084
+ update: { type: "text.append", text: text2 }
23957
24085
  });
23958
24086
  }
23959
24087
  #finishText(outcome = { status: "succeeded" }) {
@@ -24003,11 +24131,11 @@ var CursorTurnOutput = class {
24003
24131
  const { item } = tool;
24004
24132
  if (update.content != null) {
24005
24133
  tool.changes = cursorFileChanges(update.content);
24006
- const text = update.content.flatMap((content) => content.type === "content" && content.content.type === "text" ? [content.content.text] : content.type === "diff" ? [`${content.path}
24134
+ const text2 = update.content.flatMap((content) => content.type === "content" && content.content.type === "text" ? [content.content.text] : content.type === "diff" ? [`${content.path}
24007
24135
  ${content.newText}`] : []).join("\n");
24008
24136
  item.output = {
24009
- content: [{ type: "text", text: text.slice(0, TOOL_OUTPUT_LIMIT) }],
24010
- truncated: text.length > TOOL_OUTPUT_LIMIT
24137
+ content: [{ type: "text", text: text2.slice(0, TOOL_OUTPUT_LIMIT) }],
24138
+ truncated: text2.length > TOOL_OUTPUT_LIMIT
24011
24139
  };
24012
24140
  this.emit({
24013
24141
  type: "item.updated",
@@ -24288,7 +24416,7 @@ import { backup, DatabaseSync as DatabaseSync2 } from "node:sqlite";
24288
24416
  // dist/fork-terminal.js
24289
24417
  import { spawn as spawn2 } from "node:child_process";
24290
24418
  import { setTimeout as delay } from "node:timers/promises";
24291
- var quote = (text) => `'${text.replaceAll("'", "'\\''")}'`;
24419
+ var quote = (text2) => `'${text2.replaceAll("'", "'\\''")}'`;
24292
24420
  async function runCursorForkTerminal(options, sessionId, signal, rewind) {
24293
24421
  signal.throwIfAborted();
24294
24422
  const invocation = cursorInvocation(options.environment, options.command, [
@@ -24341,9 +24469,9 @@ async function runCursorForkTerminal(options, sessionId, signal, rewind) {
24341
24469
  await delay(50);
24342
24470
  }
24343
24471
  };
24344
- const send = (text) => {
24472
+ const send = (text2) => {
24345
24473
  tail = "";
24346
- child.stdin.write(text);
24474
+ child.stdin.write(text2);
24347
24475
  };
24348
24476
  const submitCommand = async (name, description) => {
24349
24477
  send(name);
@@ -24646,15 +24774,15 @@ var CursorAdapter = class {
24646
24774
  ...this.options.timeoutMs ? { timeoutMs: this.options.timeoutMs } : {}
24647
24775
  };
24648
24776
  }
24649
- async inspect(input = {}) {
24777
+ async inspect(input2 = {}) {
24650
24778
  if (this.#closed)
24651
24779
  return {
24652
24780
  status: "unavailable",
24653
24781
  error: { code: "unavailable", message: "Cursor adapter is closed", retryable: false }
24654
24782
  };
24655
- const cwd = path9.resolve(input.cwd ?? process.cwd());
24783
+ const cwd = path9.resolve(input2.cwd ?? process.cwd());
24656
24784
  const cached2 = this.#inspections.get(cwd);
24657
- if (input.refresh) {
24785
+ if (input2.refresh) {
24658
24786
  this.#inspections.clear();
24659
24787
  if (cached2 && this.#inspectionTasks.has(cached2))
24660
24788
  this.#inspections.set(cwd, cached2);
@@ -24687,12 +24815,12 @@ var CursorAdapter = class {
24687
24815
  void result.finally(() => this.#inspectionTasks.delete(result));
24688
24816
  return result;
24689
24817
  }
24690
- async open(input) {
24818
+ async open(input2) {
24691
24819
  if (this.#closed)
24692
24820
  return rejected("invalidState", "Cursor adapter is closed");
24693
- if (input.kind === "fork" || input.kind === "rollbackLastTurn") {
24821
+ if (input2.kind === "fork" || input2.kind === "rollbackLastTurn") {
24694
24822
  const controller = new AbortController();
24695
- const pending = this.#fork(input, controller);
24823
+ const pending = this.#fork(input2, controller);
24696
24824
  this.#forks.set(controller, pending);
24697
24825
  try {
24698
24826
  return await pending;
@@ -24700,54 +24828,54 @@ var CursorAdapter = class {
24700
24828
  this.#forks.delete(controller);
24701
24829
  }
24702
24830
  }
24703
- return this.#openSession(input);
24831
+ return this.#openSession(input2);
24704
24832
  }
24705
- async #openSession(input, prepared) {
24706
- if (input.kind === "resume" && input.nativeRef.harnessId !== this.harnessId)
24833
+ async #openSession(input2, prepared) {
24834
+ if (input2.kind === "resume" && input2.nativeRef.harnessId !== this.harnessId)
24707
24835
  return rejected("invalidRequest", "Session belongs to another Harness");
24708
24836
  let executionPolicy;
24709
24837
  try {
24710
- executionPolicy = input.kind === "create" ? input.executionPolicy ?? "default" : cursorExecutionPolicy(input.nativeRef);
24838
+ executionPolicy = input2.kind === "create" ? input2.executionPolicy ?? "default" : cursorExecutionPolicy(input2.nativeRef);
24711
24839
  } catch {
24712
24840
  return rejected("invalidRequest", "Invalid Cursor Native Session locator");
24713
24841
  }
24714
24842
  const options = {
24715
- ...this.transportOptions(input.cwd, input.environment),
24843
+ ...this.transportOptions(input2.cwd, input2.environment),
24716
24844
  executionPolicy
24717
24845
  };
24718
24846
  const transport = prepared ?? new CursorTransport(options);
24719
24847
  try {
24720
- const before = input.kind === "resume" ? readCursorNativeHistory(input.nativeRef.nativeSessionId, options.cwd, options.environment) : void 0;
24721
- const info = await transport.open(input.kind === "resume" ? input.nativeRef.nativeSessionId : void 0);
24848
+ const before = input2.kind === "resume" ? readCursorNativeHistory(input2.nativeRef.nativeSessionId, options.cwd, options.environment) : void 0;
24849
+ const info = await transport.open(input2.kind === "resume" ? input2.nativeRef.nativeSessionId : void 0);
24722
24850
  let loadedSnapshot;
24723
- if (input.kind === "resume") {
24851
+ if (input2.kind === "resume") {
24724
24852
  const native = readCursorNativeHistory(transport.sessionId, options.cwd, options.environment);
24725
24853
  const snapshot = cursorSnapshot(transport.sessionId, native.turns, transport.replay);
24726
- if (input.knownTurnRefs?.some((ref) => ref.harnessId !== this.harnessId || ref.nativeSessionId !== transport.sessionId || !native.turns.some((turn) => turn.id === ref.nativeTurnKey)))
24854
+ if (input2.knownTurnRefs?.some((ref) => ref.harnessId !== this.harnessId || ref.nativeSessionId !== transport.sessionId || !native.turns.some((turn) => turn.id === ref.nativeTurnKey)))
24727
24855
  throw new Error("Saved Cursor turn identity no longer exists in native history");
24728
24856
  if (native.revision && before?.revision === native.revision)
24729
24857
  loadedSnapshot = { revision: native.revision, snapshot };
24730
24858
  }
24731
24859
  const session = new CursorSession(transport, info, () => {
24732
24860
  this.#sessions.delete(session);
24733
- }, input.kind === "create", loadedSnapshot);
24734
- if (input.model) {
24735
- const selected = await session.execute({ type: "model.select", model: input.model });
24861
+ }, input2.kind === "create", loadedSnapshot);
24862
+ if (input2.model) {
24863
+ const selected = await session.execute({ type: "model.select", model: input2.model });
24736
24864
  if (!selected.ok)
24737
24865
  throw new Error(selected.error.message);
24738
24866
  }
24739
- if (input.thinkingOptionId) {
24867
+ if (input2.thinkingOptionId) {
24740
24868
  const selected = await session.execute({
24741
24869
  type: "thinking.select",
24742
- thinkingOptionId: input.thinkingOptionId
24870
+ thinkingOptionId: input2.thinkingOptionId
24743
24871
  });
24744
24872
  if (!selected.ok)
24745
24873
  throw new Error(selected.error.message);
24746
24874
  }
24747
- if (input.permissionModeId) {
24875
+ if (input2.permissionModeId) {
24748
24876
  const selected = await session.execute({
24749
24877
  type: "permissionMode.select",
24750
- permissionModeId: input.permissionModeId
24878
+ permissionModeId: input2.permissionModeId
24751
24879
  });
24752
24880
  if (!selected.ok)
24753
24881
  throw new Error(selected.error.message);
@@ -24763,24 +24891,24 @@ var CursorAdapter = class {
24763
24891
  return { ok: false, error: cursorError(error51) };
24764
24892
  }
24765
24893
  }
24766
- async #fork(input, controller) {
24894
+ async #fork(input2, controller) {
24767
24895
  const signal = controller.signal;
24768
24896
  if (!cursorForkAvailable())
24769
24897
  return rejected("unsupported", "Cursor Fork requires macOS/Linux with /usr/bin/script");
24770
24898
  let executionPolicy;
24771
24899
  try {
24772
- if (input.kind === "fork")
24773
- validateCursorFork(input.sourceRef, input.checkpoint);
24774
- else if (input.sourceRef.harnessId !== this.harnessId || input.sourceRef.formatVersion !== 1)
24900
+ if (input2.kind === "fork")
24901
+ validateCursorFork(input2.sourceRef, input2.checkpoint);
24902
+ else if (input2.sourceRef.harnessId !== this.harnessId || input2.sourceRef.formatVersion !== 1)
24775
24903
  return rejected("invalidRequest", "Invalid Cursor rollback source");
24776
- executionPolicy = cursorExecutionPolicy(input.sourceRef);
24904
+ executionPolicy = cursorExecutionPolicy(input2.sourceRef);
24777
24905
  } catch {
24778
24906
  return rejected("invalidRequest", "Invalid Cursor fork checkpoint");
24779
24907
  }
24780
- const source = [...this.#sessions].find((session2) => session2.transport.sessionId === input.sourceRef.nativeSessionId);
24781
- if (source && !cursorSameWorkspace(source.transport.options.cwd, input.cwd))
24908
+ const source = [...this.#sessions].find((session2) => session2.transport.sessionId === input2.sourceRef.nativeSessionId);
24909
+ if (source && !cursorSameWorkspace(source.transport.options.cwd, input2.cwd))
24782
24910
  return rejected("unsupported", "Cursor Fork does not support changing workspace");
24783
- const sourceRunning = input.kind === "fork" && source?.turnRunningForFork() === true;
24911
+ const sourceRunning = input2.kind === "fork" && source?.turnRunningForFork() === true;
24784
24912
  const release = sourceRunning ? void 0 : source?.lockForFork();
24785
24913
  if (source && !release && !sourceRunning)
24786
24914
  return rejected("sessionBusy", "Cursor source session is busy");
@@ -24794,11 +24922,11 @@ var CursorAdapter = class {
24794
24922
  try {
24795
24923
  const options = source ? {
24796
24924
  ...source.transport.options,
24797
- environment: { ...source.transport.options.environment, ...input.environment }
24798
- } : this.transportOptions(input.cwd, input.environment);
24799
- const native = readCursorNativeTurns(input.sourceRef.nativeSessionId, input.cwd, options.environment);
24800
- const retained = input.kind === "fork" ? native.findIndex((turn) => turn.id === input.checkpoint.checkpointId) + 1 : native.length - 1;
24801
- if (!native.length || input.kind === "fork" && retained === 0)
24925
+ environment: { ...source.transport.options.environment, ...input2.environment }
24926
+ } : this.transportOptions(input2.cwd, input2.environment);
24927
+ const native = readCursorNativeTurns(input2.sourceRef.nativeSessionId, input2.cwd, options.environment);
24928
+ const retained = input2.kind === "fork" ? native.findIndex((turn) => turn.id === input2.checkpoint.checkpointId) + 1 : native.length - 1;
24929
+ if (!native.length || input2.kind === "fork" && retained === 0)
24802
24930
  return rejected("checkpointNotFound", "Cursor derivation boundary no longer exists");
24803
24931
  if (native[retained] && !native[retained]?.rewindRoot)
24804
24932
  return rejected("unsupported", "Cursor target has no native rewind checkpoint");
@@ -24813,7 +24941,7 @@ var CursorAdapter = class {
24813
24941
  throw error51;
24814
24942
  };
24815
24943
  const [staged, ready] = await Promise.allSettled([
24816
- forkCursorSession(input.sourceRef, input.kind === "fork" ? input.checkpoint : void 0, options, signal, { sourceRunning }).catch(abort),
24944
+ forkCursorSession(input2.sourceRef, input2.kind === "fork" ? input2.checkpoint : void 0, options, signal, { sourceRunning }).catch(abort),
24817
24945
  transport.prepare().catch(abort)
24818
24946
  ]);
24819
24947
  if (staged.status === "fulfilled")
@@ -24825,12 +24953,12 @@ var CursorAdapter = class {
24825
24953
  throw staged.reason;
24826
24954
  if (!derived)
24827
24955
  throw new Error("Cursor native fork did not return a target");
24828
- const model2 = input.kind === "rollbackLastTurn" ? input.model ?? source?.initialState.effectiveModel : source?.initialState.effectiveModel;
24829
- const thinking = input.kind === "rollbackLastTurn" ? input.thinkingOptionId ?? source?.initialState.effectiveThinkingOptionId : source?.initialState.effectiveThinkingOptionId;
24830
- const mode = input.kind === "rollbackLastTurn" ? input.permissionModeId ?? source?.initialState.effectivePermissionModeId : source?.initialState.effectivePermissionModeId;
24956
+ const model2 = input2.kind === "rollbackLastTurn" ? input2.model ?? source?.initialState.effectiveModel : source?.initialState.effectiveModel;
24957
+ const thinking = input2.kind === "rollbackLastTurn" ? input2.thinkingOptionId ?? source?.initialState.effectiveThinkingOptionId : source?.initialState.effectiveThinkingOptionId;
24958
+ const mode = input2.kind === "rollbackLastTurn" ? input2.permissionModeId ?? source?.initialState.effectivePermissionModeId : source?.initialState.effectivePermissionModeId;
24831
24959
  const opened = await this.#openSession({
24832
24960
  kind: "resume",
24833
- cwd: input.cwd,
24961
+ cwd: input2.cwd,
24834
24962
  environment: options.environment,
24835
24963
  nativeRef: cursorNativeSessionRef(derived.sessionId, executionPolicy),
24836
24964
  ...model2 ? { model: model2 } : {},
@@ -24840,9 +24968,9 @@ var CursorAdapter = class {
24840
24968
  if (!opened.ok)
24841
24969
  throw new Error(opened.error.message);
24842
24970
  session = opened.value;
24843
- if (JSON.stringify(readCursorNativeTurns(derived.sessionId, input.cwd, options.environment)) !== JSON.stringify(derived.expected))
24971
+ if (JSON.stringify(readCursorNativeTurns(derived.sessionId, input2.cwd, options.environment)) !== JSON.stringify(derived.expected))
24844
24972
  throw new Error("Cursor derived history changed during ACP adoption");
24845
- const sourceTurns = readCursorNativeTurns(input.sourceRef.nativeSessionId, input.cwd, options.environment);
24973
+ const sourceTurns = readCursorNativeTurns(input2.sourceRef.nativeSessionId, input2.cwd, options.environment);
24846
24974
  if (sourceRunning ? !cursorTurnsStartWith(sourceTurns, derived.expected) : JSON.stringify(sourceTurns) !== JSON.stringify(derived.sourceTurns))
24847
24975
  throw new Error("Cursor source changed before fork adoption");
24848
24976
  derived.commit();
@@ -24875,6 +25003,10 @@ var CursorSession = class {
24875
25003
  get capabilities() {
24876
25004
  return cursorCapabilities(this.info);
24877
25005
  }
25006
+ /** The live Session catalog, including parameters the inspection Session does not pin. */
25007
+ modelCatalog() {
25008
+ return cursorCatalog(this.info);
25009
+ }
24878
25010
  initialUsage = null;
24879
25011
  commands = {
24880
25012
  list: async () => this.#closed ? rejected("invalidState", "Cursor session is closed") : { ok: true, value: cursorCommands(this.transport.availableCommands) },
@@ -25060,6 +25192,14 @@ var CursorSession = class {
25060
25192
  return rejected("invalidRequest", "Unknown Cursor execution mode");
25061
25193
  selections = [["mode", command.permissionModeId]];
25062
25194
  }
25195
+ let published = false;
25196
+ const publish = () => {
25197
+ published = true;
25198
+ this.#channel.emit({
25199
+ kind: "event",
25200
+ event: { type: "session.state.changed", state: structuredClone(this.initialState) }
25201
+ });
25202
+ };
25063
25203
  for (const [configId, value] of selections) {
25064
25204
  if (this.info.configOptions?.some((option) => option.id === configId && option.currentValue === value))
25065
25205
  continue;
@@ -25075,11 +25215,10 @@ var CursorSession = class {
25075
25215
  this.initialState.effectivePermissionModeId = harnessPermissionModeIdSchema.parse(mode.currentValue);
25076
25216
  delete this.initialState.effectiveThinkingOptionId;
25077
25217
  Object.assign(this.initialState, cursorThinkingState(this.info));
25078
- this.#channel.emit({
25079
- kind: "event",
25080
- event: { type: "session.state.changed", state: structuredClone(this.initialState) }
25081
- });
25218
+ publish();
25082
25219
  }
25220
+ if (!published)
25221
+ publish();
25083
25222
  return { ok: true, value: { completed: true } };
25084
25223
  } catch (error51) {
25085
25224
  return { ok: false, error: cursorError(error51) };
@@ -25335,13 +25474,13 @@ function consumeBrokerFrames(socket, onFrame, onError, maxBytes = HARNESS_BROKER
25335
25474
  bufferedBytes = required2;
25336
25475
  if (newline2 < 0)
25337
25476
  return;
25338
- const text = buffered.toString("utf8", 0, bufferedBytes);
25477
+ const text2 = buffered.toString("utf8", 0, bufferedBytes);
25339
25478
  bufferedBytes = 0;
25340
25479
  if (buffered.length > 64 * 1024)
25341
25480
  buffered = Buffer.alloc(0);
25342
- if (text.length > 0) {
25481
+ if (text2.length > 0) {
25343
25482
  try {
25344
- const value = JSON.parse(text);
25483
+ const value = JSON.parse(text2);
25345
25484
  onFrame(value);
25346
25485
  } catch (error51) {
25347
25486
  fail(error51 instanceof SyntaxError ? new Error("Harness broker received invalid JSON") : error51 instanceof Error ? error51 : new Error(String(error51)));
@@ -25728,7 +25867,7 @@ var harnessOutputSchema = external_exports.custom((value) => {
25728
25867
  });
25729
25868
 
25730
25869
  // ../../harness-broker/dist/session-import-client.js
25731
- function createBrokerSessionImportCapability(input) {
25870
+ function createBrokerSessionImportCapability(input2) {
25732
25871
  let listing = null;
25733
25872
  const closed = () => ({
25734
25873
  ok: false,
@@ -25748,13 +25887,13 @@ function createBrokerSessionImportCapability(input) {
25748
25887
  const identities = /* @__PURE__ */ new Set();
25749
25888
  let total;
25750
25889
  for (; ; ) {
25751
- if (input.isClosed())
25890
+ if (input2.isClosed())
25752
25891
  return closed();
25753
- const result = await input.request("adapter.sessionImport.list", {
25892
+ const result = await input2.request("adapter.sessionImport.list", {
25754
25893
  offset: candidates.length,
25755
25894
  limit: HARNESS_BROKER_SESSION_IMPORT_PAGE_SIZE
25756
25895
  });
25757
- if (input.isClosed())
25896
+ if (input2.isClosed())
25758
25897
  return closed();
25759
25898
  if (!result.ok)
25760
25899
  return result;
@@ -25772,12 +25911,12 @@ function createBrokerSessionImportCapability(input) {
25772
25911
  return { ok: true, value: candidates };
25773
25912
  }
25774
25913
  } catch (error51) {
25775
- return { ok: false, error: input.error(error51) };
25914
+ return { ok: false, error: input2.error(error51) };
25776
25915
  }
25777
25916
  };
25778
25917
  return {
25779
25918
  listCandidates() {
25780
- if (input.isClosed())
25919
+ if (input2.isClosed())
25781
25920
  return Promise.resolve(closed());
25782
25921
  listing ??= list().finally(() => {
25783
25922
  listing = null;
@@ -25785,20 +25924,20 @@ function createBrokerSessionImportCapability(input) {
25785
25924
  return listing;
25786
25925
  },
25787
25926
  async resolveCandidate(nativeSessionId) {
25788
- if (input.isClosed())
25927
+ if (input2.isClosed())
25789
25928
  return closed();
25790
25929
  try {
25791
- const result = await input.request("adapter.sessionImport.resolve", { nativeSessionId });
25792
- if (input.isClosed())
25930
+ const result = await input2.request("adapter.sessionImport.resolve", { nativeSessionId });
25931
+ if (input2.isClosed())
25793
25932
  return closed();
25794
25933
  if (!result.ok)
25795
25934
  return result;
25796
25935
  const source = brokerSessionImportSourceSchema.safeParse(result.value);
25797
- if (!source.success || source.data.nativeRef.harnessId !== input.harnessId || source.data.candidate.nativeSessionId !== nativeSessionId)
25936
+ if (!source.success || source.data.nativeRef.harnessId !== input2.harnessId || source.data.candidate.nativeSessionId !== nativeSessionId)
25798
25937
  return invalid();
25799
25938
  return { ok: true, value: source.data };
25800
25939
  } catch (error51) {
25801
- return { ok: false, error: input.error(error51) };
25940
+ return { ok: false, error: input2.error(error51) };
25802
25941
  }
25803
25942
  }
25804
25943
  };
@@ -26378,17 +26517,17 @@ var BrokeredHarnessAdapter = class {
26378
26517
  #credits = null;
26379
26518
  #creditsRefresh = null;
26380
26519
  subagents = {
26381
- readSnapshot: async (input) => {
26520
+ readSnapshot: async (input2) => {
26382
26521
  try {
26383
- return parseHarnessResult(await this.#request("adapter.subagent.readSnapshot", input));
26522
+ return parseHarnessResult(await this.#request("adapter.subagent.readSnapshot", input2));
26384
26523
  } catch (error51) {
26385
26524
  return { ok: false, error: this.#error(error51) };
26386
26525
  }
26387
26526
  }
26388
26527
  };
26389
- constructor(input = {}) {
26390
- this.harnessId = harnessPluginIdSchema.parse(input.harnessId ?? "claude-code");
26391
- if (input.sessionImport) {
26528
+ constructor(input2 = {}) {
26529
+ this.harnessId = harnessPluginIdSchema.parse(input2.harnessId ?? "claude-code");
26530
+ if (input2.sessionImport) {
26392
26531
  this.sessionImport = createBrokerSessionImportCapability({
26393
26532
  harnessId: this.harnessId,
26394
26533
  request: async (method, params) => parseHarnessResult(await this.#request(method, params, method === "adapter.sessionImport.resolve")),
@@ -26396,20 +26535,20 @@ var BrokeredHarnessAdapter = class {
26396
26535
  error: (error51) => this.#error(error51)
26397
26536
  });
26398
26537
  }
26399
- if (input.accountCredits !== false) {
26538
+ if (input2.accountCredits !== false) {
26400
26539
  this.credits = () => this.#credits;
26401
26540
  this.refreshCredits = () => this.#refreshAccountCredits();
26402
26541
  }
26403
- this.#forwardEnvironment = input.forwardDelegationEnvironment === true;
26404
- if (input.commandCatalog)
26405
- this.commandCatalog = input.commandCatalog;
26406
- if (input.liveCommandCatalog)
26542
+ this.#forwardEnvironment = input2.forwardDelegationEnvironment === true;
26543
+ if (input2.commandCatalog)
26544
+ this.commandCatalog = input2.commandCatalog;
26545
+ if (input2.liveCommandCatalog)
26407
26546
  this.liveCommandCatalog = true;
26408
- this.#descriptorPath = input.descriptorPath ?? defaultHarnessBrokerDescriptorPath(input.environment, this.harnessId);
26409
- this.#isInstalled = input.isInstalled;
26410
- const environment = input.environment ?? process.env;
26411
- this.#startBroker = input.startBroker === false ? void 0 : input.startBroker ?? (process.platform === "darwin" && !input.descriptorPath ? () => startBrokerLaunchAgent(this.harnessId, environment) : void 0);
26412
- this.#startTimeoutMs = input.startTimeoutMs ?? BROKER_START_TIMEOUT_MS;
26547
+ this.#descriptorPath = input2.descriptorPath ?? defaultHarnessBrokerDescriptorPath(input2.environment, this.harnessId);
26548
+ this.#isInstalled = input2.isInstalled;
26549
+ const environment = input2.environment ?? process.env;
26550
+ this.#startBroker = input2.startBroker === false ? void 0 : input2.startBroker ?? (process.platform === "darwin" && !input2.descriptorPath ? () => startBrokerLaunchAgent(this.harnessId, environment) : void 0);
26551
+ this.#startTimeoutMs = input2.startTimeoutMs ?? BROKER_START_TIMEOUT_MS;
26413
26552
  }
26414
26553
  #refreshAccountCredits() {
26415
26554
  if (this.#closed)
@@ -26441,11 +26580,11 @@ var BrokeredHarnessAdapter = class {
26441
26580
  return null;
26442
26581
  }
26443
26582
  }
26444
- async inspect(input = {}) {
26583
+ async inspect(input2 = {}) {
26445
26584
  if (this.#closed)
26446
26585
  return failedInspection("Aqua Harness broker adapter is closed");
26447
26586
  try {
26448
- return harnessInspectionSchema.parse(await this.#request("adapter.inspect", input, true));
26587
+ return harnessInspectionSchema.parse(await this.#request("adapter.inspect", input2, true));
26449
26588
  } catch (error51) {
26450
26589
  this.#connection = null;
26451
26590
  if (error51 instanceof HarnessNotInstalledError)
@@ -26457,12 +26596,12 @@ var BrokeredHarnessAdapter = class {
26457
26596
  const result = await this.#request("adapter.normalizeStoredModelRef", { ref, catalog }, true);
26458
26597
  return harnessModelRefSchema.nullable().parse(result) ?? void 0;
26459
26598
  }
26460
- async open(input) {
26599
+ async open(input2) {
26461
26600
  if (this.#closed)
26462
26601
  return { ok: false, error: unavailable("Aqua Harness broker adapter is closed", false) };
26463
- const safeInput = { ...input };
26602
+ const safeInput = { ...input2 };
26464
26603
  delete safeInput.environment;
26465
- if (this.#forwardEnvironment && input.environment) {
26604
+ if (this.#forwardEnvironment && input2.environment) {
26466
26605
  const allowed = [
26467
26606
  "CODEXHOST_CLI_PATH",
26468
26607
  "CODEXHOST_CLI_NODE_PATH",
@@ -26470,7 +26609,7 @@ var BrokeredHarnessAdapter = class {
26470
26609
  "CODEXHOST_RUNTIME_TOKEN",
26471
26610
  "CODEXHOST_THREAD_ID"
26472
26611
  ];
26473
- const environment = Object.fromEntries(Object.entries(input.environment).filter(([key, value]) => allowed.includes(key) && value !== void 0));
26612
+ const environment = Object.fromEntries(Object.entries(input2.environment).filter(([key, value]) => allowed.includes(key) && value !== void 0));
26474
26613
  if (Object.keys(environment).length)
26475
26614
  safeInput.environment = environment;
26476
26615
  }