@qwen-code/qwen-code 0.21.6 → 0.21.7

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 (288) hide show
  1. package/bundled/qc-helper/docs/configuration/settings.md +19 -9
  2. package/bundled/qc-helper/docs/features/channels/dingtalk.md +1 -1
  3. package/bundled/qc-helper/docs/features/code-review.md +27 -0
  4. package/bundled/qc-helper/docs/qwen-serve.md +1 -1
  5. package/bundled/review/SKILL.md +48 -16
  6. package/chunks/{MaxSizedBox-2HFKP4LI.js → MaxSizedBox-ANWZBPTS.js} +38 -38
  7. package/chunks/{StandaloneSessionPicker-RBV72M5N.js → StandaloneSessionPicker-XKS3VU3A.js} +54 -53
  8. package/chunks/{acpAgent-WO6JFCVQ.js → acpAgent-KUAZ3GCZ.js} +80 -80
  9. package/chunks/{agent-AHGLYNZ4.js → agent-T6PTGX5R.js} +35 -35
  10. package/chunks/{agent-headless-NTXKKGRO.js → agent-headless-PR7YCB7S.js} +35 -35
  11. package/chunks/{anthropicContentGenerator-3CAHEZBM.js → anthropicContentGenerator-DTMVEL5M.js} +7 -7
  12. package/chunks/{artifact-tool-RROCCJDA.js → artifact-tool-U4VOZIK5.js} +2 -2
  13. package/chunks/{askUserQuestion-2EPPBPUZ.js → askUserQuestion-XOBQLPFA.js} +2 -2
  14. package/chunks/{bridge-RPAU64CA.js → bridge-NU6YEEHK.js} +39 -39
  15. package/chunks/{channel-management-service-IGEUOVRT.js → channel-management-service-FSQ7SHYI.js} +1 -1
  16. package/chunks/{channel-settings-store-ON64MF7G.js → channel-settings-store-35VQVUVV.js} +41 -41
  17. package/chunks/{chunk-XC656O42.js → chunk-22NBYCPD.js} +3 -3
  18. package/chunks/{chunk-T4JSA7KU.js → chunk-23RZCH76.js} +3 -3
  19. package/chunks/{chunk-PX5DNLSA.js → chunk-2U3WZGZG.js} +18 -10
  20. package/chunks/chunk-2VSTGY6M.js +107 -0
  21. package/chunks/{chunk-QZKYZCN3.js → chunk-33ACCIIY.js} +3 -3
  22. package/chunks/{chunk-MBEMTXQT.js → chunk-3K7FH2KQ.js} +1 -32
  23. package/chunks/{chunk-ODPXHGLL.js → chunk-3NB7TSE2.js} +2 -2
  24. package/chunks/{chunk-QYPT3QUD.js → chunk-3ULCB3NE.js} +3 -3
  25. package/chunks/{chunk-C4CBJQKY.js → chunk-55LYDVPU.js} +1 -1
  26. package/chunks/{chunk-NKSF7HYF.js → chunk-5KH532V7.js} +1 -1
  27. package/chunks/{chunk-BOGOR4HB.js → chunk-6EOI4HOK.js} +7 -7
  28. package/chunks/{chunk-CA4UIDFU.js → chunk-6GONZVLS.js} +1 -1
  29. package/chunks/{chunk-3UOLYNTF.js → chunk-6HVUFDS2.js} +6 -6
  30. package/chunks/{chunk-5L6CQ4ZU.js → chunk-6M26GBKX.js} +2 -2
  31. package/chunks/{chunk-XA4TMLFN.js → chunk-6UWFTUQL.js} +530 -388
  32. package/chunks/{chunk-W5DXUTXD.js → chunk-6XJMFJ4D.js} +8 -8
  33. package/chunks/{chunk-ACZRB7AD.js → chunk-6XU3PH66.js} +3 -3
  34. package/chunks/{chunk-NGJOAKJY.js → chunk-72LNFGUY.js} +3 -3
  35. package/chunks/{chunk-33FNCQSY.js → chunk-7MH4J33A.js} +2 -2
  36. package/chunks/{chunk-2AGOQ7QO.js → chunk-7UFKAV7Y.js} +118 -6
  37. package/chunks/{chunk-O7V7N4G7.js → chunk-AE77C5ZU.js} +198 -35
  38. package/chunks/{chunk-JELIWHXD.js → chunk-AOHJKPKL.js} +1 -1
  39. package/chunks/{chunk-GLNBDYUX.js → chunk-AXMWHKXA.js} +6 -2
  40. package/chunks/{chunk-H36SETQS.js → chunk-B2GJNDTV.js} +1 -1
  41. package/chunks/{chunk-QMBEW7EW.js → chunk-BGG4MBYD.js} +2 -2
  42. package/chunks/{chunk-6WBWIPBF.js → chunk-BVWVWGLE.js} +2 -2
  43. package/chunks/{chunk-GK2H5GRC.js → chunk-CB2464BK.js} +5 -5
  44. package/chunks/{chunk-2UISUFHQ.js → chunk-CJXIIILK.js} +3 -3
  45. package/chunks/{chunk-WK4TJUEA.js → chunk-CKASRHZI.js} +1 -1
  46. package/chunks/{chunk-Z7JILXGX.js → chunk-CNIID3TV.js} +3 -3
  47. package/chunks/{chunk-5MJGUQU5.js → chunk-CSZEXZBE.js} +3 -3
  48. package/chunks/{chunk-KKN2IE7Q.js → chunk-CTJLZLB5.js} +1 -1
  49. package/chunks/{chunk-HY25ULVN.js → chunk-CXE7E23H.js} +131 -48
  50. package/chunks/{chunk-4WTAQEHV.js → chunk-CYR3HI5X.js} +3 -3
  51. package/chunks/{chunk-KHUA3NQV.js → chunk-DBOFL3LQ.js} +2 -2
  52. package/chunks/{chunk-4LKVQFHM.js → chunk-DREZZAZM.js} +2 -2
  53. package/chunks/{chunk-SQC6K5HI.js → chunk-E33LOKRA.js} +1 -1
  54. package/chunks/{chunk-2DNKEBXY.js → chunk-EI3HZX6C.js} +1 -1
  55. package/chunks/{chunk-U25CMJYY.js → chunk-EKPKKXY2.js} +1 -1
  56. package/chunks/{chunk-RHTTKJTP.js → chunk-EORNAQDT.js} +1 -1
  57. package/chunks/{chunk-432XCUHF.js → chunk-EQL65XGA.js} +1 -1
  58. package/chunks/{chunk-TYERNYH4.js → chunk-EUNWC2VS.js} +2 -2
  59. package/chunks/{chunk-OWSW7EYP.js → chunk-EUQTXRKZ.js} +6 -6
  60. package/chunks/{chunk-UH7Z7Y45.js → chunk-FOGU3LJX.js} +1 -1
  61. package/chunks/{chunk-536SWZTA.js → chunk-FPM27XN4.js} +4 -4
  62. package/chunks/{chunk-E4WHKETF.js → chunk-FVKHVJZQ.js} +2 -49
  63. package/chunks/{chunk-YMBOEAF4.js → chunk-FZBZSYKU.js} +1 -1
  64. package/chunks/{chunk-YZQTA3ID.js → chunk-GDXET5XU.js} +31 -3396
  65. package/chunks/{chunk-A5YZ3FA2.js → chunk-GM463R2B.js} +1 -1
  66. package/chunks/{chunk-MOHAWIAW.js → chunk-GNPNYXJB.js} +2 -2
  67. package/chunks/{chunk-2POQWYM6.js → chunk-GSS34377.js} +3 -3
  68. package/chunks/{chunk-CJ5WLD5Y.js → chunk-H2UQ2M5Z.js} +2 -2
  69. package/chunks/{chunk-SUKEUUAA.js → chunk-HQB2KUAN.js} +1 -1
  70. package/chunks/{chunk-JE44IPH6.js → chunk-HYRDKNUY.js} +2 -2
  71. package/chunks/{chunk-D7D7RXIJ.js → chunk-IC4Z6LX6.js} +1 -1
  72. package/chunks/{chunk-HU5TUALO.js → chunk-IIJEYBNH.js} +3 -3
  73. package/chunks/{chunk-EMYZIABH.js → chunk-IUFV6FYU.js} +1 -1
  74. package/chunks/{chunk-4S4OEQ6U.js → chunk-J6SZID63.js} +2 -2
  75. package/chunks/{chunk-BFHXDAR7.js → chunk-KKBPOU75.js} +1 -1
  76. package/chunks/{chunk-XM2O73NC.js → chunk-KKJJB5X6.js} +2455 -1314
  77. package/chunks/{chunk-SLSWFHDF.js → chunk-KR4ZSC7K.js} +4 -4
  78. package/chunks/{chunk-RFUHDCNF.js → chunk-KXSDEOFU.js} +1 -1
  79. package/chunks/{chunk-MGSSJT27.js → chunk-L4N6TIP7.js} +5 -3
  80. package/chunks/{chunk-OP2OHZ7K.js → chunk-LA7YLSR6.js} +6 -6
  81. package/chunks/{chunk-EXCEQD22.js → chunk-LEMXGVEP.js} +4 -4
  82. package/chunks/{chunk-WVAESIM6.js → chunk-LZC3B5N2.js} +4 -4
  83. package/chunks/{chunk-6O5DVH27.js → chunk-M6HMMKVG.js} +1 -1
  84. package/chunks/{chunk-75QMRMO7.js → chunk-MAJS7AT4.js} +3 -3
  85. package/chunks/{chunk-T5U6IM4C.js → chunk-MVUQRLOH.js} +3 -3
  86. package/chunks/{chunk-GLWP3FDB.js → chunk-MZSJ43WV.js} +31 -2
  87. package/chunks/{chunk-ZPPP6VCL.js → chunk-NG2R4N5O.js} +1 -1
  88. package/chunks/{chunk-UGTWD35F.js → chunk-NLREQJFK.js} +1 -1
  89. package/chunks/{chunk-N2GJU6KI.js → chunk-OFI7IGST.js} +12 -12
  90. package/chunks/{chunk-VGFPFM4U.js → chunk-OH2VKQXH.js} +42 -16
  91. package/chunks/{chunk-G5NNWEYE.js → chunk-OHJLEW5J.js} +4 -4
  92. package/chunks/{chunk-3RXUYQJI.js → chunk-OIVKILPI.js} +49 -0
  93. package/chunks/{chunk-VNQCPBC2.js → chunk-OMKQH5C5.js} +3 -3
  94. package/chunks/{chunk-LBWNSLJK.js → chunk-ONSZH6VM.js} +2 -2
  95. package/chunks/{chunk-DYA25Y7U.js → chunk-OWMAZHIX.js} +1 -1
  96. package/chunks/{chunk-4JH77A2U.js → chunk-P2AJ7FTI.js} +1 -1
  97. package/chunks/{chunk-WNU7TZTO.js → chunk-P3LEG54R.js} +3 -3
  98. package/chunks/{chunk-VSALQLT7.js → chunk-PJOBIWUG.js} +1 -1
  99. package/chunks/{chunk-PPUOYL77.js → chunk-PQBHU2IA.js} +49 -18
  100. package/chunks/{chunk-WO2B5E5B.js → chunk-Q3JQ7OSU.js} +1 -1
  101. package/chunks/{chunk-IMOQO6YL.js → chunk-QETYKPMG.js} +1 -1
  102. package/chunks/{chunk-DVBEGGLG.js → chunk-RERATVSK.js} +10 -9
  103. package/chunks/chunk-RGSBTHSU.js +3381 -0
  104. package/chunks/{chunk-DIT4V3XH.js → chunk-RMH5OWLD.js} +1 -1
  105. package/chunks/{chunk-TOGZTG4X.js → chunk-RNVQB725.js} +2 -2
  106. package/chunks/{chunk-GESMMPAK.js → chunk-RUL4S3K3.js} +79 -59
  107. package/chunks/{chunk-3LZKY4V4.js → chunk-RZHU3ILK.js} +5 -5
  108. package/chunks/{chunk-SKNE3KQC.js → chunk-SCI7K3GM.js} +4 -4
  109. package/chunks/{chunk-YAVY33G4.js → chunk-SEZ556DZ.js} +1 -1
  110. package/chunks/{chunk-Q5RM32DR.js → chunk-SHZYHGQH.js} +1 -1
  111. package/chunks/chunk-SOORFWKY.js +155 -0
  112. package/chunks/{chunk-K2B3X3E7.js → chunk-SPMY6CX6.js} +4 -4
  113. package/chunks/{chunk-FZFP7RZI.js → chunk-TDXGKHDN.js} +3 -3
  114. package/chunks/{chunk-R5RBXLNC.js → chunk-TLV2IMHR.js} +5 -5
  115. package/chunks/{chunk-U4AF3QLU.js → chunk-TRLYP7OF.js} +8 -8
  116. package/chunks/{chunk-ULPQQSDN.js → chunk-TYKC75AX.js} +3 -3
  117. package/chunks/{chunk-KVUBYJDM.js → chunk-TZEZYNYD.js} +1 -1
  118. package/chunks/{chunk-XC2VAFVZ.js → chunk-UVX4Y6IN.js} +1 -1
  119. package/chunks/{chunk-RK2EE3T7.js → chunk-VOARQPTA.js} +2 -2
  120. package/chunks/{chunk-TGGEZINK.js → chunk-W4B7UBUS.js} +7 -7
  121. package/chunks/{chunk-URN76TKR.js → chunk-WCG5O7IP.js} +2 -2
  122. package/chunks/{chunk-TSERKWCX.js → chunk-XCWO3SMQ.js} +3 -3
  123. package/chunks/{chunk-OXX3FG2N.js → chunk-Y4EWSQF7.js} +3 -3
  124. package/chunks/{chunk-3PRJYMXC.js → chunk-Y4NGLFGJ.js} +1 -1
  125. package/chunks/{chunk-A4VTILZT.js → chunk-Y7E5LNLO.js} +115 -85
  126. package/chunks/{chunk-3LGZEYOF.js → chunk-YHEEE624.js} +2 -2
  127. package/chunks/{chunk-SQOMTWQT.js → chunk-YJQCUTT2.js} +4 -4
  128. package/chunks/{chunk-GWRHVJY2.js → chunk-ZJ3VGYHK.js} +20 -20
  129. package/chunks/{chunk-LAAFLUQV.js → chunk-ZXU5UHMI.js} +1 -1
  130. package/chunks/{computer-use-5HXJ2P4X.js → computer-use-KEAPATUY.js} +35 -35
  131. package/chunks/{config-utils-VXD4SPVR.js → config-utils-K7SCOWHD.js} +2 -2
  132. package/chunks/{contextCommand-7BEHRX2H.js → contextCommand-ZJA6A5K5.js} +37 -37
  133. package/chunks/{core-runtime-U4VJ5TIV.js → core-runtime-QMJPWHCI.js} +35 -35
  134. package/chunks/{create-sub-session-QZNQY332.js → create-sub-session-DJE6XICH.js} +35 -35
  135. package/chunks/{create-sub-session-6EWLAZD5.js → create-sub-session-E4PBYXV5.js} +2 -2
  136. package/chunks/{cron-create-CCRIULJE.js → cron-create-GRBWYMIJ.js} +4 -4
  137. package/chunks/{cron-delete-FCFW6BGP.js → cron-delete-4CMKBR2M.js} +4 -4
  138. package/chunks/{cron-list-QDBVCHRF.js → cron-list-W7K4ASOA.js} +4 -4
  139. package/chunks/{daemon-YI5RY62O.js → daemon-SCTQMM7Z.js} +50 -2
  140. package/chunks/{daemon-status-provider-UJUGTDTL.js → daemon-status-provider-FSWDPE2G.js} +43 -43
  141. package/chunks/{daemon-trust-policy-ZHDD5VYQ.js → daemon-trust-policy-P5L5VFAY.js} +40 -40
  142. package/chunks/{daemon-trust-policy-monitor-5SHYBDGA.js → daemon-trust-policy-monitor-73JYN6ET.js} +40 -40
  143. package/chunks/{deferred-core-runtime-QWAEBTR5.js → deferred-core-runtime-BWRCCFTE.js} +35 -35
  144. package/chunks/{display-image-GUJA352B.js → display-image-O2XFPQTC.js} +4 -4
  145. package/chunks/{dist-A7H2KKUC.js → dist-K4WWQBHS.js} +277 -98
  146. package/chunks/{earlyInputCapture-5BMSGKOI.js → earlyInputCapture-L5ST23A6.js} +36 -36
  147. package/chunks/{edit-IVQQVYYK.js → edit-LHHRFNFK.js} +35 -35
  148. package/chunks/{enter-worktree-P3DF2N6O.js → enter-worktree-6NXCRZPF.js} +35 -35
  149. package/chunks/{enterPlanMode-KKTDVLAD.js → enterPlanMode-ZVQT4U7D.js} +35 -35
  150. package/chunks/{environment-W5TRDM3G.js → environment-GJ2HWJOS.js} +37 -37
  151. package/chunks/{errors-GJJB36IG.js → errors-6RLH3XXC.js} +37 -37
  152. package/chunks/{exit-worktree-LV5RLOCU.js → exit-worktree-I2YLUHHY.js} +35 -35
  153. package/chunks/{exitPlanMode-TUGOB2LL.js → exitPlanMode-7CCWKO7I.js} +35 -35
  154. package/chunks/{fast-path-2FU23PAQ.js → fast-path-DVFD4HQD.js} +2 -2
  155. package/chunks/{gemini-KDULDQPP.js → gemini-7FWGOYD4.js} +72 -72
  156. package/chunks/{geminiContentGenerator-LOCFHNVA.js → geminiContentGenerator-V2WVLIXU.js} +6 -6
  157. package/chunks/{glob-Z4NQFKWS.js → glob-3N6GGI75.js} +35 -35
  158. package/chunks/{goal-tools-3AZKX5WQ.js → goal-tools-APOW6UXL.js} +3 -3
  159. package/chunks/{grep-Z67Z7EN6.js → grep-V43ILZVX.js} +35 -35
  160. package/chunks/{handleAutoUpdate-DFUZE6I6.js → handleAutoUpdate-A5WFVWIA.js} +39 -39
  161. package/chunks/{i18n-R4FMZ7N2.js → i18n-PLVQ4FBZ.js} +36 -36
  162. package/chunks/{image-gen-4CQJPQP5.js → image-gen-7C6IK6DC.js} +9 -9
  163. package/chunks/{initializer-DK672ZVE.js → initializer-CVAIKZYL.js} +41 -41
  164. package/chunks/{installationInfo-PO4Z3ES7.js → installationInfo-J6QDHNTK.js} +36 -36
  165. package/chunks/{keychain-token-storage-7BT4TQ2A.js → keychain-token-storage-TVAMTNP7.js} +2 -2
  166. package/chunks/{list-QXQF6C53.js → list-ZZ4OUUWV.js} +43 -43
  167. package/chunks/{list-agents-GC4BRET7.js → list-agents-KFFIIS2G.js} +2 -2
  168. package/chunks/{loadedSettingsAdapter-4D7GUGW6.js → loadedSettingsAdapter-QRYRJSWL.js} +40 -40
  169. package/chunks/{loggingContentGenerator-2P3MNACM.js → loggingContentGenerator-OJCO75HM.js} +17 -17
  170. package/chunks/{loop-wakeup-SQQSBMEY.js → loop-wakeup-TLMJPMMP.js} +5 -5
  171. package/chunks/{ls-63CC3NNX.js → ls-UVVE2XGE.js} +4 -4
  172. package/chunks/{lsp-P6NVJVNT.js → lsp-QMEA2VLB.js} +2 -2
  173. package/chunks/{managed-npm-update-LWVJQTWO.js → managed-npm-update-PCOSCP2N.js} +36 -36
  174. package/chunks/{mcp-GHETAR6V.js → mcp-M3WKKWKY.js} +40 -40
  175. package/chunks/{monitor-4T7W4M6Q.js → monitor-GN24FH6C.js} +35 -35
  176. package/chunks/{nonInteractiveCli-P4UKCJFM.js → nonInteractiveCli-KPTU3VSQ.js} +72 -72
  177. package/chunks/{notebook-edit-OC2V7U5D.js → notebook-edit-4YM65BBO.js} +35 -35
  178. package/chunks/{openaiContentGenerator-RAJUFWQY.js → openaiContentGenerator-EDQT6GTV.js} +19 -19
  179. package/chunks/{pidfile-HVPYVRLS.js → pidfile-JOIIRN2C.js} +36 -36
  180. package/chunks/{processUtils-VIQ4JHVX.js → processUtils-5SV4MX3Q.js} +2 -2
  181. package/chunks/{qwenContentGenerator-2QLCUFNZ.js → qwenContentGenerator-ODRJSUGR.js} +40 -40
  182. package/chunks/{qwenOAuth2-J2X3EN43.js → qwenOAuth2-NESCMZ47.js} +8 -8
  183. package/chunks/{read-file-ZNAN2B26.js → read-file-HPSODLPK.js} +10 -10
  184. package/chunks/{read-mcp-resource-RTSSEER5.js → read-mcp-resource-2TNSJTC3.js} +2 -2
  185. package/chunks/{record-artifact-E6AWQU2Z.js → record-artifact-RAON52FC.js} +3 -3
  186. package/chunks/{resumeHistoryUtils-RCY7AL5Y.js → resumeHistoryUtils-TXCOFFMQ.js} +41 -40
  187. package/chunks/{ripGrep-C3KMLZM5.js → ripGrep-ZKQGTQAO.js} +35 -35
  188. package/chunks/{run-qwen-serve-3JN75CIQ.js → run-qwen-serve-ZPKPKECF.js} +65 -43
  189. package/chunks/{runtime-VUA4WQYD.js → runtime-2FLNNM36.js} +43 -43
  190. package/chunks/{scheduler-Z4IBXCOY.js → scheduler-365PJHNR.js} +35 -35
  191. package/chunks/{sdk-exporters-http-IL2346MJ.js → sdk-exporters-http-KHAB5JSD.js} +2 -2
  192. package/chunks/{sdk-impl-SYKGVWOZ.js → sdk-impl-KD7FSTC3.js} +2 -2
  193. package/chunks/{send-message-TL6FIMMN.js → send-message-ZM7MRUGP.js} +5 -5
  194. package/chunks/{serve-67T3P7XI.js → serve-QD2RNLKJ.js} +41 -41
  195. package/chunks/{server-46ZO2CLV.js → server-XLJVLTYM.js} +621 -332
  196. package/chunks/{session-B4IFAFC4.js → session-3VTUHH4Q.js} +73 -73
  197. package/chunks/{settings-AI2BTBOZ.js → settings-KULVPCQC.js} +39 -39
  198. package/chunks/{shell-BKII3B6E.js → shell-3SWW22MH.js} +35 -35
  199. package/chunks/{skill-6CFOWVGA.js → skill-KDHWYS7W.js} +14 -14
  200. package/chunks/{skill-settings-6BFQWMW4.js → skill-settings-NMY4JEJC.js} +39 -39
  201. package/chunks/{spawnChannel-FJXW35U7.js → spawnChannel-ZKS4Q5OU.js} +37 -37
  202. package/chunks/{standalone-update-WVINHRNS.js → standalone-update-7CXPGAQ4.js} +37 -37
  203. package/chunks/{startInteractiveUI-YE57CJ57.js → startInteractiveUI-2QQLEKM6.js} +399 -159
  204. package/chunks/{syntheticOutput-BN7E626U.js → syntheticOutput-ZLCUTKO2.js} +3 -3
  205. package/chunks/{task-create-Q727MXHJ.js → task-create-CQP5UEA3.js} +9 -9
  206. package/chunks/{task-list-G6KPQ5JT.js → task-list-XLEZOJXP.js} +5 -5
  207. package/chunks/{task-stop-TNXRNAL2.js → task-stop-7ZQM5CFF.js} +2 -2
  208. package/chunks/{task-update-YB7PXO4R.js → task-update-JA75U2SN.js} +9 -9
  209. package/chunks/{team-create-GNC7NFY6.js → team-create-2WTNGAOX.js} +35 -35
  210. package/chunks/{team-delete-GDO7H2T4.js → team-delete-MHY3UZGY.js} +5 -5
  211. package/chunks/{team-plan-approval-ECALJLIO.js → team-plan-approval-LZTYLEG4.js} +35 -35
  212. package/chunks/{terminal-image-renderer-II74TFVW.js → terminal-image-renderer-R5HHAFJN.js} +41 -36
  213. package/chunks/{theme-manager-2MGEDD22.js → theme-manager-PAUCSJFF.js} +36 -36
  214. package/chunks/{todoWrite-MHWHO5UO.js → todoWrite-UPVOHYGD.js} +4 -4
  215. package/chunks/{tool-search-S6LRRACA.js → tool-search-2BFCGLI6.js} +13 -13
  216. package/chunks/{total-session-admission-7WVAWQPU.js → total-session-admission-MK4SINFK.js} +39 -39
  217. package/chunks/{trustedFolders-NFS4KHO4.js → trustedFolders-TJ5S26N7.js} +36 -36
  218. package/chunks/{update-relaunch-Q5HLZ6UW.js → update-relaunch-N7AYLARF.js} +5 -5
  219. package/chunks/{updateCheck-UOVZSTP7.js → updateCheck-QRZ3DVT5.js} +38 -38
  220. package/chunks/{useAutoAcceptIndicator-PC6MOJCO.js → useAutoAcceptIndicator-DBJ7Y5AF.js} +42 -42
  221. package/chunks/{validateNonInterActiveAuth-YMQP3ZM7.js → validateNonInterActiveAuth-6ZQWUDS3.js} +69 -69
  222. package/chunks/{version-T4AQFZJH.js → version-AJQGQWXC.js} +1 -1
  223. package/chunks/{web-fetch-JQCJHEEX.js → web-fetch-QWJYRXFL.js} +13 -13
  224. package/chunks/{web-search-QGZ2KY4G.js → web-search-2AOXJGHU.js} +9 -9
  225. package/chunks/web-shell-static-O73YPVVC.js +33 -0
  226. package/chunks/{workflow-YIT27YWZ.js → workflow-ERH3SJG2.js} +36 -36
  227. package/chunks/{workspace-providers-status-FIDZQ2PL.js → workspace-providers-status-HZ474RA4.js} +43 -43
  228. package/chunks/{workspace-registration-store-RCSPE4DU.js → workspace-registration-store-6EUP4JXG.js} +1 -1
  229. package/chunks/{workspace-registry-5PEUCY6E.js → workspace-registry-R4APRRNC.js} +39 -39
  230. package/chunks/{workspace-service-LANDVPL7.js → workspace-service-HFIFDMU7.js} +45 -45
  231. package/chunks/{workspace-skills-status-2IQVJNIN.js → workspace-skills-status-HAHEIHGK.js} +41 -41
  232. package/chunks/{workspace-trust-reconciler-CZPZZCZC.js → workspace-trust-reconciler-65GTAGDK.js} +45 -45
  233. package/chunks/{write-file-G5VNGCOG.js → write-file-B34CDELV.js} +35 -35
  234. package/chunks/{zoom-image-6RBLD7X6.js → zoom-image-HPRBZHSS.js} +10 -10
  235. package/cli.js +12 -12
  236. package/package.json +3 -3
  237. package/web-shell/assets/{arc-B-Vtkp1W.js → arc-Ip-FFDJ0.js} +1 -1
  238. package/web-shell/assets/{architectureDiagram-3BPJPVTR-qmTXIj64.js → architectureDiagram-3BPJPVTR-CChqgwIb.js} +1 -1
  239. package/web-shell/assets/{blockDiagram-GPEHLZMM-ZlnXEtdP.js → blockDiagram-GPEHLZMM-BHN-Tfss.js} +1 -1
  240. package/web-shell/assets/{c4Diagram-AAUBKEIU-Wyoirf6Z.js → c4Diagram-AAUBKEIU-BhyjzDjN.js} +1 -1
  241. package/web-shell/assets/channel-Cu8qd6OB.js +1 -0
  242. package/web-shell/assets/{chunk-2J33WTMH-WQwbq9d8.js → chunk-2J33WTMH-BB9eyHrx.js} +1 -1
  243. package/web-shell/assets/{chunk-4BX2VUAB-DQKnAXC4.js → chunk-4BX2VUAB-BeV7ce_J.js} +1 -1
  244. package/web-shell/assets/{chunk-55IACEB6-DIdgXNcO.js → chunk-55IACEB6-DO7kXDiV.js} +1 -1
  245. package/web-shell/assets/{chunk-727SXJPM-CUwGOLEd.js → chunk-727SXJPM-B27MPznD.js} +1 -1
  246. package/web-shell/assets/{chunk-AQP2D5EJ-CCBGZFZ4.js → chunk-AQP2D5EJ-DHIjqjD_.js} +1 -1
  247. package/web-shell/assets/{chunk-FMBD7UC4-DMGXProk.js → chunk-FMBD7UC4-DabMqyN2.js} +1 -1
  248. package/web-shell/assets/{chunk-ND2GUHAM-yejcFqsh.js → chunk-ND2GUHAM-Dw7Nnnxc.js} +1 -1
  249. package/web-shell/assets/{chunk-QZHKN3VN-DxCyqTf7.js → chunk-QZHKN3VN-DdaZew1Q.js} +1 -1
  250. package/web-shell/assets/classDiagram-4FO5ZUOK-BI3KrXhq.js +1 -0
  251. package/web-shell/assets/classDiagram-v2-Q7XG4LA2-BI3KrXhq.js +1 -0
  252. package/web-shell/assets/{cose-bilkent-S5V4N54A-DOrF3cg_.js → cose-bilkent-S5V4N54A-CgBpCYH5.js} +1 -1
  253. package/web-shell/assets/{dagre-BM42HDAG-Be6CdYQ_.js → dagre-BM42HDAG-BB4IU8G0.js} +1 -1
  254. package/web-shell/assets/{diagram-2AECGRRQ-B_Rjsft2.js → diagram-2AECGRRQ-BcUTHU37.js} +1 -1
  255. package/web-shell/assets/{diagram-5GNKFQAL-BvQbKSm1.js → diagram-5GNKFQAL-B6Lyihyv.js} +1 -1
  256. package/web-shell/assets/{diagram-KO2AKTUF-BsdmMdpS.js → diagram-KO2AKTUF-CRIJOjpG.js} +1 -1
  257. package/web-shell/assets/{diagram-LMA3HP47-CrQlBaNr.js → diagram-LMA3HP47-DdNiwWWT.js} +1 -1
  258. package/web-shell/assets/{diagram-OG6HWLK6-aB1MD_DL.js → diagram-OG6HWLK6-Dz4b32Do.js} +1 -1
  259. package/web-shell/assets/{erDiagram-TEJ5UH35-F-eUUn9n.js → erDiagram-TEJ5UH35-D-8NGw77.js} +1 -1
  260. package/web-shell/assets/{flowDiagram-I6XJVG4X-DY_d8lUK.js → flowDiagram-I6XJVG4X-Dun26LyM.js} +1 -1
  261. package/web-shell/assets/{ganttDiagram-6RSMTGT7-Dqu7KBPg.js → ganttDiagram-6RSMTGT7-F10Hu1Gc.js} +1 -1
  262. package/web-shell/assets/{gitGraphDiagram-PVQCEYII-2IkU_VEj.js → gitGraphDiagram-PVQCEYII-Bf8Ez6-D.js} +1 -1
  263. package/web-shell/assets/{index-BuSbqggh.js → index-BXqw-nGq.js} +1 -1
  264. package/web-shell/assets/{index-DrfC2e9s.js → index-hcgjV7vS.js} +333 -333
  265. package/web-shell/assets/{infoDiagram-5YYISTIA-C4orwzPw.js → infoDiagram-5YYISTIA-DVgTMLvj.js} +1 -1
  266. package/web-shell/assets/{ishikawaDiagram-YF4QCWOH-fXUEfef_.js → ishikawaDiagram-YF4QCWOH-uT-KepvK.js} +1 -1
  267. package/web-shell/assets/{journeyDiagram-JHISSGLW-Bs0I1_J5.js → journeyDiagram-JHISSGLW-Vg_XadQf.js} +1 -1
  268. package/web-shell/assets/{kanban-definition-UN3LZRKU-BPRj1dw_.js → kanban-definition-UN3LZRKU-Dyv1ESBE.js} +1 -1
  269. package/web-shell/assets/{linear-DFS6ZDpW.js → linear-BMIepYX3.js} +1 -1
  270. package/web-shell/assets/{mermaid.core-CZxjWMaO.js → mermaid.core-zA8pJ9ag.js} +5 -5
  271. package/web-shell/assets/{mindmap-definition-RKZ34NQL-Dsr3PmNs.js → mindmap-definition-RKZ34NQL-BCW_BZ_5.js} +1 -1
  272. package/web-shell/assets/{pieDiagram-4H26LBE5-D5Ngpz5Y.js → pieDiagram-4H26LBE5-DseNEGp2.js} +1 -1
  273. package/web-shell/assets/{quadrantDiagram-W4KKPZXB-WJK9I25z.js → quadrantDiagram-W4KKPZXB-6Z7wr1Fi.js} +1 -1
  274. package/web-shell/assets/{requirementDiagram-4Y6WPE33-CmrYcwOH.js → requirementDiagram-4Y6WPE33-CVOlCRPf.js} +1 -1
  275. package/web-shell/assets/{sankeyDiagram-5OEKKPKP-7SjCc4Mv.js → sankeyDiagram-5OEKKPKP-CGhgrUJZ.js} +1 -1
  276. package/web-shell/assets/{sequenceDiagram-3UESZ5HK-Dl9E0IRM.js → sequenceDiagram-3UESZ5HK-dlqmpLuQ.js} +1 -1
  277. package/web-shell/assets/{stateDiagram-AJRCARHV-CRRio7yV.js → stateDiagram-AJRCARHV-B9EW10Xb.js} +1 -1
  278. package/web-shell/assets/stateDiagram-v2-BHNVJYJU-CJTZJJ5X.js +1 -0
  279. package/web-shell/assets/{timeline-definition-PNZ67QCA-DVyXjjfq.js → timeline-definition-PNZ67QCA-BBRh0mgZ.js} +1 -1
  280. package/web-shell/assets/{vennDiagram-CIIHVFJN-Nb2Lckzq.js → vennDiagram-CIIHVFJN-B8Gs-REP.js} +1 -1
  281. package/web-shell/assets/{wardley-L42UT6IY-DuL_otIP.js → wardley-L42UT6IY-D_y80Ur7.js} +1 -1
  282. package/web-shell/assets/{wardleyDiagram-YWT4CUSO-DVI9Q4Aa.js → wardleyDiagram-YWT4CUSO-D-CNfHJ-.js} +1 -1
  283. package/web-shell/assets/{xychartDiagram-2RQKCTM6-BNjAm7KD.js → xychartDiagram-2RQKCTM6-DQ5CvELo.js} +1 -1
  284. package/web-shell/index.html +1 -1
  285. package/web-shell/assets/channel-DXaHnfjS.js +0 -1
  286. package/web-shell/assets/classDiagram-4FO5ZUOK-BigU82A0.js +0 -1
  287. package/web-shell/assets/classDiagram-v2-Q7XG4LA2-BigU82A0.js +0 -1
  288. package/web-shell/assets/stateDiagram-v2-BHNVJYJU-1atT7XaU.js +0 -1
@@ -21,13 +21,13 @@ import {
21
21
  shouldSuppressRememberErrorDetails,
22
22
  workspaceMemoryFailureCode,
23
23
  workspaceMemoryFailureDiagnostics
24
- } from "./chunk-U4AF3QLU.js";
24
+ } from "./chunk-TRLYP7OF.js";
25
25
  import {
26
26
  deriveWebSocketBase,
27
27
  openQwenAsrRealtimeStream,
28
28
  openVoiceStream,
29
29
  openVoiceStreamWithRetry
30
- } from "./chunk-WO2B5E5B.js";
30
+ } from "./chunk-Q3JQ7OSU.js";
31
31
  import {
32
32
  SetupGithubError,
33
33
  collectSessionData,
@@ -39,15 +39,15 @@ import {
39
39
  toJson,
40
40
  toJsonl,
41
41
  toMarkdown
42
- } from "./chunk-W5DXUTXD.js";
42
+ } from "./chunk-6XJMFJ4D.js";
43
43
  import {
44
44
  OBSERVED_CONTACT_MAX_FRESH_WITHIN_SECONDS,
45
45
  ObservedChannelContactStore
46
- } from "./chunk-DYA25Y7U.js";
46
+ } from "./chunk-OWMAZHIX.js";
47
+ import "./chunk-KXSDEOFU.js";
47
48
  import {
48
49
  escapeAnsiCtrlCodes
49
50
  } from "./chunk-4NFY2S7N.js";
50
- import "./chunk-RFUHDCNF.js";
51
51
  import "./chunk-2MIN6GRR.js";
52
52
  import "./chunk-QHTIBUWB.js";
53
53
  import "./chunk-EKTCKZV5.js";
@@ -98,7 +98,6 @@ import {
98
98
  parseOptionalWorkspaceCwd,
99
99
  parsePermissionVoteBody,
100
100
  requireSessionId,
101
- require_express,
102
101
  resolveAcpHttpEnabled,
103
102
  resolveCdpMcpCommand,
104
103
  safeBody,
@@ -109,34 +108,46 @@ import {
109
108
  setRateLimiter,
110
109
  unsafeRevealSecret,
111
110
  validateMcpRuntimeServerName
112
- } from "./chunk-YZQTA3ID.js";
111
+ } from "./chunk-RGSBTHSU.js";
113
112
  import {
114
113
  isLoopbackBind
115
114
  } from "./chunk-RXFQM6FQ.js";
116
115
  import "./chunk-HGCQ5SE7.js";
117
116
  import {
118
- assertValidChannelSecretUpdates
119
- } from "./chunk-CJ5WLD5Y.js";
117
+ createTotalSessionAdmissionController
118
+ } from "./chunk-AKA24BGO.js";
120
119
  import {
121
120
  WorkspaceGenerationClosedError,
122
121
  createSingleWorkspaceRegistry,
123
122
  createWorkspaceSessionOwnerIndex
124
123
  } from "./chunk-2M5N3DHY.js";
124
+ import "./chunk-GRC5HGPI.js";
125
+ import {
126
+ assertValidChannelSecretUpdates
127
+ } from "./chunk-H2UQ2M5Z.js";
125
128
  import {
126
129
  createWorkspaceProvidersStatusProvider
127
- } from "./chunk-TGGEZINK.js";
130
+ } from "./chunk-W4B7UBUS.js";
128
131
  import {
129
132
  getAuthTypeFromEnv,
130
133
  resolveCliGenerationConfig
131
- } from "./chunk-5MJGUQU5.js";
134
+ } from "./chunk-CSZEXZBE.js";
132
135
  import {
133
136
  createWorkspaceSkillsStatusProvider
134
- } from "./chunk-WNU7TZTO.js";
137
+ } from "./chunk-P3LEG54R.js";
135
138
  import "./chunk-BGXZBI5B.js";
139
+ import {
140
+ isServeDebugMode,
141
+ mountWebShellAssets,
142
+ mountWebShellSpaFallback
143
+ } from "./chunk-SOORFWKY.js";
144
+ import {
145
+ require_express
146
+ } from "./chunk-GDXET5XU.js";
136
147
  import {
137
148
  evaluateDaemonWorkspaceTrust,
138
149
  readDaemonTrustPolicySnapshot
139
- } from "./chunk-VNQCPBC2.js";
150
+ } from "./chunk-OMKQH5C5.js";
140
151
  import {
141
152
  EMPTY_WORKSPACE_VOICE_UPDATE_ERROR,
142
153
  MAX_WORKSPACE_SKILL_NAME_LENGTH,
@@ -150,14 +161,14 @@ import {
150
161
  validateWorkspaceSkillName,
151
162
  validateWorkspaceVoiceState,
152
163
  voiceSettingsScopeToWire
153
- } from "./chunk-DVBEGGLG.js";
164
+ } from "./chunk-RERATVSK.js";
154
165
  import {
155
166
  PermissionRulesValidationError,
156
167
  buildPermissionSettings,
157
168
  isPermissionRuleType,
158
169
  normalizePermissionRules,
159
170
  readPermissionRuleSet
160
- } from "./chunk-CA4UIDFU.js";
171
+ } from "./chunk-6GONZVLS.js";
161
172
  import {
162
173
  assertVoiceBaseUrlNetworkAllowed,
163
174
  isStreamingVoiceModel,
@@ -165,13 +176,13 @@ import {
165
176
  resolveVoiceTranscriptionConfig,
166
177
  sanitizeVoiceErrorMessage,
167
178
  transcribeVoiceAudio
168
- } from "./chunk-O7V7N4G7.js";
179
+ } from "./chunk-AE77C5ZU.js";
169
180
  import {
170
181
  isVoiceEnabled,
171
182
  isVoiceMode,
172
183
  readVoiceModel
173
- } from "./chunk-C4CBJQKY.js";
174
- import "./chunk-JELIWHXD.js";
184
+ } from "./chunk-55LYDVPU.js";
185
+ import "./chunk-AOHJKPKL.js";
175
186
  import "./chunk-Z4X5MTRT.js";
176
187
  import {
177
188
  WorkspacePermissionRulesSessionRequiredError,
@@ -179,15 +190,11 @@ import {
179
190
  WorkspaceSkillNotFoundError,
180
191
  WorkspaceSkillNotToggleableError
181
192
  } from "./chunk-OA4JVLSA.js";
182
- import {
183
- createTotalSessionAdmissionController
184
- } from "./chunk-AKA24BGO.js";
185
- import "./chunk-GRC5HGPI.js";
186
193
  import {
187
194
  daemonObservedContactsPath,
188
195
  loadChannelsConfig
189
- } from "./chunk-OWSW7EYP.js";
190
- import "./chunk-G5NNWEYE.js";
196
+ } from "./chunk-EUQTXRKZ.js";
197
+ import "./chunk-OHJLEW5J.js";
191
198
  import "./chunk-57OAHC2Y.js";
192
199
  import {
193
200
  LIVE_HOST_BUNDLE_ID,
@@ -196,42 +203,42 @@ import {
196
203
  } from "./chunk-NKLP3DCK.js";
197
204
  import {
198
205
  createDaemonStatusProvider
199
- } from "./chunk-SQOMTWQT.js";
206
+ } from "./chunk-YJQCUTT2.js";
200
207
  import "./chunk-VXZBKKQR.js";
201
- import "./chunk-K2B3X3E7.js";
208
+ import "./chunk-SPMY6CX6.js";
202
209
  import "./chunk-3SH53ANB.js";
203
210
  import {
204
211
  snapshotProcessEnv
205
- } from "./chunk-ULPQQSDN.js";
212
+ } from "./chunk-TYKC75AX.js";
206
213
  import {
207
214
  SessionArtifactAuthorizationError,
208
215
  SessionArtifactValidationError,
209
216
  createAcpSessionBridge,
210
217
  parseSessionSource
211
- } from "./chunk-OP2OHZ7K.js";
218
+ } from "./chunk-LA7YLSR6.js";
212
219
  import {
213
220
  EVENT_SCHEMA_VERSION,
214
221
  EventBus,
215
222
  SubscriberLimitExceededError
216
- } from "./chunk-GLWP3FDB.js";
223
+ } from "./chunk-MZSJ43WV.js";
217
224
  import "./chunk-XCGIMOLN.js";
218
225
  import "./chunk-OCPBI7J5.js";
219
- import "./chunk-SQC6K5HI.js";
226
+ import "./chunk-E33LOKRA.js";
220
227
  import {
221
228
  STATUS_SCHEMA_VERSION,
222
229
  createIdleWorkspaceMemoryStatus,
223
230
  mapDomainErrorToErrorKind
224
- } from "./chunk-UGTWD35F.js";
231
+ } from "./chunk-NLREQJFK.js";
225
232
  import "./chunk-K6KS3LTN.js";
226
233
  import "./chunk-FC4KQFCS.js";
227
234
  import "./chunk-T3CHYWJZ.js";
228
235
  import {
229
236
  parseChannelWebhookConfigLenient
230
- } from "./chunk-LAAFLUQV.js";
237
+ } from "./chunk-ZXU5UHMI.js";
231
238
  import "./chunk-VWOVHOTT.js";
232
239
  import {
233
240
  supportedChannelCatalog
234
- } from "./chunk-EMYZIABH.js";
241
+ } from "./chunk-IUFV6FYU.js";
235
242
  import "./chunk-V6WHFGST.js";
236
243
  import {
237
244
  MAX_REGISTERED_WORKSPACES,
@@ -240,7 +247,7 @@ import {
240
247
  WorkspaceRegistrationStoreLimitError,
241
248
  normalizeWorkspaceDisplayName,
242
249
  workspaceRegistrationId
243
- } from "./chunk-4JH77A2U.js";
250
+ } from "./chunk-P2AJ7FTI.js";
244
251
  import "./chunk-R574ATRM.js";
245
252
  import {
246
253
  BranchWhilePromptActiveError,
@@ -316,7 +323,7 @@ import {
316
323
  getWritableScopes,
317
324
  loadSettings,
318
325
  validateSettingValue
319
- } from "./chunk-PPUOYL77.js";
326
+ } from "./chunk-PQBHU2IA.js";
320
327
  import "./chunk-RKUWKYED.js";
321
328
  import "./chunk-GOXKNSDZ.js";
322
329
  import "./chunk-IDS7MSUP.js";
@@ -325,14 +332,14 @@ import {
325
332
  detectSystemLanguage,
326
333
  resolveLanguageSetting,
327
334
  resolveSupportedLanguage
328
- } from "./chunk-KHUA3NQV.js";
329
- import "./chunk-RK2EE3T7.js";
335
+ } from "./chunk-DBOFL3LQ.js";
336
+ import "./chunk-VOARQPTA.js";
330
337
  import "./chunk-6PEXNQTX.js";
331
- import "./chunk-YMBOEAF4.js";
338
+ import "./chunk-FZBZSYKU.js";
332
339
  import "./chunk-VJNBRRZG.js";
333
340
  import {
334
341
  getWorkspaceTrustStatus
335
- } from "./chunk-ACZRB7AD.js";
342
+ } from "./chunk-6XU3PH66.js";
336
343
  import "./chunk-ALGGS7UH.js";
337
344
  import {
338
345
  isWithinRoot as isWithinRoot2
@@ -411,7 +418,7 @@ import {
411
418
  writeWorkspaceContextFile,
412
419
  writeWorktreeSession,
413
420
  writeWorktreeSessionMarker
414
- } from "./chunk-A4VTILZT.js";
421
+ } from "./chunk-Y7E5LNLO.js";
415
422
  import "./chunk-GOFAQQZA.js";
416
423
  import "./chunk-5M6IDOMF.js";
417
424
  import "./chunk-TWPJO254.js";
@@ -419,12 +426,12 @@ import "./chunk-H6XPXXMH.js";
419
426
  import {
420
427
  MAX_JOBS,
421
428
  nextDurableFireMs
422
- } from "./chunk-Z7JILXGX.js";
423
- import "./chunk-T5U6IM4C.js";
424
- import "./chunk-TSERKWCX.js";
425
- import "./chunk-33FNCQSY.js";
429
+ } from "./chunk-CNIID3TV.js";
430
+ import "./chunk-MVUQRLOH.js";
431
+ import "./chunk-XCWO3SMQ.js";
432
+ import "./chunk-7MH4J33A.js";
426
433
  import "./chunk-6PVPNMXU.js";
427
- import "./chunk-DIT4V3XH.js";
434
+ import "./chunk-RMH5OWLD.js";
428
435
  import {
429
436
  nextFireTime,
430
437
  parseCron
@@ -437,32 +444,32 @@ import {
437
444
  readCronTasks,
438
445
  taskHasLegacyCondition,
439
446
  updateCronTasks
440
- } from "./chunk-MOHAWIAW.js";
441
- import "./chunk-3PRJYMXC.js";
447
+ } from "./chunk-GNPNYXJB.js";
448
+ import "./chunk-Y4NGLFGJ.js";
442
449
  import "./chunk-O6GEWCJA.js";
443
450
  import "./chunk-T26EAKDL.js";
444
451
  import "./chunk-ZPJWUGCS.js";
445
452
  import "./chunk-CPBF7KYF.js";
446
- import "./chunk-4S4OEQ6U.js";
453
+ import "./chunk-J6SZID63.js";
447
454
  import "./chunk-KRXPRVGL.js";
448
- import "./chunk-A5YZ3FA2.js";
449
- import "./chunk-YAVY33G4.js";
450
- import "./chunk-2UISUFHQ.js";
451
- import "./chunk-MBEMTXQT.js";
455
+ import "./chunk-GM463R2B.js";
456
+ import "./chunk-SEZ556DZ.js";
457
+ import "./chunk-CJXIIILK.js";
458
+ import "./chunk-3K7FH2KQ.js";
452
459
  import {
453
460
  APPROVAL_MODES
454
- } from "./chunk-6WBWIPBF.js";
461
+ } from "./chunk-BVWVWGLE.js";
455
462
  import "./chunk-S6LOFUVP.js";
456
463
  import {
457
464
  SubagentError,
458
465
  SubagentErrorCode
459
- } from "./chunk-WVAESIM6.js";
466
+ } from "./chunk-LZC3B5N2.js";
460
467
  import "./chunk-K623ENWT.js";
461
468
  import {
462
469
  escapeXml
463
470
  } from "./chunk-AQ37AY7B.js";
464
- import "./chunk-432XCUHF.js";
465
- import "./chunk-HU5TUALO.js";
471
+ import "./chunk-EQL65XGA.js";
472
+ import "./chunk-IIJEYBNH.js";
466
473
  import {
467
474
  QwenOAuth2Client,
468
475
  QwenOAuthPollError,
@@ -471,30 +478,32 @@ import {
471
478
  isDeviceAuthorizationSuccess,
472
479
  isDeviceTokenPending,
473
480
  isDeviceTokenSuccess
474
- } from "./chunk-XC656O42.js";
481
+ } from "./chunk-22NBYCPD.js";
475
482
  import "./chunk-NAVJD2PQ.js";
476
- import "./chunk-QYPT3QUD.js";
477
- import "./chunk-QMBEW7EW.js";
483
+ import "./chunk-3ULCB3NE.js";
484
+ import "./chunk-BGG4MBYD.js";
478
485
  import "./chunk-DGEIYUC3.js";
479
486
  import "./chunk-MPHPFVKK.js";
480
- import "./chunk-GLNBDYUX.js";
487
+ import "./chunk-AXMWHKXA.js";
481
488
  import "./chunk-DJ2GSRLV.js";
482
- import "./chunk-QZKYZCN3.js";
489
+ import "./chunk-33ACCIIY.js";
483
490
  import {
484
491
  addDaemonRequestAttribute,
492
+ captureDaemonTelemetryContext,
485
493
  emitDaemonLog,
486
494
  hashDaemonWorkspace,
487
495
  recordDaemonBridgeError,
488
496
  recordDaemonError,
489
497
  recordDaemonHttpRequest,
490
498
  recordDaemonHttpResponse,
499
+ runWithDaemonTelemetryContext,
491
500
  withDaemonRequestSpan
492
- } from "./chunk-MGSSJT27.js";
501
+ } from "./chunk-L4N6TIP7.js";
493
502
  import "./chunk-2J3OJGTL.js";
494
503
  import "./chunk-P3QQPMQA.js";
495
- import "./chunk-6O5DVH27.js";
504
+ import "./chunk-M6HMMKVG.js";
496
505
  import "./chunk-GLCZKT5V.js";
497
- import "./chunk-2DNKEBXY.js";
506
+ import "./chunk-EI3HZX6C.js";
498
507
  import "./chunk-CR3C7WXL.js";
499
508
  import "./chunk-XWRJCPHC.js";
500
509
  import {
@@ -507,19 +516,19 @@ import {
507
516
  isWithinRoot,
508
517
  parseLineTolerant,
509
518
  read
510
- } from "./chunk-PX5DNLSA.js";
519
+ } from "./chunk-2U3WZGZG.js";
511
520
  import "./chunk-WOJZWRAZ.js";
512
521
  import "./chunk-VGC4I5JJ.js";
513
- import "./chunk-E4WHKETF.js";
514
- import "./chunk-ZPPP6VCL.js";
515
- import "./chunk-D7D7RXIJ.js";
516
- import "./chunk-BOGOR4HB.js";
522
+ import "./chunk-FVKHVJZQ.js";
523
+ import "./chunk-NG2R4N5O.js";
524
+ import "./chunk-IC4Z6LX6.js";
525
+ import "./chunk-6EOI4HOK.js";
517
526
  import "./chunk-46UV252V.js";
518
527
  import "./chunk-ZBVS26BY.js";
519
- import "./chunk-BFHXDAR7.js";
520
- import "./chunk-TYERNYH4.js";
521
- import "./chunk-UH7Z7Y45.js";
522
- import "./chunk-5L6CQ4ZU.js";
528
+ import "./chunk-KKBPOU75.js";
529
+ import "./chunk-EUNWC2VS.js";
530
+ import "./chunk-FOGU3LJX.js";
531
+ import "./chunk-6M26GBKX.js";
523
532
  import "./chunk-W4RQUHY3.js";
524
533
  import "./chunk-LKRMNRSN.js";
525
534
  import {
@@ -527,7 +536,7 @@ import {
527
536
  Storage,
528
537
  createDebugLogger,
529
538
  runWithoutDebugLogSession
530
- } from "./chunk-3RXUYQJI.js";
539
+ } from "./chunk-OIVKILPI.js";
531
540
  import "./chunk-VOQXFAY5.js";
532
541
  import {
533
542
  writeStderrLine,
@@ -554,7 +563,7 @@ import {
554
563
 
555
564
  // packages/cli/src/serve/server.ts
556
565
  init_esbuild_shims();
557
- var import_express5 = __toESM(require_express(), 1);
566
+ var import_express4 = __toESM(require_express(), 1);
558
567
 
559
568
  // packages/cli/src/serve/acp-http/index.ts
560
569
  init_esbuild_shims();
@@ -1171,11 +1180,11 @@ function decodeTextCursor(cursor) {
1171
1180
  return { off, size, dev, ino };
1172
1181
  }
1173
1182
  __name(decodeTextCursor, "decodeTextCursor");
1174
- function assertCursorMatchesFile(cursor, stats, path15) {
1183
+ function assertCursorMatchesFile(cursor, stats, path14) {
1175
1184
  if (String(stats.dev) !== cursor.dev || String(stats.ino) !== cursor.ino || stats.size < cursor.size) {
1176
1185
  throw new FsError(
1177
1186
  "hash_mismatch",
1178
- `cursor no longer matches the file it was issued for: ${path15}`,
1187
+ `cursor no longer matches the file it was issued for: ${path14}`,
1179
1188
  { hint: "re-read the file from the beginning to get a fresh cursor" }
1180
1189
  );
1181
1190
  }
@@ -5155,17 +5164,6 @@ __name(mountWorkspaceQualifiedMemoryRememberRoutes, "mountWorkspaceQualifiedMemo
5155
5164
  init_esbuild_shims();
5156
5165
  import { promises as fs2 } from "node:fs";
5157
5166
  import * as path8 from "node:path";
5158
-
5159
- // packages/cli/src/serve/debug-mode.ts
5160
- init_esbuild_shims();
5161
- function isServeDebugMode() {
5162
- const value = process.env["QWEN_SERVE_DEBUG"];
5163
- if (!value) return false;
5164
- return !["0", "false", "off", "no"].includes(value.trim().toLowerCase());
5165
- }
5166
- __name(isServeDebugMode, "isServeDebugMode");
5167
-
5168
- // packages/cli/src/serve/workspace-memory.ts
5169
5167
  function requireTrustedWorkspace2(deps, res) {
5170
5168
  if (deps.isWorkspaceTrusted?.() !== false) return true;
5171
5169
  res.status(403).json({
@@ -13937,7 +13935,7 @@ function mountAcpHttp(app, bridge, opts) {
13937
13935
  if (!enabled) return void 0;
13938
13936
  const daemonEnv = opts.daemonEnv ?? process.env;
13939
13937
  const getPrimaryEnv = /* @__PURE__ */ __name(() => opts.workspaceRegistry ? runtimeEffectiveEnv(opts.workspaceRegistry.primary, daemonEnv) : daemonEnv, "getPrimaryEnv");
13940
- const path15 = opts.path ?? "/acp";
13938
+ const path14 = opts.path ?? "/acp";
13941
13939
  const dispatcherRef = {};
13942
13940
  let disposed = false;
13943
13941
  const rejectIfDisposed = /* @__PURE__ */ __name((res) => {
@@ -14109,7 +14107,7 @@ function mountAcpHttp(app, bridge, opts) {
14109
14107
  const primaryMount = {
14110
14108
  primary: true,
14111
14109
  workspaceCwd: opts.boundWorkspace,
14112
- routeLabel: logSafe(path15),
14110
+ routeLabel: logSafe(path14),
14113
14111
  rateLimitScope: opts.workspaceRegistry?.primary.workspaceId ?? "primary",
14114
14112
  registry,
14115
14113
  dispatcher,
@@ -14263,7 +14261,7 @@ function mountAcpHttp(app, bridge, opts) {
14263
14261
  });
14264
14262
  }, "handleAcpPost");
14265
14263
  app.post(
14266
- path15,
14264
+ path14,
14267
14265
  (req, res) => handleAcpPost(primaryMount, req, res)
14268
14266
  );
14269
14267
  const handleAcpGet = /* @__PURE__ */ __name((mount, req, res) => {
@@ -14361,10 +14359,10 @@ function mountAcpHttp(app, bridge, opts) {
14361
14359
  onPumpSettled();
14362
14360
  });
14363
14361
  }, "handleAcpGet");
14364
- app.get(path15, (req, res) => {
14362
+ app.get(path14, (req, res) => {
14365
14363
  handleAcpGet(primaryMount, req, res);
14366
14364
  });
14367
- app.delete(path15, (req, res) => {
14365
+ app.delete(path14, (req, res) => {
14368
14366
  handleAcpDelete(primaryMount, req, res);
14369
14367
  });
14370
14368
  const createSecondaryAcpMount = /* @__PURE__ */ __name((rt) => {
@@ -14566,7 +14564,7 @@ function mountAcpHttp(app, bridge, opts) {
14566
14564
  const isPluralAcpShape = pluralRawSelector !== null;
14567
14565
  const pluralVoiceRawSelector = opts.workspaceVoiceConnection ? pluralWorkspaceRawSelector(rawPath, PLURAL_VOICE_WS_SUFFIX) : null;
14568
14566
  const isPluralVoiceShape = pluralVoiceRawSelector !== null;
14569
- if (rawPath !== path15 && !isCdpPath && !extraRoute && !isPluralAcpShape && !isPluralVoiceShape) {
14567
+ if (rawPath !== path14 && !isCdpPath && !extraRoute && !isPluralAcpShape && !isPluralVoiceShape) {
14570
14568
  logReject(`unknown-path ${logSafe(rawPath)}`);
14571
14569
  socket.destroy();
14572
14570
  return;
@@ -15103,7 +15101,7 @@ function mountAcpHttp(app, bridge, opts) {
15103
15101
  });
15104
15102
  }, "upgradeListener");
15105
15103
  httpServer.on("upgrade", upgradeListener);
15106
- writeStderrLine(`qwen serve: /acp WebSocket transport enabled on ${path15}`);
15104
+ writeStderrLine(`qwen serve: /acp WebSocket transport enabled on ${path14}`);
15107
15105
  }
15108
15106
  __name(setupWebSocket, "setupWebSocket");
15109
15107
  return {
@@ -15287,6 +15285,7 @@ function buildModelsConfig(settings, env) {
15287
15285
  return new ModelsConfig({
15288
15286
  initialAuthType: selectedAuthType,
15289
15287
  modelProvidersConfig: merged.modelProviders,
15288
+ providerProtocolConfig: merged.providerProtocol,
15290
15289
  generationConfig: resolvedCliConfig.generationConfig,
15291
15290
  generationConfigSources: resolvedCliConfig.sources
15292
15291
  });
@@ -15772,105 +15771,6 @@ var CdpTunnelRegistry = class {
15772
15771
  }
15773
15772
  };
15774
15773
 
15775
- // packages/cli/src/serve/web-shell-static.ts
15776
- init_esbuild_shims();
15777
- var import_express2 = __toESM(require_express(), 1);
15778
- import * as path9 from "node:path";
15779
- var WEB_SHELL_CSP_DIRECTIVES = [
15780
- "default-src 'self'",
15781
- "script-src 'self' 'unsafe-inline' 'unsafe-eval' 'wasm-unsafe-eval'",
15782
- "style-src 'self' 'unsafe-inline'",
15783
- "font-src 'self' data:",
15784
- "img-src 'self' data: blob:",
15785
- "connect-src 'self'",
15786
- "worker-src 'self' blob:",
15787
- // base-uri does NOT fall back to default-src; lock it so an injected <base>
15788
- // (the SPA renders AI-generated markdown) cannot repoint relative URLs to an
15789
- // attacker origin.
15790
- "base-uri 'none'"
15791
- ];
15792
- function buildWebShellCsp(frameAncestors = []) {
15793
- const fa = frameAncestors.length ? `frame-ancestors ${frameAncestors.join(" ")}` : "frame-ancestors 'none'";
15794
- return [...WEB_SHELL_CSP_DIRECTIVES, fa].join("; ");
15795
- }
15796
- __name(buildWebShellCsp, "buildWebShellCsp");
15797
- var WEB_SHELL_CSP = buildWebShellCsp();
15798
- function isDocumentNavigation(req) {
15799
- const fetchMode = req.headers["sec-fetch-mode"];
15800
- const fetchDest = req.headers["sec-fetch-dest"];
15801
- const accept = req.headers.accept ?? "";
15802
- return fetchMode === "navigate" || fetchDest === "document" || accept.trim().toLowerCase().startsWith("text/html");
15803
- }
15804
- __name(isDocumentNavigation, "isDocumentNavigation");
15805
- function createSendIndex(webShellDir, frameAncestors = []) {
15806
- const indexPath = path9.join(webShellDir, "index.html");
15807
- const csp = buildWebShellCsp(frameAncestors);
15808
- return (res) => {
15809
- res.status(200).set("Content-Security-Policy", csp).set("X-Content-Type-Options", "nosniff").set("Referrer-Policy", "no-referrer").set(
15810
- // `microphone=(self)` lets the same-origin Web Shell document request
15811
- // the mic for voice dictation (the prompt won't even appear under an
15812
- // empty `microphone=()` allowlist). Still blocks cross-origin iframes;
15813
- // camera/geolocation/payment stay disabled (unused).
15814
- "Permissions-Policy",
15815
- "camera=(), microphone=(self), geolocation=(), payment=()"
15816
- ).set("Cache-Control", "no-cache");
15817
- if (frameAncestors.length === 0) {
15818
- res.set("X-Frame-Options", "DENY");
15819
- }
15820
- res.sendFile(
15821
- indexPath,
15822
- { cacheControl: false, dotfiles: "allow" },
15823
- (err) => {
15824
- if (!err) return;
15825
- writeStderrLine(
15826
- `qwen serve: Web Shell index send failed: ${err instanceof Error ? err.message : String(err)}`
15827
- );
15828
- if (!res.headersSent) {
15829
- res.status(500).type("text/plain").send("Failed to load Web Shell");
15830
- } else {
15831
- res.end();
15832
- }
15833
- }
15834
- );
15835
- };
15836
- }
15837
- __name(createSendIndex, "createSendIndex");
15838
- function mountWebShellAssets(app, webShellDir, frameAncestors = []) {
15839
- const sendIndex = createSendIndex(webShellDir, frameAncestors);
15840
- app.use(
15841
- "/assets",
15842
- import_express2.default.static(path9.join(webShellDir, "assets"), {
15843
- index: false,
15844
- immutable: true,
15845
- maxAge: "1y"
15846
- })
15847
- );
15848
- app.use("/assets", (req, res) => {
15849
- if (isServeDebugMode()) {
15850
- writeStderrLine(
15851
- `qwen serve: Web Shell asset not found: ${req.originalUrl}`
15852
- );
15853
- }
15854
- res.status(404).type("text/plain").send("Not found");
15855
- });
15856
- app.get("/", (_req, res) => sendIndex(res));
15857
- }
15858
- __name(mountWebShellAssets, "mountWebShellAssets");
15859
- function mountWebShellSpaFallback(app, webShellDir, frameAncestors = []) {
15860
- const sendIndex = createSendIndex(webShellDir, frameAncestors);
15861
- app.use((req, res, next) => {
15862
- if (req.method !== "GET" && req.method !== "HEAD") return next();
15863
- if (!isDocumentNavigation(req)) return next();
15864
- if (isServeDebugMode()) {
15865
- writeStderrLine(
15866
- `qwen serve: Web Shell SPA fallback served for ${req.method} ${req.originalUrl}`
15867
- );
15868
- }
15869
- sendIndex(res);
15870
- });
15871
- }
15872
- __name(mountWebShellSpaFallback, "mountWebShellSpaFallback");
15873
-
15874
15774
  // packages/cli/src/serve/workspace-generation.ts
15875
15775
  init_esbuild_shims();
15876
15776
 
@@ -20437,8 +20337,8 @@ function decodePathSegment(value) {
20437
20337
  }
20438
20338
  __name(decodePathSegment, "decodePathSegment");
20439
20339
  function matchLegacySessionTelemetryRoute(method, requestPath) {
20440
- const path15 = requestPath.length > 1 && requestPath.endsWith("/") ? requestPath.slice(0, -1) : requestPath;
20441
- const requestSegments = path15.split("/").slice(1);
20340
+ const path14 = requestPath.length > 1 && requestPath.endsWith("/") ? requestPath.slice(0, -1) : requestPath;
20341
+ const requestSegments = path14.split("/").slice(1);
20442
20342
  const prefix = requestSegments[0]?.toLowerCase();
20443
20343
  if (prefix !== "session" && prefix !== "sessions" && prefix !== "permission") {
20444
20344
  return void 0;
@@ -20490,23 +20390,23 @@ __name(setDaemonTelemetryWorkspace, "setDaemonTelemetryWorkspace");
20490
20390
  function resolveDaemonTelemetryRoute(req) {
20491
20391
  const legacyRoute = matchLegacySessionTelemetryRoute(req.method, req.path);
20492
20392
  if (legacyRoute) return legacyRoute;
20493
- const path15 = req.path.replace(/\/$/, "") || "/";
20494
- if (req.method === "GET" && path15 === "/daemon/status") {
20393
+ const path14 = req.path.replace(/\/$/, "") || "/";
20394
+ if (req.method === "GET" && path14 === "/daemon/status") {
20495
20395
  return { route: "GET /daemon/status" };
20496
20396
  }
20497
- if (req.method === "GET" && /^\/workspace\/[^/]+\/sessions$/.test(path15)) {
20397
+ if (req.method === "GET" && /^\/workspace\/[^/]+\/sessions$/.test(path14)) {
20498
20398
  return { route: "GET /workspace/:id/sessions" };
20499
20399
  }
20500
- if (req.method === "GET" && /^\/workspaces\/[^/]+\/sessions$/.test(path15)) {
20400
+ if (req.method === "GET" && /^\/workspaces\/[^/]+\/sessions$/.test(path14)) {
20501
20401
  return { route: "GET /workspace/:id/sessions" };
20502
20402
  }
20503
- if (req.method === "GET" && /^\/workspace\/[^/]+\/session-info$/.test(path15)) {
20403
+ if (req.method === "GET" && /^\/workspace\/[^/]+\/session-info$/.test(path14)) {
20504
20404
  return { route: "GET /workspace/:id/session-info" };
20505
20405
  }
20506
- if (req.method === "GET" && /^\/workspaces\/[^/]+\/session-info$/.test(path15)) {
20406
+ if (req.method === "GET" && /^\/workspaces\/[^/]+\/session-info$/.test(path14)) {
20507
20407
  return { route: "GET /workspace/:id/session-info" };
20508
20408
  }
20509
- const workspaceTranscript = path15.match(
20409
+ const workspaceTranscript = path14.match(
20510
20410
  /^\/workspaces\/[^/]+\/session\/([^/]+)\/transcript$/
20511
20411
  );
20512
20412
  if (workspaceTranscript?.[1] && req.method === "GET") {
@@ -20515,7 +20415,7 @@ function resolveDaemonTelemetryRoute(req) {
20515
20415
  sessionId: decodePathSegment(workspaceTranscript[1])
20516
20416
  };
20517
20417
  }
20518
- const workspaceExport = path15.match(
20418
+ const workspaceExport = path14.match(
20519
20419
  /^\/workspaces\/[^/]+\/session\/([^/]+)\/export$/
20520
20420
  );
20521
20421
  if (workspaceExport?.[1] && req.method === "GET") {
@@ -20524,7 +20424,7 @@ function resolveDaemonTelemetryRoute(req) {
20524
20424
  sessionId: decodePathSegment(workspaceExport[1])
20525
20425
  };
20526
20426
  }
20527
- const workspaceArchivedExport = path15.match(
20427
+ const workspaceArchivedExport = path14.match(
20528
20428
  /^\/workspaces\/[^/]+\/session\/([^/]+)\/archive\/export$/
20529
20429
  );
20530
20430
  if (workspaceArchivedExport?.[1] && req.method === "GET") {
@@ -20534,8 +20434,8 @@ function resolveDaemonTelemetryRoute(req) {
20534
20434
  };
20535
20435
  }
20536
20436
  const pluralWorkspacePrefix = /^\/workspaces\/[^/]+/;
20537
- if (pluralWorkspacePrefix.test(path15)) {
20538
- const suffix = path15.replace(pluralWorkspacePrefix, "/workspace");
20437
+ if (pluralWorkspacePrefix.test(path14)) {
20438
+ const suffix = path14.replace(pluralWorkspacePrefix, "/workspace");
20539
20439
  if (req.method === "GET") {
20540
20440
  if (suffix === "/workspace/mcp" || suffix === "/workspace/skills" || suffix === "/workspace/tools" || suffix === "/workspace/providers" || suffix === "/workspace/env" || suffix === "/workspace/preflight" || suffix === "/workspace/hooks" || suffix === "/workspace/settings" || suffix === "/workspace/voice" || suffix === "/workspace/permissions" || suffix === "/workspace/trust" || suffix === "/workspace/memory" || suffix === "/workspace/agents") {
20541
20441
  return { route: `GET ${suffix}` };
@@ -20594,58 +20494,58 @@ function resolveDaemonTelemetryRoute(req) {
20594
20494
  return { route: "DELETE /workspace/session-groups/:groupId" };
20595
20495
  }
20596
20496
  }
20597
- if (req.method === "POST" && path15 === "/workspace/init") {
20497
+ if (req.method === "POST" && path14 === "/workspace/init") {
20598
20498
  return { route: "POST /workspace/init" };
20599
20499
  }
20600
- if (req.method === "POST" && path15 === "/workspace/setup-github") {
20500
+ if (req.method === "POST" && path14 === "/workspace/setup-github") {
20601
20501
  return { route: "POST /workspace/setup-github" };
20602
20502
  }
20603
- if (req.method === "POST" && path15 === "/workspace/reload") {
20503
+ if (req.method === "POST" && path14 === "/workspace/reload") {
20604
20504
  return { route: "POST /workspace/reload" };
20605
20505
  }
20606
- const mcpRestart = path15.match(/^\/workspace\/mcp\/([^/]+)\/restart$/);
20506
+ const mcpRestart = path14.match(/^\/workspace\/mcp\/([^/]+)\/restart$/);
20607
20507
  if (mcpRestart?.[1] && req.method === "POST") {
20608
20508
  return { route: "POST /workspace/mcp/:server/restart" };
20609
20509
  }
20610
- if (req.method === "POST" && path15 === "/workspace/mcp/servers") {
20510
+ if (req.method === "POST" && path14 === "/workspace/mcp/servers") {
20611
20511
  return { route: "POST /workspace/mcp/servers" };
20612
20512
  }
20613
- const mcpDelete = path15.match(/^\/workspace\/mcp\/servers\/([^/]+)$/);
20513
+ const mcpDelete = path14.match(/^\/workspace\/mcp\/servers\/([^/]+)$/);
20614
20514
  if (mcpDelete?.[1] && req.method === "DELETE") {
20615
20515
  return { route: "DELETE /workspace/mcp/servers/:name" };
20616
20516
  }
20617
- if (req.method === "POST" && path15 === "/workspace/auth/device-flow") {
20517
+ if (req.method === "POST" && path14 === "/workspace/auth/device-flow") {
20618
20518
  return { route: "POST /workspace/auth/device-flow" };
20619
20519
  }
20620
- const deviceFlowDelete = path15.match(
20520
+ const deviceFlowDelete = path14.match(
20621
20521
  /^\/workspace\/auth\/device-flow\/([^/]+)$/
20622
20522
  );
20623
20523
  if (deviceFlowDelete?.[1] && req.method === "DELETE") {
20624
20524
  return { route: "DELETE /workspace/auth/device-flow/:id" };
20625
20525
  }
20626
- const toolEnable = path15.match(/^\/workspace\/tools\/([^/]+)\/enable$/);
20526
+ const toolEnable = path14.match(/^\/workspace\/tools\/([^/]+)\/enable$/);
20627
20527
  if (toolEnable?.[1] && req.method === "POST") {
20628
20528
  return { route: "POST /workspace/tools/:name/enable" };
20629
20529
  }
20630
- if (path15 === "/workspace/settings") {
20530
+ if (path14 === "/workspace/settings") {
20631
20531
  if (req.method === "GET") return { route: "GET /workspace/settings" };
20632
20532
  if (req.method === "POST") return { route: "POST /workspace/settings" };
20633
20533
  }
20634
- if (path15 === "/workspace/permissions") {
20534
+ if (path14 === "/workspace/permissions") {
20635
20535
  if (req.method === "GET") return { route: "GET /workspace/permissions" };
20636
20536
  if (req.method === "POST") return { route: "POST /workspace/permissions" };
20637
20537
  }
20638
- if (path15 === "/workspace/trust") {
20538
+ if (path14 === "/workspace/trust") {
20639
20539
  if (req.method === "GET") return { route: "GET /workspace/trust" };
20640
20540
  }
20641
- if (req.method === "POST" && path15 === "/workspace/trust/request") {
20541
+ if (req.method === "POST" && path14 === "/workspace/trust/request") {
20642
20542
  return { route: "POST /workspace/trust/request" };
20643
20543
  }
20644
- if (path15 === "/workspace/voice") {
20544
+ if (path14 === "/workspace/voice") {
20645
20545
  if (req.method === "GET") return { route: "GET /workspace/voice" };
20646
20546
  if (req.method === "POST") return { route: "POST /workspace/voice" };
20647
20547
  }
20648
- if (req.method === "POST" && path15 === "/workspace/voice/transcribe") {
20548
+ if (req.method === "POST" && path14 === "/workspace/voice/transcribe") {
20649
20549
  return { route: "POST /workspace/voice/transcribe" };
20650
20550
  }
20651
20551
  return void 0;
@@ -20914,7 +20814,7 @@ __name(registerPermissionRoutes, "registerPermissionRoutes");
20914
20814
  init_esbuild_shims();
20915
20815
  import * as crypto3 from "node:crypto";
20916
20816
  import * as fs5 from "node:fs";
20917
- import * as path10 from "node:path";
20817
+ import * as path9 from "node:path";
20918
20818
 
20919
20819
  // packages/cli/src/serve/server/prompt-deadline.ts
20920
20820
  init_esbuild_shims();
@@ -22682,7 +22582,7 @@ function registerSessionRoutes(app, deps) {
22682
22582
  const workspaceParam = req.params[paramName] ?? "";
22683
22583
  const byId = workspaceRegistry.getByWorkspaceId(workspaceParam);
22684
22584
  if (byId) return byId;
22685
- if (!path10.isAbsolute(workspaceParam)) {
22585
+ if (!path9.isAbsolute(workspaceParam)) {
22686
22586
  res.status(400).json({
22687
22587
  error: `\`:${paramName}\` must decode to a workspace id or absolute path`
22688
22588
  });
@@ -23573,7 +23473,7 @@ function registerSessionRoutes(app, deps) {
23573
23473
  if (worktreeMeta) {
23574
23474
  try {
23575
23475
  const createAllowedRoots = [
23576
- path10.join(workspaceCwd, ".qwen", "worktrees")
23476
+ path9.join(workspaceCwd, ".qwen", "worktrees")
23577
23477
  ];
23578
23478
  let createRepoTop = null;
23579
23479
  try {
@@ -23584,7 +23484,7 @@ function registerSessionRoutes(app, deps) {
23584
23484
  }
23585
23485
  if (createRepoTop && createRepoTop !== workspaceCwd) {
23586
23486
  createAllowedRoots.push(
23587
- path10.join(createRepoTop, ".qwen", "worktrees")
23487
+ path9.join(createRepoTop, ".qwen", "worktrees")
23588
23488
  );
23589
23489
  }
23590
23490
  await runtime.bridge.changeSessionCwd(session.sessionId, {
@@ -23883,7 +23783,7 @@ function registerSessionRoutes(app, deps) {
23883
23783
  if (sidecar) {
23884
23784
  let realTarget;
23885
23785
  const candidateRoots = [
23886
- path10.join(workspaceCwd, ".qwen", "worktrees")
23786
+ path9.join(workspaceCwd, ".qwen", "worktrees")
23887
23787
  ];
23888
23788
  try {
23889
23789
  realTarget = fs5.realpathSync(sidecar.worktreePath);
@@ -23895,13 +23795,13 @@ function registerSessionRoutes(app, deps) {
23895
23795
  } catch {
23896
23796
  }
23897
23797
  if (repoTop && repoTop !== workspaceCwd) {
23898
- candidateRoots.push(path10.join(repoTop, ".qwen", "worktrees"));
23798
+ candidateRoots.push(path9.join(repoTop, ".qwen", "worktrees"));
23899
23799
  }
23900
23800
  const contained = candidateRoots.some((root) => {
23901
23801
  try {
23902
23802
  const realRoot = fs5.realpathSync(root);
23903
- const rel = path10.relative(realRoot, realTarget);
23904
- return !rel.startsWith("..") && !path10.isAbsolute(rel);
23803
+ const rel = path9.relative(realRoot, realTarget);
23804
+ return !rel.startsWith("..") && !path9.isAbsolute(rel);
23905
23805
  } catch {
23906
23806
  return false;
23907
23807
  }
@@ -24217,7 +24117,7 @@ function registerSessionRoutes(app, deps) {
24217
24117
  async (req, res, sessionId, runtime) => {
24218
24118
  const body = safeBody(req);
24219
24119
  const targetPath = body["path"];
24220
- if (typeof targetPath !== "string" || targetPath.length === 0 || !path10.isAbsolute(targetPath)) {
24120
+ if (typeof targetPath !== "string" || targetPath.length === 0 || !path9.isAbsolute(targetPath)) {
24221
24121
  res.status(400).json({
24222
24122
  error: "`path` is required and must be an absolute path",
24223
24123
  code: "invalid_path"
@@ -27251,7 +27151,7 @@ __name(registerUsageStatsRoutes, "registerUsageStatsRoutes");
27251
27151
  // packages/cli/src/serve/scheduled-task-keepalive.ts
27252
27152
  init_esbuild_shims();
27253
27153
  import * as fsSync from "node:fs";
27254
- import * as path11 from "node:path";
27154
+ import * as path10 from "node:path";
27255
27155
  var log = createDebugLogger("SCHED_KEEPALIVE");
27256
27156
  function collectBoundSessionIds(tasks) {
27257
27157
  const seen = /* @__PURE__ */ new Set();
@@ -27477,8 +27377,8 @@ function startScheduledTaskKeepalive(opts) {
27477
27377
  opts.runtimeBaseDir,
27478
27378
  () => getCronFilePath(boundWorkspace)
27479
27379
  );
27480
- const cronDir = path11.dirname(cronFilePath);
27481
- const cronFileName = path11.basename(cronFilePath);
27380
+ const cronDir = path10.dirname(cronFilePath);
27381
+ const cronFileName = path10.basename(cronFilePath);
27482
27382
  let fileWatcher;
27483
27383
  try {
27484
27384
  fsSync.mkdirSync(cronDir, { recursive: true });
@@ -28942,6 +28842,8 @@ __name(registerWorkspaceQualifiedSettingsRoutes, "registerWorkspaceQualifiedSett
28942
28842
 
28943
28843
  // packages/cli/src/serve/routes/sse-events.ts
28944
28844
  init_esbuild_shims();
28845
+ import { randomUUID as randomUUID7 } from "node:crypto";
28846
+ import { performance as performance2 } from "node:perf_hooks";
28945
28847
 
28946
28848
  // packages/cli/src/serve/server/error-response.ts
28947
28849
  init_esbuild_shims();
@@ -29526,6 +29428,39 @@ __name(errorPayload, "errorPayload");
29526
29428
 
29527
29429
  // packages/cli/src/serve/routes/sse-events.ts
29528
29430
  var activeSseCount = 0;
29431
+ var SSE_STREAM_ID_HEADER = "X-Qwen-SSE-Stream-Id";
29432
+ var SSE_STREAM_ID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
29433
+ var SSE_CONNECT_REASONS = [
29434
+ "initial",
29435
+ "resume",
29436
+ "prompt_restart",
29437
+ "stream_end",
29438
+ "transport_error",
29439
+ "state_resync",
29440
+ "unknown"
29441
+ ];
29442
+ var SSE_CONNECT_REASON_SET = new Set(
29443
+ SSE_CONNECT_REASONS
29444
+ );
29445
+ function parseSseConnectReason(raw) {
29446
+ return typeof raw === "string" && SSE_CONNECT_REASON_SET.has(raw) ? raw : "unknown";
29447
+ }
29448
+ __name(parseSseConnectReason, "parseSseConnectReason");
29449
+ function parsePreviousSseStreamId(raw) {
29450
+ return typeof raw === "string" && SSE_STREAM_ID_RE.test(raw) ? raw.toLowerCase() : void 0;
29451
+ }
29452
+ __name(parsePreviousSseStreamId, "parsePreviousSseStreamId");
29453
+ function parseSseClientId(raw) {
29454
+ return typeof raw === "string" && raw.length > 0 && raw.length <= MAX_CLIENT_ID_LENGTH && CLIENT_ID_RE.test(raw) ? raw : void 0;
29455
+ }
29456
+ __name(parseSseClientId, "parseSseClientId");
29457
+ function boundedDiagnosticString(value) {
29458
+ return Array.from(value.slice(0, 256)).slice(0, 128).map((character) => {
29459
+ const codePoint = character.codePointAt(0) ?? 0;
29460
+ return codePoint <= 31 || codePoint >= 127 && codePoint <= 159 || codePoint === 8232 || codePoint === 8233 || codePoint >= 8234 && codePoint <= 8238 || codePoint >= 8294 && codePoint <= 8297 ? " " : character;
29461
+ }).join("");
29462
+ }
29463
+ __name(boundedDiagnosticString, "boundedDiagnosticString");
29529
29464
  function getActiveSseCount() {
29530
29465
  return activeSseCount;
29531
29466
  }
@@ -29551,6 +29486,134 @@ function registerSseEventsRoutes(app, deps) {
29551
29486
  const { workspaceRegistry, daemonLog, sendBridgeError: sendBridgeError2, writerIdleTimeoutMs } = deps;
29552
29487
  app.get("/session/:id/events", async (req, res) => {
29553
29488
  const sessionId = req.params["id"];
29489
+ const diagnosticSessionId = boundedDiagnosticString(sessionId);
29490
+ const streamId = randomUUID7();
29491
+ const clientId = parseSseClientId(req.headers["x-qwen-client-id"]);
29492
+ const connectReason = parseSseConnectReason(req.query["connectReason"]);
29493
+ const previousStreamId = parsePreviousSseStreamId(
29494
+ req.query["previousStreamId"]
29495
+ );
29496
+ const telemetryContext = captureDaemonTelemetryContext();
29497
+ const telemetryBaseAttributes = {
29498
+ "session.id": sessionId,
29499
+ "qwen-code.daemon.sse.stream_id": streamId,
29500
+ "qwen-code.daemon.sse.client_reported_connect_reason": connectReason,
29501
+ ...clientId ? { "qwen-code.client_id": clientId } : {},
29502
+ ...previousStreamId ? {
29503
+ "qwen-code.daemon.sse.client_reported_previous_stream_id": previousStreamId
29504
+ } : {}
29505
+ };
29506
+ const emitLifecycleLog = /* @__PURE__ */ __name((eventName, body, attributes = {}) => {
29507
+ void runWithDaemonTelemetryContext(telemetryContext, async () => {
29508
+ emitDaemonLog(
29509
+ body,
29510
+ { ...telemetryBaseAttributes, ...attributes },
29511
+ { eventName }
29512
+ );
29513
+ }).catch(() => {
29514
+ });
29515
+ }, "emitLifecycleLog");
29516
+ let slowWarningCount = 0;
29517
+ let eventBusEvictionReason;
29518
+ const onSubscriberDiagnostic = /* @__PURE__ */ __name((diagnostic) => {
29519
+ const triggerEventType = boundedDiagnosticString(
29520
+ diagnostic.data.triggerEventType
29521
+ );
29522
+ const common = {
29523
+ queueSize: diagnostic.data.queueSize,
29524
+ maxQueued: diagnostic.data.maxQueued,
29525
+ queuedBytes: diagnostic.data.queuedBytes,
29526
+ maxQueuedBytes: diagnostic.data.maxQueuedBytes,
29527
+ triggerEventType,
29528
+ triggerEventBytes: diagnostic.data.triggerEventBytes
29529
+ };
29530
+ const telemetryCommon = {
29531
+ "qwen-code.daemon.sse.queue_size": common.queueSize,
29532
+ "qwen-code.daemon.sse.max_queued": common.maxQueued,
29533
+ "qwen-code.daemon.sse.queued_bytes": common.queuedBytes,
29534
+ "qwen-code.daemon.sse.max_queued_bytes": common.maxQueuedBytes,
29535
+ "qwen-code.daemon.sse.trigger_event_type": common.triggerEventType,
29536
+ "qwen-code.daemon.sse.trigger_event_bytes": common.triggerEventBytes
29537
+ };
29538
+ let handled = false;
29539
+ if (diagnostic.type === "slow_client_warning") {
29540
+ slowWarningCount += 1;
29541
+ const context = {
29542
+ sessionId: diagnosticSessionId,
29543
+ clientId,
29544
+ streamId,
29545
+ connectReason,
29546
+ previousStreamId,
29547
+ ...common,
29548
+ threshold: diagnostic.data.threshold,
29549
+ lastEventId: diagnostic.data.lastEventId
29550
+ };
29551
+ try {
29552
+ if (daemonLog) {
29553
+ daemonLog.warn("SSE slow client warning", context);
29554
+ } else {
29555
+ writeStderrLine(
29556
+ `qwen serve: SSE slow client warning ${JSON.stringify(context)}`
29557
+ );
29558
+ }
29559
+ handled = true;
29560
+ } catch {
29561
+ handled = false;
29562
+ }
29563
+ emitLifecycleLog(
29564
+ "qwen-code.daemon.sse.slow_client_warning",
29565
+ "Daemon SSE slow client warning.",
29566
+ {
29567
+ ...telemetryCommon,
29568
+ "qwen-code.daemon.sse.threshold": diagnostic.data.threshold,
29569
+ "qwen-code.daemon.sse.last_event_id": diagnostic.data.lastEventId
29570
+ }
29571
+ );
29572
+ } else {
29573
+ eventBusEvictionReason = boundedDiagnosticString(
29574
+ diagnostic.data.reason
29575
+ );
29576
+ const threshold = diagnostic.data.reason === "queue_bytes_overflow" ? "bytes" : "frames";
29577
+ const context = {
29578
+ sessionId: diagnosticSessionId,
29579
+ clientId,
29580
+ streamId,
29581
+ connectReason,
29582
+ previousStreamId,
29583
+ ...common,
29584
+ threshold,
29585
+ reason: eventBusEvictionReason,
29586
+ droppedAfter: diagnostic.data.droppedAfter,
29587
+ ...diagnostic.data.eventBytes !== void 0 ? { eventBytes: diagnostic.data.eventBytes } : {}
29588
+ };
29589
+ try {
29590
+ if (daemonLog) {
29591
+ daemonLog.warn("SSE client evicted", context);
29592
+ } else {
29593
+ writeStderrLine(
29594
+ `qwen serve: SSE client evicted ${JSON.stringify(context)}`
29595
+ );
29596
+ }
29597
+ handled = true;
29598
+ } catch {
29599
+ handled = false;
29600
+ }
29601
+ emitLifecycleLog(
29602
+ "qwen-code.daemon.sse.client_evicted",
29603
+ "Daemon SSE client evicted.",
29604
+ {
29605
+ ...telemetryCommon,
29606
+ "qwen-code.daemon.sse.threshold": threshold,
29607
+ "qwen-code.daemon.sse.event_bus_eviction_reason": eventBusEvictionReason,
29608
+ "qwen-code.daemon.sse.dropped_after_event_id": diagnostic.data.droppedAfter,
29609
+ ...diagnostic.data.eventBytes !== void 0 ? {
29610
+ "qwen-code.daemon.sse.rejected_event_bytes": diagnostic.data.eventBytes
29611
+ } : {}
29612
+ }
29613
+ );
29614
+ }
29615
+ return handled;
29616
+ }, "onSubscriberDiagnostic");
29554
29617
  const lastEventId = parseLastEventId(req.headers["last-event-id"]);
29555
29618
  const eventEpoch = parseEventEpochHeader(req.headers["x-qwen-event-epoch"]);
29556
29619
  const maxQueued = parseMaxQueuedQuery(req.query["maxQueued"], res);
@@ -29572,13 +29635,15 @@ function registerSseEventsRoutes(app, deps) {
29572
29635
  const iterable = virtualKey ? await deps.virtualSubagentSessions?.subscribe(runtime, sessionId, {
29573
29636
  signal: abort.signal,
29574
29637
  lastEventId,
29575
- ...maxQueued !== void 0 ? { maxQueued } : {}
29638
+ ...maxQueued !== void 0 ? { maxQueued } : {},
29639
+ onSubscriberDiagnostic
29576
29640
  }) : runtime.bridge.subscribeEvents(sessionId, {
29577
29641
  signal: abort.signal,
29578
29642
  lastEventId,
29579
29643
  ...eventEpoch !== void 0 ? { epoch: eventEpoch } : {},
29580
29644
  ...maxQueued !== void 0 ? { maxQueued } : {},
29581
- ...snapshot ? { snapshot: true } : {}
29645
+ ...snapshot ? { snapshot: true } : {},
29646
+ onSubscriberDiagnostic
29582
29647
  });
29583
29648
  if (!iterable) {
29584
29649
  res.status(404).json({
@@ -29599,7 +29664,7 @@ function registerSseEventsRoutes(app, deps) {
29599
29664
  } catch (err) {
29600
29665
  if (err instanceof SubscriberLimitExceededError) {
29601
29666
  writeStderrLine(
29602
- `qwen serve: subscriber limit reached for session ${sessionId} (limit=${err.limit}); rejecting new SSE client with 429`
29667
+ `qwen serve: subscriber limit reached for session ${diagnosticSessionId} (limit=${err.limit}); rejecting new SSE client with 429`
29603
29668
  );
29604
29669
  res.setHeader("Retry-After", "5");
29605
29670
  res.status(429).json({
@@ -29615,21 +29680,84 @@ function registerSseEventsRoutes(app, deps) {
29615
29680
  });
29616
29681
  return;
29617
29682
  }
29618
- if (daemonLog) {
29619
- const sseOpenedAt = Date.now();
29620
- const sseClientId = req.headers["x-qwen-client-id"];
29621
- daemonLog.info("SSE stream opened", { sessionId, clientId: sseClientId });
29622
- res.on("close", () => {
29623
- try {
29624
- daemonLog.info("SSE stream closed", {
29625
- sessionId,
29626
- clientId: sseClientId,
29627
- durationMs: Date.now() - sseOpenedAt
29628
- });
29629
- } catch {
29630
- }
29683
+ const openedAt = performance2.now();
29684
+ let closeReason;
29685
+ let terminalCandidate;
29686
+ let terminalEventType;
29687
+ let eventFramesWriteSettled = 0;
29688
+ let lastEventIdWritten;
29689
+ let backpressureCount = 0;
29690
+ let maxDrainWaitMs = 0;
29691
+ let activeDrainStartedAt;
29692
+ let maxLivePublishToWriteSettledMs = 0;
29693
+ let liveTimingEnabled = lastEventId === void 0;
29694
+ let finalized = false;
29695
+ let sseCounted = false;
29696
+ const finalize = /* @__PURE__ */ __name(() => {
29697
+ if (finalized) return;
29698
+ finalized = true;
29699
+ if (activeDrainStartedAt !== void 0) {
29700
+ maxDrainWaitMs = Math.max(
29701
+ maxDrainWaitMs,
29702
+ performance2.now() - activeDrainStartedAt
29703
+ );
29704
+ }
29705
+ const durationMs = Math.max(0, performance2.now() - openedAt);
29706
+ const resolvedCloseReason = closeReason ?? terminalCandidate ?? "client_disconnect";
29707
+ const closeAttributes = {
29708
+ "qwen-code.daemon.sse.duration_ms": durationMs,
29709
+ "qwen-code.daemon.sse.event_frames_write_settled": eventFramesWriteSettled,
29710
+ "qwen-code.daemon.sse.backpressure_count": backpressureCount,
29711
+ "qwen-code.daemon.sse.max_drain_wait_ms": maxDrainWaitMs,
29712
+ "qwen-code.daemon.sse.max_live_publish_to_write_settled_ms": maxLivePublishToWriteSettledMs,
29713
+ "qwen-code.daemon.sse.slow_warning_count": slowWarningCount,
29714
+ "qwen-code.daemon.sse.close_reason": resolvedCloseReason,
29715
+ ...lastEventIdWritten !== void 0 ? {
29716
+ "qwen-code.daemon.sse.last_event_id_written": lastEventIdWritten
29717
+ } : {},
29718
+ ...eventBusEvictionReason ? {
29719
+ "qwen-code.daemon.sse.event_bus_eviction_reason": eventBusEvictionReason
29720
+ } : {},
29721
+ ...terminalEventType ? {
29722
+ "qwen-code.daemon.sse.terminal_event_type": terminalEventType
29723
+ } : {}
29724
+ };
29725
+ void runWithDaemonTelemetryContext(telemetryContext, async () => {
29726
+ for (const [key, value] of Object.entries(closeAttributes)) {
29727
+ addDaemonRequestAttribute(key, value);
29728
+ }
29729
+ emitDaemonLog(
29730
+ "Daemon SSE stream closed.",
29731
+ { ...telemetryBaseAttributes, ...closeAttributes },
29732
+ { eventName: "qwen-code.daemon.sse.closed" }
29733
+ );
29734
+ }).catch(() => {
29631
29735
  });
29632
- }
29736
+ try {
29737
+ daemonLog?.info("SSE stream closed", {
29738
+ sessionId: diagnosticSessionId,
29739
+ clientId,
29740
+ streamId,
29741
+ connectReason,
29742
+ previousStreamId,
29743
+ closeReason: resolvedCloseReason,
29744
+ durationMs,
29745
+ eventFramesWriteSettled,
29746
+ lastEventIdWritten,
29747
+ backpressureCount,
29748
+ maxDrainWaitMs,
29749
+ maxLivePublishToWriteSettledMs,
29750
+ slowWarningCount,
29751
+ eventBusEvictionReason,
29752
+ terminalEventType
29753
+ });
29754
+ } catch {
29755
+ }
29756
+ if (sseCounted) {
29757
+ sseCounted = false;
29758
+ activeSseCount--;
29759
+ }
29760
+ }, "finalize");
29633
29761
  res.status(200);
29634
29762
  res.setHeader("Content-Type", "text/event-stream");
29635
29763
  res.setHeader("Cache-Control", "no-cache, no-transform");
@@ -29638,49 +29766,92 @@ function registerSseEventsRoutes(app, deps) {
29638
29766
  if (busEpoch !== void 0) {
29639
29767
  res.setHeader("X-Qwen-Event-Epoch", busEpoch);
29640
29768
  }
29641
- res.flushHeaders();
29769
+ res.setHeader(SSE_STREAM_ID_HEADER, streamId);
29770
+ res.prependOnceListener("finish", finalize);
29771
+ res.prependOnceListener("close", finalize);
29642
29772
  activeSseCount++;
29643
- let sseCounted = true;
29644
- res.on("close", () => {
29645
- if (sseCounted) {
29646
- sseCounted = false;
29647
- activeSseCount--;
29773
+ sseCounted = true;
29774
+ for (const [key, value] of Object.entries(telemetryBaseAttributes)) {
29775
+ addDaemonRequestAttribute(key, value);
29776
+ }
29777
+ try {
29778
+ daemonLog?.info("SSE stream opened", {
29779
+ sessionId: diagnosticSessionId,
29780
+ clientId,
29781
+ streamId,
29782
+ connectReason,
29783
+ previousStreamId,
29784
+ lastEventId
29785
+ });
29786
+ } catch {
29787
+ }
29788
+ emitLifecycleLog(
29789
+ "qwen-code.daemon.sse.opened",
29790
+ "Daemon SSE stream opened.",
29791
+ {
29792
+ ...lastEventId !== void 0 ? { "qwen-code.daemon.sse.resume_from_event_id": lastEventId } : {}
29648
29793
  }
29649
- });
29794
+ );
29795
+ try {
29796
+ res.flushHeaders();
29797
+ } catch {
29798
+ closeReason = "socket_error";
29799
+ abort.abort();
29800
+ finalize();
29801
+ try {
29802
+ if (!res.writableEnded) res.end();
29803
+ } catch {
29804
+ }
29805
+ return;
29806
+ }
29650
29807
  let writeChain = Promise.resolve();
29651
29808
  const trackWriterIdle = writerIdleTimeoutMs !== void 0 && writerIdleTimeoutMs > 0;
29652
29809
  let lastWriteAt = trackWriterIdle ? Date.now() : 0;
29810
+ const settleDrainMeasurement = /* @__PURE__ */ __name(() => {
29811
+ if (activeDrainStartedAt === void 0) return;
29812
+ maxDrainWaitMs = Math.max(
29813
+ maxDrainWaitMs,
29814
+ performance2.now() - activeDrainStartedAt
29815
+ );
29816
+ activeDrainStartedAt = void 0;
29817
+ }, "settleDrainMeasurement");
29653
29818
  const doWrite = /* @__PURE__ */ __name((chunk) => new Promise((resolve5, reject) => {
29654
29819
  if (res.writableEnded) {
29655
- resolve5();
29820
+ resolve5("closed");
29656
29821
  return;
29657
29822
  }
29658
29823
  let ok;
29659
29824
  try {
29660
29825
  ok = res.write(chunk);
29661
29826
  } catch (err) {
29827
+ if (!closeReason) closeReason = "socket_error";
29662
29828
  reject(err);
29663
29829
  return;
29664
29830
  }
29665
29831
  if (ok) {
29666
29832
  if (trackWriterIdle) lastWriteAt = Date.now();
29667
- resolve5();
29833
+ resolve5("settled");
29668
29834
  return;
29669
29835
  }
29836
+ backpressureCount += 1;
29837
+ activeDrainStartedAt = performance2.now();
29670
29838
  const onDrain = /* @__PURE__ */ __name(() => {
29671
29839
  res.off("close", onClose);
29672
29840
  res.off("error", onError);
29841
+ settleDrainMeasurement();
29673
29842
  if (trackWriterIdle) lastWriteAt = Date.now();
29674
- resolve5();
29843
+ resolve5("settled");
29675
29844
  }, "onDrain");
29676
29845
  const onClose = /* @__PURE__ */ __name(() => {
29677
29846
  res.off("drain", onDrain);
29678
29847
  res.off("error", onError);
29679
- resolve5();
29848
+ settleDrainMeasurement();
29849
+ resolve5("closed");
29680
29850
  }, "onClose");
29681
29851
  const onError = /* @__PURE__ */ __name((err) => {
29682
29852
  res.off("drain", onDrain);
29683
29853
  res.off("close", onClose);
29854
+ settleDrainMeasurement();
29684
29855
  reject(err);
29685
29856
  }, "onError");
29686
29857
  res.once("drain", onDrain);
@@ -29689,7 +29860,10 @@ function registerSseEventsRoutes(app, deps) {
29689
29860
  }), "doWrite");
29690
29861
  const writeWithBackpressure = /* @__PURE__ */ __name((chunk) => {
29691
29862
  const next = writeChain.then(() => doWrite(chunk));
29692
- writeChain = next.catch(() => void 0);
29863
+ writeChain = next.then(
29864
+ () => void 0,
29865
+ () => void 0
29866
+ );
29693
29867
  return next;
29694
29868
  }, "writeWithBackpressure");
29695
29869
  void writeWithBackpressure("retry: 3000\n\n").catch(() => {
@@ -29717,8 +29891,10 @@ function registerSseEventsRoutes(app, deps) {
29717
29891
  if (res.writableEnded) return;
29718
29892
  const idleForMs = Date.now() - lastWriteAt;
29719
29893
  if (idleForMs < writerIdleTimeoutMsValue) return;
29894
+ closeReason = "writer_idle_timeout";
29895
+ terminalEventType = "client_evicted";
29720
29896
  try {
29721
- res.write(
29897
+ const settled = res.write(
29722
29898
  formatSseFrame({
29723
29899
  v: 1,
29724
29900
  type: "client_evicted",
@@ -29730,14 +29906,37 @@ function registerSseEventsRoutes(app, deps) {
29730
29906
  }
29731
29907
  })
29732
29908
  );
29909
+ if (settled) eventFramesWriteSettled += 1;
29733
29910
  } catch {
29734
29911
  }
29912
+ const idleContext = {
29913
+ sessionId: diagnosticSessionId,
29914
+ clientId,
29915
+ streamId,
29916
+ connectReason,
29917
+ previousStreamId,
29918
+ idleForMs,
29919
+ timeoutMs: writerIdleTimeoutMsValue
29920
+ };
29735
29921
  try {
29736
- writeStderrLine(
29737
- `qwen serve: evicting SSE client (session ${sessionId}) \u2014 writer idle for ${idleForMs}ms > ${writerIdleTimeoutMsValue}ms timeout`
29738
- );
29922
+ if (daemonLog) {
29923
+ daemonLog.warn("SSE writer idle timeout", idleContext);
29924
+ } else {
29925
+ writeStderrLine(
29926
+ `qwen serve: evicting SSE client (session ${diagnosticSessionId}) \u2014 writer idle for ${idleForMs}ms > ${writerIdleTimeoutMsValue}ms timeout (streamId=${streamId}${clientId ? `, clientId=${clientId}` : ""})`
29927
+ );
29928
+ }
29739
29929
  } catch {
29740
29930
  }
29931
+ emitLifecycleLog(
29932
+ "qwen-code.daemon.sse.client_evicted",
29933
+ "Daemon SSE client evicted by writer idle timeout.",
29934
+ {
29935
+ "qwen-code.daemon.sse.writer_idle_for_ms": idleForMs,
29936
+ "qwen-code.daemon.sse.writer_idle_timeout_ms": writerIdleTimeoutMsValue,
29937
+ "qwen-code.daemon.sse.eviction_reason": "writer_idle_timeout"
29938
+ }
29939
+ );
29741
29940
  cleanup();
29742
29941
  try {
29743
29942
  if (!res.writableEnded) res.end();
@@ -29748,33 +29947,123 @@ function registerSseEventsRoutes(app, deps) {
29748
29947
  }
29749
29948
  req.on("close", cleanup);
29750
29949
  res.on("error", (err) => {
29751
- writeStderrLine(
29752
- `qwen serve: SSE socket error (session ${sessionId}): ${err.message}`
29753
- );
29950
+ if (!closeReason) closeReason = "socket_error";
29951
+ try {
29952
+ if (daemonLog) {
29953
+ daemonLog.error("SSE socket error", err, {
29954
+ sessionId: diagnosticSessionId,
29955
+ clientId,
29956
+ streamId,
29957
+ connectReason,
29958
+ previousStreamId
29959
+ });
29960
+ } else {
29961
+ writeStderrLine(
29962
+ `qwen serve: SSE socket error (session ${diagnosticSessionId}): ${err.message} (streamId=${streamId}${clientId ? `, clientId=${clientId}` : ""})`
29963
+ );
29964
+ }
29965
+ } catch {
29966
+ }
29754
29967
  cleanup();
29755
29968
  });
29756
29969
  void (async () => {
29757
29970
  try {
29758
29971
  while (true) {
29759
29972
  const next = await iter.next();
29760
- if (next.done) break;
29973
+ if (next.done) {
29974
+ if (!closeReason) {
29975
+ closeReason = terminalCandidate ?? "source_complete";
29976
+ }
29977
+ break;
29978
+ }
29761
29979
  if (res.writableEnded) break;
29980
+ if (next.value.type === "client_evicted") {
29981
+ terminalCandidate = "event_bus_evicted";
29982
+ terminalEventType = next.value.type;
29983
+ const reason = next.value.data?.reason;
29984
+ if (typeof reason === "string") {
29985
+ eventBusEvictionReason = boundedDiagnosticString(reason);
29986
+ }
29987
+ } else if (next.value.type === "session_died" || next.value.type === "session_closed") {
29988
+ terminalCandidate = "session_terminal";
29989
+ terminalEventType = next.value.type;
29990
+ }
29762
29991
  if (next.value.type === "state_resync_required") {
29763
29992
  const data = next.value.data;
29764
29993
  const gap = typeof data.earliestAvailableId === "number" && typeof data.lastDeliveredId === "number" ? data.earliestAvailableId - data.lastDeliveredId - 1 : void 0;
29765
- writeStderrLine(
29766
- `qwen serve: SSE ring eviction detected (session ${sessionId}): lastEventId=${data.lastDeliveredId ?? "?"}, earliestInRing=${data.earliestAvailableId ?? "?"}, gap=${gap ?? "?"} events, reason=${data.reason ?? "?"}` + (typeof data.detail === "string" ? `, detail=${data.detail}` : "") + `. Consumer must call loadSession to recover.`
29994
+ const reason = typeof data.reason === "string" ? boundedDiagnosticString(data.reason) : "unknown";
29995
+ const detail = typeof data.detail === "string" ? boundedDiagnosticString(data.detail) : void 0;
29996
+ const context = {
29997
+ sessionId: diagnosticSessionId,
29998
+ clientId,
29999
+ streamId,
30000
+ connectReason,
30001
+ previousStreamId,
30002
+ lastEventId: data.lastDeliveredId,
30003
+ earliestInRing: data.earliestAvailableId,
30004
+ gap,
30005
+ reason,
30006
+ detail
30007
+ };
30008
+ try {
30009
+ if (daemonLog) {
30010
+ daemonLog.warn(
30011
+ "SSE ring eviction detected; consumer must call loadSession to recover",
30012
+ context
30013
+ );
30014
+ } else {
30015
+ writeStderrLine(
30016
+ `qwen serve: SSE ring eviction detected (session ${diagnosticSessionId}): lastEventId=${data.lastDeliveredId ?? "?"}, earliestInRing=${data.earliestAvailableId ?? "?"}, gap=${gap ?? "?"} events, reason=${typeof data.reason === "string" ? reason : "?"}` + (detail ? `, detail=${detail}` : "") + `, streamId=${streamId}` + (clientId ? `, clientId=${clientId}` : "") + `. Consumer must call loadSession to recover.`
30017
+ );
30018
+ }
30019
+ } catch {
30020
+ }
30021
+ emitLifecycleLog(
30022
+ "qwen-code.daemon.sse.state_resync_required",
30023
+ "Daemon SSE state resync required.",
30024
+ {
30025
+ "qwen-code.daemon.sse.resync_reason": reason,
30026
+ ...detail ? { "qwen-code.daemon.sse.resync_detail": detail } : {},
30027
+ ...typeof data.lastDeliveredId === "number" ? {
30028
+ "qwen-code.daemon.sse.resync_last_delivered_id": data.lastDeliveredId
30029
+ } : {},
30030
+ ...typeof data.earliestAvailableId === "number" ? {
30031
+ "qwen-code.daemon.sse.resync_earliest_available_id": data.earliestAvailableId
30032
+ } : {},
30033
+ ...gap !== void 0 ? { "qwen-code.daemon.sse.resync_gap_events": gap } : {}
30034
+ }
29767
30035
  );
29768
30036
  }
29769
- await writeWithBackpressure(formatSseFrame(next.value));
30037
+ const liveEvent = liveTimingEnabled;
30038
+ const serverTimestamp = next.value._meta?.["serverTimestamp"];
30039
+ const outcome = await writeWithBackpressure(
30040
+ formatSseFrame(next.value)
30041
+ );
30042
+ if (outcome === "closed") break;
30043
+ eventFramesWriteSettled += 1;
30044
+ if (typeof next.value.id === "number") {
30045
+ lastEventIdWritten = next.value.id;
30046
+ }
30047
+ if (liveEvent && typeof serverTimestamp === "number" && Number.isFinite(serverTimestamp)) {
30048
+ maxLivePublishToWriteSettledMs = Math.max(
30049
+ maxLivePublishToWriteSettledMs,
30050
+ Math.max(0, Date.now() - serverTimestamp)
30051
+ );
30052
+ }
30053
+ if (next.value.type === "replay_complete") {
30054
+ liveTimingEnabled = true;
30055
+ }
29770
30056
  }
29771
30057
  } catch (err) {
29772
- if (!res.writableEnded) {
30058
+ if (!closeReason) {
30059
+ closeReason = "iterator_error";
30060
+ }
30061
+ if (!res.writableEnded && closeReason !== "socket_error") {
29773
30062
  const errorKind = mapDomainErrorToErrorKind(err);
29774
30063
  writeStderrLine(
29775
- `qwen serve: bridge iterator error (session ${sessionId}): ${errorMessage2(err)}` + (errorKind ? ` [${errorKind}]` : "")
30064
+ `qwen serve: bridge iterator error (session ${diagnosticSessionId}): ${errorMessage2(err)}` + (errorKind ? ` [${errorKind}]` : "")
29776
30065
  );
29777
- await writeWithBackpressure(
30066
+ const outcome = await writeWithBackpressure(
29778
30067
  formatSseFrame({
29779
30068
  v: 1,
29780
30069
  type: "stream_error",
@@ -29783,8 +30072,8 @@ function registerSseEventsRoutes(app, deps) {
29783
30072
  ...errorKind ? { errorKind } : {}
29784
30073
  }
29785
30074
  })
29786
- ).catch(() => {
29787
- });
30075
+ ).catch(() => "closed");
30076
+ if (outcome === "settled") eventFramesWriteSettled += 1;
29788
30077
  }
29789
30078
  } finally {
29790
30079
  cleanup();
@@ -30034,7 +30323,7 @@ __name(registerWorkspaceModelsRoutes, "registerWorkspaceModelsRoutes");
30034
30323
  // packages/cli/src/serve/routes/a2ui-action.ts
30035
30324
  init_esbuild_shims();
30036
30325
  import * as fsp4 from "node:fs/promises";
30037
- import * as path12 from "node:path";
30326
+ import * as path11 from "node:path";
30038
30327
  var A2UI_MIME = "application/a2ui+json";
30039
30328
  var ACTION_TOOL = "action";
30040
30329
  var CALL_TIMEOUT_MS = 15e3;
@@ -30057,7 +30346,7 @@ __name(usableServerConfig, "usableServerConfig");
30057
30346
  async function findFromSettingsFile(workspaceCwd) {
30058
30347
  try {
30059
30348
  const raw = await fsp4.readFile(
30060
- path12.join(workspaceCwd, ".qwen", "settings.json"),
30349
+ path11.join(workspaceCwd, ".qwen", "settings.json"),
30061
30350
  "utf8"
30062
30351
  );
30063
30352
  const settings = JSON.parse(raw);
@@ -30218,7 +30507,7 @@ __name(registerA2uiActionRoutes, "registerA2uiActionRoutes");
30218
30507
 
30219
30508
  // packages/cli/src/serve/server/fs-factory.ts
30220
30509
  init_esbuild_shims();
30221
- import * as path13 from "node:path";
30510
+ import * as path12 from "node:path";
30222
30511
  var IDE_WORKSPACE_PATH_ENV_VAR = "QWEN_CODE_IDE_WORKSPACE_PATH";
30223
30512
  function createDefaultFsAuditEmit() {
30224
30513
  const WARN_EVERY = 100;
@@ -30293,14 +30582,14 @@ function parseIdeWorkspacePathEnv(value) {
30293
30582
  const parsed = JSON.parse(value);
30294
30583
  if (Array.isArray(parsed) && parsed.every((item) => typeof item === "string")) {
30295
30584
  return parsed.filter(
30296
- (workspace) => workspace.length > 0 && path13.isAbsolute(workspace)
30585
+ (workspace) => workspace.length > 0 && path12.isAbsolute(workspace)
30297
30586
  );
30298
30587
  }
30299
30588
  throw new Error("IDE workspace path JSON must be a string array");
30300
30589
  } catch {
30301
30590
  }
30302
30591
  }
30303
- return value.split(path13.delimiter).filter((workspace) => workspace.length > 0 && path13.isAbsolute(workspace));
30592
+ return value.split(path12.delimiter).filter((workspace) => workspace.length > 0 && path12.isAbsolute(workspace));
30304
30593
  }
30305
30594
  __name(parseIdeWorkspacePathEnv, "parseIdeWorkspacePathEnv");
30306
30595
  function dropNestedWorkspacesPreservingPrimary(workspaces) {
@@ -30569,9 +30858,9 @@ __name(setupDeviceFlowRegistry, "setupDeviceFlowRegistry");
30569
30858
 
30570
30859
  // packages/cli/src/serve/server/error-handlers.ts
30571
30860
  init_esbuild_shims();
30572
- var import_express3 = __toESM(require_express(), 1);
30861
+ var import_express2 = __toESM(require_express(), 1);
30573
30862
  function installJsonBodyParser(app) {
30574
- app.use(import_express3.default.json({ limit: "10mb" }));
30863
+ app.use(import_express2.default.json({ limit: "10mb" }));
30575
30864
  app.use((err, _req, res, next) => {
30576
30865
  if (sendJsonBodyParserError(res, err)) return;
30577
30866
  next(err);
@@ -30625,10 +30914,10 @@ function installRateLimiter(app, opts, daemonLog, options = {}) {
30625
30914
  { tier, key: key.slice(0, 64) }
30626
30915
  );
30627
30916
  } : void 0,
30628
- onError: daemonLog ? (err, path15) => {
30917
+ onError: daemonLog ? (err, path14) => {
30629
30918
  daemonLog.warn(
30630
30919
  `rate limiter error (fail-open): ${err instanceof Error ? err.message : String(err)}`,
30631
- { path: path15 }
30920
+ { path: path14 }
30632
30921
  );
30633
30922
  } : void 0
30634
30923
  });
@@ -30824,7 +31113,7 @@ __name(registerWorkspaceQualifiedLifecycleRoutes, "registerWorkspaceQualifiedLif
30824
31113
  init_esbuild_shims();
30825
31114
  import { readdir as readdir2, stat as stat2 } from "node:fs/promises";
30826
31115
  import { realpathSync as realpathSync3 } from "node:fs";
30827
- import { basename as basename4, dirname as dirname4, isAbsolute as isAbsolute7, join as join8, resolve as resolve4, sep as sep3 } from "node:path";
31116
+ import { basename as basename4, dirname as dirname4, isAbsolute as isAbsolute7, join as join7, resolve as resolve4, sep as sep3 } from "node:path";
30828
31117
 
30829
31118
  // packages/cli/src/serve/native-directory-picker.ts
30830
31119
  init_esbuild_shims();
@@ -31210,7 +31499,7 @@ function registerWorkspaceManagementRoutes(app, deps) {
31210
31499
  return;
31211
31500
  }
31212
31501
  const endsWithSep = prefix.endsWith("/") || process.platform === "win32" && prefix.endsWith("\\");
31213
- const dir = endsWithSep ? join8(prefix, ".") : dirname4(prefix);
31502
+ const dir = endsWithSep ? join7(prefix, ".") : dirname4(prefix);
31214
31503
  const filter = endsWithSep ? "" : basename4(prefix);
31215
31504
  const filterLower = filter.toLowerCase();
31216
31505
  const suggestions = [];
@@ -31226,7 +31515,7 @@ function registerWorkspaceManagementRoutes(app, deps) {
31226
31515
  let isDir = entry.isDirectory();
31227
31516
  if (!isDir && entry.isSymbolicLink()) {
31228
31517
  try {
31229
- isDir = (await stat2(join8(dir, entry.name))).isDirectory();
31518
+ isDir = (await stat2(join7(dir, entry.name))).isDirectory();
31230
31519
  } catch {
31231
31520
  continue;
31232
31521
  }
@@ -31236,7 +31525,7 @@ function registerWorkspaceManagementRoutes(app, deps) {
31236
31525
  truncated = true;
31237
31526
  break;
31238
31527
  }
31239
- suggestions.push({ name: entry.name, path: join8(dir, entry.name) });
31528
+ suggestions.push({ name: entry.name, path: join7(dir, entry.name) });
31240
31529
  }
31241
31530
  } catch {
31242
31531
  }
@@ -31256,11 +31545,11 @@ function registerWorkspaceManagementRoutes(app, deps) {
31256
31545
  const controller = new AbortController();
31257
31546
  res.on("close", () => controller.abort());
31258
31547
  try {
31259
- const path15 = await pickWorkspaceDirectory(controller.signal);
31548
+ const path14 = await pickWorkspaceDirectory(controller.signal);
31260
31549
  res.status(200).json({
31261
31550
  kind: "workspace-directory-picker",
31262
- selected: path15 !== void 0,
31263
- ...path15 === void 0 ? {} : { path: path15 }
31551
+ selected: path14 !== void 0,
31552
+ ...path14 === void 0 ? {} : { path: path14 }
31264
31553
  });
31265
31554
  } catch (error2) {
31266
31555
  const detail = error2 instanceof Error ? error2.message : String(error2);
@@ -32317,8 +32606,8 @@ function buildDiffList(workspaceCwd, result) {
32317
32606
  hiddenCount: 0
32318
32607
  };
32319
32608
  }
32320
- const files = [...result.perFileStats.entries()].map(([path15, s]) => ({
32321
- path: path15,
32609
+ const files = [...result.perFileStats.entries()].map(([path14, s]) => ({
32610
+ path: path14,
32322
32611
  oldPath: s.oldPath,
32323
32612
  added: s.added,
32324
32613
  removed: s.removed,
@@ -35200,7 +35489,7 @@ __name(registerWorkspaceQualifiedSkillsRoutes, "registerWorkspaceQualifiedSkills
35200
35489
 
35201
35490
  // packages/cli/src/serve/routes/channel-webhooks.ts
35202
35491
  init_esbuild_shims();
35203
- var import_express4 = __toESM(require_express(), 1);
35492
+ var import_express3 = __toESM(require_express(), 1);
35204
35493
  import { createHash as createHash4, timingSafeEqual as timingSafeEqual2 } from "node:crypto";
35205
35494
  var PROTOTYPE_POLLUTION_KEYS = /* @__PURE__ */ new Set([
35206
35495
  "__proto__",
@@ -35249,7 +35538,7 @@ function registerChannelWebhookRoutes(app, deps) {
35249
35538
  locals.channelWebhook = { channelName, source, sourceConfig };
35250
35539
  next();
35251
35540
  },
35252
- import_express4.default.json({ limit: "1mb" }),
35541
+ import_express3.default.json({ limit: "1mb" }),
35253
35542
  async (req, res) => {
35254
35543
  const locals = res.locals;
35255
35544
  const webhook = locals.channelWebhook;
@@ -35444,7 +35733,7 @@ init_esbuild_shims();
35444
35733
 
35445
35734
  // packages/cli/src/serve/live/live-host-coordinator.ts
35446
35735
  init_esbuild_shims();
35447
- import { randomUUID as randomUUID7, timingSafeEqual as timingSafeEqual3 } from "node:crypto";
35736
+ import { randomUUID as randomUUID8, timingSafeEqual as timingSafeEqual3 } from "node:crypto";
35448
35737
  var DEFAULT_HELLO_TIMEOUT_MS = 5e3;
35449
35738
  var DEFAULT_HEARTBEAT_INTERVAL_MS = 5e3;
35450
35739
  var DEFAULT_HEARTBEAT_TIMEOUT_MS = 15e3;
@@ -35621,7 +35910,7 @@ __name(projectStatusForHost, "projectStatusForHost");
35621
35910
  var LiveHostCoordinator = class {
35622
35911
  constructor(options) {
35623
35912
  this.options = options;
35624
- this.daemonInstanceNonce = options.daemonInstanceNonce ?? randomUUID7();
35913
+ this.daemonInstanceNonce = options.daemonInstanceNonce ?? randomUUID8();
35625
35914
  this.handlers = options.handlers ?? {};
35626
35915
  this.now = options.now ?? Date.now;
35627
35916
  this.helloTimeoutMs = options.helloTimeoutMs ?? DEFAULT_HELLO_TIMEOUT_MS;
@@ -35813,7 +36102,7 @@ var LiveHostCoordinator = class {
35813
36102
  startCall(mode) {
35814
36103
  const call = {
35815
36104
  epoch: ++this.nextEpoch,
35816
- callId: randomUUID7(),
36105
+ callId: randomUUID8(),
35817
36106
  mode,
35818
36107
  state: "starting",
35819
36108
  pendingPermission: false,
@@ -35872,7 +36161,7 @@ var LiveHostCoordinator = class {
35872
36161
  new Error("Qwen Live Host must be connected to change the shortcut.")
35873
36162
  );
35874
36163
  }
35875
- const requestId = randomUUID7();
36164
+ const requestId = randomUUID8();
35876
36165
  return new Promise((resolve5, reject) => {
35877
36166
  const timer = setTimeout(() => {
35878
36167
  this.rejectPendingShortcut(
@@ -35962,7 +36251,7 @@ var LiveHostCoordinator = class {
35962
36251
  )
35963
36252
  );
35964
36253
  }
35965
- const requestId = randomUUID7();
36254
+ const requestId = randomUUID8();
35966
36255
  return new Promise((resolve5, reject) => {
35967
36256
  const timer = setTimeout(() => {
35968
36257
  this.pendingAppshots.delete(requestId);
@@ -36302,7 +36591,7 @@ var LiveHostCoordinator = class {
36302
36591
  this.disconnectHost(lease, 4008, "Live Host heartbeat timed out.");
36303
36592
  return;
36304
36593
  }
36305
- const pingId = randomUUID7();
36594
+ const pingId = randomUUID8();
36306
36595
  lease.pingId = pingId;
36307
36596
  this.sendHost({ type: "host.ping", pingId });
36308
36597
  }
@@ -36564,7 +36853,7 @@ init_esbuild_shims();
36564
36853
 
36565
36854
  // packages/cli/src/serve/live/live-setup-controller.ts
36566
36855
  init_esbuild_shims();
36567
- import { randomUUID as randomUUID9 } from "node:crypto";
36856
+ import { randomUUID as randomUUID10 } from "node:crypto";
36568
36857
 
36569
36858
  // packages/cli/src/serve/live/provider-credentials.ts
36570
36859
  init_esbuild_shims();
@@ -36662,7 +36951,7 @@ __name(resolveLiveProviderCredential, "resolveLiveProviderCredential");
36662
36951
 
36663
36952
  // packages/cli/src/serve/live/qwen-realtime-session.ts
36664
36953
  init_esbuild_shims();
36665
- import { randomUUID as randomUUID8 } from "node:crypto";
36954
+ import { randomUUID as randomUUID9 } from "node:crypto";
36666
36955
  var QWEN_REALTIME_LIMITS = {
36667
36956
  maxInputAudioFrameBytes: 64 * 1024,
36668
36957
  maxOutputAudioFrameBytes: 256 * 1024,
@@ -37077,7 +37366,7 @@ function openQwenRealtimeSession(config, callbacks = {}, deps = {}) {
37077
37366
  const sendJson = /* @__PURE__ */ __name((body) => {
37078
37367
  if (terminal || closedByClient || ws.readyState !== ws.OPEN) return false;
37079
37368
  try {
37080
- ws.send(JSON.stringify({ event_id: randomUUID8(), ...body }));
37369
+ ws.send(JSON.stringify({ event_id: randomUUID9(), ...body }));
37081
37370
  return true;
37082
37371
  } catch (error2) {
37083
37372
  fail(
@@ -38440,7 +38729,7 @@ async function validateCredential(credential) {
38440
38729
  apiKey: credential.apiKey,
38441
38730
  model: credential.realtimeModel,
38442
38731
  voice: credential.voice,
38443
- callEpoch: `setup-${randomUUID9()}`
38732
+ callEpoch: `setup-${randomUUID10()}`
38444
38733
  });
38445
38734
  session.close({ discardPendingInput: true });
38446
38735
  }
@@ -38747,11 +39036,11 @@ __name(registerLiveSetupRoutes, "registerLiveSetupRoutes");
38747
39036
  // packages/cli/src/serve/live/live-host-installer.ts
38748
39037
  init_esbuild_shims();
38749
39038
  import { execFile as execFile3 } from "node:child_process";
38750
- import { createHash as createHash5, randomUUID as randomUUID10 } from "node:crypto";
39039
+ import { createHash as createHash5, randomUUID as randomUUID11 } from "node:crypto";
38751
39040
  import * as fs6 from "node:fs";
38752
39041
  import * as fsp5 from "node:fs/promises";
38753
39042
  import * as os from "node:os";
38754
- import * as path14 from "node:path";
39043
+ import * as path13 from "node:path";
38755
39044
  import { Readable, Transform } from "node:stream";
38756
39045
  import { pipeline } from "node:stream/promises";
38757
39046
  import { promisify as promisify3 } from "node:util";
@@ -38829,7 +39118,7 @@ async function readBundleValue(appPath, key) {
38829
39118
  "raw",
38830
39119
  "-o",
38831
39120
  "-",
38832
- path14.join(appPath, "Contents", "Info.plist")
39121
+ path13.join(appPath, "Contents", "Info.plist")
38833
39122
  ]);
38834
39123
  }
38835
39124
  __name(readBundleValue, "readBundleValue");
@@ -38935,13 +39224,13 @@ async function installLatestHost(currentArchitecture, onStatus) {
38935
39224
  const manifest = await fetchManifest();
38936
39225
  const asset = manifest.assets[currentArchitecture];
38937
39226
  const temporaryDirectory = await fsp5.mkdtemp(
38938
- path14.join(os.tmpdir(), "qwen-live-host-")
39227
+ path13.join(os.tmpdir(), "qwen-live-host-")
38939
39228
  );
38940
- const archivePath = path14.join(temporaryDirectory, asset.name);
38941
- const extractedPath = path14.join(temporaryDirectory, "extracted");
38942
- const candidatePath = path14.join(extractedPath, LIVE_HOST_APP_NAME);
38943
- const stagingPath = `/Applications/.Qwen Live Host.install-${randomUUID10()}.app`;
38944
- const backupPath = `/Applications/.Qwen Live Host.backup-${randomUUID10()}.app`;
39229
+ const archivePath = path13.join(temporaryDirectory, asset.name);
39230
+ const extractedPath = path13.join(temporaryDirectory, "extracted");
39231
+ const candidatePath = path13.join(extractedPath, LIVE_HOST_APP_NAME);
39232
+ const stagingPath = `/Applications/.Qwen Live Host.install-${randomUUID11()}.app`;
39233
+ const backupPath = `/Applications/.Qwen Live Host.backup-${randomUUID11()}.app`;
38945
39234
  let movedExisting = false;
38946
39235
  let installedCandidate = false;
38947
39236
  try {
@@ -39085,15 +39374,15 @@ var LiveHostInstaller = class {
39085
39374
 
39086
39375
  // packages/cli/src/serve/live/live-session-coordinator.ts
39087
39376
  init_esbuild_shims();
39088
- import { createHash as createHash6, randomUUID as randomUUID11 } from "node:crypto";
39377
+ import { createHash as createHash6, randomUUID as randomUUID12 } from "node:crypto";
39089
39378
  import { createWriteStream as createWriteStream2, mkdirSync as mkdirSync2 } from "node:fs";
39090
- import { join as join11 } from "node:path";
39379
+ import { join as join10 } from "node:path";
39091
39380
 
39092
39381
  // packages/cli/src/serve/live/realtime-startup-context.ts
39093
39382
  init_esbuild_shims();
39094
39383
  import { readdirSync } from "node:fs";
39095
39384
  import { homedir } from "node:os";
39096
- import { basename as basename5, join as join10 } from "node:path";
39385
+ import { basename as basename5, join as join9 } from "node:path";
39097
39386
  var STARTUP_CONTEXT_HEADER = "Startup context from Qwen Code.\nThis is background context about recent work and machine/workspace layout. It may be incomplete or stale. Use it to inform responses, and do not repeat it back unless relevant.";
39098
39387
  var CURRENT_THREAD_SECTION_TOKEN_BUDGET = 1200;
39099
39388
  var RECENT_WORK_SECTION_TOKEN_BUDGET = 2200;
@@ -39335,7 +39624,7 @@ function collectTreeLines(directory, depth, lines) {
39335
39624
  const indent = " ".repeat(depth);
39336
39625
  lines.push(`${indent}- ${entry.name}${entry.isDirectory() ? "/" : ""}`);
39337
39626
  if (entry.isDirectory()) {
39338
- collectTreeLines(join10(directory, entry.name), depth + 1, lines);
39627
+ collectTreeLines(join9(directory, entry.name), depth + 1, lines);
39339
39628
  }
39340
39629
  }
39341
39630
  if (entries.length > DIR_ENTRY_LIMIT) {
@@ -39454,13 +39743,13 @@ function openLiveAudioCapture(source, identifier) {
39454
39743
  try {
39455
39744
  mkdirSync2(directory, { recursive: true, mode: 448 });
39456
39745
  const safeIdentifier = identifier.replace(/[^A-Za-z0-9_-]/g, "_");
39457
- const path15 = join11(
39746
+ const path14 = join10(
39458
39747
  directory,
39459
39748
  `${source}-${Date.now()}-${safeIdentifier}.pcm`
39460
39749
  );
39461
- const stream = createWriteStream2(path15, { flags: "wx", mode: 384 });
39750
+ const stream = createWriteStream2(path14, { flags: "wx", mode: 384 });
39462
39751
  stream.on("error", () => void 0);
39463
- return { source, path: path15, stream, hash: createHash6("sha256"), bytes: 0 };
39752
+ return { source, path: path14, stream, hash: createHash6("sha256"), bytes: 0 };
39464
39753
  } catch {
39465
39754
  return void 0;
39466
39755
  }
@@ -39815,7 +40104,7 @@ var LiveSessionCoordinator = class {
39815
40104
  context.speechInProgress = true;
39816
40105
  context.inputCommitPending = true;
39817
40106
  context.inputAwaitingResponse = false;
39818
- const partialItemId = itemId ?? `partial:${randomUUID11()}`;
40107
+ const partialItemId = itemId ?? `partial:${randomUUID12()}`;
39819
40108
  context.activePartialInputItemId = partialItemId;
39820
40109
  if (!context.partialInputTranscripts.has(partialItemId)) {
39821
40110
  context.partialInputTranscripts.set(partialItemId, "");
@@ -39845,7 +40134,7 @@ var LiveSessionCoordinator = class {
39845
40134
  }, "onInputCommitted"),
39846
40135
  onInputTranscriptDelta: /* @__PURE__ */ __name(({ itemId, text }) => {
39847
40136
  if (this.isCurrentSocket(context, generation)) {
39848
- const partialItemId = itemId ?? context.activePartialInputItemId ?? `partial:${randomUUID11()}`;
40137
+ const partialItemId = itemId ?? context.activePartialInputItemId ?? `partial:${randomUUID12()}`;
39849
40138
  context.activePartialInputItemId = partialItemId;
39850
40139
  context.partialInputTranscripts.set(partialItemId, text);
39851
40140
  this.options.host.setTranscript?.(context.epoch, text);
@@ -39855,7 +40144,7 @@ var LiveSessionCoordinator = class {
39855
40144
  if (this.isCurrentSocket(context, generation)) {
39856
40145
  context.speechInProgress = false;
39857
40146
  context.inputCommitPending = false;
39858
- const completedItemId = itemId ?? context.activePartialInputItemId ?? `unattributed:${randomUUID11()}`;
40147
+ const completedItemId = itemId ?? context.activePartialInputItemId ?? `unattributed:${randomUUID12()}`;
39859
40148
  context.partialInputTranscripts.delete(completedItemId);
39860
40149
  if (context.activePartialInputItemId === completedItemId) {
39861
40150
  context.activePartialInputItemId = void 0;
@@ -40569,7 +40858,7 @@ var LiveSessionCoordinator = class {
40569
40858
  const runtime = context.runtime;
40570
40859
  if (!runtime) throw new Error("Conversation workspace is unavailable.");
40571
40860
  const bridge = runtime.bridge;
40572
- const promptId = randomUUID11();
40861
+ const promptId = randomUUID12();
40573
40862
  const lastEventId = bridge.getSessionLastEventId(locator.sessionId);
40574
40863
  const turnAbort = new AbortController();
40575
40864
  this.inFlightTurnAborts.add(turnAbort);
@@ -40886,7 +41175,7 @@ var LiveSessionCoordinator = class {
40886
41175
 
40887
41176
  // packages/cli/src/serve/live/live-task-service.ts
40888
41177
  init_esbuild_shims();
40889
- import { randomUUID as randomUUID12 } from "node:crypto";
41178
+ import { randomUUID as randomUUID13 } from "node:crypto";
40890
41179
  var DEFAULT_LIST_LIMIT = 20;
40891
41180
  var DEFAULT_READ_TURN_LIMIT = 3;
40892
41181
  var DEFAULT_WAIT_TIMEOUT_MS = 12e4;
@@ -41602,7 +41891,7 @@ var LiveTaskService = class {
41602
41891
  { sessionId, prompt: [{ type: "text", text: prompt }] },
41603
41892
  void 0,
41604
41893
  {
41605
- promptId: randomUUID12(),
41894
+ promptId: randomUUID13(),
41606
41895
  onPromptAdmitted: /* @__PURE__ */ __name(() => {
41607
41896
  admitted = true;
41608
41897
  onAdmitted?.();
@@ -41826,7 +42115,7 @@ function createServeApp(opts, getPort = () => opts.port, deps = {}) {
41826
42115
  "createServeApp: deps.workspaceRuntimeRemoval requires the matching deps.voiceCoordinator."
41827
42116
  );
41828
42117
  }
41829
- const app = (0, import_express5.default)();
42118
+ const app = (0, import_express4.default)();
41830
42119
  const injectedWorkspaceRegistry = deps.workspaceRegistry;
41831
42120
  const boundWorkspace = injectedWorkspaceRegistry?.primary.workspaceCwd ?? deps.boundWorkspace ?? canonicalizeWorkspace(opts.workspace ?? process.cwd());
41832
42121
  if (injectedWorkspaceRegistry) {