@openclaw/codex 2026.9.4 → 2026.9.5
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/assets/activity.svg +30 -0
- package/assets/icon.png +0 -0
- package/dist/.setup/account-usage-runtime-C2MOIvfq.mjs +75 -0
- package/dist/{apply-CvT8tW5i.js → .setup/apply-CJ0ZfmBG.mjs} +11 -11
- package/dist/.setup/async-questions-DdhOCwGi.mjs +27 -0
- package/dist/{attempt-client-cleanup-DKHzbwt5.js → .setup/attempt-client-cleanup-BpYKdTA0.mjs} +29 -14
- package/dist/{attempt-context-D44yeDII.js → .setup/attempt-context-VXVwTCfS.mjs} +5 -5
- package/dist/.setup/attempt-terminal-gZrxQ35N.mjs +5 -0
- package/dist/{auth-binding-CWlKVccJ.js → .setup/auth-binding-DhLWa_7K.mjs} +1 -1
- package/dist/{auth-cache-key-7orQae_j.js → .setup/auth-cache-key-QirmgiCo.mjs} +3 -3
- package/dist/{auth-profile-CwzO4_RG.js → .setup/auth-profile-WqZtZfXN.mjs} +1 -1
- package/dist/.setup/binding-connection-Bm38niE8.mjs +50 -0
- package/dist/.setup/binding-connection.runtime-CnRMC0ta.mjs +48 -0
- package/dist/{bounded-turn-C_Hneydj.js → .setup/bounded-turn-BtlZcivC.mjs} +16 -11
- package/dist/{build-state-BCmg9-5p.js → .setup/build-state-Xx9ybZqa.mjs} +1 -1
- package/dist/{capabilities-8vx68WLH.js → .setup/capabilities-_vXcZGSx.mjs} +1 -1
- package/dist/{client-B57KWPQx.js → .setup/client-vXs2929Q.mjs} +332 -163
- package/dist/{command-dispatch-BpduNGVf.js → .setup/command-dispatch-naHIZwwF.mjs} +3 -3
- package/dist/{command-formatters-lxlkNZgU.js → .setup/command-formatters-CGEkdawF.mjs} +2 -2
- package/dist/{command-handlers-tiL9iWj7.js → .setup/command-handlers-BtAJEW1X.mjs} +59 -42
- package/dist/{command-rpc-CR5EOEZX.js → .setup/command-rpc-DHFpn4le.mjs} +22 -13
- package/dist/{compact-B_H3AOd7.js → .setup/compact-C3i3qlzj.mjs} +28 -43
- package/dist/{config-oIORaQ5T.js → .setup/config-CedDWjM-.mjs} +5 -4
- package/dist/{config-options-CXMq1T-C.js → .setup/config-options-BsanJ8QG.mjs} +6 -418
- package/dist/{protocol-5bh1G-H7.js → .setup/config-parsing-CcB9iPoq.mjs} +9 -51
- package/dist/{config-runtime-D0zGNIHu.js → .setup/config-runtime-CeAhl_h4.mjs} +2 -2
- package/dist/.setup/config-security-BRQ2mgW9.mjs +465 -0
- package/dist/{conversation-binding-DsB4-O7U.js → .setup/conversation-binding-DhzrpTM6.mjs} +23 -21
- package/dist/{conversation-binding-data-BiodpIzq.js → .setup/conversation-binding-data-CrcyZk6O.mjs} +1 -1
- package/dist/{conversation-control-CtUu1b3m.js → .setup/conversation-control-DN53ns41.mjs} +17 -13
- package/dist/.setup/cyber-failover-DYwbmf1o.mjs +123 -0
- package/dist/.setup/cyber-failover-notice-e9G3J9-e.mjs +17 -0
- package/dist/{dynamic-tools-CmN5RAip.js → .setup/dynamic-tools-D16lOp67.mjs} +101 -55
- package/dist/{effective-mcp-catalog-Bd73bqA8.js → .setup/effective-mcp-catalog-K6kLCN8X.mjs} +3 -3
- package/dist/{ephemeral-turn-D78_VmzO.js → .setup/ephemeral-turn-R1gA8Sn6.mjs} +4 -5
- package/dist/{event-projector-assistant-message-BmBM4qBV.js → .setup/event-projector-assistant-message-DNUR1s0A.mjs} +6 -3
- package/dist/{event-projector-items-5VhsECCO.js → .setup/event-projector-items-DyTQ_XqL.mjs} +1 -1
- package/dist/{attempt-notifications-C9XufG6l.js → .setup/event-projector-usage-C7Ntzs-f.mjs} +102 -9
- package/dist/{harness-C7rRa7bm.js → .setup/harness-rxaaoN-o.mjs} +74 -20
- package/dist/{inference-context-Dr_mzvk4.js → .setup/inference-context-fulhZuz8.mjs} +1 -1
- package/dist/{inference-proxy-HGXKUIre.js → .setup/inference-proxy-CC15HuSi.mjs} +4 -4
- package/dist/{isolated-completion-DWVb5U2J.js → .setup/isolated-completion-B6srt48J.mjs} +7 -7
- package/dist/{launch-args-RXQwn8zV.js → .setup/launch-args-DnMak49W.mjs} +22 -1
- package/dist/{managed-binary-D22rNEcR.js → .setup/managed-binary-DP6Rib3P.mjs} +2 -2
- package/dist/{managed-thread-store-D1t5jh3G.js → .setup/managed-thread-store-BMqgThVL.mjs} +48 -14
- package/dist/{model-catalog-Dq2n8f_p.js → .setup/model-catalog-DkvUuBey.mjs} +35 -10
- package/dist/{models-PCKOim-h.js → .setup/models-BDFgm_G-.mjs} +3 -3
- package/dist/.setup/native-auth-BLZGqFjw.mjs +57 -0
- package/dist/{native-subagent-history-DjtPloaU.js → .setup/native-subagent-history-YXaL6dMd.mjs} +24 -29
- package/dist/.setup/native-subagent-monitor-B1hxzIOy.mjs +5031 -0
- package/dist/{native-subagent-task-ids-BzTdT0Uw.js → .setup/native-subagent-task-ids-DsuOonKv.mjs} +32 -8
- package/dist/{node-cli-sessions-DKaOmVUh.js → .setup/node-cli-sessions-Cl8b2ZF3.mjs} +1 -1
- package/dist/{node-exec-server.runtime-Cl2vapEi.js → .setup/node-exec-server.runtime-BaViBKNz.mjs} +3 -3
- package/dist/{plan-7uG-Fp36.js → .setup/plan-xD7WKYTM.mjs} +64 -48
- package/dist/{plugin-activation-BYQculil.js → .setup/plugin-activation-r8nq5Jzp.mjs} +3 -3
- package/dist/{plugin-app-cache-key-d0eKxy7b.js → .setup/plugin-app-cache-key-BOxKP7db.mjs} +29 -25
- package/dist/{plugin-approval-roundtrip-Bz3FT8W5.js → .setup/plugin-approval-roundtrip-CjfzafAZ.mjs} +1 -1
- package/dist/{plugin-inventory-oL4Na1ZG.js → .setup/plugin-inventory-DUle8DLz.mjs} +7 -6
- package/dist/{plugin-metadata-cache-ClPJpRio.js → .setup/plugin-metadata-cache-DsS5buNa.mjs} +29 -14
- package/dist/{provider-capabilities-BvCUL69A.js → .setup/provider-capabilities-B8J4Dy-O.mjs} +2 -2
- package/dist/{provider-MQ8PVkuE.js → .setup/provider-fFh_-VR3.mjs} +4 -4
- package/dist/{rate-limits-CBMmWBr9.js → .setup/rate-limits-DOEGYRNs.mjs} +90 -46
- package/dist/{request-B7hEkBGq.js → .setup/request-BioXJLYa.mjs} +113 -33
- package/dist/.setup/run-attempt-lifecycle-B7JbY4-F.mjs +71 -0
- package/dist/{run-attempt-CvsAAGa0.js → .setup/run-attempt-rlA07pUv.mjs} +580 -498
- package/dist/{runtime-artifact-BJ0rXBZ_.js → .setup/runtime-artifact-Dy38Z5iU.mjs} +2 -2
- package/dist/{sandbox-guard-BxgyoM8M.js → .setup/sandbox-guard-BBP-RbTf.mjs} +3 -3
- package/dist/{session-binding-CI8UuilT.js → .setup/session-binding-_0W_fHRr.mjs} +46 -64
- package/dist/{session-binding-record-Bcvslnhf.js → .setup/session-binding-record-TH3xA0zj.mjs} +181 -3
- package/dist/.setup/session-binding-sidecars-CKYEcfNn.mjs +543 -0
- package/dist/{session-catalog-adoption-tcZi1IfX.js → .setup/session-catalog-adoption-CR_whkEW.mjs} +6 -6
- package/dist/{session-catalog-archive-CwKg8Xz2.js → .setup/session-catalog-archive-CwZaPacf.mjs} +6 -6
- package/dist/.setup/session-catalog-events-jMcYfQyd.mjs +250 -0
- package/dist/.setup/session-catalog-fUdWDx-U.mjs +2464 -0
- package/dist/.setup/session-catalog-index-B141u15s.mjs +1070 -0
- package/dist/.setup/session-catalog-index-order-Cc5BzlQr.mjs +48 -0
- package/dist/.setup/session-catalog-index-state-BAuDztHN.mjs +180 -0
- package/dist/{thread-history-page-D0JIp48V.js → .setup/session-catalog-native-projection-ChV3cCtm.mjs} +206 -95
- package/dist/{session-catalog-node-adoption-B1tgDW-m.js → .setup/session-catalog-node-adoption-BVRsYOSh.mjs} +3 -3
- package/dist/{session-catalog-node-continue-Ci-DXyJP.js → .setup/session-catalog-node-continue-Dowv8osw.mjs} +7 -7
- package/dist/.setup/session-catalog-projection-C1Bj9Jl-.mjs +414 -0
- package/dist/{session-cli-DNN_jhGc.js → .setup/session-cli-DIj-IE-E.mjs} +4 -4
- package/dist/{session-history-Cz-tOOYj.js → .setup/session-history-C--SrLI8.mjs} +10 -5
- package/dist/{session-history-import-DwyijFI6.js → .setup/session-history-import-JHXT5Xfi.mjs} +4 -4
- package/dist/{session-history-read-cxPUxyVV.js → .setup/session-history-read-B3ZfSUbF.mjs} +2 -2
- package/dist/{session-history.worker-BeK1YOyT.js → .setup/session-history.worker-CpNj7H_P.mjs} +5 -6
- package/dist/{session-initialization-Ct0_Hzmg.js → .setup/session-initialization-DH1z6fXn.mjs} +2 -2
- package/dist/{session-permission-policy-BBmXA8Eg.js → .setup/session-permission-policy-DhurXY0l.mjs} +2 -2
- package/dist/{session-retirement-B2YfbAAT.js → .setup/session-retirement-CU87AOg9.mjs} +6 -6
- package/dist/{settled-turn-context-Du6gdUDd.js → .setup/settled-turn-context-fmwouT5I.mjs} +2 -2
- package/dist/{settled-turn-finalizer-Dn91stmc.js → .setup/settled-turn-finalizer-CiY2bLFK.mjs} +9 -9
- package/dist/{shared-client-CscigXXL.js → .setup/shared-client-BpTtuLQ5.mjs} +286 -145
- package/dist/{side-question-BGMJQf4U.js → .setup/side-question-DSCZyoBD.mjs} +64 -47
- package/dist/{source-CElXU0Oy.js → .setup/source-Bjp4UQij.mjs} +7 -6
- package/dist/{thread-archive-guard-DfpBr-Sz.js → .setup/thread-archive-guard-jmecf6OJ.mjs} +1 -1
- package/dist/.setup/thread-history-page-BTx-4xsg.mjs +83 -0
- package/dist/{thread-lifecycle-DXl1-I6b.js → .setup/thread-lifecycle-Cik28qWn.mjs} +256 -128
- package/dist/{thread-ownership-BsDRTsyp.js → .setup/thread-ownership-skomxnIt.mjs} +4 -4
- package/dist/{thread-policy-BuEQfE0g.js → .setup/thread-policy-Cjs4B8xf.mjs} +2 -2
- package/dist/{thread-resume-DsDOZpFg.js → .setup/thread-resume-BkNpj9Pz.mjs} +8 -5
- package/dist/.setup/timeout-DZF05XrR.mjs +63 -0
- package/dist/{transcript-history-projection-v17wXgdK.js → .setup/transcript-history-projection-DHNBDhCU.mjs} +8 -3
- package/dist/{transcript-mirror-C5CKgNy6.js → .setup/transcript-mirror-D4qp_leP.mjs} +15 -6
- package/dist/{transcript-mirror-attestation-DibE0krH.js → .setup/transcript-mirror-attestation-CzM-94NC.mjs} +4 -1
- package/dist/{transport-stdio-BGjHoYLr.js → .setup/transport-stdio-Cmx94Oiy.mjs} +149 -44
- package/dist/{upstream-session-fork-BZerMte_.js → .setup/upstream-session-fork-D3UKxgVD.mjs} +27 -26
- package/dist/{usage-tCk-mg_x.js → .setup/usage-BOgBEKso.mjs} +4 -4
- package/dist/.setup/usage-limit-error-C0ow7DOc.mjs +166 -0
- package/dist/{version-omm6IPI3.js → .setup/version-CoqzXPgK.mjs} +1 -1
- package/dist/{web-search-provider.runtime-B7bGbGWq.js → .setup/web-search-provider.runtime-CTGuJt6i.mjs} +3 -3
- package/dist/api.js +6 -6
- package/dist/cli-metadata.js +1 -1
- package/dist/doctor-contract-api.js +8 -528
- package/dist/harness.js +1 -1
- package/dist/index.js +123 -83
- package/dist/media-understanding-provider.js +3 -3
- package/dist/migration-provider-api.js +1 -1
- package/dist/native-tool-policy.js +12 -0
- package/dist/provider-discovery.js +18 -0
- package/dist/session-history-worker-runtime.js +23 -5
- package/dist/session-history.worker.js +2 -2
- package/dist/web-search-contract-api.js +1 -1
- package/openclaw.plugin.json +354 -69
- package/package.json +11 -8
- package/dist/binding-connection-D3udKbIE.js +0 -60
- package/dist/event-projector-usage-BfXmpOec.js +0 -102
- package/dist/native-subagent-history-owner-Pcp7JuVF.js +0 -34
- package/dist/native-subagent-monitor-fQ7eIXEf.js +0 -2978
- package/dist/rpc-error-ttN_QjEm.js +0 -30
- package/dist/session-catalog-ct-AH01I.js +0 -1477
- package/dist/session-catalog-home-id-CwhLdC03.js +0 -18
- package/dist/session-catalog-provenance-D-dIfRAH.js +0 -96
- package/dist/timeout-BVw8aaM1.js +0 -33
- package/dist/{auth-profile-selection-DFu9e167.js → .setup/auth-profile-selection-DFu9e167.mjs} +0 -0
- package/dist/{config-utils-DujwEnhg.js → .setup/config-utils-DujwEnhg.mjs} +0 -0
- package/dist/{context-compaction-activity-CMla5FPJ.js → .setup/context-compaction-activity-CMla5FPJ.mjs} +0 -0
- package/dist/{elicitation-input-DPoK8F7w.js → .setup/elicitation-input-DPoK8F7w.mjs} +0 -0
- package/dist/{history-rejection-B4nOXNXF.js → .setup/history-rejection-B4nOXNXF.mjs} +0 -0
- package/dist/{image-payload-sanitizer-tupAr-2o.js → .setup/image-payload-sanitizer-tupAr-2o.mjs} +0 -0
- package/dist/{incognito-session-uhrBF6wJ.js → .setup/incognito-session-uhrBF6wJ.mjs} +0 -0
- package/dist/{local-runtime-attribution-B_2mnqhb.js → .setup/local-runtime-attribution-B_2mnqhb.mjs} +0 -0
- package/dist/{native-execution-policy-umd0tgh4.js → .setup/native-execution-policy-YBMHSzC4.mjs} +1 -1
- /package/dist/{plugin-marketplace-discovery-P-Vndfqq.js → .setup/plugin-marketplace-discovery-P-Vndfqq.mjs} +0 -0
- /package/dist/{rolldown-runtime-8H4AJuhK.js → .setup/rolldown-runtime-8H4AJuhK.mjs} +0 -0
- /package/dist/{session-binding-meta-B7aEMU7g.js → .setup/session-binding-meta-B7aEMU7g.mjs} +0 -0
- /package/dist/{session-upstream-marker-D15C9NHp.js → .setup/session-upstream-marker-D15C9NHp.mjs} +0 -0
- /package/dist/{upstream-prompt-provenance-LphB8slG.js → .setup/upstream-prompt-provenance-LphB8slG.mjs} +0 -0
- /package/dist/{web-search-provider.shared-BrZmlqyR.js → .setup/web-search-provider.shared-BrZmlqyR.mjs} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as resolvePackagedCodexNativeCommand } from "./managed-binary-
|
|
2
|
-
import { n as resolveCodexAppServerSpawnEnv } from "./transport-stdio-
|
|
1
|
+
import { a as resolvePackagedCodexNativeCommand } from "./managed-binary-DP6Rib3P.mjs";
|
|
2
|
+
import { n as resolveCodexAppServerSpawnEnv } from "./transport-stdio-Cmx94Oiy.mjs";
|
|
3
3
|
import { createHash } from "node:crypto";
|
|
4
4
|
import { resolveWindowsExecutablePath, resolveWindowsSpawnProgram } from "openclaw/plugin-sdk/windows-spawn";
|
|
5
5
|
import { constants } from "node:fs";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.
|
|
2
|
-
import {
|
|
3
|
-
import { n as resolveCodexNativeExecutionPolicy, t as formatCodexNativeNodeExecBlock } from "./native-execution-policy-
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.mjs";
|
|
2
|
+
import { l as isCodexRemoteExecPlacementSandbox } from "./config-parsing-CcB9iPoq.mjs";
|
|
3
|
+
import { n as resolveCodexNativeExecutionPolicy, t as formatCodexNativeNodeExecBlock } from "./native-execution-policy-YBMHSzC4.mjs";
|
|
4
4
|
import { tryResolveDefaultAgentId } from "openclaw/plugin-sdk/agent-scope-runtime";
|
|
5
5
|
import { parseAgentSessionKey } from "openclaw/plugin-sdk/routing";
|
|
6
6
|
import { resolveSandboxRuntimeStatus } from "openclaw/plugin-sdk/sandbox";
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.
|
|
2
|
-
import { m as
|
|
3
|
-
import {
|
|
4
|
-
import { n as
|
|
5
|
-
import { n as normalizeCodexAppServerBindingModelProvider } from "./auth-profile-CwzO4_RG.js";
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.mjs";
|
|
2
|
+
import { _ as mutateCodexNativeSubagentSubmissions, a as ownsStoredSessionGeneration, c as readCodexBindingTimestamp, d as readPluginAppPolicyContext, f as readStoredCodexAppServerBinding, g as adoptCodexNativeSubagentSubmissions, h as validateBindingForWrite, i as matchesCodexNativeSubagentSubmissionBinding, l as readCurrentCodexAppServerBinding, m as stripUndefinedBinding, n as assertCodexBindingMayBeReplaced, o as preserveCodexNativeSubagentSubmissions, p as sessionBindingIdentity, r as bindingStoreKey, s as readCodexAppServerThreadBinding, t as CodexSupervisionBindingReplacementError, u as readCurrentCodexNativeSubagentSubmissions } from "./session-binding-record-TH3xA0zj.mjs";
|
|
3
|
+
import { n as CODEX_APP_SERVER_BINDING_NAMESPACE, t as CODEX_APP_SERVER_BINDING_MAX_ENTRIES } from "./session-binding-meta-B7aEMU7g.mjs";
|
|
4
|
+
import { n as normalizeCodexAppServerBindingModelProvider } from "./auth-profile-WqZtZfXN.mjs";
|
|
6
5
|
import { asOptionalRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
7
6
|
import { createHash, randomUUID } from "node:crypto";
|
|
8
|
-
import { AgentHarnessSessionSupersededError, embeddedAgentLog } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
9
7
|
import { isDeepStrictEqual } from "node:util";
|
|
10
|
-
import { getSessionEntry, resolveStorePath } from "openclaw/plugin-sdk/session-store-runtime";
|
|
11
8
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
9
|
+
import { AgentHarnessSessionSupersededError, embeddedAgentLog } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
10
|
+
import { getSessionEntry, resolveStorePath } from "openclaw/plugin-sdk/session-store-runtime";
|
|
12
11
|
//#region extensions/codex/src/app-server/session-binding.ts
|
|
13
12
|
/** SQLite-backed Codex app-server thread bindings. */
|
|
14
13
|
var session_binding_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -159,11 +158,22 @@ function bindingLeaseLostError(key, cause) {
|
|
|
159
158
|
function scopeCodexRunBindingStore(params) {
|
|
160
159
|
const mapSessionIdentity = (identity) => identity.agentId === params.logicalIdentity.agentId && identity.sessionId === params.logicalIdentity.sessionId && identity.sessionKey?.trim() === params.logicalIdentity.sessionKey?.trim() ? params.physicalIdentity : identity;
|
|
161
160
|
const mapIdentity = (identity) => identity.kind === "session" ? mapSessionIdentity(identity) : identity;
|
|
161
|
+
const mapHistoryOwner = (identity, owner) => {
|
|
162
|
+
const mapped = mapIdentity(identity);
|
|
163
|
+
return identity.kind === "session" && mapped.kind === "session" && owner.sessionId === identity.sessionId ? {
|
|
164
|
+
...owner,
|
|
165
|
+
sessionId: mapped.sessionId
|
|
166
|
+
} : owner;
|
|
167
|
+
};
|
|
162
168
|
return {
|
|
163
169
|
...params.bindingStore,
|
|
164
170
|
read: (identity) => params.bindingStore.read(mapIdentity(identity)),
|
|
171
|
+
readNativeSubagentSubmissions: (identity, owner) => params.bindingStore.readNativeSubagentSubmissions(mapIdentity(identity), mapHistoryOwner(identity, owner)),
|
|
165
172
|
hasOtherThreadOwner: (threadId, identity) => params.bindingStore.hasOtherThreadOwner(threadId, identity ? mapIdentity(identity) : void 0),
|
|
166
|
-
mutate: (identity, mutation, assertCurrent) => params.bindingStore.mutate(mapIdentity(identity), mutation
|
|
173
|
+
mutate: (identity, mutation, assertCurrent) => params.bindingStore.mutate(mapIdentity(identity), mutation.kind === "record-native-subagent-submission" || mutation.kind === "consume-native-subagent-submission" ? {
|
|
174
|
+
...mutation,
|
|
175
|
+
owner: mapHistoryOwner(identity, mutation.owner)
|
|
176
|
+
} : mutation, assertCurrent),
|
|
167
177
|
prepareSessionGenerationReclaim: (identity) => params.bindingStore.prepareSessionGenerationReclaim(mapSessionIdentity(identity)),
|
|
168
178
|
adoptSessionGeneration: (identity, expectedPreviousSessionId, assertCurrent) => params.bindingStore.adoptSessionGeneration(mapSessionIdentity(identity), expectedPreviousSessionId, assertCurrent),
|
|
169
179
|
resetSessionGeneration: (identity) => params.bindingStore.resetSessionGeneration(mapSessionIdentity(identity)),
|
|
@@ -436,6 +446,7 @@ function createCodexAppServerBindingStore(state) {
|
|
|
436
446
|
};
|
|
437
447
|
return {
|
|
438
448
|
read: (identity) => readCurrentCodexAppServerBinding(state, identity),
|
|
449
|
+
readNativeSubagentSubmissions: (identity, owner) => readCurrentCodexNativeSubagentSubmissions(state, identity, owner),
|
|
439
450
|
async hasOtherThreadOwner(threadId, currentIdentity) {
|
|
440
451
|
const currentKey = currentIdentity ? bindingStoreKey(currentIdentity) : void 0;
|
|
441
452
|
return state.entries().some(({ key, value }) => {
|
|
@@ -477,6 +488,26 @@ function createCodexAppServerBindingStore(state) {
|
|
|
477
488
|
const key = bindingStoreKey(identity);
|
|
478
489
|
const retainLegacyClear = mutation.kind === "clear" && key.startsWith("conversation:legacy-");
|
|
479
490
|
return await transactKey(key, (current, leaseToken) => {
|
|
491
|
+
if (mutation.kind === "record-native-subagent-submission" || mutation.kind === "consume-native-subagent-submission") {
|
|
492
|
+
if (!assertCurrent) throw new Error("Codex native subagent submission mutation requires current authority.");
|
|
493
|
+
assertCurrent();
|
|
494
|
+
if (current?.state !== "active" || !ownsStoredSessionGeneration(identity, current) || identity.kind === "session" && mutation.owner.sessionId !== identity.sessionId || !matchesCodexNativeSubagentSubmissionBinding(current.binding, mutation.owner)) return { result: false };
|
|
495
|
+
const changed = mutateCodexNativeSubagentSubmissions({
|
|
496
|
+
current: current.nativeSubagentSubmissions,
|
|
497
|
+
owner: mutation.owner,
|
|
498
|
+
receipt: mutation.receipt,
|
|
499
|
+
consume: mutation.kind === "consume-native-subagent-submission"
|
|
500
|
+
});
|
|
501
|
+
if (!changed.applied) return { result: false };
|
|
502
|
+
const { nativeSubagentSubmissions: _previous, ...bindingOwner } = current;
|
|
503
|
+
return {
|
|
504
|
+
result: true,
|
|
505
|
+
next: {
|
|
506
|
+
...bindingOwner,
|
|
507
|
+
...changed.next ? { nativeSubagentSubmissions: changed.next } : {}
|
|
508
|
+
}
|
|
509
|
+
};
|
|
510
|
+
}
|
|
480
511
|
const ownsGeneration = ownsStoredSessionGeneration(identity, current);
|
|
481
512
|
const ownedLease = current?.lease && current.lease.token === leaseToken ? { lease: current.lease } : {};
|
|
482
513
|
if (mutation.kind === "reclaim-generation") {
|
|
@@ -539,12 +570,14 @@ function createCodexAppServerBindingStore(state) {
|
|
|
539
570
|
...mutation.patch,
|
|
540
571
|
threadId: mutation.threadId
|
|
541
572
|
});
|
|
573
|
+
const nativeSubagentSubmissions = active ? preserveCodexNativeSubagentSubmissions(active.binding, binding, active.nativeSubagentSubmissions) : void 0;
|
|
542
574
|
return {
|
|
543
575
|
result: true,
|
|
544
576
|
next: {
|
|
545
577
|
version: 1,
|
|
546
578
|
state: "active",
|
|
547
579
|
binding,
|
|
580
|
+
...nativeSubagentSubmissions !== void 0 ? { nativeSubagentSubmissions } : {},
|
|
548
581
|
...storedSessionGeneration(identity, current),
|
|
549
582
|
...ownedLease
|
|
550
583
|
}
|
|
@@ -562,11 +595,14 @@ function createCodexAppServerBindingStore(state) {
|
|
|
562
595
|
if (current?.state !== "active") return { result: "absent" };
|
|
563
596
|
if (current.sessionId === targetSessionId) return { result: "current" };
|
|
564
597
|
if (current.sessionId !== expectedSessionId) return { result: "conflict" };
|
|
598
|
+
const { nativeSubagentSubmissions, ...bindingOwner } = current;
|
|
599
|
+
const adoptedSubmissions = adoptCodexNativeSubagentSubmissions(nativeSubagentSubmissions);
|
|
565
600
|
return {
|
|
566
601
|
result: "adopted",
|
|
567
602
|
next: {
|
|
568
|
-
...
|
|
569
|
-
sessionId: targetSessionId
|
|
603
|
+
...bindingOwner,
|
|
604
|
+
sessionId: targetSessionId,
|
|
605
|
+
...adoptedSubmissions !== void 0 ? { nativeSubagentSubmissions: adoptedSubmissions } : {}
|
|
570
606
|
}
|
|
571
607
|
};
|
|
572
608
|
}, void 0, assertCurrent);
|
|
@@ -676,60 +712,6 @@ function preservedSessionGeneration(identity, current) {
|
|
|
676
712
|
if (current?.sessionId) return { sessionId: current.sessionId };
|
|
677
713
|
return storedSessionGeneration(identity, current);
|
|
678
714
|
}
|
|
679
|
-
function readPluginAppPolicyContext(value, bindingSchemaVersion) {
|
|
680
|
-
const record = asOptionalRecord(value);
|
|
681
|
-
if (!record || typeof record.fingerprint !== "string") return;
|
|
682
|
-
const apps = asOptionalRecord(record.apps);
|
|
683
|
-
if (!apps) return;
|
|
684
|
-
const parsedApps = {};
|
|
685
|
-
for (const [appId, rawEntry] of Object.entries(apps)) {
|
|
686
|
-
const entry = asOptionalRecord(rawEntry);
|
|
687
|
-
if (!entry) return;
|
|
688
|
-
const destructiveApprovalMode = readDestructiveApprovalMode(entry.destructiveApprovalMode, bindingSchemaVersion);
|
|
689
|
-
const mcpServerNamesValid = Array.isArray(entry.mcpServerNames) && entry.mcpServerNames.every((serverName) => typeof serverName === "string");
|
|
690
|
-
if (entry.source === "account") {
|
|
691
|
-
if ("appId" in entry || typeof entry.appName !== "string" || typeof entry.allowDestructiveActions !== "boolean" || entry.allowOpenWorld !== void 0 && typeof entry.allowOpenWorld !== "boolean" || destructiveApprovalMode === "invalid" || !mcpServerNamesValid) return;
|
|
692
|
-
parsedApps[appId] = {
|
|
693
|
-
source: "account",
|
|
694
|
-
appName: entry.appName,
|
|
695
|
-
allowDestructiveActions: entry.allowDestructiveActions,
|
|
696
|
-
...typeof entry.allowOpenWorld === "boolean" ? { allowOpenWorld: entry.allowOpenWorld } : {},
|
|
697
|
-
...destructiveApprovalMode ? { destructiveApprovalMode } : {},
|
|
698
|
-
mcpServerNames: entry.mcpServerNames
|
|
699
|
-
};
|
|
700
|
-
continue;
|
|
701
|
-
}
|
|
702
|
-
if ("appId" in entry || entry.source !== void 0 && entry.source !== "plugin" || typeof entry.configKey !== "string" || typeof entry.marketplaceName !== "string" || !CODEX_PLUGIN_MARKETPLACE_NAME_PATTERN.test(entry.marketplaceName) || typeof entry.pluginName !== "string" || typeof entry.allowDestructiveActions !== "boolean" || entry.allowOpenWorld !== void 0 && typeof entry.allowOpenWorld !== "boolean" || destructiveApprovalMode === "invalid" || !mcpServerNamesValid) return;
|
|
703
|
-
parsedApps[appId] = {
|
|
704
|
-
configKey: entry.configKey,
|
|
705
|
-
marketplaceName: entry.marketplaceName,
|
|
706
|
-
pluginName: entry.pluginName,
|
|
707
|
-
allowDestructiveActions: entry.allowDestructiveActions,
|
|
708
|
-
...typeof entry.allowOpenWorld === "boolean" ? { allowOpenWorld: entry.allowOpenWorld } : {},
|
|
709
|
-
...destructiveApprovalMode ? { destructiveApprovalMode } : {},
|
|
710
|
-
mcpServerNames: entry.mcpServerNames
|
|
711
|
-
};
|
|
712
|
-
}
|
|
713
|
-
const parsedPluginAppIds = {};
|
|
714
|
-
if (record.pluginAppIds !== void 0 && (!record.pluginAppIds || typeof record.pluginAppIds !== "object" || Array.isArray(record.pluginAppIds))) return;
|
|
715
|
-
if (record.pluginAppIds && typeof record.pluginAppIds === "object") for (const [configKey, appIds] of Object.entries(record.pluginAppIds)) {
|
|
716
|
-
if (!Array.isArray(appIds) || appIds.some((appId) => typeof appId !== "string")) return;
|
|
717
|
-
parsedPluginAppIds[configKey] = appIds;
|
|
718
|
-
}
|
|
719
|
-
return {
|
|
720
|
-
fingerprint: record.fingerprint,
|
|
721
|
-
apps: parsedApps,
|
|
722
|
-
pluginAppIds: parsedPluginAppIds
|
|
723
|
-
};
|
|
724
|
-
}
|
|
725
|
-
function readDestructiveApprovalMode(value, bindingSchemaVersion) {
|
|
726
|
-
if (value === void 0) return;
|
|
727
|
-
if (value === "allow" || value === "deny") return value;
|
|
728
|
-
if (value === "auto") return bindingSchemaVersion === 1 ? "allow" : "auto";
|
|
729
|
-
if (value === "ask" && bindingSchemaVersion === 2) return "ask";
|
|
730
|
-
if (value === "on-request" && bindingSchemaVersion === 1) return "auto";
|
|
731
|
-
return "invalid";
|
|
732
|
-
}
|
|
733
715
|
function sleep(ms) {
|
|
734
716
|
return new Promise((resolve) => {
|
|
735
717
|
setTimeout(resolve, ms);
|
package/dist/{session-binding-record-Bcvslnhf.js → .setup/session-binding-record-TH3xA0zj.mjs}
RENAMED
|
@@ -1,8 +1,115 @@
|
|
|
1
|
-
import { i as normalizeCodexServiceTier, m as CODEX_PLUGIN_MARKETPLACE_NAME_PATTERN } from "./config-utils-DujwEnhg.
|
|
1
|
+
import { i as normalizeCodexServiceTier, m as CODEX_PLUGIN_MARKETPLACE_NAME_PATTERN } from "./config-utils-DujwEnhg.mjs";
|
|
2
|
+
import { asOptionalRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
2
3
|
import { createHash } from "node:crypto";
|
|
4
|
+
import { isDeepStrictEqual } from "node:util";
|
|
3
5
|
import { AgentHarnessPreflightError } from "openclaw/plugin-sdk/agent-harness-registration";
|
|
4
6
|
import { resolveSessionAgentIdsStrict } from "openclaw/plugin-sdk/agent-scope-runtime";
|
|
5
7
|
import { z } from "zod";
|
|
8
|
+
//#region extensions/codex/src/app-server/native-subagent-history-owner.ts
|
|
9
|
+
const nonBlankString = z.string().refine((value) => Boolean(value.trim()));
|
|
10
|
+
const codexNativeSubagentHistoryOwnerSchema = z.object({
|
|
11
|
+
parentThreadId: nonBlankString,
|
|
12
|
+
sessionId: nonBlankString,
|
|
13
|
+
lifecycleRevision: nonBlankString.optional(),
|
|
14
|
+
connectionFingerprint: z.string().regex(/^[a-f0-9]{64}$/u)
|
|
15
|
+
});
|
|
16
|
+
/** Automatic recovery may follow native rotation only within the same host lifecycle and connection. */
|
|
17
|
+
function matchesCodexNativeSubagentHistoryOwner(stored, current) {
|
|
18
|
+
return stored.connectionFingerprint === current.connectionFingerprint && stored.lifecycleRevision === current.lifecycleRevision && (stored.lifecycleRevision !== void 0 || stored.sessionId === current.sessionId);
|
|
19
|
+
}
|
|
20
|
+
function codexNativeSubagentHistoryConnectionFingerprint(binding) {
|
|
21
|
+
if (!binding.appServerRuntimeFingerprint) return;
|
|
22
|
+
return createHash("sha256").update(JSON.stringify([
|
|
23
|
+
binding.appServerRuntimeFingerprint,
|
|
24
|
+
binding.connectionScope ?? null,
|
|
25
|
+
binding.authProfileId ?? null
|
|
26
|
+
])).digest("hex");
|
|
27
|
+
}
|
|
28
|
+
function createCodexNativeSubagentHistoryOwner(params) {
|
|
29
|
+
const connectionFingerprint = codexNativeSubagentHistoryConnectionFingerprint(params.binding);
|
|
30
|
+
return connectionFingerprint ? {
|
|
31
|
+
parentThreadId: params.parentThreadId,
|
|
32
|
+
sessionId: params.sessionId,
|
|
33
|
+
...params.lifecycleRevision ? { lifecycleRevision: params.lifecycleRevision } : {},
|
|
34
|
+
connectionFingerprint
|
|
35
|
+
} : void 0;
|
|
36
|
+
}
|
|
37
|
+
function readCodexNativeSubagentHistoryOwner(detail) {
|
|
38
|
+
const value = asOptionalRecord(detail)?.nativeHistory;
|
|
39
|
+
if (value === void 0) return;
|
|
40
|
+
const owner = codexNativeSubagentHistoryOwnerSchema.safeParse(value);
|
|
41
|
+
if (!owner.success) throw new Error("Subagent history owner is invalid.");
|
|
42
|
+
const { lifecycleRevision, ...required } = owner.data;
|
|
43
|
+
return lifecycleRevision === void 0 ? required : {
|
|
44
|
+
...required,
|
|
45
|
+
lifecycleRevision
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
function assertHistoryOwnerMatchesRegistration(saved, current, parentThreadId, requireSaved = false) {
|
|
49
|
+
if (requireSaved && !saved) throw new Error("Subagent completion history owner is missing.");
|
|
50
|
+
if (saved && (!current || saved.parentThreadId !== parentThreadId || saved.connectionFingerprint !== current.connectionFingerprint || saved.sessionId !== current.sessionId || saved.lifecycleRevision !== current.lifecycleRevision)) throw new Error("Subagent completion history owner is contradictory.");
|
|
51
|
+
}
|
|
52
|
+
//#endregion
|
|
53
|
+
//#region extensions/codex/src/app-server/native-subagent-submission.ts
|
|
54
|
+
const identifier = z.string().refine((value) => Boolean(value.trim()));
|
|
55
|
+
const submissionSchema = z.object({
|
|
56
|
+
parentTurnId: identifier,
|
|
57
|
+
callId: identifier,
|
|
58
|
+
childThreadId: identifier,
|
|
59
|
+
submissionId: identifier,
|
|
60
|
+
predecessorRunId: identifier,
|
|
61
|
+
predecessorNativeTurnId: identifier
|
|
62
|
+
}).strict();
|
|
63
|
+
const submissionsSchema = z.object({
|
|
64
|
+
version: z.literal(1),
|
|
65
|
+
owner: codexNativeSubagentHistoryOwnerSchema,
|
|
66
|
+
receipts: z.array(submissionSchema)
|
|
67
|
+
}).strict().refine(({ receipts }) => new Set(receipts.map(({ parentTurnId, callId }) => JSON.stringify([parentTurnId, callId]))).size === receipts.length);
|
|
68
|
+
function matchesCodexNativeSubagentSubmissionOwner(stored, current) {
|
|
69
|
+
return stored.parentThreadId === current.parentThreadId && matchesCodexNativeSubagentHistoryOwner(stored, current);
|
|
70
|
+
}
|
|
71
|
+
function readCodexNativeSubagentSubmissions(value) {
|
|
72
|
+
if (value === void 0) return;
|
|
73
|
+
const parsed = submissionsSchema.safeParse(value);
|
|
74
|
+
if (!parsed.success) throw new Error("Invalid Codex native subagent submission metadata.");
|
|
75
|
+
return parsed.data;
|
|
76
|
+
}
|
|
77
|
+
function mutateCodexNativeSubagentSubmissions(params) {
|
|
78
|
+
const current = readCodexNativeSubagentSubmissions(params.current);
|
|
79
|
+
const owner = codexNativeSubagentHistoryOwnerSchema.parse(params.owner);
|
|
80
|
+
const receipt = submissionSchema.parse(params.receipt);
|
|
81
|
+
if (current && !matchesCodexNativeSubagentSubmissionOwner(current.owner, owner)) return { applied: false };
|
|
82
|
+
const receipts = current?.receipts ?? [];
|
|
83
|
+
const existing = receipts.find((entry) => entry.parentTurnId === receipt.parentTurnId && entry.callId === receipt.callId);
|
|
84
|
+
if (existing && !isDeepStrictEqual(existing, receipt)) return { applied: false };
|
|
85
|
+
if (params.consume) {
|
|
86
|
+
if (!current) return { applied: false };
|
|
87
|
+
const remaining = receipts.filter((entry) => entry !== existing);
|
|
88
|
+
return {
|
|
89
|
+
applied: true,
|
|
90
|
+
...remaining.length ? { next: {
|
|
91
|
+
version: 1,
|
|
92
|
+
owner: current.owner,
|
|
93
|
+
receipts: remaining
|
|
94
|
+
} } : {}
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
return {
|
|
98
|
+
applied: true,
|
|
99
|
+
next: {
|
|
100
|
+
version: 1,
|
|
101
|
+
owner: current?.owner ?? owner,
|
|
102
|
+
receipts: existing ? receipts : [...receipts, receipt]
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
/** Physical adoption cannot establish continuity for an unstamped receipt. */
|
|
107
|
+
function adoptCodexNativeSubagentSubmissions(value) {
|
|
108
|
+
if (value === void 0) return;
|
|
109
|
+
const parsed = submissionsSchema.safeParse(value);
|
|
110
|
+
return !parsed.success || parsed.data.owner.lifecycleRevision ? value : void 0;
|
|
111
|
+
}
|
|
112
|
+
//#endregion
|
|
6
113
|
//#region extensions/codex/src/app-server/session-binding-record.ts
|
|
7
114
|
/** Canonical binding codec and synchronous generation-aware reads; no lifecycle or auth loading. */
|
|
8
115
|
/** Resolves the same agent scope OpenClaw uses for transcript/session ownership. */
|
|
@@ -180,7 +287,8 @@ const storedBindingSchema = z.discriminatedUnion("state", [z.object({
|
|
|
180
287
|
state: z.literal("active"),
|
|
181
288
|
binding: threadBindingSchema,
|
|
182
289
|
sessionId: storedSessionIdSchema,
|
|
183
|
-
lease: bindingLeaseSchema.optional().catch(void 0)
|
|
290
|
+
lease: bindingLeaseSchema.optional().catch(void 0),
|
|
291
|
+
nativeSubagentSubmissions: z.unknown().optional()
|
|
184
292
|
}), z.object({
|
|
185
293
|
version: z.literal(1),
|
|
186
294
|
state: z.literal("cleared"),
|
|
@@ -242,6 +350,22 @@ function readCurrentCodexAppServerBinding(state, identity) {
|
|
|
242
350
|
if (raw !== void 0 && !stored) throw new Error(`Invalid Codex app-server binding row: ${key}`);
|
|
243
351
|
return stored?.state === "active" && ownsStoredSessionGeneration(identity, stored) ? stored.binding : void 0;
|
|
244
352
|
}
|
|
353
|
+
function matchesCodexNativeSubagentSubmissionBinding(binding, owner) {
|
|
354
|
+
return binding.threadId === owner.parentThreadId && !binding.pendingSupervisionBranch && codexNativeSubagentHistoryConnectionFingerprint(binding) === owner.connectionFingerprint;
|
|
355
|
+
}
|
|
356
|
+
/** Unknown metadata stays opaque through ordinary binding writes. */
|
|
357
|
+
function preserveCodexNativeSubagentSubmissions(currentBinding, nextBinding, value) {
|
|
358
|
+
return currentBinding.threadId === nextBinding.threadId && codexNativeSubagentHistoryConnectionFingerprint(currentBinding) === codexNativeSubagentHistoryConnectionFingerprint(nextBinding) && isDeepStrictEqual(currentBinding.pendingSupervisionBranch, nextBinding.pendingSupervisionBranch) ? value : void 0;
|
|
359
|
+
}
|
|
360
|
+
function readCurrentCodexNativeSubagentSubmissions(state, identity, owner) {
|
|
361
|
+
const key = bindingStoreKey(identity);
|
|
362
|
+
const raw = state.lookup(key);
|
|
363
|
+
const stored = readStoredCodexAppServerBinding(raw);
|
|
364
|
+
if (raw !== void 0 && !stored) throw new Error(`Invalid Codex app-server binding row: ${key}`);
|
|
365
|
+
if (stored?.state !== "active" || !ownsStoredSessionGeneration(identity, stored) || identity.kind === "session" && owner.sessionId !== identity.sessionId || !matchesCodexNativeSubagentSubmissionBinding(stored.binding, owner)) return [];
|
|
366
|
+
const submissions = readCodexNativeSubagentSubmissions(stored.nativeSubagentSubmissions);
|
|
367
|
+
return submissions && matchesCodexNativeSubagentSubmissionOwner(submissions.owner, owner) ? submissions.receipts : [];
|
|
368
|
+
}
|
|
245
369
|
var CodexSupervisionBindingReplacementError = class extends Error {
|
|
246
370
|
constructor(threadId, operation) {
|
|
247
371
|
super(`Refusing to replace supervised Codex thread ${threadId} while ${operation}; its native user-home connection and model ownership must be preserved`);
|
|
@@ -252,5 +376,59 @@ function assertCodexBindingMayBeReplaced(binding, operation, expected) {
|
|
|
252
376
|
if (expected) throw new AgentHarnessPreflightError(`Codex native model ownership prevents ${operation}. Continue or compact the original session in its native runtime, or create a new chat with a concrete model; the original binding was preserved.`);
|
|
253
377
|
if (binding?.connectionScope === "supervision") throw new CodexSupervisionBindingReplacementError(binding.threadId, operation);
|
|
254
378
|
}
|
|
379
|
+
function readPluginAppPolicyContext(value, bindingSchemaVersion) {
|
|
380
|
+
const record = asOptionalRecord(value);
|
|
381
|
+
if (!record || typeof record.fingerprint !== "string") return;
|
|
382
|
+
const apps = asOptionalRecord(record.apps);
|
|
383
|
+
if (!apps) return;
|
|
384
|
+
const parsedApps = {};
|
|
385
|
+
for (const [appId, rawEntry] of Object.entries(apps)) {
|
|
386
|
+
const entry = asOptionalRecord(rawEntry);
|
|
387
|
+
if (!entry) return;
|
|
388
|
+
const destructiveApprovalMode = readDestructiveApprovalMode(entry.destructiveApprovalMode, bindingSchemaVersion);
|
|
389
|
+
const mcpServerNames = Array.isArray(entry.mcpServerNames) && entry.mcpServerNames.every((serverName) => typeof serverName === "string") ? entry.mcpServerNames : void 0;
|
|
390
|
+
if (entry.source === "account") {
|
|
391
|
+
if ("appId" in entry || typeof entry.appName !== "string" || typeof entry.allowDestructiveActions !== "boolean" || entry.allowOpenWorld !== void 0 && typeof entry.allowOpenWorld !== "boolean" || destructiveApprovalMode === "invalid" || !mcpServerNames) return;
|
|
392
|
+
parsedApps[appId] = {
|
|
393
|
+
source: "account",
|
|
394
|
+
appName: entry.appName,
|
|
395
|
+
allowDestructiveActions: entry.allowDestructiveActions,
|
|
396
|
+
...typeof entry.allowOpenWorld === "boolean" ? { allowOpenWorld: entry.allowOpenWorld } : {},
|
|
397
|
+
...destructiveApprovalMode ? { destructiveApprovalMode } : {},
|
|
398
|
+
mcpServerNames
|
|
399
|
+
};
|
|
400
|
+
continue;
|
|
401
|
+
}
|
|
402
|
+
if ("appId" in entry || entry.source !== void 0 && entry.source !== "plugin" || typeof entry.configKey !== "string" || typeof entry.marketplaceName !== "string" || !CODEX_PLUGIN_MARKETPLACE_NAME_PATTERN.test(entry.marketplaceName) || typeof entry.pluginName !== "string" || typeof entry.allowDestructiveActions !== "boolean" || entry.allowOpenWorld !== void 0 && typeof entry.allowOpenWorld !== "boolean" || destructiveApprovalMode === "invalid" || !mcpServerNames) return;
|
|
403
|
+
parsedApps[appId] = {
|
|
404
|
+
configKey: entry.configKey,
|
|
405
|
+
marketplaceName: entry.marketplaceName,
|
|
406
|
+
pluginName: entry.pluginName,
|
|
407
|
+
allowDestructiveActions: entry.allowDestructiveActions,
|
|
408
|
+
...typeof entry.allowOpenWorld === "boolean" ? { allowOpenWorld: entry.allowOpenWorld } : {},
|
|
409
|
+
...destructiveApprovalMode ? { destructiveApprovalMode } : {},
|
|
410
|
+
mcpServerNames
|
|
411
|
+
};
|
|
412
|
+
}
|
|
413
|
+
const parsedPluginAppIds = {};
|
|
414
|
+
if (record.pluginAppIds !== void 0 && (!record.pluginAppIds || typeof record.pluginAppIds !== "object" || Array.isArray(record.pluginAppIds))) return;
|
|
415
|
+
if (record.pluginAppIds && typeof record.pluginAppIds === "object") for (const [configKey, appIds] of Object.entries(record.pluginAppIds)) {
|
|
416
|
+
if (!Array.isArray(appIds) || appIds.some((appId) => typeof appId !== "string")) return;
|
|
417
|
+
parsedPluginAppIds[configKey] = appIds;
|
|
418
|
+
}
|
|
419
|
+
return {
|
|
420
|
+
fingerprint: record.fingerprint,
|
|
421
|
+
apps: parsedApps,
|
|
422
|
+
pluginAppIds: parsedPluginAppIds
|
|
423
|
+
};
|
|
424
|
+
}
|
|
425
|
+
function readDestructiveApprovalMode(value, bindingSchemaVersion) {
|
|
426
|
+
if (value === void 0) return;
|
|
427
|
+
if (value === "allow" || value === "deny") return value;
|
|
428
|
+
if (value === "auto") return bindingSchemaVersion === 1 ? "allow" : "auto";
|
|
429
|
+
if (value === "ask" && bindingSchemaVersion === 2) return "ask";
|
|
430
|
+
if (value === "on-request" && bindingSchemaVersion === 1) return "auto";
|
|
431
|
+
return "invalid";
|
|
432
|
+
}
|
|
255
433
|
//#endregion
|
|
256
|
-
export {
|
|
434
|
+
export { readCodexNativeSubagentHistoryOwner as S, mutateCodexNativeSubagentSubmissions as _, ownsStoredSessionGeneration as a, createCodexNativeSubagentHistoryOwner as b, readCodexBindingTimestamp as c, readPluginAppPolicyContext as d, readStoredCodexAppServerBinding as f, adoptCodexNativeSubagentSubmissions as g, validateBindingForWrite as h, matchesCodexNativeSubagentSubmissionBinding as i, readCurrentCodexAppServerBinding as l, stripUndefinedBinding as m, assertCodexBindingMayBeReplaced as n, preserveCodexNativeSubagentSubmissions as o, sessionBindingIdentity as p, bindingStoreKey as r, readCodexAppServerThreadBinding as s, CodexSupervisionBindingReplacementError as t, readCurrentCodexNativeSubagentSubmissions as u, assertHistoryOwnerMatchesRegistration as v, matchesCodexNativeSubagentHistoryOwner as x, codexNativeSubagentHistoryConnectionFingerprint as y };
|