@openclaw/codex 2026.8.1-beta.2 → 2026.8.1-beta.3

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 (59) hide show
  1. package/dist/api.js +147 -0
  2. package/dist/app-server-policy-bg5QPSVP.js +25 -0
  3. package/dist/{attempt-client-cleanup-DMLXUfa8.js → attempt-client-cleanup-URjUlCHg.js} +1 -1
  4. package/dist/{binding-connection-I5Bo-AsX.js → binding-connection-DAvZwp96.js} +15 -3
  5. package/dist/{bounded-turn-qgZmzy_4.js → bounded-turn-4BjrZEwW.js} +22 -16
  6. package/dist/{capabilities-CybGI1oz.js → capabilities-CH3K57v4.js} +1 -1
  7. package/dist/cli-metadata.js +1 -1
  8. package/dist/{command-formatters-B1AEz8ZA.js → command-formatters-D0nZ3qtd.js} +2 -2
  9. package/dist/{command-handlers-Db8pu_ds.js → command-handlers-DC86lgT4.js} +39 -22
  10. package/dist/command-rpc-xUIIonsO.js +90 -0
  11. package/dist/{compact-LspQaGfl.js → compact-COqgBRny.js} +35 -29
  12. package/dist/{session-binding-DPxIvMgE.js → config-CpNeo5AE.js} +28 -888
  13. package/dist/context-compaction-activity-BOeJf7yo.js +58 -0
  14. package/dist/doctor-contract-api.js +15 -14
  15. package/dist/{dynamic-tools-BVdyWkUD.js → dynamic-tools-fJZhl4CE.js} +1284 -651
  16. package/dist/{effective-mcp-catalog-DIIhAtOZ.js → effective-mcp-catalog-4YKn51aG.js} +2 -2
  17. package/dist/elicitation-input-DMkeki8d.js +71 -0
  18. package/dist/{event-projector-usage-e5huIQWu.js → event-projector-usage-CLwNEJqW.js} +16 -16
  19. package/dist/harness-DoKQcF8n.js +258 -0
  20. package/dist/harness.js +2 -226
  21. package/dist/index.js +171 -48
  22. package/dist/{isolated-completion-C58NbL40.js → isolated-completion-DPMtlH9r.js} +3 -3
  23. package/dist/managed-binary-By4FZC6i.js +212 -0
  24. package/dist/media-understanding-provider.js +2 -2
  25. package/dist/model-catalog-CmGoqVKB.js +48 -0
  26. package/dist/{models-BFlpn1Ex.js → models-CZw1wClT.js} +2 -2
  27. package/dist/{native-subagent-monitor-DyTGmTUx.js → native-subagent-monitor-GGq3RnOo.js} +185 -71
  28. package/dist/node-exec-server.runtime-Bsu1LdFZ.js +192 -0
  29. package/dist/{plugin-app-cache-key-C3H2CVp6.js → plugin-app-cache-key-DMNQ8Zi8.js} +15 -3
  30. package/dist/plugin-approval-roundtrip-C75Yiiwc.js +95 -0
  31. package/dist/{plugin-marketplace-discovery-CzrGJdCR.js → plugin-marketplace-discovery-CSWDkMrP.js} +40 -26
  32. package/dist/{plugin-metadata-cache-CNJPj4_b.js → plugin-metadata-cache-BXH5NF-4.js} +8 -5
  33. package/dist/{protocol-validators-B4F7L8Rf.js → protocol-validators-VAVyEnDp.js} +55 -2
  34. package/dist/{rate-limits-DZXmOL8-.js → rate-limits-BI1dMHDG.js} +1 -1
  35. package/dist/{request-BRl5_UfX.js → request-DSK0W6YI.js} +2 -2
  36. package/dist/{run-attempt-P8BdxC1I.js → run-attempt-BV3HzuCf.js} +1098 -666
  37. package/dist/{runtime-artifact-BVSPdd6g.js → runtime-artifact-BvyT1uyd.js} +4 -7
  38. package/dist/{sandbox-guard-Cmwc9eIk.js → sandbox-guard-C1qEeZ5C.js} +25 -19
  39. package/dist/session-binding-BTrLf9Qm.js +874 -0
  40. package/dist/{session-catalog-xwNi_SDM.js → session-catalog-ezP_UcRM.js} +1541 -1296
  41. package/dist/session-catalog-home-id-BNwAJ9D7.js +18 -0
  42. package/dist/{session-cli-7hgXZDV7.js → session-cli-B1hKvfkI.js} +20 -7
  43. package/dist/{session-retirement-DoMMJFKm.js → session-retirement-CE4iMiLh.js} +3 -3
  44. package/dist/{session-upstream-marker-CrIFX06J.js → session-upstream-marker-D_2npHlA.js} +1 -1
  45. package/dist/{settled-turn-finalizer-BRWBO4MO.js → settled-turn-finalizer-Dx1onIqg.js} +23 -19
  46. package/dist/{shared-client-kIBbGjk4.js → shared-client-Dw-rzii0.js} +755 -273
  47. package/dist/{side-question-9HAL26l9.js → side-question-DbXkJZzg.js} +52 -30
  48. package/dist/{thread-lifecycle-Bu1BTDXr.js → thread-lifecycle-DKdrnTMX.js} +310 -92
  49. package/dist/{thread-ownership-6kOQHlyC.js → thread-ownership-i2NBwDUL.js} +2 -2
  50. package/dist/{thread-resume-CPrJNQVM.js → thread-resume-CdJk2Ehf.js} +3 -3
  51. package/dist/{transcript-mirror-B9gGgnJS.js → transcript-mirror-BU0_LKAL.js} +46 -28
  52. package/dist/{transport-stdio-DIImwDVS.js → transport-stdio-DhoGy33Z.js} +2 -2
  53. package/dist/{upstream-prompt-provenance-ClRBije0.js → upstream-prompt-provenance-CFmsKwr9.js} +12 -14
  54. package/dist/{upstream-session-fork-CE-_LdnP.js → upstream-session-fork-BDVJCLAD.js} +12 -6
  55. package/dist/{usage-CHlV0e-o.js → usage-9dKJCgcy.js} +3 -3
  56. package/dist/{web-search-provider.runtime-DRw2Vl42.js → web-search-provider.runtime-DCdx4DGu.js} +3 -3
  57. package/openclaw.plugin.json +31 -1
  58. package/package.json +6 -5
  59. package/dist/app-server-policy-zcBDc1JU.js +0 -49
@@ -0,0 +1,18 @@
1
+ import path from "node:path";
2
+ import { createHash } from "node:crypto";
3
+ import fsSync from "node:fs";
4
+ //#region extensions/codex/src/session-catalog-home-id.ts
5
+ function canonicalCodexCatalogHome(value) {
6
+ const resolved = path.resolve(value);
7
+ try {
8
+ return fsSync.realpathSync.native(resolved);
9
+ } catch {
10
+ return resolved;
11
+ }
12
+ }
13
+ /** One canonical identity for catalog discovery and durable ownership rows. */
14
+ function codexCatalogHomeId(codexHome) {
15
+ return createHash("sha256").update("openclaw:codex-session-catalog-home:v1\0").update(canonicalCodexCatalogHome(codexHome)).digest("hex");
16
+ }
17
+ //#endregion
18
+ export { codexCatalogHomeId as n, canonicalCodexCatalogHome as t };
@@ -1,10 +1,15 @@
1
- import { a as CODEX_LOCAL_SESSION_HOST_ID } from "./session-catalog-xwNi_SDM.js";
1
+ import "./session-catalog-ezP_UcRM.js";
2
2
  import { isRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
3
3
  import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
4
4
  import { sanitizeTerminalText } from "openclaw/plugin-sdk/text-chunking";
5
+ import { normalizeAgentId } from "openclaw/plugin-sdk/routing";
5
6
  import { addGatewayClientOptions, callGatewayFromCli } from "openclaw/plugin-sdk/gateway-runtime";
6
7
  //#region extensions/codex/src/session-cli.ts
7
8
  const CODEX_SESSION_CATALOG_CLI_TIMEOUT_MS = 75e3;
9
+ function requestedAgentId(options) {
10
+ const agentId = options.agent?.trim();
11
+ return agentId ? normalizeAgentId(agentId) : void 0;
12
+ }
8
13
  function writeLine(value = "") {
9
14
  process.stdout.write(`${value}\n`);
10
15
  }
@@ -80,12 +85,14 @@ function filterHosts(result, selector) {
80
85
  } : result;
81
86
  }
82
87
  async function listCodexSessions(options) {
88
+ const agentId = requestedAgentId(options);
83
89
  const host = options.host?.trim() || void 0;
84
90
  const cursor = options.cursor?.trim() || void 0;
85
91
  if (cursor && !host) throw new Error("--cursor requires --host so the cursor is routed to one Codex host");
86
92
  const search = options.search?.trim() || void 0;
87
93
  const limitPerHost = parsePageLimit(options.limit);
88
94
  const params = {
95
+ ...agentId ? { agentId } : {},
89
96
  ...search ? { search } : {},
90
97
  ...limitPerHost !== void 0 ? { limitPerHost } : {},
91
98
  ...host ? { hostIds: [host] } : {},
@@ -122,10 +129,13 @@ function readThreadId(value) {
122
129
  }
123
130
  async function continueCodexSession(threadIdValue, options) {
124
131
  const threadId = readThreadId(threadIdValue);
132
+ const agentId = requestedAgentId(options);
133
+ const hostId = options.host?.trim() || "gateway:local";
125
134
  const raw = await callGatewayFromCli("sessions.catalog.continue", gatewayOptions(options), {
126
135
  catalogId: "codex",
127
- hostId: CODEX_LOCAL_SESSION_HOST_ID,
128
- threadId
136
+ hostId,
137
+ threadId,
138
+ ...agentId ? { agentId } : {}
129
139
  }, {
130
140
  mode: "cli",
131
141
  scopes: ["operator.write"]
@@ -140,11 +150,14 @@ async function continueCodexSession(threadIdValue, options) {
140
150
  }
141
151
  async function archiveCodexSession(threadIdValue, options) {
142
152
  const threadId = readThreadId(threadIdValue);
153
+ const agentId = requestedAgentId(options);
154
+ const hostId = options.host?.trim() || "gateway:local";
143
155
  if (options.confirmNoOtherRunner !== true) throw new Error("--confirm-no-other-runner is required because Codex client and runner activity is process-local");
144
156
  const raw = await callGatewayFromCli("sessions.catalog.archive", gatewayOptions(options), {
145
157
  catalogId: "codex",
146
- hostId: CODEX_LOCAL_SESSION_HOST_ID,
158
+ hostId,
147
159
  threadId,
160
+ ...agentId ? { agentId } : {},
148
161
  confirmNoOtherRunner: true
149
162
  }, {
150
163
  mode: "cli",
@@ -161,13 +174,13 @@ async function archiveCodexSession(threadIdValue, options) {
161
174
  /** Registers the plugin-owned Codex session supervision CLI. */
162
175
  function registerCodexSessionCli(program) {
163
176
  const codex = program.command("codex").description("Inspect and branch from Codex sessions through the Gateway");
164
- addGatewayClientOptions(codex.command("sessions").description("List non-archived Codex app-server sessions across connected hosts").option("--search <text>", "Search session titles (case-insensitive)").option("--host <id>", "Filter by stable host id").option("--limit <count>", "Maximum sessions returned per host").option("--cursor <cursor>", "Continue one host page (requires --host)").option("--json", "Print the structured catalog response", false), { timeoutMs: CODEX_SESSION_CATALOG_CLI_TIMEOUT_MS }).action(async (options) => {
177
+ addGatewayClientOptions(codex.command("sessions").description("List non-archived Codex app-server sessions across connected hosts").option("--agent <id>", "Agent id that owns the Codex sessions").option("--search <text>", "Search session titles (case-insensitive)").option("--host <id>", "Filter by stable host id").option("--limit <count>", "Maximum sessions returned per host").option("--cursor <cursor>", "Continue one host page (requires --host)").option("--json", "Print the structured catalog response", false), { timeoutMs: CODEX_SESSION_CATALOG_CLI_TIMEOUT_MS }).action(async (options) => {
165
178
  await listCodexSessions(options);
166
179
  });
167
- addGatewayClientOptions(codex.command("continue <thread-id>").description("Continue a Gateway-local Codex thread as an OpenClaw branch").option("--json", "Print the structured response", false)).action(async (threadId, options) => {
180
+ addGatewayClientOptions(codex.command("continue <thread-id>").description("Continue a Gateway-local Codex thread as an OpenClaw branch").option("--agent <id>", "Agent id that owns the Codex session").option("--host <id>", "Stable local host id from codex sessions").option("--json", "Print the structured response", false)).action(async (threadId, options) => {
168
181
  await continueCodexSession(threadId, options);
169
182
  });
170
- addGatewayClientOptions(codex.command("archive <thread-id>").description("Archive a stored or idle Gateway-local Codex thread").option("--confirm-no-other-runner", "Confirm no other Codex client or OpenClaw runner is using this thread", false).option("--json", "Print the structured response", false)).action(async (threadId, options) => {
183
+ addGatewayClientOptions(codex.command("archive <thread-id>").description("Archive a stored or idle Gateway-local Codex thread").option("--agent <id>", "Agent id that owns the Codex session").option("--host <id>", "Stable local host id from codex sessions").option("--confirm-no-other-runner", "Confirm no other Codex client or OpenClaw runner is using this thread", false).option("--json", "Print the structured response", false)).action(async (threadId, options) => {
171
184
  await archiveCodexSession(threadId, options);
172
185
  });
173
186
  }
@@ -1,7 +1,7 @@
1
- import { K as releaseCodexAppServerLiveThread, d as retainSharedCodexAppServerClientByInstanceId } from "./shared-client-kIBbGjk4.js";
2
- import { a as closeCodexStartupClientBestEffort, d as unsubscribeCodexThreadBestEffort, r as CodexAppServerUnsafeSubscriptionError } from "./attempt-client-cleanup-DMLXUfa8.js";
1
+ import { J as releaseCodexAppServerLiveThread, d as retainSharedCodexAppServerClientByInstanceId } from "./shared-client-Dw-rzii0.js";
2
+ import { a as closeCodexStartupClientBestEffort, d as unsubscribeCodexThreadBestEffort, r as CodexAppServerUnsafeSubscriptionError } from "./attempt-client-cleanup-URjUlCHg.js";
3
3
  import { t as isIncognitoSessionKey } from "./incognito-session-ET_ufDH-.js";
4
- import { t as codexNativeSubagentMonitorRuntime } from "./native-subagent-monitor-DyTGmTUx.js";
4
+ import { t as codexNativeSubagentMonitorRuntime } from "./native-subagent-monitor-GGq3RnOo.js";
5
5
  //#region extensions/codex/src/app-server/session-retirement.ts
6
6
  /** Retire binding and native subscription under the same generation/physical-client ownership fence. */
7
7
  async function retireCodexAppServerSessionGeneration(params) {
@@ -1,4 +1,4 @@
1
- import { r as importCodexThreadHistoryToTranscript } from "./transcript-mirror-B9gGgnJS.js";
1
+ import { r as importCodexThreadHistoryToTranscript } from "./transcript-mirror-BU0_LKAL.js";
2
2
  import { resolveStorePath } from "openclaw/plugin-sdk/session-store-runtime";
3
3
  //#region extensions/codex/src/app-server/session-history-import.ts
4
4
  /** Creates a session whose transcript is derived from one verified Codex thread snapshot. */
@@ -1,7 +1,7 @@
1
- import { ct as isJsonObject } from "./shared-client-kIBbGjk4.js";
2
- import { i as readUpstreamUserText, r as readMirrorIdentity, t as attachCodexMirrorIdentity } from "./upstream-prompt-provenance-ClRBije0.js";
3
- import { c as readCodexMirrorSourceFingerprint, s as fingerprintCodexMirrorSourceMessage, t as codexTranscriptMirrorRuntime } from "./transcript-mirror-B9gGgnJS.js";
4
- import { t as runBoundedCodexAppServerTurn } from "./bounded-turn-qgZmzy_4.js";
1
+ import { ut as isJsonObject } from "./shared-client-Dw-rzii0.js";
2
+ import { i as readUpstreamUserText, r as readMirrorIdentity, t as attachCodexMirrorIdentity } from "./upstream-prompt-provenance-CFmsKwr9.js";
3
+ import { c as readCodexMirrorSourceFingerprint, s as fingerprintCodexMirrorSourceMessage, t as codexTranscriptMirrorRuntime } from "./transcript-mirror-BU0_LKAL.js";
4
+ import { t as runBoundedCodexAppServerTurn } from "./bounded-turn-4BjrZEwW.js";
5
5
  import { n as createAssistantMessage } from "./event-projector-assistant-message-BwxV4d6N.js";
6
6
  import { isRecord, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
7
7
  import { Buffer } from "node:buffer";
@@ -56,27 +56,26 @@ function serializeToolArguments(value) {
56
56
  return requireBoundedText(serialized, "tool arguments");
57
57
  }
58
58
  function projectUserMessage(message) {
59
- const record = message;
60
59
  const upstreamUserText = readUpstreamUserText(message);
61
- if (upstreamUserText && typeof record.content === "string") return [{
60
+ if (upstreamUserText && typeof message.content === "string") return [{
62
61
  type: "message",
63
62
  role: "user",
64
63
  content: [{
65
64
  type: "input_text",
66
- text: requireBoundedText(upstreamUserText, "upstream user text")
65
+ text: requireBoundedText(upstreamUserText, "upstream user text", MAX_PROJECTION_BYTES)
67
66
  }]
68
67
  }];
69
- if (typeof record.content === "string") return [{
68
+ if (typeof message.content === "string") return [{
70
69
  type: "message",
71
70
  role: "user",
72
71
  content: [{
73
72
  type: "input_text",
74
- text: requireBoundedText(record.content, "user message")
73
+ text: requireBoundedText(message.content, "user message")
75
74
  }]
76
75
  }];
77
- if (!Array.isArray(record.content)) throw new Error("Codex settled-turn projection found unsupported user content");
76
+ if (!Array.isArray(message.content)) throw new Error("Codex settled-turn projection found unsupported user content");
78
77
  const content = [];
79
- for (const value of record.content) {
78
+ for (const value of message.content) {
80
79
  if (!isRecord(value)) throw new Error("Codex settled-turn projection found malformed user content");
81
80
  if (value.type === "text") {
82
81
  const text = readBoundedText(value.text, "user text");
@@ -86,7 +85,7 @@ function projectUserMessage(message) {
86
85
  });
87
86
  continue;
88
87
  }
89
- throw new Error(`Codex settled-turn projection does not support user content ${String(value.type)}`);
88
+ throw new Error(`Codex settled-turn projection does not support user content ${value.type}`);
90
89
  }
91
90
  if (content.length === 0) throw new Error("Codex settled-turn projection found an empty user message");
92
91
  return [{
@@ -144,8 +143,9 @@ function projectToolResult(message) {
144
143
  const id = requireCallId(message.toolCallId);
145
144
  const name = requireToolName(message.toolName);
146
145
  if (!Array.isArray(message.content)) throw new Error("Codex settled-turn projection found unsupported tool result content");
147
- if (message.isError !== void 0 && typeof message.isError !== "boolean") throw new Error("Codex settled-turn projection found invalid tool result status");
148
- const isError = message.isError === true;
146
+ const isErrorValue = message.isError;
147
+ if (isErrorValue !== void 0 && typeof isErrorValue !== "boolean") throw new Error("Codex settled-turn projection found invalid tool result status");
148
+ const isError = isErrorValue === true;
149
149
  const parts = [];
150
150
  for (const value of message.content) {
151
151
  if (!isRecord(value)) throw new Error("Codex settled-turn projection found malformed tool result content");
@@ -173,17 +173,16 @@ function projectToolResult(message) {
173
173
  };
174
174
  }
175
175
  function projectMessage(message) {
176
- const record = message;
177
176
  let items;
178
177
  let calls = [];
179
178
  let results = [];
180
179
  if (message.role === "user") items = projectUserMessage(message);
181
180
  else if (message.role === "assistant") {
182
- const projected = projectAssistantMessage(record);
181
+ const projected = projectAssistantMessage(message);
183
182
  items = projected.items;
184
183
  calls = projected.calls;
185
184
  } else if (message.role === "toolResult") {
186
- const projected = projectToolResult(record);
185
+ const projected = projectToolResult(message);
187
186
  items = [projected.item];
188
187
  results = [projected.result];
189
188
  } else throw new Error(`Codex settled-turn projection does not support role ${message.role}`);
@@ -304,6 +303,11 @@ async function runCodexSettledTurnFinalization(operation, options) {
304
303
  cwd: attempt.workspaceDir,
305
304
  messages: [assistant],
306
305
  idempotencyScope: `codex-settled-finalizer:${attempt.runId}`,
306
+ runId: attempt.runId,
307
+ terminalAssistantOwner: {
308
+ mirrorIdentity,
309
+ runId: attempt.runId
310
+ },
307
311
  config: attempt.config,
308
312
  skipBeforeMessageWriteHooks: true
309
313
  });
@@ -311,8 +315,8 @@ async function runCodexSettledTurnFinalization(operation, options) {
311
315
  const expectedFingerprint = fingerprintCodexMirrorSourceMessage(assistant);
312
316
  if (!mirrorResult.assistantMirrorIdentitiesOwned.includes(mirrorIdentity) || !persistedMessage || persistedMessage.role !== "assistant" || readCodexMirrorSourceFingerprint(persistedMessage) !== expectedFingerprint) throw new Error("Codex settled-turn final answer transcript attestation mismatch");
313
317
  const persistedAssistant = persistedMessage;
314
- const persistedAssistantRecord = persistedAssistant;
315
- const assistantTranscriptIdempotencyKey = typeof persistedAssistantRecord.idempotencyKey === "string" ? persistedAssistantRecord.idempotencyKey.trim() : "";
318
+ const persistedIdempotencyKey = "idempotencyKey" in persistedAssistant ? persistedAssistant.idempotencyKey : void 0;
319
+ const assistantTranscriptIdempotencyKey = typeof persistedIdempotencyKey === "string" ? persistedIdempotencyKey.trim() : "";
316
320
  return {
317
321
  assistant: persistedAssistant,
318
322
  assistantTranscriptOwned: true,