@openclaw/codex 2026.10.2 → 2026.10.5-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.setup/{account-usage-runtime-DPXsyONK.mjs → account-usage-runtime-B6S1BQU7.mjs} +8 -7
- package/dist/.setup/{app-server-policy-Bg4FZw1f.mjs → app-server-policy-D_zv8J7V.mjs} +3 -4
- package/dist/.setup/{apply-CQ3brq3z.mjs → apply-Cc1DfWPz.mjs} +40 -51
- package/dist/.setup/{attempt-client-cleanup-DPUGAWP2.mjs → attempt-client-cleanup-CxX4cTSi.mjs} +6 -6
- package/dist/.setup/attempt-terminal-jO5IMj9K.mjs +2 -0
- package/dist/.setup/{attempt-workspace-context-GllQy8mw.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-BE1HXsNo.mjs → auth-cache-key-tENCQOub.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-9YflG60n.mjs → bounded-turn-DxtRqV8t.mjs} +21 -17
- package/dist/.setup/{bounded-turn-isolation-DklXNk3k.mjs → bounded-turn-isolation-BfDAo-qZ.mjs} +4 -4
- package/dist/.setup/{build-state-LS-A65iX.mjs → build-state-CMYRQ_We.mjs} +1 -1
- package/dist/.setup/{capabilities-kQntafj_.mjs → capabilities-DbOzOglY.mjs} +1 -1
- package/dist/.setup/{client-catalog-response-BprQziLV.mjs → client-catalog-response-B7oqHQGO.mjs} +25 -32
- package/dist/.setup/{client-ChJtGEdJ.mjs → client-zrCKOu_E.mjs} +198 -247
- package/dist/.setup/{command-dispatch-BoC9hvFs.mjs → command-dispatch-ImiHvcyW.mjs} +3 -4
- package/dist/.setup/{command-formatters-DV3DHhdr.mjs → command-formatters-xW9KpoSZ.mjs} +16 -26
- package/dist/.setup/{command-handlers-BVX2quUD.mjs → command-handlers-B8CT4ngS.mjs} +270 -360
- package/dist/.setup/{command-rpc-M4gYsRiV.mjs → command-rpc-HtQjCQBg.mjs} +19 -18
- package/dist/.setup/{compact-D3JNLG_b.mjs → compact-Do9HPeDr.mjs} +41 -61
- package/dist/.setup/{computer-use-CF0jsDi1.mjs → computer-use-CeF5GuCX.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-7kceEUf0.mjs → conversation-binding-D78aEdkE.mjs} +85 -119
- package/dist/.setup/{conversation-binding-data-DJ4ix-W5.mjs → conversation-binding-data-UgLuTSQT.mjs} +9 -8
- package/dist/.setup/{conversation-control-BpJpPo0t.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-BCi00feJ.mjs → dynamic-tool-build-BMiiFROa.mjs} +57 -69
- package/dist/.setup/{dynamic-tools-DUv6Sr6h.mjs → dynamic-tools-DPPHrGKB.mjs} +680 -709
- package/dist/.setup/{effective-mcp-catalog-CIdbHp1t.mjs → effective-mcp-catalog-x3JVEcJp.mjs} +11 -20
- package/dist/.setup/{elicitation-input-r9axtppm.mjs → elicitation-input-DXG_qaXr.mjs} +14 -20
- package/dist/.setup/{ephemeral-turn-U4th15a6.mjs → ephemeral-turn-Dk0wWoqi.mjs} +3 -3
- package/dist/.setup/{event-projector-assistant-message-BwG5TUYW.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-C6QKyyDS.mjs → isolated-completion-z0ii1a_V.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-JFCtSkRp.mjs → mcp-app-session-preparation-GTx-bRGN.mjs} +24 -25
- package/dist/.setup/{mcp-tool-metadata-j10HhfTC.mjs → mcp-tool-metadata-DW41snf3.mjs} +1 -1
- package/dist/.setup/{model-catalog-DD-evckc.mjs → model-catalog-VUdFUqnH.mjs} +8 -8
- package/dist/.setup/{models-DaW-7tld.mjs → models-Dph0RqpR.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-CSZpcjwq.mjs +561 -0
- package/dist/.setup/{native-mcp-app-ChpyWmL-.mjs → native-mcp-app-CDrrBaTE.mjs} +6 -6
- package/dist/.setup/native-skill-isolation-BAatEJZb.mjs +391 -0
- package/dist/.setup/{native-subagent-monitor-wh_-K3Vo.mjs → native-subagent-monitor-D5O_o07p.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-CUHSuL6_.mjs → plan-QNW5zpFp.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-bPQbG8BI.mjs → plugin-approval-roundtrip-DOQ3Tibe.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-Ct6-1lsF.mjs → provider-BG5nXBnY.mjs} +4 -4
- package/dist/.setup/{provider-capabilities-DhkeeHJd.mjs → provider-capabilities-DtJKxDf6.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-CZkKkN6c.mjs → request-6piO0U_P.mjs} +28 -48
- package/dist/.setup/{rpc-error-hmWM21RB.mjs → rpc-error-C98SHchT.mjs} +3 -6
- package/dist/.setup/{run-attempt-C6-678kR.mjs → run-attempt-DejV9vDW.mjs} +927 -860
- 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-Cj-b2FpC.mjs → session-catalog-events-BziNSfLx.mjs} +6 -5
- package/dist/.setup/{session-catalog-index-BnvC43eZ.mjs → session-catalog-index-BmaZFGEH.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-DCtsWKSF.mjs → session-catalog-native-projection-4CsufcT8.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-Cn0bLb-d.mjs → session-catalog-projection-CcIdJdsd.mjs} +8 -22
- package/dist/.setup/session-catalog-source-CdPqS9sa.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-Bo81t4Fb.mjs → session-retirement-CcWVhLVr.mjs} +7 -7
- package/dist/.setup/{settled-turn-context-BZsMjkIO.mjs → settled-turn-context-BPL6D3RO.mjs} +1 -1
- package/dist/.setup/{settled-turn-finalizer-CFARFqNd.mjs → settled-turn-finalizer-BezKSo-Y.mjs} +12 -11
- package/dist/.setup/{shared-client-5NUq43f3.mjs → shared-client-BjiqpbC5.mjs} +164 -227
- package/dist/.setup/{side-question-oTlegAz3.mjs → side-question-YQ5FObkD.mjs} +116 -137
- package/dist/.setup/{source-1cabQi3x.mjs → source-Ce3XIIsU.mjs} +37 -56
- package/dist/.setup/thread-archive-guard-LKdwQKyr.mjs +56 -0
- package/dist/.setup/{thread-lifecycle--EPPTNTe.mjs → thread-lifecycle-run-BWy0LDLB.mjs} +338 -478
- package/dist/.setup/thread-model-selection-DcVebr8N.mjs +61 -0
- package/dist/.setup/{thread-ownership-T7T_iffm.mjs → thread-ownership-5X4197vk.mjs} +5 -5
- package/dist/.setup/{thread-ownership-queue-Dp24d7-F.mjs → thread-ownership-queue-CeyYScUC.mjs} +5 -6
- package/dist/.setup/{thread-policy-VtqLex1l.mjs → thread-policy-BEecBTJM.mjs} +4 -4
- package/dist/.setup/thread-requests-BgzJwJtS.mjs +745 -0
- package/dist/.setup/{thread-resume-buZujRcC.mjs → thread-resume-BXY_6o6Z.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-BOKSJmfw.mjs → turn-router-D8DLkZgH.mjs} +30 -31
- package/dist/.setup/upstream-prompt-provenance-Ccd9MFRJ.mjs +44 -0
- package/dist/.setup/{upstream-session-fork-C4sbIoZb.mjs → upstream-session-fork-DQZbaYMK.mjs} +50 -43
- package/dist/.setup/{usage-Cq21xTMZ.mjs → usage-DVR5mNJK.mjs} +4 -4
- package/dist/.setup/{usage-limit-error-CGJUoQu8.mjs → usage-limit-error-BEONfgt-.mjs} +12 -21
- package/dist/.setup/web-search-item-CvokaZOo.mjs +20 -0
- package/dist/.setup/{web-search-provider.runtime-DrVE7-Br.mjs → web-search-provider.runtime-CffHOpYY.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-C5i1S6RN.mjs +0 -124
- package/dist/.setup/service-tier-normalization-Cei89SW6.mjs +0 -15
- package/dist/.setup/shell-dynamic-tools-Bmedt1QE.mjs +0 -85
- package/dist/.setup/thread-archive-guard-C9frICzX.mjs +0 -60
- package/dist/.setup/thread-requests-Bj_Lixmv.mjs +0 -2111
- package/dist/.setup/upstream-prompt-provenance-fXkKbPVC.mjs +0 -37
|
@@ -1,39 +1,66 @@
|
|
|
1
1
|
import { i as isJsonObject } from "./protocol-CANUwXJ3.mjs";
|
|
2
|
-
import { m as sessionBindingIdentity } from "./session-binding-record-
|
|
3
|
-
import { c as
|
|
4
|
-
import { c as isCodexPairedNodeRemoteExecPlacementSandbox, d as readCodexPluginConfig, l as isCodexRemoteExecPlacementSandbox, u as isCodexSandboxExecServerEnabled } from "./config-parsing-
|
|
5
|
-
import { i as resolveCodexAppServerHomeScope, l as resolveCodexModelBackedReviewerPolicyContext } from "./config-options-
|
|
6
|
-
import { n as formatCodexUsageLimitErrorMessage } from "./rate-limits-
|
|
7
|
-
import { i as resolveCodexBindingAppServerConnection, r as requireCodexSupervisionModelSelection } from "./binding-connection-
|
|
8
|
-
import { n as canUseCodexModelBackedApprovalsReviewerForModel, r as resolveOpenClawExecPolicyForCodexAppServer } from "./config-
|
|
9
|
-
import { X as readRecentCodexRateLimits, b as withLeasedCodexAppServerClientStartSelectionRetry, c as getLeasedSharedCodexAppServerClient, m as releaseCodexAppServerClientLease, tt as resolveCodexAppServerPreparedAuthHandoff } from "./shared-client-
|
|
10
|
-
import {
|
|
11
|
-
import { d as terminateCodexBackgroundTerminals, f as unsubscribeCodexThreadBestEffort, l as retireUnsafeCodexTurnClientBestEffort, s as interruptCodexTurnAndWaitBestEffort } from "./attempt-client-cleanup-
|
|
12
|
-
import { t as CodexEphemeralTurn } from "./ephemeral-turn-
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import { r as
|
|
16
|
-
import { i as
|
|
17
|
-
import { t as
|
|
18
|
-
import {
|
|
19
|
-
import { i as
|
|
20
|
-
import {
|
|
21
|
-
import { t as
|
|
22
|
-
import {
|
|
2
|
+
import { m as sessionBindingIdentity } from "./session-binding-record-DU_0biMD.mjs";
|
|
3
|
+
import { c as withMcpElicitationsApprovalPolicy, d as readCodexRequirementsToml, n as hasCodexMcpToolApprovalOverrides, s as shouldAutoApproveCodexAppServerApprovals } from "./config-security-clxAZYWX.mjs";
|
|
4
|
+
import { c as isCodexPairedNodeRemoteExecPlacementSandbox, d as readCodexPluginConfig, l as isCodexRemoteExecPlacementSandbox, u as isCodexSandboxExecServerEnabled } from "./config-parsing-DsWSCPHO.mjs";
|
|
5
|
+
import { i as resolveCodexAppServerHomeScope, l as resolveCodexModelBackedReviewerPolicyContext } from "./config-options-DDzeNQ8m.mjs";
|
|
6
|
+
import { n as formatCodexUsageLimitErrorMessage } from "./rate-limits-CI8pTPqL.mjs";
|
|
7
|
+
import { i as resolveCodexBindingAppServerConnection, r as requireCodexSupervisionModelSelection } from "./binding-connection-B7HAAZSI.mjs";
|
|
8
|
+
import { n as canUseCodexModelBackedApprovalsReviewerForModel, r as resolveOpenClawExecPolicyForCodexAppServer } from "./config-C1YVVLEA.mjs";
|
|
9
|
+
import { X as readRecentCodexRateLimits, b as withLeasedCodexAppServerClientStartSelectionRetry, c as getLeasedSharedCodexAppServerClient, m as releaseCodexAppServerClientLease, tt as resolveCodexAppServerPreparedAuthHandoff } from "./shared-client-BjiqpbC5.mjs";
|
|
10
|
+
import { E as resolveDynamicToolCallTimeoutMs, O as toCodexDynamicToolProtocolResponse, T as handleDynamicToolCallWithTimeout, _ as assertCodexTurnStartResponse, a as isCodexAppServerIndeterminateRequestCancellationError, k as resolveCodexToolAbortTerminalReason, m as assertCodexThreadForkResponse, r as isCodexAppServerApprovalRequest, w as createCodexElicitationResponse, y as readCodexDynamicToolCallParams } from "./client-zrCKOu_E.mjs";
|
|
11
|
+
import { d as terminateCodexBackgroundTerminals, f as unsubscribeCodexThreadBestEffort, l as retireUnsafeCodexTurnClientBestEffort, s as interruptCodexTurnAndWaitBestEffort } from "./attempt-client-cleanup-CxX4cTSi.mjs";
|
|
12
|
+
import { t as CodexEphemeralTurn } from "./ephemeral-turn-Dk0wWoqi.mjs";
|
|
13
|
+
import { d as mergeCodexThreadConfigs, f as refreshCodexPluginAppApprovalPolicy } from "./project-doc-thread-config-BVcvnps8.mjs";
|
|
14
|
+
import { n as resolveCodexAppServerReasoningEffort, t as readCodexSupportedReasoningEfforts } from "./reasoning-effort-CS9kKWB9.mjs";
|
|
15
|
+
import { h as resolveCodexWebSearchPlan, r as buildCodexRuntimeThreadConfig, z as resolveCodexDynamicToolsLoading } from "./thread-requests-BgzJwJtS.mjs";
|
|
16
|
+
import { i as resolveCodexSessionBinding } from "./session-binding-JEHNMPsr.mjs";
|
|
17
|
+
import { i as resolveCodexAppServerThreadModelSelection, t as CODEX_NATIVE_PERSONALITY_NONE } from "./thread-model-selection-DcVebr8N.mjs";
|
|
18
|
+
import { t as resolveCodexNativeExecutionBlock } from "./sandbox-guard-DIImwCy1.mjs";
|
|
19
|
+
import { i as assertCodexSupervisionThreadLineage, n as CodexThreadPolicyHandoffError, o as refreshCodexThreadPolicy } from "./thread-policy-BEecBTJM.mjs";
|
|
20
|
+
import { o as runCodexCleanupStep } from "./run-attempt-lifecycle-KN4oh-7O.mjs";
|
|
21
|
+
import { a as resolveCodexExternalSandboxPolicyForOpenClawSandbox, c as shouldEnableCodexAppServerNativeToolSurface, l as shouldRequireCodexSandboxExecServerEnvironment, o as resolveCodexMessageToolProvider, s as resolveCodexSandboxEnvironmentSelection, t as buildDynamicTools } from "./dynamic-tool-build-BMiiFROa.mjs";
|
|
22
|
+
import { a as buildCodexNativeHookRelayDisabledConfig, i as buildCodexNativeHookRelayConfig, l as resolveCodexNativeHookRelayEvents, u as resolveCodexNativeHookRelayTtlMs } from "./native-hook-relay-CSZpcjwq.mjs";
|
|
23
|
+
import { i as resolveCodexSessionPermissionCwd, n as applyCodexSessionPermissionPolicy, r as resolveCodexEffectiveSessionPermissionPolicy, t as CODEX_SESSION_PERMISSION_EXEC_MODES } from "./session-permission-policy-CD2MAWU8.mjs";
|
|
24
|
+
import { a as handleCodexAppServerApprovalRequest, c as createCodexNativePreToolUseFailureBuffer, d as buildCodexTemporalAdditionalContext, g as buildCodexUserInput, i as createCodexDynamicToolDiagnostics, o as ensureCodexSandboxExecServerEnvironment, r as routeCodexAppServerElicitationRequest, s as releaseCodexSandboxExecServerEnvironment, t as createCodexDynamicToolBridge, y as CodexNativeToolLifecycleProjector } from "./dynamic-tools-DPPHrGKB.mjs";
|
|
25
|
+
import { t as resolveCodexAppServerForModelProvider } from "./app-server-policy-D_zv8J7V.mjs";
|
|
26
|
+
import { n as resolveCodexProviderWebSearchSupportForClient } from "./provider-capabilities-DtJKxDf6.mjs";
|
|
23
27
|
import { readStringField } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
24
28
|
import { randomUUID } from "node:crypto";
|
|
25
29
|
import { isDeepStrictEqual } from "node:util";
|
|
26
30
|
import { resolveSessionAgentIdsStrict } from "openclaw/plugin-sdk/agent-scope-runtime";
|
|
27
31
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
28
|
-
import { buildAgentHookContextChannelFields, embeddedAgentLog, formatErrorMessage as formatErrorMessage$1, resolveSandboxContext, runAgentCleanupStep } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
29
32
|
import { resolveAgentWorkspaceDir } from "openclaw/plugin-sdk/agent-runtime";
|
|
33
|
+
import { buildAgentHookContextChannelFields, embeddedAgentLog, formatErrorMessage as formatErrorMessage$1, resolveSandboxContext } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
30
34
|
import { loadExecApprovals } from "openclaw/plugin-sdk/exec-approvals-runtime";
|
|
31
35
|
import { loadCodexBundleMcpApprovalConfig, resolveCodexMcpToolOverridesForAgent } from "openclaw/plugin-sdk/codex-mcp-projection";
|
|
32
36
|
import { registerNativeHookRelayForBundledRuntime } from "openclaw/plugin-sdk/native-hook-relay-runtime";
|
|
33
37
|
//#region extensions/codex/src/app-server/side-question-cleanup.ts
|
|
34
38
|
async function cleanupCodexSideQuestion(client, params) {
|
|
39
|
+
const cleanupThread = async () => {
|
|
40
|
+
if (!params.threadId) return;
|
|
41
|
+
if (params.interrupt && params.turnId !== void 0) {
|
|
42
|
+
if (!await interruptCodexTurnAndWaitBestEffort(client, {
|
|
43
|
+
threadId: params.threadId,
|
|
44
|
+
turnId: params.turnId,
|
|
45
|
+
timeoutMs: params.timeoutMs
|
|
46
|
+
})) {
|
|
47
|
+
await retireUnsafeCodexTurnClientBestEffort(client, "side turn interrupt");
|
|
48
|
+
throw new Error("Codex /btw cleanup could not confirm the side turn stopped; background terminals may still be running.");
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
if (params.terminateBackgroundTerminals && params.turnId !== void 0) try {
|
|
52
|
+
await terminateCodexBackgroundTerminals(client, params.threadId);
|
|
53
|
+
} catch (error) {
|
|
54
|
+
await retireUnsafeCodexTurnClientBestEffort(client, "side background terminals");
|
|
55
|
+
throw error;
|
|
56
|
+
}
|
|
57
|
+
if (!await unsubscribeCodexThreadBestEffort(client, {
|
|
58
|
+
threadId: params.threadId,
|
|
59
|
+
timeoutMs: params.timeoutMs
|
|
60
|
+
})) await retireUnsafeCodexTurnClientBestEffort(client, "side thread unsubscribe");
|
|
61
|
+
};
|
|
35
62
|
const errors = [];
|
|
36
|
-
for (const cleanup of [
|
|
63
|
+
for (const cleanup of [cleanupThread, ...params.afterThreadCleanup]) try {
|
|
37
64
|
const pending = cleanup();
|
|
38
65
|
if (pending) await pending;
|
|
39
66
|
} catch (error) {
|
|
@@ -44,29 +71,6 @@ async function cleanupCodexSideQuestion(client, params) {
|
|
|
44
71
|
if (errors.length === 1) throw errors[0];
|
|
45
72
|
throw new AggregateError(errors, errors.map(formatErrorMessage).join("; "), { cause: errors[0] });
|
|
46
73
|
}
|
|
47
|
-
async function cleanupCodexSideThread(client, params) {
|
|
48
|
-
if (!params.threadId) return;
|
|
49
|
-
if (params.interrupt && params.turnId !== void 0) {
|
|
50
|
-
if (!await interruptCodexTurnAndWaitBestEffort(client, {
|
|
51
|
-
threadId: params.threadId,
|
|
52
|
-
turnId: params.turnId,
|
|
53
|
-
timeoutMs: params.timeoutMs
|
|
54
|
-
})) {
|
|
55
|
-
await retireUnsafeCodexTurnClientBestEffort(client, "side turn interrupt");
|
|
56
|
-
throw new Error("Codex /btw cleanup could not confirm the side turn stopped; background terminals may still be running.");
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
if (params.terminateBackgroundTerminals && params.turnId !== void 0) try {
|
|
60
|
-
await terminateCodexBackgroundTerminals(client, params.threadId);
|
|
61
|
-
} catch (error) {
|
|
62
|
-
await retireUnsafeCodexTurnClientBestEffort(client, "side background terminals");
|
|
63
|
-
throw error;
|
|
64
|
-
}
|
|
65
|
-
if (!await unsubscribeCodexThreadBestEffort(client, {
|
|
66
|
-
threadId: params.threadId,
|
|
67
|
-
timeoutMs: params.timeoutMs
|
|
68
|
-
})) await retireUnsafeCodexTurnClientBestEffort(client, "side thread unsubscribe");
|
|
69
|
-
}
|
|
70
74
|
//#endregion
|
|
71
75
|
//#region extensions/codex/src/app-server/side-question-instructions.ts
|
|
72
76
|
const SIDE_DEVELOPER_INSTRUCTIONS = `You are in a side conversation, not the main thread.
|
|
@@ -386,6 +390,63 @@ async function runCodexAppServerSideQuestion(params, options) {
|
|
|
386
390
|
sandboxEnvironment = environment;
|
|
387
391
|
sandboxEnvironmentClient = targetClient;
|
|
388
392
|
};
|
|
393
|
+
async function createCodexSideToolBridge(nativeProviderWebSearchSupport) {
|
|
394
|
+
const resolvedWorkspace = effectiveParams.workspaceDir ?? cwd;
|
|
395
|
+
const sandboxSessionKey = sideRunParams.sandboxSessionKey?.trim() || sideRunParams.sessionKey?.trim() || sideRunParams.sessionId || sessionAgentId;
|
|
396
|
+
const sandbox = sideRunParams.sandbox !== void 0 ? sideRunParams.sandbox : await resolveSandboxContext({
|
|
397
|
+
config: sideRunParams.config,
|
|
398
|
+
sessionKey: sandboxSessionKey,
|
|
399
|
+
workspaceDir: cwd
|
|
400
|
+
});
|
|
401
|
+
let webSearchAllowed = false;
|
|
402
|
+
const tools = await buildDynamicTools({
|
|
403
|
+
params: sideRunParams,
|
|
404
|
+
resolvedWorkspace,
|
|
405
|
+
effectiveWorkspace: cwd,
|
|
406
|
+
sandboxSessionKey,
|
|
407
|
+
sandbox,
|
|
408
|
+
nativeToolSurfaceEnabled,
|
|
409
|
+
nativeProviderWebSearchSupport,
|
|
410
|
+
sessionPermissionPolicy,
|
|
411
|
+
runAbortController,
|
|
412
|
+
sessionAgentId,
|
|
413
|
+
policyAgentId: sessionAgentId,
|
|
414
|
+
pluginConfig,
|
|
415
|
+
onYieldDetected: () => {},
|
|
416
|
+
onWebSearchPolicyResolved: (allowed) => {
|
|
417
|
+
webSearchAllowed = allowed;
|
|
418
|
+
}
|
|
419
|
+
});
|
|
420
|
+
const requestedWebSearchPlan = resolveCodexWebSearchPlan({
|
|
421
|
+
config: sideRunParams.config,
|
|
422
|
+
nativeToolSurfaceEnabled,
|
|
423
|
+
nativeProviderWebSearchSupport,
|
|
424
|
+
webSearchAllowed
|
|
425
|
+
});
|
|
426
|
+
const webSearchPlan = requestedWebSearchPlan.kind === "managed" ? resolveCodexWebSearchPlan({
|
|
427
|
+
config: sideRunParams.config,
|
|
428
|
+
webSearchAllowed: false
|
|
429
|
+
}) : requestedWebSearchPlan;
|
|
430
|
+
const exposedTools = tools.filter((tool) => tool.name !== "web_search" && tool.name !== "computer");
|
|
431
|
+
return {
|
|
432
|
+
toolBridge: createCodexDynamicToolBridge({
|
|
433
|
+
tools: exposedTools,
|
|
434
|
+
signal: runAbortController.signal,
|
|
435
|
+
loading: resolveCodexDynamicToolsLoading(pluginConfig),
|
|
436
|
+
hookContext: {
|
|
437
|
+
agentId: sessionAgentId,
|
|
438
|
+
config: sideRunParams.config,
|
|
439
|
+
contextWindowTokens: sideRunParams.model.contextWindow,
|
|
440
|
+
sessionId: sideRunParams.sessionId,
|
|
441
|
+
sessionKey: sideRunParams.sessionKey,
|
|
442
|
+
runId: sideRunParams.runId,
|
|
443
|
+
currentChannelProvider: resolveCodexMessageToolProvider(sideRunParams),
|
|
444
|
+
...buildAgentHookContextChannelFields(sideRunParams)
|
|
445
|
+
}
|
|
446
|
+
}),
|
|
447
|
+
webSearchPlan
|
|
448
|
+
};
|
|
449
|
+
}
|
|
389
450
|
try {
|
|
390
451
|
assertCurrent();
|
|
391
452
|
const autoApproveMcpTools = shouldAutoApproveCodexAppServerApprovals(appServer);
|
|
@@ -399,7 +460,7 @@ async function runCodexAppServerSideQuestion(params, options) {
|
|
|
399
460
|
});
|
|
400
461
|
const approvalPolicy = Object.keys(binding.pluginAppPolicyContext?.apps ?? {}).length > 0 || hasCodexMcpToolApprovalOverrides(params.cfg?.mcp?.servers, Object.keys(projectedMcpServers), projectedMcpServers) ? withMcpElicitationsApprovalPolicy(appServer.approvalPolicy) : appServer.approvalPolicy;
|
|
401
462
|
const sandbox = appServer.sandbox;
|
|
402
|
-
const
|
|
463
|
+
const { toolBridge, webSearchPlan } = await createCodexSideToolBridge(resolveCodexWebSearchPlan({
|
|
403
464
|
config: params.cfg,
|
|
404
465
|
nativeToolSurfaceEnabled
|
|
405
466
|
}).kind === "native-hosted" ? await resolveCodexProviderWebSearchSupportForClient({
|
|
@@ -407,18 +468,7 @@ async function runCodexAppServerSideQuestion(params, options) {
|
|
|
407
468
|
timeoutMs: appServer.requestTimeoutMs,
|
|
408
469
|
modelProviderOverride: modelSelection.modelProvider,
|
|
409
470
|
signal: runAbortController.signal
|
|
410
|
-
}) : "unsupported";
|
|
411
|
-
const { toolBridge, webSearchPlan } = await createCodexSideToolBridge({
|
|
412
|
-
params: sideRunParams,
|
|
413
|
-
cwd,
|
|
414
|
-
resolvedWorkspace: effectiveParams.workspaceDir ?? cwd,
|
|
415
|
-
pluginConfig,
|
|
416
|
-
sessionAgentId,
|
|
417
|
-
nativeToolSurfaceEnabled,
|
|
418
|
-
nativeProviderWebSearchSupport,
|
|
419
|
-
sessionPermissionPolicy,
|
|
420
|
-
runAbortController
|
|
421
|
-
});
|
|
471
|
+
}) : "unsupported");
|
|
422
472
|
const handleServerRequest = async (request, _scope, requestSignal, setExecutionTimeoutMs) => {
|
|
423
473
|
const signal = AbortSignal.any([requestSignal, runAbortController.signal]);
|
|
424
474
|
if (signal.aborted || !childThreadId || !turnId) return;
|
|
@@ -458,14 +508,14 @@ async function runCodexAppServerSideQuestion(params, options) {
|
|
|
458
508
|
});
|
|
459
509
|
setExecutionTimeoutMs?.(timeoutMs);
|
|
460
510
|
const toolStartedAt = Date.now();
|
|
461
|
-
const
|
|
511
|
+
const diagnostics = createCodexDynamicToolDiagnostics({
|
|
462
512
|
call,
|
|
463
513
|
agentId: sessionAgentId,
|
|
464
514
|
runId: sideRunParams.runId,
|
|
465
515
|
sessionId: params.sessionId,
|
|
466
516
|
sessionKey: params.sessionKey
|
|
467
|
-
};
|
|
468
|
-
|
|
517
|
+
});
|
|
518
|
+
diagnostics.started();
|
|
469
519
|
const toolCall = handleDynamicToolCallWithTimeout({
|
|
470
520
|
call,
|
|
471
521
|
toolBridge,
|
|
@@ -476,18 +526,10 @@ async function runCodexAppServerSideQuestion(params, options) {
|
|
|
476
526
|
activeDynamicToolCalls.add(toolCall);
|
|
477
527
|
try {
|
|
478
528
|
const response = await toolCall;
|
|
479
|
-
|
|
480
|
-
...diagnosticContext,
|
|
481
|
-
response,
|
|
482
|
-
durationMs: Math.max(0, Date.now() - toolStartedAt)
|
|
483
|
-
});
|
|
529
|
+
diagnostics.terminal(response, Math.max(0, Date.now() - toolStartedAt));
|
|
484
530
|
return toCodexDynamicToolProtocolResponse(response);
|
|
485
531
|
} catch (error) {
|
|
486
|
-
|
|
487
|
-
...diagnosticContext,
|
|
488
|
-
durationMs: Math.max(0, Date.now() - toolStartedAt),
|
|
489
|
-
terminalReason: signal.aborted ? resolveCodexToolAbortTerminalReason(signal) : "failed"
|
|
490
|
-
});
|
|
532
|
+
diagnostics.error(Math.max(0, Date.now() - toolStartedAt), signal.aborted ? resolveCodexToolAbortTerminalReason(signal) : "failed");
|
|
491
533
|
throw error;
|
|
492
534
|
} finally {
|
|
493
535
|
activeDynamicToolCalls.delete(toolCall);
|
|
@@ -752,76 +794,13 @@ async function runCodexAppServerSideQuestion(params, options) {
|
|
|
752
794
|
releaseSandboxEnvironment,
|
|
753
795
|
() => releaseCodexAppServerClientLease(clientLease),
|
|
754
796
|
() => nativeHookRelay?.unregister(),
|
|
755
|
-
() =>
|
|
756
|
-
|
|
757
|
-
sessionId: sideRunParams.sessionId,
|
|
758
|
-
step: "codex-side-native-hook-relay-release",
|
|
759
|
-
log: embeddedAgentLog,
|
|
760
|
-
cleanup: async () => {
|
|
761
|
-
await nativeHookRelay?.drain();
|
|
762
|
-
}
|
|
797
|
+
() => runCodexCleanupStep(sideRunParams, "codex-side-native-hook-relay-release", async () => {
|
|
798
|
+
await nativeHookRelay?.drain();
|
|
763
799
|
})
|
|
764
800
|
]
|
|
765
801
|
});
|
|
766
802
|
}
|
|
767
803
|
}
|
|
768
|
-
async function createCodexSideToolBridge(input) {
|
|
769
|
-
const { params } = input;
|
|
770
|
-
const sandboxSessionKey = params.sandboxSessionKey?.trim() || params.sessionKey?.trim() || params.sessionId || input.sessionAgentId;
|
|
771
|
-
const sandbox = params.sandbox !== void 0 ? params.sandbox : await resolveSandboxContext({
|
|
772
|
-
config: params.config,
|
|
773
|
-
sessionKey: sandboxSessionKey,
|
|
774
|
-
workspaceDir: input.cwd
|
|
775
|
-
});
|
|
776
|
-
let webSearchAllowed = false;
|
|
777
|
-
const tools = await buildDynamicTools({
|
|
778
|
-
params,
|
|
779
|
-
resolvedWorkspace: input.resolvedWorkspace,
|
|
780
|
-
effectiveWorkspace: input.cwd,
|
|
781
|
-
sandboxSessionKey,
|
|
782
|
-
sandbox,
|
|
783
|
-
nativeToolSurfaceEnabled: input.nativeToolSurfaceEnabled,
|
|
784
|
-
nativeProviderWebSearchSupport: input.nativeProviderWebSearchSupport,
|
|
785
|
-
sessionPermissionPolicy: input.sessionPermissionPolicy,
|
|
786
|
-
runAbortController: input.runAbortController,
|
|
787
|
-
sessionAgentId: input.sessionAgentId,
|
|
788
|
-
policyAgentId: input.sessionAgentId,
|
|
789
|
-
pluginConfig: input.pluginConfig,
|
|
790
|
-
onYieldDetected: () => {},
|
|
791
|
-
onWebSearchPolicyResolved: (allowed) => {
|
|
792
|
-
webSearchAllowed = allowed;
|
|
793
|
-
}
|
|
794
|
-
});
|
|
795
|
-
const requestedWebSearchPlan = resolveCodexWebSearchPlan({
|
|
796
|
-
config: params.config,
|
|
797
|
-
nativeToolSurfaceEnabled: input.nativeToolSurfaceEnabled,
|
|
798
|
-
nativeProviderWebSearchSupport: input.nativeProviderWebSearchSupport,
|
|
799
|
-
webSearchAllowed
|
|
800
|
-
});
|
|
801
|
-
const webSearchPlan = requestedWebSearchPlan.kind === "managed" ? resolveCodexWebSearchPlan({
|
|
802
|
-
config: params.config,
|
|
803
|
-
webSearchAllowed: false
|
|
804
|
-
}) : requestedWebSearchPlan;
|
|
805
|
-
const exposedTools = tools.filter((tool) => tool.name !== "web_search" && tool.name !== "computer");
|
|
806
|
-
return {
|
|
807
|
-
toolBridge: createCodexDynamicToolBridge({
|
|
808
|
-
tools: exposedTools,
|
|
809
|
-
signal: input.runAbortController.signal,
|
|
810
|
-
loading: resolveCodexDynamicToolsLoading(input.pluginConfig),
|
|
811
|
-
hookContext: {
|
|
812
|
-
agentId: input.sessionAgentId,
|
|
813
|
-
config: params.config,
|
|
814
|
-
contextWindowTokens: params.model.contextWindow,
|
|
815
|
-
sessionId: params.sessionId,
|
|
816
|
-
sessionKey: params.sessionKey,
|
|
817
|
-
runId: params.runId,
|
|
818
|
-
currentChannelProvider: resolveCodexMessageToolProvider(params),
|
|
819
|
-
...buildAgentHookContextChannelFields(params)
|
|
820
|
-
}
|
|
821
|
-
}),
|
|
822
|
-
webSearchPlan
|
|
823
|
-
};
|
|
824
|
-
}
|
|
825
804
|
async function forkCodexSideThread(client, params, options) {
|
|
826
805
|
try {
|
|
827
806
|
return await client.request("thread/fork", params, options);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { a as defaultCodexAppInventoryCache, r as buildCodexPluginAppCacheKey } from "./plugin-app-cache-key-
|
|
2
|
-
import { a as withCodexAppServerJsonClient } from "./request-
|
|
3
|
-
import { a as
|
|
4
|
-
import "./config-
|
|
5
|
-
import { t as __exportAll } from "./session-binding-sidecars-
|
|
1
|
+
import { a as defaultCodexAppInventoryCache, r as buildCodexPluginAppCacheKey } from "./plugin-app-cache-key-Bg9DbDI6.mjs";
|
|
2
|
+
import { a as withCodexAppServerJsonClient } from "./request-6piO0U_P.mjs";
|
|
3
|
+
import { a as marketplaceRef, o as pluginReadParams, r as isOpenAiCuratedMarketplaceName, u as CODEX_PLUGINS_MARKETPLACE_NAME } from "./plugin-inventory-CYgdo14P.mjs";
|
|
4
|
+
import "./config-C1YVVLEA.mjs";
|
|
5
|
+
import { t as __exportAll } from "./session-binding-sidecars-DD-enC8w.mjs";
|
|
6
6
|
import { asNonArrayRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
7
7
|
import path from "node:path";
|
|
8
8
|
import os from "node:os";
|
|
@@ -88,19 +88,16 @@ async function discoverCodexMemoryFile(candidate) {
|
|
|
88
88
|
}
|
|
89
89
|
async function discoverCodexMemorySources(codexHome) {
|
|
90
90
|
const memoriesDir = path.join(codexHome, "memories");
|
|
91
|
-
|
|
91
|
+
const candidates = [{
|
|
92
92
|
id: "memory:codex:MEMORY.md",
|
|
93
93
|
label: "Codex consolidated memory",
|
|
94
|
-
|
|
94
|
+
path: path.join(memoriesDir, "MEMORY.md")
|
|
95
95
|
}, {
|
|
96
96
|
id: "memory:codex:memory_summary.md",
|
|
97
97
|
label: "Codex memory summary",
|
|
98
|
-
|
|
99
|
-
}]
|
|
100
|
-
|
|
101
|
-
label: candidate.label,
|
|
102
|
-
path: path.join(memoriesDir, candidate.name)
|
|
103
|
-
})))).filter((entry) => entry !== void 0);
|
|
98
|
+
path: path.join(memoriesDir, "memory_summary.md")
|
|
99
|
+
}];
|
|
100
|
+
return (await Promise.all(candidates.map(discoverCodexMemoryFile))).filter((entry) => entry !== void 0);
|
|
104
101
|
}
|
|
105
102
|
//#endregion
|
|
106
103
|
//#region extensions/codex/src/migration/source.ts
|
|
@@ -284,23 +281,15 @@ async function withPluginMigrationEligibility(params) {
|
|
|
284
281
|
const installedAppsById = new Map(snapshot.installedApps.map((app) => [app.id, app]));
|
|
285
282
|
for (const { plugin, apps: declaredApps } of pending) {
|
|
286
283
|
const apps = declaredApps.map((app) => sourcePluginAppFactWithInventory(app, appInfoById.get(app.id), installedAppsById.get(app.id)));
|
|
287
|
-
const
|
|
288
|
-
|
|
289
|
-
evaluated.push({
|
|
290
|
-
...plugin,
|
|
291
|
-
apps,
|
|
292
|
-
migratable: true
|
|
293
|
-
});
|
|
294
|
-
continue;
|
|
295
|
-
}
|
|
296
|
-
evaluated.push({
|
|
284
|
+
const block = appInventoryMigrationBlock(plugin, apps);
|
|
285
|
+
evaluated.push(block ? {
|
|
297
286
|
...plugin,
|
|
298
287
|
migratable: false,
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
288
|
+
...block
|
|
289
|
+
} : {
|
|
290
|
+
...plugin,
|
|
291
|
+
apps,
|
|
292
|
+
migratable: true
|
|
304
293
|
});
|
|
305
294
|
}
|
|
306
295
|
return evaluated;
|
|
@@ -330,37 +319,29 @@ async function refreshSourceAppInventory(options) {
|
|
|
330
319
|
}
|
|
331
320
|
function sourcePluginAppFactWithInventory(app, info, installedApp) {
|
|
332
321
|
if (!installedApp) return app;
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
322
|
+
const fact = { ...app };
|
|
323
|
+
if (info) fact.isAccessible = !installedApp.enabled || installedApp.callable;
|
|
324
|
+
else if (installedApp.enabled) fact.isAccessible = false;
|
|
325
|
+
fact.isEnabled = installedApp.enabled;
|
|
326
|
+
if (info && installedApp.enabled && !installedApp.callable) fact.isCallable = false;
|
|
327
|
+
return fact;
|
|
328
|
+
}
|
|
329
|
+
function appInventoryMigrationBlock(plugin, apps) {
|
|
330
|
+
const inaccessible = apps.find((app) => app.isAccessible === false);
|
|
331
|
+
const disabled = apps.find((app) => app.isEnabled === false);
|
|
332
|
+
const missing = apps.find((app) => app.isAccessible === void 0 || app.isEnabled === void 0);
|
|
333
|
+
const blocking = inaccessible ?? disabled ?? missing;
|
|
334
|
+
if (!blocking) return;
|
|
335
|
+
const code = inaccessible ? "app_inaccessible" : disabled ? "app_disabled" : "app_missing";
|
|
336
|
+
const status = inaccessible ? apps.some((app) => app.isCallable === false) ? "not callable" : "inaccessible" : disabled ? "disabled" : "missing";
|
|
346
337
|
return {
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
338
|
+
migrationBlock: {
|
|
339
|
+
code,
|
|
340
|
+
apps
|
|
341
|
+
},
|
|
342
|
+
message: `Codex plugin "${plugin.pluginName ?? plugin.name}" owns app "${blocking.name}" but the source app inventory reports it is ${status}; authenticate or enable the app in Codex before migrating it to OpenClaw.`
|
|
351
343
|
};
|
|
352
344
|
}
|
|
353
|
-
function migrationBlockCodeForApps(apps) {
|
|
354
|
-
if (apps.some((app) => app.isAccessible === false)) return "app_inaccessible";
|
|
355
|
-
if (apps.some((app) => app.isEnabled === false)) return "app_disabled";
|
|
356
|
-
if (apps.some((app) => app.isAccessible === void 0 || app.isEnabled === void 0)) return "app_missing";
|
|
357
|
-
}
|
|
358
|
-
function appInventoryBlockMessage(plugin, apps, code) {
|
|
359
|
-
const status = code === "app_inaccessible" ? apps.some((app) => app.isCallable === false) ? "not callable" : "inaccessible" : code === "app_disabled" ? "disabled" : "missing";
|
|
360
|
-
const blocking = apps.find((app) => code === "app_inaccessible" ? app.isAccessible === false : code === "app_disabled" ? app.isEnabled === false : app.isAccessible === void 0 || app.isEnabled === void 0) ?? apps[0];
|
|
361
|
-
const appLabel = blocking ? ` app "${blocking.name}"` : " an owned app";
|
|
362
|
-
return `Codex plugin "${plugin.pluginName ?? plugin.name}" owns${appLabel} but the source app inventory reports it is ${status}; authenticate or enable the app in Codex before migrating it to OpenClaw.`;
|
|
363
|
-
}
|
|
364
345
|
function codexPluginMigrationSubscriptionWarning() {
|
|
365
346
|
return "Codex app-backed plugin migration requires the Codex app-server source account to be logged in with a ChatGPT subscription account. Log in to the Codex app with subscription auth; OpenClaw auth or API-key auth does not satisfy Codex app connector access.";
|
|
366
347
|
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { i as isJsonObject } from "./protocol-CANUwXJ3.mjs";
|
|
2
|
+
import { normalizeBoundedOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
3
|
+
//#region extensions/codex/src/app-server/thread-archive-guard.ts
|
|
4
|
+
const DESCENDANT_PAGE_LIMIT = 100;
|
|
5
|
+
const MAX_DESCENDANT_PAGES = 100;
|
|
6
|
+
const MAX_THREAD_ID_LENGTH = 256;
|
|
7
|
+
const MAX_CURSOR_LENGTH = 4096;
|
|
8
|
+
function readNextCursor(value) {
|
|
9
|
+
if (value === void 0 || value === null) return;
|
|
10
|
+
if (typeof value !== "string" || !value.trim() || value.length > MAX_CURSOR_LENGTH) throw new Error("Codex app-server returned an invalid descendant-list cursor");
|
|
11
|
+
return value;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Native archive includes the spawned subtree. Enumerate that same subtree first so an
|
|
15
|
+
* OpenClaw-owned descendant cannot be stopped as an undocumented side effect.
|
|
16
|
+
*/
|
|
17
|
+
async function assertCodexArchiveDescendantsUnowned(params) {
|
|
18
|
+
const ancestorThreadId = normalizeBoundedOptionalString(params.threadId, MAX_THREAD_ID_LENGTH);
|
|
19
|
+
if (!ancestorThreadId) throw new Error("cannot verify Codex archive descendants for an invalid thread id");
|
|
20
|
+
const seenThreadIds = /* @__PURE__ */ new Set([ancestorThreadId]);
|
|
21
|
+
let pageIndex = 0;
|
|
22
|
+
for (const archived of [false, true]) {
|
|
23
|
+
const seenCursors = /* @__PURE__ */ new Set();
|
|
24
|
+
let cursor;
|
|
25
|
+
do {
|
|
26
|
+
if (pageIndex++ >= MAX_DESCENDANT_PAGES) throw new Error("Codex descendant enumeration exceeded its safety limit");
|
|
27
|
+
const response = await params.listPage({
|
|
28
|
+
ancestorThreadId,
|
|
29
|
+
archived,
|
|
30
|
+
limit: DESCENDANT_PAGE_LIMIT,
|
|
31
|
+
sortKey: "created_at",
|
|
32
|
+
sortDirection: "desc",
|
|
33
|
+
useStateDbOnly: true,
|
|
34
|
+
...cursor ? { cursor } : {}
|
|
35
|
+
});
|
|
36
|
+
if (!isJsonObject(response) || !Array.isArray(response.data)) throw new Error("Codex app-server returned an invalid descendant-list response");
|
|
37
|
+
if (response.data.length > DESCENDANT_PAGE_LIMIT) throw new Error("Codex app-server exceeded the descendant-list page limit");
|
|
38
|
+
for (const value of response.data) {
|
|
39
|
+
if (!isJsonObject(value)) throw new Error("Codex app-server returned an invalid descendant thread");
|
|
40
|
+
const descendantThreadId = normalizeBoundedOptionalString(value.id, MAX_THREAD_ID_LENGTH);
|
|
41
|
+
if (!descendantThreadId) throw new Error("Codex app-server returned a descendant without a valid thread id");
|
|
42
|
+
if (seenThreadIds.has(descendantThreadId)) throw new Error("Codex app-server returned a cyclic descendant thread list");
|
|
43
|
+
seenThreadIds.add(descendantThreadId);
|
|
44
|
+
await params.assertDescendantIdle(descendantThreadId);
|
|
45
|
+
if (await params.bindingStore.hasOtherThreadOwner(descendantThreadId)) throw new Error("cannot archive a Codex thread while a spawned descendant is owned by an OpenClaw session");
|
|
46
|
+
}
|
|
47
|
+
cursor = readNextCursor(response.nextCursor);
|
|
48
|
+
if (cursor) {
|
|
49
|
+
if (seenCursors.has(cursor)) throw new Error("Codex app-server returned a repeated descendant-list cursor");
|
|
50
|
+
seenCursors.add(cursor);
|
|
51
|
+
}
|
|
52
|
+
} while (cursor);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
//#endregion
|
|
56
|
+
export { assertCodexArchiveDescendantsUnowned as t };
|