@qwen-code/qwen-code 0.23.3 → 0.23.4

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 (462) hide show
  1. package/bundled/computer-use/SKILL.md +46 -198
  2. package/bundled/computer-use/references/macos.md +208 -0
  3. package/bundled/computer-use/references/windows-linux.md +247 -0
  4. package/bundled/goal-draft/SKILL.md +10 -10
  5. package/bundled/qc-helper/docs/configuration/settings.md +81 -71
  6. package/bundled/qc-helper/docs/extension/getting-started-extensions.md +2 -0
  7. package/bundled/qc-helper/docs/extension/introduction.md +9 -3
  8. package/bundled/qc-helper/docs/features/_meta.ts +1 -0
  9. package/bundled/qc-helper/docs/features/agent-board.md +89 -0
  10. package/bundled/qc-helper/docs/features/channels/dingtalk.md +3 -21
  11. package/bundled/qc-helper/docs/features/channels/dws.md +5 -1
  12. package/bundled/qc-helper/docs/features/channels/overview.md +5 -6
  13. package/bundled/qc-helper/docs/features/code-review.md +18 -4
  14. package/bundled/qc-helper/docs/features/commands.md +9 -0
  15. package/bundled/qc-helper/docs/features/computer-use.md +26 -8
  16. package/bundled/qc-helper/docs/features/cross-session-protocol.md +23 -5
  17. package/bundled/qc-helper/docs/features/followup-suggestions.md +17 -5
  18. package/bundled/qc-helper/docs/features/goals.md +22 -18
  19. package/bundled/qc-helper/docs/features/hooks.md +48 -37
  20. package/bundled/qc-helper/docs/features/skills.md +33 -3
  21. package/bundled/qc-helper/docs/features/status-line.md +2 -0
  22. package/bundled/qc-helper/docs/features/sub-agents.md +27 -0
  23. package/bundled/qc-helper/docs/qwen-serve.md +7 -3
  24. package/bundled/review/SKILL.md +20 -10
  25. package/bundled/review/references/persistence.md +2 -0
  26. package/bundled/workflow-authoring/SKILL.md +442 -0
  27. package/bundled/workflow-creator/SKILL.md +1 -1
  28. package/chunks/{MaxSizedBox-D4LW7RZZ.js → MaxSizedBox-Q44AWRWI.js} +59 -55
  29. package/chunks/{StandaloneSessionPicker-ALTTRWUP.js → StandaloneSessionPicker-UKII7M7U.js} +83 -79
  30. package/chunks/{acp-startup-profiler-KEU6VAYR.js → acp-startup-profiler-RUQNTNU5.js} +2 -2
  31. package/chunks/acp-subagent-executor-7RUAOXE7.js +141 -0
  32. package/chunks/{acpAgent-BBSW7XZG.js → acpAgent-5N3LHCO3.js} +1026 -355
  33. package/chunks/{agent-SQ6OY3QD.js → agent-LU5UJALC.js} +43 -39
  34. package/chunks/{agent-headless-RI2THRQ7.js → agent-headless-LTLADUGR.js} +43 -39
  35. package/chunks/{anthropicContentGenerator-JSKMKS6V.js → anthropicContentGenerator-H5YPXIDE.js} +37 -15
  36. package/chunks/{artifact-tool-PMYZCYNH.js → artifact-tool-MFGORTWZ.js} +59 -109
  37. package/chunks/{askUserQuestion-4M4YYIB4.js → askUserQuestion-WS4GUT7C.js} +3 -3
  38. package/chunks/{bridge-DAFMI72L.js → bridge-P34XQP3D.js} +63 -58
  39. package/chunks/{build-63BIOYWK.js → build-5KWQBWEQ.js} +1 -1
  40. package/chunks/{ca-KC2AISNS.js → ca-GZ4FDJU2.js} +3 -3
  41. package/chunks/{channel-management-service-OWDXVL7R.js → channel-management-service-AFVIT4VH.js} +8 -8
  42. package/chunks/{channel-settings-store-4I6JONT7.js → channel-settings-store-VE4ARRSR.js} +68 -64
  43. package/chunks/{channel-worker-group-F2ZZMLNS.js → channel-worker-group-JR6JOELM.js} +8 -8
  44. package/chunks/{channel-worker-manager-2SZLJJSJ.js → channel-worker-manager-AVKJEZFL.js} +8 -8
  45. package/chunks/{channel-worker-supervisor-ZFNWMG6D.js → channel-worker-supervisor-OOYY7BAQ.js} +5 -5
  46. package/chunks/{chunk-DAWWT2ID.js → chunk-2NRKLYID.js} +1374 -2164
  47. package/chunks/{chunk-53GWJOLP.js → chunk-2P2IXKDR.js} +3 -1
  48. package/chunks/{chunk-6JACAGYH.js → chunk-2S2WIGCM.js} +1 -1
  49. package/chunks/{chunk-IUVIBDKU.js → chunk-2YMRRI2C.js} +9 -10
  50. package/chunks/{chunk-MLQNSPRZ.js → chunk-3AYIKQTJ.js} +15 -5
  51. package/chunks/{chunk-F53KKZUD.js → chunk-3LMDSCLU.js} +158 -10
  52. package/chunks/{chunk-WG7BL3FY.js → chunk-473RJLIH.js} +1 -1
  53. package/chunks/{chunk-BWAMMKIS.js → chunk-4XP7WXC4.js} +135 -6
  54. package/chunks/{chunk-W5ZQMAEM.js → chunk-4Y2I3CI3.js} +1 -1
  55. package/chunks/{chunk-HGEUHUEV.js → chunk-54B2LTKP.js} +1 -1
  56. package/chunks/{chunk-IRH27ZC2.js → chunk-5EZRLTLQ.js} +4 -4
  57. package/chunks/{chunk-DLH7YIX6.js → chunk-5FK4MSHB.js} +3 -3
  58. package/chunks/chunk-5JG3DAKS.js +1416 -0
  59. package/chunks/{chunk-CUEXOHQH.js → chunk-5ODRE7E5.js} +9 -15
  60. package/chunks/{chunk-532WHF4F.js → chunk-5VQR2DD7.js} +2 -2
  61. package/chunks/chunk-62MWBTS7.js +191 -0
  62. package/chunks/{chunk-YQHLFCPU.js → chunk-65ANUQSV.js} +32 -24
  63. package/chunks/{chunk-YBUMTY7B.js → chunk-66N6C4EH.js} +1 -1
  64. package/chunks/{chunk-AC6KDLH3.js → chunk-6TFZIA2L.js} +1 -1
  65. package/chunks/{chunk-Y2MYW47X.js → chunk-6WXVEDT2.js} +9 -2
  66. package/chunks/{chunk-NRXWJXJ4.js → chunk-7GKPKIUB.js} +15 -15
  67. package/chunks/chunk-7JGH6IMU.js +2780 -0
  68. package/chunks/{chunk-ZHKTKHMO.js → chunk-7MIBD3LG.js} +1 -1
  69. package/chunks/{chunk-HGAELO7B.js → chunk-7ML2ZLQF.js} +2 -2
  70. package/chunks/{chunk-3UXUOFO6.js → chunk-7W2Y3PZD.js} +9 -10
  71. package/chunks/{chunk-76RGWKLS.js → chunk-ABNX6E6K.js} +1 -1
  72. package/chunks/chunk-ACHCT36C.js +28 -0
  73. package/chunks/{chunk-NE624IVP.js → chunk-ADQUK6WA.js} +1 -1
  74. package/chunks/{chunk-PLLIWEM3.js → chunk-AEWCOE64.js} +2 -2
  75. package/chunks/{chunk-3FPYT6QC.js → chunk-ARDHE6MM.js} +23 -0
  76. package/chunks/{chunk-LILGKQ4B.js → chunk-AXZMWAJV.js} +156 -26
  77. package/chunks/{chunk-SYLECP23.js → chunk-BBMOAZ2E.js} +4 -4
  78. package/chunks/{chunk-RWVD5RRY.js → chunk-BDDE4YNP.js} +3 -3
  79. package/chunks/{chunk-TPKQIA7G.js → chunk-BSIOCNDK.js} +1 -1
  80. package/chunks/{chunk-U7O65WKL.js → chunk-BW2SMO6L.js} +1 -1
  81. package/chunks/{chunk-WBCPROWX.js → chunk-C4HBZQNH.js} +1 -1
  82. package/chunks/{chunk-NOO4QFXM.js → chunk-C75BXMPM.js} +1 -3
  83. package/chunks/chunk-CFMZLE3L.js +75 -0
  84. package/chunks/{chunk-AXTFYDXT.js → chunk-CXXAZ2LZ.js} +1 -1
  85. package/chunks/{chunk-N7VWZDWW.js → chunk-DCRVSIK6.js} +4460 -3838
  86. package/chunks/{chunk-NJQTG2G3.js → chunk-DGTH4BSO.js} +11 -11
  87. package/chunks/{chunk-J3TJH52D.js → chunk-DOTF2PF2.js} +1 -1
  88. package/chunks/{chunk-BWQLXU37.js → chunk-E4XZSQXB.js} +381 -86
  89. package/chunks/{chunk-2ALXPGB4.js → chunk-E6IR653O.js} +1 -1
  90. package/chunks/{chunk-R4Q2PEFV.js → chunk-E7HXORS7.js} +1 -1
  91. package/chunks/{chunk-ZKYR7QS4.js → chunk-EDB556X7.js} +2 -2
  92. package/chunks/{chunk-NUQVB25K.js → chunk-EKMJR7M3.js} +2 -2
  93. package/chunks/{chunk-Q5BD56BW.js → chunk-ELHAQ5H4.js} +7 -7
  94. package/chunks/{chunk-GSILBZLN.js → chunk-EOQXU3ZE.js} +2 -2
  95. package/chunks/{chunk-7QYWGTHB.js → chunk-EPVEPTI3.js} +44 -151
  96. package/chunks/{chunk-POC3YMHG.js → chunk-F2IRY2TD.js} +4 -4
  97. package/chunks/{chunk-S6Q6Q4P2.js → chunk-FBDHP23D.js} +1 -1
  98. package/chunks/{chunk-3I7W2POO.js → chunk-FGROOEKM.js} +5 -40
  99. package/chunks/{chunk-HNLMYDQE.js → chunk-FMLBBXHB.js} +13 -9
  100. package/chunks/{chunk-Z3GF56ME.js → chunk-FRISMWG3.js} +3 -3
  101. package/chunks/{chunk-ALMR3E6Q.js → chunk-GDWE23OR.js} +3 -3
  102. package/chunks/{chunk-IAEXTMED.js → chunk-GNV2SFO7.js} +173 -7
  103. package/chunks/{chunk-CXTPVBFA.js → chunk-GSS4SZNG.js} +100 -17
  104. package/chunks/{chunk-3XLK2QMY.js → chunk-H7L725Z6.js} +59 -16
  105. package/chunks/{chunk-6HUXPLB5.js → chunk-HEOH7JZY.js} +5 -5
  106. package/chunks/{chunk-DTNV6UZY.js → chunk-HFJSQ4GL.js} +10 -24
  107. package/chunks/{chunk-BZM5U74J.js → chunk-I6JRN375.js} +724 -468
  108. package/chunks/{chunk-VZUCTJ2P.js → chunk-I6YJZGHS.js} +10 -10
  109. package/chunks/{chunk-RZHU3K6M.js → chunk-IAS753HG.js} +2 -20
  110. package/chunks/{chunk-EDMXGXAK.js → chunk-IBRQG2MP.js} +10 -13
  111. package/chunks/{chunk-NOAG7N22.js → chunk-IGLX6UXJ.js} +2 -2
  112. package/chunks/chunk-INGBUYL6.js +230 -0
  113. package/chunks/{chunk-IL5M5NYD.js → chunk-IR5CVY5G.js} +11 -9
  114. package/chunks/{chunk-OX7IZ2G5.js → chunk-ITOB3LRT.js} +4 -4
  115. package/chunks/{chunk-LDVNJZGH.js → chunk-IUXWAKVS.js} +17 -8
  116. package/chunks/{chunk-2PJRI3EH.js → chunk-J4DRBDHX.js} +218 -43
  117. package/chunks/{chunk-XGYHNWL3.js → chunk-J7LBAKDH.js} +3 -3
  118. package/chunks/{chunk-W5FIP7FC.js → chunk-JLZ5YCMV.js} +5 -5
  119. package/chunks/{chunk-LG5Y4OWO.js → chunk-JRHKM3YQ.js} +2 -2
  120. package/chunks/{chunk-2ZN3O5FT.js → chunk-JZ3FFPES.js} +6 -6
  121. package/chunks/{chunk-NMCDMLHL.js → chunk-K2DCZ6SZ.js} +50 -35
  122. package/chunks/{chunk-F42YYSCK.js → chunk-KLGCF6G7.js} +8 -8
  123. package/chunks/{chunk-K2OJUPOE.js → chunk-KP2FHIFR.js} +12 -0
  124. package/chunks/{chunk-IV7GDNKC.js → chunk-KZCK5JUN.js} +4 -4
  125. package/chunks/{acp-subagent-executor-LEUN3N7N.js → chunk-L56E7YUM.js} +11 -110
  126. package/chunks/{chunk-NMRCXKQ5.js → chunk-L5BVU4JW.js} +3 -3
  127. package/chunks/{chunk-ZW2EUO2A.js → chunk-L6DIANLD.js} +1 -1
  128. package/chunks/{chunk-GOXQL4YH.js → chunk-LFNK4DGQ.js} +2 -2
  129. package/chunks/{chunk-UKZ45TJL.js → chunk-LMDMYMSS.js} +420 -219
  130. package/chunks/chunk-LMJSPC55.js +260 -0
  131. package/chunks/{chunk-X6K77VHC.js → chunk-LWWRJRCD.js} +1 -1
  132. package/chunks/{chunk-UXEO7E3V.js → chunk-LYD3T3H7.js} +1 -0
  133. package/chunks/{chunk-HBQ2NXOU.js → chunk-M6MID3FA.js} +2 -2
  134. package/chunks/{chunk-E4UEO3XM.js → chunk-ME4JBHSB.js} +324 -2
  135. package/chunks/{chunk-MF6E7FSA.js → chunk-MFPAVOYJ.js} +8 -201
  136. package/chunks/{chunk-BV6Q5HMY.js → chunk-MJHLKWGJ.js} +8 -7
  137. package/chunks/{chunk-NFYEQRLG.js → chunk-MQRLLBMQ.js} +1 -1
  138. package/chunks/{chunk-O4KNCAX4.js → chunk-NCPFOLM2.js} +11 -0
  139. package/chunks/{chunk-2SZH22YO.js → chunk-NJ2OFVUX.js} +115 -97
  140. package/chunks/{chunk-6MBXY6WM.js → chunk-NRQI3PGS.js} +1 -1
  141. package/chunks/{chunk-3CZ2BQV6.js → chunk-NXUZFW3G.js} +49 -19
  142. package/chunks/{chunk-X7UJKOHZ.js → chunk-O75ZXPOX.js} +4 -6
  143. package/chunks/{chunk-5GLDOLNQ.js → chunk-OWUAZXXN.js} +4 -3
  144. package/chunks/{chunk-XBZTAGB7.js → chunk-OXDQETZA.js} +1 -1
  145. package/chunks/{chunk-2UWQX4FP.js → chunk-OZEV3R3S.js} +1 -1
  146. package/chunks/{chunk-SBRX4BDI.js → chunk-P225AM5U.js} +2 -2
  147. package/chunks/{chunk-ZU47FBOC.js → chunk-P6XVYPWA.js} +126 -12
  148. package/chunks/{chunk-MHAADZOZ.js → chunk-PCIYPEYV.js} +3 -3
  149. package/chunks/{chunk-SSGAAWLY.js → chunk-PNACDSCO.js} +95 -73
  150. package/chunks/chunk-PRWRNC64.js +32 -0
  151. package/chunks/{chunk-7BXXIQG4.js → chunk-PVKEYO5D.js} +36 -72
  152. package/chunks/{chunk-FCQJLMA2.js → chunk-Q3TFRP5G.js} +178 -8
  153. package/chunks/{chunk-DYFOSJHU.js → chunk-QM2MRAG4.js} +2756 -1153
  154. package/chunks/{chunk-ZKZHSB5W.js → chunk-QR4Q425T.js} +9 -9
  155. package/chunks/{chunk-J6MB5ZHZ.js → chunk-QZW6WRB7.js} +2 -1
  156. package/chunks/{chunk-3BTSSIJO.js → chunk-RHTNPDGD.js} +99 -14
  157. package/chunks/{chunk-OLTN767L.js → chunk-RJFUPP3F.js} +2 -2
  158. package/chunks/chunk-RKXAOP6F.js +154 -0
  159. package/chunks/{chunk-TP6FYVQT.js → chunk-RSWBT7AZ.js} +33 -1
  160. package/chunks/{chunk-E7LB57MB.js → chunk-RWKR4VNK.js} +6 -6
  161. package/chunks/chunk-S7UQ3V2H.js +87 -0
  162. package/chunks/{chunk-N6VQ37ZZ.js → chunk-SFL6U7U7.js} +1 -1
  163. package/chunks/{chunk-SODMFNAR.js → chunk-SQCZDHBQ.js} +5 -5
  164. package/chunks/{chunk-MOS5OAOG.js → chunk-SROLVJFY.js} +6 -6
  165. package/chunks/{chunk-3KQBQ6FM.js → chunk-SYDMM6IX.js} +190 -28
  166. package/chunks/{chunk-HUXPEUFL.js → chunk-SYROIHU7.js} +1 -1
  167. package/chunks/{chunk-PSPAM24S.js → chunk-TBSCTWKF.js} +6 -0
  168. package/chunks/{chunk-RLLRJJDR.js → chunk-TJDUJSVH.js} +2 -2
  169. package/chunks/{chunk-HBU7EKY4.js → chunk-TRKIKBUW.js} +45 -15
  170. package/chunks/{chunk-GCDXVPFK.js → chunk-TW2RLZPC.js} +31 -7
  171. package/chunks/chunk-U6H3XTFA.js +95 -0
  172. package/chunks/{chunk-NHJKAR6E.js → chunk-UGEDTVL6.js} +972 -18
  173. package/chunks/{chunk-KOKPXIAN.js → chunk-UL4DXZMP.js} +3 -3
  174. package/chunks/{chunk-MSNHNAQZ.js → chunk-UUT7EFX3.js} +3 -3
  175. package/chunks/{chunk-JXNIF2O5.js → chunk-V545KI73.js} +1 -1
  176. package/chunks/{chunk-7ICHPMBQ.js → chunk-VELFTVEO.js} +4 -4
  177. package/chunks/chunk-VGY2RGXL.js +100 -0
  178. package/chunks/{chunk-5KI7ZDTB.js → chunk-VQ3SUPLA.js} +24 -12
  179. package/chunks/{chunk-TBEXLLAO.js → chunk-VRQZESKP.js} +1 -1
  180. package/chunks/{chunk-FN3JNDRU.js → chunk-VVI7MK3V.js} +3 -3
  181. package/chunks/{chunk-EUURTIV6.js → chunk-WBSJ6VPZ.js} +10 -2
  182. package/chunks/{chunk-NLNQNBZ2.js → chunk-WD6YQI5M.js} +1 -1
  183. package/chunks/{chunk-KFZYGSJN.js → chunk-WDB57HEI.js} +3 -3
  184. package/chunks/chunk-WFNEY5G7.js +347 -0
  185. package/chunks/{chunk-XKBFYTCD.js → chunk-WK6DEH3Q.js} +46 -0
  186. package/chunks/{chunk-EVTNACMT.js → chunk-WKQX4FND.js} +12 -12
  187. package/chunks/{chunk-36HCNKDS.js → chunk-WKVZES7O.js} +65 -14
  188. package/chunks/{chunk-NHCZJQE4.js → chunk-WLFILD4T.js} +6 -6
  189. package/chunks/{chunk-JYKWOREU.js → chunk-WMEX6CFP.js} +13 -3
  190. package/chunks/{chunk-6W4HBUA2.js → chunk-WNQRJXKP.js} +1 -1
  191. package/chunks/{chunk-7APZIRH3.js → chunk-X7GOO6VM.js} +5 -5
  192. package/chunks/{chunk-VX63RJXE.js → chunk-XX5HQLCZ.js} +7 -0
  193. package/chunks/{chunk-2Z3T52OC.js → chunk-Y5TM7SBV.js} +7 -2
  194. package/chunks/{chunk-V2P3DOQR.js → chunk-YDFOHRS5.js} +1 -1
  195. package/chunks/{chunk-QMUYLYT5.js → chunk-YGFJ6BRT.js} +1 -1
  196. package/chunks/{chunk-LK2WUCDQ.js → chunk-YM6KUQ2S.js} +1 -1
  197. package/chunks/chunk-Z72PLR74.js +36 -0
  198. package/chunks/{chunk-BHTYRHJF.js → chunk-ZJ7JQUGY.js} +4 -1
  199. package/chunks/{chunk-4ALNJDHL.js → chunk-ZKIAGIGH.js} +87 -4
  200. package/chunks/{chunk-VG3Q2NC4.js → chunk-ZNI3YJHS.js} +32 -12
  201. package/chunks/{chunk-DT75RKNH.js → chunk-ZXUKZHMV.js} +3 -3
  202. package/chunks/{chunk-Q2LVVIKF.js → chunk-ZZUXUBEB.js} +29 -12
  203. package/chunks/codex-subagent-executor-WCRCJMQK.js +586 -0
  204. package/chunks/{config-utils-L6KLDYIV.js → config-utils-73C3RGYN.js} +60 -56
  205. package/chunks/{contextCommand-UYEH7NIU.js → contextCommand-4ZDPQJHD.js} +58 -54
  206. package/chunks/{core-runtime-NVHT3Z3V.js → core-runtime-ZDUA5DYE.js} +58 -55
  207. package/chunks/{create-sub-session-YWASE5VH.js → create-sub-session-JK3SSJKO.js} +169 -89
  208. package/chunks/{create-sub-session-TIGCFGCS.js → create-sub-session-MSGNIM37.js} +5 -2
  209. package/chunks/{cron-create-AKWX67FO.js → cron-create-U2JJ5CCF.js} +3 -3
  210. package/chunks/{cron-delete-XPB6IYZJ.js → cron-delete-7DM4LJWD.js} +2 -2
  211. package/chunks/{cron-list-XBKO4WU5.js → cron-list-VCUSZK2Y.js} +2 -2
  212. package/chunks/{daemon-G5TYKZD6.js → daemon-NJB4PWZ7.js} +3 -1
  213. package/chunks/{daemon-git-worktree-guard-FOW4RQSK.js → daemon-git-worktree-guard-QU2CCJIE.js} +58 -54
  214. package/chunks/{daemon-status-provider-O5KQZYMP.js → daemon-status-provider-2PO7NLDQ.js} +68 -63
  215. package/chunks/{daemon-trust-policy-3ATXEON7.js → daemon-trust-policy-IMDTIUWB.js} +64 -60
  216. package/chunks/{daemon-trust-policy-monitor-7MCNDNEC.js → daemon-trust-policy-monitor-6IVBNUAD.js} +64 -60
  217. package/chunks/{de-UU2YTO37.js → de-VGY3VNBU.js} +3 -3
  218. package/chunks/{deferred-core-runtime-JK5IXL5K.js → deferred-core-runtime-3AZUE7F3.js} +56 -52
  219. package/chunks/{discovery-XP4RMDUM.js → discovery-5KUEPR65.js} +2 -2
  220. package/chunks/{display-image-NAH3AZ63.js → display-image-QTHALY6N.js} +3 -3
  221. package/chunks/{dist-KLZ7XGEQ.js → dist-2QYIVNS6.js} +1 -4
  222. package/chunks/{dist-AHJYPSJL.js → dist-GUB7QRYA.js} +2 -5
  223. package/chunks/{dist-ZXTZTE54.js → dist-MPUZZOG5.js} +4 -17
  224. package/chunks/{dist-F2DVGTL3.js → dist-NIOJXMGY.js} +111 -101
  225. package/chunks/{dist-KJGRVIGJ.js → dist-PA7WPFVE.js} +5 -36
  226. package/chunks/{dist-AIKC5E5P.js → dist-SE4J6Z4O.js} +43 -669
  227. package/chunks/{dist-H6G3K26N.js → dist-T6DDPDLQ.js} +14 -34
  228. package/chunks/{dist-GWNQVPZT.js → dist-TFGETXFN.js} +10 -33
  229. package/chunks/{dist-ZA52JXAS.js → dist-VDLSBCLM.js} +1 -5
  230. package/chunks/{edit-SY35KYIE.js → edit-HXMBABZU.js} +46 -42
  231. package/chunks/{en-CAJHTIQT.js → en-E5ZO5TZW.js} +5 -3
  232. package/chunks/{enter-worktree-54L5QJ3N.js → enter-worktree-CAARFWBI.js} +6 -5
  233. package/chunks/{enterPlanMode-HXX6KQJR.js → enterPlanMode-KAMW2I2C.js} +43 -39
  234. package/chunks/{environment-DKXHG4HB.js → environment-HYMXOTVB.js} +59 -55
  235. package/chunks/{errors-ADY7LQJJ.js → errors-NQRH7NAM.js} +58 -54
  236. package/chunks/exec-RPKEY6HP.js +505 -0
  237. package/chunks/{exit-worktree-EORJDKDS.js → exit-worktree-JXGGUOBP.js} +6 -5
  238. package/chunks/{exitPlanMode-HSK2CQI6.js → exitPlanMode-SMEBS5EF.js} +43 -39
  239. package/chunks/{fast-path-U636VWN2.js → fast-path-CUWUTJUR.js} +10 -10
  240. package/chunks/{fast-path-settings-V7MI7EZJ.js → fast-path-settings-XDYX7X5Z.js} +2 -2
  241. package/chunks/{fr-HKNWVXRJ.js → fr-UAZJJH5N.js} +3 -3
  242. package/chunks/{glob-GUGGTH5L.js → glob-VOM5DVZ3.js} +43 -39
  243. package/chunks/{goal-tools-PXYRSQGX.js → goal-tools-YBYJ5KPM.js} +49 -41
  244. package/chunks/{grep-3PKFKLCA.js → grep-H2I33VAO.js} +8 -3
  245. package/chunks/{handleAutoUpdate-5KHS4HIN.js → handleAutoUpdate-4CEHNJ2F.js} +61 -57
  246. package/chunks/{i18n-KSGKMUPT.js → i18n-G7ODGUGN.js} +57 -53
  247. package/chunks/{image-gen-OCCR2WWU.js → image-gen-5G2TQ3DY.js} +6 -5
  248. package/chunks/{initializer-YYT5XEZF.js → initializer-GZ73HSOA.js} +64 -60
  249. package/chunks/{installationInfo-UNSBPYW2.js → installationInfo-PV472I52.js} +57 -53
  250. package/chunks/{ja-GJS5RZGU.js → ja-2RITCMAJ.js} +3 -3
  251. package/chunks/list-D4A7LFOF.js +133 -0
  252. package/chunks/{list-agents-QLDXS5OD.js → list-agents-EWDCEPIW.js} +3 -3
  253. package/chunks/{llm-XGGLBGPH.js → llm-PJU4VT3K.js} +161 -125
  254. package/chunks/{llm-content-generator-ZHQQT5W7.js → llm-content-generator-ITOMDK65.js} +14 -7
  255. package/chunks/{loadedSettingsAdapter-3DXLASK7.js → loadedSettingsAdapter-NNU4BY5Q.js} +64 -60
  256. package/chunks/{loggingContentGenerator-V72OCCJO.js → loggingContentGenerator-SMI2AJYY.js} +47 -43
  257. package/chunks/{loop-wakeup-HHMYIC7Z.js → loop-wakeup-VG6CGBQA.js} +4 -4
  258. package/chunks/{ls-N7ABR6HI.js → ls-6ZB3BEIR.js} +1 -1
  259. package/chunks/{lsp-LTOFWG5P.js → lsp-M54FQARP.js} +5 -1
  260. package/chunks/{managed-npm-update-HV5LPZH2.js → managed-npm-update-AN5RDI5D.js} +57 -53
  261. package/chunks/mcp-RIIEZ7NJ.js +127 -0
  262. package/chunks/model-configuration-E5M35A3M.js +140 -0
  263. package/chunks/modelConfigUtils-43SY2EDS.js +119 -0
  264. package/chunks/{monitor-TLBNM4MV.js → monitor-5WYDOXLI.js} +43 -39
  265. package/chunks/{nonInteractiveCli-LSJSQ2W4.js → nonInteractiveCli-D3YFYXNB.js} +112 -107
  266. package/chunks/{notebook-edit-OSPOLZP6.js → notebook-edit-GQNFJTIR.js} +45 -41
  267. package/chunks/{openaiContentGenerator-BE4S5TRD.js → openaiContentGenerator-VJAKFZ32.js} +24 -19
  268. package/chunks/{openaiResponsesContentGenerator-RTCAJ5V5.js → openaiResponsesContentGenerator-AWRYZLJU.js} +110 -19
  269. package/chunks/{pidfile-H32FEPWA.js → pidfile-I5SWEJDX.js} +56 -52
  270. package/chunks/{processUtils-SSLIPDEA.js → processUtils-NSYM3SKR.js} +2 -2
  271. package/chunks/{prompt-terminal-ledger-I5SLL6UF.js → prompt-terminal-ledger-KWBANHUE.js} +57 -53
  272. package/chunks/{pt-FXMYXEUV.js → pt-5ZF7ZQUV.js} +3 -3
  273. package/chunks/{qwenContentGenerator-TMQC623Z.js → qwenContentGenerator-LR6HNFBU.js} +47 -43
  274. package/chunks/{qwenOAuth2-3ZRQHHTC.js → qwenOAuth2-WIEUEFEY.js} +5 -4
  275. package/chunks/{read-file-T2QAIZE2.js → read-file-LOSUPKDX.js} +9 -8
  276. package/chunks/{read-mcp-resource-B37WANAQ.js → read-mcp-resource-LPSWXVOD.js} +1 -1
  277. package/chunks/{record-artifact-OAXWXZ5D.js → record-artifact-PXMNP7GZ.js} +3 -3
  278. package/chunks/{record-source-D7R7X3GT.js → record-source-2GSY5JD5.js} +6 -6
  279. package/chunks/{report-findings-AR3VC6EQ.js → report-findings-W6GR7SYZ.js} +4 -4
  280. package/chunks/{request-shutdown-IKNWTX5M.js → request-shutdown-53SNYGVR.js} +5 -5
  281. package/chunks/{resumeHistoryUtils-QLKDH5GY.js → resumeHistoryUtils-6IFK3MQO.js} +63 -59
  282. package/chunks/{ripGrep-YGWL7KCV.js → ripGrep-MBSYRHNP.js} +13 -11
  283. package/chunks/{ru-RMHURE5U.js → ru-7BNZFQKG.js} +3 -3
  284. package/chunks/{run-qwen-serve-26KZDECC.js → run-qwen-serve-WYEEYIHV.js} +314 -127
  285. package/chunks/{runtime-BMEIVDDG.js → runtime-FVTTOB4E.js} +69 -65
  286. package/chunks/{scheduled-tasks-NCFPP6VQ.js → scheduled-tasks-RN6DUY7E.js} +66 -60
  287. package/chunks/{scheduler-47TVMUVN.js → scheduler-T7DDWINW.js} +58 -54
  288. package/chunks/{sdk-exporters-http-VWTF4W6K.js → sdk-exporters-http-3R2TRQHE.js} +2 -1
  289. package/chunks/{sdk-impl-G6FVTBQZ.js → sdk-impl-4WF3VZ2F.js} +3 -3
  290. package/chunks/{send-message-TWOGWCBG.js → send-message-UMJKN27Q.js} +7 -7
  291. package/chunks/{serve-KL3G6LQQ.js → serve-LVMPJBTV.js} +66 -62
  292. package/chunks/{server-LBPYXZ5G.js → server-U7K7EJEP.js} +783 -350
  293. package/chunks/{session-YG6742LO.js → session-BQNC5QUN.js} +117 -112
  294. package/chunks/{session-attachments-root-OUBQDYC4.js → session-attachments-root-LQDHWZST.js} +56 -52
  295. package/chunks/{session-pr-refresh-EKGMYNAW.js → session-pr-refresh-J7DQYX2I.js} +66 -60
  296. package/chunks/{settings-DDNHJX2L.js → settings-WAWJIZHR.js} +67 -63
  297. package/chunks/{shell-KUCXWITU.js → shell-WFJEYGQI.js} +43 -39
  298. package/chunks/{skill-JQLKPNWZ.js → skill-RHQWSDOK.js} +128 -23
  299. package/chunks/{skill-settings-XERQCUXZ.js → skill-settings-ALFUQQD6.js} +72 -60
  300. package/chunks/{spawnChannel-GQ45QFGB.js → spawnChannel-D35CB5JB.js} +60 -55
  301. package/chunks/{standalone-update-PRF3ILGZ.js → standalone-update-NMMY6CAO.js} +58 -54
  302. package/chunks/{start-opentui-ui-JDSOZE3N.js → start-opentui-ui-F6BN46GE.js} +2693 -2160
  303. package/chunks/{startInteractiveUI-RRW3JVHN.js → startInteractiveUI-E6U7L5AD.js} +1610 -1773
  304. package/chunks/{syntheticOutput-F6F27JMK.js → syntheticOutput-EX5L5GYI.js} +2 -2
  305. package/chunks/{task-create-Y623TBHB.js → task-create-75HVPEAH.js} +7 -7
  306. package/chunks/{task-list-FCPEEGWL.js → task-list-ZLJSMRFA.js} +2 -2
  307. package/chunks/{task-stop-QTKZXLPH.js → task-stop-MD7P6QGK.js} +1 -1
  308. package/chunks/{task-update-YLSXF25N.js → task-update-RI7QNVDP.js} +20 -13
  309. package/chunks/{team-create-5DRLOLOE.js → team-create-DKAJ3OUY.js} +43 -39
  310. package/chunks/{team-delete-S7TLHZCF.js → team-delete-RIDINW6I.js} +1 -1
  311. package/chunks/{team-plan-approval-MWSGAL5T.js → team-plan-approval-ZUG32DAK.js} +43 -39
  312. package/chunks/{terminal-image-renderer-H7PD4FQW.js → terminal-image-renderer-U3Z5PMGO.js} +58 -54
  313. package/chunks/{theme-manager-7AV73D6R.js → theme-manager-GA65ZFKB.js} +56 -52
  314. package/chunks/{todoWrite-5QI2H2FW.js → todoWrite-XSTG2VT5.js} +6 -3
  315. package/chunks/{tool-search-UGYTBLUV.js → tool-search-XCEN7VXX.js} +17 -12
  316. package/chunks/{total-session-admission-JIHSTJ5S.js → total-session-admission-FZSHBR32.js} +63 -58
  317. package/chunks/{trustedFolders-5VCBXFOP.js → trustedFolders-SXPNZESV.js} +57 -53
  318. package/chunks/{update-relaunch-4LF3APCV.js → update-relaunch-QOUTZZ7Q.js} +5 -5
  319. package/chunks/{updateCheck-4T3WUE5F.js → updateCheck-DYRX7M34.js} +60 -56
  320. package/chunks/{useAutoAcceptIndicator-UMGB64Z6.js → useAutoAcceptIndicator-QOG7LUT3.js} +68 -64
  321. package/chunks/{validateNonInterActiveAuth-GFJ72U2C.js → validateNonInterActiveAuth-FJPAEMDD.js} +109 -104
  322. package/chunks/{version-EAAZN4T2.js → version-5IC46F2Z.js} +1 -1
  323. package/chunks/{web-fetch-VRU3A2NI.js → web-fetch-WSW4QZBA.js} +15 -13
  324. package/chunks/web-search-5QFKXWUV.js +39 -0
  325. package/chunks/{web-shell-static-CCN4JZEE.js → web-shell-static-T7UGLVE4.js} +2 -7
  326. package/chunks/{workflow-UHPFALVZ.js → workflow-ZF4DLK4V.js} +179 -79
  327. package/chunks/workspace-providers-status-4E4XWBFS.js +133 -0
  328. package/chunks/{workspace-registration-store-A7RGKW62.js → workspace-registration-store-M3QEP27F.js} +2 -2
  329. package/chunks/{workspace-registry-C2NGE6SD.js → workspace-registry-H2ENI5G2.js} +63 -58
  330. package/chunks/{workspace-runtime-coordinator-QKMZ24YF.js → workspace-runtime-coordinator-CRRNB7PC.js} +66 -59
  331. package/chunks/{workspace-service-RQTTAGGC.js → workspace-service-GJ2GOHKU.js} +70 -65
  332. package/chunks/workspace-skills-status-CRWHV35X.js +130 -0
  333. package/chunks/{workspace-trust-reconciler-KFWATZUU.js → workspace-trust-reconciler-GG2JA7KI.js} +73 -68
  334. package/chunks/{write-file-DPVB2SBQ.js → write-file-LZ4EMF36.js} +45 -41
  335. package/chunks/{zh-TW-2K2WRFPY.js → zh-TW-7PRVUGLW.js} +5 -3
  336. package/chunks/{zh-S5V3Z5CR.js → zh-V2EYTYJP.js} +5 -3
  337. package/chunks/{zoom-image-S7AWLAPC.js → zoom-image-J5IMS3WD.js} +11 -10
  338. package/cli.js +18 -17
  339. package/codeModeHost.js +4425 -0
  340. package/export-transcript-document.css +1 -1
  341. package/export-transcript-document.js +151 -151
  342. package/locales/ca.js +5 -6
  343. package/locales/de.js +5 -6
  344. package/locales/en.js +7 -6
  345. package/locales/fr.js +6 -6
  346. package/locales/ja.js +5 -6
  347. package/locales/pt.js +5 -6
  348. package/locales/ru.js +6 -6
  349. package/locales/zh-TW.js +7 -6
  350. package/locales/zh.js +7 -6
  351. package/package.json +4 -3
  352. package/web-shell/assets/{abnfDiagram-VCTEODGH-nU24rpIE.js → abnfDiagram-VCTEODGH-S_JCiANq.js} +1 -1
  353. package/web-shell/assets/{arc-D1hTu8QI.js → arc-DP-839Xn.js} +1 -1
  354. package/web-shell/assets/architectureDiagram-5GKGNRK7-C8rCd2KK.js +36 -0
  355. package/web-shell/assets/blockDiagram-NRAW4CY4-DQR82jwr.js +129 -0
  356. package/web-shell/assets/{c4Diagram-UCG6FXSJ-kEFoC1ei.js → c4Diagram-UCG6FXSJ-D21PNMRP.js} +4 -4
  357. package/web-shell/assets/channel-BgGrpX_z.js +1 -0
  358. package/web-shell/assets/{chunk-2Q5K7J3B-DbT9wS7j.js → chunk-2Q5K7J3B-KdDInGLi.js} +1 -1
  359. package/web-shell/assets/{chunk-5VM5RSS4-CNbULt6O.js → chunk-5VM5RSS4-ltb7zRmH.js} +1 -1
  360. package/web-shell/assets/{chunk-F27PBJKO-CbQRy4Tb.js → chunk-F27PBJKO-DcpQA0Ng.js} +1 -1
  361. package/web-shell/assets/chunk-G27WJ6UU-C8NDZxcy.js +231 -0
  362. package/web-shell/assets/chunk-JWPE2WC7-hXhhHTs1.js +1 -0
  363. package/web-shell/assets/chunk-LCL6LL3I-CLaOR-Hl.js +206 -0
  364. package/web-shell/assets/chunk-POPQ4Y6H-Y5_qlB1N.js +1 -0
  365. package/web-shell/assets/{chunk-SVP7TREG-DyBb2Axj.js → chunk-SVP7TREG-BWX2Voh7.js} +4 -4
  366. package/web-shell/assets/{chunk-XXDRQBXY-BIA0eb5B.js → chunk-XXDRQBXY-1wmj_kXI.js} +1 -1
  367. package/web-shell/assets/classDiagram-DTDB5LWJ-jUH7ADYs.js +1 -0
  368. package/web-shell/assets/classDiagram-v2-JRS7N3AN-jUH7ADYs.js +1 -0
  369. package/web-shell/assets/cose-bilkent-JH36ORCC-DpLc-cdd.js +1 -0
  370. package/web-shell/assets/cynefin-OW5HDTMX-DhxGiPZW.js +178 -0
  371. package/web-shell/assets/{cynefinDiagram-5FMLGOSQ-LENf_IUy.js → cynefinDiagram-5FMLGOSQ-Dl3jfBry.js} +1 -1
  372. package/web-shell/assets/{cytoscape.esm-CUqq0XTU.js → cytoscape.esm-DJK6lGiH.js} +3 -3
  373. package/web-shell/assets/dagre-3AP2YEHR-C8FA8vJk.js +4 -0
  374. package/web-shell/assets/diagram-S7CK7UJ4-D-quIUtW.js +30 -0
  375. package/web-shell/assets/diagram-UQ7AKVKN-Bjo09Uts.js +41 -0
  376. package/web-shell/assets/diagram-VSXAHHWV-IoI3ttq4.js +3 -0
  377. package/web-shell/assets/diagram-VX7I27RA-BKyOZ5SO.js +24 -0
  378. package/web-shell/assets/diagram-Z3DM3KII-Cu_OHEhw.js +24 -0
  379. package/web-shell/assets/{ebnfDiagram-PWID7BFC-BGpiquRm.js → ebnfDiagram-PWID7BFC-UVB-bbPg.js} +1 -1
  380. package/web-shell/assets/{erDiagram-SSCWMZ5O-D0besu_U.js → erDiagram-SSCWMZ5O-l8drddto.js} +13 -13
  381. package/web-shell/assets/flowDiagram-A5DVABFB-DU1I_VAI.js +168 -0
  382. package/web-shell/assets/{ganttDiagram-EL5Y4UJY-CNlsAeNr.js → ganttDiagram-EL5Y4UJY-BLRH05uB.js} +1 -1
  383. package/web-shell/assets/gitGraphDiagram-WWUBYQGX-Czg_BkRE.js +106 -0
  384. package/web-shell/assets/index-CmMV8Jla.js +3 -0
  385. package/web-shell/assets/{index-CGT341lL.js → index-DohPy72Z.js} +1 -1
  386. package/web-shell/assets/index-DyMtNYuu.js +2207 -0
  387. package/web-shell/assets/index-n6N-2a3v.css +36 -0
  388. package/web-shell/assets/{infoDiagram-RXCK75RN-Bpai64Ll.js → infoDiagram-RXCK75RN-BpBvjkro.js} +1 -1
  389. package/web-shell/assets/ishikawaDiagram-5VMMS53U-phy1l3jm.js +70 -0
  390. package/web-shell/assets/{journeyDiagram-EYS64GPL-iz_DKgFX.js → journeyDiagram-EYS64GPL-oY-9LgVS.js} +1 -1
  391. package/web-shell/assets/kanban-definition-3QL26DDD-slZoy-sc.js +89 -0
  392. package/web-shell/assets/{layout-qEvKgnvU.js → layout-0hnn_P9l.js} +1 -1
  393. package/web-shell/assets/{linear-C6lklGdq.js → linear-7Wqe8DRy.js} +1 -1
  394. package/web-shell/assets/mermaid.core-BaK8n0bq.js +312 -0
  395. package/web-shell/assets/mindmap-definition-FBJOCRG2-BedUdy_E.js +96 -0
  396. package/web-shell/assets/{pegDiagram-XKGWAZYB-BhD0q0i6.js → pegDiagram-XKGWAZYB-DQLRdmxq.js} +1 -1
  397. package/web-shell/assets/pieDiagram-E7YTZNPT-UC20w9-5.js +39 -0
  398. package/web-shell/assets/quadrantDiagram-AXDQQJYC-CQx2Hmk3.js +7 -0
  399. package/web-shell/assets/qwen-code-notification-BRVagufF.png +0 -0
  400. package/web-shell/assets/{railroadDiagram-O6MQD6OU-E1g2KIFK.js → railroadDiagram-O6MQD6OU-2UEJe_y-.js} +1 -1
  401. package/web-shell/assets/{requirementDiagram-EFPCY7ZU-CuerYJOe.js → requirementDiagram-EFPCY7ZU-DOAJggB4.js} +13 -13
  402. package/web-shell/assets/{sankeyDiagram-P5KCCOFB-CqWyCZGA.js → sankeyDiagram-P5KCCOFB-DnQ_qJo7.js} +7 -7
  403. package/web-shell/assets/{sequenceDiagram-WJ2MYXX4-B-YWb8x4.js → sequenceDiagram-WJ2MYXX4-DZrZUoCo.js} +16 -16
  404. package/web-shell/assets/sizeCapture-X5ZJPWSS-B5G4GDQB.js +1 -0
  405. package/web-shell/assets/{stateDiagram-HBIQ2CUA-C8LDpNHS.js → stateDiagram-HBIQ2CUA-Bn1cT0qF.js} +1 -1
  406. package/web-shell/assets/stateDiagram-v2-4QOOHH4V-BF3xtNvJ.js +1 -0
  407. package/web-shell/assets/swimlanes-XN3QIQJK-Bzhcdn87.js +1 -0
  408. package/web-shell/assets/swimlanesDiagram-VK2B7HYN-B753mA3E.js +8 -0
  409. package/web-shell/assets/timeline-definition-24CTP7MA-BqZ_3D10.js +120 -0
  410. package/web-shell/assets/vennDiagram-4TSXK5OY-z9kw1kmm.js +34 -0
  411. package/web-shell/assets/wardleyDiagram-VM6X3IG4-Cydp1zJW.js +78 -0
  412. package/web-shell/assets/{xychartDiagram-S5SC5T6Z-ruD2Wjhg.js → xychartDiagram-S5SC5T6Z-j4X1lQKo.js} +1 -1
  413. package/web-shell/index.html +2 -2
  414. package/chunks/chunk-7Q2AXRDJ.js +0 -114
  415. package/chunks/chunk-AEY27Z35.js +0 -1411
  416. package/chunks/chunk-CFKIH3D3.js +0 -50
  417. package/chunks/chunk-HWVUSYSN.js +0 -126
  418. package/chunks/chunk-QHMLYMMS.js +0 -32
  419. package/chunks/chunk-SAH4BD2J.js +0 -92
  420. package/chunks/chunk-TWUKBNWM.js +0 -86
  421. package/chunks/chunk-ZTTC7T4X.js +0 -126
  422. package/chunks/list-YL6LDQKQ.js +0 -129
  423. package/chunks/mcp-IYVSIW6O.js +0 -123
  424. package/chunks/web-search-NEGYQNDJ.js +0 -912
  425. package/chunks/workspace-providers-status-AEYISSU2.js +0 -127
  426. package/chunks/workspace-skills-status-5HWZU3HX.js +0 -126
  427. package/web-shell/assets/architectureDiagram-5GKGNRK7-B_fgkKe7.js +0 -36
  428. package/web-shell/assets/blockDiagram-NRAW4CY4-C3pddUNg.js +0 -129
  429. package/web-shell/assets/channel-Blod4z1X.js +0 -1
  430. package/web-shell/assets/chunk-G27WJ6UU-CVbXTxYk.js +0 -231
  431. package/web-shell/assets/chunk-JWPE2WC7-D89c_BXy.js +0 -1
  432. package/web-shell/assets/chunk-LCL6LL3I-B7-I_9KB.js +0 -206
  433. package/web-shell/assets/chunk-POPQ4Y6H-DcLQFzS4.js +0 -1
  434. package/web-shell/assets/classDiagram-DTDB5LWJ-D6hFDMqb.js +0 -1
  435. package/web-shell/assets/classDiagram-v2-JRS7N3AN-D6hFDMqb.js +0 -1
  436. package/web-shell/assets/cose-bilkent-JH36ORCC-Db2FYN85.js +0 -1
  437. package/web-shell/assets/cynefin-OW5HDTMX-i4GwmBVy.js +0 -178
  438. package/web-shell/assets/dagre-3AP2YEHR-CF9XVrD9.js +0 -4
  439. package/web-shell/assets/diagram-S7CK7UJ4-DD5PJfSm.js +0 -30
  440. package/web-shell/assets/diagram-UQ7AKVKN-CjD_sBMj.js +0 -41
  441. package/web-shell/assets/diagram-VSXAHHWV-U5WwMqyA.js +0 -3
  442. package/web-shell/assets/diagram-VX7I27RA-BujpHJJf.js +0 -24
  443. package/web-shell/assets/diagram-Z3DM3KII-3ZLtKEXo.js +0 -24
  444. package/web-shell/assets/flowDiagram-A5DVABFB-9DwDuIyr.js +0 -168
  445. package/web-shell/assets/gitGraphDiagram-WWUBYQGX-C_pPFiTR.js +0 -106
  446. package/web-shell/assets/index-BYWs4JWq.js +0 -3
  447. package/web-shell/assets/index-D3YS6KuJ.js +0 -2173
  448. package/web-shell/assets/index-eBxK3rs2.css +0 -36
  449. package/web-shell/assets/ishikawaDiagram-5VMMS53U-ktpJFq4r.js +0 -70
  450. package/web-shell/assets/kanban-definition-3QL26DDD-m_gG00Yt.js +0 -89
  451. package/web-shell/assets/mermaid.core-DSCYB_2P.js +0 -312
  452. package/web-shell/assets/mindmap-definition-FBJOCRG2-DRQbT8w-.js +0 -96
  453. package/web-shell/assets/pieDiagram-E7YTZNPT-BvIGQCSd.js +0 -39
  454. package/web-shell/assets/quadrantDiagram-AXDQQJYC-BDQtfpU-.js +0 -7
  455. package/web-shell/assets/sizeCapture-X5ZJPWSS-BB7YY4Tl.js +0 -1
  456. package/web-shell/assets/stateDiagram-v2-4QOOHH4V-C4CbdvGa.js +0 -1
  457. package/web-shell/assets/swimlanes-XN3QIQJK-D94vOoxZ.js +0 -1
  458. package/web-shell/assets/swimlanesDiagram-VK2B7HYN--QNSIOC8.js +0 -8
  459. package/web-shell/assets/timeline-definition-24CTP7MA-C9C8uEYm.js +0 -120
  460. package/web-shell/assets/vennDiagram-4TSXK5OY-CYzMHbVW.js +0 -34
  461. package/web-shell/assets/wardleyDiagram-VM6X3IG4-G9nhtLES.js +0 -78
  462. package/chunks/{open-with-auth-6MVIHMXB.js → open-with-auth-XFCCJOO6.js} +3 -3
@@ -1,18 +1,15 @@
1
1
  // Force strict mode and setup for ESM
2
2
  "use strict";
3
- import {
4
- recomputeMcpGating
5
- } from "./chunk-7ICHPMBQ.js";
6
3
  import {
7
4
  PeerMessaging,
8
5
  classifyApiError
9
- } from "./chunk-DT75RKNH.js";
10
- import {
11
- normalizePartList
12
- } from "./chunk-5IENVM7Z.js";
6
+ } from "./chunk-ZXUKZHMV.js";
13
7
  import {
14
8
  fireSessionDeleteHook
15
9
  } from "./chunk-L34XSHIZ.js";
10
+ import {
11
+ normalizePartList
12
+ } from "./chunk-5IENVM7Z.js";
16
13
  import {
17
14
  EXTENSION_CONTEXT_BUDGET,
18
15
  buildExtensionMentionContext,
@@ -22,7 +19,7 @@ import {
22
19
  matchMcpServerByRef,
23
20
  parseExtensionRef,
24
21
  parseMcpServerRef
25
- } from "./chunk-MLQNSPRZ.js";
22
+ } from "./chunk-3AYIKQTJ.js";
26
23
  import {
27
24
  getAvailableCommands,
28
25
  getSlashCommandFirstToken,
@@ -32,7 +29,10 @@ import {
32
29
  pLimit,
33
30
  recordDaemonSessionModel,
34
31
  restoreSessionModelThenAuthenticate
35
- } from "./chunk-SSGAAWLY.js";
32
+ } from "./chunk-PNACDSCO.js";
33
+ import {
34
+ recomputeMcpGating
35
+ } from "./chunk-VELFTVEO.js";
36
36
  import {
37
37
  SessionIdConflictError,
38
38
  appEvents,
@@ -42,46 +42,44 @@ import {
42
42
  loadCliConfig,
43
43
  normalizeDisabledToolList,
44
44
  parseApprovalModeValue
45
- } from "./chunk-DYFOSJHU.js";
45
+ } from "./chunk-QM2MRAG4.js";
46
+ import {
47
+ getCommandSubcommandNames,
48
+ getEffectiveSupportedModes
49
+ } from "./chunk-4XP7WXC4.js";
50
+ import "./chunk-YGFJ6BRT.js";
46
51
  import "./chunk-NYX53SV4.js";
52
+ import "./chunk-FBDHP23D.js";
47
53
  import {
48
54
  collectContextData,
49
55
  formatContextUsageText
50
- } from "./chunk-W5FIP7FC.js";
51
- import {
52
- getCommandSubcommandNames
53
- } from "./chunk-7Q2AXRDJ.js";
54
- import {
55
- getEffectiveSupportedModes
56
- } from "./chunk-BWAMMKIS.js";
57
- import "./chunk-S6Q6Q4P2.js";
56
+ } from "./chunk-JLZ5YCMV.js";
58
57
  import "./chunk-4WGODMVR.js";
59
- import "./chunk-QMUYLYT5.js";
58
+ import {
59
+ startNonInteractiveOpenAILogHousekeeping
60
+ } from "./chunk-PCIYPEYV.js";
61
+ import "./chunk-KW7NOTN6.js";
62
+ import "./chunk-2XRE4KE4.js";
63
+ import "./chunk-6TFZIA2L.js";
60
64
  import {
61
65
  isGoalStatusKind
62
66
  } from "./chunk-EKTCKZV5.js";
63
- import "./chunk-GOXQL4YH.js";
64
- import "./chunk-2XRE4KE4.js";
67
+ import "./chunk-LFNK4DGQ.js";
68
+ import "./chunk-YAF2MQZ6.js";
65
69
  import {
66
- startNonInteractiveOpenAILogHousekeeping
67
- } from "./chunk-MHAADZOZ.js";
68
- import "./chunk-KW7NOTN6.js";
69
- import "./chunk-EVTNACMT.js";
70
+ computeCpuPercent
71
+ } from "./chunk-LBOVL47Y.js";
72
+ import "./chunk-24FVUD5P.js";
73
+ import "./chunk-WKQX4FND.js";
70
74
  import "./chunk-6H67XLET.js";
71
75
  import {
72
76
  beginAcpBootstrapConfigProfiling,
73
77
  buildAndFreezeAcpStartupProfile,
74
78
  endAcpBootstrapConfigProfiling,
75
79
  markAcpStartup
76
- } from "./chunk-J3TJH52D.js";
77
- import "./chunk-SYLECP23.js";
78
- import "./chunk-GCDXVPFK.js";
79
- import "./chunk-AC6KDLH3.js";
80
- import "./chunk-YAF2MQZ6.js";
81
- import {
82
- computeCpuPercent
83
- } from "./chunk-LBOVL47Y.js";
84
- import "./chunk-24FVUD5P.js";
80
+ } from "./chunk-DOTF2PF2.js";
81
+ import "./chunk-BBMOAZ2E.js";
82
+ import "./chunk-TW2RLZPC.js";
85
83
  import {
86
84
  GENERATION_MAX_PROMPT_BYTES,
87
85
  GENERATION_TIMEOUT_MS,
@@ -102,7 +100,7 @@ import {
102
100
  shouldSuppressRememberErrorDetails,
103
101
  workspaceMemoryFailureCode,
104
102
  workspaceMemoryFailureDiagnostics
105
- } from "./chunk-KOKPXIAN.js";
103
+ } from "./chunk-UL4DXZMP.js";
106
104
  import {
107
105
  BaseEmitter,
108
106
  HistoryReplayer,
@@ -113,14 +111,21 @@ import {
113
111
  hasFullSessionContext,
114
112
  observeAcpToolResultProjection,
115
113
  observeAcpToolResultWire
116
- } from "./chunk-3XLK2QMY.js";
114
+ } from "./chunk-H7L725Z6.js";
117
115
  import "./chunk-M3JGHRMQ.js";
118
116
  import "./chunk-VFFQAOPR.js";
117
+ import "./chunk-2S2WIGCM.js";
119
118
  import "./chunk-47ECGEJC.js";
120
- import "./chunk-6JACAGYH.js";
121
119
  import "./chunk-2MIN6GRR.js";
122
120
  import "./chunk-QHTIBUWB.js";
123
121
  import "./chunk-TXASDT2M.js";
122
+ import {
123
+ getConversationDirectoryName,
124
+ hasVerifiableInode,
125
+ isSameConversationPath,
126
+ isSameDirectoryIdentity
127
+ } from "./chunk-PB7JBAHF.js";
128
+ import "./chunk-DMEUXLSS.js";
124
129
  import {
125
130
  isCompatibleLiveSessionSource
126
131
  } from "./chunk-OHU2H5CS.js";
@@ -131,19 +136,12 @@ import {
131
136
  isReservedStandaloneSessionSourceType,
132
137
  parseSessionSource
133
138
  } from "./chunk-N4QWUPDM.js";
134
- import {
135
- getConversationDirectoryName,
136
- hasVerifiableInode,
137
- isSameConversationPath,
138
- isSameDirectoryIdentity
139
- } from "./chunk-PB7JBAHF.js";
140
- import "./chunk-UXEO7E3V.js";
141
139
  import {
142
140
  buildScheduledTaskRunPrompt,
143
141
  normalizeChannelDeliveryText,
144
142
  scheduledTaskRunSessionName,
145
143
  scheduledTaskRunSourceId
146
- } from "./chunk-Z3GF56ME.js";
144
+ } from "./chunk-FRISMWG3.js";
147
145
  import {
148
146
  normalizeSessionIdForLookup,
149
147
  parseCallerSuppliedSessionId
@@ -154,36 +152,16 @@ import {
154
152
  buildPermissionSettings,
155
153
  normalizePermissionRules,
156
154
  readPermissionRuleSet
157
- } from "./chunk-XBZTAGB7.js";
155
+ } from "./chunk-OXDQETZA.js";
158
156
  import {
159
157
  MAX_AUDIO_BYTES,
160
158
  sanitizeVoiceErrorMessage,
161
159
  transcribeVoiceAudio
162
- } from "./chunk-2ALXPGB4.js";
160
+ } from "./chunk-E6IR653O.js";
163
161
  import {
164
162
  readVoiceModel
165
- } from "./chunk-NE624IVP.js";
163
+ } from "./chunk-ADQUK6WA.js";
166
164
  import "./chunk-Y53DG2HA.js";
167
- import {
168
- mapSkillConfigToStatus
169
- } from "./chunk-BHTYRHJF.js";
170
- import "./chunk-FCQJLMA2.js";
171
- import "./chunk-DMEUXLSS.js";
172
- import {
173
- createLoadedSettingsAdapter
174
- } from "./chunk-TWUKBNWM.js";
175
- import "./chunk-RWVD5RRY.js";
176
- import "./chunk-HBQ2NXOU.js";
177
- import "./chunk-JS73NNWF.js";
178
- import {
179
- SCHEDULED_TASK_RUN_SOURCE_TYPE
180
- } from "./chunk-3KQBQ6FM.js";
181
- import "./chunk-7U5G6JXI.js";
182
- import "./chunk-WCCLLK7X.js";
183
- import "./chunk-OCPBI7J5.js";
184
- import {
185
- ndJsonStream
186
- } from "./chunk-IUVIBDKU.js";
187
165
  import {
188
166
  PERSIST_REASONING_SELECTION_META_KEY,
189
167
  REASONING_EFFORT_DEFAULT,
@@ -200,16 +178,30 @@ import {
200
178
  isReasoningSelectionSupported,
201
179
  parseReasoningSelection,
202
180
  resolvePersistedReasoningConfigState
203
- } from "./chunk-BV6Q5HMY.js";
181
+ } from "./chunk-MJHLKWGJ.js";
204
182
  import {
205
- ACP_ROUTE_ID_PREFIX,
206
- buildAcpModelOptions,
207
- getCurrentAcpModelId,
208
- parseAcpBaseModelId,
209
- parseAcpModelOption,
210
- resolveAcpModelOption,
211
- sanitizeProviderBaseUrl
212
- } from "./chunk-MF6E7FSA.js";
183
+ mapSkillConfigToStatus
184
+ } from "./chunk-ZJ7JQUGY.js";
185
+ import {
186
+ resolveSkillSettings
187
+ } from "./chunk-LMJSPC55.js";
188
+ import "./chunk-Q3TFRP5G.js";
189
+ import {
190
+ createLoadedSettingsAdapter
191
+ } from "./chunk-RKXAOP6F.js";
192
+ import "./chunk-BDDE4YNP.js";
193
+ import "./chunk-M6MID3FA.js";
194
+ import "./chunk-JS73NNWF.js";
195
+ import {
196
+ SCHEDULED_TASK_RUN_SOURCE_TYPE
197
+ } from "./chunk-SYDMM6IX.js";
198
+ import "./chunk-7U5G6JXI.js";
199
+ import "./chunk-WCCLLK7X.js";
200
+ import "./chunk-OCPBI7J5.js";
201
+ import {
202
+ ndJsonStream
203
+ } from "./chunk-2YMRRI2C.js";
204
+ import "./chunk-LYD3T3H7.js";
213
205
  import {
214
206
  ACP_PREFLIGHT_KINDS,
215
207
  IDLE_HOOK_EVENTS,
@@ -217,16 +209,23 @@ import {
217
209
  SERVE_STATUS_EXT_METHODS,
218
210
  STATUS_SCHEMA_VERSION,
219
211
  mapDomainErrorToErrorKind
220
- } from "./chunk-HGEUHUEV.js";
212
+ } from "./chunk-54B2LTKP.js";
213
+ import "./chunk-MFPAVOYJ.js";
221
214
  import {
222
- resolveSkillSettings
223
- } from "./chunk-HWVUSYSN.js";
224
- import "./chunk-NHCZJQE4.js";
225
- import "./chunk-SODMFNAR.js";
215
+ ACP_ROUTE_ID_PREFIX,
216
+ buildAcpModelOptions,
217
+ getCurrentAcpModelId,
218
+ parseAcpBaseModelId,
219
+ parseAcpModelOption,
220
+ resolveAcpModelOption,
221
+ sanitizeProviderBaseUrl
222
+ } from "./chunk-INGBUYL6.js";
223
+ import "./chunk-WLFILD4T.js";
224
+ import "./chunk-SQCZDHBQ.js";
226
225
  import "./chunk-57OAHC2Y.js";
227
- import "./chunk-RZHU3K6M.js";
228
- import "./chunk-CUEXOHQH.js";
229
- import "./chunk-76RGWKLS.js";
226
+ import "./chunk-IAS753HG.js";
227
+ import "./chunk-5ODRE7E5.js";
228
+ import "./chunk-ABNX6E6K.js";
230
229
  import "./chunk-V6WHFGST.js";
231
230
  import {
232
231
  ACTIVE_WORK_CLOSE_IF_UNHELD_PARAM,
@@ -246,6 +245,7 @@ import {
246
245
  DAEMON_PERMISSION_CANCEL_REASON_META_KEY,
247
246
  DAEMON_PROMPT_DISPLAY_TEXT_META_KEY,
248
247
  DAEMON_RESTORE_ASK_USER_QUESTION_META_KEY,
248
+ DAEMON_SUBMITTED_PROMPT_META_KEY,
249
249
  DAEMON_SUPPRESS_RESTORE_ASK_USER_QUESTION_META_KEY,
250
250
  DAEMON_SUPPRESS_WORKTREE_CONTEXT_RESTORE_META_KEY,
251
251
  LOAD_REPLAY_BULK_MODE,
@@ -261,25 +261,27 @@ import {
261
261
  REQUESTED_SESSION_ID_META_KEY,
262
262
  SESSION_INITIALIZATION_DEADLINE_META_KEY,
263
263
  SESSION_INITIALIZATION_TIMEOUT_ERROR_KIND,
264
+ SESSION_MODEL_PERSIST_DEFAULT_META_KEY,
265
+ SUBMITTED_PROMPT_META_KEY,
264
266
  TODO_STOP_GUARD_CONTINUATION_CLAIM_METHOD,
265
267
  TODO_STOP_GUARD_QUEUE_RELEASE_METHOD,
266
268
  WORKTREE_MCP_DEFER_META_KEY,
267
269
  clampActiveWorkIntervalMs,
268
270
  isValidTrustedModelPrompt
269
- } from "./chunk-PSPAM24S.js";
271
+ } from "./chunk-TBSCTWKF.js";
270
272
  import {
271
273
  NOT_CURRENTLY_GENERATING_CANCEL_MESSAGE,
272
274
  isNotCurrentlyGeneratingCancelError
273
275
  } from "./chunk-FAWTMDX7.js";
276
+ import "./chunk-6PLDPT2C.js";
274
277
  import "./chunk-FYJ7W2PI.js";
275
278
  import "./chunk-STUJ7IMZ.js";
276
- import "./chunk-NLNQNBZ2.js";
277
- import "./chunk-ALMR3E6Q.js";
278
279
  import "./chunk-GYTKQYDB.js";
280
+ import "./chunk-WD6YQI5M.js";
281
+ import "./chunk-GDWE23OR.js";
279
282
  import "./chunk-RKFGE7JH.js";
280
283
  import "./chunk-CJ3DHN5I.js";
281
284
  import "./chunk-UDG5EZJI.js";
282
- import "./chunk-M5GB774H.js";
283
285
  import {
284
286
  EXTERNAL_TOOL_GUARD_READY_META_KEY,
285
287
  EXTERNAL_TOOL_GUARD_REQUIRED_VALUE,
@@ -289,12 +291,13 @@ import {
289
291
  SHELL_EXECUTING_TOOL_NAMES,
290
292
  isValidExternalToolGuardDenialReason
291
293
  } from "./chunk-3VUENPWF.js";
294
+ import "./chunk-M5GB774H.js";
292
295
  import "./chunk-NFXXBWSE.js";
293
- import "./chunk-X6K77VHC.js";
296
+ import "./chunk-LWWRJRCD.js";
294
297
  import {
295
298
  ACP_EVENT_LOOP_STALL_RESTART_MS,
296
299
  CHANNEL_PROMPT_META_KEY
297
- } from "./chunk-7QYWGTHB.js";
300
+ } from "./chunk-EPVEPTI3.js";
298
301
  import {
299
302
  AgentSideConnection,
300
303
  PROTOCOL_VERSION,
@@ -303,7 +306,7 @@ import {
303
306
  import {
304
307
  assembleMcpServers,
305
308
  loadMcpApprovals
306
- } from "./chunk-2ZN3O5FT.js";
309
+ } from "./chunk-JZ3FFPES.js";
307
310
  import {
308
311
  deleteNestedPropertySafe,
309
312
  getOutputLanguageFilePath,
@@ -315,41 +318,40 @@ import {
315
318
  settingExistsInScope,
316
319
  updateOutputLanguageFile,
317
320
  writeOutputLanguageAndRegisterPath
318
- } from "./chunk-7BXXIQG4.js";
321
+ } from "./chunk-PVKEYO5D.js";
322
+ import "./chunk-P6XVYPWA.js";
319
323
  import "./chunk-RKUWKYED.js";
320
- import "./chunk-ZU47FBOC.js";
324
+ import {
325
+ getCurrentLanguage,
326
+ setLanguageAsync
327
+ } from "./chunk-I6YJZGHS.js";
328
+ import {
329
+ SUPPORTED_LANGUAGES
330
+ } from "./chunk-5EJZE3FP.js";
321
331
  import {
322
332
  findEnvFiles,
323
333
  preResolveHomeEnvOverrides,
324
334
  reloadEnvironment
325
- } from "./chunk-NOAG7N22.js";
326
- import "./chunk-N6VQ37ZZ.js";
335
+ } from "./chunk-IGLX6UXJ.js";
336
+ import "./chunk-SFL6U7U7.js";
327
337
  import "./chunk-BW4333PP.js";
328
- import {
329
- ENV_ACP_REPEATED_TOOL_FAILURE_GUARD,
330
- QWEN_CODE_SERVE_ENV
331
- } from "./chunk-VX63RJXE.js";
332
- import "./chunk-6PLDPT2C.js";
333
338
  import {
334
339
  getSystemDefaultsPath,
335
340
  getSystemSettingsPath
336
341
  } from "./chunk-IDS7MSUP.js";
337
342
  import {
338
- getCurrentLanguage,
339
- setLanguageAsync
340
- } from "./chunk-VZUCTJ2P.js";
341
- import {
342
- SUPPORTED_LANGUAGES
343
- } from "./chunk-5EJZE3FP.js";
343
+ ENV_ACP_REPEATED_TOOL_FAILURE_GUARD,
344
+ QWEN_CODE_SERVE_ENV
345
+ } from "./chunk-XX5HQLCZ.js";
344
346
  import "./chunk-XFSFZCM5.js";
345
347
  import "./chunk-2EAZ43JQ.js";
346
348
  import "./chunk-NF5J2WFA.js";
347
- import "./chunk-R4Q2PEFV.js";
349
+ import "./chunk-E7HXORS7.js";
348
350
  import "./chunk-W3N5XAZ6.js";
349
351
  import {
350
352
  isWorkspaceTrusted,
351
353
  loadTrustedFolders
352
- } from "./chunk-53GWJOLP.js";
354
+ } from "./chunk-2P2IXKDR.js";
353
355
  import "./chunk-NPQ5ZKRP.js";
354
356
  import "./chunk-MR3PXB6E.js";
355
357
  import {
@@ -362,7 +364,6 @@ import {
362
364
  TURN_INTERRUPTION_HISTORY_TAIL_COUNT,
363
365
  WorkspaceMcpBudget,
364
366
  abortGoalForStopHookCap,
365
- applyProviderInstallPlan,
366
367
  buildBtwCacheSafeParams,
367
368
  buildBtwPrompt,
368
369
  buildGoalContinuationParts,
@@ -379,36 +380,38 @@ import {
379
380
  readManyFiles,
380
381
  runManagedRememberByAgent,
381
382
  subagentGenerator
382
- } from "./chunk-BZM5U74J.js";
383
+ } from "./chunk-I6JRN375.js";
383
384
  import {
384
385
  buildToolWriteOriginMeta
385
386
  } from "./chunk-GELRJXE2.js";
386
387
  import "./chunk-32CM56LO.js";
388
+ import {
389
+ CreateSubSessionTool
390
+ } from "./chunk-6WXVEDT2.js";
391
+ import "./chunk-LJZSMWOH.js";
387
392
  import {
388
393
  ALL_PROVIDERS,
394
+ applyProviderInstallPlan,
389
395
  buildInstallPlan,
390
396
  findExistingProviderModels,
391
397
  findProviderById,
392
398
  getDefaultBaseUrlForProtocol,
393
399
  getDefaultModelIds,
394
- resolveBaseUrl
395
- } from "./chunk-AEY27Z35.js";
396
- import {
397
- CreateSubSessionTool
398
- } from "./chunk-Y2MYW47X.js";
399
- import "./chunk-LJZSMWOH.js";
400
- import "./chunk-F42YYSCK.js";
401
- import "./chunk-NUQVB25K.js";
400
+ resolveBaseUrl,
401
+ resolveOwnsModel
402
+ } from "./chunk-7JGH6IMU.js";
403
+ import "./chunk-KLGCF6G7.js";
404
+ import "./chunk-EKMJR7M3.js";
405
+ import "./chunk-EDB556X7.js";
402
406
  import {
403
407
  restoreWorktreeContext
404
- } from "./chunk-ZKZHSB5W.js";
405
- import "./chunk-MSNHNAQZ.js";
408
+ } from "./chunk-QR4Q425T.js";
409
+ import "./chunk-UUT7EFX3.js";
406
410
  import "./chunk-DJXSOEFB.js";
407
- import "./chunk-ZKYR7QS4.js";
408
- import "./chunk-532WHF4F.js";
411
+ import "./chunk-5VQR2DD7.js";
409
412
  import "./chunk-BUQN5LTI.js";
410
413
  import "./chunk-ZPJWUGCS.js";
411
- import "./chunk-LK2WUCDQ.js";
414
+ import "./chunk-YM6KUQ2S.js";
412
415
  import {
413
416
  MAX_RETAINED_SNAPSHOTS,
414
417
  deleteWorkflowSnapshot,
@@ -417,8 +420,8 @@ import {
417
420
  listWorkflowSnapshots,
418
421
  resolveSavedWorkflowScript,
419
422
  toSnapshot
420
- } from "./chunk-UKZ45TJL.js";
421
- import "./chunk-RLLRJJDR.js";
423
+ } from "./chunk-LMDMYMSS.js";
424
+ import "./chunk-TJDUJSVH.js";
422
425
  import {
423
426
  APPROVAL_MODE_INFO,
424
427
  BranchPointInvalidError,
@@ -460,15 +463,15 @@ import {
460
463
  SessionWriterUnavailableError,
461
464
  TURN_RESULT_CODE_TEXT_TRUNCATED,
462
465
  TURN_RESULT_TEXT_MAX_CHARS,
466
+ ToolMode,
463
467
  acquireSleepInhibitor,
464
468
  ambientGoalToolResultProvenance,
465
469
  applyAutoModeDecision,
466
- approxBase64Bytes,
470
+ applyPendingGoalProposal,
467
471
  bridgeToolResultImages,
468
472
  buildBackgroundEntryLabel,
469
473
  buildContextUsage,
470
474
  buildPermissionCheckContext,
471
- clampInlineMediaPart,
472
475
  collectSessionTurnState,
473
476
  computeUniqueBranchTitle,
474
477
  convertToFunctionErrorResponse,
@@ -494,6 +497,8 @@ import {
494
497
  firePostToolUseHook,
495
498
  firePreToolUseHook,
496
499
  formatDenialStateLog,
500
+ formatProposeGoalRecoveryFailed,
501
+ formatProposeGoalRecoveryNotStarted,
497
502
  formatStopHookBlockingCapWarning,
498
503
  generateToolUseId,
499
504
  getAutoModeActionFingerprint,
@@ -512,6 +517,7 @@ import {
512
517
  ideContextStore,
513
518
  injectPermissionRulesIfMissing,
514
519
  isApproveOutcome,
520
+ isCodeModeToolCallAllowed,
515
521
  isCompressionFailureStatus,
516
522
  isDenialFallbackReason,
517
523
  isGatedMcpScope,
@@ -554,60 +560,66 @@ import {
554
560
  updateSetting,
555
561
  validatePlanModeShellApproval,
556
562
  validatePlanModeShellContext
557
- } from "./chunk-N7VWZDWW.js";
563
+ } from "./chunk-DCRVSIK6.js";
558
564
  import "./chunk-GOFAQQZA.js";
565
+ import "./chunk-HEOH7JZY.js";
559
566
  import "./chunk-TWPJO254.js";
560
567
  import {
561
568
  external_exports
562
569
  } from "./chunk-CQ35AJ4Z.js";
563
570
  import "./chunk-65I7S4Z3.js";
564
- import "./chunk-6HUXPLB5.js";
565
571
  import "./chunk-7CLLH5TI.js";
566
- import "./chunk-XKBFYTCD.js";
572
+ import "./chunk-WK6DEH3Q.js";
573
+ import {
574
+ parsePositiveIntegerEnv
575
+ } from "./chunk-6PVPNMXU.js";
567
576
  import {
568
577
  RUNTIME_SNAPSHOT_PREFIX
569
- } from "./chunk-ZTTC7T4X.js";
578
+ } from "./chunk-5JG3DAKS.js";
570
579
  import {
571
580
  SESSION_ARTIFACT_PERSISTENCE_VERSION,
572
581
  normalizeEventPayload,
573
582
  normalizeSnapshotPayload,
574
583
  wrapUserPromptSubmitContext
575
- } from "./chunk-E4UEO3XM.js";
576
- import "./chunk-IAEXTMED.js";
577
- import "./chunk-IRH27ZC2.js";
584
+ } from "./chunk-ME4JBHSB.js";
585
+ import "./chunk-GNV2SFO7.js";
586
+ import "./chunk-5EZRLTLQ.js";
578
587
  import "./chunk-QHWCP53L.js";
579
- import "./chunk-F53KKZUD.js";
588
+ import {
589
+ isValidCronTaskRoutingId
590
+ } from "./chunk-3LMDSCLU.js";
580
591
  import {
581
592
  promptIdContext,
582
593
  todoWorkChainContext
583
594
  } from "./chunk-O6GEWCJA.js";
584
- import "./chunk-36HCNKDS.js";
585
- import {
586
- parsePositiveIntegerEnv
587
- } from "./chunk-6PVPNMXU.js";
595
+ import "./chunk-WKVZES7O.js";
588
596
  import {
589
597
  AgentOutputMessageCapture,
590
598
  addAgentInputMessageAttributes,
591
599
  addToolArgumentsAttributes,
592
600
  addToolCallResultAttributes,
601
+ authoredSkillName,
602
+ qualifySkillName,
593
603
  registerAcpEventLoopLagGauge,
594
604
  startEventLoopLagMonitor
595
- } from "./chunk-2SZH22YO.js";
596
- import "./chunk-DTNV6UZY.js";
605
+ } from "./chunk-NJ2OFVUX.js";
606
+ import "./chunk-HFJSQ4GL.js";
597
607
  import "./chunk-QJNDUTOL.js";
598
- import "./chunk-JXNIF2O5.js";
599
- import "./chunk-NFYEQRLG.js";
608
+ import "./chunk-V545KI73.js";
609
+ import "./chunk-MQRLLBMQ.js";
600
610
  import {
601
611
  SessionSourceError,
602
612
  SessionSourceService
603
613
  } from "./chunk-ELRMZTPF.js";
614
+ import "./chunk-U6H3XTFA.js";
615
+ import "./chunk-ACHCT36C.js";
604
616
  import {
605
617
  escapeJsonTagCharacters
606
618
  } from "./chunk-CHEIIBT3.js";
607
- import "./chunk-PLLIWEM3.js";
619
+ import "./chunk-AEWCOE64.js";
608
620
  import {
609
621
  registerSession
610
- } from "./chunk-5GLDOLNQ.js";
622
+ } from "./chunk-OWUAZXXN.js";
611
623
  import "./chunk-CH2YDT6X.js";
612
624
  import {
613
625
  APPROVAL_MODES
@@ -619,49 +631,53 @@ import {
619
631
  getOutputStyleTurnReminder,
620
632
  getPlanModeSystemReminder,
621
633
  resolveMainSessionOutputStyle
622
- } from "./chunk-LILGKQ4B.js";
623
- import "./chunk-3CZ2BQV6.js";
624
- import "./chunk-SAH4BD2J.js";
625
- import "./chunk-CXTPVBFA.js";
634
+ } from "./chunk-AXZMWAJV.js";
635
+ import "./chunk-NXUZFW3G.js";
636
+ import {
637
+ approxBase64Bytes,
638
+ clampInlineMediaPart
639
+ } from "./chunk-WFNEY5G7.js";
640
+ import "./chunk-GSS4SZNG.js";
626
641
  import {
627
642
  runWithRuntimeContentGenerator
628
- } from "./chunk-U7O65WKL.js";
643
+ } from "./chunk-BW2SMO6L.js";
629
644
  import "./chunk-S6LOFUVP.js";
630
645
  import {
631
646
  FORK_SUBAGENT_TYPE,
632
647
  isSystemReminderContent,
633
648
  wrapSystemReminder
634
- } from "./chunk-FN3JNDRU.js";
635
- import "./chunk-EUURTIV6.js";
649
+ } from "./chunk-VVI7MK3V.js";
650
+ import "./chunk-WBSJ6VPZ.js";
636
651
  import {
637
652
  HookEventName,
638
653
  createHookOutput
639
654
  } from "./chunk-G6UUOCUT.js";
640
655
  import "./chunk-IZ2U57NY.js";
656
+ import "./chunk-Z72PLR74.js";
641
657
  import "./chunk-NUQ4GK5I.js";
642
- import "./chunk-K2OJUPOE.js";
643
658
  import {
644
659
  clearCachedCredentialFile,
645
660
  qwenOAuth2Events
646
- } from "./chunk-AXTFYDXT.js";
661
+ } from "./chunk-CXXAZ2LZ.js";
647
662
  import "./chunk-NAVJD2PQ.js";
648
- import "./chunk-YBUMTY7B.js";
649
- import "./chunk-HNLMYDQE.js";
650
- import "./chunk-QHMLYMMS.js";
663
+ import "./chunk-66N6C4EH.js";
664
+ import "./chunk-FMLBBXHB.js";
651
665
  import "./chunk-VNOVK4I7.js";
652
666
  import {
653
667
  getToolCallPreparations
654
- } from "./chunk-CFKIH3D3.js";
668
+ } from "./chunk-S7UQ3V2H.js";
655
669
  import "./chunk-JL6APGBX.js";
656
670
  import "./chunk-DJ2GSRLV.js";
657
- import "./chunk-4ALNJDHL.js";
658
- import "./chunk-NOO4QFXM.js";
671
+ import "./chunk-ZKIAGIGH.js";
672
+ import "./chunk-VGY2RGXL.js";
673
+ import "./chunk-C75BXMPM.js";
659
674
  import "./chunk-KFFCDLKV.js";
675
+ import "./chunk-KP2FHIFR.js";
660
676
  import {
661
677
  addDaemonRequestAttribute,
662
678
  extractDaemonTraceContext,
663
679
  withDaemonSpan
664
- } from "./chunk-ZW2EUO2A.js";
680
+ } from "./chunk-L6DIANLD.js";
665
681
  import {
666
682
  ConversationFinishedEvent,
667
683
  DiscoveredMCPTool,
@@ -687,7 +703,7 @@ import {
687
703
  shouldRunVisionBridge,
688
704
  splitImageParts,
689
705
  uiTelemetryService
690
- } from "./chunk-HBU7EKY4.js";
706
+ } from "./chunk-TRKIKBUW.js";
691
707
  import {
692
708
  INVOCATION_CONTEXT_META_KEY,
693
709
  PRIVATE_ACP_CAPABILITY_ENV,
@@ -696,23 +712,28 @@ import {
696
712
  parseInvocationContext,
697
713
  runWithInvocationContext
698
714
  } from "./chunk-5ETULJLP.js";
699
- import "./chunk-ZHKTKHMO.js";
715
+ import "./chunk-7MIBD3LG.js";
700
716
  import "./chunk-VGC4I5JJ.js";
717
+ import {
718
+ getAllMemoryFilenames,
719
+ getSpecificMimeType
720
+ } from "./chunk-QZW6WRB7.js";
701
721
  import {
702
722
  getAutoMemoryRoot,
703
723
  getUserAutoMemoryRoot
704
724
  } from "./chunk-EDIDYZBT.js";
705
725
  import "./chunk-HD7O6WLV.js";
706
726
  import {
707
- getAllMemoryFilenames,
708
- getSpecificMimeType
709
- } from "./chunk-J6MB5ZHZ.js";
727
+ extractCodeModeImageContent,
728
+ runWithToolCallRuntime,
729
+ runWithoutToolCallRuntime
730
+ } from "./chunk-CFMZLE3L.js";
710
731
  import "./chunk-WZAD4ZNJ.js";
711
732
  import {
712
733
  REASONING_EFFORT_TIERS,
713
734
  getGptReasoningCapabilities,
714
735
  parseModelReasoningCapabilities
715
- } from "./chunk-3FPYT6QC.js";
736
+ } from "./chunk-ARDHE6MM.js";
716
737
  import {
717
738
  DEFAULT_TOKEN_LIMIT,
718
739
  tokenLimit
@@ -721,7 +742,7 @@ import "./chunk-TIGXX4PA.js";
721
742
  import {
722
743
  hasVertexProjectConfigured,
723
744
  preloadContentGenerator
724
- } from "./chunk-3UXUOFO6.js";
745
+ } from "./chunk-7W2Y3PZD.js";
725
746
  import "./chunk-XFFRI3WM.js";
726
747
  import {
727
748
  AuthType
@@ -738,9 +759,9 @@ import {
738
759
  startToolExecutionSpan,
739
760
  startToolSpan,
740
761
  withInteractionSpan
741
- } from "./chunk-W5ZQMAEM.js";
762
+ } from "./chunk-4Y2I3CI3.js";
742
763
  import "./chunk-74TONY4F.js";
743
- import "./chunk-HUXPEUFL.js";
764
+ import "./chunk-SYROIHU7.js";
744
765
  import {
745
766
  BaseDeclarativeTool,
746
767
  BaseToolInvocation,
@@ -748,7 +769,7 @@ import {
748
769
  ToolNames,
749
770
  canonicalToolName,
750
771
  isShellProgressData
751
- } from "./chunk-TP6FYVQT.js";
772
+ } from "./chunk-RSWBT7AZ.js";
752
773
  import {
753
774
  Storage,
754
775
  createDebugLogger,
@@ -758,13 +779,13 @@ import {
758
779
  sessionIdContext
759
780
  } from "./chunk-ZAFYHRVY.js";
760
781
  import "./chunk-TBWQLLFO.js";
782
+ import "./chunk-WNQRJXKP.js";
761
783
  import "./chunk-V5U2NZNJ.js";
762
- import "./chunk-6W4HBUA2.js";
763
- import "./chunk-TPKQIA7G.js";
784
+ import "./chunk-BSIOCNDK.js";
764
785
  import {
765
786
  registerCleanup,
766
787
  runExitCleanup
767
- } from "./chunk-JYKWOREU.js";
788
+ } from "./chunk-WMEX6CFP.js";
768
789
  import {
769
790
  writeStderrLine,
770
791
  writeStderrLineSafe
@@ -784,7 +805,7 @@ import {
784
805
  // packages/cli/src/acp-integration/acpAgent.ts
785
806
  init_esbuild_shims();
786
807
  import { randomUUID as randomUUID2, timingSafeEqual } from "node:crypto";
787
- import { performance } from "node:perf_hooks";
808
+ import { performance as performance2 } from "node:perf_hooks";
788
809
  import { isDeepStrictEqual } from "node:util";
789
810
 
790
811
  // packages/cli/src/acp-integration/authMethods.ts
@@ -1025,6 +1046,7 @@ var AcpFileSystemService = class {
1025
1046
 
1026
1047
  // packages/cli/src/acp-integration/acpAgent.ts
1027
1048
  import { Readable as Readable2, Writable as Writable2 } from "node:stream";
1049
+ import { realpathSync as realpathSync3 } from "node:fs";
1028
1050
  import * as fs4 from "node:fs/promises";
1029
1051
  import * as os3 from "node:os";
1030
1052
  import * as path7 from "node:path";
@@ -1162,7 +1184,11 @@ function inactiveExtensionSkillRefs(config) {
1162
1184
  }
1163
1185
  __name(inactiveExtensionSkillRefs, "inactiveExtensionSkillRefs");
1164
1186
  function isInactiveExtensionSkill(skill, inactiveSkillRefs) {
1165
- return skill.level === "extension" && skill.extensionName !== void 0 && inactiveSkillRefs.has(extensionSkillRef(skill.extensionName, skill.name));
1187
+ return skill.level === "extension" && skill.extensionName !== void 0 && // The ref set holds authored names because it is built from the manifest,
1188
+ // while the registry name carries the owner prefix.
1189
+ inactiveSkillRefs.has(
1190
+ extensionSkillRef(skill.extensionName, authoredSkillName(skill))
1191
+ );
1166
1192
  }
1167
1193
  __name(isInactiveExtensionSkill, "isInactiveExtensionSkill");
1168
1194
 
@@ -2154,6 +2180,12 @@ function buildPermissionRequestContent(confirmation) {
2154
2180
  }
2155
2181
  });
2156
2182
  }
2183
+ if (confirmation.type === "info" && confirmation.renderPromptAsPlainText) {
2184
+ content.push({
2185
+ type: "content",
2186
+ content: { type: "text", text: confirmation.prompt }
2187
+ });
2188
+ }
2157
2189
  return content;
2158
2190
  }
2159
2191
  __name(buildPermissionRequestContent, "buildPermissionRequestContent");
@@ -3289,6 +3321,7 @@ var MAX_RETAINED_SESSION_ROUTE_COUNTS = 8;
3289
3321
  var USER_CANCEL_ABORT_REASON = "qwen:user-cancel";
3290
3322
  var NEW_PROMPT_ABORT_REASON = "qwen:new-prompt";
3291
3323
  var SESSION_DISPOSE_ABORT_REASON = "qwen:session-dispose";
3324
+ var GOAL_HELD_RECOVERY_COMMANDS = "Run:\n/goal pause\nThen, when ready:\n/goal resume";
3292
3325
  var DAEMON_RETRY_META_KEY = "qwen.daemon.retry";
3293
3326
  var DAEMON_CONTINUE_META_KEY = "qwen.daemon.continueLastTurn";
3294
3327
  var MAX_DAEMON_ATTACHMENT_REFERENCES = 256;
@@ -4052,6 +4085,7 @@ async function buildAvailableCommandsSnapshot(config, abortSignal = AbortSignal.
4052
4085
  const isInactiveExtensionCommand = cmd.skillDetail.level === "extension" && isInactiveExtensionSkill(
4053
4086
  {
4054
4087
  name: cmd.skillDetail.name,
4088
+ authoredName: cmd.skillDetail.authoredName,
4055
4089
  level: "extension",
4056
4090
  extensionName: "extensionName" in cmd.skillDetail && typeof cmd.skillDetail.extensionName === "string" ? cmd.skillDetail.extensionName : void 0
4057
4091
  },
@@ -4137,6 +4171,7 @@ var Session = class {
4137
4171
  this.onActiveWorkChanged = onActiveWorkChanged;
4138
4172
  this.isWorkflowRunLiveInSiblingSession = isWorkflowRunLiveInSiblingSession;
4139
4173
  this.sessionId = id;
4174
+ this.restoredHistoryGaps = config.getSessionRestoreRuntime?.()?.historyGaps;
4140
4175
  this.workflowHistory = [...workflowHistory];
4141
4176
  this.requiresManagedConversationBinding = isReservedStandaloneSessionSourceType(
4142
4177
  this.config.getSessionSourceType?.()
@@ -4183,6 +4218,7 @@ var Session = class {
4183
4218
  __name(this, "Session");
4184
4219
  }
4185
4220
  pendingPrompt = null;
4221
+ activeGoalProposalTurn;
4186
4222
  /**
4187
4223
  * Tracks the completion of the current prompt so that the next prompt
4188
4224
  * can await it. This prevents a new prompt from reading chat history
@@ -4200,6 +4236,7 @@ var Session = class {
4200
4236
  */
4201
4237
  followupAbort = null;
4202
4238
  turn = 0;
4239
+ codeModeNestedSequence = 0;
4203
4240
  refreshContextFilesOnWrite = false;
4204
4241
  activeTodoWorkChainPromptId;
4205
4242
  createdAt = Date.now();
@@ -4277,6 +4314,7 @@ var Session = class {
4277
4314
  backgroundNotificationAcceptances = /* @__PURE__ */ new Map();
4278
4315
  activeNotificationAcceptances = /* @__PURE__ */ new Set();
4279
4316
  goalQueue = [];
4317
+ heldGoalProposal;
4280
4318
  goalProcessing = false;
4281
4319
  activeGoalTurn;
4282
4320
  goalHostUnbind;
@@ -4379,6 +4417,7 @@ var Session = class {
4379
4417
  // Implement SessionContext interface
4380
4418
  sessionId;
4381
4419
  sessionReasoningSelection;
4420
+ restoredHistoryGaps;
4382
4421
  #bindGoalRuntime() {
4383
4422
  try {
4384
4423
  const runtime = this.config.getGoalRuntime();
@@ -4386,6 +4425,9 @@ var Session = class {
4386
4425
  this.goalRuntimeUnsubscribe = runtime.subscribe((snapshot, cause) => {
4387
4426
  const previousGoal = this.lastGoalSnapshot?.goal ?? null;
4388
4427
  this.lastGoalSnapshot = snapshot;
4428
+ if (this.heldGoalProposal && (snapshot.goal?.goalId !== this.heldGoalProposal.goalId || snapshot.goal.revision !== this.heldGoalProposal.revision || snapshot.goal.status !== "active" || cause === "resume")) {
4429
+ this.heldGoalProposal = void 0;
4430
+ }
4389
4431
  void this.#queueGoalState(snapshot, cause, previousGoal).catch(
4390
4432
  (error) => debugLogger6.warn(
4391
4433
  `Failed to emit ACP Goal state: ${error instanceof Error ? error.message : String(error)}`
@@ -4571,6 +4613,10 @@ var Session = class {
4571
4613
  if (this.disposed || this.closing || this.goalProcessing || this.pendingPrompt || this.pendingPromptCompletion || this.cronProcessing || this.cronAbortController || this.notificationProcessing || this.notificationAbortController || this.#isAutomaticWorkHeld()) {
4572
4614
  return;
4573
4615
  }
4616
+ const next = this.goalQueue[0];
4617
+ if (this.heldGoalProposal && next?.permit.goalId === this.heldGoalProposal.goalId && next.permit.revision === this.heldGoalProposal.revision) {
4618
+ return;
4619
+ }
4574
4620
  const turn = this.goalQueue.shift();
4575
4621
  if (!turn) return;
4576
4622
  this.goalProcessing = true;
@@ -5485,7 +5531,7 @@ var Session = class {
5485
5531
  }
5486
5532
  }
5487
5533
  }
5488
- reloadModelProvidersFromDisk() {
5534
+ async reloadModelProvidersFromDisk() {
5489
5535
  if (!this.settings.reloadScopesFromDiskAtomically([
5490
5536
  "User" /* User */,
5491
5537
  "Workspace" /* Workspace */
@@ -5496,6 +5542,7 @@ var Session = class {
5496
5542
  this.settings.merged.modelProviders,
5497
5543
  this.settings.merged.providerProtocol ?? {}
5498
5544
  );
5545
+ await this.config.setImageModel(this.settings.merged.imageModel);
5499
5546
  }
5500
5547
  installPendingManagedConversationBinding(expectation, assertIdentity) {
5501
5548
  if (!this.requiresManagedConversationBinding || expectation.canonicalSessionId !== this.sessionId) {
@@ -5974,15 +6021,15 @@ var Session = class {
5974
6021
  llmClient.truncateHistory(apiTruncateIndex);
5975
6022
  chat.stripThoughtsFromHistory();
5976
6023
  this.clearActiveTodoPlanRevision();
6024
+ this.activeTodoWorkChainPromptId = void 0;
5977
6025
  const preserveQueuedPromptPriority = this.todoStopGuardQueuedPromptPriority;
5978
6026
  const shouldDrainAutomaticQueues = (this.todoStopGuard.blocksUnrelatedAutomaticTurns || this.todoStopGuard.hasCommittedContinuation) && !preserveQueuedPromptPriority;
5979
6027
  this.todoStopGuard.blockUntilOrdinaryPromptStarts();
5980
6028
  const rewindFiles = opts?.rewindFiles !== false;
5981
6029
  const fileHistoryService = this.config.getFileHistoryService();
5982
- const survivingSnapshots = rewindFiles ? fileHistoryService.getSnapshots().slice(0, targetTurnIndex + 1) : void 0;
5983
- if (survivingSnapshots) {
5984
- fileHistoryService.restoreFromSnapshots(survivingSnapshots);
5985
- }
6030
+ const snapshotsBeforeRewind = fileHistoryService.getSnapshots();
6031
+ const survivingSnapshots = rewindFiles ? snapshotsBeforeRewind.slice(0, targetTurnIndex + 1) : snapshotsBeforeRewind.slice(0, targetTurnIndex);
6032
+ fileHistoryService.restoreFromSnapshots(survivingSnapshots);
5986
6033
  this.config.getChatRecordingService()?.rewindRecording(
5987
6034
  targetTurnIndex,
5988
6035
  { truncatedCount: Math.max(0, apiHistory.length - apiTruncateIndex) },
@@ -6012,6 +6059,7 @@ var Session = class {
6012
6059
  }
6013
6060
  this.config.getLlmClient().setHistory(structuredClone(history));
6014
6061
  this.clearActiveTodoPlanRevision();
6062
+ this.activeTodoWorkChainPromptId = void 0;
6015
6063
  this.#clearTodoStopGuardTrustAndDrainAutomaticQueues();
6016
6064
  }
6017
6065
  #computeApiTruncationIndexForUserTurn(apiHistory, targetTurnIndex) {
@@ -6095,6 +6143,17 @@ var Session = class {
6095
6143
  );
6096
6144
  }
6097
6145
  const turnRecording = this.#beginTurnRecording(params, invocationContext);
6146
+ const recordAdmissionCancellation = /* @__PURE__ */ __name(() => {
6147
+ if (turnRecording) turnRecording.cancelledAt ??= Date.now();
6148
+ }, "recordAdmissionCancellation");
6149
+ admissionCancellation?.addEventListener(
6150
+ "abort",
6151
+ recordAdmissionCancellation,
6152
+ {
6153
+ once: true
6154
+ }
6155
+ );
6156
+ if (admissionCancellation?.aborted) recordAdmissionCancellation();
6098
6157
  try {
6099
6158
  const result = await this.#promptWithTurnRecording(
6100
6159
  params,
@@ -6104,7 +6163,7 @@ var Session = class {
6104
6163
  scheduledGoalTurn,
6105
6164
  turnRecording
6106
6165
  );
6107
- this.#settleTurnRecording(
6166
+ await this.#settleTurnRecording(
6108
6167
  result.stopReason === "cancelled" ? "cancelled" : "completed",
6109
6168
  turnRecording,
6110
6169
  result
@@ -6116,11 +6175,16 @@ var Session = class {
6116
6175
  const controlledAbort = abortReason === USER_CANCEL_ABORT_REASON || abortReason === SESSION_DISPOSE_ABORT_REASON || abortReason === NEW_PROMPT_ABORT_REASON && this.#isAbortError(error);
6117
6176
  if (controlledAbort) {
6118
6177
  const result = { stopReason: "cancelled" };
6119
- this.#settleTurnRecording("cancelled", turnRecording, result);
6178
+ await this.#settleTurnRecording("cancelled", turnRecording, result);
6120
6179
  return result;
6121
6180
  }
6122
- this.#settleTurnRecording("error", turnRecording, void 0, error);
6181
+ await this.#settleTurnRecording("error", turnRecording, void 0, error);
6123
6182
  throw error;
6183
+ } finally {
6184
+ admissionCancellation?.removeEventListener(
6185
+ "abort",
6186
+ recordAdmissionCancellation
6187
+ );
6124
6188
  }
6125
6189
  }
6126
6190
  async #promptWithTurnRecording(params, invocationContext, admissionCancellation, modelPrompt, scheduledGoalTurn, turnRecording) {
@@ -6168,7 +6232,17 @@ var Session = class {
6168
6232
  if (!goalTurn) {
6169
6233
  try {
6170
6234
  const runtime = this.config.getGoalRuntime();
6171
- if (runtime.getSnapshot().goal?.status === "active") {
6235
+ const activeGoal = runtime.getSnapshot().goal;
6236
+ const heldGoalMatches = this.heldGoalProposal?.goalId === activeGoal?.goalId && this.heldGoalProposal?.revision === activeGoal?.revision;
6237
+ if (activeGoal?.status === "active" && heldGoalMatches) {
6238
+ for (const queued of this.goalQueue.splice(0)) {
6239
+ queued.controller.abort(NEW_PROMPT_ABORT_REASON);
6240
+ await runtime.releaseTurn(queued.turnKey, { requeue: false });
6241
+ }
6242
+ await this.messageEmitter.emitAgentMessage(
6243
+ `Automatic Goal execution is still held. ${GOAL_HELD_RECOVERY_COMMANDS}`
6244
+ );
6245
+ } else if (activeGoal?.status === "active") {
6172
6246
  reservedGoalRuntime = runtime;
6173
6247
  reservedGoalTurnKey = `goal-user:${randomUUID()}`;
6174
6248
  runtime.beginTurn(reservedGoalTurnKey);
@@ -6184,6 +6258,14 @@ var Session = class {
6184
6258
  this.pendingPrompt?.abort(NEW_PROMPT_ABORT_REASON);
6185
6259
  const pendingSend = goalTurn?.controller ?? new AbortController();
6186
6260
  if (turnRecording) turnRecording.abortController = pendingSend;
6261
+ const recordCancellation = /* @__PURE__ */ __name(() => {
6262
+ if (turnRecording && pendingSend.signal.reason === USER_CANCEL_ABORT_REASON) {
6263
+ turnRecording.cancelledAt ??= Date.now();
6264
+ }
6265
+ }, "recordCancellation");
6266
+ pendingSend.signal.addEventListener("abort", recordCancellation, {
6267
+ once: true
6268
+ });
6187
6269
  const cancelPendingSend = /* @__PURE__ */ __name(() => pendingSend.abort(USER_CANCEL_ABORT_REASON), "cancelPendingSend");
6188
6270
  if (admissionCancellation) {
6189
6271
  admissionCancellation.addEventListener("abort", cancelPendingSend, {
@@ -6194,6 +6276,7 @@ var Session = class {
6194
6276
  this.pendingPrompt = pendingSend;
6195
6277
  const releasePendingSend = /* @__PURE__ */ __name(() => {
6196
6278
  admissionCancellation?.removeEventListener("abort", cancelPendingSend);
6279
+ pendingSend.signal.removeEventListener("abort", recordCancellation);
6197
6280
  if (this.pendingPrompt === pendingSend) {
6198
6281
  this.pendingPrompt = null;
6199
6282
  }
@@ -6346,6 +6429,11 @@ var Session = class {
6346
6429
  }
6347
6430
  } : result;
6348
6431
  promptResult = completedResult;
6432
+ const proposalTurn = responseCapture.goalProposalTurn;
6433
+ if (proposalTurn) {
6434
+ proposalTurn.completedNormally = completedResult.stopReason === "end_turn" && !pendingSend.signal.aborted && proposalTurn.settlementBlocked !== true;
6435
+ }
6436
+ await this.#settleGoalProposal(responseCapture);
6349
6437
  releasePendingSend();
6350
6438
  void this.#drainCronQueue();
6351
6439
  void this.#drainNotificationQueue();
@@ -6373,6 +6461,23 @@ var Session = class {
6373
6461
  rejectedByLoopProtection = isLoopDetectedTurnError(error);
6374
6462
  throw error;
6375
6463
  } finally {
6464
+ const proposalTurn = responseCapture.goalProposalTurn;
6465
+ if (proposalTurn) {
6466
+ this.config.takePendingGoalProposal(proposalTurn.turnKey);
6467
+ if (this.activeGoalProposalTurn === proposalTurn) {
6468
+ this.activeGoalProposalTurn = void 0;
6469
+ }
6470
+ }
6471
+ if (this.config.getGoalProposalHostSupported() && this.config.setGoalProposalTurnKey(void 0)) {
6472
+ try {
6473
+ await this.config.getLlmClient().setTools();
6474
+ } catch (error) {
6475
+ debugLogger6.warn(
6476
+ "Failed to refresh Goal proposal availability",
6477
+ error
6478
+ );
6479
+ }
6480
+ }
6376
6481
  const stillOwnsPendingPrompt = this.pendingPrompt === pendingSend;
6377
6482
  releasePendingSend();
6378
6483
  const shouldDrainAutomaticQueues = (
@@ -6404,6 +6509,29 @@ var Session = class {
6404
6509
  await this.#consumeLiveEndInstruction();
6405
6510
  }
6406
6511
  }
6512
+ #getRecoveryPlan(fullHistory) {
6513
+ const llmClient = this.config.getLlmClient();
6514
+ if (!llmClient || !llmClient.isInitialized()) {
6515
+ return void 0;
6516
+ }
6517
+ const chat = this.#getCurrentChat();
6518
+ if (this.config.getRestoreAskUserQuestion?.() === true && findRestorableAskUserQuestion(chat.peekLastHistoryEntry()) !== void 0) {
6519
+ return void 0;
6520
+ }
6521
+ const runtimeGaps = this.config.getSessionRestoreRuntime?.()?.historyGaps ?? (normalizeSessionIdForLookup(this.config.getSessionId()) === this.sessionId ? this.restoredHistoryGaps : void 0);
6522
+ return buildSessionRecoveryPlanFromApiHistory({
6523
+ sessionId: this.sessionId,
6524
+ apiHistory: fullHistory ? chat.getHistory() : chat.getHistoryTailShallow?.(TURN_INTERRUPTION_HISTORY_TAIL_COUNT) ?? chat.getHistoryTail(TURN_INTERRUPTION_HISTORY_TAIL_COUNT),
6525
+ historyGaps: runtimeGaps?.length ? runtimeGaps : this.config.getResumedSessionData?.()?.historyGaps
6526
+ });
6527
+ }
6528
+ getRecoveryStatus() {
6529
+ const recoveryPlan = this.#getRecoveryPlan(false);
6530
+ return {
6531
+ kind: recoveryPlan?.kind ?? "clean",
6532
+ canContinue: recoveryPlan?.canContinue === true && !(this.pendingPrompt && !this.pendingPrompt.signal.aborted)
6533
+ };
6534
+ }
6407
6535
  /**
6408
6536
  * Classify whether an unfinished previous turn can be resumed — an
6409
6537
  * interrupted prompt (the model never answered) or a turn left with dangling
@@ -6418,26 +6546,11 @@ var Session = class {
6418
6546
  * authoritatively. Powers `qwen/control/session/continue`.
6419
6547
  */
6420
6548
  async continueLastTurn() {
6421
- const llmClient = this.config.getLlmClient();
6422
- if (!llmClient || !llmClient.isInitialized()) {
6423
- return { accepted: false, interruption: "none" };
6424
- }
6425
- const chat = this.#getCurrentChat();
6426
- if (this.config.getRestoreAskUserQuestion?.() === true && findRestorableAskUserQuestion(chat.peekLastHistoryEntry()) !== void 0) {
6427
- return { accepted: false, interruption: "none" };
6428
- }
6429
- const recoveryPlan = buildSessionRecoveryPlanFromApiHistory({
6430
- sessionId: this.sessionId,
6431
- apiHistory: chat.getHistoryTailShallow?.(TURN_INTERRUPTION_HISTORY_TAIL_COUNT) ?? chat.getHistoryTail(TURN_INTERRUPTION_HISTORY_TAIL_COUNT)
6432
- });
6433
- if (!recoveryPlan.continuation) {
6434
- return { accepted: false, interruption: "none" };
6435
- }
6436
- const interruption = recoveryPlan.kind === "interrupted_prompt" ? "interrupted_prompt" : "interrupted_turn";
6437
- if (this.pendingPrompt && !this.pendingPrompt.signal.aborted) {
6438
- return { accepted: false, interruption };
6439
- }
6440
- return { accepted: true, interruption };
6549
+ const recovery = this.getRecoveryStatus();
6550
+ return {
6551
+ accepted: recovery.canContinue,
6552
+ interruption: recovery.kind === "interrupted_prompt" || recovery.kind === "interrupted_turn" ? recovery.kind : "none"
6553
+ };
6441
6554
  }
6442
6555
  /**
6443
6556
  * Generate a server-side follow-up suggestion for the just-completed
@@ -6554,6 +6667,70 @@ var Session = class {
6554
6667
  ), "execute");
6555
6668
  return goalTurn ? goalTurnContext.run(goalTurn.permit, execute) : goalTurnContext.exit(execute);
6556
6669
  }
6670
+ async #settleGoalProposal(capture) {
6671
+ const turn = capture.goalProposalTurn;
6672
+ if (!turn) return;
6673
+ const proposal = this.config.takePendingGoalProposal(turn.turnKey);
6674
+ if (!proposal) return;
6675
+ const ownsTurn = /* @__PURE__ */ __name(() => turn.completedNormally && !turn.controller.signal.aborted && this.pendingPrompt === turn.controller && this.activeGoalProposalTurn === turn && !this.disposed && !this.closing, "ownsTurn");
6676
+ if (!ownsTurn()) {
6677
+ if (!this.disposed && !this.closing) {
6678
+ await this.messageEmitter.emitAgentMessage(
6679
+ formatProposeGoalRecoveryNotStarted(proposal.objective)
6680
+ );
6681
+ }
6682
+ return;
6683
+ }
6684
+ try {
6685
+ const runtime = await this.config.getGoalRuntimeReady();
6686
+ if (!ownsTurn()) {
6687
+ if (!this.disposed && !this.closing) {
6688
+ await this.messageEmitter.emitAgentMessage(
6689
+ formatProposeGoalRecoveryNotStarted(proposal.objective)
6690
+ );
6691
+ }
6692
+ return;
6693
+ }
6694
+ const result = await applyPendingGoalProposal(runtime, proposal);
6695
+ if (result.applied && (!ownsTurn() || proposal.approvalSignal?.aborted)) {
6696
+ try {
6697
+ await runtime.dispatch({
6698
+ action: "pause",
6699
+ expectedGoalId: result.goal.goalId,
6700
+ expectedRevision: result.goal.revision,
6701
+ reason: this.closing || this.disposed ? GOAL_PAUSE_REASON_SESSION_DISPOSED : GOAL_PAUSE_REASON_USER_INTERRUPT
6702
+ });
6703
+ } catch (error) {
6704
+ const current = runtime.getSnapshot().goal;
6705
+ if (current?.goalId === result.goal.goalId && current.revision === result.goal.revision && current.status === "active") {
6706
+ this.heldGoalProposal = {
6707
+ goalId: current.goalId,
6708
+ revision: current.revision
6709
+ };
6710
+ debugLogger6.warn(
6711
+ "Failed to pause the cancelled Goal proposal",
6712
+ error
6713
+ );
6714
+ await this.messageEmitter.emitAgentMessage(
6715
+ `The Goal was created, but its cancellation could not be saved. Automatic execution is held in this session. ${GOAL_HELD_RECOVERY_COMMANDS}`
6716
+ );
6717
+ }
6718
+ }
6719
+ } else if (!result.applied) {
6720
+ debugLogger6.debug(
6721
+ `Dropping an approved Goal proposal: ${result.reason}`
6722
+ );
6723
+ await this.messageEmitter.emitAgentMessage(
6724
+ result.kind === "changed" ? result.reason : formatProposeGoalRecoveryFailed(proposal.objective)
6725
+ );
6726
+ }
6727
+ } catch (error) {
6728
+ debugLogger6.warn("Failed to apply an approved Goal proposal", error);
6729
+ await this.messageEmitter.emitAgentMessage(
6730
+ formatProposeGoalRecoveryFailed(proposal.objective)
6731
+ );
6732
+ }
6733
+ }
6557
6734
  async #executePromptInner(params, pendingSend, responseCapture, modelPrompt, rejectOnLoopDetected = false, goalTurn, channelTurn = false) {
6558
6735
  let managedMemoryRecallStarted = false;
6559
6736
  return Storage.runWithRuntimeBaseDir(
@@ -6566,6 +6743,19 @@ var Session = class {
6566
6743
  }
6567
6744
  this.turn += 1;
6568
6745
  const promptId = this.config.getSessionId() + "########" + this.turn;
6746
+ if (!goalTurn && !channelTurn && params._meta?.["qwen.goalProposalApproval"] === true) {
6747
+ responseCapture.goalProposalTurn = {
6748
+ turnKey: promptId,
6749
+ controller: pendingSend,
6750
+ completedNormally: false
6751
+ };
6752
+ this.activeGoalProposalTurn = responseCapture.goalProposalTurn;
6753
+ }
6754
+ if (this.config.getGoalProposalHostSupported() && this.config.setGoalProposalTurnKey(
6755
+ responseCapture.goalProposalTurn?.turnKey
6756
+ )) {
6757
+ await this.config.getLlmClient().setTools();
6758
+ }
6569
6759
  const daemonPromptId = getInvocationContext()?.promptId;
6570
6760
  const promptMetadata = params._meta;
6571
6761
  const continuesCurrentWorkChain = params.retry === true || promptMetadata?.[DAEMON_RETRY_META_KEY] === true || promptMetadata?.[DAEMON_CONTINUE_META_KEY] === true || promptMetadata?.[DAEMON_RESTORE_ASK_USER_QUESTION_META_KEY] === true;
@@ -6583,6 +6773,8 @@ var Session = class {
6583
6773
  const promptText = params.prompt.filter((block) => block.type === "text").map((block) => block.type === "text" ? block.text : "").join(" ");
6584
6774
  const promptDisplayTextValue = promptMetadata?.[DAEMON_PROMPT_DISPLAY_TEXT_META_KEY];
6585
6775
  const promptDisplayText = typeof promptDisplayTextValue === "string" ? promptDisplayTextValue : void 0;
6776
+ const declaredSubmission = promptMetadata?.[DAEMON_SUBMITTED_PROMPT_META_KEY];
6777
+ const submittedPrompt = typeof declaredSubmission === "string" ? declaredSubmission : "";
6586
6778
  const modelPromptBlocks = modelPrompt === void 0 ? params.prompt : [{ type: "text", text: modelPrompt }];
6587
6779
  logUserPrompt(
6588
6780
  this.config,
@@ -6626,11 +6818,8 @@ var Session = class {
6626
6818
  goalTurn.permit
6627
6819
  );
6628
6820
  } else if (isContinue) {
6629
- const recoveryPlan = buildSessionRecoveryPlanFromApiHistory({
6630
- sessionId: this.sessionId,
6631
- apiHistory: this.#getCurrentChat().getHistory()
6632
- });
6633
- if (!recoveryPlan.continuation) {
6821
+ const recoveryPlan = this.#getRecoveryPlan(true);
6822
+ if (!recoveryPlan?.continuation) {
6634
6823
  debugLogger6.warn(
6635
6824
  `[Session] continue ${promptId}: no interrupted turn on re-detection, nothing to continue`
6636
6825
  );
@@ -6765,13 +6954,15 @@ var Session = class {
6765
6954
  const messageBus = this.config.getMessageBus?.();
6766
6955
  const isRuntimeContinuation = goalTurn?.origin === "runtime";
6767
6956
  const isFreshUserTurn = !isRetry && !isContinue && !isRestoreAskUserQuestion && !isRuntimeContinuation;
6957
+ const isUserSubmissionTurn = isFreshUserTurn && !channelTurn;
6768
6958
  if (!isContinue && !isRestoreAskUserQuestion && !isRuntimeContinuation && hooksEnabled && messageBus && this.config.hasHooksForEvent?.("UserPromptSubmit")) {
6769
6959
  const response = await messageBus.request(
6770
6960
  {
6771
6961
  type: "hook-execution-request" /* HOOK_EXECUTION_REQUEST */,
6772
6962
  eventName: "UserPromptSubmit",
6773
6963
  input: {
6774
- prompt: promptText
6964
+ prompt: promptText,
6965
+ ...isUserSubmissionTurn && submittedPrompt.trim().length > 0 ? { submitted_prompt: submittedPrompt } : {}
6775
6966
  },
6776
6967
  signal: pendingSend.signal
6777
6968
  },
@@ -6800,9 +6991,14 @@ var Session = class {
6800
6991
  if (!continuesCurrentWorkChain && !this.todoStopGuard.enabled) {
6801
6992
  this.#resetTodoStopGuardBackgroundLineage();
6802
6993
  }
6994
+ const continuesTodoWorkChain = continuesCurrentWorkChain || this.activeTodoWorkChainPromptId !== void 0 && this.config.getActiveTodoReminder(
6995
+ this.activeTodoWorkChainPromptId
6996
+ ) !== void 0 && this.config.getActiveTodoWorkChainOwner(
6997
+ this.activeTodoWorkChainPromptId
6998
+ ) === this.config.getActiveTodoPlanWriterOwner();
6803
6999
  this.config.startActiveTodoWorkChain(
6804
7000
  promptId,
6805
- continuesCurrentWorkChain ? this.activeTodoWorkChainPromptId : void 0
7001
+ continuesTodoWorkChain ? this.activeTodoWorkChainPromptId : void 0
6806
7002
  );
6807
7003
  this.activeTodoWorkChainPromptId = promptId;
6808
7004
  if (!isRestoreAskUserQuestion) {
@@ -6858,7 +7054,8 @@ ${this.pendingRecoveredAgentsNotice}
6858
7054
  parts = insertAfterFunctionResponses(parts, [noticePart]);
6859
7055
  this.pendingRecoveredAgentsNotice = null;
6860
7056
  }
6861
- const activeTodoReminder = isRestoreAskUserQuestion ? void 0 : this.config.takeActiveTodoReminder(promptId, true);
7057
+ const isMachineContinuation = isRetry || isContinue || isRuntimeContinuation;
7058
+ const activeTodoReminder = isRestoreAskUserQuestion || !isMachineContinuation ? void 0 : this.config.takeActiveTodoReminder(promptId, true);
6862
7059
  if (activeTodoReminder && !parts.some((part) => part.text === activeTodoReminder)) {
6863
7060
  parts = insertAfterFunctionResponses(parts, [
6864
7061
  { text: activeTodoReminder }
@@ -7286,6 +7483,7 @@ ${this.pendingRecoveredAgentsNotice}
7286
7483
  async #handleStopHookLoop(pendingSend, promptId, hooksEnabled, messageBus, allowExternalHooks = true, modelOverride, responseCapture, rejectOnLoopDetected = false, goalTurn, channelTurn = false) {
7287
7484
  const stopHookBlockingCap = this.config.getStopHookBlockingCap();
7288
7485
  let stopHookIterationCount = 0;
7486
+ let stopHookForcedTurn = false;
7289
7487
  let stopHookReasons = [];
7290
7488
  const onFullTurnModel = /* @__PURE__ */ __name((model) => {
7291
7489
  if (modelOverride === model) {
@@ -7297,6 +7495,11 @@ ${this.pendingRecoveredAgentsNotice}
7297
7495
  modelOverride = model;
7298
7496
  return true;
7299
7497
  }, "onFullTurnModel");
7498
+ const blockGoalProposalSettlement = /* @__PURE__ */ __name(() => {
7499
+ if (responseCapture?.goalProposalTurn) {
7500
+ responseCapture.goalProposalTurn.settlementBlocked = true;
7501
+ }
7502
+ }, "blockGoalProposalSettlement");
7300
7503
  let midTurnContinuationCount = 0;
7301
7504
  while (true) {
7302
7505
  if (this.pendingPrompt && this.pendingPrompt !== pendingSend) {
@@ -7310,6 +7513,7 @@ ${this.pendingRecoveredAgentsNotice}
7310
7513
  this.#clearTodoStopGuardTrustAndDrainAutomaticQueues();
7311
7514
  }
7312
7515
  if (this.todoStopGuardQueuedPromptPriority) {
7516
+ blockGoalProposalSettlement();
7313
7517
  return { stopReason: "end_turn" };
7314
7518
  }
7315
7519
  if (this.todoStopGuard.needsStopInspection) {
@@ -7323,6 +7527,7 @@ ${this.pendingRecoveredAgentsNotice}
7323
7527
  pendingSend.signal
7324
7528
  );
7325
7529
  if (claim === "queued") {
7530
+ blockGoalProposalSettlement();
7326
7531
  this.#preserveUnsentMessageHistory(
7327
7532
  { role: "user", parts: drained.parts },
7328
7533
  true
@@ -7333,7 +7538,11 @@ ${this.pendingRecoveredAgentsNotice}
7333
7538
  this.todoStopGuard.blockUntilOrdinaryPromptStarts();
7334
7539
  }
7335
7540
  }
7541
+ stopHookForcedTurn = false;
7542
+ stopHookIterationCount = 0;
7543
+ stopHookReasons = [];
7336
7544
  this.todoStopGuard.acceptMidTurnUserInput();
7545
+ blockGoalProposalSettlement();
7337
7546
  const continuation2 = await this.#runStopContinuation(
7338
7547
  pendingSend,
7339
7548
  promptId + "_mid_turn_" + ++midTurnContinuationCount,
@@ -7361,6 +7570,7 @@ ${this.pendingRecoveredAgentsNotice}
7361
7570
  pendingSend.signal
7362
7571
  );
7363
7572
  if (claim === "queued") {
7573
+ blockGoalProposalSettlement();
7364
7574
  return { stopReason: "end_turn" };
7365
7575
  }
7366
7576
  if (claim === "unavailable") {
@@ -7383,7 +7593,7 @@ ${this.pendingRecoveredAgentsNotice}
7383
7593
  type: "hook-execution-request" /* HOOK_EXECUTION_REQUEST */,
7384
7594
  eventName: "Stop",
7385
7595
  input: {
7386
- stop_hook_active: true,
7596
+ stop_hook_active: stopHookForcedTurn,
7387
7597
  last_assistant_message: responseText,
7388
7598
  ...contextUsage
7389
7599
  },
@@ -7410,6 +7620,7 @@ ${this.pendingRecoveredAgentsNotice}
7410
7620
  pendingSend.signal
7411
7621
  );
7412
7622
  if (claim === "queued") {
7623
+ blockGoalProposalSettlement();
7413
7624
  this.#preserveUnsentMessageHistory(
7414
7625
  { role: "user", parts: drained.parts },
7415
7626
  true
@@ -7420,7 +7631,11 @@ ${this.pendingRecoveredAgentsNotice}
7420
7631
  this.todoStopGuard.blockUntilOrdinaryPromptStarts();
7421
7632
  }
7422
7633
  }
7634
+ stopHookForcedTurn = false;
7635
+ stopHookIterationCount = 0;
7636
+ stopHookReasons = [];
7423
7637
  this.todoStopGuard.acceptMidTurnUserInput();
7638
+ blockGoalProposalSettlement();
7424
7639
  const continuation2 = await this.#runStopContinuation(
7425
7640
  pendingSend,
7426
7641
  promptId + "_mid_turn_" + ++midTurnContinuationCount,
@@ -7448,6 +7663,7 @@ ${this.pendingRecoveredAgentsNotice}
7448
7663
  pendingSend.signal
7449
7664
  );
7450
7665
  if (claim === "queued") {
7666
+ blockGoalProposalSettlement();
7451
7667
  return { stopReason: "end_turn" };
7452
7668
  }
7453
7669
  if (claim === "unavailable") {
@@ -7477,7 +7693,10 @@ ${this.pendingRecoveredAgentsNotice}
7477
7693
  const guardContinuation = guardDecision?.kind === "continue" ? guardDecision : null;
7478
7694
  if (guardDecision?.kind === "exhausted") {
7479
7695
  await this.#emitTodoStopGuardExhausted(guardDecision);
7480
- if (!externalReason) return { stopReason: "end_turn" };
7696
+ if (!externalReason) {
7697
+ blockGoalProposalSettlement();
7698
+ return { stopReason: "end_turn" };
7699
+ }
7481
7700
  }
7482
7701
  if (externalReason && stopHookIterationCount >= stopHookBlockingCap) {
7483
7702
  const warning = formatStopHookBlockingCapWarning(
@@ -7492,6 +7711,7 @@ ${this.pendingRecoveredAgentsNotice}
7492
7711
  await this.#pauseGoalForStopHookCap();
7493
7712
  }
7494
7713
  this.todoStopGuard.suspend();
7714
+ blockGoalProposalSettlement();
7495
7715
  await this.messageEmitter.emitAgentMessage(warning);
7496
7716
  debugLogger6.warn(warning);
7497
7717
  return { stopReason: "end_turn" };
@@ -7514,6 +7734,7 @@ ${this.pendingRecoveredAgentsNotice}
7514
7734
  stopHookCount
7515
7735
  );
7516
7736
  }
7737
+ stopHookForcedTurn = Boolean(externalReason);
7517
7738
  const continuation = await this.#runStopContinuation(
7518
7739
  pendingSend,
7519
7740
  continuationPromptId,
@@ -7538,6 +7759,9 @@ ${this.pendingRecoveredAgentsNotice}
7538
7759
  ...channelTurn ? { channelTurn: true } : {}
7539
7760
  }
7540
7761
  );
7762
+ if (continuation.supersededAutomaticContinuation) {
7763
+ stopHookForcedTurn = false;
7764
+ }
7541
7765
  if (continuation.supersededAutomaticContinuation && externalReason) {
7542
7766
  stopHookIterationCount--;
7543
7767
  stopHookReasons = stopHookReasons.slice(0, -1);
@@ -7564,6 +7788,12 @@ ${this.pendingRecoveredAgentsNotice}
7564
7788
  true
7565
7789
  );
7566
7790
  }, "preservePendingMessage");
7791
+ const blockGoalProposalSettlement = /* @__PURE__ */ __name(() => {
7792
+ const proposalTurn = options.responseCapture?.goalProposalTurn;
7793
+ if (proposalTurn) {
7794
+ proposalTurn.settlementBlocked = true;
7795
+ }
7796
+ }, "blockGoalProposalSettlement");
7567
7797
  while (nextMessage !== null) {
7568
7798
  if (this.pendingPrompt && this.pendingPrompt !== pendingSend) {
7569
7799
  preservePendingMessage(nextMessage);
@@ -7670,6 +7900,7 @@ ${this.pendingRecoveredAgentsNotice}
7670
7900
  nextGuardContinuation = void 0;
7671
7901
  if (!options.externalParts) {
7672
7902
  preserveGuardOnSkippedSend = true;
7903
+ blockGoalProposalSettlement();
7673
7904
  return { kind: "stop", stopReason: "end_turn" };
7674
7905
  }
7675
7906
  if (!initialSend && nextMessage) {
@@ -7688,6 +7919,7 @@ ${this.pendingRecoveredAgentsNotice}
7688
7919
  guardForThisSend = void 0;
7689
7920
  nextGuardContinuation = void 0;
7690
7921
  preserveGuardOnSkippedSend = true;
7922
+ blockGoalProposalSettlement();
7691
7923
  if (initialSend) {
7692
7924
  supersededAutomaticContinuation = true;
7693
7925
  }
@@ -7745,6 +7977,7 @@ ${this.pendingRecoveredAgentsNotice}
7745
7977
  guardForThisSend = void 0;
7746
7978
  nextGuardContinuation = void 0;
7747
7979
  preserveGuardOnSkippedSend = true;
7980
+ blockGoalProposalSettlement();
7748
7981
  if (initialSend) {
7749
7982
  supersededAutomaticContinuation = true;
7750
7983
  }
@@ -8227,8 +8460,21 @@ ${this.pendingRecoveredAgentsNotice}
8227
8460
  ...recordingService !== void 0 ? { recordingService } : {}
8228
8461
  };
8229
8462
  }
8230
- #settleTurnRecording(state, recording, response, error) {
8463
+ async #settleTurnRecording(state, recording, response, error) {
8231
8464
  if (recording === null) return;
8465
+ const cancelledAt = state === "cancelled" ? recording.cancelledAt : void 0;
8466
+ if (cancelledAt !== void 0 && response) {
8467
+ response._meta = {
8468
+ ...response._meta,
8469
+ "qwen.promptCancelled": {
8470
+ cancelledAt,
8471
+ elapsedMs: Math.max(
8472
+ 0,
8473
+ cancelledAt - (recording.startedAt ?? cancelledAt)
8474
+ )
8475
+ }
8476
+ };
8477
+ }
8232
8478
  const finalAnswer = truncateTurnText(recording.finalAnswer.finalText);
8233
8479
  const stopReason = response?.stopReason ?? (state === "cancelled" ? "cancelled" : void 0);
8234
8480
  const payload = {
@@ -8237,6 +8483,7 @@ ${this.pendingRecoveredAgentsNotice}
8237
8483
  ...stopReason !== void 0 ? { stopReason } : {},
8238
8484
  ...state === "error" ? { error: normalizeTurnResultError(error) } : {},
8239
8485
  ...recording.startedAt !== void 0 ? { startedAt: recording.startedAt } : {},
8486
+ ...cancelledAt !== void 0 ? { cancelledAt } : {},
8240
8487
  endedAt: Date.now(),
8241
8488
  promptText: recording.promptText,
8242
8489
  ...recording.promptTextTruncated ? { promptTextTruncated: true } : {},
@@ -8249,6 +8496,9 @@ ${this.pendingRecoveredAgentsNotice}
8249
8496
  };
8250
8497
  try {
8251
8498
  recording.recordingService?.recordTurnResult(payload);
8499
+ if (cancelledAt !== void 0) {
8500
+ await recording.recordingService?.flush();
8501
+ }
8252
8502
  } catch (recordError) {
8253
8503
  debugLogger6.warn(
8254
8504
  `Failed to record turn result: ${this.#formatError(recordError)}`
@@ -8556,7 +8806,10 @@ ${this.pendingRecoveredAgentsNotice}
8556
8806
  if (hadMidTurnUserInput) {
8557
8807
  this.todoStopGuard.acceptMidTurnUserInput();
8558
8808
  }
8559
- const activeTodoReminder = this.config.takeActiveTodoReminder(promptId);
8809
+ const carriesAgentToolResult = toolRun.parts.some(
8810
+ (part) => canonicalToolName(part.functionResponse?.name ?? "") === ToolNames.AGENT
8811
+ );
8812
+ const activeTodoReminder = carriesAgentToolResult ? this.config.takeActiveTodoReminder(promptId, true) : this.config.takeActiveTodoReminder(promptId);
8560
8813
  if (abortSignal.aborted) {
8561
8814
  return {
8562
8815
  message: {
@@ -8922,6 +9175,10 @@ ${this.pendingRecoveredAgentsNotice}
8922
9175
  * timed-out drain is still recorded exactly once.
8923
9176
  */
8924
9177
  async #buildMidTurnParts(messages, abortSignal, options = {}) {
9178
+ const proposalTurn = this.activeGoalProposalTurn;
9179
+ if (messages.length > 0 && proposalTurn?.controller.signal === abortSignal) {
9180
+ proposalTurn.settlementBlocked = true;
9181
+ }
8925
9182
  const parts = [];
8926
9183
  for (const message of messages) {
8927
9184
  const displayText = message.kind === "text" ? message.message : message.displayText;
@@ -9043,6 +9300,29 @@ ${this.pendingRecoveredAgentsNotice}
9043
9300
  );
9044
9301
  });
9045
9302
  }, "record");
9303
+ const restoreOneShot = /* @__PURE__ */ __name(async () => {
9304
+ if (job.recurring !== false || !job.id) return;
9305
+ try {
9306
+ const restored = await scheduler.restoreConsumedOneShot(job.id);
9307
+ if (!restored) {
9308
+ debugLogger6.warn(
9309
+ `Scheduled task ${taskId} could not find its consumed one-shot to restore`
9310
+ );
9311
+ }
9312
+ } catch (error) {
9313
+ debugLogger6.warn(
9314
+ `Scheduled task ${taskId} could not restore its unexecuted one-shot: ${error instanceof Error ? error.message : String(error)}`
9315
+ );
9316
+ }
9317
+ }, "restoreOneShot");
9318
+ if (job.modelServiceId !== void 0 && !isValidCronTaskRoutingId(job.modelServiceId) || job.groupId !== void 0 && !isValidCronTaskRoutingId(job.groupId)) {
9319
+ debugLogger6.warn(
9320
+ `Scheduled task ${taskId} has invalid model or group routing; it was not dispatched`
9321
+ );
9322
+ await record({ dispatchFailed: true });
9323
+ await restoreOneShot();
9324
+ return;
9325
+ }
9046
9326
  let sessionId;
9047
9327
  try {
9048
9328
  const response = await this.client.extMethod(
@@ -9068,6 +9348,8 @@ ${this.pendingRecoveredAgentsNotice}
9068
9348
  sourceType: SCHEDULED_TASK_RUN_SOURCE_TYPE,
9069
9349
  sourceId: scheduledTaskRunSourceId(job.id)
9070
9350
  } : {},
9351
+ ...job.modelServiceId ? { model: job.modelServiceId } : {},
9352
+ ...job.groupId ? { groupId: job.groupId } : {},
9071
9353
  callerSessionId: this.sessionId
9072
9354
  }
9073
9355
  );
@@ -9077,10 +9359,18 @@ ${this.pendingRecoveredAgentsNotice}
9077
9359
  }
9078
9360
  sessionId = responseSessionId;
9079
9361
  } catch (error) {
9362
+ const requiresFreshSessionRouting = job.modelServiceId !== void 0 || job.groupId !== void 0;
9363
+ const errorMessage = error instanceof Error ? error.message : typeof error === "object" && error !== null && typeof error["message"] === "string" ? error["message"] : String(error);
9080
9364
  debugLogger6.warn(
9081
- `Scheduled task ${taskId} could not create a fresh session, running it in the task session instead: ${error instanceof Error ? error.message : String(error)}`
9365
+ requiresFreshSessionRouting ? `Scheduled task ${taskId} could not create a fresh session with its requested routing: ${errorMessage}` : `Scheduled task ${taskId} could not create a fresh session, running it in the task session instead: ${errorMessage}`
9082
9366
  );
9083
- await record({ sessionId: this.sessionId, dispatchFailed: true });
9367
+ await record(
9368
+ requiresFreshSessionRouting ? { dispatchFailed: true } : { sessionId: this.sessionId, dispatchFailed: true }
9369
+ );
9370
+ if (requiresFreshSessionRouting) {
9371
+ await restoreOneShot();
9372
+ return;
9373
+ }
9084
9374
  this.#enqueueCronPrompt({
9085
9375
  prompt: job.prompt,
9086
9376
  source: "cron",
@@ -10685,50 +10975,32 @@ ${this.pendingRecoveredAgentsNotice}
10685
10975
  ])
10686
10976
  );
10687
10977
  const pendingToolResultRecords = [];
10978
+ const pendingNestedToolResultRecords = [];
10688
10979
  let toolResultRecordSequence = 0;
10689
10980
  const queueToolResultRecord = /* @__PURE__ */ __name((fc, record) => {
10690
- pendingToolResultRecords.push({
10981
+ const ordinal = dedupedFunctionCalls.indexOf(fc);
10982
+ const target = ordinal === -1 ? pendingNestedToolResultRecords : pendingToolResultRecords;
10983
+ target.push({
10691
10984
  ...record,
10692
- ordinal: dedupedFunctionCalls.indexOf(fc),
10985
+ ordinal: Math.max(0, ordinal),
10693
10986
  sequence: toolResultRecordSequence++
10694
10987
  });
10695
10988
  }, "queueToolResultRecord");
10696
10989
  let batchTerminatesTurn = false;
10697
- const finalizeRunToolResult = /* @__PURE__ */ __name(async (result) => {
10698
- const orderedRecords = [...pendingToolResultRecords].sort(
10699
- (left, right) => left.ordinal - right.ordinal || left.sequence - right.sequence
10700
- );
10701
- const repeatedToolFailureBatch = {
10702
- complete: orderedRecords.length === dedupedFunctionCalls.length && new Set(orderedRecords.map((record) => record.ordinal)).size === dedupedFunctionCalls.length,
10703
- observations: orderedRecords.map((record) => ({
10704
- callId: record.callId,
10705
- policyToolName: record.policyToolName,
10706
- toolType: record.toolType,
10707
- terminalStatus: record.metadata.status,
10708
- executionStatus: record.metadata.executionStatus,
10709
- executionErrorType: record.executionErrorType,
10710
- providerDuplicate: record.providerDuplicate
10711
- }))
10712
- };
10713
- if (orderedRecords.length === 0) {
10714
- return {
10715
- ...result,
10716
- repeatedToolFailureBatch,
10717
- ...batchTerminatesTurn ? { terminateTurn: true } : {}
10718
- };
10719
- }
10990
+ const finalizeAndRecord = /* @__PURE__ */ __name(async (records) => {
10991
+ if (records.length === 0) return [];
10720
10992
  const finalized = await finalizeToolResponses(
10721
10993
  this.config,
10722
- orderedRecords.map((record) => ({
10994
+ records.map((record) => ({
10723
10995
  callId: record.callId,
10724
10996
  toolName: record.toolName,
10725
10997
  responseParts: record.responseParts,
10726
10998
  persistedOutputFiles: record.persistedOutputFiles,
10727
10999
  artifacts: record.metadata.artifacts
10728
11000
  })),
10729
- new Map(orderedRecords.map((record) => [record.callId, promptId]))
11001
+ new Map(records.map((record) => [record.callId, promptId]))
10730
11002
  );
10731
- orderedRecords.forEach((record, index) => {
11003
+ records.forEach((record, index) => {
10732
11004
  if (record.skipPersistence === true || this.#shouldSkipRestoredAskUserQuestionPersistence(record.callId)) {
10733
11005
  return;
10734
11006
  }
@@ -10743,6 +11015,43 @@ ${this.pendingRecoveredAgentsNotice}
10743
11015
  ...goalProvenance ? [goalProvenance] : []
10744
11016
  );
10745
11017
  });
11018
+ return finalized;
11019
+ }, "finalizeAndRecord");
11020
+ const finalizeNestedToolResult = /* @__PURE__ */ __name(async (result) => {
11021
+ const records = pendingNestedToolResultRecords.splice(0);
11022
+ if (records.length === 0) return result.parts;
11023
+ const finalized = await finalizeAndRecord(records);
11024
+ return finalized.flatMap((entry) => entry.responseParts);
11025
+ }, "finalizeNestedToolResult");
11026
+ const finalizeRunToolResult = /* @__PURE__ */ __name(async (result) => {
11027
+ await finalizeAndRecord(
11028
+ [...pendingNestedToolResultRecords].sort(
11029
+ (left, right) => left.sequence - right.sequence
11030
+ )
11031
+ );
11032
+ const orderedRecords = [...pendingToolResultRecords].sort(
11033
+ (left, right) => left.ordinal - right.ordinal || left.sequence - right.sequence
11034
+ );
11035
+ const repeatedToolFailureBatch = {
11036
+ complete: orderedRecords.length === dedupedFunctionCalls.length && new Set(orderedRecords.map((record) => record.ordinal)).size === dedupedFunctionCalls.length,
11037
+ observations: orderedRecords.map((record) => ({
11038
+ callId: record.callId,
11039
+ policyToolName: record.policyToolName,
11040
+ toolType: record.toolType,
11041
+ terminalStatus: record.metadata.status,
11042
+ executionStatus: record.metadata.executionStatus,
11043
+ executionErrorType: record.executionErrorType,
11044
+ providerDuplicate: record.providerDuplicate
11045
+ }))
11046
+ };
11047
+ if (orderedRecords.length === 0) {
11048
+ return {
11049
+ ...result,
11050
+ repeatedToolFailureBatch,
11051
+ ...batchTerminatesTurn ? { terminateTurn: true } : {}
11052
+ };
11053
+ }
11054
+ const finalized = await finalizeAndRecord(orderedRecords);
10746
11055
  return {
10747
11056
  ...result,
10748
11057
  parts: finalized.flatMap((entry) => entry.responseParts),
@@ -11057,7 +11366,9 @@ ${this.pendingRecoveredAgentsNotice}
11057
11366
  recordSkippedToolCall,
11058
11367
  queueToolResultRecord,
11059
11368
  executionCallIds.get(calls[idx]),
11060
- onFullTurnModel
11369
+ onFullTurnModel,
11370
+ void 0,
11371
+ finalizeNestedToolResult
11061
11372
  ).then((r) => {
11062
11373
  results[idx] = r;
11063
11374
  if (r.loopDetected && executing.size > 1 && !warnedWaitingForInFlight) {
@@ -11186,7 +11497,9 @@ ${this.pendingRecoveredAgentsNotice}
11186
11497
  recordSkippedToolCall,
11187
11498
  queueToolResultRecord,
11188
11499
  executionCallIds.get(fc),
11189
- onFullTurnModel
11500
+ onFullTurnModel,
11501
+ void 0,
11502
+ finalizeNestedToolResult
11190
11503
  );
11191
11504
  parts.push(...r.parts);
11192
11505
  collectMemoryWriteCandidates(r);
@@ -11263,13 +11576,15 @@ ${this.pendingRecoveredAgentsNotice}
11263
11576
  }
11264
11577
  return reminders;
11265
11578
  }
11266
- async runTool(abortSignal, promptId, fc, onStopAfterPermissionCancel, toolLoopState, recordSkippedToolCall, queueToolResultRecord, generatedCallId, onFullTurnModel) {
11579
+ async runTool(abortSignal, promptId, fc, onStopAfterPermissionCancel, toolLoopState, recordSkippedToolCall, queueToolResultRecord, generatedCallId, onFullTurnModel, codeModeContext, finalizeCodeModeToolResult) {
11267
11580
  const callId = fc.id ?? generatedCallId ?? `${fc.name}-${Date.now()}`;
11268
11581
  let args = fc.args ?? {};
11269
11582
  let executionStatus = "not_started";
11270
11583
  let executionErrorType;
11271
11584
  let executeReturned = false;
11272
11585
  let executeAttempted = false;
11586
+ let executionStartedAt;
11587
+ const elapsedExecutionMs = /* @__PURE__ */ __name(() => executionStartedAt === void 0 ? void 0 : Math.round(performance.now() - executionStartedAt), "elapsedExecutionMs");
11273
11588
  let producerObserved = false;
11274
11589
  let terminalStatus;
11275
11590
  let toolType = "native";
@@ -11317,6 +11632,10 @@ ${this.pendingRecoveredAgentsNotice}
11317
11632
  "event.name": "tool_call",
11318
11633
  "event.timestamp": (/* @__PURE__ */ new Date()).toISOString(),
11319
11634
  call_id: callId,
11635
+ ...codeModeContext ? {
11636
+ parent_call_id: codeModeContext.parentCallId,
11637
+ source: codeModeContext.source
11638
+ } : {},
11320
11639
  prompt_id: promptId,
11321
11640
  function_name: toolName2,
11322
11641
  function_args: args,
@@ -11463,6 +11782,19 @@ ${this.pendingRecoveredAgentsNotice}
11463
11782
  );
11464
11783
  }
11465
11784
  const toolName = fc.name;
11785
+ if (this.config.getToolMode?.() === ToolMode.CodeModeOnly && !isCodeModeToolCallAllowed(toolName, codeModeContext?.source ?? "model")) {
11786
+ return earlyErrorResponse(
11787
+ new Error(
11788
+ `Tool "${toolName}" is unavailable on this CodeModeOnly call surface.`
11789
+ ),
11790
+ toolName,
11791
+ {
11792
+ status: "error",
11793
+ errorType: "execution_denied" /* EXECUTION_DENIED */,
11794
+ executionStatus: "not_started"
11795
+ }
11796
+ );
11797
+ }
11466
11798
  const toolRegistry = this.config.getToolRegistry();
11467
11799
  const tool = toolRegistry.getTool(toolName);
11468
11800
  if (!tool) {
@@ -11498,7 +11830,11 @@ ${this.pendingRecoveredAgentsNotice}
11498
11830
  // (coreToolScheduler.ts) so pre-Phase-2 dashboards keyed off call_id keep
11499
11831
  // matching daemon/ACP tool spans during the migration window.
11500
11832
  call_id: callId,
11501
- tool_name: policyToolName
11833
+ tool_name: policyToolName,
11834
+ ...codeModeContext ? {
11835
+ "tool.parent_call_id": codeModeContext.parentCallId,
11836
+ "tool.source": codeModeContext.source
11837
+ } : {}
11502
11838
  },
11503
11839
  tool.description,
11504
11840
  promptId
@@ -11507,6 +11843,19 @@ ${this.pendingRecoveredAgentsNotice}
11507
11843
  return await runInToolSpanContext(toolSpan, async () => {
11508
11844
  const entryCancellation = cancelBeforeExecutionIfAborted(toolName);
11509
11845
  if (entryCancellation) return entryCancellation;
11846
+ if (policyToolName === ToolNames.PROPOSE_GOAL && (this.activeGoalProposalTurn?.turnKey !== promptId || this.activeGoalProposalTurn.controller.signal.aborted)) {
11847
+ return earlyErrorResponse(
11848
+ new Error(
11849
+ "The Goal was not set: this turn cannot own a Goal approval. Hand the user a `/goal set <objective>` line instead."
11850
+ ),
11851
+ toolName,
11852
+ {
11853
+ status: "error",
11854
+ errorType: "execution_denied" /* EXECUTION_DENIED */,
11855
+ executionStatus: "not_started"
11856
+ }
11857
+ );
11858
+ }
11510
11859
  const isTrustedLiveScreenContextTool = tool === this.liveScreenContextTool;
11511
11860
  const isTrustedLiveTaskTool = this.liveTaskTools.includes(
11512
11861
  tool
@@ -12483,12 +12832,85 @@ ${this.pendingRecoveredAgentsNotice}
12483
12832
  });
12484
12833
  executionStatus = "error";
12485
12834
  executeAttempted = true;
12835
+ executionStartedAt = performance.now();
12486
12836
  try {
12487
- toolResult = await invocation.execute(
12837
+ const execute = /* @__PURE__ */ __name(() => invocation.execute(
12488
12838
  activeToolAbortSignal,
12489
12839
  onToolProgress,
12490
12840
  this.config.getShellExecutionConfig()
12491
- );
12841
+ ), "execute");
12842
+ if (toolName !== ToolNames.EXEC) {
12843
+ toolResult = await execute();
12844
+ } else {
12845
+ let dispatchTail = Promise.resolve();
12846
+ const dispatch = /* @__PURE__ */ __name((nestedName, nestedArgs, nestedSignal, onResult) => {
12847
+ const next = dispatchTail.then(async () => {
12848
+ if (!isCodeModeToolCallAllowed(nestedName, "code_mode")) {
12849
+ throw new Error(
12850
+ `Tool "${nestedName}" is not callable from exec.`
12851
+ );
12852
+ }
12853
+ const nestedCallId = `${callId}:code:${++this.codeModeNestedSequence}`;
12854
+ const nested = await runWithoutToolCallRuntime(
12855
+ () => this.runTool(
12856
+ nestedSignal,
12857
+ promptId,
12858
+ {
12859
+ id: nestedCallId,
12860
+ name: nestedName,
12861
+ args: nestedArgs
12862
+ },
12863
+ onStopAfterPermissionCancel,
12864
+ toolLoopState,
12865
+ recordSkippedToolCall,
12866
+ queueToolResultRecord,
12867
+ nestedCallId,
12868
+ onFullTurnModel,
12869
+ { parentCallId: callId, source: "code_mode" }
12870
+ )
12871
+ );
12872
+ const nestedParts = finalizeCodeModeToolResult ? await finalizeCodeModeToolResult(nested) : nested.parts;
12873
+ const functionResponse = nestedParts.map((part) => part.functionResponse).find((part) => part?.id === nestedCallId);
12874
+ const response = functionResponse?.response;
12875
+ const nestedError = response?.["error"];
12876
+ onResult?.({
12877
+ callId: nestedCallId,
12878
+ responseParts: nestedParts,
12879
+ resultDisplay: void 0,
12880
+ error: nestedError === void 0 ? void 0 : new Error(String(nestedError)),
12881
+ errorType: void 0,
12882
+ ..."modelOverride" in nested ? { modelOverride: nested.modelOverride } : {},
12883
+ ...nested.terminateTurn ? { terminateTurn: true } : {}
12884
+ });
12885
+ if (nestedError !== void 0) {
12886
+ throw new Error(
12887
+ typeof nestedError === "string" ? nestedError : JSON.stringify(nestedError)
12888
+ );
12889
+ }
12890
+ const nestedOutput = response?.["output"] ?? response?.["content"] ?? "";
12891
+ const content = extractCodeModeImageContent(nestedParts);
12892
+ return {
12893
+ callId: nestedCallId,
12894
+ name: nestedName,
12895
+ status: "success",
12896
+ output: typeof nestedOutput === "string" ? nestedOutput : JSON.stringify(nestedOutput),
12897
+ ...content ? { content } : {}
12898
+ };
12899
+ });
12900
+ dispatchTail = next.then(
12901
+ () => void 0,
12902
+ () => void 0
12903
+ );
12904
+ return next;
12905
+ }, "dispatch");
12906
+ toolResult = await runWithToolCallRuntime(
12907
+ {
12908
+ parentCallId: callId,
12909
+ dispatch
12910
+ },
12911
+ execute
12912
+ );
12913
+ }
12492
12914
  executeReturned = true;
12493
12915
  try {
12494
12916
  settledArtifacts = toolResult.artifacts;
@@ -12602,7 +13024,8 @@ ${this.pendingRecoveredAgentsNotice}
12602
13024
  toolUseId,
12603
13025
  permissionMode,
12604
13026
  activeToolAbortSignal,
12605
- callId
13027
+ callId,
13028
+ elapsedExecutionMs()
12606
13029
  );
12607
13030
  if (activeToolAbortSignal.aborted) {
12608
13031
  return earlyErrorResponse(
@@ -12657,7 +13080,8 @@ ${this.pendingRecoveredAgentsNotice}
12657
13080
  isInterrupt,
12658
13081
  permissionMode,
12659
13082
  activeToolAbortSignal,
12660
- callId
13083
+ callId,
13084
+ elapsedExecutionMs()
12661
13085
  );
12662
13086
  if (failureHookResult.additionalContext) {
12663
13087
  debugLogger6.debug(
@@ -12752,6 +13176,10 @@ ${this.pendingRecoveredAgentsNotice}
12752
13176
  "event.name": "tool_call",
12753
13177
  "event.timestamp": (/* @__PURE__ */ new Date()).toISOString(),
12754
13178
  call_id: callId,
13179
+ ...codeModeContext ? {
13180
+ parent_call_id: codeModeContext.parentCallId,
13181
+ source: codeModeContext.source
13182
+ } : {},
12755
13183
  function_name: toolName,
12756
13184
  function_args: args,
12757
13185
  duration_ms: durationMs,
@@ -12810,8 +13238,9 @@ ${this.pendingRecoveredAgentsNotice}
12810
13238
  }
12811
13239
  return {
12812
13240
  parts: responseParts,
13241
+ ..."modelOverride" in toolResult && succeeded ? { modelOverride: toolResult.modelOverride } : {},
12813
13242
  stopAfterPermissionCancel: nestedPermissionCancelled,
12814
- ...toolResult.terminateTurn ? { terminateTurn: true } : {},
13243
+ ...toolResult.terminateTurn && succeeded ? { terminateTurn: true } : {},
12815
13244
  memoryWriteCandidates: status === "success" ? [
12816
13245
  {
12817
13246
  toolName,
@@ -12838,7 +13267,8 @@ ${this.pendingRecoveredAgentsNotice}
12838
13267
  isInterrupt,
12839
13268
  String(approvalMode),
12840
13269
  activeToolAbortSignal,
12841
- callId
13270
+ callId,
13271
+ elapsedExecutionMs()
12842
13272
  );
12843
13273
  if (failureHookResult.additionalContext) {
12844
13274
  debugLogger6.debug(
@@ -13059,7 +13489,9 @@ ${this.pendingRecoveredAgentsNotice}
13059
13489
  }
13060
13490
  };
13061
13491
  } else {
13062
- return { text: `@${part.uri}` };
13492
+ return {
13493
+ text: part.name ? `@${part.uri} (original filename: ${JSON.stringify(part.name)})` : `@${part.uri}`
13494
+ };
13063
13495
  }
13064
13496
  }
13065
13497
  case "resource": {
@@ -14976,7 +15408,7 @@ function createAcpSessionProfiler(span, attributePrefix) {
14976
15408
  }
14977
15409
  }, "setAttribute");
14978
15410
  const recordStage = /* @__PURE__ */ __name((stage, start) => {
14979
- const durationMs = Math.round((performance.now() - start) * 100) / 100;
15411
+ const durationMs = Math.round((performance2.now() - start) * 100) / 100;
14980
15412
  if (Number.isFinite(durationMs) && durationMs >= 0) {
14981
15413
  setAttribute(
14982
15414
  `qwen-code.daemon.${attributePrefix}.${stage}_ms`,
@@ -14995,7 +15427,7 @@ function createAcpSessionProfiler(span, attributePrefix) {
14995
15427
  },
14996
15428
  async time(stage, fn) {
14997
15429
  if (!span) return await fn();
14998
- const start = performance.now();
15430
+ const start = performance2.now();
14999
15431
  try {
15000
15432
  return await fn();
15001
15433
  } catch (error) {
@@ -15007,7 +15439,7 @@ function createAcpSessionProfiler(span, attributePrefix) {
15007
15439
  },
15008
15440
  timeSync(stage, fn) {
15009
15441
  if (!span) return fn();
15010
- const start = performance.now();
15442
+ const start = performance2.now();
15011
15443
  try {
15012
15444
  return fn();
15013
15445
  } catch (error) {
@@ -15692,14 +16124,38 @@ function readExistingProviderConfig(config, settings) {
15692
16124
  // Never serialize the raw secret over the ACP wire. Expose only whether a
15693
16125
  // key is stored; the client can omit `apiKey` on connect to keep it.
15694
16126
  ...apiKey ? { hasApiKey: true } : {},
15695
- ...existing ? { modelIds: existing.models.map((model) => model.id) } : {},
16127
+ ...existing ? {
16128
+ modelIds: existing.models.filter(
16129
+ (model) => model.baseUrl === firstModel?.baseUrl && model.envKey === firstModel?.envKey
16130
+ ).map((model) => model.id)
16131
+ } : {},
15696
16132
  ...advancedConfig ? { advancedConfig } : {}
15697
16133
  };
15698
16134
  }
15699
16135
  __name(readExistingProviderConfig, "readExistingProviderConfig");
15700
- function resolveExistingProviderApiKey(config, settings, protocol, baseUrl) {
15701
- const envKey = resolveProviderEnvKey(config, protocol, baseUrl);
15702
- return readSettingsEnv(settings, envKey);
16136
+ function resolveExistingProviderApiKey(config, settings, protocol, baseUrl, modelIds) {
16137
+ const owns = resolveOwnsModel(config);
16138
+ const models = (settings.merged.modelProviders?.[protocol] ?? []).filter(
16139
+ (model) => owns?.(model) && model.baseUrl === baseUrl && modelIds.includes(model.id)
16140
+ );
16141
+ const conversation = models.filter(
16142
+ (model) => !model.imageOnly && !model.voiceOnly
16143
+ );
16144
+ if (!conversation.length && modelIds.some((id) => !models.some((model) => model.id === id))) {
16145
+ return readSettingsEnv(
16146
+ settings,
16147
+ resolveProviderEnvKey(config, protocol, baseUrl)
16148
+ );
16149
+ }
16150
+ const keys = new Set(
16151
+ (conversation.length ? conversation : models).map((model) => model.envKey)
16152
+ );
16153
+ if (keys.size === 1) return readSettingsEnv(settings, [...keys][0]);
16154
+ if (keys.size > 1) return void 0;
16155
+ return readSettingsEnv(
16156
+ settings,
16157
+ resolveProviderEnvKey(config, protocol, baseUrl)
16158
+ );
15703
16159
  }
15704
16160
  __name(resolveExistingProviderApiKey, "resolveExistingProviderApiKey");
15705
16161
  function serializeProviderConfig(config, settings) {
@@ -15747,14 +16203,6 @@ function readProviderSetupInputs(config, params, resolveExistingApiKey) {
15747
16203
  `Invalid or missing baseUrl for provider "${config.id}"`
15748
16204
  );
15749
16205
  }
15750
- const apiKey = readOptionalString3(params["apiKey"], "apiKey") ?? resolveExistingApiKey?.(protocol ?? config.protocol, baseUrl);
15751
- if (!apiKey) {
15752
- throw RequestError.invalidParams(void 0, "Invalid or missing apiKey");
15753
- }
15754
- const apiKeyError = config.validateApiKey?.(apiKey, baseUrl);
15755
- if (apiKeyError) {
15756
- throw RequestError.invalidParams(void 0, apiKeyError);
15757
- }
15758
16206
  const defaultModelIds = getDefaultModelIds(config);
15759
16207
  const modelIds = readStringArray(params["modelIds"], "modelIds");
15760
16208
  const resolvedModelIds = modelIds.length > 0 ? modelIds : defaultModelIds;
@@ -15764,6 +16212,18 @@ function readProviderSetupInputs(config, params, resolveExistingApiKey) {
15764
16212
  `Invalid or missing modelIds for provider "${config.id}"`
15765
16213
  );
15766
16214
  }
16215
+ const apiKey = readOptionalString3(params["apiKey"], "apiKey") ?? resolveExistingApiKey?.(
16216
+ protocol ?? config.protocol,
16217
+ baseUrl,
16218
+ resolvedModelIds
16219
+ );
16220
+ if (!apiKey) {
16221
+ throw RequestError.invalidParams(void 0, "Invalid or missing apiKey");
16222
+ }
16223
+ const apiKeyError = config.validateApiKey?.(apiKey, baseUrl);
16224
+ if (apiKeyError) {
16225
+ throw RequestError.invalidParams(void 0, apiKeyError);
16226
+ }
15767
16227
  const advancedConfig = readProviderAdvancedConfig(params["advancedConfig"]);
15768
16228
  return {
15769
16229
  ...protocol ? { protocol } : {},
@@ -16559,52 +17019,81 @@ async function runAcpAgent(config, settings, argv, options) {
16559
17019
  eventLoopMonitor.dispose();
16560
17020
  throw err;
16561
17021
  }
17022
+ let drainPoolPromise;
16562
17023
  const drainPoolBeforeExit = /* @__PURE__ */ __name(async (label, strict = false) => {
16563
17024
  if (!agentInstance) return;
16564
17025
  try {
16565
- await agentInstance.shutdownMcpPool(8e3);
17026
+ drainPoolPromise ??= agentInstance.shutdownMcpPool(8e3);
17027
+ await drainPoolPromise;
16566
17028
  } catch (err) {
16567
17029
  debugLogger9.error(`[ACP] MCP pool drain (${label}) error:`, err);
16568
17030
  if (strict) throw err;
16569
17031
  }
16570
17032
  }, "drainPoolBeforeExit");
17033
+ let disposeSessionsPromise;
17034
+ const disposeSessionsOnce = /* @__PURE__ */ __name(() => {
17035
+ if (!agentInstance) return Promise.resolve();
17036
+ disposeSessionsPromise ??= agentInstance.disposeSessions();
17037
+ return disposeSessionsPromise;
17038
+ }, "disposeSessionsOnce");
16571
17039
  let shuttingDown = false;
16572
17040
  let managedShutdownPromise;
16573
- let sessionEndFired = false;
16574
- const fireSessionEndOnce = /* @__PURE__ */ __name(async (reason, managedConfigs) => {
16575
- if (sessionEndFired) return;
16576
- sessionEndFired = true;
16577
- const configs = new Set(managedConfigs ?? [config]);
16578
- if (!managedConfigs) {
16579
- const sessions = agentInstance?.getActiveSessions();
16580
- if (sessions) {
16581
- for (const session of sessions) {
16582
- const sessionConfig = session.getConfig?.();
16583
- if (sessionConfig) {
16584
- configs.add(sessionConfig);
17041
+ let sessionEndPromise;
17042
+ const fireSessionEndOnce = /* @__PURE__ */ __name((reason, managedConfigs) => {
17043
+ if (sessionEndPromise) return sessionEndPromise;
17044
+ sessionEndPromise = (async () => {
17045
+ const configs = new Set(managedConfigs ?? [config]);
17046
+ if (!managedConfigs) {
17047
+ const sessions = agentInstance?.getActiveSessions();
17048
+ if (sessions) {
17049
+ for (const session of sessions) {
17050
+ const sessionConfig = session.getConfig?.();
17051
+ if (sessionConfig) {
17052
+ configs.add(sessionConfig);
17053
+ }
16585
17054
  }
16586
17055
  }
16587
17056
  }
16588
- }
16589
- const failures = [];
16590
- for (const cfg of configs) {
16591
- const hookSystem = cfg.getHookSystem?.();
16592
- const hooksEnabled = !cfg.getDisableAllHooks?.();
16593
- if (!hooksEnabled || !hookSystem || !cfg.hasHooksForEvent?.("SessionEnd")) {
16594
- continue;
16595
- }
17057
+ const controller = new AbortController();
17058
+ const timeout = setTimeout(() => controller.abort(), 3e4);
17059
+ timeout.unref();
16596
17060
  try {
16597
- await hookSystem.fireSessionEndEvent(reason);
16598
- } catch (err) {
16599
- if (managedConfigs) failures.push(err);
16600
- debugLogger9.warn(
16601
- `SessionEnd hook failed: ${err instanceof Error ? err.message : String(err)}`
17061
+ const results = await Promise.allSettled(
17062
+ [...configs].flatMap((cfg) => {
17063
+ const hookSystem = cfg.getHookSystem?.();
17064
+ if (cfg.getDisableAllHooks?.() || !hookSystem || typeof hookSystem.fireSessionEndEvent !== "function" || !cfg.hasHooksForEvent?.("SessionEnd")) {
17065
+ return [];
17066
+ }
17067
+ return [
17068
+ Promise.resolve().then(
17069
+ () => hookSystem.fireSessionEndEvent(reason, controller.signal)
17070
+ )
17071
+ ];
17072
+ })
16602
17073
  );
17074
+ const failures = results.filter(
17075
+ (result) => result.status === "rejected"
17076
+ ).map((result) => result.reason);
17077
+ if (controller.signal.aborted) {
17078
+ failures.push(
17079
+ new Error(
17080
+ "SessionEnd hook did not complete within 30s (cancelled)"
17081
+ )
17082
+ );
17083
+ }
17084
+ for (const failure2 of failures) {
17085
+ debugLogger9.warn(
17086
+ `SessionEnd hook failed: ${failure2 instanceof Error ? failure2.message : String(failure2)}`
17087
+ );
17088
+ }
17089
+ if (managedConfigs && failures.length > 0) {
17090
+ throw new AggregateError(failures, "SessionEnd hook shutdown failed");
17091
+ }
17092
+ } finally {
17093
+ clearTimeout(timeout);
16603
17094
  }
16604
- }
16605
- if (failures.length > 0) {
16606
- throw new AggregateError(failures, "SessionEnd hook shutdown failed");
16607
- }
17095
+ })();
17096
+ return sessionEndPromise;
16608
17097
  }, "fireSessionEndOnce");
16609
17098
  const shutdownManagedAgent = /* @__PURE__ */ __name((reason, label) => {
16610
17099
  if (managedShutdownPromise) return managedShutdownPromise;
@@ -16691,7 +17180,7 @@ async function runAcpAgent(config, settings, argv, options) {
16691
17180
  }
16692
17181
  try {
16693
17182
  await fireSessionEndOnce("other" /* Other */);
16694
- await agentInstance?.disposeSessions();
17183
+ await disposeSessionsOnce();
16695
17184
  try {
16696
17185
  process.stdin.destroy();
16697
17186
  } catch {
@@ -16729,7 +17218,7 @@ async function runAcpAgent(config, settings, argv, options) {
16729
17218
  } else {
16730
17219
  await fireSessionEndOnce("prompt_input_exit" /* PromptInputExit */);
16731
17220
  await drainPoolBeforeExit("ide_close");
16732
- await agentInstance?.disposeSessions();
17221
+ await disposeSessionsOnce();
16733
17222
  }
16734
17223
  } finally {
16735
17224
  process.off("SIGTERM", shutdownHandler);
@@ -18082,7 +18571,7 @@ var QwenAgent = class _QwenAgent {
18082
18571
  }
18083
18572
  this.clientCapabilities = args.clientCapabilities;
18084
18573
  const authMethods = buildAuthMethods();
18085
- const version = "0.23.3";
18574
+ const version = "0.23.4";
18086
18575
  const response = {
18087
18576
  protocolVersion: PROTOCOL_VERSION,
18088
18577
  agentInfo: {
@@ -18515,7 +19004,8 @@ var QwenAgent = class _QwenAgent {
18515
19004
  sessionSource,
18516
19005
  sessionId,
18517
19006
  true,
18518
- {},
19007
+ // Restore token counts only after the model route is authenticated.
19008
+ { skipLlmInitialization: true },
18519
19009
  void 0,
18520
19010
  restoreOptions
18521
19011
  )
@@ -18851,7 +19341,8 @@ var QwenAgent = class _QwenAgent {
18851
19341
  sessionSource,
18852
19342
  sessionId,
18853
19343
  true,
18854
- {},
19344
+ // Restore token counts only after the model route is authenticated.
19345
+ { skipLlmInitialization: true },
18855
19346
  void 0,
18856
19347
  RESUME_RESTORE_OPTIONS
18857
19348
  )
@@ -19028,7 +19519,7 @@ var QwenAgent = class _QwenAgent {
19028
19519
  }
19029
19520
  return await this.runInSessionContext(
19030
19521
  session,
19031
- () => session.setModel({ ...params, sessionId })
19522
+ () => params._meta?.[SESSION_MODEL_PERSIST_DEFAULT_META_KEY] === false ? session.setModel({ ...params, sessionId }, { persistDefault: false }) : session.setModel({ ...params, sessionId })
19032
19523
  );
19033
19524
  }
19034
19525
  async setSessionConfigOption(params) {
@@ -19165,13 +19656,24 @@ var QwenAgent = class _QwenAgent {
19165
19656
  const suppliedContext = meta[INVOCATION_CONTEXT_META_KEY];
19166
19657
  const suppliedModelPrompt = meta[DAEMON_MODEL_PROMPT_META_KEY];
19167
19658
  const suppliedPromptDisplayText = meta[DAEMON_PROMPT_DISPLAY_TEXT_META_KEY];
19659
+ const submittedPrompt = this.privateParentState === "trusted" ? meta[DAEMON_SUBMITTED_PROMPT_META_KEY] : meta[SUBMITTED_PROMPT_META_KEY];
19168
19660
  const suppliedChannelPrompt = meta[CHANNEL_PROMPT_META_KEY];
19661
+ const suppliedGoalProposalApproval = meta["qwen.goalProposalApproval"];
19169
19662
  const suppliedChannelDelivery = meta[DAEMON_CHANNEL_DELIVERY_META_KEY];
19170
19663
  delete meta[INVOCATION_CONTEXT_META_KEY];
19171
19664
  delete meta[DAEMON_MODEL_PROMPT_META_KEY];
19172
19665
  delete meta[PRIVATE_PARENT_CAPABILITY_META_KEY];
19173
19666
  delete meta[DAEMON_PROMPT_DISPLAY_TEXT_META_KEY];
19667
+ delete meta[SUBMITTED_PROMPT_META_KEY];
19668
+ delete meta[DAEMON_SUBMITTED_PROMPT_META_KEY];
19669
+ if (typeof submittedPrompt === "string" && suppliedChannelPrompt !== true) {
19670
+ meta[DAEMON_SUBMITTED_PROMPT_META_KEY] = submittedPrompt;
19671
+ }
19174
19672
  delete meta[CHANNEL_PROMPT_META_KEY];
19673
+ delete meta["qwen.goalProposalApproval"];
19674
+ if (this.privateParentState === "trusted" && suppliedGoalProposalApproval === true) {
19675
+ meta["qwen.goalProposalApproval"] = true;
19676
+ }
19175
19677
  delete meta[DAEMON_CHANNEL_DELIVERY_META_KEY];
19176
19678
  if (this.privateParentState === "trusted" && typeof suppliedPromptDisplayText === "string") {
19177
19679
  meta[DAEMON_PROMPT_DISPLAY_TEXT_META_KEY] = suppliedPromptDisplayText;
@@ -19251,8 +19753,105 @@ var QwenAgent = class _QwenAgent {
19251
19753
  });
19252
19754
  }
19253
19755
  loadPermissionSettings(cwd) {
19254
- this.settings = loadSettings(cwd);
19255
- return this.settings;
19756
+ return this.adoptRequestSettings(this.loadRequestSettings(cwd), cwd);
19757
+ }
19758
+ /**
19759
+ * Publish a freshly loaded `LoadedSettings` into the process-wide
19760
+ * `this.settings` cache only when it was loaded for the daemon's own
19761
+ * workspace. `this.settings` is the "latest loaded" cache read by the
19762
+ * daemon-global control handlers (`workspaceReload`,
19763
+ * `workspaceModelProvidersReload`, `qwen/settings/getPath`, workspace
19764
+ * status): a session-scoped load for a foreign workspace (worktree) must
19765
+ * stay request-local, or that workspace's settings, approval mode, MCP
19766
+ * servers, hooks and permission rules would bleed into every other live
19767
+ * session. The load still returns the caller's instance either way.
19768
+ */
19769
+ adoptRequestSettings(settings, settingsCwd) {
19770
+ if (this.canonicalWorkspacePath(settingsCwd) === this.canonicalWorkspacePath(this.config.getTargetDir())) {
19771
+ this.settings = settings;
19772
+ }
19773
+ return settings;
19774
+ }
19775
+ /**
19776
+ * Canonical spelling for workspace-coordinate comparisons. A session's
19777
+ * admission root and a request's settings cwd can name the same directory
19778
+ * through a symlink (`/tmp` vs `/private/tmp` on macOS) or a different case
19779
+ * on a case-insensitive volume; a plain string compare then turns a
19780
+ * workspace grant's *revocation* into a no-op on the live session while the
19781
+ * caller is told it saved (fail-open). `realpathSync.native()` resolves
19782
+ * both through the filesystem — including the on-disk casing on macOS and
19783
+ * Windows — and deliberately does NOT fold case itself: on a case-sensitive
19784
+ * volume `proj` and `PROJ` are genuinely different workspaces, and folding
19785
+ * would silently authorise one under a rule written for the other.
19786
+ */
19787
+ canonicalWorkspacePath(workspacePath) {
19788
+ const resolved = path7.resolve(workspacePath);
19789
+ try {
19790
+ return realpathSync3.native(resolved);
19791
+ } catch {
19792
+ return resolved;
19793
+ }
19794
+ }
19795
+ /**
19796
+ * Load settings for a single `qwen/settings/*` / `qwen/permissions/*`
19797
+ * request. `skipLoadEnvironment` is set because a per-request read — and, for
19798
+ * session-scoped calls, a foreign-workspace read — must not inject that
19799
+ * workspace's `.env` into the daemon's process-wide `process.env`; env
19800
+ * application stays with the daemon-global reload handlers that call
19801
+ * `reloadEnvironment` deliberately. `consumeCorruptionEnvVars` is stated
19802
+ * explicitly because passing an options object replaces `loadSettings`'s
19803
+ * `= true` default.
19804
+ */
19805
+ loadRequestSettings(settingsCwd) {
19806
+ return loadSettings(settingsCwd, {
19807
+ consumeCorruptionEnvVars: true,
19808
+ skipLoadEnvironment: true
19809
+ });
19810
+ }
19811
+ /**
19812
+ * Resolve the workspace root for the session-aware `qwen/settings/*` +
19813
+ * `qwen/permissions/*` handlers — the ones whose write and read-back share
19814
+ * the resolved coordinate. The handlers whose status/apply routes are
19815
+ * workspace-global (`setMcpServer`, `removeMcpServer`, `setHook`,
19816
+ * `removeHook`, `setExtensionSetting`) deliberately do NOT resolve
19817
+ * `sessionId`: their write would land in the session's worktree while the
19818
+ * status and reload routes keep reading the bootstrap workspace, so the
19819
+ * handler would answer "saved" for a server no route ever lists or applies.
19820
+ * Those five resolve `requestedCwd || this.config.getTargetDir()` instead
19821
+ * (`||`, not `??`: a present-but-empty `cwd` is not a workspace and falls to
19822
+ * the bootstrap dir like an absent one).
19823
+ *
19824
+ * `sessionId` names the requesting session, whose own Config is
19825
+ * relocated to its worktree; without one the daemon's bootstrap
19826
+ * `this.config` is used — nothing relocates the agent-level Config, so that
19827
+ * is the boot workspace and swapping `process.cwd()` for
19828
+ * `this.config.getTargetDir()` is a no-op there. An unresolvable `sessionId`
19829
+ * is rejected rather than silently retargeting the read/write to the
19830
+ * bootstrap workspace, whose trust decision and settings the caller never
19831
+ * selected.
19832
+ */
19833
+ settingsCwdFor(requestedCwd, params) {
19834
+ if (requestedCwd) {
19835
+ return requestedCwd;
19836
+ }
19837
+ const sessionId = params["sessionId"];
19838
+ if (sessionId !== void 0 && sessionId !== null) {
19839
+ if (typeof sessionId !== "string" || sessionId.length === 0) {
19840
+ throw RequestError.invalidParams(
19841
+ void 0,
19842
+ "Invalid sessionId: expected a non-empty string"
19843
+ );
19844
+ }
19845
+ const session = this.sessions.get(sessionId);
19846
+ if (!session) {
19847
+ throw new RequestError(-32004, `Session not found: ${sessionId}`, {
19848
+ errorKind: "session_not_found",
19849
+ sessionId
19850
+ });
19851
+ }
19852
+ return this.sessionWorkspaceRoot(session.getConfig());
19853
+ }
19854
+ return this.config.getTargetDir();
19256
19855
  }
19257
19856
  async buildCoreSettings(settings, cwd) {
19258
19857
  const userSettings = settings.user.settings;
@@ -19376,7 +19975,7 @@ var QwenAgent = class _QwenAgent {
19376
19975
  isTrusted: settings.isTrusted
19377
19976
  };
19378
19977
  }
19379
- syncLivePermissionManagers(before, after) {
19978
+ syncLivePermissionManagers(before, after, settingScope, settingsCwd) {
19380
19979
  for (const ruleType of PERMISSION_RULE_TYPES) {
19381
19980
  const oldRules = new Set(before[ruleType]);
19382
19981
  const newRules = new Set(after[ruleType]);
@@ -19384,6 +19983,14 @@ var QwenAgent = class _QwenAgent {
19384
19983
  const added = after[ruleType].filter((rule) => !oldRules.has(rule));
19385
19984
  if (removed.length === 0 && added.length === 0) continue;
19386
19985
  for (const session of this.sessions.values()) {
19986
+ if (settingScope === "Workspace" /* Workspace */) {
19987
+ const sessionWorkspace = this.sessionWorkspaceRoot(
19988
+ session.getConfig()
19989
+ );
19990
+ if (this.canonicalWorkspacePath(sessionWorkspace) !== this.canonicalWorkspacePath(settingsCwd)) {
19991
+ continue;
19992
+ }
19993
+ }
19387
19994
  const pm = session.getConfig().getPermissionManager?.();
19388
19995
  if (!pm) continue;
19389
19996
  try {
@@ -19404,6 +20011,20 @@ var QwenAgent = class _QwenAgent {
19404
20011
  workspaceCwd(config) {
19405
20012
  return config.getTargetDir();
19406
20013
  }
20014
+ /**
20015
+ * The stable workspace root a session was admitted under. Unlike
20016
+ * `workspaceCwd` (the live `getTargetDir()`) and `Config.getProjectRoot()`
20017
+ * (also live `targetDir`), this reads the admission-bound `storage`, which
20018
+ * `relocateWorkingDirectory` leaves untouched when `session/cd` moves a
20019
+ * session into a subdirectory (`skipArtifactMigration: true`). Keying the
20020
+ * twelve `qwen/settings/*` / `qwen/permissions/*` handlers and the
20021
+ * workspace-scoped permission fan-out on this root — rather than the live
20022
+ * cwd — is what keeps a post-`cd` request from reading/writing a stray
20023
+ * `<subdir>/.qwen/settings.json`.
20024
+ */
20025
+ sessionWorkspaceRoot(config) {
20026
+ return config.storage.getProjectRoot();
20027
+ }
19407
20028
  safeWorkspaceCwd(config) {
19408
20029
  try {
19409
20030
  return this.workspaceCwd(config);
@@ -20020,13 +20641,22 @@ var QwenAgent = class _QwenAgent {
20020
20641
  if (extension.isActive) continue;
20021
20642
  for (const skill of extension.skills ?? []) {
20022
20643
  const extensionName = extension.name;
20023
- const key = `extension:${extensionName}:${skill.name}`;
20644
+ const key = `extension:${extensionName}:${qualifySkillName(
20645
+ extensionName,
20646
+ skill.name
20647
+ )}`;
20024
20648
  if (skillsByKey.has(key)) continue;
20025
20649
  skillsByKey.set(
20026
20650
  key,
20027
20651
  mapSkillConfigToStatus(
20028
20652
  {
20029
20653
  ...skill,
20654
+ // Carry the qualified name like the registry rows do: a
20655
+ // surface that persists this row's name verbatim (the web
20656
+ // shell's Enable toggle) would otherwise write a bare entry
20657
+ // that can never grant once the extension activates.
20658
+ name: qualifySkillName(extensionName, skill.name),
20659
+ authoredName: skill.name,
20030
20660
  level: "extension",
20031
20661
  extensionName,
20032
20662
  extensionDisplayName: extension.displayName
@@ -20520,6 +21150,7 @@ var QwenAgent = class _QwenAgent {
20520
21150
  v: STATUS_SCHEMA_VERSION,
20521
21151
  sessionId,
20522
21152
  workspaceCwd: this.workspaceCwd(config),
21153
+ recovery: session.getRecoveryStatus(),
20523
21154
  state: {
20524
21155
  models: this.buildAvailableModels(config),
20525
21156
  modes: this.buildModesData(config),
@@ -21147,15 +21778,20 @@ var QwenAgent = class _QwenAgent {
21147
21778
  const inputs = readProviderSetupInputs(
21148
21779
  providerConfig,
21149
21780
  params,
21150
- (protocol, baseUrl) => resolveExistingProviderApiKey(
21781
+ (protocol, baseUrl, modelIds) => resolveExistingProviderApiKey(
21151
21782
  providerConfig,
21152
21783
  this.settings,
21153
21784
  protocol,
21154
- baseUrl
21785
+ baseUrl,
21786
+ modelIds
21155
21787
  )
21156
21788
  );
21157
21789
  const persistScope = readProviderConnectScope(params["scope"]);
21158
- const plan = buildInstallPlan(providerConfig, inputs);
21790
+ const plan = buildInstallPlan(
21791
+ providerConfig,
21792
+ inputs,
21793
+ this.settings.merged.modelProviders?.[inputs.protocol ?? providerConfig.protocol]
21794
+ );
21159
21795
  const adapter = createLoadedSettingsAdapter(
21160
21796
  this.settings,
21161
21797
  persistScope
@@ -21191,15 +21827,17 @@ var QwenAgent = class _QwenAgent {
21191
21827
  return setManagedSkillEnabled(this.config, params, requestedCwd);
21192
21828
  }
21193
21829
  case "qwen/settings/getMemory": {
21194
- const settings = loadSettings(cwd);
21195
- this.settings = settings;
21830
+ const settingsCwd = this.settingsCwdFor(requestedCwd, params);
21831
+ const settings = this.loadRequestSettings(settingsCwd);
21832
+ this.adoptRequestSettings(settings, settingsCwd);
21196
21833
  return {
21197
21834
  settings: normalizeQwenMemorySettings(settings.merged.memory)
21198
21835
  };
21199
21836
  }
21200
21837
  case "qwen/settings/setMemory": {
21201
21838
  const updates = toRecord3(params["updates"]);
21202
- const settings = loadSettings(cwd);
21839
+ const settingsCwd = this.settingsCwdFor(requestedCwd, params);
21840
+ const settings = this.loadRequestSettings(settingsCwd);
21203
21841
  for (const key of QWEN_MEMORY_SETTING_KEYS) {
21204
21842
  if (updates[key] === void 0) continue;
21205
21843
  if (typeof updates[key] !== "boolean") {
@@ -21210,7 +21848,7 @@ var QwenAgent = class _QwenAgent {
21210
21848
  }
21211
21849
  settings.setValue("User" /* User */, `memory.${key}`, updates[key]);
21212
21850
  }
21213
- this.settings = settings;
21851
+ this.adoptRequestSettings(settings, settingsCwd);
21214
21852
  return {
21215
21853
  settings: normalizeQwenMemorySettings(settings.merged.memory)
21216
21854
  };
@@ -21219,9 +21857,13 @@ var QwenAgent = class _QwenAgent {
21219
21857
  return { path: this.settings.user.path };
21220
21858
  }
21221
21859
  case "qwen/settings/getMemoryPaths": {
21222
- const projectRoot = typeof params["projectRoot"] === "string" ? params["projectRoot"] : cwd;
21860
+ const settingsCwd = this.settingsCwdFor(requestedCwd, params);
21861
+ const projectRoot = typeof params["projectRoot"] === "string" ? params["projectRoot"] : settingsCwd;
21223
21862
  return {
21224
- paths: await resolveQwenMemoryPaths({ cwd, projectRoot })
21863
+ paths: await resolveQwenMemoryPaths({
21864
+ cwd: settingsCwd,
21865
+ projectRoot
21866
+ })
21225
21867
  };
21226
21868
  }
21227
21869
  case SERVE_STATUS_EXT_METHODS.workspaceMcp:
@@ -24783,9 +25425,10 @@ ${outputText}
24783
25425
  return { newSessionId, title, displayName: title };
24784
25426
  }
24785
25427
  case "qwen/settings/getCore": {
24786
- const settings = loadSettings(cwd);
24787
- this.settings = settings;
24788
- return this.buildCoreSettings(settings, cwd);
25428
+ const settingsCwd = this.settingsCwdFor(requestedCwd, params);
25429
+ const settings = this.loadRequestSettings(settingsCwd);
25430
+ this.adoptRequestSettings(settings, settingsCwd);
25431
+ return this.buildCoreSettings(settings, settingsCwd);
24789
25432
  }
24790
25433
  case "qwen/settings/setCoreValue": {
24791
25434
  const key = params["key"];
@@ -24795,7 +25438,8 @@ ${outputText}
24795
25438
  "Unsupported Qwen setting key"
24796
25439
  );
24797
25440
  }
24798
- const settings = loadSettings(cwd);
25441
+ const settingsCwd = this.settingsCwdFor(requestedCwd, params);
25442
+ const settings = this.loadRequestSettings(settingsCwd);
24799
25443
  const settingKey = key;
24800
25444
  const normalizedValue = normalizeCoreSettingValue(
24801
25445
  settingKey,
@@ -24809,8 +25453,8 @@ ${outputText}
24809
25453
  if (settingKey === "general.outputLanguage" && typeof normalizedValue === "string" && scope === "User" /* User */) {
24810
25454
  updateOutputLanguageFile(normalizedValue);
24811
25455
  }
24812
- this.settings = settings;
24813
- return this.buildCoreSettings(settings, cwd);
25456
+ this.adoptRequestSettings(settings, settingsCwd);
25457
+ return this.buildCoreSettings(settings, settingsCwd);
24814
25458
  }
24815
25459
  case "qwen/settings/setMcpServer": {
24816
25460
  const name = params["name"];
@@ -24820,7 +25464,8 @@ ${outputText}
24820
25464
  "MCP server name is required"
24821
25465
  );
24822
25466
  }
24823
- const settings = loadSettings(cwd);
25467
+ const settingsCwd = requestedCwd || this.config.getTargetDir();
25468
+ const settings = this.loadRequestSettings(settingsCwd);
24824
25469
  const settingScope = toSettingsScope(params["scope"]);
24825
25470
  const scope = settingScope === "Workspace" /* Workspace */ ? "workspace" : "user";
24826
25471
  const existing = readScopeSettings(settings, scope);
@@ -24835,8 +25480,8 @@ ${outputText}
24835
25480
  )
24836
25481
  };
24837
25482
  settings.setValue(settingScope, "mcpServers", mcpServers);
24838
- this.settings = settings;
24839
- return this.buildCoreSettings(settings, cwd);
25483
+ this.adoptRequestSettings(settings, settingsCwd);
25484
+ return this.buildCoreSettings(settings, settingsCwd);
24840
25485
  }
24841
25486
  case "qwen/settings/removeMcpServer": {
24842
25487
  const name = params["name"];
@@ -24846,22 +25491,24 @@ ${outputText}
24846
25491
  "MCP server name is required"
24847
25492
  );
24848
25493
  }
24849
- const settings = loadSettings(cwd);
25494
+ const settingsCwd = requestedCwd || this.config.getTargetDir();
25495
+ const settings = this.loadRequestSettings(settingsCwd);
24850
25496
  const settingScope = toSettingsScope(params["scope"]);
24851
25497
  const scope = settingScope === "Workspace" /* Workspace */ ? "workspace" : "user";
24852
25498
  const existing = readScopeSettings(settings, scope);
24853
25499
  const mcpServers = { ...toRecord3(existing["mcpServers"]) };
24854
25500
  delete mcpServers[name.trim()];
24855
25501
  settings.setValue(settingScope, "mcpServers", mcpServers);
24856
- this.settings = settings;
24857
- return this.buildCoreSettings(settings, cwd);
25502
+ this.adoptRequestSettings(settings, settingsCwd);
25503
+ return this.buildCoreSettings(settings, settingsCwd);
24858
25504
  }
24859
25505
  case "qwen/settings/setHook": {
24860
25506
  const event = params["event"];
24861
25507
  if (!isHookEvent(event)) {
24862
25508
  throw RequestError.invalidParams(void 0, "Invalid hook event");
24863
25509
  }
24864
- const settings = loadSettings(cwd);
25510
+ const settingsCwd = requestedCwd || this.config.getTargetDir();
25511
+ const settings = this.loadRequestSettings(settingsCwd);
24865
25512
  const settingScope = toSettingsScope(params["scope"]);
24866
25513
  const scope = settingScope === "Workspace" /* Workspace */ ? "workspace" : "user";
24867
25514
  const existing = readScopeSettings(settings, scope);
@@ -24881,8 +25528,8 @@ ${outputText}
24881
25528
  }
24882
25529
  hooksRoot[event] = eventHooks;
24883
25530
  settings.setValue(settingScope, "hooks", hooksRoot);
24884
- this.settings = settings;
24885
- return this.buildCoreSettings(settings, cwd);
25531
+ this.adoptRequestSettings(settings, settingsCwd);
25532
+ return this.buildCoreSettings(settings, settingsCwd);
24886
25533
  }
24887
25534
  case "qwen/settings/removeHook": {
24888
25535
  const event = params["event"];
@@ -24893,7 +25540,8 @@ ${outputText}
24893
25540
  if (typeof index !== "number" || !Number.isInteger(index) || index < 0) {
24894
25541
  throw RequestError.invalidParams(void 0, "Invalid hook index");
24895
25542
  }
24896
- const settings = loadSettings(cwd);
25543
+ const settingsCwd = requestedCwd || this.config.getTargetDir();
25544
+ const settings = this.loadRequestSettings(settingsCwd);
24897
25545
  const settingScope = toSettingsScope(params["scope"]);
24898
25546
  const scope = settingScope === "Workspace" /* Workspace */ ? "workspace" : "user";
24899
25547
  const existing = readScopeSettings(settings, scope);
@@ -24908,8 +25556,8 @@ ${outputText}
24908
25556
  eventHooks.splice(index, 1);
24909
25557
  hooksRoot[event] = eventHooks;
24910
25558
  settings.setValue(settingScope, "hooks", hooksRoot);
24911
- this.settings = settings;
24912
- return this.buildCoreSettings(settings, cwd);
25559
+ this.adoptRequestSettings(settings, settingsCwd);
25560
+ return this.buildCoreSettings(settings, settingsCwd);
24913
25561
  }
24914
25562
  case "qwen/settings/setExtensionSetting": {
24915
25563
  const extensionId = params["extensionId"];
@@ -24927,9 +25575,10 @@ ${outputText}
24927
25575
  if (typeof value !== "string") {
24928
25576
  throw RequestError.invalidParams(void 0, "value must be a string");
24929
25577
  }
24930
- const settings = loadSettings(cwd);
25578
+ const settingsCwd = requestedCwd || this.config.getTargetDir();
25579
+ const settings = this.loadRequestSettings(settingsCwd);
24931
25580
  const extensionManager = new ExtensionManager({
24932
- workspaceDir: cwd,
25581
+ workspaceDir: settingsCwd,
24933
25582
  isWorkspaceTrusted: isWorkspaceTrusted(settings.merged).isTrusted ?? true,
24934
25583
  locale: getCurrentLanguage()
24935
25584
  });
@@ -24946,11 +25595,12 @@ ${outputText}
24946
25595
  async () => value,
24947
25596
  extScope
24948
25597
  );
24949
- this.settings = settings;
24950
- return this.buildCoreSettings(settings, cwd);
25598
+ this.adoptRequestSettings(settings, settingsCwd);
25599
+ return this.buildCoreSettings(settings, settingsCwd);
24951
25600
  }
24952
25601
  case "qwen/permissions/getSettings": {
24953
- const settings = this.loadPermissionSettings(cwd);
25602
+ const settingsCwd = this.settingsCwdFor(requestedCwd, params);
25603
+ const settings = this.loadPermissionSettings(settingsCwd);
24954
25604
  return buildPermissionSettings(settings);
24955
25605
  }
24956
25606
  case "qwen/permissions/setRules": {
@@ -24968,7 +25618,8 @@ ${outputText}
24968
25618
  'ruleType must be "allow", "ask", or "deny"'
24969
25619
  );
24970
25620
  }
24971
- const settings = this.loadPermissionSettings(cwd);
25621
+ const settingsCwd = this.settingsCwdFor(requestedCwd, params);
25622
+ const settings = this.loadPermissionSettings(settingsCwd);
24972
25623
  const before = readPermissionRuleSet(settings.merged);
24973
25624
  const settingScope = scope === "workspace" ? "Workspace" /* Workspace */ : "User" /* User */;
24974
25625
  const scopeSettings = scope === "workspace" ? settings.workspace.settings : settings.user.settings;
@@ -24986,7 +25637,12 @@ ${outputText}
24986
25637
  }
24987
25638
  settings.setValue(settingScope, `permissions.${ruleType}`, rules);
24988
25639
  const after = readPermissionRuleSet(settings.merged);
24989
- this.syncLivePermissionManagers(before, after);
25640
+ this.syncLivePermissionManagers(
25641
+ before,
25642
+ after,
25643
+ settingScope,
25644
+ settingsCwd
25645
+ );
24990
25646
  return buildPermissionSettings(settings);
24991
25647
  }
24992
25648
  case SERVE_CONTROL_EXT_METHODS.workspaceModelProvidersReload: {
@@ -24997,33 +25653,35 @@ ${outputText}
24997
25653
  debugLogger9.warn("Model-provider settings reload failed");
24998
25654
  return { configsRefreshed: 0, configsFailed: 1 };
24999
25655
  }
25000
- this.modelProviderReloadRevision += 1;
25656
+ const reloadRevision = ++this.modelProviderReloadRevision;
25001
25657
  const merged = this.settings.merged;
25002
25658
  reloadEnvironment(merged, cwd);
25003
25659
  const providerProtocol = merged.providerProtocol ?? {};
25004
25660
  let configsRefreshed = 0;
25005
25661
  let configsFailed = 0;
25006
- const reloadConfig = /* @__PURE__ */ __name((config, id) => {
25662
+ const reloadConfig = /* @__PURE__ */ __name(async (config, id) => {
25663
+ if (reloadRevision !== this.modelProviderReloadRevision) return;
25007
25664
  try {
25008
25665
  config.reloadModelProvidersConfig(
25009
25666
  merged.modelProviders,
25010
25667
  providerProtocol
25011
25668
  );
25669
+ await config.setImageModel(merged.imageModel);
25012
25670
  configsRefreshed += 1;
25013
25671
  } catch {
25014
25672
  configsFailed += 1;
25015
25673
  debugLogger9.warn(`Model-provider reload failed for ${id}`);
25016
25674
  }
25017
25675
  }, "reloadConfig");
25018
- reloadConfig(this.config, "bootstrap");
25676
+ await reloadConfig(this.config, "bootstrap");
25019
25677
  for (const config of this.initializingConfigs) {
25020
25678
  if (config !== this.config) {
25021
- reloadConfig(config, `initializing:${config.getSessionId()}`);
25679
+ await reloadConfig(config, `initializing:${config.getSessionId()}`);
25022
25680
  }
25023
25681
  }
25024
25682
  for (const [id, session] of this.sessions) {
25025
25683
  try {
25026
- session.reloadModelProvidersFromDisk();
25684
+ await session.reloadModelProvidersFromDisk();
25027
25685
  configsRefreshed += 1;
25028
25686
  } catch {
25029
25687
  configsFailed += 1;
@@ -25071,7 +25729,8 @@ ${outputText}
25071
25729
  }
25072
25730
  const config = session.getConfig();
25073
25731
  const authType = config.getAuthType();
25074
- if (providersChanged) {
25732
+ const sessionProvidersChanged = JSON.stringify(config.getModelProvidersConfig()) !== JSON.stringify(newMerged.modelProviders) || JSON.stringify(config.getProviderProtocolConfig()) !== JSON.stringify(newMerged.providerProtocol ?? {});
25733
+ if (sessionProvidersChanged) {
25075
25734
  try {
25076
25735
  config.reloadModelProvidersConfig(
25077
25736
  newMerged.modelProviders,
@@ -25083,6 +25742,13 @@ ${outputText}
25083
25742
  );
25084
25743
  }
25085
25744
  }
25745
+ try {
25746
+ await config.setImageModel(newMerged.imageModel);
25747
+ } catch (err) {
25748
+ debugLogger9.warn(
25749
+ `reload: setImageModel failed for session ${id}: ${err}`
25750
+ );
25751
+ }
25086
25752
  const newModelName = newMerged.model?.name;
25087
25753
  if (changed.has("model") && newModelName && newModelName !== config.getModel() && authType) {
25088
25754
  try {
@@ -25093,7 +25759,7 @@ ${outputText}
25093
25759
  `reload: switchModel failed for session ${id}: ${err}`
25094
25760
  );
25095
25761
  }
25096
- } else if ((providersChanged || envChanged) && authType) {
25762
+ } else if ((sessionProvidersChanged || envChanged) && authType) {
25097
25763
  try {
25098
25764
  await this.refreshAuthWithPersistedReasoning(
25099
25765
  config,
@@ -25531,6 +26197,10 @@ ${outputText}
25531
26197
  if (sessionSource) {
25532
26198
  config.setSessionSource(sessionSource.sourceType, sessionSource.sourceId);
25533
26199
  }
26200
+ config.setArtifactSnapshotsEnabled(this.isTrustedManagedParent());
26201
+ if (this.clientCapabilities?._meta?.["qwen.goalProposals"] === true) {
26202
+ config.setGoalProposalHostSupported(true);
26203
+ }
25534
26204
  if (chatRecording !== false) {
25535
26205
  this.initializingConfigs.add(config);
25536
26206
  }
@@ -25946,6 +26616,7 @@ ${outputText}
25946
26616
  settings.merged.modelProviders,
25947
26617
  settings.merged.providerProtocol ?? {}
25948
26618
  );
26619
+ await config.setImageModel(settings.merged.imageModel);
25949
26620
  if (options.deferWorkspaceActivation !== true) {
25950
26621
  const envReload = reloadEnvironment(
25951
26622
  settings.merged,