@openclaw/codex 2026.9.2 → 2026.9.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.
Files changed (120) hide show
  1. package/README.md +2 -0
  2. package/dist/api.js +29 -26
  3. package/dist/apply-CvT8tW5i.js +356 -0
  4. package/dist/{attempt-client-cleanup-Bp1ZOnk2.js → attempt-client-cleanup-DKHzbwt5.js} +38 -214
  5. package/dist/{attempt-context-CSazkWns.js → attempt-context-D44yeDII.js} +9 -7
  6. package/dist/{event-projector-usage-ZqEVbAEY.js → attempt-notifications-C9XufG6l.js} +3 -106
  7. package/dist/{auth-binding-Ds_QVm-X.js → auth-binding-CWlKVccJ.js} +2 -2
  8. package/dist/auth-cache-key-7orQae_j.js +498 -0
  9. package/dist/auth-profile-CwzO4_RG.js +43 -0
  10. package/dist/auth-profile-selection-DFu9e167.js +45 -0
  11. package/dist/binding-connection-D3udKbIE.js +60 -0
  12. package/dist/{bounded-turn-DxGJRYbY.js → bounded-turn-C_Hneydj.js} +28 -125
  13. package/dist/build-state-BCmg9-5p.js +19 -0
  14. package/dist/{capabilities-B1mgvpP8.js → capabilities-8vx68WLH.js} +1 -1
  15. package/dist/cli-metadata.js +1 -1
  16. package/dist/client-B57KWPQx.js +4005 -0
  17. package/dist/command-dispatch-BpduNGVf.js +21 -0
  18. package/dist/{command-formatters-DSbGMXA0.js → command-formatters-lxlkNZgU.js} +4 -3
  19. package/dist/{command-handlers-DOJvGv6-.js → command-handlers-tiL9iWj7.js} +788 -135
  20. package/dist/command-rpc-CR5EOEZX.js +233 -0
  21. package/dist/{compact-Y_xBqrHN.js → compact-B_H3AOd7.js} +19 -14
  22. package/dist/config-oIORaQ5T.js +106 -0
  23. package/dist/{config-CyapYSji.js → config-options-CXMq1T-C.js} +205 -593
  24. package/dist/config-runtime-D0zGNIHu.js +11 -0
  25. package/dist/{config-utils-C57JiJrU.js → config-utils-DujwEnhg.js} +2 -4
  26. package/dist/conversation-binding-DsB4-O7U.js +900 -0
  27. package/dist/{plugin-marketplace-discovery-B7gHXJ3d.js → conversation-control-CtUu1b3m.js} +11 -143
  28. package/dist/doctor-contract-api.js +5 -5
  29. package/dist/{dynamic-tools-BwpvTxaX.js → dynamic-tools-CmN5RAip.js} +133 -76
  30. package/dist/{effective-mcp-catalog-CY9Jn4bA.js → effective-mcp-catalog-Bd73bqA8.js} +3 -3
  31. package/dist/{elicitation-input-DMkeki8d.js → elicitation-input-DPoK8F7w.js} +8 -22
  32. package/dist/ephemeral-turn-D78_VmzO.js +101 -0
  33. package/dist/{event-projector-assistant-message-B9kp6iGC.js → event-projector-assistant-message-BmBM4qBV.js} +12 -25
  34. package/dist/event-projector-items-5VhsECCO.js +200 -0
  35. package/dist/event-projector-usage-BfXmpOec.js +102 -0
  36. package/dist/{harness-Czh2Sdoc.js → harness-C7rRa7bm.js} +48 -24
  37. package/dist/harness.js +1 -1
  38. package/dist/history-rejection-B4nOXNXF.js +13 -0
  39. package/dist/incognito-session-uhrBF6wJ.js +15 -0
  40. package/dist/index.js +406 -2915
  41. package/dist/inference-context-Dr_mzvk4.js +94 -0
  42. package/dist/inference-proxy-HGXKUIre.js +311 -0
  43. package/dist/{isolated-completion-CRh-51AK.js → isolated-completion-DWVb5U2J.js} +7 -4
  44. package/dist/launch-args-RXQwn8zV.js +90 -0
  45. package/dist/{managed-binary-DcpnJF9x.js → managed-binary-D22rNEcR.js} +13 -103
  46. package/dist/managed-thread-store-D1t5jh3G.js +66 -0
  47. package/dist/media-understanding-provider.js +4 -1
  48. package/dist/migration-provider-api.js +2 -0
  49. package/dist/{model-catalog-DT5vo6qo.js → model-catalog-Dq2n8f_p.js} +6 -5
  50. package/dist/{models-CcrgSMQR.js → models-PCKOim-h.js} +3 -3
  51. package/dist/native-execution-policy-umd0tgh4.js +128 -0
  52. package/dist/native-subagent-history-DjtPloaU.js +140 -0
  53. package/dist/native-subagent-history-owner-Pcp7JuVF.js +34 -0
  54. package/dist/{native-subagent-monitor-B3bvQGcg.js → native-subagent-monitor-fQ7eIXEf.js} +115 -460
  55. package/dist/native-subagent-task-ids-BzTdT0Uw.js +387 -0
  56. package/dist/node-cli-sessions-DKaOmVUh.js +527 -0
  57. package/dist/{node-exec-server.runtime-nfbUOtUB.js → node-exec-server.runtime-Cl2vapEi.js} +55 -24
  58. package/dist/plan-7uG-Fp36.js +947 -0
  59. package/dist/plugin-activation-BYQculil.js +138 -0
  60. package/dist/{thread-resume-BLgqkUc1.js → plugin-app-cache-key-d0eKxy7b.js} +4 -52
  61. package/dist/{plugin-approval-roundtrip-aQVdyL5g.js → plugin-approval-roundtrip-Bz3FT8W5.js} +1 -1
  62. package/dist/plugin-inventory-oL4Na1ZG.js +328 -0
  63. package/dist/plugin-marketplace-discovery-P-Vndfqq.js +137 -0
  64. package/dist/{plugin-metadata-cache-BwCLTY_U.js → plugin-metadata-cache-ClPJpRio.js} +17 -9
  65. package/dist/protocol-5bh1G-H7.js +275 -0
  66. package/dist/provider-MQ8PVkuE.js +50 -0
  67. package/dist/{provider-capabilities-BpG9Ltc5.js → provider-capabilities-BvCUL69A.js} +2 -2
  68. package/dist/{rate-limits-Fx_l4eNa.js → rate-limits-CBMmWBr9.js} +1 -1
  69. package/dist/request-B7hEkBGq.js +212 -0
  70. package/dist/rpc-error-ttN_QjEm.js +30 -0
  71. package/dist/{run-attempt-BzthFQSM.js → run-attempt-CvsAAGa0.js} +664 -377
  72. package/dist/{runtime-artifact-Bh_gf6-t.js → runtime-artifact-BJ0rXBZ_.js} +27 -27
  73. package/dist/sandbox-guard-BxgyoM8M.js +166 -0
  74. package/dist/{session-binding-4Ki04sW-.js → session-binding-CI8UuilT.js} +30 -48
  75. package/dist/{session-binding-record-CyaXZvTe.js → session-binding-record-Bcvslnhf.js} +12 -26
  76. package/dist/session-catalog-adoption-tcZi1IfX.js +251 -0
  77. package/dist/session-catalog-archive-CwKg8Xz2.js +56 -0
  78. package/dist/session-catalog-ct-AH01I.js +1477 -0
  79. package/dist/session-catalog-home-id-CwhLdC03.js +18 -0
  80. package/dist/session-catalog-node-adoption-B1tgDW-m.js +182 -0
  81. package/dist/session-catalog-node-continue-Ci-DXyJP.js +238 -0
  82. package/dist/session-catalog-provenance-D-dIfRAH.js +96 -0
  83. package/dist/{session-cli-BjLhpmS1.js → session-cli-DNN_jhGc.js} +3 -2
  84. package/dist/{session-history-DWmMqiqW.js → session-history-Cz-tOOYj.js} +6 -3
  85. package/dist/{session-upstream-marker-DReTpGz6.js → session-history-import-DwyijFI6.js} +5 -50
  86. package/dist/{session-history-read-LHldwvyh.js → session-history-read-cxPUxyVV.js} +21 -7
  87. package/dist/session-history-worker-runtime.js +18 -6
  88. package/dist/session-history.worker-BeK1YOyT.js +378 -0
  89. package/dist/session-history.worker.js +1 -1
  90. package/dist/{session-initialization-BCFVnLL4.js → session-initialization-Ct0_Hzmg.js} +2 -2
  91. package/dist/{session-permission-policy-BaueHmSj.js → session-permission-policy-BBmXA8Eg.js} +4 -7
  92. package/dist/{session-retirement-DNdmYdFc.js → session-retirement-B2YfbAAT.js} +6 -5
  93. package/dist/session-upstream-marker-D15C9NHp.js +46 -0
  94. package/dist/{settled-turn-context-BOM3Y1pl.js → settled-turn-context-Du6gdUDd.js} +9 -9
  95. package/dist/{settled-turn-finalizer-BI-b1sry.js → settled-turn-finalizer-Dn91stmc.js} +8 -7
  96. package/dist/shared-client-CscigXXL.js +3109 -0
  97. package/dist/{side-question-B6DWAw1A.js → side-question-BGMJQf4U.js} +65 -170
  98. package/dist/source-CElXU0Oy.js +518 -0
  99. package/dist/thread-archive-guard-DfpBr-Sz.js +53 -0
  100. package/dist/thread-history-page-D0JIp48V.js +361 -0
  101. package/dist/{thread-lifecycle-DPK30jad.js → thread-lifecycle-DXl1-I6b.js} +187 -639
  102. package/dist/{thread-ownership-CbucAmmp.js → thread-ownership-BsDRTsyp.js} +13 -15
  103. package/dist/thread-policy-BuEQfE0g.js +54 -0
  104. package/dist/thread-resume-DsDOZpFg.js +52 -0
  105. package/dist/timeout-BVw8aaM1.js +33 -0
  106. package/dist/transcript-history-projection-v17wXgdK.js +238 -0
  107. package/dist/{transcript-mirror-_njEB84z.js → transcript-mirror-C5CKgNy6.js} +50 -260
  108. package/dist/{transcript-mirror-attestation-Byl34PC-.js → transcript-mirror-attestation-DibE0krH.js} +17 -4
  109. package/dist/{transport-stdio-CzTngV0j.js → transport-stdio-BGjHoYLr.js} +73 -43
  110. package/dist/{upstream-session-fork-1fwbNKzQ.js → upstream-session-fork-BZerMte_.js} +27 -19
  111. package/dist/{usage-i9fv5-4m.js → usage-tCk-mg_x.js} +4 -3
  112. package/dist/version-omm6IPI3.js +12 -0
  113. package/dist/{web-search-provider.runtime-DKQn67A7.js → web-search-provider.runtime-B7bGbGWq.js} +3 -3
  114. package/openclaw.plugin.json +23 -1
  115. package/package.json +4 -4
  116. package/dist/request-C8H22rPi.js +0 -475
  117. package/dist/session-catalog-B47uwekb.js +0 -3272
  118. package/dist/session-history.worker-zZVcx0ME.js +0 -267
  119. package/dist/shared-client-CKhX2kFt.js +0 -7505
  120. package/dist/thread-policy-CTalhWFy.js +0 -105
@@ -1,267 +0,0 @@
1
- import { i as readUpstreamUserText, r as readMirrorIdentity } from "./upstream-prompt-provenance-LphB8slG.js";
2
- import { s as serializeCodexMirrorSourceEvidence } from "./transcript-mirror-attestation-Byl34PC-.js";
3
- import { n as readCodexNativeHistory } from "./session-history-read-LHldwvyh.js";
4
- import { isRecord, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
5
- import { serveWorkerTasks } from "openclaw/plugin-sdk/process-runtime";
6
- import { Buffer } from "node:buffer";
7
- //#region extensions/codex/src/app-server/settled-turn-projection.ts
8
- const MAX_RESPONSE_ITEMS = 200;
9
- const MAX_PROJECTION_BYTES = 524288;
10
- const MAX_TEXT_BYTES = 65536;
11
- const TOOL_NAME_PATTERN = /^[a-zA-Z0-9._-]{1,128}$/u;
12
- const TOOL_ERROR_STATUS_PREFIX = "[Tool result status: error]\n";
13
- function readBoundedText(value, label, maxBytes = MAX_TEXT_BYTES) {
14
- if (typeof value !== "string" || !value.trim()) return;
15
- if (Buffer.byteLength(value, "utf8") > maxBytes) throw new Error(`Codex settled-turn projection found oversized ${label}`);
16
- return value;
17
- }
18
- function requireBoundedText(value, label, maxBytes = MAX_TEXT_BYTES) {
19
- const text = readBoundedText(value, label, maxBytes);
20
- if (!text) throw new Error(`Codex settled-turn projection found empty ${label}`);
21
- return text;
22
- }
23
- function responseItemBytes(item) {
24
- return Buffer.byteLength(JSON.stringify(item), "utf8");
25
- }
26
- function requireCallId(value) {
27
- const callId = normalizeOptionalString(value);
28
- if (!callId || callId.length > 256) throw new Error("Codex settled-turn projection found an invalid tool call id");
29
- return callId;
30
- }
31
- function requireToolName(value) {
32
- const name = normalizeOptionalString(value);
33
- if (!name || !TOOL_NAME_PATTERN.test(name)) throw new Error(`Codex settled-turn projection found an invalid tool name${name ? `: ${name.slice(0, 64)}` : ""}`);
34
- return name;
35
- }
36
- function serializeToolArguments(value) {
37
- if (typeof value === "string") {
38
- let parsed;
39
- try {
40
- parsed = JSON.parse(value);
41
- } catch {
42
- throw new Error("Codex settled-turn projection found invalid JSON tool arguments");
43
- }
44
- if (!isRecord(parsed)) throw new Error("Codex settled-turn projection requires object tool arguments");
45
- return requireBoundedText(value, "tool arguments");
46
- }
47
- if (!isRecord(value)) throw new Error("Codex settled-turn projection requires object tool arguments");
48
- let serialized;
49
- try {
50
- serialized = JSON.stringify(value);
51
- } catch {
52
- throw new Error("Codex settled-turn projection found unserializable tool arguments");
53
- }
54
- return requireBoundedText(serialized, "tool arguments");
55
- }
56
- function projectUserMessage(message) {
57
- const upstreamUserText = readUpstreamUserText(message);
58
- if (typeof message.content === "string") return {
59
- type: "message",
60
- role: "user",
61
- content: [{
62
- type: "input_text",
63
- text: upstreamUserText ? requireBoundedText(upstreamUserText, "upstream user text", MAX_PROJECTION_BYTES) : requireBoundedText(message.content, "user message")
64
- }]
65
- };
66
- if (!Array.isArray(message.content)) throw new Error("Codex settled-turn projection found unsupported user content");
67
- const content = [];
68
- let bytes = responseItemBytes({
69
- type: "message",
70
- role: "user",
71
- content
72
- });
73
- for (const value of message.content) {
74
- if (!isRecord(value)) throw new Error("Codex settled-turn projection found malformed user content");
75
- if (value.type !== "text") throw new Error(`Codex settled-turn projection does not support user content ${value.type}`);
76
- const text = readBoundedText(value.text, "user text");
77
- if (text) {
78
- const part = {
79
- type: "input_text",
80
- text
81
- };
82
- bytes += responseItemBytes(part) + (content.length > 0 ? 1 : 0);
83
- if (bytes > MAX_PROJECTION_BYTES) throw new Error("Codex settled-turn projection exceeds the byte limit");
84
- content.push(part);
85
- }
86
- }
87
- if (content.length === 0) throw new Error("Codex settled-turn projection found an empty user message");
88
- return {
89
- type: "message",
90
- role: "user",
91
- content
92
- };
93
- }
94
- function* projectAssistantMessage(message) {
95
- const values = typeof message.content === "string" ? [{
96
- type: "text",
97
- text: message.content
98
- }] : message.content;
99
- if (!Array.isArray(values)) throw new Error("Codex settled-turn projection found unsupported assistant content");
100
- for (const value of values) {
101
- if (!isRecord(value)) throw new Error("Codex settled-turn projection found malformed assistant content");
102
- if (value.type === "text") {
103
- const text = readBoundedText(value.text, "assistant text");
104
- if (text) yield { item: {
105
- type: "message",
106
- role: "assistant",
107
- content: [{
108
- type: "output_text",
109
- text
110
- }]
111
- } };
112
- continue;
113
- }
114
- if (value.type === "toolCall") {
115
- const id = requireCallId(value.id ?? value.toolCallId);
116
- const name = requireToolName(value.name ?? value.toolName);
117
- yield {
118
- call: {
119
- id,
120
- name
121
- },
122
- item: {
123
- type: "function_call",
124
- call_id: id,
125
- name,
126
- arguments: serializeToolArguments(value.arguments ?? value.input)
127
- }
128
- };
129
- continue;
130
- }
131
- if (value.type === "thinking" || value.type === "reasoning") continue;
132
- throw new Error(`Codex settled-turn projection does not support assistant content ${String(value.type)}`);
133
- }
134
- }
135
- function projectToolResult(message) {
136
- const id = requireCallId(message.toolCallId);
137
- const name = requireToolName(message.toolName);
138
- if (!Array.isArray(message.content)) throw new Error("Codex settled-turn projection found unsupported tool result content");
139
- const isErrorValue = message.isError;
140
- if (isErrorValue !== void 0 && typeof isErrorValue !== "boolean") throw new Error("Codex settled-turn projection found invalid tool result status");
141
- const isError = isErrorValue === true;
142
- const parts = [];
143
- let bytes = 0;
144
- const appendText = (text) => {
145
- bytes += Buffer.byteLength(text, "utf8") + (parts.length > 0 ? 1 : 0);
146
- if (bytes > MAX_TEXT_BYTES) throw new Error("Codex settled-turn projection found oversized tool result output");
147
- parts.push(text);
148
- };
149
- for (const value of message.content) {
150
- if (!isRecord(value)) throw new Error("Codex settled-turn projection found malformed tool result content");
151
- if (value.type === "image") {
152
- appendText(`[Image tool result: ${normalizeOptionalString(value.mimeType) ?? "unknown type"}]`);
153
- continue;
154
- }
155
- if (value.type !== "text" && value.type !== "toolResult") throw new Error("Codex settled-turn projection found malformed tool result content");
156
- const text = value.type === "text" ? readBoundedText(value.text, "tool result text") : readBoundedText(value.content ?? value.text, "tool result text");
157
- if (text) appendText(text);
158
- }
159
- const resultText = parts.join("\n") || (isError ? "Tool failed without textual output." : "Tool completed without textual output.");
160
- const output = requireBoundedText(isError ? `${TOOL_ERROR_STATUS_PREFIX}${resultText}` : resultText, "tool result output", isError ? MAX_TEXT_BYTES + Buffer.byteLength(TOOL_ERROR_STATUS_PREFIX, "utf8") : MAX_TEXT_BYTES);
161
- return {
162
- result: {
163
- id,
164
- name
165
- },
166
- item: {
167
- type: "function_call_output",
168
- call_id: id,
169
- output
170
- }
171
- };
172
- }
173
- function* projectMessage(message) {
174
- if (message.role === "user") yield { item: projectUserMessage(message) };
175
- else if (message.role === "assistant") yield* projectAssistantMessage(message);
176
- else if (message.role === "toolResult") yield projectToolResult(message);
177
- else throw new Error(`Codex settled-turn projection does not support role ${message.role}`);
178
- }
179
- /** Consumes complete evidence or rejects at the existing limits, never truncating its history. */
180
- function projectSettledCodexMessages(messages) {
181
- const items = [];
182
- const calls = /* @__PURE__ */ new Map();
183
- const results = /* @__PURE__ */ new Set();
184
- let bytes = 0;
185
- for (const message of messages) for (const { item, call, result } of projectMessage(message)) {
186
- if (call) {
187
- if (calls.has(call.id)) throw new Error("Codex settled-turn projection found a duplicate tool call");
188
- calls.set(call.id, call.name);
189
- }
190
- if (result) {
191
- if (calls.get(result.id) !== result.name || results.has(result.id)) throw new Error("Codex settled-turn projection found an ambiguous tool transcript");
192
- results.add(result.id);
193
- }
194
- if (items.length === MAX_RESPONSE_ITEMS) throw new Error("Codex settled-turn projection exceeds the item limit");
195
- bytes += responseItemBytes(item);
196
- if (bytes > MAX_PROJECTION_BYTES) throw new Error("Codex settled-turn projection exceeds the byte limit");
197
- items.push(item);
198
- }
199
- if (calls.size !== results.size) throw new Error("Codex settled-turn projection found an incomplete tool transcript");
200
- if (results.size === 0) throw new Error("Codex settled-turn projection found no completed tool result");
201
- return items;
202
- }
203
- //#endregion
204
- //#region extensions/codex/src/app-server/settled-turn-evidence.ts
205
- function rejectEvidence() {
206
- throw new Error("Codex settled-turn transcript does not match the settled turn");
207
- }
208
- /** The worker consumes this verifier lazily; rejection never acquires the remaining payloads. */
209
- function projectVerifiedSettledCodexMessages(history, params) {
210
- return projectSettledCodexMessages(verifiedSettledMessages(history, params));
211
- }
212
- /** Yields only the settled prefix, but exhausts suffix identity checks before accepting it. */
213
- function* verifiedSettledMessages(history, params) {
214
- const promptIdentity = `${params.turnId}:prompt`;
215
- const boundaryIndex = params.settledMessages.findLastIndex((message) => message.role === "toolResult");
216
- const boundary = params.settledMessages[boundaryIndex];
217
- const boundaryIdentity = boundary && readMirrorIdentity(boundary);
218
- const requiredIds = params.settledMessages.slice(0, boundaryIndex + 1).flatMap((message) => readMirrorIdentity(message) ?? []);
219
- if (!boundaryIdentity?.startsWith(`${params.turnId}:tool:`) || requiredIds.length !== boundaryIndex + 1 || new Set(requiredIds).size !== requiredIds.length || !requiredIds.includes(promptIdentity)) rejectEvidence();
220
- const mirrored = params.mirroredMessages;
221
- const mirroredIds = mirrored.flatMap((message) => readMirrorIdentity(message) ?? []);
222
- const mirroredBoundaryIndex = mirrored.findIndex((message) => readMirrorIdentity(message) === boundaryIdentity);
223
- if (new Set(mirroredIds).size !== mirroredIds.length || mirroredBoundaryIndex + 1 !== requiredIds.length || requiredIds.some((id, index) => readMirrorIdentity(mirrored[index]) !== id)) rejectEvidence();
224
- const required = new Map(requiredIds.map((id, index) => [id, mirrored[index]]));
225
- const seen = /* @__PURE__ */ new Set();
226
- let matched = 0;
227
- let throughBoundary = false;
228
- for (const message of history) {
229
- const identity = readMirrorIdentity(message);
230
- if (identity) {
231
- if (seen.has(identity)) rejectEvidence();
232
- seen.add(identity);
233
- const expected = required.get(identity);
234
- if (expected) {
235
- if (identity !== requiredIds[matched] || serializeCodexMirrorSourceEvidence(message) !== serializeCodexMirrorSourceEvidence(expected)) rejectEvidence();
236
- matched += 1;
237
- }
238
- }
239
- if (!throughBoundary) yield message;
240
- throughBoundary ||= identity === boundaryIdentity;
241
- }
242
- if (!throughBoundary || matched !== requiredIds.length) rejectEvidence();
243
- }
244
- //#endregion
245
- //#region extensions/codex/session-history.worker.ts
246
- const codexHistoryWorkerUrl = new URL(import.meta.url);
247
- async function runCodexHistoryWorkerInput(input) {
248
- const request = input;
249
- let version;
250
- const onSnapshot = (value) => {
251
- version = value;
252
- };
253
- if (request.kind === "messages") return {
254
- kind: request.kind,
255
- messages: await readCodexNativeHistory(request.target, request.sessionId, (messages) => Array.from(messages), request.admission, onSnapshot),
256
- version
257
- };
258
- if (request.kind === "settled") return {
259
- kind: request.kind,
260
- data: await readCodexNativeHistory(request.target, request.sessionId, (messages) => projectVerifiedSettledCodexMessages(messages, request.evidence), request.admission, onSnapshot),
261
- version
262
- };
263
- throw new Error("Invalid Codex history worker operation");
264
- }
265
- serveWorkerTasks(runCodexHistoryWorkerInput);
266
- //#endregion
267
- export { runCodexHistoryWorkerInput as n, codexHistoryWorkerUrl as t };