@qwen-code/qwen-code 0.19.11 → 0.19.12-preview.0

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 (304) hide show
  1. package/bundled/batch/SKILL.md +6 -0
  2. package/bundled/qc-helper/docs/configuration/model-providers.md +11 -0
  3. package/bundled/qc-helper/docs/configuration/settings.md +11 -10
  4. package/bundled/qc-helper/docs/features/channels/overview.md +66 -11
  5. package/bundled/qc-helper/docs/features/sub-agents.md +8 -8
  6. package/bundled/qc-helper/docs/features/worktree.md +2 -2
  7. package/bundled/qc-helper/docs/qwen-serve-deploy-local.md +42 -7
  8. package/bundled/qc-helper/docs/qwen-serve.md +102 -40
  9. package/bundled/qc-helper/docs/reference/keyboard-shortcuts.md +1 -1
  10. package/bundled/review/SKILL.md +60 -49
  11. package/bundled/simplify/SKILL.md +1 -1
  12. package/chunks/{MaxSizedBox-L6TGYDM3.js → MaxSizedBox-3KIWAU6Z.js} +31 -32
  13. package/chunks/{StandaloneSessionPicker-AKEQHU5P.js → StandaloneSessionPicker-TF626NO7.js} +45 -46
  14. package/chunks/acp-startup-profiler-N3RHHXJ3.js +25 -0
  15. package/chunks/{acpAgent-PTNBGJDN.js → acpAgent-JDVJXVBO.js} +1863 -507
  16. package/chunks/{agent-AJOMOZPJ.js → agent-BONWC4VY.js} +26 -27
  17. package/chunks/{agent-headless-CYKOMAXS.js → agent-headless-H7HKMGLZ.js} +26 -27
  18. package/chunks/{anthropicContentGenerator-HBRXJSP4.js → anthropicContentGenerator-ZZRGFEES.js} +35 -12
  19. package/chunks/{artifact-tool-MIZLXBLF.js → artifact-tool-PHO5XEGZ.js} +5 -5
  20. package/chunks/{askUserQuestion-XMJVPNWM.js → askUserQuestion-CEPBT47X.js} +2 -47
  21. package/chunks/{bridge-QKISWPCI.js → bridge-ATN2TLWJ.js} +31 -32
  22. package/chunks/{ca-CODEN7TD.js → ca-2SL2BXTK.js} +3 -2
  23. package/chunks/{channel-worker-group-SOUWTFHC.js → channel-worker-group-S3H5QHTI.js} +4 -4
  24. package/chunks/{channel-worker-manager-LOVSV3WW.js → channel-worker-manager-ZJ4HTMO2.js} +4 -4
  25. package/chunks/{channel-worker-supervisor-XW6MHJBQ.js → channel-worker-supervisor-JA6VZ5V5.js} +3 -3
  26. package/chunks/{chunk-ZIXOTAPZ.js → chunk-2DZ7E27L.js} +92 -3
  27. package/chunks/{chunk-L5U3ELZX.js → chunk-335ECZTA.js} +1 -1
  28. package/chunks/{chunk-2FO5GFKZ.js → chunk-3DJY4IFO.js} +1 -1
  29. package/chunks/{chunk-4AGTGMCQ.js → chunk-3PE7OY2G.js} +12 -12
  30. package/chunks/{chunk-QOTQH4CB.js → chunk-4AGBO6RB.js} +27 -10
  31. package/chunks/{chunk-Y66VOBRP.js → chunk-4CA4WUMS.js} +2 -2
  32. package/chunks/{chunk-LQIDP6K5.js → chunk-4CHDYDG3.js} +1 -1
  33. package/chunks/{chunk-574PTLMU.js → chunk-4OVECYBM.js} +407 -92
  34. package/chunks/{chunk-TV6K2FB4.js → chunk-4RPARQ5D.js} +2 -2
  35. package/chunks/{chunk-TL4R5TRK.js → chunk-4W55BHOC.js} +2 -2
  36. package/chunks/{chunk-RCEEXIOO.js → chunk-4XCVGEEX.js} +3 -3
  37. package/chunks/{chunk-3DWIFU7L.js → chunk-53UMEONK.js} +1 -1
  38. package/chunks/{chunk-AU3MFJPL.js → chunk-54KPEDM2.js} +8 -8
  39. package/chunks/{chunk-T76DGHGG.js → chunk-66F4IJ4L.js} +5 -5
  40. package/chunks/{chunk-YLSSEUAM.js → chunk-675SVDMD.js} +354 -278
  41. package/chunks/{chunk-NVTQZXR7.js → chunk-6QGZVKOO.js} +91 -52
  42. package/chunks/{chunk-NJOFRXTM.js → chunk-6TDA4EVC.js} +4200 -3450
  43. package/chunks/{chunk-BYH2JRK3.js → chunk-6WZZHJSZ.js} +5 -5
  44. package/chunks/{chunk-7X7TEQNX.js → chunk-76BFY7AF.js} +13 -0
  45. package/chunks/chunk-7KS72E2N.js +883 -0
  46. package/chunks/{chunk-CF5VJRGC.js → chunk-7LMAKIWE.js} +1 -1
  47. package/chunks/{chunk-WMNXXRGL.js → chunk-7O7WZH7N.js} +31 -31
  48. package/chunks/{chunk-7ZYHLN67.js → chunk-7OZGMFHC.js} +26 -75
  49. package/chunks/{chunk-6WPJRYLZ.js → chunk-7SX6WZNO.js} +3 -3
  50. package/chunks/{chunk-JGUT3LWZ.js → chunk-ANRANWVE.js} +4 -1
  51. package/chunks/{chunk-JD44PNGJ.js → chunk-AWOU24F6.js} +10 -5
  52. package/chunks/{chunk-6WGZDD67.js → chunk-BEFQGC6H.js} +2 -2
  53. package/chunks/{chunk-KXYJPRT5.js → chunk-BEZPRKD3.js} +28 -6
  54. package/chunks/{chunk-FYQ22K62.js → chunk-CHVH4DVN.js} +6 -5
  55. package/chunks/{chunk-LS56TX3M.js → chunk-CMHJEUVB.js} +1 -1
  56. package/chunks/{chunk-FXKOAEXP.js → chunk-CXWUXRD5.js} +14 -14
  57. package/chunks/{chunk-CAHY5ABC.js → chunk-DULSE2SH.js} +1 -1
  58. package/chunks/{chunk-SQ5BK3GO.js → chunk-DYUPBU7H.js} +1 -1
  59. package/chunks/{chunk-FNX3LGAK.js → chunk-E655RDRL.js} +1 -1
  60. package/chunks/{chunk-N5VIZTND.js → chunk-EWPLL4OT.js} +1 -1
  61. package/chunks/{chunk-FSA7ERJ2.js → chunk-F2RR4HO2.js} +1 -1
  62. package/chunks/{chunk-S63Z5V42.js → chunk-F2YCCUXI.js} +4 -4
  63. package/chunks/{chunk-3AYLDB6B.js → chunk-FEZXQXW2.js} +1 -1
  64. package/chunks/{chunk-OWT2CAEQ.js → chunk-GEHSF7MS.js} +105 -12
  65. package/chunks/{chunk-LXLTBIDP.js → chunk-HCCR43AY.js} +1 -1
  66. package/chunks/{chunk-7NMU22Q3.js → chunk-HQ7MDVBO.js} +18 -7
  67. package/chunks/{chunk-KSZKSE23.js → chunk-HVWPSGDY.js} +1 -1
  68. package/chunks/{chunk-YFVO2HOR.js → chunk-HZXU6YZW.js} +5 -5
  69. package/chunks/{chunk-HASK4LMI.js → chunk-IKLWU6YS.js} +13 -6
  70. package/chunks/{chunk-GNBBAQ6J.js → chunk-ILQ42UG6.js} +111 -40
  71. package/chunks/{chunk-THXDQSTA.js → chunk-IQRQVPGN.js} +49 -154
  72. package/chunks/{chunk-SPJQO2CE.js → chunk-J2MKYJKZ.js} +2 -2
  73. package/chunks/{chunk-SUARMD4Q.js → chunk-J6NT5YTN.js} +28 -2
  74. package/chunks/{chunk-TYLOFD2U.js → chunk-JCJPZMJV.js} +1 -1
  75. package/chunks/{chunk-BYB3GF2T.js → chunk-JCYMQU5F.js} +133 -6
  76. package/chunks/{chunk-6EDDYPI3.js → chunk-JUNVFQVY.js} +4 -4
  77. package/chunks/{chunk-CH2XVB47.js → chunk-K7P34F2J.js} +3 -3
  78. package/chunks/{chunk-5VWYKIMW.js → chunk-KANTXY7B.js} +2 -2
  79. package/chunks/{chunk-K7VD4XLT.js → chunk-LHEQDKAR.js} +1 -1
  80. package/chunks/{chunk-A2HWMJVO.js → chunk-LKR7QQ63.js} +3 -3
  81. package/chunks/{chunk-4HUDDSO5.js → chunk-LLIGYAQU.js} +4 -4
  82. package/chunks/{chunk-5Z452MMD.js → chunk-LODZMRXC.js} +154 -83
  83. package/chunks/{chunk-FBU7WRZI.js → chunk-LPHGXXZX.js} +6 -1
  84. package/chunks/{chunk-CPFIQVZJ.js → chunk-LYFDJTXE.js} +1 -1
  85. package/chunks/{chunk-TIOE2OPE.js → chunk-MCYZTKBV.js} +2 -2
  86. package/chunks/{chunk-ZQIYGQCG.js → chunk-MHEZV3OY.js} +506 -143
  87. package/chunks/{chunk-JWICTOXS.js → chunk-NGTQA57Y.js} +2 -2
  88. package/chunks/{chunk-5CNYZ7TN.js → chunk-NJQPQ4IO.js} +7 -7
  89. package/chunks/chunk-NSZJQACR.js +45 -0
  90. package/chunks/{chunk-DOPUYNXO.js → chunk-NUHSLBJZ.js} +7 -7
  91. package/chunks/{chunk-CITWNIXJ.js → chunk-NVUGS23Y.js} +5 -5
  92. package/chunks/{chunk-2Z5UX4KI.js → chunk-OSSDHJDU.js} +1 -1
  93. package/chunks/{chunk-YUZI3WAC.js → chunk-OWAK7LMW.js} +7 -0
  94. package/chunks/{chunk-Y3KFTWVX.js → chunk-OZWJAFFE.js} +6 -6
  95. package/chunks/{chunk-YGYSMY2R.js → chunk-PSISZNIT.js} +1629 -1142
  96. package/chunks/{chunk-4ROQY23C.js → chunk-PTXVHS2O.js} +7 -7
  97. package/chunks/{chunk-OKAIGAYW.js → chunk-QGONRHUS.js} +3 -3
  98. package/chunks/{chunk-PZL23GTM.js → chunk-QR6U5QPP.js} +8 -0
  99. package/chunks/chunk-QSG4ZFG4.js +257 -0
  100. package/chunks/{chunk-BXBDC476.js → chunk-R32BTEZY.js} +5 -5
  101. package/chunks/{chunk-AVEOWVOM.js → chunk-R3VWUU2E.js} +1 -1
  102. package/chunks/{chunk-RP5R7MB6.js → chunk-R4RIMOJL.js} +12 -12
  103. package/chunks/{chunk-ARKANCNX.js → chunk-SGPFJMRP.js} +1 -1
  104. package/chunks/{chunk-3M75MSVA.js → chunk-SMASS3CY.js} +1 -1
  105. package/chunks/{chunk-4IJMTYCB.js → chunk-SNONG66P.js} +818 -29
  106. package/chunks/chunk-TDKQP3M6.js +201 -0
  107. package/chunks/{chunk-VFX7EZIR.js → chunk-TFV3XVAZ.js} +8 -1
  108. package/chunks/{chunk-4LD5APFL.js → chunk-TYQMGACW.js} +1 -0
  109. package/chunks/{chunk-7NFB7LBQ.js → chunk-UE5TZ55T.js} +8 -0
  110. package/chunks/{chunk-F333XEAU.js → chunk-UOA2IHRI.js} +4 -3
  111. package/chunks/{chunk-VRR65QYW.js → chunk-V4PCIS25.js} +5 -1
  112. package/chunks/{chunk-WIEO4CWB.js → chunk-VAJS2E2D.js} +1 -1
  113. package/chunks/{chunk-GLNHPRZT.js → chunk-W4DFAUAO.js} +1 -1
  114. package/chunks/{chunk-STZQCNN3.js → chunk-W7H223ZZ.js} +1 -1
  115. package/chunks/{chunk-6Y6ORE2G.js → chunk-WACI4VES.js} +288 -20
  116. package/chunks/{chunk-WTNZ6DXB.js → chunk-WEPXQKGP.js} +1 -1
  117. package/chunks/{chunk-4BJVSIS3.js → chunk-WHQNBBWW.js} +2 -2
  118. package/chunks/{chunk-QDJ2R4CM.js → chunk-WTHRMVKB.js} +3 -3
  119. package/chunks/{chunk-L4Y55KIS.js → chunk-X6YQWCIJ.js} +1 -1
  120. package/chunks/{chunk-Q6TUALBE.js → chunk-XAAEDML2.js} +1 -1
  121. package/chunks/{chunk-BUAXJVNP.js → chunk-XACBIZJB.js} +3 -3
  122. package/chunks/{chunk-2OG646IN.js → chunk-XFJU7SVP.js} +4 -4
  123. package/chunks/{chunk-KKRTYONM.js → chunk-XSPFQQRE.js} +3 -3
  124. package/chunks/{chunk-V2DXTLUE.js → chunk-Y5UDBQYF.js} +3 -3
  125. package/chunks/{chunk-MQOVXZAF.js → chunk-YN2I5I42.js} +529 -61
  126. package/chunks/{chunk-FMNYGWOD.js → chunk-Z4ZCVYJ5.js} +14 -8
  127. package/chunks/{chunk-SY7NEYX4.js → chunk-ZFHHBRRA.js} +2 -2
  128. package/chunks/{chunk-QYG4BY6Q.js → chunk-ZPVGEMVC.js} +1 -1
  129. package/chunks/{computer-use-VZZMJEQ7.js → computer-use-UY4A72X7.js} +26 -27
  130. package/chunks/{config-utils-IQQT3GCI.js → config-utils-KWTRFP7D.js} +3 -3
  131. package/chunks/{contextCommand-PORKIZSY.js → contextCommand-3DZ2SVH6.js} +30 -31
  132. package/chunks/{create-sub-session-EAB2U5XW.js → create-sub-session-DIJOV6HV.js} +2 -2
  133. package/chunks/{create-sub-session-XVFKHAFW.js → create-sub-session-OT7WXLDO.js} +27 -28
  134. package/chunks/{cron-create-GMVKSXZT.js → cron-create-X462ERYA.js} +4 -4
  135. package/chunks/{cron-delete-VDZKUAVK.js → cron-delete-SL5UJUM3.js} +4 -4
  136. package/chunks/{cron-list-UG7C7RAR.js → cron-list-3MD6SVXI.js} +4 -4
  137. package/chunks/{daemon-IHR6WSPB.js → daemon-ZW6LHOXT.js} +91 -14
  138. package/chunks/{daemon-status-provider-ABLBA3UJ.js → daemon-status-provider-GTZOYSBO.js} +35 -36
  139. package/chunks/{de-NOXPCSYN.js → de-I7ZIYXZC.js} +3 -2
  140. package/chunks/{dist-PX2ERZ6I.js → dist-HCUUS6IH.js} +2 -2
  141. package/chunks/{dist-VYWUKURL.js → dist-O2IP3G5D.js} +1 -1
  142. package/chunks/{dist-GXJVCOS7.js → dist-RZBJT5O2.js} +2 -1
  143. package/chunks/{dist-V2YVLYOW.js → dist-Y54RURGT.js} +3 -1
  144. package/chunks/{dist-DOPL5LSQ.js → dist-YTPTCUAD.js} +1 -1
  145. package/chunks/{dist-4WCQEZIN.js → dist-ZJHKKWUD.js} +1 -1
  146. package/chunks/{earlyInputCapture-DJCU5SPU.js → earlyInputCapture-GGWVGBZ7.js} +27 -28
  147. package/chunks/{edit-O4VV5AO6.js → edit-JN467GIR.js} +27 -28
  148. package/chunks/{en-JFVULHTB.js → en-XE34GKAA.js} +7 -3
  149. package/chunks/{enter-worktree-XQYDDI2I.js → enter-worktree-MMO4VBQE.js} +26 -27
  150. package/chunks/{enterPlanMode-CESVMQBV.js → enterPlanMode-BRZOG4DB.js} +27 -30
  151. package/chunks/{environment-5KXOLZNR.js → environment-LOCDCWMZ.js} +29 -30
  152. package/chunks/{errors-EBUTCBAQ.js → errors-XXSL5HGG.js} +29 -30
  153. package/chunks/{exit-worktree-MWGNSPNX.js → exit-worktree-UD7PI5H5.js} +26 -27
  154. package/chunks/exitPlanMode-EIUETQI6.js +389 -0
  155. package/chunks/{fast-path-6V73F2T2.js → fast-path-ULGAEUVK.js} +2 -2
  156. package/chunks/{fr-HVFNU42H.js → fr-X7KDVZIY.js} +3 -2
  157. package/chunks/{gemini-TEFJZCIZ.js → gemini-KW3APZ4P.js} +133 -80
  158. package/chunks/{geminiContentGenerator-M56BEXWI.js → geminiContentGenerator-4BQ5QHPR.js} +5 -5
  159. package/chunks/{glob-DMYFEEAZ.js → glob-FPKAMR6B.js} +32 -28
  160. package/chunks/{grep-GYE47MD4.js → grep-MOGRCYB4.js} +32 -28
  161. package/chunks/{handleAutoUpdate-OLUY4L7L.js → handleAutoUpdate-QUMRZZOS.js} +33 -34
  162. package/chunks/{i18n-462JC7IY.js → i18n-F3W6YUYP.js} +28 -29
  163. package/chunks/{initializer-Y7WD4D2I.js → initializer-KLU2KAIZ.js} +33 -34
  164. package/chunks/{installationInfo-I2Z3BKCE.js → installationInfo-P3ZP2SIZ.js} +27 -28
  165. package/chunks/{ja-PY5AF544.js → ja-2ICT3KXF.js} +3 -2
  166. package/chunks/{keychain-token-storage-AU22CQI6.js → keychain-token-storage-K23CFKGN.js} +2 -2
  167. package/chunks/{list-XQ5MSAXP.js → list-4X6D5JD2.js} +35 -36
  168. package/chunks/{loadedSettingsAdapter-TQOWYE7C.js → loadedSettingsAdapter-446B6WKA.js} +32 -33
  169. package/chunks/{loop-wakeup-QXWZSCYM.js → loop-wakeup-6H7OENTB.js} +5 -5
  170. package/chunks/{ls-2OUTG3IZ.js → ls-APTSOOS5.js} +4 -4
  171. package/chunks/{lsp-4VMNXZW6.js → lsp-HPACPJAN.js} +2 -2
  172. package/chunks/{mcp-22LLEEVM.js → mcp-JYVOJZOD.js} +32 -33
  173. package/chunks/{monitor-VKG324X3.js → monitor-KY7YH7TL.js} +26 -27
  174. package/chunks/nonInteractiveCli-EK35TLVJ.js +129 -0
  175. package/chunks/{notebook-edit-FJJRBQ3S.js → notebook-edit-IHGW42QK.js} +27 -28
  176. package/chunks/{openaiContentGenerator-4T2OGTR5.js → openaiContentGenerator-FURUCKQJ.js} +13 -14
  177. package/chunks/{pidfile-XL3MDCBM.js → pidfile-WKUVXDMR.js} +27 -28
  178. package/chunks/{processUtils-7UCFN34D.js → processUtils-LHSRN76X.js} +2 -2
  179. package/chunks/{pt-A3PRQXMU.js → pt-JJ4XPIBP.js} +3 -2
  180. package/chunks/{qwenContentGenerator-PQUXJDIZ.js → qwenContentGenerator-NRLM7R36.js} +30 -31
  181. package/chunks/{qwenOAuth2-LEYOU7RU.js → qwenOAuth2-5FNX3AWH.js} +22 -5
  182. package/chunks/{read-file-3EYQML7E.js → read-file-VLEAEXFP.js} +9 -10
  183. package/chunks/{read-mcp-resource-JUFHCKSC.js → read-mcp-resource-C6NT52T6.js} +2 -2
  184. package/chunks/{record-artifact-DWSMBXYY.js → record-artifact-ENCU7QCL.js} +2 -2
  185. package/chunks/{ripGrep-S6WPGQNA.js → ripGrep-MT23EIDD.js} +26 -27
  186. package/chunks/{ru-IBCWUTOC.js → ru-STR4KTW7.js} +3 -2
  187. package/chunks/{run-qwen-serve-NSKBT3HU.js → run-qwen-serve-5HWOQFLI.js} +63 -47
  188. package/chunks/{runtime-LG5ZZ3VH.js → runtime-6IVKJSLW.js} +38 -37
  189. package/chunks/{scheduler-PLX3VVTB.js → scheduler-63GJG75U.js} +26 -27
  190. package/chunks/{send-message-JZ752NWD.js → send-message-5GZ4FX2V.js} +3 -3
  191. package/chunks/{serve-S2ZLRZZR.js → serve-3LL7RRDP.js} +32 -33
  192. package/chunks/{server-5ECMV4TM.js → server-AA24QLPA.js} +1672 -615
  193. package/chunks/{session-ILSONWG4.js → session-LRVCFQQQ.js} +102 -75
  194. package/chunks/{settings-BOE7WWSA.js → settings-ZX3OKUT4.js} +36 -37
  195. package/chunks/{shell-VW664JIZ.js → shell-KR3IMYH6.js} +26 -27
  196. package/chunks/{skill-COHV6625.js → skill-QLM2LSF7.js} +11 -12
  197. package/chunks/{spawnChannel-5UUR5XOZ.js → spawnChannel-6WFOK3SA.js} +28 -29
  198. package/chunks/{src-XPKFZ3RN.js → src-ADLNIPHD.js} +101 -72
  199. package/chunks/{standalone-update-IOOJ2NZQ.js → standalone-update-C54OTJWJ.js} +29 -30
  200. package/chunks/{startInteractiveUI-3NGJGXXS.js → startInteractiveUI-KFAOS6HC.js} +2342 -1796
  201. package/chunks/{stdioHelpers-UMY72QRP.js → stdioHelpers-HGIYTWAY.js} +3 -1
  202. package/chunks/{syntheticOutput-LELY6HAI.js → syntheticOutput-ULOVVLY4.js} +3 -3
  203. package/chunks/{task-create-QY3BIMNM.js → task-create-DUE2PMNI.js} +7 -7
  204. package/chunks/{task-list-D2U47WBJ.js → task-list-WVPNX7BZ.js} +5 -5
  205. package/chunks/{task-stop-N6E5IYLH.js → task-stop-CPEQWOT6.js} +2 -2
  206. package/chunks/{task-update-HJCQILLB.js → task-update-HY2LNFFB.js} +7 -7
  207. package/chunks/{team-create-UPLVZQFX.js → team-create-Q5B5M7UD.js} +26 -27
  208. package/chunks/{team-delete-RCWYDRF4.js → team-delete-JJV6IUOA.js} +5 -5
  209. package/chunks/{team-plan-approval-F5F432RO.js → team-plan-approval-J55PXNY2.js} +26 -27
  210. package/chunks/{theme-manager-JJE4BJ67.js → theme-manager-QWTDRPHV.js} +27 -28
  211. package/chunks/todoWrite-JHHIDOIV.js +358 -0
  212. package/chunks/{tool-search-LRXI4JLZ.js → tool-search-LSSKWZKH.js} +10 -11
  213. package/chunks/{total-session-admission-I4DHN6UP.js → total-session-admission-S6ATY5HY.js} +32 -33
  214. package/chunks/{trustedFolders-SEH7LNX2.js → trustedFolders-CY4TUPDJ.js} +28 -29
  215. package/chunks/turndown.cjs-FZHGMUTY.js +17670 -0
  216. package/chunks/{update-relaunch-T6ZKBUA6.js → update-relaunch-IOKOUV3K.js} +6 -6
  217. package/chunks/{updateCheck-FWLXZPRO.js → updateCheck-YNRFE4V7.js} +30 -31
  218. package/chunks/{validateNonInterActiveAuth-X6K2VWYT.js → validateNonInterActiveAuth-OXTECS4B.js} +68 -68
  219. package/chunks/{version-LIFSOGSE.js → version-2CZQQDL5.js} +1 -1
  220. package/chunks/web-fetch-7QTEGJI5.js +938 -0
  221. package/chunks/{workflow-NX2DFWGD.js → workflow-G3CZU256.js} +29 -30
  222. package/chunks/{workspace-providers-status-VYD6M2NE.js → workspace-providers-status-UHQOIPAZ.js} +35 -36
  223. package/chunks/{workspace-registration-store-2Y6PWOEL.js → workspace-registration-store-5WPCMX4F.js} +1 -1
  224. package/chunks/{workspace-registry-PKBDBWCA.js → workspace-registry-LAQCRQTH.js} +32 -33
  225. package/chunks/{workspace-service-HHORUHTS.js → workspace-service-6ZEUJY2Z.js} +38 -39
  226. package/chunks/{workspace-skills-status-O5Q26LIY.js → workspace-skills-status-YG6OITSM.js} +33 -34
  227. package/chunks/{write-file-NVAEZ3J2.js → write-file-E7T3PU3B.js} +60 -28
  228. package/chunks/{zh-PAUNIMHQ.js → zh-6ANG2HTL.js} +7 -3
  229. package/chunks/{zh-TW-GNEUIUFF.js → zh-TW-4RR3YHNN.js} +7 -3
  230. package/cli-entry.js +37 -2
  231. package/cli.js +17 -11
  232. package/locales/ca.js +3 -2
  233. package/locales/de.js +3 -2
  234. package/locales/en.js +10 -5
  235. package/locales/fr.js +3 -2
  236. package/locales/ja.js +3 -2
  237. package/locales/pt.js +3 -2
  238. package/locales/ru.js +3 -2
  239. package/locales/zh-TW.js +9 -3
  240. package/locales/zh.js +9 -3
  241. package/package.json +3 -3
  242. package/web-shell/assets/{arc-H74fE8UR.js → arc-_dVIKMdB.js} +1 -1
  243. package/web-shell/assets/{architectureDiagram-3BPJPVTR-DN3kEq-I.js → architectureDiagram-3BPJPVTR-MuN3nKpL.js} +1 -1
  244. package/web-shell/assets/{blockDiagram-GPEHLZMM-BrqbsFUF.js → blockDiagram-GPEHLZMM-BtmvJjzx.js} +1 -1
  245. package/web-shell/assets/{c4Diagram-AAUBKEIU-ClFhU1P-.js → c4Diagram-AAUBKEIU-Dvi58_BU.js} +1 -1
  246. package/web-shell/assets/channel-Bi5TehaT.js +1 -0
  247. package/web-shell/assets/{chunk-2J33WTMH-jCIcG0_M.js → chunk-2J33WTMH-YqxOVhS1.js} +1 -1
  248. package/web-shell/assets/{chunk-4BX2VUAB-DSkGe62-.js → chunk-4BX2VUAB-DoBgbC9z.js} +1 -1
  249. package/web-shell/assets/{chunk-55IACEB6-BxBHOGTd.js → chunk-55IACEB6-3NEQrBAr.js} +1 -1
  250. package/web-shell/assets/{chunk-727SXJPM-v_DS7dH7.js → chunk-727SXJPM-DrCZQxp0.js} +1 -1
  251. package/web-shell/assets/{chunk-AQP2D5EJ-1RzEKRPq.js → chunk-AQP2D5EJ-m_g3zjgv.js} +1 -1
  252. package/web-shell/assets/{chunk-FMBD7UC4-DyrSbLOX.js → chunk-FMBD7UC4-D1_crABJ.js} +1 -1
  253. package/web-shell/assets/{chunk-ND2GUHAM-BCmdsZiy.js → chunk-ND2GUHAM-BdhgVtBx.js} +1 -1
  254. package/web-shell/assets/{chunk-QZHKN3VN-CphHGW2D.js → chunk-QZHKN3VN-BlmThhm-.js} +1 -1
  255. package/web-shell/assets/classDiagram-4FO5ZUOK-BKhhRdd1.js +1 -0
  256. package/web-shell/assets/classDiagram-v2-Q7XG4LA2-BKhhRdd1.js +1 -0
  257. package/web-shell/assets/{cose-bilkent-S5V4N54A-D5kRC7Fi.js → cose-bilkent-S5V4N54A-Cbjm_00Z.js} +1 -1
  258. package/web-shell/assets/{dagre-BM42HDAG-DIiyJJ0U.js → dagre-BM42HDAG-C39QNVgC.js} +1 -1
  259. package/web-shell/assets/{diagram-2AECGRRQ-BOcuB8xU.js → diagram-2AECGRRQ-DNXSAixC.js} +1 -1
  260. package/web-shell/assets/{diagram-5GNKFQAL-CMgiZ4d3.js → diagram-5GNKFQAL-BCbGUPEA.js} +1 -1
  261. package/web-shell/assets/{diagram-KO2AKTUF-Ctx8pfN0.js → diagram-KO2AKTUF-1eujKSDC.js} +1 -1
  262. package/web-shell/assets/{diagram-LMA3HP47-BT5REAWC.js → diagram-LMA3HP47-DUMKXgql.js} +1 -1
  263. package/web-shell/assets/{diagram-OG6HWLK6-CJkUqXcp.js → diagram-OG6HWLK6-BFktU3_u.js} +1 -1
  264. package/web-shell/assets/{erDiagram-TEJ5UH35-DyvNNX6v.js → erDiagram-TEJ5UH35-BvJC7DLk.js} +1 -1
  265. package/web-shell/assets/{flowDiagram-I6XJVG4X-VBf8_My8.js → flowDiagram-I6XJVG4X-Cgu3PlOt.js} +1 -1
  266. package/web-shell/assets/{ganttDiagram-6RSMTGT7-CviJnR7B.js → ganttDiagram-6RSMTGT7-DLNXN5Xh.js} +1 -1
  267. package/web-shell/assets/{gitGraphDiagram-PVQCEYII-BY66_Oze.js → gitGraphDiagram-PVQCEYII-BQFRDv6R.js} +1 -1
  268. package/web-shell/assets/index-C_ouplMQ.js +1187 -0
  269. package/web-shell/assets/{index-DhYuvi3j.js → index-CdC3pjP3.js} +1 -1
  270. package/web-shell/assets/index-XGDFJE-X.css +5 -0
  271. package/web-shell/assets/{infoDiagram-5YYISTIA-D2jaewWZ.js → infoDiagram-5YYISTIA-DT2mOSvp.js} +1 -1
  272. package/web-shell/assets/{ishikawaDiagram-YF4QCWOH-BpnNTyi5.js → ishikawaDiagram-YF4QCWOH-9fy_K4bd.js} +1 -1
  273. package/web-shell/assets/{journeyDiagram-JHISSGLW-CA55GNZF.js → journeyDiagram-JHISSGLW-CoGSEuhE.js} +1 -1
  274. package/web-shell/assets/{kanban-definition-UN3LZRKU-DyiSl_Ts.js → kanban-definition-UN3LZRKU-BP9hHYIj.js} +1 -1
  275. package/web-shell/assets/{linear-B-sN3dkV.js → linear-uIroDsmp.js} +1 -1
  276. package/web-shell/assets/{mermaid.core-xf9SXDdb.js → mermaid.core-BUwoStsA.js} +5 -5
  277. package/web-shell/assets/{mindmap-definition-RKZ34NQL-DXhr2kRk.js → mindmap-definition-RKZ34NQL-DZB-FWim.js} +1 -1
  278. package/web-shell/assets/{pieDiagram-4H26LBE5-DUXpbfGQ.js → pieDiagram-4H26LBE5-YPptloKl.js} +1 -1
  279. package/web-shell/assets/{quadrantDiagram-W4KKPZXB-NeDQYeWw.js → quadrantDiagram-W4KKPZXB-dgk3DSzm.js} +1 -1
  280. package/web-shell/assets/{requirementDiagram-4Y6WPE33-BSbFRL1A.js → requirementDiagram-4Y6WPE33-BH2En2i9.js} +1 -1
  281. package/web-shell/assets/{sankeyDiagram-5OEKKPKP-gg27cAaN.js → sankeyDiagram-5OEKKPKP-BB98feeI.js} +1 -1
  282. package/web-shell/assets/{sequenceDiagram-3UESZ5HK-Bi_1TSs4.js → sequenceDiagram-3UESZ5HK-CunAIGh8.js} +1 -1
  283. package/web-shell/assets/{stateDiagram-AJRCARHV-CboCCRaf.js → stateDiagram-AJRCARHV-DTJs_-I2.js} +1 -1
  284. package/web-shell/assets/stateDiagram-v2-BHNVJYJU-DrfFMYta.js +1 -0
  285. package/web-shell/assets/{timeline-definition-PNZ67QCA-DrGpF_jn.js → timeline-definition-PNZ67QCA-Cd4AN7O0.js} +1 -1
  286. package/web-shell/assets/{vennDiagram-CIIHVFJN-DCaJU67x.js → vennDiagram-CIIHVFJN-xIG-rUU9.js} +1 -1
  287. package/web-shell/assets/{wardley-L42UT6IY-p0QcW1aP.js → wardley-L42UT6IY-D1UyjIcG.js} +1 -1
  288. package/web-shell/assets/{wardleyDiagram-YWT4CUSO-DiEVxj1W.js → wardleyDiagram-YWT4CUSO-BVM0Mb99.js} +1 -1
  289. package/web-shell/assets/{xychartDiagram-2RQKCTM6-iQB8nSlA.js → xychartDiagram-2RQKCTM6-BX31JDSz.js} +1 -1
  290. package/web-shell/index.html +2 -2
  291. package/chunks/chunk-2HRYPZT5.js +0 -25
  292. package/chunks/chunk-QAW7PIHT.js +0 -168
  293. package/chunks/chunk-RTV5TUYB.js +0 -143
  294. package/chunks/chunk-ZPAHLFZU.js +0 -172
  295. package/chunks/exitPlanMode-HYQL4XMB.js +0 -909
  296. package/chunks/nonInteractiveCli-UMYUT643.js +0 -129
  297. package/chunks/todoWrite-FKCGATPJ.js +0 -531
  298. package/chunks/web-fetch-CFCWTCAP.js +0 -5673
  299. package/web-shell/assets/channel-NFC5ADAa.js +0 -1
  300. package/web-shell/assets/classDiagram-4FO5ZUOK-DHgwjz3X.js +0 -1
  301. package/web-shell/assets/classDiagram-v2-Q7XG4LA2-DHgwjz3X.js +0 -1
  302. package/web-shell/assets/index-8xIBbHV3.js +0 -1143
  303. package/web-shell/assets/index-DLyhlZZO.css +0 -5
  304. package/web-shell/assets/stateDiagram-v2-BHNVJYJU-CXRqms6P.js +0 -1
@@ -1,12 +1,5 @@
1
1
  // Force strict mode and setup for ESM
2
2
  "use strict";
3
- import {
4
- LOAD_REPLAY_BULK_MODE,
5
- LOAD_REPLAY_META_KEY,
6
- LOAD_REPLAY_MODE_META_KEY,
7
- LOAD_REPLAY_VERSION,
8
- MID_TURN_QUEUE_DRAIN_METHOD
9
- } from "./chunk-PZL23GTM.js";
10
3
  import {
11
4
  DEFAULT_RING_SIZE,
12
5
  EVENT_SCHEMA_VERSION,
@@ -16,6 +9,20 @@ import {
16
9
  import {
17
10
  normalizeCompactedReplayMaxBytes
18
11
  } from "./chunk-COH43MRJ.js";
12
+ import {
13
+ CHANNEL_STARTUP_PROFILE_META_KEY,
14
+ CHANNEL_STARTUP_PROFILE_VERSION,
15
+ LOAD_REPLAY_BULK_MODE,
16
+ LOAD_REPLAY_META_KEY,
17
+ LOAD_REPLAY_MODE_META_KEY,
18
+ LOAD_REPLAY_PAGE_SIZE_META_KEY,
19
+ LOAD_REPLAY_VERSION,
20
+ MID_TURN_QUEUE_DRAIN_METHOD,
21
+ TODO_STOP_GUARD_QUEUE_RELEASE_METHOD
22
+ } from "./chunk-QR6U5QPP.js";
23
+ import {
24
+ defaultSpawnChannelFactory
25
+ } from "./chunk-FEZXQXW2.js";
19
26
  import {
20
27
  BranchWhilePromptActiveError,
21
28
  CancelSentinelCollisionError,
@@ -36,10 +43,7 @@ import {
36
43
  SessionShellDisabledError,
37
44
  WorkspaceMismatchError,
38
45
  isNotCurrentlyGeneratingCancelError
39
- } from "./chunk-L4Y55KIS.js";
40
- import {
41
- defaultSpawnChannelFactory
42
- } from "./chunk-3AYLDB6B.js";
46
+ } from "./chunk-X6YQWCIJ.js";
43
47
  import {
44
48
  BridgeChannelClosedError,
45
49
  BridgeTimeoutError,
@@ -48,7 +52,7 @@ import {
48
52
  STATUS_SCHEMA_VERSION,
49
53
  createIdleWorkspaceExtensionsStatus,
50
54
  createIdleWorkspaceHooksStatus
51
- } from "./chunk-VFX7EZIR.js";
55
+ } from "./chunk-TFV3XVAZ.js";
52
56
  import {
53
57
  canonicalizeWorkspace
54
58
  } from "./chunk-W7FJ3N32.js";
@@ -68,11 +72,11 @@ import {
68
72
  metadataBudgetBytes,
69
73
  normalizeSnapshotPayload,
70
74
  stableSessionArtifactId
71
- } from "./chunk-NJOFRXTM.js";
75
+ } from "./chunk-6TDA4EVC.js";
72
76
  import {
73
77
  DAEMON_TRACEPARENT_META_KEY,
74
78
  DAEMON_TRACESTATE_META_KEY
75
- } from "./chunk-MQOVXZAF.js";
79
+ } from "./chunk-YN2I5I42.js";
76
80
  import {
77
81
  init_esbuild_shims
78
82
  } from "./chunk-5O2XNYP6.js";
@@ -100,6 +104,23 @@ var LATEST_WINS_UPDATES = /* @__PURE__ */ new Set([
100
104
  "current_mode_update"
101
105
  ]);
102
106
  var REPLAY_SEGMENT_COMPACT_THRESHOLD = 64;
107
+ function replayRecordId(event) {
108
+ if (event.type !== "session_update") return void 0;
109
+ const data = event.data;
110
+ if (!data || typeof data !== "object" || Array.isArray(data))
111
+ return void 0;
112
+ const update = data["update"];
113
+ if (!update || typeof update !== "object" || Array.isArray(update)) {
114
+ return void 0;
115
+ }
116
+ const meta = update["_meta"];
117
+ if (!meta || typeof meta !== "object" || Array.isArray(meta)) {
118
+ return void 0;
119
+ }
120
+ const recordId = meta["qwen.session.recordId"];
121
+ return typeof recordId === "string" ? recordId : void 0;
122
+ }
123
+ __name(replayRecordId, "replayRecordId");
103
124
  var TurnBoundaryCompactionEngine = class {
104
125
  static {
105
126
  __name(this, "TurnBoundaryCompactionEngine");
@@ -167,11 +188,29 @@ var TurnBoundaryCompactionEngine = class {
167
188
  seedReplayEvents(events) {
168
189
  if (this.closed) return;
169
190
  this.resetReplayWindow();
191
+ let recordEvents = [];
192
+ let recordId;
193
+ const flushRecord = /* @__PURE__ */ __name(() => {
194
+ this.addReplaySegment(recordEvents, 0);
195
+ recordEvents = [];
196
+ recordId = void 0;
197
+ }, "flushRecord");
170
198
  for (const event of events) {
171
199
  this.recordLastEventId(event);
172
200
  if (TRANSIENT_TYPES.has(event.type)) continue;
173
- this.addReplaySegment([event], 0);
201
+ const nextRecordId = replayRecordId(event);
202
+ if (nextRecordId === void 0) {
203
+ flushRecord();
204
+ this.addReplaySegment([event], 0);
205
+ continue;
206
+ }
207
+ if (recordId !== void 0 && recordId !== nextRecordId) {
208
+ flushRecord();
209
+ }
210
+ recordId = nextRecordId;
211
+ recordEvents.push(event);
174
212
  }
213
+ flushRecord();
175
214
  this.liveJournal = [];
176
215
  this.slots = [];
177
216
  this.toolSlotIndex.clear();
@@ -195,6 +234,10 @@ var TurnBoundaryCompactionEngine = class {
195
234
  }
196
235
  switch (updateType) {
197
236
  case "agent_message_chunk": {
237
+ if (hasTodoStopGuardDiscreteMeta(data?.update?._meta)) {
238
+ this.slots.push({ kind: "misc", event });
239
+ break;
240
+ }
198
241
  this.mergeTextSlot("text", event, data);
199
242
  break;
200
243
  }
@@ -444,6 +487,10 @@ function extractParentToolCallIdFromMeta(meta) {
444
487
  return void 0;
445
488
  }
446
489
  __name(extractParentToolCallIdFromMeta, "extractParentToolCallIdFromMeta");
490
+ function hasTodoStopGuardDiscreteMeta(meta) {
491
+ return typeof meta === "object" && meta !== null && meta["qwenDiscreteMessage"] === true && meta["source"] === "todo_stop_guard";
492
+ }
493
+ __name(hasTodoStopGuardDiscreteMeta, "hasTodoStopGuardDiscreteMeta");
447
494
  function mergeToolCallEvent(existing, incoming) {
448
495
  const existingData = existing.data;
449
496
  const incomingData = incoming.data;
@@ -495,6 +542,108 @@ function parseSessionSource(sourceType, sourceId) {
495
542
  }
496
543
  __name(parseSessionSource, "parseSessionSource");
497
544
 
545
+ // packages/acp-bridge/src/channel-startup-profile.ts
546
+ init_esbuild_shims();
547
+ var MAX_PROFILE_DURATION_MS = 6e5;
548
+ var ATTRIBUTE_PREFIX = "qwen-code.daemon.acp_startup";
549
+ function isRecord(value) {
550
+ return value !== null && typeof value === "object" && !Array.isArray(value);
551
+ }
552
+ __name(isRecord, "isRecord");
553
+ function readDuration(source, key) {
554
+ const value = source[key];
555
+ return typeof value === "number" && Number.isFinite(value) && value >= 0 && value <= MAX_PROFILE_DURATION_MS ? value : void 0;
556
+ }
557
+ __name(readDuration, "readDuration");
558
+ function readDurations(source, keys) {
559
+ if (!isRecord(source)) {
560
+ return { values: {}, complete: false };
561
+ }
562
+ const values = {};
563
+ let complete = true;
564
+ for (const key of keys) {
565
+ const value = readDuration(source, key);
566
+ if (value === void 0) {
567
+ complete = false;
568
+ } else {
569
+ values[key] = value;
570
+ }
571
+ }
572
+ return { values, complete };
573
+ }
574
+ __name(readDurations, "readDurations");
575
+ function addDurationAttributes(attributes, group, values) {
576
+ for (const [key, value] of Object.entries(values)) {
577
+ if (group === "phase" && key === "unattributedMs") continue;
578
+ const attributeKey = key.replace(
579
+ /[A-Z]/g,
580
+ (letter) => `_${letter.toLowerCase()}`
581
+ );
582
+ attributes[`${ATTRIBUTE_PREFIX}.${group}.${attributeKey}`] = value;
583
+ }
584
+ }
585
+ __name(addDurationAttributes, "addDurationAttributes");
586
+ var PHASE_KEYS = [
587
+ "processToProfilerReadyMs",
588
+ "geminiImportMs",
589
+ "argsParseMs",
590
+ "settingsLoadMs",
591
+ "configConstructionMs",
592
+ "appInitializationMs",
593
+ "acpImportMs",
594
+ "bootstrapConfigInitializationMs",
595
+ "transportSetupMs",
596
+ "initializeHandlerMs",
597
+ "unattributedMs"
598
+ ];
599
+ var CONFIG_KEYS = [
600
+ "extensionsInitialMs",
601
+ "hooksMs",
602
+ "skillsMs",
603
+ "extensionsFinalMs",
604
+ "hierarchicalMemoryMs",
605
+ "toolRegistryMs",
606
+ "ripgrepProbeMs",
607
+ "toolWarmupMs",
608
+ "otherMs"
609
+ ];
610
+ function getChannelStartupProfileAttributes(response, receivedAtEpochMs, initializeTimeoutMs) {
611
+ if (!isRecord(response) || !isRecord(response["_meta"])) {
612
+ return void 0;
613
+ }
614
+ const profile = response["_meta"][CHANNEL_STARTUP_PROFILE_META_KEY];
615
+ if (!isRecord(profile) || profile["v"] !== CHANNEL_STARTUP_PROFILE_VERSION) {
616
+ return void 0;
617
+ }
618
+ const phases = readDurations(profile["phases"], PHASE_KEYS);
619
+ const config = readDurations(profile["config"], CONFIG_KEYS);
620
+ const processToResponseMs = readDuration(profile, "processToResponseMs");
621
+ const responseBuiltAtEpochMs = profile["responseBuiltAtEpochMs"];
622
+ const childComplete = profile["complete"] === true;
623
+ const validResponseEpoch = typeof responseBuiltAtEpochMs === "number" && Number.isFinite(responseBuiltAtEpochMs) && responseBuiltAtEpochMs >= 0;
624
+ const effectiveComplete = childComplete && phases.complete && config.complete && processToResponseMs !== void 0 && validResponseEpoch;
625
+ const attributes = {
626
+ [`${ATTRIBUTE_PREFIX}.profile.version`]: CHANNEL_STARTUP_PROFILE_VERSION,
627
+ [`${ATTRIBUTE_PREFIX}.profile.complete`]: effectiveComplete
628
+ };
629
+ if (processToResponseMs !== void 0) {
630
+ attributes[`${ATTRIBUTE_PREFIX}.child.process_to_response_ms`] = processToResponseMs;
631
+ }
632
+ if (phases.values["unattributedMs"] !== void 0) {
633
+ attributes[`${ATTRIBUTE_PREFIX}.child.unattributed_ms`] = phases.values["unattributedMs"];
634
+ }
635
+ addDurationAttributes(attributes, "phase", phases.values);
636
+ addDurationAttributes(attributes, "config", config.values);
637
+ if (validResponseEpoch) {
638
+ const transportMs = receivedAtEpochMs - responseBuiltAtEpochMs;
639
+ if (Number.isFinite(transportMs) && transportMs >= 0 && transportMs <= initializeTimeoutMs) {
640
+ attributes[`${ATTRIBUTE_PREFIX}.response_transport_ms`] = transportMs;
641
+ }
642
+ }
643
+ return attributes;
644
+ }
645
+ __name(getChannelStartupProfileAttributes, "getChannelStartupProfileAttributes");
646
+
498
647
  // packages/acp-bridge/src/internal/stderrLine.ts
499
648
  init_esbuild_shims();
500
649
  function writeStderrLine(message) {
@@ -567,8 +716,8 @@ var MultiClientPermissionMediator = class {
567
716
  * an identical line (the unanimity condition is the NORMAL
568
717
  * operating mode for M=2, not a rare edge); a busy session with
569
718
  * many tool calls would produce dozens of duplicate stderr lines
570
- * within seconds. One emit per mediator (= per daemon lifetime
571
- * since the bridge constructs one) is enough to make the
719
+ * within seconds. One emit per mediator (= per bridge/runtime lifetime
720
+ * since each bridge constructs one) is enough to make the
572
721
  * configuration visible without spam.
573
722
  */
574
723
  unanimityBreadcrumbEmitted = false;
@@ -627,6 +776,7 @@ var MultiClientPermissionMediator = class {
627
776
  const pending = {
628
777
  requestId: record.requestId,
629
778
  sessionId: record.sessionId,
779
+ promptId: record.promptId,
630
780
  policy,
631
781
  originatorClientId: record.originatorClientId,
632
782
  allowedOptionIds: record.allowedOptionIds,
@@ -700,6 +850,7 @@ var MultiClientPermissionMediator = class {
700
850
  const optionId = prior.resolution.kind === "option" ? prior.resolution.optionId : CANCEL_VOTE_SENTINEL;
701
851
  this.safeEmit(prior.sessionId, {
702
852
  type: "permission_already_resolved",
853
+ ...prior.promptId ? { promptId: prior.promptId } : {},
703
854
  data: {
704
855
  requestId: prior.requestId,
705
856
  sessionId: prior.sessionId,
@@ -865,6 +1016,7 @@ var MultiClientPermissionMediator = class {
865
1016
  );
866
1017
  this.safeEmit(pending.sessionId, {
867
1018
  type: "permission_partial_vote",
1019
+ ...pending.promptId ? { promptId: pending.promptId } : {},
868
1020
  data: {
869
1021
  requestId: pending.requestId,
870
1022
  sessionId: pending.sessionId,
@@ -938,6 +1090,7 @@ var MultiClientPermissionMediator = class {
938
1090
  );
939
1091
  this.safeEmit(pending.sessionId, {
940
1092
  type: "permission_forbidden",
1093
+ ...pending.promptId ? { promptId: pending.promptId } : {},
941
1094
  data: {
942
1095
  requestId: pending.requestId,
943
1096
  sessionId: pending.sessionId,
@@ -1060,6 +1213,7 @@ var MultiClientPermissionMediator = class {
1060
1213
  this.pending.delete(pending.requestId);
1061
1214
  this.safeEmit(pending.sessionId, {
1062
1215
  type: "permission_resolved",
1216
+ ...pending.promptId ? { promptId: pending.promptId } : {},
1063
1217
  data: {
1064
1218
  requestId: pending.requestId,
1065
1219
  outcome: this.toAcpOutcome(resolution),
@@ -1083,6 +1237,7 @@ var MultiClientPermissionMediator = class {
1083
1237
  this.rememberResolved({
1084
1238
  requestId: pending.requestId,
1085
1239
  sessionId: pending.sessionId,
1240
+ promptId: pending.promptId,
1086
1241
  resolution,
1087
1242
  resolverClientId
1088
1243
  });
@@ -1181,6 +1336,7 @@ var MultiClientPermissionMediator = class {
1181
1336
  return {
1182
1337
  requestId: pending.requestId,
1183
1338
  sessionId: pending.sessionId,
1339
+ ...pending.promptId ? { promptId: pending.promptId } : {},
1184
1340
  originatorClientId: pending.originatorClientId,
1185
1341
  allowedOptionIds: pending.allowedOptionIds,
1186
1342
  issuedAtMs: pending.issuedAtMs
@@ -1200,10 +1356,10 @@ function isFsErrorShape(err) {
1200
1356
  return err instanceof Error && err.name === "FsError" && typeof err.kind === "string";
1201
1357
  }
1202
1358
  __name(isFsErrorShape, "isFsErrorShape");
1203
- function isRecord(value) {
1359
+ function isRecord2(value) {
1204
1360
  return typeof value === "object" && value !== null && !Array.isArray(value);
1205
1361
  }
1206
- __name(isRecord, "isRecord");
1362
+ __name(isRecord2, "isRecord");
1207
1363
  function pendingInteractionOptions(options) {
1208
1364
  return options.map((option) => ({
1209
1365
  optionId: String(option.optionId ?? ""),
@@ -1214,21 +1370,21 @@ function pendingInteractionOptions(options) {
1214
1370
  __name(pendingInteractionOptions, "pendingInteractionOptions");
1215
1371
  function pendingInteractionFromRequest(requestId, params) {
1216
1372
  const toolCall = params.toolCall;
1217
- const meta = isRecord(toolCall["_meta"]) ? toolCall["_meta"] : void 0;
1373
+ const meta = isRecord2(toolCall["_meta"]) ? toolCall["_meta"] : void 0;
1218
1374
  const rawInput = toolCall["rawInput"];
1219
1375
  const options = pendingInteractionOptions(
1220
1376
  Array.isArray(params.options) ? params.options : []
1221
1377
  );
1222
1378
  const isUserQuestion = meta?.["qwenInteractionKind"] === "user_question";
1223
1379
  if (isUserQuestion) {
1224
- const rawQuestions = Array.isArray(meta?.["qwenQuestions"]) ? meta["qwenQuestions"] : isRecord(rawInput) && Array.isArray(rawInput["questions"]) ? rawInput["questions"] : [];
1380
+ const rawQuestions = Array.isArray(meta?.["qwenQuestions"]) ? meta["qwenQuestions"] : isRecord2(rawInput) && Array.isArray(rawInput["questions"]) ? rawInput["questions"] : [];
1225
1381
  return {
1226
1382
  requestId,
1227
1383
  kind: "user_question",
1228
1384
  createdAt: (/* @__PURE__ */ new Date()).toISOString(),
1229
1385
  ...typeof toolCall["title"] === "string" ? { title: toolCall["title"] } : {},
1230
1386
  questions: rawQuestions.flatMap(
1231
- (question, index) => isRecord(question) ? [{ ...question, answerKey: String(index) }] : []
1387
+ (question, index) => isRecord2(question) ? [{ ...question, answerKey: String(index) }] : []
1232
1388
  ),
1233
1389
  options
1234
1390
  };
@@ -1278,7 +1434,7 @@ function extractCappedArtifactInputs(rawArtifacts, limit, sessionId, source, toI
1278
1434
  const artifacts = [];
1279
1435
  for (let index = 0; index < rawArtifacts.length; index++) {
1280
1436
  const artifact = rawArtifacts[index];
1281
- if (!isRecord(artifact)) {
1437
+ if (!isRecord2(artifact)) {
1282
1438
  writeStderrLine(
1283
1439
  `[artifacts] session=${sessionId} action=dropped reason=malformed source=${source} index=${index}`
1284
1440
  );
@@ -1452,6 +1608,7 @@ var BridgeClient = class {
1452
1608
  }
1453
1609
  const published = entry.events.publish({
1454
1610
  type: "permission_request",
1611
+ ...entry.activePromptId ? { promptId: entry.activePromptId } : {},
1455
1612
  data: {
1456
1613
  requestId,
1457
1614
  sessionId: entry.sessionId,
@@ -1479,6 +1636,7 @@ var BridgeClient = class {
1479
1636
  const record = {
1480
1637
  requestId,
1481
1638
  sessionId: entry.sessionId,
1639
+ promptId: entry.activePromptId,
1482
1640
  originatorClientId: entry.activePromptOriginatorClientId,
1483
1641
  allowedOptionIds,
1484
1642
  issuedAtMs: Date.now()
@@ -1512,13 +1670,21 @@ var BridgeClient = class {
1512
1670
  } catch {
1513
1671
  }
1514
1672
  if (entry && prepared.artifacts.length > 0) {
1515
- await this.upsertAndPublishArtifacts(entry, prepared.artifacts, {
1516
- trustedPublisher: prepared.trustedPublisher
1517
- });
1673
+ await this.upsertAndPublishArtifacts(
1674
+ entry,
1675
+ prepared.artifacts,
1676
+ {
1677
+ trustedPublisher: prepared.trustedPublisher
1678
+ },
1679
+ prepared.turn
1680
+ );
1518
1681
  }
1519
1682
  }
1520
1683
  prepareSessionUpdateFrames(params, entry) {
1521
- const originator = entry?.activePromptOriginatorClientId ? { originatorClientId: entry.activePromptOriginatorClientId } : {};
1684
+ const turn = {
1685
+ ...entry?.activePromptId ? { promptId: entry.activePromptId } : {},
1686
+ ...entry?.activePromptOriginatorClientId ? { originatorClientId: entry.activePromptOriginatorClientId } : {}
1687
+ };
1522
1688
  const frames = [];
1523
1689
  const a2ui = extractA2uiToolUpdate(params);
1524
1690
  if (a2ui) {
@@ -1537,7 +1703,7 @@ var BridgeClient = class {
1537
1703
  _meta: { serverTimestamp: Date.now(), source: "a2ui-bridge" }
1538
1704
  }
1539
1705
  },
1540
- ...originator
1706
+ ...turn
1541
1707
  });
1542
1708
  }
1543
1709
  params = a2ui.sanitizedParams;
@@ -1555,13 +1721,14 @@ var BridgeClient = class {
1555
1721
  frames.push({
1556
1722
  type: "session_update",
1557
1723
  data: publishParams,
1558
- ...originator,
1724
+ ...turn,
1559
1725
  ...serverTimestamp !== void 0 ? { _meta: { serverTimestamp } } : {}
1560
1726
  });
1561
1727
  return {
1562
1728
  frames,
1563
1729
  artifacts,
1564
- trustedPublisher: isTrustedArtifactToolUpdate(params, updateMeta)
1730
+ trustedPublisher: isTrustedArtifactToolUpdate(params, updateMeta),
1731
+ turn
1565
1732
  };
1566
1733
  }
1567
1734
  async seedSessionUpdates(entry, updates, options = {}) {
@@ -1576,15 +1743,21 @@ var BridgeClient = class {
1576
1743
  if (options.ingestArtifacts !== false && prepared.artifacts.length > 0) {
1577
1744
  artifactBatches.push({
1578
1745
  artifacts: prepared.artifacts,
1579
- trustedPublisher: prepared.trustedPublisher
1746
+ trustedPublisher: prepared.trustedPublisher,
1747
+ turn: prepared.turn
1580
1748
  });
1581
1749
  }
1582
1750
  }
1583
1751
  entry.events.seedReplayEvents(frames);
1584
1752
  for (const batch of artifactBatches) {
1585
- await this.upsertAndPublishArtifacts(entry, batch.artifacts, {
1586
- trustedPublisher: batch.trustedPublisher
1587
- });
1753
+ await this.upsertAndPublishArtifacts(
1754
+ entry,
1755
+ batch.artifacts,
1756
+ {
1757
+ trustedPublisher: batch.trustedPublisher
1758
+ },
1759
+ batch.turn
1760
+ );
1588
1761
  }
1589
1762
  }
1590
1763
  /**
@@ -1692,11 +1865,17 @@ var BridgeClient = class {
1692
1865
  throw RequestError.methodNotFound(method);
1693
1866
  }
1694
1867
  const sessionId = typeof params["sessionId"] === "string" ? params["sessionId"] : void 0;
1695
- if (!sessionId) return { messages: [] };
1868
+ if (!sessionId) return { messages: [], hasQueuedPrompt: false };
1696
1869
  const entry = this.resolveEntry(sessionId);
1697
- if (!entry) return { messages: [] };
1870
+ if (!entry) return { messages: [], hasQueuedPrompt: false };
1698
1871
  const drained = entry.midTurnMessageQueue.splice(0);
1699
1872
  const messages = drained.map((item) => item.text);
1873
+ const hasQueuedPrompt = entry.pendingPromptList.some(
1874
+ (prompt) => prompt.state === "queued" && !prompt.abortController.signal.aborted
1875
+ );
1876
+ if (params["todoStopGuardWatchQueuedPrompt"] === true) {
1877
+ entry.todoStopGuardAwaitingQueuedPrompt = hasQueuedPrompt;
1878
+ }
1700
1879
  if (drained.length > 0) {
1701
1880
  const byOriginator = /* @__PURE__ */ new Map();
1702
1881
  for (const item of drained) {
@@ -1707,6 +1886,7 @@ var BridgeClient = class {
1707
1886
  for (const [originatorClientId, texts] of byOriginator) {
1708
1887
  const published = entry.events.publish({
1709
1888
  type: MID_TURN_MESSAGE_INJECTED_EVENT,
1889
+ ...entry.activePromptId ? { promptId: entry.activePromptId } : {},
1710
1890
  data: { sessionId: entry.sessionId, messages: texts },
1711
1891
  ...originatorClientId ? { originatorClientId } : {}
1712
1892
  });
@@ -1715,7 +1895,7 @@ var BridgeClient = class {
1715
1895
  );
1716
1896
  }
1717
1897
  }
1718
- return { messages };
1898
+ return { messages, hasQueuedPrompt };
1719
1899
  }
1720
1900
  /**
1721
1901
  * Reverse tool channel (issue #5626, Phase 2) — answer the child's
@@ -1958,7 +2138,7 @@ var BridgeClient = class {
1958
2138
  const { v: _v2, sessionId: _sid2, ...rest2 } = params;
1959
2139
  void _v2;
1960
2140
  void _sid2;
1961
- this.publishExtNotification(sessionId2, "terminal_sequence", rest2);
2141
+ this.publishExtNotification(sessionId2, "terminal_sequence", rest2, true);
1962
2142
  return;
1963
2143
  }
1964
2144
  if (method === "qwen/notify/session/artifact-event") {
@@ -2021,12 +2201,16 @@ var BridgeClient = class {
2021
2201
  toolCallId
2022
2202
  })
2023
2203
  );
2024
- await this.upsertAndPublishArtifacts(entry, artifacts);
2204
+ const turn = {
2205
+ ...entry.activePromptId ? { promptId: entry.activePromptId } : {},
2206
+ ...entry.activePromptOriginatorClientId ? { originatorClientId: entry.activePromptOriginatorClientId } : {}
2207
+ };
2208
+ await this.upsertAndPublishArtifacts(entry, artifacts, void 0, turn);
2025
2209
  }
2026
- async upsertAndPublishArtifacts(entry, artifacts, options) {
2210
+ async upsertAndPublishArtifacts(entry, artifacts, options, turn = {}) {
2027
2211
  try {
2028
2212
  const result = await entry.artifacts.upsertMany(artifacts, options);
2029
- this.publishArtifactChanges(entry, result.changes);
2213
+ this.publishArtifactChanges(entry, result.changes, turn);
2030
2214
  } catch (error) {
2031
2215
  writeStderrLine(
2032
2216
  `[artifacts] session=${entry.sessionId} action=dropped reason=${JSON.stringify(
@@ -2035,20 +2219,21 @@ var BridgeClient = class {
2035
2219
  );
2036
2220
  }
2037
2221
  }
2038
- publishArtifactChanges(entry, changes) {
2222
+ publishArtifactChanges(entry, changes, turn) {
2039
2223
  for (const change of changes) {
2040
2224
  entry.events.publish({
2041
2225
  type: "artifact_changed",
2042
2226
  data: { sessionId: entry.sessionId, change },
2043
- ...entry.activePromptOriginatorClientId ? { originatorClientId: entry.activePromptOriginatorClientId } : {}
2227
+ ...turn
2044
2228
  });
2045
2229
  }
2046
2230
  }
2047
- publishExtNotification(sessionId, type, data) {
2231
+ publishExtNotification(sessionId, type, data, turnScoped = false) {
2048
2232
  const entry = this.resolveEntry(sessionId);
2049
2233
  const frame = {
2050
2234
  type,
2051
2235
  data,
2236
+ ...turnScoped && entry?.activePromptId ? { promptId: entry.activePromptId } : {},
2052
2237
  ...entry?.activePromptOriginatorClientId ? { originatorClientId: entry.activePromptOriginatorClientId } : {}
2053
2238
  };
2054
2239
  if (entry) {
@@ -2093,6 +2278,7 @@ var BridgeClient = class {
2093
2278
  } else {
2094
2279
  entry.events.publish({
2095
2280
  type: "model_switched",
2281
+ ...entry.activePromptId ? { promptId: entry.activePromptId } : {},
2096
2282
  data: { sessionId, modelId: currentModelId },
2097
2283
  ...entry.activePromptOriginatorClientId ? { originatorClientId: entry.activePromptOriginatorClientId } : {}
2098
2284
  });
@@ -2146,6 +2332,7 @@ var BridgeClient = class {
2146
2332
  } else {
2147
2333
  entry.events.publish({
2148
2334
  type: "approval_mode_changed",
2335
+ ...entry.activePromptId ? { promptId: entry.activePromptId } : {},
2149
2336
  data: {
2150
2337
  sessionId,
2151
2338
  previous: "default",
@@ -2163,6 +2350,7 @@ var BridgeClient = class {
2163
2350
  }
2164
2351
  entry.events.publish({
2165
2352
  type: "session_update",
2353
+ ...entry.activePromptId ? { promptId: entry.activePromptId } : {},
2166
2354
  data: {
2167
2355
  sessionId,
2168
2356
  update: {
@@ -4795,12 +4983,20 @@ var KNOWN_SESSION_UPDATE_TYPES = /* @__PURE__ */ new Set([
4795
4983
  "usage_update"
4796
4984
  ]);
4797
4985
  var MAX_BULK_REPLAY_UPDATES = 1e4;
4798
- function isRecord2(value) {
4986
+ function isRecord3(value) {
4799
4987
  return typeof value === "object" && value !== null && !Array.isArray(value);
4800
4988
  }
4801
- __name(isRecord2, "isRecord");
4989
+ __name(isRecord3, "isRecord");
4990
+ function getCanonicalModelId(response, fallback) {
4991
+ if (!isRecord3(response) || !isRecord3(response["_meta"])) return fallback;
4992
+ const modelSwitch = response["_meta"]["qwenModelSwitch"];
4993
+ if (!isRecord3(modelSwitch)) return fallback;
4994
+ const modelId = modelSwitch["modelId"];
4995
+ return typeof modelId === "string" ? modelId : fallback;
4996
+ }
4997
+ __name(getCanonicalModelId, "getCanonicalModelId");
4802
4998
  function isBulkReplayUpdate(value) {
4803
- if (!isRecord2(value)) return false;
4999
+ if (!isRecord3(value)) return false;
4804
5000
  const updateType = value["sessionUpdate"];
4805
5001
  return typeof updateType === "string" && KNOWN_SESSION_UPDATE_TYPES.has(updateType);
4806
5002
  }
@@ -4812,11 +5008,11 @@ function describeLoadReplayValue(value) {
4812
5008
  }
4813
5009
  __name(describeLoadReplayValue, "describeLoadReplayValue");
4814
5010
  function extractLoadReplayResponse(state) {
4815
- const meta = isRecord2(state._meta) ? state._meta : void 0;
5011
+ const meta = isRecord3(state._meta) ? state._meta : void 0;
4816
5012
  const replay = meta?.[LOAD_REPLAY_META_KEY];
4817
5013
  if (replay === void 0) return { state, updates: [] };
4818
- if (!isRecord2(replay) || replay["v"] !== LOAD_REPLAY_VERSION) {
4819
- const version = isRecord2(replay) ? replay["v"] : void 0;
5014
+ if (!isRecord3(replay) || replay["v"] !== LOAD_REPLAY_VERSION) {
5015
+ const version = isRecord3(replay) ? replay["v"] : void 0;
4820
5016
  throw new Error(
4821
5017
  `Invalid qwen.session.loadReplay payload (type=${describeLoadReplayValue(replay)}, version=${JSON.stringify(version)})`
4822
5018
  );
@@ -4844,12 +5040,18 @@ function extractLoadReplayResponse(state) {
4844
5040
  `Invalid qwen.session.loadReplay replayError (version=${LOAD_REPLAY_VERSION}, replayError=${describeLoadReplayValue(replayError)})`
4845
5041
  );
4846
5042
  }
5043
+ const hasMore = replay["hasMore"];
5044
+ if (hasMore !== void 0 && typeof hasMore !== "boolean") {
5045
+ throw new Error(
5046
+ `Invalid qwen.session.loadReplay hasMore (version=${LOAD_REPLAY_VERSION}, hasMore=${describeLoadReplayValue(hasMore)})`
5047
+ );
5048
+ }
4847
5049
  const invalidUpdateIndex = rawUpdates.findIndex(
4848
5050
  (update) => !isBulkReplayUpdate(update)
4849
5051
  );
4850
5052
  if (invalidUpdateIndex !== -1) {
4851
5053
  const invalidUpdate = rawUpdates[invalidUpdateIndex];
4852
- const discriminator = isRecord2(invalidUpdate) ? invalidUpdate["sessionUpdate"] : void 0;
5054
+ const discriminator = isRecord3(invalidUpdate) ? invalidUpdate["sessionUpdate"] : void 0;
4853
5055
  throw new Error(
4854
5056
  `Invalid qwen.session.loadReplay update at index ${invalidUpdateIndex} (version=${LOAD_REPLAY_VERSION}, count=${rawUpdates.length}, sessionUpdate=${JSON.stringify(discriminator)})`
4855
5057
  );
@@ -4866,7 +5068,8 @@ function extractLoadReplayResponse(state) {
4866
5068
  state: cleanState,
4867
5069
  updates: rawUpdates,
4868
5070
  ...partial === true ? { partial: true } : {},
4869
- ...typeof replayError === "string" ? { replayError } : {}
5071
+ ...typeof replayError === "string" ? { replayError } : {},
5072
+ ...hasMore === true ? { hasMore: true } : {}
4870
5073
  };
4871
5074
  }
4872
5075
  __name(extractLoadReplayResponse, "extractLoadReplayResponse");
@@ -4990,7 +5193,7 @@ function pickUserInputEchoMeta(meta) {
4990
5193
  return Array.isArray(inputAnnotations) ? { inputAnnotations } : {};
4991
5194
  }
4992
5195
  __name(pickUserInputEchoMeta, "pickUserInputEchoMeta");
4993
- function echoPromptToSessionBus(entry, req, originatorClientId) {
5196
+ function echoPromptToSessionBus(entry, req, promptId, originatorClientId) {
4994
5197
  const prompt = req.prompt;
4995
5198
  if (!Array.isArray(prompt) || prompt.length === 0) return;
4996
5199
  const serverTimestamp = Date.now();
@@ -5001,6 +5204,7 @@ function echoPromptToSessionBus(entry, req, originatorClientId) {
5001
5204
  try {
5002
5205
  entry.events.publish({
5003
5206
  type: "session_update",
5207
+ promptId,
5004
5208
  data: {
5005
5209
  sessionId: req.sessionId,
5006
5210
  update: {
@@ -5025,10 +5229,11 @@ function echoPromptToSessionBus(entry, req, originatorClientId) {
5025
5229
  }
5026
5230
  }
5027
5231
  __name(echoPromptToSessionBus, "echoPromptToSessionBus");
5028
- function broadcastPromptCancelled(entry, sessionId, originatorClientId, reason) {
5232
+ function broadcastPromptCancelled(entry, sessionId, promptId, originatorClientId, reason) {
5029
5233
  try {
5030
5234
  entry.events.publish({
5031
5235
  type: "prompt_cancelled",
5236
+ ...promptId ? { promptId } : {},
5032
5237
  data: { sessionId, ...reason ? { reason } : {} },
5033
5238
  ...originatorClientId ? { originatorClientId } : {}
5034
5239
  });
@@ -5036,7 +5241,7 @@ function broadcastPromptCancelled(entry, sessionId, originatorClientId, reason)
5036
5241
  }
5037
5242
  }
5038
5243
  __name(broadcastPromptCancelled, "broadcastPromptCancelled");
5039
- function broadcastPromptCancelledOnce(entry, sessionId, originatorClientId, reason) {
5244
+ function broadcastPromptCancelledOnce(entry, sessionId, promptId, originatorClientId, reason) {
5040
5245
  if (entry.cancelBroadcast) {
5041
5246
  writeStderrLine(
5042
5247
  `broadcastPromptCancelledOnce: suppressed duplicate cancel for session ${sessionId} (latch already set)`
@@ -5044,13 +5249,20 @@ function broadcastPromptCancelledOnce(entry, sessionId, originatorClientId, reas
5044
5249
  return;
5045
5250
  }
5046
5251
  entry.cancelBroadcast = true;
5047
- broadcastPromptCancelled(entry, sessionId, originatorClientId, reason);
5252
+ broadcastPromptCancelled(
5253
+ entry,
5254
+ sessionId,
5255
+ promptId,
5256
+ originatorClientId,
5257
+ reason
5258
+ );
5048
5259
  }
5049
5260
  __name(broadcastPromptCancelledOnce, "broadcastPromptCancelledOnce");
5050
5261
  function broadcastTurnComplete(entry, sessionId, promptResult, promptId, originatorClientId) {
5051
5262
  try {
5052
5263
  entry.events.publish({
5053
5264
  type: "turn_complete",
5265
+ ...promptId ? { promptId } : {},
5054
5266
  data: {
5055
5267
  sessionId,
5056
5268
  stopReason: promptResult.stopReason ?? "end_turn",
@@ -5120,6 +5332,7 @@ function broadcastTurnError(entry, sessionId, err, promptId, originatorClientId)
5120
5332
  try {
5121
5333
  entry.events.publish({
5122
5334
  type: "turn_error",
5335
+ ...promptId ? { promptId } : {},
5123
5336
  data: {
5124
5337
  sessionId,
5125
5338
  message,
@@ -5555,11 +5768,13 @@ function createAcpSessionBridge(opts) {
5555
5768
  if (channelInfo && !channelInfo.isDying) return channelInfo;
5556
5769
  if (inFlightChannelSpawn) return await inFlightChannelSpawn;
5557
5770
  const promise = (async () => {
5771
+ const acpChannelId = randomUUID2();
5558
5772
  const channel = await telemetry.withSpan(
5559
5773
  "channel.spawn",
5560
5774
  {
5561
5775
  "qwen-code.daemon.bridge.operation": "channel.spawn",
5562
- "qwen-code.daemon.channel.reused": false
5776
+ "qwen-code.daemon.channel.reused": false,
5777
+ "qwen-code.daemon.acp_channel.id": acpChannelId
5563
5778
  },
5564
5779
  async () => await channelFactory(boundWorkspace, childEnvOverrides)
5565
5780
  );
@@ -5645,6 +5860,7 @@ function createAcpSessionBridge(opts) {
5645
5860
  );
5646
5861
  const connection = new ClientSideConnection(() => client, channel.stream);
5647
5862
  const info = {
5863
+ id: acpChannelId,
5648
5864
  channel,
5649
5865
  connection,
5650
5866
  client,
@@ -5734,19 +5950,39 @@ function createAcpSessionBridge(opts) {
5734
5950
  await telemetry.withSpan(
5735
5951
  "channel.initialize",
5736
5952
  {
5737
- "qwen-code.daemon.bridge.operation": "channel.initialize"
5953
+ "qwen-code.daemon.bridge.operation": "channel.initialize",
5954
+ "qwen-code.daemon.acp_channel.id": acpChannelId
5738
5955
  },
5739
- async () => await withTimeout(
5740
- connection.initialize({
5741
- protocolVersion: PROTOCOL_VERSION,
5742
- clientCapabilities: {
5743
- fs: { readTextFile: true, writeTextFile: true }
5744
- },
5745
- clientInfo: { name: "qwen-serve-bridge", version: "0" }
5746
- }),
5747
- initTimeoutMs,
5748
- "initialize"
5749
- )
5956
+ async () => {
5957
+ const response = await withTimeout(
5958
+ connection.initialize({
5959
+ protocolVersion: PROTOCOL_VERSION,
5960
+ _meta: {
5961
+ [CHANNEL_STARTUP_PROFILE_META_KEY]: {
5962
+ v: CHANNEL_STARTUP_PROFILE_VERSION
5963
+ }
5964
+ },
5965
+ clientCapabilities: {
5966
+ fs: { readTextFile: true, writeTextFile: true }
5967
+ },
5968
+ clientInfo: { name: "qwen-serve-bridge", version: "0" }
5969
+ }),
5970
+ initTimeoutMs,
5971
+ "initialize"
5972
+ );
5973
+ try {
5974
+ const attributes = getChannelStartupProfileAttributes(
5975
+ response,
5976
+ Date.now(),
5977
+ initTimeoutMs
5978
+ );
5979
+ if (attributes && telemetry.setActiveSpanAttributes) {
5980
+ telemetry.setActiveSpanAttributes(attributes);
5981
+ }
5982
+ } catch {
5983
+ }
5984
+ return response;
5985
+ }
5750
5986
  );
5751
5987
  } catch (err) {
5752
5988
  info.isDying = true;
@@ -5774,7 +6010,15 @@ function createAcpSessionBridge(opts) {
5774
6010
  }
5775
6011
  __name(ensureChannel, "ensureChannel");
5776
6012
  async function doSpawn(modelServiceId, effectiveScope, approvalMode, requestedClientId, onSessionRegistered, parentSessionId, sourceType, sourceId) {
5777
- const ci = await ensureChannel();
6013
+ const channelPath = channelInfo && !channelInfo.isDying ? "reused" : inFlightChannelSpawn ? "joined" : "spawned_on_request";
6014
+ const ci = await telemetry.withSpan(
6015
+ "channel.wait",
6016
+ {
6017
+ "qwen-code.daemon.bridge.operation": "channel.wait",
6018
+ "qwen-code.daemon.channel.path": channelPath
6019
+ },
6020
+ ensureChannel
6021
+ );
5778
6022
  ci.sessionSpawnsInFlight++;
5779
6023
  let sessionRegistered = false;
5780
6024
  let sessionRemovedDuringInitialization = false;
@@ -5786,16 +6030,27 @@ function createAcpSessionBridge(opts) {
5786
6030
  "session.new",
5787
6031
  {
5788
6032
  "qwen-code.daemon.bridge.operation": "session.new",
5789
- "qwen-code.daemon.session_scope": effectiveScope
6033
+ "qwen-code.daemon.session_scope": effectiveScope,
6034
+ "qwen-code.daemon.channel.path": channelPath,
6035
+ "qwen-code.daemon.acp_channel.id": ci.id
5790
6036
  },
5791
- async () => await withTimeout(
5792
- ci.connection.newSession({
5793
- cwd: boundWorkspace,
5794
- mcpServers: []
5795
- }),
5796
- initTimeoutMs,
5797
- "newSession"
5798
- )
6037
+ async () => {
6038
+ const response = await withTimeout(
6039
+ ci.connection.newSession(
6040
+ telemetry.injectPromptContext({
6041
+ cwd: boundWorkspace,
6042
+ mcpServers: []
6043
+ })
6044
+ ),
6045
+ initTimeoutMs,
6046
+ "newSession"
6047
+ );
6048
+ telemetry.event("session.new.completed", {
6049
+ "session.id": response.sessionId,
6050
+ "qwen-code.daemon.acp_channel.id": ci.id
6051
+ });
6052
+ return response;
6053
+ }
5799
6054
  );
5800
6055
  } catch (err) {
5801
6056
  if (hasNoChannelWork(ci, { ignoreCurrentSessionSpawn: true })) {
@@ -5959,7 +6214,7 @@ function createAcpSessionBridge(opts) {
5959
6214
  entry.modelRoundtripInFlight = true;
5960
6215
  let succeeded = false;
5961
6216
  try {
5962
- await Promise.race([
6217
+ const result = await Promise.race([
5963
6218
  withTimeout(
5964
6219
  conn.unstable_setSessionModel({
5965
6220
  sessionId: entry.sessionId,
@@ -5975,7 +6230,7 @@ function createAcpSessionBridge(opts) {
5975
6230
  type: "settings_changed",
5976
6231
  data: {
5977
6232
  key: "model.name",
5978
- value: modelId
6233
+ value: getCanonicalModelId(result, modelId)
5979
6234
  },
5980
6235
  ...originatorClientId ? { originatorClientId } : {}
5981
6236
  });
@@ -6179,7 +6434,7 @@ function createAcpSessionBridge(opts) {
6179
6434
  const cacheWorkspaceMcpDetails = /* @__PURE__ */ __name(async (info, status) => {
6180
6435
  if (!Array.isArray(status.servers)) return;
6181
6436
  const serverNames = status.servers.flatMap(
6182
- (server) => isRecord2(server) && typeof server["name"] === "string" && server["mcpStatus"] === "connected" ? [server["name"]] : []
6437
+ (server) => isRecord3(server) && typeof server["name"] === "string" && server["mcpStatus"] === "connected" ? [server["name"]] : []
6183
6438
  );
6184
6439
  const cacheDetail = /* @__PURE__ */ __name(async (serverName, method, cache) => {
6185
6440
  try {
@@ -6457,6 +6712,7 @@ function createAcpSessionBridge(opts) {
6457
6712
  entry.modelPublishGeneration++;
6458
6713
  entry.events.publish({
6459
6714
  type: "model_switched",
6715
+ ...entry.activePromptId ? { promptId: entry.activePromptId } : {},
6460
6716
  data: { sessionId: entry.sessionId, modelId },
6461
6717
  ...originatorClientId ? { originatorClientId } : {}
6462
6718
  });
@@ -6466,6 +6722,7 @@ function createAcpSessionBridge(opts) {
6466
6722
  entry.approvalModePublishGeneration++;
6467
6723
  entry.events.publish({
6468
6724
  type: "approval_mode_changed",
6725
+ ...entry.activePromptId ? { promptId: entry.activePromptId } : {},
6469
6726
  data: {
6470
6727
  sessionId: entry.sessionId,
6471
6728
  previous: payload.previous,
@@ -6714,7 +6971,8 @@ function createAcpSessionBridge(opts) {
6714
6971
  compactedReplay: snapshot.compactedTurns,
6715
6972
  liveJournal: snapshot.liveJournal,
6716
6973
  lastEventId: snapshot.lastEventId,
6717
- ...replayStatus
6974
+ ...replayStatus,
6975
+ ...entry.restoreHistoryHasMore === true ? { historyHasMore: true } : {}
6718
6976
  };
6719
6977
  }
6720
6978
  return { lastEventId: snapshot.lastEventId, ...replayStatus };
@@ -6724,7 +6982,7 @@ function createAcpSessionBridge(opts) {
6724
6982
  const warnings = [];
6725
6983
  const snapshot = normalizeSnapshotPayload(candidate, warnings);
6726
6984
  if (!snapshot) return void 0;
6727
- const snapshotWarnings = isRecord2(candidate) && Array.isArray(candidate["warnings"]) ? candidate["warnings"].filter(
6985
+ const snapshotWarnings = isRecord3(candidate) && Array.isArray(candidate["warnings"]) ? candidate["warnings"].filter(
6728
6986
  (warning) => typeof warning === "string" && warning.length <= 1e3
6729
6987
  ).slice(-500) : [];
6730
6988
  return {
@@ -6852,6 +7110,7 @@ function createAcpSessionBridge(opts) {
6852
7110
  let replayUpdates = [];
6853
7111
  let replayPartial;
6854
7112
  let replayError;
7113
+ let replayHasMore;
6855
7114
  try {
6856
7115
  if (action === "load") {
6857
7116
  state = await Promise.race([
@@ -6867,7 +7126,10 @@ function createAcpSessionBridge(opts) {
6867
7126
  mcpServers: [],
6868
7127
  ...historyReplay === "response" ? {
6869
7128
  _meta: {
6870
- [LOAD_REPLAY_MODE_META_KEY]: LOAD_REPLAY_BULK_MODE
7129
+ [LOAD_REPLAY_MODE_META_KEY]: LOAD_REPLAY_BULK_MODE,
7130
+ ...req.historyPageSize !== void 0 ? {
7131
+ [LOAD_REPLAY_PAGE_SIZE_META_KEY]: req.historyPageSize
7132
+ } : {}
6871
7133
  }
6872
7134
  } : {}
6873
7135
  }),
@@ -6896,6 +7158,7 @@ function createAcpSessionBridge(opts) {
6896
7158
  replayUpdates = extracted.updates;
6897
7159
  replayPartial = extracted.partial;
6898
7160
  replayError = extracted.replayError;
7161
+ replayHasMore = extracted.hasMore === true ? true : void 0;
6899
7162
  }
6900
7163
  } catch (err) {
6901
7164
  restoreEvents.close();
@@ -6980,6 +7243,9 @@ function createAcpSessionBridge(opts) {
6980
7243
  if (replayError !== void 0) {
6981
7244
  entry.restoreReplayError = replayError;
6982
7245
  }
7246
+ if (replayHasMore === true) {
7247
+ entry.restoreHistoryHasMore = true;
7248
+ }
6983
7249
  seedSnapshotCaches(entry, publicState);
6984
7250
  const artifactRestoreWarnings = await entry.artifacts.restore(
6985
7251
  restoredArtifactSnapshot
@@ -6998,6 +7264,9 @@ function createAcpSessionBridge(opts) {
6998
7264
  await ci.client.seedSessionUpdates(entry, replayUpdates, {
6999
7265
  ingestArtifacts: restoredArtifactSnapshot === void 0 || artifactRestoreFailed
7000
7266
  });
7267
+ if (req.historyPageSize !== void 0 && entry.events.snapshotReplay()?.compactedTurns.some((event) => event.type === "history_truncated")) {
7268
+ entry.restoreHistoryHasMore = true;
7269
+ }
7001
7270
  ci.client.drainEarlyEvents(entry.sessionId, entry);
7002
7271
  }
7003
7272
  const clientId = registerClient(entry, req.clientId);
@@ -7399,8 +7668,27 @@ function createAcpSessionBridge(opts) {
7399
7668
  };
7400
7669
  entry.pendingPromptList.push(pendingEntry);
7401
7670
  if (isQueued) {
7671
+ pendingAbort.signal.addEventListener(
7672
+ "abort",
7673
+ () => {
7674
+ if (pendingEntry.state !== "queued") return;
7675
+ if (!entry.todoStopGuardAwaitingQueuedPrompt) return;
7676
+ const hasAnotherQueuedPrompt = entry.pendingPromptList.some(
7677
+ (candidate) => candidate !== pendingEntry && candidate.state === "queued" && !candidate.abortController.signal.aborted
7678
+ );
7679
+ if (hasAnotherQueuedPrompt) return;
7680
+ entry.todoStopGuardAwaitingQueuedPrompt = false;
7681
+ void entry.connection.extMethod(TODO_STOP_GUARD_QUEUE_RELEASE_METHOD, { sessionId }).catch((error) => {
7682
+ writeStderrLine(
7683
+ `qwen serve: Todo Stop Guard queued-prompt release failed for ${JSON.stringify(sessionId)}: ${error instanceof Error ? error.message : String(error)}`
7684
+ );
7685
+ });
7686
+ },
7687
+ { once: true }
7688
+ );
7402
7689
  entry.events.publish({
7403
7690
  type: "pending_prompt_added",
7691
+ promptId: pendingEntry.promptId,
7404
7692
  data: {
7405
7693
  sessionId,
7406
7694
  promptId: pendingEntry.promptId,
@@ -7418,9 +7706,11 @@ function createAcpSessionBridge(opts) {
7418
7706
  throw new DOMException("Prompt aborted", "AbortError");
7419
7707
  }
7420
7708
  if (pendingEntry.state === "queued") {
7709
+ entry.todoStopGuardAwaitingQueuedPrompt = false;
7421
7710
  pendingEntry.state = "running";
7422
7711
  entry.events.publish({
7423
7712
  type: "pending_prompt_started",
7713
+ promptId: pendingEntry.promptId,
7424
7714
  data: {
7425
7715
  sessionId,
7426
7716
  promptId: pendingEntry.promptId,
@@ -7473,6 +7763,7 @@ function createAcpSessionBridge(opts) {
7473
7763
  return copy;
7474
7764
  })();
7475
7765
  entry.promptActive = true;
7766
+ entry.activePromptId = pendingEntry.promptId;
7476
7767
  delete entry.turnError;
7477
7768
  activePromptCounter++;
7478
7769
  entry.sessionLastSeenAt = Date.now();
@@ -7488,10 +7779,12 @@ function createAcpSessionBridge(opts) {
7488
7779
  echoPromptToSessionBus(
7489
7780
  entry,
7490
7781
  promptRequest,
7782
+ pendingEntry.promptId,
7491
7783
  originatorClientId
7492
7784
  );
7493
7785
  }
7494
7786
  } catch (echoErr) {
7787
+ delete entry.activePromptId;
7495
7788
  delete entry.activePromptOriginatorClientId;
7496
7789
  if (entry.promptActive) {
7497
7790
  entry.promptActive = false;
@@ -7507,6 +7800,7 @@ function createAcpSessionBridge(opts) {
7507
7800
  entry.sessionLastSeenAt = Date.now();
7508
7801
  touchActivity();
7509
7802
  }
7803
+ delete entry.activePromptId;
7510
7804
  delete entry.activePromptOriginatorClientId;
7511
7805
  if (entry.clientIds.size === 0 && entry.events.subscriberCount === 0 && byId.has(sessionId)) {
7512
7806
  void closeSessionImpl(sessionId, void 0, {
@@ -7538,6 +7832,7 @@ function createAcpSessionBridge(opts) {
7538
7832
  broadcastPromptCancelledOnce(
7539
7833
  entry,
7540
7834
  sessionId,
7835
+ pendingEntry.promptId,
7541
7836
  originatorClientId,
7542
7837
  "forward_failed"
7543
7838
  );
@@ -7555,6 +7850,7 @@ function createAcpSessionBridge(opts) {
7555
7850
  broadcastPromptCancelledOnce(
7556
7851
  entry,
7557
7852
  sessionId,
7853
+ pendingEntry.promptId,
7558
7854
  originatorClientId
7559
7855
  );
7560
7856
  cancelPendingForSession(sessionId);
@@ -7617,6 +7913,7 @@ function createAcpSessionBridge(opts) {
7617
7913
  try {
7618
7914
  entry.events.publish({
7619
7915
  type: "pending_prompt_completed",
7916
+ promptId: pendingEntry.promptId,
7620
7917
  data: {
7621
7918
  sessionId,
7622
7919
  promptId: pendingEntry.promptId,
@@ -7650,7 +7947,12 @@ function createAcpSessionBridge(opts) {
7650
7947
  entry,
7651
7948
  context?.clientId
7652
7949
  );
7653
- broadcastPromptCancelledOnce(entry, sessionId, cancelOriginatorClientId);
7950
+ broadcastPromptCancelledOnce(
7951
+ entry,
7952
+ sessionId,
7953
+ entry.activePromptId,
7954
+ cancelOriginatorClientId
7955
+ );
7654
7956
  cancelPendingForSession(sessionId);
7655
7957
  const notif = req ? { ...req, sessionId } : { sessionId };
7656
7958
  telemetry.metrics?.cancelled();
@@ -8385,6 +8687,12 @@ function createAcpSessionBridge(opts) {
8385
8687
  SERVE_CONTROL_EXT_METHODS.sessionGoalClear
8386
8688
  );
8387
8689
  },
8690
+ async getSessionGoal(sessionId) {
8691
+ return requestSessionStatus(
8692
+ sessionId,
8693
+ SERVE_CONTROL_EXT_METHODS.sessionGoalGet
8694
+ );
8695
+ },
8388
8696
  async continueSession(sessionId, context) {
8389
8697
  const entry = byId.get(sessionId);
8390
8698
  if (!entry) throw new SessionNotFoundError(sessionId);
@@ -8531,7 +8839,7 @@ function createAcpSessionBridge(opts) {
8531
8839
  type: "settings_changed",
8532
8840
  data: {
8533
8841
  key: "model.name",
8534
- value: req.modelId
8842
+ value: getCanonicalModelId(result, req.modelId)
8535
8843
  },
8536
8844
  ...originatorClientId ? { originatorClientId } : {}
8537
8845
  });
@@ -8759,6 +9067,7 @@ function createAcpSessionBridge(opts) {
8759
9067
  try {
8760
9068
  entry.events.publish({
8761
9069
  type: "pending_prompt_completed",
9070
+ promptId,
8762
9071
  data: { sessionId, promptId, state: "removed" },
8763
9072
  ...target.originatorClientId ? { originatorClientId: target.originatorClientId } : {}
8764
9073
  });
@@ -9475,11 +9784,17 @@ function createAcpSessionBridge(opts) {
9475
9784
  },
9476
9785
  async preheat() {
9477
9786
  if (shuttingDown) return;
9478
- const ci = await ensureChannel();
9479
- const idleMs = resolvedChannelIdleTimeoutMs();
9480
- if (idleMs > 0 && hasNoChannelWork(ci)) {
9481
- await startIdleTimer(ci);
9482
- }
9787
+ await telemetry.withSpan(
9788
+ "channel.preheat",
9789
+ { "qwen-code.daemon.bridge.operation": "channel.preheat" },
9790
+ async () => {
9791
+ const ci = await ensureChannel();
9792
+ const idleMs = resolvedChannelIdleTimeoutMs();
9793
+ if (idleMs > 0 && hasNoChannelWork(ci)) {
9794
+ await startIdleTimer(ci);
9795
+ }
9796
+ }
9797
+ );
9483
9798
  }
9484
9799
  };
9485
9800
  return bridgeApi;