@amodalai/runtime 0.1.26 → 0.2.1

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 (445) hide show
  1. package/dist/src/__fixtures__/README.md +88 -0
  2. package/dist/src/__fixtures__/e2e.test.js +211 -0
  3. package/dist/src/__fixtures__/e2e.test.js.map +1 -0
  4. package/dist/src/__fixtures__/smoke-agent/amodal.json +11 -0
  5. package/dist/src/__fixtures__/smoke-agent/automations/delivery-callback-test.json +9 -0
  6. package/dist/src/__fixtures__/smoke-agent/automations/test-auto.md +5 -0
  7. package/dist/src/__fixtures__/smoke-agent/connections/mock-api/access.json +11 -0
  8. package/dist/src/__fixtures__/smoke-agent/connections/mock-api/spec.json +4 -0
  9. package/dist/src/__fixtures__/smoke-agent/connections/mock-api/surface.md +9 -0
  10. package/dist/src/__fixtures__/smoke-agent/connections/mock-mcp/access.json +3 -0
  11. package/dist/src/__fixtures__/smoke-agent/connections/mock-mcp/spec.json +8 -0
  12. package/dist/src/__fixtures__/smoke-agent/evals/basic-eval.md +12 -0
  13. package/dist/src/__fixtures__/smoke-agent/knowledge/test-knowledge.md +3 -0
  14. package/dist/src/__fixtures__/smoke-agent/skills/test-skill/SKILL.md +11 -0
  15. package/dist/src/__fixtures__/smoke-agent/stores/test-items.json +11 -0
  16. package/dist/src/__fixtures__/smoke-agent/tools/echo_tool/handler.d.ts +18 -0
  17. package/dist/src/__fixtures__/smoke-agent/tools/echo_tool/handler.js +22 -0
  18. package/dist/src/__fixtures__/smoke-agent/tools/echo_tool/handler.js.map +1 -0
  19. package/dist/src/__fixtures__/smoke-agent/tools/echo_tool/tool.json +17 -0
  20. package/dist/src/__fixtures__/smoke.test.js +1404 -0
  21. package/dist/src/__fixtures__/smoke.test.js.map +1 -0
  22. package/dist/src/__fixtures__/test-env.d.ts +27 -0
  23. package/dist/src/__fixtures__/test-env.js +64 -0
  24. package/dist/src/__fixtures__/test-env.js.map +1 -0
  25. package/dist/src/__fixtures__/test-helpers.d.ts +30 -0
  26. package/dist/src/__fixtures__/test-helpers.js +120 -0
  27. package/dist/src/__fixtures__/test-helpers.js.map +1 -0
  28. package/dist/src/__tests__/test-providers.d.ts +40 -0
  29. package/dist/src/__tests__/test-providers.js +61 -0
  30. package/dist/src/__tests__/test-providers.js.map +1 -0
  31. package/dist/src/agent/agent-types.d.ts +22 -0
  32. package/dist/src/agent/agent-types.js.map +1 -1
  33. package/dist/src/agent/automation-bridge.d.ts +9 -0
  34. package/dist/src/agent/automation-bridge.js +26 -0
  35. package/dist/src/agent/automation-bridge.js.map +1 -1
  36. package/dist/src/agent/automation-bridge.test.js +63 -0
  37. package/dist/src/agent/automation-bridge.test.js.map +1 -1
  38. package/dist/src/agent/local-server.d.ts +1 -8
  39. package/dist/src/agent/local-server.js +398 -163
  40. package/dist/src/agent/local-server.js.map +1 -1
  41. package/dist/src/agent/local-server.test.js +14 -8
  42. package/dist/src/agent/local-server.test.js.map +1 -1
  43. package/dist/src/agent/loop-types.d.ts +254 -0
  44. package/dist/src/agent/loop-types.js +24 -0
  45. package/dist/src/agent/loop-types.js.map +1 -0
  46. package/dist/src/agent/loop.d.ts +31 -0
  47. package/dist/src/agent/loop.js +152 -0
  48. package/dist/src/agent/loop.js.map +1 -0
  49. package/dist/src/agent/loop.test.js +1594 -0
  50. package/dist/src/agent/loop.test.js.map +1 -0
  51. package/dist/src/agent/mcp-config.d.ts +28 -0
  52. package/dist/src/agent/mcp-config.js +57 -0
  53. package/dist/src/agent/mcp-config.js.map +1 -0
  54. package/dist/src/agent/page-builder.js +6 -1
  55. package/dist/src/agent/page-builder.js.map +1 -1
  56. package/dist/src/agent/proactive/delivery-router.d.ts +68 -0
  57. package/dist/src/agent/proactive/delivery-router.js +337 -0
  58. package/dist/src/agent/proactive/delivery-router.js.map +1 -0
  59. package/dist/src/agent/{stores-e2e.test.d.ts → proactive/delivery-router.test.d.ts} +1 -1
  60. package/dist/src/agent/proactive/delivery-router.test.js +455 -0
  61. package/dist/src/agent/proactive/delivery-router.test.js.map +1 -0
  62. package/dist/src/agent/proactive/proactive-runner.d.ts +46 -8
  63. package/dist/src/agent/proactive/proactive-runner.js +67 -37
  64. package/dist/src/agent/proactive/proactive-runner.js.map +1 -1
  65. package/dist/src/agent/proactive/proactive-runner.test.d.ts +1 -1
  66. package/dist/src/agent/proactive/proactive-runner.test.js +73 -87
  67. package/dist/src/agent/proactive/proactive-runner.test.js.map +1 -1
  68. package/dist/src/agent/routes/admin-chat-abort.test.d.ts +6 -0
  69. package/dist/src/agent/routes/admin-chat-abort.test.js +206 -0
  70. package/dist/src/agent/routes/admin-chat-abort.test.js.map +1 -0
  71. package/dist/src/agent/routes/admin-chat.d.ts +15 -3
  72. package/dist/src/agent/routes/admin-chat.js +61 -18
  73. package/dist/src/agent/routes/admin-chat.js.map +1 -1
  74. package/dist/src/agent/routes/automations.js +5 -6
  75. package/dist/src/agent/routes/automations.js.map +1 -1
  76. package/dist/src/agent/routes/evals.d.ts +3 -2
  77. package/dist/src/agent/routes/evals.js +25 -12
  78. package/dist/src/agent/routes/evals.js.map +1 -1
  79. package/dist/src/agent/routes/files.js +7 -9
  80. package/dist/src/agent/routes/files.js.map +1 -1
  81. package/dist/src/agent/routes/inspect.d.ts +6 -2
  82. package/dist/src/agent/routes/inspect.js +31 -17
  83. package/dist/src/agent/routes/inspect.js.map +1 -1
  84. package/dist/src/agent/routes/inspect.test.js +18 -42
  85. package/dist/src/agent/routes/inspect.test.js.map +1 -1
  86. package/dist/src/agent/routes/stores.js +9 -12
  87. package/dist/src/agent/routes/stores.js.map +1 -1
  88. package/dist/src/agent/routes/task.d.ts +15 -3
  89. package/dist/src/agent/routes/task.js +16 -7
  90. package/dist/src/agent/routes/task.js.map +1 -1
  91. package/dist/src/agent/routes/task.test.d.ts +1 -1
  92. package/dist/src/agent/routes/task.test.js +68 -53
  93. package/dist/src/agent/routes/task.test.js.map +1 -1
  94. package/dist/src/agent/routes/webhooks.js +12 -3
  95. package/dist/src/agent/routes/webhooks.js.map +1 -1
  96. package/dist/src/agent/snapshot-server.d.ts +2 -22
  97. package/dist/src/agent/snapshot-server.js +48 -27
  98. package/dist/src/agent/snapshot-server.js.map +1 -1
  99. package/dist/src/agent/states/compacting.d.ts +14 -0
  100. package/dist/src/agent/states/compacting.js +260 -0
  101. package/dist/src/agent/states/compacting.js.map +1 -0
  102. package/dist/src/agent/states/confirming.d.ts +10 -0
  103. package/dist/src/agent/states/confirming.js +79 -0
  104. package/dist/src/agent/states/confirming.js.map +1 -0
  105. package/dist/src/agent/states/dispatching.d.ts +18 -0
  106. package/dist/src/agent/states/dispatching.js +285 -0
  107. package/dist/src/agent/states/dispatching.js.map +1 -0
  108. package/dist/src/agent/states/executing.d.ts +21 -0
  109. package/dist/src/agent/states/executing.js +452 -0
  110. package/dist/src/agent/states/executing.js.map +1 -0
  111. package/dist/src/agent/states/streaming.d.ts +10 -0
  112. package/dist/src/agent/states/streaming.js +169 -0
  113. package/dist/src/agent/states/streaming.js.map +1 -0
  114. package/dist/src/agent/states/thinking.d.ts +13 -0
  115. package/dist/src/agent/states/thinking.js +450 -0
  116. package/dist/src/agent/states/thinking.js.map +1 -0
  117. package/dist/src/agent/token-estimate.d.ts +31 -0
  118. package/dist/src/agent/token-estimate.js +34 -0
  119. package/dist/src/agent/token-estimate.js.map +1 -0
  120. package/dist/src/agent/token-estimate.test.d.ts +6 -0
  121. package/dist/src/agent/token-estimate.test.js +44 -0
  122. package/dist/src/agent/token-estimate.test.js.map +1 -0
  123. package/dist/src/agent/tool-executor-local.js +9 -18
  124. package/dist/src/agent/tool-executor-local.js.map +1 -1
  125. package/dist/src/agent/tool-executor-local.test.js +3 -5
  126. package/dist/src/agent/tool-executor-local.test.js.map +1 -1
  127. package/dist/src/api/create-agent.d.ts +15 -0
  128. package/dist/src/api/create-agent.js +134 -0
  129. package/dist/src/api/create-agent.js.map +1 -0
  130. package/dist/src/api/types.d.ts +66 -0
  131. package/dist/src/api/types.js +7 -0
  132. package/dist/src/api/types.js.map +1 -0
  133. package/dist/src/context/compiler.d.ts +13 -0
  134. package/dist/src/context/compiler.js +358 -0
  135. package/dist/src/context/compiler.js.map +1 -0
  136. package/dist/src/context/compiler.test.d.ts +6 -0
  137. package/dist/src/context/compiler.test.js +532 -0
  138. package/dist/src/context/compiler.test.js.map +1 -0
  139. package/dist/src/context/types.d.ts +110 -0
  140. package/dist/src/context/types.js +7 -0
  141. package/dist/src/context/types.js.map +1 -0
  142. package/dist/src/env-ref.d.ts +13 -0
  143. package/dist/src/env-ref.js +31 -0
  144. package/dist/src/env-ref.js.map +1 -0
  145. package/dist/src/env-ref.test.d.ts +6 -0
  146. package/dist/src/env-ref.test.js +34 -0
  147. package/dist/src/env-ref.test.js.map +1 -0
  148. package/dist/src/errors.d.ts +15 -0
  149. package/dist/src/errors.js +22 -0
  150. package/dist/src/errors.js.map +1 -1
  151. package/dist/src/errors.test.js +2 -2
  152. package/dist/src/errors.test.js.map +1 -1
  153. package/dist/src/events/event-bus.d.ts +54 -0
  154. package/dist/src/events/event-bus.js +84 -0
  155. package/dist/src/events/event-bus.js.map +1 -0
  156. package/dist/src/events/event-bus.test.d.ts +6 -0
  157. package/dist/src/events/event-bus.test.js +112 -0
  158. package/dist/src/events/event-bus.test.js.map +1 -0
  159. package/dist/src/events/events-route.d.ts +36 -0
  160. package/dist/src/events/events-route.js +80 -0
  161. package/dist/src/events/events-route.js.map +1 -0
  162. package/dist/src/events/events-route.test.d.ts +6 -0
  163. package/dist/src/events/events-route.test.js +134 -0
  164. package/dist/src/events/events-route.test.js.map +1 -0
  165. package/dist/src/events/store-event-wrapper.d.ts +19 -0
  166. package/dist/src/events/store-event-wrapper.js +57 -0
  167. package/dist/src/events/store-event-wrapper.js.map +1 -0
  168. package/dist/src/events/store-event-wrapper.test.d.ts +6 -0
  169. package/dist/src/events/store-event-wrapper.test.js +91 -0
  170. package/dist/src/events/store-event-wrapper.test.js.map +1 -0
  171. package/dist/src/index.d.ts +33 -6
  172. package/dist/src/index.js +35 -21
  173. package/dist/src/index.js.map +1 -1
  174. package/dist/src/middleware/auth.d.ts +0 -2
  175. package/dist/src/middleware/auth.js.map +1 -1
  176. package/dist/src/providers/create-provider.d.ts +23 -0
  177. package/dist/src/providers/create-provider.js +185 -0
  178. package/dist/src/providers/create-provider.js.map +1 -0
  179. package/dist/src/providers/create-provider.test.d.ts +6 -0
  180. package/dist/src/providers/create-provider.test.js +95 -0
  181. package/dist/src/providers/create-provider.test.js.map +1 -0
  182. package/dist/src/providers/failover.d.ts +38 -0
  183. package/dist/src/providers/failover.js +147 -0
  184. package/dist/src/providers/failover.js.map +1 -0
  185. package/dist/src/providers/failover.test.d.ts +6 -0
  186. package/dist/src/providers/failover.test.js +169 -0
  187. package/dist/src/providers/failover.test.js.map +1 -0
  188. package/dist/src/providers/search-provider.d.ts +64 -0
  189. package/dist/src/providers/search-provider.js +174 -0
  190. package/dist/src/providers/search-provider.js.map +1 -0
  191. package/dist/src/providers/types.d.ts +118 -0
  192. package/dist/src/providers/types.js +7 -0
  193. package/dist/src/providers/types.js.map +1 -0
  194. package/dist/src/routes/ai-stream.d.ts +28 -10
  195. package/dist/src/routes/ai-stream.js +85 -41
  196. package/dist/src/routes/ai-stream.js.map +1 -1
  197. package/dist/src/routes/chat-new.test.d.ts +6 -0
  198. package/dist/src/routes/chat-new.test.js +107 -0
  199. package/dist/src/routes/chat-new.test.js.map +1 -0
  200. package/dist/src/routes/chat-stream-new.test.d.ts +6 -0
  201. package/dist/src/routes/chat-stream-new.test.js +135 -0
  202. package/dist/src/routes/chat-stream-new.test.js.map +1 -0
  203. package/dist/src/routes/chat-stream.d.ts +20 -4
  204. package/dist/src/routes/chat-stream.js +49 -29
  205. package/dist/src/routes/chat-stream.js.map +1 -1
  206. package/dist/src/routes/chat.d.ts +19 -4
  207. package/dist/src/routes/chat.js +62 -23
  208. package/dist/src/routes/chat.js.map +1 -1
  209. package/dist/src/routes/health.d.ts +3 -2
  210. package/dist/src/routes/health.js.map +1 -1
  211. package/dist/src/routes/route-helpers.d.ts +50 -0
  212. package/dist/src/routes/route-helpers.js +80 -0
  213. package/dist/src/routes/route-helpers.js.map +1 -0
  214. package/dist/src/routes/session-resolver.d.ts +77 -0
  215. package/dist/src/routes/session-resolver.js +109 -0
  216. package/dist/src/routes/session-resolver.js.map +1 -0
  217. package/dist/src/routes/session-resolver.test.d.ts +6 -0
  218. package/dist/src/routes/session-resolver.test.js +207 -0
  219. package/dist/src/routes/session-resolver.test.js.map +1 -0
  220. package/dist/src/routes/webhooks.d.ts +3 -1
  221. package/dist/src/routes/webhooks.js +12 -4
  222. package/dist/src/routes/webhooks.js.map +1 -1
  223. package/dist/src/security/permission-checker.d.ts +80 -0
  224. package/dist/src/security/permission-checker.js +75 -0
  225. package/dist/src/security/permission-checker.js.map +1 -0
  226. package/dist/src/security/permission-checker.test.d.ts +6 -0
  227. package/dist/src/security/permission-checker.test.js +208 -0
  228. package/dist/src/security/permission-checker.test.js.map +1 -0
  229. package/dist/src/server.d.ts +18 -11
  230. package/dist/src/server.js +46 -46
  231. package/dist/src/server.js.map +1 -1
  232. package/dist/src/server.test.d.ts +1 -1
  233. package/dist/src/server.test.js +6 -144
  234. package/dist/src/server.test.js.map +1 -1
  235. package/dist/src/session/drizzle-session-store.d.ts +56 -0
  236. package/dist/src/session/drizzle-session-store.js +203 -0
  237. package/dist/src/session/drizzle-session-store.js.map +1 -0
  238. package/dist/src/session/manager.d.ts +101 -0
  239. package/dist/src/session/manager.js +394 -0
  240. package/dist/src/session/manager.js.map +1 -0
  241. package/dist/src/session/manager.test.d.ts +6 -0
  242. package/dist/src/session/manager.test.js +309 -0
  243. package/dist/src/session/manager.test.js.map +1 -0
  244. package/dist/src/session/pglite-session-store.d.ts +23 -0
  245. package/dist/src/session/pglite-session-store.js +70 -0
  246. package/dist/src/session/pglite-session-store.js.map +1 -0
  247. package/dist/src/session/postgres-session-store.d.ts +44 -0
  248. package/dist/src/session/postgres-session-store.js +138 -0
  249. package/dist/src/session/postgres-session-store.js.map +1 -0
  250. package/dist/src/session/session-builder.d.ts +69 -0
  251. package/dist/src/session/session-builder.js +384 -0
  252. package/dist/src/session/session-builder.js.map +1 -0
  253. package/dist/src/session/session-builder.test.d.ts +6 -0
  254. package/dist/src/session/session-builder.test.js +350 -0
  255. package/dist/src/session/session-builder.test.js.map +1 -0
  256. package/dist/src/session/session-store-selector.d.ts +49 -0
  257. package/dist/src/session/session-store-selector.js +60 -0
  258. package/dist/src/session/session-store-selector.js.map +1 -0
  259. package/dist/src/session/session-store-selector.test.d.ts +6 -0
  260. package/dist/src/session/session-store-selector.test.js +79 -0
  261. package/dist/src/session/session-store-selector.test.js.map +1 -0
  262. package/dist/src/session/store.d.ts +171 -0
  263. package/dist/src/session/store.js +155 -0
  264. package/dist/src/session/store.js.map +1 -0
  265. package/dist/src/session/store.test.d.ts +6 -0
  266. package/dist/src/session/store.test.js +423 -0
  267. package/dist/src/session/store.test.js.map +1 -0
  268. package/dist/src/session/stream-hooks.d.ts +39 -0
  269. package/dist/src/session/stream-hooks.js +7 -0
  270. package/dist/src/session/stream-hooks.js.map +1 -0
  271. package/dist/src/session/tool-context-factory.d.ts +61 -0
  272. package/dist/src/session/tool-context-factory.js +189 -0
  273. package/dist/src/session/tool-context-factory.js.map +1 -0
  274. package/dist/src/session/tool-context-factory.test.d.ts +6 -0
  275. package/dist/src/session/tool-context-factory.test.js +284 -0
  276. package/dist/src/session/tool-context-factory.test.js.map +1 -0
  277. package/dist/src/session/types.d.ts +195 -0
  278. package/dist/src/session/types.js +7 -0
  279. package/dist/src/session/types.js.map +1 -0
  280. package/dist/src/stores/drizzle-store-backend.d.ts +49 -0
  281. package/dist/src/stores/drizzle-store-backend.js +306 -0
  282. package/dist/src/stores/drizzle-store-backend.js.map +1 -0
  283. package/dist/src/stores/drizzle-store-backend.test.d.ts +6 -0
  284. package/dist/src/stores/drizzle-store-backend.test.js +215 -0
  285. package/dist/src/stores/drizzle-store-backend.test.js.map +1 -0
  286. package/dist/src/stores/index.d.ts +4 -0
  287. package/dist/src/stores/index.js +2 -0
  288. package/dist/src/stores/index.js.map +1 -1
  289. package/dist/src/stores/pglite-store-backend.d.ts +16 -19
  290. package/dist/src/stores/pglite-store-backend.js +85 -239
  291. package/dist/src/stores/pglite-store-backend.js.map +1 -1
  292. package/dist/src/stores/postgres-store-backend.d.ts +30 -0
  293. package/dist/src/stores/postgres-store-backend.js +100 -0
  294. package/dist/src/stores/postgres-store-backend.js.map +1 -0
  295. package/dist/src/stores/schema.d.ts +457 -0
  296. package/dist/src/stores/schema.js +59 -0
  297. package/dist/src/stores/schema.js.map +1 -0
  298. package/dist/src/tools/admin-file-tools.d.ts +42 -0
  299. package/dist/src/tools/admin-file-tools.js +714 -0
  300. package/dist/src/tools/admin-file-tools.js.map +1 -0
  301. package/dist/src/tools/admin-file-tools.test.d.ts +6 -0
  302. package/dist/src/tools/admin-file-tools.test.js +521 -0
  303. package/dist/src/tools/admin-file-tools.test.js.map +1 -0
  304. package/dist/src/tools/custom-tool-adapter.d.ts +41 -0
  305. package/dist/src/tools/custom-tool-adapter.js +190 -0
  306. package/dist/src/tools/custom-tool-adapter.js.map +1 -0
  307. package/dist/src/tools/custom-tool-adapter.test.d.ts +6 -0
  308. package/dist/src/tools/custom-tool-adapter.test.js +243 -0
  309. package/dist/src/tools/custom-tool-adapter.test.js.map +1 -0
  310. package/dist/src/tools/dispatch-tool.d.ts +52 -0
  311. package/dist/src/tools/dispatch-tool.js +71 -0
  312. package/dist/src/tools/dispatch-tool.js.map +1 -0
  313. package/dist/src/tools/dispatch-tool.test.d.ts +6 -0
  314. package/dist/src/tools/dispatch-tool.test.js +75 -0
  315. package/dist/src/tools/dispatch-tool.test.js.map +1 -0
  316. package/dist/src/tools/fetch-url-tool.d.ts +23 -0
  317. package/dist/src/tools/fetch-url-tool.js +333 -0
  318. package/dist/src/tools/fetch-url-tool.js.map +1 -0
  319. package/dist/src/tools/fetch-url-tool.test.d.ts +6 -0
  320. package/dist/src/tools/fetch-url-tool.test.js +228 -0
  321. package/dist/src/tools/fetch-url-tool.test.js.map +1 -0
  322. package/dist/src/tools/mcp-tool-adapter.d.ts +18 -0
  323. package/dist/src/tools/mcp-tool-adapter.js +135 -0
  324. package/dist/src/tools/mcp-tool-adapter.js.map +1 -0
  325. package/dist/src/tools/mcp-tool-adapter.test.d.ts +6 -0
  326. package/dist/src/tools/mcp-tool-adapter.test.js +226 -0
  327. package/dist/src/tools/mcp-tool-adapter.test.js.map +1 -0
  328. package/dist/src/tools/registry.d.ts +25 -0
  329. package/dist/src/tools/registry.js +72 -0
  330. package/dist/src/tools/registry.js.map +1 -0
  331. package/dist/src/tools/registry.test.d.ts +6 -0
  332. package/dist/src/tools/registry.test.js +120 -0
  333. package/dist/src/tools/registry.test.js.map +1 -0
  334. package/dist/src/tools/request-tool.d.ts +42 -0
  335. package/dist/src/tools/request-tool.js +190 -0
  336. package/dist/src/tools/request-tool.js.map +1 -0
  337. package/dist/src/tools/request-tool.test.d.ts +6 -0
  338. package/dist/src/tools/request-tool.test.js +253 -0
  339. package/dist/src/tools/request-tool.test.js.map +1 -0
  340. package/dist/src/tools/store-tools.d.ts +29 -0
  341. package/dist/src/tools/store-tools.js +224 -0
  342. package/dist/src/tools/store-tools.js.map +1 -0
  343. package/dist/src/tools/store-tools.test.d.ts +6 -0
  344. package/dist/src/tools/store-tools.test.js +215 -0
  345. package/dist/src/tools/store-tools.test.js.map +1 -0
  346. package/dist/src/tools/types.d.ts +129 -0
  347. package/dist/src/tools/types.js +7 -0
  348. package/dist/src/tools/types.js.map +1 -0
  349. package/dist/src/tools/web-search-tool.d.ts +31 -0
  350. package/dist/src/tools/web-search-tool.js +170 -0
  351. package/dist/src/tools/web-search-tool.js.map +1 -0
  352. package/dist/src/tools/web-search-tool.test.d.ts +6 -0
  353. package/dist/src/tools/web-search-tool.test.js +153 -0
  354. package/dist/src/tools/web-search-tool.test.js.map +1 -0
  355. package/dist/src/tools/web-tools-shared.d.ts +21 -0
  356. package/dist/src/tools/web-tools-shared.js +32 -0
  357. package/dist/src/tools/web-tools-shared.js.map +1 -0
  358. package/dist/src/types.d.ts +40 -12
  359. package/dist/src/types.js +16 -2
  360. package/dist/src/types.js.map +1 -1
  361. package/dist/tsconfig.tsbuildinfo +1 -1
  362. package/package.json +27 -4
  363. package/dist/src/__tests__/sse-contract.test.js +0 -464
  364. package/dist/src/__tests__/sse-contract.test.js.map +0 -1
  365. package/dist/src/__tests__/tools.test.js +0 -583
  366. package/dist/src/__tests__/tools.test.js.map +0 -1
  367. package/dist/src/agent/agent-runner.d.ts +0 -33
  368. package/dist/src/agent/agent-runner.js +0 -1040
  369. package/dist/src/agent/agent-runner.js.map +0 -1
  370. package/dist/src/agent/custom-tools-e2e.test.d.ts +0 -6
  371. package/dist/src/agent/custom-tools-e2e.test.js +0 -566
  372. package/dist/src/agent/custom-tools-e2e.test.js.map +0 -1
  373. package/dist/src/agent/request-helper.d.ts +0 -16
  374. package/dist/src/agent/request-helper.js +0 -96
  375. package/dist/src/agent/request-helper.js.map +0 -1
  376. package/dist/src/agent/session-store.d.ts +0 -62
  377. package/dist/src/agent/session-store.js +0 -151
  378. package/dist/src/agent/session-store.js.map +0 -1
  379. package/dist/src/agent/stores-e2e.test.js +0 -433
  380. package/dist/src/agent/stores-e2e.test.js.map +0 -1
  381. package/dist/src/agent/tool-context-builder.d.ts +0 -11
  382. package/dist/src/agent/tool-context-builder.js +0 -102
  383. package/dist/src/agent/tool-context-builder.js.map +0 -1
  384. package/dist/src/agent/tool-context-builder.test.d.ts +0 -6
  385. package/dist/src/agent/tool-context-builder.test.js +0 -152
  386. package/dist/src/agent/tool-context-builder.test.js.map +0 -1
  387. package/dist/src/agent/write-repo-file.test.js +0 -270
  388. package/dist/src/agent/write-repo-file.test.js.map +0 -1
  389. package/dist/src/cron/heartbeat-runner.d.ts +0 -21
  390. package/dist/src/cron/heartbeat-runner.js +0 -79
  391. package/dist/src/cron/heartbeat-runner.js.map +0 -1
  392. package/dist/src/cron/heartbeat-runner.test.d.ts +0 -6
  393. package/dist/src/cron/heartbeat-runner.test.js +0 -120
  394. package/dist/src/cron/heartbeat-runner.test.js.map +0 -1
  395. package/dist/src/cron/heartbeat-scheduler.d.ts +0 -26
  396. package/dist/src/cron/heartbeat-scheduler.js +0 -55
  397. package/dist/src/cron/heartbeat-scheduler.js.map +0 -1
  398. package/dist/src/cron/heartbeat-scheduler.test.d.ts +0 -6
  399. package/dist/src/cron/heartbeat-scheduler.test.js +0 -61
  400. package/dist/src/cron/heartbeat-scheduler.test.js.map +0 -1
  401. package/dist/src/routes/ai-stream.test.d.ts +0 -6
  402. package/dist/src/routes/ai-stream.test.js +0 -586
  403. package/dist/src/routes/ai-stream.test.js.map +0 -1
  404. package/dist/src/routes/ask-user-response.d.ts +0 -30
  405. package/dist/src/routes/ask-user-response.js +0 -61
  406. package/dist/src/routes/ask-user-response.js.map +0 -1
  407. package/dist/src/routes/ask-user-response.test.d.ts +0 -6
  408. package/dist/src/routes/ask-user-response.test.js +0 -88
  409. package/dist/src/routes/ask-user-response.test.js.map +0 -1
  410. package/dist/src/routes/chat-stream.test.d.ts +0 -6
  411. package/dist/src/routes/chat-stream.test.js +0 -155
  412. package/dist/src/routes/chat-stream.test.js.map +0 -1
  413. package/dist/src/routes/chat.test.d.ts +0 -6
  414. package/dist/src/routes/chat.test.js +0 -99
  415. package/dist/src/routes/chat.test.js.map +0 -1
  416. package/dist/src/routes/widget-actions.d.ts +0 -49
  417. package/dist/src/routes/widget-actions.js +0 -78
  418. package/dist/src/routes/widget-actions.js.map +0 -1
  419. package/dist/src/session/admin-file-tools.d.ts +0 -136
  420. package/dist/src/session/admin-file-tools.js +0 -240
  421. package/dist/src/session/admin-file-tools.js.map +0 -1
  422. package/dist/src/session/custom-tool-adapter.d.ts +0 -74
  423. package/dist/src/session/custom-tool-adapter.js +0 -180
  424. package/dist/src/session/custom-tool-adapter.js.map +0 -1
  425. package/dist/src/session/history-converter.d.ts +0 -21
  426. package/dist/src/session/history-converter.js +0 -59
  427. package/dist/src/session/history-converter.js.map +0 -1
  428. package/dist/src/session/history-converter.test.d.ts +0 -6
  429. package/dist/src/session/history-converter.test.js +0 -130
  430. package/dist/src/session/history-converter.test.js.map +0 -1
  431. package/dist/src/session/session-manager.d.ts +0 -219
  432. package/dist/src/session/session-manager.js +0 -915
  433. package/dist/src/session/session-manager.js.map +0 -1
  434. package/dist/src/session/session-manager.test.d.ts +0 -6
  435. package/dist/src/session/session-manager.test.js +0 -455
  436. package/dist/src/session/session-manager.test.js.map +0 -1
  437. package/dist/src/session/session-runner.d.ts +0 -45
  438. package/dist/src/session/session-runner.js +0 -719
  439. package/dist/src/session/session-runner.js.map +0 -1
  440. package/dist/src/session/session-runner.test.d.ts +0 -6
  441. package/dist/src/session/session-runner.test.js +0 -834
  442. package/dist/src/session/session-runner.test.js.map +0 -1
  443. /package/dist/src/{__tests__/sse-contract.test.d.ts → __fixtures__/e2e.test.d.ts} +0 -0
  444. /package/dist/src/{__tests__/tools.test.d.ts → __fixtures__/smoke.test.d.ts} +0 -0
  445. /package/dist/src/agent/{write-repo-file.test.d.ts → loop.test.d.ts} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dispatching.js","sourceRoot":"","sources":["../../../../src/agent/states/dispatching.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;;;;GAWG;AAEH,OAAO,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAC;AAE5C,OAAO,EAAC,kBAAkB,EAAC,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAC,mBAAmB,EAAC,MAAM,kBAAkB,CAAC;AAOrD,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AACpC,OAAO,EAAC,mBAAmB,EAAC,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAC,uBAAuB,EAAE,kBAAkB,EAAC,MAAM,8BAA8B,CAAC;AAEzF,8EAA8E;AAC9E,YAAY;AACZ,8EAA8E;AAE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AmB;IACxF,MAAM,QAAQ,GAAG,SAAS,CAAC,MAAM,GAAG,CAAC;QACnC,CAAC,CAAC,wBAAwB,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;QAChD,CAAC,CAAC,EAAE,CAAC;IAEP,OAAO,YAAY,SAAS;;sHAEwF,QAAQ,EAAE,CAAC;AACjI,CAAC"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Amodal Labs, Inc.
4
+ * SPDX-License-Identifier: MIT
5
+ */
6
+ import type { SSEEvent } from '../../types.js';
7
+ import type { ToolDefinition } from '../../tools/types.js';
8
+ import type { ExecutingState, AgentContext, TransitionResult, ToolCall, ToolResult } from '../loop-types.js';
9
+ /**
10
+ * Handle the EXECUTING state — execute a single tool call.
11
+ */
12
+ export declare function handleExecuting(state: ExecutingState, ctx: AgentContext): Promise<TransitionResult>;
13
+ /**
14
+ * Execute a tool call, building the ToolContext from the AgentContext.
15
+ * Enforces a timeout via AbortSignal to prevent hanging on broken tools.
16
+ */
17
+ export declare function executeTool(call: ToolCall, toolDef: ToolDefinition, ctx: AgentContext): Promise<unknown>;
18
+ /**
19
+ * After a tool result: append to messages, then continue to next call or back to THINKING.
20
+ */
21
+ export declare function nextAfterToolResult(state: ExecutingState, result: ToolResult, effects: SSEEvent[], ctx: AgentContext): TransitionResult;
@@ -0,0 +1,452 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Amodal Labs, Inc.
4
+ * SPDX-License-Identifier: MIT
5
+ */
6
+ import { SSEEventType } from '../../types.js';
7
+ import { estimateTokenCount } from '../token-estimate.js';
8
+ import { DISPATCH_TOOL_NAME } from '../../tools/dispatch-tool.js';
9
+ /**
10
+ * Handle the EXECUTING state — execute a single tool call.
11
+ */
12
+ export async function handleExecuting(state, ctx) {
13
+ const { current, queue } = state;
14
+ const effects = [];
15
+ const timestamp = new Date().toISOString();
16
+ // 1. Look up the tool
17
+ const toolDef = ctx.toolRegistry.get(current.toolName);
18
+ if (!toolDef) {
19
+ const result = {
20
+ callId: current.toolCallId,
21
+ toolName: current.toolName,
22
+ status: 'error',
23
+ content: `Tool "${current.toolName}" not found. Available tools: ${ctx.toolRegistry.names().join(', ')}`,
24
+ };
25
+ ctx.logger.warn('tool_not_found', {
26
+ tool: current.toolName,
27
+ session: ctx.sessionId,
28
+ });
29
+ return nextAfterToolResult(state, result, effects, ctx);
30
+ }
31
+ // 2. Validate args against schema (cheap guard against hallucinated params)
32
+ // Only for Zod schemas — FlexibleSchema (MCP/custom tools) uses jsonSchema()
33
+ // which is validated by the AI SDK at the provider level.
34
+ if ('safeParse' in toolDef.parameters) {
35
+ const validation = toolDef.parameters.safeParse(current.args);
36
+ if (!validation.success) {
37
+ const result = {
38
+ callId: current.toolCallId,
39
+ toolName: current.toolName,
40
+ status: 'error',
41
+ content: `Invalid parameters: ${validation.error.message}`,
42
+ };
43
+ ctx.logger.warn('tool_args_invalid', {
44
+ tool: current.toolName,
45
+ callId: current.toolCallId,
46
+ session: ctx.sessionId,
47
+ errors: validation.error.issues,
48
+ });
49
+ return nextAfterToolResult(state, result, effects, ctx);
50
+ }
51
+ }
52
+ // 3a. Tool-level confirmation gate — applies to any tool that sets
53
+ // `requiresConfirmation: true`. Routes through CONFIRMING on the first
54
+ // call; subsequent passes (after user approval) are tracked in
55
+ // `ctx.confirmedCallIds` to avoid an infinite EXECUTING → CONFIRMING
56
+ // loop. Connection tools handle confirmation via their ACL path below
57
+ // and should leave this flag undefined.
58
+ if (toolDef.requiresConfirmation && !ctx.confirmedCallIds.has(current.toolCallId)) {
59
+ ctx.logger.info('tool_confirmation_required', {
60
+ tool: current.toolName,
61
+ callId: current.toolCallId,
62
+ session: ctx.sessionId,
63
+ reason: 'tool_flagged_requires_confirmation',
64
+ });
65
+ return {
66
+ next: { type: 'confirming', call: current, remainingQueue: queue },
67
+ effects: [...effects, {
68
+ type: SSEEventType.ConfirmationRequired,
69
+ endpoint: current.toolName,
70
+ method: 'EXECUTE',
71
+ reason: `Tool "${current.toolName}" requires user confirmation`,
72
+ escalated: false,
73
+ timestamp,
74
+ }],
75
+ };
76
+ }
77
+ // 3b. Connection-tool ACL check — access.json rules with endpoint-level
78
+ // allow/deny/confirm tiers. Store/admin tools have their own guards
79
+ // (read-only paths, blocked filenames, schema validation).
80
+ if (toolDef.metadata?.category === 'connection' && toolDef.metadata.connection) {
81
+ const method = typeof current.args['method'] === 'string' ? current.args['method'] : 'GET';
82
+ const endpoint = typeof current.args['endpoint'] === 'string' ? current.args['endpoint'] : '/';
83
+ const rawIntent = current.args['intent'];
84
+ const intent = rawIntent === 'write' || rawIntent === 'confirmed_write' ? rawIntent : 'read';
85
+ const permResult = ctx.permissionChecker.check({
86
+ connection: toolDef.metadata.connection,
87
+ endpointPath: `${method} ${endpoint}`,
88
+ intent,
89
+ method,
90
+ params: current.args,
91
+ });
92
+ if (!permResult.allowed) {
93
+ const result = {
94
+ callId: current.toolCallId,
95
+ toolName: current.toolName,
96
+ status: 'error',
97
+ content: `Permission denied: ${permResult.reason}`,
98
+ };
99
+ ctx.logger.warn('tool_permission_denied', {
100
+ tool: current.toolName,
101
+ reason: permResult.reason,
102
+ session: ctx.sessionId,
103
+ });
104
+ return nextAfterToolResult(state, result, effects, ctx);
105
+ }
106
+ if (permResult.allowed &&
107
+ permResult.requiresConfirmation &&
108
+ !ctx.confirmedCallIds.has(current.toolCallId)) {
109
+ return {
110
+ next: { type: 'confirming', call: current, remainingQueue: queue },
111
+ effects: [...effects, {
112
+ type: SSEEventType.ConfirmationRequired,
113
+ endpoint,
114
+ method,
115
+ reason: permResult.reason,
116
+ escalated: false,
117
+ timestamp,
118
+ }],
119
+ };
120
+ }
121
+ }
122
+ // 4. Intercept dispatch_task — transition to DISPATCHING instead of executing
123
+ if (current.toolName === DISPATCH_TOOL_NAME) {
124
+ const args = current.args;
125
+ const rawTools = Array.isArray(args['tools']) ? args['tools'] : [];
126
+ const toolSubset = rawTools
127
+ .filter((t) => typeof t === 'string')
128
+ .filter((t) => t !== DISPATCH_TOOL_NAME);
129
+ effects.push({
130
+ type: SSEEventType.ToolCallStart,
131
+ tool_name: current.toolName,
132
+ tool_id: current.toolCallId,
133
+ parameters: sanitizeParams(current.args),
134
+ timestamp,
135
+ });
136
+ return {
137
+ next: {
138
+ type: 'dispatching',
139
+ task: {
140
+ agentName: String(args['agent_name'] ?? 'sub-agent'),
141
+ toolSubset,
142
+ prompt: String(args['prompt'] ?? ''),
143
+ maxTurns: typeof args['max_turns'] === 'number' ? args['max_turns'] : undefined,
144
+ },
145
+ toolCallId: current.toolCallId,
146
+ queue,
147
+ results: state.results,
148
+ },
149
+ effects,
150
+ };
151
+ }
152
+ // 5. Decide: can we batch this call with leading read-only calls from the
153
+ // queue? Batching lets independent read-only tools run concurrently
154
+ // instead of taking one EXECUTING transition per call. Non-batchable
155
+ // calls (writes, confirmation-required, connection ACL, dispatch) still
156
+ // flow through the single-call path for correctness.
157
+ const batch = collectBatch(current, toolDef, queue, ctx);
158
+ if (batch.calls.length > 1) {
159
+ return executeBatch(state, batch, effects, ctx);
160
+ }
161
+ // Single-call path: execute the current tool, emit events, advance state.
162
+ effects.push(buildToolCallStartEvent(current, timestamp));
163
+ const { result, duration } = await runToolCall(current, toolDef, ctx);
164
+ effects.push(buildToolCallResultEvent(current, result, duration));
165
+ ctx.logger.info('tool_call', {
166
+ tool: current.toolName,
167
+ callId: current.toolCallId,
168
+ status: result.status,
169
+ session: ctx.sessionId,
170
+ duration,
171
+ });
172
+ return nextAfterToolResult(state, result, effects, ctx);
173
+ }
174
+ /**
175
+ * A call is batchable when it can't trigger a mid-queue state-machine
176
+ * transition. Connection tools are excluded because their ACL check can
177
+ * return `requiresConfirmation`, which would need a transition to
178
+ * CONFIRMING — and a batch can only produce one `next` state.
179
+ * Confirmation-flagged and dispatch tools are excluded for the same
180
+ * reason: the state machine must route them individually.
181
+ */
182
+ function isBatchable(toolDef) {
183
+ return (toolDef.readOnly === true &&
184
+ !toolDef.requiresConfirmation &&
185
+ toolDef.metadata?.category !== 'connection');
186
+ }
187
+ /**
188
+ * Collect the current call plus the leading contiguous run of batchable
189
+ * calls from the queue. Stops at the first non-batchable call so writes
190
+ * and gated calls stay sequential.
191
+ */
192
+ function collectBatch(current, currentToolDef, queue, ctx) {
193
+ if (!isBatchable(currentToolDef)) {
194
+ return { calls: [{ call: current, toolDef: currentToolDef }], remainingQueue: queue };
195
+ }
196
+ const calls = [{ call: current, toolDef: currentToolDef }];
197
+ let i = 0;
198
+ for (; i < queue.length; i++) {
199
+ const peek = queue[i];
200
+ const peekDef = ctx.toolRegistry.get(peek.toolName);
201
+ if (!peekDef || !isBatchable(peekDef))
202
+ break;
203
+ calls.push({ call: peek, toolDef: peekDef });
204
+ }
205
+ return { calls, remainingQueue: queue.slice(i) };
206
+ }
207
+ /**
208
+ * Run a batch of read-only tool calls concurrently. Emits per-call
209
+ * ToolCallStart events first (so UIs can render N in-flight cards at once),
210
+ * awaits all results via Promise.all, then emits per-call ToolCallResult
211
+ * events in the original call order. A failure in one call does not block
212
+ * the others — each produces its own result message for the model.
213
+ */
214
+ async function executeBatch(state, batch, priorEffects, ctx) {
215
+ const effects = [...priorEffects];
216
+ const startTimestamp = new Date().toISOString();
217
+ // Fire all start events before kicking off the work
218
+ for (const { call } of batch.calls) {
219
+ effects.push(buildToolCallStartEvent(call, startTimestamp));
220
+ }
221
+ // Run all calls concurrently (pre-exec cache is used per-call inside runToolCall)
222
+ const runs = await Promise.all(batch.calls.map(({ call, toolDef }) => runToolCall(call, toolDef, ctx)));
223
+ // Emit result events + structured logs in the original order
224
+ for (let i = 0; i < batch.calls.length; i++) {
225
+ const { call } = batch.calls[i];
226
+ const { result, duration } = runs[i];
227
+ effects.push(buildToolCallResultEvent(call, result, duration));
228
+ ctx.logger.info('tool_call', {
229
+ tool: call.toolName,
230
+ callId: call.toolCallId,
231
+ status: result.status,
232
+ session: ctx.sessionId,
233
+ duration,
234
+ });
235
+ }
236
+ // Apply smart-snipping per result and append each as a tool message in
237
+ // call order, then advance the state. Batched results never individually
238
+ // transition — they collectively advance the state once.
239
+ const snippedResults = runs.map(({ result }) => snipIfOversized(result, ctx));
240
+ for (const result of snippedResults) {
241
+ ctx.messages = [...ctx.messages, buildToolResultMessage(result)];
242
+ }
243
+ const allResults = [...state.results, ...snippedResults];
244
+ // More calls pending? Continue in EXECUTING with the next one.
245
+ if (batch.remainingQueue.length > 0) {
246
+ const [next, ...rest] = batch.remainingQueue;
247
+ return {
248
+ next: { type: 'executing', queue: rest, current: next, results: allResults },
249
+ effects,
250
+ };
251
+ }
252
+ // Batch cleared the queue — transition to COMPACTING or THINKING.
253
+ return transitionAfterQueueEmpty(ctx, effects);
254
+ }
255
+ // ---------------------------------------------------------------------------
256
+ // Per-call execution helpers
257
+ // ---------------------------------------------------------------------------
258
+ /**
259
+ * Execute one tool call (using the pre-exec cache when present), capture
260
+ * duration, and build a ToolResult. Never throws — tool failures become
261
+ * error results the model can observe.
262
+ */
263
+ async function runToolCall(call, toolDef, ctx) {
264
+ const startedAt = Date.now();
265
+ try {
266
+ // Check pre-execution cache first (read-only tools started during streaming)
267
+ const cached = ctx.preExecutionCache.get(call.toolCallId);
268
+ const output = cached ? await cached : await executeTool(call, toolDef, ctx);
269
+ const content = typeof output === 'string' ? output : JSON.stringify(output);
270
+ // Detect error-as-result pattern: tool returned {error: "..."} without throwing.
271
+ // This happens when tool internals catch errors and return them as data.
272
+ // Treat these as failures so the SSE event shows status: 'error'.
273
+ const isErrorResult = typeof output === 'object' &&
274
+ output !== null &&
275
+ 'error' in output &&
276
+ typeof output['error'] === 'string' &&
277
+ Object.keys(output).length === 1;
278
+ const duration = Date.now() - startedAt;
279
+ if (isErrorResult) {
280
+ ctx.logger.warn('tool_returned_error', {
281
+ tool: call.toolName,
282
+ callId: call.toolCallId,
283
+ error: output['error'],
284
+ session: ctx.sessionId,
285
+ duration,
286
+ });
287
+ }
288
+ return {
289
+ result: {
290
+ callId: call.toolCallId,
291
+ toolName: call.toolName,
292
+ status: isErrorResult ? 'error' : 'success',
293
+ content,
294
+ },
295
+ duration,
296
+ };
297
+ }
298
+ catch (err) {
299
+ const duration = Date.now() - startedAt;
300
+ ctx.logger.error('tool_execution_error', {
301
+ tool: call.toolName,
302
+ callId: call.toolCallId,
303
+ error: err instanceof Error ? err.message : String(err),
304
+ session: ctx.sessionId,
305
+ duration,
306
+ });
307
+ return {
308
+ result: {
309
+ callId: call.toolCallId,
310
+ toolName: call.toolName,
311
+ status: 'error',
312
+ content: `Tool execution failed: ${err instanceof Error ? err.message : String(err)}`,
313
+ },
314
+ duration,
315
+ };
316
+ }
317
+ }
318
+ function buildToolCallStartEvent(call, timestamp) {
319
+ return {
320
+ type: SSEEventType.ToolCallStart,
321
+ tool_name: call.toolName,
322
+ tool_id: call.toolCallId,
323
+ parameters: sanitizeParams(call.args),
324
+ timestamp,
325
+ };
326
+ }
327
+ function buildToolCallResultEvent(call, result, duration) {
328
+ return {
329
+ type: SSEEventType.ToolCallResult,
330
+ tool_id: call.toolCallId,
331
+ status: result.status,
332
+ duration_ms: duration,
333
+ ...(result.status === 'error' ? { error: result.content } : {}),
334
+ timestamp: new Date().toISOString(),
335
+ };
336
+ }
337
+ /**
338
+ * Execute a tool call, building the ToolContext from the AgentContext.
339
+ * Enforces a timeout via AbortSignal to prevent hanging on broken tools.
340
+ */
341
+ export async function executeTool(call, toolDef, ctx) {
342
+ const toolCtx = ctx.buildToolContext(call.toolCallId);
343
+ // Combine session abort signal with a per-tool timeout.
344
+ // Mutate instead of spread — toolCtx.request() reads ctx.signal at call
345
+ // time, so the combined signal propagates to HTTP requests and other
346
+ // async operations inside the tool.
347
+ const timeoutSignal = AbortSignal.timeout(ctx.config.toolTimeoutMs);
348
+ toolCtx.signal = AbortSignal.any([ctx.signal, timeoutSignal]);
349
+ return toolDef.execute(call.args, toolCtx);
350
+ }
351
+ /**
352
+ * After a tool result: append to messages, then continue to next call or back to THINKING.
353
+ */
354
+ export function nextAfterToolResult(state, result, effects, ctx) {
355
+ const snipped = snipIfOversized(result, ctx);
356
+ // Append tool result message
357
+ const resultMessage = buildToolResultMessage(snipped);
358
+ ctx.messages = [...ctx.messages, resultMessage];
359
+ const allResults = [...state.results, snipped];
360
+ // More tool calls in the queue?
361
+ if (state.queue.length > 0) {
362
+ const [next, ...rest] = state.queue;
363
+ return {
364
+ next: {
365
+ type: 'executing',
366
+ queue: rest,
367
+ current: next,
368
+ results: allResults,
369
+ },
370
+ effects,
371
+ };
372
+ }
373
+ return transitionAfterQueueEmpty(ctx, effects);
374
+ }
375
+ /**
376
+ * Smart snipping: if a tool result exceeds maxResultSize, keep the first
377
+ * and last 2K chars with a [snipped] marker in between. This preserves the
378
+ * beginning (usually headers/structure) and end (usually the answer) while
379
+ * cutting the middle bulk.
380
+ */
381
+ function snipIfOversized(result, ctx) {
382
+ if (result.content.length <= ctx.config.maxResultSize)
383
+ return result;
384
+ const originalSize = result.content.length;
385
+ const keepChars = 2_000;
386
+ const head = result.content.slice(0, keepChars);
387
+ const tail = result.content.slice(-keepChars);
388
+ ctx.logger.info('tool_result_snipped', {
389
+ callId: result.callId,
390
+ tool: result.toolName,
391
+ originalSize,
392
+ snippedTo: keepChars * 2,
393
+ session: ctx.sessionId,
394
+ });
395
+ return {
396
+ ...result,
397
+ content: `${head}\n\n[... snipped ${String(originalSize - keepChars * 2)} chars — full output was ${String(originalSize)} chars ...]\n\n${tail}`,
398
+ };
399
+ }
400
+ /**
401
+ * Transition after the tool-call queue is drained — either COMPACTING if
402
+ * context is heavy, or THINKING for the next LLM turn.
403
+ */
404
+ function transitionAfterQueueEmpty(ctx, effects) {
405
+ const estimatedTokens = estimateTokenCount(ctx.messages, ctx.provider);
406
+ if (estimatedTokens > ctx.maxContextTokens * ctx.config.compactThreshold) {
407
+ ctx.logger.info('context_compaction_triggered', {
408
+ session: ctx.sessionId,
409
+ estimatedTokens,
410
+ maxContextTokens: ctx.maxContextTokens,
411
+ threshold: ctx.config.compactThreshold,
412
+ });
413
+ return {
414
+ next: { type: 'compacting', messages: ctx.messages, estimatedTokens },
415
+ effects,
416
+ };
417
+ }
418
+ return {
419
+ next: { type: 'thinking', messages: ctx.messages },
420
+ effects,
421
+ };
422
+ }
423
+ /**
424
+ * Build a tool result message in AI SDK format.
425
+ */
426
+ function buildToolResultMessage(result) {
427
+ return {
428
+ role: 'tool',
429
+ content: [{
430
+ type: 'tool-result',
431
+ toolCallId: result.callId,
432
+ toolName: result.toolName,
433
+ output: { type: 'text', value: result.content },
434
+ }],
435
+ };
436
+ }
437
+ /**
438
+ * Strip sensitive fields from tool call parameters for SSE events.
439
+ */
440
+ function sanitizeParams(params) {
441
+ const sanitized = {};
442
+ for (const [key, value] of Object.entries(params)) {
443
+ if (/token|secret|password|key|auth/i.test(key)) {
444
+ sanitized[key] = '[REDACTED]';
445
+ }
446
+ else {
447
+ sanitized[key] = value;
448
+ }
449
+ }
450
+ return sanitized;
451
+ }
452
+ //# sourceMappingURL=executing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"executing.js","sourceRoot":"","sources":["../../../../src/agent/states/executing.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAuBH,OAAO,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAC;AAU5C,OAAO,EAAC,kBAAkB,EAAC,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAC,kBAAkB,EAAC,MAAM,8BAA8B,CAAC;AAEhE;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CACnC,KAAqB,EACrB,GAAiB;IAEjB,MAAM,EAAC,OAAO,EAAE,KAAK,EAAC,GAAG,KAAK,CAAC;IAC/B,MAAM,OAAO,GAAe,EAAE,CAAC;IAC/B,MAAM,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAE3C,sBAAsB;IACtB,MAAM,OAAO,GAAG,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACvD,IAAI,CAAC,OAAO,EAAE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gBAAgB;SACvC,CAAC,CAAC;QACH,OAAO;YACL,IAAI,EAAE,EAAC,IAAI,EAAE,YAAY,EAAE,QAAQ,EAAE,GAAG,CAAC,QAAQ,EAAE,eAAe,EAAC;YACnE,OAAO;SACR,CAAC;IACJ,CAAC;IACD,OAAO;QACL,IAAI,EAAE,EAAC,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,CAAC,QAAQ,EAAC;QAChD,OAAO;KACR,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,SAAS,sBAAsB,CAAC,MAAkB;IAChD,OAAO;QACL,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,CAAC;gBACR,IAAI,EAAE,aAAsB;gBAC5B,UAAU,EAAE,MAAM,CAAC,MAAM;gBACzB,QAAQ,EAAE,MAAM,CAAC,QAAQ;gBACzB,MAAM,EAAE,EAAC,IAAI,EAAE,MAAe,EAAE,KAAK,EAAE,MAAM,CAAC,OAAO,EAAC;aACvD,CAAC;KACH,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,SAAS,cAAc,CAAC,MAA+B;IACrD,MAAM,SAAS,GAA4B,EAAE,CAAC;IAC9C,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QAClD,IAAI,iCAAiC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;YAChD,SAAS,CAAC,GAAG,CAAC,GAAG,YAAY,CAAC;QAChC,CAAC;aAAM,CAAC;YACN,SAAS,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QACzB,CAAC;IACH,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Amodal Labs, Inc.
4
+ * SPDX-License-Identifier: MIT
5
+ */
6
+ import type { StreamingState, AgentContext, TransitionResult } from '../loop-types.js';
7
+ /**
8
+ * Handle the STREAMING state.
9
+ */
10
+ export declare function handleStreaming(state: StreamingState, ctx: AgentContext): Promise<TransitionResult>;