@openclaw/codex 2026.9.8 → 2026.10.1-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 +8 -0
- package/dist/.setup/{account-usage-runtime-G348lY1q.mjs → account-usage-runtime-C4GFoef_.mjs} +5 -5
- package/dist/.setup/app-server-policy-Bg4FZw1f.mjs +23 -0
- package/dist/.setup/{apply-Cqb-YoCS.mjs → apply-D02fLpgN.mjs} +48 -39
- package/dist/.setup/attempt-client-cleanup-yLjGwbwT.mjs +155 -0
- package/dist/.setup/{attempt-workspace-context-BJ5Z_olH.mjs → attempt-workspace-context-CbSzT6V2.mjs} +11 -15
- package/dist/.setup/{auth-binding-BLWz7stm.mjs → auth-binding-BoMwpuPN.mjs} +17 -25
- package/dist/.setup/{auth-cache-key-Dnps4W4_.mjs → auth-cache-key-CEd9QlIs.mjs} +244 -82
- package/dist/.setup/{auth-profile-B0okYl2D.mjs → auth-profile-CgHQ8Vot.mjs} +2 -1
- package/dist/.setup/{auth-profile-selection-DFu9e167.mjs → auth-profile-selection-hr8ocLtz.mjs} +5 -7
- package/dist/.setup/{binding-connection-DTtN1KrX.mjs → binding-connection-C-08ez1w.mjs} +2 -2
- package/dist/.setup/{binding-connection.runtime-6TpgD1M6.mjs → binding-connection.runtime-Dn2p-fdy.mjs} +3 -3
- package/dist/.setup/{bounded-turn-BNunZPtz.mjs → bounded-turn-DlHlNTyS.mjs} +14 -13
- package/dist/.setup/{bounded-turn-isolation-B8K_ylqk.mjs → bounded-turn-isolation-DklXNk3k.mjs} +4 -4
- package/dist/.setup/{build-state-DIQ5O_-S.mjs → build-state-CIi3Ckqu.mjs} +1 -1
- package/dist/.setup/{capabilities-B3WEZl4e.mjs → capabilities-kQntafj_.mjs} +1 -1
- package/dist/.setup/{client-qyUBJlGZ.mjs → client-CBzEVDyb.mjs} +438 -160
- package/dist/.setup/{client-catalog-response-DRvx_wCC.mjs → client-catalog-response-CmvIiDdj.mjs} +57 -25
- package/dist/.setup/command-authorization-AikPDtcc.mjs +15 -0
- package/dist/.setup/{command-dispatch-Btrs1D6f.mjs → command-dispatch-BE_RdMou.mjs} +3 -3
- package/dist/.setup/{command-formatters-R3ckE3Co.mjs → command-formatters-DV3DHhdr.mjs} +7 -5
- package/dist/.setup/{command-handlers-DvlCHJch.mjs → command-handlers-DNoRq5Ps.mjs} +82 -144
- package/dist/.setup/{command-rpc-skzRq4wD.mjs → command-rpc-B6xsq2dB.mjs} +23 -31
- package/dist/.setup/{compact-8ttks5U5.mjs → compact-BLSAd-ru.mjs} +117 -65
- package/dist/.setup/{plugin-metadata-cache-BRwtRct9.mjs → computer-use-DpolvQHw.mjs} +65 -202
- package/dist/.setup/{config-DKhXquav.mjs → config-0Gxk3_eq.mjs} +5 -6
- package/dist/.setup/{config-options-CzyWLTJt.mjs → config-options-HG_Rr3W_.mjs} +13 -23
- package/dist/.setup/{config-parsing-b088LyhT.mjs → config-parsing-BQq-CHTF.mjs} +41 -4
- package/dist/.setup/{config-runtime-C0NbLms1.mjs → config-runtime-cUYrqu_a.mjs} +2 -2
- package/dist/.setup/{config-security-CE-FcGw9.mjs → config-security-KAPScztc.mjs} +20 -36
- package/dist/.setup/{context-engine-projection-PezSESth.mjs → context-engine-projection-CsgYSQhW.mjs} +11 -14
- package/dist/.setup/{conversation-binding-74LaGGH-.mjs → conversation-binding-CgSSD1Qz.mjs} +36 -48
- package/dist/.setup/{conversation-binding-data-C746z5Pn.mjs → conversation-binding-data-DJ4ix-W5.mjs} +1 -1
- package/dist/.setup/{conversation-control-OrN6zuaY.mjs → conversation-control-tCg763cI.mjs} +19 -21
- package/dist/.setup/{cyber-failover-XV0nNRZu.mjs → cyber-failover-Bb1J6hS1.mjs} +1 -1
- package/dist/.setup/{cyber-failover-notice-RNpGpTyP.mjs → cyber-failover-notice-XR03ef31.mjs} +1 -1
- package/dist/.setup/doctor-start-options-DPW9JxIE.mjs +63 -0
- package/dist/.setup/dynamic-tool-build-CVrx02cH.mjs +463 -0
- package/dist/.setup/{dynamic-tools-Db2sY5cZ.mjs → dynamic-tools-DdsymYGQ.mjs} +238 -878
- package/dist/.setup/{effective-mcp-catalog-Bi6-SQ7i.mjs → effective-mcp-catalog-BysTBZCW.mjs} +83 -11
- package/dist/.setup/{elicitation-input-DPoK8F7w.mjs → elicitation-input-r9axtppm.mjs} +4 -2
- package/dist/.setup/{ephemeral-turn-DiCS1ijR.mjs → ephemeral-turn-oPKxs3ia.mjs} +2 -2
- package/dist/.setup/{event-projector-assistant-message-MV_1dj-3.mjs → event-projector-assistant-message-YCL2wspu.mjs} +2 -2
- package/dist/.setup/{event-projector-values-DJSz8BTk.mjs → event-projector-values-DTqZHizf.mjs} +2 -12
- package/dist/.setup/{inference-dispatch-CMZtjQyz.mjs → inference-dispatch-B5UKEUyC.mjs} +12 -21
- package/dist/.setup/{inference-proxy-DhcXOgUE.mjs → inference-proxy-DUO5E2QQ.mjs} +6 -5
- package/dist/.setup/{isolated-completion-D80IXfQF.mjs → isolated-completion-D5gbKm6k.mjs} +8 -8
- package/dist/.setup/{managed-binary-kiWRhNRE.mjs → managed-binary-C1VFoVPf.mjs} +31 -38
- package/dist/.setup/mcp-app-session-preparation-CdqsXwZX.mjs +223 -0
- package/dist/.setup/mcp-tool-metadata-j10HhfTC.mjs +43 -0
- package/dist/.setup/{model-catalog-DiC0Tkha.mjs → model-catalog-Dj_uvusa.mjs} +7 -7
- package/dist/.setup/{models-DfLmPV0k.mjs → models-Du_i5G_t.mjs} +10 -7
- package/dist/.setup/{native-auth-CuG53tu4.mjs → native-auth-Cjb9y7IZ.mjs} +5 -6
- package/dist/.setup/{native-execution-policy-BxZJy5mP.mjs → native-execution-policy-ClzpdG3D.mjs} +1 -12
- package/dist/.setup/native-mcp-app-DV7VbfzF.mjs +310 -0
- package/dist/.setup/{native-subagent-monitor-BwkQXf9e.mjs → native-subagent-monitor-CCEFO6qK.mjs} +235 -318
- package/dist/.setup/{native-subagent-pending-assignments-DwkCzLvD.mjs → native-subagent-pending-assignments-BDqhOdJp.mjs} +0 -4
- package/dist/.setup/{native-task-assignments-DMQ0g3hu.mjs → native-task-assignments-C6KVqiN1.mjs} +9 -8
- package/dist/.setup/{node-cli-sessions-HC4W6FLI.mjs → node-cli-sessions-B5oNDkUS.mjs} +11 -17
- package/dist/.setup/{node-exec-server.runtime-BgBfWQqo.mjs → node-exec-server.runtime-0xSEjKYt.mjs} +2 -2
- package/dist/.setup/{plan-DPdMk1Oy.mjs → plan-CUHSIOep.mjs} +67 -89
- package/dist/.setup/{plugin-activation-cNHRfaxU.mjs → plugin-activation-BcyBv8PG.mjs} +4 -4
- package/dist/.setup/{plugin-app-cache-key-BL9B5H0L.mjs → plugin-app-cache-key-BW8rd98k.mjs} +11 -15
- package/dist/.setup/plugin-approval-roundtrip-uAR-oQfr.mjs +109 -0
- package/dist/.setup/{plugin-inventory-Cky2XJUw.mjs → plugin-inventory-Bf0_piTw.mjs} +29 -51
- package/dist/.setup/{plugin-marketplace-discovery-D_dV9FXa.mjs → plugin-marketplace-discovery-SQPhSuic.mjs} +2 -16
- package/dist/.setup/plugin-metadata-cache-DWnB7VMj.mjs +84 -0
- package/dist/.setup/plugin-thread-config-deadline-CdRzGJt4.mjs +124 -0
- package/dist/.setup/{provider-D6F_7p1I.mjs → provider-BP8ZaZqn.mjs} +4 -4
- package/dist/.setup/provider-capabilities-Z5ZbBxqP.mjs +50 -0
- package/dist/.setup/{rate-limits-B7-X2TgG.mjs → rate-limits-CMPy24F5.mjs} +1 -5
- package/dist/.setup/{request-BZOfsSXW.mjs → request-BH3FvYUE.mjs} +189 -49
- package/dist/.setup/rpc-error-hmWM21RB.mjs +57 -0
- package/dist/.setup/{run-attempt-dYJhjZrp.mjs → run-attempt-CgvFoW7R.mjs} +553 -727
- package/dist/.setup/{run-attempt-lifecycle-C-6O3Exn.mjs → run-attempt-lifecycle-BuZgVbDA.mjs} +19 -3
- package/dist/.setup/{runtime-artifact-DDQ-HGXf.mjs → runtime-artifact-CUTOOnKw.mjs} +5 -6
- package/dist/.setup/{runtime-artifact-connection-D68qQn1m.mjs → runtime-artifact-connection-CADz3_BY.mjs} +5 -4
- package/dist/.setup/{sandbox-guard-DjCz2eOw.mjs → sandbox-guard-WqE8yPge.mjs} +3 -3
- package/dist/.setup/service-tier-normalization-Cei89SW6.mjs +15 -0
- package/dist/.setup/{session-binding-DGCYAfvD.mjs → session-binding-Ce7BqiPN.mjs} +92 -102
- package/dist/.setup/session-binding-meta-Lkm5Lpf4.mjs +15 -0
- package/dist/.setup/session-binding-record-BZB8RgcF.mjs +179 -0
- package/dist/.setup/session-binding-record-codec-z4ZpDn6E.mjs +216 -0
- package/dist/.setup/{session-binding-sidecars-jo6H8dFr.mjs → session-binding-sidecars-BrdV95Fg.mjs} +8 -2
- package/dist/.setup/{session-catalog-adoption-BU_pHWG7.mjs → session-catalog-adoption-CPIP4S_y.mjs} +34 -18
- package/dist/.setup/{session-catalog-archive-spHfihri.mjs → session-catalog-archive-DcgwvSbF.mjs} +24 -29
- package/dist/.setup/{session-catalog-events-BMCFMZw-.mjs → session-catalog-events-KIXOoSnQ.mjs} +5 -5
- package/dist/.setup/{session-catalog-index-DwJjnF5k.mjs → session-catalog-index-DPICGlxr.mjs} +361 -72
- package/dist/.setup/{session-catalog-index-order-BcQpHks3.mjs → session-catalog-index-order-nhyO0wdW.mjs} +1 -1
- package/dist/.setup/{session-catalog-limits-DDxOsQeC.mjs → session-catalog-limits-DEU36Qlo.mjs} +1 -1
- package/dist/.setup/{session-catalog-index-state-TeO7EyO-.mjs → session-catalog-list-request-tXephOB4.mjs} +180 -6
- package/dist/.setup/{session-catalog-native-projection-CuaFZuQE.mjs → session-catalog-native-projection-CTBd4EUm.mjs} +7 -6
- package/dist/.setup/{session-catalog-node-adoption-DgXvSGu0.mjs → session-catalog-node-adoption-7-WEQTB1.mjs} +12 -2
- package/dist/.setup/{session-catalog-node-continue-DjKXHBbi.mjs → session-catalog-node-continue-DLWBwAAO.mjs} +11 -15
- package/dist/.setup/{session-catalog-node-lookup-CtAXI5W5.mjs → session-catalog-node-lookup-Uufckwcm.mjs} +2 -2
- package/dist/.setup/{session-catalog-parsing-CPGaPYr-.mjs → session-catalog-parsing-B-qWJh2x.mjs} +70 -28
- package/dist/.setup/{session-catalog-projection-CGfzfP93.mjs → session-catalog-projection-CE0_Hffi.mjs} +6 -122
- package/dist/.setup/{session-catalog-provenance-DoAvktcj.mjs → session-catalog-provenance-CmsOE5mh.mjs} +6 -1
- package/dist/.setup/{session-cli-DlmBHYIe.mjs → session-cli-kH4vuGod.mjs} +1 -2
- package/dist/.setup/{session-history-D83lJWHG.mjs → session-history-BogBHKLk.mjs} +1 -1
- package/dist/.setup/{session-history-import-WhX-X33a.mjs → session-history-import-NWKPa4ZO.mjs} +4 -4
- package/dist/.setup/{session-history-read-Ov3StuL4.mjs → session-history-read-CNN8zwbD.mjs} +8 -19
- package/dist/.setup/{session-history.worker-MnPKncqP.mjs → session-history.worker-Cq_4DYgN.mjs} +3 -3
- package/dist/.setup/{session-initialization-6aveB9qb.mjs → session-initialization-D6dtFQkE.mjs} +2 -2
- package/dist/.setup/{session-permission-policy-Ci_fVX6y.mjs → session-permission-policy-BxIUJ0Zd.mjs} +8 -37
- package/dist/.setup/{session-retirement-LlYWBKTJ.mjs → session-retirement-aC60o6P3.mjs} +14 -15
- package/dist/.setup/{settled-turn-context-D4yj4rxf.mjs → settled-turn-context-BZsMjkIO.mjs} +13 -6
- package/dist/.setup/{settled-turn-finalizer-DW9W3gza.mjs → settled-turn-finalizer-CDxCejjC.mjs} +8 -8
- package/dist/.setup/{shared-client-CJCTeFpQ.mjs → shared-client-DJJ3ljH2.mjs} +291 -272
- package/dist/.setup/{provider-capabilities-DG5qbsUZ.mjs → shell-dynamic-tools-Do9lIAT1.mjs} +16 -55
- package/dist/.setup/{side-question-BLeGj7TQ.mjs → side-question-B7T0_GEC.mjs} +99 -91
- package/dist/.setup/{source-CJis_1EF.mjs → source-DH70LqN0.mjs} +24 -40
- package/dist/.setup/{thread-lifecycle-_bAbjedG.mjs → thread-lifecycle-DkcoX9q-.mjs} +262 -305
- package/dist/.setup/{thread-ownership-B6pPt21M.mjs → thread-ownership-0aRHD9iK.mjs} +10 -8
- package/dist/.setup/{thread-policy-gNPzzpVp.mjs → thread-policy-CXZV97TS.mjs} +22 -21
- package/dist/.setup/{thread-requests-OWGOiDaV.mjs → thread-requests-COrRJcZb.mjs} +107 -98
- package/dist/.setup/{thread-resume-GOry0AYh.mjs → thread-resume-rx7J68Rx.mjs} +10 -18
- package/dist/.setup/{transcript-history-projection-DRSifI-1.mjs → transcript-history-projection-B9a7HwUV.mjs} +11 -16
- package/dist/.setup/{transcript-mirror-kxmCYsuF.mjs → transcript-mirror-BfLRARNL.mjs} +64 -67
- package/dist/.setup/{transport-stdio-Bdegpn2V.mjs → transport-stdio-a0HDa2Mj.mjs} +27 -8
- package/dist/.setup/{transport-websocket-BTBE-LD9.mjs → transport-websocket-zqJ0Cmtn.mjs} +3 -8
- package/dist/.setup/{attempt-client-cleanup-B-S7ngS_.mjs → turn-router-CX1-EoCp.mjs} +75 -170
- package/dist/.setup/{upstream-session-fork-gkdRj2yH.mjs → upstream-session-fork-LYlaQnbt.mjs} +35 -46
- package/dist/.setup/{usage-CApUvLOV.mjs → usage-Dmx7B0W2.mjs} +4 -4
- package/dist/.setup/{usage-limit-error-wSMQkbpV.mjs → usage-limit-error-M8jVnITZ.mjs} +4 -4
- package/dist/.setup/{web-search-provider.runtime-UKgeiBUG.mjs → web-search-provider.runtime-CsVmqbFm.mjs} +4 -20
- package/dist/.setup/websocket-data-XlRvt8Ys.mjs +6 -0
- package/dist/.setup/workspace-write-sandbox-probe-DmUHLrrl.mjs +118 -0
- package/dist/api.js +34 -54
- package/dist/catalog-page.worker.js +1 -1
- package/dist/cli-metadata.js +1 -1
- package/dist/doctor-contract-api.js +15 -27
- package/dist/harness.js +37 -22
- package/dist/index.js +2880 -276
- package/dist/media-understanding-provider.js +2 -2
- package/dist/migration-provider-api.js +1 -1
- package/dist/native-session-binding-api.js +2 -0
- package/dist/provider-discovery.js +1 -1
- package/dist/session-history-worker-runtime.js +33 -4
- package/dist/session-history.worker.js +1 -1
- package/openclaw.plugin.json +3 -3
- package/package.json +6 -6
- package/dist/.setup/config-utils-D0CXecki.mjs +0 -57
- package/dist/.setup/incognito-session-DWYapfwf.mjs +0 -2
- package/dist/.setup/managed-thread-store-BMqgThVL.mjs +0 -100
- package/dist/.setup/rpc-error-BlD2vuzn.mjs +0 -31
- package/dist/.setup/session-binding-meta-B7aEMU7g.mjs +0 -6
- package/dist/.setup/session-binding-record-Oe9L-CNY.mjs +0 -375
- package/dist/.setup/session-catalog-BFafIiF6.mjs +0 -2599
- package/dist/.setup/session-catalog-list-request-CvtxrYSe.mjs +0 -170
- package/dist/.setup/shared-client-lifecycle-7xgtlo15.mjs +0 -153
|
@@ -1,11 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { dt as normalizeCodexDynamicToolName } from "./thread-requests-OWGOiDaV.mjs";
|
|
1
|
+
import { ft as normalizeCodexDynamicToolName } from "./thread-requests-COrRJcZb.mjs";
|
|
3
2
|
import { pinExecToolTarget } from "openclaw/plugin-sdk/codex-mcp-projection";
|
|
4
3
|
import { loadNodeExecAvailability } from "openclaw/plugin-sdk/node-selection-runtime";
|
|
5
4
|
//#region extensions/codex/src/app-server/shell-dynamic-tools.ts
|
|
6
5
|
const CODEX_NODE_EXEC_DYNAMIC_TOOL_NAME = "node_exec";
|
|
7
6
|
const CODEX_GATEWAY_EXEC_DYNAMIC_TOOL_NAME = "gateway_exec";
|
|
8
7
|
const CODEX_GATEWAY_PROCESS_DYNAMIC_TOOL_NAME = "gateway_process";
|
|
8
|
+
const CODEX_DISABLED_NATIVE_SHELL_DYNAMIC_TOOLS = /* @__PURE__ */ new Set([
|
|
9
|
+
"exec",
|
|
10
|
+
"process",
|
|
11
|
+
"sandbox_exec",
|
|
12
|
+
"sandbox_process",
|
|
13
|
+
CODEX_GATEWAY_EXEC_DYNAMIC_TOOL_NAME,
|
|
14
|
+
CODEX_GATEWAY_PROCESS_DYNAMIC_TOOL_NAME,
|
|
15
|
+
CODEX_NODE_EXEC_DYNAMIC_TOOL_NAME
|
|
16
|
+
]);
|
|
9
17
|
const PROCESS_FOLLOWUP_TEXT = "Use process (list/poll/log/write/send-keys/submit/paste/kill/clear/remove) for follow-up.";
|
|
10
18
|
function isCodexDynamicToolExcluded(config, names) {
|
|
11
19
|
const normalizedNames = new Set(names.map((name) => normalizeCodexDynamicToolName(name)));
|
|
@@ -67,58 +75,11 @@ function createSandboxProcessProjection(processTool) {
|
|
|
67
75
|
description: "Manage background shell sessions through OpenClaw's configured sandbox backend for this session: list, poll, log, write, send-keys, submit, paste, kill, clear, or remove. Use only for sandbox follow-up; use Codex's native shell session handling only when no OpenClaw sandbox is active and native Code Mode is available."
|
|
68
76
|
};
|
|
69
77
|
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
const
|
|
74
|
-
|
|
75
|
-
return provider === "openai" ? "supported" : "unsupported";
|
|
76
|
-
}
|
|
77
|
-
async function readConfiguredProviderWebSearchSupport(params) {
|
|
78
|
-
if (params.expectedNativeModelProvider) {
|
|
79
|
-
if (((await params.client.request("config/read", { includeLayers: false }, {
|
|
80
|
-
timeoutMs: params.timeoutMs,
|
|
81
|
-
signal: params.signal
|
|
82
|
-
})).config.model_provider ?? "openai") !== params.expectedNativeModelProvider) return "unknown";
|
|
83
|
-
}
|
|
84
|
-
return (await params.client.request("modelProvider/capabilities/read", {}, {
|
|
85
|
-
timeoutMs: params.timeoutMs,
|
|
86
|
-
signal: params.signal
|
|
87
|
-
})).webSearch ? "supported" : "unsupported";
|
|
88
|
-
}
|
|
89
|
-
async function resolveCodexProviderWebSearchSupportForClient(params) {
|
|
90
|
-
const overrideSupport = resolveOverriddenProviderWebSearchSupport(params.modelProviderOverride);
|
|
91
|
-
if (overrideSupport) return overrideSupport;
|
|
92
|
-
try {
|
|
93
|
-
return await readConfiguredProviderWebSearchSupport(params);
|
|
94
|
-
} catch {
|
|
95
|
-
return "unknown";
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
async function resolveCodexProviderWebSearchSupport(params) {
|
|
99
|
-
const overrideSupport = resolveOverriddenProviderWebSearchSupport(params.modelProviderOverride);
|
|
100
|
-
if (overrideSupport) return overrideSupport;
|
|
101
|
-
let client;
|
|
102
|
-
try {
|
|
103
|
-
client = await params.clientFactory({
|
|
104
|
-
startOptions: params.appServer.start,
|
|
105
|
-
...params.preparedAuth ? { preparedAuth: params.preparedAuth } : { authProfileId: params.authProfileId },
|
|
106
|
-
agentDir: params.agentDir,
|
|
107
|
-
config: params.config,
|
|
108
|
-
timeoutMs: params.appServer.requestTimeoutMs
|
|
109
|
-
});
|
|
110
|
-
return await resolveCodexProviderWebSearchSupportForClient({
|
|
111
|
-
client,
|
|
112
|
-
timeoutMs: params.appServer.requestTimeoutMs,
|
|
113
|
-
modelProviderOverride: params.modelProviderOverride,
|
|
114
|
-
expectedNativeModelProvider: params.expectedNativeModelProvider,
|
|
115
|
-
signal: params.signal
|
|
116
|
-
});
|
|
117
|
-
} catch {
|
|
118
|
-
return "unknown";
|
|
119
|
-
} finally {
|
|
120
|
-
if (client) releaseLeasedSharedCodexAppServerClient(client);
|
|
121
|
-
}
|
|
78
|
+
/** Keeps replacement shell tools direct even when model metadata mandates Codex Code Mode. */
|
|
79
|
+
function placeDisabledNativeShellToolsInDirectNamespace(tools, nativeToolSurfaceEnabled) {
|
|
80
|
+
if (nativeToolSurfaceEnabled !== false) return tools;
|
|
81
|
+
for (const tool of tools) if (CODEX_DISABLED_NATIVE_SHELL_DYNAMIC_TOOLS.has(normalizeCodexDynamicToolName(tool.name))) tool.catalogMode = "direct-only";
|
|
82
|
+
return tools;
|
|
122
83
|
}
|
|
123
84
|
//#endregion
|
|
124
|
-
export {
|
|
85
|
+
export { createGatewayProcessProjection as a, createSandboxProcessProjection as c, createGatewayExecProjection as i, isCodexDynamicToolExcluded as l, CODEX_GATEWAY_PROCESS_DYNAMIC_TOOL_NAME as n, createNodeExecAliasDynamicTool as o, CODEX_NODE_EXEC_DYNAMIC_TOOL_NAME as r, createSandboxExecProjection as s, CODEX_GATEWAY_EXEC_DYNAMIC_TOOL_NAME as t, placeDisabledNativeShellToolsInDirectNamespace as u };
|
|
@@ -1,30 +1,32 @@
|
|
|
1
1
|
import { i as isJsonObject } from "./protocol-CANUwXJ3.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import { c as shouldAutoApproveCodexAppServerApprovals,
|
|
4
|
-
import { c as isCodexPairedNodeRemoteExecPlacementSandbox, d as readCodexPluginConfig, l as isCodexRemoteExecPlacementSandbox, u as isCodexSandboxExecServerEnabled } from "./config-parsing-
|
|
5
|
-
import { i as resolveCodexAppServerHomeScope, l as resolveCodexModelBackedReviewerPolicyContext } from "./config-options-
|
|
6
|
-
import { n as formatCodexUsageLimitErrorMessage } from "./rate-limits-
|
|
7
|
-
import { i as resolveCodexBindingAppServerConnection, r as requireCodexSupervisionModelSelection } from "./binding-connection-
|
|
8
|
-
import { n as canUseCodexModelBackedApprovalsReviewerForModel, r as resolveOpenClawExecPolicyForCodexAppServer } from "./config-
|
|
9
|
-
import { X as readRecentCodexRateLimits, b as withLeasedCodexAppServerClientStartSelectionRetry, c as getLeasedSharedCodexAppServerClient, m as releaseCodexAppServerClientLease, tt as resolveCodexAppServerPreparedAuthHandoff } from "./shared-client-
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { t as CodexEphemeralTurn } from "./ephemeral-turn-
|
|
13
|
-
import { Ct as
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import { t as resolveCodexNativeExecutionBlock } from "./sandbox-guard-
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
2
|
+
import { m as sessionBindingIdentity } from "./session-binding-record-BZB8RgcF.mjs";
|
|
3
|
+
import { c as shouldAutoApproveCodexAppServerApprovals, f as readCodexRequirementsToml, l as withMcpElicitationsApprovalPolicy, n as hasCodexMcpToolApprovalOverrides } from "./config-security-KAPScztc.mjs";
|
|
4
|
+
import { c as isCodexPairedNodeRemoteExecPlacementSandbox, d as readCodexPluginConfig, l as isCodexRemoteExecPlacementSandbox, u as isCodexSandboxExecServerEnabled } from "./config-parsing-BQq-CHTF.mjs";
|
|
5
|
+
import { i as resolveCodexAppServerHomeScope, l as resolveCodexModelBackedReviewerPolicyContext } from "./config-options-HG_Rr3W_.mjs";
|
|
6
|
+
import { n as formatCodexUsageLimitErrorMessage } from "./rate-limits-CMPy24F5.mjs";
|
|
7
|
+
import { i as resolveCodexBindingAppServerConnection, r as requireCodexSupervisionModelSelection } from "./binding-connection-C-08ez1w.mjs";
|
|
8
|
+
import { n as canUseCodexModelBackedApprovalsReviewerForModel, r as resolveOpenClawExecPolicyForCodexAppServer } from "./config-0Gxk3_eq.mjs";
|
|
9
|
+
import { X as readRecentCodexRateLimits, b as withLeasedCodexAppServerClientStartSelectionRetry, c as getLeasedSharedCodexAppServerClient, m as releaseCodexAppServerClientLease, tt as resolveCodexAppServerPreparedAuthHandoff } from "./shared-client-DJJ3ljH2.mjs";
|
|
10
|
+
import { N as toCodexDynamicToolProtocolResponse, P as resolveCodexToolAbortTerminalReason, T as handleDynamicToolCallWithTimeout, _ as assertCodexTurnStartResponse, a as isCodexAppServerIndeterminateRequestCancellationError, k as resolveDynamicToolCallTimeoutMs, m as assertCodexThreadForkResponse, r as isCodexAppServerApprovalRequest, w as createCodexElicitationResponse, y as readCodexDynamicToolCallParams } from "./client-CBzEVDyb.mjs";
|
|
11
|
+
import { d as terminateCodexBackgroundTerminals, f as unsubscribeCodexThreadBestEffort, l as retireUnsafeCodexTurnClientBestEffort, s as interruptCodexTurnAndWaitBestEffort } from "./attempt-client-cleanup-yLjGwbwT.mjs";
|
|
12
|
+
import { t as CodexEphemeralTurn } from "./ephemeral-turn-oPKxs3ia.mjs";
|
|
13
|
+
import { Ct as mergeCodexThreadConfigs, N as resolveCodexNativeHookRelayEvents, O as buildCodexNativeHookRelayConfig, P as resolveCodexNativeHookRelayTtlMs, _ as CODEX_NATIVE_PERSONALITY_NONE, b as resolveCodexAppServerThreadModelSelection, k as buildCodexNativeHookRelayDisabledConfig, m as resolveCodexWebSearchPlan, pt as resolveCodexDynamicToolsLoading, r as buildCodexRuntimeThreadConfig, wt as refreshCodexPluginAppApprovalPolicy } from "./thread-requests-COrRJcZb.mjs";
|
|
14
|
+
import { b as resolveCodexAppServerReasoningEffort, o as buildCodexUserInput, r as buildCodexTemporalAdditionalContext, y as readCodexSupportedReasoningEfforts } from "./thread-lifecycle-DkcoX9q-.mjs";
|
|
15
|
+
import { r as resolveCodexSessionBinding } from "./session-binding-Ce7BqiPN.mjs";
|
|
16
|
+
import { i as assertCodexSupervisionThreadLineage, n as CodexThreadPolicyHandoffError, o as refreshCodexThreadPolicy } from "./thread-policy-CXZV97TS.mjs";
|
|
17
|
+
import { t as resolveCodexNativeExecutionBlock } from "./sandbox-guard-WqE8yPge.mjs";
|
|
18
|
+
import { a as resolveCodexExternalSandboxPolicyForOpenClawSandbox, c as shouldEnableCodexAppServerNativeToolSurface, l as shouldRequireCodexSandboxExecServerEnvironment, o as resolveCodexMessageToolProvider, s as resolveCodexSandboxEnvironmentSelection, t as buildDynamicTools } from "./dynamic-tool-build-CVrx02cH.mjs";
|
|
19
|
+
import { i as resolveCodexSessionPermissionCwd, n as applyCodexSessionPermissionPolicy, r as resolveCodexEffectiveSessionPermissionPolicy, t as CODEX_SESSION_PERMISSION_EXEC_MODES } from "./session-permission-policy-BxIUJ0Zd.mjs";
|
|
20
|
+
import { a as emitDynamicToolStartedDiagnostic, c as ensureCodexSandboxExecServerEnvironment, i as emitDynamicToolErrorDiagnostic, l as releaseCodexSandboxExecServerEnvironment, m as CodexNativeToolLifecycleProjector, o as emitDynamicToolTerminalDiagnostic, r as routeCodexAppServerElicitationRequest, s as handleCodexAppServerApprovalRequest, t as createCodexDynamicToolBridge, u as createCodexNativePreToolUseFailureBuffer } from "./dynamic-tools-DdsymYGQ.mjs";
|
|
21
|
+
import { t as resolveCodexAppServerForModelProvider } from "./app-server-policy-Bg4FZw1f.mjs";
|
|
22
|
+
import { n as resolveCodexProviderWebSearchSupportForClient } from "./provider-capabilities-Z5ZbBxqP.mjs";
|
|
21
23
|
import { readStringField } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
22
24
|
import { randomUUID } from "node:crypto";
|
|
23
25
|
import { isDeepStrictEqual } from "node:util";
|
|
24
26
|
import { resolveSessionAgentIdsStrict } from "openclaw/plugin-sdk/agent-scope-runtime";
|
|
25
27
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
26
|
-
import { resolveAgentWorkspaceDir } from "openclaw/plugin-sdk/agent-runtime";
|
|
27
28
|
import { buildAgentHookContextChannelFields, embeddedAgentLog, formatErrorMessage as formatErrorMessage$1, resolveSandboxContext, runAgentCleanupStep } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
29
|
+
import { resolveAgentWorkspaceDir } from "openclaw/plugin-sdk/agent-runtime";
|
|
28
30
|
import { loadExecApprovals } from "openclaw/plugin-sdk/exec-approvals-runtime";
|
|
29
31
|
import { loadCodexBundleMcpApprovalConfig, resolveCodexMcpToolOverridesForAgent } from "openclaw/plugin-sdk/codex-mcp-projection";
|
|
30
32
|
import { registerNativeHookRelayForBundledRuntime } from "openclaw/plugin-sdk/native-hook-relay-runtime";
|
|
@@ -81,6 +83,69 @@ You may perform non-mutating inspection, including reading or searching files an
|
|
|
81
83
|
|
|
82
84
|
Do not modify files, source, git state, permissions, configuration, workspace state, or external state unless the user explicitly requests that mutation in this side conversation. Do not request escalated permissions or broader sandbox access unless the user explicitly requests a mutation that requires it. If the user explicitly requests a mutation, keep it minimal, local to the request, and avoid disrupting the main thread.`;
|
|
83
85
|
//#endregion
|
|
86
|
+
//#region extensions/codex/src/app-server/side-question-run-params.ts
|
|
87
|
+
function buildSideRunAttemptParams(params, options) {
|
|
88
|
+
return {
|
|
89
|
+
params,
|
|
90
|
+
config: params.cfg,
|
|
91
|
+
agentDir: params.agentDir,
|
|
92
|
+
provider: params.provider,
|
|
93
|
+
modelId: params.model,
|
|
94
|
+
model: params.runtimeModel ?? {
|
|
95
|
+
id: params.model,
|
|
96
|
+
provider: params.provider
|
|
97
|
+
},
|
|
98
|
+
prompt: params.question,
|
|
99
|
+
timeoutMs: options.timeoutMs,
|
|
100
|
+
sessionId: params.sessionId,
|
|
101
|
+
sessionFile: params.sessionFile,
|
|
102
|
+
sessionKey: params.sessionKey,
|
|
103
|
+
...params.sandboxSessionKey ? { sandboxSessionKey: params.sandboxSessionKey } : {},
|
|
104
|
+
agentId: params.agentId,
|
|
105
|
+
...params.messageChannel ? { messageChannel: params.messageChannel } : {},
|
|
106
|
+
...params.messageProvider ? { messageProvider: params.messageProvider } : {},
|
|
107
|
+
...params.chatType ? { chatType: params.chatType } : {},
|
|
108
|
+
...params.agentAccountId ? { agentAccountId: params.agentAccountId } : {},
|
|
109
|
+
...params.messageTo ? { messageTo: params.messageTo } : {},
|
|
110
|
+
...params.messageThreadId !== void 0 ? { messageThreadId: params.messageThreadId } : {},
|
|
111
|
+
...params.chatId ? { chatId: params.chatId } : {},
|
|
112
|
+
...params.messageActionTurnCapability ? { messageActionTurnCapability: params.messageActionTurnCapability } : {},
|
|
113
|
+
...params.groupId !== void 0 ? { groupId: params.groupId } : {},
|
|
114
|
+
...params.groupChannel !== void 0 ? { groupChannel: params.groupChannel } : {},
|
|
115
|
+
...params.groupSpace !== void 0 ? { groupSpace: params.groupSpace } : {},
|
|
116
|
+
...params.memberRoleIds ? { memberRoleIds: params.memberRoleIds } : {},
|
|
117
|
+
...params.spawnedBy !== void 0 ? { spawnedBy: params.spawnedBy } : {},
|
|
118
|
+
...params.senderId !== void 0 ? { senderId: params.senderId } : {},
|
|
119
|
+
...params.senderName !== void 0 ? { senderName: params.senderName } : {},
|
|
120
|
+
...params.senderUsername !== void 0 ? { senderUsername: params.senderUsername } : {},
|
|
121
|
+
...params.senderE164 !== void 0 ? { senderE164: params.senderE164 } : {},
|
|
122
|
+
...params.senderIsOwner !== void 0 ? { senderIsOwner: params.senderIsOwner } : {},
|
|
123
|
+
...params.currentChannelId ? { currentChannelId: params.currentChannelId } : {},
|
|
124
|
+
...params.toolsAllow ? { toolsAllow: params.toolsAllow } : {},
|
|
125
|
+
workspaceDir: options.cwd,
|
|
126
|
+
authProfileId: options.authProfileId,
|
|
127
|
+
authProfileIdSource: options.authProfileId ? params.preparedRuntimeAuth.plan.forwardedAuthProfileSource : void 0,
|
|
128
|
+
thinkLevel: params.resolvedThinkLevel ?? "off",
|
|
129
|
+
resolvedReasoningLevel: params.resolvedReasoningLevel,
|
|
130
|
+
authStorage: params.preparedRuntimeAuth.authStorage,
|
|
131
|
+
authProfileStore: params.preparedRuntimeAuth.authProfileStore,
|
|
132
|
+
modelRegistry: params.preparedRuntimeAuth.modelRegistry,
|
|
133
|
+
preparedModelRuntime: params.preparedModelRuntime,
|
|
134
|
+
...params.preparedRuntimeAuth.resolvedApiKey ? { resolvedApiKey: params.preparedRuntimeAuth.resolvedApiKey } : {},
|
|
135
|
+
runId: options.runId,
|
|
136
|
+
abortSignal: params.opts?.abortSignal,
|
|
137
|
+
onAgentEvent: (event) => {
|
|
138
|
+
if (event.stream === "approval") params.opts?.onApprovalEvent?.(event.data);
|
|
139
|
+
},
|
|
140
|
+
onBlockReply: params.opts?.onBlockReply,
|
|
141
|
+
onPartialReply: params.opts?.onPartialReply,
|
|
142
|
+
onToolResult: params.opts?.onToolResult,
|
|
143
|
+
requireExplicitMessageTarget: true,
|
|
144
|
+
hostCapabilities: params.hostCapabilities,
|
|
145
|
+
sandbox: params.sandbox
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
//#endregion
|
|
84
149
|
//#region extensions/codex/src/app-server/side-question.ts
|
|
85
150
|
const SIDE_QUESTION_COMPLETION_TIMEOUT_MS = 6e5;
|
|
86
151
|
var CodexSideQuestionTimeoutError = class extends Error {
|
|
@@ -97,7 +162,7 @@ async function runCodexAppServerSideQuestion(params, options) {
|
|
|
97
162
|
config: params.cfg
|
|
98
163
|
});
|
|
99
164
|
const hostCapabilities = params.hostCapabilities;
|
|
100
|
-
const { binding,
|
|
165
|
+
const { binding, authority } = await resolveCodexSessionBinding({
|
|
101
166
|
bindingStore: options.bindingStore,
|
|
102
167
|
identity: bindingIdentity,
|
|
103
168
|
config: params.cfg,
|
|
@@ -105,6 +170,7 @@ async function runCodexAppServerSideQuestion(params, options) {
|
|
|
105
170
|
assertCurrent: hostCapabilities.assertActive,
|
|
106
171
|
signal: params.opts?.abortSignal
|
|
107
172
|
});
|
|
173
|
+
const assertCurrent = authority.assertCurrent;
|
|
108
174
|
if (!binding?.threadId) throw new Error("Codex /btw needs an active Codex thread. Send a normal message first, then try /btw again.");
|
|
109
175
|
if (isCodexPairedNodeRemoteExecPlacementSandbox(params.sandbox)) throw new Error("Normal Codex turns are supported on nodes, but /btw is not yet bound to the active placement.");
|
|
110
176
|
const pluginConfig = readCodexPluginConfig(options.pluginConfig);
|
|
@@ -256,7 +322,7 @@ async function runCodexAppServerSideQuestion(params, options) {
|
|
|
256
322
|
if (nativeExecutionBlock) throw new Error(nativeExecutionBlock);
|
|
257
323
|
if (!nativeToolSurfaceEnabled) throw new Error("Codex-native /btw side-question mode is unavailable because the effective tool policy restricts Codex native tools for this session.");
|
|
258
324
|
const clientOptions = {
|
|
259
|
-
assertCurrent,
|
|
325
|
+
assertCurrent: authority.assertLegacyCurrent,
|
|
260
326
|
startOptions: appServer.start,
|
|
261
327
|
timeoutMs: appServer.requestTimeoutMs,
|
|
262
328
|
authRequirement: preparedRuntimeAuth.plan.modelRoute?.authRequirement,
|
|
@@ -370,7 +436,7 @@ async function runCodexAppServerSideQuestion(params, options) {
|
|
|
370
436
|
});
|
|
371
437
|
return approvalResult.kind === "handled" ? approvalResult.response : createCodexElicitationResponse("decline", null, { message: "OpenClaw Codex side questions do not support interactive MCP input." });
|
|
372
438
|
}
|
|
373
|
-
if (request.method === "item/tool/requestUserInput") return
|
|
439
|
+
if (request.method === "item/tool/requestUserInput") return isJsonObject(request.params) && request.params.threadId === childThreadId && request.params.turnId === turnId ? { answers: {} } : void 0;
|
|
374
440
|
if (isCodexAppServerApprovalRequest(request.method)) return handleCodexAppServerApprovalRequest({
|
|
375
441
|
method: request.method,
|
|
376
442
|
requestParams: request.params,
|
|
@@ -459,7 +525,7 @@ async function runCodexAppServerSideQuestion(params, options) {
|
|
|
459
525
|
}),
|
|
460
526
|
signal: runAbortController.signal,
|
|
461
527
|
runBeforeToolCall: sideRunParams.hostCapabilities.runBeforeToolCall,
|
|
462
|
-
assertActive:
|
|
528
|
+
assertActive: authority.assertLegacyCurrent,
|
|
463
529
|
onPreToolUseFailure: (failure) => {
|
|
464
530
|
if (!nativePreToolUseFailures.active && nativeToolLifecycleProjector) nativeToolLifecycleProjector.recordPreToolUseFailure(failure, nativeToolRunWasAbortedBeforeCleanup);
|
|
465
531
|
else nativePreToolUseFailures.record(failure);
|
|
@@ -493,6 +559,7 @@ async function runCodexAppServerSideQuestion(params, options) {
|
|
|
493
559
|
const scoped = requestOptions();
|
|
494
560
|
return {
|
|
495
561
|
...scoped,
|
|
562
|
+
withCurrent: authority.withCurrent,
|
|
496
563
|
assertCurrent: () => {
|
|
497
564
|
scoped.assertCurrent();
|
|
498
565
|
assertCurrentBinding();
|
|
@@ -567,6 +634,7 @@ async function runCodexAppServerSideQuestion(params, options) {
|
|
|
567
634
|
threadId: childThreadId,
|
|
568
635
|
developerInstructions: SIDE_DEVELOPER_INSTRUCTIONS,
|
|
569
636
|
...scoped,
|
|
637
|
+
withCurrent: authority.withCurrent,
|
|
570
638
|
signal: runAbortController.signal,
|
|
571
639
|
assertCurrent: () => {
|
|
572
640
|
assertCurrent();
|
|
@@ -579,6 +647,9 @@ async function runCodexAppServerSideQuestion(params, options) {
|
|
|
579
647
|
throw error instanceof CodexThreadPolicyHandoffError ? error : new CodexThreadPolicyHandoffError("not-written", error);
|
|
580
648
|
}
|
|
581
649
|
return response.thread.id;
|
|
650
|
+
}, {
|
|
651
|
+
assertCurrent,
|
|
652
|
+
authority
|
|
582
653
|
}),
|
|
583
654
|
onClientChange: (nextClient) => {
|
|
584
655
|
client = nextClient;
|
|
@@ -615,7 +686,8 @@ async function runCodexAppServerSideQuestion(params, options) {
|
|
|
615
686
|
}, {
|
|
616
687
|
timeoutMs: appServer.requestTimeoutMs,
|
|
617
688
|
signal: runAbortController.signal,
|
|
618
|
-
assertCurrent
|
|
689
|
+
assertCurrent,
|
|
690
|
+
withCurrent: authority.withCurrent
|
|
619
691
|
}).catch((error) => {
|
|
620
692
|
if (isCodexAppServerIndeterminateRequestCancellationError(error)) turnId = "";
|
|
621
693
|
throw error;
|
|
@@ -650,10 +722,10 @@ async function runCodexAppServerSideQuestion(params, options) {
|
|
|
650
722
|
if (result.turn?.status === "interrupted") throw new Error("Codex /btw side thread was interrupted.");
|
|
651
723
|
assertCurrent();
|
|
652
724
|
if (!result.text) throw new Error("Codex /btw completed without an answer.");
|
|
653
|
-
return {
|
|
725
|
+
return await authority.withCurrent(() => ({
|
|
654
726
|
text: result.text,
|
|
655
727
|
usage: result.usage
|
|
656
|
-
};
|
|
728
|
+
}));
|
|
657
729
|
} catch (error) {
|
|
658
730
|
primaryFailure = { error };
|
|
659
731
|
throw error;
|
|
@@ -693,67 +765,6 @@ async function runCodexAppServerSideQuestion(params, options) {
|
|
|
693
765
|
});
|
|
694
766
|
}
|
|
695
767
|
}
|
|
696
|
-
function buildSideRunAttemptParams(params, options) {
|
|
697
|
-
return {
|
|
698
|
-
params,
|
|
699
|
-
config: params.cfg,
|
|
700
|
-
agentDir: params.agentDir,
|
|
701
|
-
provider: params.provider,
|
|
702
|
-
modelId: params.model,
|
|
703
|
-
model: params.runtimeModel ?? {
|
|
704
|
-
id: params.model,
|
|
705
|
-
provider: params.provider
|
|
706
|
-
},
|
|
707
|
-
prompt: params.question,
|
|
708
|
-
timeoutMs: options.timeoutMs,
|
|
709
|
-
sessionId: params.sessionId,
|
|
710
|
-
sessionFile: params.sessionFile,
|
|
711
|
-
sessionKey: params.sessionKey,
|
|
712
|
-
...params.sandboxSessionKey ? { sandboxSessionKey: params.sandboxSessionKey } : {},
|
|
713
|
-
agentId: params.agentId,
|
|
714
|
-
...params.messageChannel ? { messageChannel: params.messageChannel } : {},
|
|
715
|
-
...params.messageProvider ? { messageProvider: params.messageProvider } : {},
|
|
716
|
-
...params.chatType ? { chatType: params.chatType } : {},
|
|
717
|
-
...params.agentAccountId ? { agentAccountId: params.agentAccountId } : {},
|
|
718
|
-
...params.messageTo ? { messageTo: params.messageTo } : {},
|
|
719
|
-
...params.messageThreadId !== void 0 ? { messageThreadId: params.messageThreadId } : {},
|
|
720
|
-
...params.chatId ? { chatId: params.chatId } : {},
|
|
721
|
-
...params.messageActionTurnCapability ? { messageActionTurnCapability: params.messageActionTurnCapability } : {},
|
|
722
|
-
...params.groupId !== void 0 ? { groupId: params.groupId } : {},
|
|
723
|
-
...params.groupChannel !== void 0 ? { groupChannel: params.groupChannel } : {},
|
|
724
|
-
...params.groupSpace !== void 0 ? { groupSpace: params.groupSpace } : {},
|
|
725
|
-
...params.memberRoleIds ? { memberRoleIds: params.memberRoleIds } : {},
|
|
726
|
-
...params.spawnedBy !== void 0 ? { spawnedBy: params.spawnedBy } : {},
|
|
727
|
-
...params.senderId !== void 0 ? { senderId: params.senderId } : {},
|
|
728
|
-
...params.senderName !== void 0 ? { senderName: params.senderName } : {},
|
|
729
|
-
...params.senderUsername !== void 0 ? { senderUsername: params.senderUsername } : {},
|
|
730
|
-
...params.senderE164 !== void 0 ? { senderE164: params.senderE164 } : {},
|
|
731
|
-
...params.senderIsOwner !== void 0 ? { senderIsOwner: params.senderIsOwner } : {},
|
|
732
|
-
...params.currentChannelId ? { currentChannelId: params.currentChannelId } : {},
|
|
733
|
-
...params.toolsAllow ? { toolsAllow: params.toolsAllow } : {},
|
|
734
|
-
workspaceDir: options.cwd,
|
|
735
|
-
authProfileId: options.authProfileId,
|
|
736
|
-
authProfileIdSource: options.authProfileId ? params.preparedRuntimeAuth.plan.forwardedAuthProfileSource : void 0,
|
|
737
|
-
thinkLevel: params.resolvedThinkLevel ?? "off",
|
|
738
|
-
resolvedReasoningLevel: params.resolvedReasoningLevel,
|
|
739
|
-
authStorage: params.preparedRuntimeAuth.authStorage,
|
|
740
|
-
authProfileStore: params.preparedRuntimeAuth.authProfileStore,
|
|
741
|
-
modelRegistry: params.preparedRuntimeAuth.modelRegistry,
|
|
742
|
-
preparedModelRuntime: params.preparedModelRuntime,
|
|
743
|
-
...params.preparedRuntimeAuth.resolvedApiKey ? { resolvedApiKey: params.preparedRuntimeAuth.resolvedApiKey } : {},
|
|
744
|
-
runId: options.runId,
|
|
745
|
-
abortSignal: params.opts?.abortSignal,
|
|
746
|
-
onAgentEvent: (event) => {
|
|
747
|
-
if (event.stream === "approval") params.opts?.onApprovalEvent?.(event.data);
|
|
748
|
-
},
|
|
749
|
-
onBlockReply: params.opts?.onBlockReply,
|
|
750
|
-
onPartialReply: params.opts?.onPartialReply,
|
|
751
|
-
onToolResult: params.opts?.onToolResult,
|
|
752
|
-
requireExplicitMessageTarget: true,
|
|
753
|
-
hostCapabilities: params.hostCapabilities,
|
|
754
|
-
sandbox: params.sandbox
|
|
755
|
-
};
|
|
756
|
-
}
|
|
757
768
|
async function createCodexSideToolBridge(input) {
|
|
758
769
|
const { params } = input;
|
|
759
770
|
const sandboxSessionKey = params.sandboxSessionKey?.trim() || params.sessionKey?.trim() || params.sessionId || input.sessionAgentId;
|
|
@@ -811,9 +822,6 @@ async function createCodexSideToolBridge(input) {
|
|
|
811
822
|
webSearchPlan
|
|
812
823
|
};
|
|
813
824
|
}
|
|
814
|
-
function isSideUserInputRequest(value, threadId, turnId) {
|
|
815
|
-
return isJsonObject(value) && value.threadId === threadId && value.turnId === turnId;
|
|
816
|
-
}
|
|
817
825
|
async function forkCodexSideThread(client, params, options) {
|
|
818
826
|
try {
|
|
819
827
|
return await client.request("thread/fork", params, options);
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
import { a as
|
|
3
|
-
import {
|
|
4
|
-
import "./config-
|
|
5
|
-
import { t as __exportAll } from "./session-binding-sidecars-
|
|
1
|
+
import { a as defaultCodexAppInventoryCache, r as buildCodexPluginAppCacheKey } from "./plugin-app-cache-key-BW8rd98k.mjs";
|
|
2
|
+
import { a as withCodexAppServerJsonClient } from "./request-BH3FvYUE.mjs";
|
|
3
|
+
import { a as pluginReadParams, i as marketplaceRef, l as CODEX_PLUGINS_MARKETPLACE_NAME, n as isOpenAiCuratedMarketplaceName } from "./plugin-inventory-Bf0_piTw.mjs";
|
|
4
|
+
import "./config-0Gxk3_eq.mjs";
|
|
5
|
+
import { t as __exportAll } from "./session-binding-sidecars-BrdV95Fg.mjs";
|
|
6
6
|
import { asNonArrayRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
7
7
|
import path from "node:path";
|
|
8
8
|
import os from "node:os";
|
|
9
9
|
import fs from "node:fs/promises";
|
|
10
|
-
import { coerceErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
10
|
+
import { coerceErrorMessage, extractErrorCode } from "openclaw/plugin-sdk/error-runtime";
|
|
11
11
|
import { isPathInside } from "openclaw/plugin-sdk/file-access-runtime";
|
|
12
12
|
import { pathExists } from "openclaw/plugin-sdk/security-runtime";
|
|
13
13
|
import { tryReadJson } from "@openclaw/fs-safe/json";
|
|
@@ -82,7 +82,7 @@ async function discoverCodexMemoryFile(candidate) {
|
|
|
82
82
|
if (!stat.isFile()) throw new Error(`Codex memory source must be a regular file: ${candidate.path}`);
|
|
83
83
|
return candidate;
|
|
84
84
|
} catch (error) {
|
|
85
|
-
if (error
|
|
85
|
+
if (extractErrorCode(error) === "ENOENT") return;
|
|
86
86
|
throw error;
|
|
87
87
|
}
|
|
88
88
|
}
|
|
@@ -114,9 +114,6 @@ function defaultCodexHome() {
|
|
|
114
114
|
const configuredHome = process.env.CODEX_HOME;
|
|
115
115
|
return resolveHomePath(configuredHome !== void 0 && configuredHome.length > 0 ? configuredHome : "~/.codex");
|
|
116
116
|
}
|
|
117
|
-
function personalAgentsSkillsDir() {
|
|
118
|
-
return path.join(resolveUserHomeDir(), ".agents", "skills");
|
|
119
|
-
}
|
|
120
117
|
async function discoverInstalledCuratedPlugins(codexHome, options = {}) {
|
|
121
118
|
const startOptions = sourceCodexAppServerStartOptions(codexHome);
|
|
122
119
|
try {
|
|
@@ -175,7 +172,7 @@ function sourceCodexAppServerStartOptions(codexHome) {
|
|
|
175
172
|
function discoverInstalledCuratedPluginSources(response) {
|
|
176
173
|
const installedByName = /* @__PURE__ */ new Map();
|
|
177
174
|
for (const marketplace of response.marketplaces) {
|
|
178
|
-
if (!
|
|
175
|
+
if (!isOpenAiCuratedMarketplaceName(marketplace.name)) continue;
|
|
179
176
|
const remote = !marketplace.path;
|
|
180
177
|
for (const summary of marketplace.plugins) {
|
|
181
178
|
if (!summary.installed) continue;
|
|
@@ -194,7 +191,7 @@ function discoverInstalledCuratedPluginSources(response) {
|
|
|
194
191
|
enabled: summary.enabled
|
|
195
192
|
},
|
|
196
193
|
marketplace: marketplaceRef(marketplace, CODEX_PLUGINS_MARKETPLACE_NAME),
|
|
197
|
-
|
|
194
|
+
readPluginName: remote ? summary.remotePluginId?.trim() || void 0 : pluginName,
|
|
198
195
|
remote
|
|
199
196
|
});
|
|
200
197
|
}
|
|
@@ -214,27 +211,34 @@ async function withPluginMigrationEligibility(params) {
|
|
|
214
211
|
});
|
|
215
212
|
continue;
|
|
216
213
|
}
|
|
217
|
-
|
|
218
|
-
|
|
214
|
+
let detail;
|
|
215
|
+
try {
|
|
216
|
+
if (!readPluginName) throw new Error(`Codex remote plugin "${plugin.pluginName ?? plugin.name}" has no readable remote plugin id.`);
|
|
217
|
+
detail = (await params.requestOptions.request({
|
|
218
|
+
method: "plugin/read",
|
|
219
|
+
requestParams: pluginReadParams(marketplace, readPluginName)
|
|
220
|
+
})).plugin;
|
|
221
|
+
} catch (error) {
|
|
222
|
+
const message = coerceErrorMessage(error);
|
|
219
223
|
evaluated.push({
|
|
220
224
|
...plugin,
|
|
221
225
|
migratable: false,
|
|
222
226
|
migrationBlock: {
|
|
223
227
|
code: "plugin_read_unavailable",
|
|
224
|
-
error:
|
|
228
|
+
error: message
|
|
225
229
|
},
|
|
226
|
-
message: `Codex plugin "${plugin.pluginName ?? plugin.name}" detail could not be read: ${
|
|
230
|
+
message: `Codex plugin "${plugin.pluginName ?? plugin.name}" detail could not be read: ${message}`
|
|
227
231
|
});
|
|
228
232
|
continue;
|
|
229
233
|
}
|
|
230
|
-
if (detail.
|
|
234
|
+
if (detail.apps.length === 0) {
|
|
231
235
|
evaluated.push({
|
|
232
236
|
...plugin,
|
|
233
237
|
migratable: true
|
|
234
238
|
});
|
|
235
239
|
continue;
|
|
236
240
|
}
|
|
237
|
-
const apps = detail.
|
|
241
|
+
const apps = detail.apps.map(({ id, name }) => ({
|
|
238
242
|
id,
|
|
239
243
|
name
|
|
240
244
|
})).toSorted((left, right) => left.id.localeCompare(right.id));
|
|
@@ -279,7 +283,7 @@ async function withPluginMigrationEligibility(params) {
|
|
|
279
283
|
const appInfoById = new Map(snapshot.apps.map((app) => [app.id, app]));
|
|
280
284
|
const installedAppsById = new Map(snapshot.installedApps.map((app) => [app.id, app]));
|
|
281
285
|
for (const { plugin, apps: declaredApps } of pending) {
|
|
282
|
-
const apps = declaredApps.map((app) => sourcePluginAppFactWithInventory(app, appInfoById.get(app.id), installedAppsById.get(app.id)))
|
|
286
|
+
const apps = declaredApps.map((app) => sourcePluginAppFactWithInventory(app, appInfoById.get(app.id), installedAppsById.get(app.id)));
|
|
283
287
|
const blockCode = migrationBlockCodeForApps(apps);
|
|
284
288
|
if (!blockCode) {
|
|
285
289
|
evaluated.push({
|
|
@@ -312,26 +316,6 @@ async function readSourceCodexAccount(options) {
|
|
|
312
316
|
default: return "missing";
|
|
313
317
|
}
|
|
314
318
|
}
|
|
315
|
-
async function readPluginDetail(options, marketplace, plugin, readPluginName) {
|
|
316
|
-
if (!readPluginName) return {
|
|
317
|
-
ok: false,
|
|
318
|
-
error: `Codex remote plugin "${plugin.pluginName ?? plugin.name}" has no readable remote plugin id.`
|
|
319
|
-
};
|
|
320
|
-
try {
|
|
321
|
-
return {
|
|
322
|
-
ok: true,
|
|
323
|
-
detail: (await options.request({
|
|
324
|
-
method: "plugin/read",
|
|
325
|
-
requestParams: pluginReadParams(marketplace, readPluginName)
|
|
326
|
-
})).plugin
|
|
327
|
-
};
|
|
328
|
-
} catch (error) {
|
|
329
|
-
return {
|
|
330
|
-
ok: false,
|
|
331
|
-
error: coerceErrorMessage(error)
|
|
332
|
-
};
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
319
|
async function refreshSourceAppInventory(options) {
|
|
336
320
|
const key = buildCodexPluginAppCacheKey({ appServer: { start: options.startOptions } });
|
|
337
321
|
const request = async (method, requestParams) => await options.request({
|
|
@@ -397,7 +381,7 @@ function pluginNameFromSummary(summary) {
|
|
|
397
381
|
async function discoverCodexSource(options = {}) {
|
|
398
382
|
const codexHome = resolveHomePath(options.input?.trim() || defaultCodexHome());
|
|
399
383
|
const codexSkillsDir = path.join(codexHome, "skills");
|
|
400
|
-
const agentsSkillsDir =
|
|
384
|
+
const agentsSkillsDir = path.join(resolveUserHomeDir(), ".agents", "skills");
|
|
401
385
|
const configPath = path.join(codexHome, "config.toml");
|
|
402
386
|
const authPath = path.join(codexHome, "auth.json");
|
|
403
387
|
const modelsCachePath = path.join(codexHome, "models_cache.json");
|