@qwen-code/qwen-code 0.22.0 → 0.22.2-nightly.20260828.7357136dd1

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 (483) hide show
  1. package/bundled/computer-use/SKILL.md +229 -0
  2. package/bundled/computer-use/agents/openai.yaml +4 -0
  3. package/bundled/coordinate/SKILL.md +5 -5
  4. package/bundled/goal-draft/SKILL.md +109 -0
  5. package/bundled/qc-helper/docs/configuration/auth.md +7 -7
  6. package/bundled/qc-helper/docs/configuration/model-providers.md +70 -9
  7. package/bundled/qc-helper/docs/configuration/settings.md +48 -48
  8. package/bundled/qc-helper/docs/extension/introduction.md +3 -1
  9. package/bundled/qc-helper/docs/features/_meta.ts +1 -0
  10. package/bundled/qc-helper/docs/features/channels/_meta.ts +1 -0
  11. package/bundled/qc-helper/docs/features/channels/dingtalk.md +12 -0
  12. package/bundled/qc-helper/docs/features/channels/dws.md +120 -0
  13. package/bundled/qc-helper/docs/features/channels/overview.md +37 -6
  14. package/bundled/qc-helper/docs/features/code-review.md +27 -23
  15. package/bundled/qc-helper/docs/features/commands.md +4 -3
  16. package/bundled/qc-helper/docs/features/computer-use.md +57 -51
  17. package/bundled/qc-helper/docs/features/goals.md +58 -0
  18. package/bundled/qc-helper/docs/features/headless.md +13 -11
  19. package/bundled/qc-helper/docs/features/mcp.md +35 -12
  20. package/bundled/qc-helper/docs/features/status-line.md +3 -3
  21. package/bundled/qc-helper/docs/features/sub-agents.md +1 -1
  22. package/bundled/qc-helper/docs/features/worktree.md +1 -1
  23. package/bundled/qc-helper/docs/overview.md +1 -1
  24. package/bundled/qc-helper/docs/quickstart.md +1 -1
  25. package/bundled/qc-helper/docs/qwen-serve.md +29 -6
  26. package/bundled/review/SKILL.md +185 -435
  27. package/bundled/review/references/aone.md +18 -0
  28. package/bundled/review/references/persistence.md +109 -0
  29. package/bundled/review/references/posting.md +272 -0
  30. package/chunks/MaxSizedBox-LMWXCLDV.js +110 -0
  31. package/chunks/{StandaloneSessionPicker-KTHPCSR6.js → StandaloneSessionPicker-W3F7U3JL.js} +87 -88
  32. package/chunks/{acp-startup-profiler-T4GEAPLX.js → acp-startup-profiler-GNYAL6LI.js} +2 -2
  33. package/chunks/{acpAgent-CRY3JZ5O.js → acpAgent-EYZ6EEHD.js} +3223 -2145
  34. package/chunks/agent-RBLGBY65.js +95 -0
  35. package/chunks/agent-headless-L5T4Y4OZ.js +85 -0
  36. package/chunks/{anthropicContentGenerator-Y2OX6LS4.js → anthropicContentGenerator-GMHML35Q.js} +128 -59
  37. package/chunks/{artifact-tool-SBXMTVCB.js → artifact-tool-XSMPHZBT.js} +11 -3
  38. package/chunks/{askUserQuestion-KEQJRFD6.js → askUserQuestion-4SWJY65V.js} +2 -2
  39. package/chunks/bridge-5LR2F2ND.js +119 -0
  40. package/chunks/{ca-D3F4S6NG.js → ca-7HPYOYSZ.js} +3 -0
  41. package/chunks/{channel-management-service-IRTT7RNE.js → channel-management-service-KHR3N6CH.js} +6 -6
  42. package/chunks/channel-settings-store-4FOAZW72.js +120 -0
  43. package/chunks/{channel-worker-group-BJNMR2MP.js → channel-worker-group-6NA6BBZV.js} +9 -7
  44. package/chunks/{channel-worker-manager-EMA7CQDJ.js → channel-worker-manager-NEZ2J6RK.js} +11 -8
  45. package/chunks/{channel-worker-supervisor-F6I6WSWW.js → channel-worker-supervisor-FKU7DIHJ.js} +12 -6
  46. package/chunks/{chunk-HDKCKCYO.js → chunk-23RFD54N.js} +1 -1
  47. package/chunks/{read-package-up-UXSW3YPB.js → chunk-2EAZ43JQ.js} +1 -0
  48. package/chunks/{chunk-KM73TBQ4.js → chunk-2LD5U7Q3.js} +31 -0
  49. package/chunks/{chunk-GIWB5QLV.js → chunk-2SXSLSQE.js} +4 -4
  50. package/chunks/chunk-2TNL5KPM.js +49 -0
  51. package/chunks/chunk-335CJSNF.js +2320 -0
  52. package/chunks/chunk-36LGBEM6.js +130 -0
  53. package/chunks/{chunk-O5BDEWBC.js → chunk-3JXM2CVW.js} +3 -3
  54. package/chunks/{chunk-2E3V7G6Y.js → chunk-3K6TUZHS.js} +55 -50
  55. package/chunks/{chunk-WWUSHZ7M.js → chunk-3OOXT6CR.js} +5 -5
  56. package/chunks/{chunk-2UZJWSVD.js → chunk-3WK3QDNV.js} +2 -2
  57. package/chunks/{chunk-4J7OPYNS.js → chunk-3XOKEVII.js} +6 -6
  58. package/chunks/chunk-3Y34Q3JV.js +1584 -0
  59. package/chunks/{chunk-YMVFIYHV.js → chunk-42IDLQWS.js} +26 -20
  60. package/chunks/{chunk-7HFULI45.js → chunk-454XFGH4.js} +3 -3
  61. package/chunks/chunk-4CMJKUND.js +95 -0
  62. package/chunks/{chunk-XLDFW44M.js → chunk-4K7KNVWH.js} +3 -3
  63. package/chunks/{chunk-YDJRMQU4.js → chunk-4QHPPXK2.js} +16 -8
  64. package/chunks/{chunk-7KOFLDEP.js → chunk-5JTIYALA.js} +1 -1
  65. package/chunks/{chunk-CXJHQVEK.js → chunk-5PA6UEYA.js} +4 -0
  66. package/chunks/{chunk-7NBVNAJJ.js → chunk-62GQFYID.js} +3 -3
  67. package/chunks/{chunk-JGUBDRBC.js → chunk-6DIGWMGT.js} +3 -3
  68. package/chunks/{chunk-X7V3N6YH.js → chunk-6JCGO55P.js} +885 -3380
  69. package/chunks/{chunk-HIK2OF33.js → chunk-6PJOTWAN.js} +1 -1
  70. package/chunks/{chunk-VUMLT7E5.js → chunk-6W2IK5KC.js} +956 -17
  71. package/chunks/{chunk-S4C4JJKE.js → chunk-6ZZBRRKQ.js} +5 -5
  72. package/chunks/{chunk-W4CRPSC5.js → chunk-7EQQR46F.js} +1 -1
  73. package/chunks/{chunk-PHJJ3RVO.js → chunk-7GWQW5ID.js} +7 -15
  74. package/chunks/chunk-7J6OTNGO.js +424 -0
  75. package/chunks/{chunk-URN2JIAQ.js → chunk-7TUBJBBJ.js} +5 -1
  76. package/chunks/{chunk-A5F63FEW.js → chunk-7VD6IPQM.js} +1 -1
  77. package/chunks/{chunk-36OF5PRW.js → chunk-ABS25QER.js} +7 -3
  78. package/chunks/{chunk-UU4WC7DK.js → chunk-AJGR6E6Z.js} +117 -30
  79. package/chunks/{chunk-MQP3MHWN.js → chunk-AU3MMVJF.js} +43 -20
  80. package/chunks/{chunk-ZS5BHEPD.js → chunk-AXC26UCQ.js} +1 -1
  81. package/chunks/{chunk-PDL6LKB5.js → chunk-AY3BNYEQ.js} +1 -1
  82. package/chunks/{chunk-O5Z7EB6Y.js → chunk-AYHQZBJ4.js} +170 -207
  83. package/chunks/{chunk-WRT324N6.js → chunk-B466ZSHZ.js} +3 -3
  84. package/chunks/{chunk-5XHAOUWD.js → chunk-B5OUL5EL.js} +3 -3
  85. package/chunks/{chunk-GAHYKJPV.js → chunk-B5PHIJGI.js} +186 -60
  86. package/chunks/{chunk-IBJ5S45N.js → chunk-B7CDU2SL.js} +2 -2
  87. package/chunks/{chunk-UZPYR3EV.js → chunk-BFPESSTR.js} +1 -1
  88. package/chunks/{chunk-43T5WDQ7.js → chunk-BFSFJR3D.js} +1 -1
  89. package/chunks/{chunk-IWOWEENB.js → chunk-BKWNKLZB.js} +404 -44
  90. package/chunks/{chunk-3CLIDIVQ.js → chunk-BOWFGCEU.js} +3 -3
  91. package/chunks/{chunk-BB5IMQCV.js → chunk-BPAKYXQ3.js} +2 -2
  92. package/chunks/{chunk-ZRYQMWEP.js → chunk-BWORX6FA.js} +2 -2
  93. package/chunks/{chunk-AP3B7LKD.js → chunk-BXDAPVQU.js} +2 -2
  94. package/chunks/{chunk-NUGZAFR2.js → chunk-C2X7KY45.js} +147 -6
  95. package/chunks/{chunk-MZKWFWVG.js → chunk-C3KURPP7.js} +6 -6
  96. package/chunks/{chunk-WZDM44SB.js → chunk-CAJTKR6W.js} +7 -7
  97. package/chunks/{chunk-DB2OKNTU.js → chunk-CFJY4DGX.js} +2 -2
  98. package/chunks/{chunk-QKBYFU2Q.js → chunk-CFKIH3D3.js} +21 -1
  99. package/chunks/{chunk-I432KXWD.js → chunk-CMHFCLBU.js} +1 -1
  100. package/chunks/{create-sub-session-XBCVGNFU.js → chunk-CQH5KTKC.js} +4 -6
  101. package/chunks/{chunk-5HJUPACR.js → chunk-CRKKHXTI.js} +185 -174
  102. package/chunks/{chunk-L4HVF7LM.js → chunk-CYAUBK46.js} +3 -3
  103. package/chunks/{chunk-AZF6SME3.js → chunk-D5LUXLUH.js} +3 -3
  104. package/chunks/{chunk-RPJQ3O4M.js → chunk-DFDWJE6Z.js} +60 -53
  105. package/chunks/{chunk-KSPRQSB4.js → chunk-DIMEPKCW.js} +52 -12
  106. package/chunks/chunk-DJBQCO2E.js +842 -0
  107. package/chunks/{chunk-OVH5Y7KS.js → chunk-DP4MWIM3.js} +19 -3
  108. package/chunks/{chunk-LI4YHTQK.js → chunk-DYXFD5RO.js} +182 -3
  109. package/chunks/{chunk-NW35NVFN.js → chunk-E3XVSVKK.js} +26 -4
  110. package/chunks/{chunk-VSNPOSDN.js → chunk-EB6QRGHM.js} +108 -13
  111. package/chunks/{chunk-FVBVJEBG.js → chunk-EKNBU2X7.js} +10 -8
  112. package/chunks/{chunk-DJEHYM4H.js → chunk-EKSCLBBF.js} +3 -3
  113. package/chunks/{chunk-624NHDGB.js → chunk-ERFDKH32.js} +11 -0
  114. package/chunks/chunk-EW5VVLJT.js +3525 -0
  115. package/chunks/{chunk-T6XLJRQY.js → chunk-EWIQ3NAE.js} +38774 -6955
  116. package/chunks/{chunk-4XPSVIED.js → chunk-FALBWZF4.js} +6 -6
  117. package/chunks/chunk-FBX2SDQ4.js +48 -0
  118. package/chunks/{chunk-VMJL7RH6.js → chunk-FEHMA4RO.js} +539 -651
  119. package/chunks/{chunk-PXOJLJ5W.js → chunk-FMFBLTLY.js} +606 -223
  120. package/chunks/{chunk-ZLCT4C5A.js → chunk-FTF2YIZ5.js} +1 -1
  121. package/chunks/{chunk-IOSEW6KP.js → chunk-G6FECKTJ.js} +9 -6
  122. package/chunks/{chunk-RDG44S5I.js → chunk-GGNE3JAW.js} +2 -2
  123. package/chunks/chunk-GYTKQYDB.js +23 -0
  124. package/chunks/{chunk-B6UBOIFE.js → chunk-H33EQVMG.js} +14 -11
  125. package/chunks/chunk-H72BQNM3.js +645 -0
  126. package/chunks/{chunk-YZBDKFRQ.js → chunk-HGIMWQVT.js} +995 -892
  127. package/chunks/chunk-HOCJDUFY.js +20 -0
  128. package/chunks/{chunk-6UQSU7CQ.js → chunk-HPXV655A.js} +60 -107
  129. package/chunks/{chunk-45NQKMYB.js → chunk-HVC3PNVC.js} +1 -1
  130. package/chunks/{chunk-QJHPWLZC.js → chunk-HYDJDQGJ.js} +1 -1
  131. package/chunks/{chunk-7DMTAQJ6.js → chunk-IB7FQJRY.js} +163 -57
  132. package/chunks/{chunk-AW27A43Y.js → chunk-ICURCKIU.js} +1428 -120
  133. package/chunks/{chunk-4F5WV4RF.js → chunk-ISKH4QX3.js} +288 -15
  134. package/chunks/{chunk-SE55HQGF.js → chunk-J6S24ZJE.js} +92 -70
  135. package/chunks/{chunk-7DYNJFES.js → chunk-JB4JIVTJ.js} +6 -1
  136. package/chunks/{chunk-OARZJFZX.js → chunk-JN4IWWMN.js} +4 -4
  137. package/chunks/{chunk-6PCOVQO2.js → chunk-JUUBLSZU.js} +8 -8
  138. package/chunks/{chunk-FEMQ6Y7W.js → chunk-JWALNCLT.js} +47 -126
  139. package/chunks/{chunk-TBVSALA3.js → chunk-K5KXUXWC.js} +3 -3
  140. package/chunks/{chunk-XYQHT3AW.js → chunk-KTJFDCX4.js} +2 -2
  141. package/chunks/{chunk-6FRJEE2S.js → chunk-LEFCFTEX.js} +6 -6
  142. package/chunks/{chunk-BUGYW6FB.js → chunk-LEGTMYAE.js} +1 -1
  143. package/chunks/{chunk-MPHLIJYL.js → chunk-LLZA2IK3.js} +20 -8
  144. package/chunks/{chunk-BEGIBJAZ.js → chunk-LNETQKBE.js} +4 -4
  145. package/chunks/{chunk-KVGR4MCF.js → chunk-LUEHOUHM.js} +3 -3
  146. package/chunks/{chunk-2A4C2MEG.js → chunk-LVPZO674.js} +35 -12
  147. package/chunks/{chunk-25NESM4G.js → chunk-M4ORUPYI.js} +29 -5
  148. package/chunks/{chunk-VFACN2CE.js → chunk-M6FOJXW3.js} +1 -1
  149. package/chunks/{chunk-FYZMB6DB.js → chunk-MAYHGRP4.js} +12 -12
  150. package/chunks/{chunk-K3LPAED5.js → chunk-MQM5PJML.js} +24 -4
  151. package/chunks/{chunk-ZRFUT5VV.js → chunk-MTJN7FOT.js} +7 -7
  152. package/chunks/{chunk-BGXZBI5B.js → chunk-N4X7G4J2.js} +2 -1
  153. package/chunks/{chunk-2TRNCJK4.js → chunk-NIFYWDYN.js} +1 -1
  154. package/chunks/{chunk-SQS55KR4.js → chunk-NU7RKEZR.js} +2 -2
  155. package/chunks/{chunk-U2UYQMM6.js → chunk-NXMBRVMQ.js} +3 -3
  156. package/chunks/chunk-OI4NY7RA.js +346 -0
  157. package/chunks/{chunk-LURJYO2T.js → chunk-OZ6KS6KW.js} +4 -0
  158. package/chunks/{chunk-K52PZNU4.js → chunk-PDQGMSZK.js} +2 -2
  159. package/chunks/{chunk-PZRUV52H.js → chunk-PPKZ7JOE.js} +20 -2
  160. package/chunks/{chunk-SAH4BD2J.js → chunk-PQEISIKS.js} +67 -0
  161. package/chunks/{chunk-AO4M6NMD.js → chunk-PWIGAMA4.js} +146 -27
  162. package/chunks/{chunk-S3G6YFQC.js → chunk-QFCDF5PL.js} +1 -1
  163. package/chunks/chunk-QHMLYMMS.js +32 -0
  164. package/chunks/{chunk-5XUTPXQU.js → chunk-QPTRRPZU.js} +47 -13
  165. package/chunks/{chunk-UUQFJILB.js → chunk-RFI4YGMR.js} +34 -267
  166. package/chunks/{chunk-A6NRNRKE.js → chunk-RFIDDFAL.js} +1 -1
  167. package/chunks/chunk-RKFGE7JH.js +93 -0
  168. package/chunks/chunk-RNVFRIOO.js +275 -0
  169. package/chunks/{chunk-WU5E4HMO.js → chunk-RU7BK6B3.js} +1 -1
  170. package/chunks/{chunk-J5ZDDUKM.js → chunk-RVXDXY6I.js} +4 -4
  171. package/chunks/{chunk-OE52YHCZ.js → chunk-RWZB422L.js} +11 -11
  172. package/chunks/chunk-RXFQM6FQ.js +42 -0
  173. package/chunks/{chunk-MHG6NDS6.js → chunk-RYNZQGXN.js} +19 -2
  174. package/chunks/{chunk-4CWDWDL6.js → chunk-SJ5ERAW3.js} +1 -1
  175. package/chunks/{chunk-Q54XG7IX.js → chunk-SMPR7SPO.js} +1 -1
  176. package/chunks/{chunk-UIRLQ3N7.js → chunk-SRZZY4IY.js} +3 -3
  177. package/chunks/{chunk-ND7NOI4P.js → chunk-STUJ7IMZ.js} +0 -92
  178. package/chunks/{chunk-VYC7XFYV.js → chunk-SUX7HDNA.js} +5 -5
  179. package/chunks/{chunk-ZZUVC6RI.js → chunk-SVNO44PF.js} +3 -3
  180. package/chunks/{chunk-FDD2IUEL.js → chunk-SZLBBZH4.js} +370 -35
  181. package/chunks/{chunk-GHY5OIYP.js → chunk-T2NKRHZZ.js} +13 -13
  182. package/chunks/chunk-T4EFG2P5.js +113 -0
  183. package/chunks/{chunk-BMCSKS37.js → chunk-TLHUNMO7.js} +6 -6
  184. package/chunks/{chunk-JOLJTKIG.js → chunk-TPI7O7HR.js} +1 -1
  185. package/chunks/{chunk-6QSA4JHL.js → chunk-TQHGJYR3.js} +4492 -1121
  186. package/chunks/{chunk-ISJMN3ML.js → chunk-TTX2JUE6.js} +1 -1
  187. package/chunks/{chunk-EFB657PR.js → chunk-TW3E6YNO.js} +3 -3
  188. package/chunks/{chunk-LD5VIJ7S.js → chunk-TWSKM647.js} +1 -1
  189. package/chunks/chunk-U54AYGEC.js +337 -0
  190. package/chunks/{chunk-A5F2YNO6.js → chunk-UHQFIS7N.js} +260 -10
  191. package/chunks/{chunk-6NFAEG54.js → chunk-UTLCH2FK.js} +24 -13
  192. package/chunks/{chunk-7JBHIQS2.js → chunk-UY3PBNY3.js} +19 -37
  193. package/chunks/{chunk-DWCKACFL.js → chunk-V2NDP3I4.js} +2 -2
  194. package/chunks/{chunk-2GXYDNXP.js → chunk-V2QDDC5J.js} +19 -9
  195. package/chunks/{chunk-VLRBJ24J.js → chunk-V5J4J5TP.js} +2 -2
  196. package/chunks/{chunk-X2UOOG5V.js → chunk-VQUGEVGR.js} +1 -1
  197. package/chunks/{chunk-RDQ7QB4Y.js → chunk-VTHREBQM.js} +2 -2
  198. package/chunks/{chunk-YLFLHKDL.js → chunk-W3N5XAZ6.js} +1 -1
  199. package/chunks/{chunk-62JOGZL5.js → chunk-W6DUQ5GA.js} +11497 -10502
  200. package/chunks/{chunk-P47E4SJC.js → chunk-WALC5VJH.js} +4 -4
  201. package/chunks/{chunk-3ZFJUBTP.js → chunk-WAOIHTJS.js} +1 -1
  202. package/chunks/{chunk-KIVGVFMM.js → chunk-WBHKK3CU.js} +16 -4
  203. package/chunks/{chunk-XZJKSETB.js → chunk-WXEA74YB.js} +3 -3
  204. package/chunks/{chunk-VEND4KA4.js → chunk-X3ZRTCJD.js} +1 -1
  205. package/chunks/{chunk-YRLW2MSX.js → chunk-XBVNNDPK.js} +11 -4
  206. package/chunks/{chunk-XL5K4SVK.js → chunk-XF63PKEN.js} +1 -1
  207. package/chunks/{chunk-LDGWX737.js → chunk-XLLQJRAH.js} +323 -510
  208. package/chunks/{chunk-2Z6LSQMF.js → chunk-XQFT3QUF.js} +1 -1
  209. package/chunks/{chunk-P3QQPMQA.js → chunk-XZA32HII.js} +4 -4
  210. package/chunks/{chunk-C72BXMJ5.js → chunk-Y3QL45LS.js} +1 -1
  211. package/chunks/{chunk-QS4ENGVF.js → chunk-Y4TPOUEV.js} +17 -8
  212. package/chunks/{chunk-AVCCKIZ6.js → chunk-YRZX2PHA.js} +1 -1
  213. package/chunks/{chunk-Z3JMO2CH.js → chunk-YTDVNSUQ.js} +1 -1
  214. package/chunks/{chunk-WS7PAXXR.js → chunk-YWQ237GX.js} +15 -199
  215. package/chunks/chunk-ZELCTN6Y.js +29 -0
  216. package/chunks/{chunk-TQOF5KBL.js → chunk-ZEZKIS2K.js} +0 -31
  217. package/chunks/{chunk-IIWGSX4L.js → chunk-ZTP35P4B.js} +1 -1
  218. package/chunks/{chunk-K623ENWT.js → chunk-ZU4UDIWX.js} +23 -1
  219. package/chunks/chunk-ZYNTSXWK.js +32 -0
  220. package/chunks/config-utils-JVGAP34H.js +113 -0
  221. package/chunks/contextCommand-XDB7OSO7.js +106 -0
  222. package/chunks/{core-runtime-CES6JSVV.js → core-runtime-XHYA2RH7.js} +66 -63
  223. package/chunks/create-sub-session-23ITIELI.js +17 -0
  224. package/chunks/{create-sub-session-UJTPMVOG.js → create-sub-session-MHYCFNCM.js} +168 -87
  225. package/chunks/{cron-create-IKA56DAF.js → cron-create-KJ4IY6PP.js} +57 -10
  226. package/chunks/{cron-delete-K5Q62EGH.js → cron-delete-MBLQCAYY.js} +4 -4
  227. package/chunks/{cron-list-QBFGAMP7.js → cron-list-DWH2PQ47.js} +4 -4
  228. package/chunks/{daemon-RZZUPGOJ.js → daemon-K5XS42ID.js} +567 -27
  229. package/chunks/{daemon-git-worktree-guard-3QY2BQYB.js → daemon-git-worktree-guard-V3P5XLHB.js} +339 -95
  230. package/chunks/daemon-status-provider-KKU7ZTLM.js +117 -0
  231. package/chunks/daemon-trust-policy-TZGK34DW.js +112 -0
  232. package/chunks/{daemon-trust-policy-monitor-TK4K7M63.js → daemon-trust-policy-monitor-F23DD2M4.js} +69 -69
  233. package/chunks/{de-RYUHH2C6.js → de-X6HLSIFE.js} +1 -0
  234. package/chunks/deferred-core-runtime-LKLGBCGZ.js +114 -0
  235. package/chunks/{display-image-OEJMJV3S.js → display-image-BE7I6ZB6.js} +5 -5
  236. package/chunks/{dist-5EV2G6MC.js → dist-4WXLCBDR.js} +1 -1
  237. package/chunks/{dist-ES6HNUW2.js → dist-5VXFRTWU.js} +525 -64
  238. package/chunks/{dist-ESS34DHC.js → dist-6BPYWHVD.js} +89 -65
  239. package/chunks/{dist-2OG3PGKO.js → dist-GFN5DCBX.js} +76 -67
  240. package/chunks/{dist-K7IQB53U.js → dist-HZNT6GQS.js} +1 -1
  241. package/chunks/{dist-J6P3C52Z.js → dist-LVZCXVPF.js} +99 -26
  242. package/chunks/{dist-LZO24N3E.js → dist-N6W6E753.js} +71 -64
  243. package/chunks/dist-QDLFKWOL.js +2512 -0
  244. package/chunks/{dist-VVQBOKDH.js → dist-SWQMYP2Q.js} +18 -16
  245. package/chunks/earlyInputCapture-NERYFYTR.js +107 -0
  246. package/chunks/{edit-A2633SLR.js → edit-ACCATIXB.js} +49 -51
  247. package/chunks/{en-3RHLPITS.js → en-YLXBXM4Z.js} +5 -1
  248. package/chunks/{enter-worktree-OIAHE2TB.js → enter-worktree-35QCAAFP.js} +7 -8
  249. package/chunks/{enterPlanMode-SUGIKLR7.js → enterPlanMode-NEN6EPVM.js} +48 -50
  250. package/chunks/environment-CKWHBC5T.js +129 -0
  251. package/chunks/errors-XTZPNQ77.js +113 -0
  252. package/chunks/{exit-worktree-3UT3SSWT.js → exit-worktree-XQD6D543.js} +7 -8
  253. package/chunks/exitPlanMode-CY344X5J.js +83 -0
  254. package/chunks/{fast-path-3AVP3G35.js → fast-path-YSOX4PAM.js} +31 -10
  255. package/chunks/{fast-path-settings-WHX3J3ZI.js → fast-path-settings-XMFBYFUH.js} +2 -2
  256. package/chunks/{fr-4PL5GHG4.js → fr-FTZWF462.js} +1 -0
  257. package/chunks/{gemini-7PVQWHTH.js → gemini-VQY2YCPH.js} +137 -129
  258. package/chunks/{geminiContentGenerator-B2FOJJDJ.js → geminiContentGenerator-PAPXNIGU.js} +16 -13
  259. package/chunks/{glob-7YGXE6OV.js → glob-GVCUSBBF.js} +48 -50
  260. package/chunks/{goal-tools-TLJCE7YZ.js → goal-tools-5STK6OXW.js} +77 -31
  261. package/chunks/{grep-6DV6LTON.js → grep-5GPICQBU.js} +6 -6
  262. package/chunks/handleAutoUpdate-ZJPJN42W.js +109 -0
  263. package/chunks/i18n-BZYKOST7.js +124 -0
  264. package/chunks/{image-gen-7CSCJ73T.js → image-gen-J6FDGUZP.js} +8 -12
  265. package/chunks/initializer-GO2C5HE3.js +113 -0
  266. package/chunks/installationInfo-WM2GXQZ6.js +107 -0
  267. package/chunks/{ja-HZ7X7PQO.js → ja-2GL5FKYJ.js} +1 -0
  268. package/chunks/{keychain-token-storage-MTFTAESK.js → keychain-token-storage-37XPR34V.js} +2 -2
  269. package/chunks/list-ERDJB7PQ.js +116 -0
  270. package/chunks/{list-agents-43XUEXJV.js → list-agents-DI3YFTDT.js} +2 -2
  271. package/chunks/loadedSettingsAdapter-7JOCVOKV.js +110 -0
  272. package/chunks/{loggingContentGenerator-RNE66CKK.js → loggingContentGenerator-3ONLU3BS.js} +327 -39
  273. package/chunks/{loop-wakeup-E54KDUXC.js → loop-wakeup-XJFONSQ7.js} +5 -5
  274. package/chunks/{ls-CGL2UC3H.js → ls-3VAT2J7A.js} +4 -4
  275. package/chunks/{lsp-5IKUO5DX.js → lsp-5W7IRUBH.js} +2 -2
  276. package/chunks/{managed-npm-update-Y3SC3GLJ.js → managed-npm-update-TLRCC2GE.js} +62 -62
  277. package/chunks/mcp-2LH3QXR2.js +110 -0
  278. package/chunks/{monitor-PXYSGSUN.js → monitor-P7LDAL4W.js} +48 -50
  279. package/chunks/nonInteractiveCli-E5T7PZ27.js +184 -0
  280. package/chunks/{notebook-edit-ISIBJVBR.js → notebook-edit-F7KSG4WQ.js} +49 -51
  281. package/chunks/open-with-auth-4UI3KHUR.js +55 -0
  282. package/chunks/{openaiContentGenerator-6TBOPEGT.js → openaiContentGenerator-2EXCZUGN.js} +29 -32
  283. package/chunks/pidfile-P25DWA5Q.js +111 -0
  284. package/chunks/process-registry-OAEG6WGC.js +662 -0
  285. package/chunks/{processUtils-YK2TDTTU.js → processUtils-PVDKBL35.js} +2 -2
  286. package/chunks/prompt-terminal-ledger-AJ7T7OIV.js +105 -0
  287. package/chunks/{pt-QT5N2Q6Q.js → pt-XN2YWJVM.js} +1 -0
  288. package/chunks/{qwenContentGenerator-CLDMA2Y4.js → qwenContentGenerator-TBBRLWIT.js} +54 -62
  289. package/chunks/{qwenOAuth2-DLDR6UC5.js → qwenOAuth2-OF5WRBQT.js} +7 -11
  290. package/chunks/read-file-6IIY4RLJ.js +32 -0
  291. package/chunks/{read-mcp-resource-XYES2B42.js → read-mcp-resource-XD257PGJ.js} +2 -2
  292. package/chunks/read-package-up-6T6ICKR7.js +13 -0
  293. package/chunks/{record-artifact-W3IBTGL7.js → record-artifact-VW23GS4F.js} +4 -5
  294. package/chunks/report-findings-XA3FJG3N.js +33 -0
  295. package/chunks/request-shutdown-BCLA3JV2.js +133 -0
  296. package/chunks/resumeHistoryUtils-44IETXDY.js +118 -0
  297. package/chunks/ripGrep-E7ESZ7SS.js +39 -0
  298. package/chunks/{ru-STMG5BPD.js → ru-OLTMFJEW.js} +1 -0
  299. package/chunks/{run-qwen-serve-XJHOW2NY.js → run-qwen-serve-DXBCYW7V.js} +924 -356
  300. package/chunks/runtime-RUSPD35D.js +148 -0
  301. package/chunks/scheduled-tasks-DVRJZO6I.js +127 -0
  302. package/chunks/scheduler-TDRB2NSY.js +122 -0
  303. package/chunks/{sdk-exporters-http-RSIOP3G2.js → sdk-exporters-http-TTU2CHBU.js} +5 -5
  304. package/chunks/{sdk-impl-CB3KARSK.js → sdk-impl-UUMVYMAL.js} +12 -6
  305. package/chunks/{send-message-J4VT46OI.js → send-message-AJ4OCUBV.js} +24 -29
  306. package/chunks/serve-KITOM7OR.js +118 -0
  307. package/chunks/{server-74ONDK62.js → server-THCOMUC2.js} +5814 -4549
  308. package/chunks/{session-BO6VBWJP.js → session-XKR5MPXE.js} +152 -142
  309. package/chunks/session-pr-refresh-KRBH7KDA.js +278 -0
  310. package/chunks/{settings-35QZNFDG.js → settings-YXZ4XBKK.js} +72 -72
  311. package/chunks/shell-5FJ2DZ3W.js +93 -0
  312. package/chunks/{skill-DKEMQSNJ.js → skill-VMMJZ6CJ.js} +161 -33
  313. package/chunks/skill-settings-7SG4YA2W.js +118 -0
  314. package/chunks/spawnChannel-BPMIXRBI.js +112 -0
  315. package/chunks/standalone-update-QN5HFRIC.js +118 -0
  316. package/chunks/{startInteractiveUI-J2QSGWPU.js → startInteractiveUI-5A7RQFRP.js} +3139 -2438
  317. package/chunks/{syntheticOutput-JAXMIMZP.js → syntheticOutput-ML43GEFN.js} +3 -3
  318. package/chunks/{task-create-I2H322E4.js → task-create-QN4LYRSE.js} +11 -11
  319. package/chunks/{task-list-3OLIWFTQ.js → task-list-JPLGK45U.js} +5 -5
  320. package/chunks/{task-stop-JAUY6MSY.js → task-stop-CXEH5L2D.js} +2 -2
  321. package/chunks/{task-update-B3XO4CPI.js → task-update-IWEOJFV2.js} +11 -11
  322. package/chunks/{team-create-W534PMGX.js → team-create-HVGVUL2L.js} +49 -51
  323. package/chunks/{team-delete-Q7GE7RRI.js → team-delete-RZVVSGCY.js} +5 -5
  324. package/chunks/{team-plan-approval-WNV6P6NG.js → team-plan-approval-S5A5FQWU.js} +48 -50
  325. package/chunks/terminal-image-renderer-SIVPPXDI.js +114 -0
  326. package/chunks/theme-manager-TA33UZZX.js +102 -0
  327. package/chunks/{todoWrite-FJJTY2TI.js → todoWrite-WDJNQEMW.js} +43 -25
  328. package/chunks/{tool-search-Y4KL3LRE.js → tool-search-NX7IPDKP.js} +19 -20
  329. package/chunks/total-session-admission-PWXZBOVX.js +114 -0
  330. package/chunks/trustedFolders-V6Y4CU3F.js +122 -0
  331. package/chunks/{update-relaunch-OHVFN6KF.js → update-relaunch-CGSX3R37.js} +6 -6
  332. package/chunks/updateCheck-T5O2WGIB.js +118 -0
  333. package/chunks/useAutoAcceptIndicator-ULBJJWPY.js +120 -0
  334. package/chunks/{validateNonInterActiveAuth-WJXH426F.js → validateNonInterActiveAuth-E5S2JSRC.js} +114 -108
  335. package/chunks/{version-QMDRADXM.js → version-LS5JPU36.js} +2 -2
  336. package/chunks/{web-fetch-ROS6P4LP.js → web-fetch-RLMFZTS3.js} +25 -244
  337. package/chunks/{web-search-JS3E76O6.js → web-search-LMCIC4N5.js} +11 -13
  338. package/chunks/{web-shell-static-3NUTRHAH.js → web-shell-static-A6QMUNNV.js} +11 -4
  339. package/chunks/webapi-Z5OM224P.js +4118 -0
  340. package/chunks/{workflow-2FCMBTBZ.js → workflow-JBXU3IGA.js} +713 -138
  341. package/chunks/workspace-providers-status-525ORQBH.js +114 -0
  342. package/chunks/{workspace-registration-store-SU4EJKSD.js → workspace-registration-store-7Y44R4LV.js} +1 -1
  343. package/chunks/workspace-registry-HS4RWUSQ.js +123 -0
  344. package/chunks/workspace-service-7PXDM6EB.js +129 -0
  345. package/chunks/workspace-skills-status-FMJGC2XI.js +113 -0
  346. package/chunks/{workspace-trust-reconciler-4Y4F7XIX.js → workspace-trust-reconciler-3YTWSQBY.js} +78 -77
  347. package/chunks/write-file-BVQRYQQO.js +88 -0
  348. package/chunks/{zh-TW-NX43Z2S2.js → zh-TW-RPTMRTHG.js} +5 -1
  349. package/chunks/{zh-3JQ75KFU.js → zh-UNY63FR3.js} +5 -1
  350. package/chunks/{zoom-image-DNBKCGGF.js → zoom-image-FGCELNS4.js} +14 -15
  351. package/cli.js +13 -13
  352. package/locales/ca.js +3 -0
  353. package/locales/de.js +1 -0
  354. package/locales/en.js +5 -0
  355. package/locales/fr.js +1 -0
  356. package/locales/ja.js +1 -0
  357. package/locales/pt.js +1 -0
  358. package/locales/ru.js +1 -0
  359. package/locales/zh-TW.js +5 -0
  360. package/locales/zh.js +5 -0
  361. package/package.json +3 -3
  362. package/web-shell/assets/{abnfDiagram-VCTEODGH-DWHXEVlf.js → abnfDiagram-VCTEODGH-2XZDeWYO.js} +1 -1
  363. package/web-shell/assets/{arc-CXKjm86V.js → arc-B6UgMh90.js} +1 -1
  364. package/web-shell/assets/{architectureDiagram-5GKGNRK7-B_ynI0cX.js → architectureDiagram-5GKGNRK7-DZgNFeN1.js} +1 -1
  365. package/web-shell/assets/{blockDiagram-NRAW4CY4-DMebd9X0.js → blockDiagram-NRAW4CY4-DQ2wvBFN.js} +1 -1
  366. package/web-shell/assets/{c4Diagram-UCG6FXSJ-BZ5BlxS-.js → c4Diagram-UCG6FXSJ-DMmQMrc4.js} +1 -1
  367. package/web-shell/assets/channel-D_TyfiTx.js +1 -0
  368. package/web-shell/assets/{chunk-2Q5K7J3B-CluJKopE.js → chunk-2Q5K7J3B-C8Zh2e9y.js} +1 -1
  369. package/web-shell/assets/{chunk-5VM5RSS4-hzDAPFOo.js → chunk-5VM5RSS4-C3LTenP8.js} +1 -1
  370. package/web-shell/assets/{chunk-F27PBJKO-6vHioKJe.js → chunk-F27PBJKO-CxABOc8n.js} +1 -1
  371. package/web-shell/assets/{chunk-G27WJ6UU-B_5hKTGo.js → chunk-G27WJ6UU-CD_JxHDC.js} +1 -1
  372. package/web-shell/assets/{chunk-JWPE2WC7-CO9VoFCH.js → chunk-JWPE2WC7-BdmZPmce.js} +1 -1
  373. package/web-shell/assets/{chunk-LCL6LL3I-7L5JpxYu.js → chunk-LCL6LL3I-80bcHmfK.js} +1 -1
  374. package/web-shell/assets/{chunk-POPQ4Y6H-DHLJMAqj.js → chunk-POPQ4Y6H-CNpLZyQF.js} +1 -1
  375. package/web-shell/assets/{chunk-SVP7TREG-Dt-4Cqdl.js → chunk-SVP7TREG-CXlKgMv3.js} +1 -1
  376. package/web-shell/assets/{chunk-XXDRQBXY-QlSQ3ssG.js → chunk-XXDRQBXY-CivyYyvL.js} +1 -1
  377. package/web-shell/assets/classDiagram-DTDB5LWJ-Bw_H3xMd.js +1 -0
  378. package/web-shell/assets/classDiagram-v2-JRS7N3AN-Bw_H3xMd.js +1 -0
  379. package/web-shell/assets/{cose-bilkent-JH36ORCC-DMw3EOxl.js → cose-bilkent-JH36ORCC-COAjRH3w.js} +1 -1
  380. package/web-shell/assets/{cynefin-OW5HDTMX-s6vEA7RQ.js → cynefin-OW5HDTMX-DqU1JHO6.js} +1 -1
  381. package/web-shell/assets/{cynefinDiagram-5FMLGOSQ-AOKsvYLt.js → cynefinDiagram-5FMLGOSQ-BCLI1Bvj.js} +1 -1
  382. package/web-shell/assets/{dagre-3AP2YEHR-9QAZn3m7.js → dagre-3AP2YEHR-DmAz8nqF.js} +1 -1
  383. package/web-shell/assets/{diagram-S7CK7UJ4-CWpnu4FN.js → diagram-S7CK7UJ4-Ck-5QLT5.js} +1 -1
  384. package/web-shell/assets/{diagram-UQ7AKVKN-9l0jXD8q.js → diagram-UQ7AKVKN-C0ljX0mW.js} +1 -1
  385. package/web-shell/assets/{diagram-VSXAHHWV-BMUHroj4.js → diagram-VSXAHHWV-DPgvT24v.js} +1 -1
  386. package/web-shell/assets/{diagram-VX7I27RA-Co9x27vm.js → diagram-VX7I27RA-D7hWr1LR.js} +1 -1
  387. package/web-shell/assets/{diagram-Z3DM3KII-BKnTeOER.js → diagram-Z3DM3KII-D59tlOta.js} +1 -1
  388. package/web-shell/assets/{ebnfDiagram-PWID7BFC-QBZD9CKG.js → ebnfDiagram-PWID7BFC-CY2DDx00.js} +1 -1
  389. package/web-shell/assets/{erDiagram-SSCWMZ5O-dKWAEGun.js → erDiagram-SSCWMZ5O-AR4h8Q8k.js} +1 -1
  390. package/web-shell/assets/{flowDiagram-A5DVABFB-CR_UgVqj.js → flowDiagram-A5DVABFB-DbF0HqBz.js} +1 -1
  391. package/web-shell/assets/{ganttDiagram-EL5Y4UJY-DQUnjWO6.js → ganttDiagram-EL5Y4UJY-J52mrIhc.js} +1 -1
  392. package/web-shell/assets/{gitGraphDiagram-WWUBYQGX-C4j59wPL.js → gitGraphDiagram-WWUBYQGX-CcgMY5EV.js} +1 -1
  393. package/web-shell/assets/index-BjUg3vPr.css +5 -0
  394. package/web-shell/assets/index-CFwYYVFU.js +1873 -0
  395. package/web-shell/assets/{index-tYXRIPz4.js → index-MQs7l15A.js} +1 -1
  396. package/web-shell/assets/{infoDiagram-RXCK75RN-mzqbt50w.js → infoDiagram-RXCK75RN-Buu3ibp2.js} +1 -1
  397. package/web-shell/assets/{ishikawaDiagram-5VMMS53U-ChLOqhGl.js → ishikawaDiagram-5VMMS53U-CoKQxnF3.js} +1 -1
  398. package/web-shell/assets/{journeyDiagram-EYS64GPL-SifZE-R8.js → journeyDiagram-EYS64GPL-CxK35mTC.js} +1 -1
  399. package/web-shell/assets/{kanban-definition-3QL26DDD-Sft2qlbc.js → kanban-definition-3QL26DDD-tk2CHTQ1.js} +1 -1
  400. package/web-shell/assets/{layout-O2uHVkPd.js → layout-DEpMwb4u.js} +1 -1
  401. package/web-shell/assets/{linear-BVqYgjSc.js → linear-DSQsLh53.js} +1 -1
  402. package/web-shell/assets/{mermaid.core-CZ9MQaJ6.js → mermaid.core-DIZuPBQT.js} +6 -6
  403. package/web-shell/assets/{mindmap-definition-FBJOCRG2-BNQYjBqM.js → mindmap-definition-FBJOCRG2-CCAvk8r_.js} +1 -1
  404. package/web-shell/assets/{pegDiagram-XKGWAZYB-rh1J8uv6.js → pegDiagram-XKGWAZYB-CpJ28jxz.js} +1 -1
  405. package/web-shell/assets/{pieDiagram-E7YTZNPT-BQHR5mn9.js → pieDiagram-E7YTZNPT-ziJR2R32.js} +1 -1
  406. package/web-shell/assets/{quadrantDiagram-AXDQQJYC-CLCbP7mK.js → quadrantDiagram-AXDQQJYC-B60zE3Mh.js} +1 -1
  407. package/web-shell/assets/{railroadDiagram-O6MQD6OU-CDQhrkbm.js → railroadDiagram-O6MQD6OU-M3GqQ_g1.js} +1 -1
  408. package/web-shell/assets/{requirementDiagram-EFPCY7ZU-BdP9uswg.js → requirementDiagram-EFPCY7ZU-ntCtYqTk.js} +1 -1
  409. package/web-shell/assets/{sankeyDiagram-P5KCCOFB-CFZDFBXF.js → sankeyDiagram-P5KCCOFB-AYLoItcZ.js} +1 -1
  410. package/web-shell/assets/{sequenceDiagram-WJ2MYXX4-BW9WOJXI.js → sequenceDiagram-WJ2MYXX4-DEWk4Mlj.js} +1 -1
  411. package/web-shell/assets/{sizeCapture-X5ZJPWSS-CPMia32z.js → sizeCapture-X5ZJPWSS-OOWvzPay.js} +1 -1
  412. package/web-shell/assets/{stateDiagram-HBIQ2CUA-BANp9p7F.js → stateDiagram-HBIQ2CUA-BcMmvxem.js} +1 -1
  413. package/web-shell/assets/stateDiagram-v2-4QOOHH4V-DRLLqPWO.js +1 -0
  414. package/web-shell/assets/{swimlanes-XN3QIQJK-JroXksK-.js → swimlanes-XN3QIQJK-DuZTWWvh.js} +1 -1
  415. package/web-shell/assets/swimlanesDiagram-VK2B7HYN-DOfLQQYt.js +8 -0
  416. package/web-shell/assets/{timeline-definition-24CTP7MA-DfuVIfYY.js → timeline-definition-24CTP7MA-CjqtZXEd.js} +1 -1
  417. package/web-shell/assets/{vennDiagram-4TSXK5OY-BZXoSjRB.js → vennDiagram-4TSXK5OY-knVCVkQ4.js} +1 -1
  418. package/web-shell/assets/{wardleyDiagram-VM6X3IG4-BdiY8avC.js → wardleyDiagram-VM6X3IG4-yoWhw0a2.js} +1 -1
  419. package/web-shell/assets/{xychartDiagram-S5SC5T6Z-DcXh_U4H.js → xychartDiagram-S5SC5T6Z-ue14E_gL.js} +1 -1
  420. package/web-shell/index.html +20 -5
  421. package/chunks/MaxSizedBox-3OZJCC3J.js +0 -110
  422. package/chunks/agent-BFE3DQM3.js +0 -93
  423. package/chunks/agent-headless-LLVKZZ4P.js +0 -87
  424. package/chunks/bridge-EBYO4SYM.js +0 -118
  425. package/chunks/channel-settings-store-5VP2Y2YM.js +0 -115
  426. package/chunks/chunk-2J3OJGTL.js +0 -98
  427. package/chunks/chunk-7IV52LTO.js +0 -202
  428. package/chunks/chunk-AXMWHKXA.js +0 -42
  429. package/chunks/chunk-F6WFNA7U.js +0 -22
  430. package/chunks/chunk-IO257NUD.js +0 -623
  431. package/chunks/chunk-JS73NNWF.js +0 -30
  432. package/chunks/chunk-SJ4HB27T.js +0 -945
  433. package/chunks/chunk-VGHZT6JR.js +0 -51
  434. package/chunks/chunk-YHC2EYYG.js +0 -125
  435. package/chunks/computer-use-EGPWFEX6.js +0 -2142
  436. package/chunks/config-utils-WZ43VOBS.js +0 -25
  437. package/chunks/contextCommand-5DSEQI6S.js +0 -106
  438. package/chunks/daemon-status-provider-EYMLPYJU.js +0 -116
  439. package/chunks/daemon-trust-policy-CQYKZ7VO.js +0 -112
  440. package/chunks/deferred-core-runtime-WFEPUXZR.js +0 -114
  441. package/chunks/earlyInputCapture-PN4PP7V5.js +0 -107
  442. package/chunks/environment-WUPHLPKZ.js +0 -127
  443. package/chunks/errors-WPMPVIAT.js +0 -113
  444. package/chunks/exitPlanMode-MLFHYZNB.js +0 -85
  445. package/chunks/handleAutoUpdate-F5OTWUT5.js +0 -109
  446. package/chunks/i18n-C562S6KN.js +0 -124
  447. package/chunks/initializer-7YPGOFP4.js +0 -113
  448. package/chunks/installationInfo-ARU5Q2H7.js +0 -107
  449. package/chunks/list-KTSK275C.js +0 -116
  450. package/chunks/loadedSettingsAdapter-F3T2EQ5J.js +0 -110
  451. package/chunks/mcp-6ONTVPAY.js +0 -110
  452. package/chunks/nonInteractiveCli-KZDWFAN6.js +0 -178
  453. package/chunks/pidfile-IO7ALSZF.js +0 -111
  454. package/chunks/process-registry-PMJOA5CO.js +0 -172
  455. package/chunks/prompt-terminal-ledger-TCE7PMCE.js +0 -105
  456. package/chunks/read-file-2HOD2ATO.js +0 -33
  457. package/chunks/resumeHistoryUtils-DDSBAQJS.js +0 -118
  458. package/chunks/ripGrep-E7P6K4QR.js +0 -40
  459. package/chunks/runtime-J4SPTJRQ.js +0 -148
  460. package/chunks/scheduler-VRAEZZ4E.js +0 -122
  461. package/chunks/serve-KEAWV4TI.js +0 -118
  462. package/chunks/shell-H6K63WG3.js +0 -95
  463. package/chunks/skill-settings-TCKLXIXM.js +0 -118
  464. package/chunks/spawnChannel-2K6NKWM5.js +0 -111
  465. package/chunks/standalone-update-LSCGOEFP.js +0 -118
  466. package/chunks/terminal-image-renderer-UHX3UD66.js +0 -114
  467. package/chunks/theme-manager-6B47ZPIF.js +0 -102
  468. package/chunks/total-session-admission-NSCFWGJH.js +0 -113
  469. package/chunks/trustedFolders-7XMJWGQ3.js +0 -122
  470. package/chunks/updateCheck-EOVLHD4T.js +0 -118
  471. package/chunks/useAutoAcceptIndicator-ZNMIGBTN.js +0 -120
  472. package/chunks/workspace-providers-status-GPGU5YMT.js +0 -113
  473. package/chunks/workspace-registry-BQISXT6Y.js +0 -122
  474. package/chunks/workspace-service-LLY6HCUC.js +0 -129
  475. package/chunks/workspace-skills-status-L5N2Y3ZP.js +0 -113
  476. package/chunks/write-file-EJHU2Z3E.js +0 -90
  477. package/web-shell/assets/channel-Zg3WHgq_.js +0 -1
  478. package/web-shell/assets/classDiagram-DTDB5LWJ-C16l9jQz.js +0 -1
  479. package/web-shell/assets/classDiagram-v2-JRS7N3AN-C16l9jQz.js +0 -1
  480. package/web-shell/assets/index-BN_m_uHJ.css +0 -5
  481. package/web-shell/assets/index-DrlJu79f.js +0 -1792
  482. package/web-shell/assets/stateDiagram-v2-4QOOHH4V-NZYAoQLU.js +0 -1
  483. package/web-shell/assets/swimlanesDiagram-VK2B7HYN-3YdVX3vj.js +0 -8
@@ -1,8 +1,12 @@
1
1
  // Force strict mode and setup for ESM
2
2
  "use strict";
3
+ import {
4
+ isUserPromptSubmitContextPartText,
5
+ projectUserTranscriptForDisplay
6
+ } from "./chunk-7J6OTNGO.js";
3
7
  import {
4
8
  runSideQuery
5
- } from "./chunk-ZRYQMWEP.js";
9
+ } from "./chunk-BWORX6FA.js";
6
10
  import {
7
11
  init_esbuild_shims
8
12
  } from "./chunk-5O2XNYP6.js";
@@ -21,8 +25,19 @@ var GOAL_CHECKPOINT_CLAIM_MAX_BYTES = 16e3;
21
25
  var GOAL_CHECKPOINT_SOURCE_REFERENCE_LIMIT = 32;
22
26
  var GOAL_EVIDENCE_CATALOG_EXHAUSTED_REASON = "The current Goal revision exceeded the bounded evidence catalog. Automatic retries cannot recover. Edit or replace the Goal before resuming it.";
23
27
  var GOAL_CHECKPOINT_REQUEST_TOO_LARGE_REASON = "The current Goal revision exceeded the checkpoint verifier request limit. Automatic retries cannot recover. Edit or replace the Goal before resuming it.";
28
+ var GOAL_CHECKPOINT_STALL_LIMIT = 3;
29
+ var GOAL_CHECKPOINT_STALLED_REASON = "The current Goal revision ran three consecutive evidence checkpoints without relief: the evidence window overflowed every time, and each check either came back with a full claim list or a result that could not be folded into claims at all, so every turn paid a checkpoint call and lost uncatalogued evidence. Automatic retries cannot recover. Edit or replace the Goal with a narrower objective before resuming it.";
30
+ var GOAL_DEFAULT_TOKEN_BUDGET = 3e7;
31
+ function goalTokenBudgetReason(tokenBudget) {
32
+ return `The Goal spent its autonomous token budget (${tokenBudget.toLocaleString("en-US")} tokens). Resume the Goal to authorize another budget window, or clear it.`;
33
+ }
34
+ __name(goalTokenBudgetReason, "goalTokenBudgetReason");
35
+ function isGoalTokenBudgetSpent(goal) {
36
+ return goal.tokenBudget !== void 0 && goal.tokensUsed >= goal.tokenBudget;
37
+ }
38
+ __name(isGoalTokenBudgetSpent, "isGoalTokenBudgetSpent");
24
39
  function isGoalLimitKind(value) {
25
- return value === "evidence_catalog" || value === "checkpoint_request";
40
+ return value === "evidence_catalog" || value === "checkpoint_request" || value === "token_budget";
26
41
  }
27
42
  __name(isGoalLimitKind, "isGoalLimitKind");
28
43
  function goalLimitKindForReason(reason) {
@@ -49,9 +64,10 @@ function goalRequiresExactPermit(snapshot) {
49
64
  }
50
65
  __name(goalRequiresExactPermit, "goalRequiresExactPermit");
51
66
  function isRepeatedBlockerProposal(proposal) {
52
- return proposal.status === "blocked" && proposal.blockerKind !== "authority" && proposal.blockerKind !== "external";
67
+ return proposal.status === "blocked" && proposal.blockerKind !== "authority" && proposal.blockerKind !== "external" && proposal.blockerKind !== "infeasible";
53
68
  }
54
69
  __name(isRepeatedBlockerProposal, "isRepeatedBlockerProposal");
70
+ var GOAL_INFEASIBLE_NEXT_STEP = "The objective cannot be satisfied as written; edit or replace the Goal with an objective the evidence allows before resuming it.";
55
71
  function validateGoalProposalReason(reason) {
56
72
  if (!reason.trim()) return "Goal proposal reason must not be empty";
57
73
  if ([...reason].length > GOAL_PROPOSAL_REASON_MAX_CHARACTERS) {
@@ -64,406 +80,10 @@ function validateGoalProposalReason(reason) {
64
80
  }
65
81
  __name(validateGoalProposalReason, "validateGoalProposalReason");
66
82
 
67
- // packages/core/src/utils/transcript-records.ts
68
- init_esbuild_shims();
69
- var USER_PROMPT_SUBMIT_CONTEXT_OPEN = "<qwen:user-prompt-submit-context>";
70
- var USER_PROMPT_SUBMIT_CONTEXT_CLOSE = "</qwen:user-prompt-submit-context>";
71
- var TranscriptRecordPreparationError = class extends TypeError {
72
- constructor(code, message) {
73
- super(message);
74
- this.code = code;
75
- this.name = "TranscriptRecordPreparationError";
76
- }
77
- static {
78
- __name(this, "TranscriptRecordPreparationError");
79
- }
80
- };
81
- var RECORD_TYPES = /* @__PURE__ */ new Set([
82
- "user",
83
- "assistant",
84
- "tool_result",
85
- "system"
86
- ]);
87
- var ARTIFACT_RECORD_SUBTYPES = /* @__PURE__ */ new Set([
88
- "session_artifact_event",
89
- "session_artifact_snapshot"
90
- ]);
91
- var KNOWN_RECORD_SUBTYPES = /* @__PURE__ */ new Set([
92
- "chat_compression",
93
- "slash_command",
94
- "ui_telemetry",
95
- "at_command",
96
- "attribution_snapshot",
97
- "notification",
98
- "cron",
99
- "mid_turn_user_message",
100
- "realtime_message",
101
- "custom_title",
102
- "parent_session",
103
- "rewind",
104
- "agent_bootstrap",
105
- "agent_launch_prompt",
106
- "agent_retry",
107
- "file_history_snapshot",
108
- "session_source",
109
- "branch_checkpoint",
110
- "goal_state",
111
- "goal_runtime",
112
- "turn_result",
113
- ...ARTIFACT_RECORD_SUBTYPES
114
- ]);
115
- function isObjectRecord(value) {
116
- return typeof value === "object" && value !== null && !Array.isArray(value);
117
- }
118
- __name(isObjectRecord, "isObjectRecord");
119
- function wrapUserPromptSubmitContext(context) {
120
- return `${USER_PROMPT_SUBMIT_CONTEXT_OPEN}
121
- ${context}
122
- ${USER_PROMPT_SUBMIT_CONTEXT_CLOSE}`;
123
- }
124
- __name(wrapUserPromptSubmitContext, "wrapUserPromptSubmitContext");
125
- function isUserPromptSubmitContextPartText(text) {
126
- const trimmed = text.trim();
127
- const prefix = `${USER_PROMPT_SUBMIT_CONTEXT_OPEN}
128
- `;
129
- const suffix = `
130
- ${USER_PROMPT_SUBMIT_CONTEXT_CLOSE}`;
131
- if (!trimmed.startsWith(prefix) || !trimmed.endsWith(suffix)) {
132
- return false;
133
- }
134
- const body = trimmed.slice(prefix.length, -suffix.length);
135
- return !body.includes(USER_PROMPT_SUBMIT_CONTEXT_OPEN) && !body.includes(USER_PROMPT_SUBMIT_CONTEXT_CLOSE);
136
- }
137
- __name(isUserPromptSubmitContextPartText, "isUserPromptSubmitContextPartText");
138
- function isUserPromptSubmitContextPart(part) {
139
- return isObjectRecord(part) && typeof part["text"] === "string" && isUserPromptSubmitContextPartText(part["text"]);
140
- }
141
- __name(isUserPromptSubmitContextPart, "isUserPromptSubmitContextPart");
142
- function projectUserTranscriptForDisplay(record) {
143
- const parts = record.message?.parts ?? [];
144
- const hasFinalHookContextPart = parts.length > 1 && isUserPromptSubmitContextPart(parts[parts.length - 1]);
145
- const payload = isObjectRecord(record.systemPayload) ? record.systemPayload : void 0;
146
- const isUserPromptPayload = payload && (typeof payload["hookContext"] === "string" || hasFinalHookContextPart);
147
- const displayText = isUserPromptPayload && typeof payload["displayText"] === "string" ? payload["displayText"] : void 0;
148
- if (displayText !== void 0) {
149
- const visibleParts = parts.filter(
150
- (part) => !isObjectRecord(part) || typeof part["text"] !== "string"
151
- );
152
- return { displayText, parts: visibleParts };
153
- }
154
- if (payload === void 0 && hasFinalHookContextPart) {
155
- return { displayText: void 0, parts: parts.slice(0, -1) };
156
- }
157
- return { displayText: void 0, parts };
158
- }
159
- __name(projectUserTranscriptForDisplay, "projectUserTranscriptForDisplay");
160
- function diagnostic(code, message, affectsCompleteness, fields = {}, severity = affectsCompleteness ? "warning" : "info") {
161
- return {
162
- code,
163
- severity,
164
- message,
165
- affectsCompleteness,
166
- ...fields
167
- };
168
- }
169
- __name(diagnostic, "diagnostic");
170
- function isTranscriptConversationRecord(record) {
171
- return !isTranscriptArtifactRecord(record);
172
- }
173
- __name(isTranscriptConversationRecord, "isTranscriptConversationRecord");
174
- function isTranscriptArtifactRecord(record) {
175
- return record.type === "system" && typeof record.subtype === "string" && ARTIFACT_RECORD_SUBTYPES.has(record.subtype);
176
- }
177
- __name(isTranscriptArtifactRecord, "isTranscriptArtifactRecord");
178
- function validateTranscriptRecord(value, recordIndex) {
179
- const diagnostics = [];
180
- if (!isObjectRecord(value)) {
181
- diagnostics.push(
182
- diagnostic(
183
- "invalid_record",
184
- "Skipped a transcript record that is not an object.",
185
- true,
186
- { recordIndex }
187
- )
188
- );
189
- return { diagnostics };
190
- }
191
- const uuid = value["uuid"];
192
- const parentUuid = value["parentUuid"];
193
- const sessionId = value["sessionId"];
194
- const type = value["type"];
195
- const recordId = typeof uuid === "string" ? uuid : void 0;
196
- if (typeof uuid !== "string" || uuid.length === 0 || typeof parentUuid !== "string" && parentUuid !== null || typeof sessionId !== "string" || sessionId.length === 0) {
197
- diagnostics.push(
198
- diagnostic(
199
- "invalid_record",
200
- "Skipped a transcript record with invalid identity fields.",
201
- true,
202
- { recordIndex, recordId }
203
- )
204
- );
205
- return { diagnostics };
206
- }
207
- if (typeof type !== "string" || !RECORD_TYPES.has(type)) {
208
- diagnostics.push(
209
- diagnostic(
210
- "unknown_record_or_part",
211
- "Skipped a transcript record with an unknown record type.",
212
- true,
213
- { recordIndex, recordId }
214
- )
215
- );
216
- return { diagnostics };
217
- }
218
- const timestamp = value["timestamp"];
219
- if (timestamp !== void 0 && (typeof timestamp !== "string" || !Number.isFinite(new Date(timestamp).getTime()))) {
220
- diagnostics.push(
221
- diagnostic(
222
- "invalid_timestamp",
223
- "Ignored an invalid transcript record timestamp.",
224
- false,
225
- { recordIndex, recordId, path: "timestamp" }
226
- )
227
- );
228
- }
229
- const subtype = value["subtype"];
230
- if (subtype !== void 0 && (typeof subtype !== "string" || !KNOWN_RECORD_SUBTYPES.has(subtype))) {
231
- diagnostics.push(
232
- diagnostic(
233
- "unknown_record_or_part",
234
- "The transcript record has an unknown subtype.",
235
- true,
236
- { recordIndex, recordId, path: "subtype" }
237
- )
238
- );
239
- }
240
- let message;
241
- if (value["message"] !== void 0) {
242
- if (!isObjectRecord(value["message"])) {
243
- diagnostics.push(
244
- diagnostic(
245
- "malformed_part",
246
- "Ignored a malformed transcript message payload.",
247
- true,
248
- { recordIndex, recordId, path: "message" }
249
- )
250
- );
251
- } else {
252
- const parts = value["message"]["parts"];
253
- if (parts !== void 0 && !Array.isArray(parts)) {
254
- diagnostics.push(
255
- diagnostic(
256
- "malformed_part",
257
- "Ignored malformed transcript message parts.",
258
- true,
259
- { recordIndex, recordId, path: "message.parts" }
260
- )
261
- );
262
- }
263
- message = {
264
- ...typeof value["message"]["role"] === "string" ? { role: value["message"]["role"] } : {},
265
- ...Array.isArray(parts) ? { parts } : {}
266
- };
267
- }
268
- }
269
- return {
270
- record: {
271
- ...value,
272
- uuid,
273
- parentUuid,
274
- sessionId,
275
- type,
276
- ...typeof subtype === "string" ? { subtype } : { subtype: void 0 },
277
- ...typeof timestamp === "string" && Number.isFinite(new Date(timestamp).getTime()) ? { timestamp } : { timestamp: void 0 },
278
- ...message ? { message } : { message: void 0 }
279
- },
280
- diagnostics
281
- };
282
- }
283
- __name(validateTranscriptRecord, "validateTranscriptRecord");
284
- function selectTranscriptLeaf(records, leafUuid) {
285
- if (leafUuid !== void 0) {
286
- return records.some(
287
- (record) => record.uuid === leafUuid && isTranscriptConversationRecord(record)
288
- ) ? leafUuid : void 0;
289
- }
290
- for (let index = records.length - 1; index >= 0; index -= 1) {
291
- const record = records[index];
292
- if (record && isTranscriptConversationRecord(record)) return record.uuid;
293
- }
294
- return void 0;
295
- }
296
- __name(selectTranscriptLeaf, "selectTranscriptLeaf");
297
- function walkTranscriptUuidChain(leafUuid, lookup) {
298
- const uuids = [];
299
- const gaps = [];
300
- const visited = /* @__PURE__ */ new Set();
301
- let currentUuid = leafUuid;
302
- let cycleUuid;
303
- while (currentUuid) {
304
- if (visited.has(currentUuid)) {
305
- cycleUuid = currentUuid;
306
- break;
307
- }
308
- visited.add(currentUuid);
309
- const record = lookup(currentUuid);
310
- if (!record) break;
311
- uuids.push(currentUuid);
312
- if (!record.parentUuid) break;
313
- if (!lookup(record.parentUuid)) {
314
- gaps.push({
315
- childUuid: currentUuid,
316
- missingParentUuid: record.parentUuid
317
- });
318
- break;
319
- }
320
- currentUuid = record.parentUuid;
321
- }
322
- uuids.reverse();
323
- return { uuids, gaps, ...cycleUuid ? { cycleUuid } : {} };
324
- }
325
- __name(walkTranscriptUuidChain, "walkTranscriptUuidChain");
326
- function aggregateTranscriptRecordFragments(records) {
327
- const first = records[0];
328
- if (!first) {
329
- throw new Error("Cannot aggregate empty transcript record array");
330
- }
331
- const base = { ...first };
332
- let message = first.message ? { ...first.message, parts: [...first.message.parts ?? []] } : void 0;
333
- for (let index = 1; index < records.length; index += 1) {
334
- const record = records[index];
335
- if (record.message !== void 0) {
336
- message = message ? {
337
- role: message.role,
338
- parts: [...message.parts ?? [], ...record.message.parts ?? []]
339
- } : { ...record.message, parts: [...record.message.parts ?? []] };
340
- }
341
- if (record.usageMetadata) base["usageMetadata"] = record.usageMetadata;
342
- if (record.toolCallResult && !base["toolCallResult"]) {
343
- base["toolCallResult"] = record.toolCallResult;
344
- }
345
- if (record.model && !base["model"]) base["model"] = record.model;
346
- if (record.timestamp && (!base["timestamp"] || record.timestamp > String(base["timestamp"]))) {
347
- base["timestamp"] = record.timestamp;
348
- }
349
- }
350
- base["message"] = message;
351
- return base;
352
- }
353
- __name(aggregateTranscriptRecordFragments, "aggregateTranscriptRecordFragments");
354
- function prepareTranscriptRecords(values, options = {}) {
355
- if (!Array.isArray(values)) {
356
- throw new TranscriptRecordPreparationError(
357
- "invalid_records",
358
- "Transcript records must be an array."
359
- );
360
- }
361
- const diagnostics = [];
362
- const records = [];
363
- const sourceIndexByRecord = /* @__PURE__ */ new Map();
364
- for (let index = 0; index < values.length; index += 1) {
365
- const validated = validateTranscriptRecord(values[index], index);
366
- diagnostics.push(...validated.diagnostics);
367
- if (validated.record) {
368
- records.push(validated.record);
369
- sourceIndexByRecord.set(validated.record, index);
370
- }
371
- }
372
- const sessionIds = new Set(records.map((record) => record.sessionId));
373
- if (sessionIds.size > 1) {
374
- throw new TranscriptRecordPreparationError(
375
- "mixed_session_ids",
376
- "Transcript records contain multiple session ids."
377
- );
378
- }
379
- const leafUuid = selectTranscriptLeaf(records, options.leafUuid);
380
- if (options.leafUuid !== void 0 && leafUuid === void 0) {
381
- throw new TranscriptRecordPreparationError(
382
- "leaf_not_found",
383
- "The requested transcript leaf was not found."
384
- );
385
- }
386
- if (!leafUuid) {
387
- if (records.length > 0) {
388
- diagnostics.push(
389
- diagnostic(
390
- "artifact_only",
391
- "The input contains no conversation records.",
392
- false
393
- )
394
- );
395
- }
396
- return {
397
- ...sessionIds.size === 1 ? { sessionId: records[0].sessionId } : {},
398
- records: [],
399
- gaps: [],
400
- diagnostics
401
- };
402
- }
403
- const fragmentsByUuid = /* @__PURE__ */ new Map();
404
- const firstByUuid = /* @__PURE__ */ new Map();
405
- for (const record of records) {
406
- if (!isTranscriptConversationRecord(record)) continue;
407
- const fragments = fragmentsByUuid.get(record.uuid);
408
- if (fragments) {
409
- if (fragments[0].parentUuid !== record.parentUuid) {
410
- diagnostics.push(
411
- diagnostic(
412
- "conflicting_parent_uuid",
413
- "Duplicate transcript record fragments disagree on parentUuid.",
414
- true,
415
- {
416
- recordIndex: sourceIndexByRecord.get(record),
417
- recordId: record.uuid,
418
- path: "parentUuid"
419
- }
420
- )
421
- );
422
- }
423
- fragments.push(record);
424
- } else {
425
- fragmentsByUuid.set(record.uuid, [record]);
426
- firstByUuid.set(record.uuid, record);
427
- }
428
- }
429
- const chain = walkTranscriptUuidChain(
430
- leafUuid,
431
- (uuid) => firstByUuid.get(uuid)
432
- );
433
- for (const gap of chain.gaps) {
434
- diagnostics.push(
435
- diagnostic(
436
- "history_gap",
437
- "The active transcript chain is missing a parent record.",
438
- true,
439
- { recordId: gap.childUuid }
440
- )
441
- );
442
- }
443
- if (chain.cycleUuid) {
444
- diagnostics.push(
445
- diagnostic(
446
- "parent_cycle",
447
- "The active transcript chain contains a parent cycle.",
448
- true,
449
- { recordId: chain.cycleUuid }
450
- )
451
- );
452
- }
453
- return {
454
- ...sessionIds.size === 1 ? { sessionId: records[0].sessionId } : {},
455
- records: chain.uuids.map(
456
- (uuid) => aggregateTranscriptRecordFragments(fragmentsByUuid.get(uuid) ?? [])
457
- ),
458
- gaps: chain.gaps,
459
- diagnostics
460
- };
461
- }
462
- __name(prepareTranscriptRecords, "prepareTranscriptRecords");
463
-
464
83
  // packages/core/src/goals/goal-evidence.ts
465
84
  init_esbuild_shims();
466
85
  var CATALOG_PREVIEW_LIMIT = 240;
86
+ var CATALOG_PREVIEW_BYTE_LIMIT = 240;
467
87
  var CATALOG_ENTRY_LIMIT = 100;
468
88
  var CATALOG_BYTE_LIMIT = 24e3;
469
89
  var CATALOG_LINEAGE_LIMIT = 16;
@@ -557,6 +177,7 @@ var GoalEvidenceRecordIndexAccumulator = class {
557
177
  this.lastPartPreviewValues
558
178
  ).trim();
559
179
  }
180
+ preview = capPreviewBytes(preview, CATALOG_PREVIEW_BYTE_LIMIT);
560
181
  const catalogEntry = this.provenance && this.parsedGoalContext && preview ? {
561
182
  uuid: this.uuid,
562
183
  provenance: this.provenance,
@@ -703,7 +324,7 @@ var GoalEvidenceCheckpointAccumulator = class {
703
324
  catalogBytes += entryBytes;
704
325
  }
705
326
  this.truncated = truncated;
706
- this.shouldCheckpoint = !truncated && this.candidateUuids.length > 0 && (this.checkpointEntries.length + this.candidateUuids.length >= CHECKPOINT_ENTRY_THRESHOLD || catalogBytes >= CHECKPOINT_BYTE_THRESHOLD);
327
+ this.shouldCheckpoint = this.candidateUuids.length > 0 && (truncated || this.checkpointEntries.length + this.candidateUuids.length >= CHECKPOINT_ENTRY_THRESHOLD || catalogBytes >= CHECKPOINT_BYTE_THRESHOLD);
707
328
  }
708
329
  static {
709
330
  __name(this, "GoalEvidenceCheckpointAccumulator");
@@ -1051,7 +672,13 @@ function repeatedBlockerCoverageCatalogued(analysis) {
1051
672
  __name(repeatedBlockerCoverageCatalogued, "repeatedBlockerCoverageCatalogued");
1052
673
  function validateBlockerCoverage(proposal, citedRecords, analysis) {
1053
674
  if (proposal.status !== "blocked") return;
1054
- if (proposal.blockerKind === "authority" || proposal.blockerKind === "external") {
675
+ if (proposal.blockerKind === "infeasible" && !citedRecords.some(({ proofKind }) => proofKind === "external_fact")) {
676
+ throw new InvalidGoalEvidenceReferenceError(
677
+ "infeasible_blocker_external_fact_required",
678
+ "An infeasible blocker requires cited external tool evidence of the fact that makes the objective unsatisfiable."
679
+ );
680
+ }
681
+ if (proposal.blockerKind === "authority" || proposal.blockerKind === "external" || proposal.blockerKind === "infeasible") {
1055
682
  if (!citedRecords.some(
1056
683
  ({ proofKind }) => proofKind === "user_input" || proofKind === "external_fact"
1057
684
  )) {
@@ -1099,7 +726,10 @@ function checkpointCatalogEntries(goal) {
1099
726
  uuid: claim.id,
1100
727
  provenance: "goal_checkpoint",
1101
728
  turnId: `checkpoint:${checkpoint.checkpointId}`,
1102
- preview: claim.claim.slice(0, CATALOG_PREVIEW_LIMIT),
729
+ preview: capPreviewBytes(
730
+ claim.claim.slice(0, CATALOG_PREVIEW_LIMIT),
731
+ CATALOG_PREVIEW_BYTE_LIMIT
732
+ ),
1103
733
  proofKind: claim.proofKind
1104
734
  }));
1105
735
  }
@@ -1168,6 +798,21 @@ function legacySafeProvenance(record) {
1168
798
  return void 0;
1169
799
  }
1170
800
  __name(legacySafeProvenance, "legacySafeProvenance");
801
+ function capPreviewBytes(value, limit) {
802
+ if (Buffer.byteLength(value, "utf8") <= limit) {
803
+ return value;
804
+ }
805
+ let byteLength = 0;
806
+ let cutoff = 0;
807
+ for (const codePoint of value) {
808
+ const codePointBytes = Buffer.byteLength(codePoint, "utf8");
809
+ if (byteLength + codePointBytes > limit) break;
810
+ byteLength += codePointBytes;
811
+ cutoff += codePoint.length;
812
+ }
813
+ return value.slice(0, cutoff);
814
+ }
815
+ __name(capPreviewBytes, "capPreviewBytes");
1171
816
  function capCheckpointContent(content) {
1172
817
  if (Buffer.byteLength(content, "utf8") <= CHECKPOINT_CONTENT_BYTE_LIMIT) {
1173
818
  return content;
@@ -1206,7 +851,10 @@ __name(evidenceContent, "evidenceContent");
1206
851
  function evidencePreview(record, provenance) {
1207
852
  const projection = provenance === "real_user" ? projectUserTranscriptForDisplay(record) : void 0;
1208
853
  if (projection?.displayText !== void 0) {
1209
- return projection.displayText.slice(0, CATALOG_PREVIEW_LIMIT).trim();
854
+ return capPreviewBytes(
855
+ projection.displayText.slice(0, CATALOG_PREVIEW_LIMIT).trim(),
856
+ CATALOG_PREVIEW_BYTE_LIMIT
857
+ );
1210
858
  }
1211
859
  let preview = "";
1212
860
  const append = /* @__PURE__ */ __name((value) => {
@@ -1225,7 +873,7 @@ function evidencePreview(record, provenance) {
1225
873
  }
1226
874
  if (preview.length >= CATALOG_PREVIEW_LIMIT) break;
1227
875
  }
1228
- return preview.trim();
876
+ return capPreviewBytes(preview.trim(), CATALOG_PREVIEW_BYTE_LIMIT);
1229
877
  }
1230
878
  __name(evidencePreview, "evidencePreview");
1231
879
  function renderToolResponse(functionResponse) {
@@ -1346,7 +994,8 @@ function reduceGoalControl(current, transition) {
1346
994
  transition.nextGoalId,
1347
995
  normalizeObjective(request.objective, snapshotOf(null)),
1348
996
  transition.now,
1349
- transition.cursor
997
+ transition.cursor,
998
+ transition.tokenBudgetGrant
1350
999
  );
1351
1000
  }
1352
1001
  assertExpectedVersion(
@@ -1360,7 +1009,8 @@ function reduceGoalControl(current, transition) {
1360
1009
  transition.nextGoalId,
1361
1010
  normalizeObjective(request.objective, snapshotOf(current)),
1362
1011
  transition.now,
1363
- transition.cursor
1012
+ transition.cursor,
1013
+ transition.tokenBudgetGrant
1364
1014
  );
1365
1015
  }
1366
1016
  if (request.action === "edit") {
@@ -1375,6 +1025,8 @@ function reduceGoalControl(current, transition) {
1375
1025
  objective: normalizeObjective(request.objective, snapshotOf(current)),
1376
1026
  evidenceCursor: copyCursor(transition.cursor),
1377
1027
  evidenceCheckpoint: void 0,
1028
+ checkpointStalls: void 0,
1029
+ ...rearmedTokenBudget(current, transition.tokenBudgetGrant),
1378
1030
  lastReason: void 0,
1379
1031
  limitKind: void 0
1380
1032
  });
@@ -1400,17 +1052,34 @@ function reduceGoalControl(current, transition) {
1400
1052
  snapshotOf(current)
1401
1053
  );
1402
1054
  }
1403
- if (current.status === "usage_limited" && isEvidenceLimited(current)) {
1404
- throw new GoalInvalidTransitionError(
1405
- "An evidence-limited Goal cannot be resumed; edit or replace the Goal first",
1406
- snapshotOf(current)
1407
- );
1055
+ if (request.action === "resume" && current.status === "usage_limited" && current.limitKind === "token_budget") {
1056
+ return transitionGoal(current, transition.now, {
1057
+ status: "active",
1058
+ ...rearmedTokenBudget(current, transition.tokenBudgetGrant),
1059
+ lastReason: void 0,
1060
+ limitKind: void 0
1061
+ });
1408
1062
  }
1409
1063
  if (request.action !== "resume") {
1410
1064
  return assertNever(request, snapshotOf(current));
1411
1065
  }
1066
+ if (current.status === "usage_limited" && isEvidenceLimited(current)) {
1067
+ return transitionGoal(current, transition.now, {
1068
+ status: "active",
1069
+ evidenceCursor: copyCursor(transition.cursor),
1070
+ evidenceCheckpoint: void 0,
1071
+ // The streak counts checkpoints against one window; this resume starts
1072
+ // a different one, so carrying it over would spend the new window's
1073
+ // allowance on the old window's failures.
1074
+ checkpointStalls: void 0,
1075
+ ...rearmedTokenBudget(current, transition.tokenBudgetGrant),
1076
+ lastReason: void 0,
1077
+ limitKind: void 0
1078
+ });
1079
+ }
1412
1080
  return transitionGoal(current, transition.now, {
1413
- status: "active"
1081
+ status: "active",
1082
+ ...rearmedTokenBudget(current, transition.tokenBudgetGrant)
1414
1083
  });
1415
1084
  }
1416
1085
  __name(reduceGoalControl, "reduceGoalControl");
@@ -1423,7 +1092,9 @@ function reduceGoalTurnFinished(current, transition) {
1423
1092
  }
1424
1093
  return transitionGoal(current, transition.now, {
1425
1094
  turnCount: current.turnCount + 1,
1426
- ...transition.lastReason === void 0 ? {} : { lastReason: transition.lastReason }
1095
+ tokensUsed: current.tokensUsed + Math.max(0, transition.tokensUsed ?? 0),
1096
+ ...transition.lastReason === void 0 ? {} : { lastReason: transition.lastReason },
1097
+ ...transition.windDownTurnId === void 0 ? {} : { windDownTurnId: transition.windDownTurnId }
1427
1098
  });
1428
1099
  }
1429
1100
  __name(reduceGoalTurnFinished, "reduceGoalTurnFinished");
@@ -1526,7 +1197,7 @@ function parseGoalStateCause(value) {
1526
1197
  return isGoalStateCause(value) ? value : void 0;
1527
1198
  }
1528
1199
  __name(parseGoalStateCause, "parseGoalStateCause");
1529
- function createGoal(goalId, objective, now, cursor) {
1200
+ function createGoal(goalId, objective, now, cursor, tokenBudget) {
1530
1201
  return {
1531
1202
  goalId,
1532
1203
  revision: 1,
@@ -1535,6 +1206,10 @@ function createGoal(goalId, objective, now, cursor) {
1535
1206
  evidenceCursor: copyCursor(cursor),
1536
1207
  turnCount: 0,
1537
1208
  activeTimeMs: 0,
1209
+ tokensUsed: 0,
1210
+ // A non-finite grant (a host opting out) arms nothing: `Infinity` would
1211
+ // not survive the JSON journal, so "unbounded" is spelled as no field.
1212
+ ...tokenBudget !== void 0 && Number.isFinite(tokenBudget) ? { tokenBudget } : {},
1538
1213
  createdAt: now,
1539
1214
  updatedAt: now
1540
1215
  };
@@ -1558,16 +1233,30 @@ function normalizeObjective(objective, current) {
1558
1233
  }
1559
1234
  __name(normalizeObjective, "normalizeObjective");
1560
1235
  function isEvidenceLimited(goal) {
1561
- return goal.limitKind !== void 0 || goal.lastReason !== void 0 && goalLimitKindForReason(goal.lastReason) !== void 0;
1236
+ return goal.limitKind === "evidence_catalog" || goal.limitKind === "checkpoint_request" || goal.lastReason !== void 0 && goalLimitKindForReason(goal.lastReason) !== void 0;
1562
1237
  }
1563
1238
  __name(isEvidenceLimited, "isEvidenceLimited");
1239
+ function rearmedTokenBudget(current, grant) {
1240
+ if (grant === void 0 || !isGoalTokenBudgetSpent(current)) {
1241
+ return {};
1242
+ }
1243
+ return Number.isFinite(grant) ? { tokenBudget: current.tokensUsed + grant, windDownTurnId: void 0 } : { tokenBudget: void 0, windDownTurnId: void 0 };
1244
+ }
1245
+ __name(rearmedTokenBudget, "rearmedTokenBudget");
1564
1246
  function transitionGoal(goal, now, changes) {
1565
- return {
1247
+ const transitioned = {
1566
1248
  ...goal,
1567
1249
  ...changes,
1568
1250
  activeTimeMs: elapsedActiveTime(goal, now),
1569
1251
  updatedAt: now
1570
1252
  };
1253
+ if ("tokenBudget" in changes && changes.tokenBudget === void 0) {
1254
+ delete transitioned.tokenBudget;
1255
+ }
1256
+ if ("windDownTurnId" in changes && changes.windDownTurnId === void 0) {
1257
+ delete transitioned.windDownTurnId;
1258
+ }
1259
+ return transitioned;
1571
1260
  }
1572
1261
  __name(transitionGoal, "transitionGoal");
1573
1262
  function snapshotOf(goal) {
@@ -1597,12 +1286,16 @@ function parseGoalRecord(value) {
1597
1286
  "evidenceCursor",
1598
1287
  "turnCount",
1599
1288
  "activeTimeMs",
1289
+ "tokensUsed",
1290
+ "tokenBudget",
1291
+ "windDownTurnId",
1600
1292
  "createdAt",
1601
1293
  "updatedAt",
1602
1294
  "evidenceCheckpoint",
1295
+ "checkpointStalls",
1603
1296
  "lastReason",
1604
1297
  "limitKind"
1605
- ]) || typeof value["goalId"] !== "string" || !value["goalId"] || !isNonNegativeInteger(value["revision"]) || value["revision"] === 0 || typeof value["objective"] !== "string" || !value["objective"].trim() || !isGoalStatus(value["status"]) || !isTranscriptCursor(value["evidenceCursor"]) || !isNonNegativeInteger(value["turnCount"]) || !isNonNegativeNumber(value["activeTimeMs"]) || !isFiniteNumber(value["createdAt"]) || !isFiniteNumber(value["updatedAt"]) || !isGoalEvidenceCheckpoint(value["evidenceCheckpoint"]) || value["lastReason"] !== void 0 && typeof value["lastReason"] !== "string" || value["limitKind"] !== void 0 && (!isGoalLimitKind(value["limitKind"]) || value["status"] !== "usage_limited")) {
1298
+ ]) || typeof value["goalId"] !== "string" || !value["goalId"] || !isNonNegativeInteger(value["revision"]) || value["revision"] === 0 || typeof value["objective"] !== "string" || !value["objective"].trim() || !isGoalStatus(value["status"]) || !isTranscriptCursor(value["evidenceCursor"]) || !isNonNegativeInteger(value["turnCount"]) || !isNonNegativeNumber(value["activeTimeMs"]) || value["tokensUsed"] !== void 0 && !isNonNegativeNumber(value["tokensUsed"]) || value["tokenBudget"] !== void 0 && !isNonNegativeNumber(value["tokenBudget"]) || value["windDownTurnId"] !== void 0 && (typeof value["windDownTurnId"] !== "string" || !value["windDownTurnId"]) || !isFiniteNumber(value["createdAt"]) || !isFiniteNumber(value["updatedAt"]) || !isGoalEvidenceCheckpoint(value["evidenceCheckpoint"]) || value["checkpointStalls"] !== void 0 && !isNonNegativeInteger(value["checkpointStalls"]) || value["lastReason"] !== void 0 && typeof value["lastReason"] !== "string" || value["limitKind"] !== void 0 && (!isGoalLimitKind(value["limitKind"]) || value["status"] !== "usage_limited")) {
1606
1299
  return void 0;
1607
1300
  }
1608
1301
  if (value["evidenceCheckpoint"] && value["evidenceCursor"].recordId !== value["evidenceCheckpoint"].checkpointId) {
@@ -1616,11 +1309,18 @@ function parseGoalRecord(value) {
1616
1309
  evidenceCursor: copyCursor(value["evidenceCursor"]),
1617
1310
  turnCount: value["turnCount"],
1618
1311
  activeTimeMs: value["activeTimeMs"],
1312
+ // Goals persisted before `tokensUsed` existed carry no spend to restore.
1313
+ tokensUsed: value["tokensUsed"] ?? 0,
1314
+ // And no budget: a Goal from before budgets existed stays unbounded.
1315
+ ...value["tokenBudget"] === void 0 ? {} : { tokenBudget: value["tokenBudget"] },
1316
+ ...value["windDownTurnId"] === void 0 ? {} : { windDownTurnId: value["windDownTurnId"] },
1619
1317
  createdAt: value["createdAt"],
1620
1318
  updatedAt: value["updatedAt"],
1621
1319
  ...value["evidenceCheckpoint"] === void 0 ? {} : {
1622
1320
  evidenceCheckpoint: structuredClone(value["evidenceCheckpoint"])
1623
1321
  },
1322
+ // Zero is spelled as no field; a persisted 0 restores the same way.
1323
+ ...value["checkpointStalls"] ? { checkpointStalls: value["checkpointStalls"] } : {},
1624
1324
  ...value["lastReason"] === void 0 ? {} : { lastReason: value["lastReason"] },
1625
1325
  ...value["limitKind"] === void 0 ? {} : { limitKind: value["limitKind"] }
1626
1326
  };
@@ -1712,6 +1412,10 @@ import { randomUUID } from "node:crypto";
1712
1412
 
1713
1413
  // packages/core/src/goals/goal-checkpoint.ts
1714
1414
  init_esbuild_shims();
1415
+ function isGoalCheckpointStalled(window, checkpoint) {
1416
+ return window.truncated && checkpoint.claims.length >= GOAL_CHECKPOINT_CLAIM_LIMIT;
1417
+ }
1418
+ __name(isGoalCheckpointStalled, "isGoalCheckpointStalled");
1715
1419
  var InvalidGoalCheckpointError = class extends Error {
1716
1420
  static {
1717
1421
  __name(this, "InvalidGoalCheckpointError");
@@ -1894,10 +1598,14 @@ function parseGoalCheckpointVerifierText(text) {
1894
1598
  try {
1895
1599
  value = JSON.parse(text);
1896
1600
  } catch {
1897
- throw new Error("Goal checkpoint verifier returned invalid JSON");
1601
+ throw new InvalidGoalCheckpointError(
1602
+ "Goal checkpoint verifier returned invalid JSON"
1603
+ );
1898
1604
  }
1899
1605
  if (!isRecord4(value) || !hasOnlyKeys4(value, ["claims"]) || !Array.isArray(value["claims"]) || value["claims"].length === 0 || value["claims"].length > GOAL_CHECKPOINT_CLAIM_LIMIT) {
1900
- throw new Error("Goal checkpoint verifier returned invalid claims");
1606
+ throw new InvalidGoalCheckpointError(
1607
+ "Goal checkpoint verifier returned invalid claims"
1608
+ );
1901
1609
  }
1902
1610
  const claims = value["claims"].map(
1903
1611
  (claim, index) => parseClaim(claim, index)
@@ -1905,15 +1613,6 @@ function parseGoalCheckpointVerifierText(text) {
1905
1613
  return { claims };
1906
1614
  }
1907
1615
  __name(parseGoalCheckpointVerifierText, "parseGoalCheckpointVerifierText");
1908
- function validateGoalCheckpointVerifierText(text) {
1909
- try {
1910
- parseGoalCheckpointVerifierText(text);
1911
- return null;
1912
- } catch (error) {
1913
- return error instanceof Error ? error.message : "Goal checkpoint verifier returned invalid output";
1914
- }
1915
- }
1916
- __name(validateGoalCheckpointVerifierText, "validateGoalCheckpointVerifierText");
1917
1616
  function createGoalCheckpointVerifier(config, options = {}) {
1918
1617
  const timeoutMs = options.timeoutMs ?? GOAL_CHECKPOINT_VERIFIER_TIMEOUT_MS;
1919
1618
  return async (input, attemptSignal) => {
@@ -1938,8 +1637,11 @@ function createGoalCheckpointVerifier(config, options = {}) {
1938
1637
  responseMimeType: "application/json",
1939
1638
  responseJsonSchema: GOAL_CHECKPOINT_VERIFIER_SCHEMA,
1940
1639
  thinkingConfig: { thinkingBudget: 0, includeThoughts: false }
1941
- },
1942
- validate: validateGoalCheckpointVerifierText
1640
+ }
1641
+ // Parsing stays out of a validate hook: runSideQuery re-wraps hook
1642
+ // failures into plain Errors, dropping the InvalidGoalCheckpointError
1643
+ // class the runtime's checkpoint stall breaker counts unusable
1644
+ // results by.
1943
1645
  });
1944
1646
  return parseGoalCheckpointVerifierText(result.text);
1945
1647
  } finally {
@@ -1952,11 +1654,15 @@ function parseClaim(value, index) {
1952
1654
  if (!isRecord4(value) || !hasOnlyKeys4(value, ["proofKind", "claim", "sourceRefs"]) || !isGoalEvidenceProofKind(value["proofKind"]) || typeof value["claim"] !== "string" || !Array.isArray(value["sourceRefs"]) || value["sourceRefs"].length === 0 || value["sourceRefs"].length > GOAL_CHECKPOINT_SOURCE_REFERENCE_LIMIT || value["sourceRefs"].some(
1953
1655
  (reference) => typeof reference !== "string" || reference.length === 0
1954
1656
  ) || new Set(value["sourceRefs"]).size !== value["sourceRefs"].length) {
1955
- throw new Error(`Goal checkpoint verifier claim ${index + 1} is invalid`);
1657
+ throw new InvalidGoalCheckpointError(
1658
+ `Goal checkpoint verifier claim ${index + 1} is invalid`
1659
+ );
1956
1660
  }
1957
1661
  const claim = value["claim"].trim();
1958
1662
  if (!claim || [...claim].length > GOAL_CHECKPOINT_CLAIM_MAX_CHARACTERS) {
1959
- throw new Error(`Goal checkpoint verifier claim ${index + 1} is invalid`);
1663
+ throw new InvalidGoalCheckpointError(
1664
+ `Goal checkpoint verifier claim ${index + 1} is invalid`
1665
+ );
1960
1666
  }
1961
1667
  return {
1962
1668
  proofKind: value["proofKind"],
@@ -2021,7 +1727,7 @@ function recoverLegacyGoal(records) {
2021
1727
  }
2022
1728
  for (let itemIndex = payload.outputHistoryItems.length - 1; itemIndex >= 0; itemIndex -= 1) {
2023
1729
  const value = payload.outputHistoryItems[itemIndex];
2024
- if (!isObjectRecord2(value) || value["type"] !== "goal_status") continue;
1730
+ if (!isObjectRecord(value) || value["type"] !== "goal_status") continue;
2025
1731
  const kind = value["kind"];
2026
1732
  const condition = value["condition"];
2027
1733
  if (typeof kind !== "string" || typeof condition !== "string") {
@@ -2065,7 +1771,7 @@ function normalizeGoalRecoveryRecord(record) {
2065
1771
  return void 0;
2066
1772
  }
2067
1773
  const goalStatusItems = payload.outputHistoryItems.filter(
2068
- (value) => isObjectRecord2(value) && value["type"] === "goal_status"
1774
+ (value) => isObjectRecord(value) && value["type"] === "goal_status"
2069
1775
  );
2070
1776
  if (goalStatusItems.length === 0) return void 0;
2071
1777
  return {
@@ -2086,7 +1792,7 @@ function isGoalRecoveryCandidate(record) {
2086
1792
  }
2087
1793
  const payload = record.systemPayload;
2088
1794
  return payload?.phase === "result" && Array.isArray(payload.outputHistoryItems) && payload.outputHistoryItems.some(
2089
- (value) => isObjectRecord2(value) && value["type"] === "goal_status"
1795
+ (value) => isObjectRecord(value) && value["type"] === "goal_status"
2090
1796
  );
2091
1797
  }
2092
1798
  __name(isGoalRecoveryCandidate, "isGoalRecoveryCandidate");
@@ -2097,10 +1803,10 @@ function unsupportedLegacy(recordUuid) {
2097
1803
  };
2098
1804
  }
2099
1805
  __name(unsupportedLegacy, "unsupportedLegacy");
2100
- function isObjectRecord2(value) {
1806
+ function isObjectRecord(value) {
2101
1807
  return typeof value === "object" && value !== null && !Array.isArray(value);
2102
1808
  }
2103
- __name(isObjectRecord2, "isObjectRecord");
1809
+ __name(isObjectRecord, "isObjectRecord");
2104
1810
  function createMigratedGoalState(input) {
2105
1811
  const objective = input.objective.trim();
2106
1812
  if (!objective) {
@@ -2120,6 +1826,7 @@ function createMigratedGoalState(input) {
2120
1826
  evidenceCursor: { recordId: input.recordUuid },
2121
1827
  turnCount: 0,
2122
1828
  activeTimeMs: 0,
1829
+ tokensUsed: 0,
2123
1830
  createdAt: input.now,
2124
1831
  updatedAt: input.now
2125
1832
  }
@@ -2169,6 +1876,9 @@ function createGoalRuntime(options) {
2169
1876
  let currentTurnKey;
2170
1877
  let queuedTurnKey;
2171
1878
  let continuationQueued = false;
1879
+ let announcedObjective;
1880
+ let currentTurnAnnouncement;
1881
+ let currentTurnDelivered = false;
2172
1882
  let currentProposal;
2173
1883
  let pendingProposal;
2174
1884
  let verificationAttempt;
@@ -2178,6 +1888,7 @@ function createGoalRuntime(options) {
2178
1888
  let currentTurnFeedback;
2179
1889
  let restored = false;
2180
1890
  let restoreActivationPending = false;
1891
+ let windDownTurnId;
2181
1892
  let restorePreparation;
2182
1893
  let restoreActivation;
2183
1894
  let preparedRestoreCause;
@@ -2192,6 +1903,73 @@ function createGoalRuntime(options) {
2192
1903
  recordUuid,
2193
1904
  controller: new AbortController()
2194
1905
  } : void 0, "createCheckpointAttempt");
1906
+ const takeTurnTokens = /* @__PURE__ */ __name((turnId) => {
1907
+ if (!options.tokenLedger) return 0;
1908
+ try {
1909
+ const tokens = options.tokenLedger.takeGoalTurnTokens(turnId);
1910
+ return Number.isFinite(tokens) ? Math.max(0, tokens) : 0;
1911
+ } catch {
1912
+ return 0;
1913
+ }
1914
+ }, "takeTurnTokens");
1915
+ const tokenBudgetGrant = options.tokenBudgetGrant ?? GOAL_DEFAULT_TOKEN_BUDGET;
1916
+ const usageLimitedSnapshot = /* @__PURE__ */ __name((goal, reason, limitKind) => {
1917
+ const now = Date.now();
1918
+ return {
1919
+ v: GOAL_STATE_VERSION,
1920
+ goal: {
1921
+ ...goal,
1922
+ status: "usage_limited",
1923
+ activeTimeMs: elapsedActiveTime(goal, now),
1924
+ updatedAt: now,
1925
+ lastReason: reason,
1926
+ ...limitKind === void 0 ? {} : { limitKind }
1927
+ },
1928
+ activity: "idle"
1929
+ };
1930
+ }, "usageLimitedSnapshot");
1931
+ const journalUsageLimitedSettle = /* @__PURE__ */ __name(async (goal, reason, limitKind) => {
1932
+ const limitedSnapshot = usageLimitedSnapshot(goal, reason, limitKind);
1933
+ await options.journal.recordGoalState(randomUUID(), {
1934
+ v: GOAL_STATE_VERSION,
1935
+ cause: "usage_limited",
1936
+ snapshot: limitedSnapshot
1937
+ });
1938
+ return limitedSnapshot;
1939
+ }, "journalUsageLimitedSettle");
1940
+ const commitUsageLimitedSettle = /* @__PURE__ */ __name((limitedSnapshot) => {
1941
+ continuationQueued = false;
1942
+ currentTurnFeedback = void 0;
1943
+ snapshot = structuredClone(limitedSnapshot);
1944
+ broadcast("usage_limited");
1945
+ }, "commitUsageLimitedSettle");
1946
+ const stopForSpentBudget = /* @__PURE__ */ __name(() => {
1947
+ void enqueue(async () => {
1948
+ const goal = snapshot.goal;
1949
+ if (!goal || goal.status !== "active" || !isGoalTokenBudgetSpent(goal) || currentPermit || pendingProposal || verificationAttempt || checkpointAttempt) {
1950
+ return;
1951
+ }
1952
+ const reason = goalTokenBudgetReason(goal.tokenBudget);
1953
+ let limitedSnapshot;
1954
+ try {
1955
+ limitedSnapshot = await journalUsageLimitedSettle(
1956
+ goal,
1957
+ reason,
1958
+ "token_budget"
1959
+ );
1960
+ } catch {
1961
+ limitedSnapshot = usageLimitedSnapshot(goal, reason, "token_budget");
1962
+ }
1963
+ if (snapshot.goal?.goalId !== goal.goalId || snapshot.goal.revision !== goal.revision || snapshot.goal.status !== "active" || currentPermit) {
1964
+ return;
1965
+ }
1966
+ commitUsageLimitedSettle(limitedSnapshot);
1967
+ }).catch(() => void 0);
1968
+ }, "stopForSpentBudget");
1969
+ const withCheckpointStalls = /* @__PURE__ */ __name((goal, checkpointStalls) => {
1970
+ const { checkpointStalls: _previous, ...rest } = goal;
1971
+ return checkpointStalls > 0 ? { ...rest, checkpointStalls } : rest;
1972
+ }, "withCheckpointStalls");
2195
1973
  const assertAvailable = /* @__PURE__ */ __name(() => {
2196
1974
  if (disposed) throw new Error(GOAL_RUNTIME_DISPOSED_MESSAGE);
2197
1975
  }, "assertAvailable");
@@ -2214,7 +1992,14 @@ function createGoalRuntime(options) {
2214
1992
  } catch {
2215
1993
  }
2216
1994
  }, "preemptHost");
2217
- const flushContinuation = /* @__PURE__ */ __name((cause) => {
1995
+ const settleCurrentTurnAnnouncement = /* @__PURE__ */ __name((delivered) => {
1996
+ if (delivered && currentTurnAnnouncement !== void 0) {
1997
+ announcedObjective = currentTurnAnnouncement;
1998
+ }
1999
+ currentTurnAnnouncement = void 0;
2000
+ currentTurnDelivered = false;
2001
+ }, "settleCurrentTurnAnnouncement");
2002
+ const flushContinuation = /* @__PURE__ */ __name((cause, windDown = false) => {
2218
2003
  if (!continuationQueued || !host || currentPermit || pendingProposal || verificationAttempt || checkpointAttempt || snapshot.activity !== "idle" || snapshot.goal?.status !== "active") {
2219
2004
  return;
2220
2005
  }
@@ -2232,11 +2017,16 @@ function createGoalRuntime(options) {
2232
2017
  currentPermitHost = scheduledHost;
2233
2018
  currentTurnKey = `goal-runtime:${currentPermit.turnId}`;
2234
2019
  const startedPermit = structuredClone(currentPermit);
2020
+ const objectiveUpdated = announcedObjective !== void 0 && announcedObjective !== continuationContext;
2021
+ currentTurnAnnouncement = continuationContext;
2022
+ currentTurnDelivered = false;
2023
+ windDownTurnId = windDown ? startedPermit.turnId : void 0;
2235
2024
  snapshot = { ...snapshot, activity: "running" };
2236
2025
  broadcast(cause);
2237
2026
  const handleStartFailure = /* @__PURE__ */ __name(() => {
2238
2027
  void enqueue(async () => {
2239
2028
  if (isCurrentPermit(startedPermit)) {
2029
+ settleCurrentTurnAnnouncement(false);
2240
2030
  const nextTurnKey = queuedTurnKey;
2241
2031
  currentPermit = void 0;
2242
2032
  currentPermitHost = void 0;
@@ -2273,6 +2063,8 @@ function createGoalRuntime(options) {
2273
2063
  started = scheduledHost.startGoalTurn({
2274
2064
  permit: startedPermit,
2275
2065
  continuationContext,
2066
+ ...objectiveUpdated ? { objectiveUpdated } : {},
2067
+ ...windDown ? { windDown } : {},
2276
2068
  ...verifierFeedback ? { verifierFeedback } : {}
2277
2069
  });
2278
2070
  } catch {
@@ -2285,6 +2077,15 @@ function createGoalRuntime(options) {
2285
2077
  if (restoreActivationPending || snapshot.goal?.status !== "active" || currentPermit || pendingProposal || verificationAttempt || checkpointAttempt) {
2286
2078
  return;
2287
2079
  }
2080
+ if (isGoalTokenBudgetSpent(snapshot.goal)) {
2081
+ if (snapshot.goal.windDownTurnId !== void 0) {
2082
+ stopForSpentBudget();
2083
+ return;
2084
+ }
2085
+ continuationQueued = true;
2086
+ flushContinuation(cause, true);
2087
+ return;
2088
+ }
2288
2089
  continuationQueued = true;
2289
2090
  flushContinuation(cause);
2290
2091
  }, "queueContinuation");
@@ -2342,7 +2143,7 @@ function createGoalRuntime(options) {
2342
2143
  return {
2343
2144
  ...base,
2344
2145
  proposal: { ...attempt.proposal, status: "blocked" },
2345
- blockedPolicy: "A blocked Goal is resumable. It may be accepted immediately only when the evidence shows that new user authority or a material user choice is required, or that an external state change is required, and no meaningful in-scope work remains. An ordinary technical blocker requires evidence of the same cause from the current and two immediately preceding Goal turns. Difficulty, uncertainty, incomplete work, or a preference for clarification do not by themselves justify blocked."
2146
+ blockedPolicy: "A blocked Goal is resumable. It may be accepted immediately only when the evidence shows that new user authority or a material user choice is required, or that an external state change is required, and no meaningful in-scope work remains. An infeasible blocker may also be accepted immediately, only when cited external_fact evidence shows the objective cannot be satisfied as written: it contradicts itself, it names a target that verifiably does not exist, or it requires an action outside what the tools can perform; reject it when the obstacle is difficulty, uncertainty, information the model could still obtain, or a preference to ask. An ordinary technical blocker requires evidence of the same cause from the current and two immediately preceding Goal turns. Difficulty, uncertainty, incomplete work, or a preference for clarification do not by themselves justify blocked."
2346
2147
  };
2347
2148
  }, "verifierInput");
2348
2149
  const promoteQueuedUserTurn = /* @__PURE__ */ __name(() => {
@@ -2379,7 +2180,7 @@ function createGoalRuntime(options) {
2379
2180
  ...snapshot.goal,
2380
2181
  activeTimeMs: elapsedActiveTime(snapshot.goal, now),
2381
2182
  updatedAt: now,
2382
- lastReason: outcome.result.reason
2183
+ lastReason: attempt.proposal.blockerKind === "infeasible" ? `${outcome.result.reason} ${GOAL_INFEASIBLE_NEXT_STEP}` : outcome.result.reason
2383
2184
  };
2384
2185
  const acceptedSnapshot = {
2385
2186
  v: GOAL_STATE_VERSION,
@@ -2412,36 +2213,24 @@ function createGoalRuntime(options) {
2412
2213
  continuationQueued = false;
2413
2214
  nextVerifierFeedback = void 0;
2414
2215
  currentTurnFeedback = void 0;
2216
+ if (attempt.proposal.status === "complete") {
2217
+ announcedObjective = void 0;
2218
+ }
2415
2219
  snapshot = structuredClone(terminalSnapshot);
2416
2220
  broadcast(attempt.proposal.status);
2417
2221
  return void 0;
2418
2222
  }
2419
2223
  if (outcome.kind === "usage_limited") {
2420
- const limitedSnapshot = {
2421
- v: GOAL_STATE_VERSION,
2422
- goal: {
2423
- ...snapshot.goal,
2424
- status: "usage_limited",
2425
- activeTimeMs: elapsedActiveTime(snapshot.goal, now),
2426
- updatedAt: now,
2427
- lastReason: outcome.reason,
2428
- ...outcome.limitKind === void 0 ? {} : { limitKind: outcome.limitKind }
2429
- },
2430
- activity: "idle"
2431
- };
2432
- await options.journal.recordGoalState(randomUUID(), {
2433
- v: GOAL_STATE_VERSION,
2434
- cause: "usage_limited",
2435
- snapshot: limitedSnapshot
2436
- });
2224
+ const limitedSnapshot = await journalUsageLimitedSettle(
2225
+ snapshot.goal,
2226
+ outcome.reason,
2227
+ outcome.limitKind
2228
+ );
2437
2229
  if (!isCurrentVerificationAttempt(attempt) || !snapshot.goal) return;
2438
2230
  verificationAttempt = void 0;
2439
2231
  pendingProposal = void 0;
2440
- continuationQueued = false;
2441
2232
  nextVerifierFeedback = void 0;
2442
- currentTurnFeedback = void 0;
2443
- snapshot = structuredClone(limitedSnapshot);
2444
- broadcast("usage_limited");
2233
+ commitUsageLimitedSettle(limitedSnapshot);
2445
2234
  return void 0;
2446
2235
  }
2447
2236
  const rejectedCheckpoint = isRepeatedBlockerProposal(attempt.proposal) ? void 0 : createCheckpointAttempt(attempt.permit, snapshot.goal);
@@ -2549,15 +2338,23 @@ function createGoalRuntime(options) {
2549
2338
  await settleDanglingAttempt(checkpoint.permit);
2550
2339
  }
2551
2340
  }, "runVerification");
2552
- const finishCheckpointCheck = /* @__PURE__ */ __name(async (attempt) => {
2341
+ const finishCheckpointCheck = /* @__PURE__ */ __name(async (attempt, outcome = "inconclusive") => {
2553
2342
  await enqueue(async () => {
2554
2343
  if (!isCurrentCheckpointAttempt(attempt) || !snapshot.goal) return;
2344
+ const checkpointStalls = outcome === "room" ? 0 : outcome === "stalled" ? (snapshot.goal.checkpointStalls ?? 0) + 1 : snapshot.goal.checkpointStalls ?? 0;
2345
+ if (await settleIfCheckpointStalled(
2346
+ attempt,
2347
+ snapshot.goal,
2348
+ checkpointStalls
2349
+ )) {
2350
+ return;
2351
+ }
2555
2352
  const persistedCause = nextVerifierFeedback === void 0 ? "checkpoint" : "verifier_reject";
2556
2353
  const now = Date.now();
2557
2354
  const checkedSnapshot = {
2558
2355
  v: GOAL_STATE_VERSION,
2559
2356
  goal: {
2560
- ...snapshot.goal,
2357
+ ...withCheckpointStalls(snapshot.goal, checkpointStalls),
2561
2358
  activeTimeMs: elapsedActiveTime(snapshot.goal, now),
2562
2359
  updatedAt: now
2563
2360
  },
@@ -2579,45 +2376,50 @@ function createGoalRuntime(options) {
2579
2376
  }
2580
2377
  });
2581
2378
  }, "finishCheckpointCheck");
2379
+ const settleCheckpointFailure = /* @__PURE__ */ __name(async (attempt, goal, reason, limitKind) => {
2380
+ const limitedSnapshot = await journalUsageLimitedSettle(
2381
+ goal,
2382
+ reason,
2383
+ limitKind
2384
+ );
2385
+ if (!isCurrentCheckpointAttempt(attempt) || !snapshot.goal) return;
2386
+ checkpointAttempt = void 0;
2387
+ commitUsageLimitedSettle(limitedSnapshot);
2388
+ }, "settleCheckpointFailure");
2389
+ const settleIfCheckpointStalled = /* @__PURE__ */ __name(async (attempt, goal, checkpointStalls) => {
2390
+ if (checkpointStalls < GOAL_CHECKPOINT_STALL_LIMIT) return false;
2391
+ await settleCheckpointFailure(
2392
+ attempt,
2393
+ withCheckpointStalls(goal, checkpointStalls),
2394
+ GOAL_CHECKPOINT_STALLED_REASON,
2395
+ "evidence_catalog"
2396
+ );
2397
+ return true;
2398
+ }, "settleIfCheckpointStalled");
2582
2399
  const recordCheckpointFailure = /* @__PURE__ */ __name(async (attempt, reason, limitKind) => {
2583
2400
  await enqueue(async () => {
2584
2401
  if (!isCurrentCheckpointAttempt(attempt) || !snapshot.goal) return;
2585
- const now = Date.now();
2586
- const limitedSnapshot = {
2587
- v: GOAL_STATE_VERSION,
2588
- goal: {
2589
- ...snapshot.goal,
2590
- status: "usage_limited",
2591
- activeTimeMs: elapsedActiveTime(snapshot.goal, now),
2592
- updatedAt: now,
2593
- lastReason: reason,
2594
- ...limitKind === void 0 ? {} : { limitKind }
2595
- },
2596
- activity: "idle"
2597
- };
2598
- await options.journal.recordGoalState(randomUUID(), {
2599
- v: GOAL_STATE_VERSION,
2600
- cause: "usage_limited",
2601
- snapshot: limitedSnapshot
2602
- });
2603
- if (!isCurrentCheckpointAttempt(attempt) || !snapshot.goal) return;
2604
- checkpointAttempt = void 0;
2605
- continuationQueued = false;
2606
- currentTurnFeedback = void 0;
2607
- snapshot = structuredClone(limitedSnapshot);
2608
- broadcast("usage_limited");
2402
+ await settleCheckpointFailure(attempt, snapshot.goal, reason, limitKind);
2609
2403
  });
2610
2404
  }, "recordCheckpointFailure");
2611
- const recordCheckpoint = /* @__PURE__ */ __name(async (attempt, checkpoint) => {
2405
+ const recordCheckpoint = /* @__PURE__ */ __name(async (attempt, checkpoint, stalled) => {
2612
2406
  if (!checkpoint) return;
2613
2407
  await enqueue(async () => {
2614
2408
  if (!isCurrentCheckpointAttempt(attempt) || !snapshot.goal) return;
2409
+ const checkpointStalls = stalled ? (snapshot.goal.checkpointStalls ?? 0) + 1 : 0;
2410
+ if (await settleIfCheckpointStalled(
2411
+ attempt,
2412
+ snapshot.goal,
2413
+ checkpointStalls
2414
+ )) {
2415
+ return;
2416
+ }
2615
2417
  const now = Date.now();
2616
2418
  const persistedCause = nextVerifierFeedback === void 0 ? "checkpoint" : "verifier_reject";
2617
2419
  const checkpointSnapshot = {
2618
2420
  v: GOAL_STATE_VERSION,
2619
2421
  goal: {
2620
- ...snapshot.goal,
2422
+ ...withCheckpointStalls(snapshot.goal, checkpointStalls),
2621
2423
  evidenceCursor: { recordId: attempt.recordUuid },
2622
2424
  evidenceCheckpoint: checkpoint,
2623
2425
  activeTimeMs: elapsedActiveTime(snapshot.goal, now),
@@ -2664,7 +2466,7 @@ function createGoalRuntime(options) {
2664
2466
  permit: attempt.permit
2665
2467
  });
2666
2468
  }
2667
- if (window.truncated) {
2469
+ if (window.truncated && !window.shouldCheckpoint) {
2668
2470
  await recordCheckpointFailure(
2669
2471
  attempt,
2670
2472
  GOAL_EVIDENCE_CATALOG_EXHAUSTED_REASON,
@@ -2673,7 +2475,7 @@ function createGoalRuntime(options) {
2673
2475
  return;
2674
2476
  }
2675
2477
  if (!window.shouldCheckpoint) {
2676
- await finishCheckpointCheck(attempt);
2478
+ await finishCheckpointCheck(attempt, "room");
2677
2479
  return;
2678
2480
  }
2679
2481
  let checkpoint;
@@ -2708,10 +2510,18 @@ function createGoalRuntime(options) {
2708
2510
  );
2709
2511
  return;
2710
2512
  }
2513
+ if (error instanceof InvalidGoalCheckpointError && window.truncated) {
2514
+ await finishCheckpointCheck(attempt, "stalled");
2515
+ return;
2516
+ }
2711
2517
  await finishCheckpointCheck(attempt);
2712
2518
  return;
2713
2519
  }
2714
- await recordCheckpoint(attempt, checkpoint);
2520
+ await recordCheckpoint(
2521
+ attempt,
2522
+ checkpoint,
2523
+ isGoalCheckpointStalled(window, checkpoint)
2524
+ );
2715
2525
  } catch (error) {
2716
2526
  if (attempt.controller.signal.aborted) return;
2717
2527
  if (error instanceof EvidenceSourceUnavailableError && error.code === "current_turn_not_tail") {
@@ -2921,6 +2731,7 @@ function createGoalRuntime(options) {
2921
2731
  if (currentTurnFeedback !== void 0) {
2922
2732
  nextVerifierFeedback ??= currentTurnFeedback;
2923
2733
  }
2734
+ settleCurrentTurnAnnouncement(currentTurnDelivered);
2924
2735
  currentPermit = void 0;
2925
2736
  currentPermitHost = void 0;
2926
2737
  currentTurnKey = void 0;
@@ -2949,6 +2760,12 @@ function createGoalRuntime(options) {
2949
2760
  return released;
2950
2761
  });
2951
2762
  },
2763
+ markTurnDelivered(turnKey) {
2764
+ assertOperational();
2765
+ if (currentPermit && currentTurnKey === turnKey) {
2766
+ currentTurnDelivered = true;
2767
+ }
2768
+ },
2952
2769
  permitForTurn(turnKey) {
2953
2770
  assertOperational();
2954
2771
  return currentPermit && currentTurnKey === turnKey ? structuredClone(currentPermit) : void 0;
@@ -2967,10 +2784,15 @@ function createGoalRuntime(options) {
2967
2784
  if (!isCurrentPermit(permit) || !snapshot.goal) {
2968
2785
  throw new Error(STALE_GOAL_TURN_MESSAGE);
2969
2786
  }
2787
+ settleCurrentTurnAnnouncement(currentTurnDelivered);
2970
2788
  const recordUuid = randomUUID();
2789
+ const finishedWindDown = windDownTurnId === permit.turnId;
2971
2790
  const nextGoal = reduceGoalTurnFinished(snapshot.goal, {
2972
- now: Date.now()
2791
+ now: Date.now(),
2792
+ tokensUsed: takeTurnTokens(permit.turnId),
2793
+ ...finishedWindDown ? { windDownTurnId: permit.turnId } : {}
2973
2794
  });
2795
+ if (finishedWindDown) windDownTurnId = void 0;
2974
2796
  const persistedSnapshot = {
2975
2797
  v: GOAL_STATE_VERSION,
2976
2798
  goal: nextGoal,
@@ -3141,7 +2963,8 @@ ${proposal.reason}`;
3141
2963
  request,
3142
2964
  now: Date.now(),
3143
2965
  nextGoalId: randomUUID(),
3144
- cursor: request.action === "create" || request.action === "replace" || request.action === "edit" ? { recordId: recordUuid } : options.journal.getTranscriptCursor()
2966
+ cursor: request.action === "create" || request.action === "replace" || request.action === "edit" ? { recordId: recordUuid } : options.journal.getTranscriptCursor(),
2967
+ tokenBudgetGrant
3145
2968
  });
3146
2969
  const nextSnapshot = {
3147
2970
  v: GOAL_STATE_VERSION,
@@ -3174,6 +2997,7 @@ ${proposal.reason}`;
3174
2997
  invalidateAttempts(`Goal ${request.action}`);
3175
2998
  }
3176
2999
  if (invalidatesPermit) {
3000
+ settleCurrentTurnAnnouncement(currentTurnDelivered);
3177
3001
  currentPermit = void 0;
3178
3002
  currentPermitHost = void 0;
3179
3003
  currentTurnKey = void 0;
@@ -3184,6 +3008,7 @@ ${proposal.reason}`;
3184
3008
  nextVerifierFeedback = void 0;
3185
3009
  currentTurnFeedback = void 0;
3186
3010
  continuationQueued = false;
3011
+ if (request.action === "clear") announcedObjective = void 0;
3187
3012
  } else if (request.action === "resume") {
3188
3013
  blockedAudit = void 0;
3189
3014
  }
@@ -3218,6 +3043,8 @@ ${proposal.reason}`;
3218
3043
  blockedAudit = void 0;
3219
3044
  nextVerifierFeedback = void 0;
3220
3045
  currentTurnFeedback = void 0;
3046
+ currentTurnAnnouncement = void 0;
3047
+ currentTurnDelivered = false;
3221
3048
  preemptHost("Goal runtime disposed", invalidatedHost);
3222
3049
  host = void 0;
3223
3050
  listeners.clear();
@@ -3237,21 +3064,12 @@ export {
3237
3064
  emptyGoalSnapshot,
3238
3065
  goalRequiresExactPermit,
3239
3066
  validateGoalProposalReason,
3240
- wrapUserPromptSubmitContext,
3241
- isUserPromptSubmitContextPartText,
3242
- projectUserTranscriptForDisplay,
3243
- isTranscriptConversationRecord,
3244
- isTranscriptArtifactRecord,
3245
- validateTranscriptRecord,
3246
- selectTranscriptLeaf,
3247
- walkTranscriptUuidChain,
3248
- aggregateTranscriptRecordFragments,
3249
- prepareTranscriptRecords,
3250
3067
  GOAL_EVIDENCE_REFERENCE_LIMIT,
3251
3068
  EvidenceSourceUnavailableError,
3252
3069
  InvalidGoalEvidenceReferenceError,
3253
3070
  GoalEvidenceRecordIndexAccumulator,
3254
3071
  GoalEvidenceCheckpointAccumulator,
3072
+ capPreviewBytes,
3255
3073
  createGoalCheckpointVerifier,
3256
3074
  GoalConflictError,
3257
3075
  GoalInvalidTransitionError,
@@ -3274,8 +3092,3 @@ export {
3274
3092
  * Copyright 2026 Qwen Team
3275
3093
  * SPDX-License-Identifier: Apache-2.0
3276
3094
  */
3277
- /**
3278
- * @license
3279
- * Copyright 2025 Qwen Team
3280
- * SPDX-License-Identifier: Apache-2.0
3281
- */