@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
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { resolveAgentConfig, tryResolveDefaultAgentId } from "openclaw/plugin-sdk/agent-scope-runtime";
|
|
2
|
+
import { normalizeAgentId, parseAgentSessionKey } from "openclaw/plugin-sdk/routing";
|
|
3
|
+
import { resolvePreparedSandboxRuntimeStatus } from "openclaw/plugin-sdk/sandbox";
|
|
4
|
+
import { captureSessionEntryCurrentCheckAsync } from "openclaw/plugin-sdk/session-binding-runtime";
|
|
5
|
+
//#region extensions/codex/src/app-server/native-execution-policy.ts
|
|
6
|
+
function resolveRunPolicyParams(params, options) {
|
|
7
|
+
return {
|
|
8
|
+
config: params.config,
|
|
9
|
+
sessionKey: options.runtimeSessionKey?.trim() || params.sandboxSessionKey?.trim() || params.sessionKey?.trim() || params.sessionId,
|
|
10
|
+
sessionId: params.sessionId,
|
|
11
|
+
agentId: options.agentId,
|
|
12
|
+
sessionTarget: params.sessionTarget,
|
|
13
|
+
execOverrides: params.execOverrides,
|
|
14
|
+
sandboxAvailable: options.sandbox === null ? false : options.sandbox?.enabled,
|
|
15
|
+
readRuntimeSessionEntry: true
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
function prepareCodexNativeExecutionPolicyForRun(params, options = {}) {
|
|
19
|
+
return prepareCodexNativeExecutionPolicy(resolveRunPolicyParams(params, options));
|
|
20
|
+
}
|
|
21
|
+
/** Prepare the selected row once; retained checks use its exact execution policy. */
|
|
22
|
+
async function prepareCodexNativeExecutionPolicy(params) {
|
|
23
|
+
const captured = {
|
|
24
|
+
...params,
|
|
25
|
+
execOverrides: params.execOverrides && { ...params.execOverrides },
|
|
26
|
+
sessionTarget: params.sessionTarget && { ...params.sessionTarget }
|
|
27
|
+
};
|
|
28
|
+
const { sourceAgentId, sourceSessionKey, canReadSessionEntry } = resolveSessionSelection(captured);
|
|
29
|
+
if (!canReadSessionEntry || !sourceAgentId || !sourceSessionKey) return {
|
|
30
|
+
policy: resolveCodexNativeExecutionPolicy({
|
|
31
|
+
...captured,
|
|
32
|
+
sessionEntry: captured.sessionEntry ?? null
|
|
33
|
+
}),
|
|
34
|
+
async assertCurrent() {},
|
|
35
|
+
retain: () => () => {},
|
|
36
|
+
release() {}
|
|
37
|
+
};
|
|
38
|
+
const selected = await captureSessionEntryCurrentCheckAsync({
|
|
39
|
+
agentId: sourceAgentId,
|
|
40
|
+
sessionKey: sourceSessionKey,
|
|
41
|
+
storePath: captured.sessionTarget?.storePath ?? captured.storePath,
|
|
42
|
+
fields: [
|
|
43
|
+
"sessionId",
|
|
44
|
+
"lifecycleRevision",
|
|
45
|
+
"execHost",
|
|
46
|
+
"execNode",
|
|
47
|
+
"sandbox",
|
|
48
|
+
"sandboxMode"
|
|
49
|
+
],
|
|
50
|
+
errorMessage: "Codex session execution policy changed; prepare the operation again."
|
|
51
|
+
});
|
|
52
|
+
try {
|
|
53
|
+
let owners = 0;
|
|
54
|
+
const retain = () => {
|
|
55
|
+
owners++;
|
|
56
|
+
let released = false;
|
|
57
|
+
return () => {
|
|
58
|
+
if (released) return;
|
|
59
|
+
released = true;
|
|
60
|
+
if (--owners === 0) selected.release();
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
return {
|
|
64
|
+
policy: resolveCodexNativeExecutionPolicy({
|
|
65
|
+
...captured,
|
|
66
|
+
sessionEntry: selected.entry ?? null,
|
|
67
|
+
readRuntimeSessionEntry: false
|
|
68
|
+
}),
|
|
69
|
+
assertCurrent: selected.assertCurrent,
|
|
70
|
+
source: selected.source,
|
|
71
|
+
retain,
|
|
72
|
+
release: retain()
|
|
73
|
+
};
|
|
74
|
+
} catch (error) {
|
|
75
|
+
selected.release();
|
|
76
|
+
throw error;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
/** Projects node execution ownership into the runtime tool factory options. */
|
|
80
|
+
function resolveCodexNodeExecToolOverrides(policy) {
|
|
81
|
+
if (policy.effectiveExecHost !== "node") return;
|
|
82
|
+
const node = policy.node?.trim();
|
|
83
|
+
return {
|
|
84
|
+
host: "node",
|
|
85
|
+
...node ? { node } : {}
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
/** Resolves node/gateway/sandbox execution ownership from overrides, session, agent, and config. */
|
|
89
|
+
function resolveCodexNativeExecutionPolicy(params) {
|
|
90
|
+
const config = params.config ?? {};
|
|
91
|
+
const { agentId, sessionKey } = resolveSessionSelection(params);
|
|
92
|
+
const sessionEntry = params.sessionEntry;
|
|
93
|
+
const sandboxAgentId = parseAgentSessionKey(sessionKey)?.agentId ?? agentId;
|
|
94
|
+
const sandboxed = params.sandboxAvailable === true || (sessionKey && sandboxAgentId ? resolvePreparedSandboxRuntimeStatus({
|
|
95
|
+
cfg: config,
|
|
96
|
+
sessionKey,
|
|
97
|
+
agentId: sandboxAgentId,
|
|
98
|
+
classificationAgentId: sandboxAgentId,
|
|
99
|
+
preparedSessionEntry: sessionEntry
|
|
100
|
+
}).sandboxed : false);
|
|
101
|
+
const sandboxAvailable = params.sandboxAvailable ?? sandboxed;
|
|
102
|
+
const agentExec = agentId ? resolveAgentConfig(config, agentId)?.tools?.exec : void 0;
|
|
103
|
+
const globalExec = config.tools?.exec;
|
|
104
|
+
const requestedExecHost = normalizeExecTarget(params.execOverrides?.host) ?? normalizeExecTarget(sessionEntry?.execHost) ?? normalizeExecTarget(agentExec?.host) ?? normalizeExecTarget(globalExec?.host) ?? "auto";
|
|
105
|
+
const effectiveExecHost = requestedExecHost === "auto" ? sandboxAvailable ? "sandbox" : "gateway" : requestedExecHost;
|
|
106
|
+
const node = params.execOverrides?.node ?? sessionEntry?.execNode ?? agentExec?.node ?? globalExec?.node;
|
|
107
|
+
return {
|
|
108
|
+
nativeToolSurfaceAllowed: effectiveExecHost !== "node",
|
|
109
|
+
sandboxed,
|
|
110
|
+
requestedExecHost,
|
|
111
|
+
effectiveExecHost,
|
|
112
|
+
node,
|
|
113
|
+
...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." } : {}
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
function resolveSessionSelection(params) {
|
|
117
|
+
const config = params.config ?? {};
|
|
118
|
+
const sessionKey = params.sessionKey?.trim() || params.sessionId?.trim() || void 0;
|
|
119
|
+
const agentId = normalizeAgentIdOrDefault(params.agentId) ?? parseAgentIdFromSessionKey(sessionKey) ?? tryResolveDefaultAgentId(config);
|
|
120
|
+
return {
|
|
121
|
+
sessionKey,
|
|
122
|
+
agentId,
|
|
123
|
+
sourceSessionKey: params.sessionTarget?.sessionKey ?? sessionKey,
|
|
124
|
+
sourceAgentId: params.sessionTarget?.agentId ?? agentId,
|
|
125
|
+
canReadSessionEntry: params.sessionEntry === void 0 && params.readRuntimeSessionEntry && (params.sessionTarget !== void 0 || (parseAgentIdFromSessionKey(sessionKey) ?? tryResolveDefaultAgentId(config)) === agentId)
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
/** Formats the user-facing explanation shown when native tools are blocked by exec host=node. */
|
|
129
|
+
function formatCodexNativeNodeExecBlock(params) {
|
|
130
|
+
return [
|
|
131
|
+
`Codex-native ${params.surface} is unavailable because OpenClaw exec host=node is active for this session.`,
|
|
132
|
+
params.reason ?? "Codex app-server native execution cannot route execution through the selected OpenClaw node.",
|
|
133
|
+
"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."
|
|
134
|
+
].join(" ");
|
|
135
|
+
}
|
|
136
|
+
function parseAgentIdFromSessionKey(sessionKey) {
|
|
137
|
+
const raw = sessionKey?.trim();
|
|
138
|
+
if (!raw) return;
|
|
139
|
+
const parts = raw.toLowerCase().split(":").filter(Boolean);
|
|
140
|
+
if (parts.length < 3 || parts[0] !== "agent" || !parts[2]) return;
|
|
141
|
+
return normalizeAgentIdOrDefault(parts[1]);
|
|
142
|
+
}
|
|
143
|
+
function normalizeAgentIdOrDefault(value) {
|
|
144
|
+
const normalized = normalizeAgentId(value);
|
|
145
|
+
return normalized === "main" && !(value ?? "").trim() ? void 0 : normalized;
|
|
146
|
+
}
|
|
147
|
+
function normalizeExecTarget(value) {
|
|
148
|
+
const normalized = value?.trim().toLowerCase();
|
|
149
|
+
if (normalized === "auto" || normalized === "sandbox" || normalized === "gateway" || normalized === "node") return normalized;
|
|
150
|
+
}
|
|
151
|
+
//#endregion
|
|
152
|
+
export { resolveCodexNodeExecToolOverrides as a, resolveCodexNativeExecutionPolicy as i, prepareCodexNativeExecutionPolicy as n, prepareCodexNativeExecutionPolicyForRun as r, formatCodexNativeNodeExecBlock as t };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { r as isJsonObject } from "./protocol-CaPAVwe9.mjs";
|
|
2
2
|
import { l as fingerprintCodexPolicy } from "./config-security-clxAZYWX.mjs";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { R as normalizeCodexDynamicToolName } from "./thread-requests-
|
|
6
|
-
import { t as codexNativeSubagentMonitorRuntime } from "./native-subagent-monitor-
|
|
3
|
+
import { b as nativeHookRelayUnregisterQueue } from "./shared-client-CE_uY0A1.mjs";
|
|
4
|
+
import { O as resolveCodexToolAbortTerminalReason } from "./client-BS8X7HmG.mjs";
|
|
5
|
+
import { R as normalizeCodexDynamicToolName } from "./thread-requests-BjawdIVV.mjs";
|
|
6
|
+
import { t as codexNativeSubagentMonitorRuntime } from "./native-subagent-monitor-CFE7b4oC.mjs";
|
|
7
7
|
import { createHash } from "node:crypto";
|
|
8
8
|
import { addTimerTimeoutGraceMs, finiteSecondsToTimerSafeMilliseconds } from "openclaw/plugin-sdk/number-runtime";
|
|
9
9
|
import { escapeRegExp } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
@@ -124,7 +124,12 @@ function createCodexNativeHookRemoteCredential(params) {
|
|
|
124
124
|
}, {
|
|
125
125
|
timeoutMs: params.timeoutMs,
|
|
126
126
|
signal: params.signal,
|
|
127
|
-
assertCurrent: params.assertCurrent
|
|
127
|
+
assertCurrent: params.assertCurrent,
|
|
128
|
+
withCurrent: async (write) => {
|
|
129
|
+
await params.assertCurrentAsync?.();
|
|
130
|
+
params.assertCurrent();
|
|
131
|
+
write();
|
|
132
|
+
}
|
|
128
133
|
});
|
|
129
134
|
} catch {
|
|
130
135
|
throw new Error("Could not deliver the native hook relay credential to Codex");
|
|
@@ -180,6 +185,22 @@ const CODEX_HOOK_MATCHER_NAMES_BY_TOOL_ID = {
|
|
|
180
185
|
"exec",
|
|
181
186
|
"exec_command"
|
|
182
187
|
],
|
|
188
|
+
process: ["process", "write_stdin"],
|
|
189
|
+
read: [
|
|
190
|
+
"read",
|
|
191
|
+
"Read",
|
|
192
|
+
"read_file"
|
|
193
|
+
],
|
|
194
|
+
write: ["write", "Write"],
|
|
195
|
+
edit: ["edit", "Edit"],
|
|
196
|
+
ls: ["ls", "list_dir"],
|
|
197
|
+
grep: [
|
|
198
|
+
"grep",
|
|
199
|
+
"Grep",
|
|
200
|
+
"grep_files"
|
|
201
|
+
],
|
|
202
|
+
find: ["find", "Glob"],
|
|
203
|
+
view_image: ["view_image"],
|
|
183
204
|
apply_patch: [
|
|
184
205
|
"apply_patch",
|
|
185
206
|
"Write",
|
|
@@ -241,6 +262,7 @@ function createCodexNativeHookRelay(params) {
|
|
|
241
262
|
pendingDirectChildAdmissions.clear();
|
|
242
263
|
};
|
|
243
264
|
let releaseProcessAdmission;
|
|
265
|
+
let releaseExecutionPolicy;
|
|
244
266
|
let processAdmissionDisposed = false;
|
|
245
267
|
let remoteCredential;
|
|
246
268
|
let remoteCleanup;
|
|
@@ -273,8 +295,12 @@ function createCodexNativeHookRelay(params) {
|
|
|
273
295
|
}),
|
|
274
296
|
signal: params.signal,
|
|
275
297
|
runBeforeToolCall: params.hostCapabilities.runBeforeToolCall,
|
|
276
|
-
executionAdmission: params.nativeProcessAuthority || params.nativeModelAdmission ? {
|
|
277
|
-
toolNames: [
|
|
298
|
+
executionAdmission: params.nativeProcessAuthority || params.nativeModelAdmission || params.hostCapabilities.workspaceReadiness ? {
|
|
299
|
+
toolNames: [
|
|
300
|
+
...params.nativeProcessAuthority ? ["exec"] : [],
|
|
301
|
+
...params.nativeModelAdmission ? modelInputTools : [],
|
|
302
|
+
...params.hostCapabilities.workspaceReadiness?.toolNames ?? []
|
|
303
|
+
],
|
|
278
304
|
admit: async (invocation, assertAdmissionCurrent, preparation) => {
|
|
279
305
|
const payload = invocation.rawPayload;
|
|
280
306
|
const toolName = CODEX_NATIVE_SPAWN_HOOK_NAMES.includes(invocation.toolName ?? "") ? "spawn_agent" : invocation.toolName;
|
|
@@ -309,6 +335,11 @@ function createCodexNativeHookRelay(params) {
|
|
|
309
335
|
assertAdmissionCurrent();
|
|
310
336
|
return;
|
|
311
337
|
}
|
|
338
|
+
if (!params.nativeProcessAuthority || ![
|
|
339
|
+
"Bash",
|
|
340
|
+
"exec",
|
|
341
|
+
"exec_command"
|
|
342
|
+
].includes(invocation.toolName ?? "")) return;
|
|
312
343
|
const rootThreadId = isJsonObject(payload) && typeof payload.session_id === "string" ? payload.session_id.trim() : void 0;
|
|
313
344
|
const childThreadId = readCodexNativeChildThreadId(payload);
|
|
314
345
|
const threadId = childThreadId ?? rootThreadId;
|
|
@@ -325,6 +356,7 @@ function createCodexNativeHookRelay(params) {
|
|
|
325
356
|
params.hostCapabilities.assertActive();
|
|
326
357
|
params.assertCurrent?.();
|
|
327
358
|
},
|
|
359
|
+
assertActiveAsync: params.assertCurrentAsync,
|
|
328
360
|
retention: {
|
|
329
361
|
readClaim: readCodexNativeChildThreadId,
|
|
330
362
|
shouldRetainAfterForegroundClose: () => successfulYieldRetentionAuthorized && directChildClaims.size > 0,
|
|
@@ -361,6 +393,7 @@ function createCodexNativeHookRelay(params) {
|
|
|
361
393
|
rejectPendingAdmissions("native hook relay registration closed");
|
|
362
394
|
processAdmissionDisposed = true;
|
|
363
395
|
releaseProcessAdmission?.();
|
|
396
|
+
releaseExecutionPolicy?.();
|
|
364
397
|
if (remoteCredential) {
|
|
365
398
|
remoteCleanup = remoteCredential.dispose().catch((error) => params.remoteCallback?.onCleanupFailure(toErrorObject(error, "Native hook relay credential cleanup failed")));
|
|
366
399
|
nativeHookRelayUnregisterQueue.track(remoteCleanup);
|
|
@@ -370,10 +403,11 @@ function createCodexNativeHookRelay(params) {
|
|
|
370
403
|
onPreToolUseFailure: params.onPreToolUseFailure,
|
|
371
404
|
command: {
|
|
372
405
|
nice: 10,
|
|
373
|
-
timeoutMs: params.options?.gatewayTimeoutMs
|
|
406
|
+
timeoutMs: params.hostCapabilities.workspaceReadiness ? Math.max(params.options?.gatewayTimeoutMs ?? 0, params.attemptTimeoutMs) : params.options?.gatewayTimeoutMs
|
|
374
407
|
}
|
|
375
408
|
});
|
|
376
409
|
if (!processAdmissionDisposed) try {
|
|
410
|
+
releaseExecutionPolicy = params.retainExecutionPolicy?.();
|
|
377
411
|
releaseProcessAdmission = params.nativeProcessAuthority?.owner.retainAdmission();
|
|
378
412
|
} catch (error) {
|
|
379
413
|
relay.unregister();
|
|
@@ -387,7 +421,8 @@ function createCodexNativeHookRelay(params) {
|
|
|
387
421
|
assertCurrent: () => {
|
|
388
422
|
params.hostCapabilities.assertActive();
|
|
389
423
|
params.assertCurrent?.();
|
|
390
|
-
}
|
|
424
|
+
},
|
|
425
|
+
assertCurrentAsync: params.assertCurrentAsync
|
|
391
426
|
});
|
|
392
427
|
if (processAdmissionDisposed) remoteCredential.dispose();
|
|
393
428
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { n as getCodexAppServerTurnRouter } from "./turn-router-
|
|
4
|
-
import { a as requestPluginApprovalOutcome } from "./plugin-approval-roundtrip-
|
|
1
|
+
import { I as protectCodexAppServerLiveThread, p as retainSharedCodexAppServerClientIfCurrent, t as captureCodexAppServerClientLifetime } from "./shared-client-CE_uY0A1.mjs";
|
|
2
|
+
import { M as getCodexAppServerClientInstanceId } from "./client-BS8X7HmG.mjs";
|
|
3
|
+
import { n as getCodexAppServerTurnRouter } from "./turn-router-Dbw17k3K.mjs";
|
|
4
|
+
import { a as requestPluginApprovalOutcome } from "./plugin-approval-roundtrip-DIZHLbAM.mjs";
|
|
5
5
|
import { i as readCodexMcpToolUiVisibility, n as projectCodexMcpToolMetadata, r as readCodexMcpToolConnectorId, t as projectCodexMcpServerMetadata } from "./mcp-tool-metadata-DW41snf3.mjs";
|
|
6
|
-
import { t as __exportAll } from "./session-binding-sidecars-
|
|
6
|
+
import { t as __exportAll } from "./session-binding-sidecars-BNSS6WL4.mjs";
|
|
7
7
|
import { asOptionalRecord, normalizeLowercaseStringOrEmpty, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
8
8
|
import { z } from "zod";
|
|
9
9
|
import { loadAgentHarnessMcpConfig, prepareHarnessNativeMcpAppPreview } from "openclaw/plugin-sdk/agent-harness-runtime";
|
package/dist/.setup/{native-skill-isolation-DSBeF-Yy.mjs → native-skill-isolation-CMimsKYy.mjs}
RENAMED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { r as isJsonObject } from "./protocol-CaPAVwe9.mjs";
|
|
2
2
|
import { n as resolveCodexAppServerLocalHomeDir } from "./auth-start-options-BPIPeEX8.mjs";
|
|
3
|
-
import { t as buildCodexAppServerConnectionFingerprint } from "./plugin-app-cache-key-
|
|
4
|
-
import {
|
|
5
|
-
import { f as unsubscribeCodexThreadBestEffort, n as CODEX_APP_SERVER_UNSUBSCRIBE_TIMEOUT_MS } from "./attempt-client-cleanup-
|
|
6
|
-
import { b as codexDynamicToolsFingerprint, p as attestCodexRestrictedToolSurfaceMcpServersDisabled } from "./thread-requests-
|
|
3
|
+
import { t as buildCodexAppServerConnectionFingerprint } from "./plugin-app-cache-key-DRb-niJc.mjs";
|
|
4
|
+
import { L as readCodexClientSessionMeta } from "./shared-client-CE_uY0A1.mjs";
|
|
5
|
+
import { f as unsubscribeCodexThreadBestEffort, n as CODEX_APP_SERVER_UNSUBSCRIBE_TIMEOUT_MS } from "./attempt-client-cleanup-6OcbMH46.mjs";
|
|
6
|
+
import { b as codexDynamicToolsFingerprint, p as attestCodexRestrictedToolSurfaceMcpServersDisabled } from "./thread-requests-BjawdIVV.mjs";
|
|
7
7
|
import path from "node:path";
|
|
8
8
|
import os from "node:os";
|
|
9
9
|
import fs from "node:fs/promises";
|
|
@@ -16,7 +16,7 @@ function hasCodexNativeToolCatalog(binding) {
|
|
|
16
16
|
}
|
|
17
17
|
/** Pinned serde omits empty catalogs and false deferLoading; declarations remain native-owned. */
|
|
18
18
|
function parseCodexNativeToolCatalog(metadata, threadId, fingerprint) {
|
|
19
|
-
const fail = () => /* @__PURE__ */ new Error("The
|
|
19
|
+
const fail = () => /* @__PURE__ */ new Error("The saved Codex native tool catalog is missing, corrupt, or changed; the thread is preserved. Reconnect and inspect its native metadata before retrying.");
|
|
20
20
|
if (!isJsonObject(metadata) || metadata.id !== threadId) throw fail();
|
|
21
21
|
const catalog = metadata.dynamic_tools ?? [];
|
|
22
22
|
if (!Array.isArray(catalog) || Buffer.byteLength(JSON.stringify(catalog)) > 1048576) throw fail();
|
|
@@ -65,7 +65,7 @@ async function loadCodexNativeToolCatalog(params) {
|
|
|
65
65
|
assertCurrent();
|
|
66
66
|
const home = resolveCodexAppServerLocalHomeDir(appServer.start, agentDir);
|
|
67
67
|
const actualHome = client.getRuntimeIdentity()?.codexHome;
|
|
68
|
-
if (!hasCodexNativeToolCatalog(binding) || !binding.dynamicToolsFingerprint || appServer.start.transport !== "stdio" && appServer.start.transport !== "unix" || appServer.remoteWorkspaceRoot || !actualHome || path.resolve(actualHome) !== path.resolve(home) || binding.appServerRuntimeFingerprint !== buildCodexAppServerConnectionFingerprint(appServer, agentDir)) throw new Error("
|
|
68
|
+
if (!hasCodexNativeToolCatalog(binding) || !binding.dynamicToolsFingerprint || appServer.start.transport !== "stdio" && appServer.start.transport !== "unix" || appServer.remoteWorkspaceRoot || !actualHome || path.resolve(actualHome) !== path.resolve(home) || binding.appServerRuntimeFingerprint !== buildCodexAppServerConnectionFingerprint(appServer, agentDir)) throw new Error("Saved Codex declarations require the original verified local binding and selected native connection; the thread is preserved.");
|
|
69
69
|
const metadata = await readCodexClientSessionMeta(client, path.join(home, "sessions"), binding.rolloutPath, binding.threadId);
|
|
70
70
|
const consume = () => {
|
|
71
71
|
assertCurrent();
|