@liberseek/boft-cli-win32-arm64 0.8.4 → 0.8.5

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.
@@ -3583,10 +3583,10 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
3583
3583
  const shape = def.shape;
3584
3584
  const propValues = {};
3585
3585
  for (const key in shape) {
3586
- const field = shape[key]._zod;
3587
- if (field.values) {
3586
+ const field2 = shape[key]._zod;
3587
+ if (field2.values) {
3588
3588
  propValues[key] ?? (propValues[key] = /* @__PURE__ */ new Set());
3589
- for (const v of field.values)
3589
+ for (const v of field2.values)
3590
3590
  propValues[key].add(v);
3591
3591
  }
3592
3592
  }
@@ -15226,6 +15226,8 @@ var usageStatisticsTotalsSchema = external_exports.strictObject({
15226
15226
  cachedInputTokens: count,
15227
15227
  cacheWriteInputTokens: count,
15228
15228
  cacheKnownInputTokens: count,
15229
+ cacheHitCachedInputTokens: count,
15230
+ cacheHitInputTokens: count,
15229
15231
  outputTokens: count,
15230
15232
  reasoningOutputTokens: count,
15231
15233
  /** USD at the public price, summed over the priced requests only. */
@@ -15333,6 +15335,51 @@ var hostInteractionIdSchema = opaqueIdSchema.brand();
15333
15335
  var threadPrewarmDiscardParamsSchema = external_exports.object({ threadId: hostThreadIdSchema });
15334
15336
  var threadPrewarmDiscardResultSchema = external_exports.object({ discarded: external_exports.boolean() });
15335
15337
 
15338
+ // ../../shared-contracts/dist/thread-questions.js
15339
+ var field = external_exports.discriminatedUnion("type", [
15340
+ external_exports.object({
15341
+ id: external_exports.string().min(1),
15342
+ type: external_exports.literal("choice"),
15343
+ prompt: external_exports.string(),
15344
+ options: external_exports.array(external_exports.object({
15345
+ value: external_exports.string().min(1),
15346
+ label: external_exports.string(),
15347
+ description: external_exports.string().optional()
15348
+ })).min(1),
15349
+ multiple: external_exports.boolean(),
15350
+ allowOther: external_exports.boolean(),
15351
+ optional: external_exports.boolean()
15352
+ }),
15353
+ external_exports.object({
15354
+ id: external_exports.string().min(1),
15355
+ type: external_exports.literal("text"),
15356
+ prompt: external_exports.string(),
15357
+ multiline: external_exports.boolean(),
15358
+ secret: external_exports.literal(false),
15359
+ optional: external_exports.boolean(),
15360
+ placeholder: external_exports.string().optional(),
15361
+ prefill: external_exports.string().optional()
15362
+ })
15363
+ ]);
15364
+ var threadQuestionSchema = external_exports.object({
15365
+ interactionId: external_exports.string().min(1),
15366
+ turnId: external_exports.string().min(1),
15367
+ title: external_exports.string().optional(),
15368
+ questions: external_exports.array(field).min(1)
15369
+ }).refine(({ questions }) => questions.some((q) => q.type === "choice" && q.multiple), {
15370
+ message: "Shared cards require at least one multi-select question"
15371
+ });
15372
+ var threadQuestionsListParamsSchema = external_exports.strictObject({ threadId: external_exports.string().min(1) });
15373
+ var threadQuestionsResultSchema = external_exports.object({ questions: external_exports.array(threadQuestionSchema) });
15374
+ var threadQuestionRespondParamsSchema = external_exports.strictObject({
15375
+ threadId: external_exports.string().min(1),
15376
+ turnId: external_exports.string().min(1),
15377
+ interactionId: external_exports.string().min(1),
15378
+ answers: external_exports.record(external_exports.string(), external_exports.array(external_exports.string())),
15379
+ cancelled: external_exports.boolean().default(false)
15380
+ });
15381
+ var threadQuestionRespondResultSchema = external_exports.object({ accepted: external_exports.literal(true) });
15382
+
15336
15383
  // ../../shared-contracts/dist/harness-plugins.js
15337
15384
  var HARNESS_PLUGIN_MANIFEST_MAX_BYTES = 32 * 1024;
15338
15385
  var HARNESS_PLUGIN_ICON_MAX_BYTES = 128 * 1024;
@@ -16102,7 +16149,10 @@ var harnessPluginRouteSchema = external_exports.object({
16102
16149
  harnessId: harnessPluginIdSchema,
16103
16150
  model: harnessModelRefSchema.optional(),
16104
16151
  thinkingOptionId: harnessThinkingOptionIdSchema.optional(),
16105
- permissionModeId: harnessPermissionModeIdSchema.optional()
16152
+ permissionModeId: harnessPermissionModeIdSchema.optional(),
16153
+ /** A draft prewarm create: stays unsubmitted until the user's first Turn.
16154
+ * Desktop forwards only the Model of a main-process prewarm to thread/start. */
16155
+ prewarm: external_exports.literal(true).optional()
16106
16156
  }).strict();
16107
16157
 
16108
16158
  // ../../shared-contracts/dist/harness-launch-settings.js
@@ -17029,26 +17079,26 @@ function parseHostUsage(value) {
17029
17079
  }
17030
17080
  }
17031
17081
  const indicators = value.composerIndicators === void 0 ? {} : { composerIndicators: composerIndicatorsSchema.parse(value.composerIndicators) };
17032
- for (const field of [
17082
+ for (const field2 of [
17033
17083
  "totalCredits",
17034
17084
  "contextUsagePercent",
17035
17085
  "apiOutputTokensPerSecond"
17036
17086
  ]) {
17037
- const candidate = value[field];
17087
+ const candidate = value[field2];
17038
17088
  if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isFinite(candidate) || candidate < 0)) {
17039
- throw new Error(`Harness Usage '${field}' must be a finite non-negative number`);
17089
+ throw new Error(`Harness Usage '${field2}' must be a finite non-negative number`);
17040
17090
  }
17041
17091
  }
17042
- for (const field of tokenFields) {
17043
- const candidate = value[field];
17092
+ for (const field2 of tokenFields) {
17093
+ const candidate = value[field2];
17044
17094
  if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isSafeInteger(candidate) || candidate < 0)) {
17045
- throw new Error(`Harness Usage '${field}' must be a non-negative safe integer`);
17095
+ throw new Error(`Harness Usage '${field2}' must be a non-negative safe integer`);
17046
17096
  }
17047
17097
  }
17048
- for (const field of safeIntegerFields) {
17049
- const candidate = value[field];
17098
+ for (const field2 of safeIntegerFields) {
17099
+ const candidate = value[field2];
17050
17100
  if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isSafeInteger(candidate) || candidate < 0)) {
17051
- throw new Error(`Harness Usage '${field}' must be a non-negative safe integer`);
17101
+ throw new Error(`Harness Usage '${field2}' must be a non-negative safe integer`);
17052
17102
  }
17053
17103
  }
17054
17104
  if (value.outputTokensPerSecond !== void 0 && (typeof value.outputTokensPerSecond !== "number" || !Number.isFinite(value.outputTokensPerSecond) || value.outputTokensPerSecond < 0)) {
@@ -17057,16 +17107,16 @@ function parseHostUsage(value) {
17057
17107
  if (value.totalCostUsd !== void 0 && (typeof value.totalCostUsd !== "number" || !Number.isFinite(value.totalCostUsd) || value.totalCostUsd < 0)) {
17058
17108
  throw new Error("Harness Usage 'totalCostUsd' must be a finite non-negative number");
17059
17109
  }
17060
- for (const field of ["totalCredits", "contextUsagePercent"]) {
17061
- const candidate = value[field];
17110
+ for (const field2 of ["totalCredits", "contextUsagePercent"]) {
17111
+ const candidate = value[field2];
17062
17112
  if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isFinite(candidate) || candidate < 0)) {
17063
- throw new Error(`Harness Usage '${field}' must be a finite non-negative number`);
17113
+ throw new Error(`Harness Usage '${field2}' must be a finite non-negative number`);
17064
17114
  }
17065
17115
  }
17066
- for (const field of percentFields) {
17067
- const candidate = value[field];
17116
+ for (const field2 of percentFields) {
17117
+ const candidate = value[field2];
17068
17118
  if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isFinite(candidate) || candidate < 0 || candidate > 100)) {
17069
- throw new Error(`Harness Usage '${field}' must be between 0 and 100`);
17119
+ throw new Error(`Harness Usage '${field2}' must be between 0 and 100`);
17070
17120
  }
17071
17121
  }
17072
17122
  if (value.sessionCacheUsage !== void 0) {
@@ -17137,19 +17187,19 @@ function parseHostUsageRequest(value) {
17137
17187
  if (typeof value.requestId !== "string" || value.requestId.length === 0) {
17138
17188
  throw new Error("Harness Usage request 'requestId' must be a non-empty string");
17139
17189
  }
17140
- for (const field of ["model", "provider"]) {
17141
- const candidate = value[field];
17190
+ for (const field2 of ["model", "provider"]) {
17191
+ const candidate = value[field2];
17142
17192
  if (candidate !== void 0 && (typeof candidate !== "string" || candidate.length === 0)) {
17143
- throw new Error(`Harness Usage request '${field}' must be a non-empty string`);
17193
+ throw new Error(`Harness Usage request '${field2}' must be a non-empty string`);
17144
17194
  }
17145
17195
  }
17146
17196
  if (value.historical !== void 0 && typeof value.historical !== "boolean") {
17147
17197
  throw new Error("Harness Usage request 'historical' must be a boolean");
17148
17198
  }
17149
- for (const field of requestTokenFields) {
17150
- const candidate = value[field];
17199
+ for (const field2 of requestTokenFields) {
17200
+ const candidate = value[field2];
17151
17201
  if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isSafeInteger(candidate) || candidate < 0)) {
17152
- throw new Error(`Harness Usage request '${field}' must be a non-negative safe integer`);
17202
+ throw new Error(`Harness Usage request '${field2}' must be a non-negative safe integer`);
17153
17203
  }
17154
17204
  }
17155
17205
  if (value.inputTokens === void 0 || value.outputTokens === void 0) {
@@ -20527,9 +20577,9 @@ function outputText(output) {
20527
20577
  function stringField2(value, key) {
20528
20578
  if (!isRecord10(value))
20529
20579
  return void 0;
20530
- const field = value[key];
20531
- if (typeof field === "string" && field.length > 0)
20532
- return field;
20580
+ const field2 = value[key];
20581
+ if (typeof field2 === "string" && field2.length > 0)
20582
+ return field2;
20533
20583
  if (isRecord10(value.input)) {
20534
20584
  const nested = value.input[key];
20535
20585
  if (typeof nested === "string" && nested.length > 0)
@@ -20545,8 +20595,8 @@ function stringField2(value, key) {
20545
20595
  function numberField(value, key) {
20546
20596
  if (!isRecord10(value))
20547
20597
  return void 0;
20548
- const field = value[key];
20549
- return typeof field === "number" || field === null ? field : void 0;
20598
+ const field2 = value[key];
20599
+ return typeof field2 === "number" || field2 === null ? field2 : void 0;
20550
20600
  }
20551
20601
  function stripDiffPrefix(pathString) {
20552
20602
  if (typeof pathString !== "string" || pathString.length === 0)
@@ -20585,9 +20635,9 @@ function nestedToolString(value, keys) {
20585
20635
  if (!isRecord10(value))
20586
20636
  return void 0;
20587
20637
  for (const key of keys) {
20588
- const field = value[key];
20589
- if (typeof field === "string" && field.length > 0)
20590
- return field;
20638
+ const field2 = value[key];
20639
+ if (typeof field2 === "string" && field2.length > 0)
20640
+ return field2;
20591
20641
  }
20592
20642
  for (const wrapper of ["input", "arguments", "params", "details"]) {
20593
20643
  const nested = nestedToolString(value[wrapper], keys);
@@ -20600,15 +20650,15 @@ function patchFromResult(result) {
20600
20650
  if (!isRecord10(result))
20601
20651
  return void 0;
20602
20652
  for (const key of ["patch", "diff", "unifiedDiff"]) {
20603
- const field = result[key];
20604
- if (typeof field === "string" && field.length > 0)
20605
- return field;
20653
+ const field2 = result[key];
20654
+ if (typeof field2 === "string" && field2.length > 0)
20655
+ return field2;
20606
20656
  }
20607
20657
  if (isRecord10(result.details)) {
20608
20658
  for (const key of ["patch", "diff", "unifiedDiff"]) {
20609
- const field = result.details[key];
20610
- if (typeof field === "string" && field.length > 0)
20611
- return field;
20659
+ const field2 = result.details[key];
20660
+ if (typeof field2 === "string" && field2.length > 0)
20661
+ return field2;
20612
20662
  }
20613
20663
  }
20614
20664
  return void 0;
@@ -3580,10 +3580,10 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
3580
3580
  const shape = def.shape;
3581
3581
  const propValues = {};
3582
3582
  for (const key in shape) {
3583
- const field = shape[key]._zod;
3584
- if (field.values) {
3583
+ const field2 = shape[key]._zod;
3584
+ if (field2.values) {
3585
3585
  propValues[key] ?? (propValues[key] = /* @__PURE__ */ new Set());
3586
- for (const v of field.values)
3586
+ for (const v of field2.values)
3587
3587
  propValues[key].add(v);
3588
3588
  }
3589
3589
  }
@@ -15223,6 +15223,8 @@ var usageStatisticsTotalsSchema = external_exports.strictObject({
15223
15223
  cachedInputTokens: count,
15224
15224
  cacheWriteInputTokens: count,
15225
15225
  cacheKnownInputTokens: count,
15226
+ cacheHitCachedInputTokens: count,
15227
+ cacheHitInputTokens: count,
15226
15228
  outputTokens: count,
15227
15229
  reasoningOutputTokens: count,
15228
15230
  /** USD at the public price, summed over the priced requests only. */
@@ -15330,6 +15332,51 @@ var hostInteractionIdSchema = opaqueIdSchema.brand();
15330
15332
  var threadPrewarmDiscardParamsSchema = external_exports.object({ threadId: hostThreadIdSchema });
15331
15333
  var threadPrewarmDiscardResultSchema = external_exports.object({ discarded: external_exports.boolean() });
15332
15334
 
15335
+ // ../../shared-contracts/dist/thread-questions.js
15336
+ var field = external_exports.discriminatedUnion("type", [
15337
+ external_exports.object({
15338
+ id: external_exports.string().min(1),
15339
+ type: external_exports.literal("choice"),
15340
+ prompt: external_exports.string(),
15341
+ options: external_exports.array(external_exports.object({
15342
+ value: external_exports.string().min(1),
15343
+ label: external_exports.string(),
15344
+ description: external_exports.string().optional()
15345
+ })).min(1),
15346
+ multiple: external_exports.boolean(),
15347
+ allowOther: external_exports.boolean(),
15348
+ optional: external_exports.boolean()
15349
+ }),
15350
+ external_exports.object({
15351
+ id: external_exports.string().min(1),
15352
+ type: external_exports.literal("text"),
15353
+ prompt: external_exports.string(),
15354
+ multiline: external_exports.boolean(),
15355
+ secret: external_exports.literal(false),
15356
+ optional: external_exports.boolean(),
15357
+ placeholder: external_exports.string().optional(),
15358
+ prefill: external_exports.string().optional()
15359
+ })
15360
+ ]);
15361
+ var threadQuestionSchema = external_exports.object({
15362
+ interactionId: external_exports.string().min(1),
15363
+ turnId: external_exports.string().min(1),
15364
+ title: external_exports.string().optional(),
15365
+ questions: external_exports.array(field).min(1)
15366
+ }).refine(({ questions }) => questions.some((q) => q.type === "choice" && q.multiple), {
15367
+ message: "Shared cards require at least one multi-select question"
15368
+ });
15369
+ var threadQuestionsListParamsSchema = external_exports.strictObject({ threadId: external_exports.string().min(1) });
15370
+ var threadQuestionsResultSchema = external_exports.object({ questions: external_exports.array(threadQuestionSchema) });
15371
+ var threadQuestionRespondParamsSchema = external_exports.strictObject({
15372
+ threadId: external_exports.string().min(1),
15373
+ turnId: external_exports.string().min(1),
15374
+ interactionId: external_exports.string().min(1),
15375
+ answers: external_exports.record(external_exports.string(), external_exports.array(external_exports.string())),
15376
+ cancelled: external_exports.boolean().default(false)
15377
+ });
15378
+ var threadQuestionRespondResultSchema = external_exports.object({ accepted: external_exports.literal(true) });
15379
+
15333
15380
  // ../../shared-contracts/dist/harness-plugins.js
15334
15381
  var HARNESS_PLUGIN_MANIFEST_MAX_BYTES = 32 * 1024;
15335
15382
  var HARNESS_PLUGIN_ICON_MAX_BYTES = 128 * 1024;
@@ -16099,7 +16146,10 @@ var harnessPluginRouteSchema = external_exports.object({
16099
16146
  harnessId: harnessPluginIdSchema,
16100
16147
  model: harnessModelRefSchema.optional(),
16101
16148
  thinkingOptionId: harnessThinkingOptionIdSchema.optional(),
16102
- permissionModeId: harnessPermissionModeIdSchema.optional()
16149
+ permissionModeId: harnessPermissionModeIdSchema.optional(),
16150
+ /** A draft prewarm create: stays unsubmitted until the user's first Turn.
16151
+ * Desktop forwards only the Model of a main-process prewarm to thread/start. */
16152
+ prewarm: external_exports.literal(true).optional()
16103
16153
  }).strict();
16104
16154
 
16105
16155
  // ../../shared-contracts/dist/harness-launch-settings.js
@@ -16710,26 +16760,26 @@ function parseHostUsage(value) {
16710
16760
  }
16711
16761
  }
16712
16762
  const indicators = value.composerIndicators === void 0 ? {} : { composerIndicators: composerIndicatorsSchema.parse(value.composerIndicators) };
16713
- for (const field of [
16763
+ for (const field2 of [
16714
16764
  "totalCredits",
16715
16765
  "contextUsagePercent",
16716
16766
  "apiOutputTokensPerSecond"
16717
16767
  ]) {
16718
- const candidate2 = value[field];
16768
+ const candidate2 = value[field2];
16719
16769
  if (candidate2 !== void 0 && (typeof candidate2 !== "number" || !Number.isFinite(candidate2) || candidate2 < 0)) {
16720
- throw new Error(`Harness Usage '${field}' must be a finite non-negative number`);
16770
+ throw new Error(`Harness Usage '${field2}' must be a finite non-negative number`);
16721
16771
  }
16722
16772
  }
16723
- for (const field of tokenFields) {
16724
- const candidate2 = value[field];
16773
+ for (const field2 of tokenFields) {
16774
+ const candidate2 = value[field2];
16725
16775
  if (candidate2 !== void 0 && (typeof candidate2 !== "number" || !Number.isSafeInteger(candidate2) || candidate2 < 0)) {
16726
- throw new Error(`Harness Usage '${field}' must be a non-negative safe integer`);
16776
+ throw new Error(`Harness Usage '${field2}' must be a non-negative safe integer`);
16727
16777
  }
16728
16778
  }
16729
- for (const field of safeIntegerFields) {
16730
- const candidate2 = value[field];
16779
+ for (const field2 of safeIntegerFields) {
16780
+ const candidate2 = value[field2];
16731
16781
  if (candidate2 !== void 0 && (typeof candidate2 !== "number" || !Number.isSafeInteger(candidate2) || candidate2 < 0)) {
16732
- throw new Error(`Harness Usage '${field}' must be a non-negative safe integer`);
16782
+ throw new Error(`Harness Usage '${field2}' must be a non-negative safe integer`);
16733
16783
  }
16734
16784
  }
16735
16785
  if (value.outputTokensPerSecond !== void 0 && (typeof value.outputTokensPerSecond !== "number" || !Number.isFinite(value.outputTokensPerSecond) || value.outputTokensPerSecond < 0)) {
@@ -16738,16 +16788,16 @@ function parseHostUsage(value) {
16738
16788
  if (value.totalCostUsd !== void 0 && (typeof value.totalCostUsd !== "number" || !Number.isFinite(value.totalCostUsd) || value.totalCostUsd < 0)) {
16739
16789
  throw new Error("Harness Usage 'totalCostUsd' must be a finite non-negative number");
16740
16790
  }
16741
- for (const field of ["totalCredits", "contextUsagePercent"]) {
16742
- const candidate2 = value[field];
16791
+ for (const field2 of ["totalCredits", "contextUsagePercent"]) {
16792
+ const candidate2 = value[field2];
16743
16793
  if (candidate2 !== void 0 && (typeof candidate2 !== "number" || !Number.isFinite(candidate2) || candidate2 < 0)) {
16744
- throw new Error(`Harness Usage '${field}' must be a finite non-negative number`);
16794
+ throw new Error(`Harness Usage '${field2}' must be a finite non-negative number`);
16745
16795
  }
16746
16796
  }
16747
- for (const field of percentFields) {
16748
- const candidate2 = value[field];
16797
+ for (const field2 of percentFields) {
16798
+ const candidate2 = value[field2];
16749
16799
  if (candidate2 !== void 0 && (typeof candidate2 !== "number" || !Number.isFinite(candidate2) || candidate2 < 0 || candidate2 > 100)) {
16750
- throw new Error(`Harness Usage '${field}' must be between 0 and 100`);
16800
+ throw new Error(`Harness Usage '${field2}' must be between 0 and 100`);
16751
16801
  }
16752
16802
  }
16753
16803
  if (value.sessionCacheUsage !== void 0) {
@@ -16818,19 +16868,19 @@ function parseHostUsageRequest(value) {
16818
16868
  if (typeof value.requestId !== "string" || value.requestId.length === 0) {
16819
16869
  throw new Error("Harness Usage request 'requestId' must be a non-empty string");
16820
16870
  }
16821
- for (const field of ["model", "provider"]) {
16822
- const candidate2 = value[field];
16871
+ for (const field2 of ["model", "provider"]) {
16872
+ const candidate2 = value[field2];
16823
16873
  if (candidate2 !== void 0 && (typeof candidate2 !== "string" || candidate2.length === 0)) {
16824
- throw new Error(`Harness Usage request '${field}' must be a non-empty string`);
16874
+ throw new Error(`Harness Usage request '${field2}' must be a non-empty string`);
16825
16875
  }
16826
16876
  }
16827
16877
  if (value.historical !== void 0 && typeof value.historical !== "boolean") {
16828
16878
  throw new Error("Harness Usage request 'historical' must be a boolean");
16829
16879
  }
16830
- for (const field of requestTokenFields) {
16831
- const candidate2 = value[field];
16880
+ for (const field2 of requestTokenFields) {
16881
+ const candidate2 = value[field2];
16832
16882
  if (candidate2 !== void 0 && (typeof candidate2 !== "number" || !Number.isSafeInteger(candidate2) || candidate2 < 0)) {
16833
- throw new Error(`Harness Usage request '${field}' must be a non-negative safe integer`);
16883
+ throw new Error(`Harness Usage request '${field2}' must be a non-negative safe integer`);
16834
16884
  }
16835
16885
  }
16836
16886
  if (value.inputTokens === void 0 || value.outputTokens === void 0) {
@@ -18224,24 +18274,24 @@ var buildClientParams = (args, fields) => {
18224
18274
  }
18225
18275
  if ("in" in config2) {
18226
18276
  if (config2.key) {
18227
- const field = map2.get(config2.key);
18228
- const name = field.map || config2.key;
18229
- if (field.in) {
18277
+ const field2 = map2.get(config2.key);
18278
+ const name = field2.map || config2.key;
18279
+ if (field2.in) {
18230
18280
  ;
18231
- params[field.in][name] = arg;
18281
+ params[field2.in][name] = arg;
18232
18282
  }
18233
18283
  } else {
18234
18284
  params.body = arg;
18235
18285
  }
18236
18286
  } else {
18237
18287
  for (const [key, value] of Object.entries(arg ?? {})) {
18238
- const field = map2.get(key);
18239
- if (field) {
18240
- if (field.in) {
18241
- const name = field.map || key;
18242
- params[field.in][name] = value;
18288
+ const field2 = map2.get(key);
18289
+ if (field2) {
18290
+ if (field2.in) {
18291
+ const name = field2.map || key;
18292
+ params[field2.in][name] = value;
18243
18293
  } else {
18244
- params[field.map] = value;
18294
+ params[field2.map] = value;
18245
18295
  }
18246
18296
  } else {
18247
18297
  const extra = extraPrefixes.find(([prefix]) => key.startsWith(prefix));
@@ -24378,8 +24428,8 @@ var OpenCodeHarnessSession = class {
24378
24428
  this.#event({ type: "item.started", turnId: active.turnId, item });
24379
24429
  }
24380
24430
  }
24381
- #appendPartDelta(active, partID, field, delta) {
24382
- if (field !== "text" || !delta)
24431
+ #appendPartDelta(active, partID, field2, delta) {
24432
+ if (field2 !== "text" || !delta)
24383
24433
  return;
24384
24434
  const existing = active.items.get(partID);
24385
24435
  if (!existing)
@@ -27374,16 +27424,16 @@ function permissionInteraction(request, turnId) {
27374
27424
  };
27375
27425
  }
27376
27426
  function formInteraction(form, turnId) {
27377
- const questions = form.fields.map((field) => {
27378
- if (field.type === "external" || field.hidden || field.when?.length) {
27427
+ const questions = form.fields.map((field2) => {
27428
+ if (field2.type === "external" || field2.hidden || field2.when?.length) {
27379
27429
  throw new Error("OpenCode v2 external, hidden or conditional form fields require its native UI");
27380
27430
  }
27381
27431
  const base = {
27382
- id: field.key,
27383
- prompt: [field.title, field.description].filter(Boolean).join("\n") || field.key,
27384
- optional: !field.required
27432
+ id: field2.key,
27433
+ prompt: [field2.title, field2.description].filter(Boolean).join("\n") || field2.key,
27434
+ optional: !field2.required
27385
27435
  };
27386
- if (field.type === "boolean")
27436
+ if (field2.type === "boolean")
27387
27437
  return {
27388
27438
  ...base,
27389
27439
  type: "choice",
@@ -27394,22 +27444,22 @@ function formInteraction(form, turnId) {
27394
27444
  { value: "false", label: "No" }
27395
27445
  ]
27396
27446
  };
27397
- if (field.type === "multiselect" || field.type === "string" && field.options?.length) {
27447
+ if (field2.type === "multiselect" || field2.type === "string" && field2.options?.length) {
27398
27448
  return {
27399
27449
  ...base,
27400
27450
  type: "choice",
27401
- multiple: field.type === "multiselect",
27402
- allowOther: field.custom ?? false,
27403
- options: field.options ?? []
27451
+ multiple: field2.type === "multiselect",
27452
+ allowOther: field2.custom ?? false,
27453
+ options: field2.options ?? []
27404
27454
  };
27405
27455
  }
27406
27456
  return {
27407
27457
  ...base,
27408
27458
  type: "text",
27409
- multiline: field.type === "string",
27459
+ multiline: field2.type === "string",
27410
27460
  secret: false,
27411
- ...field.type === "string" && field.placeholder ? { placeholder: field.placeholder } : {},
27412
- ...field.default !== void 0 ? { prefill: String(field.default) } : {}
27461
+ ...field2.type === "string" && field2.placeholder ? { placeholder: field2.placeholder } : {},
27462
+ ...field2.default !== void 0 ? { prefill: String(field2.default) } : {}
27413
27463
  };
27414
27464
  });
27415
27465
  return {
@@ -27452,24 +27502,24 @@ async function replyInteraction(client2, pending, command) {
27452
27502
  return;
27453
27503
  }
27454
27504
  const answer = {};
27455
- for (const field of form.fields) {
27456
- const values = command.response.answers[field.key] ?? [];
27505
+ for (const field2 of form.fields) {
27506
+ const values = command.response.answers[field2.key] ?? [];
27457
27507
  if (!values.length)
27458
27508
  continue;
27459
27509
  const value = values[0];
27460
27510
  if (value === void 0)
27461
27511
  continue;
27462
- if (field.type === "multiselect")
27463
- answer[field.key] = values;
27464
- else if (field.type === "boolean")
27465
- answer[field.key] = value === "true";
27466
- else if (field.type === "number" || field.type === "integer") {
27512
+ if (field2.type === "multiselect")
27513
+ answer[field2.key] = values;
27514
+ else if (field2.type === "boolean")
27515
+ answer[field2.key] = value === "true";
27516
+ else if (field2.type === "number" || field2.type === "integer") {
27467
27517
  const number4 = Number(value);
27468
- if (!value.trim() || !Number.isFinite(number4) || field.type === "integer" && !Number.isInteger(number4))
27469
- throw new Error(`Invalid number for ${field.key}`);
27470
- answer[field.key] = number4;
27518
+ if (!value.trim() || !Number.isFinite(number4) || field2.type === "integer" && !Number.isInteger(number4))
27519
+ throw new Error(`Invalid number for ${field2.key}`);
27520
+ answer[field2.key] = number4;
27471
27521
  } else
27472
- answer[field.key] = value;
27522
+ answer[field2.key] = value;
27473
27523
  }
27474
27524
  await client2.session.form.reply({ sessionID: form.sessionID, formID: form.id, answer });
27475
27525
  }