@qwen-code/qwen-code 0.23.5-dev.codemode-responses.20260915.af4da34719 → 0.23.5-preview.0

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 (377) hide show
  1. package/bundled/computer-use/SKILL.md +24 -3
  2. package/bundled/qc-helper/docs/configuration/model-providers.md +43 -0
  3. package/bundled/qc-helper/docs/configuration/settings.md +10 -9
  4. package/bundled/qc-helper/docs/extension/agent-plugins.md +1 -0
  5. package/bundled/qc-helper/docs/extension/introduction.md +49 -0
  6. package/bundled/qc-helper/docs/features/channels/dingtalk.md +39 -4
  7. package/bundled/qc-helper/docs/features/channels/overview.md +12 -0
  8. package/bundled/qc-helper/docs/features/commands.md +57 -52
  9. package/bundled/qc-helper/docs/features/computer-use.md +1 -1
  10. package/bundled/qc-helper/docs/features/goals.md +8 -0
  11. package/bundled/qc-helper/docs/features/hooks.md +16 -0
  12. package/bundled/qc-helper/docs/qwen-serve.md +3 -1
  13. package/bundled/workflow-authoring/SKILL.md +48 -22
  14. package/chunks/{MaxSizedBox-3K65WFGY.js → MaxSizedBox-FCF6M53W.js} +40 -43
  15. package/chunks/{StandaloneSessionPicker-JKM33JPY.js → StandaloneSessionPicker-V635V72I.js} +60 -63
  16. package/chunks/{acp-startup-profiler-RUQNTNU5.js → acp-startup-profiler-MOOU37VM.js} +2 -2
  17. package/chunks/{acp-subagent-executor-KIZBB2CL.js → acp-subagent-executor-TND6W2O5.js} +46 -47
  18. package/chunks/{acpAgent-SHI4L5EV.js → acpAgent-3DPWZTNC.js} +954 -322
  19. package/chunks/{agent-AJXNVRX2.js → agent-KIHGINKN.js} +27 -30
  20. package/chunks/{agent-headless-2JPJKYHK.js → agent-headless-EJ4QOUSM.js} +27 -30
  21. package/chunks/{anthropicContentGenerator-H5YPXIDE.js → anthropicContentGenerator-4FGOM5LK.js} +46 -64
  22. package/chunks/{artifact-tool-MFGORTWZ.js → artifact-tool-MUTNH4NI.js} +1 -1
  23. package/chunks/{askUserQuestion-WS4GUT7C.js → askUserQuestion-AKIRLVB5.js} +1 -1
  24. package/chunks/bareMode-QWKZPLPX.js +14 -0
  25. package/chunks/{bridge-KZYSMV4N.js → bridge-MUX5YJZT.js} +46 -49
  26. package/chunks/{ca-GZ4FDJU2.js → ca-WC3A5B3Q.js} +12 -1
  27. package/chunks/{channel-management-service-AFVIT4VH.js → channel-management-service-RRILWSXX.js} +4 -4
  28. package/chunks/{channel-settings-store-IJG52IDV.js → channel-settings-store-7CBIRZER.js} +51 -54
  29. package/chunks/{channel-worker-group-JR6JOELM.js → channel-worker-group-3DUJFZJR.js} +8 -8
  30. package/chunks/{channel-worker-manager-AVKJEZFL.js → channel-worker-manager-E5UW2VLA.js} +8 -8
  31. package/chunks/{channel-worker-supervisor-OOYY7BAQ.js → channel-worker-supervisor-VN33GSEC.js} +5 -5
  32. package/chunks/{chunk-2YMRRI2C.js → chunk-2C5TR6HN.js} +82 -9
  33. package/chunks/{chunk-YDFOHRS5.js → chunk-2GP6BQ2J.js} +1 -1
  34. package/chunks/{chunk-JATZTB7X.js → chunk-347O2YZJ.js} +158 -290
  35. package/chunks/{chunk-RYREFZFH.js → chunk-36NRLIR6.js} +10 -8
  36. package/chunks/{chunk-AXZMWAJV.js → chunk-36SDZ2Q4.js} +8 -0
  37. package/chunks/{chunk-QR4Q425T.js → chunk-3BZI5GDP.js} +1 -1
  38. package/chunks/{chunk-IP6NRULS.js → chunk-3HTUE6ZR.js} +3 -3
  39. package/chunks/{chunk-B2VSRPS6.js → chunk-3LLEB5CU.js} +2 -2
  40. package/chunks/{chunk-L2XNHRDL.js → chunk-3UGMLA4V.js} +10 -8
  41. package/chunks/{chunk-66N6C4EH.js → chunk-3WILPKTJ.js} +2 -2
  42. package/chunks/{chunk-SROLVJFY.js → chunk-3WWPEFMX.js} +1 -1
  43. package/chunks/{chunk-ZKIAGIGH.js → chunk-3XBUCOWS.js} +1 -1
  44. package/chunks/{chunk-737SVOO7.js → chunk-43Y26NPF.js} +3 -3
  45. package/chunks/{chunk-INGBUYL6.js → chunk-4FLUQWJ4.js} +1 -1
  46. package/chunks/{chunk-BTBJEB27.js → chunk-4JFLRHNE.js} +1 -1
  47. package/chunks/{chunk-MJHLKWGJ.js → chunk-4QPVZA5J.js} +70 -23
  48. package/chunks/{chunk-XX5HQLCZ.js → chunk-6OTF7TTE.js} +32 -1
  49. package/chunks/{chunk-4Y2I3CI3.js → chunk-6USYH3EU.js} +99 -6
  50. package/chunks/{chunk-Q3TFRP5G.js → chunk-7D4CV7JH.js} +102 -9
  51. package/chunks/{chunk-EWJTAP3Y.js → chunk-7O5PYQ3M.js} +20 -1
  52. package/chunks/chunk-ADN5KESB.js +28 -0
  53. package/chunks/chunk-AKRSSKUT.js +229 -0
  54. package/chunks/{chunk-IOXJX7XE.js → chunk-AQP3H22J.js} +1 -1
  55. package/chunks/{chunk-YP7QCE7X.js → chunk-AUX2FL5T.js} +24 -7
  56. package/chunks/{chunk-YGFJ6BRT.js → chunk-AZCTY64Z.js} +1 -1
  57. package/chunks/{chunk-5CDDYYNI.js → chunk-B5TJK7B3.js} +1 -1
  58. package/chunks/{chunk-7MKB7L25.js → chunk-B6RMK4ED.js} +4 -4
  59. package/chunks/{chunk-YH24ZJ65.js → chunk-BHG3H6OZ.js} +1 -1
  60. package/chunks/{chunk-BRPYJQDD.js → chunk-BHVF3R6B.js} +7 -5
  61. package/chunks/{chunk-HFJSQ4GL.js → chunk-BTICBRPL.js} +1 -1
  62. package/chunks/{chunk-KZCK5JUN.js → chunk-C3T6HPNM.js} +1 -1
  63. package/chunks/{chunk-UB2MATP5.js → chunk-CDDP4ONL.js} +164 -27
  64. package/chunks/{chunk-OL3TNHFM.js → chunk-CQPM66MG.js} +4 -4
  65. package/chunks/{chunk-WKVZES7O.js → chunk-CXONOVBN.js} +1 -1
  66. package/chunks/{chunk-6IHJLXNF.js → chunk-CXY6BICQ.js} +501 -479
  67. package/chunks/{chunk-I5QPDANL.js → chunk-D3KVGQUV.js} +1 -1
  68. package/chunks/{chunk-LMJSPC55.js → chunk-D7JMO2GP.js} +3 -7
  69. package/chunks/{chunk-CXXAZ2LZ.js → chunk-DC4ZNGH4.js} +1 -1
  70. package/chunks/{chunk-FMLBBXHB.js → chunk-DRAX5YAI.js} +2 -2
  71. package/chunks/{chunk-DOTF2PF2.js → chunk-DRD6VBNH.js} +1 -1
  72. package/chunks/chunk-DX6JTDMR.js +105 -0
  73. package/chunks/{chunk-HJAJ6MR6.js → chunk-E2VSBAFA.js} +53 -11
  74. package/chunks/{chunk-G7ZYRFHS.js → chunk-EIBECN2J.js} +3 -3
  75. package/chunks/{chunk-LWWRJRCD.js → chunk-ESBYWATJ.js} +1 -1
  76. package/chunks/{chunk-2PLQ3CXJ.js → chunk-FASYATAZ.js} +5 -7
  77. package/chunks/{chunk-3ADU34IF.js → chunk-FBY32737.js} +4 -4
  78. package/chunks/{chunk-SIDVJZWH.js → chunk-FCPJXKDG.js} +10 -7
  79. package/chunks/{chunk-5GXJBU7K.js → chunk-FEDFZBGR.js} +3 -3
  80. package/chunks/{chunk-CALVKIIG.js → chunk-FIJODK52.js} +3 -3
  81. package/chunks/{chunk-ZTVYMZBD.js → chunk-FX6PZBOV.js} +3 -3
  82. package/chunks/{chunk-L6DIANLD.js → chunk-G45B3INR.js} +1 -1
  83. package/chunks/{chunk-TATT2THJ.js → chunk-GI7SLDOI.js} +2 -2
  84. package/chunks/chunk-GJKP6XOB.js +1092 -0
  85. package/chunks/{chunk-I6YJZGHS.js → chunk-GSAOVDTH.js} +9 -9
  86. package/chunks/{chunk-7MIOAF77.js → chunk-H6L4NEAT.js} +1 -1
  87. package/chunks/{chunk-MJGJF6G6.js → chunk-HNFKYKHH.js} +103 -22
  88. package/chunks/{chunk-PN6D5LWJ.js → chunk-HX4WXX3H.js} +301 -138
  89. package/chunks/{chunk-HG46TTAG.js → chunk-HXUI5D4H.js} +1 -1
  90. package/chunks/{chunk-JF2CFBDK.js → chunk-HYHSMTRA.js} +4 -4
  91. package/chunks/{chunk-4DZMYFZA.js → chunk-IKBEIDOH.js} +14 -14
  92. package/chunks/{chunk-QEENIXYB.js → chunk-INN5ORKX.js} +1 -1
  93. package/chunks/{chunk-GNV2SFO7.js → chunk-IVFTLUZD.js} +26 -1
  94. package/chunks/{chunk-L2NII7PZ.js → chunk-IXO2OCIP.js} +2 -2
  95. package/chunks/{chunk-6MAHSVMB.js → chunk-K4XMAIRX.js} +30 -33
  96. package/chunks/{chunk-AYMSNIYL.js → chunk-KAYC5FBN.js} +5269 -2785
  97. package/chunks/chunk-KEM7MWS7.js +3541 -0
  98. package/chunks/{chunk-ADQUK6WA.js → chunk-KVC7HZWK.js} +1 -1
  99. package/chunks/{chunk-Z35OSDIT.js → chunk-KVQ3QL4K.js} +3 -3
  100. package/chunks/{chunk-7U5G6JXI.js → chunk-KWYTSSTJ.js} +105 -6
  101. package/chunks/{chunk-PZRAE65J.js → chunk-L2A5VBDL.js} +3019 -2352
  102. package/chunks/{chunk-WD6YQI5M.js → chunk-L3SNMEDW.js} +1 -1
  103. package/chunks/{chunk-BYUAT5OC.js → chunk-L7TJUPNR.js} +19 -3
  104. package/chunks/{chunk-ABNX6E6K.js → chunk-LFKXIOGC.js} +1 -1
  105. package/chunks/{chunk-NFQOOITE.js → chunk-LO2UWNO5.js} +2 -2
  106. package/chunks/{chunk-LWUTZKDU.js → chunk-M22WLKLI.js} +5 -5
  107. package/chunks/{chunk-54B2LTKP.js → chunk-M23GFJ5B.js} +24 -5
  108. package/chunks/{chunk-VGY2RGXL.js → chunk-M4U2LTD2.js} +1 -1
  109. package/chunks/{chunk-ZNI3YJHS.js → chunk-MFDKHGTD.js} +1 -1
  110. package/chunks/{chunk-R7OO56VZ.js → chunk-MMRGG6R4.js} +1 -1
  111. package/chunks/{chunk-E6IR653O.js → chunk-MO4XID7S.js} +1 -1
  112. package/chunks/{chunk-FZQQMVLB.js → chunk-NKTMUPHJ.js} +3 -6
  113. package/chunks/{chunk-V77DTVCM.js → chunk-NQ272MQG.js} +1 -1
  114. package/chunks/{chunk-TDFLM7BE.js → chunk-OALXNGUA.js} +6 -6
  115. package/chunks/{chunk-FBDHP23D.js → chunk-OSG23MR3.js} +1 -1
  116. package/chunks/{chunk-NJ2OFVUX.js → chunk-P42KMMU6.js} +860 -1
  117. package/chunks/{chunk-Y33TCKXL.js → chunk-PF7GAP6K.js} +60 -58
  118. package/chunks/{chunk-MQRLLBMQ.js → chunk-PPJSG2PU.js} +2 -2
  119. package/chunks/{chunk-EPVEPTI3.js → chunk-PZRXWQUA.js} +753 -18
  120. package/chunks/{chunk-OLN7QX4P.js → chunk-Q54O3EIA.js} +30 -28
  121. package/chunks/{chunk-DQH3EVAD.js → chunk-QGEISOJ2.js} +4 -4
  122. package/chunks/{chunk-3M4O2AY3.js → chunk-QHSOINX6.js} +2 -2
  123. package/chunks/{chunk-HIQEL7EM.js → chunk-QIPLWW6Q.js} +1 -1
  124. package/chunks/chunk-QMENOK5T.js +1246 -0
  125. package/chunks/chunk-QT6Z2IBF.js +347 -0
  126. package/chunks/{chunk-TBSCTWKF.js → chunk-RN6A53UJ.js} +25 -0
  127. package/chunks/{chunk-65BKWMMH.js → chunk-RRI764F7.js} +21 -19
  128. package/chunks/{chunk-YI2YCNSP.js → chunk-SENYKRII.js} +1 -1
  129. package/chunks/chunk-SFHX5G2S.js +2796 -0
  130. package/chunks/chunk-SK3RZOPS.js +34 -0
  131. package/chunks/{chunk-MD6KXINN.js → chunk-SOLRBF7L.js} +13 -9
  132. package/chunks/{chunk-6BCN3VOY.js → chunk-SSWTA7CH.js} +12 -12
  133. package/chunks/{chunk-IAS753HG.js → chunk-SYMXYRM5.js} +11 -2
  134. package/chunks/{chunk-FGROOEKM.js → chunk-TDKUXSJO.js} +34 -6
  135. package/chunks/{chunk-ZJ7JQUGY.js → chunk-TKF4JINY.js} +1 -1
  136. package/chunks/{chunk-RVK37FWG.js → chunk-TPY6HW55.js} +4 -4
  137. package/chunks/{chunk-EDB556X7.js → chunk-TRZ22SG5.js} +1 -1
  138. package/chunks/{chunk-7LG4MUUD.js → chunk-TXTCM3TC.js} +4 -4
  139. package/chunks/{chunk-5ODRE7E5.js → chunk-U4AASWUQ.js} +28 -12
  140. package/chunks/{chunk-WPMRT4AR.js → chunk-UQGRJTDK.js} +2 -2
  141. package/chunks/{chunk-JBS56C7O.js → chunk-UZSB57EV.js} +6 -8
  142. package/chunks/{chunk-S4M6BDNE.js → chunk-V4JJAVHQ.js} +2 -2
  143. package/chunks/chunk-VEXUA6DX.js +1026 -0
  144. package/chunks/{chunk-ME4JBHSB.js → chunk-VQDWCQOE.js} +2 -0
  145. package/chunks/{chunk-3XXDCC5C.js → chunk-VU3XMZ5I.js} +23 -4
  146. package/chunks/{chunk-RD2HAF25.js → chunk-WL36KHUQ.js} +6 -6
  147. package/chunks/{chunk-WYRSEVBQ.js → chunk-WNQIJTOP.js} +8 -8
  148. package/chunks/{chunk-GTBXQ5W2.js → chunk-WSJI6ODG.js} +99 -30
  149. package/chunks/{chunk-VN5G33G7.js → chunk-WZWTY7SG.js} +6 -6
  150. package/chunks/{chunk-EKMJR7M3.js → chunk-X7AYIXC7.js} +1 -1
  151. package/chunks/{chunk-IBRQG2MP.js → chunk-XAJZFGD2.js} +11 -11
  152. package/chunks/{chunk-VRQZESKP.js → chunk-XICCGDWF.js} +2 -2
  153. package/chunks/{chunk-OZ2KDR2L.js → chunk-Y2KJC55Y.js} +12 -7
  154. package/chunks/{chunk-2S2WIGCM.js → chunk-Y4NNIGYO.js} +1 -1
  155. package/chunks/{chunk-J7LBAKDH.js → chunk-YL3UJML3.js} +7 -7
  156. package/chunks/{chunk-GSS4SZNG.js → chunk-YP2K3WOS.js} +40 -56
  157. package/chunks/{chunk-ZZUXUBEB.js → chunk-YQQ2U7AS.js} +8 -5
  158. package/chunks/{chunk-FAWTMDX7.js → chunk-YXHY6BKS.js} +15 -0
  159. package/chunks/{chunk-VIV2I3R7.js → chunk-YZXSDPOQ.js} +140 -39
  160. package/chunks/{chunk-KZ63S3HX.js → chunk-ZFHKUQZ4.js} +3 -3
  161. package/chunks/{chunk-B6KSTADQ.js → chunk-ZMYKNKET.js} +6 -6
  162. package/chunks/{codex-subagent-executor-6M7TD3MF.js → codex-subagent-executor-AEAIQZDC.js} +48 -49
  163. package/chunks/{config-utils-TB4QERW7.js → config-utils-KX2YS725.js} +43 -46
  164. package/chunks/{contextCommand-BFQMDECM.js → contextCommand-RV6Y5LNJ.js} +41 -44
  165. package/chunks/{core-runtime-Z2QJJMHR.js → core-runtime-ZI4RTOJQ.js} +45 -48
  166. package/chunks/{create-sub-session-GE4U3D7C.js → create-sub-session-BBWFQARJ.js} +46 -48
  167. package/chunks/{daemon-NJB4PWZ7.js → daemon-INCM4VBX.js} +3 -1
  168. package/chunks/{daemon-git-worktree-guard-IPA22S72.js → daemon-git-worktree-guard-KECEMV6A.js} +39 -42
  169. package/chunks/{daemon-status-provider-2U5WPCCB.js → daemon-status-provider-NULJNAEV.js} +53 -56
  170. package/chunks/{daemon-trust-policy-GEIGMVDQ.js → daemon-trust-policy-S4KWGPV3.js} +47 -50
  171. package/chunks/{daemon-trust-policy-monitor-JETBW5FX.js → daemon-trust-policy-monitor-546N5ZVL.js} +47 -50
  172. package/chunks/{de-VGY3VNBU.js → de-6AVKPTXQ.js} +11 -0
  173. package/chunks/{deferred-core-runtime-LANRK77C.js → deferred-core-runtime-T23ZT443.js} +39 -42
  174. package/chunks/{dist-NIOJXMGY.js → dist-4P3ZJYGI.js} +1 -1
  175. package/chunks/{dist-VDLSBCLM.js → dist-7MGRENQ5.js} +1 -1
  176. package/chunks/{dist-SE4J6Z4O.js → dist-BNW423XT.js} +326 -77
  177. package/chunks/{dist-TFGETXFN.js → dist-CESMUYGN.js} +4 -4
  178. package/chunks/{dist-MPUZZOG5.js → dist-DBBOFWSC.js} +1 -1
  179. package/chunks/{dist-T6DDPDLQ.js → dist-G5UMXIGF.js} +1 -1
  180. package/chunks/{dist-PA7WPFVE.js → dist-UXVNLQHG.js} +3 -3
  181. package/chunks/{dist-GUB7QRYA.js → dist-VA4LREAQ.js} +2 -2
  182. package/chunks/{dist-2QYIVNS6.js → dist-XDRTR4QP.js} +1 -1
  183. package/chunks/{edit-QC63PJOZ.js → edit-CMSQB7NP.js} +27 -30
  184. package/chunks/{en-E5ZO5TZW.js → en-56QLKXS2.js} +23 -1
  185. package/chunks/{enter-worktree-CAARFWBI.js → enter-worktree-DA6A4XC5.js} +3 -3
  186. package/chunks/{enterPlanMode-5TMWDRXD.js → enterPlanMode-UDPMNESD.js} +27 -30
  187. package/chunks/{environment-TNQVM5B3.js → environment-TSQJUTPV.js} +42 -45
  188. package/chunks/{errors-KWDDLG7P.js → errors-RIVYJS6T.js} +41 -44
  189. package/chunks/{exit-worktree-JXGGUOBP.js → exit-worktree-4H6Z2VQI.js} +3 -3
  190. package/chunks/{exitPlanMode-CLEWPZIE.js → exitPlanMode-BYBBFN2T.js} +27 -30
  191. package/chunks/{fast-path-PMRLQT7J.js → fast-path-F2CYDDZ4.js} +4 -4
  192. package/chunks/{fast-path-settings-XDYX7X5Z.js → fast-path-settings-N2VGRGDJ.js} +2 -2
  193. package/chunks/{fr-UAZJJH5N.js → fr-EBUDHJL3.js} +11 -0
  194. package/chunks/{glob-3AK4KKCE.js → glob-Z2JMJKKN.js} +27 -30
  195. package/chunks/{goal-tools-FD6OCE6Q.js → goal-tools-HXVVLGCV.js} +27 -30
  196. package/chunks/{handleAutoUpdate-QUNNMMY6.js → handleAutoUpdate-FZP45KOR.js} +43 -46
  197. package/chunks/{i18n-DVN326VM.js → i18n-OTB62AKW.js} +40 -43
  198. package/chunks/{image-gen-5G2TQ3DY.js → image-gen-HIAZCB5T.js} +6 -7
  199. package/chunks/{initializer-JHEJBPVJ.js → initializer-4JXZEC4B.js} +47 -50
  200. package/chunks/{installationInfo-DYOI4I5U.js → installationInfo-2IJV5QKC.js} +39 -42
  201. package/chunks/{ja-2RITCMAJ.js → ja-NCDT4CGV.js} +11 -0
  202. package/chunks/{list-MW74DDMO.js → list-KQSQ4A5G.js} +50 -53
  203. package/chunks/{llm-HUDP76IA.js → llm-LSUBOJAR.js} +154 -974
  204. package/chunks/{llm-content-generator-KYD6ZEM6.js → llm-content-generator-MLIONRXE.js} +17 -12
  205. package/chunks/{loadedSettingsAdapter-RRAZOPRB.js → loadedSettingsAdapter-TZTTNRHI.js} +47 -50
  206. package/chunks/{loggingContentGenerator-MHE6Z2OZ.js → loggingContentGenerator-TUPEXFMM.js} +31 -34
  207. package/chunks/{loop-wakeup-VG6CGBQA.js → loop-wakeup-ZBVRI6VH.js} +1 -1
  208. package/chunks/{managed-npm-update-3G3O3T3R.js → managed-npm-update-WEA5XMFZ.js} +40 -43
  209. package/chunks/{mcp-JGLBFJQB.js → mcp-TFDTUPIA.js} +47 -50
  210. package/chunks/{model-configuration-EGWMLK4P.js → model-configuration-ZCAKKIOF.js} +48 -51
  211. package/chunks/{modelConfigUtils-H4WFGWQD.js → modelConfigUtils-J3ZPW7ZK.js} +41 -44
  212. package/chunks/{monitor-62V72TGX.js → monitor-CI7YE7MT.js} +29 -32
  213. package/chunks/{nonInteractiveCli-GYKHG7RX.js → nonInteractiveCli-GPT3TVOK.js} +96 -98
  214. package/chunks/{notebook-edit-HOJLHP3F.js → notebook-edit-3WCVRNGL.js} +27 -30
  215. package/chunks/{openaiContentGenerator-ZAJTUWVO.js → openaiContentGenerator-OGILGUZE.js} +12 -17
  216. package/chunks/{openaiResponsesContentGenerator-AWRYZLJU.js → openaiResponsesContentGenerator-NXOXUPFM.js} +45 -13
  217. package/chunks/{pidfile-CS7LHAN5.js → pidfile-GBTBIGHF.js} +39 -42
  218. package/chunks/{process-registry-X6ZCASEN.js → process-registry-7LAPI3ZB.js} +1 -1
  219. package/chunks/{processUtils-OWQU3JQM.js → processUtils-O4II3RYH.js} +2 -2
  220. package/chunks/{prompt-terminal-ledger-76P527XD.js → prompt-terminal-ledger-ILIXZI3E.js} +40 -43
  221. package/chunks/{pt-5ZF7ZQUV.js → pt-FYYFWYUC.js} +11 -0
  222. package/chunks/{qwenContentGenerator-QZCQ3UTX.js → qwenContentGenerator-I4LRYADV.js} +33 -36
  223. package/chunks/{qwenOAuth2-WIEUEFEY.js → qwenOAuth2-3J66TOT5.js} +6 -7
  224. package/chunks/{read-file-KR5BES2E.js → read-file-G4XKW2CS.js} +5 -9
  225. package/chunks/{record-artifact-PXMNP7GZ.js → record-artifact-L3CFJOMA.js} +2 -2
  226. package/chunks/{report-findings-W6GR7SYZ.js → report-findings-LY5HQY4K.js} +3 -3
  227. package/chunks/{resumeHistoryUtils-36NM5S3D.js → resumeHistoryUtils-YPJU4XFE.js} +44 -47
  228. package/chunks/{ripGrep-QGFIVODS.js → ripGrep-AAKMALLM.js} +7 -11
  229. package/chunks/{ru-7BNZFQKG.js → ru-RHEB3RNS.js} +11 -0
  230. package/chunks/{run-qwen-serve-UFEOUIDD.js → run-qwen-serve-ZVEKGS7Y.js} +177 -98
  231. package/chunks/{runtime-7LTR2C7Q.js → runtime-SJCRYNPA.js} +52 -55
  232. package/chunks/safe-mode-KLGUG54M.js +11 -0
  233. package/chunks/sandbox-UIXL423Z.js +146 -0
  234. package/chunks/sandboxConfig-CY343YNJ.js +114 -0
  235. package/chunks/{scheduled-tasks-MV22T3JO.js → scheduled-tasks-5UGBEVNZ.js} +50 -53
  236. package/chunks/{scheduler-HSNQ53ML.js → scheduler-GCZYLZ2P.js} +41 -44
  237. package/chunks/{sdk-exporters-http-3R2TRQHE.js → sdk-exporters-http-DR4G663K.js} +1 -1
  238. package/chunks/{sdk-impl-4WF3VZ2F.js → sdk-impl-SJR26MQF.js} +3 -3
  239. package/chunks/{send-message-UMJKN27Q.js → send-message-DN76MXDX.js} +6 -6
  240. package/chunks/{serve-LDD4FEJQ.js → serve-2XXQLVK2.js} +48 -51
  241. package/chunks/{server-IKTZFW3E.js → server-UHMKPCAZ.js} +408 -211
  242. package/chunks/{session-T77EXOOI.js → session-ZLUK7E4P.js} +108 -108
  243. package/chunks/{session-attachments-root-FBASBVAO.js → session-attachments-root-DHQM5IEZ.js} +39 -42
  244. package/chunks/{session-pr-refresh-2BHKIMIN.js → session-pr-refresh-3OMTQWCZ.js} +48 -51
  245. package/chunks/{settings-TJNUFBGG.js → settings-P4DHIIUP.js} +50 -53
  246. package/chunks/{shell-HDI5VPGD.js → shell-IMFUVQQ5.js} +27 -30
  247. package/chunks/{skill-VTA6FNDX.js → skill-NB5RJGZW.js} +7 -11
  248. package/chunks/{skill-settings-K4LSGCKA.js → skill-settings-IXG5CTQO.js} +47 -50
  249. package/chunks/{spawnChannel-YSGSPD5D.js → spawnChannel-Q3YALTCJ.js} +44 -45
  250. package/chunks/{standalone-update-O5LYCCMB.js → standalone-update-H5OJ7MM7.js} +41 -44
  251. package/chunks/{start-opentui-ui-CS6HKYCE.js → start-opentui-ui-JKAIWGF7.js} +733 -386
  252. package/chunks/{startInteractiveUI-IVP5HEDD.js → startInteractiveUI-YRPOT6GH.js} +370 -337
  253. package/chunks/task-create-75HVPEAH.js +1 -1
  254. package/chunks/{team-create-DW4KE2PR.js → team-create-2XTBYRJF.js} +31 -34
  255. package/chunks/{team-plan-approval-33UL4JDG.js → team-plan-approval-CFNWW7ZQ.js} +27 -30
  256. package/chunks/{terminal-image-renderer-4FK76L22.js → terminal-image-renderer-UDPJPGPQ.js} +39 -42
  257. package/chunks/{theme-manager-UQ3EKEJ4.js → theme-manager-SK57EKMO.js} +39 -42
  258. package/chunks/{tool-search-QUOG6M6M.js → tool-search-ZHTJU2MV.js} +5 -9
  259. package/chunks/{total-session-admission-QRWPWSK5.js → total-session-admission-UUZBDQCG.js} +47 -50
  260. package/chunks/{tree-sitter-ALGO6NDO.js → tree-sitter-4D7QS7F6.js} +1 -1
  261. package/chunks/{tree-sitter-bash-H6YH7EBF.js → tree-sitter-bash-VEJGF5XF.js} +1 -1
  262. package/chunks/{trustedFolders-HESP75BK.js → trustedFolders-4LDBLNTS.js} +40 -43
  263. package/chunks/{update-relaunch-YROJ7A26.js → update-relaunch-LI7GRP36.js} +5 -5
  264. package/chunks/{updateCheck-CUKTRHID.js → updateCheck-PKSSORPO.js} +43 -46
  265. package/chunks/{useAutoAcceptIndicator-BQGSRBHX.js → useAutoAcceptIndicator-I32UEQPI.js} +50 -53
  266. package/chunks/{validateNonInterActiveAuth-UM5U2ZZI.js → validateNonInterActiveAuth-YFPCYYNL.js} +93 -95
  267. package/chunks/{version-A6G2KO4K.js → version-4MTL4JVU.js} +1 -1
  268. package/chunks/{web-fetch-A3RMCVQY.js → web-fetch-O6RG6ISB.js} +9 -13
  269. package/chunks/{web-search-3XGJ773E.js → web-search-JHAXVEMD.js} +9 -14
  270. package/chunks/{web-shell-static-T7UGLVE4.js → web-shell-static-FFWCUUZS.js} +8 -4
  271. package/chunks/{workflow-4TWAFNIB.js → workflow-O7L6VDYU.js} +396 -113
  272. package/chunks/{workspace-providers-status-GNTJ4OIZ.js → workspace-providers-status-WRX6CJM4.js} +53 -56
  273. package/chunks/{workspace-registration-store-D3K34O63.js → workspace-registration-store-7G4E7YPY.js} +1 -1
  274. package/chunks/{workspace-registry-ZE5ZSWNF.js → workspace-registry-SXIMGT4D.js} +47 -50
  275. package/chunks/{workspace-runtime-coordinator-DEXM2635.js → workspace-runtime-coordinator-7DOEHXYT.js} +47 -50
  276. package/chunks/{workspace-service-OGYORPWD.js → workspace-service-HDXOZMYC.js} +53 -56
  277. package/chunks/{workspace-skills-status-4W4H3BGJ.js → workspace-skills-status-VN4L37CA.js} +50 -53
  278. package/chunks/{workspace-trust-reconciler-BHR7S7UJ.js → workspace-trust-reconciler-XEBW5FUL.js} +57 -60
  279. package/chunks/{write-file-EP5AEO5E.js → write-file-LKX4ETIO.js} +29 -32
  280. package/chunks/{zh-V2EYTYJP.js → zh-F76MZTL3.js} +23 -1
  281. package/chunks/{zh-TW-7PRVUGLW.js → zh-TW-S3YTQ4DS.js} +23 -1
  282. package/chunks/{zoom-image-DDEGWG3R.js → zoom-image-RDPRTP4B.js} +5 -9
  283. package/cli.js +19 -15
  284. package/export-transcript-document.css +1 -1
  285. package/export-transcript-document.js +151 -150
  286. package/locales/ca.js +19 -2
  287. package/locales/de.js +18 -0
  288. package/locales/en.js +33 -2
  289. package/locales/fr.js +18 -0
  290. package/locales/ja.js +18 -0
  291. package/locales/pt.js +18 -0
  292. package/locales/ru.js +18 -0
  293. package/locales/zh-TW.js +33 -2
  294. package/locales/zh.js +33 -2
  295. package/package.json +3 -3
  296. package/web-shell/assets/{abnfDiagram-VCTEODGH-BtpzKw3A.js → abnfDiagram-VCTEODGH-RxykUDmi.js} +1 -1
  297. package/web-shell/assets/{arc-CQiVKZJP.js → arc-CZpgGCJC.js} +1 -1
  298. package/web-shell/assets/{architectureDiagram-5GKGNRK7-ekIPBb2d.js → architectureDiagram-5GKGNRK7-BHSMzNDT.js} +1 -1
  299. package/web-shell/assets/{blockDiagram-NRAW4CY4-BrRWkWri.js → blockDiagram-NRAW4CY4-Bn4mF9SZ.js} +1 -1
  300. package/web-shell/assets/{c4Diagram-UCG6FXSJ-qYS8CYZ3.js → c4Diagram-UCG6FXSJ-CBM-Bj6t.js} +1 -1
  301. package/web-shell/assets/channel-DFYs_LlK.js +1 -0
  302. package/web-shell/assets/{chunk-2Q5K7J3B-ZasyyEZm.js → chunk-2Q5K7J3B-D5Fin58O.js} +1 -1
  303. package/web-shell/assets/{chunk-5VM5RSS4-C_IzCGeA.js → chunk-5VM5RSS4-CY05weF7.js} +1 -1
  304. package/web-shell/assets/{chunk-F27PBJKO-C25NZOyD.js → chunk-F27PBJKO-3neZnj5Y.js} +1 -1
  305. package/web-shell/assets/{chunk-G27WJ6UU-XPOHNSGX.js → chunk-G27WJ6UU-Cd7EU4BE.js} +1 -1
  306. package/web-shell/assets/{chunk-JWPE2WC7-BQBh0Xni.js → chunk-JWPE2WC7-DwK1mqFw.js} +1 -1
  307. package/web-shell/assets/{chunk-LCL6LL3I-CoShjpX7.js → chunk-LCL6LL3I-Sl7vY22C.js} +1 -1
  308. package/web-shell/assets/{chunk-POPQ4Y6H-BwRmCDSz.js → chunk-POPQ4Y6H-BXNzpbVg.js} +1 -1
  309. package/web-shell/assets/{chunk-SVP7TREG-DSzE5-Mw.js → chunk-SVP7TREG-DjjButcp.js} +1 -1
  310. package/web-shell/assets/{chunk-XXDRQBXY-BQSQv30h.js → chunk-XXDRQBXY-DNOiCjOJ.js} +1 -1
  311. package/web-shell/assets/classDiagram-DTDB5LWJ-DnGrKXoM.js +1 -0
  312. package/web-shell/assets/classDiagram-v2-JRS7N3AN-DnGrKXoM.js +1 -0
  313. package/web-shell/assets/{cose-bilkent-JH36ORCC-XVUVTHVo.js → cose-bilkent-JH36ORCC-BUnker7a.js} +1 -1
  314. package/web-shell/assets/{cynefin-OW5HDTMX-CrsKx4lQ.js → cynefin-OW5HDTMX-DcUgdWE5.js} +1 -1
  315. package/web-shell/assets/{cynefinDiagram-5FMLGOSQ-BPeZEuHw.js → cynefinDiagram-5FMLGOSQ-CvDKsZsL.js} +1 -1
  316. package/web-shell/assets/{dagre-3AP2YEHR-D31cQ2Qs.js → dagre-3AP2YEHR-jpCmUbr1.js} +1 -1
  317. package/web-shell/assets/{diagram-S7CK7UJ4-zyiG097Q.js → diagram-S7CK7UJ4-DBe_bKE5.js} +1 -1
  318. package/web-shell/assets/{diagram-UQ7AKVKN-Br3vtfsy.js → diagram-UQ7AKVKN-oXvPpDgs.js} +1 -1
  319. package/web-shell/assets/{diagram-VSXAHHWV-Bxkhjx4u.js → diagram-VSXAHHWV-BD7-_SGh.js} +1 -1
  320. package/web-shell/assets/{diagram-VX7I27RA-BQH8QiDk.js → diagram-VX7I27RA-DOJL0wub.js} +1 -1
  321. package/web-shell/assets/{diagram-Z3DM3KII-B_aQ1cw0.js → diagram-Z3DM3KII-DRIiodDD.js} +1 -1
  322. package/web-shell/assets/{ebnfDiagram-PWID7BFC-B9N7BRQE.js → ebnfDiagram-PWID7BFC-Db31Ulmb.js} +1 -1
  323. package/web-shell/assets/{erDiagram-SSCWMZ5O-Cx6Hb1Re.js → erDiagram-SSCWMZ5O-CVHhwI2_.js} +1 -1
  324. package/web-shell/assets/{flowDiagram-A5DVABFB-DTuLP7GU.js → flowDiagram-A5DVABFB-DWOFy1FK.js} +1 -1
  325. package/web-shell/assets/{ganttDiagram-EL5Y4UJY-DYS3d-sL.js → ganttDiagram-EL5Y4UJY-C0sxQtPd.js} +1 -1
  326. package/web-shell/assets/{gitGraphDiagram-WWUBYQGX-Cp0EGx04.js → gitGraphDiagram-WWUBYQGX-CNituBYC.js} +1 -1
  327. package/web-shell/assets/index-B15NlwB8.js +2213 -0
  328. package/web-shell/assets/index-BSrS0tQ6.css +36 -0
  329. package/web-shell/assets/{index-45-LkPDB.js → index-gm9tLk7h.js} +1 -1
  330. package/web-shell/assets/{infoDiagram-RXCK75RN-9--kukiT.js → infoDiagram-RXCK75RN-CxhJYtIR.js} +1 -1
  331. package/web-shell/assets/{ishikawaDiagram-5VMMS53U-CGBdsDLD.js → ishikawaDiagram-5VMMS53U-By2mchUy.js} +1 -1
  332. package/web-shell/assets/{journeyDiagram-EYS64GPL-DeXhcscd.js → journeyDiagram-EYS64GPL-CVH-OweI.js} +1 -1
  333. package/web-shell/assets/{kanban-definition-3QL26DDD-CFdvsU3b.js → kanban-definition-3QL26DDD-Cc9dQXLy.js} +1 -1
  334. package/web-shell/assets/knowledge-Dg9788h4.svg +1 -0
  335. package/web-shell/assets/{layout-DAnwQ3KB.js → layout-C_60ysHw.js} +1 -1
  336. package/web-shell/assets/{linear-CTo7v7Nh.js → linear-BvAVfqwu.js} +1 -1
  337. package/web-shell/assets/{mermaid.core-jggSxF1i.js → mermaid.core-C3CoBKAc.js} +6 -6
  338. package/web-shell/assets/{mindmap-definition-FBJOCRG2-DzIepvlJ.js → mindmap-definition-FBJOCRG2-Cuu8Q8LM.js} +1 -1
  339. package/web-shell/assets/{pegDiagram-XKGWAZYB-BFGS9GJv.js → pegDiagram-XKGWAZYB-DmAeyDO2.js} +1 -1
  340. package/web-shell/assets/{pieDiagram-E7YTZNPT-B2UUcNIT.js → pieDiagram-E7YTZNPT-B7vbB_xv.js} +1 -1
  341. package/web-shell/assets/{quadrantDiagram-AXDQQJYC-BgM6htrX.js → quadrantDiagram-AXDQQJYC-BqOBkRR7.js} +1 -1
  342. package/web-shell/assets/{railroadDiagram-O6MQD6OU-Dk9cS7N-.js → railroadDiagram-O6MQD6OU-sI06lZIu.js} +1 -1
  343. package/web-shell/assets/{requirementDiagram-EFPCY7ZU-C9oRg7xi.js → requirementDiagram-EFPCY7ZU-Bg13d10S.js} +1 -1
  344. package/web-shell/assets/{sankeyDiagram-P5KCCOFB-B-_c7GzI.js → sankeyDiagram-P5KCCOFB-WFOzZHrR.js} +1 -1
  345. package/web-shell/assets/{sequenceDiagram-WJ2MYXX4-R0M-347u.js → sequenceDiagram-WJ2MYXX4-CCdRbA4E.js} +1 -1
  346. package/web-shell/assets/{sizeCapture-X5ZJPWSS-Df0f8UAW.js → sizeCapture-X5ZJPWSS-BH5F3bGg.js} +1 -1
  347. package/web-shell/assets/{stateDiagram-HBIQ2CUA-CsUEfAA-.js → stateDiagram-HBIQ2CUA-NwS2X3QB.js} +1 -1
  348. package/web-shell/assets/stateDiagram-v2-4QOOHH4V-1aU2JZXO.js +1 -0
  349. package/web-shell/assets/{swimlanes-XN3QIQJK-9OGHVSrx.js → swimlanes-XN3QIQJK-Bm38pM28.js} +1 -1
  350. package/web-shell/assets/swimlanesDiagram-VK2B7HYN-Dp-u6kQG.js +8 -0
  351. package/web-shell/assets/{timeline-definition-24CTP7MA-DAfGqS2B.js → timeline-definition-24CTP7MA-Do-agLSo.js} +1 -1
  352. package/web-shell/assets/{vennDiagram-4TSXK5OY-CKATpwHi.js → vennDiagram-4TSXK5OY-aggLfZzl.js} +1 -1
  353. package/web-shell/assets/{wardleyDiagram-VM6X3IG4-CQHdhTrm.js → wardleyDiagram-VM6X3IG4-D5JR3mXX.js} +1 -1
  354. package/web-shell/assets/{xychartDiagram-S5SC5T6Z-5k9NLqlY.js → xychartDiagram-S5SC5T6Z-DhtLDuXs.js} +1 -1
  355. package/web-shell/index.html +2 -2
  356. package/chunks/chunk-7MIBD3LG.js +0 -137
  357. package/chunks/chunk-ARDHE6MM.js +0 -235
  358. package/chunks/chunk-C75BXMPM.js +0 -169
  359. package/chunks/chunk-ERU3SDXT.js +0 -27
  360. package/chunks/chunk-FPGTNKCP.js +0 -251
  361. package/chunks/chunk-JL6APGBX.js +0 -43
  362. package/chunks/chunk-L5OBTAXN.js +0 -137
  363. package/chunks/chunk-MZ3W3F44.js +0 -4172
  364. package/chunks/chunk-OIDF7L67.js +0 -514
  365. package/chunks/chunk-VSXX6VUI.js +0 -2812
  366. package/chunks/chunk-ZFYACOVD.js +0 -1416
  367. package/web-shell/assets/channel-DSQQnOZj.js +0 -1
  368. package/web-shell/assets/classDiagram-DTDB5LWJ-V94ta08R.js +0 -1
  369. package/web-shell/assets/classDiagram-v2-JRS7N3AN-V94ta08R.js +0 -1
  370. package/web-shell/assets/index-H8um-iEl.js +0 -2207
  371. package/web-shell/assets/index-n6N-2a3v.css +0 -36
  372. package/web-shell/assets/stateDiagram-v2-4QOOHH4V-CnSuTPJ2.js +0 -1
  373. package/web-shell/assets/swimlanesDiagram-VK2B7HYN-Bb7TcWQw.js +0 -8
  374. package/chunks/{chunk-QZW6WRB7.js → chunk-5NUKK2DT.js} +2 -2
  375. package/chunks/{chunk-JS73NNWF.js → chunk-FUSEMYFX.js} +0 -0
  376. package/chunks/{chunk-SVWWF5TZ.js → chunk-WVURIAEE.js} +3 -3
  377. package/chunks/{task-update-RI7QNVDP.js → task-update-3LSYQDRW.js} +4 -4
@@ -1,15 +1,18 @@
1
1
  // Force strict mode and setup for ESM
2
2
  "use strict";
3
+ import {
4
+ recomputeMcpGating
5
+ } from "./chunk-ZFHKUQZ4.js";
3
6
  import {
4
7
  PeerMessaging,
5
8
  classifyApiError
6
- } from "./chunk-I5QPDANL.js";
7
- import {
8
- fireSessionDeleteHook
9
- } from "./chunk-L34XSHIZ.js";
9
+ } from "./chunk-D3KVGQUV.js";
10
10
  import {
11
11
  normalizePartList
12
12
  } from "./chunk-5IENVM7Z.js";
13
+ import {
14
+ fireSessionDeleteHook
15
+ } from "./chunk-L34XSHIZ.js";
13
16
  import {
14
17
  EXTENSION_CONTEXT_BUDGET,
15
18
  buildExtensionMentionContext,
@@ -19,20 +22,18 @@ import {
19
22
  matchMcpServerByRef,
20
23
  parseExtensionRef,
21
24
  parseMcpServerRef
22
- } from "./chunk-WYRSEVBQ.js";
25
+ } from "./chunk-WNQIJTOP.js";
23
26
  import {
24
27
  getAvailableCommands,
25
28
  getSlashCommandFirstToken,
26
29
  handleSlashCommand,
27
30
  insertAfterFunctionResponses,
31
+ isCrossSessionMessagingEnabled,
28
32
  isSlashCommand,
29
33
  pLimit,
30
34
  recordDaemonSessionModel,
31
35
  restoreSessionModelThenAuthenticate
32
- } from "./chunk-PN6D5LWJ.js";
33
- import {
34
- recomputeMcpGating
35
- } from "./chunk-KZ63S3HX.js";
36
+ } from "./chunk-HX4WXX3H.js";
36
37
  import {
37
38
  SessionIdConflictError,
38
39
  appEvents,
@@ -42,44 +43,45 @@ import {
42
43
  loadCliConfig,
43
44
  normalizeDisabledToolList,
44
45
  parseApprovalModeValue
45
- } from "./chunk-6IHJLXNF.js";
46
- import {
47
- getCommandSubcommandNames,
48
- getEffectiveSupportedModes
49
- } from "./chunk-OZ2KDR2L.js";
50
- import "./chunk-YGFJ6BRT.js";
46
+ } from "./chunk-CXY6BICQ.js";
51
47
  import "./chunk-NYX53SV4.js";
52
- import "./chunk-FBDHP23D.js";
53
48
  import {
54
49
  collectContextData,
55
50
  formatContextUsageText
56
- } from "./chunk-RVK37FWG.js";
57
- import "./chunk-4WGODMVR.js";
51
+ } from "./chunk-TPY6HW55.js";
58
52
  import {
59
- startNonInteractiveOpenAILogHousekeeping
60
- } from "./chunk-IP6NRULS.js";
61
- import "./chunk-KW7NOTN6.js";
62
- import "./chunk-2XRE4KE4.js";
63
- import "./chunk-5CDDYYNI.js";
53
+ getCommandSubcommandNames,
54
+ getEffectiveSupportedModes
55
+ } from "./chunk-Y2KJC55Y.js";
56
+ import "./chunk-OSG23MR3.js";
57
+ import "./chunk-4WGODMVR.js";
58
+ import "./chunk-AZCTY64Z.js";
64
59
  import {
65
60
  isGoalStatusKind
66
61
  } from "./chunk-EKTCKZV5.js";
67
- import "./chunk-WPMRT4AR.js";
62
+ import "./chunk-2XRE4KE4.js";
63
+ import {
64
+ startNonInteractiveOpenAILogHousekeeping
65
+ } from "./chunk-3HTUE6ZR.js";
66
+ import "./chunk-KW7NOTN6.js";
67
+ import "./chunk-FBY32737.js";
68
+ import "./chunk-B6RMK4ED.js";
69
+ import "./chunk-QT6Z2IBF.js";
70
+ import "./chunk-UQGRJTDK.js";
68
71
  import "./chunk-YAF2MQZ6.js";
72
+ import "./chunk-B5TJK7B3.js";
69
73
  import {
70
74
  computeCpuPercent
71
75
  } from "./chunk-LBOVL47Y.js";
72
76
  import "./chunk-24FVUD5P.js";
73
- import "./chunk-B6KSTADQ.js";
77
+ import "./chunk-ZMYKNKET.js";
74
78
  import "./chunk-6H67XLET.js";
75
79
  import {
76
80
  beginAcpBootstrapConfigProfiling,
77
81
  buildAndFreezeAcpStartupProfile,
78
82
  endAcpBootstrapConfigProfiling,
79
83
  markAcpStartup
80
- } from "./chunk-DOTF2PF2.js";
81
- import "./chunk-3ADU34IF.js";
82
- import "./chunk-7MKB7L25.js";
84
+ } from "./chunk-DRD6VBNH.js";
83
85
  import {
84
86
  GENERATION_MAX_PROMPT_BYTES,
85
87
  GENERATION_TIMEOUT_MS,
@@ -100,7 +102,7 @@ import {
100
102
  shouldSuppressRememberErrorDetails,
101
103
  workspaceMemoryFailureCode,
102
104
  workspaceMemoryFailureDiagnostics
103
- } from "./chunk-BRPYJQDD.js";
105
+ } from "./chunk-BHVF3R6B.js";
104
106
  import {
105
107
  BaseEmitter,
106
108
  HistoryReplayer,
@@ -111,11 +113,11 @@ import {
111
113
  hasFullSessionContext,
112
114
  observeAcpToolResultProjection,
113
115
  observeAcpToolResultWire
114
- } from "./chunk-MJGJF6G6.js";
116
+ } from "./chunk-HNFKYKHH.js";
115
117
  import "./chunk-M3JGHRMQ.js";
116
118
  import "./chunk-VFFQAOPR.js";
117
- import "./chunk-2S2WIGCM.js";
118
119
  import "./chunk-47ECGEJC.js";
120
+ import "./chunk-Y4NNIGYO.js";
119
121
  import "./chunk-2MIN6GRR.js";
120
122
  import "./chunk-QHTIBUWB.js";
121
123
  import "./chunk-TXASDT2M.js";
@@ -136,12 +138,13 @@ import {
136
138
  isReservedStandaloneSessionSourceType,
137
139
  parseSessionSource
138
140
  } from "./chunk-N4QWUPDM.js";
141
+ import "./chunk-7D4CV7JH.js";
139
142
  import {
140
143
  buildScheduledTaskRunPrompt,
141
144
  normalizeChannelDeliveryText,
142
145
  scheduledTaskRunSessionName,
143
146
  scheduledTaskRunSourceId
144
- } from "./chunk-DQH3EVAD.js";
147
+ } from "./chunk-QGEISOJ2.js";
145
148
  import {
146
149
  normalizeSessionIdForLookup,
147
150
  parseCallerSuppliedSessionId
@@ -152,16 +155,19 @@ import {
152
155
  buildPermissionSettings,
153
156
  normalizePermissionRules,
154
157
  readPermissionRuleSet
155
- } from "./chunk-YH24ZJ65.js";
158
+ } from "./chunk-BHG3H6OZ.js";
156
159
  import {
157
160
  MAX_AUDIO_BYTES,
158
161
  sanitizeVoiceErrorMessage,
159
162
  transcribeVoiceAudio
160
- } from "./chunk-E6IR653O.js";
163
+ } from "./chunk-MO4XID7S.js";
161
164
  import {
162
165
  readVoiceModel
163
- } from "./chunk-ADQUK6WA.js";
166
+ } from "./chunk-KVC7HZWK.js";
164
167
  import "./chunk-Y53DG2HA.js";
168
+ import "./chunk-FX6PZBOV.js";
169
+ import "./chunk-3LLEB5CU.js";
170
+ import "./chunk-FUSEMYFX.js";
165
171
  import {
166
172
  PERSIST_REASONING_SELECTION_META_KEY,
167
173
  REASONING_EFFORT_DEFAULT,
@@ -170,37 +176,48 @@ import {
170
176
  REASONING_SELECTION_PERSISTED_META_KEY,
171
177
  applyReasoningSelection,
172
178
  buildModelReasoningConfigOption,
173
- buildModelReasoningConfigPreview,
179
+ buildModelReasoningRoutePreview,
174
180
  clearReasoningRequestOverrides,
175
181
  getConfiguredModelReasoning,
176
182
  getDefaultReasoningConfig,
177
183
  getGptReasoningOverrideState,
178
184
  isReasoningSelectionSupported,
179
- parseReasoningSelection,
180
- resolvePersistedReasoningConfigState
181
- } from "./chunk-MJHLKWGJ.js";
185
+ parseReasoningSelection
186
+ } from "./chunk-4QPVZA5J.js";
187
+ import "./chunk-UZSB57EV.js";
188
+ import {
189
+ ACP_ROUTE_ID_PREFIX,
190
+ buildAcpModelOptions,
191
+ getCurrentAcpModelId,
192
+ parseAcpBaseModelId,
193
+ parseAcpModelOption,
194
+ resolveAcpModelOption,
195
+ sanitizeProviderBaseUrl
196
+ } from "./chunk-4FLUQWJ4.js";
182
197
  import {
183
198
  mapSkillConfigToStatus
184
- } from "./chunk-ZJ7JQUGY.js";
199
+ } from "./chunk-TKF4JINY.js";
185
200
  import {
186
201
  resolveSkillSettings
187
- } from "./chunk-LMJSPC55.js";
188
- import "./chunk-Q3TFRP5G.js";
202
+ } from "./chunk-D7JMO2GP.js";
203
+ import "./chunk-WZWTY7SG.js";
204
+ import "./chunk-E2VSBAFA.js";
205
+ import "./chunk-57OAHC2Y.js";
206
+ import "./chunk-SYMXYRM5.js";
207
+ import "./chunk-U4AASWUQ.js";
208
+ import "./chunk-LFKXIOGC.js";
189
209
  import {
190
210
  createLoadedSettingsAdapter
191
- } from "./chunk-CALVKIIG.js";
192
- import "./chunk-ZTVYMZBD.js";
193
- import "./chunk-B2VSRPS6.js";
194
- import "./chunk-JS73NNWF.js";
211
+ } from "./chunk-FIJODK52.js";
195
212
  import {
196
213
  SCHEDULED_TASK_RUN_SOURCE_TYPE
197
- } from "./chunk-PZRAE65J.js";
198
- import "./chunk-7U5G6JXI.js";
214
+ } from "./chunk-L2A5VBDL.js";
215
+ import "./chunk-KWYTSSTJ.js";
199
216
  import "./chunk-WCCLLK7X.js";
200
217
  import "./chunk-OCPBI7J5.js";
201
218
  import {
202
219
  ndJsonStream
203
- } from "./chunk-2YMRRI2C.js";
220
+ } from "./chunk-2C5TR6HN.js";
204
221
  import "./chunk-LYD3T3H7.js";
205
222
  import {
206
223
  ACP_PREFLIGHT_KINDS,
@@ -209,23 +226,7 @@ import {
209
226
  SERVE_STATUS_EXT_METHODS,
210
227
  STATUS_SCHEMA_VERSION,
211
228
  mapDomainErrorToErrorKind
212
- } from "./chunk-54B2LTKP.js";
213
- import "./chunk-JBS56C7O.js";
214
- import {
215
- ACP_ROUTE_ID_PREFIX,
216
- buildAcpModelOptions,
217
- getCurrentAcpModelId,
218
- parseAcpBaseModelId,
219
- parseAcpModelOption,
220
- resolveAcpModelOption,
221
- sanitizeProviderBaseUrl
222
- } from "./chunk-INGBUYL6.js";
223
- import "./chunk-VN5G33G7.js";
224
- import "./chunk-HJAJ6MR6.js";
225
- import "./chunk-57OAHC2Y.js";
226
- import "./chunk-IAS753HG.js";
227
- import "./chunk-5ODRE7E5.js";
228
- import "./chunk-ABNX6E6K.js";
229
+ } from "./chunk-M23GFJ5B.js";
229
230
  import "./chunk-V6WHFGST.js";
230
231
  import {
231
232
  ACTIVE_WORK_CLOSE_IF_UNHELD_PARAM,
@@ -268,20 +269,21 @@ import {
268
269
  WORKTREE_MCP_DEFER_META_KEY,
269
270
  clampActiveWorkIntervalMs,
270
271
  isValidTrustedModelPrompt
271
- } from "./chunk-TBSCTWKF.js";
272
+ } from "./chunk-RN6A53UJ.js";
272
273
  import {
273
274
  NOT_CURRENTLY_GENERATING_CANCEL_MESSAGE,
274
275
  isNotCurrentlyGeneratingCancelError
275
- } from "./chunk-FAWTMDX7.js";
276
+ } from "./chunk-YXHY6BKS.js";
276
277
  import "./chunk-6PLDPT2C.js";
277
278
  import "./chunk-FYJ7W2PI.js";
278
279
  import "./chunk-STUJ7IMZ.js";
280
+ import "./chunk-L3SNMEDW.js";
279
281
  import "./chunk-GYTKQYDB.js";
280
- import "./chunk-WD6YQI5M.js";
281
282
  import "./chunk-GDWE23OR.js";
282
- import "./chunk-RKFGE7JH.js";
283
283
  import "./chunk-CJ3DHN5I.js";
284
+ import "./chunk-RKFGE7JH.js";
284
285
  import "./chunk-UDG5EZJI.js";
286
+ import "./chunk-M5GB774H.js";
285
287
  import {
286
288
  EXTERNAL_TOOL_GUARD_READY_META_KEY,
287
289
  EXTERNAL_TOOL_GUARD_REQUIRED_VALUE,
@@ -291,13 +293,16 @@ import {
291
293
  SHELL_EXECUTING_TOOL_NAMES,
292
294
  isValidExternalToolGuardDenialReason
293
295
  } from "./chunk-3VUENPWF.js";
294
- import "./chunk-M5GB774H.js";
295
296
  import "./chunk-NFXXBWSE.js";
296
- import "./chunk-LWWRJRCD.js";
297
+ import "./chunk-ESBYWATJ.js";
297
298
  import {
298
299
  ACP_EVENT_LOOP_STALL_RESTART_MS,
299
- CHANNEL_PROMPT_META_KEY
300
- } from "./chunk-EPVEPTI3.js";
300
+ CHANNEL_OUTPUT_MODE_META_KEY,
301
+ CHANNEL_PROMPT_META_KEY,
302
+ CHANNEL_TASK_OUTPUT_META_KEY,
303
+ CHANNEL_TASK_RESULT_META_KEY,
304
+ CHANNEL_TASK_RESULT_PARTIAL_META_KEY
305
+ } from "./chunk-PZRXWQUA.js";
301
306
  import {
302
307
  AgentSideConnection,
303
308
  PROTOCOL_VERSION,
@@ -306,7 +311,7 @@ import {
306
311
  import {
307
312
  assembleMcpServers,
308
313
  loadMcpApprovals
309
- } from "./chunk-RD2HAF25.js";
314
+ } from "./chunk-WL36KHUQ.js";
310
315
  import {
311
316
  deleteNestedPropertySafe,
312
317
  getOutputLanguageFilePath,
@@ -318,13 +323,18 @@ import {
318
323
  settingExistsInScope,
319
324
  updateOutputLanguageFile,
320
325
  writeOutputLanguageAndRegisterPath
321
- } from "./chunk-65BKWMMH.js";
322
- import "./chunk-YP7QCE7X.js";
326
+ } from "./chunk-RRI764F7.js";
323
327
  import "./chunk-RKUWKYED.js";
328
+ import "./chunk-AUX2FL5T.js";
329
+ import "./chunk-BW4333PP.js";
330
+ import {
331
+ getSystemDefaultsPath,
332
+ getSystemSettingsPath
333
+ } from "./chunk-IDS7MSUP.js";
324
334
  import {
325
335
  getCurrentLanguage,
326
336
  setLanguageAsync
327
- } from "./chunk-I6YJZGHS.js";
337
+ } from "./chunk-GSAOVDTH.js";
328
338
  import {
329
339
  SUPPORTED_LANGUAGES
330
340
  } from "./chunk-5EJZE3FP.js";
@@ -332,26 +342,16 @@ import {
332
342
  findEnvFiles,
333
343
  preResolveHomeEnvOverrides,
334
344
  reloadEnvironment
335
- } from "./chunk-FZQQMVLB.js";
336
- import "./chunk-SFL6U7U7.js";
337
- import "./chunk-BW4333PP.js";
338
- import {
339
- getSystemDefaultsPath,
340
- getSystemSettingsPath
341
- } from "./chunk-IDS7MSUP.js";
345
+ } from "./chunk-NKTMUPHJ.js";
342
346
  import {
343
347
  ENV_ACP_REPEATED_TOOL_FAILURE_GUARD,
344
348
  QWEN_CODE_SERVE_ENV
345
- } from "./chunk-XX5HQLCZ.js";
346
- import "./chunk-XFSFZCM5.js";
347
- import "./chunk-2EAZ43JQ.js";
348
- import "./chunk-NF5J2WFA.js";
349
- import "./chunk-IOXJX7XE.js";
350
- import "./chunk-W3N5XAZ6.js";
349
+ } from "./chunk-6OTF7TTE.js";
350
+ import "./chunk-SFL6U7U7.js";
351
351
  import {
352
352
  isWorkspaceTrusted,
353
353
  loadTrustedFolders
354
- } from "./chunk-V77DTVCM.js";
354
+ } from "./chunk-NQ272MQG.js";
355
355
  import "./chunk-NPQ5ZKRP.js";
356
356
  import "./chunk-MR3PXB6E.js";
357
357
  import {
@@ -361,9 +361,7 @@ import {
361
361
  LoopTickResolver,
362
362
  MAX_BACKGROUND_NOTIFICATION_QUEUE,
363
363
  McpTransportPool,
364
- TURN_INTERRUPTION_HISTORY_TAIL_COUNT,
365
364
  WorkspaceMcpBudget,
366
- abortGoalForStopHookCap,
367
365
  buildBtwCacheSafeParams,
368
366
  buildBtwPrompt,
369
367
  buildGoalContinuationParts,
@@ -375,64 +373,50 @@ import {
375
373
  findApiRewindCutPoint,
376
374
  generatePromptSuggestion,
377
375
  generateSessionRecap,
378
- getStopHookContinuationReason,
376
+ getLastPeerInboxFailure,
379
377
  projectGoalStateToLegacy,
380
378
  readManyFiles,
381
379
  runManagedRememberByAgent,
382
380
  subagentGenerator
383
- } from "./chunk-JATZTB7X.js";
381
+ } from "./chunk-347O2YZJ.js";
384
382
  import {
385
383
  buildToolWriteOriginMeta
386
384
  } from "./chunk-GELRJXE2.js";
387
385
  import "./chunk-32CM56LO.js";
386
+ import "./chunk-XFSFZCM5.js";
387
+ import "./chunk-2EAZ43JQ.js";
388
+ import "./chunk-NF5J2WFA.js";
389
+ import "./chunk-AQP3H22J.js";
390
+ import "./chunk-W3N5XAZ6.js";
388
391
  import {
389
392
  CreateSubSessionTool
390
393
  } from "./chunk-6WXVEDT2.js";
391
394
  import "./chunk-LJZSMWOH.js";
392
- import {
393
- ALL_PROVIDERS,
394
- applyProviderInstallPlan,
395
- buildInstallPlan,
396
- findExistingProviderModels,
397
- findProviderById,
398
- getDefaultBaseUrlForProtocol,
399
- getDefaultModelIds,
400
- resolveBaseUrl,
401
- resolveOwnsModel
402
- } from "./chunk-VSXX6VUI.js";
403
- import "./chunk-7LG4MUUD.js";
404
- import "./chunk-EKMJR7M3.js";
405
- import "./chunk-EDB556X7.js";
395
+ import "./chunk-VEXUA6DX.js";
396
+ import "./chunk-TXTCM3TC.js";
397
+ import "./chunk-X7AYIXC7.js";
398
+ import "./chunk-TRZ22SG5.js";
406
399
  import {
407
400
  restoreWorktreeContext
408
- } from "./chunk-QR4Q425T.js";
409
- import "./chunk-L2NII7PZ.js";
410
- import "./chunk-DJXSOEFB.js";
411
- import "./chunk-5VQR2DD7.js";
412
- import "./chunk-BUQN5LTI.js";
401
+ } from "./chunk-3BZI5GDP.js";
413
402
  import "./chunk-ZPJWUGCS.js";
414
403
  import "./chunk-YM6KUQ2S.js";
404
+ import "./chunk-IXO2OCIP.js";
405
+ import "./chunk-DJXSOEFB.js";
415
406
  import {
416
407
  MAX_RETAINED_SNAPSHOTS,
417
408
  deleteWorkflowSnapshot,
418
- extractAndStripMeta,
419
- listSavedWorkflows,
420
409
  listWorkflowSnapshots,
421
- resolveSavedWorkflowScript,
422
410
  toSnapshot
423
- } from "./chunk-MZ3W3F44.js";
424
- import "./chunk-NFQOOITE.js";
411
+ } from "./chunk-SFHX5G2S.js";
412
+ import "./chunk-5VQR2DD7.js";
413
+ import "./chunk-BUQN5LTI.js";
414
+ import "./chunk-LO2UWNO5.js";
425
415
  import {
426
416
  APPROVAL_MODE_INFO,
427
417
  BranchPointInvalidError,
428
418
  ExtensionManager,
429
419
  GLOBAL_DUPLICATE_THRESHOLD,
430
- GOAL_PAUSE_REASON_SESSION_DISPOSED,
431
- GOAL_PAUSE_REASON_SESSION_TOKEN_LIMIT,
432
- GOAL_PAUSE_REASON_STOP_HOOK_CAP,
433
- GOAL_PAUSE_REASON_USER_INTERRUPT,
434
- GoalConflictError,
435
- GoalInvalidTransitionError,
436
420
  GoalPersistenceUnavailableError,
437
421
  InvalidMcpConfigError,
438
422
  InvalidSessionTranscriptCursorError,
@@ -461,6 +445,7 @@ import {
461
445
  SessionTranscriptTooLargeError,
462
446
  SessionWriterError,
463
447
  SessionWriterUnavailableError,
448
+ TURN_INTERRUPTION_HISTORY_TAIL_COUNT,
464
449
  TURN_RESULT_CODE_TEXT_TRUNCATED,
465
450
  TURN_RESULT_TEXT_MAX_CHARS,
466
451
  ToolMode,
@@ -468,9 +453,11 @@ import {
468
453
  ambientGoalToolResultProvenance,
469
454
  applyAutoModeDecision,
470
455
  applyPendingGoalProposal,
456
+ backgroundTurnContext,
471
457
  bridgeToolResultImages,
472
458
  buildBackgroundEntryLabel,
473
459
  buildContextUsage,
460
+ buildHooksListing,
474
461
  buildPermissionCheckContext,
475
462
  collectSessionTurnState,
476
463
  computeUniqueBranchTitle,
@@ -481,12 +468,12 @@ import {
481
468
  decoratePlanModeShellConfirmation,
482
469
  dedupeToolCallsById,
483
470
  didWriteProjectContextFile,
484
- emptyGoalSnapshot,
485
471
  encodeSessionTranscriptCursor,
486
472
  evaluateAutoMode,
487
473
  evaluatePermissionFlow,
488
474
  evaluatePlanModeShellPolicy,
489
475
  evaluateToolInvocationGuard,
476
+ extractAndStripMeta,
490
477
  finalizeToolResponses,
491
478
  findPlanModeEntryBatchBoundaryIndex,
492
479
  findRepeatedDuplicateProviderToolCall,
@@ -512,7 +499,6 @@ import {
512
499
  getSubagentSessionDir,
513
500
  getToolCallRepeatKey,
514
501
  getWorkflowTaskMutationKey,
515
- goalPauseReasonForFailure,
516
502
  goalTurnContext,
517
503
  ideContextStore,
518
504
  injectPermissionRulesIfMissing,
@@ -525,6 +511,7 @@ import {
525
511
  isReplayOfHandledToolCall,
526
512
  isTerminalWorkflowStatus,
527
513
  isTurnResultRecordPayload,
514
+ listSavedWorkflows,
528
515
  markDuplicateProviderToolCallResponseSent,
529
516
  matchesAnyServerPattern,
530
517
  mcpServerRequiresOAuth,
@@ -532,9 +519,6 @@ import {
532
519
  normalizeDerivedBranchTitle,
533
520
  normalizeTurnResultError,
534
521
  observeToolResultBoundary,
535
- parseGoalControlRequest,
536
- parseGoalSnapshotV2,
537
- parseGoalStateCause,
538
522
  persistPermissionOutcome,
539
523
  prepareAutoModeFallback,
540
524
  readAgentMetaAsync,
@@ -544,6 +528,7 @@ import {
544
528
  recordHandledToolCall,
545
529
  refreshMemoryAfterManagedWrite,
546
530
  refreshMemoryInstruction,
531
+ resolveSavedWorkflowScript,
547
532
  restorableAskUserQuestionCallIds,
548
533
  runForkedAgent,
549
534
  runManagedAutoMemoryDream,
@@ -555,58 +540,74 @@ import {
555
540
  shouldRunAutoModeForCall,
556
541
  toolResultBoundaryArtifact,
557
542
  toolResultPartDiagnosticValues,
558
- truncateNotificationLabel,
559
543
  tryWithWorkflowTaskMutation,
560
544
  updateSetting,
561
545
  validatePlanModeShellApproval,
562
546
  validatePlanModeShellContext
563
- } from "./chunk-AYMSNIYL.js";
547
+ } from "./chunk-KAYC5FBN.js";
564
548
  import "./chunk-GOFAQQZA.js";
549
+ import "./chunk-65I7S4Z3.js";
565
550
  import "./chunk-HEOH7JZY.js";
566
551
  import "./chunk-TWPJO254.js";
567
552
  import {
568
553
  external_exports
569
554
  } from "./chunk-CQ35AJ4Z.js";
570
- import "./chunk-65I7S4Z3.js";
555
+ import {
556
+ prepareFileWatchersForProcessExit
557
+ } from "./chunk-IVFTLUZD.js";
571
558
  import "./chunk-7CLLH5TI.js";
572
559
  import "./chunk-WK6DEH3Q.js";
573
560
  import {
574
561
  parsePositiveIntegerEnv
575
562
  } from "./chunk-6PVPNMXU.js";
576
- import {
577
- RUNTIME_SNAPSHOT_PREFIX
578
- } from "./chunk-ZFYACOVD.js";
563
+ import "./chunk-DX6JTDMR.js";
579
564
  import {
580
565
  SESSION_ARTIFACT_PERSISTENCE_VERSION,
581
566
  normalizeEventPayload,
582
567
  normalizeSnapshotPayload,
583
568
  wrapUserPromptSubmitContext
584
- } from "./chunk-ME4JBHSB.js";
585
- import "./chunk-GNV2SFO7.js";
569
+ } from "./chunk-VQDWCQOE.js";
586
570
  import "./chunk-5EZRLTLQ.js";
587
571
  import "./chunk-QHWCP53L.js";
588
572
  import {
589
573
  isValidCronTaskRoutingId
590
574
  } from "./chunk-3LMDSCLU.js";
575
+ import "./chunk-QJNDUTOL.js";
591
576
  import {
592
577
  promptIdContext,
593
578
  todoWorkChainContext
594
579
  } from "./chunk-O6GEWCJA.js";
595
- import "./chunk-WKVZES7O.js";
580
+ import "./chunk-CXONOVBN.js";
581
+ import {
582
+ registerSession
583
+ } from "./chunk-OWUAZXXN.js";
584
+ import "./chunk-CH2YDT6X.js";
596
585
  import {
597
586
  AgentOutputMessageCapture,
587
+ GOAL_PAUSE_REASON_SESSION_DISPOSED,
588
+ GOAL_PAUSE_REASON_SESSION_TOKEN_LIMIT,
589
+ GOAL_PAUSE_REASON_STOP_HOOK_CAP,
590
+ GOAL_PAUSE_REASON_USER_INTERRUPT,
591
+ GoalConflictError,
592
+ GoalInvalidTransitionError,
598
593
  addAgentInputMessageAttributes,
599
594
  addToolArgumentsAttributes,
600
595
  addToolCallResultAttributes,
601
596
  authoredSkillName,
597
+ emptyGoalSnapshot,
598
+ goalPauseReasonForFailure,
599
+ parseGoalControlRequest,
600
+ parseGoalSnapshotV2,
601
+ parseGoalStateCause,
602
602
  qualifySkillName,
603
603
  registerAcpEventLoopLagGauge,
604
- startEventLoopLagMonitor
605
- } from "./chunk-NJ2OFVUX.js";
606
- import "./chunk-HFJSQ4GL.js";
607
- import "./chunk-QJNDUTOL.js";
604
+ startEventLoopLagMonitor,
605
+ truncateNotificationLabel
606
+ } from "./chunk-P42KMMU6.js";
607
+ import "./chunk-BTICBRPL.js";
608
608
  import "./chunk-V545KI73.js";
609
- import "./chunk-MQRLLBMQ.js";
609
+ import "./chunk-ADN5KESB.js";
610
+ import "./chunk-PPJSG2PU.js";
610
611
  import {
611
612
  SessionSourceError,
612
613
  SessionSourceService
@@ -617,28 +618,26 @@ import {
617
618
  escapeJsonTagCharacters
618
619
  } from "./chunk-CHEIIBT3.js";
619
620
  import "./chunk-AEWCOE64.js";
620
- import {
621
- registerSession
622
- } from "./chunk-OWUAZXXN.js";
623
- import "./chunk-CH2YDT6X.js";
624
621
  import {
625
622
  APPROVAL_MODES
626
623
  } from "./chunk-JX6XHPTX.js";
627
624
  import "./chunk-ZSTCM3MX.js";
625
+ import "./chunk-SK3RZOPS.js";
628
626
  import "./chunk-MLXTMF7H.js";
629
627
  import {
630
628
  getArenaSystemReminder,
631
629
  getOutputStyleTurnReminder,
632
630
  getPlanModeSystemReminder,
633
631
  resolveMainSessionOutputStyle
634
- } from "./chunk-AXZMWAJV.js";
632
+ } from "./chunk-36SDZ2Q4.js";
635
633
  import "./chunk-NXUZFW3G.js";
636
634
  import {
637
635
  approxBase64Bytes,
638
636
  clampInlineMediaPart
639
637
  } from "./chunk-WFNEY5G7.js";
640
- import "./chunk-GSS4SZNG.js";
638
+ import "./chunk-YP2K3WOS.js";
641
639
  import {
640
+ runOutsideAgentContext,
642
641
  runWithRuntimeContentGenerator
643
642
  } from "./chunk-BW2SMO6L.js";
644
643
  import "./chunk-S6LOFUVP.js";
@@ -658,26 +657,37 @@ import "./chunk-NUQ4GK5I.js";
658
657
  import {
659
658
  clearCachedCredentialFile,
660
659
  qwenOAuth2Events
661
- } from "./chunk-CXXAZ2LZ.js";
660
+ } from "./chunk-DC4ZNGH4.js";
662
661
  import "./chunk-NAVJD2PQ.js";
663
- import "./chunk-66N6C4EH.js";
664
- import "./chunk-FMLBBXHB.js";
662
+ import "./chunk-3WILPKTJ.js";
663
+ import "./chunk-DRAX5YAI.js";
665
664
  import "./chunk-VNOVK4I7.js";
666
665
  import {
667
666
  getToolCallPreparations
668
667
  } from "./chunk-S7UQ3V2H.js";
669
- import "./chunk-JL6APGBX.js";
670
668
  import "./chunk-DJ2GSRLV.js";
671
- import "./chunk-ZKIAGIGH.js";
672
- import "./chunk-VGY2RGXL.js";
673
- import "./chunk-C75BXMPM.js";
669
+ import "./chunk-3XBUCOWS.js";
670
+ import "./chunk-M4U2LTD2.js";
674
671
  import "./chunk-KFFCDLKV.js";
675
672
  import "./chunk-KP2FHIFR.js";
673
+ import {
674
+ ALL_PROVIDERS,
675
+ RUNTIME_SNAPSHOT_PREFIX,
676
+ applyProviderInstallPlan,
677
+ buildInstallPlan,
678
+ findExistingProviderModels,
679
+ findProviderById,
680
+ getDefaultBaseUrlForProtocol,
681
+ getDefaultModelIds,
682
+ resolveBaseUrl,
683
+ resolveOwnsModel,
684
+ resolveReasoningCapabilities
685
+ } from "./chunk-KEM7MWS7.js";
676
686
  import {
677
687
  addDaemonRequestAttribute,
678
688
  extractDaemonTraceContext,
679
689
  withDaemonSpan
680
- } from "./chunk-L6DIANLD.js";
690
+ } from "./chunk-G45B3INR.js";
681
691
  import {
682
692
  ConversationFinishedEvent,
683
693
  DiscoveredMCPTool,
@@ -703,7 +713,7 @@ import {
703
713
  shouldRunVisionBridge,
704
714
  splitImageParts,
705
715
  uiTelemetryService
706
- } from "./chunk-UB2MATP5.js";
716
+ } from "./chunk-CDDP4ONL.js";
707
717
  import {
708
718
  INVOCATION_CONTEXT_META_KEY,
709
719
  PRIVATE_ACP_CAPABILITY_ENV,
@@ -712,12 +722,11 @@ import {
712
722
  parseInvocationContext,
713
723
  runWithInvocationContext
714
724
  } from "./chunk-5ETULJLP.js";
715
- import "./chunk-7MIBD3LG.js";
716
725
  import "./chunk-VGC4I5JJ.js";
717
726
  import {
718
727
  getAllMemoryFilenames,
719
728
  getSpecificMimeType
720
- } from "./chunk-QZW6WRB7.js";
729
+ } from "./chunk-5NUKK2DT.js";
721
730
  import {
722
731
  getAutoMemoryRoot,
723
732
  getUserAutoMemoryRoot
@@ -729,25 +738,20 @@ import {
729
738
  runWithoutToolCallRuntime
730
739
  } from "./chunk-CFMZLE3L.js";
731
740
  import "./chunk-WZAD4ZNJ.js";
741
+ import "./chunk-TIGXX4PA.js";
742
+ import "./chunk-XFFRI3WM.js";
732
743
  import {
744
+ DEFAULT_TOKEN_LIMIT,
733
745
  REASONING_EFFORT_TIERS,
734
746
  getGptReasoningCapabilities,
735
- parseModelReasoningCapabilities
736
- } from "./chunk-ARDHE6MM.js";
737
- import {
738
- DEFAULT_TOKEN_LIMIT,
739
- tokenLimit
740
- } from "./chunk-FPGTNKCP.js";
741
- import "./chunk-TIGXX4PA.js";
742
- import {
743
747
  hasVertexProjectConfigured,
744
- preloadContentGenerator
745
- } from "./chunk-OIDF7L67.js";
746
- import "./chunk-XFFRI3WM.js";
748
+ parseModelReasoningCapabilities,
749
+ preloadContentGenerator,
750
+ tokenLimit
751
+ } from "./chunk-GJKP6XOB.js";
747
752
  import {
748
753
  AuthType
749
- } from "./chunk-ERU3SDXT.js";
750
- import "./chunk-EWJTAP3Y.js";
754
+ } from "./chunk-7O5PYQ3M.js";
751
755
  import "./chunk-HHJLM3WQ.js";
752
756
  import {
753
757
  endToolExecutionSpan,
@@ -759,7 +763,7 @@ import {
759
763
  startToolExecutionSpan,
760
764
  startToolSpan,
761
765
  withInteractionSpan
762
- } from "./chunk-4Y2I3CI3.js";
766
+ } from "./chunk-6USYH3EU.js";
763
767
  import "./chunk-74TONY4F.js";
764
768
  import "./chunk-SYROIHU7.js";
765
769
  import {
@@ -779,13 +783,13 @@ import {
779
783
  sessionIdContext
780
784
  } from "./chunk-ZAFYHRVY.js";
781
785
  import "./chunk-TBWQLLFO.js";
782
- import "./chunk-HIQEL7EM.js";
783
786
  import "./chunk-V5U2NZNJ.js";
787
+ import "./chunk-QIPLWW6Q.js";
784
788
  import "./chunk-BSIOCNDK.js";
785
789
  import {
786
790
  registerCleanup,
787
791
  runExitCleanup
788
- } from "./chunk-7MIOAF77.js";
792
+ } from "./chunk-H6L4NEAT.js";
789
793
  import {
790
794
  writeStderrLine,
791
795
  writeStderrLineSafe
@@ -1044,8 +1048,53 @@ var AcpFileSystemService = class {
1044
1048
  }
1045
1049
  };
1046
1050
 
1051
+ // packages/cli/src/acp-integration/acp-output.ts
1052
+ init_esbuild_shims();
1053
+ import { Writable } from "node:stream";
1054
+ var OUTPUT_DRAIN_TIMEOUT_MS = 2e3;
1055
+ function createAcpOutput(output) {
1056
+ const writer = Writable.toWeb(output).getWriter();
1057
+ const drained = writer.closed;
1058
+ void drained.catch(() => {
1059
+ });
1060
+ let closing = false;
1061
+ let closePromise;
1062
+ return {
1063
+ stream: new WritableStream({
1064
+ write(frame) {
1065
+ if (closing) throw new Error("ACP output is closed");
1066
+ return writer.write(frame);
1067
+ }
1068
+ }),
1069
+ close() {
1070
+ if (closePromise) return closePromise;
1071
+ closing = true;
1072
+ void writer.close().catch(() => {
1073
+ });
1074
+ let timer;
1075
+ closePromise = Promise.race([
1076
+ drained,
1077
+ new Promise((_, reject) => {
1078
+ timer = setTimeout(() => {
1079
+ const error = new Error(
1080
+ `ACP output did not drain within ${OUTPUT_DRAIN_TIMEOUT_MS}ms`
1081
+ );
1082
+ reject(error);
1083
+ output.destroy(error);
1084
+ }, OUTPUT_DRAIN_TIMEOUT_MS);
1085
+ })
1086
+ ]).finally(() => {
1087
+ if (timer) clearTimeout(timer);
1088
+ writer.releaseLock();
1089
+ });
1090
+ return closePromise;
1091
+ }
1092
+ };
1093
+ }
1094
+ __name(createAcpOutput, "createAcpOutput");
1095
+
1047
1096
  // packages/cli/src/acp-integration/acpAgent.ts
1048
- import { Readable as Readable2, Writable as Writable2 } from "node:stream";
1097
+ import { Readable as Readable2 } from "node:stream";
1049
1098
  import { realpathSync as realpathSync3 } from "node:fs";
1050
1099
  import * as fs4 from "node:fs/promises";
1051
1100
  import * as os3 from "node:os";
@@ -3316,7 +3365,6 @@ __name(reduceRepeatedToolFailureGuard, "reduceRepeatedToolFailureGuard");
3316
3365
 
3317
3366
  // packages/cli/src/acp-integration/session/Session.ts
3318
3367
  var debugLogger6 = createDebugLogger("SESSION");
3319
- var permissionRequestTails = /* @__PURE__ */ new WeakMap();
3320
3368
  var MAX_RETAINED_SESSION_ROUTE_COUNTS = 8;
3321
3369
  var USER_CANCEL_ABORT_REASON = "qwen:user-cancel";
3322
3370
  var NEW_PROMPT_ABORT_REASON = "qwen:new-prompt";
@@ -3615,6 +3663,7 @@ var MID_TURN_QUEUE_DRAIN_TIMEOUT_MS = 2e3;
3615
3663
  var MID_TURN_QUEUE_RECOVERY_TIMEOUT_MS = 3e4;
3616
3664
  var MID_TURN_QUEUE_RESOLVE_TIMEOUT_MS = 1e4;
3617
3665
  var ACTIVE_TURN_POLL_INTERVAL_MS = 10;
3666
+ var CHANNEL_TASK_POLL_INTERVAL_MS = 100;
3618
3667
  var MAX_MID_TURN_DRAIN_ITEMS = 10;
3619
3668
  var MID_TURN_ATTACHMENT_PROCESSING_FAILURE_TEXT = "[Attachment could not be processed]";
3620
3669
  var MAX_MID_TURN_RESOURCE_TEXT_LENGTH = 1e5;
@@ -3890,6 +3939,16 @@ var TodoStopGuardClaimTimeoutError = class extends Error {
3890
3939
  );
3891
3940
  }
3892
3941
  };
3942
+ var BackgroundTurnAdmissionTimeoutError = class extends Error {
3943
+ static {
3944
+ __name(this, "BackgroundTurnAdmissionTimeoutError");
3945
+ }
3946
+ constructor() {
3947
+ super(
3948
+ `background turn admission got no response within ${MID_TURN_QUEUE_DRAIN_TIMEOUT_MS}ms`
3949
+ );
3950
+ }
3951
+ };
3893
3952
  function toAdmissibleNotification(item) {
3894
3953
  return {
3895
3954
  kind: item.kind,
@@ -3903,11 +3962,13 @@ function beginChannelDeliveryResponseBlock(capture) {
3903
3962
  capture?.agentOutput.beginResponse();
3904
3963
  if (capture?.channelDelivery) capture.channelDelivery.finalText = "";
3905
3964
  if (capture?.turnResult) capture.turnResult.finalText = "";
3906
- if (!capture?.channelDelivery && !capture?.turnResult) return void 0;
3965
+ if (!capture?.channelDelivery && !capture?.turnResult && !capture?.backgroundResponse) {
3966
+ return void 0;
3967
+ }
3907
3968
  return {
3908
3969
  parts: [],
3909
3970
  chars: 0,
3910
- ...capture?.channelDelivery ? {} : { capChars: TURN_RESULT_TEXT_MAX_CHARS + 1 }
3971
+ ...capture?.channelDelivery || capture?.backgroundResponse ? {} : { capChars: TURN_RESULT_TEXT_MAX_CHARS + 1 }
3911
3972
  };
3912
3973
  }
3913
3974
  __name(beginChannelDeliveryResponseBlock, "beginChannelDeliveryResponseBlock");
@@ -4305,11 +4366,19 @@ var Session = class {
4305
4366
  */
4306
4367
  droppedNotifications = new DroppedNotificationTally();
4307
4368
  notificationProcessing = false;
4369
+ backgroundTurn;
4370
+ lastCompletedRpcPromptId;
4371
+ notificationsPaused = false;
4372
+ notificationAdmissionDeferred = false;
4373
+ notificationAdmissionRetry;
4374
+ finishedBackgroundTurnId;
4308
4375
  notificationAbortController = null;
4309
4376
  notificationCompletion = null;
4310
4377
  currentAgentNotificationTaskId = null;
4311
4378
  currentWorkflowNotificationTaskId = null;
4312
4379
  currentShellNotificationActive = false;
4380
+ currentNotificationWorkChainId;
4381
+ channelTaskCaptures = /* @__PURE__ */ new Set();
4313
4382
  persistedBackgroundNotificationTaskIds = /* @__PURE__ */ new Set();
4314
4383
  backgroundNotificationAcceptances = /* @__PURE__ */ new Map();
4315
4384
  activeNotificationAcceptances = /* @__PURE__ */ new Set();
@@ -4367,6 +4436,7 @@ var Session = class {
4367
4436
  workflowDeletionSeq = 0;
4368
4437
  workflowDeletionSeqByRunId = /* @__PURE__ */ new Map();
4369
4438
  #shellStatusChangeCallback;
4439
+ #monitorStatusChangeCallback;
4370
4440
  workflowApprovalAbortController = new AbortController();
4371
4441
  activeTodoPlanRevision;
4372
4442
  activeTodoPlanStructure;
@@ -4418,6 +4488,14 @@ var Session = class {
4418
4488
  sessionId;
4419
4489
  sessionReasoningSelection;
4420
4490
  restoredHistoryGaps;
4491
+ /**
4492
+ * Tail of this session's permission queue. The serialization unit is the
4493
+ * session, not the `AgentSideConnection`: one daemon child owns a single
4494
+ * connection that every session on it multiplexes onto, so a connection-wide
4495
+ * queue makes unrelated sessions inherit the wait behind a question nobody
4496
+ * is going to answer. Mirrors `promptQueue`, which is per session bridge-side.
4497
+ */
4498
+ permissionRequestTail = Promise.resolve();
4421
4499
  #bindGoalRuntime() {
4422
4500
  try {
4423
4501
  const runtime = this.config.getGoalRuntime();
@@ -4733,6 +4811,24 @@ var Session = class {
4733
4811
  await runtime.releaseTurn(turn.turnKey);
4734
4812
  }
4735
4813
  }
4814
+ if (turn.endingToolCallId && result?.stopReason === "end_turn" && failureMessage === void 0 && !turn.controller.signal.aborted) {
4815
+ const recorder = this.config.getChatRecordingService();
4816
+ if (recorder) {
4817
+ try {
4818
+ await recorder.recordGoalTurnEnd(
4819
+ turn.endingToolCallId,
4820
+ turn.permit
4821
+ );
4822
+ const chat = this.#getCurrentChat();
4823
+ chat.setCompletedToolCallIds([
4824
+ ...chat.getCompletedToolCallIds(),
4825
+ turn.endingToolCallId
4826
+ ]);
4827
+ } catch (error) {
4828
+ debugLogger6.warn("Failed to record ACP Goal turn end:", error);
4829
+ }
4830
+ }
4831
+ }
4736
4832
  } catch (error) {
4737
4833
  debugLogger6.warn(
4738
4834
  `Failed to settle ACP Goal turn: ${error instanceof Error ? error.message : String(error)}`
@@ -4742,9 +4838,9 @@ var Session = class {
4742
4838
  /**
4743
4839
  * Stops an autonomous Goal loop when the Stop-hook blocking cap fires.
4744
4840
  *
4745
- * `abortGoalForStopHookCap` only knows about the legacy `activeGoalStore`,
4746
- * which no longer has a writer for daemon sessions, so ACP needs the
4747
- * canonical runtime acted on directly.
4841
+ * Pauses the canonical runtime, the way the TUI's interrupted-exit path
4842
+ * does: left active, `finishTurn` would mint the next continuation and a
4843
+ * Stop hook that always blocks would loop the session forever.
4748
4844
  */
4749
4845
  async #pauseGoalForStopHookCap() {
4750
4846
  try {
@@ -4986,7 +5082,11 @@ var Session = class {
4986
5082
  }
4987
5083
  async #claimTodoStopGuardContinuation(abortSignal) {
4988
5084
  const context = getInvocationContext();
4989
- const ownerPromptId = context?.sessionId === this.sessionId ? context.promptId : void 0;
5085
+ const background = backgroundTurnContext.getStore();
5086
+ const channelTask = context === void 0 && this.currentNotificationWorkChainId ? [...this.channelTaskCaptures].find(
5087
+ (capture) => capture.workChainId === this.currentNotificationWorkChainId && capture.daemonPromptId && !capture.signal.aborted
5088
+ ) : void 0;
5089
+ const ownerPromptId = background?.active && background.sessionId === this.sessionId ? background.turn.turnId : context?.sessionId === this.sessionId ? context.promptId : channelTask?.daemonPromptId;
4990
5090
  if (ownerPromptId) {
4991
5091
  this.todoStopGuardClaimOwnerCounts.set(
4992
5092
  ownerPromptId,
@@ -5009,7 +5109,7 @@ var Session = class {
5009
5109
  );
5010
5110
  });
5011
5111
  const response = await Promise.race([claimPromise, timeoutPromise]);
5012
- if (abortSignal.aborted || !isRecord2(response)) {
5112
+ if (abortSignal.aborted || channelTask?.signal.aborted || !isRecord2(response)) {
5013
5113
  return "unavailable";
5014
5114
  }
5015
5115
  if (ownerPromptId && response["claimed"] === false && response["hasQueuedPrompt"] === true) {
@@ -5694,8 +5794,17 @@ var Session = class {
5694
5794
  );
5695
5795
  }
5696
5796
  }
5797
+ hasRunningBackgroundTasks() {
5798
+ return !this.disposed && (this.config.getBackgroundTaskRegistry().hasRunningTasks() || this.config.getBackgroundShellRegistry().hasRunningEntries() || this.config.getWorkflowRunRegistry().hasRunningEntries() || this.config.getMonitorRegistry().getAll().some((task) => task.status === "running"));
5799
+ }
5800
+ getBackgroundTurn() {
5801
+ return this.disposed ? void 0 : this.backgroundTurn;
5802
+ }
5803
+ getFinishedBackgroundTurnId() {
5804
+ return this.finishedBackgroundTurnId;
5805
+ }
5697
5806
  isTurnIdle() {
5698
- return !this.closing && !this.#hasActiveTurn();
5807
+ return !this.closing && this.channelTaskCaptures.size === 0 && !this.#hasActiveTurn();
5699
5808
  }
5700
5809
  isIdle() {
5701
5810
  return this.isTurnIdle() && this.collectActiveWorkHolds().length === 0;
@@ -5777,7 +5886,7 @@ var Session = class {
5777
5886
  if (this.closing) {
5778
5887
  throw RequestError.invalidParams(void 0, "Session is closing");
5779
5888
  }
5780
- if (this.#hasActiveTurn()) {
5889
+ if (!this.isTurnIdle()) {
5781
5890
  throw new RequestError(-32602, "Session is busy processing a turn", {
5782
5891
  errorKind: "session_busy"
5783
5892
  });
@@ -5880,6 +5989,12 @@ var Session = class {
5880
5989
  dispose() {
5881
5990
  this.disposed = true;
5882
5991
  this.closing = true;
5992
+ for (const capture of this.channelTaskCaptures) {
5993
+ capture.controller.abort(SESSION_DISPOSE_ABORT_REASON);
5994
+ }
5995
+ clearTimeout(this.notificationAdmissionRetry);
5996
+ this.notificationAdmissionRetry = void 0;
5997
+ this.backgroundTurn = void 0;
5883
5998
  this.clearActiveTodoPlanRevision();
5884
5999
  this.pendingPrompt?.abort(SESSION_DISPOSE_ABORT_REASON);
5885
6000
  this.pendingPrompt = null;
@@ -5918,6 +6033,10 @@ var Session = class {
5918
6033
  this.#statusChangeCallback = void 0;
5919
6034
  }
5920
6035
  this.config.getMonitorRegistry().setNotificationCallback(void 0);
6036
+ if (this.#monitorStatusChangeCallback) {
6037
+ this.config.getMonitorRegistry().clearStatusChangeCallback?.(this.#monitorStatusChangeCallback);
6038
+ this.#monitorStatusChangeCallback = void 0;
6039
+ }
5921
6040
  const shellRegistry = this.config.getBackgroundShellRegistry();
5922
6041
  shellRegistry.setNotificationCallback(void 0);
5923
6042
  if (this.#shellStatusChangeCallback) {
@@ -5999,7 +6118,7 @@ var Session = class {
5999
6118
  "targetTurnIndex must be a non-negative integer"
6000
6119
  );
6001
6120
  }
6002
- if (this.closing || this.#hasActiveTurn()) {
6121
+ if (!this.isTurnIdle()) {
6003
6122
  throw RequestError.invalidParams(
6004
6123
  void 0,
6005
6124
  "Cannot rewind while a prompt is running"
@@ -6051,7 +6170,7 @@ var Session = class {
6051
6170
  );
6052
6171
  }
6053
6172
  restoreHistory(history) {
6054
- if (this.closing || this.#hasActiveTurn()) {
6173
+ if (!this.isTurnIdle()) {
6055
6174
  throw RequestError.invalidParams(
6056
6175
  void 0,
6057
6176
  "Cannot restore history while a prompt is running"
@@ -6072,18 +6191,21 @@ var Session = class {
6072
6191
  async cancelPendingPrompt() {
6073
6192
  const hadPrompt = !!this.pendingPrompt;
6074
6193
  const hadCron = !!this.cronAbortController;
6075
- const hadNotification = !!this.notificationAbortController || this.notificationProcessing;
6194
+ const hadNotification = !!this.notificationAbortController || this.notificationProcessing || !!this.notificationAdmissionRetry;
6076
6195
  const queuedGoalTurns = this.goalQueue.splice(0);
6077
6196
  const hadQueuedGoalTurn = queuedGoalTurns.length > 0;
6078
6197
  if (this.followupAbort) {
6079
6198
  this.followupAbort.abort();
6080
6199
  this.followupAbort = null;
6081
6200
  }
6082
- if (!hadPrompt && !hadCron && !hadNotification && !hadQueuedGoalTurn) {
6201
+ if (!hadPrompt && !hadCron && !hadNotification && !hadQueuedGoalTurn && this.channelTaskCaptures.size === 0) {
6083
6202
  throw new Error(NOT_CURRENTLY_GENERATING_CANCEL_MESSAGE);
6084
6203
  }
6085
6204
  this.todoStopGuard.suspend();
6086
6205
  const abortReason = this.closing || this.disposed ? SESSION_DISPOSE_ABORT_REASON : USER_CANCEL_ABORT_REASON;
6206
+ for (const capture of this.channelTaskCaptures) {
6207
+ capture.controller.abort(abortReason);
6208
+ }
6087
6209
  if (this.pendingPrompt) {
6088
6210
  this.pendingPrompt.abort(abortReason);
6089
6211
  this.pendingPrompt = null;
@@ -6101,8 +6223,9 @@ var Session = class {
6101
6223
  this.notificationAbortController.abort();
6102
6224
  this.notificationAbortController = null;
6103
6225
  }
6104
- this.notificationQueue = [];
6105
- this.droppedNotifications.clear();
6226
+ this.notificationsPaused = true;
6227
+ clearTimeout(this.notificationAdmissionRetry);
6228
+ this.notificationAdmissionRetry = void 0;
6106
6229
  this.notificationProcessing = false;
6107
6230
  const queuedGoalTurn = queuedGoalTurns[0];
6108
6231
  if (queuedGoalTurn) {
@@ -6143,6 +6266,13 @@ var Session = class {
6143
6266
  );
6144
6267
  }
6145
6268
  const turnRecording = this.#beginTurnRecording(params, invocationContext);
6269
+ const controller = new AbortController();
6270
+ const channelTask = params._meta?.[CHANNEL_PROMPT_META_KEY] === true && params._meta?.[CHANNEL_OUTPUT_MODE_META_KEY] === "per_task" ? {
6271
+ daemonPromptId: invocationContext?.promptId,
6272
+ controller,
6273
+ signal: admissionCancellation ? AbortSignal.any([admissionCancellation, controller.signal]) : controller.signal
6274
+ } : void 0;
6275
+ if (channelTask) this.channelTaskCaptures.add(channelTask);
6146
6276
  const recordAdmissionCancellation = /* @__PURE__ */ __name(() => {
6147
6277
  if (turnRecording) turnRecording.cancelledAt ??= Date.now();
6148
6278
  }, "recordAdmissionCancellation");
@@ -6155,14 +6285,18 @@ var Session = class {
6155
6285
  );
6156
6286
  if (admissionCancellation?.aborted) recordAdmissionCancellation();
6157
6287
  try {
6158
- const result = await this.#promptWithTurnRecording(
6288
+ let result = await this.#promptWithTurnRecording(
6159
6289
  params,
6160
6290
  invocationContext,
6161
6291
  admissionCancellation,
6162
6292
  modelPrompt,
6163
6293
  scheduledGoalTurn,
6164
- turnRecording
6294
+ turnRecording,
6295
+ channelTask
6165
6296
  );
6297
+ if (channelTask && result.stopReason === "end_turn") {
6298
+ result = await this.#waitForChannelTaskResult(channelTask, result);
6299
+ }
6166
6300
  await this.#settleTurnRecording(
6167
6301
  result.stopReason === "cancelled" ? "cancelled" : "completed",
6168
6302
  turnRecording,
@@ -6181,13 +6315,62 @@ var Session = class {
6181
6315
  await this.#settleTurnRecording("error", turnRecording, void 0, error);
6182
6316
  throw error;
6183
6317
  } finally {
6318
+ if (channelTask) {
6319
+ this.channelTaskCaptures.delete(channelTask);
6320
+ void this.#drainNotificationQueue();
6321
+ }
6184
6322
  admissionCancellation?.removeEventListener(
6185
6323
  "abort",
6186
6324
  recordAdmissionCancellation
6187
6325
  );
6188
6326
  }
6189
6327
  }
6190
- async #promptWithTurnRecording(params, invocationContext, admissionCancellation, modelPrompt, scheduledGoalTurn, turnRecording) {
6328
+ #hasPendingChannelTaskWork(workChainId) {
6329
+ return this.config.getBackgroundTaskRegistry().getAll().some(
6330
+ (task) => task.todoWorkChainId === workChainId && task.isBackgrounded && (task.status === "running" || task.status === "paused" || task.status === "cancelled" && !task.notified)
6331
+ ) || this.config.getBackgroundShellRegistry().getAll().some(
6332
+ (task) => task.todoWorkChainId === workChainId && task.status === "running"
6333
+ ) || this.config.getMonitorRegistry().getAll().some(
6334
+ (task) => task.todoWorkChainId === workChainId && task.status === "running"
6335
+ ) || this.config.getWorkflowRunRegistry().list().some(
6336
+ (task) => task.todoWorkChainId === workChainId && !isTerminalWorkflowStatus(task.status)
6337
+ ) || this.notificationQueue.some(
6338
+ (item) => item.todoWorkChainId === workChainId && (!this.todoStopGuard.blocksUnrelatedAutomaticTurns || this.#notificationContinuesTodoStopGuardWorkChain(item))
6339
+ ) || this.currentNotificationWorkChainId === workChainId;
6340
+ }
6341
+ async #waitForChannelTaskResult(capture, result) {
6342
+ while (true) {
6343
+ await new Promise((resolve7) => setImmediate(resolve7));
6344
+ if (capture.daemonPromptId && this.todoStopGuardQueuedPromptPriority && this.todoStopGuardQueuedPromptOwnerPromptId === capture.daemonPromptId) {
6345
+ capture.controller.abort(NEW_PROMPT_ABORT_REASON);
6346
+ }
6347
+ if (capture.signal.aborted || this.disposed) {
6348
+ return { ...result, stopReason: "cancelled" };
6349
+ }
6350
+ if (!capture.workChainId || !this.#hasPendingChannelTaskWork(capture.workChainId)) {
6351
+ break;
6352
+ }
6353
+ await new Promise((resolve7) => {
6354
+ const finish = /* @__PURE__ */ __name(() => {
6355
+ clearTimeout(timer);
6356
+ capture.signal.removeEventListener("abort", finish);
6357
+ resolve7();
6358
+ }, "finish");
6359
+ const timer = setTimeout(finish, CHANNEL_TASK_POLL_INTERVAL_MS);
6360
+ capture.signal.addEventListener("abort", finish, { once: true });
6361
+ if (capture.signal.aborted) finish();
6362
+ });
6363
+ }
6364
+ return capture.finalText ? {
6365
+ ...result,
6366
+ _meta: {
6367
+ ...result._meta,
6368
+ [CHANNEL_TASK_RESULT_META_KEY]: capture.finalText,
6369
+ [CHANNEL_TASK_RESULT_PARTIAL_META_KEY]: capture.partial === true
6370
+ }
6371
+ } : result;
6372
+ }
6373
+ async #promptWithTurnRecording(params, invocationContext, admissionCancellation, modelPrompt, scheduledGoalTurn, turnRecording, channelTask) {
6191
6374
  if (this.closing) {
6192
6375
  throw RequestError.invalidParams(void 0, "Session is closing");
6193
6376
  }
@@ -6279,6 +6462,15 @@ var Session = class {
6279
6462
  pendingSend.signal.removeEventListener("abort", recordCancellation);
6280
6463
  if (this.pendingPrompt === pendingSend) {
6281
6464
  this.pendingPrompt = null;
6465
+ if (!scheduledGoalTurn)
6466
+ this.lastCompletedRpcPromptId = invocationContext?.promptId;
6467
+ clearTimeout(this.notificationAdmissionRetry);
6468
+ this.notificationAdmissionRetry = void 0;
6469
+ this.notificationAdmissionDeferred = false;
6470
+ for (const item of this.notificationQueue) {
6471
+ item.admissionRetries = 0;
6472
+ delete item.turn;
6473
+ }
6282
6474
  }
6283
6475
  }, "releasePendingSend");
6284
6476
  if (this.followupAbort) {
@@ -6307,8 +6499,6 @@ var Session = class {
6307
6499
  if (this.notificationAbortController) {
6308
6500
  this.notificationAbortController.abort();
6309
6501
  this.notificationAbortController = null;
6310
- this.notificationQueue = [];
6311
- this.droppedNotifications.clear();
6312
6502
  this.notificationProcessing = false;
6313
6503
  }
6314
6504
  if (this.notificationCompletion) {
@@ -6372,6 +6562,7 @@ var Session = class {
6372
6562
  this.duplicateProviderToolCallResponseIds.clear();
6373
6563
  const channelDelivery = parsePromptChannelDelivery(params);
6374
6564
  const responseCapture = {
6565
+ ...channelTask ? { channelTask } : {},
6375
6566
  ...channelDelivery ? { channelDelivery: { finalText: "" } } : {},
6376
6567
  ...turnRecording ? { turnResult: turnRecording.finalAnswer } : {},
6377
6568
  agentOutput: new AgentOutputMessageCapture(this.config)
@@ -6385,6 +6576,12 @@ var Session = class {
6385
6576
  let promptFailureMessage;
6386
6577
  if (turnRecording) turnRecording.startedAt = Date.now();
6387
6578
  try {
6579
+ const reasoningMeta = params._meta;
6580
+ if (scheduledGoalTurn === void 0 && !params.retry && !reasoningMeta?.[DAEMON_RETRY_META_KEY] && !reasoningMeta?.[DAEMON_CONTINUE_META_KEY] && !reasoningMeta?.[DAEMON_RESTORE_ASK_USER_QUESTION_META_KEY] && this.config.applyReasoningOverrides?.()) {
6581
+ this.reconcileReasoningSelection(this.config.getModel(), {
6582
+ persist: false
6583
+ });
6584
+ }
6388
6585
  const result = await this.#executePrompt(
6389
6586
  params,
6390
6587
  pendingSend,
@@ -6521,6 +6718,7 @@ var Session = class {
6521
6718
  const runtimeGaps = this.config.getSessionRestoreRuntime?.()?.historyGaps ?? (normalizeSessionIdForLookup(this.config.getSessionId()) === this.sessionId ? this.restoredHistoryGaps : void 0);
6522
6719
  return buildSessionRecoveryPlanFromApiHistory({
6523
6720
  sessionId: this.sessionId,
6721
+ completedToolCallIds: chat.getCompletedToolCallIds?.(),
6524
6722
  apiHistory: fullHistory ? chat.getHistory() : chat.getHistoryTailShallow?.(TURN_INTERRUPTION_HISTORY_TAIL_COUNT) ?? chat.getHistoryTail(TURN_INTERRUPTION_HISTORY_TAIL_COUNT),
6525
6723
  historyGaps: runtimeGaps?.length ? runtimeGaps : this.config.getResumedSessionData?.()?.historyGaps
6526
6724
  });
@@ -6741,6 +6939,7 @@ var Session = class {
6741
6939
  if (pendingSend.signal.aborted) {
6742
6940
  return { stopReason: "cancelled" };
6743
6941
  }
6942
+ if (goalTurn?.origin !== "runtime") this.notificationsPaused = false;
6744
6943
  this.turn += 1;
6745
6944
  const promptId = this.config.getSessionId() + "########" + this.turn;
6746
6945
  if (!goalTurn && !channelTurn && params._meta?.["qwen.goalProposalApproval"] === true) {
@@ -7001,6 +7200,9 @@ var Session = class {
7001
7200
  continuesTodoWorkChain ? this.activeTodoWorkChainPromptId : void 0
7002
7201
  );
7003
7202
  this.activeTodoWorkChainPromptId = promptId;
7203
+ if (responseCapture.channelTask) {
7204
+ responseCapture.channelTask.workChainId = this.config.getActiveTodoWorkChainOwner(promptId);
7205
+ }
7004
7206
  if (!isRestoreAskUserQuestion) {
7005
7207
  try {
7006
7208
  const fileHistoryService = this.config.getFileHistoryService();
@@ -7516,6 +7718,36 @@ ${this.pendingRecoveredAgentsNotice}
7516
7718
  blockGoalProposalSettlement();
7517
7719
  return { stopReason: "end_turn" };
7518
7720
  }
7721
+ const backgroundParts = await this.#takeCurrentTurnBackgroundParts(
7722
+ promptId,
7723
+ pendingSend.signal
7724
+ );
7725
+ if (backgroundParts.length > 0) {
7726
+ if (pendingSend.signal.aborted || this.pendingPrompt && this.pendingPrompt !== pendingSend) {
7727
+ this.#preserveUnsentMessageHistory(
7728
+ { role: "user", parts: backgroundParts },
7729
+ true
7730
+ );
7731
+ return { stopReason: "cancelled" };
7732
+ }
7733
+ const continuation2 = await this.#runStopContinuation(
7734
+ pendingSend,
7735
+ promptId + "_background_result_" + ++midTurnContinuationCount,
7736
+ promptId,
7737
+ backgroundParts,
7738
+ false,
7739
+ {
7740
+ onFullTurnModel,
7741
+ getModelOverride: /* @__PURE__ */ __name(() => modelOverride, "getModelOverride"),
7742
+ responseCapture,
7743
+ rejectOnLoopDetected,
7744
+ ...goalTurn ? { goalTurn } : {},
7745
+ ...channelTurn ? { channelTurn: true } : {}
7746
+ }
7747
+ );
7748
+ if (continuation2.kind === "terminal") return continuation2;
7749
+ continue;
7750
+ }
7519
7751
  if (this.todoStopGuard.needsStopInspection) {
7520
7752
  const drained = await this.#drainMidTurnInput(pendingSend.signal, {
7521
7753
  watchQueuedPrompt: true,
@@ -7677,7 +7909,7 @@ ${this.pendingRecoveredAgentsNotice}
7677
7909
  await this.messageEmitter.emitAgentMessage(stopOutput.systemMessage);
7678
7910
  }
7679
7911
  if (stopOutput?.isBlockingDecision() || stopOutput?.shouldStopExecution()) {
7680
- externalReason = getStopHookContinuationReason(stopOutput);
7912
+ externalReason = stopOutput.getEffectiveReason();
7681
7913
  stopHookIterationCount++;
7682
7914
  stopHookReasons = [...stopHookReasons, externalReason];
7683
7915
  stopHookCount = response.stopHookCount ?? 1;
@@ -7703,13 +7935,7 @@ ${this.pendingRecoveredAgentsNotice}
7703
7935
  "Stop",
7704
7936
  stopHookBlockingCap
7705
7937
  );
7706
- if (!abortGoalForStopHookCap(
7707
- this.config,
7708
- this.config.getSessionId(),
7709
- warning
7710
- )) {
7711
- await this.#pauseGoalForStopHookCap();
7712
- }
7938
+ await this.#pauseGoalForStopHookCap();
7713
7939
  this.todoStopGuard.suspend();
7714
7940
  blockGoalProposalSettlement();
7715
7941
  await this.messageEmitter.emitAgentMessage(warning);
@@ -8096,11 +8322,13 @@ ${this.pendingRecoveredAgentsNotice}
8096
8322
  const candidate = response.value.candidates[0];
8097
8323
  for (const part of candidate.content?.parts ?? []) {
8098
8324
  if (!part.text) continue;
8099
- this.messageEmitter.emitMessage(
8100
- part.text,
8101
- "assistant",
8102
- part.thought
8103
- );
8325
+ if (!options.responseCapture?.backgroundResponse || part.thought) {
8326
+ this.messageEmitter.emitMessage(
8327
+ part.text,
8328
+ "assistant",
8329
+ part.thought
8330
+ );
8331
+ }
8104
8332
  if (!part.thought) {
8105
8333
  options.responseCapture?.agentOutput.appendText(part.text);
8106
8334
  appendChannelDeliveryResponseText(
@@ -8198,6 +8426,11 @@ ${this.pendingRecoveredAgentsNotice}
8198
8426
  channelDeliveryResponseBlock,
8199
8427
  functionCalls.length > 0
8200
8428
  );
8429
+ if (options.responseCapture?.backgroundResponse) {
8430
+ await options.responseCapture.backgroundResponse(
8431
+ channelDeliveryResponseBlock?.parts.join("") ?? ""
8432
+ );
8433
+ }
8201
8434
  if (usageMetadata) {
8202
8435
  this.#recordPromptTokenCount(usageMetadata, requestRouteKey);
8203
8436
  const durationMs = Date.now() - streamStartTime;
@@ -8348,6 +8581,13 @@ ${this.pendingRecoveredAgentsNotice}
8348
8581
  }
8349
8582
  }
8350
8583
  async sendUpdate(update) {
8584
+ const execution = backgroundTurnContext.getStore();
8585
+ if (execution?.active && execution.sessionId === this.sessionId && update._meta?.["source"] !== "background_task_completed") {
8586
+ update = {
8587
+ ...update,
8588
+ _meta: { ...update._meta, backgroundTurn: { ...execution.turn } }
8589
+ };
8590
+ }
8351
8591
  const projectedUpdate = projectAcpToolResultUpdate(update);
8352
8592
  observeAcpToolResultProjection(update, projectedUpdate, this.sessionId);
8353
8593
  const params = {
@@ -8355,7 +8595,7 @@ ${this.pendingRecoveredAgentsNotice}
8355
8595
  update: projectedUpdate
8356
8596
  };
8357
8597
  const canUpdateTodoPlanRevision = update.sessionUpdate === "plan" && this.config.getApprovalMode() === "plan" /* PLAN */;
8358
- const todoPlanRevision = canUpdateTodoPlanRevision ? this.#readTodoPlanRevision(update) : void 0;
8598
+ const todoPlanRevision = canUpdateTodoPlanRevision && update.sessionUpdate === "plan" ? this.#readTodoPlanRevision(update) : void 0;
8359
8599
  const preservesPendingRevision = todoPlanRevision !== void 0 && todoPlanRevision.structure === this.activeTodoPlanStructure;
8360
8600
  const previousActiveTodoPlanRevision = this.activeTodoPlanRevision;
8361
8601
  const previousActiveTodoPlanStructure = this.activeTodoPlanStructure;
@@ -8760,6 +9000,9 @@ ${this.pendingRecoveredAgentsNotice}
8760
9000
  true
8761
9001
  );
8762
9002
  await this.messageRewriter?.waitForPendingRewrites();
9003
+ goalTurn.endingToolCallId = toolRun.parts.findLast(
9004
+ (part) => part.functionResponse?.id
9005
+ )?.functionResponse?.id;
8763
9006
  return true;
8764
9007
  }
8765
9008
  #recordPromptCompletionEffects(result, responseCapture, isFreshUserTurn) {
@@ -8802,6 +9045,10 @@ ${this.pendingRecoveredAgentsNotice}
8802
9045
  watchQueuedPrompt: toolLoopState.repeatedToolFailureMode !== "off",
8803
9046
  onFullTurnModel
8804
9047
  });
9048
+ const backgroundParts = await this.#takeCurrentTurnBackgroundParts(
9049
+ promptId,
9050
+ abortSignal
9051
+ );
8805
9052
  const hadMidTurnUserInput = drained.parts.length > 0;
8806
9053
  if (hadMidTurnUserInput) {
8807
9054
  this.todoStopGuard.acceptMidTurnUserInput();
@@ -8817,7 +9064,8 @@ ${this.pendingRecoveredAgentsNotice}
8817
9064
  parts: [
8818
9065
  ...toolRun.parts,
8819
9066
  ...activeTodoReminder ? [{ text: activeTodoReminder }] : [],
8820
- ...drained.parts
9067
+ ...drained.parts,
9068
+ ...backgroundParts
8821
9069
  ]
8822
9070
  },
8823
9071
  hadMidTurnUserInput
@@ -8856,7 +9104,8 @@ ${this.pendingRecoveredAgentsNotice}
8856
9104
  ...toolRun.parts,
8857
9105
  ...activeTodoReminder ? [{ text: activeTodoReminder }] : [],
8858
9106
  ...repeatedToolFailureDecision.kind === "warn" ? [{ text: REPEATED_TOOL_FAILURE_REMINDER }] : [],
8859
- ...drained.parts
9107
+ ...drained.parts,
9108
+ ...backgroundParts
8860
9109
  ];
8861
9110
  if (repeatedToolFailureDecision.kind === "stop") {
8862
9111
  this.todoStopGuard.suspend();
@@ -9062,8 +9311,11 @@ ${this.pendingRecoveredAgentsNotice}
9062
9311
  }
9063
9312
  let drainPromise;
9064
9313
  try {
9314
+ const background = backgroundTurnContext.getStore();
9315
+ const promptId = background?.active && background.sessionId === this.sessionId ? background.turn.turnId : getInvocationContext()?.promptId;
9065
9316
  drainPromise = this.client.extMethod(MID_TURN_QUEUE_DRAIN_METHOD, {
9066
9317
  sessionId: this.sessionId,
9318
+ ...promptId ? { promptId } : {},
9067
9319
  // Keep the legacy wire name for ACP host compatibility.
9068
9320
  ...options.watchQueuedPrompt ? { todoStopGuardWatchQueuedPrompt: true } : {}
9069
9321
  });
@@ -9893,6 +10145,7 @@ ${this.pendingRecoveredAgentsNotice}
9893
10145
  displayText,
9894
10146
  modelText,
9895
10147
  taskId: meta.agentId,
10148
+ sourceTurnId: meta.sourceTurnId,
9896
10149
  status: meta.status,
9897
10150
  kind: "agent",
9898
10151
  continuesTodoStopGuardWorkChain: this.#agentContinuesTodoStopGuardWorkChain(meta.agentId),
@@ -9908,6 +10161,10 @@ ${this.pendingRecoveredAgentsNotice}
9908
10161
  }
9909
10162
  );
9910
10163
  const monitorRegistry = this.config.getMonitorRegistry();
10164
+ this.#monitorStatusChangeCallback = () => this.#activeWorkChanged();
10165
+ monitorRegistry.setStatusChangeCallback?.(
10166
+ this.#monitorStatusChangeCallback
10167
+ );
9911
10168
  monitorRegistry.setNotificationCallback((displayText, modelText, meta) => {
9912
10169
  if (meta.status === "running") {
9913
10170
  return;
@@ -10043,6 +10300,23 @@ ${this.pendingRecoveredAgentsNotice}
10043
10300
  }
10044
10301
  }
10045
10302
  this.notificationQueue.push(item);
10303
+ this.config.getChatRecordingService()?.recordBackgroundTaskCompleted?.({
10304
+ displayText: item.displayText,
10305
+ backgroundTask: {
10306
+ taskId: item.taskId,
10307
+ sourceTurnId: item.sourceTurnId,
10308
+ status: item.status,
10309
+ kind: item.kind,
10310
+ toolUseId: item.toolUseId,
10311
+ ...item.structured
10312
+ }
10313
+ });
10314
+ void this.#emitBackgroundNotificationDisplay(
10315
+ item,
10316
+ "background_task_completed"
10317
+ ).catch((error) => {
10318
+ debugLogger6.warn("Failed to publish background task completion:", error);
10319
+ });
10046
10320
  this.#activeWorkChanged();
10047
10321
  void this.#drainNotificationQueue();
10048
10322
  }
@@ -10080,6 +10354,7 @@ ${this.pendingRecoveredAgentsNotice}
10080
10354
  item.displayText,
10081
10355
  {
10082
10356
  taskId: item.taskId,
10357
+ sourceTurnId: item.sourceTurnId,
10083
10358
  status: item.status,
10084
10359
  kind: item.kind,
10085
10360
  toolUseId: item.toolUseId,
@@ -10102,11 +10377,89 @@ ${this.pendingRecoveredAgentsNotice}
10102
10377
  }
10103
10378
  return true;
10104
10379
  }
10380
+ async #takeCurrentTurnBackgroundParts(promptId, signal) {
10381
+ if (signal.aborted || this.notificationsPaused) return [];
10382
+ const turnId = this.backgroundTurn?.turnId ?? getInvocationContext()?.promptId ?? promptId;
10383
+ const parts = [];
10384
+ for (let index = 0; index < this.notificationQueue.length; ) {
10385
+ const item = this.notificationQueue[index];
10386
+ if (item.sourceTurnId !== turnId) {
10387
+ index++;
10388
+ continue;
10389
+ }
10390
+ this.notificationQueue.splice(index, 1);
10391
+ const droppedSummary = this.droppedNotifications.take();
10392
+ if (droppedSummary) {
10393
+ parts.push({ text: droppedSummary.modelText });
10394
+ this.config.getChatRecordingService()?.recordNotification(
10395
+ [{ text: droppedSummary.modelText }],
10396
+ droppedSummary.displayText
10397
+ );
10398
+ try {
10399
+ await this.#emitDroppedNotificationSummary(droppedSummary);
10400
+ } catch (error) {
10401
+ debugLogger6.warn(
10402
+ "Failed to display dropped notification summary:",
10403
+ error
10404
+ );
10405
+ }
10406
+ }
10407
+ if (!item.persisted) {
10408
+ this.config.getChatRecordingService()?.recordNotification([{ text: item.modelText }], item.displayText, {
10409
+ taskId: item.taskId,
10410
+ status: item.status,
10411
+ kind: item.kind,
10412
+ toolUseId: item.toolUseId,
10413
+ sourceTurnId: item.sourceTurnId,
10414
+ ...item.structured
10415
+ });
10416
+ }
10417
+ parts.push({ text: item.modelText });
10418
+ try {
10419
+ await this.#emitBackgroundNotificationDisplay(item);
10420
+ } catch (error) {
10421
+ debugLogger6.warn(
10422
+ "Failed to display consumed background result:",
10423
+ error
10424
+ );
10425
+ }
10426
+ }
10427
+ if (parts.length > 0) this.#activeWorkChanged();
10428
+ return parts;
10429
+ }
10430
+ #deferBackgroundAdmission(item) {
10431
+ if (this.disposed) return;
10432
+ this.notificationQueue.unshift(item);
10433
+ this.notificationAdmissionDeferred = true;
10434
+ if (this.notificationsPaused) return;
10435
+ const attempt = item.admissionRetries ?? 0;
10436
+ item.admissionRetries = attempt + 1;
10437
+ if (attempt >= 3) {
10438
+ void backgroundTurnContext.exit(
10439
+ () => this.#emitAgentDiagnosticMessageSafely(
10440
+ "Background result retained after repeated start failures. Send a message to retry.",
10441
+ "Failed to display deferred background result"
10442
+ )
10443
+ );
10444
+ return;
10445
+ }
10446
+ this.notificationAdmissionRetry = setTimeout(
10447
+ () => {
10448
+ this.notificationAdmissionRetry = void 0;
10449
+ if (this.disposed || this.notificationsPaused) return;
10450
+ this.notificationAdmissionDeferred = false;
10451
+ void this.#drainNotificationQueue();
10452
+ },
10453
+ 1e3 * 2 ** attempt
10454
+ );
10455
+ this.notificationAdmissionRetry.unref?.();
10456
+ }
10105
10457
  async #drainNotificationQueue() {
10106
10458
  if (this.disposed) return;
10107
10459
  if (this.closing) return;
10108
10460
  if (this.#isAutomaticWorkHeld()) return;
10109
10461
  if (this.notificationProcessing) return;
10462
+ if (this.notificationsPaused || this.notificationAdmissionDeferred) return;
10110
10463
  if (this.pendingPrompt || this.goalProcessing || this.cronProcessing || this.cronAbortController) {
10111
10464
  return;
10112
10465
  }
@@ -10119,6 +10472,7 @@ ${this.pendingRecoveredAgentsNotice}
10119
10472
  }
10120
10473
  async #drainNotificationQueueExclusive() {
10121
10474
  if (this.disposed || this.closing || this.notificationProcessing) return;
10475
+ if (this.notificationsPaused || this.notificationAdmissionDeferred) return;
10122
10476
  if (this.#isAutomaticWorkHeld()) return;
10123
10477
  if (this.pendingPrompt || this.cronProcessing || this.cronAbortController) {
10124
10478
  return;
@@ -10132,6 +10486,11 @@ ${this.pendingRecoveredAgentsNotice}
10132
10486
  debugLogger6.warn(
10133
10487
  `Notification turn rejected [session ${this.sessionId}]: ${error instanceof Error ? error.message : String(error)}`
10134
10488
  );
10489
+ const index = this.#nextNotificationQueueIndex();
10490
+ if (index >= 0)
10491
+ this.#deferBackgroundAdmission(
10492
+ this.notificationQueue.splice(index, 1)[0]
10493
+ );
10135
10494
  return;
10136
10495
  }
10137
10496
  if (this.disposed || this.closing || this.notificationProcessing || this.pendingPrompt || this.goalProcessing || this.cronProcessing || this.cronAbortController || this.#nextNotificationQueueIndex() < 0) {
@@ -10144,7 +10503,7 @@ ${this.pendingRecoveredAgentsNotice}
10144
10503
  resolveCompletion = resolve7;
10145
10504
  });
10146
10505
  try {
10147
- while (this.notificationQueue.length > 0) {
10506
+ while (this.notificationQueue.length > 0 && !this.notificationsPaused && !this.notificationAdmissionDeferred) {
10148
10507
  if (this.pendingPrompt || this.goalProcessing || this.cronProcessing || this.cronAbortController) {
10149
10508
  break;
10150
10509
  }
@@ -10155,21 +10514,48 @@ ${this.pendingRecoveredAgentsNotice}
10155
10514
  this.currentAgentNotificationTaskId = item.kind === "agent" ? item.taskId : null;
10156
10515
  this.currentWorkflowNotificationTaskId = item.kind === "workflow" ? item.taskId : null;
10157
10516
  this.currentShellNotificationActive = item.kind === "shell";
10517
+ this.currentNotificationWorkChainId = item.todoWorkChainId;
10158
10518
  this.#activeWorkChanged();
10159
10519
  try {
10160
- await goalTurnContext.exit(
10161
- () => runWithInvocationContext(
10162
- void 0,
10163
- () => sessionIdContext.run(
10164
- this.config.getSessionId(),
10165
- () => this.#executeBackgroundNotificationPromptInner(item)
10520
+ const turn = item.turn ??= {
10521
+ turnId: `${this.sessionId}########notification${randomUUID()}`,
10522
+ taskId: item.taskId,
10523
+ kind: item.kind,
10524
+ ...item.toolUseId ? { toolUseId: item.toolUseId } : {},
10525
+ ...item.sourceTurnId ? { sourceTurnId: item.sourceTurnId } : {},
10526
+ ...item.label ? { label: item.label } : {},
10527
+ startedAt: Date.now()
10528
+ };
10529
+ const channelTask = item.todoWorkChainId ? [...this.channelTaskCaptures].find(
10530
+ (capture) => capture.workChainId === item.todoWorkChainId && !capture.signal.aborted
10531
+ ) : void 0;
10532
+ const context = { sessionId: this.sessionId, turn, active: true };
10533
+ try {
10534
+ const execute = /* @__PURE__ */ __name(() => goalTurnContext.exit(
10535
+ () => runOutsideAgentContext(
10536
+ () => runWithInvocationContext(
10537
+ void 0,
10538
+ () => sessionIdContext.run(
10539
+ this.config.getSessionId(),
10540
+ () => this.#executeBackgroundNotificationPromptInner(
10541
+ item,
10542
+ turn,
10543
+ channelTask
10544
+ )
10545
+ )
10546
+ )
10166
10547
  )
10167
- )
10168
- );
10548
+ ), "execute");
10549
+ if (channelTask) await backgroundTurnContext.exit(execute);
10550
+ else await backgroundTurnContext.run(context, execute);
10551
+ } finally {
10552
+ context.active = false;
10553
+ }
10169
10554
  } finally {
10170
10555
  this.currentAgentNotificationTaskId = null;
10171
10556
  this.currentWorkflowNotificationTaskId = null;
10172
10557
  this.currentShellNotificationActive = false;
10558
+ this.currentNotificationWorkChainId = void 0;
10173
10559
  this.#activeWorkChanged();
10174
10560
  }
10175
10561
  }
@@ -10180,7 +10566,7 @@ ${this.pendingRecoveredAgentsNotice}
10180
10566
  this.#activeWorkChanged();
10181
10567
  void this.#drainGoalQueue();
10182
10568
  void this.#drainCronQueue();
10183
- if (this.notificationQueue.length > 0 && !this.pendingPrompt && !this.goalProcessing && !this.cronProcessing && !this.cronAbortController) {
10569
+ if (this.notificationQueue.length > 0 && !this.notificationsPaused && !this.notificationAdmissionDeferred && !this.pendingPrompt && !this.goalProcessing && !this.cronProcessing && !this.cronAbortController) {
10184
10570
  void this.#drainNotificationQueue();
10185
10571
  }
10186
10572
  }
@@ -10188,20 +10574,25 @@ ${this.pendingRecoveredAgentsNotice}
10188
10574
  #nextNotificationQueueIndex() {
10189
10575
  if (this.notificationQueue.length === 0) return -1;
10190
10576
  if (this.todoStopGuardQueuedPromptPriority) return -1;
10191
- if (!this.todoStopGuard.blocksUnrelatedAutomaticTurns) return 0;
10577
+ const channelTasks = [...this.channelTaskCaptures].filter(
10578
+ (capture) => capture.workChainId && !capture.signal.aborted
10579
+ );
10192
10580
  return this.notificationQueue.findIndex(
10193
- (item) => this.#notificationContinuesTodoStopGuardWorkChain(item)
10581
+ (item) => (!this.todoStopGuard.blocksUnrelatedAutomaticTurns || this.#notificationContinuesTodoStopGuardWorkChain(item)) && (channelTasks.length === 0 || channelTasks.some(
10582
+ (capture) => capture.workChainId === item.todoWorkChainId
10583
+ ))
10194
10584
  );
10195
10585
  }
10196
- async #executeBackgroundNotificationPromptInner(item) {
10586
+ async #executeBackgroundNotificationPromptInner(item, turn, channelTask) {
10197
10587
  return Storage.runWithRuntimeBaseDir(
10198
10588
  this.runtimeBaseDir,
10199
10589
  this.config.getWorkingDir(),
10200
10590
  async () => {
10201
10591
  const ac = new AbortController();
10202
- const promptId = this.config.getSessionId() + "########notification" + Date.now();
10592
+ const promptId = turn.turnId;
10203
10593
  let responseSegmentEmitted = false;
10204
10594
  let responseTurnComplete = false;
10595
+ let admitted = false;
10205
10596
  const finishBackgroundNotificationTurn = /* @__PURE__ */ __name(async (reason, partial = false) => {
10206
10597
  if (responseSegmentEmitted && !responseTurnComplete) {
10207
10598
  try {
@@ -10215,20 +10606,79 @@ ${this.pendingRecoveredAgentsNotice}
10215
10606
  );
10216
10607
  responseTurnComplete = true;
10217
10608
  await this.messageRewriter?.flushTurn(ac.signal);
10609
+ await this.messageRewriter?.waitForPendingRewrites();
10218
10610
  } catch (error) {
10219
10611
  debugLogger6.warn(
10220
10612
  `Failed to complete background notification response: ${this.#formatError(error)}`
10221
10613
  );
10222
10614
  }
10223
10615
  }
10224
- await this.#emitBackgroundNotificationEndTurn(reason);
10616
+ await this.#emitBackgroundNotificationEndTurn(
10617
+ reason,
10618
+ channelTask ? void 0 : promptId
10619
+ );
10225
10620
  }, "finishBackgroundNotificationTurn");
10621
+ const emitBackgroundResponse = /* @__PURE__ */ __name(async (text) => {
10622
+ if (!text.length) return;
10623
+ await this.#emitBackgroundNotificationResponse(
10624
+ item,
10625
+ text,
10626
+ ac.signal,
10627
+ promptId,
10628
+ false
10629
+ );
10630
+ responseSegmentEmitted = true;
10631
+ }, "emitBackgroundResponse");
10226
10632
  this.notificationAbortController = ac;
10227
10633
  const continuesCurrentWorkChain = this.#notificationContinuesTodoStopGuardWorkChain(item);
10228
10634
  this.#prepareTodoStopGuardForAutomaticTurn(continuesCurrentWorkChain);
10229
10635
  try {
10230
10636
  await this.assertCanStartTurn();
10231
- if (ac.signal.aborted) return;
10637
+ if (ac.signal.aborted) {
10638
+ this.notificationQueue.unshift(item);
10639
+ return;
10640
+ }
10641
+ if (channelTask?.signal.aborted) {
10642
+ this.#deferBackgroundAdmission(item);
10643
+ return;
10644
+ }
10645
+ if (!channelTask) {
10646
+ let admission;
10647
+ let admissionTimeoutHandle;
10648
+ try {
10649
+ admission = await Promise.race([
10650
+ this.client.extMethod("_qwencode/start_turn", {
10651
+ sessionId: this.sessionId,
10652
+ source: "background_notification",
10653
+ ...turn,
10654
+ ...this.lastCompletedRpcPromptId ? { afterPromptId: this.lastCompletedRpcPromptId } : {}
10655
+ }),
10656
+ new Promise((_, reject) => {
10657
+ admissionTimeoutHandle = setTimeout(
10658
+ () => reject(new BackgroundTurnAdmissionTimeoutError()),
10659
+ MID_TURN_QUEUE_DRAIN_TIMEOUT_MS
10660
+ );
10661
+ })
10662
+ ]);
10663
+ } catch (error) {
10664
+ const code = error && typeof error === "object" && "code" in error ? error.code : void 0;
10665
+ if (code !== -32601) throw error;
10666
+ } finally {
10667
+ clearTimeout(admissionTimeoutHandle);
10668
+ }
10669
+ if (admission?.["accepted"] === false) {
10670
+ this.#deferBackgroundAdmission(item);
10671
+ return;
10672
+ }
10673
+ }
10674
+ admitted = true;
10675
+ if (!channelTask) this.backgroundTurn = turn;
10676
+ if (ac.signal.aborted) {
10677
+ delete item.turn;
10678
+ this.notificationQueue.unshift(item);
10679
+ await finishBackgroundNotificationTurn("cancelled", true);
10680
+ return;
10681
+ }
10232
10682
  this.config.startAutomaticActiveTodoWorkChain(
10233
10683
  promptId,
10234
10684
  item.todoWorkChainId
@@ -10255,6 +10705,7 @@ ${this.pendingRecoveredAgentsNotice}
10255
10705
  item.displayText,
10256
10706
  {
10257
10707
  taskId: item.taskId,
10708
+ sourceTurnId: item.sourceTurnId,
10258
10709
  status: item.status,
10259
10710
  kind: item.kind,
10260
10711
  toolUseId: item.toolUseId,
@@ -10284,6 +10735,7 @@ ${this.pendingRecoveredAgentsNotice}
10284
10735
  while (nextMessage !== null) {
10285
10736
  if (ac.signal.aborted) {
10286
10737
  this.todoStopGuard.suspend();
10738
+ this.#preserveUnsentMessageHistory(nextMessage, true);
10287
10739
  await finishBackgroundNotificationTurn("cancelled", true);
10288
10740
  return;
10289
10741
  }
@@ -10377,18 +10829,7 @@ ${this.pendingRecoveredAgentsNotice}
10377
10829
  await messageDisplay?.finish();
10378
10830
  }
10379
10831
  }
10380
- const turnComplete = functionCalls.length === 0;
10381
- if (responseText.length > 0 || turnComplete && responseSegmentEmitted) {
10382
- await this.#emitBackgroundNotificationResponse(
10383
- item,
10384
- responseText,
10385
- ac.signal,
10386
- promptId,
10387
- turnComplete
10388
- );
10389
- if (responseText.length > 0) responseSegmentEmitted = true;
10390
- if (turnComplete) responseTurnComplete = true;
10391
- }
10832
+ await emitBackgroundResponse(responseText);
10392
10833
  if (this.messageRewriter) {
10393
10834
  await this.messageRewriter.flushTurn(ac.signal);
10394
10835
  }
@@ -10433,26 +10874,53 @@ ${this.pendingRecoveredAgentsNotice}
10433
10874
  );
10434
10875
  return;
10435
10876
  }
10877
+ } else {
10878
+ const input = await this.#drainMidTurnUserMessages(ac.signal);
10879
+ const results = await this.#takeCurrentTurnBackgroundParts(
10880
+ promptId,
10881
+ ac.signal
10882
+ );
10883
+ if (input.length > 0) this.todoStopGuard.acceptMidTurnUserInput();
10884
+ if (input.length > 0 || results.length > 0) {
10885
+ nextMessage = { role: "user", parts: [...input, ...results] };
10886
+ }
10436
10887
  }
10437
10888
  }
10438
10889
  if (this.messageRewriter) {
10439
10890
  await this.messageRewriter.waitForPendingRewrites();
10440
10891
  }
10441
10892
  let stopReason = "end_turn";
10893
+ let loopProtectionStopped = false;
10442
10894
  if (this.todoStopGuard.needsStopInspection) {
10443
- stopReason = (await this.#handleStopHookLoop(
10895
+ const responseCapture = {
10896
+ agentOutput: new AgentOutputMessageCapture(this.config),
10897
+ backgroundResponse: emitBackgroundResponse
10898
+ };
10899
+ const guardResult = await this.#handleStopHookLoop(
10444
10900
  ac,
10445
10901
  promptId,
10446
10902
  false,
10447
10903
  void 0,
10448
- false
10449
- )).stopReason;
10904
+ false,
10905
+ void 0,
10906
+ responseCapture
10907
+ );
10908
+ stopReason = guardResult.stopReason;
10909
+ loopProtectionStopped = guardResult.loopProtectionStopped === true;
10450
10910
  }
10451
10911
  await finishBackgroundNotificationTurn(
10452
10912
  ac.signal.aborted ? "cancelled" : stopReason,
10453
- ac.signal.aborted
10913
+ ac.signal.aborted || stopReason === "cancelled" || loopProtectionStopped
10454
10914
  );
10455
10915
  } catch (error) {
10916
+ if (!admitted) {
10917
+ this.#deferBackgroundAdmission(item);
10918
+ debugLogger6.warn(
10919
+ "Background turn could not start; retaining result:",
10920
+ error
10921
+ );
10922
+ return;
10923
+ }
10456
10924
  if (ac.signal.aborted) {
10457
10925
  this.todoStopGuard.suspend();
10458
10926
  await finishBackgroundNotificationTurn("cancelled", true);
@@ -10475,6 +10943,10 @@ ${this.pendingRecoveredAgentsNotice}
10475
10943
  }
10476
10944
  } finally {
10477
10945
  this.config.endAutomaticActiveTodoWorkChain(promptId);
10946
+ if (admitted && !channelTask)
10947
+ this.finishedBackgroundTurnId = promptId;
10948
+ if (this.backgroundTurn?.turnId === promptId)
10949
+ this.backgroundTurn = void 0;
10478
10950
  if (this.notificationAbortController === ac) {
10479
10951
  this.notificationAbortController = null;
10480
10952
  }
@@ -10493,15 +10965,16 @@ ${this.pendingRecoveredAgentsNotice}
10493
10965
  }
10494
10966
  });
10495
10967
  }
10496
- async #emitBackgroundNotificationDisplay(item) {
10968
+ async #emitBackgroundNotificationDisplay(item, source = "background_notification") {
10497
10969
  await this.sendUpdate({
10498
10970
  sessionUpdate: "agent_message_chunk",
10499
10971
  content: { type: "text", text: item.displayText },
10500
10972
  _meta: {
10501
- source: "background_notification",
10973
+ source,
10502
10974
  qwenDiscreteMessage: true,
10503
10975
  backgroundTask: {
10504
10976
  taskId: item.taskId,
10977
+ sourceTurnId: item.sourceTurnId,
10505
10978
  status: item.status,
10506
10979
  kind: item.kind,
10507
10980
  toolUseId: item.toolUseId,
@@ -10511,6 +10984,20 @@ ${this.pendingRecoveredAgentsNotice}
10511
10984
  });
10512
10985
  }
10513
10986
  async #emitBackgroundNotificationResponse(item, text, signal, turnId, turnComplete, partial = false) {
10987
+ let channelTaskOutput = false;
10988
+ for (const capture of this.channelTaskCaptures) {
10989
+ if (capture.workChainId && capture.workChainId === item.todoWorkChainId && !capture.signal.aborted) {
10990
+ if (text.trim()) {
10991
+ capture.finalText = text;
10992
+ capture.finalResponseTurnId = turnId;
10993
+ capture.partial = false;
10994
+ }
10995
+ if (turnComplete && capture.finalResponseTurnId === turnId) {
10996
+ capture.partial = partial;
10997
+ }
10998
+ channelTaskOutput = true;
10999
+ }
11000
+ }
10514
11001
  const rawLabel = item.label ?? (item.kind === "agent" ? void 0 : item.structured?.description ?? item.structured?.commandLabel);
10515
11002
  const label = rawLabel ? truncateNotificationLabel(rawLabel) : void 0;
10516
11003
  const update = {
@@ -10519,8 +11006,10 @@ ${this.pendingRecoveredAgentsNotice}
10519
11006
  _meta: {
10520
11007
  source: "background_notification_response",
10521
11008
  qwenDiscreteMessage: true,
11009
+ ...channelTaskOutput ? { [CHANNEL_TASK_OUTPUT_META_KEY]: true } : {},
10522
11010
  backgroundTask: {
10523
11011
  taskId: item.taskId,
11012
+ sourceTurnId: item.sourceTurnId,
10524
11013
  status: item.status,
10525
11014
  kind: item.kind,
10526
11015
  toolUseId: item.toolUseId,
@@ -10537,11 +11026,12 @@ ${this.pendingRecoveredAgentsNotice}
10537
11026
  }
10538
11027
  await this.sendUpdate(update);
10539
11028
  }
10540
- async #emitBackgroundNotificationEndTurn(reason) {
11029
+ async #emitBackgroundNotificationEndTurn(reason, turnId) {
10541
11030
  try {
10542
11031
  await this.client.extNotification("_qwencode/end_turn", {
10543
11032
  sessionId: this.sessionId,
10544
11033
  reason,
11034
+ ...turnId ? { turnId } : {},
10545
11035
  source: "background_notification"
10546
11036
  });
10547
11037
  } catch (error) {
@@ -10642,15 +11132,16 @@ ${this.pendingRecoveredAgentsNotice}
10642
11132
  };
10643
11133
  await this.sendUpdate(update);
10644
11134
  }
10645
- /**
10646
- * Requests permission from the client for a tool call.
10647
- * Used by SubAgentTracker for sub-agent approval requests.
10648
- */
10649
- async requestPermission(params) {
10650
- return this.client.requestPermission(params);
11135
+ #withBackgroundPermission(params) {
11136
+ const execution = backgroundTurnContext.getStore();
11137
+ return execution?.active && execution.sessionId === this.sessionId ? {
11138
+ ...params,
11139
+ _meta: { ...params._meta, backgroundTurn: execution.turn }
11140
+ } : params;
10651
11141
  }
10652
11142
  #requestPermissionQueued(params, signal) {
10653
- const prior = permissionRequestTails.get(this.client) ?? Promise.resolve();
11143
+ params = this.#withBackgroundPermission(params);
11144
+ const prior = this.permissionRequestTail;
10654
11145
  const transportRequest = prior.then(
10655
11146
  () => signal.aborted ? requestPermissionWithAbort(this.client, params, signal) : this.client.requestPermission(params)
10656
11147
  );
@@ -10668,7 +11159,7 @@ ${this.pendingRecoveredAgentsNotice}
10668
11159
  ]).finally(() => {
10669
11160
  if (abortListener) signal.removeEventListener("abort", abortListener);
10670
11161
  });
10671
- permissionRequestTails.set(this.client, tail);
11162
+ this.permissionRequestTail = tail;
10672
11163
  return requestPermissionWithAbort(
10673
11164
  { requestPermission: /* @__PURE__ */ __name(() => transportRequest, "requestPermission") },
10674
11165
  params,
@@ -13935,8 +14426,11 @@ var ActiveWorkReporter = class {
13935
14426
  try {
13936
14427
  sessions = [];
13937
14428
  for (const source of this.listSources()) {
14429
+ const finishedBackgroundTurnId = source.getFinishedBackgroundTurnId?.();
13938
14430
  sessions.push({
13939
14431
  sessionId: source.sessionId,
14432
+ ...finishedBackgroundTurnId ? { finishedBackgroundTurnId } : {},
14433
+ ...source.hasRunningBackgroundTasks ? { hasRunningBackgroundTasks: source.hasRunningBackgroundTasks() } : {},
13940
14434
  holds: source.collectActiveWorkHolds().filter((hold) => this.#enabledCategories.has(hold.category))
13941
14435
  });
13942
14436
  }
@@ -14080,7 +14574,7 @@ import * as path5 from "node:path";
14080
14574
 
14081
14575
  // packages/cli/src/acp-integration/skill-source-download.ts
14082
14576
  init_esbuild_shims();
14083
- import { Readable, Writable } from "node:stream";
14577
+ import { Readable, Writable as Writable2 } from "node:stream";
14084
14578
  import { pipeline } from "node:stream/promises";
14085
14579
  import * as path4 from "node:path";
14086
14580
  import { createGunzip } from "node:zlib";
@@ -14232,7 +14726,7 @@ async function extractFilesFromTarGz(archiveBytes, directoryPath, limits = {}) {
14232
14726
  // `Readable.from(uint8array)` would otherwise iterate it byte-by-byte.
14233
14727
  Readable.from([Buffer.from(archiveBytes)]),
14234
14728
  createGunzip(),
14235
- new Writable({
14729
+ new Writable2({
14236
14730
  write(chunk, _enc, cb) {
14237
14731
  total += chunk.length;
14238
14732
  if (total > maxDecompressedBytes) {
@@ -15065,6 +15559,12 @@ function serializeWorkflowTask(entry, now) {
15065
15559
  id: entry.runId,
15066
15560
  ...optionalField("toolUseId", entry.toolUseId),
15067
15561
  ...optionalField("workflowName", entry.workflowName),
15562
+ ...optionalField("sourceRef", entry.sourceRef && { ...entry.sourceRef }),
15563
+ ...optionalField(
15564
+ "workflowCalls",
15565
+ entry.workflowCalls?.map((call) => ({ ...call }))
15566
+ ),
15567
+ ...optionalField("workflowCallsTruncated", entry.workflowCallsTruncated),
15068
15568
  ...optionalField("sourceRunId", entry.sourceRunId),
15069
15569
  ...optionalField("startMode", entry.startMode),
15070
15570
  label: entry.meta?.name ?? entry.workflowName ?? entry.description ?? entry.runId,
@@ -15084,6 +15584,10 @@ function serializeWorkflowTask(entry, now) {
15084
15584
  agentsDispatched: entry.agentsDispatched,
15085
15585
  agentsCompleted: entry.agentsCompleted,
15086
15586
  agentsRespawned: entry.agentsRespawned ?? 0,
15587
+ ...optionalField(
15588
+ "sizeWarning",
15589
+ entry.sizeWarning ? { ...entry.sizeWarning } : void 0
15590
+ ),
15087
15591
  tokensSpent: entry.tokensSpent,
15088
15592
  tokenBudgetTotal: entry.tokenBudgetTotal,
15089
15593
  recentLogs: [...entry.recentLogs],
@@ -15107,6 +15611,15 @@ function serializeWorkflowSnapshot(snapshot) {
15107
15611
  isHistorical: true,
15108
15612
  ...optionalField("toolUseId", snapshot.toolUseId),
15109
15613
  ...optionalField("workflowName", snapshot.workflowName),
15614
+ ...optionalField(
15615
+ "sourceRef",
15616
+ snapshot.sourceRef && { ...snapshot.sourceRef }
15617
+ ),
15618
+ ...optionalField(
15619
+ "workflowCalls",
15620
+ snapshot.workflowCalls?.map((call) => ({ ...call }))
15621
+ ),
15622
+ ...optionalField("workflowCallsTruncated", snapshot.workflowCallsTruncated),
15110
15623
  ...optionalField("sourceRunId", snapshot.sourceRunId),
15111
15624
  ...optionalField("startMode", snapshot.startMode),
15112
15625
  label: snapshot.meta?.name ?? snapshot.workflowName ?? snapshot.description ?? snapshot.runId,
@@ -15125,6 +15638,10 @@ function serializeWorkflowSnapshot(snapshot) {
15125
15638
  agentsDispatched: snapshot.agentsDispatched,
15126
15639
  agentsCompleted: snapshot.agentsCompleted,
15127
15640
  agentsRespawned: snapshot.agentsRespawned ?? 0,
15641
+ ...optionalField(
15642
+ "sizeWarning",
15643
+ snapshot.sizeWarning ? { ...snapshot.sizeWarning } : void 0
15644
+ ),
15128
15645
  tokensSpent: snapshot.tokensSpent,
15129
15646
  tokenBudgetTotal: snapshot.tokenBudgetTotal,
15130
15647
  recentLogs: [...snapshot.recentLogs],
@@ -15311,6 +15828,26 @@ function isSessionOwnedWorkflowTool(value) {
15311
15828
  return typeof value === "object" && value !== null && "buildSessionOwnedBackground" in value && typeof value.buildSessionOwnedBackground === "function";
15312
15829
  }
15313
15830
  __name(isSessionOwnedWorkflowTool, "isSessionOwnedWorkflowTool");
15831
+ async function startSessionOwnedWorkflow(tool, params, workflowName) {
15832
+ let invocation;
15833
+ try {
15834
+ invocation = tool.buildSessionOwnedBackground(params, workflowName);
15835
+ } catch (error) {
15836
+ throw RequestError.invalidParams(
15837
+ { errorKind: "workflow_invalid_params" },
15838
+ error instanceof Error ? error.message : String(error)
15839
+ );
15840
+ }
15841
+ const result = await invocation.execute(new AbortController().signal);
15842
+ if (result.error?.type === "invalid_tool_params" /* INVALID_TOOL_PARAMS */) {
15843
+ throw RequestError.invalidParams(
15844
+ { errorKind: "workflow_invalid_params" },
15845
+ result.error.message
15846
+ );
15847
+ }
15848
+ return result;
15849
+ }
15850
+ __name(startSessionOwnedWorkflow, "startSessionOwnedWorkflow");
15314
15851
  var debugLogger9 = createDebugLogger("ACP_AGENT");
15315
15852
  var QWEN_ACP_LOCAL_READ_ROOTS_ENV = "QWEN_ACP_LOCAL_READ_ROOTS";
15316
15853
  var POSIX_TMP_LOCAL_READ_ROOT = "/tmp";
@@ -16948,16 +17485,17 @@ async function runAcpAgent(config, settings, argv, options) {
16948
17485
  });
16949
17486
  let agentInstance;
16950
17487
  let connection;
17488
+ let output;
16951
17489
  markAcpStartup("transportSetupStart");
16952
17490
  try {
16953
- const stdout = Writable2.toWeb(process.stdout);
17491
+ output = createAcpOutput(process.stdout);
16954
17492
  const stdin = Readable2.toWeb(process.stdin);
16955
17493
  console.log = console.error;
16956
17494
  console.info = console.error;
16957
17495
  console.debug = console.error;
16958
17496
  let initializeRequestId;
16959
17497
  const pendingNewSessionRequestIds = /* @__PURE__ */ new Set();
16960
- const stream = ndJsonStream(stdout, stdin, {
17498
+ const stream = ndJsonStream(output.stream, stdin, {
16961
17499
  onMessageObserved: /* @__PURE__ */ __name(({ direction, bytes, message }) => {
16962
17500
  if (direction === "sent") {
16963
17501
  observeAcpToolResultWire(message, bytes);
@@ -17159,6 +17697,7 @@ async function runAcpAgent(config, settings, argv, options) {
17159
17697
  const shutdownHandler = /* @__PURE__ */ __name(async () => {
17160
17698
  if (shuttingDown) return;
17161
17699
  shuttingDown = true;
17700
+ prepareFileWatchersForProcessExit();
17162
17701
  debugLogger9.debug("[ACP] Shutdown signal received, closing streams");
17163
17702
  if (agentInstance?.isTrustedManagedParent()) {
17164
17703
  let exitCode = 0;
@@ -17203,8 +17742,10 @@ async function runAcpAgent(config, settings, argv, options) {
17203
17742
  }, "shutdownHandler");
17204
17743
  process.on("SIGTERM", shutdownHandler);
17205
17744
  process.on("SIGINT", shutdownHandler);
17745
+ const shutdownFailures = [];
17206
17746
  try {
17207
17747
  await connection.closed;
17748
+ prepareFileWatchersForProcessExit();
17208
17749
  if (agentInstance?.isTrustedManagedParent()) {
17209
17750
  try {
17210
17751
  await shutdownManagedAgent(
@@ -17220,11 +17761,22 @@ async function runAcpAgent(config, settings, argv, options) {
17220
17761
  await drainPoolBeforeExit("ide_close");
17221
17762
  await disposeSessionsOnce();
17222
17763
  }
17764
+ } catch (error) {
17765
+ shutdownFailures.push(error);
17223
17766
  } finally {
17767
+ try {
17768
+ if (!shuttingDown) await output.close();
17769
+ } catch (error) {
17770
+ if (!shuttingDown) shutdownFailures.push(error);
17771
+ }
17224
17772
  process.off("SIGTERM", shutdownHandler);
17225
17773
  process.off("SIGINT", shutdownHandler);
17226
17774
  eventLoopMonitor.dispose();
17227
17775
  }
17776
+ if (shutdownFailures.length === 1) throw shutdownFailures[0];
17777
+ if (shutdownFailures.length > 1) {
17778
+ throw new AggregateError(shutdownFailures, "ACP EOF shutdown failed");
17779
+ }
17228
17780
  }
17229
17781
  __name(runAcpAgent, "runAcpAgent");
17230
17782
  function toStdioServer(server) {
@@ -18155,8 +18707,20 @@ var QwenAgent = class _QwenAgent {
18155
18707
  pendingConfigCleanupKey(runtimeBaseDir, sessionId) {
18156
18708
  return `${path7.resolve(runtimeBaseDir)}\0${sessionId}`;
18157
18709
  }
18158
- withAskUserQuestionRestoreHint(session, response) {
18159
- if (this.argv.restoreAskUserQuestion !== true) {
18710
+ withSessionRestoreMeta(session, response, suppressQuestionHint) {
18711
+ const backgroundTurn = session?.getBackgroundTurn?.();
18712
+ const hasRunningBackgroundTasks = session?.hasRunningBackgroundTasks?.();
18713
+ if (backgroundTurn || hasRunningBackgroundTasks !== void 0) {
18714
+ response = {
18715
+ ...response,
18716
+ _meta: {
18717
+ ...response._meta,
18718
+ ...backgroundTurn ? { backgroundTurn } : {},
18719
+ ...hasRunningBackgroundTasks !== void 0 ? { hasRunningBackgroundTasks } : {}
18720
+ }
18721
+ };
18722
+ }
18723
+ if (suppressQuestionHint || this.argv.restoreAskUserQuestion !== true) {
18160
18724
  return response;
18161
18725
  }
18162
18726
  if (!session?.shouldHintAskUserQuestionRestore()) {
@@ -18341,7 +18905,9 @@ var QwenAgent = class _QwenAgent {
18341
18905
  );
18342
18906
  }, "ownsSessionId")
18343
18907
  });
18344
- if (messaging === null) this.peerMessagingStart = null;
18908
+ if (messaging === null && getLastPeerInboxFailure()?.cause !== "unsupported_platform") {
18909
+ this.peerMessagingStart = null;
18910
+ }
18345
18911
  return messaging;
18346
18912
  } catch (error) {
18347
18913
  debugLogger9.error(
@@ -18379,7 +18945,7 @@ var QwenAgent = class _QwenAgent {
18379
18945
  * question nobody asks of a session a daemon is driving.
18380
18946
  */
18381
18947
  registerHostedSession(sessionId, config, settings) {
18382
- if (settings.merged.agents?.crossSessionMessaging !== true) return;
18948
+ if (!isCrossSessionMessagingEnabled(settings.merged)) return;
18383
18949
  this.startPeerMessaging();
18384
18950
  if (this.registeredSessions.has(sessionId)) return;
18385
18951
  this.registeredSessions.add(sessionId);
@@ -18571,7 +19137,7 @@ var QwenAgent = class _QwenAgent {
18571
19137
  }
18572
19138
  this.clientCapabilities = args.clientCapabilities;
18573
19139
  const authMethods = buildAuthMethods();
18574
- const version = "0.23.5-dev.codemode-responses.20260915.af4da34719";
19140
+ const version = "0.23.5-preview.0";
18575
19141
  const response = {
18576
19142
  protocolVersion: PROTOCOL_VERSION,
18577
19143
  agentInfo: {
@@ -18869,7 +19435,11 @@ var QwenAgent = class _QwenAgent {
18869
19435
  const restoreOptions = loadRestoreOptions(params);
18870
19436
  const suppressRestoreAskUserQuestion = params._meta?.[DAEMON_SUPPRESS_RESTORE_ASK_USER_QUESTION_META_KEY] === true;
18871
19437
  const suppressWorktreeContextRestore = params._meta?.[DAEMON_SUPPRESS_WORKTREE_CONTEXT_RESTORE_META_KEY] === true;
18872
- const withRestoreHint = /* @__PURE__ */ __name((session, response) => suppressRestoreAskUserQuestion ? response : this.withAskUserQuestionRestoreHint(session, response), "withRestoreHint");
19438
+ const withRestoreHint = /* @__PURE__ */ __name((session, response) => this.withSessionRestoreMeta(
19439
+ session,
19440
+ response,
19441
+ suppressRestoreAskUserQuestion
19442
+ ), "withRestoreHint");
18873
19443
  const liveSession = this.sessions.get(sessionId);
18874
19444
  if (liveSession) {
18875
19445
  const settings = profiler.timeSync(
@@ -19279,7 +19849,11 @@ var QwenAgent = class _QwenAgent {
19279
19849
  }
19280
19850
  const suppressRestoreAskUserQuestion = params._meta?.[DAEMON_SUPPRESS_RESTORE_ASK_USER_QUESTION_META_KEY] === true;
19281
19851
  const suppressWorktreeContextRestore = params._meta?.[DAEMON_SUPPRESS_WORKTREE_CONTEXT_RESTORE_META_KEY] === true;
19282
- const withRestoreHint = /* @__PURE__ */ __name((session, response) => suppressRestoreAskUserQuestion ? response : this.withAskUserQuestionRestoreHint(session, response), "withRestoreHint");
19852
+ const withRestoreHint = /* @__PURE__ */ __name((session, response) => this.withSessionRestoreMeta(
19853
+ session,
19854
+ response,
19855
+ suppressRestoreAskUserQuestion
19856
+ ), "withRestoreHint");
19283
19857
  const liveSession = this.sessions.get(sessionId);
19284
19858
  if (liveSession) {
19285
19859
  const settings = profiler.timeSync(
@@ -19658,6 +20232,7 @@ var QwenAgent = class _QwenAgent {
19658
20232
  const suppliedPromptDisplayText = meta[DAEMON_PROMPT_DISPLAY_TEXT_META_KEY];
19659
20233
  const submittedPrompt = this.privateParentState === "trusted" ? meta[DAEMON_SUBMITTED_PROMPT_META_KEY] : meta[SUBMITTED_PROMPT_META_KEY];
19660
20234
  const suppliedChannelPrompt = meta[CHANNEL_PROMPT_META_KEY];
20235
+ const suppliedChannelOutputMode = meta[CHANNEL_OUTPUT_MODE_META_KEY];
19661
20236
  const suppliedGoalProposalApproval = meta["qwen.goalProposalApproval"];
19662
20237
  const suppliedChannelDelivery = meta[DAEMON_CHANNEL_DELIVERY_META_KEY];
19663
20238
  delete meta[INVOCATION_CONTEXT_META_KEY];
@@ -19670,6 +20245,7 @@ var QwenAgent = class _QwenAgent {
19670
20245
  meta[DAEMON_SUBMITTED_PROMPT_META_KEY] = submittedPrompt;
19671
20246
  }
19672
20247
  delete meta[CHANNEL_PROMPT_META_KEY];
20248
+ delete meta[CHANNEL_OUTPUT_MODE_META_KEY];
19673
20249
  delete meta["qwen.goalProposalApproval"];
19674
20250
  if (this.privateParentState === "trusted" && suppliedGoalProposalApproval === true) {
19675
20251
  meta["qwen.goalProposalApproval"] = true;
@@ -19680,6 +20256,9 @@ var QwenAgent = class _QwenAgent {
19680
20256
  }
19681
20257
  if (this.privateParentState === "trusted" && suppliedChannelPrompt === true) {
19682
20258
  meta[CHANNEL_PROMPT_META_KEY] = true;
20259
+ if (suppliedChannelOutputMode === "per_task") {
20260
+ meta[CHANNEL_OUTPUT_MODE_META_KEY] = suppliedChannelOutputMode;
20261
+ }
19683
20262
  }
19684
20263
  if (this.privateParentState === "trusted" && suppliedChannelDelivery !== void 0) {
19685
20264
  meta[DAEMON_CHANNEL_DELIVERY_META_KEY] = suppliedChannelDelivery;
@@ -20735,25 +21314,25 @@ var QwenAgent = class _QwenAgent {
20735
21314
  providers.set(authType, provider);
20736
21315
  }
20737
21316
  const isCurrent = currentAuth === model.authType && currentAcpModelId === modelId;
20738
- const resolved = !model.isRuntimeModel && !modelId.startsWith(ACP_ROUTE_ID_PREFIX) ? config.getResolvedModelConfig?.(
21317
+ const resolved = !model.isRuntimeModel ? config.getResolvedModelConfig?.(
20739
21318
  model.authType,
20740
21319
  model.id,
20741
- model.registryBaseUrl ?? model.baseUrl
21320
+ model.registryBaseUrl
20742
21321
  ) : void 0;
20743
- const configOptions = model.isRuntimeModel || modelId.startsWith(ACP_ROUTE_ID_PREFIX) ? void 0 : buildModelReasoningConfigPreview(
20744
- model.id,
20745
- resolvePersistedReasoningConfigState(
20746
- model.id,
20747
- settings.merged.model?.reasoningEffort,
20748
- resolved?.generationConfig.thinkingMandatory === true,
20749
- model.capabilities?.reasoning
21322
+ const generation = {
21323
+ ...resolved?.generationConfig,
21324
+ model: model.id,
21325
+ authType: model.authType,
21326
+ baseUrl: resolved?.baseUrl
21327
+ };
21328
+ const configOptions = model.isRuntimeModel ? void 0 : buildModelReasoningRoutePreview(
21329
+ generation,
21330
+ resolveReasoningCapabilities(
21331
+ generation,
21332
+ model.capabilities?.reasoning ?? resolved?.capabilities?.reasoning
20750
21333
  ),
20751
- model.capabilities?.reasoning,
20752
- resolved ? {
20753
- ...resolved.generationConfig,
20754
- model: model.id,
20755
- baseUrl: resolved.baseUrl
20756
- } : void 0
21334
+ settings.merged.model?.reasoningEffort,
21335
+ modelId.startsWith(ACP_ROUTE_ID_PREFIX)
20757
21336
  );
20758
21337
  const providerModel = {
20759
21338
  modelId,
@@ -21226,6 +21805,13 @@ var QwenAgent = class _QwenAgent {
21226
21805
  availableCommands: workflowsEnabled || !config.isWorkflowsEnabled() ? availableCommands : availableCommands.filter((command) => command.name !== "workflows"),
21227
21806
  availableSkills: availableSkills ?? [],
21228
21807
  workflowsEnabled,
21808
+ workflowToolFeatures: {
21809
+ sourceRef: true,
21810
+ agentStepId: true,
21811
+ workflowStepId: true,
21812
+ runSavedArgs: true,
21813
+ runScript: true
21814
+ },
21229
21815
  savedWorkflows
21230
21816
  };
21231
21817
  }
@@ -21473,35 +22059,23 @@ var QwenAgent = class _QwenAgent {
21473
22059
  buildWorkspaceHooksStatus(config) {
21474
22060
  try {
21475
22061
  const workspaceCwd = this.workspaceCwd(config);
21476
- const disabled = config.getDisableAllHooks();
21477
- const hookSystem = config.getHookSystem();
21478
- if (!hookSystem) {
21479
- return {
21480
- v: STATUS_SCHEMA_VERSION,
21481
- workspaceCwd,
21482
- initialized: true,
21483
- disabled,
21484
- hooks: [],
21485
- events: IDLE_HOOK_EVENTS
21486
- };
21487
- }
21488
- const registryEntries = hookSystem.getAllHooks();
21489
- const hooks = registryEntries.map(
21490
- (entry) => ({
22062
+ const listing = buildHooksListing(config);
22063
+ const hooks = listing.rows.filter((row) => row.origin === "registry").map(
22064
+ (row) => ({
21491
22065
  kind: "hook",
21492
- eventName: entry.eventName,
21493
- config: this.serializeHookConfig(entry.config),
21494
- source: entry.source,
21495
- ...entry.matcher ? { matcher: entry.matcher } : {},
21496
- ...entry.sequential !== void 0 ? { sequential: entry.sequential } : {},
21497
- enabled: entry.enabled
22066
+ eventName: row.eventName,
22067
+ config: this.serializeHookConfig(row.config),
22068
+ source: row.source,
22069
+ ...row.matcher ? { matcher: row.matcher } : {},
22070
+ ...row.sequential !== void 0 ? { sequential: row.sequential } : {},
22071
+ enabled: row.enabled
21498
22072
  })
21499
22073
  );
21500
22074
  return {
21501
22075
  v: STATUS_SCHEMA_VERSION,
21502
22076
  workspaceCwd,
21503
22077
  initialized: true,
21504
- disabled,
22078
+ disabled: listing.allDisabled,
21505
22079
  hooks,
21506
22080
  events: IDLE_HOOK_EVENTS
21507
22081
  };
@@ -24527,18 +25101,23 @@ ${outputText}
24527
25101
  );
24528
25102
  }
24529
25103
  const action = params["action"];
24530
- if (action !== "pause" && action !== "resume" && action !== "retry" && action !== "rerun" && action !== "delete-history" && action !== "run-saved") {
25104
+ if (action !== "pause" && action !== "resume" && action !== "retry" && action !== "rerun" && action !== "delete-history" && action !== "run-saved" && action !== "run-script") {
24531
25105
  throw RequestError.invalidParams(
24532
25106
  void 0,
24533
- 'action must be "pause", "resume", "retry", "rerun", "delete-history", or "run-saved"'
25107
+ 'action must be "pause", "resume", "retry", "rerun", "delete-history", "run-saved", or "run-script"'
24534
25108
  );
24535
25109
  }
25110
+ const startInput = {
25111
+ // `args` is any JSON value, `null` included, so presence decides.
25112
+ ...Object.hasOwn(params, "args") ? { args: params["args"] } : {},
25113
+ ...params["sourceRef"] !== void 0 ? { sourceRef: params["sourceRef"] } : {}
25114
+ };
24536
25115
  const session = this.sessionOrThrow(sessionId);
24537
25116
  const config = session.getConfig();
24538
25117
  if (!this.canUseWorkflowControls(config)) {
24539
25118
  return { changed: false };
24540
25119
  }
24541
- const mutationClaim = action === "run-saved" ? getWorkflowTaskMutationKey(config, taskId, "saved") : getWorkflowTaskMutationKey(config, taskId);
25120
+ const mutationClaim = action === "run-saved" ? getWorkflowTaskMutationKey(config, taskId, "saved") : action === "run-script" ? getWorkflowTaskMutationKey(config, taskId, "script") : getWorkflowTaskMutationKey(config, taskId);
24542
25121
  if (action === "delete-history") {
24543
25122
  const attempt = await tryWithWorkflowTaskMutation(
24544
25123
  mutationClaim,
@@ -24575,12 +25154,50 @@ ${outputText}
24575
25154
  "The workflow tool is unavailable; cannot run this saved workflow."
24576
25155
  );
24577
25156
  }
24578
- const result = await workflowTool.buildSessionOwnedBackground(
24579
- {
24580
- scriptPath: savedWorkflow.scriptPath
24581
- },
25157
+ const result = await startSessionOwnedWorkflow(
25158
+ workflowTool,
25159
+ { ...startInput, scriptPath: savedWorkflow.scriptPath },
24582
25160
  savedWorkflow.name
24583
- ).execute(new AbortController().signal);
25161
+ );
25162
+ const startedTask = result.workflowRunId ? registry.get(result.workflowRunId) : void 0;
25163
+ return startedTask ? {
25164
+ changed: true,
25165
+ status: startedTask.status,
25166
+ taskId: startedTask.runId
25167
+ } : { changed: false };
25168
+ }
25169
+ );
25170
+ if (!attempt.acquired) {
25171
+ return { changed: false };
25172
+ }
25173
+ return attempt.value;
25174
+ }
25175
+ if (action === "run-script") {
25176
+ const script = params["script"];
25177
+ if (typeof script !== "string" || script.length === 0) {
25178
+ throw RequestError.invalidParams(
25179
+ { errorKind: "workflow_invalid_params" },
25180
+ '`script` is required for the "run-script" action'
25181
+ );
25182
+ }
25183
+ const attempt = await tryWithWorkflowTaskMutation(
25184
+ mutationClaim,
25185
+ async () => {
25186
+ const workflowTool = config.getToolRegistry().getTool(ToolNames.WORKFLOW);
25187
+ if (!isSessionOwnedWorkflowTool(workflowTool)) {
25188
+ throw RequestError.invalidParams(
25189
+ void 0,
25190
+ "The workflow tool is unavailable; cannot run this script."
25191
+ );
25192
+ }
25193
+ const result = await startSessionOwnedWorkflow(
25194
+ workflowTool,
25195
+ { ...startInput, script },
25196
+ // No definition name: a caller-supplied script is named by its
25197
+ // own `export const meta`, which is where the run's label
25198
+ // comes from when no saved workflow backs it.
25199
+ void 0
25200
+ );
24584
25201
  const startedTask = result.workflowRunId ? registry.get(result.workflowRunId) : void 0;
24585
25202
  return startedTask ? {
24586
25203
  changed: true,
@@ -24631,12 +25248,14 @@ ${outputText}
24631
25248
  const startParams = {
24632
25249
  ...readableScriptPath ? { scriptPath: readableScriptPath } : { script: task.script },
24633
25250
  args: task.args,
25251
+ ...task.sourceRef ? { sourceRef: task.sourceRef } : {},
24634
25252
  ...action === "retry" ? { resumeFromRunId: task.runId } : {}
24635
25253
  };
24636
- const result = await workflowTool.buildSessionOwnedBackground(
25254
+ const result = await startSessionOwnedWorkflow(
25255
+ workflowTool,
24637
25256
  startParams,
24638
25257
  readableScriptPath ? task.workflowName : void 0
24639
- ).execute(new AbortController().signal);
25258
+ );
24640
25259
  if (action === "rerun") {
24641
25260
  const rerunTask = result.workflowRunId ? registry.get(result.workflowRunId) : void 0;
24642
25261
  if (rerunTask) {
@@ -25723,6 +26342,18 @@ ${outputText}
25723
26342
  const skipped = [];
25724
26343
  const results = await Promise.allSettled(
25725
26344
  sessions.map(async ([id, session]) => {
26345
+ const reasoningError = session.getConfig().stageReasoningOverrides?.(
26346
+ newMerged.modelProviders,
26347
+ newMerged.providerProtocol ?? {}
26348
+ );
26349
+ if (reasoningError)
26350
+ await session.sendUpdate({
26351
+ sessionUpdate: "agent_message_chunk",
26352
+ content: { type: "text", text: reasoningError },
26353
+ _meta: { qwenDiscreteMessage: true }
26354
+ }).catch(
26355
+ (error) => debugLogger9.warn("Reasoning notice delivery failed", error)
26356
+ );
25726
26357
  if (!session.isIdle()) {
25727
26358
  skipped.push(id);
25728
26359
  return;
@@ -26795,7 +27426,7 @@ ${outputText}
26795
27426
  config,
26796
27427
  currentModelId
26797
27428
  );
26798
- if (activeRuntimeSnapshot || currentModelId.startsWith(ACP_ROUTE_ID_PREFIX) || !isReasoningSelectionSupported(
27429
+ if (activeRuntimeSnapshot || currentModelId.startsWith(ACP_ROUTE_ID_PREFIX) && !modelReasoning?.profile || !isReasoningSelectionSupported(
26799
27430
  rawCurrentModelId,
26800
27431
  REASONING_EFFORT_DEFAULT,
26801
27432
  false,
@@ -26820,6 +27451,9 @@ ${outputText}
26820
27451
  generation,
26821
27452
  modelReasoning
26822
27453
  );
27454
+ if (modelReasoning?.profile && gptOverride?.enabled && gptOverride.useDefaultEffort) {
27455
+ return [modeConfigOption, modelConfigOption];
27456
+ }
26823
27457
  const gptEnableOverride = generation.reasoning === false ? getGptReasoningOverrideState(
26824
27458
  { ...generation, reasoning: void 0 },
26825
27459
  modelReasoning
@@ -26878,10 +27512,8 @@ ${outputText}
26878
27512
  config.getAuthType?.(),
26879
27513
  config.getCurrentModelRegistryBaseUrl?.()
26880
27514
  );
26881
- if (completeModelId.startsWith(ACP_ROUTE_ID_PREFIX)) {
26882
- return void 0;
26883
- }
26884
- return getConfiguredModelReasoning(config);
27515
+ const reasoning = getConfiguredModelReasoning(config);
27516
+ return completeModelId.startsWith(ACP_ROUTE_ID_PREFIX) && !reasoning?.profile ? void 0 : reasoning;
26885
27517
  }
26886
27518
  buildSelectableModelOptions(config) {
26887
27519
  const currentAuthType = config.getAuthType();