@workflow/core 5.2.3 → 5.4.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 (283) hide show
  1. package/README.md +27 -0
  2. package/dist/capabilities.d.ts +2 -0
  3. package/dist/capabilities.d.ts.map +1 -1
  4. package/dist/capabilities.js +7 -1
  5. package/dist/classify-error.d.ts.map +1 -1
  6. package/dist/classify-error.js +3 -2
  7. package/dist/create-hook.d.ts +15 -0
  8. package/dist/create-hook.d.ts.map +1 -1
  9. package/dist/create-hook.js +1 -1
  10. package/dist/events-consumer.d.ts +98 -6
  11. package/dist/events-consumer.d.ts.map +1 -1
  12. package/dist/events-consumer.js +198 -13
  13. package/dist/flushable-stream.js +11 -2
  14. package/dist/global.d.ts +6 -0
  15. package/dist/global.d.ts.map +1 -1
  16. package/dist/global.js +1 -1
  17. package/dist/logger.d.ts.map +1 -1
  18. package/dist/logger.js +65 -35
  19. package/dist/private.d.ts +41 -2
  20. package/dist/private.d.ts.map +1 -1
  21. package/dist/private.js +39 -4
  22. package/dist/replay-payload-cache.d.ts +13 -2
  23. package/dist/replay-payload-cache.d.ts.map +1 -1
  24. package/dist/replay-payload-cache.js +20 -10
  25. package/dist/runtime/after-terminal-write.d.ts +33 -0
  26. package/dist/runtime/after-terminal-write.d.ts.map +1 -0
  27. package/dist/runtime/after-terminal-write.js +23 -0
  28. package/dist/runtime/child-run-completion-notify.d.ts +36 -0
  29. package/dist/runtime/child-run-completion-notify.d.ts.map +1 -0
  30. package/dist/runtime/child-run-completion-notify.js +97 -0
  31. package/dist/runtime/child-run-completion.d.ts +45 -0
  32. package/dist/runtime/child-run-completion.d.ts.map +1 -0
  33. package/dist/runtime/child-run-completion.js +192 -0
  34. package/dist/runtime/constants.d.ts +161 -176
  35. package/dist/runtime/constants.d.ts.map +1 -1
  36. package/dist/runtime/constants.js +194 -273
  37. package/dist/runtime/delivery.d.ts +270 -0
  38. package/dist/runtime/delivery.d.ts.map +1 -0
  39. package/dist/runtime/delivery.js +325 -0
  40. package/dist/runtime/deployment-guard.d.ts +8 -1
  41. package/dist/runtime/deployment-guard.d.ts.map +1 -1
  42. package/dist/runtime/deployment-guard.js +12 -6
  43. package/dist/runtime/get-port-lazy.d.ts.map +1 -1
  44. package/dist/runtime/get-port-lazy.js +77 -14
  45. package/dist/runtime/helpers.d.ts +50 -4
  46. package/dist/runtime/helpers.d.ts.map +1 -1
  47. package/dist/runtime/helpers.js +88 -10
  48. package/dist/runtime/hook-creation.d.ts +45 -0
  49. package/dist/runtime/hook-creation.d.ts.map +1 -0
  50. package/dist/runtime/hook-creation.js +98 -0
  51. package/dist/runtime/hook-wake.d.ts +16 -14
  52. package/dist/runtime/hook-wake.d.ts.map +1 -1
  53. package/dist/runtime/hook-wake.js +31 -18
  54. package/dist/runtime/invocations.d.ts.map +1 -1
  55. package/dist/runtime/invocations.js +9 -3
  56. package/dist/runtime/out-of-band-observation.d.ts +28 -17
  57. package/dist/runtime/out-of-band-observation.d.ts.map +1 -1
  58. package/dist/runtime/out-of-band-observation.js +12 -3
  59. package/dist/runtime/quickjs-delivery-shared.d.ts +126 -0
  60. package/dist/runtime/quickjs-delivery-shared.d.ts.map +1 -0
  61. package/dist/runtime/quickjs-delivery-shared.js +176 -0
  62. package/dist/runtime/quickjs-log-view.d.ts +17 -0
  63. package/dist/runtime/quickjs-log-view.d.ts.map +1 -1
  64. package/dist/runtime/quickjs-log-view.js +31 -1
  65. package/dist/runtime/quickjs-pending-ops.d.ts +181 -0
  66. package/dist/runtime/quickjs-pending-ops.d.ts.map +1 -0
  67. package/dist/runtime/quickjs-pending-ops.js +633 -0
  68. package/dist/runtime/quickjs-runtime.d.ts +30 -5
  69. package/dist/runtime/quickjs-runtime.d.ts.map +1 -1
  70. package/dist/runtime/quickjs-runtime.js +546 -169
  71. package/dist/runtime/quickjs-serde.d.ts.map +1 -1
  72. package/dist/runtime/quickjs-serde.js +96 -5
  73. package/dist/runtime/replay-budget.d.ts +8 -1
  74. package/dist/runtime/replay-budget.d.ts.map +1 -1
  75. package/dist/runtime/replay-budget.js +12 -8
  76. package/dist/runtime/resume-hook.d.ts +15 -10
  77. package/dist/runtime/resume-hook.d.ts.map +1 -1
  78. package/dist/runtime/resume-hook.js +211 -65
  79. package/dist/runtime/run-spec-routing.d.ts +52 -0
  80. package/dist/runtime/run-spec-routing.d.ts.map +1 -0
  81. package/dist/runtime/run-spec-routing.js +78 -0
  82. package/dist/runtime/run-spec-version.d.ts +8 -4
  83. package/dist/runtime/run-spec-version.d.ts.map +1 -1
  84. package/dist/runtime/run-spec-version.js +11 -7
  85. package/dist/runtime/run.d.ts +29 -3
  86. package/dist/runtime/run.d.ts.map +1 -1
  87. package/dist/runtime/run.js +116 -11
  88. package/dist/runtime/runs.d.ts +58 -2
  89. package/dist/runtime/runs.d.ts.map +1 -1
  90. package/dist/runtime/runs.js +228 -30
  91. package/dist/runtime/spec8/constants.d.ts +177 -0
  92. package/dist/runtime/spec8/constants.d.ts.map +1 -0
  93. package/dist/runtime/spec8/constants.js +232 -0
  94. package/dist/runtime/spec8/count-step-started-events.d.ts.map +1 -0
  95. package/dist/runtime/spec8/count-step-started-events.js +72 -0
  96. package/dist/runtime/spec8/delivery.d.ts +6 -0
  97. package/dist/runtime/spec8/delivery.d.ts.map +1 -0
  98. package/dist/runtime/spec8/delivery.js +4250 -0
  99. package/dist/runtime/spec8/inline-steps-in-flight.d.ts +58 -0
  100. package/dist/runtime/spec8/inline-steps-in-flight.d.ts.map +1 -0
  101. package/dist/runtime/spec8/inline-steps-in-flight.js +104 -0
  102. package/dist/runtime/spec8/open-hook-wait-state.d.ts.map +1 -0
  103. package/dist/runtime/spec8/open-hook-wait-state.js +93 -0
  104. package/dist/runtime/{quickjs-entrypoint.d.ts → spec8/quickjs-entrypoint.d.ts} +0 -20
  105. package/dist/runtime/spec8/quickjs-entrypoint.d.ts.map +1 -0
  106. package/dist/runtime/spec8/quickjs-entrypoint.js +1779 -0
  107. package/dist/runtime/{step-executor.d.ts → spec8/step-executor.d.ts} +11 -7
  108. package/dist/runtime/spec8/step-executor.d.ts.map +1 -0
  109. package/dist/runtime/spec8/step-executor.js +1134 -0
  110. package/dist/runtime/{step-ownership.d.ts → spec8/step-ownership.d.ts} +1 -1
  111. package/dist/runtime/spec8/step-ownership.d.ts.map +1 -0
  112. package/dist/runtime/spec8/step-ownership.js +114 -0
  113. package/dist/runtime/spec8/step-single-flight.d.ts +34 -0
  114. package/dist/runtime/spec8/step-single-flight.d.ts.map +1 -0
  115. package/dist/runtime/spec8/step-single-flight.js +36 -0
  116. package/dist/runtime/{suspension-handler.d.ts → spec8/suspension-handler.d.ts} +68 -24
  117. package/dist/runtime/spec8/suspension-handler.d.ts.map +1 -0
  118. package/dist/runtime/spec8/suspension-handler.js +1291 -0
  119. package/dist/runtime/spec9/consume-after-commit.d.ts +33 -0
  120. package/dist/runtime/spec9/consume-after-commit.d.ts.map +1 -0
  121. package/dist/runtime/spec9/consume-after-commit.js +13 -0
  122. package/dist/runtime/spec9/consumed-position.d.ts +38 -0
  123. package/dist/runtime/spec9/consumed-position.d.ts.map +1 -0
  124. package/dist/runtime/spec9/consumed-position.js +48 -0
  125. package/dist/runtime/spec9/creator-rules.d.ts +220 -0
  126. package/dist/runtime/spec9/creator-rules.d.ts.map +1 -0
  127. package/dist/runtime/spec9/creator-rules.js +357 -0
  128. package/dist/runtime/spec9/deadline.d.ts +18 -0
  129. package/dist/runtime/spec9/deadline.d.ts.map +1 -0
  130. package/dist/runtime/spec9/deadline.js +27 -0
  131. package/dist/runtime/spec9/delivery.d.ts +17 -0
  132. package/dist/runtime/spec9/delivery.d.ts.map +1 -0
  133. package/dist/runtime/spec9/delivery.js +3837 -0
  134. package/dist/runtime/spec9/fence-refusals.d.ts +20 -0
  135. package/dist/runtime/spec9/fence-refusals.d.ts.map +1 -0
  136. package/dist/runtime/spec9/fence-refusals.js +55 -0
  137. package/dist/runtime/spec9/in-band-writer.d.ts +275 -0
  138. package/dist/runtime/spec9/in-band-writer.d.ts.map +1 -0
  139. package/dist/runtime/spec9/in-band-writer.js +831 -0
  140. package/dist/runtime/spec9/live-feed.d.ts +151 -0
  141. package/dist/runtime/spec9/live-feed.d.ts.map +1 -0
  142. package/dist/runtime/spec9/live-feed.js +311 -0
  143. package/dist/runtime/spec9/log-state.d.ts +137 -0
  144. package/dist/runtime/spec9/log-state.d.ts.map +1 -0
  145. package/dist/runtime/spec9/log-state.js +176 -0
  146. package/dist/runtime/spec9/quickjs-entrypoint.d.ts +185 -0
  147. package/dist/runtime/spec9/quickjs-entrypoint.d.ts.map +1 -0
  148. package/dist/runtime/spec9/quickjs-entrypoint.js +2332 -0
  149. package/dist/runtime/spec9/read-deadline.d.ts +46 -0
  150. package/dist/runtime/spec9/read-deadline.d.ts.map +1 -0
  151. package/dist/runtime/spec9/read-deadline.js +88 -0
  152. package/dist/runtime/spec9/run-ahead.d.ts +65 -0
  153. package/dist/runtime/spec9/run-ahead.d.ts.map +1 -0
  154. package/dist/runtime/spec9/run-ahead.js +102 -0
  155. package/dist/runtime/spec9/step-delivery.d.ts +111 -0
  156. package/dist/runtime/spec9/step-delivery.d.ts.map +1 -0
  157. package/dist/runtime/spec9/step-delivery.js +149 -0
  158. package/dist/runtime/spec9/step-executor.d.ts +217 -0
  159. package/dist/runtime/spec9/step-executor.d.ts.map +1 -0
  160. package/dist/runtime/spec9/step-executor.js +782 -0
  161. package/dist/runtime/spec9/step-handler.d.ts +92 -0
  162. package/dist/runtime/spec9/step-handler.d.ts.map +1 -0
  163. package/dist/runtime/spec9/step-handler.js +375 -0
  164. package/dist/runtime/spec9/step-message.d.ts +42 -0
  165. package/dist/runtime/spec9/step-message.d.ts.map +1 -0
  166. package/dist/runtime/spec9/step-message.js +81 -0
  167. package/dist/runtime/spec9/step-retention.d.ts +44 -0
  168. package/dist/runtime/spec9/step-retention.d.ts.map +1 -0
  169. package/dist/runtime/spec9/step-retention.js +51 -0
  170. package/dist/runtime/spec9/step-single-flight.d.ts +19 -0
  171. package/dist/runtime/spec9/step-single-flight.d.ts.map +1 -0
  172. package/dist/runtime/spec9/step-single-flight.js +24 -0
  173. package/dist/runtime/spec9/step-wait-creation.d.ts +162 -0
  174. package/dist/runtime/spec9/step-wait-creation.d.ts.map +1 -0
  175. package/dist/runtime/spec9/step-wait-creation.js +450 -0
  176. package/dist/runtime/spec9/suspension-handler.d.ts +125 -0
  177. package/dist/runtime/spec9/suspension-handler.d.ts.map +1 -0
  178. package/dist/runtime/spec9/suspension-handler.js +327 -0
  179. package/dist/runtime/spec9/wait-timer.d.ts +143 -0
  180. package/dist/runtime/spec9/wait-timer.d.ts.map +1 -0
  181. package/dist/runtime/spec9/wait-timer.js +173 -0
  182. package/dist/runtime/start-hook-binding.d.ts +50 -0
  183. package/dist/runtime/start-hook-binding.d.ts.map +1 -0
  184. package/dist/runtime/start-hook-binding.js +85 -0
  185. package/dist/runtime/start-hook-delivery.d.ts +47 -0
  186. package/dist/runtime/start-hook-delivery.d.ts.map +1 -0
  187. package/dist/runtime/start-hook-delivery.js +94 -0
  188. package/dist/runtime/start-hook-holder.d.ts +50 -0
  189. package/dist/runtime/start-hook-holder.d.ts.map +1 -0
  190. package/dist/runtime/start-hook-holder.js +149 -0
  191. package/dist/runtime/start.d.ts +76 -4
  192. package/dist/runtime/start.d.ts.map +1 -1
  193. package/dist/runtime/start.js +451 -62
  194. package/dist/runtime/step-latency.d.ts +3 -3
  195. package/dist/runtime/step-latency.js +1 -1
  196. package/dist/runtime/step-single-flight.d.ts +4 -8
  197. package/dist/runtime/step-single-flight.d.ts.map +1 -1
  198. package/dist/runtime/step-single-flight.js +23 -36
  199. package/dist/runtime/step-streams.d.ts +6 -0
  200. package/dist/runtime/step-streams.d.ts.map +1 -0
  201. package/dist/runtime/step-streams.js +40 -0
  202. package/dist/runtime/suspension-hooks.d.ts +84 -0
  203. package/dist/runtime/suspension-hooks.d.ts.map +1 -0
  204. package/dist/runtime/suspension-hooks.js +310 -0
  205. package/dist/runtime/wait-continuation.d.ts +27 -0
  206. package/dist/runtime/wait-continuation.d.ts.map +1 -1
  207. package/dist/runtime/wait-continuation.js +27 -2
  208. package/dist/runtime/world-compatibility.d.ts +22 -3
  209. package/dist/runtime/world-compatibility.d.ts.map +1 -1
  210. package/dist/runtime/world-compatibility.js +37 -2
  211. package/dist/runtime/world.d.ts.map +1 -1
  212. package/dist/runtime/world.js +2 -1
  213. package/dist/runtime.d.ts +2 -2
  214. package/dist/runtime.d.ts.map +1 -1
  215. package/dist/runtime.js +118 -4154
  216. package/dist/serialization/abort-stream.d.ts +11 -0
  217. package/dist/serialization/abort-stream.d.ts.map +1 -0
  218. package/dist/serialization/abort-stream.js +86 -0
  219. package/dist/serialization/reducers/common-vm.d.ts.map +1 -1
  220. package/dist/serialization/reducers/common-vm.js +39 -2
  221. package/dist/serialization/reducers/common.d.ts.map +1 -1
  222. package/dist/serialization/reducers/common.js +26 -3
  223. package/dist/serialization/types.d.ts +10 -1
  224. package/dist/serialization/types.d.ts.map +1 -1
  225. package/dist/serialization/types.js +1 -1
  226. package/dist/serialization.d.ts +21 -5
  227. package/dist/serialization.d.ts.map +1 -1
  228. package/dist/serialization.js +136 -79
  229. package/dist/set-attributes.d.ts.map +1 -1
  230. package/dist/set-attributes.js +9 -14
  231. package/dist/step/context-storage.d.ts +2 -0
  232. package/dist/step/context-storage.d.ts.map +1 -1
  233. package/dist/step/context-storage.js +1 -1
  234. package/dist/step.d.ts.map +1 -1
  235. package/dist/step.js +23 -16
  236. package/dist/telemetry/semantic-conventions.d.ts +218 -3
  237. package/dist/telemetry/semantic-conventions.d.ts.map +1 -1
  238. package/dist/telemetry/semantic-conventions.js +161 -2
  239. package/dist/test-support/append-only-world.d.ts +437 -0
  240. package/dist/test-support/append-only-world.d.ts.map +1 -0
  241. package/dist/test-support/append-only-world.js +816 -0
  242. package/dist/test-support/fence-snapshot.d.ts +11 -0
  243. package/dist/test-support/fence-snapshot.d.ts.map +1 -0
  244. package/dist/test-support/fence-snapshot.js +12 -0
  245. package/dist/test-support/load-events.d.ts +8 -0
  246. package/dist/test-support/load-events.d.ts.map +1 -0
  247. package/dist/test-support/load-events.js +27 -0
  248. package/dist/test-support/orchestrator-harness.d.ts +502 -0
  249. package/dist/test-support/orchestrator-harness.d.ts.map +1 -0
  250. package/dist/test-support/orchestrator-harness.js +116 -0
  251. package/dist/version.d.ts +1 -1
  252. package/dist/version.js +2 -2
  253. package/dist/workflow/abort-controller.d.ts.map +1 -1
  254. package/dist/workflow/abort-controller.js +7 -5
  255. package/dist/workflow/hook.d.ts +5 -0
  256. package/dist/workflow/hook.d.ts.map +1 -1
  257. package/dist/workflow/hook.js +83 -19
  258. package/dist/workflow.d.ts +45 -16
  259. package/dist/workflow.d.ts.map +1 -1
  260. package/dist/workflow.js +111 -50
  261. package/docs/api-reference/create-hook.mdx +8 -0
  262. package/docs/api-reference/create-webhook.mdx +1 -1
  263. package/docs/api-reference/fetch.mdx +2 -0
  264. package/docs/foundations/errors-and-retries.mdx +6 -0
  265. package/docs/foundations/hooks.mdx +3 -1
  266. package/docs/foundations/idempotency.mdx +190 -60
  267. package/docs/foundations/starting-workflows.mdx +3 -7
  268. package/docs/how-it-works/event-sourcing.mdx +6 -0
  269. package/package.json +5 -5
  270. package/dist/runtime/count-step-started-events.d.ts.map +0 -1
  271. package/dist/runtime/count-step-started-events.js +0 -72
  272. package/dist/runtime/open-hook-wait-state.d.ts.map +0 -1
  273. package/dist/runtime/open-hook-wait-state.js +0 -93
  274. package/dist/runtime/quickjs-entrypoint.d.ts.map +0 -1
  275. package/dist/runtime/quickjs-entrypoint.js +0 -2314
  276. package/dist/runtime/step-executor.d.ts.map +0 -1
  277. package/dist/runtime/step-executor.js +0 -1156
  278. package/dist/runtime/step-ownership.d.ts.map +0 -1
  279. package/dist/runtime/step-ownership.js +0 -114
  280. package/dist/runtime/suspension-handler.d.ts.map +0 -1
  281. package/dist/runtime/suspension-handler.js +0 -1562
  282. /package/dist/runtime/{count-step-started-events.d.ts → spec8/count-step-started-events.d.ts} +0 -0
  283. /package/dist/runtime/{open-hook-wait-state.d.ts → spec8/open-hook-wait-state.d.ts} +0 -0
@@ -0,0 +1,437 @@
1
+ import { type CreateEventParams, type Event, type ListEventsParams, type WorkflowRun, type World } from '@workflow/world';
2
+ /**
3
+ * The limits world-vercel puts on one `createBatch` call, the World this fake
4
+ * models: at most 100 events, and at most 768 KiB of frame meta and payloads.
5
+ * They are the World's, held here apart from the runtime's own batch budget
6
+ * (`MAX_IN_BAND_CREATION_BATCH_*` in `runtime/constants.ts`), so a change to
7
+ * that budget, or to how the runtime counts a batch's bytes, cannot raise
8
+ * what this fake accepts along with it.
9
+ */
10
+ export declare const WORLD_EVENT_BATCH_LIMITS: Readonly<{
11
+ maxEvents: 100;
12
+ maxBytes: number;
13
+ }>;
14
+ /**
15
+ * The bytes one batch item takes on the wire, as this fake counts them,
16
+ * independently of the runtime's estimate: its JSON with every binary
17
+ * payload left out, plus each payload's length.
18
+ */
19
+ export declare function eventBatchItemBytes(event: unknown): number;
20
+ /** One `world.queue` call recorded by {@link AppendOnlyWorld}. */
21
+ export interface RecordedQueueCall {
22
+ queueName: string;
23
+ message: unknown;
24
+ opts?: Record<string, unknown>;
25
+ }
26
+ /** A queue message the World holds until a test delivers it. */
27
+ export interface HeldMessage {
28
+ message: unknown;
29
+ messageId: string;
30
+ queueName: string;
31
+ deliveryCount: number;
32
+ createdAt: Date;
33
+ opts?: Record<string, unknown>;
34
+ /** Deliveries of this message that ended in a handoff. */
35
+ handoffCount?: number;
36
+ /**
37
+ * Delivered as the given re-run of a coalesced delivery: the next
38
+ * `deliveryCount` by this many, `attempt` unchanged.
39
+ */
40
+ coalescedRerun?: number;
41
+ /** Passed as `meta.invocationStartedAt`. */
42
+ invocationStartedAt?: number;
43
+ /**
44
+ * When the queue's clock makes the message due (epoch ms): its send time
45
+ * plus its delay, or a redelivery's time plus its `timeoutSeconds`. Read by
46
+ * {@link AppendOnlyWorld.runOnClock}.
47
+ */
48
+ dueAtMs?: number;
49
+ }
50
+ /** One delivery a test made, with what the handler returned. */
51
+ export interface RecordedDelivery {
52
+ message: unknown;
53
+ messageId: string;
54
+ deliveryCount: number;
55
+ result: unknown;
56
+ }
57
+ /** One `events.create` call recorded by {@link AppendOnlyWorld}. */
58
+ export interface RecordedCreate {
59
+ event: Event;
60
+ params?: CreateEventParams;
61
+ }
62
+ /**
63
+ * An in-memory World that keeps no step or wait state: every step and wait
64
+ * event is a plain append, with no exists, terminal, `retryAfter` or
65
+ * `stepName` checks. Run state is checked the way the World contract still
66
+ * asks (writes that start work on a terminal run are refused).
67
+ *
68
+ * It implements the in-band writer fence a World that creates spec 9 runs
69
+ * must: it counts in-band
70
+ * positions, returns `snapshot` from `list`, refuses a stale in-band write
71
+ * with `InBandSupersededError`, and refuses an in-band write without an
72
+ * expected count with a 400. It stores an in-band write at its `occurredAt`,
73
+ * orders a batch per entity, and treats `{ timeoutSeconds: 0 }` as a
74
+ * handoff, as every World does for a single-orchestrator run.
75
+ *
76
+ * It implements the optional parts of the single-orchestrator contract so
77
+ * tests can switch them on and off:
78
+ *
79
+ * - `subscribe`: the live feed.
80
+ * - `reportIncomplete`: answer in-band writes with an incomplete skipped-slot
81
+ * report (`hasMore: true`).
82
+ *
83
+ * Every created event is recorded, so a test can assert what the runtime
84
+ * wrote and with which params.
85
+ */
86
+ export declare class AppendOnlyWorld {
87
+ readonly options: {
88
+ subscribe?: boolean;
89
+ /**
90
+ * How the live feed's `subscribe` fails, as on a World whose push
91
+ * transport is unavailable: `microtask` accepts the subscription and
92
+ * reports an error through `onError` in a microtask; `throw` throws
93
+ * from `subscribe`. Implies `subscribe`.
94
+ */
95
+ subscribeFailure?: 'microtask' | 'throw';
96
+ /** Raw AES-256 key returned for every run, so payloads are encrypted. */
97
+ encryptionKey?: Uint8Array;
98
+ /**
99
+ * Answer creates with a placeholder in place of the payload bytes, as a
100
+ * World that returns payloads as lazy references does. The log keeps
101
+ * the bytes.
102
+ */
103
+ lazyCreatePayloads?: boolean;
104
+ reportIncomplete?: boolean;
105
+ /** Leave `events.createBatch` out, as a World without batch writes. */
106
+ noBatch?: boolean;
107
+ /**
108
+ * Offer `queueBatch`, recorded in {@link AppendOnlyWorld.queueBatches}.
109
+ * Each message is published as a single `queue` call would be. A throw
110
+ * from `failQueueBatch` fails that call whole.
111
+ */
112
+ queueBatch?: boolean;
113
+ /** Called with each `queueBatch` call's messages before it publishes. */
114
+ failQueueBatch?: (messages: readonly {
115
+ message: unknown;
116
+ opts?: unknown;
117
+ }[]) => void | Promise<void>;
118
+ /**
119
+ * Answer every `events.create` and `events.createBatch` this many
120
+ * milliseconds late, after committing, as a remote World's round trip.
121
+ */
122
+ createDelayMs?: number;
123
+ /**
124
+ * Hook tokens another run already holds: a `hook_created` for one of
125
+ * them commits `hook_conflict` instead, as a World with a token index
126
+ * does.
127
+ */
128
+ takenHookTokens?: readonly string[];
129
+ /**
130
+ * Honor `resolveData: 'skip-step-inputs'` on replay pages (list pages
131
+ * and skipped-slot reports): `step_created` and `step_started` are
132
+ * served without `input`. The log and the created event keep it.
133
+ */
134
+ skipStepInputs?: boolean;
135
+ /**
136
+ * Whether a handoff (`{ timeoutSeconds: 0 }`) of `held` continues on a
137
+ * new message instead, as world-vercel does for a message close to its
138
+ * expiry: the held message is acknowledged, and a new one (fresh id,
139
+ * first delivery) is held in its place, with the payload
140
+ * `singleOrchestratorContinuationPayload` builds from the held one.
141
+ */
142
+ rotateHandoff?: (held: HeldMessage) => boolean;
143
+ /**
144
+ * Called with the delay of every `{ timeoutSeconds }` result, so a
145
+ * test with fake timers can let that time pass before the redelivery.
146
+ */
147
+ advanceClock?: (seconds: number) => void;
148
+ /**
149
+ * Coalesce like a VQS concurrency key: a keyed message (an orchestrator
150
+ * message by `orchestratorRunIdOf`, so not a step message and not an
151
+ * intermediate wait hop) enqueued undelayed while one of the run's
152
+ * orchestrator deliveries runs is not held but counted on that
153
+ * delivery, and a delivery that would acknowledge with messages
154
+ * counted runs its handler again until none are, each re-run with the
155
+ * next `deliveryCount` and the same `attempt`, as world-vercel reports
156
+ * one. A delayed message is held; a test that lets one come due while
157
+ * a delivery runs calls {@link AppendOnlyWorld.comeDue}.
158
+ */
159
+ coalesce?: boolean;
160
+ /**
161
+ * In `coalesce` mode, the most re-runs of one delivery; past them the
162
+ * message is handed off (redelivered, not counted as an attempt), as
163
+ * world-vercel does. Unbounded when absent.
164
+ */
165
+ maxCoalescedReruns?: number;
166
+ /**
167
+ * Called before every `events.create`, before anything is checked or
168
+ * written. A test throws from it to refuse a write, or awaits in it to
169
+ * hold one back.
170
+ */
171
+ beforeCreate?: (data: {
172
+ eventType: string;
173
+ eventData?: Record<string, unknown>;
174
+ }, params: CreateEventParams | undefined,
175
+ /** Whether the event is an item of a `createBatch` call. */
176
+ source?: {
177
+ batch: boolean;
178
+ }) => void | Promise<void>;
179
+ /**
180
+ * Called before every `events.list`, after the call is recorded. A test
181
+ * awaits in it to hold a read back, as a remote World's read that is
182
+ * held in transit.
183
+ */
184
+ beforeList?: (params: ListEventsParams) => void | Promise<void>;
185
+ /**
186
+ * How long the queue deduplicates an idempotency key after the send
187
+ * that made it held a message, in ms of the (possibly faked) system
188
+ * clock, whether that message is still held, being delivered, or was
189
+ * acknowledged. Past it a send under the key is a new message, as on a
190
+ * queue with a finite dedupe window (world-vercel's is 24 hours).
191
+ * Absent: a key is deduplicated for as long as the fake lives.
192
+ */
193
+ keyDedupeWindowMs?: number;
194
+ };
195
+ readonly events: Event[];
196
+ readonly creates: RecordedCreate[];
197
+ readonly queueCalls: RecordedQueueCall[];
198
+ /** Messages enqueued and not yet acknowledged. */
199
+ readonly held: HeldMessage[];
200
+ readonly deliveries: RecordedDelivery[];
201
+ /** The event types of every `createBatch` call, in call order. */
202
+ readonly batches: string[][];
203
+ /**
204
+ * The messages of every `queueBatch` call (with the `queueBatch` option),
205
+ * in call order. Each message is also recorded in {@link queueCalls}.
206
+ */
207
+ readonly queueBatches: RecordedQueueCall[][];
208
+ /**
209
+ * Every in-band write's named position and first slot, in call order: how
210
+ * many positions its skipped-slot report covered.
211
+ */
212
+ readonly reportSpans: {
213
+ eventCount: number;
214
+ firstSlot: number;
215
+ }[];
216
+ /** How many `events.create` and `events.createBatch` calls were made. */
217
+ createCalls: number;
218
+ /** The params of every `events.list` call. */
219
+ readonly listCalls: Array<Record<string, unknown>>;
220
+ /** Replay events served without their step input (`skipStepInputs`). */
221
+ strippedStepInputs: number;
222
+ private handler;
223
+ seq: number;
224
+ seqInBand: number;
225
+ private readonly subscribers;
226
+ private run;
227
+ /** The orchestrator delivery in flight, in `coalesce` mode. */
228
+ private activeOrchestrator;
229
+ /** How many messages were coalesced into a delivery, in `coalesce` mode. */
230
+ coalescedMessages: number;
231
+ /** Deliveries handed off past `maxCoalescedReruns`, in `coalesce` mode. */
232
+ coalescedHandoffs: number;
233
+ /** Handoffs continued on a new message (see `rotateHandoff`). */
234
+ rotations: number;
235
+ /** Messages a test enqueued (see `enqueue`), for their unique ids. */
236
+ private enqueued;
237
+ /** Idempotency keys of the messages being delivered, with their counts. */
238
+ private readonly deliveringKeys;
239
+ /**
240
+ * Idempotency keys of acknowledged messages. A queue keeps a key past the
241
+ * message's acknowledgment (Vercel Queues for `min(retention, 24h)`), so a
242
+ * late send under it is dropped too.
243
+ */
244
+ private readonly acknowledgedKeys;
245
+ /** When each idempotency key was last sent as a new message (epoch ms). */
246
+ private readonly keySentAtMs;
247
+ constructor(options?: {
248
+ subscribe?: boolean;
249
+ /**
250
+ * How the live feed's `subscribe` fails, as on a World whose push
251
+ * transport is unavailable: `microtask` accepts the subscription and
252
+ * reports an error through `onError` in a microtask; `throw` throws
253
+ * from `subscribe`. Implies `subscribe`.
254
+ */
255
+ subscribeFailure?: 'microtask' | 'throw';
256
+ /** Raw AES-256 key returned for every run, so payloads are encrypted. */
257
+ encryptionKey?: Uint8Array;
258
+ /**
259
+ * Answer creates with a placeholder in place of the payload bytes, as a
260
+ * World that returns payloads as lazy references does. The log keeps
261
+ * the bytes.
262
+ */
263
+ lazyCreatePayloads?: boolean;
264
+ reportIncomplete?: boolean;
265
+ /** Leave `events.createBatch` out, as a World without batch writes. */
266
+ noBatch?: boolean;
267
+ /**
268
+ * Offer `queueBatch`, recorded in {@link AppendOnlyWorld.queueBatches}.
269
+ * Each message is published as a single `queue` call would be. A throw
270
+ * from `failQueueBatch` fails that call whole.
271
+ */
272
+ queueBatch?: boolean;
273
+ /** Called with each `queueBatch` call's messages before it publishes. */
274
+ failQueueBatch?: (messages: readonly {
275
+ message: unknown;
276
+ opts?: unknown;
277
+ }[]) => void | Promise<void>;
278
+ /**
279
+ * Answer every `events.create` and `events.createBatch` this many
280
+ * milliseconds late, after committing, as a remote World's round trip.
281
+ */
282
+ createDelayMs?: number;
283
+ /**
284
+ * Hook tokens another run already holds: a `hook_created` for one of
285
+ * them commits `hook_conflict` instead, as a World with a token index
286
+ * does.
287
+ */
288
+ takenHookTokens?: readonly string[];
289
+ /**
290
+ * Honor `resolveData: 'skip-step-inputs'` on replay pages (list pages
291
+ * and skipped-slot reports): `step_created` and `step_started` are
292
+ * served without `input`. The log and the created event keep it.
293
+ */
294
+ skipStepInputs?: boolean;
295
+ /**
296
+ * Whether a handoff (`{ timeoutSeconds: 0 }`) of `held` continues on a
297
+ * new message instead, as world-vercel does for a message close to its
298
+ * expiry: the held message is acknowledged, and a new one (fresh id,
299
+ * first delivery) is held in its place, with the payload
300
+ * `singleOrchestratorContinuationPayload` builds from the held one.
301
+ */
302
+ rotateHandoff?: (held: HeldMessage) => boolean;
303
+ /**
304
+ * Called with the delay of every `{ timeoutSeconds }` result, so a
305
+ * test with fake timers can let that time pass before the redelivery.
306
+ */
307
+ advanceClock?: (seconds: number) => void;
308
+ /**
309
+ * Coalesce like a VQS concurrency key: a keyed message (an orchestrator
310
+ * message by `orchestratorRunIdOf`, so not a step message and not an
311
+ * intermediate wait hop) enqueued undelayed while one of the run's
312
+ * orchestrator deliveries runs is not held but counted on that
313
+ * delivery, and a delivery that would acknowledge with messages
314
+ * counted runs its handler again until none are, each re-run with the
315
+ * next `deliveryCount` and the same `attempt`, as world-vercel reports
316
+ * one. A delayed message is held; a test that lets one come due while
317
+ * a delivery runs calls {@link AppendOnlyWorld.comeDue}.
318
+ */
319
+ coalesce?: boolean;
320
+ /**
321
+ * In `coalesce` mode, the most re-runs of one delivery; past them the
322
+ * message is handed off (redelivered, not counted as an attempt), as
323
+ * world-vercel does. Unbounded when absent.
324
+ */
325
+ maxCoalescedReruns?: number;
326
+ /**
327
+ * Called before every `events.create`, before anything is checked or
328
+ * written. A test throws from it to refuse a write, or awaits in it to
329
+ * hold one back.
330
+ */
331
+ beforeCreate?: (data: {
332
+ eventType: string;
333
+ eventData?: Record<string, unknown>;
334
+ }, params: CreateEventParams | undefined,
335
+ /** Whether the event is an item of a `createBatch` call. */
336
+ source?: {
337
+ batch: boolean;
338
+ }) => void | Promise<void>;
339
+ /**
340
+ * Called before every `events.list`, after the call is recorded. A test
341
+ * awaits in it to hold a read back, as a remote World's read that is
342
+ * held in transit.
343
+ */
344
+ beforeList?: (params: ListEventsParams) => void | Promise<void>;
345
+ /**
346
+ * How long the queue deduplicates an idempotency key after the send
347
+ * that made it held a message, in ms of the (possibly faked) system
348
+ * clock, whether that message is still held, being delivered, or was
349
+ * acknowledged. Past it a send under the key is a new message, as on a
350
+ * queue with a finite dedupe window (world-vercel's is 24 hours).
351
+ * Absent: a key is deduplicated for as long as the fake lives.
352
+ */
353
+ keyDedupeWindowMs?: number;
354
+ });
355
+ /** Seed a run as if `run_created` had been written. */
356
+ seedRun(run: Omit<WorkflowRun, 'specVersion'> & {
357
+ specVersion?: number;
358
+ }): void;
359
+ /**
360
+ * Seed a run with an existing log, as a fresh process would find it: the
361
+ * events keep their ids, and every position counts as in-band, so the next
362
+ * orchestrator delivery adopts it all from the snapshot.
363
+ */
364
+ seedLog(run: Omit<WorkflowRun, 'specVersion'> & {
365
+ specVersion?: number;
366
+ }, events: readonly Event[]): void;
367
+ /**
368
+ * A `run_started` for a run this World never saw (`run_created` did not
369
+ * land) creates the run from the creation data it carries, as a World does
370
+ * for resilient start. The creation counts as the run's first in-band
371
+ * position.
372
+ */
373
+ private createRunFromStart;
374
+ /** Append an event as an out-of-band writer would. */
375
+ appendOutOfBand(event: Partial<Event>): Event;
376
+ /**
377
+ * The step-event shape a single-orchestrator World requires (world-vercel
378
+ * refuses it otherwise): every step event names its step, and a start,
379
+ * retry or failure carries the attempt.
380
+ */
381
+ private checkStepEventData;
382
+ private append;
383
+ private applyToRun;
384
+ private checkFence;
385
+ private checkRunAcceptsWork;
386
+ private report;
387
+ /** Replay events as a page with `resolveData` serves them. */
388
+ private served;
389
+ /** The event a `hook_created` create commits. */
390
+ private committedHook;
391
+ /**
392
+ * Deliver one held message to the registered queue handler, the way a
393
+ * queue would: a `{ timeoutSeconds }` result keeps the same message (same
394
+ * id, next delivery count); anything else acknowledges it; a rejection
395
+ * keeps it too.
396
+ */
397
+ deliver(held: HeldMessage): Promise<unknown>;
398
+ /**
399
+ * Lets a held (delayed) message come due now, as the queue's clock would.
400
+ * In `coalesce` mode, a keyed one (see `coalesce`) that comes due while an
401
+ * orchestrator delivery of the run runs is coalesced into it: no longer
402
+ * held, never delivered, and counted on that delivery, which runs again.
403
+ * Returns whether it was coalesced; otherwise it stays held for the test
404
+ * to deliver.
405
+ */
406
+ comeDue(held: HeldMessage): boolean;
407
+ private deliverOnce;
408
+ private deliverOnceKeyed;
409
+ /** Enqueue a message as `start()` or a test would. */
410
+ enqueue(queueName: string, message: unknown): HeldMessage;
411
+ /**
412
+ * Deliver held messages, oldest first, until none is left or `limit`
413
+ * deliveries were made. Delays are ignored.
414
+ */
415
+ runUntilIdle(limit?: number): Promise<void>;
416
+ /**
417
+ * Deliver held messages in the order the queue's clock makes them due,
418
+ * moving the (faked) system clock to each one's due time
419
+ * (`HeldMessage.dueAtMs`), until none is left or `limit` deliveries were
420
+ * made. Among messages due at the same time, `prefer` picks which go first
421
+ * (oldest first otherwise): an orchestrator wake ahead of a step message
422
+ * gives each step outcome its own orchestrator delivery. `deliverAs`
423
+ * changes how a message is delivered (as a coalesced re-run, say). Needs a
424
+ * faked `Date` (`vi.useFakeTimers({ toFake: ['Date'] })`).
425
+ */
426
+ runOnClock(options?: {
427
+ limit?: number;
428
+ prefer?: (held: HeldMessage) => boolean;
429
+ deliverAs?: (held: HeldMessage) => HeldMessage;
430
+ }): Promise<void>;
431
+ /** The created event as a create response carries it. */
432
+ private responseEvent;
433
+ /** Commits a batch write; see `createBatch` in {@link asWorld}. */
434
+ private commitBatch;
435
+ asWorld(): World;
436
+ }
437
+ //# sourceMappingURL=append-only-world.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"append-only-world.d.ts","sourceRoot":"","sources":["../../src/test-support/append-only-world.ts"],"names":[],"mappings":"AAKA,OAAO,EAEL,KAAK,iBAAiB,EACtB,KAAK,KAAK,EAGV,KAAK,gBAAgB,EAMrB,KAAK,WAAW,EAChB,KAAK,KAAK,EACX,MAAM,iBAAiB,CAAC;AAGzB;;;;;;;GAOG;AACH,eAAO,MAAM,wBAAwB;;;EAGnC,CAAC;AAEH;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAU1D;AAED,kEAAkE;AAClE,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAChC;AAED,gEAAgE;AAChE,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,IAAI,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,0DAA0D;IAC1D,YAAY,CA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