@openclaw/codex 2026.10.5-beta.3 → 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.
Files changed (156) hide show
  1. package/README.md +10 -3
  2. package/dist/.setup/{account-usage-runtime-CBR8imwK.mjs → account-usage-runtime-DDCDkvtl.mjs} +15 -9
  3. package/dist/.setup/{app-server-policy-D_zv8J7V.mjs → app-server-policy-Cog6mm2i.mjs} +1 -1
  4. package/dist/.setup/{apply-CfWD3Bk6.mjs → apply-BVSXYkTV.mjs} +11 -11
  5. package/dist/.setup/{attempt-client-cleanup-D3YvP0N7.mjs → attempt-client-cleanup-6OcbMH46.mjs} +14 -8
  6. package/dist/.setup/attempt-terminal-sZutF0WY.mjs +1 -0
  7. package/dist/.setup/{attempt-workspace-context-CcwP3DA3.mjs → attempt-workspace-context-GYPLawX6.mjs} +2 -2
  8. package/dist/.setup/{auth-binding-BaxlhaNx.mjs → auth-binding-830RLAJW.mjs} +2 -2
  9. package/dist/.setup/{auth-cache-key-BzYrcgwJ.mjs → auth-cache-key-CVcYw8HD.mjs} +92 -80
  10. package/dist/.setup/{auth-profile-CgHQ8Vot.mjs → auth-profile-auwzSwwy.mjs} +14 -8
  11. package/dist/.setup/{auth-profile-health-oHizqgye.mjs → auth-profile-health-BVPZU9I8.mjs} +15 -8
  12. package/dist/.setup/{auth-profile-selection-hr8ocLtz.mjs → auth-profile-selection-Bp5PDk3W.mjs} +24 -7
  13. package/dist/.setup/{binding-connection-B7HAAZSI.mjs → binding-connection-GTgUj9pi.mjs} +2 -2
  14. package/dist/.setup/{binding-connection.runtime-DAXn7iFl.mjs → binding-connection.runtime-RcWR3vQu.mjs} +4 -3
  15. package/dist/.setup/{bounded-turn-isolation-BfDAo-qZ.mjs → bounded-turn-isolation-D8CDrAVX.mjs} +3 -3
  16. package/dist/.setup/{bounded-turn-BmChqNaK.mjs → bounded-turn-mN_ekXYW.mjs} +18 -22
  17. package/dist/.setup/{build-state-sjOWPg_o.mjs → build-state-VcujMRqP.mjs} +1 -1
  18. package/dist/.setup/{capabilities-DbOzOglY.mjs → capabilities-DAS-JX1z.mjs} +1 -1
  19. package/dist/.setup/{client-aPKNc4Ii.mjs → client-BS8X7HmG.mjs} +47 -317
  20. package/dist/.setup/{client-catalog-response-Du2GmrOV.mjs → client-catalog-response-jM38o5w1.mjs} +2 -2
  21. package/dist/.setup/client-initialize-CjgZcX61.mjs +165 -0
  22. package/dist/.setup/{command-dispatch-CF6mgl3u.mjs → command-dispatch-DzXbHqCn.mjs} +3 -3
  23. package/dist/.setup/{command-formatters-xW9KpoSZ.mjs → command-formatters-B_7-QZ1c.mjs} +2 -2
  24. package/dist/.setup/{command-handlers-DlycReQg.mjs → command-handlers-tfb5Uq-O.mjs} +539 -406
  25. package/dist/.setup/command-rpc-SXqLQukR.mjs +296 -0
  26. package/dist/.setup/compact-M-JxLcbZ.mjs +823 -0
  27. package/dist/.setup/{computer-use-C6yYfm6-.mjs → computer-use-FqQ-Flbl.mjs} +21 -68
  28. package/dist/.setup/{config-C1YVVLEA.mjs → config-BfrAlTMT.mjs} +3 -3
  29. package/dist/.setup/{config-options-DDzeNQ8m.mjs → config-options-DMFZkd3X.mjs} +1 -1
  30. package/dist/.setup/{config-runtime-DWzK-k0n.mjs → config-runtime-BZRizyuG.mjs} +2 -2
  31. package/dist/.setup/{context-engine-projection-ps-yn_ci.mjs → context-engine-projection-PIeLSnR-.mjs} +16 -30
  32. package/dist/.setup/{conversation-binding-CP_mK17t.mjs → conversation-binding-C7MZy-Cx.mjs} +228 -116
  33. package/dist/.setup/{conversation-binding-data-UgLuTSQT.mjs → conversation-binding-data-khgW0n-o.mjs} +4 -2
  34. package/dist/.setup/{conversation-control-GXM3unE4.mjs → conversation-control-B2EpVZEb.mjs} +53 -23
  35. package/dist/.setup/{cyber-failover-D4dgNfFf.mjs → cyber-failover-CqEZoQsj.mjs} +1 -1
  36. package/dist/.setup/{cyber-failover-notice-ljgGGL0s.mjs → cyber-failover-notice-poL3Advd.mjs} +1 -1
  37. package/dist/.setup/{doctor-start-options-JjTAl-q_.mjs → doctor-start-options-8uIBXIzR.mjs} +8 -5
  38. package/dist/.setup/{dynamic-tool-build-DKko0Jjw.mjs → dynamic-tool-build-BjFAIG-f.mjs} +208 -218
  39. package/dist/.setup/{dynamic-tools-8hqa1jVc.mjs → dynamic-tools-XqWsVjcC.mjs} +344 -118
  40. package/dist/.setup/{effective-mcp-catalog-uIZ4w7Nh.mjs → effective-mcp-catalog-C3ta5hHc.mjs} +11 -9
  41. package/dist/.setup/{ephemeral-turn-DAlEbytF.mjs → ephemeral-turn-1ZF17fUR.mjs} +5 -4
  42. package/dist/.setup/{event-projector-assistant-message-CLMKN4x-.mjs → event-projector-assistant-message-ChOAY7rW.mjs} +16 -11
  43. package/dist/.setup/{event-projector-usage-BpKfdoTm.mjs → event-projector-usage-CBY0Hkga.mjs} +2 -2
  44. package/dist/.setup/{event-projector-values-CLvG1Hil.mjs → event-projector-values-yf4us9Pf.mjs} +1 -1
  45. package/dist/.setup/experimental-features-uGnVDtp-.mjs +19 -0
  46. package/dist/.setup/inference-context-mv_dBpAL.mjs +209 -0
  47. package/dist/.setup/{inference-dispatch-CO6tTs4q.mjs → inference-dispatch-C2zVSnrr.mjs} +2 -2
  48. package/dist/.setup/{inference-metadata-DCvcG_N_.mjs → inference-metadata-CYFWLHVk.mjs} +3 -1
  49. package/dist/.setup/{inference-proxy-BDWV0djM.mjs → inference-proxy-yd3hr2dr.mjs} +8 -8
  50. package/dist/.setup/installed-probe-lVC1X5ve.mjs +185 -0
  51. package/dist/.setup/{isolated-completion-BWEjVHBf.mjs → isolated-completion-P-r8NRE4.mjs} +7 -7
  52. package/dist/.setup/managed-binary-DbKvGXKl.mjs +395 -0
  53. package/dist/.setup/{mcp-app-session-preparation-CJR8ib5s.mjs → mcp-app-session-preparation-fnsnCovu.mjs} +18 -14
  54. package/dist/.setup/{model-catalog-Ben3FsFp.mjs → model-catalog-Y_esgRPY.mjs} +28 -17
  55. package/dist/.setup/{models-BB0l-gUb.mjs → models-BWLEUo2E.mjs} +3 -3
  56. package/dist/.setup/{native-auth-esN5MdIv.mjs → native-auth-DpZIaY8N.mjs} +7 -4
  57. package/dist/.setup/native-execution-policy-D09tLP-u.mjs +152 -0
  58. package/dist/.setup/{native-hook-relay-DQzvuJ-W.mjs → native-hook-relay-C7aaLJaP.mjs} +45 -10
  59. package/dist/.setup/{native-mcp-app-UkwXOBfS.mjs → native-mcp-app-CsWj-v_x.mjs} +5 -5
  60. package/dist/.setup/{native-skill-isolation-DoRxgQPX.mjs → native-skill-isolation-CMimsKYy.mjs} +7 -7
  61. package/dist/.setup/{native-subagent-monitor-DC4clzAD.mjs → native-subagent-monitor-CFE7b4oC.mjs} +485 -239
  62. package/dist/.setup/{native-subagent-pending-assignments-DmVhedNs.mjs → native-subagent-pending-assignments-CTinVtjo.mjs} +1 -1
  63. package/dist/.setup/{native-task-assignments-DimsQ9Qa.mjs → native-task-assignments-YJopbaVO.mjs} +9 -5
  64. package/dist/.setup/{node-cli-sessions-CzKg2nGq.mjs → node-cli-sessions-BuJnBnEq.mjs} +7 -4
  65. package/dist/.setup/{node-exec-server.runtime-BWkULhBM.mjs → node-exec-server.runtime-CP7RC1Nd.mjs} +3 -3
  66. package/dist/.setup/{plan-DFVngccH.mjs → plan-B4cHgqNv.mjs} +7 -20
  67. package/dist/.setup/{plugin-activation-D7WkJMvU.mjs → plugin-activation-CXPWe-hl.mjs} +4 -4
  68. package/dist/.setup/{plugin-app-cache-key-Bg9DbDI6.mjs → plugin-app-cache-key-DRb-niJc.mjs} +17 -55
  69. package/dist/.setup/{plugin-approval-roundtrip-68FoMlaZ.mjs → plugin-approval-roundtrip-DIZHLbAM.mjs} +1 -1
  70. package/dist/.setup/{plugin-inventory-CYgdo14P.mjs → plugin-inventory-DE9wcaeH.mjs} +2 -2
  71. package/dist/.setup/{plugin-metadata-cache-Bi8TAPwX.mjs → plugin-metadata-cache-BqC-a6Fb.mjs} +2 -15
  72. package/dist/.setup/{project-doc-thread-config-BVcvnps8.mjs → project-doc-thread-config-B0UI3f1D.mjs} +6 -6
  73. package/dist/.setup/protocol-CaPAVwe9.mjs +12 -0
  74. package/dist/.setup/{provider-capabilities-DWH29sy3.mjs → provider-capabilities-DjcKunHS.mjs} +1 -1
  75. package/dist/.setup/{provider-BCXRBKEb.mjs → provider-wj_LFJH3.mjs} +4 -4
  76. package/dist/.setup/{rate-limits-CI8pTPqL.mjs → rate-limits-BpfURnuy.mjs} +1 -1
  77. package/dist/.setup/{request-DInueZ2q.mjs → request-ePeNJrOd.mjs} +132 -136
  78. package/dist/.setup/{responses-oauth-twnuTaAa.mjs → responses-oauth-CCV7aVYF.mjs} +6 -6
  79. package/dist/.setup/{rpc-error-C98SHchT.mjs → rpc-error-DemqqaxE.mjs} +7 -3
  80. package/dist/.setup/{run-attempt-BN-0TO0P.mjs → run-attempt-BcWArowv.mjs} +595 -426
  81. package/dist/.setup/{run-attempt-lifecycle-KN4oh-7O.mjs → run-attempt-lifecycle-DN-ATDp9.mjs} +1 -1
  82. package/dist/.setup/{runtime-artifact-C13pR7tD.mjs → runtime-artifact-CmLWeyJB.mjs} +3 -3
  83. package/dist/.setup/{runtime-artifact-connection-jS5DeCok.mjs → runtime-artifact-connection-DpWlZ02e.mjs} +3 -3
  84. package/dist/.setup/{sandbox-guard-DIImwCy1.mjs → sandbox-guard-DneAfNye.mjs} +70 -30
  85. package/dist/.setup/{session-binding-JEHNMPsr.mjs → session-binding-BgsWcbdY.mjs} +25 -23
  86. package/dist/.setup/{session-binding-record-DU_0biMD.mjs → session-binding-record-C_THntMe.mjs} +27 -12
  87. package/dist/.setup/{session-binding-record-codec-BpH8u_G9.mjs → session-binding-record-codec-DvmOI7g_.mjs} +1 -0
  88. package/dist/.setup/{session-binding-sidecars-DD-enC8w.mjs → session-binding-sidecars-BNSS6WL4.mjs} +55 -63
  89. package/dist/.setup/session-cancellation-DLBSJO5n.mjs +43 -0
  90. package/dist/.setup/{session-catalog-adoption-Ca3OYGYM.mjs → session-catalog-adoption-ppsLlVLB.mjs} +24 -38
  91. package/dist/.setup/{session-catalog-archive-Bv6gV7x9.mjs → session-catalog-archive-CqLRHJ6z.mjs} +11 -13
  92. package/dist/.setup/{session-catalog-events-DujfzcAY.mjs → session-catalog-events-DK0opVp3.mjs} +5 -5
  93. package/dist/.setup/{session-catalog-index-DQ9_sj42.mjs → session-catalog-index-BfzfdtH7.mjs} +96 -271
  94. package/dist/.setup/{session-catalog-index-order-CTfoefow.mjs → session-catalog-index-order-0Zqng2u8.mjs} +1 -1
  95. package/dist/.setup/{session-catalog-limits-BynIoOYm.mjs → session-catalog-limits-Dc6E0BZz.mjs} +1 -1
  96. package/dist/.setup/{session-catalog-list-request-D4MYNgDB.mjs → session-catalog-list-request-CAjoWjaH.mjs} +3 -4
  97. package/dist/.setup/{session-catalog-native-projection-BY2zMkMO.mjs → session-catalog-native-projection-G3lSDYYG.mjs} +5 -5
  98. package/dist/.setup/{session-catalog-node-adoption-BdP9Zjqo.mjs → session-catalog-node-adoption-e9v8mGgx.mjs} +5 -5
  99. package/dist/.setup/{session-catalog-node-continue-CNJibO4_.mjs → session-catalog-node-continue-H7nrzcUD.mjs} +5 -5
  100. package/dist/.setup/{session-catalog-node-lookup-BH_DBGa9.mjs → session-catalog-node-lookup-BrZfDkA8.mjs} +2 -2
  101. package/dist/.setup/{session-catalog-parsing-DkeoVn60.mjs → session-catalog-parsing-V6jyFg9g.mjs} +2 -2
  102. package/dist/.setup/{session-catalog-projection-BTXOyzl_.mjs → session-catalog-projection-BjWE414G.mjs} +8 -7
  103. package/dist/.setup/{session-catalog-provenance-CmsOE5mh.mjs → session-catalog-provenance-Dg9s12z-.mjs} +50 -30
  104. package/dist/.setup/{session-catalog-source-yQpy2Y6b.mjs → session-catalog-source-DqyuNxCe.mjs} +2 -6
  105. package/dist/.setup/{session-cli-GwU0izn-.mjs → session-cli-CBGKiqdv.mjs} +1 -1
  106. package/dist/.setup/{session-history-BO6i_pfk.mjs → session-history-7W0cgTXF.mjs} +11 -9
  107. package/dist/.setup/{session-history-import-CaO8s6ta.mjs → session-history-import-BwPKwcNi.mjs} +4 -4
  108. package/dist/.setup/{session-initialization-Bi_2DKhc.mjs → session-initialization-Dn3vveGv.mjs} +2 -2
  109. package/dist/.setup/{session-retirement-CIDqLMII.mjs → session-retirement-Ci_JvOfH.mjs} +8 -8
  110. package/dist/.setup/{session-history.worker-DJQfek5p.mjs → settled-turn-evidence--tRW6fSm.mjs} +2 -18
  111. package/dist/.setup/{settled-turn-finalizer-C6tjH8RJ.mjs → settled-turn-finalizer-D3-KXsbP.mjs} +8 -8
  112. package/dist/.setup/{shared-client-CCz9ldpr.mjs → shared-client-CE_uY0A1.mjs} +380 -557
  113. package/dist/.setup/side-question-OM18H9WJ.mjs +998 -0
  114. package/dist/.setup/{source-DsubBCYm.mjs → source-uGKgKWm8.mjs} +5 -5
  115. package/dist/.setup/{thread-archive-guard-LKdwQKyr.mjs → thread-archive-guard-BWjSsA92.mjs} +1 -1
  116. package/dist/.setup/{thread-lifecycle-run-CxVfnkG-.mjs → thread-lifecycle-run-mLueY6pH.mjs} +172 -75
  117. package/dist/.setup/{thread-model-selection-DcVebr8N.mjs → thread-model-selection-DxposL4X.mjs} +9 -9
  118. package/dist/.setup/{thread-ownership-_2e1sjfi.mjs → thread-ownership-t6Y9fLQS.mjs} +7 -7
  119. package/dist/.setup/{thread-policy-CLTwg3ZA.mjs → thread-policy-Cy301Or8.mjs} +6 -6
  120. package/dist/.setup/{thread-requests-BgzJwJtS.mjs → thread-requests-BjawdIVV.mjs} +14 -14
  121. package/dist/.setup/{thread-resume-C6qsk8_o.mjs → thread-resume-BUbsUfgF.mjs} +6 -6
  122. package/dist/.setup/{transcript-history-projection-DfKcoZCB.mjs → transcript-history-projection-i-FVpyha.mjs} +1 -1
  123. package/dist/.setup/{transcript-mirror-Bee2o6jj.mjs → transcript-mirror-CEQJZlF3.mjs} +6 -9
  124. package/dist/.setup/{transport-stdio-CRWTkKOn.mjs → transport-stdio-Bq160Dhv.mjs} +63 -64
  125. package/dist/.setup/{transport-websocket-DIyPfkHo.mjs → transport-websocket-0YqiI_MH.mjs} +1 -1
  126. package/dist/.setup/{turn-router-CSJl3yYQ.mjs → turn-router-Dbw17k3K.mjs} +2 -2
  127. package/dist/.setup/{upstream-session-fork-BC45E4Pe.mjs → upstream-session-fork-_LYkh0nZ.mjs} +46 -219
  128. package/dist/.setup/{usage-limit-error-CJoJ_F8V.mjs → usage-limit-error-DcOSH3J4.mjs} +4 -4
  129. package/dist/.setup/{usage-1eNaNDM2.mjs → usage-w_93wnnR.mjs} +4 -4
  130. package/dist/.setup/{web-search-item-CvokaZOo.mjs → web-search-item-DHVuNSqk.mjs} +1 -1
  131. package/dist/.setup/{web-search-provider.runtime-Qq_wUrvv.mjs → web-search-provider.runtime-DMHxve5v.mjs} +3 -3
  132. package/dist/.setup/{workspace-write-sandbox-probe-BDWO2Qkh.mjs → workspace-write-sandbox-probe-DJxOXcF3.mjs} +2 -2
  133. package/dist/api.js +7 -28
  134. package/dist/catalog-page.worker.js +1 -1
  135. package/dist/cli-metadata.js +1 -1
  136. package/dist/client-version-api.js +25 -0
  137. package/dist/doctor-contract-api.js +5 -5
  138. package/dist/harness.js +59 -36
  139. package/dist/index.js +259 -295
  140. package/dist/media-understanding-provider.js +2 -2
  141. package/dist/migration-provider-api.js +1 -2
  142. package/dist/native-session-binding-api.js +1 -2
  143. package/dist/provider-discovery.js +1 -1
  144. package/dist/session-history-worker-entrypoint.js +12 -0
  145. package/dist/session-history-worker-runtime.js +7 -18
  146. package/dist/session-history.worker.js +18 -2
  147. package/openclaw.plugin.json +1 -1
  148. package/package.json +6 -6
  149. package/dist/.setup/attempt-terminal-jO5IMj9K.mjs +0 -2
  150. package/dist/.setup/command-rpc-CUy4Bo-0.mjs +0 -247
  151. package/dist/.setup/compact-BCCjM_cb.mjs +0 -808
  152. package/dist/.setup/inference-context-DNlGwzwy.mjs +0 -91
  153. package/dist/.setup/managed-binary-BtIjV7yN.mjs +0 -175
  154. package/dist/.setup/native-execution-policy-MXEe7PB3.mjs +0 -75
  155. package/dist/.setup/protocol-CANUwXJ3.mjs +0 -17
  156. package/dist/.setup/side-question-COaYBoON.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 };