@qwen-code/qwen-code 0.21.10 → 0.21.11-nightly.20260814.45c2e73080

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 (378) hide show
  1. package/bundled/coordinate/SKILL.md +52 -0
  2. package/bundled/qc-helper/docs/configuration/model-providers.md +10 -8
  3. package/bundled/qc-helper/docs/configuration/settings.md +10 -0
  4. package/bundled/qc-helper/docs/extension/_meta.ts +1 -0
  5. package/bundled/qc-helper/docs/extension/agent-plugins.md +50 -0
  6. package/bundled/qc-helper/docs/extension/extension-releasing.md +3 -3
  7. package/bundled/qc-helper/docs/extension/introduction.md +17 -3
  8. package/bundled/qc-helper/docs/features/_meta.ts +1 -0
  9. package/bundled/qc-helper/docs/features/arena.md +4 -3
  10. package/bundled/qc-helper/docs/features/code-review.md +1 -1
  11. package/bundled/qc-helper/docs/features/commands.md +7 -6
  12. package/bundled/qc-helper/docs/features/dual-output.md +5 -0
  13. package/bundled/qc-helper/docs/features/headless.md +8 -0
  14. package/bundled/qc-helper/docs/features/multi-agent-coordination.md +30 -0
  15. package/bundled/qc-helper/docs/qwen-serve.md +40 -40
  16. package/bundled/review/SKILL.md +45 -23
  17. package/chunks/{MaxSizedBox-FKXYULMW.js → MaxSizedBox-P4Z76535.js} +45 -44
  18. package/chunks/{StandaloneSessionPicker-OQS3M7AY.js → StandaloneSessionPicker-TRWDBCJG.js} +65 -64
  19. package/chunks/{acp-startup-profiler-VNTFWYAC.js → acp-startup-profiler-TVI2OVUN.js} +2 -2
  20. package/chunks/{acpAgent-AGS6HLQQ.js → acpAgent-MSZHQSZ7.js} +1645 -579
  21. package/chunks/{agent-4NCVO27U.js → agent-TMTEYQGK.js} +42 -41
  22. package/chunks/agent-headless-54WWND2M.js +87 -0
  23. package/chunks/{anthropicContentGenerator-D3Y4RFT4.js → anthropicContentGenerator-7ZK7U65G.js} +8 -8
  24. package/chunks/{artifact-tool-N652YE4L.js → artifact-tool-7HVSSXYZ.js} +2 -2
  25. package/chunks/{askUserQuestion-ONW74PKJ.js → askUserQuestion-IQCA2SOX.js} +2 -2
  26. package/chunks/{bridge-FHINXZMN.js → bridge-CI2NKV64.js} +49 -48
  27. package/chunks/{ca-ZLKAB4K3.js → ca-4CQ6MYNQ.js} +2 -1
  28. package/chunks/{channel-management-service-PHELKOW2.js → channel-management-service-LNEYNMDX.js} +6 -6
  29. package/chunks/channel-settings-store-QU4WFXHO.js +102 -0
  30. package/chunks/{channel-worker-group-WQP4RCDO.js → channel-worker-group-Q5WQVOMZ.js} +8 -7
  31. package/chunks/{channel-worker-manager-MRDFAKIM.js → channel-worker-manager-Z3JLH72P.js} +8 -7
  32. package/chunks/{channel-worker-supervisor-IVSDIMI4.js → channel-worker-supervisor-CG5HHT7K.js} +6 -5
  33. package/chunks/{chunk-A7XMDZRI.js → chunk-2AG524A4.js} +5 -5
  34. package/chunks/{chunk-GM463R2B.js → chunk-2ASWIM4A.js} +1 -1
  35. package/chunks/{chunk-DP3IHZGG.js → chunk-2AUM35J5.js} +59 -7
  36. package/chunks/{chunk-TZEZYNYD.js → chunk-2N6CV4PW.js} +1 -1
  37. package/chunks/{chunk-BSI645OU.js → chunk-3LHSUFPE.js} +3 -3
  38. package/chunks/{chunk-DCZEPFB4.js → chunk-3XLWKV4S.js} +3 -3
  39. package/chunks/{chunk-YWPSGJFI.js → chunk-4IBNVBGJ.js} +2 -2
  40. package/chunks/{chunk-ZRBMO3C7.js → chunk-4IWFPTAH.js} +1 -1
  41. package/chunks/{chunk-B2GJNDTV.js → chunk-4JS2QK7P.js} +1 -1
  42. package/chunks/{chunk-5MZCSWI4.js → chunk-4NV6L4GZ.js} +1184 -1450
  43. package/chunks/{chunk-Y3OVRWRY.js → chunk-4QC6SUVN.js} +1 -1
  44. package/chunks/{chunk-AOHJKPKL.js → chunk-5KZNWF2M.js} +1 -1
  45. package/chunks/{chunk-UMD7WQTR.js → chunk-5XNR53C7.js} +10 -8
  46. package/chunks/{chunk-IIJEYBNH.js → chunk-66PLFJQ7.js} +197 -60
  47. package/chunks/{chunk-SEZ556DZ.js → chunk-67F2BEYW.js} +1 -1
  48. package/chunks/{chunk-7GTMV7UE.js → chunk-6KXHEN6M.js} +8700 -2449
  49. package/chunks/{chunk-FVKHVJZQ.js → chunk-6OJDN5ZT.js} +1 -1
  50. package/chunks/{chunk-CKASRHZI.js → chunk-6SU6OW5Z.js} +1 -1
  51. package/chunks/{chunk-NEOXOWYH.js → chunk-6YUEAYJ5.js} +7 -7
  52. package/chunks/{chunk-QGNOFE5E.js → chunk-766PXUQ3.js} +1 -1
  53. package/chunks/{chunk-UVX4Y6IN.js → chunk-7JL5YBSA.js} +1 -1
  54. package/chunks/{chunk-2PLNY5TN.js → chunk-7MAHENBD.js} +4 -4
  55. package/chunks/{chunk-L2AFWWJE.js → chunk-7UNST76G.js} +105 -24
  56. package/chunks/{chunk-HUWENAHO.js → chunk-7WUMS2UA.js} +1 -1
  57. package/chunks/{chunk-MVUQRLOH.js → chunk-A4BAHMJF.js} +3 -3
  58. package/chunks/{chunk-7MH4J33A.js → chunk-A6GQUQ7I.js} +2 -2
  59. package/chunks/{chunk-GNPNYXJB.js → chunk-AAZWJAPQ.js} +2 -2
  60. package/chunks/{chunk-DX3RGJMS.js → chunk-ADJDLEVO.js} +72 -13
  61. package/chunks/{chunk-IWTMYQ32.js → chunk-AN3LCBS7.js} +9 -8
  62. package/chunks/{chunk-LHEC5V6G.js → chunk-AXEL55JW.js} +2 -2
  63. package/chunks/{chunk-QUI267ZP.js → chunk-B66LYK4B.js} +492 -63
  64. package/chunks/{chunk-VNNWAZSI.js → chunk-BCGJZGFI.js} +3 -3
  65. package/chunks/{chunk-F6WDTQ3M.js → chunk-BRYHERQ6.js} +5 -5
  66. package/chunks/{chunk-6ZRFAKXK.js → chunk-C2DR57L6.js} +1 -1
  67. package/chunks/{chunk-26CXSA6V.js → chunk-CAOT4DYN.js} +2 -2
  68. package/chunks/{chunk-H6XPXXMH.js → chunk-CQ35AJ4Z.js} +252 -254
  69. package/chunks/{chunk-F24A2JBM.js → chunk-CUXI3S6E.js} +914 -175
  70. package/chunks/{chunk-AEL7KN2O.js → chunk-DANYMI4U.js} +2 -2
  71. package/chunks/{chunk-AAE6SR4Q.js → chunk-DX7V233D.js} +1 -1
  72. package/chunks/{chunk-PJRW65JO.js → chunk-E74YSVIN.js} +1 -1
  73. package/chunks/{chunk-OWMAZHIX.js → chunk-EGB2PIYM.js} +1 -1
  74. package/chunks/{chunk-TRRF5BSP.js → chunk-F4BUGC4Y.js} +1 -1
  75. package/chunks/{chunk-4MKXUHXY.js → chunk-FGQY4VOZ.js} +5 -5
  76. package/chunks/{chunk-ZBVS26BY.js → chunk-FPGTNKCP.js} +7 -5
  77. package/chunks/{chunk-SR7RZ4MS.js → chunk-FTGU6G45.js} +2 -2
  78. package/chunks/{chunk-IBUGFUXC.js → chunk-G2ZEKO4T.js} +12 -12
  79. package/chunks/{chunk-NDU63YLI.js → chunk-GN2SCYBA.js} +4 -4
  80. package/chunks/{chunk-NV3F44FL.js → chunk-GNRFC5UM.js} +2 -2
  81. package/chunks/{chunk-KKBPOU75.js → chunk-H6BFLALJ.js} +1 -1
  82. package/chunks/chunk-HHJLM3WQ.js +41 -0
  83. package/chunks/{chunk-LLCWZQCU.js → chunk-HM7TLULV.js} +3 -3
  84. package/chunks/{chunk-ECWR5LQR.js → chunk-I76FLAP7.js} +3 -3
  85. package/chunks/{chunk-Q3AL4JQ3.js → chunk-IAE7LYSB.js} +2 -2
  86. package/chunks/{chunk-DREZZAZM.js → chunk-IDNVCWXZ.js} +13 -5
  87. package/chunks/{chunk-YF5MALI4.js → chunk-IPMHLZPY.js} +20 -16
  88. package/chunks/{chunk-UDXSXLER.js → chunk-IW6RQPQB.js} +14 -4
  89. package/chunks/{chunk-UBX6NL47.js → chunk-JLT5HCGQ.js} +47 -3
  90. package/chunks/{chunk-COBO5EBO.js → chunk-JRTJEGSP.js} +1 -1
  91. package/chunks/{chunk-PBRVUF5B.js → chunk-JW5UEE3V.js} +1 -1
  92. package/chunks/{chunk-W4RQUHY3.js → chunk-K5IDV3PC.js} +184 -22
  93. package/chunks/{chunk-O3EU6GMH.js → chunk-KACBT7N7.js} +27 -4
  94. package/chunks/{chunk-MFDYOYZZ.js → chunk-KCGEAL2C.js} +25 -2
  95. package/chunks/{chunk-EI3HZX6C.js → chunk-KK3FEHPJ.js} +1 -1
  96. package/chunks/{chunk-OJUQF2PL.js → chunk-KRRRRU3X.js} +5 -5
  97. package/chunks/{chunk-J6SZID63.js → chunk-KTWUFHS4.js} +2 -2
  98. package/chunks/{chunk-E2FPSSKP.js → chunk-KZKEVWJW.js} +57 -13
  99. package/chunks/{chunk-ZJ4W6SUY.js → chunk-L6PE52MF.js} +3 -3
  100. package/chunks/{chunk-YGT2AUJ7.js → chunk-LAKFZU36.js} +39 -19
  101. package/chunks/{chunk-47PEPJO7.js → chunk-LKN5SEHD.js} +3 -3
  102. package/chunks/{chunk-OQTXYMKW.js → chunk-LSMCI42W.js} +3 -3
  103. package/chunks/{chunk-ABVRJU3D.js → chunk-LY2SB7GC.js} +7 -7
  104. package/chunks/{chunk-D27I6YJT.js → chunk-M53FFYQJ.js} +27 -18
  105. package/chunks/{chunk-YTFDX4PR.js → chunk-M6NDLY2T.js} +1 -1
  106. package/chunks/{chunk-3P2LV43B.js → chunk-MMEDZKWK.js} +3 -3
  107. package/chunks/{chunk-VFMASYQA.js → chunk-MS7GNABG.js} +3 -0
  108. package/chunks/{chunk-6LP743KE.js → chunk-MUTFMB5B.js} +78 -112
  109. package/chunks/{chunk-URK542T4.js → chunk-NF5J2WFA.js} +15 -2
  110. package/chunks/{chunk-VSFKIRRW.js → chunk-NH6U7L42.js} +4 -4
  111. package/chunks/{chunk-DA4HRSBW.js → chunk-NHZF4VCD.js} +1 -1
  112. package/chunks/{chunk-QG3FFJYU.js → chunk-NJE5NH5B.js} +1 -1
  113. package/chunks/{chunk-2UUMVNYT.js → chunk-NM33GGOM.js} +3 -3
  114. package/chunks/{chunk-FOGU3LJX.js → chunk-NW7SPXVG.js} +1 -1
  115. package/chunks/{chunk-EUNWC2VS.js → chunk-O6SLWH4X.js} +2 -2
  116. package/chunks/{chunk-EBZ6BJTF.js → chunk-OEVVUUYW.js} +1 -1
  117. package/chunks/chunk-OMVHZ7E6.js +1280 -0
  118. package/chunks/{chunk-KZ22NXBY.js → chunk-OT72MGHE.js} +4 -4
  119. package/chunks/{chunk-DZUO626D.js → chunk-OUCCIS3E.js} +3 -3
  120. package/chunks/{chunk-OONWZLFK.js → chunk-OYLYERMH.js} +4 -4
  121. package/chunks/{chunk-P3BJLFSZ.js → chunk-OYQM5XZ4.js} +3 -3
  122. package/chunks/{chunk-NRLFZWCT.js → chunk-PNU3TILU.js} +3 -3
  123. package/chunks/{chunk-M6HMMKVG.js → chunk-PSTHNTHF.js} +1 -1
  124. package/chunks/{chunk-4PYCZH2V.js → chunk-QEWAHAW2.js} +3 -3
  125. package/chunks/{chunk-QJMOAMXT.js → chunk-RG2S3GYC.js} +8 -8
  126. package/chunks/{chunk-CTJLZLB5.js → chunk-RQS2BGPI.js} +1 -1
  127. package/chunks/{chunk-Y4R47ZUH.js → chunk-RTBUTKAX.js} +7 -7
  128. package/chunks/{chunk-NV65ZUVM.js → chunk-RZZV6GQN.js} +1 -1
  129. package/chunks/{chunk-UEOKWYGY.js → chunk-SESSAEWC.js} +11 -11
  130. package/chunks/{chunk-CPG6P4GG.js → chunk-SKRHR6N2.js} +1 -1
  131. package/chunks/{chunk-WAUGQKUU.js → chunk-SNHBRO4C.js} +9 -5
  132. package/chunks/{chunk-KID7K6H2.js → chunk-SNPOURNX.js} +6 -6
  133. package/chunks/{chunk-VWKER4ZH.js → chunk-SQCTJ435.js} +3 -3
  134. package/chunks/{chunk-Z4JX4NSH.js → chunk-SXJ7JYQA.js} +23 -23
  135. package/chunks/{chunk-XVHYA33G.js → chunk-TD7JVTIA.js} +4 -4
  136. package/chunks/{chunk-IRZ2ZH72.js → chunk-TEFHXP7C.js} +4 -4
  137. package/chunks/{chunk-2FRY5CRX.js → chunk-TNETSI2A.js} +3 -3
  138. package/chunks/{chunk-IA7TGCN2.js → chunk-TROB4PZY.js} +4 -4
  139. package/chunks/{chunk-4TRQPFDP.js → chunk-U3O2EO5Y.js} +26 -20
  140. package/chunks/{chunk-VKJ4KTPJ.js → chunk-U7ROFHSH.js} +1 -1
  141. package/chunks/{chunk-Q3JQ7OSU.js → chunk-UBC6PMV7.js} +1 -1
  142. package/chunks/{chunk-W5UC37EE.js → chunk-UFHPAMAV.js} +6 -0
  143. package/chunks/{chunk-EQL65XGA.js → chunk-UHF5VBKO.js} +47 -21
  144. package/chunks/{chunk-S6HYI3MF.js → chunk-UQPLUR4A.js} +2 -2
  145. package/chunks/{chunk-HGCQ5SE7.js → chunk-UXEO7E3V.js} +21 -0
  146. package/chunks/{chunk-WCG5O7IP.js → chunk-V3NMFQD2.js} +2 -2
  147. package/chunks/{chunk-EKPKKXY2.js → chunk-V4SJMQVJ.js} +1 -1
  148. package/chunks/{chunk-ONSZH6VM.js → chunk-VFJVRSRK.js} +2 -2
  149. package/chunks/{chunk-MZSJ43WV.js → chunk-W5ZFJYUG.js} +13 -0
  150. package/chunks/{chunk-XCGIMOLN.js → chunk-WCCLLK7X.js} +14 -1
  151. package/chunks/{chunk-4WL6SY4F.js → chunk-WDSTNDEW.js} +1 -1
  152. package/chunks/{chunk-KONVMRK7.js → chunk-WFTBYUOR.js} +1 -1
  153. package/chunks/{chunk-EI3NWELG.js → chunk-WH32GXQS.js} +6233 -4342
  154. package/chunks/{chunk-MIKXJYZB.js → chunk-WS5TWVT6.js} +305 -291
  155. package/chunks/{chunk-VJNBRRZG.js → chunk-WZMH7II3.js} +1 -1
  156. package/chunks/{chunk-67EWJE77.js → chunk-XY7DGTIC.js} +1 -1
  157. package/chunks/{chunk-HV76SFIA.js → chunk-YI5G32RU.js} +3 -3
  158. package/chunks/{chunk-OIVKILPI.js → chunk-YMB77M76.js} +18 -0
  159. package/chunks/{chunk-AQAJJMRR.js → chunk-YPITLFHS.js} +1 -1
  160. package/chunks/{chunk-WOJZWRAZ.js → chunk-YRLW2MSX.js} +1 -1
  161. package/chunks/{chunk-ZZCWJWTF.js → chunk-YY23TR4M.js} +31 -11
  162. package/chunks/{chunk-URKIBIFC.js → chunk-YYI3Z3AO.js} +3 -3
  163. package/chunks/chunk-Z7B6SRPM.js +32 -0
  164. package/chunks/{chunk-6Q5ABMTU.js → chunk-ZGONVQ3D.js} +23 -19
  165. package/chunks/{chunk-GWVUR3QZ.js → chunk-ZM6LZON7.js} +3 -3
  166. package/chunks/{chunk-XCWO3SMQ.js → chunk-ZPZANKVP.js} +3 -3
  167. package/chunks/{chunk-OCSFNUU4.js → chunk-ZRD3BUEX.js} +8 -8
  168. package/chunks/{chunk-PYQADEFD.js → chunk-ZRT36RSF.js} +1 -1
  169. package/chunks/{chunk-JT7XS4YW.js → chunk-ZZ7RUTJ4.js} +1 -1
  170. package/chunks/{computer-use-WQFK33Z3.js → computer-use-7BMFU557.js} +42 -41
  171. package/chunks/{config-utils-ULCSRMWD.js → config-utils-I732W437.js} +6 -6
  172. package/chunks/{contextCommand-7EOZND7C.js → contextCommand-VJ6UOMM4.js} +44 -43
  173. package/chunks/{core-runtime-FGMQRM6E.js → core-runtime-PMRKP77C.js} +42 -41
  174. package/chunks/{create-sub-session-QIDZUOPU.js → create-sub-session-23ULO5PO.js} +2 -2
  175. package/chunks/{create-sub-session-QM2K5HLZ.js → create-sub-session-5A3MSW22.js} +42 -41
  176. package/chunks/{cron-create-VONA5JYY.js → cron-create-5WUTNKNF.js} +4 -4
  177. package/chunks/{cron-delete-5JXSP2MI.js → cron-delete-JEQ27YPS.js} +4 -4
  178. package/chunks/{cron-list-KE4F2CIR.js → cron-list-IXGCA7UR.js} +4 -4
  179. package/chunks/{daemon-GWD7BT6E.js → daemon-PXIC4ZDK.js} +186 -7
  180. package/chunks/daemon-status-provider-33BLPRUA.js +103 -0
  181. package/chunks/daemon-trust-policy-ZUV26YGP.js +99 -0
  182. package/chunks/{daemon-trust-policy-monitor-6UKEABN5.js → daemon-trust-policy-monitor-35WRTIMA.js} +49 -48
  183. package/chunks/{de-LIW4XVLN.js → de-UBEBKG6V.js} +2 -1
  184. package/chunks/{deferred-core-runtime-67GJXHXS.js → deferred-core-runtime-ZSLQKM7J.js} +42 -41
  185. package/chunks/{display-image-NQRSIBXM.js → display-image-CAD7RAUM.js} +4 -4
  186. package/chunks/{dist-6BMOAE3Z.js → dist-362MN6CP.js} +4 -4
  187. package/chunks/{dist-3NTTUAHT.js → dist-5VDE7U3A.js} +3 -3
  188. package/chunks/{dist-Z3CS4OVP.js → dist-6RK4U6VU.js} +11 -5
  189. package/chunks/{dist-B2CGTW6T.js → dist-CCUH2Z4C.js} +3 -3
  190. package/chunks/{dist-J47AXBZC.js → dist-EZHCZSW6.js} +3 -3
  191. package/chunks/{dist-EZE3V3Q7.js → dist-JIORWIDV.js} +3 -3
  192. package/chunks/{dist-EWW3J4HQ.js → dist-M3XMEIP2.js} +3 -3
  193. package/chunks/{dist-OTUO3AS2.js → dist-NN5ARGTQ.js} +13 -5
  194. package/chunks/{earlyInputCapture-IWMYR6OB.js → earlyInputCapture-UNMCTGJR.js} +43 -42
  195. package/chunks/{edit-ZFGROCAF.js → edit-TXVTSXHY.js} +42 -41
  196. package/chunks/{en-SY5GTIGX.js → en-X6YV7GME.js} +2 -1
  197. package/chunks/{enter-worktree-TZZZCDM5.js → enter-worktree-7Q3X4PW7.js} +42 -41
  198. package/chunks/{enterPlanMode-U77BI3R6.js → enterPlanMode-AZBU3ZB6.js} +42 -41
  199. package/chunks/{environment-HC37DS2I.js → environment-TGFFQISF.js} +45 -44
  200. package/chunks/{errors-6AG54JPD.js → errors-GVPFT7BA.js} +44 -43
  201. package/chunks/{exit-worktree-UYYWFPNK.js → exit-worktree-7INKYMWE.js} +42 -41
  202. package/chunks/exitPlanMode-5CE7CLAE.js +85 -0
  203. package/chunks/{fast-path-F5FSZ3O7.js → fast-path-7B6F74IR.js} +5 -5
  204. package/chunks/{fast-path-settings-RPAVBD7P.js → fast-path-settings-LNOFM2YP.js} +2 -2
  205. package/chunks/{fr-RQFO7U4P.js → fr-VENTC2BS.js} +2 -1
  206. package/chunks/{gemini-NKQHYM36.js → gemini-4RUYPDKT.js} +92 -91
  207. package/chunks/{geminiContentGenerator-HCWZOUX3.js → geminiContentGenerator-NLL52POY.js} +6 -6
  208. package/chunks/{glob-3PDXKBAO.js → glob-DHU3INUK.js} +42 -41
  209. package/chunks/{goal-tools-SWNB6GP4.js → goal-tools-LQFO4BRY.js} +4 -4
  210. package/chunks/{grep-5HZKZYVD.js → grep-523W6G52.js} +42 -41
  211. package/chunks/handleAutoUpdate-PKUQ3OQQ.js +94 -0
  212. package/chunks/{i18n-Q27KKNDL.js → i18n-HYL2UBJW.js} +43 -42
  213. package/chunks/{image-gen-2Z2RJ6W7.js → image-gen-NLIDBAKE.js} +10 -10
  214. package/chunks/initializer-DGH7RAJ7.js +100 -0
  215. package/chunks/{installationInfo-XXB75T7O.js → installationInfo-FZ4XWV7O.js} +43 -42
  216. package/chunks/{ja-KOZKHJHZ.js → ja-QHT4EQTO.js} +2 -1
  217. package/chunks/{keychain-token-storage-TVAMTNP7.js → keychain-token-storage-GU75J2T2.js} +2 -2
  218. package/chunks/list-RH5HGWRJ.js +103 -0
  219. package/chunks/{list-agents-Z4WABFDZ.js → list-agents-5PNMK2AM.js} +2 -2
  220. package/chunks/loadedSettingsAdapter-XMX2JDOU.js +97 -0
  221. package/chunks/{loggingContentGenerator-6NTFBM7Q.js → loggingContentGenerator-T3J4HZ7U.js} +139 -98
  222. package/chunks/{loop-wakeup-UZ5RL5Y2.js → loop-wakeup-OV65FEGR.js} +5 -5
  223. package/chunks/{ls-TVHDGIES.js → ls-7CETV7WV.js} +4 -4
  224. package/chunks/{lsp-CVN6OQPI.js → lsp-IWTJWFLT.js} +2 -2
  225. package/chunks/{managed-npm-update-SPHYQUWZ.js → managed-npm-update-E5ZGIGWV.js} +45 -44
  226. package/chunks/mcp-6LC572CW.js +97 -0
  227. package/chunks/{monitor-ZBBPAA54.js → monitor-HQUS4RTV.js} +42 -41
  228. package/chunks/nonInteractiveCli-X7HKTS5Z.js +163 -0
  229. package/chunks/{notebook-edit-5W3FW7Z2.js → notebook-edit-QPI3LTFM.js} +42 -41
  230. package/chunks/{openaiContentGenerator-TQANPEVZ.js → openaiContentGenerator-GGS72DVB.js} +29 -29
  231. package/chunks/{pidfile-EQOBLH4E.js → pidfile-HD3EB6GL.js} +43 -42
  232. package/chunks/{processUtils-7XQG7EHS.js → processUtils-2WNEPSW4.js} +2 -2
  233. package/chunks/{pt-U6AOCTMF.js → pt-VL3I5RNY.js} +2 -1
  234. package/chunks/{qwenContentGenerator-BKCPHHXU.js → qwenContentGenerator-WJYPELF3.js} +48 -48
  235. package/chunks/{qwenOAuth2-BJ6PQKE6.js → qwenOAuth2-RSMEBZU4.js} +9 -9
  236. package/chunks/read-file-URU5ALY3.js +32 -0
  237. package/chunks/{read-mcp-resource-PZ4ZF6YL.js → read-mcp-resource-THCSZHXO.js} +2 -2
  238. package/chunks/{read-package-up-TCM6I7S2.js → read-package-up-K6RKTL5D.js} +1 -1
  239. package/chunks/{record-artifact-P4HFMS7X.js → record-artifact-76YYQA5F.js} +3 -3
  240. package/chunks/{resumeHistoryUtils-6N6XGJJW.js → resumeHistoryUtils-XMC3CR2U.js} +49 -48
  241. package/chunks/ripGrep-6NYCUBVW.js +85 -0
  242. package/chunks/{ru-CMX4UMYP.js → ru-4RCKL4PY.js} +2 -1
  243. package/chunks/{run-qwen-serve-BCKBCAMX.js → run-qwen-serve-H4IXCJDQ.js} +165 -65
  244. package/chunks/{runtime-E2437YKL.js → runtime-EJHNZR7H.js} +55 -54
  245. package/chunks/{scheduler-K3D5Z655.js → scheduler-VVORKEEZ.js} +44 -43
  246. package/chunks/{sdk-exporters-http-XVTZQRCE.js → sdk-exporters-http-JYKTSCMG.js} +11 -7
  247. package/chunks/{sdk-impl-7W7AKCS4.js → sdk-impl-ROR54N3H.js} +13 -10
  248. package/chunks/{send-message-CAMSLG2L.js → send-message-P5SLP57G.js} +6 -6
  249. package/chunks/serve-3ULKH2KQ.js +107 -0
  250. package/chunks/{server-UD6INW7J.js → server-J52IQLRJ.js} +949 -303
  251. package/chunks/{session-GR4ZEVW4.js → session-MNWSMCC2.js} +118 -98
  252. package/chunks/{settings-5O24D3OJ.js → settings-WFCKUQZO.js} +48 -47
  253. package/chunks/{shell-UTLWLG5G.js → shell-H5DZN76B.js} +42 -41
  254. package/chunks/{skill-QQAZL4VO.js → skill-STSDBOIL.js} +19 -19
  255. package/chunks/{skill-settings-P3YHJVBZ.js → skill-settings-LTJAR2LV.js} +48 -47
  256. package/chunks/spawnChannel-XL27KTLE.js +98 -0
  257. package/chunks/{standalone-update-QP742MGP.js → standalone-update-3FUDL2R6.js} +44 -43
  258. package/chunks/{startInteractiveUI-YCS6AEPN.js → startInteractiveUI-5BFJCCWU.js} +596 -335
  259. package/chunks/{syntheticOutput-PEBJQYJV.js → syntheticOutput-SEW4NA47.js} +3 -3
  260. package/chunks/{task-create-5NWCQSJF.js → task-create-247EAVF7.js} +10 -10
  261. package/chunks/{task-list-53265TRZ.js → task-list-ZJN4QHLK.js} +5 -5
  262. package/chunks/{task-stop-FPCOIRYX.js → task-stop-MAYQJ42I.js} +2 -2
  263. package/chunks/{task-update-5HN577LS.js → task-update-CG4FALQF.js} +10 -10
  264. package/chunks/{team-create-WFH7OCDQ.js → team-create-FC2EYGE7.js} +44 -43
  265. package/chunks/{team-delete-MMQB4OSC.js → team-delete-3XVRPQBP.js} +5 -5
  266. package/chunks/{team-plan-approval-EGTT53MV.js → team-plan-approval-X673CRIZ.js} +42 -41
  267. package/chunks/{terminal-image-renderer-BWRESAQ7.js → terminal-image-renderer-MRNJ77H7.js} +44 -43
  268. package/chunks/theme-manager-6UMSB7DJ.js +89 -0
  269. package/chunks/{todoWrite-JGV6VLOX.js → todoWrite-IE2YTCK7.js} +4 -4
  270. package/chunks/{tool-search-TI5PTIBF.js → tool-search-7Z3PPA5O.js} +19 -19
  271. package/chunks/total-session-admission-NU4KV76R.js +99 -0
  272. package/chunks/{trustedFolders-4KYHA4IG.js → trustedFolders-SCUSHKHS.js} +43 -42
  273. package/chunks/{update-relaunch-WB6LGIF2.js → update-relaunch-M6BNKY4W.js} +5 -5
  274. package/chunks/{updateCheck-LOS5GYFC.js → updateCheck-QMZZ53S6.js} +48 -47
  275. package/chunks/{useAutoAcceptIndicator-MHAPY52L.js → useAutoAcceptIndicator-GAFG5PFE.js} +52 -51
  276. package/chunks/{validateNonInterActiveAuth-QV22HNQU.js → validateNonInterActiveAuth-V44BOAD2.js} +87 -86
  277. package/chunks/{version-DALWZHKQ.js → version-A4J2RQXD.js} +2 -2
  278. package/chunks/{web-fetch-JMJVMYFE.js → web-fetch-43TWEBWB.js} +19 -19
  279. package/chunks/{web-search-DNDUIPU5.js → web-search-CS3Q6JBI.js} +11 -11
  280. package/chunks/{workflow-JGNN64PM.js → workflow-ETQXJUPR.js} +115 -49
  281. package/chunks/workspace-providers-status-Y4FPKLHN.js +100 -0
  282. package/chunks/{workspace-registration-store-LRJG7QA4.js → workspace-registration-store-JASCK5RS.js} +1 -1
  283. package/chunks/{workspace-registry-KVXIFM36.js → workspace-registry-MU3VIM2D.js} +49 -48
  284. package/chunks/{workspace-service-PO4AAKKT.js → workspace-service-MHVHRNDX.js} +54 -53
  285. package/chunks/workspace-skills-status-QVQMNHGO.js +100 -0
  286. package/chunks/{workspace-trust-reconciler-DOZPCVHG.js → workspace-trust-reconciler-ABXDCISO.js} +56 -55
  287. package/chunks/write-file-YL7EPQRJ.js +87 -0
  288. package/chunks/{zh-AGL2FVBI.js → zh-LMSTK4WD.js} +2 -1
  289. package/chunks/{zh-TW-KI66MHQY.js → zh-TW-SQ4HTSCW.js} +2 -1
  290. package/chunks/{zoom-image-CNC77ZMA.js → zoom-image-ZQV6O2KE.js} +15 -15
  291. package/cli.js +13 -13
  292. package/locales/ca.js +1 -0
  293. package/locales/de.js +1 -0
  294. package/locales/en.js +1 -0
  295. package/locales/fr.js +1 -0
  296. package/locales/ja.js +1 -0
  297. package/locales/pt.js +1 -0
  298. package/locales/ru.js +1 -0
  299. package/locales/zh-TW.js +1 -0
  300. package/locales/zh.js +1 -0
  301. package/package.json +4 -4
  302. package/web-shell/assets/{arc-CDk0d60K.js → arc-BDKBUdHd.js} +1 -1
  303. package/web-shell/assets/{architectureDiagram-3BPJPVTR-h-W3I2lP.js → architectureDiagram-3BPJPVTR-DgMi5iOf.js} +1 -1
  304. package/web-shell/assets/{blockDiagram-GPEHLZMM-D1pvSmZg.js → blockDiagram-GPEHLZMM-DOyxD2BK.js} +1 -1
  305. package/web-shell/assets/{c4Diagram-AAUBKEIU-ByAm5ZNf.js → c4Diagram-AAUBKEIU-CmXzCE_n.js} +1 -1
  306. package/web-shell/assets/channel-BCff03Ag.js +1 -0
  307. package/web-shell/assets/{chunk-2J33WTMH-VrGPPOGV.js → chunk-2J33WTMH-Dr13N7PT.js} +1 -1
  308. package/web-shell/assets/{chunk-4BX2VUAB-B7hTowgG.js → chunk-4BX2VUAB-CIFcKNCP.js} +1 -1
  309. package/web-shell/assets/{chunk-55IACEB6-j1Fq8DpE.js → chunk-55IACEB6-B8jmrVPK.js} +1 -1
  310. package/web-shell/assets/{chunk-727SXJPM-UjABYpF2.js → chunk-727SXJPM-CQc0wjze.js} +1 -1
  311. package/web-shell/assets/{chunk-AQP2D5EJ-D4uBItrs.js → chunk-AQP2D5EJ-CGdZxT9s.js} +1 -1
  312. package/web-shell/assets/{chunk-FMBD7UC4-DeFbKlb8.js → chunk-FMBD7UC4-4iCBhCLJ.js} +1 -1
  313. package/web-shell/assets/{chunk-ND2GUHAM-rQJ8TIgT.js → chunk-ND2GUHAM-B0mMzZcM.js} +1 -1
  314. package/web-shell/assets/{chunk-QZHKN3VN-DAGcRxvq.js → chunk-QZHKN3VN-6CURQrGl.js} +1 -1
  315. package/web-shell/assets/classDiagram-4FO5ZUOK-DnwxH0ri.js +1 -0
  316. package/web-shell/assets/classDiagram-v2-Q7XG4LA2-DnwxH0ri.js +1 -0
  317. package/web-shell/assets/{cose-bilkent-S5V4N54A-MaE7MJSt.js → cose-bilkent-S5V4N54A-L6Fo1GN1.js} +1 -1
  318. package/web-shell/assets/{dagre-BM42HDAG-DzijYGSb.js → dagre-BM42HDAG-BTsGDeLA.js} +1 -1
  319. package/web-shell/assets/{diagram-2AECGRRQ-WdbG7WnX.js → diagram-2AECGRRQ-B4AXYZGR.js} +1 -1
  320. package/web-shell/assets/{diagram-5GNKFQAL-NYutsBnw.js → diagram-5GNKFQAL-C2yM5aNc.js} +1 -1
  321. package/web-shell/assets/{diagram-KO2AKTUF-Dqg0eBY0.js → diagram-KO2AKTUF-CrGLZmRK.js} +1 -1
  322. package/web-shell/assets/{diagram-LMA3HP47-C7vRP2Lb.js → diagram-LMA3HP47-rycHl4fv.js} +1 -1
  323. package/web-shell/assets/{diagram-OG6HWLK6-B2sEPpPt.js → diagram-OG6HWLK6-MQj80AQu.js} +1 -1
  324. package/web-shell/assets/{erDiagram-TEJ5UH35-a4zIbzm8.js → erDiagram-TEJ5UH35-DCgH-D0D.js} +1 -1
  325. package/web-shell/assets/{flowDiagram-I6XJVG4X-BK9y89ya.js → flowDiagram-I6XJVG4X-B0gnwCnt.js} +1 -1
  326. package/web-shell/assets/{ganttDiagram-6RSMTGT7-wUQTSNvV.js → ganttDiagram-6RSMTGT7-CB0OxXVE.js} +1 -1
  327. package/web-shell/assets/{gitGraphDiagram-PVQCEYII-Dnzt4SAi.js → gitGraphDiagram-PVQCEYII-xLxucse9.js} +1 -1
  328. package/web-shell/assets/{index-BA3wUcKL.js → index-BFFbq0E-.js} +1 -1
  329. package/web-shell/assets/index-D7XXR9S-.js +1789 -0
  330. package/web-shell/assets/index-Dk5RwPL9.css +5 -0
  331. package/web-shell/assets/{infoDiagram-5YYISTIA-DcaoToij.js → infoDiagram-5YYISTIA-7FCqN4qa.js} +1 -1
  332. package/web-shell/assets/{ishikawaDiagram-YF4QCWOH-DzduqhP2.js → ishikawaDiagram-YF4QCWOH-BGyKlnik.js} +1 -1
  333. package/web-shell/assets/{journeyDiagram-JHISSGLW-BvviZR_O.js → journeyDiagram-JHISSGLW-CmgSXMLF.js} +1 -1
  334. package/web-shell/assets/{kanban-definition-UN3LZRKU-Efm2JxY3.js → kanban-definition-UN3LZRKU-CjT2mF6A.js} +1 -1
  335. package/web-shell/assets/{linear-DtY3IbOs.js → linear-CiTDGfCW.js} +1 -1
  336. package/web-shell/assets/{mermaid.core-PzpFqoMe.js → mermaid.core-_QnqxPRF.js} +5 -5
  337. package/web-shell/assets/{mindmap-definition-RKZ34NQL-BLlTkHS0.js → mindmap-definition-RKZ34NQL-B1On14ZB.js} +1 -1
  338. package/web-shell/assets/{pieDiagram-4H26LBE5-D-mKF-jE.js → pieDiagram-4H26LBE5-x1Pf1OG2.js} +1 -1
  339. package/web-shell/assets/{quadrantDiagram-W4KKPZXB-DYCzslGm.js → quadrantDiagram-W4KKPZXB-ZawmK1Q9.js} +1 -1
  340. package/web-shell/assets/{requirementDiagram-4Y6WPE33-Dfpxlk7R.js → requirementDiagram-4Y6WPE33-krIMX0c8.js} +1 -1
  341. package/web-shell/assets/{sankeyDiagram-5OEKKPKP-D5cRaaxh.js → sankeyDiagram-5OEKKPKP-aMJyxtx_.js} +1 -1
  342. package/web-shell/assets/{sequenceDiagram-3UESZ5HK-s04DReiS.js → sequenceDiagram-3UESZ5HK-C530-Kqz.js} +1 -1
  343. package/web-shell/assets/{stateDiagram-AJRCARHV-01UNFgnb.js → stateDiagram-AJRCARHV-DObd9dT_.js} +1 -1
  344. package/web-shell/assets/stateDiagram-v2-BHNVJYJU-Bttf9Ae9.js +1 -0
  345. package/web-shell/assets/{timeline-definition-PNZ67QCA-DX8_wZBC.js → timeline-definition-PNZ67QCA-D9LnwQ1O.js} +1 -1
  346. package/web-shell/assets/{vennDiagram-CIIHVFJN-BK0FlBme.js → vennDiagram-CIIHVFJN-B_MT_v6Y.js} +1 -1
  347. package/web-shell/assets/{wardley-L42UT6IY-DkPc9UlD.js → wardley-L42UT6IY-DHKPz5Hu.js} +1 -1
  348. package/web-shell/assets/{wardleyDiagram-YWT4CUSO-DNKkpDAo.js → wardleyDiagram-YWT4CUSO-BoyKaItA.js} +1 -1
  349. package/web-shell/assets/{xychartDiagram-2RQKCTM6-CiPwg8QG.js → xychartDiagram-2RQKCTM6--xBJT7Kg.js} +1 -1
  350. package/web-shell/index.html +2 -2
  351. package/chunks/agent-headless-HYEHZFH6.js +0 -86
  352. package/chunks/channel-settings-store-OXYG5S5X.js +0 -101
  353. package/chunks/chunk-I5VM3SKY.js +0 -451
  354. package/chunks/chunk-PDPFQ2FO.js +0 -156
  355. package/chunks/daemon-status-provider-L3J6GKCT.js +0 -102
  356. package/chunks/daemon-trust-policy-4PHPY23S.js +0 -98
  357. package/chunks/exitPlanMode-RWJR2KGB.js +0 -84
  358. package/chunks/handleAutoUpdate-NHFSGYTF.js +0 -93
  359. package/chunks/initializer-Y5DJLT43.js +0 -99
  360. package/chunks/list-YHNQ32CS.js +0 -102
  361. package/chunks/loadedSettingsAdapter-GHUQK7H4.js +0 -96
  362. package/chunks/mcp-EA3KO6FS.js +0 -96
  363. package/chunks/nonInteractiveCli-NNOR56HU.js +0 -162
  364. package/chunks/read-file-KKTXGIZD.js +0 -32
  365. package/chunks/ripGrep-SJVAAYDV.js +0 -84
  366. package/chunks/serve-IH4XR5IL.js +0 -106
  367. package/chunks/spawnChannel-UAQMH6Y6.js +0 -94
  368. package/chunks/theme-manager-ZNDGAHJN.js +0 -88
  369. package/chunks/total-session-admission-66UDSOHO.js +0 -98
  370. package/chunks/workspace-providers-status-K22B3Z6B.js +0 -99
  371. package/chunks/workspace-skills-status-DDYCBVSH.js +0 -99
  372. package/chunks/write-file-TT6MWIKC.js +0 -86
  373. package/web-shell/assets/channel-DPFUV4oi.js +0 -1
  374. package/web-shell/assets/classDiagram-4FO5ZUOK-CLm0hVvw.js +0 -1
  375. package/web-shell/assets/classDiagram-v2-Q7XG4LA2-CLm0hVvw.js +0 -1
  376. package/web-shell/assets/index-BjC3yjjL.css +0 -5
  377. package/web-shell/assets/index-QzFq6w7o.js +0 -1775
  378. package/web-shell/assets/stateDiagram-v2-BHNVJYJU-DXb5olqv.js +0 -1
@@ -5,7 +5,7 @@ import {
5
5
  openQwenAsrRealtimeStream,
6
6
  openVoiceStream,
7
7
  openVoiceStreamWithRetry
8
- } from "./chunk-Q3JQ7OSU.js";
8
+ } from "./chunk-UBC6PMV7.js";
9
9
  import {
10
10
  GENERATION_MAX_PROMPT_BYTES,
11
11
  LIVE_SESSION_SOURCE_PREFIX,
@@ -26,7 +26,7 @@ import {
26
26
  shouldSuppressRememberErrorDetails,
27
27
  workspaceMemoryFailureCode,
28
28
  workspaceMemoryFailureDiagnostics
29
- } from "./chunk-6LP743KE.js";
29
+ } from "./chunk-MUTFMB5B.js";
30
30
  import {
31
31
  SetupGithubError,
32
32
  collectSessionData,
@@ -38,18 +38,17 @@ import {
38
38
  toJson,
39
39
  toJsonl,
40
40
  toMarkdown
41
- } from "./chunk-5MZCSWI4.js";
41
+ } from "./chunk-4NV6L4GZ.js";
42
42
  import {
43
43
  OBSERVED_CONTACT_MAX_FRESH_WITHIN_SECONDS,
44
44
  ObservedChannelContactStore
45
- } from "./chunk-OWMAZHIX.js";
46
- import "./chunk-ZRBMO3C7.js";
45
+ } from "./chunk-EGB2PIYM.js";
46
+ import "./chunk-4IWFPTAH.js";
47
47
  import {
48
48
  escapeAnsiCtrlCodes
49
49
  } from "./chunk-4NFY2S7N.js";
50
50
  import "./chunk-2MIN6GRR.js";
51
51
  import "./chunk-QHTIBUWB.js";
52
- import "./chunk-EKTCKZV5.js";
53
52
  import "./chunk-3Z43GZUQ.js";
54
53
  import {
55
54
  CAPABILITIES_SCHEMA_VERSION,
@@ -107,14 +106,14 @@ import {
107
106
  setRateLimiter,
108
107
  unsafeRevealSecret,
109
108
  validateMcpRuntimeServerName
110
- } from "./chunk-ZZCWJWTF.js";
109
+ } from "./chunk-YY23TR4M.js";
111
110
  import "./chunk-VGHZT6JR.js";
112
111
  import {
113
112
  isLoopbackBind,
114
113
  normalizeSessionIdForLookup,
115
114
  parseCallerSuppliedSessionId
116
115
  } from "./chunk-TQOF5KBL.js";
117
- import "./chunk-HGCQ5SE7.js";
116
+ import "./chunk-UXEO7E3V.js";
118
117
  import {
119
118
  EMPTY_WORKSPACE_VOICE_UPDATE_ERROR,
120
119
  MAX_WORKSPACE_SKILL_NAME_LENGTH,
@@ -128,14 +127,14 @@ import {
128
127
  validateWorkspaceSkillName,
129
128
  validateWorkspaceVoiceState,
130
129
  voiceSettingsScopeToWire
131
- } from "./chunk-OCSFNUU4.js";
130
+ } from "./chunk-ZRD3BUEX.js";
132
131
  import {
133
132
  PermissionRulesValidationError,
134
133
  buildPermissionSettings,
135
134
  isPermissionRuleType,
136
135
  normalizePermissionRules,
137
136
  readPermissionRuleSet
138
- } from "./chunk-Y3OVRWRY.js";
137
+ } from "./chunk-4QC6SUVN.js";
139
138
  import {
140
139
  assertVoiceBaseUrlNetworkAllowed,
141
140
  isStreamingVoiceModel,
@@ -143,13 +142,13 @@ import {
143
142
  resolveVoiceTranscriptionConfig,
144
143
  sanitizeVoiceErrorMessage,
145
144
  transcribeVoiceAudio
146
- } from "./chunk-LLCWZQCU.js";
145
+ } from "./chunk-HM7TLULV.js";
147
146
  import {
148
147
  isVoiceEnabled,
149
148
  isVoiceMode,
150
149
  readVoiceModel
151
- } from "./chunk-EBZ6BJTF.js";
152
- import "./chunk-AOHJKPKL.js";
150
+ } from "./chunk-OEVVUUYW.js";
151
+ import "./chunk-5KZNWF2M.js";
153
152
  import {
154
153
  createTotalSessionAdmissionController
155
154
  } from "./chunk-X2UOOG5V.js";
@@ -166,26 +165,26 @@ import {
166
165
  } from "./chunk-4JRM2BSM.js";
167
166
  import {
168
167
  assertValidChannelSecretUpdates
169
- } from "./chunk-NRLFZWCT.js";
168
+ } from "./chunk-PNU3TILU.js";
170
169
  import {
171
170
  createDaemonStatusProvider
172
- } from "./chunk-OONWZLFK.js";
171
+ } from "./chunk-OYLYERMH.js";
173
172
  import "./chunk-NTTBXH7U.js";
174
- import "./chunk-VSFKIRRW.js";
173
+ import "./chunk-NH6U7L42.js";
175
174
  import "./chunk-3SH53ANB.js";
176
175
  import {
177
176
  createWorkspaceProvidersStatusProvider
178
- } from "./chunk-QJMOAMXT.js";
177
+ } from "./chunk-RG2S3GYC.js";
179
178
  import {
180
179
  getAuthTypeFromEnv,
181
180
  resolveCliGenerationConfig
182
- } from "./chunk-2PLNY5TN.js";
181
+ } from "./chunk-7MAHENBD.js";
183
182
  import {
184
183
  snapshotProcessEnv
185
- } from "./chunk-P3BJLFSZ.js";
184
+ } from "./chunk-OYQM5XZ4.js";
186
185
  import {
187
186
  createWorkspaceSkillsStatusProvider
188
- } from "./chunk-VWKER4ZH.js";
187
+ } from "./chunk-SQCTJ435.js";
189
188
  import "./chunk-BGXZBI5B.js";
190
189
  import "./chunk-Z4X5MTRT.js";
191
190
  import {
@@ -204,20 +203,20 @@ import {
204
203
  import {
205
204
  evaluateDaemonWorkspaceTrust,
206
205
  readDaemonTrustPolicySnapshot
207
- } from "./chunk-47PEPJO7.js";
206
+ } from "./chunk-LKN5SEHD.js";
208
207
  import {
209
208
  daemonObservedContactsPath,
210
209
  loadChannelsConfig
211
- } from "./chunk-NEOXOWYH.js";
212
- import "./chunk-UMD7WQTR.js";
210
+ } from "./chunk-6YUEAYJ5.js";
211
+ import "./chunk-5XNR53C7.js";
213
212
  import "./chunk-57OAHC2Y.js";
214
213
  import {
215
214
  parseChannelWebhookConfigLenient
216
- } from "./chunk-LHEC5V6G.js";
217
- import "./chunk-67EWJE77.js";
215
+ } from "./chunk-AXEL55JW.js";
216
+ import "./chunk-XY7DGTIC.js";
218
217
  import {
219
218
  supportedChannelCatalog
220
- } from "./chunk-E2FPSSKP.js";
219
+ } from "./chunk-KZKEVWJW.js";
221
220
  import {
222
221
  LIVE_HOST_BUNDLE_ID,
223
222
  LIVE_HOST_PROTOCOL_VERSION,
@@ -228,21 +227,21 @@ import {
228
227
  SessionArtifactValidationError,
229
228
  createAcpSessionBridge,
230
229
  parseSessionSource
231
- } from "./chunk-F24A2JBM.js";
230
+ } from "./chunk-CUXI3S6E.js";
232
231
  import {
233
232
  EVENT_SCHEMA_VERSION,
234
233
  EventBus,
235
234
  SubscriberLimitExceededError
236
- } from "./chunk-MZSJ43WV.js";
237
- import "./chunk-XCGIMOLN.js";
235
+ } from "./chunk-W5ZFJYUG.js";
236
+ import "./chunk-WCCLLK7X.js";
238
237
  import "./chunk-OCPBI7J5.js";
239
- import "./chunk-I5VM3SKY.js";
238
+ import "./chunk-OMVHZ7E6.js";
240
239
  import {
241
240
  STATUS_SCHEMA_VERSION,
242
241
  SessionRestoreTimeoutError,
243
242
  createIdleWorkspaceMemoryStatus,
244
243
  mapDomainErrorToErrorKind
245
- } from "./chunk-DA4HRSBW.js";
244
+ } from "./chunk-NHZF4VCD.js";
246
245
  import "./chunk-K6KS3LTN.js";
247
246
  import "./chunk-FC4KQFCS.js";
248
247
  import "./chunk-T3CHYWJZ.js";
@@ -254,11 +253,12 @@ import {
254
253
  WorkspaceRegistrationStoreLimitError,
255
254
  normalizeWorkspaceDisplayName,
256
255
  workspaceRegistrationId
257
- } from "./chunk-QGNOFE5E.js";
256
+ } from "./chunk-766PXUQ3.js";
258
257
  import {
258
+ DAEMON_PROMPT_DISPLAY_TEXT_META_KEY,
259
259
  REQUESTED_SESSION_ID_META_KEY,
260
260
  gradeActiveWorkCoverage
261
- } from "./chunk-W5UC37EE.js";
261
+ } from "./chunk-UFHPAMAV.js";
262
262
  import {
263
263
  BranchWhilePromptActiveError,
264
264
  BridgeChannelQuarantinedError,
@@ -299,6 +299,10 @@ import {
299
299
  canonicalizeWorkspaces,
300
300
  translateAndCheckAbsoluteWorkspacePath
301
301
  } from "./chunk-6PLDPT2C.js";
302
+ import {
303
+ CHANNEL_WORKER_PROMPT_AUTHORIZATION_META_KEY,
304
+ isChannelWorkerPromptAuthorized
305
+ } from "./chunk-Z7B6SRPM.js";
302
306
  import {
303
307
  ChannelDeliveryError,
304
308
  MAX_CHANNEL_STARTUP_FAILURES,
@@ -311,7 +315,7 @@ import {
311
315
  } from "./chunk-YP5KH5Y7.js";
312
316
  import {
313
317
  normalizeWorkerDiagnostic
314
- } from "./chunk-PBRVUF5B.js";
318
+ } from "./chunk-JW5UEE3V.js";
315
319
  import {
316
320
  normalizeServeChannelSelection
317
321
  } from "./chunk-ALMR3E6Q.js";
@@ -323,8 +327,8 @@ import "./chunk-BKHCW2BI.js";
323
327
  import "./chunk-5HBA2Z7V.js";
324
328
  import {
325
329
  sanitizeLogText
326
- } from "./chunk-DX3RGJMS.js";
327
- import "./chunk-UDXSXLER.js";
330
+ } from "./chunk-ADJDLEVO.js";
331
+ import "./chunk-IW6RQPQB.js";
328
332
  import {
329
333
  getDialogSettingKeys,
330
334
  getModelProvidersOwnerScope,
@@ -334,26 +338,26 @@ import {
334
338
  getWritableScopes,
335
339
  loadSettings,
336
340
  validateSettingValue
337
- } from "./chunk-ABVRJU3D.js";
338
- import "./chunk-UBX6NL47.js";
341
+ } from "./chunk-LY2SB7GC.js";
342
+ import "./chunk-JLT5HCGQ.js";
339
343
  import "./chunk-RKUWKYED.js";
340
344
  import "./chunk-GOXKNSDZ.js";
341
345
  import "./chunk-IDS7MSUP.js";
342
346
  import {
343
347
  detectSystemLanguage,
344
348
  resolveLanguageSetting
345
- } from "./chunk-UEOKWYGY.js";
349
+ } from "./chunk-SESSAEWC.js";
346
350
  import {
347
351
  SUPPORTED_LANGUAGES,
348
352
  resolveSupportedLanguage
349
353
  } from "./chunk-5EJZE3FP.js";
350
- import "./chunk-ZJ4W6SUY.js";
351
- import "./chunk-VFMASYQA.js";
352
- import "./chunk-AEL7KN2O.js";
353
- import "./chunk-VJNBRRZG.js";
354
+ import "./chunk-L6PE52MF.js";
355
+ import "./chunk-MS7GNABG.js";
356
+ import "./chunk-DANYMI4U.js";
357
+ import "./chunk-WZMH7II3.js";
354
358
  import {
355
359
  getWorkspaceTrustStatus
356
- } from "./chunk-GWVUR3QZ.js";
360
+ } from "./chunk-ZM6LZON7.js";
357
361
  import "./chunk-NPQ5ZKRP.js";
358
362
  import {
359
363
  isWithinRoot as isWithinRoot2
@@ -433,20 +437,20 @@ import {
433
437
  writeWorkspaceContextFile,
434
438
  writeWorktreeSession,
435
439
  writeWorktreeSessionMarker
436
- } from "./chunk-EI3NWELG.js";
440
+ } from "./chunk-WH32GXQS.js";
437
441
  import "./chunk-GOFAQQZA.js";
438
442
  import "./chunk-5M6IDOMF.js";
439
443
  import "./chunk-TWPJO254.js";
440
- import "./chunk-H6XPXXMH.js";
444
+ import "./chunk-CQ35AJ4Z.js";
441
445
  import {
442
446
  MAX_JOBS,
443
447
  nextDurableFireMs
444
- } from "./chunk-2UUMVNYT.js";
445
- import "./chunk-MVUQRLOH.js";
446
- import "./chunk-XCWO3SMQ.js";
447
- import "./chunk-7MH4J33A.js";
448
+ } from "./chunk-NM33GGOM.js";
449
+ import "./chunk-A4BAHMJF.js";
450
+ import "./chunk-ZPZANKVP.js";
451
+ import "./chunk-A6GQUQ7I.js";
448
452
  import "./chunk-6PVPNMXU.js";
449
- import "./chunk-TRRF5BSP.js";
453
+ import "./chunk-F4BUGC4Y.js";
450
454
  import {
451
455
  nextFireTime,
452
456
  parseCron
@@ -459,22 +463,22 @@ import {
459
463
  readCronTasks,
460
464
  taskHasLegacyCondition,
461
465
  updateCronTasks
462
- } from "./chunk-GNPNYXJB.js";
463
- import "./chunk-HUWENAHO.js";
466
+ } from "./chunk-AAZWJAPQ.js";
467
+ import "./chunk-7WUMS2UA.js";
464
468
  import "./chunk-O6GEWCJA.js";
465
469
  import "./chunk-T26EAKDL.js";
466
470
  import "./chunk-ZPJWUGCS.js";
467
471
  import "./chunk-CPBF7KYF.js";
468
- import "./chunk-J6SZID63.js";
472
+ import "./chunk-KTWUFHS4.js";
469
473
  import "./chunk-KRXPRVGL.js";
470
- import "./chunk-GM463R2B.js";
471
- import "./chunk-SEZ556DZ.js";
472
- import "./chunk-2FRY5CRX.js";
473
- import "./chunk-QUI267ZP.js";
474
+ import "./chunk-2ASWIM4A.js";
475
+ import "./chunk-67F2BEYW.js";
476
+ import "./chunk-TNETSI2A.js";
477
+ import "./chunk-B66LYK4B.js";
474
478
  import {
475
479
  APPROVAL_MODES
476
- } from "./chunk-WAUGQKUU.js";
477
- import "./chunk-DZUO626D.js";
480
+ } from "./chunk-SNHBRO4C.js";
481
+ import "./chunk-OUCCIS3E.js";
478
482
  import {
479
483
  addDaemonRequestAttribute,
480
484
  captureDaemonTelemetryContext,
@@ -486,20 +490,21 @@ import {
486
490
  recordDaemonHttpResponse,
487
491
  runWithDaemonTelemetryContext,
488
492
  withDaemonRequestSpan
489
- } from "./chunk-4TRQPFDP.js";
493
+ } from "./chunk-U3O2EO5Y.js";
490
494
  import "./chunk-SAH4BD2J.js";
491
- import "./chunk-CPG6P4GG.js";
495
+ import "./chunk-66PLFJQ7.js";
496
+ import "./chunk-SKRHR6N2.js";
492
497
  import "./chunk-S6LOFUVP.js";
493
498
  import "./chunk-2J3OJGTL.js";
494
499
  import {
495
500
  SubagentError,
496
501
  SubagentErrorCode
497
- } from "./chunk-IA7TGCN2.js";
502
+ } from "./chunk-TROB4PZY.js";
498
503
  import "./chunk-K623ENWT.js";
499
504
  import {
500
505
  escapeXml
501
506
  } from "./chunk-AQ37AY7B.js";
502
- import "./chunk-EQL65XGA.js";
507
+ import "./chunk-UHF5VBKO.js";
503
508
  import {
504
509
  QwenOAuth2Client,
505
510
  QwenOAuthPollError,
@@ -508,19 +513,19 @@ import {
508
513
  isDeviceAuthorizationSuccess,
509
514
  isDeviceTokenPending,
510
515
  isDeviceTokenSuccess
511
- } from "./chunk-3P2LV43B.js";
516
+ } from "./chunk-MMEDZKWK.js";
512
517
  import "./chunk-NAVJD2PQ.js";
513
- import "./chunk-HV76SFIA.js";
514
- import "./chunk-4PYCZH2V.js";
518
+ import "./chunk-YI5G32RU.js";
519
+ import "./chunk-QEWAHAW2.js";
515
520
  import "./chunk-P3QQPMQA.js";
516
- import "./chunk-SR7RZ4MS.js";
517
- import "./chunk-M6HMMKVG.js";
521
+ import "./chunk-FTGU6G45.js";
522
+ import "./chunk-PSTHNTHF.js";
518
523
  import "./chunk-KM73TBQ4.js";
519
524
  import "./chunk-MPHPFVKK.js";
520
525
  import "./chunk-AXMWHKXA.js";
521
526
  import "./chunk-GLCZKT5V.js";
522
527
  import "./chunk-DJ2GSRLV.js";
523
- import "./chunk-EI3HZX6C.js";
528
+ import "./chunk-KK3FEHPJ.js";
524
529
  import "./chunk-CR3C7WXL.js";
525
530
  import "./chunk-XWRJCPHC.js";
526
531
  import {
@@ -533,30 +538,30 @@ import {
533
538
  isWithinRoot,
534
539
  parseLineTolerant,
535
540
  read
536
- } from "./chunk-YGT2AUJ7.js";
537
- import "./chunk-WOJZWRAZ.js";
541
+ } from "./chunk-LAKFZU36.js";
542
+ import "./chunk-YRLW2MSX.js";
538
543
  import "./chunk-VGC4I5JJ.js";
539
- import "./chunk-FVKHVJZQ.js";
540
- import "./chunk-COBO5EBO.js";
541
- import "./chunk-6ZRFAKXK.js";
542
- import "./chunk-PYQADEFD.js";
543
- import "./chunk-Y4R47ZUH.js";
544
+ import "./chunk-6OJDN5ZT.js";
545
+ import "./chunk-JRTJEGSP.js";
546
+ import "./chunk-C2DR57L6.js";
547
+ import "./chunk-ZRT36RSF.js";
548
+ import "./chunk-RTBUTKAX.js";
544
549
  import "./chunk-F6WFNA7U.js";
545
550
  import "./chunk-46UV252V.js";
546
- import "./chunk-ZBVS26BY.js";
547
- import "./chunk-KKBPOU75.js";
548
- import "./chunk-EUNWC2VS.js";
549
- import "./chunk-FOGU3LJX.js";
550
- import "./chunk-L2AFWWJE.js";
551
- import "./chunk-W4RQUHY3.js";
552
- import "./chunk-PDPFQ2FO.js";
551
+ import "./chunk-FPGTNKCP.js";
552
+ import "./chunk-H6BFLALJ.js";
553
+ import "./chunk-O6SLWH4X.js";
554
+ import "./chunk-NW7SPXVG.js";
555
+ import "./chunk-7UNST76G.js";
556
+ import "./chunk-HHJLM3WQ.js";
557
+ import "./chunk-K5IDV3PC.js";
553
558
  import {
554
559
  FatalConfigError,
555
560
  Storage,
556
561
  createDebugLogger,
557
562
  getErrorMessage,
558
563
  runWithoutDebugLogSession
559
- } from "./chunk-OIVKILPI.js";
564
+ } from "./chunk-YMB77M76.js";
560
565
  import "./chunk-VOQXFAY5.js";
561
566
  import {
562
567
  writeStderrLine,
@@ -583,7 +588,7 @@ import {
583
588
 
584
589
  // packages/cli/src/serve/server.ts
585
590
  init_esbuild_shims();
586
- var import_express5 = __toESM(require_express(), 1);
591
+ var import_express6 = __toESM(require_express(), 1);
587
592
 
588
593
  // packages/cli/src/serve/acp-http/index.ts
589
594
  init_esbuild_shims();
@@ -1001,6 +1006,7 @@ import * as path2 from "node:path";
1001
1006
  var MAX_READ_BYTES = 256 * 1024;
1002
1007
  var MAX_TEXT_SCAN_BYTES = 8 * 1024 * 1024;
1003
1008
  var MAX_WRITE_BYTES = 5 * 1024 * 1024;
1009
+ var MAX_UPLOAD_BYTES = 50 * 1024 * 1024;
1004
1010
  var BINARY_PROBE_BYTES = 4096;
1005
1011
  function shouldIgnore(absolute, boundWorkspace, ignore, kind = "file") {
1006
1012
  const rel = path2.relative(boundWorkspace, absolute);
@@ -1200,11 +1206,11 @@ function decodeTextCursor(cursor) {
1200
1206
  return { off, size, dev, ino };
1201
1207
  }
1202
1208
  __name(decodeTextCursor, "decodeTextCursor");
1203
- function assertCursorMatchesFile(cursor, stats, path16) {
1209
+ function assertCursorMatchesFile(cursor, stats, path17) {
1204
1210
  if (String(stats.dev) !== cursor.dev || String(stats.ino) !== cursor.ino || stats.size < cursor.size) {
1205
1211
  throw new FsError(
1206
1212
  "hash_mismatch",
1207
- `cursor no longer matches the file it was issued for: ${path16}`,
1213
+ `cursor no longer matches the file it was issued for: ${path17}`,
1208
1214
  { hint: "re-read the file from the beginning to get a fresh cursor" }
1209
1215
  );
1210
1216
  }
@@ -2088,6 +2094,41 @@ var WorkspaceFileSystemImpl = class {
2088
2094
  throw this.recordAndWrap(err, "edit", p);
2089
2095
  }
2090
2096
  }
2097
+ async writeBytesAtomic(p, data) {
2098
+ const start = performance.now();
2099
+ try {
2100
+ this.deps.generationGuard?.assertOpen();
2101
+ assertTrustedForIntent(this.deps.trusted, "write");
2102
+ enforceWriteSize(data.length, MAX_UPLOAD_BYTES);
2103
+ const out = await this.deps.pathLocks.runExclusive(
2104
+ p,
2105
+ async () => {
2106
+ await assertCreateTargetAbsent(p);
2107
+ this.deps.generationGuard?.assertOpen();
2108
+ const result = await atomicPublishResolvedFile({
2109
+ target: p,
2110
+ buf: data,
2111
+ mode: "create",
2112
+ assertGenerationOpen: /* @__PURE__ */ __name(() => this.deps.generationGuard?.assertOpen(), "assertGenerationOpen")
2113
+ });
2114
+ const verdict = this.ignoreVerdict(p, "file");
2115
+ this.deps.audit.recordAccess(this.deps.ctx, {
2116
+ intent: "write",
2117
+ absolute: p,
2118
+ durationMs: performance.now() - start,
2119
+ sizeBytes: result.sizeBytes,
2120
+ matchedIgnore: verdict.ignored ? verdict.category : void 0
2121
+ });
2122
+ return { sizeBytes: result.sizeBytes, hash: result.hash };
2123
+ }
2124
+ );
2125
+ return out;
2126
+ } catch (err) {
2127
+ throw this.recordAndWrap(err, "write", p, {
2128
+ audit: !(isFsError(err) && err.kind === "file_already_exists")
2129
+ });
2130
+ }
2131
+ }
2091
2132
  /**
2092
2133
  * Coerce an arbitrary thrown value into an `FsError`, emit the
2093
2134
  * matching `fs.denied` audit event, and return the typed error
@@ -2101,11 +2142,14 @@ var WorkspaceFileSystemImpl = class {
2101
2142
  * - routes can still rely on `instanceof FsError`
2102
2143
  * for their `sendFsError` serializer.
2103
2144
  */
2104
- recordAndWrap(err, intent, input) {
2145
+ recordAndWrap(err, intent, input, opts) {
2105
2146
  if (err instanceof Error && "code" in err && err.code === "workspace_generation_closed") {
2106
2147
  return err;
2107
2148
  }
2108
2149
  const fs8 = wrapAsFsError(err);
2150
+ if (opts?.audit === false) {
2151
+ return fs8;
2152
+ }
2109
2153
  this.deps.audit.recordDenied(this.deps.ctx, {
2110
2154
  intent,
2111
2155
  input,
@@ -2557,6 +2601,22 @@ function mergeWriteMeta(existing, opts) {
2557
2601
  }
2558
2602
  __name(mergeWriteMeta, "mergeWriteMeta");
2559
2603
  async function atomicWriteTextResolvedFile(input) {
2604
+ const buf = await encodeTextFileContentAsync(
2605
+ input.target,
2606
+ input.content,
2607
+ buildWriteMeta(input.meta)
2608
+ );
2609
+ enforceWriteSize(buf.length);
2610
+ return atomicPublishResolvedFile({
2611
+ target: input.target,
2612
+ buf,
2613
+ mode: input.mode,
2614
+ expectedHash: input.expectedHash,
2615
+ assertGenerationOpen: input.assertGenerationOpen
2616
+ });
2617
+ }
2618
+ __name(atomicWriteTextResolvedFile, "atomicWriteTextResolvedFile");
2619
+ async function atomicPublishResolvedFile(input) {
2560
2620
  const target = input.target;
2561
2621
  const parent = path4.dirname(target);
2562
2622
  const parentStat = await fsp2.lstat(parent);
@@ -2571,24 +2631,29 @@ async function atomicWriteTextResolvedFile(input) {
2571
2631
  `parent path is not a directory: ${parent}`
2572
2632
  );
2573
2633
  }
2574
- const tmpPath = path4.join(
2575
- parent,
2576
- `.${path4.basename(target)}.${process.pid}.${randomBytes(6).toString("hex")}.tmp`
2577
- );
2634
+ const tmpSuffix = `.${process.pid}.${randomBytes(6).toString("hex")}.tmp`;
2635
+ const tmpNameMaxBytes = 255;
2636
+ const tmpBaseMaxBytes = tmpNameMaxBytes - 1 - Buffer.byteLength(tmpSuffix, "utf-8");
2637
+ let tmpBase = path4.basename(target);
2638
+ if (Buffer.byteLength(tmpBase, "utf-8") > tmpBaseMaxBytes) {
2639
+ tmpBase = safeUtf8Truncate(
2640
+ Buffer.from(tmpBase, "utf-8"),
2641
+ tmpBaseMaxBytes
2642
+ ).toString("utf-8");
2643
+ }
2644
+ const tmpPath = path4.join(parent, `.${tmpBase}${tmpSuffix}`);
2578
2645
  let tempLive = false;
2579
2646
  let tempHandle;
2580
2647
  let tempStat;
2581
2648
  try {
2582
2649
  tempHandle = await reserveTempFile(tmpPath);
2583
2650
  tempLive = true;
2584
- const encoded = await writeEncodedTextTemp({
2585
- targetPath: target,
2651
+ const written = await writeBufferToTemp({
2586
2652
  tmpPath,
2587
- content: input.content,
2588
- meta: input.meta,
2653
+ buf: input.buf,
2589
2654
  handle: tempHandle
2590
2655
  });
2591
- tempStat = encoded.stat;
2656
+ tempStat = written.stat;
2592
2657
  const targetState = await assertAtomicTargetPrecondition({
2593
2658
  target,
2594
2659
  mode: input.mode,
@@ -2607,7 +2672,7 @@ async function atomicWriteTextResolvedFile(input) {
2607
2672
  }
2608
2673
  tempLive = false;
2609
2674
  await fsyncParentDirBestEffort(parent);
2610
- return encoded;
2675
+ return written;
2611
2676
  } catch (err) {
2612
2677
  await tempHandle?.close().catch(() => void 0);
2613
2678
  if (tempLive) {
@@ -2619,19 +2684,13 @@ async function atomicWriteTextResolvedFile(input) {
2619
2684
  throw err;
2620
2685
  }
2621
2686
  }
2622
- __name(atomicWriteTextResolvedFile, "atomicWriteTextResolvedFile");
2687
+ __name(atomicPublishResolvedFile, "atomicPublishResolvedFile");
2623
2688
  async function reserveTempFile(tmpPath) {
2624
2689
  return fsp2.open(tmpPath, "wx", 384);
2625
2690
  }
2626
2691
  __name(reserveTempFile, "reserveTempFile");
2627
- async function writeEncodedTextTemp(input) {
2628
- const buf = await encodeTextFileContentAsync(
2629
- input.targetPath,
2630
- input.content,
2631
- buildWriteMeta(input.meta)
2632
- );
2633
- enforceWriteSize(buf.length);
2634
- await input.handle.writeFile(buf);
2692
+ async function writeBufferToTemp(input) {
2693
+ await input.handle.writeFile(input.buf);
2635
2694
  await syncHandleBestEffort(input.handle);
2636
2695
  const st = await fsp2.lstat(input.tmpPath);
2637
2696
  const opened = await input.handle.stat();
@@ -2649,9 +2708,9 @@ async function writeEncodedTextTemp(input) {
2649
2708
  `temporary path is not a regular file: ${input.tmpPath}`
2650
2709
  );
2651
2710
  }
2652
- return { sizeBytes: buf.length, hash: hashBuffer(buf), stat: st };
2711
+ return { sizeBytes: input.buf.length, hash: hashBuffer(input.buf), stat: st };
2653
2712
  }
2654
- __name(writeEncodedTextTemp, "writeEncodedTextTemp");
2713
+ __name(writeBufferToTemp, "writeBufferToTemp");
2655
2714
  async function assertCreateTargetAbsent(target) {
2656
2715
  try {
2657
2716
  const st = await fsp2.lstat(target);
@@ -9839,20 +9898,31 @@ var AcpDispatcher = class {
9839
9898
  if ("error" in parsedSource) {
9840
9899
  throw new AcpParamError(parsedSource.error);
9841
9900
  }
9842
- const result = await listWorkspaceSessionsForResponse(
9843
- this.bridge,
9844
- workspaceCwd,
9845
- {
9846
- cursor,
9847
- size: metaSize,
9848
- archiveState,
9849
- view,
9850
- group,
9851
- parentSessionId,
9852
- ...parsedSource
9853
- },
9854
- { runtimeBaseDir: this.sessionRuntimeBaseDir }
9855
- );
9901
+ let result;
9902
+ try {
9903
+ conn.abortSignal.throwIfAborted();
9904
+ result = await listWorkspaceSessionsForResponse(
9905
+ this.bridge,
9906
+ workspaceCwd,
9907
+ {
9908
+ cursor,
9909
+ size: metaSize,
9910
+ archiveState,
9911
+ view,
9912
+ group,
9913
+ parentSessionId,
9914
+ ...parsedSource
9915
+ },
9916
+ {
9917
+ runtimeBaseDir: this.sessionRuntimeBaseDir,
9918
+ signal: conn.abortSignal
9919
+ }
9920
+ );
9921
+ conn.abortSignal.throwIfAborted();
9922
+ } catch (error2) {
9923
+ if (conn.abortSignal.aborted) return;
9924
+ throw error2;
9925
+ }
9856
9926
  this.replyConn(conn, id, {
9857
9927
  sessions: result.sessions.map((s) => ({
9858
9928
  sessionId: s.sessionId,
@@ -14570,7 +14640,7 @@ function mountAcpHttp(app, bridge, opts) {
14570
14640
  const archiveCoordinator = opts.archiveCoordinator ?? new SessionArchiveCoordinator();
14571
14641
  const requestedSessionIdAdmission = opts.requestedSessionIdAdmission;
14572
14642
  const getPrimaryEnv = /* @__PURE__ */ __name(() => opts.workspaceRegistry ? runtimeEffectiveEnv(opts.workspaceRegistry.primary, daemonEnv) : daemonEnv, "getPrimaryEnv");
14573
- const path16 = opts.path ?? "/acp";
14643
+ const path17 = opts.path ?? "/acp";
14574
14644
  const dispatcherRef = {};
14575
14645
  let disposed = false;
14576
14646
  const rejectIfDisposed = /* @__PURE__ */ __name((res) => {
@@ -14754,7 +14824,7 @@ function mountAcpHttp(app, bridge, opts) {
14754
14824
  const primaryMount = {
14755
14825
  primary: true,
14756
14826
  workspaceCwd: opts.boundWorkspace,
14757
- routeLabel: logSafe(path16),
14827
+ routeLabel: logSafe(path17),
14758
14828
  rateLimitScope: opts.workspaceRegistry?.primary.workspaceId ?? "primary",
14759
14829
  registry,
14760
14830
  dispatcher,
@@ -14908,7 +14978,7 @@ function mountAcpHttp(app, bridge, opts) {
14908
14978
  });
14909
14979
  }, "handleAcpPost");
14910
14980
  app.post(
14911
- path16,
14981
+ path17,
14912
14982
  (req, res) => handleAcpPost(primaryMount, req, res)
14913
14983
  );
14914
14984
  const handleAcpGet = /* @__PURE__ */ __name((mount, req, res) => {
@@ -15007,10 +15077,10 @@ function mountAcpHttp(app, bridge, opts) {
15007
15077
  onPumpSettled();
15008
15078
  });
15009
15079
  }, "handleAcpGet");
15010
- app.get(path16, (req, res) => {
15080
+ app.get(path17, (req, res) => {
15011
15081
  handleAcpGet(primaryMount, req, res);
15012
15082
  });
15013
- app.delete(path16, (req, res) => {
15083
+ app.delete(path17, (req, res) => {
15014
15084
  handleAcpDelete(primaryMount, req, res);
15015
15085
  });
15016
15086
  const createSecondaryAcpMount = /* @__PURE__ */ __name((rt) => {
@@ -15219,7 +15289,7 @@ function mountAcpHttp(app, bridge, opts) {
15219
15289
  const isPluralAcpShape = pluralRawSelector !== null;
15220
15290
  const pluralVoiceRawSelector = opts.workspaceVoiceConnection ? pluralWorkspaceRawSelector(rawPath, PLURAL_VOICE_WS_SUFFIX) : null;
15221
15291
  const isPluralVoiceShape = pluralVoiceRawSelector !== null;
15222
- if (rawPath !== path16 && !isCdpPath && !extraRoute && !isPluralAcpShape && !isPluralVoiceShape) {
15292
+ if (rawPath !== path17 && !isCdpPath && !extraRoute && !isPluralAcpShape && !isPluralVoiceShape) {
15223
15293
  logReject(`unknown-path ${logSafe(rawPath)}`);
15224
15294
  socket.destroy();
15225
15295
  return;
@@ -15757,7 +15827,7 @@ function mountAcpHttp(app, bridge, opts) {
15757
15827
  });
15758
15828
  }, "upgradeListener");
15759
15829
  httpServer.on("upgrade", upgradeListener);
15760
- writeStderrLine(`qwen serve: /acp WebSocket transport enabled on ${path16}`);
15830
+ writeStderrLine(`qwen serve: /acp WebSocket transport enabled on ${path17}`);
15761
15831
  }
15762
15832
  __name(setupWebSocket, "setupWebSocket");
15763
15833
  return {
@@ -19657,6 +19727,8 @@ __name(registerWorkspaceExtensionRoutes, "registerWorkspaceExtensionRoutes");
19657
19727
 
19658
19728
  // packages/cli/src/serve/routes/workspace-file-write.ts
19659
19729
  init_esbuild_shims();
19730
+ var import_express3 = __toESM(require_express(), 1);
19731
+ import * as path10 from "node:path";
19660
19732
  function getFsFactory3(req, res) {
19661
19733
  const context = getWorkspaceRouteContext(req);
19662
19734
  if (context) return context.runtime.routeFileSystemFactory;
@@ -19934,6 +20006,351 @@ function registerWorkspaceQualifiedFileWriteRoutes(app, deps) {
19934
20006
  );
19935
20007
  }
19936
20008
  __name(registerWorkspaceQualifiedFileWriteRoutes, "registerWorkspaceQualifiedFileWriteRoutes");
20009
+ var MAX_CONCURRENT_UPLOADS = 4;
20010
+ var MAX_UPLOAD_FILENAME_BYTES = 255;
20011
+ var NUMBERED_CANDIDATE_CAP = 1e3;
20012
+ var uploadGateLeases = /* @__PURE__ */ new WeakMap();
20013
+ function createUploadConcurrencyGate(max = MAX_CONCURRENT_UPLOADS) {
20014
+ let active = 0;
20015
+ return {
20016
+ tryAcquire() {
20017
+ if (active >= max) return false;
20018
+ active += 1;
20019
+ return true;
20020
+ },
20021
+ release() {
20022
+ if (active > 0) active -= 1;
20023
+ }
20024
+ };
20025
+ }
20026
+ __name(createUploadConcurrencyGate, "createUploadConcurrencyGate");
20027
+ var uploadAdmissions = /* @__PURE__ */ new WeakMap();
20028
+ function splitStemExtension(basename7) {
20029
+ const lastDot = basename7.lastIndexOf(".");
20030
+ if (lastDot <= 0) return { stem: basename7, ext: "" };
20031
+ return { stem: basename7.slice(0, lastDot), ext: basename7.slice(lastDot) };
20032
+ }
20033
+ __name(splitStemExtension, "splitStemExtension");
20034
+ function fitFilenameToByteCap(stem, suffix, ext, capBytes) {
20035
+ if (Buffer.byteLength(suffix + ext, "utf-8") > capBytes) return null;
20036
+ let chars = Array.from(stem);
20037
+ while (Buffer.byteLength(chars.join("") + suffix + ext, "utf-8") > capBytes) {
20038
+ if (chars.length === 0) return null;
20039
+ chars = chars.slice(0, -1);
20040
+ }
20041
+ return chars.join("") + suffix + ext;
20042
+ }
20043
+ __name(fitFilenameToByteCap, "fitFilenameToByteCap");
20044
+ function sendUploadTooLarge(res) {
20045
+ applyReadHeaders(res);
20046
+ res.status(413).json({
20047
+ errorKind: "file_too_large",
20048
+ error: `Request body too large (max ${MAX_UPLOAD_BYTES / (1024 * 1024)} MiB)`,
20049
+ status: 413,
20050
+ maxBytes: MAX_UPLOAD_BYTES
20051
+ });
20052
+ }
20053
+ __name(sendUploadTooLarge, "sendUploadTooLarge");
20054
+ function fileUploadConcurrencyGate(gate) {
20055
+ return (req, res, next) => {
20056
+ if (!gate.tryAcquire()) {
20057
+ applyReadHeaders(res);
20058
+ res.status(429).set("Retry-After", "1").json({
20059
+ errorKind: "upload_busy",
20060
+ error: "Too many uploads in progress",
20061
+ status: 429,
20062
+ retryAfterSeconds: 1
20063
+ });
20064
+ return;
20065
+ }
20066
+ let released = false;
20067
+ const release = /* @__PURE__ */ __name(() => {
20068
+ if (released) return;
20069
+ released = true;
20070
+ gate.release();
20071
+ res.off("finish", releaseBeforeHandler);
20072
+ res.off("close", releaseBeforeHandler);
20073
+ uploadGateLeases.delete(req);
20074
+ }, "release");
20075
+ const releaseBeforeHandler = /* @__PURE__ */ __name(() => {
20076
+ if (!lease.handlerStarted) release();
20077
+ }, "releaseBeforeHandler");
20078
+ const lease = { handlerStarted: false, release };
20079
+ uploadGateLeases.set(req, lease);
20080
+ res.once("finish", releaseBeforeHandler);
20081
+ res.once("close", releaseBeforeHandler);
20082
+ next();
20083
+ };
20084
+ }
20085
+ __name(fileUploadConcurrencyGate, "fileUploadConcurrencyGate");
20086
+ function fileUploadBodyParser() {
20087
+ const raw = import_express3.default.raw({
20088
+ type: "application/octet-stream",
20089
+ limit: MAX_UPLOAD_BYTES,
20090
+ // The endpoint contract is raw octets: decoding a Content-Encoding would
20091
+ // publish bytes the client never sent (and hash/size of the decoded form).
20092
+ inflate: false
20093
+ });
20094
+ return (req, res, next) => {
20095
+ raw(req, res, (err) => {
20096
+ if (err) {
20097
+ const status = err.status;
20098
+ if (status === 413) {
20099
+ sendUploadTooLarge(res);
20100
+ return;
20101
+ }
20102
+ if (status === 415) {
20103
+ applyReadHeaders(res);
20104
+ res.status(415).json({
20105
+ errorKind: "unsupported_media_type",
20106
+ error: "File uploads do not support encoded request bodies",
20107
+ status: 415
20108
+ });
20109
+ return;
20110
+ }
20111
+ if (err.code === "ECONNABORTED" || req.aborted) {
20112
+ return;
20113
+ }
20114
+ next(err);
20115
+ return;
20116
+ }
20117
+ next();
20118
+ });
20119
+ };
20120
+ }
20121
+ __name(fileUploadBodyParser, "fileUploadBodyParser");
20122
+ function fileUploadAdmission(deps, opts) {
20123
+ return (req, res, next) => {
20124
+ void (async () => {
20125
+ const ROUTE2 = opts.qualified ? "POST /workspaces/:workspace/file/upload" : "POST /file/upload";
20126
+ try {
20127
+ if (opts.qualified) {
20128
+ const registry = deps.workspaceRegistry;
20129
+ if (!registry) {
20130
+ throw new Error("workspace registry is not configured");
20131
+ }
20132
+ const runtime = resolveWorkspaceRuntimeFromParam(registry, req, res);
20133
+ if (!runtime) return;
20134
+ if (!requireTrustedWorkspaceRuntime(runtime, res)) return;
20135
+ setWorkspaceRouteContext(req, {
20136
+ runtime,
20137
+ routePrefix: "POST /workspaces/:workspace"
20138
+ });
20139
+ } else if (opts.isWorkspaceTrusted?.() === false) {
20140
+ applyReadHeaders(res);
20141
+ res.status(403).json({
20142
+ errorKind: "untrusted_workspace",
20143
+ error: "workspace is not trusted; write operations are forbidden",
20144
+ status: 403
20145
+ });
20146
+ return;
20147
+ }
20148
+ const contentType = (req.headers["content-type"] ?? "").split(";")[0].trim().toLowerCase();
20149
+ if (contentType !== "application/octet-stream") {
20150
+ applyReadHeaders(res);
20151
+ res.status(415).json({
20152
+ errorKind: "unsupported_media_type",
20153
+ error: "File uploads require application/octet-stream",
20154
+ status: 415
20155
+ });
20156
+ return;
20157
+ }
20158
+ const queryPath = req.query["path"];
20159
+ if (typeof queryPath !== "string" || queryPath.length === 0) {
20160
+ sendParseError(res, ROUTE2, "`path` query parameter is required");
20161
+ return;
20162
+ }
20163
+ const dir = path10.dirname(queryPath);
20164
+ const basename7 = path10.basename(queryPath);
20165
+ if (queryPath.endsWith("/") || basename7.length === 0 || basename7 === "." || basename7 === "..") {
20166
+ sendParseError(res, ROUTE2, "`path` must name a file");
20167
+ return;
20168
+ }
20169
+ if (queryPath.includes("\0")) {
20170
+ sendParseError(res, ROUTE2, "path must not contain null bytes");
20171
+ return;
20172
+ }
20173
+ if (hasSuspiciousPathPattern(basename7)) {
20174
+ sendParseError(res, ROUTE2, "filename contains a suspicious pattern");
20175
+ return;
20176
+ }
20177
+ if (Buffer.byteLength(basename7, "utf-8") > MAX_UPLOAD_FILENAME_BYTES) {
20178
+ sendParseError(
20179
+ res,
20180
+ ROUTE2,
20181
+ `filename exceeds ${MAX_UPLOAD_FILENAME_BYTES} bytes`
20182
+ );
20183
+ return;
20184
+ }
20185
+ const contentLength = req.headers["content-length"];
20186
+ if (contentLength !== void 0) {
20187
+ const declared = Number(contentLength);
20188
+ if (Number.isFinite(declared) && declared > MAX_UPLOAD_BYTES) {
20189
+ sendUploadTooLarge(res);
20190
+ return;
20191
+ }
20192
+ }
20193
+ const clientId = deps.parseClientId(req, res);
20194
+ if (clientId === null) return;
20195
+ const originatorClientId = resolveOriginatorClientId2(
20196
+ clientId,
20197
+ deps,
20198
+ res,
20199
+ req
20200
+ );
20201
+ if (originatorClientId === null) return;
20202
+ const factory = getFsFactory3(req, res);
20203
+ if (!factory) return;
20204
+ const fs8 = factory.forRequest({
20205
+ originatorClientId,
20206
+ route: ROUTE2
20207
+ });
20208
+ const resolvedDir = await fs8.resolve(dir, "write");
20209
+ let dirStat;
20210
+ try {
20211
+ dirStat = await fs8.stat(resolvedDir);
20212
+ } catch (err) {
20213
+ if (isFsError(err) && err.kind === "path_not_found") {
20214
+ sendParseError(res, ROUTE2, "parent directory does not exist");
20215
+ return;
20216
+ }
20217
+ throw err;
20218
+ }
20219
+ if (dirStat.kind !== "directory") {
20220
+ sendParseError(res, ROUTE2, "parent path is not a directory");
20221
+ return;
20222
+ }
20223
+ uploadAdmissions.set(req, {
20224
+ route: ROUTE2,
20225
+ fs: fs8,
20226
+ basename: basename7,
20227
+ resolvedDir,
20228
+ queryDir: dir
20229
+ });
20230
+ next();
20231
+ } catch (err) {
20232
+ sendFsError(
20233
+ res,
20234
+ err,
20235
+ opts.qualified ? "POST /workspaces/:workspace/file/upload" : "POST /file/upload"
20236
+ );
20237
+ }
20238
+ })();
20239
+ };
20240
+ }
20241
+ __name(fileUploadAdmission, "fileUploadAdmission");
20242
+ async function handlePostFileUpload(req, res) {
20243
+ const admission = uploadAdmissions.get(req);
20244
+ if (!admission) {
20245
+ applyReadHeaders(res);
20246
+ res.status(500).json({
20247
+ errorKind: "internal_error",
20248
+ error: "upload admission context is missing",
20249
+ status: 500
20250
+ });
20251
+ return;
20252
+ }
20253
+ const { route, fs: fs8, basename: basename7, resolvedDir, queryDir } = admission;
20254
+ const { stem, ext } = splitStemExtension(basename7);
20255
+ const lease = uploadGateLeases.get(req);
20256
+ if (lease) lease.handlerStarted = true;
20257
+ try {
20258
+ if (req.aborted || res.closed) return;
20259
+ const body = req.body;
20260
+ const data = body === void 0 || body === null ? Buffer.alloc(0) : body;
20261
+ for (let n = 0; n < NUMBERED_CANDIDATE_CAP; n++) {
20262
+ const candidateBasename = n === 0 ? basename7 : fitFilenameToByteCap(
20263
+ stem,
20264
+ ` (${n})`,
20265
+ ext,
20266
+ MAX_UPLOAD_FILENAME_BYTES
20267
+ );
20268
+ if (candidateBasename === null) {
20269
+ sendParseError(
20270
+ res,
20271
+ route,
20272
+ `filename cannot fit within ${MAX_UPLOAD_FILENAME_BYTES} bytes`
20273
+ );
20274
+ return;
20275
+ }
20276
+ const candidateAbs = path10.join(resolvedDir, candidateBasename);
20277
+ let resolved;
20278
+ try {
20279
+ resolved = await fs8.resolve(
20280
+ path10.join(queryDir, candidateBasename),
20281
+ "write"
20282
+ );
20283
+ } catch (err) {
20284
+ if (isFsError(err) && err.kind === "symlink_escape" && err.cause?.code === "ELOOP") {
20285
+ continue;
20286
+ }
20287
+ sendFsError(res, err, route);
20288
+ return;
20289
+ }
20290
+ if (resolved !== candidateAbs) {
20291
+ continue;
20292
+ }
20293
+ try {
20294
+ const out = await fs8.writeBytesAtomic(resolved, data);
20295
+ applyReadHeaders(res);
20296
+ res.status(201).json({
20297
+ kind: "file_upload",
20298
+ path: workspaceRelative(req, resolved),
20299
+ sizeBytes: out.sizeBytes,
20300
+ hash: out.hash
20301
+ });
20302
+ return;
20303
+ } catch (err) {
20304
+ if (isFsError(err) && err.kind === "file_already_exists") {
20305
+ continue;
20306
+ }
20307
+ sendFsError(res, err, route);
20308
+ return;
20309
+ }
20310
+ }
20311
+ applyReadHeaders(res);
20312
+ res.status(409).json({
20313
+ errorKind: "file_already_exists",
20314
+ error: `could not allocate a free filename for "${basename7}"`,
20315
+ status: 409
20316
+ });
20317
+ } catch (err) {
20318
+ sendFsError(res, err, route);
20319
+ } finally {
20320
+ uploadAdmissions.delete(req);
20321
+ lease?.release();
20322
+ }
20323
+ }
20324
+ __name(handlePostFileUpload, "handlePostFileUpload");
20325
+ function registerWorkspaceFileUploadRoutes(app, deps) {
20326
+ app.post(
20327
+ "/file/upload",
20328
+ deps.mutate({ strict: true }),
20329
+ fileUploadAdmission(deps, {
20330
+ qualified: false,
20331
+ isWorkspaceTrusted: deps.isWorkspaceTrusted
20332
+ }),
20333
+ fileUploadConcurrencyGate(deps.uploadGate),
20334
+ fileUploadBodyParser(),
20335
+ (req, res) => {
20336
+ void handlePostFileUpload(req, res);
20337
+ }
20338
+ );
20339
+ }
20340
+ __name(registerWorkspaceFileUploadRoutes, "registerWorkspaceFileUploadRoutes");
20341
+ function registerWorkspaceQualifiedFileUploadRoutes(app, deps) {
20342
+ app.post(
20343
+ "/workspaces/:workspace/file/upload",
20344
+ deps.mutate({ strict: true }),
20345
+ fileUploadAdmission(deps, { qualified: true }),
20346
+ fileUploadConcurrencyGate(deps.uploadGate),
20347
+ fileUploadBodyParser(),
20348
+ (req, res) => {
20349
+ void handlePostFileUpload(req, res);
20350
+ }
20351
+ );
20352
+ }
20353
+ __name(registerWorkspaceQualifiedFileUploadRoutes, "registerWorkspaceQualifiedFileUploadRoutes");
19937
20354
 
19938
20355
  // packages/cli/src/serve/routes/workspace-trust.ts
19939
20356
  init_esbuild_shims();
@@ -20288,15 +20705,15 @@ var legacySessionTelemetryRoutes = [
20288
20705
  },
20289
20706
  {
20290
20707
  method: "GET",
20291
- path: "/session/:id/subagents/:toolCallId",
20708
+ path: "/session/:id/subagents/:subagentRef",
20292
20709
  attribution: "handler_resolved",
20293
- route: "GET /session/:id/subagents/:toolCallId"
20710
+ route: "GET /session/:id/subagents/:subagentRef"
20294
20711
  },
20295
20712
  {
20296
20713
  method: "POST",
20297
- path: "/session/:id/subagents/:toolCallId/cancel",
20714
+ path: "/session/:id/subagents/:subagentRef/cancel",
20298
20715
  attribution: "handler_resolved",
20299
- route: "POST /session/:id/subagents/:toolCallId/cancel"
20716
+ route: "POST /session/:id/subagents/:subagentRef/cancel"
20300
20717
  },
20301
20718
  {
20302
20719
  method: "GET",
@@ -20418,6 +20835,12 @@ var legacySessionTelemetryRoutes = [
20418
20835
  attribution: "handler_resolved",
20419
20836
  route: "POST /session/:id/model"
20420
20837
  },
20838
+ {
20839
+ method: "POST",
20840
+ path: "/session/:id/config-option",
20841
+ attribution: "handler_resolved",
20842
+ route: "POST /session/:id/config-option"
20843
+ },
20421
20844
  {
20422
20845
  method: "POST",
20423
20846
  path: "/session/:id/recap",
@@ -20525,8 +20948,8 @@ function decodePathSegment(value) {
20525
20948
  }
20526
20949
  __name(decodePathSegment, "decodePathSegment");
20527
20950
  function matchLegacySessionTelemetryRoute(method, requestPath) {
20528
- const path16 = requestPath.length > 1 && requestPath.endsWith("/") ? requestPath.slice(0, -1) : requestPath;
20529
- const requestSegments = path16.split("/").slice(1);
20951
+ const path17 = requestPath.length > 1 && requestPath.endsWith("/") ? requestPath.slice(0, -1) : requestPath;
20952
+ const requestSegments = path17.split("/").slice(1);
20530
20953
  const prefix = requestSegments[0]?.toLowerCase();
20531
20954
  if (prefix !== "session" && prefix !== "sessions" && prefix !== "permission") {
20532
20955
  return void 0;
@@ -20578,23 +21001,23 @@ __name(setDaemonTelemetryWorkspace, "setDaemonTelemetryWorkspace");
20578
21001
  function resolveDaemonTelemetryRoute(req) {
20579
21002
  const legacyRoute = matchLegacySessionTelemetryRoute(req.method, req.path);
20580
21003
  if (legacyRoute) return legacyRoute;
20581
- const path16 = req.path.replace(/\/$/, "") || "/";
20582
- if (req.method === "GET" && path16 === "/daemon/status") {
21004
+ const path17 = req.path.replace(/\/$/, "") || "/";
21005
+ if (req.method === "GET" && path17 === "/daemon/status") {
20583
21006
  return { route: "GET /daemon/status" };
20584
21007
  }
20585
- if (req.method === "GET" && /^\/workspace\/[^/]+\/sessions$/.test(path16)) {
21008
+ if (req.method === "GET" && /^\/workspace\/[^/]+\/sessions$/.test(path17)) {
20586
21009
  return { route: "GET /workspace/:id/sessions" };
20587
21010
  }
20588
- if (req.method === "GET" && /^\/workspaces\/[^/]+\/sessions$/.test(path16)) {
21011
+ if (req.method === "GET" && /^\/workspaces\/[^/]+\/sessions$/.test(path17)) {
20589
21012
  return { route: "GET /workspace/:id/sessions" };
20590
21013
  }
20591
- if (req.method === "GET" && /^\/workspace\/[^/]+\/session-info$/.test(path16)) {
21014
+ if (req.method === "GET" && /^\/workspace\/[^/]+\/session-info$/.test(path17)) {
20592
21015
  return { route: "GET /workspace/:id/session-info" };
20593
21016
  }
20594
- if (req.method === "GET" && /^\/workspaces\/[^/]+\/session-info$/.test(path16)) {
21017
+ if (req.method === "GET" && /^\/workspaces\/[^/]+\/session-info$/.test(path17)) {
20595
21018
  return { route: "GET /workspace/:id/session-info" };
20596
21019
  }
20597
- const workspaceTranscript = path16.match(
21020
+ const workspaceTranscript = path17.match(
20598
21021
  /^\/workspaces\/[^/]+\/session\/([^/]+)\/transcript$/
20599
21022
  );
20600
21023
  if (workspaceTranscript?.[1] && req.method === "GET") {
@@ -20603,7 +21026,7 @@ function resolveDaemonTelemetryRoute(req) {
20603
21026
  sessionId: decodePathSegment(workspaceTranscript[1])
20604
21027
  };
20605
21028
  }
20606
- const workspaceExport = path16.match(
21029
+ const workspaceExport = path17.match(
20607
21030
  /^\/workspaces\/[^/]+\/session\/([^/]+)\/export$/
20608
21031
  );
20609
21032
  if (workspaceExport?.[1] && req.method === "GET") {
@@ -20612,7 +21035,7 @@ function resolveDaemonTelemetryRoute(req) {
20612
21035
  sessionId: decodePathSegment(workspaceExport[1])
20613
21036
  };
20614
21037
  }
20615
- const workspaceArchivedExport = path16.match(
21038
+ const workspaceArchivedExport = path17.match(
20616
21039
  /^\/workspaces\/[^/]+\/session\/([^/]+)\/archive\/export$/
20617
21040
  );
20618
21041
  if (workspaceArchivedExport?.[1] && req.method === "GET") {
@@ -20622,8 +21045,8 @@ function resolveDaemonTelemetryRoute(req) {
20622
21045
  };
20623
21046
  }
20624
21047
  const pluralWorkspacePrefix = /^\/workspaces\/[^/]+/;
20625
- if (pluralWorkspacePrefix.test(path16)) {
20626
- const suffix = path16.replace(pluralWorkspacePrefix, "/workspace");
21048
+ if (pluralWorkspacePrefix.test(path17)) {
21049
+ const suffix = path17.replace(pluralWorkspacePrefix, "/workspace");
20627
21050
  if (req.method === "GET") {
20628
21051
  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") {
20629
21052
  return { route: `GET ${suffix}` };
@@ -20646,7 +21069,7 @@ function resolveDaemonTelemetryRoute(req) {
20646
21069
  }
20647
21070
  }
20648
21071
  if (req.method === "POST") {
20649
- if (suffix === "/workspace/settings" || suffix === "/workspace/voice" || suffix === "/workspace/voice/transcribe" || suffix === "/workspace/permissions" || suffix === "/workspace/trust/request" || suffix === "/workspace/init" || suffix === "/workspace/reload" || suffix === "/workspace/file/write" || suffix === "/workspace/file/edit" || suffix === "/workspace/mcp/servers" || suffix === "/workspace/memory" || suffix === "/workspace/agents" || suffix === "/workspace/sessions/delete" || suffix === "/workspace/sessions/archive" || suffix === "/workspace/sessions/unarchive" || suffix === "/workspace/session-groups") {
21072
+ if (suffix === "/workspace/settings" || suffix === "/workspace/voice" || suffix === "/workspace/voice/transcribe" || suffix === "/workspace/permissions" || suffix === "/workspace/trust/request" || suffix === "/workspace/init" || suffix === "/workspace/reload" || suffix === "/workspace/file/write" || suffix === "/workspace/file/edit" || suffix === "/workspace/file/upload" || suffix === "/workspace/mcp/servers" || suffix === "/workspace/memory" || suffix === "/workspace/agents" || suffix === "/workspace/sessions/delete" || suffix === "/workspace/sessions/archive" || suffix === "/workspace/sessions/unarchive" || suffix === "/workspace/session-groups") {
20650
21073
  return { route: `POST ${suffix}` };
20651
21074
  }
20652
21075
  if (/^\/workspace\/tools\/[^/]+\/enable$/.test(suffix)) {
@@ -20682,58 +21105,58 @@ function resolveDaemonTelemetryRoute(req) {
20682
21105
  return { route: "DELETE /workspace/session-groups/:groupId" };
20683
21106
  }
20684
21107
  }
20685
- if (req.method === "POST" && path16 === "/workspace/init") {
21108
+ if (req.method === "POST" && path17 === "/workspace/init") {
20686
21109
  return { route: "POST /workspace/init" };
20687
21110
  }
20688
- if (req.method === "POST" && path16 === "/workspace/setup-github") {
21111
+ if (req.method === "POST" && path17 === "/workspace/setup-github") {
20689
21112
  return { route: "POST /workspace/setup-github" };
20690
21113
  }
20691
- if (req.method === "POST" && path16 === "/workspace/reload") {
21114
+ if (req.method === "POST" && path17 === "/workspace/reload") {
20692
21115
  return { route: "POST /workspace/reload" };
20693
21116
  }
20694
- const mcpRestart = path16.match(/^\/workspace\/mcp\/([^/]+)\/restart$/);
21117
+ const mcpRestart = path17.match(/^\/workspace\/mcp\/([^/]+)\/restart$/);
20695
21118
  if (mcpRestart?.[1] && req.method === "POST") {
20696
21119
  return { route: "POST /workspace/mcp/:server/restart" };
20697
21120
  }
20698
- if (req.method === "POST" && path16 === "/workspace/mcp/servers") {
21121
+ if (req.method === "POST" && path17 === "/workspace/mcp/servers") {
20699
21122
  return { route: "POST /workspace/mcp/servers" };
20700
21123
  }
20701
- const mcpDelete = path16.match(/^\/workspace\/mcp\/servers\/([^/]+)$/);
21124
+ const mcpDelete = path17.match(/^\/workspace\/mcp\/servers\/([^/]+)$/);
20702
21125
  if (mcpDelete?.[1] && req.method === "DELETE") {
20703
21126
  return { route: "DELETE /workspace/mcp/servers/:name" };
20704
21127
  }
20705
- if (req.method === "POST" && path16 === "/workspace/auth/device-flow") {
21128
+ if (req.method === "POST" && path17 === "/workspace/auth/device-flow") {
20706
21129
  return { route: "POST /workspace/auth/device-flow" };
20707
21130
  }
20708
- const deviceFlowDelete = path16.match(
21131
+ const deviceFlowDelete = path17.match(
20709
21132
  /^\/workspace\/auth\/device-flow\/([^/]+)$/
20710
21133
  );
20711
21134
  if (deviceFlowDelete?.[1] && req.method === "DELETE") {
20712
21135
  return { route: "DELETE /workspace/auth/device-flow/:id" };
20713
21136
  }
20714
- const toolEnable = path16.match(/^\/workspace\/tools\/([^/]+)\/enable$/);
21137
+ const toolEnable = path17.match(/^\/workspace\/tools\/([^/]+)\/enable$/);
20715
21138
  if (toolEnable?.[1] && req.method === "POST") {
20716
21139
  return { route: "POST /workspace/tools/:name/enable" };
20717
21140
  }
20718
- if (path16 === "/workspace/settings") {
21141
+ if (path17 === "/workspace/settings") {
20719
21142
  if (req.method === "GET") return { route: "GET /workspace/settings" };
20720
21143
  if (req.method === "POST") return { route: "POST /workspace/settings" };
20721
21144
  }
20722
- if (path16 === "/workspace/permissions") {
21145
+ if (path17 === "/workspace/permissions") {
20723
21146
  if (req.method === "GET") return { route: "GET /workspace/permissions" };
20724
21147
  if (req.method === "POST") return { route: "POST /workspace/permissions" };
20725
21148
  }
20726
- if (path16 === "/workspace/trust") {
21149
+ if (path17 === "/workspace/trust") {
20727
21150
  if (req.method === "GET") return { route: "GET /workspace/trust" };
20728
21151
  }
20729
- if (req.method === "POST" && path16 === "/workspace/trust/request") {
21152
+ if (req.method === "POST" && path17 === "/workspace/trust/request") {
20730
21153
  return { route: "POST /workspace/trust/request" };
20731
21154
  }
20732
- if (path16 === "/workspace/voice") {
21155
+ if (path17 === "/workspace/voice") {
20733
21156
  if (req.method === "GET") return { route: "GET /workspace/voice" };
20734
21157
  if (req.method === "POST") return { route: "POST /workspace/voice" };
20735
21158
  }
20736
- if (req.method === "POST" && path16 === "/workspace/voice/transcribe") {
21159
+ if (req.method === "POST" && path17 === "/workspace/voice/transcribe") {
20737
21160
  return { route: "POST /workspace/voice/transcribe" };
20738
21161
  }
20739
21162
  return void 0;
@@ -21002,7 +21425,7 @@ __name(registerPermissionRoutes, "registerPermissionRoutes");
21002
21425
  init_esbuild_shims();
21003
21426
  import * as crypto3 from "node:crypto";
21004
21427
  import * as fs6 from "node:fs";
21005
- import * as path11 from "node:path";
21428
+ import * as path12 from "node:path";
21006
21429
 
21007
21430
  // packages/cli/src/serve/server/prompt-deadline.ts
21008
21431
  init_esbuild_shims();
@@ -21022,7 +21445,7 @@ init_esbuild_shims();
21022
21445
 
21023
21446
  // packages/cli/src/serve/server/persisted-session-list-cache.ts
21024
21447
  init_esbuild_shims();
21025
- import path10 from "node:path";
21448
+ import path11 from "node:path";
21026
21449
  var PersistedSessionListCache = class {
21027
21450
  constructor(ttlMs, maxRetainedSummaries) {
21028
21451
  this.ttlMs = ttlMs;
@@ -21033,7 +21456,8 @@ var PersistedSessionListCache = class {
21033
21456
  }
21034
21457
  slots = /* @__PURE__ */ new Map();
21035
21458
  retainedSummaries = 0;
21036
- lookup(scope, loader) {
21459
+ lookup(scope, loader, options = {}) {
21460
+ options.signal?.throwIfAborted();
21037
21461
  const key = this.key(scope);
21038
21462
  let slot = this.slots.get(key);
21039
21463
  if (!slot) {
@@ -21044,27 +21468,43 @@ var PersistedSessionListCache = class {
21044
21468
  if (slot.value) {
21045
21469
  const cacheAgeMs = Math.max(0, now - slot.value.completedAt);
21046
21470
  if (cacheAgeMs < this.ttlMs) {
21471
+ const snapshot = slot.value.snapshot;
21047
21472
  return {
21048
21473
  status: "cache_hit",
21049
- promise: Promise.resolve(slot.value.snapshot),
21474
+ promise: Promise.resolve().then(() => {
21475
+ options.signal?.throwIfAborted();
21476
+ return snapshot;
21477
+ }),
21050
21478
  cacheAgeMs
21051
21479
  };
21052
21480
  }
21053
21481
  this.removeValue(slot);
21054
21482
  }
21055
- if (slot.inFlight !== void 0 && slot.inFlight.generation === slot.generation) {
21483
+ if (slot.inFlight !== void 0 && slot.inFlight.generation === slot.generation && !slot.inFlight.controller.signal.aborted) {
21056
21484
  return {
21057
21485
  status: "single_flight",
21058
- promise: slot.inFlight.promise
21486
+ promise: this.attachWaiter(key, slot, slot.inFlight, options.signal)
21059
21487
  };
21060
21488
  }
21061
21489
  const generation = slot.generation;
21062
- const managed = Promise.resolve().then(loader).then(
21490
+ const controller = new AbortController();
21491
+ const load = {
21492
+ generation,
21493
+ controller,
21494
+ promise: void 0,
21495
+ waiterCount: 0,
21496
+ settled: false
21497
+ };
21498
+ const managed = Promise.resolve().then(() => {
21499
+ controller.signal.throwIfAborted();
21500
+ return loader(controller.signal);
21501
+ }).then(
21063
21502
  (snapshot) => {
21503
+ load.settled = true;
21064
21504
  const current = this.slots.get(key);
21065
- if (current === slot && current.inFlight?.promise === managed) {
21505
+ if (current === slot && current.inFlight === load) {
21066
21506
  current.inFlight = void 0;
21067
- if (current.generation === generation && snapshot.sessions.length <= this.maxRetainedSummaries) {
21507
+ if (current.generation === generation && !controller.signal.aborted && snapshot.sessions.length <= this.maxRetainedSummaries) {
21068
21508
  this.installValue(key, current, snapshot);
21069
21509
  } else if (current.value === void 0) {
21070
21510
  this.slots.delete(key);
@@ -21073,16 +21513,21 @@ var PersistedSessionListCache = class {
21073
21513
  return snapshot;
21074
21514
  },
21075
21515
  (error2) => {
21516
+ load.settled = true;
21076
21517
  const current = this.slots.get(key);
21077
- if (current === slot && current.inFlight?.promise === managed) {
21518
+ if (current === slot && current.inFlight === load) {
21078
21519
  current.inFlight = void 0;
21079
21520
  if (current.value === void 0) this.slots.delete(key);
21080
21521
  }
21081
21522
  throw error2;
21082
21523
  }
21083
21524
  );
21084
- slot.inFlight = { generation, promise: managed };
21085
- return { status: "scan", promise: managed };
21525
+ load.promise = managed;
21526
+ slot.inFlight = load;
21527
+ return {
21528
+ status: "scan",
21529
+ promise: this.attachWaiter(key, slot, load, options.signal)
21530
+ };
21086
21531
  }
21087
21532
  invalidate(scope) {
21088
21533
  const key = this.key(scope);
@@ -21136,9 +21581,42 @@ var PersistedSessionListCache = class {
21136
21581
  this.retainedSummaries -= value.snapshot.sessions.length;
21137
21582
  slot.value = void 0;
21138
21583
  }
21584
+ attachWaiter(key, slot, load, signal) {
21585
+ load.waiterCount += 1;
21586
+ return new Promise((resolve5, reject) => {
21587
+ let settled = false;
21588
+ const settle = /* @__PURE__ */ __name((finish) => {
21589
+ if (settled) return;
21590
+ settled = true;
21591
+ signal?.removeEventListener("abort", onAbort);
21592
+ load.waiterCount -= 1;
21593
+ if (load.waiterCount === 0 && !load.settled) {
21594
+ load.controller.abort(
21595
+ new DOMException("No active session list waiters", "AbortError")
21596
+ );
21597
+ const current = this.slots.get(key);
21598
+ if (current === slot && current.inFlight === load) {
21599
+ current.inFlight = void 0;
21600
+ if (current.value === void 0) this.slots.delete(key);
21601
+ }
21602
+ }
21603
+ finish();
21604
+ }, "settle");
21605
+ const onAbort = /* @__PURE__ */ __name(() => {
21606
+ if (load.settled) return;
21607
+ settle(() => reject(signal?.reason));
21608
+ }, "onAbort");
21609
+ signal?.addEventListener("abort", onAbort, { once: true });
21610
+ if (signal?.aborted) onAbort();
21611
+ void load.promise.then(
21612
+ (snapshot) => settle(() => resolve5(snapshot)),
21613
+ (error2) => settle(() => reject(error2))
21614
+ );
21615
+ });
21616
+ }
21139
21617
  key(scope) {
21140
21618
  return JSON.stringify([
21141
- path10.resolve(scope.runtimeBaseDir),
21619
+ path11.resolve(scope.runtimeBaseDir),
21142
21620
  scope.workspaceCwd,
21143
21621
  scope.archiveState
21144
21622
  ]);
@@ -21257,15 +21735,21 @@ function encodeMetadataSessionCursor(last, filter, archiveState) {
21257
21735
  ).toString("base64url");
21258
21736
  }
21259
21737
  __name(encodeMetadataSessionCursor, "encodeMetadataSessionCursor");
21260
- async function enrichWorktreeSidecars(bySessionId, sessionService, archiveState = "active") {
21738
+ async function enrichWorktreeSidecars(bySessionId, sessionService, archiveState = "active", signal) {
21261
21739
  for (const [sessionId, summary] of bySessionId) {
21740
+ signal?.throwIfAborted();
21262
21741
  if (summary.worktree) continue;
21263
- const sidecar = await readWorktreeSession(
21264
- sessionService.getWorktreeSessionPathForArchiveState(
21742
+ let sidecar;
21743
+ try {
21744
+ const sidecarPath = sessionService.getWorktreeSessionPathForArchiveState(
21265
21745
  sessionId,
21266
21746
  archiveState
21267
- )
21268
- ).catch(() => null);
21747
+ );
21748
+ sidecar = signal ? await readWorktreeSession(sidecarPath, { signal }) : await readWorktreeSession(sidecarPath);
21749
+ } catch {
21750
+ signal?.throwIfAborted();
21751
+ sidecar = null;
21752
+ }
21269
21753
  if (sidecar) {
21270
21754
  bySessionId.set(sessionId, {
21271
21755
  ...summary,
@@ -21320,8 +21804,9 @@ function clonePersistedSummary(session) {
21320
21804
  };
21321
21805
  }
21322
21806
  __name(clonePersistedSummary, "clonePersistedSummary");
21323
- async function loadAllPersistedSummaries(sessionService, archiveState) {
21807
+ async function loadAllPersistedSummaries(sessionService, archiveState, signal) {
21324
21808
  const scanStartedAt = performance.now();
21809
+ signal.throwIfAborted();
21325
21810
  const sessions = [];
21326
21811
  let truncated = false;
21327
21812
  let scanPages = 0;
@@ -21331,8 +21816,10 @@ async function loadAllPersistedSummaries(sessionService, archiveState) {
21331
21816
  const page = await sessionService.listSessions({
21332
21817
  cursor,
21333
21818
  size: 1e4,
21334
- archiveState
21819
+ archiveState,
21820
+ signal
21335
21821
  });
21822
+ signal.throwIfAborted();
21336
21823
  const remaining = MAX_ORGANIZED_SESSIONS - sessions.length;
21337
21824
  sessions.push(...page.items.slice(0, remaining).map(toSummary2));
21338
21825
  cursor = page.nextCursor;
@@ -21350,7 +21837,13 @@ async function loadAllPersistedSummaries(sessionService, archiveState) {
21350
21837
  const bySessionId = new Map(
21351
21838
  sessions.map((session) => [session.sessionId, session])
21352
21839
  );
21353
- await enrichWorktreeSidecars(bySessionId, sessionService, archiveState);
21840
+ await enrichWorktreeSidecars(
21841
+ bySessionId,
21842
+ sessionService,
21843
+ archiveState,
21844
+ signal
21845
+ );
21846
+ signal.throwIfAborted();
21354
21847
  return {
21355
21848
  sessions: [...bySessionId.values()],
21356
21849
  truncated,
@@ -21359,10 +21852,11 @@ async function loadAllPersistedSummaries(sessionService, archiveState) {
21359
21852
  };
21360
21853
  }
21361
21854
  __name(loadAllPersistedSummaries, "loadAllPersistedSummaries");
21362
- async function listAllPersistedSummaries(sessionService, workspaceCwd, archiveState, runtimeBaseDir, queryKind) {
21855
+ async function listAllPersistedSummaries(sessionService, workspaceCwd, archiveState, runtimeBaseDir, queryKind, signal) {
21363
21856
  const lookup = persistedSessionListCache.lookup(
21364
21857
  { runtimeBaseDir, workspaceCwd, archiveState },
21365
- () => loadAllPersistedSummaries(sessionService, archiveState)
21858
+ (loadSignal) => loadAllPersistedSummaries(sessionService, archiveState, loadSignal),
21859
+ { signal }
21366
21860
  );
21367
21861
  addDaemonRequestAttribute(
21368
21862
  "qwen-code.daemon.session_list.cache_status",
@@ -21383,6 +21877,7 @@ async function listAllPersistedSummaries(sessionService, workspaceCwd, archiveSt
21383
21877
  );
21384
21878
  }
21385
21879
  const snapshot = await lookup.promise;
21880
+ signal?.throwIfAborted();
21386
21881
  addDaemonRequestAttribute(
21387
21882
  "qwen-code.daemon.session_list.persisted_sessions",
21388
21883
  snapshot.sessions.length
@@ -21395,7 +21890,7 @@ async function listAllPersistedSummaries(sessionService, workspaceCwd, archiveSt
21395
21890
  "qwen-code.daemon.session_list.truncated",
21396
21891
  snapshot.truncated
21397
21892
  );
21398
- if (lookup.status === "scan") {
21893
+ if (lookup.status !== "cache_hit") {
21399
21894
  addDaemonRequestAttribute(
21400
21895
  "qwen-code.daemon.session_list.scan_duration_ms",
21401
21896
  snapshot.scanDurationMs
@@ -21459,7 +21954,9 @@ async function listOrganizedWorkspaceSessionsForResponse(bridge, workspaceCwd, o
21459
21954
  const archiveState = options.archiveState ?? "active";
21460
21955
  const sessionService = new SessionService(workspaceCwd);
21461
21956
  const organizationService = createSessionOrganizationService(workspaceCwd);
21957
+ readOptions.signal?.throwIfAborted();
21462
21958
  const snapshot = await organizationService.readSnapshot();
21959
+ readOptions.signal?.throwIfAborted();
21463
21960
  const knownGroupIds = new Set(snapshot.groups.map((group2) => group2.id));
21464
21961
  const group = options.group ?? "all";
21465
21962
  if (group !== "all" && group !== "pinned" && group !== "ungrouped" && !knownGroupIds.has(group)) {
@@ -21483,8 +21980,10 @@ async function listOrganizedWorkspaceSessionsForResponse(bridge, workspaceCwd, o
21483
21980
  workspaceCwd,
21484
21981
  archiveState,
21485
21982
  readOptions.runtimeBaseDir,
21486
- "organized"
21983
+ "organized",
21984
+ readOptions.signal
21487
21985
  );
21986
+ readOptions.signal?.throwIfAborted();
21488
21987
  for (const session of persisted.sessions) {
21489
21988
  bySessionId.set(
21490
21989
  session.sessionId,
@@ -21517,7 +22016,9 @@ async function listOrganizedWorkspaceSessionsForResponse(bridge, workspaceCwd, o
21517
22016
  // above and this point: `existing` stayed undefined but
21518
22017
  // `sessionExists` flipped to true, silently dropping the live
21519
22018
  // session from the response instead of merging it.
21520
- !persisted.truncated || !await sessionService.sessionExists(live.sessionId)
22019
+ !persisted.truncated || !await (readOptions.signal ? sessionService.sessionExists(live.sessionId, {
22020
+ signal: readOptions.signal
22021
+ }) : sessionService.sessionExists(live.sessionId))
21521
22022
  ) {
21522
22023
  bySessionId.set(
21523
22024
  live.sessionId,
@@ -21535,6 +22036,7 @@ async function listOrganizedWorkspaceSessionsForResponse(bridge, workspaceCwd, o
21535
22036
  }
21536
22037
  }
21537
22038
  } catch (error2) {
22039
+ readOptions.signal?.throwIfAborted();
21538
22040
  liveMergeFailed = true;
21539
22041
  writeStderrLine(
21540
22042
  `qwen serve: organized session list live merge failed; using persisted sessions only: ${error2 instanceof Error ? error2.message : String(error2)}`
@@ -21549,6 +22051,7 @@ async function listOrganizedWorkspaceSessionsForResponse(bridge, workspaceCwd, o
21549
22051
  return session.groupId == null && session.color == null;
21550
22052
  return session.color == null && session.groupId === group;
21551
22053
  });
22054
+ readOptions.signal?.throwIfAborted();
21552
22055
  const activityTimeById = new Map(
21553
22056
  filtered.map((session) => [
21554
22057
  session.sessionId,
@@ -21556,6 +22059,7 @@ async function listOrganizedWorkspaceSessionsForResponse(bridge, workspaceCwd, o
21556
22059
  ])
21557
22060
  );
21558
22061
  filtered.sort((a, b) => compareOrganizedSessions(activityTimeById, a, b));
22062
+ readOptions.signal?.throwIfAborted();
21559
22063
  const afterCursor = cursorKey === void 0 ? filtered : filtered.filter(
21560
22064
  (session) => compareOrganizedCursorKeys(
21561
22065
  cursorKey,
@@ -21587,8 +22091,10 @@ async function listWorkspaceSessionsByMetadataForResponse(bridge, workspaceCwd,
21587
22091
  workspaceCwd,
21588
22092
  archiveState,
21589
22093
  readOptions.runtimeBaseDir,
21590
- "metadata"
22094
+ "metadata",
22095
+ readOptions.signal
21591
22096
  );
22097
+ readOptions.signal?.throwIfAborted();
21592
22098
  for (const session of persisted.sessions) {
21593
22099
  bySessionId.set(session.sessionId, clonePersistedSummary(session));
21594
22100
  }
@@ -21607,7 +22113,9 @@ async function listWorkspaceSessionsByMetadataForResponse(bridge, workspaceCwd,
21607
22113
  // `listOrganizedWorkspaceSessionsForResponse`: an untruncated scan
21608
22114
  // already covers every persisted session, so skip the racy
21609
22115
  // re-check when nothing was truncated.
21610
- !persisted.truncated || !await sessionService.sessionExists(live.sessionId)
22116
+ !persisted.truncated || !await (readOptions.signal ? sessionService.sessionExists(live.sessionId, {
22117
+ signal: readOptions.signal
22118
+ }) : sessionService.sessionExists(live.sessionId))
21611
22119
  ) {
21612
22120
  bySessionId.set(live.sessionId, {
21613
22121
  ...live,
@@ -21619,6 +22127,7 @@ async function listWorkspaceSessionsByMetadataForResponse(bridge, workspaceCwd,
21619
22127
  }
21620
22128
  }
21621
22129
  } catch (error2) {
22130
+ readOptions.signal?.throwIfAborted();
21622
22131
  liveMergeFailed = true;
21623
22132
  writeStderrLine(
21624
22133
  `qwen serve: session metadata filter live merge failed; using persisted sessions only: ${error2 instanceof Error ? error2.message : String(error2)}`
@@ -21633,6 +22142,7 @@ async function listWorkspaceSessionsByMetadataForResponse(bridge, workspaceCwd,
21633
22142
  getLiveSessionCursorKey(b)
21634
22143
  )
21635
22144
  );
22145
+ readOptions.signal?.throwIfAborted();
21636
22146
  const cursorKey = options.cursor !== void 0 && options.cursor !== "" ? parseMetadataSessionCursor(options.cursor, {
21637
22147
  ...filter,
21638
22148
  archiveState
@@ -21658,20 +22168,25 @@ async function listWorkspaceSessionsByMetadataForResponse(bridge, workspaceCwd,
21658
22168
  }
21659
22169
  __name(listWorkspaceSessionsByMetadataForResponse, "listWorkspaceSessionsByMetadataForResponse");
21660
22170
  async function listWorkspaceSessionsForResponse(bridge, workspaceCwd, options, readOptions = {}) {
22171
+ readOptions.signal?.throwIfAborted();
21661
22172
  const runtimeBaseDir = new Storage(
21662
22173
  workspaceCwd,
21663
22174
  readOptions.runtimeBaseDir
21664
22175
  ).getRuntimeBaseDir();
21665
- return Storage.runWithResolvedRuntimeBaseDir(
22176
+ const result = await Storage.runWithResolvedRuntimeBaseDir(
21666
22177
  runtimeBaseDir,
21667
22178
  () => listWorkspaceSessionsForResponseInRuntime(bridge, workspaceCwd, options, {
21668
22179
  ...readOptions.mergeLive !== void 0 ? { mergeLive: readOptions.mergeLive } : {},
22180
+ ...readOptions.signal !== void 0 ? { signal: readOptions.signal } : {},
21669
22181
  runtimeBaseDir
21670
22182
  })
21671
22183
  );
22184
+ readOptions.signal?.throwIfAborted();
22185
+ return result;
21672
22186
  }
21673
22187
  __name(listWorkspaceSessionsForResponse, "listWorkspaceSessionsForResponse");
21674
22188
  async function listWorkspaceSessionsForResponseInRuntime(bridge, workspaceCwd, options, readOptions) {
22189
+ readOptions.signal?.throwIfAborted();
21675
22190
  const rawSize = options?.size;
21676
22191
  const requestedSize = typeof rawSize === "number" && Number.isSafeInteger(rawSize) ? rawSize : DEFAULT_SESSION_PAGE_SIZE;
21677
22192
  const pageSize = Math.min(Math.max(requestedSize, 1), MAX_SESSION_PAGE_SIZE);
@@ -21708,13 +22223,21 @@ async function listWorkspaceSessionsForResponseInRuntime(bridge, workspaceCwd, o
21708
22223
  const persisted = await sessionService.listSessions({
21709
22224
  cursor: numericCursor,
21710
22225
  size: pageSize,
21711
- archiveState
22226
+ archiveState,
22227
+ ...readOptions.signal ? { signal: readOptions.signal } : {}
21712
22228
  });
22229
+ readOptions.signal?.throwIfAborted();
21713
22230
  const bySessionId = /* @__PURE__ */ new Map();
21714
22231
  for (const item of persisted.items) {
21715
22232
  bySessionId.set(item.sessionId, toSummary2(item));
21716
22233
  }
21717
- await enrichWorktreeSidecars(bySessionId, sessionService, archiveState);
22234
+ await enrichWorktreeSidecars(
22235
+ bySessionId,
22236
+ sessionService,
22237
+ archiveState,
22238
+ readOptions.signal
22239
+ );
22240
+ readOptions.signal?.throwIfAborted();
21718
22241
  if (archiveState === "archived" || readOptions.mergeLive === false) {
21719
22242
  const sessions2 = [...bySessionId.values()];
21720
22243
  const nextCursor2 = persisted.nextCursor != null ? String(persisted.nextCursor) : void 0;
@@ -21732,7 +22255,9 @@ async function listWorkspaceSessionsForResponseInRuntime(bridge, workspaceCwd, o
21732
22255
  // `existing` stayed undefined but `sessionExists` flipped to true,
21733
22256
  // silently dropping the live session from the response instead of
21734
22257
  // merging it.
21735
- (persisted.nextCursor == null || !await sessionService.sessionExists(live.sessionId))) {
22258
+ (persisted.nextCursor == null || !await (readOptions.signal ? sessionService.sessionExists(live.sessionId, {
22259
+ signal: readOptions.signal
22260
+ }) : sessionService.sessionExists(live.sessionId)))) {
21736
22261
  bySessionId.set(live.sessionId, {
21737
22262
  ...live,
21738
22263
  createdAt: live.createdAt,
@@ -21747,6 +22272,7 @@ async function listWorkspaceSessionsForResponseInRuntime(bridge, workspaceCwd, o
21747
22272
  const bTime = Date.parse(b.updatedAt ?? b.createdAt);
21748
22273
  return bTime - aTime;
21749
22274
  });
22275
+ readOptions.signal?.throwIfAborted();
21750
22276
  const nextCursor = persisted.nextCursor != null ? String(persisted.nextCursor) : void 0;
21751
22277
  return { sessions, nextCursor };
21752
22278
  }
@@ -21927,6 +22453,8 @@ import * as fs5 from "node:fs/promises";
21927
22453
  import { createReadStream } from "node:fs";
21928
22454
  import readline from "node:readline";
21929
22455
  var PREFIX = "subagent.";
22456
+ var MAX_VIRTUAL_SESSION_ID_PART_LENGTH = 500;
22457
+ var MAX_VIRTUAL_SESSION_ID_LENGTH = 2e3;
21930
22458
  var POLL_INTERVAL_MS = 250;
21931
22459
  var TARGET_RETENTION_MS = 6e4;
21932
22460
  async function readFirstUserText(filePath) {
@@ -22015,26 +22543,40 @@ function decodePart(value) {
22015
22543
  }
22016
22544
  }
22017
22545
  __name(decodePart, "decodePart");
22018
- function isValidVirtualSessionPart(value) {
22019
- return /^[a-zA-Z0-9_-]{1,500}$/.test(value);
22546
+ function isValidVirtualParentSessionId(value) {
22547
+ return value.length > 0 && value.length <= MAX_VIRTUAL_SESSION_ID_PART_LENGTH && /^[a-zA-Z0-9_-]+$/.test(value);
22020
22548
  }
22021
- __name(isValidVirtualSessionPart, "isValidVirtualSessionPart");
22549
+ __name(isValidVirtualParentSessionId, "isValidVirtualParentSessionId");
22550
+ function isValidVirtualAgentId(value) {
22551
+ return value.length > 0 && value.length <= MAX_VIRTUAL_SESSION_ID_PART_LENGTH && // Round-trip rejects lone surrogates: UTF-8 maps them to U+FFFD, so two
22552
+ // distinct agent ids would otherwise encode to the same session id.
22553
+ decodePart(encodePart(value)) === value;
22554
+ }
22555
+ __name(isValidVirtualAgentId, "isValidVirtualAgentId");
22022
22556
  function createVirtualSubagentSessionId(parentSessionId, agentId) {
22023
- if (!isValidVirtualSessionPart(parentSessionId) || !isValidVirtualSessionPart(agentId)) {
22557
+ if (!isValidVirtualParentSessionId(parentSessionId) || !isValidVirtualAgentId(agentId)) {
22024
22558
  throw new Error("Virtual subagent session ids require valid id parts");
22025
22559
  }
22026
- return `${PREFIX}${encodePart(parentSessionId)}.${encodePart(agentId)}`;
22560
+ const sessionId = `${PREFIX}${encodePart(parentSessionId)}.${encodePart(agentId)}`;
22561
+ if (sessionId.length > MAX_VIRTUAL_SESSION_ID_LENGTH) {
22562
+ throw new Error(
22563
+ `Virtual subagent session id exceeds ${MAX_VIRTUAL_SESSION_ID_LENGTH} characters`
22564
+ );
22565
+ }
22566
+ return sessionId;
22027
22567
  }
22028
22568
  __name(createVirtualSubagentSessionId, "createVirtualSubagentSessionId");
22029
22569
  function parseVirtualSubagentSessionId(sessionId) {
22030
- if (!sessionId.startsWith(PREFIX) || sessionId.length > 2e3) {
22570
+ if (!sessionId.startsWith(PREFIX) || sessionId.length > MAX_VIRTUAL_SESSION_ID_LENGTH) {
22031
22571
  return void 0;
22032
22572
  }
22033
22573
  const parts = sessionId.slice(PREFIX.length).split(".");
22034
22574
  if (parts.length !== 2) return void 0;
22035
- const parentSessionId = decodePart(parts[0]);
22036
- const agentId = decodePart(parts[1]);
22037
- if (!parentSessionId || !agentId || !isValidVirtualSessionPart(parentSessionId) || !isValidVirtualSessionPart(agentId)) {
22575
+ const parentPart = parts[0];
22576
+ const agentPart = parts[1];
22577
+ const parentSessionId = decodePart(parentPart);
22578
+ const agentId = decodePart(agentPart);
22579
+ if (!parentSessionId || !agentId || !isValidVirtualParentSessionId(parentSessionId) || !isValidVirtualAgentId(agentId) || encodePart(parentSessionId) !== parentPart || encodePart(agentId) !== agentPart) {
22038
22580
  return void 0;
22039
22581
  }
22040
22582
  return { parentSessionId, agentId };
@@ -23033,7 +23575,7 @@ function registerSessionRoutes(app, deps) {
23033
23575
  const workspaceParam = req.params[paramName] ?? "";
23034
23576
  const byId = workspaceRegistry.getByWorkspaceId(workspaceParam);
23035
23577
  if (byId) return byId;
23036
- if (!path11.isAbsolute(workspaceParam)) {
23578
+ if (!path12.isAbsolute(workspaceParam)) {
23037
23579
  res.status(400).json({
23038
23580
  error: `\`:${paramName}\` must decode to a workspace id or absolute path`
23039
23581
  });
@@ -23090,16 +23632,19 @@ function registerSessionRoutes(app, deps) {
23090
23632
  }
23091
23633
  return runtime;
23092
23634
  }, "resolveLegacyPrimaryRuntimeFromParam");
23093
- const hasActivePersistedSessions = /* @__PURE__ */ __name(async (runtime) => {
23635
+ const hasActivePersistedSessions = /* @__PURE__ */ __name(async (runtime, signal) => {
23094
23636
  try {
23095
23637
  const page = await createWorkspaceRuntimeSessionService(
23096
23638
  runtime
23097
23639
  ).listSessions({
23098
23640
  archiveState: "active",
23099
- size: 1
23641
+ size: 1,
23642
+ signal
23100
23643
  });
23644
+ signal.throwIfAborted();
23101
23645
  return page.items.length > 0;
23102
23646
  } catch {
23647
+ signal.throwIfAborted();
23103
23648
  return false;
23104
23649
  }
23105
23650
  }, "hasActivePersistedSessions");
@@ -23890,7 +24435,7 @@ function registerSessionRoutes(app, deps) {
23890
24435
  if (worktreeMeta) {
23891
24436
  try {
23892
24437
  const createAllowedRoots = [
23893
- path11.join(workspaceCwd, ".qwen", "worktrees")
24438
+ path12.join(workspaceCwd, ".qwen", "worktrees")
23894
24439
  ];
23895
24440
  let createRepoTop = null;
23896
24441
  try {
@@ -23901,7 +24446,7 @@ function registerSessionRoutes(app, deps) {
23901
24446
  }
23902
24447
  if (createRepoTop && createRepoTop !== workspaceCwd) {
23903
24448
  createAllowedRoots.push(
23904
- path11.join(createRepoTop, ".qwen", "worktrees")
24449
+ path12.join(createRepoTop, ".qwen", "worktrees")
23905
24450
  );
23906
24451
  }
23907
24452
  await runtime.bridge.changeSessionCwd(session.sessionId, {
@@ -24200,7 +24745,7 @@ function registerSessionRoutes(app, deps) {
24200
24745
  if (sidecar) {
24201
24746
  let realTarget;
24202
24747
  const candidateRoots = [
24203
- path11.join(workspaceCwd, ".qwen", "worktrees")
24748
+ path12.join(workspaceCwd, ".qwen", "worktrees")
24204
24749
  ];
24205
24750
  try {
24206
24751
  realTarget = fs6.realpathSync(sidecar.worktreePath);
@@ -24212,13 +24757,13 @@ function registerSessionRoutes(app, deps) {
24212
24757
  } catch {
24213
24758
  }
24214
24759
  if (repoTop && repoTop !== workspaceCwd) {
24215
- candidateRoots.push(path11.join(repoTop, ".qwen", "worktrees"));
24760
+ candidateRoots.push(path12.join(repoTop, ".qwen", "worktrees"));
24216
24761
  }
24217
24762
  const contained = candidateRoots.some((root) => {
24218
24763
  try {
24219
24764
  const realRoot = fs6.realpathSync(root);
24220
- const rel = path11.relative(realRoot, realTarget);
24221
- return !rel.startsWith("..") && !path11.isAbsolute(rel);
24765
+ const rel = path12.relative(realRoot, realTarget);
24766
+ return !rel.startsWith("..") && !path12.isAbsolute(rel);
24222
24767
  } catch {
24223
24768
  return false;
24224
24769
  }
@@ -24271,8 +24816,8 @@ function registerSessionRoutes(app, deps) {
24271
24816
  }, "restoreSessionHandler");
24272
24817
  app.post("/session/:id/load", mutate(), restoreSessionHandler("load"));
24273
24818
  app.post("/session/:id/resume", mutate(), restoreSessionHandler("resume"));
24274
- app.get("/session/:id/subagents/:toolCallId", async (req, res) => {
24275
- const route = "GET /session/:id/subagents/:toolCallId";
24819
+ app.get("/session/:id/subagents/:subagentRef", async (req, res) => {
24820
+ const route = "GET /session/:id/subagents/:subagentRef";
24276
24821
  const sessionId = requireSessionId(req, res);
24277
24822
  if (!sessionId) return;
24278
24823
  if (!virtualSubagentSessions) {
@@ -24283,11 +24828,11 @@ function registerSessionRoutes(app, deps) {
24283
24828
  });
24284
24829
  return;
24285
24830
  }
24286
- const toolCallId = req.params["toolCallId"];
24287
- if (!toolCallId || toolCallId.length > 500) {
24831
+ const subagentRef = req.params["subagentRef"];
24832
+ if (!subagentRef || subagentRef.length > MAX_VIRTUAL_SESSION_ID_PART_LENGTH) {
24288
24833
  res.status(400).json({
24289
- error: "`toolCallId` must be a non-empty tool call id",
24290
- code: "invalid_tool_call_id"
24834
+ error: "`subagentRef` must be a non-empty subagent reference",
24835
+ code: "invalid_subagent_ref"
24291
24836
  });
24292
24837
  return;
24293
24838
  }
@@ -24303,14 +24848,14 @@ function registerSessionRoutes(app, deps) {
24303
24848
  const resolved = await virtualSubagentSessions.resolve(
24304
24849
  runtime,
24305
24850
  sessionId,
24306
- toolCallId
24851
+ subagentRef
24307
24852
  );
24308
24853
  if (!resolved) {
24309
24854
  res.status(404).json({
24310
24855
  error: "Subagent session not found",
24311
24856
  code: "session_not_found",
24312
24857
  sessionId,
24313
- toolCallId
24858
+ subagentRef
24314
24859
  });
24315
24860
  return;
24316
24861
  }
@@ -24320,10 +24865,10 @@ function registerSessionRoutes(app, deps) {
24320
24865
  }
24321
24866
  });
24322
24867
  app.post(
24323
- "/session/:id/subagents/:toolCallId/cancel",
24868
+ "/session/:id/subagents/:subagentRef/cancel",
24324
24869
  mutate(),
24325
24870
  async (req, res) => {
24326
- const route = "POST /session/:id/subagents/:toolCallId/cancel";
24871
+ const route = "POST /session/:id/subagents/:subagentRef/cancel";
24327
24872
  const sessionId = requireSessionId(req, res);
24328
24873
  if (!sessionId) return;
24329
24874
  if (!virtualSubagentSessions) {
@@ -24334,11 +24879,11 @@ function registerSessionRoutes(app, deps) {
24334
24879
  });
24335
24880
  return;
24336
24881
  }
24337
- const toolCallId = req.params["toolCallId"];
24338
- if (!toolCallId || toolCallId.length > 500) {
24882
+ const subagentRef = req.params["subagentRef"];
24883
+ if (!subagentRef || subagentRef.length > MAX_VIRTUAL_SESSION_ID_PART_LENGTH) {
24339
24884
  res.status(400).json({
24340
- error: "`toolCallId` must be a non-empty tool call id",
24341
- code: "invalid_tool_call_id"
24885
+ error: "`subagentRef` must be a non-empty subagent reference",
24886
+ code: "invalid_subagent_ref"
24342
24887
  });
24343
24888
  return;
24344
24889
  }
@@ -24354,14 +24899,14 @@ function registerSessionRoutes(app, deps) {
24354
24899
  const resolved = await virtualSubagentSessions.resolve(
24355
24900
  runtime,
24356
24901
  sessionId,
24357
- toolCallId
24902
+ subagentRef
24358
24903
  );
24359
24904
  if (!resolved) {
24360
24905
  res.status(404).json({
24361
24906
  error: "Subagent session not found",
24362
24907
  code: "session_not_found",
24363
24908
  sessionId,
24364
- toolCallId
24909
+ subagentRef
24365
24910
  });
24366
24911
  return;
24367
24912
  }
@@ -24534,7 +25079,7 @@ function registerSessionRoutes(app, deps) {
24534
25079
  async (req, res, sessionId, runtime) => {
24535
25080
  const body = safeBody(req);
24536
25081
  const targetPath = body["path"];
24537
- if (typeof targetPath !== "string" || targetPath.length === 0 || !path11.isAbsolute(targetPath)) {
25082
+ if (typeof targetPath !== "string" || targetPath.length === 0 || !path12.isAbsolute(targetPath)) {
24538
25083
  res.status(400).json({
24539
25084
  error: "`path` is required and must be an absolute path",
24540
25085
  code: "invalid_path"
@@ -25034,12 +25579,18 @@ function registerSessionRoutes(app, deps) {
25034
25579
  const clientId = parseClientIdHeader(req, res);
25035
25580
  if (clientId === null) return;
25036
25581
  const promptId = crypto3.randomUUID();
25037
- res.status(200).json(
25038
- await runtime.bridge.continueSession(sessionId, {
25039
- ...clientId !== void 0 ? { clientId } : {},
25040
- promptId
25041
- })
25042
- );
25582
+ const result = await runtime.bridge.continueSession(sessionId, {
25583
+ ...clientId !== void 0 ? { clientId } : {},
25584
+ promptId
25585
+ });
25586
+ if (daemonLog && result.accepted) {
25587
+ daemonLog.info("continuation enqueued", {
25588
+ sessionId,
25589
+ promptId,
25590
+ clientId
25591
+ });
25592
+ }
25593
+ res.status(200).json(result);
25043
25594
  }
25044
25595
  )
25045
25596
  );
@@ -25104,6 +25655,22 @@ function registerSessionRoutes(app, deps) {
25104
25655
  const forwardedBody = { ...body };
25105
25656
  delete forwardedBody["deadlineMs"];
25106
25657
  delete forwardedBody["delivery"];
25658
+ const forwardedMeta = typeof forwardedBody["_meta"] === "object" && forwardedBody["_meta"] !== null && !Array.isArray(forwardedBody["_meta"]) ? { ...forwardedBody["_meta"] } : void 0;
25659
+ const promptAuthorization = forwardedMeta?.[CHANNEL_WORKER_PROMPT_AUTHORIZATION_META_KEY];
25660
+ const promptDisplayText = forwardedMeta?.[DAEMON_PROMPT_DISPLAY_TEXT_META_KEY];
25661
+ if (forwardedMeta) {
25662
+ delete forwardedMeta[CHANNEL_WORKER_PROMPT_AUTHORIZATION_META_KEY];
25663
+ delete forwardedMeta[DAEMON_PROMPT_DISPLAY_TEXT_META_KEY];
25664
+ if (Object.keys(forwardedMeta).length > 0) {
25665
+ forwardedBody["_meta"] = forwardedMeta;
25666
+ } else {
25667
+ delete forwardedBody["_meta"];
25668
+ }
25669
+ }
25670
+ const trustedPromptDisplayText = typeof promptDisplayText === "string" && isChannelWorkerPromptAuthorized(
25671
+ promptAuthorization,
25672
+ runtime.workspaceCwd
25673
+ ) ? promptDisplayText : void 0;
25107
25674
  const lastEventId = ownerBridge.getSessionLastEventId(sessionId);
25108
25675
  const eventEpoch = ownerBridge.getSessionEventEpoch(sessionId);
25109
25676
  addDaemonRequestAttribute("qwen-code.prompt_id", promptId);
@@ -25136,6 +25703,7 @@ function registerSessionRoutes(app, deps) {
25136
25703
  ...clientId !== void 0 ? { clientId } : {},
25137
25704
  promptId,
25138
25705
  ...effectiveDeadlineMs !== void 0 ? { deadlineMs: effectiveDeadlineMs } : {},
25706
+ ...trustedPromptDisplayText !== void 0 ? { promptDisplayText: trustedPromptDisplayText } : {},
25139
25707
  ...delivery !== void 0 ? {
25140
25708
  channelDelivery: {
25141
25709
  deliveryId: promptId,
@@ -26014,25 +26582,54 @@ function registerSessionRoutes(app, deps) {
26014
26582
  ...parentSessionId !== void 0 ? { parentSessionId } : {},
26015
26583
  ...parsedSource
26016
26584
  };
26017
- const usePersisted = readOnlySecondary || runtime.primary || view === "organized" || archiveState === "archived" || parentSessionId !== void 0 || parsedSource.sourceType !== void 0 || (cursor !== void 0 && cursor !== "" ? isNumericSessionCursor(cursor) : await hasActivePersistedSessions(runtime));
26018
- if (!usePersisted && (view !== void 0 || archiveState === "archived" || parentSessionId !== void 0 || parsedSource.sourceType !== void 0)) {
26019
- throw new Error(
26020
- "session list live path received persisted-only options"
26585
+ const controller = new AbortController();
26586
+ const onRequestAborted = /* @__PURE__ */ __name(() => {
26587
+ controller.abort(new DOMException("Request aborted", "AbortError"));
26588
+ }, "onRequestAborted");
26589
+ const onResponseClosed = /* @__PURE__ */ __name(() => {
26590
+ if (!res.writableEnded) {
26591
+ controller.abort(new DOMException("Response closed", "AbortError"));
26592
+ }
26593
+ }, "onResponseClosed");
26594
+ req.once("aborted", onRequestAborted);
26595
+ res.once("close", onResponseClosed);
26596
+ if (req.aborted || res.destroyed) onRequestAborted();
26597
+ try {
26598
+ const usePersisted = readOnlySecondary || runtime.primary || view === "organized" || archiveState === "archived" || parentSessionId !== void 0 || parsedSource.sourceType !== void 0 || (cursor !== void 0 && cursor !== "" ? isNumericSessionCursor(cursor) : await hasActivePersistedSessions(runtime, controller.signal));
26599
+ if (!usePersisted && (view !== void 0 || archiveState === "archived" || parentSessionId !== void 0 || parsedSource.sourceType !== void 0)) {
26600
+ throw new Error(
26601
+ "session list live path received persisted-only options"
26602
+ );
26603
+ }
26604
+ const result = usePersisted ? await runWorkspaceInspectionWithLogPolicy(
26605
+ runtime,
26606
+ () => listWorkspaceSessionsForResponse(runtime.bridge, key, options, {
26607
+ mergeLive: !readOnlySecondary,
26608
+ runtimeBaseDir: runtime.sessionRuntimeBaseDir,
26609
+ signal: controller.signal
26610
+ })
26611
+ ) : listLiveWorkspaceSessionsForResponse(
26612
+ runtime.bridge,
26613
+ key,
26614
+ options
26021
26615
  );
26616
+ controller.signal.throwIfAborted();
26617
+ if (res.destroyed) return;
26618
+ res.status(200).json({
26619
+ sessions: result.sessions,
26620
+ ...result.nextCursor != null ? { nextCursor: result.nextCursor } : {},
26621
+ ...result.liveMergeFailed ? { liveMergeFailed: true } : {},
26622
+ ...result.truncated ? { truncated: true } : {}
26623
+ });
26624
+ } catch (err) {
26625
+ if (controller.signal.aborted || res.destroyed) {
26626
+ return;
26627
+ }
26628
+ throw err;
26629
+ } finally {
26630
+ req.off("aborted", onRequestAborted);
26631
+ res.off("close", onResponseClosed);
26022
26632
  }
26023
- const result = usePersisted ? await runWorkspaceInspectionWithLogPolicy(
26024
- runtime,
26025
- () => listWorkspaceSessionsForResponse(runtime.bridge, key, options, {
26026
- mergeLive: !readOnlySecondary,
26027
- runtimeBaseDir: runtime.sessionRuntimeBaseDir
26028
- })
26029
- ) : listLiveWorkspaceSessionsForResponse(runtime.bridge, key, options);
26030
- res.status(200).json({
26031
- sessions: result.sessions,
26032
- ...result.nextCursor != null ? { nextCursor: result.nextCursor } : {},
26033
- ...result.liveMergeFailed ? { liveMergeFailed: true } : {},
26034
- ...result.truncated ? { truncated: true } : {}
26035
- });
26036
26633
  } catch (err) {
26037
26634
  if (err instanceof InvalidCursorError) {
26038
26635
  res.status(400).json({
@@ -26125,6 +26722,35 @@ function registerSessionRoutes(app, deps) {
26125
26722
  }
26126
26723
  )
26127
26724
  );
26725
+ app.post(
26726
+ "/session/:id/config-option",
26727
+ mutate(),
26728
+ withOwnerMutableSession(
26729
+ "POST /session/:id/config-option",
26730
+ async (req, res, sessionId, runtime) => {
26731
+ const body = safeBody(req);
26732
+ const configId = body["configId"];
26733
+ const value = body["value"];
26734
+ if (configId !== "reasoning_effort") {
26735
+ res.status(400).json({
26736
+ error: "`configId` must be reasoning_effort"
26737
+ });
26738
+ return;
26739
+ }
26740
+ if (typeof value !== "string" || !value) {
26741
+ res.status(400).json({
26742
+ error: "`value` is required and must be a non-empty string"
26743
+ });
26744
+ return;
26745
+ }
26746
+ const response = await runtime.bridge.setSessionConfigOption(
26747
+ sessionId,
26748
+ { sessionId, configId, value }
26749
+ );
26750
+ res.status(200).json(response);
26751
+ }
26752
+ )
26753
+ );
26128
26754
  app.post(
26129
26755
  "/session/:id/recap",
26130
26756
  mutate(),
@@ -27628,7 +28254,7 @@ __name(registerUsageStatsRoutes, "registerUsageStatsRoutes");
27628
28254
  // packages/cli/src/serve/scheduled-task-keepalive.ts
27629
28255
  init_esbuild_shims();
27630
28256
  import * as fsSync from "node:fs";
27631
- import * as path12 from "node:path";
28257
+ import * as path13 from "node:path";
27632
28258
  var log = createDebugLogger("SCHED_KEEPALIVE");
27633
28259
  function collectBoundSessionIds(tasks) {
27634
28260
  const seen = /* @__PURE__ */ new Set();
@@ -27784,18 +28410,21 @@ function startScheduledTaskKeepalive(opts) {
27784
28410
  const metadata = await new SessionService(
27785
28411
  boundWorkspace
27786
28412
  ).readCreationMetadata(sessionId);
27787
- const load = bridge.loadSession({
28413
+ const resume = bridge.resumeSession({
27788
28414
  sessionId,
27789
28415
  workspaceCwd: boundWorkspace,
27790
- historyReplay: "response",
27791
28416
  ...metadata
27792
28417
  });
27793
- void load.catch(() => {
28418
+ void resume.catch(() => {
27794
28419
  }).finally(() => {
27795
28420
  reviving.delete(sessionId);
27796
28421
  });
27797
28422
  try {
27798
- await withTimeout(load, reviveTimeoutMs, `loadSession(${sessionId})`);
28423
+ await withTimeout(
28424
+ resume,
28425
+ reviveTimeoutMs,
28426
+ `resumeSession(${sessionId})`
28427
+ );
27799
28428
  log.debug("keepalive: revived non-resident session", sessionId);
27800
28429
  reviveState.delete(sessionId);
27801
28430
  } catch (loadErr) {
@@ -27854,8 +28483,8 @@ function startScheduledTaskKeepalive(opts) {
27854
28483
  opts.runtimeBaseDir,
27855
28484
  () => getCronFilePath(boundWorkspace)
27856
28485
  );
27857
- const cronDir = path12.dirname(cronFilePath);
27858
- const cronFileName = path12.basename(cronFilePath);
28486
+ const cronDir = path13.dirname(cronFilePath);
28487
+ const cronFileName = path13.basename(cronFilePath);
27859
28488
  let fileWatcher;
27860
28489
  try {
27861
28490
  fsSync.mkdirSync(cronDir, { recursive: true });
@@ -27892,11 +28521,11 @@ function startScheduledTaskKeepalive(opts) {
27892
28521
  };
27893
28522
  }
27894
28523
  __name(startScheduledTaskKeepalive, "startScheduledTaskKeepalive");
27895
- var REHYDRATE_LOAD_TIMEOUT_MS = 7e4;
28524
+ var REHYDRATE_RESUME_TIMEOUT_MS = 7e4;
27896
28525
  var REHYDRATE_MAX_CONCURRENCY = 4;
27897
28526
  async function rehydrateScheduledTaskSessions(deps) {
27898
28527
  const { bridge, boundWorkspace } = deps;
27899
- const timeoutMs = deps.loadTimeoutMs ?? REHYDRATE_LOAD_TIMEOUT_MS;
28528
+ const timeoutMs = deps.loadTimeoutMs ?? REHYDRATE_RESUME_TIMEOUT_MS;
27900
28529
  let tasks;
27901
28530
  try {
27902
28531
  tasks = await readCronTasks(boundWorkspace);
@@ -27916,16 +28545,15 @@ async function rehydrateScheduledTaskSessions(deps) {
27916
28545
  const metadata = await new SessionService(
27917
28546
  boundWorkspace
27918
28547
  ).readCreationMetadata(sessionId);
27919
- const load = bridge.loadSession({
28548
+ const resume = bridge.resumeSession({
27920
28549
  sessionId,
27921
28550
  workspaceCwd: boundWorkspace,
27922
- historyReplay: "response",
27923
28551
  ...metadata
27924
28552
  });
27925
- void load.catch(() => {
28553
+ void resume.catch(() => {
27926
28554
  });
27927
28555
  try {
27928
- await withTimeout(load, timeoutMs, `loadSession(${sessionId})`);
28556
+ await withTimeout(resume, timeoutMs, `resumeSession(${sessionId})`);
27929
28557
  loaded.push(sessionId);
27930
28558
  } catch (err) {
27931
28559
  failed.push(sessionId);
@@ -28519,6 +29147,7 @@ function registerCapabilitiesRoutes(app, deps) {
28519
29147
  deps.maxPendingPromptsPerSession
28520
29148
  ),
28521
29149
  sessionRestoreTimeoutMs: deps.sessionRestoreTimeoutMs,
29150
+ ...features.includes("workspace_file_upload") ? { maxWorkspaceFileUploadBytes: MAX_UPLOAD_BYTES } : {},
28522
29151
  ...multiWorkspace ? {
28523
29152
  maxSessionsPerWorkspace: advertisedMaxSessions(
28524
29153
  deps.maxSessionsPerWorkspace
@@ -30837,7 +31466,7 @@ __name(registerWorkspaceModelsRoutes, "registerWorkspaceModelsRoutes");
30837
31466
  // packages/cli/src/serve/routes/a2ui-action.ts
30838
31467
  init_esbuild_shims();
30839
31468
  import * as fsp4 from "node:fs/promises";
30840
- import * as path13 from "node:path";
31469
+ import * as path14 from "node:path";
30841
31470
  var A2UI_MIME = "application/a2ui+json";
30842
31471
  var ACTION_TOOL = "action";
30843
31472
  var CALL_TIMEOUT_MS = 15e3;
@@ -30860,7 +31489,7 @@ __name(usableServerConfig, "usableServerConfig");
30860
31489
  async function findFromSettingsFile(workspaceCwd) {
30861
31490
  try {
30862
31491
  const raw = await fsp4.readFile(
30863
- path13.join(workspaceCwd, ".qwen", "settings.json"),
31492
+ path14.join(workspaceCwd, ".qwen", "settings.json"),
30864
31493
  "utf8"
30865
31494
  );
30866
31495
  const settings = JSON.parse(raw);
@@ -31021,7 +31650,7 @@ __name(registerA2uiActionRoutes, "registerA2uiActionRoutes");
31021
31650
 
31022
31651
  // packages/cli/src/serve/server/fs-factory.ts
31023
31652
  init_esbuild_shims();
31024
- import * as path14 from "node:path";
31653
+ import * as path15 from "node:path";
31025
31654
  var IDE_WORKSPACE_PATH_ENV_VAR = "QWEN_CODE_IDE_WORKSPACE_PATH";
31026
31655
  function createDefaultFsAuditEmit() {
31027
31656
  const WARN_EVERY = 100;
@@ -31096,14 +31725,14 @@ function parseIdeWorkspacePathEnv(value) {
31096
31725
  const parsed = JSON.parse(value);
31097
31726
  if (Array.isArray(parsed) && parsed.every((item) => typeof item === "string")) {
31098
31727
  return parsed.filter(
31099
- (workspace) => workspace.length > 0 && path14.isAbsolute(workspace)
31728
+ (workspace) => workspace.length > 0 && path15.isAbsolute(workspace)
31100
31729
  );
31101
31730
  }
31102
31731
  throw new Error("IDE workspace path JSON must be a string array");
31103
31732
  } catch {
31104
31733
  }
31105
31734
  }
31106
- return value.split(path14.delimiter).filter((workspace) => workspace.length > 0 && path14.isAbsolute(workspace));
31735
+ return value.split(path15.delimiter).filter((workspace) => workspace.length > 0 && path15.isAbsolute(workspace));
31107
31736
  }
31108
31737
  __name(parseIdeWorkspacePathEnv, "parseIdeWorkspacePathEnv");
31109
31738
  function dropNestedWorkspacesPreservingPrimary(workspaces) {
@@ -31372,9 +32001,9 @@ __name(setupDeviceFlowRegistry, "setupDeviceFlowRegistry");
31372
32001
 
31373
32002
  // packages/cli/src/serve/server/error-handlers.ts
31374
32003
  init_esbuild_shims();
31375
- var import_express3 = __toESM(require_express(), 1);
32004
+ var import_express4 = __toESM(require_express(), 1);
31376
32005
  function installJsonBodyParser(app) {
31377
- app.use(import_express3.default.json({ limit: "10mb" }));
32006
+ app.use(import_express4.default.json({ limit: "10mb" }));
31378
32007
  app.use((err, _req, res, next) => {
31379
32008
  if (sendJsonBodyParserError(res, err)) return;
31380
32009
  next(err);
@@ -31428,10 +32057,10 @@ function installRateLimiter(app, opts, daemonLog, options = {}) {
31428
32057
  { tier, key: key.slice(0, 64) }
31429
32058
  );
31430
32059
  } : void 0,
31431
- onError: daemonLog ? (err, path16) => {
32060
+ onError: daemonLog ? (err, path17) => {
31432
32061
  daemonLog.warn(
31433
32062
  `rate limiter error (fail-open): ${err instanceof Error ? err.message : String(err)}`,
31434
- { path: path16 }
32063
+ { path: path17 }
31435
32064
  );
31436
32065
  } : void 0
31437
32066
  });
@@ -31627,7 +32256,7 @@ __name(registerWorkspaceQualifiedLifecycleRoutes, "registerWorkspaceQualifiedLif
31627
32256
  init_esbuild_shims();
31628
32257
  import { readdir as readdir2, stat as stat2 } from "node:fs/promises";
31629
32258
  import { realpathSync as realpathSync3 } from "node:fs";
31630
- import { basename as basename4, dirname as dirname4, isAbsolute as isAbsolute7, join as join8, resolve as resolve4, sep as sep3 } from "node:path";
32259
+ import { basename as basename5, dirname as dirname5, isAbsolute as isAbsolute7, join as join9, resolve as resolve4, sep as sep3 } from "node:path";
31631
32260
 
31632
32261
  // packages/cli/src/serve/native-directory-picker.ts
31633
32262
  init_esbuild_shims();
@@ -32013,8 +32642,8 @@ function registerWorkspaceManagementRoutes(app, deps) {
32013
32642
  return;
32014
32643
  }
32015
32644
  const endsWithSep = prefix.endsWith("/") || process.platform === "win32" && prefix.endsWith("\\");
32016
- const dir = endsWithSep ? join8(prefix, ".") : dirname4(prefix);
32017
- const filter = endsWithSep ? "" : basename4(prefix);
32645
+ const dir = endsWithSep ? join9(prefix, ".") : dirname5(prefix);
32646
+ const filter = endsWithSep ? "" : basename5(prefix);
32018
32647
  const filterLower = filter.toLowerCase();
32019
32648
  const suggestions = [];
32020
32649
  let truncated = false;
@@ -32029,7 +32658,7 @@ function registerWorkspaceManagementRoutes(app, deps) {
32029
32658
  let isDir = entry.isDirectory();
32030
32659
  if (!isDir && entry.isSymbolicLink()) {
32031
32660
  try {
32032
- isDir = (await stat2(join8(dir, entry.name))).isDirectory();
32661
+ isDir = (await stat2(join9(dir, entry.name))).isDirectory();
32033
32662
  } catch {
32034
32663
  continue;
32035
32664
  }
@@ -32039,7 +32668,7 @@ function registerWorkspaceManagementRoutes(app, deps) {
32039
32668
  truncated = true;
32040
32669
  break;
32041
32670
  }
32042
- suggestions.push({ name: entry.name, path: join8(dir, entry.name) });
32671
+ suggestions.push({ name: entry.name, path: join9(dir, entry.name) });
32043
32672
  }
32044
32673
  } catch {
32045
32674
  }
@@ -32059,11 +32688,11 @@ function registerWorkspaceManagementRoutes(app, deps) {
32059
32688
  const controller = new AbortController();
32060
32689
  res.on("close", () => controller.abort());
32061
32690
  try {
32062
- const path16 = await pickWorkspaceDirectory(controller.signal);
32691
+ const path17 = await pickWorkspaceDirectory(controller.signal);
32063
32692
  res.status(200).json({
32064
32693
  kind: "workspace-directory-picker",
32065
- selected: path16 !== void 0,
32066
- ...path16 === void 0 ? {} : { path: path16 }
32694
+ selected: path17 !== void 0,
32695
+ ...path17 === void 0 ? {} : { path: path17 }
32067
32696
  });
32068
32697
  } catch (error2) {
32069
32698
  const detail = error2 instanceof Error ? error2.message : String(error2);
@@ -33120,8 +33749,8 @@ function buildDiffList(workspaceCwd, result) {
33120
33749
  hiddenCount: 0
33121
33750
  };
33122
33751
  }
33123
- const files = [...result.perFileStats.entries()].map(([path16, s]) => ({
33124
- path: path16,
33752
+ const files = [...result.perFileStats.entries()].map(([path17, s]) => ({
33753
+ path: path17,
33125
33754
  oldPath: s.oldPath,
33126
33755
  added: s.added,
33127
33756
  removed: s.removed,
@@ -36113,7 +36742,7 @@ __name(registerWorkspaceQualifiedSkillsRoutes, "registerWorkspaceQualifiedSkills
36113
36742
 
36114
36743
  // packages/cli/src/serve/routes/channel-webhooks.ts
36115
36744
  init_esbuild_shims();
36116
- var import_express4 = __toESM(require_express(), 1);
36745
+ var import_express5 = __toESM(require_express(), 1);
36117
36746
  import { createHash as createHash4, timingSafeEqual as timingSafeEqual2 } from "node:crypto";
36118
36747
  var PROTOTYPE_POLLUTION_KEYS = /* @__PURE__ */ new Set([
36119
36748
  "__proto__",
@@ -36162,7 +36791,7 @@ function registerChannelWebhookRoutes(app, deps) {
36162
36791
  locals.channelWebhook = { channelName, source, sourceConfig };
36163
36792
  next();
36164
36793
  },
36165
- import_express4.default.json({ limit: "1mb" }),
36794
+ import_express5.default.json({ limit: "1mb" }),
36166
36795
  async (req, res) => {
36167
36796
  const locals = res.locals;
36168
36797
  const webhook = locals.channelWebhook;
@@ -39664,7 +40293,7 @@ import { createHash as createHash5, randomUUID as randomUUID11 } from "node:cryp
39664
40293
  import * as fs7 from "node:fs";
39665
40294
  import * as fsp5 from "node:fs/promises";
39666
40295
  import * as os2 from "node:os";
39667
- import * as path15 from "node:path";
40296
+ import * as path16 from "node:path";
39668
40297
  import { Readable, Transform } from "node:stream";
39669
40298
  import { pipeline } from "node:stream/promises";
39670
40299
  import { promisify as promisify3 } from "node:util";
@@ -39744,7 +40373,7 @@ async function readBundleValue(appPath, key) {
39744
40373
  "raw",
39745
40374
  "-o",
39746
40375
  "-",
39747
- path15.join(appPath, "Contents", "Info.plist")
40376
+ path16.join(appPath, "Contents", "Info.plist")
39748
40377
  ]);
39749
40378
  }
39750
40379
  __name(readBundleValue, "readBundleValue");
@@ -39886,11 +40515,11 @@ async function downloadLiveHostRelease(currentArchitecture, destination, onProgr
39886
40515
  __name(downloadLiveHostRelease, "downloadLiveHostRelease");
39887
40516
  async function installLatestHost(currentArchitecture, onStatus) {
39888
40517
  const temporaryDirectory = await fsp5.mkdtemp(
39889
- path15.join(os2.tmpdir(), "qwen-live-host-")
40518
+ path16.join(os2.tmpdir(), "qwen-live-host-")
39890
40519
  );
39891
- const archivePath = path15.join(temporaryDirectory, "Qwen-Live-Host.zip");
39892
- const extractedPath = path15.join(temporaryDirectory, "extracted");
39893
- const candidatePath = path15.join(extractedPath, LIVE_HOST_APP_NAME);
40520
+ const archivePath = path16.join(temporaryDirectory, "Qwen-Live-Host.zip");
40521
+ const extractedPath = path16.join(temporaryDirectory, "extracted");
40522
+ const candidatePath = path16.join(extractedPath, LIVE_HOST_APP_NAME);
39894
40523
  const stagingPath = `/Applications/.Qwen Live Host.install-${randomUUID11()}.app`;
39895
40524
  const backupPath = `/Applications/.Qwen Live Host.backup-${randomUUID11()}.app`;
39896
40525
  let movedExisting = false;
@@ -40042,13 +40671,13 @@ var LiveHostInstaller = class {
40042
40671
  init_esbuild_shims();
40043
40672
  import { createHash as createHash6, randomUUID as randomUUID12 } from "node:crypto";
40044
40673
  import { createWriteStream as createWriteStream2, mkdirSync as mkdirSync2 } from "node:fs";
40045
- import { join as join11 } from "node:path";
40674
+ import { join as join12 } from "node:path";
40046
40675
 
40047
40676
  // packages/cli/src/serve/live/realtime-startup-context.ts
40048
40677
  init_esbuild_shims();
40049
40678
  import { readdirSync } from "node:fs";
40050
40679
  import { homedir } from "node:os";
40051
- import { basename as basename5, join as join10 } from "node:path";
40680
+ import { basename as basename6, join as join11 } from "node:path";
40052
40681
  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.";
40053
40682
  var CURRENT_THREAD_SECTION_TOKEN_BUDGET = 1200;
40054
40683
  var RECENT_WORK_SECTION_TOKEN_BUDGET = 2200;
@@ -40290,7 +40919,7 @@ function collectTreeLines(directory, depth, lines) {
40290
40919
  const indent = " ".repeat(depth);
40291
40920
  lines.push(`${indent}- ${entry.name}${entry.isDirectory() ? "/" : ""}`);
40292
40921
  if (entry.isDirectory()) {
40293
- collectTreeLines(join10(directory, entry.name), depth + 1, lines);
40922
+ collectTreeLines(join11(directory, entry.name), depth + 1, lines);
40294
40923
  }
40295
40924
  }
40296
40925
  if (entries.length > DIR_ENTRY_LIMIT) {
@@ -40314,11 +40943,11 @@ function buildWorkspaceSection(currentCwd, userRoot) {
40314
40943
  if (!cwdTree && !gitRoot && !userRootTree) return void 0;
40315
40944
  const lines = [
40316
40945
  `Current working directory: ${currentCwd}`,
40317
- `Working directory name: ${basename5(currentCwd) || currentCwd}`
40946
+ `Working directory name: ${basename6(currentCwd) || currentCwd}`
40318
40947
  ];
40319
40948
  if (gitRoot) {
40320
40949
  lines.push(`Git root: ${gitRoot}`);
40321
- lines.push(`Git project: ${basename5(gitRoot) || gitRoot}`);
40950
+ lines.push(`Git project: ${basename6(gitRoot) || gitRoot}`);
40322
40951
  }
40323
40952
  if (userRoot) lines.push(`User root: ${userRoot}`);
40324
40953
  if (cwdTree) lines.push("", "Working directory tree:", ...cwdTree);
@@ -40409,13 +41038,13 @@ function openLiveAudioCapture(source, identifier) {
40409
41038
  try {
40410
41039
  mkdirSync2(directory, { recursive: true, mode: 448 });
40411
41040
  const safeIdentifier = identifier.replace(/[^A-Za-z0-9_-]/g, "_");
40412
- const path16 = join11(
41041
+ const path17 = join12(
40413
41042
  directory,
40414
41043
  `${source}-${Date.now()}-${safeIdentifier}.pcm`
40415
41044
  );
40416
- const stream = createWriteStream2(path16, { flags: "wx", mode: 384 });
41045
+ const stream = createWriteStream2(path17, { flags: "wx", mode: 384 });
40417
41046
  stream.on("error", () => void 0);
40418
- return { source, path: path16, stream, hash: createHash6("sha256"), bytes: 0 };
41047
+ return { source, path: path17, stream, hash: createHash6("sha256"), bytes: 0 };
40419
41048
  } catch {
40420
41049
  return void 0;
40421
41050
  }
@@ -42811,7 +43440,7 @@ function createServeApp(opts, getPort = () => opts.port, deps = {}) {
42811
43440
  "createServeApp: runtime replacement/removal requires deps.getSessionBridges so session-id admission can inspect draining generations."
42812
43441
  );
42813
43442
  }
42814
- const app = (0, import_express5.default)();
43443
+ const app = (0, import_express6.default)();
42815
43444
  const injectedWorkspaceRegistry = deps.workspaceRegistry;
42816
43445
  const boundWorkspace = injectedWorkspaceRegistry?.primary.workspaceCwd ?? deps.boundWorkspace ?? canonicalizeWorkspace(opts.workspace ?? process.cwd());
42817
43446
  if (injectedWorkspaceRegistry) {
@@ -43810,6 +44439,23 @@ function createServeApp(opts, getPort = () => opts.port, deps = {}) {
43810
44439
  safeBody,
43811
44440
  workspaceRegistry
43812
44441
  });
44442
+ const uploadGate = createUploadConcurrencyGate();
44443
+ registerWorkspaceFileUploadRoutes(app, {
44444
+ bridge: primaryBridge,
44445
+ mutate,
44446
+ parseClientId: parseClientIdHeader,
44447
+ safeBody,
44448
+ uploadGate,
44449
+ ...primaryRuntimeTrustAuthoritative ? { isWorkspaceTrusted: isPrimaryWorkspaceTrusted } : {}
44450
+ });
44451
+ registerWorkspaceQualifiedFileUploadRoutes(app, {
44452
+ bridge: primaryBridge,
44453
+ mutate,
44454
+ parseClientId: parseClientIdHeader,
44455
+ safeBody,
44456
+ uploadGate,
44457
+ workspaceRegistry
44458
+ });
43813
44459
  registerWorkspaceSetupGithubRoutes(app, {
43814
44460
  boundWorkspace: primaryBoundWorkspace,
43815
44461
  bridge: primaryBridge,