stitchkit 0.127.0 → 0.129.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 (313) hide show
  1. package/CHANGELOG.md +194 -6
  2. package/dist/agent-executor/acp/v1-connect.d.ts +9 -1
  3. package/dist/agent-executor/acp/v1-connect.d.ts.map +1 -1
  4. package/dist/agent-executor/acp/v1-driver.d.ts +8 -2
  5. package/dist/agent-executor/acp/v1-driver.d.ts.map +1 -1
  6. package/dist/agent-executor/acp/v1-map.d.ts.map +1 -1
  7. package/dist/agent-executor/acp/v1-session.d.ts +8 -0
  8. package/dist/agent-executor/acp/v1-session.d.ts.map +1 -1
  9. package/dist/agent-executor/claude/cli-driver.d.ts +4 -0
  10. package/dist/agent-executor/claude/cli-driver.d.ts.map +1 -1
  11. package/dist/agent-executor/claude/protocol.d.ts +20 -2
  12. package/dist/agent-executor/claude/protocol.d.ts.map +1 -1
  13. package/dist/agent-executor/claude/session.d.ts +2 -1
  14. package/dist/agent-executor/claude/session.d.ts.map +1 -1
  15. package/dist/agent-executor/claude/transcript.d.ts +9 -6
  16. package/dist/agent-executor/claude/transcript.d.ts.map +1 -1
  17. package/dist/agent-executor/claude-sdk/controls.d.ts +19 -0
  18. package/dist/agent-executor/claude-sdk/controls.d.ts.map +1 -0
  19. package/dist/agent-executor/claude-sdk/driver.d.ts +118 -4
  20. package/dist/agent-executor/claude-sdk/driver.d.ts.map +1 -1
  21. package/dist/agent-executor/claude-sdk/query-loop.d.ts +46 -0
  22. package/dist/agent-executor/claude-sdk/query-loop.d.ts.map +1 -0
  23. package/dist/agent-executor/claude-sdk/query-options.d.ts +27 -0
  24. package/dist/agent-executor/claude-sdk/query-options.d.ts.map +1 -0
  25. package/dist/agent-executor/claude-sdk/session.d.ts +6 -5
  26. package/dist/agent-executor/claude-sdk/session.d.ts.map +1 -1
  27. package/dist/agent-executor/codex/classify.d.ts.map +1 -1
  28. package/dist/agent-executor/codex/connect.d.ts +45 -0
  29. package/dist/agent-executor/codex/connect.d.ts.map +1 -0
  30. package/dist/agent-executor/codex/driver.d.ts +55 -10
  31. package/dist/agent-executor/codex/driver.d.ts.map +1 -1
  32. package/dist/agent-executor/codex/limits.d.ts +11 -2
  33. package/dist/agent-executor/codex/limits.d.ts.map +1 -1
  34. package/dist/agent-executor/codex/protocol.d.ts +75 -6
  35. package/dist/agent-executor/codex/protocol.d.ts.map +1 -1
  36. package/dist/agent-executor/codex/session-controls.d.ts +155 -0
  37. package/dist/agent-executor/codex/session-controls.d.ts.map +1 -0
  38. package/dist/agent-executor/codex/session.d.ts +28 -30
  39. package/dist/agent-executor/codex/session.d.ts.map +1 -1
  40. package/dist/agent-executor/codex/unix-socket-target.d.ts +26 -0
  41. package/dist/agent-executor/codex/unix-socket-target.d.ts.map +1 -0
  42. package/dist/agent-executor/codex/unix-socket.d.ts +26 -0
  43. package/dist/agent-executor/codex/unix-socket.d.ts.map +1 -0
  44. package/dist/agent-executor/codex/ws-frame.d.ts +15 -0
  45. package/dist/agent-executor/codex/ws-frame.d.ts.map +1 -0
  46. package/dist/agent-executor/contract.d.ts +2 -0
  47. package/dist/agent-executor/contract.d.ts.map +1 -1
  48. package/dist/agent-executor/engine-process.d.ts +9 -0
  49. package/dist/agent-executor/engine-process.d.ts.map +1 -1
  50. package/dist/agent-executor/hello.d.ts +8 -0
  51. package/dist/agent-executor/hello.d.ts.map +1 -1
  52. package/dist/agent-executor/image-input.d.ts +71 -0
  53. package/dist/agent-executor/image-input.d.ts.map +1 -0
  54. package/dist/agent-executor/session-primitives.d.ts +0 -3
  55. package/dist/agent-executor/session-primitives.d.ts.map +1 -1
  56. package/dist/agent-runtime/agent-tool.d.ts +21 -7
  57. package/dist/agent-runtime/agent-tool.d.ts.map +1 -1
  58. package/dist/agent-runtime/branch-contract.d.ts +1 -0
  59. package/dist/agent-runtime/branch-contract.d.ts.map +1 -1
  60. package/dist/agent-runtime/branch-identities.d.ts +5 -2
  61. package/dist/agent-runtime/branch-identities.d.ts.map +1 -1
  62. package/dist/agent-runtime/branch-messages.d.ts +9 -9
  63. package/dist/agent-runtime/branch-messages.d.ts.map +1 -1
  64. package/dist/agent-runtime/branch-observations.d.ts +49 -36
  65. package/dist/agent-runtime/branch-observations.d.ts.map +1 -1
  66. package/dist/agent-runtime/branch-provider.d.ts +14 -8
  67. package/dist/agent-runtime/branch-provider.d.ts.map +1 -1
  68. package/dist/agent-runtime/branch-source.d.ts +13 -1
  69. package/dist/agent-runtime/branch-source.d.ts.map +1 -1
  70. package/dist/agent-runtime/child-tools.d.ts +64 -0
  71. package/dist/agent-runtime/child-tools.d.ts.map +1 -1
  72. package/dist/agent-runtime/event-search-tools.d.ts +82 -5
  73. package/dist/agent-runtime/event-search-tools.d.ts.map +1 -1
  74. package/dist/agent-runtime/invocation-attempt.d.ts +1 -1
  75. package/dist/agent-runtime/invocation-attempt.d.ts.map +1 -1
  76. package/dist/agent-runtime/invocation-payload.d.ts +12 -0
  77. package/dist/agent-runtime/invocation-payload.d.ts.map +1 -1
  78. package/dist/agent-runtime/invocation-read.d.ts +6 -3
  79. package/dist/agent-runtime/invocation-read.d.ts.map +1 -1
  80. package/dist/agent-runtime/invocation-schema.d.ts +50 -8
  81. package/dist/agent-runtime/invocation-schema.d.ts.map +1 -1
  82. package/dist/agent-runtime/invocations.d.ts +20 -9
  83. package/dist/agent-runtime/invocations.d.ts.map +1 -1
  84. package/dist/agent-runtime/postgres.d.ts.map +1 -1
  85. package/dist/agent-runtime/schedule-tools.d.ts +30 -0
  86. package/dist/agent-runtime/schedule-tools.d.ts.map +1 -1
  87. package/dist/agent-runtime/schemas-invocation-payload.d.ts +48 -0
  88. package/dist/agent-runtime/schemas-invocation-payload.d.ts.map +1 -0
  89. package/dist/agent-runtime/sql-events.d.ts.map +1 -1
  90. package/dist/agent-runtime/sql-rows.d.ts +10 -10
  91. package/dist/agent-runtime/sql-session.d.ts +11 -0
  92. package/dist/agent-runtime/sql-session.d.ts.map +1 -1
  93. package/dist/agent-runtime/sqlite-transactions.d.ts.map +1 -1
  94. package/dist/agent-runtime/state-tools.d.ts +55 -0
  95. package/dist/agent-runtime/state-tools.d.ts.map +1 -1
  96. package/dist/agent-runtime/store-branch.d.ts.map +1 -1
  97. package/dist/agent-runtime/store-conformance-lifecycle.d.ts +20 -20
  98. package/dist/agent-runtime/store-conformance-support.d.ts +10 -10
  99. package/dist/agent-runtime/store-create.d.ts.map +1 -1
  100. package/dist/agent-runtime/store-driver-contract.d.ts +12 -0
  101. package/dist/agent-runtime/store-driver-contract.d.ts.map +1 -1
  102. package/dist/agent-runtime/store-memory-events.d.ts.map +1 -1
  103. package/dist/agent-runtime/store.d.ts +7 -0
  104. package/dist/agent-runtime/store.d.ts.map +1 -1
  105. package/dist/agent-runtime/terminal-commit.d.ts +10 -10
  106. package/dist/declaration/declaration.d.ts +6 -3
  107. package/dist/declaration/declaration.d.ts.map +1 -1
  108. package/dist/entrypoints/agent-executor/acp.d.ts +1 -1
  109. package/dist/entrypoints/agent-executor/acp.d.ts.map +1 -1
  110. package/dist/entrypoints/agent-executor/acp.js +28 -17
  111. package/dist/entrypoints/agent-executor/claude-sdk.d.ts +1 -1
  112. package/dist/entrypoints/agent-executor/claude-sdk.d.ts.map +1 -1
  113. package/dist/entrypoints/agent-executor/claude-sdk.js +543 -96
  114. package/dist/entrypoints/agent-executor/claude.js +40 -21
  115. package/dist/entrypoints/agent-executor/codex.d.ts +4 -0
  116. package/dist/entrypoints/agent-executor/codex.d.ts.map +1 -1
  117. package/dist/entrypoints/agent-executor/codex.js +1530 -207
  118. package/dist/entrypoints/agent-executor.js +7 -7
  119. package/dist/entrypoints/agent-runtime/browser.js +1 -1
  120. package/dist/entrypoints/agent-runtime/coding-tools.js +3 -3
  121. package/dist/entrypoints/agent-runtime/harness.js +10 -11
  122. package/dist/entrypoints/agent-runtime/openrouter.js +4 -4
  123. package/dist/entrypoints/agent-runtime/postgres.js +12 -7
  124. package/dist/entrypoints/agent-runtime/realtime.js +4 -4
  125. package/dist/entrypoints/agent-runtime/sandbox.js +7 -7
  126. package/dist/entrypoints/agent-runtime/sqlite/bun.js +7 -7
  127. package/dist/entrypoints/agent-runtime/sqlite/node.js +7 -7
  128. package/dist/entrypoints/agent-runtime/testing.js +9 -9
  129. package/dist/entrypoints/agent-runtime.d.ts +9 -7
  130. package/dist/entrypoints/agent-runtime.d.ts.map +1 -1
  131. package/dist/entrypoints/agent-runtime.js +254 -207
  132. package/dist/entrypoints/application/diagnostic-journal.js +4 -4
  133. package/dist/entrypoints/application/directory-inbox.js +8 -8
  134. package/dist/entrypoints/application/opentelemetry.js +2 -2
  135. package/dist/entrypoints/application.js +2 -2
  136. package/dist/entrypoints/cli/publish.js +8 -8
  137. package/dist/entrypoints/cli.js +12 -11
  138. package/dist/entrypoints/contract.js +2 -2
  139. package/dist/entrypoints/declaration.js +0 -1
  140. package/dist/entrypoints/files/packaging.js +2 -2
  141. package/dist/entrypoints/files.js +42 -19
  142. package/dist/entrypoints/handler.js +4 -4
  143. package/dist/entrypoints/http.js +5 -5
  144. package/dist/entrypoints/index.js +7 -7
  145. package/dist/entrypoints/node.js +7 -7
  146. package/dist/entrypoints/observability.js +4 -4
  147. package/dist/entrypoints/primitives.js +2 -2
  148. package/dist/entrypoints/process.js +6 -6
  149. package/dist/entrypoints/react.js +1 -1
  150. package/dist/entrypoints/remote.js +2 -2
  151. package/dist/entrypoints/server.js +10 -10
  152. package/dist/entrypoints/service-host/macos.js +6 -6
  153. package/dist/entrypoints/service-host.d.ts +4 -1
  154. package/dist/entrypoints/service-host.d.ts.map +1 -1
  155. package/dist/entrypoints/service-host.js +835 -224
  156. package/dist/entrypoints/spend.js +1 -1
  157. package/dist/entrypoints/sync/postgres.js +1 -1
  158. package/dist/entrypoints/sync.js +2 -2
  159. package/dist/entrypoints/telegram.js +5 -5
  160. package/dist/entrypoints/testing.js +5 -5
  161. package/dist/entrypoints/tools/agent.js +5 -4
  162. package/dist/entrypoints/tools/connections.js +2 -2
  163. package/dist/entrypoints/tools/invoker.js +4 -3
  164. package/dist/entrypoints/tools/mcp.js +5 -4
  165. package/dist/entrypoints/tools/toolkit.js +8 -7
  166. package/dist/entrypoints/tools.d.ts +1 -1
  167. package/dist/entrypoints/tools.d.ts.map +1 -1
  168. package/dist/entrypoints/tools.js +15 -13
  169. package/dist/entrypoints/tracking/contract.js +1 -1
  170. package/dist/entrypoints/xlsx.js +1 -1
  171. package/dist/files/directory-appearance.d.ts +20 -9
  172. package/dist/files/directory-appearance.d.ts.map +1 -1
  173. package/dist/files/polled-json.d.ts.map +1 -1
  174. package/dist/files/regular-file.d.ts +15 -5
  175. package/dist/files/regular-file.d.ts.map +1 -1
  176. package/dist/{index-prf6ayhf.js → index-13wmzpa6.js} +1 -1
  177. package/dist/{index-qnzhmk2s.js → index-17qgm6xe.js} +91 -48
  178. package/dist/{index-wv8dqy7q.js → index-205456mf.js} +1 -1
  179. package/dist/{index-3gwp8ez6.js → index-21cfxc4z.js} +13 -18
  180. package/dist/{index-xtkw9866.js → index-2c5w2d1d.js} +1 -1
  181. package/dist/{index-g1q7fwn9.js → index-2nwvn7m2.js} +1 -1
  182. package/dist/{index-d4svrknj.js → index-39c2hj6h.js} +2 -2
  183. package/dist/{index-sfzfd2m2.js → index-39rmc00v.js} +1 -1
  184. package/dist/{index-ky3ardqn.js → index-3fym4j8n.js} +1 -1
  185. package/dist/{index-d96c1n1q.js → index-5tdc0q43.js} +20 -19
  186. package/dist/{index-3ypvpkwr.js → index-669374qc.js} +1 -1
  187. package/dist/{index-x90w78yz.js → index-673drwkn.js} +23 -8
  188. package/dist/{index-83n766x4.js → index-7jqn3b3g.js} +16 -10
  189. package/dist/{index-5jyjb4s0.js → index-80acsm27.js} +1 -1
  190. package/dist/{index-xmr47znh.js → index-827bgv33.js} +1 -1
  191. package/dist/{index-xypxnzhp.js → index-93n6jwy0.js} +4 -4
  192. package/dist/{index-wbnpa8z6.js → index-9kpxz49v.js} +5 -5
  193. package/dist/{index-fcw255hd.js → index-9sfhje6y.js} +3 -3
  194. package/dist/{index-bh4pmtr9.js → index-afb6z77w.js} +3 -1
  195. package/dist/{index-9y0afd5f.js → index-apf5g7y9.js} +1 -1
  196. package/dist/{index-4qvyhn23.js → index-bjmj2q1z.js} +1 -1
  197. package/dist/{index-bbzvrq66.js → index-dcsxj68j.js} +457 -204
  198. package/dist/{index-j516jaaz.js → index-dnzxxf8a.js} +49 -2
  199. package/dist/{index-kmbpej2y.js → index-emgrmavr.js} +102 -61
  200. package/dist/index-fgahdc7s.js +100 -0
  201. package/dist/{index-kzavdze2.js → index-gr0kxymw.js} +5 -1
  202. package/dist/{index-e06z0tkb.js → index-gya4hwh3.js} +2 -2
  203. package/dist/{index-3djgv3ch.js → index-hab790s6.js} +26 -11
  204. package/dist/{index-j13gzgdv.js → index-j0ef04jw.js} +9 -5
  205. package/dist/{index-rhb33thr.js → index-jcge9tx3.js} +1 -1
  206. package/dist/{index-dvd1qdwa.js → index-ke02kxsr.js} +3 -3
  207. package/dist/{index-3agqmmrg.js → index-mkfhpk11.js} +7 -9
  208. package/dist/{index-a725ayvz.js → index-mttkdm5a.js} +1 -1
  209. package/dist/{index-9wh98cpa.js → index-n3bm7zqq.js} +131 -91
  210. package/dist/{index-7xp05h20.js → index-p06z7g7w.js} +7 -7
  211. package/dist/{index-kt6dh1n6.js → index-p16q492v.js} +1 -1
  212. package/dist/{index-5zwac8ft.js → index-pp97q86a.js} +3 -3
  213. package/dist/{index-39n02e0q.js → index-psye60qn.js} +1 -1
  214. package/dist/{index-5ptwb6ka.js → index-pzhqydxb.js} +1 -1
  215. package/dist/{index-7kfcb576.js → index-qa2jjb65.js} +1 -1
  216. package/dist/{index-0djnptn8.js → index-qhjmmsm2.js} +10 -3
  217. package/dist/{index-7grgs8cx.js → index-qpzyahe3.js} +2 -2
  218. package/dist/{index-8xr2eq99.js → index-r97ppg0g.js} +4 -4
  219. package/dist/{index-bmaz3jzy.js → index-rjs94dny.js} +1 -1
  220. package/dist/{index-p1m9djt6.js → index-rxh3qy4x.js} +33 -6
  221. package/dist/{index-en8e5zsj.js → index-ryxb427v.js} +1 -1
  222. package/dist/{index-nbv44x0x.js → index-s2e3h616.js} +137 -36
  223. package/dist/{index-dwa6pskj.js → index-sd4e5x5j.js} +86 -47
  224. package/dist/{index-g56ht6qf.js → index-t3qcac2a.js} +1 -1
  225. package/dist/index-vgzhw2zk.js +304 -0
  226. package/dist/{index-jrka9029.js → index-vmbxj75t.js} +2 -2
  227. package/dist/{index-caywx1c0.js → index-wv2amqm4.js} +109 -12
  228. package/dist/{index-5e0zsbf7.js → index-x2fb37t0.js} +2 -2
  229. package/dist/{index-z4k0hqp9.js → index-y71zn1gw.js} +137 -27
  230. package/dist/{index-wavv538x.js → index-ybdq8kk2.js} +3 -3
  231. package/dist/{index-4gk6k3zc.js → index-ycr4pk0z.js} +1 -1
  232. package/dist/{index-0tyt97nk.js → index-yrr3n391.js} +1 -1
  233. package/dist/{index-v37b2cd6.js → index-z20pdxeb.js} +2 -2
  234. package/dist/{index-0hdm5sx6.js → index-z9d74jmb.js} +8 -4
  235. package/dist/{index-4s2w4g37.js → index-zhshhxew.js} +80 -2
  236. package/dist/{index-3b31z0pc.js → index-znd1b57f.js} +12 -6
  237. package/dist/internal/bounded-file-confirm.d.ts +32 -0
  238. package/dist/internal/bounded-file-confirm.d.ts.map +1 -0
  239. package/dist/internal/bounded-file-read.d.ts +10 -7
  240. package/dist/internal/bounded-file-read.d.ts.map +1 -1
  241. package/dist/internal/file-observation.d.ts +5 -1
  242. package/dist/internal/file-observation.d.ts.map +1 -1
  243. package/dist/internal/positive-integer.d.ts +2 -0
  244. package/dist/internal/positive-integer.d.ts.map +1 -1
  245. package/dist/internal/process-instance.d.ts +8 -0
  246. package/dist/internal/process-instance.d.ts.map +1 -1
  247. package/dist/internal/unix-socket.d.ts +10 -1
  248. package/dist/internal/unix-socket.d.ts.map +1 -1
  249. package/dist/server/unix-client.d.ts +7 -0
  250. package/dist/server/unix-client.d.ts.map +1 -1
  251. package/dist/service-host/systemd-inspect.d.ts +3 -1
  252. package/dist/service-host/systemd-inspect.d.ts.map +1 -1
  253. package/dist/service-host/systemd-render-shared.d.ts +64 -0
  254. package/dist/service-host/systemd-render-shared.d.ts.map +1 -0
  255. package/dist/service-host/systemd-render.d.ts +31 -26
  256. package/dist/service-host/systemd-render.d.ts.map +1 -1
  257. package/dist/service-host/systemd-timer-render.d.ts +31 -0
  258. package/dist/service-host/systemd-timer-render.d.ts.map +1 -0
  259. package/dist/service-host/systemd-timer-rollback.d.ts +26 -0
  260. package/dist/service-host/systemd-timer-rollback.d.ts.map +1 -0
  261. package/dist/service-host/systemd-timer.d.ts +82 -0
  262. package/dist/service-host/systemd-timer.d.ts.map +1 -0
  263. package/dist/service-host/systemd-unit-ops.d.ts +26 -0
  264. package/dist/service-host/systemd-unit-ops.d.ts.map +1 -0
  265. package/dist/service-host/systemd.d.ts +1 -1
  266. package/dist/service-host/systemd.d.ts.map +1 -1
  267. package/dist/tools/access.d.ts +30 -1
  268. package/dist/tools/access.d.ts.map +1 -1
  269. package/dist/tools/agent.d.ts +2 -2
  270. package/dist/tools/agent.d.ts.map +1 -1
  271. package/dist/tools/cli/args-scan.d.ts +5 -0
  272. package/dist/tools/cli/args-scan.d.ts.map +1 -1
  273. package/dist/tools/cli/args.d.ts +11 -5
  274. package/dist/tools/cli/args.d.ts.map +1 -1
  275. package/dist/tools/cli/invoke.d.ts +2 -1
  276. package/dist/tools/cli/invoke.d.ts.map +1 -1
  277. package/dist/tools/cli/notices.d.ts.map +1 -1
  278. package/dist/tools/cli/run-managed.d.ts.map +1 -1
  279. package/dist/tools/cli/session.d.ts.map +1 -1
  280. package/dist/tools/execute.d.ts.map +1 -1
  281. package/dist/tools/invoker.d.ts +2 -1
  282. package/dist/tools/invoker.d.ts.map +1 -1
  283. package/dist/tools/list-names.d.ts +2 -3
  284. package/dist/tools/list-names.d.ts.map +1 -1
  285. package/dist/tools/manifest.d.ts +2 -3
  286. package/dist/tools/manifest.d.ts.map +1 -1
  287. package/dist/tools/mcp/mount.d.ts +5 -5
  288. package/dist/tools/mcp/mount.d.ts.map +1 -1
  289. package/dist/tools/mcp/register.d.ts +2 -1
  290. package/dist/tools/mcp/register.d.ts.map +1 -1
  291. package/dist/tools/mcp/runtime-tools.d.ts.map +1 -1
  292. package/llms/agent-executor-acp.txt +10 -6
  293. package/llms/agent-executor-claude-sdk.txt +13 -10
  294. package/llms/agent-executor-claude.txt +2 -2
  295. package/llms/agent-executor-codex.txt +9 -3
  296. package/llms/agent-executor.txt +2 -2
  297. package/llms/agent-runtime.4.txt +21 -9
  298. package/llms/cli.3.txt +4 -4
  299. package/llms/cli.txt +1 -0
  300. package/llms/declaration.txt +2 -2
  301. package/llms/files.txt +1 -1
  302. package/llms/node.txt +2 -2
  303. package/llms/server.5.txt +2 -2
  304. package/llms/service-host.txt +5 -5
  305. package/llms/stitchkit.txt +81 -77
  306. package/llms/tools.3.txt +3 -2
  307. package/llms/upgrading-0.128.0-0.129.0.txt +175 -0
  308. package/llms/upgrading.txt +1 -0
  309. package/llms-full.txt +323 -127
  310. package/llms.txt +15 -14
  311. package/package.json +1 -1
  312. package/dist/index-ajmtxsky.js +0 -193
  313. package/dist/index-ax3wns1a.js +0 -93
@@ -21,7 +21,7 @@ import {
21
21
  AgentSandboxRestrictionSchema2,
22
22
  AgentSandboxGradeSchema2,
23
23
  AGENT_CODING_TOOL_NAMES
24
- } from "./index-wavv538x.js";
24
+ } from "./index-ybdq8kk2.js";
25
25
  import {
26
26
  AgentRuntimeHeadSchema2,
27
27
  AgentStoredRunSchema2,
@@ -52,6 +52,8 @@ import {
52
52
  ProviderJournalResponseSchema
53
53
  } from "./index-9xr44d2g.js";
54
54
  import {
55
+ PurgeInvocationPayloadsInputSchema2,
56
+ PurgeInvocationPayloadsResultSchema2,
55
57
  InvocationStartedSchema,
56
58
  InvocationRequestSchema,
57
59
  InvocationResponseSchema,
@@ -59,7 +61,7 @@ import {
59
61
  InvocationPayloadReceiptSchema,
60
62
  isModelInvocationRecord,
61
63
  assistantStatus
62
- } from "./index-ajmtxsky.js";
64
+ } from "./index-vgzhw2zk.js";
63
65
  import {
64
66
  StepEventPayloadSchema,
65
67
  ParkEventPayloadSchema,
@@ -68,7 +70,7 @@ import {
68
70
  } from "./index-snef22zr.js";
69
71
  import {
70
72
  assertPositiveSafeInteger
71
- } from "./index-kzavdze2.js";
73
+ } from "./index-gr0kxymw.js";
72
74
 
73
75
  // src/agent-runtime/branch-contract.ts
74
76
  import { z as z2 } from "zod";
@@ -148,7 +150,7 @@ var BRANCH_RUNTIME_REFERENCE_KEYS = [
148
150
  ];
149
151
  var BranchApplicationKeySchema = z2.object({
150
152
  key: z2.enum(BRANCH_RUNTIME_REFERENCE_KEYS),
151
- sourceIdentity: z2.enum(["refuse", "retain"]).default("refuse")
153
+ sourceIdentity: z2.enum(["refuse", "retain", "rekey-spill"]).default("refuse")
152
154
  }).strict();
153
155
  var BranchApplicationKeysSchema = z2.array(BranchApplicationKeySchema).superRefine((keys, ctx) => {
154
156
  const names = keys.map((entry) => entry.key);
@@ -201,10 +203,34 @@ var AgentConversationBranchPlanSchema2 = z2.object({
201
203
  }).strict();
202
204
 
203
205
  // src/agent-runtime/agent-tool.ts
204
- function defineAgentTool(definition) {
206
+ function defineAgentToolDescriptor(descriptor) {
207
+ const identity = Object.freeze({
208
+ ...descriptor.identity,
209
+ ...descriptor.identity.meta !== undefined && {
210
+ meta: Object.freeze({ ...descriptor.identity.meta })
211
+ }
212
+ });
213
+ const expose = Object.freeze(["AGENT"]);
214
+ return Object.freeze({
215
+ ...descriptor,
216
+ identity,
217
+ expose
218
+ });
219
+ }
220
+ function bindAgentTool(descriptor, handler) {
205
221
  return {
206
- ...definition,
207
- handler: (context) => definition.handler(context)
222
+ name: descriptor.name,
223
+ description: descriptor.description,
224
+ identity: {
225
+ ...descriptor.identity,
226
+ ...descriptor.identity.meta !== undefined && {
227
+ meta: { ...descriptor.identity.meta }
228
+ }
229
+ },
230
+ input: descriptor.input,
231
+ output: descriptor.output,
232
+ expose: descriptor.expose,
233
+ handler: (context) => handler(context)
208
234
  };
209
235
  }
210
236
 
@@ -952,18 +978,47 @@ var TraceInputSchema = z10.object({
952
978
  limit: z10.int().positive().max(1000).default(100)
953
979
  }).strict();
954
980
  var TraceOutputSchema = z10.object({ events: z10.array(EventOutputSchema), nextSeq: z10.number().optional() }).strict();
981
+ var SEARCH_DESCRIPTOR = defineAgentToolDescriptor({
982
+ name: AGENT_EVENT_SEARCH_TOOL_NAMES.search,
983
+ description: "Search authorized durable conversation events and return exact addresses.",
984
+ identity: { serviceName: "agent-events", action: "search", method: "POST" },
985
+ input: SearchInputSchema,
986
+ output: SearchOutputSchema,
987
+ expose: ["AGENT"]
988
+ });
989
+ var TRACE_DESCRIPTOR = defineAgentToolDescriptor({
990
+ name: AGENT_EVENT_SEARCH_TOOL_NAMES.trace,
991
+ description: "Read a bounded contiguous slice of this conversation event trace.",
992
+ identity: { serviceName: "agent-events", action: "trace", method: "GET" },
993
+ input: TraceInputSchema,
994
+ output: TraceOutputSchema,
995
+ expose: ["AGENT"]
996
+ });
997
+ var EVENT_DESCRIPTOR = defineAgentToolDescriptor({
998
+ name: AGENT_EVENT_SEARCH_TOOL_NAMES.event,
999
+ description: "Read one durable event by exact conversation and sequence address.",
1000
+ identity: { serviceName: "agent-events", action: "read", method: "GET" },
1001
+ input: EventAddressSchema,
1002
+ output: EventOutputSchema,
1003
+ expose: ["AGENT"]
1004
+ });
1005
+ var AGENT_EVENT_SEARCH_TOOL_DESCRIPTORS2 = Object.freeze([
1006
+ SEARCH_DESCRIPTOR,
1007
+ TRACE_DESCRIPTOR,
1008
+ EVENT_DESCRIPTOR
1009
+ ]);
955
1010
  var AGENT_EVENT_SEARCH_TOOL_SCHEMAS = {
956
- [AGENT_EVENT_SEARCH_TOOL_NAMES.search]: {
957
- input: SearchInputSchema,
958
- output: SearchOutputSchema
1011
+ [SEARCH_DESCRIPTOR.name]: {
1012
+ input: SEARCH_DESCRIPTOR.input,
1013
+ output: SEARCH_DESCRIPTOR.output
959
1014
  },
960
- [AGENT_EVENT_SEARCH_TOOL_NAMES.trace]: {
961
- input: TraceInputSchema,
962
- output: TraceOutputSchema
1015
+ [TRACE_DESCRIPTOR.name]: {
1016
+ input: TRACE_DESCRIPTOR.input,
1017
+ output: TRACE_DESCRIPTOR.output
963
1018
  },
964
- [AGENT_EVENT_SEARCH_TOOL_NAMES.event]: {
965
- input: EventAddressSchema,
966
- output: EventOutputSchema
1019
+ [EVENT_DESCRIPTOR.name]: {
1020
+ input: EVENT_DESCRIPTOR.input,
1021
+ output: EVENT_DESCRIPTOR.output
967
1022
  }
968
1023
  };
969
1024
  function createAgentEventSearchTools2(config) {
@@ -998,55 +1053,31 @@ function createAgentEventSearchTools2(config) {
998
1053
  };
999
1054
  };
1000
1055
  return [
1001
- defineAgentTool({
1002
- name: AGENT_EVENT_SEARCH_TOOL_NAMES.search,
1003
- description: "Search authorized durable conversation events and return exact addresses.",
1004
- identity: { serviceName: "agent-events", action: "search", method: "POST" },
1005
- input: SearchInputSchema,
1006
- output: SearchOutputSchema,
1007
- expose: ["AGENT"],
1008
- handler: async ({ input: request }) => ({
1009
- results: [
1010
- ...await input.search({
1011
- requestingConversationId: input.conversationId,
1012
- ...request
1013
- })
1014
- ]
1015
- })
1016
- }),
1017
- defineAgentTool({
1018
- name: AGENT_EVENT_SEARCH_TOOL_NAMES.trace,
1019
- description: "Read a bounded contiguous slice of this conversation event trace.",
1020
- identity: { serviceName: "agent-events", action: "trace", method: "GET" },
1021
- input: TraceInputSchema,
1022
- output: TraceOutputSchema,
1023
- expose: ["AGENT"],
1024
- handler: async ({ input: request }) => {
1025
- const page = await input.store.readEvents({
1026
- conversationId: input.conversationId,
1056
+ bindAgentTool(SEARCH_DESCRIPTOR, async ({ input: request }) => ({
1057
+ results: [
1058
+ ...await input.search({
1059
+ requestingConversationId: input.conversationId,
1027
1060
  ...request
1028
- });
1029
- return {
1030
- events: page.items.map((event) => ({
1031
- conversationId: event.conversationId,
1032
- seq: event.seq,
1033
- kind: event.kind,
1034
- occurredAt: event.occurredAt,
1035
- payload: event.payload
1036
- })),
1037
- ...page.nextSeq !== undefined && { nextSeq: page.nextSeq }
1038
- };
1039
- }
1061
+ })
1062
+ ]
1063
+ })),
1064
+ bindAgentTool(TRACE_DESCRIPTOR, async ({ input: request }) => {
1065
+ const page = await input.store.readEvents({
1066
+ conversationId: input.conversationId,
1067
+ ...request
1068
+ });
1069
+ return {
1070
+ events: page.items.map((event) => ({
1071
+ conversationId: event.conversationId,
1072
+ seq: event.seq,
1073
+ kind: event.kind,
1074
+ occurredAt: event.occurredAt,
1075
+ payload: event.payload
1076
+ })),
1077
+ ...page.nextSeq !== undefined && { nextSeq: page.nextSeq }
1078
+ };
1040
1079
  }),
1041
- defineAgentTool({
1042
- name: AGENT_EVENT_SEARCH_TOOL_NAMES.event,
1043
- description: "Read one durable event by exact conversation and sequence address.",
1044
- identity: { serviceName: "agent-events", action: "read", method: "GET" },
1045
- input: EventAddressSchema,
1046
- output: EventOutputSchema,
1047
- expose: ["AGENT"],
1048
- handler: ({ input: request }) => readExact(request)
1049
- })
1080
+ bindAgentTool(EVENT_DESCRIPTOR, ({ input: request }) => readExact(request))
1050
1081
  ];
1051
1082
  }
1052
1083
 
@@ -1089,7 +1120,7 @@ function assertSourceCapabilities(driver, source) {
1089
1120
  }
1090
1121
 
1091
1122
  // src/agent-runtime/store-create.ts
1092
- import { z as z24 } from "zod";
1123
+ import { z as z25 } from "zod";
1093
1124
 
1094
1125
  // src/agent-runtime/store-archive.ts
1095
1126
  import { z as z14 } from "zod";
@@ -1967,10 +1998,10 @@ async function exportConversationIn(driver, transaction, conversationId) {
1967
1998
 
1968
1999
  // src/agent-runtime/store-branch.ts
1969
2000
  import { createHash as createHash7 } from "node:crypto";
1970
- import { z as z22 } from "zod";
2001
+ import { z as z23 } from "zod";
1971
2002
 
1972
2003
  // src/agent-runtime/branch-events.ts
1973
- import { z as z19 } from "zod";
2004
+ import { z as z20 } from "zod";
1974
2005
 
1975
2006
  // src/agent-runtime/branch-messages.ts
1976
2007
  import { z as z16 } from "zod";
@@ -2060,31 +2091,55 @@ function branchRuntimeToolRecord(ids, name, value, output) {
2060
2091
 
2061
2092
  // src/agent-runtime/branch-messages.ts
2062
2093
  var RETAINABLE = new Set(["conversation", "run", "message"]);
2094
+ var RUNTIME_REFERENCE_KEYS = new Set(BRANCH_RUNTIME_REFERENCE_KEYS);
2063
2095
  function branchOpaqueJson(ids, value, path = "") {
2064
2096
  if (Array.isArray(value)) {
2065
- value.forEach((entry, index) => {
2066
- branchOpaqueJson(ids, entry, `${path}[${index}]`);
2067
- });
2068
- return value;
2097
+ return value.map((entry, index) => branchOpaqueJson(ids, entry, `${path}[${index}]`));
2069
2098
  }
2070
2099
  if (value !== null && typeof value === "object") {
2071
- for (const key of BRANCH_RUNTIME_REFERENCE_KEYS) {
2072
- if (!(key in value))
2073
- continue;
2074
- const at = path ? `${path}.${key}` : key;
2075
- const mode = ids.applicationKey(key);
2076
- if (mode === undefined) {
2077
- ids.refuse({
2078
- code: "application-key-undeclared",
2079
- message: `Branch cannot rekey an opaque payload containing ${key} at ${at}; declare it in applicationKeys if it is application data`,
2080
- key,
2081
- path: at
2082
- });
2083
- continue;
2100
+ return branchOpaqueRecord(ids, value, path);
2101
+ }
2102
+ return value;
2103
+ }
2104
+ function branchOpaqueRecord(ids, value, path = "") {
2105
+ const out = {};
2106
+ for (const [key, entry] of Object.entries(value)) {
2107
+ const at = path ? `${path}.${key}` : key;
2108
+ if (!RUNTIME_REFERENCE_KEYS.has(key)) {
2109
+ out[key] = branchOpaqueJson(ids, entry, at);
2110
+ continue;
2111
+ }
2112
+ const mode = ids.applicationKey(key);
2113
+ if (mode === undefined) {
2114
+ ids.refuse({
2115
+ code: "application-key-undeclared",
2116
+ message: `Branch cannot rekey an opaque payload containing ${key} at ${at}; declare it in applicationKeys if it is application data`,
2117
+ key,
2118
+ path: at
2119
+ });
2120
+ out[key] = branchOpaqueJson(ids, entry, at);
2121
+ continue;
2122
+ }
2123
+ if (mode === "rekey-spill") {
2124
+ if (typeof entry === "string") {
2125
+ const kinds = ids.sourceIdentitiesOf(entry);
2126
+ if (kinds.size === 1 && kinds.has("spill")) {
2127
+ out[key] = ids.reference("spill", entry);
2128
+ } else {
2129
+ ids.refuse({
2130
+ code: "application-key-source-identity",
2131
+ message: `Branch cannot rekey non-spill or foreign value under the application key ${key} at ${at}`,
2132
+ key,
2133
+ path: at
2134
+ });
2135
+ out[key] = entry;
2136
+ }
2137
+ } else {
2138
+ out[key] = branchOpaqueJson(ids, entry, at);
2084
2139
  }
2085
- const entry = value[key];
2086
- if (typeof entry !== "string")
2087
- continue;
2140
+ continue;
2141
+ }
2142
+ if (typeof entry === "string") {
2088
2143
  for (const kind of ids.sourceIdentitiesOf(entry)) {
2089
2144
  if (mode === "retain" && RETAINABLE.has(kind))
2090
2145
  continue;
@@ -2097,10 +2152,9 @@ function branchOpaqueJson(ids, value, path = "") {
2097
2152
  break;
2098
2153
  }
2099
2154
  }
2100
- for (const [key, entry] of Object.entries(value))
2101
- branchOpaqueJson(ids, entry, path ? `${path}.${key}` : key);
2155
+ out[key] = branchOpaqueJson(ids, entry, at);
2102
2156
  }
2103
- return value;
2157
+ return out;
2104
2158
  }
2105
2159
  function branchToolJson(ids, name, value, output) {
2106
2160
  return branchRuntimeToolRecord(ids, name, value, output) ?? branchOpaqueJson(ids, value);
@@ -2112,15 +2166,15 @@ function branchPartAt(ids, part) {
2112
2166
  switch (part.type) {
2113
2167
  case "file":
2114
2168
  return { ...part, reference: ids.fileReference(part.reference) };
2115
- case "tool-call": {
2116
- if (part.provider)
2117
- branchOpaqueJson(ids, part.provider.data);
2169
+ case "tool-call":
2118
2170
  return {
2119
2171
  ...part,
2172
+ ...part.provider && {
2173
+ provider: { ...part.provider, data: branchOpaqueRecord(ids, part.provider.data) }
2174
+ },
2120
2175
  callId: ids.reference("call", part.callId),
2121
2176
  input: branchToolJson(ids, part.toolName, part.input, false)
2122
2177
  };
2123
- }
2124
2178
  case "tool-result":
2125
2179
  return {
2126
2180
  ...part,
@@ -2140,9 +2194,10 @@ function branchPartAt(ids, part) {
2140
2194
  case "provider":
2141
2195
  throw new TypeError("Branch cannot rekey an opaque provider part");
2142
2196
  case "reasoning":
2143
- if (part.provider)
2144
- branchOpaqueJson(ids, part.provider.data);
2145
- return part;
2197
+ return part.provider ? {
2198
+ ...part,
2199
+ provider: { ...part.provider, data: branchOpaqueRecord(ids, part.provider.data) }
2200
+ } : part;
2146
2201
  default:
2147
2202
  return part;
2148
2203
  }
@@ -2200,7 +2255,7 @@ var Retry = z17.object({
2200
2255
  delayMs: z17.number().nonnegative().optional(),
2201
2256
  reason: z17.string().optional()
2202
2257
  }).strict();
2203
- var Spill = z17.object({ reference: Id, bytes: z17.int().nonnegative(), sha256: Hash2.optional() }).strict();
2258
+ var SpillEventPayloadSchema = z17.object({ reference: Id, bytes: z17.int().nonnegative(), sha256: Hash2.optional() }).strict();
2204
2259
  var Schedule = z17.object({
2205
2260
  id: Id,
2206
2261
  kind: z17.enum(["at", "after", "every"]).optional(),
@@ -2219,16 +2274,16 @@ function durability(ids, raw, kind) {
2219
2274
  const value = kind === "durability/step" ? StepEventPayloadSchema.parse(raw) : kind === "durability/park" ? ParkEventPayloadSchema.parse(raw) : kind === "durability/event" ? DeliveredEventPayloadSchema.parse(raw) : EffectEventPayloadSchema.parse(raw);
2220
2275
  if (canonicalAgentJson2(value) !== canonicalAgentJson2(raw))
2221
2276
  throw new TypeError("Branch cannot rekey opaque durability payload");
2222
- if ("encoded" in value)
2223
- branchOpaqueJson(ids, z17.json().parse(JSON.parse(value.encoded)));
2277
+ const encoded = "encoded" in value ? JSON.stringify(branchOpaqueJson(ids, z17.json().parse(JSON.parse(value.encoded)))) : undefined;
2224
2278
  return {
2225
2279
  ...value,
2280
+ ...encoded !== undefined && { encoded },
2226
2281
  runId: ids.reference("run", value.runId),
2227
2282
  ..."id" in value && { id: ids.define("key", value.id) }
2228
2283
  };
2229
2284
  }
2230
2285
  function spill(ids, raw) {
2231
- const value = Spill.parse(raw);
2286
+ const value = SpillEventPayloadSchema.parse(raw);
2232
2287
  return { ...value, reference: ids.reference("spill", value.reference) };
2233
2288
  }
2234
2289
  function schedule(ids, raw) {
@@ -2249,9 +2304,9 @@ function childState(ids, raw) {
2249
2304
  const value = ChildStateEventPayloadSchema.parse(raw);
2250
2305
  if ("action" in value) {
2251
2306
  if (value.action === "blocking-presented") {
2252
- branchOpaqueJson(ids, value.input);
2253
2307
  return {
2254
2308
  ...value,
2309
+ input: branchOpaqueJson(ids, value.input),
2255
2310
  childConversationId: rekeyChildConversation(ids, value.childConversationId),
2256
2311
  approvalId: ids.define("approval", value.approvalId),
2257
2312
  childApprovalId: ids.define("approval", value.childApprovalId),
@@ -2316,8 +2371,7 @@ var OBSERVATION_RULES = {
2316
2371
  }).strict().parse(raw),
2317
2372
  "state/set": (ids, raw) => {
2318
2373
  const value = State.parse(raw);
2319
- branchOpaqueJson(ids, value.value);
2320
- return value;
2374
+ return { ...value, value: branchOpaqueJson(ids, value.value) };
2321
2375
  },
2322
2376
  "retry/scheduled": retry,
2323
2377
  "retry/started": retry,
@@ -2401,16 +2455,49 @@ var BranchObservationSchema = z17.object({ sourceKind: Id, payload: z17.json() }
2401
2455
 
2402
2456
  // src/agent-runtime/branch-provider.ts
2403
2457
  import { createHash as createHash3 } from "node:crypto";
2458
+ import { z as z18 } from "zod";
2459
+ var ProviderOptionsRecordSchema = z18.record(z18.string(), z18.record(z18.string(), z18.json()));
2460
+ var ReferenceRecordSchema = z18.record(z18.string(), z18.string()).refine((value) => !("type" in value), "Provider reference cannot contain a file discriminator");
2404
2461
  function hash(value) {
2405
2462
  return createHash3("sha256").update(canonicalAgentJson2(value)).digest("hex");
2406
2463
  }
2407
- function checkFileData(ids, value) {
2408
- if (value === null || typeof value !== "object" || Array.isArray(value))
2409
- return;
2410
- if (value.type === "reference" && "reference" in value)
2411
- branchOpaqueJson(ids, value.reference);
2412
- else if (!("type" in value) && value.binary !== true)
2413
- branchOpaqueJson(ids, value);
2464
+ function rekeyProviderOptions(ids, options) {
2465
+ return ProviderOptionsRecordSchema.parse(branchOpaqueJson(ids, options));
2466
+ }
2467
+ function rekeyReference(ids, value) {
2468
+ return ReferenceRecordSchema.parse(branchOpaqueJson(ids, value));
2469
+ }
2470
+ function rekeyContentFileData(ids, value) {
2471
+ if (value.type === "reference") {
2472
+ return { ...value, reference: rekeyReference(ids, value.reference) };
2473
+ }
2474
+ return value;
2475
+ }
2476
+ function isBinaryMarker(value) {
2477
+ return "binary" in value && value.binary === true;
2478
+ }
2479
+ function rekeyFilePartData(ids, value) {
2480
+ if (typeof value === "string")
2481
+ return value;
2482
+ if (isBinaryMarker(value))
2483
+ return value;
2484
+ if ("type" in value) {
2485
+ if (value.type === "reference" && "reference" in value && typeof value.reference === "object" && value.reference !== null) {
2486
+ return { type: "reference", reference: rekeyReference(ids, value.reference) };
2487
+ }
2488
+ return value;
2489
+ }
2490
+ return rekeyReference(ids, value);
2491
+ }
2492
+ function rekeyImagePartData(ids, value) {
2493
+ if (typeof value === "string")
2494
+ return value;
2495
+ if (isBinaryMarker(value))
2496
+ return value;
2497
+ return rekeyReference(ids, value);
2498
+ }
2499
+ function rekeyReasoningFileData(_ids, value) {
2500
+ return value;
2414
2501
  }
2415
2502
 
2416
2503
  class BranchProvider {
@@ -2424,62 +2511,11 @@ class BranchProvider {
2424
2511
  const value = ProviderJournalMessageSchema.parse(raw);
2425
2512
  if (hash(value.message) !== value.sha256)
2426
2513
  throw new TypeError("Branch provider message digest is inconsistent");
2427
- if (value.message.providerOptions)
2428
- branchOpaqueJson(this.ids, value.message.providerOptions);
2514
+ const rekeyedMessageOptions = value.message.providerOptions ? rekeyProviderOptions(this.ids, value.message.providerOptions) : undefined;
2429
2515
  const message = {
2430
2516
  ...value.message,
2431
- content: typeof value.message.content === "string" ? value.message.content : value.message.content.map((part) => {
2432
- if ("providerOptions" in part && part.providerOptions)
2433
- branchOpaqueJson(this.ids, part.providerOptions);
2434
- if (part.type === "file" || part.type === "reasoning-file")
2435
- checkFileData(this.ids, part.data);
2436
- if (part.type === "image")
2437
- checkFileData(this.ids, part.image);
2438
- if (part.type === "tool-call")
2439
- return {
2440
- ...part,
2441
- toolCallId: this.ids.reference("call", part.toolCallId),
2442
- input: branchToolJson(this.ids, part.toolName, part.input, false)
2443
- };
2444
- if (part.type === "tool-result") {
2445
- if ("providerOptions" in part.output && part.output.providerOptions)
2446
- branchOpaqueJson(this.ids, part.output.providerOptions);
2447
- if (part.output.type === "error-json")
2448
- branchOpaqueJson(this.ids, part.output.value);
2449
- if (part.output.type === "content")
2450
- for (const item of part.output.value) {
2451
- if (item.providerOptions)
2452
- branchOpaqueJson(this.ids, item.providerOptions);
2453
- if (item.type === "file")
2454
- checkFileData(this.ids, item.data);
2455
- if ("providerReference" in item)
2456
- branchOpaqueJson(this.ids, item.providerReference);
2457
- if ("fileId" in item && typeof item.fileId !== "string")
2458
- branchOpaqueJson(this.ids, item.fileId);
2459
- }
2460
- return {
2461
- ...part,
2462
- toolCallId: this.ids.reference("call", part.toolCallId),
2463
- output: part.output.type === "json" ? {
2464
- ...part.output,
2465
- value: branchToolJson(this.ids, part.toolName, part.output.value, true)
2466
- } : part.output
2467
- };
2468
- }
2469
- if (part.type === "tool-approval-request")
2470
- return {
2471
- type: part.type,
2472
- approvalId: this.ids.reference("approval", part.approvalId),
2473
- toolCallId: this.ids.reference("call", part.toolCallId),
2474
- ...part.reason !== undefined && { reason: part.reason }
2475
- };
2476
- if (part.type === "tool-approval-response")
2477
- return {
2478
- ...part,
2479
- approvalId: this.ids.reference("approval", part.approvalId)
2480
- };
2481
- return part;
2482
- })
2517
+ ...rekeyedMessageOptions !== undefined && { providerOptions: rekeyedMessageOptions },
2518
+ content: typeof value.message.content === "string" ? value.message.content : value.message.content.map((part) => this.rekeyPart(part))
2483
2519
  };
2484
2520
  const sha256 = hash(message);
2485
2521
  this.digests.set(value.sha256, sha256);
@@ -2506,10 +2542,92 @@ class BranchProvider {
2506
2542
  const value = ProviderJournalResponseSchema.parse(raw);
2507
2543
  return { ...value, runId: this.ids.reference("run", value.runId) };
2508
2544
  }
2545
+ rekeyPart(part) {
2546
+ const providerOptions = "providerOptions" in part && part.providerOptions !== undefined ? rekeyProviderOptions(this.ids, part.providerOptions) : undefined;
2547
+ const base = providerOptions !== undefined ? { ...part, providerOptions } : part;
2548
+ if (base.type === "file") {
2549
+ return { ...base, data: rekeyFilePartData(this.ids, base.data) };
2550
+ }
2551
+ if (base.type === "reasoning-file") {
2552
+ return { ...base, data: rekeyReasoningFileData(this.ids, base.data) };
2553
+ }
2554
+ if (base.type === "image") {
2555
+ return { ...base, image: rekeyImagePartData(this.ids, base.image) };
2556
+ }
2557
+ if (base.type === "tool-call") {
2558
+ return {
2559
+ ...base,
2560
+ toolCallId: this.ids.reference("call", base.toolCallId),
2561
+ input: branchToolJson(this.ids, base.toolName, base.input, false)
2562
+ };
2563
+ }
2564
+ if (base.type === "tool-result") {
2565
+ return {
2566
+ ...base,
2567
+ toolCallId: this.ids.reference("call", base.toolCallId),
2568
+ output: this.rekeyToolResultOutput(base.toolName, base.output)
2569
+ };
2570
+ }
2571
+ if (base.type === "tool-approval-request") {
2572
+ return {
2573
+ type: base.type,
2574
+ approvalId: this.ids.reference("approval", base.approvalId),
2575
+ toolCallId: this.ids.reference("call", base.toolCallId),
2576
+ ...base.reason !== undefined && { reason: base.reason }
2577
+ };
2578
+ }
2579
+ if (base.type === "tool-approval-response") {
2580
+ return {
2581
+ ...base,
2582
+ approvalId: this.ids.reference("approval", base.approvalId)
2583
+ };
2584
+ }
2585
+ return base;
2586
+ }
2587
+ rekeyToolResultOutput(toolName, output) {
2588
+ const providerOptions = "providerOptions" in output && output.providerOptions !== undefined ? rekeyProviderOptions(this.ids, output.providerOptions) : undefined;
2589
+ if (output.type === "json") {
2590
+ return {
2591
+ ...output,
2592
+ ...providerOptions !== undefined && { providerOptions },
2593
+ value: branchToolJson(this.ids, toolName, output.value, true)
2594
+ };
2595
+ }
2596
+ if (output.type === "error-json") {
2597
+ return {
2598
+ ...output,
2599
+ ...providerOptions !== undefined && { providerOptions },
2600
+ value: branchOpaqueJson(this.ids, output.value)
2601
+ };
2602
+ }
2603
+ if (output.type === "content") {
2604
+ return {
2605
+ ...output,
2606
+ value: output.value.map((item) => {
2607
+ const itemOptions = item.providerOptions !== undefined ? rekeyProviderOptions(this.ids, item.providerOptions) : undefined;
2608
+ const next = itemOptions !== undefined ? { ...item, providerOptions: itemOptions } : item;
2609
+ if (next.type === "file") {
2610
+ return { ...next, data: rekeyContentFileData(this.ids, next.data) };
2611
+ }
2612
+ if (next.type === "file-reference" || next.type === "image-file-reference") {
2613
+ return {
2614
+ ...next,
2615
+ providerReference: rekeyReference(this.ids, next.providerReference)
2616
+ };
2617
+ }
2618
+ if ((next.type === "file-id" || next.type === "image-file-id") && typeof next.fileId !== "string") {
2619
+ return { ...next, fileId: rekeyReference(this.ids, next.fileId) };
2620
+ }
2621
+ return next;
2622
+ })
2623
+ };
2624
+ }
2625
+ return providerOptions !== undefined ? { ...output, providerOptions } : output;
2626
+ }
2509
2627
  }
2510
2628
 
2511
2629
  // src/agent-runtime/branch-transitions.ts
2512
- import { z as z18 } from "zod";
2630
+ import { z as z19 } from "zod";
2513
2631
  function rekeyBranchTransition(ids, source, operation) {
2514
2632
  const message = (value) => branchMessage(ids, source, value);
2515
2633
  const input = operation.input;
@@ -2581,11 +2699,11 @@ function rekeyBranchTransition(ids, source, operation) {
2581
2699
  }
2582
2700
  }
2583
2701
  function branchJson(value) {
2584
- return z18.json().parse(value);
2702
+ return z19.json().parse(value);
2585
2703
  }
2586
2704
 
2587
2705
  // src/agent-runtime/branch-events.ts
2588
- var Hash3 = z19.string().regex(/^[a-f0-9]{64}$/);
2706
+ var Hash3 = z20.string().regex(/^[a-f0-9]{64}$/);
2589
2707
  function rekeyBranchEvents(ids, source, events, retainedMessages = new Map) {
2590
2708
  try {
2591
2709
  const hydrated = events.map((event) => atEvent(ids, event, () => {
@@ -2649,14 +2767,14 @@ function rekeyBranchEvent(ids, source, event, provider) {
2649
2767
  if (event.kind === "runtime/transition") {
2650
2768
  const operation = branchTransition(event);
2651
2769
  const rekeyed = rekeyBranchTransition(ids, source, operation);
2652
- const raw = z19.object({
2653
- type: z19.string(),
2654
- input: z19.object({
2655
- assistant: z19.object({
2770
+ const raw = z20.object({
2771
+ type: z20.string(),
2772
+ input: z20.object({
2773
+ assistant: z20.object({
2656
2774
  sha256: Hash3.optional(),
2657
2775
  sourceSha256: Hash3.optional(),
2658
- bytes: z19.int(),
2659
- parts: z19.int()
2776
+ bytes: z20.int(),
2777
+ parts: z20.int()
2660
2778
  }).passthrough()
2661
2779
  }).passthrough()
2662
2780
  }).passthrough().safeParse(event.payload);
@@ -2764,6 +2882,9 @@ class BranchIdentities {
2764
2882
  this.definitions.set(kind, values);
2765
2883
  return target;
2766
2884
  }
2885
+ defineExpiredSpill(source) {
2886
+ return this.define("spill", source);
2887
+ }
2767
2888
  within(address, work) {
2768
2889
  const outer = this.address;
2769
2890
  this.address = { ...outer, ...address };
@@ -2904,22 +3025,22 @@ class BranchIdentities {
2904
3025
 
2905
3026
  // src/agent-runtime/branch-source.ts
2906
3027
  import { createHash as createHash6 } from "node:crypto";
2907
- import { z as z21 } from "zod";
3028
+ import { z as z22 } from "zod";
2908
3029
 
2909
3030
  // src/agent-runtime/archive-spill.ts
2910
3031
  import { createHash as createHash5 } from "node:crypto";
2911
- import { z as z20 } from "zod";
2912
- var ArchiveSpillSchema = z20.object({
2913
- reference: z20.string().min(1),
2914
- runId: z20.string().min(1).optional(),
2915
- toolCallId: z20.string().min(1).optional(),
2916
- mediaType: z20.string().min(1),
2917
- bytes: z20.int().nonnegative(),
2918
- sha256: z20.string().regex(/^[a-f0-9]{64}$/),
2919
- createdAt: z20.iso.datetime({ offset: true }),
2920
- expiresAt: z20.iso.datetime({ offset: true }).optional(),
3032
+ import { z as z21 } from "zod";
3033
+ var ArchiveSpillSchema = z21.object({
3034
+ reference: z21.string().min(1),
3035
+ runId: z21.string().min(1).optional(),
3036
+ toolCallId: z21.string().min(1).optional(),
3037
+ mediaType: z21.string().min(1),
3038
+ bytes: z21.int().nonnegative(),
3039
+ sha256: z21.string().regex(/^[a-f0-9]{64}$/),
3040
+ createdAt: z21.iso.datetime({ offset: true }),
3041
+ expiresAt: z21.iso.datetime({ offset: true }).optional(),
2921
3042
  authorization: AgentCodingToolAuthorizationSchema2.optional(),
2922
- base64: z20.string()
3043
+ base64: z21.string()
2923
3044
  }).strict().superRefine((spill, ctx) => {
2924
3045
  const bytes = Buffer.from(spill.base64, "base64");
2925
3046
  if (bytes.toString("base64") !== spill.base64 || bytes.byteLength !== spill.bytes || createHash5("sha256").update(bytes).digest("hex") !== spill.sha256) {
@@ -2931,7 +3052,7 @@ var ArchiveSpillSchema = z20.object({
2931
3052
  });
2932
3053
 
2933
3054
  // src/agent-runtime/branch-source.ts
2934
- var SnapshotProjection = z21.object({ archiveType: z21.literal("runtime-snapshot"), snapshot: AgentSnapshotSchema2 }).strict();
3055
+ var SnapshotProjection = z22.object({ archiveType: z22.literal("runtime-snapshot"), snapshot: AgentSnapshotSchema2 }).strict();
2935
3056
  function branchHash(value) {
2936
3057
  return createHash6("sha256").update(canonicalAgentJson2(value)).digest("hex");
2937
3058
  }
@@ -2948,13 +3069,13 @@ function boundary(events, throughRunId) {
2948
3069
  for (const event of events) {
2949
3070
  if (event.kind !== "runtime/transition")
2950
3071
  continue;
2951
- const candidate = z21.object({
2952
- type: z21.string(),
2953
- input: z21.object({
2954
- runId: z21.string().optional(),
2955
- reason: z21.string().optional(),
2956
- action: z21.string().optional(),
2957
- absorb: z21.array(z21.object({ runId: z21.string() })).optional()
3072
+ const candidate = z22.object({
3073
+ type: z22.string(),
3074
+ input: z22.object({
3075
+ runId: z22.string().optional(),
3076
+ reason: z22.string().optional(),
3077
+ action: z22.string().optional(),
3078
+ absorb: z22.array(z22.object({ runId: z22.string() })).optional()
2958
3079
  })
2959
3080
  }).safeParse(event.payload);
2960
3081
  if (!candidate.success)
@@ -2965,6 +3086,83 @@ function boundary(events, throughRunId) {
2965
3086
  }
2966
3087
  throw new TypeError("Branch boundary run has no exact settled event");
2967
3088
  }
3089
+ function integrityRefusal(message, address) {
3090
+ return new AgentConversationBranchRefusedError2([
3091
+ { ...address ?? {}, code: "integrity", message }
3092
+ ]);
3093
+ }
3094
+ function collectExpiredSpills(events, liveSpills) {
3095
+ const created = new Map;
3096
+ const deleted = new Map;
3097
+ for (const event of events) {
3098
+ let sourceKind = event.kind;
3099
+ let payload = event.payload;
3100
+ if (event.kind === "runtime/branch-observation") {
3101
+ const obs = BranchObservationSchema.safeParse(event.payload);
3102
+ if (!obs.success)
3103
+ continue;
3104
+ sourceKind = obs.data.sourceKind;
3105
+ payload = obs.data.payload;
3106
+ }
3107
+ if (sourceKind !== "spill/created" && sourceKind !== "spill/deleted")
3108
+ continue;
3109
+ const parsed = SpillEventPayloadSchema.safeParse(payload);
3110
+ if (!parsed.success) {
3111
+ throw integrityRefusal(`Branch archive has malformed ${sourceKind} payload`, {
3112
+ seq: event.seq,
3113
+ eventKind: event.kind
3114
+ });
3115
+ }
3116
+ const { reference, bytes, sha256 } = parsed.data;
3117
+ if (sourceKind === "spill/created") {
3118
+ if (created.has(reference)) {
3119
+ throw integrityRefusal("Branch archive has duplicate spill/created event", {
3120
+ seq: event.seq,
3121
+ eventKind: event.kind
3122
+ });
3123
+ }
3124
+ created.set(reference, { seq: event.seq, bytes, ...sha256 ? { sha256 } : {} });
3125
+ } else {
3126
+ if (deleted.has(reference)) {
3127
+ throw integrityRefusal("Branch archive has duplicate spill/deleted event", {
3128
+ seq: event.seq,
3129
+ eventKind: event.kind
3130
+ });
3131
+ }
3132
+ const origin = created.get(reference);
3133
+ if (!origin || event.seq <= origin.seq) {
3134
+ throw integrityRefusal("Branch archive has spill/deleted without prior spill/created", {
3135
+ seq: event.seq,
3136
+ eventKind: event.kind
3137
+ });
3138
+ }
3139
+ if (origin.bytes !== bytes || origin.sha256 !== undefined && sha256 !== undefined && origin.sha256 !== sha256) {
3140
+ throw integrityRefusal("Branch archive spill/deleted disagrees with spill/created", {
3141
+ seq: event.seq,
3142
+ eventKind: event.kind
3143
+ });
3144
+ }
3145
+ deleted.set(reference, {
3146
+ seq: event.seq,
3147
+ bytes,
3148
+ ...sha256 !== undefined ? { sha256 } : origin.sha256 !== undefined ? { sha256: origin.sha256 } : {}
3149
+ });
3150
+ }
3151
+ }
3152
+ const liveSet = new Set(liveSpills.map((spill) => spill.reference));
3153
+ for (const [ref, meta] of deleted) {
3154
+ if (liveSet.has(ref)) {
3155
+ throw integrityRefusal("Branch archive has both a live spill and spill/deleted", {
3156
+ seq: meta.seq,
3157
+ eventKind: "spill/deleted"
3158
+ });
3159
+ }
3160
+ }
3161
+ return {
3162
+ expiredSpills: [...deleted.keys()].sort(),
3163
+ deletedMeta: deleted
3164
+ };
3165
+ }
2968
3166
  function prepareBranchSource(bytes, {
2969
3167
  source,
2970
3168
  applicationFiles = [],
@@ -2977,7 +3175,7 @@ function prepareBranchSource(bytes, {
2977
3175
  if (event.seq !== index + 1)
2978
3176
  throw new TypeError("Branch source event sequence is incomplete");
2979
3177
  }
2980
- const projections = archive.projections.map((value) => z21.union([SnapshotProjection, ArchiveProjectionSchema]).parse(value));
3178
+ const projections = archive.projections.map((value) => z22.union([SnapshotProjection, ArchiveProjectionSchema]).parse(value));
2981
3179
  if (projections.some((value, index) => canonicalAgentJson2(value) !== canonicalAgentJson2(archive.projections[index])))
2982
3180
  throw new TypeError("Branch archive snapshot contains an unknown opaque field");
2983
3181
  const snapshots = projections.filter((value) => ("archiveType" in value));
@@ -2997,10 +3195,13 @@ function prepareBranchSource(bytes, {
2997
3195
  const allSpills = archive.spills.map((value) => ArchiveSpillSchema.parse(value));
2998
3196
  if (new Set(allSpills.map((spill) => spill.reference)).size !== allSpills.length)
2999
3197
  throw new TypeError("Branch archive has duplicate spill identities");
3198
+ const { expiredSpills: allExpiredSpills, deletedMeta } = collectExpiredSpills(archive.events, allSpills);
3000
3199
  const full = replayBranchEvents(archive.conversationId, archive.events, expected);
3001
3200
  const validationIds = new BranchIdentities("branch-validation", "branch-validation", archive.conversationId);
3002
3201
  for (const spill of allSpills)
3003
3202
  validationIds.define("spill", spill.reference);
3203
+ for (const expired of allExpiredSpills)
3204
+ validationIds.defineExpiredSpill(expired);
3004
3205
  validationIds.declareApplicationFiles(applicationFiles);
3005
3206
  validationIds.declareApplicationKeys(applicationKeys);
3006
3207
  rekeyBranchEvents(validationIds, archive.conversationId, archive.events, full.retainedMessages);
@@ -3023,17 +3224,33 @@ function prepareBranchSource(bytes, {
3023
3224
  const selectedIds = new BranchIdentities("branch-validation", "branch-validation", archive.conversationId);
3024
3225
  for (const spill of allSpills)
3025
3226
  selectedIds.define("spill", spill.reference);
3227
+ for (const expired of allExpiredSpills)
3228
+ selectedIds.defineExpiredSpill(expired);
3026
3229
  selectedIds.declareApplicationFiles(applicationFiles);
3027
3230
  selectedIds.declareApplicationKeys(applicationKeys);
3028
3231
  rekeyBranchEvents(selectedIds, archive.conversationId, events, replay.retainedMessages);
3029
3232
  const references = selectedIds.referenced("spill");
3030
3233
  const spills = allSpills.filter((spill) => references.has(spill.reference));
3031
- if (spills.length !== references.size)
3032
- throw new TypeError("Branch source is missing a referenced spill");
3234
+ const expiredSpills = allExpiredSpills.filter((ref) => references.has(ref));
3235
+ if (spills.length + expiredSpills.length !== references.size)
3236
+ throw integrityRefusal("Branch source is missing a referenced spill");
3237
+ const tailDeletedSpills = [];
3238
+ for (const ref of expiredSpills) {
3239
+ const meta = deletedMeta.get(ref);
3240
+ if (meta && meta.seq > seq) {
3241
+ tailDeletedSpills.push({
3242
+ reference: ref,
3243
+ bytes: meta.bytes,
3244
+ ...meta.sha256 !== undefined && { sha256: meta.sha256 }
3245
+ });
3246
+ }
3247
+ }
3033
3248
  return {
3034
3249
  conversationId: archive.conversationId,
3035
3250
  events,
3036
3251
  spills,
3252
+ expiredSpills,
3253
+ tailDeletedSpills,
3037
3254
  replay,
3038
3255
  ...refused && { refused },
3039
3256
  applicationFiles: validationIds.applicationFileReferences(),
@@ -3041,6 +3258,7 @@ function prepareBranchSource(bytes, {
3041
3258
  conversationId: archive.conversationId,
3042
3259
  events,
3043
3260
  spills,
3261
+ expiredSpills,
3044
3262
  snapshot: replay.snapshot
3045
3263
  })
3046
3264
  };
@@ -3165,6 +3383,8 @@ async function branchConversation(driver, raw) {
3165
3383
  const ids = new BranchIdentities(input.destinationConversationId, input.requestKey, source.conversationId);
3166
3384
  for (const spill of source.spills)
3167
3385
  ids.define("spill", spill.reference);
3386
+ for (const expired of source.expiredSpills)
3387
+ ids.defineExpiredSpill(expired);
3168
3388
  ids.declareApplicationFiles(input.applicationFiles ?? []);
3169
3389
  ids.declareApplicationKeys(input.applicationKeys ?? []);
3170
3390
  const events = rekeyBranchEvents(ids, source.conversationId, source.events, source.replay.retainedMessages);
@@ -3220,18 +3440,32 @@ async function branchConversation(driver, raw) {
3220
3440
  if (appended.seq !== event.seq)
3221
3441
  throw new TypeError("Branch event sequence changed");
3222
3442
  }
3443
+ for (const tail of source.tailDeletedSpills) {
3444
+ await driver.events.append(tx, agentStoreEventDraft({
3445
+ conversationId: input.destinationConversationId,
3446
+ kind: "runtime/branch-observation",
3447
+ payload: {
3448
+ sourceKind: "spill/deleted",
3449
+ payload: {
3450
+ reference: ids.reference("spill", tail.reference),
3451
+ bytes: tail.bytes,
3452
+ ...tail.sha256 !== undefined && { sha256: tail.sha256 }
3453
+ }
3454
+ }
3455
+ }));
3456
+ }
3223
3457
  await driver.archive?.import(tx, {
3224
3458
  format: "stitchkit.agent-conversation",
3225
3459
  formatVersion: 1,
3226
3460
  conversationId: input.destinationConversationId,
3227
3461
  events: [],
3228
3462
  projections: [],
3229
- spills: z22.array(z22.json()).parse(spills)
3463
+ spills: z23.array(z23.json()).parse(spills)
3230
3464
  });
3231
3465
  await driver.events.append(tx, agentStoreEventDraft({
3232
3466
  conversationId: input.destinationConversationId,
3233
3467
  kind: "runtime/branched",
3234
- payload: z22.json().parse(receipt)
3468
+ payload: z23.json().parse(receipt)
3235
3469
  }));
3236
3470
  return { outcome: "created", receipt };
3237
3471
  });
@@ -3270,7 +3504,7 @@ function findEventOnce(driver, input) {
3270
3504
  }
3271
3505
 
3272
3506
  // src/agent-runtime/store-mutate.ts
3273
- import { z as z23 } from "zod";
3507
+ import { z as z24 } from "zod";
3274
3508
  function validateAdmissionReceipt(receipt, record, conversationId) {
3275
3509
  const input = receipt.input;
3276
3510
  const run = record.run;
@@ -3417,7 +3651,7 @@ async function persistApplied(driver, transaction, read, operation, reduced) {
3417
3651
  await driver.events.append(transaction, agentStoreEventDraft({
3418
3652
  conversationId,
3419
3653
  kind: "runtime/transition",
3420
- payload: z23.json().parse(transitionRecord(operation, reduced))
3654
+ payload: z24.json().parse(transitionRecord(operation, reduced))
3421
3655
  }));
3422
3656
  return { outcome: "applied", snapshot: reduced.snapshot };
3423
3657
  }
@@ -3466,9 +3700,9 @@ function createStoreConversationPurge(driver, conversations) {
3466
3700
  }
3467
3701
 
3468
3702
  // src/agent-runtime/store-create.ts
3469
- var AgentRecoverableScanInputSchema = z24.object({
3470
- cursor: z24.string().min(1).optional(),
3471
- limit: z24.number().int().min(1).max(1000)
3703
+ var AgentRecoverableScanInputSchema = z25.object({
3704
+ cursor: z25.string().min(1).optional(),
3705
+ limit: z25.number().int().min(1).max(1000)
3472
3706
  });
3473
3707
  function createAgentRuntimeStore2(driver) {
3474
3708
  const capabilities = driverCapabilities(driver);
@@ -3489,6 +3723,25 @@ function createAgentRuntimeStore2(driver) {
3489
3723
  ...driver.conversations && {
3490
3724
  purgeConversation: createStoreConversationPurge(driver, driver.conversations)
3491
3725
  },
3726
+ ...driver.events.redactExpiredPayloads && {
3727
+ async purgeExpiredPayloads(rawInput) {
3728
+ const parsed = PurgeInvocationPayloadsInputSchema2.parse(rawInput);
3729
+ const redact = driver.events.redactExpiredPayloads;
3730
+ if (!redact)
3731
+ throw new TypeError("Agent runtime store does not support payload purge");
3732
+ const before = new Date(Date.parse(parsed.before)).toISOString();
3733
+ const expiredAt = new Date().toISOString();
3734
+ const result = await driver.transaction((tx) => redact(tx, {
3735
+ before,
3736
+ expiredAt,
3737
+ ...parsed.conversationId !== undefined && {
3738
+ conversationId: parsed.conversationId
3739
+ },
3740
+ limit: parsed.limit ?? 1000
3741
+ }));
3742
+ return PurgeInvocationPayloadsResultSchema2.parse(result);
3743
+ }
3744
+ },
3492
3745
  acceptInputAndAssignRun: (input) => mutate({
3493
3746
  type: "accept",
3494
3747
  input: AcceptInputAndAssignRunSchema2.parse(input)
@@ -3523,4 +3776,4 @@ function createAgentRuntimeStore2(driver) {
3523
3776
  };
3524
3777
  }
3525
3778
 
3526
- export { AgentBranchRefusalCodeSchema2, AgentBranchRefusalSchema2, AgentConversationBranchRefusedError2, BranchAgentConversationInputSchema2, AgentConversationBranchReceiptSchema2, AgentConversationBranchResultSchema2, AgentConversationBranchPlanSchema2, defineAgentTool, SqlIntegerSchema, HeadRowSchema, MessageRowSchema, PositionedMessageRowSchema, CountRowSchema, FlagSchema, EVENT_COLUMNS, parseJson, encodeJson, missing, placeholders, parseRunRow, parseEventRow, nextEventSeqByMaximum, AgentChildBudgetSchema2, AgentChildStateSchema2, AgentChildRecordSchema2, AgentChildBlockingKindSchema2, AgentChildBlockingSourceSchema2, AgentChildBlockingEventSchema2, ChildBlockingDecisionSchema, ChildSpawnedEventPayloadSchema, ChildStateEventPayloadSchema, parseChild, usageNumbers, AgentConversationPurgeInputSchema2, AgentConversationPurgeResultSchema2, AgentConversationPurgedError2, purgeAgentConversation2, DeferredAgentToolSearchInputSchema2, DeferredAgentToolMatchSchema2, DeferredAgentToolReceiptSchema2, agentSqlTables, isRetryablePostgresConflict, POSTGRES_ISOLATION, postgresSession, setPostgresTransactionIsolation, runPostgresTransaction, AgentEventSearchResultSchema2, createAgentEventSearch2, createAgentEventSearchTools2, AgentStoreUnsupportedCapabilityError2, ArchiveProjectionSchema, isRuntimeSnapshotEntry, replaceMessage, appendEventIn, ArchiveSpillSchema, createAgentRuntimeStore2 };
3779
+ export { AgentBranchRefusalCodeSchema2, AgentBranchRefusalSchema2, AgentConversationBranchRefusedError2, BranchAgentConversationInputSchema2, AgentConversationBranchReceiptSchema2, AgentConversationBranchResultSchema2, AgentConversationBranchPlanSchema2, defineAgentToolDescriptor, bindAgentTool, SqlIntegerSchema, HeadRowSchema, MessageRowSchema, PositionedMessageRowSchema, CountRowSchema, FlagSchema, EVENT_COLUMNS, parseJson, encodeJson, missing, placeholders, parseRunRow, parseEventRow, nextEventSeqByMaximum, AgentChildBudgetSchema2, AgentChildStateSchema2, AgentChildRecordSchema2, AgentChildBlockingKindSchema2, AgentChildBlockingSourceSchema2, AgentChildBlockingEventSchema2, ChildBlockingDecisionSchema, ChildSpawnedEventPayloadSchema, ChildStateEventPayloadSchema, parseChild, usageNumbers, AgentConversationPurgeInputSchema2, AgentConversationPurgeResultSchema2, AgentConversationPurgedError2, purgeAgentConversation2, DeferredAgentToolSearchInputSchema2, DeferredAgentToolMatchSchema2, DeferredAgentToolReceiptSchema2, agentSqlTables, isRetryablePostgresConflict, POSTGRES_ISOLATION, postgresSession, setPostgresTransactionIsolation, runPostgresTransaction, AgentEventSearchResultSchema2, createAgentEventSearch2, AGENT_EVENT_SEARCH_TOOL_DESCRIPTORS2, createAgentEventSearchTools2, AgentStoreUnsupportedCapabilityError2, ArchiveProjectionSchema, isRuntimeSnapshotEntry, replaceMessage, appendEventIn, ArchiveSpillSchema, createAgentRuntimeStore2 };