@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.
- package/README.md +2 -0
- package/dist/api.js +29 -26
- package/dist/apply-CvT8tW5i.js +356 -0
- package/dist/{attempt-client-cleanup-Bp1ZOnk2.js → attempt-client-cleanup-DKHzbwt5.js} +38 -214
- package/dist/{attempt-context-CSazkWns.js → attempt-context-D44yeDII.js} +9 -7
- package/dist/{event-projector-usage-ZqEVbAEY.js → attempt-notifications-C9XufG6l.js} +3 -106
- package/dist/{auth-binding-Ds_QVm-X.js → auth-binding-CWlKVccJ.js} +2 -2
- package/dist/auth-cache-key-7orQae_j.js +498 -0
- package/dist/auth-profile-CwzO4_RG.js +43 -0
- package/dist/auth-profile-selection-DFu9e167.js +45 -0
- package/dist/binding-connection-D3udKbIE.js +60 -0
- package/dist/{bounded-turn-DxGJRYbY.js → bounded-turn-C_Hneydj.js} +28 -125
- package/dist/build-state-BCmg9-5p.js +19 -0
- package/dist/{capabilities-B1mgvpP8.js → capabilities-8vx68WLH.js} +1 -1
- package/dist/cli-metadata.js +1 -1
- package/dist/client-B57KWPQx.js +4005 -0
- package/dist/command-dispatch-BpduNGVf.js +21 -0
- package/dist/{command-formatters-DSbGMXA0.js → command-formatters-lxlkNZgU.js} +4 -3
- package/dist/{command-handlers-DOJvGv6-.js → command-handlers-tiL9iWj7.js} +788 -135
- package/dist/command-rpc-CR5EOEZX.js +233 -0
- package/dist/{compact-Y_xBqrHN.js → compact-B_H3AOd7.js} +19 -14
- package/dist/config-oIORaQ5T.js +106 -0
- package/dist/{config-CyapYSji.js → config-options-CXMq1T-C.js} +205 -593
- package/dist/config-runtime-D0zGNIHu.js +11 -0
- package/dist/{config-utils-C57JiJrU.js → config-utils-DujwEnhg.js} +2 -4
- package/dist/conversation-binding-DsB4-O7U.js +900 -0
- package/dist/{plugin-marketplace-discovery-B7gHXJ3d.js → conversation-control-CtUu1b3m.js} +11 -143
- package/dist/doctor-contract-api.js +5 -5
- package/dist/{dynamic-tools-BwpvTxaX.js → dynamic-tools-CmN5RAip.js} +133 -76
- package/dist/{effective-mcp-catalog-CY9Jn4bA.js → effective-mcp-catalog-Bd73bqA8.js} +3 -3
- package/dist/{elicitation-input-DMkeki8d.js → elicitation-input-DPoK8F7w.js} +8 -22
- package/dist/ephemeral-turn-D78_VmzO.js +101 -0
- package/dist/{event-projector-assistant-message-B9kp6iGC.js → event-projector-assistant-message-BmBM4qBV.js} +12 -25
- package/dist/event-projector-items-5VhsECCO.js +200 -0
- package/dist/event-projector-usage-BfXmpOec.js +102 -0
- package/dist/{harness-Czh2Sdoc.js → harness-C7rRa7bm.js} +48 -24
- package/dist/harness.js +1 -1
- package/dist/history-rejection-B4nOXNXF.js +13 -0
- package/dist/incognito-session-uhrBF6wJ.js +15 -0
- package/dist/index.js +406 -2915
- package/dist/inference-context-Dr_mzvk4.js +94 -0
- package/dist/inference-proxy-HGXKUIre.js +311 -0
- package/dist/{isolated-completion-CRh-51AK.js → isolated-completion-DWVb5U2J.js} +7 -4
- package/dist/launch-args-RXQwn8zV.js +90 -0
- package/dist/{managed-binary-DcpnJF9x.js → managed-binary-D22rNEcR.js} +13 -103
- package/dist/managed-thread-store-D1t5jh3G.js +66 -0
- package/dist/media-understanding-provider.js +4 -1
- package/dist/migration-provider-api.js +2 -0
- package/dist/{model-catalog-DT5vo6qo.js → model-catalog-Dq2n8f_p.js} +6 -5
- package/dist/{models-CcrgSMQR.js → models-PCKOim-h.js} +3 -3
- package/dist/native-execution-policy-umd0tgh4.js +128 -0
- package/dist/native-subagent-history-DjtPloaU.js +140 -0
- package/dist/native-subagent-history-owner-Pcp7JuVF.js +34 -0
- package/dist/{native-subagent-monitor-B3bvQGcg.js → native-subagent-monitor-fQ7eIXEf.js} +115 -460
- package/dist/native-subagent-task-ids-BzTdT0Uw.js +387 -0
- package/dist/node-cli-sessions-DKaOmVUh.js +527 -0
- package/dist/{node-exec-server.runtime-nfbUOtUB.js → node-exec-server.runtime-Cl2vapEi.js} +55 -24
- package/dist/plan-7uG-Fp36.js +947 -0
- package/dist/plugin-activation-BYQculil.js +138 -0
- package/dist/{thread-resume-BLgqkUc1.js → plugin-app-cache-key-d0eKxy7b.js} +4 -52
- package/dist/{plugin-approval-roundtrip-aQVdyL5g.js → plugin-approval-roundtrip-Bz3FT8W5.js} +1 -1
- package/dist/plugin-inventory-oL4Na1ZG.js +328 -0
- package/dist/plugin-marketplace-discovery-P-Vndfqq.js +137 -0
- package/dist/{plugin-metadata-cache-BwCLTY_U.js → plugin-metadata-cache-ClPJpRio.js} +17 -9
- package/dist/protocol-5bh1G-H7.js +275 -0
- package/dist/provider-MQ8PVkuE.js +50 -0
- package/dist/{provider-capabilities-BpG9Ltc5.js → provider-capabilities-BvCUL69A.js} +2 -2
- package/dist/{rate-limits-Fx_l4eNa.js → rate-limits-CBMmWBr9.js} +1 -1
- package/dist/request-B7hEkBGq.js +212 -0
- package/dist/rpc-error-ttN_QjEm.js +30 -0
- package/dist/{run-attempt-BzthFQSM.js → run-attempt-CvsAAGa0.js} +664 -377
- package/dist/{runtime-artifact-Bh_gf6-t.js → runtime-artifact-BJ0rXBZ_.js} +27 -27
- package/dist/sandbox-guard-BxgyoM8M.js +166 -0
- package/dist/{session-binding-4Ki04sW-.js → session-binding-CI8UuilT.js} +30 -48
- package/dist/{session-binding-record-CyaXZvTe.js → session-binding-record-Bcvslnhf.js} +12 -26
- package/dist/session-catalog-adoption-tcZi1IfX.js +251 -0
- package/dist/session-catalog-archive-CwKg8Xz2.js +56 -0
- package/dist/session-catalog-ct-AH01I.js +1477 -0
- package/dist/session-catalog-home-id-CwhLdC03.js +18 -0
- package/dist/session-catalog-node-adoption-B1tgDW-m.js +182 -0
- package/dist/session-catalog-node-continue-Ci-DXyJP.js +238 -0
- package/dist/session-catalog-provenance-D-dIfRAH.js +96 -0
- package/dist/{session-cli-BjLhpmS1.js → session-cli-DNN_jhGc.js} +3 -2
- package/dist/{session-history-DWmMqiqW.js → session-history-Cz-tOOYj.js} +6 -3
- package/dist/{session-upstream-marker-DReTpGz6.js → session-history-import-DwyijFI6.js} +5 -50
- package/dist/{session-history-read-LHldwvyh.js → session-history-read-cxPUxyVV.js} +21 -7
- package/dist/session-history-worker-runtime.js +18 -6
- package/dist/session-history.worker-BeK1YOyT.js +378 -0
- package/dist/session-history.worker.js +1 -1
- package/dist/{session-initialization-BCFVnLL4.js → session-initialization-Ct0_Hzmg.js} +2 -2
- package/dist/{session-permission-policy-BaueHmSj.js → session-permission-policy-BBmXA8Eg.js} +4 -7
- package/dist/{session-retirement-DNdmYdFc.js → session-retirement-B2YfbAAT.js} +6 -5
- package/dist/session-upstream-marker-D15C9NHp.js +46 -0
- package/dist/{settled-turn-context-BOM3Y1pl.js → settled-turn-context-Du6gdUDd.js} +9 -9
- package/dist/{settled-turn-finalizer-BI-b1sry.js → settled-turn-finalizer-Dn91stmc.js} +8 -7
- package/dist/shared-client-CscigXXL.js +3109 -0
- package/dist/{side-question-B6DWAw1A.js → side-question-BGMJQf4U.js} +65 -170
- package/dist/source-CElXU0Oy.js +518 -0
- package/dist/thread-archive-guard-DfpBr-Sz.js +53 -0
- package/dist/thread-history-page-D0JIp48V.js +361 -0
- package/dist/{thread-lifecycle-DPK30jad.js → thread-lifecycle-DXl1-I6b.js} +187 -639
- package/dist/{thread-ownership-CbucAmmp.js → thread-ownership-BsDRTsyp.js} +13 -15
- package/dist/thread-policy-BuEQfE0g.js +54 -0
- package/dist/thread-resume-DsDOZpFg.js +52 -0
- package/dist/timeout-BVw8aaM1.js +33 -0
- package/dist/transcript-history-projection-v17wXgdK.js +238 -0
- package/dist/{transcript-mirror-_njEB84z.js → transcript-mirror-C5CKgNy6.js} +50 -260
- package/dist/{transcript-mirror-attestation-Byl34PC-.js → transcript-mirror-attestation-DibE0krH.js} +17 -4
- package/dist/{transport-stdio-CzTngV0j.js → transport-stdio-BGjHoYLr.js} +73 -43
- package/dist/{upstream-session-fork-1fwbNKzQ.js → upstream-session-fork-BZerMte_.js} +27 -19
- package/dist/{usage-i9fv5-4m.js → usage-tCk-mg_x.js} +4 -3
- package/dist/version-omm6IPI3.js +12 -0
- package/dist/{web-search-provider.runtime-DKQn67A7.js → web-search-provider.runtime-B7bGbGWq.js} +3 -3
- package/openclaw.plugin.json +23 -1
- package/package.json +4 -4
- package/dist/request-C8H22rPi.js +0 -475
- package/dist/session-catalog-B47uwekb.js +0 -3272
- package/dist/session-history.worker-zZVcx0ME.js +0 -267
- package/dist/shared-client-CKhX2kFt.js +0 -7505
- package/dist/thread-policy-CTalhWFy.js +0 -105
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
1
|
+
import { r as readCodexAppServerConfigOptions } from "./launch-args-RXQwn8zV.js";
|
|
2
|
+
import { C as readCodexErrorNotification, E as createCodexElicitationResponse, b as assertCodexThreadStartResponse, x as assertCodexTurnStartResponse } from "./client-B57KWPQx.js";
|
|
3
|
+
import "./config-oIORaQ5T.js";
|
|
4
|
+
import { n as resolveCodexAppServerRuntimeOptions } from "./config-runtime-D0zGNIHu.js";
|
|
5
|
+
import { u as isCodexAppServerStartSelectionChangedError } from "./shared-client-CscigXXL.js";
|
|
6
|
+
import { a as closeCodexStartupClientBestEffort, o as interruptCodexTurnAndWaitBestEffort, t as CODEX_APP_SERVER_INTERRUPT_TIMEOUT_MS } from "./attempt-client-cleanup-DKHzbwt5.js";
|
|
7
|
+
import { t as CodexEphemeralTurn } from "./ephemeral-turn-D78_VmzO.js";
|
|
8
|
+
import { r as readModelListResult } from "./models-PCKOim-h.js";
|
|
9
|
+
import { Et as mergeCodexThreadConfigs, K as attestCodexRestrictedToolSurfaceMcpServersDisabled, _ as assertCodexManagedRequirementsDoNotOverrideToolPolicy, v as buildCodexRingZeroThreadConfigPatch, x as readCodexInheritedMcpServerNames, y as buildCodexRuntimeThreadConfig } from "./thread-lifecycle-DXl1-I6b.js";
|
|
9
10
|
import { resolveTimerTimeoutMs } from "openclaw/plugin-sdk/number-runtime";
|
|
10
|
-
import fs from "node:fs/promises";
|
|
11
11
|
import path from "node:path";
|
|
12
|
-
import
|
|
12
|
+
import fs from "node:fs/promises";
|
|
13
13
|
import { resolvePreferredOpenClawTmpDir, withTempWorkspace } from "openclaw/plugin-sdk/temp-path";
|
|
14
14
|
//#region extensions/codex/src/app-server/bounded-turn.ts
|
|
15
15
|
const CODEX_APP_SERVER_ARGS_ENV_KEY = "OPENCLAW_CODEX_APP_SERVER_ARGS";
|
|
@@ -62,8 +62,8 @@ async function runBoundedCodexAppServerTurn(params) {
|
|
|
62
62
|
async function runBoundedCodexAppServerTurnInWorkspace(params, appServer, workspace, selectionAttempt = 0, timing) {
|
|
63
63
|
const totalTimeoutMs = timing?.timeoutMs ?? resolveTimerTimeoutMs(params.timeoutMs, 100, 100);
|
|
64
64
|
const timeoutError = new CodexBoundedTurnTimeoutError(params.taskLabel, totalTimeoutMs);
|
|
65
|
-
const deadline = timing?.deadline ??
|
|
66
|
-
const timeoutMs = deadline -
|
|
65
|
+
const deadline = timing?.deadline ?? performance.now() + totalTimeoutMs;
|
|
66
|
+
const timeoutMs = deadline - performance.now();
|
|
67
67
|
if (timeoutMs <= 0) throw timeoutError;
|
|
68
68
|
params.assertCurrent?.();
|
|
69
69
|
const agentDir = params.agentDir?.trim() || void 0;
|
|
@@ -79,7 +79,7 @@ async function runBoundedCodexAppServerTurnInWorkspace(params, appServer, worksp
|
|
|
79
79
|
assertCurrent: params.assertCurrent,
|
|
80
80
|
...params.signal ? { abandonSignal: params.signal } : {}
|
|
81
81
|
};
|
|
82
|
-
const client = params.options.clientFactory ? await params.options.clientFactory(clientOptions) : await import("./shared-client-
|
|
82
|
+
const client = params.options.clientFactory ? await params.options.clientFactory(clientOptions) : await import("./shared-client-CscigXXL.js").then((n) => n.y).then(({ createIsolatedCodexAppServerClient }) => createIsolatedCodexAppServerClient({
|
|
83
83
|
...clientOptions,
|
|
84
84
|
authProfileStore: params.authProfileStore
|
|
85
85
|
}));
|
|
@@ -102,7 +102,7 @@ async function runBoundedCodexAppServerTurnInWorkspace(params, appServer, worksp
|
|
|
102
102
|
const abortFromCaller = () => abortRun(params.signal?.reason ?? "aborted");
|
|
103
103
|
if (params.signal?.aborted) abortFromCaller();
|
|
104
104
|
else params.signal?.addEventListener("abort", abortFromCaller, { once: true });
|
|
105
|
-
const remainingRunMs = deadline -
|
|
105
|
+
const remainingRunMs = deadline - performance.now();
|
|
106
106
|
if (remainingRunMs <= 0) abortRun(timeoutError);
|
|
107
107
|
const timeout = setTimeout(() => abortRun(timeoutError), Math.max(1, remainingRunMs));
|
|
108
108
|
timeout.unref?.();
|
|
@@ -147,9 +147,10 @@ async function runBoundedCodexAppServerTurnInWorkspace(params, appServer, worksp
|
|
|
147
147
|
items: params.historyItems
|
|
148
148
|
}, requestOptions);
|
|
149
149
|
params.assertCurrent?.();
|
|
150
|
-
const collector =
|
|
151
|
-
|
|
152
|
-
|
|
150
|
+
const collector = new CodexEphemeralTurn(client, thread.thread.id, {
|
|
151
|
+
textMode: "all",
|
|
152
|
+
onRequest: createCodexBoundedApprovalHandler(params.taskLabel)
|
|
153
|
+
});
|
|
153
154
|
try {
|
|
154
155
|
const turn = assertCodexTurnStartResponse(await client.request("turn/start", {
|
|
155
156
|
threadId: thread.thread.id,
|
|
@@ -159,13 +160,18 @@ async function runBoundedCodexAppServerTurnInWorkspace(params, appServer, worksp
|
|
|
159
160
|
}, requestOptions));
|
|
160
161
|
activeTurnId = turn.turn.id;
|
|
161
162
|
if (abortController.signal.aborted) requestInterrupt();
|
|
162
|
-
const result = await collector.
|
|
163
|
+
const result = await collector.wait(turn.turn, {
|
|
163
164
|
signal: abortController.signal,
|
|
164
|
-
timeoutError
|
|
165
|
+
abortError: () => resolveCodexBoundedTurnAbortError(abortController.signal, params.taskLabel, timeoutError)
|
|
165
166
|
});
|
|
167
|
+
if (result.error || result.turn?.status === "failed") throw new Error((result.error ? readCodexErrorNotification(result.error)?.error.message : result.turn?.error?.message) ?? `codex app-server ${params.taskLabel} turn failed`);
|
|
168
|
+
if (result.turn?.status !== "completed") throw new Error(`codex app-server ${params.taskLabel} turn ended with status ${result.turn?.status ?? "unknown"}`);
|
|
169
|
+
if (!result.text && !params.allowEmptyText) throw new Error(`Codex app-server ${params.taskLabel} turn returned no text.`);
|
|
166
170
|
params.assertCurrent?.();
|
|
167
171
|
return {
|
|
168
|
-
|
|
172
|
+
text: result.text,
|
|
173
|
+
items: result.items,
|
|
174
|
+
usage: result.usage,
|
|
169
175
|
model: modelSelection.catalogId,
|
|
170
176
|
nativeSelection: {
|
|
171
177
|
model: thread.model,
|
|
@@ -174,8 +180,7 @@ async function runBoundedCodexAppServerTurnInWorkspace(params, appServer, worksp
|
|
|
174
180
|
};
|
|
175
181
|
} finally {
|
|
176
182
|
await interruptPromise;
|
|
177
|
-
|
|
178
|
-
cleanup();
|
|
183
|
+
collector.route.release();
|
|
179
184
|
}
|
|
180
185
|
} catch (error) {
|
|
181
186
|
if (abortController.signal.aborted) throw resolveCodexBoundedTurnAbortError(abortController.signal, params.taskLabel, timeoutError);
|
|
@@ -269,110 +274,8 @@ async function resolveCodexBoundedTurnModel(params) {
|
|
|
269
274
|
runtimeModelId: match.model
|
|
270
275
|
};
|
|
271
276
|
}
|
|
272
|
-
function createCodexBoundedTurnCollector(threadId, taskLabel, allowEmptyText) {
|
|
273
|
-
let turnId;
|
|
274
|
-
let completedTurn;
|
|
275
|
-
let promptError;
|
|
276
|
-
const usageProjection = new CodexUsageProjection();
|
|
277
|
-
const pending = [];
|
|
278
|
-
const completedItems = /* @__PURE__ */ new Map();
|
|
279
|
-
const assistantTextByItem = /* @__PURE__ */ new Map();
|
|
280
|
-
const assistantItemOrder = [];
|
|
281
|
-
const { promise: completion, resolve: resolveCompletion } = createDeferred();
|
|
282
|
-
const rememberAssistantText = (itemId, text) => {
|
|
283
|
-
if (!text) return;
|
|
284
|
-
if (!assistantTextByItem.has(itemId)) assistantItemOrder.push(itemId);
|
|
285
|
-
assistantTextByItem.set(itemId, text);
|
|
286
|
-
};
|
|
287
|
-
const handleNotification = (notification) => {
|
|
288
|
-
const params = isJsonObject(notification.params) ? notification.params : void 0;
|
|
289
|
-
if (!params || readStringField(params, "threadId") !== threadId) return;
|
|
290
|
-
if (!turnId) {
|
|
291
|
-
pending.push(notification);
|
|
292
|
-
return;
|
|
293
|
-
}
|
|
294
|
-
if (readCodexNotificationTurnId(params) !== turnId) return;
|
|
295
|
-
if (notification.method === "item/completed") {
|
|
296
|
-
const item = readCodexNotificationItem(notification.params);
|
|
297
|
-
if (item) {
|
|
298
|
-
completedItems.set(item.id, item);
|
|
299
|
-
if (item.type === "agentMessage" && typeof item.text === "string") rememberAssistantText(item.id, item.text);
|
|
300
|
-
}
|
|
301
|
-
return;
|
|
302
|
-
}
|
|
303
|
-
if (notification.method === "item/agentMessage/delta") {
|
|
304
|
-
const itemId = readStringField(params, "itemId") ?? readStringField(params, "id") ?? "assistant";
|
|
305
|
-
const delta = readStringField(params, "delta") ?? "";
|
|
306
|
-
rememberAssistantText(itemId, `${assistantTextByItem.get(itemId) ?? ""}${delta}`);
|
|
307
|
-
return;
|
|
308
|
-
}
|
|
309
|
-
if (notification.method === "rawResponse/completed") {
|
|
310
|
-
usageProjection.record(params);
|
|
311
|
-
return;
|
|
312
|
-
}
|
|
313
|
-
if (notification.method === "turn/completed") {
|
|
314
|
-
completedTurn = readCodexTurnCompletedNotification(notification.params)?.turn ?? completedTurn;
|
|
315
|
-
resolveCompletion();
|
|
316
|
-
return;
|
|
317
|
-
}
|
|
318
|
-
if (notification.method === "error") {
|
|
319
|
-
usageProjection.invalidateContext();
|
|
320
|
-
if (isRetryableErrorNotification(notification.params)) return;
|
|
321
|
-
promptError = readCodexErrorNotification(notification.params)?.error.message ?? `codex app-server ${taskLabel} turn failed`;
|
|
322
|
-
resolveCompletion();
|
|
323
|
-
}
|
|
324
|
-
};
|
|
325
|
-
return {
|
|
326
|
-
handleNotification,
|
|
327
|
-
async collect(startedTurn, options) {
|
|
328
|
-
turnId = startedTurn.id;
|
|
329
|
-
if (isTerminalTurnStatus(startedTurn.status)) completedTurn = startedTurn;
|
|
330
|
-
for (const notification of pending.splice(0)) handleNotification(notification);
|
|
331
|
-
if (!completedTurn && !promptError) await waitForTurnCompletion({
|
|
332
|
-
completion,
|
|
333
|
-
signal: options.signal,
|
|
334
|
-
taskLabel,
|
|
335
|
-
timeoutError: options.timeoutError
|
|
336
|
-
});
|
|
337
|
-
if (promptError) throw new Error(promptError);
|
|
338
|
-
if (completedTurn?.status === "failed") throw new Error(completedTurn.error?.message ?? `codex app-server ${taskLabel} turn failed`);
|
|
339
|
-
if (completedTurn?.status !== "completed") throw new Error(`codex app-server ${taskLabel} turn ended with status ${completedTurn?.status ?? "unknown"}`);
|
|
340
|
-
const items = collectCompletedItems(completedTurn?.items, completedItems);
|
|
341
|
-
const itemText = collectAssistantTextFromItems(items);
|
|
342
|
-
const deltaText = assistantItemOrder.map((itemId) => assistantTextByItem.get(itemId)?.trim()).filter((text) => Boolean(text)).join("\n\n").trim();
|
|
343
|
-
const text = (itemText || deltaText).trim();
|
|
344
|
-
if (!text && !allowEmptyText) throw new Error(`Codex app-server ${taskLabel} turn returned no text.`);
|
|
345
|
-
return {
|
|
346
|
-
text,
|
|
347
|
-
items,
|
|
348
|
-
usage: usageProjection.usage
|
|
349
|
-
};
|
|
350
|
-
}
|
|
351
|
-
};
|
|
352
|
-
}
|
|
353
|
-
function collectCompletedItems(turnItems, notificationItems) {
|
|
354
|
-
const items = new Map(notificationItems);
|
|
355
|
-
for (const item of turnItems ?? []) items.set(item.id, item);
|
|
356
|
-
return [...items.values()];
|
|
357
|
-
}
|
|
358
|
-
async function waitForTurnCompletion(params) {
|
|
359
|
-
if (params.signal.aborted) throw resolveCodexBoundedTurnAbortError(params.signal, params.taskLabel, params.timeoutError);
|
|
360
|
-
let cleanupAbort;
|
|
361
|
-
try {
|
|
362
|
-
await Promise.race([params.completion, new Promise((_, reject) => {
|
|
363
|
-
const abortListener = () => reject(resolveCodexBoundedTurnAbortError(params.signal, params.taskLabel, params.timeoutError));
|
|
364
|
-
params.signal.addEventListener("abort", abortListener, { once: true });
|
|
365
|
-
cleanupAbort = () => params.signal.removeEventListener("abort", abortListener);
|
|
366
|
-
})]);
|
|
367
|
-
} finally {
|
|
368
|
-
cleanupAbort?.();
|
|
369
|
-
}
|
|
370
|
-
}
|
|
371
277
|
function resolveCodexBoundedTurnAbortError(signal, taskLabel, timeoutError) {
|
|
372
278
|
return signal.reason === timeoutError ? timeoutError : /* @__PURE__ */ new Error(`codex app-server ${taskLabel} turn aborted`);
|
|
373
279
|
}
|
|
374
|
-
function collectAssistantTextFromItems(items) {
|
|
375
|
-
return (items ?? []).filter((item) => item.type === "agentMessage").map((item) => item.text.trim()).filter(Boolean).join("\n\n").trim();
|
|
376
|
-
}
|
|
377
280
|
//#endregion
|
|
378
|
-
export { runBoundedCodexAppServerTurn
|
|
281
|
+
export { runBoundedCodexAppServerTurn };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
//#region extensions/codex/package.json
|
|
2
|
+
var version = "2026.9.4";
|
|
3
|
+
//#endregion
|
|
4
|
+
//#region extensions/codex/src/build-state.ts
|
|
5
|
+
/**
|
|
6
|
+
* Duplicate module copies share one immutable published version's state.
|
|
7
|
+
* In-process restarts retain old records and callbacks for their old owners.
|
|
8
|
+
* Local rebuilds without a version bump deliberately share the same state.
|
|
9
|
+
*/
|
|
10
|
+
function codexBuildSymbol(name) {
|
|
11
|
+
return Symbol.for(`${name}@${version}`);
|
|
12
|
+
}
|
|
13
|
+
function defineCodexBuildState(name, create) {
|
|
14
|
+
const key = codexBuildSymbol(name);
|
|
15
|
+
const globalState = globalThis;
|
|
16
|
+
return () => globalState[key] ??= create();
|
|
17
|
+
}
|
|
18
|
+
//#endregion
|
|
19
|
+
export { defineCodexBuildState as n, codexBuildSymbol as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { t as CodexAppServerRpcError } from "./rpc-error-ttN_QjEm.js";
|
|
2
2
|
//#region extensions/codex/src/app-server/capabilities.ts
|
|
3
3
|
/**
|
|
4
4
|
* Capability helpers for optional Codex app-server control-plane methods.
|
package/dist/cli-metadata.js
CHANGED
|
@@ -2,7 +2,7 @@ import { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry";
|
|
|
2
2
|
//#region extensions/codex/cli-metadata.ts
|
|
3
3
|
function registerCodexCliMetadata(api) {
|
|
4
4
|
api.registerCli(async ({ program }) => {
|
|
5
|
-
const { registerCodexSessionCli } = await import("./session-cli-
|
|
5
|
+
const { registerCodexSessionCli } = await import("./session-cli-DNN_jhGc.js");
|
|
6
6
|
registerCodexSessionCli(program);
|
|
7
7
|
}, { descriptors: [{
|
|
8
8
|
name: "codex",
|