@qwen-code/qwen-code 0.22.3 → 0.23.0

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 (497) hide show
  1. package/README.md +30 -0
  2. package/bundled/computer-use/SKILL.md +116 -180
  3. package/bundled/goal-draft/SKILL.md +5 -1
  4. package/bundled/qc-helper/docs/common-workflow.md +32 -0
  5. package/bundled/qc-helper/docs/configuration/auth.md +6 -6
  6. package/bundled/qc-helper/docs/configuration/model-providers.md +8 -2
  7. package/bundled/qc-helper/docs/configuration/settings.md +63 -58
  8. package/bundled/qc-helper/docs/extension/introduction.md +1 -1
  9. package/bundled/qc-helper/docs/features/_meta.ts +1 -0
  10. package/bundled/qc-helper/docs/features/approval-mode.md +3 -0
  11. package/bundled/qc-helper/docs/features/auto-mode.md +34 -17
  12. package/bundled/qc-helper/docs/features/channels/dingtalk.md +4 -2
  13. package/bundled/qc-helper/docs/features/channels/dws.md +6 -2
  14. package/bundled/qc-helper/docs/features/channels/overview.md +5 -2
  15. package/bundled/qc-helper/docs/features/code-review.md +2 -2
  16. package/bundled/qc-helper/docs/features/commands.md +79 -1
  17. package/bundled/qc-helper/docs/features/computer-use.md +2 -2
  18. package/bundled/qc-helper/docs/features/goals.md +9 -3
  19. package/bundled/qc-helper/docs/features/headless.md +16 -1
  20. package/bundled/qc-helper/docs/features/hooks.md +8 -3
  21. package/bundled/qc-helper/docs/features/memory.md +1 -0
  22. package/bundled/qc-helper/docs/features/output-styles.md +38 -0
  23. package/bundled/qc-helper/docs/qwen-serve-deploy-local.md +17 -7
  24. package/bundled/qc-helper/docs/qwen-serve.md +74 -55
  25. package/bundled/review/SKILL.md +16 -7
  26. package/bundled/review/references/posting.md +3 -3
  27. package/chunks/MaxSizedBox-B3D7545A.js +111 -0
  28. package/chunks/{StandaloneSessionPicker-2FJAOLGG.js → StandaloneSessionPicker-QUMO4LLQ.js} +88 -86
  29. package/chunks/{acp-startup-profiler-GNYAL6LI.js → acp-startup-profiler-M4X5F3VK.js} +2 -2
  30. package/chunks/{acpAgent-2ZMIJAFV.js → acpAgent-2GTFCIEP.js} +2041 -444
  31. package/chunks/{agent-X5WX3L2I.js → agent-XKF5SZWU.js} +46 -46
  32. package/chunks/agent-headless-OC2IB55D.js +85 -0
  33. package/chunks/{anthropicContentGenerator-YVTB6QX7.js → anthropicContentGenerator-L76MR5OR.js} +53 -20
  34. package/chunks/{artifact-tool-XSMPHZBT.js → artifact-tool-MYCL2QCS.js} +3 -4
  35. package/chunks/{askUserQuestion-4SWJY65V.js → askUserQuestion-THQZMG44.js} +45 -7
  36. package/chunks/bridge-IHSBI2YJ.js +118 -0
  37. package/chunks/{build-INBK7IXX.js → build-63BIOYWK.js} +1 -1
  38. package/chunks/{ca-7HPYOYSZ.js → ca-BNU7YNDE.js} +3 -0
  39. package/chunks/{channel-management-service-HQ6KDS7C.js → channel-management-service-4MTCEGJB.js} +4 -4
  40. package/chunks/channel-settings-store-BVKWAI2T.js +121 -0
  41. package/chunks/{channel-worker-group-6NA6BBZV.js → channel-worker-group-47F4ISUZ.js} +7 -7
  42. package/chunks/{channel-worker-manager-NEZ2J6RK.js → channel-worker-manager-I5Y44GYR.js} +51 -10
  43. package/chunks/{channel-worker-supervisor-FKU7DIHJ.js → channel-worker-supervisor-6VCLUXFE.js} +4 -4
  44. package/chunks/{chunk-PPKZ7JOE.js → chunk-22UH7VTP.js} +1 -1
  45. package/chunks/chunk-24FVUD5P.js +49 -0
  46. package/chunks/{chunk-MZCJWS5Y.js → chunk-2M3EWQNG.js} +20 -0
  47. package/chunks/{chunk-7T52W4SW.js → chunk-32LU3APX.js} +1 -1
  48. package/chunks/{chunk-42IDLQWS.js → chunk-373DQUVA.js} +48 -13
  49. package/chunks/{chunk-MSBO7X2W.js → chunk-37JFWFCD.js} +1 -1
  50. package/chunks/{chunk-3JXM2CVW.js → chunk-3AKCBZVW.js} +3 -3
  51. package/chunks/{chunk-TVC6HQ2U.js → chunk-3JQZVCBI.js} +2 -2
  52. package/chunks/{chunk-2LNNVAUV.js → chunk-3L724BJ5.js} +246 -15
  53. package/chunks/{chunk-E7REAOTN.js → chunk-47ECGEJC.js} +4 -0
  54. package/chunks/{chunk-WNPDGUJO.js → chunk-47RYEQW5.js} +2 -3
  55. package/chunks/{chunk-TZBSGJ6C.js → chunk-4BGDFKQE.js} +7 -7
  56. package/chunks/{chunk-PZ66FRIC.js → chunk-4F7GQGXB.js} +11772 -4773
  57. package/chunks/{chunk-DMLVSW7L.js → chunk-4HVH57J3.js} +713 -9
  58. package/chunks/{chunk-CMHFCLBU.js → chunk-4LIFGNI4.js} +1 -1
  59. package/chunks/{chunk-3SZC4VP4.js → chunk-4M24B5J5.js} +88 -49
  60. package/chunks/{chunk-BOWFGCEU.js → chunk-4PSDSCW3.js} +3 -3
  61. package/chunks/chunk-4UANMABT.js +1026 -0
  62. package/chunks/{chunk-M3QRM3DE.js → chunk-54C6PIGT.js} +5 -5
  63. package/chunks/{chunk-HP5LR5HL.js → chunk-5EIOJGCR.js} +4 -4
  64. package/chunks/{chunk-64REQJJ2.js → chunk-5H5S4UY5.js} +3 -3
  65. package/chunks/chunk-5IENVM7Z.js +35 -0
  66. package/chunks/{chunk-I6LYRJPB.js → chunk-5Q5RC2WE.js} +2 -2
  67. package/chunks/{chunk-WGY3AVGM.js → chunk-5RTTI4GE.js} +79 -5
  68. package/chunks/{chunk-KID24ZFN.js → chunk-64QH2UC6.js} +13 -1
  69. package/chunks/{chunk-MF7HCQWZ.js → chunk-65HWLGA7.js} +3 -3
  70. package/chunks/{chunk-OU5APVWO.js → chunk-6A2D4QSO.js} +13 -7
  71. package/chunks/chunk-6HUXPLB5.js +110 -0
  72. package/chunks/{chunk-VQUGEVGR.js → chunk-7IKXTGZT.js} +1 -1
  73. package/chunks/{chunk-UTLCH2FK.js → chunk-7JMGTOH7.js} +437 -136
  74. package/chunks/{chunk-7LOELM2I.js → chunk-7RB56BRJ.js} +3 -3
  75. package/chunks/{chunk-NIFYWDYN.js → chunk-7TBU7PU2.js} +1 -1
  76. package/chunks/{chunk-V2NDP3I4.js → chunk-7XL4WRXM.js} +2 -2
  77. package/chunks/chunk-ADJD4LZF.js +210 -0
  78. package/chunks/{chunk-T7KMERIX.js → chunk-ADYN7P2Y.js} +2 -2
  79. package/chunks/{chunk-TPI7O7HR.js → chunk-AHYTURFB.js} +1 -1
  80. package/chunks/{chunk-LUEHOUHM.js → chunk-AI35S34R.js} +3 -3
  81. package/chunks/{chunk-CIZCL2MW.js → chunk-ALUYNJPM.js} +1486 -2172
  82. package/chunks/{chunk-ABS25QER.js → chunk-ANVG3BVV.js} +1 -1
  83. package/chunks/{chunk-6ZPDLGHN.js → chunk-AZJLY2XZ.js} +5 -5
  84. package/chunks/{chunk-A3LWD5MK.js → chunk-BA4WJC4L.js} +1 -1
  85. package/chunks/{chunk-W3JH33JE.js → chunk-BFY33IB4.js} +18 -10
  86. package/chunks/{chunk-N4X7G4J2.js → chunk-BHTYRHJF.js} +1 -1
  87. package/chunks/{chunk-TEBDFQBZ.js → chunk-BJXCYUGM.js} +11 -6
  88. package/chunks/{chunk-7VMIMAVB.js → chunk-C2VWOXHS.js} +8 -8
  89. package/chunks/{chunk-XHF7WQ6B.js → chunk-C4TIXFDZ.js} +16 -5
  90. package/chunks/chunk-CHEIIBT3.js +40 -0
  91. package/chunks/chunk-CVX63TFJ.js +348 -0
  92. package/chunks/{chunk-RXFQM6FQ.js → chunk-DMEUXLSS.js} +16 -1
  93. package/chunks/{chunk-EKSCLBBF.js → chunk-DQCKVAF5.js} +23 -5
  94. package/chunks/{chunk-734C6JGI.js → chunk-DSX7KQPM.js} +5195 -666
  95. package/chunks/{chunk-4CMJKUND.js → chunk-DTVQSSNM.js} +67 -2
  96. package/chunks/{chunk-BKWNKLZB.js → chunk-DYTW3QVG.js} +24 -9
  97. package/chunks/{chunk-C2X7KY45.js → chunk-E4JNFXNI.js} +3 -3
  98. package/chunks/{chunk-UHQFIS7N.js → chunk-EAHOJF6V.js} +28 -4
  99. package/chunks/{chunk-YLSQLSH7.js → chunk-EBDGRBZX.js} +24 -16
  100. package/chunks/{chunk-DJBQCO2E.js → chunk-EFTPIZIC.js} +412 -3
  101. package/chunks/{chunk-6DIGWMGT.js → chunk-EIJT2PQ6.js} +2 -2
  102. package/chunks/{chunk-4TT3IVGA.js → chunk-EIY7SUPZ.js} +1 -1
  103. package/chunks/{chunk-XQFT3QUF.js → chunk-ENYUKMFK.js} +1 -1
  104. package/chunks/{chunk-ZWJDJ6RU.js → chunk-EVFDRBUM.js} +157 -153
  105. package/chunks/{chunk-4VPCTGH6.js → chunk-EWRW2WQC.js} +15 -9
  106. package/chunks/{chunk-VBCPNIQD.js → chunk-F33GFWPR.js} +47 -184
  107. package/chunks/{chunk-ERFDKH32.js → chunk-F47DITLZ.js} +19 -8
  108. package/chunks/{chunk-73RM4POK.js → chunk-F7NF2IOE.js} +7 -7
  109. package/chunks/{chunk-EB6QRGHM.js → chunk-FD5SJOWT.js} +10 -7
  110. package/chunks/{chunk-SS5SDCD3.js → chunk-FRICLXCZ.js} +7 -7
  111. package/chunks/{chunk-NU7RKEZR.js → chunk-FUO5V5KI.js} +14 -7
  112. package/chunks/{chunk-G6FECKTJ.js → chunk-G5PBOQWI.js} +9 -6
  113. package/chunks/{chunk-CAJTKR6W.js → chunk-G7HBEEX7.js} +15 -9
  114. package/chunks/{chunk-4QHPPXK2.js → chunk-GB4UKWY5.js} +2 -2
  115. package/chunks/{chunk-QYMAKPY5.js → chunk-GH2S4GD5.js} +350 -12
  116. package/chunks/{chunk-LHBUKJG2.js → chunk-GXUTFQXK.js} +28 -25
  117. package/chunks/{chunk-KJO2LBUK.js → chunk-H43PSPYS.js} +5 -5
  118. package/chunks/{chunk-XSG6G3G6.js → chunk-HJBHMANB.js} +12 -14
  119. package/chunks/chunk-HRPFBHW7.js +336 -0
  120. package/chunks/{chunk-6PJOTWAN.js → chunk-HT5S5TRQ.js} +1 -1
  121. package/chunks/{chunk-HCOBAG2L.js → chunk-HWVUSYSN.js} +3 -8
  122. package/chunks/{chunk-2OUD5T67.js → chunk-I2TMJPCV.js} +213 -185
  123. package/chunks/{chunk-CLWO3B77.js → chunk-I4NRYS6A.js} +11 -11
  124. package/chunks/{chunk-V7EESTJV.js → chunk-I5N4EAS6.js} +1 -1
  125. package/chunks/{chunk-K5KXUXWC.js → chunk-IG4W5SJR.js} +3 -3
  126. package/chunks/{chunk-FROAFEFB.js → chunk-IPATA3T2.js} +3 -3
  127. package/chunks/{chunk-NKLP3DCK.js → chunk-IQAFKVXS.js} +1 -1
  128. package/chunks/{chunk-AYHQZBJ4.js → chunk-IRKQ4YYX.js} +3 -3
  129. package/chunks/{chunk-J3NNHTV6.js → chunk-J5TTWBZK.js} +6 -0
  130. package/chunks/{chunk-QFCDF5PL.js → chunk-JHN7UIDW.js} +1 -1
  131. package/chunks/{chunk-AVNATYLY.js → chunk-JJKNYRFY.js} +1 -1
  132. package/chunks/{chunk-CQH5KTKC.js → chunk-JR42V4UY.js} +1 -1
  133. package/chunks/chunk-JS73NNWF.js +30 -0
  134. package/chunks/{chunk-NV55WWD6.js → chunk-JUARRUMA.js} +802 -2011
  135. package/chunks/chunk-JX6XHPTX.js +26 -0
  136. package/chunks/{chunk-5JTIYALA.js → chunk-JZWOCUZ3.js} +1 -1
  137. package/chunks/{chunk-P2G476QN.js → chunk-KEVYJSI4.js} +13 -13
  138. package/chunks/{chunk-B466ZSHZ.js → chunk-KFN2IZYR.js} +3 -3
  139. package/chunks/{chunk-JWALNCLT.js → chunk-KGV55H53.js} +1 -1
  140. package/chunks/{chunk-23RFD54N.js → chunk-KHP66DFN.js} +1 -1
  141. package/chunks/{chunk-2SXSLSQE.js → chunk-KM3XVTMO.js} +12 -6
  142. package/chunks/{chunk-GPGU4S2N.js → chunk-KMU3ZHH4.js} +3 -3
  143. package/chunks/chunk-KOGW3YWJ.js +2054 -0
  144. package/chunks/{chunk-NMOD2FXQ.js → chunk-L26ONV2Y.js} +8 -8
  145. package/chunks/chunk-L34XSHIZ.js +28 -0
  146. package/chunks/{chunk-SEONHUS3.js → chunk-LAUEEBDL.js} +2 -0
  147. package/chunks/{chunk-3WK3QDNV.js → chunk-LB3WQQJK.js} +2 -2
  148. package/chunks/{chunk-URE3QBBB.js → chunk-LEPCWS5A.js} +3 -3
  149. package/chunks/{chunk-36GSQ3MM.js → chunk-LHBNR6EU.js} +2 -2
  150. package/chunks/{chunk-V4264FEG.js → chunk-LKODFJRD.js} +1 -1
  151. package/chunks/{chunk-PADPMMYM.js → chunk-LOBDDFYK.js} +5 -29
  152. package/chunks/{chunk-BXDAPVQU.js → chunk-LU77UT4D.js} +28 -4
  153. package/chunks/{chunk-RFIDDFAL.js → chunk-M4KFODIP.js} +1 -1
  154. package/chunks/{chunk-CFJY4DGX.js → chunk-M4LBBSVP.js} +4 -2
  155. package/chunks/{chunk-KYWTPLBJ.js → chunk-MOF6VZN2.js} +2 -2
  156. package/chunks/{chunk-DJPASAUV.js → chunk-MP6YZ4RK.js} +4829 -3638
  157. package/chunks/{chunk-T26EAKDL.js → chunk-N2TNM3QB.js} +2 -6
  158. package/chunks/{chunk-2TNL5KPM.js → chunk-N4QWUPDM.js} +7 -0
  159. package/chunks/{chunk-7S226YTK.js → chunk-NFIDVZND.js} +11 -1
  160. package/chunks/{chunk-ZEYFMJQA.js → chunk-NQ4L2CMD.js} +83 -18
  161. package/chunks/{chunk-ZZUKP7HV.js → chunk-NRL5CUZT.js} +1 -1
  162. package/chunks/{chunk-WXEA74YB.js → chunk-NSUKQ4DN.js} +9 -3
  163. package/chunks/chunk-NUHOLAQ6.js +59 -0
  164. package/chunks/{chunk-DJEZ55D4.js → chunk-NVVJTUSL.js} +336 -140
  165. package/chunks/{chunk-3XKLXHGK.js → chunk-NXKOVOM5.js} +9 -9
  166. package/chunks/{chunk-5Q372OFJ.js → chunk-O4KNCAX4.js} +57 -10
  167. package/chunks/{chunk-GOXKNSDZ.js → chunk-O5CD7T4T.js} +40 -9
  168. package/chunks/{chunk-XIQ5HQ2F.js → chunk-OBTWL6ZW.js} +1 -1
  169. package/chunks/{chunk-PDQGMSZK.js → chunk-ODZF64DM.js} +1 -1
  170. package/chunks/{chunk-5MK45KZ3.js → chunk-OHOO527W.js} +1 -1
  171. package/chunks/{chunk-36LGBEM6.js → chunk-OHU2H5CS.js} +1 -1
  172. package/chunks/{chunk-JB4JIVTJ.js → chunk-OKTNXDVO.js} +1 -1
  173. package/chunks/{chunk-CETB5XY4.js → chunk-ORFIYTI2.js} +1 -1
  174. package/chunks/{chunk-7E7UCJHS.js → chunk-OSHQMOBS.js} +18 -17
  175. package/chunks/chunk-OSSTATJF.js +1310 -0
  176. package/chunks/chunk-P6UIF2OW.js +400 -0
  177. package/chunks/{chunk-U54AYGEC.js → chunk-PB7JBAHF.js} +15 -49
  178. package/chunks/{chunk-Y5S7LBOZ.js → chunk-PCRBLMIN.js} +17 -3
  179. package/chunks/{chunk-WAOIHTJS.js → chunk-PDAKFU7M.js} +1 -1
  180. package/chunks/{chunk-YTDVNSUQ.js → chunk-QAK5475D.js} +1 -1
  181. package/chunks/{chunk-ST5MDGH3.js → chunk-QI27MKNQ.js} +27 -19
  182. package/chunks/{chunk-MK2GIB46.js → chunk-QJGYU5PG.js} +1 -1
  183. package/chunks/{chunk-SMPR7SPO.js → chunk-QJNDUTOL.js} +45 -239
  184. package/chunks/{chunk-MQM5PJML.js → chunk-QJVZLILI.js} +1 -1
  185. package/chunks/{chunk-B5PHIJGI.js → chunk-QKDNS6FU.js} +2 -2
  186. package/chunks/{chunk-ZU4UDIWX.js → chunk-QQD2GART.js} +15 -9
  187. package/chunks/{chunk-62GQFYID.js → chunk-RAFQIHN2.js} +3 -3
  188. package/chunks/{chunk-MO3FC2WT.js → chunk-RJUVTJEZ.js} +1 -1
  189. package/chunks/{chunk-M6FOJXW3.js → chunk-RKW36UWC.js} +1 -1
  190. package/chunks/{chunk-GBJBJ4HX.js → chunk-RM4WT2XB.js} +4 -26
  191. package/chunks/{chunk-VGIFXISB.js → chunk-RN3YGDCA.js} +7 -5
  192. package/chunks/{chunk-DYXFD5RO.js → chunk-S2T7H5MI.js} +1 -1
  193. package/chunks/{chunk-FTF2YIZ5.js → chunk-S6H3ELPG.js} +1 -1
  194. package/chunks/{chunk-4NDLQAY2.js → chunk-SI7WDR3U.js} +524 -16
  195. package/chunks/{chunk-2YOHKHYR.js → chunk-SRF4KTAG.js} +6 -6
  196. package/chunks/{chunk-ZZMSC3RG.js → chunk-STCVJXQB.js} +24 -24
  197. package/chunks/{chunk-ST5V3ZOC.js → chunk-SULZPKTA.js} +3 -3
  198. package/chunks/{chunk-6X7EU5TI.js → chunk-SX2QIMJV.js} +9 -7
  199. package/chunks/{chunk-V5J4J5TP.js → chunk-TJYRTS4S.js} +2 -20
  200. package/chunks/{chunk-C3PEFRKD.js → chunk-TMKTOTMQ.js} +5 -5
  201. package/chunks/{chunk-ISKH4QX3.js → chunk-TQHPVKO6.js} +4 -4
  202. package/chunks/{chunk-HVC3PNVC.js → chunk-TSZSGQ3N.js} +1 -1
  203. package/chunks/{chunk-ICURCKIU.js → chunk-U4DJ5XB3.js} +594 -91
  204. package/chunks/{chunk-TTX2JUE6.js → chunk-U6D2PPMN.js} +1 -1
  205. package/chunks/{chunk-GVIVASYK.js → chunk-UAKRDON5.js} +4 -4
  206. package/chunks/{chunk-D5LUXLUH.js → chunk-UJ4DUYIH.js} +18 -4
  207. package/chunks/{chunk-VTHREBQM.js → chunk-UKYXYWI2.js} +2 -2
  208. package/chunks/{chunk-ZYMLPEZQ.js → chunk-UM2FFKXN.js} +3 -3
  209. package/chunks/{chunk-2OBKDPZZ.js → chunk-UPFRILIL.js} +2 -2
  210. package/chunks/{chunk-2HYKTO7V.js → chunk-UUASLXHW.js} +55 -6
  211. package/chunks/chunk-V5U2NZNJ.js +29 -0
  212. package/chunks/{chunk-P5Y23G2L.js → chunk-V7RNNPGC.js} +1 -18
  213. package/chunks/{chunk-Q2MSPKIJ.js → chunk-VBWD6C27.js} +1 -1
  214. package/chunks/chunk-VGHZT6JR.js +51 -0
  215. package/chunks/{chunk-MPNBVAEU.js → chunk-VNAYZAFX.js} +4 -4
  216. package/chunks/chunk-VPSIC437.js +780 -0
  217. package/chunks/{chunk-AIAOIFY4.js → chunk-VWTSRH6C.js} +92 -17
  218. package/chunks/{chunk-4K7KNVWH.js → chunk-VYIUNFEA.js} +3 -3
  219. package/chunks/{chunk-EQSBPBZ3.js → chunk-WP4AX3XD.js} +5 -7
  220. package/chunks/{chunk-BFPESSTR.js → chunk-XEAAO654.js} +1 -1
  221. package/chunks/{chunk-RU7BK6B3.js → chunk-XLXAZLDR.js} +3 -3
  222. package/chunks/{chunk-EFWRMA2I.js → chunk-YPWZTR7F.js} +3 -3
  223. package/chunks/{chunk-XF63PKEN.js → chunk-ZDFQGHZH.js} +1 -1
  224. package/chunks/{chunk-OZ6KS6KW.js → chunk-ZGCKTAL5.js} +6 -1
  225. package/chunks/chunk-ZHO2CW6D.js +205 -0
  226. package/chunks/chunk-ZJ2LM2SI.js +198 -0
  227. package/chunks/{chunk-AYFA7MZV.js → chunk-ZKFTS3OV.js} +6 -6
  228. package/chunks/{chunk-HMJ2P3SV.js → chunk-ZL4HFSL6.js} +91 -29
  229. package/chunks/{chunk-DJECZIJX.js → chunk-ZTPGUFQV.js} +30 -8
  230. package/chunks/{chunk-7EQQR46F.js → chunk-ZVP4PWBU.js} +1 -1
  231. package/chunks/chunk-bdqvmfwv-ZTSOWAFE.js +17446 -0
  232. package/chunks/config-utils-LVSYDLHZ.js +114 -0
  233. package/chunks/contextCommand-TZD7UAJK.js +107 -0
  234. package/chunks/{core-runtime-AXB6SK5D.js → core-runtime-B4UKKIAQ.js} +63 -62
  235. package/chunks/{create-sub-session-23ITIELI.js → create-sub-session-LUPWEUHR.js} +3 -3
  236. package/chunks/{create-sub-session-4QNE64MR.js → create-sub-session-NJ24B4US.js} +94 -66
  237. package/chunks/{cron-create-KJ4IY6PP.js → cron-create-CRSPET3H.js} +4 -4
  238. package/chunks/{cron-delete-MBLQCAYY.js → cron-delete-DB77SZTU.js} +4 -4
  239. package/chunks/{cron-list-DWH2PQ47.js → cron-list-U2JNYWV6.js} +4 -4
  240. package/chunks/{daemon-3GNHB3M2.js → daemon-RKDGBFLK.js} +613 -102
  241. package/chunks/{daemon-git-worktree-guard-IVAJJWYK.js → daemon-git-worktree-guard-O2HPOBAB.js} +62 -61
  242. package/chunks/daemon-status-provider-GRRVCJFW.js +117 -0
  243. package/chunks/daemon-trust-policy-YJL442BK.js +113 -0
  244. package/chunks/{daemon-trust-policy-monitor-KGGROSIV.js → daemon-trust-policy-monitor-JL7F4Y4Q.js} +68 -67
  245. package/chunks/{de-X6HLSIFE.js → de-T4BLOKEC.js} +3 -0
  246. package/chunks/deferred-core-runtime-S32AYVZI.js +115 -0
  247. package/chunks/{devtools-JCG4K2NZ.js → devtools-VDRJYPZF.js} +1 -1
  248. package/chunks/{discovery-X2NV535U.js → discovery-TUM3ZQ6U.js} +2 -2
  249. package/chunks/{display-image-BE7I6ZB6.js → display-image-73C7XNRK.js} +5 -5
  250. package/chunks/{dist-LVZCXVPF.js → dist-62OZ7QXB.js} +44 -26
  251. package/chunks/{dist-GFN5DCBX.js → dist-EDHQIBYD.js} +152 -63
  252. package/chunks/{dist-N6W6E753.js → dist-GT64AAUR.js} +135 -26
  253. package/chunks/{dist-6BPYWHVD.js → dist-JVXT4VUJ.js} +14 -7
  254. package/chunks/{dist-4WXLCBDR.js → dist-L6URO6CK.js} +12 -5
  255. package/chunks/{dist-5VXFRTWU.js → dist-LXFYIJNG.js} +866 -172
  256. package/chunks/{dist-SWQMYP2Q.js → dist-PDGNRVPY.js} +27 -8
  257. package/chunks/{dist-NSV4NBPK.js → dist-QAF5DO3Y.js} +380 -83
  258. package/chunks/{dist-HZNT6GQS.js → dist-ZCJLKQSP.js} +28 -14
  259. package/chunks/earlyInputCapture-BBPCIVZG.js +108 -0
  260. package/chunks/{edit-LEQLAGPZ.js → edit-SUGXY63Y.js} +47 -47
  261. package/chunks/{en-YLXBXM4Z.js → en-2RATMNX7.js} +5 -0
  262. package/chunks/{enter-worktree-35QCAAFP.js → enter-worktree-B6USKSIK.js} +7 -7
  263. package/chunks/{enterPlanMode-ONQN3WHE.js → enterPlanMode-MDX4RVVL.js} +48 -48
  264. package/chunks/{environment-UANTR7A4.js → environment-VN6RXDVN.js} +63 -62
  265. package/chunks/errors-UEY36PIT.js +114 -0
  266. package/chunks/{exit-worktree-XQD6D543.js → exit-worktree-DLQ73SJH.js} +10 -8
  267. package/chunks/exitPlanMode-EPHIEDAA.js +83 -0
  268. package/chunks/{fast-path-WUL7UZ6H.js → fast-path-Y73R42LV.js} +8 -7
  269. package/chunks/{fast-path-settings-XH426LUU.js → fast-path-settings-MFUR3IWK.js} +3 -3
  270. package/chunks/{fr-FTZWF462.js → fr-BGHGYX6A.js} +3 -0
  271. package/chunks/{glob-Y54QUWDY.js → glob-DMGH7EZN.js} +47 -47
  272. package/chunks/goal-tools-3RF3PXCL.js +99 -0
  273. package/chunks/{grep-5GPICQBU.js → grep-AJVLCVXC.js} +9 -7
  274. package/chunks/handleAutoUpdate-HVWQT2AU.js +110 -0
  275. package/chunks/i18n-5OR7NTRZ.js +125 -0
  276. package/chunks/{image-gen-J6FDGUZP.js → image-gen-VOIDOHOB.js} +8 -8
  277. package/chunks/initializer-JE5RQSOE.js +114 -0
  278. package/chunks/installationInfo-KO3CCSCK.js +108 -0
  279. package/chunks/{ja-2GL5FKYJ.js → ja-G3FTD5XE.js} +3 -0
  280. package/chunks/{keychain-token-storage-37XPR34V.js → keychain-token-storage-REZVMJA6.js} +2 -2
  281. package/chunks/list-3IORSFIY.js +117 -0
  282. package/chunks/list-agents-SBMONIUK.js +128 -0
  283. package/chunks/{llm-NSAVK5V3.js → llm-K26SUDVK.js} +223 -140
  284. package/chunks/{llm-content-generator-AY2QKXHE.js → llm-content-generator-TT6EAUD4.js} +11 -12
  285. package/chunks/loadedSettingsAdapter-KLLFZF3M.js +111 -0
  286. package/chunks/{loggingContentGenerator-DSFQHXIF.js → loggingContentGenerator-EYQBA4M4.js} +66 -65
  287. package/chunks/{loop-wakeup-XJFONSQ7.js → loop-wakeup-QA6SHCZT.js} +5 -5
  288. package/chunks/{ls-3VAT2J7A.js → ls-HEJNCEYO.js} +4 -4
  289. package/chunks/{lsp-5W7IRUBH.js → lsp-WOQKNZP6.js} +2 -2
  290. package/chunks/{managed-npm-update-TSWENTK5.js → managed-npm-update-HIJTODQT.js} +61 -60
  291. package/chunks/mcp-A2UEHETW.js +111 -0
  292. package/chunks/{monitor-RW4GWJHB.js → monitor-DKNZQAB2.js} +46 -46
  293. package/chunks/{node-QKLNSZMX.js → node-UETAYMMO.js} +3 -3
  294. package/chunks/nonInteractiveCli-YA47F2F4.js +190 -0
  295. package/chunks/{notebook-edit-CQNYS5OR.js → notebook-edit-MGHTRL2D.js} +47 -47
  296. package/chunks/{open-with-auth-YN3QZHVM.js → open-with-auth-D6JD6LDS.js} +3 -3
  297. package/chunks/{openaiContentGenerator-J6QIF7EX.js → openaiContentGenerator-ZJIEQ3ZJ.js} +26 -28
  298. package/chunks/pidfile-ETHAZNMY.js +112 -0
  299. package/chunks/{processUtils-GPHNANKZ.js → processUtils-UY3SAJJZ.js} +2 -2
  300. package/chunks/prompt-terminal-ledger-GZ747VYE.js +106 -0
  301. package/chunks/{pt-XN2YWJVM.js → pt-D73IFYT7.js} +3 -0
  302. package/chunks/{qwenContentGenerator-WWDXPYQI.js → qwenContentGenerator-VI4KATRY.js} +58 -58
  303. package/chunks/{qwenOAuth2-OF5WRBQT.js → qwenOAuth2-7AOCKSOQ.js} +7 -7
  304. package/chunks/{read-file-FQUQHC6N.js → read-file-P7F4P7LV.js} +11 -13
  305. package/chunks/{read-mcp-resource-XD257PGJ.js → read-mcp-resource-GLAGB6R7.js} +2 -2
  306. package/chunks/{record-artifact-VW23GS4F.js → record-artifact-SWVR7NSU.js} +4 -4
  307. package/chunks/renderer-selection-M4UN63VJ.js +99 -0
  308. package/chunks/{report-findings-AO5VYFLR.js → report-findings-AL5YW3KI.js} +5 -5
  309. package/chunks/{request-shutdown-BCLA3JV2.js → request-shutdown-5YK4IZ54.js} +8 -7
  310. package/chunks/resumeHistoryUtils-DPZKFW24.js +119 -0
  311. package/chunks/ripGrep-C7LJKUPZ.js +37 -0
  312. package/chunks/{ru-OLTMFJEW.js → ru-QMISLKRH.js} +3 -0
  313. package/chunks/{run-qwen-serve-5X6IDZER.js → run-qwen-serve-OGTEEUR2.js} +589 -251
  314. package/chunks/{runtime-HK27GMPF.js → runtime-LNBLEMZS.js} +73 -72
  315. package/chunks/scheduled-tasks-FLDYZQOF.js +128 -0
  316. package/chunks/{scheduler-WD4MHMO5.js → scheduler-73YXGUGW.js} +62 -61
  317. package/chunks/{sdk-exporters-grpc-G5IT4XS4.js → sdk-exporters-grpc-MXTVSE3C.js} +2 -2
  318. package/chunks/{sdk-exporters-http-TTU2CHBU.js → sdk-exporters-http-3JO5TJNU.js} +4 -4
  319. package/chunks/{sdk-impl-UUMVYMAL.js → sdk-impl-HZAUUTHJ.js} +6 -6
  320. package/chunks/{send-message-AJ4OCUBV.js → send-message-JC7NJTY6.js} +166 -35
  321. package/chunks/serve-3UR2H4CV.js +119 -0
  322. package/chunks/{server-GO2N5DH7.js → server-AOYZVVOM.js} +2904 -860
  323. package/chunks/{session-IFNHTUBT.js → session-UAWFNFGI.js} +119 -114
  324. package/chunks/session-attachments-root-ZCGXQQTR.js +104 -0
  325. package/chunks/{session-pr-refresh-I3UBWMVP.js → session-pr-refresh-CT2INROL.js} +157 -88
  326. package/chunks/{settings-L6N54CU6.js → settings-BHRGDASJ.js} +67 -66
  327. package/chunks/{shell-4Y5LLW6N.js → shell-YHOGC7TO.js} +46 -46
  328. package/chunks/{skill-YOWTRAKQ.js → skill-ZGBKNCHQ.js} +131 -97
  329. package/chunks/skill-settings-AKSP665O.js +119 -0
  330. package/chunks/spawnChannel-N25MBB6F.js +112 -0
  331. package/chunks/standalone-update-XGPWJDRN.js +119 -0
  332. package/chunks/start-opentui-ui-FZ4USOU7.js +55342 -0
  333. package/chunks/{startInteractiveUI-XDFSHBZD.js → startInteractiveUI-E2WQJUOA.js} +3509 -4706
  334. package/chunks/{syntheticOutput-ML43GEFN.js → syntheticOutput-HJNZSEHN.js} +3 -3
  335. package/chunks/{task-create-QN4LYRSE.js → task-create-6RSD54S5.js} +12 -12
  336. package/chunks/{task-list-JPLGK45U.js → task-list-IQSACPOM.js} +34 -11
  337. package/chunks/{task-stop-CXEH5L2D.js → task-stop-HE2LRQNW.js} +2 -2
  338. package/chunks/{task-update-IWEOJFV2.js → task-update-XAJ2NYOA.js} +13 -14
  339. package/chunks/{team-create-OOPXCDBA.js → team-create-SOKMYSQU.js} +54 -55
  340. package/chunks/{team-delete-RZVVSGCY.js → team-delete-NGNNKGMG.js} +25 -8
  341. package/chunks/{team-plan-approval-DSX5EWAT.js → team-plan-approval-U7ZWXYAY.js} +46 -46
  342. package/chunks/terminal-image-renderer-KKM4OBLO.js +117 -0
  343. package/chunks/theme-manager-GQHF3A7T.js +103 -0
  344. package/chunks/{todoWrite-WDJNQEMW.js → todoWrite-5UTVUXHA.js} +39 -9
  345. package/chunks/{tool-search-J5Q6U7DN.js → tool-search-IAI2RVWT.js} +21 -19
  346. package/chunks/total-session-admission-G4CGCSTG.js +113 -0
  347. package/chunks/trustedFolders-D2I3FDPB.js +123 -0
  348. package/chunks/{update-relaunch-SIKHLHVR.js → update-relaunch-5RWKZAL3.js} +5 -5
  349. package/chunks/updateCheck-ZXOQDFEI.js +119 -0
  350. package/chunks/useAutoAcceptIndicator-6EK4QGAH.js +121 -0
  351. package/chunks/{validateNonInterActiveAuth-JUDQP6V4.js → validateNonInterActiveAuth-QPFEKATS.js} +113 -109
  352. package/chunks/{version-C63GDDWN.js → version-JKNG7YDH.js} +1 -1
  353. package/chunks/{web-fetch-FOQZMNSC.js → web-fetch-X3AHIIHW.js} +16 -19
  354. package/chunks/{web-search-PUJTBFUC.js → web-search-K2FMOGS5.js} +10 -11
  355. package/chunks/{web-shell-static-HNB4FDOE.js → web-shell-static-POZHGGXE.js} +5 -4
  356. package/chunks/{workflow-Y5IPINVH.js → workflow-TOLPAK5G.js} +213 -119
  357. package/chunks/workspace-providers-status-PCJK3RC7.js +115 -0
  358. package/chunks/{workspace-registration-store-SMJWI2AI.js → workspace-registration-store-KQWVVW4Y.js} +2 -1
  359. package/chunks/workspace-registry-YNIOB6HJ.js +122 -0
  360. package/chunks/workspace-runtime-coordinator-WG2RNEN7.js +123 -0
  361. package/chunks/workspace-service-G4ZNBOFH.js +127 -0
  362. package/chunks/workspace-skills-status-FMTPPMWC.js +114 -0
  363. package/chunks/{workspace-trust-reconciler-PLIDLJZX.js → workspace-trust-reconciler-IBDFQBQS.js} +76 -77
  364. package/chunks/wrapper-JH3IFHT2.js +35 -0
  365. package/chunks/write-file-YTLFY2S5.js +88 -0
  366. package/chunks/{zh-UNY63FR3.js → zh-25DF7OGK.js} +5 -0
  367. package/chunks/{zh-TW-RPTMRTHG.js → zh-TW-5EDMZVGK.js} +5 -0
  368. package/chunks/{zoom-image-LYQD7BQA.js → zoom-image-IFXSN74N.js} +11 -13
  369. package/cli.js +131 -90
  370. package/locales/ca.js +6 -0
  371. package/locales/de.js +6 -0
  372. package/locales/en.js +9 -0
  373. package/locales/fr.js +6 -0
  374. package/locales/ja.js +6 -0
  375. package/locales/pt.js +6 -0
  376. package/locales/ru.js +6 -0
  377. package/locales/zh-TW.js +9 -0
  378. package/locales/zh.js +9 -0
  379. package/package.json +3 -3
  380. package/web-shell/assets/{abnfDiagram-VCTEODGH-TRCMSA_6.js → abnfDiagram-VCTEODGH-Cxf7xE_Z.js} +1 -1
  381. package/web-shell/assets/{arc-D9Uls5b3.js → arc-ESi1eNkE.js} +1 -1
  382. package/web-shell/assets/{architectureDiagram-5GKGNRK7-Bwb8jPXg.js → architectureDiagram-5GKGNRK7-D9l7-bDo.js} +1 -1
  383. package/web-shell/assets/{blockDiagram-NRAW4CY4-DHj71TSX.js → blockDiagram-NRAW4CY4-Bc8DEasw.js} +1 -1
  384. package/web-shell/assets/{c4Diagram-UCG6FXSJ-uKBBdbyr.js → c4Diagram-UCG6FXSJ-Dimb2Hmh.js} +1 -1
  385. package/web-shell/assets/channel-B7ohGDil.js +1 -0
  386. package/web-shell/assets/{chunk-2Q5K7J3B-BZd0Phrl.js → chunk-2Q5K7J3B-jVDmOpAQ.js} +1 -1
  387. package/web-shell/assets/{chunk-5VM5RSS4-7KNeNBqN.js → chunk-5VM5RSS4-DbG_SwdB.js} +1 -1
  388. package/web-shell/assets/{chunk-F27PBJKO-BeboS7Fi.js → chunk-F27PBJKO-QEc4cY1v.js} +1 -1
  389. package/web-shell/assets/{chunk-G27WJ6UU-RV3JONoj.js → chunk-G27WJ6UU-iJ36lQ3X.js} +1 -1
  390. package/web-shell/assets/{chunk-JWPE2WC7-Yw9FCFsP.js → chunk-JWPE2WC7-DuArnVtF.js} +1 -1
  391. package/web-shell/assets/{chunk-LCL6LL3I-GIMnydDe.js → chunk-LCL6LL3I-DxOf1zwL.js} +1 -1
  392. package/web-shell/assets/{chunk-POPQ4Y6H-Cfrux7bL.js → chunk-POPQ4Y6H-lVLu9Ild.js} +1 -1
  393. package/web-shell/assets/{chunk-SVP7TREG-BlvIN0CO.js → chunk-SVP7TREG-C6XYlIer.js} +1 -1
  394. package/web-shell/assets/{chunk-XXDRQBXY-DMs7Rr4t.js → chunk-XXDRQBXY-CiG2j2Ji.js} +1 -1
  395. package/web-shell/assets/classDiagram-DTDB5LWJ-DdFpqpfD.js +1 -0
  396. package/web-shell/assets/classDiagram-v2-JRS7N3AN-DdFpqpfD.js +1 -0
  397. package/web-shell/assets/{cose-bilkent-JH36ORCC-DNGqTNwI.js → cose-bilkent-JH36ORCC-DGVHMMVm.js} +1 -1
  398. package/web-shell/assets/{cynefin-OW5HDTMX-CojMpaoH.js → cynefin-OW5HDTMX-D6cgpCnH.js} +1 -1
  399. package/web-shell/assets/{cynefinDiagram-5FMLGOSQ-DF07YXGo.js → cynefinDiagram-5FMLGOSQ-BKv4Z-UX.js} +1 -1
  400. package/web-shell/assets/{dagre-3AP2YEHR-17-4WtCH.js → dagre-3AP2YEHR-B4ABMIG-.js} +1 -1
  401. package/web-shell/assets/{diagram-S7CK7UJ4-G3Wuyz9m.js → diagram-S7CK7UJ4-DgCkp_Lm.js} +1 -1
  402. package/web-shell/assets/{diagram-UQ7AKVKN-nyWIKZ8P.js → diagram-UQ7AKVKN-FG0FNokz.js} +1 -1
  403. package/web-shell/assets/{diagram-VSXAHHWV-tKHhmYSC.js → diagram-VSXAHHWV-JgkP9qg-.js} +1 -1
  404. package/web-shell/assets/{diagram-VX7I27RA-CpDf1hYk.js → diagram-VX7I27RA-ADh2x83l.js} +1 -1
  405. package/web-shell/assets/{diagram-Z3DM3KII-Cah2IFXG.js → diagram-Z3DM3KII-yXqoYF1J.js} +1 -1
  406. package/web-shell/assets/{ebnfDiagram-PWID7BFC-DNaCkgxy.js → ebnfDiagram-PWID7BFC-Duk83Ek_.js} +1 -1
  407. package/web-shell/assets/{erDiagram-SSCWMZ5O-CAdRgcf1.js → erDiagram-SSCWMZ5O-DMdvxySG.js} +1 -1
  408. package/web-shell/assets/{flowDiagram-A5DVABFB-CMUJAShL.js → flowDiagram-A5DVABFB-DHjVgSji.js} +1 -1
  409. package/web-shell/assets/{ganttDiagram-EL5Y4UJY-o-_MUNey.js → ganttDiagram-EL5Y4UJY-DMM9DkCE.js} +1 -1
  410. package/web-shell/assets/{gitGraphDiagram-WWUBYQGX-_aG-2Z7O.js → gitGraphDiagram-WWUBYQGX-t_ug9vO8.js} +1 -1
  411. package/web-shell/assets/index-BGZRqbRo.css +36 -0
  412. package/web-shell/assets/index-DRri_6_x.js +2067 -0
  413. package/web-shell/assets/{index-BK_NKxiJ.js → index-zqvnpGHv.js} +1 -1
  414. package/web-shell/assets/{infoDiagram-RXCK75RN-qJPeZbGP.js → infoDiagram-RXCK75RN-eT1fANNm.js} +1 -1
  415. package/web-shell/assets/{ishikawaDiagram-5VMMS53U-7Om4vNo1.js → ishikawaDiagram-5VMMS53U-k3evzZNn.js} +1 -1
  416. package/web-shell/assets/{journeyDiagram-EYS64GPL-BNtXqmBW.js → journeyDiagram-EYS64GPL-CGim3EAi.js} +1 -1
  417. package/web-shell/assets/{kanban-definition-3QL26DDD-COgFec8P.js → kanban-definition-3QL26DDD-WHfJo-22.js} +1 -1
  418. package/web-shell/assets/{layout-B9n81PC9.js → layout-DkqIaFlJ.js} +1 -1
  419. package/web-shell/assets/{linear-Bb6nXZQq.js → linear-Bdkd3mCz.js} +1 -1
  420. package/web-shell/assets/{mermaid.core-Cgrm3JVT.js → mermaid.core-CGw0LkT_.js} +6 -6
  421. package/web-shell/assets/{mindmap-definition-FBJOCRG2-TKwLTjnG.js → mindmap-definition-FBJOCRG2-C9V4rBvo.js} +1 -1
  422. package/web-shell/assets/{pegDiagram-XKGWAZYB-BJPuvlpi.js → pegDiagram-XKGWAZYB-CwoI2T5G.js} +1 -1
  423. package/web-shell/assets/{pieDiagram-E7YTZNPT-D01VkNsW.js → pieDiagram-E7YTZNPT-DaTmBmPG.js} +1 -1
  424. package/web-shell/assets/{quadrantDiagram-AXDQQJYC-C4hHsiv-.js → quadrantDiagram-AXDQQJYC-plh6MyGI.js} +1 -1
  425. package/web-shell/assets/{railroadDiagram-O6MQD6OU-CuEO4xK2.js → railroadDiagram-O6MQD6OU-D_b-S0iK.js} +1 -1
  426. package/web-shell/assets/{requirementDiagram-EFPCY7ZU-D5J_vIo5.js → requirementDiagram-EFPCY7ZU-zUzTN7VE.js} +1 -1
  427. package/web-shell/assets/{sankeyDiagram-P5KCCOFB-DQKY223V.js → sankeyDiagram-P5KCCOFB-m6AhoD0l.js} +1 -1
  428. package/web-shell/assets/{sequenceDiagram-WJ2MYXX4-D27YV_cm.js → sequenceDiagram-WJ2MYXX4-Cwhzsine.js} +1 -1
  429. package/web-shell/assets/{sizeCapture-X5ZJPWSS-TJg8UcwV.js → sizeCapture-X5ZJPWSS-CcZuKIae.js} +1 -1
  430. package/web-shell/assets/{stateDiagram-HBIQ2CUA-CmnPzUIx.js → stateDiagram-HBIQ2CUA-CFoiJwD_.js} +1 -1
  431. package/web-shell/assets/stateDiagram-v2-4QOOHH4V--H8HdEmk.js +1 -0
  432. package/web-shell/assets/{swimlanes-XN3QIQJK-ByeP3_Nu.js → swimlanes-XN3QIQJK-CgS9hcaV.js} +1 -1
  433. package/web-shell/assets/swimlanesDiagram-VK2B7HYN-ShE9OIgf.js +8 -0
  434. package/web-shell/assets/{timeline-definition-24CTP7MA-BsFA5juR.js → timeline-definition-24CTP7MA-Dzzc05t9.js} +1 -1
  435. package/web-shell/assets/{vennDiagram-4TSXK5OY-DREP2ECo.js → vennDiagram-4TSXK5OY-DemK0f7Y.js} +1 -1
  436. package/web-shell/assets/{wardleyDiagram-VM6X3IG4-iyd9lKi2.js → wardleyDiagram-VM6X3IG4-CquLxtMr.js} +1 -1
  437. package/web-shell/assets/{xychartDiagram-S5SC5T6Z-CVr1_j9q.js → xychartDiagram-S5SC5T6Z-BTBKTM5g.js} +1 -1
  438. package/web-shell/index.html +196 -2
  439. package/chunks/MaxSizedBox-X42SXBJH.js +0 -110
  440. package/chunks/agent-headless-IZM25LJA.js +0 -85
  441. package/chunks/bridge-ME6QXZNA.js +0 -119
  442. package/chunks/channel-settings-store-PEOI7XCG.js +0 -120
  443. package/chunks/chunk-7J6OTNGO.js +0 -424
  444. package/chunks/chunk-BWORX6FA.js +0 -135
  445. package/chunks/chunk-CPBF7KYF.js +0 -51
  446. package/chunks/chunk-H72BQNM3.js +0 -645
  447. package/chunks/chunk-JHYH6PYQ.js +0 -3096
  448. package/chunks/chunk-SS4MRMKE.js +0 -3525
  449. package/chunks/chunk-T4EFG2P5.js +0 -113
  450. package/chunks/chunk-XZA32HII.js +0 -19
  451. package/chunks/chunk-ZYNTSXWK.js +0 -32
  452. package/chunks/config-utils-R6M3TA34.js +0 -113
  453. package/chunks/contextCommand-ZCAP23J6.js +0 -106
  454. package/chunks/daemon-status-provider-K3SJ5C2U.js +0 -117
  455. package/chunks/daemon-trust-policy-DOR3YG62.js +0 -112
  456. package/chunks/deferred-core-runtime-WOYLUQQ7.js +0 -114
  457. package/chunks/earlyInputCapture-OHBEVO4K.js +0 -107
  458. package/chunks/errors-WAK6KFBC.js +0 -113
  459. package/chunks/exitPlanMode-UEYBG6P5.js +0 -83
  460. package/chunks/goal-tools-PTD3MBA7.js +0 -411
  461. package/chunks/handleAutoUpdate-FP3NWNSG.js +0 -109
  462. package/chunks/i18n-INIU5X7A.js +0 -124
  463. package/chunks/initializer-TYODV6GE.js +0 -113
  464. package/chunks/installationInfo-AAPKYDSZ.js +0 -107
  465. package/chunks/list-TUODDN6J.js +0 -116
  466. package/chunks/list-agents-DI3YFTDT.js +0 -80
  467. package/chunks/loadedSettingsAdapter-KJCLZ3C4.js +0 -110
  468. package/chunks/mcp-MWSAPFOL.js +0 -110
  469. package/chunks/nonInteractiveCli-JXKL343Q.js +0 -185
  470. package/chunks/pidfile-QOIQZFT2.js +0 -111
  471. package/chunks/prompt-terminal-ledger-FOMFTYOM.js +0 -105
  472. package/chunks/resumeHistoryUtils-NSGF3UCB.js +0 -118
  473. package/chunks/ripGrep-4CAT6SKV.js +0 -39
  474. package/chunks/scheduled-tasks-MN2ZZ5P6.js +0 -127
  475. package/chunks/serve-2XCHPPGG.js +0 -118
  476. package/chunks/skill-settings-ZL4JY5UE.js +0 -118
  477. package/chunks/spawnChannel-ZST6XJVJ.js +0 -112
  478. package/chunks/standalone-update-THVU3OKY.js +0 -118
  479. package/chunks/terminal-image-renderer-KS25G33E.js +0 -114
  480. package/chunks/theme-manager-YMZNG45F.js +0 -102
  481. package/chunks/total-session-admission-PVN64JVV.js +0 -114
  482. package/chunks/trustedFolders-FATSC4YI.js +0 -122
  483. package/chunks/updateCheck-D3YG2WCD.js +0 -118
  484. package/chunks/useAutoAcceptIndicator-ILINOSAS.js +0 -120
  485. package/chunks/workspace-providers-status-IJ4VHFMB.js +0 -114
  486. package/chunks/workspace-registry-BTGZIMPK.js +0 -123
  487. package/chunks/workspace-service-SIN67ITC.js +0 -126
  488. package/chunks/workspace-skills-status-F3RKCUIX.js +0 -113
  489. package/chunks/write-file-PAIGB33C.js +0 -88
  490. package/web-shell/assets/channel-CXjVLaBa.js +0 -1
  491. package/web-shell/assets/classDiagram-DTDB5LWJ-DANEijO3.js +0 -1
  492. package/web-shell/assets/classDiagram-v2-JRS7N3AN-DANEijO3.js +0 -1
  493. package/web-shell/assets/index-Ci-z4zWY.js +0 -1913
  494. package/web-shell/assets/index-LDlXZRHA.css +0 -36
  495. package/web-shell/assets/stateDiagram-v2-4QOOHH4V-DNKPyrDc.js +0 -1
  496. package/web-shell/assets/swimlanesDiagram-VK2B7HYN-ZL1HPC6w.js +0 -8
  497. /package/chunks/{chunk-FOGQO4FG.js → chunk-JA5CBKRP.js} +0 -0
@@ -3,6 +3,10 @@
3
3
  import {
4
4
  computeCpuPercent
5
5
  } from "./chunk-LBOVL47Y.js";
6
+ import {
7
+ hostAssignsIpv6Loopback,
8
+ isOwnInterfaceAddress
9
+ } from "./chunk-24FVUD5P.js";
6
10
  import {
7
11
  resolveServeToken
8
12
  } from "./chunk-ZELCTN6Y.js";
@@ -24,14 +28,20 @@ import {
24
28
  bearerAuth,
25
29
  createBridgeFileSystemAdapter,
26
30
  denyBrowserOriginCors,
31
+ findNonLoopbackHttpOrigin,
27
32
  getAdvertisedServeFeatures,
28
33
  getDeviceFlowRegistry,
29
34
  getRateLimiter,
30
35
  getServeProtocolVersions,
31
36
  hostAllowlist,
37
+ installSelfOriginStripMiddleware,
32
38
  isBrowserAutomationMcpAvailable,
33
39
  isDeepHealthQuery,
40
+ isLocalPathOpenAvailable,
41
+ isLocalTerminalAvailable,
34
42
  isManagedScratchChild,
43
+ isNativeDirectoryPickerAvailable,
44
+ isTrustedLoopbackMode,
35
45
  listenerMaxConnections,
36
46
  parseAllowOriginPatterns,
37
47
  parseDaemonStatusDetail,
@@ -39,7 +49,8 @@ import {
39
49
  prepareManagedScratchRoot,
40
50
  resolveAcpHttpEnabled,
41
51
  toDaemonStatusMemoryLimits
42
- } from "./chunk-4NDLQAY2.js";
52
+ } from "./chunk-SI7WDR3U.js";
53
+ import "./chunk-VGHZT6JR.js";
43
54
  import {
44
55
  ConversationDirectoryIdentityError,
45
56
  assertExactConversationRootIdentity,
@@ -51,10 +62,7 @@ import {
51
62
  isSameConversationDirectoryObject,
52
63
  materializeConversationDirectoryIdentity,
53
64
  revalidateConversationRootIdentity
54
- } from "./chunk-U54AYGEC.js";
55
- import {
56
- isLoopbackBind
57
- } from "./chunk-RXFQM6FQ.js";
65
+ } from "./chunk-PB7JBAHF.js";
58
66
  import {
59
67
  formatMemoryBudgetStderr,
60
68
  resolveDaemonMemoryBudget,
@@ -62,7 +70,7 @@ import {
62
70
  } from "./chunk-UXEO7E3V.js";
63
71
  import {
64
72
  setDeferredRuntimeRequestTiming
65
- } from "./chunk-SEONHUS3.js";
73
+ } from "./chunk-LAUEEBDL.js";
66
74
  import {
67
75
  normalizeSessionIdForLookup
68
76
  } from "./chunk-ZEZKIS2K.js";
@@ -70,6 +78,9 @@ import "./chunk-NYWWQ437.js";
70
78
  import {
71
79
  resolveSessionRestoreTimeoutMs
72
80
  } from "./chunk-4JRM2BSM.js";
81
+ import {
82
+ DEFAULT_RING_SIZE
83
+ } from "./chunk-7U5G6JXI.js";
73
84
  import {
74
85
  DEFAULT_COMPACTED_REPLAY_MAX_BYTES,
75
86
  DEFAULT_MAX_JOURNAL_BYTES,
@@ -81,34 +92,38 @@ import {
81
92
  } from "./chunk-WCCLLK7X.js";
82
93
  import {
83
94
  require_express
84
- } from "./chunk-AYHQZBJ4.js";
95
+ } from "./chunk-IRKQ4YYX.js";
85
96
  import {
86
97
  resolveWebShellDir
87
98
  } from "./chunk-FBX2SDQ4.js";
99
+ import {
100
+ isLoopbackAddress,
101
+ isLoopbackBind
102
+ } from "./chunk-DMEUXLSS.js";
88
103
  import {
89
104
  resolveChannelCwd
90
- } from "./chunk-HVC3PNVC.js";
105
+ } from "./chunk-TSZSGQ3N.js";
91
106
  import {
92
107
  LIVE_HOST_PROTOCOL_VERSION
93
- } from "./chunk-NKLP3DCK.js";
108
+ } from "./chunk-IQAFKVXS.js";
109
+ import "./chunk-ZL4HFSL6.js";
94
110
  import "./chunk-K6KS3LTN.js";
95
- import "./chunk-HMJ2P3SV.js";
96
- import "./chunk-7E7UCJHS.js";
111
+ import "./chunk-OSHQMOBS.js";
97
112
  import {
98
113
  consumeServeFastPathRejectedLoaderKeys,
99
114
  loadServeFastPathSettings,
100
115
  preResolveServeFastPathHomeEnvOverrides
101
- } from "./chunk-T7KMERIX.js";
116
+ } from "./chunk-ADYN7P2Y.js";
102
117
  import {
103
118
  MAX_REGISTERED_WORKSPACES,
104
119
  resolveWorkspaceInputs,
105
120
  workspaceRegistrationId
106
- } from "./chunk-TEBDFQBZ.js";
107
- import "./chunk-G6FECKTJ.js";
121
+ } from "./chunk-BJXCYUGM.js";
122
+ import "./chunk-G5PBOQWI.js";
108
123
  import {
109
124
  LOAD_REPLAY_META_KEY
110
- } from "./chunk-OZ6KS6KW.js";
111
- import "./chunk-ERFDKH32.js";
125
+ } from "./chunk-ZGCKTAL5.js";
126
+ import "./chunk-F47DITLZ.js";
112
127
  import {
113
128
  canonicalizeWorkspace,
114
129
  translateAndCheckAbsoluteWorkspacePath
@@ -116,7 +131,7 @@ import {
116
131
  import {
117
132
  ExtraCaInspectionError,
118
133
  loadableCertificates
119
- } from "./chunk-ISKH4QX3.js";
134
+ } from "./chunk-TQHPVKO6.js";
120
135
  import "./chunk-FYJ7W2PI.js";
121
136
  import "./chunk-Z7B6SRPM.js";
122
137
  import {
@@ -128,7 +143,7 @@ import {
128
143
  import {
129
144
  normalizeWorkerDiagnostic,
130
145
  sanitizeWorkerDiagnostic
131
- } from "./chunk-RFIDDFAL.js";
146
+ } from "./chunk-M4KFODIP.js";
132
147
  import {
133
148
  channelSelectionNames
134
149
  } from "./chunk-ALMR3E6Q.js";
@@ -145,14 +160,14 @@ import {
145
160
  PRIVATE_EXTERNAL_TOOL_GUARD_PROVIDER_ENV
146
161
  } from "./chunk-3VUENPWF.js";
147
162
  import "./chunk-M5GB774H.js";
148
- import {
149
- MAX_DAEMON_WORKSPACES
150
- } from "./chunk-5HBA2Z7V.js";
151
163
  import {
152
164
  sanitizeLogText
153
- } from "./chunk-ICURCKIU.js";
165
+ } from "./chunk-U4DJ5XB3.js";
154
166
  import "./chunk-IW6RQPQB.js";
155
- import "./chunk-GOXKNSDZ.js";
167
+ import {
168
+ MAX_DAEMON_WORKSPACES
169
+ } from "./chunk-5HBA2Z7V.js";
170
+ import "./chunk-O5CD7T4T.js";
156
171
  import {
157
172
  getGlobalQwenDirLite,
158
173
  resolveConfigPathLite
@@ -162,10 +177,10 @@ import {
162
177
  clearLoaderKeyRejectionReporterIfCurrent,
163
178
  scrubInheritedLoaderEnv,
164
179
  setLoaderKeyRejectionReporter
165
- } from "./chunk-MZCJWS5Y.js";
180
+ } from "./chunk-2M3EWQNG.js";
166
181
  import {
167
182
  getCliVersion
168
- } from "./chunk-Q2MSPKIJ.js";
183
+ } from "./chunk-VBWD6C27.js";
169
184
  import "./chunk-W3N5XAZ6.js";
170
185
  import "./chunk-NPQ5ZKRP.js";
171
186
  import {
@@ -174,6 +189,7 @@ import {
174
189
  import "./chunk-LJZSMWOH.js";
175
190
  import "./chunk-GOFAQQZA.js";
176
191
  import "./chunk-5M6IDOMF.js";
192
+ import "./chunk-6HUXPLB5.js";
177
193
  import "./chunk-TWPJO254.js";
178
194
  import "./chunk-CQ35AJ4Z.js";
179
195
  import {
@@ -210,6 +226,7 @@ init_esbuild_shims();
210
226
  var import_express = __toESM(require_express(), 1);
211
227
  import { X509Certificate, createHash as createHash2, timingSafeEqual } from "node:crypto";
212
228
  import { execFile } from "node:child_process";
229
+ import { lookup } from "node:dns/promises";
213
230
  import * as fs from "node:fs";
214
231
  import { createServer } from "node:http";
215
232
  import * as https from "node:https";
@@ -3091,8 +3108,8 @@ var RUNTIME_STARTUP_TIMEOUT_ENV = "QWEN_SERVE_RUNTIME_STARTUP_TIMEOUT_MS";
3091
3108
  var MAX_EVENT_RING_SIZE = 1e6;
3092
3109
  var DEFAULT_MAX_SESSIONS = 32;
3093
3110
  var DEFAULT_MAX_PENDING_PROMPTS_PER_SESSION = 5;
3094
- var DEFAULT_EVENT_RING_SIZE = 8e3;
3095
3111
  var DEFAULT_SESSION_IDLE_TIMEOUT_MS = 30 * 6e4;
3112
+ var DEFAULT_SESSION_PROMPT_SETTLED_CLOSE_GRACE_MS = 0;
3096
3113
  var WORKSPACE_SETTING_SCOPE = "Workspace";
3097
3114
  function isPositiveIntegerMs(value) {
3098
3115
  return Number.isFinite(value) && Number.isInteger(value) && value > 0;
@@ -3226,15 +3243,52 @@ function workspaceRuntimeEffectiveEnv(runtime, daemonEnv) {
3226
3243
  return runtime.env.effectiveEnv ?? daemonEnv;
3227
3244
  }
3228
3245
  __name(workspaceRuntimeEffectiveEnv, "workspaceRuntimeEffectiveEnv");
3229
- function formatChannelWorkerDaemonUrl(host, port, tls = false) {
3246
+ function canonicalIpLiteral(host) {
3247
+ const inner = host.startsWith("[") && host.endsWith("]") ? host.slice(1, -1) : host;
3248
+ try {
3249
+ const hostname = new URL(
3250
+ `http://${inner.includes(":") ? `[${inner}]` : inner}`
3251
+ ).hostname;
3252
+ const canonical = hostname.startsWith("[") && hostname.endsWith("]") ? hostname.slice(1, -1) : hostname;
3253
+ return isIP(canonical) === 0 ? void 0 : canonical;
3254
+ } catch {
3255
+ return void 0;
3256
+ }
3257
+ }
3258
+ __name(canonicalIpLiteral, "canonicalIpLiteral");
3259
+ function formatChannelWorkerDaemonUrl(host, port, tls = false, boundFamily, ipv6LoopbackAssigned = hostAssignsIpv6Loopback()) {
3230
3260
  const scheme = tls ? "https" : "http";
3231
3261
  const normalized = host.trim().toLowerCase();
3232
- if (normalized === "" || normalized === "0.0.0.0" || normalized === "::" || normalized === "[::]") {
3262
+ const canonicalIp = canonicalIpLiteral(normalized);
3263
+ const v6Loopback = ipv6LoopbackAssigned ? `${scheme}://[::1]:${port}` : `${scheme}://127.0.0.1:${port}`;
3264
+ if (normalized === "") {
3265
+ return boundFamily === "IPv4" ? `${scheme}://127.0.0.1:${port}` : v6Loopback;
3266
+ }
3267
+ if (canonicalIp === "::") {
3268
+ return v6Loopback;
3269
+ }
3270
+ if (canonicalIp === "0.0.0.0" || canonicalIp === "::ffff:0:0") {
3233
3271
  return `${scheme}://127.0.0.1:${port}`;
3234
3272
  }
3235
3273
  return `${scheme}://${formatHostForUrl(host)}:${port}`;
3236
3274
  }
3237
3275
  __name(formatChannelWorkerDaemonUrl, "formatChannelWorkerDaemonUrl");
3276
+ function assertChannelWorkerDaemonUrlIsLocal(workerDaemonUrl, hostname) {
3277
+ let host;
3278
+ try {
3279
+ host = new URL(workerDaemonUrl).hostname;
3280
+ } catch {
3281
+ throw new Error(
3282
+ `Channels cannot start: --hostname "${hostname}" cannot be carried in a worker URL (a zone-scoped address has no spelling the URL parser accepts). Bind to loopback, to the wildcard (0.0.0.0 / ::), or to a zone-less literal address of one of this machine's interfaces.`
3283
+ );
3284
+ }
3285
+ if (isLoopbackBind(host)) return;
3286
+ if (isOwnInterfaceAddress(host)) return;
3287
+ throw new Error(
3288
+ `Channels cannot start: --hostname "${hostname}" is not a loopback bind and does not name an address on this host, so channel workers have no local URL to reach the daemon on. Bind to loopback, to the wildcard (0.0.0.0 / ::), or to a literal address of one of this machine's interfaces.`
3289
+ );
3290
+ }
3291
+ __name(assertChannelWorkerDaemonUrlIsLocal, "assertChannelWorkerDaemonUrlIsLocal");
3238
3292
  var WORKER_TLS_TRUST_PROBE = `
3239
3293
  import { isIP } from 'node:net';
3240
3294
  import * as tls from 'node:tls';
@@ -3353,9 +3407,11 @@ function describeWorkerTlsTrustGaps(opts) {
3353
3407
  );
3354
3408
  const leafHeldByWorkers = servingBlocks !== void 0 && servingBlocks.some((block) => block.fingerprint256 === x509.fingerprint256);
3355
3409
  const workerTrustStore = operatorChain && servingBlocks ? [...operatorChain, ...servingChain] : servingChain;
3410
+ const now = Date.now();
3356
3411
  const anchorPath = walkWorkerAnchorPath(
3357
3412
  x509,
3358
3413
  workerTrustStore,
3414
+ now,
3359
3415
  // The `servingBlocks === undefined` fallback prepends the leaf too, but
3360
3416
  // that file already reports its own gap below and the workers receive it
3361
3417
  // verbatim; only the partial-read case needs the distinction.
@@ -3411,7 +3467,6 @@ function describeWorkerTlsTrustGaps(opts) {
3411
3467
  `--tls-cert "${opts.certPath}" is issued by another CA (${x509.issuer.replace(/\r?\n/g, ", ")}), not self-signed, and ${!opts.operatorCaCertPath ? `no NODE_EXTRA_CA_CERTS is set` : opts.operatorCaCertReadError !== void 0 ? `NODE_EXTRA_CA_CERTS "${opts.operatorCaCertPath}" could not be read, so whatever it carries reached nobody` : operatorDiscarded ? `NODE_EXTRA_CA_CERTS "${opts.operatorCaCertPath}" was discarded together with the unloadable serving file above, whatever it carries` : `NODE_EXTRA_CA_CERTS "${opts.operatorCaCertPath}" does not carry a certificate that anchors it`}, so nothing in the channel workers' bundle anchors their trust \u2014 every worker handshake to the daemon will fail UNABLE_TO_VERIFY_LEAF_SIGNATURE unless the issuing CA is already in the workers' default trust store. ` + (operatorDiscarded ? `Re-export --tls-cert as described above and restart; NODE_EXTRA_CA_CERTS is not the file to change.` : opts.operatorCaCertReadError !== void 0 ? `Make NODE_EXTRA_CA_CERTS readable by the daemon as described above and restart.` : `Point NODE_EXTRA_CA_CERTS at the issuing CA (for mkcert: "$(mkcert -CAROOT)/rootCA.pem") and restart.`)
3412
3468
  );
3413
3469
  }
3414
- const now = Date.now();
3415
3470
  for (const member of anchorPath.path) {
3416
3471
  if (member.fingerprint256 === x509.fingerprint256) continue;
3417
3472
  const subject = member.subject.replace(/\r?\n/g, ", ");
@@ -3421,14 +3476,16 @@ function describeWorkerTlsTrustGaps(opts) {
3421
3476
  );
3422
3477
  continue;
3423
3478
  }
3424
- if (new Date(member.validTo).getTime() < now) {
3425
- gaps.push(
3426
- `--tls-cert "${opts.certPath}" chains through "${subject}", which expired on ${member.validTo} \u2014 every worker handshake to the daemon will fail CERT_HAS_EXPIRED. Renew that chain member and restart.`
3427
- );
3428
- } else if (new Date(member.validFrom).getTime() > now) {
3429
- gaps.push(
3430
- `--tls-cert "${opts.certPath}" chains through "${subject}", which is not yet valid (validFrom: ${member.validFrom}) \u2014 every worker handshake to the daemon will fail CERT_NOT_YET_VALID. Check that chain member's notBefore date or the system clock.`
3431
- );
3479
+ if (!certValidAt(member, now)) {
3480
+ if (new Date(member.validTo).getTime() < now) {
3481
+ gaps.push(
3482
+ `--tls-cert "${opts.certPath}" chains through "${subject}", which expired on ${member.validTo} \u2014 every worker handshake to the daemon will fail CERT_HAS_EXPIRED. Renew that chain member and restart.`
3483
+ );
3484
+ } else {
3485
+ gaps.push(
3486
+ `--tls-cert "${opts.certPath}" chains through "${subject}", which is not yet valid (validFrom: ${member.validFrom}) \u2014 every worker handshake to the daemon will fail CERT_NOT_YET_VALID. Check that chain member's notBefore date or the system clock.`
3487
+ );
3488
+ }
3432
3489
  }
3433
3490
  }
3434
3491
  const host = workerDialHost(opts.daemonUrl);
@@ -3549,6 +3606,10 @@ function cannotIssueCertificates(cert) {
3549
3606
  return !isV1Certificate(cert) && keyUsage === void 0;
3550
3607
  }
3551
3608
  __name(cannotIssueCertificates, "cannotIssueCertificates");
3609
+ function certValidAt(cert, now) {
3610
+ return new Date(cert.validFrom).getTime() <= now && new Date(cert.validTo).getTime() >= now;
3611
+ }
3612
+ __name(certValidAt, "certValidAt");
3552
3613
  function isSelfSignedCert(x509) {
3553
3614
  if (x509.subject !== x509.issuer) return false;
3554
3615
  try {
@@ -3619,7 +3680,7 @@ function pathLengthConstraint(cert) {
3619
3680
  return length;
3620
3681
  }
3621
3682
  __name(pathLengthConstraint, "pathLengthConstraint");
3622
- function walkWorkerAnchorPath(leaf, chain, leafHeldByWorkers = true) {
3683
+ function walkWorkerAnchorPath(leaf, chain, now, leafHeldByWorkers = true) {
3623
3684
  let next = leaf;
3624
3685
  const walked = /* @__PURE__ */ new Set();
3625
3686
  const path2 = [];
@@ -3644,9 +3705,10 @@ function walkWorkerAnchorPath(leaf, chain, leafHeldByWorkers = true) {
3644
3705
  return pathLengthViolation ? { anchored: false, path: path2, pathLengthViolation } : { anchored: true, path: path2 };
3645
3706
  }
3646
3707
  walked.add(current.fingerprint256);
3647
- const issuer = chain.find(
3708
+ const issuers = chain.filter(
3648
3709
  (candidate) => !walked.has(candidate.fingerprint256) && certIssuedBy(current, candidate)
3649
3710
  );
3711
+ const issuer = issuers.find((candidate) => certValidAt(candidate, now)) ?? issuers[0];
3650
3712
  if (issuer && !isSelfSignedCert(issuer) && !issuer.ca) {
3651
3713
  return { anchored: false, path: path2, incapableIssuer: issuer };
3652
3714
  }
@@ -3738,12 +3800,12 @@ __name(hasRetryableChannelWorkerShutdownError, "hasRetryableChannelWorkerShutdow
3738
3800
  var channelWorkerRuntimePromise;
3739
3801
  async function loadChannelWorkerRuntime() {
3740
3802
  channelWorkerRuntimePromise ??= Promise.all([
3741
- import("./channel-worker-supervisor-FKU7DIHJ.js"),
3742
- import("./pidfile-QOIQZFT2.js"),
3743
- import("./runtime-HK27GMPF.js"),
3803
+ import("./channel-worker-supervisor-6VCLUXFE.js"),
3804
+ import("./pidfile-ETHAZNMY.js"),
3805
+ import("./runtime-LNBLEMZS.js"),
3744
3806
  import("./cli-entry-path-4VJ3Y6T2.js"),
3745
- import("./channel-worker-group-6NA6BBZV.js"),
3746
- import("./channel-worker-manager-NEZ2J6RK.js")
3807
+ import("./channel-worker-group-47F4ISUZ.js"),
3808
+ import("./channel-worker-manager-I5Y44GYR.js")
3747
3809
  ]).then(
3748
3810
  ([
3749
3811
  supervisor,
@@ -3849,13 +3911,13 @@ function shouldPreheatBridge(deps) {
3849
3911
  __name(shouldPreheatBridge, "shouldPreheatBridge");
3850
3912
  var coreRuntimePromise;
3851
3913
  function loadCoreRuntime() {
3852
- coreRuntimePromise ??= import("./core-runtime-AXB6SK5D.js");
3914
+ coreRuntimePromise ??= import("./core-runtime-B4UKKIAQ.js");
3853
3915
  return coreRuntimePromise;
3854
3916
  }
3855
3917
  __name(loadCoreRuntime, "loadCoreRuntime");
3856
3918
  var liveDiscoveryRuntimePromise;
3857
3919
  function loadLiveDiscoveryRuntime() {
3858
- liveDiscoveryRuntimePromise ??= import("./discovery-X2NV535U.js");
3920
+ liveDiscoveryRuntimePromise ??= import("./discovery-TUM3ZQ6U.js");
3859
3921
  return liveDiscoveryRuntimePromise;
3860
3922
  }
3861
3923
  __name(loadLiveDiscoveryRuntime, "loadLiveDiscoveryRuntime");
@@ -3885,10 +3947,10 @@ __name(resolveDaemonLogBaseDirForRun, "resolveDaemonLogBaseDirForRun");
3885
3947
  var settingsRuntimePromise;
3886
3948
  function loadSettingsRuntimeModules() {
3887
3949
  settingsRuntimePromise ??= Promise.all([
3888
- import("./settings-L6N54CU6.js"),
3889
- import("./environment-UANTR7A4.js"),
3890
- import("./loadedSettingsAdapter-KJCLZ3C4.js"),
3891
- import("./trustedFolders-FATSC4YI.js")
3950
+ import("./settings-BHRGDASJ.js"),
3951
+ import("./environment-VN6RXDVN.js"),
3952
+ import("./loadedSettingsAdapter-KLLFZF3M.js"),
3953
+ import("./trustedFolders-D2I3FDPB.js")
3892
3954
  ]).then(([settings, environment, loadedSettingsAdapter, trustedFolders]) => ({
3893
3955
  settings,
3894
3956
  environment,
@@ -3901,8 +3963,8 @@ __name(loadSettingsRuntimeModules, "loadSettingsRuntimeModules");
3901
3963
  var channelWebhookConfigRuntimePromise;
3902
3964
  function loadChannelWebhookConfigRuntime() {
3903
3965
  channelWebhookConfigRuntimePromise ??= Promise.all([
3904
- import("./runtime-HK27GMPF.js"),
3905
- import("./config-utils-R6M3TA34.js")
3966
+ import("./runtime-LNBLEMZS.js"),
3967
+ import("./config-utils-LVSYDLHZ.js")
3906
3968
  ]).then(([channelRuntime, configUtils]) => ({
3907
3969
  loadChannelsConfig: channelRuntime.loadChannelsConfig,
3908
3970
  parseChannelWebhookConfig: configUtils.parseChannelWebhookConfig
@@ -3926,20 +3988,22 @@ async function loadServeRuntimeModules() {
3926
3988
  workspaceSkillsStatusModule,
3927
3989
  totalSessionAdmissionModule,
3928
3990
  workspaceRegistryModule,
3991
+ workspaceRuntimeCoordinatorModule,
3929
3992
  promptLedgerModule
3930
3993
  ] = await Promise.all([
3931
- import("./server-GO2N5DH7.js"),
3932
- import("./bridge-ME6QXZNA.js"),
3933
- import("./spawnChannel-ZST6XJVJ.js"),
3994
+ import("./server-AOYZVVOM.js"),
3995
+ import("./bridge-IHSBI2YJ.js"),
3996
+ import("./spawnChannel-N25MBB6F.js"),
3934
3997
  import("./process-registry-OAEG6WGC.js"),
3935
- import("./workspace-service-SIN67ITC.js"),
3998
+ import("./workspace-service-G4ZNBOFH.js"),
3936
3999
  import("./types-HKLPXZB3.js"),
3937
- import("./daemon-status-provider-K3SJ5C2U.js"),
3938
- import("./workspace-providers-status-IJ4VHFMB.js"),
3939
- import("./workspace-skills-status-F3RKCUIX.js"),
3940
- import("./total-session-admission-PVN64JVV.js"),
3941
- import("./workspace-registry-BTGZIMPK.js"),
3942
- import("./prompt-terminal-ledger-FOMFTYOM.js")
4000
+ import("./daemon-status-provider-GRRVCJFW.js"),
4001
+ import("./workspace-providers-status-PCJK3RC7.js"),
4002
+ import("./workspace-skills-status-FMTPPMWC.js"),
4003
+ import("./total-session-admission-G4CGCSTG.js"),
4004
+ import("./workspace-registry-YNIOB6HJ.js"),
4005
+ import("./workspace-runtime-coordinator-WG2RNEN7.js"),
4006
+ import("./prompt-terminal-ledger-GZ747VYE.js")
3943
4007
  ]);
3944
4008
  return {
3945
4009
  createServeApp: serverModule.createServeApp,
@@ -3959,6 +4023,7 @@ async function loadServeRuntimeModules() {
3959
4023
  createWorkspaceRegistry: workspaceRegistryModule.createWorkspaceRegistry,
3960
4024
  createWorkspaceSessionOwnerIndex: workspaceRegistryModule.createWorkspaceSessionOwnerIndex,
3961
4025
  createWorkspaceGenerationGuard: workspaceRegistryModule.createWorkspaceGenerationGuard,
4026
+ getWorkspaceRuntimeCoordinatorIfSupported: workspaceRuntimeCoordinatorModule.getWorkspaceRuntimeCoordinatorIfSupported,
3962
4027
  createPromptLedgerSink: promptLedgerModule.createPromptLedgerSink
3963
4028
  };
3964
4029
  }
@@ -3983,7 +4048,11 @@ function sessionIdleTimeoutMs(value) {
3983
4048
  return value !== void 0 ? channelIdleTimeoutMs(value) : DEFAULT_SESSION_IDLE_TIMEOUT_MS;
3984
4049
  }
3985
4050
  __name(sessionIdleTimeoutMs, "sessionIdleTimeoutMs");
3986
- function currentServeFeaturesForRunQwenServe(opts, sessionShellCommandEnabled, sessionArtifactsPersistenceAvailable, currentSessionSchedulingAvailable, env) {
4051
+ function sessionPromptSettledCloseGraceMs(value) {
4052
+ return value !== void 0 ? channelIdleTimeoutMs(value) : DEFAULT_SESSION_PROMPT_SETTLED_CLOSE_GRACE_MS;
4053
+ }
4054
+ __name(sessionPromptSettledCloseGraceMs, "sessionPromptSettledCloseGraceMs");
4055
+ function currentServeFeaturesForRunQwenServe(opts, sessionShellCommandEnabled, sessionArtifactsPersistenceAvailable, workspaceRuntimeAvailable, currentSessionSchedulingAvailable, env, nativeDirectoryPickerAvailable, localPathOpenAvailable, localTerminalOpenAvailable) {
3987
4056
  return getAdvertisedServeFeatures(void 0, {
3988
4057
  requireAuth: opts.requireAuth === true,
3989
4058
  mcpPoolActive: opts.mcpPoolActive !== false,
@@ -4004,8 +4073,21 @@ function currentServeFeaturesForRunQwenServe(opts, sessionShellCommandEnabled, s
4004
4073
  channelManagementAvailable: true,
4005
4074
  persistentWorkspaceRegistrationAvailable: true,
4006
4075
  workspaceRuntimeRemovalAvailable: true,
4007
- // Advertise the same WS feature flags as the runtime path (serve-features.ts)
4008
- // so the bootstrap `/capabilities` window doesn't briefly under-report them.
4076
+ // Advertise the same host-conditional and WS feature flags as the runtime
4077
+ // path (serve-features.ts) so the bootstrap `/capabilities` window doesn't
4078
+ // briefly under-report them.
4079
+ nativeDirectoryPickerAvailable,
4080
+ workspaceRuntimeAvailable,
4081
+ localPathOpenAvailable,
4082
+ localTerminalOpenAvailable,
4083
+ // The production wiring below always registers these, so the bootstrap
4084
+ // envelope must not under-report them either — the runtime envelope
4085
+ // serves all five once the app is up.
4086
+ dynamicWorkspaceRegistrationAvailable: true,
4087
+ scratchWorkspaceRegistrationAvailable: true,
4088
+ standaloneSessionsAvailable: true,
4089
+ workspaceTrustHotReloadAvailable: true,
4090
+ acpHttpEnabled: resolveAcpHttpEnabled(env),
4009
4091
  clientMcpOverWsEnabled: opts.clientMcpOverWs === true,
4010
4092
  cdpTunnelOverWsEnabled: opts.cdpTunnelOverWs === true,
4011
4093
  browserAutomationMcpAvailable: isBrowserAutomationMcpAvailable(opts, env)
@@ -4022,8 +4104,12 @@ function createBootstrapCapabilities(input) {
4022
4104
  input.opts,
4023
4105
  input.sessionShellCommandEnabled,
4024
4106
  input.sessionArtifactsPersistenceAvailable,
4107
+ input.workspaceRuntimeAvailable,
4025
4108
  input.currentSessionSchedulingAvailable,
4026
- input.env
4109
+ input.env,
4110
+ input.nativeDirectoryPickerAvailable,
4111
+ input.localPathOpenAvailable,
4112
+ input.localTerminalOpenAvailable
4027
4113
  ),
4028
4114
  modelServices: [],
4029
4115
  workspaceCwd: input.boundWorkspace,
@@ -4058,45 +4144,6 @@ function validateRateLimitOptions(opts) {
4058
4144
  }
4059
4145
  }
4060
4146
  __name(validateRateLimitOptions, "validateRateLimitOptions");
4061
- function installSameOriginOriginStrip(app, getPort) {
4062
- let cachedStripPort = -1;
4063
- let cachedSelfOrigins = /* @__PURE__ */ new Set();
4064
- app.use((req, _res, next) => {
4065
- const origin = req.headers.origin;
4066
- if (origin) {
4067
- const port = getPort();
4068
- if (port !== cachedStripPort) {
4069
- cachedStripPort = port;
4070
- cachedSelfOrigins = /* @__PURE__ */ new Set([
4071
- `http://127.0.0.1:${port}`,
4072
- `http://localhost:${port}`,
4073
- `http://[::1]:${port}`,
4074
- `http://host.docker.internal:${port}`,
4075
- `https://127.0.0.1:${port}`,
4076
- `https://localhost:${port}`,
4077
- `https://[::1]:${port}`,
4078
- `https://host.docker.internal:${port}`
4079
- ]);
4080
- if (port === 80 || port === 443) {
4081
- for (const host of [
4082
- "127.0.0.1",
4083
- "localhost",
4084
- "[::1]",
4085
- "host.docker.internal"
4086
- ]) {
4087
- cachedSelfOrigins.add(`http://${host}`);
4088
- cachedSelfOrigins.add(`https://${host}`);
4089
- }
4090
- }
4091
- }
4092
- if (cachedSelfOrigins.has(origin)) {
4093
- delete req.headers.origin;
4094
- }
4095
- }
4096
- next();
4097
- });
4098
- }
4099
- __name(installSameOriginOriginStrip, "installSameOriginOriginStrip");
4100
4147
  function createLazyBridgeProxy(getBridge, getStartupError = () => void 0) {
4101
4148
  return new Proxy(
4102
4149
  {},
@@ -4182,6 +4229,7 @@ function createBootstrapServeApp(input) {
4182
4229
  qwenCodeVersion,
4183
4230
  sessionShellCommandEnabled,
4184
4231
  sessionArtifactsPersistenceAvailable,
4232
+ workspaceRuntimeAvailable,
4185
4233
  currentSessionSchedulingAvailable,
4186
4234
  permissionPolicy,
4187
4235
  multiWorkspaceCapabilitiesRequireRuntime,
@@ -4191,7 +4239,10 @@ function createBootstrapServeApp(input) {
4191
4239
  onHealthServed
4192
4240
  } = input;
4193
4241
  const app = (0, import_express.default)();
4194
- installSameOriginOriginStrip(app, getPort);
4242
+ const nativeDirectoryPickerAvailable = isNativeDirectoryPickerAvailable();
4243
+ const localPathOpenAvailable = isLocalPathOpenAvailable();
4244
+ const localTerminalOpenAvailable = isLocalTerminalAvailable();
4245
+ installSelfOriginStripMiddleware(app, getPort, opts.hostname);
4195
4246
  if (opts.allowOrigins && opts.allowOrigins.length > 0) {
4196
4247
  app.use(allowOriginCors(parseAllowOriginPatterns(opts.allowOrigins)));
4197
4248
  } else {
@@ -4242,9 +4293,13 @@ function createBootstrapServeApp(input) {
4242
4293
  qwenCodeVersion,
4243
4294
  sessionShellCommandEnabled,
4244
4295
  sessionArtifactsPersistenceAvailable,
4296
+ workspaceRuntimeAvailable,
4245
4297
  currentSessionSchedulingAvailable,
4246
4298
  permissionPolicy,
4247
- env: process.env
4299
+ env: process.env,
4300
+ nativeDirectoryPickerAvailable,
4301
+ localPathOpenAvailable,
4302
+ localTerminalOpenAvailable
4248
4303
  })
4249
4304
  );
4250
4305
  });
@@ -4326,7 +4381,7 @@ function createBootstrapServeApp(input) {
4326
4381
  opts.maxPendingPromptsPerSession
4327
4382
  ),
4328
4383
  listenerMaxConnections: listenerMaxConnections(opts.maxConnections),
4329
- eventRingSize: opts.eventRingSize ?? DEFAULT_EVENT_RING_SIZE,
4384
+ eventRingSize: opts.eventRingSize ?? DEFAULT_RING_SIZE,
4330
4385
  compactedReplayMaxBytes: opts.compactedReplayMaxBytes ?? DEFAULT_COMPACTED_REPLAY_MAX_BYTES,
4331
4386
  maxJournalEvents: opts.maxJournalEvents ?? DEFAULT_MAX_JOURNAL_EVENTS,
4332
4387
  maxJournalBytes: opts.maxJournalBytes ?? DEFAULT_MAX_JOURNAL_BYTES,
@@ -4334,6 +4389,9 @@ function createBootstrapServeApp(input) {
4334
4389
  writerIdleTimeoutMs: positiveFiniteOrNull(opts.writerIdleTimeoutMs),
4335
4390
  channelIdleTimeoutMs: channelIdleTimeoutMs(opts.channelIdleTimeoutMs),
4336
4391
  sessionIdleTimeoutMs: sessionIdleTimeoutMs(opts.sessionIdleTimeoutMs),
4392
+ sessionPromptSettledCloseGraceMs: sessionPromptSettledCloseGraceMs(
4393
+ opts.sessionPromptSettledCloseGraceMs
4394
+ ),
4337
4395
  acpConnectionCap: null,
4338
4396
  acpPreAttachMaxFramesPerStream: null,
4339
4397
  acpPreAttachMaxFramesPerConnection: null,
@@ -4360,8 +4418,12 @@ function createBootstrapServeApp(input) {
4360
4418
  opts,
4361
4419
  sessionShellCommandEnabled,
4362
4420
  sessionArtifactsPersistenceAvailable,
4421
+ workspaceRuntimeAvailable,
4363
4422
  currentSessionSchedulingAvailable,
4364
- process.env
4423
+ process.env,
4424
+ nativeDirectoryPickerAvailable,
4425
+ localPathOpenAvailable,
4426
+ localTerminalOpenAvailable
4365
4427
  )
4366
4428
  },
4367
4429
  runtime: {
@@ -4661,7 +4723,7 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
4661
4723
  const runStartedAt = performance2.now();
4662
4724
  delete process.env[EXTERNAL_TOOL_GUARD_TOKEN_ENV];
4663
4725
  const channelDeliveryAuthorizations = new ChannelDeliveryAuthorizationStore();
4664
- const shouldPreheat = !deps.bridge && shouldPreheatBridge(deps);
4726
+ let shouldPreheat = !deps.bridge && shouldPreheatBridge(deps);
4665
4727
  const startup = {
4666
4728
  processStartedAt: new Date(
4667
4729
  Date.now() - Math.round(process.uptime() * 1e3)
@@ -4700,12 +4762,18 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
4700
4762
  }, "restoreScrubbedLoaderEnv");
4701
4763
  loggerLifecycle.scrubApplied(restoreScrubbedLoaderEnv);
4702
4764
  const token = resolveServeToken(optsIn.token);
4765
+ const bindHostname = optsIn.hostname.toLowerCase() === "localhost" ? (await (deps.bindHostnameLookup ?? lookup)(optsIn.hostname)).address : optsIn.hostname;
4766
+ const trustedLoopbackMode = isTrustedLoopbackMode({
4767
+ loopbackBind: isLoopbackAddress(bindHostname),
4768
+ tokenConfigured: token !== void 0,
4769
+ requireAuth: optsIn.requireAuth === true
4770
+ });
4703
4771
  const channelDeliveryDiagnosticRedaction = {
4704
4772
  workerEnv: daemonRuntimeBaseEnv,
4705
4773
  ...token ? { daemonToken: token } : {}
4706
4774
  };
4707
- const sessionShellCommandEnabled = optsIn.enableSessionShell === true && token !== void 0;
4708
- if (optsIn.enableSessionShell === true && token === void 0) {
4775
+ const sessionShellCommandEnabled = optsIn.enableSessionShell === true && (token !== void 0 || trustedLoopbackMode);
4776
+ if (optsIn.enableSessionShell === true && token === void 0 && !trustedLoopbackMode) {
4709
4777
  writeStderrLine(
4710
4778
  `qwen serve: --enable-session-shell ignored because no bearer token is configured. Set ${QWEN_SERVER_TOKEN_ENV} or pass --token to enable direct session shell.`
4711
4779
  );
@@ -4727,6 +4795,7 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
4727
4795
  const rawWorkspace = rawWorkspaces[0];
4728
4796
  const opts = {
4729
4797
  ...optsIn,
4798
+ hostname: bindHostname,
4730
4799
  token,
4731
4800
  promptDeadlineMs,
4732
4801
  writerIdleTimeoutMs,
@@ -4858,7 +4927,7 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
4858
4927
  }
4859
4928
  if (!isLoopbackBind(opts.hostname) && !token) {
4860
4929
  throw new Error(
4861
- `Refusing to bind ${opts.hostname}:${opts.port} without a bearer token. Set ${QWEN_SERVER_TOKEN_ENV} or pass --token, or rebind to loopback (127.0.0.1, localhost, ::1, or [::1]).`
4930
+ `Refusing to bind ${opts.hostname}:${opts.port} without a bearer token. Set ${QWEN_SERVER_TOKEN_ENV} or pass --token, or rebind to loopback (127.0.0.0/8, localhost, ::1, or [::1]).`
4862
4931
  );
4863
4932
  }
4864
4933
  if (opts.requireAuth && !token) {
@@ -4873,8 +4942,16 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
4873
4942
  `Refusing to start with --allow-origin '*' but no bearer token configured. '*' admits any cross-origin browser to the API; without a token, any local page can drive the daemon. Set ${QWEN_SERVER_TOKEN_ENV} or pass --token, or list specific origins instead of '*'.`
4874
4943
  );
4875
4944
  }
4945
+ const nonLoopbackHttpOrigin = findNonLoopbackHttpOrigin(parsed);
4946
+ if (nonLoopbackHttpOrigin && !token) {
4947
+ throw new Error(
4948
+ `Refusing to start with --allow-origin ${JSON.stringify(
4949
+ nonLoopbackHttpOrigin
4950
+ )} but no bearer token configured. Non-loopback HTTP(S) browser origins can drive the full operator API, including code execution as the daemon user. Set ${QWEN_SERVER_TOKEN_ENV} or pass --token, or use a loopback origin.`
4951
+ );
4952
+ }
4876
4953
  writeStderrLine(
4877
- `qwen serve: --allow-origin: ${opts.allowOrigins.join(", ")}` + (parsed.allowAny ? " (WARNING: `*` admits any cross-origin browser \u2014 bearer token gates API routes; the Web Shell static assets stay pre-auth in every mode unless --no-web, and /health stays pre-auth on loopback unless --require-auth is set)" : "")
4954
+ `qwen serve: --allow-origin: ${opts.allowOrigins.join(", ")}` + (parsed.allowAny ? " (WARNING: `*` admits any cross-origin browser \u2014 bearer token gates API routes; the Web Shell static assets stay pre-auth in every mode unless --no-web, and /health stays pre-auth on loopback unless --require-auth is set)" : trustedLoopbackMode ? " (WARNING: these browser origins receive full API authority without a bearer token in trusted loopback mode and can execute code as the daemon user)" : "")
4878
4955
  );
4879
4956
  }
4880
4957
  if (opts.allowPrivateAuthBaseUrl) {
@@ -4984,7 +5061,7 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
4984
5061
  }
4985
5062
  let workspaceRegistrationStore = deps.workspaceRegistrationStore;
4986
5063
  if (workspaceRegistrationStore === void 0 && process.env["QWEN_SERVE_NO_PERSISTENT_REGISTRATION"] !== "1") {
4987
- const { WorkspaceRegistrationStore } = await import("./workspace-registration-store-SMJWI2AI.js");
5064
+ const { WorkspaceRegistrationStore } = await import("./workspace-registration-store-KQWVVW4Y.js");
4988
5065
  workspaceRegistrationStore = new WorkspaceRegistrationStore(boundWorkspace);
4989
5066
  }
4990
5067
  if (workspaceRegistrationStore) {
@@ -5218,6 +5295,13 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
5218
5295
  );
5219
5296
  }
5220
5297
  }
5298
+ if (opts.sessionPromptSettledCloseGraceMs !== void 0) {
5299
+ if (!isNonNegativeIntegerMs(opts.sessionPromptSettledCloseGraceMs)) {
5300
+ throw new TypeError(
5301
+ `Invalid sessionPromptSettledCloseGraceMs: ${opts.sessionPromptSettledCloseGraceMs}. Must be a non-negative integer (milliseconds, 0 = disabled).`
5302
+ );
5303
+ }
5304
+ }
5221
5305
  if (opts.initializeTimeoutMs !== void 0) {
5222
5306
  if (!isPositiveIntegerMs(opts.initializeTimeoutMs)) {
5223
5307
  throw new TypeError(
@@ -5268,7 +5352,7 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
5268
5352
  "qwen serve: required external tool guard handshake succeeded."
5269
5353
  );
5270
5354
  }
5271
- const { createDaemonToolGuard } = await import("./daemon-git-worktree-guard-IVAJJWYK.js");
5355
+ const { createDaemonToolGuard } = await import("./daemon-git-worktree-guard-O2HPOBAB.js");
5272
5356
  const daemonToolGuardHandler = createDaemonToolGuard(
5273
5357
  externalToolGuardHandler
5274
5358
  );
@@ -5331,6 +5415,7 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
5331
5415
  }, "markServeAppStartupFailed");
5332
5416
  let runtimeApp;
5333
5417
  let runtimeAppForCleanup;
5418
+ let getWorkspaceRuntimeCoordinatorIfSupported;
5334
5419
  let bridgeRef = deps.bridge;
5335
5420
  let managedProcessRegistry;
5336
5421
  let managedChildHeapPolicy;
@@ -5614,8 +5699,9 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
5614
5699
  loadCoreRuntime(),
5615
5700
  loadSettingsRuntimeModules(),
5616
5701
  cliVersionPromise,
5617
- import("./daemon-trust-policy-DOR3YG62.js")
5702
+ import("./daemon-trust-policy-YJL442BK.js")
5618
5703
  ]);
5704
+ getWorkspaceRuntimeCoordinatorIfSupported = runtime.getWorkspaceRuntimeCoordinatorIfSupported;
5619
5705
  cliVersion = resolvedCliVersion;
5620
5706
  settingsRuntime.environment.preResolveHomeEnvOverrides();
5621
5707
  const bootTrustSnapshot = await trustPolicy.readDaemonTrustPolicySnapshot();
@@ -5625,6 +5711,10 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
5625
5711
  boundWorkspace
5626
5712
  );
5627
5713
  const trustedWorkspace = deps.trustedWorkspace ?? bootPrimaryTrustDecision.targetTrusted;
5714
+ if (shouldPreheat && !trustedWorkspace) {
5715
+ shouldPreheat = false;
5716
+ startup.preheat.status = "not_scheduled";
5717
+ }
5628
5718
  const workspaceTrustHotReloadAvailable = deps.trustedWorkspace === void 0 && deps.bridge === void 0 && deps.fsFactory === void 0;
5629
5719
  let managedScratchRoot;
5630
5720
  try {
@@ -5707,10 +5797,6 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
5707
5797
  runtimeBootSettings,
5708
5798
  runtimeEnvSnapshot.effectiveEnv
5709
5799
  );
5710
- const sessionAttachmentsRoot = /* @__PURE__ */ __name((workspace, runtimeBaseDir) => path.join(
5711
- new core.Storage(workspace, runtimeBaseDir).getProjectTempDir(),
5712
- "attachments"
5713
- ), "sessionAttachmentsRoot");
5714
5800
  const runtimeEffectiveEnv = {
5715
5801
  ...runtimeEnvSnapshot.effectiveEnv,
5716
5802
  QWEN_RUNTIME_DIR: primarySessionRuntimeBaseDir
@@ -5726,6 +5812,7 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
5726
5812
  mode: "runtime-overlay",
5727
5813
  overlayKeys: [...runtimeEnvSnapshot.overlayKeys],
5728
5814
  effectiveEnv: runtimeEffectiveEnv,
5815
+ workflowsEnabledBySettings: runtimeBootSettings?.merged.tools?.workflowsEnabled === true,
5729
5816
  envFilePaths: [...runtimeEnvSnapshot.envFilePaths],
5730
5817
  envFileReadFailed: runtimeEnvSnapshot.envFileReadFailed,
5731
5818
  envFileReadFailures: [...runtimeEnvSnapshot.envFileReadFailures]
@@ -5792,6 +5879,15 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
5792
5879
  daemonLog,
5793
5880
  emitTelemetryLog: core.emitDaemonLog
5794
5881
  });
5882
+ const warnAcpQueueSaturated = /* @__PURE__ */ __name((info) => {
5883
+ daemonLog.warn("ACP NDJSON decoded queue saturated", {
5884
+ requiredBytes: info.requiredBytes,
5885
+ availableBytes: info.availableBytes,
5886
+ maxQueuedMessages: info.maxQueuedMessages,
5887
+ maxQueuedBytes: info.maxQueuedBytes,
5888
+ queueSaturationGraceMs: info.graceMs
5889
+ });
5890
+ }, "warnAcpQueueSaturated");
5795
5891
  const recordPromptQueueWait = /* @__PURE__ */ __name((durationMs) => {
5796
5892
  promptQueueWaitStats.count += 1;
5797
5893
  promptQueueWaitStats.totalMs += durationMs;
@@ -5934,7 +6030,8 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
5934
6030
  direction: daemonPipeDirection(direction),
5935
6031
  bytes,
5936
6032
  message
5937
- }), "onMessageObserved")
6033
+ }), "onMessageObserved"),
6034
+ onQueueSaturated: warnAcpQueueSaturated
5938
6035
  },
5939
6036
  ...acpChildExtraArgs(opts) ? { extraArgs: acpChildExtraArgs(opts) } : {}
5940
6037
  });
@@ -5950,6 +6047,30 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
5950
6047
  });
5951
6048
  const clientMcpSenderRegistry = new ClientMcpSenderRegistry();
5952
6049
  const runtimeBridges = [];
6050
+ const runtimeEpochSources = /* @__PURE__ */ new Map();
6051
+ const runtimeEpochSourceFor = /* @__PURE__ */ __name((workspaceCwd) => {
6052
+ let source = runtimeEpochSources.get(workspaceCwd);
6053
+ if (!source) {
6054
+ let epoch = 0;
6055
+ source = {
6056
+ current: /* @__PURE__ */ __name(() => epoch, "current"),
6057
+ allocate: /* @__PURE__ */ __name(() => ++epoch, "allocate")
6058
+ };
6059
+ runtimeEpochSources.set(workspaceCwd, source);
6060
+ }
6061
+ return source;
6062
+ }, "runtimeEpochSourceFor");
6063
+ let mcpAuthenticationActive = false;
6064
+ const acquireMcpAuthentication = /* @__PURE__ */ __name(() => {
6065
+ if (mcpAuthenticationActive) return void 0;
6066
+ mcpAuthenticationActive = true;
6067
+ let released = false;
6068
+ return () => {
6069
+ if (released) return;
6070
+ released = true;
6071
+ mcpAuthenticationActive = false;
6072
+ };
6073
+ }, "acquireMcpAuthentication");
5953
6074
  const totalSessionAdmission = runtime.createTotalSessionAdmissionController(
5954
6075
  {
5955
6076
  maxTotalSessions: opts.maxTotalSessions,
@@ -5986,14 +6107,8 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
5986
6107
  }), "persistDisabledToolsFn");
5987
6108
  const persistDisabledSkillsFn = /* @__PURE__ */ __name((workspace, skillName, enabled, assertGenerationOpen) => withSettingsLock(workspace, async () => {
5988
6109
  assertGenerationOpen?.();
5989
- const {
5990
- resolveSkillSettings,
5991
- skillSettingStrings,
5992
- updateWorkspaceSkillSettingLists
5993
- } = await import("./skill-settings-ZL4JY5UE.js");
6110
+ const { skillSettingStrings, updateWorkspaceSkillSettingLists } = await import("./skill-settings-AKSP665O.js");
5994
6111
  const fresh = loadSettingsForPersistence(workspace);
5995
- const normalizedName = skillName.trim().toLowerCase();
5996
- const resolved = resolveSkillSettings(fresh);
5997
6112
  const workspaceDisabled = skillSettingStrings(
5998
6113
  fresh,
5999
6114
  WORKSPACE_SETTING_SCOPE,
@@ -6007,8 +6122,7 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
6007
6122
  const next = updateWorkspaceSkillSettingLists(
6008
6123
  { disabled: workspaceDisabled, enabled: workspaceEnabled },
6009
6124
  skillName,
6010
- enabled,
6011
- resolved.defaultDisabledNames.has(normalizedName) && !resolved.enabledNames.has(normalizedName)
6125
+ enabled
6012
6126
  );
6013
6127
  const settingsChanges = [];
6014
6128
  if (JSON.stringify(next.disabled) !== JSON.stringify(workspaceDisabled)) {
@@ -6043,13 +6157,8 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
6043
6157
  }), "persistDisabledSkillsFn");
6044
6158
  const persistDisabledSkillsBatchFn = /* @__PURE__ */ __name((workspace, skillNames, enabled, assertGenerationOpen) => withSettingsLock(workspace, async () => {
6045
6159
  assertGenerationOpen?.();
6046
- const {
6047
- resolveSkillSettings,
6048
- skillSettingStrings,
6049
- updateWorkspaceSkillSettingLists
6050
- } = await import("./skill-settings-ZL4JY5UE.js");
6160
+ const { skillSettingStrings, updateWorkspaceSkillSettingLists } = await import("./skill-settings-AKSP665O.js");
6051
6161
  const fresh = loadSettingsForPersistence(workspace);
6052
- const resolved = resolveSkillSettings(fresh);
6053
6162
  const initialDisabled = skillSettingStrings(
6054
6163
  fresh,
6055
6164
  WORKSPACE_SETTING_SCOPE,
@@ -6063,12 +6172,10 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
6063
6172
  let next = { disabled: initialDisabled, enabled: initialEnabled };
6064
6173
  const outcomes = [];
6065
6174
  for (const skillName of skillNames) {
6066
- const normalizedName = skillName.trim().toLowerCase();
6067
6175
  const updated = updateWorkspaceSkillSettingLists(
6068
6176
  next,
6069
6177
  skillName,
6070
- enabled,
6071
- resolved.defaultDisabledNames.has(normalizedName) && !resolved.enabledNames.has(normalizedName)
6178
+ enabled
6072
6179
  );
6073
6180
  const changed = JSON.stringify(updated.disabled) !== JSON.stringify(next.disabled) || JSON.stringify(updated.enabled) !== JSON.stringify(next.enabled);
6074
6181
  next = updated;
@@ -6141,9 +6248,10 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
6141
6248
  }
6142
6249
  }), "persistSettingsFn");
6143
6250
  const [{ createSubSessionLauncher }, scheduledTaskRoutes] = await Promise.all([
6144
- import("./create-sub-session-4QNE64MR.js"),
6145
- import("./scheduled-tasks-MN2ZZ5P6.js")
6251
+ import("./create-sub-session-NJ24B4US.js"),
6252
+ import("./scheduled-tasks-FLDYZQOF.js")
6146
6253
  ]);
6254
+ const { sessionAttachmentsRoots } = await import("./session-attachments-root-ZCGXQQTR.js");
6147
6255
  const createCurrentSessionScheduledTaskHandler = /* @__PURE__ */ __name((workspaceCwd, runtimeBaseDir, getBridge, assertGenerationOpen) => async ({
6148
6256
  callerSessionId,
6149
6257
  cron,
@@ -6184,11 +6292,13 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
6184
6292
  runtimeBootSettings?.merged.serve ?? {}
6185
6293
  )
6186
6294
  });
6295
+ const attachmentsRoots = sessionAttachmentsRoots(
6296
+ boundWorkspace,
6297
+ primarySessionRuntimeBaseDir
6298
+ );
6187
6299
  const bridge = deps.bridge ?? runtime.createAcpSessionBridge({
6188
- sessionAttachmentsRoot: sessionAttachmentsRoot(
6189
- boundWorkspace,
6190
- primarySessionRuntimeBaseDir
6191
- ),
6300
+ sessionAttachmentsRoot: attachmentsRoots.root,
6301
+ sessionAttachmentsFallbackRoot: attachmentsRoots.fallback,
6192
6302
  // Reverse tool channel: let `BridgeClient.extMethod` reach the WS
6193
6303
  // connection that hosts a named client MCP server (#5626).
6194
6304
  clientMcpSender: clientMcpSenderRegistry.lookup,
@@ -6230,8 +6340,13 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
6230
6340
  sessionRestoreTimeoutMs,
6231
6341
  ...opts.sessionReapIntervalMs !== void 0 ? { sessionReapIntervalMs: opts.sessionReapIntervalMs } : {},
6232
6342
  ...opts.sessionIdleTimeoutMs !== void 0 ? { sessionIdleTimeoutMs: opts.sessionIdleTimeoutMs } : {},
6343
+ ...opts.sessionPromptSettledCloseGraceMs !== void 0 ? {
6344
+ sessionPromptSettledCloseGraceMs: opts.sessionPromptSettledCloseGraceMs
6345
+ } : {},
6233
6346
  ...opts.permissionResponseTimeoutMs !== void 0 ? { permissionResponseTimeoutMs: opts.permissionResponseTimeoutMs } : {},
6234
6347
  boundWorkspace,
6348
+ runtimeEpochSource: runtimeEpochSourceFor(boundWorkspace),
6349
+ acquireMcpAuthentication,
6235
6350
  // Prompt terminal ledger: persisted beside the transcript so a
6236
6351
  // restarted daemon can reconcile dangling prompts on cold load.
6237
6352
  promptLedger: runtime.createPromptLedgerSink(
@@ -6279,6 +6394,82 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
6279
6394
  runtimeBridges.push(bridge);
6280
6395
  let invalidatePrimaryServeFeaturesCache = /* @__PURE__ */ __name(() => {
6281
6396
  }, "invalidatePrimaryServeFeaturesCache");
6397
+ const reloadPrimaryDaemonEnv = /* @__PURE__ */ __name((workspace, assertGenerationOpen) => withSettingsLock(workspace, async () => {
6398
+ assertGenerationOpen?.();
6399
+ const fresh = settingsRuntime.settings.loadSettings(workspace, {
6400
+ skipLoadEnvironment: true,
6401
+ skipWorkspaceSettings: !trustedWorkspace,
6402
+ workspaceTrusted: trustedWorkspace
6403
+ });
6404
+ assertGenerationOpen?.();
6405
+ let refreshedRuntimeEnv;
6406
+ try {
6407
+ refreshedRuntimeEnv = settingsRuntime.environment.buildRuntimeEnvironment(
6408
+ fresh.merged,
6409
+ workspace,
6410
+ daemonRuntimeBaseEnv,
6411
+ trustedWorkspace
6412
+ );
6413
+ } catch (err) {
6414
+ const fallbackReason = err instanceof Error ? err.message : String(err);
6415
+ primaryRuntimeEnv.fallbackReason = fallbackReason;
6416
+ daemonLog.warn(
6417
+ "failed to rebuild runtime env snapshot before daemon env reload; preserving previous runtime env",
6418
+ {
6419
+ error: fallbackReason
6420
+ }
6421
+ );
6422
+ return {
6423
+ updatedKeys: [],
6424
+ removedKeys: [],
6425
+ runtimeEnvironmentApplied: false
6426
+ };
6427
+ }
6428
+ logRuntimeEnvFileReadFailures(workspace, refreshedRuntimeEnv);
6429
+ if (refreshedRuntimeEnv.envFileReadFailed) {
6430
+ return {
6431
+ updatedKeys: [],
6432
+ removedKeys: [],
6433
+ runtimeEnvironmentApplied: false
6434
+ };
6435
+ }
6436
+ const result = settingsRuntime.settings.reloadEnvironment(
6437
+ fresh.merged,
6438
+ workspace,
6439
+ trustedWorkspace,
6440
+ { failClosedOnEnvFileReadError: true }
6441
+ );
6442
+ if (result.envFileReadFailed) {
6443
+ return {
6444
+ updatedKeys: [],
6445
+ removedKeys: [],
6446
+ runtimeEnvironmentApplied: false
6447
+ };
6448
+ }
6449
+ replaceRuntimeEffectiveEnv(refreshedRuntimeEnv.effectiveEnv);
6450
+ primaryRuntimeEnv.workflowsEnabledBySettings = fresh.merged.tools?.workflowsEnabled === true;
6451
+ delete primaryRuntimeEnv.fallbackReason;
6452
+ primaryRuntimeEnv.envFileReadFailed = refreshedRuntimeEnv.envFileReadFailed;
6453
+ primaryRuntimeEnv.envFileReadFailures.splice(
6454
+ 0,
6455
+ primaryRuntimeEnv.envFileReadFailures.length,
6456
+ ...refreshedRuntimeEnv.envFileReadFailures
6457
+ );
6458
+ primaryRuntimeEnv.overlayKeys.splice(
6459
+ 0,
6460
+ primaryRuntimeEnv.overlayKeys.length,
6461
+ ...refreshedRuntimeEnv.overlayKeys
6462
+ );
6463
+ primaryRuntimeEnv.envFilePaths.splice(
6464
+ 0,
6465
+ primaryRuntimeEnv.envFilePaths.length,
6466
+ ...refreshedRuntimeEnv.envFilePaths
6467
+ );
6468
+ return {
6469
+ ...result,
6470
+ runtimeEnvironmentApplied: true
6471
+ };
6472
+ }), "reloadPrimaryDaemonEnv");
6282
6473
  const workspaceService = runtime.createDaemonWorkspaceService({
6283
6474
  boundWorkspace,
6284
6475
  isWorkspaceTrusted: /* @__PURE__ */ __name(() => trustedWorkspace, "isWorkspaceTrusted"),
@@ -6296,71 +6487,7 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
6296
6487
  persistSetting: persistSettingFn,
6297
6488
  persistSettings: persistSettingsFn,
6298
6489
  preheatAcpChild: /* @__PURE__ */ __name(() => bridge.preheat(), "preheatAcpChild"),
6299
- reloadDaemonEnv: /* @__PURE__ */ __name((workspace, assertGenerationOpen) => withSettingsLock(workspace, async () => {
6300
- assertGenerationOpen?.();
6301
- const fresh = settingsRuntime.settings.loadSettings(workspace, {
6302
- skipLoadEnvironment: true,
6303
- skipWorkspaceSettings: !trustedWorkspace,
6304
- workspaceTrusted: trustedWorkspace
6305
- });
6306
- assertGenerationOpen?.();
6307
- const result = settingsRuntime.settings.reloadEnvironment(
6308
- fresh.merged,
6309
- workspace,
6310
- trustedWorkspace
6311
- );
6312
- let refreshedRuntimeEnv;
6313
- let fallbackReason;
6314
- try {
6315
- refreshedRuntimeEnv = settingsRuntime.environment.buildRuntimeEnvironment(
6316
- fresh.merged,
6317
- workspace,
6318
- daemonRuntimeBaseEnv,
6319
- trustedWorkspace
6320
- );
6321
- } catch (err) {
6322
- fallbackReason = err instanceof Error ? err.message : String(err);
6323
- daemonLog.warn(
6324
- "failed to rebuild runtime env snapshot after daemon env reload; preserving previous runtime env",
6325
- {
6326
- error: fallbackReason
6327
- }
6328
- );
6329
- refreshedRuntimeEnv = {
6330
- effectiveEnv: { ...runtimeEffectiveEnv },
6331
- overlayKeys: [...primaryRuntimeEnv.overlayKeys],
6332
- envFilePaths: [...primaryRuntimeEnv.envFilePaths],
6333
- envFileReadFailed: primaryRuntimeEnv.envFileReadFailed ?? false,
6334
- envFileReadFailures: [
6335
- ...primaryRuntimeEnv.envFileReadFailures ?? []
6336
- ]
6337
- };
6338
- }
6339
- logRuntimeEnvFileReadFailures(workspace, refreshedRuntimeEnv);
6340
- replaceRuntimeEffectiveEnv(refreshedRuntimeEnv.effectiveEnv);
6341
- if (fallbackReason) {
6342
- primaryRuntimeEnv.fallbackReason = fallbackReason;
6343
- } else {
6344
- delete primaryRuntimeEnv.fallbackReason;
6345
- }
6346
- primaryRuntimeEnv.envFileReadFailed = refreshedRuntimeEnv.envFileReadFailed;
6347
- primaryRuntimeEnv.envFileReadFailures.splice(
6348
- 0,
6349
- primaryRuntimeEnv.envFileReadFailures.length,
6350
- ...refreshedRuntimeEnv.envFileReadFailures
6351
- );
6352
- primaryRuntimeEnv.overlayKeys.splice(
6353
- 0,
6354
- primaryRuntimeEnv.overlayKeys.length,
6355
- ...refreshedRuntimeEnv.overlayKeys
6356
- );
6357
- primaryRuntimeEnv.envFilePaths.splice(
6358
- 0,
6359
- primaryRuntimeEnv.envFilePaths.length,
6360
- ...refreshedRuntimeEnv.envFilePaths
6361
- );
6362
- return result;
6363
- }), "reloadDaemonEnv"),
6490
+ reloadDaemonEnv: reloadPrimaryDaemonEnv,
6364
6491
  queryWorkspaceStatus: /* @__PURE__ */ __name((method, idle) => bridge.queryWorkspaceStatus(method, idle), "queryWorkspaceStatus"),
6365
6492
  invokeWorkspaceCommand: /* @__PURE__ */ __name((method, params, invokeOpts) => bridge.invokeWorkspaceCommand(method, params, invokeOpts), "invokeWorkspaceCommand"),
6366
6493
  refreshExtensionsForAllSessions: /* @__PURE__ */ __name(() => bridge.refreshExtensionsForAllSessions(), "refreshExtensionsForAllSessions"),
@@ -6417,6 +6544,7 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
6417
6544
  mode: "runtime-overlay",
6418
6545
  overlayKeys: [...snapshot.overlayKeys],
6419
6546
  effectiveEnv,
6547
+ workflowsEnabledBySettings: settings?.merged.tools?.workflowsEnabled === true,
6420
6548
  envFilePaths: [...snapshot.envFilePaths],
6421
6549
  envFileReadFailed: snapshot.envFileReadFailed,
6422
6550
  envFileReadFailures: [...snapshot.envFileReadFailures]
@@ -6434,6 +6562,80 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
6434
6562
  }
6435
6563
  };
6436
6564
  }, "createRuntimeEnvMetadata");
6565
+ const reloadRuntimeOverlaySnapshotForModelProviders = /* @__PURE__ */ __name((workspace, trusted, env, assertGenerationOpen) => withSettingsLock(workspace, async () => {
6566
+ assertGenerationOpen?.();
6567
+ const fresh = settingsRuntime.settings.loadSettings(workspace, {
6568
+ skipLoadEnvironment: true,
6569
+ skipWorkspaceSettings: !trusted,
6570
+ workspaceTrusted: trusted
6571
+ });
6572
+ assertGenerationOpen?.();
6573
+ let refreshedRuntimeEnv;
6574
+ try {
6575
+ refreshedRuntimeEnv = settingsRuntime.environment.buildRuntimeEnvironment(
6576
+ fresh.merged,
6577
+ workspace,
6578
+ daemonRuntimeBaseEnv,
6579
+ trusted
6580
+ );
6581
+ } catch (err) {
6582
+ env.metadata.fallbackReason = err instanceof Error ? err.message : String(err);
6583
+ daemonLog.warn(
6584
+ "failed to rebuild runtime overlay for model-provider reload; preserving previous runtime env",
6585
+ { workspace, error: env.metadata.fallbackReason }
6586
+ );
6587
+ return {
6588
+ updatedKeys: [],
6589
+ removedKeys: [],
6590
+ runtimeEnvironmentApplied: false
6591
+ };
6592
+ }
6593
+ logRuntimeEnvFileReadFailures(workspace, refreshedRuntimeEnv);
6594
+ if (refreshedRuntimeEnv.envFileReadFailed) {
6595
+ return {
6596
+ updatedKeys: [],
6597
+ removedKeys: [],
6598
+ runtimeEnvironmentApplied: false
6599
+ };
6600
+ }
6601
+ assertGenerationOpen?.();
6602
+ try {
6603
+ env.replace(refreshedRuntimeEnv.effectiveEnv);
6604
+ env.metadata.envFileReadFailed = refreshedRuntimeEnv.envFileReadFailed;
6605
+ env.metadata.envFileReadFailures.splice(
6606
+ 0,
6607
+ env.metadata.envFileReadFailures.length,
6608
+ ...refreshedRuntimeEnv.envFileReadFailures
6609
+ );
6610
+ env.metadata.overlayKeys.splice(
6611
+ 0,
6612
+ env.metadata.overlayKeys.length,
6613
+ ...refreshedRuntimeEnv.overlayKeys
6614
+ );
6615
+ env.metadata.envFilePaths.splice(
6616
+ 0,
6617
+ env.metadata.envFilePaths.length,
6618
+ ...refreshedRuntimeEnv.envFilePaths
6619
+ );
6620
+ delete env.metadata.fallbackReason;
6621
+ return {
6622
+ updatedKeys: [],
6623
+ removedKeys: [],
6624
+ runtimeEnvironmentApplied: true
6625
+ };
6626
+ } catch (err) {
6627
+ env.metadata.fallbackReason = err instanceof Error ? err.message : String(err);
6628
+ daemonLog.warn(
6629
+ "failed to apply runtime overlay for model-provider reload; preserving previous runtime env",
6630
+ { workspace, error: env.metadata.fallbackReason }
6631
+ );
6632
+ return {
6633
+ updatedKeys: [],
6634
+ removedKeys: [],
6635
+ runtimeEnvironmentApplied: false
6636
+ };
6637
+ }
6638
+ }), "reloadRuntimeOverlaySnapshotForModelProviders");
6437
6639
  const readLiveConversationScheduledTasks = /* @__PURE__ */ __name(async () => {
6438
6640
  if (!fs.existsSync(liveConversationWorkspace.rootPath)) return [];
6439
6641
  const { canonicalRoot } = await liveConversationWorkspace.revalidate();
@@ -6524,7 +6726,8 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
6524
6726
  direction: daemonPipeDirection(direction),
6525
6727
  bytes,
6526
6728
  message
6527
- }), "onMessageObserved")
6729
+ }), "onMessageObserved"),
6730
+ onQueueSaturated: warnAcpQueueSaturated
6528
6731
  },
6529
6732
  ...acpChildExtraArgs(opts) ? { extraArgs: acpChildExtraArgs(opts) } : {}
6530
6733
  });
@@ -6537,11 +6740,13 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
6537
6740
  secondarySettings?.merged.serve ?? {}
6538
6741
  )
6539
6742
  });
6743
+ const secondaryAttachmentsRoots = sessionAttachmentsRoots(
6744
+ workspaceInput.cwd,
6745
+ secondaryEnv.sessionRuntimeBaseDir
6746
+ );
6540
6747
  const secondaryBridge = runtime.createAcpSessionBridge({
6541
- sessionAttachmentsRoot: sessionAttachmentsRoot(
6542
- workspaceInput.cwd,
6543
- secondaryEnv.sessionRuntimeBaseDir
6544
- ),
6748
+ sessionAttachmentsRoot: secondaryAttachmentsRoots.root,
6749
+ sessionAttachmentsFallbackRoot: secondaryAttachmentsRoots.fallback,
6545
6750
  clientMcpSender: secondaryClientMcpSenderRegistry.lookup,
6546
6751
  onCreateSubSession: secondarySubSessionLauncher.launch,
6547
6752
  onCreateCurrentSessionScheduledTask: createCurrentSessionScheduledTaskHandler(
@@ -6581,8 +6786,13 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
6581
6786
  sessionRestoreTimeoutMs,
6582
6787
  ...opts.sessionReapIntervalMs !== void 0 ? { sessionReapIntervalMs: opts.sessionReapIntervalMs } : {},
6583
6788
  ...opts.sessionIdleTimeoutMs !== void 0 ? { sessionIdleTimeoutMs: opts.sessionIdleTimeoutMs } : {},
6789
+ ...opts.sessionPromptSettledCloseGraceMs !== void 0 ? {
6790
+ sessionPromptSettledCloseGraceMs: opts.sessionPromptSettledCloseGraceMs
6791
+ } : {},
6584
6792
  ...opts.permissionResponseTimeoutMs !== void 0 ? { permissionResponseTimeoutMs: opts.permissionResponseTimeoutMs } : {},
6585
6793
  boundWorkspace: workspaceInput.cwd,
6794
+ runtimeEpochSource: runtimeEpochSourceFor(workspaceInput.cwd),
6795
+ acquireMcpAuthentication,
6586
6796
  promptLedger: runtime.createPromptLedgerSink(
6587
6797
  workspaceInput.cwd,
6588
6798
  secondaryEnv.sessionRuntimeBaseDir
@@ -6658,20 +6868,54 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
6658
6868
  workspaceTrusted: secondaryTrusted
6659
6869
  });
6660
6870
  assertGenerationOpen?.();
6661
- const result = settingsRuntime.settings.reloadEnvironment(
6662
- fresh.merged,
6663
- workspace,
6664
- secondaryTrusted
6665
- );
6871
+ let runtimeEnvironmentApplied = false;
6872
+ let refreshedRuntimeEnv;
6666
6873
  try {
6667
- const refreshedRuntimeEnv = settingsRuntime.environment.buildRuntimeEnvironment(
6874
+ refreshedRuntimeEnv = settingsRuntime.environment.buildRuntimeEnvironment(
6668
6875
  fresh.merged,
6669
6876
  workspace,
6670
6877
  daemonRuntimeBaseEnv,
6671
6878
  secondaryTrusted
6672
6879
  );
6673
- logRuntimeEnvFileReadFailures(workspace, refreshedRuntimeEnv);
6880
+ } catch (err) {
6881
+ secondaryEnv.metadata.fallbackReason = err instanceof Error ? err.message : String(err);
6882
+ daemonLog.warn(
6883
+ "failed to rebuild secondary runtime env snapshot before daemon env reload; preserving previous runtime env",
6884
+ {
6885
+ workspace,
6886
+ error: secondaryEnv.metadata.fallbackReason
6887
+ }
6888
+ );
6889
+ return {
6890
+ updatedKeys: [],
6891
+ removedKeys: [],
6892
+ runtimeEnvironmentApplied
6893
+ };
6894
+ }
6895
+ logRuntimeEnvFileReadFailures(workspace, refreshedRuntimeEnv);
6896
+ if (refreshedRuntimeEnv.envFileReadFailed) {
6897
+ return {
6898
+ updatedKeys: [],
6899
+ removedKeys: [],
6900
+ runtimeEnvironmentApplied: false
6901
+ };
6902
+ }
6903
+ const result = settingsRuntime.settings.reloadEnvironment(
6904
+ fresh.merged,
6905
+ workspace,
6906
+ secondaryTrusted,
6907
+ { failClosedOnEnvFileReadError: true }
6908
+ );
6909
+ if (result.envFileReadFailed) {
6910
+ return {
6911
+ updatedKeys: [],
6912
+ removedKeys: [],
6913
+ runtimeEnvironmentApplied: false
6914
+ };
6915
+ }
6916
+ try {
6674
6917
  secondaryEnv.replace(refreshedRuntimeEnv.effectiveEnv);
6918
+ secondaryEnv.metadata.workflowsEnabledBySettings = fresh.merged.tools?.workflowsEnabled === true;
6675
6919
  secondaryEnv.metadata.envFileReadFailed = refreshedRuntimeEnv.envFileReadFailed;
6676
6920
  secondaryEnv.metadata.envFileReadFailures.splice(
6677
6921
  0,
@@ -6689,18 +6933,26 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
6689
6933
  ...refreshedRuntimeEnv.envFilePaths
6690
6934
  );
6691
6935
  delete secondaryEnv.metadata.fallbackReason;
6936
+ runtimeEnvironmentApplied = true;
6937
+ return { ...result, runtimeEnvironmentApplied };
6692
6938
  } catch (err) {
6693
6939
  secondaryEnv.metadata.fallbackReason = err instanceof Error ? err.message : String(err);
6694
6940
  daemonLog.warn(
6695
- "failed to rebuild secondary runtime env snapshot after daemon env reload; preserving previous runtime env",
6941
+ "failed to apply secondary runtime env snapshot after daemon env reload; preserving previous runtime env",
6696
6942
  {
6697
6943
  workspace,
6698
6944
  error: secondaryEnv.metadata.fallbackReason
6699
6945
  }
6700
6946
  );
6947
+ return { ...result, runtimeEnvironmentApplied };
6701
6948
  }
6702
- return result;
6703
6949
  }), "reloadDaemonEnv"),
6950
+ reloadModelProvidersDaemonEnv: /* @__PURE__ */ __name((workspace, assertGenerationOpen) => reloadRuntimeOverlaySnapshotForModelProviders(
6951
+ workspace,
6952
+ secondaryTrusted,
6953
+ secondaryEnv,
6954
+ assertGenerationOpen
6955
+ ), "reloadModelProvidersDaemonEnv"),
6704
6956
  queryWorkspaceStatus: /* @__PURE__ */ __name((method, idle) => secondaryBridge.queryWorkspaceStatus(method, idle), "queryWorkspaceStatus"),
6705
6957
  invokeWorkspaceCommand: /* @__PURE__ */ __name((method, params, invokeOpts) => secondaryBridge.invokeWorkspaceCommand(method, params, invokeOpts), "invokeWorkspaceCommand"),
6706
6958
  refreshExtensionsForAllSessions: /* @__PURE__ */ __name(() => secondaryBridge.refreshExtensionsForAllSessions(), "refreshExtensionsForAllSessions"),
@@ -6840,7 +7092,7 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
6840
7092
  };
6841
7093
  sessionPrRefreshTimer?.dispose();
6842
7094
  const refreshGeneration = ++sessionPrRefreshGeneration;
6843
- void import("./session-pr-refresh-I3UBWMVP.js").then((mod) => {
7095
+ void import("./session-pr-refresh-CT2INROL.js").then((mod) => {
6844
7096
  if (refreshGeneration !== sessionPrRefreshGeneration) return;
6845
7097
  sessionPrRefreshTimer = mod.startSessionPrRefreshTimer({
6846
7098
  workspaceRegistry,
@@ -6914,7 +7166,8 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
6914
7166
  direction: daemonPipeDirection(direction),
6915
7167
  bytes,
6916
7168
  message
6917
- }), "onMessageObserved")
7169
+ }), "onMessageObserved"),
7170
+ onQueueSaturated: warnAcpQueueSaturated
6918
7171
  },
6919
7172
  ...acpChildExtraArgs(opts) ? { extraArgs: acpChildExtraArgs(opts) } : {}
6920
7173
  });
@@ -6941,11 +7194,13 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
6941
7194
  });
6942
7195
  let wsBridge;
6943
7196
  try {
7197
+ const wsAttachmentsRoots = sessionAttachmentsRoots(
7198
+ cwd,
7199
+ wsEnv.sessionRuntimeBaseDir
7200
+ );
6944
7201
  wsBridge = runtime.createAcpSessionBridge({
6945
- sessionAttachmentsRoot: sessionAttachmentsRoot(
6946
- cwd,
6947
- wsEnv.sessionRuntimeBaseDir
6948
- ),
7202
+ sessionAttachmentsRoot: wsAttachmentsRoots.root,
7203
+ sessionAttachmentsFallbackRoot: wsAttachmentsRoots.fallback,
6949
7204
  clientMcpSender: wsClientMcpRegistry.lookup,
6950
7205
  onCreateSubSession: wsSubSessionLauncher.launch,
6951
7206
  onCreateCurrentSessionScheduledTask: createCurrentSessionScheduledTaskHandler(
@@ -6983,8 +7238,13 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
6983
7238
  sessionRestoreTimeoutMs,
6984
7239
  ...opts.sessionReapIntervalMs !== void 0 ? { sessionReapIntervalMs: opts.sessionReapIntervalMs } : {},
6985
7240
  ...opts.sessionIdleTimeoutMs !== void 0 ? { sessionIdleTimeoutMs: opts.sessionIdleTimeoutMs } : {},
7241
+ ...opts.sessionPromptSettledCloseGraceMs !== void 0 ? {
7242
+ sessionPromptSettledCloseGraceMs: opts.sessionPromptSettledCloseGraceMs
7243
+ } : {},
6986
7244
  ...opts.permissionResponseTimeoutMs !== void 0 ? { permissionResponseTimeoutMs: opts.permissionResponseTimeoutMs } : {},
6987
7245
  boundWorkspace: cwd,
7246
+ runtimeEpochSource: runtimeEpochSourceFor(cwd),
7247
+ acquireMcpAuthentication,
6988
7248
  // Live-conversation workspaces keep transcripts outside the
6989
7249
  // runtime storage layout, so no ledger sink is wired there.
6990
7250
  ...provenance === "live-conversation" ? {} : {
@@ -7071,20 +7331,54 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
7071
7331
  workspaceTrusted: trusted
7072
7332
  });
7073
7333
  assertGenerationOpen?.();
7074
- const result = settingsRuntime.settings.reloadEnvironment(
7075
- fresh.merged,
7076
- workspace,
7077
- trusted
7078
- );
7334
+ let runtimeEnvironmentApplied = false;
7335
+ let refreshedRuntimeEnv;
7079
7336
  try {
7080
- const refreshedRuntimeEnv = settingsRuntime.environment.buildRuntimeEnvironment(
7337
+ refreshedRuntimeEnv = settingsRuntime.environment.buildRuntimeEnvironment(
7081
7338
  fresh.merged,
7082
7339
  workspace,
7083
7340
  daemonRuntimeBaseEnv,
7084
7341
  trusted
7085
7342
  );
7086
- logRuntimeEnvFileReadFailures(workspace, refreshedRuntimeEnv);
7343
+ } catch (err) {
7344
+ wsEnv.metadata.fallbackReason = err instanceof Error ? err.message : String(err);
7345
+ daemonLog.warn(
7346
+ "failed to rebuild dynamic runtime env snapshot before daemon env reload; preserving previous runtime env",
7347
+ {
7348
+ workspace,
7349
+ error: wsEnv.metadata.fallbackReason
7350
+ }
7351
+ );
7352
+ return {
7353
+ updatedKeys: [],
7354
+ removedKeys: [],
7355
+ runtimeEnvironmentApplied
7356
+ };
7357
+ }
7358
+ logRuntimeEnvFileReadFailures(workspace, refreshedRuntimeEnv);
7359
+ if (refreshedRuntimeEnv.envFileReadFailed) {
7360
+ return {
7361
+ updatedKeys: [],
7362
+ removedKeys: [],
7363
+ runtimeEnvironmentApplied: false
7364
+ };
7365
+ }
7366
+ const result = settingsRuntime.settings.reloadEnvironment(
7367
+ fresh.merged,
7368
+ workspace,
7369
+ trusted,
7370
+ { failClosedOnEnvFileReadError: true }
7371
+ );
7372
+ if (result.envFileReadFailed) {
7373
+ return {
7374
+ updatedKeys: [],
7375
+ removedKeys: [],
7376
+ runtimeEnvironmentApplied: false
7377
+ };
7378
+ }
7379
+ try {
7087
7380
  wsEnv.replace(refreshedRuntimeEnv.effectiveEnv);
7381
+ wsEnv.metadata.workflowsEnabledBySettings = fresh.merged.tools?.workflowsEnabled === true;
7088
7382
  wsEnv.metadata.envFileReadFailed = refreshedRuntimeEnv.envFileReadFailed;
7089
7383
  wsEnv.metadata.envFileReadFailures.splice(
7090
7384
  0,
@@ -7102,18 +7396,28 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
7102
7396
  ...refreshedRuntimeEnv.envFilePaths
7103
7397
  );
7104
7398
  delete wsEnv.metadata.fallbackReason;
7399
+ runtimeEnvironmentApplied = true;
7400
+ return { ...result, runtimeEnvironmentApplied };
7105
7401
  } catch (err) {
7106
7402
  wsEnv.metadata.fallbackReason = err instanceof Error ? err.message : String(err);
7107
7403
  daemonLog.warn(
7108
- "failed to rebuild dynamic runtime env snapshot after daemon env reload; preserving previous runtime env",
7404
+ "failed to apply dynamic runtime env snapshot after daemon env reload; preserving previous runtime env",
7109
7405
  {
7110
7406
  workspace,
7111
7407
  error: wsEnv.metadata.fallbackReason
7112
7408
  }
7113
7409
  );
7410
+ return { ...result, runtimeEnvironmentApplied };
7114
7411
  }
7115
- return result;
7116
7412
  }), "reloadDaemonEnv"),
7413
+ ...buildOptions?.primary === true ? {} : {
7414
+ reloadModelProvidersDaemonEnv: /* @__PURE__ */ __name((workspace, assertGenerationOpen) => reloadRuntimeOverlaySnapshotForModelProviders(
7415
+ workspace,
7416
+ trusted,
7417
+ wsEnv,
7418
+ assertGenerationOpen
7419
+ ), "reloadModelProvidersDaemonEnv")
7420
+ },
7117
7421
  queryWorkspaceStatus: /* @__PURE__ */ __name((method, idle) => wsBridge.queryWorkspaceStatus(method, idle), "queryWorkspaceStatus"),
7118
7422
  invokeWorkspaceCommand: /* @__PURE__ */ __name((method, params, invokeOpts) => wsBridge.invokeWorkspaceCommand(method, params, invokeOpts), "invokeWorkspaceCommand"),
7119
7423
  refreshExtensionsForAllSessions: /* @__PURE__ */ __name(() => wsBridge.refreshExtensionsForAllSessions(), "refreshExtensionsForAllSessions"),
@@ -7296,6 +7600,7 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
7296
7600
  const existing = runtimeCleanupPromises.get(runtimeToDrain);
7297
7601
  if (existing) return existing;
7298
7602
  const cleanup = (async () => {
7603
+ runtime.getWorkspaceRuntimeCoordinatorIfSupported(runtimeToDrain)?.dispose();
7299
7604
  const containmentErrors = [];
7300
7605
  try {
7301
7606
  await workspaceVoiceCoordinator.disposeRuntime(
@@ -7319,7 +7624,9 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
7319
7624
  } catch {
7320
7625
  }
7321
7626
  if (reason !== "daemon_shutdown" && channelWorkerManager && runtimeToDrain.provenance !== "live-conversation") {
7322
- await channelWorkerManager.removeWorkspace(runtimeToDrain.workspaceCwd).catch((err) => {
7627
+ await channelWorkerManager.removeWorkspace(runtimeToDrain.workspaceCwd, {
7628
+ permanent: reason === "workspace_removed"
7629
+ }).catch((err) => {
7323
7630
  daemonLog.error(
7324
7631
  "workspace channel worker cleanup error",
7325
7632
  err instanceof Error ? err : null
@@ -7449,8 +7756,8 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
7449
7756
  { createChannelManagementService },
7450
7757
  { WorkspaceChannelSettingsStore }
7451
7758
  ] = await Promise.all([
7452
- import("./channel-management-service-HQ6KDS7C.js"),
7453
- import("./channel-settings-store-PEOI7XCG.js")
7759
+ import("./channel-management-service-4MTCEGJB.js"),
7760
+ import("./channel-settings-store-BVKWAI2T.js")
7454
7761
  ]);
7455
7762
  return createChannelManagementService({
7456
7763
  workspaceCwd: targetRuntime.workspaceCwd,
@@ -7655,8 +7962,8 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
7655
7962
  { createWorkspaceTrustReconciler },
7656
7963
  { createDaemonTrustPolicyMonitor }
7657
7964
  ] = await Promise.all([
7658
- import("./workspace-trust-reconciler-PLIDLJZX.js"),
7659
- import("./daemon-trust-policy-monitor-KGGROSIV.js")
7965
+ import("./workspace-trust-reconciler-IBDFQBQS.js"),
7966
+ import("./daemon-trust-policy-monitor-JL7F4Y4Q.js")
7660
7967
  ]);
7661
7968
  const materializationFor = /* @__PURE__ */ __name((entry, snapshot, decision) => {
7662
7969
  const boundWorkspaces2 = entry.primary && decision.targetTrusted ? runtime.resolveBoundWorkspacesFromIdeEnv(
@@ -7828,6 +8135,7 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
7828
8135
  qwenCodeVersion: cliVersion,
7829
8136
  sessionShellCommandEnabled,
7830
8137
  sessionArtifactsPersistenceAvailable,
8138
+ workspaceRuntimeAvailable: deps.bridge === void 0 || typeof deps.bridge.getWorkspaceRuntimeLifecycleSnapshot === "function",
7831
8139
  currentSessionSchedulingAvailable: false,
7832
8140
  permissionPolicy,
7833
8141
  multiWorkspaceCapabilitiesRequireRuntime: workspaceInputs.length > 1,
@@ -7852,7 +8160,7 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
7852
8160
  // through (and start the runtime) exactly like the warm app would.
7853
8161
  // Dynamic import keeps web-shell-static out of the serve fast-path
7854
8162
  // static closure (see the import-boundary guards in fast-path.test.ts).
7855
- isPreAuthRequest: webShellMounted ? (req) => import("./web-shell-static-HNB4FDOE.js").then(
8163
+ isPreAuthRequest: webShellMounted ? (req) => import("./web-shell-static-POZHGGXE.js").then(
7856
8164
  (webShellStatic) => webShellStatic.isPreAuthWebShellRequest(req)
7857
8165
  ) : void 0
7858
8166
  });
@@ -7872,7 +8180,7 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
7872
8180
  );
7873
8181
  }
7874
8182
  const channelValidationSettingsRuntime = opts.channelSelection ? await loadSettingsRuntimeModules() : void 0;
7875
- const channelValidationTrustPolicy = opts.channelSelection ? await import("./daemon-trust-policy-DOR3YG62.js") : void 0;
8183
+ const channelValidationTrustPolicy = opts.channelSelection ? await import("./daemon-trust-policy-YJL442BK.js") : void 0;
7876
8184
  const channelValidationTrustSnapshot = channelValidationTrustPolicy ? await channelValidationTrustPolicy.readDaemonTrustPolicySnapshot() : void 0;
7877
8185
  const resolveChannelWorkspaceGroupsAtListen = /* @__PURE__ */ __name(() => {
7878
8186
  if (!opts.channelSelection || !channelValidationSettingsRuntime || !channelRuntime) {
@@ -7996,7 +8304,7 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
7996
8304
  const addr = server.address();
7997
8305
  actualPort = typeof addr === "object" && addr ? addr.port : opts.port;
7998
8306
  const scheme = tlsOptions ? "https" : "http";
7999
- const url = `${scheme}://${formatHostForUrl(opts.hostname)}:${actualPort}`;
8307
+ const url = `${scheme}://${formatHostForUrl(optsIn.hostname)}:${actualPort}`;
8000
8308
  const liveRuntimeBaseDir = path.dirname(daemonLogBaseDir);
8001
8309
  const liveDiscoveryOwners = [];
8002
8310
  const rememberLiveDiscoveryOwner = /* @__PURE__ */ __name((owner) => {
@@ -8425,11 +8733,14 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
8425
8733
  );
8426
8734
  }
8427
8735
  const workerRuntime = await ensureChannelRuntime();
8736
+ const workerHostname = tlsOptions ? optsIn.hostname : opts.hostname;
8428
8737
  const workerDaemonUrl = formatChannelWorkerDaemonUrl(
8429
- opts.hostname,
8738
+ workerHostname,
8430
8739
  actualPort,
8431
- tlsOptions !== void 0
8740
+ tlsOptions !== void 0,
8741
+ typeof addr === "object" && addr && (addr.family === "IPv4" || addr.family === "IPv6") ? addr.family : void 0
8432
8742
  );
8743
+ (deps.channelWorkerUrlCertifier ?? assertChannelWorkerDaemonUrlIsLocal)(workerDaemonUrl, workerHostname);
8433
8744
  if (tlsOptions && tlsCertPath && process.env["NODE_TLS_REJECT_UNAUTHORIZED"] === "0") {
8434
8745
  daemonLog.warn(
8435
8746
  `NODE_TLS_REJECT_UNAUTHORIZED=0 disables certificate verification for channel workers; skipping the worker TLS trust check.`
@@ -8729,6 +9040,15 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
8729
9040
  cancelLiveDiscoveryRetry();
8730
9041
  channelControlDraining = true;
8731
9042
  const initiallyMountedApp = runtimeApp ?? runtimeAppForCleanup;
9043
+ const beginRuntimeCoordinatorDrains = /* @__PURE__ */ __name((app2) => {
9044
+ const registry = app2?.locals?.["workspaceRegistry"];
9045
+ for (const workspaceRuntime of registry?.list() ?? []) {
9046
+ getWorkspaceRuntimeCoordinatorIfSupported?.(
9047
+ workspaceRuntime
9048
+ )?.beginDrain();
9049
+ }
9050
+ }, "beginRuntimeCoordinatorDrains");
9051
+ beginRuntimeCoordinatorDrains(initiallyMountedApp);
8732
9052
  const initiallyMountedManagement = initiallyMountedApp?.locals?.["workspaceManagementHandle"];
8733
9053
  const initiallyMountedSessionMaintenance = initiallyMountedApp?.locals?.["sessionArchiveCoordinator"];
8734
9054
  const initiallyMountedConversationActivity = initiallyMountedApp?.locals?.["conversationRuntimeActivity"];
@@ -8857,6 +9177,7 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
8857
9177
  err instanceof Error ? err : null
8858
9178
  );
8859
9179
  });
9180
+ beginRuntimeCoordinatorDrains(appForCleanup);
8860
9181
  startProcessRegistryShutdown();
8861
9182
  disposeRuntimeAppResources(appForCleanup);
8862
9183
  disposeDaemonEventLoopMonitor();
@@ -8966,7 +9287,7 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
8966
9287
  );
8967
9288
  if (!token) {
8968
9289
  writeStderrLine(
8969
- `qwen serve: bearer auth disabled (loopback default). Set ${QWEN_SERVER_TOKEN_ENV} to enable.`
9290
+ `qwen serve: trusted loopback mode; local callers have full API access without bearer authentication, including code execution as the daemon user. Use --require-auth with ${QWEN_SERVER_TOKEN_ENV} on shared or untrusted hosts.`
8970
9291
  );
8971
9292
  if (opts.clientMcpOverWs === true) {
8972
9293
  writeStderrLine(
@@ -9079,6 +9400,22 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
9079
9400
  const tryListen = /* @__PURE__ */ __name((attemptPort, attempt) => {
9080
9401
  const handleListening = /* @__PURE__ */ __name(() => {
9081
9402
  server.removeListener("error", handleError);
9403
+ const address = server.address();
9404
+ if (trustedLoopbackMode && (typeof address !== "object" || address === null || !isLoopbackAddress(address.address))) {
9405
+ const resolvedAddress = typeof address === "object" && address !== null ? address.address : String(address);
9406
+ const error = new Error(
9407
+ `Refusing trusted-loopback mode because ${opts.hostname} bound to non-loopback address ${resolvedAddress}. Set ${QWEN_SERVER_TOKEN_ENV} or pass --token, or bind to an explicit loopback address.`
9408
+ );
9409
+ removeCurrentServePidfile();
9410
+ markServeAppStartupFailed(error);
9411
+ void serveAppLifecycle.close().then(
9412
+ () => reject(error),
9413
+ (closeError) => reject(
9414
+ closeError instanceof Error ? new AggregateError([error, closeError], error.message) : error
9415
+ )
9416
+ );
9417
+ return;
9418
+ }
9082
9419
  onListening();
9083
9420
  }, "handleListening");
9084
9421
  const handleError = /* @__PURE__ */ __name((err) => {
@@ -9130,6 +9467,7 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
9130
9467
  __name(runQwenServeImpl, "runQwenServeImpl");
9131
9468
  export {
9132
9469
  InvalidPolicyConfigError,
9470
+ assertChannelWorkerDaemonUrlIsLocal,
9133
9471
  createBoundChannelDeliveryHandler,
9134
9472
  createDisabledChannelWorkerSupervisor,
9135
9473
  createLazyBridgeProxy,