@workflow/core 5.0.0-beta.5 → 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/attribute-changes.d.ts +5 -0
- package/dist/attribute-changes.d.ts.map +1 -0
- package/dist/attribute-changes.js +25 -0
- package/dist/capabilities.d.ts +35 -2
- package/dist/capabilities.d.ts.map +1 -1
- package/dist/capabilities.js +74 -5
- package/dist/capture-stack.d.ts +1 -1
- package/dist/capture-stack.js +2 -2
- package/dist/class-serialization.d.ts +32 -0
- package/dist/class-serialization.d.ts.map +1 -1
- package/dist/class-serialization.js +37 -1
- package/dist/classify-error.d.ts +19 -3
- package/dist/classify-error.d.ts.map +1 -1
- package/dist/classify-error.js +98 -6
- package/dist/context-violation-error.d.ts +5 -5
- package/dist/context-violation-error.d.ts.map +1 -1
- package/dist/context-violation-error.js +8 -6
- package/dist/create-hook.d.ts +72 -7
- package/dist/create-hook.d.ts.map +1 -1
- package/dist/create-hook.js +1 -1
- package/dist/define-hook.js +2 -2
- package/dist/describe-error.d.ts +7 -7
- package/dist/describe-error.d.ts.map +1 -1
- package/dist/describe-error.js +97 -12
- package/dist/encryption.d.ts +38 -4
- package/dist/encryption.d.ts.map +1 -1
- package/dist/encryption.js +96 -14
- package/dist/events-consumer.d.ts +297 -0
- package/dist/events-consumer.d.ts.map +1 -1
- package/dist/events-consumer.js +673 -42
- package/dist/flushable-stream.d.ts +97 -1
- package/dist/flushable-stream.d.ts.map +1 -1
- package/dist/flushable-stream.js +291 -11
- package/dist/global.d.ts +36 -2
- package/dist/global.d.ts.map +1 -1
- package/dist/global.js +21 -6
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/dist/log-format.d.ts +2 -2
- package/dist/log-format.js +19 -12
- package/dist/logger.d.ts +1 -0
- package/dist/logger.d.ts.map +1 -1
- package/dist/logger.js +10 -6
- package/dist/private.d.ts +226 -9
- package/dist/private.d.ts.map +1 -1
- package/dist/private.js +626 -7
- 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/replay-payload-cache.d.ts +64 -0
- package/dist/replay-payload-cache.d.ts.map +1 -0
- package/dist/replay-payload-cache.js +158 -0
- package/dist/runtime/compute-instance.d.ts +13 -0
- package/dist/runtime/compute-instance.d.ts.map +1 -0
- package/dist/runtime/compute-instance.js +14 -0
- package/dist/runtime/constants.d.ts +315 -0
- package/dist/runtime/constants.d.ts.map +1 -1
- package/dist/runtime/constants.js +502 -16
- package/dist/runtime/count-step-started-events.d.ts +52 -0
- package/dist/runtime/count-step-started-events.d.ts.map +1 -0
- package/dist/runtime/count-step-started-events.js +72 -0
- package/dist/runtime/deployment-guard.d.ts +99 -0
- package/dist/runtime/deployment-guard.d.ts.map +1 -0
- package/dist/runtime/deployment-guard.js +154 -0
- package/dist/runtime/get-port-lazy.d.ts +15 -0
- package/dist/runtime/get-port-lazy.d.ts.map +1 -1
- package/dist/runtime/get-port-lazy.js +75 -6
- package/dist/runtime/get-world-lazy.d.ts +5 -14
- package/dist/runtime/get-world-lazy.d.ts.map +1 -1
- package/dist/runtime/get-world-lazy.js +19 -29
- package/dist/runtime/helpers.d.ts +415 -29
- package/dist/runtime/helpers.d.ts.map +1 -1
- package/dist/runtime/helpers.js +686 -57
- package/dist/runtime/quickjs-assets.generated.d.ts +14 -0
- package/dist/runtime/quickjs-assets.generated.d.ts.map +1 -0
- package/dist/runtime/quickjs-assets.generated.js +30 -0
- package/dist/runtime/quickjs-entrypoint.d.ts +158 -0
- package/dist/runtime/quickjs-entrypoint.d.ts.map +1 -0
- package/dist/runtime/quickjs-entrypoint.js +1863 -0
- 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/quickjs-runtime.d.ts +244 -0
- package/dist/runtime/quickjs-runtime.d.ts.map +1 -0
- package/dist/runtime/quickjs-runtime.js +2427 -0
- package/dist/runtime/quickjs-serde.d.ts +107 -0
- package/dist/runtime/quickjs-serde.d.ts.map +1 -0
- package/dist/runtime/quickjs-serde.js +2159 -0
- package/dist/runtime/replay-budget.d.ts +97 -0
- package/dist/runtime/replay-budget.d.ts.map +1 -0
- package/dist/runtime/replay-budget.js +139 -0
- package/dist/runtime/replay-recovery-reporter.d.ts +36 -0
- package/dist/runtime/replay-recovery-reporter.d.ts.map +1 -0
- package/dist/runtime/replay-recovery-reporter.js +64 -0
- package/dist/runtime/resume-hook.d.ts +91 -8
- package/dist/runtime/resume-hook.d.ts.map +1 -1
- package/dist/runtime/resume-hook.js +512 -89
- package/dist/runtime/resume-latency.d.ts +150 -0
- package/dist/runtime/resume-latency.d.ts.map +1 -0
- package/dist/runtime/resume-latency.js +155 -0
- package/dist/runtime/run-id-time.d.ts +19 -0
- package/dist/runtime/run-id-time.d.ts.map +1 -0
- package/dist/runtime/run-id-time.js +42 -0
- package/dist/runtime/run.d.ts +72 -7
- package/dist/runtime/run.d.ts.map +1 -1
- package/dist/runtime/run.js +280 -53
- package/dist/runtime/runs.d.ts +54 -3
- package/dist/runtime/runs.d.ts.map +1 -1
- package/dist/runtime/runs.js +126 -16
- package/dist/runtime/start.d.ts +101 -2
- package/dist/runtime/start.d.ts.map +1 -1
- package/dist/runtime/start.js +352 -61
- package/dist/runtime/step-executor.d.ts +186 -5
- package/dist/runtime/step-executor.d.ts.map +1 -1
- package/dist/runtime/step-executor.js +768 -130
- package/dist/runtime/step-latency.d.ts +220 -0
- package/dist/runtime/step-latency.d.ts.map +1 -0
- package/dist/runtime/step-latency.js +215 -0
- package/dist/runtime/step-ownership.d.ts +72 -0
- package/dist/runtime/step-ownership.d.ts.map +1 -0
- package/dist/runtime/step-ownership.js +114 -0
- package/dist/runtime/step-single-flight.d.ts +12 -0
- package/dist/runtime/step-single-flight.d.ts.map +1 -0
- package/dist/runtime/step-single-flight.js +75 -0
- package/dist/runtime/suspension-handler.d.ts +247 -7
- package/dist/runtime/suspension-handler.d.ts.map +1 -1
- package/dist/runtime/suspension-handler.js +1304 -125
- package/dist/runtime/unserializable-step.d.ts +34 -0
- package/dist/runtime/unserializable-step.d.ts.map +1 -0
- package/dist/runtime/unserializable-step.js +52 -0
- package/dist/runtime/vm-mode.d.ts +44 -0
- package/dist/runtime/vm-mode.d.ts.map +1 -0
- package/dist/runtime/vm-mode.js +62 -0
- package/dist/runtime/vm-serde-bundle.generated.d.ts +14 -0
- package/dist/runtime/vm-serde-bundle.generated.d.ts.map +1 -0
- package/dist/runtime/vm-serde-bundle.generated.js +16 -0
- package/dist/runtime/wait-continuation.d.ts +106 -0
- package/dist/runtime/wait-continuation.d.ts.map +1 -0
- package/dist/runtime/wait-continuation.js +136 -0
- package/dist/runtime/wait-until.d.ts +18 -0
- package/dist/runtime/wait-until.d.ts.map +1 -0
- package/dist/runtime/wait-until.js +42 -0
- package/dist/runtime/world-compatibility.d.ts +32 -0
- package/dist/runtime/world-compatibility.d.ts.map +1 -0
- package/dist/runtime/world-compatibility.js +44 -0
- package/dist/runtime/world-init.d.ts +17 -42
- package/dist/runtime/world-init.d.ts.map +1 -1
- package/dist/runtime/world-init.js +18 -43
- package/dist/runtime/world.d.ts +14 -2
- package/dist/runtime/world.d.ts.map +1 -1
- package/dist/runtime/world.js +75 -19
- package/dist/runtime.d.ts +10 -6
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +3911 -489
- package/dist/sealed-box.d.ts +167 -0
- package/dist/sealed-box.d.ts.map +1 -0
- package/dist/sealed-box.js +571 -0
- package/dist/serialization/client.d.ts +3 -3
- package/dist/serialization/client.d.ts.map +1 -1
- package/dist/serialization/client.js +8 -4
- package/dist/serialization/codec-devalue-vm.d.ts +16 -0
- package/dist/serialization/codec-devalue-vm.d.ts.map +1 -0
- package/dist/serialization/codec-devalue-vm.js +148 -0
- package/dist/serialization/codec-devalue.d.ts +1 -1
- package/dist/serialization/codec-devalue.d.ts.map +1 -1
- package/dist/serialization/codec-devalue.js +24 -6
- package/dist/serialization/codec.d.ts +37 -2
- package/dist/serialization/codec.d.ts.map +1 -1
- package/dist/serialization/codec.js +2 -2
- package/dist/serialization/compression.d.ts +105 -0
- package/dist/serialization/compression.d.ts.map +1 -0
- package/dist/serialization/compression.js +261 -0
- package/dist/serialization/encryption.d.ts +119 -17
- package/dist/serialization/encryption.d.ts.map +1 -1
- package/dist/serialization/encryption.js +152 -17
- package/dist/serialization/errors.d.ts +13 -0
- package/dist/serialization/errors.d.ts.map +1 -1
- package/dist/serialization/errors.js +20 -2
- package/dist/serialization/format.d.ts +6 -6
- package/dist/serialization/format.js +7 -7
- package/dist/serialization/hardened.d.ts +156 -0
- package/dist/serialization/hardened.d.ts.map +1 -0
- package/dist/serialization/hardened.js +538 -0
- package/dist/serialization/index.d.ts +10 -8
- package/dist/serialization/index.d.ts.map +1 -1
- package/dist/serialization/index.js +10 -8
- package/dist/serialization/reducers/class-vm.d.ts +20 -0
- package/dist/serialization/reducers/class-vm.d.ts.map +1 -0
- package/dist/serialization/reducers/class-vm.js +77 -0
- package/dist/serialization/reducers/class.d.ts.map +1 -1
- package/dist/serialization/reducers/class.js +11 -6
- package/dist/serialization/reducers/common-vm.d.ts +15 -0
- package/dist/serialization/reducers/common-vm.d.ts.map +1 -0
- package/dist/serialization/reducers/common-vm.js +616 -0
- package/dist/serialization/reducers/common.d.ts +1 -1
- package/dist/serialization/reducers/common.d.ts.map +1 -1
- package/dist/serialization/reducers/common.js +202 -62
- package/dist/serialization/reducers/step-function-vm.d.ts +44 -0
- package/dist/serialization/reducers/step-function-vm.d.ts.map +1 -0
- package/dist/serialization/reducers/step-function-vm.js +97 -0
- package/dist/serialization/reducers/step-function.d.ts.map +1 -1
- package/dist/serialization/reducers/step-function.js +25 -9
- package/dist/serialization/step.d.ts +4 -4
- package/dist/serialization/step.d.ts.map +1 -1
- package/dist/serialization/step.js +9 -5
- package/dist/serialization/types.d.ts +80 -1
- package/dist/serialization/types.d.ts.map +1 -1
- package/dist/serialization/types.js +15 -1
- package/dist/serialization/workflow-vm.d.ts +29 -0
- package/dist/serialization/workflow-vm.d.ts.map +1 -0
- package/dist/serialization/workflow-vm.js +74 -0
- package/dist/serialization-format.d.ts +64 -8
- package/dist/serialization-format.d.ts.map +1 -1
- package/dist/serialization-format.js +225 -73
- package/dist/serialization.d.ts +262 -34
- package/dist/serialization.d.ts.map +1 -1
- package/dist/serialization.js +1885 -277
- package/dist/set-attributes.d.ts +13 -0
- package/dist/set-attributes.d.ts.map +1 -0
- package/dist/set-attributes.js +60 -0
- package/dist/source-map.d.ts +25 -0
- package/dist/source-map.d.ts.map +1 -1
- package/dist/source-map.js +154 -10
- package/dist/step/context-storage.d.ts +63 -2
- package/dist/step/context-storage.d.ts.map +1 -1
- package/dist/step/context-storage.js +7 -5
- package/dist/step/writable-stream.d.ts +3 -3
- package/dist/step/writable-stream.d.ts.map +1 -1
- package/dist/step/writable-stream.js +80 -13
- package/dist/step.d.ts.map +1 -1
- package/dist/step.js +148 -27
- package/dist/symbols.d.ts +50 -0
- package/dist/symbols.d.ts.map +1 -1
- package/dist/symbols.js +51 -1
- package/dist/telemetry/semantic-conventions.d.ts +433 -2
- package/dist/telemetry/semantic-conventions.d.ts.map +1 -1
- package/dist/telemetry/semantic-conventions.js +319 -3
- package/dist/telemetry.d.ts +91 -0
- package/dist/telemetry.d.ts.map +1 -1
- package/dist/telemetry.js +244 -17
- package/dist/test-support/orchestrator-context.d.ts +25 -0
- package/dist/test-support/orchestrator-context.d.ts.map +1 -0
- package/dist/test-support/orchestrator-context.js +107 -0
- package/dist/types.d.ts +6 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +23 -1
- package/dist/util.d.ts +0 -5
- package/dist/util.d.ts.map +1 -1
- package/dist/util.js +1 -15
- package/dist/version.d.ts +1 -1
- package/dist/version.d.ts.map +1 -1
- package/dist/version.js +2 -2
- package/dist/vm/index.d.ts.map +1 -1
- package/dist/vm/index.js +84 -14
- package/dist/vm/script-cache.d.ts +26 -0
- package/dist/vm/script-cache.d.ts.map +1 -0
- package/dist/vm/script-cache.js +131 -0
- package/dist/vm/uint8array-base64.js +1 -1
- package/dist/workflow/abort-controller.d.ts +2 -2
- package/dist/workflow/abort-controller.d.ts.map +1 -1
- package/dist/workflow/abort-controller.js +88 -21
- package/dist/workflow/attribute-dispatcher.d.ts +6 -0
- package/dist/workflow/attribute-dispatcher.d.ts.map +1 -0
- package/dist/workflow/attribute-dispatcher.js +45 -0
- package/dist/workflow/create-hook.d.ts.map +1 -1
- package/dist/workflow/create-hook.js +24 -3
- package/dist/workflow/get-workflow-metadata.js +2 -2
- package/dist/workflow/hook.d.ts.map +1 -1
- package/dist/workflow/hook.js +304 -47
- package/dist/workflow/index.d.ts +1 -0
- package/dist/workflow/index.d.ts.map +1 -1
- package/dist/workflow/index.js +2 -1
- package/dist/workflow/set-attributes.d.ts +68 -0
- package/dist/workflow/set-attributes.d.ts.map +1 -0
- package/dist/workflow/set-attributes.js +60 -0
- package/dist/workflow/sleep.d.ts.map +1 -1
- package/dist/workflow/sleep.js +58 -12
- package/dist/workflow/world-init-stub.d.ts +3 -3
- package/dist/workflow/world-init-stub.js +4 -4
- package/dist/workflow.d.ts +95 -3
- package/dist/workflow.d.ts.map +1 -1
- package/dist/workflow.js +900 -561
- package/docs/api-reference/create-hook.mdx +89 -10
- package/docs/api-reference/create-webhook.mdx +16 -15
- package/docs/api-reference/define-hook.mdx +35 -33
- package/docs/api-reference/fatal-error.mdx +30 -8
- package/docs/api-reference/fetch.mdx +14 -10
- package/docs/api-reference/get-step-metadata.mdx +2 -2
- package/docs/api-reference/get-workflow-metadata.mdx +3 -3
- package/docs/api-reference/get-writable.mdx +7 -7
- package/docs/api-reference/index.mdx +4 -1
- package/docs/api-reference/retryable-error.mdx +1 -1
- package/docs/api-reference/set-attributes.mdx +61 -0
- package/docs/api-reference/sleep.mdx +4 -4
- package/docs/foundations/cancellation.mdx +31 -32
- package/docs/foundations/errors-and-retries.mdx +42 -11
- package/docs/foundations/hooks.mdx +64 -35
- package/docs/foundations/idempotency.mdx +244 -12
- package/docs/foundations/index.mdx +1 -23
- package/docs/foundations/meta.json +2 -1
- package/docs/foundations/serialization.mdx +21 -22
- package/docs/foundations/starting-workflows.mdx +106 -30
- package/docs/foundations/streaming.mdx +108 -60
- package/docs/foundations/versioning.mdx +263 -0
- package/docs/foundations/workflows-and-steps.mdx +9 -9
- package/docs/how-it-works/cancellation.mdx +63 -63
- package/docs/how-it-works/code-transform.mdx +83 -67
- package/docs/how-it-works/encryption.mdx +30 -26
- package/docs/how-it-works/event-sourcing.mdx +125 -34
- package/docs/how-it-works/framework-integrations.mdx +96 -337
- package/docs/how-it-works/understanding-directives.mdx +22 -22
- package/package.json +24 -15
- package/dist/runtime/step-handler.d.ts +0 -2
- package/dist/runtime/step-handler.d.ts.map +0 -1
- package/dist/runtime/step-handler.js +0 -776
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* QuickJS WebAssembly (WASM) VM integration with the Workflow DevKit.
|
|
3
|
+
*
|
|
4
|
+
* This module provides the entry point for running workflows in the
|
|
5
|
+
* QuickJS VM engine instead of the `node:vm` engine. Both engines
|
|
6
|
+
* implement the same event-replay execution model, where every invocation:
|
|
7
|
+
*
|
|
8
|
+
* 1. Loads the full event log for the run
|
|
9
|
+
* 2. Runs the workflow function from the top in a fresh QuickJS VM,
|
|
10
|
+
* replaying the event log to resolve awaited primitives
|
|
11
|
+
* 3. On suspension: creates events + queues steps for new pending ops
|
|
12
|
+
* 4. On completion: creates run_completed
|
|
13
|
+
* 5. On failure: creates run_failed
|
|
14
|
+
*/
|
|
15
|
+
import type { Span } from '@opentelemetry/api';
|
|
16
|
+
import { type Event, type RunInput, type WorkflowRun } from '@workflow/world';
|
|
17
|
+
/**
|
|
18
|
+
* Returns true when the supplied preloaded events indicate this is the
|
|
19
|
+
* first workflow handler invocation for the run, i.e. the log contains
|
|
20
|
+
* nothing beyond `run_created` / `run_started`. In that case the
|
|
21
|
+
* preloaded events ARE the complete event log and the `events.list`
|
|
22
|
+
* round-trips can be skipped entirely.
|
|
23
|
+
*
|
|
24
|
+
* Crucially, if the world backfilled a missing `run_created` via the
|
|
25
|
+
* resilient start path, `preloadedEvents` contains it even when a fresh
|
|
26
|
+
* `events.list` might not (eventual consistency), so preferring the
|
|
27
|
+
* preloaded events on first invocation is also the more correct choice.
|
|
28
|
+
*
|
|
29
|
+
* Returns false when `preloadedEvents` is missing/empty so the caller
|
|
30
|
+
* falls back to the normal fetch path.
|
|
31
|
+
*
|
|
32
|
+
* Exported for unit testing.
|
|
33
|
+
*/
|
|
34
|
+
export declare function isFirstInvocation(preloadedEvents: readonly Event[] | undefined): boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Run a workflow using the QuickJS WASM VM engine.
|
|
37
|
+
*
|
|
38
|
+
* This replaces the `node:vm` replay path (runWorkflow + EventsConsumer)
|
|
39
|
+
* with a QuickJS VM invocation that performs the same full event replay.
|
|
40
|
+
*
|
|
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.
|
|
64
|
+
*/
|
|
65
|
+
export declare function runWorkflowWithQuickJS(params: {
|
|
66
|
+
workflowCode: string;
|
|
67
|
+
workflowName: string;
|
|
68
|
+
workflowRun: WorkflowRun;
|
|
69
|
+
/**
|
|
70
|
+
* Events returned inline by `events.create('run_started', ...)` or by
|
|
71
|
+
* the lazy hook fast path's `hook_received` preload. When they indicate
|
|
72
|
+
* a first invocation, or when `preloadedEventsComplete` attests they
|
|
73
|
+
* are the complete log, they are used as the event log instead of
|
|
74
|
+
* fetching via `events.list`, matching the node:vm engine's fast path.
|
|
75
|
+
*/
|
|
76
|
+
preloadedEvents?: Event[];
|
|
77
|
+
/**
|
|
78
|
+
* True when the caller has validated that `preloadedEvents` is the run's
|
|
79
|
+
* COMPLETE event log (e.g. the lazy hook fast path's hasMore-false
|
|
80
|
+
* replay preload). The first-invocation heuristic below only recognizes
|
|
81
|
+
* run_created/run_started-only preloads, so without this attestation a
|
|
82
|
+
* hook-resume preload would be discarded and refetched.
|
|
83
|
+
*/
|
|
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;
|
|
92
|
+
/**
|
|
93
|
+
* Run input carried through the queue message on first delivery. Used
|
|
94
|
+
* as a last-resort fallback for `run_created.eventData.input` when
|
|
95
|
+
* the event log is incomplete.
|
|
96
|
+
*/
|
|
97
|
+
runInput?: RunInput;
|
|
98
|
+
/**
|
|
99
|
+
* The parent OTel span (the outer `WORKFLOW {workflowName}` span from
|
|
100
|
+
* `runtime.ts`). When supplied, VM lifecycle attributes are attached
|
|
101
|
+
* to it for end-to-end visibility.
|
|
102
|
+
*/
|
|
103
|
+
parentSpan?: Span;
|
|
104
|
+
/**
|
|
105
|
+
* Server-supplied per-run event ceiling from the run_started response
|
|
106
|
+
* (undefined ⇒ no enforcement). Mirrors the node:vm engine's guard:
|
|
107
|
+
* a runaway run is failed once its log reaches the ceiling. The throw
|
|
108
|
+
* propagates to the replay loop's catch in runtime.ts (the QuickJS
|
|
109
|
+
* dispatch runs inside that loop's try), which classifies it and
|
|
110
|
+
* records run_failed with MAX_EVENTS_EXCEEDED.
|
|
111
|
+
*/
|
|
112
|
+
maxEventsLimit?: number;
|
|
113
|
+
/**
|
|
114
|
+
* Queue delivery attempt of the message driving this invocation (from
|
|
115
|
+
* the queue handler's metadata; 1 = first delivery). Surfaced in
|
|
116
|
+
* diagnostics; crash recovery itself is driven by the ownership-lease
|
|
117
|
+
* decision table in the loop, not by the attempt count.
|
|
118
|
+
*/
|
|
119
|
+
deliveryAttempt?: number;
|
|
120
|
+
/**
|
|
121
|
+
* Queue message ID of the delivery driving this invocation, stamped as
|
|
122
|
+
* `ownerMessageId` on inline lazy step claims so wake replays defer to
|
|
123
|
+
* the in-flight body instead of requeueing the step.
|
|
124
|
+
*/
|
|
125
|
+
ownerMessageId?: string;
|
|
126
|
+
/** Request ID of the queue invocation, when the queue provides one. */
|
|
127
|
+
requestId?: string;
|
|
128
|
+
/**
|
|
129
|
+
* Queue namespace resolved at route registration (runtime.ts). Must be
|
|
130
|
+
* threaded into every message publish: the builders bake the namespace
|
|
131
|
+
* into generated routes, so consumers listen on `__<ns>_wkf_workflow_*`.
|
|
132
|
+
* A publish without it lands on `__wkf_workflow_*` and is never
|
|
133
|
+
* picked up.
|
|
134
|
+
*/
|
|
135
|
+
namespace?: string;
|
|
136
|
+
/**
|
|
137
|
+
* Run-origin trace carrier accessor from runtime.ts
|
|
138
|
+
* (getNextTraceCarrier). In the default `linked` trace mode every
|
|
139
|
+
* invocation must link back to the run's origin (workflow.start) in a
|
|
140
|
+
* star; capturing the current invocation context instead would chain
|
|
141
|
+
* invocations to each other and fragment the run view on async queues.
|
|
142
|
+
*/
|
|
143
|
+
nextTraceCarrier?: () => Promise<Record<string, string>>;
|
|
144
|
+
/**
|
|
145
|
+
* The wait this invocation is the delayed continuation for, if it is one
|
|
146
|
+
* (`WorkflowInvokePayload.waitContinuation`). Read only to decide the next
|
|
147
|
+
* continuation's idempotency key: a continuation that finds its own wait
|
|
148
|
+
* still pending has spent its key, so the re-arm has to advance the attempt
|
|
149
|
+
* or the world's dedupe window drops it and the wait loses its only timer.
|
|
150
|
+
*/
|
|
151
|
+
waitContinuation?: {
|
|
152
|
+
correlationId: string;
|
|
153
|
+
attempt: number;
|
|
154
|
+
};
|
|
155
|
+
}): Promise<{
|
|
156
|
+
timeoutSeconds?: number;
|
|
157
|
+
} | void>;
|
|
158
|
+
//# sourceMappingURL=quickjs-entrypoint.d.ts.map
|
|
@@ -0,0 +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,EAGL,KAAK,KAAK,EAGV,KAAK,QAAQ,EAIb,KAAK,WAAW,EACjB,MAAM,iBAAiB,CAAC;AA4DzB;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,iBAAiB,CAC/B,eAAe,EAAE,SAAS,KAAK,EAAE,GAAG,SAAS,GAC5C,OAAO,CAOT;AA0sBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAsB,sBAAsB,CAAC,MAAM,EAAE;IACnD,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,WAAW,CAAC;IACzB;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,KAAK,EAAE,CAAC;IAC1B;;;;;;OAMG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC;;;;;OAKG;IACH,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC;;;;OAIG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB;;;;OAIG;IACH,UAAU,CAAC,EAAE,IAAI,CAAC;IAClB;;;;;;;OAOG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;;;OAKG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,uEAAuE;IACvE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;;OAMG;IACH,gBAAgB,CAAC,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACzD;;;;;;OAMG;IACH,gBAAgB,CAAC,EAAE;QAAE,aAAa,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;CAC/D,GAAG,OAAO,CAAC;IAAE,cAAc,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAAC,CAm5C9C"}
|