@openclaw/codex 2026.9.7 → 2026.10.1-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -0
- package/dist/.setup/{account-usage-runtime-DFhbh1zz.mjs → account-usage-runtime-C4GFoef_.mjs} +5 -5
- package/dist/.setup/app-server-policy-Bg4FZw1f.mjs +23 -0
- package/dist/.setup/{apply-D3GcSoSa.mjs → apply-D02fLpgN.mjs} +48 -39
- package/dist/.setup/attempt-client-cleanup-yLjGwbwT.mjs +155 -0
- package/dist/.setup/{attempt-workspace-context-C5HigshI.mjs → attempt-workspace-context-CbSzT6V2.mjs} +11 -15
- package/dist/.setup/{auth-binding-BLWz7stm.mjs → auth-binding-BoMwpuPN.mjs} +17 -25
- package/dist/.setup/{auth-cache-key-Dbvq-QgB.mjs → auth-cache-key-CEd9QlIs.mjs} +244 -82
- package/dist/.setup/{auth-profile-B0okYl2D.mjs → auth-profile-CgHQ8Vot.mjs} +2 -1
- package/dist/.setup/{auth-profile-selection-DFu9e167.mjs → auth-profile-selection-hr8ocLtz.mjs} +5 -7
- package/dist/.setup/{binding-connection-DTtN1KrX.mjs → binding-connection-C-08ez1w.mjs} +2 -2
- package/dist/.setup/{binding-connection.runtime-6TpgD1M6.mjs → binding-connection.runtime-Dn2p-fdy.mjs} +3 -3
- package/dist/.setup/{bounded-turn-CbjoN2OW.mjs → bounded-turn-DlHlNTyS.mjs} +14 -13
- package/dist/.setup/{bounded-turn-isolation-B8K_ylqk.mjs → bounded-turn-isolation-DklXNk3k.mjs} +4 -4
- package/dist/.setup/{build-state-Da1_z0kd.mjs → build-state-CIi3Ckqu.mjs} +1 -1
- package/dist/.setup/{capabilities-B3WEZl4e.mjs → capabilities-kQntafj_.mjs} +1 -1
- package/dist/.setup/{client-N0JpgSzF.mjs → client-CBzEVDyb.mjs} +438 -160
- package/dist/.setup/{client-catalog-response-5HHLdcde.mjs → client-catalog-response-CmvIiDdj.mjs} +57 -25
- package/dist/.setup/command-authorization-AikPDtcc.mjs +15 -0
- package/dist/.setup/{command-dispatch-BeAoaovI.mjs → command-dispatch-BE_RdMou.mjs} +3 -3
- package/dist/.setup/{command-formatters-R3ckE3Co.mjs → command-formatters-DV3DHhdr.mjs} +7 -5
- package/dist/.setup/{command-handlers-ylTMS00z.mjs → command-handlers-DNoRq5Ps.mjs} +82 -144
- package/dist/.setup/{command-rpc-CGJGUQ6Y.mjs → command-rpc-B6xsq2dB.mjs} +23 -31
- package/dist/.setup/{compact-C2WamavS.mjs → compact-BLSAd-ru.mjs} +117 -65
- package/dist/.setup/{plugin-metadata-cache-DsjsL1dr.mjs → computer-use-DpolvQHw.mjs} +66 -203
- package/dist/.setup/{config-DKhXquav.mjs → config-0Gxk3_eq.mjs} +5 -6
- package/dist/.setup/{config-options-CzyWLTJt.mjs → config-options-HG_Rr3W_.mjs} +13 -23
- package/dist/.setup/{config-parsing-b088LyhT.mjs → config-parsing-BQq-CHTF.mjs} +41 -4
- package/dist/.setup/{config-runtime-C0NbLms1.mjs → config-runtime-cUYrqu_a.mjs} +2 -2
- package/dist/.setup/{config-security-CE-FcGw9.mjs → config-security-KAPScztc.mjs} +20 -36
- package/dist/.setup/{context-engine-projection-PezSESth.mjs → context-engine-projection-CsgYSQhW.mjs} +11 -14
- package/dist/.setup/{conversation-binding-3Min8qvP.mjs → conversation-binding-CgSSD1Qz.mjs} +36 -48
- package/dist/.setup/{conversation-binding-data-C746z5Pn.mjs → conversation-binding-data-DJ4ix-W5.mjs} +1 -1
- package/dist/.setup/{conversation-control-CEP8X5JC.mjs → conversation-control-tCg763cI.mjs} +19 -21
- package/dist/.setup/{cyber-failover-XV0nNRZu.mjs → cyber-failover-Bb1J6hS1.mjs} +1 -1
- package/dist/.setup/{cyber-failover-notice-RNpGpTyP.mjs → cyber-failover-notice-XR03ef31.mjs} +1 -1
- package/dist/.setup/doctor-start-options-DPW9JxIE.mjs +63 -0
- package/dist/.setup/dynamic-tool-build-CVrx02cH.mjs +463 -0
- package/dist/.setup/{dynamic-tools-DzlsLUuS.mjs → dynamic-tools-DdsymYGQ.mjs} +238 -878
- package/dist/.setup/{effective-mcp-catalog-CxUtC-xG.mjs → effective-mcp-catalog-BysTBZCW.mjs} +83 -11
- package/dist/.setup/{elicitation-input-DPoK8F7w.mjs → elicitation-input-r9axtppm.mjs} +4 -2
- package/dist/.setup/{ephemeral-turn-CDsPJOa2.mjs → ephemeral-turn-oPKxs3ia.mjs} +2 -2
- package/dist/.setup/{event-projector-assistant-message-CigreO4K.mjs → event-projector-assistant-message-YCL2wspu.mjs} +2 -2
- package/dist/.setup/{event-projector-values-DJSz8BTk.mjs → event-projector-values-DTqZHizf.mjs} +2 -12
- package/dist/.setup/{inference-dispatch-CMZtjQyz.mjs → inference-dispatch-B5UKEUyC.mjs} +12 -21
- package/dist/.setup/{inference-proxy-DhcXOgUE.mjs → inference-proxy-DUO5E2QQ.mjs} +6 -5
- package/dist/.setup/{isolated-completion-Dm3PzxJk.mjs → isolated-completion-D5gbKm6k.mjs} +8 -8
- package/dist/.setup/{managed-binary-kiWRhNRE.mjs → managed-binary-C1VFoVPf.mjs} +31 -38
- package/dist/.setup/mcp-app-session-preparation-CdqsXwZX.mjs +223 -0
- package/dist/.setup/mcp-tool-metadata-j10HhfTC.mjs +43 -0
- package/dist/.setup/{model-catalog-PAuZgJC6.mjs → model-catalog-Dj_uvusa.mjs} +7 -7
- package/dist/.setup/{models-DHXZtVVk.mjs → models-Du_i5G_t.mjs} +10 -7
- package/dist/.setup/{native-auth-CuG53tu4.mjs → native-auth-Cjb9y7IZ.mjs} +5 -6
- package/dist/.setup/{native-execution-policy-BxZJy5mP.mjs → native-execution-policy-ClzpdG3D.mjs} +1 -12
- package/dist/.setup/native-mcp-app-DV7VbfzF.mjs +310 -0
- package/dist/.setup/{native-subagent-monitor-Dpsmf2wz.mjs → native-subagent-monitor-CCEFO6qK.mjs} +235 -318
- package/dist/.setup/{native-subagent-pending-assignments-DwkCzLvD.mjs → native-subagent-pending-assignments-BDqhOdJp.mjs} +0 -4
- package/dist/.setup/{native-task-assignments-DMQ0g3hu.mjs → native-task-assignments-C6KVqiN1.mjs} +9 -8
- package/dist/.setup/{node-cli-sessions-HC4W6FLI.mjs → node-cli-sessions-B5oNDkUS.mjs} +11 -17
- package/dist/.setup/{node-exec-server.runtime-BgBfWQqo.mjs → node-exec-server.runtime-0xSEjKYt.mjs} +2 -2
- package/dist/.setup/{plan-Y-QIvrKB.mjs → plan-CUHSIOep.mjs} +67 -89
- package/dist/.setup/{plugin-activation-cNHRfaxU.mjs → plugin-activation-BcyBv8PG.mjs} +4 -4
- package/dist/.setup/{plugin-app-cache-key-BL9B5H0L.mjs → plugin-app-cache-key-BW8rd98k.mjs} +11 -15
- package/dist/.setup/plugin-approval-roundtrip-uAR-oQfr.mjs +109 -0
- package/dist/.setup/{plugin-inventory-Cky2XJUw.mjs → plugin-inventory-Bf0_piTw.mjs} +29 -51
- package/dist/.setup/{plugin-marketplace-discovery-D_dV9FXa.mjs → plugin-marketplace-discovery-SQPhSuic.mjs} +2 -16
- package/dist/.setup/plugin-metadata-cache-DWnB7VMj.mjs +84 -0
- package/dist/.setup/plugin-thread-config-deadline-CdRzGJt4.mjs +124 -0
- package/dist/.setup/{provider-DH8NSzGt.mjs → provider-BP8ZaZqn.mjs} +4 -4
- package/dist/.setup/provider-capabilities-Z5ZbBxqP.mjs +50 -0
- package/dist/.setup/{rate-limits-B7-X2TgG.mjs → rate-limits-CMPy24F5.mjs} +1 -5
- package/dist/.setup/{request-BHZ1nz8d.mjs → request-BH3FvYUE.mjs} +189 -49
- package/dist/.setup/rpc-error-hmWM21RB.mjs +57 -0
- package/dist/.setup/{run-attempt-D8RZUOzY.mjs → run-attempt-CgvFoW7R.mjs} +553 -727
- package/dist/.setup/{run-attempt-lifecycle-C-6O3Exn.mjs → run-attempt-lifecycle-BuZgVbDA.mjs} +19 -3
- package/dist/.setup/{runtime-artifact-DDQ-HGXf.mjs → runtime-artifact-CUTOOnKw.mjs} +5 -6
- package/dist/.setup/{runtime-artifact-connection-D68qQn1m.mjs → runtime-artifact-connection-CADz3_BY.mjs} +5 -4
- package/dist/.setup/{sandbox-guard-DjCz2eOw.mjs → sandbox-guard-WqE8yPge.mjs} +3 -3
- package/dist/.setup/service-tier-normalization-Cei89SW6.mjs +15 -0
- package/dist/.setup/{session-binding-DGCYAfvD.mjs → session-binding-Ce7BqiPN.mjs} +92 -102
- package/dist/.setup/session-binding-meta-Lkm5Lpf4.mjs +15 -0
- package/dist/.setup/session-binding-record-BZB8RgcF.mjs +179 -0
- package/dist/.setup/session-binding-record-codec-z4ZpDn6E.mjs +216 -0
- package/dist/.setup/{session-binding-sidecars-jo6H8dFr.mjs → session-binding-sidecars-BrdV95Fg.mjs} +8 -2
- package/dist/.setup/{session-catalog-adoption-BU_pHWG7.mjs → session-catalog-adoption-CPIP4S_y.mjs} +34 -18
- package/dist/.setup/{session-catalog-archive-spHfihri.mjs → session-catalog-archive-DcgwvSbF.mjs} +24 -29
- package/dist/.setup/{session-catalog-events-DePDzzjc.mjs → session-catalog-events-KIXOoSnQ.mjs} +5 -5
- package/dist/.setup/{session-catalog-index-CZvDzC6z.mjs → session-catalog-index-DPICGlxr.mjs} +361 -72
- package/dist/.setup/{session-catalog-index-order-BcQpHks3.mjs → session-catalog-index-order-nhyO0wdW.mjs} +1 -1
- package/dist/.setup/{session-catalog-limits-DDxOsQeC.mjs → session-catalog-limits-DEU36Qlo.mjs} +1 -1
- package/dist/.setup/{session-catalog-index-state-TeO7EyO-.mjs → session-catalog-list-request-tXephOB4.mjs} +180 -6
- package/dist/.setup/{session-catalog-native-projection-DjhwGL6x.mjs → session-catalog-native-projection-CTBd4EUm.mjs} +7 -6
- package/dist/.setup/{session-catalog-node-adoption-DgXvSGu0.mjs → session-catalog-node-adoption-7-WEQTB1.mjs} +12 -2
- package/dist/.setup/{session-catalog-node-continue-DjKXHBbi.mjs → session-catalog-node-continue-DLWBwAAO.mjs} +11 -15
- package/dist/.setup/{session-catalog-node-lookup-CtAXI5W5.mjs → session-catalog-node-lookup-Uufckwcm.mjs} +2 -2
- package/dist/.setup/{session-catalog-parsing-CPGaPYr-.mjs → session-catalog-parsing-B-qWJh2x.mjs} +70 -28
- package/dist/.setup/{session-catalog-projection-Cr5qP5Dj.mjs → session-catalog-projection-CE0_Hffi.mjs} +6 -122
- package/dist/.setup/{session-catalog-provenance-DoAvktcj.mjs → session-catalog-provenance-CmsOE5mh.mjs} +6 -1
- package/dist/.setup/{session-cli-Cn_nCqfq.mjs → session-cli-kH4vuGod.mjs} +1 -2
- package/dist/.setup/{session-history-D83lJWHG.mjs → session-history-BogBHKLk.mjs} +1 -1
- package/dist/.setup/{session-history-import-WhX-X33a.mjs → session-history-import-NWKPa4ZO.mjs} +4 -4
- package/dist/.setup/{session-history-read-Ov3StuL4.mjs → session-history-read-CNN8zwbD.mjs} +8 -19
- package/dist/.setup/{session-history.worker-MnPKncqP.mjs → session-history.worker-Cq_4DYgN.mjs} +3 -3
- package/dist/.setup/{session-initialization-6aveB9qb.mjs → session-initialization-D6dtFQkE.mjs} +2 -2
- package/dist/.setup/{session-permission-policy-Ci_fVX6y.mjs → session-permission-policy-BxIUJ0Zd.mjs} +8 -37
- package/dist/.setup/{session-retirement-qMTxkNx2.mjs → session-retirement-aC60o6P3.mjs} +14 -15
- package/dist/.setup/{settled-turn-context-D4yj4rxf.mjs → settled-turn-context-BZsMjkIO.mjs} +13 -6
- package/dist/.setup/{settled-turn-finalizer-BsvEabkw.mjs → settled-turn-finalizer-CDxCejjC.mjs} +8 -8
- package/dist/.setup/{shared-client-DqyTMYug.mjs → shared-client-DJJ3ljH2.mjs} +291 -272
- package/dist/.setup/{provider-capabilities-CAxoF-X1.mjs → shell-dynamic-tools-Do9lIAT1.mjs} +16 -55
- package/dist/.setup/{side-question-C4kCmQy1.mjs → side-question-B7T0_GEC.mjs} +99 -91
- package/dist/.setup/{source-CS_7GFJZ.mjs → source-DH70LqN0.mjs} +24 -40
- package/dist/.setup/{thread-lifecycle-DPflntEJ.mjs → thread-lifecycle-DkcoX9q-.mjs} +262 -305
- package/dist/.setup/{thread-ownership-roNP0l1c.mjs → thread-ownership-0aRHD9iK.mjs} +10 -8
- package/dist/.setup/{thread-policy-DTd-DtkX.mjs → thread-policy-CXZV97TS.mjs} +22 -21
- package/dist/.setup/{thread-requests-B_bRnMGN.mjs → thread-requests-COrRJcZb.mjs} +107 -98
- package/dist/.setup/{thread-resume-CdDaoc7T.mjs → thread-resume-rx7J68Rx.mjs} +10 -18
- package/dist/.setup/{transcript-history-projection-DRSifI-1.mjs → transcript-history-projection-B9a7HwUV.mjs} +11 -16
- package/dist/.setup/{transcript-mirror-kxmCYsuF.mjs → transcript-mirror-BfLRARNL.mjs} +64 -67
- package/dist/.setup/{transport-stdio-Bdegpn2V.mjs → transport-stdio-a0HDa2Mj.mjs} +27 -8
- package/dist/.setup/{transport-websocket-BTBE-LD9.mjs → transport-websocket-zqJ0Cmtn.mjs} +3 -8
- package/dist/.setup/{attempt-client-cleanup-DOP-cW5j.mjs → turn-router-CX1-EoCp.mjs} +75 -170
- package/dist/.setup/{upstream-session-fork-CBeVjBpT.mjs → upstream-session-fork-LYlaQnbt.mjs} +35 -46
- package/dist/.setup/{usage-BMzNxeR_.mjs → usage-Dmx7B0W2.mjs} +4 -4
- package/dist/.setup/{usage-limit-error-QXerDo3i.mjs → usage-limit-error-M8jVnITZ.mjs} +4 -4
- package/dist/.setup/{web-search-provider.runtime-P77OUeoo.mjs → web-search-provider.runtime-CsVmqbFm.mjs} +4 -20
- package/dist/.setup/websocket-data-XlRvt8Ys.mjs +6 -0
- package/dist/.setup/workspace-write-sandbox-probe-DmUHLrrl.mjs +118 -0
- package/dist/api.js +34 -54
- package/dist/catalog-page.worker.js +1 -1
- package/dist/cli-metadata.js +1 -1
- package/dist/doctor-contract-api.js +15 -27
- package/dist/harness.js +37 -22
- package/dist/index.js +2880 -276
- package/dist/media-understanding-provider.js +2 -2
- package/dist/migration-provider-api.js +1 -1
- package/dist/native-session-binding-api.js +2 -0
- package/dist/provider-discovery.js +1 -1
- package/dist/session-history-worker-runtime.js +33 -4
- package/dist/session-history.worker.js +1 -1
- package/openclaw.plugin.json +3 -3
- package/package.json +6 -6
- package/dist/.setup/config-utils-D0CXecki.mjs +0 -57
- package/dist/.setup/incognito-session-DWYapfwf.mjs +0 -2
- package/dist/.setup/managed-thread-store-BMqgThVL.mjs +0 -100
- package/dist/.setup/rpc-error-BlD2vuzn.mjs +0 -31
- package/dist/.setup/session-binding-meta-B7aEMU7g.mjs +0 -6
- package/dist/.setup/session-binding-record-Oe9L-CNY.mjs +0 -375
- package/dist/.setup/session-catalog-4sCdv5qx.mjs +0 -2610
- package/dist/.setup/session-catalog-list-request-CvtxrYSe.mjs +0 -170
- package/dist/.setup/shared-client-lifecycle-DJIgqgMw.mjs +0 -153
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as DEFAULT_CODEX_APP_SERVER_NETWORK_PROXY_PROFILE_PREFIX } from "./config-parsing-b088LyhT.mjs";
|
|
1
|
+
import { b as readRecord, v as readNonEmptyString } from "./config-parsing-BQq-CHTF.mjs";
|
|
3
2
|
import { createHash } from "node:crypto";
|
|
4
3
|
import { AgentHarnessPreflightError } from "openclaw/plugin-sdk/agent-harness-registration";
|
|
5
4
|
import { parse } from "smol-toml";
|
|
@@ -65,17 +64,13 @@ function resolveCodexRequirementsPath(env, platform) {
|
|
|
65
64
|
if (platform === "win32") return `${(readNonEmptyString(env.ProgramData) ?? "C:\\ProgramData").replace(/[\\/]+$/, "")}${WINDOWS_CODEX_REQUIREMENTS_SUFFIX}`;
|
|
66
65
|
return UNIX_CODEX_REQUIREMENTS_PATH;
|
|
67
66
|
}
|
|
68
|
-
function
|
|
69
|
-
const requirements = parseCodexRequirements(content);
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
return parseRequirementsValues(parseCodexRequirements(content)?.allowed_approval_policies, normalizeRequirementsApprovalPolicy);
|
|
76
|
-
}
|
|
77
|
-
function parseAllowedApprovalsReviewersFromCodexRequirements(content) {
|
|
78
|
-
return parseRequirementsValues(parseCodexRequirements(content)?.allowed_approvals_reviewers, (value) => resolveApprovalsReviewer(value.trim().toLowerCase()));
|
|
67
|
+
function parseCodexRequirementsPolicy(content, hostName = "") {
|
|
68
|
+
const requirements = content === void 0 ? void 0 : parseCodexRequirements(content);
|
|
69
|
+
return {
|
|
70
|
+
allowedSandboxModes: parseMatchingRemoteSandboxModesFromCodexRequirements(requirements, hostName) ?? parseRequirementsValues(requirements?.allowed_sandbox_modes, normalizeRequirementsSandboxMode),
|
|
71
|
+
allowedApprovalPolicies: parseRequirementsValues(requirements?.allowed_approval_policies, normalizeRequirementsApprovalPolicy),
|
|
72
|
+
allowedApprovalsReviewers: parseRequirementsValues(requirements?.allowed_approvals_reviewers, (value) => resolveApprovalsReviewer(value.trim().toLowerCase()))
|
|
73
|
+
};
|
|
79
74
|
}
|
|
80
75
|
function parseMatchingRemoteSandboxModesFromCodexRequirements(requirements, hostName) {
|
|
81
76
|
const normalizedHostName = normalizeRequirementsHostName(hostName);
|
|
@@ -130,7 +125,6 @@ function globPatternMatches(value, pattern) {
|
|
|
130
125
|
}
|
|
131
126
|
function normalizeRequirementsApprovalPolicy(value) {
|
|
132
127
|
const normalized = value.trim().toLowerCase();
|
|
133
|
-
if (normalized === "on-failure") return "on-request";
|
|
134
128
|
if (normalized === "untrusted") return normalized;
|
|
135
129
|
return resolveApprovalPolicy(normalized);
|
|
136
130
|
}
|
|
@@ -154,6 +148,9 @@ function selectUserApprovalsReviewer(allowedApprovalsReviewers, execModeRequirin
|
|
|
154
148
|
}
|
|
155
149
|
//#endregion
|
|
156
150
|
//#region extensions/codex/src/app-server/config-policy-json.ts
|
|
151
|
+
function fingerprintCodexPolicy(value) {
|
|
152
|
+
return createHash("sha256").update(stringifyCodexPolicy(value)).digest("hex");
|
|
153
|
+
}
|
|
157
154
|
function stringifyCodexPolicy(value) {
|
|
158
155
|
if (Array.isArray(value)) return `[${value.map((item) => stringifyCodexPolicy(item)).join(",")}]`;
|
|
159
156
|
if (value && typeof value === "object") return `{${Object.entries(value).toSorted(([left], [right]) => left.localeCompare(right)).map(([key, item]) => `${JSON.stringify(key)}:${stringifyCodexPolicy(item)}`).join(",")}}`;
|
|
@@ -188,7 +185,10 @@ function resolveCodexAppServerNetworkProxy(config, sandbox) {
|
|
|
188
185
|
},
|
|
189
186
|
network: networkConfig
|
|
190
187
|
};
|
|
191
|
-
const profileName =
|
|
188
|
+
const profileName = readNonEmptyString(config.profileName) ?? `openclaw-network-${fingerprintCodexPolicy({
|
|
189
|
+
version: 1,
|
|
190
|
+
profile
|
|
191
|
+
}).slice(0, 16)}`;
|
|
192
192
|
const configPatch = {
|
|
193
193
|
"features.network_proxy.enabled": true,
|
|
194
194
|
default_permissions: profileName,
|
|
@@ -196,19 +196,10 @@ function resolveCodexAppServerNetworkProxy(config, sandbox) {
|
|
|
196
196
|
};
|
|
197
197
|
return { networkProxy: {
|
|
198
198
|
profileName,
|
|
199
|
-
configFingerprint:
|
|
199
|
+
configFingerprint: fingerprintCodexPolicy(configPatch),
|
|
200
200
|
configPatch
|
|
201
201
|
} };
|
|
202
202
|
}
|
|
203
|
-
function resolveNetworkProxyPermissionProfileName(config, profile) {
|
|
204
|
-
const explicitProfileName = readNonEmptyString(config.profileName);
|
|
205
|
-
if (explicitProfileName) return explicitProfileName;
|
|
206
|
-
const suffix = createHash("sha256").update(stringifyCodexPolicy({
|
|
207
|
-
version: 1,
|
|
208
|
-
profile
|
|
209
|
-
})).digest("hex").slice(0, 16);
|
|
210
|
-
return `${DEFAULT_CODEX_APP_SERVER_NETWORK_PROXY_PROFILE_PREFIX}-${suffix}`;
|
|
211
|
-
}
|
|
212
203
|
function normalizeNetworkProxyPermissionMap(value) {
|
|
213
204
|
const entries = Object.entries(value ?? {}).map(([key, permission]) => [key.trim(), permission === "none" ? "deny" : permission]).filter(([key]) => key.length > 0);
|
|
214
205
|
return entries.length > 0 ? Object.fromEntries(entries) : void 0;
|
|
@@ -253,13 +244,8 @@ function assertCodexAppServerConnectionSecurity(params) {
|
|
|
253
244
|
if (inferCodexAppServerConnectionClass(params) === "remote" && !hasIdentityBearingWebSocketAuth(params)) throw new Error("remote Codex app-server WebSocket URLs require appServer.authToken or an Authorization header");
|
|
254
245
|
}
|
|
255
246
|
function isLoopbackWebSocketUrl(value) {
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
parsed = new URL(value);
|
|
259
|
-
} catch {
|
|
260
|
-
return false;
|
|
261
|
-
}
|
|
262
|
-
if (parsed.protocol !== "ws:" && parsed.protocol !== "wss:") return false;
|
|
247
|
+
const parsed = URL.parse(value);
|
|
248
|
+
if (parsed?.protocol !== "ws:" && parsed?.protocol !== "wss:") return false;
|
|
263
249
|
return isLoopbackHost(parsed.hostname);
|
|
264
250
|
}
|
|
265
251
|
function hasIdentityBearingWebSocketAuth(params) {
|
|
@@ -279,9 +265,7 @@ function resolveDefaultCodexAppServerPolicy(params) {
|
|
|
279
265
|
mode: "yolo",
|
|
280
266
|
dangerFullAccessAllowed: true
|
|
281
267
|
};
|
|
282
|
-
const allowedSandboxModes = content === void 0 ? void 0 :
|
|
283
|
-
const allowedApprovalPolicies = content === void 0 ? void 0 : parseAllowedApprovalPoliciesFromCodexRequirements(content);
|
|
284
|
-
const allowedApprovalsReviewers = content === void 0 ? void 0 : parseAllowedApprovalsReviewersFromCodexRequirements(content);
|
|
268
|
+
const { allowedSandboxModes, allowedApprovalPolicies, allowedApprovalsReviewers } = parseCodexRequirementsPolicy(content, content === void 0 ? void 0 : readNonEmptyString(params.hostName) ?? hostname());
|
|
285
269
|
const yoloSandboxAllowed = allowedSandboxModes === void 0 || allowedSandboxModes.has("danger-full-access");
|
|
286
270
|
const yoloApprovalAllowed = allowedApprovalPolicies === void 0 || allowedApprovalPolicies.has("never") && !allowedApprovalPolicies.has("untrusted");
|
|
287
271
|
const yoloReviewerAllowed = allowedApprovalsReviewers === void 0 || allowedApprovalsReviewers.has("user");
|
|
@@ -298,4 +282,4 @@ function resolveDefaultCodexAppServerPolicy(params) {
|
|
|
298
282
|
};
|
|
299
283
|
}
|
|
300
284
|
//#endregion
|
|
301
|
-
export {
|
|
285
|
+
export { selectForcedPromptingSandbox as C, selectForcedDangerFullAccessSandbox as S, resolveApprovalPolicy as _, resolveDefaultCodexAppServerPolicy as a, resolveEffectiveOpenClawExecModeForCodexAppServer as b, shouldAutoApproveCodexAppServerApprovals as c, parseCodexRequirementsPolicy as d, readCodexRequirementsToml as f, assertCodexAppServerAllowedForOpenClawExecMode as g, selectUserApprovalsReviewer as h, resolveCodexAppServerNetworkProxy as i, withMcpElicitationsApprovalPolicy as l, selectGuardianApprovalsReviewer as m, hasCodexMcpToolApprovalOverrides as n, resolvePolicyMode as o, selectGuardianApprovalPolicy as p, inferCodexAppServerConnectionClass as r, resolveTransport as s, assertCodexAppServerConnectionSecurity as t, fingerprintCodexPolicy as u, resolveApprovalsReviewer as v, selectGuardianSandbox as w, resolveSandbox as x, resolveCodexPolicyModeForOpenClawExecMode as y };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { asFiniteNumber } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
1
2
|
import { sliceUtf16Safe, truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
2
3
|
import { isOpenClawRuntimeContextCustomMessage } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
3
4
|
import { IMAGE_BLOCK_TOKENS } from "openclaw/plugin-sdk/agent-core";
|
|
@@ -94,8 +95,8 @@ async function projectContextEngineAssemblyForCodex(params) {
|
|
|
94
95
|
}
|
|
95
96
|
/** Resolves rendered context size from a token budget and reserve. */
|
|
96
97
|
function resolveCodexContextEngineProjectionMaxChars(params) {
|
|
97
|
-
const contextTokenBudget =
|
|
98
|
-
if (
|
|
98
|
+
const contextTokenBudget = Math.floor(asFiniteNumber(params.contextTokenBudget) ?? 0);
|
|
99
|
+
if (contextTokenBudget <= 0) return DEFAULT_RENDERED_CONTEXT_CHARS;
|
|
99
100
|
return normalizeRenderedContextMaxChars(resolveProjectionPromptBudgetTokens({
|
|
100
101
|
contextTokenBudget,
|
|
101
102
|
reserveTokens: params.reserveTokens
|
|
@@ -120,8 +121,8 @@ function resolveContinuityCharsPerToken(calibration) {
|
|
|
120
121
|
}
|
|
121
122
|
/** Resolves rendered context size for no-engine continuity projections. */
|
|
122
123
|
function resolveCodexContinuityProjectionMaxChars(params) {
|
|
123
|
-
const contextTokenBudget =
|
|
124
|
-
if (
|
|
124
|
+
const contextTokenBudget = Math.floor(asFiniteNumber(params.contextTokenBudget) ?? 0);
|
|
125
|
+
if (contextTokenBudget <= 0) return DEFAULT_RENDERED_CONTEXT_CHARS;
|
|
125
126
|
return normalizeRenderedContextMaxChars(resolveProjectionPromptBudgetTokens({
|
|
126
127
|
contextTokenBudget,
|
|
127
128
|
reserveTokens: Math.max(DEFAULT_CODEX_PROJECTION_RESERVE_TOKENS, Math.floor(contextTokenBudget * CONTINUITY_PROJECTION_RESERVE_RATIO))
|
|
@@ -296,12 +297,10 @@ function renderToolCallPayload(record) {
|
|
|
296
297
|
return payload;
|
|
297
298
|
}
|
|
298
299
|
function renderToolResultPayload(record) {
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
}
|
|
304
|
-
return payload;
|
|
300
|
+
return {
|
|
301
|
+
...pickToolPayloadMetadata(record),
|
|
302
|
+
...Object.fromEntries(Object.entries(record).filter(([key]) => !TOOL_PAYLOAD_METADATA_KEYS.has(key)).map(([key, value]) => [key, projectToolPayloadValue(value, "content", key)]))
|
|
303
|
+
};
|
|
305
304
|
}
|
|
306
305
|
const TOOL_PAYLOAD_METADATA_KEYS = /* @__PURE__ */ new Set([
|
|
307
306
|
"type",
|
|
@@ -330,9 +329,7 @@ function projectToolPayloadValue(value, mode, key = "", seen = /* @__PURE__ */ n
|
|
|
330
329
|
if (seen.has(value)) return "[Circular]";
|
|
331
330
|
seen.add(value);
|
|
332
331
|
if (Array.isArray(value)) return value.map((entry) => projectToolPayloadValue(entry, mode, key, seen));
|
|
333
|
-
|
|
334
|
-
for (const [childKey, child] of Object.entries(value)) out[childKey] = projectToolPayloadValue(child, mode, childKey, seen);
|
|
335
|
-
return out;
|
|
332
|
+
return Object.fromEntries(Object.entries(value).map(([childKey, child]) => [childKey, projectToolPayloadValue(child, mode, childKey, seen)]));
|
|
336
333
|
}
|
|
337
334
|
return `[${typeof value}]`;
|
|
338
335
|
}
|
|
@@ -384,4 +381,4 @@ function truncateOlderContext(text, maxChars, totalChars = text.length) {
|
|
|
384
381
|
};
|
|
385
382
|
}
|
|
386
383
|
//#endregion
|
|
387
|
-
export { isCodexDurableCustomMessage as a, resolveCodexContextEngineProjectionMaxChars as c, fitCodexProjectedContextForTurnStart as i, resolveCodexContinuityProjectionMaxChars as l, CodexContextAttachmentError as n, neutralizeCodexExplicitMentionSigils as o, buildCodexContinuityCalibration as r, projectContextEngineAssemblyForCodex as s, CODEX_TURN_START_TEXT_INPUT_MAX_CHARS as t };
|
|
384
|
+
export { isCodexDurableCustomMessage as a, resolveCodexContextEngineProjectionMaxChars as c, fitCodexProjectedContextForTurnStart as i, resolveCodexContinuityProjectionMaxChars as l, CodexContextAttachmentError as n, neutralizeCodexExplicitMentionSigils as o, buildCodexContinuityCalibration as r, projectContextEngineAssemblyForCodex as s, CODEX_TURN_START_TEXT_INPUT_MAX_CHARS as t, resolveProjectionPromptBudgetTokens as u };
|
|
@@ -1,31 +1,34 @@
|
|
|
1
1
|
import { i as isJsonObject } from "./protocol-CANUwXJ3.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { d as readCodexPluginConfig } from "./config-parsing-
|
|
5
|
-
import { d as readCodexEffectiveConfig, n as codexSandboxPolicyForTurn } from "./config-options-
|
|
6
|
-
import {
|
|
7
|
-
import { o as resolveCodexDefaultWorkspaceDir } from "./conversation-binding-data-
|
|
8
|
-
import {
|
|
9
|
-
import { n as
|
|
10
|
-
import { n as
|
|
11
|
-
import { n as
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import "./
|
|
17
|
-
import "./
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
2
|
+
import { m as sessionBindingIdentity, n as assertCodexBindingMayBeReplaced } from "./session-binding-record-BZB8RgcF.mjs";
|
|
3
|
+
import { f as readCodexRequirementsToml } from "./config-security-KAPScztc.mjs";
|
|
4
|
+
import { d as readCodexPluginConfig } from "./config-parsing-BQq-CHTF.mjs";
|
|
5
|
+
import { d as readCodexEffectiveConfig, n as codexSandboxPolicyForTurn } from "./config-options-HG_Rr3W_.mjs";
|
|
6
|
+
import { S as retainSharedCodexAppServerClientByInstanceId } from "./auth-cache-key-CEd9QlIs.mjs";
|
|
7
|
+
import { o as resolveCodexDefaultWorkspaceDir } from "./conversation-binding-data-DJ4ix-W5.mjs";
|
|
8
|
+
import { o as isCodexAppServerOverloadError } from "./rpc-error-hmWM21RB.mjs";
|
|
9
|
+
import { n as projectBoundedCodexVisibleSessionHistory } from "./transcript-history-projection-B9a7HwUV.mjs";
|
|
10
|
+
import { n as canUseCodexModelBackedApprovalsReviewerForModel, r as resolveOpenClawExecPolicyForCodexAppServer } from "./config-0Gxk3_eq.mjs";
|
|
11
|
+
import { n as resolveCodexAppServerRuntimeOptions } from "./config-runtime-cUYrqu_a.mjs";
|
|
12
|
+
import { n as normalizeCodexAppServerBindingModelProvider, t as isCodexAppServerNativeAuthProfile } from "./auth-profile-CgHQ8Vot.mjs";
|
|
13
|
+
import { B as isCodexAppServerClientRuntimeLive, F as consumeCodexAppServerLiveThread, G as releaseCodexAppServerLiveThread, R as hasCodexAppServerLiveThread, V as isCodexAppServerLiveThreadClaimed, b as withLeasedCodexAppServerClientStartSelectionRetry, c as getLeasedSharedCodexAppServerClient, m as releaseCodexAppServerClientLease } from "./shared-client-DJJ3ljH2.mjs";
|
|
14
|
+
import { a as isCodexAppServerIndeterminateRequestCancellationError, g as assertCodexThreadStartResponse, p as assertCodexThreadAcceptsDirectInput, u as CodexThreadDirectInputError } from "./client-CBzEVDyb.mjs";
|
|
15
|
+
import { a as isCodexNotificationForTurn, n as getCodexAppServerTurnRouter } from "./turn-router-CX1-EoCp.mjs";
|
|
16
|
+
import { f as unsubscribeCodexThreadBestEffort, l as retireUnsafeCodexTurnClientBestEffort, o as closeCodexStartupClientBestEffort, r as CodexAppServerUnsafeSubscriptionError, s as interruptCodexTurnAndWaitBestEffort } from "./attempt-client-cleanup-yLjGwbwT.mjs";
|
|
17
|
+
import { C as buildCodexProjectDocThreadConfig, Ct as mergeCodexThreadConfigs, _ as CODEX_NATIVE_PERSONALITY_NONE, y as resolveCodexAppServerRequestModelSelection, yt as buildDisabledAppsConfigPatch } from "./thread-requests-COrRJcZb.mjs";
|
|
18
|
+
import "./thread-lifecycle-DkcoX9q-.mjs";
|
|
19
|
+
import "./session-binding-Ce7BqiPN.mjs";
|
|
20
|
+
import { t as resumeCodexAppServerThread } from "./thread-resume-rx7J68Rx.mjs";
|
|
21
|
+
import { a as rollbackCodexAppServerBindingSubscription, c as withExclusiveCodexAppServerThread, n as releaseCodexAppServerBindingSubscription, r as retainCodexAppServerBindingSubscription, t as isSameCodexAppServerThreadOwner } from "./thread-ownership-0aRHD9iK.mjs";
|
|
22
|
+
import { i as resolveCodexSessionPermissionCwd, n as applyCodexSessionPermissionPolicy, t as CODEX_SESSION_PERMISSION_EXEC_MODES } from "./session-permission-policy-BxIUJ0Zd.mjs";
|
|
23
|
+
import { t as resolveCodexAppServerForModelProvider } from "./app-server-policy-Bg4FZw1f.mjs";
|
|
24
|
+
import { f as trackCodexConversationActiveTurn, o as resolveThreadRequestModelProvider, t as buildCodexConversationAgentLookup } from "./conversation-control-tCg763cI.mjs";
|
|
22
25
|
import { asOptionalRecord, normalizeOptionalString, readNonEmptyStringPreservingWhitespace } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
23
26
|
import { resolveSessionAgentIdsStrict } from "openclaw/plugin-sdk/agent-scope-runtime";
|
|
24
27
|
import { resolveTimerTimeoutMs } from "openclaw/plugin-sdk/number-runtime";
|
|
25
28
|
import path from "node:path";
|
|
29
|
+
import { embeddedAgentLog, formatErrorMessage, resolveActiveEmbeddedRunSessionId, resolveSandboxContext } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
26
30
|
import { fileURLToPath } from "node:url";
|
|
27
31
|
import { resolveAgentWorkspaceDir } from "openclaw/plugin-sdk/agent-runtime";
|
|
28
|
-
import { embeddedAgentLog, formatErrorMessage, resolveActiveEmbeddedRunSessionId, resolveSandboxContext } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
29
32
|
import { loadExecApprovals } from "openclaw/plugin-sdk/exec-approvals-runtime";
|
|
30
33
|
import { getSessionEntry, resolveStorePath, resolveTranscriptSessionKeyBySessionId } from "openclaw/plugin-sdk/session-store-runtime";
|
|
31
34
|
import { readVisibleSessionTranscriptMessageEntries } from "openclaw/plugin-sdk/session-transcript-runtime";
|
|
@@ -160,9 +163,11 @@ async function resolveThreadBindingRuntime(params) {
|
|
|
160
163
|
clientOptions
|
|
161
164
|
};
|
|
162
165
|
}
|
|
163
|
-
function
|
|
166
|
+
async function buildConversationThreadRequestForClient(client, resolved, serviceTier, requestOptions) {
|
|
167
|
+
const effectiveConfig = await readCodexEffectiveConfig(client, resolved.workspaceDir, requestOptions());
|
|
168
|
+
requestOptions();
|
|
164
169
|
const { runtime } = resolved;
|
|
165
|
-
const config = buildCodexProjectDocThreadConfig(mergeCodexThreadConfigs(runtime.networkProxy?.configPatch, buildDisabledAppsConfigPatch()),
|
|
170
|
+
const config = buildCodexProjectDocThreadConfig(mergeCodexThreadConfigs(runtime.networkProxy?.configPatch, buildDisabledAppsConfigPatch()), effectiveConfig);
|
|
166
171
|
return {
|
|
167
172
|
cwd: resolved.workspaceDir,
|
|
168
173
|
...resolved.model ? { model: resolved.model } : {},
|
|
@@ -178,11 +183,6 @@ function buildConversationThreadRequest(resolved, serviceTier, effectiveNativeCo
|
|
|
178
183
|
...serviceTier ? { serviceTier } : {}
|
|
179
184
|
};
|
|
180
185
|
}
|
|
181
|
-
async function buildConversationThreadRequestForClient(client, resolved, serviceTier, requestOptions) {
|
|
182
|
-
const effectiveConfig = await readCodexEffectiveConfig(client, resolved.workspaceDir, requestOptions());
|
|
183
|
-
requestOptions();
|
|
184
|
-
return buildConversationThreadRequest(resolved, serviceTier, effectiveConfig);
|
|
185
|
-
}
|
|
186
186
|
async function writeThreadBindingFromResponse(params, resolved, client, response, requestOptions) {
|
|
187
187
|
let retained = false;
|
|
188
188
|
let sameOwner = false;
|
|
@@ -387,24 +387,11 @@ async function projectConversationSourceHistory(source, target, config) {
|
|
|
387
387
|
await clientLease.release();
|
|
388
388
|
}
|
|
389
389
|
}
|
|
390
|
-
function resolveThreadRequestModelProvider(params) {
|
|
391
|
-
const modelProvider = params.modelProvider?.trim();
|
|
392
|
-
if (!modelProvider || modelProvider.toLowerCase() === "codex") return;
|
|
393
|
-
if (isCodexAppServerNativeAuthProfile(params) && modelProvider.toLowerCase() === "openai") return;
|
|
394
|
-
return modelProvider.toLowerCase() === "openai" ? "openai" : modelProvider;
|
|
395
|
-
}
|
|
396
390
|
function resolveModelBackedReviewerPolicyProvider(params) {
|
|
397
391
|
const modelProvider = params.modelProvider?.trim();
|
|
398
392
|
if (modelProvider && modelProvider.toLowerCase() !== "codex") return modelProvider.toLowerCase() === "openai" ? "openai" : modelProvider;
|
|
399
393
|
return isCodexAppServerNativeAuthProfile(params) ? "openai" : void 0;
|
|
400
394
|
}
|
|
401
|
-
function buildCodexConversationAgentLookup(params) {
|
|
402
|
-
const agentDir = params.agentDir?.trim();
|
|
403
|
-
return {
|
|
404
|
-
...agentDir ? { agentDir } : {},
|
|
405
|
-
...params.config ? { config: params.config } : {}
|
|
406
|
-
};
|
|
407
|
-
}
|
|
408
395
|
//#endregion
|
|
409
396
|
//#region extensions/codex/src/conversation-turn-collector.ts
|
|
410
397
|
/** Identifies a timer that expired in the bound-turn collector itself. */
|
|
@@ -425,6 +412,11 @@ function createCodexConversationTurnCollector(threadId) {
|
|
|
425
412
|
const collectReplyText = () => {
|
|
426
413
|
return [...assistantTextByItem.values()].map((text) => text.trim()).filter(Boolean).at(-1) ?? "";
|
|
427
414
|
};
|
|
415
|
+
const completeItem = (item, itemId) => {
|
|
416
|
+
assistantTextByItem.delete(itemId);
|
|
417
|
+
const text = readAssistantReplyText(item);
|
|
418
|
+
if (text?.trim()) assistantTextByItem.set(itemId, text);
|
|
419
|
+
};
|
|
428
420
|
const clearWaitState = () => {
|
|
429
421
|
if (timeout) {
|
|
430
422
|
clearTimeout(timeout);
|
|
@@ -454,9 +446,7 @@ function createCodexConversationTurnCollector(threadId) {
|
|
|
454
446
|
const item = isJsonObject(params.item) ? params.item : void 0;
|
|
455
447
|
if (item?.type === "agentMessage") {
|
|
456
448
|
const itemId = normalizeOptionalString(item.id) ?? normalizeOptionalString(params.itemId) ?? "assistant";
|
|
457
|
-
|
|
458
|
-
const text = readAssistantReplyText(item);
|
|
459
|
-
if (text?.trim()) assistantTextByItem.set(itemId, text);
|
|
449
|
+
completeItem(item, itemId);
|
|
460
450
|
}
|
|
461
451
|
return;
|
|
462
452
|
}
|
|
@@ -471,9 +461,7 @@ function createCodexConversationTurnCollector(threadId) {
|
|
|
471
461
|
for (const item of items) {
|
|
472
462
|
if (!isJsonObject(item) || item.type !== "agentMessage") continue;
|
|
473
463
|
const itemId = normalizeOptionalString(item.id) ?? `assistant-${assistantTextByItem.size + 1}`;
|
|
474
|
-
|
|
475
|
-
const text = readAssistantReplyText(item);
|
|
476
|
-
if (text?.trim()) assistantTextByItem.set(itemId, text);
|
|
464
|
+
completeItem(item, itemId);
|
|
477
465
|
}
|
|
478
466
|
}
|
|
479
467
|
finish();
|
|
@@ -860,7 +848,7 @@ async function runBoundTurnWithMissingThreadRecovery(params) {
|
|
|
860
848
|
}
|
|
861
849
|
}
|
|
862
850
|
function isCodexThreadNotFoundError(error) {
|
|
863
|
-
if (isCodexAppServerOverloadError(error) ||
|
|
851
|
+
if (isCodexAppServerOverloadError(error) || error instanceof CodexAppServerUnsafeSubscriptionError) return false;
|
|
864
852
|
const message = formatErrorMessage(error);
|
|
865
853
|
return /\bthread not found:/iu.test(message) || /\bbound Codex conversation has no thread binding\b/u.test(message);
|
|
866
854
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as __exportAll } from "./session-binding-sidecars-
|
|
1
|
+
import { t as __exportAll } from "./session-binding-sidecars-BrdV95Fg.mjs";
|
|
2
2
|
import { asOptionalRecord, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
3
3
|
import { createHash, randomUUID } from "node:crypto";
|
|
4
4
|
import process from "node:process";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { o as formatCodexDisplayText } from "./command-formatters-
|
|
4
|
-
import "./config-
|
|
5
|
-
import { n as normalizeCodexAppServerBindingModelProvider, t as isCodexAppServerNativeAuthProfile } from "./auth-profile-
|
|
6
|
-
import {
|
|
7
|
-
import "./thread-lifecycle-
|
|
8
|
-
import "./session-binding-
|
|
1
|
+
import { r as bindingStoreKey } from "./session-binding-record-BZB8RgcF.mjs";
|
|
2
|
+
import { m as isCodexFastServiceTier } from "./config-parsing-BQq-CHTF.mjs";
|
|
3
|
+
import { o as formatCodexDisplayText } from "./command-formatters-DV3DHhdr.mjs";
|
|
4
|
+
import "./config-0Gxk3_eq.mjs";
|
|
5
|
+
import { n as normalizeCodexAppServerBindingModelProvider, t as isCodexAppServerNativeAuthProfile } from "./auth-profile-CgHQ8Vot.mjs";
|
|
6
|
+
import { x as resolveCodexBindingModelProviderFallback, y as resolveCodexAppServerRequestModelSelection } from "./thread-requests-COrRJcZb.mjs";
|
|
7
|
+
import "./thread-lifecycle-DkcoX9q-.mjs";
|
|
8
|
+
import "./session-binding-Ce7BqiPN.mjs";
|
|
9
9
|
import { resolveAgentDir } from "openclaw/plugin-sdk/agent-runtime";
|
|
10
10
|
import { getSessionEntry, patchSessionEntry, resolveStorePath } from "openclaw/plugin-sdk/session-store-runtime";
|
|
11
11
|
import { ModelSelectionLockedError, applyModelOverrideWithAuthProfileCompatibility } from "openclaw/plugin-sdk/model-session-runtime";
|
|
@@ -85,16 +85,18 @@ async function setCodexConversationModel(input) {
|
|
|
85
85
|
const params = { ...input };
|
|
86
86
|
const model = params.model.trim();
|
|
87
87
|
if (!model) return "Usage: /codex model <model>";
|
|
88
|
-
const lookup =
|
|
88
|
+
const lookup = buildCodexConversationAgentLookup(params);
|
|
89
89
|
params.assertCurrent();
|
|
90
90
|
const assertCommitAllowed = params.assertCommitAllowed ?? params.assertCurrent;
|
|
91
91
|
const binding = requirePreparedThreadBinding(params.binding);
|
|
92
92
|
if (binding.connectionScope === "supervision") throw new ModelSelectionLockedError();
|
|
93
|
-
const modelProvider =
|
|
93
|
+
const modelProvider = resolveThreadRequestModelProvider({
|
|
94
94
|
authProfileId: binding.authProfileId,
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
95
|
+
modelProvider: resolveCodexBindingModelProviderFallback({
|
|
96
|
+
bindingModel: binding.model,
|
|
97
|
+
bindingModelProvider: binding.modelProvider,
|
|
98
|
+
currentModel: model
|
|
99
|
+
}),
|
|
98
100
|
...lookup
|
|
99
101
|
});
|
|
100
102
|
const modelSelection = resolveCodexAppServerRequestModelSelection({
|
|
@@ -216,22 +218,18 @@ async function patchThreadBinding(bindingStore, identity, threadId, patch, asser
|
|
|
216
218
|
patch
|
|
217
219
|
}, assertCurrent)) throw new Error("Codex thread binding changed while applying the control update.");
|
|
218
220
|
}
|
|
219
|
-
function
|
|
221
|
+
function buildCodexConversationAgentLookup(params) {
|
|
220
222
|
const agentDir = params.agentDir?.trim();
|
|
221
223
|
return {
|
|
222
224
|
...agentDir ? { agentDir } : {},
|
|
223
225
|
...params.config ? { config: params.config } : {}
|
|
224
226
|
};
|
|
225
227
|
}
|
|
226
|
-
function
|
|
227
|
-
const modelProvider =
|
|
228
|
-
currentModel: params.currentModel,
|
|
229
|
-
bindingModel: params.bindingModel,
|
|
230
|
-
bindingModelProvider: params.bindingModelProvider
|
|
231
|
-
})?.trim();
|
|
228
|
+
function resolveThreadRequestModelProvider(params) {
|
|
229
|
+
const modelProvider = params.modelProvider?.trim();
|
|
232
230
|
if (!modelProvider || modelProvider.toLowerCase() === "codex") return;
|
|
233
231
|
if (isCodexAppServerNativeAuthProfile(params) && modelProvider.toLowerCase() === "openai") return;
|
|
234
232
|
return modelProvider.toLowerCase() === "openai" ? "openai" : modelProvider;
|
|
235
233
|
}
|
|
236
234
|
//#endregion
|
|
237
|
-
export {
|
|
235
|
+
export { readCodexConversationActiveTurn as a, setCodexConversationModel as c, stopCodexConversationTurn as d, trackCodexConversationActiveTurn as f, parseCodexPermissionsModeArg as i, setCodexConversationPermissions as l, formatPermissionsMode as n, resolveThreadRequestModelProvider as o, parseCodexFastModeArg as r, setCodexConversationFastMode as s, buildCodexConversationAgentLookup as t, steerCodexConversationTurn as u };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as readCodexPluginConfig } from "./config-parsing-
|
|
1
|
+
import { d as readCodexPluginConfig } from "./config-parsing-BQq-CHTF.mjs";
|
|
2
2
|
import { t as attemptTerminal } from "./attempt-terminal-gZrxQ35N.mjs";
|
|
3
3
|
//#region extensions/codex/src/app-server/cyber-failover.ts
|
|
4
4
|
/**
|
package/dist/.setup/{cyber-failover-notice-RNpGpTyP.mjs → cyber-failover-notice-XR03ef31.mjs}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as emitCodexAppServerEvent } from "./run-attempt-lifecycle-
|
|
1
|
+
import { t as emitCodexAppServerEvent } from "./run-attempt-lifecycle-BuZgVbDA.mjs";
|
|
2
2
|
//#region extensions/codex/src/app-server/cyber-failover-notice.ts
|
|
3
3
|
async function emitCodexCyberNotice(params, notice) {
|
|
4
4
|
await emitCodexAppServerEvent(params, {
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { d as readCodexPluginConfig } from "./config-parsing-BQq-CHTF.mjs";
|
|
2
|
+
import { a as resolveCodexAppServerStartOptionsForAgent } from "./config-options-HG_Rr3W_.mjs";
|
|
3
|
+
import { r as resolveManagedCodexAppServerStartOptions, t as isManagedCodexDesktopCommand } from "./managed-binary-C1VFoVPf.mjs";
|
|
4
|
+
import "./config-0Gxk3_eq.mjs";
|
|
5
|
+
import { n as resolveCodexAppServerRuntimeOptions } from "./config-runtime-cUYrqu_a.mjs";
|
|
6
|
+
import { listAgentIds, resolveAgentDir } from "openclaw/plugin-sdk/agent-scope-runtime";
|
|
7
|
+
import { resolveDefaultModelForAgent } from "openclaw/plugin-sdk/agent-runtime";
|
|
8
|
+
import { resolveEffectiveAgentRuntime } from "openclaw/plugin-sdk/command-auth-native";
|
|
9
|
+
//#region extensions/codex/src/doctor-start-options.ts
|
|
10
|
+
/** Selects the same local agent or passive-catalog command for both Doctor probes. */
|
|
11
|
+
async function resolveCodexDoctorStartOptions(params) {
|
|
12
|
+
const pluginConfig = params.cfg.plugins?.entries?.codex?.config;
|
|
13
|
+
const start = resolveCodexAppServerRuntimeOptions({
|
|
14
|
+
pluginConfig,
|
|
15
|
+
env: params.env
|
|
16
|
+
}).start;
|
|
17
|
+
if (start.transport !== "stdio") return {
|
|
18
|
+
status: "skipped",
|
|
19
|
+
reason: "Codex uses a remote app-server transport."
|
|
20
|
+
};
|
|
21
|
+
if (params.managedOnly && start.commandSource !== "managed") return {
|
|
22
|
+
status: "skipped",
|
|
23
|
+
reason: "Codex uses a custom app-server command."
|
|
24
|
+
};
|
|
25
|
+
const resolveAgentStartOptions = params.deps?.resolveAgentStartOptions ?? resolveCodexAppServerStartOptionsForAgent;
|
|
26
|
+
const resolveStartOptions = params.deps?.resolveStartOptions ?? resolveManagedCodexAppServerStartOptions;
|
|
27
|
+
const isDesktopCommand = params.deps?.isDesktopCommand ?? isManagedCodexDesktopCommand;
|
|
28
|
+
const candidates = [];
|
|
29
|
+
for (const agentId of listAgentIds(params.cfg)) {
|
|
30
|
+
const model = resolveDefaultModelForAgent({
|
|
31
|
+
cfg: params.cfg,
|
|
32
|
+
agentId
|
|
33
|
+
});
|
|
34
|
+
if (resolveEffectiveAgentRuntime({
|
|
35
|
+
cfg: params.cfg,
|
|
36
|
+
provider: model.provider,
|
|
37
|
+
modelId: model.model,
|
|
38
|
+
agentId
|
|
39
|
+
}) !== "codex") continue;
|
|
40
|
+
candidates.push(resolveAgentStartOptions({
|
|
41
|
+
startOptions: start,
|
|
42
|
+
agentDir: resolveAgentDir(params.cfg, agentId, params.env),
|
|
43
|
+
env: params.env
|
|
44
|
+
}));
|
|
45
|
+
}
|
|
46
|
+
if (params.cfg.plugins?.entries?.codex?.enabled === true && readCodexPluginConfig(pluginConfig).sessionCatalog?.enabled !== false) candidates.push({
|
|
47
|
+
...start,
|
|
48
|
+
managedCommandOrder: "package-only"
|
|
49
|
+
});
|
|
50
|
+
for (const candidate of candidates) {
|
|
51
|
+
const resolved = await resolveStartOptions(candidate, { pluginRoot: params.pluginRoot });
|
|
52
|
+
if (!isDesktopCommand(resolved.command)) return {
|
|
53
|
+
status: "selected",
|
|
54
|
+
start: resolved
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
return {
|
|
58
|
+
status: "skipped",
|
|
59
|
+
reason: candidates.length ? "Only desktop-owned Codex commands are configured." : "No local Codex runtime is configured."
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
//#endregion
|
|
63
|
+
export { resolveCodexDoctorStartOptions as t };
|