@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.
Files changed (161) hide show
  1. package/dist/.setup/{account-usage-runtime-DPXsyONK.mjs → account-usage-runtime-B6S1BQU7.mjs} +8 -7
  2. package/dist/.setup/{app-server-policy-Bg4FZw1f.mjs → app-server-policy-D_zv8J7V.mjs} +3 -4
  3. package/dist/.setup/{apply-CQ3brq3z.mjs → apply-Cc1DfWPz.mjs} +40 -51
  4. package/dist/.setup/{attempt-client-cleanup-DPUGAWP2.mjs → attempt-client-cleanup-CxX4cTSi.mjs} +6 -6
  5. package/dist/.setup/attempt-terminal-jO5IMj9K.mjs +2 -0
  6. package/dist/.setup/{attempt-workspace-context-GllQy8mw.mjs → attempt-workspace-context-CcwP3DA3.mjs} +21 -18
  7. package/dist/.setup/{auth-binding-BoMwpuPN.mjs → auth-binding-BaxlhaNx.mjs} +2 -2
  8. package/dist/.setup/{auth-cache-key-BE1HXsNo.mjs → auth-cache-key-tENCQOub.mjs} +30 -41
  9. package/dist/.setup/{binding-connection-C-08ez1w.mjs → binding-connection-B7HAAZSI.mjs} +2 -2
  10. package/dist/.setup/{binding-connection.runtime-Dn2p-fdy.mjs → binding-connection.runtime-DAXn7iFl.mjs} +6 -5
  11. package/dist/.setup/{bounded-turn-9YflG60n.mjs → bounded-turn-DxtRqV8t.mjs} +21 -17
  12. package/dist/.setup/{bounded-turn-isolation-DklXNk3k.mjs → bounded-turn-isolation-BfDAo-qZ.mjs} +4 -4
  13. package/dist/.setup/{build-state-LS-A65iX.mjs → build-state-CMYRQ_We.mjs} +1 -1
  14. package/dist/.setup/{capabilities-kQntafj_.mjs → capabilities-DbOzOglY.mjs} +1 -1
  15. package/dist/.setup/{client-catalog-response-BprQziLV.mjs → client-catalog-response-B7oqHQGO.mjs} +25 -32
  16. package/dist/.setup/{client-ChJtGEdJ.mjs → client-zrCKOu_E.mjs} +198 -247
  17. package/dist/.setup/{command-dispatch-BoC9hvFs.mjs → command-dispatch-ImiHvcyW.mjs} +3 -4
  18. package/dist/.setup/{command-formatters-DV3DHhdr.mjs → command-formatters-xW9KpoSZ.mjs} +16 -26
  19. package/dist/.setup/{command-handlers-BVX2quUD.mjs → command-handlers-B8CT4ngS.mjs} +270 -360
  20. package/dist/.setup/{command-rpc-M4gYsRiV.mjs → command-rpc-HtQjCQBg.mjs} +19 -18
  21. package/dist/.setup/{compact-D3JNLG_b.mjs → compact-Do9HPeDr.mjs} +41 -61
  22. package/dist/.setup/{computer-use-CF0jsDi1.mjs → computer-use-CeF5GuCX.mjs} +109 -147
  23. package/dist/.setup/{config-0Gxk3_eq.mjs → config-C1YVVLEA.mjs} +32 -59
  24. package/dist/.setup/config-contracts.shared-D85SGEuq.mjs +4 -0
  25. package/dist/.setup/{config-options-HG_Rr3W_.mjs → config-options-DDzeNQ8m.mjs} +52 -90
  26. package/dist/.setup/{config-parsing-BQq-CHTF.mjs → config-parsing-DsWSCPHO.mjs} +19 -55
  27. package/dist/.setup/{config-runtime-cUYrqu_a.mjs → config-runtime-DWzK-k0n.mjs} +2 -2
  28. package/dist/.setup/{config-security-KAPScztc.mjs → config-security-clxAZYWX.mjs} +35 -39
  29. package/dist/.setup/config-utils-DN_YT7dE.mjs +47 -0
  30. package/dist/.setup/{context-engine-projection-CsgYSQhW.mjs → context-engine-projection-ps-yn_ci.mjs} +10 -22
  31. package/dist/.setup/{conversation-binding-7kceEUf0.mjs → conversation-binding-D78aEdkE.mjs} +85 -119
  32. package/dist/.setup/{conversation-binding-data-DJ4ix-W5.mjs → conversation-binding-data-UgLuTSQT.mjs} +9 -8
  33. package/dist/.setup/{conversation-control-BpJpPo0t.mjs → conversation-control-GXM3unE4.mjs} +7 -10
  34. package/dist/.setup/{cyber-failover-Bb1J6hS1.mjs → cyber-failover-D4dgNfFf.mjs} +2 -5
  35. package/dist/.setup/{cyber-failover-notice-XR03ef31.mjs → cyber-failover-notice-ljgGGL0s.mjs} +1 -1
  36. package/dist/.setup/{doctor-start-options-DPW9JxIE.mjs → doctor-start-options-JjTAl-q_.mjs} +5 -5
  37. package/dist/.setup/{dynamic-tool-build-BCi00feJ.mjs → dynamic-tool-build-BMiiFROa.mjs} +57 -69
  38. package/dist/.setup/{dynamic-tools-DUv6Sr6h.mjs → dynamic-tools-DPPHrGKB.mjs} +680 -709
  39. package/dist/.setup/{effective-mcp-catalog-CIdbHp1t.mjs → effective-mcp-catalog-x3JVEcJp.mjs} +11 -20
  40. package/dist/.setup/{elicitation-input-r9axtppm.mjs → elicitation-input-DXG_qaXr.mjs} +14 -20
  41. package/dist/.setup/{ephemeral-turn-U4th15a6.mjs → ephemeral-turn-Dk0wWoqi.mjs} +3 -3
  42. package/dist/.setup/{event-projector-assistant-message-BwG5TUYW.mjs → event-projector-assistant-message-CLMKN4x-.mjs} +2 -2
  43. package/dist/.setup/{event-projector-usage-03R0I2dM.mjs → event-projector-usage-BpKfdoTm.mjs} +20 -33
  44. package/dist/.setup/{event-projector-values-DTqZHizf.mjs → event-projector-values-CLvG1Hil.mjs} +4 -5
  45. package/dist/.setup/history-rejection-B4nOXNXF.mjs +13 -0
  46. package/dist/.setup/{inference-context-D-9gWlTR.mjs → inference-context-DNlGwzwy.mjs} +10 -11
  47. package/dist/.setup/{inference-dispatch-B5UKEUyC.mjs → inference-dispatch-CO6tTs4q.mjs} +5 -4
  48. package/dist/.setup/{inference-metadata-CgIf7sOx.mjs → inference-metadata-DCvcG_N_.mjs} +36 -41
  49. package/dist/.setup/{inference-proxy-DUO5E2QQ.mjs → inference-proxy-BDWV0djM.mjs} +10 -14
  50. package/dist/.setup/{isolated-completion-C6QKyyDS.mjs → isolated-completion-z0ii1a_V.mjs} +8 -8
  51. package/dist/.setup/local-runtime-attribution-CZz2DJ4q.mjs +15 -0
  52. package/dist/.setup/{managed-binary-C1VFoVPf.mjs → managed-binary-BtIjV7yN.mjs} +16 -36
  53. package/dist/.setup/{mcp-app-session-preparation-JFCtSkRp.mjs → mcp-app-session-preparation-GTx-bRGN.mjs} +24 -25
  54. package/dist/.setup/{mcp-tool-metadata-j10HhfTC.mjs → mcp-tool-metadata-DW41snf3.mjs} +1 -1
  55. package/dist/.setup/{model-catalog-DD-evckc.mjs → model-catalog-VUdFUqnH.mjs} +8 -8
  56. package/dist/.setup/{models-DaW-7tld.mjs → models-Dph0RqpR.mjs} +6 -10
  57. package/dist/.setup/{native-auth-Cjb9y7IZ.mjs → native-auth-esN5MdIv.mjs} +5 -5
  58. package/dist/.setup/{native-execution-policy-ClzpdG3D.mjs → native-execution-policy-MXEe7PB3.mjs} +11 -28
  59. package/dist/.setup/native-hook-relay-CSZpcjwq.mjs +561 -0
  60. package/dist/.setup/{native-mcp-app-ChpyWmL-.mjs → native-mcp-app-CDrrBaTE.mjs} +6 -6
  61. package/dist/.setup/native-skill-isolation-BAatEJZb.mjs +391 -0
  62. package/dist/.setup/{native-subagent-monitor-wh_-K3Vo.mjs → native-subagent-monitor-D5O_o07p.mjs} +505 -639
  63. package/dist/.setup/{native-subagent-pending-assignments-BDqhOdJp.mjs → native-subagent-pending-assignments-DmVhedNs.mjs} +11 -23
  64. package/dist/.setup/{native-task-assignments-C6KVqiN1.mjs → native-task-assignments-DimsQ9Qa.mjs} +73 -27
  65. package/dist/.setup/{node-cli-sessions-B5oNDkUS.mjs → node-cli-sessions-CzKg2nGq.mjs} +18 -26
  66. package/dist/.setup/{node-exec-server.runtime-0xSEjKYt.mjs → node-exec-server.runtime-BWkULhBM.mjs} +5 -8
  67. package/dist/.setup/{plan-CUHSuL6_.mjs → plan-QNW5zpFp.mjs} +40 -50
  68. package/dist/.setup/{plugin-activation-BcyBv8PG.mjs → plugin-activation-D7WkJMvU.mjs} +4 -5
  69. package/dist/.setup/{plugin-app-cache-key-BW8rd98k.mjs → plugin-app-cache-key-Bg9DbDI6.mjs} +18 -23
  70. package/dist/.setup/{plugin-approval-roundtrip-bPQbG8BI.mjs → plugin-approval-roundtrip-DOQ3Tibe.mjs} +4 -6
  71. package/dist/.setup/{plugin-inventory-Bf0_piTw.mjs → plugin-inventory-CYgdo14P.mjs} +28 -43
  72. package/dist/.setup/{plugin-marketplace-discovery-SQPhSuic.mjs → plugin-marketplace-discovery-BblHM3DU.mjs} +7 -10
  73. package/dist/.setup/{plugin-metadata-cache-DWnB7VMj.mjs → plugin-metadata-cache-Bi8TAPwX.mjs} +5 -10
  74. package/dist/.setup/project-doc-thread-config-BVcvnps8.mjs +490 -0
  75. package/dist/.setup/{provider-Ct6-1lsF.mjs → provider-BG5nXBnY.mjs} +4 -4
  76. package/dist/.setup/{provider-capabilities-DhkeeHJd.mjs → provider-capabilities-DtJKxDf6.mjs} +1 -1
  77. package/dist/.setup/{rate-limits-CMPy24F5.mjs → rate-limits-CI8pTPqL.mjs} +15 -32
  78. package/dist/.setup/reasoning-effort-CS9kKWB9.mjs +37 -0
  79. package/dist/.setup/{request-CZkKkN6c.mjs → request-6piO0U_P.mjs} +28 -48
  80. package/dist/.setup/{rpc-error-hmWM21RB.mjs → rpc-error-C98SHchT.mjs} +3 -6
  81. package/dist/.setup/{run-attempt-C6-678kR.mjs → run-attempt-DejV9vDW.mjs} +927 -860
  82. package/dist/.setup/{run-attempt-lifecycle-BuZgVbDA.mjs → run-attempt-lifecycle-KN4oh-7O.mjs} +13 -4
  83. package/dist/.setup/{runtime-artifact-CUTOOnKw.mjs → runtime-artifact-C13pR7tD.mjs} +18 -22
  84. package/dist/.setup/{runtime-artifact-connection-CADz3_BY.mjs → runtime-artifact-connection-jS5DeCok.mjs} +3 -3
  85. package/dist/.setup/{sandbox-guard-WqE8yPge.mjs → sandbox-guard-DIImwCy1.mjs} +4 -6
  86. package/dist/.setup/service-tier-normalization-BPgw2Wdt.mjs +9 -0
  87. package/dist/.setup/{session-binding-Ce7BqiPN.mjs → session-binding-JEHNMPsr.mjs} +13 -40
  88. package/dist/.setup/{session-binding-record-BZB8RgcF.mjs → session-binding-record-DU_0biMD.mjs} +4 -4
  89. package/dist/.setup/{session-binding-record-codec-z4ZpDn6E.mjs → session-binding-record-codec-BpH8u_G9.mjs} +16 -39
  90. package/dist/.setup/{session-binding-sidecars-BrdV95Fg.mjs → session-binding-sidecars-DD-enC8w.mjs} +49 -54
  91. package/dist/.setup/{session-catalog-adoption-CPIP4S_y.mjs → session-catalog-adoption-Ca3OYGYM.mjs} +23 -27
  92. package/dist/.setup/{session-catalog-archive-DcgwvSbF.mjs → session-catalog-archive-Bv6gV7x9.mjs} +6 -6
  93. package/dist/.setup/{session-catalog-events-Cj-b2FpC.mjs → session-catalog-events-BziNSfLx.mjs} +6 -5
  94. package/dist/.setup/{session-catalog-index-BnvC43eZ.mjs → session-catalog-index-BmaZFGEH.mjs} +111 -105
  95. package/dist/.setup/{session-catalog-index-order-nhyO0wdW.mjs → session-catalog-index-order-CTfoefow.mjs} +28 -5
  96. package/dist/.setup/{session-catalog-limits-DEU36Qlo.mjs → session-catalog-limits-BynIoOYm.mjs} +1 -1
  97. package/dist/.setup/{session-catalog-list-request-tXephOB4.mjs → session-catalog-list-request-D4MYNgDB.mjs} +11 -8
  98. package/dist/.setup/{session-catalog-native-projection-DCtsWKSF.mjs → session-catalog-native-projection-4CsufcT8.mjs} +5 -61
  99. package/dist/.setup/{session-catalog-node-adoption-7-WEQTB1.mjs → session-catalog-node-adoption-BdP9Zjqo.mjs} +2 -2
  100. package/dist/.setup/{session-catalog-node-continue-DLWBwAAO.mjs → session-catalog-node-continue-CNJibO4_.mjs} +27 -49
  101. package/dist/.setup/{session-catalog-node-lookup-Uufckwcm.mjs → session-catalog-node-lookup-BH_DBGa9.mjs} +3 -3
  102. package/dist/.setup/{session-catalog-parsing-B-qWJh2x.mjs → session-catalog-parsing-DkeoVn60.mjs} +9 -19
  103. package/dist/.setup/{session-catalog-projection-Cn0bLb-d.mjs → session-catalog-projection-CcIdJdsd.mjs} +8 -22
  104. package/dist/.setup/session-catalog-source-CdPqS9sa.mjs +58 -0
  105. package/dist/.setup/{session-cli-kH4vuGod.mjs → session-cli-GwU0izn-.mjs} +20 -41
  106. package/dist/.setup/{session-history-BogBHKLk.mjs → session-history-BO6i_pfk.mjs} +1 -1
  107. package/dist/.setup/{session-history-import-NWKPa4ZO.mjs → session-history-import-CaO8s6ta.mjs} +4 -4
  108. package/dist/.setup/{session-history-read-CNN8zwbD.mjs → session-history-read-BI_2jRED.mjs} +4 -15
  109. package/dist/.setup/{session-history.worker-Cq_4DYgN.mjs → session-history.worker-DJQfek5p.mjs} +147 -159
  110. package/dist/.setup/{session-initialization-D6dtFQkE.mjs → session-initialization-Bi_2DKhc.mjs} +3 -5
  111. package/dist/.setup/{session-permission-policy-BxIUJ0Zd.mjs → session-permission-policy-CD2MAWU8.mjs} +12 -20
  112. package/dist/.setup/{session-retirement-Bo81t4Fb.mjs → session-retirement-CcWVhLVr.mjs} +7 -7
  113. package/dist/.setup/{settled-turn-context-BZsMjkIO.mjs → settled-turn-context-BPL6D3RO.mjs} +1 -1
  114. package/dist/.setup/{settled-turn-finalizer-CFARFqNd.mjs → settled-turn-finalizer-BezKSo-Y.mjs} +12 -11
  115. package/dist/.setup/{shared-client-5NUq43f3.mjs → shared-client-BjiqpbC5.mjs} +164 -227
  116. package/dist/.setup/{side-question-oTlegAz3.mjs → side-question-YQ5FObkD.mjs} +116 -137
  117. package/dist/.setup/{source-1cabQi3x.mjs → source-Ce3XIIsU.mjs} +37 -56
  118. package/dist/.setup/thread-archive-guard-LKdwQKyr.mjs +56 -0
  119. package/dist/.setup/{thread-lifecycle--EPPTNTe.mjs → thread-lifecycle-run-BWy0LDLB.mjs} +338 -478
  120. package/dist/.setup/thread-model-selection-DcVebr8N.mjs +61 -0
  121. package/dist/.setup/{thread-ownership-T7T_iffm.mjs → thread-ownership-5X4197vk.mjs} +5 -5
  122. package/dist/.setup/{thread-ownership-queue-Dp24d7-F.mjs → thread-ownership-queue-CeyYScUC.mjs} +5 -6
  123. package/dist/.setup/{thread-policy-VtqLex1l.mjs → thread-policy-BEecBTJM.mjs} +4 -4
  124. package/dist/.setup/thread-requests-BgzJwJtS.mjs +745 -0
  125. package/dist/.setup/{thread-resume-buZujRcC.mjs → thread-resume-BXY_6o6Z.mjs} +5 -5
  126. package/dist/.setup/{timeout-CXOfNoaX.mjs → timeout-D0mEWSGG.mjs} +6 -12
  127. package/dist/.setup/{transcript-history-projection-B9a7HwUV.mjs → transcript-history-projection-DfKcoZCB.mjs} +3 -4
  128. package/dist/.setup/{transcript-mirror-BfLRARNL.mjs → transcript-mirror-Bee2o6jj.mjs} +68 -68
  129. package/dist/.setup/{transcript-mirror-attestation-YSegaktH.mjs → transcript-mirror-attestation-BzUXnrvv.mjs} +5 -2
  130. package/dist/.setup/{transport-stdio-a0HDa2Mj.mjs → transport-stdio-CRWTkKOn.mjs} +67 -77
  131. package/dist/.setup/{transport-websocket-zqJ0Cmtn.mjs → transport-websocket-DIyPfkHo.mjs} +8 -16
  132. package/dist/.setup/{turn-router-BOKSJmfw.mjs → turn-router-D8DLkZgH.mjs} +30 -31
  133. package/dist/.setup/upstream-prompt-provenance-Ccd9MFRJ.mjs +44 -0
  134. package/dist/.setup/{upstream-session-fork-C4sbIoZb.mjs → upstream-session-fork-DQZbaYMK.mjs} +50 -43
  135. package/dist/.setup/{usage-Cq21xTMZ.mjs → usage-DVR5mNJK.mjs} +4 -4
  136. package/dist/.setup/{usage-limit-error-CGJUoQu8.mjs → usage-limit-error-BEONfgt-.mjs} +12 -21
  137. package/dist/.setup/web-search-item-CvokaZOo.mjs +20 -0
  138. package/dist/.setup/{web-search-provider.runtime-DrVE7-Br.mjs → web-search-provider.runtime-CffHOpYY.mjs} +3 -3
  139. package/dist/.setup/{workspace-write-sandbox-probe-DmUHLrrl.mjs → workspace-write-sandbox-probe-BDWO2Qkh.mjs} +4 -4
  140. package/dist/api.js +15 -15
  141. package/dist/catalog-page.worker.js +1 -1
  142. package/dist/cli-metadata.js +1 -1
  143. package/dist/doctor-contract-api.js +5 -6
  144. package/dist/harness.js +32 -61
  145. package/dist/index.js +302 -416
  146. package/dist/media-understanding-provider.js +32 -43
  147. package/dist/migration-provider-api.js +1 -1
  148. package/dist/native-session-binding-api.js +1 -1
  149. package/dist/native-tool-policy.js +23 -1
  150. package/dist/provider-discovery.js +1 -1
  151. package/dist/session-history-worker-runtime.js +52 -31
  152. package/dist/session-history.worker.js +1 -1
  153. package/openclaw.plugin.json +20 -3
  154. package/package.json +7 -7
  155. package/dist/.setup/attempt-terminal-gZrxQ35N.mjs +0 -5
  156. package/dist/.setup/plugin-thread-config-deadline-C5i1S6RN.mjs +0 -124
  157. package/dist/.setup/service-tier-normalization-Cei89SW6.mjs +0 -15
  158. package/dist/.setup/shell-dynamic-tools-Bmedt1QE.mjs +0 -85
  159. package/dist/.setup/thread-archive-guard-C9frICzX.mjs +0 -60
  160. package/dist/.setup/thread-requests-Bj_Lixmv.mjs +0 -2111
  161. 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-BZB8RgcF.mjs";
3
- import { c as shouldAutoApproveCodexAppServerApprovals, f as readCodexRequirementsToml, l as withMcpElicitationsApprovalPolicy, n as hasCodexMcpToolApprovalOverrides } from "./config-security-KAPScztc.mjs";
4
- import { c as isCodexPairedNodeRemoteExecPlacementSandbox, d as readCodexPluginConfig, l as isCodexRemoteExecPlacementSandbox, u as isCodexSandboxExecServerEnabled } from "./config-parsing-BQq-CHTF.mjs";
5
- import { i as resolveCodexAppServerHomeScope, l as resolveCodexModelBackedReviewerPolicyContext } from "./config-options-HG_Rr3W_.mjs";
6
- import { n as formatCodexUsageLimitErrorMessage } from "./rate-limits-CMPy24F5.mjs";
7
- import { i as resolveCodexBindingAppServerConnection, r as requireCodexSupervisionModelSelection } from "./binding-connection-C-08ez1w.mjs";
8
- import { n as canUseCodexModelBackedApprovalsReviewerForModel, r as resolveOpenClawExecPolicyForCodexAppServer } from "./config-0Gxk3_eq.mjs";
9
- import { X as readRecentCodexRateLimits, b as withLeasedCodexAppServerClientStartSelectionRetry, c as getLeasedSharedCodexAppServerClient, m as releaseCodexAppServerClientLease, tt as resolveCodexAppServerPreparedAuthHandoff } from "./shared-client-5NUq43f3.mjs";
10
- import { N as toCodexDynamicToolProtocolResponse, P as resolveCodexToolAbortTerminalReason, T as handleDynamicToolCallWithTimeout, _ as assertCodexTurnStartResponse, a as isCodexAppServerIndeterminateRequestCancellationError, k as resolveDynamicToolCallTimeoutMs, m as assertCodexThreadForkResponse, r as isCodexAppServerApprovalRequest, w as createCodexElicitationResponse, y as readCodexDynamicToolCallParams } from "./client-ChJtGEdJ.mjs";
11
- import { d as terminateCodexBackgroundTerminals, f as unsubscribeCodexThreadBestEffort, l as retireUnsafeCodexTurnClientBestEffort, s as interruptCodexTurnAndWaitBestEffort } from "./attempt-client-cleanup-DPUGAWP2.mjs";
12
- import { t as CodexEphemeralTurn } from "./ephemeral-turn-U4th15a6.mjs";
13
- import { Ct as mergeCodexThreadConfigs, N as resolveCodexNativeHookRelayEvents, O as buildCodexNativeHookRelayConfig, P as resolveCodexNativeHookRelayTtlMs, _ as CODEX_NATIVE_PERSONALITY_NONE, b as resolveCodexAppServerThreadModelSelection, k as buildCodexNativeHookRelayDisabledConfig, m as resolveCodexWebSearchPlan, pt as resolveCodexDynamicToolsLoading, r as buildCodexRuntimeThreadConfig, wt as refreshCodexPluginAppApprovalPolicy } from "./thread-requests-Bj_Lixmv.mjs";
14
- import { b as resolveCodexAppServerReasoningEffort, o as buildCodexUserInput, r as buildCodexTemporalAdditionalContext, y as readCodexSupportedReasoningEfforts } from "./thread-lifecycle--EPPTNTe.mjs";
15
- import { r as resolveCodexSessionBinding } from "./session-binding-Ce7BqiPN.mjs";
16
- import { i as assertCodexSupervisionThreadLineage, n as CodexThreadPolicyHandoffError, o as refreshCodexThreadPolicy } from "./thread-policy-VtqLex1l.mjs";
17
- import { t as resolveCodexNativeExecutionBlock } from "./sandbox-guard-WqE8yPge.mjs";
18
- import { a as resolveCodexExternalSandboxPolicyForOpenClawSandbox, c as shouldEnableCodexAppServerNativeToolSurface, l as shouldRequireCodexSandboxExecServerEnvironment, o as resolveCodexMessageToolProvider, s as resolveCodexSandboxEnvironmentSelection, t as buildDynamicTools } from "./dynamic-tool-build-BCi00feJ.mjs";
19
- import { i as resolveCodexSessionPermissionCwd, n as applyCodexSessionPermissionPolicy, r as resolveCodexEffectiveSessionPermissionPolicy, t as CODEX_SESSION_PERMISSION_EXEC_MODES } from "./session-permission-policy-BxIUJ0Zd.mjs";
20
- import { a as emitDynamicToolStartedDiagnostic, c as ensureCodexSandboxExecServerEnvironment, i as emitDynamicToolErrorDiagnostic, l as releaseCodexSandboxExecServerEnvironment, m as CodexNativeToolLifecycleProjector, o as emitDynamicToolTerminalDiagnostic, r as routeCodexAppServerElicitationRequest, s as handleCodexAppServerApprovalRequest, t as createCodexDynamicToolBridge, u as createCodexNativePreToolUseFailureBuffer } from "./dynamic-tools-DUv6Sr6h.mjs";
21
- import { t as resolveCodexAppServerForModelProvider } from "./app-server-policy-Bg4FZw1f.mjs";
22
- import { n as resolveCodexProviderWebSearchSupportForClient } from "./provider-capabilities-DhkeeHJd.mjs";
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 [() => cleanupCodexSideThread(client, params), ...params.afterThreadCleanup]) try {
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 nativeProviderWebSearchSupport = resolveCodexWebSearchPlan({
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 diagnosticContext = {
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
- emitDynamicToolStartedDiagnostic(diagnosticContext);
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
- emitDynamicToolTerminalDiagnostic({
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
- emitDynamicToolErrorDiagnostic({
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
- () => runAgentCleanupStep({
756
- runId: sideRunParams.runId,
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-BW8rd98k.mjs";
2
- import { a as withCodexAppServerJsonClient } from "./request-CZkKkN6c.mjs";
3
- import { a as pluginReadParams, i as marketplaceRef, l as CODEX_PLUGINS_MARKETPLACE_NAME, n as isOpenAiCuratedMarketplaceName } from "./plugin-inventory-Bf0_piTw.mjs";
4
- import "./config-0Gxk3_eq.mjs";
5
- import { t as __exportAll } from "./session-binding-sidecars-BrdV95Fg.mjs";
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
- return (await Promise.all([{
91
+ const candidates = [{
92
92
  id: "memory:codex:MEMORY.md",
93
93
  label: "Codex consolidated memory",
94
- name: "MEMORY.md"
94
+ path: path.join(memoriesDir, "MEMORY.md")
95
95
  }, {
96
96
  id: "memory:codex:memory_summary.md",
97
97
  label: "Codex memory summary",
98
- name: "memory_summary.md"
99
- }].map(async (candidate) => await discoverCodexMemoryFile({
100
- id: candidate.id,
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 blockCode = migrationBlockCodeForApps(apps);
288
- if (!blockCode) {
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
- migrationBlock: {
300
- code: blockCode,
301
- apps
302
- },
303
- message: appInventoryBlockMessage(plugin, apps, blockCode)
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
- if (!info) return installedApp.enabled ? {
334
- ...app,
335
- isAccessible: false,
336
- isEnabled: true
337
- } : {
338
- ...app,
339
- isEnabled: false
340
- };
341
- if (!installedApp.enabled) return {
342
- ...app,
343
- isAccessible: true,
344
- isEnabled: false
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
- ...app,
348
- isAccessible: installedApp.callable,
349
- isEnabled: installedApp.enabled,
350
- ...!installedApp.callable ? { isCallable: false } : {}
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 };