@openclaw/codex 2026.9.8 → 2026.10.1-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -0
- package/dist/.setup/{account-usage-runtime-G348lY1q.mjs → account-usage-runtime-DGqFpAud.mjs} +5 -5
- package/dist/.setup/app-server-policy-Bg4FZw1f.mjs +23 -0
- package/dist/.setup/{apply-Cqb-YoCS.mjs → apply-CXTudl9p.mjs} +48 -39
- package/dist/.setup/attempt-client-cleanup-BH0hW2xU.mjs +155 -0
- package/dist/.setup/{attempt-workspace-context-BJ5Z_olH.mjs → attempt-workspace-context-BY0jprWJ.mjs} +11 -15
- package/dist/.setup/{auth-binding-BLWz7stm.mjs → auth-binding-BoMwpuPN.mjs} +17 -25
- package/dist/.setup/{auth-cache-key-Dnps4W4_.mjs → auth-cache-key-CGm0UJOr.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-isolation-B8K_ylqk.mjs → bounded-turn-isolation-DklXNk3k.mjs} +4 -4
- package/dist/.setup/{bounded-turn-BNunZPtz.mjs → bounded-turn-pGsfXcmH.mjs} +14 -13
- package/dist/.setup/{build-state-DIQ5O_-S.mjs → build-state-CqQnsg7T.mjs} +1 -1
- package/dist/.setup/{capabilities-B3WEZl4e.mjs → capabilities-kQntafj_.mjs} +1 -1
- package/dist/.setup/{client-qyUBJlGZ.mjs → client-C8lgBOoO.mjs} +438 -160
- package/dist/.setup/{client-catalog-response-DRvx_wCC.mjs → client-catalog-response-Bqp7WG51.mjs} +57 -25
- package/dist/.setup/command-authorization-AikPDtcc.mjs +15 -0
- package/dist/.setup/{command-dispatch-Btrs1D6f.mjs → command-dispatch-DhBbFIQ5.mjs} +3 -3
- package/dist/.setup/{command-formatters-R3ckE3Co.mjs → command-formatters-DV3DHhdr.mjs} +7 -5
- package/dist/.setup/{command-handlers-DvlCHJch.mjs → command-handlers-ztOOzm6O.mjs} +82 -144
- package/dist/.setup/{command-rpc-skzRq4wD.mjs → command-rpc-CuC5fPom.mjs} +23 -31
- package/dist/.setup/{compact-8ttks5U5.mjs → compact-tUb9AYfH.mjs} +117 -65
- package/dist/.setup/{plugin-metadata-cache-BRwtRct9.mjs → computer-use-BBN9y326.mjs} +65 -202
- package/dist/.setup/{config-DKhXquav.mjs → config-0Gxk3_eq.mjs} +5 -6
- package/dist/.setup/{config-options-CzyWLTJt.mjs → config-options-HG_Rr3W_.mjs} +13 -23
- package/dist/.setup/{config-parsing-b088LyhT.mjs → config-parsing-BQq-CHTF.mjs} +41 -4
- package/dist/.setup/{config-runtime-C0NbLms1.mjs → config-runtime-cUYrqu_a.mjs} +2 -2
- package/dist/.setup/{config-security-CE-FcGw9.mjs → config-security-KAPScztc.mjs} +20 -36
- package/dist/.setup/{context-engine-projection-PezSESth.mjs → context-engine-projection-CsgYSQhW.mjs} +11 -14
- package/dist/.setup/{conversation-binding-74LaGGH-.mjs → conversation-binding-B3MNMVzb.mjs} +36 -48
- package/dist/.setup/{conversation-binding-data-C746z5Pn.mjs → conversation-binding-data-DJ4ix-W5.mjs} +1 -1
- package/dist/.setup/{conversation-control-OrN6zuaY.mjs → conversation-control-CYsMlCuE.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-C8xGEXmR.mjs +463 -0
- package/dist/.setup/{dynamic-tools-Db2sY5cZ.mjs → dynamic-tools-DyERJnR6.mjs} +238 -878
- package/dist/.setup/{effective-mcp-catalog-Bi6-SQ7i.mjs → effective-mcp-catalog-C26Mio5l.mjs} +83 -11
- package/dist/.setup/{elicitation-input-DPoK8F7w.mjs → elicitation-input-r9axtppm.mjs} +4 -2
- package/dist/.setup/{ephemeral-turn-DiCS1ijR.mjs → ephemeral-turn-D8VcDTNo.mjs} +2 -2
- package/dist/.setup/{event-projector-assistant-message-MV_1dj-3.mjs → event-projector-assistant-message-BN7CNUB5.mjs} +2 -2
- package/dist/.setup/{event-projector-values-DJSz8BTk.mjs → event-projector-values-DTqZHizf.mjs} +2 -12
- package/dist/.setup/{inference-dispatch-CMZtjQyz.mjs → inference-dispatch-B5UKEUyC.mjs} +12 -21
- package/dist/.setup/{inference-proxy-DhcXOgUE.mjs → inference-proxy-DUO5E2QQ.mjs} +6 -5
- package/dist/.setup/{isolated-completion-D80IXfQF.mjs → isolated-completion-C0jrcplS.mjs} +8 -8
- package/dist/.setup/{managed-binary-kiWRhNRE.mjs → managed-binary-C1VFoVPf.mjs} +31 -38
- package/dist/.setup/mcp-app-session-preparation-BxN0_CYe.mjs +223 -0
- package/dist/.setup/mcp-tool-metadata-j10HhfTC.mjs +43 -0
- package/dist/.setup/{model-catalog-DiC0Tkha.mjs → model-catalog-DZyNeDKG.mjs} +7 -7
- package/dist/.setup/{models-DfLmPV0k.mjs → models-DSseKSMg.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-CqcPVmhH.mjs +310 -0
- package/dist/.setup/{native-subagent-monitor-BwkQXf9e.mjs → native-subagent-monitor-BUYOUp9X.mjs} +235 -318
- package/dist/.setup/{native-subagent-pending-assignments-DwkCzLvD.mjs → native-subagent-pending-assignments-BDqhOdJp.mjs} +0 -4
- package/dist/.setup/{native-task-assignments-DMQ0g3hu.mjs → native-task-assignments-C6KVqiN1.mjs} +9 -8
- package/dist/.setup/{node-cli-sessions-HC4W6FLI.mjs → node-cli-sessions-B5oNDkUS.mjs} +11 -17
- package/dist/.setup/{node-exec-server.runtime-BgBfWQqo.mjs → node-exec-server.runtime-0xSEjKYt.mjs} +2 -2
- package/dist/.setup/{plan-DPdMk1Oy.mjs → plan-BJ37d2Og.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-CuahdPLC.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-B8LGaZNW.mjs +124 -0
- package/dist/.setup/{provider-D6F_7p1I.mjs → provider-BnwHVD_z.mjs} +4 -4
- package/dist/.setup/provider-capabilities-D68Whix6.mjs +50 -0
- package/dist/.setup/{rate-limits-B7-X2TgG.mjs → rate-limits-CMPy24F5.mjs} +1 -5
- package/dist/.setup/{request-BZOfsSXW.mjs → request-jSbhc1sg.mjs} +189 -49
- package/dist/.setup/rpc-error-hmWM21RB.mjs +57 -0
- package/dist/.setup/{run-attempt-dYJhjZrp.mjs → run-attempt-BLDZeYLD.mjs} +553 -727
- package/dist/.setup/{run-attempt-lifecycle-C-6O3Exn.mjs → run-attempt-lifecycle-BuZgVbDA.mjs} +19 -3
- package/dist/.setup/{runtime-artifact-DDQ-HGXf.mjs → runtime-artifact-CUTOOnKw.mjs} +5 -6
- package/dist/.setup/{runtime-artifact-connection-D68qQn1m.mjs → runtime-artifact-connection-CADz3_BY.mjs} +5 -4
- package/dist/.setup/{sandbox-guard-DjCz2eOw.mjs → sandbox-guard-WqE8yPge.mjs} +3 -3
- package/dist/.setup/service-tier-normalization-Cei89SW6.mjs +15 -0
- package/dist/.setup/{session-binding-DGCYAfvD.mjs → session-binding-Ce7BqiPN.mjs} +92 -102
- package/dist/.setup/session-binding-meta-Lkm5Lpf4.mjs +15 -0
- package/dist/.setup/session-binding-record-BZB8RgcF.mjs +179 -0
- package/dist/.setup/session-binding-record-codec-z4ZpDn6E.mjs +216 -0
- package/dist/.setup/{session-binding-sidecars-jo6H8dFr.mjs → session-binding-sidecars-BrdV95Fg.mjs} +8 -2
- package/dist/.setup/{session-catalog-adoption-BU_pHWG7.mjs → session-catalog-adoption-CPIP4S_y.mjs} +34 -18
- package/dist/.setup/{session-catalog-archive-spHfihri.mjs → session-catalog-archive-DcgwvSbF.mjs} +24 -29
- package/dist/.setup/{session-catalog-events-BMCFMZw-.mjs → session-catalog-events-Bdjw9HEn.mjs} +5 -5
- package/dist/.setup/{session-catalog-index-DwJjnF5k.mjs → session-catalog-index-DufISKJ6.mjs} +361 -72
- package/dist/.setup/{session-catalog-index-order-BcQpHks3.mjs → session-catalog-index-order-nhyO0wdW.mjs} +1 -1
- package/dist/.setup/{session-catalog-limits-DDxOsQeC.mjs → session-catalog-limits-DEU36Qlo.mjs} +1 -1
- package/dist/.setup/{session-catalog-index-state-TeO7EyO-.mjs → session-catalog-list-request-tXephOB4.mjs} +180 -6
- package/dist/.setup/{session-catalog-native-projection-CuaFZuQE.mjs → session-catalog-native-projection-D6IiLtMb.mjs} +7 -6
- package/dist/.setup/{session-catalog-node-adoption-DgXvSGu0.mjs → session-catalog-node-adoption-7-WEQTB1.mjs} +12 -2
- package/dist/.setup/{session-catalog-node-continue-DjKXHBbi.mjs → session-catalog-node-continue-DLWBwAAO.mjs} +11 -15
- package/dist/.setup/{session-catalog-node-lookup-CtAXI5W5.mjs → session-catalog-node-lookup-Uufckwcm.mjs} +2 -2
- package/dist/.setup/{session-catalog-parsing-CPGaPYr-.mjs → session-catalog-parsing-B-qWJh2x.mjs} +70 -28
- package/dist/.setup/{session-catalog-projection-CGfzfP93.mjs → session-catalog-projection-8aHNwzWD.mjs} +6 -122
- package/dist/.setup/{session-catalog-provenance-DoAvktcj.mjs → session-catalog-provenance-CmsOE5mh.mjs} +6 -1
- package/dist/.setup/{session-cli-DlmBHYIe.mjs → session-cli-kH4vuGod.mjs} +1 -2
- package/dist/.setup/{session-history-D83lJWHG.mjs → session-history-BogBHKLk.mjs} +1 -1
- package/dist/.setup/{session-history-import-WhX-X33a.mjs → session-history-import-NWKPa4ZO.mjs} +4 -4
- package/dist/.setup/{session-history-read-Ov3StuL4.mjs → session-history-read-CNN8zwbD.mjs} +8 -19
- package/dist/.setup/{session-history.worker-MnPKncqP.mjs → session-history.worker-Cq_4DYgN.mjs} +3 -3
- package/dist/.setup/{session-initialization-6aveB9qb.mjs → session-initialization-D6dtFQkE.mjs} +2 -2
- package/dist/.setup/{session-permission-policy-Ci_fVX6y.mjs → session-permission-policy-BxIUJ0Zd.mjs} +8 -37
- package/dist/.setup/{session-retirement-LlYWBKTJ.mjs → session-retirement-Czbchv_O.mjs} +14 -15
- package/dist/.setup/{settled-turn-context-D4yj4rxf.mjs → settled-turn-context-BZsMjkIO.mjs} +13 -6
- package/dist/.setup/{settled-turn-finalizer-DW9W3gza.mjs → settled-turn-finalizer-DjZsIwbZ.mjs} +8 -8
- package/dist/.setup/{shared-client-CJCTeFpQ.mjs → shared-client-qhyYWbew.mjs} +291 -272
- package/dist/.setup/{provider-capabilities-DG5qbsUZ.mjs → shell-dynamic-tools-D3Brj3g9.mjs} +16 -55
- package/dist/.setup/{side-question-BLeGj7TQ.mjs → side-question-D3NJlgbl.mjs} +99 -91
- package/dist/.setup/{source-CJis_1EF.mjs → source-BYu0T780.mjs} +24 -40
- package/dist/.setup/{thread-lifecycle-_bAbjedG.mjs → thread-lifecycle-Cbz_7ySv.mjs} +262 -305
- package/dist/.setup/{thread-ownership-B6pPt21M.mjs → thread-ownership-DwuSrt3s.mjs} +10 -8
- package/dist/.setup/{thread-policy-gNPzzpVp.mjs → thread-policy-DoNxbhqt.mjs} +22 -21
- package/dist/.setup/{thread-requests-OWGOiDaV.mjs → thread-requests-CL1e8Wmx.mjs} +107 -98
- package/dist/.setup/{thread-resume-GOry0AYh.mjs → thread-resume-BT6NHMkM.mjs} +10 -18
- package/dist/.setup/{transcript-history-projection-DRSifI-1.mjs → transcript-history-projection-B9a7HwUV.mjs} +11 -16
- package/dist/.setup/{transcript-mirror-kxmCYsuF.mjs → transcript-mirror-BfLRARNL.mjs} +64 -67
- package/dist/.setup/{transport-stdio-Bdegpn2V.mjs → transport-stdio-a0HDa2Mj.mjs} +27 -8
- package/dist/.setup/{transport-websocket-BTBE-LD9.mjs → transport-websocket-zqJ0Cmtn.mjs} +3 -8
- package/dist/.setup/{attempt-client-cleanup-B-S7ngS_.mjs → turn-router-sS69wYnI.mjs} +75 -170
- package/dist/.setup/{upstream-session-fork-gkdRj2yH.mjs → upstream-session-fork-ChSld66u.mjs} +35 -46
- package/dist/.setup/{usage-CApUvLOV.mjs → usage-D8e8Xiqf.mjs} +4 -4
- package/dist/.setup/{usage-limit-error-wSMQkbpV.mjs → usage-limit-error-GbT-5NcW.mjs} +4 -4
- package/dist/.setup/{web-search-provider.runtime-UKgeiBUG.mjs → web-search-provider.runtime-dL2GD1Kl.mjs} +4 -20
- package/dist/.setup/websocket-data-XlRvt8Ys.mjs +6 -0
- package/dist/.setup/workspace-write-sandbox-probe-DmUHLrrl.mjs +118 -0
- package/dist/api.js +34 -54
- package/dist/catalog-page.worker.js +1 -1
- package/dist/cli-metadata.js +1 -1
- package/dist/doctor-contract-api.js +15 -27
- package/dist/harness.js +37 -22
- package/dist/index.js +2880 -276
- package/dist/media-understanding-provider.js +2 -2
- package/dist/migration-provider-api.js +1 -1
- package/dist/native-session-binding-api.js +2 -0
- package/dist/provider-discovery.js +1 -1
- package/dist/session-history-worker-runtime.js +33 -4
- package/dist/session-history.worker.js +1 -1
- package/openclaw.plugin.json +3 -3
- package/package.json +6 -6
- package/dist/.setup/config-utils-D0CXecki.mjs +0 -57
- package/dist/.setup/incognito-session-DWYapfwf.mjs +0 -2
- package/dist/.setup/managed-thread-store-BMqgThVL.mjs +0 -100
- package/dist/.setup/rpc-error-BlD2vuzn.mjs +0 -31
- package/dist/.setup/session-binding-meta-B7aEMU7g.mjs +0 -6
- package/dist/.setup/session-binding-record-Oe9L-CNY.mjs +0 -375
- package/dist/.setup/session-catalog-BFafIiF6.mjs +0 -2599
- package/dist/.setup/session-catalog-list-request-CvtxrYSe.mjs +0 -170
- package/dist/.setup/shared-client-lifecycle-7xgtlo15.mjs +0 -153
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
import { m as sessionBindingIdentity } from "./session-binding-record-BZB8RgcF.mjs";
|
|
2
|
+
import { f as readCodexRequirementsToml } from "./config-security-KAPScztc.mjs";
|
|
3
|
+
import { d as readCodexPluginConfig } from "./config-parsing-BQq-CHTF.mjs";
|
|
4
|
+
import { n as isCodexAppServerProxyLaunch } from "./launch-args-DbFCehO7.mjs";
|
|
5
|
+
import { n as buildCodexAppServerRuntimeFingerprint, r as buildCodexPluginAppCacheKey } from "./plugin-app-cache-key-BW8rd98k.mjs";
|
|
6
|
+
import { i as resolveCodexBindingAppServerConnection } from "./binding-connection-C-08ez1w.mjs";
|
|
7
|
+
import { r as resolveOpenClawExecPolicyForCodexAppServer } from "./config-0Gxk3_eq.mjs";
|
|
8
|
+
import { r as resolveCodexAppServerAuthProfileId } from "./auth-profile-CgHQ8Vot.mjs";
|
|
9
|
+
import { I as ensureCodexAppServerClientRuntime, c as getLeasedSharedCodexAppServerClient, h as releaseLeasedSharedCodexAppServerClient } from "./shared-client-qhyYWbew.mjs";
|
|
10
|
+
import { Ct as mergeCodexThreadConfigs, _t as buildCodexPluginThreadConfigInputFingerprint } from "./thread-requests-CL1e8Wmx.mjs";
|
|
11
|
+
import { s as startOrResumeThread } from "./thread-lifecycle-Cbz_7ySv.mjs";
|
|
12
|
+
import { r as resolveCodexSessionBinding } from "./session-binding-Ce7BqiPN.mjs";
|
|
13
|
+
import { a as rollbackCodexAppServerBindingSubscription, r as retainCodexAppServerBindingSubscription, t as isSameCodexAppServerThreadOwner } from "./thread-ownership-DwuSrt3s.mjs";
|
|
14
|
+
import { n as resolveCodexPluginThreadConfigStartupPolicy, t as createCodexPluginThreadConfigStartupProvider } from "./plugin-thread-config-deadline-B8LGaZNW.mjs";
|
|
15
|
+
import { n as applyCodexSessionPermissionPolicy } from "./session-permission-policy-BxIUJ0Zd.mjs";
|
|
16
|
+
import { z } from "zod";
|
|
17
|
+
import { loadCodexBundleMcpThreadConfig } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
18
|
+
import { loadExecApprovals } from "openclaw/plugin-sdk/exec-approvals-runtime";
|
|
19
|
+
import { buildCodexUserMcpServersThreadConfigPatchForRuntime } from "openclaw/plugin-sdk/codex-mcp-projection";
|
|
20
|
+
//#region extensions/codex/src/app-server/mcp-app-session-preparation.ts
|
|
21
|
+
/** Runs the existing thread lifecycle only. This path has no prompt or turn submission. */
|
|
22
|
+
async function prepareCodexMcpAppSession(params) {
|
|
23
|
+
const { preparation } = params;
|
|
24
|
+
if (preparation.version !== 1 || preparation.purpose !== "mcp-app") throw new Error("Unsupported native session preparation capability");
|
|
25
|
+
return preparation.run(async () => {
|
|
26
|
+
const input = preparation.params;
|
|
27
|
+
const assertSourceCurrent = () => {
|
|
28
|
+
params.assertCurrent();
|
|
29
|
+
input.hostCapabilities.assertActive();
|
|
30
|
+
input.abortSignal?.throwIfAborted();
|
|
31
|
+
};
|
|
32
|
+
assertSourceCurrent();
|
|
33
|
+
const pluginConfig = readCodexPluginConfig(params.pluginConfig);
|
|
34
|
+
const admitted = await resolveCodexSessionBinding({
|
|
35
|
+
bindingStore: params.bindingStore,
|
|
36
|
+
identity: sessionBindingIdentity(input),
|
|
37
|
+
config: input.config,
|
|
38
|
+
storePath: input.sessionTarget?.storePath,
|
|
39
|
+
reclaimStale: true,
|
|
40
|
+
signal: input.abortSignal,
|
|
41
|
+
assertCurrent: assertSourceCurrent
|
|
42
|
+
});
|
|
43
|
+
const assertCurrent = () => {
|
|
44
|
+
assertSourceCurrent();
|
|
45
|
+
admitted.authority.assertLegacyCurrent();
|
|
46
|
+
};
|
|
47
|
+
assertCurrent();
|
|
48
|
+
const prepareThread = async () => {
|
|
49
|
+
const execPolicy = resolveOpenClawExecPolicyForCodexAppServer({
|
|
50
|
+
permissionMode: input.permissionMode,
|
|
51
|
+
execOverrides: input.execOverrides,
|
|
52
|
+
approvals: input.permissionMode === "full" ? void 0 : loadExecApprovals(),
|
|
53
|
+
config: input.config,
|
|
54
|
+
agentId: input.agentId
|
|
55
|
+
});
|
|
56
|
+
const { appServer: runtimeOptions } = await resolveCodexBindingAppServerConnection({
|
|
57
|
+
binding: admitted.binding,
|
|
58
|
+
pluginConfig,
|
|
59
|
+
execPolicy,
|
|
60
|
+
modelProvider: input.provider,
|
|
61
|
+
model: input.modelId,
|
|
62
|
+
config: input.config,
|
|
63
|
+
agentDir: input.agentDir,
|
|
64
|
+
requirementsToml: readCodexRequirementsToml({}),
|
|
65
|
+
openClawSandboxActive: false,
|
|
66
|
+
sessionPermissionMode: input.permissionMode,
|
|
67
|
+
assertCurrent
|
|
68
|
+
});
|
|
69
|
+
assertCurrent();
|
|
70
|
+
const appServer = applyCodexSessionPermissionPolicy({
|
|
71
|
+
appServer: runtimeOptions,
|
|
72
|
+
pluginConfig,
|
|
73
|
+
permissionMode: input.permissionMode,
|
|
74
|
+
sessionRoot: input.sessionRoot,
|
|
75
|
+
defaultRoot: input.workspaceDir,
|
|
76
|
+
canUseAutoReview: false
|
|
77
|
+
});
|
|
78
|
+
const environment = input.hostCapabilities.preparedEnvironment?.();
|
|
79
|
+
const startOptions = appServer.start.transport === "stdio" && !isCodexAppServerProxyLaunch(appServer.start.args) ? {
|
|
80
|
+
...appServer.start,
|
|
81
|
+
env: {
|
|
82
|
+
...appServer.start.env,
|
|
83
|
+
...environment?.credentialScrubEnv,
|
|
84
|
+
...environment?.localIdentityEnv,
|
|
85
|
+
...environment?.localProcessEnv
|
|
86
|
+
}
|
|
87
|
+
} : appServer.start;
|
|
88
|
+
const authProfileId = resolveCodexAppServerAuthProfileId({
|
|
89
|
+
authProfileId: input.authProfileId ?? admitted.binding?.authProfileId,
|
|
90
|
+
store: input.authProfileStore,
|
|
91
|
+
config: input.config
|
|
92
|
+
});
|
|
93
|
+
const client = await getLeasedSharedCodexAppServerClient({
|
|
94
|
+
startOptions,
|
|
95
|
+
pluginConfig: params.pluginConfig,
|
|
96
|
+
agentId: input.agentId,
|
|
97
|
+
agentDir: input.agentDir,
|
|
98
|
+
config: input.config,
|
|
99
|
+
authProfileStore: input.authProfileStore,
|
|
100
|
+
authProfileId: admitted.binding?.connectionScope === "supervision" || appServer.start.homeScope === "user" ? null : authProfileId,
|
|
101
|
+
abandonSignal: input.abortSignal,
|
|
102
|
+
assertCurrent,
|
|
103
|
+
timeoutMs: appServer.requestTimeoutMs
|
|
104
|
+
});
|
|
105
|
+
try {
|
|
106
|
+
assertCurrent();
|
|
107
|
+
ensureCodexAppServerClientRuntime(client, {
|
|
108
|
+
agentDir: input.agentDir,
|
|
109
|
+
authProfileId,
|
|
110
|
+
authProfileStore: input.authProfileStore,
|
|
111
|
+
config: input.config
|
|
112
|
+
});
|
|
113
|
+
const pluginPolicy = resolveCodexPluginThreadConfigStartupPolicy({
|
|
114
|
+
pluginConfig,
|
|
115
|
+
nativeToolSurfaceEnabled: true
|
|
116
|
+
});
|
|
117
|
+
const appCacheKey = buildCodexPluginAppCacheKey({
|
|
118
|
+
appServer,
|
|
119
|
+
agentDir: input.agentDir,
|
|
120
|
+
authProfileId,
|
|
121
|
+
appServerVersion: client.getServerVersion(),
|
|
122
|
+
runtimeIdentity: client.getRuntimeIdentity()
|
|
123
|
+
});
|
|
124
|
+
const pluginThreadConfig = pluginPolicy.pluginThreadConfigRequired ? createCodexPluginThreadConfigStartupProvider({
|
|
125
|
+
inputFingerprint: buildCodexPluginThreadConfigInputFingerprint({
|
|
126
|
+
pluginConfig: pluginPolicy.pluginThreadConfigPluginConfig,
|
|
127
|
+
appCacheKey
|
|
128
|
+
}),
|
|
129
|
+
enabledPluginConfigKeys: pluginPolicy.enabledPluginConfigKeys,
|
|
130
|
+
policy: pluginPolicy.resolvedPluginPolicy,
|
|
131
|
+
requestTimeoutMs: appServer.requestTimeoutMs,
|
|
132
|
+
signal: input.abortSignal ?? new AbortController().signal,
|
|
133
|
+
pluginConfig: pluginPolicy.pluginThreadConfigPluginConfig,
|
|
134
|
+
client,
|
|
135
|
+
configCwd: input.workspaceDir,
|
|
136
|
+
appCacheKey
|
|
137
|
+
}) : void 0;
|
|
138
|
+
const bundle = await loadCodexBundleMcpThreadConfig({
|
|
139
|
+
workspaceDir: input.workspaceDir,
|
|
140
|
+
agentId: input.agentId,
|
|
141
|
+
cfg: input.config,
|
|
142
|
+
toolOverrides: input.toolOverrides
|
|
143
|
+
});
|
|
144
|
+
assertCurrent();
|
|
145
|
+
const user = await buildCodexUserMcpServersThreadConfigPatchForRuntime(input.config, {
|
|
146
|
+
agentId: input.agentId,
|
|
147
|
+
agentDir: input.agentDir,
|
|
148
|
+
toolOverrides: input.toolOverrides,
|
|
149
|
+
allowLiteralOAuthProjection: appServer.connectionClass !== "remote"
|
|
150
|
+
});
|
|
151
|
+
assertCurrent();
|
|
152
|
+
const modelSource = input.hostCapabilities.retainSourceAuthority?.();
|
|
153
|
+
let nativeModelAdmission;
|
|
154
|
+
try {
|
|
155
|
+
modelSource?.assertCurrent();
|
|
156
|
+
nativeModelAdmission = modelSource ? modelSource.modelPolicyRequired !== false ? "required" : "optional" : void 0;
|
|
157
|
+
} finally {
|
|
158
|
+
modelSource?.release();
|
|
159
|
+
}
|
|
160
|
+
const bundleConfig = bundle.configPatch ? z.record(z.string(), z.json()).parse(bundle.configPatch) : void 0;
|
|
161
|
+
const thread = await startOrResumeThread({
|
|
162
|
+
client,
|
|
163
|
+
bindingStore: params.bindingStore,
|
|
164
|
+
params: {
|
|
165
|
+
...input,
|
|
166
|
+
authProfileId
|
|
167
|
+
},
|
|
168
|
+
assertCurrent,
|
|
169
|
+
agentId: input.agentId,
|
|
170
|
+
agentDir: input.agentDir,
|
|
171
|
+
cwd: input.workspaceDir,
|
|
172
|
+
appServer,
|
|
173
|
+
dynamicTools: [],
|
|
174
|
+
nativeCodeModeEnabled: false,
|
|
175
|
+
webSearchAllowed: false,
|
|
176
|
+
persistentWebSearchAllowed: false,
|
|
177
|
+
userMcpServersEnabled: false,
|
|
178
|
+
nativeModelAdmission,
|
|
179
|
+
pluginThreadConfig,
|
|
180
|
+
appServerRuntimeFingerprint: buildCodexAppServerRuntimeFingerprint({
|
|
181
|
+
appServer,
|
|
182
|
+
appServerVersion: client.getServerVersion(),
|
|
183
|
+
runtimeIdentity: client.getRuntimeIdentity()
|
|
184
|
+
}),
|
|
185
|
+
config: mergeCodexThreadConfigs(bundleConfig, user),
|
|
186
|
+
signal: input.abortSignal
|
|
187
|
+
});
|
|
188
|
+
let retained = false;
|
|
189
|
+
try {
|
|
190
|
+
retained = await params.bindingStore.withLease(sessionBindingIdentity(input), async () => {
|
|
191
|
+
assertCurrent();
|
|
192
|
+
if (!isSameCodexAppServerThreadOwner(params.bindingStore.read(sessionBindingIdentity(input)), thread)) return false;
|
|
193
|
+
thread.liveThreadOwnership?.assertCurrent();
|
|
194
|
+
return await retainCodexAppServerBindingSubscription(client, thread.threadId, {
|
|
195
|
+
release: thread.liveThreadOwnership?.release,
|
|
196
|
+
configFingerprint: thread.liveThreadConfigFingerprint,
|
|
197
|
+
serviceTier: thread.liveThreadOwnership?.serviceTier,
|
|
198
|
+
ephemeralPolicy: thread.liveThreadEphemeralPolicy
|
|
199
|
+
});
|
|
200
|
+
});
|
|
201
|
+
if (!retained) throw new Error("Native MCP session ownership changed before retention");
|
|
202
|
+
return thread;
|
|
203
|
+
} finally {
|
|
204
|
+
if (!retained) {
|
|
205
|
+
if (thread.liveThreadOwnership) await thread.liveThreadOwnership.release(thread.threadId);
|
|
206
|
+
else await rollbackCodexAppServerBindingSubscription(client, thread.threadId, false);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
} finally {
|
|
210
|
+
releaseLeasedSharedCodexAppServerClient(client);
|
|
211
|
+
}
|
|
212
|
+
};
|
|
213
|
+
if (admitted.binding) return await prepareThread();
|
|
214
|
+
const thread = await params.bindingStore.withLease(sessionBindingIdentity(input), async () => {
|
|
215
|
+
assertCurrent();
|
|
216
|
+
return params.bindingStore.read(sessionBindingIdentity(input)) ?? await prepareThread();
|
|
217
|
+
});
|
|
218
|
+
assertCurrent();
|
|
219
|
+
return thread;
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
//#endregion
|
|
223
|
+
export { prepareCodexMcpAppSession };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { r as parseCodexPluginMarketplaceId } from "./plugin-marketplace-discovery-SQPhSuic.mjs";
|
|
2
|
+
import { asOptionalRecord, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
3
|
+
import { normalizeMcpCodexToolAnnotations, readMcpAppIcons, readMcpAppSettingsCapability, readMcpAppToolExtensions } from "openclaw/plugin-sdk/codex-mcp-projection";
|
|
4
|
+
//#region extensions/codex/src/app-server/mcp-tool-metadata.ts
|
|
5
|
+
function projectCodexMcpServerMetadata(status) {
|
|
6
|
+
const plugin = status.pluginId ? parseCodexPluginMarketplaceId(status.pluginId) : void 0;
|
|
7
|
+
return {
|
|
8
|
+
serverName: status.name,
|
|
9
|
+
launchSummary: "Codex native MCP connection",
|
|
10
|
+
...status.pluginId ? {
|
|
11
|
+
pluginId: plugin?.pluginName ?? status.pluginId,
|
|
12
|
+
marketplace: plugin?.marketplaceName
|
|
13
|
+
} : {},
|
|
14
|
+
title: status.serverInfo?.title ?? void 0,
|
|
15
|
+
icons: readMcpAppIcons(status.serverInfo?.icons),
|
|
16
|
+
settings: readMcpAppSettingsCapability(status.serverCapabilities),
|
|
17
|
+
toolCount: Object.keys(status.tools).length
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
function projectCodexMcpToolMetadata(toolName, raw) {
|
|
21
|
+
const tool = asOptionalRecord(raw);
|
|
22
|
+
return {
|
|
23
|
+
title: normalizeOptionalString(tool?.title) ?? normalizeOptionalString(asOptionalRecord(tool?.annotations)?.title),
|
|
24
|
+
fallbackDescription: normalizeOptionalString(tool?.description) ?? toolName,
|
|
25
|
+
appExtensions: readMcpAppToolExtensions(tool ?? {}),
|
|
26
|
+
codexAnnotations: normalizeMcpCodexToolAnnotations(tool?.annotations),
|
|
27
|
+
uiResourceUri: normalizeOptionalString(asOptionalRecord(asOptionalRecord(tool?._meta)?.ui)?.resourceUri)
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
/** Hosted app ownership is authoritative only on metadata supplied by Codex. */
|
|
31
|
+
function readCodexMcpToolConnectorId(tool) {
|
|
32
|
+
const metadata = asOptionalRecord(asOptionalRecord(tool)?.["_meta"]);
|
|
33
|
+
return normalizeOptionalString(metadata?.connector_id) ?? normalizeOptionalString(metadata?.connectorId);
|
|
34
|
+
}
|
|
35
|
+
/** Preserve MCP App visibility so model-only tools cannot become widget authority. */
|
|
36
|
+
function readCodexMcpToolUiVisibility(tool) {
|
|
37
|
+
const metadata = asOptionalRecord(asOptionalRecord(tool)?.["_meta"]);
|
|
38
|
+
const visibility = asOptionalRecord(metadata?.ui)?.visibility;
|
|
39
|
+
if (!Array.isArray(visibility)) return;
|
|
40
|
+
return [...new Set(visibility.filter((value) => value === "app" || value === "model"))].toSorted();
|
|
41
|
+
}
|
|
42
|
+
//#endregion
|
|
43
|
+
export { readCodexMcpToolUiVisibility as i, projectCodexMcpToolMetadata as n, readCodexMcpToolConnectorId as r, projectCodexMcpServerMetadata as t };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { t as buildCodexRuntimeModelParams } from "./model-runtime-BdqzOMkU.mjs";
|
|
2
|
-
import { d as readCodexPluginConfig } from "./config-parsing-
|
|
2
|
+
import { d as readCodexPluginConfig } from "./config-parsing-BQq-CHTF.mjs";
|
|
3
3
|
import { n as isCodexAppServerProxyLaunch } from "./launch-args-DbFCehO7.mjs";
|
|
4
|
-
import {
|
|
5
|
-
import { n as resolveCodexAppServerRuntimeOptions } from "./config-runtime-
|
|
6
|
-
import { a as resolveCodexAppServerAuthProfileStore, r as resolveCodexAppServerAuthProfileId } from "./auth-profile-
|
|
7
|
-
import { r as captureSharedCodexAppServerCatalogLifetime } from "./shared-client-
|
|
4
|
+
import { a as withCodexAppServerJsonClient } from "./request-jSbhc1sg.mjs";
|
|
5
|
+
import { n as resolveCodexAppServerRuntimeOptions } from "./config-runtime-cUYrqu_a.mjs";
|
|
6
|
+
import { a as resolveCodexAppServerAuthProfileStore, r as resolveCodexAppServerAuthProfileId } from "./auth-profile-CgHQ8Vot.mjs";
|
|
7
|
+
import { r as captureSharedCodexAppServerCatalogLifetime } from "./shared-client-qhyYWbew.mjs";
|
|
8
8
|
import { i as isCodexResponsesOAuthCredential } from "./responses-oauth-twnuTaAa.mjs";
|
|
9
|
-
import { n as listAllCodexAppServerModels } from "./models-
|
|
10
|
-
import { probeCodexNativeAuth } from "./native-auth-
|
|
9
|
+
import { n as listAllCodexAppServerModels } from "./models-DSseKSMg.mjs";
|
|
10
|
+
import { probeCodexNativeAuth } from "./native-auth-Cjb9y7IZ.mjs";
|
|
11
11
|
//#region extensions/codex/src/app-server/model-catalog.ts
|
|
12
12
|
const INPUT_TYPES = /* @__PURE__ */ new Set([
|
|
13
13
|
"text",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { d as assertCodexModelListResponse } from "./client-C8lgBOoO.mjs";
|
|
2
2
|
import { normalizeOptionalString, normalizeUniqueTrimmedStringList } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
3
3
|
//#region extensions/codex/src/app-server/models.ts
|
|
4
4
|
const DEFAULT_MODEL_DISCOVERY_TIMEOUT_MS = 1e4;
|
|
@@ -32,8 +32,8 @@ async function withCodexAppServerModelRequest(options, run) {
|
|
|
32
32
|
if (options.request) return await run(options.request);
|
|
33
33
|
const timeoutMs = options.timeoutMs ?? 1e4;
|
|
34
34
|
const useSharedClient = options.sharedClient !== false;
|
|
35
|
-
const { createIsolatedCodexAppServerClient, getLeasedSharedCodexAppServerClient, releaseLeasedSharedCodexAppServerClient } = await import("./shared-client-
|
|
36
|
-
const { requestCodexAppServerClientJson } = await import("./request-
|
|
35
|
+
const { createIsolatedCodexAppServerClient, getLeasedSharedCodexAppServerClient, releaseLeasedSharedCodexAppServerClient } = await import("./shared-client-qhyYWbew.mjs").then((n) => n.v);
|
|
36
|
+
const { requestCodexAppServerClientJson } = await import("./request-jSbhc1sg.mjs").then((n) => n.i);
|
|
37
37
|
const client = await (useSharedClient ? getLeasedSharedCodexAppServerClient : createIsolatedCodexAppServerClient)({
|
|
38
38
|
startOptions: options.startOptions,
|
|
39
39
|
timeoutMs,
|
|
@@ -66,7 +66,7 @@ async function requestModelListPage(request, options) {
|
|
|
66
66
|
}
|
|
67
67
|
function readModelListResult(value) {
|
|
68
68
|
const response = assertCodexModelListResponse(value);
|
|
69
|
-
const models = response.data.map(
|
|
69
|
+
const models = response.data.map(readCodexModel);
|
|
70
70
|
const nextCursor = response.nextCursor ?? void 0;
|
|
71
71
|
return {
|
|
72
72
|
models,
|
|
@@ -77,17 +77,20 @@ function readCodexModel(value) {
|
|
|
77
77
|
const id = normalizeOptionalString(value.id);
|
|
78
78
|
const model = normalizeOptionalString(value.model);
|
|
79
79
|
if (!id || !model) throw new Error("Invalid Codex app-server model/list response: model id and name must be non-empty strings");
|
|
80
|
+
const displayName = normalizeOptionalString(value.displayName);
|
|
81
|
+
const description = normalizeOptionalString(value.description);
|
|
82
|
+
const defaultReasoningEffort = normalizeOptionalString(value.defaultReasoningEffort);
|
|
80
83
|
return {
|
|
81
84
|
id,
|
|
82
85
|
model,
|
|
83
|
-
...
|
|
84
|
-
...
|
|
86
|
+
...displayName ? { displayName } : {},
|
|
87
|
+
...description ? { description } : {},
|
|
85
88
|
hidden: value.hidden,
|
|
86
89
|
isDefault: value.isDefault,
|
|
87
90
|
inputModalities: value.inputModalities,
|
|
88
91
|
serviceTiers: normalizeUniqueTrimmedStringList((value.serviceTiers ?? []).map((tier) => tier.id)),
|
|
89
92
|
supportedReasoningEfforts: normalizeUniqueTrimmedStringList(value.supportedReasoningEfforts.map((entry) => entry.reasoningEffort)),
|
|
90
|
-
...
|
|
93
|
+
...defaultReasoningEffort ? { defaultReasoningEffort } : {},
|
|
91
94
|
...value.multiAgentVersion !== void 0 ? { multiAgentVersion: value.multiAgentVersion } : {}
|
|
92
95
|
};
|
|
93
96
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { d as readCodexPluginConfig } from "./config-parsing-
|
|
1
|
+
import { d as readCodexPluginConfig } from "./config-parsing-BQq-CHTF.mjs";
|
|
2
2
|
import { n as isCodexAppServerProxyLaunch, t as buildCodexLoginStatusArgs } from "./launch-args-DbFCehO7.mjs";
|
|
3
|
-
import { r as resolveManagedCodexAppServerStartOptions } from "./managed-binary-
|
|
4
|
-
import { n as resolveCodexAppServerSpawnEnv } from "./transport-stdio-
|
|
5
|
-
import { n as resolveCodexAppServerRuntimeOptions } from "./config-runtime-
|
|
6
|
-
import { runUtf8CommandWithTimeout } from "openclaw/plugin-sdk/process-runtime";
|
|
3
|
+
import { r as resolveManagedCodexAppServerStartOptions } from "./managed-binary-C1VFoVPf.mjs";
|
|
4
|
+
import { n as resolveCodexAppServerSpawnEnv } from "./transport-stdio-a0HDa2Mj.mjs";
|
|
5
|
+
import { n as resolveCodexAppServerRuntimeOptions } from "./config-runtime-cUYrqu_a.mjs";
|
|
7
6
|
import { materializeWindowsSpawnProgram, resolveWindowsSpawnProgram } from "openclaw/plugin-sdk/windows-spawn";
|
|
7
|
+
import { runUtf8CommandWithTimeout } from "openclaw/plugin-sdk/process-runtime";
|
|
8
8
|
//#region extensions/codex/src/app-server/native-auth.ts
|
|
9
9
|
const OPENAI_LOGIN_MODES = {
|
|
10
10
|
"Logged in using ChatGPT": "oauth",
|
|
@@ -22,7 +22,6 @@ async function probeCodexNativeAuth(params) {
|
|
|
22
22
|
});
|
|
23
23
|
if (options.start.transport !== "stdio" || options.start.homeScope !== "user" || isCodexAppServerProxyLaunch(options.start.args)) return;
|
|
24
24
|
const start = await resolveManagedCodexAppServerStartOptions(options.start, { pluginRoot: params.pluginRoot });
|
|
25
|
-
if (start.transport !== "stdio") return;
|
|
26
25
|
const env = resolveCodexAppServerSpawnEnv(start, params.env ?? process.env);
|
|
27
26
|
const invocation = materializeWindowsSpawnProgram(resolveWindowsSpawnProgram({
|
|
28
27
|
command: start.command,
|
package/dist/.setup/{native-execution-policy-BxZJy5mP.mjs → native-execution-policy-ClzpdG3D.mjs}
RENAMED
|
@@ -16,11 +16,7 @@ function resolveCodexNodeExecToolOverrides(policy) {
|
|
|
16
16
|
function resolveCodexNativeExecutionPolicy(params) {
|
|
17
17
|
const config = params.config ?? {};
|
|
18
18
|
const sessionKey = params.sessionKey?.trim() || params.sessionId?.trim() || void 0;
|
|
19
|
-
const agentId =
|
|
20
|
-
config,
|
|
21
|
-
sessionKey,
|
|
22
|
-
agentId: params.agentId
|
|
23
|
-
});
|
|
19
|
+
const agentId = normalizeAgentIdOrDefault(params.agentId) ?? parseAgentIdFromSessionKey(sessionKey) ?? tryResolveDefaultAgentId(config);
|
|
24
20
|
const canReadSessionEntry = Boolean(agentId) && params.readRuntimeSessionEntry && shouldReadRuntimeSessionEntry({
|
|
25
21
|
config,
|
|
26
22
|
sessionKey,
|
|
@@ -58,13 +54,6 @@ function formatCodexNativeNodeExecBlock(params) {
|
|
|
58
54
|
"Use a normal Codex harness turn so OpenClaw exec/process tools run on the node, or switch exec host to gateway for native Codex app-server execution."
|
|
59
55
|
].join(" ");
|
|
60
56
|
}
|
|
61
|
-
function resolvePolicyAgentId(params) {
|
|
62
|
-
const explicitAgentId = normalizeAgentIdOrDefault(params.agentId);
|
|
63
|
-
if (explicitAgentId) return explicitAgentId;
|
|
64
|
-
const sessionAgentId = parseAgentIdFromSessionKey(params.sessionKey);
|
|
65
|
-
if (sessionAgentId) return sessionAgentId;
|
|
66
|
-
return tryResolveDefaultAgentId(params.config);
|
|
67
|
-
}
|
|
68
57
|
function parseAgentIdFromSessionKey(sessionKey) {
|
|
69
58
|
const raw = sessionKey?.trim();
|
|
70
59
|
if (!raw) return;
|