@codexhost/cli-win32-arm64 0.13.3 → 0.15.0

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 (33) hide show
  1. package/README.md +1 -1
  2. package/app/codexhost-distribution.json +1 -1
  3. package/app/console-server.mjs +109 -11
  4. package/app/console-web.js +649 -132
  5. package/app/desktop-controller.mjs +120 -12
  6. package/app/host-runtime.mjs +1124 -293
  7. package/app/plugins/antigravity/plugin.mjs +431 -66
  8. package/app/plugins/claude-code/plugin.mjs +761 -139
  9. package/app/plugins/codebuddy/plugin.mjs +322 -68
  10. package/app/plugins/codex-usage/plugin.mjs +249 -102
  11. package/app/plugins/copilot/assets/icon.png +0 -0
  12. package/app/plugins/copilot/manifest.json +26 -0
  13. package/app/plugins/copilot/plugin.mjs +34591 -0
  14. package/app/plugins/cursor-cli/plugin.mjs +21011 -44970
  15. package/app/plugins/deepseek-harness/plugin.mjs +160 -43
  16. package/app/plugins/enabled.json +1 -0
  17. package/app/plugins/grok/plugin.mjs +565 -107
  18. package/app/plugins/hermes/plugin.mjs +128 -12
  19. package/app/plugins/kimi-code/plugin.mjs +136 -22
  20. package/app/plugins/kiro-cli/plugin.mjs +136 -22
  21. package/app/plugins/omp/plugin.mjs +2236 -2036
  22. package/app/plugins/opencode/plugin.mjs +187 -68
  23. package/app/plugins/pi/plugin.mjs +2621 -2304
  24. package/app/plugins/qoder/plugin.mjs +153 -36
  25. package/app/plugins/qoder-cn/plugin.mjs +153 -36
  26. package/app/plugins/workbuddy/plugin.mjs +583 -92
  27. package/app/plugins/zcode/plugin.mjs +183 -40
  28. package/app/renderer-extension.js +1758 -392
  29. package/bin/codexhost.exe +0 -0
  30. package/libexec/codexhost-node-repl.exe +0 -0
  31. package/libexec/codexhost-shim.exe +0 -0
  32. package/libexec/codexhost-updater.exe +0 -0
  33. package/package.json +1 -1
@@ -504,10 +504,13 @@ function usageSessionTitle(value) {
504
504
  return void 0;
505
505
  if (normalized.length <= MAX_SESSION_TITLE_LENGTH)
506
506
  return normalized;
507
- const characters = [...normalized];
508
- if (characters.length <= MAX_SESSION_TITLE_LENGTH)
509
- return normalized;
510
- return `${characters.slice(0, MAX_SESSION_TITLE_LENGTH - 1).join("").trimEnd()}…`;
507
+ let title = "";
508
+ for (const character of normalized) {
509
+ if (title.length + character.length >= MAX_SESSION_TITLE_LENGTH)
510
+ break;
511
+ title += character;
512
+ }
513
+ return `${title.trimEnd()}…`;
511
514
  }
512
515
  function sessionIdOk(value) {
513
516
  return typeof value === "string" && value.length > 0 && value.length <= MAX_SESSION_ID_LENGTH;
@@ -3577,10 +3580,10 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
3577
3580
  const shape = def.shape;
3578
3581
  const propValues = {};
3579
3582
  for (const key in shape) {
3580
- const field = shape[key]._zod;
3581
- if (field.values) {
3583
+ const field2 = shape[key]._zod;
3584
+ if (field2.values) {
3582
3585
  propValues[key] ?? (propValues[key] = /* @__PURE__ */ new Set());
3583
- for (const v of field.values)
3586
+ for (const v of field2.values)
3584
3587
  propValues[key].add(v);
3585
3588
  }
3586
3589
  }
@@ -15199,10 +15202,19 @@ var model = external_exports.string().min(1).max(512);
15199
15202
  var project = external_exports.string().min(1).max(4096);
15200
15203
  var usageStatisticsParamsSchema = external_exports.strictObject({
15201
15204
  range: external_exports.enum(USAGE_STATISTICS_RANGES),
15205
+ /** Display timezone for ranges, dates and hourly buckets; omitted means the Host's local zone. */
15206
+ timeZone: external_exports.string().min(1).max(128).refine((value) => {
15207
+ try {
15208
+ new Intl.DateTimeFormat("en", { timeZone: value });
15209
+ return true;
15210
+ } catch {
15211
+ return false;
15212
+ }
15213
+ }, "Unsupported usage statistics timezone").optional(),
15202
15214
  harness: harness.optional(),
15203
15215
  model: model.nullable().optional(),
15204
15216
  project: project.nullable().optional(),
15205
- /** One local date inside the range. */
15217
+ /** One date in the query timezone inside the range. */
15206
15218
  date: localDate.optional()
15207
15219
  });
15208
15220
  var usageStatisticsTotalsSchema = external_exports.strictObject({
@@ -15238,7 +15250,7 @@ var usageStatisticsSessionSchema = external_exports.strictObject({
15238
15250
  });
15239
15251
  var usageStatisticsResultSchema = external_exports.strictObject({
15240
15252
  range: external_exports.enum(USAGE_STATISTICS_RANGES),
15241
- /** First local date of the range; null for all time. */
15253
+ /** First date in the query timezone (Host local when omitted); null for all time. */
15242
15254
  from: localDate.nullable(),
15243
15255
  to: localDate,
15244
15256
  /** The filters these figures apply, echoed so a late answer to older filters is recognised. */
@@ -15278,7 +15290,7 @@ var usageStatisticsResultSchema = external_exports.strictObject({
15278
15290
  totals: usageStatisticsTotalsSchema,
15279
15291
  /** Each date and Harness of the range: every filter except the day. */
15280
15292
  daily: external_exports.array(external_exports.strictObject({ date: localDate, harness, ...totals })).max(2e5),
15281
- /** Local weekday (0 = Sunday) and hour, all filters applied. */
15293
+ /** Weekday (0 = Sunday) and hour in the query timezone, all filters applied. */
15282
15294
  hourly: external_exports.array(external_exports.strictObject({
15283
15295
  weekday: external_exports.number().int().min(0).max(6),
15284
15296
  hour: external_exports.number().int().min(0).max(23),
@@ -15318,6 +15330,51 @@ var hostInteractionIdSchema = opaqueIdSchema.brand();
15318
15330
  var threadPrewarmDiscardParamsSchema = external_exports.object({ threadId: hostThreadIdSchema });
15319
15331
  var threadPrewarmDiscardResultSchema = external_exports.object({ discarded: external_exports.boolean() });
15320
15332
 
15333
+ // ../../shared-contracts/dist/thread-questions.js
15334
+ var field = external_exports.discriminatedUnion("type", [
15335
+ external_exports.object({
15336
+ id: external_exports.string().min(1),
15337
+ type: external_exports.literal("choice"),
15338
+ prompt: external_exports.string(),
15339
+ options: external_exports.array(external_exports.object({
15340
+ value: external_exports.string().min(1),
15341
+ label: external_exports.string(),
15342
+ description: external_exports.string().optional()
15343
+ })).min(1),
15344
+ multiple: external_exports.boolean(),
15345
+ allowOther: external_exports.boolean(),
15346
+ optional: external_exports.boolean()
15347
+ }),
15348
+ external_exports.object({
15349
+ id: external_exports.string().min(1),
15350
+ type: external_exports.literal("text"),
15351
+ prompt: external_exports.string(),
15352
+ multiline: external_exports.boolean(),
15353
+ secret: external_exports.literal(false),
15354
+ optional: external_exports.boolean(),
15355
+ placeholder: external_exports.string().optional(),
15356
+ prefill: external_exports.string().optional()
15357
+ })
15358
+ ]);
15359
+ var threadQuestionSchema = external_exports.object({
15360
+ interactionId: external_exports.string().min(1),
15361
+ turnId: external_exports.string().min(1),
15362
+ title: external_exports.string().optional(),
15363
+ questions: external_exports.array(field).min(1)
15364
+ }).refine(({ questions }) => questions.some((q) => q.type === "choice" && q.multiple), {
15365
+ message: "Shared cards require at least one multi-select question"
15366
+ });
15367
+ var threadQuestionsListParamsSchema = external_exports.strictObject({ threadId: external_exports.string().min(1) });
15368
+ var threadQuestionsResultSchema = external_exports.object({ questions: external_exports.array(threadQuestionSchema) });
15369
+ var threadQuestionRespondParamsSchema = external_exports.strictObject({
15370
+ threadId: external_exports.string().min(1),
15371
+ turnId: external_exports.string().min(1),
15372
+ interactionId: external_exports.string().min(1),
15373
+ answers: external_exports.record(external_exports.string(), external_exports.array(external_exports.string())),
15374
+ cancelled: external_exports.boolean().default(false)
15375
+ });
15376
+ var threadQuestionRespondResultSchema = external_exports.object({ accepted: external_exports.literal(true) });
15377
+
15321
15378
  // ../../shared-contracts/dist/console.js
15322
15379
  var consoleAnnouncementSchema = external_exports.strictObject({
15323
15380
  title: external_exports.string().trim().min(1).max(200),
@@ -15338,6 +15395,8 @@ var CONSOLE_HOST_METHODS = Object.freeze([
15338
15395
  "codexhost/harness/display-settings/set",
15339
15396
  "codexhost/harness/inspect",
15340
15397
  "codexhost/harness/installation",
15398
+ "codexhost/harness/installation/start",
15399
+ "codexhost/harness/installation/status",
15341
15400
  "codexhost/harness/launch-settings/get",
15342
15401
  "codexhost/harness/launch-settings/set",
15343
15402
  "codexhost/harness/web-ui/open",
@@ -15413,7 +15472,18 @@ var threadManualCompactionStartedSchema = external_exports.strictObject({
15413
15472
  var nonNegativeSafeIntegerSchema = external_exports.number().int().safe().nonnegative();
15414
15473
  var finiteNonNegativeNumberSchema = external_exports.number().finite().nonnegative();
15415
15474
  var cacheHitRatePercentSchema = external_exports.number().finite().min(0).max(100);
15475
+ var indicatorTextSchema = (maximum) => harnessLocalizedTextSchema.refine((entries) => Object.values(entries).every((text) => text.length <= maximum));
15476
+ var composerIndicatorsSchema = external_exports.array(external_exports.object({
15477
+ kind: external_exports.literal("countdown"),
15478
+ id: external_exports.string().min(1).max(64),
15479
+ expiresAtUnix: nonNegativeSafeIntegerSchema,
15480
+ label: indicatorTextSchema(256).optional(),
15481
+ tooltip: indicatorTextSchema(1024).optional()
15482
+ }).strict()).max(2).refine((entries) => new Set(entries.map(({ id }) => id)).size === entries.length, {
15483
+ message: "Composer indicator IDs must be unique"
15484
+ });
15416
15485
  var threadUsageSnapshotSchema = external_exports.object({
15486
+ composerIndicators: composerIndicatorsSchema.optional(),
15417
15487
  inputTokens: nonNegativeSafeIntegerSchema.optional(),
15418
15488
  cachedInputTokens: nonNegativeSafeIntegerSchema.optional(),
15419
15489
  cacheWriteInputTokens: nonNegativeSafeIntegerSchema.optional(),
@@ -15821,7 +15891,9 @@ var harnessSessionCapabilitiesSchema = external_exports.object({
15821
15891
  }).strict().optional(),
15822
15892
  autonomousTurns: external_exports.object({
15823
15893
  observe: external_exports.boolean()
15824
- }).strict().optional()
15894
+ }).strict().optional(),
15895
+ /** True only when `turn.steer` delivers input into the active Turn through a native primitive. */
15896
+ steer: external_exports.boolean().optional()
15825
15897
  }).strict();
15826
15898
  var harnessConfigurationStateSchema = external_exports.object({
15827
15899
  effectiveModel: harnessModelRefSchema.optional(),
@@ -15868,7 +15940,9 @@ var harnessInspectionSchema = external_exports.union([
15868
15940
  var harnessInspectParamsSchema = external_exports.object({
15869
15941
  harnessId: harnessIdSchema,
15870
15942
  cwd: nonBlankTextSchema2.max(16384).optional(),
15871
- refresh: external_exports.boolean().optional()
15943
+ refresh: external_exports.boolean().optional(),
15944
+ /** `availability` asks only whether the Harness can run; see `InspectHarnessInput.purpose`. */
15945
+ purpose: external_exports.literal("availability").optional()
15872
15946
  }).strict();
15873
15947
  var harnessWebUiOpenParamsSchema = external_exports.object({
15874
15948
  harnessId: harnessIdSchema
@@ -15951,6 +16025,15 @@ var threadOwnershipListResultSchema = external_exports.object({
15951
16025
  seen.add(thread.threadId);
15952
16026
  }
15953
16027
  });
16028
+ var threadSteeringInspectParamsSchema = external_exports.object({
16029
+ threadId: hostThreadIdSchema,
16030
+ /** The text about to be steered; a Harness command always stops and restarts. */
16031
+ text: external_exports.string().optional()
16032
+ }).strict();
16033
+ var threadSteerDeliverySchema = external_exports.enum(["activeTurn", "newTurn"]);
16034
+ var threadSteeringInspectResultSchema = external_exports.object({
16035
+ delivery: external_exports.enum(["official", "activeTurn", "newTurn"])
16036
+ }).strict();
15954
16037
 
15955
16038
  // ../../shared-contracts/dist/harness-plugins.js
15956
16039
  var HARNESS_PLUGIN_MANIFEST_MAX_BYTES = 32 * 1024;
@@ -16052,6 +16135,10 @@ var harnessInstallationStateSchema = external_exports.object({
16052
16135
  latestVersion: external_exports.string().min(1).max(128),
16053
16136
  updateAvailable: external_exports.boolean(),
16054
16137
  canUpdate: external_exports.boolean(),
16138
+ /** Defaults to CLI; some Harnesses ship only inside a desktop application. */
16139
+ versionKind: external_exports.enum(["cli", "application"]).optional(),
16140
+ /** Official download opened by the user; does not imply an automatic installation. */
16141
+ manualUpdateUrl: external_exports.url().max(2048).refine((value) => /^https:\/\/[^/?#@]+(?:[/?#]|$)/iu.test(value), "Manual updates require a credential-free HTTPS URL").optional(),
16055
16142
  // Adapter-owned diagnostic text; UI uses messageCode rather than displaying it verbatim.
16056
16143
  message: external_exports.string().max(2048).optional(),
16057
16144
  messageCode: external_exports.string().min(1).max(128).optional(),
@@ -16059,6 +16146,20 @@ var harnessInstallationStateSchema = external_exports.object({
16059
16146
  notice: harnessLocalizedTextSchema.optional(),
16060
16147
  latestVersionKind: external_exports.enum(["unknown", "tracking-branch"]).optional()
16061
16148
  }).strict();
16149
+ var harnessInstallationTaskParamsSchema = external_exports.object({ taskId: external_exports.string().uuid() }).strict();
16150
+ var harnessInstallationTaskSchema = external_exports.discriminatedUnion("status", [
16151
+ external_exports.object({ taskId: external_exports.string().uuid(), status: external_exports.literal("running") }).strict(),
16152
+ external_exports.object({
16153
+ taskId: external_exports.string().uuid(),
16154
+ status: external_exports.literal("succeeded"),
16155
+ result: harnessInstallationStateSchema
16156
+ }).strict(),
16157
+ external_exports.object({
16158
+ taskId: external_exports.string().uuid(),
16159
+ status: external_exports.literal("failed"),
16160
+ error: external_exports.object({ code: external_exports.number().int(), message: external_exports.string().min(1).max(2048) }).strict()
16161
+ }).strict()
16162
+ ]);
16062
16163
 
16063
16164
  // ../../shared-contracts/dist/codex-accounts.js
16064
16165
  var accountIdSchema = external_exports.string().min(1).max(256).regex(/^[A-Za-z0-9._~-]+$/u);
@@ -16544,6 +16645,18 @@ function sanitizeDiagnosticTail(value) {
16544
16645
  return redacted.length <= DIAGNOSTIC_TAIL_MAX_LENGTH ? redacted : redacted.slice(-DIAGNOSTIC_TAIL_MAX_LENGTH);
16545
16646
  }
16546
16647
 
16648
+ // ../../harness-adapter/dist/steer.js
16649
+ function unsupportedSteer(harnessLabel) {
16650
+ return {
16651
+ ok: false,
16652
+ error: {
16653
+ code: "unsupported",
16654
+ message: `${harnessLabel} cannot steer an active Turn natively`,
16655
+ retryable: false
16656
+ }
16657
+ };
16658
+ }
16659
+
16547
16660
  // ../../harness-adapter/dist/usage.js
16548
16661
  var tokenFields = [
16549
16662
  "inputTokens",
@@ -16571,6 +16684,7 @@ var usageFields = /* @__PURE__ */ new Set([
16571
16684
  ...safeIntegerFields,
16572
16685
  ...percentFields,
16573
16686
  "sessionCacheUsage",
16687
+ "composerIndicators",
16574
16688
  "totalCostUsd",
16575
16689
  "totalCredits",
16576
16690
  "contextUsagePercent",
@@ -16593,26 +16707,27 @@ function parseHostUsage(value) {
16593
16707
  throw new Error(`Harness Usage contains unknown field '${key}'`);
16594
16708
  }
16595
16709
  }
16596
- for (const field of [
16710
+ const indicators = value.composerIndicators === void 0 ? {} : { composerIndicators: composerIndicatorsSchema.parse(value.composerIndicators) };
16711
+ for (const field2 of [
16597
16712
  "totalCredits",
16598
16713
  "contextUsagePercent",
16599
16714
  "apiOutputTokensPerSecond"
16600
16715
  ]) {
16601
- const candidate2 = value[field];
16716
+ const candidate2 = value[field2];
16602
16717
  if (candidate2 !== void 0 && (typeof candidate2 !== "number" || !Number.isFinite(candidate2) || candidate2 < 0)) {
16603
- throw new Error(`Harness Usage '${field}' must be a finite non-negative number`);
16718
+ throw new Error(`Harness Usage '${field2}' must be a finite non-negative number`);
16604
16719
  }
16605
16720
  }
16606
- for (const field of tokenFields) {
16607
- const candidate2 = value[field];
16721
+ for (const field2 of tokenFields) {
16722
+ const candidate2 = value[field2];
16608
16723
  if (candidate2 !== void 0 && (typeof candidate2 !== "number" || !Number.isSafeInteger(candidate2) || candidate2 < 0)) {
16609
- throw new Error(`Harness Usage '${field}' must be a non-negative safe integer`);
16724
+ throw new Error(`Harness Usage '${field2}' must be a non-negative safe integer`);
16610
16725
  }
16611
16726
  }
16612
- for (const field of safeIntegerFields) {
16613
- const candidate2 = value[field];
16727
+ for (const field2 of safeIntegerFields) {
16728
+ const candidate2 = value[field2];
16614
16729
  if (candidate2 !== void 0 && (typeof candidate2 !== "number" || !Number.isSafeInteger(candidate2) || candidate2 < 0)) {
16615
- throw new Error(`Harness Usage '${field}' must be a non-negative safe integer`);
16730
+ throw new Error(`Harness Usage '${field2}' must be a non-negative safe integer`);
16616
16731
  }
16617
16732
  }
16618
16733
  if (value.outputTokensPerSecond !== void 0 && (typeof value.outputTokensPerSecond !== "number" || !Number.isFinite(value.outputTokensPerSecond) || value.outputTokensPerSecond < 0)) {
@@ -16621,10 +16736,10 @@ function parseHostUsage(value) {
16621
16736
  if (value.totalCostUsd !== void 0 && (typeof value.totalCostUsd !== "number" || !Number.isFinite(value.totalCostUsd) || value.totalCostUsd < 0)) {
16622
16737
  throw new Error("Harness Usage 'totalCostUsd' must be a finite non-negative number");
16623
16738
  }
16624
- for (const field of percentFields) {
16625
- const candidate2 = value[field];
16739
+ for (const field2 of percentFields) {
16740
+ const candidate2 = value[field2];
16626
16741
  if (candidate2 !== void 0 && (typeof candidate2 !== "number" || !Number.isFinite(candidate2) || candidate2 < 0 || candidate2 > 100)) {
16627
- throw new Error(`Harness Usage '${field}' must be between 0 and 100`);
16742
+ throw new Error(`Harness Usage '${field2}' must be between 0 and 100`);
16628
16743
  }
16629
16744
  }
16630
16745
  if (value.sessionCacheUsage !== void 0) {
@@ -16663,9 +16778,9 @@ function parseHostUsage(value) {
16663
16778
  if (value.costSource !== "publicPrice") {
16664
16779
  throw new Error("Harness Usage 'unpricedModels' must be provided with a 'publicPrice' cost");
16665
16780
  }
16666
- return { ...value, unpricedModels: [...models] };
16781
+ return { ...value, ...indicators, unpricedModels: [...models] };
16667
16782
  }
16668
- return { ...value };
16783
+ return { ...value, ...indicators };
16669
16784
  }
16670
16785
  var requestTokenFields = [
16671
16786
  "inputTokens",
@@ -16695,19 +16810,19 @@ function parseHostUsageRequest(value) {
16695
16810
  if (typeof value.requestId !== "string" || value.requestId.length === 0) {
16696
16811
  throw new Error("Harness Usage request 'requestId' must be a non-empty string");
16697
16812
  }
16698
- for (const field of ["model", "provider"]) {
16699
- const candidate2 = value[field];
16813
+ for (const field2 of ["model", "provider"]) {
16814
+ const candidate2 = value[field2];
16700
16815
  if (candidate2 !== void 0 && (typeof candidate2 !== "string" || candidate2.length === 0)) {
16701
- throw new Error(`Harness Usage request '${field}' must be a non-empty string`);
16816
+ throw new Error(`Harness Usage request '${field2}' must be a non-empty string`);
16702
16817
  }
16703
16818
  }
16704
16819
  if (value.historical !== void 0 && typeof value.historical !== "boolean") {
16705
16820
  throw new Error("Harness Usage request 'historical' must be a boolean");
16706
16821
  }
16707
- for (const field of requestTokenFields) {
16708
- const candidate2 = value[field];
16822
+ for (const field2 of requestTokenFields) {
16823
+ const candidate2 = value[field2];
16709
16824
  if (candidate2 !== void 0 && (typeof candidate2 !== "number" || !Number.isSafeInteger(candidate2) || candidate2 < 0)) {
16710
- throw new Error(`Harness Usage request '${field}' must be a non-negative safe integer`);
16825
+ throw new Error(`Harness Usage request '${field2}' must be a non-negative safe integer`);
16711
16826
  }
16712
16827
  }
16713
16828
  if (value.inputTokens === void 0 || value.outputTokens === void 0) {
@@ -18101,24 +18216,24 @@ var buildClientParams = (args, fields) => {
18101
18216
  }
18102
18217
  if ("in" in config2) {
18103
18218
  if (config2.key) {
18104
- const field = map2.get(config2.key);
18105
- const name = field.map || config2.key;
18106
- if (field.in) {
18219
+ const field2 = map2.get(config2.key);
18220
+ const name = field2.map || config2.key;
18221
+ if (field2.in) {
18107
18222
  ;
18108
- params[field.in][name] = arg;
18223
+ params[field2.in][name] = arg;
18109
18224
  }
18110
18225
  } else {
18111
18226
  params.body = arg;
18112
18227
  }
18113
18228
  } else {
18114
18229
  for (const [key, value] of Object.entries(arg ?? {})) {
18115
- const field = map2.get(key);
18116
- if (field) {
18117
- if (field.in) {
18118
- const name = field.map || key;
18119
- params[field.in][name] = value;
18230
+ const field2 = map2.get(key);
18231
+ if (field2) {
18232
+ if (field2.in) {
18233
+ const name = field2.map || key;
18234
+ params[field2.in][name] = value;
18120
18235
  } else {
18121
- params[field.map] = value;
18236
+ params[field2.map] = value;
18122
18237
  }
18123
18238
  } else {
18124
18239
  const extra = extraPrefixes.find(([prefix]) => key.startsWith(prefix));
@@ -23781,6 +23896,8 @@ var OpenCodeHarnessSession = class {
23781
23896
  if (this.#phase !== "open") {
23782
23897
  return { ok: false, error: invalidState("OpenCode Session is not open") };
23783
23898
  }
23899
+ if (command.type === "turn.steer")
23900
+ return unsupportedSteer("OpenCode");
23784
23901
  if (command.type === "turn.cancel")
23785
23902
  return this.#cancel(command);
23786
23903
  if (command.type === "interaction.respond")
@@ -24249,8 +24366,8 @@ var OpenCodeHarnessSession = class {
24249
24366
  this.#event({ type: "item.started", turnId: active.turnId, item });
24250
24367
  }
24251
24368
  }
24252
- #appendPartDelta(active, partID, field, delta) {
24253
- if (field !== "text" || !delta)
24369
+ #appendPartDelta(active, partID, field2, delta) {
24370
+ if (field2 !== "text" || !delta)
24254
24371
  return;
24255
24372
  const existing = active.items.get(partID);
24256
24373
  if (!existing)
@@ -27245,16 +27362,16 @@ function permissionInteraction(request, turnId) {
27245
27362
  };
27246
27363
  }
27247
27364
  function formInteraction(form, turnId) {
27248
- const questions = form.fields.map((field) => {
27249
- if (field.type === "external" || field.hidden || field.when?.length) {
27365
+ const questions = form.fields.map((field2) => {
27366
+ if (field2.type === "external" || field2.hidden || field2.when?.length) {
27250
27367
  throw new Error("OpenCode v2 external, hidden or conditional form fields require its native UI");
27251
27368
  }
27252
27369
  const base = {
27253
- id: field.key,
27254
- prompt: [field.title, field.description].filter(Boolean).join("\n") || field.key,
27255
- optional: !field.required
27370
+ id: field2.key,
27371
+ prompt: [field2.title, field2.description].filter(Boolean).join("\n") || field2.key,
27372
+ optional: !field2.required
27256
27373
  };
27257
- if (field.type === "boolean")
27374
+ if (field2.type === "boolean")
27258
27375
  return {
27259
27376
  ...base,
27260
27377
  type: "choice",
@@ -27265,22 +27382,22 @@ function formInteraction(form, turnId) {
27265
27382
  { value: "false", label: "No" }
27266
27383
  ]
27267
27384
  };
27268
- if (field.type === "multiselect" || field.type === "string" && field.options?.length) {
27385
+ if (field2.type === "multiselect" || field2.type === "string" && field2.options?.length) {
27269
27386
  return {
27270
27387
  ...base,
27271
27388
  type: "choice",
27272
- multiple: field.type === "multiselect",
27273
- allowOther: field.custom ?? false,
27274
- options: field.options ?? []
27389
+ multiple: field2.type === "multiselect",
27390
+ allowOther: field2.custom ?? false,
27391
+ options: field2.options ?? []
27275
27392
  };
27276
27393
  }
27277
27394
  return {
27278
27395
  ...base,
27279
27396
  type: "text",
27280
- multiline: field.type === "string",
27397
+ multiline: field2.type === "string",
27281
27398
  secret: false,
27282
- ...field.type === "string" && field.placeholder ? { placeholder: field.placeholder } : {},
27283
- ...field.default !== void 0 ? { prefill: String(field.default) } : {}
27399
+ ...field2.type === "string" && field2.placeholder ? { placeholder: field2.placeholder } : {},
27400
+ ...field2.default !== void 0 ? { prefill: String(field2.default) } : {}
27284
27401
  };
27285
27402
  });
27286
27403
  return {
@@ -27323,24 +27440,24 @@ async function replyInteraction(client2, pending, command) {
27323
27440
  return;
27324
27441
  }
27325
27442
  const answer = {};
27326
- for (const field of form.fields) {
27327
- const values = command.response.answers[field.key] ?? [];
27443
+ for (const field2 of form.fields) {
27444
+ const values = command.response.answers[field2.key] ?? [];
27328
27445
  if (!values.length)
27329
27446
  continue;
27330
27447
  const value = values[0];
27331
27448
  if (value === void 0)
27332
27449
  continue;
27333
- if (field.type === "multiselect")
27334
- answer[field.key] = values;
27335
- else if (field.type === "boolean")
27336
- answer[field.key] = value === "true";
27337
- else if (field.type === "number" || field.type === "integer") {
27450
+ if (field2.type === "multiselect")
27451
+ answer[field2.key] = values;
27452
+ else if (field2.type === "boolean")
27453
+ answer[field2.key] = value === "true";
27454
+ else if (field2.type === "number" || field2.type === "integer") {
27338
27455
  const number4 = Number(value);
27339
- if (!value.trim() || !Number.isFinite(number4) || field.type === "integer" && !Number.isInteger(number4))
27340
- throw new Error(`Invalid number for ${field.key}`);
27341
- answer[field.key] = number4;
27456
+ if (!value.trim() || !Number.isFinite(number4) || field2.type === "integer" && !Number.isInteger(number4))
27457
+ throw new Error(`Invalid number for ${field2.key}`);
27458
+ answer[field2.key] = number4;
27342
27459
  } else
27343
- answer[field.key] = value;
27460
+ answer[field2.key] = value;
27344
27461
  }
27345
27462
  await client2.session.form.reply({ sessionID: form.sessionID, formID: form.id, answer });
27346
27463
  }
@@ -27461,6 +27578,8 @@ var V2Session = class {
27461
27578
  async execute(command) {
27462
27579
  if (this.#closed)
27463
27580
  return { ok: false, error: failure("OpenCode Session is closed", "invalidState") };
27581
+ if (command.type === "turn.steer")
27582
+ return unsupportedSteer("OpenCode");
27464
27583
  if (command.type === "turn.start")
27465
27584
  return this.#start(command, false);
27466
27585
  if (command.type === "turn.cancel") {