@qwen-code/qwen-code 0.22.1 → 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 (418) hide show
  1. package/bundled/goal-draft/SKILL.md +109 -0
  2. package/bundled/qc-helper/docs/configuration/settings.md +13 -13
  3. package/bundled/qc-helper/docs/features/_meta.ts +1 -0
  4. package/bundled/qc-helper/docs/features/channels/overview.md +34 -3
  5. package/bundled/qc-helper/docs/features/code-review.md +3 -3
  6. package/bundled/qc-helper/docs/features/commands.md +2 -1
  7. package/bundled/qc-helper/docs/features/goals.md +58 -0
  8. package/bundled/qc-helper/docs/features/headless.md +13 -11
  9. package/bundled/qc-helper/docs/features/status-line.md +3 -3
  10. package/bundled/review/SKILL.md +70 -22
  11. package/bundled/review/references/persistence.md +7 -3
  12. package/bundled/review/references/posting.md +2 -0
  13. package/chunks/MaxSizedBox-LMWXCLDV.js +110 -0
  14. package/chunks/{StandaloneSessionPicker-XF2TVJFK.js → StandaloneSessionPicker-W3F7U3JL.js} +79 -81
  15. package/chunks/{acpAgent-GY53MJIW.js → acpAgent-EYZ6EEHD.js} +1132 -339
  16. package/chunks/{agent-7U6CC5KF.js → agent-RBLGBY65.js} +44 -46
  17. package/chunks/agent-headless-L5T4Y4OZ.js +85 -0
  18. package/chunks/{anthropicContentGenerator-U76GTVB6.js → anthropicContentGenerator-GMHML35Q.js} +10 -11
  19. package/chunks/{artifact-tool-XDJCZZCF.js → artifact-tool-XSMPHZBT.js} +11 -3
  20. package/chunks/{askUserQuestion-ZXXERLEV.js → askUserQuestion-4SWJY65V.js} +2 -2
  21. package/chunks/bridge-5LR2F2ND.js +119 -0
  22. package/chunks/{channel-management-service-HXXS3HOZ.js → channel-management-service-KHR3N6CH.js} +6 -6
  23. package/chunks/channel-settings-store-4FOAZW72.js +120 -0
  24. package/chunks/{channel-worker-group-EVDC2P4K.js → channel-worker-group-6NA6BBZV.js} +8 -7
  25. package/chunks/{channel-worker-manager-IJJZHGEI.js → channel-worker-manager-NEZ2J6RK.js} +10 -8
  26. package/chunks/{channel-worker-supervisor-YSKB5GVB.js → channel-worker-supervisor-FKU7DIHJ.js} +6 -5
  27. package/chunks/{chunk-7QGEJI7M.js → chunk-23RFD54N.js} +1 -1
  28. package/chunks/{chunk-LJP2BBMK.js → chunk-2SXSLSQE.js} +4 -4
  29. package/chunks/chunk-2TNL5KPM.js +49 -0
  30. package/chunks/chunk-335CJSNF.js +2320 -0
  31. package/chunks/chunk-36LGBEM6.js +130 -0
  32. package/chunks/{chunk-ZWKGZB2K.js → chunk-3JXM2CVW.js} +3 -3
  33. package/chunks/{chunk-ICWGPK23.js → chunk-3K6TUZHS.js} +7 -7
  34. package/chunks/{chunk-43C2II2G.js → chunk-3OOXT6CR.js} +5 -5
  35. package/chunks/{chunk-ILPXSKGQ.js → chunk-3WK3QDNV.js} +2 -2
  36. package/chunks/{chunk-2YDYDDE2.js → chunk-3XOKEVII.js} +3 -3
  37. package/chunks/chunk-3Y34Q3JV.js +1584 -0
  38. package/chunks/{chunk-ZLTEQYNC.js → chunk-42IDLQWS.js} +26 -20
  39. package/chunks/{chunk-5MK32KJV.js → chunk-454XFGH4.js} +3 -3
  40. package/chunks/chunk-4CMJKUND.js +95 -0
  41. package/chunks/{chunk-77TOMRBG.js → chunk-4K7KNVWH.js} +3 -3
  42. package/chunks/{chunk-V3GINY6K.js → chunk-4QHPPXK2.js} +16 -8
  43. package/chunks/{chunk-UCSV2IZW.js → chunk-62GQFYID.js} +3 -3
  44. package/chunks/{chunk-SLEWBQWM.js → chunk-6DIGWMGT.js} +2 -2
  45. package/chunks/{chunk-I6YW3T3W.js → chunk-6JCGO55P.js} +723 -3399
  46. package/chunks/{chunk-PVBT5QPD.js → chunk-6PJOTWAN.js} +1 -1
  47. package/chunks/{chunk-5Y2JCJAH.js → chunk-6W2IK5KC.js} +956 -17
  48. package/chunks/{chunk-A7X32SCT.js → chunk-6ZZBRRKQ.js} +5 -5
  49. package/chunks/{chunk-ELY4QVIB.js → chunk-7EQQR46F.js} +1 -1
  50. package/chunks/{chunk-4DCP3362.js → chunk-7GWQW5ID.js} +4 -4
  51. package/chunks/chunk-7J6OTNGO.js +424 -0
  52. package/chunks/{chunk-CITGRGCM.js → chunk-7TUBJBBJ.js} +4 -1
  53. package/chunks/{chunk-L436XFLJ.js → chunk-7VD6IPQM.js} +1 -1
  54. package/chunks/{chunk-E4I5MVBR.js → chunk-ABS25QER.js} +1 -1
  55. package/chunks/{chunk-2ZV3CZKI.js → chunk-AJGR6E6Z.js} +49 -32
  56. package/chunks/{chunk-HJOWQUE2.js → chunk-AU3MMVJF.js} +31 -14
  57. package/chunks/{chunk-I32QCIK7.js → chunk-AXC26UCQ.js} +1 -1
  58. package/chunks/{chunk-7AS7QX72.js → chunk-AY3BNYEQ.js} +1 -1
  59. package/chunks/{chunk-FVDQ5E67.js → chunk-B466ZSHZ.js} +3 -3
  60. package/chunks/{chunk-OI2DR6QB.js → chunk-B5OUL5EL.js} +2 -2
  61. package/chunks/{chunk-6US7BF3G.js → chunk-B5PHIJGI.js} +183 -5
  62. package/chunks/{chunk-5T4LWWNX.js → chunk-B7CDU2SL.js} +2 -2
  63. package/chunks/{chunk-4TPAG3O7.js → chunk-BFPESSTR.js} +1 -1
  64. package/chunks/{chunk-WBT3STGU.js → chunk-BKWNKLZB.js} +20 -20
  65. package/chunks/{chunk-73WFGVIZ.js → chunk-BOWFGCEU.js} +3 -3
  66. package/chunks/{chunk-EMGAVCBZ.js → chunk-BPAKYXQ3.js} +2 -2
  67. package/chunks/{chunk-IPQA4SR5.js → chunk-BWORX6FA.js} +1 -1
  68. package/chunks/{chunk-BKDAF7ES.js → chunk-BXDAPVQU.js} +2 -2
  69. package/chunks/{chunk-ZEADBZLO.js → chunk-C2X7KY45.js} +3 -3
  70. package/chunks/{chunk-T2HMXHYA.js → chunk-C3KURPP7.js} +6 -6
  71. package/chunks/{chunk-JUIJ3FXC.js → chunk-CAJTKR6W.js} +5 -5
  72. package/chunks/{chunk-2FN2HNTI.js → chunk-CFJY4DGX.js} +2 -2
  73. package/chunks/{chunk-DP7LABIB.js → chunk-CMHFCLBU.js} +1 -1
  74. package/chunks/{chunk-LRKMQPMD.js → chunk-CQH5KTKC.js} +1 -1
  75. package/chunks/{chunk-J7MLXFC5.js → chunk-CRKKHXTI.js} +185 -174
  76. package/chunks/{chunk-XNXWEGKB.js → chunk-CYAUBK46.js} +3 -3
  77. package/chunks/{chunk-JECO75XD.js → chunk-D5LUXLUH.js} +2 -2
  78. package/chunks/{chunk-SRGENTPF.js → chunk-DFDWJE6Z.js} +48 -31
  79. package/chunks/chunk-DJBQCO2E.js +842 -0
  80. package/chunks/{chunk-2CRNTW2B.js → chunk-DP4MWIM3.js} +2 -2
  81. package/chunks/{chunk-EB4VDXNI.js → chunk-DYXFD5RO.js} +182 -3
  82. package/chunks/{chunk-ODXCSIH5.js → chunk-E3XVSVKK.js} +26 -4
  83. package/chunks/{chunk-ZKAZP2ZG.js → chunk-EB6QRGHM.js} +3 -3
  84. package/chunks/{chunk-GNRVKN76.js → chunk-EKNBU2X7.js} +4 -4
  85. package/chunks/{chunk-3UZCLCXR.js → chunk-EKSCLBBF.js} +3 -3
  86. package/chunks/{chunk-624NHDGB.js → chunk-ERFDKH32.js} +11 -0
  87. package/chunks/chunk-EW5VVLJT.js +3525 -0
  88. package/chunks/{chunk-XYX474JQ.js → chunk-EWIQ3NAE.js} +2522 -2030
  89. package/chunks/{chunk-O5YGAEQS.js → chunk-FALBWZF4.js} +6 -6
  90. package/chunks/{chunk-GZJUCMH4.js → chunk-FEHMA4RO.js} +542 -654
  91. package/chunks/{chunk-2YEZNBSD.js → chunk-FMFBLTLY.js} +320 -86
  92. package/chunks/{chunk-MZS7GEC7.js → chunk-FTF2YIZ5.js} +1 -1
  93. package/chunks/{chunk-ZJG323IA.js → chunk-G6FECKTJ.js} +7 -5
  94. package/chunks/{chunk-6KS24S3X.js → chunk-GGNE3JAW.js} +1 -1
  95. package/chunks/{chunk-BQBUZDDH.js → chunk-H33EQVMG.js} +4 -4
  96. package/chunks/chunk-H72BQNM3.js +645 -0
  97. package/chunks/{chunk-5ZYZPDDF.js → chunk-HGIMWQVT.js} +30 -25
  98. package/chunks/{chunk-DCSAVGDJ.js → chunk-HOCJDUFY.js} +2 -2
  99. package/chunks/{chunk-MDZO5V2O.js → chunk-HPXV655A.js} +9 -7
  100. package/chunks/{chunk-7JPW6IYH.js → chunk-HVC3PNVC.js} +1 -1
  101. package/chunks/{chunk-2MHGD7EE.js → chunk-HYDJDQGJ.js} +1 -1
  102. package/chunks/{chunk-BDHLBR46.js → chunk-IB7FQJRY.js} +34 -11
  103. package/chunks/{chunk-E55H6BZ7.js → chunk-ICURCKIU.js} +1335 -119
  104. package/chunks/{chunk-PAJGKZAA.js → chunk-ISKH4QX3.js} +14 -12
  105. package/chunks/{chunk-3B5DCAQU.js → chunk-J6S24ZJE.js} +34 -34
  106. package/chunks/{chunk-AYVIGUUK.js → chunk-JB4JIVTJ.js} +1 -1
  107. package/chunks/{chunk-C4WBKZJT.js → chunk-JN4IWWMN.js} +4 -4
  108. package/chunks/{chunk-6HTMIKXZ.js → chunk-JUUBLSZU.js} +4 -4
  109. package/chunks/{chunk-T6OODF2U.js → chunk-JWALNCLT.js} +1 -1
  110. package/chunks/{chunk-SKNVVYIJ.js → chunk-K5KXUXWC.js} +3 -3
  111. package/chunks/{chunk-IRIX323G.js → chunk-KTJFDCX4.js} +2 -2
  112. package/chunks/{chunk-FK4H3V6S.js → chunk-LEFCFTEX.js} +6 -6
  113. package/chunks/{chunk-OQ6LTSX3.js → chunk-LEGTMYAE.js} +1 -1
  114. package/chunks/{chunk-NY3IJYAV.js → chunk-LLZA2IK3.js} +15 -9
  115. package/chunks/{chunk-5CI4AXDD.js → chunk-LNETQKBE.js} +4 -4
  116. package/chunks/{chunk-TOF4UZHH.js → chunk-LUEHOUHM.js} +3 -3
  117. package/chunks/{chunk-62PXFOK4.js → chunk-LVPZO674.js} +4 -4
  118. package/chunks/{chunk-EEQYTWGU.js → chunk-M4ORUPYI.js} +5 -5
  119. package/chunks/{chunk-GNMJNDZE.js → chunk-M6FOJXW3.js} +1 -1
  120. package/chunks/{chunk-MYLXL7F6.js → chunk-MAYHGRP4.js} +9 -9
  121. package/chunks/{chunk-K3LPAED5.js → chunk-MQM5PJML.js} +24 -4
  122. package/chunks/{chunk-SM7ZVKTF.js → chunk-MTJN7FOT.js} +7 -7
  123. package/chunks/{chunk-BGXZBI5B.js → chunk-N4X7G4J2.js} +2 -1
  124. package/chunks/{chunk-27ONXAFY.js → chunk-NIFYWDYN.js} +1 -1
  125. package/chunks/{chunk-IJVDHPKD.js → chunk-NU7RKEZR.js} +2 -2
  126. package/chunks/{chunk-R2ZJH3FV.js → chunk-NXMBRVMQ.js} +3 -3
  127. package/chunks/{chunk-JLGFGPZJ.js → chunk-OI4NY7RA.js} +2 -2
  128. package/chunks/{chunk-RRKNX553.js → chunk-PDQGMSZK.js} +1 -1
  129. package/chunks/{chunk-GTUKW3I6.js → chunk-PPKZ7JOE.js} +1 -1
  130. package/chunks/{chunk-SAH4BD2J.js → chunk-PQEISIKS.js} +67 -0
  131. package/chunks/{chunk-MW5AHWOZ.js → chunk-PWIGAMA4.js} +93 -14
  132. package/chunks/{chunk-WEGXPP5E.js → chunk-QFCDF5PL.js} +1 -1
  133. package/chunks/{chunk-EAV3TENS.js → chunk-QPTRRPZU.js} +44 -7
  134. package/chunks/{chunk-SQPOJ4ZI.js → chunk-RFI4YGMR.js} +21 -266
  135. package/chunks/{chunk-JVPFTDBK.js → chunk-RFIDDFAL.js} +1 -1
  136. package/chunks/chunk-RKFGE7JH.js +93 -0
  137. package/chunks/chunk-RNVFRIOO.js +275 -0
  138. package/chunks/{chunk-CPPYZHBN.js → chunk-RU7BK6B3.js} +1 -1
  139. package/chunks/{chunk-OT26ITEY.js → chunk-RVXDXY6I.js} +3 -3
  140. package/chunks/{chunk-W2WRNJKX.js → chunk-RWZB422L.js} +5 -5
  141. package/chunks/{chunk-6YAR6ZU3.js → chunk-RYNZQGXN.js} +19 -2
  142. package/chunks/{chunk-EKP3M4RF.js → chunk-SJ5ERAW3.js} +1 -1
  143. package/chunks/{chunk-DEYPMJPD.js → chunk-SMPR7SPO.js} +1 -1
  144. package/chunks/{chunk-3BV7TZNQ.js → chunk-SRZZY4IY.js} +3 -3
  145. package/chunks/{chunk-7CWEZQ6T.js → chunk-STUJ7IMZ.js} +0 -77
  146. package/chunks/{chunk-TKO4TLT6.js → chunk-SUX7HDNA.js} +3 -3
  147. package/chunks/{chunk-76WGY6LW.js → chunk-SVNO44PF.js} +3 -3
  148. package/chunks/{chunk-UX3IFLJM.js → chunk-SZLBBZH4.js} +150 -23
  149. package/chunks/{chunk-K63NK3KL.js → chunk-T2NKRHZZ.js} +13 -13
  150. package/chunks/{chunk-4K7NQDCG.js → chunk-T4EFG2P5.js} +18 -9
  151. package/chunks/{chunk-2NCVUT3C.js → chunk-TLHUNMO7.js} +4 -4
  152. package/chunks/{chunk-EC5BONC3.js → chunk-TPI7O7HR.js} +1 -1
  153. package/chunks/{chunk-ZXDM7DYV.js → chunk-TQHGJYR3.js} +2029 -616
  154. package/chunks/{chunk-T2CRBIDJ.js → chunk-TTX2JUE6.js} +1 -1
  155. package/chunks/{chunk-OX44MOAN.js → chunk-TW3E6YNO.js} +3 -3
  156. package/chunks/chunk-U54AYGEC.js +337 -0
  157. package/chunks/{chunk-2NNTE2ED.js → chunk-UHQFIS7N.js} +15 -0
  158. package/chunks/{chunk-KOJ6MHD5.js → chunk-UTLCH2FK.js} +1 -1
  159. package/chunks/{chunk-KCOXDRQL.js → chunk-UY3PBNY3.js} +17 -29
  160. package/chunks/{chunk-7DPKPBOQ.js → chunk-V2NDP3I4.js} +2 -2
  161. package/chunks/{chunk-47SIHHPL.js → chunk-V2QDDC5J.js} +19 -9
  162. package/chunks/{chunk-BVE5EMIG.js → chunk-V5J4J5TP.js} +2 -2
  163. package/chunks/{chunk-X2UOOG5V.js → chunk-VQUGEVGR.js} +1 -1
  164. package/chunks/{chunk-XJS54K4A.js → chunk-VTHREBQM.js} +2 -2
  165. package/chunks/{chunk-VMDURMFY.js → chunk-W6DUQ5GA.js} +11307 -10424
  166. package/chunks/{chunk-BX2BZPFJ.js → chunk-WALC5VJH.js} +4 -4
  167. package/chunks/{chunk-FPH6TXD3.js → chunk-WAOIHTJS.js} +1 -1
  168. package/chunks/{chunk-LI2HEMKO.js → chunk-WBHKK3CU.js} +4 -4
  169. package/chunks/{chunk-O3BUXIPM.js → chunk-WXEA74YB.js} +3 -3
  170. package/chunks/{chunk-NER3H7PI.js → chunk-X3ZRTCJD.js} +1 -1
  171. package/chunks/{chunk-YRLW2MSX.js → chunk-XBVNNDPK.js} +11 -4
  172. package/chunks/{chunk-VL4YX3FH.js → chunk-XF63PKEN.js} +1 -1
  173. package/chunks/{chunk-FN5C6C7G.js → chunk-XLLQJRAH.js} +190 -478
  174. package/chunks/{chunk-3FSBMAYD.js → chunk-XQFT3QUF.js} +1 -1
  175. package/chunks/{chunk-FJWICLG7.js → chunk-Y3QL45LS.js} +1 -1
  176. package/chunks/{chunk-IKN3IUJP.js → chunk-Y4TPOUEV.js} +17 -9
  177. package/chunks/{chunk-NVK4HJYQ.js → chunk-YRZX2PHA.js} +1 -1
  178. package/chunks/{chunk-2SERYG4T.js → chunk-YTDVNSUQ.js} +1 -1
  179. package/chunks/{chunk-KWFP3WV6.js → chunk-YWQ237GX.js} +4 -193
  180. package/chunks/{chunk-6E4WHQJV.js → chunk-ZTP35P4B.js} +1 -1
  181. package/chunks/{chunk-E6FGMDFQ.js → chunk-ZU4UDIWX.js} +19 -1
  182. package/chunks/config-utils-JVGAP34H.js +113 -0
  183. package/chunks/contextCommand-XDB7OSO7.js +106 -0
  184. package/chunks/{core-runtime-PKNQ63VL.js → core-runtime-XHYA2RH7.js} +59 -61
  185. package/chunks/{create-sub-session-RVHSWVAP.js → create-sub-session-23ITIELI.js} +3 -3
  186. package/chunks/{create-sub-session-PLGPY6TV.js → create-sub-session-MHYCFNCM.js} +163 -84
  187. package/chunks/{cron-create-IJGVR5R2.js → cron-create-KJ4IY6PP.js} +57 -10
  188. package/chunks/{cron-delete-4N5BI6GL.js → cron-delete-MBLQCAYY.js} +4 -4
  189. package/chunks/{cron-list-2CATIPUX.js → cron-list-DWH2PQ47.js} +4 -4
  190. package/chunks/{daemon-NAYK4XXU.js → daemon-K5XS42ID.js} +516 -3
  191. package/chunks/{daemon-git-worktree-guard-LDBJXH2U.js → daemon-git-worktree-guard-V3P5XLHB.js} +56 -58
  192. package/chunks/daemon-status-provider-KKU7ZTLM.js +117 -0
  193. package/chunks/daemon-trust-policy-TZGK34DW.js +112 -0
  194. package/chunks/{daemon-trust-policy-monitor-IGEJPHQ4.js → daemon-trust-policy-monitor-F23DD2M4.js} +62 -64
  195. package/chunks/deferred-core-runtime-LKLGBCGZ.js +114 -0
  196. package/chunks/{display-image-DR55LL6M.js → display-image-BE7I6ZB6.js} +5 -5
  197. package/chunks/{dist-DJBNNPLN.js → dist-4WXLCBDR.js} +1 -1
  198. package/chunks/{dist-TJUDJTCB.js → dist-5VXFRTWU.js} +280 -48
  199. package/chunks/{dist-6H6RZ5H6.js → dist-6BPYWHVD.js} +89 -65
  200. package/chunks/{dist-ZBVOXSKF.js → dist-GFN5DCBX.js} +74 -65
  201. package/chunks/{dist-SATKXKUR.js → dist-HZNT6GQS.js} +1 -1
  202. package/chunks/{dist-FVJZSIO4.js → dist-LVZCXVPF.js} +72 -20
  203. package/chunks/{dist-7CKN54NL.js → dist-N6W6E753.js} +71 -64
  204. package/chunks/{dist-4Q7NTUNB.js → dist-QDLFKWOL.js} +2 -2
  205. package/chunks/{dist-UQUFZDIY.js → dist-SWQMYP2Q.js} +18 -16
  206. package/chunks/earlyInputCapture-NERYFYTR.js +107 -0
  207. package/chunks/{edit-KSPVUEAS.js → edit-ACCATIXB.js} +45 -47
  208. package/chunks/{en-6MDBWMTG.js → en-YLXBXM4Z.js} +2 -1
  209. package/chunks/{enter-worktree-UOZ6ZTP7.js → enter-worktree-35QCAAFP.js} +7 -7
  210. package/chunks/{enterPlanMode-DZTABSKN.js → enterPlanMode-NEN6EPVM.js} +44 -46
  211. package/chunks/{environment-JXOSW25V.js → environment-CKWHBC5T.js} +58 -60
  212. package/chunks/errors-XTZPNQ77.js +113 -0
  213. package/chunks/{exit-worktree-G2QATUCV.js → exit-worktree-XQD6D543.js} +7 -7
  214. package/chunks/exitPlanMode-CY344X5J.js +83 -0
  215. package/chunks/{fast-path-EBS7NAVL.js → fast-path-YSOX4PAM.js} +5 -5
  216. package/chunks/{gemini-JELEKOVS.js → gemini-VQY2YCPH.js} +110 -108
  217. package/chunks/{geminiContentGenerator-I2CKP7XI.js → geminiContentGenerator-PAPXNIGU.js} +8 -8
  218. package/chunks/{glob-TDVEVPQZ.js → glob-GVCUSBBF.js} +44 -46
  219. package/chunks/{goal-tools-CNVXMSZD.js → goal-tools-5STK6OXW.js} +10 -8
  220. package/chunks/{grep-3NLSS32D.js → grep-5GPICQBU.js} +6 -6
  221. package/chunks/handleAutoUpdate-ZJPJN42W.js +109 -0
  222. package/chunks/i18n-BZYKOST7.js +124 -0
  223. package/chunks/{image-gen-63NN2H5N.js → image-gen-J6FDGUZP.js} +8 -10
  224. package/chunks/initializer-GO2C5HE3.js +113 -0
  225. package/chunks/installationInfo-WM2GXQZ6.js +107 -0
  226. package/chunks/{keychain-token-storage-3MGFRYGM.js → keychain-token-storage-37XPR34V.js} +2 -2
  227. package/chunks/list-ERDJB7PQ.js +116 -0
  228. package/chunks/{list-agents-EXRSHIDJ.js → list-agents-DI3YFTDT.js} +2 -2
  229. package/chunks/loadedSettingsAdapter-7JOCVOKV.js +110 -0
  230. package/chunks/{loggingContentGenerator-CZWUAHAI.js → loggingContentGenerator-3ONLU3BS.js} +321 -30
  231. package/chunks/{loop-wakeup-XBPB2BRO.js → loop-wakeup-XJFONSQ7.js} +5 -5
  232. package/chunks/{ls-WFONAND2.js → ls-3VAT2J7A.js} +4 -4
  233. package/chunks/{lsp-DUKPDUXN.js → lsp-5W7IRUBH.js} +2 -2
  234. package/chunks/{managed-npm-update-54W23SP5.js → managed-npm-update-TLRCC2GE.js} +57 -59
  235. package/chunks/mcp-2LH3QXR2.js +110 -0
  236. package/chunks/{monitor-A4J5QRGJ.js → monitor-P7LDAL4W.js} +44 -46
  237. package/chunks/nonInteractiveCli-E5T7PZ27.js +184 -0
  238. package/chunks/{notebook-edit-4ANFZON5.js → notebook-edit-F7KSG4WQ.js} +45 -47
  239. package/chunks/{openaiContentGenerator-JCCJJQZC.js → openaiContentGenerator-2EXCZUGN.js} +26 -28
  240. package/chunks/pidfile-P25DWA5Q.js +111 -0
  241. package/chunks/process-registry-OAEG6WGC.js +662 -0
  242. package/chunks/{processUtils-JJAR56SO.js → processUtils-PVDKBL35.js} +2 -2
  243. package/chunks/prompt-terminal-ledger-AJ7T7OIV.js +105 -0
  244. package/chunks/{qwenContentGenerator-5JM44ZSA.js → qwenContentGenerator-TBBRLWIT.js} +49 -51
  245. package/chunks/{qwenOAuth2-JIYAWXTW.js → qwenOAuth2-OF5WRBQT.js} +7 -9
  246. package/chunks/{read-file-N3E5DY7N.js → read-file-6IIY4RLJ.js} +13 -13
  247. package/chunks/{read-mcp-resource-7A7NFSFL.js → read-mcp-resource-XD257PGJ.js} +2 -2
  248. package/chunks/{record-artifact-CPJ4IJSD.js → record-artifact-VW23GS4F.js} +4 -4
  249. package/chunks/{report-findings-VFM5DENC.js → report-findings-XA3FJG3N.js} +5 -5
  250. package/chunks/{request-shutdown-AXVOFN5C.js → request-shutdown-BCLA3JV2.js} +7 -7
  251. package/chunks/resumeHistoryUtils-44IETXDY.js +118 -0
  252. package/chunks/ripGrep-E7ESZ7SS.js +39 -0
  253. package/chunks/{run-qwen-serve-IWGPZADI.js → run-qwen-serve-DXBCYW7V.js} +356 -331
  254. package/chunks/{runtime-I76HPFUE.js → runtime-RUSPD35D.js} +67 -69
  255. package/chunks/scheduled-tasks-DVRJZO6I.js +127 -0
  256. package/chunks/{scheduler-M6YL4K4I.js → scheduler-TDRB2NSY.js} +58 -60
  257. package/chunks/{sdk-exporters-http-XXSKBD2C.js → sdk-exporters-http-TTU2CHBU.js} +2 -2
  258. package/chunks/{sdk-impl-VPNBLV7I.js → sdk-impl-UUMVYMAL.js} +11 -5
  259. package/chunks/{send-message-A2GXDX3B.js → send-message-AJ4OCUBV.js} +25 -9
  260. package/chunks/serve-KITOM7OR.js +118 -0
  261. package/chunks/{server-TWXRRREO.js → server-THCOMUC2.js} +5476 -4771
  262. package/chunks/{session-IT5ZXU7A.js → session-XKR5MPXE.js} +105 -106
  263. package/chunks/session-pr-refresh-KRBH7KDA.js +278 -0
  264. package/chunks/{settings-IX5HOOCG.js → settings-YXZ4XBKK.js} +61 -63
  265. package/chunks/{shell-LZ55AAJB.js → shell-5FJ2DZ3W.js} +44 -46
  266. package/chunks/{skill-WSZ53D2R.js → skill-VMMJZ6CJ.js} +71 -26
  267. package/chunks/skill-settings-7SG4YA2W.js +118 -0
  268. package/chunks/spawnChannel-BPMIXRBI.js +112 -0
  269. package/chunks/standalone-update-QN5HFRIC.js +118 -0
  270. package/chunks/{startInteractiveUI-O6BI2OSA.js → startInteractiveUI-5A7RQFRP.js} +2902 -2289
  271. package/chunks/{syntheticOutput-5AJ444QT.js → syntheticOutput-ML43GEFN.js} +3 -3
  272. package/chunks/{task-create-CDJSOEQD.js → task-create-QN4LYRSE.js} +11 -11
  273. package/chunks/{task-list-BELMPA75.js → task-list-JPLGK45U.js} +5 -5
  274. package/chunks/{task-stop-U3S3KZG2.js → task-stop-CXEH5L2D.js} +2 -2
  275. package/chunks/{task-update-77VCFDDZ.js → task-update-IWEOJFV2.js} +11 -11
  276. package/chunks/{team-create-UF4TMQEH.js → team-create-HVGVUL2L.js} +44 -46
  277. package/chunks/{team-delete-YWFXX77L.js → team-delete-RZVVSGCY.js} +5 -5
  278. package/chunks/{team-plan-approval-U57NSR6C.js → team-plan-approval-S5A5FQWU.js} +44 -46
  279. package/chunks/terminal-image-renderer-SIVPPXDI.js +114 -0
  280. package/chunks/theme-manager-TA33UZZX.js +102 -0
  281. package/chunks/{todoWrite-435EO2CS.js → todoWrite-WDJNQEMW.js} +43 -25
  282. package/chunks/{tool-search-SV35UV72.js → tool-search-NX7IPDKP.js} +18 -18
  283. package/chunks/total-session-admission-PWXZBOVX.js +114 -0
  284. package/chunks/{trustedFolders-YKK67IP3.js → trustedFolders-V6Y4CU3F.js} +57 -59
  285. package/chunks/{update-relaunch-DX7LVA4P.js → update-relaunch-CGSX3R37.js} +5 -5
  286. package/chunks/updateCheck-T5O2WGIB.js +118 -0
  287. package/chunks/useAutoAcceptIndicator-ULBJJWPY.js +120 -0
  288. package/chunks/{validateNonInterActiveAuth-B26O4YJP.js → validateNonInterActiveAuth-E5S2JSRC.js} +101 -102
  289. package/chunks/{version-K5D7VJ4B.js → version-LS5JPU36.js} +1 -1
  290. package/chunks/{web-fetch-VFHZLLNZ.js → web-fetch-RLMFZTS3.js} +16 -18
  291. package/chunks/{web-search-AQE5A4J5.js → web-search-LMCIC4N5.js} +9 -11
  292. package/chunks/{workflow-XL6AEUZ7.js → workflow-JBXU3IGA.js} +128 -94
  293. package/chunks/workspace-providers-status-525ORQBH.js +114 -0
  294. package/chunks/{workspace-registration-store-I4U3V5LL.js → workspace-registration-store-7Y44R4LV.js} +1 -1
  295. package/chunks/workspace-registry-HS4RWUSQ.js +123 -0
  296. package/chunks/workspace-service-7PXDM6EB.js +129 -0
  297. package/chunks/workspace-skills-status-FMJGC2XI.js +113 -0
  298. package/chunks/{workspace-trust-reconciler-GJ466KCE.js → workspace-trust-reconciler-3YTWSQBY.js} +70 -70
  299. package/chunks/write-file-BVQRYQQO.js +88 -0
  300. package/chunks/{zh-TW-MV4FWFB6.js → zh-TW-RPTMRTHG.js} +2 -1
  301. package/chunks/{zh-X3WGU6SI.js → zh-UNY63FR3.js} +2 -1
  302. package/chunks/{zoom-image-NYJPC3NI.js → zoom-image-FGCELNS4.js} +13 -13
  303. package/cli.js +14 -14
  304. package/locales/en.js +2 -0
  305. package/locales/zh-TW.js +2 -0
  306. package/locales/zh.js +2 -0
  307. package/package.json +3 -3
  308. package/web-shell/assets/{abnfDiagram-VCTEODGH-yq7z7Anb.js → abnfDiagram-VCTEODGH-2XZDeWYO.js} +1 -1
  309. package/web-shell/assets/{arc-CbJO0xnT.js → arc-B6UgMh90.js} +1 -1
  310. package/web-shell/assets/{architectureDiagram-5GKGNRK7-CRh89421.js → architectureDiagram-5GKGNRK7-DZgNFeN1.js} +1 -1
  311. package/web-shell/assets/{blockDiagram-NRAW4CY4-C75KAhKv.js → blockDiagram-NRAW4CY4-DQ2wvBFN.js} +1 -1
  312. package/web-shell/assets/{c4Diagram-UCG6FXSJ-BzlMveFB.js → c4Diagram-UCG6FXSJ-DMmQMrc4.js} +1 -1
  313. package/web-shell/assets/channel-D_TyfiTx.js +1 -0
  314. package/web-shell/assets/{chunk-2Q5K7J3B-DA8QDX3a.js → chunk-2Q5K7J3B-C8Zh2e9y.js} +1 -1
  315. package/web-shell/assets/{chunk-5VM5RSS4-Bgu7gQ7Y.js → chunk-5VM5RSS4-C3LTenP8.js} +1 -1
  316. package/web-shell/assets/{chunk-F27PBJKO-BOew7pIK.js → chunk-F27PBJKO-CxABOc8n.js} +1 -1
  317. package/web-shell/assets/{chunk-G27WJ6UU-DHx1I-hO.js → chunk-G27WJ6UU-CD_JxHDC.js} +1 -1
  318. package/web-shell/assets/{chunk-JWPE2WC7-SarFW0WU.js → chunk-JWPE2WC7-BdmZPmce.js} +1 -1
  319. package/web-shell/assets/{chunk-LCL6LL3I-BLzP083Z.js → chunk-LCL6LL3I-80bcHmfK.js} +1 -1
  320. package/web-shell/assets/{chunk-POPQ4Y6H-Bmkv_iKm.js → chunk-POPQ4Y6H-CNpLZyQF.js} +1 -1
  321. package/web-shell/assets/{chunk-SVP7TREG-MPx9r1N2.js → chunk-SVP7TREG-CXlKgMv3.js} +1 -1
  322. package/web-shell/assets/{chunk-XXDRQBXY-Ck-09rKG.js → chunk-XXDRQBXY-CivyYyvL.js} +1 -1
  323. package/web-shell/assets/classDiagram-DTDB5LWJ-Bw_H3xMd.js +1 -0
  324. package/web-shell/assets/classDiagram-v2-JRS7N3AN-Bw_H3xMd.js +1 -0
  325. package/web-shell/assets/{cose-bilkent-JH36ORCC-DWm6lfOG.js → cose-bilkent-JH36ORCC-COAjRH3w.js} +1 -1
  326. package/web-shell/assets/{cynefin-OW5HDTMX-DcBUyr5R.js → cynefin-OW5HDTMX-DqU1JHO6.js} +1 -1
  327. package/web-shell/assets/{cynefinDiagram-5FMLGOSQ-Df8qmd_p.js → cynefinDiagram-5FMLGOSQ-BCLI1Bvj.js} +1 -1
  328. package/web-shell/assets/{dagre-3AP2YEHR-DDmGspD7.js → dagre-3AP2YEHR-DmAz8nqF.js} +1 -1
  329. package/web-shell/assets/{diagram-S7CK7UJ4-BK_qFvbi.js → diagram-S7CK7UJ4-Ck-5QLT5.js} +1 -1
  330. package/web-shell/assets/{diagram-UQ7AKVKN-Uw3AP_bi.js → diagram-UQ7AKVKN-C0ljX0mW.js} +1 -1
  331. package/web-shell/assets/{diagram-VSXAHHWV-CJOQKxY7.js → diagram-VSXAHHWV-DPgvT24v.js} +1 -1
  332. package/web-shell/assets/{diagram-VX7I27RA-DhdvZna5.js → diagram-VX7I27RA-D7hWr1LR.js} +1 -1
  333. package/web-shell/assets/{diagram-Z3DM3KII-edQU0nlP.js → diagram-Z3DM3KII-D59tlOta.js} +1 -1
  334. package/web-shell/assets/{ebnfDiagram-PWID7BFC-4kugBEsO.js → ebnfDiagram-PWID7BFC-CY2DDx00.js} +1 -1
  335. package/web-shell/assets/{erDiagram-SSCWMZ5O-BMkFivWO.js → erDiagram-SSCWMZ5O-AR4h8Q8k.js} +1 -1
  336. package/web-shell/assets/{flowDiagram-A5DVABFB-BM1ea8g-.js → flowDiagram-A5DVABFB-DbF0HqBz.js} +1 -1
  337. package/web-shell/assets/{ganttDiagram-EL5Y4UJY-CXj_cKRf.js → ganttDiagram-EL5Y4UJY-J52mrIhc.js} +1 -1
  338. package/web-shell/assets/{gitGraphDiagram-WWUBYQGX-D0nEqwqu.js → gitGraphDiagram-WWUBYQGX-CcgMY5EV.js} +1 -1
  339. package/web-shell/assets/index-BjUg3vPr.css +5 -0
  340. package/web-shell/assets/index-CFwYYVFU.js +1873 -0
  341. package/web-shell/assets/{index-B6JN54Pd.js → index-MQs7l15A.js} +1 -1
  342. package/web-shell/assets/{infoDiagram-RXCK75RN-DF7aGGbQ.js → infoDiagram-RXCK75RN-Buu3ibp2.js} +1 -1
  343. package/web-shell/assets/{ishikawaDiagram-5VMMS53U-CZYNX1lL.js → ishikawaDiagram-5VMMS53U-CoKQxnF3.js} +1 -1
  344. package/web-shell/assets/{journeyDiagram-EYS64GPL-CvrqMUz1.js → journeyDiagram-EYS64GPL-CxK35mTC.js} +1 -1
  345. package/web-shell/assets/{kanban-definition-3QL26DDD-BZNJQZBj.js → kanban-definition-3QL26DDD-tk2CHTQ1.js} +1 -1
  346. package/web-shell/assets/{layout-Bf83x7D6.js → layout-DEpMwb4u.js} +1 -1
  347. package/web-shell/assets/{linear-Bkc3ES2f.js → linear-DSQsLh53.js} +1 -1
  348. package/web-shell/assets/{mermaid.core-C6xuovwz.js → mermaid.core-DIZuPBQT.js} +6 -6
  349. package/web-shell/assets/{mindmap-definition-FBJOCRG2-DzH6gVRg.js → mindmap-definition-FBJOCRG2-CCAvk8r_.js} +1 -1
  350. package/web-shell/assets/{pegDiagram-XKGWAZYB-DCvLh2fa.js → pegDiagram-XKGWAZYB-CpJ28jxz.js} +1 -1
  351. package/web-shell/assets/{pieDiagram-E7YTZNPT-BtjVlx_6.js → pieDiagram-E7YTZNPT-ziJR2R32.js} +1 -1
  352. package/web-shell/assets/{quadrantDiagram-AXDQQJYC-IbroqxFe.js → quadrantDiagram-AXDQQJYC-B60zE3Mh.js} +1 -1
  353. package/web-shell/assets/{railroadDiagram-O6MQD6OU-BvMykiWW.js → railroadDiagram-O6MQD6OU-M3GqQ_g1.js} +1 -1
  354. package/web-shell/assets/{requirementDiagram-EFPCY7ZU-D-HHMyrh.js → requirementDiagram-EFPCY7ZU-ntCtYqTk.js} +1 -1
  355. package/web-shell/assets/{sankeyDiagram-P5KCCOFB-C0XXhB6d.js → sankeyDiagram-P5KCCOFB-AYLoItcZ.js} +1 -1
  356. package/web-shell/assets/{sequenceDiagram-WJ2MYXX4-DseAXj5d.js → sequenceDiagram-WJ2MYXX4-DEWk4Mlj.js} +1 -1
  357. package/web-shell/assets/{sizeCapture-X5ZJPWSS-Cek2EweK.js → sizeCapture-X5ZJPWSS-OOWvzPay.js} +1 -1
  358. package/web-shell/assets/{stateDiagram-HBIQ2CUA-yLv8wafW.js → stateDiagram-HBIQ2CUA-BcMmvxem.js} +1 -1
  359. package/web-shell/assets/stateDiagram-v2-4QOOHH4V-DRLLqPWO.js +1 -0
  360. package/web-shell/assets/{swimlanes-XN3QIQJK-Cwz-opvE.js → swimlanes-XN3QIQJK-DuZTWWvh.js} +1 -1
  361. package/web-shell/assets/swimlanesDiagram-VK2B7HYN-DOfLQQYt.js +8 -0
  362. package/web-shell/assets/{timeline-definition-24CTP7MA-BJuFD7OG.js → timeline-definition-24CTP7MA-CjqtZXEd.js} +1 -1
  363. package/web-shell/assets/{vennDiagram-4TSXK5OY-CNAavdoV.js → vennDiagram-4TSXK5OY-knVCVkQ4.js} +1 -1
  364. package/web-shell/assets/{wardleyDiagram-VM6X3IG4-DaIjAidq.js → wardleyDiagram-VM6X3IG4-yoWhw0a2.js} +1 -1
  365. package/web-shell/assets/{xychartDiagram-S5SC5T6Z-DkcQXjTy.js → xychartDiagram-S5SC5T6Z-ue14E_gL.js} +1 -1
  366. package/web-shell/index.html +3 -3
  367. package/chunks/MaxSizedBox-UUTUE42J.js +0 -112
  368. package/chunks/agent-headless-32O4L2CT.js +0 -87
  369. package/chunks/bridge-DFX2FFH4.js +0 -119
  370. package/chunks/channel-settings-store-ELLH2M4M.js +0 -117
  371. package/chunks/chunk-I6VVOZDK.js +0 -202
  372. package/chunks/chunk-JS73NNWF.js +0 -30
  373. package/chunks/chunk-K2OJUPOE.js +0 -78
  374. package/chunks/chunk-P3QQPMQA.js +0 -19
  375. package/chunks/chunk-SDVF6A42.js +0 -945
  376. package/chunks/chunk-VGHZT6JR.js +0 -51
  377. package/chunks/config-utils-7M6PCTLT.js +0 -113
  378. package/chunks/contextCommand-G4QG3TW6.js +0 -108
  379. package/chunks/daemon-status-provider-F5FEHVVG.js +0 -118
  380. package/chunks/daemon-trust-policy-C6YTU5CQ.js +0 -114
  381. package/chunks/deferred-core-runtime-GHT3GDOR.js +0 -116
  382. package/chunks/earlyInputCapture-HOSJTLWP.js +0 -109
  383. package/chunks/errors-IOXFDE4J.js +0 -115
  384. package/chunks/exitPlanMode-PZG4FXRB.js +0 -85
  385. package/chunks/handleAutoUpdate-AWAGHKOX.js +0 -111
  386. package/chunks/i18n-CYA25C5F.js +0 -126
  387. package/chunks/initializer-JD2FLNLO.js +0 -115
  388. package/chunks/installationInfo-N3DCWVWR.js +0 -109
  389. package/chunks/list-XDQAUET5.js +0 -118
  390. package/chunks/loadedSettingsAdapter-IK7H5JRK.js +0 -112
  391. package/chunks/mcp-2E7ZLMEE.js +0 -112
  392. package/chunks/nonInteractiveCli-ZNDXB62Y.js +0 -185
  393. package/chunks/pidfile-DHV2Y7UD.js +0 -113
  394. package/chunks/process-registry-PMJOA5CO.js +0 -172
  395. package/chunks/prompt-terminal-ledger-LDZ6QVYA.js +0 -107
  396. package/chunks/resumeHistoryUtils-YQRITQAG.js +0 -120
  397. package/chunks/ripGrep-NEIHKBKB.js +0 -39
  398. package/chunks/serve-XY5S63GN.js +0 -120
  399. package/chunks/skill-settings-5U7FTJIK.js +0 -120
  400. package/chunks/spawnChannel-TMC6VXGN.js +0 -113
  401. package/chunks/standalone-update-CUYGWTR4.js +0 -120
  402. package/chunks/terminal-image-renderer-DRL3BROJ.js +0 -116
  403. package/chunks/theme-manager-HHJPUDRN.js +0 -104
  404. package/chunks/total-session-admission-TQI7TCTL.js +0 -114
  405. package/chunks/updateCheck-6JRTKTUF.js +0 -120
  406. package/chunks/useAutoAcceptIndicator-MYXYSKSL.js +0 -122
  407. package/chunks/workspace-providers-status-H6TG34YV.js +0 -116
  408. package/chunks/workspace-registry-2PWNIYNI.js +0 -123
  409. package/chunks/workspace-service-4FGTUJLA.js +0 -131
  410. package/chunks/workspace-skills-status-7VOLUDT6.js +0 -115
  411. package/chunks/write-file-PWOYCT2K.js +0 -90
  412. package/web-shell/assets/channel-B3sGR79J.js +0 -1
  413. package/web-shell/assets/classDiagram-DTDB5LWJ-sTGo0K3v.js +0 -1
  414. package/web-shell/assets/classDiagram-v2-JRS7N3AN-sTGo0K3v.js +0 -1
  415. package/web-shell/assets/index-C-XlQn24.css +0 -5
  416. package/web-shell/assets/index-DLjXM0dn.js +0 -1860
  417. package/web-shell/assets/stateDiagram-v2-4QOOHH4V-DeThXnol.js +0 -1
  418. package/web-shell/assets/swimlanesDiagram-VK2B7HYN-GW0R1ZSv.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-IPQA4SR5.js";
9
+ } from "./chunk-BWORX6FA.js";
6
10
  import {
7
11
  init_esbuild_shims
8
12
  } from "./chunk-5O2XNYP6.js";
@@ -23,8 +27,17 @@ var GOAL_EVIDENCE_CATALOG_EXHAUSTED_REASON = "The current Goal revision exceeded
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.";
24
28
  var GOAL_CHECKPOINT_STALL_LIMIT = 3;
25
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");
26
39
  function isGoalLimitKind(value) {
27
- return value === "evidence_catalog" || value === "checkpoint_request";
40
+ return value === "evidence_catalog" || value === "checkpoint_request" || value === "token_budget";
28
41
  }
29
42
  __name(isGoalLimitKind, "isGoalLimitKind");
30
43
  function goalLimitKindForReason(reason) {
@@ -51,9 +64,10 @@ function goalRequiresExactPermit(snapshot) {
51
64
  }
52
65
  __name(goalRequiresExactPermit, "goalRequiresExactPermit");
53
66
  function isRepeatedBlockerProposal(proposal) {
54
- return proposal.status === "blocked" && proposal.blockerKind !== "authority" && proposal.blockerKind !== "external";
67
+ return proposal.status === "blocked" && proposal.blockerKind !== "authority" && proposal.blockerKind !== "external" && proposal.blockerKind !== "infeasible";
55
68
  }
56
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.";
57
71
  function validateGoalProposalReason(reason) {
58
72
  if (!reason.trim()) return "Goal proposal reason must not be empty";
59
73
  if ([...reason].length > GOAL_PROPOSAL_REASON_MAX_CHARACTERS) {
@@ -66,404 +80,6 @@ function validateGoalProposalReason(reason) {
66
80
  }
67
81
  __name(validateGoalProposalReason, "validateGoalProposalReason");
68
82
 
69
- // packages/core/src/utils/transcript-records.ts
70
- init_esbuild_shims();
71
- var USER_PROMPT_SUBMIT_CONTEXT_OPEN = "<qwen:user-prompt-submit-context>";
72
- var USER_PROMPT_SUBMIT_CONTEXT_CLOSE = "</qwen:user-prompt-submit-context>";
73
- var TranscriptRecordPreparationError = class extends TypeError {
74
- constructor(code, message) {
75
- super(message);
76
- this.code = code;
77
- this.name = "TranscriptRecordPreparationError";
78
- }
79
- static {
80
- __name(this, "TranscriptRecordPreparationError");
81
- }
82
- };
83
- var RECORD_TYPES = /* @__PURE__ */ new Set([
84
- "user",
85
- "assistant",
86
- "tool_result",
87
- "system"
88
- ]);
89
- var ARTIFACT_RECORD_SUBTYPES = /* @__PURE__ */ new Set([
90
- "session_artifact_event",
91
- "session_artifact_snapshot"
92
- ]);
93
- var KNOWN_RECORD_SUBTYPES = /* @__PURE__ */ new Set([
94
- "chat_compression",
95
- "slash_command",
96
- "ui_telemetry",
97
- "at_command",
98
- "attribution_snapshot",
99
- "notification",
100
- "cron",
101
- "mid_turn_user_message",
102
- "realtime_message",
103
- "custom_title",
104
- "parent_session",
105
- "rewind",
106
- "agent_bootstrap",
107
- "agent_launch_prompt",
108
- "agent_retry",
109
- "file_history_snapshot",
110
- "session_source",
111
- "session_model",
112
- "branch_checkpoint",
113
- "goal_state",
114
- "goal_runtime",
115
- "turn_result",
116
- ...ARTIFACT_RECORD_SUBTYPES
117
- ]);
118
- function isObjectRecord(value) {
119
- return typeof value === "object" && value !== null && !Array.isArray(value);
120
- }
121
- __name(isObjectRecord, "isObjectRecord");
122
- function wrapUserPromptSubmitContext(context) {
123
- return `${USER_PROMPT_SUBMIT_CONTEXT_OPEN}
124
- ${context}
125
- ${USER_PROMPT_SUBMIT_CONTEXT_CLOSE}`;
126
- }
127
- __name(wrapUserPromptSubmitContext, "wrapUserPromptSubmitContext");
128
- function isUserPromptSubmitContextPartText(text) {
129
- const trimmed = text.trim();
130
- const prefix = `${USER_PROMPT_SUBMIT_CONTEXT_OPEN}
131
- `;
132
- const suffix = `
133
- ${USER_PROMPT_SUBMIT_CONTEXT_CLOSE}`;
134
- if (!trimmed.startsWith(prefix) || !trimmed.endsWith(suffix)) {
135
- return false;
136
- }
137
- const body = trimmed.slice(prefix.length, -suffix.length);
138
- return !body.includes(USER_PROMPT_SUBMIT_CONTEXT_OPEN) && !body.includes(USER_PROMPT_SUBMIT_CONTEXT_CLOSE);
139
- }
140
- __name(isUserPromptSubmitContextPartText, "isUserPromptSubmitContextPartText");
141
- function isUserPromptSubmitContextPart(part) {
142
- return isObjectRecord(part) && typeof part["text"] === "string" && isUserPromptSubmitContextPartText(part["text"]);
143
- }
144
- __name(isUserPromptSubmitContextPart, "isUserPromptSubmitContextPart");
145
- function projectUserTranscriptForDisplay(record) {
146
- const parts = record.message?.parts ?? [];
147
- const hasFinalHookContextPart = parts.length > 1 && isUserPromptSubmitContextPart(parts[parts.length - 1]);
148
- const payload = isObjectRecord(record.systemPayload) ? record.systemPayload : void 0;
149
- const isUserPromptPayload = payload && (typeof payload["hookContext"] === "string" || hasFinalHookContextPart);
150
- const displayText = isUserPromptPayload && typeof payload["displayText"] === "string" ? payload["displayText"] : void 0;
151
- if (displayText !== void 0) {
152
- const visibleParts = parts.filter(
153
- (part) => !isObjectRecord(part) || typeof part["text"] !== "string"
154
- );
155
- return { displayText, parts: visibleParts };
156
- }
157
- if (payload === void 0 && hasFinalHookContextPart) {
158
- return { displayText: void 0, parts: parts.slice(0, -1) };
159
- }
160
- return { displayText: void 0, parts };
161
- }
162
- __name(projectUserTranscriptForDisplay, "projectUserTranscriptForDisplay");
163
- function diagnostic(code, message, affectsCompleteness, fields = {}, severity = affectsCompleteness ? "warning" : "info") {
164
- return {
165
- code,
166
- severity,
167
- message,
168
- affectsCompleteness,
169
- ...fields
170
- };
171
- }
172
- __name(diagnostic, "diagnostic");
173
- function isTranscriptConversationRecord(record) {
174
- return !isTranscriptArtifactRecord(record);
175
- }
176
- __name(isTranscriptConversationRecord, "isTranscriptConversationRecord");
177
- function isTranscriptArtifactRecord(record) {
178
- return record.type === "system" && typeof record.subtype === "string" && ARTIFACT_RECORD_SUBTYPES.has(record.subtype);
179
- }
180
- __name(isTranscriptArtifactRecord, "isTranscriptArtifactRecord");
181
- function validateTranscriptRecord(value, recordIndex) {
182
- const diagnostics = [];
183
- if (!isObjectRecord(value)) {
184
- diagnostics.push(
185
- diagnostic(
186
- "invalid_record",
187
- "Skipped a transcript record that is not an object.",
188
- true,
189
- { recordIndex }
190
- )
191
- );
192
- return { diagnostics };
193
- }
194
- const uuid = value["uuid"];
195
- const parentUuid = value["parentUuid"];
196
- const sessionId = value["sessionId"];
197
- const type = value["type"];
198
- const recordId = typeof uuid === "string" ? uuid : void 0;
199
- if (typeof uuid !== "string" || uuid.length === 0 || typeof parentUuid !== "string" && parentUuid !== null || typeof sessionId !== "string" || sessionId.length === 0) {
200
- diagnostics.push(
201
- diagnostic(
202
- "invalid_record",
203
- "Skipped a transcript record with invalid identity fields.",
204
- true,
205
- { recordIndex, recordId }
206
- )
207
- );
208
- return { diagnostics };
209
- }
210
- if (typeof type !== "string" || !RECORD_TYPES.has(type)) {
211
- diagnostics.push(
212
- diagnostic(
213
- "unknown_record_or_part",
214
- "Skipped a transcript record with an unknown record type.",
215
- true,
216
- { recordIndex, recordId }
217
- )
218
- );
219
- return { diagnostics };
220
- }
221
- const timestamp = value["timestamp"];
222
- if (timestamp !== void 0 && (typeof timestamp !== "string" || !Number.isFinite(new Date(timestamp).getTime()))) {
223
- diagnostics.push(
224
- diagnostic(
225
- "invalid_timestamp",
226
- "Ignored an invalid transcript record timestamp.",
227
- false,
228
- { recordIndex, recordId, path: "timestamp" }
229
- )
230
- );
231
- }
232
- const subtype = value["subtype"];
233
- if (subtype !== void 0 && (typeof subtype !== "string" || !KNOWN_RECORD_SUBTYPES.has(subtype))) {
234
- diagnostics.push(
235
- diagnostic(
236
- "unknown_record_or_part",
237
- "The transcript record has an unknown subtype.",
238
- true,
239
- { recordIndex, recordId, path: "subtype" }
240
- )
241
- );
242
- }
243
- let message;
244
- if (value["message"] !== void 0) {
245
- if (!isObjectRecord(value["message"])) {
246
- diagnostics.push(
247
- diagnostic(
248
- "malformed_part",
249
- "Ignored a malformed transcript message payload.",
250
- true,
251
- { recordIndex, recordId, path: "message" }
252
- )
253
- );
254
- } else {
255
- const parts = value["message"]["parts"];
256
- if (parts !== void 0 && !Array.isArray(parts)) {
257
- diagnostics.push(
258
- diagnostic(
259
- "malformed_part",
260
- "Ignored malformed transcript message parts.",
261
- true,
262
- { recordIndex, recordId, path: "message.parts" }
263
- )
264
- );
265
- }
266
- message = {
267
- ...typeof value["message"]["role"] === "string" ? { role: value["message"]["role"] } : {},
268
- ...Array.isArray(parts) ? { parts } : {}
269
- };
270
- }
271
- }
272
- return {
273
- record: {
274
- ...value,
275
- uuid,
276
- parentUuid,
277
- sessionId,
278
- type,
279
- ...typeof subtype === "string" ? { subtype } : { subtype: void 0 },
280
- ...typeof timestamp === "string" && Number.isFinite(new Date(timestamp).getTime()) ? { timestamp } : { timestamp: void 0 },
281
- ...message ? { message } : { message: void 0 }
282
- },
283
- diagnostics
284
- };
285
- }
286
- __name(validateTranscriptRecord, "validateTranscriptRecord");
287
- function selectTranscriptLeaf(records, leafUuid) {
288
- if (leafUuid !== void 0) {
289
- return records.some(
290
- (record) => record.uuid === leafUuid && isTranscriptConversationRecord(record)
291
- ) ? leafUuid : void 0;
292
- }
293
- for (let index = records.length - 1; index >= 0; index -= 1) {
294
- const record = records[index];
295
- if (record && isTranscriptConversationRecord(record)) return record.uuid;
296
- }
297
- return void 0;
298
- }
299
- __name(selectTranscriptLeaf, "selectTranscriptLeaf");
300
- function walkTranscriptUuidChain(leafUuid, lookup) {
301
- const uuids = [];
302
- const gaps = [];
303
- const visited = /* @__PURE__ */ new Set();
304
- let currentUuid = leafUuid;
305
- let cycleUuid;
306
- while (currentUuid) {
307
- if (visited.has(currentUuid)) {
308
- cycleUuid = currentUuid;
309
- break;
310
- }
311
- visited.add(currentUuid);
312
- const record = lookup(currentUuid);
313
- if (!record) break;
314
- uuids.push(currentUuid);
315
- if (!record.parentUuid) break;
316
- if (!lookup(record.parentUuid)) {
317
- gaps.push({
318
- childUuid: currentUuid,
319
- missingParentUuid: record.parentUuid
320
- });
321
- break;
322
- }
323
- currentUuid = record.parentUuid;
324
- }
325
- uuids.reverse();
326
- return { uuids, gaps, ...cycleUuid ? { cycleUuid } : {} };
327
- }
328
- __name(walkTranscriptUuidChain, "walkTranscriptUuidChain");
329
- function aggregateTranscriptRecordFragments(records) {
330
- const first = records[0];
331
- if (!first) {
332
- throw new Error("Cannot aggregate empty transcript record array");
333
- }
334
- const base = { ...first };
335
- let message = first.message ? { ...first.message, parts: [...first.message.parts ?? []] } : void 0;
336
- for (let index = 1; index < records.length; index += 1) {
337
- const record = records[index];
338
- if (record.message !== void 0) {
339
- message = message ? {
340
- role: message.role,
341
- parts: [...message.parts ?? [], ...record.message.parts ?? []]
342
- } : { ...record.message, parts: [...record.message.parts ?? []] };
343
- }
344
- if (record.usageMetadata) base["usageMetadata"] = record.usageMetadata;
345
- if (record.toolCallResult && !base["toolCallResult"]) {
346
- base["toolCallResult"] = record.toolCallResult;
347
- }
348
- if (record.model && !base["model"]) base["model"] = record.model;
349
- if (record.timestamp && (!base["timestamp"] || record.timestamp > String(base["timestamp"]))) {
350
- base["timestamp"] = record.timestamp;
351
- }
352
- }
353
- base["message"] = message;
354
- return base;
355
- }
356
- __name(aggregateTranscriptRecordFragments, "aggregateTranscriptRecordFragments");
357
- function prepareTranscriptRecords(values, options = {}) {
358
- if (!Array.isArray(values)) {
359
- throw new TranscriptRecordPreparationError(
360
- "invalid_records",
361
- "Transcript records must be an array."
362
- );
363
- }
364
- const diagnostics = [];
365
- const records = [];
366
- const sourceIndexByRecord = /* @__PURE__ */ new Map();
367
- for (let index = 0; index < values.length; index += 1) {
368
- const validated = validateTranscriptRecord(values[index], index);
369
- diagnostics.push(...validated.diagnostics);
370
- if (validated.record) {
371
- records.push(validated.record);
372
- sourceIndexByRecord.set(validated.record, index);
373
- }
374
- }
375
- const sessionIds = new Set(records.map((record) => record.sessionId));
376
- if (sessionIds.size > 1) {
377
- throw new TranscriptRecordPreparationError(
378
- "mixed_session_ids",
379
- "Transcript records contain multiple session ids."
380
- );
381
- }
382
- const leafUuid = selectTranscriptLeaf(records, options.leafUuid);
383
- if (options.leafUuid !== void 0 && leafUuid === void 0) {
384
- throw new TranscriptRecordPreparationError(
385
- "leaf_not_found",
386
- "The requested transcript leaf was not found."
387
- );
388
- }
389
- if (!leafUuid) {
390
- if (records.length > 0) {
391
- diagnostics.push(
392
- diagnostic(
393
- "artifact_only",
394
- "The input contains no conversation records.",
395
- false
396
- )
397
- );
398
- }
399
- return {
400
- ...sessionIds.size === 1 ? { sessionId: records[0].sessionId } : {},
401
- records: [],
402
- gaps: [],
403
- diagnostics
404
- };
405
- }
406
- const fragmentsByUuid = /* @__PURE__ */ new Map();
407
- const firstByUuid = /* @__PURE__ */ new Map();
408
- for (const record of records) {
409
- if (!isTranscriptConversationRecord(record)) continue;
410
- const fragments = fragmentsByUuid.get(record.uuid);
411
- if (fragments) {
412
- if (fragments[0].parentUuid !== record.parentUuid) {
413
- diagnostics.push(
414
- diagnostic(
415
- "conflicting_parent_uuid",
416
- "Duplicate transcript record fragments disagree on parentUuid.",
417
- true,
418
- {
419
- recordIndex: sourceIndexByRecord.get(record),
420
- recordId: record.uuid,
421
- path: "parentUuid"
422
- }
423
- )
424
- );
425
- }
426
- fragments.push(record);
427
- } else {
428
- fragmentsByUuid.set(record.uuid, [record]);
429
- firstByUuid.set(record.uuid, record);
430
- }
431
- }
432
- const chain = walkTranscriptUuidChain(
433
- leafUuid,
434
- (uuid) => firstByUuid.get(uuid)
435
- );
436
- for (const gap of chain.gaps) {
437
- diagnostics.push(
438
- diagnostic(
439
- "history_gap",
440
- "The active transcript chain is missing a parent record.",
441
- true,
442
- { recordId: gap.childUuid }
443
- )
444
- );
445
- }
446
- if (chain.cycleUuid) {
447
- diagnostics.push(
448
- diagnostic(
449
- "parent_cycle",
450
- "The active transcript chain contains a parent cycle.",
451
- true,
452
- { recordId: chain.cycleUuid }
453
- )
454
- );
455
- }
456
- return {
457
- ...sessionIds.size === 1 ? { sessionId: records[0].sessionId } : {},
458
- records: chain.uuids.map(
459
- (uuid) => aggregateTranscriptRecordFragments(fragmentsByUuid.get(uuid) ?? [])
460
- ),
461
- gaps: chain.gaps,
462
- diagnostics
463
- };
464
- }
465
- __name(prepareTranscriptRecords, "prepareTranscriptRecords");
466
-
467
83
  // packages/core/src/goals/goal-evidence.ts
468
84
  init_esbuild_shims();
469
85
  var CATALOG_PREVIEW_LIMIT = 240;
@@ -1056,7 +672,13 @@ function repeatedBlockerCoverageCatalogued(analysis) {
1056
672
  __name(repeatedBlockerCoverageCatalogued, "repeatedBlockerCoverageCatalogued");
1057
673
  function validateBlockerCoverage(proposal, citedRecords, analysis) {
1058
674
  if (proposal.status !== "blocked") return;
1059
- 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") {
1060
682
  if (!citedRecords.some(
1061
683
  ({ proofKind }) => proofKind === "user_input" || proofKind === "external_fact"
1062
684
  )) {
@@ -1372,7 +994,8 @@ function reduceGoalControl(current, transition) {
1372
994
  transition.nextGoalId,
1373
995
  normalizeObjective(request.objective, snapshotOf(null)),
1374
996
  transition.now,
1375
- transition.cursor
997
+ transition.cursor,
998
+ transition.tokenBudgetGrant
1376
999
  );
1377
1000
  }
1378
1001
  assertExpectedVersion(
@@ -1386,7 +1009,8 @@ function reduceGoalControl(current, transition) {
1386
1009
  transition.nextGoalId,
1387
1010
  normalizeObjective(request.objective, snapshotOf(current)),
1388
1011
  transition.now,
1389
- transition.cursor
1012
+ transition.cursor,
1013
+ transition.tokenBudgetGrant
1390
1014
  );
1391
1015
  }
1392
1016
  if (request.action === "edit") {
@@ -1402,6 +1026,7 @@ function reduceGoalControl(current, transition) {
1402
1026
  evidenceCursor: copyCursor(transition.cursor),
1403
1027
  evidenceCheckpoint: void 0,
1404
1028
  checkpointStalls: void 0,
1029
+ ...rearmedTokenBudget(current, transition.tokenBudgetGrant),
1405
1030
  lastReason: void 0,
1406
1031
  limitKind: void 0
1407
1032
  });
@@ -1427,6 +1052,14 @@ function reduceGoalControl(current, transition) {
1427
1052
  snapshotOf(current)
1428
1053
  );
1429
1054
  }
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
+ });
1062
+ }
1430
1063
  if (request.action !== "resume") {
1431
1064
  return assertNever(request, snapshotOf(current));
1432
1065
  }
@@ -1439,12 +1072,14 @@ function reduceGoalControl(current, transition) {
1439
1072
  // a different one, so carrying it over would spend the new window's
1440
1073
  // allowance on the old window's failures.
1441
1074
  checkpointStalls: void 0,
1075
+ ...rearmedTokenBudget(current, transition.tokenBudgetGrant),
1442
1076
  lastReason: void 0,
1443
1077
  limitKind: void 0
1444
1078
  });
1445
1079
  }
1446
1080
  return transitionGoal(current, transition.now, {
1447
- status: "active"
1081
+ status: "active",
1082
+ ...rearmedTokenBudget(current, transition.tokenBudgetGrant)
1448
1083
  });
1449
1084
  }
1450
1085
  __name(reduceGoalControl, "reduceGoalControl");
@@ -1458,7 +1093,8 @@ function reduceGoalTurnFinished(current, transition) {
1458
1093
  return transitionGoal(current, transition.now, {
1459
1094
  turnCount: current.turnCount + 1,
1460
1095
  tokensUsed: current.tokensUsed + Math.max(0, transition.tokensUsed ?? 0),
1461
- ...transition.lastReason === void 0 ? {} : { lastReason: transition.lastReason }
1096
+ ...transition.lastReason === void 0 ? {} : { lastReason: transition.lastReason },
1097
+ ...transition.windDownTurnId === void 0 ? {} : { windDownTurnId: transition.windDownTurnId }
1462
1098
  });
1463
1099
  }
1464
1100
  __name(reduceGoalTurnFinished, "reduceGoalTurnFinished");
@@ -1561,7 +1197,7 @@ function parseGoalStateCause(value) {
1561
1197
  return isGoalStateCause(value) ? value : void 0;
1562
1198
  }
1563
1199
  __name(parseGoalStateCause, "parseGoalStateCause");
1564
- function createGoal(goalId, objective, now, cursor) {
1200
+ function createGoal(goalId, objective, now, cursor, tokenBudget) {
1565
1201
  return {
1566
1202
  goalId,
1567
1203
  revision: 1,
@@ -1571,6 +1207,9 @@ function createGoal(goalId, objective, now, cursor) {
1571
1207
  turnCount: 0,
1572
1208
  activeTimeMs: 0,
1573
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 } : {},
1574
1213
  createdAt: now,
1575
1214
  updatedAt: now
1576
1215
  };
@@ -1594,16 +1233,30 @@ function normalizeObjective(objective, current) {
1594
1233
  }
1595
1234
  __name(normalizeObjective, "normalizeObjective");
1596
1235
  function isEvidenceLimited(goal) {
1597
- 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;
1598
1237
  }
1599
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");
1600
1246
  function transitionGoal(goal, now, changes) {
1601
- return {
1247
+ const transitioned = {
1602
1248
  ...goal,
1603
1249
  ...changes,
1604
1250
  activeTimeMs: elapsedActiveTime(goal, now),
1605
1251
  updatedAt: now
1606
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;
1607
1260
  }
1608
1261
  __name(transitionGoal, "transitionGoal");
1609
1262
  function snapshotOf(goal) {
@@ -1634,13 +1287,15 @@ function parseGoalRecord(value) {
1634
1287
  "turnCount",
1635
1288
  "activeTimeMs",
1636
1289
  "tokensUsed",
1290
+ "tokenBudget",
1291
+ "windDownTurnId",
1637
1292
  "createdAt",
1638
1293
  "updatedAt",
1639
1294
  "evidenceCheckpoint",
1640
1295
  "checkpointStalls",
1641
1296
  "lastReason",
1642
1297
  "limitKind"
1643
- ]) || 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"]) || !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")) {
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")) {
1644
1299
  return void 0;
1645
1300
  }
1646
1301
  if (value["evidenceCheckpoint"] && value["evidenceCursor"].recordId !== value["evidenceCheckpoint"].checkpointId) {
@@ -1656,6 +1311,9 @@ function parseGoalRecord(value) {
1656
1311
  activeTimeMs: value["activeTimeMs"],
1657
1312
  // Goals persisted before `tokensUsed` existed carry no spend to restore.
1658
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"] },
1659
1317
  createdAt: value["createdAt"],
1660
1318
  updatedAt: value["updatedAt"],
1661
1319
  ...value["evidenceCheckpoint"] === void 0 ? {} : {
@@ -2069,7 +1727,7 @@ function recoverLegacyGoal(records) {
2069
1727
  }
2070
1728
  for (let itemIndex = payload.outputHistoryItems.length - 1; itemIndex >= 0; itemIndex -= 1) {
2071
1729
  const value = payload.outputHistoryItems[itemIndex];
2072
- if (!isObjectRecord2(value) || value["type"] !== "goal_status") continue;
1730
+ if (!isObjectRecord(value) || value["type"] !== "goal_status") continue;
2073
1731
  const kind = value["kind"];
2074
1732
  const condition = value["condition"];
2075
1733
  if (typeof kind !== "string" || typeof condition !== "string") {
@@ -2113,7 +1771,7 @@ function normalizeGoalRecoveryRecord(record) {
2113
1771
  return void 0;
2114
1772
  }
2115
1773
  const goalStatusItems = payload.outputHistoryItems.filter(
2116
- (value) => isObjectRecord2(value) && value["type"] === "goal_status"
1774
+ (value) => isObjectRecord(value) && value["type"] === "goal_status"
2117
1775
  );
2118
1776
  if (goalStatusItems.length === 0) return void 0;
2119
1777
  return {
@@ -2134,7 +1792,7 @@ function isGoalRecoveryCandidate(record) {
2134
1792
  }
2135
1793
  const payload = record.systemPayload;
2136
1794
  return payload?.phase === "result" && Array.isArray(payload.outputHistoryItems) && payload.outputHistoryItems.some(
2137
- (value) => isObjectRecord2(value) && value["type"] === "goal_status"
1795
+ (value) => isObjectRecord(value) && value["type"] === "goal_status"
2138
1796
  );
2139
1797
  }
2140
1798
  __name(isGoalRecoveryCandidate, "isGoalRecoveryCandidate");
@@ -2145,10 +1803,10 @@ function unsupportedLegacy(recordUuid) {
2145
1803
  };
2146
1804
  }
2147
1805
  __name(unsupportedLegacy, "unsupportedLegacy");
2148
- function isObjectRecord2(value) {
1806
+ function isObjectRecord(value) {
2149
1807
  return typeof value === "object" && value !== null && !Array.isArray(value);
2150
1808
  }
2151
- __name(isObjectRecord2, "isObjectRecord");
1809
+ __name(isObjectRecord, "isObjectRecord");
2152
1810
  function createMigratedGoalState(input) {
2153
1811
  const objective = input.objective.trim();
2154
1812
  if (!objective) {
@@ -2218,6 +1876,9 @@ function createGoalRuntime(options) {
2218
1876
  let currentTurnKey;
2219
1877
  let queuedTurnKey;
2220
1878
  let continuationQueued = false;
1879
+ let announcedObjective;
1880
+ let currentTurnAnnouncement;
1881
+ let currentTurnDelivered = false;
2221
1882
  let currentProposal;
2222
1883
  let pendingProposal;
2223
1884
  let verificationAttempt;
@@ -2227,6 +1888,7 @@ function createGoalRuntime(options) {
2227
1888
  let currentTurnFeedback;
2228
1889
  let restored = false;
2229
1890
  let restoreActivationPending = false;
1891
+ let windDownTurnId;
2230
1892
  let restorePreparation;
2231
1893
  let restoreActivation;
2232
1894
  let preparedRestoreCause;
@@ -2250,6 +1912,60 @@ function createGoalRuntime(options) {
2250
1912
  return 0;
2251
1913
  }
2252
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");
2253
1969
  const withCheckpointStalls = /* @__PURE__ */ __name((goal, checkpointStalls) => {
2254
1970
  const { checkpointStalls: _previous, ...rest } = goal;
2255
1971
  return checkpointStalls > 0 ? { ...rest, checkpointStalls } : rest;
@@ -2276,7 +1992,14 @@ function createGoalRuntime(options) {
2276
1992
  } catch {
2277
1993
  }
2278
1994
  }, "preemptHost");
2279
- 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) => {
2280
2003
  if (!continuationQueued || !host || currentPermit || pendingProposal || verificationAttempt || checkpointAttempt || snapshot.activity !== "idle" || snapshot.goal?.status !== "active") {
2281
2004
  return;
2282
2005
  }
@@ -2294,11 +2017,16 @@ function createGoalRuntime(options) {
2294
2017
  currentPermitHost = scheduledHost;
2295
2018
  currentTurnKey = `goal-runtime:${currentPermit.turnId}`;
2296
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;
2297
2024
  snapshot = { ...snapshot, activity: "running" };
2298
2025
  broadcast(cause);
2299
2026
  const handleStartFailure = /* @__PURE__ */ __name(() => {
2300
2027
  void enqueue(async () => {
2301
2028
  if (isCurrentPermit(startedPermit)) {
2029
+ settleCurrentTurnAnnouncement(false);
2302
2030
  const nextTurnKey = queuedTurnKey;
2303
2031
  currentPermit = void 0;
2304
2032
  currentPermitHost = void 0;
@@ -2335,6 +2063,8 @@ function createGoalRuntime(options) {
2335
2063
  started = scheduledHost.startGoalTurn({
2336
2064
  permit: startedPermit,
2337
2065
  continuationContext,
2066
+ ...objectiveUpdated ? { objectiveUpdated } : {},
2067
+ ...windDown ? { windDown } : {},
2338
2068
  ...verifierFeedback ? { verifierFeedback } : {}
2339
2069
  });
2340
2070
  } catch {
@@ -2347,6 +2077,15 @@ function createGoalRuntime(options) {
2347
2077
  if (restoreActivationPending || snapshot.goal?.status !== "active" || currentPermit || pendingProposal || verificationAttempt || checkpointAttempt) {
2348
2078
  return;
2349
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
+ }
2350
2089
  continuationQueued = true;
2351
2090
  flushContinuation(cause);
2352
2091
  }, "queueContinuation");
@@ -2404,7 +2143,7 @@ function createGoalRuntime(options) {
2404
2143
  return {
2405
2144
  ...base,
2406
2145
  proposal: { ...attempt.proposal, status: "blocked" },
2407
- 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."
2408
2147
  };
2409
2148
  }, "verifierInput");
2410
2149
  const promoteQueuedUserTurn = /* @__PURE__ */ __name(() => {
@@ -2441,7 +2180,7 @@ function createGoalRuntime(options) {
2441
2180
  ...snapshot.goal,
2442
2181
  activeTimeMs: elapsedActiveTime(snapshot.goal, now),
2443
2182
  updatedAt: now,
2444
- lastReason: outcome.result.reason
2183
+ lastReason: attempt.proposal.blockerKind === "infeasible" ? `${outcome.result.reason} ${GOAL_INFEASIBLE_NEXT_STEP}` : outcome.result.reason
2445
2184
  };
2446
2185
  const acceptedSnapshot = {
2447
2186
  v: GOAL_STATE_VERSION,
@@ -2474,36 +2213,24 @@ function createGoalRuntime(options) {
2474
2213
  continuationQueued = false;
2475
2214
  nextVerifierFeedback = void 0;
2476
2215
  currentTurnFeedback = void 0;
2216
+ if (attempt.proposal.status === "complete") {
2217
+ announcedObjective = void 0;
2218
+ }
2477
2219
  snapshot = structuredClone(terminalSnapshot);
2478
2220
  broadcast(attempt.proposal.status);
2479
2221
  return void 0;
2480
2222
  }
2481
2223
  if (outcome.kind === "usage_limited") {
2482
- const limitedSnapshot = {
2483
- v: GOAL_STATE_VERSION,
2484
- goal: {
2485
- ...snapshot.goal,
2486
- status: "usage_limited",
2487
- activeTimeMs: elapsedActiveTime(snapshot.goal, now),
2488
- updatedAt: now,
2489
- lastReason: outcome.reason,
2490
- ...outcome.limitKind === void 0 ? {} : { limitKind: outcome.limitKind }
2491
- },
2492
- activity: "idle"
2493
- };
2494
- await options.journal.recordGoalState(randomUUID(), {
2495
- v: GOAL_STATE_VERSION,
2496
- cause: "usage_limited",
2497
- snapshot: limitedSnapshot
2498
- });
2224
+ const limitedSnapshot = await journalUsageLimitedSettle(
2225
+ snapshot.goal,
2226
+ outcome.reason,
2227
+ outcome.limitKind
2228
+ );
2499
2229
  if (!isCurrentVerificationAttempt(attempt) || !snapshot.goal) return;
2500
2230
  verificationAttempt = void 0;
2501
2231
  pendingProposal = void 0;
2502
- continuationQueued = false;
2503
2232
  nextVerifierFeedback = void 0;
2504
- currentTurnFeedback = void 0;
2505
- snapshot = structuredClone(limitedSnapshot);
2506
- broadcast("usage_limited");
2233
+ commitUsageLimitedSettle(limitedSnapshot);
2507
2234
  return void 0;
2508
2235
  }
2509
2236
  const rejectedCheckpoint = isRepeatedBlockerProposal(attempt.proposal) ? void 0 : createCheckpointAttempt(attempt.permit, snapshot.goal);
@@ -2650,30 +2377,14 @@ function createGoalRuntime(options) {
2650
2377
  });
2651
2378
  }, "finishCheckpointCheck");
2652
2379
  const settleCheckpointFailure = /* @__PURE__ */ __name(async (attempt, goal, reason, limitKind) => {
2653
- const now = Date.now();
2654
- const limitedSnapshot = {
2655
- v: GOAL_STATE_VERSION,
2656
- goal: {
2657
- ...goal,
2658
- status: "usage_limited",
2659
- activeTimeMs: elapsedActiveTime(goal, now),
2660
- updatedAt: now,
2661
- lastReason: reason,
2662
- ...limitKind === void 0 ? {} : { limitKind }
2663
- },
2664
- activity: "idle"
2665
- };
2666
- await options.journal.recordGoalState(randomUUID(), {
2667
- v: GOAL_STATE_VERSION,
2668
- cause: "usage_limited",
2669
- snapshot: limitedSnapshot
2670
- });
2380
+ const limitedSnapshot = await journalUsageLimitedSettle(
2381
+ goal,
2382
+ reason,
2383
+ limitKind
2384
+ );
2671
2385
  if (!isCurrentCheckpointAttempt(attempt) || !snapshot.goal) return;
2672
2386
  checkpointAttempt = void 0;
2673
- continuationQueued = false;
2674
- currentTurnFeedback = void 0;
2675
- snapshot = structuredClone(limitedSnapshot);
2676
- broadcast("usage_limited");
2387
+ commitUsageLimitedSettle(limitedSnapshot);
2677
2388
  }, "settleCheckpointFailure");
2678
2389
  const settleIfCheckpointStalled = /* @__PURE__ */ __name(async (attempt, goal, checkpointStalls) => {
2679
2390
  if (checkpointStalls < GOAL_CHECKPOINT_STALL_LIMIT) return false;
@@ -3020,6 +2731,7 @@ function createGoalRuntime(options) {
3020
2731
  if (currentTurnFeedback !== void 0) {
3021
2732
  nextVerifierFeedback ??= currentTurnFeedback;
3022
2733
  }
2734
+ settleCurrentTurnAnnouncement(currentTurnDelivered);
3023
2735
  currentPermit = void 0;
3024
2736
  currentPermitHost = void 0;
3025
2737
  currentTurnKey = void 0;
@@ -3048,6 +2760,12 @@ function createGoalRuntime(options) {
3048
2760
  return released;
3049
2761
  });
3050
2762
  },
2763
+ markTurnDelivered(turnKey) {
2764
+ assertOperational();
2765
+ if (currentPermit && currentTurnKey === turnKey) {
2766
+ currentTurnDelivered = true;
2767
+ }
2768
+ },
3051
2769
  permitForTurn(turnKey) {
3052
2770
  assertOperational();
3053
2771
  return currentPermit && currentTurnKey === turnKey ? structuredClone(currentPermit) : void 0;
@@ -3066,11 +2784,15 @@ function createGoalRuntime(options) {
3066
2784
  if (!isCurrentPermit(permit) || !snapshot.goal) {
3067
2785
  throw new Error(STALE_GOAL_TURN_MESSAGE);
3068
2786
  }
2787
+ settleCurrentTurnAnnouncement(currentTurnDelivered);
3069
2788
  const recordUuid = randomUUID();
2789
+ const finishedWindDown = windDownTurnId === permit.turnId;
3070
2790
  const nextGoal = reduceGoalTurnFinished(snapshot.goal, {
3071
2791
  now: Date.now(),
3072
- tokensUsed: takeTurnTokens(permit.turnId)
2792
+ tokensUsed: takeTurnTokens(permit.turnId),
2793
+ ...finishedWindDown ? { windDownTurnId: permit.turnId } : {}
3073
2794
  });
2795
+ if (finishedWindDown) windDownTurnId = void 0;
3074
2796
  const persistedSnapshot = {
3075
2797
  v: GOAL_STATE_VERSION,
3076
2798
  goal: nextGoal,
@@ -3241,7 +2963,8 @@ ${proposal.reason}`;
3241
2963
  request,
3242
2964
  now: Date.now(),
3243
2965
  nextGoalId: randomUUID(),
3244
- 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
3245
2968
  });
3246
2969
  const nextSnapshot = {
3247
2970
  v: GOAL_STATE_VERSION,
@@ -3274,6 +2997,7 @@ ${proposal.reason}`;
3274
2997
  invalidateAttempts(`Goal ${request.action}`);
3275
2998
  }
3276
2999
  if (invalidatesPermit) {
3000
+ settleCurrentTurnAnnouncement(currentTurnDelivered);
3277
3001
  currentPermit = void 0;
3278
3002
  currentPermitHost = void 0;
3279
3003
  currentTurnKey = void 0;
@@ -3284,6 +3008,7 @@ ${proposal.reason}`;
3284
3008
  nextVerifierFeedback = void 0;
3285
3009
  currentTurnFeedback = void 0;
3286
3010
  continuationQueued = false;
3011
+ if (request.action === "clear") announcedObjective = void 0;
3287
3012
  } else if (request.action === "resume") {
3288
3013
  blockedAudit = void 0;
3289
3014
  }
@@ -3318,6 +3043,8 @@ ${proposal.reason}`;
3318
3043
  blockedAudit = void 0;
3319
3044
  nextVerifierFeedback = void 0;
3320
3045
  currentTurnFeedback = void 0;
3046
+ currentTurnAnnouncement = void 0;
3047
+ currentTurnDelivered = false;
3321
3048
  preemptHost("Goal runtime disposed", invalidatedHost);
3322
3049
  host = void 0;
3323
3050
  listeners.clear();
@@ -3337,16 +3064,6 @@ export {
3337
3064
  emptyGoalSnapshot,
3338
3065
  goalRequiresExactPermit,
3339
3066
  validateGoalProposalReason,
3340
- wrapUserPromptSubmitContext,
3341
- isUserPromptSubmitContextPartText,
3342
- projectUserTranscriptForDisplay,
3343
- isTranscriptConversationRecord,
3344
- isTranscriptArtifactRecord,
3345
- validateTranscriptRecord,
3346
- selectTranscriptLeaf,
3347
- walkTranscriptUuidChain,
3348
- aggregateTranscriptRecordFragments,
3349
- prepareTranscriptRecords,
3350
3067
  GOAL_EVIDENCE_REFERENCE_LIMIT,
3351
3068
  EvidenceSourceUnavailableError,
3352
3069
  InvalidGoalEvidenceReferenceError,
@@ -3375,8 +3092,3 @@ export {
3375
3092
  * Copyright 2026 Qwen Team
3376
3093
  * SPDX-License-Identifier: Apache-2.0
3377
3094
  */
3378
- /**
3379
- * @license
3380
- * Copyright 2025 Qwen Team
3381
- * SPDX-License-Identifier: Apache-2.0
3382
- */