@qwen-code/qwen-code 0.21.12 → 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 (303) hide show
  1. package/bundled/qc-helper/docs/configuration/settings.md +7 -5
  2. package/bundled/qc-helper/docs/features/code-review.md +13 -12
  3. package/bundled/review/SKILL.md +96 -68
  4. package/chunks/{MaxSizedBox-ZSJJ2D5S.js → MaxSizedBox-UQALOVVT.js} +41 -41
  5. package/chunks/{StandaloneSessionPicker-WHUHQXSA.js → StandaloneSessionPicker-KEGXNUG6.js} +62 -62
  6. package/chunks/{acp-startup-profiler-SVPUHLXV.js → acp-startup-profiler-NMDXYGDN.js} +2 -2
  7. package/chunks/{acpAgent-7JOAESF5.js → acpAgent-XPES32S7.js} +533 -286
  8. package/chunks/{agent-E6V3VXQR.js → agent-DPTOZFEM.js} +38 -38
  9. package/chunks/{agent-headless-OEQNFOMH.js → agent-headless-GJCQMURW.js} +38 -38
  10. package/chunks/{anthropicContentGenerator-YDT4EOKO.js → anthropicContentGenerator-G7BVXTKN.js} +6 -6
  11. package/chunks/{artifact-tool-4GCQQDZI.js → artifact-tool-GEXTOPVO.js} +2 -2
  12. package/chunks/{askUserQuestion-HZJJLR3Z.js → askUserQuestion-B33XRSB7.js} +2 -2
  13. package/chunks/{bridge-NPBV53UA.js → bridge-YNQBAA4Z.js} +42 -42
  14. package/chunks/{channel-management-service-OADNGQM3.js → channel-management-service-GWY2GAIC.js} +1 -1
  15. package/chunks/{channel-settings-store-4ODLJ4X2.js → channel-settings-store-WNWYFHG7.js} +45 -45
  16. package/chunks/{channel-worker-group-IHBIHQ45.js → channel-worker-group-7LXCMZ77.js} +4 -4
  17. package/chunks/{channel-worker-manager-GEHYJ5AE.js → channel-worker-manager-RYEME4ZZ.js} +4 -4
  18. package/chunks/{channel-worker-supervisor-ZJIIWM4I.js → channel-worker-supervisor-OEVWBHGT.js} +2 -2
  19. package/chunks/{chunk-5RUCD4ED.js → chunk-25EYDK42.js} +3 -3
  20. package/chunks/{chunk-2ZWH53I4.js → chunk-2B2BF7P7.js} +3 -3
  21. package/chunks/{chunk-OYWVIXHT.js → chunk-2M55OBEB.js} +1 -1
  22. package/chunks/{chunk-GZDWTBT3.js → chunk-3EZLLVDF.js} +2 -2
  23. package/chunks/{chunk-V6OBVAST.js → chunk-3U3VAL47.js} +1 -1
  24. package/chunks/{chunk-KWX56CHZ.js → chunk-4PKCUT7F.js} +7 -7
  25. package/chunks/{chunk-EBPLKY6U.js → chunk-4S5337WV.js} +1229 -522
  26. package/chunks/{chunk-QLTATTPS.js → chunk-5CVO7YES.js} +1 -1
  27. package/chunks/{chunk-I7BT2MME.js → chunk-5EYKMUUY.js} +1 -1
  28. package/chunks/{chunk-YIGGWOJE.js → chunk-6HY6IF3Z.js} +1 -1
  29. package/chunks/{chunk-LCX5B364.js → chunk-6ORZ2EDC.js} +3 -3
  30. package/chunks/{chunk-OWGRUU7F.js → chunk-6QFDQMQX.js} +1 -1
  31. package/chunks/{chunk-5AFGJNY6.js → chunk-6YKYPVDV.js} +4 -4
  32. package/chunks/{chunk-X5SLJOMF.js → chunk-76J3IJ3M.js} +4 -4
  33. package/chunks/{chunk-YX2RDGAL.js → chunk-7UXUJ5T3.js} +1 -1
  34. package/chunks/{chunk-3GDBZJD6.js → chunk-A267JX7H.js} +6 -6
  35. package/chunks/{chunk-DD6O3ZRD.js → chunk-A4MFR4C5.js} +1 -1
  36. package/chunks/{chunk-LUISTZXI.js → chunk-AA2BEKV3.js} +2 -2
  37. package/chunks/{chunk-4XA4QIUA.js → chunk-AFSG32D5.js} +1 -1
  38. package/chunks/{chunk-B4VN3VDH.js → chunk-AS5IN4GK.js} +5 -5
  39. package/chunks/{chunk-MELQSJOU.js → chunk-AW4TRXOC.js} +1 -1
  40. package/chunks/{chunk-EJOGLSNJ.js → chunk-AXN7UPYQ.js} +1 -1
  41. package/chunks/{chunk-CGM3E75C.js → chunk-BHILXOC3.js} +2 -2
  42. package/chunks/{chunk-7KJPO7YH.js → chunk-BKPPWD33.js} +2 -2
  43. package/chunks/{chunk-HOSVOUDK.js → chunk-BUQDLC2G.js} +3 -0
  44. package/chunks/{chunk-2IVYL3IF.js → chunk-BVJS5BSP.js} +1 -1
  45. package/chunks/{chunk-TMFWI4RC.js → chunk-BZ263IKX.js} +1 -1
  46. package/chunks/{chunk-G6MUFRNI.js → chunk-CHHABXPE.js} +1 -1
  47. package/chunks/{chunk-YILJKX2T.js → chunk-CKSJECTU.js} +4 -4
  48. package/chunks/{chunk-4AOVQPJU.js → chunk-CPHEPGAO.js} +1 -1
  49. package/chunks/{chunk-OWXFBIB6.js → chunk-CU6GJD55.js} +1 -1
  50. package/chunks/{chunk-FMIH5KMQ.js → chunk-CZBYX5MY.js} +1 -1
  51. package/chunks/{chunk-S6TCTH4Z.js → chunk-DGK6P3BQ.js} +12 -12
  52. package/chunks/{chunk-QPBFRWCP.js → chunk-DGZEMW5R.js} +3 -3
  53. package/chunks/{chunk-NW2GIPG3.js → chunk-DXIBNLBZ.js} +2 -2
  54. package/chunks/{chunk-FA5K6YI2.js → chunk-E23IPNGS.js} +25 -2
  55. package/chunks/{chunk-ULNWG62W.js → chunk-E3DYKPYZ.js} +3 -3
  56. package/chunks/{chunk-N4SVADAV.js → chunk-EL5SXY3T.js} +4 -3
  57. package/chunks/{chunk-YCHNAKC5.js → chunk-EZ5RP345.js} +11 -11
  58. package/chunks/{chunk-D7QGE3RT.js → chunk-FAAUPSY2.js} +1 -1
  59. package/chunks/{chunk-YBHUXEC6.js → chunk-FDGGZIYW.js} +1 -1
  60. package/chunks/{chunk-CIDQISGM.js → chunk-GGDBMYGZ.js} +5 -5
  61. package/chunks/{chunk-DG4IQ6JG.js → chunk-GMIEIY3Y.js} +3 -3
  62. package/chunks/{chunk-ZQUY3ZJU.js → chunk-GO7STP6N.js} +4 -4
  63. package/chunks/{chunk-3AEKDXKT.js → chunk-H4A72DE5.js} +1 -1
  64. package/chunks/{chunk-IRSLAS4M.js → chunk-HUTNYWBG.js} +2 -2
  65. package/chunks/{chunk-ZBB5EZZV.js → chunk-IA2K2HJE.js} +2 -2
  66. package/chunks/{chunk-IX4PWUDU.js → chunk-IGGGG5CX.js} +4329 -1586
  67. package/chunks/{chunk-ZMY2P4L3.js → chunk-IWPYVAO2.js} +4 -4
  68. package/chunks/{chunk-WCEI6J56.js → chunk-JNDY2MDR.js} +2 -2
  69. package/chunks/{chunk-3LDGOQXZ.js → chunk-JOOFMXGF.js} +6 -6
  70. package/chunks/{chunk-RDVNSJQU.js → chunk-JUEPY766.js} +3 -3
  71. package/chunks/{chunk-QBJYSIQ4.js → chunk-K3LPAED5.js} +53 -12
  72. package/chunks/{chunk-FRHQQC2Z.js → chunk-KBXKR5R2.js} +1 -1
  73. package/chunks/{chunk-PTSEETCO.js → chunk-KD5BOPLP.js} +12 -12
  74. package/chunks/{chunk-CPFFU46D.js → chunk-KV27IEHM.js} +1 -1
  75. package/chunks/{chunk-6P5EXEBL.js → chunk-LJQAUZMR.js} +207 -146
  76. package/chunks/{chunk-56HVDG3M.js → chunk-M732YJPW.js} +6 -6
  77. package/chunks/{chunk-LSRI3ND3.js → chunk-MA2HEDVP.js} +1 -1
  78. package/chunks/{chunk-XH3KAV2G.js → chunk-MC4TLKEI.js} +2 -2
  79. package/chunks/{chunk-YBVVOSOH.js → chunk-MIPFDQAF.js} +1 -1
  80. package/chunks/{chunk-47BGDLJG.js → chunk-MLPXSYXR.js} +31 -18
  81. package/chunks/{chunk-KRXPRVGL.js → chunk-MLXTMF7H.js} +0 -1
  82. package/chunks/{chunk-CQ6IPDQW.js → chunk-MRMJCLIY.js} +3 -3
  83. package/chunks/{chunk-62X3CM7Q.js → chunk-N5YPT6PH.js} +4 -4
  84. package/chunks/{chunk-OPVF453Q.js → chunk-NEFOOD54.js} +3 -3
  85. package/chunks/{chunk-DAV4QFD5.js → chunk-NHDR76JX.js} +44 -3
  86. package/chunks/{chunk-36XKGB7E.js → chunk-NM5V5OVW.js} +3 -3
  87. package/chunks/{chunk-QSD4UH74.js → chunk-NNHNLJ2X.js} +42 -42
  88. package/chunks/chunk-NYWWQ437.js +24 -0
  89. package/chunks/{chunk-MDNUCDKZ.js → chunk-O4D7SPJN.js} +2 -2
  90. package/chunks/{chunk-HG3UBTJ4.js → chunk-O565M6A4.js} +411 -10
  91. package/chunks/{chunk-BSR5AXZR.js → chunk-OD2WU5QY.js} +1 -1
  92. package/chunks/{chunk-DPTMKFIH.js → chunk-OMLJNPBE.js} +42 -12
  93. package/chunks/{chunk-Q4ZPYNIZ.js → chunk-OOQUVWIG.js} +4 -4
  94. package/chunks/{chunk-D2RNVVH6.js → chunk-OVZPVYZB.js} +2 -2
  95. package/chunks/{chunk-3GM5DLBI.js → chunk-OXCMMLED.js} +3 -3
  96. package/chunks/{chunk-BSSLSQEW.js → chunk-OY5RNSV4.js} +3 -3
  97. package/chunks/{chunk-PZW46OTB.js → chunk-P7MPQI75.js} +2 -2
  98. package/chunks/{chunk-6JEIRPLN.js → chunk-PP4FUZNV.js} +2 -2
  99. package/chunks/{chunk-DFVXU5YM.js → chunk-PQ36L4F5.js} +1 -1
  100. package/chunks/{chunk-VPV7WBVT.js → chunk-PT4I7NBA.js} +1 -1
  101. package/chunks/{chunk-VLHR7F4E.js → chunk-QF2NHSPB.js} +28 -28
  102. package/chunks/{chunk-NLFLYSS4.js → chunk-QFJ5JHQR.js} +1 -1
  103. package/chunks/{chunk-VIFA5VJD.js → chunk-QIH2HAEN.js} +1 -1
  104. package/chunks/{chunk-HTYND72J.js → chunk-QNQAPSN2.js} +1 -1
  105. package/chunks/{chunk-TDESMS7M.js → chunk-QRCNA3SR.js} +4 -4
  106. package/chunks/{chunk-IH4Z54RJ.js → chunk-QV5YN5YD.js} +5 -5
  107. package/chunks/{chunk-WI6GIM2M.js → chunk-RIAABG2K.js} +2 -2
  108. package/chunks/{chunk-UI5UGEF4.js → chunk-RLKC46YT.js} +16 -10
  109. package/chunks/{chunk-KEC5FHLM.js → chunk-ROIYNTHJ.js} +3 -3
  110. package/chunks/{chunk-4KM2SYK5.js → chunk-RVOJ2FBP.js} +8 -8
  111. package/chunks/{chunk-63FNZTWG.js → chunk-RWDNJBWN.js} +2 -2
  112. package/chunks/{chunk-FQDCO3CJ.js → chunk-S5DWMTHO.js} +5 -0
  113. package/chunks/{chunk-TTRH3RTQ.js → chunk-SG7ZP5PG.js} +4 -4
  114. package/chunks/{chunk-TXP5NGG3.js → chunk-SXCOEJO4.js} +1 -1
  115. package/chunks/{chunk-K34GJQOZ.js → chunk-TIGA2IVL.js} +3 -3
  116. package/chunks/chunk-TS6625XH.js +488 -0
  117. package/chunks/{chunk-WM3LUQLO.js → chunk-TUGSVUJB.js} +6 -6
  118. package/chunks/{chunk-XAFIL4BD.js → chunk-U3VNBPUO.js} +5 -5
  119. package/chunks/{chunk-WDVDVWJ3.js → chunk-UKMR3CKV.js} +6 -6
  120. package/chunks/{chunk-DEDESZDL.js → chunk-UPDOZBWO.js} +1 -1
  121. package/chunks/{chunk-MUNA4QDC.js → chunk-UZPM4XHR.js} +4 -4
  122. package/chunks/{chunk-6SPD4Z7F.js → chunk-V26NVGAU.js} +1 -1
  123. package/chunks/{chunk-XDRXOSAD.js → chunk-V57QC6WW.js} +2 -2
  124. package/chunks/{chunk-NX4A23LY.js → chunk-WFSTRPRO.js} +3 -3
  125. package/chunks/{chunk-H7TMVHKE.js → chunk-WGHHA7ZH.js} +1 -1
  126. package/chunks/{chunk-JRIVMPD2.js → chunk-WSH6GRKG.js} +4 -4
  127. package/chunks/{chunk-OR64CU46.js → chunk-X26JYGTD.js} +1 -1
  128. package/chunks/{chunk-RQJA2YYO.js → chunk-XHRY7BXD.js} +4 -4
  129. package/chunks/{chunk-MAKIANMX.js → chunk-XIT3GURH.js} +3 -3
  130. package/chunks/{chunk-KLOMACIR.js → chunk-XLLKYULU.js} +2 -2
  131. package/chunks/{chunk-PVXEJB66.js → chunk-XUJNK7Y6.js} +1 -1
  132. package/chunks/{chunk-AKBFSOC5.js → chunk-Y3YCSWG5.js} +2 -2
  133. package/chunks/{chunk-6ZKSO6K7.js → chunk-YEYY7TEP.js} +7 -7
  134. package/chunks/{chunk-TB4YFWXG.js → chunk-YZHRN3CF.js} +2 -2
  135. package/chunks/{chunk-TQDFSQQF.js → chunk-YZOSNW4R.js} +1 -1
  136. package/chunks/{chunk-GXTMEATA.js → chunk-ZYBBISBY.js} +7 -7
  137. package/chunks/{chunk-ROIJYS5K.js → chunk-ZYYTZUI2.js} +3 -3
  138. package/chunks/{chunk-CZ4OWGQQ.js → chunk-ZZO74WKW.js} +43 -5
  139. package/chunks/{computer-use-F4URV4TU.js → computer-use-77C5FHMW.js} +38 -38
  140. package/chunks/{config-utils-Z3OW3IQG.js → config-utils-IVHRSXWI.js} +2 -2
  141. package/chunks/{contextCommand-IGSS2U5J.js → contextCommand-PJ77GBWL.js} +40 -40
  142. package/chunks/{core-runtime-H5CZDN3A.js → core-runtime-7VMIKUTG.js} +38 -38
  143. package/chunks/{create-sub-session-PA7MFTHK.js → create-sub-session-2L5MQRN4.js} +38 -38
  144. package/chunks/{create-sub-session-XT6DLYOE.js → create-sub-session-KRQULJE6.js} +2 -2
  145. package/chunks/{cron-create-2JZ2TWTF.js → cron-create-H7UEPDSN.js} +4 -4
  146. package/chunks/{cron-delete-CTPD2P26.js → cron-delete-6SZK7YFM.js} +4 -4
  147. package/chunks/{cron-list-V44KHAF6.js → cron-list-H25JIHEZ.js} +4 -4
  148. package/chunks/{daemon-GED37WOX.js → daemon-2KTG7ZBN.js} +80 -8
  149. package/chunks/{daemon-git-worktree-guard-LZDCNJGV.js → daemon-git-worktree-guard-DXYIMWFT.js} +38 -38
  150. package/chunks/{daemon-status-provider-QYM57Z44.js → daemon-status-provider-ZDOYJCU6.js} +46 -46
  151. package/chunks/{daemon-trust-policy-TSRVEYZR.js → daemon-trust-policy-E67OYUK2.js} +44 -44
  152. package/chunks/{daemon-trust-policy-monitor-2K2YETMT.js → daemon-trust-policy-monitor-RYYGCQ3J.js} +44 -44
  153. package/chunks/{deferred-core-runtime-FKJ3OYE7.js → deferred-core-runtime-3SGXFXEQ.js} +38 -38
  154. package/chunks/discovery-ORA5J7YP.js +27 -0
  155. package/chunks/{display-image-M2ELAVN4.js → display-image-ON3EYFRD.js} +4 -4
  156. package/chunks/{earlyInputCapture-WJBSJQUF.js → earlyInputCapture-KJMLFVQV.js} +39 -39
  157. package/chunks/{edit-X73LA4YO.js → edit-I4LQFAEC.js} +38 -38
  158. package/chunks/{enter-worktree-CLRQTIVN.js → enter-worktree-YNPOJSRH.js} +38 -38
  159. package/chunks/{enterPlanMode-6BDYUQ5T.js → enterPlanMode-XCPK62ER.js} +38 -38
  160. package/chunks/{environment-WOAJXJDJ.js → environment-S7CTIHMX.js} +40 -40
  161. package/chunks/{errors-7OY5MXYY.js → errors-7HB2AIDS.js} +40 -40
  162. package/chunks/{exit-worktree-TFFJXCRT.js → exit-worktree-AIIY7SR6.js} +38 -38
  163. package/chunks/{exitPlanMode-WDURQMIU.js → exitPlanMode-R4JY7V2O.js} +38 -38
  164. package/chunks/{fast-path-QQLGC37M.js → fast-path-NDJV3ZFJ.js} +2 -2
  165. package/chunks/{gemini-VHE62IJL.js → gemini-RSUFP5OE.js} +86 -86
  166. package/chunks/{geminiContentGenerator-VSHIEGAQ.js → geminiContentGenerator-SQ5XBPZ7.js} +6 -6
  167. package/chunks/{glob-VMEEDDLO.js → glob-J4RUJAHX.js} +38 -38
  168. package/chunks/{goal-tools-M4UDAZXP.js → goal-tools-VHTNVOKK.js} +56 -12
  169. package/chunks/{grep-F4UAR7KX.js → grep-VJWPLFOT.js} +38 -38
  170. package/chunks/{handleAutoUpdate-GN7Z6QAC.js → handleAutoUpdate-POCX2MNB.js} +42 -42
  171. package/chunks/{i18n-ETW24DHW.js → i18n-RM5YOICI.js} +39 -39
  172. package/chunks/{image-gen-YPK2AZT4.js → image-gen-EXECB5XM.js} +10 -10
  173. package/chunks/{initializer-UA6KQ7MS.js → initializer-Z2AFGBNR.js} +45 -45
  174. package/chunks/{installationInfo-P7OTIR4P.js → installationInfo-4I5FXNMH.js} +39 -39
  175. package/chunks/{keychain-token-storage-NKKCUHI2.js → keychain-token-storage-3XFJ5ZB2.js} +2 -2
  176. package/chunks/{list-GRAMIQOT.js → list-ZMBFIGZA.js} +47 -47
  177. package/chunks/{list-agents-O6WSY4CT.js → list-agents-OSVDFI6S.js} +2 -2
  178. package/chunks/{loadedSettingsAdapter-5O2TDS3I.js → loadedSettingsAdapter-T6TV4YJ7.js} +44 -44
  179. package/chunks/{loggingContentGenerator-J2J2AANS.js → loggingContentGenerator-WF4ZOJEZ.js} +63 -39
  180. package/chunks/{loop-wakeup-GVQRMUKS.js → loop-wakeup-WQS6JYAG.js} +5 -5
  181. package/chunks/{ls-6W2D7TKU.js → ls-D3HUFHDP.js} +4 -4
  182. package/chunks/{lsp-NJ4KFBI2.js → lsp-3QDDJTCS.js} +2 -2
  183. package/chunks/{managed-npm-update-WMV5ITKU.js → managed-npm-update-E7IW6N7V.js} +39 -39
  184. package/chunks/{mcp-XLP33CAI.js → mcp-6UNYX4HG.js} +44 -44
  185. package/chunks/{monitor-2MM23VDV.js → monitor-EE2UYMGE.js} +38 -38
  186. package/chunks/{nonInteractiveCli-KTA5K6FS.js → nonInteractiveCli-WAY237O4.js} +79 -79
  187. package/chunks/{notebook-edit-QD4TRKLY.js → notebook-edit-NTDY4QDU.js} +38 -38
  188. package/chunks/{openaiContentGenerator-KLHSPVN2.js → openaiContentGenerator-YNFVJMRJ.js} +23 -23
  189. package/chunks/{pidfile-RQGZBNXT.js → pidfile-4XSFLYBZ.js} +39 -39
  190. package/chunks/{processUtils-HZZDA2VV.js → processUtils-WDA2MJFD.js} +2 -2
  191. package/chunks/proper-lockfile-3LHWIM44.js +8 -0
  192. package/chunks/{qwenContentGenerator-T75M2Z3B.js → qwenContentGenerator-434M7QKY.js} +43 -43
  193. package/chunks/{qwenOAuth2-5QZU444W.js → qwenOAuth2-GMYZOO6A.js} +9 -9
  194. package/chunks/{read-file-LOVUSBJC.js → read-file-TAFBKMNI.js} +11 -11
  195. package/chunks/{read-mcp-resource-GWCP23WG.js → read-mcp-resource-XD54ZQMC.js} +2 -2
  196. package/chunks/{record-artifact-IYQDEYMV.js → record-artifact-SEYFJEJF.js} +3 -3
  197. package/chunks/{resumeHistoryUtils-LVKSSQII.js → resumeHistoryUtils-EVG3WYK2.js} +45 -45
  198. package/chunks/{ripGrep-ZJSHKB6H.js → ripGrep-WOEK2PXS.js} +38 -38
  199. package/chunks/{run-qwen-serve-GZW7B4WK.js → run-qwen-serve-3QSGRXAN.js} +411 -209
  200. package/chunks/{runtime-MYRXEO2E.js → runtime-5MLLZ7DC.js} +47 -47
  201. package/chunks/{scheduler-DPTPI6FW.js → scheduler-RPBJ63CH.js} +40 -40
  202. package/chunks/{sdk-exporters-http-NHBYB5FZ.js → sdk-exporters-http-XUVP63H6.js} +2 -2
  203. package/chunks/{sdk-impl-SK4P5WON.js → sdk-impl-YXUEN2Z2.js} +2 -2
  204. package/chunks/{send-message-O7FO63UK.js → send-message-VZENRWRH.js} +6 -6
  205. package/chunks/{serve-XCG4XCDA.js → serve-HS3XLPXU.js} +44 -44
  206. package/chunks/{server-AWQHKXLG.js → server-TC4A7AAZ.js} +3833 -1618
  207. package/chunks/{session-P5FKNCNR.js → session-UBOFXVMN.js} +80 -80
  208. package/chunks/{settings-CSYVIP2R.js → settings-D5644OM5.js} +43 -43
  209. package/chunks/{shell-EGTSUO2P.js → shell-3PZULQQV.js} +38 -38
  210. package/chunks/{skill-IFUD72GF.js → skill-PEVVXQ3L.js} +16 -16
  211. package/chunks/{skill-settings-YOE7LBHE.js → skill-settings-J65JKKES.js} +43 -43
  212. package/chunks/{spawnChannel-PQSZIOLY.js → spawnChannel-IYGXRHSQ.js} +40 -40
  213. package/chunks/{standalone-update-RB2EGUSF.js → standalone-update-IFM53PE7.js} +40 -40
  214. package/chunks/{startInteractiveUI-KMYUJ2MU.js → startInteractiveUI-3AVH7L6H.js} +417 -168
  215. package/chunks/{syntheticOutput-DVHJMUGV.js → syntheticOutput-7GWFIDXT.js} +3 -3
  216. package/chunks/{task-create-4NC7PDI4.js → task-create-FCBDX7UH.js} +11 -11
  217. package/chunks/{task-list-LBSRMOC7.js → task-list-YIYIUFUA.js} +6 -6
  218. package/chunks/{task-stop-YFNATTIM.js → task-stop-X37KYTKB.js} +2 -2
  219. package/chunks/{task-update-BPLM52GD.js → task-update-MYPFVOVM.js} +11 -11
  220. package/chunks/{team-create-B6A6MJBT.js → team-create-ZAIA7KAV.js} +38 -38
  221. package/chunks/{team-delete-MKYMYBFM.js → team-delete-6UMU4XLS.js} +6 -6
  222. package/chunks/{team-plan-approval-5WO3CXXU.js → team-plan-approval-UNIUS7OD.js} +38 -38
  223. package/chunks/{terminal-image-renderer-BTRE2GEU.js → terminal-image-renderer-G343P2RV.js} +40 -40
  224. package/chunks/{theme-manager-XL2N5SBY.js → theme-manager-Z3RIT7DB.js} +39 -39
  225. package/chunks/{todoWrite-K5K7NRE5.js → todoWrite-U2R4NVF4.js} +4 -4
  226. package/chunks/{tool-search-QNBLXUGR.js → tool-search-5R2OE4C7.js} +15 -15
  227. package/chunks/{total-session-admission-N4E5SFBO.js → total-session-admission-4KBHMQQ2.js} +42 -42
  228. package/chunks/{trustedFolders-MQS46LIU.js → trustedFolders-LK6T4XC7.js} +39 -39
  229. package/chunks/{update-relaunch-536KRL33.js → update-relaunch-UBKROIC6.js} +5 -5
  230. package/chunks/{updateCheck-QJI2SYWF.js → updateCheck-W4Y2GFSD.js} +42 -42
  231. package/chunks/{useAutoAcceptIndicator-7QASHD46.js → useAutoAcceptIndicator-C7BEICBF.js} +47 -47
  232. package/chunks/{validateNonInterActiveAuth-ZNRGWBLV.js → validateNonInterActiveAuth-LTEI2TB6.js} +76 -76
  233. package/chunks/{version-DBEQAFRW.js → version-G5A5DGVS.js} +1 -1
  234. package/chunks/{web-fetch-MBIVXKPE.js → web-fetch-RTEQTR5Z.js} +15 -15
  235. package/chunks/{web-search-4LBIN6VF.js → web-search-5OXHEZPV.js} +9 -9
  236. package/chunks/{workflow-LNMA55HY.js → workflow-ISQJHPG2.js} +39 -39
  237. package/chunks/{workspace-providers-status-PDDMI6ST.js → workspace-providers-status-2ZPZPUPZ.js} +47 -47
  238. package/chunks/{workspace-registration-store-BGRKKIYR.js → workspace-registration-store-CYNY6IP6.js} +2 -2
  239. package/chunks/{workspace-registry-L4NCJ34K.js → workspace-registry-34GTUUHB.js} +44 -43
  240. package/chunks/{workspace-service-LOXYKYTR.js → workspace-service-XCDQLE2Y.js} +50 -50
  241. package/chunks/{workspace-skills-status-IJ5FOQI6.js → workspace-skills-status-RS4O7AIJ.js} +45 -45
  242. package/chunks/{workspace-trust-reconciler-H36TCR2S.js → workspace-trust-reconciler-AYGXC7A3.js} +53 -52
  243. package/chunks/{write-file-JJAY7JSP.js → write-file-EWXKVVXF.js} +38 -38
  244. package/chunks/{zoom-image-4MVVVM7E.js → zoom-image-4BFYJ3HG.js} +11 -11
  245. package/cli.js +13 -13
  246. package/package.json +3 -3
  247. package/web-shell/assets/{arc-B-89zHN4.js → arc-CgOpDKvm.js} +1 -1
  248. package/web-shell/assets/{architectureDiagram-3BPJPVTR-BkcOncHk.js → architectureDiagram-3BPJPVTR-0Ag_m34F.js} +1 -1
  249. package/web-shell/assets/{blockDiagram-GPEHLZMM-DQ4yboaF.js → blockDiagram-GPEHLZMM-IwTwFau0.js} +1 -1
  250. package/web-shell/assets/{c4Diagram-AAUBKEIU-C_8ZjPDI.js → c4Diagram-AAUBKEIU-DLa5GUv8.js} +1 -1
  251. package/web-shell/assets/channel-BrGVBa2L.js +1 -0
  252. package/web-shell/assets/{chunk-2J33WTMH-naKVe1Bm.js → chunk-2J33WTMH-DcYP-WFG.js} +1 -1
  253. package/web-shell/assets/{chunk-4BX2VUAB-DdoViKT2.js → chunk-4BX2VUAB-C8MVPMiQ.js} +1 -1
  254. package/web-shell/assets/{chunk-55IACEB6-DUDQZEwU.js → chunk-55IACEB6-BUi4Yfv3.js} +1 -1
  255. package/web-shell/assets/{chunk-727SXJPM-BqpDTR5s.js → chunk-727SXJPM-Cy3Su2YY.js} +1 -1
  256. package/web-shell/assets/{chunk-AQP2D5EJ-CdmEknkT.js → chunk-AQP2D5EJ-Dp8Teqv6.js} +1 -1
  257. package/web-shell/assets/{chunk-FMBD7UC4-CH7fFTLB.js → chunk-FMBD7UC4-BDTDM-4j.js} +1 -1
  258. package/web-shell/assets/{chunk-ND2GUHAM-ObgSuFKF.js → chunk-ND2GUHAM-7HfDt0r2.js} +1 -1
  259. package/web-shell/assets/{chunk-QZHKN3VN-D9fKdv_s.js → chunk-QZHKN3VN-BIBU0uCF.js} +1 -1
  260. package/web-shell/assets/classDiagram-4FO5ZUOK-B5TUzJzI.js +1 -0
  261. package/web-shell/assets/classDiagram-v2-Q7XG4LA2-B5TUzJzI.js +1 -0
  262. package/web-shell/assets/{cose-bilkent-S5V4N54A-CvzATMx9.js → cose-bilkent-S5V4N54A-DRLdcg9p.js} +1 -1
  263. package/web-shell/assets/{dagre-BM42HDAG-M_xU21QW.js → dagre-BM42HDAG-DCCgDwqW.js} +1 -1
  264. package/web-shell/assets/{diagram-2AECGRRQ-CNrl9sW1.js → diagram-2AECGRRQ-CsBTBmk3.js} +1 -1
  265. package/web-shell/assets/{diagram-5GNKFQAL-CUweVT6T.js → diagram-5GNKFQAL-C9qjH8Lt.js} +1 -1
  266. package/web-shell/assets/{diagram-KO2AKTUF-D3n6Lxjo.js → diagram-KO2AKTUF-Brjs_lj2.js} +1 -1
  267. package/web-shell/assets/{diagram-LMA3HP47-0SeFPK4t.js → diagram-LMA3HP47-DtiWCl_F.js} +1 -1
  268. package/web-shell/assets/{diagram-OG6HWLK6-DAgyEwge.js → diagram-OG6HWLK6-DmfKLkBT.js} +1 -1
  269. package/web-shell/assets/{erDiagram-TEJ5UH35-CzxBBDIK.js → erDiagram-TEJ5UH35-Bve_4deH.js} +1 -1
  270. package/web-shell/assets/{flowDiagram-I6XJVG4X-B0uj0jyo.js → flowDiagram-I6XJVG4X-C2_kXCcV.js} +1 -1
  271. package/web-shell/assets/{ganttDiagram-6RSMTGT7-DFzcj5km.js → ganttDiagram-6RSMTGT7-BSBIjiTF.js} +1 -1
  272. package/web-shell/assets/{gitGraphDiagram-PVQCEYII-DylJ_Fc9.js → gitGraphDiagram-PVQCEYII-CyebwI55.js} +1 -1
  273. package/web-shell/assets/index-CIDsgxTe.js +1792 -0
  274. package/web-shell/assets/{index-BIGQygTL.css → index-DiQnWi_E.css} +1 -1
  275. package/web-shell/assets/{index-BKSAnXU9.js → index-d0yfnV1M.js} +1 -1
  276. package/web-shell/assets/{infoDiagram-5YYISTIA-BYMcJVMI.js → infoDiagram-5YYISTIA-CSDGnWxU.js} +1 -1
  277. package/web-shell/assets/{ishikawaDiagram-YF4QCWOH-t1quI1S3.js → ishikawaDiagram-YF4QCWOH-BK4jU13p.js} +1 -1
  278. package/web-shell/assets/{journeyDiagram-JHISSGLW-YM_QVUJm.js → journeyDiagram-JHISSGLW-D_W6j-oF.js} +1 -1
  279. package/web-shell/assets/{kanban-definition-UN3LZRKU-jw8OddK1.js → kanban-definition-UN3LZRKU-C7xf-SdC.js} +1 -1
  280. package/web-shell/assets/{linear-Dlr3RVuP.js → linear-DQmzxpxd.js} +1 -1
  281. package/web-shell/assets/{mermaid.core-CqGKzNzd.js → mermaid.core-9P7AGOLG.js} +5 -5
  282. package/web-shell/assets/{mindmap-definition-RKZ34NQL-BqureoOS.js → mindmap-definition-RKZ34NQL-DgcgMyPk.js} +1 -1
  283. package/web-shell/assets/{pieDiagram-4H26LBE5-Da20HkK1.js → pieDiagram-4H26LBE5-3wWGb9eG.js} +1 -1
  284. package/web-shell/assets/{quadrantDiagram-W4KKPZXB-BsNlMvJy.js → quadrantDiagram-W4KKPZXB-BeCXnQw9.js} +1 -1
  285. package/web-shell/assets/{requirementDiagram-4Y6WPE33-DzVCQCse.js → requirementDiagram-4Y6WPE33-Bi1UOHDz.js} +1 -1
  286. package/web-shell/assets/{sankeyDiagram-5OEKKPKP-BMo16voT.js → sankeyDiagram-5OEKKPKP-lrLUjjbb.js} +1 -1
  287. package/web-shell/assets/{sequenceDiagram-3UESZ5HK-Bgi-pdHk.js → sequenceDiagram-3UESZ5HK-BFuqKz6Q.js} +1 -1
  288. package/web-shell/assets/{stateDiagram-AJRCARHV-xaPQXwGk.js → stateDiagram-AJRCARHV-8DemQLhu.js} +1 -1
  289. package/web-shell/assets/stateDiagram-v2-BHNVJYJU-DhM5ixYd.js +1 -0
  290. package/web-shell/assets/{timeline-definition-PNZ67QCA-C_9RuvKG.js → timeline-definition-PNZ67QCA-uzEuVQXg.js} +1 -1
  291. package/web-shell/assets/{vennDiagram-CIIHVFJN-Bgu6vdla.js → vennDiagram-CIIHVFJN-BQTeZ_-o.js} +1 -1
  292. package/web-shell/assets/{wardley-L42UT6IY-CFTZ8IrX.js → wardley-L42UT6IY-B6yM5Im7.js} +1 -1
  293. package/web-shell/assets/{wardleyDiagram-YWT4CUSO-BASW9Vmt.js → wardleyDiagram-YWT4CUSO-ChM8bmgn.js} +1 -1
  294. package/web-shell/assets/{xychartDiagram-2RQKCTM6--Nh-CD3F.js → xychartDiagram-2RQKCTM6-oNG6HyB1.js} +1 -1
  295. package/web-shell/index.html +2 -2
  296. package/chunks/discovery-XLHITE74.js +0 -220
  297. package/web-shell/assets/channel-Du2WFns8.js +0 -1
  298. package/web-shell/assets/classDiagram-4FO5ZUOK-Zw0HafH6.js +0 -1
  299. package/web-shell/assets/classDiagram-v2-Q7XG4LA2-Zw0HafH6.js +0 -1
  300. package/web-shell/assets/index-J7OMTqAN.js +0 -1789
  301. package/web-shell/assets/stateDiagram-v2-BHNVJYJU-D5RqimXD.js +0 -1
  302. package/chunks/{chunk-SYHXR6WM.js → chunk-4W5U2TUT.js} +3 -3
  303. /package/chunks/{chunk-OK47XBYH.js → chunk-A4QRWUDE.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-O565M6A4.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";
@@ -78,17 +81,17 @@ 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-JNDY2MDR.js";
85
+ import "./chunk-AA2BEKV3.js";
83
86
  import {
84
87
  LOAD_REPLAY_META_KEY
85
- } from "./chunk-FQDCO3CJ.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-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,
@@ -133,7 +136,7 @@ import {
133
136
  } from "./chunk-MS7GNABG.js";
134
137
  import {
135
138
  getCliVersion
136
- } from "./chunk-OWXFBIB6.js";
139
+ } from "./chunk-CU6GJD55.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-4XSFLYBZ.js"),
3043
+ import("./runtime-5MLLZ7DC.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-7LXCMZ77.js"),
3046
+ import("./channel-worker-manager-RYEME4ZZ.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-7VMIKUTG.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-ORA5J7YP.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-D5644OM5.js"),
3188
+ import("./environment-S7CTIHMX.js"),
3189
+ import("./loadedSettingsAdapter-T6TV4YJ7.js"),
3190
+ import("./trustedFolders-LK6T4XC7.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-5MLLZ7DC.js"),
3204
+ import("./config-utils-IVHRSXWI.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-TC4A7AAZ.js"),
3230
+ import("./bridge-YNQBAA4Z.js"),
3231
+ import("./spawnChannel-IYGXRHSQ.js"),
3221
3232
  import("./process-registry-PMJOA5CO.js"),
3222
- import("./workspace-service-LOXYKYTR.js"),
3233
+ import("./workspace-service-XCDQLE2Y.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-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")
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-CYNY6IP6.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-DXYIMWFT.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",
@@ -4792,7 +4887,7 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
4792
4887
  loadCoreRuntime(),
4793
4888
  loadSettingsRuntimeModules(),
4794
4889
  cliVersionPromise,
4795
- import("./daemon-trust-policy-TSRVEYZR.js")
4890
+ import("./daemon-trust-policy-E67OYUK2.js")
4796
4891
  ]);
4797
4892
  cliVersion = resolvedCliVersion;
4798
4893
  settingsRuntime.environment.preResolveHomeEnvOverrides();
@@ -4815,7 +4910,6 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
4815
4910
  `qwen serve: managed scratch workspaces are unavailable: ${err instanceof Error ? err.message : String(err)}`
4816
4911
  );
4817
4912
  }
4818
- const liveConversationWorkspace = deps.liveConversationWorkspace ?? new ConversationWorkspace();
4819
4913
  let runtimeBootSettings;
4820
4914
  try {
4821
4915
  runtimeBootSettings = settingsRuntime.settings.loadSettings(
@@ -5165,7 +5259,7 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
5165
5259
  resolveSkillSettings,
5166
5260
  skillSettingStrings,
5167
5261
  updateWorkspaceSkillSettingLists
5168
- } = await import("./skill-settings-YOE7LBHE.js");
5262
+ } = await import("./skill-settings-J65JKKES.js");
5169
5263
  const fresh = loadSettingsForPersistence(workspace);
5170
5264
  const normalizedName = skillName.trim().toLowerCase();
5171
5265
  const resolved = resolveSkillSettings(fresh);
@@ -5230,7 +5324,7 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
5230
5324
  resolveSkillSettings,
5231
5325
  skillSettingStrings,
5232
5326
  updateWorkspaceSkillSettingLists
5233
- } = await import("./skill-settings-YOE7LBHE.js");
5327
+ } = await import("./skill-settings-J65JKKES.js");
5234
5328
  const fresh = loadSettingsForPersistence(workspace);
5235
5329
  const resolved = resolveSkillSettings(fresh);
5236
5330
  const initialDisabled = skillSettingStrings(
@@ -5335,7 +5429,7 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
5335
5429
  );
5336
5430
  }
5337
5431
  }), "persistSettingsFn");
5338
- const { createSubSessionLauncher } = await import("./create-sub-session-PA7MFTHK.js");
5432
+ const { createSubSessionLauncher } = await import("./create-sub-session-2L5MQRN4.js");
5339
5433
  const subSessionLauncher = createSubSessionLauncher({
5340
5434
  getBridge: /* @__PURE__ */ __name(() => bridgeRef, "getBridge"),
5341
5435
  boundWorkspace,
@@ -5845,7 +5939,7 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
5845
5939
  workspaceRegistryForPersistence.current = workspaceRegistry;
5846
5940
  const workspaceVoiceCoordinator = new WorkspaceVoiceCoordinator();
5847
5941
  core.registerDaemonGaugeCallbacks({
5848
- 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"),
5849
5943
  sseCount: /* @__PURE__ */ __name(() => runtime.getActiveSseCount(), "sseCount"),
5850
5944
  heapUsed: /* @__PURE__ */ __name(() => process.memoryUsage().heapUsed, "heapUsed")
5851
5945
  });
@@ -5894,12 +5988,12 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
5894
5988
  cpuPercent,
5895
5989
  rssBytes: mem.rss,
5896
5990
  heapUsedBytes: mem.heapUsed,
5897
- activeSessions: workspaceRegistry.list().reduce((sum, item) => sum + item.bridge.sessionCount, 0),
5898
- activePrompts: workspaceRegistry.list().reduce(
5991
+ activeSessions: workspaceRegistry.listAll().reduce((sum, item) => sum + item.bridge.sessionCount, 0),
5992
+ activePrompts: workspaceRegistry.listAll().reduce(
5899
5993
  (sum, item) => sum + (item.bridge.activePromptCount ?? 0),
5900
5994
  0
5901
5995
  ),
5902
- queuedPrompts: workspaceRegistry.list().reduce(
5996
+ queuedPrompts: workspaceRegistry.listAll().reduce(
5903
5997
  (sum, item) => sum + (item.bridge.pendingPromptTotal ?? 0),
5904
5998
  0
5905
5999
  ),
@@ -6510,8 +6604,8 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
6510
6604
  { createChannelManagementService },
6511
6605
  { WorkspaceChannelSettingsStore }
6512
6606
  ] = await Promise.all([
6513
- import("./channel-management-service-OADNGQM3.js"),
6514
- import("./channel-settings-store-4ODLJ4X2.js")
6607
+ import("./channel-management-service-GWY2GAIC.js"),
6608
+ import("./channel-settings-store-WNWYFHG7.js")
6515
6609
  ]);
6516
6610
  return createChannelManagementService({
6517
6611
  workspaceCwd: targetRuntime.workspaceCwd,
@@ -6565,6 +6659,8 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
6565
6659
  throw new Error("Workspace runtime publication validation failed.");
6566
6660
  }, "validateWorkspaceRuntimeForPublication");
6567
6661
  const app2 = runtime.createServeApp(opts, () => actualPort, {
6662
+ serveAppLifecycle,
6663
+ liveDiscoveryStableBaseDir,
6568
6664
  workspaceRegistry,
6569
6665
  getSessionBridges: /* @__PURE__ */ __name(() => runtimeBridges, "getSessionBridges"),
6570
6666
  createWorkspaceRuntime: createDynamicWorkspaceRuntime,
@@ -6712,8 +6808,8 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
6712
6808
  { createWorkspaceTrustReconciler },
6713
6809
  { createDaemonTrustPolicyMonitor }
6714
6810
  ] = await Promise.all([
6715
- import("./workspace-trust-reconciler-H36TCR2S.js"),
6716
- import("./daemon-trust-policy-monitor-2K2YETMT.js")
6811
+ import("./workspace-trust-reconciler-AYGXC7A3.js"),
6812
+ import("./daemon-trust-policy-monitor-RYYGCQ3J.js")
6717
6813
  ]);
6718
6814
  const materializationFor = /* @__PURE__ */ __name((entry, snapshot, decision) => {
6719
6815
  const boundWorkspaces2 = entry.primary && decision.targetTrusted ? runtime.resolveBoundWorkspacesFromIdeEnv(
@@ -6928,7 +7024,7 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
6928
7024
  );
6929
7025
  }
6930
7026
  const channelValidationSettingsRuntime = opts.channelSelection ? await loadSettingsRuntimeModules() : void 0;
6931
- const channelValidationTrustPolicy = opts.channelSelection ? await import("./daemon-trust-policy-TSRVEYZR.js") : void 0;
7027
+ const channelValidationTrustPolicy = opts.channelSelection ? await import("./daemon-trust-policy-E67OYUK2.js") : void 0;
6932
7028
  const channelValidationTrustSnapshot = channelValidationTrustPolicy ? await channelValidationTrustPolicy.readDaemonTrustPolicySnapshot() : void 0;
6933
7029
  const resolveChannelWorkspaceGroupsAtListen = /* @__PURE__ */ __name(() => {
6934
7030
  if (!opts.channelSelection || !channelValidationSettingsRuntime || !channelRuntime) {
@@ -7035,6 +7131,7 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
7035
7131
  reserveChannelServicePidfile(opts.channelSelection);
7036
7132
  }
7037
7133
  return await new Promise((resolve3, reject) => {
7134
+ let closeHost;
7038
7135
  const onListening = /* @__PURE__ */ __name((error) => {
7039
7136
  if (error) return;
7040
7137
  startup.listenerReadyAt = (/* @__PURE__ */ new Date()).toISOString();
@@ -7054,26 +7151,40 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
7054
7151
  const url = `${scheme}://${formatHostForUrl(opts.hostname)}:${actualPort}`;
7055
7152
  const liveRuntimeBaseDir = path.dirname(daemonLogBaseDir);
7056
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");
7057
7162
  let liveDiscoveryPublish;
7058
7163
  let liveDiscoveryRetryTimer;
7059
7164
  let liveDiscoveryRetryTask;
7165
+ let liveDiscoveryBootRetryApp;
7060
7166
  let liveDiscoveryEnabled = false;
7061
7167
  let liveDiscoveryShuttingDown = false;
7062
7168
  let liveDiscoveryToggle = Promise.resolve();
7063
7169
  let attemptPendingLiveDiscovery;
7064
7170
  const pendingLiveDiscoveryBaseDirs = /* @__PURE__ */ new Set();
7065
7171
  const warnedLiveDiscoveryOwners = /* @__PURE__ */ new Set();
7172
+ let warnedLiveDiscoveryBootFailure = false;
7066
7173
  const liveDiscoveryRetryDelayMs = deps.liveDiscoveryRetryDelayMs !== void 0 && Number.isFinite(deps.liveDiscoveryRetryDelayMs) && deps.liveDiscoveryRetryDelayMs >= 10 ? Math.min(deps.liveDiscoveryRetryDelayMs, 6e4) : DEFAULT_LIVE_DISCOVERY_RETRY_MS;
7067
7174
  const scheduleLiveDiscoveryRetry = /* @__PURE__ */ __name(() => {
7068
- if (liveDiscoveryShuttingDown || !liveDiscoveryEnabled || liveDiscoveryRetryTimer || liveDiscoveryRetryTask || pendingLiveDiscoveryBaseDirs.size === 0 || !attemptPendingLiveDiscovery) {
7175
+ if (liveDiscoveryShuttingDown || !liveDiscoveryEnabled || liveDiscoveryRetryTimer || liveDiscoveryRetryTask || !liveDiscoveryBootRetryApp && (pendingLiveDiscoveryBaseDirs.size === 0 || !attemptPendingLiveDiscovery)) {
7069
7176
  return;
7070
7177
  }
7071
7178
  liveDiscoveryRetryTimer = setTimeout(() => {
7072
7179
  liveDiscoveryRetryTimer = void 0;
7073
- if (liveDiscoveryShuttingDown || !liveDiscoveryEnabled || !attemptPendingLiveDiscovery) {
7180
+ if (liveDiscoveryShuttingDown || !liveDiscoveryEnabled) {
7074
7181
  return;
7075
7182
  }
7076
- 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(() => {
7077
7188
  if (liveDiscoveryRetryTask === retry) {
7078
7189
  liveDiscoveryRetryTask = void 0;
7079
7190
  }
@@ -7098,16 +7209,20 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
7098
7209
  const coordinator = candidateApp.locals?.["liveCoordinator"];
7099
7210
  const instanceNonce = coordinator?.daemonInstanceNonce;
7100
7211
  if (typeof instanceNonce !== "string") return Promise.resolve();
7101
- liveDiscoveryPublish = loadLiveDiscoveryRuntime().then(
7212
+ let publicationFailed = false;
7213
+ let publicationRetryable = false;
7214
+ const publication = serveAppLifecycle.startBoot().then(() => loadLiveDiscoveryRuntime()).then(
7102
7215
  async ({
7103
- getStableLiveDiscoveryBaseDir,
7216
+ handoffLiveDiscoveryOwner,
7104
7217
  LiveDiscoveryOwnerActiveError,
7218
+ LiveDiscoveryPublicationError,
7219
+ removeLiveDiscoveryFile,
7105
7220
  writeLiveDiscoveryFile
7106
7221
  }) => {
7107
7222
  if (liveDiscoveryShuttingDown || !liveDiscoveryEnabled) return;
7108
- const stableBaseDir = path.resolve(
7109
- deps.liveDiscoveryStableBaseDir ?? getStableLiveDiscoveryBaseDir()
7110
- );
7223
+ liveDiscoveryBootRetryApp = void 0;
7224
+ warnedLiveDiscoveryBootFailure = false;
7225
+ const stableBaseDir = liveDiscoveryStableBaseDir;
7111
7226
  const runtimeBaseDir = path.resolve(liveRuntimeBaseDir);
7112
7227
  const targetBaseDirs = /* @__PURE__ */ new Set();
7113
7228
  if (runtimeBaseDir !== stableBaseDir) {
@@ -7125,21 +7240,51 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
7125
7240
  instanceNonce
7126
7241
  };
7127
7242
  attemptPendingLiveDiscovery = /* @__PURE__ */ __name(async () => {
7128
- for (const runtimeBaseDir2 of [
7129
- ...pendingLiveDiscoveryBaseDirs
7130
- ]) {
7131
- 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();
7132
7263
  return;
7264
+ }
7133
7265
  try {
7266
+ if (runtimeBaseDir2 !== stableBaseDir) {
7267
+ await handoffLiveDiscoveryOwner(
7268
+ runtimeBaseDir2,
7269
+ record,
7270
+ async () => void 0
7271
+ );
7272
+ }
7134
7273
  await writeLiveDiscoveryFile(runtimeBaseDir2, record);
7135
- pendingLiveDiscoveryBaseDirs.delete(runtimeBaseDir2);
7136
- warnedLiveDiscoveryOwners.delete(runtimeBaseDir2);
7137
- liveDiscoveryOwners.push({
7274
+ published.push({
7138
7275
  runtimeBaseDir: runtimeBaseDir2,
7139
7276
  instanceNonce,
7140
7277
  pid: process.pid
7141
7278
  });
7142
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();
7143
7288
  if (err instanceof LiveDiscoveryOwnerActiveError) {
7144
7289
  if (!warnedLiveDiscoveryOwners.has(runtimeBaseDir2)) {
7145
7290
  warnedLiveDiscoveryOwners.add(runtimeBaseDir2);
@@ -7147,49 +7292,77 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
7147
7292
  `failed to publish Live Host discovery at ${runtimeBaseDir2}: ${err.message}`
7148
7293
  );
7149
7294
  }
7150
- continue;
7295
+ return;
7151
7296
  }
7152
- pendingLiveDiscoveryBaseDirs.delete(runtimeBaseDir2);
7153
7297
  daemonLog.warn(
7154
7298
  `failed to publish Live Host discovery at ${runtimeBaseDir2}: ${err instanceof Error ? err.message : String(err)}`
7155
7299
  );
7300
+ return;
7156
7301
  }
7157
7302
  }
7303
+ for (const owner of published) {
7304
+ pendingLiveDiscoveryBaseDirs.delete(owner.runtimeBaseDir);
7305
+ warnedLiveDiscoveryOwners.delete(owner.runtimeBaseDir);
7306
+ rememberLiveDiscoveryOwner(owner);
7307
+ }
7158
7308
  }, "attemptPendingLiveDiscovery");
7159
7309
  await attemptPendingLiveDiscovery();
7160
7310
  scheduleLiveDiscoveryRetry();
7161
7311
  }
7162
7312
  ).catch((err) => {
7163
- daemonLog.warn(
7164
- `failed to publish Live Host discovery: ${err instanceof Error ? err.message : String(err)}`
7165
- );
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
+ }
7166
7330
  });
7331
+ liveDiscoveryPublish = trackedPublication;
7167
7332
  return liveDiscoveryPublish;
7168
7333
  }, "publishLiveDiscovery");
7169
7334
  const removeLiveDiscoveryOwners = /* @__PURE__ */ __name(async () => {
7170
- const owners = liveDiscoveryOwners.splice(0);
7335
+ const owners = [...liveDiscoveryOwners];
7171
7336
  if (owners.length === 0) return;
7172
7337
  let removeLiveDiscoveryFile;
7173
7338
  try {
7174
7339
  ({ removeLiveDiscoveryFile } = await loadLiveDiscoveryRuntime());
7175
7340
  } catch (err) {
7176
- daemonLog.warn(
7177
- `failed to load Live discovery runtime for cleanup: ${err instanceof Error ? err.message : String(err)}`
7178
- );
7179
- return;
7341
+ throw new Error("Failed to load Live discovery cleanup support.", {
7342
+ cause: err
7343
+ });
7180
7344
  }
7345
+ const errors = [];
7181
7346
  for (const owner of owners) {
7182
7347
  try {
7183
7348
  await removeLiveDiscoveryFile(owner.runtimeBaseDir, owner);
7349
+ const index = liveDiscoveryOwners.indexOf(owner);
7350
+ if (index >= 0) liveDiscoveryOwners.splice(index, 1);
7184
7351
  } catch (err) {
7185
- daemonLog.warn(
7186
- `failed to remove Live Host discovery at ${owner.runtimeBaseDir}: ${err instanceof Error ? err.message : String(err)}`
7187
- );
7352
+ errors.push(err);
7188
7353
  }
7189
7354
  }
7355
+ if (errors.length > 0) {
7356
+ throw new AggregateError(
7357
+ errors,
7358
+ "Live Host discovery cleanup is incomplete."
7359
+ );
7360
+ }
7190
7361
  }, "removeLiveDiscoveryOwners");
7191
7362
  const unpublishLiveDiscovery = /* @__PURE__ */ __name(async () => {
7192
7363
  liveDiscoveryEnabled = false;
7364
+ liveDiscoveryBootRetryApp = void 0;
7365
+ warnedLiveDiscoveryBootFailure = false;
7193
7366
  cancelLiveDiscoveryRetry();
7194
7367
  pendingLiveDiscoveryBaseDirs.clear();
7195
7368
  attemptPendingLiveDiscovery = void 0;
@@ -7207,6 +7380,9 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
7207
7380
  liveDiscoveryToggle = operation.catch(() => void 0);
7208
7381
  return operation;
7209
7382
  };
7383
+ candidateApp.locals.onConversationRuntimeReady = () => {
7384
+ void publishLiveDiscovery(candidateApp);
7385
+ };
7210
7386
  }, "attachLiveDiscoveryControl");
7211
7387
  const cleanupLiveDiscovery = /* @__PURE__ */ __name(async () => {
7212
7388
  liveDiscoveryShuttingDown = true;
@@ -7214,58 +7390,6 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
7214
7390
  await liveDiscoveryToggle;
7215
7391
  await unpublishLiveDiscovery();
7216
7392
  }, "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
7393
  let shuttingDown = false;
7270
7394
  let closePromise;
7271
7395
  let runtimeStartupTimer;
@@ -7332,6 +7456,7 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
7332
7456
  }, "stopChannelWorkerAfterFailedStartup");
7333
7457
  const failRuntimeStartup = /* @__PURE__ */ __name(async (err, bridgeForCleanup) => {
7334
7458
  const error2 = err instanceof Error ? err : new Error(String(err));
7459
+ markServeAppStartupFailed(error2);
7335
7460
  if (runtimeStartupSettled) {
7336
7461
  disposeRuntimeAppResources(runtimeApp ?? runtimeAppForCleanup);
7337
7462
  await shutdownBridgeAfterFailedStartup(bridgeForCleanup);
@@ -7351,16 +7476,13 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
7351
7476
  daemonLog.error("runtime startup failed", error2);
7352
7477
  markRuntimeFailed(error2);
7353
7478
  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
- });
7479
+ server.close((closeErr) => {
7480
+ if (closeErr) {
7481
+ daemonLog.error(
7482
+ "server close after runtime startup error failed",
7483
+ closeErr
7484
+ );
7485
+ }
7364
7486
  });
7365
7487
  server.closeAllConnections();
7366
7488
  }
@@ -7548,6 +7670,7 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
7548
7670
  if (runtimeStartupSettled) return;
7549
7671
  }
7550
7672
  if (runtimeStartupSettled) return;
7673
+ markServeAppStartupReady();
7551
7674
  await publishLiveDiscovery(candidateApp);
7552
7675
  runtimeStartupSettled = true;
7553
7676
  clearRuntimeStartupTimer();
@@ -7663,7 +7786,7 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
7663
7786
  process.exit(runtimeStartupError === void 0 ? 0 : 1);
7664
7787
  } catch (err) {
7665
7788
  daemonLog.error("shutdown error", err instanceof Error ? err : null);
7666
- if (err instanceof Error && retryableChannelWorkerShutdownErrors.has(err)) {
7789
+ if (hasRetryableChannelWorkerShutdownError(err)) {
7667
7790
  daemonLog.error(
7668
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)"
7669
7792
  );
@@ -7698,10 +7821,12 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
7698
7821
  const initiallyMountedApp = runtimeApp ?? runtimeAppForCleanup;
7699
7822
  const initiallyMountedManagement = initiallyMountedApp?.locals?.["workspaceManagementHandle"];
7700
7823
  const initiallyMountedSessionMaintenance = initiallyMountedApp?.locals?.["sessionArchiveCoordinator"];
7824
+ const initiallyMountedConversationActivity = initiallyMountedApp?.locals?.["conversationRuntimeActivity"];
7701
7825
  const initialManagementWait = initiallyMountedManagement?.sealAndWait?.();
7702
7826
  const initiallyMountedLive = initiallyMountedApp?.locals;
7703
7827
  const initialLiveWait = initiallyMountedLive?.sealAndWaitLiveCoordinator?.();
7704
7828
  const initialSessionMaintenanceWait = initiallyMountedSessionMaintenance?.sealMaintenanceAndWait?.();
7829
+ const initialConversationActivityWait = initiallyMountedConversationActivity?.sealAndWait?.();
7705
7830
  let processRegistryShutdown;
7706
7831
  const startProcessRegistryShutdown = /* @__PURE__ */ __name(() => {
7707
7832
  processRegistryShutdown ??= managedProcessRegistry?.shutdown().then(
@@ -7735,7 +7860,7 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
7735
7860
  `qwen serve: telemetry shutdown error: ${telemetryErr instanceof Error ? telemetryErr.message : String(telemetryErr)}`
7736
7861
  );
7737
7862
  }).finally(async () => {
7738
- const finalErr = err ?? bridgeShutdownError ?? channelWorkerShutdownError;
7863
+ let finalErr = err ?? bridgeShutdownError ?? channelWorkerShutdownError;
7739
7864
  const retryableChannelClose = channelWorkerShutdownError !== void 0 && channelWorkerManager?.state().enabled === true;
7740
7865
  if (retryableChannelClose) {
7741
7866
  const retryableError = channelWorkerShutdownError;
@@ -7750,7 +7875,20 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
7750
7875
  rej(retryableError);
7751
7876
  return;
7752
7877
  }
7753
- 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
+ }
7754
7892
  if (loggerPublished || loggerSignalOwned) {
7755
7893
  writeDaemonLifecycleBestEffort(() => {
7756
7894
  if (finalErr) {
@@ -7782,6 +7920,7 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
7782
7920
  const appForCleanup = runtimeApp ?? runtimeAppForCleanup;
7783
7921
  const workspaceManagementHandle = appForCleanup?.locals?.["workspaceManagementHandle"];
7784
7922
  const sessionMaintenance = appForCleanup?.locals?.["sessionArchiveCoordinator"];
7923
+ const conversationActivity = appForCleanup?.locals?.["conversationRuntimeActivity"];
7785
7924
  await initialManagementWait;
7786
7925
  if (workspaceManagementHandle !== initiallyMountedManagement) {
7787
7926
  await workspaceManagementHandle?.sealAndWait?.();
@@ -7795,6 +7934,10 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
7795
7934
  if (sessionMaintenance !== initiallyMountedSessionMaintenance) {
7796
7935
  await sessionMaintenance?.sealMaintenanceAndWait?.();
7797
7936
  }
7937
+ await initialConversationActivityWait;
7938
+ if (conversationActivity !== initiallyMountedConversationActivity) {
7939
+ await conversationActivity?.sealAndWait?.();
7940
+ }
7798
7941
  stopTrustPolicyMonitor(appForCleanup);
7799
7942
  const waitForTrustPolicyIdle = appForCleanup?.locals?.["waitForTrustPolicyIdle"];
7800
7943
  await waitForTrustPolicyIdle?.().catch((err) => {
@@ -7862,43 +8005,71 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
7862
8005
  );
7863
8006
  bridgeShutdownError ??= processRegistryError;
7864
8007
  }
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
- });
8008
+ }).then(
8009
+ () => finish(),
8010
+ (error2) => finish(
8011
+ error2 instanceof Error ? error2 : new Error(String(error2))
8012
+ )
8013
+ );
7894
8014
  });
7895
8015
  return closePromise;
7896
8016
  }, "close")
7897
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
+ }
7898
8070
  process.on("SIGINT", onSignal);
7899
8071
  process.on("SIGTERM", onSignal);
7900
8072
  process.on("uncaughtExceptionMonitor", onUncaughtExceptionMonitor);
7901
- server.removeAllListeners("error");
7902
8073
  server.on("error", (err) => {
7903
8074
  daemonLog.error("server error", err instanceof Error ? err : null);
7904
8075
  });
@@ -7916,6 +8087,7 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
7916
8087
  } else {
7917
8088
  const acpHandle = preparedRuntimeApp.locals?.["acpHandle"];
7918
8089
  acpHandle?.attachServer?.(server);
8090
+ markServeAppStartupReady();
7919
8091
  void publishLiveDiscovery(preparedRuntimeApp);
7920
8092
  }
7921
8093
  } else if (deferRuntimeUntilFirstHealth) {
@@ -7949,7 +8121,7 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
7949
8121
  closeErr instanceof Error ? closeErr : null
7950
8122
  )
7951
8123
  );
7952
- if (closeErr instanceof Error && retryableChannelWorkerShutdownErrors.has(closeErr)) {
8124
+ if (hasRetryableChannelWorkerShutdownError(closeErr)) {
7953
8125
  writeDaemonLifecycleBestEffort(
7954
8126
  () => daemonLog.error(
7955
8127
  "runtime startup failed, but qwen serve remains alive to retain the channel service lease until worker exit is confirmed"
@@ -7965,10 +8137,9 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
7965
8137
  }
7966
8138
  }, "onListening");
7967
8139
  let server;
7968
- let httpsServer;
7969
8140
  if (tlsOptions) {
7970
8141
  try {
7971
- httpsServer = https.createServer(tlsOptions, app);
8142
+ server = https.createServer(tlsOptions, app);
7972
8143
  } catch (err) {
7973
8144
  reject(
7974
8145
  new Error(
@@ -7977,38 +8148,69 @@ async function runQwenServeImpl(optsIn, deps, loggerLifecycle) {
7977
8148
  );
7978
8149
  return;
7979
8150
  }
7980
- }
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
+ });
7981
8167
  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();
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);
7996
8174
  const nextPort = attemptPort + 1;
7997
8175
  if (err.code === "EADDRINUSE" && opts.strictPort !== true && opts.port !== 0 && nextPort <= 65535 && attempt < MAX_PORT_ATTEMPTS - 1) {
7998
8176
  writeStderrLine(
7999
8177
  `qwen serve: port ${attemptPort} is in use, trying ${nextPort}...`
8000
8178
  );
8001
8179
  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);
8180
+ return;
8010
8181
  }
8011
- });
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
+ }
8012
8214
  }, "tryListen");
8013
8215
  tryListen(opts.port, 0);
8014
8216
  });