@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
@@ -3,6 +3,7 @@
3
3
  import {
4
4
  ClientSideConnection,
5
5
  PROTOCOL_VERSION,
6
+ RequestError,
6
7
  ndJsonStream
7
8
  } from "./chunk-IJOS26LH.js";
8
9
  import {
@@ -461,6 +462,18 @@ init_esbuild_shims();
461
462
  var CHANNEL_PROMPT_DISPLAY_TEXT_META_KEY = "qwen.daemon.promptDisplayText";
462
463
  var CHANNEL_PROMPT_AUTHORIZATION_META_KEY = "qwen.daemon.channelPromptAuthorization";
463
464
  var CHANNEL_PROMPT_META_KEY = "qwen.channel.prompt";
465
+ var CHANNEL_OUTPUT_MODE_META_KEY = "qwen.channel.outputMode";
466
+ var CHANNEL_TASK_RESULT_META_KEY = "qwen.channel.taskResult";
467
+ var CHANNEL_TASK_RESULT_PARTIAL_META_KEY = "qwen.channel.taskResultPartial";
468
+ var CHANNEL_TASK_OUTPUT_META_KEY = "qwen.channel.taskOutput";
469
+ var ChannelPromptCancelledError = class extends Error {
470
+ static {
471
+ __name(this, "ChannelPromptCancelledError");
472
+ }
473
+ constructor() {
474
+ super("Channel task cancelled");
475
+ }
476
+ };
464
477
  var CHANNEL_BTW_METHOD = "qwen/control/session/btw";
465
478
  var ACP_PRIVATE_PARENT_CAPABILITY_META_KEY = "qwen-code/private-parent-capability";
466
479
  var ACP_PRIVATE_PARENT_CAPABILITY_ENV = "QWEN_CODE_PRIVATE_ACP_CAPABILITY";
@@ -857,22 +870,32 @@ var AcpBridge = class extends EventEmitter {
857
870
  }
858
871
  prompt.push({ type: "text", text });
859
872
  try {
860
- await conn.prompt({
873
+ const result = await conn.prompt({
861
874
  sessionId,
862
875
  prompt,
863
876
  _meta: {
864
877
  [CHANNEL_PROMPT_META_KEY]: true,
878
+ ...options?.outputMode === "per_task" ? { [CHANNEL_OUTPUT_MODE_META_KEY]: "per_task" } : {},
865
879
  ...options?.displayText !== void 0 ? {
866
880
  [CHANNEL_PROMPT_DISPLAY_TEXT_META_KEY]: options.displayText
867
881
  } : {}
868
882
  }
869
883
  });
884
+ if (options?.outputMode === "per_task" && result?.stopReason === "cancelled") {
885
+ throw new ChannelPromptCancelledError();
886
+ }
887
+ const taskResult = result?._meta?.[CHANNEL_TASK_RESULT_META_KEY];
888
+ if (options?.outputMode === "per_task") {
889
+ options.onTaskResult?.({
890
+ partial: result?._meta?.[CHANNEL_TASK_RESULT_PARTIAL_META_KEY] === true
891
+ });
892
+ }
893
+ return options?.outputMode === "per_task" && typeof taskResult === "string" && taskResult.trim() ? taskResult : chunks.join("") || slashCommandOutput;
870
894
  } finally {
871
895
  this.off("textChunk", onChunk);
872
896
  this.off("slashCommandOutput", onSlashCommandOutput);
873
897
  this.off("responseBoundary", clearChunks);
874
898
  }
875
- return chunks.join("") || slashCommandOutput;
876
899
  }
877
900
  async btw(sessionId, question, signal) {
878
901
  if (!this.knownSessionIds.has(sessionId)) {
@@ -957,7 +980,7 @@ var AcpBridge = class extends EventEmitter {
957
980
  }
958
981
  const content = update["content"];
959
982
  if (meta?.["qwenDiscreteMessage"] === true) {
960
- if (meta["source"] === "background_notification_response" && meta["rewritten"] !== true) {
983
+ if (meta["source"] === "background_notification_response" && meta["rewritten"] !== true && meta[CHANNEL_TASK_OUTPUT_META_KEY] !== true) {
961
984
  const context = parseBackgroundResponseContext(meta["backgroundTask"]);
962
985
  if (content?.type === "text" && (content.text || context?.turnComplete)) {
963
986
  this.emit("backgroundResponse", sessionId, content.text ?? "", context);
@@ -1149,7 +1172,7 @@ var AcpBridge = class extends EventEmitter {
1149
1172
  hasQueuedPrompt: false
1150
1173
  };
1151
1174
  }
1152
- throw new Error(`Method not found: ${method}`);
1175
+ throw RequestError.methodNotFound(method);
1153
1176
  }
1154
1177
  async handleClientMcpMessage(params) {
1155
1178
  if (!this.channelLoopMcpServer) {
@@ -1230,6 +1253,35 @@ function formatSkippedRegistrationReason(result) {
1230
1253
  }
1231
1254
  __name(formatSkippedRegistrationReason, "formatSkippedRegistrationReason");
1232
1255
 
1256
+ // packages/channels/base/dist/output-mode.js
1257
+ init_esbuild_shims();
1258
+ var DEFAULT_CHANNEL_OUTPUT_MODE = "per_turn";
1259
+ var CHANNEL_OUTPUT_MODE_FIELD = {
1260
+ key: "outputMode",
1261
+ label: "Output Mode",
1262
+ kind: "enum",
1263
+ default: DEFAULT_CHANNEL_OUTPUT_MODE,
1264
+ description: "Choose one final result for the complete task, each complete assistant response, or the last reply in each turn. Defaults to per turn: the main response finishes independently of background follow-ups. Applies to cards and ordinary messages.",
1265
+ options: [
1266
+ { value: "per_task", label: "Per task" },
1267
+ { value: "per_response", label: "Per response" },
1268
+ { value: "per_turn", label: "Per turn (default)" }
1269
+ ]
1270
+ };
1271
+ function parseChannelOutputMode(name, value, supportsOutputMode) {
1272
+ if (value === void 0) {
1273
+ return supportsOutputMode ? DEFAULT_CHANNEL_OUTPUT_MODE : void 0;
1274
+ }
1275
+ if (!supportsOutputMode) {
1276
+ throw new Error(`Channel "${name}" does not support outputMode.`);
1277
+ }
1278
+ if (value !== "per_task" && value !== "per_response" && value !== "per_turn") {
1279
+ throw new Error(`Channel "${name}" outputMode must be "per_task", "per_response", or "per_turn".`);
1280
+ }
1281
+ return value;
1282
+ }
1283
+ __name(parseChannelOutputMode, "parseChannelOutputMode");
1284
+
1233
1285
  // packages/channels/base/dist/index.js
1234
1286
  init_esbuild_shims();
1235
1287
 
@@ -2130,7 +2182,7 @@ var SessionRouter = class {
2130
2182
  * heals it through the superseded redirect — the failed reset drops the
2131
2183
  * old id from the live set so that load consults the daemon again.
2132
2184
  */
2133
- async replaceManagedWorktreeSession(sessionId, target, workspaceCwd, expectedCwd) {
2185
+ async replaceManagedWorktreeSession(sessionId, target, workspaceCwd, expectedCwd, beforeForget) {
2134
2186
  const bridge = this.bridge;
2135
2187
  if (!bridge.resetWorktreeSession) {
2136
2188
  throw new Error("Worktree reset is not supported by this bridge");
@@ -2156,6 +2208,7 @@ var SessionRouter = class {
2156
2208
  this.toTarget.set(replacementId, target);
2157
2209
  this.toCwd.set(replacementId, actualCwd);
2158
2210
  this.liveSessionIds.add(replacementId);
2211
+ beforeForget?.();
2159
2212
  this.forgetManagedSession(sessionId);
2160
2213
  return replacementId;
2161
2214
  } catch (error) {
@@ -2224,13 +2277,14 @@ var SessionRouter = class {
2224
2277
  if (changed)
2225
2278
  this.persist();
2226
2279
  }
2227
- async detachManagedSession(sessionId) {
2280
+ async detachManagedSession(sessionId, beforeForget) {
2228
2281
  try {
2229
2282
  if (this.bridge.discardSession) {
2230
2283
  await this.bridge.discardSession(sessionId);
2231
2284
  } else if (this.liveSessionIds.has(sessionId)) {
2232
2285
  throw new Error("Managed session detach is not supported");
2233
2286
  }
2287
+ beforeForget?.();
2234
2288
  } finally {
2235
2289
  this.forgetManagedSession(sessionId);
2236
2290
  }
@@ -2730,6 +2784,7 @@ var NamedSessionManager = class {
2730
2784
  filePath;
2731
2785
  router;
2732
2786
  isBusy;
2787
+ onSessionRetiring;
2733
2788
  now;
2734
2789
  registry;
2735
2790
  taskBySessionId;
@@ -2747,6 +2802,7 @@ var NamedSessionManager = class {
2747
2802
  this.filePath = options.filePath;
2748
2803
  this.router = options.router;
2749
2804
  this.isBusy = options.isBusy;
2805
+ this.onSessionRetiring = options.onSessionRetiring;
2750
2806
  this.now = options.now ?? Date.now;
2751
2807
  this.registry = this.readRegistry();
2752
2808
  this.taskBySessionId = this.buildTaskIndex(this.registry);
@@ -2986,7 +3042,7 @@ var NamedSessionManager = class {
2986
3042
  this.router.activateManagedSession(replacementSessionId ?? replacement.sessionId, replacement.target, replacement.cwd, { isolation: replacement.isolation, workspaceCwd: this.cwd });
2987
3043
  }
2988
3044
  try {
2989
- await this.router.detachManagedSession(task.sessionId);
3045
+ await this.router.detachManagedSession(task.sessionId, () => this.onSessionRetiring?.(task.sessionId));
2990
3046
  } catch (error) {
2991
3047
  const healedReplacement = replacement !== void 0 && replacementSessionId !== void 0 && replacementSessionId !== replacement.sessionId ? { ...replacement, sessionId: replacementSessionId } : void 0;
2992
3048
  this.commitOwner(healedReplacement ? this.replaceTask(owner, healedReplacement, owner.activeTaskName) : owner);
@@ -3059,6 +3115,7 @@ var NamedSessionManager = class {
3059
3115
  throw error;
3060
3116
  }
3061
3117
  this.router.activateManagedSession(sessionId, updatedTask.target, updatedTask.cwd, { isolation: updatedTask.isolation, workspaceCwd: this.cwd });
3118
+ this.onSessionRetiring?.(task.sessionId);
3062
3119
  this.router.forgetManagedSession(task.sessionId);
3063
3120
  this.repointSupersededSessionIds(task.sessionId, sessionId);
3064
3121
  this.supersededSessionIds.delete(task.sessionId);
@@ -3225,7 +3282,7 @@ var NamedSessionManager = class {
3225
3282
  }
3226
3283
  async resetWorktreeSession(task) {
3227
3284
  try {
3228
- return await this.router.replaceManagedWorktreeSession(task.sessionId, task.target, this.cwd, task.cwd);
3285
+ return await this.router.replaceManagedWorktreeSession(task.sessionId, task.target, this.cwd, task.cwd, () => this.onSessionRetiring?.(task.sessionId));
3229
3286
  } catch (error) {
3230
3287
  throw new NamedSessionTaskError(`Could not reset task "${task.name}".`, task.name, { cause: error });
3231
3288
  }
@@ -4332,6 +4389,14 @@ var ChannelBase = class {
4332
4389
  }
4333
4390
  await this.deliverBackgroundResponseToTarget(sessionId, text, delivery);
4334
4391
  }
4392
+ getBackgroundResponseSourceLabel(sessionId) {
4393
+ const target = this.router.getTarget(sessionId);
4394
+ const presentation = this.namedSessions?.presentation(sessionId);
4395
+ if (!target || target.channelName !== this.name || !this.router.isSessionLive(sessionId) || !presentation || presentation.status !== "open" || !this.sameTaskOwner(target, presentation.target)) {
4396
+ return void 0;
4397
+ }
4398
+ return this.createSourceLabel(presentation, target);
4399
+ }
4335
4400
  async resolveBackgroundResponseDelivery(sessionId) {
4336
4401
  let target = this.router.getTarget(sessionId);
4337
4402
  if (!target || target.channelName !== this.name)
@@ -4863,7 +4928,8 @@ No answer is available from the current conversation context.`;
4863
4928
  cwd: config.cwd,
4864
4929
  filePath: join5(options.stateDir, "named-sessions.json"),
4865
4930
  router: this.router,
4866
- isBusy: /* @__PURE__ */ __name((sessionId) => this.isNamedSessionBusy(sessionId), "isBusy")
4931
+ isBusy: /* @__PURE__ */ __name((sessionId) => this.isNamedSessionBusy(sessionId), "isBusy"),
4932
+ onSessionRetiring: /* @__PURE__ */ __name((sessionId) => this.onSessionRetiring(sessionId), "onSessionRetiring")
4867
4933
  });
4868
4934
  }
4869
4935
  this.registerSharedCommands();
@@ -5787,9 +5853,13 @@ ${promptText}` : promptText;
5787
5853
  active.cancelPending = false;
5788
5854
  }).then((cancelSucceeded) => {
5789
5855
  const turnEnded = this.activePrompts.get(sessionId) !== active;
5790
- if (!cancelSucceeded || active.deliveryStarted || turnEnded && !active.cancelled) {
5856
+ if (!cancelSucceeded || active.deliveryStarted || turnEnded && !active.cancelled && !active.cancellationEmitted) {
5791
5857
  return false;
5792
5858
  }
5859
+ if (turnEnded) {
5860
+ this.emitTaskCancellation(active, sessionId, reason);
5861
+ return true;
5862
+ }
5793
5863
  active.cancelled = true;
5794
5864
  this.dropCollectBuffer(sessionId);
5795
5865
  this.removePendingPermissionsForSession(sessionId, "run_cancelled");
@@ -6525,7 +6595,6 @@ ${requestList}`);
6525
6595
  const result = await namedSessions.close(owner, parts[0]);
6526
6596
  if (closing) {
6527
6597
  this.cancelBtw(closing.sessionId);
6528
- this.onSessionRetiring(closing.sessionId);
6529
6598
  }
6530
6599
  await this.sendThreadMessage(envelope.chatId, envelope.threadId, result.active ? `Closed task "${result.closed.name}". Selected "${result.active.name}".` : `Closed task "${result.closed.name}". No task is selected.`);
6531
6600
  return true;
@@ -6595,8 +6664,9 @@ ${requestList}`);
6595
6664
  this.clearPendingGroupHistory(envelope);
6596
6665
  if (removedIds.length > 0) {
6597
6666
  for (const id of removedIds) {
6598
- if (id !== retiringSessionId)
6667
+ if (!this.namedSessions && id !== retiringSessionId) {
6599
6668
  this.onSessionRetiring(id);
6669
+ }
6600
6670
  this.cancelBtw(id);
6601
6671
  if (this.isSharedSession(envelope)) {
6602
6672
  const who = sanitizeSenderName(envelope.senderName || envelope.senderId || "unknown");
@@ -8451,8 +8521,15 @@ ${promptToSend}`;
8451
8521
  const promptBridge = this.bridge;
8452
8522
  promptBridge.on("textChunk", onChunk);
8453
8523
  promptBridge.on("responseBoundary", onResponseBoundary);
8524
+ let taskResultPartial = false;
8454
8525
  try {
8455
8526
  const response = await promptBridge.prompt(sessionId, promptToSend, {
8527
+ ...this.config.outputMode === "per_task" ? {
8528
+ outputMode: "per_task",
8529
+ onTaskResult: /* @__PURE__ */ __name(({ partial }) => {
8530
+ taskResultPartial = partial;
8531
+ }, "onTaskResult")
8532
+ } : {},
8456
8533
  ...images.length > 0 ? { images } : {},
8457
8534
  imageBase64,
8458
8535
  imageMimeType,
@@ -8467,6 +8544,8 @@ ${promptToSend}`;
8467
8544
  if (!promptState.cancelled && response) {
8468
8545
  promptState.deliveryStarted = true;
8469
8546
  const segment = this.ensureOutputSegment(sessionId, promptState);
8547
+ if (segment && taskResultPartial)
8548
+ segment.partial = true;
8470
8549
  await this.onResponseComplete(envelope.chatId, response, sessionId, segment);
8471
8550
  if (segment && promptState.activeSegmentId === segment.segmentId) {
8472
8551
  promptState.activeSegmentId = void 0;
@@ -8484,10 +8563,14 @@ ${promptToSend}`;
8484
8563
  });
8485
8564
  }
8486
8565
  } catch (err) {
8566
+ const runtimeCancelled = !promptState.deliveryStarted && err instanceof ChannelPromptCancelledError;
8487
8567
  if (!promptState.deliveryStarted) {
8488
8568
  await this.settleCancelRequested(promptState);
8569
+ if (runtimeCancelled) {
8570
+ this.emitTaskCancellation(promptState, sessionId, "runtime_cancelled");
8571
+ }
8489
8572
  }
8490
- if (!promptState.cancelled) {
8573
+ if (!promptState.cancelled && !runtimeCancelled) {
8491
8574
  releaseHeldChunks();
8492
8575
  const segment = this.closeOutputSegment(sessionId, promptState);
8493
8576
  void this.notifyOutputSegmentEnd(envelope.chatId, sessionId, segment, "failed");
@@ -8504,7 +8587,7 @@ ${promptToSend}`;
8504
8587
  process.stderr.write(`[${channel}] turn ${safeMessageId} threw after cancellation for session ${safeSessionId}: ${this.lifecycleError(err)}
8505
8588
  `);
8506
8589
  }
8507
- if (promptState.cancelled) {
8590
+ if (promptState.cancelled || runtimeCancelled) {
8508
8591
  return;
8509
8592
  }
8510
8593
  if (sourceLabel) {
@@ -8825,6 +8908,7 @@ var DaemonChannelBridge = class extends EventEmitter2 {
8825
8908
  requestToSession = /* @__PURE__ */ new Map();
8826
8909
  respondedRequestToSession = /* @__PURE__ */ new Map();
8827
8910
  activePrompts = /* @__PURE__ */ new Set();
8911
+ taskOutputs = /* @__PURE__ */ new Map();
8828
8912
  activePromptControllers = /* @__PURE__ */ new Map();
8829
8913
  availableCommandsBySession = /* @__PURE__ */ new Map();
8830
8914
  toolCallKindsBySession = /* @__PURE__ */ new Map();
@@ -8987,6 +9071,9 @@ var DaemonChannelBridge = class extends EventEmitter2 {
8987
9071
  throw new Error(`Prompt already in flight for daemon session ${sessionId}`);
8988
9072
  }
8989
9073
  this.activePrompts.add(sessionId);
9074
+ const taskOutput = options?.outputMode === "per_task" ? {} : void 0;
9075
+ if (taskOutput)
9076
+ this.taskOutputs.set(sessionId, taskOutput);
8990
9077
  const controller = new AbortController();
8991
9078
  let controllers = this.activePromptControllers.get(sessionId);
8992
9079
  if (!controllers) {
@@ -9103,6 +9190,7 @@ var DaemonChannelBridge = class extends EventEmitter2 {
9103
9190
  prompt,
9104
9191
  _meta: {
9105
9192
  [CHANNEL_PROMPT_META_KEY]: true,
9193
+ ...options?.outputMode === "per_task" ? { [CHANNEL_OUTPUT_MODE_META_KEY]: "per_task" } : {},
9106
9194
  ...promptAuthorization ? {
9107
9195
  [CHANNEL_PROMPT_AUTHORIZATION_META_KEY]: promptAuthorization
9108
9196
  } : {},
@@ -9121,7 +9209,13 @@ var DaemonChannelBridge = class extends EventEmitter2 {
9121
9209
  turnBarrier,
9122
9210
  new Promise((resolve3) => setTimeout(resolve3, 0))
9123
9211
  ]);
9124
- const textResult = chunks.join("") || slashCommandOutput;
9212
+ if (options?.outputMode === "per_task" && result.stopReason === "cancelled") {
9213
+ throw new ChannelPromptCancelledError();
9214
+ }
9215
+ if (taskOutput) {
9216
+ options?.onTaskResult?.({ partial: taskOutput.partial === true });
9217
+ }
9218
+ const textResult = taskOutput?.text || chunks.join("") || slashCommandOutput;
9125
9219
  this.emit("promptComplete", {
9126
9220
  sessionId,
9127
9221
  text: textResult,
@@ -9135,6 +9229,9 @@ var DaemonChannelBridge = class extends EventEmitter2 {
9135
9229
  this.off("responseBoundary", clearChunks);
9136
9230
  this.off("sessionDied", onSessionDied);
9137
9231
  this.activePrompts.delete(sessionId);
9232
+ if (this.taskOutputs.get(sessionId) === taskOutput) {
9233
+ this.taskOutputs.delete(sessionId);
9234
+ }
9138
9235
  controllers.delete(controller);
9139
9236
  if (controllers.size === 0 && this.activePromptControllers.get(sessionId) === controllers) {
9140
9237
  this.activePromptControllers.delete(sessionId);
@@ -9322,6 +9419,8 @@ var DaemonChannelBridge = class extends EventEmitter2 {
9322
9419
  this.dropSession(session.sessionId, this.getStringField(event.data, "error", "stream_error"));
9323
9420
  break;
9324
9421
  case "turn_complete":
9422
+ if (isRecord3(event.data) && event.data["backgroundTurn"])
9423
+ break;
9325
9424
  this.resolveTurnBarrier(session.sessionId);
9326
9425
  break;
9327
9426
  case "turn_error":
@@ -9347,7 +9446,21 @@ var DaemonChannelBridge = class extends EventEmitter2 {
9347
9446
  }
9348
9447
  const text = getTextContent(update["content"]);
9349
9448
  if (meta?.["qwenDiscreteMessage"] === true) {
9350
- if (meta["source"] === "background_notification_response" && meta["rewritten"] !== true) {
9449
+ if (meta["source"] === "background_notification_response" && meta["rewritten"] !== true && meta[CHANNEL_TASK_OUTPUT_META_KEY] === true) {
9450
+ const taskOutput = this.taskOutputs.get(sessionId);
9451
+ if (taskOutput) {
9452
+ const context = parseBackgroundResponseContext(meta["backgroundTask"]);
9453
+ if (text?.trim()) {
9454
+ taskOutput.text = text;
9455
+ taskOutput.turnId = context?.turnId;
9456
+ taskOutput.partial = context?.partial === true;
9457
+ } else if (context?.turnComplete && context.turnId !== void 0 && context.turnId === taskOutput.turnId) {
9458
+ taskOutput.partial = context.partial === true;
9459
+ }
9460
+ }
9461
+ break;
9462
+ }
9463
+ if (meta["source"] === "background_notification_response" && meta["rewritten"] !== true && meta[CHANNEL_TASK_OUTPUT_META_KEY] !== true) {
9351
9464
  const context = parseBackgroundResponseContext(meta["backgroundTask"]);
9352
9465
  if (text || context?.turnComplete) {
9353
9466
  this.emit("backgroundResponse", sessionId, text ?? "", context);
@@ -9810,6 +9923,620 @@ function isTerminalTaskLifecycleType(type) {
9810
9923
  }
9811
9924
  __name(isTerminalTaskLifecycleType, "isTerminalTaskLifecycleType");
9812
9925
 
9926
+ // packages/channels/base/dist/output-turn.js
9927
+ init_esbuild_shims();
9928
+ var ChannelOutputTurn = class {
9929
+ static {
9930
+ __name(this, "ChannelOutputTurn");
9931
+ }
9932
+ mode;
9933
+ lastOutput;
9934
+ finished = false;
9935
+ constructor(mode = DEFAULT_CHANNEL_OUTPUT_MODE) {
9936
+ this.mode = mode;
9937
+ }
9938
+ get latestOnly() {
9939
+ return this.mode === "per_turn" || this.mode === "per_task";
9940
+ }
9941
+ shouldPreview(text) {
9942
+ return !this.finished && text.trim() !== "";
9943
+ }
9944
+ close(text, reason) {
9945
+ if (this.finished)
9946
+ return { kind: "skip" };
9947
+ if (reason === "failed" || reason === "cancelled") {
9948
+ this.lastOutput = void 0;
9949
+ return { kind: reason };
9950
+ }
9951
+ if (!text.trim()) {
9952
+ if (reason === "response_boundary" || !this.latestOnly) {
9953
+ return { kind: "skip" };
9954
+ }
9955
+ text = this.lastOutput ?? "";
9956
+ if (!text.trim())
9957
+ return { kind: "skip" };
9958
+ }
9959
+ if (reason === "response_boundary" && this.mode !== "per_response") {
9960
+ this.lastOutput = text;
9961
+ return {
9962
+ kind: "preview",
9963
+ text
9964
+ };
9965
+ }
9966
+ this.lastOutput = void 0;
9967
+ return { kind: "complete", text, rotate: reason !== "completed" };
9968
+ }
9969
+ finish(terminal) {
9970
+ const output = terminal === "completed" ? this.lastOutput : void 0;
9971
+ this.lastOutput = void 0;
9972
+ this.finished = true;
9973
+ return output;
9974
+ }
9975
+ };
9976
+
9977
+ // packages/channels/base/dist/background-output-coordinator.js
9978
+ init_esbuild_shims();
9979
+ var BACKGROUND_OUTPUT_TIMEOUT_MS = 10 * 60 * 1e3;
9980
+ var BACKGROUND_OUTPUT_RETRY_MS = 30 * 1e3;
9981
+ var BACKGROUND_OUTPUT_MAX_RETRIES = 3;
9982
+ var BackgroundOutputCoordinator = class {
9983
+ static {
9984
+ __name(this, "BackgroundOutputCoordinator");
9985
+ }
9986
+ options;
9987
+ backgroundResponseAggregations = /* @__PURE__ */ new Map();
9988
+ detachedBackgroundResponseAggregations = /* @__PURE__ */ new Set();
9989
+ pendingBackgroundResponseTerminals = /* @__PURE__ */ new Map();
9990
+ detachedPendingBackgroundResponseTerminals = /* @__PURE__ */ new Set();
9991
+ constructor(options) {
9992
+ this.options = options;
9993
+ }
9994
+ /** False leaves delivery to the adapter's immediate response path. */
9995
+ async dispatch(sessionId, text, context) {
9996
+ if (this.options.outputMode !== "per_turn" && this.options.outputMode !== "per_task" || !context || typeof context.turnComplete !== "boolean") {
9997
+ return false;
9998
+ }
9999
+ await this.collect(sessionId, text, context);
10000
+ return true;
10001
+ }
10002
+ async collect(sessionId, text, context) {
10003
+ const target = this.options.getTarget(sessionId);
10004
+ if (!target)
10005
+ return;
10006
+ const key = JSON.stringify([
10007
+ sessionId,
10008
+ context.kind,
10009
+ context.taskId,
10010
+ context.turnId
10011
+ ]);
10012
+ let current = this.backgroundResponseAggregations.get(key);
10013
+ let parked = this.pendingBackgroundResponseTerminals.get(key);
10014
+ if (current?.turnComplete === true) {
10015
+ this.detachedBackgroundResponseAggregations.add(current);
10016
+ this.backgroundResponseAggregations.delete(key);
10017
+ current = void 0;
10018
+ }
10019
+ if (!current && (parked?.turnEnded === true || parked?.turnComplete === true && (parked.retryTimer || parked.retryInFlight || parked.resolvers > 0))) {
10020
+ if (!parked.turnEnded) {
10021
+ this.detachedPendingBackgroundResponseTerminals.add(parked);
10022
+ }
10023
+ parked = {
10024
+ sessionId,
10025
+ target,
10026
+ sourceLabel: this.options.getSourceLabel?.(sessionId),
10027
+ resolvers: 0,
10028
+ held: []
10029
+ };
10030
+ this.pendingBackgroundResponseTerminals.set(key, parked);
10031
+ }
10032
+ if (!current && text.trim().length === 0) {
10033
+ if (!parked || parked.resolvers === 0 && !parked.retryTimer && !parked.retryInFlight && !parked.resolutionDropped && !parked.turnComplete) {
10034
+ if (parked)
10035
+ this.pendingBackgroundResponseTerminals.delete(key);
10036
+ return;
10037
+ }
10038
+ if (context.turnComplete) {
10039
+ parked.turnComplete = true;
10040
+ parked.status = context.status;
10041
+ parked.label = context.label ?? parked.label;
10042
+ parked.completionPartial = context.partial === true;
10043
+ if (parked.resolvers === 0 && !parked.retryTimer && !parked.retryInFlight && (parked.retryAttempts ?? 0) >= BACKGROUND_OUTPUT_MAX_RETRIES) {
10044
+ parked.turnEnded = true;
10045
+ this.pendingBackgroundResponseTerminals.delete(key);
10046
+ }
10047
+ }
10048
+ return;
10049
+ }
10050
+ if (!current) {
10051
+ parked ??= {
10052
+ sessionId,
10053
+ target,
10054
+ sourceLabel: this.options.getSourceLabel?.(sessionId),
10055
+ resolvers: 0,
10056
+ held: []
10057
+ };
10058
+ this.pendingBackgroundResponseTerminals.set(key, parked);
10059
+ this.holdPendingBackgroundResponse(parked, text, context);
10060
+ parked.resolvers++;
10061
+ try {
10062
+ let delivery;
10063
+ try {
10064
+ delivery = await this.options.resolveDelivery(sessionId);
10065
+ } catch (error) {
10066
+ if (parked.resolvers === 1 && !this.backgroundResponseAggregations.has(key)) {
10067
+ this.scheduleBackgroundResponseResolutionRetry(key, sessionId, parked);
10068
+ } else {
10069
+ const existing = this.backgroundResponseAggregations.get(key);
10070
+ if (existing) {
10071
+ if (parked.held.length > 0) {
10072
+ this.applyHeldBackgroundResponses(existing, parked);
10073
+ }
10074
+ this.applyPendingBackgroundResponseTerminal(existing, parked);
10075
+ if (parked.resolvers === 1) {
10076
+ if (existing.turnComplete) {
10077
+ await this.completeBackgroundResponseAggregation(key, existing);
10078
+ } else {
10079
+ this.scheduleBackgroundResponseAggregationFlush(key, existing);
10080
+ }
10081
+ }
10082
+ }
10083
+ }
10084
+ throw error;
10085
+ }
10086
+ if (!delivery || this.options.getTarget(sessionId) !== delivery.target) {
10087
+ if (parked.resolvers === 1 && !this.backgroundResponseAggregations.has(key)) {
10088
+ this.scheduleBackgroundResponseResolutionRetry(key, sessionId, parked);
10089
+ } else {
10090
+ const existing = this.backgroundResponseAggregations.get(key);
10091
+ if (existing) {
10092
+ if (parked.held.length > 0) {
10093
+ this.applyHeldBackgroundResponses(existing, parked);
10094
+ }
10095
+ this.applyPendingBackgroundResponseTerminal(existing, parked);
10096
+ if (parked.resolvers === 1) {
10097
+ if (existing.turnComplete) {
10098
+ await this.completeBackgroundResponseAggregation(key, existing);
10099
+ } else {
10100
+ this.scheduleBackgroundResponseAggregationFlush(key, existing);
10101
+ }
10102
+ }
10103
+ }
10104
+ }
10105
+ return;
10106
+ }
10107
+ if (parked.retiring || parked.turnEnded === true || this.pendingBackgroundResponseTerminals.get(key) !== parked) {
10108
+ await this.flushDetachedBackgroundResponse(key, sessionId, parked, delivery);
10109
+ return;
10110
+ }
10111
+ parked.sourceLabel = delivery.sourceLabel;
10112
+ if (parked.retryTimer) {
10113
+ clearTimeout(parked.retryTimer);
10114
+ parked.retryTimer = void 0;
10115
+ }
10116
+ current = this.backgroundResponseAggregations.get(key) ?? this.createBackgroundResponseAggregation(key, sessionId, parked.held[0]?.context ?? context, delivery.target, delivery.sourceLabel);
10117
+ this.applyHeldBackgroundResponses(current, parked);
10118
+ this.applyPendingBackgroundResponseTerminal(current, parked);
10119
+ if (parked.resolutionDropped) {
10120
+ current.resolutionDropped = true;
10121
+ parked.resolutionDropped = void 0;
10122
+ }
10123
+ } finally {
10124
+ parked.resolvers--;
10125
+ if (this.pendingBackgroundResponseTerminals.get(key) === parked && parked.resolvers === 0 && !parked.retryTimer && parked.held.length === 0 && (!parked.resolutionDropped || parked.turnEnded)) {
10126
+ this.pendingBackgroundResponseTerminals.delete(key);
10127
+ }
10128
+ }
10129
+ if (!current)
10130
+ return;
10131
+ if (current.turnComplete && parked.resolvers > 0)
10132
+ return;
10133
+ if (!current.turnComplete) {
10134
+ this.scheduleBackgroundResponseAggregationFlush(key, current);
10135
+ } else {
10136
+ await this.completeBackgroundResponseAggregation(key, current);
10137
+ }
10138
+ return;
10139
+ }
10140
+ current.status = context.status;
10141
+ current.label = context.label ?? current.label;
10142
+ if (text.trim())
10143
+ current.text = text;
10144
+ if (context.turnComplete && parked && parked.resolvers > 0) {
10145
+ parked.turnComplete = true;
10146
+ parked.status = context.status;
10147
+ parked.label = context.label ?? parked.label;
10148
+ parked.completionPartial = context.partial === true;
10149
+ } else if (context.turnComplete) {
10150
+ current.turnComplete = true;
10151
+ current.completionPartial = context.partial === true;
10152
+ } else if (parked?.turnComplete && parked.resolvers === 0) {
10153
+ current.turnComplete = true;
10154
+ current.status = parked.status ?? current.status;
10155
+ current.label = parked.label ?? current.label;
10156
+ current.completionPartial = parked.completionPartial === true;
10157
+ }
10158
+ current.resolutionDropped ||= parked?.resolutionDropped;
10159
+ if (!current.turnComplete) {
10160
+ this.scheduleBackgroundResponseAggregationFlush(key, current);
10161
+ return;
10162
+ }
10163
+ await this.completeBackgroundResponseAggregation(key, current);
10164
+ }
10165
+ flushBackgroundResponseAggregation(key, aggregation) {
10166
+ if (aggregation.flushing)
10167
+ return Promise.resolve();
10168
+ const flushing = this.flushBackgroundResponseAggregationInner(key, aggregation).finally(() => {
10169
+ if (aggregation.flushing === flushing)
10170
+ aggregation.flushing = void 0;
10171
+ });
10172
+ aggregation.flushing = flushing;
10173
+ return flushing;
10174
+ }
10175
+ async flushBackgroundResponseAggregationInner(key, aggregation) {
10176
+ if (this.backgroundResponseAggregations.get(key) !== aggregation && !this.detachedBackgroundResponseAggregations.has(aggregation)) {
10177
+ return;
10178
+ }
10179
+ if (aggregation.retryTimer)
10180
+ clearTimeout(aggregation.retryTimer);
10181
+ aggregation.retryTimer = void 0;
10182
+ let delivery = aggregation.delivery;
10183
+ if (!delivery) {
10184
+ if (!aggregation.text) {
10185
+ if (!this.owesTerminalBackgroundResponse(aggregation)) {
10186
+ if (aggregation.retiring || aggregation.turnComplete) {
10187
+ this.removeBackgroundResponseAggregation(key, aggregation);
10188
+ } else {
10189
+ this.scheduleBackgroundResponseAggregationFlush(key, aggregation);
10190
+ }
10191
+ return;
10192
+ }
10193
+ }
10194
+ if (aggregation.timeoutTimer)
10195
+ clearTimeout(aggregation.timeoutTimer);
10196
+ aggregation.timeoutTimer = void 0;
10197
+ const text = aggregation.text;
10198
+ aggregation.text = "";
10199
+ delivery = {
10200
+ status: aggregation.status,
10201
+ kind: aggregation.kind,
10202
+ label: aggregation.label,
10203
+ text,
10204
+ partial: this.isPartialBackgroundResponseDelivery(aggregation, text.length > 0),
10205
+ attempts: 0,
10206
+ send: this.options.createDelivery(aggregation.sessionId, {
10207
+ target: aggregation.target,
10208
+ sourceLabel: aggregation.sourceLabel
10209
+ })
10210
+ };
10211
+ aggregation.delivery = delivery;
10212
+ }
10213
+ let error;
10214
+ let composedTurnComplete = false;
10215
+ try {
10216
+ const result = await delivery.send({
10217
+ status: delivery.status,
10218
+ kind: delivery.kind,
10219
+ label: delivery.label,
10220
+ text: delivery.text,
10221
+ partial: delivery.partial,
10222
+ turnComplete: aggregation.turnComplete === true
10223
+ });
10224
+ composedTurnComplete = result.turnComplete;
10225
+ } catch (caught) {
10226
+ error = caught;
10227
+ }
10228
+ if (error === void 0) {
10229
+ aggregation.delivery = void 0;
10230
+ aggregation.delivered = true;
10231
+ if (composedTurnComplete && aggregation.turnComplete && delivery.partial !== true && !aggregation.retiring) {
10232
+ aggregation.completionDelivered = true;
10233
+ }
10234
+ if (aggregation.retiring || aggregation.turnComplete) {
10235
+ await this.flushBackgroundResponseAggregationInner(key, aggregation);
10236
+ } else {
10237
+ this.scheduleBackgroundResponseAggregationFlush(key, aggregation);
10238
+ }
10239
+ return;
10240
+ }
10241
+ delivery.attempts++;
10242
+ this.options.log(`background response delivery failed (attempt ${delivery.attempts}): ${sanitizeLogText(error instanceof Error ? error.message : String(error), 300)}
10243
+ `);
10244
+ if (aggregation.retiring || delivery.attempts >= BACKGROUND_OUTPUT_MAX_RETRIES || // A permanently rejected send cannot
10245
+ // succeed later; retrying it only spends the chat's send quota.
10246
+ !this.options.isRetryableError(error)) {
10247
+ aggregation.delivery = void 0;
10248
+ aggregation.dropped = true;
10249
+ if (!aggregation.text) {
10250
+ if (aggregation.retiring || aggregation.turnComplete) {
10251
+ this.removeBackgroundResponseAggregation(key, aggregation);
10252
+ } else {
10253
+ this.scheduleBackgroundResponseAggregationFlush(key, aggregation);
10254
+ }
10255
+ } else if (aggregation.retiring || aggregation.turnComplete) {
10256
+ await this.flushBackgroundResponseAggregationInner(key, aggregation);
10257
+ } else {
10258
+ this.scheduleBackgroundResponseAggregationFlush(key, aggregation);
10259
+ }
10260
+ return;
10261
+ }
10262
+ aggregation.retryTimer = setTimeout(() => {
10263
+ aggregation.retryTimer = void 0;
10264
+ void this.flushBackgroundResponseAggregation(key, aggregation);
10265
+ }, BACKGROUND_OUTPUT_RETRY_MS);
10266
+ aggregation.retryTimer.unref?.();
10267
+ }
10268
+ /**
10269
+ * A delivery is partial whenever it is not the turn's whole output: the
10270
+ * turn is still open, earlier text already went out (or was given up on),
10271
+ * or the turn itself ended early.
10272
+ */
10273
+ isPartialBackgroundResponseDelivery(aggregation, hasText) {
10274
+ return hasText && (aggregation.delivered === true || aggregation.dropped === true || aggregation.resolutionDropped === true || aggregation.retiring === true || aggregation.completionPartial === true || aggregation.turnComplete !== true);
10275
+ }
10276
+ /**
10277
+ * If a turn outlives the bounded wait, its final empty marker still needs
10278
+ * a terminal delivery so recipients learn that the partial output finished.
10279
+ */
10280
+ owesTerminalBackgroundResponse(aggregation) {
10281
+ return aggregation.turnComplete === true && aggregation.delivered === true && aggregation.completionDelivered !== true && aggregation.retiring !== true && aggregation.completionPartial !== true && aggregation.dropped !== true && aggregation.resolutionDropped !== true;
10282
+ }
10283
+ removeBackgroundResponseAggregation(key, aggregation) {
10284
+ if (this.backgroundResponseAggregations.get(key) === aggregation) {
10285
+ this.backgroundResponseAggregations.delete(key);
10286
+ }
10287
+ this.detachedBackgroundResponseAggregations.delete(aggregation);
10288
+ }
10289
+ drain(sessionId) {
10290
+ const flushes = [];
10291
+ for (const [key, pending] of this.pendingBackgroundResponseTerminals) {
10292
+ if (sessionId !== void 0 && pending.sessionId !== sessionId)
10293
+ continue;
10294
+ if (pending.retryTimer)
10295
+ clearTimeout(pending.retryTimer);
10296
+ pending.retryTimer = void 0;
10297
+ pending.retiring = true;
10298
+ pending.turnComplete = true;
10299
+ pending.completionPartial = true;
10300
+ this.pendingBackgroundResponseTerminals.delete(key);
10301
+ this.detachedPendingBackgroundResponseTerminals.add(pending);
10302
+ }
10303
+ for (const pending of this.detachedPendingBackgroundResponseTerminals) {
10304
+ if (sessionId !== void 0 && pending.sessionId !== sessionId)
10305
+ continue;
10306
+ if (pending.retryTimer)
10307
+ clearTimeout(pending.retryTimer);
10308
+ pending.retryTimer = void 0;
10309
+ pending.retiring = true;
10310
+ pending.turnComplete = true;
10311
+ pending.completionPartial = true;
10312
+ if (pending.held.length > 0 && this.options.getTarget(pending.sessionId) === pending.target) {
10313
+ flushes.push(this.flushDetachedBackgroundResponse("", pending.sessionId, pending, {
10314
+ target: pending.target,
10315
+ sourceLabel: pending.sourceLabel
10316
+ }));
10317
+ } else if (pending.held.length > 0) {
10318
+ this.options.log(`background response target unavailable during drain; ${pending.held.length} buffered segment(s) discarded
10319
+ `);
10320
+ pending.held.length = 0;
10321
+ this.detachedPendingBackgroundResponseTerminals.delete(pending);
10322
+ } else if (pending.held.length === 0) {
10323
+ this.detachedPendingBackgroundResponseTerminals.delete(pending);
10324
+ }
10325
+ }
10326
+ const aggregations = /* @__PURE__ */ new Set([
10327
+ ...this.backgroundResponseAggregations.values(),
10328
+ ...this.detachedBackgroundResponseAggregations
10329
+ ]);
10330
+ for (const aggregation of aggregations) {
10331
+ if (sessionId !== void 0 && aggregation.sessionId !== sessionId) {
10332
+ continue;
10333
+ }
10334
+ if (aggregation.timeoutTimer)
10335
+ clearTimeout(aggregation.timeoutTimer);
10336
+ if (aggregation.retryTimer)
10337
+ clearTimeout(aggregation.retryTimer);
10338
+ aggregation.timeoutTimer = void 0;
10339
+ aggregation.retryTimer = void 0;
10340
+ aggregation.retiring = true;
10341
+ aggregation.turnComplete = true;
10342
+ aggregation.completionPartial = true;
10343
+ flushes.push(aggregation.flushing ?? this.flushBackgroundResponseAggregation(aggregation.key, aggregation));
10344
+ }
10345
+ return Promise.allSettled(flushes).then((results) => {
10346
+ for (const result of results) {
10347
+ if (result.status === "rejected") {
10348
+ const error = result.reason;
10349
+ this.options.log(`background response delivery failed during drain: ${sanitizeLogText(error instanceof Error ? error.message : String(error), 300)}
10350
+ `);
10351
+ }
10352
+ }
10353
+ });
10354
+ }
10355
+ createBackgroundResponseAggregation(key, sessionId, context, target, sourceLabel) {
10356
+ const aggregation = {
10357
+ key,
10358
+ sessionId,
10359
+ target,
10360
+ sourceLabel,
10361
+ status: context.status,
10362
+ kind: context.kind,
10363
+ label: context.label,
10364
+ text: ""
10365
+ };
10366
+ this.backgroundResponseAggregations.set(key, aggregation);
10367
+ return aggregation;
10368
+ }
10369
+ scheduleBackgroundResponseResolutionRetry(key, sessionId, pending) {
10370
+ if (pending.retiring)
10371
+ return;
10372
+ if (pending.retryTimer)
10373
+ return;
10374
+ pending.retryAttempts = (pending.retryAttempts ?? 0) + 1;
10375
+ if (pending.retryAttempts >= BACKGROUND_OUTPUT_MAX_RETRIES) {
10376
+ this.options.log(`background response target unresolved after ${pending.retryAttempts} attempts; ${pending.held.length} buffered segment(s) discarded
10377
+ `);
10378
+ pending.resolutionDropped = true;
10379
+ pending.turnEnded = pending.turnComplete === true;
10380
+ pending.held.length = 0;
10381
+ pending.turnComplete = void 0;
10382
+ pending.status = void 0;
10383
+ pending.label = void 0;
10384
+ pending.completionPartial = void 0;
10385
+ if (pending.turnEnded) {
10386
+ this.detachedPendingBackgroundResponseTerminals.delete(pending);
10387
+ }
10388
+ return;
10389
+ }
10390
+ pending.retryTimer = setTimeout(() => {
10391
+ pending.retryTimer = void 0;
10392
+ pending.retryInFlight = true;
10393
+ void this.retryBackgroundResponseResolution(key, sessionId, pending).catch((error) => {
10394
+ this.options.log(`background response target resolution failed: ${sanitizeLogText(error instanceof Error ? error.message : String(error), 300)}
10395
+ `);
10396
+ }).finally(() => {
10397
+ pending.retryInFlight = false;
10398
+ if (pending.retiring || !pending.retryTimer && !pending.resolutionDropped) {
10399
+ this.detachedPendingBackgroundResponseTerminals.delete(pending);
10400
+ }
10401
+ if (this.pendingBackgroundResponseTerminals.get(key) === pending && pending.resolvers === 0 && !pending.retryTimer && pending.held.length === 0 && (!pending.resolutionDropped || pending.turnEnded)) {
10402
+ this.pendingBackgroundResponseTerminals.delete(key);
10403
+ }
10404
+ });
10405
+ }, BACKGROUND_OUTPUT_RETRY_MS);
10406
+ pending.retryTimer.unref?.();
10407
+ const active = this.pendingBackgroundResponseTerminals.get(key);
10408
+ if (!active || active === pending) {
10409
+ this.pendingBackgroundResponseTerminals.set(key, pending);
10410
+ }
10411
+ }
10412
+ async retryBackgroundResponseResolution(key, sessionId, pending) {
10413
+ let delivery;
10414
+ try {
10415
+ delivery = await this.options.resolveDelivery(sessionId);
10416
+ } catch (error) {
10417
+ if (this.pendingBackgroundResponseTerminals.get(key) === pending && !this.backgroundResponseAggregations.has(key) || this.detachedPendingBackgroundResponseTerminals.has(pending)) {
10418
+ this.scheduleBackgroundResponseResolutionRetry(key, sessionId, pending);
10419
+ }
10420
+ throw error;
10421
+ }
10422
+ if (!delivery || this.options.getTarget(sessionId) !== delivery.target) {
10423
+ if (pending.retiring) {
10424
+ if (pending.held.length > 0) {
10425
+ this.options.log(`background response target unavailable during drain; ${pending.held.length} buffered segment(s) discarded
10426
+ `);
10427
+ }
10428
+ pending.held.length = 0;
10429
+ this.detachedPendingBackgroundResponseTerminals.delete(pending);
10430
+ return;
10431
+ }
10432
+ if (this.pendingBackgroundResponseTerminals.get(key) === pending && !this.backgroundResponseAggregations.has(key) || this.detachedPendingBackgroundResponseTerminals.has(pending)) {
10433
+ this.scheduleBackgroundResponseResolutionRetry(key, sessionId, pending);
10434
+ }
10435
+ return;
10436
+ }
10437
+ if (pending.retiring || this.pendingBackgroundResponseTerminals.get(key) !== pending || pending.turnComplete) {
10438
+ await this.flushDetachedBackgroundResponse(key, sessionId, pending, delivery);
10439
+ return;
10440
+ }
10441
+ const first = pending.held[0];
10442
+ if (!first)
10443
+ return;
10444
+ const aggregation = this.createBackgroundResponseAggregation(key, sessionId, first.context, delivery.target, delivery.sourceLabel);
10445
+ this.applyHeldBackgroundResponses(aggregation, pending);
10446
+ if (pending.resolutionDropped) {
10447
+ aggregation.resolutionDropped = true;
10448
+ pending.resolutionDropped = void 0;
10449
+ }
10450
+ if (this.pendingBackgroundResponseTerminals.get(key) === pending) {
10451
+ this.pendingBackgroundResponseTerminals.delete(key);
10452
+ }
10453
+ this.scheduleBackgroundResponseAggregationFlush(key, aggregation);
10454
+ }
10455
+ holdPendingBackgroundResponse(pending, text, context) {
10456
+ if (text.trim().length > 0)
10457
+ pending.held.push({ text, context });
10458
+ if (context.turnComplete) {
10459
+ pending.turnComplete = true;
10460
+ pending.status = context.status;
10461
+ pending.label = context.label ?? pending.label;
10462
+ pending.completionPartial = context.partial === true;
10463
+ }
10464
+ }
10465
+ applyHeldBackgroundResponses(aggregation, pending) {
10466
+ for (const { text, context } of pending.held.splice(0)) {
10467
+ aggregation.status = context.status;
10468
+ aggregation.label = context.label ?? aggregation.label;
10469
+ if (text.trim())
10470
+ aggregation.text = text;
10471
+ if (context.turnComplete) {
10472
+ aggregation.turnComplete = true;
10473
+ aggregation.completionPartial = context.partial === true;
10474
+ }
10475
+ }
10476
+ }
10477
+ applyPendingBackgroundResponseTerminal(aggregation, pending) {
10478
+ if (!pending.turnComplete)
10479
+ return;
10480
+ aggregation.turnComplete = true;
10481
+ aggregation.status = pending.status ?? aggregation.status;
10482
+ aggregation.label = pending.label ?? aggregation.label;
10483
+ aggregation.completionPartial = pending.completionPartial === true;
10484
+ pending.turnComplete = void 0;
10485
+ pending.status = void 0;
10486
+ pending.label = void 0;
10487
+ pending.completionPartial = void 0;
10488
+ }
10489
+ async completeBackgroundResponseAggregation(key, aggregation) {
10490
+ if (aggregation.delivery) {
10491
+ aggregation.delivery.status = aggregation.status;
10492
+ aggregation.delivery.label = aggregation.label ?? aggregation.delivery.label;
10493
+ aggregation.delivery.partial = this.isPartialBackgroundResponseDelivery(aggregation, aggregation.delivery.text.length > 0) || aggregation.text.length > 0;
10494
+ }
10495
+ if (aggregation.timeoutTimer)
10496
+ clearTimeout(aggregation.timeoutTimer);
10497
+ aggregation.timeoutTimer = void 0;
10498
+ await this.flushBackgroundResponseAggregation(key, aggregation);
10499
+ }
10500
+ async flushDetachedBackgroundResponse(key, sessionId, pending, delivery) {
10501
+ const first = pending.held[0];
10502
+ if (!first) {
10503
+ this.detachedPendingBackgroundResponseTerminals.delete(pending);
10504
+ return;
10505
+ }
10506
+ const aggregation = {
10507
+ key,
10508
+ sessionId,
10509
+ target: delivery.target,
10510
+ sourceLabel: delivery.sourceLabel,
10511
+ status: first.context.status,
10512
+ kind: first.context.kind,
10513
+ label: first.context.label,
10514
+ text: "",
10515
+ turnComplete: pending.turnComplete,
10516
+ completionPartial: pending.completionPartial,
10517
+ resolutionDropped: pending.resolutionDropped
10518
+ };
10519
+ this.applyHeldBackgroundResponses(aggregation, pending);
10520
+ aggregation.status = pending.status ?? aggregation.status;
10521
+ aggregation.label = pending.label ?? aggregation.label;
10522
+ if (this.pendingBackgroundResponseTerminals.get(key) === pending) {
10523
+ this.pendingBackgroundResponseTerminals.delete(key);
10524
+ }
10525
+ this.detachedPendingBackgroundResponseTerminals.delete(pending);
10526
+ this.detachedBackgroundResponseAggregations.add(aggregation);
10527
+ await this.flushBackgroundResponseAggregation(key, aggregation);
10528
+ }
10529
+ scheduleBackgroundResponseAggregationFlush(key, aggregation) {
10530
+ if (aggregation.timeoutTimer || aggregation.delivery)
10531
+ return;
10532
+ aggregation.timeoutTimer = setTimeout(() => {
10533
+ aggregation.timeoutTimer = void 0;
10534
+ void this.flushBackgroundResponseAggregation(key, aggregation);
10535
+ }, BACKGROUND_OUTPUT_TIMEOUT_MS);
10536
+ aggregation.timeoutTimer.unref?.();
10537
+ }
10538
+ };
10539
+
9813
10540
  export {
9814
10541
  resolvePath,
9815
10542
  getGlobalQwenDir,
@@ -9824,16 +10551,24 @@ export {
9824
10551
  sanitizeDisplayText,
9825
10552
  sanitizeLogText,
9826
10553
  SessionRouter,
10554
+ CHANNEL_PROMPT_META_KEY,
10555
+ CHANNEL_OUTPUT_MODE_META_KEY,
10556
+ CHANNEL_TASK_RESULT_META_KEY,
10557
+ CHANNEL_TASK_RESULT_PARTIAL_META_KEY,
10558
+ CHANNEL_TASK_OUTPUT_META_KEY,
9827
10559
  ChannelLoopScheduler,
9828
10560
  ChannelBase,
9829
10561
  PollingChannelBase,
9830
- CHANNEL_PROMPT_META_KEY,
9831
10562
  CHANNEL_LOOP_MCP_SERVER_NAME,
9832
10563
  ACP_EVENT_LOOP_STALL_RESTART_MS,
9833
10564
  AcpBridge,
9834
10565
  DaemonChannelBridge,
9835
10566
  ChannelLoopStore,
9836
- isTerminalTaskLifecycleType
10567
+ isTerminalTaskLifecycleType,
10568
+ CHANNEL_OUTPUT_MODE_FIELD,
10569
+ parseChannelOutputMode,
10570
+ ChannelOutputTurn,
10571
+ BackgroundOutputCoordinator
9837
10572
  };
9838
10573
  /**
9839
10574
  * @license