@qwen-code/qwen-code 0.20.1-preview.7215 → 0.20.1

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 (326) hide show
  1. package/bundled/qc-helper/docs/configuration/settings.md +1 -1
  2. package/bundled/qc-helper/docs/features/auto-mode.md +19 -16
  3. package/bundled/qc-helper/docs/features/commands.md +54 -0
  4. package/bundled/qc-helper/docs/features/sub-agents.md +16 -7
  5. package/bundled/qc-helper/docs/integration-github-action.md +10 -10
  6. package/bundled/qc-helper/docs/qwen-serve.md +2 -1
  7. package/bundled/review/DESIGN.md +2 -2
  8. package/bundled/review/SKILL.md +4 -4
  9. package/chunks/{MaxSizedBox-EH6G5AEH.js → MaxSizedBox-4WZYPSRU.js} +40 -36
  10. package/chunks/{StandaloneSessionPicker-264A3TEA.js → StandaloneSessionPicker-PE4JAIFA.js} +58 -54
  11. package/chunks/{acpAgent-6RBIJFDI.js → acpAgent-BVIKGJ2C.js} +1503 -520
  12. package/chunks/{agent-QURXGAA3.js → agent-DHLFAOUV.js} +36 -32
  13. package/chunks/{agent-headless-CRGX4ICQ.js → agent-headless-ZP5WTNXZ.js} +36 -32
  14. package/chunks/{anthropicContentGenerator-BWBAZGTW.js → anthropicContentGenerator-NMSS7IMV.js} +11 -11
  15. package/chunks/{artifact-tool-IUJ7QWCX.js → artifact-tool-56T5IMBP.js} +3 -3
  16. package/chunks/{askUserQuestion-IUMUUTDQ.js → askUserQuestion-E25OBIC2.js} +3 -3
  17. package/chunks/{bridge-MNFVKPMI.js → bridge-XAK7JKMD.js} +41 -37
  18. package/chunks/{build-SSCNEHZZ.js → build-GHIZ4MSZ.js} +1 -1
  19. package/chunks/{ca-2SL2BXTK.js → ca-N6VVUFVB.js} +611 -201
  20. package/chunks/{channel-worker-group-53CMOPFT.js → channel-worker-group-LFBT7K64.js} +5 -5
  21. package/chunks/{channel-worker-manager-UTXILKC2.js → channel-worker-manager-3RUPERG2.js} +5 -5
  22. package/chunks/{channel-worker-supervisor-ZGO2W2MD.js → channel-worker-supervisor-A3KVATD3.js} +4 -4
  23. package/chunks/{chunk-IUSNI6IX.js → chunk-27CLX4FV.js} +1 -1
  24. package/chunks/{chunk-2HOVDT7W.js → chunk-2LI23QA6.js} +1 -1
  25. package/chunks/chunk-2RFKHEXL.js +74 -0
  26. package/chunks/{chunk-LZYWWWCZ.js → chunk-3KQSDUK3.js} +3 -3
  27. package/chunks/{chunk-NOWTNYC7.js → chunk-3LH5Q2AR.js} +8 -8
  28. package/chunks/{chunk-IB35C3IL.js → chunk-3SXF4GMQ.js} +1 -1
  29. package/chunks/chunk-43T5WDQ7.js +127 -0
  30. package/chunks/{chunk-KXEGCGUG.js → chunk-4BRH6FP5.js} +31 -6
  31. package/chunks/{chunk-TTSKHF43.js → chunk-4DSBFQMI.js} +2 -2
  32. package/chunks/{chunk-JD3MKVKL.js → chunk-4K56OJFJ.js} +1 -1
  33. package/chunks/{chunk-KTUQMDEP.js → chunk-4K7VDKAD.js} +1 -1
  34. package/chunks/{chunk-QKYTTBYW.js → chunk-4LVZNIDO.js} +1 -1
  35. package/chunks/{chunk-OF2BBLYQ.js → chunk-52T5UHAZ.js} +2 -2
  36. package/chunks/{chunk-ZEOZL37W.js → chunk-57FIIFJN.js} +1 -1
  37. package/chunks/{chunk-WAX3ITOA.js → chunk-5EA5NVXS.js} +1 -1
  38. package/chunks/chunk-5G2SK2OO.js +20600 -0
  39. package/chunks/{chunk-6EFTQYW7.js → chunk-5I5BM454.js} +1 -1
  40. package/chunks/{chunk-GMGDLUC7.js → chunk-6IL7KRLE.js} +1 -1
  41. package/chunks/{chunk-26LLB6FM.js → chunk-6NHK6HS7.js} +2 -2
  42. package/chunks/{chunk-FVS747N7.js → chunk-6PRNSLMB.js} +11 -6
  43. package/chunks/chunk-6PVPNMXU.js +29 -0
  44. package/chunks/{chunk-BDBMYST4.js → chunk-6X4GWOPW.js} +1 -1
  45. package/chunks/{chunk-4ODB7WIB.js → chunk-6ZBPS62S.js} +1 -1
  46. package/chunks/{chunk-E5GIFWE3.js → chunk-766HLFAG.js} +54 -33
  47. package/chunks/{chunk-SDXIH6OA.js → chunk-76OFFG6L.js} +137 -5
  48. package/chunks/{chunk-ANHT55MR.js → chunk-7LH6CHKG.js} +1 -1
  49. package/chunks/{chunk-Y4CRUWFZ.js → chunk-7NDXG4MB.js} +60 -35
  50. package/chunks/{chunk-KPZNOZPC.js → chunk-7SWFAKVH.js} +22 -22
  51. package/chunks/{chunk-AYCDXHZB.js → chunk-7Z6JQEL6.js} +1 -1
  52. package/chunks/{chunk-5NWV4NFB.js → chunk-AZD6KAV7.js} +3 -3
  53. package/chunks/{chunk-7YBZGNEC.js → chunk-BKZEHVPV.js} +176 -168
  54. package/chunks/{chunk-WXAXH7IJ.js → chunk-BWQRDISK.js} +1 -1
  55. package/chunks/{chunk-X4CGDBKA.js → chunk-BZAEENUV.js} +3 -3
  56. package/chunks/{chunk-BF32GYSY.js → chunk-CHXKGIMK.js} +1 -1
  57. package/chunks/{chunk-4SLLEAQP.js → chunk-D53NR4GO.js} +562 -301
  58. package/chunks/{chunk-FLTN6NRU.js → chunk-D6ZOVZLF.js} +5 -1
  59. package/chunks/{chunk-NBMIC7DR.js → chunk-D7WXIW7H.js} +4 -4
  60. package/chunks/{chunk-MKLKHZAK.js → chunk-DPRMI6NU.js} +1 -1
  61. package/chunks/{chunk-AR27OPIU.js → chunk-DRIXALGM.js} +2 -2
  62. package/chunks/{chunk-5SCI6E3E.js → chunk-E4IMU4Y5.js} +1 -1
  63. package/chunks/{chunk-Z5Q65RVH.js → chunk-EC2ET5ZZ.js} +1 -1
  64. package/chunks/{chunk-B453NMZJ.js → chunk-EFIOE2EH.js} +3 -3
  65. package/chunks/{chunk-OKWRU4NO.js → chunk-EWXXMRMP.js} +3 -3
  66. package/chunks/{chunk-NEEB7UEN.js → chunk-FFFM6NJV.js} +1 -2
  67. package/chunks/{chunk-JVTCARQ6.js → chunk-G6LRTI62.js} +4 -4
  68. package/chunks/{chunk-6OH6A5EX.js → chunk-GEB2CGUV.js} +20262 -17752
  69. package/chunks/{chunk-OONJNQ42.js → chunk-GPSKDNEE.js} +3 -3
  70. package/chunks/{chunk-FNGK2Z5B.js → chunk-H4AR2JQF.js} +3 -3
  71. package/chunks/chunk-HTR4WV6U.js +327 -0
  72. package/chunks/chunk-IS2SBY6T.js +2256 -0
  73. package/chunks/{chunk-G45X5TRN.js → chunk-JCW2R7WC.js} +1 -72
  74. package/chunks/{chunk-6GUTHAN7.js → chunk-JHFVJQRO.js} +1 -1
  75. package/chunks/{chunk-IE4JSQ5L.js → chunk-JIBBZH37.js} +27 -23
  76. package/chunks/{chunk-UJEZQ562.js → chunk-JJEFX6U5.js} +3 -3
  77. package/chunks/{chunk-QOK6RMIP.js → chunk-JKFHJK5U.js} +4 -4
  78. package/chunks/{chunk-GA7VRJVN.js → chunk-JO7FGOSY.js} +5 -5
  79. package/chunks/{chunk-WOT64EP2.js → chunk-JTUAAVUT.js} +2 -2
  80. package/chunks/{chunk-MAQQGNQ5.js → chunk-JYS55H6Z.js} +66 -7
  81. package/chunks/{chunk-DA7OOKVN.js → chunk-KDPIV6WC.js} +29 -2
  82. package/chunks/{chunk-EIAK6Q2B.js → chunk-KHOVYUHX.js} +2 -2
  83. package/chunks/{chunk-OLMETXLX.js → chunk-KQQ757OQ.js} +2 -2
  84. package/chunks/{chunk-Z6UEAQTP.js → chunk-KSZZBDVD.js} +165 -48
  85. package/chunks/chunk-KWK7UE6L.js +6194 -0
  86. package/chunks/{chunk-OOCI5VVU.js → chunk-LIZRAKPB.js} +1 -1
  87. package/chunks/{chunk-VFAE4AGH.js → chunk-LPMBFOWH.js} +73 -68
  88. package/chunks/{chunk-IKP5DXZY.js → chunk-LYEKAAEH.js} +5 -5
  89. package/chunks/chunk-M7WBGLYP.js +151 -0
  90. package/chunks/{chunk-P2YAOGJD.js → chunk-MTSYH4MB.js} +3 -3
  91. package/chunks/{chunk-WKRXIHD6.js → chunk-N5ARKAVE.js} +8 -8
  92. package/chunks/chunk-NABLFI57.js +82 -0
  93. package/chunks/{chunk-CVDW42JT.js → chunk-NNFK277W.js} +1 -1
  94. package/chunks/{chunk-467G3SV5.js → chunk-NPQDJGKU.js} +1 -1
  95. package/chunks/chunk-OQ5SYCPE.js +10017 -0
  96. package/chunks/{chunk-C27BYUX6.js → chunk-OQB4EXO4.js} +14 -11
  97. package/chunks/{chunk-RELYEO3R.js → chunk-OUDZVU7H.js} +242 -1607
  98. package/chunks/{chunk-3EUZWNWA.js → chunk-PBED7USE.js} +1 -1
  99. package/chunks/{chunk-WBTZGWQ6.js → chunk-PIHKWN7M.js} +1 -1
  100. package/chunks/{chunk-XNP57UDV.js → chunk-PPIHLGNE.js} +2 -2
  101. package/chunks/{chunk-Q4RBU7WX.js → chunk-PSVSP2OS.js} +6 -6
  102. package/chunks/{chunk-BRXIO5WY.js → chunk-Q2V2ADXF.js} +7 -7
  103. package/chunks/{chunk-JDI67JFB.js → chunk-Q2YKNMLS.js} +3 -3
  104. package/chunks/{chunk-BAIEQKR5.js → chunk-Q3GGJDYN.js} +5 -5
  105. package/chunks/{chunk-PBATSWUQ.js → chunk-QBUDF33N.js} +1 -1
  106. package/chunks/{chunk-OMH3276Y.js → chunk-QD6BRERJ.js} +7 -7
  107. package/chunks/{chunk-Y2ENGUD6.js → chunk-QKTHJXCS.js} +1 -1
  108. package/chunks/{chunk-BVLROR2T.js → chunk-QLJUC7TG.js} +1 -1
  109. package/chunks/{chunk-UEY4AYUL.js → chunk-QNLNLENL.js} +2 -2
  110. package/chunks/{chunk-7KDI2IB2.js → chunk-QSJ6JIF5.js} +4 -4
  111. package/chunks/{chunk-Q3ZBFXK4.js → chunk-QUHJRRUA.js} +126 -30
  112. package/chunks/{chunk-N6YTEVLV.js → chunk-R3BCL5XW.js} +10 -4
  113. package/chunks/{chunk-EVSTCA7S.js → chunk-R7MPKABX.js} +307 -86
  114. package/chunks/{chunk-RFIAR4YL.js → chunk-RV4C2ZFG.js} +1 -1
  115. package/chunks/{chunk-NIJEXGV6.js → chunk-RVLZCXEE.js} +79 -10
  116. package/chunks/{chunk-T7DDD7CZ.js → chunk-RYSMKY43.js} +4 -4
  117. package/chunks/{chunk-MC2DOZS7.js → chunk-S3YQCNJE.js} +3 -3
  118. package/chunks/{chunk-4WUAQ2DO.js → chunk-SP32MK6J.js} +2 -2
  119. package/chunks/{chunk-JNWZQ27S.js → chunk-SP5WRGVG.js} +3 -3
  120. package/chunks/{chunk-FSL5W5TI.js → chunk-T2L47JJK.js} +3 -3
  121. package/chunks/{chunk-TB6UDU4T.js → chunk-THJNPLI4.js} +16 -16
  122. package/chunks/{chunk-TCKTNY66.js → chunk-TPR35HHZ.js} +6 -6
  123. package/chunks/{chunk-UQES76OO.js → chunk-TXRKCFWS.js} +6 -6
  124. package/chunks/chunk-U7ZFW55U.js +2098 -0
  125. package/chunks/{chunk-W7H223ZZ.js → chunk-UGYMA4EI.js} +1 -1
  126. package/chunks/{chunk-X6YQWCIJ.js → chunk-UH3WSE5L.js} +13 -1
  127. package/chunks/{chunk-R3VWUU2E.js → chunk-VYPFXUCB.js} +1 -1
  128. package/chunks/{chunk-2DXOIVUI.js → chunk-WCFTQD7H.js} +11 -11
  129. package/chunks/chunk-WHGVTP7Q.js +1049 -0
  130. package/chunks/{chunk-PWVTCGBP.js → chunk-WML6JOGQ.js} +31 -19
  131. package/chunks/{chunk-D2VIDMVM.js → chunk-X6N25LXS.js} +2 -2
  132. package/chunks/{chunk-Z5R4JMOL.js → chunk-X7XWGRDT.js} +4 -4
  133. package/chunks/chunk-XHATNRQA.js +1500 -0
  134. package/chunks/{chunk-V25Z5UUB.js → chunk-Y2DAH52F.js} +7 -6
  135. package/chunks/{chunk-S35ZDXOS.js → chunk-YM3SZTH4.js} +2 -1
  136. package/chunks/{chunk-GKY2OJ7R.js → chunk-ZHERRXZJ.js} +1 -1
  137. package/chunks/{computer-use-R7KA6UJ6.js → computer-use-MV4K6WJM.js} +41 -37
  138. package/chunks/{config-utils-6FXFJUYB.js → config-utils-WYUQ7II4.js} +3 -3
  139. package/chunks/{contextCommand-KAQQPHZ4.js → contextCommand-TQD36VNX.js} +38 -34
  140. package/chunks/{create-sub-session-X5RVIHCK.js → create-sub-session-AZ77LBL3.js} +3 -3
  141. package/chunks/{create-sub-session-TDPDBU4K.js → create-sub-session-JOW4BKMC.js} +36 -32
  142. package/chunks/{cron-create-AC5FFLN7.js → cron-create-KTWJM7QT.js} +5 -5
  143. package/chunks/{cron-delete-JEB3FAHA.js → cron-delete-2P3I5ULL.js} +5 -5
  144. package/chunks/{cron-list-NBYPCNIB.js → cron-list-PXDPGEDQ.js} +5 -5
  145. package/chunks/{daemon-RG2MAI6T.js → daemon-KLPTQIE4.js} +138 -81
  146. package/chunks/daemon-status-provider-TII4SMCZ.js +81 -0
  147. package/chunks/{de-I7ZIYXZC.js → de-4IBXM7CN.js} +5 -1
  148. package/chunks/{dist-2BHAYBKP.js → dist-HMU6CYS4.js} +2 -2
  149. package/chunks/{dist-AU7NQQRP.js → dist-OAV7LJGJ.js} +1 -1
  150. package/chunks/{dist-FUTEXY6A.js → dist-OMW6WDEO.js} +1 -1
  151. package/chunks/{dist-2MIU4UUH.js → dist-PJLG2XYX.js} +1 -1
  152. package/chunks/{dist-53PZYC5B.js → dist-UIFWIFRO.js} +2 -2
  153. package/chunks/{dist-WGTQO7F2.js → dist-XRYV6TJP.js} +65 -25
  154. package/chunks/{earlyInputCapture-WC7RI5HV.js → earlyInputCapture-2V57RG6H.js} +37 -33
  155. package/chunks/{edit-6MHKCJCM.js → edit-TTUH7PWR.js} +43 -41
  156. package/chunks/{en-XE34GKAA.js → en-USMCCJAJ.js} +5 -1
  157. package/chunks/{enter-worktree-O7VJ2E7A.js → enter-worktree-D4IVCXYB.js} +41 -37
  158. package/chunks/{enterPlanMode-5XYAALIO.js → enterPlanMode-WRUJTVYN.js} +47 -38
  159. package/chunks/{environment-LSKFNLBU.js → environment-SEPKXB2C.js} +38 -34
  160. package/chunks/{errors-ZFVCY6HG.js → errors-YSVGBLBU.js} +38 -34
  161. package/chunks/{exit-worktree-MYIK66T7.js → exit-worktree-MZ4JSSP6.js} +41 -37
  162. package/chunks/{exitPlanMode-7MBNU76O.js → exitPlanMode-HAZLSSOJ.js} +41 -37
  163. package/chunks/{fast-path-RNLIB64C.js → fast-path-EVBVIE2U.js} +4 -3
  164. package/chunks/{fast-path-settings-DAOVFADC.js → fast-path-settings-XB3CPUJT.js} +2 -2
  165. package/chunks/{fr-X7KDVZIY.js → fr-WVHEBDDB.js} +5 -1
  166. package/chunks/{gemini-WK5ISEAQ.js → gemini-APQ76464.js} +100 -95
  167. package/chunks/{geminiContentGenerator-NUJQBZBW.js → geminiContentGenerator-LB4MA2LI.js} +5 -5
  168. package/chunks/{getMachineId-bsd-EXV7SWPA.js → getMachineId-bsd-QFVLPUPT.js} +1 -1
  169. package/chunks/{getMachineId-darwin-IUOMFXU3.js → getMachineId-darwin-DGMQQE2E.js} +1 -1
  170. package/chunks/{getMachineId-linux-K7XJYFHL.js → getMachineId-linux-R4Z6CSWC.js} +1 -1
  171. package/chunks/{getMachineId-unsupported-EA5FDRJ6.js → getMachineId-unsupported-Z3SBVBUV.js} +1 -1
  172. package/chunks/{getMachineId-win-KBA6RAI5.js → getMachineId-win-SCK5UFDT.js} +1 -1
  173. package/chunks/{glob-7P6RYY4L.js → glob-LABYMYKG.js} +43 -39
  174. package/chunks/{grep-V3QHNP2J.js → grep-HKIKJCAS.js} +43 -39
  175. package/chunks/{handleAutoUpdate-AAQ6PL3E.js → handleAutoUpdate-RWAAL2UM.js} +40 -36
  176. package/chunks/{i18n-B7IO7WQT.js → i18n-ZUVDAJIJ.js} +37 -33
  177. package/chunks/{initializer-E5TIC3CW.js → initializer-7YUHIC36.js} +43 -39
  178. package/chunks/{installationInfo-XLPNAISK.js → installationInfo-DVEOMWDE.js} +39 -33
  179. package/chunks/{ja-2ICT3KXF.js → ja-KY4ROZTE.js} +5 -1
  180. package/chunks/{keychain-token-storage-DWRJMNH3.js → keychain-token-storage-6ACJDYIB.js} +3 -3
  181. package/chunks/list-WHCZSIR2.js +82 -0
  182. package/chunks/{loadedSettingsAdapter-X5BSC6CE.js → loadedSettingsAdapter-YCWN6AK3.js} +42 -38
  183. package/chunks/{loop-wakeup-HMHCT5GU.js → loop-wakeup-RNMRVA66.js} +6 -6
  184. package/chunks/{ls-IW5HYDG4.js → ls-J2ZI5XYK.js} +5 -5
  185. package/chunks/{lsp-4RL52YIZ.js → lsp-UMS3NUB5.js} +3 -3
  186. package/chunks/managed-npm-update-PG3463CJ.js +333 -0
  187. package/chunks/{mcp-4C4HWXAR.js → mcp-VLHDCKAN.js} +42 -38
  188. package/chunks/{monitor-3CJDNZB2.js → monitor-GG4F4YM6.js} +41 -37
  189. package/chunks/nonInteractiveCli-UYXYV4YX.js +133 -0
  190. package/chunks/{notebook-edit-MX366HCT.js → notebook-edit-US4VLN6Q.js} +44 -42
  191. package/chunks/{openaiContentGenerator-KRPNNJGZ.js → openaiContentGenerator-CVEDTMDB.js} +20 -18
  192. package/chunks/{pidfile-K7T2JLUJ.js → pidfile-QQ45OIOY.js} +37 -33
  193. package/chunks/{processUtils-YXL3VIBR.js → processUtils-3WMHLQE5.js} +2 -2
  194. package/chunks/{pt-JJ4XPIBP.js → pt-OK455PLH.js} +5 -1
  195. package/chunks/{qwenContentGenerator-GJVXFZ3U.js → qwenContentGenerator-Y2GRNYZQ.js} +42 -38
  196. package/chunks/{qwenOAuth2-UZTIBQLY.js → qwenOAuth2-J2X6E5VO.js} +18 -16
  197. package/chunks/{read-file-S5XQSYOW.js → read-file-C7Z266CU.js} +13 -11
  198. package/chunks/{read-mcp-resource-OIBCNIX7.js → read-mcp-resource-F6HYMDUY.js} +3 -3
  199. package/chunks/{record-artifact-HDMK4LHG.js → record-artifact-7GCFLDD7.js} +3 -3
  200. package/chunks/{resumeHistoryUtils-IKR6XD2S.js → resumeHistoryUtils-KBQWX77U.js} +43 -39
  201. package/chunks/{ripGrep-H65GRSQX.js → ripGrep-RW26MTQ3.js} +36 -32
  202. package/chunks/{ru-STR4KTW7.js → ru-7SPDGMGD.js} +5 -1
  203. package/chunks/{run-qwen-serve-7SKAQOAA.js → run-qwen-serve-MXFMOMEL.js} +104 -82
  204. package/chunks/{runtime-I2STBGPR.js → runtime-APNO3V6D.js} +48 -42
  205. package/chunks/{scheduler-6F7HETNO.js → scheduler-L6FYCGVO.js} +36 -32
  206. package/chunks/sdk-exporters-grpc-ETLH47EP.js +23214 -0
  207. package/chunks/sdk-exporters-http-IDGLRBGP.js +563 -0
  208. package/chunks/sdk-impl-5ESZBGJQ.js +9186 -0
  209. package/chunks/{send-message-WXVVK4DB.js → send-message-PYIJ2PZL.js} +6 -4
  210. package/chunks/{serve-4ATEWSEA.js → serve-6QBXDVWT.js} +42 -38
  211. package/chunks/{server-YPUPFV2O.js → server-5TJJEMVQ.js} +1006 -305
  212. package/chunks/{session-AZFIERIY.js → session-BWEUHKQB.js} +92 -176
  213. package/chunks/{settings-EFQHLTM3.js → settings-O7IUQNRR.js} +45 -41
  214. package/chunks/{shell-FWXWBJ4Q.js → shell-R5L4NQYY.js} +36 -32
  215. package/chunks/{skill-A634MNCD.js → skill-ITEOSNW6.js} +24 -20
  216. package/chunks/{spawnChannel-KKBGGR47.js → spawnChannel-E7NTWSGW.js} +38 -34
  217. package/chunks/{src-BVROLD6N.js → src-FFXGUTNL.js} +303 -237
  218. package/chunks/{standalone-update-ERLA3BDC.js → standalone-update-JCJOXW4P.js} +38 -34
  219. package/chunks/{startInteractiveUI-3VZ23WAY.js → startInteractiveUI-IJSBLZFO.js} +1057 -864
  220. package/chunks/{syntheticOutput-HCUFXSIA.js → syntheticOutput-H7RTI5KL.js} +4 -4
  221. package/chunks/{task-create-RIY5JTFC.js → task-create-7474AJJD.js} +10 -8
  222. package/chunks/{task-list-XBUCV3CO.js → task-list-633HGOIB.js} +6 -6
  223. package/chunks/{task-stop-QDFCCYR5.js → task-stop-MNUGHPIA.js} +3 -3
  224. package/chunks/{task-update-7PXKJQOI.js → task-update-66GQB5LI.js} +10 -8
  225. package/chunks/{team-create-ZZO7QFQ7.js → team-create-OVSZTJZO.js} +44 -40
  226. package/chunks/{team-delete-TNSSE2S5.js → team-delete-BB3CG3QF.js} +6 -6
  227. package/chunks/{team-plan-approval-3BZBJ46K.js → team-plan-approval-SLEVDLT5.js} +41 -37
  228. package/chunks/{theme-manager-FSFWNXFJ.js → theme-manager-V6ZQISHM.js} +37 -33
  229. package/chunks/{todoWrite-OMAIGB6V.js → todoWrite-KRAUN54W.js} +5 -5
  230. package/chunks/{tool-search-VYXAAIDW.js → tool-search-KYIF6C6E.js} +21 -17
  231. package/chunks/{total-session-admission-PSMLQICS.js → total-session-admission-EU77XTL7.js} +42 -38
  232. package/chunks/{trustedFolders-QA3RK2NV.js → trustedFolders-DDEF3ADH.js} +37 -33
  233. package/chunks/{update-relaunch-LNLZFX3J.js → update-relaunch-XEZTDP6K.js} +17 -17
  234. package/chunks/updateCheck-KZ5LZ545.js +89 -0
  235. package/chunks/{useAutoAcceptIndicator-DIWN27LT.js → useAutoAcceptIndicator-47EZERGQ.js} +47 -43
  236. package/chunks/{validateNonInterActiveAuth-LOEOFCAF.js → validateNonInterActiveAuth-J2DM4LWZ.js} +79 -75
  237. package/chunks/{version-HBF2VBLE.js → version-PN7WYXHP.js} +1 -1
  238. package/chunks/{web-fetch-BWGSD2BD.js → web-fetch-WRI5QRFR.js} +100 -42
  239. package/chunks/{web-search-OOHTCVR3.js → web-search-2HCXNAVX.js} +111 -60
  240. package/chunks/{workflow-LJAJBOR4.js → workflow-U5XBPGQZ.js} +48 -43
  241. package/chunks/workspace-providers-status-2T54GIJZ.js +79 -0
  242. package/chunks/{workspace-registration-store-4EHGQW4Y.js → workspace-registration-store-F3V4KBIW.js} +8 -2
  243. package/chunks/{workspace-registry-BKD7VC4Y.js → workspace-registry-U6QVZ5BU.js} +42 -38
  244. package/chunks/{workspace-service-75RHX6KR.js → workspace-service-734D36QD.js} +49 -45
  245. package/chunks/{workspace-skills-status-WBZBZI6A.js → workspace-skills-status-5ABUKOAQ.js} +43 -39
  246. package/chunks/write-file-CIH4I4CS.js +66 -0
  247. package/chunks/{zh-TW-4RR3YHNN.js → zh-TW-BM47YBFH.js} +5 -1
  248. package/chunks/{zh-6ANG2HTL.js → zh-WY5DWYZD.js} +5 -1
  249. package/cli-entry.js +164 -12
  250. package/cli.js +18 -11
  251. package/locales/ca.js +772 -203
  252. package/locales/de.js +8 -2
  253. package/locales/en.js +8 -2
  254. package/locales/fr.js +8 -2
  255. package/locales/ja.js +8 -2
  256. package/locales/pt.js +8 -2
  257. package/locales/ru.js +8 -2
  258. package/locales/zh-TW.js +8 -2
  259. package/locales/zh.js +8 -2
  260. package/package.json +3 -3
  261. package/web-shell/assets/{arc-Buk1besA.js → arc-ByltRugA.js} +1 -1
  262. package/web-shell/assets/{architectureDiagram-3BPJPVTR-B1aUKYDC.js → architectureDiagram-3BPJPVTR-CCRTto5d.js} +1 -1
  263. package/web-shell/assets/{blockDiagram-GPEHLZMM-CRTdg3Zx.js → blockDiagram-GPEHLZMM-Jfy36u1L.js} +1 -1
  264. package/web-shell/assets/{c4Diagram-AAUBKEIU-DFdRMp5g.js → c4Diagram-AAUBKEIU-4d5FfEZ0.js} +1 -1
  265. package/web-shell/assets/channel-4N2UIFcG.js +1 -0
  266. package/web-shell/assets/{chunk-2J33WTMH-4rYQdkEI.js → chunk-2J33WTMH-BPwxCEro.js} +1 -1
  267. package/web-shell/assets/{chunk-4BX2VUAB-Coi-pQJy.js → chunk-4BX2VUAB-jY7ZmJWY.js} +1 -1
  268. package/web-shell/assets/{chunk-55IACEB6-BtBjz02t.js → chunk-55IACEB6-C98HgCsS.js} +1 -1
  269. package/web-shell/assets/{chunk-727SXJPM-CGYOWorl.js → chunk-727SXJPM-cDu-ge-q.js} +1 -1
  270. package/web-shell/assets/{chunk-AQP2D5EJ-CH5AKhqx.js → chunk-AQP2D5EJ-BKdJwxXK.js} +1 -1
  271. package/web-shell/assets/{chunk-FMBD7UC4-Cd50-w85.js → chunk-FMBD7UC4-DnuxqwMu.js} +1 -1
  272. package/web-shell/assets/{chunk-ND2GUHAM-C2wF3KCK.js → chunk-ND2GUHAM-C4fZNPv0.js} +1 -1
  273. package/web-shell/assets/{chunk-QZHKN3VN-pCeRTaWi.js → chunk-QZHKN3VN-Cf4XWOmz.js} +1 -1
  274. package/web-shell/assets/classDiagram-4FO5ZUOK-Q4dYOtsh.js +1 -0
  275. package/web-shell/assets/classDiagram-v2-Q7XG4LA2-Q4dYOtsh.js +1 -0
  276. package/web-shell/assets/{cose-bilkent-S5V4N54A-B-_fAB6D.js → cose-bilkent-S5V4N54A-C82mFiqj.js} +1 -1
  277. package/web-shell/assets/{dagre-BM42HDAG-ChSPNHpL.js → dagre-BM42HDAG-Df8KACER.js} +1 -1
  278. package/web-shell/assets/{diagram-2AECGRRQ-BX7cFOF3.js → diagram-2AECGRRQ-EzNs7s_2.js} +1 -1
  279. package/web-shell/assets/{diagram-5GNKFQAL-BQUTW92n.js → diagram-5GNKFQAL-BRLNvreg.js} +1 -1
  280. package/web-shell/assets/{diagram-KO2AKTUF-BkYPh3e4.js → diagram-KO2AKTUF-2HLYHRjC.js} +1 -1
  281. package/web-shell/assets/{diagram-LMA3HP47-Cl6jsNyx.js → diagram-LMA3HP47-DeH0NzSp.js} +1 -1
  282. package/web-shell/assets/{diagram-OG6HWLK6-DRWoHz8n.js → diagram-OG6HWLK6-k5Gn47-G.js} +1 -1
  283. package/web-shell/assets/{erDiagram-TEJ5UH35-CGvFcZco.js → erDiagram-TEJ5UH35-gPHFo79f.js} +1 -1
  284. package/web-shell/assets/{flowDiagram-I6XJVG4X-vms6oVdv.js → flowDiagram-I6XJVG4X-DYBOiTRW.js} +1 -1
  285. package/web-shell/assets/{ganttDiagram-6RSMTGT7-ukT_sfmi.js → ganttDiagram-6RSMTGT7-cxjAuic9.js} +1 -1
  286. package/web-shell/assets/{gitGraphDiagram-PVQCEYII-Bn2ZE2Ut.js → gitGraphDiagram-PVQCEYII-3nPqpmCP.js} +1 -1
  287. package/web-shell/assets/index-B7jzUZ_s.css +5 -0
  288. package/web-shell/assets/{index-wFXp7W68.js → index-Cl8d-1bK.js} +1 -1
  289. package/web-shell/assets/index-gE8OWwj_.js +1197 -0
  290. package/web-shell/assets/{infoDiagram-5YYISTIA-DHJdSi7x.js → infoDiagram-5YYISTIA-Dph21pR5.js} +1 -1
  291. package/web-shell/assets/{ishikawaDiagram-YF4QCWOH-DOvd2Wph.js → ishikawaDiagram-YF4QCWOH-Cjg1hSaG.js} +1 -1
  292. package/web-shell/assets/{journeyDiagram-JHISSGLW-CH_urMCT.js → journeyDiagram-JHISSGLW-CR-IzvnU.js} +1 -1
  293. package/web-shell/assets/{kanban-definition-UN3LZRKU-FKiBdgbH.js → kanban-definition-UN3LZRKU-BYmuybuC.js} +1 -1
  294. package/web-shell/assets/{linear-0ZVQFVKf.js → linear-CngEEoy8.js} +1 -1
  295. package/web-shell/assets/{mermaid.core-DJ05ZZIK.js → mermaid.core-G6fbZRPf.js} +5 -5
  296. package/web-shell/assets/{mindmap-definition-RKZ34NQL-BPuUhkUm.js → mindmap-definition-RKZ34NQL-BtnqnUwJ.js} +1 -1
  297. package/web-shell/assets/{pieDiagram-4H26LBE5-yLFKcXyG.js → pieDiagram-4H26LBE5-XTq6UHIA.js} +1 -1
  298. package/web-shell/assets/{quadrantDiagram-W4KKPZXB-irWqc1pE.js → quadrantDiagram-W4KKPZXB-D1J5PrsS.js} +1 -1
  299. package/web-shell/assets/{requirementDiagram-4Y6WPE33-B_4uMoIV.js → requirementDiagram-4Y6WPE33-CLcBUy3t.js} +1 -1
  300. package/web-shell/assets/{sankeyDiagram-5OEKKPKP-ciA4GPwk.js → sankeyDiagram-5OEKKPKP-iwKV02_6.js} +1 -1
  301. package/web-shell/assets/{sequenceDiagram-3UESZ5HK-CRdZvy0U.js → sequenceDiagram-3UESZ5HK-7NFYQcEX.js} +1 -1
  302. package/web-shell/assets/{stateDiagram-AJRCARHV-DaYIkCCn.js → stateDiagram-AJRCARHV-Bvm4Wih6.js} +1 -1
  303. package/web-shell/assets/stateDiagram-v2-BHNVJYJU-xXU_zO2Z.js +1 -0
  304. package/web-shell/assets/{timeline-definition-PNZ67QCA-oBUKv6iH.js → timeline-definition-PNZ67QCA-B4FZFE9O.js} +1 -1
  305. package/web-shell/assets/{vennDiagram-CIIHVFJN-CGW9Sdmb.js → vennDiagram-CIIHVFJN-CvMBpmtL.js} +1 -1
  306. package/web-shell/assets/{wardley-L42UT6IY-CvwKJOCm.js → wardley-L42UT6IY-E3ag2327.js} +1 -1
  307. package/web-shell/assets/{wardleyDiagram-YWT4CUSO-Ipc260sN.js → wardleyDiagram-YWT4CUSO-BEXWlgxC.js} +1 -1
  308. package/web-shell/assets/{xychartDiagram-2RQKCTM6-D6-CM7pK.js → xychartDiagram-2RQKCTM6-CICK05gI.js} +1 -1
  309. package/web-shell/index.html +2 -2
  310. package/chunks/chunk-ETD6K42I.js +0 -358
  311. package/chunks/chunk-I5NLVPZJ.js +0 -45
  312. package/chunks/chunk-ONWW74X6.js +0 -74639
  313. package/chunks/chunk-W7FJ3N32.js +0 -49
  314. package/chunks/daemon-status-provider-LVTVJGAD.js +0 -77
  315. package/chunks/list-3CZR5I42.js +0 -78
  316. package/chunks/nonInteractiveCli-QTEHDDFH.js +0 -129
  317. package/chunks/updateCheck-JJEUQ54U.js +0 -73
  318. package/chunks/workspace-providers-status-FYV7TTHA.js +0 -75
  319. package/chunks/write-file-M2DTFILF.js +0 -599
  320. package/web-shell/assets/channel-04R0vLbG.js +0 -1
  321. package/web-shell/assets/classDiagram-4FO5ZUOK-Bw9SOwAV.js +0 -1
  322. package/web-shell/assets/classDiagram-v2-Q7XG4LA2-Bw9SOwAV.js +0 -1
  323. package/web-shell/assets/index-DgkKrjw3.js +0 -1187
  324. package/web-shell/assets/index-Rv6mOAN9.css +0 -5
  325. package/web-shell/assets/stateDiagram-v2-BHNVJYJU-DWBoO4UY.js +0 -1
  326. package/chunks/{chunk-PEJWA3QQ.js → chunk-QZJY47IE.js} +5 -5
@@ -20,9 +20,6 @@ import {
20
20
  MID_TURN_QUEUE_DRAIN_METHOD,
21
21
  TODO_STOP_GUARD_QUEUE_RELEASE_METHOD
22
22
  } from "./chunk-QR6U5QPP.js";
23
- import {
24
- defaultSpawnChannelFactory
25
- } from "./chunk-6GUTHAN7.js";
26
23
  import {
27
24
  BranchWhilePromptActiveError,
28
25
  CancelSentinelCollisionError,
@@ -34,6 +31,7 @@ import {
34
31
  InvalidSessionScopeError,
35
32
  MCP_RESTART_SERVER_DEADLINE_MS,
36
33
  PermissionForbiddenError,
34
+ PromptDeadlineExceededError,
37
35
  PromptQueueFullError,
38
36
  RestoreInProgressError,
39
37
  SessionBusyError,
@@ -43,7 +41,10 @@ import {
43
41
  SessionShellDisabledError,
44
42
  WorkspaceMismatchError,
45
43
  isNotCurrentlyGeneratingCancelError
46
- } from "./chunk-X6YQWCIJ.js";
44
+ } from "./chunk-UH3WSE5L.js";
45
+ import {
46
+ defaultSpawnChannelFactory
47
+ } from "./chunk-JHFVJQRO.js";
47
48
  import {
48
49
  BridgeChannelClosedError,
49
50
  BridgeTimeoutError,
@@ -52,15 +53,16 @@ import {
52
53
  STATUS_SCHEMA_VERSION,
53
54
  createIdleWorkspaceExtensionsStatus,
54
55
  createIdleWorkspaceHooksStatus
55
- } from "./chunk-WXAXH7IJ.js";
56
- import {
57
- canonicalizeWorkspace
58
- } from "./chunk-W7FJ3N32.js";
56
+ } from "./chunk-BWQRDISK.js";
59
57
  import {
60
58
  ClientSideConnection,
61
59
  PROTOCOL_VERSION,
62
60
  RequestError
63
61
  } from "./chunk-UDXSXLER.js";
62
+ import {
63
+ canonicalizeWorkspace,
64
+ translateAndCheckAbsoluteWorkspacePath
65
+ } from "./chunk-2RFKHEXL.js";
64
66
  import {
65
67
  SESSION_ARTIFACT_PERSISTENCE_VERSION,
66
68
  ShellExecutionService,
@@ -72,11 +74,11 @@ import {
72
74
  metadataBudgetBytes,
73
75
  normalizeSnapshotPayload,
74
76
  stableSessionArtifactId
75
- } from "./chunk-6OH6A5EX.js";
77
+ } from "./chunk-GEB2CGUV.js";
76
78
  import {
77
79
  DAEMON_TRACEPARENT_META_KEY,
78
80
  DAEMON_TRACESTATE_META_KEY
79
- } from "./chunk-ONWW74X6.js";
81
+ } from "./chunk-5G2SK2OO.js";
80
82
  import {
81
83
  init_esbuild_shims
82
84
  } from "./chunk-5O2XNYP6.js";
@@ -5040,6 +5042,12 @@ function isRecord3(value) {
5040
5042
  return typeof value === "object" && value !== null && !Array.isArray(value);
5041
5043
  }
5042
5044
  __name(isRecord3, "isRecord");
5045
+ function isDefinitiveAcpRequestError(error) {
5046
+ if (error instanceof RequestError) return true;
5047
+ if (!isRecord3(error)) return false;
5048
+ return typeof error["code"] === "number" && Number.isInteger(error["code"]) && typeof error["message"] === "string";
5049
+ }
5050
+ __name(isDefinitiveAcpRequestError, "isDefinitiveAcpRequestError");
5043
5051
  function getCanonicalModelId(response, fallback) {
5044
5052
  if (!isRecord3(response) || !isRecord3(response["_meta"])) return fallback;
5045
5053
  const modelSwitch = response["_meta"]["qwenModelSwitch"];
@@ -5399,6 +5407,57 @@ function broadcastTurnError(entry, sessionId, err, promptId, originatorClientId)
5399
5407
  }
5400
5408
  }
5401
5409
  __name(broadcastTurnError, "broadcastTurnError");
5410
+ function publishPromptTerminal(entry, pendingEntry, terminal) {
5411
+ if (pendingEntry.terminalPublished) {
5412
+ writeStderrLine(
5413
+ `publishPromptTerminal: suppressed duplicate ${terminal.kind} terminal for prompt ${pendingEntry.promptId} (session ${entry.sessionId})`
5414
+ );
5415
+ return;
5416
+ }
5417
+ pendingEntry.terminalPublished = true;
5418
+ const originatorClientId = pendingEntry.originatorClientId;
5419
+ if (terminal.kind === "complete") {
5420
+ broadcastTurnComplete(
5421
+ entry,
5422
+ entry.sessionId,
5423
+ terminal.result,
5424
+ pendingEntry.promptId,
5425
+ originatorClientId
5426
+ );
5427
+ } else if (terminal.kind === "cancelled") {
5428
+ broadcastTurnComplete(
5429
+ entry,
5430
+ entry.sessionId,
5431
+ { stopReason: "cancelled" },
5432
+ pendingEntry.promptId,
5433
+ originatorClientId
5434
+ );
5435
+ } else {
5436
+ broadcastTurnError(
5437
+ entry,
5438
+ entry.sessionId,
5439
+ terminal.err,
5440
+ pendingEntry.promptId,
5441
+ originatorClientId
5442
+ );
5443
+ }
5444
+ }
5445
+ __name(publishPromptTerminal, "publishPromptTerminal");
5446
+ function flushPromptTerminals(entry, code, message) {
5447
+ for (const pending of [...entry.pendingPromptList]) {
5448
+ publishPromptTerminal(entry, pending, {
5449
+ kind: "error",
5450
+ err: { code, message }
5451
+ });
5452
+ try {
5453
+ pending.abortController.abort(
5454
+ new DOMException("Prompt aborted", "AbortError")
5455
+ );
5456
+ } catch {
5457
+ }
5458
+ }
5459
+ }
5460
+ __name(flushPromptTerminals, "flushPromptTerminals");
5402
5461
  function hasControlCharacter2(value) {
5403
5462
  for (let i = 0; i < value.length; i += 1) {
5404
5463
  const code = value.charCodeAt(i);
@@ -5558,6 +5617,18 @@ function createAcpSessionBridge(opts) {
5558
5617
  lastActivityTimestamp = Date.now();
5559
5618
  }
5560
5619
  __name(touchActivity, "touchActivity");
5620
+ function settleActivePromptState(entry, promptId) {
5621
+ if (entry.activePromptId !== promptId) return;
5622
+ delete entry.activePromptId;
5623
+ delete entry.activePromptOriginatorClientId;
5624
+ if (entry.promptActive) {
5625
+ entry.promptActive = false;
5626
+ activePromptCounter--;
5627
+ entry.sessionLastSeenAt = Date.now();
5628
+ touchActivity();
5629
+ }
5630
+ }
5631
+ __name(settleActivePromptState, "settleActivePromptState");
5561
5632
  function resolvePositiveFiniteMs(raw, fallback) {
5562
5633
  if (raw === void 0) return fallback;
5563
5634
  return raw > 0 && Number.isFinite(raw) ? Math.min(raw, 2147483647) : 0;
@@ -5674,7 +5745,7 @@ function createAcpSessionBridge(opts) {
5674
5745
  if (shuttingDown) return;
5675
5746
  const now = Date.now();
5676
5747
  for (const [id, entry] of byId) {
5677
- if (entry.promptActive) continue;
5748
+ if (entry.pendingPromptCount > 0) continue;
5678
5749
  if (entry.events.subscriberCount > 0) continue;
5679
5750
  const lastActive = entry.sessionLastSeenAt ?? Date.parse(entry.createdAt);
5680
5751
  const idle = now - lastActive;
@@ -5731,7 +5802,8 @@ function createAcpSessionBridge(opts) {
5731
5802
  pendingInteractionCount: entry.pendingInteractions.size,
5732
5803
  hasTurnError: entry.turnError !== void 0,
5733
5804
  ...entry.turnError !== void 0 ? { turnError: entry.turnError } : {},
5734
- pendingInteractions: [...entry.pendingInteractions.values()]
5805
+ pendingInteractions: [...entry.pendingInteractions.values()],
5806
+ ...entry.worktree ? { worktree: entry.worktree } : {}
5735
5807
  };
5736
5808
  }, "toSessionSummary");
5737
5809
  const permissionConsensusQuorum = opts.permissionConsensusQuorum;
@@ -5793,13 +5865,30 @@ function createAcpSessionBridge(opts) {
5793
5865
  entry.clientIds.set(clientId, count - 1);
5794
5866
  }
5795
5867
  }, "unregisterClient");
5868
+ const recordAttachRef = /* @__PURE__ */ __name((entry, clientId) => {
5869
+ entry.attachRefs.set(clientId, (entry.attachRefs.get(clientId) ?? 0) + 1);
5870
+ }, "recordAttachRef");
5871
+ const releaseAttachRef = /* @__PURE__ */ __name((entry, clientId) => {
5872
+ const refs = entry.attachRefs.get(clientId);
5873
+ if (refs === void 0 || refs <= 0) return false;
5874
+ if (refs === 1) {
5875
+ entry.attachRefs.delete(clientId);
5876
+ } else {
5877
+ entry.attachRefs.set(clientId, refs - 1);
5878
+ }
5879
+ return true;
5880
+ }, "releaseAttachRef");
5796
5881
  const rollbackAttachRegistration = /* @__PURE__ */ __name(async (entry, clientId, attachCountDelta = 1) => {
5797
- entry.attachCount = Math.max(0, entry.attachCount - attachCountDelta);
5882
+ const released = releaseAttachRef(entry, clientId) ? 1 : 0;
5883
+ entry.attachCount = Math.max(
5884
+ 0,
5885
+ entry.attachCount - (released + (attachCountDelta - 1))
5886
+ );
5798
5887
  unregisterClient(entry, clientId);
5799
5888
  if (entry.spawnOwnerWantedKill && entry.attachCount === 0 && entry.events.subscriberCount === 0) {
5800
5889
  await bridgeApi.killSession(entry.sessionId).catch(() => {
5801
5890
  });
5802
- } else if (entry.clientIds.size === 0 && entry.events.subscriberCount === 0 && !entry.promptActive) {
5891
+ } else if (entry.clientIds.size === 0 && entry.events.subscriberCount === 0 && entry.pendingPromptCount === 0) {
5803
5892
  await closeSessionImpl(entry.sessionId, void 0, {
5804
5893
  reason: "last_client_detached"
5805
5894
  }).catch((err) => {
@@ -5968,6 +6057,11 @@ function createAcpSessionBridge(opts) {
5968
6057
  const sessEntry = byId.get(sid);
5969
6058
  if (!sessEntry) continue;
5970
6059
  cancelPendingForSession(sid);
6060
+ flushPromptTerminals(
6061
+ sessEntry,
6062
+ "channel_closed",
6063
+ "agent channel exited before the prompt completed"
6064
+ );
5971
6065
  try {
5972
6066
  sessEntry.events.publish({
5973
6067
  type: "session_died",
@@ -6062,7 +6156,7 @@ function createAcpSessionBridge(opts) {
6062
6156
  }
6063
6157
  }
6064
6158
  __name(ensureChannel, "ensureChannel");
6065
- async function doSpawn(modelServiceId, effectiveScope, approvalMode, requestedClientId, onSessionRegistered, parentSessionId, sourceType, sourceId) {
6159
+ async function doSpawn(modelServiceId, effectiveScope, approvalMode, requestedClientId, onSessionRegistered, parentSessionId, sourceType, sourceId, worktree) {
6066
6160
  const channelPath = channelInfo && !channelInfo.isDying ? "reused" : inFlightChannelSpawn ? "joined" : "spawned_on_request";
6067
6161
  const ci = await telemetry.withSpan(
6068
6162
  "channel.wait",
@@ -6123,7 +6217,7 @@ function createAcpSessionBridge(opts) {
6123
6217
  newSessionResp.sessionId,
6124
6218
  boundWorkspace,
6125
6219
  void 0,
6126
- { parentSessionId, sourceType, sourceId }
6220
+ { parentSessionId, sourceType, sourceId, worktree }
6127
6221
  );
6128
6222
  initializedSessionId = entry.sessionId;
6129
6223
  sessionRegistered = true;
@@ -6237,7 +6331,8 @@ function createAcpSessionBridge(opts) {
6237
6331
  ...entry.sourceType ? { sourceType: entry.sourceType } : {},
6238
6332
  ...entry.sourceId !== void 0 ? { sourceId: entry.sourceId } : {},
6239
6333
  ...entry.sourceType ? { sourcePersisted: sourcePersisted === true } : {},
6240
- ...entry.parentSessionId ? { parentSessionPersisted: parentSessionPersisted === true } : {}
6334
+ ...entry.parentSessionId ? { parentSessionPersisted: parentSessionPersisted === true } : {},
6335
+ ...entry.worktree ? { worktree: entry.worktree } : {}
6241
6336
  };
6242
6337
  } finally {
6243
6338
  ci.sessionSpawnsInFlight = Math.max(0, ci.sessionSpawnsInFlight - 1);
@@ -6447,10 +6542,11 @@ function createAcpSessionBridge(opts) {
6447
6542
  }
6448
6543
  return entry.transportClosedReject;
6449
6544
  }, "getTransportClosedReject");
6450
- const resolveWorkspaceKey = /* @__PURE__ */ __name((workspaceCwd) => {
6451
- if (!path3.isAbsolute(workspaceCwd)) {
6545
+ const resolveWorkspaceKey = /* @__PURE__ */ __name((rawWorkspaceCwd) => {
6546
+ const workspaceCwd = translateAndCheckAbsoluteWorkspacePath(rawWorkspaceCwd);
6547
+ if (workspaceCwd === null) {
6452
6548
  throw new Error(
6453
- `workspaceCwd must be an absolute path; got "${workspaceCwd}"`
6549
+ `workspaceCwd must be an absolute path; got "${rawWorkspaceCwd}"`
6454
6550
  );
6455
6551
  }
6456
6552
  const workspaceKey = workspaceCwd === boundWorkspace ? boundWorkspace : canonicalizeWorkspace(workspaceCwd);
@@ -6689,12 +6785,18 @@ function createAcpSessionBridge(opts) {
6689
6785
  return;
6690
6786
  }
6691
6787
  try {
6788
+ const closeRequest = entry.connection.extMethod(
6789
+ SERVE_CONTROL_EXT_METHODS.sessionClose,
6790
+ {
6791
+ sessionId: entry.sessionId,
6792
+ drainTimeoutMs: Math.max(1, Math.floor(initTimeoutMs * 0.8)),
6793
+ ...opts2?.requireFlush === true ? { requireFlush: true } : {}
6794
+ }
6795
+ );
6796
+ const observedCloseRequest = opts2?.timeoutMs ? withTimeout(closeRequest, opts2.timeoutMs, label) : closeRequest;
6692
6797
  await Promise.race([
6693
- withTimeout(
6694
- entry.connection.extMethod(SERVE_CONTROL_EXT_METHODS.sessionClose, {
6695
- sessionId: entry.sessionId,
6696
- ...opts2?.requireFlush === true ? { requireFlush: true } : {}
6697
- }),
6798
+ opts2?.throwOnFailure === true ? observedCloseRequest : withTimeout(
6799
+ observedCloseRequest,
6698
6800
  initTimeoutMs,
6699
6801
  SERVE_CONTROL_EXT_METHODS.sessionClose
6700
6802
  ),
@@ -6850,6 +6952,7 @@ function createAcpSessionBridge(opts) {
6850
6952
  ...options.parentSessionId ? { parentSessionId: options.parentSessionId } : {},
6851
6953
  ...options.sourceType ? { sourceType: options.sourceType } : {},
6852
6954
  ...options.sourceId !== void 0 ? { sourceId: options.sourceId } : {},
6955
+ ...options.worktree ? { worktree: options.worktree } : {},
6853
6956
  channel: ci.channel,
6854
6957
  connection: ci.connection,
6855
6958
  events,
@@ -6859,6 +6962,7 @@ function createAcpSessionBridge(opts) {
6859
6962
  persistence: createSessionArtifactPersistence(ci.connection, sessionId)
6860
6963
  }),
6861
6964
  recordingDegraded: false,
6965
+ closing: false,
6862
6966
  promptQueue: Promise.resolve(),
6863
6967
  pendingPromptCount: 0,
6864
6968
  pendingPromptList: [],
@@ -6872,6 +6976,7 @@ function createAcpSessionBridge(opts) {
6872
6976
  clientIds: /* @__PURE__ */ new Map(),
6873
6977
  clientLastSeenAt: /* @__PURE__ */ new Map(),
6874
6978
  attachCount: 0,
6979
+ attachRefs: /* @__PURE__ */ new Map(),
6875
6980
  spawnOwnerWantedKill: false,
6876
6981
  promptActive: false,
6877
6982
  retryAllowed: false
@@ -7074,8 +7179,15 @@ function createAcpSessionBridge(opts) {
7074
7179
  const historyReplay = action === "load" ? req.historyReplay ?? "stream" : "stream";
7075
7180
  const existing = byId.get(req.sessionId);
7076
7181
  if (existing) {
7182
+ if (existing.closing) {
7183
+ throw new SessionNotFoundError(
7184
+ req.sessionId,
7185
+ "The session is closing; retry after close completes"
7186
+ );
7187
+ }
7077
7188
  existing.attachCount++;
7078
7189
  const clientId = registerClient(existing, req.clientId);
7190
+ recordAttachRef(existing, clientId);
7079
7191
  if (req.approvalMode) {
7080
7192
  await applyApprovalModeForAttach(existing, req.approvalMode, clientId);
7081
7193
  }
@@ -7120,6 +7232,7 @@ function createAcpSessionBridge(opts) {
7120
7232
  );
7121
7233
  }
7122
7234
  const clientId = registerClient(entry, req.clientId);
7235
+ recordAttachRef(entry, clientId);
7123
7236
  if (req.approvalMode) {
7124
7237
  await applyApprovalModeForAttach(entry, req.approvalMode, clientId);
7125
7238
  }
@@ -7241,6 +7354,7 @@ function createAcpSessionBridge(opts) {
7241
7354
  restoreEvents.close();
7242
7355
  racedEntry.attachCount += 1 + coalesceState.count;
7243
7356
  const clientId2 = registerClient(racedEntry, req.clientId);
7357
+ recordAttachRef(racedEntry, clientId2);
7244
7358
  if (req.approvalMode) {
7245
7359
  try {
7246
7360
  await applyApprovalMode(
@@ -7387,10 +7501,17 @@ function createAcpSessionBridge(opts) {
7387
7501
  async function closeSessionImpl(sessionId, context, closeOpts) {
7388
7502
  const entry = byId.get(sessionId);
7389
7503
  if (!entry) throw new SessionNotFoundError(sessionId);
7504
+ if (entry.closing) {
7505
+ throw new SessionNotFoundError(
7506
+ sessionId,
7507
+ "The session is already closing"
7508
+ );
7509
+ }
7390
7510
  let originatorClientId;
7391
7511
  if (context?.clientId !== void 0) {
7392
7512
  originatorClientId = resolveTrustedClientId(entry, context.clientId);
7393
7513
  }
7514
+ entry.closing = true;
7394
7515
  const reason = closeOpts?.reason ?? "client_close";
7395
7516
  writeStderrLine(
7396
7517
  `qwen serve: closing session ${JSON.stringify(sessionId)} (reason: ${reason})` + (originatorClientId ? ` by client ${JSON.stringify(originatorClientId)}` : "")
@@ -7400,26 +7521,37 @@ function createAcpSessionBridge(opts) {
7400
7521
  "session.id": sessionId,
7401
7522
  "session.close.reason": reason
7402
7523
  });
7403
- if (defaultEntry === entry) defaultEntry = void 0;
7404
7524
  const ci = channelInfoForEntry(entry);
7405
7525
  if (!ci) {
7406
7526
  writeStderrLine(
7407
7527
  `qwen serve: closeSession channelInfoForEntry returned undefined for session ${JSON.stringify(sessionId)} \u2014 channel cleanup skipped (entry's channel already torn down)`
7408
7528
  );
7409
7529
  }
7410
- const requireAgentClose = closeOpts?.requireAgentClose === true;
7411
- if (requireAgentClose) {
7530
+ try {
7531
+ permissionMediator.forgetSession(sessionId);
7532
+ entry.pendingPermissionIds.clear();
7533
+ entry.pendingInteractions.clear();
7412
7534
  await notifyAgentSessionClose(entry, ci, "closeSession", {
7413
7535
  throwOnFailure: true,
7414
- requireFlush: true
7536
+ requireFlush: closeOpts?.requireAgentClose === true
7415
7537
  });
7538
+ } catch (error) {
7539
+ if (isDefinitiveAcpRequestError(error)) {
7540
+ entry.closing = false;
7541
+ } else if (ci) {
7542
+ await killChannelWithLog(
7543
+ ci,
7544
+ `recover unknown close outcome for session ${JSON.stringify(sessionId)}`
7545
+ );
7546
+ } else {
7547
+ entry.closing = false;
7548
+ }
7549
+ throw error;
7416
7550
  }
7551
+ if (defaultEntry === entry) defaultEntry = void 0;
7417
7552
  if (ci && ci.channel === entry.channel) {
7418
7553
  ci.sessionIds.delete(sessionId);
7419
7554
  }
7420
- permissionMediator.forgetSession(sessionId);
7421
- entry.pendingPermissionIds.clear();
7422
- entry.pendingInteractions.clear();
7423
7555
  if (entry.promptActive) {
7424
7556
  entry.promptActive = false;
7425
7557
  activePromptCounter--;
@@ -7434,6 +7566,11 @@ function createAcpSessionBridge(opts) {
7434
7566
  reason
7435
7567
  });
7436
7568
  ci?.client.markSessionClosed(sessionId);
7569
+ flushPromptTerminals(
7570
+ entry,
7571
+ "session_closed",
7572
+ "session closed before the prompt completed"
7573
+ );
7437
7574
  try {
7438
7575
  entry.events.publish({
7439
7576
  type: "session_closed",
@@ -7451,9 +7588,6 @@ function createAcpSessionBridge(opts) {
7451
7588
  } catch {
7452
7589
  }
7453
7590
  entry.events.close();
7454
- if (!requireAgentClose) {
7455
- await notifyAgentSessionClose(entry, ci, "closeSession");
7456
- }
7457
7591
  try {
7458
7592
  await telemetry.withSpan(
7459
7593
  "session.close.cancel_active_prompt",
@@ -7568,8 +7702,15 @@ function createAcpSessionBridge(opts) {
7568
7702
  if (effectiveScope === "single") {
7569
7703
  const existing = defaultEntry;
7570
7704
  if (existing) {
7705
+ if (existing.closing) {
7706
+ throw new SessionNotFoundError(
7707
+ existing.sessionId,
7708
+ "The session is closing; retry after close completes"
7709
+ );
7710
+ }
7571
7711
  existing.attachCount++;
7572
7712
  const clientId = registerClient(existing, req.clientId);
7713
+ recordAttachRef(existing, clientId);
7573
7714
  if (req.modelServiceId) {
7574
7715
  await applyModelServiceId(
7575
7716
  existing,
@@ -7609,6 +7750,7 @@ function createAcpSessionBridge(opts) {
7609
7750
  );
7610
7751
  }
7611
7752
  const clientId = registerClient(attachedEntry, req.clientId);
7753
+ recordAttachRef(attachedEntry, clientId);
7612
7754
  if (req.modelServiceId) {
7613
7755
  await applyModelServiceId(
7614
7756
  attachedEntry,
@@ -7654,7 +7796,8 @@ function createAcpSessionBridge(opts) {
7654
7796
  releaseAdmissionOnce,
7655
7797
  req.parentSessionId,
7656
7798
  source.sourceType,
7657
- source.sourceId
7799
+ source.sourceId,
7800
+ req.worktree
7658
7801
  );
7659
7802
  const tracker = effectiveScope === "single" ? workspaceKey : `${workspaceKey}#${randomUUID2()}`;
7660
7803
  inFlightSpawns.set(tracker, promise);
@@ -7676,6 +7819,14 @@ function createAcpSessionBridge(opts) {
7676
7819
  const queuedAt = Date.now();
7677
7820
  const entry = byId.get(sessionId);
7678
7821
  if (!entry) return Promise.reject(new SessionNotFoundError(sessionId));
7822
+ if (entry.closing) {
7823
+ return Promise.reject(
7824
+ new SessionNotFoundError(
7825
+ sessionId,
7826
+ "The session is closing; retry after close completes"
7827
+ )
7828
+ );
7829
+ }
7679
7830
  const originatorClientId = resolveTrustedClientId(
7680
7831
  entry,
7681
7832
  context?.clientId
@@ -7720,6 +7871,37 @@ function createAcpSessionBridge(opts) {
7720
7871
  state: isQueued ? "queued" : "running"
7721
7872
  };
7722
7873
  entry.pendingPromptList.push(pendingEntry);
7874
+ const deadlineMs = context?.deadlineMs;
7875
+ const hasDeadline = typeof deadlineMs === "number" && Number.isFinite(deadlineMs) && deadlineMs > 0;
7876
+ let deadlineReject;
7877
+ let deadlinePromise;
7878
+ let deadlineTimer;
7879
+ if (hasDeadline) {
7880
+ deadlinePromise = new Promise((_resolve, reject) => {
7881
+ deadlineReject = reject;
7882
+ });
7883
+ deadlinePromise.catch(() => {
7884
+ });
7885
+ const onDeadline = /* @__PURE__ */ __name(() => {
7886
+ if (pendingEntry.terminalPublished) return;
7887
+ const deadlineErr = new PromptDeadlineExceededError(deadlineMs);
7888
+ writeStderrLine(
7889
+ `sendPrompt: prompt ${promptId} exceeded ${deadlineMs}ms deadline for session ${sessionId}; agent may still be executing`
7890
+ );
7891
+ publishPromptTerminal(entry, pendingEntry, {
7892
+ kind: "error",
7893
+ err: {
7894
+ code: "prompt_deadline_exceeded",
7895
+ message: deadlineErr.message
7896
+ }
7897
+ });
7898
+ settleActivePromptState(entry, pendingEntry.promptId);
7899
+ deadlineReject?.(deadlineErr);
7900
+ pendingAbort.abort(deadlineErr);
7901
+ }, "onDeadline");
7902
+ deadlineTimer = setTimeout(onDeadline, deadlineMs);
7903
+ deadlineTimer.unref();
7904
+ }
7723
7905
  if (isQueued) {
7724
7906
  pendingAbort.signal.addEventListener(
7725
7907
  "abort",
@@ -7837,35 +8019,17 @@ function createAcpSessionBridge(opts) {
7837
8019
  );
7838
8020
  }
7839
8021
  } catch (echoErr) {
7840
- delete entry.activePromptId;
7841
- delete entry.activePromptOriginatorClientId;
7842
- if (entry.promptActive) {
7843
- entry.promptActive = false;
7844
- activePromptCounter--;
7845
- touchActivity();
7846
- }
8022
+ settleActivePromptState(entry, pendingEntry.promptId);
7847
8023
  throw echoErr;
7848
8024
  }
7849
8025
  const promptPromise = entry.connection.prompt(promptRequest).finally(() => {
7850
- if (entry.promptActive) {
7851
- entry.promptActive = false;
7852
- activePromptCounter--;
7853
- entry.sessionLastSeenAt = Date.now();
7854
- touchActivity();
7855
- }
7856
- delete entry.activePromptId;
7857
- delete entry.activePromptOriginatorClientId;
7858
- if (entry.clientIds.size === 0 && entry.events.subscriberCount === 0 && byId.has(sessionId)) {
7859
- void closeSessionImpl(sessionId, void 0, {
7860
- reason: "last_client_detached"
7861
- }).catch((err) => {
7862
- writeStderrLine(
7863
- `qwen serve: deferred close-on-prompt-complete failed for ${JSON.stringify(sessionId)}: ${err instanceof Error ? err.stack ?? err.message : String(err)}`
7864
- );
7865
- });
7866
- }
8026
+ settleActivePromptState(entry, pendingEntry.promptId);
7867
8027
  });
7868
- const racedPromise = Promise.race([
8028
+ const racedPromise = deadlinePromise ? Promise.race([
8029
+ promptPromise,
8030
+ getTransportClosedReject(entry),
8031
+ deadlinePromise
8032
+ ]) : Promise.race([
7869
8033
  promptPromise,
7870
8034
  getTransportClosedReject(entry)
7871
8035
  ]);
@@ -7873,6 +8037,9 @@ function createAcpSessionBridge(opts) {
7873
8037
  () => {
7874
8038
  },
7875
8039
  (err) => {
8040
+ if (err instanceof PromptDeadlineExceededError) {
8041
+ return;
8042
+ }
7876
8043
  if (err instanceof DOMException && err.name === "AbortError" && pendingEntry.state === "queued") {
7877
8044
  writeStderrLine(
7878
8045
  `sendPrompt: queued prompt removed before agent forward for session ${sessionId}`
@@ -7935,23 +8102,17 @@ function createAcpSessionBridge(opts) {
7935
8102
  );
7936
8103
  result.then(
7937
8104
  (promptResult) => {
7938
- broadcastTurnComplete(
7939
- entry,
7940
- sessionId,
7941
- promptResult,
7942
- pendingEntry.promptId,
7943
- originatorClientId
7944
- );
8105
+ publishPromptTerminal(entry, pendingEntry, {
8106
+ kind: "complete",
8107
+ result: promptResult
8108
+ });
7945
8109
  },
7946
8110
  (err) => {
7947
- if (err instanceof DOMException && err.name === "AbortError") return;
7948
- broadcastTurnError(
7949
- entry,
7950
- sessionId,
7951
- err,
7952
- pendingEntry.promptId,
7953
- originatorClientId
7954
- );
8111
+ if (err instanceof DOMException && err.name === "AbortError") {
8112
+ publishPromptTerminal(entry, pendingEntry, { kind: "cancelled" });
8113
+ return;
8114
+ }
8115
+ publishPromptTerminal(entry, pendingEntry, { kind: "error", err });
7955
8116
  }
7956
8117
  );
7957
8118
  entry.promptQueue = result.then(
@@ -7959,6 +8120,7 @@ function createAcpSessionBridge(opts) {
7959
8120
  () => void 0
7960
8121
  );
7961
8122
  result.finally(() => {
8123
+ if (deadlineTimer !== void 0) clearTimeout(deadlineTimer);
7962
8124
  const listIdx = entry.pendingPromptList.indexOf(pendingEntry);
7963
8125
  if (listIdx !== -1) {
7964
8126
  entry.pendingPromptList.splice(listIdx, 1);
@@ -7985,6 +8147,15 @@ function createAcpSessionBridge(opts) {
7985
8147
  );
7986
8148
  entry.midTurnMessageQueue.length = 0;
7987
8149
  }
8150
+ if (entry.clientIds.size === 0 && entry.events.subscriberCount === 0 && entry.pendingPromptCount === 0 && byId.get(sessionId) === entry) {
8151
+ void closeSessionImpl(sessionId, void 0, {
8152
+ reason: "last_client_detached"
8153
+ }).catch((err) => {
8154
+ writeStderrLine(
8155
+ `qwen serve: deferred close-on-prompt-complete failed for ${JSON.stringify(sessionId)}: ${err instanceof Error ? err.stack ?? err.message : String(err)}`
8156
+ );
8157
+ });
8158
+ }
7988
8159
  }).catch(() => {
7989
8160
  });
7990
8161
  return result;
@@ -8260,7 +8431,8 @@ function createAcpSessionBridge(opts) {
8260
8431
  SERVE_CONTROL_EXT_METHODS.sessionCd,
8261
8432
  {
8262
8433
  sessionId,
8263
- path: req.path
8434
+ path: req.path,
8435
+ ...req.allowedRoots ? { allowedRoots: req.allowedRoots } : {}
8264
8436
  }
8265
8437
  );
8266
8438
  const extResult = raw;
@@ -8296,6 +8468,12 @@ function createAcpSessionBridge(opts) {
8296
8468
  );
8297
8469
  return { sessionId, ...result };
8298
8470
  },
8471
+ setSessionWorktree(sessionId, worktree) {
8472
+ const entry = byId.get(sessionId);
8473
+ if (entry) {
8474
+ entry.worktree = worktree;
8475
+ }
8476
+ },
8299
8477
  async closeSession(sessionId, context, closeOpts) {
8300
8478
  return closeSessionImpl(sessionId, context, closeOpts);
8301
8479
  },
@@ -9126,6 +9304,9 @@ function createAcpSessionBridge(opts) {
9126
9304
  });
9127
9305
  } catch {
9128
9306
  }
9307
+ if (target.state === "queued") {
9308
+ publishPromptTerminal(entry, target, { kind: "cancelled" });
9309
+ }
9129
9310
  return { removed: true };
9130
9311
  },
9131
9312
  enqueueMidTurnMessage(sessionId, message, context) {
@@ -9373,6 +9554,9 @@ function createAcpSessionBridge(opts) {
9373
9554
  async rewindSession(sessionId, req, context) {
9374
9555
  const entry = byId.get(sessionId);
9375
9556
  if (!entry) throw new SessionNotFoundError(sessionId);
9557
+ if (entry.closing) {
9558
+ throw new SessionNotFoundError(sessionId, "The session is closing");
9559
+ }
9376
9560
  const info = channelInfoForEntry(entry);
9377
9561
  if (!info || info.isDying) throw new SessionNotFoundError(sessionId);
9378
9562
  const originatorClientId = resolveTrustedClientId(
@@ -9684,9 +9868,41 @@ function createAcpSessionBridge(opts) {
9684
9868
  entry.spawnOwnerWantedKill = true;
9685
9869
  return false;
9686
9870
  }
9871
+ if (entry.closing) {
9872
+ const closingChannel = channelInfoForEntry(entry);
9873
+ if (!closingChannel) return false;
9874
+ await killChannelWithLog(
9875
+ closingChannel,
9876
+ `force kill closing session ${JSON.stringify(sessionId)}`
9877
+ );
9878
+ return true;
9879
+ }
9880
+ entry.closing = true;
9881
+ const ci = channelInfoForEntry(entry);
9882
+ if (!ci) {
9883
+ writeStderrLine(
9884
+ `qwen serve: killSession channelInfoForEntry returned undefined for session ${JSON.stringify(sessionId)} \u2014 channel cleanup skipped (entry's channel already torn down)`
9885
+ );
9886
+ }
9687
9887
  permissionMediator.forgetSession(sessionId);
9688
9888
  entry.pendingPermissionIds.clear();
9689
9889
  entry.pendingInteractions.clear();
9890
+ try {
9891
+ await notifyAgentSessionClose(entry, ci, "killSession", {
9892
+ throwOnFailure: true,
9893
+ timeoutMs: initTimeoutMs
9894
+ });
9895
+ } catch (error) {
9896
+ if (ci) {
9897
+ await killChannelWithLog(
9898
+ ci,
9899
+ `force kill session ${JSON.stringify(sessionId)}`
9900
+ );
9901
+ return true;
9902
+ }
9903
+ entry.closing = false;
9904
+ throw error;
9905
+ }
9690
9906
  if (entry.promptActive) {
9691
9907
  entry.promptActive = false;
9692
9908
  activePromptCounter--;
@@ -9701,17 +9917,15 @@ function createAcpSessionBridge(opts) {
9701
9917
  workspaceCwd: entry.workspaceCwd,
9702
9918
  reason: "killed"
9703
9919
  });
9704
- const ci = channelInfoForEntry(entry);
9705
- if (!ci) {
9706
- writeStderrLine(
9707
- `qwen serve: killSession channelInfoForEntry returned undefined for session ${JSON.stringify(sessionId)} \u2014 channel cleanup skipped (entry's channel already torn down)`
9708
- );
9709
- }
9710
9920
  if (ci && ci.channel === entry.channel) {
9711
9921
  ci.sessionIds.delete(sessionId);
9712
9922
  }
9713
- await notifyAgentSessionClose(entry, ci, "killSession");
9714
9923
  ci?.client.markSessionClosed(sessionId);
9924
+ flushPromptTerminals(
9925
+ entry,
9926
+ "session_killed",
9927
+ "session killed before the prompt completed"
9928
+ );
9715
9929
  try {
9716
9930
  entry.events.publish({
9717
9931
  type: "session_died",
@@ -9731,12 +9945,14 @@ function createAcpSessionBridge(opts) {
9731
9945
  async detachClient(sessionId, clientId) {
9732
9946
  const entry = byId.get(sessionId);
9733
9947
  if (!entry) return;
9734
- if (entry.attachCount > 0) entry.attachCount--;
9948
+ if (clientId !== void 0 && releaseAttachRef(entry, clientId)) {
9949
+ if (entry.attachCount > 0) entry.attachCount--;
9950
+ }
9735
9951
  unregisterClient(entry, clientId);
9736
9952
  if (entry.spawnOwnerWantedKill && entry.attachCount === 0 && entry.events.subscriberCount === 0) {
9737
9953
  await this.killSession(sessionId).catch(() => {
9738
9954
  });
9739
- } else if (entry.clientIds.size === 0 && entry.events.subscriberCount === 0 && !entry.promptActive) {
9955
+ } else if (entry.clientIds.size === 0 && entry.events.subscriberCount === 0 && entry.pendingPromptCount === 0) {
9740
9956
  await closeSessionImpl(sessionId, void 0, {
9741
9957
  reason: "last_client_detached"
9742
9958
  }).catch((err) => {
@@ -9800,6 +10016,11 @@ function createAcpSessionBridge(opts) {
9800
10016
  workspaceCwd: e.workspaceCwd,
9801
10017
  reason: shutdownReason
9802
10018
  });
10019
+ flushPromptTerminals(
10020
+ e,
10021
+ "daemon_shutdown",
10022
+ "daemon shut down before the prompt completed"
10023
+ );
9803
10024
  try {
9804
10025
  e.events.publish({
9805
10026
  type: "session_died",