@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.
@@ -3098,10 +3098,10 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
3098
3098
  const shape = def.shape;
3099
3099
  const propValues = {};
3100
3100
  for (const key in shape) {
3101
- const field2 = shape[key]._zod;
3102
- if (field2.values) {
3101
+ const field3 = shape[key]._zod;
3102
+ if (field3.values) {
3103
3103
  propValues[key] ?? (propValues[key] = /* @__PURE__ */ new Set());
3104
- for (const v of field2.values)
3104
+ for (const v of field3.values)
3105
3105
  propValues[key].add(v);
3106
3106
  }
3107
3107
  }
@@ -15056,6 +15056,62 @@ var CONSOLE_HOST_METHODS = Object.freeze([
15056
15056
  // ../../shared-contracts/dist/version.js
15057
15057
  var WORKSPACE_CONTRACT_VERSION = 1;
15058
15058
 
15059
+ // ../../shared-contracts/dist/thread-questions.js
15060
+ var threadQuestionsParamsSchema = external_exports.strictObject({ threadId: hostThreadIdSchema });
15061
+ var field = { id: external_exports.string().min(1), prompt: external_exports.string(), optional: external_exports.boolean() };
15062
+ var questionAutoResolutionSchema = external_exports.strictObject({
15063
+ deadlineUnixMs: external_exports.number().int().min(0).max(864e13),
15064
+ action: external_exports.enum(["recommended", "decline"]),
15065
+ resetOnActivity: external_exports.boolean().optional()
15066
+ });
15067
+ var threadQuestionSchema = external_exports.strictObject({
15068
+ interactionId: hostInteractionIdSchema,
15069
+ turnId: hostTurnIdSchema,
15070
+ title: external_exports.string().optional(),
15071
+ expiresAt: external_exports.string().optional(),
15072
+ autoResolution: questionAutoResolutionSchema.optional(),
15073
+ questions: external_exports.array(external_exports.discriminatedUnion("type", [
15074
+ external_exports.strictObject({
15075
+ ...field,
15076
+ type: external_exports.literal("choice"),
15077
+ multiple: external_exports.boolean(),
15078
+ allowOther: external_exports.boolean(),
15079
+ options: external_exports.array(external_exports.strictObject({
15080
+ value: external_exports.string().min(1),
15081
+ label: external_exports.string(),
15082
+ description: external_exports.string().optional()
15083
+ })).min(1)
15084
+ }),
15085
+ external_exports.strictObject({
15086
+ ...field,
15087
+ type: external_exports.literal("text"),
15088
+ multiline: external_exports.boolean(),
15089
+ secret: external_exports.literal(false),
15090
+ placeholder: external_exports.string().optional(),
15091
+ prefill: external_exports.string().optional()
15092
+ })
15093
+ ])).min(1)
15094
+ });
15095
+ var threadQuestionsResultSchema = external_exports.strictObject({
15096
+ questions: external_exports.array(threadQuestionSchema)
15097
+ });
15098
+ var threadQuestionRespondParamsSchema = external_exports.strictObject({
15099
+ threadId: hostThreadIdSchema,
15100
+ interactionId: hostInteractionIdSchema,
15101
+ turnId: hostTurnIdSchema,
15102
+ answers: external_exports.record(external_exports.string(), external_exports.array(external_exports.string())),
15103
+ cancelled: external_exports.boolean().optional()
15104
+ });
15105
+ var threadQuestionRespondResultSchema = external_exports.strictObject({ accepted: external_exports.literal(true) });
15106
+ var threadQuestionActivityParamsSchema = external_exports.strictObject({
15107
+ threadId: hostThreadIdSchema,
15108
+ interactionId: hostInteractionIdSchema,
15109
+ turnId: hostTurnIdSchema
15110
+ });
15111
+ var threadQuestionActivityResultSchema = external_exports.strictObject({
15112
+ autoResolution: questionAutoResolutionSchema.nullable()
15113
+ });
15114
+
15059
15115
  // ../../shared-contracts/dist/idle-release.js
15060
15116
  var IDLE_RELEASE_TIMEOUT_MINUTES_MIN = 5;
15061
15117
  var IDLE_RELEASE_TIMEOUT_MINUTES_MAX = 1440;
@@ -16267,6 +16323,9 @@ function validateHostQuestionResponse(interaction, response) {
16267
16323
  }
16268
16324
  for (const question of interaction.questions) {
16269
16325
  const answers = response.answers[question.id] ?? [];
16326
+ if (new Set(answers).size !== answers.length) {
16327
+ return invalidRequest2("Question Response contains duplicate answers");
16328
+ }
16270
16329
  if (!question.optional && answers.length === 0) {
16271
16330
  return invalidRequest2("Question Response omits a required answer");
16272
16331
  }
@@ -16408,26 +16467,26 @@ function parseHostUsage(value) {
16408
16467
  }
16409
16468
  }
16410
16469
  const indicators = value.composerIndicators === void 0 ? {} : { composerIndicators: composerIndicatorsSchema.parse(value.composerIndicators) };
16411
- for (const field2 of [
16470
+ for (const field3 of [
16412
16471
  "totalCredits",
16413
16472
  "contextUsagePercent",
16414
16473
  "apiOutputTokensPerSecond"
16415
16474
  ]) {
16416
- const candidate = value[field2];
16475
+ const candidate = value[field3];
16417
16476
  if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isFinite(candidate) || candidate < 0)) {
16418
- throw new Error(`Harness Usage '${field2}' must be a finite non-negative number`);
16477
+ throw new Error(`Harness Usage '${field3}' must be a finite non-negative number`);
16419
16478
  }
16420
16479
  }
16421
- for (const field2 of tokenFields) {
16422
- const candidate = value[field2];
16480
+ for (const field3 of tokenFields) {
16481
+ const candidate = value[field3];
16423
16482
  if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isSafeInteger(candidate) || candidate < 0)) {
16424
- throw new Error(`Harness Usage '${field2}' must be a non-negative safe integer`);
16483
+ throw new Error(`Harness Usage '${field3}' must be a non-negative safe integer`);
16425
16484
  }
16426
16485
  }
16427
- for (const field2 of safeIntegerFields) {
16428
- const candidate = value[field2];
16486
+ for (const field3 of safeIntegerFields) {
16487
+ const candidate = value[field3];
16429
16488
  if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isSafeInteger(candidate) || candidate < 0)) {
16430
- throw new Error(`Harness Usage '${field2}' must be a non-negative safe integer`);
16489
+ throw new Error(`Harness Usage '${field3}' must be a non-negative safe integer`);
16431
16490
  }
16432
16491
  }
16433
16492
  if (value.outputTokensPerSecond !== void 0 && (typeof value.outputTokensPerSecond !== "number" || !Number.isFinite(value.outputTokensPerSecond) || value.outputTokensPerSecond < 0)) {
@@ -16436,10 +16495,10 @@ function parseHostUsage(value) {
16436
16495
  if (value.totalCostUsd !== void 0 && (typeof value.totalCostUsd !== "number" || !Number.isFinite(value.totalCostUsd) || value.totalCostUsd < 0)) {
16437
16496
  throw new Error("Harness Usage 'totalCostUsd' must be a finite non-negative number");
16438
16497
  }
16439
- for (const field2 of percentFields) {
16440
- const candidate = value[field2];
16498
+ for (const field3 of percentFields) {
16499
+ const candidate = value[field3];
16441
16500
  if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isFinite(candidate) || candidate < 0 || candidate > 100)) {
16442
- throw new Error(`Harness Usage '${field2}' must be between 0 and 100`);
16501
+ throw new Error(`Harness Usage '${field3}' must be between 0 and 100`);
16443
16502
  }
16444
16503
  }
16445
16504
  if (value.sessionCacheUsage !== void 0) {
@@ -16510,19 +16569,19 @@ function parseHostUsageRequest(value) {
16510
16569
  if (typeof value.requestId !== "string" || value.requestId.length === 0) {
16511
16570
  throw new Error("Harness Usage request 'requestId' must be a non-empty string");
16512
16571
  }
16513
- for (const field2 of ["model", "provider"]) {
16514
- const candidate = value[field2];
16572
+ for (const field3 of ["model", "provider"]) {
16573
+ const candidate = value[field3];
16515
16574
  if (candidate !== void 0 && (typeof candidate !== "string" || candidate.length === 0)) {
16516
- throw new Error(`Harness Usage request '${field2}' must be a non-empty string`);
16575
+ throw new Error(`Harness Usage request '${field3}' must be a non-empty string`);
16517
16576
  }
16518
16577
  }
16519
16578
  if (value.historical !== void 0 && typeof value.historical !== "boolean") {
16520
16579
  throw new Error("Harness Usage request 'historical' must be a boolean");
16521
16580
  }
16522
- for (const field2 of requestTokenFields) {
16523
- const candidate = value[field2];
16581
+ for (const field3 of requestTokenFields) {
16582
+ const candidate = value[field3];
16524
16583
  if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isSafeInteger(candidate) || candidate < 0)) {
16525
- throw new Error(`Harness Usage request '${field2}' must be a non-negative safe integer`);
16584
+ throw new Error(`Harness Usage request '${field3}' must be a non-negative safe integer`);
16526
16585
  }
16527
16586
  }
16528
16587
  if (value.inputTokens === void 0 || value.outputTokens === void 0) {
@@ -17028,7 +17087,7 @@ var subscriptionSchema = external_exports.object({
17028
17087
  });
17029
17088
  function codingProduct(value) {
17030
17089
  const entry = recordSchema2.safeParse(value).data;
17031
- return [entry?.productId, entry?.productName].some((field2) => typeof field2 === "string" && field2.toLowerCase().includes("coding"));
17090
+ return [entry?.productId, entry?.productName].some((field3) => typeof field3 === "string" && field3.toLowerCase().includes("coding"));
17032
17091
  }
17033
17092
  async function queryEntitlement(family, apiKey, environment) {
17034
17093
  try {
@@ -17751,16 +17810,16 @@ var CliTransport = class {
17751
17810
  var CONFIG_URL = "https://zcode.z.ai/api/v1/client/configs";
17752
17811
  var CONFIG_TTL_MS = 6e4;
17753
17812
  var CONFIG_TIMEOUT_MS = 15e3;
17754
- var field = external_exports.string().min(1).optional().catch(void 0);
17813
+ var field2 = external_exports.string().min(1).optional().catch(void 0);
17755
17814
  var responseSchema = external_exports.object({
17756
17815
  data: external_exports.object({
17757
17816
  configs: external_exports.object({
17758
17817
  captcha: external_exports.object({
17759
17818
  enabled: external_exports.boolean().optional(),
17760
17819
  skip_model_request: external_exports.boolean().optional(),
17761
- region: field,
17762
- prefix: field,
17763
- sceneId: field
17820
+ region: field2,
17821
+ prefix: field2,
17822
+ sceneId: field2
17764
17823
  }).optional()
17765
17824
  })
17766
17825
  })