@openclaw/codex 2026.9.6 → 2026.9.8
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 +2 -0
- package/assets/icon.png +0 -0
- package/dist/.setup/{account-usage-runtime-Eem_WGqY.mjs → account-usage-runtime-G348lY1q.mjs} +5 -5
- package/dist/.setup/{apply-DDOi8uNx.mjs → apply-Cqb-YoCS.mjs} +22 -36
- package/dist/.setup/{attempt-client-cleanup-CEv1cKwF.mjs → attempt-client-cleanup-B-S7ngS_.mjs} +128 -37
- package/dist/.setup/attempt-workspace-context-BJ5Z_olH.mjs +164 -0
- package/dist/.setup/{auth-binding-DhLWa_7K.mjs → auth-binding-BLWz7stm.mjs} +14 -1
- package/dist/.setup/{auth-cache-key-B2mpaI9D.mjs → auth-cache-key-Dnps4W4_.mjs} +36 -34
- package/dist/.setup/{auth-profile-WqZtZfXN.mjs → auth-profile-B0okYl2D.mjs} +1 -2
- package/dist/.setup/auth-start-options-BPIPeEX8.mjs +44 -0
- package/dist/.setup/{binding-connection-ThoatDcb.mjs → binding-connection-DTtN1KrX.mjs} +2 -2
- package/dist/.setup/{binding-connection.runtime-yoHrABt-.mjs → binding-connection.runtime-6TpgD1M6.mjs} +4 -4
- package/dist/.setup/{bounded-turn-B2HScEgT.mjs → bounded-turn-BNunZPtz.mjs} +15 -18
- package/dist/.setup/bounded-turn-isolation-B8K_ylqk.mjs +14 -0
- package/dist/.setup/{build-state-C7EnDVgr.mjs → build-state-DIQ5O_-S.mjs} +1 -1
- package/dist/.setup/{capabilities-CDXOOFdZ.mjs → capabilities-B3WEZl4e.mjs} +2 -10
- package/dist/.setup/{client-catalog-response-BMgt_4q4.mjs → client-catalog-response-DRvx_wCC.mjs} +1 -1
- package/dist/.setup/{client-Cs08OXVQ.mjs → client-qyUBJlGZ.mjs} +138 -399
- package/dist/.setup/{command-dispatch-B4JuOsOk.mjs → command-dispatch-Btrs1D6f.mjs} +5 -8
- package/dist/.setup/{command-formatters-Bmqvr9tO.mjs → command-formatters-R3ckE3Co.mjs} +29 -61
- package/dist/.setup/{command-handlers-DW7Lx9oH.mjs → command-handlers-DvlCHJch.mjs} +222 -343
- package/dist/.setup/{command-rpc-DixIj3HW.mjs → command-rpc-skzRq4wD.mjs} +15 -18
- package/dist/.setup/compact-8ttks5U5.mjs +776 -0
- package/dist/.setup/{config-BoTP_mrL.mjs → config-DKhXquav.mjs} +26 -28
- package/dist/.setup/{config-options-BvaRs51b.mjs → config-options-CzyWLTJt.mjs} +24 -37
- package/dist/.setup/{config-parsing-CcB9iPoq.mjs → config-parsing-b088LyhT.mjs} +57 -60
- package/dist/.setup/{config-runtime-C8Rw1m1m.mjs → config-runtime-C0NbLms1.mjs} +2 -2
- package/dist/.setup/{config-security-BEReZ6go.mjs → config-security-CE-FcGw9.mjs} +32 -111
- package/dist/.setup/{config-utils-DujwEnhg.mjs → config-utils-D0CXecki.mjs} +3 -13
- package/dist/.setup/context-engine-projection-PezSESth.mjs +387 -0
- package/dist/.setup/{conversation-binding-DP-gMrBP.mjs → conversation-binding-74LaGGH-.mjs} +67 -90
- package/dist/.setup/{conversation-binding-data-CrcyZk6O.mjs → conversation-binding-data-C746z5Pn.mjs} +8 -12
- package/dist/.setup/{conversation-control-uK9Jomlc.mjs → conversation-control-OrN6zuaY.mjs} +8 -8
- package/dist/.setup/{cyber-failover-DYwbmf1o.mjs → cyber-failover-XV0nNRZu.mjs} +1 -1
- package/dist/.setup/{cyber-failover-notice-e9G3J9-e.mjs → cyber-failover-notice-RNpGpTyP.mjs} +1 -1
- package/dist/.setup/{dynamic-tools-BDXl-8Cw.mjs → dynamic-tools-Db2sY5cZ.mjs} +2305 -2606
- package/dist/.setup/{effective-mcp-catalog-CvnvnGIe.mjs → effective-mcp-catalog-Bi6-SQ7i.mjs} +8 -17
- package/dist/.setup/{ephemeral-turn-poidXgek.mjs → ephemeral-turn-DiCS1ijR.mjs} +3 -3
- package/dist/.setup/event-projector-assistant-message-MV_1dj-3.mjs +69 -0
- package/dist/.setup/{event-projector-usage-CnBS8Wa3.mjs → event-projector-usage-03R0I2dM.mjs} +3 -25
- package/dist/.setup/event-projector-values-DJSz8BTk.mjs +106 -0
- package/dist/.setup/incognito-session-DWYapfwf.mjs +2 -0
- package/dist/.setup/{inference-context-D96l9-ew.mjs → inference-context-D-9gWlTR.mjs} +16 -18
- package/dist/.setup/inference-dispatch-CMZtjQyz.mjs +359 -0
- package/dist/.setup/inference-metadata-CgIf7sOx.mjs +81 -0
- package/dist/.setup/{inference-proxy-b-aJMSxm.mjs → inference-proxy-DhcXOgUE.mjs} +174 -214
- package/dist/.setup/{isolated-completion-BIZFhTNG.mjs → isolated-completion-D80IXfQF.mjs} +9 -12
- package/dist/.setup/{managed-binary-BnshlFag.mjs → managed-binary-kiWRhNRE.mjs} +8 -12
- package/dist/.setup/{model-catalog-CfXJf9Ay.mjs → model-catalog-DiC0Tkha.mjs} +11 -10
- package/dist/.setup/model-runtime-BdqzOMkU.mjs +11 -0
- package/dist/.setup/{models-KnqBv0hE.mjs → models-DfLmPV0k.mjs} +9 -18
- package/dist/.setup/{native-auth-rWbGbMn3.mjs → native-auth-CuG53tu4.mjs} +4 -4
- package/dist/.setup/{native-execution-policy-umd0tgh4.mjs → native-execution-policy-BxZJy5mP.mjs} +5 -30
- package/dist/.setup/{native-subagent-monitor-D3filLY2.mjs → native-subagent-monitor-BwkQXf9e.mjs} +4395 -3609
- package/dist/.setup/native-subagent-pending-assignments-DwkCzLvD.mjs +203 -0
- package/dist/.setup/native-task-assignments-DMQ0g3hu.mjs +194 -0
- package/dist/.setup/{node-cli-sessions-r3avj02l.mjs → node-cli-sessions-HC4W6FLI.mjs} +19 -49
- package/dist/.setup/{node-exec-server.runtime-BDwWXVpK.mjs → node-exec-server.runtime-BgBfWQqo.mjs} +3 -6
- package/dist/.setup/{plan-CN3VwfNU.mjs → plan-DPdMk1Oy.mjs} +49 -92
- package/dist/.setup/{plugin-activation-DT3MNtqj.mjs → plugin-activation-cNHRfaxU.mjs} +8 -36
- package/dist/.setup/{plugin-app-cache-key-B2CsSdnV.mjs → plugin-app-cache-key-BL9B5H0L.mjs} +6 -23
- package/dist/.setup/{plugin-inventory-BoRei8Z4.mjs → plugin-inventory-Cky2XJUw.mjs} +21 -21
- package/dist/.setup/{plugin-marketplace-discovery-CDOi8IFs.mjs → plugin-marketplace-discovery-D_dV9FXa.mjs} +18 -24
- package/dist/.setup/{plugin-metadata-cache-Ctmo83k_.mjs → plugin-metadata-cache-BRwtRct9.mjs} +116 -176
- package/dist/.setup/{provider-BOsxQHOM.mjs → provider-D6F_7p1I.mjs} +11 -14
- package/dist/.setup/{provider-capabilities-BfE88FZ5.mjs → provider-capabilities-DG5qbsUZ.mjs} +13 -18
- package/dist/.setup/{rate-limits-CMU3DUD0.mjs → rate-limits-B7-X2TgG.mjs} +9 -31
- package/dist/.setup/{request-D2L0zMrq.mjs → request-BZOfsSXW.mjs} +7 -6
- package/dist/.setup/responses-oauth-twnuTaAa.mjs +93 -0
- package/dist/.setup/rpc-error-BlD2vuzn.mjs +31 -0
- package/dist/.setup/{run-attempt-BHu11r7h.mjs → run-attempt-dYJhjZrp.mjs} +1035 -1023
- package/dist/.setup/{run-attempt-lifecycle-B7JbY4-F.mjs → run-attempt-lifecycle-C-6O3Exn.mjs} +10 -24
- package/dist/.setup/{runtime-artifact-CLZ8udh-.mjs → runtime-artifact-DDQ-HGXf.mjs} +16 -4
- package/dist/.setup/runtime-artifact-connection-D68qQn1m.mjs +78 -0
- package/dist/.setup/sandbox-guard-DjCz2eOw.mjs +126 -0
- package/dist/.setup/scope-DOC1Xjc8.mjs +6 -0
- package/dist/.setup/session-binding-DGCYAfvD.mjs +443 -0
- package/dist/.setup/{session-binding-record-BGoz8wOK.mjs → session-binding-record-Oe9L-CNY.mjs} +52 -130
- package/dist/.setup/{session-binding-sidecars-BlB5EvIS.mjs → session-binding-sidecars-jo6H8dFr.mjs} +196 -17
- package/dist/.setup/{session-catalog-Pno1xGcl.mjs → session-catalog-BFafIiF6.mjs} +185 -350
- package/dist/.setup/{session-catalog-adoption-BI6UTDZT.mjs → session-catalog-adoption-BU_pHWG7.mjs} +7 -6
- package/dist/.setup/{session-catalog-archive-lHBqzhaO.mjs → session-catalog-archive-spHfihri.mjs} +6 -6
- package/dist/.setup/session-catalog-events-BMCFMZw-.mjs +139 -0
- package/dist/.setup/session-catalog-home-id-vlih0B_g.mjs +22 -0
- package/dist/.setup/{session-catalog-index-B9_VQIUz.mjs → session-catalog-index-DwJjnF5k.mjs} +126 -122
- package/dist/.setup/{session-catalog-index-order-hcdz07yN.mjs → session-catalog-index-order-BcQpHks3.mjs} +1 -1
- package/dist/.setup/{session-catalog-index-state-Dgh8ORJm.mjs → session-catalog-index-state-TeO7EyO-.mjs} +3 -2
- package/dist/.setup/session-catalog-limits-DDxOsQeC.mjs +14 -0
- package/dist/.setup/session-catalog-list-request-CvtxrYSe.mjs +170 -0
- package/dist/.setup/session-catalog-native-projection-CuaFZuQE.mjs +178 -0
- package/dist/.setup/{session-catalog-node-adoption-ITddWx_X.mjs → session-catalog-node-adoption-DgXvSGu0.mjs} +10 -27
- package/dist/.setup/{session-catalog-node-continue-6g6qi4A9.mjs → session-catalog-node-continue-DjKXHBbi.mjs} +8 -10
- package/dist/.setup/session-catalog-node-lookup-CtAXI5W5.mjs +56 -0
- package/dist/.setup/{session-catalog-native-projection-DowriLid.mjs → session-catalog-parsing-CPGaPYr-.mjs} +11 -194
- package/dist/.setup/{session-catalog-projection-zK_PUsiE.mjs → session-catalog-projection-CGfzfP93.mjs} +6 -4
- package/dist/.setup/session-catalog-provenance-DoAvktcj.mjs +95 -0
- package/dist/.setup/{session-cli-irrD-uo7.mjs → session-cli-DlmBHYIe.mjs} +9 -22
- package/dist/.setup/{session-history-BrqhSCf9.mjs → session-history-D83lJWHG.mjs} +4 -6
- package/dist/.setup/{session-history-import-D-3wAgOP.mjs → session-history-import-WhX-X33a.mjs} +7 -10
- package/dist/.setup/session-history-read-Ov3StuL4.mjs +133 -0
- package/dist/.setup/{session-history.worker-CaCh0xF_.mjs → session-history.worker-MnPKncqP.mjs} +9 -5
- package/dist/.setup/session-initialization-6aveB9qb.mjs +22 -0
- package/dist/.setup/{session-permission-policy-BI1QK_98.mjs → session-permission-policy-Ci_fVX6y.mjs} +4 -8
- package/dist/.setup/{session-retirement-BH-S6qkJ.mjs → session-retirement-LlYWBKTJ.mjs} +17 -17
- package/dist/.setup/{settled-turn-context-fmwouT5I.mjs → settled-turn-context-D4yj4rxf.mjs} +1 -1
- package/dist/.setup/{settled-turn-finalizer-DiAi6Kx6.mjs → settled-turn-finalizer-DW9W3gza.mjs} +14 -10
- package/dist/.setup/{shared-client-DA4VR4Eb.mjs → shared-client-CJCTeFpQ.mjs} +783 -412
- package/dist/.setup/shared-client-lifecycle-7xgtlo15.mjs +153 -0
- package/dist/.setup/{side-question-BJ1wSDcB.mjs → side-question-BLeGj7TQ.mjs} +79 -143
- package/dist/.setup/{source-CUzJq5WN.mjs → source-CJis_1EF.mjs} +80 -137
- package/dist/.setup/{thread-lifecycle-B3mfz1TG.mjs → thread-lifecycle-_bAbjedG.mjs} +294 -737
- package/dist/.setup/{thread-ownership-DcTtAcXj.mjs → thread-ownership-B6pPt21M.mjs} +45 -10
- package/dist/.setup/{incognito-session-uhrBF6wJ.mjs → thread-ownership-queue-Dp24d7-F.mjs} +1 -2
- package/dist/.setup/{thread-policy-DGuQsuFC.mjs → thread-policy-gNPzzpVp.mjs} +46 -7
- package/dist/.setup/{thread-requests-BLvGkP2R.mjs → thread-requests-OWGOiDaV.mjs} +199 -302
- package/dist/.setup/{thread-resume-DIBXwOpE.mjs → thread-resume-GOry0AYh.mjs} +6 -6
- package/dist/.setup/{timeout-C910MdAB.mjs → timeout-CXOfNoaX.mjs} +1 -35
- package/dist/.setup/{transcript-history-projection-ZZpkFkJ_.mjs → transcript-history-projection-DRSifI-1.mjs} +17 -89
- package/dist/.setup/{transcript-mirror-attestation-CzM-94NC.mjs → transcript-mirror-attestation-YSegaktH.mjs} +3 -4
- package/dist/.setup/{transcript-mirror-BtHDBp1G.mjs → transcript-mirror-kxmCYsuF.mjs} +7 -9
- package/dist/.setup/{transport-stdio-h2VHOskC.mjs → transport-stdio-Bdegpn2V.mjs} +5 -22
- package/dist/.setup/transport-websocket-BTBE-LD9.mjs +211 -0
- package/dist/.setup/{upstream-prompt-provenance-LphB8slG.mjs → upstream-prompt-provenance-fXkKbPVC.mjs} +3 -9
- package/dist/.setup/{upstream-session-fork-BUr4OUbC.mjs → upstream-session-fork-gkdRj2yH.mjs} +23 -23
- package/dist/.setup/{usage-BML0r-ua.mjs → usage-CApUvLOV.mjs} +4 -4
- package/dist/.setup/{usage-limit-error-DUMbefVY.mjs → usage-limit-error-wSMQkbpV.mjs} +4 -19
- package/dist/.setup/{web-search-provider.runtime-CDKlN-Rv.mjs → web-search-provider.runtime-UKgeiBUG.mjs} +8 -19
- package/dist/api.js +9 -11
- package/dist/catalog-page.worker.js +1 -1
- package/dist/cli-metadata.js +1 -1
- package/dist/doctor-contract-api.js +50 -8
- package/dist/harness.js +344 -1
- package/dist/index.js +193 -245
- package/dist/media-understanding-provider.js +9 -22
- package/dist/migration-provider-api.js +1 -1
- package/dist/provider-discovery.js +1 -1
- package/dist/session-history-worker-runtime.js +3 -3
- package/dist/session-history.worker.js +1 -1
- package/openclaw.plugin.json +14 -2
- package/package.json +7 -6
- package/dist/.setup/attempt-workspace-context-DUVEn_CS.mjs +0 -331
- package/dist/.setup/compact-Du5UvtxA.mjs +0 -680
- package/dist/.setup/event-projector-assistant-message-BsruvNrH.mjs +0 -103
- package/dist/.setup/event-projector-items-C6L_5ZiT.mjs +0 -234
- package/dist/.setup/harness-a_MsE4-_.mjs +0 -355
- package/dist/.setup/history-rejection-B4nOXNXF.mjs +0 -13
- package/dist/.setup/image-payload-sanitizer-tupAr-2o.mjs +0 -79
- package/dist/.setup/local-runtime-attribution-B_2mnqhb.mjs +0 -19
- package/dist/.setup/native-subagent-history-0nYYgo0k.mjs +0 -148
- package/dist/.setup/native-subagent-task-ids-wb8CKZGN.mjs +0 -441
- package/dist/.setup/plugin-approval-roundtrip-C0MZzCuP.mjs +0 -122
- package/dist/.setup/rolldown-runtime-8H4AJuhK.mjs +0 -14
- package/dist/.setup/sandbox-guard-C2sRMOEY.mjs +0 -166
- package/dist/.setup/session-binding-Cm0apEbd.mjs +0 -692
- package/dist/.setup/session-catalog-events-Bj6j94E_.mjs +0 -347
- package/dist/.setup/session-history-read-B3ZfSUbF.mjs +0 -50
- package/dist/.setup/session-initialization-rcgbZiid.mjs +0 -75
- package/dist/.setup/thread-history-page-DoVpnHim.mjs +0 -83
|
@@ -17,23 +17,13 @@ function buildCodexMediaUnderstandingProvider(options = {}) {
|
|
|
17
17
|
id: CODEX_MEDIA_PROVIDER_ID,
|
|
18
18
|
capabilities: ["image"],
|
|
19
19
|
defaultModels: { image: DEFAULT_CODEX_IMAGE_MODEL },
|
|
20
|
-
describeImage: async (req) => describeCodexImages({
|
|
20
|
+
describeImage: async ({ buffer, fileName, mime, ...req }) => describeCodexImages({
|
|
21
|
+
...req,
|
|
21
22
|
images: [{
|
|
22
|
-
buffer
|
|
23
|
-
fileName
|
|
24
|
-
mime
|
|
25
|
-
}]
|
|
26
|
-
provider: req.provider,
|
|
27
|
-
model: req.model,
|
|
28
|
-
prompt: req.prompt,
|
|
29
|
-
maxTokens: req.maxTokens,
|
|
30
|
-
timeoutMs: req.timeoutMs,
|
|
31
|
-
...req.signal ? { signal: req.signal } : {},
|
|
32
|
-
profile: req.profile,
|
|
33
|
-
preferredProfile: req.preferredProfile,
|
|
34
|
-
authStore: req.authStore,
|
|
35
|
-
agentDir: req.agentDir,
|
|
36
|
-
cfg: req.cfg
|
|
23
|
+
buffer,
|
|
24
|
+
fileName,
|
|
25
|
+
mime
|
|
26
|
+
}]
|
|
37
27
|
}, options),
|
|
38
28
|
describeImages: async (req) => describeCodexImages(req, options),
|
|
39
29
|
extractStructured: async (req) => extractCodexStructured(req, options)
|
|
@@ -43,7 +33,7 @@ async function describeCodexImages(req, options) {
|
|
|
43
33
|
const model = req.model.trim();
|
|
44
34
|
if (!model) throw new Error("Codex image understanding requires model id.");
|
|
45
35
|
req.signal?.throwIfAborted();
|
|
46
|
-
const { runBoundedCodexAppServerTurn } = await import("./.setup/bounded-turn-
|
|
36
|
+
const { runBoundedCodexAppServerTurn } = await import("./.setup/bounded-turn-BNunZPtz.mjs");
|
|
47
37
|
req.signal?.throwIfAborted();
|
|
48
38
|
const { text } = await runBoundedCodexAppServerTurn({
|
|
49
39
|
config: req.cfg,
|
|
@@ -83,7 +73,7 @@ async function extractCodexStructured(req, options) {
|
|
|
83
73
|
if (req.input.length === 0) throw new Error("Codex structured extraction requires at least one input.");
|
|
84
74
|
if (!req.input.some((entry) => entry.type === "image")) throw new Error("Codex structured extraction requires at least one image input.");
|
|
85
75
|
req.signal?.throwIfAborted();
|
|
86
|
-
const { runBoundedCodexAppServerTurn } = await import("./.setup/bounded-turn-
|
|
76
|
+
const { runBoundedCodexAppServerTurn } = await import("./.setup/bounded-turn-BNunZPtz.mjs");
|
|
87
77
|
req.signal?.throwIfAborted();
|
|
88
78
|
const { text } = await runBoundedCodexAppServerTurn({
|
|
89
79
|
config: req.cfg,
|
|
@@ -101,7 +91,7 @@ async function extractCodexStructured(req, options) {
|
|
|
101
91
|
taskLabel: "structured extraction",
|
|
102
92
|
developerInstructions: "You are OpenClaw's bounded structured-extraction worker. Return only the requested extraction. Do not call tools, edit files, ask follow-up questions, or include secrets.",
|
|
103
93
|
input: buildCodexStructuredInput(req),
|
|
104
|
-
requiredModalities:
|
|
94
|
+
requiredModalities: ["text", "image"],
|
|
105
95
|
isolation: "configured-transport"
|
|
106
96
|
});
|
|
107
97
|
return normalizeStructuredExtractionResult({
|
|
@@ -116,9 +106,6 @@ function buildCodexImagePrompt(req) {
|
|
|
116
106
|
if (req.images.length <= 1) return prompt;
|
|
117
107
|
return `${prompt}\n\nAnalyze all ${req.images.length} images together.`;
|
|
118
108
|
}
|
|
119
|
-
function requiredStructuredModalities() {
|
|
120
|
-
return ["text", "image"];
|
|
121
|
-
}
|
|
122
109
|
function buildCodexStructuredInput(req) {
|
|
123
110
|
return [{
|
|
124
111
|
type: "text",
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as buildCodexMigrationProvider } from "./.setup/provider-
|
|
1
|
+
import { t as buildCodexMigrationProvider } from "./.setup/provider-D6F_7p1I.mjs";
|
|
2
2
|
export { buildCodexMigrationProvider as buildMigrationProvider };
|
|
@@ -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-CuG53tu4.mjs");
|
|
9
9
|
return await probeCodexNativeAuth({
|
|
10
10
|
config,
|
|
11
11
|
env,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as runCodexHistoryWorkerInput } from "./.setup/session-history.worker-
|
|
3
|
-
import { n as resolveCodexHistoryTarget } from "./.setup/session-history-
|
|
1
|
+
import { o as codexHistoryRejectionReason } from "./.setup/session-history-read-Ov3StuL4.mjs";
|
|
2
|
+
import { t as runCodexHistoryWorkerInput } from "./.setup/session-history.worker-MnPKncqP.mjs";
|
|
3
|
+
import { n as resolveCodexHistoryTarget } from "./.setup/session-history-D83lJWHG.mjs";
|
|
4
4
|
import { WorkerTaskPool, resolveRuntimeWorkerArgv, resolveRuntimeWorkerUrl } from "openclaw/plugin-sdk/process-runtime";
|
|
5
5
|
import { isIncognitoSessionKey } from "openclaw/plugin-sdk/session-key-runtime";
|
|
6
6
|
import { fileURLToPath } from "node:url";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as runCodexHistoryWorkerInput } from "./.setup/session-history.worker-
|
|
1
|
+
import { t as runCodexHistoryWorkerInput } from "./.setup/session-history.worker-MnPKncqP.mjs";
|
|
2
2
|
export { runCodexHistoryWorkerInput };
|
package/openclaw.plugin.json
CHANGED
|
@@ -33,6 +33,9 @@
|
|
|
33
33
|
{
|
|
34
34
|
"id": "codex-app-server-sidecars-to-plugin-state"
|
|
35
35
|
},
|
|
36
|
+
{
|
|
37
|
+
"id": "codex-native-task-assignments"
|
|
38
|
+
},
|
|
36
39
|
{
|
|
37
40
|
"id": "codex-app-server-orphaned-session-bindings",
|
|
38
41
|
"doctorOnly": true,
|
|
@@ -261,7 +264,7 @@
|
|
|
261
264
|
"timeoutMs": {
|
|
262
265
|
"type": "number",
|
|
263
266
|
"minimum": 1,
|
|
264
|
-
"default":
|
|
267
|
+
"default": 10000
|
|
265
268
|
}
|
|
266
269
|
}
|
|
267
270
|
},
|
|
@@ -592,6 +595,10 @@
|
|
|
592
595
|
"null"
|
|
593
596
|
]
|
|
594
597
|
},
|
|
598
|
+
"enableUltrafast": {
|
|
599
|
+
"type": "boolean",
|
|
600
|
+
"default": false
|
|
601
|
+
},
|
|
595
602
|
"cyberFailover": {
|
|
596
603
|
"type": "object",
|
|
597
604
|
"additionalProperties": false,
|
|
@@ -752,7 +759,7 @@
|
|
|
752
759
|
},
|
|
753
760
|
"discovery.timeoutMs": {
|
|
754
761
|
"label": "Discovery Timeout",
|
|
755
|
-
"help": "Maximum time to wait for Codex app-server model discovery
|
|
762
|
+
"help": "Maximum time to wait for Codex app-server model discovery. The default allows Codex to finish its remote catalog refresh or native fallback; a timeout leaves native models unavailable until discovery succeeds.",
|
|
756
763
|
"advanced": true
|
|
757
764
|
},
|
|
758
765
|
"computerUse": {
|
|
@@ -976,6 +983,11 @@
|
|
|
976
983
|
"help": "Optional Codex app-server service tier. Use priority, flex, or null. Legacy fast is accepted as priority.",
|
|
977
984
|
"advanced": true
|
|
978
985
|
},
|
|
986
|
+
"appServer.enableUltrafast": {
|
|
987
|
+
"label": "Enable Ultrafast (for supported models)",
|
|
988
|
+
"help": "Use Ultrafast when the selected model advertises access; otherwise keep the current tier. Shared Fast off remains off.",
|
|
989
|
+
"advanced": true
|
|
990
|
+
},
|
|
979
991
|
"appServer.networkProxy": {
|
|
980
992
|
"label": "Network Proxy",
|
|
981
993
|
"help": "Enable Codex permissions-profile networking for app-server commands.",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/codex",
|
|
3
|
-
"version": "2026.9.
|
|
3
|
+
"version": "2026.9.8",
|
|
4
4
|
"description": "OpenClaw Codex app-server harness and native session supervision plugin.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -8,10 +8,11 @@
|
|
|
8
8
|
},
|
|
9
9
|
"type": "module",
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@openai/codex": "0.
|
|
11
|
+
"@openai/codex": "0.158.0",
|
|
12
|
+
"@openclaw/fs-safe": "0.21.1",
|
|
12
13
|
"semver": "7.8.5",
|
|
13
14
|
"smol-toml": "1.8.0",
|
|
14
|
-
"typebox": "1.3.
|
|
15
|
+
"typebox": "1.3.34",
|
|
15
16
|
"ws": "8.21.3",
|
|
16
17
|
"zod": "4.6.5"
|
|
17
18
|
},
|
|
@@ -37,10 +38,10 @@
|
|
|
37
38
|
]
|
|
38
39
|
},
|
|
39
40
|
"compat": {
|
|
40
|
-
"pluginApi": ">=2026.9.
|
|
41
|
+
"pluginApi": ">=2026.9.8"
|
|
41
42
|
},
|
|
42
43
|
"build": {
|
|
43
|
-
"openclawVersion": "2026.9.
|
|
44
|
+
"openclawVersion": "2026.9.8",
|
|
44
45
|
"workerEntries": [
|
|
45
46
|
"./catalog-page.worker.ts"
|
|
46
47
|
]
|
|
@@ -65,7 +66,7 @@
|
|
|
65
66
|
"assets/activity.svg"
|
|
66
67
|
],
|
|
67
68
|
"peerDependencies": {
|
|
68
|
-
"openclaw": ">=2026.9.
|
|
69
|
+
"openclaw": ">=2026.9.8"
|
|
69
70
|
},
|
|
70
71
|
"peerDependenciesMeta": {
|
|
71
72
|
"openclaw": {
|
|
@@ -1,331 +0,0 @@
|
|
|
1
|
-
import { r as flattenCodexDynamicToolFunctions } from "./protocol-CANUwXJ3.mjs";
|
|
2
|
-
import { ct as isMessageOnlyCodexSourceReply } from "./thread-requests-BLvGkP2R.mjs";
|
|
3
|
-
import { readNonBlankString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
4
|
-
import path from "node:path";
|
|
5
|
-
import { resolveAgentWorkspaceDir } from "openclaw/plugin-sdk/agent-runtime";
|
|
6
|
-
import { buildBootstrapContextForFiles, embeddedAgentLog, resolveBootstrapFilesForRun } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
7
|
-
import { resolveBootstrapFilesForPreparation } from "openclaw/plugin-sdk/codex-mcp-projection";
|
|
8
|
-
import { prepareMemorySystemPromptAddition } from "openclaw/plugin-sdk/core";
|
|
9
|
-
//#region extensions/codex/src/app-server/attempt-workspace-context.ts
|
|
10
|
-
/** Workspace snapshots, per-turn workspace context, and memory-tool routing for Codex. */
|
|
11
|
-
const CODEX_NATIVE_PROJECT_DOC_BASENAMES = /* @__PURE__ */ new Set(["agents.md"]);
|
|
12
|
-
const CODEX_TURN_SCOPED_WORKSPACE_DEVELOPER_CONTEXT_BASENAMES = /* @__PURE__ */ new Set([
|
|
13
|
-
"identity.md",
|
|
14
|
-
"soul.md",
|
|
15
|
-
"user.md"
|
|
16
|
-
]);
|
|
17
|
-
const CODEX_WORKSPACE_DEVELOPER_CONTEXT_BASENAMES = new Set(CODEX_TURN_SCOPED_WORKSPACE_DEVELOPER_CONTEXT_BASENAMES);
|
|
18
|
-
const CODEX_MEMORY_CONTEXT_BASENAME = "memory.md";
|
|
19
|
-
const CODEX_MEMORY_TOOL_NAMES = /* @__PURE__ */ new Set(["memory_search", "memory_get"]);
|
|
20
|
-
const CODEX_BOOTSTRAP_CONTEXT_ORDER = /* @__PURE__ */ new Map([
|
|
21
|
-
["soul.md", 10],
|
|
22
|
-
["identity.md", 20],
|
|
23
|
-
["user.md", 30],
|
|
24
|
-
["bootstrap.md", 50],
|
|
25
|
-
["memory.md", 60]
|
|
26
|
-
]);
|
|
27
|
-
/** A child baseline reads the bounded workspace snapshot without invoking admission hooks. */
|
|
28
|
-
async function prepareCodexWorkspaceDeveloperInstructions(params) {
|
|
29
|
-
if (isSameCodexWorkspacePath(params.workspaceDir, params.cwd)) return;
|
|
30
|
-
const files = await resolveBootstrapFilesForPreparation(params);
|
|
31
|
-
return renderCodexWorkspaceDeveloperInstructions({
|
|
32
|
-
files: selectCodexWorkspaceAgentProjectInstructionFiles(buildBootstrapContextForFiles(files, {
|
|
33
|
-
config: params.config,
|
|
34
|
-
agentId: params.agentId
|
|
35
|
-
}), params.workspaceDir),
|
|
36
|
-
header: "## OpenClaw Agent Workspace Instructions",
|
|
37
|
-
preamble: "OpenClaw loaded this bounded snapshot from the configured agent workspace."
|
|
38
|
-
}) ?? "";
|
|
39
|
-
}
|
|
40
|
-
/** Loads and partitions workspace snapshots, turn instructions, and memory references. */
|
|
41
|
-
async function buildCodexWorkspaceBootstrapContext(params) {
|
|
42
|
-
const inheritsAgentWorkspace = (params.executionWorkspace ?? params.resolvedWorkspace) !== params.resolvedWorkspace;
|
|
43
|
-
const injectOpenClawContext = shouldInjectCodexOpenClawPromptContext(params.params);
|
|
44
|
-
const restrictedProjectDocNeedsOpenClawCarrier = params.params.pluginHarnessToolPolicyRestricted === true && !params.params.disableTools && !isMessageOnlyCodexSourceReply(params.params) && params.params.bootstrapContextMode !== "lightweight";
|
|
45
|
-
const includeAgentWorkspaceInstructions = injectOpenClawContext && !params.ringZeroActive && (inheritsAgentWorkspace || restrictedProjectDocNeedsOpenClawCarrier);
|
|
46
|
-
try {
|
|
47
|
-
const promptWorkspace = inheritsAgentWorkspace ? params.resolvedWorkspace : params.effectiveWorkspace;
|
|
48
|
-
const memoryToolsAvailable = params.memoryToolNames.length > 0 && canRouteCodexWorkspaceMemoryThroughTools({
|
|
49
|
-
config: params.params.config,
|
|
50
|
-
agentId: params.params.agentId ?? params.sessionAgentId,
|
|
51
|
-
workspaceDir: inheritsAgentWorkspace ? params.resolvedWorkspace : params.effectiveWorkspace
|
|
52
|
-
});
|
|
53
|
-
const bootstrapFiles = await resolveBootstrapFilesForRun({
|
|
54
|
-
workspaceDir: params.resolvedWorkspace,
|
|
55
|
-
config: params.params.config,
|
|
56
|
-
sessionKey: params.sessionKey,
|
|
57
|
-
sessionId: params.params.sessionId,
|
|
58
|
-
bootstrapUserProfileId: params.params.bootstrapUserProfileId,
|
|
59
|
-
chatType: params.params.chatType,
|
|
60
|
-
agentId: params.params.agentId ?? params.sessionAgentId,
|
|
61
|
-
warn: (message) => embeddedAgentLog.warn(message),
|
|
62
|
-
contextMode: params.params.bootstrapContextMode,
|
|
63
|
-
runKind: params.params.bootstrapContextRunKind
|
|
64
|
-
});
|
|
65
|
-
const memoryToolRoutedBootstrapFiles = memoryToolsAvailable ? selectCodexWorkspaceMemoryReferenceFiles({
|
|
66
|
-
bootstrapFiles,
|
|
67
|
-
workspaceDir: params.resolvedWorkspace
|
|
68
|
-
}) : [];
|
|
69
|
-
const memoryReferenceFiles = memoryToolRoutedBootstrapFiles.map((file) => remapCodexContextFilePath({
|
|
70
|
-
file: toCodexEmbeddedContextFile(file),
|
|
71
|
-
sourceWorkspaceDir: params.resolvedWorkspace,
|
|
72
|
-
targetWorkspaceDir: promptWorkspace
|
|
73
|
-
}));
|
|
74
|
-
const contextFiles = buildBootstrapContextForFiles(memoryToolsAvailable ? bootstrapFiles.filter((file) => !isCodexWorkspaceRootMemoryBootstrapFile({
|
|
75
|
-
file,
|
|
76
|
-
workspaceDir: params.resolvedWorkspace
|
|
77
|
-
})) : bootstrapFiles, {
|
|
78
|
-
config: params.params.config,
|
|
79
|
-
agentId: params.params.agentId ?? params.sessionAgentId,
|
|
80
|
-
warn: (message) => embeddedAgentLog.warn(message)
|
|
81
|
-
}).map((file) => remapCodexContextFilePath({
|
|
82
|
-
file,
|
|
83
|
-
sourceWorkspaceDir: params.resolvedWorkspace,
|
|
84
|
-
targetWorkspaceDir: promptWorkspace
|
|
85
|
-
}));
|
|
86
|
-
const promptContextFiles = selectCodexWorkspacePromptContextFiles(contextFiles, {
|
|
87
|
-
excludeMemory: memoryToolsAvailable,
|
|
88
|
-
memoryWorkspaceDir: params.effectiveWorkspace
|
|
89
|
-
});
|
|
90
|
-
const threadDeveloperInstructionFiles = includeAgentWorkspaceInstructions ? selectCodexWorkspaceAgentProjectInstructionFiles(contextFiles, params.resolvedWorkspace) : [];
|
|
91
|
-
const turnScopedDeveloperInstructionFiles = injectOpenClawContext ? selectCodexWorkspaceTurnScopedDeveloperInstructionFiles(contextFiles) : [];
|
|
92
|
-
return {
|
|
93
|
-
bootstrapFiles,
|
|
94
|
-
contextFiles,
|
|
95
|
-
inheritsAgentWorkspace,
|
|
96
|
-
promptContextFiles,
|
|
97
|
-
threadDeveloperInstructionFiles,
|
|
98
|
-
turnScopedDeveloperInstructionFiles,
|
|
99
|
-
memoryReferenceFiles,
|
|
100
|
-
memoryToolRoutedBootstrapFiles,
|
|
101
|
-
memoryToolNames: [...params.memoryToolNames],
|
|
102
|
-
memoryToolRouted: memoryToolsAvailable,
|
|
103
|
-
promptContext: renderCodexWorkspaceBootstrapPromptContext(promptContextFiles),
|
|
104
|
-
threadDeveloperInstructions: includeAgentWorkspaceInstructions ? params.agentWorkspaceDeveloperInstructions ?? renderCodexWorkspaceDeveloperInstructions({
|
|
105
|
-
files: threadDeveloperInstructionFiles,
|
|
106
|
-
header: "## OpenClaw Agent Workspace Instructions",
|
|
107
|
-
preamble: "OpenClaw loaded this bounded snapshot from the configured agent workspace."
|
|
108
|
-
}) ?? "" : void 0,
|
|
109
|
-
turnScopedDeveloperInstructions: renderCodexWorkspaceCollaborationDeveloperInstructions(turnScopedDeveloperInstructionFiles),
|
|
110
|
-
memoryCollaborationInstructions: injectOpenClawContext ? await renderCodexWorkspaceMemoryCollaborationInstructions({
|
|
111
|
-
files: memoryReferenceFiles,
|
|
112
|
-
toolNames: params.memoryToolNames,
|
|
113
|
-
memoryToolRouted: memoryToolsAvailable,
|
|
114
|
-
citationsMode: params.params.config?.memory?.citations,
|
|
115
|
-
agentId: params.params.agentId ?? params.sessionAgentId,
|
|
116
|
-
agentSessionKey: params.sessionKey,
|
|
117
|
-
sandboxed: params.sandboxed
|
|
118
|
-
}) : void 0
|
|
119
|
-
};
|
|
120
|
-
} catch (error) {
|
|
121
|
-
embeddedAgentLog.warn("failed to load codex workspace bootstrap instructions", { error });
|
|
122
|
-
return {
|
|
123
|
-
bootstrapFiles: [],
|
|
124
|
-
contextFiles: [],
|
|
125
|
-
inheritsAgentWorkspace,
|
|
126
|
-
threadDeveloperInstructions: includeAgentWorkspaceInstructions ? params.agentWorkspaceDeveloperInstructions : void 0
|
|
127
|
-
};
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
function shouldInjectCodexOpenClawPromptContext(params) {
|
|
131
|
-
return !(params.bootstrapContextMode === "lightweight" && params.bootstrapContextRunKind === "cron");
|
|
132
|
-
}
|
|
133
|
-
function renderCodexWorkspaceBootstrapPromptContext(contextFiles) {
|
|
134
|
-
const files = contextFiles;
|
|
135
|
-
if (files.length === 0) return;
|
|
136
|
-
const lines = [
|
|
137
|
-
"OpenClaw loaded these user-editable workspace files for the current turn. Codex loads project-local AGENTS.md natively. When execution uses another folder, OpenClaw supplies the agent workspace AGENTS.md as thread-level developer instructions. SOUL.md, IDENTITY.md, and USER.md are prepared separately from user input and are not repeated here.",
|
|
138
|
-
"",
|
|
139
|
-
"# Project Context",
|
|
140
|
-
"",
|
|
141
|
-
"The following project context files have been loaded:"
|
|
142
|
-
];
|
|
143
|
-
lines.push("");
|
|
144
|
-
for (const file of files) lines.push(`## ${file.path}`, "", file.content, "");
|
|
145
|
-
return lines.join("\n").trim();
|
|
146
|
-
}
|
|
147
|
-
function selectCodexWorkspacePromptContextFiles(contextFiles, options = {}) {
|
|
148
|
-
const excludeMemory = options.excludeMemory ?? true;
|
|
149
|
-
return contextFiles.filter((file) => {
|
|
150
|
-
const baseName = getCodexContextFileBasename(file.path);
|
|
151
|
-
return baseName && !CODEX_NATIVE_PROJECT_DOC_BASENAMES.has(baseName) && !CODEX_WORKSPACE_DEVELOPER_CONTEXT_BASENAMES.has(baseName) && (!excludeMemory || !isCodexWorkspaceRootMemoryContextFile({
|
|
152
|
-
file,
|
|
153
|
-
workspaceDir: options.memoryWorkspaceDir
|
|
154
|
-
})) && !isMissingCodexBootstrapContextFile(file);
|
|
155
|
-
}).toSorted(compareCodexContextFiles);
|
|
156
|
-
}
|
|
157
|
-
function selectCodexWorkspaceTurnScopedDeveloperInstructionFiles(contextFiles) {
|
|
158
|
-
return selectCodexWorkspaceDeveloperInstructionFiles(contextFiles, CODEX_TURN_SCOPED_WORKSPACE_DEVELOPER_CONTEXT_BASENAMES);
|
|
159
|
-
}
|
|
160
|
-
function selectCodexWorkspaceAgentProjectInstructionFiles(contextFiles, agentWorkspaceDir) {
|
|
161
|
-
const agentProjectDocPath = path.join(path.resolve(agentWorkspaceDir), "AGENTS.md");
|
|
162
|
-
return selectCodexWorkspaceDeveloperInstructionFiles(contextFiles, CODEX_NATIVE_PROJECT_DOC_BASENAMES).filter((file) => path.resolve(file.path) === agentProjectDocPath);
|
|
163
|
-
}
|
|
164
|
-
function selectCodexWorkspaceDeveloperInstructionFiles(contextFiles, basenames) {
|
|
165
|
-
return contextFiles.filter((file) => {
|
|
166
|
-
const baseName = getCodexContextFileBasename(file.path);
|
|
167
|
-
return baseName && basenames.has(baseName) && !isMissingCodexBootstrapContextFile(file) && file.content.trim().length > 0;
|
|
168
|
-
}).toSorted(compareCodexContextFiles);
|
|
169
|
-
}
|
|
170
|
-
function renderCodexWorkspaceCollaborationDeveloperInstructions(files) {
|
|
171
|
-
return renderCodexWorkspaceDeveloperInstructions({
|
|
172
|
-
files,
|
|
173
|
-
header: "## OpenClaw Agent Soul",
|
|
174
|
-
preamble: "OpenClaw loaded these workspace instruction files from the active agent workspace. They are the canonical definitions of who you are, how you think and work, and the human you work alongside. Internalize and follow them accordingly." + (files.some((file) => file.personalUser === true) ? " The personal users/<profile-id>/USER.md belongs to this session's selected person (assigned human owner, otherwise human creator). It supplements shared USER.md and overrides conflicting shared preferences, not higher-priority rules. Other participants do not change this personal context." : ""),
|
|
175
|
-
wrapperTag: "AGENT_SOUL"
|
|
176
|
-
});
|
|
177
|
-
}
|
|
178
|
-
function renderCodexWorkspaceDeveloperInstructions(params) {
|
|
179
|
-
const { files, header, preamble, wrapperTag } = params;
|
|
180
|
-
if (files.length === 0) return;
|
|
181
|
-
const lines = [
|
|
182
|
-
header,
|
|
183
|
-
"",
|
|
184
|
-
preamble,
|
|
185
|
-
""
|
|
186
|
-
];
|
|
187
|
-
if (wrapperTag) lines.push(`<${wrapperTag}>`, "");
|
|
188
|
-
for (const file of files) lines.push(`### ${file.path}`, "", file.content, "");
|
|
189
|
-
if (wrapperTag) lines.push(`</${wrapperTag}>`);
|
|
190
|
-
return lines.join("\n").trim();
|
|
191
|
-
}
|
|
192
|
-
function selectCodexWorkspaceMemoryReferenceFiles(params) {
|
|
193
|
-
return params.bootstrapFiles.filter((file) => {
|
|
194
|
-
return isCodexWorkspaceRootMemoryBootstrapFile({
|
|
195
|
-
file,
|
|
196
|
-
workspaceDir: params.workspaceDir
|
|
197
|
-
}) && !file.missing && (file.content ?? "").trim().length > 0;
|
|
198
|
-
}).toSorted(compareCodexBootstrapFiles);
|
|
199
|
-
}
|
|
200
|
-
/**
|
|
201
|
-
* Renders a memory-file reference that points Codex at memory tools instead of
|
|
202
|
-
* embedding MEMORY.md contents.
|
|
203
|
-
*/
|
|
204
|
-
function renderCodexWorkspaceMemoryReference(params) {
|
|
205
|
-
if (params.files.length === 0) return;
|
|
206
|
-
const lines = [
|
|
207
|
-
"## OpenClaw Workspace Memory",
|
|
208
|
-
"",
|
|
209
|
-
`MEMORY.md exists in the active agent workspace as a memory file, not an instruction file. OpenClaw does not paste its contents into native Codex turns; use ${(params.toolNames?.length ? params.toolNames : Array.from(CODEX_MEMORY_TOOL_NAMES)).join(" or ")} when durable memory is relevant and the tools are available.`,
|
|
210
|
-
""
|
|
211
|
-
];
|
|
212
|
-
for (const file of params.files) lines.push(`- ${file.path}`);
|
|
213
|
-
return lines.join("\n").trim();
|
|
214
|
-
}
|
|
215
|
-
async function renderCodexWorkspaceMemoryCollaborationInstructions(params) {
|
|
216
|
-
const sections = [params.memoryToolRouted ? await renderCodexMemoryRecallInstructions({
|
|
217
|
-
toolNames: params.toolNames,
|
|
218
|
-
citationsMode: params.citationsMode,
|
|
219
|
-
agentId: params.agentId,
|
|
220
|
-
agentSessionKey: params.agentSessionKey,
|
|
221
|
-
sandboxed: params.sandboxed
|
|
222
|
-
}) : void 0, renderCodexWorkspaceMemoryReference({
|
|
223
|
-
files: params.files,
|
|
224
|
-
toolNames: params.toolNames
|
|
225
|
-
})].filter(isNonEmptyString);
|
|
226
|
-
return sections.length > 0 ? sections.join("\n\n") : void 0;
|
|
227
|
-
}
|
|
228
|
-
async function renderCodexMemoryRecallInstructions(params) {
|
|
229
|
-
const availableTools = new Set(params.toolNames);
|
|
230
|
-
const memoryPrompt = await prepareMemorySystemPromptAddition({
|
|
231
|
-
availableTools,
|
|
232
|
-
citationsMode: params.citationsMode,
|
|
233
|
-
agentId: params.agentId,
|
|
234
|
-
agentSessionKey: params.agentSessionKey,
|
|
235
|
-
sandboxed: params.sandboxed
|
|
236
|
-
}).catch((error) => {
|
|
237
|
-
embeddedAgentLog.warn("failed to prepare codex memory recall instructions", { error });
|
|
238
|
-
});
|
|
239
|
-
if (!memoryPrompt) return;
|
|
240
|
-
return [memoryPrompt, renderCodexMemoryToolSearchBridge(params.toolNames)].filter(isNonEmptyString).join("\n").trim();
|
|
241
|
-
}
|
|
242
|
-
function renderCodexMemoryToolSearchBridge(toolNames) {
|
|
243
|
-
const memoryToolNames = toolNames.map((name) => normalizeCodexDynamicToolName(name)).filter((name) => CODEX_MEMORY_TOOL_NAMES.has(name)).toSorted();
|
|
244
|
-
if (memoryToolNames.length === 0) return;
|
|
245
|
-
return `Codex may expose ${memoryToolNames.join(" and ")} as deferred tools. When the memory guidance above calls for memory recall, use an already-loaded memory tool directly. If the needed memory tool is deferred and not currently callable, use \`tool_search\` to load it, then call that memory tool.`;
|
|
246
|
-
}
|
|
247
|
-
/** Lists available memory tool names understood by Codex workspace memory routing. */
|
|
248
|
-
function getCodexWorkspaceMemoryToolNames(tools) {
|
|
249
|
-
const availableToolNames = new Set(flattenCodexDynamicToolFunctions(tools).map((tool) => normalizeCodexDynamicToolName(tool.name)));
|
|
250
|
-
return Array.from(CODEX_MEMORY_TOOL_NAMES).filter((name) => availableToolNames.has(name));
|
|
251
|
-
}
|
|
252
|
-
function canRouteCodexWorkspaceMemoryThroughTools(params) {
|
|
253
|
-
if (!params.config) return false;
|
|
254
|
-
return isSameCodexWorkspacePath(resolveAgentWorkspaceDir(params.config, params.agentId), params.workspaceDir);
|
|
255
|
-
}
|
|
256
|
-
function isMissingCodexBootstrapContextFile(file) {
|
|
257
|
-
return file.content.trimStart().startsWith("[MISSING] Expected at:");
|
|
258
|
-
}
|
|
259
|
-
function toCodexEmbeddedContextFile(file) {
|
|
260
|
-
return {
|
|
261
|
-
path: readNonBlankString(file.path) ?? readNonBlankString(file.name) ?? "",
|
|
262
|
-
content: file.content ?? "",
|
|
263
|
-
...file.personalUser === true ? { personalUser: true } : {}
|
|
264
|
-
};
|
|
265
|
-
}
|
|
266
|
-
function isCodexWorkspaceRootMemoryBootstrapFile(params) {
|
|
267
|
-
return isCodexWorkspaceRootMemoryPath({
|
|
268
|
-
filePath: readNonBlankString(params.file.path) ?? readNonBlankString(params.file.name) ?? "",
|
|
269
|
-
workspaceDir: params.workspaceDir
|
|
270
|
-
});
|
|
271
|
-
}
|
|
272
|
-
function isCodexWorkspaceRootMemoryContextFile(params) {
|
|
273
|
-
if (!params.workspaceDir) return false;
|
|
274
|
-
return isCodexWorkspaceRootMemoryPath({
|
|
275
|
-
filePath: params.file.path,
|
|
276
|
-
workspaceDir: params.workspaceDir
|
|
277
|
-
});
|
|
278
|
-
}
|
|
279
|
-
function isCodexWorkspaceRootMemoryPath(params) {
|
|
280
|
-
const filePath = params.filePath.trim();
|
|
281
|
-
if (!filePath) return false;
|
|
282
|
-
return (path.isAbsolute(filePath) ? path.resolve(filePath) : path.resolve(params.workspaceDir, filePath)) === path.join(path.resolve(params.workspaceDir), "MEMORY.md");
|
|
283
|
-
}
|
|
284
|
-
function isSameCodexWorkspacePath(left, right) {
|
|
285
|
-
return path.resolve(left) === path.resolve(right);
|
|
286
|
-
}
|
|
287
|
-
/**
|
|
288
|
-
* Remaps bootstrap file paths from the resolved workspace to the effective Codex
|
|
289
|
-
* workspace while preserving platform path separators.
|
|
290
|
-
*/
|
|
291
|
-
function remapCodexContextFilePath(params) {
|
|
292
|
-
const relativePath = path.relative(params.sourceWorkspaceDir, params.file.path);
|
|
293
|
-
if (!relativePath || relativePath === ".." || relativePath.startsWith(`..${path.sep}`) || path.isAbsolute(relativePath) || params.sourceWorkspaceDir === params.targetWorkspaceDir) return params.file;
|
|
294
|
-
const targetUsesPosixSeparators = params.targetWorkspaceDir.includes("/") && !params.targetWorkspaceDir.includes("\\");
|
|
295
|
-
const normalizedRelativePath = targetUsesPosixSeparators ? relativePath.replaceAll("\\", "/") : relativePath.replaceAll("/", "\\");
|
|
296
|
-
return {
|
|
297
|
-
...params.file,
|
|
298
|
-
path: targetUsesPosixSeparators ? path.posix.join(params.targetWorkspaceDir, normalizedRelativePath) : path.win32.join(params.targetWorkspaceDir, normalizedRelativePath)
|
|
299
|
-
};
|
|
300
|
-
}
|
|
301
|
-
function compareCodexContextFiles(left, right) {
|
|
302
|
-
const leftPath = normalizeCodexContextFilePath(left.path);
|
|
303
|
-
const rightPath = normalizeCodexContextFilePath(right.path);
|
|
304
|
-
const leftBase = getCodexContextFileBasename(left.path);
|
|
305
|
-
const rightBase = getCodexContextFileBasename(right.path);
|
|
306
|
-
const leftOrder = CODEX_BOOTSTRAP_CONTEXT_ORDER.get(leftBase) ?? Number.MAX_SAFE_INTEGER;
|
|
307
|
-
const rightOrder = CODEX_BOOTSTRAP_CONTEXT_ORDER.get(rightBase) ?? Number.MAX_SAFE_INTEGER;
|
|
308
|
-
if (leftOrder !== rightOrder) return leftOrder - rightOrder;
|
|
309
|
-
if (leftBase !== rightBase) return leftBase.localeCompare(rightBase);
|
|
310
|
-
return leftBase === "user.md" ? 0 : leftPath.localeCompare(rightPath);
|
|
311
|
-
}
|
|
312
|
-
function compareCodexBootstrapFiles(left, right) {
|
|
313
|
-
return compareCodexContextFiles(toCodexEmbeddedContextFile(left), toCodexEmbeddedContextFile(right));
|
|
314
|
-
}
|
|
315
|
-
function normalizeCodexContextFilePath(filePath) {
|
|
316
|
-
return filePath.trim().replaceAll("\\", "/").toLowerCase();
|
|
317
|
-
}
|
|
318
|
-
function getCodexContextFileDisplayBasename(filePath) {
|
|
319
|
-
return filePath.trim().replaceAll("\\", "/").split("/").pop()?.trim() ?? "";
|
|
320
|
-
}
|
|
321
|
-
function getCodexContextFileBasename(filePath) {
|
|
322
|
-
return normalizeCodexContextFilePath(filePath).split("/").pop() ?? "";
|
|
323
|
-
}
|
|
324
|
-
function normalizeCodexDynamicToolName(name) {
|
|
325
|
-
return name.trim().toLowerCase();
|
|
326
|
-
}
|
|
327
|
-
function isNonEmptyString(value) {
|
|
328
|
-
return typeof value === "string" && value.length > 0;
|
|
329
|
-
}
|
|
330
|
-
//#endregion
|
|
331
|
-
export { getCodexContextFileDisplayBasename as a, normalizeCodexContextFilePath as c, shouldInjectCodexOpenClawPromptContext as d, getCodexContextFileBasename as i, normalizeCodexDynamicToolName as l, CODEX_NATIVE_PROJECT_DOC_BASENAMES as n, getCodexWorkspaceMemoryToolNames as o, buildCodexWorkspaceBootstrapContext as r, isNonEmptyString as s, CODEX_MEMORY_CONTEXT_BASENAME as t, prepareCodexWorkspaceDeveloperInstructions as u };
|