@qwen-code/qwen-code 0.21.11-preview.0 → 0.21.11

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 (360) hide show
  1. package/bundled/coordinate/SKILL.md +52 -0
  2. package/bundled/qc-helper/docs/configuration/model-providers.md +10 -8
  3. package/bundled/qc-helper/docs/features/_meta.ts +1 -0
  4. package/bundled/qc-helper/docs/features/arena.md +4 -3
  5. package/bundled/qc-helper/docs/features/commands.md +7 -6
  6. package/bundled/qc-helper/docs/features/dual-output.md +5 -0
  7. package/bundled/qc-helper/docs/features/headless.md +8 -0
  8. package/bundled/qc-helper/docs/features/multi-agent-coordination.md +30 -0
  9. package/bundled/qc-helper/docs/qwen-serve.md +7 -7
  10. package/bundled/review/SKILL.md +17 -7
  11. package/chunks/{MaxSizedBox-FVSXOMKP.js → MaxSizedBox-G7QPSZTF.js} +45 -44
  12. package/chunks/{StandaloneSessionPicker-Q27UAQ3X.js → StandaloneSessionPicker-3CTEPV7S.js} +65 -64
  13. package/chunks/{acp-startup-profiler-VNTFWYAC.js → acp-startup-profiler-JMJBZDVO.js} +2 -2
  14. package/chunks/{acpAgent-C6TV2BIU.js → acpAgent-43JURWOW.js} +1107 -285
  15. package/chunks/{agent-IPODFZTU.js → agent-MIY4LJJJ.js} +42 -41
  16. package/chunks/agent-headless-LWVA6GR5.js +87 -0
  17. package/chunks/{anthropicContentGenerator-D3Y4RFT4.js → anthropicContentGenerator-7HEP7Q5D.js} +8 -8
  18. package/chunks/{artifact-tool-N652YE4L.js → artifact-tool-M7UAJ5NT.js} +2 -2
  19. package/chunks/{askUserQuestion-ONW74PKJ.js → askUserQuestion-7G3LI3IZ.js} +2 -2
  20. package/chunks/{bridge-YX2R6VVM.js → bridge-PTTJEBNP.js} +47 -46
  21. package/chunks/{ca-ZLKAB4K3.js → ca-4CQ6MYNQ.js} +2 -1
  22. package/chunks/{channel-management-service-PHELKOW2.js → channel-management-service-PQ6SU56M.js} +6 -6
  23. package/chunks/channel-settings-store-IKK34GMH.js +102 -0
  24. package/chunks/{channel-worker-group-WQP4RCDO.js → channel-worker-group-WBRE33ZV.js} +8 -7
  25. package/chunks/{channel-worker-manager-MRDFAKIM.js → channel-worker-manager-V4LYVTPH.js} +8 -7
  26. package/chunks/{channel-worker-supervisor-IVSDIMI4.js → channel-worker-supervisor-YDAGW2RP.js} +6 -5
  27. package/chunks/{chunk-I7XTOGIS.js → chunk-23GFHEM3.js} +4 -4
  28. package/chunks/{chunk-IIJEYBNH.js → chunk-25OFRBH2.js} +188 -58
  29. package/chunks/{chunk-E2XBEWAK.js → chunk-2AAFGCWP.js} +650 -129
  30. package/chunks/{chunk-J6SZID63.js → chunk-2AZMF6G5.js} +2 -2
  31. package/chunks/{chunk-VVSMEI6C.js → chunk-2R2HYSUQ.js} +21 -102
  32. package/chunks/{chunk-DZUO626D.js → chunk-2XZWO53E.js} +3 -3
  33. package/chunks/{chunk-VKJ4KTPJ.js → chunk-3GCU5O2E.js} +1 -1
  34. package/chunks/{chunk-AJ6LQ5A6.js → chunk-3LHYTQ2R.js} +1 -1
  35. package/chunks/{chunk-LU7RJB2W.js → chunk-3SOTXJNO.js} +8 -8
  36. package/chunks/{chunk-SKSOLRPK.js → chunk-45HPDU3F.js} +3 -3
  37. package/chunks/{chunk-OWMAZHIX.js → chunk-47FQVRCO.js} +1 -1
  38. package/chunks/{chunk-K4QON4BH.js → chunk-4C4QSXE3.js} +23 -23
  39. package/chunks/{chunk-UMEB4DHF.js → chunk-4EX3DBFH.js} +4 -4
  40. package/chunks/{chunk-MFDYOYZZ.js → chunk-4MHDNGAV.js} +25 -2
  41. package/chunks/{chunk-SVY7G3WS.js → chunk-4PFKN7CQ.js} +7 -7
  42. package/chunks/{chunk-HV76SFIA.js → chunk-5HBFERG5.js} +3 -3
  43. package/chunks/{chunk-WAUGQKUU.js → chunk-6LYDH7VT.js} +9 -5
  44. package/chunks/{chunk-S6HYI3MF.js → chunk-6S52N6PG.js} +2 -2
  45. package/chunks/{chunk-FVKHVJZQ.js → chunk-732MOPEM.js} +1 -1
  46. package/chunks/{chunk-UHJ5S7DF.js → chunk-7QE3QFU3.js} +8 -8
  47. package/chunks/{chunk-WCG5O7IP.js → chunk-7SUQZ7QH.js} +2 -2
  48. package/chunks/{chunk-CQGGDOR5.js → chunk-AAOONL5N.js} +1 -1
  49. package/chunks/{chunk-B7SQOICP.js → chunk-AKLY5M2C.js} +4 -4
  50. package/chunks/{chunk-UVX4Y6IN.js → chunk-AQHNAA7E.js} +1 -1
  51. package/chunks/{chunk-DVQECPGW.js → chunk-BIXG46YI.js} +12 -12
  52. package/chunks/{chunk-4TRQPFDP.js → chunk-BJKREW56.js} +6 -8
  53. package/chunks/{chunk-7S4DYMFG.js → chunk-BNRNVMOT.js} +27 -18
  54. package/chunks/{chunk-PIA35YOG.js → chunk-BR6TUEKJ.js} +9 -8
  55. package/chunks/{chunk-Q3JQ7OSU.js → chunk-BTYS2JAY.js} +1 -1
  56. package/chunks/{chunk-H6XPXXMH.js → chunk-CQ35AJ4Z.js} +252 -254
  57. package/chunks/{chunk-COBO5EBO.js → chunk-CTQE2NB2.js} +1 -1
  58. package/chunks/{chunk-MTE6R5HF.js → chunk-DEKY5Y7V.js} +3 -3
  59. package/chunks/{chunk-BCZ2TTSH.js → chunk-DM4C3OX5.js} +1 -1
  60. package/chunks/{chunk-HDHLWOG5.js → chunk-DSKLWQHC.js} +2 -2
  61. package/chunks/{chunk-KKBPOU75.js → chunk-EFIMD5VA.js} +1 -1
  62. package/chunks/{chunk-CTJLZLB5.js → chunk-EN2J77G7.js} +1 -1
  63. package/chunks/{chunk-67EWJE77.js → chunk-ENEEQMGM.js} +1 -1
  64. package/chunks/{chunk-RKCPPZV6.js → chunk-EOBM4T2Z.js} +1 -1
  65. package/chunks/{chunk-7C7RTJPC.js → chunk-ESVSQKPY.js} +4 -4
  66. package/chunks/{chunk-CPG6P4GG.js → chunk-EYS3GGM3.js} +1 -1
  67. package/chunks/{chunk-4PYCZH2V.js → chunk-EYW54TBD.js} +3 -3
  68. package/chunks/{chunk-UXV3DYVT.js → chunk-F4T5J34H.js} +1 -1
  69. package/chunks/{chunk-FOGU3LJX.js → chunk-F6AOBFUN.js} +1 -1
  70. package/chunks/{chunk-ZBVS26BY.js → chunk-FPGTNKCP.js} +7 -5
  71. package/chunks/{chunk-BO2VRKY2.js → chunk-G64M7R2Y.js} +5 -5
  72. package/chunks/{chunk-EI3HZX6C.js → chunk-GJJQV4PY.js} +1 -1
  73. package/chunks/{chunk-CKASRHZI.js → chunk-GLWWPFTW.js} +1 -1
  74. package/chunks/{chunk-GM463R2B.js → chunk-GZGDJ4E6.js} +1 -1
  75. package/chunks/{chunk-W5UC37EE.js → chunk-HHGQGTJQ.js} +2 -0
  76. package/chunks/chunk-HHJLM3WQ.js +41 -0
  77. package/chunks/{chunk-2Z6PYTOK.js → chunk-HMCSRTDY.js} +1 -1
  78. package/chunks/{chunk-L2AFWWJE.js → chunk-HUE2M6VI.js} +50 -5
  79. package/chunks/{chunk-F32C6V5B.js → chunk-HZV75ET2.js} +3 -3
  80. package/chunks/{chunk-6ZRFAKXK.js → chunk-IEP44U2R.js} +1 -1
  81. package/chunks/{chunk-AOHJKPKL.js → chunk-IQFYO5BF.js} +1 -1
  82. package/chunks/{chunk-UDXSXLER.js → chunk-IW6RQPQB.js} +14 -4
  83. package/chunks/{chunk-XCWO3SMQ.js → chunk-IX7CFQGA.js} +3 -3
  84. package/chunks/{chunk-UO2N5QWP.js → chunk-J4EVBAB3.js} +27 -4
  85. package/chunks/{chunk-ZZCWJWTF.js → chunk-JHMFKJEP.js} +1 -1
  86. package/chunks/{chunk-Y3NNBNGM.js → chunk-JKEO6OQY.js} +4 -4
  87. package/chunks/{chunk-6Q5ABMTU.js → chunk-JLYYGKRN.js} +23 -19
  88. package/chunks/{chunk-HOUK5CR2.js → chunk-JOXXPM3X.js} +6 -6
  89. package/chunks/{chunk-E2FPSSKP.js → chunk-JPA7IDTE.js} +57 -13
  90. package/chunks/{chunk-OQTXYMKW.js → chunk-JS4Q5NG5.js} +3 -3
  91. package/chunks/{chunk-PBRVUF5B.js → chunk-K7JW6V5O.js} +1 -1
  92. package/chunks/{chunk-3P2LV43B.js → chunk-KCCODSAA.js} +3 -3
  93. package/chunks/{chunk-DREZZAZM.js → chunk-KCDQGIHS.js} +13 -5
  94. package/chunks/{chunk-KHLBIO6M.js → chunk-KFCTC5IJ.js} +11 -11
  95. package/chunks/{chunk-M6HMMKVG.js → chunk-KPVVWKF3.js} +1 -1
  96. package/chunks/{chunk-MVUQRLOH.js → chunk-KT4OWAAZ.js} +3 -3
  97. package/chunks/{chunk-W4RQUHY3.js → chunk-L2GTEEEU.js} +142 -23
  98. package/chunks/{chunk-X7XXP7CN.js → chunk-LA3FF7RO.js} +2 -2
  99. package/chunks/{chunk-DX3RGJMS.js → chunk-LT532KF4.js} +71 -12
  100. package/chunks/{chunk-JT7XS4YW.js → chunk-M2NMFAFR.js} +1 -1
  101. package/chunks/{chunk-YTFDX4PR.js → chunk-M6NDLY2T.js} +1 -1
  102. package/chunks/{chunk-VBU76UYP.js → chunk-MCHGE3EC.js} +302 -290
  103. package/chunks/{chunk-3WOZVMGJ.js → chunk-MDQSCFAZ.js} +7 -7
  104. package/chunks/{chunk-EKPKKXY2.js → chunk-MLZCPGDX.js} +1 -1
  105. package/chunks/{chunk-OIVKILPI.js → chunk-MPBRV3UU.js} +3 -0
  106. package/chunks/{chunk-VFMASYQA.js → chunk-MS7GNABG.js} +3 -0
  107. package/chunks/{chunk-2FRY5CRX.js → chunk-MWZYNOCG.js} +3 -3
  108. package/chunks/{chunk-ONSZH6VM.js → chunk-MZQ4I4AP.js} +2 -2
  109. package/chunks/{chunk-TG3IUQ6M.js → chunk-N3ZWGKXN.js} +4 -4
  110. package/chunks/{chunk-7MH4J33A.js → chunk-N7NBMAMW.js} +2 -2
  111. package/chunks/{chunk-EUNWC2VS.js → chunk-NC4O6UE6.js} +2 -2
  112. package/chunks/{chunk-4P66JPNV.js → chunk-NFSSQDB5.js} +5 -5
  113. package/chunks/{chunk-FTO3P6PZ.js → chunk-NM3E6GGL.js} +3 -3
  114. package/chunks/{chunk-FYTHSJDQ.js → chunk-NQPYPDOY.js} +2 -2
  115. package/chunks/{chunk-HUWENAHO.js → chunk-NWPO6I7V.js} +1 -1
  116. package/chunks/{chunk-SR7RZ4MS.js → chunk-O4BBDP2G.js} +2 -2
  117. package/chunks/{chunk-X76PVMPQ.js → chunk-OC5SKSNX.js} +3 -3
  118. package/chunks/{chunk-6S4NCX23.js → chunk-OGQERNHD.js} +3 -3
  119. package/chunks/{chunk-DA4HRSBW.js → chunk-OPBATTFQ.js} +1 -1
  120. package/chunks/{chunk-5BRSWOSC.js → chunk-P7KCJGBR.js} +4 -4
  121. package/chunks/{chunk-TZ3FN4B2.js → chunk-PBYVS6QT.js} +3 -3
  122. package/chunks/{chunk-VNNWAZSI.js → chunk-QG2IEE2E.js} +3 -3
  123. package/chunks/{chunk-XGLVQQ6F.js → chunk-QGZN4RYB.js} +4 -4
  124. package/chunks/{chunk-2UUMVNYT.js → chunk-QTI7SRXI.js} +3 -3
  125. package/chunks/{chunk-B2GJNDTV.js → chunk-QUESTNOP.js} +1 -1
  126. package/chunks/{chunk-6WIKTX4C.js → chunk-RUKNJEJO.js} +1 -1
  127. package/chunks/{chunk-6CONQTS2.js → chunk-RUVZZKDH.js} +1 -1
  128. package/chunks/{chunk-QUI267ZP.js → chunk-SAQHDAUJ.js} +42 -8
  129. package/chunks/{chunk-DCGYLIYO.js → chunk-SUTP6CZA.js} +5 -5
  130. package/chunks/{chunk-HGBUHVFO.js → chunk-T4576UW4.js} +3 -3
  131. package/chunks/{chunk-TZEZYNYD.js → chunk-T4FTABSW.js} +1 -1
  132. package/chunks/{chunk-SEZ556DZ.js → chunk-T6W4KACQ.js} +1 -1
  133. package/chunks/{chunk-EV3LZGGK.js → chunk-TKAEODJR.js} +572 -42
  134. package/chunks/{chunk-NV3F44FL.js → chunk-TNQLAI6I.js} +2 -2
  135. package/chunks/{chunk-A6PSUNCY.js → chunk-TNS2M7VL.js} +5 -5
  136. package/chunks/{chunk-ZUIOLZ4V.js → chunk-TTB6GBJ6.js} +8323 -2227
  137. package/chunks/{chunk-YGT2AUJ7.js → chunk-U2JLICUY.js} +33 -16
  138. package/chunks/{chunk-PDUIXSYP.js → chunk-U7QUDFPD.js} +7 -7
  139. package/chunks/{chunk-PWYEWOZM.js → chunk-UEUE6LJX.js} +1 -1
  140. package/chunks/{chunk-O3VWAZLP.js → chunk-UIZGNLBP.js} +770 -932
  141. package/chunks/{chunk-V3KCCRKA.js → chunk-UM57UTTV.js} +3 -3
  142. package/chunks/{chunk-EQL65XGA.js → chunk-V3LXMASR.js} +47 -21
  143. package/chunks/{chunk-LHEC5V6G.js → chunk-VRWOMUZM.js} +2 -2
  144. package/chunks/{chunk-5C7FDVHB.js → chunk-W2ITCESM.js} +176 -477
  145. package/chunks/{chunk-7OFX3YZW.js → chunk-W2PNY24B.js} +1 -1
  146. package/chunks/{chunk-T3FNRMFJ.js → chunk-X5GLCWPX.js} +1 -1
  147. package/chunks/{chunk-BSI645OU.js → chunk-XBLYC4MI.js} +3 -3
  148. package/chunks/{chunk-GNPNYXJB.js → chunk-XLQS3VI6.js} +2 -2
  149. package/chunks/{chunk-TCRQD7F6.js → chunk-XT6TGJFD.js} +1 -1
  150. package/chunks/{chunk-PYQADEFD.js → chunk-XTH2OMDS.js} +1 -1
  151. package/chunks/{chunk-PFWPBYL2.js → chunk-XUMBOJC2.js} +3 -3
  152. package/chunks/{chunk-P6RBCBBE.js → chunk-YIKMBYMT.js} +3 -3
  153. package/chunks/{chunk-WOJZWRAZ.js → chunk-YRLW2MSX.js} +1 -1
  154. package/chunks/{chunk-7WUUNAJP.js → chunk-YVVIFFU4.js} +3 -3
  155. package/chunks/chunk-Z7B6SRPM.js +32 -0
  156. package/chunks/{chunk-IA7TGCN2.js → chunk-ZV4XVYL3.js} +4 -4
  157. package/chunks/{chunk-PJRW65JO.js → chunk-ZWPWQEF5.js} +1 -1
  158. package/chunks/{computer-use-5LGM2YO5.js → computer-use-7TIKEXBX.js} +42 -41
  159. package/chunks/{config-utils-ULCSRMWD.js → config-utils-6MVJ54TY.js} +6 -6
  160. package/chunks/{contextCommand-JT44ADUD.js → contextCommand-5QKI7MRY.js} +44 -43
  161. package/chunks/{core-runtime-XHEJM2VB.js → core-runtime-USS7ZF3H.js} +42 -41
  162. package/chunks/{create-sub-session-QIDZUOPU.js → create-sub-session-Y4WYDZGC.js} +2 -2
  163. package/chunks/{create-sub-session-UQBDJF5G.js → create-sub-session-ZD2F3BH2.js} +42 -41
  164. package/chunks/{cron-create-VONA5JYY.js → cron-create-ZOVA3CC2.js} +4 -4
  165. package/chunks/{cron-delete-5JXSP2MI.js → cron-delete-7Z3H4LJY.js} +4 -4
  166. package/chunks/{cron-list-KE4F2CIR.js → cron-list-UHGX3IQG.js} +4 -4
  167. package/chunks/{daemon-GWD7BT6E.js → daemon-Y3NOHFKQ.js} +38 -7
  168. package/chunks/daemon-status-provider-PMP4J7BC.js +103 -0
  169. package/chunks/daemon-trust-policy-2252VKXI.js +99 -0
  170. package/chunks/{daemon-trust-policy-monitor-LUMB46CL.js → daemon-trust-policy-monitor-OSGGKJXT.js} +49 -48
  171. package/chunks/{de-LIW4XVLN.js → de-UBEBKG6V.js} +2 -1
  172. package/chunks/{deferred-core-runtime-BFB6YRTZ.js → deferred-core-runtime-3VD4V6YZ.js} +42 -41
  173. package/chunks/{display-image-NQRSIBXM.js → display-image-ZE3GZNIK.js} +4 -4
  174. package/chunks/{dist-Z3CS4OVP.js → dist-AVUYBK7L.js} +11 -5
  175. package/chunks/{dist-6BMOAE3Z.js → dist-BNWP6IZL.js} +4 -4
  176. package/chunks/{dist-3NTTUAHT.js → dist-EFJILGIS.js} +3 -3
  177. package/chunks/{dist-EZE3V3Q7.js → dist-MAIUUIWN.js} +3 -3
  178. package/chunks/{dist-B2CGTW6T.js → dist-NPS52B2V.js} +3 -3
  179. package/chunks/{dist-J47AXBZC.js → dist-PKSRQAR2.js} +3 -3
  180. package/chunks/{dist-OTUO3AS2.js → dist-Q2WJ2IZU.js} +13 -5
  181. package/chunks/{dist-EWW3J4HQ.js → dist-ZWDH5HLS.js} +3 -3
  182. package/chunks/{earlyInputCapture-GPULMO2H.js → earlyInputCapture-ER4HGLJN.js} +43 -42
  183. package/chunks/{edit-XYMQNMWU.js → edit-B3MT7O53.js} +42 -41
  184. package/chunks/{en-SY5GTIGX.js → en-X6YV7GME.js} +2 -1
  185. package/chunks/{enter-worktree-TIASENJP.js → enter-worktree-WVIYVSDJ.js} +42 -41
  186. package/chunks/{enterPlanMode-K6LTIGWM.js → enterPlanMode-DDCIM6HA.js} +42 -41
  187. package/chunks/{environment-3XX7LUMG.js → environment-LITGMOUP.js} +45 -44
  188. package/chunks/{errors-VTFZ6M4W.js → errors-E5CIOR2I.js} +44 -43
  189. package/chunks/{exit-worktree-IBKPEHUJ.js → exit-worktree-NQ2A6URE.js} +42 -41
  190. package/chunks/exitPlanMode-YXSWN4D3.js +85 -0
  191. package/chunks/{fast-path-QOBSDLA6.js → fast-path-PH3DBS6X.js} +3 -3
  192. package/chunks/{fast-path-settings-RPAVBD7P.js → fast-path-settings-LNOFM2YP.js} +2 -2
  193. package/chunks/{fr-RQFO7U4P.js → fr-VENTC2BS.js} +2 -1
  194. package/chunks/{gemini-OCRXJUWF.js → gemini-4YPO4ADY.js} +88 -87
  195. package/chunks/{geminiContentGenerator-VHSPCS6F.js → geminiContentGenerator-GMSVVXOU.js} +6 -6
  196. package/chunks/{glob-BVX4L3CM.js → glob-3Y3VHLM2.js} +42 -41
  197. package/chunks/{goal-tools-SWNB6GP4.js → goal-tools-JDK2SNMV.js} +4 -4
  198. package/chunks/{grep-CJSUX5NJ.js → grep-VUHUDZYG.js} +42 -41
  199. package/chunks/handleAutoUpdate-OBFFPWSJ.js +94 -0
  200. package/chunks/{i18n-BPEDXABF.js → i18n-4PJA5KKU.js} +43 -42
  201. package/chunks/{image-gen-DEEXNNA2.js → image-gen-4IFV4HES.js} +10 -10
  202. package/chunks/initializer-ZTY3VSWL.js +100 -0
  203. package/chunks/{installationInfo-JCUKPGDB.js → installationInfo-6USRNCD2.js} +43 -42
  204. package/chunks/{ja-KOZKHJHZ.js → ja-QHT4EQTO.js} +2 -1
  205. package/chunks/{keychain-token-storage-TVAMTNP7.js → keychain-token-storage-JTWUYFU7.js} +2 -2
  206. package/chunks/list-U2ZDKYWN.js +103 -0
  207. package/chunks/{list-agents-Z4WABFDZ.js → list-agents-4GQ2XNEU.js} +2 -2
  208. package/chunks/loadedSettingsAdapter-WW4HIVLO.js +97 -0
  209. package/chunks/{loggingContentGenerator-MOOIBKKR.js → loggingContentGenerator-XXG6YWUE.js} +46 -27
  210. package/chunks/{loop-wakeup-UZ5RL5Y2.js → loop-wakeup-HOQI3K5D.js} +5 -5
  211. package/chunks/{ls-TVHDGIES.js → ls-O4VBQRG7.js} +4 -4
  212. package/chunks/{lsp-CVN6OQPI.js → lsp-APQJ5ZEZ.js} +2 -2
  213. package/chunks/{managed-npm-update-7K2LDL7V.js → managed-npm-update-7GM2LPLL.js} +43 -42
  214. package/chunks/mcp-7KZW2T5P.js +97 -0
  215. package/chunks/{monitor-EXI73A5P.js → monitor-RQROQHLD.js} +42 -41
  216. package/chunks/nonInteractiveCli-U7JNJGS6.js +163 -0
  217. package/chunks/{notebook-edit-GKKQJQQU.js → notebook-edit-XQA6YCH2.js} +42 -41
  218. package/chunks/{openaiContentGenerator-NSPCP4FY.js → openaiContentGenerator-BZW2IB42.js} +29 -29
  219. package/chunks/{pidfile-IU4ETBRE.js → pidfile-NX5VZ3IK.js} +43 -42
  220. package/chunks/{processUtils-GZOVMFK4.js → processUtils-M635AD23.js} +2 -2
  221. package/chunks/{pt-U6AOCTMF.js → pt-VL3I5RNY.js} +2 -1
  222. package/chunks/{qwenContentGenerator-BBTNTOMB.js → qwenContentGenerator-KHJ73E2C.js} +48 -48
  223. package/chunks/{qwenOAuth2-D6L2W25Z.js → qwenOAuth2-QMK25XO7.js} +9 -9
  224. package/chunks/read-file-6LKIKKXD.js +32 -0
  225. package/chunks/{read-mcp-resource-PZ4ZF6YL.js → read-mcp-resource-TJSJRH4F.js} +2 -2
  226. package/chunks/{record-artifact-P4HFMS7X.js → record-artifact-FXF5LHPE.js} +3 -3
  227. package/chunks/{resumeHistoryUtils-VUY4B6BO.js → resumeHistoryUtils-RR2KEVH5.js} +49 -48
  228. package/chunks/ripGrep-CF2WRBYV.js +85 -0
  229. package/chunks/{ru-CMX4UMYP.js → ru-4RCKL4PY.js} +2 -1
  230. package/chunks/{run-qwen-serve-7BDTKCFP.js → run-qwen-serve-L5TF57J4.js} +57 -50
  231. package/chunks/{runtime-VMWGIAX7.js → runtime-3RE3BPR4.js} +55 -54
  232. package/chunks/{scheduler-MUKPARY5.js → scheduler-LXQZAMYT.js} +44 -43
  233. package/chunks/{sdk-exporters-http-XVTZQRCE.js → sdk-exporters-http-7SYSCGEO.js} +3 -3
  234. package/chunks/{sdk-impl-7W7AKCS4.js → sdk-impl-VZI6M6EH.js} +6 -6
  235. package/chunks/{send-message-CAMSLG2L.js → send-message-RBYLV5NY.js} +6 -6
  236. package/chunks/{serve-7G5R52HX.js → serve-5D4S7GIA.js} +49 -48
  237. package/chunks/{server-FTSWAHXF.js → server-ILZB6TTC.js} +391 -172
  238. package/chunks/{session-FLUDUMZJ.js → session-SXCZITZ4.js} +114 -94
  239. package/chunks/{settings-CJVTBEW7.js → settings-4RQB3OVF.js} +48 -47
  240. package/chunks/{shell-2DOQIYEE.js → shell-FCTR3OI2.js} +42 -41
  241. package/chunks/{skill-2GOEKN34.js → skill-IAKHPD5H.js} +19 -19
  242. package/chunks/{skill-settings-5FEOMZQS.js → skill-settings-SOR23NOP.js} +48 -47
  243. package/chunks/{spawnChannel-VJRIO75F.js → spawnChannel-I6VAWYQJ.js} +45 -43
  244. package/chunks/{standalone-update-OC5IKJGY.js → standalone-update-5NN3MTYH.js} +44 -43
  245. package/chunks/{startInteractiveUI-HFHFI2ZR.js → startInteractiveUI-OYGL3NZJ.js} +589 -329
  246. package/chunks/{syntheticOutput-PEBJQYJV.js → syntheticOutput-D3Z64LJC.js} +3 -3
  247. package/chunks/{task-create-5NWCQSJF.js → task-create-URFZ5EUX.js} +10 -10
  248. package/chunks/{task-list-53265TRZ.js → task-list-6JDFMPUW.js} +5 -5
  249. package/chunks/{task-stop-FPCOIRYX.js → task-stop-HHUGCD25.js} +2 -2
  250. package/chunks/{task-update-5HN577LS.js → task-update-LCJM3EYG.js} +10 -10
  251. package/chunks/{team-create-ZWAXZR75.js → team-create-J4JP6AXN.js} +44 -43
  252. package/chunks/{team-delete-MMQB4OSC.js → team-delete-PZGGBQLM.js} +5 -5
  253. package/chunks/{team-plan-approval-LH23GCUV.js → team-plan-approval-7BEAIR2H.js} +42 -41
  254. package/chunks/{terminal-image-renderer-7L3GCHD5.js → terminal-image-renderer-SGGTG5LN.js} +44 -43
  255. package/chunks/theme-manager-67TSB7LH.js +89 -0
  256. package/chunks/{todoWrite-JGV6VLOX.js → todoWrite-WINAZSZI.js} +4 -4
  257. package/chunks/{tool-search-BZOZHGKI.js → tool-search-XPOFDWOX.js} +19 -19
  258. package/chunks/{total-session-admission-KP4CJTSB.js → total-session-admission-SZJFAM25.js} +47 -46
  259. package/chunks/{trustedFolders-57QEHV67.js → trustedFolders-44NTYYV4.js} +43 -42
  260. package/chunks/{update-relaunch-53MODFE4.js → update-relaunch-K33Q3WEH.js} +5 -5
  261. package/chunks/{updateCheck-4QDI7CUZ.js → updateCheck-VBRNPLS4.js} +45 -44
  262. package/chunks/{useAutoAcceptIndicator-VVQUPTM5.js → useAutoAcceptIndicator-AUNRB5S7.js} +52 -51
  263. package/chunks/{validateNonInterActiveAuth-KKVD5E43.js → validateNonInterActiveAuth-WTO36MTA.js} +83 -82
  264. package/chunks/{version-IB5ASN63.js → version-JZA6HYPI.js} +1 -1
  265. package/chunks/{web-fetch-APSFQMIH.js → web-fetch-LLHPV2IR.js} +19 -19
  266. package/chunks/{web-search-EWEHMFIW.js → web-search-4HCHRZ3U.js} +11 -11
  267. package/chunks/{workflow-LA4ACRO4.js → workflow-YI74QTWW.js} +43 -42
  268. package/chunks/workspace-providers-status-CI3AO2BH.js +100 -0
  269. package/chunks/{workspace-registration-store-WSLHN7HA.js → workspace-registration-store-KPIKXDHA.js} +1 -1
  270. package/chunks/{workspace-registry-5HXRV7L4.js → workspace-registry-XE22QDE6.js} +47 -46
  271. package/chunks/{workspace-service-SSP4PLBC.js → workspace-service-WI2FD72A.js} +54 -53
  272. package/chunks/workspace-skills-status-FFZU6FXL.js +100 -0
  273. package/chunks/{workspace-trust-reconciler-PASUNEKQ.js → workspace-trust-reconciler-GJLNXR2U.js} +54 -53
  274. package/chunks/write-file-IEAC3XC3.js +87 -0
  275. package/chunks/{zh-AGL2FVBI.js → zh-LMSTK4WD.js} +2 -1
  276. package/chunks/{zh-TW-KI66MHQY.js → zh-TW-SQ4HTSCW.js} +2 -1
  277. package/chunks/{zoom-image-NAVVM4R2.js → zoom-image-GTVVT25J.js} +15 -15
  278. package/cli.js +13 -13
  279. package/locales/ca.js +1 -0
  280. package/locales/de.js +1 -0
  281. package/locales/en.js +1 -0
  282. package/locales/fr.js +1 -0
  283. package/locales/ja.js +1 -0
  284. package/locales/pt.js +1 -0
  285. package/locales/ru.js +1 -0
  286. package/locales/zh-TW.js +1 -0
  287. package/locales/zh.js +1 -0
  288. package/package.json +3 -3
  289. package/web-shell/assets/{arc-BGiARkbG.js → arc-B13-S0Yo.js} +1 -1
  290. package/web-shell/assets/{architectureDiagram-3BPJPVTR-3QBZDeqg.js → architectureDiagram-3BPJPVTR-CHvWNlVW.js} +1 -1
  291. package/web-shell/assets/{blockDiagram-GPEHLZMM-CbJI0j0o.js → blockDiagram-GPEHLZMM-CXebOlXF.js} +1 -1
  292. package/web-shell/assets/{c4Diagram-AAUBKEIU-pita1IYy.js → c4Diagram-AAUBKEIU-BQpx4y3Q.js} +1 -1
  293. package/web-shell/assets/channel-BB_Hm8Rf.js +1 -0
  294. package/web-shell/assets/{chunk-2J33WTMH-WzTFww1i.js → chunk-2J33WTMH-Cak1exSv.js} +1 -1
  295. package/web-shell/assets/{chunk-4BX2VUAB-8TIRo9bL.js → chunk-4BX2VUAB-BIc8BV5_.js} +1 -1
  296. package/web-shell/assets/{chunk-55IACEB6-CuCr34qf.js → chunk-55IACEB6-DoeJ5BL1.js} +1 -1
  297. package/web-shell/assets/{chunk-727SXJPM-Bb_xWEAx.js → chunk-727SXJPM-BDR_wYSu.js} +1 -1
  298. package/web-shell/assets/{chunk-AQP2D5EJ-C8T1b2Qw.js → chunk-AQP2D5EJ-BhRRGRq1.js} +1 -1
  299. package/web-shell/assets/{chunk-FMBD7UC4-kjpyMkNM.js → chunk-FMBD7UC4-BJGAwVXr.js} +1 -1
  300. package/web-shell/assets/{chunk-ND2GUHAM-Dm35jDmi.js → chunk-ND2GUHAM-vhE73bsD.js} +1 -1
  301. package/web-shell/assets/{chunk-QZHKN3VN-BPVKwuby.js → chunk-QZHKN3VN-BuTBZsdR.js} +1 -1
  302. package/web-shell/assets/classDiagram-4FO5ZUOK-B_hFK54Y.js +1 -0
  303. package/web-shell/assets/classDiagram-v2-Q7XG4LA2-B_hFK54Y.js +1 -0
  304. package/web-shell/assets/{cose-bilkent-S5V4N54A-M-7J9Xyz.js → cose-bilkent-S5V4N54A-CVHKipHP.js} +1 -1
  305. package/web-shell/assets/{dagre-BM42HDAG-u6rmS689.js → dagre-BM42HDAG-C1DPa8SV.js} +1 -1
  306. package/web-shell/assets/{diagram-2AECGRRQ-nAisfOUB.js → diagram-2AECGRRQ-BYP_QxkT.js} +1 -1
  307. package/web-shell/assets/{diagram-5GNKFQAL-CpobRd3l.js → diagram-5GNKFQAL-Cray7ruQ.js} +1 -1
  308. package/web-shell/assets/{diagram-KO2AKTUF-B82W_wPq.js → diagram-KO2AKTUF-Ds4vJANi.js} +1 -1
  309. package/web-shell/assets/{diagram-LMA3HP47-ClTkmPW6.js → diagram-LMA3HP47-DxFrDykH.js} +1 -1
  310. package/web-shell/assets/{diagram-OG6HWLK6-42fbxGPW.js → diagram-OG6HWLK6-BdIO-pF_.js} +1 -1
  311. package/web-shell/assets/{erDiagram-TEJ5UH35-8_zQfzlQ.js → erDiagram-TEJ5UH35-5JA8KDYV.js} +1 -1
  312. package/web-shell/assets/{flowDiagram-I6XJVG4X-DQDoN_oV.js → flowDiagram-I6XJVG4X-DL4drKro.js} +1 -1
  313. package/web-shell/assets/{ganttDiagram-6RSMTGT7-Cqd646fB.js → ganttDiagram-6RSMTGT7-ijX2DD6_.js} +1 -1
  314. package/web-shell/assets/{gitGraphDiagram-PVQCEYII-B6qWs_tS.js → gitGraphDiagram-PVQCEYII-_lPsFLFF.js} +1 -1
  315. package/web-shell/assets/index-BTwNYZkp.js +1785 -0
  316. package/web-shell/assets/{index-BCeQB_tk.js → index-C-YoqYbs.js} +1 -1
  317. package/web-shell/assets/{index-eYjX7fQg.css → index-dHAFxPHb.css} +1 -1
  318. package/web-shell/assets/{infoDiagram-5YYISTIA-BVyDAHuu.js → infoDiagram-5YYISTIA-COFClLab.js} +1 -1
  319. package/web-shell/assets/{ishikawaDiagram-YF4QCWOH-BBHM904I.js → ishikawaDiagram-YF4QCWOH-Div9KOgO.js} +1 -1
  320. package/web-shell/assets/{journeyDiagram-JHISSGLW-B5Bv5Z_0.js → journeyDiagram-JHISSGLW-VAw5u0wc.js} +1 -1
  321. package/web-shell/assets/{kanban-definition-UN3LZRKU-BwSTb0YF.js → kanban-definition-UN3LZRKU-CncCn8Nl.js} +1 -1
  322. package/web-shell/assets/{linear-CHtTm36c.js → linear-D6ad7e_k.js} +1 -1
  323. package/web-shell/assets/{mermaid.core-vBCuAUkf.js → mermaid.core-BV1IECGb.js} +5 -5
  324. package/web-shell/assets/{mindmap-definition-RKZ34NQL-CNfKHJrA.js → mindmap-definition-RKZ34NQL-a3jeNgPr.js} +1 -1
  325. package/web-shell/assets/{pieDiagram-4H26LBE5-DT6QMLhc.js → pieDiagram-4H26LBE5-DsVRY5BW.js} +1 -1
  326. package/web-shell/assets/{quadrantDiagram-W4KKPZXB-Rb2Dar4i.js → quadrantDiagram-W4KKPZXB-D6zgexJK.js} +1 -1
  327. package/web-shell/assets/{requirementDiagram-4Y6WPE33-CA9YzPUY.js → requirementDiagram-4Y6WPE33-VEpSwJjn.js} +1 -1
  328. package/web-shell/assets/{sankeyDiagram-5OEKKPKP-CJ5SkhJw.js → sankeyDiagram-5OEKKPKP-CYEuOFne.js} +1 -1
  329. package/web-shell/assets/{sequenceDiagram-3UESZ5HK-T31AiuVM.js → sequenceDiagram-3UESZ5HK-CCg0lI-9.js} +1 -1
  330. package/web-shell/assets/{stateDiagram-AJRCARHV-f7Xpd_Xh.js → stateDiagram-AJRCARHV-BHXPsL0B.js} +1 -1
  331. package/web-shell/assets/stateDiagram-v2-BHNVJYJU-eTG8D0QT.js +1 -0
  332. package/web-shell/assets/{timeline-definition-PNZ67QCA-dCwsTscr.js → timeline-definition-PNZ67QCA-gqTf9a0k.js} +1 -1
  333. package/web-shell/assets/{vennDiagram-CIIHVFJN-SQtBFYkQ.js → vennDiagram-CIIHVFJN-C4DXXkBh.js} +1 -1
  334. package/web-shell/assets/{wardley-L42UT6IY-Dfh4eW0B.js → wardley-L42UT6IY-CMK46EiX.js} +1 -1
  335. package/web-shell/assets/{wardleyDiagram-YWT4CUSO-BWBKXBsC.js → wardleyDiagram-YWT4CUSO-DTk1Gzt9.js} +1 -1
  336. package/web-shell/assets/{xychartDiagram-2RQKCTM6-DVqzcaxh.js → xychartDiagram-2RQKCTM6-BcJsM1dH.js} +1 -1
  337. package/web-shell/index.html +2 -2
  338. package/chunks/agent-headless-JOL3STCJ.js +0 -86
  339. package/chunks/channel-settings-store-CDUEUDYS.js +0 -101
  340. package/chunks/chunk-PDPFQ2FO.js +0 -156
  341. package/chunks/daemon-status-provider-67M3LFIJ.js +0 -102
  342. package/chunks/daemon-trust-policy-3XCIBLLT.js +0 -98
  343. package/chunks/exitPlanMode-2U23CG2U.js +0 -84
  344. package/chunks/handleAutoUpdate-2F3RWBIT.js +0 -93
  345. package/chunks/initializer-QRD7X25L.js +0 -99
  346. package/chunks/list-G6SHYRHQ.js +0 -102
  347. package/chunks/loadedSettingsAdapter-S4EPYP35.js +0 -96
  348. package/chunks/mcp-R2Z6IKPN.js +0 -96
  349. package/chunks/nonInteractiveCli-E6CEE6IG.js +0 -162
  350. package/chunks/read-file-S2BROE4F.js +0 -32
  351. package/chunks/ripGrep-V4EX6SLA.js +0 -84
  352. package/chunks/theme-manager-7WO6DXIT.js +0 -88
  353. package/chunks/workspace-providers-status-5C3HGWHF.js +0 -99
  354. package/chunks/workspace-skills-status-DX7CA34S.js +0 -99
  355. package/chunks/write-file-3N2WAE3F.js +0 -86
  356. package/web-shell/assets/channel-3vYOf77E.js +0 -1
  357. package/web-shell/assets/classDiagram-4FO5ZUOK-Dr2aqxvr.js +0 -1
  358. package/web-shell/assets/classDiagram-v2-Q7XG4LA2-Dr2aqxvr.js +0 -1
  359. package/web-shell/assets/index-Dv9zBWC9.js +0 -1775
  360. package/web-shell/assets/stateDiagram-v2-BHNVJYJU-wucbNzkr.js +0 -1
@@ -17,7 +17,7 @@ import {
17
17
  } from "./chunk-OCPBI7J5.js";
18
18
  import {
19
19
  defaultSpawnChannelFactory
20
- } from "./chunk-EV3LZGGK.js";
20
+ } from "./chunk-TKAEODJR.js";
21
21
  import {
22
22
  BridgeChannelClosedError,
23
23
  BridgeTimeoutError,
@@ -27,7 +27,7 @@ import {
27
27
  SessionRestoreTimeoutError,
28
28
  createIdleWorkspaceExtensionsStatus,
29
29
  createIdleWorkspaceHooksStatus
30
- } from "./chunk-DA4HRSBW.js";
30
+ } from "./chunk-OPBATTFQ.js";
31
31
  import {
32
32
  ACTIVE_WORK_CLOSE_IF_UNHELD_PARAM,
33
33
  ACTIVE_WORK_CLOSE_TIMEOUT_MS,
@@ -43,6 +43,7 @@ import {
43
43
  CHANNEL_STARTUP_PROFILE_VERSION,
44
44
  DAEMON_CHANNEL_DELIVERY_META_KEY,
45
45
  DAEMON_MODEL_PROMPT_META_KEY,
46
+ DAEMON_PROMPT_DISPLAY_TEXT_META_KEY,
46
47
  LOAD_REPLAY_BULK_MODE,
47
48
  LOAD_REPLAY_HIDE_INHERITED_META_KEY,
48
49
  LOAD_REPLAY_META_KEY,
@@ -58,7 +59,7 @@ import {
58
59
  WORKTREE_MCP_DEFER_META_KEY,
59
60
  clampActiveWorkIntervalMs,
60
61
  isValidTrustedModelPrompt
61
- } from "./chunk-W5UC37EE.js";
62
+ } from "./chunk-HHGQGTJQ.js";
62
63
  import {
63
64
  BranchWhilePromptActiveError,
64
65
  BridgeChannelQuarantinedError,
@@ -102,7 +103,7 @@ import {
102
103
  ClientSideConnection,
103
104
  PROTOCOL_VERSION,
104
105
  RequestError
105
- } from "./chunk-UDXSXLER.js";
106
+ } from "./chunk-IW6RQPQB.js";
106
107
  import {
107
108
  SESSION_ARTIFACT_PERSISTENCE_VERSION,
108
109
  SESSION_TRANSCRIPT_MAX_LIMIT,
@@ -115,16 +116,16 @@ import {
115
116
  metadataBudgetBytes,
116
117
  normalizeSnapshotPayload,
117
118
  stableSessionArtifactId
118
- } from "./chunk-O3VWAZLP.js";
119
+ } from "./chunk-UIZGNLBP.js";
119
120
  import {
120
121
  DAEMON_TRACEPARENT_META_KEY,
121
122
  DAEMON_TRACESTATE_META_KEY
122
- } from "./chunk-4TRQPFDP.js";
123
+ } from "./chunk-BJKREW56.js";
123
124
  import {
124
125
  INVOCATION_CONTEXT_META_KEY,
125
126
  PRIVATE_ACP_CAPABILITY_ENV,
126
127
  PRIVATE_PARENT_CAPABILITY_META_KEY
127
- } from "./chunk-YGT2AUJ7.js";
128
+ } from "./chunk-U2JLICUY.js";
128
129
  import {
129
130
  init_esbuild_shims
130
131
  } from "./chunk-5O2XNYP6.js";
@@ -136,6 +137,7 @@ import {
136
137
  init_esbuild_shims();
137
138
  import { randomBytes, randomUUID as randomUUID2 } from "node:crypto";
138
139
  import * as path3 from "node:path";
140
+ import { inspect } from "node:util";
139
141
 
140
142
  // packages/acp-bridge/src/compactionEngine.ts
141
143
  init_esbuild_shims();
@@ -5914,6 +5916,12 @@ function isRecord3(value) {
5914
5916
  return typeof value === "object" && value !== null && !Array.isArray(value);
5915
5917
  }
5916
5918
  __name(isRecord3, "isRecord");
5919
+ function safeTransportFailureCode(error) {
5920
+ if (!isRecord3(error)) return void 0;
5921
+ const code = error["code"];
5922
+ return typeof code === "string" && /^[a-z0-9_.-]{1,64}$/iu.test(code) ? code : void 0;
5923
+ }
5924
+ __name(safeTransportFailureCode, "safeTransportFailureCode");
5917
5925
  function sessionSourceRequestMeta(sourceType, sourceId) {
5918
5926
  return sourceType ? {
5919
5927
  [SESSION_SOURCE_META_KEY]: {
@@ -5923,12 +5931,280 @@ function sessionSourceRequestMeta(sourceType, sourceId) {
5923
5931
  } : {};
5924
5932
  }
5925
5933
  __name(sessionSourceRequestMeta, "sessionSourceRequestMeta");
5934
+ function getChannelPromptDisplayText(entry, displayText) {
5935
+ return entry.sourceType === "channel" && typeof displayText === "string" ? displayText : void 0;
5936
+ }
5937
+ __name(getChannelPromptDisplayText, "getChannelPromptDisplayText");
5926
5938
  function isDefinitiveAcpRequestError(error) {
5927
5939
  if (error instanceof RequestError) return true;
5928
5940
  if (!isRecord3(error)) return false;
5929
5941
  return typeof error["code"] === "number" && Number.isInteger(error["code"]) && typeof error["message"] === "string";
5930
5942
  }
5931
5943
  __name(isDefinitiveAcpRequestError, "isDefinitiveAcpRequestError");
5944
+ var LogSafeAcpRequestError = class extends RequestError {
5945
+ constructor(code, message, data, reservePreparedResponse) {
5946
+ super(code, message, data);
5947
+ this.reservePreparedResponse = reservePreparedResponse;
5948
+ }
5949
+ static {
5950
+ __name(this, "LogSafeAcpRequestError");
5951
+ }
5952
+ toResult() {
5953
+ const result = super.toResult();
5954
+ if ("error" in result) {
5955
+ Object.defineProperty(result.error, inspect.custom, {
5956
+ configurable: true,
5957
+ value: /* @__PURE__ */ __name(() => ({ code: result.error.code, payloadOmitted: true }), "value")
5958
+ });
5959
+ try {
5960
+ this.reservePreparedResponse?.(result.error);
5961
+ } catch {
5962
+ }
5963
+ }
5964
+ return result;
5965
+ }
5966
+ };
5967
+ var MAX_LOG_SAFE_ACP_ERROR_DETAILS_CHARS = 1024;
5968
+ var MAX_LOG_SAFE_ACP_ERROR_KIND_CHARS = 128;
5969
+ var MAX_LOG_SAFE_ACP_ERROR_HINT_CHARS = 512;
5970
+ function logSafeAcpErrorDetails(error) {
5971
+ const details = error instanceof Error ? error.message : isRecord3(error) && typeof error["message"] === "string" ? error["message"] : void 0;
5972
+ if (!details) return void 0;
5973
+ return {
5974
+ details: details.length <= MAX_LOG_SAFE_ACP_ERROR_DETAILS_CHARS ? details : `${details.slice(0, MAX_LOG_SAFE_ACP_ERROR_DETAILS_CHARS)}\u2026`
5975
+ };
5976
+ }
5977
+ __name(logSafeAcpErrorDetails, "logSafeAcpErrorDetails");
5978
+ function boundedAcpErrorString(value, maxChars) {
5979
+ return value.length <= maxChars ? value : `${value.slice(0, maxChars)}\u2026`;
5980
+ }
5981
+ __name(boundedAcpErrorString, "boundedAcpErrorString");
5982
+ function logSafeRequestErrorMessage(code) {
5983
+ switch (code) {
5984
+ case -32700:
5985
+ return "Parse error";
5986
+ case -32600:
5987
+ return "Invalid request";
5988
+ case -32601:
5989
+ return "Method not found";
5990
+ case -32602:
5991
+ return "Invalid params";
5992
+ case -32603:
5993
+ return "Internal error";
5994
+ case -32e3:
5995
+ return "Authentication required";
5996
+ case -32002:
5997
+ return "Resource not found";
5998
+ default:
5999
+ return "ACP client request failed";
6000
+ }
6001
+ }
6002
+ __name(logSafeRequestErrorMessage, "logSafeRequestErrorMessage");
6003
+ function logSafeRequestErrorData(data) {
6004
+ if (!isRecord3(data) || typeof data["errorKind"] !== "string") {
6005
+ return void 0;
6006
+ }
6007
+ const status = data["status"];
6008
+ const hint = data["hint"];
6009
+ return {
6010
+ errorKind: boundedAcpErrorString(
6011
+ data["errorKind"],
6012
+ MAX_LOG_SAFE_ACP_ERROR_KIND_CHARS
6013
+ ),
6014
+ ...typeof status === "number" && Number.isFinite(status) ? { status } : {},
6015
+ ...typeof hint === "string" ? {
6016
+ hint: boundedAcpErrorString(hint, MAX_LOG_SAFE_ACP_ERROR_HINT_CHARS)
6017
+ } : {}
6018
+ };
6019
+ }
6020
+ __name(logSafeRequestErrorData, "logSafeRequestErrorData");
6021
+ var AcpInboundHandlerLimitError = class extends Error {
6022
+ constructor(maxActiveHandlers, maxActiveHandlerBytes, requiredBytes, availableBytes) {
6023
+ super("ACP inbound handler capacity exceeded");
6024
+ this.maxActiveHandlers = maxActiveHandlers;
6025
+ this.maxActiveHandlerBytes = maxActiveHandlerBytes;
6026
+ this.requiredBytes = requiredBytes;
6027
+ this.availableBytes = availableBytes;
6028
+ this.name = "AcpInboundHandlerLimitError";
6029
+ }
6030
+ static {
6031
+ __name(this, "AcpInboundHandlerLimitError");
6032
+ }
6033
+ code = "acp_handler_limit_exceeded";
6034
+ };
6035
+ function estimateAcpHandlerBytes(value, limitBytes) {
6036
+ let bytes = 0;
6037
+ const stack = [value];
6038
+ const seen = /* @__PURE__ */ new WeakSet();
6039
+ while (stack.length > 0) {
6040
+ const current = stack.pop();
6041
+ if (current === null) {
6042
+ bytes += 4;
6043
+ } else if (typeof current === "string") {
6044
+ bytes += Buffer.byteLength(current) + 2;
6045
+ } else if (typeof current === "number") {
6046
+ bytes += 24;
6047
+ } else if (typeof current === "boolean") {
6048
+ bytes += 5;
6049
+ } else if (Array.isArray(current)) {
6050
+ if (seen.has(current)) return limitBytes + 1;
6051
+ seen.add(current);
6052
+ bytes += 2 + Math.max(0, current.length - 1);
6053
+ if (bytes + current.length > limitBytes) return limitBytes + 1;
6054
+ for (let index = current.length - 1; index >= 0; index--) {
6055
+ stack.push(current[index]);
6056
+ }
6057
+ } else if (isRecord3(current)) {
6058
+ if (seen.has(current)) return limitBytes + 1;
6059
+ seen.add(current);
6060
+ const entries = Object.entries(current);
6061
+ bytes += 2 + Math.max(0, entries.length - 1);
6062
+ for (const [key, entryValue] of entries) {
6063
+ bytes += Buffer.byteLength(key) + 3;
6064
+ stack.push(entryValue);
6065
+ }
6066
+ } else {
6067
+ bytes += 4;
6068
+ }
6069
+ if (bytes > limitBytes) return limitBytes + 1;
6070
+ }
6071
+ return Math.max(1, bytes);
6072
+ }
6073
+ __name(estimateAcpHandlerBytes, "estimateAcpHandlerBytes");
6074
+ var AcpInboundHandlerAdmission = class {
6075
+ constructor(guard) {
6076
+ this.guard = guard;
6077
+ }
6078
+ static {
6079
+ __name(this, "AcpInboundHandlerAdmission");
6080
+ }
6081
+ activeHandlers = 0;
6082
+ activeBytes = 0;
6083
+ async run(params, operation) {
6084
+ const envelopeBytes = Math.min(2048, this.guard.maxActiveHandlerBytes);
6085
+ const requiredBytes = envelopeBytes + estimateAcpHandlerBytes(
6086
+ params,
6087
+ Math.max(0, this.guard.maxActiveHandlerBytes - envelopeBytes)
6088
+ );
6089
+ const availableBytes = Math.max(
6090
+ 0,
6091
+ this.guard.maxActiveHandlerBytes - this.activeBytes
6092
+ );
6093
+ if (this.activeHandlers >= this.guard.maxActiveHandlers || requiredBytes > availableBytes) {
6094
+ const error = new AcpInboundHandlerLimitError(
6095
+ this.guard.maxActiveHandlers,
6096
+ this.guard.maxActiveHandlerBytes,
6097
+ requiredBytes,
6098
+ availableBytes
6099
+ );
6100
+ this.guard.fail(error);
6101
+ throw error;
6102
+ }
6103
+ this.activeHandlers++;
6104
+ this.activeBytes += requiredBytes;
6105
+ try {
6106
+ return await operation();
6107
+ } finally {
6108
+ this.activeHandlers--;
6109
+ this.activeBytes -= requiredBytes;
6110
+ }
6111
+ }
6112
+ };
6113
+ async function withLogSafeAcpError(operation, reservePreparedResponse) {
6114
+ try {
6115
+ return await operation();
6116
+ } catch (error) {
6117
+ if (error instanceof RequestError) {
6118
+ const code = Number.isFinite(error.code) ? error.code : -32603;
6119
+ throw new LogSafeAcpRequestError(
6120
+ code,
6121
+ logSafeRequestErrorMessage(code),
6122
+ logSafeRequestErrorData(error.data),
6123
+ reservePreparedResponse
6124
+ );
6125
+ }
6126
+ throw new LogSafeAcpRequestError(
6127
+ -32603,
6128
+ "Internal error",
6129
+ logSafeAcpErrorDetails(error),
6130
+ reservePreparedResponse
6131
+ );
6132
+ }
6133
+ }
6134
+ __name(withLogSafeAcpError, "withLogSafeAcpError");
6135
+ function createLogSafeAcpClient(client, transportGuard) {
6136
+ const admission = new AcpInboundHandlerAdmission(transportGuard);
6137
+ const runNotification = /* @__PURE__ */ __name((params, operation) => withLogSafeAcpError(() => admission.run(params, operation)), "runNotification");
6138
+ const runRequest = /* @__PURE__ */ __name((params, operation) => withLogSafeAcpError(
6139
+ () => admission.run(params, async () => {
6140
+ const result = await operation();
6141
+ transportGuard.reservePreparedResponse(result ?? null);
6142
+ return result;
6143
+ }),
6144
+ transportGuard.reservePreparedResponse
6145
+ ), "runRequest");
6146
+ return {
6147
+ requestPermission: /* @__PURE__ */ __name((params) => runRequest(params, () => client.requestPermission(params)), "requestPermission"),
6148
+ sessionUpdate: /* @__PURE__ */ __name((params) => runNotification(params, () => client.sessionUpdate(params)), "sessionUpdate"),
6149
+ writeTextFile: client.writeTextFile ? (params) => runRequest(params, () => client.writeTextFile(params)) : void 0,
6150
+ readTextFile: client.readTextFile ? (params) => runRequest(params, () => client.readTextFile(params)) : void 0,
6151
+ createTerminal: client.createTerminal ? (params) => runRequest(params, () => client.createTerminal(params)) : void 0,
6152
+ terminalOutput: client.terminalOutput ? (params) => runRequest(params, () => client.terminalOutput(params)) : void 0,
6153
+ releaseTerminal: client.releaseTerminal ? (params) => runRequest(
6154
+ params,
6155
+ async () => await client.releaseTerminal(params) ?? {}
6156
+ ) : void 0,
6157
+ waitForTerminalExit: client.waitForTerminalExit ? (params) => runRequest(params, () => client.waitForTerminalExit(params)) : void 0,
6158
+ killTerminal: client.killTerminal ? (params) => runRequest(
6159
+ params,
6160
+ async () => await client.killTerminal(params) ?? {}
6161
+ ) : void 0,
6162
+ extMethod: client.extMethod ? (method, params) => runRequest(params, () => client.extMethod(method, params)) : void 0,
6163
+ extNotification: client.extNotification ? (method, params) => runNotification(params, () => client.extNotification(method, params)) : void 0
6164
+ };
6165
+ }
6166
+ __name(createLogSafeAcpClient, "createLogSafeAcpClient");
6167
+ var OUTBOUND_GUARDED_CONNECTION_METHODS = /* @__PURE__ */ new Set([
6168
+ "initialize",
6169
+ "newSession",
6170
+ "loadSession",
6171
+ "unstable_forkSession",
6172
+ "unstable_listSessions",
6173
+ "unstable_resumeSession",
6174
+ "setSessionMode",
6175
+ "unstable_setSessionModel",
6176
+ "setSessionConfigOption",
6177
+ "authenticate",
6178
+ "prompt",
6179
+ "cancel",
6180
+ "extMethod",
6181
+ "extNotification"
6182
+ ]);
6183
+ function createOutboundGuardedConnection(connection, transportGuard) {
6184
+ const wrappers = /* @__PURE__ */ new Map();
6185
+ return new Proxy(connection, {
6186
+ get(target, property) {
6187
+ const value = Reflect.get(target, property, target);
6188
+ if (typeof value !== "function" || !OUTBOUND_GUARDED_CONNECTION_METHODS.has(property)) {
6189
+ return value;
6190
+ }
6191
+ let wrapper = wrappers.get(property);
6192
+ if (!wrapper) {
6193
+ wrapper = /* @__PURE__ */ __name(async (...args) => {
6194
+ const release = transportGuard.reserveOutboundOperation(args);
6195
+ try {
6196
+ return await Reflect.apply(value, target, args);
6197
+ } finally {
6198
+ release();
6199
+ }
6200
+ }, "wrapper");
6201
+ wrappers.set(property, wrapper);
6202
+ }
6203
+ return wrapper;
6204
+ }
6205
+ });
6206
+ }
6207
+ __name(createOutboundGuardedConnection, "createOutboundGuardedConnection");
5932
6208
  function getCanonicalModelId(response, fallback) {
5933
6209
  if (!isRecord3(response) || !isRecord3(response["_meta"])) return fallback;
5934
6210
  const modelSwitch = response["_meta"]["qwenModelSwitch"];
@@ -6135,14 +6411,27 @@ function pickUserInputEchoMeta(meta) {
6135
6411
  return Array.isArray(inputAnnotations) ? { inputAnnotations } : {};
6136
6412
  }
6137
6413
  __name(pickUserInputEchoMeta, "pickUserInputEchoMeta");
6138
- function echoPromptToSessionBus(entry, req, promptId, originatorClientId) {
6414
+ function echoPromptToSessionBus(entry, req, promptId, originatorClientId, displayText) {
6139
6415
  const prompt = req.prompt;
6140
6416
  if (!Array.isArray(prompt) || prompt.length === 0) return;
6417
+ let displayTextPublished = false;
6141
6418
  const serverTimestamp = Date.now();
6142
- const blockCount = Math.min(prompt.length, MAX_ECHO_CONTENT_BLOCKS);
6419
+ const echoPrompt = prompt.slice(0, MAX_ECHO_CONTENT_BLOCKS);
6420
+ if (displayText && !echoPrompt.some((part) => isRecord3(part) && part["type"] === "text")) {
6421
+ const textPart = prompt.slice(MAX_ECHO_CONTENT_BLOCKS).find((part) => isRecord3(part) && part["type"] === "text");
6422
+ if (textPart) echoPrompt[echoPrompt.length - 1] = textPart;
6423
+ }
6424
+ const blockCount = echoPrompt.length;
6143
6425
  for (let i = 0; i < blockCount; i += 1) {
6144
- const part = prompt[i];
6426
+ const part = echoPrompt[i];
6145
6427
  if (!part || typeof part !== "object" || Array.isArray(part)) continue;
6428
+ let displayPart = part;
6429
+ if (displayText !== void 0 && part.type === "text") {
6430
+ if (displayTextPublished) continue;
6431
+ displayTextPublished = true;
6432
+ if (!displayText) continue;
6433
+ displayPart = { ...part, text: displayText };
6434
+ }
6146
6435
  try {
6147
6436
  entry.events.publish({
6148
6437
  type: "session_update",
@@ -6151,7 +6440,7 @@ function echoPromptToSessionBus(entry, req, promptId, originatorClientId) {
6151
6440
  sessionId: req.sessionId,
6152
6441
  update: {
6153
6442
  sessionUpdate: "user_message_chunk",
6154
- content: part,
6443
+ content: displayPart,
6155
6444
  // `_meta` lives inside the `update` object rather than at
6156
6445
  // envelope level. `_meta` is a standard JSON-RPC/MCP extension
6157
6446
  // field permitted alongside spec fields, the SDK normalizer
@@ -6718,6 +7007,14 @@ function createAcpSessionBridge(opts) {
6718
7007
  }
6719
7008
  }
6720
7009
  __name(cancelIdleTimer, "cancelIdleTimer");
7010
+ function channelUnavailableReject(channel, context) {
7011
+ const unavailable = channel.transportFailed ? Promise.race([channel.exited, channel.transportFailed]) : channel.exited;
7012
+ const reject = /* @__PURE__ */ __name(() => {
7013
+ throw new BridgeChannelClosedError(context);
7014
+ }, "reject");
7015
+ return unavailable.then(reject, reject);
7016
+ }
7017
+ __name(channelUnavailableReject, "channelUnavailableReject");
6721
7018
  async function killChannelWithLog(ci, context) {
6722
7019
  ci.isDying = true;
6723
7020
  await ci.channel.kill().catch((err) => {
@@ -6924,6 +7221,14 @@ function createAcpSessionBridge(opts) {
6924
7221
  const generationRequests = /* @__PURE__ */ new Map();
6925
7222
  const workspaceGenerationRequests = /* @__PURE__ */ new Map();
6926
7223
  const inFlightExtensionRefreshes = /* @__PURE__ */ new Map();
7224
+ const clearInFlightExtensionRefreshes = /* @__PURE__ */ __name((connection) => {
7225
+ for (const [sessionId, refresh] of inFlightExtensionRefreshes) {
7226
+ if (refresh.connection === connection) {
7227
+ refresh.rejectUnavailable();
7228
+ inFlightExtensionRefreshes.delete(sessionId);
7229
+ }
7230
+ }
7231
+ }, "clearInFlightExtensionRefreshes");
6927
7232
  const toSessionSummary = /* @__PURE__ */ __name((entry) => {
6928
7233
  let isWaitingForPermission = false;
6929
7234
  let isWaitingForUserQuestion = false;
@@ -7172,7 +7477,14 @@ function createAcpSessionBridge(opts) {
7172
7477
  applyActiveWorkSnapshot(currentInfo, snapshot);
7173
7478
  }
7174
7479
  );
7175
- connection = new ClientSideConnection(() => client, channel.stream);
7480
+ const rawConnection = new ClientSideConnection(
7481
+ () => channel.transportGuard ? createLogSafeAcpClient(client, channel.transportGuard) : client,
7482
+ channel.stream
7483
+ );
7484
+ connection = channel.transportGuard ? createOutboundGuardedConnection(
7485
+ rawConnection,
7486
+ channel.transportGuard
7487
+ ) : rawConnection;
7176
7488
  } catch (error) {
7177
7489
  try {
7178
7490
  channel.killSync();
@@ -7208,11 +7520,26 @@ function createAcpSessionBridge(opts) {
7208
7520
  unsettledAbandonedRestores: /* @__PURE__ */ new Set(),
7209
7521
  restoreSettlementOverdue: false,
7210
7522
  restoreSettlementTimers: /* @__PURE__ */ new Map(),
7523
+ transportFailed: false,
7524
+ transportFailureInitiatedTeardown: false,
7211
7525
  isDying: false,
7212
7526
  isQuarantined: false,
7213
7527
  handshakeComplete: false
7214
7528
  };
7215
7529
  infoRef.current = info;
7530
+ const markTransportFailed = /* @__PURE__ */ __name((error) => {
7531
+ if (!info.isDying) {
7532
+ info.transportFailureInitiatedTeardown = true;
7533
+ }
7534
+ info.transportFailed = true;
7535
+ info.transportFailureCode = safeTransportFailureCode(error);
7536
+ info.isDying = true;
7537
+ clearInFlightExtensionRefreshes(info.connection);
7538
+ }, "markTransportFailed");
7539
+ void channel.transportFailed?.then(
7540
+ markTransportFailed,
7541
+ markTransportFailed
7542
+ );
7216
7543
  aliveChannels.add(info);
7217
7544
  if (aliveChannels.size > 2) {
7218
7545
  writeStderrLine(
@@ -7220,6 +7547,7 @@ function createAcpSessionBridge(opts) {
7220
7547
  );
7221
7548
  }
7222
7549
  void channel.exited.then((exitInfo) => {
7550
+ clearInFlightExtensionRefreshes(info.connection);
7223
7551
  if (channelInfo === info) cancelIdleTimer();
7224
7552
  if (info.workspaceMcpDiscoveryTimer) {
7225
7553
  clearTimeout(info.workspaceMcpDiscoveryTimer);
@@ -7238,7 +7566,7 @@ function createAcpSessionBridge(opts) {
7238
7566
  if (channelInfo === info) channelInfo = void 0;
7239
7567
  const sessions = Array.from(info.sessionIds);
7240
7568
  info.sessionIds.clear();
7241
- const channelExitExpected = shuttingDown || info.isDying;
7569
+ const channelExitExpected = shuttingDown || info.isDying && !info.transportFailureInitiatedTeardown;
7242
7570
  if (info.handshakeComplete) {
7243
7571
  telemetry.metrics?.channelLifecycle("exit", channelExitExpected);
7244
7572
  }
@@ -7246,10 +7574,15 @@ function createAcpSessionBridge(opts) {
7246
7574
  telemetry.event("channel.exited", {
7247
7575
  "qwen-code.daemon.channel.exit_code": exitInfo?.exitCode ?? -1,
7248
7576
  "qwen-code.daemon.channel.session_count": sessions.length,
7577
+ "qwen-code.daemon.channel.transport_failed": info.transportFailed,
7578
+ "qwen-code.daemon.channel.transport_failure_initiated_teardown": info.transportFailureInitiatedTeardown,
7579
+ ...info.transportFailureCode ? {
7580
+ "qwen-code.daemon.channel.transport_error_code": info.transportFailureCode
7581
+ } : {},
7249
7582
  ...exitInfo?.signalCode ? { "qwen-code.daemon.channel.signal": exitInfo.signalCode } : {}
7250
7583
  });
7251
7584
  writeStderrLine(
7252
- `qwen serve: channel exited (code=${exitInfo?.exitCode ?? "none"}, signal=${exitInfo?.signalCode ?? "none"}, ${sessions.length} session(s) torn down)`
7585
+ `qwen serve: channel exited (code=${exitInfo?.exitCode ?? "none"}, signal=${exitInfo?.signalCode ?? "none"}, transport=${info.transportFailed ? info.transportFailureCode ?? "failed" : "ok"}, ${sessions.length} session(s) torn down)`
7253
7586
  );
7254
7587
  }
7255
7588
  for (const sid of sessions) {
@@ -7301,26 +7634,29 @@ function createAcpSessionBridge(opts) {
7301
7634
  },
7302
7635
  async () => {
7303
7636
  const response = await withTimeout(
7304
- connection.initialize({
7305
- protocolVersion: PROTOCOL_VERSION,
7306
- _meta: {
7307
- [ACTIVE_WORK_HEARTBEAT_META_KEY]: {
7308
- v: ACTIVE_WORK_HEARTBEAT_VERSION,
7309
- intervalMs: ACTIVE_WORK_HEARTBEAT_INTERVAL_MS
7637
+ Promise.race([
7638
+ connection.initialize({
7639
+ protocolVersion: PROTOCOL_VERSION,
7640
+ _meta: {
7641
+ [ACTIVE_WORK_HEARTBEAT_META_KEY]: {
7642
+ v: ACTIVE_WORK_HEARTBEAT_VERSION,
7643
+ intervalMs: ACTIVE_WORK_HEARTBEAT_INTERVAL_MS
7644
+ },
7645
+ [CHANNEL_STARTUP_PROFILE_META_KEY]: {
7646
+ v: CHANNEL_STARTUP_PROFILE_VERSION
7647
+ },
7648
+ [PRIVATE_PARENT_CAPABILITY_META_KEY]: privateParentCapability
7310
7649
  },
7311
- [CHANNEL_STARTUP_PROFILE_META_KEY]: {
7312
- v: CHANNEL_STARTUP_PROFILE_VERSION
7650
+ clientCapabilities: {
7651
+ fs: {
7652
+ readTextFile: delegateReadTextFileToClient,
7653
+ writeTextFile: true
7654
+ }
7313
7655
  },
7314
- [PRIVATE_PARENT_CAPABILITY_META_KEY]: privateParentCapability
7315
- },
7316
- clientCapabilities: {
7317
- fs: {
7318
- readTextFile: delegateReadTextFileToClient,
7319
- writeTextFile: true
7320
- }
7321
- },
7322
- clientInfo: { name: "qwen-serve-bridge", version: "0" }
7323
- }),
7656
+ clientInfo: { name: "qwen-serve-bridge", version: "0" }
7657
+ }),
7658
+ channelUnavailableReject(channel, "during initialize")
7659
+ ]),
7324
7660
  initTimeoutMs,
7325
7661
  "initialize"
7326
7662
  );
@@ -7365,6 +7701,11 @@ function createAcpSessionBridge(opts) {
7365
7701
  });
7366
7702
  throw err;
7367
7703
  }
7704
+ if (info.isDying) {
7705
+ await channel.kill().catch(() => {
7706
+ });
7707
+ throw new BridgeChannelClosedError("during initialize");
7708
+ }
7368
7709
  if (shuttingDown) {
7369
7710
  info.isDying = true;
7370
7711
  await channel.kill().catch(() => {
@@ -7394,6 +7735,9 @@ function createAcpSessionBridge(opts) {
7394
7735
  },
7395
7736
  ensureChannel
7396
7737
  );
7738
+ if (ci.isDying) {
7739
+ throw new BridgeChannelClosedError("before newSession");
7740
+ }
7397
7741
  ci.sessionSpawnsInFlight++;
7398
7742
  if (requestedSessionId !== void 0) {
7399
7743
  ci.client.markSessionRegistrationInFlight(requestedSessionId);
@@ -7426,15 +7770,18 @@ function createAcpSessionBridge(opts) {
7426
7770
  } : {}
7427
7771
  });
7428
7772
  const response = await withTimeout(
7429
- ci.connection.newSession(
7430
- worktree ? {
7431
- ...request,
7432
- _meta: {
7433
- ...isRecord3(request._meta) ? request._meta : {},
7434
- [WORKTREE_MCP_DEFER_META_KEY]: true
7435
- }
7436
- } : request
7437
- ),
7773
+ Promise.race([
7774
+ ci.connection.newSession(
7775
+ worktree ? {
7776
+ ...request,
7777
+ _meta: {
7778
+ ...isRecord3(request._meta) ? request._meta : {},
7779
+ [WORKTREE_MCP_DEFER_META_KEY]: true
7780
+ }
7781
+ } : request
7782
+ ),
7783
+ channelUnavailableReject(ci.channel, "during newSession")
7784
+ ]),
7438
7785
  initTimeoutMs,
7439
7786
  "newSession"
7440
7787
  );
@@ -7455,6 +7802,10 @@ function createAcpSessionBridge(opts) {
7455
7802
  }
7456
7803
  throw err;
7457
7804
  }
7805
+ await Promise.resolve();
7806
+ if (ci.isDying) {
7807
+ throw new BridgeChannelClosedError("after newSession");
7808
+ }
7458
7809
  if (shuttingDown) {
7459
7810
  throw new Error("AcpSessionBridge is shutting down");
7460
7811
  }
@@ -7773,13 +8124,25 @@ function createAcpSessionBridge(opts) {
7773
8124
  __name(applyApprovalMode, "applyApprovalMode");
7774
8125
  async function applyApprovalModeForAttach(entry, mode, clientId) {
7775
8126
  try {
7776
- await applyApprovalMode(entry, mode, false, clientId);
8127
+ const result = await applyApprovalMode(entry, mode, false, clientId);
8128
+ return result.previous;
7777
8129
  } catch (err) {
7778
8130
  await rollbackAttachRegistration(entry, clientId);
7779
8131
  throw err;
7780
8132
  }
7781
8133
  }
7782
8134
  __name(applyApprovalModeForAttach, "applyApprovalModeForAttach");
8135
+ async function rollbackApprovalModeForRejectedAttach(entry, previous, clientId) {
8136
+ if (byId.get(entry.sessionId) !== entry) return;
8137
+ try {
8138
+ await applyApprovalMode(entry, previous, false, clientId);
8139
+ } catch (err) {
8140
+ writeStderrLine(
8141
+ `attach: failed to restore approval mode for session ${entry.sessionId}: ${extractErrorMessage(err)}`
8142
+ );
8143
+ }
8144
+ }
8145
+ __name(rollbackApprovalModeForRejectedAttach, "rollbackApprovalModeForRejectedAttach");
7783
8146
  const cancelPendingForSession = /* @__PURE__ */ __name((sessionId) => {
7784
8147
  permissionMediator.forgetSession(sessionId);
7785
8148
  byId.get(sessionId)?.pendingPermissionIds.clear();
@@ -7787,11 +8150,10 @@ function createAcpSessionBridge(opts) {
7787
8150
  }, "cancelPendingForSession");
7788
8151
  const getTransportClosedReject = /* @__PURE__ */ __name((entry) => {
7789
8152
  if (!entry.transportClosedReject) {
7790
- entry.transportClosedReject = entry.channel.exited.then(() => {
7791
- throw new BridgeChannelClosedError(
7792
- `mid-request (session ${entry.sessionId})`
7793
- );
7794
- });
8153
+ entry.transportClosedReject = channelUnavailableReject(
8154
+ entry.channel,
8155
+ `mid-request (session ${entry.sessionId})`
8156
+ );
7795
8157
  }
7796
8158
  return entry.transportClosedReject;
7797
8159
  }, "getTransportClosedReject");
@@ -7819,6 +8181,28 @@ function createAcpSessionBridge(opts) {
7819
8181
  }
7820
8182
  return void 0;
7821
8183
  }, "channelInfoForEntry");
8184
+ const assertAttachableSessionEntry = /* @__PURE__ */ __name((sessionId, entry) => {
8185
+ if (byId.get(sessionId) !== entry) {
8186
+ throw new SessionNotFoundError(
8187
+ sessionId,
8188
+ "The session channel is unavailable; retry after teardown completes"
8189
+ );
8190
+ }
8191
+ if (isClosingOrAuthorizingClose(entry)) {
8192
+ throw new SessionNotFoundError(
8193
+ sessionId,
8194
+ "The session is closing; retry after close completes",
8195
+ "session_closing"
8196
+ );
8197
+ }
8198
+ const owner = channelInfoForEntry(entry);
8199
+ if (!owner || owner.isDying) {
8200
+ throw new SessionNotFoundError(
8201
+ sessionId,
8202
+ "The session channel is unavailable; retry after teardown completes"
8203
+ );
8204
+ }
8205
+ }, "assertAttachableSessionEntry");
7822
8206
  const assertLivePromptEntry = /* @__PURE__ */ __name((sessionId, entry) => {
7823
8207
  const info = channelInfoForEntry(entry);
7824
8208
  if (byId.get(sessionId) !== entry || !info || info.isDying) {
@@ -7827,9 +8211,10 @@ function createAcpSessionBridge(opts) {
7827
8211
  }, "assertLivePromptEntry");
7828
8212
  const getChannelClosedReject = /* @__PURE__ */ __name((info) => {
7829
8213
  if (!info.statusClosedReject) {
7830
- info.statusClosedReject = info.channel.exited.then(() => {
7831
- throw new BridgeChannelClosedError("mid-request (workspace status)");
7832
- });
8214
+ info.statusClosedReject = channelUnavailableReject(
8215
+ info.channel,
8216
+ "mid-request (workspace status)"
8217
+ );
7833
8218
  }
7834
8219
  return info.statusClosedReject;
7835
8220
  }, "getChannelClosedReject");
@@ -8495,6 +8880,7 @@ function createAcpSessionBridge(opts) {
8495
8880
  for (let attempt = 0; attempt < 2; attempt++) {
8496
8881
  try {
8497
8882
  const lastEventId = entry.events.lastEventId;
8883
+ const eventEpoch = entry.events.epoch;
8498
8884
  const seenCursors = /* @__PURE__ */ new Set();
8499
8885
  let emptyPageCount = 0;
8500
8886
  let cursor;
@@ -8515,11 +8901,12 @@ function createAcpSessionBridge(opts) {
8515
8901
  cursor = nextCursor;
8516
8902
  if (cursor !== void 0) seenCursors.add(cursor);
8517
8903
  } while (page.events.length === 0 && page.hasMore && cursor !== void 0 && page.partial !== true && page.replayError === void 0);
8518
- if (byId.get(entry.sessionId) === entry && !entry.promptActive && entry.events.lastEventId === lastEventId) {
8904
+ if (byId.get(entry.sessionId) === entry && !entry.promptActive && entry.events.epoch === eventEpoch && entry.events.lastEventId === lastEventId) {
8519
8905
  return {
8520
8906
  compactedReplay: page.events,
8521
8907
  liveJournal: [],
8522
8908
  lastEventId,
8909
+ eventEpoch,
8523
8910
  ...page.partial === true ? { partial: true } : {},
8524
8911
  ...page.replayError !== void 0 ? { replayError: page.replayError } : {},
8525
8912
  ...page.hasMore ? { historyHasMore: true } : {}
@@ -8592,30 +8979,30 @@ function createAcpSessionBridge(opts) {
8592
8979
  const hideInheritedHistory = action === "load" && req.hideInheritedHistory === true;
8593
8980
  const existing = byId.get(req.sessionId);
8594
8981
  if (existing) {
8595
- if (isClosingOrAuthorizingClose(existing)) {
8596
- throw new SessionNotFoundError(
8597
- req.sessionId,
8598
- "The session is closing; retry after close completes",
8599
- "session_closing"
8600
- );
8601
- }
8982
+ assertAttachableSessionEntry(req.sessionId, existing);
8602
8983
  const replayFields = historyPageSize !== void 0 ? await refreshedReplayFieldsFor(existing, historyPageSize) : replayFieldsFor(existing, action);
8603
8984
  const historyAnchorRecordId = action === "load" ? await resolveHistoryAnchorRecordId(existing, replayFields) : void 0;
8604
- if (byId.get(req.sessionId) !== existing) {
8605
- throw new SessionNotFoundError(req.sessionId);
8606
- }
8607
- if (isClosingOrAuthorizingClose(existing)) {
8608
- throw new SessionNotFoundError(
8609
- req.sessionId,
8610
- "The session is closing; retry after close completes",
8611
- "session_closing"
8612
- );
8613
- }
8985
+ assertAttachableSessionEntry(req.sessionId, existing);
8614
8986
  existing.attachCount++;
8615
8987
  const clientId = registerClient(existing, req.clientId);
8616
8988
  recordAttachRef(existing, clientId);
8617
8989
  if (req.approvalMode) {
8618
- await applyApprovalModeForAttach(existing, req.approvalMode, clientId);
8990
+ const previousApprovalMode = await applyApprovalModeForAttach(
8991
+ existing,
8992
+ req.approvalMode,
8993
+ clientId
8994
+ );
8995
+ try {
8996
+ assertAttachableSessionEntry(req.sessionId, existing);
8997
+ } catch (error) {
8998
+ await rollbackApprovalModeForRejectedAttach(
8999
+ existing,
9000
+ previousApprovalMode,
9001
+ clientId
9002
+ );
9003
+ await rollbackAttachRegistration(existing, clientId);
9004
+ throw error;
9005
+ }
8619
9006
  }
8620
9007
  return {
8621
9008
  sessionId: existing.sessionId,
@@ -8667,10 +9054,32 @@ function createAcpSessionBridge(opts) {
8667
9054
  "the agent child likely crashed during session restore \u2014 retry to restore the session"
8668
9055
  );
8669
9056
  }
9057
+ try {
9058
+ assertAttachableSessionEntry(restored.sessionId, entry);
9059
+ } catch (error) {
9060
+ inFlight.coalesceState.count--;
9061
+ entry.attachCount = Math.max(0, entry.attachCount - 1);
9062
+ throw error;
9063
+ }
8670
9064
  const clientId = registerClient(entry, req.clientId);
8671
9065
  recordAttachRef(entry, clientId);
8672
9066
  if (req.approvalMode) {
8673
- await applyApprovalModeForAttach(entry, req.approvalMode, clientId);
9067
+ const previousApprovalMode = await applyApprovalModeForAttach(
9068
+ entry,
9069
+ req.approvalMode,
9070
+ clientId
9071
+ );
9072
+ try {
9073
+ assertAttachableSessionEntry(restored.sessionId, entry);
9074
+ } catch (error) {
9075
+ await rollbackApprovalModeForRejectedAttach(
9076
+ entry,
9077
+ previousApprovalMode,
9078
+ clientId
9079
+ );
9080
+ await rollbackAttachRegistration(entry, clientId);
9081
+ throw error;
9082
+ }
8674
9083
  }
8675
9084
  return {
8676
9085
  ...restored,
@@ -8834,12 +9243,16 @@ function createAcpSessionBridge(opts) {
8834
9243
  const promise = (async () => {
8835
9244
  pendingRestoreEvents.set(req.sessionId, restoreEvents);
8836
9245
  const restoreChannel = await ensureChannel();
9246
+ if (restoreChannel.isDying) {
9247
+ throw new BridgeChannelClosedError(`before session/${action}`);
9248
+ }
8837
9249
  ci = restoreChannel;
8838
9250
  restoreChannel.pendingRestoreIds.add(req.sessionId);
8839
9251
  restoreChannel.client.markRestoreInFlight(req.sessionId);
8840
- const transportClosed = restoreChannel.channel.exited.then(() => {
8841
- throw new BridgeChannelClosedError(`during session/${action}`);
8842
- });
9252
+ const transportClosed = channelUnavailableReject(
9253
+ restoreChannel.channel,
9254
+ `during session/${action}`
9255
+ );
8843
9256
  transportClosed.catch(() => {
8844
9257
  });
8845
9258
  let state;
@@ -8985,24 +9398,20 @@ function createAcpSessionBridge(opts) {
8985
9398
  const racedEntry = byId.get(req.sessionId);
8986
9399
  if (racedEntry) {
8987
9400
  restoreEvents.close();
8988
- if (isClosingOrAuthorizingClose(racedEntry)) {
8989
- throw new SessionNotFoundError(
8990
- req.sessionId,
8991
- "The session is closing; retry after close completes",
8992
- "session_closing"
8993
- );
8994
- }
9401
+ assertAttachableSessionEntry(req.sessionId, racedEntry);
8995
9402
  racedEntry.attachCount += 1 + coalesceState.count;
8996
9403
  const clientId2 = registerClient(racedEntry, req.clientId);
8997
9404
  recordAttachRef(racedEntry, clientId2);
8998
9405
  if (req.approvalMode) {
9406
+ let previousApprovalMode;
8999
9407
  try {
9000
- await applyApprovalMode(
9408
+ const result = await applyApprovalMode(
9001
9409
  racedEntry,
9002
9410
  req.approvalMode,
9003
9411
  false,
9004
9412
  clientId2
9005
9413
  );
9414
+ previousApprovalMode = result.previous;
9006
9415
  } catch (err) {
9007
9416
  await rollbackAttachRegistration(
9008
9417
  racedEntry,
@@ -9011,6 +9420,21 @@ function createAcpSessionBridge(opts) {
9011
9420
  );
9012
9421
  throw err;
9013
9422
  }
9423
+ try {
9424
+ assertAttachableSessionEntry(req.sessionId, racedEntry);
9425
+ } catch (error) {
9426
+ await rollbackApprovalModeForRejectedAttach(
9427
+ racedEntry,
9428
+ previousApprovalMode,
9429
+ clientId2
9430
+ );
9431
+ await rollbackAttachRegistration(
9432
+ racedEntry,
9433
+ clientId2,
9434
+ 1 + coalesceState.count
9435
+ );
9436
+ throw error;
9437
+ }
9014
9438
  }
9015
9439
  return {
9016
9440
  sessionId: racedEntry.sessionId,
@@ -9077,9 +9501,11 @@ function createAcpSessionBridge(opts) {
9077
9501
  }
9078
9502
  ci.client.drainEarlyEvents(entry.sessionId, entry);
9079
9503
  }
9504
+ assertAttachableSessionEntry(req.sessionId, entry);
9080
9505
  const clientId = registerClient(entry, req.clientId);
9081
9506
  if (req.approvalMode) {
9082
9507
  await applyApprovalModeForAttach(entry, req.approvalMode, clientId);
9508
+ assertAttachableSessionEntry(req.sessionId, entry);
9083
9509
  }
9084
9510
  entry.attachCount = coalesceState.count;
9085
9511
  registeredEntry = entry;
@@ -9465,13 +9891,7 @@ function createAcpSessionBridge(opts) {
9465
9891
  if (effectiveScope === "single") {
9466
9892
  const existing = defaultEntry;
9467
9893
  if (existing) {
9468
- if (isClosingOrAuthorizingClose(existing)) {
9469
- throw new SessionNotFoundError(
9470
- existing.sessionId,
9471
- "The session is closing; retry after close completes",
9472
- "session_closing"
9473
- );
9474
- }
9894
+ assertAttachableSessionEntry(existing.sessionId, existing);
9475
9895
  existing.attachCount++;
9476
9896
  const clientId = registerClient(existing, req.clientId);
9477
9897
  recordAttachRef(existing, clientId);
@@ -9484,13 +9904,27 @@ function createAcpSessionBridge(opts) {
9484
9904
  ).catch(() => {
9485
9905
  });
9486
9906
  }
9907
+ let previousApprovalMode;
9487
9908
  if (req.approvalMode) {
9488
- await applyApprovalModeForAttach(
9909
+ previousApprovalMode = await applyApprovalModeForAttach(
9489
9910
  existing,
9490
9911
  req.approvalMode,
9491
9912
  clientId
9492
9913
  );
9493
9914
  }
9915
+ try {
9916
+ assertAttachableSessionEntry(existing.sessionId, existing);
9917
+ } catch (error) {
9918
+ if (previousApprovalMode !== void 0) {
9919
+ await rollbackApprovalModeForRejectedAttach(
9920
+ existing,
9921
+ previousApprovalMode,
9922
+ clientId
9923
+ );
9924
+ }
9925
+ await rollbackAttachRegistration(existing, clientId);
9926
+ throw error;
9927
+ }
9494
9928
  return {
9495
9929
  sessionId: existing.sessionId,
9496
9930
  workspaceCwd: existing.workspaceCwd,
@@ -9507,13 +9941,14 @@ function createAcpSessionBridge(opts) {
9507
9941
  if (inFlight) {
9508
9942
  const session = await inFlight;
9509
9943
  const attachedEntry = byId.get(session.sessionId);
9510
- if (attachedEntry) attachedEntry.attachCount++;
9511
9944
  if (!attachedEntry) {
9512
9945
  throw new SessionNotFoundError(
9513
9946
  session.sessionId,
9514
9947
  "the agent child likely crashed during initialization \u2014 retry to spawn a new session"
9515
9948
  );
9516
9949
  }
9950
+ assertAttachableSessionEntry(session.sessionId, attachedEntry);
9951
+ attachedEntry.attachCount++;
9517
9952
  const clientId = registerClient(attachedEntry, req.clientId);
9518
9953
  recordAttachRef(attachedEntry, clientId);
9519
9954
  if (req.modelServiceId) {
@@ -9525,13 +9960,27 @@ function createAcpSessionBridge(opts) {
9525
9960
  ).catch(() => {
9526
9961
  });
9527
9962
  }
9963
+ let previousApprovalMode;
9528
9964
  if (req.approvalMode) {
9529
- await applyApprovalModeForAttach(
9965
+ previousApprovalMode = await applyApprovalModeForAttach(
9530
9966
  attachedEntry,
9531
9967
  req.approvalMode,
9532
9968
  clientId
9533
9969
  );
9534
9970
  }
9971
+ try {
9972
+ assertAttachableSessionEntry(session.sessionId, attachedEntry);
9973
+ } catch (error) {
9974
+ if (previousApprovalMode !== void 0) {
9975
+ await rollbackApprovalModeForRejectedAttach(
9976
+ attachedEntry,
9977
+ previousApprovalMode,
9978
+ clientId
9979
+ );
9980
+ }
9981
+ await rollbackAttachRegistration(attachedEntry, clientId);
9982
+ throw error;
9983
+ }
9535
9984
  return {
9536
9985
  ...session,
9537
9986
  attached: true,
@@ -9680,12 +10129,19 @@ function createAcpSessionBridge(opts) {
9680
10129
  );
9681
10130
  }
9682
10131
  }
10132
+ const channelDisplayText = getChannelPromptDisplayText(
10133
+ entry,
10134
+ context?.promptDisplayText
10135
+ );
10136
+ const pendingText = channelDisplayText === void 0 ? extractPromptText(req.prompt) : channelDisplayText || (req.prompt.some(
10137
+ (block) => isRecord3(block) && block["type"] === "image"
10138
+ ) ? "[image]" : "");
9683
10139
  const pendingEntry = {
9684
10140
  promptId,
9685
10141
  queuedAt,
9686
10142
  ...originatorClientId !== void 0 ? { originatorClientId } : {},
9687
10143
  ...isPromotedMidTurn ? { promotedMidTurn: true } : {},
9688
- text: extractPromptText(req.prompt),
10144
+ text: pendingText,
9689
10145
  abortController: pendingAbort,
9690
10146
  state: isQueued ? "queued" : "running"
9691
10147
  };
@@ -9823,11 +10279,13 @@ function createAcpSessionBridge(opts) {
9823
10279
  delete copy.retry;
9824
10280
  delete copy.delivery;
9825
10281
  const meta = copy._meta && typeof copy._meta === "object" ? { ...copy._meta } : {};
10282
+ const promptDisplayText = channelDisplayText;
9826
10283
  delete meta[DAEMON_RETRY_META_KEY];
9827
10284
  delete meta[INVOCATION_CONTEXT_META_KEY];
9828
10285
  delete meta[PRIVATE_PARENT_CAPABILITY_META_KEY];
9829
10286
  delete meta[DAEMON_CONTINUE_META_KEY];
9830
10287
  delete meta[DAEMON_CHANNEL_DELIVERY_META_KEY];
10288
+ delete meta[DAEMON_PROMPT_DISPLAY_TEXT_META_KEY];
9831
10289
  delete meta[DAEMON_MODEL_PROMPT_META_KEY];
9832
10290
  if (isRetry) {
9833
10291
  meta[DAEMON_RETRY_META_KEY] = true;
@@ -9838,6 +10296,9 @@ function createAcpSessionBridge(opts) {
9838
10296
  if (context?.channelDelivery) {
9839
10297
  meta[DAEMON_CHANNEL_DELIVERY_META_KEY] = context.channelDelivery;
9840
10298
  }
10299
+ if (promptDisplayText !== void 0) {
10300
+ meta[DAEMON_PROMPT_DISPLAY_TEXT_META_KEY] = promptDisplayText;
10301
+ }
9841
10302
  if (modelPrompt !== void 0) {
9842
10303
  meta[DAEMON_MODEL_PROMPT_META_KEY] = modelPrompt;
9843
10304
  }
@@ -9867,7 +10328,8 @@ function createAcpSessionBridge(opts) {
9867
10328
  entry,
9868
10329
  promptRequest,
9869
10330
  pendingEntry.promptId,
9870
- originatorClientId
10331
+ originatorClientId,
10332
+ channelDisplayText
9871
10333
  );
9872
10334
  }
9873
10335
  } catch (echoErr) {
@@ -10226,16 +10688,20 @@ function createAcpSessionBridge(opts) {
10226
10688
  releaseFreshSessionReservation(admission);
10227
10689
  }, "releaseAdmissionOnce");
10228
10690
  try {
10229
- const ci = await ensureChannel();
10691
+ assertLivePromptEntry(sessionId, entry);
10692
+ const ci = channelInfoForEntry(entry);
10230
10693
  const result = await withTimeout(
10231
- ci.connection.extMethod(
10232
- isSideTask ? SERVE_CONTROL_EXT_METHODS.sessionSideTask : SERVE_CONTROL_EXT_METHODS.sessionBranch,
10233
- {
10234
- sessionId,
10235
- cwd: boundWorkspace,
10236
- name: req.name
10237
- }
10238
- ),
10694
+ Promise.race([
10695
+ ci.connection.extMethod(
10696
+ isSideTask ? SERVE_CONTROL_EXT_METHODS.sessionSideTask : SERVE_CONTROL_EXT_METHODS.sessionBranch,
10697
+ {
10698
+ sessionId,
10699
+ cwd: boundWorkspace,
10700
+ name: req.name
10701
+ }
10702
+ ),
10703
+ getTransportClosedReject(entry)
10704
+ ]),
10239
10705
  initTimeoutMs,
10240
10706
  isSideTask ? "createSideTaskSession" : "branchSession"
10241
10707
  );
@@ -10271,10 +10737,25 @@ function createAcpSessionBridge(opts) {
10271
10737
  `qwen serve: branchSession load failed for ${result.newSessionId}, attempting cleanup...`
10272
10738
  );
10273
10739
  try {
10274
- await ci.connection.extMethod(
10275
- SERVE_CONTROL_EXT_METHODS.sessionClose,
10276
- { sessionId: result.newSessionId, cwd: boundWorkspace }
10277
- );
10740
+ if (!ci.isDying) {
10741
+ await withTimeout(
10742
+ Promise.race([
10743
+ ci.connection.extMethod(
10744
+ SERVE_CONTROL_EXT_METHODS.sessionClose,
10745
+ {
10746
+ sessionId: result.newSessionId,
10747
+ cwd: boundWorkspace
10748
+ }
10749
+ ),
10750
+ channelUnavailableReject(
10751
+ ci.channel,
10752
+ "during branchSession cleanup"
10753
+ )
10754
+ ]),
10755
+ initTimeoutMs,
10756
+ "branchSession cleanup"
10757
+ );
10758
+ }
10278
10759
  } catch (cleanupErr) {
10279
10760
  writeStderrLine(
10280
10761
  `qwen serve: branchSession cleanup of ${result.newSessionId} failed: ${cleanupErr instanceof Error ? cleanupErr.message : cleanupErr}`
@@ -10370,16 +10851,16 @@ function createAcpSessionBridge(opts) {
10370
10851
  if (entry.promptActive) {
10371
10852
  throw new CdWhilePromptActiveError(sessionId);
10372
10853
  }
10373
- const ci = await ensureChannel();
10374
- const raw = await ci.connection.extMethod(
10375
- SERVE_CONTROL_EXT_METHODS.sessionCd,
10376
- {
10854
+ assertLivePromptEntry(sessionId, entry);
10855
+ const raw = await Promise.race([
10856
+ entry.connection.extMethod(SERVE_CONTROL_EXT_METHODS.sessionCd, {
10377
10857
  sessionId,
10378
10858
  path: req.path,
10379
10859
  ...req.allowedRoots ? { allowedRoots: req.allowedRoots } : {},
10380
10860
  ...req.managedRelocation ? { managedRelocation: req.managedRelocation } : {}
10381
- }
10382
- );
10861
+ }),
10862
+ getTransportClosedReject(entry)
10863
+ ]);
10383
10864
  const extResult = raw;
10384
10865
  if (typeof extResult?.previousCwd !== "string" || typeof extResult?.newCwd !== "string" || !Array.isArray(extResult?.warnings)) {
10385
10866
  throw new Error(
@@ -10912,6 +11393,7 @@ function createAcpSessionBridge(opts) {
10912
11393
  const bootstrapRefreshConnections = /* @__PURE__ */ new Set();
10913
11394
  const refreshSession = /* @__PURE__ */ __name(async (entry, refreshBootstrap) => {
10914
11395
  let inFlight = inFlightExtensionRefreshes.get(entry.sessionId);
11396
+ let created = false;
10915
11397
  if (!inFlight || inFlight.connection !== entry.connection || refreshBootstrap && !inFlight.refreshBootstrap) {
10916
11398
  const promise = (async () => {
10917
11399
  await entry.connection.extMethod(
@@ -10922,27 +11404,36 @@ function createAcpSessionBridge(opts) {
10922
11404
  }
10923
11405
  );
10924
11406
  })();
11407
+ let rejectUnavailable;
11408
+ const unavailable = new Promise((_resolve, reject) => {
11409
+ rejectUnavailable = /* @__PURE__ */ __name(() => reject(
11410
+ new BridgeChannelClosedError("refreshExtensionsForAllSessions")
11411
+ ), "rejectUnavailable");
11412
+ });
10925
11413
  inFlight = {
10926
11414
  connection: entry.connection,
10927
11415
  promise,
11416
+ wait: Promise.race([
11417
+ withTimeout(
11418
+ promise,
11419
+ 3e4,
11420
+ SERVE_CONTROL_EXT_METHODS.workspaceExtensionsRefresh
11421
+ ),
11422
+ unavailable
11423
+ ]),
11424
+ rejectUnavailable,
10928
11425
  refreshBootstrap
10929
11426
  };
10930
11427
  inFlightExtensionRefreshes.set(entry.sessionId, inFlight);
10931
- const clear = /* @__PURE__ */ __name(() => {
10932
- if (inFlightExtensionRefreshes.get(entry.sessionId) === inFlight) {
10933
- inFlightExtensionRefreshes.delete(entry.sessionId);
10934
- }
10935
- }, "clear");
10936
- void promise.then(clear, clear);
11428
+ created = true;
10937
11429
  }
10938
- await Promise.race([
10939
- withTimeout(
10940
- inFlight.promise,
10941
- 3e4,
10942
- SERVE_CONTROL_EXT_METHODS.workspaceExtensionsRefresh
10943
- ),
10944
- getTransportClosedReject(entry)
10945
- ]);
11430
+ const clear = /* @__PURE__ */ __name(() => {
11431
+ if (inFlightExtensionRefreshes.get(entry.sessionId) === inFlight) {
11432
+ inFlightExtensionRefreshes.delete(entry.sessionId);
11433
+ }
11434
+ }, "clear");
11435
+ if (created) void inFlight.promise.then(clear, clear);
11436
+ await inFlight.wait;
10946
11437
  }, "refreshSession");
10947
11438
  const results = await Promise.all(
10948
11439
  sessions.map(async (entry) => {
@@ -11069,6 +11560,29 @@ function createAcpSessionBridge(opts) {
11069
11560
  }
11070
11561
  return response;
11071
11562
  },
11563
+ async setSessionConfigOption(sessionId, req) {
11564
+ const entry = byId.get(sessionId);
11565
+ if (!entry) throw new SessionNotFoundError(sessionId);
11566
+ const info = channelInfoForEntry(entry);
11567
+ if (!info || info.isDying) throw new SessionNotFoundError(sessionId);
11568
+ const normalized = { ...req, sessionId };
11569
+ const transportClosed = getTransportClosedReject(entry);
11570
+ const work = entry.modelChangeQueue.then(
11571
+ () => Promise.race([
11572
+ withTimeout(
11573
+ entry.connection.setSessionConfigOption(normalized),
11574
+ initTimeoutMs,
11575
+ "setSessionConfigOption"
11576
+ ),
11577
+ transportClosed
11578
+ ])
11579
+ );
11580
+ entry.modelChangeQueue = work.then(
11581
+ () => void 0,
11582
+ () => void 0
11583
+ );
11584
+ return await work;
11585
+ },
11072
11586
  async setSessionLanguage(sessionId, params, context) {
11073
11587
  const entry = byId.get(sessionId);
11074
11588
  if (!entry) throw new SessionNotFoundError(sessionId);
@@ -11677,9 +12191,16 @@ function createAcpSessionBridge(opts) {
11677
12191
  });
11678
12192
  const historyOutput = output.length > MAX_SHELL_OUTPUT_FOR_HISTORY ? output.substring(0, MAX_SHELL_OUTPUT_FOR_HISTORY) + "\n... (truncated)" : output;
11679
12193
  try {
11680
- await entry.connection.extMethod(
11681
- SERVE_CONTROL_EXT_METHODS.sessionShellHistory,
11682
- { sessionId, command, output: historyOutput, exitCode }
12194
+ await withTimeout(
12195
+ Promise.race([
12196
+ entry.connection.extMethod(
12197
+ SERVE_CONTROL_EXT_METHODS.sessionShellHistory,
12198
+ { sessionId, command, output: historyOutput, exitCode }
12199
+ ),
12200
+ getTransportClosedReject(entry)
12201
+ ]),
12202
+ initTimeoutMs,
12203
+ "sessionShellHistory"
11683
12204
  );
11684
12205
  } catch (err) {
11685
12206
  writeServeDebugLine(