@openclaw/codex 2026.10.5-beta.4 → 2026.10.10-beta.1
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 +10 -3
- package/dist/.setup/{account-usage-runtime-CoVpNIlD.mjs → account-usage-runtime-DDCDkvtl.mjs} +15 -9
- package/dist/.setup/{app-server-policy-D_zv8J7V.mjs → app-server-policy-Cog6mm2i.mjs} +1 -1
- package/dist/.setup/{apply-BXDMd05l.mjs → apply-BVSXYkTV.mjs} +11 -11
- package/dist/.setup/{attempt-client-cleanup-zNuNTKVr.mjs → attempt-client-cleanup-6OcbMH46.mjs} +14 -8
- package/dist/.setup/attempt-terminal-sZutF0WY.mjs +1 -0
- package/dist/.setup/{attempt-workspace-context-CcwP3DA3.mjs → attempt-workspace-context-GYPLawX6.mjs} +2 -2
- package/dist/.setup/{auth-binding-BaxlhaNx.mjs → auth-binding-830RLAJW.mjs} +2 -2
- package/dist/.setup/{auth-cache-key-f8ODJ_OX.mjs → auth-cache-key-CVcYw8HD.mjs} +92 -80
- package/dist/.setup/{auth-profile-CgHQ8Vot.mjs → auth-profile-auwzSwwy.mjs} +14 -8
- package/dist/.setup/{auth-profile-health-oHizqgye.mjs → auth-profile-health-BVPZU9I8.mjs} +15 -8
- package/dist/.setup/{auth-profile-selection-hr8ocLtz.mjs → auth-profile-selection-Bp5PDk3W.mjs} +24 -7
- package/dist/.setup/{binding-connection-B7HAAZSI.mjs → binding-connection-GTgUj9pi.mjs} +2 -2
- package/dist/.setup/{binding-connection.runtime-DAXn7iFl.mjs → binding-connection.runtime-RcWR3vQu.mjs} +4 -3
- package/dist/.setup/{bounded-turn-isolation-BfDAo-qZ.mjs → bounded-turn-isolation-D8CDrAVX.mjs} +3 -3
- package/dist/.setup/{bounded-turn-DfIJtRlv.mjs → bounded-turn-mN_ekXYW.mjs} +18 -22
- package/dist/.setup/{build-state-Ds14X10-.mjs → build-state-VcujMRqP.mjs} +1 -1
- package/dist/.setup/{capabilities-DbOzOglY.mjs → capabilities-DAS-JX1z.mjs} +1 -1
- package/dist/.setup/{client-D93nbdB8.mjs → client-BS8X7HmG.mjs} +47 -317
- package/dist/.setup/{client-catalog-response-CuVLp4I0.mjs → client-catalog-response-jM38o5w1.mjs} +2 -2
- package/dist/.setup/client-initialize-CjgZcX61.mjs +165 -0
- package/dist/.setup/{command-dispatch-DxdH5a9-.mjs → command-dispatch-DzXbHqCn.mjs} +3 -3
- package/dist/.setup/{command-formatters-xW9KpoSZ.mjs → command-formatters-B_7-QZ1c.mjs} +2 -2
- package/dist/.setup/{command-handlers-fiYvYYq0.mjs → command-handlers-tfb5Uq-O.mjs} +539 -406
- package/dist/.setup/command-rpc-SXqLQukR.mjs +296 -0
- package/dist/.setup/compact-M-JxLcbZ.mjs +823 -0
- package/dist/.setup/{computer-use-DL2v3Kxq.mjs → computer-use-FqQ-Flbl.mjs} +21 -68
- package/dist/.setup/{config-C1YVVLEA.mjs → config-BfrAlTMT.mjs} +3 -3
- package/dist/.setup/{config-options-DDzeNQ8m.mjs → config-options-DMFZkd3X.mjs} +1 -1
- package/dist/.setup/{config-runtime-DWzK-k0n.mjs → config-runtime-BZRizyuG.mjs} +2 -2
- package/dist/.setup/{context-engine-projection-ps-yn_ci.mjs → context-engine-projection-PIeLSnR-.mjs} +16 -30
- package/dist/.setup/{conversation-binding-BieJZRRV.mjs → conversation-binding-C7MZy-Cx.mjs} +228 -116
- package/dist/.setup/{conversation-binding-data-UgLuTSQT.mjs → conversation-binding-data-khgW0n-o.mjs} +4 -2
- package/dist/.setup/{conversation-control-GXM3unE4.mjs → conversation-control-B2EpVZEb.mjs} +53 -23
- package/dist/.setup/{cyber-failover-D4dgNfFf.mjs → cyber-failover-CqEZoQsj.mjs} +1 -1
- package/dist/.setup/{cyber-failover-notice-ljgGGL0s.mjs → cyber-failover-notice-poL3Advd.mjs} +1 -1
- package/dist/.setup/{doctor-start-options-JjTAl-q_.mjs → doctor-start-options-8uIBXIzR.mjs} +8 -5
- package/dist/.setup/{dynamic-tool-build-DcaPmBlE.mjs → dynamic-tool-build-BjFAIG-f.mjs} +208 -218
- package/dist/.setup/{dynamic-tools-CnQFnNKH.mjs → dynamic-tools-XqWsVjcC.mjs} +344 -118
- package/dist/.setup/{effective-mcp-catalog-B5HKFZNK.mjs → effective-mcp-catalog-C3ta5hHc.mjs} +11 -9
- package/dist/.setup/{ephemeral-turn-De3qb8EQ.mjs → ephemeral-turn-1ZF17fUR.mjs} +5 -4
- package/dist/.setup/{event-projector-assistant-message-CLMKN4x-.mjs → event-projector-assistant-message-ChOAY7rW.mjs} +16 -11
- package/dist/.setup/{event-projector-usage-BpKfdoTm.mjs → event-projector-usage-CBY0Hkga.mjs} +2 -2
- package/dist/.setup/{event-projector-values-CLvG1Hil.mjs → event-projector-values-yf4us9Pf.mjs} +1 -1
- package/dist/.setup/experimental-features-uGnVDtp-.mjs +19 -0
- package/dist/.setup/inference-context-mv_dBpAL.mjs +209 -0
- package/dist/.setup/{inference-dispatch-CO6tTs4q.mjs → inference-dispatch-C2zVSnrr.mjs} +2 -2
- package/dist/.setup/{inference-metadata-DCvcG_N_.mjs → inference-metadata-CYFWLHVk.mjs} +3 -1
- package/dist/.setup/{inference-proxy-BDWV0djM.mjs → inference-proxy-yd3hr2dr.mjs} +8 -8
- package/dist/.setup/installed-probe-lVC1X5ve.mjs +185 -0
- package/dist/.setup/{isolated-completion-BPJdvk5F.mjs → isolated-completion-P-r8NRE4.mjs} +7 -7
- package/dist/.setup/managed-binary-DbKvGXKl.mjs +395 -0
- package/dist/.setup/{mcp-app-session-preparation-Dz2GOwyE.mjs → mcp-app-session-preparation-fnsnCovu.mjs} +18 -14
- package/dist/.setup/{model-catalog-ZNwltCKl.mjs → model-catalog-Y_esgRPY.mjs} +28 -17
- package/dist/.setup/{models-BHpbAuz8.mjs → models-BWLEUo2E.mjs} +3 -3
- package/dist/.setup/{native-auth-esN5MdIv.mjs → native-auth-DpZIaY8N.mjs} +7 -4
- package/dist/.setup/native-execution-policy-D09tLP-u.mjs +152 -0
- package/dist/.setup/{native-hook-relay-wq7jrNLk.mjs → native-hook-relay-C7aaLJaP.mjs} +45 -10
- package/dist/.setup/{native-mcp-app-DX3nyTtc.mjs → native-mcp-app-CsWj-v_x.mjs} +5 -5
- package/dist/.setup/{native-skill-isolation-DSBeF-Yy.mjs → native-skill-isolation-CMimsKYy.mjs} +7 -7
- package/dist/.setup/{native-subagent-monitor-DOLEIf9r.mjs → native-subagent-monitor-CFE7b4oC.mjs} +485 -239
- package/dist/.setup/{native-subagent-pending-assignments-DmVhedNs.mjs → native-subagent-pending-assignments-CTinVtjo.mjs} +1 -1
- package/dist/.setup/{native-task-assignments-DimsQ9Qa.mjs → native-task-assignments-YJopbaVO.mjs} +9 -5
- package/dist/.setup/{node-cli-sessions-CzKg2nGq.mjs → node-cli-sessions-BuJnBnEq.mjs} +7 -4
- package/dist/.setup/{node-exec-server.runtime-BWkULhBM.mjs → node-exec-server.runtime-CP7RC1Nd.mjs} +3 -3
- package/dist/.setup/{plan-41-YOBMq.mjs → plan-B4cHgqNv.mjs} +7 -20
- package/dist/.setup/{plugin-activation-D7WkJMvU.mjs → plugin-activation-CXPWe-hl.mjs} +4 -4
- package/dist/.setup/{plugin-app-cache-key-Bg9DbDI6.mjs → plugin-app-cache-key-DRb-niJc.mjs} +17 -55
- package/dist/.setup/{plugin-approval-roundtrip-CD88q3yx.mjs → plugin-approval-roundtrip-DIZHLbAM.mjs} +1 -1
- package/dist/.setup/{plugin-inventory-CYgdo14P.mjs → plugin-inventory-DE9wcaeH.mjs} +2 -2
- package/dist/.setup/{plugin-metadata-cache-Bi8TAPwX.mjs → plugin-metadata-cache-BqC-a6Fb.mjs} +2 -15
- package/dist/.setup/{project-doc-thread-config-BVcvnps8.mjs → project-doc-thread-config-B0UI3f1D.mjs} +6 -6
- package/dist/.setup/protocol-CaPAVwe9.mjs +12 -0
- package/dist/.setup/{provider-capabilities-Dn2WwH4P.mjs → provider-capabilities-DjcKunHS.mjs} +1 -1
- package/dist/.setup/{provider-LWKll6dV.mjs → provider-wj_LFJH3.mjs} +4 -4
- package/dist/.setup/{rate-limits-CI8pTPqL.mjs → rate-limits-BpfURnuy.mjs} +1 -1
- package/dist/.setup/{request-Bo0kKABI.mjs → request-ePeNJrOd.mjs} +132 -136
- package/dist/.setup/{responses-oauth-twnuTaAa.mjs → responses-oauth-CCV7aVYF.mjs} +6 -6
- package/dist/.setup/{rpc-error-C98SHchT.mjs → rpc-error-DemqqaxE.mjs} +7 -3
- package/dist/.setup/{run-attempt-ClU8MxhZ.mjs → run-attempt-BcWArowv.mjs} +595 -426
- package/dist/.setup/{run-attempt-lifecycle-KN4oh-7O.mjs → run-attempt-lifecycle-DN-ATDp9.mjs} +1 -1
- package/dist/.setup/{runtime-artifact-C13pR7tD.mjs → runtime-artifact-CmLWeyJB.mjs} +3 -3
- package/dist/.setup/{runtime-artifact-connection-jS5DeCok.mjs → runtime-artifact-connection-DpWlZ02e.mjs} +3 -3
- package/dist/.setup/{sandbox-guard-DIImwCy1.mjs → sandbox-guard-DneAfNye.mjs} +70 -30
- package/dist/.setup/{session-binding-JEHNMPsr.mjs → session-binding-BgsWcbdY.mjs} +25 -23
- package/dist/.setup/{session-binding-record-DU_0biMD.mjs → session-binding-record-C_THntMe.mjs} +27 -12
- package/dist/.setup/{session-binding-record-codec-BpH8u_G9.mjs → session-binding-record-codec-DvmOI7g_.mjs} +1 -0
- package/dist/.setup/{session-binding-sidecars-DD-enC8w.mjs → session-binding-sidecars-BNSS6WL4.mjs} +55 -63
- package/dist/.setup/session-cancellation-DLBSJO5n.mjs +43 -0
- package/dist/.setup/{session-catalog-adoption-Ca3OYGYM.mjs → session-catalog-adoption-ppsLlVLB.mjs} +24 -38
- package/dist/.setup/{session-catalog-archive-Bv6gV7x9.mjs → session-catalog-archive-CqLRHJ6z.mjs} +11 -13
- package/dist/.setup/{session-catalog-events-kR2Ot6nX.mjs → session-catalog-events-DK0opVp3.mjs} +5 -5
- package/dist/.setup/{session-catalog-index-CrnfVEnT.mjs → session-catalog-index-BfzfdtH7.mjs} +96 -271
- package/dist/.setup/{session-catalog-index-order-CTfoefow.mjs → session-catalog-index-order-0Zqng2u8.mjs} +1 -1
- package/dist/.setup/{session-catalog-limits-BynIoOYm.mjs → session-catalog-limits-Dc6E0BZz.mjs} +1 -1
- package/dist/.setup/{session-catalog-list-request-D4MYNgDB.mjs → session-catalog-list-request-CAjoWjaH.mjs} +3 -4
- package/dist/.setup/{session-catalog-native-projection-CWqCU1I_.mjs → session-catalog-native-projection-G3lSDYYG.mjs} +5 -5
- package/dist/.setup/{session-catalog-node-adoption-BdP9Zjqo.mjs → session-catalog-node-adoption-e9v8mGgx.mjs} +5 -5
- package/dist/.setup/{session-catalog-node-continue-CNJibO4_.mjs → session-catalog-node-continue-H7nrzcUD.mjs} +5 -5
- package/dist/.setup/{session-catalog-node-lookup-BH_DBGa9.mjs → session-catalog-node-lookup-BrZfDkA8.mjs} +2 -2
- package/dist/.setup/{session-catalog-parsing-DkeoVn60.mjs → session-catalog-parsing-V6jyFg9g.mjs} +2 -2
- package/dist/.setup/{session-catalog-projection-BzHiV818.mjs → session-catalog-projection-BjWE414G.mjs} +8 -7
- package/dist/.setup/{session-catalog-provenance-CmsOE5mh.mjs → session-catalog-provenance-Dg9s12z-.mjs} +50 -30
- package/dist/.setup/{session-catalog-source-DGuRdGvM.mjs → session-catalog-source-DqyuNxCe.mjs} +2 -6
- package/dist/.setup/{session-cli-GwU0izn-.mjs → session-cli-CBGKiqdv.mjs} +1 -1
- package/dist/.setup/{session-history-BO6i_pfk.mjs → session-history-7W0cgTXF.mjs} +11 -9
- package/dist/.setup/{session-history-import-CaO8s6ta.mjs → session-history-import-BwPKwcNi.mjs} +4 -4
- package/dist/.setup/{session-initialization-Bi_2DKhc.mjs → session-initialization-Dn3vveGv.mjs} +2 -2
- package/dist/.setup/{session-retirement-B3U5hpGJ.mjs → session-retirement-Ci_JvOfH.mjs} +8 -8
- package/dist/.setup/{session-history.worker-DJQfek5p.mjs → settled-turn-evidence--tRW6fSm.mjs} +2 -18
- package/dist/.setup/{settled-turn-finalizer-CYCVpTv2.mjs → settled-turn-finalizer-D3-KXsbP.mjs} +8 -8
- package/dist/.setup/{shared-client-BCx1wbyA.mjs → shared-client-CE_uY0A1.mjs} +380 -557
- package/dist/.setup/side-question-OM18H9WJ.mjs +998 -0
- package/dist/.setup/{source-DipMO9hL.mjs → source-uGKgKWm8.mjs} +5 -5
- package/dist/.setup/{thread-archive-guard-LKdwQKyr.mjs → thread-archive-guard-BWjSsA92.mjs} +1 -1
- package/dist/.setup/{thread-lifecycle-run-C_aYiYqk.mjs → thread-lifecycle-run-mLueY6pH.mjs} +172 -75
- package/dist/.setup/{thread-model-selection-DcVebr8N.mjs → thread-model-selection-DxposL4X.mjs} +9 -9
- package/dist/.setup/{thread-ownership-BoUd0i6L.mjs → thread-ownership-t6Y9fLQS.mjs} +7 -7
- package/dist/.setup/{thread-policy-B3wBRNph.mjs → thread-policy-Cy301Or8.mjs} +6 -6
- package/dist/.setup/{thread-requests-BgzJwJtS.mjs → thread-requests-BjawdIVV.mjs} +14 -14
- package/dist/.setup/{thread-resume-D-3bsr1j.mjs → thread-resume-BUbsUfgF.mjs} +6 -6
- package/dist/.setup/{transcript-history-projection-DfKcoZCB.mjs → transcript-history-projection-i-FVpyha.mjs} +1 -1
- package/dist/.setup/{transcript-mirror-Bee2o6jj.mjs → transcript-mirror-CEQJZlF3.mjs} +6 -9
- package/dist/.setup/{transport-stdio-CRWTkKOn.mjs → transport-stdio-Bq160Dhv.mjs} +63 -64
- package/dist/.setup/{transport-websocket-DIyPfkHo.mjs → transport-websocket-0YqiI_MH.mjs} +1 -1
- package/dist/.setup/{turn-router-DBVMToGo.mjs → turn-router-Dbw17k3K.mjs} +2 -2
- package/dist/.setup/{upstream-session-fork-p5fwKi7w.mjs → upstream-session-fork-_LYkh0nZ.mjs} +46 -219
- package/dist/.setup/{usage-limit-error-BQX8RHAd.mjs → usage-limit-error-DcOSH3J4.mjs} +4 -4
- package/dist/.setup/{usage-C2Kq7oej.mjs → usage-w_93wnnR.mjs} +4 -4
- package/dist/.setup/{web-search-item-CvokaZOo.mjs → web-search-item-DHVuNSqk.mjs} +1 -1
- package/dist/.setup/{web-search-provider.runtime-D89djc7e.mjs → web-search-provider.runtime-DMHxve5v.mjs} +3 -3
- package/dist/.setup/{workspace-write-sandbox-probe-BDWO2Qkh.mjs → workspace-write-sandbox-probe-DJxOXcF3.mjs} +2 -2
- package/dist/api.js +7 -28
- package/dist/catalog-page.worker.js +1 -1
- package/dist/cli-metadata.js +1 -1
- package/dist/client-version-api.js +25 -0
- package/dist/doctor-contract-api.js +5 -5
- package/dist/harness.js +59 -36
- package/dist/index.js +259 -295
- package/dist/media-understanding-provider.js +2 -2
- package/dist/migration-provider-api.js +1 -2
- package/dist/native-session-binding-api.js +1 -2
- package/dist/provider-discovery.js +1 -1
- package/dist/session-history-worker-entrypoint.js +12 -0
- package/dist/session-history-worker-runtime.js +7 -18
- package/dist/session-history.worker.js +18 -2
- package/openclaw.plugin.json +1 -1
- package/package.json +6 -6
- package/dist/.setup/attempt-terminal-jO5IMj9K.mjs +0 -2
- package/dist/.setup/command-rpc-HIvsy3wS.mjs +0 -247
- package/dist/.setup/compact-ClZ7Ar7L.mjs +0 -808
- package/dist/.setup/inference-context-DNlGwzwy.mjs +0 -91
- package/dist/.setup/managed-binary-BtIjV7yN.mjs +0 -175
- package/dist/.setup/native-execution-policy-MXEe7PB3.mjs +0 -75
- package/dist/.setup/protocol-CANUwXJ3.mjs +0 -17
- package/dist/.setup/side-question-Bz2UQW0l.mjs +0 -826
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import { n as readCodexInferenceMetadata } from "./inference-metadata-DCvcG_N_.mjs";
|
|
2
|
-
import { randomUUID } from "node:crypto";
|
|
3
|
-
//#region extensions/codex/src/app-server/inference-context.ts
|
|
4
|
-
const MAX_CONTEXT_BYTES = 262144;
|
|
5
|
-
const MAX_ACTIVE_ROOTS = 64;
|
|
6
|
-
/** One physical inference transport owns these confidential, nonpersistent snapshots. */
|
|
7
|
-
function createCodexInferenceContext(assertClientCurrent) {
|
|
8
|
-
const roots = /* @__PURE__ */ new Map();
|
|
9
|
-
let closed = false;
|
|
10
|
-
const assertOpen = () => {
|
|
11
|
-
if (closed) throw new Error("Codex parent-local inference transport is closed");
|
|
12
|
-
assertClientCurrent();
|
|
13
|
-
};
|
|
14
|
-
return {
|
|
15
|
-
register(params) {
|
|
16
|
-
assertOpen();
|
|
17
|
-
params.signal.throwIfAborted();
|
|
18
|
-
params.assertCurrent();
|
|
19
|
-
if (Buffer.byteLength(params.text) > MAX_CONTEXT_BYTES) throw new Error("Codex parent-local context exceeds the 256 KiB inference limit");
|
|
20
|
-
if (!roots.has(params.threadId) && roots.size >= MAX_ACTIVE_ROOTS) throw new Error("Codex parent-local inference root limit reached");
|
|
21
|
-
roots.get(params.threadId)?.release();
|
|
22
|
-
const controller = new AbortController();
|
|
23
|
-
const registration = {
|
|
24
|
-
generation: randomUUID(),
|
|
25
|
-
text: params.text,
|
|
26
|
-
controller,
|
|
27
|
-
assertCurrent: () => {
|
|
28
|
-
assertOpen();
|
|
29
|
-
controller.signal.throwIfAborted();
|
|
30
|
-
params.signal.throwIfAborted();
|
|
31
|
-
params.assertCurrent();
|
|
32
|
-
if (roots.get(params.threadId) !== registration) throw new Error("Codex parent-local inference generation was replaced");
|
|
33
|
-
},
|
|
34
|
-
release: () => {
|
|
35
|
-
if (roots.get(params.threadId) === registration) roots.delete(params.threadId);
|
|
36
|
-
registration.text = "";
|
|
37
|
-
controller.abort();
|
|
38
|
-
params.signal.removeEventListener("abort", registration.release);
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
roots.set(params.threadId, registration);
|
|
42
|
-
params.signal.addEventListener("abort", registration.release, { once: true });
|
|
43
|
-
return {
|
|
44
|
-
generation: registration.generation,
|
|
45
|
-
release: registration.release
|
|
46
|
-
};
|
|
47
|
-
},
|
|
48
|
-
/** Caller must authenticate its private transport before parsing any model request. */
|
|
49
|
-
prepare(body, preparedMetadata, requireAdmission = false) {
|
|
50
|
-
assertOpen();
|
|
51
|
-
const metadata = preparedMetadata ?? readCodexInferenceMetadata(body);
|
|
52
|
-
const child = Boolean(metadata.parentThreadId || metadata.subagentKind || metadata.subagent);
|
|
53
|
-
const kind = metadata.requestKind;
|
|
54
|
-
if (!requireAdmission && (child || kind === "compaction" || kind === "memory")) return {
|
|
55
|
-
body,
|
|
56
|
-
assertCurrent: assertOpen,
|
|
57
|
-
signal: void 0
|
|
58
|
-
};
|
|
59
|
-
if (child || kind !== "turn" && kind !== "prewarm" && !(requireAdmission && kind === "compaction")) throw new Error("Codex inference request has an unsupported native purpose");
|
|
60
|
-
const registration = metadata.threadId ? roots.get(metadata.threadId) : void 0;
|
|
61
|
-
const generation = metadata.generation;
|
|
62
|
-
if (!requireAdmission && kind === "prewarm" && body.generate === false && generation == null) return {
|
|
63
|
-
body,
|
|
64
|
-
assertCurrent: assertOpen,
|
|
65
|
-
signal: void 0
|
|
66
|
-
};
|
|
67
|
-
if (!registration || generation !== registration.generation) throw new Error("Codex inference has no current admitted parent generation");
|
|
68
|
-
registration.assertCurrent();
|
|
69
|
-
let preparedBody = body;
|
|
70
|
-
if (kind !== "compaction") {
|
|
71
|
-
const instructions = body.instructions;
|
|
72
|
-
if (instructions !== void 0 && typeof instructions !== "string") throw new Error("Codex inference request has invalid top-level instructions");
|
|
73
|
-
if (registration.text) preparedBody = {
|
|
74
|
-
...body,
|
|
75
|
-
instructions: instructions === void 0 ? registration.text : instructions + "\n\n" + registration.text
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
return {
|
|
79
|
-
body: preparedBody,
|
|
80
|
-
assertCurrent: registration.assertCurrent,
|
|
81
|
-
signal: registration.controller.signal
|
|
82
|
-
};
|
|
83
|
-
},
|
|
84
|
-
close() {
|
|
85
|
-
closed = true;
|
|
86
|
-
for (const registration of roots.values()) registration.release();
|
|
87
|
-
}
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
//#endregion
|
|
91
|
-
export { createCodexInferenceContext as t };
|
|
@@ -1,175 +0,0 @@
|
|
|
1
|
-
import { t as __exportAll } from "./session-binding-sidecars-DD-enC8w.mjs";
|
|
2
|
-
import { createRequire } from "node:module";
|
|
3
|
-
import { resolveGlobalSingleton } from "openclaw/plugin-sdk/global-singleton";
|
|
4
|
-
import { constants, existsSync, realpathSync } from "node:fs";
|
|
5
|
-
import path from "node:path";
|
|
6
|
-
import { access } from "node:fs/promises";
|
|
7
|
-
//#region extensions/codex/src/app-server/desktop-app-paths.ts
|
|
8
|
-
/** Shared path candidates for Codex's macOS desktop app bundle. */
|
|
9
|
-
const MACOS_DESKTOP_CODEX_APP_PATH_CANDIDATES = ["ChatGPT.app", "Codex.app"].flatMap((appName) => {
|
|
10
|
-
const appBundlePath = `/Applications/${appName}`;
|
|
11
|
-
const resources = `${appBundlePath}/Contents/Resources`;
|
|
12
|
-
const computerUseServiceAppPaths = [`${resources}/cua_node/lib/node_modules/@oai/sky/Codex Computer Use.app`, `${resources}/plugins/openai-bundled/plugins/computer-use/Codex Computer Use.app`];
|
|
13
|
-
if (appName === "Codex.app") computerUseServiceAppPaths.reverse();
|
|
14
|
-
const candidate = {
|
|
15
|
-
appName,
|
|
16
|
-
appBundlePath,
|
|
17
|
-
appServerCommandPath: `${resources}/codex`,
|
|
18
|
-
bundledMarketplacePath: `${resources}/plugins/openai-bundled`,
|
|
19
|
-
computerUseServiceAppPaths
|
|
20
|
-
};
|
|
21
|
-
return [{
|
|
22
|
-
...candidate,
|
|
23
|
-
appServerCommandPath: path.join(resources, "codex-cli", "CodexCLI.app", "Contents", "MacOS", "codex")
|
|
24
|
-
}, candidate];
|
|
25
|
-
});
|
|
26
|
-
function resolveMacOSDesktopCodexAppPathCandidates(platform = process.platform) {
|
|
27
|
-
return platform === "darwin" ? MACOS_DESKTOP_CODEX_APP_PATH_CANDIDATES : [];
|
|
28
|
-
}
|
|
29
|
-
function resolveMacOSDesktopCodexAppServerCommandCandidates(platform = process.platform) {
|
|
30
|
-
return resolveMacOSDesktopCodexAppPathCandidates(platform).map((candidate) => candidate.appServerCommandPath);
|
|
31
|
-
}
|
|
32
|
-
function resolveMacOSDesktopCodexBundledMarketplaceCandidates(platform = process.platform) {
|
|
33
|
-
return [...new Set(resolveMacOSDesktopCodexAppPathCandidates(platform).map((candidate) => candidate.bundledMarketplacePath))];
|
|
34
|
-
}
|
|
35
|
-
function resolveMacOSDesktopCodexComputerUseServiceAppCandidates(platform = process.platform, appServerCommand) {
|
|
36
|
-
if (platform !== "darwin") return [];
|
|
37
|
-
const candidates = resolveMacOSDesktopCodexAppPathCandidates(platform);
|
|
38
|
-
const matchingCandidate = appServerCommand ? candidates.find((candidate) => path.resolve(candidate.appServerCommandPath) === path.resolve(appServerCommand)) : void 0;
|
|
39
|
-
return [.../* @__PURE__ */ new Set([...matchingCandidate?.computerUseServiceAppPaths ?? [], ...candidates.flatMap((candidate) => candidate.computerUseServiceAppPaths)])];
|
|
40
|
-
}
|
|
41
|
-
function resolveFirstExistingMacOSDesktopCodexBundledMarketplacePath(params = {}) {
|
|
42
|
-
const candidates = params.candidates ?? resolveMacOSDesktopCodexBundledMarketplaceCandidates(params.platform);
|
|
43
|
-
const pathExists = params.pathExists ?? existsSync;
|
|
44
|
-
return candidates.find((candidate) => pathExists(candidate));
|
|
45
|
-
}
|
|
46
|
-
//#endregion
|
|
47
|
-
//#region extensions/codex/src/app-server/version.ts
|
|
48
|
-
/** Exact Codex app-server version shipped by the OpenClaw Codex bridge. */
|
|
49
|
-
const CODEX_APP_SERVER_VERSION = "0.160.0";
|
|
50
|
-
/** Inclusive runtime compatibility floor for external app-server binaries. */
|
|
51
|
-
const MIN_SUPPORTED_CODEX_APP_SERVER_VERSION = "0.149.0";
|
|
52
|
-
const MANAGED_CODEX_APP_SERVER_PACKAGE = "@openai/codex";
|
|
53
|
-
//#endregion
|
|
54
|
-
//#region extensions/codex/src/app-server/managed-binary.ts
|
|
55
|
-
/**
|
|
56
|
-
* Resolves the managed Codex app-server binary shipped with or installed beside
|
|
57
|
-
* the Codex plugin before stdio startup.
|
|
58
|
-
*/
|
|
59
|
-
var managed_binary_exports = /* @__PURE__ */ __exportAll({
|
|
60
|
-
isManagedCodexDesktopCommand: () => isManagedCodexDesktopCommand,
|
|
61
|
-
resolveManagedCodexAppServerStartOptions: () => resolveManagedCodexAppServerStartOptions,
|
|
62
|
-
resolveManagedCodexNativeCommand: () => resolveManagedCodexNativeCommand,
|
|
63
|
-
resolveManagedCodexPackageEntrypoint: () => resolveManagedCodexPackageEntrypoint,
|
|
64
|
-
resolvePackagedCodexNativeCommand: () => resolvePackagedCodexNativeCommand,
|
|
65
|
-
setManagedCodexPluginRoot: () => setManagedCodexPluginRoot
|
|
66
|
-
});
|
|
67
|
-
const NATIVE_TARGET_TRIPLES = /* @__PURE__ */ new Map([
|
|
68
|
-
["linux-x64", "x86_64-unknown-linux-musl"],
|
|
69
|
-
["linux-arm64", "aarch64-unknown-linux-musl"],
|
|
70
|
-
["darwin-x64", "x86_64-apple-darwin"],
|
|
71
|
-
["darwin-arm64", "aarch64-apple-darwin"],
|
|
72
|
-
["win32-x64", "x86_64-pc-windows-msvc"],
|
|
73
|
-
["win32-arm64", "aarch64-pc-windows-msvc"]
|
|
74
|
-
]);
|
|
75
|
-
const registeredCodexPlugin = resolveGlobalSingleton(Symbol.for("openclaw.codexManagedPluginRoot"), () => ({}));
|
|
76
|
-
/** Records the process-stable plugin root prepared by OpenClaw's plugin loader. */
|
|
77
|
-
function setManagedCodexPluginRoot(pluginRoot) {
|
|
78
|
-
registeredCodexPlugin.root = pluginRoot;
|
|
79
|
-
}
|
|
80
|
-
async function resolveManagedCodexAppServerStartOptions(startOptions, options = {}) {
|
|
81
|
-
if (startOptions.transport !== "stdio" || startOptions.commandSource !== "managed") return startOptions;
|
|
82
|
-
const pluginRoot = options.pluginRoot ?? registeredCodexPlugin.root;
|
|
83
|
-
if (!pluginRoot) throw new Error("Codex plugin root is unavailable. Load the Codex plugin before starting its managed app-server.");
|
|
84
|
-
const platform = options.platform ?? process.platform;
|
|
85
|
-
const candidateCommandPaths = resolveManagedCodexAppServerCommandCandidates(pluginRoot, platform, startOptions.managedCommandOrder ?? "package-first");
|
|
86
|
-
const pathExists = options.pathExists ?? commandPathExists;
|
|
87
|
-
const commandPaths = [];
|
|
88
|
-
for (const commandPath of candidateCommandPaths) if (await pathExists(commandPath, platform)) commandPaths.push(commandPath);
|
|
89
|
-
const [commandPath, ...managedFallbackCommandPaths] = commandPaths;
|
|
90
|
-
if (commandPath === void 0) throw new Error([
|
|
91
|
-
`Managed Codex app-server binary was not found for ${MANAGED_CODEX_APP_SERVER_PACKAGE}.`,
|
|
92
|
-
"Reinstall or update OpenClaw, or run pnpm install in a source checkout.",
|
|
93
|
-
"Set plugins.entries.codex.config.appServer.command or OPENCLAW_CODEX_APP_SERVER_BIN to use a custom Codex binary."
|
|
94
|
-
].join(" "));
|
|
95
|
-
return {
|
|
96
|
-
...startOptions,
|
|
97
|
-
command: commandPath,
|
|
98
|
-
commandSource: "resolved-managed",
|
|
99
|
-
...managedFallbackCommandPaths.length > 0 ? { managedFallbackCommandPaths } : {}
|
|
100
|
-
};
|
|
101
|
-
}
|
|
102
|
-
/** Resolves the native artifact behind a successful managed launcher selection. */
|
|
103
|
-
function resolveManagedCodexNativeCommand(command, options = {}) {
|
|
104
|
-
const platform = options.platform ?? process.platform;
|
|
105
|
-
if (isManagedCodexDesktopCommand(command, platform)) return command;
|
|
106
|
-
const target = `${platform === "android" ? "linux" : platform}-${options.arch ?? process.arch}`;
|
|
107
|
-
const triple = NATIVE_TARGET_TRIPLES.get(target);
|
|
108
|
-
if (!triple) return;
|
|
109
|
-
const packageRoot = resolveManagedCodexPackageRootForCommand(command, platform);
|
|
110
|
-
if (!packageRoot) return;
|
|
111
|
-
const resolvePackageJson = options.resolvePackageJson ?? resolvePackageJsonFromRoot;
|
|
112
|
-
const pathExists = options.pathExists ?? existsSync;
|
|
113
|
-
const packageJsonPath = resolvePackageJson(`@openai/codex-${target}`, packageRoot) ?? resolvePackageJson("@openai/codex", packageRoot);
|
|
114
|
-
if (!packageJsonPath) return;
|
|
115
|
-
const candidate = path.join(path.dirname(packageJsonPath), "vendor", triple, "bin", platform === "win32" ? "codex.exe" : "codex");
|
|
116
|
-
return pathExists(candidate) ? candidate : void 0;
|
|
117
|
-
}
|
|
118
|
-
/** Recognizes only the official npm entrypoint, not arbitrary configured wrappers. */
|
|
119
|
-
function resolvePackagedCodexNativeCommand(entrypoint) {
|
|
120
|
-
const packageRoot = path.dirname(path.dirname(entrypoint));
|
|
121
|
-
if (path.basename(packageRoot) !== "codex" || path.basename(path.dirname(packageRoot)) !== "@openai" || path.relative(packageRoot, entrypoint) !== path.join("bin", "codex.js")) return;
|
|
122
|
-
return resolveManagedCodexNativeCommand(entrypoint);
|
|
123
|
-
}
|
|
124
|
-
function isManagedCodexDesktopCommand(command, platform = process.platform) {
|
|
125
|
-
return platform === "darwin" && resolveMacOSDesktopCodexAppServerCommandCandidates(platform).includes(command);
|
|
126
|
-
}
|
|
127
|
-
function resolveManagedCodexPackageRootForCommand(command, platform) {
|
|
128
|
-
const pathApi = platform === "win32" ? path.win32 : path.posix;
|
|
129
|
-
const commandPaths = [command];
|
|
130
|
-
try {
|
|
131
|
-
commandPaths.unshift(realpathSync(command));
|
|
132
|
-
} catch {}
|
|
133
|
-
for (const commandPath of commandPaths) {
|
|
134
|
-
let current = pathApi.dirname(commandPath);
|
|
135
|
-
while (true) {
|
|
136
|
-
if (pathApi.basename(current) === "codex" && pathApi.basename(pathApi.dirname(current)) === "@openai") return current;
|
|
137
|
-
if (pathApi.basename(current) === ".bin") return pathApi.join(pathApi.dirname(current), "@openai", "codex");
|
|
138
|
-
const parent = pathApi.dirname(current);
|
|
139
|
-
if (parent === current) break;
|
|
140
|
-
current = parent;
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
function resolvePackageJsonFromRoot(packageName, root) {
|
|
145
|
-
try {
|
|
146
|
-
const manifestPath = realpathSync(path.join(root, "package.json"));
|
|
147
|
-
return createRequire(manifestPath).resolve(`${packageName}/package.json`);
|
|
148
|
-
} catch {
|
|
149
|
-
return;
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
function resolveManagedCodexAppServerCommandCandidates(pluginRoot, platform, managedCommandOrder) {
|
|
153
|
-
const packageCommand = resolveManagedCodexPackageEntrypoint(pluginRoot);
|
|
154
|
-
const packageCommandPaths = packageCommand ? [packageCommand] : [];
|
|
155
|
-
if (managedCommandOrder === "package-only") return packageCommandPaths;
|
|
156
|
-
const desktopCommandPaths = resolveMacOSDesktopCodexAppServerCommandCandidates(platform);
|
|
157
|
-
return managedCommandOrder === "desktop-first" ? [...desktopCommandPaths, ...packageCommandPaths] : [...packageCommandPaths, ...desktopCommandPaths];
|
|
158
|
-
}
|
|
159
|
-
function resolveManagedCodexPackageEntrypoint(pluginRoot) {
|
|
160
|
-
try {
|
|
161
|
-
return createRequire(path.join(pluginRoot, "package.json")).resolve(`${MANAGED_CODEX_APP_SERVER_PACKAGE}/bin/codex.js`);
|
|
162
|
-
} catch {
|
|
163
|
-
return;
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
async function commandPathExists(filePath, platform) {
|
|
167
|
-
try {
|
|
168
|
-
await access(filePath, platform === "win32" ? constants.F_OK : constants.X_OK);
|
|
169
|
-
return true;
|
|
170
|
-
} catch {
|
|
171
|
-
return false;
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
//#endregion
|
|
175
|
-
export { resolvePackagedCodexNativeCommand as a, MIN_SUPPORTED_CODEX_APP_SERVER_VERSION as c, resolveMacOSDesktopCodexBundledMarketplaceCandidates as d, resolveMacOSDesktopCodexComputerUseServiceAppCandidates as f, resolveManagedCodexNativeCommand as i, resolveFirstExistingMacOSDesktopCodexBundledMarketplacePath as l, managed_binary_exports as n, setManagedCodexPluginRoot as o, resolveManagedCodexAppServerStartOptions as r, CODEX_APP_SERVER_VERSION as s, isManagedCodexDesktopCommand as t, resolveMacOSDesktopCodexAppPathCandidates as u };
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { resolveAgentConfig, tryResolveDefaultAgentId } from "openclaw/plugin-sdk/agent-scope-runtime";
|
|
2
|
-
import { normalizeAgentId, parseAgentSessionKey } from "openclaw/plugin-sdk/routing";
|
|
3
|
-
import { getSessionEntry } from "openclaw/plugin-sdk/session-store-runtime";
|
|
4
|
-
import { resolveSandboxRuntimeStatus } from "openclaw/plugin-sdk/sandbox";
|
|
5
|
-
//#region extensions/codex/src/app-server/native-execution-policy.ts
|
|
6
|
-
/** Projects node execution ownership into the runtime tool factory options. */
|
|
7
|
-
function resolveCodexNodeExecToolOverrides(policy) {
|
|
8
|
-
if (policy.effectiveExecHost !== "node") return;
|
|
9
|
-
const node = policy.node?.trim();
|
|
10
|
-
return {
|
|
11
|
-
host: "node",
|
|
12
|
-
...node ? { node } : {}
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
/** Resolves node/gateway/sandbox execution ownership from overrides, session, agent, and config. */
|
|
16
|
-
function resolveCodexNativeExecutionPolicy(params) {
|
|
17
|
-
const config = params.config ?? {};
|
|
18
|
-
const sessionKey = params.sessionKey?.trim() || params.sessionId?.trim() || void 0;
|
|
19
|
-
const agentId = normalizeAgentIdOrDefault(params.agentId) ?? parseAgentIdFromSessionKey(sessionKey) ?? tryResolveDefaultAgentId(config);
|
|
20
|
-
const canReadSessionEntry = agentId && sessionKey && params.readRuntimeSessionEntry && (parseAgentIdFromSessionKey(sessionKey) ?? tryResolveDefaultAgentId(config)) === agentId;
|
|
21
|
-
let sessionEntry = params.sessionEntry ?? void 0;
|
|
22
|
-
if (sessionEntry === void 0 && canReadSessionEntry && sessionKey && agentId) try {
|
|
23
|
-
sessionEntry = getSessionEntry({
|
|
24
|
-
sessionKey,
|
|
25
|
-
agentId,
|
|
26
|
-
hydrateSkillPromptRefs: false
|
|
27
|
-
});
|
|
28
|
-
} catch {
|
|
29
|
-
sessionEntry = void 0;
|
|
30
|
-
}
|
|
31
|
-
const sandboxAgentId = parseAgentSessionKey(sessionKey)?.agentId ?? agentId;
|
|
32
|
-
const sandboxAvailable = params.sandboxAvailable ?? (sessionKey && sandboxAgentId ? resolveSandboxRuntimeStatus({
|
|
33
|
-
cfg: config,
|
|
34
|
-
sessionKey,
|
|
35
|
-
agentId: sandboxAgentId,
|
|
36
|
-
classificationAgentId: sandboxAgentId
|
|
37
|
-
}).sandboxed : false);
|
|
38
|
-
const agentExec = agentId ? resolveAgentConfig(config, agentId)?.tools?.exec : void 0;
|
|
39
|
-
const globalExec = config.tools?.exec;
|
|
40
|
-
const requestedExecHost = normalizeExecTarget(params.execOverrides?.host) ?? normalizeExecTarget(sessionEntry?.execHost) ?? normalizeExecTarget(agentExec?.host) ?? normalizeExecTarget(globalExec?.host) ?? "auto";
|
|
41
|
-
const effectiveExecHost = requestedExecHost === "auto" ? sandboxAvailable ? "sandbox" : "gateway" : requestedExecHost;
|
|
42
|
-
const node = params.execOverrides?.node ?? sessionEntry?.execNode ?? agentExec?.node ?? globalExec?.node;
|
|
43
|
-
return {
|
|
44
|
-
nativeToolSurfaceAllowed: effectiveExecHost !== "node",
|
|
45
|
-
requestedExecHost,
|
|
46
|
-
effectiveExecHost,
|
|
47
|
-
node,
|
|
48
|
-
...effectiveExecHost === "node" ? { blockReason: "OpenClaw exec host=node is active for this session. Codex app-server native execution cannot route shell, filesystem, MCP, or app-backed work through the selected OpenClaw node." } : {}
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
/** Formats the user-facing explanation shown when native tools are blocked by exec host=node. */
|
|
52
|
-
function formatCodexNativeNodeExecBlock(params) {
|
|
53
|
-
return [
|
|
54
|
-
`Codex-native ${params.surface} is unavailable because OpenClaw exec host=node is active for this session.`,
|
|
55
|
-
params.reason ?? "Codex app-server native execution cannot route execution through the selected OpenClaw node.",
|
|
56
|
-
"Use a normal Codex harness turn so OpenClaw exec/process tools run on the node, or switch exec host to gateway for native Codex app-server execution."
|
|
57
|
-
].join(" ");
|
|
58
|
-
}
|
|
59
|
-
function parseAgentIdFromSessionKey(sessionKey) {
|
|
60
|
-
const raw = sessionKey?.trim();
|
|
61
|
-
if (!raw) return;
|
|
62
|
-
const parts = raw.toLowerCase().split(":").filter(Boolean);
|
|
63
|
-
if (parts.length < 3 || parts[0] !== "agent" || !parts[2]) return;
|
|
64
|
-
return normalizeAgentIdOrDefault(parts[1]);
|
|
65
|
-
}
|
|
66
|
-
function normalizeAgentIdOrDefault(value) {
|
|
67
|
-
const normalized = normalizeAgentId(value);
|
|
68
|
-
return normalized === "main" && !(value ?? "").trim() ? void 0 : normalized;
|
|
69
|
-
}
|
|
70
|
-
function normalizeExecTarget(value) {
|
|
71
|
-
const normalized = value?.trim().toLowerCase();
|
|
72
|
-
if (normalized === "auto" || normalized === "sandbox" || normalized === "gateway" || normalized === "node") return normalized;
|
|
73
|
-
}
|
|
74
|
-
//#endregion
|
|
75
|
-
export { resolveCodexNativeExecutionPolicy as n, resolveCodexNodeExecToolOverrides as r, formatCodexNativeNodeExecBlock as t };
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { isRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
2
|
-
//#region extensions/codex/src/app-server/protocol.ts
|
|
3
|
-
/** Namespace Codex keeps directly model-visible without exposing it to Code Mode guests. */
|
|
4
|
-
const CODEX_OPENCLAW_DIRECT_DYNAMIC_TOOL_NAMESPACE = "openclaw_direct";
|
|
5
|
-
function flattenCodexDynamicToolFunctions(tools) {
|
|
6
|
-
return (tools ?? []).flatMap((tool) => tool.type === "namespace" ? tool.tools : [tool]);
|
|
7
|
-
}
|
|
8
|
-
/** Asserts the experimental beforeTurnId request field before it crosses the app-server boundary. */
|
|
9
|
-
function assertCodexThreadForkParams(value) {
|
|
10
|
-
if (!isRecord(value) || typeof value.threadId !== "string" || !value.threadId.trim() || value.beforeTurnId !== void 0 && value.beforeTurnId !== null && typeof value.beforeTurnId !== "string") throw new Error("Invalid Codex app-server thread/fork params");
|
|
11
|
-
return value;
|
|
12
|
-
}
|
|
13
|
-
function isJsonObject(value) {
|
|
14
|
-
return isRecord(value);
|
|
15
|
-
}
|
|
16
|
-
//#endregion
|
|
17
|
-
export { isJsonObject as i, assertCodexThreadForkParams as n, flattenCodexDynamicToolFunctions as r, CODEX_OPENCLAW_DIRECT_DYNAMIC_TOOL_NAMESPACE as t };
|