@swirls/looms 0.0.2 → 0.2.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 (375) hide show
  1. package/CHANGELOG.md +24 -2
  2. package/dist/actor/cell.d.ts +9 -4
  3. package/dist/actor/cell.js +7 -11
  4. package/dist/actor/host.d.ts +7 -3
  5. package/dist/actor/host.js +57 -33
  6. package/dist/actor/index.d.ts +1 -1
  7. package/dist/actor/index.js +1 -1
  8. package/dist/actor/routing.d.ts +12 -1
  9. package/dist/actor/routing.js +57 -51
  10. package/dist/agent/agent-session.d.ts +5 -0
  11. package/dist/agent/agent-session.js +270 -0
  12. package/dist/agent/debugger/agent-chat.d.ts +2 -0
  13. package/dist/agent/debugger/agent-chat.js +176 -0
  14. package/dist/agent/debugger/index.d.ts +5 -0
  15. package/dist/agent/debugger/index.js +19 -0
  16. package/dist/agent/debugger/summarize.d.ts +2 -0
  17. package/dist/agent/debugger/summarize.js +51 -0
  18. package/dist/agent/debugger/token-usage.d.ts +3 -0
  19. package/dist/agent/debugger/token-usage.js +11 -0
  20. package/dist/agent/definitions-store.d.ts +2 -3
  21. package/dist/agent/definitions-store.js +2 -4
  22. package/dist/agent/definitions.d.ts +47 -29
  23. package/dist/agent/definitions.js +39 -12
  24. package/dist/agent/effects.d.ts +359 -2
  25. package/dist/agent/effects.js +60 -34
  26. package/dist/agent/events.d.ts +175 -19
  27. package/dist/agent/events.js +45 -10
  28. package/dist/agent/index.d.ts +1 -0
  29. package/dist/agent/index.js +1 -0
  30. package/dist/agent/llm.d.ts +11 -2
  31. package/dist/agent/llm.js +13 -3
  32. package/dist/agent/module.d.ts +812 -78
  33. package/dist/agent/module.js +16 -4
  34. package/dist/agent/scope.d.ts +174 -18
  35. package/dist/agent/signals.d.ts +26 -1
  36. package/dist/agent/signals.js +79 -0
  37. package/dist/agent/threads.d.ts +3 -33
  38. package/dist/agent/threads.js +20 -25
  39. package/dist/agent/tool-schema.d.ts +1 -17
  40. package/dist/agent/tool-schema.js +3 -43
  41. package/dist/agent/types.d.ts +49 -4
  42. package/dist/agent/types.js +5 -5
  43. package/dist/ai-vercel/index.d.ts +1 -0
  44. package/dist/ai-vercel/index.js +1 -0
  45. package/dist/ai-vercel/messages.js +22 -7
  46. package/dist/ai-vercel/vercel-evaluator.d.ts +36 -0
  47. package/dist/ai-vercel/vercel-evaluator.js +73 -0
  48. package/dist/ai-vercel/vercel-llm.js +64 -44
  49. package/dist/approval/debugger/approvals-view.d.ts +3 -0
  50. package/dist/approval/debugger/approvals-view.js +16 -0
  51. package/dist/approval/debugger/index.d.ts +4 -0
  52. package/dist/approval/debugger/index.js +11 -0
  53. package/dist/approval/debugger/summarize.d.ts +2 -0
  54. package/dist/approval/debugger/summarize.js +17 -0
  55. package/dist/approval/effects.d.ts +89 -0
  56. package/dist/approval/module.d.ts +179 -29
  57. package/dist/approval/projections.d.ts +0 -14
  58. package/dist/approval/projections.js +20 -3
  59. package/dist/approval/signals.d.ts +2 -0
  60. package/dist/approval/signals.js +18 -2
  61. package/dist/cli/cli.js +2 -0
  62. package/dist/cli/commands.js +12 -16
  63. package/dist/client/client.d.ts +1213 -18
  64. package/dist/client/client.js +120 -120
  65. package/dist/client/index.d.ts +1 -1
  66. package/dist/client/index.js +1 -1
  67. package/dist/client/sse.d.ts +13 -0
  68. package/dist/client/sse.js +38 -44
  69. package/dist/cloudflare/alarm-scheduler.d.ts +12 -2
  70. package/dist/cloudflare/alarm-scheduler.js +34 -7
  71. package/dist/cloudflare/durable-object.d.ts +10 -2
  72. package/dist/cloudflare/durable-object.js +59 -28
  73. package/dist/cloudflare/event-store.d.ts +7 -2
  74. package/dist/cloudflare/event-store.js +8 -7
  75. package/dist/cloudflare/index.d.ts +2 -2
  76. package/dist/cloudflare/index.js +2 -2
  77. package/dist/cloudflare/router.d.ts +1 -1
  78. package/dist/cloudflare/router.js +15 -16
  79. package/dist/core/catalog.d.ts +3 -3
  80. package/dist/core/catalog.js +2 -5
  81. package/dist/core/coalesce.js +5 -3
  82. package/dist/core/compose.d.ts +2 -1
  83. package/dist/core/compose.js +19 -2
  84. package/dist/core/debugger-host.d.ts +16 -0
  85. package/dist/core/debugger-host.js +1 -0
  86. package/dist/core/definition-store.d.ts +11 -0
  87. package/dist/core/definition-store.js +6 -0
  88. package/dist/core/effects.d.ts +127 -15
  89. package/dist/core/effects.js +89 -17
  90. package/dist/core/envelope.d.ts +27 -7
  91. package/dist/core/envelope.js +20 -6
  92. package/dist/core/event-codec.d.ts +4 -2
  93. package/dist/core/event-codec.js +10 -5
  94. package/dist/core/event-index.js +1 -3
  95. package/dist/core/fold.d.ts +3 -0
  96. package/dist/core/fold.js +171 -24
  97. package/dist/core/ids.d.ts +5 -0
  98. package/dist/core/ids.js +35 -2
  99. package/dist/core/index.d.ts +7 -1
  100. package/dist/core/index.js +6 -1
  101. package/dist/core/kind.d.ts +22 -0
  102. package/dist/core/kind.js +17 -0
  103. package/dist/core/limits.d.ts +34 -0
  104. package/dist/core/limits.js +46 -0
  105. package/dist/core/match.d.ts +1 -0
  106. package/dist/core/match.js +10 -1
  107. package/dist/core/module-scope.d.ts +22 -20
  108. package/dist/core/module-scope.js +38 -28
  109. package/dist/core/module.d.ts +18 -5
  110. package/dist/core/module.js +4 -0
  111. package/dist/core/projection.d.ts +13 -13
  112. package/dist/core/projection.js +9 -5
  113. package/dist/core/protocol.d.ts +68 -11
  114. package/dist/core/protocol.js +82 -11
  115. package/dist/core/published.d.ts +43 -0
  116. package/dist/core/published.js +44 -0
  117. package/dist/core/replay.d.ts +312 -3
  118. package/dist/core/replay.js +11 -1
  119. package/dist/core/schema.d.ts +11 -20
  120. package/dist/core/schema.js +63 -80
  121. package/dist/core/serialize.js +2 -4
  122. package/dist/core/snapshot-store.d.ts +6 -1
  123. package/dist/core/snapshot-store.js +15 -2
  124. package/dist/core/snapshots.d.ts +5 -1
  125. package/dist/core/snapshots.js +10 -15
  126. package/dist/core/sqlite-store.js +95 -11
  127. package/dist/core/state.d.ts +142 -4
  128. package/dist/core/state.js +78 -0
  129. package/dist/core/store.d.ts +38 -3
  130. package/dist/core/store.js +77 -22
  131. package/dist/core/thread.d.ts +10 -9
  132. package/dist/core/types.d.ts +5 -8
  133. package/dist/core/types.js +28 -24
  134. package/dist/core/validate-event.js +14 -4
  135. package/dist/core/worker-callback.d.ts +17 -0
  136. package/dist/core/worker-callback.js +1 -0
  137. package/dist/debugger/app/assets/index-B3Ah8WAE.css +2 -0
  138. package/dist/debugger/app/assets/index-Qb371t_O.js +22 -0
  139. package/dist/debugger/app/assets/rolldown-runtime-CbXtAM7H.js +1 -0
  140. package/dist/debugger/app/assets/routes-CjtEHgPQ.js +47 -0
  141. package/dist/debugger/app/index.html +14 -0
  142. package/dist/debugger/components/composer.d.ts +17 -0
  143. package/dist/debugger/components/composer.js +25 -0
  144. package/dist/debugger/components/debugger-split.d.ts +2 -1
  145. package/dist/debugger/components/debugger-split.js +2 -2
  146. package/dist/debugger/components/event-inspector.d.ts +2 -1
  147. package/dist/debugger/components/event-inspector.js +25 -16
  148. package/dist/debugger/components/event-stream.d.ts +2 -1
  149. package/dist/debugger/components/event-stream.js +14 -74
  150. package/dist/debugger/components/follow-list.d.ts +19 -0
  151. package/dist/debugger/components/follow-list.js +96 -0
  152. package/dist/debugger/components/json-tree.d.ts +11 -0
  153. package/dist/debugger/components/json-tree.js +120 -0
  154. package/dist/debugger/components/json-view.js +2 -2
  155. package/dist/debugger/components/run-tree.js +53 -20
  156. package/dist/debugger/components/status-dot.d.ts +4 -0
  157. package/dist/debugger/components/status-dot.js +6 -2
  158. package/dist/debugger/context.d.ts +14 -0
  159. package/dist/debugger/context.js +17 -0
  160. package/dist/debugger/contracts.d.ts +7 -4
  161. package/dist/debugger/events/builtin-families.d.ts +3 -0
  162. package/dist/debugger/events/builtin-families.js +9 -0
  163. package/dist/debugger/events/catalog.d.ts +3 -4
  164. package/dist/debugger/events/catalog.js +27 -17
  165. package/dist/debugger/events/protocol-summarize.d.ts +1 -2
  166. package/dist/debugger/events/protocol-summarize.js +42 -24
  167. package/dist/debugger/index.d.ts +20 -6
  168. package/dist/debugger/index.js +19 -5
  169. package/dist/debugger/lib/cn.d.ts +1 -0
  170. package/dist/debugger/lib/cn.js +3 -0
  171. package/dist/debugger/lib/event-meta.d.ts +2 -3
  172. package/dist/debugger/lib/event-meta.js +6 -12
  173. package/dist/debugger/lib/json.d.ts +25 -0
  174. package/dist/debugger/lib/json.js +87 -0
  175. package/dist/debugger/lib/payload.d.ts +7 -0
  176. package/dist/debugger/lib/payload.js +11 -0
  177. package/dist/debugger/lib/time.d.ts +3 -0
  178. package/dist/debugger/lib/time.js +24 -0
  179. package/dist/debugger/plugin.d.ts +36 -0
  180. package/dist/debugger/plugin.js +14 -0
  181. package/dist/debugger/server/index.d.ts +14 -0
  182. package/dist/debugger/server/index.js +114 -0
  183. package/dist/debugger/shell/debugger-shell.d.ts +15 -0
  184. package/dist/debugger/shell/debugger-shell.js +43 -0
  185. package/dist/debugger/shell/definition-key.d.ts +3 -0
  186. package/dist/debugger/shell/definition-key.js +4 -0
  187. package/dist/debugger/shell/events-pane.d.ts +12 -0
  188. package/dist/debugger/shell/events-pane.js +25 -0
  189. package/dist/debugger/shell/projections-panel.d.ts +4 -0
  190. package/dist/debugger/shell/projections-panel.js +59 -0
  191. package/dist/debugger/shell/run-controls.d.ts +4 -0
  192. package/dist/debugger/shell/run-controls.js +72 -0
  193. package/dist/debugger/shell/run-search.d.ts +6 -0
  194. package/dist/debugger/shell/run-search.js +102 -0
  195. package/dist/debugger/shell/run-type-menu.d.ts +6 -0
  196. package/dist/debugger/shell/run-type-menu.js +11 -0
  197. package/dist/debugger/shell/schema-form.d.ts +31 -0
  198. package/dist/debugger/shell/schema-form.js +117 -0
  199. package/dist/debugger/shell/start-form.d.ts +3 -0
  200. package/dist/debugger/shell/start-form.js +75 -0
  201. package/dist/debugger/shell/use-start-run.d.ts +14 -0
  202. package/dist/debugger/shell/use-start-run.js +32 -0
  203. package/dist/debugger/shell/workspace.d.ts +6 -0
  204. package/dist/debugger/shell/workspace.js +15 -0
  205. package/dist/debugger/styles.css +111 -27
  206. package/dist/debugger/ui/button.d.ts +24 -0
  207. package/dist/debugger/ui/button.js +24 -0
  208. package/dist/debugger/ui/command.d.ts +9 -0
  209. package/dist/debugger/ui/command.js +24 -0
  210. package/dist/debugger/ui/dropdown-menu.d.ts +13 -0
  211. package/dist/debugger/ui/dropdown-menu.js +37 -0
  212. package/dist/debugger/ui/panel.d.ts +14 -0
  213. package/dist/debugger/ui/panel.js +16 -0
  214. package/dist/debugger/ui/popover.d.ts +7 -0
  215. package/dist/debugger/ui/popover.js +17 -0
  216. package/dist/debugger/ui/resizable.d.ts +7 -0
  217. package/dist/debugger/ui/resizable.js +14 -0
  218. package/dist/debugger/ui/scroll-area.d.ts +2 -1
  219. package/dist/debugger/ui/scroll-area.js +5 -3
  220. package/dist/debugger/ui/select.d.ts +10 -0
  221. package/dist/debugger/ui/select.js +21 -0
  222. package/dist/debugger/ui/tabs.js +2 -2
  223. package/dist/debugger/ui/textarea.d.ts +3 -0
  224. package/dist/debugger/ui/textarea.js +7 -0
  225. package/dist/evaluator/definitions-store.d.ts +11 -0
  226. package/dist/evaluator/definitions-store.js +8 -0
  227. package/dist/evaluator/definitions.d.ts +18 -0
  228. package/dist/evaluator/definitions.js +4 -0
  229. package/dist/evaluator/effects.d.ts +226 -0
  230. package/dist/evaluator/effects.js +132 -0
  231. package/dist/evaluator/evaluator.d.ts +24 -0
  232. package/dist/evaluator/evaluator.js +67 -0
  233. package/dist/evaluator/events.d.ts +59 -0
  234. package/dist/evaluator/events.js +21 -0
  235. package/dist/evaluator/index.d.ts +11 -0
  236. package/dist/evaluator/index.js +11 -0
  237. package/dist/evaluator/module.d.ts +606 -0
  238. package/dist/evaluator/module.js +25 -0
  239. package/dist/evaluator/projections.d.ts +50 -0
  240. package/dist/evaluator/projections.js +20 -0
  241. package/dist/evaluator/scope.d.ts +59 -0
  242. package/dist/evaluator/scope.js +7 -0
  243. package/dist/evaluator/signals.d.ts +3 -0
  244. package/dist/evaluator/signals.js +17 -0
  245. package/dist/evaluator/threads.d.ts +62 -0
  246. package/dist/evaluator/threads.js +117 -0
  247. package/dist/evaluator/types.d.ts +125 -0
  248. package/dist/evaluator/types.js +51 -0
  249. package/dist/projectors/delivery.d.ts +83 -0
  250. package/dist/projectors/delivery.js +182 -0
  251. package/dist/projectors/index-model.d.ts +1 -1
  252. package/dist/projectors/index-model.js +4 -6
  253. package/dist/projectors/index.d.ts +2 -0
  254. package/dist/projectors/index.js +2 -0
  255. package/dist/projectors/memory.d.ts +1 -1
  256. package/dist/projectors/memory.js +10 -8
  257. package/dist/projectors/postgres.js +44 -58
  258. package/dist/projectors/projector.d.ts +17 -0
  259. package/dist/projectors/projector.js +26 -1
  260. package/dist/projectors/sqlite-delivery.d.ts +4 -0
  261. package/dist/projectors/sqlite-delivery.js +147 -0
  262. package/dist/projectors/sqlite.js +23 -23
  263. package/dist/projectors/with-projectors.d.ts +7 -2
  264. package/dist/projectors/with-projectors.js +27 -28
  265. package/dist/react/notify.js +11 -8
  266. package/dist/react/react.d.ts +2 -3
  267. package/dist/react/react.js +14 -30
  268. package/dist/react/sse.d.ts +1 -1
  269. package/dist/react/sse.js +1 -1
  270. package/dist/react/store.d.ts +3 -3
  271. package/dist/react/store.js +109 -119
  272. package/dist/runtime/cancellation.d.ts +16 -0
  273. package/dist/runtime/cancellation.js +129 -0
  274. package/dist/runtime/deadline-transition-planner.d.ts +31 -0
  275. package/dist/runtime/deadline-transition-planner.js +139 -0
  276. package/dist/runtime/dispatch-effect.d.ts +3 -2
  277. package/dist/runtime/dispatch-effect.js +7 -13
  278. package/dist/runtime/errors.d.ts +51 -0
  279. package/dist/runtime/errors.js +39 -0
  280. package/dist/runtime/{runtime-helpers.d.ts → helpers.d.ts} +24 -4
  281. package/dist/runtime/{runtime-helpers.js → helpers.js} +56 -19
  282. package/dist/runtime/index.d.ts +3 -3
  283. package/dist/runtime/index.js +3 -3
  284. package/dist/runtime/ingress.d.ts +15 -0
  285. package/dist/runtime/ingress.js +42 -0
  286. package/dist/runtime/local-effect-executor.d.ts +21 -0
  287. package/dist/runtime/local-effect-executor.js +137 -0
  288. package/dist/runtime/looms.d.ts +30 -4
  289. package/dist/runtime/looms.js +57 -37
  290. package/dist/runtime/observer.d.ts +45 -0
  291. package/dist/runtime/observer.js +11 -0
  292. package/dist/runtime/repository.d.ts +55 -0
  293. package/dist/runtime/repository.js +293 -0
  294. package/dist/runtime/retry-policy.d.ts +16 -0
  295. package/dist/runtime/retry-policy.js +29 -0
  296. package/dist/runtime/run-execution-context.d.ts +30 -0
  297. package/dist/runtime/run-execution-context.js +56 -0
  298. package/dist/runtime/run-start.d.ts +4 -0
  299. package/dist/runtime/run-start.js +44 -0
  300. package/dist/runtime/runtime.d.ts +6 -87
  301. package/dist/runtime/runtime.js +248 -470
  302. package/dist/runtime/server/auth.d.ts +41 -0
  303. package/dist/runtime/server/auth.js +45 -0
  304. package/dist/runtime/server/debugger-host.d.ts +11 -0
  305. package/dist/runtime/server/debugger-host.js +32 -0
  306. package/dist/runtime/server/fetch-handler.d.ts +18 -0
  307. package/dist/runtime/server/fetch-handler.js +62 -0
  308. package/dist/runtime/server/http.d.ts +38 -0
  309. package/dist/runtime/server/http.js +66 -0
  310. package/dist/runtime/server/route-table.d.ts +55 -0
  311. package/dist/runtime/server/route-table.js +74 -0
  312. package/dist/runtime/server/routes/definitions.d.ts +3 -0
  313. package/dist/runtime/server/routes/definitions.js +20 -0
  314. package/dist/runtime/server/routes/effects.d.ts +3 -0
  315. package/dist/runtime/server/routes/effects.js +59 -0
  316. package/dist/runtime/server/routes/operations.d.ts +3 -0
  317. package/dist/runtime/server/routes/operations.js +14 -0
  318. package/dist/runtime/server/routes/runs.d.ts +3 -0
  319. package/dist/runtime/server/routes/runs.js +199 -0
  320. package/dist/runtime/server.d.ts +4 -8
  321. package/dist/runtime/server.js +6 -211
  322. package/dist/runtime/sse.d.ts +2 -1
  323. package/dist/runtime/sse.js +24 -17
  324. package/dist/runtime/types.d.ts +117 -0
  325. package/dist/runtime/types.js +1 -0
  326. package/dist/runtime/wake-engine.d.ts +20 -0
  327. package/dist/runtime/wake-engine.js +311 -0
  328. package/dist/runtime/wake-scheduler.d.ts +3 -4
  329. package/dist/runtime/wake-scheduler.js +25 -31
  330. package/dist/runtime/worker-callbacks.d.ts +16 -0
  331. package/dist/runtime/worker-callbacks.js +167 -0
  332. package/dist/runtime/worker-effect-dispatch.d.ts +36 -0
  333. package/dist/runtime/worker-effect-dispatch.js +126 -0
  334. package/dist/s2/config.d.ts +1 -1
  335. package/dist/s2/config.js +1 -1
  336. package/dist/s2/lite.js +70 -82
  337. package/dist/s2/pagination.d.ts +15 -0
  338. package/dist/s2/pagination.js +36 -0
  339. package/dist/s2/projector.js +6 -5
  340. package/dist/s2/snapshot-store.js +188 -161
  341. package/dist/s2/store.d.ts +3 -21
  342. package/dist/s2/store.js +71 -165
  343. package/dist/testing/index.d.ts +15 -0
  344. package/dist/testing/index.js +53 -16
  345. package/dist/workflow/debugger/index.d.ts +4 -0
  346. package/dist/workflow/debugger/index.js +11 -0
  347. package/dist/workflow/debugger/nodes-view.d.ts +3 -0
  348. package/dist/workflow/debugger/nodes-view.js +13 -0
  349. package/dist/workflow/debugger/summarize.d.ts +2 -0
  350. package/dist/workflow/debugger/summarize.js +30 -0
  351. package/dist/workflow/definitions-store.d.ts +2 -3
  352. package/dist/workflow/definitions-store.js +2 -2
  353. package/dist/workflow/definitions.d.ts +78 -22
  354. package/dist/workflow/definitions.js +80 -14
  355. package/dist/workflow/effects.d.ts +453 -107
  356. package/dist/workflow/effects.js +214 -115
  357. package/dist/workflow/events.d.ts +149 -5
  358. package/dist/workflow/events.js +27 -5
  359. package/dist/workflow/graph.d.ts +56 -0
  360. package/dist/workflow/graph.js +207 -0
  361. package/dist/workflow/index.d.ts +1 -0
  362. package/dist/workflow/index.js +1 -0
  363. package/dist/workflow/module.d.ts +1047 -266
  364. package/dist/workflow/projections.d.ts +14 -12
  365. package/dist/workflow/projections.js +30 -8
  366. package/dist/workflow/scope.d.ts +146 -4
  367. package/dist/workflow/threads.d.ts +383 -155
  368. package/dist/workflow/threads.js +308 -110
  369. package/package.json +26 -2
  370. package/dist/debugger/events/domain-summarize.d.ts +0 -3
  371. package/dist/debugger/events/domain-summarize.js +0 -107
  372. package/dist/debugger/events/family.d.ts +0 -8
  373. package/dist/debugger/events/family.js +0 -44
  374. package/dist/runtime/events-api.d.ts +0 -4
  375. package/dist/runtime/events-api.js +0 -84
@@ -1,7 +1,7 @@
1
- import type { AgentDefinition } from './definitions';
1
+ import type { AgentDefinition, AgentSessionDefinition } from './definitions';
2
2
  import { LlmTag, type LlmAdapter, type StubLlmPolicy } from './llm';
3
3
  export interface AgentModuleOptions {
4
- readonly definitions?: readonly AgentDefinition[];
4
+ readonly definitions?: readonly (AgentDefinition | AgentSessionDefinition)[];
5
5
  /** Model adapter used for every agent turn. Defaults to a deterministic stub for tests and scripted agents. */
6
6
  readonly llm?: LlmAdapter;
7
7
  readonly llmPolicy?: StubLlmPolicy;
@@ -21,14 +21,14 @@ export declare function agent(options?: AgentModuleOptions): import("@swirls/loo
21
21
  }>;
22
22
  }>;
23
23
  'turn.started': import("effect/Schema").Struct<{
24
- readonly turn: import("effect/Schema").Number;
24
+ readonly turn: import("effect/Schema").Finite;
25
25
  }>;
26
26
  'turn.text_delta': import("effect/Schema").Struct<{
27
- readonly turn: import("effect/Schema").Number;
27
+ readonly turn: import("effect/Schema").Finite;
28
28
  readonly delta: import("effect/Schema").String;
29
29
  }>;
30
30
  message: import("effect/Schema").Struct<{
31
- readonly turn: import("effect/Schema").Number;
31
+ readonly turn: import("effect/Schema").Finite;
32
32
  readonly message: import("effect/Schema").Struct<{
33
33
  readonly role: import("effect/Schema").Union<readonly [import("effect/Schema").Literal<"system">, import("effect/Schema").Literal<"user">, import("effect/Schema").Literal<"assistant">, import("effect/Schema").Literal<"tool">]>;
34
34
  readonly content: import("effect/Schema").String;
@@ -41,12 +41,12 @@ export declare function agent(options?: AgentModuleOptions): import("@swirls/loo
41
41
  }>>>>;
42
42
  }>;
43
43
  readonly usage: import("effect/Schema").optional<import("effect/Schema").Struct<{
44
- readonly input: import("effect/Schema").Number;
45
- readonly output: import("effect/Schema").Number;
44
+ readonly input: import("effect/Schema").Finite;
45
+ readonly output: import("effect/Schema").Finite;
46
46
  }>>;
47
47
  }>;
48
48
  'tool_call.requested': import("effect/Schema").Struct<{
49
- readonly turn: import("effect/Schema").Number;
49
+ readonly turn: import("effect/Schema").Finite;
50
50
  readonly toolCall: import("effect/Schema").Struct<{
51
51
  readonly id: import("effect/Schema").String;
52
52
  readonly name: import("effect/Schema").String;
@@ -54,14 +54,15 @@ export declare function agent(options?: AgentModuleOptions): import("@swirls/loo
54
54
  }>;
55
55
  }>;
56
56
  'tool.result': import("effect/Schema").Struct<{
57
- readonly turn: import("effect/Schema").Number;
57
+ readonly turn: import("effect/Schema").Finite;
58
58
  readonly toolCallId: import("effect/Schema").String;
59
59
  readonly name: import("effect/Schema").String;
60
60
  readonly result: import("effect/Schema").NullOr<import("effect/Schema").Codec<import("effect/Schema").Json, import("effect/Schema").Json, never, never>>;
61
61
  readonly error: import("effect/Schema").NullOr<import("effect/Schema").String>;
62
62
  }>;
63
63
  steered: import("effect/Schema").Struct<{
64
- readonly turn: import("effect/Schema").Number;
64
+ readonly turn: import("effect/Schema").Finite;
65
+ readonly messageId: import("effect/Schema").optional<import("effect/Schema").String>;
65
66
  readonly message: import("effect/Schema").Struct<{
66
67
  readonly role: import("effect/Schema").Union<readonly [import("effect/Schema").Literal<"system">, import("effect/Schema").Literal<"user">, import("effect/Schema").Literal<"assistant">, import("effect/Schema").Literal<"tool">]>;
67
68
  readonly content: import("effect/Schema").String;
@@ -75,16 +76,93 @@ export declare function agent(options?: AgentModuleOptions): import("@swirls/loo
75
76
  }>;
76
77
  readonly interrupt: import("effect/Schema").optional<import("effect/Schema").Boolean>;
77
78
  }>;
79
+ 'session.message.submitted': import("effect/Schema").Struct<{
80
+ readonly messageId: import("effect/Schema").String;
81
+ readonly text: import("effect/Schema").String;
82
+ readonly delivery: import("effect/Schema").optional<import("effect/Schema").Union<readonly [import("effect/Schema").Literal<"steer">, import("effect/Schema").Literal<"followUp">, import("effect/Schema").Literal<"nextTurn">]>>;
83
+ readonly activeChildThreadId: import("effect/Schema").optional<import("effect/Schema").String>;
84
+ }>;
85
+ 'session.steer.delivered': import("effect/Schema").Struct<{
86
+ readonly messageId: import("effect/Schema").String;
87
+ readonly activeMessageId: import("effect/Schema").String;
88
+ }>;
89
+ 'session.turn.started': import("effect/Schema").Struct<{
90
+ readonly messageId: import("effect/Schema").String;
91
+ readonly childThreadId: import("effect/Schema").String;
92
+ }>;
93
+ 'session.turn.closed': import("effect/Schema").Struct<{
94
+ readonly messageId: import("effect/Schema").String;
95
+ readonly status: import("effect/Schema").Union<readonly [import("effect/Schema").Literal<"completed">, import("effect/Schema").Literal<"failed">, import("effect/Schema").Literal<"cancelled">]>;
96
+ readonly error: import("effect/Schema").optional<import("effect/Schema").String>;
97
+ }>;
98
+ 'session.cancel.requested': import("effect/Schema").Struct<{}>;
78
99
  'spawn.requested': import("effect/Schema").Struct<{
79
100
  readonly childThreadId: import("effect/Schema").String;
80
101
  readonly kind: import("effect/Schema").String;
81
102
  readonly definitionName: import("effect/Schema").String;
103
+ readonly definitionVersion: import("effect/Schema").withDecodingDefaultKey<import("effect/Schema").String, never>;
82
104
  readonly toolCallId: import("effect/Schema").String;
83
105
  readonly input: import("effect/Schema").Codec<import("effect/Schema").Json, import("effect/Schema").Json, never, never>;
84
106
  }>;
85
107
  'effects.requested': import("effect/Schema").Struct<{
86
108
  readonly toolCallId: import("effect/Schema").String;
87
- readonly effects: import("effect/Schema").$Array<import("effect/Schema").Schema<import("@swirls/looms/core").RuntimeEffect>>;
109
+ readonly effects: import("effect/Schema").$Array<import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
110
+ readonly type: import("effect/Schema").Literal<"runtime.spawn">;
111
+ readonly childThreadId: import("effect/Schema").String;
112
+ readonly kind: import("effect/Schema").String;
113
+ readonly definitionName: import("effect/Schema").String;
114
+ readonly definitionVersion: import("effect/Schema").withDecodingDefaultKey<import("effect/Schema").String, never>;
115
+ readonly input: import("effect/Schema").Codec<import("effect/Schema").Json, import("effect/Schema").Json, never, never>;
116
+ }>, import("effect/Schema").Struct<{
117
+ readonly type: import("effect/Schema").Literal<"runtime.wait">;
118
+ readonly waitId: import("effect/Schema").String;
119
+ readonly on: import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
120
+ readonly type: import("effect/Schema").Union<readonly [import("effect/Schema").String, import("effect/Schema").$Array<import("effect/Schema").String>]>;
121
+ readonly match: import("effect/Schema").optional<import("effect/Schema").Codec<import("effect/Schema").Json, import("effect/Schema").Json, never, never>>;
122
+ }>, import("effect/Schema").Struct<{
123
+ readonly timerAt: import("effect/Schema").Finite;
124
+ }>]>;
125
+ readonly tag: import("effect/Schema").optional<import("effect/Schema").Codec<import("effect/Schema").Json, import("effect/Schema").Json, never, never>>;
126
+ }>, import("effect/Schema").Struct<{
127
+ readonly type: import("effect/Schema").Literal<"runtime.emit">;
128
+ readonly event: import("effect/Schema").Struct<{
129
+ readonly type: import("effect/Schema").String;
130
+ readonly payload: import("effect/Schema").Codec<import("effect/Schema").Json, import("effect/Schema").Json, never, never>;
131
+ readonly threadId: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
132
+ readonly parentThreadId: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
133
+ readonly causationId: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
134
+ readonly correlationId: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
135
+ readonly effectId: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
136
+ readonly origin: import("effect/Schema").optional<import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
137
+ readonly type: import("effect/Schema").Literal<"thread">;
138
+ readonly threadId: import("effect/Schema").String;
139
+ }>, import("effect/Schema").Struct<{
140
+ readonly type: import("effect/Schema").Literal<"external">;
141
+ readonly actorId: import("effect/Schema").optional<import("effect/Schema").String>;
142
+ }>, import("effect/Schema").Struct<{
143
+ readonly type: import("effect/Schema").Literal<"system">;
144
+ }>]>>;
145
+ readonly ephemeral: import("effect/Schema").optional<import("effect/Schema").Boolean>;
146
+ readonly id: import("effect/Schema").optional<import("effect/Schema").String>;
147
+ readonly ts: import("effect/Schema").optional<import("effect/Schema").Finite>;
148
+ readonly idempotencyKey: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
149
+ }>;
150
+ readonly tag: import("effect/Schema").optional<import("effect/Schema").String>;
151
+ }>, import("effect/Schema").Struct<{
152
+ readonly type: import("effect/Schema").Literal<"runtime.complete">;
153
+ readonly output: import("effect/Schema").Codec<import("effect/Schema").Json, import("effect/Schema").Json, never, never>;
154
+ }>, import("effect/Schema").Struct<{
155
+ readonly type: import("effect/Schema").Literal<"runtime.fail">;
156
+ readonly error: import("effect/Schema").String;
157
+ }>, import("effect/Schema").Struct<{
158
+ readonly type: import("effect/Schema").Literal<"runtime.cancel">;
159
+ readonly threadId: import("effect/Schema").String;
160
+ readonly tag: import("effect/Schema").optional<import("effect/Schema").String>;
161
+ }>, import("effect/Schema").Struct<{
162
+ readonly type: import("effect/Schema").String;
163
+ readonly input: import("effect/Schema").Codec<import("effect/Schema").Json, import("effect/Schema").Json, never, never>;
164
+ readonly tag: import("effect/Schema").optional<import("effect/Schema").String>;
165
+ }>]>>;
88
166
  readonly waitOn: import("effect/Schema").optional<import("effect/Schema").Struct<{
89
167
  readonly type: import("effect/Schema").Union<readonly [import("effect/Schema").String, import("effect/Schema").$Array<import("effect/Schema").String>]>;
90
168
  readonly match: import("effect/Schema").optional<import("effect/Schema").Codec<import("effect/Schema").Json, import("effect/Schema").Json, never, never>>;
@@ -94,6 +172,7 @@ export declare function agent(options?: AgentModuleOptions): import("@swirls/loo
94
172
  callLLM: import("@swirls/looms/core").EffectDefinition<{
95
173
  readonly turn: number;
96
174
  readonly definitionName?: string | undefined;
175
+ readonly definitionVersion: string;
97
176
  readonly messages?: readonly {
98
177
  readonly role: "assistant" | "system" | "tool" | "user";
99
178
  readonly content: string;
@@ -106,11 +185,68 @@ export declare function agent(options?: AgentModuleOptions): import("@swirls/loo
106
185
  }[] | undefined;
107
186
  }[] | undefined;
108
187
  readonly input?: import("effect/Schema").Json | undefined;
188
+ readonly consumedSteerMessageIds?: readonly string[] | undefined;
109
189
  }, import("./definitions-store").AgentDefinitionsTag | LlmTag, (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
110
190
  readonly type: "agent.effects.requested";
111
191
  readonly payload: {
112
192
  readonly toolCallId: string;
113
- readonly effects: readonly import("@swirls/looms/core").RuntimeEffect[];
193
+ readonly effects: readonly ({
194
+ readonly type: "runtime.spawn";
195
+ readonly childThreadId: string;
196
+ readonly kind: string;
197
+ readonly definitionName: string;
198
+ readonly definitionVersion: string;
199
+ readonly input: import("effect/Schema").Json;
200
+ } | {
201
+ readonly type: "runtime.wait";
202
+ readonly waitId: string;
203
+ readonly on: {
204
+ readonly type: string | readonly string[];
205
+ readonly match?: import("effect/Schema").Json | undefined;
206
+ } | {
207
+ readonly timerAt: number;
208
+ };
209
+ readonly tag?: import("effect/Schema").Json | undefined;
210
+ } | {
211
+ readonly type: "runtime.emit";
212
+ readonly event: {
213
+ readonly type: string;
214
+ readonly payload: import("effect/Schema").Json;
215
+ readonly threadId?: string | null | undefined;
216
+ readonly parentThreadId?: string | null | undefined;
217
+ readonly causationId?: string | null | undefined;
218
+ readonly correlationId?: string | null | undefined;
219
+ readonly effectId?: string | null | undefined;
220
+ readonly origin?: {
221
+ readonly type: "thread";
222
+ readonly threadId: string;
223
+ } | {
224
+ readonly type: "external";
225
+ readonly actorId?: string | undefined;
226
+ } | {
227
+ readonly type: "system";
228
+ } | undefined;
229
+ readonly ephemeral?: boolean | undefined;
230
+ readonly id?: string | undefined;
231
+ readonly ts?: number | undefined;
232
+ readonly idempotencyKey?: string | null | undefined;
233
+ };
234
+ readonly tag?: string | undefined;
235
+ } | {
236
+ readonly type: "runtime.complete";
237
+ readonly output: import("effect/Schema").Json;
238
+ } | {
239
+ readonly type: "runtime.fail";
240
+ readonly error: string;
241
+ } | {
242
+ readonly type: "runtime.cancel";
243
+ readonly threadId: string;
244
+ readonly tag?: string | undefined;
245
+ } | {
246
+ readonly type: string;
247
+ readonly input: import("effect/Schema").Json;
248
+ readonly tag?: string | undefined;
249
+ })[];
114
250
  readonly waitOn?: {
115
251
  readonly type: string | readonly string[];
116
252
  readonly match?: import("effect/Schema").Json | undefined;
@@ -151,12 +287,43 @@ export declare function agent(options?: AgentModuleOptions): import("@swirls/loo
151
287
  }[] | undefined;
152
288
  };
153
289
  };
290
+ }) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
291
+ readonly type: "agent.session.cancel.requested";
292
+ readonly payload: {};
293
+ }) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
294
+ readonly type: "agent.session.message.submitted";
295
+ readonly payload: {
296
+ readonly messageId: string;
297
+ readonly text: string;
298
+ readonly delivery?: "followUp" | "nextTurn" | "steer" | undefined;
299
+ readonly activeChildThreadId?: string | undefined;
300
+ };
301
+ }) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
302
+ readonly type: "agent.session.steer.delivered";
303
+ readonly payload: {
304
+ readonly messageId: string;
305
+ readonly activeMessageId: string;
306
+ };
307
+ }) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
308
+ readonly type: "agent.session.turn.closed";
309
+ readonly payload: {
310
+ readonly messageId: string;
311
+ readonly status: "cancelled" | "completed" | "failed";
312
+ readonly error?: string | undefined;
313
+ };
314
+ }) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
315
+ readonly type: "agent.session.turn.started";
316
+ readonly payload: {
317
+ readonly messageId: string;
318
+ readonly childThreadId: string;
319
+ };
154
320
  }) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
155
321
  readonly type: "agent.spawn.requested";
156
322
  readonly payload: {
157
323
  readonly childThreadId: string;
158
324
  readonly kind: string;
159
325
  readonly definitionName: string;
326
+ readonly definitionVersion: string;
160
327
  readonly toolCallId: string;
161
328
  readonly input: import("effect/Schema").Json;
162
329
  };
@@ -164,6 +331,7 @@ export declare function agent(options?: AgentModuleOptions): import("@swirls/loo
164
331
  readonly type: "agent.steered";
165
332
  readonly payload: {
166
333
  readonly turn: number;
334
+ readonly messageId?: string | undefined;
167
335
  readonly message: {
168
336
  readonly role: "assistant" | "system" | "tool" | "user";
169
337
  readonly content: string;
@@ -207,12 +375,93 @@ export declare function agent(options?: AgentModuleOptions): import("@swirls/loo
207
375
  readonly turn: number;
208
376
  readonly delta: string;
209
377
  };
378
+ }) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
379
+ readonly type: "runtime.effect.ambiguous";
380
+ readonly payload: {
381
+ readonly effectId: string;
382
+ readonly attempt: number;
383
+ readonly error: string;
384
+ };
385
+ }) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
386
+ readonly type: "runtime.effect.attempt.started";
387
+ readonly payload: {
388
+ readonly effectId: string;
389
+ readonly attempt: number;
390
+ };
391
+ }) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
392
+ readonly type: "runtime.effect.cancel.requested";
393
+ readonly payload: {
394
+ readonly effectId: string;
395
+ readonly attempt: number;
396
+ readonly deadlineAt: number | null;
397
+ };
398
+ }) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
399
+ readonly type: "runtime.effect.cancelled";
400
+ readonly payload: {
401
+ readonly effectId: string;
402
+ readonly attempt: number;
403
+ };
404
+ }) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
405
+ readonly type: "runtime.effect.completed";
406
+ readonly payload: {
407
+ readonly effectId: string;
408
+ readonly attempt: number;
409
+ };
410
+ }) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
411
+ readonly type: "runtime.effect.dispatched";
412
+ readonly payload: {
413
+ readonly effectId: string;
414
+ readonly attempt: number;
415
+ readonly deadlineAt: number | null;
416
+ };
210
417
  }) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
211
418
  readonly type: "runtime.effect.failed";
212
419
  readonly payload: {
213
420
  readonly effectId: string;
214
421
  readonly error: string;
215
422
  };
423
+ }) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
424
+ readonly type: "runtime.effect.heartbeat";
425
+ readonly payload: {
426
+ readonly effectId: string;
427
+ readonly attempt: number;
428
+ readonly heartbeatAt: number;
429
+ readonly deadlineAt: number | null;
430
+ };
431
+ }) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
432
+ readonly type: "runtime.effect.queued";
433
+ readonly payload: {
434
+ readonly effectId: string;
435
+ readonly attempt: number;
436
+ readonly deadlineAt: number | null;
437
+ };
438
+ }) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
439
+ readonly type: "runtime.effect.retry.scheduled";
440
+ readonly payload: {
441
+ readonly effectId: string;
442
+ readonly attempt: number;
443
+ readonly nextAttemptAt: number;
444
+ readonly error: string;
445
+ };
446
+ }) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
447
+ readonly type: "runtime.effect.timed_out";
448
+ readonly payload: {
449
+ readonly effectId: string;
450
+ readonly attempt: number;
451
+ readonly timeout: string;
452
+ };
453
+ }) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
454
+ readonly type: "runtime.effect.worker.started";
455
+ readonly payload: {
456
+ readonly effectId: string;
457
+ readonly attempt: number;
458
+ readonly deadlineAt: number | null;
459
+ };
460
+ }) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
461
+ readonly type: "runtime.run.cancelled";
462
+ readonly payload: {
463
+ readonly reason?: string | undefined;
464
+ };
216
465
  }) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
217
466
  readonly type: "runtime.run.completed";
218
467
  readonly payload: {
@@ -225,7 +474,9 @@ export declare function agent(options?: AgentModuleOptions): import("@swirls/loo
225
474
  readonly rootThreadId?: string | undefined;
226
475
  readonly kind: string;
227
476
  readonly definitionName: string;
477
+ readonly definitionVersion: string;
228
478
  readonly input: import("effect/Schema").Json;
479
+ readonly requestedThreadId?: string | null | undefined;
229
480
  };
230
481
  }) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
231
482
  readonly type: "runtime.signal.received";
@@ -239,6 +490,11 @@ export declare function agent(options?: AgentModuleOptions): import("@swirls/loo
239
490
  readonly stateHash: string;
240
491
  readonly state?: import("effect/Schema").Json | undefined;
241
492
  };
493
+ }) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
494
+ readonly type: "runtime.thread.cancel.requested";
495
+ readonly payload: {
496
+ readonly threadId: string;
497
+ };
242
498
  }) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
243
499
  readonly type: "runtime.thread.cancelled";
244
500
  readonly payload: {
@@ -263,6 +519,7 @@ export declare function agent(options?: AgentModuleOptions): import("@swirls/loo
263
519
  readonly threadId: string;
264
520
  readonly kind: string;
265
521
  readonly definitionName: string;
522
+ readonly definitionVersion: string;
266
523
  readonly input: import("effect/Schema").Json;
267
524
  readonly parentThreadId: string | null;
268
525
  };
@@ -307,6 +564,7 @@ export declare function agent(options?: AgentModuleOptions): import("@swirls/loo
307
564
  executeTool: import("@swirls/looms/core").EffectDefinition<{
308
565
  readonly turn: number;
309
566
  readonly definitionName?: string | undefined;
567
+ readonly definitionVersion: string;
310
568
  readonly toolCall: {
311
569
  readonly id: string;
312
570
  readonly name: string;
@@ -316,7 +574,63 @@ export declare function agent(options?: AgentModuleOptions): import("@swirls/loo
316
574
  readonly type: "agent.effects.requested";
317
575
  readonly payload: {
318
576
  readonly toolCallId: string;
319
- readonly effects: readonly import("@swirls/looms/core").RuntimeEffect[];
577
+ readonly effects: readonly ({
578
+ readonly type: "runtime.spawn";
579
+ readonly childThreadId: string;
580
+ readonly kind: string;
581
+ readonly definitionName: string;
582
+ readonly definitionVersion: string;
583
+ readonly input: import("effect/Schema").Json;
584
+ } | {
585
+ readonly type: "runtime.wait";
586
+ readonly waitId: string;
587
+ readonly on: {
588
+ readonly type: string | readonly string[];
589
+ readonly match?: import("effect/Schema").Json | undefined;
590
+ } | {
591
+ readonly timerAt: number;
592
+ };
593
+ readonly tag?: import("effect/Schema").Json | undefined;
594
+ } | {
595
+ readonly type: "runtime.emit";
596
+ readonly event: {
597
+ readonly type: string;
598
+ readonly payload: import("effect/Schema").Json;
599
+ readonly threadId?: string | null | undefined;
600
+ readonly parentThreadId?: string | null | undefined;
601
+ readonly causationId?: string | null | undefined;
602
+ readonly correlationId?: string | null | undefined;
603
+ readonly effectId?: string | null | undefined;
604
+ readonly origin?: {
605
+ readonly type: "thread";
606
+ readonly threadId: string;
607
+ } | {
608
+ readonly type: "external";
609
+ readonly actorId?: string | undefined;
610
+ } | {
611
+ readonly type: "system";
612
+ } | undefined;
613
+ readonly ephemeral?: boolean | undefined;
614
+ readonly id?: string | undefined;
615
+ readonly ts?: number | undefined;
616
+ readonly idempotencyKey?: string | null | undefined;
617
+ };
618
+ readonly tag?: string | undefined;
619
+ } | {
620
+ readonly type: "runtime.complete";
621
+ readonly output: import("effect/Schema").Json;
622
+ } | {
623
+ readonly type: "runtime.fail";
624
+ readonly error: string;
625
+ } | {
626
+ readonly type: "runtime.cancel";
627
+ readonly threadId: string;
628
+ readonly tag?: string | undefined;
629
+ } | {
630
+ readonly type: string;
631
+ readonly input: import("effect/Schema").Json;
632
+ readonly tag?: string | undefined;
633
+ })[];
320
634
  readonly waitOn?: {
321
635
  readonly type: string | readonly string[];
322
636
  readonly match?: import("effect/Schema").Json | undefined;
@@ -357,12 +671,43 @@ export declare function agent(options?: AgentModuleOptions): import("@swirls/loo
357
671
  }[] | undefined;
358
672
  };
359
673
  };
674
+ }) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
675
+ readonly type: "agent.session.cancel.requested";
676
+ readonly payload: {};
677
+ }) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
678
+ readonly type: "agent.session.message.submitted";
679
+ readonly payload: {
680
+ readonly messageId: string;
681
+ readonly text: string;
682
+ readonly delivery?: "followUp" | "nextTurn" | "steer" | undefined;
683
+ readonly activeChildThreadId?: string | undefined;
684
+ };
685
+ }) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
686
+ readonly type: "agent.session.steer.delivered";
687
+ readonly payload: {
688
+ readonly messageId: string;
689
+ readonly activeMessageId: string;
690
+ };
691
+ }) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
692
+ readonly type: "agent.session.turn.closed";
693
+ readonly payload: {
694
+ readonly messageId: string;
695
+ readonly status: "cancelled" | "completed" | "failed";
696
+ readonly error?: string | undefined;
697
+ };
698
+ }) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
699
+ readonly type: "agent.session.turn.started";
700
+ readonly payload: {
701
+ readonly messageId: string;
702
+ readonly childThreadId: string;
703
+ };
360
704
  }) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
361
705
  readonly type: "agent.spawn.requested";
362
706
  readonly payload: {
363
707
  readonly childThreadId: string;
364
708
  readonly kind: string;
365
709
  readonly definitionName: string;
710
+ readonly definitionVersion: string;
366
711
  readonly toolCallId: string;
367
712
  readonly input: import("effect/Schema").Json;
368
713
  };
@@ -370,6 +715,7 @@ export declare function agent(options?: AgentModuleOptions): import("@swirls/loo
370
715
  readonly type: "agent.steered";
371
716
  readonly payload: {
372
717
  readonly turn: number;
718
+ readonly messageId?: string | undefined;
373
719
  readonly message: {
374
720
  readonly role: "assistant" | "system" | "tool" | "user";
375
721
  readonly content: string;
@@ -413,12 +759,93 @@ export declare function agent(options?: AgentModuleOptions): import("@swirls/loo
413
759
  readonly turn: number;
414
760
  readonly delta: string;
415
761
  };
762
+ }) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
763
+ readonly type: "runtime.effect.ambiguous";
764
+ readonly payload: {
765
+ readonly effectId: string;
766
+ readonly attempt: number;
767
+ readonly error: string;
768
+ };
769
+ }) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
770
+ readonly type: "runtime.effect.attempt.started";
771
+ readonly payload: {
772
+ readonly effectId: string;
773
+ readonly attempt: number;
774
+ };
775
+ }) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
776
+ readonly type: "runtime.effect.cancel.requested";
777
+ readonly payload: {
778
+ readonly effectId: string;
779
+ readonly attempt: number;
780
+ readonly deadlineAt: number | null;
781
+ };
782
+ }) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
783
+ readonly type: "runtime.effect.cancelled";
784
+ readonly payload: {
785
+ readonly effectId: string;
786
+ readonly attempt: number;
787
+ };
788
+ }) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
789
+ readonly type: "runtime.effect.completed";
790
+ readonly payload: {
791
+ readonly effectId: string;
792
+ readonly attempt: number;
793
+ };
794
+ }) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
795
+ readonly type: "runtime.effect.dispatched";
796
+ readonly payload: {
797
+ readonly effectId: string;
798
+ readonly attempt: number;
799
+ readonly deadlineAt: number | null;
800
+ };
416
801
  }) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
417
802
  readonly type: "runtime.effect.failed";
418
803
  readonly payload: {
419
804
  readonly effectId: string;
420
805
  readonly error: string;
421
806
  };
807
+ }) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
808
+ readonly type: "runtime.effect.heartbeat";
809
+ readonly payload: {
810
+ readonly effectId: string;
811
+ readonly attempt: number;
812
+ readonly heartbeatAt: number;
813
+ readonly deadlineAt: number | null;
814
+ };
815
+ }) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
816
+ readonly type: "runtime.effect.queued";
817
+ readonly payload: {
818
+ readonly effectId: string;
819
+ readonly attempt: number;
820
+ readonly deadlineAt: number | null;
821
+ };
822
+ }) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
823
+ readonly type: "runtime.effect.retry.scheduled";
824
+ readonly payload: {
825
+ readonly effectId: string;
826
+ readonly attempt: number;
827
+ readonly nextAttemptAt: number;
828
+ readonly error: string;
829
+ };
830
+ }) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
831
+ readonly type: "runtime.effect.timed_out";
832
+ readonly payload: {
833
+ readonly effectId: string;
834
+ readonly attempt: number;
835
+ readonly timeout: string;
836
+ };
837
+ }) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
838
+ readonly type: "runtime.effect.worker.started";
839
+ readonly payload: {
840
+ readonly effectId: string;
841
+ readonly attempt: number;
842
+ readonly deadlineAt: number | null;
843
+ };
844
+ }) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
845
+ readonly type: "runtime.run.cancelled";
846
+ readonly payload: {
847
+ readonly reason?: string | undefined;
848
+ };
422
849
  }) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
423
850
  readonly type: "runtime.run.completed";
424
851
  readonly payload: {
@@ -431,7 +858,9 @@ export declare function agent(options?: AgentModuleOptions): import("@swirls/loo
431
858
  readonly rootThreadId?: string | undefined;
432
859
  readonly kind: string;
433
860
  readonly definitionName: string;
861
+ readonly definitionVersion: string;
434
862
  readonly input: import("effect/Schema").Json;
863
+ readonly requestedThreadId?: string | null | undefined;
435
864
  };
436
865
  }) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
437
866
  readonly type: "runtime.signal.received";
@@ -445,6 +874,11 @@ export declare function agent(options?: AgentModuleOptions): import("@swirls/loo
445
874
  readonly stateHash: string;
446
875
  readonly state?: import("effect/Schema").Json | undefined;
447
876
  };
877
+ }) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
878
+ readonly type: "runtime.thread.cancel.requested";
879
+ readonly payload: {
880
+ readonly threadId: string;
881
+ };
448
882
  }) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
449
883
  readonly type: "runtime.thread.cancelled";
450
884
  readonly payload: {
@@ -469,6 +903,7 @@ export declare function agent(options?: AgentModuleOptions): import("@swirls/loo
469
903
  readonly threadId: string;
470
904
  readonly kind: string;
471
905
  readonly definitionName: string;
906
+ readonly definitionVersion: string;
472
907
  readonly input: import("effect/Schema").Json;
473
908
  readonly parentThreadId: string | null;
474
909
  };
@@ -511,37 +946,8 @@ export declare function agent(options?: AgentModuleOptions): import("@swirls/loo
511
946
  };
512
947
  })>;
513
948
  }, {
514
- agent: import("@swirls/looms/core").ThreadDefinition<{
515
- definitionName?: string;
516
- lines: import("./types").Message[];
517
- pendingToolCalls: import("./types").ToolCall[];
518
- executingToolCalls: import("./types").ToolCall[];
519
- needsLlmCall: boolean;
520
- turn: number;
521
- maxTurns: number;
522
- pendingSteer: import("./types").Message | null;
523
- input: import("@swirls/looms/core").JsonValue;
524
- output: import("@swirls/looms/core").JsonValue | null;
525
- pendingEffectTools: {
526
- [causingSeq: string]: import("./types").PendingEffectTool;
527
- };
528
- pendingSpawns: import("./types").AgentPendingSpawn[];
529
- pendingEffects: import("./types").AgentPendingEffects[];
530
- pendingEmits: (import("./types").AgentPendingEmit | {
531
- id: string;
532
- event: {
533
- type: string;
534
- payload: {
535
- turn: number;
536
- toolCallId: string;
537
- name: string;
538
- result: string | number | boolean | import("effect/Schema").JsonArray | import("effect/Schema").JsonObject | null;
539
- error: string | null;
540
- };
541
- threadId: string;
542
- };
543
- })[];
544
- }>;
949
+ agent: import("@swirls/looms/core").ThreadDefinition<import("./types").AgentState>;
950
+ 'agent-session': import("@swirls/looms/core").ThreadDefinition<import("./types").AgentSessionState>;
545
951
  }, {
546
952
  conversation: import("@swirls/looms/core").ProjectionDefinition<{
547
953
  readonly lines: {
@@ -560,11 +966,12 @@ export declare function agent(options?: AgentModuleOptions): import("@swirls/loo
560
966
  readonly input: number;
561
967
  readonly output: number;
562
968
  }>;
563
- }, any> & {
969
+ }, import("effect/Context").Service.Any> & {
564
970
  readonly effects: {
565
971
  callLLM: import("@swirls/looms/core").EffectDefinition<{
566
972
  readonly turn: number;
567
973
  readonly definitionName?: string | undefined;
974
+ readonly definitionVersion: string;
568
975
  readonly messages?: readonly {
569
976
  readonly role: "assistant" | "system" | "tool" | "user";
570
977
  readonly content: string;
@@ -577,11 +984,68 @@ export declare function agent(options?: AgentModuleOptions): import("@swirls/loo
577
984
  }[] | undefined;
578
985
  }[] | undefined;
579
986
  readonly input?: import("effect/Schema").Json | undefined;
987
+ readonly consumedSteerMessageIds?: readonly string[] | undefined;
580
988
  }, import("./definitions-store").AgentDefinitionsTag | LlmTag, (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
581
989
  readonly type: "agent.effects.requested";
582
990
  readonly payload: {
583
991
  readonly toolCallId: string;
584
- readonly effects: readonly import("@swirls/looms/core").RuntimeEffect[];
992
+ readonly effects: readonly ({
993
+ readonly type: "runtime.spawn";
994
+ readonly childThreadId: string;
995
+ readonly kind: string;
996
+ readonly definitionName: string;
997
+ readonly definitionVersion: string;
998
+ readonly input: import("effect/Schema").Json;
999
+ } | {
1000
+ readonly type: "runtime.wait";
1001
+ readonly waitId: string;
1002
+ readonly on: {
1003
+ readonly type: string | readonly string[];
1004
+ readonly match?: import("effect/Schema").Json | undefined;
1005
+ } | {
1006
+ readonly timerAt: number;
1007
+ };
1008
+ readonly tag?: import("effect/Schema").Json | undefined;
1009
+ } | {
1010
+ readonly type: "runtime.emit";
1011
+ readonly event: {
1012
+ readonly type: string;
1013
+ readonly payload: import("effect/Schema").Json;
1014
+ readonly threadId?: string | null | undefined;
1015
+ readonly parentThreadId?: string | null | undefined;
1016
+ readonly causationId?: string | null | undefined;
1017
+ readonly correlationId?: string | null | undefined;
1018
+ readonly effectId?: string | null | undefined;
1019
+ readonly origin?: {
1020
+ readonly type: "thread";
1021
+ readonly threadId: string;
1022
+ } | {
1023
+ readonly type: "external";
1024
+ readonly actorId?: string | undefined;
1025
+ } | {
1026
+ readonly type: "system";
1027
+ } | undefined;
1028
+ readonly ephemeral?: boolean | undefined;
1029
+ readonly id?: string | undefined;
1030
+ readonly ts?: number | undefined;
1031
+ readonly idempotencyKey?: string | null | undefined;
1032
+ };
1033
+ readonly tag?: string | undefined;
1034
+ } | {
1035
+ readonly type: "runtime.complete";
1036
+ readonly output: import("effect/Schema").Json;
1037
+ } | {
1038
+ readonly type: "runtime.fail";
1039
+ readonly error: string;
1040
+ } | {
1041
+ readonly type: "runtime.cancel";
1042
+ readonly threadId: string;
1043
+ readonly tag?: string | undefined;
1044
+ } | {
1045
+ readonly type: string;
1046
+ readonly input: import("effect/Schema").Json;
1047
+ readonly tag?: string | undefined;
1048
+ })[];
585
1049
  readonly waitOn?: {
586
1050
  readonly type: string | readonly string[];
587
1051
  readonly match?: import("effect/Schema").Json | undefined;
@@ -622,12 +1086,43 @@ export declare function agent(options?: AgentModuleOptions): import("@swirls/loo
622
1086
  }[] | undefined;
623
1087
  };
624
1088
  };
1089
+ }) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
1090
+ readonly type: "agent.session.cancel.requested";
1091
+ readonly payload: {};
1092
+ }) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
1093
+ readonly type: "agent.session.message.submitted";
1094
+ readonly payload: {
1095
+ readonly messageId: string;
1096
+ readonly text: string;
1097
+ readonly delivery?: "followUp" | "nextTurn" | "steer" | undefined;
1098
+ readonly activeChildThreadId?: string | undefined;
1099
+ };
1100
+ }) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
1101
+ readonly type: "agent.session.steer.delivered";
1102
+ readonly payload: {
1103
+ readonly messageId: string;
1104
+ readonly activeMessageId: string;
1105
+ };
1106
+ }) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
1107
+ readonly type: "agent.session.turn.closed";
1108
+ readonly payload: {
1109
+ readonly messageId: string;
1110
+ readonly status: "cancelled" | "completed" | "failed";
1111
+ readonly error?: string | undefined;
1112
+ };
1113
+ }) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
1114
+ readonly type: "agent.session.turn.started";
1115
+ readonly payload: {
1116
+ readonly messageId: string;
1117
+ readonly childThreadId: string;
1118
+ };
625
1119
  }) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
626
1120
  readonly type: "agent.spawn.requested";
627
1121
  readonly payload: {
628
1122
  readonly childThreadId: string;
629
1123
  readonly kind: string;
630
1124
  readonly definitionName: string;
1125
+ readonly definitionVersion: string;
631
1126
  readonly toolCallId: string;
632
1127
  readonly input: import("effect/Schema").Json;
633
1128
  };
@@ -635,6 +1130,7 @@ export declare function agent(options?: AgentModuleOptions): import("@swirls/loo
635
1130
  readonly type: "agent.steered";
636
1131
  readonly payload: {
637
1132
  readonly turn: number;
1133
+ readonly messageId?: string | undefined;
638
1134
  readonly message: {
639
1135
  readonly role: "assistant" | "system" | "tool" | "user";
640
1136
  readonly content: string;
@@ -678,12 +1174,93 @@ export declare function agent(options?: AgentModuleOptions): import("@swirls/loo
678
1174
  readonly turn: number;
679
1175
  readonly delta: string;
680
1176
  };
1177
+ }) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
1178
+ readonly type: "runtime.effect.ambiguous";
1179
+ readonly payload: {
1180
+ readonly effectId: string;
1181
+ readonly attempt: number;
1182
+ readonly error: string;
1183
+ };
1184
+ }) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
1185
+ readonly type: "runtime.effect.attempt.started";
1186
+ readonly payload: {
1187
+ readonly effectId: string;
1188
+ readonly attempt: number;
1189
+ };
1190
+ }) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
1191
+ readonly type: "runtime.effect.cancel.requested";
1192
+ readonly payload: {
1193
+ readonly effectId: string;
1194
+ readonly attempt: number;
1195
+ readonly deadlineAt: number | null;
1196
+ };
1197
+ }) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
1198
+ readonly type: "runtime.effect.cancelled";
1199
+ readonly payload: {
1200
+ readonly effectId: string;
1201
+ readonly attempt: number;
1202
+ };
1203
+ }) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
1204
+ readonly type: "runtime.effect.completed";
1205
+ readonly payload: {
1206
+ readonly effectId: string;
1207
+ readonly attempt: number;
1208
+ };
1209
+ }) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
1210
+ readonly type: "runtime.effect.dispatched";
1211
+ readonly payload: {
1212
+ readonly effectId: string;
1213
+ readonly attempt: number;
1214
+ readonly deadlineAt: number | null;
1215
+ };
681
1216
  }) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
682
1217
  readonly type: "runtime.effect.failed";
683
1218
  readonly payload: {
684
1219
  readonly effectId: string;
685
1220
  readonly error: string;
686
1221
  };
1222
+ }) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
1223
+ readonly type: "runtime.effect.heartbeat";
1224
+ readonly payload: {
1225
+ readonly effectId: string;
1226
+ readonly attempt: number;
1227
+ readonly heartbeatAt: number;
1228
+ readonly deadlineAt: number | null;
1229
+ };
1230
+ }) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
1231
+ readonly type: "runtime.effect.queued";
1232
+ readonly payload: {
1233
+ readonly effectId: string;
1234
+ readonly attempt: number;
1235
+ readonly deadlineAt: number | null;
1236
+ };
1237
+ }) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
1238
+ readonly type: "runtime.effect.retry.scheduled";
1239
+ readonly payload: {
1240
+ readonly effectId: string;
1241
+ readonly attempt: number;
1242
+ readonly nextAttemptAt: number;
1243
+ readonly error: string;
1244
+ };
1245
+ }) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
1246
+ readonly type: "runtime.effect.timed_out";
1247
+ readonly payload: {
1248
+ readonly effectId: string;
1249
+ readonly attempt: number;
1250
+ readonly timeout: string;
1251
+ };
1252
+ }) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
1253
+ readonly type: "runtime.effect.worker.started";
1254
+ readonly payload: {
1255
+ readonly effectId: string;
1256
+ readonly attempt: number;
1257
+ readonly deadlineAt: number | null;
1258
+ };
1259
+ }) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
1260
+ readonly type: "runtime.run.cancelled";
1261
+ readonly payload: {
1262
+ readonly reason?: string | undefined;
1263
+ };
687
1264
  }) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
688
1265
  readonly type: "runtime.run.completed";
689
1266
  readonly payload: {
@@ -696,7 +1273,9 @@ export declare function agent(options?: AgentModuleOptions): import("@swirls/loo
696
1273
  readonly rootThreadId?: string | undefined;
697
1274
  readonly kind: string;
698
1275
  readonly definitionName: string;
1276
+ readonly definitionVersion: string;
699
1277
  readonly input: import("effect/Schema").Json;
1278
+ readonly requestedThreadId?: string | null | undefined;
700
1279
  };
701
1280
  }) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
702
1281
  readonly type: "runtime.signal.received";
@@ -710,6 +1289,11 @@ export declare function agent(options?: AgentModuleOptions): import("@swirls/loo
710
1289
  readonly stateHash: string;
711
1290
  readonly state?: import("effect/Schema").Json | undefined;
712
1291
  };
1292
+ }) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
1293
+ readonly type: "runtime.thread.cancel.requested";
1294
+ readonly payload: {
1295
+ readonly threadId: string;
1296
+ };
713
1297
  }) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
714
1298
  readonly type: "runtime.thread.cancelled";
715
1299
  readonly payload: {
@@ -734,6 +1318,7 @@ export declare function agent(options?: AgentModuleOptions): import("@swirls/loo
734
1318
  readonly threadId: string;
735
1319
  readonly kind: string;
736
1320
  readonly definitionName: string;
1321
+ readonly definitionVersion: string;
737
1322
  readonly input: import("effect/Schema").Json;
738
1323
  readonly parentThreadId: string | null;
739
1324
  };
@@ -778,6 +1363,7 @@ export declare function agent(options?: AgentModuleOptions): import("@swirls/loo
778
1363
  executeTool: import("@swirls/looms/core").EffectDefinition<{
779
1364
  readonly turn: number;
780
1365
  readonly definitionName?: string | undefined;
1366
+ readonly definitionVersion: string;
781
1367
  readonly toolCall: {
782
1368
  readonly id: string;
783
1369
  readonly name: string;
@@ -787,7 +1373,63 @@ export declare function agent(options?: AgentModuleOptions): import("@swirls/loo
787
1373
  readonly type: "agent.effects.requested";
788
1374
  readonly payload: {
789
1375
  readonly toolCallId: string;
790
- readonly effects: readonly import("@swirls/looms/core").RuntimeEffect[];
1376
+ readonly effects: readonly ({
1377
+ readonly type: "runtime.spawn";
1378
+ readonly childThreadId: string;
1379
+ readonly kind: string;
1380
+ readonly definitionName: string;
1381
+ readonly definitionVersion: string;
1382
+ readonly input: import("effect/Schema").Json;
1383
+ } | {
1384
+ readonly type: "runtime.wait";
1385
+ readonly waitId: string;
1386
+ readonly on: {
1387
+ readonly type: string | readonly string[];
1388
+ readonly match?: import("effect/Schema").Json | undefined;
1389
+ } | {
1390
+ readonly timerAt: number;
1391
+ };
1392
+ readonly tag?: import("effect/Schema").Json | undefined;
1393
+ } | {
1394
+ readonly type: "runtime.emit";
1395
+ readonly event: {
1396
+ readonly type: string;
1397
+ readonly payload: import("effect/Schema").Json;
1398
+ readonly threadId?: string | null | undefined;
1399
+ readonly parentThreadId?: string | null | undefined;
1400
+ readonly causationId?: string | null | undefined;
1401
+ readonly correlationId?: string | null | undefined;
1402
+ readonly effectId?: string | null | undefined;
1403
+ readonly origin?: {
1404
+ readonly type: "thread";
1405
+ readonly threadId: string;
1406
+ } | {
1407
+ readonly type: "external";
1408
+ readonly actorId?: string | undefined;
1409
+ } | {
1410
+ readonly type: "system";
1411
+ } | undefined;
1412
+ readonly ephemeral?: boolean | undefined;
1413
+ readonly id?: string | undefined;
1414
+ readonly ts?: number | undefined;
1415
+ readonly idempotencyKey?: string | null | undefined;
1416
+ };
1417
+ readonly tag?: string | undefined;
1418
+ } | {
1419
+ readonly type: "runtime.complete";
1420
+ readonly output: import("effect/Schema").Json;
1421
+ } | {
1422
+ readonly type: "runtime.fail";
1423
+ readonly error: string;
1424
+ } | {
1425
+ readonly type: "runtime.cancel";
1426
+ readonly threadId: string;
1427
+ readonly tag?: string | undefined;
1428
+ } | {
1429
+ readonly type: string;
1430
+ readonly input: import("effect/Schema").Json;
1431
+ readonly tag?: string | undefined;
1432
+ })[];
791
1433
  readonly waitOn?: {
792
1434
  readonly type: string | readonly string[];
793
1435
  readonly match?: import("effect/Schema").Json | undefined;
@@ -828,12 +1470,43 @@ export declare function agent(options?: AgentModuleOptions): import("@swirls/loo
828
1470
  }[] | undefined;
829
1471
  };
830
1472
  };
1473
+ }) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
1474
+ readonly type: "agent.session.cancel.requested";
1475
+ readonly payload: {};
1476
+ }) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
1477
+ readonly type: "agent.session.message.submitted";
1478
+ readonly payload: {
1479
+ readonly messageId: string;
1480
+ readonly text: string;
1481
+ readonly delivery?: "followUp" | "nextTurn" | "steer" | undefined;
1482
+ readonly activeChildThreadId?: string | undefined;
1483
+ };
1484
+ }) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
1485
+ readonly type: "agent.session.steer.delivered";
1486
+ readonly payload: {
1487
+ readonly messageId: string;
1488
+ readonly activeMessageId: string;
1489
+ };
1490
+ }) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
1491
+ readonly type: "agent.session.turn.closed";
1492
+ readonly payload: {
1493
+ readonly messageId: string;
1494
+ readonly status: "cancelled" | "completed" | "failed";
1495
+ readonly error?: string | undefined;
1496
+ };
1497
+ }) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
1498
+ readonly type: "agent.session.turn.started";
1499
+ readonly payload: {
1500
+ readonly messageId: string;
1501
+ readonly childThreadId: string;
1502
+ };
831
1503
  }) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
832
1504
  readonly type: "agent.spawn.requested";
833
1505
  readonly payload: {
834
1506
  readonly childThreadId: string;
835
1507
  readonly kind: string;
836
1508
  readonly definitionName: string;
1509
+ readonly definitionVersion: string;
837
1510
  readonly toolCallId: string;
838
1511
  readonly input: import("effect/Schema").Json;
839
1512
  };
@@ -841,6 +1514,7 @@ export declare function agent(options?: AgentModuleOptions): import("@swirls/loo
841
1514
  readonly type: "agent.steered";
842
1515
  readonly payload: {
843
1516
  readonly turn: number;
1517
+ readonly messageId?: string | undefined;
844
1518
  readonly message: {
845
1519
  readonly role: "assistant" | "system" | "tool" | "user";
846
1520
  readonly content: string;
@@ -884,12 +1558,93 @@ export declare function agent(options?: AgentModuleOptions): import("@swirls/loo
884
1558
  readonly turn: number;
885
1559
  readonly delta: string;
886
1560
  };
1561
+ }) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
1562
+ readonly type: "runtime.effect.ambiguous";
1563
+ readonly payload: {
1564
+ readonly effectId: string;
1565
+ readonly attempt: number;
1566
+ readonly error: string;
1567
+ };
1568
+ }) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
1569
+ readonly type: "runtime.effect.attempt.started";
1570
+ readonly payload: {
1571
+ readonly effectId: string;
1572
+ readonly attempt: number;
1573
+ };
1574
+ }) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
1575
+ readonly type: "runtime.effect.cancel.requested";
1576
+ readonly payload: {
1577
+ readonly effectId: string;
1578
+ readonly attempt: number;
1579
+ readonly deadlineAt: number | null;
1580
+ };
1581
+ }) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
1582
+ readonly type: "runtime.effect.cancelled";
1583
+ readonly payload: {
1584
+ readonly effectId: string;
1585
+ readonly attempt: number;
1586
+ };
1587
+ }) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
1588
+ readonly type: "runtime.effect.completed";
1589
+ readonly payload: {
1590
+ readonly effectId: string;
1591
+ readonly attempt: number;
1592
+ };
1593
+ }) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
1594
+ readonly type: "runtime.effect.dispatched";
1595
+ readonly payload: {
1596
+ readonly effectId: string;
1597
+ readonly attempt: number;
1598
+ readonly deadlineAt: number | null;
1599
+ };
887
1600
  }) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
888
1601
  readonly type: "runtime.effect.failed";
889
1602
  readonly payload: {
890
1603
  readonly effectId: string;
891
1604
  readonly error: string;
892
1605
  };
1606
+ }) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
1607
+ readonly type: "runtime.effect.heartbeat";
1608
+ readonly payload: {
1609
+ readonly effectId: string;
1610
+ readonly attempt: number;
1611
+ readonly heartbeatAt: number;
1612
+ readonly deadlineAt: number | null;
1613
+ };
1614
+ }) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
1615
+ readonly type: "runtime.effect.queued";
1616
+ readonly payload: {
1617
+ readonly effectId: string;
1618
+ readonly attempt: number;
1619
+ readonly deadlineAt: number | null;
1620
+ };
1621
+ }) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
1622
+ readonly type: "runtime.effect.retry.scheduled";
1623
+ readonly payload: {
1624
+ readonly effectId: string;
1625
+ readonly attempt: number;
1626
+ readonly nextAttemptAt: number;
1627
+ readonly error: string;
1628
+ };
1629
+ }) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
1630
+ readonly type: "runtime.effect.timed_out";
1631
+ readonly payload: {
1632
+ readonly effectId: string;
1633
+ readonly attempt: number;
1634
+ readonly timeout: string;
1635
+ };
1636
+ }) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
1637
+ readonly type: "runtime.effect.worker.started";
1638
+ readonly payload: {
1639
+ readonly effectId: string;
1640
+ readonly attempt: number;
1641
+ readonly deadlineAt: number | null;
1642
+ };
1643
+ }) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
1644
+ readonly type: "runtime.run.cancelled";
1645
+ readonly payload: {
1646
+ readonly reason?: string | undefined;
1647
+ };
893
1648
  }) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
894
1649
  readonly type: "runtime.run.completed";
895
1650
  readonly payload: {
@@ -902,7 +1657,9 @@ export declare function agent(options?: AgentModuleOptions): import("@swirls/loo
902
1657
  readonly rootThreadId?: string | undefined;
903
1658
  readonly kind: string;
904
1659
  readonly definitionName: string;
1660
+ readonly definitionVersion: string;
905
1661
  readonly input: import("effect/Schema").Json;
1662
+ readonly requestedThreadId?: string | null | undefined;
906
1663
  };
907
1664
  }) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
908
1665
  readonly type: "runtime.signal.received";
@@ -916,6 +1673,11 @@ export declare function agent(options?: AgentModuleOptions): import("@swirls/loo
916
1673
  readonly stateHash: string;
917
1674
  readonly state?: import("effect/Schema").Json | undefined;
918
1675
  };
1676
+ }) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
1677
+ readonly type: "runtime.thread.cancel.requested";
1678
+ readonly payload: {
1679
+ readonly threadId: string;
1680
+ };
919
1681
  }) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
920
1682
  readonly type: "runtime.thread.cancelled";
921
1683
  readonly payload: {
@@ -940,6 +1702,7 @@ export declare function agent(options?: AgentModuleOptions): import("@swirls/loo
940
1702
  readonly threadId: string;
941
1703
  readonly kind: string;
942
1704
  readonly definitionName: string;
1705
+ readonly definitionVersion: string;
943
1706
  readonly input: import("effect/Schema").Json;
944
1707
  readonly parentThreadId: string | null;
945
1708
  };
@@ -983,37 +1746,8 @@ export declare function agent(options?: AgentModuleOptions): import("@swirls/loo
983
1746
  })>;
984
1747
  };
985
1748
  readonly threads: {
986
- agent: import("@swirls/looms/core").ThreadDefinition<{
987
- definitionName?: string;
988
- lines: import("./types").Message[];
989
- pendingToolCalls: import("./types").ToolCall[];
990
- executingToolCalls: import("./types").ToolCall[];
991
- needsLlmCall: boolean;
992
- turn: number;
993
- maxTurns: number;
994
- pendingSteer: import("./types").Message | null;
995
- input: import("@swirls/looms/core").JsonValue;
996
- output: import("@swirls/looms/core").JsonValue | null;
997
- pendingEffectTools: {
998
- [causingSeq: string]: import("./types").PendingEffectTool;
999
- };
1000
- pendingSpawns: import("./types").AgentPendingSpawn[];
1001
- pendingEffects: import("./types").AgentPendingEffects[];
1002
- pendingEmits: (import("./types").AgentPendingEmit | {
1003
- id: string;
1004
- event: {
1005
- type: string;
1006
- payload: {
1007
- turn: number;
1008
- toolCallId: string;
1009
- name: string;
1010
- result: string | number | boolean | import("effect/Schema").JsonArray | import("effect/Schema").JsonObject | null;
1011
- error: string | null;
1012
- };
1013
- threadId: string;
1014
- };
1015
- })[];
1016
- }>;
1749
+ agent: import("@swirls/looms/core").ThreadDefinition<import("./types").AgentState>;
1750
+ 'agent-session': import("@swirls/looms/core").ThreadDefinition<import("./types").AgentSessionState>;
1017
1751
  };
1018
1752
  readonly projections: {
1019
1753
  conversation: import("@swirls/looms/core").ProjectionDefinition<{