@codexhost/cli-darwin-x64 0.14.0 → 0.16.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.
@@ -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
  }
@@ -18924,6 +18924,8 @@ var usageStatisticsTotalsSchema = external_exports.strictObject({
18924
18924
  cachedInputTokens: count,
18925
18925
  cacheWriteInputTokens: count,
18926
18926
  cacheKnownInputTokens: count,
18927
+ cacheHitCachedInputTokens: count,
18928
+ cacheHitInputTokens: count,
18927
18929
  outputTokens: count,
18928
18930
  reasoningOutputTokens: count,
18929
18931
  /** USD at the public price, summed over the priced requests only. */
@@ -19031,6 +19033,51 @@ var hostInteractionIdSchema = opaqueIdSchema.brand();
19031
19033
  var threadPrewarmDiscardParamsSchema = external_exports.object({ threadId: hostThreadIdSchema });
19032
19034
  var threadPrewarmDiscardResultSchema = external_exports.object({ discarded: external_exports.boolean() });
19033
19035
 
19036
+ // ../../shared-contracts/dist/thread-questions.js
19037
+ var field = external_exports.discriminatedUnion("type", [
19038
+ external_exports.object({
19039
+ id: external_exports.string().min(1),
19040
+ type: external_exports.literal("choice"),
19041
+ prompt: external_exports.string(),
19042
+ options: external_exports.array(external_exports.object({
19043
+ value: external_exports.string().min(1),
19044
+ label: external_exports.string(),
19045
+ description: external_exports.string().optional()
19046
+ })).min(1),
19047
+ multiple: external_exports.boolean(),
19048
+ allowOther: external_exports.boolean(),
19049
+ optional: external_exports.boolean()
19050
+ }),
19051
+ external_exports.object({
19052
+ id: external_exports.string().min(1),
19053
+ type: external_exports.literal("text"),
19054
+ prompt: external_exports.string(),
19055
+ multiline: external_exports.boolean(),
19056
+ secret: external_exports.literal(false),
19057
+ optional: external_exports.boolean(),
19058
+ placeholder: external_exports.string().optional(),
19059
+ prefill: external_exports.string().optional()
19060
+ })
19061
+ ]);
19062
+ var threadQuestionSchema = external_exports.object({
19063
+ interactionId: external_exports.string().min(1),
19064
+ turnId: external_exports.string().min(1),
19065
+ title: external_exports.string().optional(),
19066
+ questions: external_exports.array(field).min(1)
19067
+ }).refine(({ questions }) => questions.some((q) => q.type === "choice" && q.multiple), {
19068
+ message: "Shared cards require at least one multi-select question"
19069
+ });
19070
+ var threadQuestionsListParamsSchema = external_exports.strictObject({ threadId: external_exports.string().min(1) });
19071
+ var threadQuestionsResultSchema = external_exports.object({ questions: external_exports.array(threadQuestionSchema) });
19072
+ var threadQuestionRespondParamsSchema = external_exports.strictObject({
19073
+ threadId: external_exports.string().min(1),
19074
+ turnId: external_exports.string().min(1),
19075
+ interactionId: external_exports.string().min(1),
19076
+ answers: external_exports.record(external_exports.string(), external_exports.array(external_exports.string())),
19077
+ cancelled: external_exports.boolean().default(false)
19078
+ });
19079
+ var threadQuestionRespondResultSchema = external_exports.object({ accepted: external_exports.literal(true) });
19080
+
19034
19081
  // ../../shared-contracts/dist/console.js
19035
19082
  var consoleAnnouncementSchema = external_exports.strictObject({
19036
19083
  title: external_exports.string().trim().min(1).max(200),
@@ -20390,26 +20437,26 @@ function parseHostUsage(value) {
20390
20437
  }
20391
20438
  }
20392
20439
  const indicators = value.composerIndicators === void 0 ? {} : { composerIndicators: composerIndicatorsSchema.parse(value.composerIndicators) };
20393
- for (const field of [
20440
+ for (const field2 of [
20394
20441
  "totalCredits",
20395
20442
  "contextUsagePercent",
20396
20443
  "apiOutputTokensPerSecond"
20397
20444
  ]) {
20398
- const candidate = value[field];
20445
+ const candidate = value[field2];
20399
20446
  if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isFinite(candidate) || candidate < 0)) {
20400
- throw new Error(`Harness Usage '${field}' must be a finite non-negative number`);
20447
+ throw new Error(`Harness Usage '${field2}' must be a finite non-negative number`);
20401
20448
  }
20402
20449
  }
20403
- for (const field of tokenFields) {
20404
- const candidate = value[field];
20450
+ for (const field2 of tokenFields) {
20451
+ const candidate = value[field2];
20405
20452
  if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isSafeInteger(candidate) || candidate < 0)) {
20406
- throw new Error(`Harness Usage '${field}' must be a non-negative safe integer`);
20453
+ throw new Error(`Harness Usage '${field2}' must be a non-negative safe integer`);
20407
20454
  }
20408
20455
  }
20409
- for (const field of safeIntegerFields) {
20410
- const candidate = value[field];
20456
+ for (const field2 of safeIntegerFields) {
20457
+ const candidate = value[field2];
20411
20458
  if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isSafeInteger(candidate) || candidate < 0)) {
20412
- throw new Error(`Harness Usage '${field}' must be a non-negative safe integer`);
20459
+ throw new Error(`Harness Usage '${field2}' must be a non-negative safe integer`);
20413
20460
  }
20414
20461
  }
20415
20462
  if (value.outputTokensPerSecond !== void 0 && (typeof value.outputTokensPerSecond !== "number" || !Number.isFinite(value.outputTokensPerSecond) || value.outputTokensPerSecond < 0)) {
@@ -20418,10 +20465,10 @@ function parseHostUsage(value) {
20418
20465
  if (value.totalCostUsd !== void 0 && (typeof value.totalCostUsd !== "number" || !Number.isFinite(value.totalCostUsd) || value.totalCostUsd < 0)) {
20419
20466
  throw new Error("Harness Usage 'totalCostUsd' must be a finite non-negative number");
20420
20467
  }
20421
- for (const field of percentFields) {
20422
- const candidate = value[field];
20468
+ for (const field2 of percentFields) {
20469
+ const candidate = value[field2];
20423
20470
  if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isFinite(candidate) || candidate < 0 || candidate > 100)) {
20424
- throw new Error(`Harness Usage '${field}' must be between 0 and 100`);
20471
+ throw new Error(`Harness Usage '${field2}' must be between 0 and 100`);
20425
20472
  }
20426
20473
  }
20427
20474
  if (value.sessionCacheUsage !== void 0) {
@@ -20492,19 +20539,19 @@ function parseHostUsageRequest(value) {
20492
20539
  if (typeof value.requestId !== "string" || value.requestId.length === 0) {
20493
20540
  throw new Error("Harness Usage request 'requestId' must be a non-empty string");
20494
20541
  }
20495
- for (const field of ["model", "provider"]) {
20496
- const candidate = value[field];
20542
+ for (const field2 of ["model", "provider"]) {
20543
+ const candidate = value[field2];
20497
20544
  if (candidate !== void 0 && (typeof candidate !== "string" || candidate.length === 0)) {
20498
- throw new Error(`Harness Usage request '${field}' must be a non-empty string`);
20545
+ throw new Error(`Harness Usage request '${field2}' must be a non-empty string`);
20499
20546
  }
20500
20547
  }
20501
20548
  if (value.historical !== void 0 && typeof value.historical !== "boolean") {
20502
20549
  throw new Error("Harness Usage request 'historical' must be a boolean");
20503
20550
  }
20504
- for (const field of requestTokenFields) {
20505
- const candidate = value[field];
20551
+ for (const field2 of requestTokenFields) {
20552
+ const candidate = value[field2];
20506
20553
  if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isSafeInteger(candidate) || candidate < 0)) {
20507
- throw new Error(`Harness Usage request '${field}' must be a non-negative safe integer`);
20554
+ throw new Error(`Harness Usage request '${field2}' must be a non-negative safe integer`);
20508
20555
  }
20509
20556
  }
20510
20557
  if (value.inputTokens === void 0 || value.outputTokens === void 0) {
@@ -21319,9 +21366,9 @@ var DEEPSEEK_USAGE_COUNTERS = [
21319
21366
  "reasoningOutputTokens"
21320
21367
  ];
21321
21368
  function mergeDeepSeekUsage(current, next) {
21322
- const counters = Object.fromEntries(DEEPSEEK_USAGE_COUNTERS.flatMap((field) => {
21323
- const value = (current?.[field] ?? 0) + (next[field] ?? 0);
21324
- return current?.[field] !== void 0 || next[field] !== void 0 ? [[field, value]] : [];
21369
+ const counters = Object.fromEntries(DEEPSEEK_USAGE_COUNTERS.flatMap((field2) => {
21370
+ const value = (current?.[field2] ?? 0) + (next[field2] ?? 0);
21371
+ return current?.[field2] !== void 0 || next[field2] !== void 0 ? [[field2, value]] : [];
21325
21372
  }));
21326
21373
  const context = next.contextUsedTokens !== void 0 && next.contextWindowTokens !== void 0 ? {
21327
21374
  contextUsedTokens: next.contextUsedTokens,
@@ -21733,7 +21780,7 @@ function onlyKeys(value, required2, optional2 = []) {
21733
21780
  return required2.every((key) => Object.hasOwn(value, key)) && Reflect.ownKeys(value).every((key) => typeof key === "string" && allowed.has(key));
21734
21781
  }
21735
21782
  function requiredFields(value, fields) {
21736
- if (fields.some((field) => !Object.hasOwn(value, field)))
21783
+ if (fields.some((field2) => !Object.hasOwn(value, field2)))
21737
21784
  throw invalid("required fields");
21738
21785
  }
21739
21786
  function assertJsonValue2(value, label) {
@@ -22057,9 +22104,9 @@ function validateTeamPayload(type, data) {
22057
22104
  identifier(value.id, "team payload id");
22058
22105
  if (key === "member") {
22059
22106
  requiredOptionalKeys(value, ["id", "name", "description", "provider", "context", "phase"], ["error"]);
22060
- for (const field of ["name", "description", "provider"])
22061
- if (typeof value[field] !== "string")
22062
- throw invalid(`team member ${field}`);
22107
+ for (const field2 of ["name", "description", "provider"])
22108
+ if (typeof value[field2] !== "string")
22109
+ throw invalid(`team member ${field2}`);
22063
22110
  if (!["fresh", "fork"].includes(value.context) || !["provisioning", "active", "failed"].includes(value.phase) || value.error !== void 0 && typeof value.error !== "string")
22064
22111
  throw invalid("team member");
22065
22112
  } else if (key === "task") {
@@ -22073,8 +22120,8 @@ function validateTeamPayload(type, data) {
22073
22120
  stringArray(value.writeScopes, "team task writeScopes");
22074
22121
  } else {
22075
22122
  exactKeys(value, ["id", "senderId", "senderName", "targetId", "content"]);
22076
- for (const field of ["senderId", "senderName", "targetId"])
22077
- identifier(value[field], `team message ${field}`);
22123
+ for (const field2 of ["senderId", "senderName", "targetId"])
22124
+ identifier(value[field2], `team message ${field2}`);
22078
22125
  validateBlocks(value.content);
22079
22126
  }
22080
22127
  }
@@ -26250,15 +26297,24 @@ function attachedKnownInvocation(value, sinks) {
26250
26297
  return { event: value.event, eventId: value.eventId, agentId: value.agentId };
26251
26298
  }
26252
26299
  function parseApprovalRequest(value) {
26253
- if (!hasOnlyKeys(value, ["toolName"], ["callId", "reason"]) || !nonBlankString3(value.toolName) || Object.hasOwn(value, "callId") && !nonBlankString3(value.callId) || Object.hasOwn(value, "reason") && !boundedString3(value.reason)) {
26300
+ if (!hasOnlyKeys(value, ["toolName"], ["callId", "reason", "displayReason"]) || !nonBlankString3(value.toolName) || Object.hasOwn(value, "callId") && !nonBlankString3(value.callId) || Object.hasOwn(value, "reason") && !boundedString3(value.reason) || Object.hasOwn(value, "displayReason") && !isApprovalDisplayReason(value.displayReason)) {
26254
26301
  throw invalidFrame();
26255
26302
  }
26256
26303
  return {
26257
26304
  toolName: value.toolName,
26258
26305
  ...typeof value.callId === "string" ? { callId: value.callId } : {},
26259
- ...typeof value.reason === "string" ? { reason: value.reason } : {}
26306
+ ...typeof value.reason === "string" ? { reason: value.reason } : {},
26307
+ ...Object.hasOwn(value, "displayReason") ? { displayReason: value.displayReason } : {}
26260
26308
  };
26261
26309
  }
26310
+ function isApprovalDisplayReason(value) {
26311
+ if (!isPlainRecord6(value))
26312
+ return false;
26313
+ const entries = Object.entries(value);
26314
+ if (entries.length === 0)
26315
+ return false;
26316
+ return entries.every(([locale, text]) => locale.length > 0 && nonBlankString3(text) && boundedString3(text));
26317
+ }
26262
26318
  function parseQuestionRequest(value) {
26263
26319
  if (!hasOnlyKeys(value, ["questions"], ["wait"]) || !Array.isArray(value.questions)) {
26264
26320
  throw invalidFrame();
@@ -28076,7 +28132,7 @@ function validateToolResultMessage(value, profile) {
28076
28132
  return callId;
28077
28133
  }
28078
28134
  function requiredFields2(value, fields) {
28079
- if (fields.some((field) => !Object.hasOwn(value, field))) {
28135
+ if (fields.some((field2) => !Object.hasOwn(value, field2))) {
28080
28136
  fail("Modern history known event omitted a required field");
28081
28137
  }
28082
28138
  }
@@ -28101,7 +28157,7 @@ function validUsage(value) {
28101
28157
  if (!nonNegativeSafeInteger2(value.inputTokens) || !nonNegativeSafeInteger2(value.outputTokens)) {
28102
28158
  return false;
28103
28159
  }
28104
- return fields.slice(2).every((field) => value[field] === void 0 || nonNegativeSafeInteger2(value[field]));
28160
+ return fields.slice(2).every((field2) => value[field2] === void 0 || nonNegativeSafeInteger2(value[field2]));
28105
28161
  }
28106
28162
  function validateTurnReason(value) {
28107
28163
  if (!isRecord4(value) || typeof value.kind !== "string") {
@@ -28216,7 +28272,7 @@ function validateInboxSplice(data, profile) {
28216
28272
  }
28217
28273
  }
28218
28274
  function validateApprovalAsked(data) {
28219
- requiredOptionalKeys(data, ["id", "toolName"], ["callId", "reason"]);
28275
+ requiredOptionalKeys(data, ["id", "toolName"], ["callId", "reason", "displayReason"]);
28220
28276
  requiredString(data.id, "approval/asked id");
28221
28277
  requiredString(data.toolName, "approval/asked toolName");
28222
28278
  if (data.callId !== void 0)
@@ -28224,6 +28280,17 @@ function validateApprovalAsked(data) {
28224
28280
  if (data.reason !== void 0 && typeof data.reason !== "string") {
28225
28281
  fail("Modern history approval/asked reason is malformed");
28226
28282
  }
28283
+ if (data.displayReason !== void 0 && !isApprovalDisplayReason2(data.displayReason)) {
28284
+ fail("Modern history approval/asked displayReason is malformed");
28285
+ }
28286
+ }
28287
+ function isApprovalDisplayReason2(value) {
28288
+ if (!isRecord4(value))
28289
+ return false;
28290
+ const entries = Object.entries(value);
28291
+ if (entries.length === 0)
28292
+ return false;
28293
+ return entries.every(([locale, text]) => locale.length > 0 && typeof text === "string" && text.length > 0 && nonBlankString(text));
28227
28294
  }
28228
28295
  function validateApprovalDecided(data) {
28229
28296
  exactKeys(data, ["id", "outcome"]);
@@ -29137,7 +29204,7 @@ var ModernHarnessSession = class {
29137
29204
  type: "approval",
29138
29205
  interactionId,
29139
29206
  turnId: active.turnId,
29140
- title: delivery.request.reason ?? `Allow ${delivery.request.toolName}?`,
29207
+ title: delivery.request.displayReason?.en ?? delivery.request.reason ?? `Allow ${delivery.request.toolName}?`,
29141
29208
  description: delivery.request.callId ? `${delivery.request.toolName} (${delivery.request.callId})` : delivery.request.toolName,
29142
29209
  subject: { type: "nativeAction" },
29143
29210
  actions: [