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
@@ -35,7 +35,8 @@ import {
35
35
  AgentConversationBranchReceiptSchema2,
36
36
  AgentConversationBranchResultSchema2,
37
37
  AgentConversationBranchPlanSchema2,
38
- defineAgentTool,
38
+ defineAgentToolDescriptor,
39
+ bindAgentTool,
39
40
  SqlIntegerSchema,
40
41
  AgentChildBudgetSchema2,
41
42
  AgentChildStateSchema2,
@@ -57,14 +58,15 @@ import {
57
58
  DeferredAgentToolReceiptSchema2,
58
59
  AgentEventSearchResultSchema2,
59
60
  createAgentEventSearch2,
61
+ AGENT_EVENT_SEARCH_TOOL_DESCRIPTORS2,
60
62
  createAgentEventSearchTools2,
61
63
  AgentStoreUnsupportedCapabilityError2,
62
64
  createAgentRuntimeStore2
63
- } from "../index-bbzvrq66.js";
65
+ } from "../index-dcsxj68j.js";
64
66
  import {
65
67
  AgentCodingToolAuthorizationSchema2,
66
68
  refuseUnknownSpillReference
67
- } from "../index-wavv538x.js";
69
+ } from "../index-ybdq8kk2.js";
68
70
  import {
69
71
  AgentProviderEnvelopeSchema2,
70
72
  AgentTextPartSchema2,
@@ -117,17 +119,21 @@ import {
117
119
  } from "../index-9xr44d2g.js";
118
120
  import"../index-brhhaygm.js";
119
121
  import {
122
+ PurgeInvocationPayloadsInputSchema2,
123
+ PurgeInvocationPayloadsResultSchema2,
120
124
  ModelInvocationTraceSchema2,
121
125
  CompletionInvocationInputSchema2,
126
+ InvocationPayloadOmissionReasonSchema2,
122
127
  InvocationResponseSchema,
123
128
  ModelInvocationRecordSchema2,
129
+ ModelInvocationPayloadReadSchema2,
124
130
  isModelInvocationRecord,
125
131
  isAssistantHistoryEvidence2,
126
132
  isCompleteAgentHistoryTurn
127
- } from "../index-ajmtxsky.js";
133
+ } from "../index-vgzhw2zk.js";
128
134
  import {
129
135
  createBoundedSinkManager
130
- } from "../index-prf6ayhf.js";
136
+ } from "../index-13wmzpa6.js";
131
137
  import {
132
138
  AgentAdmissionEventSchema2,
133
139
  AgentTransientDeltaEventSchema2,
@@ -156,6 +162,7 @@ import {
156
162
  AgentStepSpendProviderSchema,
157
163
  AgentStepSpendSchema2,
158
164
  normalizeStepUsage,
165
+ InvocationPayloadTooLargeError2,
159
166
  currentModelInvocationAttempt2,
160
167
  AgentModelCapabilitySchema2,
161
168
  AgentModelDescriptorSchema2,
@@ -172,7 +179,7 @@ import {
172
179
  createMemoryAgentModelSelectionStore2,
173
180
  defineModelRegistry2,
174
181
  validateAgentModelSnapshot2
175
- } from "../index-kmbpej2y.js";
182
+ } from "../index-emgrmavr.js";
176
183
  import {
177
184
  AgentConversationSummarySchema2,
178
185
  AgentConversationPageSchema2,
@@ -184,13 +191,16 @@ import"../index-27hck3z2.js";
184
191
  import"../index-ngwf1s3c.js";
185
192
  import"../index-360j58vb.js";
186
193
  import"../index-j903yhp4.js";
187
- import"../index-9wh98cpa.js";
194
+ import {
195
+ resolveToolAccess
196
+ } from "../index-n3bm7zqq.js";
188
197
  import"../index-yt1gg11x.js";
189
- import"../index-3ypvpkwr.js";
198
+ import"../index-669374qc.js";
199
+ import"../index-fgahdc7s.js";
190
200
  import"../index-werjqesf.js";
191
201
  import {
192
202
  mountAgent2
193
- } from "../index-3b31z0pc.js";
203
+ } from "../index-znd1b57f.js";
194
204
  import {
195
205
  AgentContextOverflowError2,
196
206
  createAgentSessionCoordinator2,
@@ -217,9 +227,9 @@ import {
217
227
  agentGoalStateSlot2,
218
228
  agentTodoStateSlot2,
219
229
  createAgentRuntime2
220
- } from "../index-qnzhmk2s.js";
230
+ } from "../index-17qgm6xe.js";
221
231
  import"../index-m38ej7e5.js";
222
- import"../index-d4svrknj.js";
232
+ import"../index-39c2hj6h.js";
223
233
  import {
224
234
  DURABILITY_STEP_EVENT_KIND2,
225
235
  StepResultDecodeError2,
@@ -231,26 +241,23 @@ import {
231
241
  import"../index-kynwa08q.js";
232
242
  import"../index-6kec3b14.js";
233
243
  import"../index-v59pxmf1.js";
234
- import"../index-7kfcb576.js";
244
+ import"../index-qa2jjb65.js";
235
245
  import {
236
246
  createMemoryAgentRuntimeStore2
237
- } from "../index-j516jaaz.js";
247
+ } from "../index-dnzxxf8a.js";
238
248
  import {
239
249
  createAgentRuntimeEventSink2
240
- } from "../index-wv8dqy7q.js";
250
+ } from "../index-205456mf.js";
241
251
  import"../index-rj32hkkp.js";
242
- import"../index-bmaz3jzy.js";
252
+ import"../index-rjs94dny.js";
243
253
  import"../index-xrgn784x.js";
244
254
  import {
245
255
  buildToolManifest2
246
- } from "../index-d96c1n1q.js";
247
- import"../index-3agqmmrg.js";
256
+ } from "../index-5tdc0q43.js";
257
+ import"../index-mkfhpk11.js";
248
258
  import"../index-wa6h4tz6.js";
249
259
  import"../index-jb4m241t.js";
250
- import"../index-5e0zsbf7.js";
251
- import {
252
- resolveToolAccess
253
- } from "../index-ax3wns1a.js";
260
+ import"../index-x2fb37t0.js";
254
261
  import {
255
262
  defineRuntimeTool2,
256
263
  executableAgentRuntimeTools
@@ -262,7 +269,7 @@ import {
262
269
  } from "../index-y7sy1xdp.js";
263
270
  import {
264
271
  assertPositiveSafeInteger
265
- } from "../index-kzavdze2.js";
272
+ } from "../index-gr0kxymw.js";
266
273
  import {
267
274
  withDeadline
268
275
  } from "../index-agy5fqgf.js";
@@ -1063,47 +1070,87 @@ function createAgentChildManager(input) {
1063
1070
  }
1064
1071
 
1065
1072
  // src/agent-runtime/child-tools.ts
1073
+ var ChildSpawnInputSchema = z3.object({
1074
+ childInput: z3.json(),
1075
+ budget: AgentChildBudgetSchema2,
1076
+ seedUptoSeq: z3.int().positive().optional()
1077
+ }).strict();
1078
+ var ChildSpawnOutputSchema = z3.object({
1079
+ childConversationId: z3.string(),
1080
+ state: z3.string(),
1081
+ resultReference: z3.string().optional()
1082
+ });
1083
+ var SUBAGENT_DESCRIPTOR = defineAgentToolDescriptor({
1084
+ name: "subagent",
1085
+ description: "Run a child conversation seeded from the current durable parent history.",
1086
+ identity: { serviceName: "agent-children", action: "spawn", method: "POST" },
1087
+ input: ChildSpawnInputSchema,
1088
+ output: ChildSpawnOutputSchema,
1089
+ expose: ["AGENT"]
1090
+ });
1091
+ var SUBAGENT_FORK_DESCRIPTOR = defineAgentToolDescriptor({
1092
+ name: "subagent_fork",
1093
+ description: "Run a child conversation seeded from the parent through one exact event sequence.",
1094
+ identity: { serviceName: "agent-children", action: "fork", method: "POST" },
1095
+ input: ChildSpawnInputSchema,
1096
+ output: ChildSpawnOutputSchema,
1097
+ expose: ["AGENT"]
1098
+ });
1099
+ var LIST_AGENTS_DESCRIPTOR = defineAgentToolDescriptor({
1100
+ name: "list_agents",
1101
+ description: "List the durable child graph of this conversation.",
1102
+ identity: { serviceName: "agent-children", action: "list", method: "GET" },
1103
+ input: z3.object({}).strict(),
1104
+ output: z3.object({ children: z3.array(AgentChildRecordSchema2) }),
1105
+ expose: ["AGENT"]
1106
+ });
1107
+ var SEND_MESSAGE_DESCRIPTOR = defineAgentToolDescriptor({
1108
+ name: "send_message",
1109
+ description: "Send one follow-up input to an active child conversation.",
1110
+ identity: { serviceName: "agent-children", action: "message", method: "POST" },
1111
+ input: z3.object({
1112
+ childConversationId: z3.string().min(1),
1113
+ input: z3.json()
1114
+ }).strict(),
1115
+ output: z3.object({ sent: z3.literal(true) }),
1116
+ expose: ["AGENT"]
1117
+ });
1118
+ var INTERRUPT_AGENT_DESCRIPTOR = defineAgentToolDescriptor({
1119
+ name: "interrupt_agent",
1120
+ description: "Stop one active child conversation at a durable policy boundary.",
1121
+ identity: { serviceName: "agent-children", action: "interrupt", method: "POST" },
1122
+ input: z3.object({ childConversationId: z3.string().min(1) }).strict(),
1123
+ output: z3.object({ interrupted: z3.literal(true) }),
1124
+ expose: ["AGENT"]
1125
+ });
1126
+ var AGENT_CHILD_TOOL_DESCRIPTORS = Object.freeze([
1127
+ SUBAGENT_DESCRIPTOR,
1128
+ SUBAGENT_FORK_DESCRIPTOR,
1129
+ LIST_AGENTS_DESCRIPTOR,
1130
+ SEND_MESSAGE_DESCRIPTOR,
1131
+ INTERRUPT_AGENT_DESCRIPTOR
1132
+ ]);
1066
1133
  function childTool({ manager, run }, conversationId, fork) {
1067
- return defineAgentTool({
1068
- name: fork ? "subagent_fork" : "subagent",
1069
- description: fork ? "Run a child conversation seeded from the parent through one exact event sequence." : "Run a child conversation seeded from the current durable parent history.",
1070
- identity: {
1071
- serviceName: "agent-children",
1072
- action: fork ? "fork" : "spawn",
1073
- method: "POST"
1074
- },
1075
- input: z3.object({
1076
- childInput: z3.json(),
1077
- budget: AgentChildBudgetSchema2,
1078
- seedUptoSeq: z3.int().positive().optional()
1079
- }).strict(),
1080
- output: z3.object({
1081
- childConversationId: z3.string(),
1082
- state: z3.string(),
1083
- resultReference: z3.string().optional()
1084
- }),
1085
- expose: ["AGENT"],
1086
- handler: async ({ input }) => {
1087
- if (fork && input.seedUptoSeq === undefined) {
1088
- throw new TypeError("subagent_fork requires seedUptoSeq");
1089
- }
1090
- run.signal.throwIfAborted();
1091
- const child = await manager.spawnChild({
1092
- parentConversationId: conversationId,
1093
- childInput: input.childInput,
1094
- budget: input.budget,
1095
- ...input.seedUptoSeq !== undefined && { seedUptoSeq: input.seedUptoSeq }
1096
- });
1097
- await manager.waitChild(child.childConversationId);
1098
- const finished = (await manager.listChildren(conversationId)).find((record) => record.childConversationId === child.childConversationId);
1099
- if (!finished)
1100
- throw new Error("Child record disappeared after settlement");
1101
- return {
1102
- childConversationId: finished.childConversationId,
1103
- state: finished.state,
1104
- ...finished.resultReference && { resultReference: finished.resultReference }
1105
- };
1134
+ return bindAgentTool(fork ? SUBAGENT_FORK_DESCRIPTOR : SUBAGENT_DESCRIPTOR, async ({ input }) => {
1135
+ if (fork && input.seedUptoSeq === undefined) {
1136
+ throw new TypeError("subagent_fork requires seedUptoSeq");
1106
1137
  }
1138
+ run.signal.throwIfAborted();
1139
+ const child = await manager.spawnChild({
1140
+ parentConversationId: conversationId,
1141
+ childInput: input.childInput,
1142
+ budget: input.budget,
1143
+ ...input.seedUptoSeq !== undefined && { seedUptoSeq: input.seedUptoSeq }
1144
+ });
1145
+ await manager.waitChild(child.childConversationId);
1146
+ const finished = (await manager.listChildren(conversationId)).find((record) => record.childConversationId === child.childConversationId);
1147
+ if (!finished)
1148
+ throw new Error("Child record disappeared after settlement");
1149
+ return {
1150
+ childConversationId: finished.childConversationId,
1151
+ state: finished.state,
1152
+ ...finished.resultReference && { resultReference: finished.resultReference }
1153
+ };
1107
1154
  });
1108
1155
  }
1109
1156
  function createAgentChildTools(config) {
@@ -1112,41 +1159,16 @@ function createAgentChildTools(config) {
1112
1159
  return [
1113
1160
  childTool(config, conversationId, false),
1114
1161
  childTool(config, conversationId, true),
1115
- defineAgentTool({
1116
- name: "list_agents",
1117
- description: "List the durable child graph of this conversation.",
1118
- identity: { serviceName: "agent-children", action: "list", method: "GET" },
1119
- input: z3.object({}).strict(),
1120
- output: z3.object({ children: z3.array(AgentChildRecordSchema2) }),
1121
- expose: ["AGENT"],
1122
- handler: async () => ({ children: [...await manager.listChildren(conversationId)] })
1123
- }),
1124
- defineAgentTool({
1125
- name: "send_message",
1126
- description: "Send one follow-up input to an active child conversation.",
1127
- identity: { serviceName: "agent-children", action: "message", method: "POST" },
1128
- input: z3.object({
1129
- childConversationId: z3.string().min(1),
1130
- input: z3.json()
1131
- }).strict(),
1132
- output: z3.object({ sent: z3.literal(true) }),
1133
- expose: ["AGENT"],
1134
- handler: async ({ input }) => {
1135
- await manager.sendMessage(conversationId, input.childConversationId, input.input);
1136
- return { sent: true };
1137
- }
1162
+ bindAgentTool(LIST_AGENTS_DESCRIPTOR, async () => ({
1163
+ children: [...await manager.listChildren(conversationId)]
1164
+ })),
1165
+ bindAgentTool(SEND_MESSAGE_DESCRIPTOR, async ({ input }) => {
1166
+ await manager.sendMessage(conversationId, input.childConversationId, input.input);
1167
+ return { sent: true };
1138
1168
  }),
1139
- defineAgentTool({
1140
- name: "interrupt_agent",
1141
- description: "Stop one active child conversation at a durable policy boundary.",
1142
- identity: { serviceName: "agent-children", action: "interrupt", method: "POST" },
1143
- input: z3.object({ childConversationId: z3.string().min(1) }).strict(),
1144
- output: z3.object({ interrupted: z3.literal(true) }),
1145
- expose: ["AGENT"],
1146
- handler: async ({ input }) => {
1147
- await manager.interruptChild(conversationId, input.childConversationId);
1148
- return { interrupted: true };
1149
- }
1169
+ bindAgentTool(INTERRUPT_AGENT_DESCRIPTOR, async ({ input }) => {
1170
+ await manager.interruptChild(conversationId, input.childConversationId);
1171
+ return { interrupted: true };
1150
1172
  })
1151
1173
  ];
1152
1174
  }
@@ -2114,6 +2136,60 @@ var AgentScheduleDeliveryOutcomeSchema = z6.discriminatedUnion("status", [
2114
2136
  // src/agent-runtime/schedule-tools.ts
2115
2137
  import { z as z7 } from "zod";
2116
2138
  var ScheduledOutputSchema = z7.object({ scheduleId: z7.string(), nextAt: z7.string() }).strict();
2139
+ var SCHEDULE_AFTER_DESCRIPTOR = defineAgentToolDescriptor({
2140
+ name: "schedule_after",
2141
+ description: "Schedule durable input after a relative delay.",
2142
+ identity: { serviceName: "agent-schedules", action: "after", method: "POST" },
2143
+ input: z7.object({
2144
+ input: z7.json(),
2145
+ afterMs: z7.int().positive()
2146
+ }).strict(),
2147
+ output: ScheduledOutputSchema,
2148
+ expose: ["AGENT"]
2149
+ });
2150
+ var SCHEDULE_AT_DESCRIPTOR = defineAgentToolDescriptor({
2151
+ name: "schedule_at",
2152
+ description: "Schedule durable input at an absolute timestamp with an explicit offset.",
2153
+ identity: { serviceName: "agent-schedules", action: "at", method: "POST" },
2154
+ input: z7.object({ input: z7.json(), at: z7.string().min(1) }).strict(),
2155
+ output: ScheduledOutputSchema,
2156
+ expose: ["AGENT"]
2157
+ });
2158
+ var SCHEDULE_EVERY_DESCRIPTOR = defineAgentToolDescriptor({
2159
+ name: "schedule_every",
2160
+ description: "Schedule recurring durable input in an explicit conversation timezone.",
2161
+ identity: { serviceName: "agent-schedules", action: "every", method: "POST" },
2162
+ input: z7.object({
2163
+ input: z7.json(),
2164
+ everyMs: z7.int().positive(),
2165
+ timeZone: z7.string().min(1)
2166
+ }).strict(),
2167
+ output: ScheduledOutputSchema,
2168
+ expose: ["AGENT"]
2169
+ });
2170
+ var SCHEDULE_LIST_DESCRIPTOR = defineAgentToolDescriptor({
2171
+ name: "schedule_list",
2172
+ description: "List the durable schedules of this conversation.",
2173
+ identity: { serviceName: "agent-schedules", action: "list", method: "GET" },
2174
+ input: z7.object({}).strict(),
2175
+ output: z7.object({ schedules: z7.array(z7.json()) }).strict(),
2176
+ expose: ["AGENT"]
2177
+ });
2178
+ var SCHEDULE_CANCEL_DESCRIPTOR = defineAgentToolDescriptor({
2179
+ name: "schedule_cancel",
2180
+ description: "Cancel one durable deferred-input schedule.",
2181
+ identity: { serviceName: "agent-schedules", action: "cancel", method: "POST" },
2182
+ input: z7.object({ scheduleId: z7.string().min(1) }).strict(),
2183
+ output: z7.object({ cancelled: z7.boolean() }).strict(),
2184
+ expose: ["AGENT"]
2185
+ });
2186
+ var AGENT_SCHEDULE_TOOL_DESCRIPTORS = Object.freeze([
2187
+ SCHEDULE_AFTER_DESCRIPTOR,
2188
+ SCHEDULE_AT_DESCRIPTOR,
2189
+ SCHEDULE_EVERY_DESCRIPTOR,
2190
+ SCHEDULE_LIST_DESCRIPTOR,
2191
+ SCHEDULE_CANCEL_DESCRIPTOR
2192
+ ]);
2117
2193
  function createAgentScheduleTools({ service, run }) {
2118
2194
  const conversationId = conversationOfRun(run, "createAgentScheduleTools");
2119
2195
  const schedule = async (request) => {
@@ -2121,60 +2197,15 @@ function createAgentScheduleTools({ service, run }) {
2121
2197
  return { scheduleId: result.id, nextAt: result.nextAt };
2122
2198
  };
2123
2199
  return [
2124
- defineAgentTool({
2125
- name: "schedule_after",
2126
- description: "Schedule durable input after a relative delay.",
2127
- identity: { serviceName: "agent-schedules", action: "after", method: "POST" },
2128
- input: z7.object({
2129
- input: z7.json(),
2130
- afterMs: z7.int().positive()
2131
- }).strict(),
2132
- output: ScheduledOutputSchema,
2133
- expose: ["AGENT"],
2134
- handler: ({ input }) => schedule(input)
2135
- }),
2136
- defineAgentTool({
2137
- name: "schedule_at",
2138
- description: "Schedule durable input at an absolute timestamp with an explicit offset.",
2139
- identity: { serviceName: "agent-schedules", action: "at", method: "POST" },
2140
- input: z7.object({ input: z7.json(), at: z7.string().min(1) }).strict(),
2141
- output: ScheduledOutputSchema,
2142
- expose: ["AGENT"],
2143
- handler: ({ input }) => schedule(input)
2144
- }),
2145
- defineAgentTool({
2146
- name: "schedule_every",
2147
- description: "Schedule recurring durable input in an explicit conversation timezone.",
2148
- identity: { serviceName: "agent-schedules", action: "every", method: "POST" },
2149
- input: z7.object({
2150
- input: z7.json(),
2151
- everyMs: z7.int().positive(),
2152
- timeZone: z7.string().min(1)
2153
- }).strict(),
2154
- output: ScheduledOutputSchema,
2155
- expose: ["AGENT"],
2156
- handler: ({ input }) => schedule(input)
2157
- }),
2158
- defineAgentTool({
2159
- name: "schedule_list",
2160
- description: "List the durable schedules of this conversation.",
2161
- identity: { serviceName: "agent-schedules", action: "list", method: "GET" },
2162
- input: z7.object({}).strict(),
2163
- output: z7.object({ schedules: z7.array(z7.json()) }).strict(),
2164
- expose: ["AGENT"],
2165
- handler: async () => ({ schedules: [...await service.listSchedules(conversationId)] })
2166
- }),
2167
- defineAgentTool({
2168
- name: "schedule_cancel",
2169
- description: "Cancel one durable deferred-input schedule.",
2170
- identity: { serviceName: "agent-schedules", action: "cancel", method: "POST" },
2171
- input: z7.object({ scheduleId: z7.string().min(1) }).strict(),
2172
- output: z7.object({ cancelled: z7.boolean() }).strict(),
2173
- expose: ["AGENT"],
2174
- handler: async ({ input }) => ({
2175
- cancelled: await service.cancelSchedule(conversationId, input.scheduleId)
2176
- })
2177
- })
2200
+ bindAgentTool(SCHEDULE_AFTER_DESCRIPTOR, ({ input }) => schedule(input)),
2201
+ bindAgentTool(SCHEDULE_AT_DESCRIPTOR, ({ input }) => schedule(input)),
2202
+ bindAgentTool(SCHEDULE_EVERY_DESCRIPTOR, ({ input }) => schedule(input)),
2203
+ bindAgentTool(SCHEDULE_LIST_DESCRIPTOR, async () => ({
2204
+ schedules: [...await service.listSchedules(conversationId)]
2205
+ })),
2206
+ bindAgentTool(SCHEDULE_CANCEL_DESCRIPTOR, async ({ input }) => ({
2207
+ cancelled: await service.cancelSchedule(conversationId, input.scheduleId)
2208
+ }))
2178
2209
  ];
2179
2210
  }
2180
2211
  // src/agent-runtime/schedules.ts
@@ -2721,6 +2752,50 @@ var TodoItemSchema = z11.object({
2721
2752
  step: z11.string().min(1),
2722
2753
  status: z11.enum(["pending", "in_progress", "completed"])
2723
2754
  }).strict();
2755
+ var TodoOutputSchema = z11.object({ items: z11.array(TodoItemSchema) }).strict();
2756
+ var CREATE_GOAL_DESCRIPTOR = defineAgentToolDescriptor({
2757
+ name: "create_goal",
2758
+ description: "Create the durable objective for this conversation.",
2759
+ identity: { serviceName: "agent-state", action: "create-goal", method: "POST" },
2760
+ input: z11.object({ objective: z11.string().min(1) }).strict(),
2761
+ output: GoalSchema,
2762
+ expose: ["AGENT"]
2763
+ });
2764
+ var UPDATE_GOAL_DESCRIPTOR = defineAgentToolDescriptor({
2765
+ name: "update_goal",
2766
+ description: "Update the durable objective or lifecycle status.",
2767
+ identity: { serviceName: "agent-state", action: "update-goal", method: "POST" },
2768
+ input: z11.object({
2769
+ objective: z11.string().min(1).optional(),
2770
+ status: z11.enum(["active", "complete", "blocked"]).optional()
2771
+ }).strict().refine((request) => request.objective !== undefined || request.status !== undefined, {
2772
+ message: "At least one goal field must be supplied"
2773
+ }),
2774
+ output: GoalSchema,
2775
+ expose: ["AGENT"]
2776
+ });
2777
+ var GET_GOAL_DESCRIPTOR = defineAgentToolDescriptor({
2778
+ name: "get_goal",
2779
+ description: "Read the durable objective for this conversation.",
2780
+ identity: { serviceName: "agent-state", action: "get-goal", method: "GET" },
2781
+ input: z11.object({}).strict(),
2782
+ output: z11.object({ goal: GoalSchema.optional() }).strict(),
2783
+ expose: ["AGENT"]
2784
+ });
2785
+ var TODO_WRITE_DESCRIPTOR = defineAgentToolDescriptor({
2786
+ name: "todo_write",
2787
+ description: "Replace the durable ordered work plan for this conversation.",
2788
+ identity: { serviceName: "agent-state", action: "write-todo", method: "POST" },
2789
+ input: TodoOutputSchema,
2790
+ output: TodoOutputSchema,
2791
+ expose: ["AGENT"]
2792
+ });
2793
+ var AGENT_STATE_TOOL_DESCRIPTORS = Object.freeze([
2794
+ CREATE_GOAL_DESCRIPTOR,
2795
+ UPDATE_GOAL_DESCRIPTOR,
2796
+ GET_GOAL_DESCRIPTOR,
2797
+ TODO_WRITE_DESCRIPTOR
2798
+ ]);
2724
2799
  function createAgentStateTools(config) {
2725
2800
  const input = {
2726
2801
  state: config.state,
@@ -2736,73 +2811,40 @@ function createAgentStateTools(config) {
2736
2811
  return GoalSchema.parse(stored.value);
2737
2812
  };
2738
2813
  return [
2739
- defineAgentTool({
2740
- name: "create_goal",
2741
- description: "Create the durable objective for this conversation.",
2742
- identity: { serviceName: "agent-state", action: "create-goal", method: "POST" },
2743
- input: z11.object({ objective: z11.string().min(1) }).strict(),
2744
- output: GoalSchema,
2745
- expose: ["AGENT"],
2746
- handler: async ({ input: request }) => {
2747
- if (await input.state.get(input.conversationId, "goal")) {
2748
- throw new TypeError("A durable goal already exists for this conversation");
2749
- }
2750
- return writeGoal({ objective: request.objective, status: "active" });
2814
+ bindAgentTool(CREATE_GOAL_DESCRIPTOR, async ({ input: request }) => {
2815
+ if (await input.state.get(input.conversationId, "goal")) {
2816
+ throw new TypeError("A durable goal already exists for this conversation");
2751
2817
  }
2818
+ return writeGoal({ objective: request.objective, status: "active" });
2752
2819
  }),
2753
- defineAgentTool({
2754
- name: "update_goal",
2755
- description: "Update the durable objective or lifecycle status.",
2756
- identity: { serviceName: "agent-state", action: "update-goal", method: "POST" },
2757
- input: z11.object({
2758
- objective: z11.string().min(1).optional(),
2759
- status: z11.enum(["active", "complete", "blocked"]).optional()
2760
- }).strict().refine((request) => request.objective !== undefined || request.status !== undefined, {
2761
- message: "At least one goal field must be supplied"
2762
- }),
2763
- output: GoalSchema,
2764
- expose: ["AGENT"],
2765
- handler: async ({ input: request }) => {
2766
- const current = await input.state.get(input.conversationId, "goal");
2767
- if (!current)
2768
- throw new TypeError("No durable goal exists for this conversation");
2769
- const goal = GoalSchema.parse(current.value);
2770
- return writeGoal({ ...goal, ...request });
2771
- }
2820
+ bindAgentTool(UPDATE_GOAL_DESCRIPTOR, async ({ input: request }) => {
2821
+ const current = await input.state.get(input.conversationId, "goal");
2822
+ if (!current)
2823
+ throw new TypeError("No durable goal exists for this conversation");
2824
+ const goal = GoalSchema.parse(current.value);
2825
+ return writeGoal({ ...goal, ...request });
2772
2826
  }),
2773
- defineAgentTool({
2774
- name: "get_goal",
2775
- description: "Read the durable objective for this conversation.",
2776
- identity: { serviceName: "agent-state", action: "get-goal", method: "GET" },
2777
- input: z11.object({}).strict(),
2778
- output: z11.object({ goal: GoalSchema.optional() }).strict(),
2779
- expose: ["AGENT"],
2780
- handler: async () => {
2781
- const current = await input.state.get(input.conversationId, "goal");
2782
- return { ...current && { goal: GoalSchema.parse(current.value) } };
2783
- }
2827
+ bindAgentTool(GET_GOAL_DESCRIPTOR, async () => {
2828
+ const current = await input.state.get(input.conversationId, "goal");
2829
+ return { ...current && { goal: GoalSchema.parse(current.value) } };
2784
2830
  }),
2785
- defineAgentTool({
2786
- name: "todo_write",
2787
- description: "Replace the durable ordered work plan for this conversation.",
2788
- identity: { serviceName: "agent-state", action: "write-todo", method: "POST" },
2789
- input: z11.object({ items: z11.array(TodoItemSchema) }).strict(),
2790
- output: z11.object({ items: z11.array(TodoItemSchema) }).strict(),
2791
- expose: ["AGENT"],
2792
- handler: async ({ input: request }) => {
2793
- const stored = await input.state.set({
2794
- conversationId: input.conversationId,
2795
- name: "todo",
2796
- value: request,
2797
- actor: "agent"
2798
- });
2799
- return z11.object({ items: z11.array(TodoItemSchema) }).strict().parse(stored.value);
2800
- }
2831
+ bindAgentTool(TODO_WRITE_DESCRIPTOR, async ({ input: request }) => {
2832
+ const stored = await input.state.set({
2833
+ conversationId: input.conversationId,
2834
+ name: "todo",
2835
+ value: request,
2836
+ actor: "agent"
2837
+ });
2838
+ return TodoOutputSchema.parse(stored.value);
2801
2839
  })
2802
2840
  ];
2803
2841
  }
2804
2842
  export {
2805
2843
  ACTIVE_AGENT_RUN_STATES2 as ACTIVE_AGENT_RUN_STATES,
2844
+ AGENT_CHILD_TOOL_DESCRIPTORS,
2845
+ AGENT_EVENT_SEARCH_TOOL_DESCRIPTORS2 as AGENT_EVENT_SEARCH_TOOL_DESCRIPTORS,
2846
+ AGENT_SCHEDULE_TOOL_DESCRIPTORS,
2847
+ AGENT_STATE_TOOL_DESCRIPTORS,
2806
2848
  AcceptInputAndAssignRunSchema2 as AcceptInputAndAssignRunSchema,
2807
2849
  AcquireAgentRunSchema2 as AcquireAgentRunSchema,
2808
2850
  AgentAdmissionEventSchema2 as AgentAdmissionEventSchema,
@@ -2926,10 +2968,15 @@ export {
2926
2968
  DeferredAgentToolMatchSchema2 as DeferredAgentToolMatchSchema,
2927
2969
  DeferredAgentToolReceiptSchema2 as DeferredAgentToolReceiptSchema,
2928
2970
  DeferredAgentToolSearchInputSchema2 as DeferredAgentToolSearchInputSchema,
2971
+ InvocationPayloadOmissionReasonSchema2 as InvocationPayloadOmissionReasonSchema,
2972
+ InvocationPayloadTooLargeError2 as InvocationPayloadTooLargeError,
2973
+ ModelInvocationPayloadReadSchema2 as ModelInvocationPayloadReadSchema,
2929
2974
  ModelInvocationRecordSchema2 as ModelInvocationRecordSchema,
2930
2975
  ModelInvocationTraceSchema2 as ModelInvocationTraceSchema,
2931
2976
  ParkAbortedError2 as ParkAbortedError,
2932
2977
  ParkRecordDecodeError2 as ParkRecordDecodeError,
2978
+ PurgeInvocationPayloadsInputSchema2 as PurgeInvocationPayloadsInputSchema,
2979
+ PurgeInvocationPayloadsResultSchema2 as PurgeInvocationPayloadsResultSchema,
2933
2980
  ReadAgentStoreEventsSchema2 as ReadAgentStoreEventsSchema,
2934
2981
  RecordRunOperationSchema2 as RecordRunOperationSchema,
2935
2982
  RecoverAgentRunSchema2 as RecoverAgentRunSchema,
@@ -18,16 +18,16 @@ import {
18
18
  createBoundedChannel2
19
19
  } from "../../index-09f7w2qq.js";
20
20
  import"../../index-6kec3b14.js";
21
- import"../../index-x90w78yz.js";
22
- import"../../index-jrka9029.js";
21
+ import"../../index-673drwkn.js";
22
+ import"../../index-vmbxj75t.js";
23
23
  import {
24
24
  attemptExclusiveLock
25
- } from "../../index-dvd1qdwa.js";
25
+ } from "../../index-ke02kxsr.js";
26
26
  import {
27
27
  closeAfter,
28
28
  BoundedFileReadError,
29
29
  openRegularFile
30
- } from "../../index-nbv44x0x.js";
30
+ } from "../../index-s2e3h616.js";
31
31
  import {
32
32
  errnoOf
33
33
  } from "../../index-jj9228tt.js";
@@ -14,31 +14,31 @@ import {
14
14
  backoffDelay
15
15
  } from "../../index-gnjgkecx.js";
16
16
  import"../../index-6kec3b14.js";
17
- import"../../index-x90w78yz.js";
18
- import"../../index-jrka9029.js";
17
+ import"../../index-673drwkn.js";
18
+ import"../../index-vmbxj75t.js";
19
19
  import {
20
20
  defineManagedResource2
21
21
  } from "../../index-50ejfz75.js";
22
22
  import {
23
23
  createFileStateStore2
24
- } from "../../index-wbnpa8z6.js";
25
- import"../../index-g1q7fwn9.js";
26
- import"../../index-dvd1qdwa.js";
24
+ } from "../../index-9kpxz49v.js";
25
+ import"../../index-2nwvn7m2.js";
26
+ import"../../index-ke02kxsr.js";
27
27
  import {
28
28
  isJsonData
29
29
  } from "../../index-m6w6jtda.js";
30
30
  import {
31
31
  writeAtomicFileData
32
- } from "../../index-5zwac8ft.js";
32
+ } from "../../index-pp97q86a.js";
33
33
  import {
34
34
  publishAtomicFile
35
- } from "../../index-xtkw9866.js";
35
+ } from "../../index-2c5w2d1d.js";
36
36
  import {
37
37
  closeAfter,
38
38
  BoundedFileReadError,
39
39
  openRegularFile,
40
40
  readBoundedFile
41
- } from "../../index-nbv44x0x.js";
41
+ } from "../../index-s2e3h616.js";
42
42
  import {
43
43
  errnoOf
44
44
  } from "../../index-jj9228tt.js";