@qwen-code/qwen-code 0.21.12-preview.5 → 0.21.13

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 (347) hide show
  1. package/bundled/qc-helper/docs/configuration/settings.md +7 -5
  2. package/bundled/qc-helper/docs/features/channels/overview.md +1 -1
  3. package/bundled/qc-helper/docs/features/channels/plugins.md +11 -11
  4. package/bundled/qc-helper/docs/features/code-review.md +13 -12
  5. package/bundled/qc-helper/docs/qwen-serve.md +65 -0
  6. package/bundled/review/SKILL.md +96 -68
  7. package/chunks/{MaxSizedBox-6STELMXN.js → MaxSizedBox-UQALOVVT.js} +46 -46
  8. package/chunks/{StandaloneSessionPicker-LXMGCAIF.js → StandaloneSessionPicker-KEGXNUG6.js} +68 -69
  9. package/chunks/{acp-startup-profiler-TVI2OVUN.js → acp-startup-profiler-NMDXYGDN.js} +2 -2
  10. package/chunks/{acpAgent-NFRP4O5A.js → acpAgent-XPES32S7.js} +804 -380
  11. package/chunks/{agent-4AGYD6I6.js → agent-DPTOZFEM.js} +42 -42
  12. package/chunks/{agent-headless-GH4UIDXU.js → agent-headless-GJCQMURW.js} +42 -42
  13. package/chunks/{anthropicContentGenerator-ZBBX5VMY.js → anthropicContentGenerator-G7BVXTKN.js} +25 -25
  14. package/chunks/{artifact-tool-RWJAKYBZ.js → artifact-tool-GEXTOPVO.js} +5 -5
  15. package/chunks/{askUserQuestion-IQCA2SOX.js → askUserQuestion-B33XRSB7.js} +2 -2
  16. package/chunks/{bridge-3S4SKXSQ.js → bridge-YNQBAA4Z.js} +48 -48
  17. package/chunks/{build-RZS65IIX.js → build-GDBLPA24.js} +1 -1
  18. package/chunks/{channel-management-service-5ZYX4ROW.js → channel-management-service-GWY2GAIC.js} +4 -4
  19. package/chunks/{channel-settings-store-62E3TWVK.js → channel-settings-store-WNWYFHG7.js} +49 -49
  20. package/chunks/{channel-worker-group-QFJKXO7R.js → channel-worker-group-7LXCMZ77.js} +6 -6
  21. package/chunks/{channel-worker-manager-PWD2UURZ.js → channel-worker-manager-RYEME4ZZ.js} +6 -6
  22. package/chunks/{channel-worker-supervisor-XQJBGFCM.js → channel-worker-supervisor-OEVWBHGT.js} +4 -4
  23. package/chunks/{chunk-LHOG4E6Y.js → chunk-22C7BQ6D.js} +3 -3
  24. package/chunks/{chunk-KTWUFHS4.js → chunk-25EYDK42.js} +3 -3
  25. package/chunks/{chunk-QEWAHAW2.js → chunk-2B2BF7P7.js} +3 -3
  26. package/chunks/{chunk-2SB4SLKC.js → chunk-2IIJTXYF.js} +1 -3
  27. package/chunks/{chunk-6LDLDK6E.js → chunk-2M55OBEB.js} +1 -3
  28. package/chunks/{chunk-V3NMFQD2.js → chunk-3EZLLVDF.js} +2 -2
  29. package/chunks/{chunk-HUDUANHL.js → chunk-3U3VAL47.js} +1 -1
  30. package/chunks/{chunk-BKHCW2BI.js → chunk-3VUENPWF.js} +10 -0
  31. package/chunks/{chunk-XY7DGTIC.js → chunk-45NQKMYB.js} +1 -1
  32. package/chunks/{chunk-VGGNHRYZ.js → chunk-4PKCUT7F.js} +7 -7
  33. package/chunks/{chunk-T7YMWGFY.js → chunk-4S5337WV.js} +1491 -711
  34. package/chunks/{chunk-FVHLDSQS.js → chunk-4W5U2TUT.js} +3 -3
  35. package/chunks/{chunk-6SU6OW5Z.js → chunk-5CVO7YES.js} +1 -1
  36. package/chunks/{chunk-OZTGLK53.js → chunk-5EYKMUUY.js} +1 -1
  37. package/chunks/{chunk-ZRT36RSF.js → chunk-6HY6IF3Z.js} +1 -1
  38. package/chunks/{chunk-HRAFAUM7.js → chunk-6ORZ2EDC.js} +3 -3
  39. package/chunks/{chunk-JOVJCXN4.js → chunk-6QFDQMQX.js} +1 -1
  40. package/chunks/{chunk-CPTIJGUK.js → chunk-6YKYPVDV.js} +4 -4
  41. package/chunks/{chunk-62OKKUOX.js → chunk-76J3IJ3M.js} +9 -7
  42. package/chunks/{chunk-JVY7FHUZ.js → chunk-7U5G6JXI.js} +9 -0
  43. package/chunks/{chunk-TIM7NVEO.js → chunk-7UXUJ5T3.js} +1 -1
  44. package/chunks/{chunk-YCGXJ4Q3.js → chunk-A267JX7H.js} +6 -6
  45. package/chunks/{chunk-4JS2QK7P.js → chunk-A4MFR4C5.js} +1 -1
  46. package/chunks/{chunk-TN3REXN4.js → chunk-A4QRWUDE.js} +79 -36
  47. package/chunks/{chunk-JW5UEE3V.js → chunk-A6NRNRKE.js} +1 -1
  48. package/chunks/{chunk-T4G33L3W.js → chunk-AA2BEKV3.js} +3 -3
  49. package/chunks/{chunk-M3DWLXEO.js → chunk-AFSG32D5.js} +1 -1
  50. package/chunks/{chunk-R4YAQULI.js → chunk-AS5IN4GK.js} +5 -5
  51. package/chunks/{chunk-ADJDLEVO.js → chunk-AW27A43Y.js} +9 -11
  52. package/chunks/{chunk-RIDUB2GC.js → chunk-AW4TRXOC.js} +1 -1
  53. package/chunks/{chunk-XL6GYJL2.js → chunk-AXN7UPYQ.js} +2 -2
  54. package/chunks/{chunk-M4NWDIFU.js → chunk-AZQ3DT76.js} +1 -1
  55. package/chunks/{chunk-OSA2TFDI.js → chunk-BHILXOC3.js} +3 -3
  56. package/chunks/{chunk-YMIQ24FR.js → chunk-BKPPWD33.js} +2 -2
  57. package/chunks/{chunk-YMB77M76.js → chunk-BUQDLC2G.js} +59 -0
  58. package/chunks/{chunk-DXXYMK2U.js → chunk-BVJS5BSP.js} +1 -1
  59. package/chunks/{chunk-EGB2PIYM.js → chunk-BZ263IKX.js} +1 -1
  60. package/chunks/{chunk-6OJDN5ZT.js → chunk-CHHABXPE.js} +1 -1
  61. package/chunks/{chunk-ZPZANKVP.js → chunk-CKSJECTU.js} +4 -4
  62. package/chunks/{chunk-H6BFLALJ.js → chunk-CPHEPGAO.js} +1 -1
  63. package/chunks/{chunk-V6PERRH4.js → chunk-CU6GJD55.js} +1 -1
  64. package/chunks/{chunk-ZZ7RUTJ4.js → chunk-CZBYX5MY.js} +1 -1
  65. package/chunks/{chunk-2OFDCPMS.js → chunk-DGK6P3BQ.js} +13 -13
  66. package/chunks/{chunk-NM33GGOM.js → chunk-DGZEMW5R.js} +3 -3
  67. package/chunks/{chunk-UPUAGRKY.js → chunk-DXIBNLBZ.js} +2 -4
  68. package/chunks/{chunk-J5SUM3ZJ.js → chunk-E23IPNGS.js} +25 -2
  69. package/chunks/{chunk-TNETSI2A.js → chunk-E3DYKPYZ.js} +3 -3
  70. package/chunks/{chunk-3MJ44LNC.js → chunk-EL5SXY3T.js} +265 -138
  71. package/chunks/{chunk-AFKOAHC3.js → chunk-EZ5RP345.js} +13 -11
  72. package/chunks/{chunk-PSTHNTHF.js → chunk-FAAUPSY2.js} +1 -1
  73. package/chunks/{chunk-NW7SPXVG.js → chunk-FDGGZIYW.js} +1 -1
  74. package/chunks/{chunk-6YSSQFHQ.js → chunk-GGDBMYGZ.js} +5 -5
  75. package/chunks/{chunk-CDDLHCC2.js → chunk-GMIEIY3Y.js} +5 -5
  76. package/chunks/{chunk-6JFPUJ2O.js → chunk-GO7STP6N.js} +4 -4
  77. package/chunks/{chunk-7JL5YBSA.js → chunk-H4A72DE5.js} +1 -1
  78. package/chunks/{chunk-I3UEXUWJ.js → chunk-HUTNYWBG.js} +2 -2
  79. package/chunks/{chunk-UQPLUR4A.js → chunk-IA2K2HJE.js} +2 -2
  80. package/chunks/{chunk-Q7VJUIIB.js → chunk-IGGGG5CX.js} +4104 -1293
  81. package/chunks/{chunk-VE2UV7IN.js → chunk-IWPYVAO2.js} +4 -4
  82. package/chunks/{chunk-HAR4G5K2.js → chunk-JNDY2MDR.js} +2 -2
  83. package/chunks/{chunk-UALXTL5Y.js → chunk-JOOFMXGF.js} +6 -6
  84. package/chunks/{chunk-HOXEJHJQ.js → chunk-JUEPY766.js} +3 -3
  85. package/chunks/{chunk-Q7YDKOGY.js → chunk-JVEGA3MM.js} +1 -1
  86. package/chunks/{chunk-QBJYSIQ4.js → chunk-K3LPAED5.js} +53 -12
  87. package/chunks/{chunk-UHF5VBKO.js → chunk-KBXKR5R2.js} +1 -1
  88. package/chunks/{chunk-32SNBMNP.js → chunk-KD5BOPLP.js} +27 -27
  89. package/chunks/{chunk-67F2BEYW.js → chunk-KV27IEHM.js} +1 -1
  90. package/chunks/{chunk-DLDVO2NY.js → chunk-LJQAUZMR.js} +360 -174
  91. package/chunks/{chunk-BNRIQWXW.js → chunk-M732YJPW.js} +7 -7
  92. package/chunks/{chunk-JRTJEGSP.js → chunk-MA2HEDVP.js} +1 -1
  93. package/chunks/{chunk-5IW3FJGD.js → chunk-MC4TLKEI.js} +2 -2
  94. package/chunks/{chunk-2ASWIM4A.js → chunk-MIPFDQAF.js} +1 -1
  95. package/chunks/{chunk-6GTKI2YX.js → chunk-MLPXSYXR.js} +133 -28
  96. package/chunks/{chunk-KRXPRVGL.js → chunk-MLXTMF7H.js} +0 -1
  97. package/chunks/{chunk-NNGCKJAD.js → chunk-MRMJCLIY.js} +3 -3
  98. package/chunks/{chunk-E7XJWIWC.js → chunk-N5YPT6PH.js} +7 -7
  99. package/chunks/{chunk-72SKJ3E7.js → chunk-NEFOOD54.js} +3 -3
  100. package/chunks/{chunk-2U3UCXZ3.js → chunk-NHDR76JX.js} +45 -13
  101. package/chunks/{chunk-QLFTWYTO.js → chunk-NM5V5OVW.js} +3 -3
  102. package/chunks/{chunk-N4LVA3S6.js → chunk-NNHNLJ2X.js} +840 -60
  103. package/chunks/chunk-NYWWQ437.js +24 -0
  104. package/chunks/{chunk-DGNQ5AFX.js → chunk-O4D7SPJN.js} +2 -2
  105. package/chunks/{chunk-YY23TR4M.js → chunk-O565M6A4.js} +411 -10
  106. package/chunks/{chunk-VUTOV2HG.js → chunk-OD2WU5QY.js} +4 -3
  107. package/chunks/{chunk-B66LYK4B.js → chunk-OMLJNPBE.js} +42 -12
  108. package/chunks/{chunk-WAF6AR5Y.js → chunk-OOQUVWIG.js} +4 -4
  109. package/chunks/{chunk-A6GQUQ7I.js → chunk-OVZPVYZB.js} +2 -2
  110. package/chunks/{chunk-VPZMLGD3.js → chunk-OXCMMLED.js} +5 -5
  111. package/chunks/{chunk-646ZB2TS.js → chunk-OY5RNSV4.js} +3 -3
  112. package/chunks/{chunk-V7RNNPGC.js → chunk-P5Y23G2L.js} +18 -1
  113. package/chunks/{chunk-O6SLWH4X.js → chunk-P7MPQI75.js} +2 -2
  114. package/chunks/{chunk-3HXLH5QV.js → chunk-PP4FUZNV.js} +47 -4
  115. package/chunks/{chunk-4XX2LZ3E.js → chunk-PQ36L4F5.js} +1 -1
  116. package/chunks/{chunk-SKRHR6N2.js → chunk-PT4I7NBA.js} +1 -1
  117. package/chunks/{chunk-KQLW7LLV.js → chunk-QF2NHSPB.js} +603 -66
  118. package/chunks/{chunk-KK3FEHPJ.js → chunk-QFJ5JHQR.js} +1 -1
  119. package/chunks/{chunk-N2G4RA77.js → chunk-QIH2HAEN.js} +1 -1
  120. package/chunks/{chunk-QSWDGAIC.js → chunk-QILD6R27.js} +1 -1
  121. package/chunks/{chunk-NHZF4VCD.js → chunk-QNQAPSN2.js} +1 -1
  122. package/chunks/{chunk-6DH5YA3X.js → chunk-QRCNA3SR.js} +8 -8
  123. package/chunks/{chunk-3RC5Q66G.js → chunk-QV5YN5YD.js} +7 -5
  124. package/chunks/{chunk-7TKNMQ6L.js → chunk-RIAABG2K.js} +2 -2
  125. package/chunks/{chunk-LYRA6ZTI.js → chunk-RLKC46YT.js} +138 -11
  126. package/chunks/{chunk-YI5G32RU.js → chunk-ROIYNTHJ.js} +3 -3
  127. package/chunks/{chunk-UAAWNTOC.js → chunk-RVOJ2FBP.js} +12 -12
  128. package/chunks/{chunk-SNHBRO4C.js → chunk-RWDNJBWN.js} +2 -2
  129. package/chunks/{chunk-UFHPAMAV.js → chunk-S5DWMTHO.js} +11 -1
  130. package/chunks/{chunk-TROB4PZY.js → chunk-SG7ZP5PG.js} +4 -4
  131. package/chunks/{chunk-E74YSVIN.js → chunk-SXCOEJO4.js} +1 -1
  132. package/chunks/{chunk-U5C2GIN2.js → chunk-TIGA2IVL.js} +117 -3
  133. package/chunks/chunk-TS6625XH.js +488 -0
  134. package/chunks/{chunk-EHXS5MAC.js → chunk-TUGSVUJB.js} +7 -7
  135. package/chunks/{chunk-E3GLDLYB.js → chunk-TYAMGABM.js} +0 -6
  136. package/chunks/{chunk-ZLX7FTZQ.js → chunk-U3VNBPUO.js} +3 -3
  137. package/chunks/{chunk-F7PTQFTB.js → chunk-UKMR3CKV.js} +4 -4
  138. package/chunks/{chunk-7WUMS2UA.js → chunk-UPDOZBWO.js} +1 -1
  139. package/chunks/{chunk-YK4O72LT.js → chunk-UZPM4XHR.js} +4 -4
  140. package/chunks/{chunk-VKEA37IR.js → chunk-V26NVGAU.js} +1 -1
  141. package/chunks/{chunk-IJCZP2MA.js → chunk-V57QC6WW.js} +3 -3
  142. package/chunks/{chunk-LSMCI42W.js → chunk-WFSTRPRO.js} +3 -3
  143. package/chunks/{chunk-5KZNWF2M.js → chunk-WGHHA7ZH.js} +1 -1
  144. package/chunks/{chunk-A4BAHMJF.js → chunk-WSH6GRKG.js} +4 -4
  145. package/chunks/{chunk-OK727E5D.js → chunk-X26JYGTD.js} +1 -1
  146. package/chunks/{chunk-VAPNUDD5.js → chunk-XHRY7BXD.js} +4 -4
  147. package/chunks/{chunk-XNL23MGG.js → chunk-XIT3GURH.js} +3 -3
  148. package/chunks/{chunk-2RTRFLWH.js → chunk-XLLKYULU.js} +6 -6
  149. package/chunks/{chunk-C2DR57L6.js → chunk-XUJNK7Y6.js} +1 -1
  150. package/chunks/{chunk-AAZWJAPQ.js → chunk-Y3YCSWG5.js} +2 -2
  151. package/chunks/{chunk-ZTBFA7I6.js → chunk-YEYY7TEP.js} +7 -7
  152. package/chunks/{chunk-FTGU6G45.js → chunk-YZHRN3CF.js} +2 -2
  153. package/chunks/{chunk-2N6CV4PW.js → chunk-YZOSNW4R.js} +1 -1
  154. package/chunks/{chunk-U7ROFHSH.js → chunk-ZLCT4C5A.js} +1 -1
  155. package/chunks/{chunk-VBKTP7TH.js → chunk-ZYBBISBY.js} +15 -34
  156. package/chunks/{chunk-7ATQGA6V.js → chunk-ZYYTZUI2.js} +6 -6
  157. package/chunks/{chunk-RXX5T3IF.js → chunk-ZZO74WKW.js} +44 -8
  158. package/chunks/{computer-use-ZFBJYSR3.js → computer-use-77C5FHMW.js} +45 -45
  159. package/chunks/{config-utils-7JZQN6L2.js → config-utils-IVHRSXWI.js} +4 -4
  160. package/chunks/{contextCommand-G3TAIY7T.js → contextCommand-PJ77GBWL.js} +44 -44
  161. package/chunks/{core-runtime-K3MQVNSF.js → core-runtime-7VMIKUTG.js} +42 -42
  162. package/chunks/{create-sub-session-DMTLJPDG.js → create-sub-session-2L5MQRN4.js} +42 -42
  163. package/chunks/{create-sub-session-23ULO5PO.js → create-sub-session-KRQULJE6.js} +2 -2
  164. package/chunks/{cron-create-5WUTNKNF.js → cron-create-H7UEPDSN.js} +4 -4
  165. package/chunks/{cron-delete-JEQ27YPS.js → cron-delete-6SZK7YFM.js} +4 -4
  166. package/chunks/{cron-list-IXGCA7UR.js → cron-list-H25JIHEZ.js} +4 -4
  167. package/chunks/{daemon-UBVOQMWY.js → daemon-2KTG7ZBN.js} +108 -9
  168. package/chunks/daemon-git-worktree-guard-DXYIMWFT.js +2062 -0
  169. package/chunks/{daemon-status-provider-KFLEZGD7.js → daemon-status-provider-ZDOYJCU6.js} +52 -53
  170. package/chunks/{daemon-trust-policy-ZZ6DRDAC.js → daemon-trust-policy-E67OYUK2.js} +48 -48
  171. package/chunks/{daemon-trust-policy-monitor-CIKHNV2K.js → daemon-trust-policy-monitor-RYYGCQ3J.js} +48 -48
  172. package/chunks/{deferred-core-runtime-MM7X7UYR.js → deferred-core-runtime-3SGXFXEQ.js} +44 -44
  173. package/chunks/{devtools-X6ROTKHE.js → devtools-4QFYJT6U.js} +1 -1
  174. package/chunks/discovery-ORA5J7YP.js +27 -0
  175. package/chunks/{display-image-CAD7RAUM.js → display-image-ON3EYFRD.js} +4 -4
  176. package/chunks/{dist-B3ODKYEB.js → dist-4ZPG4BY6.js} +2 -2
  177. package/chunks/{dist-CCUH2Z4C.js → dist-BROOP2EG.js} +1 -1
  178. package/chunks/{dist-DANKRAB3.js → dist-IYYN3RUT.js} +2 -2
  179. package/chunks/{dist-5VDE7U3A.js → dist-JWMKPWT5.js} +3 -1
  180. package/chunks/{dist-6RK4U6VU.js → dist-K7IQB53U.js} +1 -1
  181. package/chunks/{dist-EZHCZSW6.js → dist-MAQXAQ2Y.js} +1 -1
  182. package/chunks/{dist-362MN6CP.js → dist-WJ4BHIEW.js} +2 -2
  183. package/chunks/{dist-M3XMEIP2.js → dist-YEPL4RAW.js} +1 -1
  184. package/chunks/{earlyInputCapture-O77TUBIF.js → earlyInputCapture-KJMLFVQV.js} +43 -43
  185. package/chunks/{edit-CZ23AVP6.js → edit-I4LQFAEC.js} +50 -49
  186. package/chunks/{enter-worktree-4EMS7IRL.js → enter-worktree-YNPOJSRH.js} +47 -47
  187. package/chunks/{enterPlanMode-TS6KO6DU.js → enterPlanMode-XCPK62ER.js} +47 -47
  188. package/chunks/{environment-7JAXEU6I.js → environment-S7CTIHMX.js} +44 -44
  189. package/chunks/{errors-NBABPF4S.js → errors-7HB2AIDS.js} +44 -44
  190. package/chunks/{exit-worktree-Q3NFHYUI.js → exit-worktree-AIIY7SR6.js} +47 -47
  191. package/chunks/{exitPlanMode-4JH6WLKL.js → exitPlanMode-R4JY7V2O.js} +42 -42
  192. package/chunks/{external-tool-guard-provider-5HTGOPGU.js → external-tool-guard-provider-TE4DRY36.js} +1 -1
  193. package/chunks/{fast-path-5LFDLPHJ.js → fast-path-NDJV3ZFJ.js} +3 -3
  194. package/chunks/{gemini-MB4S7YLN.js → gemini-RSUFP5OE.js} +108 -103
  195. package/chunks/{geminiContentGenerator-EQY2QU7K.js → geminiContentGenerator-SQ5XBPZ7.js} +11 -11
  196. package/chunks/{glob-LA5XO2H7.js → glob-J4RUJAHX.js} +49 -49
  197. package/chunks/{goal-tools-LQFO4BRY.js → goal-tools-VHTNVOKK.js} +56 -12
  198. package/chunks/{grep-KYBZMY36.js → grep-VJWPLFOT.js} +47 -47
  199. package/chunks/{handleAutoUpdate-HZJSAUNC.js → handleAutoUpdate-POCX2MNB.js} +46 -46
  200. package/chunks/{i18n-BSCIN4J4.js → i18n-RM5YOICI.js} +43 -43
  201. package/chunks/{image-gen-HGURQAHX.js → image-gen-EXECB5XM.js} +11 -11
  202. package/chunks/{initializer-WUHJXIB3.js → initializer-Z2AFGBNR.js} +49 -49
  203. package/chunks/{installationInfo-G3PDBWG2.js → installationInfo-4I5FXNMH.js} +43 -43
  204. package/chunks/{keychain-token-storage-GU75J2T2.js → keychain-token-storage-3XFJ5ZB2.js} +2 -2
  205. package/chunks/{list-IC7KDSZ6.js → list-ZMBFIGZA.js} +51 -51
  206. package/chunks/{list-agents-5PNMK2AM.js → list-agents-OSVDFI6S.js} +2 -2
  207. package/chunks/{loadedSettingsAdapter-Z3GOJRI7.js → loadedSettingsAdapter-T6TV4YJ7.js} +48 -48
  208. package/chunks/{loggingContentGenerator-E2QENFPH.js → loggingContentGenerator-WF4ZOJEZ.js} +99 -66
  209. package/chunks/{loop-wakeup-OV65FEGR.js → loop-wakeup-WQS6JYAG.js} +5 -5
  210. package/chunks/{ls-RPRSX26R.js → ls-D3HUFHDP.js} +6 -6
  211. package/chunks/{lsp-IWTJWFLT.js → lsp-3QDDJTCS.js} +2 -2
  212. package/chunks/{managed-npm-update-MX2OPCW4.js → managed-npm-update-E7IW6N7V.js} +43 -43
  213. package/chunks/{mcp-QQEWPNWV.js → mcp-6UNYX4HG.js} +48 -48
  214. package/chunks/{monitor-SV64FNV3.js → monitor-EE2UYMGE.js} +47 -47
  215. package/chunks/{node-YSOU44FX.js → node-UUDY34IG.js} +3 -3
  216. package/chunks/nonInteractiveCli-WAY237O4.js +163 -0
  217. package/chunks/{notebook-edit-QPYSWPRI.js → notebook-edit-NTDY4QDU.js} +47 -47
  218. package/chunks/{openaiContentGenerator-CMZXOSVA.js → openaiContentGenerator-YNFVJMRJ.js} +30 -30
  219. package/chunks/{pidfile-D5UXVVAI.js → pidfile-4XSFLYBZ.js} +43 -43
  220. package/chunks/{processUtils-ZEIMIVPX.js → processUtils-WDA2MJFD.js} +2 -2
  221. package/chunks/proper-lockfile-3LHWIM44.js +8 -0
  222. package/chunks/{qwenContentGenerator-JAXZKB7R.js → qwenContentGenerator-434M7QKY.js} +50 -50
  223. package/chunks/{qwenOAuth2-C2QWTD2G.js → qwenOAuth2-GMYZOO6A.js} +10 -10
  224. package/chunks/{read-file-2V5GE6ZW.js → read-file-TAFBKMNI.js} +11 -11
  225. package/chunks/{read-mcp-resource-THCSZHXO.js → read-mcp-resource-XD54ZQMC.js} +2 -2
  226. package/chunks/{record-artifact-76YYQA5F.js → record-artifact-SEYFJEJF.js} +3 -3
  227. package/chunks/{resumeHistoryUtils-UZ7GHPNY.js → resumeHistoryUtils-EVG3WYK2.js} +50 -50
  228. package/chunks/{ripGrep-MUTMPQSV.js → ripGrep-WOEK2PXS.js} +42 -42
  229. package/chunks/{run-qwen-serve-WU43JKEA.js → run-qwen-serve-3QSGRXAN.js} +417 -208
  230. package/chunks/{runtime-YLOFDP2P.js → runtime-5MLLZ7DC.js} +53 -53
  231. package/chunks/{scheduler-G44OPSZE.js → scheduler-RPBJ63CH.js} +44 -44
  232. package/chunks/{sdk-exporters-grpc-4QKV6MCX.js → sdk-exporters-grpc-54L4LS5L.js} +2 -2
  233. package/chunks/{sdk-exporters-http-A7XLKZO7.js → sdk-exporters-http-XUVP63H6.js} +12 -12
  234. package/chunks/{sdk-impl-XO4UF6PR.js → sdk-impl-YXUEN2Z2.js} +8 -8
  235. package/chunks/{send-message-P5SLP57G.js → send-message-VZENRWRH.js} +6 -6
  236. package/chunks/{serve-CZQDBDYV.js → serve-HS3XLPXU.js} +50 -50
  237. package/chunks/{server-HGI2KF3Y.js → server-TC4A7AAZ.js} +3850 -1630
  238. package/chunks/{session-OVMSHAO5.js → session-UBOFXVMN.js} +92 -95
  239. package/chunks/{settings-TWX6ROGP.js → settings-D5644OM5.js} +47 -47
  240. package/chunks/{shell-JDSWGVC7.js → shell-3PZULQQV.js} +42 -42
  241. package/chunks/{skill-QILHTMYJ.js → skill-PEVVXQ3L.js} +22 -22
  242. package/chunks/{skill-settings-RKRD34RZ.js → skill-settings-J65JKKES.js} +47 -47
  243. package/chunks/{spawnChannel-V5PYSDEI.js → spawnChannel-IYGXRHSQ.js} +45 -47
  244. package/chunks/{standalone-update-Y52CWCGG.js → standalone-update-IFM53PE7.js} +44 -44
  245. package/chunks/{startInteractiveUI-RVA62ZM6.js → startInteractiveUI-3AVH7L6H.js} +3340 -2460
  246. package/chunks/{syntheticOutput-SEW4NA47.js → syntheticOutput-7GWFIDXT.js} +3 -3
  247. package/chunks/{task-create-247EAVF7.js → task-create-FCBDX7UH.js} +12 -12
  248. package/chunks/{task-list-ZJN4QHLK.js → task-list-YIYIUFUA.js} +6 -6
  249. package/chunks/{task-stop-MAYQJ42I.js → task-stop-X37KYTKB.js} +2 -2
  250. package/chunks/{task-update-SU5TMZGG.js → task-update-MYPFVOVM.js} +12 -12
  251. package/chunks/{team-create-YMWUDIE3.js → team-create-ZAIA7KAV.js} +47 -47
  252. package/chunks/{team-delete-3XVRPQBP.js → team-delete-6UMU4XLS.js} +6 -6
  253. package/chunks/{team-plan-approval-3GPZAW46.js → team-plan-approval-UNIUS7OD.js} +47 -47
  254. package/chunks/{terminal-image-renderer-UGQKWDM3.js → terminal-image-renderer-G343P2RV.js} +44 -44
  255. package/chunks/{theme-manager-KRG4GGFY.js → theme-manager-Z3RIT7DB.js} +43 -43
  256. package/chunks/{todoWrite-IE2YTCK7.js → todoWrite-U2R4NVF4.js} +4 -4
  257. package/chunks/{tool-search-SZRO5G72.js → tool-search-5R2OE4C7.js} +17 -17
  258. package/chunks/{total-session-admission-JYHYOKWX.js → total-session-admission-4KBHMQQ2.js} +48 -48
  259. package/chunks/{trustedFolders-2BDCB5NJ.js → trustedFolders-LK6T4XC7.js} +43 -43
  260. package/chunks/{update-relaunch-XSYVPSDL.js → update-relaunch-UBKROIC6.js} +5 -5
  261. package/chunks/{updateCheck-SMMJ27GG.js → updateCheck-W4Y2GFSD.js} +45 -45
  262. package/chunks/{useAutoAcceptIndicator-HPG4UFIZ.js → useAutoAcceptIndicator-C7BEICBF.js} +51 -51
  263. package/chunks/{validateNonInterActiveAuth-IIL774NT.js → validateNonInterActiveAuth-LTEI2TB6.js} +84 -86
  264. package/chunks/{version-WSGAB2PA.js → version-G5A5DGVS.js} +1 -1
  265. package/chunks/{web-fetch-LKC2F5DM.js → web-fetch-RTEQTR5Z.js} +20 -20
  266. package/chunks/{web-search-BHMAMXEU.js → web-search-5OXHEZPV.js} +16 -16
  267. package/chunks/{workflow-A7AQ52HO.js → workflow-ISQJHPG2.js} +54 -53
  268. package/chunks/{workspace-providers-status-JRT57TLL.js → workspace-providers-status-2ZPZPUPZ.js} +51 -51
  269. package/chunks/{workspace-registration-store-EACJNCM5.js → workspace-registration-store-CYNY6IP6.js} +2 -2
  270. package/chunks/{workspace-registry-OV5SI4ES.js → workspace-registry-34GTUUHB.js} +50 -49
  271. package/chunks/{workspace-service-PUHU4EEK.js → workspace-service-XCDQLE2Y.js} +53 -53
  272. package/chunks/{workspace-skills-status-YAJE3UW3.js → workspace-skills-status-RS4O7AIJ.js} +49 -49
  273. package/chunks/{workspace-trust-reconciler-JP5UR2H6.js → workspace-trust-reconciler-AYGXC7A3.js} +57 -56
  274. package/chunks/{write-file-UBIHUP5M.js → write-file-EWXKVVXF.js} +42 -42
  275. package/chunks/{zoom-image-4QTKAMTP.js → zoom-image-4BFYJ3HG.js} +11 -11
  276. package/cli.js +18 -17
  277. package/package.json +3 -3
  278. package/web-shell/assets/{arc-lZ04kynw.js → arc-CgOpDKvm.js} +1 -1
  279. package/web-shell/assets/{architectureDiagram-3BPJPVTR-B1wZVhzD.js → architectureDiagram-3BPJPVTR-0Ag_m34F.js} +1 -1
  280. package/web-shell/assets/{blockDiagram-GPEHLZMM-CO0e0yJt.js → blockDiagram-GPEHLZMM-IwTwFau0.js} +1 -1
  281. package/web-shell/assets/{c4Diagram-AAUBKEIU-Dfpo6Qie.js → c4Diagram-AAUBKEIU-DLa5GUv8.js} +1 -1
  282. package/web-shell/assets/channel-BrGVBa2L.js +1 -0
  283. package/web-shell/assets/{chunk-2J33WTMH-BvxArftT.js → chunk-2J33WTMH-DcYP-WFG.js} +1 -1
  284. package/web-shell/assets/{chunk-4BX2VUAB-BS2XXjGY.js → chunk-4BX2VUAB-C8MVPMiQ.js} +1 -1
  285. package/web-shell/assets/{chunk-55IACEB6-CYL6h3Ph.js → chunk-55IACEB6-BUi4Yfv3.js} +1 -1
  286. package/web-shell/assets/{chunk-727SXJPM-C-cWPX30.js → chunk-727SXJPM-Cy3Su2YY.js} +1 -1
  287. package/web-shell/assets/{chunk-AQP2D5EJ-CJLxNbVV.js → chunk-AQP2D5EJ-Dp8Teqv6.js} +1 -1
  288. package/web-shell/assets/{chunk-FMBD7UC4-DwfzKywA.js → chunk-FMBD7UC4-BDTDM-4j.js} +1 -1
  289. package/web-shell/assets/{chunk-ND2GUHAM-BI5raYHQ.js → chunk-ND2GUHAM-7HfDt0r2.js} +1 -1
  290. package/web-shell/assets/{chunk-QZHKN3VN-_GkNI90J.js → chunk-QZHKN3VN-BIBU0uCF.js} +1 -1
  291. package/web-shell/assets/classDiagram-4FO5ZUOK-B5TUzJzI.js +1 -0
  292. package/web-shell/assets/classDiagram-v2-Q7XG4LA2-B5TUzJzI.js +1 -0
  293. package/web-shell/assets/{cose-bilkent-S5V4N54A-BAVLNxh9.js → cose-bilkent-S5V4N54A-DRLdcg9p.js} +1 -1
  294. package/web-shell/assets/{dagre-BM42HDAG-BD4XNLqp.js → dagre-BM42HDAG-DCCgDwqW.js} +1 -1
  295. package/web-shell/assets/{diagram-2AECGRRQ-WO567p8w.js → diagram-2AECGRRQ-CsBTBmk3.js} +1 -1
  296. package/web-shell/assets/{diagram-5GNKFQAL-mAk23VWO.js → diagram-5GNKFQAL-C9qjH8Lt.js} +1 -1
  297. package/web-shell/assets/{diagram-KO2AKTUF-YQEeHKze.js → diagram-KO2AKTUF-Brjs_lj2.js} +1 -1
  298. package/web-shell/assets/{diagram-LMA3HP47-CMVjxAjv.js → diagram-LMA3HP47-DtiWCl_F.js} +1 -1
  299. package/web-shell/assets/{diagram-OG6HWLK6-42hPvbM-.js → diagram-OG6HWLK6-DmfKLkBT.js} +1 -1
  300. package/web-shell/assets/{erDiagram-TEJ5UH35-CXU_cPfu.js → erDiagram-TEJ5UH35-Bve_4deH.js} +1 -1
  301. package/web-shell/assets/{flowDiagram-I6XJVG4X-D-3TdhMT.js → flowDiagram-I6XJVG4X-C2_kXCcV.js} +1 -1
  302. package/web-shell/assets/{ganttDiagram-6RSMTGT7-CsgkXolz.js → ganttDiagram-6RSMTGT7-BSBIjiTF.js} +1 -1
  303. package/web-shell/assets/{gitGraphDiagram-PVQCEYII-B6Q3PBLD.js → gitGraphDiagram-PVQCEYII-CyebwI55.js} +1 -1
  304. package/web-shell/assets/index-CIDsgxTe.js +1792 -0
  305. package/web-shell/assets/index-DiQnWi_E.css +5 -0
  306. package/web-shell/assets/{index-BFrkGj2B.js → index-d0yfnV1M.js} +1 -1
  307. package/web-shell/assets/{infoDiagram-5YYISTIA-jiAfSXp8.js → infoDiagram-5YYISTIA-CSDGnWxU.js} +1 -1
  308. package/web-shell/assets/{ishikawaDiagram-YF4QCWOH-BWif5KeJ.js → ishikawaDiagram-YF4QCWOH-BK4jU13p.js} +1 -1
  309. package/web-shell/assets/{journeyDiagram-JHISSGLW-B-GAZthS.js → journeyDiagram-JHISSGLW-D_W6j-oF.js} +1 -1
  310. package/web-shell/assets/{kanban-definition-UN3LZRKU-9TEuATdL.js → kanban-definition-UN3LZRKU-C7xf-SdC.js} +1 -1
  311. package/web-shell/assets/{linear-dy_QPfyE.js → linear-DQmzxpxd.js} +1 -1
  312. package/web-shell/assets/{mermaid.core-DB2uLAnq.js → mermaid.core-9P7AGOLG.js} +5 -5
  313. package/web-shell/assets/{mindmap-definition-RKZ34NQL-ey_dyxi-.js → mindmap-definition-RKZ34NQL-DgcgMyPk.js} +1 -1
  314. package/web-shell/assets/{pieDiagram-4H26LBE5-_6BuMdDj.js → pieDiagram-4H26LBE5-3wWGb9eG.js} +1 -1
  315. package/web-shell/assets/{quadrantDiagram-W4KKPZXB-B2rM19W2.js → quadrantDiagram-W4KKPZXB-BeCXnQw9.js} +1 -1
  316. package/web-shell/assets/{requirementDiagram-4Y6WPE33-DWj8b7vW.js → requirementDiagram-4Y6WPE33-Bi1UOHDz.js} +1 -1
  317. package/web-shell/assets/{sankeyDiagram-5OEKKPKP-D5dtYh0N.js → sankeyDiagram-5OEKKPKP-lrLUjjbb.js} +1 -1
  318. package/web-shell/assets/{sequenceDiagram-3UESZ5HK-DVkdn_qW.js → sequenceDiagram-3UESZ5HK-BFuqKz6Q.js} +1 -1
  319. package/web-shell/assets/{stateDiagram-AJRCARHV-DgwD_fi6.js → stateDiagram-AJRCARHV-8DemQLhu.js} +1 -1
  320. package/web-shell/assets/stateDiagram-v2-BHNVJYJU-DhM5ixYd.js +1 -0
  321. package/web-shell/assets/{timeline-definition-PNZ67QCA-vNr_1UNX.js → timeline-definition-PNZ67QCA-uzEuVQXg.js} +1 -1
  322. package/web-shell/assets/{vennDiagram-CIIHVFJN-ChFcGAcu.js → vennDiagram-CIIHVFJN-BQTeZ_-o.js} +1 -1
  323. package/web-shell/assets/{wardley-L42UT6IY-C8PXoSWk.js → wardley-L42UT6IY-B6yM5Im7.js} +1 -1
  324. package/web-shell/assets/{wardleyDiagram-YWT4CUSO-C2nqOV6i.js → wardleyDiagram-YWT4CUSO-ChM8bmgn.js} +1 -1
  325. package/web-shell/assets/{xychartDiagram-2RQKCTM6-BntaqhSB.js → xychartDiagram-2RQKCTM6-oNG6HyB1.js} +1 -1
  326. package/web-shell/index.html +2 -2
  327. package/chunks/chunk-5PLOQW7H.js +0 -830
  328. package/chunks/chunk-DMODRHNL.js +0 -649
  329. package/chunks/chunk-L34XSHIZ.js +0 -28
  330. package/chunks/chunk-N2TNM3QB.js +0 -9
  331. package/chunks/chunk-RECPKBBD.js +0 -622
  332. package/chunks/chunk-WLML6VIA.js +0 -18
  333. package/chunks/chunk-ZBBVBZBR.js +0 -137
  334. package/chunks/chunk-bdqvmfwv-OHYAFAAO.js +0 -17446
  335. package/chunks/discovery-XLHITE74.js +0 -220
  336. package/chunks/dispatch-FW7DX2CR.js +0 -43
  337. package/chunks/nonInteractiveCli-3XFIFXBR.js +0 -166
  338. package/chunks/opentui-entry-TEHHLGN7.js +0 -52419
  339. package/chunks/runtime-gate-T4ICWGQJ.js +0 -89
  340. package/chunks/wrapper-46Z24CTM.js +0 -35
  341. package/web-shell/assets/channel-BxvRq3pV.js +0 -1
  342. package/web-shell/assets/classDiagram-4FO5ZUOK-tL8nAxYf.js +0 -1
  343. package/web-shell/assets/classDiagram-v2-Q7XG4LA2-tL8nAxYf.js +0 -1
  344. package/web-shell/assets/index-BgjULKyF.css +0 -5
  345. package/web-shell/assets/index-CxXlPYfl.js +0 -1789
  346. package/web-shell/assets/stateDiagram-v2-BHNVJYJU-BWGkVGVB.js +0 -1
  347. /package/chunks/{chunk-44CTCCLY.js → chunk-NWNEANAT.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-YY23TR4M.js";
39
+ } from "./chunk-O565M6A4.js";
38
40
  import "./chunk-VGHZT6JR.js";
39
41
  import {
40
42
  isLoopbackBind
@@ -44,6 +46,7 @@ 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";
@@ -62,7 +65,7 @@ import {
62
65
  } from "./chunk-GDXET5XU.js";
63
66
  import {
64
67
  resolveChannelCwd
65
- } from "./chunk-XY7DGTIC.js";
68
+ } from "./chunk-45NQKMYB.js";
66
69
  import {
67
70
  LIVE_HOST_PROTOCOL_VERSION
68
71
  } from "./chunk-NKLP3DCK.js";
@@ -78,17 +81,17 @@ import {
78
81
  MAX_REGISTERED_WORKSPACES,
79
82
  resolveWorkspaceInputs,
80
83
  workspaceRegistrationId
81
- } from "./chunk-HAR4G5K2.js";
82
- import "./chunk-T4G33L3W.js";
84
+ } from "./chunk-JNDY2MDR.js";
85
+ import "./chunk-AA2BEKV3.js";
83
86
  import {
84
87
  LOAD_REPLAY_META_KEY
85
- } from "./chunk-UFHPAMAV.js";
88
+ } from "./chunk-S5DWMTHO.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-FVHLDSQS.js";
94
+ import "./chunk-4W5U2TUT.js";
92
95
  import "./chunk-FYJ7W2PI.js";
93
96
  import "./chunk-Z7B6SRPM.js";
94
97
  import {
@@ -100,20 +103,22 @@ import {
100
103
  import {
101
104
  normalizeWorkerDiagnostic,
102
105
  sanitizeWorkerDiagnostic
103
- } from "./chunk-JW5UEE3V.js";
106
+ } from "./chunk-A6NRNRKE.js";
104
107
  import {
105
108
  channelSelectionNames
106
109
  } from "./chunk-ALMR3E6Q.js";
107
110
  import "./chunk-HIBNSEJE.js";
108
111
  import "./chunk-M5GB774H.js";
109
112
  import {
113
+ EXTERNAL_TOOL_GUARD_PROVIDER_ATTACHED_VALUE,
110
114
  EXTERNAL_TOOL_GUARD_REQUIRED_VALUE,
111
115
  EXTERNAL_TOOL_GUARD_TOKEN_ENV,
112
- PRIVATE_EXTERNAL_TOOL_GUARD_ENV
113
- } from "./chunk-BKHCW2BI.js";
116
+ PRIVATE_EXTERNAL_TOOL_GUARD_ENV,
117
+ PRIVATE_EXTERNAL_TOOL_GUARD_PROVIDER_ENV
118
+ } from "./chunk-3VUENPWF.js";
114
119
  import {
115
120
  sanitizeLogText
116
- } from "./chunk-ADJDLEVO.js";
121
+ } from "./chunk-AW27A43Y.js";
117
122
  import "./chunk-IW6RQPQB.js";
118
123
  import {
119
124
  MAX_DAEMON_WORKSPACES
@@ -131,7 +136,7 @@ import {
131
136
  } from "./chunk-MS7GNABG.js";
132
137
  import {
133
138
  getCliVersion
134
- } from "./chunk-V6PERRH4.js";
139
+ } from "./chunk-CU6GJD55.js";
135
140
  import "./chunk-WZMH7II3.js";
136
141
  import "./chunk-NPQ5ZKRP.js";
137
142
  import {
@@ -143,14 +148,14 @@ import "./chunk-TWPJO254.js";
143
148
  import "./chunk-CQ35AJ4Z.js";
144
149
  import {
145
150
  require_proper_lockfile
146
- } from "./chunk-KRXPRVGL.js";
151
+ } from "./chunk-MLXTMF7H.js";
147
152
  import "./chunk-CR3C7WXL.js";
148
153
  import "./chunk-XWRJCPHC.js";
149
154
  import {
150
155
  finalizeStartupProfile,
151
156
  profileCheckpoint
152
- } from "./chunk-QSWDGAIC.js";
153
- import "./chunk-Q7YDKOGY.js";
157
+ } from "./chunk-QILD6R27.js";
158
+ import "./chunk-JVEGA3MM.js";
154
159
  import {
155
160
  writeStderrLine,
156
161
  writeStdoutLine
@@ -176,6 +181,7 @@ init_esbuild_shims();
176
181
  var import_express = __toESM(require_express(), 1);
177
182
  import { X509Certificate, createHash as createHash3, timingSafeEqual } from "node:crypto";
178
183
  import * as fs from "node:fs";
184
+ import { createServer } from "node:http";
179
185
  import * as https from "node:https";
180
186
  import * as path from "node:path";
181
187
  import * as os from "node:os";
@@ -3022,15 +3028,22 @@ function withSettingsLock(workspace, fn) {
3022
3028
  }
3023
3029
  __name(withSettingsLock, "withSettingsLock");
3024
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");
3025
3038
  var channelWorkerRuntimePromise;
3026
3039
  async function loadChannelWorkerRuntime() {
3027
3040
  channelWorkerRuntimePromise ??= Promise.all([
3028
- import("./channel-worker-supervisor-XQJBGFCM.js"),
3029
- import("./pidfile-D5UXVVAI.js"),
3030
- import("./runtime-YLOFDP2P.js"),
3041
+ import("./channel-worker-supervisor-OEVWBHGT.js"),
3042
+ import("./pidfile-4XSFLYBZ.js"),
3043
+ import("./runtime-5MLLZ7DC.js"),
3031
3044
  import("./cli-entry-path-4VJ3Y6T2.js"),
3032
- import("./channel-worker-group-QFJKXO7R.js"),
3033
- import("./channel-worker-manager-PWD2UURZ.js")
3045
+ import("./channel-worker-group-7LXCMZ77.js"),
3046
+ import("./channel-worker-manager-RYEME4ZZ.js")
3034
3047
  ]).then(
3035
3048
  ([
3036
3049
  supervisor,
@@ -3135,13 +3148,13 @@ function shouldPreheatBridge(deps) {
3135
3148
  __name(shouldPreheatBridge, "shouldPreheatBridge");
3136
3149
  var coreRuntimePromise;
3137
3150
  function loadCoreRuntime() {
3138
- coreRuntimePromise ??= import("./core-runtime-K3MQVNSF.js");
3151
+ coreRuntimePromise ??= import("./core-runtime-7VMIKUTG.js");
3139
3152
  return coreRuntimePromise;
3140
3153
  }
3141
3154
  __name(loadCoreRuntime, "loadCoreRuntime");
3142
3155
  var liveDiscoveryRuntimePromise;
3143
3156
  function loadLiveDiscoveryRuntime() {
3144
- liveDiscoveryRuntimePromise ??= import("./discovery-XLHITE74.js");
3157
+ liveDiscoveryRuntimePromise ??= import("./discovery-ORA5J7YP.js");
3145
3158
  return liveDiscoveryRuntimePromise;
3146
3159
  }
3147
3160
  __name(loadLiveDiscoveryRuntime, "loadLiveDiscoveryRuntime");
@@ -3171,10 +3184,10 @@ __name(resolveDaemonLogBaseDirForRun, "resolveDaemonLogBaseDirForRun");
3171
3184
  var settingsRuntimePromise;
3172
3185
  function loadSettingsRuntimeModules() {
3173
3186
  settingsRuntimePromise ??= Promise.all([
3174
- import("./settings-TWX6ROGP.js"),
3175
- import("./environment-7JAXEU6I.js"),
3176
- import("./loadedSettingsAdapter-Z3GOJRI7.js"),
3177
- import("./trustedFolders-2BDCB5NJ.js")
3187
+ import("./settings-D5644OM5.js"),
3188
+ import("./environment-S7CTIHMX.js"),
3189
+ import("./loadedSettingsAdapter-T6TV4YJ7.js"),
3190
+ import("./trustedFolders-LK6T4XC7.js")
3178
3191
  ]).then(([settings, environment, loadedSettingsAdapter, trustedFolders]) => ({
3179
3192
  settings,
3180
3193
  environment,
@@ -3187,8 +3200,8 @@ __name(loadSettingsRuntimeModules, "loadSettingsRuntimeModules");
3187
3200
  var channelWebhookConfigRuntimePromise;
3188
3201
  function loadChannelWebhookConfigRuntime() {
3189
3202
  channelWebhookConfigRuntimePromise ??= Promise.all([
3190
- import("./runtime-YLOFDP2P.js"),
3191
- import("./config-utils-7JZQN6L2.js")
3203
+ import("./runtime-5MLLZ7DC.js"),
3204
+ import("./config-utils-IVHRSXWI.js")
3192
3205
  ]).then(([channelRuntime, configUtils]) => ({
3193
3206
  loadChannelsConfig: channelRuntime.loadChannelsConfig,
3194
3207
  parseChannelWebhookConfig: configUtils.parseChannelWebhookConfig
@@ -3213,17 +3226,17 @@ async function loadServeRuntimeModules() {
3213
3226
  totalSessionAdmissionModule,
3214
3227
  workspaceRegistryModule
3215
3228
  ] = await Promise.all([
3216
- import("./server-HGI2KF3Y.js"),
3217
- import("./bridge-3S4SKXSQ.js"),
3218
- import("./spawnChannel-V5PYSDEI.js"),
3229
+ import("./server-TC4A7AAZ.js"),
3230
+ import("./bridge-YNQBAA4Z.js"),
3231
+ import("./spawnChannel-IYGXRHSQ.js"),
3219
3232
  import("./process-registry-PMJOA5CO.js"),
3220
- import("./workspace-service-PUHU4EEK.js"),
3233
+ import("./workspace-service-XCDQLE2Y.js"),
3221
3234
  import("./types-WYCFCEHR.js"),
3222
- import("./daemon-status-provider-KFLEZGD7.js"),
3223
- import("./workspace-providers-status-JRT57TLL.js"),
3224
- import("./workspace-skills-status-YAJE3UW3.js"),
3225
- import("./total-session-admission-JYHYOKWX.js"),
3226
- import("./workspace-registry-OV5SI4ES.js")
3235
+ import("./daemon-status-provider-ZDOYJCU6.js"),
3236
+ import("./workspace-providers-status-2ZPZPUPZ.js"),
3237
+ import("./workspace-skills-status-RS4O7AIJ.js"),
3238
+ import("./total-session-admission-4KBHMQQ2.js"),
3239
+ import("./workspace-registry-34GTUUHB.js")
3227
3240
  ]);
3228
3241
  return {
3229
3242
  createServeApp: serverModule.createServeApp,
@@ -3615,6 +3628,11 @@ function createBootstrapServeApp(input) {
3615
3628
  channelIdleTimeoutMs: channelIdleTimeoutMs(opts.channelIdleTimeoutMs),
3616
3629
  sessionIdleTimeoutMs: sessionIdleTimeoutMs(opts.sessionIdleTimeoutMs),
3617
3630
  acpConnectionCap: null,
3631
+ acpPreAttachMaxFramesPerStream: null,
3632
+ acpPreAttachMaxFramesPerConnection: null,
3633
+ acpPreAttachMaxFramesGlobal: null,
3634
+ acpPreAttachMaxPayloadBytesPerConnection: null,
3635
+ acpPreAttachMaxPayloadBytesGlobal: null,
3618
3636
  // No child-heap policy during bootstrap: it is built with the
3619
3637
  // runtime, so `enforced` is correctly false and `childHeap` null in
3620
3638
  // this window even when the flag says `enforce`.
@@ -3658,7 +3676,17 @@ function createBootstrapServeApp(input) {
3658
3676
  sessionStreams: 0,
3659
3677
  sseStreams: 0,
3660
3678
  wsStreams: 0,
3661
- 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
+ }
3662
3690
  }
3663
3691
  },
3664
3692
  rateLimit: {
@@ -3681,6 +3709,7 @@ function createBootstrapServeApp(input) {
3681
3709
  ...detail.detail === "full" ? {
3682
3710
  full: {
3683
3711
  sessions: [],
3712
+ acpMounts: [],
3684
3713
  acpConnections: [],
3685
3714
  workspace: {},
3686
3715
  auth: {
@@ -4145,6 +4174,27 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
4145
4174
  );
4146
4175
  }
4147
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
+ }
4148
4198
  const workspaceInputs = rawWorkspaces.map((workspace) => ({
4149
4199
  raw: workspace,
4150
4200
  cwd: validateAndCanonicalizeWorkspace(workspace),
@@ -4213,9 +4263,19 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
4213
4263
  journalGrowthSessionLimitProviders.delete(provider);
4214
4264
  };
4215
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
+ }
4216
4276
  let workspaceRegistrationStore = deps.workspaceRegistrationStore;
4217
4277
  if (workspaceRegistrationStore === void 0 && process.env["QWEN_SERVE_NO_PERSISTENT_REGISTRATION"] !== "1") {
4218
- const { WorkspaceRegistrationStore } = await import("./workspace-registration-store-EACJNCM5.js");
4278
+ const { WorkspaceRegistrationStore } = await import("./workspace-registration-store-CYNY6IP6.js");
4219
4279
  workspaceRegistrationStore = new WorkspaceRegistrationStore(boundWorkspace);
4220
4280
  }
4221
4281
  if (workspaceRegistrationStore) {
@@ -4224,6 +4284,14 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
4224
4284
  for (const storedWorkspace of stored.workspaces) {
4225
4285
  const registrationId = workspaceRegistrationId(storedWorkspace);
4226
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
+ }
4227
4295
  let cwd;
4228
4296
  try {
4229
4297
  cwd = validateAndCanonicalizeWorkspace(storedWorkspace);
@@ -4235,6 +4303,14 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
4235
4303
  );
4236
4304
  continue;
4237
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
+ }
4238
4314
  const existingInput = workspaceInputs.find(
4239
4315
  (workspace) => workspace.cwd === cwd
4240
4316
  );
@@ -4471,7 +4547,7 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
4471
4547
  "Required external tool guarding cannot be combined with an injected bridge."
4472
4548
  );
4473
4549
  }
4474
- const { RequiredExternalToolGuard } = await import("./external-tool-guard-provider-5HTGOPGU.js");
4550
+ const { RequiredExternalToolGuard } = await import("./external-tool-guard-provider-TE4DRY36.js");
4475
4551
  const provider = new RequiredExternalToolGuard({
4476
4552
  endpoint: opts.externalToolGuard.endpoint,
4477
4553
  token: opts.externalToolGuard.token,
@@ -4483,11 +4559,16 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
4483
4559
  "qwen serve: required external tool guard handshake succeeded."
4484
4560
  );
4485
4561
  }
4562
+ const { createDaemonToolGuard } = await import("./daemon-git-worktree-guard-DXYIMWFT.js");
4563
+ const daemonToolGuardHandler = createDaemonToolGuard(
4564
+ externalToolGuardHandler
4565
+ );
4486
4566
  const childEnvOverrides = {
4487
4567
  QWEN_SERVE_MCP_CLIENT_BUDGET: opts.mcpClientBudget !== void 0 ? String(opts.mcpClientBudget) : void 0,
4488
4568
  QWEN_SERVE_MCP_BUDGET_MODE: opts.mcpBudgetMode,
4489
4569
  QWEN_SERVE_CDP_TUNNEL_OVER_WS: opts.cdpTunnelOverWs ? "1" : void 0,
4490
- [PRIVATE_EXTERNAL_TOOL_GUARD_ENV]: externalToolGuardHandler ? EXTERNAL_TOOL_GUARD_REQUIRED_VALUE : void 0
4570
+ [PRIVATE_EXTERNAL_TOOL_GUARD_ENV]: EXTERNAL_TOOL_GUARD_REQUIRED_VALUE,
4571
+ [PRIVATE_EXTERNAL_TOOL_GUARD_PROVIDER_ENV]: externalToolGuardHandler ? EXTERNAL_TOOL_GUARD_PROVIDER_ATTACHED_VALUE : void 0
4491
4572
  };
4492
4573
  const cliVersionPromise = getCliVersion();
4493
4574
  let cliVersion;
@@ -4514,6 +4595,28 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
4514
4595
  }
4515
4596
  }
4516
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");
4517
4620
  let runtimeApp;
4518
4621
  let runtimeAppForCleanup;
4519
4622
  let bridgeRef = deps.bridge;
@@ -4588,7 +4691,6 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
4588
4691
  };
4589
4692
  }, "resolveChannelWebhookConfigSource");
4590
4693
  let closeServerAfterChannelWorkerStartupFailure = false;
4591
- let runtimeFailureListenerClose;
4592
4694
  const getChannelWorkerSnapshot = /* @__PURE__ */ __name(() => channelWorkerManager?.primarySnapshot() ?? {
4593
4695
  enabled: false,
4594
4696
  state: "disabled",
@@ -4785,7 +4887,7 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
4785
4887
  loadCoreRuntime(),
4786
4888
  loadSettingsRuntimeModules(),
4787
4889
  cliVersionPromise,
4788
- import("./daemon-trust-policy-ZZ6DRDAC.js")
4890
+ import("./daemon-trust-policy-E67OYUK2.js")
4789
4891
  ]);
4790
4892
  cliVersion = resolvedCliVersion;
4791
4893
  settingsRuntime.environment.preResolveHomeEnvOverrides();
@@ -4808,7 +4910,6 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
4808
4910
  `qwen serve: managed scratch workspaces are unavailable: ${err instanceof Error ? err.message : String(err)}`
4809
4911
  );
4810
4912
  }
4811
- const liveConversationWorkspace = deps.liveConversationWorkspace ?? new ConversationWorkspace();
4812
4913
  let runtimeBootSettings;
4813
4914
  try {
4814
4915
  runtimeBootSettings = settingsRuntime.settings.loadSettings(
@@ -5158,7 +5259,7 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
5158
5259
  resolveSkillSettings,
5159
5260
  skillSettingStrings,
5160
5261
  updateWorkspaceSkillSettingLists
5161
- } = await import("./skill-settings-RKRD34RZ.js");
5262
+ } = await import("./skill-settings-J65JKKES.js");
5162
5263
  const fresh = loadSettingsForPersistence(workspace);
5163
5264
  const normalizedName = skillName.trim().toLowerCase();
5164
5265
  const resolved = resolveSkillSettings(fresh);
@@ -5223,7 +5324,7 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
5223
5324
  resolveSkillSettings,
5224
5325
  skillSettingStrings,
5225
5326
  updateWorkspaceSkillSettingLists
5226
- } = await import("./skill-settings-RKRD34RZ.js");
5327
+ } = await import("./skill-settings-J65JKKES.js");
5227
5328
  const fresh = loadSettingsForPersistence(workspace);
5228
5329
  const resolved = resolveSkillSettings(fresh);
5229
5330
  const initialDisabled = skillSettingStrings(
@@ -5328,7 +5429,7 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
5328
5429
  );
5329
5430
  }
5330
5431
  }), "persistSettingsFn");
5331
- const { createSubSessionLauncher } = await import("./create-sub-session-DMTLJPDG.js");
5432
+ const { createSubSessionLauncher } = await import("./create-sub-session-2L5MQRN4.js");
5332
5433
  const subSessionLauncher = createSubSessionLauncher({
5333
5434
  getBridge: /* @__PURE__ */ __name(() => bridgeRef, "getBridge"),
5334
5435
  boundWorkspace,
@@ -5376,7 +5477,7 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
5376
5477
  sessionShellCommandEnabled,
5377
5478
  childEnvOverrides,
5378
5479
  channelFactory,
5379
- ...externalToolGuardHandler ? { externalToolGuard: externalToolGuardHandler } : {},
5480
+ externalToolGuard: daemonToolGuardHandler,
5380
5481
  onDiagnosticLine: diagnosticSink,
5381
5482
  telemetry: daemonTelemetry,
5382
5483
  ...permissionPolicy !== void 0 ? { permissionPolicy } : {},
@@ -5689,7 +5790,7 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
5689
5790
  sessionShellCommandEnabled,
5690
5791
  childEnvOverrides,
5691
5792
  channelFactory: secondaryChannelFactory,
5692
- ...externalToolGuardHandler ? { externalToolGuard: externalToolGuardHandler } : {},
5793
+ externalToolGuard: daemonToolGuardHandler,
5693
5794
  onDiagnosticLine: diagnosticSink,
5694
5795
  telemetry: createRuntimeBridgeTelemetry(secondaryWorkspaceHash),
5695
5796
  ...permissionPolicy !== void 0 ? { permissionPolicy } : {},
@@ -5838,7 +5939,7 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
5838
5939
  workspaceRegistryForPersistence.current = workspaceRegistry;
5839
5940
  const workspaceVoiceCoordinator = new WorkspaceVoiceCoordinator();
5840
5941
  core.registerDaemonGaugeCallbacks({
5841
- sessionCount: /* @__PURE__ */ __name(() => workspaceRegistry.list().reduce((sum, item) => sum + item.bridge.sessionCount, 0), "sessionCount"),
5942
+ sessionCount: /* @__PURE__ */ __name(() => workspaceRegistry.listAll().reduce((sum, item) => sum + item.bridge.sessionCount, 0), "sessionCount"),
5842
5943
  sseCount: /* @__PURE__ */ __name(() => runtime.getActiveSseCount(), "sseCount"),
5843
5944
  heapUsed: /* @__PURE__ */ __name(() => process.memoryUsage().heapUsed, "heapUsed")
5844
5945
  });
@@ -5887,12 +5988,12 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
5887
5988
  cpuPercent,
5888
5989
  rssBytes: mem.rss,
5889
5990
  heapUsedBytes: mem.heapUsed,
5890
- activeSessions: workspaceRegistry.list().reduce((sum, item) => sum + item.bridge.sessionCount, 0),
5891
- activePrompts: workspaceRegistry.list().reduce(
5991
+ activeSessions: workspaceRegistry.listAll().reduce((sum, item) => sum + item.bridge.sessionCount, 0),
5992
+ activePrompts: workspaceRegistry.listAll().reduce(
5892
5993
  (sum, item) => sum + (item.bridge.activePromptCount ?? 0),
5893
5994
  0
5894
5995
  ),
5895
- queuedPrompts: workspaceRegistry.list().reduce(
5996
+ queuedPrompts: workspaceRegistry.listAll().reduce(
5896
5997
  (sum, item) => sum + (item.bridge.pendingPromptTotal ?? 0),
5897
5998
  0
5898
5999
  ),
@@ -6059,7 +6160,7 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
6059
6160
  sessionShellCommandEnabled,
6060
6161
  childEnvOverrides,
6061
6162
  channelFactory: wsChannelFactory,
6062
- ...externalToolGuardHandler ? { externalToolGuard: externalToolGuardHandler } : {},
6163
+ externalToolGuard: daemonToolGuardHandler,
6063
6164
  onDiagnosticLine: diagnosticSink,
6064
6165
  telemetry: createRuntimeBridgeTelemetry(wsHash),
6065
6166
  ...permissionPolicy !== void 0 ? { permissionPolicy } : {},
@@ -6503,8 +6604,8 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
6503
6604
  { createChannelManagementService },
6504
6605
  { WorkspaceChannelSettingsStore }
6505
6606
  ] = await Promise.all([
6506
- import("./channel-management-service-5ZYX4ROW.js"),
6507
- import("./channel-settings-store-62E3TWVK.js")
6607
+ import("./channel-management-service-GWY2GAIC.js"),
6608
+ import("./channel-settings-store-WNWYFHG7.js")
6508
6609
  ]);
6509
6610
  return createChannelManagementService({
6510
6611
  workspaceCwd: targetRuntime.workspaceCwd,
@@ -6558,6 +6659,8 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
6558
6659
  throw new Error("Workspace runtime publication validation failed.");
6559
6660
  }, "validateWorkspaceRuntimeForPublication");
6560
6661
  const app2 = runtime.createServeApp(opts, () => actualPort, {
6662
+ serveAppLifecycle,
6663
+ liveDiscoveryStableBaseDir,
6561
6664
  workspaceRegistry,
6562
6665
  getSessionBridges: /* @__PURE__ */ __name(() => runtimeBridges, "getSessionBridges"),
6563
6666
  createWorkspaceRuntime: createDynamicWorkspaceRuntime,
@@ -6705,8 +6808,8 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
6705
6808
  { createWorkspaceTrustReconciler },
6706
6809
  { createDaemonTrustPolicyMonitor }
6707
6810
  ] = await Promise.all([
6708
- import("./workspace-trust-reconciler-JP5UR2H6.js"),
6709
- import("./daemon-trust-policy-monitor-CIKHNV2K.js")
6811
+ import("./workspace-trust-reconciler-AYGXC7A3.js"),
6812
+ import("./daemon-trust-policy-monitor-RYYGCQ3J.js")
6710
6813
  ]);
6711
6814
  const materializationFor = /* @__PURE__ */ __name((entry, snapshot, decision) => {
6712
6815
  const boundWorkspaces2 = entry.primary && decision.targetTrusted ? runtime.resolveBoundWorkspacesFromIdeEnv(
@@ -6921,7 +7024,7 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
6921
7024
  );
6922
7025
  }
6923
7026
  const channelValidationSettingsRuntime = opts.channelSelection ? await loadSettingsRuntimeModules() : void 0;
6924
- const channelValidationTrustPolicy = opts.channelSelection ? await import("./daemon-trust-policy-ZZ6DRDAC.js") : void 0;
7027
+ const channelValidationTrustPolicy = opts.channelSelection ? await import("./daemon-trust-policy-E67OYUK2.js") : void 0;
6925
7028
  const channelValidationTrustSnapshot = channelValidationTrustPolicy ? await channelValidationTrustPolicy.readDaemonTrustPolicySnapshot() : void 0;
6926
7029
  const resolveChannelWorkspaceGroupsAtListen = /* @__PURE__ */ __name(() => {
6927
7030
  if (!opts.channelSelection || !channelValidationSettingsRuntime || !channelRuntime) {
@@ -7028,6 +7131,7 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
7028
7131
  reserveChannelServicePidfile(opts.channelSelection);
7029
7132
  }
7030
7133
  return await new Promise((resolve3, reject) => {
7134
+ let closeHost;
7031
7135
  const onListening = /* @__PURE__ */ __name((error) => {
7032
7136
  if (error) return;
7033
7137
  startup.listenerReadyAt = (/* @__PURE__ */ new Date()).toISOString();
@@ -7047,26 +7151,40 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
7047
7151
  const url = `${scheme}://${formatHostForUrl(opts.hostname)}:${actualPort}`;
7048
7152
  const liveRuntimeBaseDir = path.dirname(daemonLogBaseDir);
7049
7153
  const liveDiscoveryOwners = [];
7154
+ const rememberLiveDiscoveryOwner = /* @__PURE__ */ __name((owner) => {
7155
+ if (liveDiscoveryOwners.some(
7156
+ (candidate) => candidate.runtimeBaseDir === owner.runtimeBaseDir && candidate.instanceNonce === owner.instanceNonce && candidate.pid === owner.pid
7157
+ )) {
7158
+ return;
7159
+ }
7160
+ liveDiscoveryOwners.push(owner);
7161
+ }, "rememberLiveDiscoveryOwner");
7050
7162
  let liveDiscoveryPublish;
7051
7163
  let liveDiscoveryRetryTimer;
7052
7164
  let liveDiscoveryRetryTask;
7165
+ let liveDiscoveryBootRetryApp;
7053
7166
  let liveDiscoveryEnabled = false;
7054
7167
  let liveDiscoveryShuttingDown = false;
7055
7168
  let liveDiscoveryToggle = Promise.resolve();
7056
7169
  let attemptPendingLiveDiscovery;
7057
7170
  const pendingLiveDiscoveryBaseDirs = /* @__PURE__ */ new Set();
7058
7171
  const warnedLiveDiscoveryOwners = /* @__PURE__ */ new Set();
7172
+ let warnedLiveDiscoveryBootFailure = false;
7059
7173
  const liveDiscoveryRetryDelayMs = deps.liveDiscoveryRetryDelayMs !== void 0 && Number.isFinite(deps.liveDiscoveryRetryDelayMs) && deps.liveDiscoveryRetryDelayMs >= 10 ? Math.min(deps.liveDiscoveryRetryDelayMs, 6e4) : DEFAULT_LIVE_DISCOVERY_RETRY_MS;
7060
7174
  const scheduleLiveDiscoveryRetry = /* @__PURE__ */ __name(() => {
7061
- if (liveDiscoveryShuttingDown || !liveDiscoveryEnabled || liveDiscoveryRetryTimer || liveDiscoveryRetryTask || pendingLiveDiscoveryBaseDirs.size === 0 || !attemptPendingLiveDiscovery) {
7175
+ if (liveDiscoveryShuttingDown || !liveDiscoveryEnabled || liveDiscoveryRetryTimer || liveDiscoveryRetryTask || !liveDiscoveryBootRetryApp && (pendingLiveDiscoveryBaseDirs.size === 0 || !attemptPendingLiveDiscovery)) {
7062
7176
  return;
7063
7177
  }
7064
7178
  liveDiscoveryRetryTimer = setTimeout(() => {
7065
7179
  liveDiscoveryRetryTimer = void 0;
7066
- if (liveDiscoveryShuttingDown || !liveDiscoveryEnabled || !attemptPendingLiveDiscovery) {
7180
+ if (liveDiscoveryShuttingDown || !liveDiscoveryEnabled) {
7067
7181
  return;
7068
7182
  }
7069
- const retry = attemptPendingLiveDiscovery().finally(() => {
7183
+ const retryApp = liveDiscoveryBootRetryApp;
7184
+ liveDiscoveryBootRetryApp = void 0;
7185
+ const retryOperation = retryApp ? publishLiveDiscovery(retryApp) : attemptPendingLiveDiscovery?.();
7186
+ if (!retryOperation) return;
7187
+ const retry = retryOperation.finally(() => {
7070
7188
  if (liveDiscoveryRetryTask === retry) {
7071
7189
  liveDiscoveryRetryTask = void 0;
7072
7190
  }
@@ -7091,16 +7209,20 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
7091
7209
  const coordinator = candidateApp.locals?.["liveCoordinator"];
7092
7210
  const instanceNonce = coordinator?.daemonInstanceNonce;
7093
7211
  if (typeof instanceNonce !== "string") return Promise.resolve();
7094
- liveDiscoveryPublish = loadLiveDiscoveryRuntime().then(
7212
+ let publicationFailed = false;
7213
+ let publicationRetryable = false;
7214
+ const publication = serveAppLifecycle.startBoot().then(() => loadLiveDiscoveryRuntime()).then(
7095
7215
  async ({
7096
- getStableLiveDiscoveryBaseDir,
7216
+ handoffLiveDiscoveryOwner,
7097
7217
  LiveDiscoveryOwnerActiveError,
7218
+ LiveDiscoveryPublicationError,
7219
+ removeLiveDiscoveryFile,
7098
7220
  writeLiveDiscoveryFile
7099
7221
  }) => {
7100
7222
  if (liveDiscoveryShuttingDown || !liveDiscoveryEnabled) return;
7101
- const stableBaseDir = path.resolve(
7102
- deps.liveDiscoveryStableBaseDir ?? getStableLiveDiscoveryBaseDir()
7103
- );
7223
+ liveDiscoveryBootRetryApp = void 0;
7224
+ warnedLiveDiscoveryBootFailure = false;
7225
+ const stableBaseDir = liveDiscoveryStableBaseDir;
7104
7226
  const runtimeBaseDir = path.resolve(liveRuntimeBaseDir);
7105
7227
  const targetBaseDirs = /* @__PURE__ */ new Set();
7106
7228
  if (runtimeBaseDir !== stableBaseDir) {
@@ -7118,21 +7240,51 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
7118
7240
  instanceNonce
7119
7241
  };
7120
7242
  attemptPendingLiveDiscovery = /* @__PURE__ */ __name(async () => {
7121
- for (const runtimeBaseDir2 of [
7122
- ...pendingLiveDiscoveryBaseDirs
7123
- ]) {
7124
- if (liveDiscoveryShuttingDown || !liveDiscoveryEnabled)
7243
+ const targets = [...pendingLiveDiscoveryBaseDirs];
7244
+ const published = [];
7245
+ const rollbackPublished = /* @__PURE__ */ __name(async () => {
7246
+ for (const owner of published.splice(0)) {
7247
+ try {
7248
+ await removeLiveDiscoveryFile(
7249
+ owner.runtimeBaseDir,
7250
+ owner
7251
+ );
7252
+ } catch (cleanupError) {
7253
+ rememberLiveDiscoveryOwner(owner);
7254
+ daemonLog.warn(
7255
+ `failed to roll back Live Host discovery at ${owner.runtimeBaseDir}: ${cleanupError instanceof Error ? cleanupError.message : String(cleanupError)}`
7256
+ );
7257
+ }
7258
+ }
7259
+ }, "rollbackPublished");
7260
+ for (const runtimeBaseDir2 of targets) {
7261
+ if (liveDiscoveryShuttingDown || !liveDiscoveryEnabled) {
7262
+ await rollbackPublished();
7125
7263
  return;
7264
+ }
7126
7265
  try {
7266
+ if (runtimeBaseDir2 !== stableBaseDir) {
7267
+ await handoffLiveDiscoveryOwner(
7268
+ runtimeBaseDir2,
7269
+ record,
7270
+ async () => void 0
7271
+ );
7272
+ }
7127
7273
  await writeLiveDiscoveryFile(runtimeBaseDir2, record);
7128
- pendingLiveDiscoveryBaseDirs.delete(runtimeBaseDir2);
7129
- warnedLiveDiscoveryOwners.delete(runtimeBaseDir2);
7130
- liveDiscoveryOwners.push({
7274
+ published.push({
7131
7275
  runtimeBaseDir: runtimeBaseDir2,
7132
7276
  instanceNonce,
7133
7277
  pid: process.pid
7134
7278
  });
7135
7279
  } catch (err) {
7280
+ if (err instanceof LiveDiscoveryPublicationError && err.published) {
7281
+ published.push({
7282
+ runtimeBaseDir: runtimeBaseDir2,
7283
+ instanceNonce,
7284
+ pid: process.pid
7285
+ });
7286
+ }
7287
+ await rollbackPublished();
7136
7288
  if (err instanceof LiveDiscoveryOwnerActiveError) {
7137
7289
  if (!warnedLiveDiscoveryOwners.has(runtimeBaseDir2)) {
7138
7290
  warnedLiveDiscoveryOwners.add(runtimeBaseDir2);
@@ -7140,49 +7292,77 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
7140
7292
  `failed to publish Live Host discovery at ${runtimeBaseDir2}: ${err.message}`
7141
7293
  );
7142
7294
  }
7143
- continue;
7295
+ return;
7144
7296
  }
7145
- pendingLiveDiscoveryBaseDirs.delete(runtimeBaseDir2);
7146
7297
  daemonLog.warn(
7147
7298
  `failed to publish Live Host discovery at ${runtimeBaseDir2}: ${err instanceof Error ? err.message : String(err)}`
7148
7299
  );
7300
+ return;
7149
7301
  }
7150
7302
  }
7303
+ for (const owner of published) {
7304
+ pendingLiveDiscoveryBaseDirs.delete(owner.runtimeBaseDir);
7305
+ warnedLiveDiscoveryOwners.delete(owner.runtimeBaseDir);
7306
+ rememberLiveDiscoveryOwner(owner);
7307
+ }
7151
7308
  }, "attemptPendingLiveDiscovery");
7152
7309
  await attemptPendingLiveDiscovery();
7153
7310
  scheduleLiveDiscoveryRetry();
7154
7311
  }
7155
7312
  ).catch((err) => {
7156
- daemonLog.warn(
7157
- `failed to publish Live Host discovery: ${err instanceof Error ? err.message : String(err)}`
7158
- );
7313
+ publicationFailed = true;
7314
+ publicationRetryable = err instanceof ConversationRuntimeOwnershipError && err.retryable;
7315
+ if (!publicationRetryable || !warnedLiveDiscoveryBootFailure) {
7316
+ warnedLiveDiscoveryBootFailure = publicationRetryable;
7317
+ daemonLog.warn(
7318
+ `failed to publish Live Host discovery: ${err instanceof Error ? err.message : String(err)}`
7319
+ );
7320
+ }
7321
+ });
7322
+ const trackedPublication = publication.finally(() => {
7323
+ if (publicationFailed && liveDiscoveryPublish === trackedPublication) {
7324
+ liveDiscoveryPublish = void 0;
7325
+ if (publicationRetryable && !liveDiscoveryShuttingDown && liveDiscoveryEnabled) {
7326
+ liveDiscoveryBootRetryApp = candidateApp;
7327
+ scheduleLiveDiscoveryRetry();
7328
+ }
7329
+ }
7159
7330
  });
7331
+ liveDiscoveryPublish = trackedPublication;
7160
7332
  return liveDiscoveryPublish;
7161
7333
  }, "publishLiveDiscovery");
7162
7334
  const removeLiveDiscoveryOwners = /* @__PURE__ */ __name(async () => {
7163
- const owners = liveDiscoveryOwners.splice(0);
7335
+ const owners = [...liveDiscoveryOwners];
7164
7336
  if (owners.length === 0) return;
7165
7337
  let removeLiveDiscoveryFile;
7166
7338
  try {
7167
7339
  ({ removeLiveDiscoveryFile } = await loadLiveDiscoveryRuntime());
7168
7340
  } catch (err) {
7169
- daemonLog.warn(
7170
- `failed to load Live discovery runtime for cleanup: ${err instanceof Error ? err.message : String(err)}`
7171
- );
7172
- return;
7341
+ throw new Error("Failed to load Live discovery cleanup support.", {
7342
+ cause: err
7343
+ });
7173
7344
  }
7345
+ const errors = [];
7174
7346
  for (const owner of owners) {
7175
7347
  try {
7176
7348
  await removeLiveDiscoveryFile(owner.runtimeBaseDir, owner);
7349
+ const index = liveDiscoveryOwners.indexOf(owner);
7350
+ if (index >= 0) liveDiscoveryOwners.splice(index, 1);
7177
7351
  } catch (err) {
7178
- daemonLog.warn(
7179
- `failed to remove Live Host discovery at ${owner.runtimeBaseDir}: ${err instanceof Error ? err.message : String(err)}`
7180
- );
7352
+ errors.push(err);
7181
7353
  }
7182
7354
  }
7355
+ if (errors.length > 0) {
7356
+ throw new AggregateError(
7357
+ errors,
7358
+ "Live Host discovery cleanup is incomplete."
7359
+ );
7360
+ }
7183
7361
  }, "removeLiveDiscoveryOwners");
7184
7362
  const unpublishLiveDiscovery = /* @__PURE__ */ __name(async () => {
7185
7363
  liveDiscoveryEnabled = false;
7364
+ liveDiscoveryBootRetryApp = void 0;
7365
+ warnedLiveDiscoveryBootFailure = false;
7186
7366
  cancelLiveDiscoveryRetry();
7187
7367
  pendingLiveDiscoveryBaseDirs.clear();
7188
7368
  attemptPendingLiveDiscovery = void 0;
@@ -7200,6 +7380,9 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
7200
7380
  liveDiscoveryToggle = operation.catch(() => void 0);
7201
7381
  return operation;
7202
7382
  };
7383
+ candidateApp.locals.onConversationRuntimeReady = () => {
7384
+ void publishLiveDiscovery(candidateApp);
7385
+ };
7203
7386
  }, "attachLiveDiscoveryControl");
7204
7387
  const cleanupLiveDiscovery = /* @__PURE__ */ __name(async () => {
7205
7388
  liveDiscoveryShuttingDown = true;
@@ -7207,58 +7390,6 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
7207
7390
  await liveDiscoveryToggle;
7208
7391
  await unpublishLiveDiscovery();
7209
7392
  }, "cleanupLiveDiscovery");
7210
- try {
7211
- channelWorkspaceGroups = resolveChannelWorkspaceGroupsAtListen();
7212
- } catch (err) {
7213
- removeCurrentServePidfile();
7214
- const error2 = err instanceof Error ? err : new Error(String(err));
7215
- server.close((closeErr) => {
7216
- if (closeErr) {
7217
- daemonLog.error(
7218
- "server close after channel worker validation error failed",
7219
- closeErr
7220
- );
7221
- }
7222
- reject(error2);
7223
- });
7224
- return;
7225
- }
7226
- if (channelWorkspaceGroups) {
7227
- for (const group of channelWorkspaceGroups) {
7228
- daemonLog.info("channel worker group assigned", {
7229
- workspace: group.workspaceCwd,
7230
- channels: group.selection.mode === "all" ? ["all"] : group.selection.names
7231
- });
7232
- }
7233
- if (opts.channelSelection?.mode === "all") {
7234
- writeStderrLine(
7235
- "qwen serve: --channel all is primary-workspace only; non-primary workspace channels are not hosted."
7236
- );
7237
- }
7238
- }
7239
- writeStdoutLine(
7240
- `qwen serve listening on ${url} (mode=${opts.mode}, workspace=${boundWorkspace})`
7241
- );
7242
- writeStderrLine(
7243
- `qwen serve: bound to workspace ${JSON.stringify(boundWorkspace)}`
7244
- );
7245
- writeStderrLine(
7246
- `qwen serve: startup timing: processToListenMs=${startup.processToListenMs} runQwenServeToListenMs=${startup.runQwenServeToListenMs}`
7247
- );
7248
- if (!token) {
7249
- writeStderrLine(
7250
- `qwen serve: bearer auth disabled (loopback default). Set ${QWEN_SERVER_TOKEN_ENV} to enable.`
7251
- );
7252
- if (opts.clientMcpOverWs === true) {
7253
- writeStderrLine(
7254
- `qwen serve: client-hosted MCP tools are accepted over the WebSocket without auth. Set ${QWEN_SERVE_CLIENT_MCP_OVER_WS_ENV}=0 to disable.`
7255
- );
7256
- }
7257
- } else if (opts.requireAuth) {
7258
- writeStderrLine(
7259
- "qwen serve: --require-auth enabled (bearer token mandatory on every route, including loopback /health)."
7260
- );
7261
- }
7262
7393
  let shuttingDown = false;
7263
7394
  let closePromise;
7264
7395
  let runtimeStartupTimer;
@@ -7325,6 +7456,7 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
7325
7456
  }, "stopChannelWorkerAfterFailedStartup");
7326
7457
  const failRuntimeStartup = /* @__PURE__ */ __name(async (err, bridgeForCleanup) => {
7327
7458
  const error2 = err instanceof Error ? err : new Error(String(err));
7459
+ markServeAppStartupFailed(error2);
7328
7460
  if (runtimeStartupSettled) {
7329
7461
  disposeRuntimeAppResources(runtimeApp ?? runtimeAppForCleanup);
7330
7462
  await shutdownBridgeAfterFailedStartup(bridgeForCleanup);
@@ -7344,16 +7476,13 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
7344
7476
  daemonLog.error("runtime startup failed", error2);
7345
7477
  markRuntimeFailed(error2);
7346
7478
  if (closeServerAfterChannelWorkerStartupFailure && server.listening) {
7347
- runtimeFailureListenerClose = new Promise((resolve4) => {
7348
- server.close((closeErr) => {
7349
- if (closeErr) {
7350
- daemonLog.error(
7351
- "server close after runtime startup error failed",
7352
- closeErr
7353
- );
7354
- }
7355
- resolve4();
7356
- });
7479
+ server.close((closeErr) => {
7480
+ if (closeErr) {
7481
+ daemonLog.error(
7482
+ "server close after runtime startup error failed",
7483
+ closeErr
7484
+ );
7485
+ }
7357
7486
  });
7358
7487
  server.closeAllConnections();
7359
7488
  }
@@ -7541,6 +7670,7 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
7541
7670
  if (runtimeStartupSettled) return;
7542
7671
  }
7543
7672
  if (runtimeStartupSettled) return;
7673
+ markServeAppStartupReady();
7544
7674
  await publishLiveDiscovery(candidateApp);
7545
7675
  runtimeStartupSettled = true;
7546
7676
  clearRuntimeStartupTimer();
@@ -7656,7 +7786,7 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
7656
7786
  process.exit(runtimeStartupError === void 0 ? 0 : 1);
7657
7787
  } catch (err) {
7658
7788
  daemonLog.error("shutdown error", err instanceof Error ? err : null);
7659
- if (err instanceof Error && retryableChannelWorkerShutdownErrors.has(err)) {
7789
+ if (hasRetryableChannelWorkerShutdownError(err)) {
7660
7790
  daemonLog.error(
7661
7791
  "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)"
7662
7792
  );
@@ -7691,10 +7821,12 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
7691
7821
  const initiallyMountedApp = runtimeApp ?? runtimeAppForCleanup;
7692
7822
  const initiallyMountedManagement = initiallyMountedApp?.locals?.["workspaceManagementHandle"];
7693
7823
  const initiallyMountedSessionMaintenance = initiallyMountedApp?.locals?.["sessionArchiveCoordinator"];
7824
+ const initiallyMountedConversationActivity = initiallyMountedApp?.locals?.["conversationRuntimeActivity"];
7694
7825
  const initialManagementWait = initiallyMountedManagement?.sealAndWait?.();
7695
7826
  const initiallyMountedLive = initiallyMountedApp?.locals;
7696
7827
  const initialLiveWait = initiallyMountedLive?.sealAndWaitLiveCoordinator?.();
7697
7828
  const initialSessionMaintenanceWait = initiallyMountedSessionMaintenance?.sealMaintenanceAndWait?.();
7829
+ const initialConversationActivityWait = initiallyMountedConversationActivity?.sealAndWait?.();
7698
7830
  let processRegistryShutdown;
7699
7831
  const startProcessRegistryShutdown = /* @__PURE__ */ __name(() => {
7700
7832
  processRegistryShutdown ??= managedProcessRegistry?.shutdown().then(
@@ -7728,7 +7860,7 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
7728
7860
  `qwen serve: telemetry shutdown error: ${telemetryErr instanceof Error ? telemetryErr.message : String(telemetryErr)}`
7729
7861
  );
7730
7862
  }).finally(async () => {
7731
- const finalErr = err ?? bridgeShutdownError ?? channelWorkerShutdownError;
7863
+ let finalErr = err ?? bridgeShutdownError ?? channelWorkerShutdownError;
7732
7864
  const retryableChannelClose = channelWorkerShutdownError !== void 0 && channelWorkerManager?.state().enabled === true;
7733
7865
  if (retryableChannelClose) {
7734
7866
  const retryableError = channelWorkerShutdownError;
@@ -7743,7 +7875,20 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
7743
7875
  rej(retryableError);
7744
7876
  return;
7745
7877
  }
7746
- await cleanupLiveDiscovery();
7878
+ try {
7879
+ await cleanupLiveDiscovery();
7880
+ } catch (cleanupError) {
7881
+ const normalizedCleanupError = cleanupError instanceof Error ? cleanupError : new Error(String(cleanupError));
7882
+ if (finalErr) {
7883
+ writeDaemonLifecycleBestEffort(() => {
7884
+ daemonLog.error(
7885
+ "Live Host discovery cleanup failed during shutdown",
7886
+ normalizedCleanupError
7887
+ );
7888
+ });
7889
+ }
7890
+ finalErr ??= normalizedCleanupError;
7891
+ }
7747
7892
  if (loggerPublished || loggerSignalOwned) {
7748
7893
  writeDaemonLifecycleBestEffort(() => {
7749
7894
  if (finalErr) {
@@ -7775,6 +7920,7 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
7775
7920
  const appForCleanup = runtimeApp ?? runtimeAppForCleanup;
7776
7921
  const workspaceManagementHandle = appForCleanup?.locals?.["workspaceManagementHandle"];
7777
7922
  const sessionMaintenance = appForCleanup?.locals?.["sessionArchiveCoordinator"];
7923
+ const conversationActivity = appForCleanup?.locals?.["conversationRuntimeActivity"];
7778
7924
  await initialManagementWait;
7779
7925
  if (workspaceManagementHandle !== initiallyMountedManagement) {
7780
7926
  await workspaceManagementHandle?.sealAndWait?.();
@@ -7788,6 +7934,10 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
7788
7934
  if (sessionMaintenance !== initiallyMountedSessionMaintenance) {
7789
7935
  await sessionMaintenance?.sealMaintenanceAndWait?.();
7790
7936
  }
7937
+ await initialConversationActivityWait;
7938
+ if (conversationActivity !== initiallyMountedConversationActivity) {
7939
+ await conversationActivity?.sealAndWait?.();
7940
+ }
7791
7941
  stopTrustPolicyMonitor(appForCleanup);
7792
7942
  const waitForTrustPolicyIdle = appForCleanup?.locals?.["waitForTrustPolicyIdle"];
7793
7943
  await waitForTrustPolicyIdle?.().catch((err) => {
@@ -7855,43 +8005,71 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
7855
8005
  );
7856
8006
  bridgeShutdownError ??= processRegistryError;
7857
8007
  }
7858
- }).finally(() => {
7859
- if (!server.listening) {
7860
- void (runtimeFailureListenerClose ?? Promise.resolve()).then(
7861
- () => finish()
7862
- );
7863
- return;
7864
- }
7865
- const SECONDARY_DEADLINE_MS = 2e3;
7866
- let secondaryTimer;
7867
- const forceTimer = setTimeout(() => {
7868
- daemonLog.warn(
7869
- `${SHUTDOWN_FORCE_CLOSE_MS}ms listener-drain timeout reached; force-closing remaining connections`
7870
- );
7871
- server.closeAllConnections();
7872
- secondaryTimer = setTimeout(() => {
7873
- daemonLog.warn(
7874
- `server.close did not fire ${SECONDARY_DEADLINE_MS}ms after force-close; resolving anyway`
7875
- );
7876
- finish();
7877
- }, SECONDARY_DEADLINE_MS);
7878
- secondaryTimer.unref();
7879
- }, SHUTDOWN_FORCE_CLOSE_MS);
7880
- forceTimer.unref();
7881
- server.close((err) => {
7882
- clearTimeout(forceTimer);
7883
- if (secondaryTimer) clearTimeout(secondaryTimer);
7884
- finish(err);
7885
- });
7886
- });
8008
+ }).then(
8009
+ () => finish(),
8010
+ (error2) => finish(
8011
+ error2 instanceof Error ? error2 : new Error(String(error2))
8012
+ )
8013
+ );
7887
8014
  });
7888
8015
  return closePromise;
7889
8016
  }, "close")
7890
8017
  };
8018
+ closeHost = handle.close;
8019
+ handle.close = () => serveAppLifecycle.close();
8020
+ try {
8021
+ channelWorkspaceGroups = resolveChannelWorkspaceGroupsAtListen();
8022
+ } catch (err) {
8023
+ removeCurrentServePidfile();
8024
+ const error2 = err instanceof Error ? err : new Error(String(err));
8025
+ markServeAppStartupFailed(error2);
8026
+ void serveAppLifecycle.close().then(
8027
+ () => reject(error2),
8028
+ (closeError) => reject(
8029
+ closeError instanceof Error ? new AggregateError([error2, closeError], error2.message) : error2
8030
+ )
8031
+ );
8032
+ return;
8033
+ }
8034
+ if (channelWorkspaceGroups) {
8035
+ for (const group of channelWorkspaceGroups) {
8036
+ daemonLog.info("channel worker group assigned", {
8037
+ workspace: group.workspaceCwd,
8038
+ channels: group.selection.mode === "all" ? ["all"] : group.selection.names
8039
+ });
8040
+ }
8041
+ if (opts.channelSelection?.mode === "all") {
8042
+ writeStderrLine(
8043
+ "qwen serve: --channel all is primary-workspace only; non-primary workspace channels are not hosted."
8044
+ );
8045
+ }
8046
+ }
8047
+ writeStdoutLine(
8048
+ `qwen serve listening on ${url} (mode=${opts.mode}, workspace=${boundWorkspace})`
8049
+ );
8050
+ writeStderrLine(
8051
+ `qwen serve: bound to workspace ${JSON.stringify(boundWorkspace)}`
8052
+ );
8053
+ writeStderrLine(
8054
+ `qwen serve: startup timing: processToListenMs=${startup.processToListenMs} runQwenServeToListenMs=${startup.runQwenServeToListenMs}`
8055
+ );
8056
+ if (!token) {
8057
+ writeStderrLine(
8058
+ `qwen serve: bearer auth disabled (loopback default). Set ${QWEN_SERVER_TOKEN_ENV} to enable.`
8059
+ );
8060
+ if (opts.clientMcpOverWs === true) {
8061
+ writeStderrLine(
8062
+ `qwen serve: client-hosted MCP tools are accepted over the WebSocket without auth. Set ${QWEN_SERVE_CLIENT_MCP_OVER_WS_ENV}=0 to disable.`
8063
+ );
8064
+ }
8065
+ } else if (opts.requireAuth) {
8066
+ writeStderrLine(
8067
+ "qwen serve: --require-auth enabled (bearer token mandatory on every route, including loopback /health)."
8068
+ );
8069
+ }
7891
8070
  process.on("SIGINT", onSignal);
7892
8071
  process.on("SIGTERM", onSignal);
7893
8072
  process.on("uncaughtExceptionMonitor", onUncaughtExceptionMonitor);
7894
- server.removeAllListeners("error");
7895
8073
  server.on("error", (err) => {
7896
8074
  daemonLog.error("server error", err instanceof Error ? err : null);
7897
8075
  });
@@ -7909,6 +8087,7 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
7909
8087
  } else {
7910
8088
  const acpHandle = preparedRuntimeApp.locals?.["acpHandle"];
7911
8089
  acpHandle?.attachServer?.(server);
8090
+ markServeAppStartupReady();
7912
8091
  void publishLiveDiscovery(preparedRuntimeApp);
7913
8092
  }
7914
8093
  } else if (deferRuntimeUntilFirstHealth) {
@@ -7942,7 +8121,7 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
7942
8121
  closeErr instanceof Error ? closeErr : null
7943
8122
  )
7944
8123
  );
7945
- if (closeErr instanceof Error && retryableChannelWorkerShutdownErrors.has(closeErr)) {
8124
+ if (hasRetryableChannelWorkerShutdownError(closeErr)) {
7946
8125
  writeDaemonLifecycleBestEffort(
7947
8126
  () => daemonLog.error(
7948
8127
  "runtime startup failed, but qwen serve remains alive to retain the channel service lease until worker exit is confirmed"
@@ -7958,10 +8137,9 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
7958
8137
  }
7959
8138
  }, "onListening");
7960
8139
  let server;
7961
- let httpsServer;
7962
8140
  if (tlsOptions) {
7963
8141
  try {
7964
- httpsServer = https.createServer(tlsOptions, app);
8142
+ server = https.createServer(tlsOptions, app);
7965
8143
  } catch (err) {
7966
8144
  reject(
7967
8145
  new Error(
@@ -7970,38 +8148,69 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
7970
8148
  );
7971
8149
  return;
7972
8150
  }
7973
- }
8151
+ } else {
8152
+ server = deps.httpServerFactory?.(app) ?? createServer(app);
8153
+ }
8154
+ serveAppLifecycle.bindServer(server, {
8155
+ startupReady: serveAppStartupReady,
8156
+ drainHost: /* @__PURE__ */ __name(() => {
8157
+ if (closeHost) return closeHost();
8158
+ if (!server.listening) return Promise.resolve();
8159
+ return new Promise((resolve4, rejectClose) => {
8160
+ server.close((error) => {
8161
+ if (error) rejectClose(error);
8162
+ else resolve4();
8163
+ });
8164
+ });
8165
+ }, "drainHost")
8166
+ });
7974
8167
  const tryListen = /* @__PURE__ */ __name((attemptPort, attempt) => {
7975
- try {
7976
- if (httpsServer) {
7977
- httpsServer.removeAllListeners("listening");
7978
- server = httpsServer.listen(attemptPort, listenHostname, onListening);
7979
- } else {
7980
- server = app.listen(attemptPort, listenHostname, onListening);
7981
- }
7982
- } catch (err) {
7983
- removeCurrentServePidfile();
7984
- reject(err instanceof Error ? err : new Error(String(err)));
7985
- return;
7986
- }
7987
- server.once("error", (err) => {
7988
- server.close();
8168
+ const handleListening = /* @__PURE__ */ __name(() => {
8169
+ server.removeListener("error", handleError);
8170
+ onListening();
8171
+ }, "handleListening");
8172
+ const handleError = /* @__PURE__ */ __name((err) => {
8173
+ server.removeListener("listening", handleListening);
7989
8174
  const nextPort = attemptPort + 1;
7990
8175
  if (err.code === "EADDRINUSE" && opts.strictPort !== true && opts.port !== 0 && nextPort <= 65535 && attempt < MAX_PORT_ATTEMPTS - 1) {
7991
8176
  writeStderrLine(
7992
8177
  `qwen serve: port ${attemptPort} is in use, trying ${nextPort}...`
7993
8178
  );
7994
8179
  tryListen(nextPort, attempt + 1);
7995
- } else {
7996
- if (err.code === "EADDRINUSE" && attempt > 0) {
7997
- writeStderrLine(
7998
- `qwen serve: all ports ${opts.port}\u2013${attemptPort} are in use`
7999
- );
8000
- }
8001
- removeCurrentServePidfile();
8002
- reject(err);
8180
+ return;
8003
8181
  }
8004
- });
8182
+ if (err.code === "EADDRINUSE" && attempt > 0) {
8183
+ writeStderrLine(
8184
+ `qwen serve: all ports ${opts.port}\u2013${attemptPort} are in use`
8185
+ );
8186
+ }
8187
+ removeCurrentServePidfile();
8188
+ markServeAppStartupFailed(err);
8189
+ void serveAppLifecycle.close().then(
8190
+ () => reject(err),
8191
+ (closeError) => reject(
8192
+ closeError instanceof Error ? new AggregateError([err, closeError], err.message) : err
8193
+ )
8194
+ );
8195
+ }, "handleError");
8196
+ try {
8197
+ server.once("listening", handleListening);
8198
+ server.once("error", handleError);
8199
+ server.listen(attemptPort, listenHostname);
8200
+ } catch (err) {
8201
+ removeCurrentServePidfile();
8202
+ server.removeListener("listening", handleListening);
8203
+ server.removeListener("error", handleError);
8204
+ const error = err instanceof Error ? err : new Error(String(err));
8205
+ markServeAppStartupFailed(error);
8206
+ void serveAppLifecycle.close().then(
8207
+ () => reject(error),
8208
+ (closeError) => reject(
8209
+ closeError instanceof Error ? new AggregateError([error, closeError], error.message) : error
8210
+ )
8211
+ );
8212
+ return;
8213
+ }
8005
8214
  }, "tryListen");
8006
8215
  tryListen(opts.port, 0);
8007
8216
  });