@codexhost/cli-linux-arm64 0.21.0 → 0.22.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.
Files changed (42) hide show
  1. package/README.md +1 -1
  2. package/app/codexhost-distribution.json +1 -1
  3. package/app/console-server.mjs +1 -0
  4. package/app/console-web.js +1 -0
  5. package/app/desktop-controller.mjs +4 -1
  6. package/app/host-runtime.mjs +86 -21
  7. package/app/plugins/antigravity/plugin.mjs +1144 -1254
  8. package/app/plugins/claude-code/plugin.mjs +389 -84
  9. package/app/plugins/codebuddy/plugin.mjs +1 -0
  10. package/app/plugins/codex-usage/plugin.mjs +1 -0
  11. package/app/plugins/copilot/plugin.mjs +1 -0
  12. package/app/plugins/cursor-cli/plugin.mjs +1 -0
  13. package/app/plugins/deepseek-harness/plugin.mjs +1 -0
  14. package/app/plugins/devin/plugin.mjs +1 -0
  15. package/app/plugins/grok/plugin.mjs +192 -177
  16. package/app/plugins/hermes/plugin.mjs +1 -0
  17. package/app/plugins/kimi-code/plugin.mjs +1 -0
  18. package/app/plugins/kiro-cli/plugin.mjs +1 -0
  19. package/app/plugins/omp/plugin.mjs +108 -22
  20. package/app/plugins/opencode/plugin.mjs +1 -0
  21. package/app/plugins/pi/plugin.mjs +119 -23
  22. package/app/plugins/qoder/plugin.mjs +1 -0
  23. package/app/plugins/qoder-cn/plugin.mjs +1 -0
  24. package/app/plugins/qwen-code/plugin.mjs +1 -0
  25. package/app/plugins/workbuddy/plugin.mjs +1 -0
  26. package/app/plugins/zcode/plugin.mjs +1 -0
  27. package/app/renderer-extension.js +1 -0
  28. package/app/web/assets/index-CN4a4sj0.js +201 -0
  29. package/app/web/codexhost-settings.js +1 -0
  30. package/app/web/index.html +1 -1
  31. package/app/web/plugins/deepseek-ai__dsh-api-remotes/client.js +1 -1
  32. package/app/web/plugins/deepseek-ai__dsh-api-session-controller/client.js +6 -6
  33. package/app/web/plugins/deepseek-ai__dsh-client-ui-chat/client.js +69 -69
  34. package/app/web/plugins/deepseek-ai__dsh-client-ui-codexhost/client.js +2 -2
  35. package/app/web/plugins/deepseek-ai__dsh-client-ui-conversation/client.js +1 -1
  36. package/app/web/plugins/deepseek-ai__dsh-client-ui-tool/client.js +1 -1
  37. package/app/web-modules/server.mjs +130 -74
  38. package/bin/codexhost +0 -0
  39. package/libexec/codexhost-shim +0 -0
  40. package/libexec/codexhost-updater +0 -0
  41. package/package.json +1 -1
  42. package/app/web/assets/index-BdmZfTRW.js +0 -201
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 @codexhost/cli@0.21.0
10
+ npm install -g @codexhost/cli@0.22.0
11
11
  ```
12
12
 
13
13
  Do not install this package directly. npm selects it through the optional dependencies of `@codexhost/cli`.
@@ -1 +1 @@
1
- {"schemaVersion":1,"version":"0.21.0","distribution":"npm","target":"linux-arm64"}
1
+ {"schemaVersion":1,"version":"0.22.0","distribution":"npm","target":"linux-arm64"}
@@ -17472,6 +17472,7 @@ var remoteSessionOperationSchema = external_exports.discriminatedUnion("kind", [
17472
17472
  message: "A history continuation requires its connection epoch"
17473
17473
  }).optional()
17474
17474
  }),
17475
+ external_exports.strictObject({ kind: external_exports.literal("usage"), ...thread, epoch: identity }),
17475
17476
  external_exports.strictObject({
17476
17477
  kind: external_exports.literal("configure"),
17477
17478
  ...thread,
@@ -16663,6 +16663,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
16663
16663
  message: "A history continuation requires its connection epoch"
16664
16664
  }).optional()
16665
16665
  }),
16666
+ external_exports.strictObject({ kind: external_exports.literal("usage"), ...thread, epoch: identity }),
16666
16667
  external_exports.strictObject({
16667
16668
  kind: external_exports.literal("configure"),
16668
16669
  ...thread,
@@ -431,6 +431,8 @@ async function rendererRemoteSession(target2, operation) {
431
431
  })
432
432
  );
433
433
  const threadId = operation.threadId;
434
+ if (operation.kind === "usage")
435
+ return read(() => manager.sendRequest("codexhost/thread/usage/inspect", { threadId }));
434
436
  if (operation.kind === "status") {
435
437
  const result = await read(
436
438
  () => manager.sendRequest("thread/read", {
@@ -17189,6 +17191,7 @@ var remoteSessionOperationSchema = external_exports.discriminatedUnion("kind", [
17189
17191
  message: "A history continuation requires its connection epoch"
17190
17192
  }).optional()
17191
17193
  }),
17194
+ external_exports.strictObject({ kind: external_exports.literal("usage"), ...thread, epoch: identity }),
17192
17195
  external_exports.strictObject({
17193
17196
  kind: external_exports.literal("configure"),
17194
17197
  ...thread,
@@ -19311,7 +19314,7 @@ async function installRendererLoadedModules(renderer) {
19311
19314
  };
19312
19315
  try {
19313
19316
  await renderer.command("Runtime.enable");
19314
- await renderer.command("Debugger.enable");
19317
+ await renderer.command("Debugger.enable", { maxScriptsCacheSize: 0 });
19315
19318
  ready = true;
19316
19319
  await flush();
19317
19320
  return dispose;
@@ -32424,6 +32424,7 @@ var remoteSessionOperationSchema = external_exports.discriminatedUnion("kind", [
32424
32424
  message: "A history continuation requires its connection epoch"
32425
32425
  }).optional()
32426
32426
  }),
32427
+ external_exports.strictObject({ kind: external_exports.literal("usage"), ...thread, epoch: identity }),
32427
32428
  external_exports.strictObject({
32428
32429
  kind: external_exports.literal("configure"),
32429
32430
  ...thread,
@@ -36187,15 +36188,15 @@ function projectAgentMessageMedia(item, cwd) {
36187
36188
 
36188
36189
  // packages/protocol-core/dist/codex-ui-projector.js
36189
36190
  function resolvedItemDurationMs(item, startedAtMs, completedAtMs) {
36190
- if ((item.type === "commandExecution" || item.type === "toolExecution") && item.durationMs !== void 0) {
36191
+ if (hasDuration(item) && item.durationMs !== void 0)
36191
36192
  return item.durationMs;
36192
- }
36193
36193
  return Math.max(0, completedAtMs - startedAtMs);
36194
36194
  }
36195
+ function hasDuration(item) {
36196
+ return item.type === "commandExecution" || item.type === "toolExecution" || item.type === "mcpToolCall";
36197
+ }
36195
36198
  function withResolvedDuration(item, durationMs) {
36196
- if (item.type !== "commandExecution" && item.type !== "toolExecution")
36197
- return item;
36198
- return { ...item, durationMs };
36199
+ return hasDuration(item) ? { ...item, durationMs } : item;
36199
36200
  }
36200
36201
  function itemStatus(outcome) {
36201
36202
  if (!outcome)
@@ -36445,6 +36446,45 @@ function planStatus(value2) {
36445
36446
  }
36446
36447
  return "pending";
36447
36448
  }
36449
+ function outcomeReason(outcome) {
36450
+ return outcome.status === "failed" ? outcome.error.message : outcome.status === "cancelled" ? outcome.reason ?? "" : "";
36451
+ }
36452
+ function presentedItem(item, outcome) {
36453
+ if (item.type !== "webSearch" || !outcome || outcome.status === "succeeded")
36454
+ return item;
36455
+ const reason = item.output ? "" : outcomeReason(outcome);
36456
+ const output = item.output ?? (reason.trim() === "" ? void 0 : { content: [{ type: "text", text: reason }] });
36457
+ return {
36458
+ type: "toolExecution",
36459
+ itemId: item.itemId,
36460
+ toolName: "web_search",
36461
+ arguments: { query: item.query },
36462
+ ...output ? { output } : {}
36463
+ };
36464
+ }
36465
+ function mcpResultContent(output) {
36466
+ return (output?.content ?? []).map((content) => content.type === "text" ? { type: "text", text: content.text } : { type: "image", data: content.base64Data, mimeType: content.mimeType });
36467
+ }
36468
+ function projectMcpToolCall(item, outcome) {
36469
+ const status2 = itemStatus(outcome);
36470
+ const outputText = item.output?.content.flatMap((content) => content.type === "text" ? [content.text] : []).join("");
36471
+ const failure = outcome?.status === "failed" ? outcome.error.message : outcome?.status === "cancelled" ? outcome.reason ?? "Cancelled" : "";
36472
+ return {
36473
+ id: item.itemId,
36474
+ type: "mcpToolCall",
36475
+ server: item.server,
36476
+ tool: item.tool,
36477
+ status: status2,
36478
+ arguments: item.arguments,
36479
+ appContext: null,
36480
+ mcpAppUi: null,
36481
+ pluginId: null,
36482
+ readOnlyHint: null,
36483
+ result: status2 === "completed" ? { content: mcpResultContent(item.output), structuredContent: null, _meta: null } : null,
36484
+ error: status2 === "failed" ? { message: outputText || failure } : null,
36485
+ durationMs: item.durationMs ?? null
36486
+ };
36487
+ }
36448
36488
  function toolContentItems(item) {
36449
36489
  if (!item.output)
36450
36490
  return null;
@@ -36548,6 +36588,16 @@ function projectItem(item, outcome, defaultCwd, includeCommandOutput = true, sen
36548
36588
  durationMs: item.durationMs ?? null
36549
36589
  };
36550
36590
  }
36591
+ case "mcpToolCall":
36592
+ return projectMcpToolCall(item, outcome);
36593
+ case "webSearch":
36594
+ return {
36595
+ id: item.itemId,
36596
+ type: "webSearch",
36597
+ query: item.query,
36598
+ action: { type: "search", query: item.query, queries: null },
36599
+ results: null
36600
+ };
36551
36601
  case "fileChange":
36552
36602
  return {
36553
36603
  id: item.itemId,
@@ -36629,7 +36679,9 @@ function projectHistoricalTurn(input) {
36629
36679
  codexErrorInfo: "other",
36630
36680
  additionalDetails: null
36631
36681
  } : null;
36632
- const projectEntry = ({ item, outcome }) => {
36682
+ const projectEntry = (entry) => {
36683
+ const { outcome } = entry;
36684
+ const item = presentedItem(entry.item, outcome);
36633
36685
  if (itemFileChanges(item) !== null) {
36634
36686
  return files?.itemId === item.itemId ? [projectItem(files, { status: "succeeded" }, cwd)] : [];
36635
36687
  }
@@ -36989,6 +37041,11 @@ var CodexTurnProjector = class {
36989
37041
  }
36990
37042
  if (event.item.type === "fileChange")
36991
37043
  return { messages: this.#fileChangeUpdates(startedAtMs) };
37044
+ if (event.item.type === "webSearch") {
37045
+ projected.orderReserved = true;
37046
+ this.#wireItemOrder.push(event.item.itemId);
37047
+ return { messages: [] };
37048
+ }
36992
37049
  const startedItem = event.item.type === "reasoning" ? { ...event.item, text: "" } : this.#mediaItem(event.item);
36993
37050
  const messages = [this.#startWireItem(projected, startedItem, startedAtMs)];
36994
37051
  if (event.item.type === "reasoning") {
@@ -37101,7 +37158,7 @@ var CodexTurnProjector = class {
37101
37158
  if (startedAtMs === void 0)
37102
37159
  throw new Error("Codex Item completed without a start time");
37103
37160
  const durationMs = resolvedItemDurationMs(projected.item, startedAtMs, emittedAtMs);
37104
- projected.item = withResolvedDuration(projected.item, durationMs);
37161
+ projected.item = withResolvedDuration(presentedItem(projected.item, projected.outcome), durationMs);
37105
37162
  projected.durationMs = durationMs;
37106
37163
  if (itemFileChanges(projected.item) !== null) {
37107
37164
  return { messages: this.#fileChangeUpdates(emittedAtMs) };
@@ -37118,6 +37175,14 @@ var CodexTurnProjector = class {
37118
37175
  }
37119
37176
  });
37120
37177
  if (!projected.wireStarted) {
37178
+ if (event.snapshot.item.type === "webSearch") {
37179
+ return {
37180
+ messages: [
37181
+ this.#startWireItem(projected, projected.item, startedAtMs),
37182
+ completedItem(this.#projectItem(projected.item, projected.outcome))
37183
+ ]
37184
+ };
37185
+ }
37121
37186
  if (projected.item.type === "toolExecution") {
37122
37187
  if (isTodoTool(projected.item.toolName)) {
37123
37188
  const plan = planFromTodoValue(projected.item.arguments) ?? planFromTodoValue(projected.item.output);
@@ -37272,7 +37337,8 @@ var CodexTurnProjector = class {
37272
37337
  throw new Error("Codex Item started more than once");
37273
37338
  projected.wireStarted = true;
37274
37339
  projected.startedAtMs = startedAtMs;
37275
- this.#wireItemOrder.push(item.itemId);
37340
+ if (!projected.orderReserved)
37341
+ this.#wireItemOrder.push(item.itemId);
37276
37342
  return {
37277
37343
  method: "item/started",
37278
37344
  emittedAtMs: startedAtMs,
@@ -45937,7 +46003,7 @@ async function installRendererLoadedModules(renderer) {
45937
46003
  };
45938
46004
  try {
45939
46005
  await renderer.command("Runtime.enable");
45940
- await renderer.command("Debugger.enable");
46006
+ await renderer.command("Debugger.enable", { maxScriptsCacheSize: 0 });
45941
46007
  ready = true;
45942
46008
  await flush();
45943
46009
  return dispose;
@@ -53797,19 +53863,18 @@ var ExternalTurnSteering = class {
53797
53863
  if (key) {
53798
53864
  const receipt2 = { fingerprint: fingerprint2, result, settled: false };
53799
53865
  this.#receipts.set(key, receipt2);
53800
- void result.then(
53801
- () => {
53802
- receipt2.settled = true;
53803
- while (this.#receipts.size > 128) {
53804
- const oldest = [...this.#receipts].find(([, entry]) => entry.settled)?.[0];
53805
- if (oldest === void 0) break;
53806
- this.#receipts.delete(oldest);
53807
- }
53808
- },
53809
- () => {
53810
- this.#receipts.delete(key);
53866
+ const settle = () => {
53867
+ receipt2.settled = true;
53868
+ while (this.#receipts.size > 128) {
53869
+ const oldest = [...this.#receipts].find(([, entry]) => entry.settled)?.[0];
53870
+ if (oldest === void 0) break;
53871
+ this.#receipts.delete(oldest);
53811
53872
  }
53812
- );
53873
+ };
53874
+ void result.then(settle, (error51) => {
53875
+ if (error51 instanceof ExternalSteerOutcomeUnknownError) settle();
53876
+ else this.#receipts.delete(key);
53877
+ });
53813
53878
  }
53814
53879
  return result;
53815
53880
  } catch (error51) {