@openclaw/codex 2026.10.1-beta.2 → 2026.10.5-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (161) hide show
  1. package/dist/.setup/{account-usage-runtime-DGqFpAud.mjs → account-usage-runtime-QBZsvZS8.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-CXTudl9p.mjs → apply-CBMV8LN0.mjs} +40 -51
  4. package/dist/.setup/{attempt-client-cleanup-BH0hW2xU.mjs → attempt-client-cleanup-t-kd_1ys.mjs} +6 -6
  5. package/dist/.setup/attempt-terminal-jO5IMj9K.mjs +2 -0
  6. package/dist/.setup/{attempt-workspace-context-BY0jprWJ.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-CGm0UJOr.mjs → auth-cache-key-DyfUvsSa.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-pGsfXcmH.mjs → bounded-turn-CyQVQwGe.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-CqQnsg7T.mjs → build-state-CzLMy1S9.mjs} +1 -1
  14. package/dist/.setup/{capabilities-kQntafj_.mjs → capabilities-DbOzOglY.mjs} +1 -1
  15. package/dist/.setup/{client-catalog-response-Bqp7WG51.mjs → client-catalog-response-DsbEAtpd.mjs} +25 -32
  16. package/dist/.setup/{client-C8lgBOoO.mjs → client-y7nO6X9c.mjs} +198 -247
  17. package/dist/.setup/{command-dispatch-DhBbFIQ5.mjs → command-dispatch-uA9lz2Kf.mjs} +3 -4
  18. package/dist/.setup/{command-formatters-DV3DHhdr.mjs → command-formatters-xW9KpoSZ.mjs} +16 -26
  19. package/dist/.setup/{command-handlers-ztOOzm6O.mjs → command-handlers-VBaJnpZo.mjs} +270 -360
  20. package/dist/.setup/{command-rpc-CuC5fPom.mjs → command-rpc-C9VxOLuG.mjs} +19 -18
  21. package/dist/.setup/{compact-tUb9AYfH.mjs → compact-CD8xJxXS.mjs} +41 -61
  22. package/dist/.setup/{computer-use-BBN9y326.mjs → computer-use-CiToXF5C.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-B3MNMVzb.mjs → conversation-binding-CTSLDM9S.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-CYsMlCuE.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-C8xGEXmR.mjs → dynamic-tool-build-D731PCdv.mjs} +57 -69
  38. package/dist/.setup/{dynamic-tools-DyERJnR6.mjs → dynamic-tools-D0pYbxHH.mjs} +689 -710
  39. package/dist/.setup/{effective-mcp-catalog-C26Mio5l.mjs → effective-mcp-catalog-1hWFKghy.mjs} +11 -20
  40. package/dist/.setup/{elicitation-input-r9axtppm.mjs → elicitation-input-DXG_qaXr.mjs} +14 -20
  41. package/dist/.setup/{ephemeral-turn-D8VcDTNo.mjs → ephemeral-turn-Cphy5Qr_.mjs} +3 -3
  42. package/dist/.setup/{event-projector-assistant-message-BN7CNUB5.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-C0jrcplS.mjs → isolated-completion-Bhqd2yBq.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-BxN0_CYe.mjs → mcp-app-session-preparation-DqSvxFqc.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-DZyNeDKG.mjs → model-catalog-B227ST3D.mjs} +6 -6
  56. package/dist/.setup/{models-DSseKSMg.mjs → models-DdRyi93L.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-BUWIOrSr.mjs +561 -0
  60. package/dist/.setup/{native-mcp-app-CqcPVmhH.mjs → native-mcp-app-CjxJQ4F7.mjs} +6 -6
  61. package/dist/.setup/native-skill-isolation-UMVoNjZz.mjs +391 -0
  62. package/dist/.setup/{native-subagent-monitor-BUYOUp9X.mjs → native-subagent-monitor-iHc8oLg5.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-BJ37d2Og.mjs → plan-C_F3aio0.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-CuahdPLC.mjs → plugin-approval-roundtrip-BSV-51ig.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-BnwHVD_z.mjs → provider-BJ4xhaGX.mjs} +4 -4
  76. package/dist/.setup/{provider-capabilities-D68Whix6.mjs → provider-capabilities-CjRaV3bx.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-jSbhc1sg.mjs → request-Y8dmbqZ3.mjs} +28 -48
  80. package/dist/.setup/{rpc-error-hmWM21RB.mjs → rpc-error-C98SHchT.mjs} +3 -6
  81. package/dist/.setup/{run-attempt-BLDZeYLD.mjs → run-attempt-Dx7a4Mfm.mjs} +927 -849
  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-Bdjw9HEn.mjs → session-catalog-events-DzFlXNUe.mjs} +6 -5
  94. package/dist/.setup/{session-catalog-index-DufISKJ6.mjs → session-catalog-index-DozvkUPd.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-D6IiLtMb.mjs → session-catalog-native-projection-rCKnZud1.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-8aHNwzWD.mjs → session-catalog-projection-DDVmALHj.mjs} +8 -22
  104. package/dist/.setup/session-catalog-source-CygTGmrb.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-Czbchv_O.mjs → session-retirement-IoS3zr17.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-DjZsIwbZ.mjs → settled-turn-finalizer-X-Fylp-u.mjs} +12 -11
  115. package/dist/.setup/{shared-client-qhyYWbew.mjs → shared-client-ByIwuAC-.mjs} +172 -229
  116. package/dist/.setup/{side-question-D3NJlgbl.mjs → side-question-BDUdozFy.mjs} +116 -137
  117. package/dist/.setup/{source-BYu0T780.mjs → source-Bxbqf3S1.mjs} +37 -56
  118. package/dist/.setup/thread-archive-guard-LKdwQKyr.mjs +56 -0
  119. package/dist/.setup/{thread-lifecycle-Cbz_7ySv.mjs → thread-lifecycle-run-CfP4PnEf.mjs} +348 -484
  120. package/dist/.setup/thread-model-selection-DcVebr8N.mjs +61 -0
  121. package/dist/.setup/{thread-ownership-DwuSrt3s.mjs → thread-ownership-Be53aiaG.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-DoNxbhqt.mjs → thread-policy-CHgY-KNl.mjs} +4 -4
  124. package/dist/.setup/thread-requests-BgzJwJtS.mjs +745 -0
  125. package/dist/.setup/{thread-resume-BT6NHMkM.mjs → thread-resume-B2EmMcgE.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-sS69wYnI.mjs → turn-router-DKDAziUW.mjs} +30 -31
  133. package/dist/.setup/upstream-prompt-provenance-Ccd9MFRJ.mjs +44 -0
  134. package/dist/.setup/{upstream-session-fork-ChSld66u.mjs → upstream-session-fork-Djp_yssT.mjs} +50 -43
  135. package/dist/.setup/{usage-D8e8Xiqf.mjs → usage-DQA-peQC.mjs} +4 -4
  136. package/dist/.setup/{usage-limit-error-GbT-5NcW.mjs → usage-limit-error-2t3KBqiX.mjs} +12 -21
  137. package/dist/.setup/web-search-item-CvokaZOo.mjs +20 -0
  138. package/dist/.setup/{web-search-provider.runtime-dL2GD1Kl.mjs → web-search-provider.runtime-BsuCMNix.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-B8LGaZNW.mjs +0 -124
  157. package/dist/.setup/service-tier-normalization-Cei89SW6.mjs +0 -15
  158. package/dist/.setup/shell-dynamic-tools-D3Brj3g9.mjs +0 -85
  159. package/dist/.setup/thread-archive-guard-C9frICzX.mjs +0 -60
  160. package/dist/.setup/thread-requests-CL1e8Wmx.mjs +0 -2111
  161. package/dist/.setup/upstream-prompt-provenance-fXkKbPVC.mjs +0 -37
@@ -1,53 +1,54 @@
1
1
  import { i as isJsonObject } from "./protocol-CANUwXJ3.mjs";
2
- import { m as sessionBindingIdentity, n as assertCodexBindingMayBeReplaced, r as bindingStoreKey } from "./session-binding-record-BZB8RgcF.mjs";
3
- import { m as isCodexFastServiceTier } from "./config-parsing-BQq-CHTF.mjs";
4
- import { c as resolveCodexAppServerPreparedApiKeyCacheKey, s as resolveCodexAppServerFallbackApiKeyCacheKey } from "./auth-cache-key-CGm0UJOr.mjs";
5
- import { n as withCodexConversationThreadActivity } from "./thread-ownership-queue-Dp24d7-F.mjs";
2
+ import { m as sessionBindingIdentity, n as assertCodexBindingMayBeReplaced, r as bindingStoreKey } from "./session-binding-record-DU_0biMD.mjs";
3
+ import { r as isCodexFastServiceTier } from "./config-utils-DN_YT7dE.mjs";
4
+ import { c as resolveCodexAppServerPreparedApiKeyCacheKey, s as resolveCodexAppServerFallbackApiKeyCacheKey } from "./auth-cache-key-DyfUvsSa.mjs";
5
+ import { n as withCodexConversationThreadActivity } from "./thread-ownership-queue-CeyYScUC.mjs";
6
6
  import { a as canMutateCodexHost, i as assertCodexHostOwnerCurrent, n as CODEX_HOST_INSPECTION_AUTH_ERROR, o as hasCodexAdminScope, r as CODEX_NATIVE_EXECUTION_AUTH_ERROR, t as CODEX_FULL_PERMISSIONS_AUTH_ERROR } from "./command-authorization-AikPDtcc.mjs";
7
- import { l as formatRelativeDuration, s as summarizeCodexAccountUsage } from "./rate-limits-CMPy24F5.mjs";
8
- import { a as formatCodexAccountLine, c as formatCodexTextForDisplay, d as formatModels, f as formatSkills, i as formatAccount, l as formatComputerUseStatus, m as isLikelyEmailAddress, n as buildHelp, o as formatCodexDisplayText, p as formatThreads, r as escapeCodexChatText, s as formatCodexStatus, t as CODEX_RESUME_SAFE_THREAD_ID_PATTERN, u as formatList } from "./command-formatters-DV3DHhdr.mjs";
9
- import { i as readCodexConversationBindingData, n as createCodexCliNodeConversationBindingData, o as resolveCodexDefaultWorkspaceDir, r as createCodexConversationBindingData } from "./conversation-binding-data-DJ4ix-W5.mjs";
10
- import { r as CodexAppServerRpcError } from "./rpc-error-hmWM21RB.mjs";
11
- import { t as CODEX_CONTROL_METHODS } from "./capabilities-kQntafj_.mjs";
12
- import { n as filterCodexMarketplacePlugins, r as parseCodexPluginMarketplaceId, t as discoverCodexMarketplacePlugins } from "./plugin-marketplace-discovery-SQPhSuic.mjs";
13
- import { o as formatCodexCliSessions } from "./node-cli-sessions-B5oNDkUS.mjs";
14
- import { a as defaultCodexAppInventoryCache, r as buildCodexPluginAppCacheKey } from "./plugin-app-cache-key-BW8rd98k.mjs";
15
- import { i as resolveCodexBindingAppServerConnection } from "./binding-connection-C-08ez1w.mjs";
16
- import { a as withCodexAppServerJsonClient } from "./request-jSbhc1sg.mjs";
17
- import { a as pluginReadParams, l as CODEX_PLUGINS_MARKETPLACE_NAME, n as isOpenAiCuratedMarketplaceName, t as findCodexMarketplacePluginSummary } from "./plugin-inventory-Bf0_piTw.mjs";
18
- import "./config-0Gxk3_eq.mjs";
19
- import { n as resolveCodexAppServerRuntimeOptions } from "./config-runtime-cUYrqu_a.mjs";
7
+ import { l as formatRelativeDuration, s as summarizeCodexAccountUsage } from "./rate-limits-CI8pTPqL.mjs";
8
+ import { a as formatCodexAccountLine, c as formatCodexTextForDisplay, d as formatModels, f as formatSkills, i as formatAccount, l as formatComputerUseStatus, m as isLikelyEmailAddress, n as buildHelp, o as formatCodexDisplayText, p as formatThreads, r as escapeCodexChatText, s as formatCodexStatus, t as CODEX_RESUME_SAFE_THREAD_ID_PATTERN, u as formatList } from "./command-formatters-xW9KpoSZ.mjs";
9
+ import { i as readCodexConversationBindingData, n as createCodexCliNodeConversationBindingData, o as resolveCodexDefaultWorkspaceDir, r as createCodexConversationBindingData } from "./conversation-binding-data-UgLuTSQT.mjs";
10
+ import { r as CodexAppServerRpcError } from "./rpc-error-C98SHchT.mjs";
11
+ import { t as CODEX_CONTROL_METHODS } from "./capabilities-DbOzOglY.mjs";
12
+ import { n as filterCodexMarketplacePlugins, r as parseCodexPluginMarketplaceId, t as discoverCodexMarketplacePlugins } from "./plugin-marketplace-discovery-BblHM3DU.mjs";
13
+ import { o as formatCodexCliSessions } from "./node-cli-sessions-CzKg2nGq.mjs";
14
+ import { a as defaultCodexAppInventoryCache, r as buildCodexPluginAppCacheKey } from "./plugin-app-cache-key-Bg9DbDI6.mjs";
15
+ import { i as resolveCodexBindingAppServerConnection } from "./binding-connection-B7HAAZSI.mjs";
16
+ import { a as withCodexAppServerJsonClient } from "./request-Y8dmbqZ3.mjs";
17
+ import { n as findCodexMarketplacePluginSummary, o as pluginReadParams, r as isOpenAiCuratedMarketplaceName, u as CODEX_PLUGINS_MARKETPLACE_NAME } from "./plugin-inventory-CYgdo14P.mjs";
18
+ import "./config-C1YVVLEA.mjs";
19
+ import { n as resolveCodexAppServerRuntimeOptions } from "./config-runtime-DWzK-k0n.mjs";
20
20
  import { a as resolveCodexAppServerAuthProfileStore, i as resolveCodexAppServerAuthProfileIdForAgent, n as normalizeCodexAppServerBindingModelProvider } from "./auth-profile-CgHQ8Vot.mjs";
21
- import { F as consumeCodexAppServerLiveThread, R as hasCodexAppServerLiveThread, c as getLeasedSharedCodexAppServerClient, et as resolveCodexAppServerAuthAccountCacheKey, h as releaseLeasedSharedCodexAppServerClient } from "./shared-client-qhyYWbew.mjs";
22
- import { a as isCodexAppServerIndeterminateRequestCancellationError, h as assertCodexThreadResumeResponse, p as assertCodexThreadAcceptsDirectInput, s as isCodexAppServerPrewriteRequestCancellationError } from "./client-C8lgBOoO.mjs";
23
- import { o as closeCodexStartupClientBestEffort } from "./attempt-client-cleanup-BH0hW2xU.mjs";
24
- import { n as fingerprintCodexAppServerAuthBinding } from "./auth-binding-BoMwpuPN.mjs";
25
- import { n as listAllCodexAppServerModels } from "./models-DSseKSMg.mjs";
26
- import { n as refreshCodexAppRuntimeState, r as refreshCodexPluginRuntimeState } from "./plugin-activation-BcyBv8PG.mjs";
27
- import { o as createCodexSessionGenerationSupersededError, r as resolveCodexSessionBinding } from "./session-binding-Ce7BqiPN.mjs";
28
- import { i as assertCodexSupervisionThreadLineage } from "./thread-policy-DoNxbhqt.mjs";
29
- import { a as rollbackCodexAppServerBindingSubscription, c as withExclusiveCodexAppServerThread, i as retireCodexConversationThreadBinding, n as releaseCodexAppServerBindingSubscription, r as retainCodexAppServerBindingSubscription, t as isSameCodexAppServerThreadOwner } from "./thread-ownership-DwuSrt3s.mjs";
30
- import { n as resolveCodexNativeSandboxBlock, t as resolveCodexNativeExecutionBlock } from "./sandbox-guard-WqE8yPge.mjs";
31
- import { t as defaultCodexPluginMetadataCache } from "./plugin-metadata-cache-DWnB7VMj.mjs";
32
- import { n as installCodexComputerUse, r as readCodexComputerUseStatus } from "./computer-use-BBN9y326.mjs";
33
- import { a as requestOptions, i as readCodexStatusProbes, o as safeCodexControlRequest, r as prepareCodexControlSessionAuth, t as codexControlRequest } from "./command-rpc-CuC5fPom.mjs";
34
- import { a as readCodexConversationActiveTurn, c as setCodexConversationModel, d as stopCodexConversationTurn, i as parseCodexPermissionsModeArg, l as setCodexConversationPermissions, n as formatPermissionsMode, r as parseCodexFastModeArg, s as setCodexConversationFastMode, u as steerCodexConversationTurn } from "./conversation-control-CYsMlCuE.mjs";
21
+ import { F as consumeCodexAppServerLiveThread, R as hasCodexAppServerLiveThread, c as getLeasedSharedCodexAppServerClient, et as resolveCodexAppServerAuthAccountCacheKey, h as releaseLeasedSharedCodexAppServerClient } from "./shared-client-ByIwuAC-.mjs";
22
+ import { a as isCodexAppServerIndeterminateRequestCancellationError, h as assertCodexThreadResumeResponse, p as assertCodexThreadAcceptsDirectInput, s as isCodexAppServerPrewriteRequestCancellationError } from "./client-y7nO6X9c.mjs";
23
+ import { o as closeCodexStartupClientBestEffort } from "./attempt-client-cleanup-t-kd_1ys.mjs";
24
+ import { n as fingerprintCodexAppServerAuthBinding } from "./auth-binding-BaxlhaNx.mjs";
25
+ import { n as listAllCodexAppServerModels } from "./models-DdRyi93L.mjs";
26
+ import { n as refreshCodexAppRuntimeState, r as refreshCodexPluginRuntimeState } from "./plugin-activation-D7WkJMvU.mjs";
27
+ import { i as resolveCodexSessionBinding, n as createCodexSessionGenerationSupersededError } from "./session-binding-JEHNMPsr.mjs";
28
+ import { a as rollbackCodexAppServerBindingSubscription, c as withExclusiveCodexAppServerThread, i as retireCodexConversationThreadBinding, n as releaseCodexAppServerBindingSubscription, r as retainCodexAppServerBindingSubscription, t as isSameCodexAppServerThreadOwner } from "./thread-ownership-Be53aiaG.mjs";
29
+ import { n as resolveCodexNativeSandboxBlock, t as resolveCodexNativeExecutionBlock } from "./sandbox-guard-DIImwCy1.mjs";
30
+ import { i as assertCodexSupervisionThreadLineage } from "./thread-policy-CHgY-KNl.mjs";
31
+ import { t as defaultCodexPluginMetadataCache } from "./plugin-metadata-cache-Bi8TAPwX.mjs";
32
+ import { n as installCodexComputerUse, r as readCodexComputerUseStatus } from "./computer-use-CiToXF5C.mjs";
33
+ import { a as requestOptions, i as readCodexStatusProbes, o as safeCodexControlRequest, r as prepareCodexControlSessionAuth, t as codexControlRequest } from "./command-rpc-C9VxOLuG.mjs";
34
+ import { a as readCodexConversationActiveTurn, c as setCodexConversationModel, d as stopCodexConversationTurn, i as parseCodexPermissionsModeArg, l as setCodexConversationPermissions, n as formatPermissionsMode, r as parseCodexFastModeArg, s as setCodexConversationFastMode, u as steerCodexConversationTurn } from "./conversation-control-GXM3unE4.mjs";
35
35
  import { normalizeOptionalString, normalizeUniqueStringEntries } from "openclaw/plugin-sdk/string-coerce-runtime";
36
36
  import crypto from "node:crypto";
37
37
  import { isDeepStrictEqual } from "node:util";
38
38
  import { resolveSessionAgentIdsStrict } from "openclaw/plugin-sdk/agent-scope-runtime";
39
39
  import { parseStrictPositiveInteger } from "openclaw/plugin-sdk/number-runtime";
40
+ import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
40
41
  import { coerceErrorMessage } from "openclaw/plugin-sdk/error-runtime";
41
42
  import { isIncognitoSessionKey } from "openclaw/plugin-sdk/session-key-runtime";
42
43
  import { expectDefined } from "openclaw/plugin-sdk/expect-runtime";
43
44
  import { parseAgentSessionKey } from "openclaw/plugin-sdk/routing";
44
- import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
45
45
  import { ensureAuthProfileStore, resolveAgentDir as resolveAgentDir$1, resolveAgentWorkspaceDir, resolveAuthProfileEligibility, resolveProfileUnusableUntilForDisplay } from "openclaw/plugin-sdk/agent-runtime";
46
46
  import { getSessionEntry, resolveStorePath } from "openclaw/plugin-sdk/session-store-runtime";
47
47
  import { findNormalizedProviderValue, resolveAuthProfileOrder } from "openclaw/plugin-sdk/provider-auth";
48
48
  import { pruneMapToMaxSize } from "openclaw/plugin-sdk/collection-runtime";
49
49
  import { renderMessagePresentationFallbackText } from "openclaw/plugin-sdk/interactive-runtime";
50
50
  import { MODEL_SELECTION_LOCKED_MESSAGE, isModelSelectionLocked, resolvePersistedSessionRuntimeId } from "openclaw/plugin-sdk/model-session-runtime";
51
+ import { composeSessionEntryCommitGuards } from "openclaw/plugin-sdk/session-binding-runtime";
51
52
  //#region extensions/codex/src/command-account.ts
52
53
  const OPENAI_PROVIDER_ID = "openai";
53
54
  async function readCodexAccountAuthOverview(params) {
@@ -68,22 +69,37 @@ async function readCodexAccountAuthOverview(params) {
68
69
  const now = Date.now();
69
70
  const activeIsSubscription = activeProfileId !== void 0 && isChatGptSubscriptionProfile(store.profiles[activeProfileId]);
70
71
  const subscriptionProfileId = activeIsSubscription ? activeProfileId : activeProfileId ? order.find((profileId) => isChatGptSubscriptionProfile(store.profiles[profileId])) : void 0;
71
- const activeUsage = activeIsSubscription && params.limits.ok ? summarizeCodexAccountUsage(params.limits.value, now) : void 0;
72
- const subscriptionUsage = subscriptionProfileId && !activeIsSubscription ? await readSubscriptionUsage({
73
- ...params,
74
- agentDir,
75
- config,
76
- subscriptionProfileId,
77
- now
78
- }) : activeUsage;
79
- const rows = order.map((profileId) => buildProfileRow({
80
- store,
81
- config,
82
- profileId,
83
- activeProfileId,
84
- now,
85
- usage: profileId === subscriptionProfileId ? subscriptionUsage : void 0
86
- }));
72
+ let subscriptionUsage = activeIsSubscription && params.limits.ok ? summarizeCodexAccountUsage(params.limits.value, now) : void 0;
73
+ if (subscriptionProfileId && !activeIsSubscription) {
74
+ const limits = await params.safeCodexControlRequest(params.pluginConfig, CODEX_CONTROL_METHODS.rateLimits, void 0, {
75
+ config,
76
+ agentDir,
77
+ authProfileId: subscriptionProfileId,
78
+ isolated: true
79
+ });
80
+ subscriptionUsage = limits.ok ? summarizeCodexAccountUsage(limits.value, now) : void 0;
81
+ }
82
+ const rows = order.map((profileId) => {
83
+ const credential = store.profiles[profileId];
84
+ const label = formatProfileLabel(profileId, credential);
85
+ const kind = formatProfileKind(credential);
86
+ const active = profileId === activeProfileId;
87
+ const row = {
88
+ profileId,
89
+ label,
90
+ kind,
91
+ status: active ? "active now" : (profileId === subscriptionProfileId ? subscriptionUsage : void 0)?.blocked ? "rate-limited" : describeInactiveProfileStatus({
92
+ store,
93
+ config,
94
+ profileId,
95
+ credential,
96
+ now
97
+ }),
98
+ active
99
+ };
100
+ if (credential?.type === "api_key" && active) row.billingNote = "billed per token";
101
+ return row;
102
+ });
87
103
  const activeRow = rows.find((row) => row.active);
88
104
  if (!activeRow) return {
89
105
  orderTitle: "Auth order",
@@ -109,37 +125,6 @@ function resolveDisplayAuthOrder(params) {
109
125
  provider: OPENAI_PROVIDER_ID
110
126
  });
111
127
  }
112
- async function readSubscriptionUsage(params) {
113
- const limits = await params.safeCodexControlRequest(params.pluginConfig, CODEX_CONTROL_METHODS.rateLimits, void 0, {
114
- config: params.config,
115
- agentDir: params.agentDir,
116
- authProfileId: params.subscriptionProfileId,
117
- isolated: true
118
- });
119
- if (!limits.ok) return;
120
- return summarizeCodexAccountUsage(limits.value, params.now);
121
- }
122
- function buildProfileRow(params) {
123
- const credential = params.store.profiles[params.profileId];
124
- const label = formatProfileLabel(params.profileId, credential);
125
- const kind = formatProfileKind(credential);
126
- const active = params.profileId === params.activeProfileId;
127
- const status = active ? "active now" : params.usage?.blocked ? "rate-limited" : describeInactiveProfileStatus({
128
- store: params.store,
129
- config: params.config,
130
- profileId: params.profileId,
131
- credential,
132
- now: params.now
133
- });
134
- return {
135
- profileId: params.profileId,
136
- label,
137
- kind,
138
- status,
139
- active,
140
- ...credential?.type === "api_key" && active ? { billingNote: "billed per token" } : {}
141
- };
142
- }
143
128
  function describeInactiveProfileStatus(params) {
144
129
  const stats = params.store.usageStats?.[params.profileId];
145
130
  const blockedUntil = stats?.blockedUntil;
@@ -217,13 +202,16 @@ function describeFailureStatus(reason, credential) {
217
202
  if (reason === "rate_limit") return "rate-limited";
218
203
  return "temporarily unavailable";
219
204
  }
205
+ const ELIGIBILITY_STATUS = /* @__PURE__ */ new Map([
206
+ ["expired", "sign-in expired"],
207
+ ["invalid_expires", "sign-in expired"],
208
+ ["unresolved_ref", "credential unavailable"],
209
+ ["provider_mismatch", "wrong provider"],
210
+ ["mode_mismatch", "wrong credential type"]
211
+ ]);
220
212
  function describeEligibilityStatus(reason, credential) {
221
213
  if (reason === "profile_missing" || reason === "missing_credential") return credential?.type === "api_key" ? "not configured" : "sign-in required";
222
- if (reason === "expired" || reason === "invalid_expires") return "sign-in expired";
223
- if (reason === "unresolved_ref") return "credential unavailable";
224
- if (reason === "provider_mismatch") return "wrong provider";
225
- if (reason === "mode_mismatch") return "wrong credential type";
226
- return "unavailable";
214
+ return ELIGIBILITY_STATUS.get(reason) ?? "unavailable";
227
215
  }
228
216
  function isActiveUntil(value, now) {
229
217
  return typeof value === "number" && Number.isFinite(value) && value > now;
@@ -374,6 +362,33 @@ function describeConfiguredPluginIdentityConflict(target, status) {
374
362
  return status === "ambiguous" ? `Multiple configured Codex plugins match '${identity}'; resolve duplicate plugin policies first.` : `Configured Codex plugin key '${identity}' points to a different plugin identity; resolve the configuration conflict first.`;
375
363
  }
376
364
  //#endregion
365
+ //#region extensions/codex/src/command-presentation.ts
366
+ function buildCodexPresentationReply(presentation) {
367
+ return {
368
+ text: renderMessagePresentationFallbackText({ presentation }),
369
+ presentation,
370
+ presentationTextMode: "fallback"
371
+ };
372
+ }
373
+ function buildCodexCommandPickerPresentation(title, prompt, buttons) {
374
+ return {
375
+ title,
376
+ blocks: [{
377
+ type: "text",
378
+ text: prompt
379
+ }, {
380
+ type: "buttons",
381
+ buttons: buttons.map((button) => ({
382
+ label: button.label,
383
+ action: {
384
+ type: "command",
385
+ command: button.command
386
+ }
387
+ }))
388
+ }]
389
+ };
390
+ }
391
+ //#endregion
377
392
  //#region extensions/codex/src/command-plugins-readiness.ts
378
393
  /** Runtime support is not account-wide permission to browse, connect or invoke apps. */
379
394
  async function readCodexHostedAppsSupport(context, account) {
@@ -592,15 +607,10 @@ function formatCodexPluginReadiness(readiness, page = 1) {
592
607
  blocks.push(buildCodexPluginStatusButtons(readiness.commandId, canRefreshHostedApps));
593
608
  }
594
609
  }
595
- const presentation = {
610
+ return buildCodexPresentationReply({
596
611
  title: "Codex plugin status",
597
612
  blocks
598
- };
599
- return {
600
- text: renderMessagePresentationFallbackText({ presentation }),
601
- presentation,
602
- presentationTextMode: "fallback"
603
- };
613
+ });
604
614
  }
605
615
  async function readEvidence(read) {
606
616
  try {
@@ -652,7 +662,7 @@ async function refreshCodexHostedApps(context) {
652
662
  await context.validateCurrent();
653
663
  return { text: `${error instanceof CodexAppServerRpcError && error.code === -32601 ? "This Codex app-server does not support the required app inventory methods. Update the Codex plugin and retry." : (isCodexAppServerIndeterminateRequestCancellationError(error) || isCodexAppServerPrewriteRequestCancellationError(error)) && "reason" in error && error.reason === "aborted" ? "The hosted app refresh was cancelled." : "Hosted app tools could not be refreshed. Check the Codex connection and try again."} Run /codex plugins refresh to retry for the current Codex account/runtime. Previous inventory was not confirmed; no conversation policy was changed.` };
654
664
  }
655
- const presentation = {
665
+ return buildCodexPresentationReply({
656
666
  title: "Hosted app refresh",
657
667
  blocks: [{
658
668
  type: "text",
@@ -668,12 +678,7 @@ async function refreshCodexHostedApps(context) {
668
678
  type: "text",
669
679
  text: "Use /codex plugins list to find configured plugins, then /codex plugins status <name>@<marketplace> to inspect one."
670
680
  }]
671
- };
672
- return {
673
- text: renderMessagePresentationFallbackText({ presentation }),
674
- presentation,
675
- presentationTextMode: "fallback"
676
- };
681
+ });
677
682
  }
678
683
  //#endregion
679
684
  //#region extensions/codex/src/command-diagnostics-state.ts
@@ -691,28 +696,35 @@ const codexDiagnosticsFeedbackState = {
691
696
  }
692
697
  };
693
698
  //#endregion
694
- //#region extensions/codex/src/command-presentation.ts
695
- function buildCodexCommandPickerPresentation(title, prompt, buttons) {
696
- return {
697
- title,
698
- blocks: [{
699
- type: "text",
700
- text: prompt
701
- }, {
702
- type: "buttons",
703
- buttons: buttons.map((button) => ({
704
- label: button.label,
705
- action: {
706
- type: "command",
707
- command: button.command
708
- }
709
- }))
710
- }]
711
- };
712
- }
713
- //#endregion
714
699
  //#region extensions/codex/src/command-handler-args.ts
715
- /** No-arg `/codex` picker. */
700
+ const COMPUTER_USE_OPTIONS = [
701
+ ["--source", "marketplaceSource"],
702
+ ["--marketplace-source", "marketplaceSource"],
703
+ ["--marketplace-path", "marketplacePath"],
704
+ ["--path", "marketplacePath"],
705
+ ["--marketplace", "marketplaceName"],
706
+ ["--plugin", "pluginName"],
707
+ ["--server", "mcpServerName"],
708
+ ["--mcp-server", "mcpServerName"]
709
+ ];
710
+ const CONNECTION_OPTIONS = {
711
+ bind: /* @__PURE__ */ new Map([
712
+ ["--cwd", "cwd"],
713
+ ["--model", "model"],
714
+ ["--provider", "provider"],
715
+ ["--model-provider", "provider"]
716
+ ]),
717
+ resume: /* @__PURE__ */ new Map([
718
+ ["--host", "host"],
719
+ ["--node", "host"],
720
+ ["--bind", "bind"]
721
+ ]),
722
+ sessions: /* @__PURE__ */ new Map([
723
+ ["--host", "host"],
724
+ ["--node", "host"],
725
+ ["--limit", "limit"]
726
+ ])
727
+ };
716
728
  function buildCodexSubcommandPickerReply() {
717
729
  const verbs = [
718
730
  {
@@ -759,60 +771,40 @@ function buildCodexSubcommandPickerReply() {
759
771
  presentation: buildCodexCommandPickerPresentation("Codex commands", "Pick a Codex subcommand:", verbs)
760
772
  };
761
773
  }
762
- function buildCodexFastMenuReply() {
763
- return buildCodexChoiceMenuReply({
764
- title: "Codex fast mode",
765
- prompt: "Pick a Codex fast mode:",
766
- introduction: "Codex fast mode. Pick one or type /codex fast <mode>:",
767
- command: "/codex fast",
768
- choices: [
774
+ function buildCodexChoiceMenuReply(kind) {
775
+ const choices = {
776
+ fast: [
769
777
  "on",
770
778
  "off",
771
779
  "status"
772
- ]
773
- });
774
- }
775
- function buildCodexPermissionsMenuReply() {
776
- return buildCodexChoiceMenuReply({
777
- title: "Codex permissions",
778
- prompt: "Pick a Codex permissions mode:",
779
- introduction: "Codex permissions. Pick one or type /codex permissions <mode>:",
780
- command: "/codex permissions",
781
- choices: [
780
+ ],
781
+ permissions: [
782
782
  "default",
783
783
  "yolo",
784
784
  "status"
785
- ]
786
- });
787
- }
788
- function buildCodexComputerUseMenuReply() {
789
- return buildCodexChoiceMenuReply({
790
- title: "Codex computer-use",
791
- prompt: "Pick a Codex computer-use action:",
792
- introduction: "Codex computer-use. Pick one or type /codex computer-use <action>:",
793
- command: "/codex computer-use",
794
- choices: ["status", "install"],
795
- hint: "Flag-driven invocations (--source, --marketplace-path, --marketplace) are not in the picker. Type '/codex computer-use' or read '/codex help' for the full surface."
796
- });
797
- }
798
- function buildCodexChoiceMenuReply(params) {
799
- const buttons = [...params.choices.map((choice) => ({
785
+ ],
786
+ "computer-use": ["status", "install"]
787
+ }[kind];
788
+ const title = `Codex ${kind === "fast" ? "fast mode" : kind}`;
789
+ const argument = kind === "computer-use" ? "action" : "mode";
790
+ const command = `/codex ${kind}`;
791
+ const buttons = [...choices.map((choice) => ({
800
792
  label: choice,
801
- command: `${params.command} ${choice}`
793
+ command: `${command} ${choice}`
802
794
  })), {
803
795
  label: "back",
804
796
  command: "/codex"
805
797
  }];
806
798
  return {
807
799
  text: [
808
- params.introduction,
800
+ `${title}. Pick one or type ${command} <${argument}>:`,
809
801
  "",
810
- ...params.choices.map((choice, index) => ` ${index + 1}. ${params.command} ${choice}`),
802
+ ...choices.map((choice, index) => ` ${index + 1}. ${command} ${choice}`),
811
803
  "",
812
- ...params.hint ? [params.hint, ""] : [],
804
+ ...kind === "computer-use" ? ["Flag-driven invocations (--source, --marketplace-path, --marketplace) are not in the picker. Type '/codex computer-use' or read '/codex help' for the full surface.", ""] : [],
813
805
  "Type '/codex' to go back to the main menu."
814
806
  ].join("\n"),
815
- presentation: buildCodexCommandPickerPresentation(params.title, params.prompt, buttons)
807
+ presentation: buildCodexCommandPickerPresentation(title, `Pick a Codex ${kind} ${argument}:`, buttons)
816
808
  };
817
809
  }
818
810
  function isMenuVerb(rest) {
@@ -829,34 +821,19 @@ function splitArgs(value) {
829
821
  if (escaping) {
830
822
  current += char;
831
823
  escaping = false;
832
- tokenStarted = true;
833
- continue;
834
- }
835
- if (char === "\\" && quote !== "'") {
836
- escaping = true;
837
- tokenStarted = true;
838
- continue;
839
- }
840
- if (quote) {
824
+ } else if (char === "\\" && quote !== "'") escaping = true;
825
+ else if (quote) {
841
826
  if (char === quote) quote = void 0;
842
827
  else current += char;
843
- tokenStarted = true;
844
- continue;
845
- }
846
- if (char === "\"" || char === "'") {
847
- quote = char;
848
- tokenStarted = true;
849
- continue;
850
- }
851
- if (/\s/.test(char)) {
828
+ } else if (char === "\"" || char === "'") quote = char;
829
+ else if (/\s/.test(char)) {
852
830
  if (tokenStarted) {
853
831
  args.push(current);
854
832
  current = "";
855
833
  tokenStarted = false;
856
834
  }
857
835
  continue;
858
- }
859
- current += char;
836
+ } else current += char;
860
837
  tokenStarted = true;
861
838
  }
862
839
  if (escaping) current += "\\";
@@ -864,12 +841,7 @@ function splitArgs(value) {
864
841
  return args;
865
842
  }
866
843
  function parseBindArgs(args) {
867
- const { parsed, values } = parseThreadArgs(args, /* @__PURE__ */ new Map([
868
- ["--cwd", "cwd"],
869
- ["--model", "model"],
870
- ["--provider", "provider"],
871
- ["--model-provider", "provider"]
872
- ]));
844
+ const { parsed, values } = parseConnectionArgs(args, "bind");
873
845
  return {
874
846
  ...parsed,
875
847
  cwd: normalizeOptionalString(values.get("cwd")),
@@ -878,69 +850,44 @@ function parseBindArgs(args) {
878
850
  };
879
851
  }
880
852
  function parseCodexCliSessionsArgs(args) {
881
- const parsed = { filter: "" };
882
- const filter = [];
883
- for (let index = 0; index < args.length; index += 1) {
884
- const arg = expectDefined(args[index], "current Codex sessions argument");
885
- if (arg === "--help" || arg === "-h") {
886
- parsed.help = true;
887
- continue;
888
- }
889
- if (arg === "--host" || arg === "--node") {
890
- const value = readRequiredOptionValue(args, index);
891
- if (!value || parsed.host !== void 0) {
892
- parsed.help = true;
893
- continue;
894
- }
895
- parsed.host = value;
896
- index += 1;
897
- continue;
898
- }
899
- if (arg === "--limit") {
900
- const value = readRequiredOptionValue(args, index);
901
- const parsedLimit = parseStrictPositiveInteger(value);
902
- if (parsedLimit === void 0) {
903
- parsed.help = true;
904
- continue;
905
- }
906
- parsed.limit = parsedLimit;
907
- index += 1;
908
- continue;
909
- }
910
- if (arg.startsWith("-")) {
911
- parsed.help = true;
912
- continue;
913
- }
914
- filter.push(arg);
915
- }
916
- parsed.host = normalizeOptionalString(parsed.host);
917
- parsed.filter = filter.join(" ").trim();
918
- return parsed;
853
+ const { parsed, values, filter } = parseConnectionArgs(args, "sessions");
854
+ return {
855
+ ...parsed,
856
+ host: normalizeOptionalString(values.get("host")),
857
+ filter: filter.join(" ").trim()
858
+ };
919
859
  }
920
860
  function parseResumeArgs(args) {
921
- const { parsed, values } = parseThreadArgs(args, /* @__PURE__ */ new Map([
922
- ["--host", "host"],
923
- ["--node", "host"],
924
- ["--bind", "bind"]
925
- ]));
861
+ const { parsed, values } = parseConnectionArgs(args, "resume");
926
862
  return {
927
863
  ...parsed,
928
864
  ...values.has("bind") ? { bindHere: true } : {},
929
865
  host: normalizeOptionalString(values.get("host"))
930
866
  };
931
867
  }
932
- function parseThreadArgs(args, options) {
868
+ function parseConnectionArgs(args, kind) {
933
869
  const parsed = {};
934
870
  const values = /* @__PURE__ */ new Map();
871
+ const filter = [];
935
872
  for (let index = 0; index < args.length; index += 1) {
936
- const arg = expectDefined(args[index], "current Codex thread argument");
873
+ const arg = expectDefined(args[index], `current Codex ${kind === "sessions" ? "sessions" : "thread"} argument`);
937
874
  if (arg === "--help" || arg === "-h") {
938
875
  parsed.help = true;
939
876
  continue;
940
877
  }
941
- const option = options.get(arg);
878
+ const option = CONNECTION_OPTIONS[kind].get(arg);
942
879
  if (option) {
943
880
  const value = readRequiredOptionValue(args, index);
881
+ if (option === "limit") {
882
+ const limit = parseStrictPositiveInteger(value);
883
+ if (limit === void 0) {
884
+ parsed.help = true;
885
+ continue;
886
+ }
887
+ parsed.limit = limit;
888
+ index += 1;
889
+ continue;
890
+ }
944
891
  if (!value || values.has(option) || option === "bind" && value !== "here") {
945
892
  parsed.help = true;
946
893
  continue;
@@ -949,23 +896,27 @@ function parseThreadArgs(args, options) {
949
896
  index += 1;
950
897
  continue;
951
898
  }
899
+ if (kind === "sessions" && !arg.startsWith("-")) {
900
+ filter.push(arg);
901
+ continue;
902
+ }
952
903
  if (!arg.startsWith("-") && !parsed.threadId) {
953
904
  parsed.threadId = arg;
954
905
  continue;
955
906
  }
956
907
  parsed.help = true;
957
908
  }
958
- parsed.threadId = normalizeOptionalString(parsed.threadId);
909
+ if (kind !== "sessions") parsed.threadId = normalizeOptionalString(parsed.threadId);
959
910
  return {
960
911
  parsed,
961
- values
912
+ values,
913
+ filter
962
914
  };
963
915
  }
964
916
  function parseComputerUseArgs(args) {
965
917
  const parsed = {
966
918
  action: "status",
967
919
  overrides: {},
968
- hasOverrides: false,
969
920
  persistentIdentity: {}
970
921
  };
971
922
  let sawAction = false;
@@ -984,26 +935,15 @@ function parseComputerUseArgs(args) {
984
935
  parsed.action = arg;
985
936
  continue;
986
937
  }
987
- const option = arg === "--source" || arg === "--marketplace-source" ? "marketplaceSource" : arg === "--marketplace-path" || arg === "--path" ? "marketplacePath" : arg === "--marketplace" ? "marketplaceName" : void 0;
938
+ const option = COMPUTER_USE_OPTIONS.find(([flag]) => flag === arg)?.[1];
988
939
  if (option) {
940
+ const target = option === "pluginName" || option === "mcpServerName" ? parsed.persistentIdentity : parsed.overrides;
989
941
  const value = readRequiredOptionValue(args, index);
990
- if (!value || parsed.overrides[option] !== void 0) {
991
- parsed.help = true;
992
- continue;
993
- }
994
- parsed.overrides[option] = value.trim();
995
- parsed.hasOverrides = true;
996
- index += 1;
997
- continue;
998
- }
999
- if (arg === "--plugin" || arg === "--server" || arg === "--mcp-server") {
1000
- const value = readRequiredOptionValue(args, index);
1001
- const configKey = arg === "--plugin" ? "pluginName" : "mcpServerName";
1002
- if (!value || parsed.persistentIdentity[configKey] !== void 0) {
942
+ if (!value || target[option] !== void 0) {
1003
943
  parsed.help = true;
1004
944
  continue;
1005
945
  }
1006
- parsed.persistentIdentity[configKey] = value.trim();
946
+ target[option] = value.trim();
1007
947
  index += 1;
1008
948
  continue;
1009
949
  }
@@ -1013,13 +953,18 @@ function parseComputerUseArgs(args) {
1013
953
  }
1014
954
  function formatComputerUsePersistentIdentityMigration(parsed) {
1015
955
  const configPrefix = "plugins.entries.codex.config.computerUse";
1016
- const settings = [parsed.persistentIdentity.pluginName ? `${configPrefix}.pluginName = ${JSON.stringify(parsed.persistentIdentity.pluginName)}` : void 0, parsed.persistentIdentity.mcpServerName ? `${configPrefix}.mcpServerName = ${JSON.stringify(parsed.persistentIdentity.mcpServerName)}` : void 0].filter((setting) => Boolean(setting));
1017
- const retryArgs = [
1018
- `/codex computer-use ${parsed.action}`,
1019
- parsed.overrides.marketplaceSource ? `--source ${JSON.stringify(parsed.overrides.marketplaceSource)}` : void 0,
1020
- parsed.overrides.marketplacePath ? `--marketplace-path ${JSON.stringify(parsed.overrides.marketplacePath)}` : void 0,
1021
- parsed.overrides.marketplaceName ? `--marketplace ${JSON.stringify(parsed.overrides.marketplaceName)}` : void 0
1022
- ].filter((arg) => Boolean(arg));
956
+ const settings = ["pluginName", "mcpServerName"].flatMap((key) => {
957
+ const value = parsed.persistentIdentity[key];
958
+ return value ? [`${configPrefix}.${key} = ${JSON.stringify(value)}`] : [];
959
+ });
960
+ const retryArgs = [`/codex computer-use ${parsed.action}`, ...[
961
+ ["marketplaceSource", "--source"],
962
+ ["marketplacePath", "--marketplace-path"],
963
+ ["marketplaceName", "--marketplace"]
964
+ ].flatMap(([key, flag]) => {
965
+ const value = parsed.overrides[key];
966
+ return value ? [`${flag} ${JSON.stringify(value)}`] : [];
967
+ })];
1023
968
  return ["One-off Computer Use plugin/server overrides are no longer supported.", `Set ${settings.join(" and ")} persistently, then rerun ${retryArgs.join(" ")}.`].join(" ");
1024
969
  }
1025
970
  function readRequiredOptionValue(args, index) {
@@ -1057,18 +1002,14 @@ function parseDiagnosticsArgs(args) {
1057
1002
  note: args
1058
1003
  };
1059
1004
  }
1060
- function formatDiagnosticsUsage(commandPrefix) {
1061
- return [
1062
- `Usage: ${commandPrefix} [note]`,
1063
- `Usage: ${commandPrefix} confirm <token>`,
1064
- `Usage: ${commandPrefix} cancel <token>`
1065
- ].join("\n");
1066
- }
1067
1005
  function createCodexDiagnosticsConfirmation(params) {
1068
1006
  prunePendingCodexDiagnosticsConfirmations(params.now);
1069
1007
  if (!pendingCodexDiagnosticsConfirmationTokensByScope.has(params.scopeKey) && pendingCodexDiagnosticsConfirmationTokensByScope.size >= CODEX_DIAGNOSTICS_CONFIRMATION_MAX_SCOPES) {
1070
1008
  const oldestScopeKey = pendingCodexDiagnosticsConfirmationTokensByScope.keys().next().value;
1071
- if (typeof oldestScopeKey === "string") deletePendingCodexDiagnosticsConfirmationScope(oldestScopeKey);
1009
+ if (typeof oldestScopeKey === "string") {
1010
+ for (const token of pendingCodexDiagnosticsConfirmationTokensByScope.get(oldestScopeKey) ?? []) pendingCodexDiagnosticsConfirmations.delete(token);
1011
+ pendingCodexDiagnosticsConfirmationTokensByScope.delete(oldestScopeKey);
1012
+ }
1072
1013
  }
1073
1014
  const scopeTokens = pendingCodexDiagnosticsConfirmationTokensByScope.get(params.scopeKey) ?? [];
1074
1015
  while (scopeTokens.length >= CODEX_DIAGNOSTICS_CONFIRMATION_MAX_REQUESTS_PER_SCOPE) {
@@ -1124,11 +1065,6 @@ function deletePendingCodexDiagnosticsConfirmation(token) {
1124
1065
  function prunePendingCodexDiagnosticsConfirmations(now) {
1125
1066
  for (const [token, pending] of pendingCodexDiagnosticsConfirmations) if (now - pending.createdAt >= CODEX_DIAGNOSTICS_CONFIRMATION_TTL_MS) deletePendingCodexDiagnosticsConfirmation(token);
1126
1067
  }
1127
- function deletePendingCodexDiagnosticsConfirmationScope(scopeKey) {
1128
- const scopeTokens = pendingCodexDiagnosticsConfirmationTokensByScope.get(scopeKey) ?? [];
1129
- for (const token of scopeTokens) pendingCodexDiagnosticsConfirmations.delete(token);
1130
- pendingCodexDiagnosticsConfirmationTokensByScope.delete(scopeKey);
1131
- }
1132
1068
  function codexDiagnosticsTargetsMatch(expected, actual) {
1133
1069
  const fingerprint = (target) => JSON.stringify([
1134
1070
  bindingStoreKey(target.identity),
@@ -1179,10 +1115,7 @@ function formatCodexDiagnosticsTargetLine(target) {
1179
1115
  function readCodexDiagnosticsTargetsCooldownMessage(targets, ctx, now, options = {}) {
1180
1116
  for (const target of targets) {
1181
1117
  const cooldownMs = readCodexDiagnosticsCooldownMs(lastCodexDiagnosticsUploadByThread, target.threadId, now);
1182
- if (cooldownMs > 0) {
1183
- if (options.includeThreadId === false) return `Codex diagnostics were already sent for one of these Codex threads recently. Try again in ${Math.ceil(cooldownMs / 1e3)}s.`;
1184
- return `Codex diagnostics were already sent for thread ${formatCodexDisplayText(target.threadId)} recently. Try again in ${Math.ceil(cooldownMs / 1e3)}s.`;
1185
- }
1118
+ if (cooldownMs > 0) return `Codex diagnostics were already sent for ${options.includeThreadId === false ? "one of these Codex threads" : `thread ${formatCodexDisplayText(target.threadId)}`} recently. Try again in ${Math.ceil(cooldownMs / 1e3)}s.`;
1186
1119
  }
1187
1120
  const scopeCooldownMs = readCodexDiagnosticsCooldownMs(lastCodexDiagnosticsUploadByScope, options.cooldownScope ?? readCodexDiagnosticsCooldownScope(ctx), now);
1188
1121
  if (scopeCooldownMs > 0) return `Codex diagnostics were already sent for this account or channel recently. Try again in ${Math.ceil(scopeCooldownMs / 1e3)}s.`;
@@ -1316,7 +1249,7 @@ async function resolvePreparedCodexCommandAuthority(deps, ctx) {
1316
1249
  config: ctx.config,
1317
1250
  storePath
1318
1251
  }) : void 0;
1319
- const assertHostCurrent = currentSession?.authority.assertLegacyCurrent ?? (() => {});
1252
+ const assertHostCurrent = currentSession?.authority.assertLegacyCurrent ?? composeSessionEntryCommitGuards([]);
1320
1253
  const binding = (target && (!sessionIdentity || !isDeepStrictEqual(target.identity, sessionIdentity)) ? await resolveCodexSessionBinding({
1321
1254
  bindingStore: deps.bindingStore,
1322
1255
  identity: target.identity,
@@ -1324,11 +1257,11 @@ async function resolvePreparedCodexCommandAuthority(deps, ctx) {
1324
1257
  storePath,
1325
1258
  assertCurrent: assertHostCurrent
1326
1259
  }) : currentSession)?.binding;
1327
- const assertCurrent = () => {
1328
- assertHostCurrent();
1260
+ const assertCurrent = composeSessionEntryCommitGuards([assertHostCurrent], (assertSource) => {
1261
+ assertSource();
1329
1262
  if (target && !isDeepStrictEqual(deps.bindingStore.read(target.identity), binding)) throw new Error("Codex command binding changed before dispatch");
1330
- assertHostCurrent();
1331
- };
1263
+ assertSource();
1264
+ });
1332
1265
  assertCurrent();
1333
1266
  return {
1334
1267
  target,
@@ -1339,14 +1272,14 @@ async function resolvePreparedCodexCommandAuthority(deps, ctx) {
1339
1272
  storePath,
1340
1273
  assertHostCurrent,
1341
1274
  assertCurrent,
1342
- assertMutationCurrent: () => {
1275
+ assertMutationCurrent: composeSessionEntryCommitGuards([assertCurrent], (assertSource) => {
1343
1276
  assertCodexHostOwnerCurrent(ctx);
1344
- assertCurrent();
1345
- },
1346
- assertHostMutationCurrent: () => {
1277
+ assertSource();
1278
+ }),
1279
+ assertHostMutationCurrent: composeSessionEntryCommitGuards([assertHostCurrent], (assertSource) => {
1347
1280
  assertCodexHostOwnerCurrent(ctx);
1348
- assertHostCurrent();
1349
- }
1281
+ assertSource();
1282
+ })
1350
1283
  };
1351
1284
  }
1352
1285
  async function resolveCommandAppServerContext(deps, ctx, pluginConfig) {
@@ -1405,20 +1338,25 @@ function resolveCodexConversationControlScope(ctx) {
1405
1338
  //#endregion
1406
1339
  //#region extensions/codex/src/command-diagnostics.ts
1407
1340
  const NO_DIAGNOSTICS_THREAD = ["No Codex thread is attached to this OpenClaw session yet.", "Use /codex threads to find a thread, then /codex resume <thread-id> before sending diagnostics."].join("\n");
1408
- async function handleCodexDiagnosticsFeedback(deps, context, pluginConfig, args, commandPrefix) {
1341
+ async function handleCodexDiagnosticsFeedback(deps, context, pluginConfig, args) {
1409
1342
  const ctx = { ...context };
1410
1343
  if (ctx.senderIsOwner !== true) return { text: "Only an owner can send Codex diagnostics." };
1411
1344
  const parsed = parseDiagnosticsArgs(args);
1412
- if (parsed.action === "usage") return { text: formatDiagnosticsUsage(commandPrefix) };
1345
+ if (parsed.action === "usage") return { text: [
1346
+ "Usage: /codex diagnostics [note]",
1347
+ "Usage: /codex diagnostics confirm <token>",
1348
+ "Usage: /codex diagnostics cancel <token>"
1349
+ ].join("\n") };
1413
1350
  if (parsed.action === "confirm") return { text: await confirmCodexDiagnosticsFeedback(deps, ctx, pluginConfig, parsed.token) };
1414
1351
  if (parsed.action === "cancel") return { text: cancelCodexDiagnosticsFeedback(ctx, parsed.token) };
1415
- const targets = await requireCodexDiagnosticsTargets(deps, ctx);
1416
- if (typeof targets === "string") return { text: targets };
1352
+ if (!await hasAnyCodexDiagnosticsIdentity(ctx)) return { text: "Cannot send Codex diagnostics because this command did not include a stable session identity." };
1353
+ const targets = await resolveCodexDiagnosticsTargets(deps, ctx);
1354
+ if (targets.length === 0) return { text: NO_DIAGNOSTICS_THREAD };
1417
1355
  if (ctx.diagnosticsUploadApproved === true) return { text: await sendCodexDiagnosticsFeedbackForTargets(deps, ctx, pluginConfig, parsed.note, targets) };
1418
1356
  if (ctx.diagnosticsPreviewOnly === true) return { text: previewCodexDiagnosticsFeedbackApproval(targets, ctx, parsed.note) };
1419
- return requestCodexDiagnosticsFeedbackApproval(targets, ctx, parsed.note, commandPrefix);
1357
+ return requestCodexDiagnosticsFeedbackApproval(targets, ctx, parsed.note);
1420
1358
  }
1421
- function requestCodexDiagnosticsFeedbackApproval(targets, ctx, note, commandPrefix) {
1359
+ function requestCodexDiagnosticsFeedbackApproval(targets, ctx, note) {
1422
1360
  const now = Date.now();
1423
1361
  const cooldownMessage = readCodexDiagnosticsTargetsCooldownMessage(targets, ctx, now);
1424
1362
  if (cooldownMessage) return { text: cooldownMessage };
@@ -1434,8 +1372,8 @@ function requestCodexDiagnosticsFeedbackApproval(targets, ctx, note, commandPref
1434
1372
  ...readCodexDiagnosticsConfirmationScope(ctx),
1435
1373
  now
1436
1374
  });
1437
- const confirmCommand = `${commandPrefix} confirm ${token}`;
1438
- const cancelCommand = `${commandPrefix} cancel ${token}`;
1375
+ const confirmCommand = `/codex diagnostics confirm ${token}`;
1376
+ const cancelCommand = `/codex diagnostics cancel ${token}`;
1439
1377
  const displayReason = reason ? formatCodexDisplayText(reason) : void 0;
1440
1378
  return {
1441
1379
  text: [
@@ -1574,11 +1512,6 @@ function consumeCodexDiagnosticsConfirmation(ctx, token, action) {
1574
1512
  deletePendingCodexDiagnosticsConfirmation(token);
1575
1513
  return pending;
1576
1514
  }
1577
- async function requireCodexDiagnosticsTargets(deps, ctx) {
1578
- if (!await hasAnyCodexDiagnosticsIdentity(ctx)) return "Cannot send Codex diagnostics because this command did not include a stable session identity.";
1579
- const targets = await resolveCodexDiagnosticsTargets(deps, ctx);
1580
- return targets.length > 0 ? targets : NO_DIAGNOSTICS_THREAD;
1581
- }
1582
1515
  async function hasAnyCodexDiagnosticsIdentity(ctx) {
1583
1516
  if (await resolveControlTarget(ctx)) return true;
1584
1517
  return (ctx.diagnosticsSessions ?? []).some((session) => Boolean(session.sessionId));
@@ -1633,13 +1566,10 @@ async function resolveCodexDiagnosticsTargets(deps, ctx) {
1633
1566
  return targets;
1634
1567
  }
1635
1568
  function resolvePendingCodexDiagnosticsTargets(deps, targets, config) {
1636
- const resolved = [];
1637
- for (const target of targets) {
1569
+ return targets.flatMap((target) => {
1638
1570
  const binding = deps.bindingStore.read(target.identity);
1639
- if (!binding?.threadId) continue;
1640
- resolved.push(resolveCodexDiagnosticsTarget(target, binding, config));
1641
- }
1642
- return resolved;
1571
+ return binding?.threadId ? [resolveCodexDiagnosticsTarget(target, binding, config)] : [];
1572
+ });
1643
1573
  }
1644
1574
  function resolveCodexDiagnosticsTarget(target, binding, config) {
1645
1575
  const candidate = {
@@ -2063,7 +1993,7 @@ async function handleComputerUseCommand(deps, ctx, pluginConfig, args) {
2063
1993
  pluginConfig,
2064
1994
  config: ctx.config,
2065
1995
  agentDir,
2066
- forceEnable: parsed.action === "install" || parsed.hasOverrides,
1996
+ forceEnable: parsed.action === "install" || Object.keys(parsed.overrides).length > 0,
2067
1997
  ...Object.keys(parsed.overrides).length > 0 ? { overrides: parsed.overrides } : {}
2068
1998
  };
2069
1999
  if (parsed.action === "install") return formatComputerUseStatus(await deps.installCodexComputerUse({
@@ -2097,17 +2027,15 @@ async function handleNativeGoal(deps, ctx, pluginConfig, args) {
2097
2027
  assertCurrent: authority.assertCurrent,
2098
2028
  ...connection.usesSupervisionConnection ? { startOptions: connection.appServer.start } : {}
2099
2029
  };
2100
- if (action === "status" || action === "get") {
2101
- if (args.length > 1) return "Usage: /codex goal [status]";
2102
- return formatNativeGoal(await deps.codexControlRequest(pluginConfig, CODEX_CONTROL_METHODS.getThreadGoal, { threadId: binding.threadId }, goalRequestOptions));
2103
- }
2104
- if (action === "clear") {
2105
- if (args.length > 1) return "Usage: /codex goal clear";
2106
- const response = await deps.codexControlRequest(pluginConfig, CODEX_CONTROL_METHODS.clearThreadGoal, { threadId: binding.threadId }, {
2030
+ if (action === "status" || action === "get" || action === "clear") {
2031
+ const clear = action === "clear";
2032
+ if (args.length > 1) return clear ? "Usage: /codex goal clear" : "Usage: /codex goal [status]";
2033
+ const response = await deps.codexControlRequest(pluginConfig, clear ? CODEX_CONTROL_METHODS.clearThreadGoal : CODEX_CONTROL_METHODS.getThreadGoal, { threadId: binding.threadId }, clear ? {
2107
2034
  ...goalRequestOptions,
2108
2035
  assertOwnerCurrent: () => assertCodexHostOwnerCurrent(ctx)
2109
- });
2110
- return isJsonObject(response) && response.cleared === true ? "Cleared the Codex goal." : "No Codex goal was active.";
2036
+ } : goalRequestOptions);
2037
+ if (clear) return isJsonObject(response) && response.cleared === true ? "Cleared the Codex goal." : "No Codex goal was active.";
2038
+ return formatNativeGoal(response);
2111
2039
  }
2112
2040
  const requestedStatus = action === "pause" ? "paused" : action === "resume" ? "active" : action === "block" ? "blocked" : action === "complete" ? "complete" : void 0;
2113
2041
  const isObjectiveUpdate = action === "set";
@@ -2182,30 +2110,28 @@ async function setConversationModel(deps, ctx, args) {
2182
2110
  assertCommitAllowed: authority.assertMutationCurrent
2183
2111
  });
2184
2112
  }
2185
- async function setConversationFastMode(deps, ctx, args) {
2186
- if (args.length > 1) return "Usage: /codex fast [on|off|status]";
2113
+ async function setConversationPreference(deps, ctx, args, kind) {
2114
+ const usage = `Usage: /codex ${kind} ${kind === "fast" ? "[on|off|status]" : "[default|yolo|status]"}`;
2115
+ if (args.length > 1) return usage;
2187
2116
  const authority = await resolvePreparedCodexCommandAuthority(deps, ctx);
2188
2117
  const { target, binding } = authority;
2189
- if (!target) return "Cannot set Codex fast mode because this command did not include a stable binding identity.";
2190
- const value = args[0];
2191
- const parsed = parseCodexFastModeArg(value);
2192
- if (value && parsed == null && value.trim().toLowerCase() !== "status") return "Usage: /codex fast [on|off|status]";
2193
- return await deps.setCodexConversationFastMode({
2194
- identity: target.identity,
2195
- bindingStore: deps.bindingStore,
2196
- binding,
2197
- enabled: parsed,
2198
- assertCurrent: parsed === void 0 ? authority.assertCurrent : authority.assertMutationCurrent
2199
- });
2200
- }
2201
- async function setConversationPermissions(deps, ctx, args) {
2202
- if (args.length > 1) return "Usage: /codex permissions [default|yolo|status]";
2203
- const authority = await resolvePreparedCodexCommandAuthority(deps, ctx);
2204
- const { target } = authority;
2118
+ if (kind === "fast") {
2119
+ if (!target) return "Cannot set Codex fast mode because this command did not include a stable binding identity.";
2120
+ const value = args[0];
2121
+ const parsed = parseCodexFastModeArg(value);
2122
+ if (value && parsed == null && value.trim().toLowerCase() !== "status") return usage;
2123
+ return await deps.setCodexConversationFastMode({
2124
+ identity: target.identity,
2125
+ bindingStore: deps.bindingStore,
2126
+ binding,
2127
+ enabled: parsed,
2128
+ assertCurrent: parsed === void 0 ? authority.assertCurrent : authority.assertMutationCurrent
2129
+ });
2130
+ }
2205
2131
  if (!target || !ctx.sessionId || !ctx.sessionKey) return "Cannot set Codex permissions because this command did not include a complete session identity.";
2206
2132
  const value = args[0];
2207
2133
  const parsed = parseCodexPermissionsModeArg(value);
2208
- if (value && !parsed && value.trim().toLowerCase() !== "status") return "Usage: /codex permissions [default|yolo|status]";
2134
+ if (value && !parsed && value.trim().toLowerCase() !== "status") return usage;
2209
2135
  if (parsed === "yolo" && !hasCodexAdminScope(ctx)) return CODEX_FULL_PERMISSIONS_AUTH_ERROR;
2210
2136
  return await deps.setCodexConversationPermissions({
2211
2137
  mode: parsed,
@@ -2328,12 +2254,7 @@ function formatCodexAvailablePlugins(plugins, warnings, query, page) {
2328
2254
  label: "Plugin controls",
2329
2255
  command: "/codex plugins menu"
2330
2256
  });
2331
- const presentation = buildCodexCommandPickerPresentation("Discoverable Codex plugins", lines.join("\n"), buttons);
2332
- return {
2333
- text: renderMessagePresentationFallbackText({ presentation }),
2334
- presentation,
2335
- presentationTextMode: "fallback"
2336
- };
2257
+ return buildCodexPresentationReply(buildCodexCommandPickerPresentation("Discoverable Codex plugins", lines.join("\n"), buttons));
2337
2258
  }
2338
2259
  //#endregion
2339
2260
  //#region extensions/codex/src/command-plugins-management.ts
@@ -2346,16 +2267,14 @@ async function handleCodexPluginsSubcommand(input, rest, io, runtime) {
2346
2267
  };
2347
2268
  const [verb = "list", ...args] = rest;
2348
2269
  const normalized = verb.toLowerCase();
2349
- if (normalized === "menu") {
2350
- if (args.length > 0) return { text: "Usage: /codex plugins menu" };
2351
- return buildPluginsMenuReply();
2352
- }
2353
- if (normalized === "help") {
2354
- if (args.length > 0) return { text: "Usage: /codex plugins help" };
2355
- return { text: buildPluginsHelp() };
2356
- }
2270
+ if ([
2271
+ "menu",
2272
+ "help",
2273
+ "list"
2274
+ ].includes(normalized) && args.length > 0) return { text: `Usage: /codex plugins ${normalized}` };
2275
+ if (normalized === "menu") return buildPluginsMenuReply();
2276
+ if (normalized === "help") return { text: buildPluginsHelp() };
2357
2277
  if (normalized === "list") {
2358
- if (args.length > 0) return { text: "Usage: /codex plugins list" };
2359
2278
  const current = await io.readConfig();
2360
2279
  return { text: formatPluginList(current.plugins ?? {}, current.enabled === true) };
2361
2280
  }
@@ -2635,7 +2554,7 @@ async function installCodexPlugin(requestedId, io, runtime, ctx) {
2635
2554
  });
2636
2555
  } catch {}
2637
2556
  const authRequirement = appsNeedingAuth.length === 1 ? "1 app still requires" : `${appsNeedingAuth.length} apps still require`;
2638
- const presentation = {
2557
+ return buildCodexPresentationReply({
2639
2558
  title: "Codex plugin app setup",
2640
2559
  tone: "warning",
2641
2560
  blocks: [
@@ -2654,12 +2573,7 @@ async function installCodexPlugin(requestedId, io, runtime, ctx) {
2654
2573
  text: `${refreshWarning.trim()} ${POLICY_REFRESH_HINT}`.trim()
2655
2574
  }
2656
2575
  ]
2657
- };
2658
- return {
2659
- text: renderMessagePresentationFallbackText({ presentation }),
2660
- presentation,
2661
- presentationTextMode: "fallback"
2662
- };
2576
+ });
2663
2577
  }
2664
2578
  const status = alreadyInstalled ? "bundle was already installed in Codex" : "bundle was installed in Codex";
2665
2579
  return { text: `${formatCodexDisplayText(requestedId)} ${status}. OpenClaw app access is configured.${refreshWarning} ${POLICY_REFRESH_HINT}` };
@@ -2945,18 +2859,14 @@ async function handleCodexSubcommand(ctx, options) {
2945
2859
  if (normalized === "binding") return { text: await describeConversationBinding(deps, ctx) };
2946
2860
  if (normalized === "stop" || normalized === "steer") return { text: await controlConversationTurn(deps, ctx, normalized, rest.join(" ")) };
2947
2861
  if (normalized === "model") return { text: await setConversationModel(deps, ctx, rest) };
2948
- if (normalized === "fast") {
2949
- if (isMenuVerb(rest)) return buildCodexFastMenuReply();
2950
- return { text: await setConversationFastMode(deps, ctx, rest) };
2951
- }
2952
- if (normalized === "permissions") {
2953
- if (isMenuVerb(rest)) return buildCodexPermissionsMenuReply();
2954
- return { text: await setConversationPermissions(deps, ctx, rest) };
2862
+ if (normalized === "fast" || normalized === "permissions") {
2863
+ if (isMenuVerb(rest)) return buildCodexChoiceMenuReply(normalized);
2864
+ return { text: await setConversationPreference(deps, ctx, rest, normalized) };
2955
2865
  }
2956
2866
  if (normalized === "compact" || normalized === "review") return { text: await startThreadAction(deps, ctx, options.pluginConfig, normalized, rest) };
2957
- if (normalized === "diagnostics") return await handleCodexDiagnosticsFeedback(deps, ctx, options.pluginConfig, rest.join(" "), "/codex diagnostics");
2867
+ if (normalized === "diagnostics") return await handleCodexDiagnosticsFeedback(deps, ctx, options.pluginConfig, rest.join(" "));
2958
2868
  if (normalized === "computer-use" || normalized === "computeruse") {
2959
- if (isMenuVerb(rest)) return buildCodexComputerUseMenuReply();
2869
+ if (isMenuVerb(rest)) return buildCodexChoiceMenuReply("computer-use");
2960
2870
  return { text: await handleComputerUseCommand(deps, ctx, options.pluginConfig, rest) };
2961
2871
  }
2962
2872
  if (normalized === "mcp" || normalized === "skills") {