@qwen-code/qwen-code 0.21.12 → 0.21.14-preview.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 (353) hide show
  1. package/bundled/qc-helper/docs/configuration/settings.md +13 -5
  2. package/bundled/qc-helper/docs/features/code-review.md +18 -13
  3. package/bundled/qc-helper/docs/features/commands.md +120 -8
  4. package/bundled/qc-helper/docs/features/sub-agents.md +2 -2
  5. package/bundled/qc-helper/docs/qwen-serve-deploy-local.md +1 -1
  6. package/bundled/qc-helper/docs/qwen-serve.md +20 -3
  7. package/bundled/review/SKILL.md +130 -82
  8. package/chunks/{MaxSizedBox-ZSJJ2D5S.js → MaxSizedBox-3PZITE2Y.js} +46 -45
  9. package/chunks/{StandaloneSessionPicker-WHUHQXSA.js → StandaloneSessionPicker-2C34PNGO.js} +68 -67
  10. package/chunks/{acp-startup-profiler-SVPUHLXV.js → acp-startup-profiler-HUYGO57H.js} +2 -2
  11. package/chunks/{acpAgent-7JOAESF5.js → acpAgent-3J4NHAYT.js} +1098 -366
  12. package/chunks/{agent-E6V3VXQR.js → agent-VFX4RPP5.js} +42 -41
  13. package/chunks/agent-headless-6WCF4J6N.js +88 -0
  14. package/chunks/{anthropicContentGenerator-YDT4EOKO.js → anthropicContentGenerator-M7XRJMSK.js} +8 -8
  15. package/chunks/{artifact-tool-4GCQQDZI.js → artifact-tool-GEXTOPVO.js} +2 -2
  16. package/chunks/{askUserQuestion-HZJJLR3Z.js → askUserQuestion-B33XRSB7.js} +2 -2
  17. package/chunks/{bridge-NPBV53UA.js → bridge-XR5ZSR7U.js} +46 -45
  18. package/chunks/{ca-4CQ6MYNQ.js → ca-SLZJD6QH.js} +8 -0
  19. package/chunks/{channel-management-service-OADNGQM3.js → channel-management-service-X6LCQUAD.js} +1 -1
  20. package/chunks/{channel-settings-store-4ODLJ4X2.js → channel-settings-store-Z7BUEUJE.js} +50 -49
  21. package/chunks/{channel-worker-group-IHBIHQ45.js → channel-worker-group-TJ35JDPE.js} +4 -4
  22. package/chunks/{channel-worker-manager-GEHYJ5AE.js → channel-worker-manager-G5LKWGOG.js} +4 -4
  23. package/chunks/{channel-worker-supervisor-ZJIIWM4I.js → channel-worker-supervisor-OEVWBHGT.js} +2 -2
  24. package/chunks/{chunk-47BGDLJG.js → chunk-25GHLMQQ.js} +42 -20
  25. package/chunks/{chunk-2ZWH53I4.js → chunk-2B2BF7P7.js} +3 -3
  26. package/chunks/chunk-2C6HJMG3.js +757 -0
  27. package/chunks/{chunk-WM3LUQLO.js → chunk-2JXDFSVE.js} +6 -6
  28. package/chunks/{chunk-OYWVIXHT.js → chunk-2M55OBEB.js} +1 -1
  29. package/chunks/{chunk-B4VN3VDH.js → chunk-2OA3JMRD.js} +5 -5
  30. package/chunks/{chunk-GZDWTBT3.js → chunk-3EZLLVDF.js} +2 -2
  31. package/chunks/chunk-3PWCMXIR.js +9169 -0
  32. package/chunks/{chunk-XAFIL4BD.js → chunk-4KQ2TI2K.js} +5 -5
  33. package/chunks/{chunk-OPVF453Q.js → chunk-4V4DFJBS.js} +3 -3
  34. package/chunks/{chunk-DPTMKFIH.js → chunk-4ZMS3JCR.js} +43 -12
  35. package/chunks/{chunk-6JEIRPLN.js → chunk-55PIFSP2.js} +2 -2
  36. package/chunks/{chunk-V6OBVAST.js → chunk-57KOJ2KZ.js} +1 -1
  37. package/chunks/{chunk-QLTATTPS.js → chunk-5CVO7YES.js} +1 -1
  38. package/chunks/{chunk-OK47XBYH.js → chunk-5IYS4WWR.js} +1 -1
  39. package/chunks/chunk-5MK45KZ3.js +492 -0
  40. package/chunks/{chunk-OWXFBIB6.js → chunk-6DFPR7CS.js} +1 -1
  41. package/chunks/{chunk-YIGGWOJE.js → chunk-6HY6IF3Z.js} +1 -1
  42. package/chunks/{chunk-XDRXOSAD.js → chunk-6LAPGPVA.js} +7 -5
  43. package/chunks/{chunk-Q4ZPYNIZ.js → chunk-6PDOHRN6.js} +4 -4
  44. package/chunks/{chunk-OWGRUU7F.js → chunk-6QFDQMQX.js} +1 -1
  45. package/chunks/{chunk-MUNA4QDC.js → chunk-6VDPDHIP.js} +29 -8
  46. package/chunks/{chunk-MDNUCDKZ.js → chunk-73G3Z7QS.js} +3 -3
  47. package/chunks/{chunk-VIFA5VJD.js → chunk-7OCSX7FC.js} +1 -1
  48. package/chunks/{chunk-D2RNVVH6.js → chunk-AKBOLMUF.js} +96 -18
  49. package/chunks/{chunk-S6TCTH4Z.js → chunk-AQBHJ2IG.js} +12 -12
  50. package/chunks/{chunk-WCEI6J56.js → chunk-BOJNAPUE.js} +2 -2
  51. package/chunks/{chunk-DAV4QFD5.js → chunk-BQWNIPTE.js} +44 -3
  52. package/chunks/{chunk-HOSVOUDK.js → chunk-BUQDLC2G.js} +3 -0
  53. package/chunks/{chunk-LUISTZXI.js → chunk-CH5OFRV7.js} +2 -2
  54. package/chunks/{chunk-G6MUFRNI.js → chunk-CHHABXPE.js} +1 -1
  55. package/chunks/{chunk-4AOVQPJU.js → chunk-CPHEPGAO.js} +1 -1
  56. package/chunks/{chunk-MS7GNABG.js → chunk-CXJHQVEK.js} +8 -0
  57. package/chunks/{chunk-K5IDV3PC.js → chunk-D34RDOLP.js} +12 -2
  58. package/chunks/{chunk-3GM5DLBI.js → chunk-DGJ7O55J.js} +3 -3
  59. package/chunks/{chunk-7KJPO7YH.js → chunk-DRKYT2TR.js} +2 -2
  60. package/chunks/{chunk-PZW46OTB.js → chunk-DVR7XKO5.js} +2 -2
  61. package/chunks/{chunk-CQ6IPDQW.js → chunk-DZCV3ZYU.js} +3 -3
  62. package/chunks/{chunk-ULNWG62W.js → chunk-E3DYKPYZ.js} +3 -3
  63. package/chunks/{chunk-YCHNAKC5.js → chunk-E5RS7LF4.js} +44 -13
  64. package/chunks/{chunk-4NFY2S7N.js → chunk-E7REAOTN.js} +15 -0
  65. package/chunks/chunk-EOCQCNV4.js +3887 -0
  66. package/chunks/{chunk-D7QGE3RT.js → chunk-FAAUPSY2.js} +1 -1
  67. package/chunks/{chunk-2IVYL3IF.js → chunk-FCTLOVYW.js} +1 -1
  68. package/chunks/{chunk-QPBFRWCP.js → chunk-FS5NGKWC.js} +3 -3
  69. package/chunks/{chunk-RQJA2YYO.js → chunk-G6FFFICU.js} +4 -4
  70. package/chunks/{chunk-36XKGB7E.js → chunk-GV3OIADZ.js} +3 -3
  71. package/chunks/{chunk-3AEKDXKT.js → chunk-H4A72DE5.js} +1 -1
  72. package/chunks/{chunk-IH4Z54RJ.js → chunk-HGPMOXLZ.js} +5 -5
  73. package/chunks/{chunk-DG4IQ6JG.js → chunk-I3N2Z25H.js} +3 -3
  74. package/chunks/{chunk-WI6GIM2M.js → chunk-I7NTHW4C.js} +2 -2
  75. package/chunks/{chunk-ZBB5EZZV.js → chunk-IA2K2HJE.js} +2 -2
  76. package/chunks/{chunk-IRSLAS4M.js → chunk-IOTPI425.js} +19 -11
  77. package/chunks/{chunk-ROIJYS5K.js → chunk-ISRHAMNL.js} +3 -3
  78. package/chunks/{chunk-CGM3E75C.js → chunk-J63PKMYA.js} +3 -3
  79. package/chunks/{chunk-PTSEETCO.js → chunk-J6YS7Z25.js} +107 -13
  80. package/chunks/{chunk-ZQUY3ZJU.js → chunk-K3CECR5C.js} +4 -4
  81. package/chunks/{chunk-QBJYSIQ4.js → chunk-K3LPAED5.js} +53 -12
  82. package/chunks/{chunk-FRHQQC2Z.js → chunk-KBXKR5R2.js} +1 -1
  83. package/chunks/{chunk-4KM2SYK5.js → chunk-KC4WMLZO.js} +1491 -10579
  84. package/chunks/{chunk-IX4PWUDU.js → chunk-KSGWAYNE.js} +14350 -8679
  85. package/chunks/{chunk-CPFFU46D.js → chunk-KV27IEHM.js} +1 -1
  86. package/chunks/{chunk-OR64CU46.js → chunk-L6CCLB3G.js} +1 -1
  87. package/chunks/{chunk-M6NDLY2T.js → chunk-LD5VIJ7S.js} +1 -1
  88. package/chunks/{chunk-GXTMEATA.js → chunk-LLR424CQ.js} +18 -15
  89. package/chunks/{chunk-RDVNSJQU.js → chunk-LRDB2OLB.js} +3 -3
  90. package/chunks/{chunk-LSRI3ND3.js → chunk-MA2HEDVP.js} +1 -1
  91. package/chunks/{chunk-DFVXU5YM.js → chunk-MCG53LWC.js} +1 -1
  92. package/chunks/{chunk-YBVVOSOH.js → chunk-MIPFDQAF.js} +1 -1
  93. package/chunks/{chunk-KRXPRVGL.js → chunk-MLXTMF7H.js} +0 -1
  94. package/chunks/{chunk-BSR5AXZR.js → chunk-NRPXRNN4.js} +1 -1
  95. package/chunks/{chunk-X5SLJOMF.js → chunk-NV6LW6FT.js} +4 -4
  96. package/chunks/{chunk-YILJKX2T.js → chunk-NVRMCWTP.js} +10 -6
  97. package/chunks/chunk-NYWWQ437.js +24 -0
  98. package/chunks/{chunk-AKBFSOC5.js → chunk-OBJYN4MX.js} +2 -2
  99. package/chunks/{chunk-NX4A23LY.js → chunk-OJOP26ET.js} +3 -3
  100. package/chunks/{chunk-3GDBZJD6.js → chunk-OLZSWUZR.js} +7 -7
  101. package/chunks/{chunk-K34GJQOZ.js → chunk-OO4FKHLO.js} +4 -4
  102. package/chunks/{chunk-BSSLSQEW.js → chunk-OSAFWBNR.js} +3 -3
  103. package/chunks/{chunk-TMFWI4RC.js → chunk-OVY67CYC.js} +1 -1
  104. package/chunks/{chunk-6ZKSO6K7.js → chunk-P425IVUK.js} +7 -7
  105. package/chunks/{chunk-4XA4QIUA.js → chunk-PMS7O6SA.js} +1 -1
  106. package/chunks/{chunk-LCX5B364.js → chunk-PPTM4O4R.js} +3 -3
  107. package/chunks/{chunk-VPV7WBVT.js → chunk-PT4I7NBA.js} +1 -1
  108. package/chunks/{chunk-3LDGOQXZ.js → chunk-QECSDJET.js} +6 -6
  109. package/chunks/{chunk-FMIH5KMQ.js → chunk-QEJZUXSK.js} +1 -1
  110. package/chunks/{chunk-NLFLYSS4.js → chunk-QFJ5JHQR.js} +1 -1
  111. package/chunks/{chunk-KWX56CHZ.js → chunk-QIHHJKXT.js} +7 -7
  112. package/chunks/{chunk-TDESMS7M.js → chunk-RAQBBGS6.js} +50 -70
  113. package/chunks/{chunk-KEC5FHLM.js → chunk-ROIYNTHJ.js} +3 -3
  114. package/chunks/{chunk-63FNZTWG.js → chunk-RWDNJBWN.js} +2 -2
  115. package/chunks/{chunk-56HVDG3M.js → chunk-RXHBTKMG.js} +6 -6
  116. package/chunks/{chunk-MAKIANMX.js → chunk-S6CXQKDD.js} +3 -3
  117. package/chunks/{chunk-CIDQISGM.js → chunk-SA7GBPEA.js} +5 -5
  118. package/chunks/{chunk-YX2RDGAL.js → chunk-SBRIBTYN.js} +1 -1
  119. package/chunks/{chunk-TTRH3RTQ.js → chunk-SG7ZP5PG.js} +4 -4
  120. package/chunks/{chunk-XH3KAV2G.js → chunk-SGLPDKRT.js} +3 -3
  121. package/chunks/{chunk-JRIVMPD2.js → chunk-SLILKYV2.js} +4 -4
  122. package/chunks/{chunk-NW2GIPG3.js → chunk-SNQZZ765.js} +2 -2
  123. package/chunks/{chunk-I7BT2MME.js → chunk-SR2LYSMT.js} +1 -1
  124. package/chunks/{chunk-TXP5NGG3.js → chunk-SXCOEJO4.js} +1 -1
  125. package/chunks/{chunk-MELQSJOU.js → chunk-TNPWODIZ.js} +1 -1
  126. package/chunks/{chunk-VLHR7F4E.js → chunk-U6RZRKNM.js} +247 -198
  127. package/chunks/{chunk-HTYND72J.js → chunk-UC67T4SF.js} +3 -1
  128. package/chunks/{chunk-HG3UBTJ4.js → chunk-UYDGFWIJ.js} +609 -23
  129. package/chunks/{chunk-6P5EXEBL.js → chunk-VGAAAMRD.js} +1126 -232
  130. package/chunks/{chunk-WDVDVWJ3.js → chunk-VHPMDDPT.js} +6 -6
  131. package/chunks/{chunk-H7TMVHKE.js → chunk-WGHHA7ZH.js} +1 -1
  132. package/chunks/{chunk-FQDCO3CJ.js → chunk-WP4WIUOJ.js} +7 -0
  133. package/chunks/{chunk-5RUCD4ED.js → chunk-WPVUOVYX.js} +3 -3
  134. package/chunks/{chunk-EJOGLSNJ.js → chunk-WSSH2BNO.js} +2 -2
  135. package/chunks/{chunk-5AFGJNY6.js → chunk-WVIABDXV.js} +4 -4
  136. package/chunks/chunk-WZAD4ZNJ.js +59 -0
  137. package/chunks/{chunk-62X3CM7Q.js → chunk-X3YA3YGG.js} +8 -5
  138. package/chunks/{chunk-EBPLKY6U.js → chunk-XC377TLN.js} +5483 -3168
  139. package/chunks/{chunk-KLOMACIR.js → chunk-XLLKYULU.js} +2 -2
  140. package/chunks/{chunk-QSD4UH74.js → chunk-XO24LIZC.js} +254 -56
  141. package/chunks/{chunk-N4SVADAV.js → chunk-XT4RKHVE.js} +5 -4
  142. package/chunks/{chunk-PVXEJB66.js → chunk-XUJNK7Y6.js} +1 -1
  143. package/chunks/{chunk-YBHUXEC6.js → chunk-YECDICIO.js} +3 -3
  144. package/chunks/{chunk-FA5K6YI2.js → chunk-YFPZ3NNC.js} +36 -4
  145. package/chunks/{chunk-46UV252V.js → chunk-YHC2EYYG.js} +35 -38
  146. package/chunks/{chunk-6SPD4Z7F.js → chunk-YIWH3MKK.js} +8 -3
  147. package/chunks/{chunk-ZMY2P4L3.js → chunk-YXC7JYUI.js} +4 -4
  148. package/chunks/{chunk-TB4YFWXG.js → chunk-YZHRN3CF.js} +2 -2
  149. package/chunks/{chunk-TQDFSQQF.js → chunk-YZOSNW4R.js} +1 -1
  150. package/chunks/{chunk-DD6O3ZRD.js → chunk-ZIGC3MUS.js} +3 -5
  151. package/chunks/{chunk-CZ4OWGQQ.js → chunk-ZXEAEZFN.js} +63 -19
  152. package/chunks/{computer-use-F4URV4TU.js → computer-use-ABECHPS5.js} +42 -41
  153. package/chunks/{config-utils-Z3OW3IQG.js → config-utils-NJQA5YLJ.js} +2 -2
  154. package/chunks/{contextCommand-IGSS2U5J.js → contextCommand-4CD5HZQQ.js} +44 -43
  155. package/chunks/{core-runtime-H5CZDN3A.js → core-runtime-2MOVQ4VX.js} +42 -41
  156. package/chunks/{create-sub-session-XT6DLYOE.js → create-sub-session-KRQULJE6.js} +2 -2
  157. package/chunks/{create-sub-session-PA7MFTHK.js → create-sub-session-L6NNHG5N.js} +46 -44
  158. package/chunks/{cron-create-2JZ2TWTF.js → cron-create-NFRZEOQX.js} +4 -4
  159. package/chunks/{cron-delete-CTPD2P26.js → cron-delete-GFVSVO7C.js} +4 -4
  160. package/chunks/{cron-list-V44KHAF6.js → cron-list-NRW34CLU.js} +4 -4
  161. package/chunks/{daemon-GED37WOX.js → daemon-XH76IXOC.js} +436 -29
  162. package/chunks/{daemon-git-worktree-guard-LZDCNJGV.js → daemon-git-worktree-guard-BLXFEG4Q.js} +44 -43
  163. package/chunks/daemon-status-provider-XGD3TPTO.js +103 -0
  164. package/chunks/daemon-trust-policy-THEGCWPO.js +100 -0
  165. package/chunks/{daemon-trust-policy-monitor-2K2YETMT.js → daemon-trust-policy-monitor-L7L4ACWQ.js} +49 -48
  166. package/chunks/{de-UBEBKG6V.js → de-AH4LGCF5.js} +8 -0
  167. package/chunks/{deferred-core-runtime-FKJ3OYE7.js → deferred-core-runtime-YQLHDUGE.js} +42 -41
  168. package/chunks/discovery-X2NV535U.js +27 -0
  169. package/chunks/{display-image-M2ELAVN4.js → display-image-ON3EYFRD.js} +4 -4
  170. package/chunks/{dist-WJ4BHIEW.js → dist-ESS34DHC.js} +72 -0
  171. package/chunks/{earlyInputCapture-WJBSJQUF.js → earlyInputCapture-PCTXNW7N.js} +43 -42
  172. package/chunks/{edit-X73LA4YO.js → edit-QX2EGWYW.js} +45 -43
  173. package/chunks/{en-X6YV7GME.js → en-MD3GP5YL.js} +8 -0
  174. package/chunks/{enter-worktree-CLRQTIVN.js → enter-worktree-EM3ZZ2SB.js} +42 -41
  175. package/chunks/{enterPlanMode-6BDYUQ5T.js → enterPlanMode-ESCMVAKB.js} +42 -41
  176. package/chunks/{environment-WOAJXJDJ.js → environment-TOJI56YV.js} +45 -44
  177. package/chunks/{errors-7OY5MXYY.js → errors-DZ5FWWEM.js} +44 -43
  178. package/chunks/{exit-worktree-TFFJXCRT.js → exit-worktree-KUIJ36XA.js} +42 -41
  179. package/chunks/exitPlanMode-NFVY54FV.js +86 -0
  180. package/chunks/{fast-path-QQLGC37M.js → fast-path-JLQXJSH6.js} +3 -3
  181. package/chunks/{fast-path-settings-LNOFM2YP.js → fast-path-settings-WHX3J3ZI.js} +2 -2
  182. package/chunks/{fr-VENTC2BS.js → fr-ZEML2JWS.js} +8 -0
  183. package/chunks/{gemini-VHE62IJL.js → gemini-I7OT4FWL.js} +92 -91
  184. package/chunks/{geminiContentGenerator-VSHIEGAQ.js → geminiContentGenerator-GRIS77NJ.js} +6 -6
  185. package/chunks/{glob-VMEEDDLO.js → glob-7TBUUV6R.js} +42 -41
  186. package/chunks/{goal-tools-M4UDAZXP.js → goal-tools-K5OHOJ6B.js} +56 -12
  187. package/chunks/{grep-F4UAR7KX.js → grep-743SYWCZ.js} +42 -41
  188. package/chunks/handleAutoUpdate-GAOYUYOD.js +95 -0
  189. package/chunks/{i18n-ETW24DHW.js → i18n-2ITURYX6.js} +43 -42
  190. package/chunks/{image-gen-YPK2AZT4.js → image-gen-4OIWDZD6.js} +10 -10
  191. package/chunks/initializer-OC7LWA6X.js +101 -0
  192. package/chunks/{installationInfo-P7OTIR4P.js → installationInfo-CO47QX3Q.js} +43 -42
  193. package/chunks/{ja-QHT4EQTO.js → ja-UM5B2HMD.js} +8 -0
  194. package/chunks/{keychain-token-storage-NKKCUHI2.js → keychain-token-storage-3XFJ5ZB2.js} +2 -2
  195. package/chunks/list-ATR2SFWT.js +104 -0
  196. package/chunks/{list-agents-O6WSY4CT.js → list-agents-OSVDFI6S.js} +2 -2
  197. package/chunks/loadedSettingsAdapter-NK4B7AGK.js +98 -0
  198. package/chunks/{loggingContentGenerator-J2J2AANS.js → loggingContentGenerator-3WXBU5TQ.js} +67 -41
  199. package/chunks/{loop-wakeup-GVQRMUKS.js → loop-wakeup-HWVUU5CF.js} +5 -5
  200. package/chunks/{ls-6W2D7TKU.js → ls-D3HUFHDP.js} +4 -4
  201. package/chunks/{lsp-NJ4KFBI2.js → lsp-3QDDJTCS.js} +2 -2
  202. package/chunks/{managed-npm-update-WMV5ITKU.js → managed-npm-update-4SSBWI2D.js} +43 -42
  203. package/chunks/mcp-C62AE2QI.js +98 -0
  204. package/chunks/{monitor-2MM23VDV.js → monitor-FEYEGASA.js} +42 -41
  205. package/chunks/nonInteractiveCli-AJEV5ZWO.js +165 -0
  206. package/chunks/{notebook-edit-QD4TRKLY.js → notebook-edit-SLLTEY4O.js} +46 -44
  207. package/chunks/{openaiContentGenerator-KLHSPVN2.js → openaiContentGenerator-WLUGIAPX.js} +27 -26
  208. package/chunks/{pidfile-RQGZBNXT.js → pidfile-TV2VWUMB.js} +43 -42
  209. package/chunks/{processUtils-HZZDA2VV.js → processUtils-3IN2ZR55.js} +2 -2
  210. package/chunks/proper-lockfile-3LHWIM44.js +8 -0
  211. package/chunks/{pt-VL3I5RNY.js → pt-5BMJ3XYH.js} +8 -0
  212. package/chunks/{qwenContentGenerator-T75M2Z3B.js → qwenContentGenerator-GSGRFPJE.js} +47 -46
  213. package/chunks/{qwenOAuth2-5QZU444W.js → qwenOAuth2-JLSTIS4Z.js} +9 -9
  214. package/chunks/{read-file-LOVUSBJC.js → read-file-6PZZRGZZ.js} +15 -13
  215. package/chunks/{read-mcp-resource-GWCP23WG.js → read-mcp-resource-XD54ZQMC.js} +2 -2
  216. package/chunks/{record-artifact-IYQDEYMV.js → record-artifact-GLU3UWBV.js} +5 -3
  217. package/chunks/{resumeHistoryUtils-LVKSSQII.js → resumeHistoryUtils-5GEWKOOO.js} +49 -48
  218. package/chunks/ripGrep-FX7GBGFN.js +86 -0
  219. package/chunks/{ru-4RCKL4PY.js → ru-6GL66ORV.js} +8 -0
  220. package/chunks/{run-qwen-serve-GZW7B4WK.js → run-qwen-serve-7RHU3NSV.js} +423 -212
  221. package/chunks/{runtime-MYRXEO2E.js → runtime-EPOXAMLP.js} +52 -51
  222. package/chunks/{scheduler-DPTPI6FW.js → scheduler-F4Y7ENVV.js} +44 -43
  223. package/chunks/{sdk-exporters-http-NHBYB5FZ.js → sdk-exporters-http-NC746HLT.js} +3 -3
  224. package/chunks/{sdk-impl-SK4P5WON.js → sdk-impl-YVL7BP6Y.js} +3 -3
  225. package/chunks/{send-message-O7FO63UK.js → send-message-TNBG5EVA.js} +7 -7
  226. package/chunks/{serve-XCG4XCDA.js → serve-LQV4TN5A.js} +49 -50
  227. package/chunks/{server-AWQHKXLG.js → server-IZCKLIYQ.js} +5042 -1725
  228. package/chunks/{session-P5FKNCNR.js → session-52ZGTDVB.js} +87 -85
  229. package/chunks/{settings-CSYVIP2R.js → settings-WCVB34HW.js} +48 -47
  230. package/chunks/{shell-EGTSUO2P.js → shell-33BIUBLH.js} +42 -41
  231. package/chunks/{skill-IFUD72GF.js → skill-IYVQ2QNK.js} +20 -18
  232. package/chunks/{skill-settings-YOE7LBHE.js → skill-settings-YG4ZS4OZ.js} +48 -47
  233. package/chunks/{spawnChannel-PQSZIOLY.js → spawnChannel-BLA4YT4W.js} +44 -43
  234. package/chunks/{standalone-update-RB2EGUSF.js → standalone-update-ALRIPWSM.js} +44 -43
  235. package/chunks/{startInteractiveUI-KMYUJ2MU.js → startInteractiveUI-PISBXWKA.js} +614 -294
  236. package/chunks/{syntheticOutput-DVHJMUGV.js → syntheticOutput-7GWFIDXT.js} +3 -3
  237. package/chunks/{task-create-4NC7PDI4.js → task-create-EILHJJB7.js} +11 -11
  238. package/chunks/{task-list-LBSRMOC7.js → task-list-WGJR6YL5.js} +21 -7
  239. package/chunks/{task-stop-YFNATTIM.js → task-stop-X37KYTKB.js} +2 -2
  240. package/chunks/{task-update-BPLM52GD.js → task-update-XZAHVXJ5.js} +86 -15
  241. package/chunks/{team-create-B6A6MJBT.js → team-create-CIQDCC6A.js} +43 -43
  242. package/chunks/{team-delete-MKYMYBFM.js → team-delete-UEP4QOOT.js} +6 -6
  243. package/chunks/{team-plan-approval-5WO3CXXU.js → team-plan-approval-664XCRB4.js} +42 -41
  244. package/chunks/{terminal-image-renderer-BTRE2GEU.js → terminal-image-renderer-TEBO6ONY.js} +44 -43
  245. package/chunks/theme-manager-3CIFH2JV.js +90 -0
  246. package/chunks/{todoWrite-K5K7NRE5.js → todoWrite-ATS62CAP.js} +4 -4
  247. package/chunks/{tool-search-QNBLXUGR.js → tool-search-IJX5JHJB.js} +19 -17
  248. package/chunks/{total-session-admission-N4E5SFBO.js → total-session-admission-XBK2NVRV.js} +46 -45
  249. package/chunks/{trustedFolders-MQS46LIU.js → trustedFolders-OOFNLRWK.js} +43 -42
  250. package/chunks/{update-relaunch-536KRL33.js → update-relaunch-EIG7EYAQ.js} +5 -5
  251. package/chunks/{updateCheck-QJI2SYWF.js → updateCheck-KYDCBLSF.js} +46 -45
  252. package/chunks/{useAutoAcceptIndicator-7QASHD46.js → useAutoAcceptIndicator-RFX3KNBN.js} +52 -51
  253. package/chunks/{validateNonInterActiveAuth-ZNRGWBLV.js → validateNonInterActiveAuth-MZXSAITU.js} +83 -81
  254. package/chunks/{version-DBEQAFRW.js → version-PJC6ZNXV.js} +1 -1
  255. package/chunks/{web-fetch-MBIVXKPE.js → web-fetch-XXICVGKQ.js} +21 -18
  256. package/chunks/{web-search-4LBIN6VF.js → web-search-LHPM6QWC.js} +9 -9
  257. package/chunks/{workflow-LNMA55HY.js → workflow-4CUO2BV7.js} +159 -57
  258. package/chunks/workspace-providers-status-G4MUGH3X.js +101 -0
  259. package/chunks/{workspace-registration-store-BGRKKIYR.js → workspace-registration-store-QMDMFWBE.js} +2 -2
  260. package/chunks/{workspace-registry-L4NCJ34K.js → workspace-registry-FKBB4MZK.js} +48 -46
  261. package/chunks/{workspace-service-LOXYKYTR.js → workspace-service-TIDTTA65.js} +55 -54
  262. package/chunks/workspace-skills-status-LBC2TZKM.js +101 -0
  263. package/chunks/{workspace-trust-reconciler-H36TCR2S.js → workspace-trust-reconciler-4KJ567XP.js} +58 -56
  264. package/chunks/{write-file-JJAY7JSP.js → write-file-R6LAEER5.js} +42 -41
  265. package/chunks/{zh-TW-SQ4HTSCW.js → zh-TW-LVLBK4KF.js} +8 -0
  266. package/chunks/{zh-LMSTK4WD.js → zh-UBMWS2BJ.js} +8 -0
  267. package/chunks/{zoom-image-4MVVVM7E.js → zoom-image-XLCK6DDK.js} +20 -17
  268. package/cli.js +13 -13
  269. package/locales/ca.js +13 -0
  270. package/locales/de.js +12 -0
  271. package/locales/en.js +11 -0
  272. package/locales/fr.js +13 -0
  273. package/locales/ja.js +13 -0
  274. package/locales/pt.js +12 -0
  275. package/locales/ru.js +12 -0
  276. package/locales/zh-TW.js +11 -0
  277. package/locales/zh.js +11 -0
  278. package/package.json +3 -3
  279. package/web-shell/assets/{arc-B-89zHN4.js → arc-DItbX0DI.js} +1 -1
  280. package/web-shell/assets/{architectureDiagram-3BPJPVTR-BkcOncHk.js → architectureDiagram-3BPJPVTR-CmnIlH8y.js} +1 -1
  281. package/web-shell/assets/{blockDiagram-GPEHLZMM-DQ4yboaF.js → blockDiagram-GPEHLZMM-pObnB9kw.js} +1 -1
  282. package/web-shell/assets/{c4Diagram-AAUBKEIU-C_8ZjPDI.js → c4Diagram-AAUBKEIU-BNBmMS0Y.js} +1 -1
  283. package/web-shell/assets/channel-hZnMfWA9.js +1 -0
  284. package/web-shell/assets/{chunk-2J33WTMH-naKVe1Bm.js → chunk-2J33WTMH-Dz4JBOO6.js} +1 -1
  285. package/web-shell/assets/{chunk-4BX2VUAB-DdoViKT2.js → chunk-4BX2VUAB-Cz2GnvAR.js} +1 -1
  286. package/web-shell/assets/{chunk-55IACEB6-DUDQZEwU.js → chunk-55IACEB6-CC6kOQYx.js} +1 -1
  287. package/web-shell/assets/{chunk-727SXJPM-BqpDTR5s.js → chunk-727SXJPM-Z4lY4gbh.js} +1 -1
  288. package/web-shell/assets/{chunk-AQP2D5EJ-CdmEknkT.js → chunk-AQP2D5EJ-Yz0hZr3D.js} +1 -1
  289. package/web-shell/assets/{chunk-FMBD7UC4-CH7fFTLB.js → chunk-FMBD7UC4-nKmTWTv9.js} +1 -1
  290. package/web-shell/assets/{chunk-ND2GUHAM-ObgSuFKF.js → chunk-ND2GUHAM-CjZz0f6Y.js} +1 -1
  291. package/web-shell/assets/{chunk-QZHKN3VN-D9fKdv_s.js → chunk-QZHKN3VN-Bab3FpuS.js} +1 -1
  292. package/web-shell/assets/classDiagram-4FO5ZUOK-BRnxm8DX.js +1 -0
  293. package/web-shell/assets/classDiagram-v2-Q7XG4LA2-BRnxm8DX.js +1 -0
  294. package/web-shell/assets/{cose-bilkent-S5V4N54A-CvzATMx9.js → cose-bilkent-S5V4N54A-BuSAGFox.js} +1 -1
  295. package/web-shell/assets/{dagre-BM42HDAG-M_xU21QW.js → dagre-BM42HDAG-CRZXTg3g.js} +1 -1
  296. package/web-shell/assets/{diagram-2AECGRRQ-CNrl9sW1.js → diagram-2AECGRRQ-BFx1Ayrz.js} +1 -1
  297. package/web-shell/assets/{diagram-5GNKFQAL-CUweVT6T.js → diagram-5GNKFQAL-B2hMZ3gS.js} +1 -1
  298. package/web-shell/assets/{diagram-KO2AKTUF-D3n6Lxjo.js → diagram-KO2AKTUF-DKxAQLmc.js} +1 -1
  299. package/web-shell/assets/{diagram-LMA3HP47-0SeFPK4t.js → diagram-LMA3HP47-Bo1xGqVY.js} +1 -1
  300. package/web-shell/assets/{diagram-OG6HWLK6-DAgyEwge.js → diagram-OG6HWLK6-B9NG78d-.js} +1 -1
  301. package/web-shell/assets/{erDiagram-TEJ5UH35-CzxBBDIK.js → erDiagram-TEJ5UH35-DltQKiqQ.js} +1 -1
  302. package/web-shell/assets/{flowDiagram-I6XJVG4X-B0uj0jyo.js → flowDiagram-I6XJVG4X-5xXGmS4I.js} +1 -1
  303. package/web-shell/assets/{ganttDiagram-6RSMTGT7-DFzcj5km.js → ganttDiagram-6RSMTGT7-bhGL5n0l.js} +1 -1
  304. package/web-shell/assets/{gitGraphDiagram-PVQCEYII-DylJ_Fc9.js → gitGraphDiagram-PVQCEYII-ZYnz9hgh.js} +1 -1
  305. package/web-shell/assets/{index-BKSAnXU9.js → index-CBBeUArD.js} +1 -1
  306. package/web-shell/assets/index-CbgU-jUo.css +5 -0
  307. package/web-shell/assets/index-_nhzXqab.js +1750 -0
  308. package/web-shell/assets/{infoDiagram-5YYISTIA-BYMcJVMI.js → infoDiagram-5YYISTIA-Cg-jamQf.js} +1 -1
  309. package/web-shell/assets/{ishikawaDiagram-YF4QCWOH-t1quI1S3.js → ishikawaDiagram-YF4QCWOH-CcmvKlyq.js} +1 -1
  310. package/web-shell/assets/{journeyDiagram-JHISSGLW-YM_QVUJm.js → journeyDiagram-JHISSGLW-BRsOQZp1.js} +1 -1
  311. package/web-shell/assets/{kanban-definition-UN3LZRKU-jw8OddK1.js → kanban-definition-UN3LZRKU-xW-dmEHK.js} +1 -1
  312. package/web-shell/assets/{linear-Dlr3RVuP.js → linear-ClBfEZH2.js} +1 -1
  313. package/web-shell/assets/{mermaid.core-CqGKzNzd.js → mermaid.core-D65NDkzc.js} +5 -5
  314. package/web-shell/assets/{mindmap-definition-RKZ34NQL-BqureoOS.js → mindmap-definition-RKZ34NQL-CyvFslYa.js} +1 -1
  315. package/web-shell/assets/{pieDiagram-4H26LBE5-Da20HkK1.js → pieDiagram-4H26LBE5-BwSefMyG.js} +1 -1
  316. package/web-shell/assets/{quadrantDiagram-W4KKPZXB-BsNlMvJy.js → quadrantDiagram-W4KKPZXB-GqBJspFS.js} +1 -1
  317. package/web-shell/assets/{requirementDiagram-4Y6WPE33-DzVCQCse.js → requirementDiagram-4Y6WPE33-B137PlTJ.js} +1 -1
  318. package/web-shell/assets/{sankeyDiagram-5OEKKPKP-BMo16voT.js → sankeyDiagram-5OEKKPKP-maHkkt8i.js} +1 -1
  319. package/web-shell/assets/{sequenceDiagram-3UESZ5HK-Bgi-pdHk.js → sequenceDiagram-3UESZ5HK-DJ1mRaG3.js} +1 -1
  320. package/web-shell/assets/{stateDiagram-AJRCARHV-xaPQXwGk.js → stateDiagram-AJRCARHV-aRmP7Q4i.js} +1 -1
  321. package/web-shell/assets/stateDiagram-v2-BHNVJYJU-Db39gvZ_.js +1 -0
  322. package/web-shell/assets/{timeline-definition-PNZ67QCA-C_9RuvKG.js → timeline-definition-PNZ67QCA-CIQ3BRPA.js} +1 -1
  323. package/web-shell/assets/{vennDiagram-CIIHVFJN-Bgu6vdla.js → vennDiagram-CIIHVFJN-DR9VPd5h.js} +1 -1
  324. package/web-shell/assets/{wardley-L42UT6IY-CFTZ8IrX.js → wardley-L42UT6IY-ZcfIbT4D.js} +1 -1
  325. package/web-shell/assets/{wardleyDiagram-YWT4CUSO-BASW9Vmt.js → wardleyDiagram-YWT4CUSO-D0jgPi4T.js} +1 -1
  326. package/web-shell/assets/{xychartDiagram-2RQKCTM6--Nh-CD3F.js → xychartDiagram-2RQKCTM6-BGWU4s5o.js} +1 -1
  327. package/web-shell/index.html +2 -2
  328. package/chunks/agent-headless-OEQNFOMH.js +0 -87
  329. package/chunks/chunk-DEDESZDL.js +0 -358
  330. package/chunks/chunk-MPHPFVKK.js +0 -48
  331. package/chunks/chunk-UI5UGEF4.js +0 -3576
  332. package/chunks/daemon-status-provider-QYM57Z44.js +0 -102
  333. package/chunks/daemon-trust-policy-TSRVEYZR.js +0 -99
  334. package/chunks/discovery-XLHITE74.js +0 -220
  335. package/chunks/exitPlanMode-WDURQMIU.js +0 -85
  336. package/chunks/handleAutoUpdate-GN7Z6QAC.js +0 -94
  337. package/chunks/initializer-UA6KQ7MS.js +0 -100
  338. package/chunks/list-GRAMIQOT.js +0 -103
  339. package/chunks/loadedSettingsAdapter-5O2TDS3I.js +0 -97
  340. package/chunks/mcp-XLP33CAI.js +0 -97
  341. package/chunks/nonInteractiveCli-KTA5K6FS.js +0 -163
  342. package/chunks/ripGrep-ZJSHKB6H.js +0 -85
  343. package/chunks/theme-manager-XL2N5SBY.js +0 -89
  344. package/chunks/workspace-providers-status-PDDMI6ST.js +0 -100
  345. package/chunks/workspace-skills-status-IJ5FOQI6.js +0 -100
  346. package/web-shell/assets/channel-Du2WFns8.js +0 -1
  347. package/web-shell/assets/classDiagram-4FO5ZUOK-Zw0HafH6.js +0 -1
  348. package/web-shell/assets/classDiagram-v2-Q7XG4LA2-Zw0HafH6.js +0 -1
  349. package/web-shell/assets/index-BIGQygTL.css +0 -5
  350. package/web-shell/assets/index-J7OMTqAN.js +0 -1789
  351. package/web-shell/assets/stateDiagram-v2-BHNVJYJU-D5RqimXD.js +0 -1
  352. package/chunks/{chunk-SYHXR6WM.js → chunk-4W5U2TUT.js} +3 -3
  353. /package/chunks/{chunk-NTTBXH7U.js → chunk-UGK4K2N2.js} +0 -0
@@ -10,8 +10,10 @@ import {
10
10
  ACCESS_LOG_CONTROLLER_LOCAL,
11
11
  CAPABILITIES_SCHEMA_VERSION,
12
12
  ClientMcpSenderRegistry,
13
+ ConversationRuntimeOwnershipError,
13
14
  PathMutexRegistry,
14
15
  SERVE_CAPABILITY_REGISTRY,
16
+ ServeAppLifecycleController,
15
17
  WorkspaceVoiceCoordinator,
16
18
  allowOriginCors,
17
19
  allowOriginMode,
@@ -34,7 +36,7 @@ import {
34
36
  resolveAcpHttpEnabled,
35
37
  setDeferredRuntimeRequestTiming,
36
38
  toDaemonStatusMemoryLimits
37
- } from "./chunk-HG3UBTJ4.js";
39
+ } from "./chunk-UYDGFWIJ.js";
38
40
  import "./chunk-VGHZT6JR.js";
39
41
  import {
40
42
  isLoopbackBind
@@ -44,9 +46,19 @@ import {
44
46
  resolveDaemonMemoryBudget,
45
47
  serveJournalGrowthPoolMb
46
48
  } from "./chunk-UXEO7E3V.js";
49
+ import "./chunk-NYWWQ437.js";
47
50
  import {
48
51
  resolveSessionRestoreTimeoutMs
49
52
  } from "./chunk-4JRM2BSM.js";
53
+ import {
54
+ DEFAULT_COMPACTED_REPLAY_MAX_BYTES,
55
+ DEFAULT_MAX_JOURNAL_BYTES,
56
+ DEFAULT_MAX_JOURNAL_EVENTS,
57
+ JOURNAL_GROWTH_HARD_CAP_BYTES,
58
+ normalizeCompactedReplayMaxBytes,
59
+ normalizeMaxJournalBytes,
60
+ normalizeMaxJournalEvents
61
+ } from "./chunk-WCCLLK7X.js";
50
62
  import {
51
63
  require_express,
52
64
  resolveWebShellDir
@@ -57,15 +69,6 @@ import {
57
69
  import {
58
70
  LIVE_HOST_PROTOCOL_VERSION
59
71
  } from "./chunk-NKLP3DCK.js";
60
- import {
61
- DEFAULT_COMPACTED_REPLAY_MAX_BYTES,
62
- DEFAULT_MAX_JOURNAL_BYTES,
63
- DEFAULT_MAX_JOURNAL_EVENTS,
64
- JOURNAL_GROWTH_HARD_CAP_BYTES,
65
- normalizeCompactedReplayMaxBytes,
66
- normalizeMaxJournalBytes,
67
- normalizeMaxJournalEvents
68
- } from "./chunk-WCCLLK7X.js";
69
72
  import "./chunk-K6KS3LTN.js";
70
73
  import "./chunk-FC4KQFCS.js";
71
74
  import "./chunk-T3CHYWJZ.js";
@@ -73,22 +76,22 @@ import {
73
76
  consumeServeFastPathRejectedLoaderKeys,
74
77
  loadServeFastPathSettings,
75
78
  preResolveServeFastPathHomeEnvOverrides
76
- } from "./chunk-M6NDLY2T.js";
79
+ } from "./chunk-LD5VIJ7S.js";
77
80
  import {
78
81
  MAX_REGISTERED_WORKSPACES,
79
82
  resolveWorkspaceInputs,
80
83
  workspaceRegistrationId
81
- } from "./chunk-WCEI6J56.js";
82
- import "./chunk-LUISTZXI.js";
84
+ } from "./chunk-BOJNAPUE.js";
85
+ import "./chunk-CH5OFRV7.js";
83
86
  import {
84
87
  LOAD_REPLAY_META_KEY
85
- } from "./chunk-FQDCO3CJ.js";
88
+ } from "./chunk-WP4WIUOJ.js";
86
89
  import "./chunk-624NHDGB.js";
87
90
  import {
88
91
  canonicalizeWorkspace,
89
92
  translateAndCheckAbsoluteWorkspacePath
90
93
  } from "./chunk-6PLDPT2C.js";
91
- import "./chunk-SYHXR6WM.js";
94
+ import "./chunk-4W5U2TUT.js";
92
95
  import "./chunk-FYJ7W2PI.js";
93
96
  import "./chunk-Z7B6SRPM.js";
94
97
  import {
@@ -113,13 +116,13 @@ import {
113
116
  PRIVATE_EXTERNAL_TOOL_GUARD_ENV,
114
117
  PRIVATE_EXTERNAL_TOOL_GUARD_PROVIDER_ENV
115
118
  } from "./chunk-3VUENPWF.js";
116
- import {
117
- MAX_DAEMON_WORKSPACES
118
- } from "./chunk-5HBA2Z7V.js";
119
119
  import {
120
120
  sanitizeLogText
121
121
  } from "./chunk-AW27A43Y.js";
122
122
  import "./chunk-IW6RQPQB.js";
123
+ import {
124
+ MAX_DAEMON_WORKSPACES
125
+ } from "./chunk-5HBA2Z7V.js";
123
126
  import "./chunk-GOXKNSDZ.js";
124
127
  import {
125
128
  getGlobalQwenDirLite,
@@ -130,10 +133,10 @@ import {
130
133
  clearLoaderKeyRejectionReporterIfCurrent,
131
134
  scrubInheritedLoaderEnv,
132
135
  setLoaderKeyRejectionReporter
133
- } from "./chunk-MS7GNABG.js";
136
+ } from "./chunk-CXJHQVEK.js";
134
137
  import {
135
138
  getCliVersion
136
- } from "./chunk-OWXFBIB6.js";
139
+ } from "./chunk-6DFPR7CS.js";
137
140
  import "./chunk-WZMH7II3.js";
138
141
  import "./chunk-NPQ5ZKRP.js";
139
142
  import {
@@ -145,7 +148,7 @@ import "./chunk-TWPJO254.js";
145
148
  import "./chunk-CQ35AJ4Z.js";
146
149
  import {
147
150
  require_proper_lockfile
148
- } from "./chunk-KRXPRVGL.js";
151
+ } from "./chunk-MLXTMF7H.js";
149
152
  import "./chunk-CR3C7WXL.js";
150
153
  import "./chunk-XWRJCPHC.js";
151
154
  import {
@@ -178,6 +181,7 @@ init_esbuild_shims();
178
181
  var import_express = __toESM(require_express(), 1);
179
182
  import { X509Certificate, createHash as createHash3, timingSafeEqual } from "node:crypto";
180
183
  import * as fs from "node:fs";
184
+ import { createServer } from "node:http";
181
185
  import * as https from "node:https";
182
186
  import * as path from "node:path";
183
187
  import * as os from "node:os";
@@ -3024,15 +3028,22 @@ function withSettingsLock(workspace, fn) {
3024
3028
  }
3025
3029
  __name(withSettingsLock, "withSettingsLock");
3026
3030
  var retryableChannelWorkerShutdownErrors = /* @__PURE__ */ new WeakSet();
3031
+ function hasRetryableChannelWorkerShutdownError(error) {
3032
+ if (error instanceof AggregateError) {
3033
+ return error.errors.some(hasRetryableChannelWorkerShutdownError);
3034
+ }
3035
+ return error instanceof Error && retryableChannelWorkerShutdownErrors.has(error);
3036
+ }
3037
+ __name(hasRetryableChannelWorkerShutdownError, "hasRetryableChannelWorkerShutdownError");
3027
3038
  var channelWorkerRuntimePromise;
3028
3039
  async function loadChannelWorkerRuntime() {
3029
3040
  channelWorkerRuntimePromise ??= Promise.all([
3030
- import("./channel-worker-supervisor-ZJIIWM4I.js"),
3031
- import("./pidfile-RQGZBNXT.js"),
3032
- import("./runtime-MYRXEO2E.js"),
3041
+ import("./channel-worker-supervisor-OEVWBHGT.js"),
3042
+ import("./pidfile-TV2VWUMB.js"),
3043
+ import("./runtime-EPOXAMLP.js"),
3033
3044
  import("./cli-entry-path-4VJ3Y6T2.js"),
3034
- import("./channel-worker-group-IHBIHQ45.js"),
3035
- import("./channel-worker-manager-GEHYJ5AE.js")
3045
+ import("./channel-worker-group-TJ35JDPE.js"),
3046
+ import("./channel-worker-manager-G5LKWGOG.js")
3036
3047
  ]).then(
3037
3048
  ([
3038
3049
  supervisor,
@@ -3137,13 +3148,13 @@ function shouldPreheatBridge(deps) {
3137
3148
  __name(shouldPreheatBridge, "shouldPreheatBridge");
3138
3149
  var coreRuntimePromise;
3139
3150
  function loadCoreRuntime() {
3140
- coreRuntimePromise ??= import("./core-runtime-H5CZDN3A.js");
3151
+ coreRuntimePromise ??= import("./core-runtime-2MOVQ4VX.js");
3141
3152
  return coreRuntimePromise;
3142
3153
  }
3143
3154
  __name(loadCoreRuntime, "loadCoreRuntime");
3144
3155
  var liveDiscoveryRuntimePromise;
3145
3156
  function loadLiveDiscoveryRuntime() {
3146
- liveDiscoveryRuntimePromise ??= import("./discovery-XLHITE74.js");
3157
+ liveDiscoveryRuntimePromise ??= import("./discovery-X2NV535U.js");
3147
3158
  return liveDiscoveryRuntimePromise;
3148
3159
  }
3149
3160
  __name(loadLiveDiscoveryRuntime, "loadLiveDiscoveryRuntime");
@@ -3173,10 +3184,10 @@ __name(resolveDaemonLogBaseDirForRun, "resolveDaemonLogBaseDirForRun");
3173
3184
  var settingsRuntimePromise;
3174
3185
  function loadSettingsRuntimeModules() {
3175
3186
  settingsRuntimePromise ??= Promise.all([
3176
- import("./settings-CSYVIP2R.js"),
3177
- import("./environment-WOAJXJDJ.js"),
3178
- import("./loadedSettingsAdapter-5O2TDS3I.js"),
3179
- import("./trustedFolders-MQS46LIU.js")
3187
+ import("./settings-WCVB34HW.js"),
3188
+ import("./environment-TOJI56YV.js"),
3189
+ import("./loadedSettingsAdapter-NK4B7AGK.js"),
3190
+ import("./trustedFolders-OOFNLRWK.js")
3180
3191
  ]).then(([settings, environment, loadedSettingsAdapter, trustedFolders]) => ({
3181
3192
  settings,
3182
3193
  environment,
@@ -3189,8 +3200,8 @@ __name(loadSettingsRuntimeModules, "loadSettingsRuntimeModules");
3189
3200
  var channelWebhookConfigRuntimePromise;
3190
3201
  function loadChannelWebhookConfigRuntime() {
3191
3202
  channelWebhookConfigRuntimePromise ??= Promise.all([
3192
- import("./runtime-MYRXEO2E.js"),
3193
- import("./config-utils-Z3OW3IQG.js")
3203
+ import("./runtime-EPOXAMLP.js"),
3204
+ import("./config-utils-NJQA5YLJ.js")
3194
3205
  ]).then(([channelRuntime, configUtils]) => ({
3195
3206
  loadChannelsConfig: channelRuntime.loadChannelsConfig,
3196
3207
  parseChannelWebhookConfig: configUtils.parseChannelWebhookConfig
@@ -3215,17 +3226,17 @@ async function loadServeRuntimeModules() {
3215
3226
  totalSessionAdmissionModule,
3216
3227
  workspaceRegistryModule
3217
3228
  ] = await Promise.all([
3218
- import("./server-AWQHKXLG.js"),
3219
- import("./bridge-NPBV53UA.js"),
3220
- import("./spawnChannel-PQSZIOLY.js"),
3229
+ import("./server-IZCKLIYQ.js"),
3230
+ import("./bridge-XR5ZSR7U.js"),
3231
+ import("./spawnChannel-BLA4YT4W.js"),
3221
3232
  import("./process-registry-PMJOA5CO.js"),
3222
- import("./workspace-service-LOXYKYTR.js"),
3233
+ import("./workspace-service-TIDTTA65.js"),
3223
3234
  import("./types-WYCFCEHR.js"),
3224
- import("./daemon-status-provider-QYM57Z44.js"),
3225
- import("./workspace-providers-status-PDDMI6ST.js"),
3226
- import("./workspace-skills-status-IJ5FOQI6.js"),
3227
- import("./total-session-admission-N4E5SFBO.js"),
3228
- import("./workspace-registry-L4NCJ34K.js")
3235
+ import("./daemon-status-provider-XGD3TPTO.js"),
3236
+ import("./workspace-providers-status-G4MUGH3X.js"),
3237
+ import("./workspace-skills-status-LBC2TZKM.js"),
3238
+ import("./total-session-admission-XBK2NVRV.js"),
3239
+ import("./workspace-registry-FKBB4MZK.js")
3229
3240
  ]);
3230
3241
  return {
3231
3242
  createServeApp: serverModule.createServeApp,
@@ -3617,6 +3628,11 @@ function createBootstrapServeApp(input) {
3617
3628
  channelIdleTimeoutMs: channelIdleTimeoutMs(opts.channelIdleTimeoutMs),
3618
3629
  sessionIdleTimeoutMs: sessionIdleTimeoutMs(opts.sessionIdleTimeoutMs),
3619
3630
  acpConnectionCap: null,
3631
+ acpPreAttachMaxFramesPerStream: null,
3632
+ acpPreAttachMaxFramesPerConnection: null,
3633
+ acpPreAttachMaxFramesGlobal: null,
3634
+ acpPreAttachMaxPayloadBytesPerConnection: null,
3635
+ acpPreAttachMaxPayloadBytesGlobal: null,
3620
3636
  // No child-heap policy during bootstrap: it is built with the
3621
3637
  // runtime, so `enforced` is correctly false and `childHeap` null in
3622
3638
  // this window even when the flag says `enforce`.
@@ -3660,7 +3676,17 @@ function createBootstrapServeApp(input) {
3660
3676
  sessionStreams: 0,
3661
3677
  sseStreams: 0,
3662
3678
  wsStreams: 0,
3663
- pendingClientRequests: 0
3679
+ pendingClientRequests: 0,
3680
+ preAttach: {
3681
+ bufferedConnectionFrames: 0,
3682
+ bufferedSessionFrames: 0,
3683
+ pendingDeliveryFrames: 0,
3684
+ usedFrames: 0,
3685
+ usedBytes: 0,
3686
+ highWaterFrames: 0,
3687
+ highWaterBytes: 0,
3688
+ guardFailures: 0
3689
+ }
3664
3690
  }
3665
3691
  },
3666
3692
  rateLimit: {
@@ -3683,6 +3709,7 @@ function createBootstrapServeApp(input) {
3683
3709
  ...detail.detail === "full" ? {
3684
3710
  full: {
3685
3711
  sessions: [],
3712
+ acpMounts: [],
3686
3713
  acpConnections: [],
3687
3714
  workspace: {},
3688
3715
  auth: {
@@ -4147,6 +4174,27 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
4147
4174
  );
4148
4175
  }
4149
4176
  const validateAndCanonicalizeWorkspace = validateAndCanonicalizeWorkspaceInput;
4177
+ const liveConversationWorkspace = deps.liveConversationWorkspace ?? new ConversationWorkspace();
4178
+ const isReservedConversationWorkspace = /* @__PURE__ */ __name((candidate) => {
4179
+ const resolvedCandidate = path.resolve(candidate);
4180
+ const resolvedRoot = path.resolve(liveConversationWorkspace.rootPath);
4181
+ let canonicalRoot = resolvedRoot;
4182
+ try {
4183
+ canonicalRoot = fs.realpathSync.native(resolvedRoot);
4184
+ } catch {
4185
+ }
4186
+ return resolvedCandidate === resolvedRoot || isWithinRoot(resolvedCandidate, resolvedRoot) || resolvedCandidate === canonicalRoot || isWithinRoot(resolvedCandidate, canonicalRoot);
4187
+ }, "isReservedConversationWorkspace");
4188
+ const reservedRawWorkspace = rawWorkspaces.find(
4189
+ (workspace) => isReservedConversationWorkspace(workspace)
4190
+ );
4191
+ if (reservedRawWorkspace) {
4192
+ throw new Error(
4193
+ `Workspace ${JSON.stringify(
4194
+ reservedRawWorkspace
4195
+ )} is reserved for Conversations.`
4196
+ );
4197
+ }
4150
4198
  const workspaceInputs = rawWorkspaces.map((workspace) => ({
4151
4199
  raw: workspace,
4152
4200
  cwd: validateAndCanonicalizeWorkspace(workspace),
@@ -4215,9 +4263,19 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
4215
4263
  journalGrowthSessionLimitProviders.delete(provider);
4216
4264
  };
4217
4265
  }, "registerJournalGrowthSessionLimits");
4266
+ const reservedStartupWorkspace = workspaceInputs.find(
4267
+ (workspace) => isReservedConversationWorkspace(workspace.cwd)
4268
+ );
4269
+ if (reservedStartupWorkspace) {
4270
+ throw new Error(
4271
+ `Workspace ${JSON.stringify(
4272
+ reservedStartupWorkspace.raw
4273
+ )} is reserved for Conversations.`
4274
+ );
4275
+ }
4218
4276
  let workspaceRegistrationStore = deps.workspaceRegistrationStore;
4219
4277
  if (workspaceRegistrationStore === void 0 && process.env["QWEN_SERVE_NO_PERSISTENT_REGISTRATION"] !== "1") {
4220
- const { WorkspaceRegistrationStore } = await import("./workspace-registration-store-BGRKKIYR.js");
4278
+ const { WorkspaceRegistrationStore } = await import("./workspace-registration-store-QMDMFWBE.js");
4221
4279
  workspaceRegistrationStore = new WorkspaceRegistrationStore(boundWorkspace);
4222
4280
  }
4223
4281
  if (workspaceRegistrationStore) {
@@ -4226,6 +4284,14 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
4226
4284
  for (const storedWorkspace of stored.workspaces) {
4227
4285
  const registrationId = workspaceRegistrationId(storedWorkspace);
4228
4286
  const displayName = stored.displayNames?.[registrationId];
4287
+ if (isReservedConversationWorkspace(storedWorkspace)) {
4288
+ writeStderrLine(
4289
+ `qwen serve: skipping persisted workspace registration ${JSON.stringify(
4290
+ storedWorkspace
4291
+ )}: path is reserved for Conversations`
4292
+ );
4293
+ continue;
4294
+ }
4229
4295
  let cwd;
4230
4296
  try {
4231
4297
  cwd = validateAndCanonicalizeWorkspace(storedWorkspace);
@@ -4237,6 +4303,14 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
4237
4303
  );
4238
4304
  continue;
4239
4305
  }
4306
+ if (isReservedConversationWorkspace(cwd)) {
4307
+ writeStderrLine(
4308
+ `qwen serve: skipping persisted workspace registration ${JSON.stringify(
4309
+ storedWorkspace
4310
+ )}: path is reserved for Conversations`
4311
+ );
4312
+ continue;
4313
+ }
4240
4314
  const existingInput = workspaceInputs.find(
4241
4315
  (workspace) => workspace.cwd === cwd
4242
4316
  );
@@ -4485,7 +4559,7 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
4485
4559
  "qwen serve: required external tool guard handshake succeeded."
4486
4560
  );
4487
4561
  }
4488
- const { createDaemonToolGuard } = await import("./daemon-git-worktree-guard-LZDCNJGV.js");
4562
+ const { createDaemonToolGuard } = await import("./daemon-git-worktree-guard-BLXFEG4Q.js");
4489
4563
  const daemonToolGuardHandler = createDaemonToolGuard(
4490
4564
  externalToolGuardHandler
4491
4565
  );
@@ -4521,6 +4595,28 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
4521
4595
  }
4522
4596
  }
4523
4597
  const webShellMounted = !!webShellDir;
4598
+ const serveAppLifecycle = new ServeAppLifecycleController();
4599
+ const liveDiscoveryStableBaseDir = path.resolve(
4600
+ deps.liveDiscoveryStableBaseDir ?? path.join(os.homedir(), ".qwen")
4601
+ );
4602
+ let resolveServeAppStartup;
4603
+ let rejectServeAppStartup;
4604
+ let serveAppStartupSettled = false;
4605
+ const serveAppStartupReady = new Promise((resolve3, reject) => {
4606
+ resolveServeAppStartup = resolve3;
4607
+ rejectServeAppStartup = reject;
4608
+ });
4609
+ void serveAppStartupReady.catch(() => void 0);
4610
+ const markServeAppStartupReady = /* @__PURE__ */ __name(() => {
4611
+ if (serveAppStartupSettled) return;
4612
+ serveAppStartupSettled = true;
4613
+ resolveServeAppStartup();
4614
+ }, "markServeAppStartupReady");
4615
+ const markServeAppStartupFailed = /* @__PURE__ */ __name((error) => {
4616
+ if (serveAppStartupSettled) return;
4617
+ serveAppStartupSettled = true;
4618
+ rejectServeAppStartup(error);
4619
+ }, "markServeAppStartupFailed");
4524
4620
  let runtimeApp;
4525
4621
  let runtimeAppForCleanup;
4526
4622
  let bridgeRef = deps.bridge;
@@ -4595,7 +4691,6 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
4595
4691
  };
4596
4692
  }, "resolveChannelWebhookConfigSource");
4597
4693
  let closeServerAfterChannelWorkerStartupFailure = false;
4598
- let runtimeFailureListenerClose;
4599
4694
  const getChannelWorkerSnapshot = /* @__PURE__ */ __name(() => channelWorkerManager?.primarySnapshot() ?? {
4600
4695
  enabled: false,
4601
4696
  state: "disabled",
@@ -4753,6 +4848,14 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
4753
4848
  );
4754
4849
  }
4755
4850
  }
4851
+ const localControlService = app2.locals?.["localControlService"];
4852
+ if (localControlService) {
4853
+ void localControlService.dispose().catch((err) => {
4854
+ daemonLog.warn(
4855
+ `Local Control dispose error: ${err instanceof Error ? err.message : String(err)}`
4856
+ );
4857
+ });
4858
+ }
4756
4859
  const acpHandle = app2.locals?.["acpHandle"];
4757
4860
  if (acpHandle?.dispose) {
4758
4861
  try {
@@ -4792,7 +4895,7 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
4792
4895
  loadCoreRuntime(),
4793
4896
  loadSettingsRuntimeModules(),
4794
4897
  cliVersionPromise,
4795
- import("./daemon-trust-policy-TSRVEYZR.js")
4898
+ import("./daemon-trust-policy-THEGCWPO.js")
4796
4899
  ]);
4797
4900
  cliVersion = resolvedCliVersion;
4798
4901
  settingsRuntime.environment.preResolveHomeEnvOverrides();
@@ -4815,7 +4918,6 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
4815
4918
  `qwen serve: managed scratch workspaces are unavailable: ${err instanceof Error ? err.message : String(err)}`
4816
4919
  );
4817
4920
  }
4818
- const liveConversationWorkspace = deps.liveConversationWorkspace ?? new ConversationWorkspace();
4819
4921
  let runtimeBootSettings;
4820
4922
  try {
4821
4923
  runtimeBootSettings = settingsRuntime.settings.loadSettings(
@@ -5165,7 +5267,7 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
5165
5267
  resolveSkillSettings,
5166
5268
  skillSettingStrings,
5167
5269
  updateWorkspaceSkillSettingLists
5168
- } = await import("./skill-settings-YOE7LBHE.js");
5270
+ } = await import("./skill-settings-YG4ZS4OZ.js");
5169
5271
  const fresh = loadSettingsForPersistence(workspace);
5170
5272
  const normalizedName = skillName.trim().toLowerCase();
5171
5273
  const resolved = resolveSkillSettings(fresh);
@@ -5230,7 +5332,7 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
5230
5332
  resolveSkillSettings,
5231
5333
  skillSettingStrings,
5232
5334
  updateWorkspaceSkillSettingLists
5233
- } = await import("./skill-settings-YOE7LBHE.js");
5335
+ } = await import("./skill-settings-YG4ZS4OZ.js");
5234
5336
  const fresh = loadSettingsForPersistence(workspace);
5235
5337
  const resolved = resolveSkillSettings(fresh);
5236
5338
  const initialDisabled = skillSettingStrings(
@@ -5335,7 +5437,7 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
5335
5437
  );
5336
5438
  }
5337
5439
  }), "persistSettingsFn");
5338
- const { createSubSessionLauncher } = await import("./create-sub-session-PA7MFTHK.js");
5440
+ const { createSubSessionLauncher } = await import("./create-sub-session-L6NNHG5N.js");
5339
5441
  const subSessionLauncher = createSubSessionLauncher({
5340
5442
  getBridge: /* @__PURE__ */ __name(() => bridgeRef, "getBridge"),
5341
5443
  boundWorkspace,
@@ -5845,7 +5947,7 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
5845
5947
  workspaceRegistryForPersistence.current = workspaceRegistry;
5846
5948
  const workspaceVoiceCoordinator = new WorkspaceVoiceCoordinator();
5847
5949
  core.registerDaemonGaugeCallbacks({
5848
- sessionCount: /* @__PURE__ */ __name(() => workspaceRegistry.list().reduce((sum, item) => sum + item.bridge.sessionCount, 0), "sessionCount"),
5950
+ sessionCount: /* @__PURE__ */ __name(() => workspaceRegistry.listAll().reduce((sum, item) => sum + item.bridge.sessionCount, 0), "sessionCount"),
5849
5951
  sseCount: /* @__PURE__ */ __name(() => runtime.getActiveSseCount(), "sseCount"),
5850
5952
  heapUsed: /* @__PURE__ */ __name(() => process.memoryUsage().heapUsed, "heapUsed")
5851
5953
  });
@@ -5894,12 +5996,12 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
5894
5996
  cpuPercent,
5895
5997
  rssBytes: mem.rss,
5896
5998
  heapUsedBytes: mem.heapUsed,
5897
- activeSessions: workspaceRegistry.list().reduce((sum, item) => sum + item.bridge.sessionCount, 0),
5898
- activePrompts: workspaceRegistry.list().reduce(
5999
+ activeSessions: workspaceRegistry.listAll().reduce((sum, item) => sum + item.bridge.sessionCount, 0),
6000
+ activePrompts: workspaceRegistry.listAll().reduce(
5899
6001
  (sum, item) => sum + (item.bridge.activePromptCount ?? 0),
5900
6002
  0
5901
6003
  ),
5902
- queuedPrompts: workspaceRegistry.list().reduce(
6004
+ queuedPrompts: workspaceRegistry.listAll().reduce(
5903
6005
  (sum, item) => sum + (item.bridge.pendingPromptTotal ?? 0),
5904
6006
  0
5905
6007
  ),
@@ -6510,8 +6612,8 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
6510
6612
  { createChannelManagementService },
6511
6613
  { WorkspaceChannelSettingsStore }
6512
6614
  ] = await Promise.all([
6513
- import("./channel-management-service-OADNGQM3.js"),
6514
- import("./channel-settings-store-4ODLJ4X2.js")
6615
+ import("./channel-management-service-X6LCQUAD.js"),
6616
+ import("./channel-settings-store-Z7BUEUJE.js")
6515
6617
  ]);
6516
6618
  return createChannelManagementService({
6517
6619
  workspaceCwd: targetRuntime.workspaceCwd,
@@ -6565,6 +6667,8 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
6565
6667
  throw new Error("Workspace runtime publication validation failed.");
6566
6668
  }, "validateWorkspaceRuntimeForPublication");
6567
6669
  const app2 = runtime.createServeApp(opts, () => actualPort, {
6670
+ serveAppLifecycle,
6671
+ liveDiscoveryStableBaseDir,
6568
6672
  workspaceRegistry,
6569
6673
  getSessionBridges: /* @__PURE__ */ __name(() => runtimeBridges, "getSessionBridges"),
6570
6674
  createWorkspaceRuntime: createDynamicWorkspaceRuntime,
@@ -6712,8 +6816,8 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
6712
6816
  { createWorkspaceTrustReconciler },
6713
6817
  { createDaemonTrustPolicyMonitor }
6714
6818
  ] = await Promise.all([
6715
- import("./workspace-trust-reconciler-H36TCR2S.js"),
6716
- import("./daemon-trust-policy-monitor-2K2YETMT.js")
6819
+ import("./workspace-trust-reconciler-4KJ567XP.js"),
6820
+ import("./daemon-trust-policy-monitor-L7L4ACWQ.js")
6717
6821
  ]);
6718
6822
  const materializationFor = /* @__PURE__ */ __name((entry, snapshot, decision) => {
6719
6823
  const boundWorkspaces2 = entry.primary && decision.targetTrusted ? runtime.resolveBoundWorkspacesFromIdeEnv(
@@ -6928,7 +7032,7 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
6928
7032
  );
6929
7033
  }
6930
7034
  const channelValidationSettingsRuntime = opts.channelSelection ? await loadSettingsRuntimeModules() : void 0;
6931
- const channelValidationTrustPolicy = opts.channelSelection ? await import("./daemon-trust-policy-TSRVEYZR.js") : void 0;
7035
+ const channelValidationTrustPolicy = opts.channelSelection ? await import("./daemon-trust-policy-THEGCWPO.js") : void 0;
6932
7036
  const channelValidationTrustSnapshot = channelValidationTrustPolicy ? await channelValidationTrustPolicy.readDaemonTrustPolicySnapshot() : void 0;
6933
7037
  const resolveChannelWorkspaceGroupsAtListen = /* @__PURE__ */ __name(() => {
6934
7038
  if (!opts.channelSelection || !channelValidationSettingsRuntime || !channelRuntime) {
@@ -7035,6 +7139,7 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
7035
7139
  reserveChannelServicePidfile(opts.channelSelection);
7036
7140
  }
7037
7141
  return await new Promise((resolve3, reject) => {
7142
+ let closeHost;
7038
7143
  const onListening = /* @__PURE__ */ __name((error) => {
7039
7144
  if (error) return;
7040
7145
  startup.listenerReadyAt = (/* @__PURE__ */ new Date()).toISOString();
@@ -7054,26 +7159,40 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
7054
7159
  const url = `${scheme}://${formatHostForUrl(opts.hostname)}:${actualPort}`;
7055
7160
  const liveRuntimeBaseDir = path.dirname(daemonLogBaseDir);
7056
7161
  const liveDiscoveryOwners = [];
7162
+ const rememberLiveDiscoveryOwner = /* @__PURE__ */ __name((owner) => {
7163
+ if (liveDiscoveryOwners.some(
7164
+ (candidate) => candidate.runtimeBaseDir === owner.runtimeBaseDir && candidate.instanceNonce === owner.instanceNonce && candidate.pid === owner.pid
7165
+ )) {
7166
+ return;
7167
+ }
7168
+ liveDiscoveryOwners.push(owner);
7169
+ }, "rememberLiveDiscoveryOwner");
7057
7170
  let liveDiscoveryPublish;
7058
7171
  let liveDiscoveryRetryTimer;
7059
7172
  let liveDiscoveryRetryTask;
7173
+ let liveDiscoveryBootRetryApp;
7060
7174
  let liveDiscoveryEnabled = false;
7061
7175
  let liveDiscoveryShuttingDown = false;
7062
7176
  let liveDiscoveryToggle = Promise.resolve();
7063
7177
  let attemptPendingLiveDiscovery;
7064
7178
  const pendingLiveDiscoveryBaseDirs = /* @__PURE__ */ new Set();
7065
7179
  const warnedLiveDiscoveryOwners = /* @__PURE__ */ new Set();
7180
+ let warnedLiveDiscoveryBootFailure = false;
7066
7181
  const liveDiscoveryRetryDelayMs = deps.liveDiscoveryRetryDelayMs !== void 0 && Number.isFinite(deps.liveDiscoveryRetryDelayMs) && deps.liveDiscoveryRetryDelayMs >= 10 ? Math.min(deps.liveDiscoveryRetryDelayMs, 6e4) : DEFAULT_LIVE_DISCOVERY_RETRY_MS;
7067
7182
  const scheduleLiveDiscoveryRetry = /* @__PURE__ */ __name(() => {
7068
- if (liveDiscoveryShuttingDown || !liveDiscoveryEnabled || liveDiscoveryRetryTimer || liveDiscoveryRetryTask || pendingLiveDiscoveryBaseDirs.size === 0 || !attemptPendingLiveDiscovery) {
7183
+ if (liveDiscoveryShuttingDown || !liveDiscoveryEnabled || liveDiscoveryRetryTimer || liveDiscoveryRetryTask || !liveDiscoveryBootRetryApp && (pendingLiveDiscoveryBaseDirs.size === 0 || !attemptPendingLiveDiscovery)) {
7069
7184
  return;
7070
7185
  }
7071
7186
  liveDiscoveryRetryTimer = setTimeout(() => {
7072
7187
  liveDiscoveryRetryTimer = void 0;
7073
- if (liveDiscoveryShuttingDown || !liveDiscoveryEnabled || !attemptPendingLiveDiscovery) {
7188
+ if (liveDiscoveryShuttingDown || !liveDiscoveryEnabled) {
7074
7189
  return;
7075
7190
  }
7076
- const retry = attemptPendingLiveDiscovery().finally(() => {
7191
+ const retryApp = liveDiscoveryBootRetryApp;
7192
+ liveDiscoveryBootRetryApp = void 0;
7193
+ const retryOperation = retryApp ? publishLiveDiscovery(retryApp) : attemptPendingLiveDiscovery?.();
7194
+ if (!retryOperation) return;
7195
+ const retry = retryOperation.finally(() => {
7077
7196
  if (liveDiscoveryRetryTask === retry) {
7078
7197
  liveDiscoveryRetryTask = void 0;
7079
7198
  }
@@ -7098,16 +7217,20 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
7098
7217
  const coordinator = candidateApp.locals?.["liveCoordinator"];
7099
7218
  const instanceNonce = coordinator?.daemonInstanceNonce;
7100
7219
  if (typeof instanceNonce !== "string") return Promise.resolve();
7101
- liveDiscoveryPublish = loadLiveDiscoveryRuntime().then(
7220
+ let publicationFailed = false;
7221
+ let publicationRetryable = false;
7222
+ const publication = serveAppLifecycle.startBoot().then(() => loadLiveDiscoveryRuntime()).then(
7102
7223
  async ({
7103
- getStableLiveDiscoveryBaseDir,
7224
+ handoffLiveDiscoveryOwner,
7104
7225
  LiveDiscoveryOwnerActiveError,
7226
+ LiveDiscoveryPublicationError,
7227
+ removeLiveDiscoveryFile,
7105
7228
  writeLiveDiscoveryFile
7106
7229
  }) => {
7107
7230
  if (liveDiscoveryShuttingDown || !liveDiscoveryEnabled) return;
7108
- const stableBaseDir = path.resolve(
7109
- deps.liveDiscoveryStableBaseDir ?? getStableLiveDiscoveryBaseDir()
7110
- );
7231
+ liveDiscoveryBootRetryApp = void 0;
7232
+ warnedLiveDiscoveryBootFailure = false;
7233
+ const stableBaseDir = liveDiscoveryStableBaseDir;
7111
7234
  const runtimeBaseDir = path.resolve(liveRuntimeBaseDir);
7112
7235
  const targetBaseDirs = /* @__PURE__ */ new Set();
7113
7236
  if (runtimeBaseDir !== stableBaseDir) {
@@ -7125,21 +7248,51 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
7125
7248
  instanceNonce
7126
7249
  };
7127
7250
  attemptPendingLiveDiscovery = /* @__PURE__ */ __name(async () => {
7128
- for (const runtimeBaseDir2 of [
7129
- ...pendingLiveDiscoveryBaseDirs
7130
- ]) {
7131
- if (liveDiscoveryShuttingDown || !liveDiscoveryEnabled)
7251
+ const targets = [...pendingLiveDiscoveryBaseDirs];
7252
+ const published = [];
7253
+ const rollbackPublished = /* @__PURE__ */ __name(async () => {
7254
+ for (const owner of published.splice(0)) {
7255
+ try {
7256
+ await removeLiveDiscoveryFile(
7257
+ owner.runtimeBaseDir,
7258
+ owner
7259
+ );
7260
+ } catch (cleanupError) {
7261
+ rememberLiveDiscoveryOwner(owner);
7262
+ daemonLog.warn(
7263
+ `failed to roll back Live Host discovery at ${owner.runtimeBaseDir}: ${cleanupError instanceof Error ? cleanupError.message : String(cleanupError)}`
7264
+ );
7265
+ }
7266
+ }
7267
+ }, "rollbackPublished");
7268
+ for (const runtimeBaseDir2 of targets) {
7269
+ if (liveDiscoveryShuttingDown || !liveDiscoveryEnabled) {
7270
+ await rollbackPublished();
7132
7271
  return;
7272
+ }
7133
7273
  try {
7274
+ if (runtimeBaseDir2 !== stableBaseDir) {
7275
+ await handoffLiveDiscoveryOwner(
7276
+ runtimeBaseDir2,
7277
+ record,
7278
+ async () => void 0
7279
+ );
7280
+ }
7134
7281
  await writeLiveDiscoveryFile(runtimeBaseDir2, record);
7135
- pendingLiveDiscoveryBaseDirs.delete(runtimeBaseDir2);
7136
- warnedLiveDiscoveryOwners.delete(runtimeBaseDir2);
7137
- liveDiscoveryOwners.push({
7282
+ published.push({
7138
7283
  runtimeBaseDir: runtimeBaseDir2,
7139
7284
  instanceNonce,
7140
7285
  pid: process.pid
7141
7286
  });
7142
7287
  } catch (err) {
7288
+ if (err instanceof LiveDiscoveryPublicationError && err.published) {
7289
+ published.push({
7290
+ runtimeBaseDir: runtimeBaseDir2,
7291
+ instanceNonce,
7292
+ pid: process.pid
7293
+ });
7294
+ }
7295
+ await rollbackPublished();
7143
7296
  if (err instanceof LiveDiscoveryOwnerActiveError) {
7144
7297
  if (!warnedLiveDiscoveryOwners.has(runtimeBaseDir2)) {
7145
7298
  warnedLiveDiscoveryOwners.add(runtimeBaseDir2);
@@ -7147,49 +7300,77 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
7147
7300
  `failed to publish Live Host discovery at ${runtimeBaseDir2}: ${err.message}`
7148
7301
  );
7149
7302
  }
7150
- continue;
7303
+ return;
7151
7304
  }
7152
- pendingLiveDiscoveryBaseDirs.delete(runtimeBaseDir2);
7153
7305
  daemonLog.warn(
7154
7306
  `failed to publish Live Host discovery at ${runtimeBaseDir2}: ${err instanceof Error ? err.message : String(err)}`
7155
7307
  );
7308
+ return;
7156
7309
  }
7157
7310
  }
7311
+ for (const owner of published) {
7312
+ pendingLiveDiscoveryBaseDirs.delete(owner.runtimeBaseDir);
7313
+ warnedLiveDiscoveryOwners.delete(owner.runtimeBaseDir);
7314
+ rememberLiveDiscoveryOwner(owner);
7315
+ }
7158
7316
  }, "attemptPendingLiveDiscovery");
7159
7317
  await attemptPendingLiveDiscovery();
7160
7318
  scheduleLiveDiscoveryRetry();
7161
7319
  }
7162
7320
  ).catch((err) => {
7163
- daemonLog.warn(
7164
- `failed to publish Live Host discovery: ${err instanceof Error ? err.message : String(err)}`
7165
- );
7321
+ publicationFailed = true;
7322
+ publicationRetryable = err instanceof ConversationRuntimeOwnershipError && err.retryable;
7323
+ if (!publicationRetryable || !warnedLiveDiscoveryBootFailure) {
7324
+ warnedLiveDiscoveryBootFailure = publicationRetryable;
7325
+ daemonLog.warn(
7326
+ `failed to publish Live Host discovery: ${err instanceof Error ? err.message : String(err)}`
7327
+ );
7328
+ }
7166
7329
  });
7330
+ const trackedPublication = publication.finally(() => {
7331
+ if (publicationFailed && liveDiscoveryPublish === trackedPublication) {
7332
+ liveDiscoveryPublish = void 0;
7333
+ if (publicationRetryable && !liveDiscoveryShuttingDown && liveDiscoveryEnabled) {
7334
+ liveDiscoveryBootRetryApp = candidateApp;
7335
+ scheduleLiveDiscoveryRetry();
7336
+ }
7337
+ }
7338
+ });
7339
+ liveDiscoveryPublish = trackedPublication;
7167
7340
  return liveDiscoveryPublish;
7168
7341
  }, "publishLiveDiscovery");
7169
7342
  const removeLiveDiscoveryOwners = /* @__PURE__ */ __name(async () => {
7170
- const owners = liveDiscoveryOwners.splice(0);
7343
+ const owners = [...liveDiscoveryOwners];
7171
7344
  if (owners.length === 0) return;
7172
7345
  let removeLiveDiscoveryFile;
7173
7346
  try {
7174
7347
  ({ removeLiveDiscoveryFile } = await loadLiveDiscoveryRuntime());
7175
7348
  } catch (err) {
7176
- daemonLog.warn(
7177
- `failed to load Live discovery runtime for cleanup: ${err instanceof Error ? err.message : String(err)}`
7178
- );
7179
- return;
7349
+ throw new Error("Failed to load Live discovery cleanup support.", {
7350
+ cause: err
7351
+ });
7180
7352
  }
7353
+ const errors = [];
7181
7354
  for (const owner of owners) {
7182
7355
  try {
7183
7356
  await removeLiveDiscoveryFile(owner.runtimeBaseDir, owner);
7357
+ const index = liveDiscoveryOwners.indexOf(owner);
7358
+ if (index >= 0) liveDiscoveryOwners.splice(index, 1);
7184
7359
  } catch (err) {
7185
- daemonLog.warn(
7186
- `failed to remove Live Host discovery at ${owner.runtimeBaseDir}: ${err instanceof Error ? err.message : String(err)}`
7187
- );
7360
+ errors.push(err);
7188
7361
  }
7189
7362
  }
7363
+ if (errors.length > 0) {
7364
+ throw new AggregateError(
7365
+ errors,
7366
+ "Live Host discovery cleanup is incomplete."
7367
+ );
7368
+ }
7190
7369
  }, "removeLiveDiscoveryOwners");
7191
7370
  const unpublishLiveDiscovery = /* @__PURE__ */ __name(async () => {
7192
7371
  liveDiscoveryEnabled = false;
7372
+ liveDiscoveryBootRetryApp = void 0;
7373
+ warnedLiveDiscoveryBootFailure = false;
7193
7374
  cancelLiveDiscoveryRetry();
7194
7375
  pendingLiveDiscoveryBaseDirs.clear();
7195
7376
  attemptPendingLiveDiscovery = void 0;
@@ -7207,6 +7388,9 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
7207
7388
  liveDiscoveryToggle = operation.catch(() => void 0);
7208
7389
  return operation;
7209
7390
  };
7391
+ candidateApp.locals.onConversationRuntimeReady = () => {
7392
+ void publishLiveDiscovery(candidateApp);
7393
+ };
7210
7394
  }, "attachLiveDiscoveryControl");
7211
7395
  const cleanupLiveDiscovery = /* @__PURE__ */ __name(async () => {
7212
7396
  liveDiscoveryShuttingDown = true;
@@ -7214,58 +7398,6 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
7214
7398
  await liveDiscoveryToggle;
7215
7399
  await unpublishLiveDiscovery();
7216
7400
  }, "cleanupLiveDiscovery");
7217
- try {
7218
- channelWorkspaceGroups = resolveChannelWorkspaceGroupsAtListen();
7219
- } catch (err) {
7220
- removeCurrentServePidfile();
7221
- const error2 = err instanceof Error ? err : new Error(String(err));
7222
- server.close((closeErr) => {
7223
- if (closeErr) {
7224
- daemonLog.error(
7225
- "server close after channel worker validation error failed",
7226
- closeErr
7227
- );
7228
- }
7229
- reject(error2);
7230
- });
7231
- return;
7232
- }
7233
- if (channelWorkspaceGroups) {
7234
- for (const group of channelWorkspaceGroups) {
7235
- daemonLog.info("channel worker group assigned", {
7236
- workspace: group.workspaceCwd,
7237
- channels: group.selection.mode === "all" ? ["all"] : group.selection.names
7238
- });
7239
- }
7240
- if (opts.channelSelection?.mode === "all") {
7241
- writeStderrLine(
7242
- "qwen serve: --channel all is primary-workspace only; non-primary workspace channels are not hosted."
7243
- );
7244
- }
7245
- }
7246
- writeStdoutLine(
7247
- `qwen serve listening on ${url} (mode=${opts.mode}, workspace=${boundWorkspace})`
7248
- );
7249
- writeStderrLine(
7250
- `qwen serve: bound to workspace ${JSON.stringify(boundWorkspace)}`
7251
- );
7252
- writeStderrLine(
7253
- `qwen serve: startup timing: processToListenMs=${startup.processToListenMs} runQwenServeToListenMs=${startup.runQwenServeToListenMs}`
7254
- );
7255
- if (!token) {
7256
- writeStderrLine(
7257
- `qwen serve: bearer auth disabled (loopback default). Set ${QWEN_SERVER_TOKEN_ENV} to enable.`
7258
- );
7259
- if (opts.clientMcpOverWs === true) {
7260
- writeStderrLine(
7261
- `qwen serve: client-hosted MCP tools are accepted over the WebSocket without auth. Set ${QWEN_SERVE_CLIENT_MCP_OVER_WS_ENV}=0 to disable.`
7262
- );
7263
- }
7264
- } else if (opts.requireAuth) {
7265
- writeStderrLine(
7266
- "qwen serve: --require-auth enabled (bearer token mandatory on every route, including loopback /health)."
7267
- );
7268
- }
7269
7401
  let shuttingDown = false;
7270
7402
  let closePromise;
7271
7403
  let runtimeStartupTimer;
@@ -7332,6 +7464,7 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
7332
7464
  }, "stopChannelWorkerAfterFailedStartup");
7333
7465
  const failRuntimeStartup = /* @__PURE__ */ __name(async (err, bridgeForCleanup) => {
7334
7466
  const error2 = err instanceof Error ? err : new Error(String(err));
7467
+ markServeAppStartupFailed(error2);
7335
7468
  if (runtimeStartupSettled) {
7336
7469
  disposeRuntimeAppResources(runtimeApp ?? runtimeAppForCleanup);
7337
7470
  await shutdownBridgeAfterFailedStartup(bridgeForCleanup);
@@ -7351,16 +7484,13 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
7351
7484
  daemonLog.error("runtime startup failed", error2);
7352
7485
  markRuntimeFailed(error2);
7353
7486
  if (closeServerAfterChannelWorkerStartupFailure && server.listening) {
7354
- runtimeFailureListenerClose = new Promise((resolve4) => {
7355
- server.close((closeErr) => {
7356
- if (closeErr) {
7357
- daemonLog.error(
7358
- "server close after runtime startup error failed",
7359
- closeErr
7360
- );
7361
- }
7362
- resolve4();
7363
- });
7487
+ server.close((closeErr) => {
7488
+ if (closeErr) {
7489
+ daemonLog.error(
7490
+ "server close after runtime startup error failed",
7491
+ closeErr
7492
+ );
7493
+ }
7364
7494
  });
7365
7495
  server.closeAllConnections();
7366
7496
  }
@@ -7548,6 +7678,7 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
7548
7678
  if (runtimeStartupSettled) return;
7549
7679
  }
7550
7680
  if (runtimeStartupSettled) return;
7681
+ markServeAppStartupReady();
7551
7682
  await publishLiveDiscovery(candidateApp);
7552
7683
  runtimeStartupSettled = true;
7553
7684
  clearRuntimeStartupTimer();
@@ -7663,7 +7794,7 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
7663
7794
  process.exit(runtimeStartupError === void 0 ? 0 : 1);
7664
7795
  } catch (err) {
7665
7796
  daemonLog.error("shutdown error", err instanceof Error ? err : null);
7666
- if (err instanceof Error && retryableChannelWorkerShutdownErrors.has(err)) {
7797
+ if (hasRetryableChannelWorkerShutdownError(err)) {
7667
7798
  daemonLog.error(
7668
7799
  "refusing to exit while a channel worker or service lease remains; signal again to retry after the child exits (another signal during that retry forces exit)"
7669
7800
  );
@@ -7688,6 +7819,7 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
7688
7819
  webShellMounted,
7689
7820
  resolvedToken: token,
7690
7821
  runtimeReady,
7822
+ getLocalControl: /* @__PURE__ */ __name(() => (runtimeApp ?? runtimeAppForCleanup)?.locals?.["localControlService"], "getLocalControl"),
7691
7823
  close: /* @__PURE__ */ __name(() => {
7692
7824
  if (closePromise) return closePromise;
7693
7825
  closePromise = new Promise((res, rej) => {
@@ -7698,10 +7830,12 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
7698
7830
  const initiallyMountedApp = runtimeApp ?? runtimeAppForCleanup;
7699
7831
  const initiallyMountedManagement = initiallyMountedApp?.locals?.["workspaceManagementHandle"];
7700
7832
  const initiallyMountedSessionMaintenance = initiallyMountedApp?.locals?.["sessionArchiveCoordinator"];
7833
+ const initiallyMountedConversationActivity = initiallyMountedApp?.locals?.["conversationRuntimeActivity"];
7701
7834
  const initialManagementWait = initiallyMountedManagement?.sealAndWait?.();
7702
7835
  const initiallyMountedLive = initiallyMountedApp?.locals;
7703
7836
  const initialLiveWait = initiallyMountedLive?.sealAndWaitLiveCoordinator?.();
7704
7837
  const initialSessionMaintenanceWait = initiallyMountedSessionMaintenance?.sealMaintenanceAndWait?.();
7838
+ const initialConversationActivityWait = initiallyMountedConversationActivity?.sealAndWait?.();
7705
7839
  let processRegistryShutdown;
7706
7840
  const startProcessRegistryShutdown = /* @__PURE__ */ __name(() => {
7707
7841
  processRegistryShutdown ??= managedProcessRegistry?.shutdown().then(
@@ -7735,7 +7869,7 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
7735
7869
  `qwen serve: telemetry shutdown error: ${telemetryErr instanceof Error ? telemetryErr.message : String(telemetryErr)}`
7736
7870
  );
7737
7871
  }).finally(async () => {
7738
- const finalErr = err ?? bridgeShutdownError ?? channelWorkerShutdownError;
7872
+ let finalErr = err ?? bridgeShutdownError ?? channelWorkerShutdownError;
7739
7873
  const retryableChannelClose = channelWorkerShutdownError !== void 0 && channelWorkerManager?.state().enabled === true;
7740
7874
  if (retryableChannelClose) {
7741
7875
  const retryableError = channelWorkerShutdownError;
@@ -7750,7 +7884,20 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
7750
7884
  rej(retryableError);
7751
7885
  return;
7752
7886
  }
7753
- await cleanupLiveDiscovery();
7887
+ try {
7888
+ await cleanupLiveDiscovery();
7889
+ } catch (cleanupError) {
7890
+ const normalizedCleanupError = cleanupError instanceof Error ? cleanupError : new Error(String(cleanupError));
7891
+ if (finalErr) {
7892
+ writeDaemonLifecycleBestEffort(() => {
7893
+ daemonLog.error(
7894
+ "Live Host discovery cleanup failed during shutdown",
7895
+ normalizedCleanupError
7896
+ );
7897
+ });
7898
+ }
7899
+ finalErr ??= normalizedCleanupError;
7900
+ }
7754
7901
  if (loggerPublished || loggerSignalOwned) {
7755
7902
  writeDaemonLifecycleBestEffort(() => {
7756
7903
  if (finalErr) {
@@ -7782,6 +7929,7 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
7782
7929
  const appForCleanup = runtimeApp ?? runtimeAppForCleanup;
7783
7930
  const workspaceManagementHandle = appForCleanup?.locals?.["workspaceManagementHandle"];
7784
7931
  const sessionMaintenance = appForCleanup?.locals?.["sessionArchiveCoordinator"];
7932
+ const conversationActivity = appForCleanup?.locals?.["conversationRuntimeActivity"];
7785
7933
  await initialManagementWait;
7786
7934
  if (workspaceManagementHandle !== initiallyMountedManagement) {
7787
7935
  await workspaceManagementHandle?.sealAndWait?.();
@@ -7795,6 +7943,10 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
7795
7943
  if (sessionMaintenance !== initiallyMountedSessionMaintenance) {
7796
7944
  await sessionMaintenance?.sealMaintenanceAndWait?.();
7797
7945
  }
7946
+ await initialConversationActivityWait;
7947
+ if (conversationActivity !== initiallyMountedConversationActivity) {
7948
+ await conversationActivity?.sealAndWait?.();
7949
+ }
7798
7950
  stopTrustPolicyMonitor(appForCleanup);
7799
7951
  const waitForTrustPolicyIdle = appForCleanup?.locals?.["waitForTrustPolicyIdle"];
7800
7952
  await waitForTrustPolicyIdle?.().catch((err) => {
@@ -7862,43 +8014,71 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
7862
8014
  );
7863
8015
  bridgeShutdownError ??= processRegistryError;
7864
8016
  }
7865
- }).finally(() => {
7866
- if (!server.listening) {
7867
- void (runtimeFailureListenerClose ?? Promise.resolve()).then(
7868
- () => finish()
7869
- );
7870
- return;
7871
- }
7872
- const SECONDARY_DEADLINE_MS = 2e3;
7873
- let secondaryTimer;
7874
- const forceTimer = setTimeout(() => {
7875
- daemonLog.warn(
7876
- `${SHUTDOWN_FORCE_CLOSE_MS}ms listener-drain timeout reached; force-closing remaining connections`
7877
- );
7878
- server.closeAllConnections();
7879
- secondaryTimer = setTimeout(() => {
7880
- daemonLog.warn(
7881
- `server.close did not fire ${SECONDARY_DEADLINE_MS}ms after force-close; resolving anyway`
7882
- );
7883
- finish();
7884
- }, SECONDARY_DEADLINE_MS);
7885
- secondaryTimer.unref();
7886
- }, SHUTDOWN_FORCE_CLOSE_MS);
7887
- forceTimer.unref();
7888
- server.close((err) => {
7889
- clearTimeout(forceTimer);
7890
- if (secondaryTimer) clearTimeout(secondaryTimer);
7891
- finish(err);
7892
- });
7893
- });
8017
+ }).then(
8018
+ () => finish(),
8019
+ (error2) => finish(
8020
+ error2 instanceof Error ? error2 : new Error(String(error2))
8021
+ )
8022
+ );
7894
8023
  });
7895
8024
  return closePromise;
7896
8025
  }, "close")
7897
8026
  };
8027
+ closeHost = handle.close;
8028
+ handle.close = () => serveAppLifecycle.close();
8029
+ try {
8030
+ channelWorkspaceGroups = resolveChannelWorkspaceGroupsAtListen();
8031
+ } catch (err) {
8032
+ removeCurrentServePidfile();
8033
+ const error2 = err instanceof Error ? err : new Error(String(err));
8034
+ markServeAppStartupFailed(error2);
8035
+ void serveAppLifecycle.close().then(
8036
+ () => reject(error2),
8037
+ (closeError) => reject(
8038
+ closeError instanceof Error ? new AggregateError([error2, closeError], error2.message) : error2
8039
+ )
8040
+ );
8041
+ return;
8042
+ }
8043
+ if (channelWorkspaceGroups) {
8044
+ for (const group of channelWorkspaceGroups) {
8045
+ daemonLog.info("channel worker group assigned", {
8046
+ workspace: group.workspaceCwd,
8047
+ channels: group.selection.mode === "all" ? ["all"] : group.selection.names
8048
+ });
8049
+ }
8050
+ if (opts.channelSelection?.mode === "all") {
8051
+ writeStderrLine(
8052
+ "qwen serve: --channel all is primary-workspace only; non-primary workspace channels are not hosted."
8053
+ );
8054
+ }
8055
+ }
8056
+ writeStdoutLine(
8057
+ `qwen serve listening on ${url} (mode=${opts.mode}, workspace=${boundWorkspace})`
8058
+ );
8059
+ writeStderrLine(
8060
+ `qwen serve: bound to workspace ${JSON.stringify(boundWorkspace)}`
8061
+ );
8062
+ writeStderrLine(
8063
+ `qwen serve: startup timing: processToListenMs=${startup.processToListenMs} runQwenServeToListenMs=${startup.runQwenServeToListenMs}`
8064
+ );
8065
+ if (!token) {
8066
+ writeStderrLine(
8067
+ `qwen serve: bearer auth disabled (loopback default). Set ${QWEN_SERVER_TOKEN_ENV} to enable.`
8068
+ );
8069
+ if (opts.clientMcpOverWs === true) {
8070
+ writeStderrLine(
8071
+ `qwen serve: client-hosted MCP tools are accepted over the WebSocket without auth. Set ${QWEN_SERVE_CLIENT_MCP_OVER_WS_ENV}=0 to disable.`
8072
+ );
8073
+ }
8074
+ } else if (opts.requireAuth) {
8075
+ writeStderrLine(
8076
+ "qwen serve: --require-auth enabled (bearer token mandatory on every route, including loopback /health)."
8077
+ );
8078
+ }
7898
8079
  process.on("SIGINT", onSignal);
7899
8080
  process.on("SIGTERM", onSignal);
7900
8081
  process.on("uncaughtExceptionMonitor", onUncaughtExceptionMonitor);
7901
- server.removeAllListeners("error");
7902
8082
  server.on("error", (err) => {
7903
8083
  daemonLog.error("server error", err instanceof Error ? err : null);
7904
8084
  });
@@ -7916,6 +8096,7 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
7916
8096
  } else {
7917
8097
  const acpHandle = preparedRuntimeApp.locals?.["acpHandle"];
7918
8098
  acpHandle?.attachServer?.(server);
8099
+ markServeAppStartupReady();
7919
8100
  void publishLiveDiscovery(preparedRuntimeApp);
7920
8101
  }
7921
8102
  } else if (deferRuntimeUntilFirstHealth) {
@@ -7949,7 +8130,7 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
7949
8130
  closeErr instanceof Error ? closeErr : null
7950
8131
  )
7951
8132
  );
7952
- if (closeErr instanceof Error && retryableChannelWorkerShutdownErrors.has(closeErr)) {
8133
+ if (hasRetryableChannelWorkerShutdownError(closeErr)) {
7953
8134
  writeDaemonLifecycleBestEffort(
7954
8135
  () => daemonLog.error(
7955
8136
  "runtime startup failed, but qwen serve remains alive to retain the channel service lease until worker exit is confirmed"
@@ -7965,10 +8146,9 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
7965
8146
  }
7966
8147
  }, "onListening");
7967
8148
  let server;
7968
- let httpsServer;
7969
8149
  if (tlsOptions) {
7970
8150
  try {
7971
- httpsServer = https.createServer(tlsOptions, app);
8151
+ server = https.createServer(tlsOptions, app);
7972
8152
  } catch (err) {
7973
8153
  reject(
7974
8154
  new Error(
@@ -7977,38 +8157,69 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
7977
8157
  );
7978
8158
  return;
7979
8159
  }
7980
- }
8160
+ } else {
8161
+ server = deps.httpServerFactory?.(app) ?? createServer(app);
8162
+ }
8163
+ serveAppLifecycle.bindServer(server, {
8164
+ startupReady: serveAppStartupReady,
8165
+ drainHost: /* @__PURE__ */ __name(() => {
8166
+ if (closeHost) return closeHost();
8167
+ if (!server.listening) return Promise.resolve();
8168
+ return new Promise((resolve4, rejectClose) => {
8169
+ server.close((error) => {
8170
+ if (error) rejectClose(error);
8171
+ else resolve4();
8172
+ });
8173
+ });
8174
+ }, "drainHost")
8175
+ });
7981
8176
  const tryListen = /* @__PURE__ */ __name((attemptPort, attempt) => {
7982
- try {
7983
- if (httpsServer) {
7984
- httpsServer.removeAllListeners("listening");
7985
- server = httpsServer.listen(attemptPort, listenHostname, onListening);
7986
- } else {
7987
- server = app.listen(attemptPort, listenHostname, onListening);
7988
- }
7989
- } catch (err) {
7990
- removeCurrentServePidfile();
7991
- reject(err instanceof Error ? err : new Error(String(err)));
7992
- return;
7993
- }
7994
- server.once("error", (err) => {
7995
- server.close();
8177
+ const handleListening = /* @__PURE__ */ __name(() => {
8178
+ server.removeListener("error", handleError);
8179
+ onListening();
8180
+ }, "handleListening");
8181
+ const handleError = /* @__PURE__ */ __name((err) => {
8182
+ server.removeListener("listening", handleListening);
7996
8183
  const nextPort = attemptPort + 1;
7997
- if (err.code === "EADDRINUSE" && opts.strictPort !== true && opts.port !== 0 && nextPort <= 65535 && attempt < MAX_PORT_ATTEMPTS - 1) {
8184
+ if (err.code === "EADDRINUSE" && opts.port !== 0 && nextPort <= 65535 && attempt < MAX_PORT_ATTEMPTS - 1) {
7998
8185
  writeStderrLine(
7999
8186
  `qwen serve: port ${attemptPort} is in use, trying ${nextPort}...`
8000
8187
  );
8001
8188
  tryListen(nextPort, attempt + 1);
8002
- } else {
8003
- if (err.code === "EADDRINUSE" && attempt > 0) {
8004
- writeStderrLine(
8005
- `qwen serve: all ports ${opts.port}\u2013${attemptPort} are in use`
8006
- );
8007
- }
8008
- removeCurrentServePidfile();
8009
- reject(err);
8189
+ return;
8010
8190
  }
8011
- });
8191
+ if (err.code === "EADDRINUSE" && attempt > 0) {
8192
+ writeStderrLine(
8193
+ `qwen serve: all ports ${opts.port}\u2013${attemptPort} are in use`
8194
+ );
8195
+ }
8196
+ removeCurrentServePidfile();
8197
+ markServeAppStartupFailed(err);
8198
+ void serveAppLifecycle.close().then(
8199
+ () => reject(err),
8200
+ (closeError) => reject(
8201
+ closeError instanceof Error ? new AggregateError([err, closeError], err.message) : err
8202
+ )
8203
+ );
8204
+ }, "handleError");
8205
+ try {
8206
+ server.once("listening", handleListening);
8207
+ server.once("error", handleError);
8208
+ server.listen(attemptPort, listenHostname);
8209
+ } catch (err) {
8210
+ removeCurrentServePidfile();
8211
+ server.removeListener("listening", handleListening);
8212
+ server.removeListener("error", handleError);
8213
+ const error = err instanceof Error ? err : new Error(String(err));
8214
+ markServeAppStartupFailed(error);
8215
+ void serveAppLifecycle.close().then(
8216
+ () => reject(error),
8217
+ (closeError) => reject(
8218
+ closeError instanceof Error ? new AggregateError([error, closeError], error.message) : error
8219
+ )
8220
+ );
8221
+ return;
8222
+ }
8012
8223
  }, "tryListen");
8013
8224
  tryListen(opts.port, 0);
8014
8225
  });