@qwen-code/qwen-code 0.21.13 → 0.21.14-nightly.20260822.7a4566cb3b

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 (400) hide show
  1. package/bundled/qc-helper/docs/configuration/settings.md +15 -7
  2. package/bundled/qc-helper/docs/extension/introduction.md +2 -0
  3. package/bundled/qc-helper/docs/features/_meta.ts +1 -0
  4. package/bundled/qc-helper/docs/features/channels/dingtalk.md +1 -1
  5. package/bundled/qc-helper/docs/features/code-review.md +25 -3
  6. package/bundled/qc-helper/docs/features/commands.md +120 -8
  7. package/bundled/qc-helper/docs/features/markdown-rendering.md +6 -0
  8. package/bundled/qc-helper/docs/features/sub-agents.md +3 -3
  9. package/bundled/qc-helper/docs/features/terminal-images.md +50 -0
  10. package/bundled/qc-helper/docs/qwen-serve-deploy-local.md +1 -1
  11. package/bundled/qc-helper/docs/qwen-serve.md +21 -4
  12. package/bundled/review/SKILL.md +113 -62
  13. package/chunks/MaxSizedBox-NCWYES5B.js +98 -0
  14. package/chunks/{StandaloneSessionPicker-KEGXNUG6.js → StandaloneSessionPicker-A4V4F64Y.js} +80 -79
  15. package/chunks/{acp-startup-profiler-NMDXYGDN.js → acp-startup-profiler-DDVSJKJK.js} +2 -2
  16. package/chunks/{acpAgent-XPES32S7.js → acpAgent-YYRH7HTQ.js} +1094 -278
  17. package/chunks/{agent-DPTOZFEM.js → agent-NEM254CJ.js} +52 -51
  18. package/chunks/agent-headless-AVFYIRPV.js +88 -0
  19. package/chunks/{anthropicContentGenerator-G7BVXTKN.js → anthropicContentGenerator-IWFTSBSV.js} +25 -25
  20. package/chunks/{artifact-tool-GEXTOPVO.js → artifact-tool-SBXMTVCB.js} +3 -3
  21. package/chunks/{askUserQuestion-B33XRSB7.js → askUserQuestion-KEQJRFD6.js} +3 -3
  22. package/chunks/{bridge-YNQBAA4Z.js → bridge-2CGOUO25.js} +59 -57
  23. package/chunks/{ca-4CQ6MYNQ.js → ca-SLZJD6QH.js} +8 -0
  24. package/chunks/{channel-management-service-GWY2GAIC.js → channel-management-service-FUJ2EFTF.js} +1 -1
  25. package/chunks/channel-settings-store-AZKNHHDC.js +103 -0
  26. package/chunks/{channel-worker-group-7LXCMZ77.js → channel-worker-group-CTE54QL6.js} +8 -7
  27. package/chunks/{channel-worker-manager-RYEME4ZZ.js → channel-worker-manager-4EHTD3T4.js} +8 -7
  28. package/chunks/{channel-worker-supervisor-OEVWBHGT.js → channel-worker-supervisor-F6I6WSWW.js} +6 -5
  29. package/chunks/{chunk-KD5BOPLP.js → chunk-2G4QF4VI.js} +125 -31
  30. package/chunks/{chunk-BHILXOC3.js → chunk-2MTIAN5Z.js} +3 -3
  31. package/chunks/{chunk-A4QRWUDE.js → chunk-2NWPB6T4.js} +6 -6
  32. package/chunks/{chunk-KV27IEHM.js → chunk-2TRNCJK4.js} +1 -1
  33. package/chunks/{chunk-EL5SXY3T.js → chunk-32CHFLGV.js} +198 -23
  34. package/chunks/{chunk-5CVO7YES.js → chunk-36OF5PRW.js} +1 -1
  35. package/chunks/{chunk-X26JYGTD.js → chunk-37BZSWEV.js} +1 -1
  36. package/chunks/{chunk-WFSTRPRO.js → chunk-3CLIDIVQ.js} +3 -3
  37. package/chunks/{chunk-A267JX7H.js → chunk-3HWN4E7N.js} +18 -18
  38. package/chunks/{chunk-ZYYTZUI2.js → chunk-3LYGXZ2H.js} +3 -3
  39. package/chunks/chunk-3SIGAHUX.js +3969 -0
  40. package/chunks/{chunk-BVJS5BSP.js → chunk-3XD4PT3B.js} +1 -1
  41. package/chunks/{chunk-6QFDQMQX.js → chunk-3ZFJUBTP.js} +1 -1
  42. package/chunks/{chunk-HUTNYWBG.js → chunk-45UD2TU4.js} +19 -11
  43. package/chunks/{chunk-4W5U2TUT.js → chunk-4F5WV4RF.js} +4 -4
  44. package/chunks/{chunk-I3G5JWBV.js → chunk-4GP3MNQ2.js} +2695 -1524
  45. package/chunks/{chunk-V26NVGAU.js → chunk-4MIDDJLJ.js} +8 -3
  46. package/chunks/{chunk-TS6625XH.js → chunk-5MK45KZ3.js} +9 -5
  47. package/chunks/{chunk-V57QC6WW.js → chunk-5OTMZVPL.js} +11 -9
  48. package/chunks/{chunk-MC4TLKEI.js → chunk-5PHLBWBL.js} +3 -3
  49. package/chunks/chunk-64LXOKG4.js +367 -0
  50. package/chunks/{chunk-6HY6IF3Z.js → chunk-6NFAEG54.js} +22 -2
  51. package/chunks/{chunk-TIGA2IVL.js → chunk-6NJIPX6W.js} +10 -298
  52. package/chunks/{chunk-MRMJCLIY.js → chunk-6RB2S4QP.js} +3 -3
  53. package/chunks/chunk-6S2OXVJT.js +369 -0
  54. package/chunks/{chunk-O4D7SPJN.js → chunk-6U46RZ25.js} +3 -3
  55. package/chunks/{chunk-JOOFMXGF.js → chunk-6UDHEIUT.js} +6 -6
  56. package/chunks/{chunk-VOQXFAY5.js → chunk-74TONY4F.js} +286 -0
  57. package/chunks/{chunk-LJQAUZMR.js → chunk-7CPJMZVJ.js} +1627 -180
  58. package/chunks/{chunk-T3CHYWJZ.js → chunk-7E7UCJHS.js} +100 -4
  59. package/chunks/{chunk-YZHRN3CF.js → chunk-7IV52LTO.js} +2 -2
  60. package/chunks/{chunk-4PKCUT7F.js → chunk-7JDGSJQH.js} +7 -7
  61. package/chunks/{chunk-GO7STP6N.js → chunk-7VITNOH6.js} +4 -4
  62. package/chunks/{chunk-CU6GJD55.js → chunk-7WLFSDLG.js} +1 -1
  63. package/chunks/{chunk-4WKAA4KS.js → chunk-A4N4FTMH.js} +1 -11
  64. package/chunks/{chunk-BUQDLC2G.js → chunk-A5F2YNO6.js} +3 -3
  65. package/chunks/{chunk-OY5RNSV4.js → chunk-AGCLK4G7.js} +3 -3
  66. package/chunks/{chunk-IA2K2HJE.js → chunk-AP3B7LKD.js} +2 -2
  67. package/chunks/{chunk-Y3YCSWG5.js → chunk-AZF6SME3.js} +2 -2
  68. package/chunks/{chunk-QFJ5JHQR.js → chunk-C72BXMJ5.js} +1 -1
  69. package/chunks/chunk-CETB5XY4.js +3654 -0
  70. package/chunks/{chunk-AA2BEKV3.js → chunk-CTAP6PO3.js} +3 -3
  71. package/chunks/{chunk-MS7GNABG.js → chunk-CXJHQVEK.js} +8 -0
  72. package/chunks/{chunk-QF2NHSPB.js → chunk-D534POS2.js} +274 -225
  73. package/chunks/{chunk-UKMR3CKV.js → chunk-D7QQ6RUB.js} +24 -9
  74. package/chunks/{chunk-DXIBNLBZ.js → chunk-DB2OKNTU.js} +2 -2
  75. package/chunks/{chunk-DGZEMW5R.js → chunk-DJEHYM4H.js} +3 -3
  76. package/chunks/{chunk-O565M6A4.js → chunk-DRVS6K7A.js} +260 -16
  77. package/chunks/{chunk-U3VNBPUO.js → chunk-DV4375RD.js} +5 -5
  78. package/chunks/{chunk-OXCMMLED.js → chunk-E63A23D7.js} +3 -3
  79. package/chunks/{chunk-4NFY2S7N.js → chunk-E7REAOTN.js} +15 -0
  80. package/chunks/{chunk-6ORZ2EDC.js → chunk-EW2IQ3ID.js} +3 -3
  81. package/chunks/{chunk-DGK6P3BQ.js → chunk-EXVK5R7X.js} +13 -13
  82. package/chunks/{chunk-NWNEANAT.js → chunk-FOGQO4FG.js} +953 -660
  83. package/chunks/{chunk-3U3VAL47.js → chunk-FV6PXZRO.js} +1 -1
  84. package/chunks/{chunk-76J3IJ3M.js → chunk-FX5TGHDE.js} +8 -8
  85. package/chunks/{chunk-QIH2HAEN.js → chunk-GXG4PYQB.js} +1 -1
  86. package/chunks/{chunk-FDGGZIYW.js → chunk-HDKCKCYO.js} +3 -3
  87. package/chunks/{chunk-RIAABG2K.js → chunk-HERHU33B.js} +2 -2
  88. package/chunks/{chunk-ZYBBISBY.js → chunk-HETN3NE2.js} +18 -15
  89. package/chunks/{chunk-XIT3GURH.js → chunk-HGBACZGD.js} +3 -3
  90. package/chunks/{chunk-UZPM4XHR.js → chunk-HGH7DXNI.js} +29 -8
  91. package/chunks/{chunk-CHHABXPE.js → chunk-HIK2OF33.js} +1 -1
  92. package/chunks/{chunk-FC4KQFCS.js → chunk-HMJ2P3SV.js} +1 -1
  93. package/chunks/chunk-HRVMTN37.js +26 -0
  94. package/chunks/{chunk-PQ36L4F5.js → chunk-HZZGYJIP.js} +1 -1
  95. package/chunks/{chunk-PT4I7NBA.js → chunk-I432KXWD.js} +1 -1
  96. package/chunks/{chunk-3EZLLVDF.js → chunk-IBJ5S45N.js} +3 -3
  97. package/chunks/{chunk-A4MFR4C5.js → chunk-IO257NUD.js} +3 -5
  98. package/chunks/{chunk-MIPFDQAF.js → chunk-ISJMN3ML.js} +1 -1
  99. package/chunks/chunk-IWOWEENB.js +9169 -0
  100. package/chunks/{chunk-XHRY7BXD.js → chunk-J6SIP2IT.js} +4 -4
  101. package/chunks/{chunk-OD2WU5QY.js → chunk-J7JQXYVL.js} +1 -1
  102. package/chunks/{chunk-NEFOOD54.js → chunk-J7VPB2HF.js} +4 -4
  103. package/chunks/{chunk-P7MPQI75.js → chunk-JGUBDRBC.js} +2 -2
  104. package/chunks/{chunk-SXCOEJO4.js → chunk-JOLJTKIG.js} +1 -1
  105. package/chunks/{chunk-NTTBXH7U.js → chunk-JS73NNWF.js} +8 -0
  106. package/chunks/{chunk-QRCNA3SR.js → chunk-JXLPQTMW.js} +50 -70
  107. package/chunks/{chunk-NNHNLJ2X.js → chunk-K2MSGB3W.js} +317 -72
  108. package/chunks/{chunk-KBXKR5R2.js → chunk-K52PZNU4.js} +1 -1
  109. package/chunks/{chunk-OOQUVWIG.js → chunk-K5OIW3I7.js} +4 -4
  110. package/chunks/{chunk-SOORFWKY.js → chunk-KSPRQSB4.js} +1 -1
  111. package/chunks/{chunk-WSH6GRKG.js → chunk-KVGR4MCF.js} +3 -3
  112. package/chunks/{chunk-6YKYPVDV.js → chunk-LC5M7YVE.js} +4 -4
  113. package/chunks/{chunk-M6NDLY2T.js → chunk-LD5VIJ7S.js} +1 -1
  114. package/chunks/{chunk-OMLJNPBE.js → chunk-LDGWX737.js} +84 -4
  115. package/chunks/{chunk-FAAUPSY2.js → chunk-LI4YHTQK.js} +1 -1
  116. package/chunks/{chunk-CXAOG665.js → chunk-LIKIJAUH.js} +2 -2
  117. package/chunks/chunk-LJZSMWOH.js +18 -0
  118. package/chunks/{chunk-BKPPWD33.js → chunk-M2IL2RTA.js} +22 -2
  119. package/chunks/{chunk-N5YPT6PH.js → chunk-MHOY756Q.js} +25 -13
  120. package/chunks/{chunk-YP5KH5Y7.js → chunk-ND7NOI4P.js} +1 -1
  121. package/chunks/{chunk-AW4TRXOC.js → chunk-NP2LV67M.js} +1 -1
  122. package/chunks/{chunk-GGDBMYGZ.js → chunk-NQB52P65.js} +5 -5
  123. package/chunks/{chunk-E3DYKPYZ.js → chunk-NUGZAFR2.js} +3 -3
  124. package/chunks/{chunk-GMIEIY3Y.js → chunk-O5BDEWBC.js} +3 -3
  125. package/chunks/{chunk-GDXET5XU.js → chunk-O5Z7EB6Y.js} +3 -3
  126. package/chunks/{chunk-5EYKMUUY.js → chunk-OTXXOZKW.js} +1 -1
  127. package/chunks/{chunk-M732YJPW.js → chunk-PALTIYXB.js} +6 -6
  128. package/chunks/{chunk-7UXUJ5T3.js → chunk-PLECQWDB.js} +1 -1
  129. package/chunks/{chunk-MLPXSYXR.js → chunk-PMIKPGDF.js} +66 -32
  130. package/chunks/{chunk-IWPYVAO2.js → chunk-PSQJ24ZZ.js} +3 -3
  131. package/chunks/{chunk-CPHEPGAO.js → chunk-PZRUV52H.js} +2 -2
  132. package/chunks/{chunk-PP4FUZNV.js → chunk-Q7RPLE33.js} +2 -2
  133. package/chunks/{chunk-S5DWMTHO.js → chunk-QQUVPMMZ.js} +2 -0
  134. package/chunks/{chunk-JUEPY766.js → chunk-RNGTMHKN.js} +3 -3
  135. package/chunks/{chunk-TUGSVUJB.js → chunk-ROV6B34L.js} +6 -6
  136. package/chunks/{chunk-RVOJ2FBP.js → chunk-RPJOOK6N.js} +1576 -10633
  137. package/chunks/{chunk-AXN7UPYQ.js → chunk-RQJJZQOH.js} +2 -2
  138. package/chunks/{chunk-AFSG32D5.js → chunk-RRRCWDFO.js} +1 -1
  139. package/chunks/{chunk-2M55OBEB.js → chunk-S3G6YFQC.js} +1 -1
  140. package/chunks/{chunk-4S5337WV.js → chunk-SVU5KGR7.js} +6527 -3314
  141. package/chunks/chunk-TBVSALA3.js +1109 -0
  142. package/chunks/{chunk-QUGAUQGJ.js → chunk-TBWQLLFO.js} +2 -0
  143. package/chunks/{chunk-AS5IN4GK.js → chunk-THK3QUU6.js} +5 -5
  144. package/chunks/{chunk-JNDY2MDR.js → chunk-TLDZKNZP.js} +1 -1
  145. package/chunks/{chunk-ZZO74WKW.js → chunk-TNAIZBPQ.js} +115 -28
  146. package/chunks/{chunk-3Z43GZUQ.js → chunk-TXASDT2M.js} +1 -1
  147. package/chunks/{chunk-CZBYX5MY.js → chunk-U53XZHAE.js} +1 -1
  148. package/chunks/{chunk-HIBNSEJE.js → chunk-UDG5EZJI.js} +0 -2
  149. package/chunks/{chunk-QNQAPSN2.js → chunk-URN2JIAQ.js} +4 -1
  150. package/chunks/{chunk-EZ5RP345.js → chunk-UYQTX2P6.js} +44 -13
  151. package/chunks/{chunk-BZ263IKX.js → chunk-UZPYR3EV.js} +1 -1
  152. package/chunks/{chunk-YZOSNW4R.js → chunk-VFACN2CE.js} +1 -1
  153. package/chunks/{chunk-RWDNJBWN.js → chunk-VLRBJ24J.js} +2 -2
  154. package/chunks/{chunk-NHDR76JX.js → chunk-VMJL7RH6.js} +4 -4
  155. package/chunks/{chunk-E23IPNGS.js → chunk-VOTDAZR7.js} +35 -6
  156. package/chunks/{chunk-XLLKYULU.js → chunk-VSNPOSDN.js} +2 -2
  157. package/chunks/{chunk-25EYDK42.js → chunk-VUMLT7E5.js} +2 -2
  158. package/chunks/{chunk-H4A72DE5.js → chunk-W4CRPSC5.js} +1 -1
  159. package/chunks/{chunk-NM5V5OVW.js → chunk-WJJYJVQE.js} +3 -3
  160. package/chunks/{chunk-ROIYNTHJ.js → chunk-WRT324N6.js} +3 -3
  161. package/chunks/chunk-WZAD4ZNJ.js +59 -0
  162. package/chunks/{chunk-SG7ZP5PG.js → chunk-WZDM44SB.js} +4 -4
  163. package/chunks/{chunk-JE7KQ2UP.js → chunk-XIQ5HQ2F.js} +469 -77
  164. package/chunks/{chunk-QV5YN5YD.js → chunk-XJOHLP2A.js} +5 -5
  165. package/chunks/{chunk-XUJNK7Y6.js → chunk-XL5K4SVK.js} +1 -1
  166. package/chunks/{chunk-CKSJECTU.js → chunk-XZJKSETB.js} +9 -5
  167. package/chunks/{chunk-YEYY7TEP.js → chunk-Y2FEAXLP.js} +7 -7
  168. package/chunks/{chunk-2B2BF7P7.js → chunk-YDJRMQU4.js} +3 -3
  169. package/chunks/{chunk-46UV252V.js → chunk-YHC2EYYG.js} +35 -38
  170. package/chunks/{chunk-OVZPVYZB.js → chunk-YMVFIYHV.js} +96 -18
  171. package/chunks/{chunk-WGHHA7ZH.js → chunk-Z3JMO2CH.js} +1 -1
  172. package/chunks/{chunk-MA2HEDVP.js → chunk-ZRYQMWEP.js} +3 -3
  173. package/chunks/{chunk-IGGGG5CX.js → chunk-ZTAT23TL.js} +15948 -10201
  174. package/chunks/{computer-use-77C5FHMW.js → computer-use-H2T7IFYX.js} +55 -54
  175. package/chunks/{config-utils-IVHRSXWI.js → config-utils-3DY73VIJ.js} +2 -2
  176. package/chunks/contextCommand-5AAZFFFV.js +94 -0
  177. package/chunks/{core-runtime-7VMIKUTG.js → core-runtime-JWFNKO2S.js} +57 -55
  178. package/chunks/{create-sub-session-2L5MQRN4.js → create-sub-session-33HIYIJE.js} +58 -56
  179. package/chunks/{create-sub-session-KRQULJE6.js → create-sub-session-XBCVGNFU.js} +6 -4
  180. package/chunks/{cron-create-H7UEPDSN.js → cron-create-IKA56DAF.js} +5 -5
  181. package/chunks/{cron-delete-6SZK7YFM.js → cron-delete-K5Q62EGH.js} +5 -5
  182. package/chunks/{cron-list-H25JIHEZ.js → cron-list-QBFGAMP7.js} +5 -5
  183. package/chunks/{daemon-2KTG7ZBN.js → daemon-NNCQ3HWT.js} +806 -147
  184. package/chunks/{daemon-git-worktree-guard-DXYIMWFT.js → daemon-git-worktree-guard-6233JAPJ.js} +54 -53
  185. package/chunks/daemon-status-provider-3EI2KALQ.js +104 -0
  186. package/chunks/daemon-trust-policy-QWWU7CON.js +100 -0
  187. package/chunks/{daemon-trust-policy-monitor-RYYGCQ3J.js → daemon-trust-policy-monitor-FH7GBAKN.js} +60 -59
  188. package/chunks/{de-UBEBKG6V.js → de-AH4LGCF5.js} +8 -0
  189. package/chunks/{deferred-core-runtime-3SGXFXEQ.js → deferred-core-runtime-EDUZQRME.js} +52 -51
  190. package/chunks/{discovery-ORA5J7YP.js → discovery-X2NV535U.js} +1 -1
  191. package/chunks/{display-image-ON3EYFRD.js → display-image-OEJMJV3S.js} +5 -5
  192. package/chunks/{dist-YEPL4RAW.js → dist-5EV2G6MC.js} +2 -3
  193. package/chunks/{dist-MAQXAQ2Y.js → dist-EQ3Q5XHX.js} +45337 -32756
  194. package/chunks/{dist-WJ4BHIEW.js → dist-ESS34DHC.js} +72 -0
  195. package/chunks/{dist-JWMKPWT5.js → dist-EUOUPUFO.js} +3 -4
  196. package/chunks/{dist-IYYN3RUT.js → dist-UOFRXJT6.js} +2798 -1250
  197. package/chunks/{earlyInputCapture-KJMLFVQV.js → earlyInputCapture-VSP42LUR.js} +53 -52
  198. package/chunks/{edit-I4LQFAEC.js → edit-ZTLO5ASX.js} +60 -58
  199. package/chunks/{en-X6YV7GME.js → en-MD3GP5YL.js} +8 -0
  200. package/chunks/{enter-worktree-YNPOJSRH.js → enter-worktree-TMTPDS2S.js} +55 -54
  201. package/chunks/{enterPlanMode-XCPK62ER.js → enterPlanMode-UBAXFMYI.js} +55 -54
  202. package/chunks/{environment-S7CTIHMX.js → environment-C2CZN7CB.js} +55 -54
  203. package/chunks/{errors-7HB2AIDS.js → errors-ZUNFQINF.js} +54 -53
  204. package/chunks/{exit-worktree-AIIY7SR6.js → exit-worktree-572NWEPJ.js} +55 -54
  205. package/chunks/exitPlanMode-QTIXFGZT.js +86 -0
  206. package/chunks/{fast-path-NDJV3ZFJ.js → fast-path-CEEVHQL3.js} +3 -3
  207. package/chunks/{fast-path-settings-LNOFM2YP.js → fast-path-settings-WHX3J3ZI.js} +2 -2
  208. package/chunks/{fr-VENTC2BS.js → fr-ZEML2JWS.js} +8 -0
  209. package/chunks/{gemini-RSUFP5OE.js → gemini-I2YR6GMS.js} +114 -112
  210. package/chunks/{geminiContentGenerator-SQ5XBPZ7.js → geminiContentGenerator-GQWNDZQF.js} +7 -7
  211. package/chunks/getMachineId-bsd-FBOAYNSY.js +48 -0
  212. package/chunks/{getMachineId-bsd-FG7IUY6U.js → getMachineId-bsd-YH7RURBZ.js} +4 -4
  213. package/chunks/{getMachineId-darwin-GLCJI2RA.js → getMachineId-darwin-H6USQYNI.js} +4 -4
  214. package/chunks/getMachineId-darwin-RNJLJUXY.js +47 -0
  215. package/chunks/{getMachineId-linux-O6OPPAKO.js → getMachineId-linux-HF2N63ET.js} +3 -3
  216. package/chunks/getMachineId-linux-UEVRAIAB.js +41 -0
  217. package/chunks/getMachineId-unsupported-FWXYJ7HW.js +31 -0
  218. package/chunks/{getMachineId-unsupported-S6CKYVGC.js → getMachineId-unsupported-NYA5DXRB.js} +3 -3
  219. package/chunks/getMachineId-win-LRVGMHLW.js +50 -0
  220. package/chunks/{getMachineId-win-X5SRNEH7.js → getMachineId-win-SMEGY2DW.js} +4 -4
  221. package/chunks/{glob-J4RUJAHX.js → glob-XFBL2RVT.js} +58 -57
  222. package/chunks/{goal-tools-VHTNVOKK.js → goal-tools-TLJCE7YZ.js} +6 -6
  223. package/chunks/{grep-VJWPLFOT.js → grep-U675LEXE.js} +55 -54
  224. package/chunks/handleAutoUpdate-R6RUCIA2.js +97 -0
  225. package/chunks/{i18n-RM5YOICI.js → i18n-SJCZDZ4C.js} +53 -52
  226. package/chunks/{image-gen-EXECB5XM.js → image-gen-6VY7CA7C.js} +14 -14
  227. package/chunks/initializer-CRDZXJOG.js +101 -0
  228. package/chunks/installationInfo-EW3NEJDZ.js +95 -0
  229. package/chunks/{ja-QHT4EQTO.js → ja-UM5B2HMD.js} +8 -0
  230. package/chunks/{keychain-token-storage-3XFJ5ZB2.js → keychain-token-storage-MTFTAESK.js} +3 -3
  231. package/chunks/list-TZEMTXDH.js +104 -0
  232. package/chunks/{list-agents-OSVDFI6S.js → list-agents-43XUEXJV.js} +6 -6
  233. package/chunks/loadedSettingsAdapter-47DG424L.js +98 -0
  234. package/chunks/{loggingContentGenerator-WF4ZOJEZ.js → loggingContentGenerator-77C6O5VW.js} +31 -29
  235. package/chunks/{loop-wakeup-WQS6JYAG.js → loop-wakeup-E54KDUXC.js} +6 -6
  236. package/chunks/{ls-D3HUFHDP.js → ls-CGL2UC3H.js} +7 -7
  237. package/chunks/{lsp-3QDDJTCS.js → lsp-5IKUO5DX.js} +3 -3
  238. package/chunks/{managed-npm-update-E7IW6N7V.js → managed-npm-update-AJ5GZRUA.js} +53 -52
  239. package/chunks/mcp-AQK656Y4.js +98 -0
  240. package/chunks/{monitor-EE2UYMGE.js → monitor-UDZXKYT3.js} +55 -54
  241. package/chunks/nonInteractiveCli-6NC3NLZM.js +166 -0
  242. package/chunks/{notebook-edit-NTDY4QDU.js → notebook-edit-G6WZI2YT.js} +59 -57
  243. package/chunks/{openaiContentGenerator-YNFVJMRJ.js → openaiContentGenerator-IHVHP3VB.js} +32 -32
  244. package/chunks/{pidfile-4XSFLYBZ.js → pidfile-EBKS2HBK.js} +53 -52
  245. package/chunks/{processUtils-WDA2MJFD.js → processUtils-B7M35ZLR.js} +2 -2
  246. package/chunks/prompt-terminal-ledger-5JYOPOII.js +93 -0
  247. package/chunks/{pt-VL3I5RNY.js → pt-5BMJ3XYH.js} +8 -0
  248. package/chunks/{qwenContentGenerator-434M7QKY.js → qwenContentGenerator-WCJPPTED.js} +59 -58
  249. package/chunks/{qwenOAuth2-GMYZOO6A.js → qwenOAuth2-S2CLBSEZ.js} +10 -10
  250. package/chunks/read-file-WFM53FTW.js +33 -0
  251. package/chunks/{read-mcp-resource-XD54ZQMC.js → read-mcp-resource-XYES2B42.js} +3 -3
  252. package/chunks/{record-artifact-SEYFJEJF.js → record-artifact-W3IBTGL7.js} +10 -6
  253. package/chunks/{resumeHistoryUtils-EVG3WYK2.js → resumeHistoryUtils-CK4ZC6YO.js} +59 -58
  254. package/chunks/ripGrep-B3PBLEQ3.js +86 -0
  255. package/chunks/{ru-4RCKL4PY.js → ru-6GL66ORV.js} +8 -0
  256. package/chunks/{run-qwen-serve-3QSGRXAN.js → run-qwen-serve-DC5RXI6N.js} +537 -185
  257. package/chunks/{runtime-5MLLZ7DC.js → runtime-UVEETF54.js} +63 -62
  258. package/chunks/{scheduler-RPBJ63CH.js → scheduler-MWT3UMVN.js} +54 -53
  259. package/chunks/{sdk-exporters-grpc-54L4LS5L.js → sdk-exporters-grpc-6J5CKOMO.js} +194 -75
  260. package/chunks/{sdk-exporters-http-XUVP63H6.js → sdk-exporters-http-Q3YZ4752.js} +40 -45
  261. package/chunks/{sdk-impl-YXUEN2Z2.js → sdk-impl-BOMCAN2Z.js} +7211 -5454
  262. package/chunks/{send-message-VZENRWRH.js → send-message-J4VT46OI.js} +8 -8
  263. package/chunks/{serve-HS3XLPXU.js → serve-AKM75GTE.js} +60 -61
  264. package/chunks/{server-TC4A7AAZ.js → server-KU7XIDVT.js} +2221 -399
  265. package/chunks/{session-UBOFXVMN.js → session-DKVYIRWN.js} +108 -105
  266. package/chunks/{settings-D5644OM5.js → settings-NS3PXZDP.js} +63 -62
  267. package/chunks/{shell-3PZULQQV.js → shell-UXCNM2OK.js} +52 -51
  268. package/chunks/{skill-PEVVXQ3L.js → skill-KV7YCCTM.js} +30 -28
  269. package/chunks/{skill-settings-J65JKKES.js → skill-settings-EXW7ESWJ.js} +59 -58
  270. package/chunks/{spawnChannel-IYGXRHSQ.js → spawnChannel-FCP44P4V.js} +55 -54
  271. package/chunks/{standalone-update-IFM53PE7.js → standalone-update-RGW3B2DX.js} +55 -54
  272. package/chunks/{startInteractiveUI-3AVH7L6H.js → startInteractiveUI-UZMF2BIJ.js} +615 -392
  273. package/chunks/{syntheticOutput-7GWFIDXT.js → syntheticOutput-JAXMIMZP.js} +4 -4
  274. package/chunks/{task-create-FCBDX7UH.js → task-create-I2H322E4.js} +12 -12
  275. package/chunks/{task-list-YIYIUFUA.js → task-list-3OLIWFTQ.js} +21 -7
  276. package/chunks/{task-stop-X37KYTKB.js → task-stop-JAUY6MSY.js} +3 -3
  277. package/chunks/{task-update-MYPFVOVM.js → task-update-B3XO4CPI.js} +87 -16
  278. package/chunks/{team-create-ZAIA7KAV.js → team-create-77XY3KAE.js} +56 -56
  279. package/chunks/{team-delete-6UMU4XLS.js → team-delete-Q7GE7RRI.js} +6 -6
  280. package/chunks/{team-plan-approval-UNIUS7OD.js → team-plan-approval-TAQANDQG.js} +55 -54
  281. package/chunks/{terminal-image-renderer-G343P2RV.js → terminal-image-renderer-V4LIF5NS.js} +54 -53
  282. package/chunks/theme-manager-KKBAJ574.js +90 -0
  283. package/chunks/{todoWrite-U2R4NVF4.js → todoWrite-FJJTY2TI.js} +7 -7
  284. package/chunks/{tool-search-5R2OE4C7.js → tool-search-GZJYRK4I.js} +25 -24
  285. package/chunks/{total-session-admission-4KBHMQQ2.js → total-session-admission-NIBNWXHE.js} +59 -57
  286. package/chunks/{trustedFolders-LK6T4XC7.js → trustedFolders-7GEI2NYC.js} +53 -52
  287. package/chunks/{undici-PYHBDDPN.js → undici-S7WJSKGJ.js} +962 -391
  288. package/chunks/{update-relaunch-UBKROIC6.js → update-relaunch-OA3OEBMD.js} +5 -5
  289. package/chunks/{updateCheck-W4Y2GFSD.js → updateCheck-QVHQEVIY.js} +56 -55
  290. package/chunks/{useAutoAcceptIndicator-C7BEICBF.js → useAutoAcceptIndicator-WZ27J7NY.js} +64 -63
  291. package/chunks/{validateNonInterActiveAuth-LTEI2TB6.js → validateNonInterActiveAuth-OXJA2JWG.js} +99 -96
  292. package/chunks/{version-G5A5DGVS.js → version-KJO64WD7.js} +1 -1
  293. package/chunks/{web-fetch-RTEQTR5Z.js → web-fetch-CC5INI2R.js} +25 -23
  294. package/chunks/{web-search-5OXHEZPV.js → web-search-MOAUAN6N.js} +18 -18
  295. package/chunks/{web-shell-static-O73YPVVC.js → web-shell-static-3NUTRHAH.js} +4 -5
  296. package/chunks/{workflow-ISQJHPG2.js → workflow-BN2ZEJMK.js} +366 -105
  297. package/chunks/workspace-providers-status-R5QTZFK3.js +101 -0
  298. package/chunks/{workspace-registration-store-CYNY6IP6.js → workspace-registration-store-WMSLM36M.js} +1 -1
  299. package/chunks/{workspace-registry-34GTUUHB.js → workspace-registry-J3RUCXH6.js} +59 -57
  300. package/chunks/{workspace-service-XCDQLE2Y.js → workspace-service-JJZFPKM4.js} +66 -65
  301. package/chunks/workspace-skills-status-DRIOZRIA.js +101 -0
  302. package/chunks/{workspace-trust-reconciler-AYGXC7A3.js → workspace-trust-reconciler-YAYSN6CX.js} +69 -67
  303. package/chunks/write-file-7HXHFFOY.js +88 -0
  304. package/chunks/{zh-TW-SQ4HTSCW.js → zh-TW-LVLBK4KF.js} +8 -0
  305. package/chunks/{zh-LMSTK4WD.js → zh-UBMWS2BJ.js} +8 -0
  306. package/chunks/{zoom-image-4BFYJ3HG.js → zoom-image-EFMQMU4G.js} +24 -22
  307. package/cli.js +15 -15
  308. package/locales/ca.js +13 -0
  309. package/locales/de.js +12 -0
  310. package/locales/en.js +11 -0
  311. package/locales/fr.js +13 -0
  312. package/locales/ja.js +13 -0
  313. package/locales/pt.js +12 -0
  314. package/locales/ru.js +12 -0
  315. package/locales/zh-TW.js +11 -0
  316. package/locales/zh.js +11 -0
  317. package/package.json +3 -3
  318. package/web-shell/assets/{arc-CgOpDKvm.js → arc-BCP1f-bN.js} +1 -1
  319. package/web-shell/assets/{architectureDiagram-3BPJPVTR-0Ag_m34F.js → architectureDiagram-3BPJPVTR-D-6ajMay.js} +1 -1
  320. package/web-shell/assets/{blockDiagram-GPEHLZMM-IwTwFau0.js → blockDiagram-GPEHLZMM-CcLlnVnf.js} +1 -1
  321. package/web-shell/assets/{c4Diagram-AAUBKEIU-DLa5GUv8.js → c4Diagram-AAUBKEIU-C_Sp9UwQ.js} +1 -1
  322. package/web-shell/assets/channel-BcImYzbA.js +1 -0
  323. package/web-shell/assets/{chunk-2J33WTMH-DcYP-WFG.js → chunk-2J33WTMH-CG0ngvo9.js} +1 -1
  324. package/web-shell/assets/{chunk-4BX2VUAB-C8MVPMiQ.js → chunk-4BX2VUAB-D43LsVdk.js} +1 -1
  325. package/web-shell/assets/{chunk-55IACEB6-BUi4Yfv3.js → chunk-55IACEB6-BqNIn5rz.js} +1 -1
  326. package/web-shell/assets/{chunk-727SXJPM-Cy3Su2YY.js → chunk-727SXJPM-BSHmO08Y.js} +1 -1
  327. package/web-shell/assets/{chunk-AQP2D5EJ-Dp8Teqv6.js → chunk-AQP2D5EJ-CMUbr5tQ.js} +1 -1
  328. package/web-shell/assets/{chunk-FMBD7UC4-BDTDM-4j.js → chunk-FMBD7UC4-Cm6JflnZ.js} +1 -1
  329. package/web-shell/assets/{chunk-ND2GUHAM-7HfDt0r2.js → chunk-ND2GUHAM-CBR39YQZ.js} +1 -1
  330. package/web-shell/assets/{chunk-QZHKN3VN-BIBU0uCF.js → chunk-QZHKN3VN-CWnqaLb-.js} +1 -1
  331. package/web-shell/assets/classDiagram-4FO5ZUOK-OWx0rDRW.js +1 -0
  332. package/web-shell/assets/classDiagram-v2-Q7XG4LA2-OWx0rDRW.js +1 -0
  333. package/web-shell/assets/{cose-bilkent-S5V4N54A-DRLdcg9p.js → cose-bilkent-S5V4N54A-DJlTdnfD.js} +1 -1
  334. package/web-shell/assets/{dagre-BM42HDAG-DCCgDwqW.js → dagre-BM42HDAG-1AFN1uVc.js} +1 -1
  335. package/web-shell/assets/{diagram-2AECGRRQ-CsBTBmk3.js → diagram-2AECGRRQ-gC0GGNSW.js} +1 -1
  336. package/web-shell/assets/{diagram-5GNKFQAL-C9qjH8Lt.js → diagram-5GNKFQAL-CPmRPT1s.js} +1 -1
  337. package/web-shell/assets/{diagram-KO2AKTUF-Brjs_lj2.js → diagram-KO2AKTUF-atigp6Hr.js} +1 -1
  338. package/web-shell/assets/{diagram-LMA3HP47-DtiWCl_F.js → diagram-LMA3HP47-BJnJFSRQ.js} +1 -1
  339. package/web-shell/assets/{diagram-OG6HWLK6-DmfKLkBT.js → diagram-OG6HWLK6-CyvJ4fG2.js} +1 -1
  340. package/web-shell/assets/{erDiagram-TEJ5UH35-Bve_4deH.js → erDiagram-TEJ5UH35-CZac_jT6.js} +1 -1
  341. package/web-shell/assets/{flowDiagram-I6XJVG4X-C2_kXCcV.js → flowDiagram-I6XJVG4X-pd-LQxWB.js} +1 -1
  342. package/web-shell/assets/{ganttDiagram-6RSMTGT7-BSBIjiTF.js → ganttDiagram-6RSMTGT7-CvB1at7l.js} +1 -1
  343. package/web-shell/assets/{gitGraphDiagram-PVQCEYII-CyebwI55.js → gitGraphDiagram-PVQCEYII-B5Y6nkil.js} +1 -1
  344. package/web-shell/assets/index-Bg3DAn8Z.js +1788 -0
  345. package/web-shell/assets/{index-d0yfnV1M.js → index-Bj3ZSUHL.js} +1 -1
  346. package/web-shell/assets/index-mp32EO88.css +5 -0
  347. package/web-shell/assets/{infoDiagram-5YYISTIA-CSDGnWxU.js → infoDiagram-5YYISTIA-BdyWvU4P.js} +1 -1
  348. package/web-shell/assets/{ishikawaDiagram-YF4QCWOH-BK4jU13p.js → ishikawaDiagram-YF4QCWOH-CaHbUdvN.js} +1 -1
  349. package/web-shell/assets/{journeyDiagram-JHISSGLW-D_W6j-oF.js → journeyDiagram-JHISSGLW-DR9F3FpG.js} +1 -1
  350. package/web-shell/assets/{kanban-definition-UN3LZRKU-C7xf-SdC.js → kanban-definition-UN3LZRKU-BoEUbkw2.js} +1 -1
  351. package/web-shell/assets/{linear-DQmzxpxd.js → linear-DUbfzV4T.js} +1 -1
  352. package/web-shell/assets/{mermaid.core-9P7AGOLG.js → mermaid.core-CLLkPcpD.js} +5 -5
  353. package/web-shell/assets/{mindmap-definition-RKZ34NQL-DgcgMyPk.js → mindmap-definition-RKZ34NQL-FuKI3Stt.js} +1 -1
  354. package/web-shell/assets/{pieDiagram-4H26LBE5-3wWGb9eG.js → pieDiagram-4H26LBE5-CVAHL7l5.js} +1 -1
  355. package/web-shell/assets/{quadrantDiagram-W4KKPZXB-BeCXnQw9.js → quadrantDiagram-W4KKPZXB-BkGi5fRj.js} +1 -1
  356. package/web-shell/assets/{requirementDiagram-4Y6WPE33-Bi1UOHDz.js → requirementDiagram-4Y6WPE33-B5ghV8-K.js} +1 -1
  357. package/web-shell/assets/{sankeyDiagram-5OEKKPKP-lrLUjjbb.js → sankeyDiagram-5OEKKPKP-CKFbVhkQ.js} +1 -1
  358. package/web-shell/assets/{sequenceDiagram-3UESZ5HK-BFuqKz6Q.js → sequenceDiagram-3UESZ5HK-C5P9ujPd.js} +1 -1
  359. package/web-shell/assets/{stateDiagram-AJRCARHV-8DemQLhu.js → stateDiagram-AJRCARHV-CsDn-Rez.js} +1 -1
  360. package/web-shell/assets/stateDiagram-v2-BHNVJYJU-DpGKD1ez.js +1 -0
  361. package/web-shell/assets/{timeline-definition-PNZ67QCA-uzEuVQXg.js → timeline-definition-PNZ67QCA-B6oLBkTr.js} +1 -1
  362. package/web-shell/assets/{vennDiagram-CIIHVFJN-BQTeZ_-o.js → vennDiagram-CIIHVFJN-DvtBkYwp.js} +1 -1
  363. package/web-shell/assets/{wardley-L42UT6IY-B6yM5Im7.js → wardley-L42UT6IY-D2UwTX16.js} +1 -1
  364. package/web-shell/assets/{wardleyDiagram-YWT4CUSO-ChM8bmgn.js → wardleyDiagram-YWT4CUSO-FnnfCxYI.js} +1 -1
  365. package/web-shell/assets/{xychartDiagram-2RQKCTM6-oNG6HyB1.js → xychartDiagram-2RQKCTM6-C1SaMQ7d.js} +1 -1
  366. package/web-shell/index.html +2 -2
  367. package/chunks/MaxSizedBox-UQALOVVT.js +0 -97
  368. package/chunks/agent-headless-GJCQMURW.js +0 -87
  369. package/chunks/channel-settings-store-WNWYFHG7.js +0 -102
  370. package/chunks/chunk-AZQ3DT76.js +0 -10017
  371. package/chunks/chunk-CR3C7WXL.js +0 -113
  372. package/chunks/chunk-K5IDV3PC.js +0 -519
  373. package/chunks/chunk-MPHPFVKK.js +0 -48
  374. package/chunks/chunk-RLKC46YT.js +0 -3582
  375. package/chunks/chunk-UPDOZBWO.js +0 -358
  376. package/chunks/contextCommand-PJ77GBWL.js +0 -93
  377. package/chunks/daemon-status-provider-ZDOYJCU6.js +0 -102
  378. package/chunks/daemon-trust-policy-E67OYUK2.js +0 -99
  379. package/chunks/exitPlanMode-R4JY7V2O.js +0 -85
  380. package/chunks/handleAutoUpdate-POCX2MNB.js +0 -94
  381. package/chunks/initializer-Z2AFGBNR.js +0 -100
  382. package/chunks/installationInfo-4I5FXNMH.js +0 -92
  383. package/chunks/list-ZMBFIGZA.js +0 -103
  384. package/chunks/loadedSettingsAdapter-T6TV4YJ7.js +0 -97
  385. package/chunks/mcp-6UNYX4HG.js +0 -97
  386. package/chunks/nonInteractiveCli-WAY237O4.js +0 -163
  387. package/chunks/read-file-TAFBKMNI.js +0 -32
  388. package/chunks/ripGrep-WOEK2PXS.js +0 -85
  389. package/chunks/theme-manager-Z3RIT7DB.js +0 -89
  390. package/chunks/undici-3FJYTMOF.js +0 -25914
  391. package/chunks/workspace-providers-status-2ZPZPUPZ.js +0 -100
  392. package/chunks/workspace-skills-status-RS4O7AIJ.js +0 -100
  393. package/chunks/write-file-EWXKVVXF.js +0 -87
  394. package/web-shell/assets/channel-BrGVBa2L.js +0 -1
  395. package/web-shell/assets/classDiagram-4FO5ZUOK-B5TUzJzI.js +0 -1
  396. package/web-shell/assets/classDiagram-v2-Q7XG4LA2-B5TUzJzI.js +0 -1
  397. package/web-shell/assets/index-CIDsgxTe.js +0 -1792
  398. package/web-shell/assets/index-DiQnWi_E.css +0 -5
  399. package/web-shell/assets/stateDiagram-v2-BHNVJYJU-DhM5ixYd.js +0 -1
  400. package/chunks/{dist-BROOP2EG.js → dist-LZO24N3E.js} +1 -1
@@ -9,111 +9,113 @@ import {
9
9
  generateAgentWorktreeSlug,
10
10
  isTerminalWorkflowStatus,
11
11
  rebuildToolRegistryOnOverride,
12
+ resolveExternalWorktreeDir,
12
13
  resolveSavedWorkflowScript,
13
14
  toModelVisibleSubagentResult,
14
15
  writeWorkflowSnapshot,
15
16
  writeWorktreeSessionMarker
16
- } from "./chunk-4S5337WV.js";
17
+ } from "./chunk-SVU5KGR7.js";
17
18
  import "./chunk-GOFAQQZA.js";
18
- import "./chunk-5M6IDOMF.js";
19
19
  import "./chunk-TWPJO254.js";
20
20
  import "./chunk-CQ35AJ4Z.js";
21
- import "./chunk-DGZEMW5R.js";
22
- import "./chunk-WSH6GRKG.js";
23
- import "./chunk-CKSJECTU.js";
24
- import "./chunk-OVZPVYZB.js";
21
+ import "./chunk-5M6IDOMF.js";
22
+ import "./chunk-KVGR4MCF.js";
23
+ import "./chunk-XZJKSETB.js";
24
+ import "./chunk-YMVFIYHV.js";
25
25
  import {
26
26
  parsePositiveIntegerEnv
27
27
  } from "./chunk-6PVPNMXU.js";
28
- import "./chunk-5EYKMUUY.js";
28
+ import "./chunk-OTXXOZKW.js";
29
+ import "./chunk-DJEHYM4H.js";
29
30
  import "./chunk-IRH27ZC2.js";
30
31
  import "./chunk-QHWCP53L.js";
31
- import "./chunk-Y3YCSWG5.js";
32
- import "./chunk-UPDOZBWO.js";
32
+ import "./chunk-AZF6SME3.js";
33
+ import "./chunk-TBVSALA3.js";
33
34
  import "./chunk-O6GEWCJA.js";
34
35
  import "./chunk-T26EAKDL.js";
35
- import "./chunk-ZPJWUGCS.js";
36
36
  import "./chunk-CPBF7KYF.js";
37
+ import "./chunk-VUMLT7E5.js";
38
+ import "./chunk-ISJMN3ML.js";
39
+ import "./chunk-2TRNCJK4.js";
40
+ import "./chunk-NUGZAFR2.js";
41
+ import "./chunk-LDGWX737.js";
37
42
  import {
38
43
  SUBAGENT_PLAN_LIFECYCLE_TOOLS
39
- } from "./chunk-RWDNJBWN.js";
40
- import "./chunk-25EYDK42.js";
41
- import "./chunk-MIPFDQAF.js";
44
+ } from "./chunk-VLRBJ24J.js";
45
+ import "./chunk-ZPJWUGCS.js";
42
46
  import "./chunk-MLXTMF7H.js";
43
- import "./chunk-KV27IEHM.js";
44
- import "./chunk-E3DYKPYZ.js";
45
- import "./chunk-OMLJNPBE.js";
46
- import "./chunk-OXCMMLED.js";
47
- import "./chunk-TIGA2IVL.js";
47
+ import "./chunk-O5BDEWBC.js";
48
+ import "./chunk-NAVJD2PQ.js";
49
+ import "./chunk-WRT324N6.js";
50
+ import "./chunk-YDJRMQU4.js";
51
+ import "./chunk-KM73TBQ4.js";
52
+ import "./chunk-E63A23D7.js";
53
+ import "./chunk-6NJIPX6W.js";
54
+ import "./chunk-P3QQPMQA.js";
55
+ import "./chunk-6S2OXVJT.js";
48
56
  import "./chunk-SAH4BD2J.js";
49
- import "./chunk-XLLKYULU.js";
57
+ import "./chunk-VSNPOSDN.js";
50
58
  import {
51
59
  runWithAgentContext
52
- } from "./chunk-PT4I7NBA.js";
60
+ } from "./chunk-I432KXWD.js";
53
61
  import "./chunk-S6LOFUVP.js";
54
- import "./chunk-2J3OJGTL.js";
55
- import "./chunk-SG7ZP5PG.js";
56
- import "./chunk-K623ENWT.js";
57
- import "./chunk-AQ37AY7B.js";
58
- import {
59
- WorkspaceContext
60
- } from "./chunk-KBXKR5R2.js";
61
- import "./chunk-GMIEIY3Y.js";
62
- import "./chunk-NAVJD2PQ.js";
63
- import "./chunk-ROIYNTHJ.js";
64
- import "./chunk-2B2BF7P7.js";
65
- import "./chunk-P3QQPMQA.js";
66
- import "./chunk-YZHRN3CF.js";
67
- import "./chunk-FAAUPSY2.js";
68
- import "./chunk-KM73TBQ4.js";
69
- import "./chunk-MPHPFVKK.js";
62
+ import "./chunk-7IV52LTO.js";
70
63
  import "./chunk-AXMWHKXA.js";
71
- import "./chunk-GLCZKT5V.js";
72
64
  import {
73
65
  createAbortController,
74
66
  createChildAbortController
75
67
  } from "./chunk-DJ2GSRLV.js";
76
- import "./chunk-QFJ5JHQR.js";
68
+ import "./chunk-2J3OJGTL.js";
69
+ import "./chunk-LI4YHTQK.js";
70
+ import "./chunk-GLCZKT5V.js";
71
+ import "./chunk-C72BXMJ5.js";
77
72
  import {
78
73
  WorkflowRunEvent,
79
74
  logWorkflowRun,
80
75
  read,
81
76
  writeLine
82
- } from "./chunk-RVOJ2FBP.js";
77
+ } from "./chunk-RPJOOK6N.js";
83
78
  import "./chunk-YRLW2MSX.js";
84
79
  import "./chunk-VGC4I5JJ.js";
85
- import "./chunk-CHHABXPE.js";
86
- import "./chunk-MA2HEDVP.js";
80
+ import "./chunk-IWOWEENB.js";
81
+ import "./chunk-HIK2OF33.js";
82
+ import "./chunk-ZRYQMWEP.js";
83
+ import "./chunk-7JDGSJQH.js";
84
+ import "./chunk-F6WFNA7U.js";
85
+ import "./chunk-WZAD4ZNJ.js";
86
+ import "./chunk-FPGTNKCP.js";
87
+ import "./chunk-YHC2EYYG.js";
88
+ import "./chunk-PZRUV52H.js";
89
+ import "./chunk-JGUBDRBC.js";
90
+ import "./chunk-HDKCKCYO.js";
91
+ import "./chunk-HHJLM3WQ.js";
92
+ import {
93
+ stripAnsiAndControl
94
+ } from "./chunk-32CHFLGV.js";
95
+ import "./chunk-74TONY4F.js";
87
96
  import {
88
97
  SyntheticOutputTool
89
- } from "./chunk-XUJNK7Y6.js";
98
+ } from "./chunk-XL5K4SVK.js";
99
+ import "./chunk-WZDM44SB.js";
100
+ import "./chunk-K623ENWT.js";
101
+ import "./chunk-AQ37AY7B.js";
102
+ import {
103
+ WorkspaceContext
104
+ } from "./chunk-K52PZNU4.js";
90
105
  import {
91
106
  BaseDeclarativeTool,
92
107
  BaseToolInvocation,
93
108
  ToolDisplayNames,
94
109
  ToolNames
95
- } from "./chunk-6HY6IF3Z.js";
96
- import "./chunk-4PKCUT7F.js";
97
- import "./chunk-F6WFNA7U.js";
98
- import "./chunk-46UV252V.js";
99
- import "./chunk-FPGTNKCP.js";
100
- import "./chunk-CPHEPGAO.js";
101
- import "./chunk-P7MPQI75.js";
102
- import "./chunk-FDGGZIYW.js";
103
- import {
104
- stripAnsiAndControl
105
- } from "./chunk-EL5SXY3T.js";
106
- import "./chunk-HHJLM3WQ.js";
107
- import "./chunk-K5IDV3PC.js";
110
+ } from "./chunk-6NFAEG54.js";
108
111
  import {
109
112
  createDebugLogger
110
- } from "./chunk-BUQDLC2G.js";
111
- import "./chunk-VOQXFAY5.js";
113
+ } from "./chunk-A5F2YNO6.js";
112
114
  import "./chunk-75DOP5OR.js";
113
115
  import "./chunk-DMTGGOSA.js";
114
116
  import "./chunk-YQ3U5MUC.js";
115
117
  import "./chunk-AMDSOFFV.js";
116
- import "./chunk-QUGAUQGJ.js";
118
+ import "./chunk-TBWQLLFO.js";
117
119
  import {
118
120
  init_esbuild_shims
119
121
  } from "./chunk-5O2XNYP6.js";
@@ -127,6 +129,7 @@ init_esbuild_shims();
127
129
  // packages/core/src/agents/runtime/workflow-orchestrator.ts
128
130
  init_esbuild_shims();
129
131
  import { randomBytes } from "node:crypto";
132
+ import { AsyncLocalStorage } from "node:async_hooks";
130
133
  import * as os from "node:os";
131
134
 
132
135
  // packages/core/src/agents/runtime/workflow-sandbox.ts
@@ -405,22 +408,27 @@ __name(validateArgs, "validateArgs");
405
408
  function createWorkflowSandbox(opts) {
406
409
  const phases = [];
407
410
  const logs = [];
408
- const safeLog = /* @__PURE__ */ __name((msg) => {
411
+ const emitLog = /* @__PURE__ */ __name((line) => {
412
+ try {
413
+ opts.emitter?.logAppended?.(line);
414
+ } catch (e) {
415
+ debugLogger.warn("emitter.logAppended threw:", e);
416
+ }
417
+ }, "emitLog");
418
+ const safeLog = /* @__PURE__ */ __name((msg, notify = true) => {
409
419
  if (logs.length < MAX_LOG_LINES) {
410
420
  const line = String(msg);
411
421
  logs.push(line);
412
- try {
413
- opts.emitter?.logAppended?.(line);
414
- } catch (e) {
415
- debugLogger.warn("emitter.logAppended threw:", e);
416
- }
422
+ if (notify) emitLog(line);
417
423
  } else if (logs.length === MAX_LOG_LINES) {
418
- logs.push(`[workflow log truncated at ${MAX_LOG_LINES} lines]`);
424
+ const line = `[workflow log truncated at ${MAX_LOG_LINES} lines]`;
425
+ logs.push(line);
426
+ if (notify) emitLog(line);
419
427
  }
420
428
  }, "safeLog");
421
429
  const safePhase = /* @__PURE__ */ __name((title) => {
422
430
  if (phases.length < MAX_PHASE_ENTRIES) {
423
- const t = String(title);
431
+ const t = stripAnsiAndControl(String(title)).slice(0, 200) || "phase";
424
432
  if (phases[phases.length - 1] === t) return;
425
433
  phases.push(t);
426
434
  try {
@@ -915,7 +923,7 @@ function createWorkflowSandbox(opts) {
915
923
  // FIX-Round1-T13: throw on any opts key not in the allowlist \u2014 catches
916
924
  // typos like { scema: ... } that previously slipped through the
917
925
  // [key:string]: unknown index signature.
918
- const KNOWN_AGENT_OPTS = ['label', 'phase', 'schema', 'model', 'isolation', 'agentType', 'stallMs'];
926
+ const KNOWN_AGENT_OPTS = ['label', 'phase', 'schema', 'model', 'isolation', 'agentType', 'stallMs', 'workingDir'];
919
927
  globalThis.agent = vmAsync(function (prompt, agentOpts) {
920
928
  agentOpts = agentOpts || {};
921
929
  const keys = Object.keys(agentOpts);
@@ -945,6 +953,34 @@ function createWorkflowSandbox(opts) {
945
953
  "Known modes are: 'worktree', 'remote'."
946
954
  );
947
955
  }
956
+ // NOTE: this init script is a host-side template literal \u2014 no
957
+ // backticks anywhere below, in code or comments.
958
+ //
959
+ // A non-number stallMs is silently dropped downstream and the
960
+ // default watchdog applies, contradicting "0 disables the watchdog"
961
+ // \u2014 refuse it loudly like the other option gates.
962
+ if (agentOpts.stallMs !== undefined && (typeof agentOpts.stallMs !== 'number' || !Number.isFinite(agentOpts.stallMs))) {
963
+ throw new Error("agent({stallMs}): must be a finite number of milliseconds (0 disables the watchdog).");
964
+ }
965
+ // workingDir pins the agent to a worktree the CALLER already owns;
966
+ // isolation creates and reaps one. Asking for both is a contradiction
967
+ // about who owns the directory's lifetime, so name it here rather than
968
+ // silently letting one win.
969
+ if (agentOpts.workingDir !== undefined) {
970
+ if (typeof agentOpts.workingDir !== 'string' || agentOpts.workingDir.trim().length === 0) {
971
+ throw new Error(
972
+ "agent({workingDir}): must be a non-empty string naming an existing " +
973
+ "git worktree of this repository."
974
+ );
975
+ }
976
+ if (agentOpts.isolation !== undefined) {
977
+ throw new Error(
978
+ "agent({workingDir, isolation}): incompatible options. workingDir " +
979
+ "pins the agent to a worktree you already own; isolation creates " +
980
+ "a fresh one and removes it afterwards. Pass one."
981
+ );
982
+ }
983
+ }
948
984
  if (typeof agentOpts.phase === 'string' && agentOpts.phase.length > 0) {
949
985
  if (__b.lastPhase() !== agentOpts.phase) {
950
986
  __b.pushPhase(agentOpts.phase);
@@ -1297,7 +1333,7 @@ ${stripped}
1297
1333
  },
1298
1334
  getPhases: /* @__PURE__ */ __name(() => [...phases], "getPhases"),
1299
1335
  getLogs: /* @__PURE__ */ __name(() => [...logs], "getLogs"),
1300
- appendLog: /* @__PURE__ */ __name((line) => safeLog(line), "appendLog"),
1336
+ appendLog: /* @__PURE__ */ __name((line) => safeLog(line, false), "appendLog"),
1301
1337
  getMeta: /* @__PURE__ */ __name(() => extractedMeta, "getMeta")
1302
1338
  };
1303
1339
  }
@@ -1529,7 +1565,13 @@ var debugLogger4 = createDebugLogger("WORKFLOW_JOURNAL");
1529
1565
  var JOURNAL_KEY_VERSION = "v2";
1530
1566
  function canonicalizeAgentOpts(opts) {
1531
1567
  const projected = {};
1532
- for (const k of ["schema", "model", "isolation", "agentType"]) {
1568
+ for (const k of [
1569
+ "schema",
1570
+ "model",
1571
+ "isolation",
1572
+ "agentType",
1573
+ "workingDir"
1574
+ ]) {
1533
1575
  const v = opts[k];
1534
1576
  if (v === void 0 || typeof v === "function") continue;
1535
1577
  projected[k] = v;
@@ -1598,6 +1640,7 @@ var WorkflowJournal = class {
1598
1640
  static {
1599
1641
  __name(this, "WorkflowJournal");
1600
1642
  }
1643
+ pending = Promise.resolve();
1601
1644
  /** Load + parse all entries into replay maps. Empty maps if no file. */
1602
1645
  async load() {
1603
1646
  try {
@@ -1610,7 +1653,13 @@ var WorkflowJournal = class {
1610
1653
  }
1611
1654
  /** Append one entry. Rejects only on I/O error (callers `.catch`). */
1612
1655
  append(entry) {
1613
- return writeLine(this.path, entry);
1656
+ const operation = this.pending.then(() => writeLine(this.path, entry));
1657
+ this.pending = operation.catch(() => void 0);
1658
+ return operation;
1659
+ }
1660
+ /** Wait until every append issued so far has settled. */
1661
+ drain() {
1662
+ return this.pending;
1614
1663
  }
1615
1664
  };
1616
1665
 
@@ -1783,8 +1832,49 @@ function resolveConcurrencyLimit(env = process.env) {
1783
1832
  return Math.max(1, Math.min(16, os.cpus().length - 2));
1784
1833
  }
1785
1834
  __name(resolveConcurrencyLimit, "resolveConcurrencyLimit");
1786
- var WORKFLOW_SUBAGENT_MAX_TURNS = 50;
1787
- var WORKFLOW_SUBAGENT_MAX_TIME_MINUTES = 10;
1835
+ var DEFAULT_WORKFLOW_SUBAGENT_MAX_TURNS = 50;
1836
+ var DEFAULT_WORKFLOW_SUBAGENT_MAX_TIME_MINUTES = 10;
1837
+ var WORKFLOW_SUBAGENT_MAX_TURNS_ENV = "QWEN_CODE_WORKFLOW_AGENT_MAX_TURNS";
1838
+ var WORKFLOW_SUBAGENT_MAX_MINUTES_ENV = "QWEN_CODE_WORKFLOW_AGENT_MAX_MINUTES";
1839
+ var HARD_WORKFLOW_SUBAGENT_MAX_TURNS_CEILING = 500;
1840
+ var HARD_WORKFLOW_SUBAGENT_MAX_MINUTES_CEILING = 100;
1841
+ function resolveSubagentBound(envName, defaultValue, ceiling, env) {
1842
+ const raw = env[envName];
1843
+ if (raw === void 0 || raw.trim() === "") return defaultValue;
1844
+ const parsed = parsePositiveIntegerEnv(raw, 0);
1845
+ if (parsed < 1) {
1846
+ debugLogger.warn(
1847
+ `Invalid ${envName}=${JSON.stringify(raw)}, using default (${defaultValue})`
1848
+ );
1849
+ return defaultValue;
1850
+ }
1851
+ if (parsed > ceiling) {
1852
+ debugLogger.warn(
1853
+ `${envName}=${parsed} exceeds hard ceiling (${ceiling}); clamping.`
1854
+ );
1855
+ return ceiling;
1856
+ }
1857
+ return parsed;
1858
+ }
1859
+ __name(resolveSubagentBound, "resolveSubagentBound");
1860
+ function resolveSubagentMaxTurns(env = process.env) {
1861
+ return resolveSubagentBound(
1862
+ WORKFLOW_SUBAGENT_MAX_TURNS_ENV,
1863
+ DEFAULT_WORKFLOW_SUBAGENT_MAX_TURNS,
1864
+ HARD_WORKFLOW_SUBAGENT_MAX_TURNS_CEILING,
1865
+ env
1866
+ );
1867
+ }
1868
+ __name(resolveSubagentMaxTurns, "resolveSubagentMaxTurns");
1869
+ function resolveSubagentMaxTimeMinutes(env = process.env) {
1870
+ return resolveSubagentBound(
1871
+ WORKFLOW_SUBAGENT_MAX_MINUTES_ENV,
1872
+ DEFAULT_WORKFLOW_SUBAGENT_MAX_TIME_MINUTES,
1873
+ HARD_WORKFLOW_SUBAGENT_MAX_MINUTES_CEILING,
1874
+ env
1875
+ );
1876
+ }
1877
+ __name(resolveSubagentMaxTimeMinutes, "resolveSubagentMaxTimeMinutes");
1788
1878
  var WORKFLOW_SUBAGENT_DISALLOWED_TOOLS = [
1789
1879
  ToolNames.ASK_USER_QUESTION,
1790
1880
  ToolNames.SEND_MESSAGE,
@@ -1819,7 +1909,7 @@ function sanitizeForErrorMessage(value) {
1819
1909
  }
1820
1910
  __name(sanitizeForErrorMessage, "sanitizeForErrorMessage");
1821
1911
  function createProductionDispatch(config, signal, onTokens, bridgeApprovalEvents) {
1822
- return async (prompt, opts) => {
1912
+ return async (prompt, opts, dispatchId) => {
1823
1913
  if (typeof prompt !== "string" || prompt.length === 0) {
1824
1914
  throw new Error("agent() requires a non-empty string prompt.");
1825
1915
  }
@@ -1832,7 +1922,10 @@ function createProductionDispatch(config, signal, onTokens, bridgeApprovalEvents
1832
1922
  return runStallResilient(
1833
1923
  async (attemptSignal, emitter) => {
1834
1924
  attempt += 1;
1835
- const cleanupApprovalBridge = bridgeApprovalEvents?.(emitter);
1925
+ const cleanupApprovalBridge = bridgeApprovalEvents?.(
1926
+ emitter,
1927
+ dispatchId
1928
+ );
1836
1929
  const cleanupTranscript = attachDispatchTranscript(
1837
1930
  config,
1838
1931
  workflowAgentId,
@@ -1907,11 +2000,11 @@ function attachDispatchTranscript(config, agentId, prompt, agentName, emitter, a
1907
2000
  }
1908
2001
  __name(attachDispatchTranscript, "attachDispatchTranscript");
1909
2002
  async function runSingleDispatch(config, prompt, opts, attemptSignal, emitter, workflowAgentId, agentIdentity, onTokens) {
1910
- const { AgentHeadless, ContextState } = await import("./agent-headless-GJCQMURW.js");
2003
+ const { AgentHeadless, ContextState } = await import("./agent-headless-AVFYIRPV.js");
1911
2004
  const ctx = new ContextState();
1912
2005
  ctx.set("task_prompt", prompt);
1913
2006
  debugLogger.debug(`[workflow] Dispatch ${workflowAgentId}`);
1914
- if (opts.agentType === void 0 && opts.model === void 0 && opts.isolation === void 0 && opts.schema === void 0) {
2007
+ if (opts.agentType === void 0 && opts.model === void 0 && opts.isolation === void 0 && opts.schema === void 0 && opts.workingDir === void 0) {
1915
2008
  const subagent = await AgentHeadless.create(
1916
2009
  agentIdentity.name,
1917
2010
  config,
@@ -1924,8 +2017,8 @@ async function runSingleDispatch(config, prompt, opts, attemptSignal, emitter, w
1924
2017
  // and the loop guards never tripped — combined with the cancellation
1925
2018
  // bug below, workflows were effectively unkillable.
1926
2019
  {
1927
- max_turns: WORKFLOW_SUBAGENT_MAX_TURNS,
1928
- max_time_minutes: WORKFLOW_SUBAGENT_MAX_TIME_MINUTES
2020
+ max_turns: resolveSubagentMaxTurns(),
2021
+ max_time_minutes: resolveSubagentMaxTimeMinutes()
1929
2022
  },
1930
2023
  // T11 (PR #4732 R1): disallow SendMessage / ExitPlanMode to align with
1931
2024
  // upstream Tg8 — closes the back-channel that would let a subagent
@@ -2023,12 +2116,34 @@ ${WORKFLOW_SUBAGENT_SYSTEM_PROMPT_WITH_SCHEMA}` : WORKFLOW_SUBAGENT_SYSTEM_PROMP
2023
2116
  };
2024
2117
  let worktreeIsolation = null;
2025
2118
  let effectiveContext = config;
2119
+ if (opts.isolation !== void 0 && opts.workingDir !== void 0) {
2120
+ throw new Error(
2121
+ "agent({workingDir, isolation}): incompatible options. workingDir pins the agent to a worktree you already own; isolation creates a fresh one and removes it afterwards. Pass one."
2122
+ );
2123
+ }
2026
2124
  if (opts.isolation === "worktree") {
2027
2125
  worktreeIsolation = await provisionWorkflowWorktree(config);
2028
- effectiveContext = createWorktreeConfigOverride(
2126
+ effectiveContext = createDirScopedConfigOverride(
2029
2127
  config,
2030
2128
  worktreeIsolation.path
2031
2129
  );
2130
+ } else if (opts.workingDir !== void 0) {
2131
+ if (typeof opts.workingDir !== "string" || opts.workingDir.trim().length === 0) {
2132
+ throw new Error(
2133
+ "agent({workingDir}): must be a non-empty string naming an existing git worktree of this repository."
2134
+ );
2135
+ }
2136
+ const resolved = await resolveExternalWorktreeDir(
2137
+ config,
2138
+ opts.workingDir,
2139
+ "workingDir"
2140
+ );
2141
+ if ("error" in resolved) {
2142
+ throw new Error(
2143
+ `agent({workingDir: ${sanitizeForErrorMessage(JSON.stringify(opts.workingDir))}}): ${sanitizeForErrorMessage(resolved.error)}`
2144
+ );
2145
+ }
2146
+ effectiveContext = createDirScopedConfigOverride(config, resolved.path);
2032
2147
  }
2033
2148
  let onParentAbort;
2034
2149
  try {
@@ -2066,8 +2181,8 @@ ${WORKFLOW_SUBAGENT_SYSTEM_PROMPT_WITH_SCHEMA}` : WORKFLOW_SUBAGENT_SYSTEM_PROMP
2066
2181
  // own runConfig / maxTurns — these are workflow-level safety bounds,
2067
2182
  // not subagent-level preferences. P5 will refine via budget.
2068
2183
  runConfigOverrides: {
2069
- max_turns: WORKFLOW_SUBAGENT_MAX_TURNS,
2070
- max_time_minutes: WORKFLOW_SUBAGENT_MAX_TIME_MINUTES
2184
+ max_turns: resolveSubagentMaxTurns(),
2185
+ max_time_minutes: resolveSubagentMaxTimeMinutes()
2071
2186
  },
2072
2187
  eventEmitter
2073
2188
  }
@@ -2221,7 +2336,7 @@ async function provisionWorkflowWorktree(config) {
2221
2336
  };
2222
2337
  }
2223
2338
  __name(provisionWorkflowWorktree, "provisionWorkflowWorktree");
2224
- function createWorktreeConfigOverride(base, wtPath) {
2339
+ function createDirScopedConfigOverride(base, wtPath) {
2225
2340
  const ov = Object.create(base);
2226
2341
  ov.targetDir = wtPath;
2227
2342
  ov.cwd = wtPath;
@@ -2229,7 +2344,10 @@ function createWorktreeConfigOverride(base, wtPath) {
2229
2344
  ov.getCwd = () => wtPath;
2230
2345
  ov.getWorkingDir = () => wtPath;
2231
2346
  ov.getProjectRoot = () => wtPath;
2232
- const wtFileService = new FileDiscoveryService(wtPath);
2347
+ const wtFileService = new FileDiscoveryService(
2348
+ wtPath,
2349
+ base.getFileFilteringOptions().customIgnoreFiles
2350
+ );
2233
2351
  ov.fileDiscoveryService = wtFileService;
2234
2352
  ov.getFileService = () => wtFileService;
2235
2353
  const wtWorkspace = new WorkspaceContext(wtPath);
@@ -2237,7 +2355,7 @@ function createWorktreeConfigOverride(base, wtPath) {
2237
2355
  ov.getWorkspaceContext = () => wtWorkspace;
2238
2356
  return ov;
2239
2357
  }
2240
- __name(createWorktreeConfigOverride, "createWorktreeConfigOverride");
2358
+ __name(createDirScopedConfigOverride, "createDirScopedConfigOverride");
2241
2359
  async function cleanupWorkflowWorktree(isolation) {
2242
2360
  const wtService = new GitWorktreeService(isolation.repoRoot);
2243
2361
  const [hasChanges, hasUnmerged] = await Promise.all([
@@ -2355,8 +2473,29 @@ var WorkflowOrchestrator = class {
2355
2473
  }
2356
2474
  ), "rejectThroughPauseGate");
2357
2475
  let agentCount = 0;
2476
+ let dispatchTraceCount = 0;
2358
2477
  const emitter = req.emitter;
2359
2478
  const budget = req.budget;
2479
+ const dependencyContext = new AsyncLocalStorage();
2480
+ const issueDispatchTrace = /* @__PURE__ */ __name((prompt, opts, cached = false) => {
2481
+ const id = `dispatch-${dispatchTraceCount += 1}`;
2482
+ const store = dependencyContext.getStore();
2483
+ const dependsOn = Array.from(new Set(store?.tails ?? []));
2484
+ if (store) store.tails = [id];
2485
+ try {
2486
+ emitter?.dispatchQueued?.({
2487
+ id,
2488
+ ...typeof opts.label === "string" ? { label: opts.label } : {},
2489
+ prompt,
2490
+ dependsOn,
2491
+ queuedAt: Date.now(),
2492
+ ...cached ? { cached: true } : {}
2493
+ });
2494
+ } catch (e) {
2495
+ debugLogger.warn("emitter.dispatchQueued threw:", e);
2496
+ }
2497
+ return id;
2498
+ }, "issueDispatchTrace");
2360
2499
  const journal = req.journal;
2361
2500
  const replay = req.resumeReplay;
2362
2501
  let prefixHash = deriveArgsSeed(req.args);
@@ -2383,6 +2522,7 @@ var WorkflowOrchestrator = class {
2383
2522
  );
2384
2523
  }
2385
2524
  const label2 = typeof opts.label === "string" ? opts.label : void 0;
2525
+ const dispatchId2 = issueDispatchTrace(prompt, opts, true);
2386
2526
  try {
2387
2527
  emitter?.agentDispatched?.(label2);
2388
2528
  } catch (e) {
@@ -2393,6 +2533,11 @@ var WorkflowOrchestrator = class {
2393
2533
  } catch (e) {
2394
2534
  debugLogger.warn("emitter.agentCompleted threw:", e);
2395
2535
  }
2536
+ try {
2537
+ emitter?.dispatchSettled?.(dispatchId2, void 0, Date.now());
2538
+ } catch (e) {
2539
+ debugLogger.warn("emitter.dispatchSettled threw:", e);
2540
+ }
2396
2541
  return scheduler.waitUntilRunning().then(
2397
2542
  () => cached.result,
2398
2543
  () => cached.result
@@ -2422,6 +2567,7 @@ var WorkflowOrchestrator = class {
2422
2567
  );
2423
2568
  }
2424
2569
  const label = typeof opts.label === "string" ? opts.label : void 0;
2570
+ const dispatchId = issueDispatchTrace(prompt, opts);
2425
2571
  try {
2426
2572
  emitter?.agentDispatched?.(label);
2427
2573
  } catch (e) {
@@ -2437,9 +2583,19 @@ var WorkflowOrchestrator = class {
2437
2583
  } catch (e) {
2438
2584
  debugLogger.warn("emitter.agentCompleted threw:", e);
2439
2585
  }
2586
+ try {
2587
+ emitter?.dispatchSettled?.(dispatchId, message, Date.now());
2588
+ } catch (e) {
2589
+ debugLogger.warn("emitter.dispatchSettled threw:", e);
2590
+ }
2440
2591
  }, "emitCompletion");
2441
2592
  return scheduler.run(async () => {
2442
2593
  try {
2594
+ try {
2595
+ emitter?.dispatchStarted?.(dispatchId, Date.now());
2596
+ } catch (e) {
2597
+ debugLogger.warn("emitter.dispatchStarted threw:", e);
2598
+ }
2443
2599
  if (budget && budget.total !== null && budget.remaining() <= 0) {
2444
2600
  debugLogger.warn(
2445
2601
  `[Workflow] budget gate refused dispatch at slot-acquire: runId=${runId} spent=${budget.spent()} total=${budget.total}`
@@ -2450,7 +2606,7 @@ var WorkflowOrchestrator = class {
2450
2606
  budget.spent()
2451
2607
  );
2452
2608
  }
2453
- const result = await this.dispatch(prompt, opts);
2609
+ const result = await this.dispatch(prompt, opts, dispatchId);
2454
2610
  emitCompletion();
2455
2611
  if (journal && journalKey !== void 0) {
2456
2612
  journal.append({
@@ -2504,8 +2660,8 @@ var WorkflowOrchestrator = class {
2504
2660
  }
2505
2661
  );
2506
2662
  }, "countedDispatch");
2507
- const parallelImpl = makeParallelImpl(signal);
2508
- const pipelineImpl = makePipelineImpl(signal);
2663
+ const parallelImpl = makeParallelImpl(signal, dependencyContext);
2664
+ const pipelineImpl = makePipelineImpl(signal, dependencyContext);
2509
2665
  const resolveSavedWorkflow = req.resolveSavedWorkflow;
2510
2666
  const parentSandboxRef = {
2511
2667
  current: void 0
@@ -2546,7 +2702,10 @@ var WorkflowOrchestrator = class {
2546
2702
  });
2547
2703
  parentSandboxRef.current = sandbox;
2548
2704
  try {
2549
- const result = await sandbox.run(req.script);
2705
+ const result = await dependencyContext.run(
2706
+ { tails: [] },
2707
+ () => sandbox.run(req.script)
2708
+ );
2550
2709
  return {
2551
2710
  runId,
2552
2711
  result,
@@ -2591,7 +2750,7 @@ async function settleToNullArray(thunks, signal, kind = "parallel") {
2591
2750
  return result;
2592
2751
  }
2593
2752
  __name(settleToNullArray, "settleToNullArray");
2594
- function makeParallelImpl(signal) {
2753
+ function makeParallelImpl(signal, dependencyContext) {
2595
2754
  return (thunks) => {
2596
2755
  if (!Array.isArray(thunks)) {
2597
2756
  return Promise.reject(
@@ -2609,11 +2768,32 @@ function makeParallelImpl(signal) {
2609
2768
  );
2610
2769
  }
2611
2770
  }
2612
- return settleToNullArray(thunks, signal);
2771
+ const parent = dependencyContext.getStore();
2772
+ const inheritedTails = parent?.tails ?? [];
2773
+ const branches = thunks.map((thunk) => {
2774
+ const store = { tails: [...inheritedTails] };
2775
+ return {
2776
+ store,
2777
+ thunk: /* @__PURE__ */ __name(() => dependencyContext.run(store, thunk), "thunk")
2778
+ };
2779
+ });
2780
+ return settleToNullArray(
2781
+ branches.map(({ thunk }) => thunk),
2782
+ signal
2783
+ ).then((result) => {
2784
+ if (parent && branches.length > 0) {
2785
+ parent.tails = mergeFanoutTails(
2786
+ parent.tails,
2787
+ inheritedTails,
2788
+ branches.flatMap(({ store }) => store.tails)
2789
+ );
2790
+ }
2791
+ return result;
2792
+ });
2613
2793
  };
2614
2794
  }
2615
2795
  __name(makeParallelImpl, "makeParallelImpl");
2616
- function makePipelineImpl(signal) {
2796
+ function makePipelineImpl(signal, dependencyContext) {
2617
2797
  return (items, ...stages) => {
2618
2798
  if (!Array.isArray(items)) {
2619
2799
  return Promise.reject(
@@ -2631,13 +2811,45 @@ function makePipelineImpl(signal) {
2631
2811
  );
2632
2812
  }
2633
2813
  }
2634
- const chains = items.map(
2635
- (item, idx) => () => runPipelineChain(item, idx, stages)
2636
- );
2637
- return settleToNullArray(chains, signal, "pipeline");
2814
+ const parent = dependencyContext.getStore();
2815
+ const inheritedTails = parent?.tails ?? [];
2816
+ const branches = items.map((item, idx) => {
2817
+ const store = { tails: [...inheritedTails] };
2818
+ return {
2819
+ store,
2820
+ thunk: /* @__PURE__ */ __name(() => dependencyContext.run(
2821
+ store,
2822
+ () => runPipelineChain(item, idx, stages)
2823
+ ), "thunk")
2824
+ };
2825
+ });
2826
+ return settleToNullArray(
2827
+ branches.map(({ thunk }) => thunk),
2828
+ signal,
2829
+ "pipeline"
2830
+ ).then((result) => {
2831
+ if (parent && branches.length > 0) {
2832
+ parent.tails = mergeFanoutTails(
2833
+ parent.tails,
2834
+ inheritedTails,
2835
+ branches.flatMap(({ store }) => store.tails)
2836
+ );
2837
+ }
2838
+ return result;
2839
+ });
2638
2840
  };
2639
2841
  }
2640
2842
  __name(makePipelineImpl, "makePipelineImpl");
2843
+ function mergeFanoutTails(currentParentTails, inheritedTails, branchTails) {
2844
+ const inherited = new Set(inheritedTails);
2845
+ const newBranchTails = branchTails.filter((tail) => !inherited.has(tail));
2846
+ const merged = newBranchTails.length > 0 ? [
2847
+ ...newBranchTails,
2848
+ ...currentParentTails.filter((tail) => !inherited.has(tail))
2849
+ ] : currentParentTails;
2850
+ return Array.from(new Set(merged));
2851
+ }
2852
+ __name(mergeFanoutTails, "mergeFanoutTails");
2641
2853
  async function runPipelineChain(item, idx, stages) {
2642
2854
  let prev = item;
2643
2855
  for (const stage of stages) {
@@ -2705,19 +2917,26 @@ var WorkflowRunner = class {
2705
2917
  throw new Error("Background workflow start was cancelled.");
2706
2918
  }
2707
2919
  const callerWasAbortedBeforeStart = options.signal.aborted;
2708
- const controller = runInBackground ? createAbortController() : createChildAbortController(options.signal);
2709
2920
  const registry = config.getWorkflowRunRegistry?.();
2921
+ let entry;
2922
+ const isCurrentEntry = /* @__PURE__ */ __name(() => registry === void 0 || entry !== void 0 && registry.get(runId) === entry, "isCurrentEntry");
2923
+ const controller = runInBackground ? createAbortController() : createChildAbortController(options.signal);
2710
2924
  const dispatch = options.dispatch ?? createProductionDispatch(
2711
2925
  config,
2712
2926
  controller.signal,
2713
2927
  (outputTokens) => budget.recordSpent(outputTokens),
2714
- registry ? (emitter2) => registry.bridgeApprovalEvents(runId, emitter2) : void 0
2928
+ registry ? (emitter2, dispatchId) => isCurrentEntry() ? registry.bridgeApprovalEvents(
2929
+ runId,
2930
+ emitter2,
2931
+ dispatchId,
2932
+ entry
2933
+ ) : () => void 0 : void 0
2715
2934
  );
2716
2935
  const orchestrator = new WorkflowOrchestrator(dispatch);
2717
- let entry;
2718
2936
  try {
2719
2937
  entry = registry?.register({
2720
2938
  runId,
2939
+ toolUseId: options.toolUseId,
2721
2940
  meta: null,
2722
2941
  status: "running",
2723
2942
  startTime: Date.now(),
@@ -2726,6 +2945,11 @@ var WorkflowRunner = class {
2726
2945
  tokenBudgetTotal: budget.total,
2727
2946
  script,
2728
2947
  scriptPath,
2948
+ args: options.args,
2949
+ ...options.resumeFromRunId ? {
2950
+ sourceRunId: options.resumeFromRunId,
2951
+ startMode: "retry"
2952
+ } : {},
2729
2953
  isBackgrounded: runInBackground
2730
2954
  });
2731
2955
  } catch (error) {
@@ -2733,7 +2957,7 @@ var WorkflowRunner = class {
2733
2957
  throw error;
2734
2958
  }
2735
2959
  const emitUpdate = /* @__PURE__ */ __name(() => {
2736
- if (!entry || !options.onUpdate) return;
2960
+ if (!entry || !options.onUpdate || !isCurrentEntry()) return;
2737
2961
  try {
2738
2962
  options.onUpdate(entry);
2739
2963
  } catch {
@@ -2741,21 +2965,48 @@ var WorkflowRunner = class {
2741
2965
  }, "emitUpdate");
2742
2966
  const emitter = {
2743
2967
  phaseStarted: /* @__PURE__ */ __name((title) => {
2968
+ if (!isCurrentEntry()) return;
2744
2969
  registry?.onPhaseStarted(runId, title);
2745
2970
  emitUpdate();
2746
2971
  }, "phaseStarted"),
2747
2972
  agentDispatched: /* @__PURE__ */ __name(() => {
2973
+ if (!isCurrentEntry()) return;
2748
2974
  registry?.onAgentDispatched(runId);
2749
2975
  emitUpdate();
2750
2976
  }, "agentDispatched"),
2751
2977
  agentCompleted: /* @__PURE__ */ __name(() => {
2978
+ if (!isCurrentEntry()) return;
2752
2979
  registry?.onAgentCompleted(runId);
2753
2980
  }, "agentCompleted"),
2754
- // Deliberate no-op: logs are snapshotted at terminal via
2755
- // setRecentLogs; per-line emit would cause up to 10k TUI redraws.
2756
- logAppended: /* @__PURE__ */ __name(() => {
2981
+ dispatchQueued: /* @__PURE__ */ __name((event) => {
2982
+ if (!isCurrentEntry()) return;
2983
+ registry?.onDispatchQueued(runId, event);
2984
+ emitUpdate();
2985
+ }, "dispatchQueued"),
2986
+ dispatchStarted: /* @__PURE__ */ __name((dispatchId, startedAt) => {
2987
+ if (!isCurrentEntry()) return;
2988
+ registry?.onDispatchStarted(runId, dispatchId, startedAt);
2989
+ emitUpdate();
2990
+ }, "dispatchStarted"),
2991
+ dispatchSettled: /* @__PURE__ */ __name((dispatchId, error, endedAt) => {
2992
+ if (!isCurrentEntry()) return;
2993
+ registry?.onDispatchSettled(
2994
+ runId,
2995
+ dispatchId,
2996
+ error,
2997
+ endedAt,
2998
+ !runInBackground && options.signal.aborted
2999
+ );
3000
+ emitUpdate();
3001
+ }, "dispatchSettled"),
3002
+ // The registry records this without firing a status update, avoiding a
3003
+ // TUI redraw per line while retaining the real replay timestamp.
3004
+ logAppended: /* @__PURE__ */ __name((line) => {
3005
+ if (!isCurrentEntry()) return;
3006
+ registry?.onLogAppended(runId, line);
2757
3007
  }, "logAppended"),
2758
3008
  budgetUpdated: /* @__PURE__ */ __name((spent, total) => {
3009
+ if (!isCurrentEntry()) return;
2759
3010
  registry?.onBudgetUpdated(runId, spent, total);
2760
3011
  emitUpdate();
2761
3012
  }, "budgetUpdated")
@@ -2763,7 +3014,10 @@ var WorkflowRunner = class {
2763
3014
  const scheduler = new WorkflowDispatchScheduler(
2764
3015
  resolveConcurrencyLimit(),
2765
3016
  controller.signal,
2766
- ({ state }) => registry?.onDispatchStateChange(runId, state)
3017
+ ({ state }) => {
3018
+ if (!isCurrentEntry()) return;
3019
+ registry?.onDispatchStateChange(runId, state);
3020
+ }
2767
3021
  );
2768
3022
  const handle = new WorkflowRunHandle(
2769
3023
  runId,
@@ -2823,6 +3077,7 @@ var WorkflowRunner = class {
2823
3077
  duration_ms: (entry.endTime ?? entry.startTime) - entry.startTime
2824
3078
  });
2825
3079
  await writeWorkflowSnapshot(config, entry);
3080
+ await journal?.drain();
2826
3081
  try {
2827
3082
  logWorkflowRun(config, telemetryEvent);
2828
3083
  } catch {
@@ -2853,7 +3108,7 @@ var WORKFLOW_PARAM_SCHEMA = {
2853
3108
  properties: {
2854
3109
  script: {
2855
3110
  type: "string",
2856
- description: `JavaScript source of the workflow. Wrapped as an async IIFE. May call the injected globals \`phase(title)\`, \`log(msg)\`, \`agent(prompt, opts?)\`, and read \`args\`. agent() opts: \`{ label?, phase?, schema?, model?, agentType?, isolation? }\`. \`schema\` (JSON Schema object): the subagent must deliver its result by calling \`structured_output\` with arguments matching the schema; agent() resolves to the validated object. Two failed attempts produce a terminal error "subagent completed without calling StructuredOutput (after 2 in-conversation nudges)". \`agentType\` (string): resolves against the declarative-agents registry (\`.qwen/agents/<name>.md\`, project then user then built-in). Unresolved names throw "agent({agentType}): agent type 'X' not found". \`model\` (string): per-call model override; routes provider correctly via the subagent runtime view. \`isolation\`: \`'worktree'\` provisions a fresh git worktree under \`<projectRoot>/.qwen/worktrees/agent-<7hex>\`; the worktree is auto-removed if no changes, otherwise the path and branch are returned alongside the result. \`'remote'\` throws "agent({isolation:'remote'}) is not available in this build" (parity with upstream). isolation=worktree refuses to run when the parent working tree has uncommitted changes (the subagent would see a stale HEAD). Workflow subagents always have SendMessage / Monitor / EnterPlanMode / ExitPlanMode in their disallowed-tool floor regardless of agentType. Concurrency: \`parallel([() => agent(...), ...])\` runs thunks through a shared per-run window (default \`max(1, min(16, cpus-2))\` agents in flight; override via \`${MAX_WORKFLOW_CONCURRENCY_ENV}\`) and resolves to a position-aligned array \u2014 a thunk that throws, or resolves to a non-JSON-serializable value, becomes \`null\` at its index (errors-as-data); parallel() itself rejects only on invalid arguments or abort. \`pipeline(items, ...stages)\` runs each item through the stages (staggered, no inter-stage barrier); a stage that throws, returns \`null\`, or returns a non-JSON-serializable value drops that item to \`null\`. Pass THUNKS to parallel, not eager calls: \`parallel([() => agent(...)])\`, not \`parallel([agent(...)])\`. At most ${DEFAULT_MAX_AGENTS_PER_RUN} agent() calls per run (override via \`${MAX_WORKFLOW_AGENTS_ENV}\`). \`Date.now()\` and \`Math.random()\` both throw \u2014 workflow scripts must be deterministic for resume. \`export const meta = {...}\` declarations are stripped before execution.`
3111
+ description: `JavaScript source of the workflow. Wrapped as an async IIFE. May call the injected globals \`phase(title)\`, \`log(msg)\`, \`agent(prompt, opts?)\`, and read \`args\`. agent() opts: \`{ label?, phase?, schema?, model?, agentType?, isolation?, workingDir?, stallMs? }\`. \`schema\` (JSON Schema object): the subagent must deliver its result by calling \`structured_output\` with arguments matching the schema; agent() resolves to the validated object. Two failed attempts produce a terminal error "subagent completed without calling StructuredOutput (after 2 in-conversation nudges)". \`agentType\` (string): resolves against the declarative-agents registry (\`.qwen/agents/<name>.md\`, project then user then built-in). Unresolved names throw "agent({agentType}): agent type 'X' not found". \`model\` (string): per-call model override; routes provider correctly via the subagent runtime view. \`isolation\`: \`'worktree'\` provisions a fresh git worktree under \`<projectRoot>/.qwen/worktrees/agent-<7hex>\`; the worktree is auto-removed if no changes, otherwise the path and branch are returned alongside the result. \`'remote'\` throws "agent({isolation:'remote'}) is not available in this build" (parity with upstream). isolation=worktree refuses to run when the parent working tree has uncommitted changes (the subagent would see a stale HEAD). \`workingDir\` (string): pin the subagent to an EXISTING git worktree of this repository that the caller owns \u2014 nothing is created and nothing is removed. Use it when the directory the agent must work in already exists and its uncommitted state is the point (a review worktree, a checkout a previous step provisioned) \u2014 exactly the case isolation cannot serve. Mutually exclusive with \`isolation\`. The path must be a linked worktree of this repository registered via \`git worktree add\` (it may live anywhere on disk) \u2014 the main checkout is not eligible. \`stallMs\` (number, ms): a no-progress watchdog, not a wall-clock cap. The dispatch is aborted and retried (up to ${MAX_STALL_ATTEMPTS} attempts total) after this many milliseconds with no observable subagent progress once progress has begun (a dispatch that produces no first response is bounded by the subagent time cap, not this watchdog); the timer is suspended while a tool is in flight, so a legitimately slow tool is not a stall. Default ${DEFAULT_STALL_MS} (override via \`${MAX_WORKFLOW_STALL_MS_ENV}\`, whole seconds); \`0\` disables the watchdog. Wall time per attempt is bounded separately. Workflow subagents always have SendMessage / Monitor / EnterPlanMode / ExitPlanMode in their disallowed-tool floor regardless of agentType. Concurrency: \`parallel([() => agent(...), ...])\` runs thunks through a shared per-run window (default \`max(1, min(16, cpus-2))\` agents in flight; override via \`${MAX_WORKFLOW_CONCURRENCY_ENV}\`) and resolves to a position-aligned array \u2014 a thunk that throws, or resolves to a non-JSON-serializable value, becomes \`null\` at its index (errors-as-data); parallel() itself rejects only on invalid arguments or abort. \`pipeline(items, ...stages)\` runs each item through the stages (staggered, no inter-stage barrier); a stage that throws, returns \`null\`, or returns a non-JSON-serializable value drops that item to \`null\`. Pass THUNKS to parallel, not eager calls: \`parallel([() => agent(...)])\`, not \`parallel([agent(...)])\`. At most ${DEFAULT_MAX_AGENTS_PER_RUN} agent() calls per run (override via \`${MAX_WORKFLOW_AGENTS_ENV}\`). \`Date.now()\` and \`Math.random()\` both throw \u2014 workflow scripts must be deterministic for resume. \`export const meta = {...}\` declarations are stripped before execution.`
2857
3112
  },
2858
3113
  scriptPath: {
2859
3114
  type: "string",
@@ -2886,6 +3141,10 @@ var WorkflowToolInvocation = class extends BaseToolInvocation {
2886
3141
  static {
2887
3142
  __name(this, "WorkflowToolInvocation");
2888
3143
  }
3144
+ callId;
3145
+ setCallId(callId) {
3146
+ this.callId = callId;
3147
+ }
2889
3148
  getDescription() {
2890
3149
  if (this.params.scriptPath && this.params.script === void 0) {
2891
3150
  return `Run saved workflow (${path.basename(this.params.scriptPath)})`;
@@ -2908,6 +3167,7 @@ var WorkflowToolInvocation = class extends BaseToolInvocation {
2908
3167
  handle = await WorkflowRunner.start({
2909
3168
  config: this.config,
2910
3169
  signal,
3170
+ toolUseId: this.callId,
2911
3171
  script: this.params.script,
2912
3172
  scriptPath: this.params.scriptPath,
2913
3173
  args: this.params.args,
@@ -2930,6 +3190,7 @@ var WorkflowToolInvocation = class extends BaseToolInvocation {
2930
3190
  handle.budget.total
2931
3191
  );
2932
3192
  return {
3193
+ workflowRunId: handle.runId,
2933
3194
  llmContent: [
2934
3195
  {
2935
3196
  text: `Workflow started in background.
@@ -3090,7 +3351,7 @@ Reach for one to be comprehensive (decompose the work and cover every part in pa
3090
3351
 
3091
3352
  **Runtime** \u2014 see the \`script\` parameter for the detailed authoring contract.
3092
3353
 
3093
- \`phase(title)\`, \`log(msg)\`, \`agent(prompt, opts?)\`, \`parallel(thunks)\`, \`pipeline(items, ...stages)\`, \`workflow(nameOrRef, args?)\`, plus the \`args\` and \`budget\` globals. \`workflow()\` runs a saved workflow inline under this run's caps and nests one level only \u2014 a workflow reached through \`workflow()\` cannot call \`workflow()\` itself, and doing so throws. Saved workflows are \`<name>.js\` files under \`<projectRoot>/.qwen/workflows\` (project scope, also surfaced as \`/<name>\` slash commands) or \`~/.qwen/workflows\` (user scope, lower precedence when both define the same name); \`workflow('<name>')\` resolves against those two directories, while \`scriptPath\` takes an absolute path to a script anywhere. Default \`max(1, min(16, cpus-2))\` agents in flight per run (\`${MAX_WORKFLOW_CONCURRENCY_ENV}\`), up to ${DEFAULT_MAX_AGENTS_PER_RUN} agents total (\`${MAX_WORKFLOW_AGENTS_ENV}\`), under a 30-minute wall-clock cap per run (\`QWEN_CODE_MAX_WORKFLOW_SECONDS\`) \u2014 a fan-out near the agent cap will not fit inside the default cap. A per-run output-token cap may also be in effect: read \`budget.total\` (\`null\` = uncapped) before committing to a large fan-out, because once the cap is reached every further \`agent()\` call is refused \u2014 a bare sequential \`await agent()\` sees the rejection, while inside \`parallel()\`/\`pipeline()\` the refused slot becomes \`null\` and the script keeps running on partial results. Per-call \`agent({ schema, agentType, model, isolation: 'worktree' })\` covers structured-output contracts, declarative-agent selection, model override, and git-worktree-isolated subagents. \`resumeFromRunId\` resumes a prior run \u2014 agent() calls whose rolling prefix-hash matches the journal are served from cache for the longest unchanged prefix. Runs appear in the background-tasks view and the \`/workflows\` dialog (live phase tree, token usage, cooperative pause/resume, cancel); \`run_in_background: true\` returns a run handle immediately in the interactive TUI and delivers completion through the conversation. Scripts run in a node:vm sandbox with no filesystem or shell access \u2014 all I/O happens through the spawned agents.
3354
+ \`phase(title)\`, \`log(msg)\`, \`agent(prompt, opts?)\`, \`parallel(thunks)\`, \`pipeline(items, ...stages)\`, \`workflow(nameOrRef, args?)\`, plus the \`args\` and \`budget\` globals. \`workflow()\` runs a saved workflow inline under this run's caps and nests one level only \u2014 a workflow reached through \`workflow()\` cannot call \`workflow()\` itself, and doing so throws. Saved workflows are \`<name>.js\` files under \`<projectRoot>/.qwen/workflows\` (project scope, also surfaced as \`/<name>\` slash commands) or \`~/.qwen/workflows\` (user scope, lower precedence when both define the same name); \`workflow('<name>')\` resolves against those two directories, while \`scriptPath\` takes an absolute path to a script anywhere. Default \`max(1, min(16, cpus-2))\` agents in flight per run (\`${MAX_WORKFLOW_CONCURRENCY_ENV}\`), up to ${DEFAULT_MAX_AGENTS_PER_RUN} agents total (\`${MAX_WORKFLOW_AGENTS_ENV}\`), under a 30-minute wall-clock cap per run (\`QWEN_CODE_MAX_WORKFLOW_SECONDS\`) \u2014 a fan-out near the agent cap will not fit inside the default cap. Each subagent attempt is separately capped at ${DEFAULT_WORKFLOW_SUBAGENT_MAX_TURNS} turns (\`${WORKFLOW_SUBAGENT_MAX_TURNS_ENV}\`) and ${DEFAULT_WORKFLOW_SUBAGENT_MAX_TIME_MINUTES} minutes (\`${WORKFLOW_SUBAGENT_MAX_MINUTES_ENV}\`) \u2014 an attempt that hits either becomes \`null\` in \`parallel()\`/\`pipeline()\`, indistinguishable from a missing agent, so raise them for legitimately long work. A per-run output-token cap may also be in effect: read \`budget.total\` (\`null\` = uncapped) before committing to a large fan-out, because once the cap is reached every further \`agent()\` call is refused \u2014 a bare sequential \`await agent()\` sees the rejection, while inside \`parallel()\`/\`pipeline()\` the refused slot becomes \`null\` and the script keeps running on partial results. Per-call \`agent({ schema, agentType, model, isolation: 'worktree', workingDir, stallMs })\` covers structured-output contracts, declarative-agent selection, model override, git-worktree-isolated subagents, pinning an agent to a caller-owned worktree, and the no-progress stall watchdog (\`stallMs: 0\` disables it). \`resumeFromRunId\` resumes a prior run \u2014 agent() calls whose rolling prefix-hash matches the journal are served from cache for the longest unchanged prefix. Runs appear in the background-tasks view and the \`/workflows\` dialog (live phase tree, token usage, cooperative pause/resume, cancel); \`run_in_background: true\` returns a run handle immediately in the interactive TUI and delivers completion through the conversation. Scripts run in a node:vm sandbox with no filesystem or shell access \u2014 all I/O happens through the spawned agents.
3094
3355
 
3095
3356
  **Scout first, then orchestrate**
3096
3357