eve 0.47.7 → 0.49.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 (429) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/dist/src/channel/channel-address.js +1 -1
  3. package/dist/src/channel/delivery-metadata.d.ts +1 -0
  4. package/dist/src/channel/delivery-metadata.js +1 -1
  5. package/dist/src/channel/types.d.ts +20 -8
  6. package/dist/src/chunks/{use-eve-agent-Dg5S44kG.js → use-eve-agent-BZnOzAVd.js} +25 -5
  7. package/dist/src/chunks/{use-eve-agent-B5zw1dwj.js → use-eve-agent-Bgp6INfi.js} +25 -5
  8. package/dist/src/cli/commands/init.js +1 -1
  9. package/dist/src/cli/commands/integration-connect.d.ts +2 -1
  10. package/dist/src/cli/commands/integration-connect.js +1 -1
  11. package/dist/src/cli/commands/register-integration-commands.d.ts +3 -1
  12. package/dist/src/cli/commands/register-integration-commands.js +1 -1
  13. package/dist/src/cli/commands/registry-metadata.d.ts +30 -0
  14. package/dist/src/cli/commands/registry-metadata.js +1 -1
  15. package/dist/src/cli/commands/registry-package.d.ts +6 -0
  16. package/dist/src/cli/commands/registry-package.js +1 -1
  17. package/dist/src/cli/commands/registry-pnpm-build-policy-flow.d.ts +30 -0
  18. package/dist/src/cli/commands/registry-pnpm-build-policy-flow.js +1 -0
  19. package/dist/src/cli/commands/registry-pnpm-build-policy.d.ts +12 -0
  20. package/dist/src/cli/commands/registry-pnpm-build-policy.js +6 -0
  21. package/dist/src/cli/commands/registry-recovery.d.ts +4 -0
  22. package/dist/src/cli/commands/registry-recovery.js +1 -1
  23. package/dist/src/cli/commands/registry.d.ts +1 -1
  24. package/dist/src/cli/commands/registry.js +1 -1
  25. package/dist/src/cli/dev/command-options.d.ts +2 -0
  26. package/dist/src/cli/dev/run-interactive-ui.js +1 -1
  27. package/dist/src/cli/dev/tui/blocks.js +1 -1
  28. package/dist/src/cli/dev/tui/prompt-command-handler.js +1 -1
  29. package/dist/src/cli/dev/tui/registry-result-message.d.ts +17 -0
  30. package/dist/src/cli/dev/tui/registry-result-message.js +3 -0
  31. package/dist/src/cli/dev/tui/runner.d.ts +11 -4
  32. package/dist/src/cli/dev/tui/runner.js +1 -1
  33. package/dist/src/cli/dev/tui/setup-commands.d.ts +9 -3
  34. package/dist/src/cli/dev/tui/setup-commands.js +2 -3
  35. package/dist/src/cli/dev/tui/setup-flow.d.ts +15 -5
  36. package/dist/src/cli/dev/tui/setup-panel.d.ts +6 -1
  37. package/dist/src/cli/dev/tui/setup-panel.js +4 -4
  38. package/dist/src/cli/dev/tui/setup-selection-input.d.ts +1 -0
  39. package/dist/src/cli/dev/tui/setup-selection-input.js +1 -1
  40. package/dist/src/cli/dev/tui/terminal-renderer.js +12 -12
  41. package/dist/src/cli/dev/tui/tui-prompter.js +1 -1
  42. package/dist/src/cli/dev/tui/tui.d.ts +3 -4
  43. package/dist/src/cli/dev/tui/tui.js +1 -1
  44. package/dist/src/cli/run.js +2 -2
  45. package/dist/src/client/agent-info-schema.d.ts +1 -0
  46. package/dist/src/client/agent-info-schema.js +1 -1
  47. package/dist/src/client/open-stream.d.ts +1 -0
  48. package/dist/src/client/open-stream.js +1 -1
  49. package/dist/src/client/session.js +1 -1
  50. package/dist/src/compiled/.vendor-stamp.json +7 -6
  51. package/dist/src/compiled/@opentelemetry/api/index.d.ts +6 -0
  52. package/dist/src/compiled/@workflow/builders/LICENSE.md +201 -0
  53. package/dist/src/compiled/@workflow/builders/index.d.ts +62 -0
  54. package/dist/src/compiled/@workflow/builders/index.js +1 -0
  55. package/dist/src/compiled/@workflow/core/attribute-changes.d.ts +2 -4
  56. package/dist/src/compiled/@workflow/core/capabilities.d.ts +10 -9
  57. package/dist/src/compiled/@workflow/core/capture-stack.d.ts +1 -1
  58. package/dist/src/compiled/@workflow/core/class-serialization.d.ts +8 -8
  59. package/dist/src/compiled/@workflow/core/context-violation-error.d.ts +5 -5
  60. package/dist/src/compiled/@workflow/core/create-hook.d.ts +2 -2
  61. package/dist/src/compiled/@workflow/core/describe-error.d.ts +7 -7
  62. package/dist/src/compiled/@workflow/core/encryption.d.ts +5 -5
  63. package/dist/src/compiled/@workflow/core/events-consumer.d.ts +49 -14
  64. package/dist/src/compiled/@workflow/core/flushable-stream.d.ts +4 -4
  65. package/dist/src/compiled/@workflow/core/global.d.ts +4 -2
  66. package/dist/src/compiled/@workflow/core/index.d.ts +1 -1
  67. package/dist/src/compiled/@workflow/core/index.js +2 -2
  68. package/dist/src/compiled/@workflow/core/log-format.d.ts +2 -2
  69. package/dist/src/compiled/@workflow/core/private.d.ts +40 -78
  70. package/dist/src/compiled/@workflow/core/private.js +1 -1
  71. package/dist/src/compiled/@workflow/core/replay-payload-cache.d.ts +13 -17
  72. package/dist/src/compiled/@workflow/core/runtime/compute-instance.d.ts +4 -3
  73. package/dist/src/compiled/@workflow/core/runtime/constants.d.ts +27 -27
  74. package/dist/src/compiled/@workflow/core/runtime/count-step-started-events.d.ts +7 -7
  75. package/dist/src/compiled/@workflow/core/runtime/deployment-guard.d.ts +7 -7
  76. package/dist/src/compiled/@workflow/core/runtime/get-port-lazy.d.ts +2 -2
  77. package/dist/src/compiled/@workflow/core/runtime/get-world-lazy.d.ts +2 -2
  78. package/dist/src/compiled/@workflow/core/runtime/helpers.d.ts +30 -49
  79. package/dist/src/compiled/@workflow/core/runtime/quickjs-entrypoint.d.ts +21 -10
  80. package/dist/src/compiled/@workflow/core/runtime/quickjs-runtime.d.ts +31 -15
  81. package/dist/src/compiled/@workflow/core/runtime/quickjs-serde.d.ts +10 -10
  82. package/dist/src/compiled/@workflow/core/runtime/replay-budget.d.ts +4 -4
  83. package/dist/src/compiled/@workflow/core/runtime/replay-recovery-reporter.d.ts +1 -1
  84. package/dist/src/compiled/@workflow/core/runtime/resume-hook.d.ts +20 -12
  85. package/dist/src/compiled/@workflow/core/runtime/resume-latency.d.ts +37 -30
  86. package/dist/src/compiled/@workflow/core/runtime/run-id-time.d.ts +2 -2
  87. package/dist/src/compiled/@workflow/core/runtime/run.d.ts +22 -5
  88. package/dist/src/compiled/@workflow/core/runtime/runs.d.ts +4 -4
  89. package/dist/src/compiled/@workflow/core/runtime/start.d.ts +3 -3
  90. package/dist/src/compiled/@workflow/core/runtime/step-executor.d.ts +14 -14
  91. package/dist/src/compiled/@workflow/core/runtime/step-latency.d.ts +42 -25
  92. package/dist/src/compiled/@workflow/core/runtime/step-ownership.d.ts +6 -6
  93. package/dist/src/compiled/@workflow/core/runtime/step-single-flight.d.ts +1 -1
  94. package/dist/src/compiled/@workflow/core/runtime/suspension-handler.d.ts +38 -24
  95. package/dist/src/compiled/@workflow/core/runtime/unserializable-step.d.ts +34 -0
  96. package/dist/src/compiled/@workflow/core/runtime/vm-mode.d.ts +2 -2
  97. package/dist/src/compiled/@workflow/core/runtime/wait-continuation.d.ts +31 -9
  98. package/dist/src/compiled/@workflow/core/runtime/wait-until.d.ts +1 -1
  99. package/dist/src/compiled/@workflow/core/runtime/world-compatibility.d.ts +20 -9
  100. package/dist/src/compiled/@workflow/core/runtime/world-init.d.ts +5 -5
  101. package/dist/src/compiled/@workflow/core/runtime.js +3 -3
  102. package/dist/src/compiled/@workflow/core/sealed-box.d.ts +7 -7
  103. package/dist/src/compiled/@workflow/core/serialization/codec-devalue-vm.d.ts +1 -1
  104. package/dist/src/compiled/@workflow/core/serialization/codec-devalue.d.ts +1 -1
  105. package/dist/src/compiled/@workflow/core/serialization/codec.d.ts +4 -4
  106. package/dist/src/compiled/@workflow/core/serialization/compression.d.ts +12 -11
  107. package/dist/src/compiled/@workflow/core/serialization/encryption.d.ts +7 -7
  108. package/dist/src/compiled/@workflow/core/serialization/format.d.ts +6 -6
  109. package/dist/src/compiled/@workflow/core/serialization/hardened.d.ts +23 -22
  110. package/dist/src/compiled/@workflow/core/serialization/index.d.ts +1 -1
  111. package/dist/src/compiled/@workflow/core/serialization/reducers/class-vm.d.ts +1 -1
  112. package/dist/src/compiled/@workflow/core/serialization/reducers/step-function-vm.d.ts +1 -1
  113. package/dist/src/compiled/@workflow/core/serialization/types.d.ts +5 -5
  114. package/dist/src/compiled/@workflow/core/serialization/workflow-vm.d.ts +1 -1
  115. package/dist/src/compiled/@workflow/core/serialization-format.d.ts +11 -11
  116. package/dist/src/compiled/@workflow/core/serialization.d.ts +18 -19
  117. package/dist/src/compiled/@workflow/core/source-map.d.ts +1 -1
  118. package/dist/src/compiled/@workflow/core/step/context-storage.d.ts +5 -5
  119. package/dist/src/compiled/@workflow/core/step/writable-stream.d.ts +3 -3
  120. package/dist/src/compiled/@workflow/core/symbols.d.ts +2 -2
  121. package/dist/src/compiled/@workflow/core/telemetry/semantic-conventions.d.ts +71 -20
  122. package/dist/src/compiled/@workflow/core/telemetry.d.ts +15 -3
  123. package/dist/src/compiled/@workflow/core/version.d.ts +1 -1
  124. package/dist/src/compiled/@workflow/core/vm/script-cache.d.ts +9 -11
  125. package/dist/src/compiled/@workflow/core/workflow/abort-controller.d.ts +1 -1
  126. package/dist/src/compiled/@workflow/core/workflow/set-attributes.d.ts +1 -1
  127. package/dist/src/compiled/@workflow/core/workflow/world-init-stub.d.ts +1 -1
  128. package/dist/src/compiled/@workflow/core/workflow.js +1 -1
  129. package/dist/src/compiled/@workflow/errors/index.d.ts +18 -18
  130. package/dist/src/compiled/@workflow/errors/index.js +1 -1
  131. package/dist/src/compiled/@workflow/world/analytics.d.ts +3 -2
  132. package/dist/src/compiled/@workflow/world/attributes-validation.d.ts +28 -0
  133. package/dist/src/compiled/@workflow/world/attributes.d.ts +8 -107
  134. package/dist/src/compiled/@workflow/world/env-config.d.ts +5 -5
  135. package/dist/src/compiled/@workflow/world/event-metadata.d.ts +132 -0
  136. package/dist/src/compiled/@workflow/world/events.d.ts +42 -96
  137. package/dist/src/compiled/@workflow/world/hooks.d.ts +12 -11
  138. package/dist/src/compiled/@workflow/world/index.d.ts +3 -3
  139. package/dist/src/compiled/@workflow/world/interfaces.d.ts +94 -39
  140. package/dist/src/compiled/@workflow/world/queue.d.ts +29 -22
  141. package/dist/src/compiled/@workflow/world/runs.d.ts +20 -0
  142. package/dist/src/compiled/@workflow/world/slot-identity.d.ts +3 -3
  143. package/dist/src/compiled/@workflow/world/spec-version.d.ts +82 -15
  144. package/dist/src/compiled/@workflow/world/ulid.d.ts +2 -2
  145. package/dist/src/compiled/@workflow/world-local/index.js +5 -5
  146. package/dist/src/compiled/@workflow/world-vercel/index.js +12 -12
  147. package/dist/src/compiled/_chunks/workflow/{attribute-changes-DXbpwBdw.js → attribute-changes-BwAadFfB.js} +3 -3
  148. package/dist/src/compiled/_chunks/workflow/debug-log-CVPstO1D.js +1 -0
  149. package/dist/src/compiled/_chunks/workflow/dist-CgbVZs5l.js +40 -0
  150. package/dist/src/compiled/_chunks/workflow/dist-DjojkP5e.js +3 -0
  151. package/dist/src/compiled/_chunks/workflow/frames-CZ9eHShe.js +3 -0
  152. package/dist/src/compiled/_chunks/workflow/global-singleton-BNinwFrL.js +1 -0
  153. package/dist/src/compiled/_chunks/workflow/private-CZFMABEf.js +1 -0
  154. package/dist/src/compiled/_chunks/workflow/resume-hook-BToMtPbH.js +1 -0
  155. package/dist/src/compiled/_chunks/workflow/run-DzyAoGh4.js +1 -0
  156. package/dist/src/compiled/_chunks/workflow/sleep-3_A5uOp-.js +1 -0
  157. package/dist/src/compiled/_chunks/workflow/undici-DfxNX5og.js +95 -0
  158. package/dist/src/compiled/_chunks/workflow/wait-until-BtySPYD0.js +15 -0
  159. package/dist/src/compiled/_chunks/workflow/ws-transport-PnVVxT0R.js +1 -0
  160. package/dist/src/compiler/extension-compatibility.d.ts +2 -2
  161. package/dist/src/compiler/extension-compatibility.js +1 -1
  162. package/dist/src/compiler/manifest.d.ts +2 -2
  163. package/dist/src/compiler/manifest.js +1 -1
  164. package/dist/src/compiler/normalize-tool.js +1 -1
  165. package/dist/src/context/keys.d.ts +3 -8
  166. package/dist/src/eve-channel/index.js +1 -1
  167. package/dist/src/eve-channel/types.d.ts +7 -7
  168. package/dist/src/execution/accepted-delivery-deployment.d.ts +7 -0
  169. package/dist/src/execution/accepted-delivery-deployment.js +1 -0
  170. package/dist/src/execution/agent-handle-dispatch.js +1 -1
  171. package/dist/src/execution/cancel-descendant-turns-step.d.ts +4 -1
  172. package/dist/src/execution/cancel-descendant-turns-step.js +1 -1
  173. package/dist/src/execution/continuation-conflict-step.d.ts +10 -0
  174. package/dist/src/execution/continuation-conflict-step.js +1 -0
  175. package/dist/src/execution/delegated-parent-notification.js +1 -1
  176. package/dist/src/execution/delegation-tool.js +1 -1
  177. package/dist/src/execution/dispatch-runtime-actions-shared.d.ts +14 -31
  178. package/dist/src/execution/dispatch-runtime-actions-shared.js +1 -1
  179. package/dist/src/execution/dispatch-runtime-actions-start.d.ts +33 -0
  180. package/dist/src/execution/dispatch-runtime-actions-start.js +1 -0
  181. package/dist/src/execution/dispatch-runtime-actions-step.js +1 -1
  182. package/dist/src/execution/dispatch-turn-step.js +1 -1
  183. package/dist/src/execution/durable-session-migrations/turn-workflow-v1-to-v2.d.ts +2 -0
  184. package/dist/src/execution/durable-session-migrations/turn-workflow-v1-to-v2.js +1 -0
  185. package/dist/src/execution/durable-session-migrations/turn-workflow.d.ts +25 -3
  186. package/dist/src/execution/durable-session-migrations/turn-workflow.js +1 -1
  187. package/dist/src/execution/dynamic-connections.js +1 -1
  188. package/dist/src/execution/eve-workflow-attributes.js +1 -1
  189. package/dist/src/execution/finalize-terminal-session.d.ts +17 -0
  190. package/dist/src/execution/finalize-terminal-session.js +1 -0
  191. package/dist/src/execution/inline-turn.d.ts +29 -0
  192. package/dist/src/execution/inline-turn.js +1 -0
  193. package/dist/src/execution/next-driver-action.d.ts +9 -4
  194. package/dist/src/execution/node-step.js +1 -1
  195. package/dist/src/execution/parked-delivery-wait.js +1 -1
  196. package/dist/src/execution/pending-turn-state.d.ts +1 -0
  197. package/dist/src/execution/pending-turn-state.js +1 -1
  198. package/dist/src/execution/proxied-deliver-step.js +1 -1
  199. package/dist/src/execution/remote-agent-dispatch.d.ts +2 -0
  200. package/dist/src/execution/remote-agent-dispatch.js +1 -1
  201. package/dist/src/execution/runtime-errors.d.ts +0 -12
  202. package/dist/src/execution/runtime-errors.js +1 -1
  203. package/dist/src/execution/session-command-token.d.ts +2 -0
  204. package/dist/src/execution/session-command-token.js +1 -1
  205. package/dist/src/execution/session-timeout-steps.js +1 -1
  206. package/dist/src/execution/settle-cancelled-turn-step.js +1 -1
  207. package/dist/src/execution/stable-workflow-names.d.ts +12 -0
  208. package/dist/src/execution/stable-workflow-names.js +1 -0
  209. package/dist/src/execution/subagent-event-proxy-step.d.ts +3 -0
  210. package/dist/src/execution/subagent-event-proxy-step.js +1 -1
  211. package/dist/src/execution/subagent-hitl-proxy.d.ts +2 -1
  212. package/dist/src/execution/subagent-hitl-proxy.js +1 -1
  213. package/dist/src/execution/subagent-start-local.js +1 -1
  214. package/dist/src/execution/subagent-start-remote.d.ts +2 -0
  215. package/dist/src/execution/subagent-start-remote.js +1 -1
  216. package/dist/src/execution/tasks/child/steps.d.ts +2 -0
  217. package/dist/src/execution/tasks/child/steps.js +1 -1
  218. package/dist/src/execution/tasks/child/workflow.js +1 -1
  219. package/dist/src/execution/tasks/parent/dispatch-task-step.js +1 -1
  220. package/dist/src/execution/tasks/parent/dispatch.js +1 -1
  221. package/dist/src/execution/tasks/parent/hitl-proxy-steps.js +1 -1
  222. package/dist/src/execution/tasks/parent/run-parent.js +1 -1
  223. package/dist/src/execution/tasks/parent/tool-execution.js +1 -1
  224. package/dist/src/execution/terminal-session-completion-step.js +1 -1
  225. package/dist/src/execution/terminal-session-event.d.ts +13 -0
  226. package/dist/src/execution/terminal-session-event.js +1 -0
  227. package/dist/src/execution/terminal-session-failure-step.d.ts +1 -0
  228. package/dist/src/execution/terminal-session-failure-step.js +1 -1
  229. package/dist/src/execution/tool-run/answer.d.ts +3 -0
  230. package/dist/src/execution/tool-run/answer.js +1 -0
  231. package/dist/src/execution/tool-run/background.d.ts +14 -0
  232. package/dist/src/execution/tool-run/background.js +1 -0
  233. package/dist/src/execution/tool-run/cancel.d.ts +7 -0
  234. package/dist/src/execution/tool-run/cancel.js +1 -0
  235. package/dist/src/execution/tool-run/dispatch.d.ts +24 -0
  236. package/dist/src/execution/tool-run/dispatch.js +1 -0
  237. package/dist/src/execution/tool-run/emit-run-report-step.d.ts +7 -0
  238. package/dist/src/execution/tool-run/emit-run-report-step.js +1 -0
  239. package/dist/src/execution/tool-run/messages.d.ts +70 -0
  240. package/dist/src/execution/tool-run/messages.js +1 -0
  241. package/dist/src/execution/tool-run/owner-channels.d.ts +29 -0
  242. package/dist/src/execution/tool-run/owner-channels.js +1 -0
  243. package/dist/src/execution/tool-run/owner-inbox.d.ts +11 -0
  244. package/dist/src/execution/tool-run/owner-inbox.js +1 -0
  245. package/dist/src/execution/tool-run/owner.d.ts +13 -0
  246. package/dist/src/execution/tool-run/owner.js +1 -0
  247. package/dist/src/execution/tool-run/resume-hook-step.d.ts +4 -0
  248. package/dist/src/execution/tool-run/resume-hook-step.js +1 -0
  249. package/dist/src/execution/tool-run/run-control.d.ts +18 -0
  250. package/dist/src/execution/tool-run/run-control.js +1 -0
  251. package/dist/src/execution/tool-run/start.d.ts +11 -0
  252. package/dist/src/execution/tool-run/start.js +1 -0
  253. package/dist/src/execution/tool-run/types.d.ts +21 -0
  254. package/dist/src/execution/tool-run/types.js +1 -0
  255. package/dist/src/execution/tool-run/workflow.d.ts +9 -0
  256. package/dist/src/execution/tool-run/workflow.js +1 -0
  257. package/dist/src/execution/tools/subagent/local.js +1 -1
  258. package/dist/src/execution/turn-cancellation-control.d.ts +2 -0
  259. package/dist/src/execution/turn-cancellation-control.js +1 -1
  260. package/dist/src/execution/turn-control-receiver.js +1 -1
  261. package/dist/src/execution/turn-dispatch.d.ts +4 -2
  262. package/dist/src/execution/turn-dispatch.js +1 -1
  263. package/dist/src/execution/turn-execution-cursor.js +1 -1
  264. package/dist/src/execution/turn-workflow.js +1 -1
  265. package/dist/src/execution/wire/session-inbox-contract.d.ts +2 -2
  266. package/dist/src/execution/wire/session-inbox-contract.js +1 -1
  267. package/dist/src/execution/wire/session-inbox-encoder.d.ts +6 -2
  268. package/dist/src/execution/wire/session-inbox-encoder.js +1 -1
  269. package/dist/src/execution/wire/session-inbox-resume.js +1 -1
  270. package/dist/src/execution/wire/session-inbox-wire.js +1 -1
  271. package/dist/src/execution/wire/session-inbox-wire.v1.js +1 -1
  272. package/dist/src/execution/wire/session-inbox-wire.v2-migration.d.ts +0 -2
  273. package/dist/src/execution/wire/session-inbox-wire.v2-migration.js +1 -1
  274. package/dist/src/execution/wire/session-inbox-wire.v2.migration.d.ts +3 -0
  275. package/dist/src/execution/wire/session-inbox-wire.v2.migration.js +1 -0
  276. package/dist/src/execution/wire/session-inbox-wire.v3.d.ts +480 -0
  277. package/dist/src/execution/wire/session-inbox-wire.v3.js +1 -0
  278. package/dist/src/execution/wire/session-inbox-wire.v3.migration.d.ts +3 -0
  279. package/dist/src/execution/wire/session-inbox-wire.v3.migration.js +1 -0
  280. package/dist/src/execution/workflow-entry-finalization.js +1 -1
  281. package/dist/src/execution/workflow-entry.d.ts +5 -1
  282. package/dist/src/execution/workflow-entry.js +1 -1
  283. package/dist/src/execution/workflow-registry.d.ts +5 -0
  284. package/dist/src/execution/workflow-registry.js +1 -0
  285. package/dist/src/execution/workflow-runtime.d.ts +17 -19
  286. package/dist/src/execution/workflow-runtime.js +1 -1
  287. package/dist/src/execution/workflow-steps.js +1 -1
  288. package/dist/src/execution/workflow-webhook-route.d.ts +4 -0
  289. package/dist/src/execution/workflow-webhook-route.js +1 -0
  290. package/dist/src/harness/attachment-staging.js +1 -1
  291. package/dist/src/harness/emission.js +1 -1
  292. package/dist/src/harness/proxy-input-requests.d.ts +10 -0
  293. package/dist/src/harness/proxy-input-requests.js +1 -1
  294. package/dist/src/harness/runtime-actions.d.ts +2 -0
  295. package/dist/src/harness/runtime-actions.js +1 -1
  296. package/dist/src/harness/session-limit-enforcement.js +1 -1
  297. package/dist/src/harness/tool-loop.js +2 -2
  298. package/dist/src/harness/tool-runs.d.ts +21 -0
  299. package/dist/src/harness/tool-runs.js +1 -0
  300. package/dist/src/harness/tools.js +1 -1
  301. package/dist/src/instrumentation/content-policy.d.ts +3 -1
  302. package/dist/src/instrumentation/content-policy.js +1 -1
  303. package/dist/src/instrumentation/runtime.d.ts +2 -2
  304. package/dist/src/instrumentation/runtime.js +1 -1
  305. package/dist/src/internal/application/package.js +1 -1
  306. package/dist/src/internal/attachments/errors.d.ts +3 -0
  307. package/dist/src/internal/authored-module-loader.d.ts +7 -1
  308. package/dist/src/internal/authored-module-loader.js +3 -3
  309. package/dist/src/internal/authored-package-boundary.js +1 -1
  310. package/dist/src/internal/authored-runtime-modules.d.ts +2 -0
  311. package/dist/src/internal/authored-runtime-modules.js +1 -1
  312. package/dist/src/internal/nitro/development-generation.d.ts +2 -0
  313. package/dist/src/internal/nitro/development-generation.js +1 -1
  314. package/dist/src/internal/nitro/host/create-application-nitro.js +1 -1
  315. package/dist/src/internal/nitro/host/dev-host-fingerprint.js +1 -1
  316. package/dist/src/internal/nitro/routes/agent-info/build-agent-info-response.js +1 -1
  317. package/dist/src/internal/nitro/routes/channel-dispatch.js +1 -1
  318. package/dist/src/internal/workflow/development-world-client.js +1 -1
  319. package/dist/src/internal/workflow-bundle/authored-workflow-directives.d.ts +17 -0
  320. package/dist/src/internal/workflow-bundle/authored-workflow-directives.js +1 -0
  321. package/dist/src/internal/workflow-bundle/authored-workflow-modules.d.ts +19 -0
  322. package/dist/src/internal/workflow-bundle/authored-workflow-modules.js +1 -0
  323. package/dist/src/internal/workflow-bundle/builder-support.d.ts +17 -2
  324. package/dist/src/internal/workflow-bundle/builder-support.js +4 -3
  325. package/dist/src/internal/workflow-bundle/builder.d.ts +2 -2
  326. package/dist/src/internal/workflow-bundle/builder.js +2 -2
  327. package/dist/src/internal/workflow-bundle/dynamic-capability-transform-plugin.d.ts +2 -0
  328. package/dist/src/internal/workflow-bundle/dynamic-capability-transform-plugin.js +1 -1
  329. package/dist/src/internal/workflow-bundle/dynamic-tool-ast-references.d.ts +3 -0
  330. package/dist/src/internal/workflow-bundle/dynamic-tool-transform.d.ts +1 -1
  331. package/dist/src/internal/workflow-bundle/dynamic-tool-transform.js +1 -1
  332. package/dist/src/internal/workflow-bundle/workflow-builders.d.ts +6 -2
  333. package/dist/src/internal/workflow-bundle/workflow-builders.js +1 -1
  334. package/dist/src/internal/workflow-bundle/workflow-core-shim.d.ts +3 -0
  335. package/dist/src/internal/workflow-bundle/workflow-core-shim.js +1 -1
  336. package/dist/src/internal/workflow-bundle/workflow-directive-ast.d.ts +7 -0
  337. package/dist/src/internal/workflow-bundle/workflow-directive-ast.js +1 -0
  338. package/dist/src/internal/workflow-bundle/workflow-transformer.d.ts +15 -1
  339. package/dist/src/internal/workflow-bundle/workflow-transformer.js +4 -4
  340. package/dist/src/packages/eve-catalog/src/index.js +1 -1
  341. package/dist/src/protocol/baggage.d.ts +6 -0
  342. package/dist/src/protocol/baggage.js +1 -0
  343. package/dist/src/public/channels/slack/attachments.js +1 -1
  344. package/dist/src/public/channels/slack/slackChannel.d.ts +7 -1
  345. package/dist/src/public/channels/slack/slackChannel.js +1 -1
  346. package/dist/src/public/channels/teams/attachments.d.ts +2 -2
  347. package/dist/src/public/channels/teams/attachments.js +1 -1
  348. package/dist/src/public/channels/teams/teamsChannel.js +1 -1
  349. package/dist/src/public/channels/telegram/attachments.js +1 -1
  350. package/dist/src/public/definitions/remote-agent.d.ts +6 -3
  351. package/dist/src/public/workflow/index.d.ts +3 -0
  352. package/dist/src/public/workflow/index.js +1 -0
  353. package/dist/src/public/workflow-modules.d.js +1 -0
  354. package/dist/src/public/workflow-modules.d.ts +11 -0
  355. package/dist/src/runtime/actions/keys.js +1 -1
  356. package/dist/src/runtime/tools/registry.js +1 -1
  357. package/dist/src/setup/connection-connector.d.ts +4 -2
  358. package/dist/src/setup/connection-connector.js +2 -2
  359. package/dist/src/setup/flows/login.js +1 -1
  360. package/dist/src/setup/flows/model.js +1 -1
  361. package/dist/src/setup/flows/provider.d.ts +5 -0
  362. package/dist/src/setup/flows/provider.js +4 -4
  363. package/dist/src/setup/flows/registry-session.d.ts +24 -7
  364. package/dist/src/setup/flows/registry-session.js +1 -1
  365. package/dist/src/setup/flows/registry.d.ts +35 -29
  366. package/dist/src/setup/flows/registry.js +2 -1
  367. package/dist/src/setup/integrations/web/setup.d.ts +0 -2
  368. package/dist/src/setup/integrations/web/setup.js +1 -1
  369. package/dist/src/setup/prompter.d.ts +24 -4
  370. package/dist/src/setup/prompter.js +1 -1
  371. package/dist/src/setup/scaffold/connections/catalog.js +1 -1
  372. package/dist/src/setup/scaffold/create/project.js +2 -2
  373. package/dist/src/setup/vercel-project.js +0 -0
  374. package/dist/src/shared/dispatch-action.d.ts +6 -0
  375. package/dist/src/shared/forwarded-trace-policy.d.ts +28 -0
  376. package/dist/src/shared/forwarded-trace-policy.js +1 -0
  377. package/dist/src/shared/instrumentation-decision.d.ts +3 -0
  378. package/dist/src/shared/instrumentation-decision.js +1 -1
  379. package/dist/src/svelte/index.js +1 -1
  380. package/dist/src/svelte/use-eve-agent.js +1 -1
  381. package/dist/src/tools/behavior.d.ts +6 -0
  382. package/dist/src/tools/definition.d.ts +39 -3
  383. package/dist/src/tracing/agent-otel-provider.js +2 -2
  384. package/dist/src/tracing/agent-otel-session-context.js +1 -1
  385. package/dist/src/tracing/agent-trace-context-store.d.ts +1 -1
  386. package/dist/src/tracing/agent-trace-context-store.js +1 -1
  387. package/dist/src/tracing/otel-declaration.d.ts +5 -3
  388. package/dist/src/tracing/otel-registration.d.ts +1 -1
  389. package/dist/src/tracing/otel-registration.js +1 -1
  390. package/dist/src/vue/index.js +1 -1
  391. package/dist/src/vue/use-eve-agent.js +1 -1
  392. package/docs/channels/custom.mdx +6 -0
  393. package/docs/channels/eve.mdx +14 -6
  394. package/docs/channels/mcp.mdx +4 -1
  395. package/docs/channels/teams.mdx +6 -1
  396. package/docs/concepts/sessions-runs-and-streaming.md +4 -2
  397. package/docs/guides/auth-and-route-protection.md +5 -1
  398. package/docs/guides/client/messages.mdx +6 -0
  399. package/docs/guides/dev-tui.md +30 -18
  400. package/docs/guides/instrumentation.md +1 -1
  401. package/docs/guides/remote-agents.md +25 -0
  402. package/docs/install-integrations.mdx +2 -0
  403. package/docs/instructions.mdx +1 -1
  404. package/docs/memory/custom-provider.md +214 -0
  405. package/docs/memory/file.md +129 -0
  406. package/docs/memory/meta.json +5 -0
  407. package/docs/memory/overview.mdx +282 -0
  408. package/docs/patterns/multi-tenant-memory.md +12 -20
  409. package/docs/reference/cli.md +2 -2
  410. package/docs/tools/meta.json +1 -1
  411. package/docs/tools/overview.mdx +7 -0
  412. package/docs/tools/workflows.mdx +288 -0
  413. package/package.json +18 -7
  414. package/dist/src/compiled/_chunks/workflow/dist-CqvWKNQv.js +0 -3
  415. package/dist/src/compiled/_chunks/workflow/dist-Dk0aQqFO.js +0 -40
  416. package/dist/src/compiled/_chunks/workflow/dist-DpYyXbJv.js +0 -1
  417. package/dist/src/compiled/_chunks/workflow/env-config-L94XftKz.js +0 -1
  418. package/dist/src/compiled/_chunks/workflow/frames-Dl2Hcma4.js +0 -3
  419. package/dist/src/compiled/_chunks/workflow/private-CuQ4HTFC.js +0 -1
  420. package/dist/src/compiled/_chunks/workflow/resume-hook-E-Nkx8q_.js +0 -1
  421. package/dist/src/compiled/_chunks/workflow/run-cIeex2KF.js +0 -1
  422. package/dist/src/compiled/_chunks/workflow/sleep-CxFsdxB_.js +0 -1
  423. package/dist/src/compiled/_chunks/workflow/spec-version-DBUVfF_R.js +0 -1
  424. package/dist/src/compiled/_chunks/workflow/undici-DznrXKcM.js +0 -95
  425. package/dist/src/compiled/_chunks/workflow/wait-until-BZHmJCAW.js +0 -15
  426. package/dist/src/compiled/_chunks/workflow/ws-transport-Ct6yyRWZ.js +0 -1
  427. package/dist/src/internal/authored-directive-prologue.d.ts +0 -4
  428. package/dist/src/internal/authored-directive-prologue.js +0 -1
  429. package/docs/memory.md +0 -408
@@ -4,7 +4,9 @@ import type { StartedWorkflowRun, WorkflowRun } from './runs.js';
4
4
  import type { PaginationOptions, ResolveData } from './shared.js';
5
5
  import type { StartedStep, Step } from './steps.js';
6
6
  import type { Wait } from './waits.js';
7
+ export * from './event-metadata.js';
7
8
  export declare const EventTypeSchema: z.ZodEnum<{
9
+ noop: "noop";
8
10
  run_created: "run_created";
9
11
  run_started: "run_started";
10
12
  run_completed: "run_completed";
@@ -59,49 +61,6 @@ declare const TerminalStepEventTypeSchema: z.ZodEnum<{
59
61
  export type TerminalStepEventType = z.infer<typeof TerminalStepEventTypeSchema>;
60
62
  export declare const TERMINAL_STEP_EVENT_TYPES: ("step_completed" | "step_failed")[];
61
63
  export declare function isTerminalStepEventType(eventType: string): eventType is TerminalStepEventType;
62
- /**
63
- * Groups event types into the classes a replay tracks per entity: the entity
64
- * named by the event's `correlationId`, or the run itself for run events,
65
- * which carry none.
66
- *
67
- * Types that share a class are the mutually exclusive outcomes of one
68
- * decision, so the log records the class once and the first event of it is the
69
- * one that counts: a step either completes or fails.
70
- *
71
- * Classes are independent of each other. A step whose result is in the log has
72
- * still recorded exactly one `step_created`, and can still record another
73
- * `step_started` if an attempt is running somewhere. What a class bounds is
74
- * which events can be *ignored*: a replay may pass over an event whose class
75
- * it already recorded for that entity and which no consumer wants (see
76
- * `EventsConsumer`), and only then.
77
- *
78
- * Note the omissions, all of them types a mapping would be dead weight for.
79
- * `hook_received` and `hook_conflict` are deliveries whose consumer subscribes
80
- * lazily, `attr_set` is written on every attribute write, and `run_created`
81
- * precedes every replay. The terminal run types are absent for a different
82
- * reason: recording a class requires a consumer to take an event of it, and no
83
- * consumer takes `run_completed` / `run_failed` / `run_cancelled` — the runtime
84
- * exits before replaying the body once the log holds one, so they never reach a
85
- * consumer at all. An entry for them could never match.
86
- */
87
- declare const ENTITY_EVENT_CLASS_BY_TYPE: {
88
- readonly step_created: "step_created";
89
- readonly step_started: "step_started";
90
- readonly step_retrying: "step_retrying";
91
- readonly step_completed: "step_terminal";
92
- readonly step_failed: "step_terminal";
93
- readonly wait_created: "wait_created";
94
- readonly wait_completed: "wait_completed";
95
- readonly hook_created: "hook_created";
96
- readonly hook_disposed: "hook_disposed";
97
- readonly run_started: "run_started";
98
- };
99
- export type EntityEventClass = (typeof ENTITY_EVENT_CLASS_BY_TYPE)[keyof typeof ENTITY_EVENT_CLASS_BY_TYPE];
100
- /**
101
- * The per-entity class `eventType` belongs to, or `undefined` when it belongs
102
- * to none. See {@link ENTITY_EVENT_CLASS_BY_TYPE}.
103
- */
104
- export declare function entityEventClass(eventType: string): EntityEventClass | undefined;
105
64
  declare const HookLifecycleEventTypeSchema: z.ZodEnum<{
106
65
  hook_created: "hook_created";
107
66
  hook_received: "hook_received";
@@ -132,33 +91,6 @@ declare const ChildEntityCreationEventTypeSchema: z.ZodEnum<{
132
91
  export type ChildEntityCreationEventType = z.infer<typeof ChildEntityCreationEventTypeSchema>;
133
92
  export declare const CHILD_ENTITY_CREATION_EVENT_TYPES: ("step_created" | "hook_created" | "wait_created")[];
134
93
  export declare function isChildEntityCreationEventType(eventType: string): eventType is ChildEntityCreationEventType;
135
- /**
136
- * Field within eventData that carries the opaque user payload for event types
137
- * that have one. V4 worlds split this field into the wire body while keeping
138
- * the remaining eventData fields in metadata.
139
- */
140
- export declare const EVENT_DATA_PAYLOAD_FIELD_BY_EVENT_TYPE: {
141
- readonly run_created: "input";
142
- readonly run_started: "input";
143
- readonly run_completed: "output";
144
- readonly run_failed: "error";
145
- readonly step_created: "input";
146
- readonly step_started: "input";
147
- readonly step_completed: "result";
148
- readonly step_failed: "error";
149
- readonly step_retrying: "error";
150
- readonly hook_created: "metadata";
151
- readonly hook_received: "payload";
152
- };
153
- export type EventDataPayloadField = (typeof EVENT_DATA_PAYLOAD_FIELD_BY_EVENT_TYPE)[keyof typeof EVENT_DATA_PAYLOAD_FIELD_BY_EVENT_TYPE];
154
- /**
155
- * Fields within eventData that hold ref/payload data per event type.
156
- * When resolveData is 'none', only these fields are stripped — all other
157
- * metadata (stepName, workflowName, etc.) is preserved.
158
- */
159
- export declare const EVENT_DATA_REF_FIELDS: Record<string, readonly EventDataPayloadField[]>;
160
- export declare function getEventDataRefFields(eventType: string): readonly string[];
161
- export declare function getEventDataPayloadField(eventType: string): EventDataPayloadField | undefined;
162
94
  /**
163
95
  * Strip ref/payload fields from eventData based on resolveData setting.
164
96
  * When resolveData is 'none', removes only large data fields (refs) from
@@ -167,6 +99,7 @@ export declare function getEventDataPayloadField(eventType: string): EventDataPa
167
99
  export declare function stripEventDataRefs(event: Event, resolveData: ResolveData): Event;
168
100
  export declare const BaseEventSchema: z.ZodObject<{
169
101
  eventType: z.ZodEnum<{
102
+ noop: "noop";
170
103
  run_created: "run_created";
171
104
  run_started: "run_started";
172
105
  run_completed: "run_completed";
@@ -303,7 +236,7 @@ export declare const CreateEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
303
236
  eventData: z.ZodObject<{
304
237
  changes: z.ZodArray<z.ZodObject<{
305
238
  key: z.ZodString;
306
- value: z.ZodUnion<readonly [z.ZodString, z.ZodNull]>;
239
+ value: z.ZodNullable<z.ZodString>;
307
240
  }, z.core.$strip>>;
308
241
  writer: z.ZodDiscriminatedUnion<[z.ZodObject<{
309
242
  type: z.ZodLiteral<"workflow">;
@@ -470,7 +403,7 @@ export declare const EventSchema: z.ZodIntersection<z.ZodDiscriminatedUnion<[z.Z
470
403
  eventData: z.ZodObject<{
471
404
  changes: z.ZodArray<z.ZodObject<{
472
405
  key: z.ZodString;
473
- value: z.ZodUnion<readonly [z.ZodString, z.ZodNull]>;
406
+ value: z.ZodNullable<z.ZodString>;
474
407
  }, z.core.$strip>>;
475
408
  writer: z.ZodDiscriminatedUnion<[z.ZodObject<{
476
409
  type: z.ZodLiteral<"workflow">;
@@ -589,6 +522,13 @@ export declare const EventSchema: z.ZodIntersection<z.ZodDiscriminatedUnion<[z.Z
589
522
  eventData: z.ZodOptional<z.ZodObject<{
590
523
  resumeAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
591
524
  }, z.core.$strip>>;
525
+ }, z.core.$strip>, z.ZodObject<{
526
+ correlationId: z.ZodOptional<z.ZodString>;
527
+ specVersion: z.ZodOptional<z.ZodNumber>;
528
+ eventType: z.ZodLiteral<"noop">;
529
+ eventData: z.ZodOptional<z.ZodObject<{
530
+ sealed: z.ZodOptional<z.ZodBoolean>;
531
+ }, z.core.$loose>>;
592
532
  }, z.core.$strip>], "eventType">, z.ZodObject<{
593
533
  runId: z.ZodString;
594
534
  eventId: z.ZodString;
@@ -652,7 +592,7 @@ export interface CreateEventParams {
652
592
  resumePayloadDigest?: string;
653
593
  /**
654
594
  * Marks a `step_created` create as the queue consumer's re-ensure of a
655
- * resilient step dispatch (a step message carrying `stepInput` — see
595
+ * resilient step dispatch (a step message carrying `stepInput`, see
656
596
  * `WorkflowInvokePayload.stepInput`): the producer's direct write was
657
597
  * parallelized with the queue publish and may have failed. Only meaningful
658
598
  * for `step_created`.
@@ -664,9 +604,9 @@ export interface CreateEventParams {
664
604
  * this flag to narrow it: refuse the re-ensure (world-vercel surfaces the
665
605
  * backend's 410 as `RunExpiredError`, which the consumer treats as "nothing
666
606
  * left to execute" and acks the message) when it has recorded a refusal for
667
- * this correlation id and no step entity exists. Best-effort by nature — a
607
+ * this correlation id and no step entity exists. Best-effort by nature (a
668
608
  * marker written at refusal time cannot be ordered before the redelivery it
669
- * is meant to stop — so it hardens, and does not close, the window. Worlds
609
+ * is meant to stop), so it hardens, and does not close, the window. Worlds
670
610
  * may ignore this flag entirely.
671
611
  */
672
612
  viaStepDispatch?: boolean;
@@ -681,16 +621,16 @@ export interface CreateEventParams {
681
621
  computeInstanceId?: string;
682
622
  /**
683
623
  * How many events the writer held in its loaded log when it decided to write
684
- * this one — equivalently, the slot it expects to land on minus one. Sent by
624
+ * this one: equivalently, the slot it expects to land on minus one. Sent by
685
625
  * every replay-context create; omitted by callers with no loaded log to be
686
626
  * stale against.
687
627
  *
688
628
  * A World's slots are dense and 1-based (see `Storage.events`), so a count
689
629
  * and a position are the same number. An id that is not a position does not
690
- * produce a count here — it throws, since the runtime cannot state a
630
+ * produce a count here: it throws, since the runtime cannot state a
691
631
  * snapshot for a log it cannot place. Such a World attempts
692
632
  * `eventCount + 1`, and on contention **bumps** to the next free slot and
693
- * commits there anyway — a stale count never rejects a write. What it does
633
+ * commits there anyway: a stale count never rejects a write. What it does
694
634
  * instead is report: when the committed slot is higher than the one asked
695
635
  * for, the events occupying the skipped slots come back on the success
696
636
  * response in {@link EventResult.events} / `cursor` / `hasMore`, so the
@@ -728,7 +668,7 @@ export interface CreateEventParams {
728
668
  /**
729
669
  * Inline-delta optimization (opt-in). When set, the World MAY return,
730
670
  * on the resulting {@link EventResult}, the first page of events written
731
- * strictly after this cursor (via `events`/`cursor`/`hasMore`) — the
671
+ * strictly after this cursor (via `events`/`cursor`/`hasMore`): the
732
672
  * same page an `events.list({ cursor: sinceCursor, sortOrder: 'asc' })`
733
673
  * call would return immediately after this write. Outside turbo mode the
734
674
  * runtime sets this on every write it makes from the orchestrator loop
@@ -736,7 +676,7 @@ export interface CreateEventParams {
736
676
  * carries the log forward and the loop reads it back for free: instead of
737
677
  * re-reading its own just-written events (and any events interleaved
738
678
  * in-band, such as `hook_received`), it consumes the authoritative delta
739
- * the write already had to compute. Turbo mode does not set it — the
679
+ * the write already had to compute. Turbo mode does not set it: the
740
680
  * point there is to keep the first invocation's writes as cheap as
741
681
  * possible, and it has no loaded log to extend.
742
682
  *
@@ -747,7 +687,7 @@ export interface CreateEventParams {
747
687
  * `hasMore: true` rather than paginating to exhaustion. The runtime
748
688
  * consumes that page and continues from its cursor, so it never reads the
749
689
  * returned prefix again.
750
- * Returning these fields at all is OPTIONAL — a World that omits them is
690
+ * Returning these fields at all is OPTIONAL: a World that omits them is
751
691
  * fully supported; the runtime falls back to `events.list`. This
752
692
  * preserves the same divergence guarantees as the fetch path because the
753
693
  * delta is computed atomically against the same log the fetch would read.
@@ -759,7 +699,7 @@ export interface CreateEventParams {
759
699
  * (`events`/`cursor`/`hasMore`) so the runtime can skip its initial
760
700
  * `events.list`. The turbo first invocation backgrounds `run_started`
761
701
  * purely as a write barrier and never reads that preload, so it sets this
762
- * to tell the World to skip the wasted list+resolve — trimming the
702
+ * to tell the World to skip the wasted list+resolve, trimming the
763
703
  * `run_started` round-trip that the chained first `step_started` waits on.
764
704
  * A World that ignores it (or doesn't preload) remains fully correct: the
765
705
  * runtime falls back to `events.list` whenever it actually needs the log.
@@ -771,7 +711,7 @@ export interface CreateEventParams {
771
711
  */
772
712
  skipPreload?: true;
773
713
  /**
774
- * Replay-log preload opt-in (advisory) — the `hook_received` dual of
714
+ * Replay-log preload opt-in (advisory): the `hook_received` dual of
775
715
  * {@link skipPreload}. Set only by the queue consumer's idempotent
776
716
  * `hook_received` re-ensure on a lazy hook resume (alongside
777
717
  * {@link resumeId} + {@link resumePayloadDigest}). A World MAY return the
@@ -781,15 +721,15 @@ export interface CreateEventParams {
781
721
  * `run_started` write and the initial `events.list`.
782
722
  *
783
723
  * The runtime trusts a returned preload as replay input ONLY when all of
784
- * the following hold — a World that cannot guarantee them should return
785
- * its normal {@link EventResult} instead:
724
+ * the following hold (a World that cannot guarantee them should return
725
+ * its normal {@link EventResult} instead):
786
726
  *
787
727
  * - `events` is the COMPLETE log with `hasMore: false` (the runtime has no
788
728
  * cursor-continuation machinery on this path; a bounded page is
789
729
  * rejected).
790
730
  * - `cursor` is a valid non-null resume point matching `events.list`
791
731
  * semantics (present even on the final page).
792
- * - `run` (with `run.startedAt`) and `maxEvents` are present — this
732
+ * - `run` (with `run.startedAt`) and `maxEvents` are present: this
793
733
  * response plays `run_started`'s role, including the event-ceiling
794
734
  * handshake.
795
735
  * - The log contains `run_created`, `run_started`, and the canonical
@@ -800,12 +740,19 @@ export interface CreateEventParams {
800
740
  * omitted from the replay input.
801
741
  *
802
742
  * Anything less and the runtime observes that no usable replay preload
803
- * came back and falls back to the existing `run_started` setup — a World
743
+ * came back and falls back to the existing `run_started` setup. A World
804
744
  * that ignores the param entirely remains fully correct. Only meaningful
805
745
  * for `hook_received`; ignored for other event types. Producer-side
806
746
  * `resumeHook()` must not set it.
807
747
  */
808
748
  preloadEvents?: true;
749
+ /**
750
+ * Synchronously observes each validated event in a streamed replay-log
751
+ * response. A retried request may observe the same event again; observers
752
+ * must therefore be idempotent. Throwing aborts the operation and the World
753
+ * must surface the original error without retrying or reclassifying it.
754
+ */
755
+ replayEventObserver?: (event: Event) => void;
809
756
  }
810
757
  /**
811
758
  * Result of creating an event. Includes the created event and optionally
@@ -829,7 +776,7 @@ export type EventResult<T extends EventType = EventType> = {
829
776
  * step-creation data atomically *created* the step on this call (the
830
777
  * caller won the create-claim), as opposed to transitioning a step that
831
778
  * already existed. The owned-inline runtime path uses this as the
832
- * exactly-once ownership signal — it runs the step body inline only when
779
+ * exactly-once ownership signal: it runs the step body inline only when
833
780
  * it created the step, so a concurrent handler that lost the create race
834
781
  * (and gets `EntityConflictError`/skipped) never double-executes. Absent
835
782
  * (undefined) on the legacy path and from older servers/worlds, which is
@@ -856,7 +803,7 @@ export type EventResult<T extends EventType = EventType> = {
856
803
  * - On any response whose committed slot came out higher than the one
857
804
  * {@link CreateEventParams.eventCount} asked for:
858
805
  * the events occupying the slots that were skipped over, in slot
859
- * order. This is the "report" half of bump-and-report — the write
806
+ * order. This is the "report" half of bump-and-report: the write
860
807
  * succeeded, and these are the events the writer had not seen when it
861
808
  * decided to make it.
862
809
  */
@@ -878,7 +825,7 @@ export type EventResult<T extends EventType = EventType> = {
878
825
  } : unknown);
879
826
  /**
880
827
  * One event of a batch write ({@link Storage.events.createBatch}), in request
881
- * order — which is the order the events land in the run's log.
828
+ * order, which is the order the events land in the run's log.
882
829
  */
883
830
  export interface BatchEventRequest {
884
831
  /** The event, same discriminated union the single `create` takes. */
@@ -886,7 +833,7 @@ export interface BatchEventRequest {
886
833
  /**
887
834
  * Client event time for this event. Under slot identity this is the source
888
835
  * of the durable event's `createdAt` (a slot id carries no time), so the
889
- * timestamp a replay observes is the one the writer chose — set it to the
836
+ * timestamp a replay observes is the one the writer chose: set it to the
890
837
  * instant the event logically occurred.
891
838
  */
892
839
  occurredAt?: Date;
@@ -922,7 +869,7 @@ export interface CreateEventBatchParams {
922
869
  * - rejection → the status code and error code the single create would have
923
870
  * failed with, so callers reuse their single-path conflict handling per
924
871
  * event. A `409`/`conflict` means the entity was not in the prior state
925
- * the event requires — most commonly because an earlier delivery already
872
+ * the event requires, most commonly because an earlier delivery already
926
873
  * applied the same event, but possibly because the entity reached a
927
874
  * DIFFERENT state (e.g. `step_completed` conflicting because the step
928
875
  * failed). A 409 alone does not prove the equivalent effect was applied;
@@ -934,10 +881,10 @@ export interface CreateEventBatchParams {
934
881
  * can return a mix of 200s and 409s from one call.
935
882
  *
936
883
  * Retry semantics: a transport retry of a committed batch converges to
937
- * per-event 409s ONLY for entity-conditioned events — creates and terminal
884
+ * per-event 409s ONLY for entity-conditioned events: creates and terminal
938
885
  * transitions. A standalone bare `step_started` or a `step_retrying`
939
886
  * re-patches its step on every attempt and does NOT converge, and
940
- * `hook_received` appends a new row per attempt — `world-vercel` rejects
887
+ * `hook_received` appends a new row per attempt, so `world-vercel` rejects
941
888
  * `hook_received` in a batch outright and only auto-retries batches whose
942
889
  * every event is retry-convergent.
943
890
  *
@@ -988,12 +935,11 @@ export interface ListEventsByCorrelationIdParams {
988
935
  * run, not globally: a slot-numbered run counts its own steps and waits, so
989
936
  * `step_…001` names the first step of *every* such run. Naming the run is
990
937
  * what makes the answer that run's events, and it is what makes the
991
- * pagination cursor unambiguous — `(runId, eventId)` is a key where an
938
+ * pagination cursor unambiguous: `(runId, eventId)` is a key where an
992
939
  * event id alone is not.
993
940
  */
994
941
  runId: string;
995
942
  pagination?: PaginationOptions;
996
943
  resolveData?: ResolveData;
997
944
  }
998
- export {};
999
945
  //# sourceMappingURL=events.d.ts.map
@@ -2,14 +2,14 @@ import { z } from '#compiled/zod/index.js';
2
2
  import type { SerializedData } from './serialization.js';
3
3
  import type { PaginationOptions, ResolveData } from './shared.js';
4
4
  /**
5
- * Minimal, immutable slice of a hook's owning run needed to resume it —
5
+ * Minimal, immutable slice of a hook's owning run needed to resume it:
6
6
  * enough for encryption-key resolution, serialization/compression capability
7
7
  * selection, queue routing, and trace linking, without fetching the full run.
8
8
  *
9
9
  * Persisted on new hook records (workflow-server) and also returned inline by
10
10
  * `getByToken`, so a resume can skip the separate `runs.get`. Deliberately
11
11
  * excludes the run's mutable state (e.g. status), inputs/outputs, attributes,
12
- * and any secret — only fields that are fixed at hook-creation time.
12
+ * and any secret: only fields that are fixed at hook-creation time.
13
13
  */
14
14
  export declare const HookResumeContextSchema: z.ZodObject<{
15
15
  deploymentId: z.ZodString;
@@ -26,17 +26,18 @@ export type HookResumeContext = z.infer<typeof HookResumeContextSchema>;
26
26
  * deployment stamps this into its execution context (and the server mirrors it
27
27
  * onto `HookResumeContext.hookResumeInputVersion`) to attest that its
28
28
  * `@workflow/core` re-ensures the `hook_received` event from a queue message's
29
- * `hookInput`. `resumeHook()`'s parallel fast path requires the target run's
30
- * marker to be at least this value. Bump only on a breaking change to the
31
- * `hookInput` re-ensure contract.
29
+ * `hookInput`. Current producers write the event durably BEFORE publishing the
30
+ * wake and do not read this marker; it exists for older producers whose lazy
31
+ * path requires the target run's marker to be at least this value. Bump only
32
+ * on a breaking change to the `hookInput` re-ensure contract.
32
33
  */
33
34
  export declare const HOOK_RESUME_INPUT_VERSION = 1;
34
35
  /**
35
36
  * Current version of the backend lazy-hook-resume dedup contract: the live
36
- * backend enforces a `(runId, resumeId)` constraint so the direct write and the
37
- * queue consumer's re-ensure converge on exactly one `hook_received`.
38
- * `resumeHook()`'s parallel fast path requires the backend to attest at least
39
- * this version. Bump only on a breaking change to the constraint semantics.
37
+ * backend enforces a `(runId, resumeId)` constraint so repeated deliveries of
38
+ * one resume's queue message converge on exactly one `hook_received`.
39
+ * `resumeHook()`'s lazy path requires the backend to attest at least this
40
+ * version. Bump only on a breaking change to the constraint semantics.
40
41
  */
41
42
  export declare const HOOK_RESUME_DEDUP_VERSION = 1;
42
43
  /**
@@ -45,8 +46,8 @@ export declare const HOOK_RESUME_DEDUP_VERSION = 1;
45
46
  *
46
47
  * Response-only and transient: NEVER persisted on the hook entity and NEVER
47
48
  * part of {@link HookResumeContextSchema}. Recomputing it per response is what
48
- * makes a server rollback or kill switch take effect immediately — a rolled-back
49
- * or kill-switched server simply stops emitting it, dropping new resumes to the
49
+ * makes a server rollback or kill switch take effect immediately: a rolled-back
50
+ * or kill-switched server stops emitting it, dropping new resumes to the
50
51
  * sequential path with no stranded hooks. (Contrast with the per-run, persisted
51
52
  * `hookResumeInputVersion`, which attests the *consumer* and is fixed at run
52
53
  * creation.)
@@ -1,10 +1,10 @@
1
1
  export type * from './analytics.js';
2
2
  export { ANALYTICS_EVENTS_GET_MANY_LIMIT, AnalyticsAttributeKeySchema, AnalyticsEventSchema, AnalyticsHookSchema, AnalyticsRunSchema, AnalyticsStepSchema, AnalyticsWaitSchema, } from './analytics.js';
3
3
  export type * from './attributes.js';
4
- export { ATTRIBUTE_KEY_MAX_LENGTH, ATTRIBUTE_MAX_PER_RUN, ATTRIBUTE_VALUE_MAX_BYTES, AttributeChangeSchema, AttributeChangesSchema, AttributeValidationError, applyAttributeChanges, PARENT_RUN_ID_ATTRIBUTE, RESERVED_ATTRIBUTE_KEY_PREFIX, ROOT_RUN_ID_ATTRIBUTE, validateAttributeChanges, validateAttributeKey, validateAttributeValue, } from './attributes.js';
4
+ export { ATTRIBUTE_KEY_MAX_LENGTH, ATTRIBUTE_MAX_PER_RUN, ATTRIBUTE_VALUE_MAX_BYTES, AttributeChangeSchema, AttributeChangesSchema, AttributeKeySchema, AttributeValidationError, AttributeValueSchema, applyAttributeChanges, PARENT_RUN_ID_ATTRIBUTE, RESERVED_ATTRIBUTE_KEY_PREFIX, ROOT_RUN_ID_ATTRIBUTE, validateAttributeChanges, } from './attributes.js';
5
5
  export { _resetEnvWarnCacheForTests, type EnvNumberOptions, envFlag, envNumber, getMaxEventsPerRun, } from './env-config.js';
6
6
  export type * from './events.js';
7
- export { BaseEventSchema, CHILD_ENTITY_CREATION_EVENT_TYPES, CreateEventSchema, EVENT_DATA_PAYLOAD_FIELD_BY_EVENT_TYPE, EVENT_DATA_REF_FIELDS, EventSchema, EventTypeSchema, entityEventClass, getEventDataPayloadField, getEventDataRefFields, HOOK_EVENTS_REQUIRING_EXISTENCE, HOOK_LIFECYCLE_EVENT_TYPES, HookCreatedEventSchema, isChildEntityCreationEvent, isChildEntityCreationEventType, isHookEventRequiringExistence, isHookLifecycleEventType, isRunEventType, isStepEventType, isTerminalRunEventType, isTerminalStepEventType, isWaitEventType, RUN_EVENT_TYPES, STEP_EVENT_TYPES, stripEventDataRefs, TERMINAL_RUN_EVENT_TYPES, TERMINAL_STEP_EVENT_TYPES, TerminalRunEventTypeSchema, WAIT_EVENT_TYPES, } from './events.js';
7
+ export { BaseEventSchema, CHILD_ENTITY_CREATION_EVENT_TYPES, CreateEventSchema, classifyEntityEvent, EventSchema, EventTypeSchema, entityEventClass, getEventDataPayloadField, getEventDataRefFields, HOOK_EVENTS_REQUIRING_EXISTENCE, HOOK_LIFECYCLE_EVENT_TYPES, HookCreatedEventSchema, isChildEntityCreationEvent, isChildEntityCreationEventType, isHookEventRequiringExistence, isHookLifecycleEventType, isRunEventType, isSealedNoopEvent, isStepEventType, isTerminalRunEventType, isTerminalStepEventType, isWaitEventType, RUN_ENTITY_KEY, RUN_EVENT_TYPES, STEP_EVENT_TYPES, stripEventDataRefs, TERMINAL_EVENT_CLASSES, TERMINAL_RUN_EVENT_TYPES, TERMINAL_STEP_EVENT_TYPES, TerminalRunEventTypeSchema, WAIT_EVENT_TYPES, } from './events.js';
8
8
  export type * from './hooks.js';
9
9
  export { HOOK_RESUME_DEDUP_VERSION, HOOK_RESUME_INPUT_VERSION, HookResumeCapabilitiesSchema, HookSchema, } from './hooks.js';
10
10
  export type * from './interfaces.js';
@@ -21,7 +21,7 @@ export type { GetChunksOptions, StreamChunk, StreamChunksResponse, StreamInfoRes
21
21
  export { PaginatedResponseSchema, StructuredErrorSchema, } from './shared.js';
22
22
  export { EVENT_ID_BODY_LENGTH, EVENT_ID_PREFIX, eventIdToSlot, FIRST_EVENT_SLOT, isSlotBody, isSlotEventId, MAX_EVENT_SLOT, requireEventSlot, slotToEventId, } from './slot-identity.js';
23
23
  export type { SpecVersion } from './spec-version.js';
24
- export { isLegacySpecVersion, requiresNewerWorld, SPEC_VERSION_CURRENT, SPEC_VERSION_LEGACY, SPEC_VERSION_MAX_SUPPORTED, SPEC_VERSION_SUPPORTS_ATTRIBUTES, SPEC_VERSION_SUPPORTS_CBOR_QUEUE_TRANSPORT, SPEC_VERSION_SUPPORTS_COMPRESSION, SPEC_VERSION_SUPPORTS_EVENT_SOURCING, SPEC_VERSION_SUPPORTS_SLOT_IDENTITY, } from './spec-version.js';
24
+ export { isLegacySpecVersion, mintedSpecVersion, requiresNewerWorld, SEALED_LOG_ENV_VAR, SPEC_VERSION_CURRENT, SPEC_VERSION_LEGACY, SPEC_VERSION_MAX_SUPPORTED, SPEC_VERSION_SUPPORTS_ATTRIBUTES, SPEC_VERSION_SUPPORTS_CBOR_QUEUE_TRANSPORT, SPEC_VERSION_SUPPORTS_COMPRESSION, SPEC_VERSION_SUPPORTS_EVENT_SOURCING, SPEC_VERSION_SUPPORTS_SEALED_LOG, SPEC_VERSION_SUPPORTS_SLOT_IDENTITY, } from './spec-version.js';
25
25
  export type * from './steps.js';
26
26
  export { isTerminalStepStatus, StepSchema, StepStatusSchema, TERMINAL_STEP_STATUSES, TerminalStepStatusSchema, } from './steps.js';
27
27
  export type { WorkflowRunId } from './ulid.js';