@karlorz/codexhost-cli-win32-x64 0.14.0-3 → 0.14.0-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.
@@ -7281,10 +7281,10 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
7281
7281
  const shape = def.shape;
7282
7282
  const propValues = {};
7283
7283
  for (const key in shape) {
7284
- const field = shape[key]._zod;
7285
- if (field.values) {
7284
+ const field2 = shape[key]._zod;
7285
+ if (field2.values) {
7286
7286
  propValues[key] ?? (propValues[key] = /* @__PURE__ */ new Set());
7287
- for (const v of field.values)
7287
+ for (const v of field2.values)
7288
7288
  propValues[key].add(v);
7289
7289
  }
7290
7290
  }
@@ -19111,6 +19111,62 @@ var CONSOLE_HOST_METHODS = Object.freeze([
19111
19111
  // ../../shared-contracts/dist/version.js
19112
19112
  var WORKSPACE_CONTRACT_VERSION = 1;
19113
19113
 
19114
+ // ../../shared-contracts/dist/thread-questions.js
19115
+ var threadQuestionsParamsSchema = external_exports.strictObject({ threadId: hostThreadIdSchema });
19116
+ var field = { id: external_exports.string().min(1), prompt: external_exports.string(), optional: external_exports.boolean() };
19117
+ var questionAutoResolutionSchema = external_exports.strictObject({
19118
+ deadlineUnixMs: external_exports.number().int().min(0).max(864e13),
19119
+ action: external_exports.enum(["recommended", "decline"]),
19120
+ resetOnActivity: external_exports.boolean().optional()
19121
+ });
19122
+ var threadQuestionSchema = external_exports.strictObject({
19123
+ interactionId: hostInteractionIdSchema,
19124
+ turnId: hostTurnIdSchema,
19125
+ title: external_exports.string().optional(),
19126
+ expiresAt: external_exports.string().optional(),
19127
+ autoResolution: questionAutoResolutionSchema.optional(),
19128
+ questions: external_exports.array(external_exports.discriminatedUnion("type", [
19129
+ external_exports.strictObject({
19130
+ ...field,
19131
+ type: external_exports.literal("choice"),
19132
+ multiple: external_exports.boolean(),
19133
+ allowOther: external_exports.boolean(),
19134
+ options: external_exports.array(external_exports.strictObject({
19135
+ value: external_exports.string().min(1),
19136
+ label: external_exports.string(),
19137
+ description: external_exports.string().optional()
19138
+ })).min(1)
19139
+ }),
19140
+ external_exports.strictObject({
19141
+ ...field,
19142
+ type: external_exports.literal("text"),
19143
+ multiline: external_exports.boolean(),
19144
+ secret: external_exports.literal(false),
19145
+ placeholder: external_exports.string().optional(),
19146
+ prefill: external_exports.string().optional()
19147
+ })
19148
+ ])).min(1)
19149
+ });
19150
+ var threadQuestionsResultSchema = external_exports.strictObject({
19151
+ questions: external_exports.array(threadQuestionSchema)
19152
+ });
19153
+ var threadQuestionRespondParamsSchema = external_exports.strictObject({
19154
+ threadId: hostThreadIdSchema,
19155
+ interactionId: hostInteractionIdSchema,
19156
+ turnId: hostTurnIdSchema,
19157
+ answers: external_exports.record(external_exports.string(), external_exports.array(external_exports.string())),
19158
+ cancelled: external_exports.boolean().optional()
19159
+ });
19160
+ var threadQuestionRespondResultSchema = external_exports.strictObject({ accepted: external_exports.literal(true) });
19161
+ var threadQuestionActivityParamsSchema = external_exports.strictObject({
19162
+ threadId: hostThreadIdSchema,
19163
+ interactionId: hostInteractionIdSchema,
19164
+ turnId: hostTurnIdSchema
19165
+ });
19166
+ var threadQuestionActivityResultSchema = external_exports.strictObject({
19167
+ autoResolution: questionAutoResolutionSchema.nullable()
19168
+ });
19169
+
19114
19170
  // ../../shared-contracts/dist/idle-release.js
19115
19171
  var IDLE_RELEASE_TIMEOUT_MINUTES_MIN = 5;
19116
19172
  var IDLE_RELEASE_TIMEOUT_MINUTES_MAX = 1440;
@@ -20326,6 +20382,9 @@ function validateHostQuestionResponse(interaction, response) {
20326
20382
  }
20327
20383
  for (const question of interaction.questions) {
20328
20384
  const answers = response.answers[question.id] ?? [];
20385
+ if (new Set(answers).size !== answers.length) {
20386
+ return invalidRequest2("Question Response contains duplicate answers");
20387
+ }
20329
20388
  if (!question.optional && answers.length === 0) {
20330
20389
  return invalidRequest2("Question Response omits a required answer");
20331
20390
  }
@@ -20489,26 +20548,26 @@ function parseHostUsage(value) {
20489
20548
  }
20490
20549
  }
20491
20550
  const indicators = value.composerIndicators === void 0 ? {} : { composerIndicators: composerIndicatorsSchema.parse(value.composerIndicators) };
20492
- for (const field of [
20551
+ for (const field2 of [
20493
20552
  "totalCredits",
20494
20553
  "contextUsagePercent",
20495
20554
  "apiOutputTokensPerSecond"
20496
20555
  ]) {
20497
- const candidate = value[field];
20556
+ const candidate = value[field2];
20498
20557
  if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isFinite(candidate) || candidate < 0)) {
20499
- throw new Error(`Harness Usage '${field}' must be a finite non-negative number`);
20558
+ throw new Error(`Harness Usage '${field2}' must be a finite non-negative number`);
20500
20559
  }
20501
20560
  }
20502
- for (const field of tokenFields) {
20503
- const candidate = value[field];
20561
+ for (const field2 of tokenFields) {
20562
+ const candidate = value[field2];
20504
20563
  if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isSafeInteger(candidate) || candidate < 0)) {
20505
- throw new Error(`Harness Usage '${field}' must be a non-negative safe integer`);
20564
+ throw new Error(`Harness Usage '${field2}' must be a non-negative safe integer`);
20506
20565
  }
20507
20566
  }
20508
- for (const field of safeIntegerFields) {
20509
- const candidate = value[field];
20567
+ for (const field2 of safeIntegerFields) {
20568
+ const candidate = value[field2];
20510
20569
  if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isSafeInteger(candidate) || candidate < 0)) {
20511
- throw new Error(`Harness Usage '${field}' must be a non-negative safe integer`);
20570
+ throw new Error(`Harness Usage '${field2}' must be a non-negative safe integer`);
20512
20571
  }
20513
20572
  }
20514
20573
  if (value.outputTokensPerSecond !== void 0 && (typeof value.outputTokensPerSecond !== "number" || !Number.isFinite(value.outputTokensPerSecond) || value.outputTokensPerSecond < 0)) {
@@ -20517,10 +20576,10 @@ function parseHostUsage(value) {
20517
20576
  if (value.totalCostUsd !== void 0 && (typeof value.totalCostUsd !== "number" || !Number.isFinite(value.totalCostUsd) || value.totalCostUsd < 0)) {
20518
20577
  throw new Error("Harness Usage 'totalCostUsd' must be a finite non-negative number");
20519
20578
  }
20520
- for (const field of percentFields) {
20521
- const candidate = value[field];
20579
+ for (const field2 of percentFields) {
20580
+ const candidate = value[field2];
20522
20581
  if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isFinite(candidate) || candidate < 0 || candidate > 100)) {
20523
- throw new Error(`Harness Usage '${field}' must be between 0 and 100`);
20582
+ throw new Error(`Harness Usage '${field2}' must be between 0 and 100`);
20524
20583
  }
20525
20584
  }
20526
20585
  if (value.sessionCacheUsage !== void 0) {
@@ -20591,19 +20650,19 @@ function parseHostUsageRequest(value) {
20591
20650
  if (typeof value.requestId !== "string" || value.requestId.length === 0) {
20592
20651
  throw new Error("Harness Usage request 'requestId' must be a non-empty string");
20593
20652
  }
20594
- for (const field of ["model", "provider"]) {
20595
- const candidate = value[field];
20653
+ for (const field2 of ["model", "provider"]) {
20654
+ const candidate = value[field2];
20596
20655
  if (candidate !== void 0 && (typeof candidate !== "string" || candidate.length === 0)) {
20597
- throw new Error(`Harness Usage request '${field}' must be a non-empty string`);
20656
+ throw new Error(`Harness Usage request '${field2}' must be a non-empty string`);
20598
20657
  }
20599
20658
  }
20600
20659
  if (value.historical !== void 0 && typeof value.historical !== "boolean") {
20601
20660
  throw new Error("Harness Usage request 'historical' must be a boolean");
20602
20661
  }
20603
- for (const field of requestTokenFields) {
20604
- const candidate = value[field];
20662
+ for (const field2 of requestTokenFields) {
20663
+ const candidate = value[field2];
20605
20664
  if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isSafeInteger(candidate) || candidate < 0)) {
20606
- throw new Error(`Harness Usage request '${field}' must be a non-negative safe integer`);
20665
+ throw new Error(`Harness Usage request '${field2}' must be a non-negative safe integer`);
20607
20666
  }
20608
20667
  }
20609
20668
  if (value.inputTokens === void 0 || value.outputTokens === void 0) {
@@ -21418,9 +21477,9 @@ var DEEPSEEK_USAGE_COUNTERS = [
21418
21477
  "reasoningOutputTokens"
21419
21478
  ];
21420
21479
  function mergeDeepSeekUsage(current, next) {
21421
- const counters = Object.fromEntries(DEEPSEEK_USAGE_COUNTERS.flatMap((field) => {
21422
- const value = (current?.[field] ?? 0) + (next[field] ?? 0);
21423
- return current?.[field] !== void 0 || next[field] !== void 0 ? [[field, value]] : [];
21480
+ const counters = Object.fromEntries(DEEPSEEK_USAGE_COUNTERS.flatMap((field2) => {
21481
+ const value = (current?.[field2] ?? 0) + (next[field2] ?? 0);
21482
+ return current?.[field2] !== void 0 || next[field2] !== void 0 ? [[field2, value]] : [];
21424
21483
  }));
21425
21484
  const context = next.contextUsedTokens !== void 0 && next.contextWindowTokens !== void 0 ? {
21426
21485
  contextUsedTokens: next.contextUsedTokens,
@@ -21832,7 +21891,7 @@ function onlyKeys(value, required2, optional2 = []) {
21832
21891
  return required2.every((key) => Object.hasOwn(value, key)) && Reflect.ownKeys(value).every((key) => typeof key === "string" && allowed.has(key));
21833
21892
  }
21834
21893
  function requiredFields(value, fields) {
21835
- if (fields.some((field) => !Object.hasOwn(value, field)))
21894
+ if (fields.some((field2) => !Object.hasOwn(value, field2)))
21836
21895
  throw invalid("required fields");
21837
21896
  }
21838
21897
  function assertJsonValue2(value, label) {
@@ -22156,9 +22215,9 @@ function validateTeamPayload(type, data) {
22156
22215
  identifier(value.id, "team payload id");
22157
22216
  if (key === "member") {
22158
22217
  requiredOptionalKeys(value, ["id", "name", "description", "provider", "context", "phase"], ["error"]);
22159
- for (const field of ["name", "description", "provider"])
22160
- if (typeof value[field] !== "string")
22161
- throw invalid(`team member ${field}`);
22218
+ for (const field2 of ["name", "description", "provider"])
22219
+ if (typeof value[field2] !== "string")
22220
+ throw invalid(`team member ${field2}`);
22162
22221
  if (!["fresh", "fork"].includes(value.context) || !["provisioning", "active", "failed"].includes(value.phase) || value.error !== void 0 && typeof value.error !== "string")
22163
22222
  throw invalid("team member");
22164
22223
  } else if (key === "task") {
@@ -22172,8 +22231,8 @@ function validateTeamPayload(type, data) {
22172
22231
  stringArray(value.writeScopes, "team task writeScopes");
22173
22232
  } else {
22174
22233
  exactKeys(value, ["id", "senderId", "senderName", "targetId", "content"]);
22175
- for (const field of ["senderId", "senderName", "targetId"])
22176
- identifier(value[field], `team message ${field}`);
22234
+ for (const field2 of ["senderId", "senderName", "targetId"])
22235
+ identifier(value[field2], `team message ${field2}`);
22177
22236
  validateBlocks(value.content);
22178
22237
  }
22179
22238
  }
@@ -28175,7 +28234,7 @@ function validateToolResultMessage(value, profile) {
28175
28234
  return callId;
28176
28235
  }
28177
28236
  function requiredFields2(value, fields) {
28178
- if (fields.some((field) => !Object.hasOwn(value, field))) {
28237
+ if (fields.some((field2) => !Object.hasOwn(value, field2))) {
28179
28238
  fail("Modern history known event omitted a required field");
28180
28239
  }
28181
28240
  }
@@ -28200,7 +28259,7 @@ function validUsage(value) {
28200
28259
  if (!nonNegativeSafeInteger2(value.inputTokens) || !nonNegativeSafeInteger2(value.outputTokens)) {
28201
28260
  return false;
28202
28261
  }
28203
- return fields.slice(2).every((field) => value[field] === void 0 || nonNegativeSafeInteger2(value[field]));
28262
+ return fields.slice(2).every((field2) => value[field2] === void 0 || nonNegativeSafeInteger2(value[field2]));
28204
28263
  }
28205
28264
  function validateTurnReason(value) {
28206
28265
  if (!isRecord4(value) || typeof value.kind !== "string") {