@openclaw/codex 2026.10.5-beta.4 → 2026.10.10-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 +10 -3
- package/dist/.setup/{account-usage-runtime-CoVpNIlD.mjs → account-usage-runtime-BVO-lpvn.mjs} +15 -9
- package/dist/.setup/{app-server-policy-D_zv8J7V.mjs → app-server-policy-Cog6mm2i.mjs} +1 -1
- package/dist/.setup/{apply-BXDMd05l.mjs → apply-tJl5mopa.mjs} +11 -11
- package/dist/.setup/{attempt-client-cleanup-zNuNTKVr.mjs → attempt-client-cleanup-DMJWXGxM.mjs} +14 -8
- package/dist/.setup/attempt-terminal-sZutF0WY.mjs +1 -0
- package/dist/.setup/{attempt-workspace-context-CcwP3DA3.mjs → attempt-workspace-context-GYPLawX6.mjs} +2 -2
- package/dist/.setup/{auth-binding-BaxlhaNx.mjs → auth-binding-830RLAJW.mjs} +2 -2
- package/dist/.setup/{auth-cache-key-f8ODJ_OX.mjs → auth-cache-key-BW1YeaIk.mjs} +92 -80
- package/dist/.setup/{auth-profile-CgHQ8Vot.mjs → auth-profile-auwzSwwy.mjs} +14 -8
- package/dist/.setup/{auth-profile-health-oHizqgye.mjs → auth-profile-health-BVPZU9I8.mjs} +15 -8
- package/dist/.setup/{auth-profile-selection-hr8ocLtz.mjs → auth-profile-selection-Bp5PDk3W.mjs} +24 -7
- package/dist/.setup/{binding-connection-B7HAAZSI.mjs → binding-connection-GTgUj9pi.mjs} +2 -2
- package/dist/.setup/{binding-connection.runtime-DAXn7iFl.mjs → binding-connection.runtime-RcWR3vQu.mjs} +4 -3
- package/dist/.setup/{bounded-turn-DfIJtRlv.mjs → bounded-turn-BQkmyyjB.mjs} +18 -22
- package/dist/.setup/{bounded-turn-isolation-BfDAo-qZ.mjs → bounded-turn-isolation-D8CDrAVX.mjs} +3 -3
- package/dist/.setup/{build-state-Ds14X10-.mjs → build-state-CjLCC0wm.mjs} +1 -1
- package/dist/.setup/{capabilities-DbOzOglY.mjs → capabilities-DAS-JX1z.mjs} +1 -1
- package/dist/.setup/{client-D93nbdB8.mjs → client--P8jwXvA.mjs} +47 -317
- package/dist/.setup/{client-catalog-response-CuVLp4I0.mjs → client-catalog-response-CsDxVVOZ.mjs} +2 -2
- package/dist/.setup/client-initialize-CjgZcX61.mjs +165 -0
- package/dist/.setup/{command-dispatch-DxdH5a9-.mjs → command-dispatch-DqaVBeR3.mjs} +3 -3
- package/dist/.setup/{command-formatters-xW9KpoSZ.mjs → command-formatters-B_7-QZ1c.mjs} +2 -2
- package/dist/.setup/{command-handlers-fiYvYYq0.mjs → command-handlers-i6mEjvfo.mjs} +539 -406
- package/dist/.setup/command-rpc-B65jEc0r.mjs +296 -0
- package/dist/.setup/compact-AO2H4RJe.mjs +823 -0
- package/dist/.setup/{computer-use-DL2v3Kxq.mjs → computer-use-YUnu0JVx.mjs} +21 -68
- package/dist/.setup/{config-C1YVVLEA.mjs → config-BfrAlTMT.mjs} +3 -3
- package/dist/.setup/{config-options-DDzeNQ8m.mjs → config-options-DMFZkd3X.mjs} +1 -1
- package/dist/.setup/{config-runtime-DWzK-k0n.mjs → config-runtime-BZRizyuG.mjs} +2 -2
- package/dist/.setup/{context-engine-projection-ps-yn_ci.mjs → context-engine-projection-PIeLSnR-.mjs} +16 -30
- package/dist/.setup/{conversation-binding-BieJZRRV.mjs → conversation-binding-CfnUR-IM.mjs} +228 -116
- package/dist/.setup/{conversation-binding-data-UgLuTSQT.mjs → conversation-binding-data-khgW0n-o.mjs} +4 -2
- package/dist/.setup/{conversation-control-GXM3unE4.mjs → conversation-control-B2EpVZEb.mjs} +53 -23
- package/dist/.setup/{cyber-failover-D4dgNfFf.mjs → cyber-failover-CqEZoQsj.mjs} +1 -1
- package/dist/.setup/{cyber-failover-notice-ljgGGL0s.mjs → cyber-failover-notice-poL3Advd.mjs} +1 -1
- package/dist/.setup/{doctor-start-options-JjTAl-q_.mjs → doctor-start-options-8uIBXIzR.mjs} +8 -5
- package/dist/.setup/{dynamic-tool-build-DcaPmBlE.mjs → dynamic-tool-build-DOub3CB5.mjs} +208 -218
- package/dist/.setup/{dynamic-tools-CnQFnNKH.mjs → dynamic-tools-Us5mvq_N.mjs} +344 -118
- package/dist/.setup/{effective-mcp-catalog-B5HKFZNK.mjs → effective-mcp-catalog-DfUUoeeM.mjs} +11 -9
- package/dist/.setup/{ephemeral-turn-De3qb8EQ.mjs → ephemeral-turn-B2z0RIeF.mjs} +5 -4
- package/dist/.setup/{event-projector-assistant-message-CLMKN4x-.mjs → event-projector-assistant-message-ChOAY7rW.mjs} +16 -11
- package/dist/.setup/{event-projector-usage-BpKfdoTm.mjs → event-projector-usage-CBY0Hkga.mjs} +2 -2
- package/dist/.setup/{event-projector-values-CLvG1Hil.mjs → event-projector-values-yf4us9Pf.mjs} +1 -1
- package/dist/.setup/experimental-features-uGnVDtp-.mjs +19 -0
- package/dist/.setup/inference-context-HRw3PDwn.mjs +209 -0
- package/dist/.setup/{inference-dispatch-CO6tTs4q.mjs → inference-dispatch-C2zVSnrr.mjs} +2 -2
- package/dist/.setup/{inference-metadata-DCvcG_N_.mjs → inference-metadata-CYFWLHVk.mjs} +3 -1
- package/dist/.setup/{inference-proxy-BDWV0djM.mjs → inference-proxy-CiLbHMLf.mjs} +8 -8
- package/dist/.setup/installed-probe-lVC1X5ve.mjs +185 -0
- package/dist/.setup/{isolated-completion-BPJdvk5F.mjs → isolated-completion-CybgD6uU.mjs} +7 -7
- package/dist/.setup/managed-binary-DbKvGXKl.mjs +395 -0
- package/dist/.setup/{mcp-app-session-preparation-Dz2GOwyE.mjs → mcp-app-session-preparation-zUgpDLWR.mjs} +18 -14
- package/dist/.setup/{model-catalog-ZNwltCKl.mjs → model-catalog-CWY3wo0B.mjs} +28 -17
- package/dist/.setup/{models-BHpbAuz8.mjs → models-CmOBxsKF.mjs} +3 -3
- package/dist/.setup/{native-auth-esN5MdIv.mjs → native-auth-DpZIaY8N.mjs} +7 -4
- package/dist/.setup/native-execution-policy-D09tLP-u.mjs +152 -0
- package/dist/.setup/{native-hook-relay-wq7jrNLk.mjs → native-hook-relay-CocOW9YS.mjs} +45 -10
- package/dist/.setup/{native-mcp-app-DX3nyTtc.mjs → native-mcp-app-DrQeLxXj.mjs} +5 -5
- package/dist/.setup/{native-skill-isolation-DSBeF-Yy.mjs → native-skill-isolation-DL4-PQa4.mjs} +7 -7
- package/dist/.setup/{native-subagent-monitor-DOLEIf9r.mjs → native-subagent-monitor-C3CIIaZG.mjs} +485 -239
- package/dist/.setup/{native-subagent-pending-assignments-DmVhedNs.mjs → native-subagent-pending-assignments-CTinVtjo.mjs} +1 -1
- package/dist/.setup/{native-task-assignments-DimsQ9Qa.mjs → native-task-assignments-YJopbaVO.mjs} +9 -5
- package/dist/.setup/{node-cli-sessions-CzKg2nGq.mjs → node-cli-sessions-BuJnBnEq.mjs} +7 -4
- package/dist/.setup/{node-exec-server.runtime-BWkULhBM.mjs → node-exec-server.runtime-CP7RC1Nd.mjs} +3 -3
- package/dist/.setup/{plan-41-YOBMq.mjs → plan-Bqj6VQvQ.mjs} +7 -20
- package/dist/.setup/{plugin-activation-D7WkJMvU.mjs → plugin-activation-CXPWe-hl.mjs} +4 -4
- package/dist/.setup/{plugin-app-cache-key-Bg9DbDI6.mjs → plugin-app-cache-key-DRb-niJc.mjs} +17 -55
- package/dist/.setup/{plugin-approval-roundtrip-CD88q3yx.mjs → plugin-approval-roundtrip-CGEiG7hG.mjs} +1 -1
- package/dist/.setup/{plugin-inventory-CYgdo14P.mjs → plugin-inventory-DE9wcaeH.mjs} +2 -2
- package/dist/.setup/{plugin-metadata-cache-Bi8TAPwX.mjs → plugin-metadata-cache-BqC-a6Fb.mjs} +2 -15
- package/dist/.setup/{project-doc-thread-config-BVcvnps8.mjs → project-doc-thread-config-B0UI3f1D.mjs} +6 -6
- package/dist/.setup/protocol-CaPAVwe9.mjs +12 -0
- package/dist/.setup/{provider-LWKll6dV.mjs → provider-C_1fMsyD.mjs} +4 -4
- package/dist/.setup/{provider-capabilities-Dn2WwH4P.mjs → provider-capabilities-C7pYYpvh.mjs} +1 -1
- package/dist/.setup/{rate-limits-CI8pTPqL.mjs → rate-limits-BpfURnuy.mjs} +1 -1
- package/dist/.setup/{request-Bo0kKABI.mjs → request-C6U8q2uz.mjs} +132 -136
- package/dist/.setup/{responses-oauth-twnuTaAa.mjs → responses-oauth-CCV7aVYF.mjs} +6 -6
- package/dist/.setup/{rpc-error-C98SHchT.mjs → rpc-error-DemqqaxE.mjs} +7 -3
- package/dist/.setup/{run-attempt-ClU8MxhZ.mjs → run-attempt-BhuXanLv.mjs} +595 -426
- package/dist/.setup/{run-attempt-lifecycle-KN4oh-7O.mjs → run-attempt-lifecycle-DN-ATDp9.mjs} +1 -1
- package/dist/.setup/{runtime-artifact-C13pR7tD.mjs → runtime-artifact-CmLWeyJB.mjs} +3 -3
- package/dist/.setup/{runtime-artifact-connection-jS5DeCok.mjs → runtime-artifact-connection-DpWlZ02e.mjs} +3 -3
- package/dist/.setup/{sandbox-guard-DIImwCy1.mjs → sandbox-guard-DneAfNye.mjs} +70 -30
- package/dist/.setup/{session-binding-JEHNMPsr.mjs → session-binding-BgsWcbdY.mjs} +25 -23
- package/dist/.setup/{session-binding-record-DU_0biMD.mjs → session-binding-record-C_THntMe.mjs} +27 -12
- package/dist/.setup/{session-binding-record-codec-BpH8u_G9.mjs → session-binding-record-codec-DvmOI7g_.mjs} +1 -0
- package/dist/.setup/{session-binding-sidecars-DD-enC8w.mjs → session-binding-sidecars-BNSS6WL4.mjs} +55 -63
- package/dist/.setup/session-cancellation-DCN1FcBZ.mjs +43 -0
- package/dist/.setup/{session-catalog-adoption-Ca3OYGYM.mjs → session-catalog-adoption-ppsLlVLB.mjs} +24 -38
- package/dist/.setup/{session-catalog-archive-Bv6gV7x9.mjs → session-catalog-archive-CqLRHJ6z.mjs} +11 -13
- package/dist/.setup/{session-catalog-events-kR2Ot6nX.mjs → session-catalog-events-CEi6SuLQ.mjs} +5 -5
- package/dist/.setup/{session-catalog-index-order-CTfoefow.mjs → session-catalog-index-order-0Zqng2u8.mjs} +1 -1
- package/dist/.setup/{session-catalog-index-CrnfVEnT.mjs → session-catalog-index-qt4UWBua.mjs} +96 -271
- package/dist/.setup/{session-catalog-limits-BynIoOYm.mjs → session-catalog-limits-Dc6E0BZz.mjs} +1 -1
- package/dist/.setup/{session-catalog-list-request-D4MYNgDB.mjs → session-catalog-list-request-CAjoWjaH.mjs} +3 -4
- package/dist/.setup/{session-catalog-native-projection-CWqCU1I_.mjs → session-catalog-native-projection-BqBYi6kV.mjs} +5 -5
- package/dist/.setup/{session-catalog-node-adoption-BdP9Zjqo.mjs → session-catalog-node-adoption-e9v8mGgx.mjs} +5 -5
- package/dist/.setup/{session-catalog-node-continue-CNJibO4_.mjs → session-catalog-node-continue-H7nrzcUD.mjs} +5 -5
- package/dist/.setup/{session-catalog-node-lookup-BH_DBGa9.mjs → session-catalog-node-lookup-BrZfDkA8.mjs} +2 -2
- package/dist/.setup/{session-catalog-parsing-DkeoVn60.mjs → session-catalog-parsing-V6jyFg9g.mjs} +2 -2
- package/dist/.setup/{session-catalog-projection-BzHiV818.mjs → session-catalog-projection-CNyhjZze.mjs} +8 -7
- package/dist/.setup/{session-catalog-provenance-CmsOE5mh.mjs → session-catalog-provenance-Dg9s12z-.mjs} +50 -30
- package/dist/.setup/{session-catalog-source-DGuRdGvM.mjs → session-catalog-source-z_mNyQdX.mjs} +2 -6
- package/dist/.setup/{session-cli-GwU0izn-.mjs → session-cli-CBGKiqdv.mjs} +1 -1
- package/dist/.setup/{session-history-BO6i_pfk.mjs → session-history-7W0cgTXF.mjs} +11 -9
- package/dist/.setup/{session-history-import-CaO8s6ta.mjs → session-history-import-BwPKwcNi.mjs} +4 -4
- package/dist/.setup/{session-initialization-Bi_2DKhc.mjs → session-initialization-Dn3vveGv.mjs} +2 -2
- package/dist/.setup/{session-retirement-B3U5hpGJ.mjs → session-retirement-RZStisKb.mjs} +8 -8
- package/dist/.setup/{session-history.worker-DJQfek5p.mjs → settled-turn-evidence--tRW6fSm.mjs} +2 -18
- package/dist/.setup/{settled-turn-finalizer-CYCVpTv2.mjs → settled-turn-finalizer-gioXygEX.mjs} +8 -8
- package/dist/.setup/{shared-client-BCx1wbyA.mjs → shared-client-CkyTrNB8.mjs} +380 -557
- package/dist/.setup/side-question-DHPWKgO3.mjs +998 -0
- package/dist/.setup/{source-DipMO9hL.mjs → source-63MLSmLJ.mjs} +5 -5
- package/dist/.setup/{thread-archive-guard-LKdwQKyr.mjs → thread-archive-guard-BWjSsA92.mjs} +1 -1
- package/dist/.setup/{thread-lifecycle-run-C_aYiYqk.mjs → thread-lifecycle-run-zCXYFW8W.mjs} +172 -75
- package/dist/.setup/{thread-model-selection-DcVebr8N.mjs → thread-model-selection-DxposL4X.mjs} +9 -9
- package/dist/.setup/{thread-ownership-BoUd0i6L.mjs → thread-ownership-Bmk5a2Gu.mjs} +7 -7
- package/dist/.setup/{thread-policy-B3wBRNph.mjs → thread-policy-DYtvZ5Ay.mjs} +6 -6
- package/dist/.setup/{thread-requests-BgzJwJtS.mjs → thread-requests-BjawdIVV.mjs} +14 -14
- package/dist/.setup/{thread-resume-D-3bsr1j.mjs → thread-resume-vBShG3-o.mjs} +6 -6
- package/dist/.setup/{transcript-history-projection-DfKcoZCB.mjs → transcript-history-projection-i-FVpyha.mjs} +1 -1
- package/dist/.setup/{transcript-mirror-Bee2o6jj.mjs → transcript-mirror-CEQJZlF3.mjs} +6 -9
- package/dist/.setup/{transport-stdio-CRWTkKOn.mjs → transport-stdio-Bq160Dhv.mjs} +63 -64
- package/dist/.setup/{transport-websocket-DIyPfkHo.mjs → transport-websocket-0YqiI_MH.mjs} +1 -1
- package/dist/.setup/{turn-router-DBVMToGo.mjs → turn-router-BGj67FMK.mjs} +2 -2
- package/dist/.setup/{upstream-session-fork-p5fwKi7w.mjs → upstream-session-fork-CWKjpdtW.mjs} +46 -219
- package/dist/.setup/{usage-C2Kq7oej.mjs → usage-AhrLFxZP.mjs} +4 -4
- package/dist/.setup/{usage-limit-error-BQX8RHAd.mjs → usage-limit-error-BdNbGJC3.mjs} +4 -4
- package/dist/.setup/{web-search-item-CvokaZOo.mjs → web-search-item-DHVuNSqk.mjs} +1 -1
- package/dist/.setup/{web-search-provider.runtime-D89djc7e.mjs → web-search-provider.runtime-Yk6lnJBG.mjs} +3 -3
- package/dist/.setup/{workspace-write-sandbox-probe-BDWO2Qkh.mjs → workspace-write-sandbox-probe-DJxOXcF3.mjs} +2 -2
- package/dist/api.js +7 -28
- package/dist/catalog-page.worker.js +1 -1
- package/dist/cli-metadata.js +1 -1
- package/dist/client-version-api.js +25 -0
- package/dist/doctor-contract-api.js +5 -5
- package/dist/harness.js +59 -36
- package/dist/index.js +259 -295
- package/dist/media-understanding-provider.js +2 -2
- package/dist/migration-provider-api.js +1 -2
- package/dist/native-session-binding-api.js +1 -2
- package/dist/provider-discovery.js +1 -1
- package/dist/session-history-worker-entrypoint.js +12 -0
- package/dist/session-history-worker-runtime.js +7 -18
- package/dist/session-history.worker.js +18 -2
- package/openclaw.plugin.json +1 -1
- package/package.json +6 -6
- package/dist/.setup/attempt-terminal-jO5IMj9K.mjs +0 -2
- package/dist/.setup/command-rpc-HIvsy3wS.mjs +0 -247
- package/dist/.setup/compact-ClZ7Ar7L.mjs +0 -808
- package/dist/.setup/inference-context-DNlGwzwy.mjs +0 -91
- package/dist/.setup/managed-binary-BtIjV7yN.mjs +0 -175
- package/dist/.setup/native-execution-policy-MXEe7PB3.mjs +0 -75
- package/dist/.setup/protocol-CANUwXJ3.mjs +0 -17
- package/dist/.setup/side-question-Bz2UQW0l.mjs +0 -826
package/dist/.setup/{run-attempt-lifecycle-KN4oh-7O.mjs → run-attempt-lifecycle-DN-ATDp9.mjs}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as attemptTerminal } from "./attempt-terminal-
|
|
1
|
+
import { t as attemptTerminal } from "./attempt-terminal-sZutF0WY.mjs";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import fs from "node:fs/promises";
|
|
4
4
|
import { awaitAgentEndSideEffects, embeddedAgentLog, formatErrorMessage, runAgentCleanupStep, runAgentEndSideEffectsAsync } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { n as isCodexAppServerProxyLaunch } from "./launch-args-DbFCehO7.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import { n as resolveCodexAppServerSpawnEnv, r as resolveCodexAppServerSpawnInvocation } from "./transport-stdio-
|
|
4
|
-
import { captureCodexConfiguredConnection, finalizeCodexConfiguredConnection, isCodexConfiguredConnectionArtifact, validateCodexConfiguredConnectionCapture } from "./runtime-artifact-connection-
|
|
2
|
+
import { p as resolvePackagedCodexNativeCommand } from "./managed-binary-DbKvGXKl.mjs";
|
|
3
|
+
import { n as resolveCodexAppServerSpawnEnv, r as resolveCodexAppServerSpawnInvocation } from "./transport-stdio-Bq160Dhv.mjs";
|
|
4
|
+
import { captureCodexConfiguredConnection, finalizeCodexConfiguredConnection, isCodexConfiguredConnectionArtifact, validateCodexConfiguredConnectionCapture } from "./runtime-artifact-connection-DpWlZ02e.mjs";
|
|
5
5
|
import { createHash } from "node:crypto";
|
|
6
6
|
import { resolveWindowsExecutablePath } from "openclaw/plugin-sdk/windows-spawn";
|
|
7
7
|
import { resolveGlobalSingleton } from "openclaw/plugin-sdk/global-singleton";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as codexAppServerStartOptionsKey } from "./config-options-
|
|
2
|
-
import "./config-runtime-
|
|
3
|
-
import { r as resolveCodexAppServerUnixSocketPath } from "./transport-websocket-
|
|
1
|
+
import { t as codexAppServerStartOptionsKey } from "./config-options-DMFZkd3X.mjs";
|
|
2
|
+
import "./config-runtime-BZRizyuG.mjs";
|
|
3
|
+
import { r as resolveCodexAppServerUnixSocketPath } from "./transport-websocket-0YqiI_MH.mjs";
|
|
4
4
|
import { isRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
5
5
|
import { createHash } from "node:crypto";
|
|
6
6
|
import path from "node:path";
|
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
import { l as isCodexRemoteExecPlacementSandbox } from "./config-parsing-DsWSCPHO.mjs";
|
|
2
|
-
import { n as
|
|
3
|
-
import { t as __exportAll } from "./session-binding-sidecars-
|
|
2
|
+
import { n as prepareCodexNativeExecutionPolicy, t as formatCodexNativeNodeExecBlock } from "./native-execution-policy-D09tLP-u.mjs";
|
|
3
|
+
import { t as __exportAll } from "./session-binding-sidecars-BNSS6WL4.mjs";
|
|
4
4
|
import { isRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
5
|
-
import { tryResolveDefaultAgentId } from "openclaw/plugin-sdk/agent-scope-runtime";
|
|
6
|
-
import { parseAgentSessionKey } from "openclaw/plugin-sdk/routing";
|
|
7
|
-
import { resolveSandboxRuntimeStatus } from "openclaw/plugin-sdk/sandbox";
|
|
8
5
|
//#region extensions/codex/src/app-server/sandbox-guard.ts
|
|
9
|
-
/**
|
|
10
|
-
* Blocks direct Codex app-server requests that would bypass OpenClaw sandbox or
|
|
11
|
-
* node-exec routing guarantees.
|
|
12
|
-
*/
|
|
13
6
|
var sandbox_guard_exports = /* @__PURE__ */ __exportAll({
|
|
7
|
+
assertNativeConversationApprovalPolicySupported: () => assertNativeConversationApprovalPolicySupported,
|
|
8
|
+
prepareCodexAppServerDirectSandboxBypassBlock: () => prepareCodexAppServerDirectSandboxBypassBlock,
|
|
9
|
+
prepareCodexNativeExecutionBlock: () => prepareCodexNativeExecutionBlock,
|
|
10
|
+
prepareCodexNativeSandboxBlock: () => prepareCodexNativeSandboxBlock,
|
|
14
11
|
resolveCodexAppServerDirectSandboxBypassBlock: () => resolveCodexAppServerDirectSandboxBypassBlock,
|
|
15
12
|
resolveCodexNativeExecutionBlock: () => resolveCodexNativeExecutionBlock,
|
|
16
13
|
resolveCodexNativeSandboxBlock: () => resolveCodexNativeSandboxBlock
|
|
@@ -59,6 +56,10 @@ function resolveCodexAppServerDirectSandboxBypassBlock(params) {
|
|
|
59
56
|
config: params.config,
|
|
60
57
|
sessionKey: params.sessionKey,
|
|
61
58
|
sessionId: params.sessionId,
|
|
59
|
+
agentId: params.agentId,
|
|
60
|
+
storePath: params.storePath,
|
|
61
|
+
sessionTarget: params.sessionTarget,
|
|
62
|
+
executionPolicy: params.executionPolicy,
|
|
62
63
|
surface: `app-server method \`${params.method}\``
|
|
63
64
|
});
|
|
64
65
|
if (nodeExecBlock) return nodeExecBlock;
|
|
@@ -67,13 +68,63 @@ function resolveCodexAppServerDirectSandboxBypassBlock(params) {
|
|
|
67
68
|
const sessionKey = params.sessionKey?.trim() || params.sessionId?.trim();
|
|
68
69
|
if (!sessionKey) return;
|
|
69
70
|
const sandboxBlock = resolveCodexNativeSandboxBlock({
|
|
70
|
-
|
|
71
|
+
...params,
|
|
71
72
|
sessionKey,
|
|
72
|
-
sandbox: params.sandbox,
|
|
73
73
|
surface: `app-server method \`${params.method}\``
|
|
74
74
|
});
|
|
75
75
|
return sandboxBlock && params.method === "thread/start" && hasOpenClawSandboxEnvironmentSelection(params.requestParams) ? void 0 : sandboxBlock;
|
|
76
76
|
}
|
|
77
|
+
/** Resolve policy before yielding to client acquisition and recheck it at each write. */
|
|
78
|
+
async function prepareCodexAppServerDirectSandboxBypassBlock(params) {
|
|
79
|
+
if (ALLOWED_CONTROL_PLANE_METHODS.has(params.method) && params.method !== "config/mcpServer/reload") return {
|
|
80
|
+
block: void 0,
|
|
81
|
+
async assertCurrent() {},
|
|
82
|
+
release() {}
|
|
83
|
+
};
|
|
84
|
+
const selected = await prepareCodexNativeExecutionPolicy({
|
|
85
|
+
...params,
|
|
86
|
+
readRuntimeSessionEntry: true
|
|
87
|
+
});
|
|
88
|
+
return {
|
|
89
|
+
block: resolveCodexAppServerDirectSandboxBypassBlock({
|
|
90
|
+
...params,
|
|
91
|
+
executionPolicy: selected.policy
|
|
92
|
+
}),
|
|
93
|
+
assertCurrent: selected.assertCurrent,
|
|
94
|
+
source: selected.source,
|
|
95
|
+
release: selected.release
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
async function prepareCodexNativeExecutionBlock(params) {
|
|
99
|
+
const selected = await prepareCodexNativeExecutionPolicy({
|
|
100
|
+
...params,
|
|
101
|
+
readRuntimeSessionEntry: true
|
|
102
|
+
});
|
|
103
|
+
return {
|
|
104
|
+
block: resolveCodexNativeExecutionBlock({
|
|
105
|
+
...params,
|
|
106
|
+
executionPolicy: selected.policy
|
|
107
|
+
}),
|
|
108
|
+
assertCurrent: selected.assertCurrent,
|
|
109
|
+
source: selected.source,
|
|
110
|
+
release: selected.release
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
async function prepareCodexNativeSandboxBlock(params) {
|
|
114
|
+
const selected = await prepareCodexNativeExecutionPolicy({
|
|
115
|
+
...params,
|
|
116
|
+
readRuntimeSessionEntry: true
|
|
117
|
+
});
|
|
118
|
+
return {
|
|
119
|
+
block: resolveCodexNativeSandboxBlock({
|
|
120
|
+
...params,
|
|
121
|
+
executionPolicy: selected.policy
|
|
122
|
+
}),
|
|
123
|
+
assertCurrent: selected.assertCurrent,
|
|
124
|
+
source: selected.source,
|
|
125
|
+
release: selected.release
|
|
126
|
+
};
|
|
127
|
+
}
|
|
77
128
|
/** Resolves the generic native-execution block for sandboxed or node-hosted sessions. */
|
|
78
129
|
function resolveCodexNativeExecutionBlock(params) {
|
|
79
130
|
return resolveCodexNativeSandboxBlock(params) ?? resolveCodexNativeNodeExecBlock(params);
|
|
@@ -81,18 +132,9 @@ function resolveCodexNativeExecutionBlock(params) {
|
|
|
81
132
|
/** Returns a block message when native Codex execution cannot honor active sandboxing. */
|
|
82
133
|
function resolveCodexNativeSandboxBlock(params) {
|
|
83
134
|
if (params.sandboxEnvironmentSelected) return;
|
|
84
|
-
|
|
85
|
-
if (!sessionKey) return;
|
|
135
|
+
if (!(params.sessionKey?.trim() || params.sessionId?.trim())) return;
|
|
86
136
|
if (isCodexRemoteExecPlacementSandbox(params.sandbox) || params.sandbox?.enabled === true) return formatCodexNativeSandboxBlock({ surface: params.surface });
|
|
87
|
-
|
|
88
|
-
if (!sandboxAgentId) return;
|
|
89
|
-
if (!resolveSandboxRuntimeStatus({
|
|
90
|
-
cfg: params.config,
|
|
91
|
-
sessionKey,
|
|
92
|
-
agentId: sandboxAgentId,
|
|
93
|
-
classificationAgentId: sandboxAgentId
|
|
94
|
-
}).sandboxed) return;
|
|
95
|
-
return formatCodexNativeSandboxBlock({ surface: params.surface });
|
|
137
|
+
return params.executionPolicy.sandboxed ? formatCodexNativeSandboxBlock({ surface: params.surface }) : void 0;
|
|
96
138
|
}
|
|
97
139
|
function hasOpenClawSandboxEnvironmentSelection(value) {
|
|
98
140
|
if (!isRecord(value)) return false;
|
|
@@ -107,18 +149,16 @@ function formatCodexNativeSandboxBlock(params) {
|
|
|
107
149
|
].join(" ");
|
|
108
150
|
}
|
|
109
151
|
function resolveCodexNativeNodeExecBlock(params) {
|
|
110
|
-
const
|
|
111
|
-
const policy = resolveCodexNativeExecutionPolicy({
|
|
112
|
-
config: params.config,
|
|
113
|
-
sessionKey,
|
|
114
|
-
agentId: params.agentId,
|
|
115
|
-
readRuntimeSessionEntry: Boolean(sessionKey)
|
|
116
|
-
});
|
|
152
|
+
const policy = params.executionPolicy;
|
|
117
153
|
if (policy.nativeToolSurfaceAllowed) return;
|
|
118
154
|
return formatCodexNativeNodeExecBlock({
|
|
119
155
|
surface: params.surface,
|
|
120
156
|
reason: policy.blockReason
|
|
121
157
|
});
|
|
122
158
|
}
|
|
159
|
+
const NATIVE_CONVERSATION_INTERACTIVE_APPROVALS_UNAVAILABLE = "OpenClaw native Codex conversation binding cannot route interactive approvals yet; use the Codex harness or explicit /acp spawn codex for that workflow.";
|
|
160
|
+
function assertNativeConversationApprovalPolicySupported(runtime) {
|
|
161
|
+
if (runtime.approvalPolicy !== "never" && runtime.approvalsReviewer === "user") throw new Error(NATIVE_CONVERSATION_INTERACTIVE_APPROVALS_UNAVAILABLE);
|
|
162
|
+
}
|
|
123
163
|
//#endregion
|
|
124
|
-
export {
|
|
164
|
+
export { sandbox_guard_exports as a, resolveCodexNativeExecutionBlock as i, prepareCodexNativeExecutionBlock as n, prepareCodexNativeSandboxBlock as r, assertNativeConversationApprovalPolicySupported as t };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { i as adoptCodexNativeSubagentSubmissions, n as mutateNativePendingAssignments, o as mutateCodexNativeSubagentSubmissions } from "./native-subagent-pending-assignments-
|
|
2
|
-
import { a as readStoredCodexAppServerBinding, i as readCodexBindingTimestamp, n as matchesPendingSupervisionBranch, o as stripUndefinedBinding, r as readCodexAppServerThreadBinding, s as validateBindingForWrite } from "./session-binding-record-codec-
|
|
3
|
-
import { a as ownsStoredSessionGeneration, c as preserveNativeTaskImport, d as
|
|
1
|
+
import { i as adoptCodexNativeSubagentSubmissions, n as mutateNativePendingAssignments, o as mutateCodexNativeSubagentSubmissions } from "./native-subagent-pending-assignments-CTinVtjo.mjs";
|
|
2
|
+
import { a as readStoredCodexAppServerBinding, i as readCodexBindingTimestamp, n as matchesPendingSupervisionBranch, o as stripUndefinedBinding, r as readCodexAppServerThreadBinding, s as validateBindingForWrite } from "./session-binding-record-codec-DvmOI7g_.mjs";
|
|
3
|
+
import { a as ownsStoredSessionGeneration, c as preserveNativeTaskImport, d as readCurrentCodexAppServerBindingAsync, f as readCurrentCodexAppServerBindings, g as sessionBindingIdentity, h as readPluginAppPolicyContext, i as matchesCodexNativeSubagentSubmissionBinding, l as preservedSessionGeneration, m as readCurrentNativePendingAssignments, n as assertCodexBindingMayBeReplaced, o as preserveCodexNativeSubagentSubmissions, p as readCurrentCodexNativeSubagentSubmissions, r as bindingStoreKey, s as preserveNativePendingAssignments, t as CodexSupervisionBindingReplacementError, u as readCurrentCodexAppServerBinding, v as storedSessionGeneration } from "./session-binding-record-C_THntMe.mjs";
|
|
4
4
|
import { a as PHYSICAL_SESSION_RETIRE_TTL_MS, i as CODEX_APP_SERVER_BINDING_NAMESPACE, n as CODEX_APP_SERVER_BINDING_LEASE, r as CODEX_APP_SERVER_BINDING_MAX_ENTRIES, t as CODEX_APP_SERVER_BINDING_GUARDED_REQUEST_TIMEOUT_MS } from "./session-binding-meta-Lkm5Lpf4.mjs";
|
|
5
|
-
import { n as normalizeCodexAppServerBindingModelProvider } from "./auth-profile-
|
|
6
|
-
import { t as __exportAll } from "./session-binding-sidecars-
|
|
5
|
+
import { n as normalizeCodexAppServerBindingModelProvider } from "./auth-profile-auwzSwwy.mjs";
|
|
6
|
+
import { t as __exportAll } from "./session-binding-sidecars-BNSS6WL4.mjs";
|
|
7
7
|
import { asOptionalRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
8
8
|
import { createHash } from "node:crypto";
|
|
9
9
|
import { AgentHarnessSessionSupersededError, embeddedAgentLog } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
10
|
-
import {
|
|
10
|
+
import { combinePreparedNativeSessionBindingAuthority as combineCodexBindingAuthority, createNativeSessionBindingLifecycleV2, reclaimNativeSessionGenerationWithAuthority, resolvePreparedNativeSessionBinding } from "openclaw/plugin-sdk/agent-harness-session-runtime";
|
|
11
11
|
//#region extensions/codex/src/app-server/session-binding-native-mutations.ts
|
|
12
12
|
/** The caller supplies the transaction's freshly parsed row and current-authority closure. */
|
|
13
13
|
function mutateNativeSubagentBinding({ identity, current, mutation, assertCurrent }) {
|
|
@@ -64,7 +64,7 @@ function normalizeStoredCodexAppServerBindingFingerprints(value) {
|
|
|
64
64
|
});
|
|
65
65
|
}
|
|
66
66
|
/** Encodes a migrated sidecar binding as one canonical plugin-state row. */
|
|
67
|
-
function createStoredCodexAppServerBinding(value, options = {}) {
|
|
67
|
+
async function createStoredCodexAppServerBinding(value, options = {}) {
|
|
68
68
|
const rawRecord = asOptionalRecord(value);
|
|
69
69
|
if (!rawRecord) return;
|
|
70
70
|
const record = normalizeLegacyBindingFingerprints(rawRecord);
|
|
@@ -74,7 +74,7 @@ function createStoredCodexAppServerBinding(value, options = {}) {
|
|
|
74
74
|
const authProfileId = typeof record.authProfileId === "string" ? record.authProfileId : void 0;
|
|
75
75
|
const binding = readCodexAppServerThreadBinding({
|
|
76
76
|
...record,
|
|
77
|
-
modelProvider: normalizeCodexAppServerBindingModelProvider({
|
|
77
|
+
modelProvider: await normalizeCodexAppServerBindingModelProvider({
|
|
78
78
|
...options.lookup,
|
|
79
79
|
authProfileId,
|
|
80
80
|
modelProvider: typeof record.modelProvider === "string" ? record.modelProvider : void 0
|
|
@@ -141,13 +141,13 @@ async function reclaimCurrentCodexSessionGeneration(params) {
|
|
|
141
141
|
/** Resolve continuity before selecting native queues, catalogs, or connections. */
|
|
142
142
|
async function resolveCodexSessionBinding(params) {
|
|
143
143
|
const identity = params.identity;
|
|
144
|
-
return await
|
|
144
|
+
return await resolvePreparedNativeSessionBinding({
|
|
145
145
|
...params,
|
|
146
146
|
...identity.kind === "session" ? {
|
|
147
147
|
target: identity,
|
|
148
148
|
generation: codexSessionGenerationOperations(params.bindingStore, identity)
|
|
149
149
|
} : {},
|
|
150
|
-
readBinding: (sessionId) => params.bindingStore.
|
|
150
|
+
readBinding: (sessionId) => params.bindingStore.readAsync(sessionId && identity.kind === "session" ? {
|
|
151
151
|
...identity,
|
|
152
152
|
sessionId
|
|
153
153
|
} : identity),
|
|
@@ -156,7 +156,16 @@ async function resolveCodexSessionBinding(params) {
|
|
|
156
156
|
}
|
|
157
157
|
/** Creates the single binding facade owned by the Codex plugin runtime. */
|
|
158
158
|
function createCodexAppServerBindingStore(state) {
|
|
159
|
-
const lifecycle =
|
|
159
|
+
const lifecycle = createNativeSessionBindingLifecycleV2({
|
|
160
|
+
lookup: (key) => state.asyncReads.lookup(key),
|
|
161
|
+
assertLeaseCurrent: (key, token) => {
|
|
162
|
+
const raw = state.lookup(key);
|
|
163
|
+
const current = readStoredCodexAppServerBinding(raw);
|
|
164
|
+
if (raw !== void 0 && !current) throw new Error(`Invalid Codex app-server binding row: ${key}`);
|
|
165
|
+
if (current?.lease?.token !== token || current.lease.expiresAt <= Date.now()) throw bindingLeaseLostError(key);
|
|
166
|
+
},
|
|
167
|
+
withCurrent: (authority) => state.withCurrent(authority)
|
|
168
|
+
}, {
|
|
160
169
|
workerCodec: "codex",
|
|
161
170
|
readRecord: readStoredCodexAppServerBinding,
|
|
162
171
|
lease: CODEX_APP_SERVER_BINDING_LEASE,
|
|
@@ -224,12 +233,13 @@ function createCodexAppServerBindingStore(state) {
|
|
|
224
233
|
};
|
|
225
234
|
return {
|
|
226
235
|
read: (identity) => readCurrentCodexAppServerBinding(state, identity),
|
|
236
|
+
readAsync: (identity) => readCurrentCodexAppServerBindingAsync(state.asyncReads, identity),
|
|
227
237
|
readMany: (identities) => readCurrentCodexAppServerBindings(state.asyncReads, identities),
|
|
228
|
-
readNativeSubagentAssignments: (identity, owner) => readCurrentNativePendingAssignments(state, identity, owner),
|
|
229
|
-
readNativeSubagentSubmissions: (identity, owner) => readCurrentCodexNativeSubagentSubmissions(state, identity, owner),
|
|
238
|
+
readNativeSubagentAssignments: (identity, owner) => readCurrentNativePendingAssignments(state.asyncReads, identity, owner),
|
|
239
|
+
readNativeSubagentSubmissions: (identity, owner) => readCurrentCodexNativeSubagentSubmissions(state.asyncReads, identity, owner),
|
|
230
240
|
async hasOtherThreadOwner(threadId, currentIdentity) {
|
|
231
241
|
const currentKey = currentIdentity ? bindingStoreKey(currentIdentity) : void 0;
|
|
232
|
-
return state.entries().some(({ key, value }) => {
|
|
242
|
+
return (await state.asyncReads.entries()).some(({ key, value }) => {
|
|
233
243
|
const stored = readStoredCodexAppServerBinding(value);
|
|
234
244
|
if (!stored) throw new Error(`Invalid Codex app-server binding row: ${key}`);
|
|
235
245
|
const isCurrentOwner = currentIdentity !== void 0 && key === currentKey && (currentIdentity.kind === "conversation" || stored.sessionId === currentIdentity.sessionId.trim());
|
|
@@ -238,7 +248,7 @@ function createCodexAppServerBindingStore(state) {
|
|
|
238
248
|
},
|
|
239
249
|
async prepareSessionGenerationReclaim(identity) {
|
|
240
250
|
const key = bindingStoreKey(identity);
|
|
241
|
-
const raw = state.lookup(key);
|
|
251
|
+
const raw = await state.asyncReads.lookup(key);
|
|
242
252
|
const current = readStoredCodexAppServerBinding(raw);
|
|
243
253
|
if (raw !== void 0 && !current) throw new Error(`Invalid Codex app-server binding row: ${key}`);
|
|
244
254
|
if (!current) return {
|
|
@@ -394,13 +404,5 @@ function codexSessionGenerationOperations(store, identity) {
|
|
|
394
404
|
function isSameSupervisionOwner(current, replacement) {
|
|
395
405
|
return replacement.connectionScope === "supervision" && replacement.threadId === current.threadId && replacement.supervisionSourceThreadId === current.supervisionSourceThreadId;
|
|
396
406
|
}
|
|
397
|
-
function storedSessionGeneration(identity, current) {
|
|
398
|
-
if (identity.kind === "session") return { sessionId: identity.sessionId };
|
|
399
|
-
return current?.sessionId ? { sessionId: current.sessionId } : {};
|
|
400
|
-
}
|
|
401
|
-
function preservedSessionGeneration(identity, current) {
|
|
402
|
-
if (current?.sessionId) return { sessionId: current.sessionId };
|
|
403
|
-
return storedSessionGeneration(identity, current);
|
|
404
|
-
}
|
|
405
407
|
//#endregion
|
|
406
408
|
export { session_binding_exports as a, resolveCodexSessionBinding as i, createCodexSessionGenerationSupersededError as n, hashCodexAppServerBindingFingerprint as o, reclaimCurrentCodexSessionGeneration as r, clearCodexBindingForClient as t };
|
package/dist/.setup/{session-binding-record-DU_0biMD.mjs → session-binding-record-C_THntMe.mjs}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as matchesCodexNativeSubagentSubmissionOwner, h as codexNativeSubagentHistoryConnectionFingerprint, r as readNativePendingAssignments, s as readCodexNativeSubagentSubmissions, t as matchesNativeAssignmentLifecycle } from "./native-subagent-pending-assignments-
|
|
2
|
-
import { a as readStoredCodexAppServerBinding, t as legacyAppPolicyEntrySchema } from "./session-binding-record-codec-
|
|
3
|
-
import { t as __exportAll } from "./session-binding-sidecars-
|
|
1
|
+
import { a as matchesCodexNativeSubagentSubmissionOwner, h as codexNativeSubagentHistoryConnectionFingerprint, r as readNativePendingAssignments, s as readCodexNativeSubagentSubmissions, t as matchesNativeAssignmentLifecycle } from "./native-subagent-pending-assignments-CTinVtjo.mjs";
|
|
2
|
+
import { a as readStoredCodexAppServerBinding, t as legacyAppPolicyEntrySchema } from "./session-binding-record-codec-DvmOI7g_.mjs";
|
|
3
|
+
import { t as __exportAll } from "./session-binding-sidecars-BNSS6WL4.mjs";
|
|
4
4
|
import { asOptionalRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
5
5
|
import { createHash } from "node:crypto";
|
|
6
6
|
import { isDeepStrictEqual } from "node:util";
|
|
@@ -17,13 +17,16 @@ var session_binding_record_exports = /* @__PURE__ */ __exportAll({
|
|
|
17
17
|
preserveCodexNativeSubagentSubmissions: () => preserveCodexNativeSubagentSubmissions,
|
|
18
18
|
preserveNativePendingAssignments: () => preserveNativePendingAssignments,
|
|
19
19
|
preserveNativeTaskImport: () => preserveNativeTaskImport,
|
|
20
|
+
preservedSessionGeneration: () => preservedSessionGeneration,
|
|
20
21
|
readCurrentCodexAppServerBinding: () => readCurrentCodexAppServerBinding,
|
|
22
|
+
readCurrentCodexAppServerBindingAsync: () => readCurrentCodexAppServerBindingAsync,
|
|
21
23
|
readCurrentCodexAppServerBindings: () => readCurrentCodexAppServerBindings,
|
|
22
24
|
readCurrentCodexNativeSubagentSubmissions: () => readCurrentCodexNativeSubagentSubmissions,
|
|
23
25
|
readCurrentNativePendingAssignments: () => readCurrentNativePendingAssignments,
|
|
24
26
|
readPluginAppPolicyContext: () => readPluginAppPolicyContext,
|
|
25
27
|
readStoredCodexAppServerBinding: () => readStoredCodexAppServerBinding,
|
|
26
|
-
sessionBindingIdentity: () => sessionBindingIdentity
|
|
28
|
+
sessionBindingIdentity: () => sessionBindingIdentity,
|
|
29
|
+
storedSessionGeneration: () => storedSessionGeneration
|
|
27
30
|
});
|
|
28
31
|
/** Resolves the same agent scope OpenClaw uses for transcript/session ownership. */
|
|
29
32
|
function sessionBindingIdentity(params) {
|
|
@@ -55,11 +58,15 @@ function bindingStoreKey(identity) {
|
|
|
55
58
|
function ownsStoredSessionGeneration(identity, current) {
|
|
56
59
|
return identity.kind !== "session" || !current?.sessionId || current.sessionId === identity.sessionId;
|
|
57
60
|
}
|
|
58
|
-
/**
|
|
61
|
+
/** Final effect guards retain the live row until raw SDK binding writers retire. */
|
|
59
62
|
function readCurrentCodexAppServerBinding(state, identity) {
|
|
60
63
|
const key = bindingStoreKey(identity);
|
|
61
64
|
return decodeCurrentCodexAppServerBinding(key, state.lookup(key), identity);
|
|
62
65
|
}
|
|
66
|
+
async function readCurrentCodexAppServerBindingAsync(state, identity) {
|
|
67
|
+
const key = bindingStoreKey(identity);
|
|
68
|
+
return decodeCurrentCodexAppServerBinding(key, await state.lookup(key), identity);
|
|
69
|
+
}
|
|
63
70
|
function decodeCurrentCodexAppServerBinding(key, raw, identity) {
|
|
64
71
|
const stored = readStoredCodexAppServerBinding(raw);
|
|
65
72
|
if (raw !== void 0 && !stored) throw new Error(`Invalid Codex app-server binding row: ${key}`);
|
|
@@ -96,19 +103,19 @@ function matchesCodexNativeSubagentSubmissionBinding(binding, owner) {
|
|
|
96
103
|
function preserveCodexNativeSubagentSubmissions(currentBinding, nextBinding, value) {
|
|
97
104
|
return currentBinding.threadId === nextBinding.threadId ? preserveNativePendingAssignments(currentBinding, nextBinding, value) : void 0;
|
|
98
105
|
}
|
|
99
|
-
function readCurrentCodexNativeSubagentSubmissions(state, identity, owner) {
|
|
100
|
-
const stored = readCurrentNativeSubagentBinding(state, identity, owner);
|
|
106
|
+
async function readCurrentCodexNativeSubagentSubmissions(state, identity, owner) {
|
|
107
|
+
const stored = await readCurrentNativeSubagentBinding(state, identity, owner);
|
|
101
108
|
if (!stored) return [];
|
|
102
109
|
const submissions = readCodexNativeSubagentSubmissions(stored.nativeSubagentSubmissions);
|
|
103
110
|
return submissions && matchesCodexNativeSubagentSubmissionOwner(submissions.owner, owner) ? submissions.receipts : [];
|
|
104
111
|
}
|
|
105
|
-
function readCurrentNativePendingAssignments(state, identity, owner) {
|
|
106
|
-
const stored = readCurrentNativeSubagentBinding(state, identity, owner);
|
|
112
|
+
async function readCurrentNativePendingAssignments(state, identity, owner) {
|
|
113
|
+
const stored = await readCurrentNativeSubagentBinding(state, identity, owner);
|
|
107
114
|
return (readNativePendingAssignments(stored?.nativeSubagentAssignments)?.assignments ?? []).filter((entry) => matchesNativeAssignmentLifecycle(entry.owner, owner));
|
|
108
115
|
}
|
|
109
|
-
function readCurrentNativeSubagentBinding(state, identity, owner) {
|
|
116
|
+
async function readCurrentNativeSubagentBinding(state, identity, owner) {
|
|
110
117
|
const key = bindingStoreKey(identity);
|
|
111
|
-
const raw = state.lookup(key);
|
|
118
|
+
const raw = await state.lookup(key);
|
|
112
119
|
const stored = readStoredCodexAppServerBinding(raw);
|
|
113
120
|
if (raw !== void 0 && !stored) throw new Error(`Invalid Codex app-server binding row: ${key}`);
|
|
114
121
|
if (stored?.state !== "active" || !ownsStoredSessionGeneration(identity, stored) || identity.kind === "session" && owner.sessionId !== identity.sessionId || !matchesCodexNativeSubagentSubmissionBinding(stored.binding, owner)) return;
|
|
@@ -175,5 +182,13 @@ function readPluginAppPolicyContext(value) {
|
|
|
175
182
|
pluginAppIds: parsedPluginAppIds
|
|
176
183
|
};
|
|
177
184
|
}
|
|
185
|
+
function storedSessionGeneration(identity, current) {
|
|
186
|
+
if (identity.kind === "session") return { sessionId: identity.sessionId };
|
|
187
|
+
return current?.sessionId ? { sessionId: current.sessionId } : {};
|
|
188
|
+
}
|
|
189
|
+
function preservedSessionGeneration(identity, current) {
|
|
190
|
+
if (current?.sessionId) return { sessionId: current.sessionId };
|
|
191
|
+
return storedSessionGeneration(identity, current);
|
|
192
|
+
}
|
|
178
193
|
//#endregion
|
|
179
|
-
export { ownsStoredSessionGeneration as a, preserveNativeTaskImport as c,
|
|
194
|
+
export { session_binding_record_exports as _, ownsStoredSessionGeneration as a, preserveNativeTaskImport as c, readCurrentCodexAppServerBindingAsync as d, readCurrentCodexAppServerBindings as f, sessionBindingIdentity as g, readPluginAppPolicyContext as h, matchesCodexNativeSubagentSubmissionBinding as i, preservedSessionGeneration as l, readCurrentNativePendingAssignments as m, assertCodexBindingMayBeReplaced as n, preserveCodexNativeSubagentSubmissions as o, readCurrentCodexNativeSubagentSubmissions as p, bindingStoreKey as r, preserveNativePendingAssignments as s, CodexSupervisionBindingReplacementError as t, readCurrentCodexAppServerBinding as u, storedSessionGeneration as v };
|
|
@@ -111,6 +111,7 @@ const threadBindingSchema = z.object({
|
|
|
111
111
|
contextEngine: contextEngineSchema.optional().catch(void 0),
|
|
112
112
|
environmentSelectionFingerprint: optionalStringSchema,
|
|
113
113
|
conversationStartId: optionalStringSchema,
|
|
114
|
+
conversationIncognito: z.literal(true).optional(),
|
|
114
115
|
conversationSourceTransferComplete: z.literal(true).optional().catch(void 0),
|
|
115
116
|
historyCoveredThrough: optionalTimestampSchema,
|
|
116
117
|
continuityCalibration: z.object({
|
package/dist/.setup/{session-binding-sidecars-DD-enC8w.mjs → session-binding-sidecars-BNSS6WL4.mjs}
RENAMED
|
@@ -246,6 +246,16 @@ function isSafeLegacySessionId(value) {
|
|
|
246
246
|
const trimmed = value.trim();
|
|
247
247
|
return trimmed.length > 0 && trimmed.length <= 255 && /^[A-Za-z0-9][A-Za-z0-9._:@-]*$/.test(trimmed);
|
|
248
248
|
}
|
|
249
|
+
async function resolveLegacySessionFileLocator(sessionsDir, entry, sessionId) {
|
|
250
|
+
const base = path.resolve(sessionsDir);
|
|
251
|
+
const fallback = path.join(base, `${sessionId}.jsonl`);
|
|
252
|
+
const sessionFile = entry.sessionFile?.trim();
|
|
253
|
+
if (!sessionFile) return fallback;
|
|
254
|
+
const candidate = path.resolve(base, sessionFile);
|
|
255
|
+
const [canonicalBase, canonicalCandidate] = await Promise.all([canonicalPathFromExistingAncestor(base), canonicalPathFromExistingAncestor(candidate)]);
|
|
256
|
+
if (!isPathInside(canonicalBase, canonicalCandidate)) throw new Error("legacy session file locator escapes its session directory");
|
|
257
|
+
return candidate;
|
|
258
|
+
}
|
|
249
259
|
//#endregion
|
|
250
260
|
//#region extensions/codex/src/migration/session-binding-sidecars.ts
|
|
251
261
|
const LEGACY_BINDING_SUFFIX = ".codex-app-server.json";
|
|
@@ -410,7 +420,7 @@ async function collectBindingOwners(sources, surfaces, params) {
|
|
|
410
420
|
storePath,
|
|
411
421
|
transcriptPath: legacyTranscriptPath,
|
|
412
422
|
...entry.lifecycleRevision ? { lifecycleRevision: entry.lifecycleRevision } : {},
|
|
413
|
-
|
|
423
|
+
agentHarnessId: entry.agentHarnessId?.trim(),
|
|
414
424
|
...entry.updatedAt !== void 0 ? { updatedAt: entry.updatedAt } : {}
|
|
415
425
|
};
|
|
416
426
|
const candidates = owners.get(canonicalLegacyTranscriptPath) ?? /* @__PURE__ */ new Map();
|
|
@@ -428,16 +438,6 @@ async function collectBindingOwners(sources, surfaces, params) {
|
|
|
428
438
|
failures
|
|
429
439
|
};
|
|
430
440
|
}
|
|
431
|
-
async function resolveLegacySessionFileLocator(sessionsDir, entry, sessionId) {
|
|
432
|
-
const base = path.resolve(sessionsDir);
|
|
433
|
-
const fallback = path.join(base, `${sessionId}.jsonl`);
|
|
434
|
-
const sessionFile = entry.sessionFile?.trim();
|
|
435
|
-
if (!sessionFile) return fallback;
|
|
436
|
-
const candidate = path.resolve(base, sessionFile);
|
|
437
|
-
const [canonicalBase, canonicalCandidate] = await Promise.all([canonicalPathFromExistingAncestor(base), canonicalPathFromExistingAncestor(candidate)]);
|
|
438
|
-
if (!isPathInside(canonicalBase, canonicalCandidate)) throw new Error("legacy session file locator escapes its session directory");
|
|
439
|
-
return candidate;
|
|
440
|
-
}
|
|
441
441
|
function tryResolveLegacyBindingOwnerAgentId(params) {
|
|
442
442
|
if (params.sessionKey.trim().toLowerCase().startsWith("agent:")) return resolveSessionAgentIdsStrict({
|
|
443
443
|
sessionKey: params.sessionKey,
|
|
@@ -482,9 +482,9 @@ async function migrateSource(source, candidates, params, store) {
|
|
|
482
482
|
return await withFileLock(source.sidecarPath, LEGACY_BINDING_LOCK_OPTIONS, async () => {
|
|
483
483
|
const [contents, stat] = await Promise.all([fs.readFile(source.sidecarPath, "utf8"), fs.stat(source.sidecarPath)]);
|
|
484
484
|
const raw = JSON.parse(contents);
|
|
485
|
-
const [{ bindingStoreKey, createStoredCodexAppServerBinding, normalizeStoredCodexAppServerBindingFingerprints, readStoredCodexAppServerBinding }, { legacyCodexConversationBindingId }] = await Promise.all([import("./session-binding-
|
|
485
|
+
const [{ bindingStoreKey, createStoredCodexAppServerBinding, normalizeStoredCodexAppServerBindingFingerprints, readStoredCodexAppServerBinding }, { legacyCodexConversationBindingId }] = await Promise.all([import("./session-binding-BgsWcbdY.mjs").then((n) => n.a), import("./conversation-binding-data-khgW0n-o.mjs").then((n) => n.t)]);
|
|
486
486
|
const agentId = owner?.agentId ?? (source.agentIds.size === 1 ? [...source.agentIds][0] : void 0);
|
|
487
|
-
const baseStored = createStoredCodexAppServerBinding(raw, {
|
|
487
|
+
const baseStored = await createStoredCodexAppServerBinding(raw, {
|
|
488
488
|
now: stat.mtime.toISOString(),
|
|
489
489
|
lookup: {
|
|
490
490
|
config: params.config,
|
|
@@ -493,6 +493,7 @@ async function migrateSource(source, candidates, params, store) {
|
|
|
493
493
|
});
|
|
494
494
|
if (!baseStored) return retain("its binding is invalid");
|
|
495
495
|
if (candidates.length > 1) return retain(`${candidates.length} matching session owners make ownership ambiguous`);
|
|
496
|
+
if (owner?.agentHarnessId === "") return retain("its session owner changed before Codex ownership could be recorded", "notice");
|
|
496
497
|
if (owner?.agentHarnessId && owner.agentHarnessId !== CODEX_AGENT_HARNESS_ID) return retain(`its session is owned by agent harness ${owner.agentHarnessId}`, "notice");
|
|
497
498
|
const readEvidence = params.context.readSessionIdentityEvidenceBatch;
|
|
498
499
|
const canonicalOwner = owner && readEvidence ? (await readEvidence([{
|
|
@@ -511,20 +512,22 @@ async function migrateSource(source, candidates, params, store) {
|
|
|
511
512
|
const current = await store.lookup(key);
|
|
512
513
|
if (current === void 0) return;
|
|
513
514
|
const parsed = readStoredCodexAppServerBinding(current);
|
|
514
|
-
if (!parsed) return `
|
|
515
|
+
if (!parsed) return `current plugin state is invalid at ${key}`;
|
|
515
516
|
const normalized = normalizeStoredCodexAppServerBindingFingerprints(parsed);
|
|
516
|
-
if (!normalized) return `
|
|
517
|
+
if (!normalized) return `current plugin state is invalid at ${key}`;
|
|
517
518
|
if (isDeepStrictEqual(parsed, normalized)) return parsed;
|
|
518
|
-
if (parsed.lease && parsed.lease.expiresAt > Date.now()) return `
|
|
519
|
-
const
|
|
520
|
-
if (!
|
|
521
|
-
await
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
519
|
+
if (parsed.lease && parsed.lease.expiresAt > Date.now()) return `current plugin state is leased at ${key}`;
|
|
520
|
+
const { observe, compareAndApply } = store;
|
|
521
|
+
if (!observe || !compareAndApply) return `current plugin state could not be normalized at ${key}`;
|
|
522
|
+
const observation = await observe(key);
|
|
523
|
+
const candidateParsed = readStoredCodexAppServerBinding(observation.value);
|
|
524
|
+
if (candidateParsed && isDeepStrictEqual(candidateParsed, parsed)) await compareAndApply(key, observation.comparison, {
|
|
525
|
+
operation: "update",
|
|
526
|
+
action: "set",
|
|
527
|
+
value: normalized
|
|
525
528
|
});
|
|
526
529
|
const persisted = readStoredCodexAppServerBinding(await store.lookup(key));
|
|
527
|
-
if (!persisted || !isDeepStrictEqual(persisted, normalized)) return `
|
|
530
|
+
if (!persisted || !isDeepStrictEqual(persisted, normalized)) return `current plugin state changed at ${key}`;
|
|
528
531
|
importedKeys++;
|
|
529
532
|
return normalized;
|
|
530
533
|
};
|
|
@@ -557,37 +560,38 @@ async function migrateSource(source, candidates, params, store) {
|
|
|
557
560
|
for (const entry of entries) {
|
|
558
561
|
const current = await readNormalizedRow(entry.key);
|
|
559
562
|
if (typeof current === "string") return retain(current);
|
|
560
|
-
if (current && !hasExpected(current, entry.value)) return retain(`
|
|
563
|
+
if (current && !hasExpected(current, entry.value)) return retain(`current plugin state changed at ${entry.key}`);
|
|
561
564
|
}
|
|
562
565
|
for (const entry of entries) {
|
|
563
566
|
if (await store.registerIfAbsent(entry.key, entry.value)) importedKeys++;
|
|
564
|
-
if (!hasExpected(await store.lookup(entry.key), entry.value)) return retain(`
|
|
567
|
+
if (!hasExpected(await store.lookup(entry.key), entry.value)) return retain(`current plugin state changed at ${entry.key}`);
|
|
565
568
|
}
|
|
566
569
|
if (owner) {
|
|
567
570
|
const ownershipResult = await recordSessionOwner(owner, params.env, {
|
|
568
571
|
canCreateOwner,
|
|
569
572
|
readEvidence
|
|
570
573
|
});
|
|
571
|
-
const ownershipWarning = typeof ownershipResult === "string" ? ownershipResult : ownershipResult ? "its
|
|
574
|
+
const ownershipWarning = typeof ownershipResult === "string" ? ownershipResult : ownershipResult ? "its saved session was deleted" : void 0;
|
|
572
575
|
if (ownershipWarning) {
|
|
573
576
|
if (sessionEntry?.value.state === "active") {
|
|
574
|
-
const
|
|
575
|
-
if (!
|
|
576
|
-
await
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
577
|
+
const { observe, compareAndApply } = store;
|
|
578
|
+
if (!observe || !compareAndApply) return retain(`${ownershipWarning}; its stale session binding could not be retired`);
|
|
579
|
+
const observation = await observe(sessionEntry.key);
|
|
580
|
+
const parsed = readStoredCodexAppServerBinding(observation.value);
|
|
581
|
+
if (!(parsed?.lease && parsed.lease.expiresAt > Date.now()) && hasExpected(observation.value, sessionEntry.value)) await compareAndApply(sessionEntry.key, observation.comparison, {
|
|
582
|
+
operation: "update",
|
|
583
|
+
action: "set",
|
|
584
|
+
value: {
|
|
581
585
|
version: 1,
|
|
582
586
|
state: "cleared",
|
|
583
587
|
sessionId: owner.sessionId,
|
|
584
588
|
retired: true
|
|
585
|
-
}
|
|
589
|
+
}
|
|
586
590
|
});
|
|
587
591
|
if (hasExpected(await store.lookup(sessionEntry.key), sessionEntry.value)) return retain(`${ownershipWarning}; its stale session binding could not be retired`);
|
|
588
592
|
}
|
|
589
593
|
if (typeof ownershipResult === "string") return retain(ownershipWarning, "notice");
|
|
590
|
-
} else for (const entry of entries) if (!hasExpected(await store.lookup(entry.key), entry.value)) return retain(`
|
|
594
|
+
} else for (const entry of entries) if (!hasExpected(await store.lookup(entry.key), entry.value)) return retain(`current plugin state changed at ${entry.key}`);
|
|
591
595
|
}
|
|
592
596
|
const archiveWarnings = [];
|
|
593
597
|
await (0, runtime_doctor_migrations_exports.archiveLegacyStateSource)({
|
|
@@ -611,29 +615,15 @@ async function migrateSource(source, candidates, params, store) {
|
|
|
611
615
|
}
|
|
612
616
|
}
|
|
613
617
|
async function recordSessionOwner(owner, env, options) {
|
|
614
|
-
const {
|
|
615
|
-
|
|
616
|
-
if ("failure" in currentIndex) return "its legacy session owner could not be revalidated";
|
|
617
|
-
const currentOwner = currentIndex.entries.find(({ sessionKey }) => sessionKey === owner.sessionKey);
|
|
618
|
-
if (!currentOwner || currentOwner.entry.sessionId !== owner.sessionId) return "its session owner changed before Codex ownership could be recorded";
|
|
619
|
-
let currentTranscriptPath;
|
|
620
|
-
try {
|
|
621
|
-
currentTranscriptPath = await resolveLegacySessionFileLocator(path.dirname(owner.storePath), currentOwner.entry, currentOwner.entry.sessionId);
|
|
622
|
-
} catch {
|
|
623
|
-
return "its session owner changed before Codex ownership could be recorded";
|
|
624
|
-
}
|
|
625
|
-
if (await canonicalPathFromExistingAncestor(currentTranscriptPath) !== await canonicalPathFromExistingAncestor(owner.transcriptPath) || currentOwner.entry.lifecycleRevision !== owner.lifecycleRevision) return "its session owner changed before Codex ownership could be recorded";
|
|
626
|
-
const legacyHarnessId = currentOwner.entry.agentHarnessId?.trim();
|
|
627
|
-
if (currentOwner.entry.agentHarnessId !== void 0 && !legacyHarnessId) return "its session owner changed before Codex ownership could be recorded";
|
|
628
|
-
if (legacyHarnessId && legacyHarnessId !== CODEX_AGENT_HARNESS_ID) return `its session is owned by agent harness ${legacyHarnessId}`;
|
|
629
|
-
let observedForeignHarness;
|
|
618
|
+
const { prepareSessionEntryPatch } = await import("openclaw/plugin-sdk/session-store-runtime");
|
|
619
|
+
let ownershipRefusal;
|
|
630
620
|
let observedCanonicalEntry = false;
|
|
631
|
-
|
|
621
|
+
if (!await prepareSessionEntryPatch({
|
|
632
622
|
agentId: owner.agentId,
|
|
633
623
|
env,
|
|
634
624
|
...options.canCreateOwner ? { fallbackEntry: {
|
|
635
625
|
sessionId: owner.sessionId,
|
|
636
|
-
updatedAt:
|
|
626
|
+
updatedAt: owner.updatedAt ?? 0,
|
|
637
627
|
...owner.lifecycleRevision ? { lifecycleRevision: owner.lifecycleRevision } : {}
|
|
638
628
|
} } : {},
|
|
639
629
|
preserveActivity: true,
|
|
@@ -641,30 +631,32 @@ async function recordSessionOwner(owner, env, options) {
|
|
|
641
631
|
skipMaintenance: true,
|
|
642
632
|
storePath: owner.storePath,
|
|
643
633
|
sessionKey: owner.sessionKey,
|
|
644
|
-
|
|
634
|
+
prepare: (entry, { existingEntry }) => {
|
|
645
635
|
observedCanonicalEntry = existingEntry !== void 0;
|
|
646
|
-
if (entry.sessionId.trim() !== owner.sessionId || entry.lifecycleRevision !== owner.lifecycleRevision)
|
|
636
|
+
if (entry.sessionId.trim() !== owner.sessionId || entry.lifecycleRevision !== owner.lifecycleRevision) {
|
|
637
|
+
ownershipRefusal = "its session owner changed before Codex ownership could be recorded";
|
|
638
|
+
return null;
|
|
639
|
+
}
|
|
647
640
|
const harnessId = typeof entry.agentHarnessId === "string" ? entry.agentHarnessId.trim() : void 0;
|
|
648
|
-
if (entry.agentHarnessId !== void 0 && !harnessId)
|
|
641
|
+
if (entry.agentHarnessId !== void 0 && !harnessId) {
|
|
642
|
+
ownershipRefusal = "Codex harness ownership could not be recorded on its session";
|
|
643
|
+
return null;
|
|
644
|
+
}
|
|
649
645
|
if (harnessId && harnessId !== CODEX_AGENT_HARNESS_ID) {
|
|
650
|
-
|
|
646
|
+
ownershipRefusal = `its session is owned by agent harness ${harnessId}`;
|
|
651
647
|
return null;
|
|
652
648
|
}
|
|
653
649
|
return { agentHarnessId: CODEX_AGENT_HARNESS_ID };
|
|
654
650
|
}
|
|
655
|
-
})
|
|
656
|
-
if (!updated) {
|
|
651
|
+
}) || ownershipRefusal) {
|
|
657
652
|
if (!options.canCreateOwner && !observedCanonicalEntry && options.readEvidence) {
|
|
658
653
|
if ((await options.readEvidence([{
|
|
659
654
|
agentId: owner.agentId,
|
|
660
655
|
sessionId: owner.sessionId
|
|
661
656
|
}]))[0]?.state === "absent") return { deleted: true };
|
|
662
657
|
}
|
|
663
|
-
return
|
|
658
|
+
return ownershipRefusal ?? "its session owner changed before Codex ownership could be recorded";
|
|
664
659
|
}
|
|
665
|
-
if (updated.sessionId.trim() !== owner.sessionId || updated.lifecycleRevision !== owner.lifecycleRevision) return "its session owner changed before Codex ownership could be recorded";
|
|
666
|
-
const harnessId = updated.agentHarnessId?.trim();
|
|
667
|
-
return harnessId === CODEX_AGENT_HARNESS_ID ? void 0 : harnessId ? `its session is owned by agent harness ${harnessId}` : "Codex harness ownership could not be recorded on its session";
|
|
668
660
|
}
|
|
669
661
|
async function readDirectoryEntries(directory) {
|
|
670
662
|
try {
|