@workflow/core 5.0.0-beta.50 → 5.0.0-beta.51
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.
- package/README.md +5 -0
- package/dist/events-consumer.d.ts +26 -0
- package/dist/events-consumer.d.ts.map +1 -1
- package/dist/events-consumer.js +28 -1
- package/dist/flushable-stream.d.ts +41 -0
- package/dist/flushable-stream.d.ts.map +1 -1
- package/dist/flushable-stream.js +169 -1
- package/dist/log-format.js +13 -6
- package/dist/replay-divergence.d.ts +25 -0
- package/dist/replay-divergence.d.ts.map +1 -0
- package/dist/replay-divergence.js +61 -0
- package/dist/runtime/helpers.d.ts +75 -1
- package/dist/runtime/helpers.d.ts.map +1 -1
- package/dist/runtime/helpers.js +129 -2
- package/dist/runtime/quickjs-entrypoint.d.ts +30 -8
- package/dist/runtime/quickjs-entrypoint.d.ts.map +1 -1
- package/dist/runtime/quickjs-entrypoint.js +209 -32
- package/dist/runtime/quickjs-log-view.d.ts +129 -0
- package/dist/runtime/quickjs-log-view.d.ts.map +1 -0
- package/dist/runtime/quickjs-log-view.js +229 -0
- package/dist/runtime/step-executor.d.ts +2 -21
- package/dist/runtime/step-executor.d.ts.map +1 -1
- package/dist/runtime/step-executor.js +85 -80
- package/dist/runtime/suspension-handler.d.ts +0 -22
- package/dist/runtime/suspension-handler.d.ts.map +1 -1
- package/dist/runtime/suspension-handler.js +126 -75
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +262 -91
- package/dist/serialization.d.ts +2 -2
- package/dist/serialization.d.ts.map +1 -1
- package/dist/serialization.js +16 -13
- package/dist/step/context-storage.d.ts +2 -0
- package/dist/step/context-storage.d.ts.map +1 -1
- package/dist/step/context-storage.js +1 -1
- package/dist/step/writable-stream.d.ts.map +1 -1
- package/dist/step/writable-stream.js +14 -10
- package/dist/telemetry/semantic-conventions.d.ts +36 -0
- package/dist/telemetry/semantic-conventions.d.ts.map +1 -1
- package/dist/telemetry/semantic-conventions.js +23 -1
- package/dist/test-support/orchestrator-context.d.ts.map +1 -1
- package/dist/test-support/orchestrator-context.js +8 -2
- package/dist/version.d.ts +1 -1
- package/dist/version.js +2 -2
- package/dist/workflow.d.ts.map +1 -1
- package/dist/workflow.js +8 -3
- package/docs/foundations/streaming.mdx +1 -1
- package/docs/how-it-works/event-sourcing.mdx +27 -0
- package/package.json +6 -6
|
@@ -38,14 +38,29 @@ export declare function isFirstInvocation(preloadedEvents: readonly Event[] | un
|
|
|
38
38
|
* This replaces the `node:vm` replay path (runWorkflow + EventsConsumer)
|
|
39
39
|
* with a QuickJS VM invocation that performs the same full event replay.
|
|
40
40
|
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
41
|
+
* Log position on writes. This engine follows the same rule as the node:vm
|
|
42
|
+
* replay loop for which writes tell the World where the writer stood (see the
|
|
43
|
+
* "Who names a position" table above `slotSnapshotParams` in `helpers.ts`):
|
|
44
|
+
*
|
|
45
|
+
* - Writes made from this invocation's view of the log (`step_created`,
|
|
46
|
+
* `wait_created`, `hook_created`, `hook_disposed`, `attr_set`, the abort
|
|
47
|
+
* `hook_received`, `wait_completed`, and the `step_created` + `step_failed`
|
|
48
|
+
* pair for an unserializable input) carry `eventCount`, and the page a
|
|
49
|
+
* World hands back is queued for the live VM through {@link QuickJSLogView}.
|
|
50
|
+
* - A single inline step's terminal write asks for the inline delta
|
|
51
|
+
* (`sinceCursor`) through `executeStep`, and so does a lone `hook_created`
|
|
52
|
+
* (see `dispatchPendingOps.deltaCursor`); the delta is queued the same
|
|
53
|
+
* way. The step executor's other writes carry nothing: it holds no log.
|
|
54
|
+
* - Run-terminal writes (`run_completed`, `run_failed`) and the terminal drain
|
|
55
|
+
* of pending ops carry nothing: nothing reads the log afterwards.
|
|
56
|
+
*
|
|
57
|
+
* What differs from the node engine is what "merge into the log" means. The
|
|
58
|
+
* node engine merges a returned page into the array it replays from. This
|
|
59
|
+
* engine holds a live VM that consumes events exactly once, in position
|
|
60
|
+
* order, so a returned page is queued and delivered ahead of the next
|
|
61
|
+
* `events.list`, which then only runs when the queue cannot account for the
|
|
62
|
+
* next position. Both engines fall back to a list for anything a page did
|
|
63
|
+
* not carry.
|
|
49
64
|
*/
|
|
50
65
|
export declare function runWorkflowWithQuickJS(params: {
|
|
51
66
|
workflowCode: string;
|
|
@@ -67,6 +82,13 @@ export declare function runWorkflowWithQuickJS(params: {
|
|
|
67
82
|
* hook-resume preload would be discarded and refetched.
|
|
68
83
|
*/
|
|
69
84
|
preloadedEventsComplete?: boolean;
|
|
85
|
+
/**
|
|
86
|
+
* The `events.list` cursor positioned after the last of `preloadedEvents`,
|
|
87
|
+
* when the caller has one. Lets this invocation read incrementally from
|
|
88
|
+
* where the preload ended and ask for an inline delta against it. Without
|
|
89
|
+
* it the first read after the preload starts from the top of the log.
|
|
90
|
+
*/
|
|
91
|
+
preloadedCursor?: string | null;
|
|
70
92
|
/**
|
|
71
93
|
* Run input carried through the queue message on first delivery. Used
|
|
72
94
|
* as a last-resort fallback for `run_created.eventData.input` when
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quickjs-entrypoint.d.ts","sourceRoot":"","sources":["../../src/runtime/quickjs-entrypoint.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAS/C,OAAO,
|
|
1
|
+
{"version":3,"file":"quickjs-entrypoint.d.ts","sourceRoot":"","sources":["../../src/runtime/quickjs-entrypoint.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAS/C,OAAO,EAGL,KAAK,KAAK,EAGV,KAAK,QAAQ,EAIb,KAAK,WAAW,EACjB,MAAM,iBAAiB,CAAC;AA4DzB;;;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