@openclaw/codex 2026.9.3 → 2026.9.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (146) hide show
  1. package/assets/activity.svg +30 -0
  2. package/assets/icon.png +0 -0
  3. package/dist/.setup/account-usage-runtime-C2MOIvfq.mjs +75 -0
  4. package/dist/{apply-B6el6hdO.js → .setup/apply-CJ0ZfmBG.mjs} +12 -13
  5. package/dist/.setup/async-questions-DdhOCwGi.mjs +27 -0
  6. package/dist/{attempt-client-cleanup-D6cR54TV.js → .setup/attempt-client-cleanup-BpYKdTA0.mjs} +30 -211
  7. package/dist/{attempt-context-AO4DSjE0.js → .setup/attempt-context-VXVwTCfS.mjs} +6 -6
  8. package/dist/.setup/attempt-terminal-gZrxQ35N.mjs +5 -0
  9. package/dist/{auth-binding-Co2Vfcf_.js → .setup/auth-binding-DhLWa_7K.mjs} +2 -2
  10. package/dist/{auth-cache-key-Kq6oerr6.js → .setup/auth-cache-key-QirmgiCo.mjs} +3 -3
  11. package/dist/{auth-profile-CwzO4_RG.js → .setup/auth-profile-WqZtZfXN.mjs} +1 -1
  12. package/dist/.setup/binding-connection-Bm38niE8.mjs +50 -0
  13. package/dist/.setup/binding-connection.runtime-CnRMC0ta.mjs +48 -0
  14. package/dist/{bounded-turn-lRpmZHFv.js → .setup/bounded-turn-BtlZcivC.mjs} +19 -14
  15. package/dist/{build-state-6RL6qohz.js → .setup/build-state-Xx9ybZqa.mjs} +1 -1
  16. package/dist/{capabilities-BeqLPbtM.js → .setup/capabilities-_vXcZGSx.mjs} +1 -1
  17. package/dist/{client-BEKu4yDx.js → .setup/client-vXs2929Q.mjs} +355 -164
  18. package/dist/{command-dispatch-CisT9Jqq.js → .setup/command-dispatch-naHIZwwF.mjs} +3 -3
  19. package/dist/{command-formatters-DeTfrapr.js → .setup/command-formatters-CGEkdawF.mjs} +4 -3
  20. package/dist/{command-handlers-BfIsJEuA.js → .setup/command-handlers-BtAJEW1X.mjs} +812 -152
  21. package/dist/{command-rpc-BMqRQOFX.js → .setup/command-rpc-DHFpn4le.mjs} +37 -21
  22. package/dist/{compact-CGJZ2rlb.js → .setup/compact-C3i3qlzj.mjs} +28 -43
  23. package/dist/{config-JDfTI4VI.js → .setup/config-CedDWjM-.mjs} +5 -4
  24. package/dist/{config-options-jnIFvwxD.js → .setup/config-options-BsanJ8QG.mjs} +9 -421
  25. package/dist/{protocol-CAAcVIKF.js → .setup/config-parsing-CcB9iPoq.mjs} +9 -51
  26. package/dist/{config-runtime-BWf6JLWG.js → .setup/config-runtime-CeAhl_h4.mjs} +2 -2
  27. package/dist/.setup/config-security-BRQ2mgW9.mjs +465 -0
  28. package/dist/{config-utils-C57JiJrU.js → .setup/config-utils-DujwEnhg.mjs} +2 -4
  29. package/dist/{conversation-binding-CxOlHiix.js → .setup/conversation-binding-DhzrpTM6.mjs} +60 -47
  30. package/dist/{conversation-binding-data-BiodpIzq.js → .setup/conversation-binding-data-CrcyZk6O.mjs} +1 -1
  31. package/dist/{conversation-control-CUCrSIQI.js → .setup/conversation-control-DN53ns41.mjs} +17 -13
  32. package/dist/.setup/cyber-failover-DYwbmf1o.mjs +123 -0
  33. package/dist/.setup/cyber-failover-notice-e9G3J9-e.mjs +17 -0
  34. package/dist/{dynamic-tools-D-JBoaLt.js → .setup/dynamic-tools-D16lOp67.mjs} +168 -61
  35. package/dist/{effective-mcp-catalog-J_5Ep5Um.js → .setup/effective-mcp-catalog-K6kLCN8X.mjs} +3 -3
  36. package/dist/{ephemeral-turn-DSwzP8YY.js → .setup/ephemeral-turn-R1gA8Sn6.mjs} +4 -5
  37. package/dist/{event-projector-assistant-message-BmBM4qBV.js → .setup/event-projector-assistant-message-DNUR1s0A.mjs} +6 -3
  38. package/dist/.setup/event-projector-items-DyTQ_XqL.mjs +200 -0
  39. package/dist/{attempt-notifications--H8zXR5-.js → .setup/event-projector-usage-C7Ntzs-f.mjs} +102 -9
  40. package/dist/{harness-FR6eQgyO.js → .setup/harness-rxaaoN-o.mjs} +90 -19
  41. package/dist/.setup/inference-context-fulhZuz8.mjs +94 -0
  42. package/dist/.setup/inference-proxy-CC15HuSi.mjs +311 -0
  43. package/dist/{isolated-completion-DHBefrzg.js → .setup/isolated-completion-B6srt48J.mjs} +7 -7
  44. package/dist/{launch-args-RXQwn8zV.js → .setup/launch-args-DnMak49W.mjs} +22 -1
  45. package/dist/{managed-binary-DrjjRRUD.js → .setup/managed-binary-DP6Rib3P.mjs} +11 -2
  46. package/dist/{managed-thread-store-D1t5jh3G.js → .setup/managed-thread-store-BMqgThVL.mjs} +48 -14
  47. package/dist/{model-catalog-B_6M04Wo.js → .setup/model-catalog-DkvUuBey.mjs} +35 -10
  48. package/dist/{models-P9k2qAof.js → .setup/models-BDFgm_G-.mjs} +3 -3
  49. package/dist/.setup/native-auth-BLZGqFjw.mjs +57 -0
  50. package/dist/.setup/native-subagent-history-YXaL6dMd.mjs +135 -0
  51. package/dist/.setup/native-subagent-monitor-B1hxzIOy.mjs +5031 -0
  52. package/dist/.setup/native-subagent-task-ids-DsuOonKv.mjs +411 -0
  53. package/dist/{node-cli-sessions-rj0ysJwM.js → .setup/node-cli-sessions-Cl8b2ZF3.mjs} +1 -1
  54. package/dist/{node-exec-server.runtime-BY_ctYnT.js → .setup/node-exec-server.runtime-BaViBKNz.mjs} +5 -5
  55. package/dist/{plan-BMJdMOEF.js → .setup/plan-xD7WKYTM.mjs} +331 -79
  56. package/dist/{plugin-activation-BQK-f5sV.js → .setup/plugin-activation-r8nq5Jzp.mjs} +24 -19
  57. package/dist/{plugin-app-cache-key-CdSQzWyX.js → .setup/plugin-app-cache-key-BOxKP7db.mjs} +29 -25
  58. package/dist/{plugin-approval-roundtrip-DeW95wB5.js → .setup/plugin-approval-roundtrip-CjfzafAZ.mjs} +1 -1
  59. package/dist/{plugin-inventory-CoRCzWW4.js → .setup/plugin-inventory-DUle8DLz.mjs} +12 -8
  60. package/dist/{plugin-marketplace-discovery-3akBizzF.js → .setup/plugin-marketplace-discovery-P-Vndfqq.mjs} +18 -15
  61. package/dist/{plugin-metadata-cache-DgNfRAGA.js → .setup/plugin-metadata-cache-DsS5buNa.mjs} +33 -14
  62. package/dist/{provider-capabilities-W4tfK5Y5.js → .setup/provider-capabilities-B8J4Dy-O.mjs} +2 -2
  63. package/dist/.setup/provider-fFh_-VR3.mjs +50 -0
  64. package/dist/{rate-limits-Bqnx1N4z.js → .setup/rate-limits-DOEGYRNs.mjs} +90 -46
  65. package/dist/.setup/request-BioXJLYa.mjs +292 -0
  66. package/dist/.setup/run-attempt-lifecycle-B7JbY4-F.mjs +71 -0
  67. package/dist/{run-attempt-DwKds3DN.js → .setup/run-attempt-rlA07pUv.mjs} +644 -491
  68. package/dist/{runtime-artifact-T-NwqeSH.js → .setup/runtime-artifact-Dy38Z5iU.mjs} +2 -2
  69. package/dist/{sandbox-guard-BcT66fWy.js → .setup/sandbox-guard-BBP-RbTf.mjs} +4 -3
  70. package/dist/{session-binding-CKSepwIC.js → .setup/session-binding-_0W_fHRr.mjs} +45 -63
  71. package/dist/{session-binding-record-CaZjYwNS.js → .setup/session-binding-record-TH3xA0zj.mjs} +181 -3
  72. package/dist/.setup/session-binding-sidecars-CKYEcfNn.mjs +543 -0
  73. package/dist/{session-catalog-adoption-BKLtSrwi.js → .setup/session-catalog-adoption-CR_whkEW.mjs} +6 -6
  74. package/dist/{session-catalog-archive-D0i2pGj2.js → .setup/session-catalog-archive-CwZaPacf.mjs} +6 -6
  75. package/dist/.setup/session-catalog-events-jMcYfQyd.mjs +250 -0
  76. package/dist/.setup/session-catalog-fUdWDx-U.mjs +2464 -0
  77. package/dist/.setup/session-catalog-index-B141u15s.mjs +1070 -0
  78. package/dist/.setup/session-catalog-index-order-Cc5BzlQr.mjs +48 -0
  79. package/dist/.setup/session-catalog-index-state-BAuDztHN.mjs +180 -0
  80. package/dist/{session-catalog-parsing-CdD3JhdM.js → .setup/session-catalog-native-projection-ChV3cCtm.mjs} +213 -21
  81. package/dist/{session-catalog-node-adoption-BUuDYY8R.js → .setup/session-catalog-node-adoption-BVRsYOSh.mjs} +3 -3
  82. package/dist/{session-catalog-node-continue-CBtc4wkI.js → .setup/session-catalog-node-continue-Dowv8osw.mjs} +7 -7
  83. package/dist/.setup/session-catalog-projection-C1Bj9Jl-.mjs +414 -0
  84. package/dist/{session-cli-CbgaHh0f.js → .setup/session-cli-DIj-IE-E.mjs} +4 -4
  85. package/dist/{session-history-Cz-tOOYj.js → .setup/session-history-C--SrLI8.mjs} +10 -5
  86. package/dist/{session-history-import-DFN7sWRU.js → .setup/session-history-import-JHXT5Xfi.mjs} +4 -4
  87. package/dist/{session-history-read-cxPUxyVV.js → .setup/session-history-read-B3ZfSUbF.mjs} +2 -2
  88. package/dist/{session-history.worker-CNEvGaU5.js → .setup/session-history.worker-CpNj7H_P.mjs} +192 -89
  89. package/dist/{session-initialization-Jo86C60I.js → .setup/session-initialization-DH1z6fXn.mjs} +2 -2
  90. package/dist/{session-permission-policy-B22InTp_.js → .setup/session-permission-policy-DhurXY0l.mjs} +2 -2
  91. package/dist/{session-retirement-BSNG_mhf.js → .setup/session-retirement-CU87AOg9.mjs} +6 -6
  92. package/dist/{settled-turn-context-Du6gdUDd.js → .setup/settled-turn-context-fmwouT5I.mjs} +2 -2
  93. package/dist/{settled-turn-finalizer-BuLUrZl2.js → .setup/settled-turn-finalizer-CiY2bLFK.mjs} +10 -10
  94. package/dist/{shared-client-CVhez2Uo.js → .setup/shared-client-BpTtuLQ5.mjs} +495 -156
  95. package/dist/{side-question-DLbr2vUU.js → .setup/side-question-DSCZyoBD.mjs} +64 -47
  96. package/dist/{source-Da-h6f7e.js → .setup/source-Bjp4UQij.mjs} +15 -14
  97. package/dist/{thread-archive-guard-D1bP04Tf.js → .setup/thread-archive-guard-jmecf6OJ.mjs} +1 -1
  98. package/dist/.setup/thread-history-page-BTx-4xsg.mjs +83 -0
  99. package/dist/{thread-lifecycle-D1pzRwHB.js → .setup/thread-lifecycle-Cik28qWn.mjs} +330 -150
  100. package/dist/{thread-ownership-D6oASVRu.js → .setup/thread-ownership-skomxnIt.mjs} +4 -4
  101. package/dist/{thread-policy-D8kI7yAO.js → .setup/thread-policy-Cjs4B8xf.mjs} +3 -3
  102. package/dist/{thread-resume-T5cveyxA.js → .setup/thread-resume-BkNpj9Pz.mjs} +8 -5
  103. package/dist/.setup/timeout-DZF05XrR.mjs +63 -0
  104. package/dist/{session-catalog-home-id-D7-aLiNt.js → .setup/transcript-history-projection-DHNBDhCU.mjs} +73 -20
  105. package/dist/{transcript-mirror-t5TOccct.js → .setup/transcript-mirror-D4qp_leP.mjs} +15 -6
  106. package/dist/{transcript-mirror-attestation-DibE0krH.js → .setup/transcript-mirror-attestation-CzM-94NC.mjs} +4 -1
  107. package/dist/{transport-stdio-BGjHoYLr.js → .setup/transport-stdio-Cmx94Oiy.mjs} +149 -44
  108. package/dist/{upstream-session-fork-De-sLJ2r.js → .setup/upstream-session-fork-D3UKxgVD.mjs} +27 -26
  109. package/dist/{usage-CPPTmBvZ.js → .setup/usage-BOgBEKso.mjs} +4 -4
  110. package/dist/.setup/usage-limit-error-C0ow7DOc.mjs +166 -0
  111. package/dist/{version-omm6IPI3.js → .setup/version-CoqzXPgK.mjs} +1 -1
  112. package/dist/{web-search-provider.runtime-CSVgQL0w.js → .setup/web-search-provider.runtime-CTGuJt6i.mjs} +3 -3
  113. package/dist/api.js +28 -20
  114. package/dist/cli-metadata.js +1 -1
  115. package/dist/doctor-contract-api.js +8 -528
  116. package/dist/harness.js +1 -1
  117. package/dist/index.js +130 -135
  118. package/dist/media-understanding-provider.js +3 -3
  119. package/dist/migration-provider-api.js +2 -0
  120. package/dist/native-tool-policy.js +12 -0
  121. package/dist/provider-discovery.js +18 -0
  122. package/dist/session-history-worker-runtime.js +23 -5
  123. package/dist/session-history.worker.js +2 -2
  124. package/dist/web-search-contract-api.js +1 -1
  125. package/openclaw.plugin.json +354 -68
  126. package/package.json +11 -8
  127. package/dist/binding-connection-QqgcPCgk.js +0 -60
  128. package/dist/event-projector-usage-CIyrYYid.js +0 -102
  129. package/dist/native-subagent-monitor-BbCUKRwC.js +0 -3350
  130. package/dist/request-CGvGOpeR.js +0 -198
  131. package/dist/session-catalog-HaDcp7Sv.js +0 -1533
  132. package/dist/session-catalog-provenance-DkJHo735.js +0 -124
  133. package/dist/timeout-BVw8aaM1.js +0 -33
  134. package/dist/{auth-profile-selection-DFu9e167.js → .setup/auth-profile-selection-DFu9e167.mjs} +0 -0
  135. package/dist/{context-compaction-activity-CMla5FPJ.js → .setup/context-compaction-activity-CMla5FPJ.mjs} +0 -0
  136. package/dist/{elicitation-input-DPoK8F7w.js → .setup/elicitation-input-DPoK8F7w.mjs} +0 -0
  137. package/dist/{history-rejection-B4nOXNXF.js → .setup/history-rejection-B4nOXNXF.mjs} +0 -0
  138. package/dist/{image-payload-sanitizer-tupAr-2o.js → .setup/image-payload-sanitizer-tupAr-2o.mjs} +0 -0
  139. package/dist/{incognito-session-uhrBF6wJ.js → .setup/incognito-session-uhrBF6wJ.mjs} +0 -0
  140. package/dist/{local-runtime-attribution-B_2mnqhb.js → .setup/local-runtime-attribution-B_2mnqhb.mjs} +0 -0
  141. package/dist/{native-execution-policy-umd0tgh4.js → .setup/native-execution-policy-YBMHSzC4.mjs} +1 -1
  142. /package/dist/{rolldown-runtime-8H4AJuhK.js → .setup/rolldown-runtime-8H4AJuhK.mjs} +0 -0
  143. /package/dist/{session-binding-meta-B7aEMU7g.js → .setup/session-binding-meta-B7aEMU7g.mjs} +0 -0
  144. /package/dist/{session-upstream-marker-D15C9NHp.js → .setup/session-upstream-marker-D15C9NHp.mjs} +0 -0
  145. /package/dist/{upstream-prompt-provenance-LphB8slG.js → .setup/upstream-prompt-provenance-LphB8slG.mjs} +0 -0
  146. /package/dist/{web-search-provider.shared-BrZmlqyR.js → .setup/web-search-provider.shared-BrZmlqyR.mjs} +0 -0
@@ -0,0 +1,30 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100">
2
+ <!--
3
+ Adapted from OpenClaw ui/public/provider-icons/ProviderIcon-codex.svg.
4
+ Source: https://github.com/steipete/CodexBar/blob/215efbd39ad58acb4b0cd637c407d63e6183bc8d/Sources/CodexBar/Resources/ProviderIcon-codex.svg
5
+
6
+ MIT License
7
+ Copyright (c) 2026 Peter Steinberger
8
+
9
+ Permission is hereby granted, free of charge, to any person obtaining a copy
10
+ of this software and associated documentation files (the "Software"), to deal
11
+ in the Software without restriction, including without limitation the rights
12
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
+ copies of the Software, and to permit persons to whom the Software is
14
+ furnished to do so, subject to the following conditions:
15
+
16
+ The above copyright notice and this permission notice shall be included in all
17
+ copies or substantial portions of the Software.
18
+
19
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25
+ SOFTWARE.
26
+
27
+ Names and marks remain the property of their respective owners.
28
+ -->
29
+ <path fill="currentColor" stroke="none" d="M83.7733 42.8087C84.6678 40.1149 84.9771 37.2613 84.6807 34.4385C84.3843 31.6156 83.489 28.8885 82.0544 26.4394C77.6908 18.8436 68.9203 14.9365 60.3548 16.7725C57.9831 14.1344 54.9591 12.1668 51.5864 11.0673C48.2137 9.96772 44.611 9.77498 41.1402 10.5084C37.6694 11.2418 34.4527 12.8755 31.8132 15.2455C29.1736 17.6155 27.204 20.6383 26.1024 24.0103C23.3212 24.5806 20.6938 25.738 18.3958 27.405C16.0977 29.0721 14.1819 31.2104 12.7765 33.6772C8.36538 41.2609 9.3669 50.8267 15.2527 57.3327C14.3549 60.0251 14.0424 62.8782 14.3361 65.7012C14.6298 68.5241 15.523 71.2518 16.9558 73.7017C21.325 81.3002 30.1011 85.207 38.6712 83.3686C40.5554 85.4904 42.8707 87.1858 45.4623 88.3416C48.0539 89.4975 50.8622 90.0871 53.6999 90.0713C62.4793 90.079 70.2575 84.4114 72.9393 76.0515C75.7201 75.4802 78.347 74.3225 80.6449 72.6555C82.9427 70.9886 84.8587 68.8507 86.2649 66.3846C90.6227 58.8145 89.6172 49.3005 83.7733 42.8087ZM53.6999 84.8356C50.1955 84.8411 46.801 83.6129 44.1116 81.3661L44.5848 81.098L60.5123 71.9043C60.9087 71.6718 61.2379 71.3402 61.4674 70.942C61.6969 70.5439 61.8189 70.0929 61.8215 69.6333V47.1769L68.5553 51.072C68.6225 51.1063 68.6694 51.1707 68.6814 51.2456V69.854C68.6641 78.1208 61.9667 84.8183 53.6999 84.8356ZM21.4977 71.0843C19.7402 68.0497 19.1092 64.4925 19.7156 61.0386L20.1885 61.3225L36.1321 70.5165C36.5266 70.748 36.9757 70.87 37.4331 70.87C37.8905 70.87 38.3396 70.748 38.7341 70.5165L58.21 59.2883V67.0628C58.2081 67.1031 58.1973 67.1424 58.1782 67.1779C58.1591 67.2134 58.1322 67.2441 58.0996 67.2678L41.9671 76.5722C34.798 80.7022 25.6388 78.2463 21.4977 71.0843ZM17.3026 36.3898C19.0723 33.3357 21.8655 31.0062 25.1878 29.8138V48.7376C25.1818 49.1949 25.2986 49.6453 25.5261 50.042C25.7535 50.4387 26.0833 50.7671 26.4809 50.9928L45.8622 62.1739L39.1283 66.069C39.0919 66.0883 39.0513 66.0984 39.0101 66.0984C38.9689 66.0984 38.9283 66.0883 38.8919 66.069L22.7908 56.7809C15.6359 52.6337 13.1822 43.4816 17.3026 36.3112V36.3898ZM72.624 49.2426L53.1792 37.9512L59.8976 34.0718C59.9341 34.0524 59.9747 34.0423 60.016 34.0423C60.0573 34.0423 60.0979 34.0524 60.1344 34.0718L76.2355 43.3761C78.6973 44.7966 80.7043 46.8882 82.0221 49.4065C83.3398 51.9249 83.914 54.7661 83.6775 57.5985C83.4411 60.431 82.4038 63.1377 80.6867 65.4027C78.9696 67.6677 76.6436 69.3975 73.9803 70.3901V51.466C73.9663 51.0096 73.834 50.5647 73.5962 50.1749C73.3584 49.7851 73.0234 49.4638 72.624 49.2426ZM79.3261 39.1657L78.8529 38.8815L62.9411 29.6089C62.5442 29.376 62.0924 29.2532 61.6322 29.2532C61.172 29.2532 60.7202 29.376 60.3233 29.6089L40.8629 40.8374V33.0628C40.8587 33.0233 40.8654 32.9834 40.882 32.9473C40.8987 32.9113 40.9248 32.8803 40.9575 32.8579L57.0586 23.5692C59.5263 22.1476 62.3478 21.458 65.193 21.5811C68.0382 21.7042 70.7896 22.6348 73.1253 24.2642C75.461 25.8936 77.2845 28.1543 78.3825 30.782C79.4806 33.4097 79.8077 36.2957 79.3257 39.1025V39.1657H79.3261ZM37.1888 52.9484L30.455 49.069C30.4213 49.0487 30.3925 49.0212 30.3707 48.9884C30.3488 48.9557 30.3345 48.9186 30.3286 48.8797V30.3188C30.3323 27.4714 31.1466 24.6839 32.6761 22.2822C34.2057 19.8805 36.3874 17.9639 38.9661 16.7564C41.5448 15.549 44.4139 15.1005 47.2381 15.4636C50.0622 15.8267 52.7247 16.9862 54.9141 18.8067L54.4409 19.0748L38.5134 28.2686C38.117 28.5011 37.7879 28.8327 37.5584 29.2308C37.329 29.629 37.207 30.0799 37.2045 30.5395L37.1888 52.9487V52.9484ZM40.8472 45.0632L49.5209 40.0643L58.21 45.0635V55.0615L49.5523 60.0608L40.8632 55.0615L40.8472 45.0632Z" />
30
+ </svg>
Binary file
@@ -0,0 +1,75 @@
1
+ import { n as isCodexAppServerProxyLaunch } from "./launch-args-DnMak49W.mjs";
2
+ import { t as buildCodexAppServerUsageSnapshot } from "./rate-limits-DOEGYRNs.mjs";
3
+ import { n as readCodexAppServerUsage } from "./request-BioXJLYa.mjs";
4
+ import "./config-CedDWjM-.mjs";
5
+ import { n as resolveCodexAppServerRuntimeOptions } from "./config-runtime-CeAhl_h4.mjs";
6
+ import { a as resolveCodexAppServerAuthProfileStore } from "./auth-profile-WqZtZfXN.mjs";
7
+ import { isDeepStrictEqual } from "node:util";
8
+ import { listAgentIds, resolveAgentDir } from "openclaw/plugin-sdk/agent-scope-runtime";
9
+ import { z } from "zod";
10
+ import { ErrorCodes, errorShape } from "openclaw/plugin-sdk/gateway-runtime";
11
+ //#region extensions/codex/src/account-usage-runtime.ts
12
+ const paramsSchema = z.object({
13
+ agentId: z.string().min(1),
14
+ profileId: z.string().min(1)
15
+ }).strict();
16
+ async function handleCodexAccountUsage({ params, respond, context, signal, hasCurrentClientAuthority }) {
17
+ const parsed = paramsSchema.safeParse(params);
18
+ if (!parsed.success) {
19
+ respond(false, void 0, errorShape(ErrorCodes.INVALID_REQUEST, "Expected agentId and profileId."));
20
+ return;
21
+ }
22
+ const { agentId, profileId } = parsed.data;
23
+ const config = context.getRuntimeConfig();
24
+ if (!listAgentIds(config).includes(agentId)) {
25
+ respond(false, void 0, errorShape(ErrorCodes.INVALID_REQUEST, "Unknown agent."));
26
+ return;
27
+ }
28
+ try {
29
+ const agentDir = resolveAgentDir(config, agentId);
30
+ const readStore = () => resolveCodexAppServerAuthProfileStore({
31
+ agentDir,
32
+ authProfileId: profileId,
33
+ config
34
+ });
35
+ const store = structuredClone(readStore());
36
+ const credential = store.profiles[profileId];
37
+ if (!credential || credential.provider !== "openai" || credential.type === "api_key") {
38
+ respond(false, void 0, errorShape(ErrorCodes.INVALID_REQUEST, "Select a saved Codex subscription login."));
39
+ return;
40
+ }
41
+ const assertCurrent = () => {
42
+ if (signal?.aborted || hasCurrentClientAuthority?.() === false || context.getRuntimeConfig() !== config || !isDeepStrictEqual(readStore().profiles[profileId], store.profiles[profileId])) throw new Error("Account credentials changed. Refresh Models and try again.");
43
+ };
44
+ assertCurrent();
45
+ const { start } = resolveCodexAppServerRuntimeOptions({ pluginConfig: config.plugins?.entries?.codex?.config });
46
+ if (isCodexAppServerProxyLaunch(start.args)) throw new Error("Account usage is unavailable through a Codex proxy. Configure a direct app-server launch.");
47
+ const usage = await readCodexAppServerUsage({
48
+ agentDir,
49
+ config,
50
+ timeoutMs: 2e4,
51
+ preparedAuth: {
52
+ kind: "profile",
53
+ profileId,
54
+ store
55
+ },
56
+ authRequirement: "subscription",
57
+ assertCurrent,
58
+ startOptions: {
59
+ ...start,
60
+ transport: "stdio",
61
+ homeScope: "agent"
62
+ }
63
+ });
64
+ assertCurrent();
65
+ const snapshot = buildCodexAppServerUsageSnapshot(usage.rateLimits, { accountDetails: true });
66
+ respond(true, {
67
+ updatedAt: Date.now(),
68
+ providers: [snapshot]
69
+ });
70
+ } catch (error) {
71
+ respond(false, void 0, errorShape(ErrorCodes.UNAVAILABLE, error instanceof Error ? error.message : "Codex usage unavailable. Try refreshing the account."));
72
+ }
73
+ }
74
+ //#endregion
75
+ export { handleCodexAccountUsage };
@@ -1,14 +1,14 @@
1
- import { m as CODEX_PLUGINS_MARKETPLACE_NAME } from "./config-utils-C57JiJrU.js";
2
- import { x as readCodexPluginConfig } from "./protocol-CAAcVIKF.js";
3
- import { s as resolveCodexAppServerFallbackApiKeyCacheKey } from "./auth-cache-key-Kq6oerr6.js";
4
- import { r as buildCodexPluginAppCacheKey, s as defaultCodexAppInventoryCache } from "./plugin-app-cache-key-CdSQzWyX.js";
5
- import { i as requestCodexAppServerJson } from "./request-CGvGOpeR.js";
6
- import "./config-JDfTI4VI.js";
7
- import { n as resolveCodexAppServerRuntimeOptions } from "./config-runtime-BWf6JLWG.js";
8
- import { i as resolveCodexAppServerAuthProfileIdForAgent } from "./auth-profile-CwzO4_RG.js";
9
- import { X as resolveCodexAppServerAuthAccountCacheKey, c as getLeasedSharedCodexAppServerClient, h as releaseLeasedSharedCodexAppServerClient, o as clearSharedCodexAppServerClientIfCurrentAndWait } from "./shared-client-CVhez2Uo.js";
10
- import { t as ensureCodexPluginActivation } from "./plugin-activation-BQK-f5sV.js";
11
- import { CODEX_PLUGIN_CONFIG_PATH, buildCodexMigrationPlan, buildCodexPluginsConfigValue, hasCodexPluginConfigConflict, n as applyCodexAuthItems, readCodexPluginMigrationConfigEntry, t as resolveCodexMigrationTargets } from "./plan-BMJdMOEF.js";
1
+ import { c as CODEX_PLUGINS_MARKETPLACE_NAME } from "./plugin-inventory-DUle8DLz.mjs";
2
+ import { d as readCodexPluginConfig } from "./config-parsing-CcB9iPoq.mjs";
3
+ import { s as resolveCodexAppServerFallbackApiKeyCacheKey } from "./auth-cache-key-QirmgiCo.mjs";
4
+ import { a as defaultCodexAppInventoryCache, r as buildCodexPluginAppCacheKey } from "./plugin-app-cache-key-BOxKP7db.mjs";
5
+ import { i as requestCodexAppServerJson } from "./request-BioXJLYa.mjs";
6
+ import "./config-CedDWjM-.mjs";
7
+ import { n as resolveCodexAppServerRuntimeOptions } from "./config-runtime-CeAhl_h4.mjs";
8
+ import { i as resolveCodexAppServerAuthProfileIdForAgent } from "./auth-profile-WqZtZfXN.mjs";
9
+ import { X as resolveCodexAppServerAuthAccountCacheKey, c as getLeasedSharedCodexAppServerClient, h as releaseLeasedSharedCodexAppServerClient, o as clearSharedCodexAppServerClientIfCurrentAndWait } from "./shared-client-BpTtuLQ5.mjs";
10
+ import { t as ensureCodexPluginActivation } from "./plugin-activation-r8nq5Jzp.mjs";
11
+ import { CODEX_PLUGIN_CONFIG_PATH, buildCodexMigrationPlan, buildCodexPluginsConfigValue, hasCodexPluginConfigConflict, n as applyCodexAuthItems, r as resolveCodexConfigPatchMode, readCodexPluginMigrationConfigEntry, t as resolveCodexMigrationTargets } from "./plan-xD7WKYTM.mjs";
12
12
  import { uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
13
13
  import { parseStrictNonNegativeInteger } from "openclaw/plugin-sdk/number-runtime";
14
14
  import path from "node:path";
@@ -53,7 +53,6 @@ function sanitizeAppsNeedingAuth(apps) {
53
53
  //#region extensions/codex/src/migration/apply.ts
54
54
  const CODEX_PLUGIN_AUTH_REQUIRED_REASON = "auth_required";
55
55
  const CODEX_PLUGIN_NOT_SELECTED_REASON = "not selected for migration";
56
- const CODEX_CONFIG_PATCH_MODE_RETURN = "return";
57
56
  const CODEX_PLUGIN_LOAD_WARNING = "Some Codex plugins could not be migrated. Run `openclaw migrate codex` after onboarding.";
58
57
  const TARGET_CODEX_MARKETPLACE_DISCOVERY_POLL_MS = 250;
59
58
  const TARGET_CODEX_MARKETPLACE_DISCOVERY_TIMEOUT_MS = 3e4;
@@ -66,7 +65,7 @@ var CodexPluginConfigConflictError = class extends Error {
66
65
  }
67
66
  };
68
67
  function shouldReturnCodexPluginConfigPatch(ctx) {
69
- return ctx.providerOptions?.configPatchMode === CODEX_CONFIG_PATCH_MODE_RETURN;
68
+ return resolveCodexConfigPatchMode(ctx) === "return";
70
69
  }
71
70
  function prepareTargetCodexAppServer(ctx) {
72
71
  const appServer = resolveTargetCodexAppServer(ctx);
@@ -0,0 +1,27 @@
1
+ import { asOptionalRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
2
+ //#region extensions/codex/src/app-server/async-questions.ts
3
+ /** Keep unsupported question payloads on Codex's complete plain-text fallback. */
4
+ function readCodexAsyncQuestions(value) {
5
+ if (!Array.isArray(value) || value.length === 0 || value.length > 12) return;
6
+ const questions = [];
7
+ for (const entry of value) {
8
+ const question = asOptionalRecord(entry);
9
+ if (!question || !isQuestionText(question.title, 4096)) return;
10
+ const options = question.options;
11
+ if (options === void 0 || options === null) {
12
+ questions.push({ title: question.title });
13
+ continue;
14
+ }
15
+ if (!Array.isArray(options) || options.length === 0 || options.length > 4 || !options.every((option) => isQuestionText(option, 256))) return;
16
+ questions.push({
17
+ title: question.title,
18
+ options: [...options]
19
+ });
20
+ }
21
+ return questions;
22
+ }
23
+ function isQuestionText(value, maxLength) {
24
+ return typeof value === "string" && value.length <= maxLength && value.trim().length > 0;
25
+ }
26
+ //#endregion
27
+ export { readCodexAsyncQuestions as t };
@@ -1,211 +1,15 @@
1
- import { o as isJsonObject } from "./protocol-CAAcVIKF.js";
2
- import "./client-BEKu4yDx.js";
3
- import { m as retireSharedCodexAppServerClientIfCurrent } from "./auth-cache-key-Kq6oerr6.js";
4
- import { r as CodexAppServerRpcError } from "./session-catalog-provenance-DkJHo735.js";
5
- import { G as unsubscribeCodexAppServerLiveThread } from "./shared-client-CVhez2Uo.js";
6
- import { asFiniteNumber, normalizeOptionalString, normalizeOptionalString as normalizeOptionalString$1, readStringField } from "openclaw/plugin-sdk/string-coerce-runtime";
7
- import { createDeferred } from "openclaw/plugin-sdk/extension-shared";
8
- import { embeddedAgentLog } from "openclaw/plugin-sdk/agent-harness-runtime";
1
+ import { m as isJsonObject } from "./config-security-BRQ2mgW9.mjs";
2
+ import { a as isCodexAppServerBrokenPipeError, d as isCodexAppServerRequestTimeoutError, l as isCodexAppServerOverloadError } from "./client-vXs2929Q.mjs";
3
+ import { m as retireSharedCodexAppServerClientIfCurrent } from "./auth-cache-key-QirmgiCo.mjs";
4
+ import { i as CodexAppServerRpcError } from "./timeout-DZF05XrR.mjs";
5
+ import { h as unknownItemStatus } from "./event-projector-items-DyTQ_XqL.mjs";
6
+ import { G as unsubscribeCodexAppServerLiveThread, rt as isCodexAppServerStartupError, u as isCodexAppServerStartSelectionChangedError } from "./shared-client-BpTtuLQ5.mjs";
7
+ import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
9
8
  import { AsyncResource } from "node:async_hooks";
10
- import { redactSensitiveText } from "openclaw/plugin-sdk/logging-core";
9
+ import { createDeferred } from "openclaw/plugin-sdk/extension-shared";
10
+ import { AgentHarnessPreflightError, embeddedAgentLog } from "openclaw/plugin-sdk/agent-harness-runtime";
11
11
  import { sanitizeTerminalText } from "openclaw/plugin-sdk/text-chunking";
12
- //#region extensions/codex/src/app-server/event-projector-values.ts
13
- const BIO_POLICY_SAFETY_ACCESS_BLOCK_PREFIX = "This content was flagged for possible biological risk.";
14
- /** Project only Codex's explicit refusal contracts; other policy errors retain their own paths. */
15
- function readCodexProviderRefusal(message, codexErrorInfo) {
16
- if (!message) return;
17
- if (codexErrorInfo === "cyberPolicy") return {
18
- category: "cyber",
19
- message
20
- };
21
- if (codexErrorInfo === "misalignmentPolicyViolation") return {
22
- category: "misalignment",
23
- message
24
- };
25
- return message.startsWith(BIO_POLICY_SAFETY_ACCESS_BLOCK_PREFIX) ? {
26
- category: "bio",
27
- message
28
- } : void 0;
29
- }
30
- function readNonEmptyString(record, key) {
31
- return normalizeOptionalString$1(record[key]);
32
- }
33
- function readNonEmptyStringArray(record, key) {
34
- const value = record[key];
35
- if (!Array.isArray(value)) return [];
36
- const entries = [];
37
- for (const entry of value) {
38
- const normalized = normalizeOptionalString$1(entry);
39
- if (normalized) entries.push(normalized);
40
- }
41
- return entries;
42
- }
43
- function readNullableString(record, key) {
44
- const value = record[key];
45
- if (value === null) return null;
46
- return typeof value === "string" ? value : void 0;
47
- }
48
- function readNonNegativeInteger(record, key) {
49
- const value = asFiniteNumber(record[key]);
50
- return value !== void 0 && Number.isInteger(value) && value >= 0 ? value : void 0;
51
- }
52
- function readCodexErrorNotificationMessage(record) {
53
- const error = record.error;
54
- return isJsonObject(error) ? readStringField(error, "message") : void 0;
55
- }
56
- function readHookOutputEntries(value) {
57
- if (!Array.isArray(value)) return [];
58
- return value.flatMap((entry) => {
59
- if (!isJsonObject(entry)) return [];
60
- const text = readStringField(entry, "text");
61
- if (!text) return [];
62
- const kind = readStringField(entry, "kind");
63
- return [{
64
- ...kind ? { kind } : {},
65
- text
66
- }];
67
- });
68
- }
69
- function splitPlanText(text) {
70
- return text.split(/\r?\n/).map((line) => line.trim().replace(/^[-*]\s+/, "")).filter((line) => line.length > 0);
71
- }
72
- function extractRawAssistantText(item) {
73
- const parts = (Array.isArray(item.content) ? item.content : []).flatMap((entry) => {
74
- if (!isJsonObject(entry)) return [];
75
- const type = readStringField(entry, "type");
76
- if (type !== "output_text" && type !== "text") return [];
77
- const value = readStringField(entry, "text");
78
- return value === void 0 ? [] : [value];
79
- });
80
- return parts.length > 0 ? parts.join("").trim() : void 0;
81
- }
82
- function readItemString(item, key) {
83
- const value = item[key];
84
- return typeof value === "string" ? value : void 0;
85
- }
86
- function readItem(value) {
87
- if (!isJsonObject(value)) return;
88
- const type = typeof value.type === "string" ? value.type : void 0;
89
- const id = typeof value.id === "string" ? value.id : void 0;
90
- if (!type || !id) return;
91
- return value;
92
- }
93
- //#endregion
94
- //#region extensions/codex/src/app-server/event-projector-items.ts
95
- function matchesCodexSnapshotTurn(item, turnId) {
96
- const itemTurnId = readItemString(item, "turnId");
97
- return itemTurnId === void 0 || itemTurnId === turnId;
98
- }
99
- function itemKind(item) {
100
- switch (item.type) {
101
- case "dynamicToolCall":
102
- case "mcpToolCall": return "tool";
103
- case "commandExecution": return "command";
104
- case "fileChange": return "patch";
105
- case "webSearch": return "search";
106
- case "reasoning":
107
- case "contextCompaction": return "analysis";
108
- default: return;
109
- }
110
- }
111
- function itemTitle(item) {
112
- switch (item.type) {
113
- case "commandExecution": return "Command";
114
- case "fileChange": return "File change";
115
- case "mcpToolCall": return "MCP tool";
116
- case "dynamicToolCall": return "Tool";
117
- case "webSearch": return "Web search";
118
- case "contextCompaction": return "Context compaction";
119
- case "reasoning": return "Reasoning";
120
- default: return item.type;
121
- }
122
- }
123
- function itemStatus(item) {
124
- const status = readItemString(item, "status");
125
- if (status === "failed" || status === "error") return "failed";
126
- if (status === "declined") return "blocked";
127
- if (status === "inProgress" || status === "in_progress" || status === "running") return "running";
128
- return "completed";
129
- }
130
- function unknownItemStatus(item) {
131
- const status = readItemString(item, "status");
132
- switch (status) {
133
- case void 0:
134
- case "completed":
135
- case "failed":
136
- case "error":
137
- case "declined":
138
- case "inProgress":
139
- case "in_progress":
140
- case "running": return;
141
- default: return status;
142
- }
143
- }
144
- function auditNativeToolTerminalStatus(item) {
145
- if (item.type === "imageView" || item.type === "sleep") return "completed";
146
- const status = readItemString(item, "status");
147
- if (status === "completed") return "completed";
148
- if (status === "failed" || status === "error") return "failed";
149
- if (status === "declined") return "blocked";
150
- return "unknown";
151
- }
152
- function auditNativeToolUnfinishedStatus(item) {
153
- return item.type === "webSearch" || item.type === "imageGeneration" ? "unknown" : "failed";
154
- }
155
- function isNonSuccessItemStatus(status) {
156
- return status === "failed" || status === "blocked";
157
- }
158
- function itemName(item) {
159
- if (item.type === "dynamicToolCall" && typeof item.tool === "string") return item.tool;
160
- if (item.type === "mcpToolCall" && typeof item.tool === "string") {
161
- const server = typeof item.server === "string" ? item.server : void 0;
162
- return server ? `${server}.${item.tool}` : item.tool;
163
- }
164
- if (item.type === "commandExecution") return "bash";
165
- if (item.type === "fileChange") return "apply_patch";
166
- if (item.type === "webSearch") return "web_search";
167
- }
168
- function auditNativeToolName(item) {
169
- if (item.type === "dynamicToolCall") return;
170
- const progressName = itemName(item);
171
- if (progressName) return progressName;
172
- if (item.type === "collabAgentToolCall") return typeof item.tool === "string" && item.tool.trim() ? `collab.${item.tool.trim()}` : "collab_agent";
173
- if (item.type === "imageGeneration") return "image_generation";
174
- if (item.type === "imageView") return "image_view";
175
- if (item.type === "sleep") return "sleep";
176
- }
177
- function isSideEffectingNativeToolItem(item) {
178
- return itemStatus(item) !== "blocked" && (isMutatingNativeToolItem(item) || item.type === "mcpToolCall");
179
- }
180
- function shouldSynthesizeToolProgressForItem(item) {
181
- switch (item.type) {
182
- case "commandExecution":
183
- case "fileChange":
184
- case "webSearch":
185
- case "mcpToolCall": return true;
186
- default: return false;
187
- }
188
- }
189
- function shouldRecordNativeToolTranscript(item) {
190
- return shouldSynthesizeToolProgressForItem(item);
191
- }
192
- function isMutatingNativeToolItem(item) {
193
- if (item.type === "commandExecution") return true;
194
- return item.type === "fileChange" || item.type === "collabAgentToolCall" || item.type === "imageGeneration";
195
- }
196
- function shouldClearTerminalPresentationForNativeItem(item) {
197
- switch (item.type) {
198
- case "collabAgentToolCall":
199
- case "commandExecution":
200
- case "fileChange":
201
- case "imageGeneration":
202
- case "imageView":
203
- case "mcpToolCall":
204
- case "webSearch": return true;
205
- default: return false;
206
- }
207
- }
208
- //#endregion
12
+ import { redactSensitiveText } from "openclaw/plugin-sdk/logging-core";
209
13
  //#region extensions/codex/src/app-server/notification-correlation.ts
210
14
  /**
211
15
  * Correlates Codex app-server notifications with the active thread/turn so
@@ -288,6 +92,9 @@ const DEFAULT_PREBIND_NOTIFICATION_LIMIT = 256;
288
92
  const DEFAULT_GLOBAL_WARNING_LIMIT = 32;
289
93
  const CODEX_APP_SERVER_NATIVE_TURN_WAIT_TIMEOUT_MS = 3e4;
290
94
  const routers = /* @__PURE__ */ new WeakMap();
95
+ function hasCodexAppServerSiblingRouteWork(client, threadId) {
96
+ return routers.get(client)?.hasSiblingWork(threadId) ?? false;
97
+ }
291
98
  /** Returns the sole router installed on a physical app-server client. */
292
99
  function getCodexAppServerTurnRouter(client) {
293
100
  const existing = routers.get(client);
@@ -297,12 +104,17 @@ function getCodexAppServerTurnRouter(client) {
297
104
  return router;
298
105
  }
299
106
  var ClientTurnRouter = class {
107
+ hasSiblingWork(threadId) {
108
+ for (const routedThreadId of this.routes.keys()) if (routedThreadId !== threadId) return true;
109
+ for (const watchedThreadId of this.nativeTurnCompletionWatchers.keys()) if (watchedThreadId !== threadId) return true;
110
+ return false;
111
+ }
300
112
  constructor(client) {
301
113
  this.routes = /* @__PURE__ */ new Map();
302
114
  this.globalWarnings = [];
303
115
  this.nativeTurnCompletionWatchers = /* @__PURE__ */ new Map();
304
116
  client.addNotificationHandler((notification) => this.routeNotification(notification));
305
- client.addRequestHandler((request, signal) => this.routeRequest(request, signal));
117
+ client.addRequestHandler((request, signal, setExecutionTimeoutMs) => this.routeRequest(request, signal, setExecutionTimeoutMs));
306
118
  client.addCloseHandler((closedClient) => {
307
119
  this.dispose(closedClient.getCloseError());
308
120
  });
@@ -519,7 +331,7 @@ var ClientTurnRouter = class {
519
331
  this.enqueueNotification(route, handler, notification, routeScope);
520
332
  return route.notificationTail;
521
333
  }
522
- async routeRequest(request, signal = new AbortController().signal) {
334
+ async routeRequest(request, signal = new AbortController().signal, setExecutionTimeoutMs) {
523
335
  if (this.closeError || signal.aborted) return;
524
336
  const scope = readScope(request.params);
525
337
  if (!scope.threadId) return;
@@ -542,7 +354,9 @@ var ClientTurnRouter = class {
542
354
  const result = await handler(request, {
543
355
  threadId: scope.threadId,
544
356
  ...scope.turnId ? { turnId: scope.turnId } : {}
545
- }, requestSignal);
357
+ }, requestSignal, setExecutionTimeoutMs && ((timeoutMs) => {
358
+ if (!requestSignal.aborted) setExecutionTimeoutMs(timeoutMs);
359
+ }));
546
360
  return requestSignal.aborted ? void 0 : result;
547
361
  } catch (error) {
548
362
  if (requestSignal.aborted) return;
@@ -764,7 +578,7 @@ async function interruptCodexTurnAndWaitBestEffort(client, params) {
764
578
  }
765
579
  }
766
580
  /** Stops native terminals on the cancelled thread without retiring peer threads. */
767
- async function terminateCodexBackgroundTerminals(client, threadId, oneShotCliRun = false) {
581
+ async function terminateCodexBackgroundTerminals(client, threadId, oneShotCliRun = false, waitForNativeItems) {
768
582
  const options = {
769
583
  timeoutMs: CODEX_APP_SERVER_INTERRUPT_TIMEOUT_MS,
770
584
  signal: AbortSignal.timeout(CODEX_APP_SERVER_INTERRUPT_TIMEOUT_MS)
@@ -782,6 +596,7 @@ async function terminateCodexBackgroundTerminals(client, threadId, oneShotCliRun
782
596
  }, options)).data.length > 0) throw new Error("native background terminals remain running");
783
597
  if (oneShotCliRun) throw new Error("native terminal termination did not confirm process cleanup");
784
598
  }
599
+ await waitForNativeItems?.(options.signal);
785
600
  } catch (cause) {
786
601
  throw new Error("Codex background-terminal cleanup failed; inspect the thread's running terminals before starting more work.", { cause });
787
602
  }
@@ -800,5 +615,9 @@ async function unsubscribeCodexThreadBestEffort(client, params) {
800
615
  return false;
801
616
  }
802
617
  }
618
+ function shouldRetireCodexStartupClient(error, spawnedBy, signal) {
619
+ if (signal.aborted || isCodexAppServerStartupError(error) || isCodexAppServerRequestTimeoutError(error)) return true;
620
+ return !isCodexAppServerStartSelectionChangedError(error) && !isCodexAppServerOverloadError(error) && !(error instanceof AgentHarnessPreflightError && error.scope === void 0) && (isCodexAppServerBrokenPipeError(error) || !spawnedBy);
621
+ }
803
622
  //#endregion
804
- export { shouldRecordNativeToolTranscript as A, readNonEmptyStringArray as B, isSideEffectingNativeToolItem as C, itemTitle as D, itemStatus as E, readCodexProviderRefusal as F, readNullableString as H, readHookOutputEntries as I, readItem as L, extractRawAssistantText as M, normalizeOptionalString$1 as N, matchesCodexSnapshotTurn as O, readCodexErrorNotificationMessage as P, readItemString as R, isNonSuccessItemStatus as S, itemName as T, splitPlanText as U, readNonNegativeInteger as V, readCodexNotificationTurnId as _, closeCodexStartupClientBestEffort as a, auditNativeToolUnfinishedStatus as b, isCodexNoActiveTurnInterruptError as c, unsubscribeCodexThreadBestEffort as d, CODEX_APP_SERVER_NATIVE_TURN_WAIT_TIMEOUT_MS as f, readCodexNotificationThreadId as g, isCodexNotificationForTurn as h, assertCodexThreadResumeSubscription as i, shouldSynthesizeToolProgressForItem as j, shouldClearTerminalPresentationForNativeItem as k, retireUnsafeCodexTurnClientBestEffort as l, CodexProjectionDiagnostics as m, CODEX_APP_SERVER_UNSUBSCRIBE_TIMEOUT_MS as n, interruptCodexTurnAndWaitBestEffort as o, getCodexAppServerTurnRouter as p, CodexAppServerUnsafeSubscriptionError as r, isCodexAppServerUnsafeSubscriptionError as s, CODEX_APP_SERVER_INTERRUPT_TIMEOUT_MS as t, terminateCodexBackgroundTerminals as u, auditNativeToolName as v, itemKind as w, isMutatingNativeToolItem as x, auditNativeToolTerminalStatus as y, readNonEmptyString as z };
623
+ export { CodexProjectionDiagnostics as _, closeCodexStartupClientBestEffort as a, readCodexNotificationTurnId as b, isCodexNoActiveTurnInterruptError as c, terminateCodexBackgroundTerminals as d, unsubscribeCodexThreadBestEffort as f, waitForPromiseOrAbort as g, hasCodexAppServerSiblingRouteWork as h, assertCodexThreadResumeSubscription as i, retireUnsafeCodexTurnClientBestEffort as l, getCodexAppServerTurnRouter as m, CODEX_APP_SERVER_UNSUBSCRIBE_TIMEOUT_MS as n, interruptCodexTurnAndWaitBestEffort as o, CODEX_APP_SERVER_NATIVE_TURN_WAIT_TIMEOUT_MS as p, CodexAppServerUnsafeSubscriptionError as r, isCodexAppServerUnsafeSubscriptionError as s, CODEX_APP_SERVER_INTERRUPT_TIMEOUT_MS as t, shouldRetireCodexStartupClient as u, isCodexNotificationForTurn as v, readCodexNotificationThreadId as y };
@@ -1,6 +1,6 @@
1
- import { a as flattenCodexDynamicToolFunctions, o as isJsonObject } from "./protocol-CAAcVIKF.js";
2
- import { t as readCodexMirroredSessionHistoryMessages } from "./session-history-Cz-tOOYj.js";
3
- import { Z as areCodexDynamicToolFingerprintsCompatible, at as isMessageOnlyCodexSourceReply, dt as isContextEngineBindingCompatible } from "./thread-lifecycle-D1pzRwHB.js";
1
+ import { m as isJsonObject, p as flattenCodexDynamicToolFunctions } from "./config-security-BRQ2mgW9.mjs";
2
+ import { t as readCodexMirroredSessionHistoryMessages } from "./session-history-C--SrLI8.mjs";
3
+ import { $ as areCodexDynamicToolFingerprintsCompatible, pt as isContextEngineBindingCompatible, st as isMessageOnlyCodexSourceReply } from "./thread-lifecycle-Cik28qWn.mjs";
4
4
  import { readNonBlankString } from "openclaw/plugin-sdk/string-coerce-runtime";
5
5
  import { createHash } from "node:crypto";
6
6
  import path from "node:path";
@@ -32,8 +32,8 @@ const CODEX_BOOTSTRAP_CONTEXT_ORDER = /* @__PURE__ */ new Map([
32
32
  ]);
33
33
  /** Reads mirrored Codex session history for harness hooks. */
34
34
  async function readMirroredSessionHistoryMessages(params) {
35
- const { admission, signal, ...target } = params;
36
- const messages = await readCodexMirroredSessionHistoryMessages(target, admission, "model-context", signal);
35
+ const { admission, signal, contextTokenBudget, ...target } = params;
36
+ const messages = await readCodexMirroredSessionHistoryMessages(target, admission, "model-context", signal, contextTokenBudget);
37
37
  if (!messages) embeddedAgentLog.warn("failed to read mirrored session history for codex harness hooks", { sessionFile: params.sessionFile });
38
38
  return messages;
39
39
  }
@@ -442,7 +442,7 @@ function renderCodexWorkspaceBootstrapPromptContext(contextFiles) {
442
442
  const files = contextFiles;
443
443
  if (files.length === 0) return;
444
444
  const lines = [
445
- "OpenClaw loaded these user-editable workspace files for the current turn. Codex loads project-local AGENTS.md natively. When execution uses another folder, OpenClaw supplies the agent workspace AGENTS.md as thread-level developer instructions. SOUL.md, IDENTITY.md, and USER.md remain turn-scoped collaboration instructions. Those files are not repeated here.",
445
+ "OpenClaw loaded these user-editable workspace files for the current turn. Codex loads project-local AGENTS.md natively. When execution uses another folder, OpenClaw supplies the agent workspace AGENTS.md as thread-level developer instructions. SOUL.md, IDENTITY.md, and USER.md are prepared separately from user input and are not repeated here.",
446
446
  "",
447
447
  "# Project Context",
448
448
  "",
@@ -0,0 +1,5 @@
1
+ import { agentHarnessAttemptTerminal } from "openclaw/plugin-sdk/agent-harness-runtime";
2
+ //#region extensions/codex/src/app-server/attempt-terminal.ts
3
+ const attemptTerminal = agentHarnessAttemptTerminal;
4
+ //#endregion
5
+ export { attemptTerminal as t };
@@ -1,4 +1,4 @@
1
- import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
1
+ import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.mjs";
2
2
  import { resolveApiKeyForProfile } from "openclaw/plugin-sdk/agent-runtime";
3
3
  import { fingerprintResolvedAuthProfileCredential } from "openclaw/plugin-sdk/agent-harness-runtime";
4
4
  import { resolveOpenAICodexAuthIdentity } from "openclaw/plugin-sdk/provider-auth";
@@ -74,4 +74,4 @@ async function fingerprintCodexAppServerAuthBinding(params) {
74
74
  return (await prepareCodexAppServerAuthBinding(params))?.fingerprint;
75
75
  }
76
76
  //#endregion
77
- export { prepareCodexAppServerAuthBinding as n, auth_binding_exports as t };
77
+ export { fingerprintCodexAppServerAuthBinding as n, prepareCodexAppServerAuthBinding as r, auth_binding_exports as t };
@@ -1,6 +1,6 @@
1
- import { n as defineCodexBuildState } from "./build-state-6RL6qohz.js";
2
- import { s as resolveMacOSDesktopCodexAppPathCandidates } from "./managed-binary-DrjjRRUD.js";
3
- import { n as resolveCodexAppServerSpawnEnv } from "./transport-stdio-BGjHoYLr.js";
1
+ import { n as defineCodexBuildState } from "./build-state-Xx9ybZqa.mjs";
2
+ import { c as resolveMacOSDesktopCodexAppPathCandidates } from "./managed-binary-DP6Rib3P.mjs";
3
+ import { n as resolveCodexAppServerSpawnEnv } from "./transport-stdio-Cmx94Oiy.mjs";
4
4
  import { createHash } from "node:crypto";
5
5
  import fs, { constants, existsSync, watch } from "node:fs";
6
6
  import path from "node:path";
@@ -1,4 +1,4 @@
1
- import { n as createCodexAuthProfileSelection } from "./auth-profile-selection-DFu9e167.js";
1
+ import { n as createCodexAuthProfileSelection } from "./auth-profile-selection-DFu9e167.mjs";
2
2
  import { embeddedAgentLog, resolveDefaultAgentDir } from "openclaw/plugin-sdk/agent-harness-registration";
3
3
  import { resolveProviderIdForAuth } from "openclaw/plugin-sdk/provider-auth-aliases";
4
4
  import { ensureAuthProfileStore, resolveAuthProfileOrder } from "openclaw/plugin-sdk/provider-auth";
@@ -0,0 +1,50 @@
1
+ import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.mjs";
2
+ import { AgentHarnessPreflightError } from "openclaw/plugin-sdk/agent-harness-registration";
3
+ import { createPluginRuntimeStore } from "openclaw/plugin-sdk/runtime-store";
4
+ //#region extensions/codex/src/app-server/binding-connection.ts
5
+ var binding_connection_exports = /* @__PURE__ */ __exportAll({
6
+ assertCodexSessionRuntimeOwnership: () => assertCodexSessionRuntimeOwnership,
7
+ codexBindingConnectionSelection: () => codexBindingConnectionSelection,
8
+ requireCodexSupervisionModelSelection: () => requireCodexSupervisionModelSelection,
9
+ resolveCodexBindingAppServerConnection: () => resolveCodexBindingAppServerConnection,
10
+ setCodexCatalogConnectionHomeResolver: () => setCodexCatalogConnectionHomeResolver
11
+ });
12
+ const catalogHomes = createPluginRuntimeStore({
13
+ key: "codex:catalog-home-resolver",
14
+ errorMessage: "Codex catalog homes are unavailable"
15
+ });
16
+ const setCodexCatalogConnectionHomeResolver = catalogHomes.setRuntime;
17
+ /** Connection selection excludes independently updated thread bookkeeping. */
18
+ function codexBindingConnectionSelection(binding) {
19
+ return binding ? [
20
+ binding.threadId,
21
+ binding.cwd.trim(),
22
+ binding.connectionScope,
23
+ binding.pendingSupervisionBranch?.connectionFingerprint ?? binding.appServerRuntimeFingerprint,
24
+ binding.authProfileId,
25
+ binding.preserveNativeModel === true
26
+ ] : void 0;
27
+ }
28
+ /** Prevents a prepared native session from becoming a fresh thread after its binding changes. */
29
+ function assertCodexSessionRuntimeOwnership(binding, expected) {
30
+ if (!expected) return;
31
+ const auth = binding?.connectionScope === "supervision" ? "native" : "host";
32
+ const hostModelChanged = expected.auth === "host" && (!expected.modelRef || binding?.model !== expected.modelRef.model || binding?.modelProvider !== expected.modelRef.provider);
33
+ if (binding?.preserveNativeModel !== true || auth !== expected.auth || hostModelChanged) throw new AgentHarnessPreflightError("Codex native session ownership is missing or changed. Reattach the original native session or create a new chat with a concrete model; no replacement thread was started.");
34
+ }
35
+ /** Requires the native model pair after a supervised pending branch has materialized. */
36
+ function requireCodexSupervisionModelSelection(binding) {
37
+ const model = binding.model?.trim();
38
+ const modelProvider = binding.modelProvider?.trim();
39
+ if (binding.connectionScope !== "supervision" || !model || !modelProvider) throw new Error("Codex supervised binding is missing its native model and provider; refusing request selection");
40
+ return {
41
+ model,
42
+ modelProvider
43
+ };
44
+ }
45
+ /** Registration publishes the resolver; connection policy loads only for an actual request. */
46
+ async function resolveCodexBindingAppServerConnection(params) {
47
+ return (await import("./binding-connection.runtime-CnRMC0ta.mjs")).resolveCodexBindingAppServerConnection(params, catalogHomes.tryGetRuntime());
48
+ }
49
+ //#endregion
50
+ export { setCodexCatalogConnectionHomeResolver as a, resolveCodexBindingAppServerConnection as i, binding_connection_exports as n, requireCodexSupervisionModelSelection as r, assertCodexSessionRuntimeOwnership as t };