@openclaw/codex 2026.10.1 → 2026.10.5-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/dist/.setup/{account-usage-runtime-B7Vg4rmy.mjs → account-usage-runtime-QBZsvZS8.mjs} +8 -7
- package/dist/.setup/{app-server-policy-Bg4FZw1f.mjs → app-server-policy-D_zv8J7V.mjs} +3 -4
- package/dist/.setup/{apply-BzlIkqSz.mjs → apply-CBMV8LN0.mjs} +40 -51
- package/dist/.setup/{attempt-client-cleanup-HXQxfMc1.mjs → attempt-client-cleanup-t-kd_1ys.mjs} +6 -6
- package/dist/.setup/attempt-terminal-jO5IMj9K.mjs +2 -0
- package/dist/.setup/{attempt-workspace-context-BmCutoyg.mjs → attempt-workspace-context-CcwP3DA3.mjs} +21 -18
- package/dist/.setup/{auth-binding-BoMwpuPN.mjs → auth-binding-BaxlhaNx.mjs} +2 -2
- package/dist/.setup/{auth-cache-key-BCCQHWdc.mjs → auth-cache-key-DyfUvsSa.mjs} +30 -41
- package/dist/.setup/{binding-connection-C-08ez1w.mjs → binding-connection-B7HAAZSI.mjs} +2 -2
- package/dist/.setup/{binding-connection.runtime-Dn2p-fdy.mjs → binding-connection.runtime-DAXn7iFl.mjs} +6 -5
- package/dist/.setup/{bounded-turn-Cv4uIEzz.mjs → bounded-turn-CyQVQwGe.mjs} +21 -17
- package/dist/.setup/{bounded-turn-isolation-DklXNk3k.mjs → bounded-turn-isolation-BfDAo-qZ.mjs} +4 -4
- package/dist/.setup/{build-state-BwxNfFEB.mjs → build-state-CzLMy1S9.mjs} +1 -1
- package/dist/.setup/{capabilities-kQntafj_.mjs → capabilities-DbOzOglY.mjs} +1 -1
- package/dist/.setup/{client-catalog-response-BNFDYAKh.mjs → client-catalog-response-DsbEAtpd.mjs} +25 -32
- package/dist/.setup/{client-BIRVBXXb.mjs → client-y7nO6X9c.mjs} +198 -247
- package/dist/.setup/{command-dispatch-D3_ypl-R.mjs → command-dispatch-uA9lz2Kf.mjs} +3 -4
- package/dist/.setup/{command-formatters-DV3DHhdr.mjs → command-formatters-xW9KpoSZ.mjs} +16 -26
- package/dist/.setup/{command-handlers-KPit4G0p.mjs → command-handlers-VBaJnpZo.mjs} +270 -360
- package/dist/.setup/{command-rpc-CmQDOxY9.mjs → command-rpc-C9VxOLuG.mjs} +19 -18
- package/dist/.setup/{compact-CLLteFIY.mjs → compact-CD8xJxXS.mjs} +41 -61
- package/dist/.setup/{computer-use-BVxocZZc.mjs → computer-use-CiToXF5C.mjs} +109 -147
- package/dist/.setup/{config-0Gxk3_eq.mjs → config-C1YVVLEA.mjs} +32 -59
- package/dist/.setup/config-contracts.shared-D85SGEuq.mjs +4 -0
- package/dist/.setup/{config-options-HG_Rr3W_.mjs → config-options-DDzeNQ8m.mjs} +52 -90
- package/dist/.setup/{config-parsing-BQq-CHTF.mjs → config-parsing-DsWSCPHO.mjs} +19 -55
- package/dist/.setup/{config-runtime-cUYrqu_a.mjs → config-runtime-DWzK-k0n.mjs} +2 -2
- package/dist/.setup/{config-security-KAPScztc.mjs → config-security-clxAZYWX.mjs} +35 -39
- package/dist/.setup/config-utils-DN_YT7dE.mjs +47 -0
- package/dist/.setup/{context-engine-projection-CsgYSQhW.mjs → context-engine-projection-ps-yn_ci.mjs} +10 -22
- package/dist/.setup/{conversation-binding-DJ_288rC.mjs → conversation-binding-CTSLDM9S.mjs} +85 -119
- package/dist/.setup/{conversation-binding-data-DJ4ix-W5.mjs → conversation-binding-data-UgLuTSQT.mjs} +9 -8
- package/dist/.setup/{conversation-control-CuiZ_pDL.mjs → conversation-control-GXM3unE4.mjs} +7 -10
- package/dist/.setup/{cyber-failover-Bb1J6hS1.mjs → cyber-failover-D4dgNfFf.mjs} +2 -5
- package/dist/.setup/{cyber-failover-notice-XR03ef31.mjs → cyber-failover-notice-ljgGGL0s.mjs} +1 -1
- package/dist/.setup/{doctor-start-options-DPW9JxIE.mjs → doctor-start-options-JjTAl-q_.mjs} +5 -5
- package/dist/.setup/{dynamic-tool-build-DgWZMfAQ.mjs → dynamic-tool-build-D731PCdv.mjs} +57 -69
- package/dist/.setup/{dynamic-tools-Ct6GKAFr.mjs → dynamic-tools-D0pYbxHH.mjs} +689 -710
- package/dist/.setup/{effective-mcp-catalog-DmCSc8TS.mjs → effective-mcp-catalog-1hWFKghy.mjs} +11 -20
- package/dist/.setup/{elicitation-input-r9axtppm.mjs → elicitation-input-DXG_qaXr.mjs} +14 -20
- package/dist/.setup/{ephemeral-turn-_cBMKCFb.mjs → ephemeral-turn-Cphy5Qr_.mjs} +3 -3
- package/dist/.setup/{event-projector-assistant-message-C3Tpt370.mjs → event-projector-assistant-message-CLMKN4x-.mjs} +2 -2
- package/dist/.setup/{event-projector-usage-03R0I2dM.mjs → event-projector-usage-BpKfdoTm.mjs} +20 -33
- package/dist/.setup/{event-projector-values-DTqZHizf.mjs → event-projector-values-CLvG1Hil.mjs} +4 -5
- package/dist/.setup/history-rejection-B4nOXNXF.mjs +13 -0
- package/dist/.setup/{inference-context-D-9gWlTR.mjs → inference-context-DNlGwzwy.mjs} +10 -11
- package/dist/.setup/{inference-dispatch-B5UKEUyC.mjs → inference-dispatch-CO6tTs4q.mjs} +5 -4
- package/dist/.setup/{inference-metadata-CgIf7sOx.mjs → inference-metadata-DCvcG_N_.mjs} +36 -41
- package/dist/.setup/{inference-proxy-DUO5E2QQ.mjs → inference-proxy-BDWV0djM.mjs} +10 -14
- package/dist/.setup/{isolated-completion-CjrQEeke.mjs → isolated-completion-Bhqd2yBq.mjs} +8 -8
- package/dist/.setup/local-runtime-attribution-CZz2DJ4q.mjs +15 -0
- package/dist/.setup/{managed-binary-C1VFoVPf.mjs → managed-binary-BtIjV7yN.mjs} +16 -36
- package/dist/.setup/{mcp-app-session-preparation-D0yRoreX.mjs → mcp-app-session-preparation-DqSvxFqc.mjs} +24 -25
- package/dist/.setup/{mcp-tool-metadata-j10HhfTC.mjs → mcp-tool-metadata-DW41snf3.mjs} +1 -1
- package/dist/.setup/{model-catalog--G4arndd.mjs → model-catalog-B227ST3D.mjs} +6 -6
- package/dist/.setup/{models-BYbLQPnj.mjs → models-DdRyi93L.mjs} +6 -10
- package/dist/.setup/{native-auth-Cjb9y7IZ.mjs → native-auth-esN5MdIv.mjs} +5 -5
- package/dist/.setup/{native-execution-policy-ClzpdG3D.mjs → native-execution-policy-MXEe7PB3.mjs} +11 -28
- package/dist/.setup/native-hook-relay-BUWIOrSr.mjs +561 -0
- package/dist/.setup/{native-mcp-app-5i5eRCwO.mjs → native-mcp-app-CjxJQ4F7.mjs} +6 -6
- package/dist/.setup/native-skill-isolation-UMVoNjZz.mjs +391 -0
- package/dist/.setup/{native-subagent-monitor-B2C8D_N0.mjs → native-subagent-monitor-iHc8oLg5.mjs} +505 -639
- package/dist/.setup/{native-subagent-pending-assignments-BDqhOdJp.mjs → native-subagent-pending-assignments-DmVhedNs.mjs} +11 -23
- package/dist/.setup/{native-task-assignments-C6KVqiN1.mjs → native-task-assignments-DimsQ9Qa.mjs} +73 -27
- package/dist/.setup/{node-cli-sessions-B5oNDkUS.mjs → node-cli-sessions-CzKg2nGq.mjs} +18 -26
- package/dist/.setup/{node-exec-server.runtime-0xSEjKYt.mjs → node-exec-server.runtime-BWkULhBM.mjs} +5 -8
- package/dist/.setup/{plan-B5bDIEuQ.mjs → plan-C_F3aio0.mjs} +40 -50
- package/dist/.setup/{plugin-activation-BcyBv8PG.mjs → plugin-activation-D7WkJMvU.mjs} +4 -5
- package/dist/.setup/{plugin-app-cache-key-BW8rd98k.mjs → plugin-app-cache-key-Bg9DbDI6.mjs} +18 -23
- package/dist/.setup/{plugin-approval-roundtrip-C_SGp5YW.mjs → plugin-approval-roundtrip-BSV-51ig.mjs} +4 -6
- package/dist/.setup/{plugin-inventory-Bf0_piTw.mjs → plugin-inventory-CYgdo14P.mjs} +28 -43
- package/dist/.setup/{plugin-marketplace-discovery-SQPhSuic.mjs → plugin-marketplace-discovery-BblHM3DU.mjs} +7 -10
- package/dist/.setup/{plugin-metadata-cache-DWnB7VMj.mjs → plugin-metadata-cache-Bi8TAPwX.mjs} +5 -10
- package/dist/.setup/project-doc-thread-config-BVcvnps8.mjs +490 -0
- package/dist/.setup/{provider-BoIby-eX.mjs → provider-BJ4xhaGX.mjs} +4 -4
- package/dist/.setup/{provider-capabilities-B4yq6UgQ.mjs → provider-capabilities-CjRaV3bx.mjs} +1 -1
- package/dist/.setup/{rate-limits-CMPy24F5.mjs → rate-limits-CI8pTPqL.mjs} +15 -32
- package/dist/.setup/reasoning-effort-CS9kKWB9.mjs +37 -0
- package/dist/.setup/{request-DD3u22uv.mjs → request-Y8dmbqZ3.mjs} +28 -48
- package/dist/.setup/{rpc-error-hmWM21RB.mjs → rpc-error-C98SHchT.mjs} +3 -6
- package/dist/.setup/{run-attempt-DOVF5OON.mjs → run-attempt-Dx7a4Mfm.mjs} +927 -859
- package/dist/.setup/{run-attempt-lifecycle-BuZgVbDA.mjs → run-attempt-lifecycle-KN4oh-7O.mjs} +13 -4
- package/dist/.setup/{runtime-artifact-CUTOOnKw.mjs → runtime-artifact-C13pR7tD.mjs} +18 -22
- package/dist/.setup/{runtime-artifact-connection-CADz3_BY.mjs → runtime-artifact-connection-jS5DeCok.mjs} +3 -3
- package/dist/.setup/{sandbox-guard-WqE8yPge.mjs → sandbox-guard-DIImwCy1.mjs} +4 -6
- package/dist/.setup/service-tier-normalization-BPgw2Wdt.mjs +9 -0
- package/dist/.setup/{session-binding-Ce7BqiPN.mjs → session-binding-JEHNMPsr.mjs} +13 -40
- package/dist/.setup/{session-binding-record-BZB8RgcF.mjs → session-binding-record-DU_0biMD.mjs} +4 -4
- package/dist/.setup/{session-binding-record-codec-z4ZpDn6E.mjs → session-binding-record-codec-BpH8u_G9.mjs} +16 -39
- package/dist/.setup/{session-binding-sidecars-BrdV95Fg.mjs → session-binding-sidecars-DD-enC8w.mjs} +49 -54
- package/dist/.setup/{session-catalog-adoption-CPIP4S_y.mjs → session-catalog-adoption-Ca3OYGYM.mjs} +23 -27
- package/dist/.setup/{session-catalog-archive-DcgwvSbF.mjs → session-catalog-archive-Bv6gV7x9.mjs} +6 -6
- package/dist/.setup/{session-catalog-events-DRaivXvC.mjs → session-catalog-events-DzFlXNUe.mjs} +6 -5
- package/dist/.setup/{session-catalog-index-qwmgqC4t.mjs → session-catalog-index-DozvkUPd.mjs} +111 -105
- package/dist/.setup/{session-catalog-index-order-nhyO0wdW.mjs → session-catalog-index-order-CTfoefow.mjs} +28 -5
- package/dist/.setup/{session-catalog-limits-DEU36Qlo.mjs → session-catalog-limits-BynIoOYm.mjs} +1 -1
- package/dist/.setup/{session-catalog-list-request-tXephOB4.mjs → session-catalog-list-request-D4MYNgDB.mjs} +11 -8
- package/dist/.setup/{session-catalog-native-projection-z9Q608QW.mjs → session-catalog-native-projection-rCKnZud1.mjs} +5 -61
- package/dist/.setup/{session-catalog-node-adoption-7-WEQTB1.mjs → session-catalog-node-adoption-BdP9Zjqo.mjs} +2 -2
- package/dist/.setup/{session-catalog-node-continue-DLWBwAAO.mjs → session-catalog-node-continue-CNJibO4_.mjs} +27 -49
- package/dist/.setup/{session-catalog-node-lookup-Uufckwcm.mjs → session-catalog-node-lookup-BH_DBGa9.mjs} +3 -3
- package/dist/.setup/{session-catalog-parsing-B-qWJh2x.mjs → session-catalog-parsing-DkeoVn60.mjs} +9 -19
- package/dist/.setup/{session-catalog-projection-Cl0Nc7c6.mjs → session-catalog-projection-DDVmALHj.mjs} +8 -22
- package/dist/.setup/session-catalog-source-CygTGmrb.mjs +58 -0
- package/dist/.setup/{session-cli-kH4vuGod.mjs → session-cli-GwU0izn-.mjs} +20 -41
- package/dist/.setup/{session-history-BogBHKLk.mjs → session-history-BO6i_pfk.mjs} +1 -1
- package/dist/.setup/{session-history-import-NWKPa4ZO.mjs → session-history-import-CaO8s6ta.mjs} +4 -4
- package/dist/.setup/{session-history-read-CNN8zwbD.mjs → session-history-read-BI_2jRED.mjs} +4 -15
- package/dist/.setup/{session-history.worker-Cq_4DYgN.mjs → session-history.worker-DJQfek5p.mjs} +147 -159
- package/dist/.setup/{session-initialization-D6dtFQkE.mjs → session-initialization-Bi_2DKhc.mjs} +3 -5
- package/dist/.setup/{session-permission-policy-BxIUJ0Zd.mjs → session-permission-policy-CD2MAWU8.mjs} +12 -20
- package/dist/.setup/{session-retirement-Bt3b0fpe.mjs → session-retirement-IoS3zr17.mjs} +7 -7
- package/dist/.setup/{settled-turn-context-BZsMjkIO.mjs → settled-turn-context-BPL6D3RO.mjs} +1 -1
- package/dist/.setup/{settled-turn-finalizer-e_24O6HA.mjs → settled-turn-finalizer-X-Fylp-u.mjs} +12 -11
- package/dist/.setup/{shared-client-DeenOD8U.mjs → shared-client-ByIwuAC-.mjs} +172 -229
- package/dist/.setup/{side-question-BZHn_1Jm.mjs → side-question-BDUdozFy.mjs} +116 -137
- package/dist/.setup/{source-0ClinBHI.mjs → source-Bxbqf3S1.mjs} +37 -56
- package/dist/.setup/thread-archive-guard-LKdwQKyr.mjs +56 -0
- package/dist/.setup/{thread-lifecycle-CoqYpbpk.mjs → thread-lifecycle-run-CfP4PnEf.mjs} +348 -484
- package/dist/.setup/thread-model-selection-DcVebr8N.mjs +61 -0
- package/dist/.setup/{thread-ownership-CSDZ6mHd.mjs → thread-ownership-Be53aiaG.mjs} +5 -5
- package/dist/.setup/{thread-ownership-queue-Dp24d7-F.mjs → thread-ownership-queue-CeyYScUC.mjs} +5 -6
- package/dist/.setup/{thread-policy-DCC9lQjC.mjs → thread-policy-CHgY-KNl.mjs} +4 -4
- package/dist/.setup/thread-requests-BgzJwJtS.mjs +745 -0
- package/dist/.setup/{thread-resume--WOKWxZd.mjs → thread-resume-B2EmMcgE.mjs} +5 -5
- package/dist/.setup/{timeout-CXOfNoaX.mjs → timeout-D0mEWSGG.mjs} +6 -12
- package/dist/.setup/{transcript-history-projection-B9a7HwUV.mjs → transcript-history-projection-DfKcoZCB.mjs} +3 -4
- package/dist/.setup/{transcript-mirror-BfLRARNL.mjs → transcript-mirror-Bee2o6jj.mjs} +68 -68
- package/dist/.setup/{transcript-mirror-attestation-YSegaktH.mjs → transcript-mirror-attestation-BzUXnrvv.mjs} +5 -2
- package/dist/.setup/{transport-stdio-a0HDa2Mj.mjs → transport-stdio-CRWTkKOn.mjs} +67 -77
- package/dist/.setup/{transport-websocket-zqJ0Cmtn.mjs → transport-websocket-DIyPfkHo.mjs} +8 -16
- package/dist/.setup/{turn-router-BWhX_SBh.mjs → turn-router-DKDAziUW.mjs} +30 -31
- package/dist/.setup/upstream-prompt-provenance-Ccd9MFRJ.mjs +44 -0
- package/dist/.setup/{upstream-session-fork-BQvofnk7.mjs → upstream-session-fork-Djp_yssT.mjs} +50 -43
- package/dist/.setup/{usage-BEHcVwcZ.mjs → usage-DQA-peQC.mjs} +4 -4
- package/dist/.setup/{usage-limit-error-D1p3nE6n.mjs → usage-limit-error-2t3KBqiX.mjs} +12 -21
- package/dist/.setup/web-search-item-CvokaZOo.mjs +20 -0
- package/dist/.setup/{web-search-provider.runtime-CV9oiB-v.mjs → web-search-provider.runtime-BsuCMNix.mjs} +3 -3
- package/dist/.setup/{workspace-write-sandbox-probe-DmUHLrrl.mjs → workspace-write-sandbox-probe-BDWO2Qkh.mjs} +4 -4
- package/dist/api.js +15 -15
- package/dist/catalog-page.worker.js +1 -1
- package/dist/cli-metadata.js +1 -1
- package/dist/doctor-contract-api.js +5 -6
- package/dist/harness.js +32 -61
- package/dist/index.js +302 -416
- package/dist/media-understanding-provider.js +32 -43
- package/dist/migration-provider-api.js +1 -1
- package/dist/native-session-binding-api.js +1 -1
- package/dist/native-tool-policy.js +23 -1
- package/dist/provider-discovery.js +1 -1
- package/dist/session-history-worker-runtime.js +52 -31
- package/dist/session-history.worker.js +1 -1
- package/openclaw.plugin.json +20 -3
- package/package.json +7 -7
- package/dist/.setup/attempt-terminal-gZrxQ35N.mjs +0 -5
- package/dist/.setup/plugin-thread-config-deadline-CsScGgrk.mjs +0 -124
- package/dist/.setup/service-tier-normalization-Cei89SW6.mjs +0 -15
- package/dist/.setup/shell-dynamic-tools-BqGszXcq.mjs +0 -85
- package/dist/.setup/thread-archive-guard-C9frICzX.mjs +0 -60
- package/dist/.setup/thread-requests-Dwg2b4Xl.mjs +0 -2111
- package/dist/.setup/upstream-prompt-provenance-fXkKbPVC.mjs +0 -37
|
@@ -33,7 +33,7 @@ async function describeCodexImages(req, options) {
|
|
|
33
33
|
const model = req.model.trim();
|
|
34
34
|
if (!model) throw new Error("Codex image understanding requires model id.");
|
|
35
35
|
req.signal?.throwIfAborted();
|
|
36
|
-
const { runBoundedCodexAppServerTurn } = await import("./.setup/bounded-turn-
|
|
36
|
+
const { runBoundedCodexAppServerTurn } = await import("./.setup/bounded-turn-CyQVQwGe.mjs");
|
|
37
37
|
req.signal?.throwIfAborted();
|
|
38
38
|
const { text } = await runBoundedCodexAppServerTurn({
|
|
39
39
|
config: req.cfg,
|
|
@@ -73,7 +73,7 @@ async function extractCodexStructured(req, options) {
|
|
|
73
73
|
if (req.input.length === 0) throw new Error("Codex structured extraction requires at least one input.");
|
|
74
74
|
if (!req.input.some((entry) => entry.type === "image")) throw new Error("Codex structured extraction requires at least one image input.");
|
|
75
75
|
req.signal?.throwIfAborted();
|
|
76
|
-
const { runBoundedCodexAppServerTurn } = await import("./.setup/bounded-turn-
|
|
76
|
+
const { runBoundedCodexAppServerTurn } = await import("./.setup/bounded-turn-CyQVQwGe.mjs");
|
|
77
77
|
req.signal?.throwIfAborted();
|
|
78
78
|
const { text } = await runBoundedCodexAppServerTurn({
|
|
79
79
|
config: req.cfg,
|
|
@@ -94,12 +94,33 @@ async function extractCodexStructured(req, options) {
|
|
|
94
94
|
requiredModalities: ["text", "image"],
|
|
95
95
|
isolation: "configured-transport"
|
|
96
96
|
});
|
|
97
|
-
|
|
97
|
+
const result = {
|
|
98
98
|
text,
|
|
99
99
|
model,
|
|
100
100
|
provider: req.provider,
|
|
101
|
-
req
|
|
102
|
-
}
|
|
101
|
+
contentType: req.jsonMode === false ? "text" : "json"
|
|
102
|
+
};
|
|
103
|
+
if (req.jsonMode !== false) {
|
|
104
|
+
try {
|
|
105
|
+
result.parsed = JSON.parse(text);
|
|
106
|
+
} catch {
|
|
107
|
+
throw new Error("Codex structured extraction returned invalid JSON.");
|
|
108
|
+
}
|
|
109
|
+
if (isRecord(req.jsonSchema)) {
|
|
110
|
+
const validation = validateJsonSchemaValue({
|
|
111
|
+
schema: req.jsonSchema,
|
|
112
|
+
cacheKey: "codex.media-understanding.extractStructured",
|
|
113
|
+
value: result.parsed,
|
|
114
|
+
cache: false
|
|
115
|
+
});
|
|
116
|
+
if (!validation.ok) {
|
|
117
|
+
const message = validation.errors.map((error) => error.text).join("; ") || "invalid";
|
|
118
|
+
throw new Error(`Codex structured extraction JSON did not match schema: ${message}`);
|
|
119
|
+
}
|
|
120
|
+
result.parsed = validation.value;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
return result;
|
|
103
124
|
}
|
|
104
125
|
function buildCodexImagePrompt(req) {
|
|
105
126
|
const prompt = req.prompt?.trim() || DEFAULT_CODEX_IMAGE_PROMPT;
|
|
@@ -109,7 +130,12 @@ function buildCodexImagePrompt(req) {
|
|
|
109
130
|
function buildCodexStructuredInput(req) {
|
|
110
131
|
return [{
|
|
111
132
|
type: "text",
|
|
112
|
-
text:
|
|
133
|
+
text: [
|
|
134
|
+
req.instructions.trim(),
|
|
135
|
+
req.schemaName ? `Schema name: ${req.schemaName}` : void 0,
|
|
136
|
+
req.jsonSchema ? `JSON schema:\n${JSON.stringify(req.jsonSchema)}` : void 0,
|
|
137
|
+
req.jsonMode === false ? "Return the extraction as concise text." : "Return valid JSON only. Do not wrap the JSON in Markdown fences."
|
|
138
|
+
].filter((part) => Boolean(part)).join("\n\n"),
|
|
113
139
|
text_elements: []
|
|
114
140
|
}, ...req.input.map((entry) => {
|
|
115
141
|
if (entry.type === "text") return {
|
|
@@ -123,42 +149,5 @@ function buildCodexStructuredInput(req) {
|
|
|
123
149
|
};
|
|
124
150
|
})];
|
|
125
151
|
}
|
|
126
|
-
function buildStructuredExtractionPrompt(req) {
|
|
127
|
-
return [
|
|
128
|
-
req.instructions.trim(),
|
|
129
|
-
req.schemaName ? `Schema name: ${req.schemaName}` : void 0,
|
|
130
|
-
req.jsonSchema ? `JSON schema:\n${JSON.stringify(req.jsonSchema)}` : void 0,
|
|
131
|
-
req.jsonMode === false ? "Return the extraction as concise text." : "Return valid JSON only. Do not wrap the JSON in Markdown fences."
|
|
132
|
-
].filter((part) => Boolean(part)).join("\n\n");
|
|
133
|
-
}
|
|
134
|
-
function normalizeStructuredExtractionResult(params) {
|
|
135
|
-
const result = {
|
|
136
|
-
text: params.text,
|
|
137
|
-
model: params.model,
|
|
138
|
-
provider: params.provider,
|
|
139
|
-
contentType: params.req.jsonMode === false ? "text" : "json"
|
|
140
|
-
};
|
|
141
|
-
if (params.req.jsonMode !== false) {
|
|
142
|
-
try {
|
|
143
|
-
result.parsed = JSON.parse(params.text);
|
|
144
|
-
} catch {
|
|
145
|
-
throw new Error("Codex structured extraction returned invalid JSON.");
|
|
146
|
-
}
|
|
147
|
-
if (isRecord(params.req.jsonSchema)) {
|
|
148
|
-
const validation = validateJsonSchemaValue({
|
|
149
|
-
schema: params.req.jsonSchema,
|
|
150
|
-
cacheKey: "codex.media-understanding.extractStructured",
|
|
151
|
-
value: result.parsed,
|
|
152
|
-
cache: false
|
|
153
|
-
});
|
|
154
|
-
if (!validation.ok) {
|
|
155
|
-
const message = validation.errors.map((error) => error.text).join("; ") || "invalid";
|
|
156
|
-
throw new Error(`Codex structured extraction JSON did not match schema: ${message}`);
|
|
157
|
-
}
|
|
158
|
-
result.parsed = validation.value;
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
return result;
|
|
162
|
-
}
|
|
163
152
|
//#endregion
|
|
164
153
|
export { buildCodexMediaUnderstandingProvider };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as buildCodexMigrationProvider } from "./.setup/provider-
|
|
1
|
+
import { t as buildCodexMigrationProvider } from "./.setup/provider-BJ4xhaGX.mjs";
|
|
2
2
|
export { buildCodexMigrationProvider as buildMigrationProvider };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as readStoredCodexAppServerBinding } from "./.setup/session-binding-record-codec-
|
|
1
|
+
import { a as readStoredCodexAppServerBinding } from "./.setup/session-binding-record-codec-BpH8u_G9.mjs";
|
|
2
2
|
export { readStoredCodexAppServerBinding as readNativeSessionBindingRecord };
|
|
@@ -8,5 +8,27 @@ const CODEX_NATIVE_TOOL_REQUIREMENTS = [
|
|
|
8
8
|
"edit",
|
|
9
9
|
"apply_patch"
|
|
10
10
|
];
|
|
11
|
+
const CODEX_TOOL_POLICY_SAFE_DENY_NAMES = [
|
|
12
|
+
"web_fetch",
|
|
13
|
+
"x_search",
|
|
14
|
+
"memory_search",
|
|
15
|
+
"memory_get",
|
|
16
|
+
"dashboard",
|
|
17
|
+
"canvas",
|
|
18
|
+
"show_widget",
|
|
19
|
+
"message",
|
|
20
|
+
"heartbeat_respond",
|
|
21
|
+
"automations",
|
|
22
|
+
"gateway",
|
|
23
|
+
"agents_list",
|
|
24
|
+
"openclaw",
|
|
25
|
+
"session_status",
|
|
26
|
+
"progress_card",
|
|
27
|
+
"skill_workshop",
|
|
28
|
+
"image_generate",
|
|
29
|
+
"music_generate",
|
|
30
|
+
"video_generate",
|
|
31
|
+
"tts"
|
|
32
|
+
];
|
|
11
33
|
//#endregion
|
|
12
|
-
export { CODEX_NATIVE_TOOL_REQUIREMENTS };
|
|
34
|
+
export { CODEX_NATIVE_TOOL_REQUIREMENTS, CODEX_TOOL_POLICY_SAFE_DENY_NAMES };
|
|
@@ -5,7 +5,7 @@ const codexProviderDiscovery = {
|
|
|
5
5
|
auth: [],
|
|
6
6
|
prepareSyntheticAuth: async ({ config, provider, env, signal, pluginRoot }) => {
|
|
7
7
|
if (provider !== "codex") return;
|
|
8
|
-
const { probeCodexNativeAuth } = await import("./.setup/native-auth-
|
|
8
|
+
const { probeCodexNativeAuth } = await import("./.setup/native-auth-esN5MdIv.mjs");
|
|
9
9
|
return await probeCodexNativeAuth({
|
|
10
10
|
config,
|
|
11
11
|
env,
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { n as
|
|
1
|
+
import { n as codexHistoryRejectionReason } from "./.setup/history-rejection-B4nOXNXF.mjs";
|
|
2
|
+
import { t as consumeCodexHistory } from "./.setup/session-history-read-BI_2jRED.mjs";
|
|
3
|
+
import { n as projectVerifiedSettledCodexMessages, t as runCodexHistoryWorkerInput } from "./.setup/session-history.worker-DJQfek5p.mjs";
|
|
4
|
+
import { n as resolveCodexHistoryTarget } from "./.setup/session-history-BO6i_pfk.mjs";
|
|
4
5
|
import { WorkerTaskPool, resolveRuntimeWorkerArgv, resolveRuntimeWorkerUrl } from "openclaw/plugin-sdk/process-runtime";
|
|
5
6
|
import { isIncognitoSessionKey } from "openclaw/plugin-sdk/session-key-runtime";
|
|
6
7
|
import { fileURLToPath } from "node:url";
|
|
7
|
-
import { SessionTranscriptReadFenceError,
|
|
8
|
+
import { SessionTranscriptReadFenceError, captureCodexSessionContextReader, readCodexSessionContextProjection } from "openclaw/plugin-sdk/codex-session-transcript-runtime";
|
|
8
9
|
//#region extensions/codex/session-history-worker-runtime.ts
|
|
9
10
|
const codexHistoryWorkerEntrypoint = {
|
|
10
11
|
currentModuleUrl: import.meta.url,
|
|
@@ -15,27 +16,29 @@ const codexHistoryWorkerEntrypoint = {
|
|
|
15
16
|
distWorkerPath: "session-history.worker.js"
|
|
16
17
|
}
|
|
17
18
|
};
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
const sourceWorkerUrl = resolveRuntimeWorkerUrl(codexHistoryWorkerEntrypoint);
|
|
20
|
+
const sourceNeedsBuiltFallback = /\.[cm]?ts$/u.test(sourceWorkerUrl.pathname) && (typeof process.versions.bun === "string" || resolveRuntimeWorkerArgv(sourceWorkerUrl).length === 1);
|
|
21
|
+
const historyReads = new WorkerTaskPool({
|
|
22
|
+
workerUrl: sourceNeedsBuiltFallback ? resolveRuntimeWorkerUrl({
|
|
22
23
|
...codexHistoryWorkerEntrypoint,
|
|
23
24
|
root: fileURLToPath(new URL("../..", import.meta.url))
|
|
24
|
-
})
|
|
25
|
-
|
|
26
|
-
const historyReads = new WorkerTaskPool({
|
|
27
|
-
workerUrl: resolveCodexHistoryWorkerUrl(),
|
|
25
|
+
}) : sourceWorkerUrl,
|
|
26
|
+
workerClass: "reader",
|
|
28
27
|
maxWorkers: 1
|
|
29
28
|
});
|
|
30
29
|
async function projectCodexSettledHistoryInWorker(target, signal, contextReader) {
|
|
31
30
|
signal?.throwIfAborted();
|
|
32
31
|
if (contextReader && !target.sessionTarget) throw new Error("Actor history requires a captured sessionTarget");
|
|
33
32
|
const resolved = resolveCodexHistoryTarget(target);
|
|
34
|
-
|
|
33
|
+
const reader = contextReader ?? (target.sessionTarget && resolved.kind === "sqlite" ? captureCodexSessionContextReader({
|
|
34
|
+
...target.sessionTarget,
|
|
35
|
+
...resolved.target
|
|
36
|
+
}, signal) : void 0);
|
|
37
|
+
if (reader) {
|
|
35
38
|
if (resolved.kind !== "sqlite") throw new Error("Actor history requires a complete matching sessionTarget");
|
|
36
39
|
let result;
|
|
37
40
|
try {
|
|
38
|
-
result = await
|
|
41
|
+
result = await reader(resolved.target, (messages, header) => {
|
|
39
42
|
signal?.throwIfAborted();
|
|
40
43
|
try {
|
|
41
44
|
return {
|
|
@@ -59,31 +62,49 @@ async function projectCodexSettledHistoryInWorker(target, signal, contextReader)
|
|
|
59
62
|
signal?.throwIfAborted();
|
|
60
63
|
return result;
|
|
61
64
|
}
|
|
62
|
-
const
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
...receipt ? { admission: { ...receipt } } : {},
|
|
67
|
-
evidence: {
|
|
68
|
-
mirroredMessages: target.mirroredMessages,
|
|
69
|
-
settledMessages: target.settledMessages,
|
|
70
|
-
turnId: target.turnId
|
|
71
|
-
}
|
|
65
|
+
const evidence = {
|
|
66
|
+
mirroredMessages: target.mirroredMessages,
|
|
67
|
+
settledMessages: target.settledMessages,
|
|
68
|
+
turnId: target.turnId
|
|
72
69
|
};
|
|
73
|
-
const result = resolved.kind === "sqlite" && isIncognitoSessionKey(resolved.target.sessionKey) ? await runCodexHistoryWorkerInput(input) : await historyReads.run(input, {
|
|
74
|
-
timeoutMs: 6e4,
|
|
75
|
-
signal
|
|
76
|
-
});
|
|
77
|
-
signal?.throwIfAborted();
|
|
78
70
|
if (resolved.kind === "sqlite") try {
|
|
79
|
-
|
|
80
|
-
|
|
71
|
+
return await readCodexSessionContextProjection(resolved.target, async ({ target: captured, admission, physicalSource }) => {
|
|
72
|
+
const input = {
|
|
73
|
+
target: {
|
|
74
|
+
kind: "sqlite",
|
|
75
|
+
target: captured
|
|
76
|
+
},
|
|
77
|
+
sessionId: target.sessionId,
|
|
78
|
+
admission,
|
|
79
|
+
physicalSource,
|
|
80
|
+
evidence
|
|
81
|
+
};
|
|
82
|
+
const result = isIncognitoSessionKey(captured.sessionKey) ? await runCodexHistoryWorkerInput(input) : await historyReads.run(input, {
|
|
83
|
+
timeoutMs: 6e4,
|
|
84
|
+
signal
|
|
85
|
+
});
|
|
86
|
+
return {
|
|
87
|
+
value: result.result,
|
|
88
|
+
version: result.version
|
|
89
|
+
};
|
|
90
|
+
}, signal);
|
|
81
91
|
} catch (error) {
|
|
92
|
+
signal?.throwIfAborted();
|
|
82
93
|
return {
|
|
83
94
|
status: "rejected",
|
|
84
95
|
reason: error instanceof SessionTranscriptReadFenceError ? "snapshot_invalidated" : codexHistoryRejectionReason(error)
|
|
85
96
|
};
|
|
86
97
|
}
|
|
98
|
+
const input = {
|
|
99
|
+
target: resolved,
|
|
100
|
+
sessionId: target.sessionId,
|
|
101
|
+
evidence
|
|
102
|
+
};
|
|
103
|
+
const result = await historyReads.run(input, {
|
|
104
|
+
timeoutMs: 6e4,
|
|
105
|
+
signal
|
|
106
|
+
});
|
|
107
|
+
signal?.throwIfAborted();
|
|
87
108
|
return result.result;
|
|
88
109
|
}
|
|
89
110
|
//#endregion
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as runCodexHistoryWorkerInput } from "./.setup/session-history.worker-
|
|
1
|
+
import { t as runCodexHistoryWorkerInput } from "./.setup/session-history.worker-DJQfek5p.mjs";
|
|
2
2
|
export { runCodexHistoryWorkerInput };
|
package/openclaw.plugin.json
CHANGED
|
@@ -551,6 +551,23 @@
|
|
|
551
551
|
"remoteWorkspaceRoot": {
|
|
552
552
|
"type": "string"
|
|
553
553
|
},
|
|
554
|
+
"nativeHookRelay": {
|
|
555
|
+
"type": "object",
|
|
556
|
+
"additionalProperties": false,
|
|
557
|
+
"required": [
|
|
558
|
+
"url",
|
|
559
|
+
"credentialDirectory"
|
|
560
|
+
],
|
|
561
|
+
"properties": {
|
|
562
|
+
"url": {
|
|
563
|
+
"type": "string",
|
|
564
|
+
"format": "uri"
|
|
565
|
+
},
|
|
566
|
+
"credentialDirectory": {
|
|
567
|
+
"type": "string"
|
|
568
|
+
}
|
|
569
|
+
}
|
|
570
|
+
},
|
|
554
571
|
"codeModeOnly": {
|
|
555
572
|
"type": "boolean",
|
|
556
573
|
"default": false
|
|
@@ -784,7 +801,7 @@
|
|
|
784
801
|
},
|
|
785
802
|
"computerUse.liveTestTimeoutMs": {
|
|
786
803
|
"label": "Live Test Timeout",
|
|
787
|
-
"help": "Maximum time for the Computer Use list_apps readiness
|
|
804
|
+
"help": "Maximum time for the Computer Use list_apps readiness check before status and startup treat the live test as failed.",
|
|
788
805
|
"advanced": true
|
|
789
806
|
},
|
|
790
807
|
"computerUse.toolCallTimeoutMs": {
|
|
@@ -794,7 +811,7 @@
|
|
|
794
811
|
},
|
|
795
812
|
"computerUse.healthCheckEnabled": {
|
|
796
813
|
"label": "Periodic Health Checks",
|
|
797
|
-
"help": "When true, run periodic Computer Use live
|
|
814
|
+
"help": "When true, run periodic Computer Use live checks on the configured cadence.",
|
|
798
815
|
"advanced": true
|
|
799
816
|
},
|
|
800
817
|
"computerUse.healthCheckIntervalMinutes": {
|
|
@@ -809,7 +826,7 @@
|
|
|
809
826
|
},
|
|
810
827
|
"computerUse.strictReadiness": {
|
|
811
828
|
"label": "Strict Readiness",
|
|
812
|
-
"help": "When true, a failed Computer Use live
|
|
829
|
+
"help": "When true, a failed Computer Use live check stops Codex-mode startup. The default false value preserves existing enabled setups by continuing with a warning.",
|
|
813
830
|
"advanced": true
|
|
814
831
|
},
|
|
815
832
|
"computerUse.autoRepair": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/codex",
|
|
3
|
-
"version": "2026.10.1",
|
|
3
|
+
"version": "2026.10.5-beta.1",
|
|
4
4
|
"description": "OpenClaw Codex app-server harness and native session supervision plugin.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -9,11 +9,11 @@
|
|
|
9
9
|
"type": "module",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@openai/codex": "0.160.0",
|
|
12
|
-
"@openclaw/fs-safe": "0.
|
|
12
|
+
"@openclaw/fs-safe": "0.25.0",
|
|
13
13
|
"semver": "7.8.5",
|
|
14
|
-
"smol-toml": "1.
|
|
14
|
+
"smol-toml": "1.9.0",
|
|
15
15
|
"typebox": "1.3.34",
|
|
16
|
-
"ws": "8.
|
|
16
|
+
"ws": "8.22.0",
|
|
17
17
|
"zod": "4.6.5"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
@@ -38,10 +38,10 @@
|
|
|
38
38
|
]
|
|
39
39
|
},
|
|
40
40
|
"compat": {
|
|
41
|
-
"pluginApi": ">=2026.10.1"
|
|
41
|
+
"pluginApi": ">=2026.10.5-beta.1"
|
|
42
42
|
},
|
|
43
43
|
"build": {
|
|
44
|
-
"openclawVersion": "2026.10.1",
|
|
44
|
+
"openclawVersion": "2026.10.5-beta.1",
|
|
45
45
|
"workerEntries": [
|
|
46
46
|
"./catalog-page.worker.ts"
|
|
47
47
|
]
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"assets/activity.svg"
|
|
67
67
|
],
|
|
68
68
|
"peerDependencies": {
|
|
69
|
-
"openclaw": ">=2026.10.1"
|
|
69
|
+
"openclaw": ">=2026.10.5-beta.1"
|
|
70
70
|
},
|
|
71
71
|
"peerDependenciesMeta": {
|
|
72
72
|
"openclaw": {
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
import { f as resolveCodexPluginsPolicy } from "./config-parsing-BQq-CHTF.mjs";
|
|
2
|
-
import { r as withAbortableTimeout } from "./timeout-CXOfNoaX.mjs";
|
|
3
|
-
import { a as defaultCodexAppInventoryCache } from "./plugin-app-cache-key-BW8rd98k.mjs";
|
|
4
|
-
import { s as resolveRecoverableCodexPluginConfigKeys } from "./plugin-inventory-Bf0_piTw.mjs";
|
|
5
|
-
import "./config-0Gxk3_eq.mjs";
|
|
6
|
-
import { Tt as shouldBuildCodexPluginThreadConfig, gt as buildCodexPluginThreadConfig, vt as buildCodexPluginThreadConfigTimeoutFallback } from "./thread-requests-Dwg2b4Xl.mjs";
|
|
7
|
-
import { m as readCurrentCodexScheduledAppPolicy, p as intersectCodexPluginThreadConfigWithScheduledAuthority } from "./thread-lifecycle-CoqYpbpk.mjs";
|
|
8
|
-
import { n as disableCodexPluginThreadConfig } from "./dynamic-tool-build-DgWZMfAQ.mjs";
|
|
9
|
-
import { t as defaultCodexPluginMetadataCache } from "./plugin-metadata-cache-DWnB7VMj.mjs";
|
|
10
|
-
import { AgentHarnessPreflightError } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
11
|
-
//#region extensions/codex/src/app-server/plugin-thread-config-deadline.ts
|
|
12
|
-
/** Enforces one bounded startup budget across Codex plugin config discovery. */
|
|
13
|
-
const CODEX_PLUGIN_THREAD_CONFIG_MAX_TIMEOUT_MS = 6e4;
|
|
14
|
-
const CODEX_PLUGIN_THREAD_CONFIG_TIMEOUT_DIVISOR = 4;
|
|
15
|
-
const CODEX_PLUGIN_THREAD_CONFIG_MIN_TIMEOUT_MS = 100;
|
|
16
|
-
var CodexPluginThreadConfigDeadlineError = class extends Error {
|
|
17
|
-
constructor() {
|
|
18
|
-
super("Codex plugin thread config deadline elapsed");
|
|
19
|
-
this.name = "CodexPluginThreadConfigDeadlineError";
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
/** Resolves the plugin policy state reused throughout app-server startup. */
|
|
23
|
-
function resolveCodexPluginThreadConfigStartupPolicy(params) {
|
|
24
|
-
const pluginThreadConfigRequired = params.hostedAppsSupported === false || Boolean(params.scheduledRuntimeAuthority) || !params.nativeToolSurfaceEnabled || shouldBuildCodexPluginThreadConfig(params.pluginConfig);
|
|
25
|
-
const pluginThreadConfigPluginConfig = params.hostedAppsSupported !== false && (params.nativeToolSurfaceEnabled || params.scheduledRuntimeAuthority) ? params.pluginConfig : disableCodexPluginThreadConfig(params.pluginConfig);
|
|
26
|
-
const resolvedPluginPolicy = pluginThreadConfigRequired ? resolveCodexPluginsPolicy(pluginThreadConfigPluginConfig) : void 0;
|
|
27
|
-
return {
|
|
28
|
-
pluginThreadConfigRequired,
|
|
29
|
-
pluginThreadConfigPluginConfig,
|
|
30
|
-
resolvedPluginPolicy,
|
|
31
|
-
enabledPluginConfigKeys: resolvedPluginPolicy ? resolvedPluginPolicy.pluginPolicies.filter((plugin) => plugin.enabled).map((plugin) => plugin.configKey).toSorted() : void 0
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
/** Builds plugin config without allowing sequential RPC timeouts to consume the turn. */
|
|
35
|
-
async function buildCodexPluginThreadConfigWithinDeadline(params) {
|
|
36
|
-
const { requestTimeoutMs, signal, request, failClosedOnTimeout, transform, ...buildParams } = params;
|
|
37
|
-
signal.throwIfAborted();
|
|
38
|
-
const timeoutMs = resolveCodexPluginThreadConfigTimeoutMs(requestTimeoutMs);
|
|
39
|
-
const deadlineMs = performance.now() + timeoutMs;
|
|
40
|
-
let requestTimedOut = false;
|
|
41
|
-
const boundedRequest = async (method, requestParams) => {
|
|
42
|
-
const remainingTimeoutMs = deadlineMs - performance.now();
|
|
43
|
-
if (requestTimedOut || remainingTimeoutMs <= 0) throw new CodexPluginThreadConfigDeadlineError();
|
|
44
|
-
try {
|
|
45
|
-
return await request(method, requestParams, {
|
|
46
|
-
timeoutMs: remainingTimeoutMs,
|
|
47
|
-
signal
|
|
48
|
-
});
|
|
49
|
-
} catch (error) {
|
|
50
|
-
requestTimedOut ||= isCodexPluginThreadConfigTimeoutError(error);
|
|
51
|
-
throw error;
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
try {
|
|
55
|
-
return await withAbortableTimeout({
|
|
56
|
-
signal,
|
|
57
|
-
timeoutMs,
|
|
58
|
-
promise: (async () => {
|
|
59
|
-
const config = await buildCodexPluginThreadConfig({
|
|
60
|
-
...buildParams,
|
|
61
|
-
request: boundedRequest
|
|
62
|
-
});
|
|
63
|
-
const result = transform ? await transform(config, boundedRequest) : config;
|
|
64
|
-
if (requestTimedOut || performance.now() >= deadlineMs) throw new CodexPluginThreadConfigDeadlineError();
|
|
65
|
-
return result;
|
|
66
|
-
})(),
|
|
67
|
-
timeoutMessage: "Codex plugin thread config deadline elapsed",
|
|
68
|
-
createTimeoutError: () => new CodexPluginThreadConfigDeadlineError()
|
|
69
|
-
});
|
|
70
|
-
} catch (error) {
|
|
71
|
-
if (signal.aborted || !requestTimedOut && !isCodexPluginThreadConfigTimeoutError(error) && performance.now() < deadlineMs) throw error;
|
|
72
|
-
if (failClosedOnTimeout) throw new AgentHarnessPreflightError(`Codex app policy verification exceeded its ${timeoutMs} ms startup budget. No app tools were executed. Retry after Codex app inventory is responsive.`);
|
|
73
|
-
return buildCodexPluginThreadConfigTimeoutFallback({
|
|
74
|
-
pluginConfig: buildParams.pluginConfig,
|
|
75
|
-
appCacheKey: buildParams.appCacheKey,
|
|
76
|
-
message: `Codex plugin discovery exceeded its ${timeoutMs} ms startup budget; plugin apps were disabled for this turn.`
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
/** Creates the recovery metadata and bounded builder used by thread startup. */
|
|
81
|
-
function createCodexPluginThreadConfigStartupProvider(params) {
|
|
82
|
-
const { client, policy, inputFingerprint, enabledPluginConfigKeys, appCache, metadataCache: configuredMetadataCache, ...buildParams } = params;
|
|
83
|
-
const metadataCache = configuredMetadataCache ?? defaultCodexPluginMetadataCache;
|
|
84
|
-
return {
|
|
85
|
-
enabled: true,
|
|
86
|
-
requiresCurrentPolicyCheck: Boolean(policy?.enabled || params.scheduledRuntimeAuthority),
|
|
87
|
-
inputFingerprint,
|
|
88
|
-
enabledPluginConfigKeys,
|
|
89
|
-
accountAppRecoveryEnabled: policy?.allowAllPlugins,
|
|
90
|
-
recoverablePluginConfigKeys: policy ? resolveRecoverableCodexPluginConfigKeys({
|
|
91
|
-
policy,
|
|
92
|
-
metadataCache,
|
|
93
|
-
appCacheKey: params.appCacheKey,
|
|
94
|
-
configCwd: params.configCwd
|
|
95
|
-
}) : void 0,
|
|
96
|
-
build: async (buildOptions) => {
|
|
97
|
-
const config = await buildCodexPluginThreadConfigWithinDeadline({
|
|
98
|
-
...buildParams,
|
|
99
|
-
threadId: buildOptions?.threadId,
|
|
100
|
-
appCache: appCache ?? defaultCodexAppInventoryCache,
|
|
101
|
-
metadataCache,
|
|
102
|
-
failClosedOnTimeout: Boolean(params.scheduledRuntimeAuthority),
|
|
103
|
-
transform: params.scheduledRuntimeAuthority ? async (builtConfig, request) => intersectCodexPluginThreadConfigWithScheduledAuthority(builtConfig, params.scheduledRuntimeAuthority, await readCurrentCodexScheduledAppPolicy({
|
|
104
|
-
request,
|
|
105
|
-
configCwd: params.configCwd,
|
|
106
|
-
threadId: buildOptions?.threadId
|
|
107
|
-
})) : void 0,
|
|
108
|
-
request: (method, requestParams, options) => client.request(method, requestParams, options)
|
|
109
|
-
});
|
|
110
|
-
return params.scheduledRuntimeAuthority && params.inputFingerprint ? {
|
|
111
|
-
...config,
|
|
112
|
-
inputFingerprint: params.inputFingerprint
|
|
113
|
-
} : config;
|
|
114
|
-
}
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
function resolveCodexPluginThreadConfigTimeoutMs(requestTimeoutMs) {
|
|
118
|
-
return Math.min(CODEX_PLUGIN_THREAD_CONFIG_MAX_TIMEOUT_MS, Math.max(CODEX_PLUGIN_THREAD_CONFIG_MIN_TIMEOUT_MS, Math.floor((Number.isFinite(requestTimeoutMs) && requestTimeoutMs > 0 ? requestTimeoutMs : CODEX_PLUGIN_THREAD_CONFIG_MAX_TIMEOUT_MS * CODEX_PLUGIN_THREAD_CONFIG_TIMEOUT_DIVISOR) / CODEX_PLUGIN_THREAD_CONFIG_TIMEOUT_DIVISOR)));
|
|
119
|
-
}
|
|
120
|
-
function isCodexPluginThreadConfigTimeoutError(error) {
|
|
121
|
-
return error instanceof CodexPluginThreadConfigDeadlineError || error instanceof Error && "code" in error && error.code === "CODEX_APP_SERVER_LOCAL_REQUEST_CANCELLED" && error.message.endsWith(" timed out");
|
|
122
|
-
}
|
|
123
|
-
//#endregion
|
|
124
|
-
export { resolveCodexPluginThreadConfigStartupPolicy as n, createCodexPluginThreadConfigStartupProvider as t };
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
//#region extensions/codex/src/app-server/config-contracts.shared.ts
|
|
2
|
-
const CODEX_PLUGIN_MARKETPLACE_NAME_PATTERN = /^[A-Za-z0-9_-]+$/;
|
|
3
|
-
//#endregion
|
|
4
|
-
//#region extensions/codex/src/app-server/service-tier-normalization.ts
|
|
5
|
-
function normalizeCodexServiceTier(value) {
|
|
6
|
-
if (typeof value !== "string") return;
|
|
7
|
-
const trimmed = value.trim();
|
|
8
|
-
if (!trimmed) return;
|
|
9
|
-
const normalized = trimmed.toLowerCase();
|
|
10
|
-
if (normalized === "fast" || normalized === "priority") return "priority";
|
|
11
|
-
if (normalized === "flex") return "flex";
|
|
12
|
-
return trimmed;
|
|
13
|
-
}
|
|
14
|
-
//#endregion
|
|
15
|
-
export { CODEX_PLUGIN_MARKETPLACE_NAME_PATTERN as n, normalizeCodexServiceTier as t };
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import { ft as normalizeCodexDynamicToolName } from "./thread-requests-Dwg2b4Xl.mjs";
|
|
2
|
-
import { pinExecToolTarget } from "openclaw/plugin-sdk/codex-mcp-projection";
|
|
3
|
-
import { loadNodeExecAvailability } from "openclaw/plugin-sdk/node-selection-runtime";
|
|
4
|
-
//#region extensions/codex/src/app-server/shell-dynamic-tools.ts
|
|
5
|
-
const CODEX_NODE_EXEC_DYNAMIC_TOOL_NAME = "node_exec";
|
|
6
|
-
const CODEX_GATEWAY_EXEC_DYNAMIC_TOOL_NAME = "gateway_exec";
|
|
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
|
-
]);
|
|
17
|
-
const PROCESS_FOLLOWUP_TEXT = "Use process (list/poll/log/write/send-keys/submit/paste/kill/clear/remove) for follow-up.";
|
|
18
|
-
function isCodexDynamicToolExcluded(config, names) {
|
|
19
|
-
const normalizedNames = new Set(names.map((name) => normalizeCodexDynamicToolName(name)));
|
|
20
|
-
return (config.codexDynamicToolsExclude ?? []).some((name) => normalizedNames.has(normalizeCodexDynamicToolName(name)));
|
|
21
|
-
}
|
|
22
|
-
async function createNodeExecAliasDynamicTool(execTool, node, discoverySignal, availabilityRef) {
|
|
23
|
-
const pinnedNode = node?.trim();
|
|
24
|
-
const availability = await (availabilityRef ? availabilityRef.current ??= loadNodeExecAvailability(discoverySignal) : loadNodeExecAvailability(discoverySignal));
|
|
25
|
-
discoverySignal?.throwIfAborted();
|
|
26
|
-
if (!availability.isAvailable(pinnedNode)) return;
|
|
27
|
-
const pinnedTool = pinExecToolTarget(execTool, {
|
|
28
|
-
host: "node",
|
|
29
|
-
...pinnedNode ? { node: pinnedNode } : {}
|
|
30
|
-
});
|
|
31
|
-
return {
|
|
32
|
-
...pinnedTool,
|
|
33
|
-
name: CODEX_NODE_EXEC_DYNAMIC_TOOL_NAME,
|
|
34
|
-
description: pinnedNode ? "Run a shell command to completion on the OpenClaw configured remote node for this session. This tool always uses OpenClaw host=node internally and follows the existing node exec approval and allowlist policy. Remote-node background follow-up is unavailable. Use Codex's native shell for local app-server work when it is available." : "Run a shell command to completion on an OpenClaw remote node. The sole connected node that can execute commands is selected automatically; select by name or id when several can. This tool always uses OpenClaw host=node internally and follows the existing node exec approval and allowlist policy. Remote-node background follow-up is unavailable. Use Codex's native shell for local app-server work when it is available.",
|
|
35
|
-
execute: withProcessFollowupText(pinnedTool, "Remote-node background follow-up is unavailable. Wait for the command to complete.")
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
function createGatewayExecProjection(createProjection, execTool, params) {
|
|
39
|
-
return createProjection(execTool, {
|
|
40
|
-
kind: "exec",
|
|
41
|
-
name: CODEX_GATEWAY_EXEC_DYNAMIC_TOOL_NAME,
|
|
42
|
-
description: "Run a shell command through OpenClaw on the Gateway host for OpenClaw-managed Gateway environment access, including Secret Store agent-readable environment values and protected egress sentinels. Native Codex shell remains preferred for ordinary local work. This tool always uses OpenClaw host=gateway internally and follows Gateway exec approval and allowlist policy.",
|
|
43
|
-
followupText: params.processAliasAvailable ? "Use gateway_process (list/poll/log/write/send-keys/submit/paste/kill/clear/remove) for follow-up." : "Background session follow-up is unavailable because gateway_process is not exposed. Rerun without background=true and set yieldMs high enough to wait for completion.",
|
|
44
|
-
...params.ask ? { ask: params.ask } : {}
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
function createGatewayProcessProjection(createProjection, processTool) {
|
|
48
|
-
return createProjection(processTool, {
|
|
49
|
-
kind: "process",
|
|
50
|
-
name: CODEX_GATEWAY_PROCESS_DYNAMIC_TOOL_NAME,
|
|
51
|
-
description: "Manage background shell sessions in the existing per-session OpenClaw process scope: list, poll, log, write, send-keys, submit, paste, kill, clear, or remove. Use for gateway_exec follow-up; use native Codex shell session handling for ordinary local work."
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
function createSandboxExecProjection(execTool) {
|
|
55
|
-
return {
|
|
56
|
-
...execTool,
|
|
57
|
-
name: "sandbox_exec",
|
|
58
|
-
description: "Run a shell command through OpenClaw's configured sandbox backend for this session. Use when OpenClaw sandboxing is active or when a command must execute in the sandbox backend, such as an SSH-backed sandbox or Docker container-path bind layout. Use Codex's native shell only when no OpenClaw sandbox is active and native Code Mode is available.",
|
|
59
|
-
execute: withProcessFollowupText(execTool, "Use sandbox_process (list/poll/log/write/send-keys/submit/paste/kill/clear/remove) for follow-up.")
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
function withProcessFollowupText(tool, followupText) {
|
|
63
|
-
return async (toolCallId, args, signal, onUpdate) => {
|
|
64
|
-
const result = await tool.execute(toolCallId, args, signal, onUpdate);
|
|
65
|
-
return {
|
|
66
|
-
...result,
|
|
67
|
-
content: result.content.map((item) => item.type === "text" ? Object.assign({}, item, { text: item.text.replace(PROCESS_FOLLOWUP_TEXT, followupText) }) : item)
|
|
68
|
-
};
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
function createSandboxProcessProjection(processTool) {
|
|
72
|
-
return {
|
|
73
|
-
...processTool,
|
|
74
|
-
name: "sandbox_process",
|
|
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."
|
|
76
|
-
};
|
|
77
|
-
}
|
|
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;
|
|
83
|
-
}
|
|
84
|
-
//#endregion
|
|
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 };
|