@karlorz/codexhost-cli-win32-x64 0.17.0-1 → 0.17.3-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.
package/README.md CHANGED
@@ -7,7 +7,7 @@ Run Pi and Claude Code as first-class external harnesses inside Codex Desktop.
7
7
  ## Install
8
8
 
9
9
  ```bash
10
- npm install -g @karlorz/codexhost-cli@0.17.0-1
10
+ npm install -g @karlorz/codexhost-cli@0.17.3-0
11
11
  ```
12
12
 
13
13
  Do not install this package directly. npm selects it through the optional dependencies of `@karlorz/codexhost-cli`.
@@ -1 +1 @@
1
- {"schemaVersion":1,"version":"0.17.0-1","distribution":"npm","target":"windows-x64"}
1
+ {"schemaVersion":1,"version":"0.17.3-0","distribution":"npm","target":"windows-x64"}
@@ -16455,6 +16455,21 @@ var threadSteeringInspectParamsSchema = external_exports.object({
16455
16455
  /** The text about to be steered; a Harness command always stops and restarts. */
16456
16456
  text: external_exports.string().optional()
16457
16457
  }).strict();
16458
+ var threadSteeringContextSchema = external_exports.object({
16459
+ kind: external_exports.literal("application"),
16460
+ value: external_exports.string().transform((text, context) => {
16461
+ try {
16462
+ return JSON.parse(text);
16463
+ } catch {
16464
+ context.addIssue({ code: "custom", message: "Invalid steering context JSON" });
16465
+ return external_exports.NEVER;
16466
+ }
16467
+ }).pipe(external_exports.object({
16468
+ expectedTurnId: hostTurnIdSchema,
16469
+ clientUserMessageId: external_exports.string().min(1),
16470
+ delivery: external_exports.enum(["newTurn", "activeTurn"])
16471
+ }).strict())
16472
+ }).strict().transform((context) => context.value);
16458
16473
  var threadSteerDeliverySchema = external_exports.enum(["activeTurn", "newTurn"]);
16459
16474
  var threadSteeringInspectResultSchema = external_exports.object({
16460
16475
  delivery: external_exports.enum(["official", "activeTurn", "newTurn"])
@@ -15675,6 +15675,21 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
15675
15675
  /** The text about to be steered; a Harness command always stops and restarts. */
15676
15676
  text: external_exports.string().optional()
15677
15677
  }).strict();
15678
+ var threadSteeringContextSchema = external_exports.object({
15679
+ kind: external_exports.literal("application"),
15680
+ value: external_exports.string().transform((text, context) => {
15681
+ try {
15682
+ return JSON.parse(text);
15683
+ } catch {
15684
+ context.addIssue({ code: "custom", message: "Invalid steering context JSON" });
15685
+ return external_exports.NEVER;
15686
+ }
15687
+ }).pipe(external_exports.object({
15688
+ expectedTurnId: hostTurnIdSchema,
15689
+ clientUserMessageId: external_exports.string().min(1),
15690
+ delivery: external_exports.enum(["newTurn", "activeTurn"])
15691
+ }).strict())
15692
+ }).strict().transform((context) => context.value);
15678
15693
  var threadSteerDeliverySchema = external_exports.enum(["activeTurn", "newTurn"]);
15679
15694
  var threadSteeringInspectResultSchema = external_exports.object({
15680
15695
  delivery: external_exports.enum(["official", "activeTurn", "newTurn"])
@@ -20301,7 +20316,7 @@ th[aria-sort] .console-usage-sort__mark {
20301
20316
  };
20302
20317
  function isUnsupportedMethod(error51, method) {
20303
20318
  if (typeof error51 !== "object" || error51 === null) return false;
20304
- const code = "code" in error51 ? error51.code : void 0;
20319
+ const code = "code" in error51 ? error51.code : "jsonRpcCode" in error51 ? error51.jsonRpcCode : void 0;
20305
20320
  const message2 = "message" in error51 ? error51.message : void 0;
20306
20321
  return code === -32601 || code === -32600 && typeof message2 === "string" && message2.startsWith(`Invalid request: unknown variant \`${method}\``);
20307
20322
  }
@@ -15581,6 +15581,21 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
15581
15581
  text: external_exports.string().optional()
15582
15582
  }).strict();
15583
15583
  var THREAD_STEER_DELIVERY_PARAM = "codexhostSteerDelivery";
15584
+ var threadSteeringContextSchema = external_exports.object({
15585
+ kind: external_exports.literal("application"),
15586
+ value: external_exports.string().transform((text, context) => {
15587
+ try {
15588
+ return JSON.parse(text);
15589
+ } catch {
15590
+ context.addIssue({ code: "custom", message: "Invalid steering context JSON" });
15591
+ return external_exports.NEVER;
15592
+ }
15593
+ }).pipe(external_exports.object({
15594
+ expectedTurnId: hostTurnIdSchema,
15595
+ clientUserMessageId: external_exports.string().min(1),
15596
+ delivery: external_exports.enum(["newTurn", "activeTurn"])
15597
+ }).strict())
15598
+ }).strict().transform((context) => context.value);
15584
15599
  var threadSteerDeliverySchema = external_exports.enum(["activeTurn", "newTurn"]);
15585
15600
  var threadSteeringInspectResultSchema = external_exports.object({
15586
15601
  delivery: external_exports.enum(["official", "activeTurn", "newTurn"])
@@ -17074,14 +17089,36 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
17074
17089
  // src/renderer-request-sender.ts
17075
17090
  function isUnsupportedMethod(error51, method) {
17076
17091
  if (typeof error51 !== "object" || error51 === null) return false;
17077
- const code = "code" in error51 ? error51.code : void 0;
17092
+ const code = "code" in error51 ? error51.code : "jsonRpcCode" in error51 ? error51.jsonRpcCode : void 0;
17078
17093
  const message = "message" in error51 ? error51.message : void 0;
17079
17094
  return code === -32601 || code === -32600 && typeof message === "string" && message.startsWith(`Invalid request: unknown variant \`${method}\``);
17080
17095
  }
17081
17096
 
17097
+ // src/renderer-steering-delivery.ts
17098
+ async function inspectRendererSteeringDelivery(send, threadId, text) {
17099
+ const inspect = "codexhost/thread/steering/inspect";
17100
+ try {
17101
+ const response2 = await send(inspect, { threadId, ...text !== void 0 ? { text } : {} });
17102
+ return threadSteeringInspectResultSchema.parse(response2).delivery;
17103
+ } catch (error51) {
17104
+ if (!isUnsupportedMethod(error51, inspect)) throw error51;
17105
+ }
17106
+ const ownership = "codexhost/thread/ownership/list";
17107
+ let response;
17108
+ try {
17109
+ response = await send(ownership, { threadIds: [threadId] });
17110
+ } catch (error51) {
17111
+ if (!isUnsupportedMethod(error51, ownership)) throw error51;
17112
+ await verifyNativeCodexThread(send, threadId);
17113
+ return "official";
17114
+ }
17115
+ const result = threadOwnershipListResultSchema.parse(response);
17116
+ const owner = result.threads.find((thread) => thread.threadId === threadId)?.owner;
17117
+ if (!owner) throw new Error("Thread ownership could not be resolved for steering");
17118
+ return owner === "codex" ? "official" : "newTurn";
17119
+ }
17120
+
17082
17121
  // src/renderer-external-steering.ts
17083
- var THREAD_STEERING_INSPECT_METHOD = "codexhost/thread/steering/inspect";
17084
- var THREAD_OWNERSHIP_LIST_METHOD = "codexhost/thread/ownership/list";
17085
17122
  function isRecord4(value) {
17086
17123
  return value !== null && typeof value === "object" && !Array.isArray(value);
17087
17124
  }
@@ -17288,34 +17325,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
17288
17325
  };
17289
17326
  });
17290
17327
  };
17291
- const inspectDelivery = async (threadId, text) => {
17292
- try {
17293
- const response = await originalSend.call(manager, THREAD_STEERING_INSPECT_METHOD, {
17294
- threadId,
17295
- ...text !== void 0 ? { text } : {}
17296
- });
17297
- return threadSteeringInspectResultSchema.parse(response).delivery;
17298
- } catch (error51) {
17299
- if (!isUnsupportedMethod(error51, THREAD_STEERING_INSPECT_METHOD)) throw error51;
17300
- }
17301
- let ownershipResponse;
17302
- try {
17303
- ownershipResponse = await originalSend.call(manager, THREAD_OWNERSHIP_LIST_METHOD, {
17304
- threadIds: [threadId]
17305
- });
17306
- } catch (error51) {
17307
- if (!isUnsupportedMethod(error51, THREAD_OWNERSHIP_LIST_METHOD)) throw error51;
17308
- await verifyNativeCodexThread(
17309
- (method, params) => originalSend.call(manager, method, params),
17310
- threadId
17311
- );
17312
- return "official";
17313
- }
17314
- const ownership = threadOwnershipListResultSchema.parse(ownershipResponse);
17315
- const owner = ownership.threads.find((thread) => thread.threadId === threadId)?.owner;
17316
- if (!owner) throw new Error("Thread ownership could not be resolved for steering");
17317
- return owner === "codex" ? "official" : "newTurn";
17318
- };
17328
+ const inspectDelivery = (threadId, text) => inspectRendererSteeringDelivery(
17329
+ (method, params) => originalSend.call(manager, method, params),
17330
+ threadId,
17331
+ text
17332
+ );
17319
17333
  const steer = async function(...args) {
17320
17334
  const [
17321
17335
  threadId,
@@ -17326,7 +17340,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
17326
17340
  clientUserMessageId,
17327
17341
  additionalContext,
17328
17342
  toolOutput,
17329
- onMessageAdded
17343
+ onMessageAdded,
17344
+ beforeSendRequest,
17345
+ assertRequestCurrent
17330
17346
  ] = args;
17331
17347
  if (typeof threadId !== "string") return originalSteer.apply(manager, args);
17332
17348
  const role = manager.getStreamRole?.(threadId);
@@ -17411,7 +17427,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
17411
17427
  attachments: attachments ?? [],
17412
17428
  commentAttachments: context.commentAttachments ?? [],
17413
17429
  mcpAppModelContextAttachments: context.mcpAppModelContextAttachments,
17414
- useAppServerPermissionDefault: true
17430
+ useAppServerPermissionDefault: true,
17431
+ beforeSendRequest,
17432
+ assertRequestCurrent
17415
17433
  }
17416
17434
  },
17417
17435
  onMessageAdded