@qwen-code/qwen-code 0.21.9 → 0.21.10

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 (218) hide show
  1. package/bundled/qc-helper/docs/configuration/settings.md +1 -1
  2. package/bundled/qc-helper/docs/features/status-line.md +13 -13
  3. package/bundled/qc-helper/docs/integration-jetbrains.md +1 -0
  4. package/bundled/qc-helper/docs/reference/keyboard-shortcuts.md +14 -10
  5. package/bundled/review/SKILL.md +2 -2
  6. package/chunks/{MaxSizedBox-6BZANW7X.js → MaxSizedBox-FKXYULMW.js} +5 -5
  7. package/chunks/{StandaloneSessionPicker-VDC5KE7T.js → StandaloneSessionPicker-OQS3M7AY.js} +19 -19
  8. package/chunks/{acp-startup-profiler-B5BYAMYQ.js → acp-startup-profiler-VNTFWYAC.js} +2 -2
  9. package/chunks/{acpAgent-F2NSBCUF.js → acpAgent-AGS6HLQQ.js} +95 -43
  10. package/chunks/{agent-VOHJOEBB.js → agent-4NCVO27U.js} +5 -5
  11. package/chunks/{agent-headless-J5NFOPHP.js → agent-headless-HYEHZFH6.js} +5 -5
  12. package/chunks/{anthropicContentGenerator-SSFE2753.js → anthropicContentGenerator-D3Y4RFT4.js} +1 -1
  13. package/chunks/{bridge-NQIZZLAS.js → bridge-FHINXZMN.js} +8 -8
  14. package/chunks/{channel-settings-store-VIY2OENO.js → channel-settings-store-OXYG5S5X.js} +11 -11
  15. package/chunks/{channel-worker-group-MSHT6CWR.js → channel-worker-group-WQP4RCDO.js} +3 -3
  16. package/chunks/{channel-worker-manager-XXD3GDSK.js → channel-worker-manager-MRDFAKIM.js} +3 -3
  17. package/chunks/{chunk-7AEPJGL4.js → chunk-26CXSA6V.js} +1 -1
  18. package/chunks/{chunk-KTQGGPGV.js → chunk-2PLNY5TN.js} +4 -4
  19. package/chunks/{chunk-G2TX5ZXC.js → chunk-47PEPJO7.js} +3 -3
  20. package/chunks/{chunk-3XVDTHBJ.js → chunk-4MKXUHXY.js} +2 -2
  21. package/chunks/{chunk-D7BXVKSF.js → chunk-4WL6SY4F.js} +1 -1
  22. package/chunks/{chunk-P3RBMQ4P.js → chunk-5MZCSWI4.js} +4 -4
  23. package/chunks/{chunk-LP2QGNSP.js → chunk-624NHDGB.js} +3 -1
  24. package/chunks/{chunk-FBMCDU63.js → chunk-6LP743KE.js} +4 -4
  25. package/chunks/{chunk-II6G3EY6.js → chunk-7GTMV7UE.js} +339 -213
  26. package/chunks/{chunk-4XQNB3KN.js → chunk-A7XMDZRI.js} +2 -2
  27. package/chunks/{chunk-PNBBJOCP.js → chunk-AAE6SR4Q.js} +1 -1
  28. package/chunks/{chunk-JUWS2Z5K.js → chunk-ABVRJU3D.js} +5 -5
  29. package/chunks/{chunk-IOEZE2YT.js → chunk-AEL7KN2O.js} +1 -1
  30. package/chunks/{chunk-OGDIJKHK.js → chunk-AQAJJMRR.js} +1 -1
  31. package/chunks/{chunk-AKJQSWV4.js → chunk-BSI645OU.js} +2 -2
  32. package/chunks/{chunk-FCLHHEUK.js → chunk-D27I6YJT.js} +11 -11
  33. package/chunks/{chunk-P2FK2HBV.js → chunk-DCZEPFB4.js} +2 -2
  34. package/chunks/{chunk-GAKGOXTC.js → chunk-EBZ6BJTF.js} +1 -1
  35. package/chunks/{chunk-KSAFZ5TA.js → chunk-ECWR5LQR.js} +1 -1
  36. package/chunks/{chunk-XX7QFP34.js → chunk-EI3NWELG.js} +116 -62
  37. package/chunks/{chunk-P4ZEZSJZ.js → chunk-F24A2JBM.js} +260 -65
  38. package/chunks/{chunk-DH5YXSIF.js → chunk-F6WDTQ3M.js} +2 -2
  39. package/chunks/{chunk-ZOSTTOUJ.js → chunk-GWVUR3QZ.js} +1 -1
  40. package/chunks/{chunk-BZP4QPNK.js → chunk-IBUGFUXC.js} +9 -9
  41. package/chunks/{chunk-SCAZZ3Q4.js → chunk-IRZ2ZH72.js} +4 -4
  42. package/chunks/{chunk-OGNFHGIG.js → chunk-IWTMYQ32.js} +4 -4
  43. package/chunks/{chunk-CG3WBKJK.js → chunk-JT7XS4YW.js} +1 -1
  44. package/chunks/{chunk-MTCYGTWH.js → chunk-KID7K6H2.js} +4 -4
  45. package/chunks/{chunk-DGEIYUC3.js → chunk-KM73TBQ4.js} +7 -1
  46. package/chunks/{chunk-TZ6KJ44L.js → chunk-KONVMRK7.js} +1 -1
  47. package/chunks/{scheduler-YNQNOU2E.js → chunk-KZ22NXBY.js} +238 -110
  48. package/chunks/{chunk-RBHQXGDK.js → chunk-LLCWZQCU.js} +1 -1
  49. package/chunks/{chunk-UJUM2SRN.js → chunk-MIKXJYZB.js} +27 -26
  50. package/chunks/{chunk-THIKWITR.js → chunk-NDU63YLI.js} +2 -2
  51. package/chunks/{chunk-ATMO54WE.js → chunk-NEOXOWYH.js} +2 -2
  52. package/chunks/{chunk-QSNSL4R4.js → chunk-NRLFZWCT.js} +1 -1
  53. package/chunks/{chunk-TQCYNLNJ.js → chunk-NV65ZUVM.js} +1 -1
  54. package/chunks/{chunk-HZGBKOX3.js → chunk-O3EU6GMH.js} +2 -2
  55. package/chunks/{chunk-46YJDYCU.js → chunk-OCSFNUU4.js} +7 -7
  56. package/chunks/{chunk-T5RLUXWJ.js → chunk-OJUQF2PL.js} +2 -2
  57. package/chunks/{chunk-ZTQSOV56.js → chunk-OONWZLFK.js} +3 -3
  58. package/chunks/{chunk-23VQTELM.js → chunk-P3BJLFSZ.js} +1 -1
  59. package/chunks/{chunk-BIRWP6LU.js → chunk-Q3AL4JQ3.js} +1 -1
  60. package/chunks/{chunk-CMOBWHWW.js → chunk-QBJYSIQ4.js} +1 -1
  61. package/chunks/{chunk-XTY5DN4Y.js → chunk-QG3FFJYU.js} +1 -1
  62. package/chunks/{chunk-W3FSZSF2.js → chunk-QGNOFE5E.js} +1 -1
  63. package/chunks/{chunk-3WDYBTTI.js → chunk-QJMOAMXT.js} +4 -4
  64. package/chunks/{chunk-67N6HB5H.js → chunk-QUI267ZP.js} +1 -0
  65. package/chunks/{chunk-K4ADGWHU.js → chunk-TRRF5BSP.js} +1 -1
  66. package/chunks/{chunk-7GOYZQPR.js → chunk-UBX6NL47.js} +3 -3
  67. package/chunks/{chunk-WP5VOXF7.js → chunk-UEOKWYGY.js} +1 -1
  68. package/chunks/{chunk-HADWBW5R.js → chunk-UMD7WQTR.js} +4 -4
  69. package/chunks/{chunk-RVSTTOJ4.js → chunk-URKIBIFC.js} +2 -2
  70. package/chunks/{chunk-7S4JBJLU.js → chunk-VSFKIRRW.js} +3 -3
  71. package/chunks/{chunk-ZBXGWQ4S.js → chunk-VWKER4ZH.js} +2 -2
  72. package/chunks/{chunk-M2PNLYGY.js → chunk-W5UC37EE.js} +2 -0
  73. package/chunks/{chunk-BT6GQIEJ.js → chunk-X2UOOG5V.js} +1 -1
  74. package/chunks/{chunk-WGK4TSB7.js → chunk-XVHYA33G.js} +3 -3
  75. package/chunks/{chunk-BAMN6XSD.js → chunk-Y3OVRWRY.js} +1 -1
  76. package/chunks/{chunk-PVOGHGSF.js → chunk-Y4R47ZUH.js} +6 -6
  77. package/chunks/{chunk-LZZLUCRS.js → chunk-YF5MALI4.js} +3 -3
  78. package/chunks/{chunk-5RBDAGC6.js → chunk-YWPSGJFI.js} +2 -2
  79. package/chunks/{chunk-MHP476D3.js → chunk-Z4JX4NSH.js} +52 -39
  80. package/chunks/{chunk-T6HEQR2Q.js → chunk-ZJ4W6SUY.js} +1 -1
  81. package/chunks/{chunk-UYAUA63Q.js → chunk-ZRBMO3C7.js} +1 -1
  82. package/chunks/{chunk-KTKYGS2P.js → chunk-ZZCWJWTF.js} +8 -1
  83. package/chunks/{computer-use-PMZ7ICGY.js → computer-use-WQFK33Z3.js} +5 -5
  84. package/chunks/{contextCommand-GEZU7YHE.js → contextCommand-7EOZND7C.js} +7 -7
  85. package/chunks/{core-runtime-HRJI2MN6.js → core-runtime-FGMQRM6E.js} +5 -5
  86. package/chunks/{create-sub-session-VBNVI4YU.js → create-sub-session-QM2K5HLZ.js} +6 -6
  87. package/chunks/{daemon-POSQPD3G.js → daemon-GWD7BT6E.js} +46 -5
  88. package/chunks/{daemon-status-provider-N4CRQKFI.js → daemon-status-provider-L3J6GKCT.js} +12 -12
  89. package/chunks/{daemon-trust-policy-BHO3JUHM.js → daemon-trust-policy-4PHPY23S.js} +11 -11
  90. package/chunks/{daemon-trust-policy-monitor-YEKJ2726.js → daemon-trust-policy-monitor-6UKEABN5.js} +11 -11
  91. package/chunks/{deferred-core-runtime-SH57E3J3.js → deferred-core-runtime-67GJXHXS.js} +5 -5
  92. package/chunks/{earlyInputCapture-B2JJ2HME.js → earlyInputCapture-IWMYR6OB.js} +5 -5
  93. package/chunks/{edit-7FTXENAN.js → edit-ZFGROCAF.js} +5 -5
  94. package/chunks/{enter-worktree-JPHV2PBG.js → enter-worktree-TZZZCDM5.js} +5 -5
  95. package/chunks/{enterPlanMode-CGBJ3AHJ.js → enterPlanMode-U77BI3R6.js} +5 -5
  96. package/chunks/{environment-LXASZAHD.js → environment-HC37DS2I.js} +7 -7
  97. package/chunks/{errors-XIGVT2AD.js → errors-6AG54JPD.js} +7 -7
  98. package/chunks/{exit-worktree-DKSGXW65.js → exit-worktree-UYYWFPNK.js} +5 -5
  99. package/chunks/{exitPlanMode-THFL2HYN.js → exitPlanMode-RWJR2KGB.js} +5 -5
  100. package/chunks/{fast-path-4NXAT5UL.js → fast-path-F5FSZ3O7.js} +2 -2
  101. package/chunks/{gemini-B3N6FACU.js → gemini-NKQHYM36.js} +76 -52
  102. package/chunks/{geminiContentGenerator-YYFE2HIE.js → geminiContentGenerator-HCWZOUX3.js} +1 -1
  103. package/chunks/{glob-BPHSCFJP.js → glob-3PDXKBAO.js} +5 -5
  104. package/chunks/{goal-tools-PXWN5VK3.js → goal-tools-SWNB6GP4.js} +1 -1
  105. package/chunks/{grep-ROZIRFLU.js → grep-5HZKZYVD.js} +5 -5
  106. package/chunks/{handleAutoUpdate-WV6SPZQB.js → handleAutoUpdate-NHFSGYTF.js} +9 -9
  107. package/chunks/{i18n-YWJWPQKD.js → i18n-Q27KKNDL.js} +6 -6
  108. package/chunks/{image-gen-SISRZ6FS.js → image-gen-2Z2RJ6W7.js} +1 -1
  109. package/chunks/{initializer-66OAD6GO.js → initializer-Y5DJLT43.js} +11 -11
  110. package/chunks/{installationInfo-3YUGIP36.js → installationInfo-XXB75T7O.js} +6 -6
  111. package/chunks/{list-VEYR66XB.js → list-YHNQ32CS.js} +14 -14
  112. package/chunks/{loadedSettingsAdapter-V2JCPCYD.js → loadedSettingsAdapter-GHUQK7H4.js} +11 -11
  113. package/chunks/{loggingContentGenerator-RBLNDREC.js → loggingContentGenerator-6NTFBM7Q.js} +1 -1
  114. package/chunks/{managed-npm-update-C5ID5R4R.js → managed-npm-update-SPHYQUWZ.js} +6 -6
  115. package/chunks/{mcp-OZ54NZJQ.js → mcp-EA3KO6FS.js} +11 -11
  116. package/chunks/{monitor-7Y4TVFTK.js → monitor-ZBBPAA54.js} +5 -5
  117. package/chunks/{nonInteractiveCli-QEK4LHAC.js → nonInteractiveCli-NNOR56HU.js} +35 -35
  118. package/chunks/{notebook-edit-OG35EBGY.js → notebook-edit-5W3FW7Z2.js} +5 -5
  119. package/chunks/{openaiContentGenerator-443BNRPJ.js → openaiContentGenerator-TQANPEVZ.js} +1 -1
  120. package/chunks/{pidfile-ZK4OLRZA.js → pidfile-EQOBLH4E.js} +5 -5
  121. package/chunks/{processUtils-4YGB4RUZ.js → processUtils-7XQG7EHS.js} +2 -2
  122. package/chunks/{qwenContentGenerator-D5C2LCSZ.js → qwenContentGenerator-BKCPHHXU.js} +5 -5
  123. package/chunks/{qwenOAuth2-Z4YQBMYN.js → qwenOAuth2-BJ6PQKE6.js} +1 -1
  124. package/chunks/{read-file-EXTJLWMU.js → read-file-KKTXGIZD.js} +1 -1
  125. package/chunks/{resumeHistoryUtils-UPCGRJUL.js → resumeHistoryUtils-6N6XGJJW.js} +8 -8
  126. package/chunks/{ripGrep-QBVIRCU4.js → ripGrep-SJVAAYDV.js} +5 -5
  127. package/chunks/{run-qwen-serve-ZYGJNE3E.js → run-qwen-serve-BCKBCAMX.js} +34 -34
  128. package/chunks/{runtime-BZZ4LWCP.js → runtime-E2437YKL.js} +12 -12
  129. package/chunks/scheduler-K3D5Z655.js +108 -0
  130. package/chunks/{serve-LJHAXDCH.js → serve-IH4XR5IL.js} +11 -11
  131. package/chunks/{server-ADMLELR6.js → server-UD6INW7J.js} +616 -245
  132. package/chunks/{session-YKZXFFTM.js → session-GR4ZEVW4.js} +43 -44
  133. package/chunks/{settings-EQBUAQ7Y.js → settings-5O24D3OJ.js} +10 -10
  134. package/chunks/{shell-3QZOJGTT.js → shell-UTLWLG5G.js} +5 -5
  135. package/chunks/{skill-UWSSMXE7.js → skill-QQAZL4VO.js} +1 -1
  136. package/chunks/{skill-settings-T6MLB7NU.js → skill-settings-P3YHJVBZ.js} +10 -10
  137. package/chunks/{spawnChannel-VS7ZFUFP.js → spawnChannel-UAQMH6Y6.js} +5 -5
  138. package/chunks/{standalone-update-2W26SRRO.js → standalone-update-QP742MGP.js} +7 -7
  139. package/chunks/{startInteractiveUI-CVS7K3D6.js → startInteractiveUI-YCS6AEPN.js} +1209 -926
  140. package/chunks/{team-create-4WFTNNUL.js → team-create-WFH7OCDQ.js} +5 -5
  141. package/chunks/{team-plan-approval-DBYI33S3.js → team-plan-approval-EGTT53MV.js} +5 -5
  142. package/chunks/{terminal-image-renderer-S5WPPQKH.js → terminal-image-renderer-BWRESAQ7.js} +5 -5
  143. package/chunks/{theme-manager-LI2RIOVR.js → theme-manager-ZNDGAHJN.js} +5 -5
  144. package/chunks/{tool-search-4773EUQ4.js → tool-search-TI5PTIBF.js} +1 -1
  145. package/chunks/{total-session-admission-PAY5CH2Z.js → total-session-admission-66UDSOHO.js} +9 -9
  146. package/chunks/{trustedFolders-FRSLE674.js → trustedFolders-4KYHA4IG.js} +6 -6
  147. package/chunks/{update-relaunch-ZSFQTU6M.js → update-relaunch-WB6LGIF2.js} +5 -5
  148. package/chunks/{updateCheck-AXWSO7KA.js → updateCheck-LOS5GYFC.js} +8 -8
  149. package/chunks/{useAutoAcceptIndicator-VHLXIA7U.js → useAutoAcceptIndicator-MHAPY52L.js} +11 -11
  150. package/chunks/{validateNonInterActiveAuth-PDJECMFU.js → validateNonInterActiveAuth-QV22HNQU.js} +32 -32
  151. package/chunks/{version-RBN764QS.js → version-DALWZHKQ.js} +1 -1
  152. package/chunks/{web-fetch-7BJK42AF.js → web-fetch-JMJVMYFE.js} +1 -1
  153. package/chunks/{web-search-L2CILQXV.js → web-search-DNDUIPU5.js} +2 -2
  154. package/chunks/{workflow-5VH2R74I.js → workflow-JGNN64PM.js} +6 -6
  155. package/chunks/{workspace-providers-status-OZTQ6JFH.js → workspace-providers-status-K22B3Z6B.js} +13 -13
  156. package/chunks/{workspace-registration-store-IX5RJQS5.js → workspace-registration-store-LRJG7QA4.js} +1 -1
  157. package/chunks/{workspace-registry-73N4BGG4.js → workspace-registry-KVXIFM36.js} +9 -9
  158. package/chunks/{workspace-service-I5RUPSNV.js → workspace-service-PO4AAKKT.js} +15 -15
  159. package/chunks/{workspace-skills-status-DMK6VYDO.js → workspace-skills-status-DDYCBVSH.js} +11 -11
  160. package/chunks/{workspace-trust-reconciler-QX4RL3TC.js → workspace-trust-reconciler-DOZPCVHG.js} +15 -15
  161. package/chunks/{write-file-UGDD5UTS.js → write-file-TT6MWIKC.js} +5 -5
  162. package/chunks/{zoom-image-ZAHEO3YP.js → zoom-image-CNC77ZMA.js} +1 -1
  163. package/cli.js +13 -13
  164. package/package.json +3 -3
  165. package/web-shell/assets/{arc-CHY4saMJ.js → arc-CDk0d60K.js} +1 -1
  166. package/web-shell/assets/{architectureDiagram-3BPJPVTR-Bu6CwvHj.js → architectureDiagram-3BPJPVTR-h-W3I2lP.js} +1 -1
  167. package/web-shell/assets/{blockDiagram-GPEHLZMM-XGt6iGf_.js → blockDiagram-GPEHLZMM-D1pvSmZg.js} +1 -1
  168. package/web-shell/assets/{c4Diagram-AAUBKEIU-CBbYl19W.js → c4Diagram-AAUBKEIU-ByAm5ZNf.js} +1 -1
  169. package/web-shell/assets/channel-DPFUV4oi.js +1 -0
  170. package/web-shell/assets/{chunk-2J33WTMH-BEhmVrdx.js → chunk-2J33WTMH-VrGPPOGV.js} +1 -1
  171. package/web-shell/assets/{chunk-4BX2VUAB-fQLyE0Bg.js → chunk-4BX2VUAB-B7hTowgG.js} +1 -1
  172. package/web-shell/assets/{chunk-55IACEB6-yGdtyx4a.js → chunk-55IACEB6-j1Fq8DpE.js} +1 -1
  173. package/web-shell/assets/{chunk-727SXJPM-DYbX2GLo.js → chunk-727SXJPM-UjABYpF2.js} +1 -1
  174. package/web-shell/assets/{chunk-AQP2D5EJ-DyKTEsYn.js → chunk-AQP2D5EJ-D4uBItrs.js} +1 -1
  175. package/web-shell/assets/{chunk-FMBD7UC4-D8Uy_GzX.js → chunk-FMBD7UC4-DeFbKlb8.js} +1 -1
  176. package/web-shell/assets/{chunk-ND2GUHAM-C8wNR2K7.js → chunk-ND2GUHAM-rQJ8TIgT.js} +1 -1
  177. package/web-shell/assets/{chunk-QZHKN3VN-BnybNxnt.js → chunk-QZHKN3VN-DAGcRxvq.js} +1 -1
  178. package/web-shell/assets/classDiagram-4FO5ZUOK-CLm0hVvw.js +1 -0
  179. package/web-shell/assets/classDiagram-v2-Q7XG4LA2-CLm0hVvw.js +1 -0
  180. package/web-shell/assets/{cose-bilkent-S5V4N54A-jq4uiFRp.js → cose-bilkent-S5V4N54A-MaE7MJSt.js} +1 -1
  181. package/web-shell/assets/{dagre-BM42HDAG-Bs7oye1U.js → dagre-BM42HDAG-DzijYGSb.js} +1 -1
  182. package/web-shell/assets/{diagram-2AECGRRQ-BHGGJNyM.js → diagram-2AECGRRQ-WdbG7WnX.js} +1 -1
  183. package/web-shell/assets/{diagram-5GNKFQAL-BJezVLGT.js → diagram-5GNKFQAL-NYutsBnw.js} +1 -1
  184. package/web-shell/assets/{diagram-KO2AKTUF-5JzQN_rL.js → diagram-KO2AKTUF-Dqg0eBY0.js} +1 -1
  185. package/web-shell/assets/{diagram-LMA3HP47-BlPYOgY9.js → diagram-LMA3HP47-C7vRP2Lb.js} +1 -1
  186. package/web-shell/assets/{diagram-OG6HWLK6-CtMHEaFK.js → diagram-OG6HWLK6-B2sEPpPt.js} +1 -1
  187. package/web-shell/assets/{erDiagram-TEJ5UH35-CRNdq2AB.js → erDiagram-TEJ5UH35-a4zIbzm8.js} +1 -1
  188. package/web-shell/assets/{flowDiagram-I6XJVG4X-De1WwLzu.js → flowDiagram-I6XJVG4X-BK9y89ya.js} +1 -1
  189. package/web-shell/assets/{ganttDiagram-6RSMTGT7-YbWfL5Zn.js → ganttDiagram-6RSMTGT7-wUQTSNvV.js} +1 -1
  190. package/web-shell/assets/{gitGraphDiagram-PVQCEYII-DzCN8bmd.js → gitGraphDiagram-PVQCEYII-Dnzt4SAi.js} +1 -1
  191. package/web-shell/assets/{index-CocPvF9Q.js → index-BA3wUcKL.js} +1 -1
  192. package/web-shell/assets/{index-BDOGGGaN.css → index-BjC3yjjL.css} +2 -2
  193. package/web-shell/assets/index-QzFq6w7o.js +1775 -0
  194. package/web-shell/assets/{infoDiagram-5YYISTIA-DLHoopnE.js → infoDiagram-5YYISTIA-DcaoToij.js} +1 -1
  195. package/web-shell/assets/{ishikawaDiagram-YF4QCWOH-XnbU04SS.js → ishikawaDiagram-YF4QCWOH-DzduqhP2.js} +1 -1
  196. package/web-shell/assets/{journeyDiagram-JHISSGLW-CipPyEeJ.js → journeyDiagram-JHISSGLW-BvviZR_O.js} +1 -1
  197. package/web-shell/assets/{kanban-definition-UN3LZRKU-DrSeyE5d.js → kanban-definition-UN3LZRKU-Efm2JxY3.js} +1 -1
  198. package/web-shell/assets/{linear-LrBKnAo_.js → linear-DtY3IbOs.js} +1 -1
  199. package/web-shell/assets/{mermaid.core-C3U9UVmf.js → mermaid.core-PzpFqoMe.js} +5 -5
  200. package/web-shell/assets/{mindmap-definition-RKZ34NQL-DqRWgC9H.js → mindmap-definition-RKZ34NQL-BLlTkHS0.js} +1 -1
  201. package/web-shell/assets/{pieDiagram-4H26LBE5-BNXY5p6H.js → pieDiagram-4H26LBE5-D-mKF-jE.js} +1 -1
  202. package/web-shell/assets/{quadrantDiagram-W4KKPZXB-Ccj9QzE4.js → quadrantDiagram-W4KKPZXB-DYCzslGm.js} +1 -1
  203. package/web-shell/assets/{requirementDiagram-4Y6WPE33-CjPM2_gx.js → requirementDiagram-4Y6WPE33-Dfpxlk7R.js} +1 -1
  204. package/web-shell/assets/{sankeyDiagram-5OEKKPKP-C0RsvKbj.js → sankeyDiagram-5OEKKPKP-D5cRaaxh.js} +1 -1
  205. package/web-shell/assets/{sequenceDiagram-3UESZ5HK-ClN1P5z7.js → sequenceDiagram-3UESZ5HK-s04DReiS.js} +1 -1
  206. package/web-shell/assets/{stateDiagram-AJRCARHV-By0eiB2Y.js → stateDiagram-AJRCARHV-01UNFgnb.js} +1 -1
  207. package/web-shell/assets/stateDiagram-v2-BHNVJYJU-DXb5olqv.js +1 -0
  208. package/web-shell/assets/{timeline-definition-PNZ67QCA-g_iaSQgv.js → timeline-definition-PNZ67QCA-DX8_wZBC.js} +1 -1
  209. package/web-shell/assets/{vennDiagram-CIIHVFJN-y9ZqJ-TD.js → vennDiagram-CIIHVFJN-BK0FlBme.js} +1 -1
  210. package/web-shell/assets/{wardley-L42UT6IY-BVVfaxpF.js → wardley-L42UT6IY-DkPc9UlD.js} +1 -1
  211. package/web-shell/assets/{wardleyDiagram-YWT4CUSO-D3ooZKZT.js → wardleyDiagram-YWT4CUSO-DNKkpDAo.js} +1 -1
  212. package/web-shell/assets/{xychartDiagram-2RQKCTM6-6GXrY6M1.js → xychartDiagram-2RQKCTM6-CiPwg8QG.js} +1 -1
  213. package/web-shell/index.html +2 -2
  214. package/web-shell/assets/channel-B40srHOa.js +0 -1
  215. package/web-shell/assets/classDiagram-4FO5ZUOK-qumcXQW_.js +0 -1
  216. package/web-shell/assets/classDiagram-v2-Q7XG4LA2-qumcXQW_.js +0 -1
  217. package/web-shell/assets/index-DSH2KrMc.js +0 -1771
  218. package/web-shell/assets/stateDiagram-v2-BHNVJYJU-Ds0WlK3F.js +0 -1
@@ -26,7 +26,7 @@ import {
26
26
  shouldSuppressRememberErrorDetails,
27
27
  workspaceMemoryFailureCode,
28
28
  workspaceMemoryFailureDiagnostics
29
- } from "./chunk-FBMCDU63.js";
29
+ } from "./chunk-6LP743KE.js";
30
30
  import {
31
31
  SetupGithubError,
32
32
  collectSessionData,
@@ -38,12 +38,12 @@ import {
38
38
  toJson,
39
39
  toJsonl,
40
40
  toMarkdown
41
- } from "./chunk-P3RBMQ4P.js";
41
+ } from "./chunk-5MZCSWI4.js";
42
42
  import {
43
43
  OBSERVED_CONTACT_MAX_FRESH_WITHIN_SECONDS,
44
44
  ObservedChannelContactStore
45
45
  } from "./chunk-OWMAZHIX.js";
46
- import "./chunk-UYAUA63Q.js";
46
+ import "./chunk-ZRBMO3C7.js";
47
47
  import {
48
48
  escapeAnsiCtrlCodes
49
49
  } from "./chunk-4NFY2S7N.js";
@@ -107,7 +107,7 @@ import {
107
107
  setRateLimiter,
108
108
  unsafeRevealSecret,
109
109
  validateMcpRuntimeServerName
110
- } from "./chunk-KTKYGS2P.js";
110
+ } from "./chunk-ZZCWJWTF.js";
111
111
  import "./chunk-VGHZT6JR.js";
112
112
  import {
113
113
  isLoopbackBind,
@@ -128,14 +128,14 @@ import {
128
128
  validateWorkspaceSkillName,
129
129
  validateWorkspaceVoiceState,
130
130
  voiceSettingsScopeToWire
131
- } from "./chunk-46YJDYCU.js";
131
+ } from "./chunk-OCSFNUU4.js";
132
132
  import {
133
133
  PermissionRulesValidationError,
134
134
  buildPermissionSettings,
135
135
  isPermissionRuleType,
136
136
  normalizePermissionRules,
137
137
  readPermissionRuleSet
138
- } from "./chunk-BAMN6XSD.js";
138
+ } from "./chunk-Y3OVRWRY.js";
139
139
  import {
140
140
  assertVoiceBaseUrlNetworkAllowed,
141
141
  isStreamingVoiceModel,
@@ -143,21 +143,21 @@ import {
143
143
  resolveVoiceTranscriptionConfig,
144
144
  sanitizeVoiceErrorMessage,
145
145
  transcribeVoiceAudio
146
- } from "./chunk-RBHQXGDK.js";
146
+ } from "./chunk-LLCWZQCU.js";
147
147
  import {
148
148
  isVoiceEnabled,
149
149
  isVoiceMode,
150
150
  readVoiceModel
151
- } from "./chunk-GAKGOXTC.js";
151
+ } from "./chunk-EBZ6BJTF.js";
152
152
  import "./chunk-AOHJKPKL.js";
153
153
  import {
154
154
  createTotalSessionAdmissionController
155
- } from "./chunk-BT6GQIEJ.js";
155
+ } from "./chunk-X2UOOG5V.js";
156
156
  import {
157
157
  WorkspaceGenerationClosedError,
158
158
  createSingleWorkspaceRegistry,
159
159
  createWorkspaceSessionOwnerIndex
160
- } from "./chunk-CMOBWHWW.js";
160
+ } from "./chunk-QBJYSIQ4.js";
161
161
  import "./chunk-OIBUG24X.js";
162
162
  import {
163
163
  MAX_SESSION_RESTORE_TIMEOUT_MS,
@@ -166,26 +166,26 @@ import {
166
166
  } from "./chunk-4JRM2BSM.js";
167
167
  import {
168
168
  assertValidChannelSecretUpdates
169
- } from "./chunk-QSNSL4R4.js";
169
+ } from "./chunk-NRLFZWCT.js";
170
170
  import {
171
171
  createDaemonStatusProvider
172
- } from "./chunk-ZTQSOV56.js";
172
+ } from "./chunk-OONWZLFK.js";
173
173
  import "./chunk-NTTBXH7U.js";
174
- import "./chunk-7S4JBJLU.js";
174
+ import "./chunk-VSFKIRRW.js";
175
175
  import "./chunk-3SH53ANB.js";
176
176
  import {
177
177
  createWorkspaceProvidersStatusProvider
178
- } from "./chunk-3WDYBTTI.js";
178
+ } from "./chunk-QJMOAMXT.js";
179
179
  import {
180
180
  getAuthTypeFromEnv,
181
181
  resolveCliGenerationConfig
182
- } from "./chunk-KTQGGPGV.js";
182
+ } from "./chunk-2PLNY5TN.js";
183
183
  import {
184
184
  snapshotProcessEnv
185
- } from "./chunk-23VQTELM.js";
185
+ } from "./chunk-P3BJLFSZ.js";
186
186
  import {
187
187
  createWorkspaceSkillsStatusProvider
188
- } from "./chunk-ZBXGWQ4S.js";
188
+ } from "./chunk-VWKER4ZH.js";
189
189
  import "./chunk-BGXZBI5B.js";
190
190
  import "./chunk-Z4X5MTRT.js";
191
191
  import {
@@ -204,12 +204,12 @@ import {
204
204
  import {
205
205
  evaluateDaemonWorkspaceTrust,
206
206
  readDaemonTrustPolicySnapshot
207
- } from "./chunk-G2TX5ZXC.js";
207
+ } from "./chunk-47PEPJO7.js";
208
208
  import {
209
209
  daemonObservedContactsPath,
210
210
  loadChannelsConfig
211
- } from "./chunk-ATMO54WE.js";
212
- import "./chunk-HADWBW5R.js";
211
+ } from "./chunk-NEOXOWYH.js";
212
+ import "./chunk-UMD7WQTR.js";
213
213
  import "./chunk-57OAHC2Y.js";
214
214
  import {
215
215
  parseChannelWebhookConfigLenient
@@ -228,7 +228,7 @@ import {
228
228
  SessionArtifactValidationError,
229
229
  createAcpSessionBridge,
230
230
  parseSessionSource
231
- } from "./chunk-P4ZEZSJZ.js";
231
+ } from "./chunk-F24A2JBM.js";
232
232
  import {
233
233
  EVENT_SCHEMA_VERSION,
234
234
  EventBus,
@@ -254,11 +254,11 @@ import {
254
254
  WorkspaceRegistrationStoreLimitError,
255
255
  normalizeWorkspaceDisplayName,
256
256
  workspaceRegistrationId
257
- } from "./chunk-W3FSZSF2.js";
257
+ } from "./chunk-QGNOFE5E.js";
258
258
  import {
259
259
  REQUESTED_SESSION_ID_META_KEY,
260
260
  gradeActiveWorkCoverage
261
- } from "./chunk-M2PNLYGY.js";
261
+ } from "./chunk-W5UC37EE.js";
262
262
  import {
263
263
  BranchWhilePromptActiveError,
264
264
  BridgeChannelQuarantinedError,
@@ -292,7 +292,7 @@ import {
292
292
  WorkspaceInitRaceError,
293
293
  WorkspaceInitSymlinkError,
294
294
  WorkspaceMismatchError
295
- } from "./chunk-LP2QGNSP.js";
295
+ } from "./chunk-624NHDGB.js";
296
296
  import {
297
297
  MAX_WORKSPACE_PATH_LENGTH,
298
298
  canonicalizeWorkspace,
@@ -334,26 +334,26 @@ import {
334
334
  getWritableScopes,
335
335
  loadSettings,
336
336
  validateSettingValue
337
- } from "./chunk-JUWS2Z5K.js";
338
- import "./chunk-7GOYZQPR.js";
337
+ } from "./chunk-ABVRJU3D.js";
338
+ import "./chunk-UBX6NL47.js";
339
339
  import "./chunk-RKUWKYED.js";
340
340
  import "./chunk-GOXKNSDZ.js";
341
341
  import "./chunk-IDS7MSUP.js";
342
342
  import {
343
343
  detectSystemLanguage,
344
344
  resolveLanguageSetting
345
- } from "./chunk-WP5VOXF7.js";
345
+ } from "./chunk-UEOKWYGY.js";
346
346
  import {
347
347
  SUPPORTED_LANGUAGES,
348
348
  resolveSupportedLanguage
349
349
  } from "./chunk-5EJZE3FP.js";
350
- import "./chunk-T6HEQR2Q.js";
350
+ import "./chunk-ZJ4W6SUY.js";
351
351
  import "./chunk-VFMASYQA.js";
352
- import "./chunk-IOEZE2YT.js";
352
+ import "./chunk-AEL7KN2O.js";
353
353
  import "./chunk-VJNBRRZG.js";
354
354
  import {
355
355
  getWorkspaceTrustStatus
356
- } from "./chunk-ZOSTTOUJ.js";
356
+ } from "./chunk-GWVUR3QZ.js";
357
357
  import "./chunk-NPQ5ZKRP.js";
358
358
  import {
359
359
  isWithinRoot as isWithinRoot2
@@ -433,7 +433,7 @@ import {
433
433
  writeWorkspaceContextFile,
434
434
  writeWorktreeSession,
435
435
  writeWorktreeSessionMarker
436
- } from "./chunk-XX7QFP34.js";
436
+ } from "./chunk-EI3NWELG.js";
437
437
  import "./chunk-GOFAQQZA.js";
438
438
  import "./chunk-5M6IDOMF.js";
439
439
  import "./chunk-TWPJO254.js";
@@ -446,7 +446,7 @@ import "./chunk-MVUQRLOH.js";
446
446
  import "./chunk-XCWO3SMQ.js";
447
447
  import "./chunk-7MH4J33A.js";
448
448
  import "./chunk-6PVPNMXU.js";
449
- import "./chunk-K4ADGWHU.js";
449
+ import "./chunk-TRRF5BSP.js";
450
450
  import {
451
451
  nextFireTime,
452
452
  parseCron
@@ -470,7 +470,7 @@ import "./chunk-KRXPRVGL.js";
470
470
  import "./chunk-GM463R2B.js";
471
471
  import "./chunk-SEZ556DZ.js";
472
472
  import "./chunk-2FRY5CRX.js";
473
- import "./chunk-67N6HB5H.js";
473
+ import "./chunk-QUI267ZP.js";
474
474
  import {
475
475
  APPROVAL_MODES
476
476
  } from "./chunk-WAUGQKUU.js";
@@ -515,7 +515,7 @@ import "./chunk-4PYCZH2V.js";
515
515
  import "./chunk-P3QQPMQA.js";
516
516
  import "./chunk-SR7RZ4MS.js";
517
517
  import "./chunk-M6HMMKVG.js";
518
- import "./chunk-DGEIYUC3.js";
518
+ import "./chunk-KM73TBQ4.js";
519
519
  import "./chunk-MPHPFVKK.js";
520
520
  import "./chunk-AXMWHKXA.js";
521
521
  import "./chunk-GLCZKT5V.js";
@@ -540,7 +540,7 @@ import "./chunk-FVKHVJZQ.js";
540
540
  import "./chunk-COBO5EBO.js";
541
541
  import "./chunk-6ZRFAKXK.js";
542
542
  import "./chunk-PYQADEFD.js";
543
- import "./chunk-PVOGHGSF.js";
543
+ import "./chunk-Y4R47ZUH.js";
544
544
  import "./chunk-F6WFNA7U.js";
545
545
  import "./chunk-46UV252V.js";
546
546
  import "./chunk-ZBVS26BY.js";
@@ -1200,11 +1200,11 @@ function decodeTextCursor(cursor) {
1200
1200
  return { off, size, dev, ino };
1201
1201
  }
1202
1202
  __name(decodeTextCursor, "decodeTextCursor");
1203
- function assertCursorMatchesFile(cursor, stats, path15) {
1203
+ function assertCursorMatchesFile(cursor, stats, path16) {
1204
1204
  if (String(stats.dev) !== cursor.dev || String(stats.ino) !== cursor.ino || stats.size < cursor.size) {
1205
1205
  throw new FsError(
1206
1206
  "hash_mismatch",
1207
- `cursor no longer matches the file it was issued for: ${path15}`,
1207
+ `cursor no longer matches the file it was issued for: ${path16}`,
1208
1208
  { hint: "re-read the file from the beginning to get a fresh cursor" }
1209
1209
  );
1210
1210
  }
@@ -8620,6 +8620,7 @@ var MAX_NAME_LENGTH = 256;
8620
8620
  var DEFAULT_FILE_GLOB_MAX_RESULTS = 5e3;
8621
8621
  var MAX_FILE_GLOB_MAX_RESULTS = 5e4;
8622
8622
  var MAX_FILE_LINE_LIMIT2 = 2e3;
8623
+ var HTTP_ACP_CONFIG_OPTION_IDS = ["model", "mode"];
8623
8624
  var AcpParamError = class extends Error {
8624
8625
  static {
8625
8626
  __name(this, "AcpParamError");
@@ -9075,6 +9076,20 @@ var AcpDispatcher = class {
9075
9076
  __name(this, "AcpDispatcher");
9076
9077
  }
9077
9078
  agentManager;
9079
+ invalidateSessionLists(archiveStates) {
9080
+ invalidateWorkspaceSessionListCache({
9081
+ runtimeBaseDir: this.sessionRuntimeBaseDir,
9082
+ workspaceCwd: this.boundWorkspace,
9083
+ archiveStates
9084
+ });
9085
+ }
9086
+ async runWithSessionListInvalidation(archiveStates, mutation) {
9087
+ try {
9088
+ return await mutation();
9089
+ } finally {
9090
+ this.invalidateSessionLists(archiveStates);
9091
+ }
9092
+ }
9078
9093
  removeOrphanSession(sessionId, removePersistedSession = false, runtime = this.getSessionRuntimeContext()) {
9079
9094
  const cleanup = removePersistedSession ? deleteDaemonSessionIfOrphan({
9080
9095
  sessionId,
@@ -9192,15 +9207,22 @@ var AcpDispatcher = class {
9192
9207
  return { clientId, fromLoopback };
9193
9208
  }
9194
9209
  /**
9195
- * The session's ACP-shaped config options (model/mode/…), read from the
9196
- * child's own session state. Returned in `session/new` and as the result
9197
- * of `session/set_config_option`. Best-effort `undefined` on error.
9210
+ * The session's ACP-shaped config options supported by this HTTP transport
9211
+ * (currently model and mode), read from the child's own session state.
9212
+ * Every response built from this helper (`session/new`,
9213
+ * `session/load`/`session/resume`, `session/fork`, and the
9214
+ * `session/set_config_option` result) is gated to the ids the transport
9215
+ * can route. Raw-state surfaces (context status, REST load/resume state)
9216
+ * intentionally carry the child's full unfiltered set — they report session
9217
+ * state. Best-effort — `undefined` on error.
9198
9218
  */
9199
9219
  async configOptionsFor(sessionId, bridge = this.bridge) {
9200
9220
  try {
9201
9221
  const ctx = await bridge.getSessionContextStatus(sessionId);
9202
9222
  const co = ctx?.state?.configOptions;
9203
- return Array.isArray(co) ? co : void 0;
9223
+ return Array.isArray(co) ? co.filter(
9224
+ (option) => isObject(option) && HTTP_ACP_CONFIG_OPTION_IDS.includes(option["id"])
9225
+ ) : void 0;
9204
9226
  } catch (err) {
9205
9227
  writeStderrLine(
9206
9228
  `qwen serve: /acp configOptionsFor(${logSafe(sessionId)}) failed: ${logSafe(errMsg(err))}`
@@ -9828,7 +9850,8 @@ var AcpDispatcher = class {
9828
9850
  group,
9829
9851
  parentSessionId,
9830
9852
  ...parsedSource
9831
- }
9853
+ },
9854
+ { runtimeBaseDir: this.sessionRuntimeBaseDir }
9832
9855
  );
9833
9856
  this.replyConn(conn, id, {
9834
9857
  sessions: result.sessions.map((s) => ({
@@ -9912,6 +9935,7 @@ var AcpDispatcher = class {
9912
9935
  throw err;
9913
9936
  } finally {
9914
9937
  conn.closingSessions.delete(sessionId);
9938
+ this.invalidateSessionLists(["active"]);
9915
9939
  }
9916
9940
  closeLocalSessionStream();
9917
9941
  this.replyConn(conn, id, {});
@@ -10267,7 +10291,7 @@ var AcpDispatcher = class {
10267
10291
  error(
10268
10292
  id,
10269
10293
  RPC.INVALID_PARAMS,
10270
- `Unknown configId: ${configId}`
10294
+ `ConfigId not supported by this transport: ${configId} (supported: ${HTTP_ACP_CONFIG_OPTION_IDS.join(", ")})`
10271
10295
  )
10272
10296
  );
10273
10297
  }
@@ -10388,11 +10412,16 @@ var AcpDispatcher = class {
10388
10412
  const sessionId = String(params["sessionId"] ?? "");
10389
10413
  await this.withMutableOwned(conn, sessionId, id, async () => {
10390
10414
  const metadata = isObject(params["metadata"]) ? params["metadata"] : {};
10391
- const result = this.bridge.updateSessionMetadata(
10392
- sessionId,
10393
- metadata,
10394
- this.sessionCtx(conn, sessionId, loopback)
10395
- );
10415
+ let result;
10416
+ try {
10417
+ result = this.bridge.updateSessionMetadata(
10418
+ sessionId,
10419
+ metadata,
10420
+ this.sessionCtx(conn, sessionId, loopback)
10421
+ );
10422
+ } finally {
10423
+ this.invalidateSessionLists(["active"]);
10424
+ }
10396
10425
  this.replyConn(conn, id, result);
10397
10426
  });
10398
10427
  return;
@@ -11914,19 +11943,22 @@ var AcpDispatcher = class {
11914
11943
  const ids = this.parseSessionIds(params);
11915
11944
  if (this.rejectActiveLiveSessionMutation(conn, id, ids)) return;
11916
11945
  const svc = new SessionService(this.boundWorkspace);
11917
- const result = await deleteDaemonSessions({
11918
- sessionIds: ids,
11919
- service: svc,
11920
- bridge: this.bridge,
11921
- coordinator: this.archiveCoordinator,
11922
- onError: /* @__PURE__ */ __name(({ phase, sessionId, error: error2 }) => {
11923
- const safeSessionId = logSafe(sessionId.slice(0, 8));
11924
- const safeMessage = logSafe(error2);
11925
- writeStderrLine(
11926
- `qwen serve: /acp sessions/delete ${phase}Session(${safeSessionId}) failed: ${safeMessage}`
11927
- );
11928
- }, "onError")
11929
- });
11946
+ const result = await this.runWithSessionListInvalidation(
11947
+ ["active", "archived"],
11948
+ () => deleteDaemonSessions({
11949
+ sessionIds: ids,
11950
+ service: svc,
11951
+ bridge: this.bridge,
11952
+ coordinator: this.archiveCoordinator,
11953
+ onError: /* @__PURE__ */ __name(({ phase, sessionId, error: error2 }) => {
11954
+ const safeSessionId = logSafe(sessionId.slice(0, 8));
11955
+ const safeMessage = logSafe(error2);
11956
+ writeStderrLine(
11957
+ `qwen serve: /acp sessions/delete ${phase}Session(${safeSessionId}) failed: ${safeMessage}`
11958
+ );
11959
+ }, "onError")
11960
+ })
11961
+ );
11930
11962
  this.replyConn(conn, id, result);
11931
11963
  return;
11932
11964
  }
@@ -11936,12 +11968,15 @@ var AcpDispatcher = class {
11936
11968
  const svc = new SessionService(this.boundWorkspace, {
11937
11969
  onWarning: logSessionArchiveWarning
11938
11970
  });
11939
- const result = await archiveDaemonSessions({
11940
- sessionIds: ids,
11941
- service: svc,
11942
- bridge: this.bridge,
11943
- coordinator: this.archiveCoordinator
11944
- });
11971
+ const result = await this.runWithSessionListInvalidation(
11972
+ ["active", "archived"],
11973
+ () => archiveDaemonSessions({
11974
+ sessionIds: ids,
11975
+ service: svc,
11976
+ bridge: this.bridge,
11977
+ coordinator: this.archiveCoordinator
11978
+ })
11979
+ );
11945
11980
  this.replyConn(conn, id, {
11946
11981
  archived: result.archived,
11947
11982
  alreadyArchived: result.alreadyArchived,
@@ -11955,11 +11990,14 @@ var AcpDispatcher = class {
11955
11990
  const svc = new SessionService(this.boundWorkspace, {
11956
11991
  onWarning: logSessionArchiveWarning
11957
11992
  });
11958
- const result = await unarchiveDaemonSessions({
11959
- sessionIds: ids,
11960
- service: svc,
11961
- coordinator: this.archiveCoordinator
11962
- });
11993
+ const result = await this.runWithSessionListInvalidation(
11994
+ ["active", "archived"],
11995
+ () => unarchiveDaemonSessions({
11996
+ sessionIds: ids,
11997
+ service: svc,
11998
+ coordinator: this.archiveCoordinator
11999
+ })
12000
+ );
11963
12001
  this.replyConn(conn, id, {
11964
12002
  unarchived: result.unarchived,
11965
12003
  alreadyActive: result.alreadyActive,
@@ -14532,7 +14570,7 @@ function mountAcpHttp(app, bridge, opts) {
14532
14570
  const archiveCoordinator = opts.archiveCoordinator ?? new SessionArchiveCoordinator();
14533
14571
  const requestedSessionIdAdmission = opts.requestedSessionIdAdmission;
14534
14572
  const getPrimaryEnv = /* @__PURE__ */ __name(() => opts.workspaceRegistry ? runtimeEffectiveEnv(opts.workspaceRegistry.primary, daemonEnv) : daemonEnv, "getPrimaryEnv");
14535
- const path15 = opts.path ?? "/acp";
14573
+ const path16 = opts.path ?? "/acp";
14536
14574
  const dispatcherRef = {};
14537
14575
  let disposed = false;
14538
14576
  const rejectIfDisposed = /* @__PURE__ */ __name((res) => {
@@ -14716,7 +14754,7 @@ function mountAcpHttp(app, bridge, opts) {
14716
14754
  const primaryMount = {
14717
14755
  primary: true,
14718
14756
  workspaceCwd: opts.boundWorkspace,
14719
- routeLabel: logSafe(path15),
14757
+ routeLabel: logSafe(path16),
14720
14758
  rateLimitScope: opts.workspaceRegistry?.primary.workspaceId ?? "primary",
14721
14759
  registry,
14722
14760
  dispatcher,
@@ -14870,7 +14908,7 @@ function mountAcpHttp(app, bridge, opts) {
14870
14908
  });
14871
14909
  }, "handleAcpPost");
14872
14910
  app.post(
14873
- path15,
14911
+ path16,
14874
14912
  (req, res) => handleAcpPost(primaryMount, req, res)
14875
14913
  );
14876
14914
  const handleAcpGet = /* @__PURE__ */ __name((mount, req, res) => {
@@ -14969,10 +15007,10 @@ function mountAcpHttp(app, bridge, opts) {
14969
15007
  onPumpSettled();
14970
15008
  });
14971
15009
  }, "handleAcpGet");
14972
- app.get(path15, (req, res) => {
15010
+ app.get(path16, (req, res) => {
14973
15011
  handleAcpGet(primaryMount, req, res);
14974
15012
  });
14975
- app.delete(path15, (req, res) => {
15013
+ app.delete(path16, (req, res) => {
14976
15014
  handleAcpDelete(primaryMount, req, res);
14977
15015
  });
14978
15016
  const createSecondaryAcpMount = /* @__PURE__ */ __name((rt) => {
@@ -15181,7 +15219,7 @@ function mountAcpHttp(app, bridge, opts) {
15181
15219
  const isPluralAcpShape = pluralRawSelector !== null;
15182
15220
  const pluralVoiceRawSelector = opts.workspaceVoiceConnection ? pluralWorkspaceRawSelector(rawPath, PLURAL_VOICE_WS_SUFFIX) : null;
15183
15221
  const isPluralVoiceShape = pluralVoiceRawSelector !== null;
15184
- if (rawPath !== path15 && !isCdpPath && !extraRoute && !isPluralAcpShape && !isPluralVoiceShape) {
15222
+ if (rawPath !== path16 && !isCdpPath && !extraRoute && !isPluralAcpShape && !isPluralVoiceShape) {
15185
15223
  logReject(`unknown-path ${logSafe(rawPath)}`);
15186
15224
  socket.destroy();
15187
15225
  return;
@@ -15719,7 +15757,7 @@ function mountAcpHttp(app, bridge, opts) {
15719
15757
  });
15720
15758
  }, "upgradeListener");
15721
15759
  httpServer.on("upgrade", upgradeListener);
15722
- writeStderrLine(`qwen serve: /acp WebSocket transport enabled on ${path15}`);
15760
+ writeStderrLine(`qwen serve: /acp WebSocket transport enabled on ${path16}`);
15723
15761
  }
15724
15762
  __name(setupWebSocket, "setupWebSocket");
15725
15763
  return {
@@ -20404,6 +20442,12 @@ var legacySessionTelemetryRoutes = [
20404
20442
  attribution: "handler_resolved",
20405
20443
  route: "DELETE /session/:id/mid-turn-messages/:messageId"
20406
20444
  },
20445
+ {
20446
+ method: "GET",
20447
+ path: "/session/:id/mid-turn-messages",
20448
+ attribution: "handler_resolved",
20449
+ route: "GET /session/:id/mid-turn-messages"
20450
+ },
20407
20451
  {
20408
20452
  method: "GET",
20409
20453
  path: "/session/:id/pending-prompts",
@@ -20481,8 +20525,8 @@ function decodePathSegment(value) {
20481
20525
  }
20482
20526
  __name(decodePathSegment, "decodePathSegment");
20483
20527
  function matchLegacySessionTelemetryRoute(method, requestPath) {
20484
- const path15 = requestPath.length > 1 && requestPath.endsWith("/") ? requestPath.slice(0, -1) : requestPath;
20485
- const requestSegments = path15.split("/").slice(1);
20528
+ const path16 = requestPath.length > 1 && requestPath.endsWith("/") ? requestPath.slice(0, -1) : requestPath;
20529
+ const requestSegments = path16.split("/").slice(1);
20486
20530
  const prefix = requestSegments[0]?.toLowerCase();
20487
20531
  if (prefix !== "session" && prefix !== "sessions" && prefix !== "permission") {
20488
20532
  return void 0;
@@ -20534,23 +20578,23 @@ __name(setDaemonTelemetryWorkspace, "setDaemonTelemetryWorkspace");
20534
20578
  function resolveDaemonTelemetryRoute(req) {
20535
20579
  const legacyRoute = matchLegacySessionTelemetryRoute(req.method, req.path);
20536
20580
  if (legacyRoute) return legacyRoute;
20537
- const path15 = req.path.replace(/\/$/, "") || "/";
20538
- if (req.method === "GET" && path15 === "/daemon/status") {
20581
+ const path16 = req.path.replace(/\/$/, "") || "/";
20582
+ if (req.method === "GET" && path16 === "/daemon/status") {
20539
20583
  return { route: "GET /daemon/status" };
20540
20584
  }
20541
- if (req.method === "GET" && /^\/workspace\/[^/]+\/sessions$/.test(path15)) {
20585
+ if (req.method === "GET" && /^\/workspace\/[^/]+\/sessions$/.test(path16)) {
20542
20586
  return { route: "GET /workspace/:id/sessions" };
20543
20587
  }
20544
- if (req.method === "GET" && /^\/workspaces\/[^/]+\/sessions$/.test(path15)) {
20588
+ if (req.method === "GET" && /^\/workspaces\/[^/]+\/sessions$/.test(path16)) {
20545
20589
  return { route: "GET /workspace/:id/sessions" };
20546
20590
  }
20547
- if (req.method === "GET" && /^\/workspace\/[^/]+\/session-info$/.test(path15)) {
20591
+ if (req.method === "GET" && /^\/workspace\/[^/]+\/session-info$/.test(path16)) {
20548
20592
  return { route: "GET /workspace/:id/session-info" };
20549
20593
  }
20550
- if (req.method === "GET" && /^\/workspaces\/[^/]+\/session-info$/.test(path15)) {
20594
+ if (req.method === "GET" && /^\/workspaces\/[^/]+\/session-info$/.test(path16)) {
20551
20595
  return { route: "GET /workspace/:id/session-info" };
20552
20596
  }
20553
- const workspaceTranscript = path15.match(
20597
+ const workspaceTranscript = path16.match(
20554
20598
  /^\/workspaces\/[^/]+\/session\/([^/]+)\/transcript$/
20555
20599
  );
20556
20600
  if (workspaceTranscript?.[1] && req.method === "GET") {
@@ -20559,7 +20603,7 @@ function resolveDaemonTelemetryRoute(req) {
20559
20603
  sessionId: decodePathSegment(workspaceTranscript[1])
20560
20604
  };
20561
20605
  }
20562
- const workspaceExport = path15.match(
20606
+ const workspaceExport = path16.match(
20563
20607
  /^\/workspaces\/[^/]+\/session\/([^/]+)\/export$/
20564
20608
  );
20565
20609
  if (workspaceExport?.[1] && req.method === "GET") {
@@ -20568,7 +20612,7 @@ function resolveDaemonTelemetryRoute(req) {
20568
20612
  sessionId: decodePathSegment(workspaceExport[1])
20569
20613
  };
20570
20614
  }
20571
- const workspaceArchivedExport = path15.match(
20615
+ const workspaceArchivedExport = path16.match(
20572
20616
  /^\/workspaces\/[^/]+\/session\/([^/]+)\/archive\/export$/
20573
20617
  );
20574
20618
  if (workspaceArchivedExport?.[1] && req.method === "GET") {
@@ -20578,8 +20622,8 @@ function resolveDaemonTelemetryRoute(req) {
20578
20622
  };
20579
20623
  }
20580
20624
  const pluralWorkspacePrefix = /^\/workspaces\/[^/]+/;
20581
- if (pluralWorkspacePrefix.test(path15)) {
20582
- const suffix = path15.replace(pluralWorkspacePrefix, "/workspace");
20625
+ if (pluralWorkspacePrefix.test(path16)) {
20626
+ const suffix = path16.replace(pluralWorkspacePrefix, "/workspace");
20583
20627
  if (req.method === "GET") {
20584
20628
  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") {
20585
20629
  return { route: `GET ${suffix}` };
@@ -20638,58 +20682,58 @@ function resolveDaemonTelemetryRoute(req) {
20638
20682
  return { route: "DELETE /workspace/session-groups/:groupId" };
20639
20683
  }
20640
20684
  }
20641
- if (req.method === "POST" && path15 === "/workspace/init") {
20685
+ if (req.method === "POST" && path16 === "/workspace/init") {
20642
20686
  return { route: "POST /workspace/init" };
20643
20687
  }
20644
- if (req.method === "POST" && path15 === "/workspace/setup-github") {
20688
+ if (req.method === "POST" && path16 === "/workspace/setup-github") {
20645
20689
  return { route: "POST /workspace/setup-github" };
20646
20690
  }
20647
- if (req.method === "POST" && path15 === "/workspace/reload") {
20691
+ if (req.method === "POST" && path16 === "/workspace/reload") {
20648
20692
  return { route: "POST /workspace/reload" };
20649
20693
  }
20650
- const mcpRestart = path15.match(/^\/workspace\/mcp\/([^/]+)\/restart$/);
20694
+ const mcpRestart = path16.match(/^\/workspace\/mcp\/([^/]+)\/restart$/);
20651
20695
  if (mcpRestart?.[1] && req.method === "POST") {
20652
20696
  return { route: "POST /workspace/mcp/:server/restart" };
20653
20697
  }
20654
- if (req.method === "POST" && path15 === "/workspace/mcp/servers") {
20698
+ if (req.method === "POST" && path16 === "/workspace/mcp/servers") {
20655
20699
  return { route: "POST /workspace/mcp/servers" };
20656
20700
  }
20657
- const mcpDelete = path15.match(/^\/workspace\/mcp\/servers\/([^/]+)$/);
20701
+ const mcpDelete = path16.match(/^\/workspace\/mcp\/servers\/([^/]+)$/);
20658
20702
  if (mcpDelete?.[1] && req.method === "DELETE") {
20659
20703
  return { route: "DELETE /workspace/mcp/servers/:name" };
20660
20704
  }
20661
- if (req.method === "POST" && path15 === "/workspace/auth/device-flow") {
20705
+ if (req.method === "POST" && path16 === "/workspace/auth/device-flow") {
20662
20706
  return { route: "POST /workspace/auth/device-flow" };
20663
20707
  }
20664
- const deviceFlowDelete = path15.match(
20708
+ const deviceFlowDelete = path16.match(
20665
20709
  /^\/workspace\/auth\/device-flow\/([^/]+)$/
20666
20710
  );
20667
20711
  if (deviceFlowDelete?.[1] && req.method === "DELETE") {
20668
20712
  return { route: "DELETE /workspace/auth/device-flow/:id" };
20669
20713
  }
20670
- const toolEnable = path15.match(/^\/workspace\/tools\/([^/]+)\/enable$/);
20714
+ const toolEnable = path16.match(/^\/workspace\/tools\/([^/]+)\/enable$/);
20671
20715
  if (toolEnable?.[1] && req.method === "POST") {
20672
20716
  return { route: "POST /workspace/tools/:name/enable" };
20673
20717
  }
20674
- if (path15 === "/workspace/settings") {
20718
+ if (path16 === "/workspace/settings") {
20675
20719
  if (req.method === "GET") return { route: "GET /workspace/settings" };
20676
20720
  if (req.method === "POST") return { route: "POST /workspace/settings" };
20677
20721
  }
20678
- if (path15 === "/workspace/permissions") {
20722
+ if (path16 === "/workspace/permissions") {
20679
20723
  if (req.method === "GET") return { route: "GET /workspace/permissions" };
20680
20724
  if (req.method === "POST") return { route: "POST /workspace/permissions" };
20681
20725
  }
20682
- if (path15 === "/workspace/trust") {
20726
+ if (path16 === "/workspace/trust") {
20683
20727
  if (req.method === "GET") return { route: "GET /workspace/trust" };
20684
20728
  }
20685
- if (req.method === "POST" && path15 === "/workspace/trust/request") {
20729
+ if (req.method === "POST" && path16 === "/workspace/trust/request") {
20686
20730
  return { route: "POST /workspace/trust/request" };
20687
20731
  }
20688
- if (path15 === "/workspace/voice") {
20732
+ if (path16 === "/workspace/voice") {
20689
20733
  if (req.method === "GET") return { route: "GET /workspace/voice" };
20690
20734
  if (req.method === "POST") return { route: "POST /workspace/voice" };
20691
20735
  }
20692
- if (req.method === "POST" && path15 === "/workspace/voice/transcribe") {
20736
+ if (req.method === "POST" && path16 === "/workspace/voice/transcribe") {
20693
20737
  return { route: "POST /workspace/voice/transcribe" };
20694
20738
  }
20695
20739
  return void 0;
@@ -20958,7 +21002,7 @@ __name(registerPermissionRoutes, "registerPermissionRoutes");
20958
21002
  init_esbuild_shims();
20959
21003
  import * as crypto3 from "node:crypto";
20960
21004
  import * as fs6 from "node:fs";
20961
- import * as path10 from "node:path";
21005
+ import * as path11 from "node:path";
20962
21006
 
20963
21007
  // packages/cli/src/serve/server/prompt-deadline.ts
20964
21008
  init_esbuild_shims();
@@ -20975,9 +21019,151 @@ __name(resolvePromptDeadlineMs, "resolvePromptDeadlineMs");
20975
21019
 
20976
21020
  // packages/cli/src/serve/server/session-list.ts
20977
21021
  init_esbuild_shims();
21022
+
21023
+ // packages/cli/src/serve/server/persisted-session-list-cache.ts
21024
+ init_esbuild_shims();
21025
+ import path10 from "node:path";
21026
+ var PersistedSessionListCache = class {
21027
+ constructor(ttlMs, maxRetainedSummaries) {
21028
+ this.ttlMs = ttlMs;
21029
+ this.maxRetainedSummaries = maxRetainedSummaries;
21030
+ }
21031
+ static {
21032
+ __name(this, "PersistedSessionListCache");
21033
+ }
21034
+ slots = /* @__PURE__ */ new Map();
21035
+ retainedSummaries = 0;
21036
+ lookup(scope, loader) {
21037
+ const key = this.key(scope);
21038
+ let slot = this.slots.get(key);
21039
+ if (!slot) {
21040
+ slot = { generation: 0 };
21041
+ this.slots.set(key, slot);
21042
+ }
21043
+ const now = Date.now();
21044
+ if (slot.value) {
21045
+ const cacheAgeMs = Math.max(0, now - slot.value.completedAt);
21046
+ if (cacheAgeMs < this.ttlMs) {
21047
+ return {
21048
+ status: "cache_hit",
21049
+ promise: Promise.resolve(slot.value.snapshot),
21050
+ cacheAgeMs
21051
+ };
21052
+ }
21053
+ this.removeValue(slot);
21054
+ }
21055
+ if (slot.inFlight !== void 0 && slot.inFlight.generation === slot.generation) {
21056
+ return {
21057
+ status: "single_flight",
21058
+ promise: slot.inFlight.promise
21059
+ };
21060
+ }
21061
+ const generation = slot.generation;
21062
+ const managed = Promise.resolve().then(loader).then(
21063
+ (snapshot) => {
21064
+ const current = this.slots.get(key);
21065
+ if (current === slot && current.inFlight?.promise === managed) {
21066
+ current.inFlight = void 0;
21067
+ if (current.generation === generation && snapshot.sessions.length <= this.maxRetainedSummaries) {
21068
+ this.installValue(key, current, snapshot);
21069
+ } else if (current.value === void 0) {
21070
+ this.slots.delete(key);
21071
+ }
21072
+ }
21073
+ return snapshot;
21074
+ },
21075
+ (error2) => {
21076
+ const current = this.slots.get(key);
21077
+ if (current === slot && current.inFlight?.promise === managed) {
21078
+ current.inFlight = void 0;
21079
+ if (current.value === void 0) this.slots.delete(key);
21080
+ }
21081
+ throw error2;
21082
+ }
21083
+ );
21084
+ slot.inFlight = { generation, promise: managed };
21085
+ return { status: "scan", promise: managed };
21086
+ }
21087
+ invalidate(scope) {
21088
+ const key = this.key(scope);
21089
+ const slot = this.slots.get(key);
21090
+ if (!slot) return;
21091
+ slot.generation += 1;
21092
+ this.removeValue(slot);
21093
+ if (slot.inFlight === void 0) this.slots.delete(key);
21094
+ }
21095
+ clear() {
21096
+ for (const slot of this.slots.values()) {
21097
+ if (slot.value) clearTimeout(slot.value.expiryTimer);
21098
+ }
21099
+ this.slots.clear();
21100
+ this.retainedSummaries = 0;
21101
+ }
21102
+ installValue(key, slot, snapshot) {
21103
+ const completedAt = Date.now();
21104
+ this.evictFor(snapshot.sessions.length);
21105
+ const remainingTtlMs = Math.max(0, this.ttlMs - (Date.now() - completedAt));
21106
+ const expiryTimer = setTimeout(() => {
21107
+ const current = this.slots.get(key);
21108
+ if (current !== slot || current.value?.expiryTimer !== expiryTimer) {
21109
+ return;
21110
+ }
21111
+ this.removeValue(current);
21112
+ if (current.inFlight === void 0) this.slots.delete(key);
21113
+ }, remainingTtlMs);
21114
+ if (typeof expiryTimer.unref === "function") expiryTimer.unref();
21115
+ const value = { snapshot, completedAt, expiryTimer };
21116
+ slot.value = value;
21117
+ this.retainedSummaries += snapshot.sessions.length;
21118
+ }
21119
+ evictFor(incomingSummaries) {
21120
+ while (this.retainedSummaries + incomingSummaries > this.maxRetainedSummaries) {
21121
+ let oldest;
21122
+ for (const [key, slot] of this.slots) {
21123
+ if (slot.value && (oldest === void 0 || slot.value.completedAt < oldest.completedAt)) {
21124
+ oldest = { key, slot, completedAt: slot.value.completedAt };
21125
+ }
21126
+ }
21127
+ if (!oldest) return;
21128
+ this.removeValue(oldest.slot);
21129
+ if (oldest.slot.inFlight === void 0) this.slots.delete(oldest.key);
21130
+ }
21131
+ }
21132
+ removeValue(slot) {
21133
+ const value = slot.value;
21134
+ if (!value) return;
21135
+ clearTimeout(value.expiryTimer);
21136
+ this.retainedSummaries -= value.snapshot.sessions.length;
21137
+ slot.value = void 0;
21138
+ }
21139
+ key(scope) {
21140
+ return JSON.stringify([
21141
+ path10.resolve(scope.runtimeBaseDir),
21142
+ scope.workspaceCwd,
21143
+ scope.archiveState
21144
+ ]);
21145
+ }
21146
+ };
21147
+
21148
+ // packages/cli/src/serve/server/session-list.ts
20978
21149
  var DEFAULT_SESSION_PAGE_SIZE = 20;
20979
21150
  var MAX_SESSION_PAGE_SIZE = 100;
20980
21151
  var MAX_ORGANIZED_SESSIONS = 5e4;
21152
+ var PERSISTED_SESSION_LIST_CACHE_TTL_MS = 2e3;
21153
+ var persistedSessionListCache = new PersistedSessionListCache(
21154
+ PERSISTED_SESSION_LIST_CACHE_TTL_MS,
21155
+ MAX_ORGANIZED_SESSIONS
21156
+ );
21157
+ function invalidateWorkspaceSessionListCache(options) {
21158
+ for (const archiveState of options.archiveStates) {
21159
+ persistedSessionListCache.invalidate({
21160
+ runtimeBaseDir: options.runtimeBaseDir,
21161
+ workspaceCwd: options.workspaceCwd,
21162
+ archiveState
21163
+ });
21164
+ }
21165
+ }
21166
+ __name(invalidateWorkspaceSessionListCache, "invalidateWorkspaceSessionListCache");
20981
21167
  var InvalidCursorError = class extends Error {
20982
21168
  static {
20983
21169
  __name(this, "InvalidCursorError");
@@ -21081,11 +21267,14 @@ async function enrichWorktreeSidecars(bySessionId, sessionService, archiveState
21081
21267
  )
21082
21268
  ).catch(() => null);
21083
21269
  if (sidecar) {
21084
- summary.worktree = {
21085
- slug: sidecar.slug,
21086
- path: sidecar.worktreePath,
21087
- branch: sidecar.worktreeBranch
21088
- };
21270
+ bySessionId.set(sessionId, {
21271
+ ...summary,
21272
+ worktree: {
21273
+ slug: sidecar.slug,
21274
+ path: sidecar.worktreePath,
21275
+ branch: sidecar.worktreeBranch
21276
+ }
21277
+ });
21089
21278
  }
21090
21279
  }
21091
21280
  }
@@ -21124,11 +21313,21 @@ function mergeLiveSessionSummary(existing, live) {
21124
21313
  };
21125
21314
  }
21126
21315
  __name(mergeLiveSessionSummary, "mergeLiveSessionSummary");
21127
- async function listAllPersistedSummaries(sessionService, archiveState) {
21316
+ function clonePersistedSummary(session) {
21317
+ return {
21318
+ ...session,
21319
+ ...session.worktree ? { worktree: { ...session.worktree } } : {}
21320
+ };
21321
+ }
21322
+ __name(clonePersistedSummary, "clonePersistedSummary");
21323
+ async function loadAllPersistedSummaries(sessionService, archiveState) {
21324
+ const scanStartedAt = performance.now();
21128
21325
  const sessions = [];
21129
21326
  let truncated = false;
21327
+ let scanPages = 0;
21130
21328
  let cursor;
21131
21329
  do {
21330
+ scanPages += 1;
21132
21331
  const page = await sessionService.listSessions({
21133
21332
  cursor,
21134
21333
  size: 1e4,
@@ -21148,7 +21347,61 @@ async function listAllPersistedSummaries(sessionService, archiveState) {
21148
21347
  break;
21149
21348
  }
21150
21349
  } while (cursor !== void 0);
21151
- return { sessions, truncated };
21350
+ const bySessionId = new Map(
21351
+ sessions.map((session) => [session.sessionId, session])
21352
+ );
21353
+ await enrichWorktreeSidecars(bySessionId, sessionService, archiveState);
21354
+ return {
21355
+ sessions: [...bySessionId.values()],
21356
+ truncated,
21357
+ scanPages,
21358
+ scanDurationMs: Math.max(0, performance.now() - scanStartedAt)
21359
+ };
21360
+ }
21361
+ __name(loadAllPersistedSummaries, "loadAllPersistedSummaries");
21362
+ async function listAllPersistedSummaries(sessionService, workspaceCwd, archiveState, runtimeBaseDir, queryKind) {
21363
+ const lookup = persistedSessionListCache.lookup(
21364
+ { runtimeBaseDir, workspaceCwd, archiveState },
21365
+ () => loadAllPersistedSummaries(sessionService, archiveState)
21366
+ );
21367
+ addDaemonRequestAttribute(
21368
+ "qwen-code.daemon.session_list.cache_status",
21369
+ lookup.status
21370
+ );
21371
+ addDaemonRequestAttribute(
21372
+ "qwen-code.daemon.session_list.archive_state",
21373
+ archiveState
21374
+ );
21375
+ addDaemonRequestAttribute(
21376
+ "qwen-code.daemon.session_list.query_kind",
21377
+ queryKind
21378
+ );
21379
+ if (lookup.cacheAgeMs !== void 0) {
21380
+ addDaemonRequestAttribute(
21381
+ "qwen-code.daemon.session_list.cache_age_ms",
21382
+ lookup.cacheAgeMs
21383
+ );
21384
+ }
21385
+ const snapshot = await lookup.promise;
21386
+ addDaemonRequestAttribute(
21387
+ "qwen-code.daemon.session_list.persisted_sessions",
21388
+ snapshot.sessions.length
21389
+ );
21390
+ addDaemonRequestAttribute(
21391
+ "qwen-code.daemon.session_list.scan_pages",
21392
+ snapshot.scanPages
21393
+ );
21394
+ addDaemonRequestAttribute(
21395
+ "qwen-code.daemon.session_list.truncated",
21396
+ snapshot.truncated
21397
+ );
21398
+ if (lookup.status === "scan") {
21399
+ addDaemonRequestAttribute(
21400
+ "qwen-code.daemon.session_list.scan_duration_ms",
21401
+ snapshot.scanDurationMs
21402
+ );
21403
+ }
21404
+ return snapshot;
21152
21405
  }
21153
21406
  __name(listAllPersistedSummaries, "listAllPersistedSummaries");
21154
21407
  function getSummaryActivityTime(session) {
@@ -21227,15 +21480,20 @@ async function listOrganizedWorkspaceSessionsForResponse(bridge, workspaceCwd, o
21227
21480
  const bySessionId = /* @__PURE__ */ new Map();
21228
21481
  const persisted = await listAllPersistedSummaries(
21229
21482
  sessionService,
21230
- archiveState
21483
+ workspaceCwd,
21484
+ archiveState,
21485
+ readOptions.runtimeBaseDir,
21486
+ "organized"
21231
21487
  );
21232
21488
  for (const session of persisted.sessions) {
21233
21489
  bySessionId.set(
21234
21490
  session.sessionId,
21235
- applyOrganization(session, snapshot.sessions.get(session.sessionId))
21491
+ applyOrganization(
21492
+ clonePersistedSummary(session),
21493
+ snapshot.sessions.get(session.sessionId)
21494
+ )
21236
21495
  );
21237
21496
  }
21238
- await enrichWorktreeSidecars(bySessionId, sessionService, archiveState);
21239
21497
  if (readOptions.mergeLive !== false && archiveState !== "archived" && isFirstPage) {
21240
21498
  try {
21241
21499
  const liveSessions = bridge.listWorkspaceSessions(workspaceCwd);
@@ -21326,12 +21584,14 @@ async function listWorkspaceSessionsByMetadataForResponse(bridge, workspaceCwd,
21326
21584
  const bySessionId = /* @__PURE__ */ new Map();
21327
21585
  const persisted = await listAllPersistedSummaries(
21328
21586
  sessionService,
21329
- archiveState
21587
+ workspaceCwd,
21588
+ archiveState,
21589
+ readOptions.runtimeBaseDir,
21590
+ "metadata"
21330
21591
  );
21331
21592
  for (const session of persisted.sessions) {
21332
- bySessionId.set(session.sessionId, session);
21593
+ bySessionId.set(session.sessionId, clonePersistedSummary(session));
21333
21594
  }
21334
- await enrichWorktreeSidecars(bySessionId, sessionService, archiveState);
21335
21595
  let liveMergeFailed = false;
21336
21596
  if (readOptions.mergeLive !== false && archiveState !== "archived") {
21337
21597
  try {
@@ -21398,6 +21658,20 @@ async function listWorkspaceSessionsByMetadataForResponse(bridge, workspaceCwd,
21398
21658
  }
21399
21659
  __name(listWorkspaceSessionsByMetadataForResponse, "listWorkspaceSessionsByMetadataForResponse");
21400
21660
  async function listWorkspaceSessionsForResponse(bridge, workspaceCwd, options, readOptions = {}) {
21661
+ const runtimeBaseDir = new Storage(
21662
+ workspaceCwd,
21663
+ readOptions.runtimeBaseDir
21664
+ ).getRuntimeBaseDir();
21665
+ return Storage.runWithResolvedRuntimeBaseDir(
21666
+ runtimeBaseDir,
21667
+ () => listWorkspaceSessionsForResponseInRuntime(bridge, workspaceCwd, options, {
21668
+ ...readOptions.mergeLive !== void 0 ? { mergeLive: readOptions.mergeLive } : {},
21669
+ runtimeBaseDir
21670
+ })
21671
+ );
21672
+ }
21673
+ __name(listWorkspaceSessionsForResponse, "listWorkspaceSessionsForResponse");
21674
+ async function listWorkspaceSessionsForResponseInRuntime(bridge, workspaceCwd, options, readOptions) {
21401
21675
  const rawSize = options?.size;
21402
21676
  const requestedSize = typeof rawSize === "number" && Number.isSafeInteger(rawSize) ? rawSize : DEFAULT_SESSION_PAGE_SIZE;
21403
21677
  const pageSize = Math.min(Math.max(requestedSize, 1), MAX_SESSION_PAGE_SIZE);
@@ -21476,7 +21750,7 @@ async function listWorkspaceSessionsForResponse(bridge, workspaceCwd, options, r
21476
21750
  const nextCursor = persisted.nextCursor != null ? String(persisted.nextCursor) : void 0;
21477
21751
  return { sessions, nextCursor };
21478
21752
  }
21479
- __name(listWorkspaceSessionsForResponse, "listWorkspaceSessionsForResponse");
21753
+ __name(listWorkspaceSessionsForResponseInRuntime, "listWorkspaceSessionsForResponseInRuntime");
21480
21754
  function listLiveWorkspaceSessionsForResponse(bridge, workspaceCwd, options) {
21481
21755
  const rawSize = options?.size;
21482
21756
  const requestedSize = typeof rawSize === "number" && Number.isSafeInteger(rawSize) ? rawSize : DEFAULT_SESSION_PAGE_SIZE;
@@ -22570,6 +22844,20 @@ function registerSessionRoutes(app, deps) {
22570
22844
  sessionShellCommandEnabled,
22571
22845
  virtualSubagentSessions
22572
22846
  } = deps;
22847
+ const invalidateSessionLists = /* @__PURE__ */ __name((runtime, archiveStates) => {
22848
+ invalidateWorkspaceSessionListCache({
22849
+ runtimeBaseDir: runtime.sessionRuntimeBaseDir,
22850
+ workspaceCwd: runtime.workspaceCwd,
22851
+ archiveStates
22852
+ });
22853
+ }, "invalidateSessionLists");
22854
+ const runWithSessionListInvalidation = /* @__PURE__ */ __name(async (runtime, archiveStates, mutation) => {
22855
+ try {
22856
+ return await mutation();
22857
+ } finally {
22858
+ invalidateSessionLists(runtime, archiveStates);
22859
+ }
22860
+ }, "runWithSessionListInvalidation");
22573
22861
  const requestedSessionIdAdmission = deps.requestedSessionIdAdmission ?? createRequestedSessionIdAdmission({
22574
22862
  archiveCoordinator,
22575
22863
  getBridges: /* @__PURE__ */ __name(() => workspaceRegistry.listManaged().map((runtime) => runtime.bridge), "getBridges"),
@@ -22745,7 +23033,7 @@ function registerSessionRoutes(app, deps) {
22745
23033
  const workspaceParam = req.params[paramName] ?? "";
22746
23034
  const byId = workspaceRegistry.getByWorkspaceId(workspaceParam);
22747
23035
  if (byId) return byId;
22748
- if (!path10.isAbsolute(workspaceParam)) {
23036
+ if (!path11.isAbsolute(workspaceParam)) {
22749
23037
  res.status(400).json({
22750
23038
  error: `\`:${paramName}\` must decode to a workspace id or absolute path`
22751
23039
  });
@@ -23602,7 +23890,7 @@ function registerSessionRoutes(app, deps) {
23602
23890
  if (worktreeMeta) {
23603
23891
  try {
23604
23892
  const createAllowedRoots = [
23605
- path10.join(workspaceCwd, ".qwen", "worktrees")
23893
+ path11.join(workspaceCwd, ".qwen", "worktrees")
23606
23894
  ];
23607
23895
  let createRepoTop = null;
23608
23896
  try {
@@ -23613,7 +23901,7 @@ function registerSessionRoutes(app, deps) {
23613
23901
  }
23614
23902
  if (createRepoTop && createRepoTop !== workspaceCwd) {
23615
23903
  createAllowedRoots.push(
23616
- path10.join(createRepoTop, ".qwen", "worktrees")
23904
+ path11.join(createRepoTop, ".qwen", "worktrees")
23617
23905
  );
23618
23906
  }
23619
23907
  await runtime.bridge.changeSessionCwd(session.sessionId, {
@@ -23912,7 +24200,7 @@ function registerSessionRoutes(app, deps) {
23912
24200
  if (sidecar) {
23913
24201
  let realTarget;
23914
24202
  const candidateRoots = [
23915
- path10.join(workspaceCwd, ".qwen", "worktrees")
24203
+ path11.join(workspaceCwd, ".qwen", "worktrees")
23916
24204
  ];
23917
24205
  try {
23918
24206
  realTarget = fs6.realpathSync(sidecar.worktreePath);
@@ -23924,13 +24212,13 @@ function registerSessionRoutes(app, deps) {
23924
24212
  } catch {
23925
24213
  }
23926
24214
  if (repoTop && repoTop !== workspaceCwd) {
23927
- candidateRoots.push(path10.join(repoTop, ".qwen", "worktrees"));
24215
+ candidateRoots.push(path11.join(repoTop, ".qwen", "worktrees"));
23928
24216
  }
23929
24217
  const contained = candidateRoots.some((root) => {
23930
24218
  try {
23931
24219
  const realRoot = fs6.realpathSync(root);
23932
- const rel = path10.relative(realRoot, realTarget);
23933
- return !rel.startsWith("..") && !path10.isAbsolute(rel);
24220
+ const rel = path11.relative(realRoot, realTarget);
24221
+ return !rel.startsWith("..") && !path11.isAbsolute(rel);
23934
24222
  } catch {
23935
24223
  return false;
23936
24224
  }
@@ -24246,7 +24534,7 @@ function registerSessionRoutes(app, deps) {
24246
24534
  async (req, res, sessionId, runtime) => {
24247
24535
  const body = safeBody(req);
24248
24536
  const targetPath = body["path"];
24249
- if (typeof targetPath !== "string" || targetPath.length === 0 || !path10.isAbsolute(targetPath)) {
24537
+ if (typeof targetPath !== "string" || targetPath.length === 0 || !path11.isAbsolute(targetPath)) {
24250
24538
  res.status(400).json({
24251
24539
  error: "`path` is required and must be an absolute path",
24252
24540
  code: "invalid_path"
@@ -25115,11 +25403,15 @@ function registerSessionRoutes(app, deps) {
25115
25403
  );
25116
25404
  if (!runtime) return;
25117
25405
  try {
25118
- await archiveCoordinator.runExclusiveMany(
25119
- [sessionId],
25120
- async () => runtime.bridge.closeSession(
25121
- sessionId,
25122
- clientId !== void 0 ? { clientId } : void 0
25406
+ await runWithSessionListInvalidation(
25407
+ runtime,
25408
+ ["active"],
25409
+ () => archiveCoordinator.runExclusiveMany(
25410
+ [sessionId],
25411
+ async () => runtime.bridge.closeSession(
25412
+ sessionId,
25413
+ clientId !== void 0 ? { clientId } : void 0
25414
+ )
25123
25415
  )
25124
25416
  );
25125
25417
  clearBranchSessionEntry(sessionId);
@@ -25140,19 +25432,23 @@ function registerSessionRoutes(app, deps) {
25140
25432
  try {
25141
25433
  const runtime = workspaceRegistry.primary;
25142
25434
  const service = createWorkspaceRuntimeSessionService(runtime);
25143
- const result = await runWithWorkspaceRuntimeStorage(
25435
+ const result = await runWithSessionListInvalidation(
25144
25436
  runtime,
25145
- () => deleteDaemonSessions({
25146
- sessionIds: uniqueIds,
25147
- service,
25148
- bridge,
25149
- coordinator: archiveCoordinator,
25150
- onError: /* @__PURE__ */ __name(({ phase, sessionId, error: error2 }) => {
25151
- writeStderrLine(
25152
- `qwen serve: ${phase}Session failed for ${safeLogValue(sessionId)}: ${safeLogValue(error2)}`
25153
- );
25154
- }, "onError")
25155
- })
25437
+ ["active", "archived"],
25438
+ () => runWithWorkspaceRuntimeStorage(
25439
+ runtime,
25440
+ () => deleteDaemonSessions({
25441
+ sessionIds: uniqueIds,
25442
+ service,
25443
+ bridge,
25444
+ coordinator: archiveCoordinator,
25445
+ onError: /* @__PURE__ */ __name(({ phase, sessionId, error: error2 }) => {
25446
+ writeStderrLine(
25447
+ `qwen serve: ${phase}Session failed for ${safeLogValue(sessionId)}: ${safeLogValue(error2)}`
25448
+ );
25449
+ }, "onError")
25450
+ })
25451
+ )
25156
25452
  );
25157
25453
  for (const removedId of result.removed) {
25158
25454
  clearBranchSessionEntry(removedId);
@@ -25171,14 +25467,18 @@ function registerSessionRoutes(app, deps) {
25171
25467
  onWarning: logSessionArchiveWarning
25172
25468
  });
25173
25469
  try {
25174
- const result = await runWithWorkspaceRuntimeStorage(
25470
+ const result = await runWithSessionListInvalidation(
25175
25471
  runtime,
25176
- () => archiveDaemonSessions({
25177
- sessionIds: uniqueIds,
25178
- service,
25179
- bridge,
25180
- coordinator: archiveCoordinator
25181
- })
25472
+ ["active", "archived"],
25473
+ () => runWithWorkspaceRuntimeStorage(
25474
+ runtime,
25475
+ () => archiveDaemonSessions({
25476
+ sessionIds: uniqueIds,
25477
+ service,
25478
+ bridge,
25479
+ coordinator: archiveCoordinator
25480
+ })
25481
+ )
25182
25482
  );
25183
25483
  res.status(200).json({
25184
25484
  archived: result.archived,
@@ -25198,13 +25498,17 @@ function registerSessionRoutes(app, deps) {
25198
25498
  onWarning: logSessionArchiveWarning
25199
25499
  });
25200
25500
  try {
25201
- const result = await runWithWorkspaceRuntimeStorage(
25501
+ const result = await runWithSessionListInvalidation(
25202
25502
  runtime,
25203
- () => unarchiveDaemonSessions({
25204
- sessionIds: uniqueIds,
25205
- service,
25206
- coordinator: archiveCoordinator
25207
- })
25503
+ ["active", "archived"],
25504
+ () => runWithWorkspaceRuntimeStorage(
25505
+ runtime,
25506
+ () => unarchiveDaemonSessions({
25507
+ sessionIds: uniqueIds,
25508
+ service,
25509
+ coordinator: archiveCoordinator
25510
+ })
25511
+ )
25208
25512
  );
25209
25513
  res.status(200).json({
25210
25514
  unarchived: result.unarchived,
@@ -25230,19 +25534,23 @@ function registerSessionRoutes(app, deps) {
25230
25534
  if (rejectActiveLiveSessionMutation(res, uniqueIds)) return;
25231
25535
  try {
25232
25536
  const service = createWorkspaceRuntimeSessionService(runtime);
25233
- const result = await runWithWorkspaceRuntimeStorage(
25537
+ const result = await runWithSessionListInvalidation(
25234
25538
  runtime,
25235
- () => deleteDaemonSessions({
25236
- sessionIds: uniqueIds,
25237
- service,
25238
- bridge: runtime.bridge,
25239
- coordinator: archiveCoordinator,
25240
- onError: /* @__PURE__ */ __name(({ phase, sessionId, error: error2 }) => {
25241
- writeStderrLine(
25242
- `qwen serve: ${phase}Session failed for ${safeLogValue(sessionId)}: ${safeLogValue(error2)}`
25243
- );
25244
- }, "onError")
25245
- })
25539
+ ["active", "archived"],
25540
+ () => runWithWorkspaceRuntimeStorage(
25541
+ runtime,
25542
+ () => deleteDaemonSessions({
25543
+ sessionIds: uniqueIds,
25544
+ service,
25545
+ bridge: runtime.bridge,
25546
+ coordinator: archiveCoordinator,
25547
+ onError: /* @__PURE__ */ __name(({ phase, sessionId, error: error2 }) => {
25548
+ writeStderrLine(
25549
+ `qwen serve: ${phase}Session failed for ${safeLogValue(sessionId)}: ${safeLogValue(error2)}`
25550
+ );
25551
+ }, "onError")
25552
+ })
25553
+ )
25246
25554
  );
25247
25555
  for (const removedId of result.removed) {
25248
25556
  clearBranchSessionEntry(removedId);
@@ -25267,14 +25575,18 @@ function registerSessionRoutes(app, deps) {
25267
25575
  onWarning: logSessionArchiveWarning
25268
25576
  });
25269
25577
  try {
25270
- const result = await runWithWorkspaceRuntimeStorage(
25578
+ const result = await runWithSessionListInvalidation(
25271
25579
  runtime,
25272
- () => archiveDaemonSessions({
25273
- sessionIds: uniqueIds,
25274
- service,
25275
- bridge: runtime.bridge,
25276
- coordinator: archiveCoordinator
25277
- })
25580
+ ["active", "archived"],
25581
+ () => runWithWorkspaceRuntimeStorage(
25582
+ runtime,
25583
+ () => archiveDaemonSessions({
25584
+ sessionIds: uniqueIds,
25585
+ service,
25586
+ bridge: runtime.bridge,
25587
+ coordinator: archiveCoordinator
25588
+ })
25589
+ )
25278
25590
  );
25279
25591
  res.status(200).json({
25280
25592
  archived: result.archived,
@@ -25300,13 +25612,17 @@ function registerSessionRoutes(app, deps) {
25300
25612
  onWarning: logSessionArchiveWarning
25301
25613
  });
25302
25614
  try {
25303
- const result = await runWithWorkspaceRuntimeStorage(
25615
+ const result = await runWithSessionListInvalidation(
25304
25616
  runtime,
25305
- () => unarchiveDaemonSessions({
25306
- sessionIds: uniqueIds,
25307
- service,
25308
- coordinator: archiveCoordinator
25309
- })
25617
+ ["active", "archived"],
25618
+ () => runWithWorkspaceRuntimeStorage(
25619
+ runtime,
25620
+ () => unarchiveDaemonSessions({
25621
+ sessionIds: uniqueIds,
25622
+ service,
25623
+ coordinator: archiveCoordinator
25624
+ })
25625
+ )
25310
25626
  );
25311
25627
  res.status(200).json({
25312
25628
  unarchived: result.unarchived,
@@ -25338,11 +25654,16 @@ function registerSessionRoutes(app, deps) {
25338
25654
  return;
25339
25655
  }
25340
25656
  const displayName = typeof rawDisplayName === "string" ? rawDisplayName.slice(0, 256) : void 0;
25341
- const effective = runtime.bridge.updateSessionMetadata(
25342
- sessionId,
25343
- { displayName },
25344
- clientId !== void 0 ? { clientId } : void 0
25345
- );
25657
+ let effective;
25658
+ try {
25659
+ effective = runtime.bridge.updateSessionMetadata(
25660
+ sessionId,
25661
+ { displayName },
25662
+ clientId !== void 0 ? { clientId } : void 0
25663
+ );
25664
+ } finally {
25665
+ invalidateSessionLists(runtime, ["active"]);
25666
+ }
25346
25667
  res.status(200).json({ sessionId, ...effective });
25347
25668
  }
25348
25669
  )
@@ -25702,7 +26023,8 @@ function registerSessionRoutes(app, deps) {
25702
26023
  const result = usePersisted ? await runWorkspaceInspectionWithLogPolicy(
25703
26024
  runtime,
25704
26025
  () => listWorkspaceSessionsForResponse(runtime.bridge, key, options, {
25705
- mergeLive: !readOnlySecondary
26026
+ mergeLive: !readOnlySecondary,
26027
+ runtimeBaseDir: runtime.sessionRuntimeBaseDir
25706
26028
  })
25707
26029
  ) : listLiveWorkspaceSessionsForResponse(runtime.bridge, key, options);
25708
26030
  res.status(200).json({
@@ -25881,6 +26203,7 @@ function registerSessionRoutes(app, deps) {
25881
26203
  (req, res, sessionId, runtime) => {
25882
26204
  const body = safeBody(req);
25883
26205
  const message = body["message"];
26206
+ const messageId = body["messageId"];
25884
26207
  const trimmed = typeof message === "string" ? message.trim() : "";
25885
26208
  if (trimmed.length === 0) {
25886
26209
  res.status(400).json({
@@ -25894,12 +26217,19 @@ function registerSessionRoutes(app, deps) {
25894
26217
  });
25895
26218
  return;
25896
26219
  }
26220
+ if (messageId !== void 0 && (typeof messageId !== "string" || messageId.length === 0 || messageId.length > 128)) {
26221
+ res.status(400).json({
26222
+ error: "`messageId` must be a non-empty string of at most 128 characters"
26223
+ });
26224
+ return;
26225
+ }
25897
26226
  const clientId = parseClientIdHeader(req, res);
25898
26227
  if (clientId === null) return;
25899
26228
  const result = runtime.bridge.enqueueMidTurnMessage(
25900
26229
  sessionId,
25901
26230
  trimmed,
25902
- clientId !== void 0 ? { clientId } : void 0
26231
+ clientId !== void 0 ? { clientId } : void 0,
26232
+ typeof messageId === "string" ? messageId : void 0
25903
26233
  );
25904
26234
  res.status(200).json(result);
25905
26235
  }
@@ -25927,6 +26257,24 @@ function registerSessionRoutes(app, deps) {
25927
26257
  }
25928
26258
  )
25929
26259
  );
26260
+ app.get("/session/:id/mid-turn-messages", (req, res) => {
26261
+ const route = "GET /session/:id/mid-turn-messages";
26262
+ const sessionId = requireSessionId(req, res);
26263
+ if (sessionId === null) return;
26264
+ const runtime = resolveLiveSessionRuntime(sessionId, res, route);
26265
+ if (!runtime) return;
26266
+ const clientId = parseClientIdHeader(req, res);
26267
+ if (clientId === null) return;
26268
+ try {
26269
+ const snapshot = runtime.bridge.getMidTurnMessages(
26270
+ sessionId,
26271
+ clientId !== void 0 ? { clientId } : void 0
26272
+ );
26273
+ res.status(200).json(snapshot);
26274
+ } catch (err) {
26275
+ sendBridgeError2(res, err, { route, sessionId });
26276
+ }
26277
+ });
25930
26278
  app.get("/session/:id/pending-prompts", (req, res) => {
25931
26279
  const sessionId = requireSessionId(req, res);
25932
26280
  if (sessionId === null) return;
@@ -27280,7 +27628,7 @@ __name(registerUsageStatsRoutes, "registerUsageStatsRoutes");
27280
27628
  // packages/cli/src/serve/scheduled-task-keepalive.ts
27281
27629
  init_esbuild_shims();
27282
27630
  import * as fsSync from "node:fs";
27283
- import * as path11 from "node:path";
27631
+ import * as path12 from "node:path";
27284
27632
  var log = createDebugLogger("SCHED_KEEPALIVE");
27285
27633
  function collectBoundSessionIds(tasks) {
27286
27634
  const seen = /* @__PURE__ */ new Set();
@@ -27506,8 +27854,8 @@ function startScheduledTaskKeepalive(opts) {
27506
27854
  opts.runtimeBaseDir,
27507
27855
  () => getCronFilePath(boundWorkspace)
27508
27856
  );
27509
- const cronDir = path11.dirname(cronFilePath);
27510
- const cronFileName = path11.basename(cronFilePath);
27857
+ const cronDir = path12.dirname(cronFilePath);
27858
+ const cronFileName = path12.basename(cronFilePath);
27511
27859
  let fileWatcher;
27512
27860
  try {
27513
27861
  fsSync.mkdirSync(cronDir, { recursive: true });
@@ -29228,7 +29576,7 @@ function sendBridgeError(res, err, ctx, daemonLog) {
29228
29576
  return;
29229
29577
  }
29230
29578
  if (err instanceof SessionNotFoundError) {
29231
- res.status(404).json({ error: err.message, sessionId: err.sessionId });
29579
+ res.status(404).json({ error: err.message, code: err.code, sessionId: err.sessionId });
29232
29580
  return;
29233
29581
  }
29234
29582
  if (err instanceof SessionArchivedError) {
@@ -30489,7 +30837,7 @@ __name(registerWorkspaceModelsRoutes, "registerWorkspaceModelsRoutes");
30489
30837
  // packages/cli/src/serve/routes/a2ui-action.ts
30490
30838
  init_esbuild_shims();
30491
30839
  import * as fsp4 from "node:fs/promises";
30492
- import * as path12 from "node:path";
30840
+ import * as path13 from "node:path";
30493
30841
  var A2UI_MIME = "application/a2ui+json";
30494
30842
  var ACTION_TOOL = "action";
30495
30843
  var CALL_TIMEOUT_MS = 15e3;
@@ -30512,7 +30860,7 @@ __name(usableServerConfig, "usableServerConfig");
30512
30860
  async function findFromSettingsFile(workspaceCwd) {
30513
30861
  try {
30514
30862
  const raw = await fsp4.readFile(
30515
- path12.join(workspaceCwd, ".qwen", "settings.json"),
30863
+ path13.join(workspaceCwd, ".qwen", "settings.json"),
30516
30864
  "utf8"
30517
30865
  );
30518
30866
  const settings = JSON.parse(raw);
@@ -30673,7 +31021,7 @@ __name(registerA2uiActionRoutes, "registerA2uiActionRoutes");
30673
31021
 
30674
31022
  // packages/cli/src/serve/server/fs-factory.ts
30675
31023
  init_esbuild_shims();
30676
- import * as path13 from "node:path";
31024
+ import * as path14 from "node:path";
30677
31025
  var IDE_WORKSPACE_PATH_ENV_VAR = "QWEN_CODE_IDE_WORKSPACE_PATH";
30678
31026
  function createDefaultFsAuditEmit() {
30679
31027
  const WARN_EVERY = 100;
@@ -30748,14 +31096,14 @@ function parseIdeWorkspacePathEnv(value) {
30748
31096
  const parsed = JSON.parse(value);
30749
31097
  if (Array.isArray(parsed) && parsed.every((item) => typeof item === "string")) {
30750
31098
  return parsed.filter(
30751
- (workspace) => workspace.length > 0 && path13.isAbsolute(workspace)
31099
+ (workspace) => workspace.length > 0 && path14.isAbsolute(workspace)
30752
31100
  );
30753
31101
  }
30754
31102
  throw new Error("IDE workspace path JSON must be a string array");
30755
31103
  } catch {
30756
31104
  }
30757
31105
  }
30758
- return value.split(path13.delimiter).filter((workspace) => workspace.length > 0 && path13.isAbsolute(workspace));
31106
+ return value.split(path14.delimiter).filter((workspace) => workspace.length > 0 && path14.isAbsolute(workspace));
30759
31107
  }
30760
31108
  __name(parseIdeWorkspacePathEnv, "parseIdeWorkspacePathEnv");
30761
31109
  function dropNestedWorkspacesPreservingPrimary(workspaces) {
@@ -31080,10 +31428,10 @@ function installRateLimiter(app, opts, daemonLog, options = {}) {
31080
31428
  { tier, key: key.slice(0, 64) }
31081
31429
  );
31082
31430
  } : void 0,
31083
- onError: daemonLog ? (err, path15) => {
31431
+ onError: daemonLog ? (err, path16) => {
31084
31432
  daemonLog.warn(
31085
31433
  `rate limiter error (fail-open): ${err instanceof Error ? err.message : String(err)}`,
31086
- { path: path15 }
31434
+ { path: path16 }
31087
31435
  );
31088
31436
  } : void 0
31089
31437
  });
@@ -31711,11 +32059,11 @@ function registerWorkspaceManagementRoutes(app, deps) {
31711
32059
  const controller = new AbortController();
31712
32060
  res.on("close", () => controller.abort());
31713
32061
  try {
31714
- const path15 = await pickWorkspaceDirectory(controller.signal);
32062
+ const path16 = await pickWorkspaceDirectory(controller.signal);
31715
32063
  res.status(200).json({
31716
32064
  kind: "workspace-directory-picker",
31717
- selected: path15 !== void 0,
31718
- ...path15 === void 0 ? {} : { path: path15 }
32065
+ selected: path16 !== void 0,
32066
+ ...path16 === void 0 ? {} : { path: path16 }
31719
32067
  });
31720
32068
  } catch (error2) {
31721
32069
  const detail = error2 instanceof Error ? error2.message : String(error2);
@@ -32772,8 +33120,8 @@ function buildDiffList(workspaceCwd, result) {
32772
33120
  hiddenCount: 0
32773
33121
  };
32774
33122
  }
32775
- const files = [...result.perFileStats.entries()].map(([path15, s]) => ({
32776
- path: path15,
33123
+ const files = [...result.perFileStats.entries()].map(([path16, s]) => ({
33124
+ path: path16,
32777
33125
  oldPath: s.oldPath,
32778
33126
  added: s.added,
32779
33127
  removed: s.removed,
@@ -39316,7 +39664,7 @@ import { createHash as createHash5, randomUUID as randomUUID11 } from "node:cryp
39316
39664
  import * as fs7 from "node:fs";
39317
39665
  import * as fsp5 from "node:fs/promises";
39318
39666
  import * as os2 from "node:os";
39319
- import * as path14 from "node:path";
39667
+ import * as path15 from "node:path";
39320
39668
  import { Readable, Transform } from "node:stream";
39321
39669
  import { pipeline } from "node:stream/promises";
39322
39670
  import { promisify as promisify3 } from "node:util";
@@ -39396,7 +39744,7 @@ async function readBundleValue(appPath, key) {
39396
39744
  "raw",
39397
39745
  "-o",
39398
39746
  "-",
39399
- path14.join(appPath, "Contents", "Info.plist")
39747
+ path15.join(appPath, "Contents", "Info.plist")
39400
39748
  ]);
39401
39749
  }
39402
39750
  __name(readBundleValue, "readBundleValue");
@@ -39538,11 +39886,11 @@ async function downloadLiveHostRelease(currentArchitecture, destination, onProgr
39538
39886
  __name(downloadLiveHostRelease, "downloadLiveHostRelease");
39539
39887
  async function installLatestHost(currentArchitecture, onStatus) {
39540
39888
  const temporaryDirectory = await fsp5.mkdtemp(
39541
- path14.join(os2.tmpdir(), "qwen-live-host-")
39889
+ path15.join(os2.tmpdir(), "qwen-live-host-")
39542
39890
  );
39543
- const archivePath = path14.join(temporaryDirectory, "Qwen-Live-Host.zip");
39544
- const extractedPath = path14.join(temporaryDirectory, "extracted");
39545
- const candidatePath = path14.join(extractedPath, LIVE_HOST_APP_NAME);
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);
39546
39894
  const stagingPath = `/Applications/.Qwen Live Host.install-${randomUUID11()}.app`;
39547
39895
  const backupPath = `/Applications/.Qwen Live Host.backup-${randomUUID11()}.app`;
39548
39896
  let movedExisting = false;
@@ -40061,13 +40409,13 @@ function openLiveAudioCapture(source, identifier) {
40061
40409
  try {
40062
40410
  mkdirSync2(directory, { recursive: true, mode: 448 });
40063
40411
  const safeIdentifier = identifier.replace(/[^A-Za-z0-9_-]/g, "_");
40064
- const path15 = join11(
40412
+ const path16 = join11(
40065
40413
  directory,
40066
40414
  `${source}-${Date.now()}-${safeIdentifier}.pcm`
40067
40415
  );
40068
- const stream = createWriteStream2(path15, { flags: "wx", mode: 384 });
40416
+ const stream = createWriteStream2(path16, { flags: "wx", mode: 384 });
40069
40417
  stream.on("error", () => void 0);
40070
- return { source, path: path15, stream, hash: createHash6("sha256"), bytes: 0 };
40418
+ return { source, path: path16, stream, hash: createHash6("sha256"), bytes: 0 };
40071
40419
  } catch {
40072
40420
  return void 0;
40073
40421
  }
@@ -40924,35 +41272,52 @@ var LiveSessionCoordinator = class {
40924
41272
  event.request,
40925
41273
  event.activeTranscript
40926
41274
  );
41275
+ const runAsNextTurn = /* @__PURE__ */ __name(async (notifyAdmission) => {
41276
+ if (!this.isCurrentSocket(context, generation) || context.realtime !== source) {
41277
+ return false;
41278
+ }
41279
+ let admitted = false;
41280
+ await this.runCoordinatorTurn(
41281
+ context,
41282
+ locator,
41283
+ event.request,
41284
+ modelPrompt,
41285
+ () => {
41286
+ admitted = true;
41287
+ if (notifyAdmission) onPromptAdmitted();
41288
+ },
41289
+ (message) => {
41290
+ if (this.isCurrentSocket(context, generation)) {
41291
+ source.sendBackendContext(message);
41292
+ }
41293
+ }
41294
+ );
41295
+ return admitted;
41296
+ }, "runAsNextTurn");
40927
41297
  const routed = runtime.bridge.enqueueMidTurnMessage(
40928
41298
  locator.sessionId,
40929
- modelPrompt
41299
+ modelPrompt,
41300
+ void 0,
41301
+ void 0,
41302
+ {
41303
+ queueOnly: true,
41304
+ onSettledWithoutDrain: /* @__PURE__ */ __name(() => {
41305
+ void runAsNextTurn(false).catch((error2) => {
41306
+ if (this.isCurrentSocket(context, generation) && context.realtime === source) {
41307
+ source.sendBackendContext(
41308
+ `The Qwen Code agent could not complete the request: ${errorMessage4(error2)}`
41309
+ );
41310
+ }
41311
+ });
41312
+ }, "onSettledWithoutDrain")
41313
+ }
40930
41314
  );
40931
41315
  if (routed.accepted) {
40932
41316
  onPromptAdmitted();
40933
41317
  return true;
40934
41318
  }
40935
41319
  await activeHandoff.turnComplete;
40936
- if (!this.isCurrentSocket(context, generation) || context.realtime !== source) {
40937
- return false;
40938
- }
40939
- let admitted = false;
40940
- await this.runCoordinatorTurn(
40941
- context,
40942
- locator,
40943
- event.request,
40944
- modelPrompt,
40945
- () => {
40946
- admitted = true;
40947
- onPromptAdmitted();
40948
- },
40949
- (message) => {
40950
- if (this.isCurrentSocket(context, generation)) {
40951
- source.sendBackendContext(message);
40952
- }
40953
- }
40954
- );
40955
- return admitted;
41320
+ return runAsNextTurn(true);
40956
41321
  }
40957
41322
  async handleDelegate(context, event, generation, source, onPromptAdmitted) {
40958
41323
  if (!this.isActive(context)) return false;
@@ -41852,7 +42217,8 @@ var LiveTaskService = class {
41852
42217
  view: "organized",
41853
42218
  group: "all",
41854
42219
  ...cursor ? { cursor } : {}
41855
- }
42220
+ },
42221
+ { runtimeBaseDir: runtime.sessionRuntimeBaseDir }
41856
42222
  );
41857
42223
  for (const session of result.sessions) {
41858
42224
  const pinned = session.isPinned === true;
@@ -42226,7 +42592,7 @@ var LiveTaskService = class {
42226
42592
  } catch (error2) {
42227
42593
  if (!(error2 instanceof SessionNotFoundError)) throw error2;
42228
42594
  }
42229
- const service = new SessionService(task.runtime.workspaceCwd);
42595
+ const service = createWorkspaceRuntimeSessionService(task.runtime);
42230
42596
  const metadata = task.runtime.provenance === "live-conversation" ? await readLoadableLiveConversationMetadata(
42231
42597
  task.summary.sessionId,
42232
42598
  (sessionId) => service.readCreationMetadata(sessionId)
@@ -42275,7 +42641,10 @@ var LiveTaskService = class {
42275
42641
  removed = false;
42276
42642
  }
42277
42643
  if (removed) {
42278
- await new SessionService(runtime.workspaceCwd).removeSession(session.sessionId).catch(() => void 0);
42644
+ await runWithWorkspaceRuntimeStorage(
42645
+ runtime,
42646
+ () => createWorkspaceRuntimeSessionService(runtime).removeSession(session.sessionId).catch(() => void 0)
42647
+ );
42279
42648
  }
42280
42649
  if (projectless && removed) {
42281
42650
  await this.options.discardEmptyConversationDirectory(session.sessionId).catch(() => void 0);
@@ -42289,8 +42658,8 @@ var LiveTaskService = class {
42289
42658
  const runtimes = live.kind === "found" ? [live.runtime] : (await Promise.all(
42290
42659
  this.options.workspaceRegistry.list().map(async (runtime2) => ({
42291
42660
  runtime: runtime2,
42292
- exists: await new SessionService(
42293
- runtime2.workspaceCwd
42661
+ exists: await createWorkspaceRuntimeSessionService(
42662
+ runtime2
42294
42663
  ).sessionExists(threadId)
42295
42664
  }))
42296
42665
  )).filter((entry) => entry.exists).map((entry) => entry.runtime);
@@ -42298,7 +42667,7 @@ var LiveTaskService = class {
42298
42667
  if (runtimes.length > 1)
42299
42668
  throw new Error(`Task id is ambiguous: ${threadId}`);
42300
42669
  const runtime = runtimes[0];
42301
- const service = new SessionService(runtime.workspaceCwd);
42670
+ const service = createWorkspaceRuntimeSessionService(runtime);
42302
42671
  const persisted = await service.loadSession(threadId);
42303
42672
  let summary;
42304
42673
  try {
@@ -42316,7 +42685,8 @@ var LiveTaskService = class {
42316
42685
  {
42317
42686
  size: 100,
42318
42687
  ...cursor ? { cursor } : {}
42319
- }
42688
+ },
42689
+ { runtimeBaseDir: runtime.sessionRuntimeBaseDir }
42320
42690
  );
42321
42691
  found = listed.sessions.find((item) => item.sessionId === threadId);
42322
42692
  cursor = listed.nextCursor;
@@ -43942,6 +44312,7 @@ export {
43942
44312
  detectFromLoopback,
43943
44313
  getActiveSseCount,
43944
44314
  getWorkspaceSessionInfoForResponse,
44315
+ invalidateWorkspaceSessionListCache,
43945
44316
  listWorkspaceSessionsForResponse,
43946
44317
  resolveBoundWorkspacesFromIdeEnv,
43947
44318
  resolveBridgeFsFactory,