@qwen-code/qwen-code 0.20.0 → 0.20.1-nightly.20260724.7d17c44a3

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 (388) hide show
  1. package/bundled/qc-helper/docs/configuration/settings.md +1 -1
  2. package/bundled/qc-helper/docs/features/auto-mode.md +19 -16
  3. package/bundled/qc-helper/docs/features/commands.md +54 -0
  4. package/bundled/qc-helper/docs/features/sub-agents.md +16 -7
  5. package/bundled/qc-helper/docs/integration-github-action.md +1 -1
  6. package/bundled/qc-helper/docs/qwen-serve.md +2 -1
  7. package/bundled/review/DESIGN.md +2 -2
  8. package/bundled/review/SKILL.md +7 -5
  9. package/chunks/MaxSizedBox-LGRTXB47.js +84 -0
  10. package/chunks/{StandaloneSessionPicker-CEGO2AZX.js → StandaloneSessionPicker-H3TBU3C3.js} +68 -56
  11. package/chunks/{acp-startup-profiler-N3RHHXJ3.js → acp-startup-profiler-RV3IV562.js} +2 -2
  12. package/chunks/{acpAgent-YUR43TLG.js → acpAgent-5D7P4BB5.js} +2061 -556
  13. package/chunks/agent-W7UAHCCI.js +80 -0
  14. package/chunks/agent-headless-KTBMPRSC.js +74 -0
  15. package/chunks/{anthropicContentGenerator-HVKLXOOU.js → anthropicContentGenerator-ZLQ3X2HI.js} +112 -45
  16. package/chunks/{artifact-tool-WBCAMD3O.js → artifact-tool-OKMWONT6.js} +3 -3
  17. package/chunks/{askUserQuestion-6DZC4UV5.js → askUserQuestion-V6FUS23G.js} +3 -3
  18. package/chunks/bridge-FFC4C6VD.js +89 -0
  19. package/chunks/{build-SSCNEHZZ.js → build-RV63TIRH.js} +2 -3
  20. package/chunks/{ca-2SL2BXTK.js → ca-GKRQZ7AM.js} +612 -201
  21. package/chunks/{channel-worker-group-53CMOPFT.js → channel-worker-group-MA3WXWYX.js} +7 -6
  22. package/chunks/{channel-worker-manager-UTXILKC2.js → channel-worker-manager-TIYYYBCT.js} +189 -29
  23. package/chunks/{channel-worker-supervisor-ZGO2W2MD.js → channel-worker-supervisor-CXRCDA4Y.js} +6 -5
  24. package/chunks/{chunk-TYQMGACW.js → chunk-22C7BQ6D.js} +508 -10967
  25. package/chunks/{chunk-4EP2PYYL.js → chunk-2G6QIHYL.js} +5 -5
  26. package/chunks/{chunk-H2XVO6NE.js → chunk-2MIN6GRR.js} +1 -1
  27. package/chunks/chunk-2RFKHEXL.js +74 -0
  28. package/chunks/{chunk-7SXZC7ID.js → chunk-2WTVWAKT.js} +7 -6
  29. package/chunks/{chunk-TIH2ZTOC.js → chunk-32A4PI3E.js} +2 -2
  30. package/chunks/chunk-36HSVBBU.js +469 -0
  31. package/chunks/{chunk-IR46U7RB.js → chunk-3FB2Y2OE.js} +3 -3
  32. package/chunks/{chunk-QR6U5QPP.js → chunk-3SJ43L4W.js} +4 -0
  33. package/chunks/chunk-3Z43GZUQ.js +32 -0
  34. package/chunks/chunk-43T5WDQ7.js +127 -0
  35. package/chunks/chunk-46UV252V.js +128 -0
  36. package/chunks/{chunk-JD3MKVKL.js → chunk-4K56OJFJ.js} +1 -1
  37. package/chunks/{chunk-KTUQMDEP.js → chunk-4K7VDKAD.js} +1 -1
  38. package/chunks/{chunk-QKYTTBYW.js → chunk-4LVZNIDO.js} +1 -1
  39. package/chunks/{chunk-OWCALFEG.js → chunk-54R2CV2G.js} +1 -1
  40. package/chunks/{chunk-ZEOZL37W.js → chunk-57FIIFJN.js} +1 -1
  41. package/chunks/chunk-5BS3KLRP.js +6194 -0
  42. package/chunks/{chunk-NEEB7UEN.js → chunk-6GMVPFB2.js} +153 -72
  43. package/chunks/{chunk-GMGDLUC7.js → chunk-6IL7KRLE.js} +1 -1
  44. package/chunks/chunk-6PVPNMXU.js +29 -0
  45. package/chunks/chunk-6QHAUJUE.js +293 -0
  46. package/chunks/chunk-6VK3IRTX.js +10017 -0
  47. package/chunks/{chunk-BDBMYST4.js → chunk-6X4GWOPW.js} +1 -1
  48. package/chunks/{chunk-AYCDXHZB.js → chunk-7Z6JQEL6.js} +1 -1
  49. package/chunks/{chunk-FSL5W5TI.js → chunk-AFFGGOF6.js} +4 -4
  50. package/chunks/chunk-AMDSOFFV.js +10860 -0
  51. package/chunks/chunk-AXUW635Q.js +934 -0
  52. package/chunks/{chunk-A5LYNIW7.js → chunk-BJBUDCM3.js} +8 -8
  53. package/chunks/chunk-BK2UNYWD.js +29 -0
  54. package/chunks/{chunk-6RLROE6G.js → chunk-BLFVGB7D.js} +30 -4
  55. package/chunks/chunk-BPJSQIJX.js +100 -0
  56. package/chunks/{chunk-FLSVD6BS.js → chunk-BRTR7S7O.js} +3 -3
  57. package/chunks/{chunk-KG3XV6FH.js → chunk-BSNWBC33.js} +32 -2
  58. package/chunks/chunk-BULDBTYC.js +153 -0
  59. package/chunks/{chunk-PBWEWI4N.js → chunk-BW5Z5NOG.js} +83 -74
  60. package/chunks/{chunk-EIAK6Q2B.js → chunk-C3VHAXP2.js} +20 -3
  61. package/chunks/{chunk-6AFUCL3D.js → chunk-CEZB3XFD.js} +1 -1
  62. package/chunks/chunk-CHMENNJV.js +1832 -0
  63. package/chunks/{chunk-TMQ6XQCX.js → chunk-CK3IEEHR.js} +416 -291
  64. package/chunks/{chunk-OYZWQNWG.js → chunk-CK6UABV2.js} +2 -2
  65. package/chunks/{chunk-VZQUV7VK.js → chunk-CKTMY3EP.js} +1 -1
  66. package/chunks/{chunk-VDWBQ5AW.js → chunk-CUPAVLRY.js} +5 -2
  67. package/chunks/{chunk-I2PYAYFM.js → chunk-CXUFILV3.js} +3 -3
  68. package/chunks/chunk-DP3IHZGG.js +1498 -0
  69. package/chunks/{chunk-BMWMT5Y2.js → chunk-DP5GT2MW.js} +7 -375
  70. package/chunks/{chunk-D22SX43D.js → chunk-DWNZ6PVQ.js} +1 -1
  71. package/chunks/{chunk-5SCI6E3E.js → chunk-E4IMU4Y5.js} +1 -1
  72. package/chunks/{chunk-DP5GXXNZ.js → chunk-EL2IQ2S5.js} +5 -1
  73. package/chunks/{chunk-EZVDJFZ7.js → chunk-ERLGR7GI.js} +1 -1
  74. package/chunks/{chunk-IVPSS6EL.js → chunk-F5MBYZSU.js} +4 -4
  75. package/chunks/{chunk-AQIEINAY.js → chunk-F6IYL66A.js} +28 -1766
  76. package/chunks/{chunk-FEOZBUMT.js → chunk-FODK6UMO.js} +0 -27
  77. package/chunks/{chunk-PGEPSDJI.js → chunk-FWNZ7CVN.js} +24 -20
  78. package/chunks/{chunk-5JBR5XIK.js → chunk-G7EFBBVF.js} +220 -141
  79. package/chunks/chunk-GLNBDYUX.js +38 -0
  80. package/chunks/{chunk-ANPINBOF.js → chunk-H4YKEV2X.js} +5 -5
  81. package/chunks/{chunk-TDKQP3M6.js → chunk-HIJQF5B5.js} +1 -1
  82. package/chunks/{chunk-FQD7GFSV.js → chunk-HJJDKFL5.js} +3 -3
  83. package/chunks/{chunk-4N3KMAIL.js → chunk-HPWHDJID.js} +152 -35
  84. package/chunks/{chunk-KQNM4EO7.js → chunk-HQCSRJ3P.js} +138 -6
  85. package/chunks/chunk-HTR4WV6U.js +327 -0
  86. package/chunks/{chunk-YWEW33JY.js → chunk-HVO55LUD.js} +7 -7
  87. package/chunks/{chunk-MJ6S23WZ.js → chunk-HZEWYOVI.js} +5 -5
  88. package/chunks/chunk-IFG6TYJ2.js +16577 -0
  89. package/chunks/{chunk-B3KGZCQN.js → chunk-IJTOWOD7.js} +322 -202
  90. package/chunks/{chunk-RS7MT2QG.js → chunk-IPUUTYMV.js} +2 -4
  91. package/chunks/{chunk-4ILMYHEI.js → chunk-IRDZJSCL.js} +3 -3
  92. package/chunks/{chunk-XU457J4V.js → chunk-IRH27ZC2.js} +2 -2
  93. package/chunks/{chunk-33XUAINQ.js → chunk-J5UKQEFG.js} +69 -9
  94. package/chunks/{chunk-G45X5TRN.js → chunk-JCW2R7WC.js} +1 -72
  95. package/chunks/{chunk-S2XVRHDN.js → chunk-JDFBBGRD.js} +1 -1
  96. package/chunks/{chunk-4XNLIGVA.js → chunk-JKCALGYN.js} +1023 -383
  97. package/chunks/{chunk-TJTKSVIV.js → chunk-JLU636DO.js} +5 -1
  98. package/chunks/{chunk-VEXFOTEO.js → chunk-JYUSL2V4.js} +3 -3
  99. package/chunks/{chunk-S2PD3EZD.js → chunk-KJEMJWNH.js} +1 -1
  100. package/chunks/{chunk-E2UVIFI2.js → chunk-KRXPRVGL.js} +0 -1
  101. package/chunks/{chunk-CZF3E5GF.js → chunk-LA5H3LM5.js} +1 -1
  102. package/chunks/{chunk-NDMQLV4Y.js → chunk-LBAO2XRA.js} +4 -4
  103. package/chunks/{chunk-7RMOXZTC.js → chunk-LDPP5VTZ.js} +4 -4
  104. package/chunks/{chunk-KDC6GNQR.js → chunk-LEEWLFHW.js} +4 -4
  105. package/chunks/{chunk-KX6UK4VJ.js → chunk-LI4I37W4.js} +22152 -18007
  106. package/chunks/{chunk-OOCI5VVU.js → chunk-LIZRAKPB.js} +1 -1
  107. package/chunks/{chunk-AJSJ5TTU.js → chunk-LP2E4MQG.js} +1 -1
  108. package/chunks/chunk-LS77BEZP.js +405 -0
  109. package/chunks/{chunk-BRRF37CO.js → chunk-LYTBLSSW.js} +5 -5
  110. package/chunks/{chunk-DBE4QFZS.js → chunk-MB7ENXPR.js} +39 -37
  111. package/chunks/{chunk-GKY2OJ7R.js → chunk-MOHAWVLH.js} +4 -4
  112. package/chunks/chunk-NABLFI57.js +82 -0
  113. package/chunks/chunk-NBQDBANR.js +411 -0
  114. package/chunks/{chunk-EAUYY7SS.js → chunk-NOAAFNTJ.js} +43 -10
  115. package/chunks/chunk-NXS53EA7.js +1462 -0
  116. package/chunks/{chunk-C27BYUX6.js → chunk-OQB4EXO4.js} +14 -11
  117. package/chunks/{chunk-NHDKSOEY.js → chunk-P3QQPMQA.js} +5 -5
  118. package/chunks/{chunk-OP4MOGXF.js → chunk-P5RRUHL7.js} +23 -1
  119. package/chunks/{chunk-KOR3XKCA.js → chunk-PBII2NFX.js} +12 -6
  120. package/chunks/{chunk-O3OCNYY5.js → chunk-PDYB7HG2.js} +2 -2
  121. package/chunks/{chunk-2HOVDT7W.js → chunk-PFSUKTZH.js} +1 -1
  122. package/chunks/chunk-PKL3HGNZ.js +2299 -0
  123. package/chunks/{chunk-5DTTYNB7.js → chunk-PQNHRFJC.js} +16 -3
  124. package/chunks/{chunk-OLMETXLX.js → chunk-PXHK5ONM.js} +41 -9
  125. package/chunks/{chunk-PF4CHQOJ.js → chunk-Q6GU6TKM.js} +11 -10
  126. package/chunks/{chunk-4ODB7WIB.js → chunk-QAFKR7WR.js} +1 -1
  127. package/chunks/{chunk-PBATSWUQ.js → chunk-QBUDF33N.js} +1 -1
  128. package/chunks/{chunk-BVLROR2T.js → chunk-QLJUC7TG.js} +1 -1
  129. package/chunks/{chunk-UEY4AYUL.js → chunk-QNLNLENL.js} +2 -2
  130. package/chunks/{chunk-333CXMNJ.js → chunk-QXZTZJLX.js} +5 -5
  131. package/chunks/chunk-R6D2CTQR.js +289 -0
  132. package/chunks/{chunk-7PZ2ATFZ.js → chunk-R6SKHK3T.js} +54 -29
  133. package/chunks/{chunk-OONJNQ42.js → chunk-RGG6M2WF.js} +4 -4
  134. package/chunks/{chunk-RFIAR4YL.js → chunk-RV4C2ZFG.js} +1 -1
  135. package/chunks/{chunk-O3Z73NBP.js → chunk-RW2NEXYJ.js} +15 -11
  136. package/chunks/{chunk-HZPN55E5.js → chunk-SJEDL7DI.js} +1 -1
  137. package/chunks/{chunk-AKX4WPPP.js → chunk-SWBJRDYC.js} +866 -183
  138. package/chunks/{chunk-NBMIC7DR.js → chunk-SX4PK3FC.js} +145 -5
  139. package/chunks/chunk-T3452DP5.js +246 -0
  140. package/chunks/{chunk-TB6UDU4T.js → chunk-THJNPLI4.js} +16 -16
  141. package/chunks/{chunk-T4TZQJ7W.js → chunk-TWPJO254.js} +5 -16
  142. package/chunks/chunk-U7ZFW55U.js +2098 -0
  143. package/chunks/{chunk-JNWZQ27S.js → chunk-UCOJC6EB.js} +72 -23
  144. package/chunks/{chunk-W7H223ZZ.js → chunk-UGYMA4EI.js} +1 -1
  145. package/chunks/{chunk-X6YQWCIJ.js → chunk-UH3WSE5L.js} +13 -1
  146. package/chunks/{chunk-2LL7TXB4.js → chunk-UH7242DI.js} +3 -3
  147. package/chunks/{chunk-CB2HFGRV.js → chunk-UJV643E2.js} +31 -6
  148. package/chunks/chunk-UO7DCGEV.js +121 -0
  149. package/chunks/{chunk-Y2ENGUD6.js → chunk-UPF7PTBI.js} +79 -2
  150. package/chunks/chunk-UW5EOVUN.js +249 -0
  151. package/chunks/{chunk-SJMV7ZBK.js → chunk-VLVO52KC.js} +8 -8
  152. package/chunks/{chunk-R3VWUU2E.js → chunk-VYPFXUCB.js} +1 -1
  153. package/chunks/{chunk-S2W2LVDU.js → chunk-WHFK6G6U.js} +8 -9
  154. package/chunks/chunk-WI3KCKZ5.js +391 -0
  155. package/chunks/{chunk-NGFEPAE6.js → chunk-WLEFWSSC.js} +8 -6
  156. package/chunks/{chunk-XVVH63JG.js → chunk-WUJXJ34P.js} +3 -3
  157. package/chunks/{chunk-MAQQGNQ5.js → chunk-WYLPWQHJ.js} +56 -717
  158. package/chunks/{chunk-D2VIDMVM.js → chunk-X6N25LXS.js} +2 -2
  159. package/chunks/chunk-XAWJ2526.js +1049 -0
  160. package/chunks/{chunk-CV63PP6U.js → chunk-YCIM6O3I.js} +1 -1
  161. package/chunks/{chunk-OEO2ERWK.js → chunk-Z44CVEUF.js} +54 -33
  162. package/chunks/{chunk-TKLLK6XQ.js → chunk-ZT4POVWC.js} +11 -11
  163. package/chunks/{chunk-NIJEXGV6.js → chunk-ZXYUQXY5.js} +148 -10
  164. package/chunks/{computer-use-NIWQNUZF.js → computer-use-UJ5T34TE.js} +50 -37
  165. package/chunks/{config-utils-AHQ6YZ66.js → config-utils-XQRXHAN3.js} +3 -3
  166. package/chunks/contextCommand-CSCB4E5M.js +79 -0
  167. package/chunks/{create-sub-session-MGNX52P3.js → create-sub-session-55F3GOLK.js} +46 -33
  168. package/chunks/{create-sub-session-P26FE5GG.js → create-sub-session-JPCSYZAJ.js} +3 -3
  169. package/chunks/{cron-create-JWFHBDRQ.js → cron-create-CUMELMPL.js} +6 -6
  170. package/chunks/{cron-delete-GDX4E26G.js → cron-delete-QZFV6U3P.js} +5 -5
  171. package/chunks/{cron-list-USMAIWPT.js → cron-list-IDKO7ZO2.js} +5 -5
  172. package/chunks/{daemon-RG2MAI6T.js → daemon-7LP7R6IU.js} +500 -133
  173. package/chunks/daemon-status-provider-6YNZ3UAE.js +88 -0
  174. package/chunks/{de-I7ZIYXZC.js → de-4IBXM7CN.js} +5 -1
  175. package/chunks/{dist-WGTQO7F2.js → dist-376652EZ.js} +114 -28
  176. package/chunks/{dist-53PZYC5B.js → dist-3YCTE6HD.js} +2 -2
  177. package/chunks/{dist-2BHAYBKP.js → dist-D7Z3HOO7.js} +14 -2
  178. package/chunks/{dist-FUTEXY6A.js → dist-MEGJFGAI.js} +40 -9
  179. package/chunks/{dist-2MIU4UUH.js → dist-NQ436QEX.js} +1 -1
  180. package/chunks/{dist-AU7NQQRP.js → dist-NQNTOIEN.js} +26 -2
  181. package/chunks/earlyInputCapture-HPUVJ2KH.js +81 -0
  182. package/chunks/{edit-3QV3JZJL.js → edit-7CMAN3F4.js} +50 -39
  183. package/chunks/{en-XE34GKAA.js → en-SALLIJS7.js} +6 -1
  184. package/chunks/{enter-worktree-4GMMF7EG.js → enter-worktree-3PH4YTY2.js} +49 -36
  185. package/chunks/{enterPlanMode-L5UWBAUC.js → enterPlanMode-MSXLSWLI.js} +55 -37
  186. package/chunks/{environment-3OV7UQOT.js → environment-KS36ZHBE.js} +48 -35
  187. package/chunks/errors-LCPFS62A.js +87 -0
  188. package/chunks/{exit-worktree-DDP57JLV.js → exit-worktree-ARA4C3CK.js} +49 -36
  189. package/chunks/{exitPlanMode-CJBLGPIP.js → exitPlanMode-GCDIQPB7.js} +49 -36
  190. package/chunks/{fast-path-M6RP2ING.js → fast-path-IDHBVIT6.js} +3 -2
  191. package/chunks/{fr-X7KDVZIY.js → fr-WVHEBDDB.js} +5 -1
  192. package/chunks/{gemini-H4PHBJTL.js → gemini-2AFQJMX5.js} +141 -105
  193. package/chunks/{geminiContentGenerator-VURJYPWP.js → geminiContentGenerator-UDIH3YI6.js} +9 -8
  194. package/chunks/{getMachineId-bsd-EXV7SWPA.js → getMachineId-bsd-QFVLPUPT.js} +1 -1
  195. package/chunks/{getMachineId-darwin-IUOMFXU3.js → getMachineId-darwin-DGMQQE2E.js} +1 -1
  196. package/chunks/{getMachineId-linux-K7XJYFHL.js → getMachineId-linux-R4Z6CSWC.js} +1 -1
  197. package/chunks/{getMachineId-unsupported-EA5FDRJ6.js → getMachineId-unsupported-Z3SBVBUV.js} +1 -1
  198. package/chunks/{getMachineId-win-KBA6RAI5.js → getMachineId-win-SCK5UFDT.js} +1 -1
  199. package/chunks/{glob-2KUSRAVQ.js → glob-HCL7HZ67.js} +49 -36
  200. package/chunks/{grep-B5RXVESV.js → grep-CJLBSCTV.js} +49 -36
  201. package/chunks/handleAutoUpdate-Q572P3FL.js +80 -0
  202. package/chunks/i18n-OBB4R7SR.js +96 -0
  203. package/chunks/initializer-LXEY6V3C.js +85 -0
  204. package/chunks/installationInfo-XUAOVMEE.js +79 -0
  205. package/chunks/{ja-2ICT3KXF.js → ja-KY4ROZTE.js} +5 -1
  206. package/chunks/{keychain-token-storage-DWRJMNH3.js → keychain-token-storage-6ACJDYIB.js} +3 -3
  207. package/chunks/{kittyProtocolDetector-HCNNKJTI.js → kittyProtocolDetector-MBRTDRBK.js} +5 -3
  208. package/chunks/list-WAXY7QOU.js +88 -0
  209. package/chunks/list-agents-AH3P5NB7.js +80 -0
  210. package/chunks/loadedSettingsAdapter-OZFNBRHE.js +82 -0
  211. package/chunks/loggingContentGenerator-7WDTTE6G.js +1068 -0
  212. package/chunks/{loop-wakeup-5GLTUBHA.js → loop-wakeup-IHRW6TNB.js} +7 -7
  213. package/chunks/{ls-FHBY3Y7I.js → ls-ZAXZ2G2W.js} +5 -5
  214. package/chunks/{lsp-B6VMEW6Y.js → lsp-R4ZG3UGQ.js} +3 -3
  215. package/chunks/managed-npm-update-N42DO5QW.js +339 -0
  216. package/chunks/mcp-6SOORKTY.js +82 -0
  217. package/chunks/{monitor-GLJZDNPS.js → monitor-4PSVNVU4.js} +51 -37
  218. package/chunks/node-UUDY34IG.js +305 -0
  219. package/chunks/nonInteractiveCli-FBR5S7IZ.js +140 -0
  220. package/chunks/{notebook-edit-AVCIWS4F.js → notebook-edit-QK26632S.js} +50 -39
  221. package/chunks/{openaiContentGenerator-B7W24G3D.js → openaiContentGenerator-IXJS6C2U.js} +33 -20
  222. package/chunks/pidfile-UCFCJOAP.js +85 -0
  223. package/chunks/{processUtils-XZPY2PBB.js → processUtils-YL2LXON2.js} +2 -2
  224. package/chunks/{pt-JJ4XPIBP.js → pt-OK455PLH.js} +5 -1
  225. package/chunks/{qwenContentGenerator-6GUTWJIC.js → qwenContentGenerator-H6WZPJKC.js} +56 -36
  226. package/chunks/{qwenOAuth2-GASEEWGU.js → qwenOAuth2-HTROHKXO.js} +10 -23
  227. package/chunks/read-file-FOYTMUNL.js +31 -0
  228. package/chunks/{read-mcp-resource-AKCL7I43.js → read-mcp-resource-65BWNF3F.js} +3 -3
  229. package/chunks/{record-artifact-PEUB7727.js → record-artifact-2RLSOP6U.js} +3 -3
  230. package/chunks/resumeHistoryUtils-ZNHTWBXS.js +90 -0
  231. package/chunks/ripGrep-K4K4QLNJ.js +72 -0
  232. package/chunks/{ru-STR4KTW7.js → ru-7SPDGMGD.js} +5 -1
  233. package/chunks/{run-qwen-serve-OZGR3FQA.js → run-qwen-serve-XI4MCAFV.js} +343 -88
  234. package/chunks/runtime-4CTBU5WX.js +115 -0
  235. package/chunks/{scheduler-Z7QLMUWA.js → scheduler-TTEITHBF.js} +46 -33
  236. package/chunks/sdk-exporters-grpc-N3OLDF63.js +23214 -0
  237. package/chunks/sdk-exporters-http-AOHAEOMC.js +563 -0
  238. package/chunks/sdk-impl-TLQOC7P4.js +9193 -0
  239. package/chunks/{send-message-3RHE7HSM.js → send-message-GEY4CNPS.js} +47 -8
  240. package/chunks/serve-W7UKJTQT.js +88 -0
  241. package/chunks/{server-SO64U3X5.js → server-JD5PIE7A.js} +3069 -517
  242. package/chunks/{session-2KL2WQAH.js → session-R4BDHLYR.js} +112 -177
  243. package/chunks/{settings-KITVOUSV.js → settings-BXZHA6TZ.js} +50 -37
  244. package/chunks/shell-XYMFCGN5.js +82 -0
  245. package/chunks/{skill-SOQHY455.js → skill-YKXYEPOF.js} +25 -20
  246. package/chunks/spawnChannel-IO4HQLFS.js +81 -0
  247. package/chunks/{src-43LM7JLB.js → src-LKKTJ4NG.js} +382 -235
  248. package/chunks/standalone-update-76JG7DVN.js +91 -0
  249. package/chunks/{startInteractiveUI-3RGTGEX5.js → startInteractiveUI-BXWQUXAS.js} +1314 -958
  250. package/chunks/{syntheticOutput-FG5PQKIR.js → syntheticOutput-2WNMXEU5.js} +4 -4
  251. package/chunks/task-create-R5H74Y76.js +25 -0
  252. package/chunks/{task-list-QWSY4ZIU.js → task-list-WXAFDSRY.js} +7 -7
  253. package/chunks/{task-stop-GWC6UWAL.js → task-stop-CHFZP23W.js} +4 -4
  254. package/chunks/{task-update-NCTAB73Q.js → task-update-Z44A4GAR.js} +11 -9
  255. package/chunks/{team-create-FXN3PEBP.js → team-create-5Y3MCAIM.js} +49 -36
  256. package/chunks/{team-delete-KK37HTOG.js → team-delete-YDCMRSI4.js} +7 -7
  257. package/chunks/{team-plan-approval-GEIZ356Q.js → team-plan-approval-HYJJZ76T.js} +49 -36
  258. package/chunks/theme-manager-3YF2SUZL.js +76 -0
  259. package/chunks/{todoWrite-ERCAMLFS.js → todoWrite-ED2IVZJL.js} +5 -5
  260. package/chunks/{tool-search-XKK7DNOK.js → tool-search-3ZO2XMEP.js} +21 -17
  261. package/chunks/total-session-admission-NDF7EVG7.js +83 -0
  262. package/chunks/trustedFolders-Q7RALK4T.js +92 -0
  263. package/chunks/{chunk-6EFTQYW7.js → undici-3FJYTMOF.js} +24 -399
  264. package/chunks/{chunk-L573Z2QZ.js → undici-PYHBDDPN.js} +1 -5
  265. package/chunks/{update-relaunch-FMVZK6XF.js → update-relaunch-BTW5XGVT.js} +17 -17
  266. package/chunks/updateCheck-MXIU6DWQ.js +91 -0
  267. package/chunks/useAutoAcceptIndicator-BJXHJW77.js +92 -0
  268. package/chunks/{validateNonInterActiveAuth-PRVEB6GG.js → validateNonInterActiveAuth-FLEPF3QQ.js} +90 -76
  269. package/chunks/{version-AZMG6KWL.js → version-75VRONIL.js} +1 -1
  270. package/chunks/{web-fetch-EPGJ5OQQ.js → web-fetch-5X27LYHB.js} +101 -41
  271. package/chunks/web-search-IDMTBJUP.js +718 -0
  272. package/chunks/{workflow-UTNVPW22.js → workflow-JOD2OPFQ.js} +54 -40
  273. package/chunks/workspace-providers-status-WDLBDLPG.js +85 -0
  274. package/chunks/{workspace-registration-store-F3ZX3YHT.js → workspace-registration-store-26Z6J6P5.js} +9 -3
  275. package/chunks/workspace-registry-IABDATX3.js +87 -0
  276. package/chunks/workspace-service-BI4KDYPD.js +97 -0
  277. package/chunks/workspace-skills-status-OVB4LPHA.js +84 -0
  278. package/chunks/write-file-276AJ7KE.js +72 -0
  279. package/chunks/{zh-6ANG2HTL.js → zh-Q54GA5SV.js} +6 -1
  280. package/chunks/{zh-TW-4RR3YHNN.js → zh-TW-VOBNFOPU.js} +6 -1
  281. package/cli-entry.js +164 -12
  282. package/cli.js +19 -12
  283. package/locales/ca.js +773 -203
  284. package/locales/de.js +8 -2
  285. package/locales/en.js +9 -2
  286. package/locales/fr.js +8 -2
  287. package/locales/ja.js +8 -2
  288. package/locales/pt.js +8 -2
  289. package/locales/ru.js +8 -2
  290. package/locales/zh-TW.js +9 -2
  291. package/locales/zh.js +9 -2
  292. package/package.json +3 -3
  293. package/web-shell/assets/{arc-Buk1besA.js → arc-CMb7lr2P.js} +1 -1
  294. package/web-shell/assets/{architectureDiagram-3BPJPVTR-B1aUKYDC.js → architectureDiagram-3BPJPVTR-D6KQ5Kwm.js} +1 -1
  295. package/web-shell/assets/{blockDiagram-GPEHLZMM-CRTdg3Zx.js → blockDiagram-GPEHLZMM-Ce7YYSf8.js} +1 -1
  296. package/web-shell/assets/{c4Diagram-AAUBKEIU-DFdRMp5g.js → c4Diagram-AAUBKEIU-DaStHfor.js} +1 -1
  297. package/web-shell/assets/channel-Dg4f-Kry.js +1 -0
  298. package/web-shell/assets/{chunk-2J33WTMH-4rYQdkEI.js → chunk-2J33WTMH-CPaqadg9.js} +1 -1
  299. package/web-shell/assets/{chunk-4BX2VUAB-Coi-pQJy.js → chunk-4BX2VUAB-Veh9ZGKg.js} +1 -1
  300. package/web-shell/assets/{chunk-55IACEB6-BtBjz02t.js → chunk-55IACEB6-BPTX5n4q.js} +1 -1
  301. package/web-shell/assets/{chunk-727SXJPM-CGYOWorl.js → chunk-727SXJPM-CtXsE_ca.js} +1 -1
  302. package/web-shell/assets/{chunk-AQP2D5EJ-CH5AKhqx.js → chunk-AQP2D5EJ-D8DDCJ8h.js} +1 -1
  303. package/web-shell/assets/{chunk-FMBD7UC4-Cd50-w85.js → chunk-FMBD7UC4-cjMDGzHz.js} +1 -1
  304. package/web-shell/assets/{chunk-ND2GUHAM-C2wF3KCK.js → chunk-ND2GUHAM-BaZ1hNhV.js} +1 -1
  305. package/web-shell/assets/{chunk-QZHKN3VN-pCeRTaWi.js → chunk-QZHKN3VN-C7w-9w5-.js} +1 -1
  306. package/web-shell/assets/classDiagram-4FO5ZUOK-CT7Fo2aW.js +1 -0
  307. package/web-shell/assets/classDiagram-v2-Q7XG4LA2-CT7Fo2aW.js +1 -0
  308. package/web-shell/assets/{cose-bilkent-S5V4N54A-B-_fAB6D.js → cose-bilkent-S5V4N54A-DqvBEEIe.js} +1 -1
  309. package/web-shell/assets/{dagre-BM42HDAG-ChSPNHpL.js → dagre-BM42HDAG-RkPyoMAk.js} +1 -1
  310. package/web-shell/assets/{diagram-2AECGRRQ-BX7cFOF3.js → diagram-2AECGRRQ-D9b6nNyg.js} +1 -1
  311. package/web-shell/assets/{diagram-5GNKFQAL-BQUTW92n.js → diagram-5GNKFQAL-CiiNKUIy.js} +1 -1
  312. package/web-shell/assets/{diagram-KO2AKTUF-BkYPh3e4.js → diagram-KO2AKTUF-CP1qizXd.js} +1 -1
  313. package/web-shell/assets/{diagram-LMA3HP47-Cl6jsNyx.js → diagram-LMA3HP47-BGe30TWx.js} +1 -1
  314. package/web-shell/assets/{diagram-OG6HWLK6-DRWoHz8n.js → diagram-OG6HWLK6-CvoEPARH.js} +1 -1
  315. package/web-shell/assets/{erDiagram-TEJ5UH35-CGvFcZco.js → erDiagram-TEJ5UH35-DWfLzVkV.js} +1 -1
  316. package/web-shell/assets/{flowDiagram-I6XJVG4X-vms6oVdv.js → flowDiagram-I6XJVG4X-D-dTQmo6.js} +1 -1
  317. package/web-shell/assets/{ganttDiagram-6RSMTGT7-ukT_sfmi.js → ganttDiagram-6RSMTGT7-CYPHKaGY.js} +1 -1
  318. package/web-shell/assets/{gitGraphDiagram-PVQCEYII-Bn2ZE2Ut.js → gitGraphDiagram-PVQCEYII-DA7_aQYD.js} +1 -1
  319. package/web-shell/assets/index-B0i-TOYM.css +5 -0
  320. package/web-shell/assets/index-CgCHD46L.js +1225 -0
  321. package/web-shell/assets/{index-wFXp7W68.js → index-DqHNAB8C.js} +1 -1
  322. package/web-shell/assets/{infoDiagram-5YYISTIA-DHJdSi7x.js → infoDiagram-5YYISTIA-B87ljDPa.js} +1 -1
  323. package/web-shell/assets/{ishikawaDiagram-YF4QCWOH-DOvd2Wph.js → ishikawaDiagram-YF4QCWOH-CYSpyjaN.js} +1 -1
  324. package/web-shell/assets/{journeyDiagram-JHISSGLW-CH_urMCT.js → journeyDiagram-JHISSGLW-DAL6Js6f.js} +1 -1
  325. package/web-shell/assets/{kanban-definition-UN3LZRKU-FKiBdgbH.js → kanban-definition-UN3LZRKU-_zufKGJv.js} +1 -1
  326. package/web-shell/assets/{linear-0ZVQFVKf.js → linear-DidhMgku.js} +1 -1
  327. package/web-shell/assets/{mermaid.core-DJ05ZZIK.js → mermaid.core-DAkX3h3a.js} +5 -5
  328. package/web-shell/assets/{mindmap-definition-RKZ34NQL-BPuUhkUm.js → mindmap-definition-RKZ34NQL-DbZxUBEH.js} +1 -1
  329. package/web-shell/assets/{pieDiagram-4H26LBE5-yLFKcXyG.js → pieDiagram-4H26LBE5-Du9uoqrf.js} +1 -1
  330. package/web-shell/assets/{quadrantDiagram-W4KKPZXB-irWqc1pE.js → quadrantDiagram-W4KKPZXB-DwjELuKm.js} +1 -1
  331. package/web-shell/assets/{requirementDiagram-4Y6WPE33-B_4uMoIV.js → requirementDiagram-4Y6WPE33-BAqfVtBL.js} +1 -1
  332. package/web-shell/assets/{sankeyDiagram-5OEKKPKP-ciA4GPwk.js → sankeyDiagram-5OEKKPKP--hm2VpmK.js} +1 -1
  333. package/web-shell/assets/{sequenceDiagram-3UESZ5HK-CRdZvy0U.js → sequenceDiagram-3UESZ5HK-R5MUQaIt.js} +1 -1
  334. package/web-shell/assets/{stateDiagram-AJRCARHV-DaYIkCCn.js → stateDiagram-AJRCARHV-VsX032xQ.js} +1 -1
  335. package/web-shell/assets/stateDiagram-v2-BHNVJYJU-uPWLcSfy.js +1 -0
  336. package/web-shell/assets/{timeline-definition-PNZ67QCA-oBUKv6iH.js → timeline-definition-PNZ67QCA-BqjVRXzg.js} +1 -1
  337. package/web-shell/assets/{vennDiagram-CIIHVFJN-CGW9Sdmb.js → vennDiagram-CIIHVFJN-i2tkvlkg.js} +1 -1
  338. package/web-shell/assets/{wardley-L42UT6IY-CvwKJOCm.js → wardley-L42UT6IY-Ch8G49EM.js} +1 -1
  339. package/web-shell/assets/{wardleyDiagram-YWT4CUSO-Ipc260sN.js → wardleyDiagram-YWT4CUSO-bYpWeQNy.js} +1 -1
  340. package/web-shell/assets/{xychartDiagram-2RQKCTM6-D6-CM7pK.js → xychartDiagram-2RQKCTM6-C9NhuBqB.js} +1 -1
  341. package/web-shell/index.html +17 -13
  342. package/chunks/MaxSizedBox-B5YGZSYE.js +0 -72
  343. package/chunks/agent-H4JIDL7S.js +0 -67
  344. package/chunks/agent-headless-TTBEREQV.js +0 -61
  345. package/chunks/bridge-VL7ITBU5.js +0 -75
  346. package/chunks/chunk-542SK7KV.js +0 -8293
  347. package/chunks/chunk-CPCVCKKF.js +0 -358
  348. package/chunks/chunk-SEKHYHMS.js +0 -45
  349. package/chunks/chunk-W7FJ3N32.js +0 -49
  350. package/chunks/chunk-ZFKNWQGQ.js +0 -74639
  351. package/chunks/contextCommand-L2COEUHS.js +0 -66
  352. package/chunks/daemon-status-provider-NL4IAG7B.js +0 -74
  353. package/chunks/earlyInputCapture-L6I2A22T.js +0 -68
  354. package/chunks/errors-LEOF5QG4.js +0 -74
  355. package/chunks/handleAutoUpdate-QQVIWXKT.js +0 -67
  356. package/chunks/i18n-N6OBDORT.js +0 -83
  357. package/chunks/initializer-6WCFNDLL.js +0 -72
  358. package/chunks/installationInfo-6J3WPXNS.js +0 -64
  359. package/chunks/list-HOWQSWP6.js +0 -75
  360. package/chunks/loadedSettingsAdapter-AO4YBRXZ.js +0 -69
  361. package/chunks/mcp-QH7QNXOH.js +0 -69
  362. package/chunks/nonInteractiveCli-TI7EMPXD.js +0 -126
  363. package/chunks/pidfile-UEHAT6DH.js +0 -72
  364. package/chunks/read-file-SQJONF6A.js +0 -29
  365. package/chunks/resumeHistoryUtils-PFQ2A23X.js +0 -78
  366. package/chunks/ripGrep-QCK22GDU.js +0 -59
  367. package/chunks/runtime-SNVAP6EH.js +0 -100
  368. package/chunks/serve-BT7KS6SC.js +0 -75
  369. package/chunks/shell-BITUVH2R.js +0 -69
  370. package/chunks/spawnChannel-2BU3AULL.js +0 -68
  371. package/chunks/standalone-update-YG5JUYCM.js +0 -78
  372. package/chunks/task-create-HX32YXO7.js +0 -23
  373. package/chunks/theme-manager-IAETOI25.js +0 -63
  374. package/chunks/total-session-admission-BJLDHKJN.js +0 -69
  375. package/chunks/trustedFolders-5XCVNEUU.js +0 -79
  376. package/chunks/updateCheck-YZZB7YBU.js +0 -70
  377. package/chunks/useAutoAcceptIndicator-ZSQX4I2H.js +0 -80
  378. package/chunks/workspace-providers-status-EADV364W.js +0 -72
  379. package/chunks/workspace-registry-W6VMFYZU.js +0 -73
  380. package/chunks/workspace-service-F3KIN2UN.js +0 -84
  381. package/chunks/workspace-skills-status-YVICUR5Y.js +0 -71
  382. package/chunks/write-file-CVGF2OKV.js +0 -596
  383. package/web-shell/assets/channel-04R0vLbG.js +0 -1
  384. package/web-shell/assets/classDiagram-4FO5ZUOK-Bw9SOwAV.js +0 -1
  385. package/web-shell/assets/classDiagram-v2-Q7XG4LA2-Bw9SOwAV.js +0 -1
  386. package/web-shell/assets/index-DgkKrjw3.js +0 -1187
  387. package/web-shell/assets/index-Rv6mOAN9.css +0 -5
  388. package/web-shell/assets/stateDiagram-v2-BHNVJYJU-DWBoO4UY.js +0 -1
@@ -339,6 +339,7 @@ var RestSseTransport = class {
339
339
  baseUrl;
340
340
  token;
341
341
  _fetch;
342
+ activeSseRequests = /* @__PURE__ */ new Set();
342
343
  _disposed = false;
343
344
  type = "rest";
344
345
  supportsReplay = true;
@@ -371,75 +372,93 @@ var RestSseTransport = class {
371
372
  if (this._disposed) {
372
373
  throw new DaemonTransportClosedError();
373
374
  }
374
- const headers = { Accept: "text/event-stream" };
375
- if (this.token) {
376
- headers["Authorization"] = `Bearer ${this.token}`;
377
- }
378
- if (opts.lastEventId !== void 0) {
379
- headers["Last-Event-ID"] = String(opts.lastEventId);
380
- }
381
- const connectCtrl = new AbortController();
382
- let connectTimer;
383
- const connectTimeoutMs = opts.connectTimeoutMs;
384
- if (connectTimeoutMs && Number.isFinite(connectTimeoutMs)) {
385
- connectTimer = setTimeout(
386
- () => connectCtrl.abort(
387
- new DOMException("Initial connect timed out", "TimeoutError")
388
- ),
389
- connectTimeoutMs
390
- );
391
- if (typeof connectTimer === "object" && connectTimer && "unref" in connectTimer) {
392
- connectTimer.unref();
393
- }
394
- }
395
- const fetchSignal = opts.signal ? composeAbortSignals([opts.signal, connectCtrl.signal]) : connectCtrl.signal;
396
- let url = `${this.baseUrl}/session/${encodeURIComponent(sessionId)}/events`;
397
- if (opts.maxQueued !== void 0) {
398
- url += `?maxQueued=${encodeURIComponent(String(opts.maxQueued))}`;
399
- }
400
- let res;
375
+ const requestCtrl = new AbortController();
376
+ this.activeSseRequests.add(requestCtrl);
401
377
  try {
402
- res = await this._fetch(url, { headers, signal: fetchSignal });
403
- } finally {
404
- if (connectTimer !== void 0) clearTimeout(connectTimer);
405
- }
406
- if (!res.ok) {
407
- let body;
378
+ const headers = { Accept: "text/event-stream" };
379
+ if (this.token) {
380
+ headers["Authorization"] = `Bearer ${this.token}`;
381
+ }
382
+ if (opts.lastEventId !== void 0) {
383
+ headers["Last-Event-ID"] = String(opts.lastEventId);
384
+ if (opts.epoch !== void 0) {
385
+ headers["X-Qwen-Event-Epoch"] = opts.epoch;
386
+ }
387
+ }
388
+ const fetchSignal = opts.signal ? composeAbortSignals([opts.signal, requestCtrl.signal]) : requestCtrl.signal;
389
+ let url = `${this.baseUrl}/session/${encodeURIComponent(sessionId)}/events`;
390
+ if (opts.maxQueued !== void 0) {
391
+ url += `?maxQueued=${encodeURIComponent(String(opts.maxQueued))}`;
392
+ }
393
+ let connectTimer;
394
+ const connectTimeoutMs = opts.connectTimeoutMs;
395
+ if (connectTimeoutMs && Number.isFinite(connectTimeoutMs)) {
396
+ connectTimer = setTimeout(
397
+ () => requestCtrl.abort(
398
+ new DOMException("Initial connect timed out", "TimeoutError")
399
+ ),
400
+ connectTimeoutMs
401
+ );
402
+ if (typeof connectTimer === "object" && connectTimer && "unref" in connectTimer) {
403
+ connectTimer.unref();
404
+ }
405
+ }
406
+ let res;
408
407
  try {
409
- const text = await res.text();
408
+ res = await this._fetch(url, { headers, signal: fetchSignal });
409
+ } finally {
410
+ if (connectTimer !== void 0) clearTimeout(connectTimer);
411
+ }
412
+ if (!res.ok) {
413
+ let body;
410
414
  try {
411
- body = JSON.parse(text);
415
+ const text = await res.text();
416
+ try {
417
+ body = JSON.parse(text);
418
+ } catch {
419
+ body = text;
420
+ }
412
421
  } catch {
413
- body = text;
414
422
  }
415
- } catch {
423
+ const detail = body && typeof body === "object" && "error" in body ? String(body.error) : `HTTP ${res.status}`;
424
+ throw new DaemonHttpError(
425
+ res.status,
426
+ body,
427
+ `GET /session/:id/events: ${detail}`
428
+ );
416
429
  }
417
- const detail = body && typeof body === "object" && "error" in body ? String(body.error) : `HTTP ${res.status}`;
418
- throw new DaemonHttpError(
419
- res.status,
420
- body,
421
- `GET /session/:id/events: ${detail}`
422
- );
423
- }
424
- const ct = res.headers.get("content-type") ?? "";
425
- if (!ct.toLowerCase().includes("text/event-stream")) {
426
- try {
427
- await res.body?.cancel();
428
- } catch {
430
+ const ct = res.headers.get("content-type") ?? "";
431
+ if (!ct.toLowerCase().includes("text/event-stream")) {
432
+ try {
433
+ await res.body?.cancel();
434
+ } catch {
435
+ }
436
+ throw new DaemonHttpError(
437
+ res.status,
438
+ ct,
439
+ `GET /session/:id/events: expected content-type text/event-stream, got "${ct}"`
440
+ );
429
441
  }
430
- throw new DaemonHttpError(
431
- res.status,
432
- ct,
433
- `GET /session/:id/events: expected content-type text/event-stream, got "${ct}"`
434
- );
435
- }
436
- if (!res.body) {
437
- throw new Error("No SSE body");
442
+ if (!res.body) {
443
+ throw new Error("No SSE body");
444
+ }
445
+ const responseEpoch = res.headers.get("x-qwen-event-epoch");
446
+ if (responseEpoch) {
447
+ opts.onEpoch?.(responseEpoch);
448
+ }
449
+ yield* parseSseStream(res.body, fetchSignal);
450
+ } finally {
451
+ requestCtrl.abort();
452
+ this.activeSseRequests.delete(requestCtrl);
438
453
  }
439
- yield* parseSseStream(res.body, opts.signal);
440
454
  }
441
455
  dispose() {
456
+ if (this._disposed) return;
442
457
  this._disposed = true;
458
+ for (const requestCtrl of this.activeSseRequests) {
459
+ requestCtrl.abort();
460
+ }
461
+ this.activeSseRequests.clear();
443
462
  }
444
463
  };
445
464
  function composeAbortSignals(signals) {
@@ -578,6 +597,7 @@ var DEFAULT_SESSION_LIST_PAGE_SIZE = 20;
578
597
  var DEFAULT_FETCH_TIMEOUT_MS = 3e4;
579
598
  var VOICE_TRANSCRIPTION_DEFAULT_TIMEOUT_MS = 65e3;
580
599
  var GITHUB_SETUP_DEFAULT_TIMEOUT_MS = 9e4;
600
+ var CHANNEL_NOTIFY_DEFAULT_TIMEOUT_MS = 35e3;
581
601
  var MAX_TIMER_DELAY_MS = 2147483647;
582
602
  var DEFAULT_MAX_PENDING_PROMPTS_PER_SESSION = 5;
583
603
  var MCP_RESTART_DEFAULT_TIMEOUT_MS = MCP_RESTART_SERVER_DEADLINE_MS + MCP_RESTART_CLIENT_HEADROOM_MS;
@@ -890,6 +910,25 @@ var DaemonClient = class {
890
910
  }
891
911
  );
892
912
  }
913
+ /**
914
+ * Send text directly through the primary workspace's channel worker.
915
+ * This does not create or prompt an Agent session. Pre-flight the
916
+ * `channel_delivery` capability before calling across mixed daemon versions.
917
+ * A successful capability check does not guarantee worker liveness; callers
918
+ * must treat 503 `channel_worker_unavailable` as an expected outcome.
919
+ */
920
+ async notify(req, opts) {
921
+ return await this.jsonRequest(
922
+ "/workspace/notify",
923
+ "POST /workspace/notify",
924
+ {
925
+ method: "POST",
926
+ body: req,
927
+ timeoutMs: opts?.timeoutMs ?? CHANNEL_NOTIFY_DEFAULT_TIMEOUT_MS,
928
+ mode: "rest"
929
+ }
930
+ );
931
+ }
893
932
  async requireCapability(capability) {
894
933
  const caps = await this.capabilities();
895
934
  if (!caps.features.includes(capability)) {
@@ -956,13 +995,13 @@ var DaemonClient = class {
956
995
  }
957
996
  );
958
997
  }
959
- async reloadWorkspaceMcp() {
998
+ async reloadWorkspaceMcp(options = {}) {
960
999
  return await this.fetchWithTimeout(
961
1000
  `${this.baseUrl}/workspace/mcp/reload`,
962
1001
  {
963
1002
  method: "POST",
964
1003
  headers: this.headers({ "Content-Type": "application/json" }),
965
- body: "{}"
1004
+ body: JSON.stringify(options)
966
1005
  },
967
1006
  async (res) => {
968
1007
  if (!res.ok) {
@@ -994,6 +1033,24 @@ var DaemonClient = class {
994
1033
  { mode: "rest" }
995
1034
  );
996
1035
  }
1036
+ async workspaceGitLog(limit, skip) {
1037
+ const params = new URLSearchParams();
1038
+ if (limit != null) params.set("limit", String(limit));
1039
+ if (skip != null) params.set("skip", String(skip));
1040
+ const qs = params.toString();
1041
+ return await this.jsonRequest(
1042
+ `/workspace/git/log${qs ? `?${qs}` : ""}`,
1043
+ "GET /workspace/git/log",
1044
+ { mode: "rest" }
1045
+ );
1046
+ }
1047
+ async workspaceGitCommitDetail(sha) {
1048
+ return await this.jsonRequest(
1049
+ `/workspace/git/log/commit?sha=${urlEncode(sha)}`,
1050
+ "GET /workspace/git/log/commit",
1051
+ { mode: "rest" }
1052
+ );
1053
+ }
997
1054
  async workspaceMcpTools(serverName) {
998
1055
  return await this.fetchWithTimeout(
999
1056
  `${this.baseUrl}/workspace/mcp/${urlEncode(serverName)}/tools`,
@@ -1036,28 +1093,21 @@ var DaemonClient = class {
1036
1093
  async workspaceAcpPreheat(timeoutMs) {
1037
1094
  const serverBudgetMs = timeoutMs ?? 5e3;
1038
1095
  const suffix = timeoutMs !== void 0 ? `?timeoutMs=${encodeURIComponent(timeoutMs)}` : "";
1039
- return await this.fetchWithTimeout(
1040
- `${this.baseUrl}/workspace/acp/preheat${suffix}`,
1041
- { method: "POST", headers: this.headers() },
1042
- async (res) => {
1043
- if (!res.ok) {
1044
- throw await this.failOnError(res, "POST /workspace/acp/preheat");
1045
- }
1046
- return await res.json();
1047
- },
1048
- serverBudgetMs + 2e3
1096
+ return await this.jsonRequest(
1097
+ `/workspace/acp/preheat${suffix}`,
1098
+ "POST /workspace/acp/preheat",
1099
+ {
1100
+ method: "POST",
1101
+ timeoutMs: serverBudgetMs + 2e3,
1102
+ mode: "rest"
1103
+ }
1049
1104
  );
1050
1105
  }
1051
1106
  async workspaceAcpStatus() {
1052
- return await this.fetchWithTimeout(
1053
- `${this.baseUrl}/workspace/acp/status`,
1054
- { headers: this.headers() },
1055
- async (res) => {
1056
- if (!res.ok) {
1057
- throw await this.failOnError(res, "GET /workspace/acp/status");
1058
- }
1059
- return await res.json();
1060
- }
1107
+ return await this.jsonRequest(
1108
+ "/workspace/acp/status",
1109
+ "GET /workspace/acp/status",
1110
+ { mode: "rest" }
1061
1111
  );
1062
1112
  }
1063
1113
  async workspaceProviders() {
@@ -1605,9 +1655,47 @@ var DaemonClient = class {
1605
1655
  MCP_RESTART_DEFAULT_TIMEOUT_MS
1606
1656
  );
1607
1657
  }
1608
- async getWorkspaceAgent(agentType) {
1658
+ async *generateContentEvents(path, label, body, opts, parse, requireTerminal) {
1659
+ const res = await this.transport.fetch(`${this.baseUrl}${path}`, {
1660
+ method: "POST",
1661
+ headers: this.headers(
1662
+ {
1663
+ "Content-Type": "application/json",
1664
+ Accept: "text/event-stream"
1665
+ },
1666
+ opts?.clientId
1667
+ ),
1668
+ body: JSON.stringify(body),
1669
+ signal: opts?.signal
1670
+ });
1671
+ if (!res.ok) throw await this.failOnError(res, label);
1672
+ if (!res.body) throw new Error("Generation response body is missing");
1673
+ let sawTerminal = false;
1674
+ for await (const event of parseSseStream(res.body, opts?.signal)) {
1675
+ const generationEvent = parse(event);
1676
+ if (!generationEvent) continue;
1677
+ sawTerminal = generationEvent.type === "done" || generationEvent.type === "error";
1678
+ yield generationEvent;
1679
+ if (requireTerminal && sawTerminal) return;
1680
+ }
1681
+ if (requireTerminal && !opts?.signal?.aborted && !sawTerminal) {
1682
+ throw new Error("Stream ended without terminal event");
1683
+ }
1684
+ }
1685
+ async *generateWorkspaceContent(prompt, opts) {
1686
+ yield* this.generateContentEvents(
1687
+ "/workspace/generate",
1688
+ "POST /workspace/generate",
1689
+ { prompt },
1690
+ opts,
1691
+ parseSessionGenerationEvent,
1692
+ true
1693
+ );
1694
+ }
1695
+ async getWorkspaceAgent(agentType, opts = {}) {
1696
+ const url = opts.scope ? `${this.baseUrl}/workspace/agents/${urlEncode(agentType)}?scope=${urlEncode(opts.scope)}` : `${this.baseUrl}/workspace/agents/${urlEncode(agentType)}`;
1609
1697
  return await this.fetchWithTimeout(
1610
- `${this.baseUrl}/workspace/agents/${urlEncode(agentType)}`,
1698
+ url,
1611
1699
  { headers: this.headers() },
1612
1700
  async (res) => {
1613
1701
  if (!res.ok) {
@@ -1742,7 +1830,8 @@ var DaemonClient = class {
1742
1830
  ...req.sessionScope !== void 0 ? { sessionScope: req.sessionScope } : {},
1743
1831
  ...req.approvalMode !== void 0 ? { approvalMode: req.approvalMode } : {},
1744
1832
  ...req.sourceType !== void 0 ? { sourceType: req.sourceType } : {},
1745
- ...req.sourceId !== void 0 ? { sourceId: req.sourceId } : {}
1833
+ ...req.sourceId !== void 0 ? { sourceId: req.sourceId } : {},
1834
+ ...req.worktree !== void 0 ? { worktree: req.worktree } : {}
1746
1835
  })
1747
1836
  },
1748
1837
  async (res) => {
@@ -1856,6 +1945,20 @@ var DaemonClient = class {
1856
1945
  }
1857
1946
  );
1858
1947
  }
1948
+ async resolveSubagentSession(sessionId, toolCallId, clientId) {
1949
+ return await this.jsonRequest(
1950
+ `/session/${urlEncode(sessionId)}/subagents/${urlEncode(toolCallId)}`,
1951
+ "GET /session/:id/subagents/:toolCallId",
1952
+ { clientId, mode: "rest" }
1953
+ );
1954
+ }
1955
+ async cancelSubagentSession(sessionId, toolCallId, clientId) {
1956
+ return await this.jsonRequest(
1957
+ `/session/${urlEncode(sessionId)}/subagents/${urlEncode(toolCallId)}/cancel`,
1958
+ "POST /session/:id/subagents/:toolCallId/cancel",
1959
+ { clientId, mode: "rest", method: "POST" }
1960
+ );
1961
+ }
1859
1962
  async resumeSession(sessionId, req = {}, clientId) {
1860
1963
  return this.restoreSession("resume", sessionId, req, clientId);
1861
1964
  }
@@ -2167,29 +2270,14 @@ var DaemonClient = class {
2167
2270
  return await res.json();
2168
2271
  }
2169
2272
  async *generateSessionContent(sessionId, prompt, opts) {
2170
- const res = await this.transport.fetch(
2171
- `${this.baseUrl}/session/${urlEncode(sessionId)}/generate`,
2172
- {
2173
- method: "POST",
2174
- headers: this.headers(
2175
- {
2176
- "Content-Type": "application/json",
2177
- Accept: "text/event-stream"
2178
- },
2179
- opts?.clientId
2180
- ),
2181
- body: JSON.stringify({ prompt }),
2182
- signal: opts?.signal
2183
- }
2273
+ yield* this.generateContentEvents(
2274
+ `/session/${urlEncode(sessionId)}/generate`,
2275
+ "POST /session/:id/generate",
2276
+ { prompt },
2277
+ opts,
2278
+ parseSessionGenerationEvent,
2279
+ false
2184
2280
  );
2185
- if (!res.ok) {
2186
- throw await this.failOnError(res, "POST /session/:id/generate");
2187
- }
2188
- if (!res.body) throw new Error("Generation response body is missing");
2189
- for await (const event of parseSseStream(res.body, opts?.signal)) {
2190
- const generationEvent = parseSessionGenerationEvent(event);
2191
- if (generationEvent) yield generationEvent;
2192
- }
2193
2281
  }
2194
2282
  async btwSession(sessionId, question, opts) {
2195
2283
  const res = await this.transport.fetch(
@@ -2924,7 +3012,8 @@ var DaemonClient = class {
2924
3012
  accept.promptId,
2925
3013
  accept.lastEventId,
2926
3014
  signal,
2927
- clientId
3015
+ clientId,
3016
+ accept.eventEpoch
2928
3017
  );
2929
3018
  } finally {
2930
3019
  releasePromptSlot();
@@ -2978,12 +3067,16 @@ var DaemonClient = class {
2978
3067
  }
2979
3068
  return await res.json();
2980
3069
  }
2981
- async _awaitTurnComplete(sessionId, promptId, lastEventId, signal, clientId) {
3070
+ async _awaitTurnComplete(sessionId, promptId, lastEventId, signal, clientId, eventEpoch) {
2982
3071
  const sseAbort = new AbortController();
2983
3072
  const composedSignal = signal ? composeAbortSignals2([signal, sseAbort.signal]) : sseAbort.signal;
2984
3073
  try {
2985
3074
  const events = this.subscribeEvents(sessionId, {
2986
3075
  lastEventId,
3076
+ // Cursor and epoch both come from the 202 envelope: a daemon
3077
+ // restart between the 202 and this subscribe is detected as an
3078
+ // epoch mismatch instead of silently mis-resuming (DAEMON-001).
3079
+ ...eventEpoch !== void 0 ? { epoch: eventEpoch } : {},
2987
3080
  signal: composedSignal
2988
3081
  });
2989
3082
  for await (const event of events) {
@@ -3049,6 +3142,8 @@ var DaemonClient = class {
3049
3142
  async *subscribeEvents(sessionId, opts = {}) {
3050
3143
  yield* this.transport.subscribeEvents(sessionId, {
3051
3144
  lastEventId: opts.lastEventId,
3145
+ epoch: opts.epoch,
3146
+ onEpoch: opts.onEpoch,
3052
3147
  maxQueued: opts.maxQueued,
3053
3148
  signal: opts.signal,
3054
3149
  connectTimeoutMs: this.fetchTimeoutMs || void 0
@@ -3336,7 +3431,8 @@ var DaemonClient = class {
3336
3431
  headers: this.headers({ "Content-Type": "application/json" }),
3337
3432
  body: JSON.stringify({
3338
3433
  cwd,
3339
- ...options.persist ? { persist: true } : {}
3434
+ ...options.persist ? { persist: true } : {},
3435
+ ...options.displayName !== void 0 ? { displayName: options.displayName } : {}
3340
3436
  })
3341
3437
  },
3342
3438
  async (res) => {
@@ -3347,6 +3443,31 @@ var DaemonClient = class {
3347
3443
  }
3348
3444
  );
3349
3445
  }
3446
+ async updateWorkspace(workspaceSelector, update) {
3447
+ return await this.workspaceJsonRequest(
3448
+ urlEncode(workspaceSelector),
3449
+ "",
3450
+ "PATCH /workspaces/:workspace",
3451
+ { method: "PATCH", body: update, mode: "rest" }
3452
+ );
3453
+ }
3454
+ /** Requests a process-local workspace in a daemon-managed empty directory. */
3455
+ async addScratchWorkspace() {
3456
+ return await this.fetchWithTimeout(
3457
+ `${this.baseUrl}/workspaces`,
3458
+ {
3459
+ method: "POST",
3460
+ headers: this.headers({ "Content-Type": "application/json" }),
3461
+ body: JSON.stringify({ kind: "scratch" })
3462
+ },
3463
+ async (res) => {
3464
+ if (!res.ok) {
3465
+ throw await this.failOnError(res, "POST /workspaces");
3466
+ }
3467
+ return await res.json();
3468
+ }
3469
+ );
3470
+ }
3350
3471
  // -- Lifecycle / disposal ------------------------------------------------
3351
3472
  /**
3352
3473
  * Release transport resources (WS close, etc.). Idempotent.
@@ -3419,6 +3540,24 @@ var WorkspaceDaemonClient = class {
3419
3540
  workspaceMcp() {
3420
3541
  return this.get("/mcp", "GET /workspaces/:workspace/mcp");
3421
3542
  }
3543
+ /**
3544
+ * Send text directly through this exact workspace's channel worker.
3545
+ * A successful capability pre-flight does not guarantee worker liveness;
3546
+ * callers must treat 503 `channel_worker_unavailable` as an expected outcome.
3547
+ */
3548
+ notify(req, opts) {
3549
+ return this.client.workspaceJsonRequest(
3550
+ this.workspaceSelector,
3551
+ "/notify",
3552
+ "POST /workspaces/:workspace/notify",
3553
+ {
3554
+ method: "POST",
3555
+ body: req,
3556
+ timeoutMs: opts?.timeoutMs ?? CHANNEL_NOTIFY_DEFAULT_TIMEOUT_MS,
3557
+ mode: "rest"
3558
+ }
3559
+ );
3560
+ }
3422
3561
  initializeWorkspaceMcp() {
3423
3562
  return this.post(
3424
3563
  "/mcp/initialize",
@@ -3426,11 +3565,11 @@ var WorkspaceDaemonClient = class {
3426
3565
  {}
3427
3566
  );
3428
3567
  }
3429
- reloadWorkspaceMcp() {
3568
+ reloadWorkspaceMcp(options = {}) {
3430
3569
  return this.post(
3431
3570
  "/mcp/reload",
3432
3571
  "POST /workspaces/:workspace/mcp/reload",
3433
- {}
3572
+ options
3434
3573
  );
3435
3574
  }
3436
3575
  workspaceVoice(clientId) {
@@ -3456,10 +3595,11 @@ var WorkspaceDaemonClient = class {
3456
3595
  opts
3457
3596
  );
3458
3597
  }
3459
- workspaceGit() {
3598
+ workspaceGit(cwd) {
3599
+ const suffix = cwd ? `/git?cwd=${encodeURIComponent(cwd)}` : "/git";
3460
3600
  return this.client.workspaceJsonRequest(
3461
3601
  this.workspaceSelector,
3462
- "/git",
3602
+ suffix,
3463
3603
  "GET /workspaces/:workspace/git",
3464
3604
  { mode: "rest" }
3465
3605
  );
@@ -3481,6 +3621,26 @@ var WorkspaceDaemonClient = class {
3481
3621
  { mode: "rest" }
3482
3622
  );
3483
3623
  }
3624
+ workspaceGitLog(limit, skip) {
3625
+ const params = new URLSearchParams();
3626
+ if (limit != null) params.set("limit", String(limit));
3627
+ if (skip != null) params.set("skip", String(skip));
3628
+ const qs = params.toString();
3629
+ return this.client.workspaceJsonRequest(
3630
+ this.workspaceSelector,
3631
+ `/git/log${qs ? `?${qs}` : ""}`,
3632
+ "GET /workspaces/:workspace/git/log",
3633
+ { mode: "rest" }
3634
+ );
3635
+ }
3636
+ workspaceGitCommitDetail(sha) {
3637
+ return this.client.workspaceJsonRequest(
3638
+ this.workspaceSelector,
3639
+ `/git/log/commit?sha=${urlEncode(sha)}`,
3640
+ "GET /workspaces/:workspace/git/log/commit",
3641
+ { mode: "rest" }
3642
+ );
3643
+ }
3484
3644
  workspaceSkills() {
3485
3645
  return this.get("/skills", "GET /workspaces/:workspace/skills");
3486
3646
  }
@@ -3978,7 +4138,20 @@ var DaemonSessionClient = class _DaemonSessionClient {
3978
4138
  replaySnapshot;
3979
4139
  hasActivePrompt;
3980
4140
  historyHasMore;
4141
+ /**
4142
+ * True when the load response flagged the replay snapshot as degraded
4143
+ * (`replayDegraded` — compaction failed at least once, so
4144
+ * `replaySnapshot` may lag behind live events). Prefer the full
4145
+ * transcript (see `fullTranscriptAvailable`) when set.
4146
+ */
4147
+ replayDegraded;
3981
4148
  lastSeenEventId;
4149
+ /**
4150
+ * Epoch token paired with {@link lastSeenEventId}. Seeded from the
4151
+ * load/resume/create response when available, refreshed from every
4152
+ * subscription's `X-Qwen-Event-Epoch` response header.
4153
+ */
4154
+ lastSeenEpoch;
3982
4155
  subscriptionActive = false;
3983
4156
  /** In-flight `reattach()` so concurrent prompts re-register only once. */
3984
4157
  reattaching;
@@ -3990,11 +4163,13 @@ var DaemonSessionClient = class _DaemonSessionClient {
3990
4163
  this.state = { ...opts.state ?? {} };
3991
4164
  this.hasActivePrompt = opts.hasActivePrompt ?? false;
3992
4165
  this.historyHasMore = opts.historyHasMore ?? false;
4166
+ this.replayDegraded = opts.replayDegraded ?? false;
3993
4167
  this.replaySnapshot = opts.replaySnapshot ?? {
3994
4168
  compactedReplay: [],
3995
4169
  liveJournal: []
3996
4170
  };
3997
4171
  this.lastSeenEventId = validateLastEventId(opts.lastEventId);
4172
+ this.lastSeenEpoch = opts.eventEpoch;
3998
4173
  this.promptLimit = opts.maxPendingPromptsPerSession === void 0 ? opts.client.maxPendingPromptsPerSession : normalizePendingPromptLimit(opts.maxPendingPromptsPerSession);
3999
4174
  }
4000
4175
  /**
@@ -4007,7 +4182,11 @@ var DaemonSessionClient = class _DaemonSessionClient {
4007
4182
  client,
4008
4183
  session,
4009
4184
  hasActivePrompt: session.hasActivePrompt,
4010
- lastEventId
4185
+ lastEventId,
4186
+ // Newer daemons may stamp the bus epoch on the create/attach
4187
+ // response; older ones don't — the first subscription then learns it
4188
+ // from the `X-Qwen-Event-Epoch` response header.
4189
+ eventEpoch: session.eventEpoch
4011
4190
  });
4012
4191
  }
4013
4192
  /**
@@ -4022,7 +4201,9 @@ var DaemonSessionClient = class _DaemonSessionClient {
4022
4201
  compactedReplay,
4023
4202
  liveJournal,
4024
4203
  historyHasMore,
4204
+ replayDegraded,
4025
4205
  lastEventId: serverLastEventId,
4206
+ eventEpoch,
4026
4207
  ...session
4027
4208
  } = await client.loadSession(sessionId, req, clientId);
4028
4209
  return new _DaemonSessionClient({
@@ -4031,11 +4212,13 @@ var DaemonSessionClient = class _DaemonSessionClient {
4031
4212
  hasActivePrompt,
4032
4213
  state,
4033
4214
  lastEventId: serverLastEventId ?? 0,
4215
+ eventEpoch,
4034
4216
  replaySnapshot: {
4035
4217
  compactedReplay: compactedReplay ?? [],
4036
4218
  liveJournal: liveJournal ?? []
4037
4219
  },
4038
- historyHasMore
4220
+ historyHasMore,
4221
+ replayDegraded
4039
4222
  });
4040
4223
  }
4041
4224
  /**
@@ -4049,6 +4232,7 @@ var DaemonSessionClient = class _DaemonSessionClient {
4049
4232
  state,
4050
4233
  hasActivePrompt,
4051
4234
  lastEventId: serverLastEventId,
4235
+ eventEpoch,
4052
4236
  ...session
4053
4237
  } = await client.resumeSession(sessionId, req, clientId);
4054
4238
  return new _DaemonSessionClient({
@@ -4056,7 +4240,8 @@ var DaemonSessionClient = class _DaemonSessionClient {
4056
4240
  session,
4057
4241
  hasActivePrompt,
4058
4242
  state,
4059
- lastEventId: serverLastEventId ?? 0
4243
+ lastEventId: serverLastEventId ?? 0,
4244
+ eventEpoch
4060
4245
  });
4061
4246
  }
4062
4247
  get sessionId() {
@@ -4071,6 +4256,9 @@ var DaemonSessionClient = class _DaemonSessionClient {
4071
4256
  get clientId() {
4072
4257
  return this.session.clientId;
4073
4258
  }
4259
+ get worktree() {
4260
+ return this.session.worktree;
4261
+ }
4074
4262
  get lastEventId() {
4075
4263
  return this.lastSeenEventId;
4076
4264
  }
@@ -4437,9 +4625,16 @@ var DaemonSessionClient = class _DaemonSessionClient {
4437
4625
  try {
4438
4626
  const { resume = true, ...subscribeOpts } = opts;
4439
4627
  const lastEventId = subscribeOpts.lastEventId ?? (resume ? this.lastSeenEventId : void 0);
4628
+ const epoch = subscribeOpts.epoch ?? (resume ? this.lastSeenEpoch : void 0);
4629
+ const callerOnEpoch = subscribeOpts.onEpoch;
4440
4630
  for await (const event of this.client.subscribeEvents(this.sessionId, {
4441
4631
  ...subscribeOpts,
4442
- lastEventId
4632
+ lastEventId,
4633
+ ...epoch !== void 0 ? { epoch } : {},
4634
+ onEpoch: /* @__PURE__ */ __name((learned) => {
4635
+ this.lastSeenEpoch = learned;
4636
+ callerOnEpoch?.(learned);
4637
+ }, "onEpoch")
4443
4638
  })) {
4444
4639
  this._dispatchTurnEvent(event);
4445
4640
  yield event;
@@ -4612,6 +4807,7 @@ var DAEMON_KNOWN_EVENT_TYPE_VALUES = [
4612
4807
  // consumers silently drop this event via `asKnownDaemonEvent`
4613
4808
  // returning undefined (no protocol bump required).
4614
4809
  "followup_suggestion",
4810
+ "channel_delivery_result",
4615
4811
  "user_shell_command",
4616
4812
  "user_shell_result",
4617
4813
  "turn_complete",
@@ -4800,6 +4996,8 @@ function asKnownDaemonEvent(event) {
4800
4996
  return event.data != null && typeof event.data === "object" ? event : void 0;
4801
4997
  case "followup_suggestion":
4802
4998
  return isFollowupSuggestionData(event.data) ? event : void 0;
4999
+ case "channel_delivery_result":
5000
+ return isChannelDeliveryResultData(event.data) ? event : void 0;
4803
5001
  case "mcp_server_added":
4804
5002
  return isMcpServerAddedData(event.data) ? event : void 0;
4805
5003
  case "mcp_server_removed":
@@ -5113,6 +5311,7 @@ function reduceDaemonSessionEvent(state, rawEvent) {
5113
5311
  case PENDING_PROMPT_ADDED_EVENT:
5114
5312
  case PENDING_PROMPT_STARTED_EVENT:
5115
5313
  case PENDING_PROMPT_COMPLETED_EVENT:
5314
+ case "channel_delivery_result":
5116
5315
  return base;
5117
5316
  case "session_rewound":
5118
5317
  return {
@@ -5536,6 +5735,38 @@ function isFollowupSuggestionData(value) {
5536
5735
  return isRecord(value) && isNonEmptyString(value["sessionId"]) && isNonEmptyString(value["suggestion"]) && isNonEmptyString(value["promptId"]);
5537
5736
  }
5538
5737
  __name(isFollowupSuggestionData, "isFollowupSuggestionData");
5738
+ var CHANNEL_DELIVERY_ERROR_CODES = /* @__PURE__ */ new Set([
5739
+ "channel_worker_unavailable",
5740
+ "channel_delivery_timeout",
5741
+ "channel_delivery_invalid",
5742
+ "channel_delivery_rejected",
5743
+ "channel_delivery_queue_full",
5744
+ "channel_delivery_failed"
5745
+ ]);
5746
+ function isChannelDeliveryResultData(value) {
5747
+ if (!isRecord(value) || !isNonEmptyString(value["sessionId"]) || !isNonEmptyString(value["deliveryId"]) || value["status"] !== "delivered" && value["status"] !== "failed" && value["status"] !== "skipped" || !Object.keys(value).every(
5748
+ (key) => [
5749
+ "sessionId",
5750
+ "deliveryId",
5751
+ "source",
5752
+ "status",
5753
+ "promptId",
5754
+ "taskId",
5755
+ "firedAt",
5756
+ "code",
5757
+ "error"
5758
+ ].includes(key)
5759
+ )) {
5760
+ return false;
5761
+ }
5762
+ const correlationValid = value["source"] === "prompt" && isNonEmptyString(value["promptId"]) && value["taskId"] === void 0 && value["firedAt"] === void 0 || value["source"] === "scheduled" && isNonEmptyString(value["taskId"]) && isFiniteNumber(value["firedAt"]) && value["promptId"] === void 0;
5763
+ if (!correlationValid) return false;
5764
+ if (value["status"] === "failed") {
5765
+ return typeof value["code"] === "string" && CHANNEL_DELIVERY_ERROR_CODES.has(value["code"]) && isNonEmptyString(value["error"]);
5766
+ }
5767
+ return value["code"] === void 0 && value["error"] === void 0;
5768
+ }
5769
+ __name(isChannelDeliveryResultData, "isChannelDeliveryResultData");
5539
5770
  function isMcpServerAddedData(value) {
5540
5771
  if (!isRecord(value)) return false;
5541
5772
  if (!isNonEmptyString(value["name"])) return false;
@@ -6277,26 +6508,43 @@ function extractServerTimestamp(event) {
6277
6508
  }
6278
6509
  if (isRecord2(event.data)) {
6279
6510
  const dataMeta = event.data["_meta"];
6511
+ const update = event.data["update"];
6512
+ const updateMeta = isRecord2(update) ? update["_meta"] : void 0;
6280
6513
  if (isRecord2(dataMeta)) {
6281
6514
  const ts = dataMeta["serverTimestamp"];
6282
6515
  if (typeof ts === "number" && Number.isFinite(ts)) return ts;
6283
6516
  }
6284
- const update = event.data["update"];
6285
- if (isRecord2(update)) {
6286
- const updateMeta = update["_meta"];
6287
- if (isRecord2(updateMeta)) {
6288
- const serverTs = updateMeta["serverTimestamp"];
6289
- if (typeof serverTs === "number" && Number.isFinite(serverTs)) {
6290
- return serverTs;
6291
- }
6292
- const ts = updateMeta["timestamp"];
6293
- if (typeof ts === "number" && Number.isFinite(ts)) return ts;
6517
+ if (isRecord2(updateMeta)) {
6518
+ const serverTs = updateMeta["serverTimestamp"];
6519
+ if (typeof serverTs === "number" && Number.isFinite(serverTs)) {
6520
+ return serverTs;
6294
6521
  }
6295
6522
  }
6523
+ const timestampCandidates = [
6524
+ isRecord2(updateMeta) ? updateMeta["timestamp"] : void 0,
6525
+ isRecord2(update) ? update["timestamp"] : void 0,
6526
+ isRecord2(dataMeta) ? dataMeta["timestamp"] : void 0,
6527
+ event.data["timestamp"]
6528
+ ];
6529
+ for (const candidate of timestampCandidates) {
6530
+ const timestamp = parseTimestamp(candidate);
6531
+ if (timestamp !== void 0) return timestamp;
6532
+ }
6296
6533
  }
6297
6534
  return void 0;
6298
6535
  }
6299
6536
  __name(extractServerTimestamp, "extractServerTimestamp");
6537
+ function parseTimestamp(value) {
6538
+ if (typeof value === "number" && Number.isFinite(value)) return value;
6539
+ if (typeof value !== "string") return void 0;
6540
+ if (/^\d+$/.test(value)) {
6541
+ const numeric = Number(value);
6542
+ return Number.isFinite(numeric) ? numeric : void 0;
6543
+ }
6544
+ const parsed = Date.parse(value);
6545
+ return Number.isFinite(parsed) ? parsed : void 0;
6546
+ }
6547
+ __name(parseTimestamp, "parseTimestamp");
6300
6548
  function normalizeSessionUpdate(event, base, opts) {
6301
6549
  const update = getSessionUpdatePayload(event.data);
6302
6550
  if (!update) {
@@ -6489,7 +6737,8 @@ function normalizeToolUpdate(update, base) {
6489
6737
  const metadata = isRecord2(update["_meta"]) ? update["_meta"] : void 0;
6490
6738
  const toolName = getString2(update, "toolName") ?? getString2(update, "name") ?? (metadata ? getString2(metadata, "toolName") : void 0) ?? (metadata ? getString2(metadata, "name") : void 0);
6491
6739
  const toolKind = getString2(update, "kind");
6492
- const title = getString2(update, "title") ?? toolName ?? toolKind;
6740
+ const explicitTitle = getString2(update, "title");
6741
+ const title = explicitTitle ?? (getString2(update, "sessionUpdate") === "tool_call" ? toolName ?? toolKind : void 0);
6493
6742
  const rawInputSource = update["rawInput"] ?? update["input"] ?? update["args"];
6494
6743
  const rawOutputSource = update["rawOutput"] ?? update["output"] ?? update["result"];
6495
6744
  const rawInput = rawInputSource !== void 0 ? redactSensitiveFields(rawInputSource) : void 0;
@@ -7618,7 +7867,8 @@ function createDaemonTranscriptState(opts = {}) {
7618
7867
  resyncRequiredCount: 0,
7619
7868
  nextOrdinal: 1,
7620
7869
  now: opts.now ?? Date.now(),
7621
- maxBlocks: opts.maxBlocks ?? DEFAULT_MAX_BLOCKS
7870
+ maxBlocks: opts.maxBlocks ?? DEFAULT_MAX_BLOCKS,
7871
+ retainSubagentBlocks: opts.retainSubagentBlocks ?? true
7622
7872
  };
7623
7873
  if (opts.onTruncation) truncationCallbacks.set(state, opts.onTruncation);
7624
7874
  return state;
@@ -7737,6 +7987,7 @@ function applyDaemonTranscriptEvent(next, event) {
7737
7987
  break;
7738
7988
  }
7739
7989
  case "assistant.text.delta":
7990
+ if (event.parentToolCallId && !next.retainSubagentBlocks) break;
7740
7991
  appendTextDelta(
7741
7992
  next,
7742
7993
  "assistant",
@@ -7752,9 +8003,14 @@ function applyDaemonTranscriptEvent(next, event) {
7752
8003
  }
7753
8004
  break;
7754
8005
  case "assistant.usage":
7755
- applyAssistantUsage(next, event);
8006
+ if (event.parentToolCallId && !next.retainSubagentBlocks) {
8007
+ applySubagentUsageToParentTool(next, event);
8008
+ } else {
8009
+ applyAssistantUsage(next, event);
8010
+ }
7756
8011
  break;
7757
8012
  case "thought.text.delta":
8013
+ if (event.parentToolCallId && !next.retainSubagentBlocks) break;
7758
8014
  appendTextDelta(
7759
8015
  next,
7760
8016
  "thought",
@@ -7764,6 +8020,10 @@ function applyDaemonTranscriptEvent(next, event) {
7764
8020
  );
7765
8021
  break;
7766
8022
  case "tool.update":
8023
+ if (event.parentToolCallId && !next.retainSubagentBlocks) {
8024
+ discardToolBlock(next, event.toolCallId);
8025
+ break;
8026
+ }
7767
8027
  upsertToolBlock(next, event);
7768
8028
  break;
7769
8029
  case "shell.output":
@@ -7919,6 +8179,35 @@ function applyAssistantUsage(state, event) {
7919
8179
  block.updatedAt = state.now;
7920
8180
  }
7921
8181
  __name(applyAssistantUsage, "applyAssistantUsage");
8182
+ function applySubagentUsageToParentTool(state, event) {
8183
+ if (!event.parentToolCallId) return;
8184
+ const block = getWritableBlockById(
8185
+ state,
8186
+ state.toolBlockByCallId[event.parentToolCallId]
8187
+ );
8188
+ if (block?.kind !== "tool") return;
8189
+ const current = isRecord2(block.rawOutput) ? block.rawOutput : void 0;
8190
+ const currentSummary = isRecord2(current?.["executionSummary"]) ? current["executionSummary"] : void 0;
8191
+ const inputTokens = finiteNumber(currentSummary?.["inputTokens"]) + event.usage.inputTokens;
8192
+ const outputTokens = finiteNumber(currentSummary?.["outputTokens"]) + event.usage.outputTokens;
8193
+ const cachedTokens = finiteNumber(currentSummary?.["cachedTokens"]) + (event.usage.cachedTokens ?? 0);
8194
+ block.rawOutput = {
8195
+ ...current ?? { type: "task_execution", status: "running" },
8196
+ executionSummary: {
8197
+ ...currentSummary ?? {},
8198
+ inputTokens,
8199
+ outputTokens,
8200
+ cachedTokens,
8201
+ totalTokens: inputTokens + outputTokens
8202
+ }
8203
+ };
8204
+ block.updatedAt = state.now;
8205
+ }
8206
+ __name(applySubagentUsageToParentTool, "applySubagentUsageToParentTool");
8207
+ function finiteNumber(value) {
8208
+ return typeof value === "number" && Number.isFinite(value) ? value : 0;
8209
+ }
8210
+ __name(finiteNumber, "finiteNumber");
7922
8211
  function clearActiveThought(state, event) {
7923
8212
  finalizeStreamingTextBlock(state, state.activeThoughtBlockId, event);
7924
8213
  state.activeThoughtBlockId = void 0;
@@ -8021,6 +8310,11 @@ function finishAssistant(state, event) {
8021
8310
  }
8022
8311
  __name(finishAssistant, "finishAssistant");
8023
8312
  function upsertToolBlock(state, event) {
8313
+ const compactTaskOutput = !state.retainSubagentBlocks && isRecord2(event.rawOutput) && event.rawOutput["type"] === "task_execution";
8314
+ let rawOutput = compactTaskExecutionOutput(
8315
+ event.rawOutput,
8316
+ state.retainSubagentBlocks
8317
+ );
8024
8318
  const existingId = state.toolBlockByCallId[event.toolCallId];
8025
8319
  if (existingId === TRIMMED_TOOL_BLOCK_ID) {
8026
8320
  if (shouldRecreateTrimmedToolBlock(event)) {
@@ -8054,10 +8348,49 @@ function upsertToolBlock(state, event) {
8054
8348
  existing.updatedAt = state.now;
8055
8349
  if (event.eventId !== void 0) existing.eventId = event.eventId;
8056
8350
  if (event.details) existing.details = event.details;
8057
- if (event.content !== void 0) existing.content = event.content;
8351
+ if (compactTaskOutput) delete existing.content;
8352
+ else if (event.content !== void 0) existing.content = event.content;
8058
8353
  if (event.locations !== void 0) existing.locations = event.locations;
8059
8354
  if (event.rawInput !== void 0) existing.rawInput = event.rawInput;
8060
- if (event.rawOutput !== void 0) existing.rawOutput = event.rawOutput;
8355
+ if (rawOutput !== void 0) {
8356
+ if (compactTaskOutput && isRecord2(rawOutput) && isRecord2(existing.rawOutput)) {
8357
+ const prevSummary = isRecord2(existing.rawOutput["executionSummary"]) ? existing.rawOutput["executionSummary"] : void 0;
8358
+ const nextSummary = isRecord2(rawOutput["executionSummary"]) ? rawOutput["executionSummary"] : void 0;
8359
+ if (prevSummary && nextSummary) {
8360
+ const inputTokens = Math.max(
8361
+ finiteNumber(prevSummary["inputTokens"]),
8362
+ finiteNumber(nextSummary["inputTokens"])
8363
+ );
8364
+ const outputTokens = Math.max(
8365
+ finiteNumber(prevSummary["outputTokens"]),
8366
+ finiteNumber(nextSummary["outputTokens"])
8367
+ );
8368
+ rawOutput = {
8369
+ ...rawOutput,
8370
+ executionSummary: {
8371
+ ...nextSummary,
8372
+ inputTokens,
8373
+ outputTokens,
8374
+ cachedTokens: Math.max(
8375
+ finiteNumber(prevSummary["cachedTokens"]),
8376
+ finiteNumber(nextSummary["cachedTokens"])
8377
+ ),
8378
+ totalTokens: Math.max(
8379
+ finiteNumber(prevSummary["totalTokens"]),
8380
+ finiteNumber(nextSummary["totalTokens"]),
8381
+ inputTokens + outputTokens
8382
+ )
8383
+ }
8384
+ };
8385
+ } else if (prevSummary) {
8386
+ rawOutput = {
8387
+ ...rawOutput,
8388
+ executionSummary: { ...prevSummary }
8389
+ };
8390
+ }
8391
+ }
8392
+ existing.rawOutput = rawOutput;
8393
+ }
8061
8394
  existing.sourceRecordIds = unionStrings(
8062
8395
  existing.sourceRecordIds,
8063
8396
  event.sourceRecordIds
@@ -8098,10 +8431,10 @@ function upsertToolBlock(state, event) {
8098
8431
  ...event.serverTimestamp !== void 0 ? { serverTimestamp: event.serverTimestamp } : {},
8099
8432
  ...event.sourceRecordIds ? { sourceRecordIds: [...event.sourceRecordIds] } : {},
8100
8433
  ...event.details ? { details: event.details } : {},
8101
- ...event.content !== void 0 ? { content: event.content } : {},
8434
+ ...!compactTaskOutput && event.content !== void 0 ? { content: event.content } : {},
8102
8435
  ...event.locations !== void 0 ? { locations: event.locations } : {},
8103
8436
  ...event.rawInput !== void 0 ? { rawInput: event.rawInput } : {},
8104
- ...event.rawOutput !== void 0 ? { rawOutput: event.rawOutput } : {},
8437
+ ...rawOutput !== void 0 ? { rawOutput } : {},
8105
8438
  ...event.toolName ? { toolName: event.toolName } : {},
8106
8439
  ...event.toolKind ? { toolKind: event.toolKind } : {},
8107
8440
  ...event.parentToolCallId ? { parentToolCallId: event.parentToolCallId } : {},
@@ -8122,6 +8455,38 @@ function upsertToolBlock(state, event) {
8122
8455
  clearActiveText(state, event.parentToolCallId);
8123
8456
  }
8124
8457
  __name(upsertToolBlock, "upsertToolBlock");
8458
+ function discardToolBlock(state, toolCallId) {
8459
+ const blockId = state.toolBlockByCallId[toolCallId];
8460
+ if (!blockId || blockId === TRIMMED_TOOL_BLOCK_ID) return;
8461
+ takeBlocksOwnership(state);
8462
+ state.blocks = state.blocks.filter((block) => block.id !== blockId);
8463
+ state.blockIndexById = rebuildDaemonTranscriptBlockIndex(state.blocks);
8464
+ delete state.toolBlockByCallId[toolCallId];
8465
+ delete state.toolProgress[toolCallId];
8466
+ if (state.currentToolCallId === toolCallId) {
8467
+ state.currentToolCallId = void 0;
8468
+ }
8469
+ }
8470
+ __name(discardToolBlock, "discardToolBlock");
8471
+ function compactTaskExecutionOutput(rawOutput, retainSubagentBlocks) {
8472
+ if (retainSubagentBlocks || !isRecord2(rawOutput) || rawOutput["type"] !== "task_execution") {
8473
+ return rawOutput;
8474
+ }
8475
+ const compact = { type: "task_execution" };
8476
+ for (const key of [
8477
+ "subagentName",
8478
+ "subagentColor",
8479
+ "taskDescription",
8480
+ "status",
8481
+ "terminateReason",
8482
+ "tokenCount",
8483
+ "executionSummary"
8484
+ ]) {
8485
+ if (rawOutput[key] !== void 0) compact[key] = rawOutput[key];
8486
+ }
8487
+ return compact;
8488
+ }
8489
+ __name(compactTaskExecutionOutput, "compactTaskExecutionOutput");
8125
8490
  function updateCurrentToolPointer(state, toolCallId, status) {
8126
8491
  if (status === void 0) return;
8127
8492
  if (IN_FLIGHT_TOOL_STATUSES.has(status)) {
@@ -8351,6 +8716,7 @@ function cloneTranscriptState(state, opts) {
8351
8716
  ...state,
8352
8717
  now: opts.now ?? Date.now(),
8353
8718
  maxBlocks: opts.maxBlocks ?? state.maxBlocks,
8719
+ retainSubagentBlocks: opts.retainSubagentBlocks ?? state.retainSubagentBlocks,
8354
8720
  // Lazy copy-on-write for
8355
8721
  // `blocks` + `blockIndexById`. Eager `[...state.blocks]` defeated the
8356
8722
  // `sortedBlocksCache` / `childrenIndexCache` WeakMaps — every dispatch
@@ -8820,6 +9186,7 @@ function createDaemonTranscriptStore(seed = {}) {
8820
9186
  reset(nextSeed = {}) {
8821
9187
  state = createState({
8822
9188
  maxBlocks: nextSeed.maxBlocks ?? state.maxBlocks,
9189
+ retainSubagentBlocks: nextSeed.retainSubagentBlocks ?? state.retainSubagentBlocks,
8823
9190
  ...nextSeed
8824
9191
  });
8825
9192
  scheduleNotify();
@@ -8929,7 +9296,7 @@ function daemonUiEventToTerminalText(event) {
8929
9296
  case "tool.update":
8930
9297
  return terminalLine(
8931
9298
  `tool ${event.status}`,
8932
- `${event.title}${event.details ? ` ${event.details}` : ""}`,
9299
+ `${event.title ?? event.toolName ?? event.toolKind ?? "Tool"}${event.details ? ` ${event.details}` : ""}`,
8933
9300
  "38;5;75"
8934
9301
  );
8935
9302
  case "shell.output":