@qwen-code/qwen-code 0.21.10 → 0.21.11

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 (367) hide show
  1. package/bundled/coordinate/SKILL.md +52 -0
  2. package/bundled/qc-helper/docs/configuration/model-providers.md +10 -8
  3. package/bundled/qc-helper/docs/extension/_meta.ts +1 -0
  4. package/bundled/qc-helper/docs/extension/agent-plugins.md +50 -0
  5. package/bundled/qc-helper/docs/extension/extension-releasing.md +3 -3
  6. package/bundled/qc-helper/docs/extension/introduction.md +17 -3
  7. package/bundled/qc-helper/docs/features/_meta.ts +1 -0
  8. package/bundled/qc-helper/docs/features/arena.md +4 -3
  9. package/bundled/qc-helper/docs/features/commands.md +7 -6
  10. package/bundled/qc-helper/docs/features/dual-output.md +5 -0
  11. package/bundled/qc-helper/docs/features/headless.md +8 -0
  12. package/bundled/qc-helper/docs/features/multi-agent-coordination.md +30 -0
  13. package/bundled/qc-helper/docs/qwen-serve.md +7 -7
  14. package/bundled/review/SKILL.md +17 -7
  15. package/chunks/{MaxSizedBox-FKXYULMW.js → MaxSizedBox-G7QPSZTF.js} +45 -44
  16. package/chunks/{StandaloneSessionPicker-OQS3M7AY.js → StandaloneSessionPicker-3CTEPV7S.js} +65 -64
  17. package/chunks/{acp-startup-profiler-VNTFWYAC.js → acp-startup-profiler-JMJBZDVO.js} +2 -2
  18. package/chunks/{acpAgent-AGS6HLQQ.js → acpAgent-43JURWOW.js} +1107 -285
  19. package/chunks/{agent-4NCVO27U.js → agent-MIY4LJJJ.js} +42 -41
  20. package/chunks/agent-headless-LWVA6GR5.js +87 -0
  21. package/chunks/{anthropicContentGenerator-D3Y4RFT4.js → anthropicContentGenerator-7HEP7Q5D.js} +8 -8
  22. package/chunks/{artifact-tool-N652YE4L.js → artifact-tool-M7UAJ5NT.js} +2 -2
  23. package/chunks/{askUserQuestion-ONW74PKJ.js → askUserQuestion-7G3LI3IZ.js} +2 -2
  24. package/chunks/{bridge-FHINXZMN.js → bridge-PTTJEBNP.js} +47 -46
  25. package/chunks/{ca-ZLKAB4K3.js → ca-4CQ6MYNQ.js} +2 -1
  26. package/chunks/{channel-management-service-PHELKOW2.js → channel-management-service-PQ6SU56M.js} +6 -6
  27. package/chunks/channel-settings-store-IKK34GMH.js +102 -0
  28. package/chunks/{channel-worker-group-WQP4RCDO.js → channel-worker-group-WBRE33ZV.js} +8 -7
  29. package/chunks/{channel-worker-manager-MRDFAKIM.js → channel-worker-manager-V4LYVTPH.js} +8 -7
  30. package/chunks/{channel-worker-supervisor-IVSDIMI4.js → channel-worker-supervisor-YDAGW2RP.js} +6 -5
  31. package/chunks/{chunk-2PLNY5TN.js → chunk-23GFHEM3.js} +4 -4
  32. package/chunks/{chunk-IIJEYBNH.js → chunk-25OFRBH2.js} +188 -58
  33. package/chunks/{chunk-F24A2JBM.js → chunk-2AAFGCWP.js} +690 -151
  34. package/chunks/{chunk-J6SZID63.js → chunk-2AZMF6G5.js} +2 -2
  35. package/chunks/{chunk-6LP743KE.js → chunk-2R2HYSUQ.js} +21 -102
  36. package/chunks/{chunk-DZUO626D.js → chunk-2XZWO53E.js} +3 -3
  37. package/chunks/{chunk-VKJ4KTPJ.js → chunk-3GCU5O2E.js} +1 -1
  38. package/chunks/{chunk-AQAJJMRR.js → chunk-3LHYTQ2R.js} +1 -1
  39. package/chunks/{chunk-QJMOAMXT.js → chunk-3SOTXJNO.js} +8 -8
  40. package/chunks/{chunk-URKIBIFC.js → chunk-45HPDU3F.js} +3 -3
  41. package/chunks/{chunk-OWMAZHIX.js → chunk-47FQVRCO.js} +1 -1
  42. package/chunks/{chunk-Z4JX4NSH.js → chunk-4C4QSXE3.js} +23 -23
  43. package/chunks/{chunk-IRZ2ZH72.js → chunk-4EX3DBFH.js} +4 -4
  44. package/chunks/{chunk-MFDYOYZZ.js → chunk-4MHDNGAV.js} +25 -2
  45. package/chunks/{chunk-ABVRJU3D.js → chunk-4PFKN7CQ.js} +7 -7
  46. package/chunks/{chunk-HV76SFIA.js → chunk-5HBFERG5.js} +3 -3
  47. package/chunks/{chunk-WAUGQKUU.js → chunk-6LYDH7VT.js} +9 -5
  48. package/chunks/{chunk-S6HYI3MF.js → chunk-6S52N6PG.js} +2 -2
  49. package/chunks/{chunk-FVKHVJZQ.js → chunk-732MOPEM.js} +1 -1
  50. package/chunks/{chunk-OCSFNUU4.js → chunk-7QE3QFU3.js} +8 -8
  51. package/chunks/{chunk-WCG5O7IP.js → chunk-7SUQZ7QH.js} +2 -2
  52. package/chunks/{chunk-QG3FFJYU.js → chunk-AAOONL5N.js} +1 -1
  53. package/chunks/{chunk-VSFKIRRW.js → chunk-AKLY5M2C.js} +4 -4
  54. package/chunks/{chunk-UVX4Y6IN.js → chunk-AQHNAA7E.js} +1 -1
  55. package/chunks/{chunk-IBUGFUXC.js → chunk-BIXG46YI.js} +12 -12
  56. package/chunks/{chunk-4TRQPFDP.js → chunk-BJKREW56.js} +6 -8
  57. package/chunks/{chunk-D27I6YJT.js → chunk-BNRNVMOT.js} +27 -18
  58. package/chunks/{chunk-IWTMYQ32.js → chunk-BR6TUEKJ.js} +9 -8
  59. package/chunks/{chunk-Q3JQ7OSU.js → chunk-BTYS2JAY.js} +1 -1
  60. package/chunks/{chunk-H6XPXXMH.js → chunk-CQ35AJ4Z.js} +252 -254
  61. package/chunks/{chunk-COBO5EBO.js → chunk-CTQE2NB2.js} +1 -1
  62. package/chunks/{chunk-P3BJLFSZ.js → chunk-DEKY5Y7V.js} +3 -3
  63. package/chunks/{chunk-Y3OVRWRY.js → chunk-DM4C3OX5.js} +1 -1
  64. package/chunks/{chunk-YWPSGJFI.js → chunk-DSKLWQHC.js} +2 -2
  65. package/chunks/{chunk-KKBPOU75.js → chunk-EFIMD5VA.js} +1 -1
  66. package/chunks/{chunk-CTJLZLB5.js → chunk-EN2J77G7.js} +1 -1
  67. package/chunks/{chunk-67EWJE77.js → chunk-ENEEQMGM.js} +1 -1
  68. package/chunks/{chunk-AEL7KN2O.js → chunk-EOBM4T2Z.js} +1 -1
  69. package/chunks/{chunk-NDU63YLI.js → chunk-ESVSQKPY.js} +4 -4
  70. package/chunks/{chunk-CPG6P4GG.js → chunk-EYS3GGM3.js} +1 -1
  71. package/chunks/{chunk-4PYCZH2V.js → chunk-EYW54TBD.js} +3 -3
  72. package/chunks/{chunk-EBZ6BJTF.js → chunk-F4T5J34H.js} +1 -1
  73. package/chunks/{chunk-FOGU3LJX.js → chunk-F6AOBFUN.js} +1 -1
  74. package/chunks/{chunk-ZBVS26BY.js → chunk-FPGTNKCP.js} +7 -5
  75. package/chunks/{chunk-YF5MALI4.js → chunk-G64M7R2Y.js} +5 -5
  76. package/chunks/{chunk-EI3HZX6C.js → chunk-GJJQV4PY.js} +1 -1
  77. package/chunks/{chunk-CKASRHZI.js → chunk-GLWWPFTW.js} +1 -1
  78. package/chunks/{chunk-GM463R2B.js → chunk-GZGDJ4E6.js} +1 -1
  79. package/chunks/{chunk-W5UC37EE.js → chunk-HHGQGTJQ.js} +2 -0
  80. package/chunks/chunk-HHJLM3WQ.js +41 -0
  81. package/chunks/{chunk-ZRBMO3C7.js → chunk-HMCSRTDY.js} +1 -1
  82. package/chunks/{chunk-L2AFWWJE.js → chunk-HUE2M6VI.js} +50 -5
  83. package/chunks/{chunk-LLCWZQCU.js → chunk-HZV75ET2.js} +3 -3
  84. package/chunks/{chunk-6ZRFAKXK.js → chunk-IEP44U2R.js} +1 -1
  85. package/chunks/{chunk-AOHJKPKL.js → chunk-IQFYO5BF.js} +1 -1
  86. package/chunks/{chunk-UDXSXLER.js → chunk-IW6RQPQB.js} +14 -4
  87. package/chunks/{chunk-XCWO3SMQ.js → chunk-IX7CFQGA.js} +3 -3
  88. package/chunks/{chunk-O3EU6GMH.js → chunk-J4EVBAB3.js} +27 -4
  89. package/chunks/{chunk-ZZCWJWTF.js → chunk-JHMFKJEP.js} +1 -1
  90. package/chunks/{chunk-XVHYA33G.js → chunk-JKEO6OQY.js} +4 -4
  91. package/chunks/{chunk-6Q5ABMTU.js → chunk-JLYYGKRN.js} +23 -19
  92. package/chunks/{chunk-KID7K6H2.js → chunk-JOXXPM3X.js} +6 -6
  93. package/chunks/{chunk-E2FPSSKP.js → chunk-JPA7IDTE.js} +57 -13
  94. package/chunks/{chunk-OQTXYMKW.js → chunk-JS4Q5NG5.js} +3 -3
  95. package/chunks/{chunk-PBRVUF5B.js → chunk-K7JW6V5O.js} +1 -1
  96. package/chunks/{chunk-3P2LV43B.js → chunk-KCCODSAA.js} +3 -3
  97. package/chunks/{chunk-DREZZAZM.js → chunk-KCDQGIHS.js} +13 -5
  98. package/chunks/{chunk-UEOKWYGY.js → chunk-KFCTC5IJ.js} +11 -11
  99. package/chunks/{chunk-M6HMMKVG.js → chunk-KPVVWKF3.js} +1 -1
  100. package/chunks/{chunk-MVUQRLOH.js → chunk-KT4OWAAZ.js} +3 -3
  101. package/chunks/{chunk-W4RQUHY3.js → chunk-L2GTEEEU.js} +142 -23
  102. package/chunks/{chunk-Q3AL4JQ3.js → chunk-LA3FF7RO.js} +2 -2
  103. package/chunks/{chunk-DX3RGJMS.js → chunk-LT532KF4.js} +71 -12
  104. package/chunks/{chunk-JT7XS4YW.js → chunk-M2NMFAFR.js} +1 -1
  105. package/chunks/{chunk-YTFDX4PR.js → chunk-M6NDLY2T.js} +1 -1
  106. package/chunks/{chunk-MIKXJYZB.js → chunk-MCHGE3EC.js} +305 -291
  107. package/chunks/{chunk-Y4R47ZUH.js → chunk-MDQSCFAZ.js} +7 -7
  108. package/chunks/{chunk-EKPKKXY2.js → chunk-MLZCPGDX.js} +1 -1
  109. package/chunks/{chunk-OIVKILPI.js → chunk-MPBRV3UU.js} +3 -0
  110. package/chunks/{chunk-VFMASYQA.js → chunk-MS7GNABG.js} +3 -0
  111. package/chunks/{chunk-2FRY5CRX.js → chunk-MWZYNOCG.js} +3 -3
  112. package/chunks/{chunk-ONSZH6VM.js → chunk-MZQ4I4AP.js} +2 -2
  113. package/chunks/{chunk-UMD7WQTR.js → chunk-N3ZWGKXN.js} +10 -8
  114. package/chunks/{chunk-7MH4J33A.js → chunk-N7NBMAMW.js} +2 -2
  115. package/chunks/{chunk-EUNWC2VS.js → chunk-NC4O6UE6.js} +2 -2
  116. package/chunks/{chunk-A7XMDZRI.js → chunk-NFSSQDB5.js} +5 -5
  117. package/chunks/{chunk-DCZEPFB4.js → chunk-NM3E6GGL.js} +3 -3
  118. package/chunks/{chunk-26CXSA6V.js → chunk-NQPYPDOY.js} +2 -2
  119. package/chunks/{chunk-HUWENAHO.js → chunk-NWPO6I7V.js} +1 -1
  120. package/chunks/{chunk-SR7RZ4MS.js → chunk-O4BBDP2G.js} +2 -2
  121. package/chunks/{chunk-ECWR5LQR.js → chunk-OC5SKSNX.js} +3 -3
  122. package/chunks/{chunk-VWKER4ZH.js → chunk-OGQERNHD.js} +3 -3
  123. package/chunks/{chunk-DA4HRSBW.js → chunk-OPBATTFQ.js} +1 -1
  124. package/chunks/{chunk-OONWZLFK.js → chunk-P7KCJGBR.js} +4 -4
  125. package/chunks/{chunk-OJUQF2PL.js → chunk-PBYVS6QT.js} +3 -3
  126. package/chunks/{chunk-VNNWAZSI.js → chunk-QG2IEE2E.js} +3 -3
  127. package/chunks/{chunk-KZ22NXBY.js → chunk-QGZN4RYB.js} +4 -4
  128. package/chunks/{chunk-2UUMVNYT.js → chunk-QTI7SRXI.js} +3 -3
  129. package/chunks/{chunk-B2GJNDTV.js → chunk-QUESTNOP.js} +1 -1
  130. package/chunks/{chunk-AAE6SR4Q.js → chunk-RUKNJEJO.js} +1 -1
  131. package/chunks/{chunk-NV65ZUVM.js → chunk-RUVZZKDH.js} +1 -1
  132. package/chunks/{chunk-QUI267ZP.js → chunk-SAQHDAUJ.js} +42 -8
  133. package/chunks/{chunk-4MKXUHXY.js → chunk-SUTP6CZA.js} +5 -5
  134. package/chunks/{chunk-UBX6NL47.js → chunk-T4576UW4.js} +3 -3
  135. package/chunks/{chunk-TZEZYNYD.js → chunk-T4FTABSW.js} +1 -1
  136. package/chunks/{chunk-SEZ556DZ.js → chunk-T6W4KACQ.js} +1 -1
  137. package/chunks/chunk-TKAEODJR.js +1279 -0
  138. package/chunks/{chunk-NV3F44FL.js → chunk-TNQLAI6I.js} +2 -2
  139. package/chunks/{chunk-F6WDTQ3M.js → chunk-TNS2M7VL.js} +5 -5
  140. package/chunks/{chunk-7GTMV7UE.js → chunk-TTB6GBJ6.js} +8323 -2227
  141. package/chunks/{chunk-YGT2AUJ7.js → chunk-U2JLICUY.js} +33 -16
  142. package/chunks/{chunk-NEOXOWYH.js → chunk-U7QUDFPD.js} +7 -7
  143. package/chunks/{chunk-QGNOFE5E.js → chunk-UEUE6LJX.js} +1 -1
  144. package/chunks/{chunk-EI3NWELG.js → chunk-UIZGNLBP.js} +4427 -3806
  145. package/chunks/{chunk-ZJ4W6SUY.js → chunk-UM57UTTV.js} +3 -3
  146. package/chunks/{chunk-EQL65XGA.js → chunk-V3LXMASR.js} +47 -21
  147. package/chunks/{chunk-LHEC5V6G.js → chunk-VRWOMUZM.js} +2 -2
  148. package/chunks/{chunk-5MZCSWI4.js → chunk-W2ITCESM.js} +176 -477
  149. package/chunks/{chunk-KONVMRK7.js → chunk-W2PNY24B.js} +1 -1
  150. package/chunks/{chunk-4WL6SY4F.js → chunk-X5GLCWPX.js} +1 -1
  151. package/chunks/{chunk-BSI645OU.js → chunk-XBLYC4MI.js} +3 -3
  152. package/chunks/{chunk-GNPNYXJB.js → chunk-XLQS3VI6.js} +2 -2
  153. package/chunks/{chunk-TRRF5BSP.js → chunk-XT6TGJFD.js} +1 -1
  154. package/chunks/{chunk-PYQADEFD.js → chunk-XTH2OMDS.js} +1 -1
  155. package/chunks/{chunk-47PEPJO7.js → chunk-XUMBOJC2.js} +3 -3
  156. package/chunks/{chunk-GWVUR3QZ.js → chunk-YIKMBYMT.js} +3 -3
  157. package/chunks/{chunk-WOJZWRAZ.js → chunk-YRLW2MSX.js} +1 -1
  158. package/chunks/{chunk-NRLFZWCT.js → chunk-YVVIFFU4.js} +3 -3
  159. package/chunks/chunk-Z7B6SRPM.js +32 -0
  160. package/chunks/{chunk-IA7TGCN2.js → chunk-ZV4XVYL3.js} +4 -4
  161. package/chunks/{chunk-PJRW65JO.js → chunk-ZWPWQEF5.js} +1 -1
  162. package/chunks/{computer-use-WQFK33Z3.js → computer-use-7TIKEXBX.js} +42 -41
  163. package/chunks/{config-utils-ULCSRMWD.js → config-utils-6MVJ54TY.js} +6 -6
  164. package/chunks/{contextCommand-7EOZND7C.js → contextCommand-5QKI7MRY.js} +44 -43
  165. package/chunks/{core-runtime-FGMQRM6E.js → core-runtime-USS7ZF3H.js} +42 -41
  166. package/chunks/{create-sub-session-QIDZUOPU.js → create-sub-session-Y4WYDZGC.js} +2 -2
  167. package/chunks/{create-sub-session-QM2K5HLZ.js → create-sub-session-ZD2F3BH2.js} +42 -41
  168. package/chunks/{cron-create-VONA5JYY.js → cron-create-ZOVA3CC2.js} +4 -4
  169. package/chunks/{cron-delete-5JXSP2MI.js → cron-delete-7Z3H4LJY.js} +4 -4
  170. package/chunks/{cron-list-KE4F2CIR.js → cron-list-UHGX3IQG.js} +4 -4
  171. package/chunks/{daemon-GWD7BT6E.js → daemon-Y3NOHFKQ.js} +38 -7
  172. package/chunks/daemon-status-provider-PMP4J7BC.js +103 -0
  173. package/chunks/daemon-trust-policy-2252VKXI.js +99 -0
  174. package/chunks/{daemon-trust-policy-monitor-6UKEABN5.js → daemon-trust-policy-monitor-OSGGKJXT.js} +49 -48
  175. package/chunks/{de-LIW4XVLN.js → de-UBEBKG6V.js} +2 -1
  176. package/chunks/{deferred-core-runtime-67GJXHXS.js → deferred-core-runtime-3VD4V6YZ.js} +42 -41
  177. package/chunks/{display-image-NQRSIBXM.js → display-image-ZE3GZNIK.js} +4 -4
  178. package/chunks/{dist-Z3CS4OVP.js → dist-AVUYBK7L.js} +11 -5
  179. package/chunks/{dist-6BMOAE3Z.js → dist-BNWP6IZL.js} +4 -4
  180. package/chunks/{dist-3NTTUAHT.js → dist-EFJILGIS.js} +3 -3
  181. package/chunks/{dist-EZE3V3Q7.js → dist-MAIUUIWN.js} +3 -3
  182. package/chunks/{dist-B2CGTW6T.js → dist-NPS52B2V.js} +3 -3
  183. package/chunks/{dist-J47AXBZC.js → dist-PKSRQAR2.js} +3 -3
  184. package/chunks/{dist-OTUO3AS2.js → dist-Q2WJ2IZU.js} +13 -5
  185. package/chunks/{dist-EWW3J4HQ.js → dist-ZWDH5HLS.js} +3 -3
  186. package/chunks/{earlyInputCapture-IWMYR6OB.js → earlyInputCapture-ER4HGLJN.js} +43 -42
  187. package/chunks/{edit-ZFGROCAF.js → edit-B3MT7O53.js} +42 -41
  188. package/chunks/{en-SY5GTIGX.js → en-X6YV7GME.js} +2 -1
  189. package/chunks/{enter-worktree-TZZZCDM5.js → enter-worktree-WVIYVSDJ.js} +42 -41
  190. package/chunks/{enterPlanMode-U77BI3R6.js → enterPlanMode-DDCIM6HA.js} +42 -41
  191. package/chunks/{environment-HC37DS2I.js → environment-LITGMOUP.js} +45 -44
  192. package/chunks/{errors-6AG54JPD.js → errors-E5CIOR2I.js} +44 -43
  193. package/chunks/{exit-worktree-UYYWFPNK.js → exit-worktree-NQ2A6URE.js} +42 -41
  194. package/chunks/exitPlanMode-YXSWN4D3.js +85 -0
  195. package/chunks/{fast-path-F5FSZ3O7.js → fast-path-PH3DBS6X.js} +3 -3
  196. package/chunks/{fast-path-settings-RPAVBD7P.js → fast-path-settings-LNOFM2YP.js} +2 -2
  197. package/chunks/{fr-RQFO7U4P.js → fr-VENTC2BS.js} +2 -1
  198. package/chunks/{gemini-NKQHYM36.js → gemini-4YPO4ADY.js} +88 -87
  199. package/chunks/{geminiContentGenerator-HCWZOUX3.js → geminiContentGenerator-GMSVVXOU.js} +6 -6
  200. package/chunks/{glob-3PDXKBAO.js → glob-3Y3VHLM2.js} +42 -41
  201. package/chunks/{goal-tools-SWNB6GP4.js → goal-tools-JDK2SNMV.js} +4 -4
  202. package/chunks/{grep-5HZKZYVD.js → grep-VUHUDZYG.js} +42 -41
  203. package/chunks/handleAutoUpdate-OBFFPWSJ.js +94 -0
  204. package/chunks/{i18n-Q27KKNDL.js → i18n-4PJA5KKU.js} +43 -42
  205. package/chunks/{image-gen-2Z2RJ6W7.js → image-gen-4IFV4HES.js} +10 -10
  206. package/chunks/initializer-ZTY3VSWL.js +100 -0
  207. package/chunks/{installationInfo-XXB75T7O.js → installationInfo-6USRNCD2.js} +43 -42
  208. package/chunks/{ja-KOZKHJHZ.js → ja-QHT4EQTO.js} +2 -1
  209. package/chunks/{keychain-token-storage-TVAMTNP7.js → keychain-token-storage-JTWUYFU7.js} +2 -2
  210. package/chunks/list-U2ZDKYWN.js +103 -0
  211. package/chunks/{list-agents-Z4WABFDZ.js → list-agents-4GQ2XNEU.js} +2 -2
  212. package/chunks/loadedSettingsAdapter-WW4HIVLO.js +97 -0
  213. package/chunks/{loggingContentGenerator-6NTFBM7Q.js → loggingContentGenerator-XXG6YWUE.js} +46 -27
  214. package/chunks/{loop-wakeup-UZ5RL5Y2.js → loop-wakeup-HOQI3K5D.js} +5 -5
  215. package/chunks/{ls-TVHDGIES.js → ls-O4VBQRG7.js} +4 -4
  216. package/chunks/{lsp-CVN6OQPI.js → lsp-APQJ5ZEZ.js} +2 -2
  217. package/chunks/{managed-npm-update-SPHYQUWZ.js → managed-npm-update-7GM2LPLL.js} +43 -42
  218. package/chunks/mcp-7KZW2T5P.js +97 -0
  219. package/chunks/{monitor-ZBBPAA54.js → monitor-RQROQHLD.js} +42 -41
  220. package/chunks/nonInteractiveCli-U7JNJGS6.js +163 -0
  221. package/chunks/{notebook-edit-5W3FW7Z2.js → notebook-edit-XQA6YCH2.js} +42 -41
  222. package/chunks/{openaiContentGenerator-TQANPEVZ.js → openaiContentGenerator-BZW2IB42.js} +29 -29
  223. package/chunks/{pidfile-EQOBLH4E.js → pidfile-NX5VZ3IK.js} +43 -42
  224. package/chunks/{processUtils-7XQG7EHS.js → processUtils-M635AD23.js} +2 -2
  225. package/chunks/{pt-U6AOCTMF.js → pt-VL3I5RNY.js} +2 -1
  226. package/chunks/{qwenContentGenerator-BKCPHHXU.js → qwenContentGenerator-KHJ73E2C.js} +48 -48
  227. package/chunks/{qwenOAuth2-BJ6PQKE6.js → qwenOAuth2-QMK25XO7.js} +9 -9
  228. package/chunks/read-file-6LKIKKXD.js +32 -0
  229. package/chunks/{read-mcp-resource-PZ4ZF6YL.js → read-mcp-resource-TJSJRH4F.js} +2 -2
  230. package/chunks/{record-artifact-P4HFMS7X.js → record-artifact-FXF5LHPE.js} +3 -3
  231. package/chunks/{resumeHistoryUtils-6N6XGJJW.js → resumeHistoryUtils-RR2KEVH5.js} +49 -48
  232. package/chunks/ripGrep-CF2WRBYV.js +85 -0
  233. package/chunks/{ru-CMX4UMYP.js → ru-4RCKL4PY.js} +2 -1
  234. package/chunks/{run-qwen-serve-BCKBCAMX.js → run-qwen-serve-L5TF57J4.js} +61 -50
  235. package/chunks/{runtime-E2437YKL.js → runtime-3RE3BPR4.js} +55 -54
  236. package/chunks/{scheduler-K3D5Z655.js → scheduler-LXQZAMYT.js} +44 -43
  237. package/chunks/{sdk-exporters-http-XVTZQRCE.js → sdk-exporters-http-7SYSCGEO.js} +3 -3
  238. package/chunks/{sdk-impl-7W7AKCS4.js → sdk-impl-VZI6M6EH.js} +6 -6
  239. package/chunks/{send-message-CAMSLG2L.js → send-message-RBYLV5NY.js} +6 -6
  240. package/chunks/{serve-IH4XR5IL.js → serve-5D4S7GIA.js} +49 -48
  241. package/chunks/{server-UD6INW7J.js → server-ILZB6TTC.js} +403 -178
  242. package/chunks/{session-GR4ZEVW4.js → session-SXCZITZ4.js} +114 -94
  243. package/chunks/{settings-5O24D3OJ.js → settings-4RQB3OVF.js} +48 -47
  244. package/chunks/{shell-UTLWLG5G.js → shell-FCTR3OI2.js} +42 -41
  245. package/chunks/{skill-QQAZL4VO.js → skill-IAKHPD5H.js} +19 -19
  246. package/chunks/{skill-settings-P3YHJVBZ.js → skill-settings-SOR23NOP.js} +48 -47
  247. package/chunks/spawnChannel-I6VAWYQJ.js +98 -0
  248. package/chunks/{standalone-update-QP742MGP.js → standalone-update-5NN3MTYH.js} +44 -43
  249. package/chunks/{startInteractiveUI-YCS6AEPN.js → startInteractiveUI-OYGL3NZJ.js} +590 -329
  250. package/chunks/{syntheticOutput-PEBJQYJV.js → syntheticOutput-D3Z64LJC.js} +3 -3
  251. package/chunks/{task-create-5NWCQSJF.js → task-create-URFZ5EUX.js} +10 -10
  252. package/chunks/{task-list-53265TRZ.js → task-list-6JDFMPUW.js} +5 -5
  253. package/chunks/{task-stop-FPCOIRYX.js → task-stop-HHUGCD25.js} +2 -2
  254. package/chunks/{task-update-5HN577LS.js → task-update-LCJM3EYG.js} +10 -10
  255. package/chunks/{team-create-WFH7OCDQ.js → team-create-J4JP6AXN.js} +44 -43
  256. package/chunks/{team-delete-MMQB4OSC.js → team-delete-PZGGBQLM.js} +5 -5
  257. package/chunks/{team-plan-approval-EGTT53MV.js → team-plan-approval-7BEAIR2H.js} +42 -41
  258. package/chunks/{terminal-image-renderer-BWRESAQ7.js → terminal-image-renderer-SGGTG5LN.js} +44 -43
  259. package/chunks/theme-manager-67TSB7LH.js +89 -0
  260. package/chunks/{todoWrite-JGV6VLOX.js → todoWrite-WINAZSZI.js} +4 -4
  261. package/chunks/{tool-search-TI5PTIBF.js → tool-search-XPOFDWOX.js} +19 -19
  262. package/chunks/{total-session-admission-66UDSOHO.js → total-session-admission-SZJFAM25.js} +47 -46
  263. package/chunks/{trustedFolders-4KYHA4IG.js → trustedFolders-44NTYYV4.js} +43 -42
  264. package/chunks/{update-relaunch-WB6LGIF2.js → update-relaunch-K33Q3WEH.js} +5 -5
  265. package/chunks/{updateCheck-LOS5GYFC.js → updateCheck-VBRNPLS4.js} +45 -44
  266. package/chunks/{useAutoAcceptIndicator-MHAPY52L.js → useAutoAcceptIndicator-AUNRB5S7.js} +52 -51
  267. package/chunks/{validateNonInterActiveAuth-QV22HNQU.js → validateNonInterActiveAuth-WTO36MTA.js} +83 -82
  268. package/chunks/{version-DALWZHKQ.js → version-JZA6HYPI.js} +1 -1
  269. package/chunks/{web-fetch-JMJVMYFE.js → web-fetch-LLHPV2IR.js} +19 -19
  270. package/chunks/{web-search-DNDUIPU5.js → web-search-4HCHRZ3U.js} +11 -11
  271. package/chunks/{workflow-JGNN64PM.js → workflow-YI74QTWW.js} +43 -42
  272. package/chunks/workspace-providers-status-CI3AO2BH.js +100 -0
  273. package/chunks/{workspace-registration-store-LRJG7QA4.js → workspace-registration-store-KPIKXDHA.js} +1 -1
  274. package/chunks/{workspace-registry-KVXIFM36.js → workspace-registry-XE22QDE6.js} +47 -46
  275. package/chunks/{workspace-service-PO4AAKKT.js → workspace-service-WI2FD72A.js} +54 -53
  276. package/chunks/workspace-skills-status-FFZU6FXL.js +100 -0
  277. package/chunks/{workspace-trust-reconciler-DOZPCVHG.js → workspace-trust-reconciler-GJLNXR2U.js} +54 -53
  278. package/chunks/write-file-IEAC3XC3.js +87 -0
  279. package/chunks/{zh-AGL2FVBI.js → zh-LMSTK4WD.js} +2 -1
  280. package/chunks/{zh-TW-KI66MHQY.js → zh-TW-SQ4HTSCW.js} +2 -1
  281. package/chunks/{zoom-image-CNC77ZMA.js → zoom-image-GTVVT25J.js} +15 -15
  282. package/cli.js +13 -13
  283. package/locales/ca.js +1 -0
  284. package/locales/de.js +1 -0
  285. package/locales/en.js +1 -0
  286. package/locales/fr.js +1 -0
  287. package/locales/ja.js +1 -0
  288. package/locales/pt.js +1 -0
  289. package/locales/ru.js +1 -0
  290. package/locales/zh-TW.js +1 -0
  291. package/locales/zh.js +1 -0
  292. package/package.json +3 -3
  293. package/web-shell/assets/{arc-CDk0d60K.js → arc-B13-S0Yo.js} +1 -1
  294. package/web-shell/assets/{architectureDiagram-3BPJPVTR-h-W3I2lP.js → architectureDiagram-3BPJPVTR-CHvWNlVW.js} +1 -1
  295. package/web-shell/assets/{blockDiagram-GPEHLZMM-D1pvSmZg.js → blockDiagram-GPEHLZMM-CXebOlXF.js} +1 -1
  296. package/web-shell/assets/{c4Diagram-AAUBKEIU-ByAm5ZNf.js → c4Diagram-AAUBKEIU-BQpx4y3Q.js} +1 -1
  297. package/web-shell/assets/channel-BB_Hm8Rf.js +1 -0
  298. package/web-shell/assets/{chunk-2J33WTMH-VrGPPOGV.js → chunk-2J33WTMH-Cak1exSv.js} +1 -1
  299. package/web-shell/assets/{chunk-4BX2VUAB-B7hTowgG.js → chunk-4BX2VUAB-BIc8BV5_.js} +1 -1
  300. package/web-shell/assets/{chunk-55IACEB6-j1Fq8DpE.js → chunk-55IACEB6-DoeJ5BL1.js} +1 -1
  301. package/web-shell/assets/{chunk-727SXJPM-UjABYpF2.js → chunk-727SXJPM-BDR_wYSu.js} +1 -1
  302. package/web-shell/assets/{chunk-AQP2D5EJ-D4uBItrs.js → chunk-AQP2D5EJ-BhRRGRq1.js} +1 -1
  303. package/web-shell/assets/{chunk-FMBD7UC4-DeFbKlb8.js → chunk-FMBD7UC4-BJGAwVXr.js} +1 -1
  304. package/web-shell/assets/{chunk-ND2GUHAM-rQJ8TIgT.js → chunk-ND2GUHAM-vhE73bsD.js} +1 -1
  305. package/web-shell/assets/{chunk-QZHKN3VN-DAGcRxvq.js → chunk-QZHKN3VN-BuTBZsdR.js} +1 -1
  306. package/web-shell/assets/classDiagram-4FO5ZUOK-B_hFK54Y.js +1 -0
  307. package/web-shell/assets/classDiagram-v2-Q7XG4LA2-B_hFK54Y.js +1 -0
  308. package/web-shell/assets/{cose-bilkent-S5V4N54A-MaE7MJSt.js → cose-bilkent-S5V4N54A-CVHKipHP.js} +1 -1
  309. package/web-shell/assets/{dagre-BM42HDAG-DzijYGSb.js → dagre-BM42HDAG-C1DPa8SV.js} +1 -1
  310. package/web-shell/assets/{diagram-2AECGRRQ-WdbG7WnX.js → diagram-2AECGRRQ-BYP_QxkT.js} +1 -1
  311. package/web-shell/assets/{diagram-5GNKFQAL-NYutsBnw.js → diagram-5GNKFQAL-Cray7ruQ.js} +1 -1
  312. package/web-shell/assets/{diagram-KO2AKTUF-Dqg0eBY0.js → diagram-KO2AKTUF-Ds4vJANi.js} +1 -1
  313. package/web-shell/assets/{diagram-LMA3HP47-C7vRP2Lb.js → diagram-LMA3HP47-DxFrDykH.js} +1 -1
  314. package/web-shell/assets/{diagram-OG6HWLK6-B2sEPpPt.js → diagram-OG6HWLK6-BdIO-pF_.js} +1 -1
  315. package/web-shell/assets/{erDiagram-TEJ5UH35-a4zIbzm8.js → erDiagram-TEJ5UH35-5JA8KDYV.js} +1 -1
  316. package/web-shell/assets/{flowDiagram-I6XJVG4X-BK9y89ya.js → flowDiagram-I6XJVG4X-DL4drKro.js} +1 -1
  317. package/web-shell/assets/{ganttDiagram-6RSMTGT7-wUQTSNvV.js → ganttDiagram-6RSMTGT7-ijX2DD6_.js} +1 -1
  318. package/web-shell/assets/{gitGraphDiagram-PVQCEYII-Dnzt4SAi.js → gitGraphDiagram-PVQCEYII-_lPsFLFF.js} +1 -1
  319. package/web-shell/assets/index-BTwNYZkp.js +1785 -0
  320. package/web-shell/assets/{index-BA3wUcKL.js → index-C-YoqYbs.js} +1 -1
  321. package/web-shell/assets/index-dHAFxPHb.css +5 -0
  322. package/web-shell/assets/{infoDiagram-5YYISTIA-DcaoToij.js → infoDiagram-5YYISTIA-COFClLab.js} +1 -1
  323. package/web-shell/assets/{ishikawaDiagram-YF4QCWOH-DzduqhP2.js → ishikawaDiagram-YF4QCWOH-Div9KOgO.js} +1 -1
  324. package/web-shell/assets/{journeyDiagram-JHISSGLW-BvviZR_O.js → journeyDiagram-JHISSGLW-VAw5u0wc.js} +1 -1
  325. package/web-shell/assets/{kanban-definition-UN3LZRKU-Efm2JxY3.js → kanban-definition-UN3LZRKU-CncCn8Nl.js} +1 -1
  326. package/web-shell/assets/{linear-DtY3IbOs.js → linear-D6ad7e_k.js} +1 -1
  327. package/web-shell/assets/{mermaid.core-PzpFqoMe.js → mermaid.core-BV1IECGb.js} +5 -5
  328. package/web-shell/assets/{mindmap-definition-RKZ34NQL-BLlTkHS0.js → mindmap-definition-RKZ34NQL-a3jeNgPr.js} +1 -1
  329. package/web-shell/assets/{pieDiagram-4H26LBE5-D-mKF-jE.js → pieDiagram-4H26LBE5-DsVRY5BW.js} +1 -1
  330. package/web-shell/assets/{quadrantDiagram-W4KKPZXB-DYCzslGm.js → quadrantDiagram-W4KKPZXB-D6zgexJK.js} +1 -1
  331. package/web-shell/assets/{requirementDiagram-4Y6WPE33-Dfpxlk7R.js → requirementDiagram-4Y6WPE33-VEpSwJjn.js} +1 -1
  332. package/web-shell/assets/{sankeyDiagram-5OEKKPKP-D5cRaaxh.js → sankeyDiagram-5OEKKPKP-CYEuOFne.js} +1 -1
  333. package/web-shell/assets/{sequenceDiagram-3UESZ5HK-s04DReiS.js → sequenceDiagram-3UESZ5HK-CCg0lI-9.js} +1 -1
  334. package/web-shell/assets/{stateDiagram-AJRCARHV-01UNFgnb.js → stateDiagram-AJRCARHV-BHXPsL0B.js} +1 -1
  335. package/web-shell/assets/stateDiagram-v2-BHNVJYJU-eTG8D0QT.js +1 -0
  336. package/web-shell/assets/{timeline-definition-PNZ67QCA-DX8_wZBC.js → timeline-definition-PNZ67QCA-gqTf9a0k.js} +1 -1
  337. package/web-shell/assets/{vennDiagram-CIIHVFJN-BK0FlBme.js → vennDiagram-CIIHVFJN-C4DXXkBh.js} +1 -1
  338. package/web-shell/assets/{wardley-L42UT6IY-DkPc9UlD.js → wardley-L42UT6IY-CMK46EiX.js} +1 -1
  339. package/web-shell/assets/{wardleyDiagram-YWT4CUSO-DNKkpDAo.js → wardleyDiagram-YWT4CUSO-DTk1Gzt9.js} +1 -1
  340. package/web-shell/assets/{xychartDiagram-2RQKCTM6-CiPwg8QG.js → xychartDiagram-2RQKCTM6-BcJsM1dH.js} +1 -1
  341. package/web-shell/index.html +2 -2
  342. package/chunks/agent-headless-HYEHZFH6.js +0 -86
  343. package/chunks/channel-settings-store-OXYG5S5X.js +0 -101
  344. package/chunks/chunk-I5VM3SKY.js +0 -451
  345. package/chunks/chunk-PDPFQ2FO.js +0 -156
  346. package/chunks/daemon-status-provider-L3J6GKCT.js +0 -102
  347. package/chunks/daemon-trust-policy-4PHPY23S.js +0 -98
  348. package/chunks/exitPlanMode-RWJR2KGB.js +0 -84
  349. package/chunks/handleAutoUpdate-NHFSGYTF.js +0 -93
  350. package/chunks/initializer-Y5DJLT43.js +0 -99
  351. package/chunks/list-YHNQ32CS.js +0 -102
  352. package/chunks/loadedSettingsAdapter-GHUQK7H4.js +0 -96
  353. package/chunks/mcp-EA3KO6FS.js +0 -96
  354. package/chunks/nonInteractiveCli-NNOR56HU.js +0 -162
  355. package/chunks/read-file-KKTXGIZD.js +0 -32
  356. package/chunks/ripGrep-SJVAAYDV.js +0 -84
  357. package/chunks/spawnChannel-UAQMH6Y6.js +0 -94
  358. package/chunks/theme-manager-ZNDGAHJN.js +0 -88
  359. package/chunks/workspace-providers-status-K22B3Z6B.js +0 -99
  360. package/chunks/workspace-skills-status-DDYCBVSH.js +0 -99
  361. package/chunks/write-file-TT6MWIKC.js +0 -86
  362. package/web-shell/assets/channel-DPFUV4oi.js +0 -1
  363. package/web-shell/assets/classDiagram-4FO5ZUOK-CLm0hVvw.js +0 -1
  364. package/web-shell/assets/classDiagram-v2-Q7XG4LA2-CLm0hVvw.js +0 -1
  365. package/web-shell/assets/index-BjC3yjjL.css +0 -5
  366. package/web-shell/assets/index-QzFq6w7o.js +0 -1775
  367. package/web-shell/assets/stateDiagram-v2-BHNVJYJU-DXb5olqv.js +0 -1
@@ -13,17 +13,17 @@ import {
13
13
  matchMcpServerByRef,
14
14
  parseExtensionRef,
15
15
  parseMcpServerRef
16
- } from "./chunk-NDU63YLI.js";
16
+ } from "./chunk-ESVSQKPY.js";
17
17
  import {
18
18
  getAvailableCommands,
19
19
  handleSlashCommand,
20
20
  insertAfterFunctionResponses,
21
21
  isSlashCommand,
22
22
  normalizePartList
23
- } from "./chunk-MIKXJYZB.js";
23
+ } from "./chunk-MCHGE3EC.js";
24
24
  import {
25
25
  recomputeMcpGating
26
- } from "./chunk-4MKXUHXY.js";
26
+ } from "./chunk-SUTP6CZA.js";
27
27
  import {
28
28
  SessionIdConflictError,
29
29
  appEvents,
@@ -31,40 +31,43 @@ import {
31
31
  cleanupReviewWorktreeLeases,
32
32
  loadCliConfig,
33
33
  normalizeDisabledToolList
34
- } from "./chunk-7GTMV7UE.js";
34
+ } from "./chunk-TTB6GBJ6.js";
35
35
  import {
36
36
  getCommandSubcommandNames
37
- } from "./chunk-QG3FFJYU.js";
37
+ } from "./chunk-AAOONL5N.js";
38
38
  import {
39
39
  getEffectiveSupportedModes
40
- } from "./chunk-YWPSGJFI.js";
40
+ } from "./chunk-DSKLWQHC.js";
41
41
  import "./chunk-NYX53SV4.js";
42
- import "./chunk-NV3F44FL.js";
42
+ import "./chunk-TNQLAI6I.js";
43
43
  import {
44
44
  collectContextData,
45
45
  formatContextUsageText
46
- } from "./chunk-F6WDTQ3M.js";
46
+ } from "./chunk-TNS2M7VL.js";
47
47
  import "./chunk-4WGODMVR.js";
48
48
  import {
49
49
  startNonInteractiveOpenAILogHousekeeping
50
- } from "./chunk-KZ22NXBY.js";
50
+ } from "./chunk-QGZN4RYB.js";
51
51
  import "./chunk-KW7NOTN6.js";
52
- import "./chunk-CTJLZLB5.js";
53
- import "./chunk-IRZ2ZH72.js";
54
- import "./chunk-URKIBIFC.js";
52
+ import "./chunk-EN2J77G7.js";
53
+ import "./chunk-4EX3DBFH.js";
54
+ import {
55
+ isGoalStatusKind
56
+ } from "./chunk-EKTCKZV5.js";
57
+ import "./chunk-45HPDU3F.js";
55
58
  import "./chunk-YAF2MQZ6.js";
56
59
  import {
57
60
  computeCpuPercent
58
61
  } from "./chunk-LBOVL47Y.js";
59
- import "./chunk-YF5MALI4.js";
62
+ import "./chunk-G64M7R2Y.js";
60
63
  import "./chunk-6H67XLET.js";
61
64
  import {
62
65
  beginAcpBootstrapConfigProfiling,
63
66
  buildAndFreezeAcpStartupProfile,
64
67
  endAcpBootstrapConfigProfiling,
65
68
  markAcpStartup
66
- } from "./chunk-JT7XS4YW.js";
67
- import "./chunk-DCZEPFB4.js";
69
+ } from "./chunk-M2NMFAFR.js";
70
+ import "./chunk-NM3E6GGL.js";
68
71
  import {
69
72
  GENERATION_MAX_PROMPT_BYTES,
70
73
  GENERATION_TIMEOUT_MS,
@@ -86,25 +89,21 @@ import {
86
89
  shouldSuppressRememberErrorDetails,
87
90
  workspaceMemoryFailureCode,
88
91
  workspaceMemoryFailureDiagnostics
89
- } from "./chunk-6LP743KE.js";
92
+ } from "./chunk-2R2HYSUQ.js";
90
93
  import {
94
+ BaseEmitter,
91
95
  HistoryReplayer,
92
- MessageEmitter,
93
96
  PlanEmitter,
94
97
  ToolCallEmitter,
95
- collectGoalStatusItemsFromRecords,
96
- goalTerminalEventToHistoryItem,
97
- recordGoalStatusItem,
98
- restoreGoalFromHistory
99
- } from "./chunk-5MZCSWI4.js";
100
- import "./chunk-OWMAZHIX.js";
101
- import "./chunk-ZRBMO3C7.js";
98
+ createTranscriptMessageUpdate,
99
+ createTranscriptUsageUpdate,
100
+ hasFullSessionContext
101
+ } from "./chunk-W2ITCESM.js";
102
+ import "./chunk-47FQVRCO.js";
103
+ import "./chunk-HMCSRTDY.js";
102
104
  import "./chunk-4NFY2S7N.js";
103
105
  import "./chunk-2MIN6GRR.js";
104
106
  import "./chunk-QHTIBUWB.js";
105
- import {
106
- isTerminalGoalStatusKind
107
- } from "./chunk-EKTCKZV5.js";
108
107
  import "./chunk-3Z43GZUQ.js";
109
108
  import {
110
109
  buildToolWriteOriginMeta
@@ -120,18 +119,18 @@ import {
120
119
  buildPermissionSettings,
121
120
  normalizePermissionRules,
122
121
  readPermissionRuleSet
123
- } from "./chunk-Y3OVRWRY.js";
122
+ } from "./chunk-DM4C3OX5.js";
124
123
  import {
125
124
  MAX_AUDIO_BYTES,
126
125
  sanitizeVoiceErrorMessage,
127
126
  transcribeVoiceAudio
128
- } from "./chunk-LLCWZQCU.js";
127
+ } from "./chunk-HZV75ET2.js";
129
128
  import {
130
129
  readVoiceModel
131
- } from "./chunk-EBZ6BJTF.js";
132
- import "./chunk-AOHJKPKL.js";
130
+ } from "./chunk-F4T5J34H.js";
131
+ import "./chunk-IQFYO5BF.js";
133
132
  import "./chunk-NTTBXH7U.js";
134
- import "./chunk-VSFKIRRW.js";
133
+ import "./chunk-AKLY5M2C.js";
135
134
  import "./chunk-3SH53ANB.js";
136
135
  import {
137
136
  ACP_ROUTE_ID_PREFIX,
@@ -141,32 +140,32 @@ import {
141
140
  parseAcpModelOption,
142
141
  resolveAcpModelOption,
143
142
  sanitizeProviderBaseUrl
144
- } from "./chunk-2PLNY5TN.js";
143
+ } from "./chunk-23GFHEM3.js";
145
144
  import {
146
145
  mapSkillConfigToStatus
147
146
  } from "./chunk-BGXZBI5B.js";
148
147
  import {
149
148
  resolveSkillSettings
150
149
  } from "./chunk-Z4X5MTRT.js";
151
- import "./chunk-NEOXOWYH.js";
152
- import "./chunk-UMD7WQTR.js";
150
+ import "./chunk-U7QUDFPD.js";
151
+ import "./chunk-N3ZWGKXN.js";
153
152
  import "./chunk-57OAHC2Y.js";
154
- import "./chunk-LHEC5V6G.js";
155
- import "./chunk-67EWJE77.js";
156
- import "./chunk-E2FPSSKP.js";
153
+ import "./chunk-VRWOMUZM.js";
154
+ import "./chunk-ENEEQMGM.js";
155
+ import "./chunk-JPA7IDTE.js";
157
156
  import {
158
157
  createLoadedSettingsAdapter
159
- } from "./chunk-4WL6SY4F.js";
158
+ } from "./chunk-X5GLCWPX.js";
160
159
  import {
161
160
  SESSION_SOURCE_META_KEY,
162
161
  parseSessionSource
163
- } from "./chunk-F24A2JBM.js";
162
+ } from "./chunk-2AAFGCWP.js";
164
163
  import "./chunk-MZSJ43WV.js";
165
164
  import "./chunk-XCGIMOLN.js";
166
165
  import "./chunk-OCPBI7J5.js";
167
166
  import {
168
167
  ndJsonStream
169
- } from "./chunk-I5VM3SKY.js";
168
+ } from "./chunk-TKAEODJR.js";
170
169
  import {
171
170
  ACP_PREFLIGHT_KINDS,
172
171
  IDLE_HOOK_EVENTS,
@@ -174,8 +173,8 @@ import {
174
173
  SERVE_STATUS_EXT_METHODS,
175
174
  STATUS_SCHEMA_VERSION,
176
175
  mapDomainErrorToErrorKind
177
- } from "./chunk-DA4HRSBW.js";
178
- import "./chunk-VKJ4KTPJ.js";
176
+ } from "./chunk-OPBATTFQ.js";
177
+ import "./chunk-3GCU5O2E.js";
179
178
  import "./chunk-V6WHFGST.js";
180
179
  import {
181
180
  ACTIVE_WORK_CLOSE_IF_UNHELD_PARAM,
@@ -188,6 +187,7 @@ import {
188
187
  CLIENT_MCP_OVER_WS_CONFIG_FLAG,
189
188
  DAEMON_CHANNEL_DELIVERY_META_KEY,
190
189
  DAEMON_MODEL_PROMPT_META_KEY,
190
+ DAEMON_PROMPT_DISPLAY_TEXT_META_KEY,
191
191
  LOAD_REPLAY_BULK_MODE,
192
192
  LOAD_REPLAY_HIDE_INHERITED_META_KEY,
193
193
  LOAD_REPLAY_META_KEY,
@@ -202,7 +202,7 @@ import {
202
202
  WORKTREE_MCP_DEFER_META_KEY,
203
203
  clampActiveWorkIntervalMs,
204
204
  isValidTrustedModelPrompt
205
- } from "./chunk-W5UC37EE.js";
205
+ } from "./chunk-HHGQGTJQ.js";
206
206
  import {
207
207
  NOT_CURRENTLY_GENERATING_CANCEL_MESSAGE,
208
208
  isNotCurrentlyGeneratingCancelError
@@ -210,7 +210,7 @@ import {
210
210
  import "./chunk-6PLDPT2C.js";
211
211
  import "./chunk-FYJ7W2PI.js";
212
212
  import "./chunk-YP5KH5Y7.js";
213
- import "./chunk-PBRVUF5B.js";
213
+ import "./chunk-K7JW6V5O.js";
214
214
  import "./chunk-ALMR3E6Q.js";
215
215
  import "./chunk-HIBNSEJE.js";
216
216
  import "./chunk-M5GB774H.js";
@@ -221,20 +221,20 @@ import {
221
221
  PRIVATE_EXTERNAL_TOOL_GUARD_ENV,
222
222
  isValidExternalToolGuardDenialReason
223
223
  } from "./chunk-BKHCW2BI.js";
224
- import "./chunk-UVX4Y6IN.js";
224
+ import "./chunk-AQHNAA7E.js";
225
225
  import {
226
226
  ACP_EVENT_LOOP_STALL_RESTART_MS,
227
227
  CHANNEL_PROMPT_META_KEY
228
- } from "./chunk-DX3RGJMS.js";
228
+ } from "./chunk-LT532KF4.js";
229
229
  import {
230
230
  AgentSideConnection,
231
231
  PROTOCOL_VERSION,
232
232
  RequestError
233
- } from "./chunk-UDXSXLER.js";
233
+ } from "./chunk-IW6RQPQB.js";
234
234
  import {
235
235
  assembleMcpServers,
236
236
  loadMcpApprovals
237
- } from "./chunk-KID7K6H2.js";
237
+ } from "./chunk-JOXXPM3X.js";
238
238
  import {
239
239
  getOutputLanguageFilePath,
240
240
  getPersistScopeForModelSelection,
@@ -243,8 +243,8 @@ import {
243
243
  resolveOutputLanguageOrPreserveAuto,
244
244
  updateOutputLanguageFile,
245
245
  writeOutputLanguageAndRegisterPath
246
- } from "./chunk-ABVRJU3D.js";
247
- import "./chunk-UBX6NL47.js";
246
+ } from "./chunk-4PFKN7CQ.js";
247
+ import "./chunk-T4576UW4.js";
248
248
  import "./chunk-RKUWKYED.js";
249
249
  import "./chunk-GOXKNSDZ.js";
250
250
  import {
@@ -254,7 +254,7 @@ import {
254
254
  import {
255
255
  getCurrentLanguage,
256
256
  setLanguageAsync
257
- } from "./chunk-UEOKWYGY.js";
257
+ } from "./chunk-KFCTC5IJ.js";
258
258
  import {
259
259
  SUPPORTED_LANGUAGES
260
260
  } from "./chunk-5EJZE3FP.js";
@@ -262,18 +262,18 @@ import {
262
262
  findEnvFiles,
263
263
  preResolveHomeEnvOverrides,
264
264
  reloadEnvironment
265
- } from "./chunk-ZJ4W6SUY.js";
265
+ } from "./chunk-UM57UTTV.js";
266
266
  import {
267
267
  ENV_ACP_REPEATED_TOOL_FAILURE_GUARD
268
- } from "./chunk-VFMASYQA.js";
269
- import "./chunk-Q3AL4JQ3.js";
270
- import "./chunk-AEL7KN2O.js";
268
+ } from "./chunk-MS7GNABG.js";
269
+ import "./chunk-LA3FF7RO.js";
270
+ import "./chunk-EOBM4T2Z.js";
271
271
  import "./chunk-VJNBRRZG.js";
272
272
  import {
273
273
  isFolderTrustEnabled,
274
274
  isWorkspaceTrusted,
275
275
  loadTrustedFolders
276
- } from "./chunk-GWVUR3QZ.js";
276
+ } from "./chunk-YIKMBYMT.js";
277
277
  import "./chunk-NPQ5ZKRP.js";
278
278
  import "./chunk-MR3PXB6E.js";
279
279
  import "./chunk-XFSFZCM5.js";
@@ -326,7 +326,6 @@ import {
326
326
  buildPermissionCheckContext,
327
327
  buildSessionRecoveryPlanFromApiHistory,
328
328
  clampInlineMediaPart,
329
- clearGoalTerminalObserver,
330
329
  computeUniqueBranchTitle,
331
330
  convertToFunctionErrorResponse,
332
331
  convertToFunctionResponse,
@@ -384,6 +383,7 @@ import {
384
383
  normalizeEventPayload,
385
384
  normalizeSnapshotPayload,
386
385
  persistPermissionOutcome,
386
+ projectGoalStateToLegacy,
387
387
  readManyFiles,
388
388
  recordAllow,
389
389
  recordFallbackApprove,
@@ -396,7 +396,6 @@ import {
396
396
  runManagedAutoMemoryDream,
397
397
  runManagedRememberByAgent,
398
398
  sessionIdContext,
399
- setGoalTerminalObserver,
400
399
  shouldClassifyAllShellForAutoMode,
401
400
  shouldFallback,
402
401
  shouldFirePermissionDeniedForAutoMode,
@@ -404,29 +403,29 @@ import {
404
403
  shouldHaltOnTurnToolCallCap,
405
404
  shouldRunAutoModeForCall,
406
405
  subagentGenerator,
407
- unregisterGoalHook,
406
+ truncateNotificationLabel,
408
407
  updateSetting,
409
408
  validatePlanModeShellApproval,
410
409
  validatePlanModeShellContext
411
- } from "./chunk-EI3NWELG.js";
410
+ } from "./chunk-UIZGNLBP.js";
412
411
  import "./chunk-GOFAQQZA.js";
413
412
  import "./chunk-5M6IDOMF.js";
414
413
  import "./chunk-TWPJO254.js";
415
414
  import {
416
415
  external_exports
417
- } from "./chunk-H6XPXXMH.js";
418
- import "./chunk-2UUMVNYT.js";
419
- import "./chunk-MVUQRLOH.js";
420
- import "./chunk-XCWO3SMQ.js";
421
- import "./chunk-7MH4J33A.js";
416
+ } from "./chunk-CQ35AJ4Z.js";
417
+ import "./chunk-QTI7SRXI.js";
418
+ import "./chunk-KT4OWAAZ.js";
419
+ import "./chunk-IX7CFQGA.js";
420
+ import "./chunk-N7NBMAMW.js";
422
421
  import {
423
422
  parsePositiveIntegerEnv
424
423
  } from "./chunk-6PVPNMXU.js";
425
- import "./chunk-TRRF5BSP.js";
424
+ import "./chunk-XT6TGJFD.js";
426
425
  import "./chunk-IRH27ZC2.js";
427
426
  import "./chunk-QHWCP53L.js";
428
- import "./chunk-GNPNYXJB.js";
429
- import "./chunk-HUWENAHO.js";
427
+ import "./chunk-XLQS3VI6.js";
428
+ import "./chunk-NWPO6I7V.js";
430
429
  import {
431
430
  promptIdContext,
432
431
  todoWorkChainContext
@@ -434,21 +433,24 @@ import {
434
433
  import "./chunk-T26EAKDL.js";
435
434
  import "./chunk-ZPJWUGCS.js";
436
435
  import "./chunk-CPBF7KYF.js";
437
- import "./chunk-J6SZID63.js";
436
+ import "./chunk-2AZMF6G5.js";
438
437
  import "./chunk-KRXPRVGL.js";
439
438
  import {
440
439
  HookEventName,
441
440
  createHookOutput
442
- } from "./chunk-GM463R2B.js";
443
- import "./chunk-SEZ556DZ.js";
444
- import "./chunk-2FRY5CRX.js";
441
+ } from "./chunk-GZGDJ4E6.js";
442
+ import "./chunk-T6W4KACQ.js";
443
+ import "./chunk-MWZYNOCG.js";
445
444
  import {
445
+ GoalPersistenceUnavailableError,
446
+ emptyGoalSnapshot,
447
+ goalTurnContext,
446
448
  wrapUserPromptSubmitContext
447
- } from "./chunk-QUI267ZP.js";
449
+ } from "./chunk-SAQHDAUJ.js";
448
450
  import {
449
451
  APPROVAL_MODES
450
- } from "./chunk-WAUGQKUU.js";
451
- import "./chunk-DZUO626D.js";
452
+ } from "./chunk-6LYDH7VT.js";
453
+ import "./chunk-2XZWO53E.js";
452
454
  import {
453
455
  addToolArgumentsAttributes,
454
456
  addToolCallResultAttributes,
@@ -456,31 +458,32 @@ import {
456
458
  registerAcpEventLoopLagGauge,
457
459
  startEventLoopLagMonitor,
458
460
  withDaemonSpan
459
- } from "./chunk-4TRQPFDP.js";
461
+ } from "./chunk-BJKREW56.js";
460
462
  import "./chunk-SAH4BD2J.js";
463
+ import "./chunk-25OFRBH2.js";
461
464
  import {
462
465
  runWithRuntimeContentGenerator
463
- } from "./chunk-CPG6P4GG.js";
466
+ } from "./chunk-EYS3GGM3.js";
464
467
  import "./chunk-S6LOFUVP.js";
465
468
  import "./chunk-2J3OJGTL.js";
466
469
  import {
467
470
  FORK_SUBAGENT_TYPE,
468
471
  getStartupContextLength,
469
472
  isSystemReminderContent
470
- } from "./chunk-IA7TGCN2.js";
473
+ } from "./chunk-ZV4XVYL3.js";
471
474
  import "./chunk-K623ENWT.js";
472
475
  import "./chunk-AQ37AY7B.js";
473
- import "./chunk-EQL65XGA.js";
476
+ import "./chunk-V3LXMASR.js";
474
477
  import {
475
478
  clearCachedCredentialFile,
476
479
  qwenOAuth2Events
477
- } from "./chunk-3P2LV43B.js";
480
+ } from "./chunk-KCCODSAA.js";
478
481
  import "./chunk-NAVJD2PQ.js";
479
- import "./chunk-HV76SFIA.js";
480
- import "./chunk-4PYCZH2V.js";
482
+ import "./chunk-5HBFERG5.js";
483
+ import "./chunk-EYW54TBD.js";
481
484
  import "./chunk-P3QQPMQA.js";
482
- import "./chunk-SR7RZ4MS.js";
483
- import "./chunk-M6HMMKVG.js";
485
+ import "./chunk-O4BBDP2G.js";
486
+ import "./chunk-KPVVWKF3.js";
484
487
  import {
485
488
  REASONING_EFFORT_TIERS,
486
489
  applyReasoningEffort
@@ -491,7 +494,7 @@ import {
491
494
  getToolCallPreparations
492
495
  } from "./chunk-GLCZKT5V.js";
493
496
  import "./chunk-DJ2GSRLV.js";
494
- import "./chunk-EI3HZX6C.js";
497
+ import "./chunk-GJJQV4PY.js";
495
498
  import {
496
499
  ConversationFinishedEvent,
497
500
  DiscoveredMCPTool,
@@ -502,6 +505,7 @@ import {
502
505
  PromptSuggestionEvent,
503
506
  RepeatedToolFailureGuardEvent,
504
507
  UserPromptEvent,
508
+ apiActivityTracker,
505
509
  formatFullTurnVisionNotice,
506
510
  formatVisionBridgeNotice,
507
511
  getAllGeminiMdFilenames,
@@ -523,17 +527,17 @@ import {
523
527
  shouldRunVisionBridge,
524
528
  splitImageParts,
525
529
  uiTelemetryService
526
- } from "./chunk-YGT2AUJ7.js";
527
- import "./chunk-WOJZWRAZ.js";
530
+ } from "./chunk-U2JLICUY.js";
531
+ import "./chunk-YRLW2MSX.js";
528
532
  import "./chunk-VGC4I5JJ.js";
529
533
  import {
530
534
  getAutoMemoryRoot,
531
535
  getUserAutoMemoryRoot
532
- } from "./chunk-FVKHVJZQ.js";
536
+ } from "./chunk-732MOPEM.js";
533
537
  import {
534
538
  runSideQuery
535
- } from "./chunk-COBO5EBO.js";
536
- import "./chunk-6ZRFAKXK.js";
539
+ } from "./chunk-CTQE2NB2.js";
540
+ import "./chunk-IEP44U2R.js";
537
541
  import {
538
542
  BaseDeclarativeTool,
539
543
  BaseToolInvocation,
@@ -541,20 +545,20 @@ import {
541
545
  ToolNames,
542
546
  canonicalToolName,
543
547
  isShellProgressData
544
- } from "./chunk-PYQADEFD.js";
548
+ } from "./chunk-XTH2OMDS.js";
545
549
  import {
546
550
  AuthType,
547
551
  preloadContentGenerator
548
- } from "./chunk-Y4R47ZUH.js";
552
+ } from "./chunk-MDQSCFAZ.js";
549
553
  import "./chunk-F6WFNA7U.js";
550
554
  import "./chunk-46UV252V.js";
551
555
  import {
552
556
  DEFAULT_TOKEN_LIMIT,
553
557
  tokenLimit
554
- } from "./chunk-ZBVS26BY.js";
555
- import "./chunk-KKBPOU75.js";
556
- import "./chunk-EUNWC2VS.js";
557
- import "./chunk-FOGU3LJX.js";
558
+ } from "./chunk-FPGTNKCP.js";
559
+ import "./chunk-EFIMD5VA.js";
560
+ import "./chunk-NC4O6UE6.js";
561
+ import "./chunk-F6AOBFUN.js";
558
562
  import {
559
563
  endToolExecutionSpan,
560
564
  endToolSpan,
@@ -563,21 +567,21 @@ import {
563
567
  startToolExecutionSpan,
564
568
  startToolSpan,
565
569
  withInteractionSpan
566
- } from "./chunk-L2AFWWJE.js";
567
- import "./chunk-W4RQUHY3.js";
568
- import "./chunk-PDPFQ2FO.js";
570
+ } from "./chunk-HUE2M6VI.js";
571
+ import "./chunk-HHJLM3WQ.js";
572
+ import "./chunk-L2GTEEEU.js";
569
573
  import {
570
574
  Storage,
571
575
  createDebugLogger,
572
576
  getErrorMessage,
573
577
  getErrorStatus,
574
578
  isSubpath
575
- } from "./chunk-OIVKILPI.js";
579
+ } from "./chunk-MPBRV3UU.js";
576
580
  import "./chunk-VOQXFAY5.js";
577
- import "./chunk-AQAJJMRR.js";
581
+ import "./chunk-3LHYTQ2R.js";
578
582
  import {
579
583
  runExitCleanup
580
- } from "./chunk-AAE6SR4Q.js";
584
+ } from "./chunk-RUKNJEJO.js";
581
585
  import {
582
586
  writeStderrLine,
583
587
  writeStderrLineSafe
@@ -1424,6 +1428,86 @@ function prefixMidTurnUserMessageParts(parts, displayText) {
1424
1428
  }
1425
1429
  __name(prefixMidTurnUserMessageParts, "prefixMidTurnUserMessageParts");
1426
1430
 
1431
+ // packages/cli/src/ui/utils/restoreGoal.ts
1432
+ init_esbuild_shims();
1433
+ function findGoalToRestore(history) {
1434
+ for (let i = history.length - 1; i >= 0; i--) {
1435
+ const item = history[i];
1436
+ if (item?.type !== "goal_status" /* GOAL_STATUS */) continue;
1437
+ const goal = item;
1438
+ if (goal.kind !== "set" && goal.kind !== "checking") return null;
1439
+ const setAt = goal.setAt ?? findSetAtOfRun(history, i);
1440
+ return {
1441
+ condition: goal.condition,
1442
+ iterations: goal.iterations ?? 0,
1443
+ ...setAt !== void 0 ? { setAt } : {}
1444
+ };
1445
+ }
1446
+ return null;
1447
+ }
1448
+ __name(findGoalToRestore, "findGoalToRestore");
1449
+ function findSetAtOfRun(history, startIndex) {
1450
+ const start = history[startIndex];
1451
+ const condition = start?.condition;
1452
+ for (let i = startIndex - 1; i >= 0; i--) {
1453
+ const item = history[i];
1454
+ if (item?.type !== "goal_status" /* GOAL_STATUS */) continue;
1455
+ const goal = item;
1456
+ if (goal.kind !== "set" && goal.kind !== "checking") return void 0;
1457
+ if (goal.condition !== condition) return void 0;
1458
+ if (goal.setAt !== void 0) return goal.setAt;
1459
+ }
1460
+ return void 0;
1461
+ }
1462
+ __name(findSetAtOfRun, "findSetAtOfRun");
1463
+ function finiteNumber(value) {
1464
+ return typeof value === "number" && Number.isFinite(value) ? value : void 0;
1465
+ }
1466
+ __name(finiteNumber, "finiteNumber");
1467
+ function isTranscriptItemRecord(item) {
1468
+ return typeof item === "object" && item !== null && !Array.isArray(item);
1469
+ }
1470
+ __name(isTranscriptItemRecord, "isTranscriptItemRecord");
1471
+ function parseGoalStatusItem(item) {
1472
+ if (!isTranscriptItemRecord(item)) return null;
1473
+ if (item["type"] !== "goal_status" /* GOAL_STATUS */) return null;
1474
+ const kind = item["kind"];
1475
+ const condition = item["condition"];
1476
+ if (!isGoalStatusKind(kind) || typeof condition !== "string") return null;
1477
+ const iterations = finiteNumber(item["iterations"]);
1478
+ const setAt = finiteNumber(item["setAt"]);
1479
+ const durationMs = finiteNumber(item["durationMs"]);
1480
+ const lastReason = typeof item["lastReason"] === "string" ? item["lastReason"] : void 0;
1481
+ return {
1482
+ type: "goal_status" /* GOAL_STATUS */,
1483
+ kind,
1484
+ condition,
1485
+ ...iterations !== void 0 ? { iterations } : {},
1486
+ ...setAt !== void 0 ? { setAt } : {},
1487
+ ...durationMs !== void 0 ? { durationMs } : {},
1488
+ ...lastReason !== void 0 ? { lastReason } : {}
1489
+ };
1490
+ }
1491
+ __name(parseGoalStatusItem, "parseGoalStatusItem");
1492
+ function collectGoalStatusItemsFromRecords(records) {
1493
+ const items = [];
1494
+ for (const record of records) {
1495
+ if (record.type !== "system" || record.subtype !== "slash_command") {
1496
+ continue;
1497
+ }
1498
+ const payload = record.systemPayload;
1499
+ if (payload?.phase !== "result") continue;
1500
+ const raws = payload.outputHistoryItems;
1501
+ if (!Array.isArray(raws)) continue;
1502
+ for (const raw of raws) {
1503
+ const item = parseGoalStatusItem(raw);
1504
+ if (item) items.push(item);
1505
+ }
1506
+ }
1507
+ return items;
1508
+ }
1509
+ __name(collectGoalStatusItemsFromRecords, "collectGoalStatusItemsFromRecords");
1510
+
1427
1511
  // packages/cli/src/acp-integration/session/tool-call-preparation-tracker.ts
1428
1512
  init_esbuild_shims();
1429
1513
  var ToolCallPreparationTracker = class {
@@ -1497,6 +1581,205 @@ var ToolCallPreparationTracker = class {
1497
1581
  }
1498
1582
  };
1499
1583
 
1584
+ // packages/cli/src/acp-integration/session/emitters/MessageEmitter.ts
1585
+ init_esbuild_shims();
1586
+ function buildGoalStatusUpdate(status) {
1587
+ return {
1588
+ sessionUpdate: "agent_message_chunk",
1589
+ content: { type: "text", text: "" },
1590
+ _meta: {
1591
+ goalStatus: status
1592
+ }
1593
+ };
1594
+ }
1595
+ __name(buildGoalStatusUpdate, "buildGoalStatusUpdate");
1596
+ function buildGoalStateUpdate(snapshot, cause, previousGoal = null) {
1597
+ const projection = cause ? projectGoalStateToLegacy({ v: 2, cause, snapshot }, previousGoal) : void 0;
1598
+ const goalStatus = projection ? (() => {
1599
+ const { type: _type, ...status } = projection.goalStatus;
1600
+ return status;
1601
+ })() : void 0;
1602
+ return {
1603
+ sessionUpdate: "agent_message_chunk",
1604
+ content: { type: "text", text: "" },
1605
+ _meta: {
1606
+ goalState: snapshot,
1607
+ ...goalStatus ? { goalStatus } : {},
1608
+ ...projection?.goalTerminal ? { goalTerminal: projection.goalTerminal } : {}
1609
+ }
1610
+ };
1611
+ }
1612
+ __name(buildGoalStateUpdate, "buildGoalStateUpdate");
1613
+ var MessageEmitter = class extends BaseEmitter {
1614
+ static {
1615
+ __name(this, "MessageEmitter");
1616
+ }
1617
+ /**
1618
+ * Emits a StopHookLoop event when Stop hooks create a loop.
1619
+ * This informs the client that Stop hooks have been executed multiple times.
1620
+ *
1621
+ * @param iterationCount - The current iteration count
1622
+ * @param reasons - Array of reasons from each Stop hook execution
1623
+ * @param stopHookCount - Number of Stop hooks that were executed
1624
+ */
1625
+ async emitStopHookLoop(iterationCount, reasons, stopHookCount) {
1626
+ const activeGoal = getActiveGoal(this.sessionId);
1627
+ await this.sendUpdate({
1628
+ sessionUpdate: "agent_message_chunk",
1629
+ content: { type: "text", text: "" },
1630
+ _meta: {
1631
+ stopHookLoop: {
1632
+ iterationCount,
1633
+ reasons,
1634
+ stopHookCount,
1635
+ ...activeGoal ? {
1636
+ goal: {
1637
+ condition: activeGoal.condition,
1638
+ iterations: activeGoal.iterations,
1639
+ setAt: activeGoal.setAt,
1640
+ lastReason: activeGoal.lastReason
1641
+ }
1642
+ } : {}
1643
+ }
1644
+ }
1645
+ });
1646
+ }
1647
+ async emitGoalStatus(status) {
1648
+ await this.sendUpdate(buildGoalStatusUpdate(status));
1649
+ }
1650
+ async emitGoalState(snapshot, cause, previousGoal = null) {
1651
+ await this.sendUpdate(buildGoalStateUpdate(snapshot, cause, previousGoal));
1652
+ }
1653
+ /**
1654
+ * Emits a user message chunk.
1655
+ *
1656
+ * @param text - The user message text content
1657
+ * @param timestamp - Optional server-side timestamp (ISO string or ms) for message ordering
1658
+ */
1659
+ async emitUserMessage(text, timestamp, options = {}) {
1660
+ await this.sendUpdate(
1661
+ createTranscriptMessageUpdate({
1662
+ role: "user",
1663
+ text,
1664
+ timestamp,
1665
+ ...options.source ? { extra: { source: options.source } } : {}
1666
+ })
1667
+ );
1668
+ }
1669
+ /**
1670
+ * Emits an agent thought chunk.
1671
+ *
1672
+ * @param text - The thought text content
1673
+ * @param timestamp - Optional server-side timestamp (ISO string or ms) for message ordering
1674
+ */
1675
+ async emitAgentThought(text, timestamp, subagentMeta) {
1676
+ await this.sendUpdate(
1677
+ createTranscriptMessageUpdate({
1678
+ role: "assistant",
1679
+ thought: true,
1680
+ text,
1681
+ timestamp,
1682
+ ...subagentMeta ? { extra: { ...subagentMeta } } : {}
1683
+ })
1684
+ );
1685
+ }
1686
+ /**
1687
+ * Emits an agent message chunk.
1688
+ *
1689
+ * @param text - The agent message text content
1690
+ * @param timestamp - Optional server-side timestamp (ISO string or ms) for message ordering
1691
+ */
1692
+ async emitAgentMessage(text, timestamp, subagentMeta) {
1693
+ await this.sendUpdate(
1694
+ createTranscriptMessageUpdate({
1695
+ role: "assistant",
1696
+ text,
1697
+ timestamp,
1698
+ ...subagentMeta ? { extra: { ...subagentMeta } } : {}
1699
+ })
1700
+ );
1701
+ }
1702
+ async emitSlashCommandOutput(text, timestamp) {
1703
+ const epochMs = BaseEmitter.toEpochMs(timestamp);
1704
+ await this.sendUpdate({
1705
+ sessionUpdate: "agent_message_chunk",
1706
+ content: { type: "text", text },
1707
+ _meta: {
1708
+ source: "slash_command",
1709
+ ...epochMs != null ? { timestamp: epochMs } : {}
1710
+ }
1711
+ });
1712
+ }
1713
+ /**
1714
+ * Emits usage metadata.
1715
+ */
1716
+ async emitUsageMetadata(usageMetadata, text = "", durationMs, subagentMeta) {
1717
+ const cumulative = this.ctx.cumulativeUsage;
1718
+ if (cumulative) {
1719
+ const addFinite = /* @__PURE__ */ __name((total, value) => typeof value === "number" && Number.isFinite(value) ? total + value : total, "addFinite");
1720
+ cumulative.promptTokens = addFinite(
1721
+ cumulative.promptTokens,
1722
+ usageMetadata.promptTokenCount
1723
+ );
1724
+ cumulative.candidateTokens = addFinite(
1725
+ cumulative.candidateTokens,
1726
+ usageMetadata.candidatesTokenCount
1727
+ );
1728
+ cumulative.cachedTokens = addFinite(
1729
+ cumulative.cachedTokens,
1730
+ usageMetadata.cachedContentTokenCount
1731
+ );
1732
+ cumulative.apiTimeMs = addFinite(cumulative.apiTimeMs, durationMs);
1733
+ }
1734
+ let activityMeta = {};
1735
+ if (typeof durationMs === "number") {
1736
+ const activity = apiActivityTracker.drain();
1737
+ activityMeta = {
1738
+ ...activity.errors > 0 ? { apiErrors: activity.errors } : {},
1739
+ ...activity.retries > 0 ? { apiRetries: activity.retries } : {}
1740
+ };
1741
+ }
1742
+ await this.sendUpdate(
1743
+ createTranscriptUsageUpdate(usageMetadata, {
1744
+ text,
1745
+ extra: {
1746
+ ...typeof durationMs === "number" ? { durationMs } : {},
1747
+ ...activityMeta,
1748
+ ...subagentMeta
1749
+ }
1750
+ })
1751
+ );
1752
+ if (!Number.isFinite(durationMs) || subagentMeta || !hasFullSessionContext(this.ctx)) {
1753
+ return;
1754
+ }
1755
+ const used = usageMetadata.promptTokenCount ?? usageMetadata.totalTokenCount;
1756
+ const size = this.ctx.config.getContentGeneratorConfig()?.contextWindowSize;
1757
+ if (typeof used !== "number" || !Number.isSafeInteger(used) || used < 0 || typeof size !== "number" || !Number.isSafeInteger(size) || size <= 0) {
1758
+ return;
1759
+ }
1760
+ await this.sendUpdate({
1761
+ sessionUpdate: "usage_update",
1762
+ used,
1763
+ size
1764
+ });
1765
+ }
1766
+ /**
1767
+ * Emits a message chunk based on role and thought flag.
1768
+ * This is the unified method that handles all message types.
1769
+ *
1770
+ * @param text - The message text content
1771
+ * @param role - Whether this is a user or assistant message
1772
+ * @param isThought - Whether this is an assistant thought (only applies to assistant role)
1773
+ * @param timestamp - Optional server-side timestamp (ISO string or ms) for message ordering
1774
+ */
1775
+ async emitMessage(text, role, isThought = false, timestamp, subagentMeta) {
1776
+ if (role === "user") {
1777
+ return this.emitUserMessage(text, timestamp);
1778
+ }
1779
+ return isThought ? this.emitAgentThought(text, timestamp, subagentMeta) : this.emitAgentMessage(text, timestamp, subagentMeta);
1780
+ }
1781
+ };
1782
+
1500
1783
  // packages/cli/src/acp-integration/session/SubAgentTracker.ts
1501
1784
  init_esbuild_shims();
1502
1785
 
@@ -2678,6 +2961,7 @@ __name(reduceRepeatedToolFailureGuard, "reduceRepeatedToolFailureGuard");
2678
2961
  var debugLogger6 = createDebugLogger("SESSION");
2679
2962
  var permissionRequestTails = /* @__PURE__ */ new WeakMap();
2680
2963
  var USER_CANCEL_ABORT_REASON = "qwen:user-cancel";
2964
+ var NEW_PROMPT_ABORT_REASON = "qwen:new-prompt";
2681
2965
  var SESSION_DISPOSE_ABORT_REASON = "qwen:session-dispose";
2682
2966
  var DAEMON_RETRY_META_KEY = "qwen.daemon.retry";
2683
2967
  var DAEMON_CONTINUE_META_KEY = "qwen.daemon.continueLastTurn";
@@ -2725,6 +3009,61 @@ function getAbortAwareEndTurnStopReason(signal) {
2725
3009
  return signal.aborted ? "cancelled" : "end_turn";
2726
3010
  }
2727
3011
  __name(getAbortAwareEndTurnStopReason, "getAbortAwareEndTurnStopReason");
3012
+ function sameGoalPermit(left, right) {
3013
+ return left?.goalId === right.goalId && left.revision === right.revision && left.turnId === right.turnId;
3014
+ }
3015
+ __name(sameGoalPermit, "sameGoalPermit");
3016
+ function buildGoalContinuationParts(turn) {
3017
+ return [
3018
+ {
3019
+ text: [
3020
+ "Continue working on the active Goal.",
3021
+ "Use get_goal for the authoritative objective and evidence state.",
3022
+ "Follow the objective's requested output format exactly. Do not add progress, status, or completion commentary unless the objective asks for it.",
3023
+ "If completion depends on content delivered in this turn, deliver only that content and call get_goal in the same response before update_goal.",
3024
+ `Runtime continuation context: ${turn.continuationContext}`,
3025
+ ...turn.verifierFeedback ? [`Verifier feedback: ${turn.verifierFeedback}`] : []
3026
+ ].join("\n")
3027
+ }
3028
+ ];
3029
+ }
3030
+ __name(buildGoalContinuationParts, "buildGoalContinuationParts");
3031
+ async function claimGoalTurn(runtime, turnKey, signal) {
3032
+ if (signal.aborted) return void 0;
3033
+ const immediate = runtime.permitForTurn(turnKey) ?? runtime.beginTurn(turnKey);
3034
+ if (immediate || runtime.getSnapshot().goal?.status !== "active") {
3035
+ return immediate;
3036
+ }
3037
+ return new Promise((resolve6, reject) => {
3038
+ let settled = false;
3039
+ let unsubscribe = /* @__PURE__ */ __name(() => {
3040
+ }, "unsubscribe");
3041
+ const finish = /* @__PURE__ */ __name((permit, error) => {
3042
+ if (settled) return;
3043
+ settled = true;
3044
+ unsubscribe();
3045
+ signal.removeEventListener("abort", onAbort);
3046
+ if (error !== void 0) reject(error);
3047
+ else resolve6(permit);
3048
+ }, "finish");
3049
+ const inspect = /* @__PURE__ */ __name(() => {
3050
+ try {
3051
+ const permit = runtime.permitForTurn(turnKey);
3052
+ if (permit || runtime.getSnapshot().goal?.status !== "active") {
3053
+ finish(permit);
3054
+ }
3055
+ } catch (error) {
3056
+ finish(void 0, error);
3057
+ }
3058
+ }, "inspect");
3059
+ const onAbort = /* @__PURE__ */ __name(() => finish(void 0), "onAbort");
3060
+ unsubscribe = runtime.subscribe(inspect);
3061
+ signal.addEventListener("abort", onAbort, { once: true });
3062
+ if (signal.aborted) onAbort();
3063
+ else inspect();
3064
+ });
3065
+ }
3066
+ __name(claimGoalTurn, "claimGoalTurn");
2728
3067
  var DAEMON_INVALID_TOOL_PARAMS_THRESHOLD = 3;
2729
3068
  var PERMISSION_CANCEL_SKIP_MESSAGE = "Skipped because a permission request was cancelled before the user answered; user input is required before continuing.";
2730
3069
  var LOOP_DETECTED_SKIP_MESSAGE = "Skipped because loop detection stopped the current turn before this tool call could run.";
@@ -3346,11 +3685,9 @@ var Session = class {
3346
3685
  this.todoStopGuardBackgroundBaseline = this.#captureTodoStopGuardBackgroundBaseline();
3347
3686
  this.toolCallEmitter = new ToolCallEmitter(this);
3348
3687
  this.planEmitter = new PlanEmitter(this);
3349
- this.historyReplayer = new HistoryReplayer(this, {
3350
- supersedeUnrestorableGoal: true
3351
- });
3688
+ this.historyReplayer = new HistoryReplayer(this);
3352
3689
  this.messageEmitter = new MessageEmitter(this);
3353
- this.installGoalTerminalObserver();
3690
+ this.#bindGoalRuntime();
3354
3691
  this.#registerBackgroundNotificationCallbacks();
3355
3692
  this.#registerSubSessionSpawner();
3356
3693
  this.config.getWorkflowRunRegistry?.().setApprovalRequestCallback(
@@ -3438,6 +3775,14 @@ var Session = class {
3438
3775
  persistedBackgroundNotificationTaskIds = /* @__PURE__ */ new Set();
3439
3776
  backgroundNotificationAcceptances = /* @__PURE__ */ new Map();
3440
3777
  activeAgentNotificationAcceptances = /* @__PURE__ */ new Set();
3778
+ goalQueue = [];
3779
+ goalProcessing = false;
3780
+ activeGoalTurn;
3781
+ goalHostUnbind;
3782
+ goalRuntimeUnsubscribe;
3783
+ lastGoalSnapshot;
3784
+ lastGoalPublicationKey;
3785
+ goalPublicationTail = Promise.resolve();
3441
3786
  // Set true in dispose(). Guards #drainCronQueue and #drainNotificationQueue
3442
3787
  // against the race where #drainNotificationQueue's finally block kicks off
3443
3788
  // #drainCronQueue after the session has already been disposed (e.g. /clear
@@ -3483,6 +3828,311 @@ var Session = class {
3483
3828
  pendingRecoveredAgentsNotice = null;
3484
3829
  // Implement SessionContext interface
3485
3830
  sessionId;
3831
+ #bindGoalRuntime() {
3832
+ try {
3833
+ const runtime = this.config.getGoalRuntime();
3834
+ this.lastGoalSnapshot = runtime.getSnapshot();
3835
+ this.goalRuntimeUnsubscribe = runtime.subscribe((snapshot, cause) => {
3836
+ const previousGoal = this.lastGoalSnapshot?.goal ?? null;
3837
+ this.lastGoalSnapshot = snapshot;
3838
+ void this.#queueGoalState(snapshot, cause, previousGoal).catch(
3839
+ (error) => debugLogger6.warn(
3840
+ `Failed to emit ACP Goal state: ${error instanceof Error ? error.message : String(error)}`
3841
+ )
3842
+ );
3843
+ });
3844
+ const host = {
3845
+ startGoalTurn: /* @__PURE__ */ __name(async (input) => {
3846
+ if (this.goalQueue.some(
3847
+ ({ permit }) => permit.turnId === input.permit.turnId
3848
+ ) || this.activeGoalTurn?.permit.turnId === input.permit.turnId) {
3849
+ return;
3850
+ }
3851
+ this.goalQueue.push({
3852
+ permit: { ...input.permit },
3853
+ turnKey: `goal-runtime:${input.permit.turnId}`,
3854
+ controller: new AbortController(),
3855
+ origin: "runtime",
3856
+ continuationContext: input.continuationContext,
3857
+ ...input.verifierFeedback ? { verifierFeedback: input.verifierFeedback } : {},
3858
+ modelStarted: false
3859
+ });
3860
+ void this.#drainGoalQueue();
3861
+ }, "startGoalTurn"),
3862
+ preemptGoalTurn: /* @__PURE__ */ __name((reason) => {
3863
+ for (const turn of this.goalQueue.splice(0)) {
3864
+ turn.controller.abort(reason);
3865
+ }
3866
+ this.activeGoalTurn?.controller.abort(reason);
3867
+ }, "preemptGoalTurn")
3868
+ };
3869
+ this.goalHostUnbind = this.config.bindGoalTurnHost(host);
3870
+ } catch (error) {
3871
+ if (!(error instanceof GoalPersistenceUnavailableError)) {
3872
+ throw error;
3873
+ }
3874
+ debugLogger6.debug("Canonical Goal runtime is unavailable for ACP");
3875
+ }
3876
+ }
3877
+ /**
3878
+ * Re-attach this session to the Goal runtime after `/clear`.
3879
+ *
3880
+ * `Config.startNewSession()` disposes the old runtime and builds a fresh
3881
+ * one, so the `subscribe` callback installed by `#bindGoalRuntime` — the
3882
+ * only path that reaches `MessageEmitter.emitGoalState` — would stay
3883
+ * registered on the abandoned instance and the client would never receive
3884
+ * another `_meta.goalState` update. The retained turn host survives the
3885
+ * switch, but the subscription and the publication de-duplication state
3886
+ * belong to the old runtime and have to be rebuilt.
3887
+ */
3888
+ rebindGoalRuntimeForNewSession() {
3889
+ if (this.disposed || this.closing) return;
3890
+ this.goalRuntimeUnsubscribe?.();
3891
+ this.goalRuntimeUnsubscribe = void 0;
3892
+ this.goalHostUnbind?.();
3893
+ this.goalHostUnbind = void 0;
3894
+ this.lastGoalSnapshot = void 0;
3895
+ this.lastGoalPublicationKey = void 0;
3896
+ this.#bindGoalRuntime();
3897
+ }
3898
+ /**
3899
+ * Publish the recovered Goal state once, after history replay.
3900
+ *
3901
+ * Goal recovery runs from the `Config` constructor, long before this
3902
+ * Session exists, so `restore()`'s correction broadcast reaches zero
3903
+ * listeners — and replay streams the pre-migration records, emitting the
3904
+ * legacy `set` card. Clients that derive the live goal from goal cards
3905
+ * (both web-shell and the daemon provider do) are therefore left showing a
3906
+ * goal as running when the migrated goal is `paused` and nothing drives
3907
+ * it; only a second reload self-corrected. Republishing here puts the
3908
+ * authoritative state *after* the replayed card, which is the ordering
3909
+ * that matters. `#publishGoalState` de-duplicates on `(cause, snapshot)`,
3910
+ * so this is a no-op when the subscription already delivered it.
3911
+ *
3912
+ * When recovery failed outright — a malformed or future-schema
3913
+ * `goal_state` record makes `recoverGoalFromRecords` return `unsupported`
3914
+ * — there is no state to publish and no in-session command can correct the
3915
+ * stream, because a degraded `/goal` answers without a cause. That case
3916
+ * gets the same trailing `cleared` card the replay-time
3917
+ * `supersedeUnrestorableGoal` used to emit.
3918
+ */
3919
+ async publishRecoveredGoalState(replayedRecords) {
3920
+ if (this.disposed || this.closing) return;
3921
+ let runtime;
3922
+ try {
3923
+ runtime = await this.config.getGoalRuntimeReady();
3924
+ } catch (error) {
3925
+ if (!(error instanceof GoalPersistenceUnavailableError)) throw error;
3926
+ await this.#supersedeUnrestorableGoal(replayedRecords);
3927
+ return;
3928
+ }
3929
+ const cause = runtime.getRecoveryCause?.();
3930
+ if (!cause) return;
3931
+ await this.#queueGoalState(runtime.getSnapshot(), cause);
3932
+ }
3933
+ /**
3934
+ * Render the recovered-Goal cards instead of streaming them.
3935
+ *
3936
+ * The bulk load-replay path (`historyReplay: 'response'`) does not stream
3937
+ * its replay: `loadSession` collects the page into the `LOAD_REPLAY`
3938
+ * envelope and the bridge seeds those updates onto the session's event bus
3939
+ * *after* the ACP `session/load` call returns. A card streamed from inside
3940
+ * that call therefore lands on the bus **before** the replayed
3941
+ * pre-migration `set` card — the reverse of the ordering
3942
+ * {@link publishRecoveredGoalState} exists to produce, leaving the phantom
3943
+ * running goal exactly as it was. Returning the cards lets the caller
3944
+ * append them to the envelope, after the replay page.
3945
+ *
3946
+ * Appending after a truncated page (`hasMore`) is still correct: paging
3947
+ * drops the oldest records, so the authoritative state belongs last either
3948
+ * way.
3949
+ *
3950
+ * Marks the publication as delivered, so the runtime subscription cannot
3951
+ * emit a duplicate card for the same `(cause, snapshot)` once the session
3952
+ * goes live.
3953
+ */
3954
+ async renderRecoveredGoalUpdates(replayedRecords) {
3955
+ if (this.disposed || this.closing) return [];
3956
+ let runtime;
3957
+ try {
3958
+ runtime = await this.config.getGoalRuntimeReady();
3959
+ } catch (error) {
3960
+ if (!(error instanceof GoalPersistenceUnavailableError)) throw error;
3961
+ const status = this.#unrestorableGoalStatus(replayedRecords);
3962
+ return status ? [buildGoalStatusUpdate(status)] : [];
3963
+ }
3964
+ const cause = runtime.getRecoveryCause?.();
3965
+ if (!cause) return [];
3966
+ const snapshot = runtime.getSnapshot();
3967
+ const publicationKey = this.#goalPublicationKey(snapshot, cause);
3968
+ if (publicationKey === this.lastGoalPublicationKey) return [];
3969
+ this.lastGoalPublicationKey = publicationKey;
3970
+ return [
3971
+ buildGoalStateUpdate(
3972
+ snapshot,
3973
+ cause,
3974
+ this.lastGoalSnapshot?.goal ?? null
3975
+ )
3976
+ ];
3977
+ }
3978
+ /**
3979
+ * Emit a trailing `cleared` card for an active legacy goal the runtime
3980
+ * refused to recover.
3981
+ *
3982
+ * Emitted, not recorded: the transcript keeps its `set` card, so a later
3983
+ * resume that can recover the goal still finds it.
3984
+ */
3985
+ async #supersedeUnrestorableGoal(replayedRecords) {
3986
+ const status = this.#unrestorableGoalStatus(replayedRecords);
3987
+ if (!status) return;
3988
+ await this.messageEmitter.emitGoalStatus(status);
3989
+ }
3990
+ /**
3991
+ * The `cleared` card for an active legacy goal the runtime refused to
3992
+ * recover, or `undefined` when there is nothing to supersede. Shared by the
3993
+ * streaming and rendering recovery paths so they cannot drift.
3994
+ */
3995
+ #unrestorableGoalStatus(replayedRecords) {
3996
+ if (!replayedRecords?.length) return void 0;
3997
+ const active = findGoalToRestore(
3998
+ collectGoalStatusItemsFromRecords(replayedRecords)
3999
+ );
4000
+ if (!active) return void 0;
4001
+ return {
4002
+ kind: "cleared",
4003
+ condition: active.condition,
4004
+ iterations: active.iterations,
4005
+ ...active.setAt !== void 0 ? { setAt: active.setAt } : {},
4006
+ lastReason: "Goal not restored: its saved state could not be read, so this session is not driving it."
4007
+ };
4008
+ }
4009
+ #goalPublicationKey(snapshot, cause) {
4010
+ return cause ? `${cause}:${JSON.stringify(snapshot)}` : void 0;
4011
+ }
4012
+ async #publishGoalState(snapshot, cause, previousGoal = this.lastGoalSnapshot?.goal ?? null) {
4013
+ const publicationKey = this.#goalPublicationKey(snapshot, cause);
4014
+ if (publicationKey && publicationKey === this.lastGoalPublicationKey) {
4015
+ return;
4016
+ }
4017
+ if (publicationKey) this.lastGoalPublicationKey = publicationKey;
4018
+ await this.messageEmitter.emitGoalState(snapshot, cause, previousGoal);
4019
+ }
4020
+ #queueGoalState(snapshot, cause, previousGoal = this.lastGoalSnapshot?.goal ?? null) {
4021
+ const publication = this.goalPublicationTail.then(
4022
+ () => this.#publishGoalState(snapshot, cause, previousGoal)
4023
+ );
4024
+ this.goalPublicationTail = publication.catch(() => void 0);
4025
+ return publication;
4026
+ }
4027
+ async #drainGoalQueue() {
4028
+ if (this.disposed || this.closing || this.goalProcessing || this.pendingPrompt || this.pendingPromptCompletion || this.cronProcessing || this.cronAbortController || this.notificationProcessing || this.notificationAbortController) {
4029
+ return;
4030
+ }
4031
+ const turn = this.goalQueue.shift();
4032
+ if (!turn) return;
4033
+ this.goalProcessing = true;
4034
+ this.activeGoalTurn = turn;
4035
+ const parts = buildGoalContinuationParts(turn);
4036
+ try {
4037
+ await this.prompt(
4038
+ {
4039
+ sessionId: this.sessionId,
4040
+ prompt: parts.map((part) => ({
4041
+ type: "text",
4042
+ text: part.text ?? ""
4043
+ }))
4044
+ },
4045
+ void 0,
4046
+ void 0,
4047
+ void 0,
4048
+ turn
4049
+ );
4050
+ } catch (error) {
4051
+ await this.#settleGoalTurn(turn, void 0, true);
4052
+ debugLogger6.warn(
4053
+ `ACP Goal turn failed: ${error instanceof Error ? error.message : String(error)}`
4054
+ );
4055
+ } finally {
4056
+ if (this.activeGoalTurn === turn) this.activeGoalTurn = void 0;
4057
+ this.goalProcessing = false;
4058
+ void this.#drainCronQueue();
4059
+ void this.#drainNotificationQueue();
4060
+ void this.#drainGoalQueue();
4061
+ }
4062
+ }
4063
+ async #settleGoalTurn(turn, result, failed) {
4064
+ try {
4065
+ const runtime = await this.config.getGoalRuntimeReady();
4066
+ if (!sameGoalPermit(runtime.permitForTurn(turn.turnKey), turn.permit)) {
4067
+ return;
4068
+ }
4069
+ if (!turn.modelStarted) {
4070
+ if (turn.controller.signal.reason === USER_CANCEL_ABORT_REASON && runtime.getSnapshot().goal?.status === "active") {
4071
+ await runtime.dispatch({
4072
+ action: "pause",
4073
+ expectedGoalId: turn.permit.goalId,
4074
+ expectedRevision: turn.permit.revision
4075
+ });
4076
+ } else {
4077
+ await runtime.releaseTurn(turn.turnKey);
4078
+ }
4079
+ return;
4080
+ }
4081
+ try {
4082
+ await this.config.getChatRecordingService()?.flush();
4083
+ } catch (error) {
4084
+ debugLogger6.warn(
4085
+ `Failed to flush ACP Goal turn: ${error instanceof Error ? error.message : String(error)}`
4086
+ );
4087
+ }
4088
+ const cancelledByUser = result?.stopReason === "cancelled" && turn.controller.signal.reason === USER_CANCEL_ABORT_REASON;
4089
+ const supersededByNewPrompt = turn.controller.signal.reason === NEW_PROMPT_ABORT_REASON;
4090
+ const shouldPause = !supersededByNewPrompt && (failed || result?.stopReason === "max_tokens" || cancelledByUser || turn.controller.signal.reason === SESSION_DISPOSE_ABORT_REASON);
4091
+ try {
4092
+ if (shouldPause && runtime.getSnapshot().goal?.status === "active") {
4093
+ await runtime.dispatch({
4094
+ action: "pause",
4095
+ expectedGoalId: turn.permit.goalId,
4096
+ expectedRevision: turn.permit.revision
4097
+ });
4098
+ return;
4099
+ }
4100
+ await runtime.finishTurn(turn.permit);
4101
+ } catch (error) {
4102
+ debugLogger6.warn(
4103
+ `Failed to record ACP Goal turn settlement: ${error instanceof Error ? error.message : String(error)}`
4104
+ );
4105
+ await runtime.releaseTurn(turn.turnKey);
4106
+ }
4107
+ } catch (error) {
4108
+ debugLogger6.warn(
4109
+ `Failed to settle ACP Goal turn: ${error instanceof Error ? error.message : String(error)}`
4110
+ );
4111
+ }
4112
+ }
4113
+ /**
4114
+ * Stops an autonomous Goal loop when the Stop-hook blocking cap fires.
4115
+ *
4116
+ * `abortGoalForStopHookCap` only knows about the legacy `activeGoalStore`,
4117
+ * which no longer has a writer for daemon sessions, so ACP needs the
4118
+ * canonical runtime acted on directly.
4119
+ */
4120
+ async #pauseGoalForStopHookCap() {
4121
+ try {
4122
+ const runtime = await this.config.getGoalRuntimeReady();
4123
+ const goal = runtime.getSnapshot().goal;
4124
+ if (goal?.status !== "active") return;
4125
+ await runtime.dispatch({
4126
+ action: "pause",
4127
+ expectedGoalId: goal.goalId,
4128
+ expectedRevision: goal.revision
4129
+ });
4130
+ } catch (error) {
4131
+ debugLogger6.warn(
4132
+ `Failed to pause the Goal after the Stop hook cap: ${error instanceof Error ? error.message : String(error)}`
4133
+ );
4134
+ }
4135
+ }
3486
4136
  async #requestWorkflowApproval(runId, approval, rawArgs, approvalSignal) {
3487
4137
  const registry = this.config.getWorkflowRunRegistry();
3488
4138
  const externalToolCallId = `workflow:${this.sessionId}:${runId}:${approval.approvalId}`;
@@ -4136,7 +4786,7 @@ var Session = class {
4136
4786
  }
4137
4787
  #hasActiveTurn() {
4138
4788
  return Boolean(
4139
- this.pendingPrompt || this.pendingPromptCompletion || this.cronProcessing || this.cronAbortController || this.cronCompletion || this.notificationProcessing || this.notificationAbortController || this.notificationCompletion
4789
+ this.pendingPrompt || this.pendingPromptCompletion || this.goalProcessing || this.cronProcessing || this.cronAbortController || this.cronCompletion || this.notificationProcessing || this.notificationAbortController || this.notificationCompletion
4140
4790
  );
4141
4791
  }
4142
4792
  beginClose() {
@@ -4164,6 +4814,7 @@ var Session = class {
4164
4814
  resolveGate();
4165
4815
  if (this.disposed) return;
4166
4816
  this.closing = false;
4817
+ void this.#drainGoalQueue();
4167
4818
  void this.#drainCronQueue();
4168
4819
  void this.#drainNotificationQueue();
4169
4820
  };
@@ -4227,6 +4878,14 @@ var Session = class {
4227
4878
  this.hardSuspendTodoStopGuard();
4228
4879
  this.notificationQueue = [];
4229
4880
  this.cronQueue = [];
4881
+ for (const turn of this.goalQueue.splice(0)) {
4882
+ turn.controller.abort(SESSION_DISPOSE_ABORT_REASON);
4883
+ }
4884
+ this.activeGoalTurn?.controller.abort(SESSION_DISPOSE_ABORT_REASON);
4885
+ this.goalHostUnbind?.();
4886
+ this.goalHostUnbind = void 0;
4887
+ this.goalRuntimeUnsubscribe?.();
4888
+ this.goalRuntimeUnsubscribe = void 0;
4230
4889
  this.notificationAbortController?.abort();
4231
4890
  this.notificationAbortController = null;
4232
4891
  this.notificationProcessing = false;
@@ -4254,7 +4913,6 @@ var Session = class {
4254
4913
  this.config.setSubSessionSpawner(void 0);
4255
4914
  this.config.getWorkflowRunRegistry?.().setApprovalRequestCallback(void 0);
4256
4915
  this.workflowApprovalAbortController.abort(SESSION_DISPOSE_ABORT_REASON);
4257
- clearGoalTerminalObserver(this.sessionId);
4258
4916
  }
4259
4917
  /**
4260
4918
  * Install the message rewrite middleware if configured.
@@ -4271,43 +4929,6 @@ var Session = class {
4271
4929
  );
4272
4930
  }
4273
4931
  }
4274
- /**
4275
- * Installs (or replaces) this session's goal-terminal observer.
4276
- *
4277
- * Public because it does not stay installed: `registerGoalHook` and
4278
- * `unregisterGoalHook` both clear the observer table for the session, so any
4279
- * caller that (re-)registers a goal outside `#processSlashCommandResult` —
4280
- * notably goal restore on resume — has to put it back. Idempotent.
4281
- */
4282
- installGoalTerminalObserver() {
4283
- setGoalTerminalObserver(this.sessionId, (event) => {
4284
- void this.messageEmitter.emitGoalTerminal(event).catch((error) => {
4285
- debugLogger6.warn(
4286
- `Failed to emit goal terminal update: ${this.#formatError(error)}`
4287
- );
4288
- });
4289
- recordGoalStatusItem(this.config, goalTerminalEventToHistoryItem(event));
4290
- });
4291
- }
4292
- /**
4293
- * Emits a goal card and persists it to the transcript. Both `set` and
4294
- * `cleared` reach the client this way — from `#emitGoalStatusItems` for a
4295
- * `/goal` prompt, and from the `sessionGoalClear` ext method — so recording
4296
- * here (rather than at each call site) keeps the transcript in step with the
4297
- * hook. Replay goes through `messageEmitter.emitGoalStatus` directly and so
4298
- * does not re-record.
4299
- */
4300
- emitGoalStatus(status) {
4301
- void this.messageEmitter.emitGoalStatus(status).catch((error) => {
4302
- debugLogger6.warn(
4303
- `Failed to emit goal status update: ${this.#formatError(error)}`
4304
- );
4305
- });
4306
- recordGoalStatusItem(this.config, {
4307
- type: "goal_status" /* GOAL_STATUS */,
4308
- ...status
4309
- });
4310
- }
4311
4932
  /**
4312
4933
  * Replays conversation history to the client using modular components.
4313
4934
  * Delegates to HistoryReplayer for consistent event emission.
@@ -4446,11 +5067,13 @@ var Session = class {
4446
5067
  const hadPrompt = !!this.pendingPrompt;
4447
5068
  const hadCron = !!this.cronAbortController;
4448
5069
  const hadNotification = !!this.notificationAbortController || this.notificationProcessing;
5070
+ const queuedGoalTurns = this.goalQueue.splice(0);
5071
+ const hadQueuedGoalTurn = queuedGoalTurns.length > 0;
4449
5072
  if (this.followupAbort) {
4450
5073
  this.followupAbort.abort();
4451
5074
  this.followupAbort = null;
4452
5075
  }
4453
- if (!hadPrompt && !hadCron && !hadNotification) {
5076
+ if (!hadPrompt && !hadCron && !hadNotification && !hadQueuedGoalTurn) {
4454
5077
  throw new Error(NOT_CURRENTLY_GENERATING_CANCEL_MESSAGE);
4455
5078
  }
4456
5079
  this.todoStopGuard.suspend();
@@ -4458,6 +5081,9 @@ var Session = class {
4458
5081
  this.pendingPrompt.abort(USER_CANCEL_ABORT_REASON);
4459
5082
  this.pendingPrompt = null;
4460
5083
  }
5084
+ for (const turn of queuedGoalTurns) {
5085
+ turn.controller.abort(USER_CANCEL_ABORT_REASON);
5086
+ }
4461
5087
  if (this.cronAbortController) {
4462
5088
  this.cronAbortController.abort();
4463
5089
  this.cronAbortController = null;
@@ -4470,6 +5096,26 @@ var Session = class {
4470
5096
  }
4471
5097
  this.notificationQueue = [];
4472
5098
  this.notificationProcessing = false;
5099
+ const queuedGoalTurn = queuedGoalTurns[0];
5100
+ if (queuedGoalTurn) {
5101
+ try {
5102
+ const runtime = this.config.getGoalRuntime();
5103
+ if (sameGoalPermit(
5104
+ runtime.permitForTurn(queuedGoalTurn.turnKey),
5105
+ queuedGoalTurn.permit
5106
+ ) && runtime.getSnapshot().goal?.status === "active") {
5107
+ await runtime.dispatch({
5108
+ action: "pause",
5109
+ expectedGoalId: queuedGoalTurn.permit.goalId,
5110
+ expectedRevision: queuedGoalTurn.permit.revision
5111
+ });
5112
+ }
5113
+ } catch (error) {
5114
+ debugLogger6.warn(
5115
+ `Failed to pause queued ACP Goal turn: ${error instanceof Error ? error.message : String(error)}`
5116
+ );
5117
+ }
5118
+ }
4473
5119
  this.#activeWorkChanged();
4474
5120
  const scheduler = this.config.isCronEnabled() ? this.config.getCronScheduler() : null;
4475
5121
  if (scheduler) {
@@ -4480,7 +5126,7 @@ var Session = class {
4480
5126
  }
4481
5127
  }
4482
5128
  }
4483
- async prompt(params, invocationContext, admissionCancellation, modelPrompt) {
5129
+ async prompt(params, invocationContext, admissionCancellation, modelPrompt, scheduledGoalTurn) {
4484
5130
  if (this.closing) {
4485
5131
  throw RequestError.invalidParams(void 0, "Session is closing");
4486
5132
  }
@@ -4507,8 +5153,27 @@ var Session = class {
4507
5153
  return { stopReason: "cancelled" };
4508
5154
  }
4509
5155
  const todoStopGuardPreparation = this.#prepareTodoStopGuardForPrompt(params);
4510
- this.pendingPrompt?.abort();
4511
- const pendingSend = new AbortController();
5156
+ let goalTurn = scheduledGoalTurn;
5157
+ let reservedGoalRuntime;
5158
+ let reservedGoalTurnKey;
5159
+ if (!goalTurn) {
5160
+ try {
5161
+ const runtime = this.config.getGoalRuntime();
5162
+ if (runtime.getSnapshot().goal?.status === "active") {
5163
+ reservedGoalRuntime = runtime;
5164
+ reservedGoalTurnKey = `goal-user:${randomUUID()}`;
5165
+ runtime.beginTurn(reservedGoalTurnKey);
5166
+ for (const queued of this.goalQueue.splice(0)) {
5167
+ queued.controller.abort(NEW_PROMPT_ABORT_REASON);
5168
+ await runtime.releaseTurn(queued.turnKey);
5169
+ }
5170
+ }
5171
+ } catch (error) {
5172
+ if (!(error instanceof GoalPersistenceUnavailableError)) throw error;
5173
+ }
5174
+ }
5175
+ this.pendingPrompt?.abort(NEW_PROMPT_ABORT_REASON);
5176
+ const pendingSend = goalTurn?.controller ?? new AbortController();
4512
5177
  const cancelPendingSend = /* @__PURE__ */ __name(() => pendingSend.abort(USER_CANCEL_ABORT_REASON), "cancelPendingSend");
4513
5178
  if (admissionCancellation) {
4514
5179
  admissionCancellation.addEventListener("abort", cancelPendingSend, {
@@ -4558,7 +5223,46 @@ var Session = class {
4558
5223
  } catch {
4559
5224
  }
4560
5225
  }
5226
+ if (reservedGoalRuntime && reservedGoalTurnKey) {
5227
+ try {
5228
+ const permit = await claimGoalTurn(
5229
+ reservedGoalRuntime,
5230
+ reservedGoalTurnKey,
5231
+ pendingSend.signal
5232
+ );
5233
+ if (permit) {
5234
+ const goal = reservedGoalRuntime.getSnapshot().goal;
5235
+ if (goal) {
5236
+ const verifierFeedback = reservedGoalRuntime.getVerifierFeedback(permit);
5237
+ goalTurn = {
5238
+ permit,
5239
+ turnKey: reservedGoalTurnKey,
5240
+ controller: pendingSend,
5241
+ origin: "user",
5242
+ continuationContext: goal.objective,
5243
+ ...verifierFeedback ? { verifierFeedback } : {},
5244
+ modelStarted: false
5245
+ };
5246
+ }
5247
+ }
5248
+ } catch (error) {
5249
+ try {
5250
+ await reservedGoalRuntime.releaseTurn(reservedGoalTurnKey);
5251
+ } catch (releaseError) {
5252
+ debugLogger6.warn(
5253
+ `Failed to release Goal reservation after admission failure: ${releaseError instanceof Error ? releaseError.message : String(releaseError)}`
5254
+ );
5255
+ } finally {
5256
+ releasePendingSend();
5257
+ this.todoStopGuard.suspend();
5258
+ }
5259
+ throw error;
5260
+ }
5261
+ }
4561
5262
  if (pendingSend.signal.aborted) {
5263
+ if (reservedGoalRuntime && reservedGoalTurnKey) {
5264
+ await reservedGoalRuntime.releaseTurn(reservedGoalTurnKey);
5265
+ }
4562
5266
  releasePendingSend();
4563
5267
  this.todoStopGuard.suspend();
4564
5268
  return { stopReason: "cancelled" };
@@ -4575,14 +5279,18 @@ var Session = class {
4575
5279
  this.pendingPromptCompletion = new Promise((resolve6) => {
4576
5280
  resolveCompletion = resolve6;
4577
5281
  });
5282
+ let promptResult;
5283
+ let promptFailed = false;
4578
5284
  try {
4579
5285
  const result = await this.#executePrompt(
4580
5286
  params,
4581
5287
  pendingSend,
4582
5288
  channelDeliveryCapture,
4583
5289
  invocationContext,
4584
- modelPrompt
5290
+ modelPrompt,
5291
+ goalTurn
4585
5292
  );
5293
+ promptResult = result;
4586
5294
  releasePendingSend();
4587
5295
  void this.#drainCronQueue();
4588
5296
  void this.#drainNotificationQueue();
@@ -4601,6 +5309,7 @@ var Session = class {
4601
5309
  }
4602
5310
  return result;
4603
5311
  } catch (error) {
5312
+ promptFailed = true;
4604
5313
  if (error instanceof SessionWriterError) {
4605
5314
  throw new RequestError(error.rpcCode, error.message, {
4606
5315
  errorKind: error.errorKind
@@ -4618,9 +5327,15 @@ var Session = class {
4618
5327
  void this.#drainCronQueue();
4619
5328
  void this.#drainNotificationQueue();
4620
5329
  }
5330
+ if (goalTurn) {
5331
+ await this.#settleGoalTurn(goalTurn, promptResult, promptFailed);
5332
+ } else if (reservedGoalRuntime && reservedGoalTurnKey) {
5333
+ await reservedGoalRuntime.releaseTurn(reservedGoalTurnKey);
5334
+ }
4621
5335
  void this.#startCronSchedulerInRuntime();
4622
5336
  resolveCompletion();
4623
5337
  this.pendingPromptCompletion = null;
5338
+ void this.#drainGoalQueue();
4624
5339
  await this.#consumeLiveEndInstruction();
4625
5340
  }
4626
5341
  }
@@ -4742,7 +5457,7 @@ var Session = class {
4742
5457
  }
4743
5458
  })();
4744
5459
  }
4745
- async #executePrompt(params, pendingSend, channelDeliveryCapture, invocationContext, modelPrompt) {
5460
+ async #executePrompt(params, pendingSend, channelDeliveryCapture, invocationContext, modelPrompt, goalTurn) {
4746
5461
  const sessionId = this.config.getSessionId();
4747
5462
  if (invocationContext !== void 0 && invocationContext.sessionId !== sessionId) {
4748
5463
  throw RequestError.invalidParams(
@@ -4750,7 +5465,7 @@ var Session = class {
4750
5465
  "Invocation context session does not match the active session"
4751
5466
  );
4752
5467
  }
4753
- return runWithInvocationContext(
5468
+ const execute = /* @__PURE__ */ __name(() => runWithInvocationContext(
4754
5469
  invocationContext,
4755
5470
  () => sessionIdContext.run(
4756
5471
  sessionId,
@@ -4758,12 +5473,14 @@ var Session = class {
4758
5473
  params,
4759
5474
  pendingSend,
4760
5475
  channelDeliveryCapture,
4761
- modelPrompt
5476
+ modelPrompt,
5477
+ goalTurn
4762
5478
  )
4763
5479
  )
4764
- );
5480
+ ), "execute");
5481
+ return goalTurn ? goalTurnContext.run(goalTurn.permit, execute) : goalTurnContext.exit(execute);
4765
5482
  }
4766
- async #executePromptInner(params, pendingSend, channelDeliveryCapture, modelPrompt) {
5483
+ async #executePromptInner(params, pendingSend, channelDeliveryCapture, modelPrompt, goalTurn) {
4767
5484
  return Storage.runWithRuntimeBaseDir(
4768
5485
  this.runtimeBaseDir,
4769
5486
  this.config.getWorkingDir(),
@@ -4788,6 +5505,7 @@ var Session = class {
4788
5505
  },
4789
5506
  async () => {
4790
5507
  const promptText = params.prompt.filter((block) => block.type === "text").map((block) => block.type === "text" ? block.text : "").join(" ");
5508
+ const promptDisplayText = typeof promptMetadata?.[DAEMON_PROMPT_DISPLAY_TEXT_META_KEY] === "string" ? promptMetadata[DAEMON_PROMPT_DISPLAY_TEXT_META_KEY] : void 0;
4791
5509
  const modelPromptBlocks = modelPrompt === void 0 ? params.prompt : [{ type: "text", text: modelPrompt }];
4792
5510
  logUserPrompt(
4793
5511
  this.config,
@@ -4803,7 +5521,12 @@ var Session = class {
4803
5521
  let continuationParts = null;
4804
5522
  let strippedOrphanEntries = null;
4805
5523
  let orphanPushCountSnapshot = 0;
4806
- if (isContinue) {
5524
+ if (goalTurn?.origin === "runtime") {
5525
+ this.config.getChatRecordingService()?.recordGoalRuntimeMessage(
5526
+ modelPromptBlocks.filter((block) => block.type === "text").map((block) => ({ text: block.text })),
5527
+ goalTurn.permit
5528
+ );
5529
+ } else if (isContinue) {
4807
5530
  const recoveryPlan = buildSessionRecoveryPlanFromApiHistory({
4808
5531
  sessionId: this.sessionId,
4809
5532
  apiHistory: this.#getCurrentChat().getHistory()
@@ -4829,11 +5552,22 @@ var Session = class {
4829
5552
  continuationParts = recoveryPlan.continuation.parts;
4830
5553
  }
4831
5554
  }
4832
- if (isContinue) {
5555
+ if (goalTurn?.origin === "runtime") {
5556
+ } else if (isContinue) {
4833
5557
  } else if (isRetry) {
4834
5558
  this.#getCurrentChat().stripOrphanedUserEntriesFromHistory();
4835
5559
  } else {
4836
- this.config.getChatRecordingService()?.recordUserMessage(promptText);
5560
+ const recorder = this.config.getChatRecordingService();
5561
+ if (promptDisplayText !== void 0) {
5562
+ recorder?.recordUserMessage(promptText, goalTurn?.permit, {
5563
+ displayText: promptDisplayText,
5564
+ hookContext: ""
5565
+ });
5566
+ } else if (goalTurn) {
5567
+ recorder?.recordUserMessage(promptText, goalTurn.permit);
5568
+ } else {
5569
+ recorder?.recordUserMessage(promptText);
5570
+ }
4837
5571
  }
4838
5572
  const firstTextBlock = modelPromptBlocks.find(
4839
5573
  (block) => block.type === "text"
@@ -4862,7 +5596,13 @@ var Session = class {
4862
5596
  inputText,
4863
5597
  pendingSend,
4864
5598
  this.config,
4865
- this.settings
5599
+ this.settings,
5600
+ {
5601
+ // `/clear` swaps in a new Goal runtime under this
5602
+ // long-lived Session; without this the goal-state
5603
+ // subscription stays on the disposed instance.
5604
+ startNewSession: /* @__PURE__ */ __name(() => this.rebindGoalRuntimeForNewSession(), "startNewSession")
5605
+ }
4866
5606
  );
4867
5607
  parts = await this.#processSlashCommandResult(
4868
5608
  slashCommandResult,
@@ -4882,7 +5622,8 @@ var Session = class {
4882
5622
  }
4883
5623
  const hooksEnabled = !this.config.getDisableAllHooks?.();
4884
5624
  const messageBus = this.config.getMessageBus?.();
4885
- if (!isContinue && hooksEnabled && messageBus && this.config.hasHooksForEvent?.("UserPromptSubmit")) {
5625
+ const isRuntimeContinuation = goalTurn?.origin === "runtime";
5626
+ if (!isContinue && !isRuntimeContinuation && hooksEnabled && messageBus && this.config.hasHooksForEvent?.("UserPromptSubmit")) {
4886
5627
  const response = await messageBus.request(
4887
5628
  {
4888
5629
  type: "hook-execution-request" /* HOOK_EXECUTION_REQUEST */,
@@ -4996,6 +5737,7 @@ ${this.pendingRecoveredAgentsNotice}
4996
5737
  );
4997
5738
  let channelDeliveryResponseBlock;
4998
5739
  try {
5740
+ if (goalTurn) goalTurn.modelStarted = true;
4999
5741
  const sendResult = await this.#sendMessageStreamWithAutoCompression(
5000
5742
  promptId,
5001
5743
  nextMessage?.parts ?? [],
@@ -5404,11 +6146,13 @@ ${this.pendingRecoveredAgentsNotice}
5404
6146
  "Stop",
5405
6147
  stopHookBlockingCap
5406
6148
  );
5407
- abortGoalForStopHookCap(
6149
+ if (!abortGoalForStopHookCap(
5408
6150
  this.config,
5409
6151
  this.config.getSessionId(),
5410
6152
  warning
5411
- );
6153
+ )) {
6154
+ await this.#pauseGoalForStopHookCap();
6155
+ }
5412
6156
  this.todoStopGuard.suspend();
5413
6157
  await this.messageEmitter.emitAgentMessage(warning);
5414
6158
  debugLogger6.warn(warning);
@@ -6149,16 +6893,16 @@ ${this.pendingRecoveredAgentsNotice}
6149
6893
  );
6150
6894
  return { responseStream: null, stopReason: "cancelled" };
6151
6895
  }
6152
- const responseStream = await this.#getCurrentChat().sendMessageStream(
6153
- options.getModelOverride?.() ?? options.modelOverride ?? this.config.getModel(),
6154
- {
6155
- message,
6156
- config: {
6157
- abortSignal
6158
- }
6159
- },
6160
- promptId
6161
- );
6896
+ const chat = this.#getCurrentChat();
6897
+ const model = options.getModelOverride?.() ?? options.modelOverride ?? this.config.getModel();
6898
+ const request = {
6899
+ message,
6900
+ config: {
6901
+ abortSignal
6902
+ }
6903
+ };
6904
+ const goalPermit = goalTurnContext.getStore();
6905
+ const responseStream = goalPermit ? await chat.sendMessageStream(model, request, promptId, goalPermit) : await chat.sendMessageStream(model, request, promptId);
6162
6906
  return { responseStream };
6163
6907
  }
6164
6908
  #preserveUnsentMessageHistory(message, preserveFullMessage) {
@@ -6638,6 +7382,7 @@ ${this.pendingRecoveredAgentsNotice}
6638
7382
  if (this.closing) return;
6639
7383
  if (this.cronProcessing) return;
6640
7384
  if (this.pendingPrompt) return;
7385
+ if (this.goalProcessing) return;
6641
7386
  if (this.notificationProcessing) return;
6642
7387
  if (this.#deferAutomaticQueueDrainUntilTurnsSettle()) return;
6643
7388
  if (this.#nextCronQueueIndex() < 0) return;
@@ -6649,7 +7394,7 @@ ${this.pendingRecoveredAgentsNotice}
6649
7394
  );
6650
7395
  return;
6651
7396
  }
6652
- if (this.disposed || this.closing || this.cronProcessing || this.pendingPrompt || this.notificationProcessing || this.#nextCronQueueIndex() < 0) {
7397
+ if (this.disposed || this.closing || this.cronProcessing || this.pendingPrompt || this.goalProcessing || this.notificationProcessing || this.#nextCronQueueIndex() < 0) {
6653
7398
  return;
6654
7399
  }
6655
7400
  if (this.#deferAutomaticQueueDrainUntilTurnsSettle()) return;
@@ -6670,6 +7415,7 @@ ${this.pendingRecoveredAgentsNotice}
6670
7415
  this.cronProcessing = false;
6671
7416
  resolveCompletion();
6672
7417
  this.cronCompletion = null;
7418
+ void this.#drainGoalQueue();
6673
7419
  void this.#drainNotificationQueue();
6674
7420
  if (this.config.isCronEnabled()) {
6675
7421
  const scheduler = this.config.getCronScheduler();
@@ -7039,6 +7785,7 @@ ${this.pendingRecoveredAgentsNotice}
7039
7785
  backgroundRegistry.setStatusChangeCallback(this.#statusChangeCallback);
7040
7786
  backgroundRegistry.setNotificationCallback(
7041
7787
  (displayText, modelText, meta) => {
7788
+ const entry = backgroundRegistry.get(meta.agentId);
7042
7789
  this.#enqueueBackgroundNotification({
7043
7790
  displayText,
7044
7791
  modelText,
@@ -7047,7 +7794,12 @@ ${this.pendingRecoveredAgentsNotice}
7047
7794
  kind: "agent",
7048
7795
  continuesTodoStopGuardWorkChain: this.#agentContinuesTodoStopGuardWorkChain(meta.agentId),
7049
7796
  toolUseId: meta.toolUseId,
7050
- todoWorkChainId: meta.todoWorkChainId
7797
+ todoWorkChainId: meta.todoWorkChainId,
7798
+ structured: entry ? {
7799
+ description: truncateNotificationLabel(
7800
+ buildBackgroundEntryLabel(entry)
7801
+ )
7802
+ } : void 0
7051
7803
  });
7052
7804
  }
7053
7805
  );
@@ -7056,6 +7808,7 @@ ${this.pendingRecoveredAgentsNotice}
7056
7808
  if (meta.status === "running") {
7057
7809
  return;
7058
7810
  }
7811
+ const entry = monitorRegistry.get(meta.monitorId);
7059
7812
  this.#enqueueBackgroundNotification({
7060
7813
  displayText,
7061
7814
  modelText,
@@ -7067,11 +7820,17 @@ ${this.pendingRecoveredAgentsNotice}
7067
7820
  meta.ownerAgentId
7068
7821
  ),
7069
7822
  toolUseId: meta.toolUseId,
7070
- todoWorkChainId: meta.todoWorkChainId
7823
+ todoWorkChainId: meta.todoWorkChainId,
7824
+ structured: entry ? {
7825
+ description: truncateNotificationLabel(entry.description),
7826
+ eventCount: meta.eventCount,
7827
+ droppedLines: entry.droppedLines || void 0
7828
+ } : void 0
7071
7829
  });
7072
7830
  });
7073
7831
  const shellRegistry = this.config.getBackgroundShellRegistry();
7074
7832
  shellRegistry.setNotificationCallback((displayText, modelText, meta) => {
7833
+ const entry = shellRegistry.get(meta.shellId);
7075
7834
  this.#enqueueBackgroundNotification({
7076
7835
  displayText,
7077
7836
  modelText,
@@ -7079,7 +7838,8 @@ ${this.pendingRecoveredAgentsNotice}
7079
7838
  status: meta.status,
7080
7839
  kind: "shell",
7081
7840
  continuesTodoStopGuardWorkChain: !this.todoStopGuardBackgroundBaseline.shells.has(meta.shellId),
7082
- todoWorkChainId: meta.todoWorkChainId
7841
+ todoWorkChainId: meta.todoWorkChainId,
7842
+ structured: entry ? { commandLabel: truncateNotificationLabel(entry.description) } : void 0
7083
7843
  });
7084
7844
  });
7085
7845
  this.config.getChatRecordingService()?.setTitleRecordedCallback((customTitle, titleSource, sessionId) => {
@@ -7170,7 +7930,8 @@ ${this.pendingRecoveredAgentsNotice}
7170
7930
  taskId: item.taskId,
7171
7931
  status: item.status,
7172
7932
  kind: item.kind,
7173
- toolUseId: item.toolUseId
7933
+ toolUseId: item.toolUseId,
7934
+ ...item.structured
7174
7935
  }
7175
7936
  );
7176
7937
  } catch (error) {
@@ -7193,7 +7954,7 @@ ${this.pendingRecoveredAgentsNotice}
7193
7954
  if (this.disposed) return;
7194
7955
  if (this.closing) return;
7195
7956
  if (this.notificationProcessing) return;
7196
- if (this.pendingPrompt || this.cronProcessing || this.cronAbortController) {
7957
+ if (this.pendingPrompt || this.goalProcessing || this.cronProcessing || this.cronAbortController) {
7197
7958
  return;
7198
7959
  }
7199
7960
  if (this.#deferAutomaticQueueDrainUntilTurnsSettle()) return;
@@ -7207,7 +7968,7 @@ ${this.pendingRecoveredAgentsNotice}
7207
7968
  );
7208
7969
  return;
7209
7970
  }
7210
- if (this.disposed || this.closing || this.notificationProcessing || this.pendingPrompt || this.cronProcessing || this.cronAbortController || this.#nextNotificationQueueIndex() < 0) {
7971
+ if (this.disposed || this.closing || this.notificationProcessing || this.pendingPrompt || this.goalProcessing || this.cronProcessing || this.cronAbortController || this.#nextNotificationQueueIndex() < 0) {
7211
7972
  return;
7212
7973
  }
7213
7974
  if (this.#deferAutomaticQueueDrainUntilTurnsSettle()) return;
@@ -7218,7 +7979,7 @@ ${this.pendingRecoveredAgentsNotice}
7218
7979
  });
7219
7980
  try {
7220
7981
  while (this.notificationQueue.length > 0) {
7221
- if (this.pendingPrompt || this.cronProcessing || this.cronAbortController) {
7982
+ if (this.pendingPrompt || this.goalProcessing || this.cronProcessing || this.cronAbortController) {
7222
7983
  break;
7223
7984
  }
7224
7985
  const nextIndex = this.#nextNotificationQueueIndex();
@@ -7245,8 +8006,9 @@ ${this.pendingRecoveredAgentsNotice}
7245
8006
  resolveCompletion();
7246
8007
  this.notificationCompletion = null;
7247
8008
  this.#activeWorkChanged();
8009
+ void this.#drainGoalQueue();
7248
8010
  void this.#drainCronQueue();
7249
- if (this.notificationQueue.length > 0 && !this.pendingPrompt && !this.cronProcessing && !this.cronAbortController) {
8011
+ if (this.notificationQueue.length > 0 && !this.pendingPrompt && !this.goalProcessing && !this.cronProcessing && !this.cronAbortController) {
7250
8012
  void this.#drainNotificationQueue();
7251
8013
  }
7252
8014
  }
@@ -7283,7 +8045,8 @@ ${this.pendingRecoveredAgentsNotice}
7283
8045
  taskId: item.taskId,
7284
8046
  status: item.status,
7285
8047
  kind: item.kind,
7286
- toolUseId: item.toolUseId
8048
+ toolUseId: item.toolUseId,
8049
+ ...item.structured
7287
8050
  });
7288
8051
  }
7289
8052
  const notificationReminders = await this.#buildInitialSystemReminders();
@@ -7499,7 +8262,8 @@ ${this.pendingRecoveredAgentsNotice}
7499
8262
  taskId: item.taskId,
7500
8263
  status: item.status,
7501
8264
  kind: item.kind,
7502
- toolUseId: item.toolUseId
8265
+ toolUseId: item.toolUseId,
8266
+ ...item.structured
7503
8267
  }
7504
8268
  }
7505
8269
  });
@@ -9721,30 +10485,6 @@ ${this.pendingRecoveredAgentsNotice}
9721
10485
  }
9722
10486
  }
9723
10487
  }
9724
- #emitGoalStatusItems(result) {
9725
- if (!("outputHistoryItems" in result)) {
9726
- return;
9727
- }
9728
- let hasActiveGoalStatus = false;
9729
- for (const item of result.outputHistoryItems ?? []) {
9730
- if (item.type === "goal_status" /* GOAL_STATUS */) {
9731
- this.emitGoalStatus({
9732
- kind: item.kind,
9733
- condition: item.condition,
9734
- ...item.iterations !== void 0 ? { iterations: item.iterations } : {},
9735
- ...item.setAt !== void 0 ? { setAt: item.setAt } : {},
9736
- ...item.durationMs !== void 0 ? { durationMs: item.durationMs } : {},
9737
- ...item.lastReason !== void 0 ? { lastReason: item.lastReason } : {}
9738
- });
9739
- if (!isTerminalGoalStatusKind(item.kind)) {
9740
- hasActiveGoalStatus = true;
9741
- }
9742
- }
9743
- }
9744
- if (hasActiveGoalStatus) {
9745
- this.installGoalTerminalObserver();
9746
- }
9747
- }
9748
10488
  /**
9749
10489
  * Processes the result of a slash command execution.
9750
10490
  *
@@ -9762,7 +10502,6 @@ ${this.pendingRecoveredAgentsNotice}
9762
10502
  * @returns Parts to use for the prompt, or null if command was handled without needing model interaction
9763
10503
  */
9764
10504
  async #processSlashCommandResult(result, originalPrompt, abortSignal, onFullTurnModel) {
9765
- this.#emitGoalStatusItems(result);
9766
10505
  this.refreshContextFilesOnWrite = result.type === "submit_prompt" && Boolean(result.refreshContextFilesOnWrite);
9767
10506
  switch (result.type) {
9768
10507
  case "submit_prompt":
@@ -9813,9 +10552,15 @@ ${this.pendingRecoveredAgentsNotice}
9813
10552
  throw new Error(unsupportedError);
9814
10553
  }
9815
10554
  case "goal_control":
9816
- throw new Error(
9817
- "Canonical Goal control is not available in ACP integration yet."
9818
- );
10555
+ if (!result.cause) {
10556
+ await this.#queueGoalState(
10557
+ result.response.snapshot,
10558
+ void 0,
10559
+ this.lastGoalSnapshot?.goal ?? null
10560
+ );
10561
+ this.lastGoalSnapshot = result.response.snapshot;
10562
+ }
10563
+ return null;
9819
10564
  case "no_command":
9820
10565
  return this.#resolvePrompt(originalPrompt, abortSignal, {
9821
10566
  promptLast: true,
@@ -10362,6 +11107,22 @@ var ActiveWorkReporter = class {
10362
11107
  }
10363
11108
  };
10364
11109
 
11110
+ // packages/cli/src/acp-integration/model-configuration.ts
11111
+ init_esbuild_shims();
11112
+ var MODEL_CONFIGURATIONS = {
11113
+ "qwen3.8-max": {
11114
+ reasoning: {
11115
+ thinking: true,
11116
+ efforts: ["low", "medium", "xhigh"],
11117
+ defaultEffort: "xhigh"
11118
+ }
11119
+ }
11120
+ };
11121
+ function getModelConfiguration(modelId) {
11122
+ return modelId === "qwen3.8-max" ? MODEL_CONFIGURATIONS[modelId] : void 0;
11123
+ }
11124
+ __name(getModelConfiguration, "getModelConfiguration");
11125
+
10365
11126
  // packages/cli/src/acp-integration/session/tasksSnapshot.ts
10366
11127
  init_esbuild_shims();
10367
11128
  function runtimeMs(entry, now) {
@@ -10499,6 +11260,7 @@ var BTW_CHILD_TIMEOUT_MS = 55e3;
10499
11260
  var MCP_OAUTH_START_TIMEOUT_MS = 3e4;
10500
11261
  var SESSION_DRAIN_TIMEOUT_MS = 3e4;
10501
11262
  var ACP_REASONING_EFFORT_DEFAULT = "default";
11263
+ var ACP_REASONING_EFFORT_NONE = "none";
10502
11264
  var ACP_REASONING_EFFORT_NAMES = {
10503
11265
  low: "Low",
10504
11266
  medium: "Medium",
@@ -13274,11 +14036,6 @@ var QwenAgent = class {
13274
14036
  cleanupErrors.push(error);
13275
14037
  }
13276
14038
  }
13277
- try {
13278
- unregisterGoalHook(session.getConfig(), sessionId);
13279
- } catch (error) {
13280
- cleanupErrors.push(error);
13281
- }
13282
14039
  try {
13283
14040
  this.mcpPool?.releaseSession(sessionId);
13284
14041
  } catch (error) {
@@ -13550,7 +14307,7 @@ var QwenAgent = class {
13550
14307
  }
13551
14308
  this.clientCapabilities = args.clientCapabilities;
13552
14309
  const authMethods = buildAuthMethods();
13553
- const version = "0.21.10";
14310
+ const version = "0.21.11";
13554
14311
  const response = {
13555
14312
  protocolVersion: PROTOCOL_VERSION,
13556
14313
  agentInfo: {
@@ -13899,7 +14656,6 @@ var QwenAgent = class {
13899
14656
  records: replayPage.records,
13900
14657
  gaps: sessionData?.historyGaps,
13901
14658
  cumulativeUsage: replayUsage,
13902
- supersedeUnrestorableGoal: true,
13903
14659
  logger: debugLogger8
13904
14660
  });
13905
14661
  replayUpdates = replay.updates;
@@ -13907,6 +14663,15 @@ var QwenAgent = class {
13907
14663
  createdSession.cumulativeUsage,
13908
14664
  replayUsage
13909
14665
  );
14666
+ try {
14667
+ replayUpdates = replayUpdates.concat(
14668
+ await createdSession.renderRecoveredGoalUpdates(records)
14669
+ );
14670
+ } catch (error) {
14671
+ debugLogger8.debug(
14672
+ `Failed to render recovered Goal state: ${error instanceof Error ? error.message : String(error)}`
14673
+ );
14674
+ }
13910
14675
  if (replay.replayError !== void 0) {
13911
14676
  replayEnvelope = {
13912
14677
  v: LOAD_REPLAY_VERSION,
@@ -13932,7 +14697,6 @@ var QwenAgent = class {
13932
14697
  config,
13933
14698
  createdSession
13934
14699
  );
13935
- this.#restoreGoalOnResume(config, createdSession);
13936
14700
  }, "beforeStartPostReplayServices")
13937
14701
  })
13938
14702
  );
@@ -14059,12 +14823,20 @@ var QwenAgent = class {
14059
14823
  ),
14060
14824
  replayHistory: false,
14061
14825
  beforeStartPostReplayServices: /* @__PURE__ */ __name(async (createdSession) => {
14826
+ try {
14827
+ await createdSession.publishRecoveredGoalState(
14828
+ config.getResumedSessionData()?.conversation.messages
14829
+ );
14830
+ } catch (error) {
14831
+ debugLogger8.debug(
14832
+ `Failed to publish recovered Goal state: ${error instanceof Error ? error.message : String(error)}`
14833
+ );
14834
+ }
14062
14835
  await this.#restoreWorktreeOnResume(config, createdSession);
14063
14836
  await this.#restoreBackgroundAgentsOnResume(
14064
14837
  config,
14065
14838
  createdSession
14066
14839
  );
14067
- this.#restoreGoalOnResume(config, createdSession);
14068
14840
  }, "beforeStartPostReplayServices")
14069
14841
  }
14070
14842
  )
@@ -14111,48 +14883,6 @@ var QwenAgent = class {
14111
14883
  await config.loadPausedBackgroundAgents(config.getSessionId());
14112
14884
  session.pendingRecoveredAgentsNotice = config.consumePendingRecoveredAgentsNotice();
14113
14885
  }
14114
- /**
14115
- * Re-registers the `/goal` Stop hook when a resumed transcript ends on an
14116
- * unsatisfied goal — the daemon counterpart of the TUI's resume restore.
14117
- * Without this the goal loop silently dies whenever a session is reloaded or
14118
- * `qwen serve` restarts, even though the transcript still shows it as active.
14119
- *
14120
- * The `addItem` bridge that `restoreGoalFromHistory` takes in the TUI is not
14121
- * used here — the daemon's terminal card goes out over the wire, not into an
14122
- * Ink history. But restore reaches `unregisterGoalHook` on every path,
14123
- * including the one where there was nothing to restore, and that clears the
14124
- * observer the `Session` constructor installed. So it is put back afterwards,
14125
- * unconditionally: without it a restored goal that later achieves or fails
14126
- * emits no terminal update and persists no terminal card, and the next reload
14127
- * revives a goal that already finished.
14128
- *
14129
- * Best-effort: a failed restore must not block session load.
14130
- */
14131
- #restoreGoalOnResume(config, session) {
14132
- try {
14133
- const records = config.getResumedSessionData()?.conversation.messages;
14134
- if (!records?.length) return;
14135
- const restored = restoreGoalFromHistory(
14136
- collectGoalStatusItemsFromRecords(records),
14137
- config
14138
- );
14139
- if (restored.restored) {
14140
- debugLogger8.info(
14141
- `ACP goal restored sessionId=${config.getSessionId()} condition=${restored.condition}`
14142
- );
14143
- } else if (restored.blockedBy && restored.blockedBy !== "condition-invalid") {
14144
- writeStderrLineSafe(
14145
- `qwen: not restoring the active goal for session ${config.getSessionId()} (${restored.blockedBy}).`
14146
- );
14147
- }
14148
- } catch (error) {
14149
- writeStderrLineSafe(
14150
- `qwen: goal restore failed for session ${config.getSessionId()}: ${error}`
14151
- );
14152
- } finally {
14153
- session.installGoalTerminalObserver();
14154
- }
14155
- }
14156
14886
  async unstable_listSessions(params) {
14157
14887
  const cwd = params.cwd || process.cwd();
14158
14888
  const numericCursor = parseAcpSessionListCursor(params.cursor);
@@ -14233,6 +14963,29 @@ var QwenAgent = class {
14233
14963
  break;
14234
14964
  }
14235
14965
  case "reasoning_effort": {
14966
+ const modelReasoning = this.getModelReasoningConfiguration(
14967
+ session.getConfig()
14968
+ );
14969
+ if (modelReasoning) {
14970
+ const selected = value === ACP_REASONING_EFFORT_NONE ? ACP_REASONING_EFFORT_NONE : modelReasoning.efforts.find((effort2) => effort2 === value);
14971
+ if (!selected) {
14972
+ throw RequestError.invalidParams(
14973
+ void 0,
14974
+ `Unknown reasoning effort: ${value}. Choose one of: ${ACP_REASONING_EFFORT_NONE}, ${modelReasoning.efforts.join(", ")}`
14975
+ );
14976
+ }
14977
+ const generation = session.getConfig().getContentGeneratorConfig();
14978
+ if (selected === ACP_REASONING_EFFORT_NONE) {
14979
+ generation.reasoning = false;
14980
+ } else {
14981
+ const current = generation.reasoning;
14982
+ generation.reasoning = {
14983
+ ...current || {},
14984
+ effort: selected
14985
+ };
14986
+ }
14987
+ break;
14988
+ }
14236
14989
  const effort = value === ACP_REASONING_EFFORT_DEFAULT ? void 0 : REASONING_EFFORT_TIERS.find((tier) => tier === value);
14237
14990
  if (value !== ACP_REASONING_EFFORT_DEFAULT && effort === void 0) {
14238
14991
  throw RequestError.invalidParams(
@@ -14268,9 +15021,14 @@ var QwenAgent = class {
14268
15021
  const meta = params._meta && typeof params._meta === "object" ? { ...params._meta } : {};
14269
15022
  const suppliedContext = meta[INVOCATION_CONTEXT_META_KEY];
14270
15023
  const suppliedModelPrompt = meta[DAEMON_MODEL_PROMPT_META_KEY];
15024
+ const suppliedPromptDisplayText = meta[DAEMON_PROMPT_DISPLAY_TEXT_META_KEY];
14271
15025
  delete meta[INVOCATION_CONTEXT_META_KEY];
14272
15026
  delete meta[DAEMON_MODEL_PROMPT_META_KEY];
14273
15027
  delete meta[PRIVATE_PARENT_CAPABILITY_META_KEY];
15028
+ delete meta[DAEMON_PROMPT_DISPLAY_TEXT_META_KEY];
15029
+ if (this.privateParentState === "trusted" && typeof suppliedPromptDisplayText === "string") {
15030
+ meta[DAEMON_PROMPT_DISPLAY_TEXT_META_KEY] = suppliedPromptDisplayText;
15031
+ }
14274
15032
  if (Object.keys(meta).length > 0) {
14275
15033
  sanitizedParams._meta = meta;
14276
15034
  } else {
@@ -18390,21 +19148,34 @@ ${outputText}
18390
19148
  }
18391
19149
  const session = this.sessionOrThrow(sessionId);
18392
19150
  const config = session.getConfig();
18393
- const cleared = unregisterGoalHook(config, sessionId);
18394
- if (cleared) {
18395
- session.emitGoalStatus({
18396
- kind: "cleared",
18397
- condition: cleared.condition,
18398
- iterations: cleared.iterations,
18399
- durationMs: Date.now() - cleared.setAt
18400
- });
19151
+ let runtime;
19152
+ try {
19153
+ runtime = await config.getGoalRuntimeReady();
19154
+ } catch (error) {
19155
+ if (!(error instanceof GoalPersistenceUnavailableError)) throw error;
19156
+ debugLogger8.info(
19157
+ `sessionGoalClear sessionId=${sessionId} cleared=false (goal persistence unavailable)`
19158
+ );
19159
+ return {
19160
+ cleared: false,
19161
+ condition: void 0,
19162
+ snapshot: emptyGoalSnapshot()
19163
+ };
18401
19164
  }
19165
+ const before = runtime.getSnapshot();
19166
+ const goal = before.goal;
19167
+ const response = goal ? await runtime.dispatch({
19168
+ action: "clear",
19169
+ expectedGoalId: goal.goalId,
19170
+ expectedRevision: goal.revision
19171
+ }) : { snapshot: before };
18402
19172
  debugLogger8.info(
18403
- `sessionGoalClear sessionId=${sessionId} cleared=${!!cleared} condition=${cleared?.condition ?? "(none)"}`
19173
+ `sessionGoalClear sessionId=${sessionId} cleared=${!!goal} objective=${goal?.objective ?? "(none)"}`
18404
19174
  );
18405
19175
  return {
18406
- cleared: !!cleared,
18407
- condition: cleared?.condition
19176
+ cleared: !!goal,
19177
+ condition: goal?.objective,
19178
+ snapshot: response.snapshot
18408
19179
  };
18409
19180
  }
18410
19181
  case SERVE_CONTROL_EXT_METHODS.sessionGoalGet: {
@@ -18415,16 +19186,22 @@ ${outputText}
18415
19186
  "Invalid or missing sessionId"
18416
19187
  );
18417
19188
  }
18418
- this.sessionOrThrow(sessionId);
18419
- const active = getActiveGoal(sessionId);
19189
+ const session = this.sessionOrThrow(sessionId);
19190
+ let snapshot;
19191
+ try {
19192
+ snapshot = (await session.getConfig().getGoalRuntimeReady()).getSnapshot();
19193
+ } catch (error) {
19194
+ if (!(error instanceof GoalPersistenceUnavailableError)) throw error;
19195
+ snapshot = emptyGoalSnapshot();
19196
+ }
19197
+ const activeGoal = snapshot.goal?.status === "active" ? snapshot.goal : null;
18420
19198
  return {
18421
- // Projected field by field: `ActiveGoal` also carries `hookId` and
18422
- // `tokensAtStart`, which are this process's business.
18423
- active: active ? {
18424
- condition: active.condition,
18425
- iterations: active.iterations,
18426
- setAt: active.setAt,
18427
- ...active.lastReason !== void 0 ? { lastReason: active.lastReason } : {}
19199
+ snapshot,
19200
+ active: activeGoal ? {
19201
+ condition: activeGoal.objective,
19202
+ iterations: activeGoal.turnCount,
19203
+ setAt: activeGoal.createdAt,
19204
+ ...activeGoal.lastReason !== void 0 ? { lastReason: activeGoal.lastReason } : {}
18428
19205
  } : null
18429
19206
  };
18430
19207
  }
@@ -19707,6 +20484,15 @@ ${outputText}
19707
20484
  sessionData.conversation.messages,
19708
20485
  sessionData.historyGaps
19709
20486
  );
20487
+ try {
20488
+ await session.publishRecoveredGoalState(
20489
+ sessionData.conversation.messages
20490
+ );
20491
+ } catch (error) {
20492
+ debugLogger8.debug(
20493
+ `Failed to publish recovered Goal state: ${error instanceof Error ? error.message : String(error)}`
20494
+ );
20495
+ }
19710
20496
  }
19711
20497
  await options.beforeStartPostReplayServices?.(session);
19712
20498
  session.installRewriter();
@@ -19807,13 +20593,41 @@ ${outputText}
19807
20593
  currentValue: currentModelId,
19808
20594
  options: configModelOptions
19809
20595
  };
19810
- const reasoningEffortConfigOption = {
20596
+ const modelReasoning = this.getModelReasoningConfiguration(config);
20597
+ const currentModelEffort = config.getReasoningEffort?.();
20598
+ const reasoningEffortConfigOption = modelReasoning ? {
20599
+ id: "reasoning_effort",
20600
+ name: "Reasoning effort",
20601
+ description: `Thinking and reasoning effort for ${rawCurrentModelId}`,
20602
+ category: "thought_level",
20603
+ type: "select",
20604
+ currentValue: config.getContentGeneratorConfig().reasoning === false ? ACP_REASONING_EFFORT_NONE : modelReasoning.efforts.find(
20605
+ (effort) => effort === currentModelEffort
20606
+ ) ?? modelReasoning.defaultEffort,
20607
+ options: [
20608
+ {
20609
+ value: ACP_REASONING_EFFORT_NONE,
20610
+ name: "Thinking off",
20611
+ description: "Disable thinking for this session"
20612
+ },
20613
+ ...modelReasoning.efforts.map((effort) => ({
20614
+ value: effort,
20615
+ name: ACP_REASONING_EFFORT_NAMES[effort],
20616
+ description: "Apply this effort to the next request"
20617
+ }))
20618
+ ],
20619
+ _meta: {
20620
+ "qwenCode/reasoning": {
20621
+ defaultEffort: modelReasoning.defaultEffort
20622
+ }
20623
+ }
20624
+ } : {
19811
20625
  id: "reasoning_effort",
19812
20626
  name: "Reasoning effort",
19813
20627
  description: "How hard reasoning-capable models should think",
19814
20628
  category: "thought_level",
19815
20629
  type: "select",
19816
- currentValue: config.getReasoningEffort?.() ?? ACP_REASONING_EFFORT_DEFAULT,
20630
+ currentValue: currentModelEffort ?? ACP_REASONING_EFFORT_DEFAULT,
19817
20631
  options: [
19818
20632
  {
19819
20633
  value: ACP_REASONING_EFFORT_DEFAULT,
@@ -19829,6 +20643,14 @@ ${outputText}
19829
20643
  };
19830
20644
  return [modeConfigOption, modelConfigOption, reasoningEffortConfigOption];
19831
20645
  }
20646
+ getModelReasoningConfiguration(config) {
20647
+ if (config.getActiveRuntimeModelSnapshot?.() || config.getReasoningEffortOverride?.() || config.getContentGeneratorConfig().thinkingMandatory === true) {
20648
+ return void 0;
20649
+ }
20650
+ const reasoning = getModelConfiguration(config.getModel())?.reasoning;
20651
+ const currentEffort = config.getReasoningEffort?.();
20652
+ return reasoning?.thinking && (!currentEffort || reasoning.efforts.includes(currentEffort)) ? reasoning : void 0;
20653
+ }
19832
20654
  buildSelectableModelOptions(config) {
19833
20655
  const currentAuthType = config.getAuthType();
19834
20656
  return buildAcpModelOptions(