@openclaw/codex 2026.10.1-beta.2 → 2026.10.5-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.setup/{account-usage-runtime-DGqFpAud.mjs → account-usage-runtime-QBZsvZS8.mjs} +8 -7
- package/dist/.setup/{app-server-policy-Bg4FZw1f.mjs → app-server-policy-D_zv8J7V.mjs} +3 -4
- package/dist/.setup/{apply-CXTudl9p.mjs → apply-CBMV8LN0.mjs} +40 -51
- package/dist/.setup/{attempt-client-cleanup-BH0hW2xU.mjs → attempt-client-cleanup-t-kd_1ys.mjs} +6 -6
- package/dist/.setup/attempt-terminal-jO5IMj9K.mjs +2 -0
- package/dist/.setup/{attempt-workspace-context-BY0jprWJ.mjs → attempt-workspace-context-CcwP3DA3.mjs} +21 -18
- package/dist/.setup/{auth-binding-BoMwpuPN.mjs → auth-binding-BaxlhaNx.mjs} +2 -2
- package/dist/.setup/{auth-cache-key-CGm0UJOr.mjs → auth-cache-key-DyfUvsSa.mjs} +30 -41
- package/dist/.setup/{binding-connection-C-08ez1w.mjs → binding-connection-B7HAAZSI.mjs} +2 -2
- package/dist/.setup/{binding-connection.runtime-Dn2p-fdy.mjs → binding-connection.runtime-DAXn7iFl.mjs} +6 -5
- package/dist/.setup/{bounded-turn-pGsfXcmH.mjs → bounded-turn-CyQVQwGe.mjs} +21 -17
- package/dist/.setup/{bounded-turn-isolation-DklXNk3k.mjs → bounded-turn-isolation-BfDAo-qZ.mjs} +4 -4
- package/dist/.setup/{build-state-CqQnsg7T.mjs → build-state-CzLMy1S9.mjs} +1 -1
- package/dist/.setup/{capabilities-kQntafj_.mjs → capabilities-DbOzOglY.mjs} +1 -1
- package/dist/.setup/{client-catalog-response-Bqp7WG51.mjs → client-catalog-response-DsbEAtpd.mjs} +25 -32
- package/dist/.setup/{client-C8lgBOoO.mjs → client-y7nO6X9c.mjs} +198 -247
- package/dist/.setup/{command-dispatch-DhBbFIQ5.mjs → command-dispatch-uA9lz2Kf.mjs} +3 -4
- package/dist/.setup/{command-formatters-DV3DHhdr.mjs → command-formatters-xW9KpoSZ.mjs} +16 -26
- package/dist/.setup/{command-handlers-ztOOzm6O.mjs → command-handlers-VBaJnpZo.mjs} +270 -360
- package/dist/.setup/{command-rpc-CuC5fPom.mjs → command-rpc-C9VxOLuG.mjs} +19 -18
- package/dist/.setup/{compact-tUb9AYfH.mjs → compact-CD8xJxXS.mjs} +41 -61
- package/dist/.setup/{computer-use-BBN9y326.mjs → computer-use-CiToXF5C.mjs} +109 -147
- package/dist/.setup/{config-0Gxk3_eq.mjs → config-C1YVVLEA.mjs} +32 -59
- package/dist/.setup/config-contracts.shared-D85SGEuq.mjs +4 -0
- package/dist/.setup/{config-options-HG_Rr3W_.mjs → config-options-DDzeNQ8m.mjs} +52 -90
- package/dist/.setup/{config-parsing-BQq-CHTF.mjs → config-parsing-DsWSCPHO.mjs} +19 -55
- package/dist/.setup/{config-runtime-cUYrqu_a.mjs → config-runtime-DWzK-k0n.mjs} +2 -2
- package/dist/.setup/{config-security-KAPScztc.mjs → config-security-clxAZYWX.mjs} +35 -39
- package/dist/.setup/config-utils-DN_YT7dE.mjs +47 -0
- package/dist/.setup/{context-engine-projection-CsgYSQhW.mjs → context-engine-projection-ps-yn_ci.mjs} +10 -22
- package/dist/.setup/{conversation-binding-B3MNMVzb.mjs → conversation-binding-CTSLDM9S.mjs} +85 -119
- package/dist/.setup/{conversation-binding-data-DJ4ix-W5.mjs → conversation-binding-data-UgLuTSQT.mjs} +9 -8
- package/dist/.setup/{conversation-control-CYsMlCuE.mjs → conversation-control-GXM3unE4.mjs} +7 -10
- package/dist/.setup/{cyber-failover-Bb1J6hS1.mjs → cyber-failover-D4dgNfFf.mjs} +2 -5
- package/dist/.setup/{cyber-failover-notice-XR03ef31.mjs → cyber-failover-notice-ljgGGL0s.mjs} +1 -1
- package/dist/.setup/{doctor-start-options-DPW9JxIE.mjs → doctor-start-options-JjTAl-q_.mjs} +5 -5
- package/dist/.setup/{dynamic-tool-build-C8xGEXmR.mjs → dynamic-tool-build-D731PCdv.mjs} +57 -69
- package/dist/.setup/{dynamic-tools-DyERJnR6.mjs → dynamic-tools-D0pYbxHH.mjs} +689 -710
- package/dist/.setup/{effective-mcp-catalog-C26Mio5l.mjs → effective-mcp-catalog-1hWFKghy.mjs} +11 -20
- package/dist/.setup/{elicitation-input-r9axtppm.mjs → elicitation-input-DXG_qaXr.mjs} +14 -20
- package/dist/.setup/{ephemeral-turn-D8VcDTNo.mjs → ephemeral-turn-Cphy5Qr_.mjs} +3 -3
- package/dist/.setup/{event-projector-assistant-message-BN7CNUB5.mjs → event-projector-assistant-message-CLMKN4x-.mjs} +2 -2
- package/dist/.setup/{event-projector-usage-03R0I2dM.mjs → event-projector-usage-BpKfdoTm.mjs} +20 -33
- package/dist/.setup/{event-projector-values-DTqZHizf.mjs → event-projector-values-CLvG1Hil.mjs} +4 -5
- package/dist/.setup/history-rejection-B4nOXNXF.mjs +13 -0
- package/dist/.setup/{inference-context-D-9gWlTR.mjs → inference-context-DNlGwzwy.mjs} +10 -11
- package/dist/.setup/{inference-dispatch-B5UKEUyC.mjs → inference-dispatch-CO6tTs4q.mjs} +5 -4
- package/dist/.setup/{inference-metadata-CgIf7sOx.mjs → inference-metadata-DCvcG_N_.mjs} +36 -41
- package/dist/.setup/{inference-proxy-DUO5E2QQ.mjs → inference-proxy-BDWV0djM.mjs} +10 -14
- package/dist/.setup/{isolated-completion-C0jrcplS.mjs → isolated-completion-Bhqd2yBq.mjs} +8 -8
- package/dist/.setup/local-runtime-attribution-CZz2DJ4q.mjs +15 -0
- package/dist/.setup/{managed-binary-C1VFoVPf.mjs → managed-binary-BtIjV7yN.mjs} +16 -36
- package/dist/.setup/{mcp-app-session-preparation-BxN0_CYe.mjs → mcp-app-session-preparation-DqSvxFqc.mjs} +24 -25
- package/dist/.setup/{mcp-tool-metadata-j10HhfTC.mjs → mcp-tool-metadata-DW41snf3.mjs} +1 -1
- package/dist/.setup/{model-catalog-DZyNeDKG.mjs → model-catalog-B227ST3D.mjs} +6 -6
- package/dist/.setup/{models-DSseKSMg.mjs → models-DdRyi93L.mjs} +6 -10
- package/dist/.setup/{native-auth-Cjb9y7IZ.mjs → native-auth-esN5MdIv.mjs} +5 -5
- package/dist/.setup/{native-execution-policy-ClzpdG3D.mjs → native-execution-policy-MXEe7PB3.mjs} +11 -28
- package/dist/.setup/native-hook-relay-BUWIOrSr.mjs +561 -0
- package/dist/.setup/{native-mcp-app-CqcPVmhH.mjs → native-mcp-app-CjxJQ4F7.mjs} +6 -6
- package/dist/.setup/native-skill-isolation-UMVoNjZz.mjs +391 -0
- package/dist/.setup/{native-subagent-monitor-BUYOUp9X.mjs → native-subagent-monitor-iHc8oLg5.mjs} +505 -639
- package/dist/.setup/{native-subagent-pending-assignments-BDqhOdJp.mjs → native-subagent-pending-assignments-DmVhedNs.mjs} +11 -23
- package/dist/.setup/{native-task-assignments-C6KVqiN1.mjs → native-task-assignments-DimsQ9Qa.mjs} +73 -27
- package/dist/.setup/{node-cli-sessions-B5oNDkUS.mjs → node-cli-sessions-CzKg2nGq.mjs} +18 -26
- package/dist/.setup/{node-exec-server.runtime-0xSEjKYt.mjs → node-exec-server.runtime-BWkULhBM.mjs} +5 -8
- package/dist/.setup/{plan-BJ37d2Og.mjs → plan-C_F3aio0.mjs} +40 -50
- package/dist/.setup/{plugin-activation-BcyBv8PG.mjs → plugin-activation-D7WkJMvU.mjs} +4 -5
- package/dist/.setup/{plugin-app-cache-key-BW8rd98k.mjs → plugin-app-cache-key-Bg9DbDI6.mjs} +18 -23
- package/dist/.setup/{plugin-approval-roundtrip-CuahdPLC.mjs → plugin-approval-roundtrip-BSV-51ig.mjs} +4 -6
- package/dist/.setup/{plugin-inventory-Bf0_piTw.mjs → plugin-inventory-CYgdo14P.mjs} +28 -43
- package/dist/.setup/{plugin-marketplace-discovery-SQPhSuic.mjs → plugin-marketplace-discovery-BblHM3DU.mjs} +7 -10
- package/dist/.setup/{plugin-metadata-cache-DWnB7VMj.mjs → plugin-metadata-cache-Bi8TAPwX.mjs} +5 -10
- package/dist/.setup/project-doc-thread-config-BVcvnps8.mjs +490 -0
- package/dist/.setup/{provider-BnwHVD_z.mjs → provider-BJ4xhaGX.mjs} +4 -4
- package/dist/.setup/{provider-capabilities-D68Whix6.mjs → provider-capabilities-CjRaV3bx.mjs} +1 -1
- package/dist/.setup/{rate-limits-CMPy24F5.mjs → rate-limits-CI8pTPqL.mjs} +15 -32
- package/dist/.setup/reasoning-effort-CS9kKWB9.mjs +37 -0
- package/dist/.setup/{request-jSbhc1sg.mjs → request-Y8dmbqZ3.mjs} +28 -48
- package/dist/.setup/{rpc-error-hmWM21RB.mjs → rpc-error-C98SHchT.mjs} +3 -6
- package/dist/.setup/{run-attempt-BLDZeYLD.mjs → run-attempt-Dx7a4Mfm.mjs} +927 -849
- package/dist/.setup/{run-attempt-lifecycle-BuZgVbDA.mjs → run-attempt-lifecycle-KN4oh-7O.mjs} +13 -4
- package/dist/.setup/{runtime-artifact-CUTOOnKw.mjs → runtime-artifact-C13pR7tD.mjs} +18 -22
- package/dist/.setup/{runtime-artifact-connection-CADz3_BY.mjs → runtime-artifact-connection-jS5DeCok.mjs} +3 -3
- package/dist/.setup/{sandbox-guard-WqE8yPge.mjs → sandbox-guard-DIImwCy1.mjs} +4 -6
- package/dist/.setup/service-tier-normalization-BPgw2Wdt.mjs +9 -0
- package/dist/.setup/{session-binding-Ce7BqiPN.mjs → session-binding-JEHNMPsr.mjs} +13 -40
- package/dist/.setup/{session-binding-record-BZB8RgcF.mjs → session-binding-record-DU_0biMD.mjs} +4 -4
- package/dist/.setup/{session-binding-record-codec-z4ZpDn6E.mjs → session-binding-record-codec-BpH8u_G9.mjs} +16 -39
- package/dist/.setup/{session-binding-sidecars-BrdV95Fg.mjs → session-binding-sidecars-DD-enC8w.mjs} +49 -54
- package/dist/.setup/{session-catalog-adoption-CPIP4S_y.mjs → session-catalog-adoption-Ca3OYGYM.mjs} +23 -27
- package/dist/.setup/{session-catalog-archive-DcgwvSbF.mjs → session-catalog-archive-Bv6gV7x9.mjs} +6 -6
- package/dist/.setup/{session-catalog-events-Bdjw9HEn.mjs → session-catalog-events-DzFlXNUe.mjs} +6 -5
- package/dist/.setup/{session-catalog-index-DufISKJ6.mjs → session-catalog-index-DozvkUPd.mjs} +111 -105
- package/dist/.setup/{session-catalog-index-order-nhyO0wdW.mjs → session-catalog-index-order-CTfoefow.mjs} +28 -5
- package/dist/.setup/{session-catalog-limits-DEU36Qlo.mjs → session-catalog-limits-BynIoOYm.mjs} +1 -1
- package/dist/.setup/{session-catalog-list-request-tXephOB4.mjs → session-catalog-list-request-D4MYNgDB.mjs} +11 -8
- package/dist/.setup/{session-catalog-native-projection-D6IiLtMb.mjs → session-catalog-native-projection-rCKnZud1.mjs} +5 -61
- package/dist/.setup/{session-catalog-node-adoption-7-WEQTB1.mjs → session-catalog-node-adoption-BdP9Zjqo.mjs} +2 -2
- package/dist/.setup/{session-catalog-node-continue-DLWBwAAO.mjs → session-catalog-node-continue-CNJibO4_.mjs} +27 -49
- package/dist/.setup/{session-catalog-node-lookup-Uufckwcm.mjs → session-catalog-node-lookup-BH_DBGa9.mjs} +3 -3
- package/dist/.setup/{session-catalog-parsing-B-qWJh2x.mjs → session-catalog-parsing-DkeoVn60.mjs} +9 -19
- package/dist/.setup/{session-catalog-projection-8aHNwzWD.mjs → session-catalog-projection-DDVmALHj.mjs} +8 -22
- package/dist/.setup/session-catalog-source-CygTGmrb.mjs +58 -0
- package/dist/.setup/{session-cli-kH4vuGod.mjs → session-cli-GwU0izn-.mjs} +20 -41
- package/dist/.setup/{session-history-BogBHKLk.mjs → session-history-BO6i_pfk.mjs} +1 -1
- package/dist/.setup/{session-history-import-NWKPa4ZO.mjs → session-history-import-CaO8s6ta.mjs} +4 -4
- package/dist/.setup/{session-history-read-CNN8zwbD.mjs → session-history-read-BI_2jRED.mjs} +4 -15
- package/dist/.setup/{session-history.worker-Cq_4DYgN.mjs → session-history.worker-DJQfek5p.mjs} +147 -159
- package/dist/.setup/{session-initialization-D6dtFQkE.mjs → session-initialization-Bi_2DKhc.mjs} +3 -5
- package/dist/.setup/{session-permission-policy-BxIUJ0Zd.mjs → session-permission-policy-CD2MAWU8.mjs} +12 -20
- package/dist/.setup/{session-retirement-Czbchv_O.mjs → session-retirement-IoS3zr17.mjs} +7 -7
- package/dist/.setup/{settled-turn-context-BZsMjkIO.mjs → settled-turn-context-BPL6D3RO.mjs} +1 -1
- package/dist/.setup/{settled-turn-finalizer-DjZsIwbZ.mjs → settled-turn-finalizer-X-Fylp-u.mjs} +12 -11
- package/dist/.setup/{shared-client-qhyYWbew.mjs → shared-client-ByIwuAC-.mjs} +172 -229
- package/dist/.setup/{side-question-D3NJlgbl.mjs → side-question-BDUdozFy.mjs} +116 -137
- package/dist/.setup/{source-BYu0T780.mjs → source-Bxbqf3S1.mjs} +37 -56
- package/dist/.setup/thread-archive-guard-LKdwQKyr.mjs +56 -0
- package/dist/.setup/{thread-lifecycle-Cbz_7ySv.mjs → thread-lifecycle-run-CfP4PnEf.mjs} +348 -484
- package/dist/.setup/thread-model-selection-DcVebr8N.mjs +61 -0
- package/dist/.setup/{thread-ownership-DwuSrt3s.mjs → thread-ownership-Be53aiaG.mjs} +5 -5
- package/dist/.setup/{thread-ownership-queue-Dp24d7-F.mjs → thread-ownership-queue-CeyYScUC.mjs} +5 -6
- package/dist/.setup/{thread-policy-DoNxbhqt.mjs → thread-policy-CHgY-KNl.mjs} +4 -4
- package/dist/.setup/thread-requests-BgzJwJtS.mjs +745 -0
- package/dist/.setup/{thread-resume-BT6NHMkM.mjs → thread-resume-B2EmMcgE.mjs} +5 -5
- package/dist/.setup/{timeout-CXOfNoaX.mjs → timeout-D0mEWSGG.mjs} +6 -12
- package/dist/.setup/{transcript-history-projection-B9a7HwUV.mjs → transcript-history-projection-DfKcoZCB.mjs} +3 -4
- package/dist/.setup/{transcript-mirror-BfLRARNL.mjs → transcript-mirror-Bee2o6jj.mjs} +68 -68
- package/dist/.setup/{transcript-mirror-attestation-YSegaktH.mjs → transcript-mirror-attestation-BzUXnrvv.mjs} +5 -2
- package/dist/.setup/{transport-stdio-a0HDa2Mj.mjs → transport-stdio-CRWTkKOn.mjs} +67 -77
- package/dist/.setup/{transport-websocket-zqJ0Cmtn.mjs → transport-websocket-DIyPfkHo.mjs} +8 -16
- package/dist/.setup/{turn-router-sS69wYnI.mjs → turn-router-DKDAziUW.mjs} +30 -31
- package/dist/.setup/upstream-prompt-provenance-Ccd9MFRJ.mjs +44 -0
- package/dist/.setup/{upstream-session-fork-ChSld66u.mjs → upstream-session-fork-Djp_yssT.mjs} +50 -43
- package/dist/.setup/{usage-D8e8Xiqf.mjs → usage-DQA-peQC.mjs} +4 -4
- package/dist/.setup/{usage-limit-error-GbT-5NcW.mjs → usage-limit-error-2t3KBqiX.mjs} +12 -21
- package/dist/.setup/web-search-item-CvokaZOo.mjs +20 -0
- package/dist/.setup/{web-search-provider.runtime-dL2GD1Kl.mjs → web-search-provider.runtime-BsuCMNix.mjs} +3 -3
- package/dist/.setup/{workspace-write-sandbox-probe-DmUHLrrl.mjs → workspace-write-sandbox-probe-BDWO2Qkh.mjs} +4 -4
- package/dist/api.js +15 -15
- package/dist/catalog-page.worker.js +1 -1
- package/dist/cli-metadata.js +1 -1
- package/dist/doctor-contract-api.js +5 -6
- package/dist/harness.js +32 -61
- package/dist/index.js +302 -416
- package/dist/media-understanding-provider.js +32 -43
- package/dist/migration-provider-api.js +1 -1
- package/dist/native-session-binding-api.js +1 -1
- package/dist/native-tool-policy.js +23 -1
- package/dist/provider-discovery.js +1 -1
- package/dist/session-history-worker-runtime.js +52 -31
- package/dist/session-history.worker.js +1 -1
- package/openclaw.plugin.json +20 -3
- package/package.json +7 -7
- package/dist/.setup/attempt-terminal-gZrxQ35N.mjs +0 -5
- package/dist/.setup/plugin-thread-config-deadline-B8LGaZNW.mjs +0 -124
- package/dist/.setup/service-tier-normalization-Cei89SW6.mjs +0 -15
- package/dist/.setup/shell-dynamic-tools-D3Brj3g9.mjs +0 -85
- package/dist/.setup/thread-archive-guard-C9frICzX.mjs +0 -60
- package/dist/.setup/thread-requests-CL1e8Wmx.mjs +0 -2111
- package/dist/.setup/upstream-prompt-provenance-fXkKbPVC.mjs +0 -37
package/dist/.setup/{run-attempt-lifecycle-BuZgVbDA.mjs → run-attempt-lifecycle-KN4oh-7O.mjs}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { t as attemptTerminal } from "./attempt-terminal-
|
|
1
|
+
import { t as attemptTerminal } from "./attempt-terminal-jO5IMj9K.mjs";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import fs from "node:fs/promises";
|
|
4
|
-
import { awaitAgentEndSideEffects, embeddedAgentLog, formatErrorMessage,
|
|
4
|
+
import { awaitAgentEndSideEffects, embeddedAgentLog, formatErrorMessage, runAgentCleanupStep, runAgentEndSideEffectsAsync } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
5
5
|
import { emitAgentHarnessAttemptEvent } from "openclaw/plugin-sdk/agent-harness-attempt-runtime";
|
|
6
6
|
//#region extensions/codex/src/app-server/workspace-dir-cache.ts
|
|
7
7
|
/** Process-local cache of Codex workspaces already created by the run loop. */
|
|
@@ -52,7 +52,7 @@ async function runCodexAgentEndHook(params, hookParams) {
|
|
|
52
52
|
await awaitAgentEndSideEffects(sideEffectParams);
|
|
53
53
|
return;
|
|
54
54
|
}
|
|
55
|
-
|
|
55
|
+
await runAgentEndSideEffectsAsync(sideEffectParams);
|
|
56
56
|
}
|
|
57
57
|
function reportCodexBackgroundCleanupFailure(params, error) {
|
|
58
58
|
const message = formatErrorMessage(error);
|
|
@@ -69,5 +69,14 @@ function reportCodexBackgroundCleanupFailure(params, error) {
|
|
|
69
69
|
}
|
|
70
70
|
});
|
|
71
71
|
}
|
|
72
|
+
function runCodexCleanupStep(params, step, cleanup) {
|
|
73
|
+
return runAgentCleanupStep({
|
|
74
|
+
runId: params.runId,
|
|
75
|
+
sessionId: params.sessionId,
|
|
76
|
+
step,
|
|
77
|
+
log: embeddedAgentLog,
|
|
78
|
+
cleanup
|
|
79
|
+
});
|
|
80
|
+
}
|
|
72
81
|
//#endregion
|
|
73
|
-
export { runCodexAgentEndHook as a, reportCodexBackgroundCleanupFailure as i, ensureCodexWorkspaceDirOnce as n,
|
|
82
|
+
export { runCodexAgentEndHook as a, withCodexAppServerFastModeServiceTier as c, reportCodexBackgroundCleanupFailure as i, ensureCodexWorkspaceDirOnce as n, runCodexCleanupStep as o, estimateCodexAppServerProjectedTurnTokens as r, shouldKeepCodexSharedAbortOpen as s, emitCodexAppServerEvent as t };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { n as isCodexAppServerProxyLaunch } from "./launch-args-DbFCehO7.mjs";
|
|
2
|
-
import { a as resolvePackagedCodexNativeCommand } from "./managed-binary-
|
|
3
|
-
import { n as resolveCodexAppServerSpawnEnv, r as resolveCodexAppServerSpawnInvocation } from "./transport-stdio-
|
|
4
|
-
import { captureCodexConfiguredConnection, finalizeCodexConfiguredConnection, isCodexConfiguredConnectionArtifact, validateCodexConfiguredConnectionCapture } from "./runtime-artifact-connection-
|
|
2
|
+
import { a as resolvePackagedCodexNativeCommand } from "./managed-binary-BtIjV7yN.mjs";
|
|
3
|
+
import { n as resolveCodexAppServerSpawnEnv, r as resolveCodexAppServerSpawnInvocation } from "./transport-stdio-CRWTkKOn.mjs";
|
|
4
|
+
import { captureCodexConfiguredConnection, finalizeCodexConfiguredConnection, isCodexConfiguredConnectionArtifact, validateCodexConfiguredConnectionCapture } from "./runtime-artifact-connection-jS5DeCok.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";
|
|
@@ -57,11 +57,16 @@ function throwIfAborted(signal) {
|
|
|
57
57
|
function compareArtifactNames(left, right) {
|
|
58
58
|
return left < right ? -1 : left > right ? 1 : 0;
|
|
59
59
|
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
60
|
+
const ARTIFACT_STAT_FIELDS = [
|
|
61
|
+
"dev",
|
|
62
|
+
"ino",
|
|
63
|
+
"mode",
|
|
64
|
+
"size",
|
|
65
|
+
"mtimeNs",
|
|
66
|
+
"ctimeNs"
|
|
67
|
+
];
|
|
63
68
|
function sameOpenedFile(left, right) {
|
|
64
|
-
return
|
|
69
|
+
return ARTIFACT_STAT_FIELDS.every((field) => left[field] === right[field]);
|
|
65
70
|
}
|
|
66
71
|
async function readRegularFileFingerprint(params) {
|
|
67
72
|
throwIfAborted(params.signal);
|
|
@@ -111,7 +116,7 @@ async function listPackageFiles(params) {
|
|
|
111
116
|
continue;
|
|
112
117
|
}
|
|
113
118
|
if (!entry.isFile()) throw new Error(`Codex runtime artifact contains an unsupported entry: ${entryPath}`);
|
|
114
|
-
files.push(
|
|
119
|
+
files.push(path.relative(params.rootPath, entryPath).split(path.sep).join("/"));
|
|
115
120
|
}
|
|
116
121
|
};
|
|
117
122
|
await visit(params.rootPath, 0);
|
|
@@ -172,20 +177,13 @@ function attestNodeOptions(value) {
|
|
|
172
177
|
};
|
|
173
178
|
}
|
|
174
179
|
if (flag === "--disable-warning" && inlineValue && /^[A-Za-z][A-Za-z0-9_.:-]{0,63}$/u.test(inlineValue)) continue;
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
if (order && SAFE_NODE_OPTIONS_DNS_RESULT_ORDERS.has(order)) continue;
|
|
178
|
-
return {
|
|
179
|
-
ok: false,
|
|
180
|
-
option: flag
|
|
181
|
-
};
|
|
182
|
-
}
|
|
183
|
-
if (!SAFE_NODE_OPTIONS_NUMERIC_FLAGS.has(flag)) return {
|
|
180
|
+
const dnsOrder = flag === "--dns-result-order";
|
|
181
|
+
if (!dnsOrder && !SAFE_NODE_OPTIONS_NUMERIC_FLAGS.has(flag)) return {
|
|
184
182
|
ok: false,
|
|
185
183
|
option: flag
|
|
186
184
|
};
|
|
187
|
-
const
|
|
188
|
-
if (!
|
|
185
|
+
const argument = inlineValue ?? tokens[++index];
|
|
186
|
+
if (!argument || !(dnsOrder ? SAFE_NODE_OPTIONS_DNS_RESULT_ORDERS.has(argument) : /^\d+$/u.test(argument))) return {
|
|
189
187
|
ok: false,
|
|
190
188
|
option: flag
|
|
191
189
|
};
|
|
@@ -408,9 +406,7 @@ function isBoundedPath(value) {
|
|
|
408
406
|
}
|
|
409
407
|
function validateFilesystemDescriptorShape(descriptor) {
|
|
410
408
|
if (descriptor.version !== 1 || !isBoundedPath(descriptor.commandPath) || !isBoundedPath(descriptor.commandRealPath) || !isBoundedPath(descriptor.nativePath) || !isBoundedPath(descriptor.codeModeHostCandidatePath) || !Array.isArray(descriptor.invocationPaths) || descriptor.invocationPaths.length === 0 || descriptor.invocationPaths.length > MAX_ARTIFACT_INVOCATION_PATHS || descriptor.invocationPaths.some((entry) => !isBoundedPath(entry)) || !descriptor.invocationPaths.includes(descriptor.commandRealPath) || !/^[a-f0-9]{64}$/u.test(descriptor.argsFingerprint)) throw new Error("Invalid Codex runtime artifact descriptor");
|
|
411
|
-
if (descriptor.packageRoot)
|
|
412
|
-
if (!isBoundedPath(descriptor.packageRoot) || path.dirname(path.dirname(descriptor.nativePath)) !== descriptor.packageRoot || path.basename(path.dirname(descriptor.nativePath)) !== "bin") throw new Error("Invalid Codex runtime package descriptor");
|
|
413
|
-
}
|
|
409
|
+
if (descriptor.packageRoot && (!isBoundedPath(descriptor.packageRoot) || path.dirname(path.dirname(descriptor.nativePath)) !== descriptor.packageRoot || path.basename(path.dirname(descriptor.nativePath)) !== "bin")) throw new Error("Invalid Codex runtime package descriptor");
|
|
414
410
|
if (descriptor.codeModeHostPath && !isBoundedPath(descriptor.codeModeHostPath)) throw new Error("Invalid Codex code-mode host artifact descriptor");
|
|
415
411
|
if (descriptor.commandSource !== void 0 && ![
|
|
416
412
|
"managed",
|
|
@@ -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-DDzeNQ8m.mjs";
|
|
2
|
+
import "./config-runtime-DWzK-k0n.mjs";
|
|
3
|
+
import { r as resolveCodexAppServerUnixSocketPath } from "./transport-websocket-DIyPfkHo.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,6 +1,6 @@
|
|
|
1
|
-
import { l as isCodexRemoteExecPlacementSandbox } from "./config-parsing-
|
|
2
|
-
import { n as resolveCodexNativeExecutionPolicy, t as formatCodexNativeNodeExecBlock } from "./native-execution-policy-
|
|
3
|
-
import { t as __exportAll } from "./session-binding-sidecars-
|
|
1
|
+
import { l as isCodexRemoteExecPlacementSandbox } from "./config-parsing-DsWSCPHO.mjs";
|
|
2
|
+
import { n as resolveCodexNativeExecutionPolicy, t as formatCodexNativeNodeExecBlock } from "./native-execution-policy-MXEe7PB3.mjs";
|
|
3
|
+
import { t as __exportAll } from "./session-binding-sidecars-DD-enC8w.mjs";
|
|
4
4
|
import { isRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
5
5
|
import { tryResolveDefaultAgentId } from "openclaw/plugin-sdk/agent-scope-runtime";
|
|
6
6
|
import { parseAgentSessionKey } from "openclaw/plugin-sdk/routing";
|
|
@@ -72,9 +72,7 @@ function resolveCodexAppServerDirectSandboxBypassBlock(params) {
|
|
|
72
72
|
sandbox: params.sandbox,
|
|
73
73
|
surface: `app-server method \`${params.method}\``
|
|
74
74
|
});
|
|
75
|
-
|
|
76
|
-
if (params.method === "thread/start" && hasOpenClawSandboxEnvironmentSelection(params.requestParams)) return;
|
|
77
|
-
return sandboxBlock;
|
|
75
|
+
return sandboxBlock && params.method === "thread/start" && hasOpenClawSandboxEnvironmentSelection(params.requestParams) ? void 0 : sandboxBlock;
|
|
78
76
|
}
|
|
79
77
|
/** Resolves the generic native-execution block for sandboxed or node-hosted sessions. */
|
|
80
78
|
function resolveCodexNativeExecutionBlock(params) {
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
//#region extensions/codex/src/app-server/service-tier-normalization.ts
|
|
2
|
+
function normalizeCodexServiceTier(value) {
|
|
3
|
+
const trimmed = typeof value === "string" ? value.trim() : "";
|
|
4
|
+
if (!trimmed) return;
|
|
5
|
+
const normalized = trimmed.toLowerCase();
|
|
6
|
+
return normalized === "fast" || normalized === "priority" ? "priority" : normalized === "flex" ? "flex" : trimmed;
|
|
7
|
+
}
|
|
8
|
+
//#endregion
|
|
9
|
+
export { normalizeCodexServiceTier as t };
|
|
@@ -1,27 +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 readCurrentCodexNativeSubagentSubmissions, f as readCurrentNativePendingAssignments, i as matchesCodexNativeSubagentSubmissionBinding, l as readCurrentCodexAppServerBinding, m as sessionBindingIdentity, n as assertCodexBindingMayBeReplaced, o as preserveCodexNativeSubagentSubmissions, p as readPluginAppPolicyContext, r as bindingStoreKey, s as preserveNativePendingAssignments, t as CodexSupervisionBindingReplacementError, u as readCurrentCodexAppServerBindings } from "./session-binding-record-
|
|
1
|
+
import { i as adoptCodexNativeSubagentSubmissions, n as mutateNativePendingAssignments, o as mutateCodexNativeSubagentSubmissions } from "./native-subagent-pending-assignments-DmVhedNs.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-BpH8u_G9.mjs";
|
|
3
|
+
import { a as ownsStoredSessionGeneration, c as preserveNativeTaskImport, d as readCurrentCodexNativeSubagentSubmissions, f as readCurrentNativePendingAssignments, i as matchesCodexNativeSubagentSubmissionBinding, l as readCurrentCodexAppServerBinding, m as sessionBindingIdentity, n as assertCodexBindingMayBeReplaced, o as preserveCodexNativeSubagentSubmissions, p as readPluginAppPolicyContext, r as bindingStoreKey, s as preserveNativePendingAssignments, t as CodexSupervisionBindingReplacementError, u as readCurrentCodexAppServerBindings } from "./session-binding-record-DU_0biMD.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
5
|
import { n as normalizeCodexAppServerBindingModelProvider } from "./auth-profile-CgHQ8Vot.mjs";
|
|
6
|
-
import { t as __exportAll } from "./session-binding-sidecars-
|
|
6
|
+
import { t as __exportAll } from "./session-binding-sidecars-DD-enC8w.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 { combineNativeSessionBindingAuthority as combineCodexBindingAuthority, createNativeSessionBindingLifecycle,
|
|
11
|
-
//#region extensions/codex/src/app-server/session-binding-authority.ts
|
|
12
|
-
/** Decides whether a run may share the durable stable-key binding owner. */
|
|
13
|
-
async function resolveCodexRunSessionBindingAuthority(params) {
|
|
14
|
-
return (await prepareNativeSessionGenerationAuthority({
|
|
15
|
-
...params,
|
|
16
|
-
target: params.identity,
|
|
17
|
-
createSupersededError: createCodexSessionGenerationSupersededError
|
|
18
|
-
})).state;
|
|
19
|
-
}
|
|
20
|
-
/** Builds the terminal coordination error used when a newer OpenClaw session owns the binding. */
|
|
21
|
-
function createCodexSessionGenerationSupersededError(sessionId) {
|
|
22
|
-
return new AgentHarnessSessionSupersededError(`Codex session generation is no longer current: ${sessionId}`);
|
|
23
|
-
}
|
|
24
|
-
//#endregion
|
|
10
|
+
import { combineNativeSessionBindingAuthority as combineCodexBindingAuthority, createNativeSessionBindingLifecycle, reclaimNativeSessionGenerationWithAuthority, resolveNativeSessionBindingWithAuthority } from "openclaw/plugin-sdk/agent-harness-session-runtime";
|
|
25
11
|
//#region extensions/codex/src/app-server/session-binding-native-mutations.ts
|
|
26
12
|
/** The caller supplies the transaction's freshly parsed row and current-authority closure. */
|
|
27
13
|
function mutateNativeSubagentBinding({ identity, current, mutation, assertCurrent }) {
|
|
@@ -57,15 +43,11 @@ const BOUNDED_BINDING_FINGERPRINT_PATTERN = /^sha256:[a-f0-9]{64}$/i;
|
|
|
57
43
|
function hashCodexAppServerBindingFingerprint(canonical) {
|
|
58
44
|
return `sha256:${createHash("sha256").update(canonical).digest("hex")}`;
|
|
59
45
|
}
|
|
60
|
-
function normalizeLegacyBindingFingerprint(value) {
|
|
61
|
-
if (typeof value !== "string" || value === "" || value === "[]" || BOUNDED_BINDING_FINGERPRINT_PATTERN.test(value)) return value;
|
|
62
|
-
return hashCodexAppServerBindingFingerprint(value);
|
|
63
|
-
}
|
|
64
46
|
function normalizeLegacyBindingFingerprints(record) {
|
|
65
47
|
let normalized = record;
|
|
66
48
|
for (const key of ["dynamicToolsFingerprint", "userMcpServersFingerprint"]) {
|
|
67
49
|
const value = record[key];
|
|
68
|
-
const next =
|
|
50
|
+
const next = typeof value === "string" && value !== "" && value !== "[]" && !BOUNDED_BINDING_FINGERPRINT_PATTERN.test(value) ? hashCodexAppServerBindingFingerprint(value) : value;
|
|
69
51
|
if (next === value) continue;
|
|
70
52
|
if (normalized === record) normalized = { ...record };
|
|
71
53
|
Object.assign(normalized, { [key]: next });
|
|
@@ -127,7 +109,6 @@ var session_binding_exports = /* @__PURE__ */ __exportAll({
|
|
|
127
109
|
readCodexAppServerThreadBinding: () => readCodexAppServerThreadBinding,
|
|
128
110
|
readStoredCodexAppServerBinding: () => readStoredCodexAppServerBinding,
|
|
129
111
|
reclaimCurrentCodexSessionGeneration: () => reclaimCurrentCodexSessionGeneration,
|
|
130
|
-
resolveCodexRunSessionBindingAuthority: () => resolveCodexRunSessionBindingAuthority,
|
|
131
112
|
resolveCodexSessionBinding: () => resolveCodexSessionBinding,
|
|
132
113
|
sessionBindingIdentity: () => sessionBindingIdentity,
|
|
133
114
|
validateBindingForWrite: () => validateBindingForWrite
|
|
@@ -144,6 +125,10 @@ async function clearCodexBindingForClient(store, identity, thread, authority) {
|
|
|
144
125
|
function bindingLeaseLostError(key, cause) {
|
|
145
126
|
return new Error(`Lost Codex binding lease: ${key}`, cause === void 0 ? void 0 : { cause });
|
|
146
127
|
}
|
|
128
|
+
/** Builds the terminal coordination error used when a newer OpenClaw session owns the binding. */
|
|
129
|
+
function createCodexSessionGenerationSupersededError(sessionId) {
|
|
130
|
+
return new AgentHarnessSessionSupersededError(`Codex session generation is no longer current: ${sessionId}`);
|
|
131
|
+
}
|
|
147
132
|
/** Lets the authoritative OpenClaw session generation claim a stale stable binding row. */
|
|
148
133
|
async function reclaimCurrentCodexSessionGeneration(params) {
|
|
149
134
|
return await reclaimNativeSessionGenerationWithAuthority({
|
|
@@ -294,20 +279,8 @@ function createCodexAppServerBindingStore(state) {
|
|
|
294
279
|
if (identity.kind !== "session" || !identity.sessionKey?.trim()) return { result: false };
|
|
295
280
|
if (!current) return { result: true };
|
|
296
281
|
if (ownsGeneration) {
|
|
297
|
-
if (current.state
|
|
298
|
-
|
|
299
|
-
next: {
|
|
300
|
-
version: 1,
|
|
301
|
-
state: "cleared",
|
|
302
|
-
sessionId: identity.sessionId,
|
|
303
|
-
...preserveNativeTaskImport(current),
|
|
304
|
-
...ownedLease
|
|
305
|
-
}
|
|
306
|
-
};
|
|
307
|
-
return { result: current.state !== "cleared" || current.retired !== true };
|
|
308
|
-
}
|
|
309
|
-
if (current.sessionId !== mutation.expectedPreviousSessionId) return { result: false };
|
|
310
|
-
if (current.state === "active" && current.binding.connectionScope === "supervision") return { result: false };
|
|
282
|
+
if (current.state !== "cleared" || current.retired !== true || current.sessionId !== mutation.expectedPreviousSessionId) return { result: current.state !== "cleared" || current.retired !== true };
|
|
283
|
+
} else if (current.sessionId !== mutation.expectedPreviousSessionId || current.state === "active" && current.binding.connectionScope === "supervision") return { result: false };
|
|
311
284
|
return {
|
|
312
285
|
result: true,
|
|
313
286
|
next: {
|
|
@@ -430,4 +403,4 @@ function preservedSessionGeneration(identity, current) {
|
|
|
430
403
|
return storedSessionGeneration(identity, current);
|
|
431
404
|
}
|
|
432
405
|
//#endregion
|
|
433
|
-
export {
|
|
406
|
+
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-BZB8RgcF.mjs → session-binding-record-DU_0biMD.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-DmVhedNs.mjs";
|
|
2
|
+
import { a as readStoredCodexAppServerBinding, t as legacyAppPolicyEntrySchema } from "./session-binding-record-codec-BpH8u_G9.mjs";
|
|
3
|
+
import { t as __exportAll } from "./session-binding-sidecars-DD-enC8w.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";
|
|
@@ -94,7 +94,7 @@ function matchesCodexNativeSubagentSubmissionBinding(binding, owner) {
|
|
|
94
94
|
}
|
|
95
95
|
/** Unknown metadata stays opaque through ordinary binding writes. */
|
|
96
96
|
function preserveCodexNativeSubagentSubmissions(currentBinding, nextBinding, value) {
|
|
97
|
-
return currentBinding.threadId === nextBinding.threadId
|
|
97
|
+
return currentBinding.threadId === nextBinding.threadId ? preserveNativePendingAssignments(currentBinding, nextBinding, value) : void 0;
|
|
98
98
|
}
|
|
99
99
|
function readCurrentCodexNativeSubagentSubmissions(state, identity, owner) {
|
|
100
100
|
const stored = readCurrentNativeSubagentBinding(state, identity, owner);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { t as CODEX_PLUGIN_MARKETPLACE_NAME_PATTERN } from "./config-contracts.shared-D85SGEuq.mjs";
|
|
2
|
+
import { t as normalizeCodexServiceTier } from "./service-tier-normalization-BPgw2Wdt.mjs";
|
|
2
3
|
import { z } from "zod";
|
|
3
4
|
//#region extensions/codex/src/app-server/session-binding-record-codec.ts
|
|
4
5
|
/** Canonical persisted binding codec; safe to load before worker transaction admission. */
|
|
@@ -117,45 +118,22 @@ const threadBindingSchema = z.object({
|
|
|
117
118
|
inputTokens: z.number().int().positive()
|
|
118
119
|
}).optional().catch(void 0)
|
|
119
120
|
}).superRefine((binding, context) => {
|
|
120
|
-
|
|
121
|
-
if (!binding.supervisionSourceThreadId) context.addIssue({
|
|
122
|
-
code: "custom",
|
|
123
|
-
message: "supervision connection ownership requires its native source thread id"
|
|
124
|
-
});
|
|
125
|
-
if (binding.preserveNativeModel !== true) context.addIssue({
|
|
126
|
-
code: "custom",
|
|
127
|
-
message: "supervision connection ownership requires native model ownership"
|
|
128
|
-
});
|
|
129
|
-
if (binding.conversationSourceTransferComplete !== true) context.addIssue({
|
|
130
|
-
code: "custom",
|
|
131
|
-
message: "supervision connection ownership requires a completed source transfer"
|
|
132
|
-
});
|
|
133
|
-
if (!binding.pendingSupervisionBranch && (!binding.model?.trim() || !binding.modelProvider)) context.addIssue({
|
|
134
|
-
code: "custom",
|
|
135
|
-
message: "materialized supervision bindings require a native model and provider"
|
|
136
|
-
});
|
|
137
|
-
}
|
|
138
|
-
if (binding.supervisionSourceThreadId && binding.connectionScope !== "supervision") context.addIssue({
|
|
121
|
+
const report = (message) => context.addIssue({
|
|
139
122
|
code: "custom",
|
|
140
|
-
message
|
|
123
|
+
message
|
|
141
124
|
});
|
|
125
|
+
if (binding.connectionScope === "supervision") {
|
|
126
|
+
if (!binding.supervisionSourceThreadId) report("supervision connection ownership requires its native source thread id");
|
|
127
|
+
if (binding.preserveNativeModel !== true) report("supervision connection ownership requires native model ownership");
|
|
128
|
+
if (binding.conversationSourceTransferComplete !== true) report("supervision connection ownership requires a completed source transfer");
|
|
129
|
+
if (!binding.pendingSupervisionBranch && (!binding.model?.trim() || !binding.modelProvider)) report("materialized supervision bindings require a native model and provider");
|
|
130
|
+
}
|
|
131
|
+
if (binding.supervisionSourceThreadId && binding.connectionScope !== "supervision") report("a supervision source thread id requires supervision connection ownership");
|
|
142
132
|
if (!binding.pendingSupervisionBranch) return;
|
|
143
|
-
if (binding.threadId !== binding.pendingSupervisionBranch.sourceThreadId)
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
if (binding.supervisionSourceThreadId !== binding.pendingSupervisionBranch.sourceThreadId) context.addIssue({
|
|
148
|
-
code: "custom",
|
|
149
|
-
message: "pending supervision source must match its durable source identity"
|
|
150
|
-
});
|
|
151
|
-
if (binding.preserveNativeModel !== true) context.addIssue({
|
|
152
|
-
code: "custom",
|
|
153
|
-
message: "pending supervision bindings must defer model selection to Codex App Server"
|
|
154
|
-
});
|
|
155
|
-
if (binding.connectionScope !== "supervision") context.addIssue({
|
|
156
|
-
code: "custom",
|
|
157
|
-
message: "pending supervision bindings require supervision connection ownership"
|
|
158
|
-
});
|
|
133
|
+
if (binding.threadId !== binding.pendingSupervisionBranch.sourceThreadId) report("pending supervision source must match the provisional thread binding");
|
|
134
|
+
if (binding.supervisionSourceThreadId !== binding.pendingSupervisionBranch.sourceThreadId) report("pending supervision source must match its durable source identity");
|
|
135
|
+
if (binding.preserveNativeModel !== true) report("pending supervision bindings must defer model selection to Codex App Server");
|
|
136
|
+
if (binding.connectionScope !== "supervision") report("pending supervision bindings require supervision connection ownership");
|
|
159
137
|
});
|
|
160
138
|
function matchesPendingSupervisionBranch(binding, expected) {
|
|
161
139
|
const pending = binding?.pendingSupervisionBranch;
|
|
@@ -198,8 +176,7 @@ function validateBindingForWrite(binding) {
|
|
|
198
176
|
/** Parses stored or shipped sidecar data into the current domain value. */
|
|
199
177
|
function readCodexAppServerThreadBinding(value) {
|
|
200
178
|
const result = threadBindingSchema.safeParse(value);
|
|
201
|
-
|
|
202
|
-
return result.data;
|
|
179
|
+
return result.success ? result.data : void 0;
|
|
203
180
|
}
|
|
204
181
|
function stripUndefinedBinding(binding) {
|
|
205
182
|
return stripUndefinedValue(binding);
|
package/dist/.setup/{session-binding-sidecars-BrdV95Fg.mjs → session-binding-sidecars-DD-enC8w.mjs}
RENAMED
|
@@ -220,20 +220,23 @@ async function readLegacySessionIndex(storePath) {
|
|
|
220
220
|
for (const [sessionKey, value] of Object.entries(raw)) {
|
|
221
221
|
if (!isRecord(value)) return { failure: `session index ${storePath} has invalid entries` };
|
|
222
222
|
if (value.sessionId === void 0) continue;
|
|
223
|
-
|
|
224
|
-
const
|
|
225
|
-
const
|
|
226
|
-
|
|
227
|
-
|
|
223
|
+
if (!isSafeLegacySessionId(value.sessionId)) return { failure: `session index ${storePath} has invalid entries` };
|
|
224
|
+
const entry = { sessionId: value.sessionId.trim() };
|
|
225
|
+
for (const key of [
|
|
226
|
+
"sessionFile",
|
|
227
|
+
"lifecycleRevision",
|
|
228
|
+
"agentHarnessId"
|
|
229
|
+
]) {
|
|
230
|
+
const field = value[key];
|
|
231
|
+
if (field !== void 0) {
|
|
232
|
+
if (typeof field !== "string") return { failure: `session index ${storePath} has invalid entries` };
|
|
233
|
+
entry[key] = field;
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
if (typeof value.updatedAt === "number" && Number.isFinite(value.updatedAt) && value.updatedAt >= 0) entry.updatedAt = value.updatedAt;
|
|
228
237
|
entries.push({
|
|
229
238
|
sessionKey,
|
|
230
|
-
entry
|
|
231
|
-
sessionId,
|
|
232
|
-
...typeof sessionFile === "string" ? { sessionFile } : {},
|
|
233
|
-
...typeof lifecycleRevision === "string" ? { lifecycleRevision } : {},
|
|
234
|
-
...typeof agentHarnessId === "string" ? { agentHarnessId } : {},
|
|
235
|
-
...typeof value.updatedAt === "number" && Number.isFinite(value.updatedAt) && value.updatedAt >= 0 ? { updatedAt: value.updatedAt } : {}
|
|
236
|
-
}
|
|
239
|
+
entry
|
|
237
240
|
});
|
|
238
241
|
}
|
|
239
242
|
return { entries };
|
|
@@ -304,21 +307,17 @@ async function collectSessionSurfaces(params) {
|
|
|
304
307
|
async function collectLegacyBindingSources(params, options = {}) {
|
|
305
308
|
const surfaces = await collectSessionSurfaces(params);
|
|
306
309
|
const sources = /* @__PURE__ */ new Map();
|
|
307
|
-
const addSource = async (sidecarPath, surface) => {
|
|
308
|
-
const canonicalSidecar = await canonicalPathFromExistingAncestor(sidecarPath);
|
|
309
|
-
const source = sources.get(canonicalSidecar) ?? {
|
|
310
|
-
sidecarPath: canonicalSidecar,
|
|
311
|
-
transcriptPath: sidecarPath.slice(0, -22),
|
|
312
|
-
agentIds: /* @__PURE__ */ new Set()
|
|
313
|
-
};
|
|
314
|
-
for (const agentId of surface.agentIds) source.agentIds.add(agentId);
|
|
315
|
-
sources.set(canonicalSidecar, source);
|
|
316
|
-
return source;
|
|
317
|
-
};
|
|
318
310
|
for (const surface of surfaces) {
|
|
319
311
|
const sidecars = surface.scan ? walkSidecars(surface.root) : iterateIndexedSidecars(surface);
|
|
320
312
|
for await (const sidecarPath of sidecars) {
|
|
321
|
-
const
|
|
313
|
+
const canonicalSidecar = await canonicalPathFromExistingAncestor(sidecarPath);
|
|
314
|
+
const source = sources.get(canonicalSidecar) ?? {
|
|
315
|
+
sidecarPath: canonicalSidecar,
|
|
316
|
+
transcriptPath: sidecarPath.slice(0, -22),
|
|
317
|
+
agentIds: /* @__PURE__ */ new Set()
|
|
318
|
+
};
|
|
319
|
+
for (const agentId of surface.agentIds) source.agentIds.add(agentId);
|
|
320
|
+
sources.set(canonicalSidecar, source);
|
|
322
321
|
if (options.firstOnly) return {
|
|
323
322
|
sources: [source],
|
|
324
323
|
surfaces
|
|
@@ -368,7 +367,6 @@ async function* walkSidecars(root) {
|
|
|
368
367
|
async function collectBindingOwners(sources, surfaces, params) {
|
|
369
368
|
const sourcePaths = new Set(await Promise.all(sources.map((source) => canonicalPathFromExistingAncestor(source.transcriptPath))));
|
|
370
369
|
const owners = /* @__PURE__ */ new Map();
|
|
371
|
-
const storePaths = new Set(surfaces.flatMap((surface) => [...surface.storePaths]));
|
|
372
370
|
const storeAgentIds = /* @__PURE__ */ new Map();
|
|
373
371
|
for (const surface of surfaces) for (const storePath of surface.storePaths) {
|
|
374
372
|
const agents = storeAgentIds.get(storePath) ?? /* @__PURE__ */ new Set();
|
|
@@ -376,7 +374,7 @@ async function collectBindingOwners(sources, surfaces, params) {
|
|
|
376
374
|
storeAgentIds.set(storePath, agents);
|
|
377
375
|
}
|
|
378
376
|
const failures = [];
|
|
379
|
-
for (const storePath of
|
|
377
|
+
for (const [storePath, agentIds] of storeAgentIds) {
|
|
380
378
|
const canonicalStorePath = await canonicalPathFromExistingAncestor(storePath);
|
|
381
379
|
const index = await readLegacySessionIndex(storePath);
|
|
382
380
|
if ("failure" in index) {
|
|
@@ -389,7 +387,7 @@ async function collectBindingOwners(sources, surfaces, params) {
|
|
|
389
387
|
const agentId = tryResolveLegacyBindingOwnerAgentId({
|
|
390
388
|
sessionKey,
|
|
391
389
|
config: params.config,
|
|
392
|
-
storeAgentIds:
|
|
390
|
+
storeAgentIds: agentIds
|
|
393
391
|
});
|
|
394
392
|
if (!agentId) {
|
|
395
393
|
failures.push(`session index ${storePath} has an ambiguous owner for ${sessionKey}`);
|
|
@@ -484,7 +482,7 @@ async function migrateSource(source, candidates, params, store) {
|
|
|
484
482
|
return await withFileLock(source.sidecarPath, LEGACY_BINDING_LOCK_OPTIONS, async () => {
|
|
485
483
|
const [contents, stat] = await Promise.all([fs.readFile(source.sidecarPath, "utf8"), fs.stat(source.sidecarPath)]);
|
|
486
484
|
const raw = JSON.parse(contents);
|
|
487
|
-
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-JEHNMPsr.mjs").then((n) => n.a), import("./conversation-binding-data-UgLuTSQT.mjs").then((n) => n.t)]);
|
|
488
486
|
const agentId = owner?.agentId ?? (source.agentIds.size === 1 ? [...source.agentIds][0] : void 0);
|
|
489
487
|
const baseStored = createStoredCodexAppServerBinding(raw, {
|
|
490
488
|
now: stat.mtime.toISOString(),
|
|
@@ -509,46 +507,45 @@ async function migrateSource(source, candidates, params, store) {
|
|
|
509
507
|
kind: "conversation",
|
|
510
508
|
bindingId: legacyCodexConversationBindingId(sessionFile)
|
|
511
509
|
}));
|
|
512
|
-
const
|
|
510
|
+
const readNormalizedRow = async (key) => {
|
|
511
|
+
const current = await store.lookup(key);
|
|
512
|
+
if (current === void 0) return;
|
|
513
513
|
const parsed = readStoredCodexAppServerBinding(current);
|
|
514
|
-
if (!parsed) return
|
|
514
|
+
if (!parsed) return `canonical plugin state is invalid at ${key}`;
|
|
515
515
|
const normalized = normalizeStoredCodexAppServerBindingFingerprints(parsed);
|
|
516
|
-
if (!normalized) return
|
|
517
|
-
if (isDeepStrictEqual(parsed, normalized)) return
|
|
518
|
-
if (parsed.lease && parsed.lease.expiresAt > Date.now()) return
|
|
516
|
+
if (!normalized) return `canonical plugin state is invalid at ${key}`;
|
|
517
|
+
if (isDeepStrictEqual(parsed, normalized)) return parsed;
|
|
518
|
+
if (parsed.lease && parsed.lease.expiresAt > Date.now()) return `canonical plugin state is leased at ${key}`;
|
|
519
519
|
const update = store.update;
|
|
520
|
-
if (!update) return
|
|
520
|
+
if (!update) return `canonical plugin state could not be normalized at ${key}`;
|
|
521
521
|
await update(key, (candidate) => {
|
|
522
522
|
const candidateParsed = readStoredCodexAppServerBinding(candidate);
|
|
523
523
|
if (!candidateParsed || !isDeepStrictEqual(candidateParsed, parsed)) return;
|
|
524
524
|
return normalized;
|
|
525
525
|
});
|
|
526
526
|
const persisted = readStoredCodexAppServerBinding(await store.lookup(key));
|
|
527
|
-
if (!persisted || !isDeepStrictEqual(persisted, normalized)) return
|
|
527
|
+
if (!persisted || !isDeepStrictEqual(persisted, normalized)) return `canonical plugin state changed at ${key}`;
|
|
528
528
|
importedKeys++;
|
|
529
|
-
return
|
|
529
|
+
return normalized;
|
|
530
530
|
};
|
|
531
531
|
let currentConversation;
|
|
532
532
|
for (const key of conversationKeys) {
|
|
533
|
-
const current = await
|
|
534
|
-
if (current ===
|
|
535
|
-
|
|
536
|
-
if (result.warning || !result.value) return retain(result.warning ?? `canonical plugin state is invalid at ${key}`);
|
|
537
|
-
currentConversation ??= result.value;
|
|
533
|
+
const current = await readNormalizedRow(key);
|
|
534
|
+
if (typeof current === "string") return retain(current);
|
|
535
|
+
currentConversation ??= current;
|
|
538
536
|
}
|
|
539
537
|
const stored = currentConversation ?? baseStored;
|
|
540
|
-
const sessionKey = owner ? bindingStoreKey({
|
|
541
|
-
kind: "session",
|
|
542
|
-
agentId: owner.agentId,
|
|
543
|
-
sessionId: owner.sessionId,
|
|
544
|
-
sessionKey: owner.sessionKey
|
|
545
|
-
}) : void 0;
|
|
546
538
|
const conversationEntries = conversationKeys.map((key) => ({
|
|
547
539
|
key,
|
|
548
540
|
value: stored
|
|
549
541
|
}));
|
|
550
|
-
const sessionEntry = owner
|
|
551
|
-
key:
|
|
542
|
+
const sessionEntry = owner ? {
|
|
543
|
+
key: bindingStoreKey({
|
|
544
|
+
kind: "session",
|
|
545
|
+
agentId: owner.agentId,
|
|
546
|
+
sessionId: owner.sessionId,
|
|
547
|
+
sessionKey: owner.sessionKey
|
|
548
|
+
}),
|
|
552
549
|
value: copyBindingForSession(stored, owner.sessionId)
|
|
553
550
|
} : void 0;
|
|
554
551
|
const entries = [...conversationEntries, ...sessionEntry ? [sessionEntry] : []];
|
|
@@ -558,11 +555,9 @@ async function migrateSource(source, candidates, params, store) {
|
|
|
558
555
|
return target.state === "cleared" ? parsed.state === "cleared" && parsed.sessionId === target.sessionId && parsed.retired === target.retired : parsed.state === "active" && parsed.sessionId === target.sessionId && isDeepStrictEqual(parsed.binding, target.binding);
|
|
559
556
|
};
|
|
560
557
|
for (const entry of entries) {
|
|
561
|
-
const current = await
|
|
562
|
-
if (current ===
|
|
563
|
-
|
|
564
|
-
if (result.warning || !result.value) return retain(result.warning ?? `canonical plugin state is invalid at ${entry.key}`);
|
|
565
|
-
if (!hasExpected(result.value, entry.value)) return retain(`canonical plugin state changed at ${entry.key}`);
|
|
558
|
+
const current = await readNormalizedRow(entry.key);
|
|
559
|
+
if (typeof current === "string") return retain(current);
|
|
560
|
+
if (current && !hasExpected(current, entry.value)) return retain(`canonical plugin state changed at ${entry.key}`);
|
|
566
561
|
}
|
|
567
562
|
for (const entry of entries) {
|
|
568
563
|
if (await store.registerIfAbsent(entry.key, entry.value)) importedKeys++;
|
package/dist/.setup/{session-catalog-adoption-CPIP4S_y.mjs → session-catalog-adoption-Ca3OYGYM.mjs}
RENAMED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { T as requireBoundThread, d as boundedCatalogString, o as CatalogParamsError } from "./session-catalog-parsing-
|
|
2
|
-
import { m as sessionBindingIdentity } from "./session-binding-record-
|
|
1
|
+
import { T as requireBoundThread, d as boundedCatalogString, o as CatalogParamsError } from "./session-catalog-parsing-DkeoVn60.mjs";
|
|
2
|
+
import { m as sessionBindingIdentity } from "./session-binding-record-DU_0biMD.mjs";
|
|
3
3
|
import { n as codexUpstreamBaseline, t as codexLastTerminalTurnId } from "./session-upstream-marker-D15C9NHp.mjs";
|
|
4
|
-
import {
|
|
5
|
-
import { adoptionSessionKeyRest, catalogSessionActions } from "./session-catalog-node-adoption-
|
|
4
|
+
import { r as reclaimCurrentCodexSessionGeneration } from "./session-binding-JEHNMPsr.mjs";
|
|
5
|
+
import { adoptionSessionKeyRest, catalogSessionActions } from "./session-catalog-node-adoption-BdP9Zjqo.mjs";
|
|
6
6
|
import { isRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
7
7
|
import { listSessionCatalogEntries, sessionCatalogAdoptedSessionKey, sessionCatalogAdoptedSourceKey } from "openclaw/plugin-sdk/session-catalog";
|
|
8
8
|
//#region extensions/codex/src/session-catalog-adoption.ts
|
|
@@ -34,34 +34,30 @@ function readCodexSupervisionMarker(entry) {
|
|
|
34
34
|
};
|
|
35
35
|
}
|
|
36
36
|
async function listAdoptedSessionEntries(params) {
|
|
37
|
-
const candidateForEntry = ({ agentId, entry, sessionKey }) => {
|
|
38
|
-
const sessionKeyRest = adoptionSessionKeyRest(sessionKey);
|
|
39
|
-
const marker = readCodexSupervisionMarker(entry);
|
|
40
|
-
if (!sessionKeyRest.startsWith(CODEX_SUPERVISION_SESSION_KEY_PREFIX) || !marker || entry.initializationPending === true || entry.agentHarnessId !== "codex" || entry.modelSelectionLocked !== true) return;
|
|
41
|
-
const sessionId = entry.sessionId?.trim();
|
|
42
|
-
if (!sessionId) return;
|
|
43
|
-
return {
|
|
44
|
-
agentId,
|
|
45
|
-
sessionKey,
|
|
46
|
-
sessionKeyRest,
|
|
47
|
-
sessionId,
|
|
48
|
-
marker,
|
|
49
|
-
identity: sessionBindingIdentity({
|
|
50
|
-
sessionId,
|
|
51
|
-
sessionKey,
|
|
52
|
-
config: params.config
|
|
53
|
-
})
|
|
54
|
-
};
|
|
55
|
-
};
|
|
56
37
|
function* candidates() {
|
|
57
|
-
for (const entry of listSessionCatalogEntries({
|
|
38
|
+
for (const { agentId, entry, sessionKey } of listSessionCatalogEntries({
|
|
58
39
|
...params.agentId ? { agentId: params.agentId } : {},
|
|
59
40
|
config: params.config ?? {},
|
|
60
41
|
runtime: params.runtime,
|
|
61
42
|
sessionEntries: params.sessionEntries
|
|
62
43
|
})) {
|
|
63
|
-
const
|
|
64
|
-
|
|
44
|
+
const sessionKeyRest = adoptionSessionKeyRest(sessionKey);
|
|
45
|
+
const marker = readCodexSupervisionMarker(entry);
|
|
46
|
+
if (!sessionKeyRest.startsWith(CODEX_SUPERVISION_SESSION_KEY_PREFIX) || !marker || entry.initializationPending === true || entry.agentHarnessId !== "codex" || entry.modelSelectionLocked !== true) continue;
|
|
47
|
+
const sessionId = entry.sessionId?.trim();
|
|
48
|
+
if (!sessionId) continue;
|
|
49
|
+
yield {
|
|
50
|
+
agentId,
|
|
51
|
+
sessionKey,
|
|
52
|
+
sessionKeyRest,
|
|
53
|
+
sessionId,
|
|
54
|
+
marker,
|
|
55
|
+
identity: sessionBindingIdentity({
|
|
56
|
+
sessionId,
|
|
57
|
+
sessionKey,
|
|
58
|
+
config: params.config
|
|
59
|
+
})
|
|
60
|
+
};
|
|
65
61
|
}
|
|
66
62
|
}
|
|
67
63
|
const collect = async (selected, readBinding = async (identity) => {
|
|
@@ -168,7 +164,7 @@ async function createOrReuseAdoptedSession(params) {
|
|
|
168
164
|
sourceThreadId: params.sourceThread.id,
|
|
169
165
|
...params.sourceHomeId ? { sourceHomeId: params.sourceHomeId } : {}
|
|
170
166
|
};
|
|
171
|
-
const { createImportedCodexSession } = await import("./session-history-import-
|
|
167
|
+
const { createImportedCodexSession } = await import("./session-history-import-CaO8s6ta.mjs");
|
|
172
168
|
const created = await createImportedCodexSession({
|
|
173
169
|
runtime: params.api.runtime,
|
|
174
170
|
bindingStore: params.bindingStore,
|
package/dist/.setup/{session-catalog-archive-DcgwvSbF.mjs → session-catalog-archive-Bv6gV7x9.mjs}
RENAMED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { o as CatalogParamsError } from "./session-catalog-parsing-
|
|
2
|
-
import { m as sessionBindingIdentity } from "./session-binding-record-
|
|
3
|
-
import { t as assertCodexArchiveDescendantsUnowned } from "./thread-archive-guard-
|
|
4
|
-
import "./session-binding-
|
|
5
|
-
import { catalogSessionActions } from "./session-catalog-node-adoption-
|
|
6
|
-
import { isAdoptionSessionKeyForThread, requireIdleThread } from "./session-catalog-adoption-
|
|
1
|
+
import { o as CatalogParamsError } from "./session-catalog-parsing-DkeoVn60.mjs";
|
|
2
|
+
import { m as sessionBindingIdentity } from "./session-binding-record-DU_0biMD.mjs";
|
|
3
|
+
import { t as assertCodexArchiveDescendantsUnowned } from "./thread-archive-guard-LKdwQKyr.mjs";
|
|
4
|
+
import "./session-binding-JEHNMPsr.mjs";
|
|
5
|
+
import { catalogSessionActions } from "./session-catalog-node-adoption-BdP9Zjqo.mjs";
|
|
6
|
+
import { isAdoptionSessionKeyForThread, requireIdleThread } from "./session-catalog-adoption-Ca3OYGYM.mjs";
|
|
7
7
|
import { listAgentIds } from "openclaw/plugin-sdk/agent-scope-runtime";
|
|
8
8
|
import { sessionCatalogAdoptedSourceKey } from "openclaw/plugin-sdk/session-catalog";
|
|
9
9
|
//#region extensions/codex/src/session-catalog-archive.ts
|