@karlorz/codexhost-cli-win32-x64 0.14.0-3 → 0.14.0-4

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.
@@ -7091,10 +7091,10 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
7091
7091
  const shape = def.shape;
7092
7092
  const propValues = {};
7093
7093
  for (const key in shape) {
7094
- const field = shape[key]._zod;
7095
- if (field.values) {
7094
+ const field2 = shape[key]._zod;
7095
+ if (field2.values) {
7096
7096
  propValues[key] ?? (propValues[key] = /* @__PURE__ */ new Set());
7097
- for (const v of field.values)
7097
+ for (const v of field2.values)
7098
7098
  propValues[key].add(v);
7099
7099
  }
7100
7100
  }
@@ -18921,6 +18921,62 @@ var CONSOLE_HOST_METHODS = Object.freeze([
18921
18921
  // ../../shared-contracts/dist/version.js
18922
18922
  var WORKSPACE_CONTRACT_VERSION = 1;
18923
18923
 
18924
+ // ../../shared-contracts/dist/thread-questions.js
18925
+ var threadQuestionsParamsSchema = external_exports.strictObject({ threadId: hostThreadIdSchema });
18926
+ var field = { id: external_exports.string().min(1), prompt: external_exports.string(), optional: external_exports.boolean() };
18927
+ var questionAutoResolutionSchema = external_exports.strictObject({
18928
+ deadlineUnixMs: external_exports.number().int().min(0).max(864e13),
18929
+ action: external_exports.enum(["recommended", "decline"]),
18930
+ resetOnActivity: external_exports.boolean().optional()
18931
+ });
18932
+ var threadQuestionSchema = external_exports.strictObject({
18933
+ interactionId: hostInteractionIdSchema,
18934
+ turnId: hostTurnIdSchema,
18935
+ title: external_exports.string().optional(),
18936
+ expiresAt: external_exports.string().optional(),
18937
+ autoResolution: questionAutoResolutionSchema.optional(),
18938
+ questions: external_exports.array(external_exports.discriminatedUnion("type", [
18939
+ external_exports.strictObject({
18940
+ ...field,
18941
+ type: external_exports.literal("choice"),
18942
+ multiple: external_exports.boolean(),
18943
+ allowOther: external_exports.boolean(),
18944
+ options: external_exports.array(external_exports.strictObject({
18945
+ value: external_exports.string().min(1),
18946
+ label: external_exports.string(),
18947
+ description: external_exports.string().optional()
18948
+ })).min(1)
18949
+ }),
18950
+ external_exports.strictObject({
18951
+ ...field,
18952
+ type: external_exports.literal("text"),
18953
+ multiline: external_exports.boolean(),
18954
+ secret: external_exports.literal(false),
18955
+ placeholder: external_exports.string().optional(),
18956
+ prefill: external_exports.string().optional()
18957
+ })
18958
+ ])).min(1)
18959
+ });
18960
+ var threadQuestionsResultSchema = external_exports.strictObject({
18961
+ questions: external_exports.array(threadQuestionSchema)
18962
+ });
18963
+ var threadQuestionRespondParamsSchema = external_exports.strictObject({
18964
+ threadId: hostThreadIdSchema,
18965
+ interactionId: hostInteractionIdSchema,
18966
+ turnId: hostTurnIdSchema,
18967
+ answers: external_exports.record(external_exports.string(), external_exports.array(external_exports.string())),
18968
+ cancelled: external_exports.boolean().optional()
18969
+ });
18970
+ var threadQuestionRespondResultSchema = external_exports.strictObject({ accepted: external_exports.literal(true) });
18971
+ var threadQuestionActivityParamsSchema = external_exports.strictObject({
18972
+ threadId: hostThreadIdSchema,
18973
+ interactionId: hostInteractionIdSchema,
18974
+ turnId: hostTurnIdSchema
18975
+ });
18976
+ var threadQuestionActivityResultSchema = external_exports.strictObject({
18977
+ autoResolution: questionAutoResolutionSchema.nullable()
18978
+ });
18979
+
18924
18980
  // ../../shared-contracts/dist/idle-release.js
18925
18981
  var IDLE_RELEASE_TIMEOUT_MINUTES_MIN = 5;
18926
18982
  var IDLE_RELEASE_TIMEOUT_MINUTES_MAX = 1440;
@@ -27657,19 +27713,19 @@ var CopilotSession = class {
27657
27713
  }
27658
27714
  async _input(message, options2) {
27659
27715
  this.assertElicitation();
27660
- const field = { type: "string" };
27661
- if (options2?.title) field.title = options2.title;
27662
- if (options2?.description) field.description = options2.description;
27663
- if (options2?.minLength != null) field.minLength = options2.minLength;
27664
- if (options2?.maxLength != null) field.maxLength = options2.maxLength;
27665
- if (options2?.format) field.format = options2.format;
27666
- if (options2?.default != null) field.default = options2.default;
27716
+ const field2 = { type: "string" };
27717
+ if (options2?.title) field2.title = options2.title;
27718
+ if (options2?.description) field2.description = options2.description;
27719
+ if (options2?.minLength != null) field2.minLength = options2.minLength;
27720
+ if (options2?.maxLength != null) field2.maxLength = options2.maxLength;
27721
+ if (options2?.format) field2.format = options2.format;
27722
+ if (options2?.default != null) field2.default = options2.default;
27667
27723
  const result = await this.rpc.ui.elicitation({
27668
27724
  message,
27669
27725
  requestedSchema: {
27670
27726
  type: "object",
27671
27727
  properties: {
27672
- value: field
27728
+ value: field2
27673
27729
  },
27674
27730
  required: ["value"]
27675
27731
  }
@@ -28844,14 +28900,14 @@ function toolFilterListToArray(value) {
28844
28900
  }
28845
28901
  return value instanceof ToolSet ? value.toArray() : value;
28846
28902
  }
28847
- function validateToolFilterList(field, list) {
28903
+ function validateToolFilterList(field2, list) {
28848
28904
  if (!list) {
28849
28905
  return;
28850
28906
  }
28851
28907
  for (const entry of list) {
28852
28908
  if (entry === "*") {
28853
28909
  throw new Error(
28854
- `Invalid ${field} entry '*': there is no bare wildcard. Use one or more of \`new ToolSet().addBuiltIn('*')\`, \`.addMcp('*')\`, or \`.addCustom('*')\` to target a specific source.`
28910
+ `Invalid ${field2} entry '*': there is no bare wildcard. Use one or more of \`new ToolSet().addBuiltIn('*')\`, \`.addMcp('*')\`, or \`.addCustom('*')\` to target a specific source.`
28855
28911
  );
28856
28912
  }
28857
28913
  }
@@ -32104,6 +32160,9 @@ function validateHostQuestionResponse(interaction, response) {
32104
32160
  }
32105
32161
  for (const question of interaction.questions) {
32106
32162
  const answers = response.answers[question.id] ?? [];
32163
+ if (new Set(answers).size !== answers.length) {
32164
+ return invalidRequest2("Question Response contains duplicate answers");
32165
+ }
32107
32166
  if (!question.optional && answers.length === 0) {
32108
32167
  return invalidRequest2("Question Response omits a required answer");
32109
32168
  }
@@ -32262,26 +32321,26 @@ function parseHostUsage(value) {
32262
32321
  }
32263
32322
  }
32264
32323
  const indicators = value.composerIndicators === void 0 ? {} : { composerIndicators: composerIndicatorsSchema.parse(value.composerIndicators) };
32265
- for (const field of [
32324
+ for (const field2 of [
32266
32325
  "totalCredits",
32267
32326
  "contextUsagePercent",
32268
32327
  "apiOutputTokensPerSecond"
32269
32328
  ]) {
32270
- const candidate = value[field];
32329
+ const candidate = value[field2];
32271
32330
  if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isFinite(candidate) || candidate < 0)) {
32272
- throw new Error(`Harness Usage '${field}' must be a finite non-negative number`);
32331
+ throw new Error(`Harness Usage '${field2}' must be a finite non-negative number`);
32273
32332
  }
32274
32333
  }
32275
- for (const field of tokenFields) {
32276
- const candidate = value[field];
32334
+ for (const field2 of tokenFields) {
32335
+ const candidate = value[field2];
32277
32336
  if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isSafeInteger(candidate) || candidate < 0)) {
32278
- throw new Error(`Harness Usage '${field}' must be a non-negative safe integer`);
32337
+ throw new Error(`Harness Usage '${field2}' must be a non-negative safe integer`);
32279
32338
  }
32280
32339
  }
32281
- for (const field of safeIntegerFields) {
32282
- const candidate = value[field];
32340
+ for (const field2 of safeIntegerFields) {
32341
+ const candidate = value[field2];
32283
32342
  if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isSafeInteger(candidate) || candidate < 0)) {
32284
- throw new Error(`Harness Usage '${field}' must be a non-negative safe integer`);
32343
+ throw new Error(`Harness Usage '${field2}' must be a non-negative safe integer`);
32285
32344
  }
32286
32345
  }
32287
32346
  if (value.outputTokensPerSecond !== void 0 && (typeof value.outputTokensPerSecond !== "number" || !Number.isFinite(value.outputTokensPerSecond) || value.outputTokensPerSecond < 0)) {
@@ -32290,10 +32349,10 @@ function parseHostUsage(value) {
32290
32349
  if (value.totalCostUsd !== void 0 && (typeof value.totalCostUsd !== "number" || !Number.isFinite(value.totalCostUsd) || value.totalCostUsd < 0)) {
32291
32350
  throw new Error("Harness Usage 'totalCostUsd' must be a finite non-negative number");
32292
32351
  }
32293
- for (const field of percentFields) {
32294
- const candidate = value[field];
32352
+ for (const field2 of percentFields) {
32353
+ const candidate = value[field2];
32295
32354
  if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isFinite(candidate) || candidate < 0 || candidate > 100)) {
32296
- throw new Error(`Harness Usage '${field}' must be between 0 and 100`);
32355
+ throw new Error(`Harness Usage '${field2}' must be between 0 and 100`);
32297
32356
  }
32298
32357
  }
32299
32358
  if (value.sessionCacheUsage !== void 0) {
@@ -32633,18 +32692,18 @@ function calendarDate(value) {
32633
32692
  const timestamp = Date.parse(value);
32634
32693
  return /^\d{4}-\d{2}-\d{2}$/u.test(value) && Number.isFinite(timestamp) && new Date(timestamp).toISOString().slice(0, 10) === value;
32635
32694
  }
32636
- function options(field) {
32637
- if (field.type === "boolean")
32695
+ function options(field2) {
32696
+ if (field2.type === "boolean")
32638
32697
  return [
32639
32698
  { value: "true", label: "Yes" },
32640
32699
  { value: "false", label: "No" }
32641
32700
  ];
32642
- if (field.type === "string" && "enum" in field)
32643
- return field.enum.map((value, index) => ({ value, label: field.enumNames?.[index] ?? value }));
32644
- if (field.type === "string" && "oneOf" in field)
32645
- return field.oneOf.map((option) => ({ value: option.const, label: option.title }));
32646
- if (field.type === "array") {
32647
- return "enum" in field.items ? field.items.enum.map((value) => ({ value, label: value })) : field.items.anyOf.map((option) => ({ value: option.const, label: option.title }));
32701
+ if (field2.type === "string" && "enum" in field2)
32702
+ return field2.enum.map((value, index) => ({ value, label: field2.enumNames?.[index] ?? value }));
32703
+ if (field2.type === "string" && "oneOf" in field2)
32704
+ return field2.oneOf.map((option) => ({ value: option.const, label: option.title }));
32705
+ if (field2.type === "array") {
32706
+ return "enum" in field2.items ? field2.items.enum.map((value) => ({ value, label: value })) : field2.items.anyOf.map((option) => ({ value: option.const, label: option.title }));
32648
32707
  }
32649
32708
  }
32650
32709
  function elicitationForm(context) {
@@ -32653,22 +32712,22 @@ function elicitationForm(context) {
32653
32712
  throw new CopilotOperationError("unsupported", "Copilot elicitation requires a supported primitive form; browser URL flows are unavailable.");
32654
32713
  if (schema.required?.some((id) => !Object.hasOwn(schema.properties, id)))
32655
32714
  throw new Error("Copilot form refers to an unknown required field");
32656
- const questions = Object.entries(schema.properties).map(([id, field]) => {
32715
+ const questions = Object.entries(schema.properties).map(([id, field2]) => {
32657
32716
  const allowed = /* @__PURE__ */ new Set([
32658
32717
  "type",
32659
32718
  "title",
32660
32719
  "description",
32661
32720
  "default",
32662
- ...field.type === "string" ? ["enum", "enumNames", "oneOf", "minLength", "maxLength", "format"] : field.type === "array" ? ["items", "minItems", "maxItems"] : field.type === "number" || field.type === "integer" ? ["minimum", "maximum"] : []
32721
+ ...field2.type === "string" ? ["enum", "enumNames", "oneOf", "minLength", "maxLength", "format"] : field2.type === "array" ? ["items", "minItems", "maxItems"] : field2.type === "number" || field2.type === "integer" ? ["minimum", "maximum"] : []
32663
32722
  ]);
32664
- if (Object.keys(field).some((key) => !allowed.has(key)))
32723
+ if (Object.keys(field2).some((key) => !allowed.has(key)))
32665
32724
  throw new CopilotOperationError("unsupported", "Copilot form contains an unsupported constraint.");
32666
- if ("format" in field && field.format && !["email", "uri", "date", "date-time"].includes(field.format))
32725
+ if ("format" in field2 && field2.format && !["email", "uri", "date", "date-time"].includes(field2.format))
32667
32726
  throw new CopilotOperationError("unsupported", "Copilot form contains an unsupported text format.");
32668
- if (!["string", "number", "integer", "boolean", "array"].includes(field.type))
32727
+ if (!["string", "number", "integer", "boolean", "array"].includes(field2.type))
32669
32728
  throw new CopilotOperationError("unsupported", "Copilot form field cannot be represented");
32670
- const prompt = [field.title ?? id, field.description].filter(Boolean).join("\n");
32671
- const choices = options(field);
32729
+ const prompt = [field2.title ?? id, field2.description].filter(Boolean).join("\n");
32730
+ const choices = options(field2);
32672
32731
  const optional2 = !schema.required?.includes(id);
32673
32732
  if (choices)
32674
32733
  return {
@@ -32676,7 +32735,7 @@ function elicitationForm(context) {
32676
32735
  type: "choice",
32677
32736
  prompt,
32678
32737
  options: choices,
32679
- multiple: field.type === "array",
32738
+ multiple: field2.type === "array",
32680
32739
  allowOther: false,
32681
32740
  optional: optional2
32682
32741
  };
@@ -32684,43 +32743,43 @@ function elicitationForm(context) {
32684
32743
  id,
32685
32744
  type: "text",
32686
32745
  prompt,
32687
- multiline: field.type === "string",
32746
+ multiline: field2.type === "string",
32688
32747
  secret: false,
32689
32748
  optional: optional2,
32690
- ...field.default === void 0 ? {} : { prefill: String(field.default) }
32749
+ ...field2.default === void 0 ? {} : { prefill: String(field2.default) }
32691
32750
  };
32692
32751
  });
32693
32752
  const decode3 = (response) => {
32694
32753
  if (response.cancelled)
32695
32754
  return { action: "cancel" };
32696
32755
  const content = /* @__PURE__ */ Object.create(null);
32697
- for (const [id, field] of Object.entries(schema.properties)) {
32756
+ for (const [id, field2] of Object.entries(schema.properties)) {
32698
32757
  const values = Object.hasOwn(response.answers, id) ? response.answers[id] ?? [] : [];
32699
32758
  if (!values.length)
32700
32759
  continue;
32701
32760
  const value = values[0] ?? "";
32702
- if (field.type === "array") {
32703
- if (field.minItems !== void 0 && values.length < field.minItems || field.maxItems !== void 0 && values.length > field.maxItems)
32761
+ if (field2.type === "array") {
32762
+ if (field2.minItems !== void 0 && values.length < field2.minItems || field2.maxItems !== void 0 && values.length > field2.maxItems)
32704
32763
  throw new Error("The number of choices is outside the native form's limits.");
32705
32764
  content[id] = values;
32706
32765
  continue;
32707
32766
  }
32708
- if (field.type === "boolean") {
32767
+ if (field2.type === "boolean") {
32709
32768
  content[id] = value === "true";
32710
32769
  continue;
32711
32770
  }
32712
- if (field.type === "number" || field.type === "integer") {
32771
+ if (field2.type === "number" || field2.type === "integer") {
32713
32772
  const number4 = Number(value);
32714
- if (!value.trim() || !Number.isFinite(number4) || field.type === "integer" && !Number.isSafeInteger(number4) || field.minimum !== void 0 && number4 < field.minimum || field.maximum !== void 0 && number4 > field.maximum)
32773
+ if (!value.trim() || !Number.isFinite(number4) || field2.type === "integer" && !Number.isSafeInteger(number4) || field2.minimum !== void 0 && number4 < field2.minimum || field2.maximum !== void 0 && number4 > field2.maximum)
32715
32774
  throw new Error("The number is outside the native form's limits.");
32716
32775
  content[id] = number4;
32717
32776
  continue;
32718
32777
  }
32719
- if (field.type === "string") {
32720
- if ("minLength" in field && field.minLength !== void 0 && Array.from(value).length < field.minLength || "maxLength" in field && field.maxLength !== void 0 && Array.from(value).length > field.maxLength)
32778
+ if (field2.type === "string") {
32779
+ if ("minLength" in field2 && field2.minLength !== void 0 && Array.from(value).length < field2.minLength || "maxLength" in field2 && field2.maxLength !== void 0 && Array.from(value).length > field2.maxLength)
32721
32780
  throw new Error("The text length is outside the native form's limits.");
32722
- if ("format" in field && field.format) {
32723
- const valid = field.format === "email" ? /^[^\s@]+@[^\s@]+\.[^\s@]+$/u.test(value) : field.format === "uri" ? URL.canParse(value) : field.format === "date" ? calendarDate(value) : calendarDate(value.slice(0, 10)) && /^\d{4}-\d{2}-\d{2}T(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|[+-](?:[01]\d|2[0-3]):[0-5]\d)$/iu.test(value) && !Number.isNaN(Date.parse(value));
32781
+ if ("format" in field2 && field2.format) {
32782
+ const valid = field2.format === "email" ? /^[^\s@]+@[^\s@]+\.[^\s@]+$/u.test(value) : field2.format === "uri" ? URL.canParse(value) : field2.format === "date" ? calendarDate(value) : calendarDate(value.slice(0, 10)) && /^\d{4}-\d{2}-\d{2}T(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|[+-](?:[01]\d|2[0-3]):[0-5]\d)$/iu.test(value) && !Number.isNaN(Date.parse(value));
32724
32783
  if (!valid)
32725
32784
  throw new Error("The text does not match the native form's format.");
32726
32785
  }
@@ -3401,10 +3401,10 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
3401
3401
  const shape = def.shape;
3402
3402
  const propValues = {};
3403
3403
  for (const key in shape) {
3404
- const field = shape[key]._zod;
3405
- if (field.values) {
3404
+ const field2 = shape[key]._zod;
3405
+ if (field2.values) {
3406
3406
  propValues[key] ?? (propValues[key] = /* @__PURE__ */ new Set());
3407
- for (const v of field.values)
3407
+ for (const v of field2.values)
3408
3408
  propValues[key].add(v);
3409
3409
  }
3410
3410
  }
@@ -15231,6 +15231,62 @@ var CONSOLE_HOST_METHODS = Object.freeze([
15231
15231
  // ../../shared-contracts/dist/version.js
15232
15232
  var WORKSPACE_CONTRACT_VERSION = 1;
15233
15233
 
15234
+ // ../../shared-contracts/dist/thread-questions.js
15235
+ var threadQuestionsParamsSchema = external_exports.strictObject({ threadId: hostThreadIdSchema });
15236
+ var field = { id: external_exports.string().min(1), prompt: external_exports.string(), optional: external_exports.boolean() };
15237
+ var questionAutoResolutionSchema = external_exports.strictObject({
15238
+ deadlineUnixMs: external_exports.number().int().min(0).max(864e13),
15239
+ action: external_exports.enum(["recommended", "decline"]),
15240
+ resetOnActivity: external_exports.boolean().optional()
15241
+ });
15242
+ var threadQuestionSchema = external_exports.strictObject({
15243
+ interactionId: hostInteractionIdSchema,
15244
+ turnId: hostTurnIdSchema,
15245
+ title: external_exports.string().optional(),
15246
+ expiresAt: external_exports.string().optional(),
15247
+ autoResolution: questionAutoResolutionSchema.optional(),
15248
+ questions: external_exports.array(external_exports.discriminatedUnion("type", [
15249
+ external_exports.strictObject({
15250
+ ...field,
15251
+ type: external_exports.literal("choice"),
15252
+ multiple: external_exports.boolean(),
15253
+ allowOther: external_exports.boolean(),
15254
+ options: external_exports.array(external_exports.strictObject({
15255
+ value: external_exports.string().min(1),
15256
+ label: external_exports.string(),
15257
+ description: external_exports.string().optional()
15258
+ })).min(1)
15259
+ }),
15260
+ external_exports.strictObject({
15261
+ ...field,
15262
+ type: external_exports.literal("text"),
15263
+ multiline: external_exports.boolean(),
15264
+ secret: external_exports.literal(false),
15265
+ placeholder: external_exports.string().optional(),
15266
+ prefill: external_exports.string().optional()
15267
+ })
15268
+ ])).min(1)
15269
+ });
15270
+ var threadQuestionsResultSchema = external_exports.strictObject({
15271
+ questions: external_exports.array(threadQuestionSchema)
15272
+ });
15273
+ var threadQuestionRespondParamsSchema = external_exports.strictObject({
15274
+ threadId: hostThreadIdSchema,
15275
+ interactionId: hostInteractionIdSchema,
15276
+ turnId: hostTurnIdSchema,
15277
+ answers: external_exports.record(external_exports.string(), external_exports.array(external_exports.string())),
15278
+ cancelled: external_exports.boolean().optional()
15279
+ });
15280
+ var threadQuestionRespondResultSchema = external_exports.strictObject({ accepted: external_exports.literal(true) });
15281
+ var threadQuestionActivityParamsSchema = external_exports.strictObject({
15282
+ threadId: hostThreadIdSchema,
15283
+ interactionId: hostInteractionIdSchema,
15284
+ turnId: hostTurnIdSchema
15285
+ });
15286
+ var threadQuestionActivityResultSchema = external_exports.strictObject({
15287
+ autoResolution: questionAutoResolutionSchema.nullable()
15288
+ });
15289
+
15234
15290
  // ../../shared-contracts/dist/idle-release.js
15235
15291
  var IDLE_RELEASE_TIMEOUT_MINUTES_MIN = 5;
15236
15292
  var IDLE_RELEASE_TIMEOUT_MINUTES_MAX = 1440;
@@ -16442,6 +16498,9 @@ function validateHostQuestionResponse(interaction, response) {
16442
16498
  }
16443
16499
  for (const question of interaction.questions) {
16444
16500
  const answers = response.answers[question.id] ?? [];
16501
+ if (new Set(answers).size !== answers.length) {
16502
+ return invalidRequest2("Question Response contains duplicate answers");
16503
+ }
16445
16504
  if (!question.optional && answers.length === 0) {
16446
16505
  return invalidRequest2("Question Response omits a required answer");
16447
16506
  }
@@ -16600,26 +16659,26 @@ function parseHostUsage(value) {
16600
16659
  }
16601
16660
  }
16602
16661
  const indicators = value.composerIndicators === void 0 ? {} : { composerIndicators: composerIndicatorsSchema.parse(value.composerIndicators) };
16603
- for (const field of [
16662
+ for (const field2 of [
16604
16663
  "totalCredits",
16605
16664
  "contextUsagePercent",
16606
16665
  "apiOutputTokensPerSecond"
16607
16666
  ]) {
16608
- const candidate = value[field];
16667
+ const candidate = value[field2];
16609
16668
  if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isFinite(candidate) || candidate < 0)) {
16610
- throw new Error(`Harness Usage '${field}' must be a finite non-negative number`);
16669
+ throw new Error(`Harness Usage '${field2}' must be a finite non-negative number`);
16611
16670
  }
16612
16671
  }
16613
- for (const field of tokenFields) {
16614
- const candidate = value[field];
16672
+ for (const field2 of tokenFields) {
16673
+ const candidate = value[field2];
16615
16674
  if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isSafeInteger(candidate) || candidate < 0)) {
16616
- throw new Error(`Harness Usage '${field}' must be a non-negative safe integer`);
16675
+ throw new Error(`Harness Usage '${field2}' must be a non-negative safe integer`);
16617
16676
  }
16618
16677
  }
16619
- for (const field of safeIntegerFields) {
16620
- const candidate = value[field];
16678
+ for (const field2 of safeIntegerFields) {
16679
+ const candidate = value[field2];
16621
16680
  if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isSafeInteger(candidate) || candidate < 0)) {
16622
- throw new Error(`Harness Usage '${field}' must be a non-negative safe integer`);
16681
+ throw new Error(`Harness Usage '${field2}' must be a non-negative safe integer`);
16623
16682
  }
16624
16683
  }
16625
16684
  if (value.outputTokensPerSecond !== void 0 && (typeof value.outputTokensPerSecond !== "number" || !Number.isFinite(value.outputTokensPerSecond) || value.outputTokensPerSecond < 0)) {
@@ -16628,10 +16687,10 @@ function parseHostUsage(value) {
16628
16687
  if (value.totalCostUsd !== void 0 && (typeof value.totalCostUsd !== "number" || !Number.isFinite(value.totalCostUsd) || value.totalCostUsd < 0)) {
16629
16688
  throw new Error("Harness Usage 'totalCostUsd' must be a finite non-negative number");
16630
16689
  }
16631
- for (const field of percentFields) {
16632
- const candidate = value[field];
16690
+ for (const field2 of percentFields) {
16691
+ const candidate = value[field2];
16633
16692
  if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isFinite(candidate) || candidate < 0 || candidate > 100)) {
16634
- throw new Error(`Harness Usage '${field}' must be between 0 and 100`);
16693
+ throw new Error(`Harness Usage '${field2}' must be between 0 and 100`);
16635
16694
  }
16636
16695
  }
16637
16696
  if (value.sessionCacheUsage !== void 0) {
@@ -17118,8 +17177,8 @@ function protobufBytes(data) {
17118
17177
  const fields = /* @__PURE__ */ new Map();
17119
17178
  while (offset < data.length) {
17120
17179
  const tag = varint();
17121
- const field = Math.floor(tag / 8), wire = tag % 8;
17122
- if (!Number.isSafeInteger(tag) || field === 0)
17180
+ const field2 = Math.floor(tag / 8), wire = tag % 8;
17181
+ if (!Number.isSafeInteger(tag) || field2 === 0)
17123
17182
  throw new Error("Invalid Cursor native field");
17124
17183
  if (wire === 0) {
17125
17184
  varint();
@@ -17129,16 +17188,16 @@ function protobufBytes(data) {
17129
17188
  if (!Number.isSafeInteger(length) || length < 0 || offset + length > data.length)
17130
17189
  throw new Error("Unsupported Cursor native record");
17131
17190
  if (wire === 2) {
17132
- const values = fields.get(field) ?? [];
17191
+ const values = fields.get(field2) ?? [];
17133
17192
  values.push(Buffer.from(data.subarray(offset, offset + length)));
17134
- fields.set(field, values);
17193
+ fields.set(field2, values);
17135
17194
  }
17136
17195
  offset += length;
17137
17196
  }
17138
17197
  return fields;
17139
17198
  }
17140
- function one(fields, field) {
17141
- const values = fields.get(field);
17199
+ function one(fields, field2) {
17200
+ const values = fields.get(field2);
17142
17201
  if (values?.length !== 1 || !values[0])
17143
17202
  throw new Error("Cursor native history identity is missing or ambiguous");
17144
17203
  return values[0];