@qwen-code/qwen-code 0.23.2 → 0.23.3

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 (373) hide show
  1. package/README.md +35 -15
  2. package/bundled/computer-use/SKILL.md +1 -1
  3. package/bundled/qc-helper/docs/configuration/model-providers.md +66 -28
  4. package/bundled/qc-helper/docs/configuration/settings.md +5 -3
  5. package/bundled/qc-helper/docs/features/_meta.ts +1 -0
  6. package/bundled/qc-helper/docs/features/channels/dws.md +7 -1
  7. package/bundled/qc-helper/docs/features/commands.md +57 -9
  8. package/bundled/qc-helper/docs/features/computer-use.md +1 -1
  9. package/bundled/qc-helper/docs/features/cross-session-protocol.md +320 -0
  10. package/bundled/qc-helper/docs/features/goals.md +1 -1
  11. package/bundled/qc-helper/docs/qwen-serve.md +16 -3
  12. package/bundled/review/SKILL.md +82 -79
  13. package/bundled/review/references/posting.md +31 -14
  14. package/chunks/{MaxSizedBox-4C3BKKKY.js → MaxSizedBox-D4LW7RZZ.js} +58 -51
  15. package/chunks/{StandaloneSessionPicker-TXVF65YW.js → StandaloneSessionPicker-ALTTRWUP.js} +80 -73
  16. package/chunks/acp-subagent-executor-LEUN3N7N.js +919 -0
  17. package/chunks/{acpAgent-H5XBKGB4.js → acpAgent-BBSW7XZG.js} +509 -201
  18. package/chunks/{agent-T5LEFJIU.js → agent-SQ6OY3QD.js} +42 -36
  19. package/chunks/{agent-headless-VZKSRH36.js → agent-headless-RI2THRQ7.js} +42 -36
  20. package/chunks/{anthropicContentGenerator-PRJWWVYJ.js → anthropicContentGenerator-JSKMKS6V.js} +66 -34
  21. package/chunks/{artifact-tool-G5LHNECG.js → artifact-tool-PMYZCYNH.js} +2 -2
  22. package/chunks/{askUserQuestion-I5W5S3D6.js → askUserQuestion-4M4YYIB4.js} +2 -2
  23. package/chunks/{bridge-AOX5IY44.js → bridge-DAFMI72L.js} +62 -55
  24. package/chunks/{channel-management-service-MWQGHPAS.js → channel-management-service-OWDXVL7R.js} +8 -8
  25. package/chunks/{channel-settings-store-XZCGDGHW.js → channel-settings-store-4I6JONT7.js} +69 -62
  26. package/chunks/{channel-worker-group-SQ5FRWOH.js → channel-worker-group-F2ZZMLNS.js} +8 -8
  27. package/chunks/{channel-worker-manager-TU4ZNWOE.js → channel-worker-manager-2SZLJJSJ.js} +18 -9
  28. package/chunks/{channel-worker-supervisor-EMITFMCP.js → channel-worker-supervisor-ZFNWMG6D.js} +6 -6
  29. package/chunks/{chunk-GNY7B3CA.js → chunk-2ALXPGB4.js} +1 -1
  30. package/chunks/{chunk-LUNC5KCL.js → chunk-2PJRI3EH.js} +7 -7
  31. package/chunks/{chunk-CLKE4IY3.js → chunk-2SZH22YO.js} +1 -1
  32. package/chunks/{chunk-RNAJVXUG.js → chunk-2ZN3O5FT.js} +6 -6
  33. package/chunks/{chunk-HIXUUCGY.js → chunk-36HCNKDS.js} +1 -1
  34. package/chunks/{chunk-FGHPZGOP.js → chunk-3BTSSIJO.js} +38 -54
  35. package/chunks/{chunk-VBLAI2HA.js → chunk-3FPYT6QC.js} +0 -31
  36. package/chunks/{chunk-QB3KS3N3.js → chunk-3I7W2POO.js} +1 -1
  37. package/chunks/{chunk-QTB4VP4K.js → chunk-3KQBQ6FM.js} +136 -11
  38. package/chunks/{chunk-JO77FGNZ.js → chunk-3UXUOFO6.js} +19 -7
  39. package/chunks/{chunk-WDN64MVT.js → chunk-3XLK2QMY.js} +82 -16
  40. package/chunks/chunk-532WHF4F.js +127 -0
  41. package/chunks/{chunk-NX7ZTXFF.js → chunk-53GWJOLP.js} +1 -1
  42. package/chunks/{chunk-QQK4L3UU.js → chunk-5GLDOLNQ.js} +131 -26
  43. package/chunks/{chunk-WK7P62DV.js → chunk-5KI7ZDTB.js} +6 -6
  44. package/chunks/{chunk-ERXNTINK.js → chunk-6JACAGYH.js} +1 -1
  45. package/chunks/{chunk-CMWU6P4D.js → chunk-6W4HBUA2.js} +1 -1
  46. package/chunks/{chunk-AUTUFD5X.js → chunk-76RGWKLS.js} +1 -1
  47. package/chunks/{chunk-PDN7FJZV.js → chunk-7APZIRH3.js} +2 -2
  48. package/chunks/{chunk-WBU2PIZ5.js → chunk-7BXXIQG4.js} +16 -16
  49. package/chunks/{chunk-APXIW2TF.js → chunk-7ICHPMBQ.js} +4 -4
  50. package/chunks/{chunk-CWVZBIZJ.js → chunk-7Q2AXRDJ.js} +1 -1
  51. package/chunks/{chunk-WDVV3LRM.js → chunk-7QYWGTHB.js} +1 -1
  52. package/chunks/{chunk-RM244SCQ.js → chunk-AC6KDLH3.js} +1 -1
  53. package/chunks/{chunk-2WC3Y7YY.js → chunk-AEY27Z35.js} +401 -23
  54. package/chunks/{chunk-XDNFODER.js → chunk-AXTFYDXT.js} +1 -1
  55. package/chunks/chunk-AYEJOTIU.js +43 -0
  56. package/chunks/{chunk-ZN5TKAVR.js → chunk-BV6Q5HMY.js} +3 -3
  57. package/chunks/{chunk-TOOOLHVS.js → chunk-BWAMMKIS.js} +3 -3
  58. package/chunks/{chunk-IRGDIDGJ.js → chunk-BWQLXU37.js} +26 -19
  59. package/chunks/{process-registry-OAEG6WGC.js → chunk-BYUAT5OC.js} +1 -0
  60. package/chunks/{chunk-GOEVQADN.js → chunk-BZM5U74J.js} +287 -169
  61. package/chunks/chunk-CF5KXZZX.js +150 -0
  62. package/chunks/{chunk-TGNNLRC3.js → chunk-CJ3DHN5I.js} +1 -0
  63. package/chunks/{chunk-PFKGV6PO.js → chunk-CUEXOHQH.js} +9 -9
  64. package/chunks/chunk-CXTPVBFA.js +937 -0
  65. package/chunks/{chunk-LEAOJ43M.js → chunk-DAWWT2ID.js} +62 -59
  66. package/chunks/{chunk-CALTQWTZ.js → chunk-DLH7YIX6.js} +2 -2
  67. package/chunks/chunk-DT75RKNH.js +691 -0
  68. package/chunks/{chunk-TRWQQBVH.js → chunk-DTNV6UZY.js} +1 -1
  69. package/chunks/{chunk-3OAXF3UK.js → chunk-DYFOSJHU.js} +3080 -933
  70. package/chunks/{chunk-GSFV5RQW.js → chunk-E4UEO3XM.js} +3 -2
  71. package/chunks/{chunk-A7EFXK7P.js → chunk-E7LB57MB.js} +5 -5
  72. package/chunks/{chunk-KEPC5BOL.js → chunk-EDMXGXAK.js} +9 -9
  73. package/chunks/chunk-ELRMZTPF.js +374 -0
  74. package/chunks/chunk-ERU3SDXT.js +27 -0
  75. package/chunks/{chunk-O2FEO2CB.js → chunk-EUURTIV6.js} +18 -2
  76. package/chunks/{chunk-QFJZAY7W.js → chunk-EVTNACMT.js} +3 -3
  77. package/chunks/{chunk-4HOEU2OR.js → chunk-EWJTAP3Y.js} +1 -19
  78. package/chunks/{chunk-YQGW3M6Z.js → chunk-F42YYSCK.js} +8 -8
  79. package/chunks/{chunk-7PD7ZMX5.js → chunk-FCQJLMA2.js} +98 -5
  80. package/chunks/{chunk-4VY3ITHR.js → chunk-FN3JNDRU.js} +3 -3
  81. package/chunks/{chunk-R457KFV7.js → chunk-GCDXVPFK.js} +3 -3
  82. package/chunks/{chunk-IR6JKBAP.js → chunk-GOXQL4YH.js} +2 -2
  83. package/chunks/{chunk-YLOHCA6I.js → chunk-GSILBZLN.js} +2 -2
  84. package/chunks/{chunk-LNYV4GXX.js → chunk-GSKX53AN.js} +0 -139
  85. package/chunks/{chunk-4WMGYG3F.js → chunk-HBQ2NXOU.js} +2 -2
  86. package/chunks/{chunk-F2NYVASI.js → chunk-HBU7EKY4.js} +14 -12
  87. package/chunks/{chunk-6G4V7SE4.js → chunk-HG46TTAG.js} +1 -1
  88. package/chunks/{chunk-G5VOXCRX.js → chunk-HGAELO7B.js} +2 -2
  89. package/chunks/{chunk-FETY36NQ.js → chunk-HGEUHUEV.js} +1 -1
  90. package/chunks/{chunk-E6TI726I.js → chunk-HUXPEUFL.js} +1 -1
  91. package/chunks/{chunk-LYT2OU7D.js → chunk-IAEXTMED.js} +1 -1
  92. package/chunks/{chunk-IW6RQPQB.js → chunk-IJOS26LH.js} +1 -3
  93. package/chunks/{chunk-ORFIYTI2.js → chunk-IK2MWJP5.js} +1 -1
  94. package/chunks/{chunk-WXD7INFV.js → chunk-IL5M5NYD.js} +8 -8
  95. package/chunks/{chunk-KA5HR3G2.js → chunk-IUVIBDKU.js} +2 -2
  96. package/chunks/{chunk-5DQ4YTIZ.js → chunk-IV7GDNKC.js} +1 -1
  97. package/chunks/chunk-JL6APGBX.js +43 -0
  98. package/chunks/{chunk-N6S3NUYJ.js → chunk-JXNIF2O5.js} +1 -1
  99. package/chunks/{chunk-DAI65CMX.js → chunk-JYKWOREU.js} +1 -1
  100. package/chunks/chunk-K2OJUPOE.js +78 -0
  101. package/chunks/{chunk-KFECPHLV.js → chunk-KFZYGSJN.js} +3 -3
  102. package/chunks/{chunk-BK7D2JR6.js → chunk-KOKPXIAN.js} +3 -3
  103. package/chunks/{chunk-4I3WFI3U.js → chunk-LDVNJZGH.js} +12 -12
  104. package/chunks/{chunk-WXFCI3O5.js → chunk-LG5Y4OWO.js} +2 -2
  105. package/chunks/{chunk-3LPJ776W.js → chunk-LILGKQ4B.js} +10 -7
  106. package/chunks/{chunk-X7LFJF5D.js → chunk-LK2WUCDQ.js} +36 -84
  107. package/chunks/{chunk-7LTCFO6T.js → chunk-MF6E7FSA.js} +6 -5
  108. package/chunks/{chunk-ELD3OBPU.js → chunk-MHAADZOZ.js} +3 -3
  109. package/chunks/{chunk-4JNHNVAZ.js → chunk-MLQNSPRZ.js} +4 -4
  110. package/chunks/{chunk-NPKCVSXX.js → chunk-MOS5OAOG.js} +10 -8
  111. package/chunks/{chunk-IWABUX6T.js → chunk-MSNHNAQZ.js} +6 -6
  112. package/chunks/{chunk-HJ5UJQQL.js → chunk-N7VWZDWW.js} +1699 -1312
  113. package/chunks/{chunk-NB3NDQQK.js → chunk-NE624IVP.js} +1 -1
  114. package/chunks/{chunk-SOA4HKRJ.js → chunk-NFYEQRLG.js} +2 -2
  115. package/chunks/{chunk-G3ZUMSFS.js → chunk-NHCZJQE4.js} +6 -6
  116. package/chunks/{chunk-B25JYXZE.js → chunk-NHJKAR6E.js} +4 -4
  117. package/chunks/{chunk-ZP5XDLSA.js → chunk-NJQTG2G3.js} +12 -12
  118. package/chunks/{chunk-DARWOZY6.js → chunk-NLNQNBZ2.js} +1 -1
  119. package/chunks/{chunk-CCBTNJB4.js → chunk-NMCDMLHL.js} +27 -27
  120. package/chunks/{chunk-AO2VMS72.js → chunk-NMRCXKQ5.js} +3 -3
  121. package/chunks/{chunk-5BH2AIEY.js → chunk-NOAG7N22.js} +2 -2
  122. package/chunks/{chunk-VJJXG73H.js → chunk-NRXWJXJ4.js} +15 -0
  123. package/chunks/chunk-NUQ4GK5I.js +315 -0
  124. package/chunks/{chunk-J3VZF2AL.js → chunk-NUQVB25K.js} +2 -2
  125. package/chunks/{chunk-U6REWGVR.js → chunk-OLTN767L.js} +2 -2
  126. package/chunks/{chunk-R3JIDRUL.js → chunk-OX7IZ2G5.js} +4 -4
  127. package/chunks/{chunk-QAZ2MGYT.js → chunk-PLLIWEM3.js} +2 -2
  128. package/chunks/{chunk-KCF2436G.js → chunk-POC3YMHG.js} +4 -4
  129. package/chunks/{chunk-HZ2HUXX7.js → chunk-Q2LVVIKF.js} +1 -1
  130. package/chunks/{chunk-7NDZKE2M.js → chunk-Q5BD56BW.js} +3 -3
  131. package/chunks/{chunk-22GORRNY.js → chunk-QMUYLYT5.js} +1 -1
  132. package/chunks/{chunk-MV5DTLJV.js → chunk-R4Q2PEFV.js} +1 -1
  133. package/chunks/{chunk-GOKAOSCN.js → chunk-RLLRJJDR.js} +1 -1
  134. package/chunks/{chunk-5OZUKLL7.js → chunk-RWVD5RRY.js} +4 -4
  135. package/chunks/{chunk-ULZECEIP.js → chunk-RZHU3K6M.js} +2 -2
  136. package/chunks/{chunk-UYDQYDW2.js → chunk-S6Q6Q4P2.js} +1 -1
  137. package/chunks/{chunk-PQEISIKS.js → chunk-SAH4BD2J.js} +0 -67
  138. package/chunks/{chunk-LWX4WDFF.js → chunk-SBRX4BDI.js} +43 -15
  139. package/chunks/{chunk-TODNHE76.js → chunk-SODMFNAR.js} +5 -5
  140. package/chunks/{chunk-FAJPLSYF.js → chunk-SSGAAWLY.js} +89 -85
  141. package/chunks/{chunk-46MMBZHI.js → chunk-SYLECP23.js} +4 -4
  142. package/chunks/{chunk-6RZX2HIH.js → chunk-TBEXLLAO.js} +2 -2
  143. package/chunks/{chunk-MWIO7MF6.js → chunk-TP6FYVQT.js} +2 -0
  144. package/chunks/{chunk-HRPFBHW7.js → chunk-TPKQIA7G.js} +1 -0
  145. package/chunks/{chunk-QHLHE2OT.js → chunk-TWUKBNWM.js} +1 -1
  146. package/chunks/{chunk-H3Q3RSKZ.js → chunk-U7O65WKL.js} +1 -1
  147. package/chunks/{chunk-S5QR6CB5.js → chunk-UKMWZ5NS.js} +108 -887
  148. package/chunks/{chunk-OXR34GCD.js → chunk-UKZ45TJL.js} +1851 -34
  149. package/chunks/{chunk-CALNF3Z3.js → chunk-V2P3DOQR.js} +1 -1
  150. package/chunks/{chunk-FV4DM2M4.js → chunk-VG3Q2NC4.js} +7 -7
  151. package/chunks/{chunk-QTNCGZHQ.js → chunk-VX63RJXE.js} +9 -0
  152. package/chunks/{chunk-CRZBDVP2.js → chunk-VZUCTJ2P.js} +4 -4
  153. package/chunks/{chunk-2BMXHB6N.js → chunk-W5FIP7FC.js} +7 -7
  154. package/chunks/{chunk-7VEYUF3N.js → chunk-W5ZQMAEM.js} +1 -1
  155. package/chunks/{chunk-XQ4RDO5B.js → chunk-WBCPROWX.js} +1 -1
  156. package/chunks/{chunk-JYGIJA4W.js → chunk-X6K77VHC.js} +1 -1
  157. package/chunks/{chunk-7SVM3RP2.js → chunk-X7UJKOHZ.js} +3 -3
  158. package/chunks/{chunk-WXPPUPHM.js → chunk-XBZTAGB7.js} +1 -1
  159. package/chunks/{chunk-TRQNRP2H.js → chunk-XGYHNWL3.js} +45 -2
  160. package/chunks/{chunk-2EKVPSIJ.js → chunk-Y2MYW47X.js} +1 -1
  161. package/chunks/{chunk-OFVAS4AR.js → chunk-YBUMTY7B.js} +1 -1
  162. package/chunks/{chunk-67XTVRVB.js → chunk-YQHLFCPU.js} +7 -7
  163. package/chunks/{chunk-G37O7YO6.js → chunk-Z3GF56ME.js} +2 -2
  164. package/chunks/{chunk-XBVNNDPK.js → chunk-ZHKTKHMO.js} +8 -1
  165. package/chunks/{chunk-OWCFKIFQ.js → chunk-ZKYR7QS4.js} +1 -1
  166. package/chunks/{chunk-YZTGGCEE.js → chunk-ZKZHSB5W.js} +1 -1
  167. package/chunks/{chunk-565U2ANU.js → chunk-ZTTC7T4X.js} +1 -1
  168. package/chunks/{chunk-XSOXPG2L.js → chunk-ZU47FBOC.js} +36 -7
  169. package/chunks/{chunk-7OCIQNKX.js → chunk-ZW2EUO2A.js} +1 -1
  170. package/chunks/{config-utils-GPLIABL2.js → config-utils-L6KLDYIV.js} +62 -55
  171. package/chunks/{contextCommand-NCUQUDBY.js → contextCommand-UYEH7NIU.js} +59 -52
  172. package/chunks/{core-runtime-WKYKWVYU.js → core-runtime-NVHT3Z3V.js} +61 -54
  173. package/chunks/{create-sub-session-TGIX63YU.js → create-sub-session-TIGCFGCS.js} +2 -2
  174. package/chunks/{create-sub-session-PPLXB3JJ.js → create-sub-session-YWASE5VH.js} +59 -52
  175. package/chunks/{cron-create-GTPVMJCF.js → cron-create-AKWX67FO.js} +1 -1
  176. package/chunks/{cron-delete-ZBK27Z4K.js → cron-delete-XPB6IYZJ.js} +1 -1
  177. package/chunks/{cron-list-KTFKFDKC.js → cron-list-XBKO4WU5.js} +1 -1
  178. package/chunks/{daemon-2CKIAO3I.js → daemon-G5TYKZD6.js} +2 -2
  179. package/chunks/{daemon-git-worktree-guard-73ZWOLKL.js → daemon-git-worktree-guard-FOW4RQSK.js} +60 -53
  180. package/chunks/{daemon-status-provider-OK7VONJG.js → daemon-status-provider-O5KQZYMP.js} +67 -60
  181. package/chunks/{daemon-trust-policy-CAUCREG2.js → daemon-trust-policy-3ATXEON7.js} +64 -57
  182. package/chunks/{daemon-trust-policy-monitor-3Y36OOEQ.js → daemon-trust-policy-monitor-7MCNDNEC.js} +64 -57
  183. package/chunks/{deferred-core-runtime-Q7WFWYD3.js → deferred-core-runtime-JK5IXL5K.js} +57 -50
  184. package/chunks/{display-image-CTNHJRZC.js → display-image-NAH3AZ63.js} +3 -3
  185. package/chunks/{dist-NP7QKLVG.js → dist-AHJYPSJL.js} +3 -3
  186. package/chunks/{dist-6YDUH3BB.js → dist-AIKC5E5P.js} +2 -2
  187. package/chunks/{dist-Y5KC3IHW.js → dist-F2DVGTL3.js} +225 -6
  188. package/chunks/{dist-BNQVF565.js → dist-GWNQVPZT.js} +5 -5
  189. package/chunks/{dist-F6JLAJLE.js → dist-H6G3K26N.js} +3 -3
  190. package/chunks/{dist-ZDNJK74R.js → dist-KJGRVIGJ.js} +2 -2
  191. package/chunks/{dist-F34J4FZX.js → dist-KLZ7XGEQ.js} +2 -2
  192. package/chunks/{dist-UFTFGI6I.js → dist-ZA52JXAS.js} +2 -2
  193. package/chunks/{dist-XLV33CLY.js → dist-ZXTZTE54.js} +2 -2
  194. package/chunks/{edit-YJD6IETK.js → edit-SY35KYIE.js} +45 -39
  195. package/chunks/{en-YJNRUQG4.js → en-CAJHTIQT.js} +1 -0
  196. package/chunks/{enter-worktree-YFTKHXHZ.js → enter-worktree-54L5QJ3N.js} +4 -4
  197. package/chunks/{enterPlanMode-EFPVTWIH.js → enterPlanMode-HXX6KQJR.js} +42 -36
  198. package/chunks/{environment-HP3AXFTB.js → environment-DKXHG4HB.js} +60 -53
  199. package/chunks/{errors-22ON46G7.js → errors-ADY7LQJJ.js} +59 -52
  200. package/chunks/{exit-worktree-NF2XEMES.js → exit-worktree-EORJDKDS.js} +4 -4
  201. package/chunks/{exitPlanMode-MOQUNCBH.js → exitPlanMode-HSK2CQI6.js} +42 -36
  202. package/chunks/{fast-path-2X7BPMXX.js → fast-path-U636VWN2.js} +6 -6
  203. package/chunks/{fast-path-settings-SATXY3PD.js → fast-path-settings-V7MI7EZJ.js} +2 -2
  204. package/chunks/{glob-Y7ACIB3P.js → glob-GUGGTH5L.js} +45 -39
  205. package/chunks/{goal-tools-DABMICUC.js → goal-tools-PXYRSQGX.js} +42 -36
  206. package/chunks/{grep-BLHF2S5D.js → grep-3PKFKLCA.js} +2 -2
  207. package/chunks/{handleAutoUpdate-MCAMHYDI.js → handleAutoUpdate-5KHS4HIN.js} +60 -53
  208. package/chunks/{i18n-C3GDCALP.js → i18n-KSGKMUPT.js} +58 -51
  209. package/chunks/{image-gen-XP4NNIYG.js → image-gen-OCCR2WWU.js} +5 -4
  210. package/chunks/{initializer-4URDQL2G.js → initializer-YYT5XEZF.js} +64 -57
  211. package/chunks/{installationInfo-LBOL6SBV.js → installationInfo-UNSBPYW2.js} +57 -50
  212. package/chunks/{list-JOGBAC2R.js → list-YL6LDQKQ.js} +67 -60
  213. package/chunks/{list-agents-2CXPGJUE.js → list-agents-QLDXS5OD.js} +17 -7
  214. package/chunks/{llm-2KPNSAVY.js → llm-XGGLBGPH.js} +126 -119
  215. package/chunks/{llm-content-generator-GR3FOHLB.js → llm-content-generator-ZHQQT5W7.js} +5 -4
  216. package/chunks/{loadedSettingsAdapter-DVKROEJD.js → loadedSettingsAdapter-3DXLASK7.js} +64 -57
  217. package/chunks/{loggingContentGenerator-P4K6K5W4.js → loggingContentGenerator-V72OCCJO.js} +64 -57
  218. package/chunks/{loop-wakeup-HL6XOWI4.js → loop-wakeup-HHMYIC7Z.js} +2 -2
  219. package/chunks/{ls-YV7RKLKY.js → ls-N7ABR6HI.js} +4 -4
  220. package/chunks/{lsp-NO3AMRZT.js → lsp-LTOFWG5P.js} +1 -1
  221. package/chunks/{managed-npm-update-VWBKHNIN.js → managed-npm-update-HV5LPZH2.js} +57 -50
  222. package/chunks/{mcp-6YYNSYLK.js → mcp-IYVSIW6O.js} +64 -57
  223. package/chunks/{monitor-A255TNZR.js → monitor-TLBNM4MV.js} +44 -38
  224. package/chunks/{nonInteractiveCli-LXGIKQAT.js → nonInteractiveCli-LSJSQ2W4.js} +110 -103
  225. package/chunks/{notebook-edit-5UYHS2DM.js → notebook-edit-OSPOLZP6.js} +43 -37
  226. package/chunks/openai-WX26N5OJ.js +47 -0
  227. package/chunks/{openaiContentGenerator-A6MAMEO5.js → openaiContentGenerator-BE4S5TRD.js} +29 -23
  228. package/chunks/openaiResponsesContentGenerator-RTCAJ5V5.js +1658 -0
  229. package/chunks/{pidfile-B7DZC4TP.js → pidfile-H32FEPWA.js} +57 -50
  230. package/chunks/process-registry-X6ZCASEN.js +10 -0
  231. package/chunks/{processUtils-BPZ2MCZS.js → processUtils-SSLIPDEA.js} +2 -2
  232. package/chunks/{prompt-terminal-ledger-FYYTAOXS.js → prompt-terminal-ledger-I5SLL6UF.js} +58 -51
  233. package/chunks/{qwenContentGenerator-4IOJFD4S.js → qwenContentGenerator-TMQC623Z.js} +55 -47
  234. package/chunks/{qwenOAuth2-KX6LVYQ3.js → qwenOAuth2-3ZRQHHTC.js} +4 -3
  235. package/chunks/{read-file-A4H4O3VQ.js → read-file-T2QAIZE2.js} +11 -9
  236. package/chunks/{read-mcp-resource-D3N75DGF.js → read-mcp-resource-B37WANAQ.js} +1 -1
  237. package/chunks/{record-artifact-Q5CRGJTP.js → record-artifact-OAXWXZ5D.js} +2 -2
  238. package/chunks/record-source-D7R7X3GT.js +22 -0
  239. package/chunks/{report-findings-TJ34R7QK.js → report-findings-AR3VC6EQ.js} +3 -3
  240. package/chunks/{request-shutdown-LRKMTBAD.js → request-shutdown-IKNWTX5M.js} +5 -5
  241. package/chunks/{resumeHistoryUtils-YQQ43E4N.js → resumeHistoryUtils-QLKDH5GY.js} +63 -56
  242. package/chunks/{ripGrep-W32NWFTA.js → ripGrep-YGWL7KCV.js} +15 -13
  243. package/chunks/{run-qwen-serve-WBSWWIRV.js → run-qwen-serve-26KZDECC.js} +127 -102
  244. package/chunks/{runtime-VRVBX2E5.js → runtime-BMEIVDDG.js} +70 -63
  245. package/chunks/{scheduled-tasks-D65KJDA3.js → scheduled-tasks-NCFPP6VQ.js} +64 -57
  246. package/chunks/{scheduler-M2YPN7Z7.js → scheduler-47TVMUVN.js} +59 -52
  247. package/chunks/{sdk-exporters-grpc-MXTVSE3C.js → sdk-exporters-grpc-Y2ZUQDUQ.js} +2 -2
  248. package/chunks/{sdk-exporters-http-7R2ARBPV.js → sdk-exporters-http-VWTF4W6K.js} +3 -3
  249. package/chunks/{sdk-impl-YOLO7LV4.js → sdk-impl-G6FVTBQZ.js} +9 -9
  250. package/chunks/{send-message-76BKWKFZ.js → send-message-TWOGWCBG.js} +12 -9
  251. package/chunks/{serve-BE3H2P6P.js → serve-KL3G6LQQ.js} +64 -57
  252. package/chunks/{server-FLY5JERG.js → server-LBPYXZ5G.js} +2931 -518
  253. package/chunks/{session-JVN62R5K.js → session-YG6742LO.js} +118 -111
  254. package/chunks/{session-attachments-root-7ACGLHXA.js → session-attachments-root-OUBQDYC4.js} +57 -50
  255. package/chunks/{session-pr-refresh-TQS57SDK.js → session-pr-refresh-EKGMYNAW.js} +64 -57
  256. package/chunks/{settings-D44YMZFT.js → settings-DDNHJX2L.js} +69 -62
  257. package/chunks/{shell-3VE6I4V5.js → shell-KUCXWITU.js} +42 -36
  258. package/chunks/{skill-FHEGRRZU.js → skill-JQLKPNWZ.js} +33 -23
  259. package/chunks/{skill-settings-VHEJMBFL.js → skill-settings-XERQCUXZ.js} +63 -56
  260. package/chunks/{spawnChannel-T6MX2ZDN.js → spawnChannel-GQ45QFGB.js} +60 -53
  261. package/chunks/{standalone-update-QUGHFMCS.js → standalone-update-PRF3ILGZ.js} +59 -52
  262. package/chunks/{start-opentui-ui-IHIIZ2LE.js → start-opentui-ui-JDSOZE3N.js} +174 -157
  263. package/chunks/{startInteractiveUI-LR7K2ARZ.js → startInteractiveUI-RRW3JVHN.js} +533 -1119
  264. package/chunks/{syntheticOutput-D2P5V6RG.js → syntheticOutput-F6F27JMK.js} +2 -2
  265. package/chunks/{task-create-MWXJFRRM.js → task-create-Y623TBHB.js} +8 -8
  266. package/chunks/{task-list-EYO3FE57.js → task-list-FCPEEGWL.js} +1 -1
  267. package/chunks/{task-stop-BFSKRTGV.js → task-stop-QTKZXLPH.js} +1 -1
  268. package/chunks/{task-update-2JJJRHMT.js → task-update-YLSXF25N.js} +8 -8
  269. package/chunks/{team-create-GY3VFY47.js → team-create-5DRLOLOE.js} +44 -38
  270. package/chunks/{team-delete-IQZ6XGFI.js → team-delete-S7TLHZCF.js} +1 -1
  271. package/chunks/{team-plan-approval-BQPGZOT5.js → team-plan-approval-MWSGAL5T.js} +42 -36
  272. package/chunks/{terminal-image-renderer-YNYW5CQG.js → terminal-image-renderer-H7PD4FQW.js} +59 -52
  273. package/chunks/{theme-manager-U6CIK3GM.js → theme-manager-7AV73D6R.js} +57 -50
  274. package/chunks/{todoWrite-5ERKFWAK.js → todoWrite-5QI2H2FW.js} +4 -4
  275. package/chunks/{tool-search-XI3QWD5I.js → tool-search-UGYTBLUV.js} +17 -15
  276. package/chunks/{total-session-admission-3SNSJJ32.js → total-session-admission-JIHSTJ5S.js} +62 -55
  277. package/chunks/{trustedFolders-OVAQKNV5.js → trustedFolders-5VCBXFOP.js} +58 -51
  278. package/chunks/{update-relaunch-XV5O74E3.js → update-relaunch-4LF3APCV.js} +5 -5
  279. package/chunks/{updateCheck-CHUYWD6L.js → updateCheck-4T3WUE5F.js} +59 -52
  280. package/chunks/{useAutoAcceptIndicator-VKSVIXZC.js → useAutoAcceptIndicator-UMGB64Z6.js} +67 -60
  281. package/chunks/{validateNonInterActiveAuth-ZNUTD3E5.js → validateNonInterActiveAuth-GFJ72U2C.js} +107 -100
  282. package/chunks/{version-EK7VAGSI.js → version-EAAZN4T2.js} +1 -1
  283. package/chunks/{web-fetch-24KZO763.js → web-fetch-VRU3A2NI.js} +13 -11
  284. package/chunks/{web-search-CRNXKZ2X.js → web-search-NEGYQNDJ.js} +14 -10
  285. package/chunks/{web-shell-static-BFDESDD4.js → web-shell-static-CCN4JZEE.js} +1 -1
  286. package/chunks/workflow-UHPFALVZ.js +1224 -0
  287. package/chunks/{workspace-providers-status-MAM42IZS.js → workspace-providers-status-AEYISSU2.js} +68 -61
  288. package/chunks/{workspace-registration-store-HKLJEDQX.js → workspace-registration-store-A7RGKW62.js} +3 -1
  289. package/chunks/{workspace-registry-7RDDOBLN.js → workspace-registry-C2NGE6SD.js} +62 -55
  290. package/chunks/{workspace-runtime-coordinator-LEPDPXJO.js → workspace-runtime-coordinator-QKMZ24YF.js} +63 -56
  291. package/chunks/{workspace-service-5IFDCNN3.js → workspace-service-RQTTAGGC.js} +70 -63
  292. package/chunks/{workspace-skills-status-FJ3HNH4H.js → workspace-skills-status-5HWZU3HX.js} +65 -58
  293. package/chunks/{workspace-trust-reconciler-PQFHIWLR.js → workspace-trust-reconciler-KFWATZUU.js} +69 -62
  294. package/chunks/{write-file-ERG67ZFX.js → write-file-DPVB2SBQ.js} +44 -38
  295. package/chunks/{zh-VBFCRQBL.js → zh-S5V3Z5CR.js} +1 -0
  296. package/chunks/{zh-TW-N2TBF2F2.js → zh-TW-2K2WRFPY.js} +1 -0
  297. package/chunks/{zoom-image-WQYEC3SR.js → zoom-image-S7AWLAPC.js} +12 -10
  298. package/cli.js +13 -13
  299. package/export-transcript-document.css +1 -0
  300. package/export-transcript-document.js +164 -165
  301. package/locales/en.js +1 -0
  302. package/locales/zh-TW.js +1 -0
  303. package/locales/zh.js +1 -0
  304. package/package.json +5 -4
  305. package/web-shell/assets/{abnfDiagram-VCTEODGH-BRLgQbnT.js → abnfDiagram-VCTEODGH-nU24rpIE.js} +1 -1
  306. package/web-shell/assets/{arc-qAF9_XsR.js → arc-D1hTu8QI.js} +1 -1
  307. package/web-shell/assets/{architectureDiagram-5GKGNRK7-BorUttEz.js → architectureDiagram-5GKGNRK7-B_fgkKe7.js} +1 -1
  308. package/web-shell/assets/{blockDiagram-NRAW4CY4-Bj0qZVxu.js → blockDiagram-NRAW4CY4-C3pddUNg.js} +1 -1
  309. package/web-shell/assets/{c4Diagram-UCG6FXSJ-BTqJis32.js → c4Diagram-UCG6FXSJ-kEFoC1ei.js} +1 -1
  310. package/web-shell/assets/channel-Blod4z1X.js +1 -0
  311. package/web-shell/assets/{chunk-2Q5K7J3B-RrQ5X8m-.js → chunk-2Q5K7J3B-DbT9wS7j.js} +1 -1
  312. package/web-shell/assets/{chunk-5VM5RSS4-uUjDl8wO.js → chunk-5VM5RSS4-CNbULt6O.js} +1 -1
  313. package/web-shell/assets/{chunk-F27PBJKO-C3JhpyzI.js → chunk-F27PBJKO-CbQRy4Tb.js} +1 -1
  314. package/web-shell/assets/{chunk-G27WJ6UU-C8ZNFs7F.js → chunk-G27WJ6UU-CVbXTxYk.js} +1 -1
  315. package/web-shell/assets/{chunk-JWPE2WC7-DNpXtEOs.js → chunk-JWPE2WC7-D89c_BXy.js} +1 -1
  316. package/web-shell/assets/{chunk-LCL6LL3I-DagA2ZLw.js → chunk-LCL6LL3I-B7-I_9KB.js} +1 -1
  317. package/web-shell/assets/{chunk-POPQ4Y6H-R23uH7Xm.js → chunk-POPQ4Y6H-DcLQFzS4.js} +1 -1
  318. package/web-shell/assets/{chunk-SVP7TREG-Qz9RN_BR.js → chunk-SVP7TREG-DyBb2Axj.js} +1 -1
  319. package/web-shell/assets/{chunk-XXDRQBXY-jYb1_hni.js → chunk-XXDRQBXY-BIA0eb5B.js} +1 -1
  320. package/web-shell/assets/classDiagram-DTDB5LWJ-D6hFDMqb.js +1 -0
  321. package/web-shell/assets/classDiagram-v2-JRS7N3AN-D6hFDMqb.js +1 -0
  322. package/web-shell/assets/{cose-bilkent-JH36ORCC-Cv2OunpE.js → cose-bilkent-JH36ORCC-Db2FYN85.js} +1 -1
  323. package/web-shell/assets/{cynefin-OW5HDTMX-LH42KFJx.js → cynefin-OW5HDTMX-i4GwmBVy.js} +1 -1
  324. package/web-shell/assets/{cynefinDiagram-5FMLGOSQ-Dha4_OoR.js → cynefinDiagram-5FMLGOSQ-LENf_IUy.js} +1 -1
  325. package/web-shell/assets/{dagre-3AP2YEHR-Br5lnUKD.js → dagre-3AP2YEHR-CF9XVrD9.js} +1 -1
  326. package/web-shell/assets/{diagram-S7CK7UJ4-dpKq2bBX.js → diagram-S7CK7UJ4-DD5PJfSm.js} +1 -1
  327. package/web-shell/assets/{diagram-UQ7AKVKN-BAgHWpXr.js → diagram-UQ7AKVKN-CjD_sBMj.js} +1 -1
  328. package/web-shell/assets/{diagram-VSXAHHWV-GRRzpyE2.js → diagram-VSXAHHWV-U5WwMqyA.js} +1 -1
  329. package/web-shell/assets/{diagram-VX7I27RA-BNFiaYpG.js → diagram-VX7I27RA-BujpHJJf.js} +1 -1
  330. package/web-shell/assets/{diagram-Z3DM3KII-BisZzB_h.js → diagram-Z3DM3KII-3ZLtKEXo.js} +1 -1
  331. package/web-shell/assets/{ebnfDiagram-PWID7BFC-B1xbwycf.js → ebnfDiagram-PWID7BFC-BGpiquRm.js} +1 -1
  332. package/web-shell/assets/{erDiagram-SSCWMZ5O-CQMzbGE5.js → erDiagram-SSCWMZ5O-D0besu_U.js} +1 -1
  333. package/web-shell/assets/{flowDiagram-A5DVABFB-CZ_Zondl.js → flowDiagram-A5DVABFB-9DwDuIyr.js} +1 -1
  334. package/web-shell/assets/{ganttDiagram-EL5Y4UJY-BTh2ShxS.js → ganttDiagram-EL5Y4UJY-CNlsAeNr.js} +1 -1
  335. package/web-shell/assets/{gitGraphDiagram-WWUBYQGX-oHOB-Uxt.js → gitGraphDiagram-WWUBYQGX-C_pPFiTR.js} +1 -1
  336. package/web-shell/assets/{index-DWoFMu5x.js → index-BYWs4JWq.js} +1 -1
  337. package/web-shell/assets/index-D3YS6KuJ.js +2173 -0
  338. package/web-shell/assets/index-eBxK3rs2.css +36 -0
  339. package/web-shell/assets/{infoDiagram-RXCK75RN-C0QpudbG.js → infoDiagram-RXCK75RN-Bpai64Ll.js} +1 -1
  340. package/web-shell/assets/{ishikawaDiagram-5VMMS53U-a6B741uT.js → ishikawaDiagram-5VMMS53U-ktpJFq4r.js} +1 -1
  341. package/web-shell/assets/{journeyDiagram-EYS64GPL-Dbht9ICp.js → journeyDiagram-EYS64GPL-iz_DKgFX.js} +1 -1
  342. package/web-shell/assets/{kanban-definition-3QL26DDD-D4OFR8-h.js → kanban-definition-3QL26DDD-m_gG00Yt.js} +1 -1
  343. package/web-shell/assets/{layout-Dvdh5jRH.js → layout-qEvKgnvU.js} +1 -1
  344. package/web-shell/assets/{linear-Dvc6KIW2.js → linear-C6lklGdq.js} +1 -1
  345. package/web-shell/assets/{mermaid.core-CB36RfIb.js → mermaid.core-DSCYB_2P.js} +6 -6
  346. package/web-shell/assets/{mindmap-definition-FBJOCRG2-Fmqo1CjP.js → mindmap-definition-FBJOCRG2-DRQbT8w-.js} +1 -1
  347. package/web-shell/assets/{pegDiagram-XKGWAZYB-CCxYBoA4.js → pegDiagram-XKGWAZYB-BhD0q0i6.js} +1 -1
  348. package/web-shell/assets/{pieDiagram-E7YTZNPT-BVHKQFzt.js → pieDiagram-E7YTZNPT-BvIGQCSd.js} +1 -1
  349. package/web-shell/assets/{quadrantDiagram-AXDQQJYC-l95IznwR.js → quadrantDiagram-AXDQQJYC-BDQtfpU-.js} +1 -1
  350. package/web-shell/assets/{railroadDiagram-O6MQD6OU-BlLdRdXp.js → railroadDiagram-O6MQD6OU-E1g2KIFK.js} +1 -1
  351. package/web-shell/assets/{requirementDiagram-EFPCY7ZU-BkDLBR5w.js → requirementDiagram-EFPCY7ZU-CuerYJOe.js} +1 -1
  352. package/web-shell/assets/{sankeyDiagram-P5KCCOFB-jAIqRp65.js → sankeyDiagram-P5KCCOFB-CqWyCZGA.js} +1 -1
  353. package/web-shell/assets/{sequenceDiagram-WJ2MYXX4-f-soZYPr.js → sequenceDiagram-WJ2MYXX4-B-YWb8x4.js} +1 -1
  354. package/web-shell/assets/{sizeCapture-X5ZJPWSS-BzOuAfB2.js → sizeCapture-X5ZJPWSS-BB7YY4Tl.js} +1 -1
  355. package/web-shell/assets/{stateDiagram-HBIQ2CUA-BPLSs12r.js → stateDiagram-HBIQ2CUA-C8LDpNHS.js} +1 -1
  356. package/web-shell/assets/stateDiagram-v2-4QOOHH4V-C4CbdvGa.js +1 -0
  357. package/web-shell/assets/{swimlanes-XN3QIQJK-D-9E_RIR.js → swimlanes-XN3QIQJK-D94vOoxZ.js} +1 -1
  358. package/web-shell/assets/swimlanesDiagram-VK2B7HYN--QNSIOC8.js +8 -0
  359. package/web-shell/assets/{timeline-definition-24CTP7MA-CT56K-gV.js → timeline-definition-24CTP7MA-C9C8uEYm.js} +1 -1
  360. package/web-shell/assets/{vennDiagram-4TSXK5OY-B-vi4IyO.js → vennDiagram-4TSXK5OY-CYzMHbVW.js} +1 -1
  361. package/web-shell/assets/{wardleyDiagram-VM6X3IG4-C9O7Ju98.js → wardleyDiagram-VM6X3IG4-G9nhtLES.js} +1 -1
  362. package/web-shell/assets/{xychartDiagram-S5SC5T6Z-6d8w3jg2.js → xychartDiagram-S5SC5T6Z-ruD2Wjhg.js} +1 -1
  363. package/web-shell/index.html +29 -5
  364. package/chunks/chunk-V7RNNPGC.js +0 -44
  365. package/chunks/workflow-HD5NYMW5.js +0 -2907
  366. package/web-shell/assets/channel-COIuCrVH.js +0 -1
  367. package/web-shell/assets/classDiagram-DTDB5LWJ-DoX6OYqu.js +0 -1
  368. package/web-shell/assets/classDiagram-v2-JRS7N3AN-DoX6OYqu.js +0 -1
  369. package/web-shell/assets/index-CI1ysIEv.js +0 -2154
  370. package/web-shell/assets/index-CpxXGH-8.css +0 -36
  371. package/web-shell/assets/stateDiagram-v2-4QOOHH4V-IRul-LaT.js +0 -1
  372. package/web-shell/assets/swimlanesDiagram-VK2B7HYN-D6lgKepA.js +0 -8
  373. /package/chunks/{chunk-JA5CBKRP.js → chunk-7NXSVSFB.js} +0 -0
@@ -0,0 +1,919 @@
1
+ // Force strict mode and setup for ESM
2
+ "use strict";
3
+ import {
4
+ ProcessRegistry
5
+ } from "./chunk-BYUAT5OC.js";
6
+ import {
7
+ createStderrForwarder
8
+ } from "./chunk-IUVIBDKU.js";
9
+ import "./chunk-HGEUHUEV.js";
10
+ import "./chunk-M5GB774H.js";
11
+ import "./chunk-3VUENPWF.js";
12
+ import {
13
+ ClientSideConnection,
14
+ PROTOCOL_VERSION,
15
+ RequestError,
16
+ ndJsonStream
17
+ } from "./chunk-IJOS26LH.js";
18
+ import "./chunk-BZM5U74J.js";
19
+ import "./chunk-GELRJXE2.js";
20
+ import "./chunk-32CM56LO.js";
21
+ import "./chunk-AEY27Z35.js";
22
+ import "./chunk-Y2MYW47X.js";
23
+ import "./chunk-LJZSMWOH.js";
24
+ import "./chunk-F42YYSCK.js";
25
+ import "./chunk-NUQVB25K.js";
26
+ import "./chunk-ZKZHSB5W.js";
27
+ import "./chunk-MSNHNAQZ.js";
28
+ import "./chunk-DJXSOEFB.js";
29
+ import "./chunk-ZKYR7QS4.js";
30
+ import "./chunk-532WHF4F.js";
31
+ import "./chunk-BUQN5LTI.js";
32
+ import "./chunk-ZPJWUGCS.js";
33
+ import "./chunk-LK2WUCDQ.js";
34
+ import "./chunk-UKZ45TJL.js";
35
+ import "./chunk-RLLRJJDR.js";
36
+ import {
37
+ AgentEventEmitter,
38
+ renderSubagentSystemPrompt
39
+ } from "./chunk-N7VWZDWW.js";
40
+ import "./chunk-GOFAQQZA.js";
41
+ import "./chunk-TWPJO254.js";
42
+ import "./chunk-CQ35AJ4Z.js";
43
+ import {
44
+ sanitizeChildEnv
45
+ } from "./chunk-65I7S4Z3.js";
46
+ import "./chunk-6HUXPLB5.js";
47
+ import "./chunk-7CLLH5TI.js";
48
+ import "./chunk-XKBFYTCD.js";
49
+ import "./chunk-ZTTC7T4X.js";
50
+ import "./chunk-E4UEO3XM.js";
51
+ import "./chunk-IAEXTMED.js";
52
+ import "./chunk-IRH27ZC2.js";
53
+ import "./chunk-QHWCP53L.js";
54
+ import "./chunk-F53KKZUD.js";
55
+ import "./chunk-O6GEWCJA.js";
56
+ import "./chunk-36HCNKDS.js";
57
+ import "./chunk-6PVPNMXU.js";
58
+ import "./chunk-2SZH22YO.js";
59
+ import "./chunk-DTNV6UZY.js";
60
+ import "./chunk-QJNDUTOL.js";
61
+ import "./chunk-JXNIF2O5.js";
62
+ import "./chunk-NFYEQRLG.js";
63
+ import "./chunk-ELRMZTPF.js";
64
+ import "./chunk-CHEIIBT3.js";
65
+ import "./chunk-PLLIWEM3.js";
66
+ import "./chunk-5GLDOLNQ.js";
67
+ import "./chunk-CH2YDT6X.js";
68
+ import "./chunk-JX6XHPTX.js";
69
+ import "./chunk-ZSTCM3MX.js";
70
+ import "./chunk-MLXTMF7H.js";
71
+ import "./chunk-LILGKQ4B.js";
72
+ import "./chunk-3CZ2BQV6.js";
73
+ import "./chunk-SAH4BD2J.js";
74
+ import "./chunk-CXTPVBFA.js";
75
+ import "./chunk-U7O65WKL.js";
76
+ import "./chunk-S6LOFUVP.js";
77
+ import "./chunk-FN3JNDRU.js";
78
+ import "./chunk-EUURTIV6.js";
79
+ import "./chunk-G6UUOCUT.js";
80
+ import "./chunk-IZ2U57NY.js";
81
+ import "./chunk-NUQ4GK5I.js";
82
+ import "./chunk-K2OJUPOE.js";
83
+ import "./chunk-AXTFYDXT.js";
84
+ import "./chunk-NAVJD2PQ.js";
85
+ import "./chunk-YBUMTY7B.js";
86
+ import "./chunk-HNLMYDQE.js";
87
+ import "./chunk-QHMLYMMS.js";
88
+ import "./chunk-VNOVK4I7.js";
89
+ import "./chunk-CFKIH3D3.js";
90
+ import "./chunk-JL6APGBX.js";
91
+ import "./chunk-DJ2GSRLV.js";
92
+ import "./chunk-4ALNJDHL.js";
93
+ import "./chunk-NOO4QFXM.js";
94
+ import "./chunk-KFFCDLKV.js";
95
+ import "./chunk-ZW2EUO2A.js";
96
+ import "./chunk-HBU7EKY4.js";
97
+ import "./chunk-5ETULJLP.js";
98
+ import "./chunk-ZHKTKHMO.js";
99
+ import "./chunk-VGC4I5JJ.js";
100
+ import "./chunk-EDIDYZBT.js";
101
+ import "./chunk-HD7O6WLV.js";
102
+ import "./chunk-J6MB5ZHZ.js";
103
+ import "./chunk-WZAD4ZNJ.js";
104
+ import "./chunk-3FPYT6QC.js";
105
+ import "./chunk-FPGTNKCP.js";
106
+ import "./chunk-TIGXX4PA.js";
107
+ import "./chunk-3UXUOFO6.js";
108
+ import "./chunk-XFFRI3WM.js";
109
+ import "./chunk-ERU3SDXT.js";
110
+ import "./chunk-EWJTAP3Y.js";
111
+ import "./chunk-HHJLM3WQ.js";
112
+ import "./chunk-W5ZQMAEM.js";
113
+ import "./chunk-74TONY4F.js";
114
+ import "./chunk-HUXPEUFL.js";
115
+ import "./chunk-TP6FYVQT.js";
116
+ import {
117
+ createDebugLogger
118
+ } from "./chunk-ZAFYHRVY.js";
119
+ import "./chunk-TBWQLLFO.js";
120
+ import "./chunk-UKMWZ5NS.js";
121
+ import "./chunk-75DOP5OR.js";
122
+ import "./chunk-DMTGGOSA.js";
123
+ import "./chunk-YQ3U5MUC.js";
124
+ import "./chunk-MATEIJZF.js";
125
+ import {
126
+ init_esbuild_shims
127
+ } from "./chunk-5O2XNYP6.js";
128
+ import {
129
+ __name
130
+ } from "./chunk-J2S4EL5Y.js";
131
+
132
+ // packages/cli/src/external-agents/acp-subagent-executor.ts
133
+ init_esbuild_shims();
134
+ import { spawn } from "node:child_process";
135
+ import { Readable, Writable } from "node:stream";
136
+
137
+ // packages/core/src/subagent-runtime.ts
138
+ init_esbuild_shims();
139
+
140
+ // packages/cli/src/external-agents/acp-subagent-executor.ts
141
+ var INIT_TIMEOUT_MS = 1e4;
142
+ var debugLogger = createDebugLogger("EXTERNAL_AGENT");
143
+ function externalModelLabel(command) {
144
+ return `external-acp:${command.split(/[\\/]/).pop() ?? command}`;
145
+ }
146
+ __name(externalModelLabel, "externalModelLabel");
147
+ function isRecord(value) {
148
+ return typeof value === "object" && value !== null && !Array.isArray(value);
149
+ }
150
+ __name(isRecord, "isRecord");
151
+ var EXTERNAL_ACTION_PROMPT_MAX = 300;
152
+ function stripControlChars(value) {
153
+ let out = "";
154
+ for (const ch of value) {
155
+ const code = ch.codePointAt(0) ?? 0;
156
+ out += code >= 32 && code !== 127 && !(code >= 128 && code <= 159) ? ch : " ";
157
+ }
158
+ return out;
159
+ }
160
+ __name(stripControlChars, "stripControlChars");
161
+ function describeExternalAction(toolCall) {
162
+ const title = stripControlChars(
163
+ toolCall.title ?? toolCall.kind ?? "External action"
164
+ );
165
+ const raw = toolCall.rawInput;
166
+ if (!isRecord(raw)) return title;
167
+ const detail = stripControlChars(JSON.stringify(raw));
168
+ const rendered = `${title}: ${detail}`;
169
+ return rendered.length > EXTERNAL_ACTION_PROMPT_MAX ? `${rendered.slice(0, EXTERNAL_ACTION_PROMPT_MAX)}\u2026` : rendered;
170
+ }
171
+ __name(describeExternalAction, "describeExternalAction");
172
+ function assertExternalAgentSpawnPlatformSupported(platform = process.platform) {
173
+ if (platform === "win32") {
174
+ throw new Error(
175
+ "External ACP agents are not supported on Windows in this release: the executor spawn is POSIX-only. An npm-installed adapter resolves to a `.cmd` launcher that cannot be spawned without a shell, and the process-tree reaping is POSIX-specific. Run the external agent on macOS/Linux (or WSL). Windows support is a tracked follow-up."
176
+ );
177
+ }
178
+ }
179
+ __name(assertExternalAgentSpawnPlatformSupported, "assertExternalAgentSpawnPlatformSupported");
180
+ function resolvePermissionMode(permissionMode, approvalMode) {
181
+ switch ((approvalMode ?? permissionMode ?? "").trim().toLowerCase()) {
182
+ case "auto":
183
+ case "acceptedits":
184
+ case "auto-edit":
185
+ return "acceptEdits";
186
+ case "plan":
187
+ return "plan";
188
+ case "bypasspermissions":
189
+ case "bypass":
190
+ case "yolo":
191
+ return "bypass";
192
+ default:
193
+ return "default";
194
+ }
195
+ }
196
+ __name(resolvePermissionMode, "resolvePermissionMode");
197
+ var POLICY_MODE_ALIASES = {
198
+ bypass: ["bypassPermissions", "yolo"],
199
+ acceptEdits: ["acceptEdits", "auto-edit", "auto"],
200
+ plan: ["plan"],
201
+ default: ["default"]
202
+ };
203
+ function selectPeerModeId(policy, availableModeIds) {
204
+ return POLICY_MODE_ALIASES[policy].find(
205
+ (id) => availableModeIds.includes(id)
206
+ );
207
+ }
208
+ __name(selectPeerModeId, "selectPeerModeId");
209
+ function optionKindForOutcome(outcome) {
210
+ switch (outcome) {
211
+ case "proceed_once" /* ProceedOnce */:
212
+ case "proceed_once_and_switch_to_default" /* ProceedOnceAndSwitchToDefault */:
213
+ return "allow_once";
214
+ case "proceed_always" /* ProceedAlways */:
215
+ case "proceed_always_server" /* ProceedAlwaysServer */:
216
+ case "proceed_always_tool" /* ProceedAlwaysTool */:
217
+ case "proceed_always_project" /* ProceedAlwaysProject */:
218
+ case "proceed_always_user" /* ProceedAlwaysUser */:
219
+ return "allow_always";
220
+ case "modify_with_editor" /* ModifyWithEditor */:
221
+ case "cancel" /* Cancel */:
222
+ case "restore_previous" /* RestorePrevious */:
223
+ return "reject_once";
224
+ default: {
225
+ const exhaustive = outcome;
226
+ void exhaustive;
227
+ return "reject_once";
228
+ }
229
+ }
230
+ }
231
+ __name(optionKindForOutcome, "optionKindForOutcome");
232
+ function selectPermissionOption(options, outcome) {
233
+ if (outcome === "cancel" /* Cancel */) return void 0;
234
+ if (new Set(options.map((option) => option.optionId)).size !== options.length) {
235
+ return void 0;
236
+ }
237
+ const kind = optionKindForOutcome(outcome);
238
+ return (options.find((option) => option.kind === kind) ?? (kind === "allow_always" ? options.find((option) => option.kind === "allow_once") : void 0) ?? options.find((option) => option.kind === "reject_once") ?? options.find((option) => option.kind === "reject_always"))?.optionId;
239
+ }
240
+ __name(selectPermissionOption, "selectPermissionOption");
241
+ function selectRejectOption(options) {
242
+ if (new Set(options.map((option) => option.optionId)).size !== options.length) {
243
+ return void 0;
244
+ }
245
+ return (options.find((option) => option.kind === "reject_once") ?? options.find((option) => option.kind === "reject_always"))?.optionId;
246
+ }
247
+ __name(selectRejectOption, "selectRejectOption");
248
+ function isExpectedExternalAgentCleanupExit(error) {
249
+ return error instanceof Error && /^ACP child pid=\d+ exited uncleanly during shutdown \(code=[^,]+, signal=[^)]+\)$/.test(
250
+ error.message
251
+ );
252
+ }
253
+ __name(isExpectedExternalAgentCleanupExit, "isExpectedExternalAgentCleanupExit");
254
+ function isUnprovenExternalAgentTreeExit(error) {
255
+ return error instanceof Error && /^ACP child pid=\d+ exited before its initial process-tree snapshot completed$/.test(
256
+ error.message
257
+ );
258
+ }
259
+ __name(isUnprovenExternalAgentTreeExit, "isUnprovenExternalAgentTreeExit");
260
+ var ExternalAgentTimeoutError = class extends Error {
261
+ static {
262
+ __name(this, "ExternalAgentTimeoutError");
263
+ }
264
+ constructor(timeoutMs) {
265
+ super(`External ACP operation timed out after ${timeoutMs}ms`);
266
+ this.name = "ExternalAgentTimeoutError";
267
+ }
268
+ };
269
+ var AcpSubagentExecutor = class _AcpSubagentExecutor {
270
+ constructor(params, child, emitter) {
271
+ this.params = params;
272
+ this.child = child;
273
+ this.emitter = emitter;
274
+ this.coreView = {
275
+ getEventEmitter: /* @__PURE__ */ __name(() => emitter, "getEventEmitter"),
276
+ modelConfig: {
277
+ ...params.modelConfig,
278
+ model: externalModelLabel(params.spec.command)
279
+ }
280
+ };
281
+ void child.exited.then(
282
+ () => this.fail(new Error(`external agent "${params.name}" exited`)),
283
+ (error) => this.fail(error)
284
+ );
285
+ }
286
+ static {
287
+ __name(this, "AcpSubagentExecutor");
288
+ }
289
+ connection;
290
+ sessionId = "";
291
+ finalText = "";
292
+ thoughtText = "";
293
+ terminateMode = "ERROR" /* ERROR */;
294
+ round = 0;
295
+ durationMs = 0;
296
+ turnStartedAt = 0;
297
+ toolCalls = 0;
298
+ toolSucceeded = 0;
299
+ toolFailed = 0;
300
+ executing = false;
301
+ started = false;
302
+ disposed = false;
303
+ cancelled = false;
304
+ disposePromise;
305
+ provider;
306
+ pendingPermissions = /* @__PURE__ */ new Map();
307
+ tools = /* @__PURE__ */ new Map();
308
+ toolNames = /* @__PURE__ */ new Map();
309
+ finishedTools = /* @__PURE__ */ new Set();
310
+ failure = new AbortController();
311
+ coreView;
312
+ static async create(params) {
313
+ assertExternalAgentSpawnPlatformSupported();
314
+ if (params.runConfig.max_turns !== void 0) {
315
+ throw new Error("External ACP agents cannot enforce max_turns.");
316
+ }
317
+ const minutes = params.runConfig.max_time_minutes;
318
+ if (minutes !== void 0 && (!Number.isFinite(minutes) || minutes <= 0 || minutes * 6e4 > 2147483647)) {
319
+ throw new Error(
320
+ "External ACP max_time_minutes must be positive, finite, and within the Node timer range."
321
+ );
322
+ }
323
+ const child = spawn(params.spec.command, params.spec.args ?? [], {
324
+ cwd: params.runtimeContext.getTargetDir(),
325
+ stdio: ["pipe", "pipe", "pipe"],
326
+ detached: process.platform !== "win32",
327
+ windowsHide: true,
328
+ env: sanitizeChildEnv(process.env)
329
+ });
330
+ const tracked = new ProcessRegistry().reserve().attach(child, { ownsProcessTree: true });
331
+ const executor = new _AcpSubagentExecutor(
332
+ params,
333
+ tracked,
334
+ params.eventEmitter ?? new AgentEventEmitter()
335
+ );
336
+ child.on("error", (error) => executor.fail(error));
337
+ child.stdin.on("error", (error) => executor.fail(error));
338
+ child.stdout.on("error", (error) => executor.fail(error));
339
+ const forwarder = createStderrForwarder({
340
+ prefix: `[external-agent ${params.name}] `
341
+ });
342
+ child.stderr.setEncoding("utf8");
343
+ child.stderr.on("data", forwarder.onData);
344
+ child.stderr.on("end", forwarder.onEnd);
345
+ child.stderr.on("error", () => {
346
+ });
347
+ try {
348
+ executor.connection = new ClientSideConnection(
349
+ () => executor.buildClient(),
350
+ ndJsonStream(
351
+ Writable.toWeb(child.stdin),
352
+ Readable.toWeb(child.stdout)
353
+ )
354
+ );
355
+ void executor.connection.closed.then(
356
+ () => executor.fail(new Error("External ACP connection closed"))
357
+ );
358
+ await executor.wait(executor.connect(), INIT_TIMEOUT_MS);
359
+ return executor;
360
+ } catch (error) {
361
+ await executor.dispose();
362
+ throw error;
363
+ }
364
+ }
365
+ buildClient() {
366
+ return {
367
+ sessionUpdate: /* @__PURE__ */ __name(async (params) => this.onSessionUpdate(params), "sessionUpdate"),
368
+ requestPermission: /* @__PURE__ */ __name((params) => this.onRequestPermission(params), "requestPermission"),
369
+ readTextFile: /* @__PURE__ */ __name(async () => {
370
+ throw RequestError.methodNotFound("fs/read_text_file");
371
+ }, "readTextFile"),
372
+ writeTextFile: /* @__PURE__ */ __name(async () => {
373
+ throw RequestError.methodNotFound("fs/write_text_file");
374
+ }, "writeTextFile"),
375
+ extMethod: /* @__PURE__ */ __name(async (method) => {
376
+ throw RequestError.methodNotFound(method);
377
+ }, "extMethod"),
378
+ extNotification: /* @__PURE__ */ __name(async () => {
379
+ }, "extNotification")
380
+ };
381
+ }
382
+ async connect() {
383
+ const initialized = await this.connection.initialize({
384
+ protocolVersion: PROTOCOL_VERSION,
385
+ clientCapabilities: { fs: { readTextFile: false, writeTextFile: false } }
386
+ });
387
+ if (initialized.protocolVersion !== PROTOCOL_VERSION) {
388
+ throw new Error("Unsupported external ACP protocol version");
389
+ }
390
+ const session = await this.connection.newSession({
391
+ cwd: this.params.runtimeContext.getTargetDir(),
392
+ mcpServers: []
393
+ });
394
+ if (!session.sessionId)
395
+ throw new Error("External ACP agent returned no sessionId");
396
+ this.sessionId = session.sessionId;
397
+ const policy = resolvePermissionMode(
398
+ this.params.permissionMode,
399
+ this.params.approvalMode
400
+ );
401
+ const availableIds = session.modes?.availableModes.map((mode) => mode.id) ?? [];
402
+ const modeId = selectPeerModeId(policy, availableIds);
403
+ if (!modeId) {
404
+ throw new Error(
405
+ `External ACP agent does not advertise any mode for the host's ${policy} approval policy (advertised: ${availableIds.join(", ") || "none"})`
406
+ );
407
+ }
408
+ await this.connection.setSessionMode({ sessionId: this.sessionId, modeId });
409
+ }
410
+ fail(error) {
411
+ this.failure.abort(error);
412
+ this.drainPermissions();
413
+ }
414
+ async wait(operation, timeoutMs, signal) {
415
+ let timer;
416
+ let onFailure = /* @__PURE__ */ __name(() => {
417
+ }, "onFailure");
418
+ let onAbort = /* @__PURE__ */ __name(() => {
419
+ }, "onAbort");
420
+ const stopped = new Promise((_resolve, reject) => {
421
+ onFailure = /* @__PURE__ */ __name(() => reject(this.failure.signal.reason), "onFailure");
422
+ onAbort = /* @__PURE__ */ __name(() => reject(signal?.reason ?? new Error("External agent cancelled")), "onAbort");
423
+ this.failure.signal.addEventListener("abort", onFailure, { once: true });
424
+ signal?.addEventListener("abort", onAbort, { once: true });
425
+ if (this.failure.signal.aborted) onFailure();
426
+ if (signal?.aborted) onAbort();
427
+ if (timeoutMs !== void 0) {
428
+ timer = setTimeout(
429
+ () => reject(new ExternalAgentTimeoutError(timeoutMs)),
430
+ timeoutMs
431
+ );
432
+ }
433
+ });
434
+ try {
435
+ return await Promise.race([operation, stopped]);
436
+ } finally {
437
+ clearTimeout(timer);
438
+ this.failure.signal.removeEventListener("abort", onFailure);
439
+ signal?.removeEventListener("abort", onAbort);
440
+ }
441
+ }
442
+ async execute(context, signal, options = {}) {
443
+ if (context.get("initial_messages_override") !== void 0) {
444
+ throw new Error(
445
+ "External ACP agents cannot import in-process conversation history"
446
+ );
447
+ }
448
+ const continuation = this.started;
449
+ const system = continuation ? "" : renderSubagentSystemPrompt(
450
+ this.params.promptConfig,
451
+ context,
452
+ this.params.runtimeContext
453
+ );
454
+ const task = String(context.get("task_prompt") ?? "Get Started!");
455
+ await this.runTurn(
456
+ [
457
+ ...system ? [{ type: "text", text: system }] : [],
458
+ { type: "text", text: task }
459
+ ],
460
+ signal,
461
+ options,
462
+ continuation ? [task] : void 0
463
+ );
464
+ }
465
+ async executeExternalInputs(inputs, signal, options = {}) {
466
+ if (inputs.length === 0) return;
467
+ await this.runTurn(this.inputPrompt(inputs), signal, options, inputs);
468
+ }
469
+ inputPrompt(inputs) {
470
+ return inputs.map((input) => ({
471
+ type: "text",
472
+ text: typeof input === "string" ? input : input.text
473
+ }));
474
+ }
475
+ emitInputs(inputs) {
476
+ for (const input of inputs) {
477
+ this.emitter.emit("external_message" /* EXTERNAL_MESSAGE */, {
478
+ subagentId: this.id,
479
+ kind: typeof input === "string" ? "message" : input.kind,
480
+ text: typeof input === "string" ? input : input.text,
481
+ timestamp: Date.now()
482
+ });
483
+ }
484
+ }
485
+ async runTurn(prompt, signal, options = {}, inputs) {
486
+ if (this.executing)
487
+ throw new Error("External ACP agents do not support concurrent turns");
488
+ if (this.disposed || this.failure.signal.aborted)
489
+ throw new Error("External ACP agent is closed");
490
+ this.executing = true;
491
+ this.started = true;
492
+ this.cancelled = false;
493
+ this.finalText = "";
494
+ this.thoughtText = "";
495
+ this.terminateMode = "ERROR" /* ERROR */;
496
+ if (options.resetStats !== false) {
497
+ this.round = this.durationMs = this.toolCalls = this.toolSucceeded = this.toolFailed = 0;
498
+ }
499
+ this.tools.clear();
500
+ this.toolNames.clear();
501
+ this.finishedTools.clear();
502
+ this.turnStartedAt = Date.now();
503
+ const timeoutMs = this.params.runConfig.max_time_minutes === void 0 ? void 0 : this.params.runConfig.max_time_minutes * 6e4;
504
+ const cancel = /* @__PURE__ */ __name(() => {
505
+ this.cancelled = true;
506
+ this.drainPermissions();
507
+ void this.connection.cancel({ sessionId: this.sessionId }).catch(() => {
508
+ });
509
+ }, "cancel");
510
+ signal?.addEventListener("abort", cancel, { once: true });
511
+ let timedOut = false;
512
+ try {
513
+ this.emitter.emit("start" /* START */, {
514
+ subagentId: this.id,
515
+ name: this.params.name,
516
+ model: this.coreView.modelConfig.model,
517
+ tools: [],
518
+ timestamp: Date.now()
519
+ });
520
+ if (signal?.aborted) {
521
+ this.terminateMode = "CANCELLED" /* CANCELLED */;
522
+ return;
523
+ }
524
+ const entryRound = this.round;
525
+ let next = prompt;
526
+ do {
527
+ this.round++;
528
+ const remaining = timeoutMs === void 0 ? void 0 : Math.max(
529
+ 0,
530
+ timeoutMs - this.durationMs - (Date.now() - this.turnStartedAt)
531
+ );
532
+ if (remaining !== void 0 && remaining <= 0) {
533
+ this.terminateMode = "TIMEOUT" /* TIMEOUT */;
534
+ break;
535
+ }
536
+ if (inputs && this.round === entryRound + 1) this.emitInputs(inputs);
537
+ const result = await this.wait(
538
+ this.connection.prompt({ sessionId: this.sessionId, prompt: next }),
539
+ remaining,
540
+ signal
541
+ );
542
+ this.terminateMode = this.stopMode(result.stopReason);
543
+ if (this.terminateMode !== "GOAL" /* GOAL */) break;
544
+ if (signal?.aborted) {
545
+ this.terminateMode = "CANCELLED" /* CANCELLED */;
546
+ break;
547
+ }
548
+ const remainingNext = timeoutMs === void 0 ? void 0 : Math.max(
549
+ 0,
550
+ timeoutMs - this.durationMs - (Date.now() - this.turnStartedAt)
551
+ );
552
+ if (remainingNext !== void 0 && remainingNext <= 0) {
553
+ this.terminateMode = "TIMEOUT" /* TIMEOUT */;
554
+ break;
555
+ }
556
+ const queued = this.provider?.() ?? [];
557
+ if (queued.length === 0) break;
558
+ this.emitter.emit("round_text" /* ROUND_TEXT */, {
559
+ subagentId: this.id,
560
+ round: this.round,
561
+ text: this.finalText,
562
+ thoughtText: this.thoughtText,
563
+ timestamp: Date.now()
564
+ });
565
+ this.finalText = "";
566
+ this.thoughtText = "";
567
+ this.emitInputs(queued);
568
+ next = this.inputPrompt(queued);
569
+ } while (!signal?.aborted);
570
+ if (signal?.aborted) this.terminateMode = "CANCELLED" /* CANCELLED */;
571
+ } catch (error) {
572
+ timedOut = error instanceof ExternalAgentTimeoutError;
573
+ this.terminateMode = signal?.aborted ? "CANCELLED" /* CANCELLED */ : timedOut ? "TIMEOUT" /* TIMEOUT */ : "ERROR" /* ERROR */;
574
+ if (this.emitter.rawListeners("error" /* ERROR */).length > 0 && !signal?.aborted) {
575
+ this.emitter.emit("error" /* ERROR */, {
576
+ subagentId: this.id,
577
+ error: error instanceof Error ? error.message : String(error),
578
+ timestamp: Date.now()
579
+ });
580
+ }
581
+ await this.dispose();
582
+ if (!signal?.aborted && !timedOut) throw error;
583
+ } finally {
584
+ signal?.removeEventListener("abort", cancel);
585
+ this.durationMs += Date.now() - this.turnStartedAt;
586
+ this.executing = false;
587
+ this.drainPermissions();
588
+ this.emitter.emit("round_text" /* ROUND_TEXT */, {
589
+ subagentId: this.id,
590
+ round: this.round,
591
+ text: this.finalText,
592
+ thoughtText: this.thoughtText,
593
+ timestamp: Date.now()
594
+ });
595
+ this.flushOpenTools();
596
+ this.emitter.emit("finish" /* FINISH */, {
597
+ subagentId: this.id,
598
+ terminateReason: this.terminateMode,
599
+ rounds: this.round,
600
+ totalDurationMs: this.durationMs,
601
+ totalToolCalls: this.toolCalls,
602
+ successfulToolCalls: this.toolSucceeded,
603
+ failedToolCalls: this.toolFailed,
604
+ timestamp: Date.now()
605
+ });
606
+ }
607
+ }
608
+ stopMode(reason) {
609
+ switch (reason) {
610
+ case "end_turn":
611
+ return "GOAL" /* GOAL */;
612
+ case "max_turn_requests":
613
+ return "MAX_TURNS" /* MAX_TURNS */;
614
+ case "cancelled":
615
+ return "CANCELLED" /* CANCELLED */;
616
+ case "refusal":
617
+ return "ERROR" /* ERROR */;
618
+ default:
619
+ return "ERROR" /* ERROR */;
620
+ }
621
+ }
622
+ get id() {
623
+ return this.params.subagentId ?? this.params.name;
624
+ }
625
+ getFinalText() {
626
+ return this.finalText;
627
+ }
628
+ getTerminateMode() {
629
+ return this.terminateMode;
630
+ }
631
+ getCore() {
632
+ return this.coreView;
633
+ }
634
+ setExternalMessageProvider(provider) {
635
+ this.provider = provider;
636
+ }
637
+ // This executor deliberately does NOT implement `setExternalMessageWaiter` /
638
+ // `setExternalMessageWaitPredicate`: ACP v1 has no mid-turn injection
639
+ // primitive (no `session/steer`), so input that arrives while a prompt is in
640
+ // flight cannot be delivered until that prompt resolves. Queued input is
641
+ // drained between prompts via the provider above (next-turn-boundary
642
+ // delivery). Implementing true mid-turn steering would require cancel +
643
+ // re-prompt — re-billing the whole in-flight turn — which is a protocol/billing
644
+ // decision, not a safe default. The delegation result surfaces this
645
+ // limitation (see agent.ts EXTERNAL_MID_TURN_INPUT_NOTICE). (R3-6)
646
+ getExecutionSummary() {
647
+ return {
648
+ rounds: this.round,
649
+ totalDurationMs: this.durationMs + (this.executing ? Date.now() - this.turnStartedAt : 0),
650
+ totalToolCalls: this.toolCalls,
651
+ successfulToolCalls: this.toolSucceeded,
652
+ failedToolCalls: this.toolFailed,
653
+ successRate: this.toolCalls ? this.toolSucceeded / this.toolCalls * 100 : 0,
654
+ inputTokens: 0,
655
+ outputTokens: 0,
656
+ thoughtTokens: 0,
657
+ cachedTokens: 0,
658
+ totalTokens: 0,
659
+ toolUsage: []
660
+ };
661
+ }
662
+ dispose() {
663
+ this.disposed = true;
664
+ this.fail(new Error("External ACP agent disposed"));
665
+ return this.disposePromise ??= this.child.terminate().catch((error) => {
666
+ if (isUnprovenExternalAgentTreeExit(error)) {
667
+ const detail = error instanceof Error ? error.message : String(error);
668
+ debugLogger.warn(
669
+ `External ACP agent process tree was not proven gone after disposal: ${detail}`
670
+ );
671
+ if (this.emitter.rawListeners("error" /* ERROR */).length > 0) {
672
+ this.emitter.emit("error" /* ERROR */, {
673
+ subagentId: this.id,
674
+ error: `External agent process tree not proven gone after disposal: ${detail}`,
675
+ timestamp: Date.now()
676
+ });
677
+ }
678
+ return;
679
+ }
680
+ if (!isExpectedExternalAgentCleanupExit(error)) throw error;
681
+ });
682
+ }
683
+ drainPermissions() {
684
+ for (const cancel of this.pendingPermissions.values()) cancel();
685
+ this.pendingPermissions.clear();
686
+ }
687
+ onSessionUpdate({ sessionId, update }) {
688
+ if (sessionId !== this.sessionId || !this.executing || this.cancelled || this.disposed || this.failure.signal.aborted)
689
+ return;
690
+ switch (update.sessionUpdate) {
691
+ case "agent_message_chunk":
692
+ case "agent_thought_chunk": {
693
+ const thought = update.sessionUpdate === "agent_thought_chunk";
694
+ const text = update.content.type === "text" ? update.content.text : JSON.stringify(update.content);
695
+ if (thought) this.thoughtText += text;
696
+ else this.finalText += text;
697
+ this.emitter.emit("stream_text" /* STREAM_TEXT */, {
698
+ subagentId: this.id,
699
+ round: this.round,
700
+ text,
701
+ thought,
702
+ timestamp: Date.now()
703
+ });
704
+ break;
705
+ }
706
+ case "tool_call":
707
+ this.updateTool(update);
708
+ break;
709
+ case "tool_call_update":
710
+ this.updateTool(update);
711
+ break;
712
+ default:
713
+ break;
714
+ }
715
+ }
716
+ updateTool(update) {
717
+ const callId = update.toolCallId;
718
+ if (this.finishedTools.has(callId)) return;
719
+ const previous = this.tools.get(callId);
720
+ const tool = {
721
+ toolCallId: callId,
722
+ title: previous?.title ?? "External tool",
723
+ ...previous,
724
+ ...Object.fromEntries(
725
+ Object.entries(update).filter(
726
+ ([, value]) => value !== null && value !== void 0
727
+ )
728
+ )
729
+ };
730
+ this.tools.set(callId, tool);
731
+ const meta = tool._meta?.["claudeCode"];
732
+ const reportedName = isRecord(meta) && typeof meta["toolName"] === "string" ? meta["toolName"] : tool.kind ?? "external_tool";
733
+ const name = this.toolNames.get(callId) ?? reportedName;
734
+ if (!previous) {
735
+ this.toolNames.set(callId, name);
736
+ this.toolCalls++;
737
+ this.emitter.emit("tool_call" /* TOOL_CALL */, {
738
+ subagentId: this.id,
739
+ round: this.round,
740
+ callId,
741
+ name,
742
+ args: isRecord(tool.rawInput) ? tool.rawInput : { input: tool.rawInput },
743
+ description: tool.title,
744
+ timestamp: Date.now()
745
+ });
746
+ }
747
+ if (tool.status !== "completed" && tool.status !== "failed") return;
748
+ this.finishedTools.add(callId);
749
+ this.tools.delete(callId);
750
+ const success = tool.status === "completed";
751
+ if (success) this.toolSucceeded++;
752
+ else this.toolFailed++;
753
+ this.toolNames.delete(callId);
754
+ const response = {
755
+ input: tool.rawInput ?? null,
756
+ toolName: reportedName,
757
+ output: tool.rawOutput ?? null,
758
+ content: tool.content ?? null,
759
+ status: tool.status
760
+ };
761
+ const responseParts = [
762
+ { functionResponse: { id: callId, name, response } }
763
+ ];
764
+ this.emitter.emit("tool_result" /* TOOL_RESULT */, {
765
+ subagentId: this.id,
766
+ round: this.round,
767
+ callId,
768
+ name,
769
+ success,
770
+ responseParts,
771
+ resultDisplay: JSON.stringify(tool.rawOutput ?? tool.content ?? null),
772
+ timestamp: Date.now()
773
+ });
774
+ this.emitter.emit("tool_responses_finalized" /* TOOL_RESPONSES_FINALIZED */, {
775
+ subagentId: this.id,
776
+ round: this.round,
777
+ responses: [{ callId, responseParts }],
778
+ timestamp: Date.now()
779
+ });
780
+ }
781
+ /**
782
+ * Emit a terminal TOOL_RESULT + TOOL_RESPONSES_FINALIZED for every tool call
783
+ * still open when the turn ends. Cancel, timeout and peer crash all leave
784
+ * entries in `this.tools`: `cancel()` sets `this.cancelled` before the peer's
785
+ * own terminal `tool_call_update` can arrive (so `onSessionUpdate` drops it),
786
+ * and the next `runTurn` clears the map. Without this flush three consumers
787
+ * keep a false record — the inline frame and Web Shell row show the tool
788
+ * executing forever (TOOL_RESULT is the only writer of their status), the
789
+ * JSONL transcript holds a permanently unpaired `functionCall`
790
+ * (TOOL_RESPONSES_FINALIZED is the only writer of its `tool_result`), and
791
+ * FINISH's totals do not sum. The in-process sibling closes the same gap via
792
+ * `onAllToolCallsComplete`.
793
+ */
794
+ flushOpenTools() {
795
+ for (const [callId, tool] of this.tools) {
796
+ const meta = tool._meta?.["claudeCode"];
797
+ const reportedName = isRecord(meta) && typeof meta["toolName"] === "string" ? meta["toolName"] : tool.kind ?? "external_tool";
798
+ const name = this.toolNames.get(callId) ?? reportedName;
799
+ this.toolFailed++;
800
+ const response = {
801
+ input: tool.rawInput ?? null,
802
+ toolName: reportedName,
803
+ output: null,
804
+ content: tool.content ?? null,
805
+ status: "failed"
806
+ };
807
+ const responseParts = [
808
+ { functionResponse: { id: callId, name, response } }
809
+ ];
810
+ this.emitter.emit("tool_result" /* TOOL_RESULT */, {
811
+ subagentId: this.id,
812
+ round: this.round,
813
+ callId,
814
+ name,
815
+ success: false,
816
+ responseParts,
817
+ resultDisplay: JSON.stringify(tool.content ?? null),
818
+ timestamp: Date.now()
819
+ });
820
+ this.emitter.emit("tool_responses_finalized" /* TOOL_RESPONSES_FINALIZED */, {
821
+ subagentId: this.id,
822
+ round: this.round,
823
+ responses: [{ callId, responseParts }],
824
+ timestamp: Date.now()
825
+ });
826
+ }
827
+ this.tools.clear();
828
+ this.toolNames.clear();
829
+ }
830
+ async onRequestPermission(params) {
831
+ const cancelled = {
832
+ outcome: { outcome: "cancelled" }
833
+ };
834
+ const runtime = this.params.runtimeContext;
835
+ const callId = params.toolCall.toolCallId;
836
+ const meta = params.toolCall._meta?.["claudeCode"];
837
+ const name = isRecord(meta) && typeof meta["toolName"] === "string" ? meta["toolName"] : params.toolCall.kind ?? "external_tool";
838
+ if (params.sessionId !== this.sessionId || !this.executing || this.cancelled || this.disposed || this.failure.signal.aborted || this.pendingPermissions.has(callId) || params.options.length === 0 || new Set(params.options.map((option) => option.optionId)).size !== params.options.length)
839
+ return cancelled;
840
+ if (name.replaceAll("_", "").toLowerCase() === "askuserquestion" || runtime.getShouldAvoidPermissionPrompts() || !runtime.isInteractive() && !runtime.getExperimentalZedIntegration() && runtime.getInputFormat() !== "stream-json" /* STREAM_JSON */ || this.emitter.rawListeners("tool_waiting_approval" /* TOOL_WAITING_APPROVAL */).length === 0) {
841
+ const rejectOptionId = selectRejectOption(params.options);
842
+ return rejectOptionId ? { outcome: { outcome: "selected", optionId: rejectOptionId } } : cancelled;
843
+ }
844
+ return new Promise((resolve) => {
845
+ const finish = /* @__PURE__ */ __name((optionId) => {
846
+ if (this.pendingPermissions.get(callId) !== deny) return;
847
+ this.pendingPermissions.delete(callId);
848
+ resolve(
849
+ optionId ? { outcome: { outcome: "selected", optionId } } : cancelled
850
+ );
851
+ }, "finish");
852
+ const deny = /* @__PURE__ */ __name(() => finish(), "deny");
853
+ this.pendingPermissions.set(callId, deny);
854
+ try {
855
+ this.emitter.emit("tool_waiting_approval" /* TOOL_WAITING_APPROVAL */, {
856
+ subagentId: this.id,
857
+ round: this.round,
858
+ callId,
859
+ name,
860
+ args: isRecord(params.toolCall.rawInput) ? params.toolCall.rawInput : {},
861
+ description: params.toolCall.title ?? "External action",
862
+ confirmationDetails: {
863
+ type: "info",
864
+ title: params.toolCall.title ?? "External action",
865
+ // Carry the action's arguments so the user sees WHAT they are
866
+ // authorizing — not just the option labels the dialog already
867
+ // renders as buttons (R11-5). Bounded and control-stripped.
868
+ prompt: describeExternalAction(params.toolCall),
869
+ // The prompt is a foreign-process payload; render it as plain text,
870
+ // never markdown — otherwise the dialog would eat glob `**` and
871
+ // render links, misrepresenting what the user approves. (R11-5 fix)
872
+ renderPromptAsPlainText: true,
873
+ hideAlwaysAllow: true
874
+ },
875
+ respond: /* @__PURE__ */ __name(async (outcome) => finish(
876
+ selectPermissionOption(params.options, outcome) ?? // An explicit user rejection of THIS tool must deny the tool,
877
+ // not cancel the whole turn: `selectPermissionOption` maps
878
+ // Cancel to undefined, and ACP `cancelled` ends the prompt turn
879
+ // (abandoning the remaining work and billing a fresh prompt to
880
+ // re-delegate). Select the peer's `reject_once` option so the
881
+ // turn continues without this one action, matching the dialog's
882
+ // "suggest changes" promise and the in-process sibling. Fall
883
+ // back to `cancelled` only when no reject option is selectable.
884
+ (outcome === "cancel" /* Cancel */ ? selectRejectOption(params.options) : void 0)
885
+ ), "respond"),
886
+ timestamp: Date.now()
887
+ });
888
+ } catch {
889
+ deny();
890
+ }
891
+ });
892
+ }
893
+ };
894
+ var acpExternalAgentExecutor = {
895
+ create: /* @__PURE__ */ __name((params) => AcpSubagentExecutor.create(params), "create")
896
+ };
897
+ export {
898
+ acpExternalAgentExecutor,
899
+ assertExternalAgentSpawnPlatformSupported,
900
+ describeExternalAction,
901
+ externalModelLabel,
902
+ isExpectedExternalAgentCleanupExit,
903
+ isUnprovenExternalAgentTreeExit,
904
+ optionKindForOutcome,
905
+ resolvePermissionMode,
906
+ selectPeerModeId,
907
+ selectPermissionOption,
908
+ selectRejectOption
909
+ };
910
+ /**
911
+ * @license
912
+ * Copyright 2025 Qwen
913
+ * SPDX-License-Identifier: Apache-2.0
914
+ */
915
+ /**
916
+ * @license
917
+ * Copyright 2026 Qwen Team
918
+ * SPDX-License-Identifier: Apache-2.0
919
+ */