@namzu/cli 39.2.0 → 40.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (419) hide show
  1. package/CHANGELOG.md +80 -0
  2. package/dist/bin.js +1 -1
  3. package/dist/checkpoints/manifest.d.ts +7 -0
  4. package/dist/checkpoints/manifest.d.ts.map +1 -1
  5. package/dist/checkpoints/rewind-stats.d.ts +31 -0
  6. package/dist/checkpoints/rewind-stats.d.ts.map +1 -0
  7. package/dist/checkpoints/store.d.ts +24 -3
  8. package/dist/checkpoints/store.d.ts.map +1 -1
  9. package/dist/chunks/{acp-OOJ6EBDV.js → acp-E7XNZWFV.js} +40 -39
  10. package/dist/chunks/acp-E7XNZWFV.js.map +6 -0
  11. package/dist/chunks/{activity-command-H7YPFJXX.js → activity-command-QANVT2PA.js} +13 -12
  12. package/dist/chunks/activity-command-QANVT2PA.js.map +6 -0
  13. package/dist/chunks/{add-E46I4MLS.js → add-VDRMBSNZ.js} +20 -18
  14. package/dist/chunks/add-VDRMBSNZ.js.map +6 -0
  15. package/dist/chunks/{agent-A3IFU43K.js → agent-PPQJZWBO.js} +31 -30
  16. package/dist/chunks/agent-session-PISYPFO2.js +54 -0
  17. package/dist/chunks/{archive-FWKUN3JD.js → archive-SH4IG6KC.js} +11 -10
  18. package/dist/chunks/archive-SH4IG6KC.js.map +6 -0
  19. package/dist/chunks/{bin-main-YOWKMTAT.js → bin-main-D45Q7FMM.js} +5 -4
  20. package/dist/chunks/bin-main-D45Q7FMM.js.map +6 -0
  21. package/dist/chunks/{browser-ZISCIIZG.js → browser-EUFWHKYD.js} +6 -6
  22. package/dist/chunks/{chat-JNYLC4XC.js → chat-QDWGHEEL.js} +14 -14
  23. package/dist/chunks/{chunk-D24BFQ2R.js → chunk-2I3Z65TV.js} +13 -13
  24. package/dist/chunks/{chunk-62GB6STC.js → chunk-4HUZHYCY.js} +4 -4
  25. package/dist/chunks/{chunk-2SPJH5HF.js → chunk-53GEER6F.js} +3 -3
  26. package/dist/chunks/{chunk-7T6O6HZO.js → chunk-5HSG2XFD.js} +2 -2
  27. package/dist/chunks/{chunk-JPWIGZJ4.js → chunk-6PAE7AWD.js} +2 -2
  28. package/dist/chunks/{chunk-SN4RRU3A.js → chunk-6UDJ3PVE.js} +7 -7
  29. package/dist/chunks/{chunk-D57LFZYV.js → chunk-73G5WDGM.js} +3 -3
  30. package/dist/chunks/{chunk-BD7DGINR.js → chunk-7M6IZGAK.js} +58 -12
  31. package/dist/chunks/chunk-7M6IZGAK.js.map +6 -0
  32. package/dist/chunks/{chunk-JBI7VU5W.js → chunk-AHPIP5IE.js} +2 -2
  33. package/dist/chunks/{chunk-JC37Z4C2.js → chunk-AQL5A442.js} +10 -4
  34. package/dist/chunks/{chunk-JC37Z4C2.js.map → chunk-AQL5A442.js.map} +1 -1
  35. package/dist/chunks/{chunk-FEANPQH4.js → chunk-AUFSSABF.js} +3 -3
  36. package/dist/chunks/{chunk-5ED3H3C7.js → chunk-BJNHDKU6.js} +2 -2
  37. package/dist/chunks/{chunk-ARILZQYC.js → chunk-BQ7PN64G.js} +10 -10
  38. package/dist/chunks/{chunk-ARILZQYC.js.map → chunk-BQ7PN64G.js.map} +1 -1
  39. package/dist/chunks/{chunk-5Y3XJ2QD.js → chunk-BZ4U5L7N.js} +9 -9
  40. package/dist/chunks/{chunk-XJMHPZGJ.js → chunk-BZJNXGWW.js} +5 -5
  41. package/dist/chunks/{chunk-K2WHGUA7.js → chunk-C3APHRQB.js} +2 -2
  42. package/dist/chunks/{chunk-5WZ63LBF.js → chunk-C3ZJQLUX.js} +2 -2
  43. package/dist/chunks/{chunk-J3JUC6J6.js → chunk-C723P7SP.js} +6 -6
  44. package/dist/chunks/{chunk-RKMGVFLZ.js → chunk-D63T5UQN.js} +584 -45
  45. package/dist/chunks/chunk-D63T5UQN.js.map +6 -0
  46. package/dist/chunks/{chunk-YN5PDLFB.js → chunk-DGV5W2BU.js} +3 -3
  47. package/dist/chunks/{chunk-DJCBJ4D2.js → chunk-DWSATEAY.js} +2 -2
  48. package/dist/chunks/{chunk-ZGL3HYDE.js → chunk-EKFNDKPO.js} +3 -3
  49. package/dist/chunks/{chunk-KONYGNG6.js → chunk-EUBCYTOK.js} +3 -152
  50. package/dist/chunks/chunk-EUBCYTOK.js.map +6 -0
  51. package/dist/chunks/{chunk-LNANLHGE.js → chunk-FBY4LGL7.js} +3 -3
  52. package/dist/chunks/chunk-G6LK7V7F.js +440 -0
  53. package/dist/chunks/chunk-G6LK7V7F.js.map +6 -0
  54. package/dist/chunks/{chunk-XRLM7PL2.js → chunk-GDVYFXOR.js} +12 -12
  55. package/dist/chunks/{chunk-P5GCOEET.js → chunk-GTWNJ7GL.js} +4 -4
  56. package/dist/chunks/{chunk-UJ7NTALX.js → chunk-HBDBVQ3R.js} +12 -12
  57. package/dist/chunks/{chunk-BTSYFCBK.js → chunk-HLYTSH5W.js} +2 -2
  58. package/dist/chunks/{chunk-TAWI7GF2.js → chunk-HPLVGTBH.js} +2 -2
  59. package/dist/chunks/{chunk-FCM3BH55.js → chunk-I7LUF577.js} +11 -5
  60. package/dist/chunks/chunk-I7LUF577.js.map +6 -0
  61. package/dist/chunks/{chunk-KG5YQMJ7.js → chunk-IAL3F2OI.js} +8 -8
  62. package/dist/chunks/{chunk-KYEHKRUB.js → chunk-ILTHOMHL.js} +4 -4
  63. package/dist/chunks/{chunk-EEDZOGV4.js → chunk-IYUW2RAA.js} +27 -2
  64. package/dist/chunks/chunk-IYUW2RAA.js.map +6 -0
  65. package/dist/chunks/{chunk-CWFDC3IX.js → chunk-JAHVXTO4.js} +2 -2
  66. package/dist/chunks/{chunk-L4M6ZSF6.js → chunk-KKYIGLKI.js} +4 -4
  67. package/dist/chunks/{chunk-A2PPMNCN.js → chunk-KOYEUNX7.js} +5 -5
  68. package/dist/chunks/{chunk-S7HFDW5W.js → chunk-KWRJTEV5.js} +3 -3
  69. package/dist/chunks/{chunk-EWD65LWA.js → chunk-L2GX4GAQ.js} +2 -2
  70. package/dist/chunks/{chunk-M3TJHQF7.js → chunk-LFI6O7WL.js} +5 -5
  71. package/dist/chunks/{chunk-6E2F73CY.js → chunk-LM3W6AEK.js} +2 -2
  72. package/dist/chunks/{chunk-IYPP6HSK.js → chunk-O2B3B2TM.js} +1 -6
  73. package/dist/chunks/chunk-O2B3B2TM.js.map +6 -0
  74. package/dist/chunks/{chunk-DEYB7GQW.js → chunk-O3L5C2WT.js} +2 -2
  75. package/dist/chunks/{chunk-AJMJHLWZ.js → chunk-PXKXXNFU.js} +2 -2
  76. package/dist/chunks/{chunk-KVYTZCCO.js → chunk-QPEGCKRA.js} +2 -2
  77. package/dist/chunks/{chunk-TQ2PH66J.js → chunk-R7XQP4PZ.js} +3 -3
  78. package/dist/chunks/{chunk-COI6QKBD.js → chunk-RAS4ZA5C.js} +5 -5
  79. package/dist/chunks/chunk-RLMKDLGK.js +3604 -0
  80. package/dist/chunks/chunk-RLMKDLGK.js.map +6 -0
  81. package/dist/chunks/{chunk-FZZU6FGO.js → chunk-RVNLS4BN.js} +2 -2
  82. package/dist/chunks/{chunk-DQIPEDOM.js → chunk-RVSGU3JS.js} +2 -2
  83. package/dist/chunks/{chunk-MD7SYK6K.js → chunk-SOE4Q55L.js} +2 -2
  84. package/dist/chunks/{chunk-2ZRQG2PH.js → chunk-SUDXOGE6.js} +29 -29
  85. package/dist/chunks/{chunk-DK6MIKJ5.js → chunk-T6INV7EZ.js} +7 -7
  86. package/dist/chunks/{chunk-AZCFI7C6.js → chunk-TTDBVPB2.js} +4240 -3641
  87. package/dist/chunks/chunk-TTDBVPB2.js.map +6 -0
  88. package/dist/chunks/{chunk-OIRKBC2L.js → chunk-U5KONGAN.js} +3 -3
  89. package/dist/chunks/{chunk-RGCA3YZA.js → chunk-U5PL5D27.js} +3 -3
  90. package/dist/chunks/{chunk-AXCOWIIH.js → chunk-U5UV2YRE.js} +2 -139
  91. package/dist/chunks/chunk-U5UV2YRE.js.map +6 -0
  92. package/dist/chunks/{chunk-65L26A6S.js → chunk-WYULBUCG.js} +4 -4
  93. package/dist/chunks/{chunk-AWDFNOGP.js → chunk-X54VNEWE.js} +2 -2
  94. package/dist/chunks/{chunk-VPDXH3ZZ.js → chunk-XDGIOXTU.js} +156 -3
  95. package/dist/chunks/chunk-XDGIOXTU.js.map +6 -0
  96. package/dist/chunks/{chunk-Q733LA67.js → chunk-XLGTH7JD.js} +4 -4
  97. package/dist/chunks/chunk-XPS3W7FC.js +147 -0
  98. package/dist/chunks/chunk-XPS3W7FC.js.map +6 -0
  99. package/dist/chunks/chunk-XSCT3DLE.js +161 -0
  100. package/dist/chunks/chunk-XSCT3DLE.js.map +6 -0
  101. package/dist/chunks/{chunk-52NW6KXV.js → chunk-YTEGBYGL.js} +4 -4
  102. package/dist/chunks/{chunk-U4A4C4GE.js → chunk-ZPIHARMI.js} +4 -4
  103. package/dist/chunks/{cli-runtime-KFHNZS4M.js → cli-runtime-YD7OZGEU.js} +16 -14
  104. package/dist/chunks/cli-runtime-YD7OZGEU.js.map +6 -0
  105. package/dist/chunks/{commands-7FSE67S7.js → commands-5P4RLRXG.js} +5 -5
  106. package/dist/chunks/{crash-report-5S6I2H4P.js → crash-report-F5G32A7S.js} +9 -8
  107. package/dist/chunks/{dist-BMP4NVQA.js → dist-6O3HSFZP.js} +2 -2
  108. package/dist/chunks/{dist-VMJECBAZ.js → dist-7B6PZO7C.js} +2 -2
  109. package/dist/chunks/{dist-ZHD7MSXC.js → dist-DFLFYX3A.js} +2 -2
  110. package/dist/chunks/{dist-MLM3PBXB.js → dist-SX66KAH4.js} +2 -2
  111. package/dist/chunks/{dist-KGS4QDJL.js → dist-WB355CNL.js} +44 -16
  112. package/dist/chunks/dist-WB355CNL.js.map +6 -0
  113. package/dist/chunks/{dist-2QEEO2BO.js → dist-Y6SGSSMO.js} +2 -2
  114. package/dist/chunks/{dist-EC2S5MA6.js → dist-ZAGIMP7N.js} +2 -2
  115. package/dist/chunks/{doctor-P67RCEDL.js → doctor-2AOB47IO.js} +8 -8
  116. package/dist/chunks/{drain-GXTL5M2V.js → drain-M6AGCMJX.js} +10 -10
  117. package/dist/chunks/{eval-TGCAUXM6.js → eval-YHY3VO7B.js} +2 -2
  118. package/dist/chunks/{exec-KGTWE4LA.js → exec-KCISQ4M7.js} +33 -28
  119. package/dist/chunks/exec-KCISQ4M7.js.map +6 -0
  120. package/dist/chunks/{home-PZO47UU7.js → home-AC5LQKDR.js} +3 -3
  121. package/dist/chunks/{host-queries-QOFBCKMJ.js → host-queries-YQVRKUWC.js} +14 -14
  122. package/dist/chunks/{lifecycle-DPH2KOCH.js → lifecycle-CQXCTLAZ.js} +28 -26
  123. package/dist/chunks/{list-ILFBHQS7.js → list-LNKKJZSZ.js} +16 -14
  124. package/dist/chunks/list-LNKKJZSZ.js.map +6 -0
  125. package/dist/chunks/{login-EUEB5HLK.js → login-YA652CIL.js} +8 -8
  126. package/dist/chunks/{logs-F2II4CCT.js → logs-2PREHSOD.js} +4 -4
  127. package/dist/chunks/{mcp-KPJ7KVE4.js → mcp-WJB2UVQW.js} +21 -19
  128. package/dist/chunks/mcp-WJB2UVQW.js.map +6 -0
  129. package/dist/chunks/{message-command-I3J5NA35.js → message-command-IXUASFZO.js} +37 -36
  130. package/dist/chunks/message-command-IXUASFZO.js.map +6 -0
  131. package/dist/chunks/{operator-tools-2SI6AFFF.js → operator-tools-QOZZZVEC.js} +12 -12
  132. package/dist/chunks/{output-schema-PJNYSOO5.js → output-schema-JTPOC3NL.js} +3 -3
  133. package/dist/chunks/{pal-7ILZQGYB.js → pal-FNSNP47Q.js} +13 -12
  134. package/dist/chunks/pal-FNSNP47Q.js.map +6 -0
  135. package/dist/chunks/{providers-MD4HAS6J.js → providers-M5HWW7DH.js} +6 -6
  136. package/dist/chunks/{resident-HVI3YGHH.js → resident-R2RCAHYR.js} +24 -22
  137. package/dist/chunks/resident-R2RCAHYR.js.map +6 -0
  138. package/dist/chunks/resume-UKK4HVCO.js +22 -0
  139. package/dist/chunks/{resume-command-EVY3VMMM.js → resume-command-LPN33FIF.js} +6 -5
  140. package/dist/chunks/{schedule-QCGOB5T2.js → schedule-J2IY3SVE.js} +8 -8
  141. package/dist/chunks/{service-MVQA56RE.js → service-LEAVOYGP.js} +27 -25
  142. package/dist/chunks/service-LEAVOYGP.js.map +6 -0
  143. package/dist/chunks/session-step-2B46NVE7.js +30 -0
  144. package/dist/chunks/{skills-MTR3YGWW.js → skills-X2V3TNTK.js} +10 -9
  145. package/dist/chunks/skills-X2V3TNTK.js.map +6 -0
  146. package/dist/chunks/{state-5GSLSGR2.js → state-VDTYWZ5S.js} +4 -3
  147. package/dist/chunks/state-VDTYWZ5S.js.map +6 -0
  148. package/dist/chunks/{store-P2I5OF2S.js → store-C27Q22UV.js} +4 -4
  149. package/dist/chunks/{store-SQUUV4YQ.js → store-DRPRQLDD.js} +9 -9
  150. package/dist/chunks/{store-UMSGE2UE.js → store-S4QRR5DH.js} +6 -6
  151. package/dist/chunks/{tui-5EKXXN5S.js → tui-RU6CRMLX.js} +13396 -11956
  152. package/dist/chunks/tui-RU6CRMLX.js.map +6 -0
  153. package/dist/chunks/{upgrade-OZE2Z2OV.js → upgrade-I2GMLDWZ.js} +3 -4
  154. package/dist/chunks/upgrade-I2GMLDWZ.js.map +6 -0
  155. package/dist/chunks/{worktree-452AXJPV.js → worktree-F632OJNE.js} +13 -12
  156. package/dist/chunks/worktree-F632OJNE.js.map +6 -0
  157. package/dist/config/load.d.ts +6 -1
  158. package/dist/config/load.d.ts.map +1 -1
  159. package/dist/config/schema.d.ts +45 -0
  160. package/dist/config/schema.d.ts.map +1 -1
  161. package/dist/config/user-config.d.ts.map +1 -1
  162. package/dist/index.js +16 -14
  163. package/dist/integrations/compaction/idle-compaction.d.ts +84 -0
  164. package/dist/integrations/compaction/idle-compaction.d.ts.map +1 -0
  165. package/dist/integrations/providers/prompt-cache-ttl.d.ts +14 -0
  166. package/dist/integrations/providers/prompt-cache-ttl.d.ts.map +1 -0
  167. package/dist/integrations/resident/runner-worker.js +20 -19
  168. package/dist/integrations/resident/runner-worker.js.map +1 -1
  169. package/dist/integrations/sessions/recap.d.ts +56 -0
  170. package/dist/integrations/sessions/recap.d.ts.map +1 -0
  171. package/dist/integrations/sessions/store.d.ts +7 -1
  172. package/dist/integrations/sessions/store.d.ts.map +1 -1
  173. package/dist/integrations/subagents/runtime.d.ts.map +1 -1
  174. package/dist/memory/typed.d.ts +11 -0
  175. package/dist/memory/typed.d.ts.map +1 -1
  176. package/dist/tui/App.d.ts +17 -1
  177. package/dist/tui/App.d.ts.map +1 -1
  178. package/dist/tui/BrandHeader.d.ts.map +1 -1
  179. package/dist/tui/Checklist.d.ts +2 -0
  180. package/dist/tui/Checklist.d.ts.map +1 -1
  181. package/dist/tui/ChoicePicker.d.ts +4 -1
  182. package/dist/tui/ChoicePicker.d.ts.map +1 -1
  183. package/dist/tui/Composer.d.ts +15 -3
  184. package/dist/tui/Composer.d.ts.map +1 -1
  185. package/dist/tui/ComposerFrame.d.ts.map +1 -1
  186. package/dist/tui/ContextGridRow.d.ts +6 -0
  187. package/dist/tui/ContextGridRow.d.ts.map +1 -0
  188. package/dist/tui/LiveActivity.d.ts +9 -1
  189. package/dist/tui/LiveActivity.d.ts.map +1 -1
  190. package/dist/tui/Markdown.d.ts.map +1 -1
  191. package/dist/tui/ReadSearchGroup.d.ts +14 -0
  192. package/dist/tui/ReadSearchGroup.d.ts.map +1 -0
  193. package/dist/tui/RewindPicker.d.ts +14 -0
  194. package/dist/tui/RewindPicker.d.ts.map +1 -0
  195. package/dist/tui/StatusBar.d.ts +31 -12
  196. package/dist/tui/StatusBar.d.ts.map +1 -1
  197. package/dist/tui/ThemeSample.d.ts +5 -0
  198. package/dist/tui/ThemeSample.d.ts.map +1 -0
  199. package/dist/tui/Transcript.d.ts +13 -0
  200. package/dist/tui/Transcript.d.ts.map +1 -1
  201. package/dist/tui/TranscriptScreen.d.ts +24 -0
  202. package/dist/tui/TranscriptScreen.d.ts.map +1 -0
  203. package/dist/tui/agent-transcript-rows.d.ts.map +1 -1
  204. package/dist/tui/agent-view-commands.d.ts.map +1 -1
  205. package/dist/tui/agent.d.ts +62 -1
  206. package/dist/tui/agent.d.ts.map +1 -1
  207. package/dist/tui/away-recap.d.ts +73 -0
  208. package/dist/tui/away-recap.d.ts.map +1 -0
  209. package/dist/tui/context-grid.d.ts +121 -0
  210. package/dist/tui/context-grid.d.ts.map +1 -0
  211. package/dist/tui/context-meter.d.ts +9 -0
  212. package/dist/tui/context-meter.d.ts.map +1 -1
  213. package/dist/tui/context-usage.d.ts +70 -0
  214. package/dist/tui/context-usage.d.ts.map +1 -0
  215. package/dist/tui/diff-view.d.ts +1 -1
  216. package/dist/tui/edit-prompts.d.ts.map +1 -1
  217. package/dist/tui/focus-reporting.d.ts +45 -0
  218. package/dist/tui/focus-reporting.d.ts.map +1 -0
  219. package/dist/tui/group-rows.d.ts +10 -0
  220. package/dist/tui/group-rows.d.ts.map +1 -0
  221. package/dist/tui/index.d.ts.map +1 -1
  222. package/dist/tui/live-window.d.ts +5 -8
  223. package/dist/tui/live-window.d.ts.map +1 -1
  224. package/dist/tui/logo.d.ts +0 -1
  225. package/dist/tui/logo.d.ts.map +1 -1
  226. package/dist/tui/motion.d.ts +14 -0
  227. package/dist/tui/motion.d.ts.map +1 -0
  228. package/dist/tui/next-task.d.ts +11 -0
  229. package/dist/tui/next-task.d.ts.map +1 -0
  230. package/dist/tui/notifications.d.ts +69 -0
  231. package/dist/tui/notifications.d.ts.map +1 -0
  232. package/dist/tui/plain-interruption.d.ts +1 -1
  233. package/dist/tui/plain-interruption.d.ts.map +1 -1
  234. package/dist/tui/read-search-group.d.ts +97 -0
  235. package/dist/tui/read-search-group.d.ts.map +1 -0
  236. package/dist/tui/recap-setting.d.ts +36 -0
  237. package/dist/tui/recap-setting.d.ts.map +1 -0
  238. package/dist/tui/recap-turns.d.ts +13 -0
  239. package/dist/tui/recap-turns.d.ts.map +1 -0
  240. package/dist/tui/restored-rows.d.ts.map +1 -1
  241. package/dist/tui/rewind.d.ts +142 -0
  242. package/dist/tui/rewind.d.ts.map +1 -0
  243. package/dist/tui/slashCommands.d.ts +45 -0
  244. package/dist/tui/slashCommands.d.ts.map +1 -1
  245. package/dist/tui/spinner-tips-setting.d.ts +10 -0
  246. package/dist/tui/spinner-tips-setting.d.ts.map +1 -0
  247. package/dist/tui/spinner-tips.d.ts +39 -0
  248. package/dist/tui/spinner-tips.d.ts.map +1 -0
  249. package/dist/tui/stale-history-retry.d.ts +17 -0
  250. package/dist/tui/stale-history-retry.d.ts.map +1 -0
  251. package/dist/tui/system-rows.d.ts +4 -0
  252. package/dist/tui/system-rows.d.ts.map +1 -1
  253. package/dist/tui/terminal-display.d.ts +7 -0
  254. package/dist/tui/terminal-display.d.ts.map +1 -1
  255. package/dist/tui/terminal-focus.d.ts +29 -0
  256. package/dist/tui/terminal-focus.d.ts.map +1 -0
  257. package/dist/tui/terminal-title.d.ts +19 -0
  258. package/dist/tui/terminal-title.d.ts.map +1 -1
  259. package/dist/tui/theme-command.d.ts +20 -0
  260. package/dist/tui/theme-command.d.ts.map +1 -0
  261. package/dist/tui/theme-detect.d.ts +41 -0
  262. package/dist/tui/theme-detect.d.ts.map +1 -0
  263. package/dist/tui/theme-launch.d.ts +16 -0
  264. package/dist/tui/theme-launch.d.ts.map +1 -0
  265. package/dist/tui/theme-palettes.d.ts +121 -0
  266. package/dist/tui/theme-palettes.d.ts.map +1 -0
  267. package/dist/tui/theme-store.d.ts +35 -0
  268. package/dist/tui/theme-store.d.ts.map +1 -0
  269. package/dist/tui/theme.d.ts +35 -64
  270. package/dist/tui/theme.d.ts.map +1 -1
  271. package/dist/tui/tidy-tool-output.d.ts +17 -0
  272. package/dist/tui/tidy-tool-output.d.ts.map +1 -1
  273. package/dist/tui/tip-history.d.ts +25 -0
  274. package/dist/tui/tip-history.d.ts.map +1 -0
  275. package/dist/tui/title-frame.d.ts +7 -0
  276. package/dist/tui/title-frame.d.ts.map +1 -0
  277. package/dist/tui/tool-end-rows.d.ts +4 -1
  278. package/dist/tui/tool-end-rows.d.ts.map +1 -1
  279. package/dist/tui/tool-failure-text.d.ts.map +1 -1
  280. package/dist/tui/transcript-screen.d.ts +31 -0
  281. package/dist/tui/transcript-screen.d.ts.map +1 -0
  282. package/dist/tui/transcript-scroll.d.ts.map +1 -1
  283. package/dist/tui/types.d.ts +26 -1
  284. package/dist/tui/types.d.ts.map +1 -1
  285. package/dist/tui/update-notice.d.ts +12 -0
  286. package/dist/tui/update-notice.d.ts.map +1 -0
  287. package/dist/tui/use-idle-compaction.d.ts +29 -0
  288. package/dist/tui/use-idle-compaction.d.ts.map +1 -0
  289. package/dist/tui/use-spinner-tip.d.ts +23 -0
  290. package/dist/tui/use-spinner-tip.d.ts.map +1 -0
  291. package/dist/tui/useNotifications.d.ts +14 -0
  292. package/dist/tui/useNotifications.d.ts.map +1 -0
  293. package/dist/tui/useReadSearchGroup.d.ts +21 -0
  294. package/dist/tui/useReadSearchGroup.d.ts.map +1 -0
  295. package/package.json +8 -8
  296. package/skills/browser-automation/SKILL.md +2 -2
  297. package/skills/schedule-task/SKILL.md +7 -7
  298. package/skills/skill-creator/SKILL.md +1 -1
  299. package/dist/chunks/acp-OOJ6EBDV.js.map +0 -6
  300. package/dist/chunks/activity-command-H7YPFJXX.js.map +0 -6
  301. package/dist/chunks/add-E46I4MLS.js.map +0 -6
  302. package/dist/chunks/agent-session-V7NDZWPF.js +0 -53
  303. package/dist/chunks/archive-FWKUN3JD.js.map +0 -6
  304. package/dist/chunks/bin-main-YOWKMTAT.js.map +0 -6
  305. package/dist/chunks/chunk-AXCOWIIH.js.map +0 -6
  306. package/dist/chunks/chunk-AZCFI7C6.js.map +0 -6
  307. package/dist/chunks/chunk-BD7DGINR.js.map +0 -6
  308. package/dist/chunks/chunk-BVUYBGWV.js +0 -1796
  309. package/dist/chunks/chunk-BVUYBGWV.js.map +0 -6
  310. package/dist/chunks/chunk-CDYUGK7F.js +0 -70
  311. package/dist/chunks/chunk-CDYUGK7F.js.map +0 -6
  312. package/dist/chunks/chunk-EEDZOGV4.js.map +0 -6
  313. package/dist/chunks/chunk-FCM3BH55.js.map +0 -6
  314. package/dist/chunks/chunk-IYPP6HSK.js.map +0 -6
  315. package/dist/chunks/chunk-KONYGNG6.js.map +0 -6
  316. package/dist/chunks/chunk-QGU3QOXI.js +0 -111
  317. package/dist/chunks/chunk-QGU3QOXI.js.map +0 -6
  318. package/dist/chunks/chunk-RKMGVFLZ.js.map +0 -6
  319. package/dist/chunks/chunk-VPDXH3ZZ.js.map +0 -6
  320. package/dist/chunks/cli-runtime-KFHNZS4M.js.map +0 -6
  321. package/dist/chunks/dist-KGS4QDJL.js.map +0 -6
  322. package/dist/chunks/exec-KGTWE4LA.js.map +0 -6
  323. package/dist/chunks/list-ILFBHQS7.js.map +0 -6
  324. package/dist/chunks/mcp-KPJ7KVE4.js.map +0 -6
  325. package/dist/chunks/message-command-I3J5NA35.js.map +0 -6
  326. package/dist/chunks/pal-7ILZQGYB.js.map +0 -6
  327. package/dist/chunks/resident-HVI3YGHH.js.map +0 -6
  328. package/dist/chunks/resume-R2OYMKYY.js +0 -22
  329. package/dist/chunks/service-MVQA56RE.js.map +0 -6
  330. package/dist/chunks/session-step-XAOTLL4U.js +0 -29
  331. package/dist/chunks/skills-MTR3YGWW.js.map +0 -6
  332. package/dist/chunks/state-5GSLSGR2.js.map +0 -6
  333. package/dist/chunks/tui-5EKXXN5S.js.map +0 -6
  334. package/dist/chunks/upgrade-OZE2Z2OV.js.map +0 -6
  335. package/dist/chunks/worktree-452AXJPV.js.map +0 -6
  336. package/dist/tui/EditPromptPicker.d.ts +0 -8
  337. package/dist/tui/EditPromptPicker.d.ts.map +0 -1
  338. package/dist/tui/ToolOutputViewer.d.ts +0 -11
  339. package/dist/tui/ToolOutputViewer.d.ts.map +0 -1
  340. /package/dist/chunks/{agent-A3IFU43K.js.map → agent-PPQJZWBO.js.map} +0 -0
  341. /package/dist/chunks/{agent-session-V7NDZWPF.js.map → agent-session-PISYPFO2.js.map} +0 -0
  342. /package/dist/chunks/{browser-ZISCIIZG.js.map → browser-EUFWHKYD.js.map} +0 -0
  343. /package/dist/chunks/{chat-JNYLC4XC.js.map → chat-QDWGHEEL.js.map} +0 -0
  344. /package/dist/chunks/{chunk-D24BFQ2R.js.map → chunk-2I3Z65TV.js.map} +0 -0
  345. /package/dist/chunks/{chunk-62GB6STC.js.map → chunk-4HUZHYCY.js.map} +0 -0
  346. /package/dist/chunks/{chunk-2SPJH5HF.js.map → chunk-53GEER6F.js.map} +0 -0
  347. /package/dist/chunks/{chunk-7T6O6HZO.js.map → chunk-5HSG2XFD.js.map} +0 -0
  348. /package/dist/chunks/{chunk-JPWIGZJ4.js.map → chunk-6PAE7AWD.js.map} +0 -0
  349. /package/dist/chunks/{chunk-SN4RRU3A.js.map → chunk-6UDJ3PVE.js.map} +0 -0
  350. /package/dist/chunks/{chunk-D57LFZYV.js.map → chunk-73G5WDGM.js.map} +0 -0
  351. /package/dist/chunks/{chunk-JBI7VU5W.js.map → chunk-AHPIP5IE.js.map} +0 -0
  352. /package/dist/chunks/{chunk-FEANPQH4.js.map → chunk-AUFSSABF.js.map} +0 -0
  353. /package/dist/chunks/{chunk-5ED3H3C7.js.map → chunk-BJNHDKU6.js.map} +0 -0
  354. /package/dist/chunks/{chunk-5Y3XJ2QD.js.map → chunk-BZ4U5L7N.js.map} +0 -0
  355. /package/dist/chunks/{chunk-XJMHPZGJ.js.map → chunk-BZJNXGWW.js.map} +0 -0
  356. /package/dist/chunks/{chunk-K2WHGUA7.js.map → chunk-C3APHRQB.js.map} +0 -0
  357. /package/dist/chunks/{chunk-5WZ63LBF.js.map → chunk-C3ZJQLUX.js.map} +0 -0
  358. /package/dist/chunks/{chunk-J3JUC6J6.js.map → chunk-C723P7SP.js.map} +0 -0
  359. /package/dist/chunks/{chunk-YN5PDLFB.js.map → chunk-DGV5W2BU.js.map} +0 -0
  360. /package/dist/chunks/{chunk-DJCBJ4D2.js.map → chunk-DWSATEAY.js.map} +0 -0
  361. /package/dist/chunks/{chunk-ZGL3HYDE.js.map → chunk-EKFNDKPO.js.map} +0 -0
  362. /package/dist/chunks/{chunk-LNANLHGE.js.map → chunk-FBY4LGL7.js.map} +0 -0
  363. /package/dist/chunks/{chunk-XRLM7PL2.js.map → chunk-GDVYFXOR.js.map} +0 -0
  364. /package/dist/chunks/{chunk-P5GCOEET.js.map → chunk-GTWNJ7GL.js.map} +0 -0
  365. /package/dist/chunks/{chunk-UJ7NTALX.js.map → chunk-HBDBVQ3R.js.map} +0 -0
  366. /package/dist/chunks/{chunk-BTSYFCBK.js.map → chunk-HLYTSH5W.js.map} +0 -0
  367. /package/dist/chunks/{chunk-TAWI7GF2.js.map → chunk-HPLVGTBH.js.map} +0 -0
  368. /package/dist/chunks/{chunk-KG5YQMJ7.js.map → chunk-IAL3F2OI.js.map} +0 -0
  369. /package/dist/chunks/{chunk-KYEHKRUB.js.map → chunk-ILTHOMHL.js.map} +0 -0
  370. /package/dist/chunks/{chunk-CWFDC3IX.js.map → chunk-JAHVXTO4.js.map} +0 -0
  371. /package/dist/chunks/{chunk-L4M6ZSF6.js.map → chunk-KKYIGLKI.js.map} +0 -0
  372. /package/dist/chunks/{chunk-A2PPMNCN.js.map → chunk-KOYEUNX7.js.map} +0 -0
  373. /package/dist/chunks/{chunk-S7HFDW5W.js.map → chunk-KWRJTEV5.js.map} +0 -0
  374. /package/dist/chunks/{chunk-EWD65LWA.js.map → chunk-L2GX4GAQ.js.map} +0 -0
  375. /package/dist/chunks/{chunk-M3TJHQF7.js.map → chunk-LFI6O7WL.js.map} +0 -0
  376. /package/dist/chunks/{chunk-6E2F73CY.js.map → chunk-LM3W6AEK.js.map} +0 -0
  377. /package/dist/chunks/{chunk-DEYB7GQW.js.map → chunk-O3L5C2WT.js.map} +0 -0
  378. /package/dist/chunks/{chunk-AJMJHLWZ.js.map → chunk-PXKXXNFU.js.map} +0 -0
  379. /package/dist/chunks/{chunk-KVYTZCCO.js.map → chunk-QPEGCKRA.js.map} +0 -0
  380. /package/dist/chunks/{chunk-TQ2PH66J.js.map → chunk-R7XQP4PZ.js.map} +0 -0
  381. /package/dist/chunks/{chunk-COI6QKBD.js.map → chunk-RAS4ZA5C.js.map} +0 -0
  382. /package/dist/chunks/{chunk-FZZU6FGO.js.map → chunk-RVNLS4BN.js.map} +0 -0
  383. /package/dist/chunks/{chunk-DQIPEDOM.js.map → chunk-RVSGU3JS.js.map} +0 -0
  384. /package/dist/chunks/{chunk-MD7SYK6K.js.map → chunk-SOE4Q55L.js.map} +0 -0
  385. /package/dist/chunks/{chunk-2ZRQG2PH.js.map → chunk-SUDXOGE6.js.map} +0 -0
  386. /package/dist/chunks/{chunk-DK6MIKJ5.js.map → chunk-T6INV7EZ.js.map} +0 -0
  387. /package/dist/chunks/{chunk-OIRKBC2L.js.map → chunk-U5KONGAN.js.map} +0 -0
  388. /package/dist/chunks/{chunk-RGCA3YZA.js.map → chunk-U5PL5D27.js.map} +0 -0
  389. /package/dist/chunks/{chunk-65L26A6S.js.map → chunk-WYULBUCG.js.map} +0 -0
  390. /package/dist/chunks/{chunk-AWDFNOGP.js.map → chunk-X54VNEWE.js.map} +0 -0
  391. /package/dist/chunks/{chunk-Q733LA67.js.map → chunk-XLGTH7JD.js.map} +0 -0
  392. /package/dist/chunks/{chunk-52NW6KXV.js.map → chunk-YTEGBYGL.js.map} +0 -0
  393. /package/dist/chunks/{chunk-U4A4C4GE.js.map → chunk-ZPIHARMI.js.map} +0 -0
  394. /package/dist/chunks/{commands-7FSE67S7.js.map → commands-5P4RLRXG.js.map} +0 -0
  395. /package/dist/chunks/{crash-report-5S6I2H4P.js.map → crash-report-F5G32A7S.js.map} +0 -0
  396. /package/dist/chunks/{dist-BMP4NVQA.js.map → dist-6O3HSFZP.js.map} +0 -0
  397. /package/dist/chunks/{dist-VMJECBAZ.js.map → dist-7B6PZO7C.js.map} +0 -0
  398. /package/dist/chunks/{dist-ZHD7MSXC.js.map → dist-DFLFYX3A.js.map} +0 -0
  399. /package/dist/chunks/{dist-MLM3PBXB.js.map → dist-SX66KAH4.js.map} +0 -0
  400. /package/dist/chunks/{dist-2QEEO2BO.js.map → dist-Y6SGSSMO.js.map} +0 -0
  401. /package/dist/chunks/{dist-EC2S5MA6.js.map → dist-ZAGIMP7N.js.map} +0 -0
  402. /package/dist/chunks/{doctor-P67RCEDL.js.map → doctor-2AOB47IO.js.map} +0 -0
  403. /package/dist/chunks/{drain-GXTL5M2V.js.map → drain-M6AGCMJX.js.map} +0 -0
  404. /package/dist/chunks/{eval-TGCAUXM6.js.map → eval-YHY3VO7B.js.map} +0 -0
  405. /package/dist/chunks/{home-PZO47UU7.js.map → home-AC5LQKDR.js.map} +0 -0
  406. /package/dist/chunks/{host-queries-QOFBCKMJ.js.map → host-queries-YQVRKUWC.js.map} +0 -0
  407. /package/dist/chunks/{lifecycle-DPH2KOCH.js.map → lifecycle-CQXCTLAZ.js.map} +0 -0
  408. /package/dist/chunks/{login-EUEB5HLK.js.map → login-YA652CIL.js.map} +0 -0
  409. /package/dist/chunks/{logs-F2II4CCT.js.map → logs-2PREHSOD.js.map} +0 -0
  410. /package/dist/chunks/{operator-tools-2SI6AFFF.js.map → operator-tools-QOZZZVEC.js.map} +0 -0
  411. /package/dist/chunks/{output-schema-PJNYSOO5.js.map → output-schema-JTPOC3NL.js.map} +0 -0
  412. /package/dist/chunks/{providers-MD4HAS6J.js.map → providers-M5HWW7DH.js.map} +0 -0
  413. /package/dist/chunks/{resume-R2OYMKYY.js.map → resume-UKK4HVCO.js.map} +0 -0
  414. /package/dist/chunks/{resume-command-EVY3VMMM.js.map → resume-command-LPN33FIF.js.map} +0 -0
  415. /package/dist/chunks/{schedule-QCGOB5T2.js.map → schedule-J2IY3SVE.js.map} +0 -0
  416. /package/dist/chunks/{session-step-XAOTLL4U.js.map → session-step-2B46NVE7.js.map} +0 -0
  417. /package/dist/chunks/{store-P2I5OF2S.js.map → store-C27Q22UV.js.map} +0 -0
  418. /package/dist/chunks/{store-SQUUV4YQ.js.map → store-DRPRQLDD.js.map} +0 -0
  419. /package/dist/chunks/{store-UMSGE2UE.js.map → store-S4QRR5DH.js.map} +0 -0
@@ -12853,7 +12853,9 @@ var TokenUsageSchema = external_exports.object({
12853
12853
  totalTokens: count,
12854
12854
  cachedTokens: count,
12855
12855
  cacheWriteTokens: count,
12856
- reasoningTokens: count.optional()
12856
+ reasoningTokens: count.optional(),
12857
+ cacheTtlMs: count.optional(),
12858
+ cacheWriteTtlTokens: external_exports.object({ fiveMin: count.optional(), oneHour: count.optional() }).strict().optional()
12857
12859
  }).strict();
12858
12860
  var CostInfoSchema = external_exports.object({
12859
12861
  inputCostPer1M: external_exports.number().nonnegative().optional(),
@@ -13248,7 +13250,7 @@ var DecisionExpiredRecordSchema = inTurn("decision_expired", {
13248
13250
  var CompactionRecordSchema = recordSchema("compaction", {
13249
13251
  compactionId: text2.min(1),
13250
13252
  strategy: text2.min(1),
13251
- trigger: external_exports.enum(["auto", "manual"]),
13253
+ trigger: external_exports.enum(["auto", "manual", "idle"]),
13252
13254
  replacesSeqRange: external_exports.tuple([positive, positive]),
13253
13255
  summary: external_exports.union([external_exports.array(messageBody), spill]),
13254
13256
  keptMessageIds: external_exports.array(messageId2),
@@ -17806,7 +17808,12 @@ ${entries2}
17806
17808
  "namzu.registry.errors": errorMessage,
17807
17809
  "namzu.registry.empty": isEmptyInput
17808
17810
  });
17809
- return { success: false, output: "", error: enrichedMessage };
17811
+ return {
17812
+ success: false,
17813
+ output: "",
17814
+ error: enrichedMessage,
17815
+ facts: { kind: "failure", reason: "invalid_arguments" }
17816
+ };
17810
17817
  }
17811
17818
  };
17812
17819
  function toolSpanIdentity(context2) {
@@ -18314,7 +18321,7 @@ function buildAskUserQuestionTool(config) {
18314
18321
  const { questionParks, pendingAnswers } = config;
18315
18322
  return defineTool({
18316
18323
  name: ASK_USER_QUESTION_TOOL_NAME,
18317
- description: `Ask the user when you are blocked on a decision that is genuinely theirs to make \u2014 one you cannot resolve from their request, your tools, the files you can read, or sensible defaults. The question must be the genuinely undecidable thing in THIS task. Never ask for information a tool can discover (do not ask what you can read, list, or search), never re-ask what the conversation already answers, and never ask meta-questions like "Shall I proceed?" \u2014 plan ratification goes through approve_plan. Provide 2-4 genuinely distinct options derived from the actual context \u2014 concrete paths, never generic placeholders (for example, asked to prepare a presentation, ask "Who is the audience?" with options like Board / Engineering team / Customer); keep labels short (1-5 words) and give each option a one-line description of what practically changes if it is chosen. If you recommend an option, put it FIRST and set recommended: true on it; the host marks it for the user, so never write "(Recommended)" or any translation of it into a label, and never end a label with a parenthesised note (put qualifiers in the description). Set multiSelect: true only when several options can apply at once. An option may carry a preview (plain text or markdown) that the host shows beside the list while it is focused; use it only when seeing the thing helps the choice. A free-text "Something else" escape hatch is always shown automatically \u2014 do not add your own "Other" option. Put the questions in the questions array. Use ONE entry for a single decision. Put several entries in the same call only when they are related decisions that ALL block your next step and the user can answer them together (for example which account, for what purpose, which environment before a credentialed step), at most 4, each with a short unique header; the user answers them all in one card and you get one answer per question. Never batch questions that depend on one another's answers \u2014 ask the first, then decide. Most work needs at most 2-3 questions in all, so prefer proceeding on stated defaults over interrogating the user. Never invent answers or synthetic content on the user's behalf unless they explicitly asked for a random/test scenario. The answers arrive as this tool's result; a question the result says was not answered must not be assumed, and if the result says the user did not answer at all, do not ask again \u2014 proceed on your best judgment without assuming consent.`,
18324
+ description: `Ask the user when you are blocked on a decision that is genuinely theirs to make \u2014 one you cannot resolve from their request, your tools, the files you can read, or sensible defaults. The question must be the genuinely undecidable thing in THIS task. Never ask for information a tool can discover (do not ask what you can read, list, or search), never re-ask what the conversation already answers, and never ask meta-questions like "Shall I proceed?" \u2014 plan ratification goes through approve_plan. Provide 2-4 genuinely distinct options derived from the actual context \u2014 concrete paths, never generic placeholders (for example, asked to prepare a presentation, ask who the audience is, with an option for each plausible audience); keep labels short (1-5 words) and give each option a one-line description of what practically changes if it is chosen. If you recommend an option, put it FIRST and set recommended: true on it; the host marks it for the user, so never write "(Recommended)" or any translation of it into a label, and never end a label with a parenthesised note (put qualifiers in the description). Set multiSelect: true only when several options can apply at once. An option may carry a preview (plain text or markdown) that the host shows beside the list while it is focused; use it only when seeing the thing helps the choice. A free-text "Something else" escape hatch is always shown automatically \u2014 do not add your own "Other" option. Put the questions in the questions array. Use ONE entry for a single decision. Put several entries in the same call only when they are related decisions that ALL block your next step and the user can answer them together (for example which account, for what purpose, which environment before a credentialed step), at most 4, each with a short unique header; the user answers them all in one card and you get one answer per question. Never batch questions that depend on one another's answers \u2014 ask the first, then decide. Most work needs at most 2-3 questions in all, so prefer proceeding on stated defaults over interrogating the user. Never invent answers or synthetic content on the user's behalf unless they explicitly asked for a random/test scenario. The answers arrive as this tool's result; a question the result says was not answered must not be assumed, and if the result says the user did not answer at all, do not ask again \u2014 proceed on your best judgment without assuming consent.`,
18318
18325
  inputSchema: inputSchema2,
18319
18326
  modelInputSchema: structuredClone(askUserQuestionModelInputSchema),
18320
18327
  enforceModelInput: true,
@@ -22299,6 +22306,8 @@ function accumulateTokenUsage(current, addition) {
22299
22306
  // and a turn mixing a reporting driver with a silent one would read as
22300
22307
  // though the silent turns did no thinking.
22301
22308
  ...current.reasoningTokens !== void 0 || addition.reasoningTokens !== void 0 ? { reasoningTokens: (current.reasoningTokens ?? 0) + (addition.reasoningTokens ?? 0) } : {}
22309
+ // `cacheTtlMs` and `cacheWriteTtlTokens` are per-call facts and are
22310
+ // deliberately not carried into a sum.
22302
22311
  };
22303
22312
  }
22304
22313
  __name(accumulateTokenUsage, "accumulateTokenUsage");
@@ -22320,7 +22329,10 @@ function mergeTokenUsage(current, next) {
22320
22329
  totalTokens: Math.max(current.totalTokens, next.totalTokens, promptTokens + completionTokens),
22321
22330
  cachedTokens: Math.max(current.cachedTokens, next.cachedTokens),
22322
22331
  cacheWriteTokens: Math.max(current.cacheWriteTokens, next.cacheWriteTokens),
22323
- ...current.reasoningTokens !== void 0 || next.reasoningTokens !== void 0 ? { reasoningTokens: Math.max(current.reasoningTokens ?? 0, next.reasoningTokens ?? 0) } : {}
22332
+ ...current.reasoningTokens !== void 0 || next.reasoningTokens !== void 0 ? { reasoningTokens: Math.max(current.reasoningTokens ?? 0, next.reasoningTokens ?? 0) } : {},
22333
+ // Frames of one call describe the same cache: the latest report wins.
22334
+ ...next.cacheTtlMs !== void 0 || current.cacheTtlMs !== void 0 ? { cacheTtlMs: next.cacheTtlMs ?? current.cacheTtlMs } : {},
22335
+ ...next.cacheWriteTtlTokens !== void 0 || current.cacheWriteTtlTokens !== void 0 ? { cacheWriteTtlTokens: next.cacheWriteTtlTokens ?? current.cacheWriteTtlTokens } : {}
22324
22336
  };
22325
22337
  }
22326
22338
  __name(mergeTokenUsage, "mergeTokenUsage");
@@ -25320,6 +25332,10 @@ function estimateMessageTokens(message) {
25320
25332
  return Math.ceil(chars / CHARS_PER_TOKEN) + rich;
25321
25333
  }
25322
25334
  __name(estimateMessageTokens, "estimateMessageTokens");
25335
+ function estimateTextTokens(text9) {
25336
+ return Math.ceil(text9.length / CHARS_PER_TOKEN);
25337
+ }
25338
+ __name(estimateTextTokens, "estimateTextTokens");
25323
25339
  function estimateMessagesTokens(messages) {
25324
25340
  return messages.reduce((total, message) => total + estimateMessageTokens(message), 0);
25325
25341
  }
@@ -25679,7 +25695,8 @@ function applyEdit(content, operations) {
25679
25695
  if (!result.success) {
25680
25696
  return {
25681
25697
  success: false,
25682
- error: framedError(result.error, index, operations.length)
25698
+ error: framedError(result.error, index, operations.length),
25699
+ ...result.reason ? { reason: result.reason } : {}
25683
25700
  };
25684
25701
  }
25685
25702
  current = result.content;
@@ -25700,6 +25717,7 @@ function applyOne(content, input) {
25700
25717
  if (resolved2 === null) {
25701
25718
  return {
25702
25719
  success: false,
25720
+ reason: "text_not_found",
25703
25721
  error: "old_string/oldStr not found in file. Make sure the string matches exactly, including whitespace and indentation."
25704
25722
  };
25705
25723
  }
@@ -25727,6 +25745,7 @@ function applyOne(content, input) {
25727
25745
  const secondLine = content.slice(0, secondIndex).split("\n").length;
25728
25746
  return {
25729
25747
  success: false,
25748
+ reason: "not_unique",
25730
25749
  error: `old_string/oldStr is not unique \u2014 found at lines ${lineNumber} and ${secondLine}. Provide more surrounding context to make it unique, or use replace_all: true.`
25731
25750
  };
25732
25751
  }
@@ -26869,7 +26888,12 @@ __name(recordDrift, "recordDrift");
26869
26888
  function admitAgainstRead(context2, key5, content, operations) {
26870
26889
  const tracker = context2.fileReadTracker;
26871
26890
  if (tracker && !tracker.hasRead(key5)) {
26872
- return { success: false, output: "", error: unreadFileError(key5, "edit") };
26891
+ return {
26892
+ success: false,
26893
+ output: "",
26894
+ error: unreadFileError(key5, "edit"),
26895
+ facts: { kind: "failure", reason: "not_read", subject: key5 }
26896
+ };
26873
26897
  }
26874
26898
  const seen = tracker?.fingerprint?.(key5);
26875
26899
  const applied = applyEdit(content, operations);
@@ -26877,7 +26901,12 @@ function admitAgainstRead(context2, key5, content, operations) {
26877
26901
  const recoverable = applied.success && operations.every((o) => o.operation === "replace");
26878
26902
  if (!recoverable) {
26879
26903
  recordDrift(context2, key5);
26880
- return { success: false, output: "", error: staleFileError(key5) };
26904
+ return {
26905
+ success: false,
26906
+ output: "",
26907
+ error: staleFileError(key5),
26908
+ facts: { kind: "failure", reason: "changed_on_disk", subject: key5 }
26909
+ };
26881
26910
  }
26882
26911
  }
26883
26912
  return { success: true, result: applied };
@@ -26900,6 +26929,15 @@ function editFacts(path2, replacements, before, after) {
26900
26929
  };
26901
26930
  }
26902
26931
  __name(editFacts, "editFacts");
26932
+ function refusedEdit(result, path2) {
26933
+ return {
26934
+ success: false,
26935
+ output: "",
26936
+ error: result.error,
26937
+ ...result.reason ? { facts: { kind: "failure", reason: result.reason, subject: path2 } } : {}
26938
+ };
26939
+ }
26940
+ __name(refusedEdit, "refusedEdit");
26903
26941
  var EditTool = defineTool({
26904
26942
  name: "edit",
26905
26943
  description: 'Makes targeted edits to a file using exact string find-and-replace or line insertion. THIS IS THE PREFERRED WAY TO MODIFY AN EXISTING FILE \u2014 never reach for `write` to change a file that already exists, because `write` overwrites the whole body and discards earlier work on partial failure. `edit` keeps the rest of the file byte-for-byte intact and is recoverable: if a single edit fails (old_string/oldStr ambiguous, broader restructuring needed), follow up with another `edit` instead of re-emitting the entire file via `write`. The old_string/oldStr must be unique in the file unless replace_all is true. For insertions, pass insertLine plus new_string/newStr; use insertLine: "end" to extend a file at the end. Self-budget new_string/newStr under 12000 characters before emitting the tool call; use repeated bounded edits for long sections. Preserves file formatting and indentation. To make several changes to ONE file that only make sense together, send them as `edits`: a list of {old_string, new_string} applied in order and committed as one write \u2014 if any of them does not apply, nothing is written and the reply names which one, so the file is never left half-changed.',
@@ -27000,9 +27038,8 @@ var EditTool = defineTool({
27000
27038
  if (!admitted2.success)
27001
27039
  return admitted2;
27002
27040
  const result2 = admitted2.result;
27003
- if (!result2.success) {
27004
- return { success: false, output: "", error: result2.error };
27005
- }
27041
+ if (!result2.success)
27042
+ return refusedEdit(result2, parsed.data.path);
27006
27043
  await context2.sandbox.writeFile(parsed.data.path, result2.content);
27007
27044
  recordEditedContent(context2, parsed.data.path, result2.content);
27008
27045
  const changed2 = editFacts(parsed.data.path, result2.replacements, content2, result2.content);
@@ -27024,7 +27061,7 @@ var EditTool = defineTool({
27024
27061
  return admitted;
27025
27062
  const result = admitted.result;
27026
27063
  if (!result.success)
27027
- return { success: false, output: "", error: result.error };
27064
+ return refusedEdit(result, hostPath);
27028
27065
  await atomicWriteFile2(hostPath, result.content);
27029
27066
  recordEditedContent(context2, hostPath, result.content);
27030
27067
  const changed = editFacts(hostPath, result.replacements, content, result.content);
@@ -27674,7 +27711,7 @@ function enforceReadBeforeOverwrite(context2, key5) {
27674
27711
  success: false,
27675
27712
  output: "",
27676
27713
  error: `${key5} already exists. Use the \`read\` tool on it first in this conversation, then call \`write\` again \u2014 or prefer \`edit\` for a targeted change.`,
27677
- facts: { kind: "failure", reason: "already_exists", subject: key5 }
27714
+ facts: { kind: "failure", reason: "not_read", subject: key5 }
27678
27715
  };
27679
27716
  }
27680
27717
  __name(enforceReadBeforeOverwrite, "enforceReadBeforeOverwrite");
@@ -27685,7 +27722,12 @@ function enforceFreshOverwrite(context2, key5, currentContent) {
27685
27722
  const observed = context2.fileReadTracker?.fingerprint?.(key5);
27686
27723
  if (observed !== void 0 && observed !== fingerprintContent(currentContent)) {
27687
27724
  context2.fileReadTracker?.recordDriftObserved?.(key5);
27688
- return { success: false, output: "", error: staleFileError(key5, "write") };
27725
+ return {
27726
+ success: false,
27727
+ output: "",
27728
+ error: staleFileError(key5, "write"),
27729
+ facts: { kind: "failure", reason: "changed_on_disk", subject: key5 }
27730
+ };
27689
27731
  }
27690
27732
  return null;
27691
27733
  }
@@ -35808,15 +35850,26 @@ var STOP_WORDS = /* @__PURE__ */ new Set([
35808
35850
  "you"
35809
35851
  ]);
35810
35852
  var WORD = /[\p{L}\p{N}_$][\p{L}\p{N}_$.\-/\\:]*/gu;
35853
+ var SEPARATORS = /* @__PURE__ */ new Set([".", "-", "/", "\\", ":"]);
35854
+ function trimSeparators(token) {
35855
+ let start = 0;
35856
+ let end = token.length;
35857
+ while (start < end && SEPARATORS.has(token[start]))
35858
+ start++;
35859
+ while (end > start && SEPARATORS.has(token[end - 1]))
35860
+ end--;
35861
+ return start === 0 && end === token.length ? token : token.slice(start, end);
35862
+ }
35863
+ __name(trimSeparators, "trimSeparators");
35811
35864
  function splitIdentifier(raw) {
35812
- const parts = raw.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2").split(/[_\s]+/).filter((p) => p.length > 0);
35865
+ const parts = raw.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/(?<=[A-Z])(?=[A-Z][a-z])/g, " ").split(/[_\s]+/).filter((p) => p.length > 0);
35813
35866
  return parts.length > 1 ? parts : [];
35814
35867
  }
35815
35868
  __name(splitIdentifier, "splitIdentifier");
35816
35869
  function tokenize2(text9) {
35817
35870
  const out = [];
35818
35871
  for (const match2 of text9.matchAll(WORD)) {
35819
- const raw = match2[0].replace(/^[.\-/\\:]+|[.\-/\\:]+$/g, "");
35872
+ const raw = trimSeparators(match2[0]);
35820
35873
  if (raw.length === 0)
35821
35874
  continue;
35822
35875
  const whole = raw.toLowerCase();
@@ -35853,8 +35906,7 @@ __name(termFrequencies, "termFrequencies");
35853
35906
  // ../sdk/dist/compaction/salience/bm25.js
35854
35907
  var K1 = 1.2;
35855
35908
  var B = 0.75;
35856
- function indexDocument(text9) {
35857
- const tokens = tokenize2(text9);
35909
+ function indexDocument(text9, tokens = tokenize2(text9)) {
35858
35910
  return { tf: termFrequencies(tokens), length: tokens.length };
35859
35911
  }
35860
35912
  __name(indexDocument, "indexDocument");
@@ -35993,7 +36045,7 @@ function scoreMessages(messages, options) {
35993
36045
  const texts = messages.map(messageText);
35994
36046
  const richContent = messages.map(hasRichContent);
35995
36047
  const tokenLists = texts.map(tokenize2);
35996
- const documents = texts.map(indexDocument);
36048
+ const documents = texts.map((text9, i) => indexDocument(text9, tokenLists[i]));
35997
36049
  const index = buildIndex(documents);
35998
36050
  const goalTokens = tokenize2(options.goal);
35999
36051
  const rawRelevance = documents.map((doc) => bm25Score(index, doc, goalTokens));
@@ -41398,6 +41450,12 @@ var IterationOrchestrator = class {
41398
41450
  usage: recorder.tokenUsage,
41399
41451
  budget: recorder.budget?.summary(),
41400
41452
  cost: recorder.costInfo,
41453
+ ...response.usage.cacheTtlMs !== void 0 ? {
41454
+ cache: {
41455
+ ttlMs: response.usage.cacheTtlMs,
41456
+ touched: response.usage.cachedTokens + response.usage.cacheWriteTokens > 0
41457
+ }
41458
+ } : {},
41401
41459
  ...contextFigures
41402
41460
  });
41403
41461
  const assistantMsg = withStreamedMessageIdentity(createAssistantMessage(
@@ -46226,7 +46284,8 @@ function usageAtLeast(current, previous) {
46226
46284
  return true;
46227
46285
  if (current === void 0)
46228
46286
  return false;
46229
- return Object.entries(previous).every(([field2, amount]) => typeof amount !== "number" || (current[field2] ?? 0) >= amount);
46287
+ return Object.entries(previous).every(([field2, amount]) => typeof amount !== "number" || field2 === "cacheTtlMs" || // `cacheTtlMs` is a per-call lifetime, not a running count: it has no order.
46288
+ (current[field2] ?? 0) >= amount);
46230
46289
  }
46231
46290
  __name(usageAtLeast, "usageAtLeast");
46232
46291
 
@@ -48360,7 +48419,10 @@ async function prepareDirectCall(host, toolCall, providerInput = true) {
48360
48419
  input: parsed,
48361
48420
  message,
48362
48421
  isError: true,
48363
- ...providerInput && !repairUsed && preparation.inputFailure ? { inputFailure: preparation.inputFailure } : {}
48422
+ ...providerInput && !repairUsed && preparation.inputFailure ? { inputFailure: preparation.inputFailure } : {},
48423
+ // The registry's typed reason (e.g. invalid arguments) is what a
48424
+ // host keys its short label on; the message alone is wording.
48425
+ ...preparation.result.facts ? { facts: preparation.result.facts } : {}
48364
48426
  };
48365
48427
  }
48366
48428
  const preOutcome = await runPreToolHook(host, toolName, preparation.prepared.input);
@@ -54064,10 +54126,69 @@ async function compactNow(input) {
54064
54126
  });
54065
54127
  }
54066
54128
  __name(compactNow, "compactNow");
54129
+ async function compactRegion(input) {
54130
+ admitManualCompaction(input);
54131
+ const { messages, start, end } = input;
54132
+ if (!Number.isInteger(start) || !Number.isInteger(end) || start < 0 || end > messages.length) {
54133
+ throw new NamzuError({
54134
+ code: "invalid_config",
54135
+ message: `compactRegion: [${start}, ${end}) is not a range inside a history of ${messages.length} messages.`,
54136
+ details: { start, end, length: messages.length },
54137
+ retryable: false
54138
+ });
54139
+ }
54140
+ if (end - start < 1)
54141
+ return null;
54142
+ for (const [label5, index] of [
54143
+ ["start", start],
54144
+ ["end", end]
54145
+ ]) {
54146
+ if (findSafeTrimIndex(messages, index) !== index) {
54147
+ throw new NamzuError({
54148
+ code: "invalid_config",
54149
+ message: `compactRegion: ${label5} index ${index} splits a tool_use/tool_result pair. Move it to a boundary between turns.`,
54150
+ details: { [label5]: index, start, end },
54151
+ retryable: false
54152
+ });
54153
+ }
54154
+ }
54155
+ const retained = findRetainedIndices(messages);
54156
+ const retainedSelected = messages.slice(start, end).filter((_, offset) => retained.has(start + offset));
54157
+ if (end - start - retainedSelected.length - 1 < 1)
54158
+ return null;
54159
+ const manager = new WorkingStateManager(input.config);
54160
+ populateWorkingState(manager, messages.slice(start, end), input.config);
54161
+ let usage = { ...EMPTY_TOKEN_USAGE };
54162
+ const body = await buildVerifiedSummary(manager, messages.slice(start, end), input.provider, input.config, (reported) => {
54163
+ usage = accumulateTokenUsage(usage, reported);
54164
+ }, input.model ?? "", {
54165
+ signal: input.signal,
54166
+ streamIdleTimeoutMs: input.streamIdleTimeoutMs,
54167
+ instructions: input.instructions
54168
+ });
54169
+ const summary2 = { ...buildCompactionMessage(body, input.recoveryNote), retain: true };
54170
+ const out = [...messages.slice(0, start), summary2, ...retainedSelected, ...messages.slice(end)];
54171
+ const dangling = findDanglingMessages(out);
54172
+ if (!dangling.isValid) {
54173
+ throw new NamzuError({
54174
+ code: "invalid_config",
54175
+ message: `compactRegion: summarising [${start}, ${end}) would leave an unmatched tool result. Widen the span to cover the whole exchange.`,
54176
+ details: { start, end },
54177
+ retryable: false
54178
+ });
54179
+ }
54180
+ return publishManualCompaction(input, {
54181
+ messages: out,
54182
+ shed: messages.length - out.length,
54183
+ summary: summary2,
54184
+ usage
54185
+ });
54186
+ }
54187
+ __name(compactRegion, "compactRegion");
54067
54188
 
54068
54189
  // ../sdk/dist/runtime/query/compact-session.js
54069
54190
  async function compactSession(params) {
54070
- const { sessionId: sessionId5, locator = {}, ...input } = params;
54191
+ const { sessionId: sessionId5, locator = {}, trigger = "manual", ...input } = params;
54071
54192
  const log = await locateSessionLog(sessionId5, locator);
54072
54193
  return withSessionLease(log, locator.lease, async (lease) => {
54073
54194
  const active = await log.activeTurn({ lease });
@@ -54095,7 +54216,7 @@ async function compactSession(params) {
54095
54216
  type: "compaction",
54096
54217
  compactionId: generateMessageId(),
54097
54218
  strategy: input.config.strategy,
54098
- trigger: "manual",
54219
+ trigger,
54099
54220
  replacesSeqRange: [1, head2.pointer.seq],
54100
54221
  summary: summary2,
54101
54222
  keptMessageIds,
@@ -54106,6 +54227,66 @@ async function compactSession(params) {
54106
54227
  });
54107
54228
  }
54108
54229
  __name(compactSession, "compactSession");
54230
+ async function compactSessionRange(params) {
54231
+ const { sessionId: sessionId5, locator = {}, from, until, ...input } = params;
54232
+ const log = await locateSessionLog(sessionId5, locator);
54233
+ return withSessionLease(log, locator.lease, async (lease) => {
54234
+ const active = await log.activeTurn({ lease });
54235
+ if (active) {
54236
+ throw new TurnInProgressError({ sessionId: sessionId5, activeTurnId: active.turnId, state: active.state });
54237
+ }
54238
+ const history = await readFoldedHistory(log);
54239
+ const position = /* @__PURE__ */ __name((id3, fallback) => {
54240
+ if (id3 === void 0)
54241
+ return fallback;
54242
+ const at = history.findIndex((entry) => entry.messageId === id3);
54243
+ if (at < 0) {
54244
+ throw new NamzuError({
54245
+ code: "not_found",
54246
+ message: `Message ${id3} is not in session ${sessionId5}'s current context; it may already have been summarised.`,
54247
+ details: { sessionId: sessionId5, messageId: id3 }
54248
+ });
54249
+ }
54250
+ return at;
54251
+ }, "position");
54252
+ const start = position(from, 0);
54253
+ const end = position(until, history.length);
54254
+ const ids = /* @__PURE__ */ new Map();
54255
+ for (const entry of history)
54256
+ if (entry.messageId)
54257
+ ids.set(entry.message, entry.messageId);
54258
+ const result = await compactRegion({
54259
+ ...input,
54260
+ messages: history.map((entry) => entry.message),
54261
+ start,
54262
+ end
54263
+ });
54264
+ if (!result)
54265
+ return null;
54266
+ const head2 = await log.head();
54267
+ if (!head2) {
54268
+ throw new NamzuError({
54269
+ code: "not_found",
54270
+ message: `Session ${sessionId5} has an empty log; there is nothing to compact.`,
54271
+ details: { sessionId: sessionId5 }
54272
+ });
54273
+ }
54274
+ const { summary: summary2, keptMessageIds } = compactionShape(result.messages, ids);
54275
+ await log.append(lease, {
54276
+ type: "compaction",
54277
+ compactionId: generateMessageId(),
54278
+ strategy: input.config.strategy,
54279
+ trigger: "manual",
54280
+ replacesSeqRange: [1, head2.pointer.seq],
54281
+ summary: summary2,
54282
+ keptMessageIds,
54283
+ tokensBefore: 0,
54284
+ tokensAfter: 0
54285
+ });
54286
+ return result;
54287
+ });
54288
+ }
54289
+ __name(compactSessionRange, "compactSessionRange");
54109
54290
  function compactionShape(messages, ids) {
54110
54291
  const order = new Map([...ids.values()].map((id3, index) => [id3, index]));
54111
54292
  const first = messages.findIndex((message) => ids.has(message));
@@ -62245,7 +62426,7 @@ async function resolveMcpEra(input) {
62245
62426
  __name(resolveMcpEra, "resolveMcpEra");
62246
62427
 
62247
62428
  // ../sdk/dist/version.js
62248
- var VERSION2 = "53.2.0";
62429
+ var VERSION2 = "54.0.0";
62249
62430
 
62250
62431
  // ../sdk/dist/connector/mcp/client.js
62251
62432
  var MAX_LIST_PAGES = 100;
@@ -65932,6 +66113,131 @@ function createResidentStepContext(options) {
65932
66113
  }
65933
66114
  __name(createResidentStepContext, "createResidentStepContext");
65934
66115
 
66116
+ // ../sdk/dist/compaction/context-breakdown.js
66117
+ var CONTEXT_CATEGORY_ORDER = [
66118
+ "system-prompt",
66119
+ "system-tools",
66120
+ "mcp-tools",
66121
+ "mcp-instructions",
66122
+ "agents",
66123
+ "memory",
66124
+ "skills",
66125
+ "messages"
66126
+ ];
66127
+ var NAMES = {
66128
+ "system-prompt": "System prompt",
66129
+ "system-tools": "System tools",
66130
+ "mcp-tools": "MCP tools",
66131
+ "mcp-instructions": "MCP server instructions",
66132
+ agents: "Custom agents",
66133
+ memory: "Memory files",
66134
+ skills: "Skills",
66135
+ messages: "Messages"
66136
+ };
66137
+ function describeToolCatalogTokens(tools) {
66138
+ return tools.map((tool) => {
66139
+ let length = 0;
66140
+ try {
66141
+ length = JSON.stringify(tool).length;
66142
+ } catch {
66143
+ }
66144
+ return { name: tool.function.name, tokens: Math.ceil(length / CHARS_PER_TOKEN) };
66145
+ });
66146
+ }
66147
+ __name(describeToolCatalogTokens, "describeToolCatalogTokens");
66148
+ function nonNegative(value) {
66149
+ return value !== void 0 && Number.isFinite(value) && value > 0 ? Math.round(value) : 0;
66150
+ }
66151
+ __name(nonNegative, "nonNegative");
66152
+ function bufferFor(input) {
66153
+ if (input.autoCompact) {
66154
+ if (input.windowSource === "auto")
66155
+ return 0;
66156
+ const reserve = Math.min(input.maxOutputTokens !== void 0 && input.maxOutputTokens > 0 ? input.maxOutputTokens : TRIGGER_OUTPUT_RESERVE_CAP_TOKENS, TRIGGER_OUTPUT_RESERVE_CAP_TOKENS);
66157
+ return reserve + TRIGGER_BUFFER_TOKENS;
66158
+ }
66159
+ return COMPACT_BUFFER_TOKENS;
66160
+ }
66161
+ __name(bufferFor, "bufferFor");
66162
+ var COMPACT_BUFFER_TOKENS = 3e3;
66163
+ function tokensOfContent(message) {
66164
+ return estimateMessageTokens(message);
66165
+ }
66166
+ __name(tokensOfContent, "tokensOfContent");
66167
+ function breakdownMessages(messages) {
66168
+ const toolCallsByType = {};
66169
+ const toolResultsByType = {};
66170
+ const nameOfCall = /* @__PURE__ */ new Map();
66171
+ let assistantTokens = 0;
66172
+ let userTokens = 0;
66173
+ for (const message of messages) {
66174
+ if (message.role === "assistant") {
66175
+ let calls = 0;
66176
+ for (const call2 of message.toolCalls ?? []) {
66177
+ nameOfCall.set(call2.id, call2.function.name);
66178
+ const tokens = estimateTextTokens(call2.function.name + call2.function.arguments);
66179
+ toolCallsByType[call2.function.name] = (toolCallsByType[call2.function.name] ?? 0) + tokens;
66180
+ calls += tokens;
66181
+ }
66182
+ assistantTokens += Math.max(0, tokensOfContent(message) - calls);
66183
+ } else if (message.role === "tool") {
66184
+ const name2 = nameOfCall.get(message.toolCallId) ?? "unknown";
66185
+ toolResultsByType[name2] = (toolResultsByType[name2] ?? 0) + tokensOfContent(message);
66186
+ } else if (message.role === "user") {
66187
+ userTokens += tokensOfContent(message);
66188
+ }
66189
+ }
66190
+ return { toolCallsByType, toolResultsByType, assistantTokens, userTokens };
66191
+ }
66192
+ __name(breakdownMessages, "breakdownMessages");
66193
+ function analyzeContextUsage(input) {
66194
+ const windowTokens = Math.max(0, Math.round(input.windowTokens));
66195
+ const fixed = {
66196
+ "system-prompt": nonNegative(input.systemPromptTokens),
66197
+ "system-tools": nonNegative(input.systemToolTokens),
66198
+ "mcp-tools": nonNegative(input.mcpToolTokens),
66199
+ "mcp-instructions": nonNegative(input.mcpInstructionTokens),
66200
+ agents: nonNegative(input.agentTokens),
66201
+ memory: nonNegative(input.memoryTokens),
66202
+ skills: nonNegative(input.skillTokens),
66203
+ messages: 0
66204
+ };
66205
+ const fixedTotal = Object.values(fixed).reduce((sum, tokens) => sum + tokens, 0);
66206
+ const messages = input.messages ?? [];
66207
+ const bufferTokens = Math.min(bufferFor(input), windowTokens);
66208
+ const measured2 = nonNegative(input.contextTokens);
66209
+ const rawMessages = measured2 > 0 ? Math.max(0, measured2 - fixedTotal) : messages.reduce((sum, message) => sum + tokensOfContent(message), 0);
66210
+ fixed.messages = Math.min(rawMessages, Math.max(0, windowTokens - fixedTotal - bufferTokens));
66211
+ const totalTokens = measured2 > 0 ? Math.max(measured2, fixedTotal) : fixedTotal + rawMessages;
66212
+ const used = fixedTotal + fixed.messages;
66213
+ const categories = [];
66214
+ for (const id3 of CONTEXT_CATEGORY_ORDER) {
66215
+ if (fixed[id3] > 0)
66216
+ categories.push({ id: id3, name: NAMES[id3], tokens: fixed[id3], kind: "used" });
66217
+ }
66218
+ const free = Math.max(0, windowTokens - used - bufferTokens);
66219
+ if (bufferTokens > 0) {
66220
+ categories.push({
66221
+ id: "buffer",
66222
+ name: input.autoCompact ? "Autocompact buffer" : "Compact buffer",
66223
+ tokens: bufferTokens,
66224
+ kind: "buffer"
66225
+ });
66226
+ }
66227
+ categories.push({ id: "free", name: "Free space", tokens: free, kind: "free" });
66228
+ return {
66229
+ categories,
66230
+ windowTokens,
66231
+ totalTokens,
66232
+ percentage: windowTokens > 0 ? Math.round(totalTokens / windowTokens * 100) : 0,
66233
+ bufferTokens,
66234
+ autoCompact: input.autoCompact,
66235
+ overflowTokens: Math.max(0, totalTokens - windowTokens),
66236
+ messageBreakdown: breakdownMessages(messages)
66237
+ };
66238
+ }
66239
+ __name(analyzeContextUsage, "analyzeContextUsage");
66240
+
65935
66241
  // ../sdk/dist/manager/resident/store.js
65936
66242
  import { createHash as createHash24, randomUUID as randomUUID6 } from "node:crypto";
65937
66243
  var text5 = external_exports.string().trim().min(1).max(8e3);
@@ -71736,6 +72042,50 @@ function isReminderMessage(message) {
71736
72042
  }
71737
72043
  __name(isReminderMessage, "isReminderMessage");
71738
72044
 
72045
+ // ../sdk/dist/runtime/cache-clock.js
72046
+ var CacheClock = class {
72047
+ static {
72048
+ __name(this, "CacheClock");
72049
+ }
72050
+ #state = null;
72051
+ /** Record a finished call. `usage` is that call's own usage, not a turn total. */
72052
+ record(usage, at) {
72053
+ if (usage.cacheTtlMs === void 0 || !(usage.cacheTtlMs > 0)) {
72054
+ this.#state = null;
72055
+ return;
72056
+ }
72057
+ const touched = usage.cachedTokens + usage.cacheWriteTokens > 0;
72058
+ this.#state = {
72059
+ lastActivityAt: at,
72060
+ ttlMs: usage.cacheTtlMs,
72061
+ expiresAt: touched ? at + usage.cacheTtlMs : null
72062
+ };
72063
+ }
72064
+ /** Forget everything (the conversation was replaced or its context rewritten). */
72065
+ reset() {
72066
+ this.#state = null;
72067
+ }
72068
+ get state() {
72069
+ return this.#state;
72070
+ }
72071
+ /** Whether the cache is still alive at `now`. False when unknown. */
72072
+ warm(now) {
72073
+ const state = this.#state;
72074
+ return state !== null && state.expiresAt !== null && now < state.expiresAt;
72075
+ }
72076
+ /**
72077
+ * The moment `fraction` of the cache's remaining life since the last
72078
+ * activity has passed: `lastActivityAt + (expiresAt - lastActivityAt) * fraction`.
72079
+ * `null` when the expiry is unknown.
72080
+ */
72081
+ dueAt(fraction) {
72082
+ const state = this.#state;
72083
+ if (state === null || state.expiresAt === null)
72084
+ return null;
72085
+ return state.lastActivityAt + (state.expiresAt - state.lastActivityAt) * fraction;
72086
+ }
72087
+ };
72088
+
71739
72089
  // ../sdk/dist/agents/forward-options.js
71740
72090
  function pickRoutedOptions(options, routes, destination) {
71741
72091
  const picked = {};
@@ -86782,6 +87132,172 @@ function isReadOnlyCommandLine(line, dialect = "bash") {
86782
87132
  }
86783
87133
  __name(isReadOnlyCommandLine, "isReadOnlyCommandLine");
86784
87134
 
87135
+ // ../sdk/dist/tools/builtins/exit-semantics.js
87136
+ var MAX_COMMAND_CHARS = 1e4;
87137
+ var PLAIN_FAILURE = { isError: true };
87138
+ function split(command) {
87139
+ const segments = [];
87140
+ const separators = [];
87141
+ let current = "";
87142
+ let pending2 = "";
87143
+ let quote = null;
87144
+ const push = /* @__PURE__ */ __name(() => {
87145
+ segments.push(current);
87146
+ separators.push(pending2);
87147
+ current = "";
87148
+ }, "push");
87149
+ for (let i = 0; i < command.length; i++) {
87150
+ const ch = command.charAt(i);
87151
+ const next = command.charAt(i + 1);
87152
+ if (quote === "'") {
87153
+ if (ch === "'")
87154
+ quote = null;
87155
+ current += ch;
87156
+ continue;
87157
+ }
87158
+ if (ch === "\\") {
87159
+ current += ch + next;
87160
+ i += 1;
87161
+ continue;
87162
+ }
87163
+ if (ch === "`") {
87164
+ const end = command.indexOf("`", i + 1);
87165
+ if (end === -1)
87166
+ return void 0;
87167
+ current += command.slice(i, end + 1);
87168
+ i = end;
87169
+ continue;
87170
+ }
87171
+ if (ch === "$" && (next === "(" || next === "{")) {
87172
+ const close = next === "(" ? ")" : "}";
87173
+ let depth = 0;
87174
+ let j = i + 1;
87175
+ for (; j < command.length; j++) {
87176
+ const c = command.charAt(j);
87177
+ if (c === next)
87178
+ depth += 1;
87179
+ else if (c === close && --depth === 0)
87180
+ break;
87181
+ }
87182
+ if (j >= command.length)
87183
+ return void 0;
87184
+ current += command.slice(i, j + 1);
87185
+ i = j;
87186
+ continue;
87187
+ }
87188
+ if (quote === '"') {
87189
+ if (ch === '"')
87190
+ quote = null;
87191
+ current += ch;
87192
+ continue;
87193
+ }
87194
+ if (ch === '"' || ch === "'") {
87195
+ quote = ch;
87196
+ current += ch;
87197
+ continue;
87198
+ }
87199
+ if (ch === "(" || ch === ")")
87200
+ return void 0;
87201
+ if (ch === "<" && next === "<" && command.charAt(i + 2) !== "<")
87202
+ return void 0;
87203
+ if (ch === ">" && next === "&") {
87204
+ current += ch + next;
87205
+ i += 1;
87206
+ continue;
87207
+ }
87208
+ if (ch === "&" && command.charAt(i - 1) === ">") {
87209
+ current += ch;
87210
+ continue;
87211
+ }
87212
+ if (ch === "|" || ch === "&" || ch === ";" || ch === "\n") {
87213
+ let sep14 = ch;
87214
+ if ((ch === "|" || ch === "&") && next === ch) {
87215
+ sep14 = ch + ch;
87216
+ i += 1;
87217
+ } else if (ch === "|" && next === "&") {
87218
+ sep14 = "|&";
87219
+ i += 1;
87220
+ }
87221
+ push();
87222
+ pending2 = sep14 === "\n" ? ";" : sep14;
87223
+ continue;
87224
+ }
87225
+ current += ch;
87226
+ }
87227
+ if (quote !== null)
87228
+ return void 0;
87229
+ push();
87230
+ const kept = [];
87231
+ const keptSeparators = [];
87232
+ segments.forEach((segment2, index) => {
87233
+ if (segment2.trim().length === 0)
87234
+ return;
87235
+ kept.push(segment2.trim());
87236
+ keptSeparators.push(separators[index] ?? "");
87237
+ });
87238
+ return kept.length === 0 ? void 0 : { segments: kept, separators: keptSeparators };
87239
+ }
87240
+ __name(split, "split");
87241
+ function followsAndChain(parsed) {
87242
+ let index = parsed.segments.length - 1;
87243
+ while (index > 0 && (parsed.separators[index] === "|" || parsed.separators[index] === "|&")) {
87244
+ index -= 1;
87245
+ }
87246
+ return parsed.separators[index] === "&&";
87247
+ }
87248
+ __name(followsAndChain, "followsAndChain");
87249
+ var NO_MATCHES = "No matches found";
87250
+ var SEARCH_WORDS = /* @__PURE__ */ new Set(["grep", "rg", "egrep", "fgrep"]);
87251
+ function gitSubcommand(words) {
87252
+ if (words[0] !== "git")
87253
+ return void 0;
87254
+ for (let i = 1; i < words.length; i++) {
87255
+ const word2 = words[i];
87256
+ if (word2.startsWith("-")) {
87257
+ if (word2 === "-C" || word2 === "-c")
87258
+ i += 1;
87259
+ continue;
87260
+ }
87261
+ return word2;
87262
+ }
87263
+ return void 0;
87264
+ }
87265
+ __name(gitSubcommand, "gitSubcommand");
87266
+ function questionNote(command) {
87267
+ const words = command.trim().split(/\s+/);
87268
+ const first = words[0] ?? "";
87269
+ if (first === "git") {
87270
+ const sub = gitSubcommand(words);
87271
+ if (sub === "diff")
87272
+ return "Files differ";
87273
+ if (sub === "grep")
87274
+ return NO_MATCHES;
87275
+ return void 0;
87276
+ }
87277
+ if (SEARCH_WORDS.has(first))
87278
+ return NO_MATCHES;
87279
+ if (first === "find")
87280
+ return "Some directories were inaccessible";
87281
+ if (first === "diff")
87282
+ return "Files differ";
87283
+ if (first === "test" || first === "[")
87284
+ return "Condition is false";
87285
+ return void 0;
87286
+ }
87287
+ __name(questionNote, "questionNote");
87288
+ function judgeExit(command, exitCode) {
87289
+ if (exitCode === 0)
87290
+ return { isError: false };
87291
+ if (exitCode !== 1 || command.length > MAX_COMMAND_CHARS)
87292
+ return PLAIN_FAILURE;
87293
+ const parsed = split(command);
87294
+ if (!parsed || followsAndChain(parsed))
87295
+ return PLAIN_FAILURE;
87296
+ const note = questionNote(parsed.segments[parsed.segments.length - 1]);
87297
+ return note === void 0 ? PLAIN_FAILURE : { isError: false, note };
87298
+ }
87299
+ __name(judgeExit, "judgeExit");
87300
+
86785
87301
  // ../sdk/dist/tools/builtins/bash.js
86786
87302
  var DEFAULT_BASH_TIMEOUT_MS = readPositiveIntEnv("NAMZU_BASH_TIMEOUT_MS", 2 * 60 * 1e3);
86787
87303
  var DEFAULT_BASH_MAX_BUFFER_BYTES = readPositiveIntEnv("NAMZU_BASH_MAX_BUFFER_BYTES", 100 * 1024 * 1024);
@@ -87190,20 +87706,24 @@ ${result.stdout}` : "",
87190
87706
  ${result.stderr}` : "",
87191
87707
  clipped2.length > 0 ? `[${clipped2.join(" and ")} was truncated by the sandbox output cap. The omitted output is unavailable in this result. Use a saved artifact or a read-only observation; do not repeat a state-changing action to recover its output.]` : ""
87192
87708
  ].filter(Boolean).join("\n\n");
87709
+ const judged = result.timedOut ? void 0 : judgeExit(input.command, result.exitCode);
87710
+ const answered = judged !== void 0 && !judged.isError;
87193
87711
  return {
87194
- success: !result.timedOut && result.exitCode === 0,
87712
+ success: answered,
87195
87713
  output: output || "(no output)",
87196
87714
  data: {
87197
87715
  exitCode: result.exitCode,
87716
+ ...judged?.note ? { exitNote: judged.note } : {},
87198
87717
  sandboxed: true,
87199
87718
  timedOut: result.timedOut,
87200
87719
  stdoutTruncated: result.stdoutTruncated ?? false,
87201
87720
  stderrTruncated: result.stderrTruncated ?? false
87202
87721
  },
87203
- error: result.timedOut ? `Command timed out after ${input.timeout}ms. Any captured output before the deadline is above.` : result.exitCode !== 0 ? `Command exited with code ${result.exitCode}` : void 0,
87722
+ error: result.timedOut ? `Command timed out after ${input.timeout}ms. Any captured output before the deadline is above.` : !answered ? `Command exited with code ${result.exitCode}` : void 0,
87204
87723
  facts: commandFacts({
87205
87724
  command: input.command,
87206
87725
  exitCode: result.exitCode,
87726
+ ...judged?.note ? { exitNote: judged.note } : {},
87207
87727
  timedOut: result.timedOut,
87208
87728
  stdout: result.stdout,
87209
87729
  stderr: result.stderr
@@ -87272,26 +87792,30 @@ ${result.stderr}` : "",
87272
87792
  failure2.stdoutTruncated ? "stdout" : "",
87273
87793
  failure2.stderrTruncated ? "stderr" : ""
87274
87794
  ].filter(Boolean);
87795
+ const judged = !timedOut && exitCode !== void 0 ? judgeExit(input.command, exitCode) : void 0;
87796
+ const answered = judged !== void 0 && !judged.isError;
87275
87797
  const output = [
87276
87798
  formatShellOutput(failure2.stdout, failure2.stderr),
87277
87799
  clipped2.length > 0 ? `[${clipped2.join(" and ")} ${clipped2.length === 1 ? "was" : "were"} truncated by the host output cap. The omitted output is unavailable in this result.]` : "",
87278
- describeWithheldEnv(inherited.dropped)
87800
+ answered ? "" : describeWithheldEnv(inherited.dropped)
87279
87801
  ].filter(Boolean).join("\n\n");
87280
87802
  return {
87281
- success: false,
87803
+ success: answered,
87282
87804
  output: output || "(no output)",
87283
87805
  data: {
87284
87806
  ...exitCode !== void 0 ? { exitCode } : {},
87807
+ ...judged?.note ? { exitNote: judged.note } : {},
87285
87808
  ...leaveSandbox ? { sandboxed: false, sandboxEscape: true } : {},
87286
87809
  timedOut,
87287
87810
  stdoutTruncated: failure2.stdoutTruncated ?? false,
87288
87811
  stderrTruncated: failure2.stderrTruncated ?? false,
87289
87812
  ...failure2.signal ? { signal: failure2.signal } : {}
87290
87813
  },
87291
- error: timedOut ? `Command timed out after ${input.timeout}ms. Any output it produced before the deadline is above.` : exitCode !== void 0 ? `Command exited with code ${exitCode}` : `Command failed: ${failure2.message}`,
87814
+ error: answered ? void 0 : timedOut ? `Command timed out after ${input.timeout}ms. Any output it produced before the deadline is above.` : exitCode !== void 0 ? `Command exited with code ${exitCode}` : `Command failed: ${failure2.message}`,
87292
87815
  facts: commandFacts({
87293
87816
  command: input.command,
87294
87817
  ...exitCode !== void 0 ? { exitCode } : {},
87818
+ ...judged?.note ? { exitNote: judged.note } : {},
87295
87819
  timedOut,
87296
87820
  ...failure2.signal ? { signal: failure2.signal } : {},
87297
87821
  stdout: failure2.stdout ?? "",
@@ -87313,6 +87837,7 @@ function commandFacts(input) {
87313
87837
  kind: "command",
87314
87838
  command: input.command,
87315
87839
  ...input.exitCode !== void 0 ? { exitCode: input.exitCode } : {},
87840
+ ...input.exitNote ? { exitNote: input.exitNote } : {},
87316
87841
  ...input.timedOut ? { timedOut: true } : {},
87317
87842
  ...input.signal ? { signal: input.signal } : {},
87318
87843
  ...input.stdout && !outBinary ? { stdout: windowText(input.stdout, outBytes) } : {},
@@ -89279,7 +89804,7 @@ var MAX_LISTED_WINDOWS = 50;
89279
89804
  var MAX_UI_SNAPSHOT_CHARS = 14e3;
89280
89805
  function computerUseUnavailableReason(provider, model) {
89281
89806
  if (!resolveProviderCapabilities(provider).supportsToolResultImages) {
89282
- return `The ${provider.id} provider cannot return images in tool results, so the model would never see a screenshot. Use a provider that can (for example Anthropic, Codex or Google) for computer use.`;
89807
+ return `The ${provider.id} provider cannot return images in tool results, so the model would never see a screenshot. Use a provider that can return images in tool results for computer use.`;
89283
89808
  }
89284
89809
  if (model !== void 0 && !modelReadsImages(provider, model)) {
89285
89810
  return `The model ${model} cannot read images, so it would never see a screenshot. Use a model that reads images for computer use.`;
@@ -89580,7 +90105,7 @@ function buildDescription(host, caps, settings) {
89580
90105
  if (available.includes("batch"))
89581
90106
  lines.push(`batch: {"type":"batch","actions":[...]} runs up to ${settings.maxBatchActions} actions in order, stops at the first one that fails, and returns one screenshot at the end. Every call costs a model round trip of several seconds, so put the steps you can already predict into one batch (click a field, type, press ENTER) rather than one call each \u2014 but end the batch at any step that should bring up a new window, and look before typing into it. A batch cannot contain screenshot${available.includes("ui_snapshot") ? ", zoom or ui_snapshot" : " or zoom"}.`);
89582
90107
  if (caps.displayServer === "win32" && available.includes("key") && available.includes("type_text"))
89583
- lines.push("To start a Windows program, a shell command (Start-Process notepad, or cmd.exe /c start calc) is surest when you have a shell tool. The Start menu searches by display names in the system language, and ENTER on a name it does not find opens a web search in the browser.");
90108
+ lines.push("To start a Windows program, a shell command (Start-Process <program>, or cmd.exe /c start <program>) is surest when you have a shell tool. The Start menu searches by display names in the system language, and ENTER on a name it does not find opens a web search in the browser.");
89584
90109
  if (available.includes("list_windows"))
89585
90110
  lines.push("list_windows names the open windows with their ids; focus_window brings one to the front.");
89586
90111
  if (windowCaptureAvailable(host, caps))
@@ -92106,7 +92631,7 @@ function actModelSchema(actions) {
92106
92631
  },
92107
92632
  origin: {
92108
92633
  type: "string",
92109
- description: 'REQUIRED. The origin from the latest snapshot header ("Page: <origin> \u2014 \u2026"), e.g. https://github.com. The call is refused if the page is no longer there.'
92634
+ description: 'REQUIRED. The origin from the latest snapshot header ("Page: <origin> \u2014 \u2026"), e.g. https://example.com. The call is refused if the page is no longer there.'
92110
92635
  },
92111
92636
  ref: { type: "string", description: "Element ref from the latest snapshot, like e12." },
92112
92637
  text: { type: "string" },
@@ -92516,7 +93041,7 @@ __name(createBrowserTools, "createBrowserTools");
92516
93041
  function buildDeleteMemoryTool(store) {
92517
93042
  return defineTool({
92518
93043
  name: "delete_memory",
92519
- description: "Permanently delete a stored memory by ID. Use update_memory with status archived when the record should remain available for inspection. Deletion does not erase past conversation transcripts. Pass the revision from read_memory when available to refuse a stale deletion.",
93044
+ description: "Permanently remove a memory by ID, for one that should not be kept at all. Use update_memory with status archived when the record should stay available to inspect. Past conversation transcripts are not changed. Pass the revision from read_memory when available, so a deletion of a memory that changed since you read it is refused. Returns a confirmation.",
92520
93045
  inputSchema: external_exports.object({
92521
93046
  id: external_exports.string().describe("Memory ID to permanently delete"),
92522
93047
  revision: external_exports.string().min(1).optional().describe("Opaque revision from read_memory; refuse deletion if the record changed")
@@ -92584,7 +93109,7 @@ __name(resolveMemoryReference, "resolveMemoryReference");
92584
93109
  function buildReadMemoryTool(store) {
92585
93110
  return defineTool({
92586
93111
  name: "read_memory",
92587
- description: "Read the full content of a specific memory by its ID or its name. For a text or Markdown memory the result ends with how old the memory is and resolves any [[name]] links it contains.",
93112
+ description: "Read one memory in full by its ID or its name. Use it when the index or a search shows that a memory bears on the task. Returns the memory text; a text or Markdown memory ends with how old it is and the memories its [[name]] links point to.",
92588
93113
  inputSchema: external_exports.object({
92589
93114
  id: external_exports.string().describe("Opaque memory ID returned by a memory search or save, or the memory name from the index")
92590
93115
  }),
@@ -92694,7 +93219,7 @@ __name(buildReadMemoryTool, "buildReadMemoryTool");
92694
93219
 
92695
93220
  // ../sdk/dist/tools/memory/fields.js
92696
93221
  var memoryFieldsSchema = {
92697
- name: external_exports.string().max(MEMORY_NAME_MAX_LENGTH).regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/).optional().describe('Unique kebab-case slug, e.g. "deploys-need-a-changeset"; other memories link to it as [[name]]'),
93222
+ name: external_exports.string().max(MEMORY_NAME_MAX_LENGTH).regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/).optional().describe('Unique kebab-case slug, e.g. "prefers-short-answers"; other memories link to it as [[name]]'),
92698
93223
  description: external_exports.string().max(300).regex(/^[^\r\n]*$/).optional().describe("One line saying what this memory is for, used to decide whether to read it"),
92699
93224
  type: external_exports.enum(["user", "feedback", "project", "reference"]).optional().describe("user, feedback, project or reference; stores that require a type use project when omitted")
92700
93225
  };
@@ -92704,11 +93229,12 @@ function buildSaveMemoryTool(store) {
92704
93229
  return defineTool({
92705
93230
  name: "save_memory",
92706
93231
  description: [
92707
- "Save a new memory for future sessions: something true now that a later session could not work out from the code, the git history or the files themselves. Do not save what those already say.",
92708
- "Choose a type: user (who the user is and how they like to work), feedback (a rule the user gave about how to work), project (a fact or decision about the work), reference (where to look for something).",
93232
+ "Save one memory for later sessions in this project: a single fact that the code, the history and the docs do not already hold.",
93233
+ "Choose a type: user (who the person is and how they like to work), feedback (a rule they gave about how to work), project (a fact or decision about the work), reference (where to look for something).",
92709
93234
  'For feedback and project memories, write the rule or fact first, then a line starting "Why:" and a line starting "How to apply:".',
92710
93235
  "Link a related memory by writing [[its-name]] in the content.",
92711
- "If a memory on this already exists, use update_memory instead: a name another memory holds is refused."
93236
+ "The name must be new: a name another memory holds is refused, and the reply points to update_memory.",
93237
+ "Returns the saved memory's id and name."
92712
93238
  ].join(" "),
92713
93239
  inputSchema: external_exports.object({
92714
93240
  title: external_exports.string().min(1).describe("Short descriptive title"),
@@ -92777,7 +93303,7 @@ var MAX_MEMORY_SCAN = 256;
92777
93303
  function defineSearchMemoryTool(search) {
92778
93304
  return defineTool({
92779
93305
  name: "search_memory",
92780
- description: "Search active stored memories by relevant words or tags. The built-in stores rank matches in names, titles, descriptions, summaries and full content. Built-in search examines at most 256 recent candidates per call; if incomplete, continue with the returned scan_offset. Use read_memory for evidence. Set status to archived to inspect obsolete records.",
93306
+ description: "Find stored memories by words or tags. Use it when the topic is not in the index, before saving (to see whether a memory already covers it), and to reach what earlier turns recorded on their own. Matches are ranked across names, titles, descriptions, summaries and content; one call examines at most 256 recent candidates, and an incomplete result returns a scan_offset to continue from. Set status to archived to look at retired memories. Returns a numbered list with each memory's id, title, type and description; open one with read_memory.",
92781
93307
  inputSchema: external_exports.object({
92782
93308
  query: external_exports.string().optional().describe("Relevant words or identifiers to search"),
92783
93309
  tags: external_exports.array(external_exports.string()).optional().describe("Filter by tags (all must match)"),
@@ -92850,7 +93376,7 @@ __name(buildStoreSearchMemoryTool, "buildStoreSearchMemoryTool");
92850
93376
  function buildUpdateMemoryTool(store) {
92851
93377
  return defineTool({
92852
93378
  name: "update_memory",
92853
- description: "Correct an existing memory in place, or archive an obsolete claim so it is no longer recalled. Prefer this to saving a second memory about the same thing. Identify it by the ID from search_memory or by its name from the memory index; current evidence should determine corrections. Pass the revision from read_memory when available to refuse a stale correction.",
93379
+ description: "Correct a memory in place, or archive one that is no longer true so it stops being recalled. Use it when a memory on the same topic already exists, which keeps the store free of duplicates, and when current evidence shows a memory is wrong. Identify the memory by the ID from search_memory or by its name from the index. Pass the revision from read_memory when available, so a change made since you read it is refused instead of overwritten. Returns the memory as it now stands.",
92854
93380
  inputSchema: external_exports.object({
92855
93381
  id: external_exports.string().describe("Memory ID, or the memory name from the index, to correct or archive"),
92856
93382
  revision: external_exports.string().min(1).optional().describe("Opaque revision from read_memory; refuse the update if the record changed"),
@@ -93057,10 +93583,10 @@ var inputSchema16 = external_exports.object({
93057
93583
  preset: external_exports.enum(["read-only", "edit-in-folder"]).optional().describe("read-only: read/glob/grep/ls only; its bash deny blocks every script. edit-in-folder: also edit and write, bash asks. For a pure script, omit the preset and set rules to {} with unmatched: deny"),
93058
93584
  unmatched: external_exports.enum(["park", "deny"]).describe("A call no rule covers: park (wait for the operator) or deny"),
93059
93585
  execution: external_exports.enum(["host", "sandbox"]).optional().describe("Where commands run; leave unset (this machine) unless the user asked for a sandbox"),
93060
- rules: external_exports.record(external_exports.string(), external_exports.union([EFFECT, external_exports.record(external_exports.string(), EFFECT)])).optional().describe('Extra rules, e.g. {"bash": {"npm test*": "allow"}}'),
93586
+ rules: external_exports.record(external_exports.string(), external_exports.union([EFFECT, external_exports.record(external_exports.string(), EFFECT)])).optional().describe('Extra rules, e.g. {"bash": {"<command> *": "allow"}}'),
93061
93587
  browser: external_exports.object({
93062
93588
  profile: external_exports.string().regex(BROWSER_PROFILE).describe('Browser profile the operator signed in with, e.g. "work"'),
93063
- sites: external_exports.record(external_exports.string(), external_exports.enum(["read", "ask", "act"])).describe('Site to level, e.g. {"https://github.com": "read"}. read: open and read only; ask: changes wait for the operator; act: changes run unasked. Unlisted sites are denied; there is no "*".'),
93589
+ sites: external_exports.record(external_exports.string(), external_exports.enum(["read", "ask", "act"])).describe('Site to level, e.g. {"https://example.com": "read"}. read: open and read only; ask: changes wait for the operator; act: changes run unasked. Unlisted sites are denied; there is no "*".'),
93064
93590
  headed: external_exports.boolean().optional().describe("Show the browser window; default no window")
93065
93591
  }).optional().describe("Browser access; omit for none")
93066
93592
  }).optional().describe('create: REQUIRED explicit permission set; there is no default. For a pure script, use {rules:{}, unmatched:"deny"} without a preset unless you intend deny rules: read-only denies bash and blocks every script. A pure script cannot use a browser grant. update: the whole new set, only when the permissions change'),
@@ -93108,7 +93634,7 @@ function browserGrant(host, proposed) {
93108
93634
  if (entries2.length === 0) {
93109
93635
  return {
93110
93636
  ok: false,
93111
- error: 'permissions.browser.sites is empty; list each site the run may open, e.g. {"https://github.com": "read"}.'
93637
+ error: 'permissions.browser.sites is empty; list each site the run may open, e.g. {"https://example.com": "read"}.'
93112
93638
  };
93113
93639
  }
93114
93640
  const sites = {};
@@ -93549,7 +94075,12 @@ var FAILURE_REASONS = [
93549
94075
  "needs_administrator",
93550
94076
  "unknown_tool",
93551
94077
  "timed_out",
93552
- "invalid_input"
94078
+ "invalid_input",
94079
+ "not_read",
94080
+ "changed_on_disk",
94081
+ "text_not_found",
94082
+ "not_unique",
94083
+ "invalid_arguments"
93553
94084
  ];
93554
94085
  var WRITE_OPERATIONS = ["created", "updated", "unchanged", "wrote"];
93555
94086
  var MAX_TEXT = 2e3;
@@ -93618,6 +94149,7 @@ function admitToolFacts(value) {
93618
94149
  kind: "command",
93619
94150
  command: text8(value.command),
93620
94151
  exitCode: typeof value.exitCode === "number" && Number.isSafeInteger(value.exitCode) ? value.exitCode : void 0,
94152
+ exitNote: text8(value.exitNote),
93621
94153
  timedOut: flag(value.timedOut),
93622
94154
  signal: text8(value.signal),
93623
94155
  binary: isRecord4(value.binary) && count6(value.binary.bytes) !== void 0 ? { bytes: count6(value.binary.bytes) } : void 0,
@@ -93914,6 +94446,7 @@ export {
93914
94446
  PromptContributionRegistry,
93915
94447
  resolveProviderCapabilities,
93916
94448
  modelReadsImages,
94449
+ estimateTextTokens,
93917
94450
  SearchToolsTool,
93918
94451
  isTerminalTaskStatus,
93919
94452
  selectTaskContext,
@@ -93970,6 +94503,7 @@ export {
93970
94503
  DiskSessionCheckpointStore,
93971
94504
  createFileReadTracker,
93972
94505
  diffWords,
94506
+ diffLines,
93973
94507
  structuredPatch,
93974
94508
  dryRunEdit,
93975
94509
  seedObservationLedger,
@@ -93981,8 +94515,11 @@ export {
93981
94515
  resumeSession,
93982
94516
  openSessionIndex,
93983
94517
  abandonTurn,
94518
+ CacheClock,
93984
94519
  compactNow,
94520
+ compactRegion,
93985
94521
  compactSession,
94522
+ compactSessionRange,
93986
94523
  DEFAULT_GATE_MAX_RETRIES,
93987
94524
  createCommandGate,
93988
94525
  createMemoryPromoter,
@@ -94056,6 +94593,8 @@ export {
94056
94593
  createResidentStepContributions,
94057
94594
  createResidentStepContext,
94058
94595
  loadPty,
94596
+ describeToolCatalogTokens,
94597
+ analyzeContextUsage,
94059
94598
  ResidentConflictError,
94060
94599
  DiskResidentAgenda,
94061
94600
  inspectResidentConsumption,
@@ -94131,4 +94670,4 @@ export {
94131
94670
  buildResidentToolEvidenceTools,
94132
94671
  createPalMessagingTools
94133
94672
  };
94134
- //# sourceMappingURL=chunk-RKMGVFLZ.js.map
94673
+ //# sourceMappingURL=chunk-D63T5UQN.js.map