@workflow/core 5.0.0-beta.44 → 5.0.0-beta.47
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/dist/attribute-changes.d.ts +3 -5
- package/dist/attribute-changes.d.ts.map +1 -1
- package/dist/attribute-changes.js +2 -2
- package/dist/capabilities.d.ts +6 -5
- package/dist/capabilities.d.ts.map +1 -1
- package/dist/capabilities.js +14 -12
- package/dist/events-consumer.d.ts +30 -7
- package/dist/events-consumer.d.ts.map +1 -1
- package/dist/events-consumer.js +67 -11
- package/dist/flushable-stream.js +2 -2
- package/dist/global.d.ts +3 -1
- package/dist/global.d.ts.map +1 -1
- package/dist/global.js +8 -5
- package/dist/private.d.ts +20 -14
- package/dist/private.d.ts.map +1 -1
- package/dist/private.js +67 -29
- package/dist/replay-payload-cache.d.ts +13 -17
- package/dist/replay-payload-cache.d.ts.map +1 -1
- package/dist/replay-payload-cache.js +55 -57
- package/dist/runtime/constants.d.ts +3 -3
- package/dist/runtime/constants.d.ts.map +1 -1
- package/dist/runtime/constants.js +4 -4
- package/dist/runtime/helpers.d.ts +15 -34
- package/dist/runtime/helpers.d.ts.map +1 -1
- package/dist/runtime/helpers.js +18 -43
- package/dist/runtime/quickjs-entrypoint.d.ts.map +1 -1
- package/dist/runtime/quickjs-entrypoint.js +8 -1
- package/dist/runtime/quickjs-runtime.js +7 -1
- package/dist/runtime/resume-hook.d.ts +20 -12
- package/dist/runtime/resume-hook.d.ts.map +1 -1
- package/dist/runtime/resume-hook.js +195 -249
- package/dist/runtime/resume-latency.d.ts +13 -6
- package/dist/runtime/resume-latency.d.ts.map +1 -1
- package/dist/runtime/resume-latency.js +4 -2
- package/dist/runtime/run.d.ts +1 -1
- package/dist/runtime/run.d.ts.map +1 -1
- package/dist/runtime/run.js +3 -2
- package/dist/runtime/start.js +12 -10
- package/dist/runtime/step-latency.d.ts +31 -14
- package/dist/runtime/step-latency.d.ts.map +1 -1
- package/dist/runtime/step-latency.js +19 -13
- package/dist/runtime/suspension-handler.d.ts +9 -7
- package/dist/runtime/suspension-handler.d.ts.map +1 -1
- package/dist/runtime/suspension-handler.js +41 -41
- package/dist/runtime/vm-mode.d.ts +1 -1
- package/dist/runtime/vm-mode.d.ts.map +1 -1
- package/dist/runtime/vm-mode.js +1 -1
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +278 -125
- package/dist/serialization/hardened.d.ts +5 -4
- package/dist/serialization/hardened.d.ts.map +1 -1
- package/dist/serialization/hardened.js +7 -1
- package/dist/serialization-format.js +2 -2
- package/dist/serialization.d.ts +8 -9
- package/dist/serialization.d.ts.map +1 -1
- package/dist/serialization.js +32 -25
- package/dist/step.d.ts.map +1 -1
- package/dist/step.js +3 -11
- package/dist/telemetry/semantic-conventions.d.ts +51 -8
- package/dist/telemetry/semantic-conventions.d.ts.map +1 -1
- package/dist/telemetry/semantic-conventions.js +38 -5
- package/dist/telemetry.d.ts +12 -0
- package/dist/telemetry.d.ts.map +1 -1
- package/dist/telemetry.js +62 -2
- package/dist/version.d.ts +1 -1
- package/dist/version.js +2 -2
- package/dist/vm/script-cache.d.ts +9 -11
- package/dist/vm/script-cache.d.ts.map +1 -1
- package/dist/vm/script-cache.js +25 -40
- package/dist/workflow/attribute-dispatcher.d.ts.map +1 -1
- package/dist/workflow/attribute-dispatcher.js +3 -6
- package/dist/workflow/hook.d.ts.map +1 -1
- package/dist/workflow/hook.js +6 -15
- package/dist/workflow.d.ts +16 -0
- package/dist/workflow.d.ts.map +1 -1
- package/dist/workflow.js +73 -29
- package/docs/foundations/errors-and-retries.mdx +1 -1
- package/package.json +6 -6
|
@@ -15,18 +15,10 @@ export declare function getHookByToken(token: string): Promise<Hook>;
|
|
|
15
15
|
* The result of {@link resumeHook}: a {@link Hook} augmented with an optional
|
|
16
16
|
* resilience signal.
|
|
17
17
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* dispatch succeeds, the resume is still guaranteed: the queue consumer
|
|
23
|
-
* idempotently materializes the `hook_received` event from the payload carried
|
|
24
|
-
* on the message before replay. In that recovered case the returned hook carries
|
|
25
|
-
* `resilientResume: true`.
|
|
26
|
-
*
|
|
27
|
-
* On the happy path (the direct write landed) and on the sequential fallback
|
|
28
|
-
* path, the flag is absent (`undefined`). Callers that don't care about the
|
|
29
|
-
* distinction can treat the result as a plain {@link Hook}.
|
|
18
|
+
* `resilientResume` is retained for source compatibility and is never set.
|
|
19
|
+
* `resumeHook()` now requires the durable `hook_received` write and workflow
|
|
20
|
+
* wake to both succeed before it resolves. Treat the result as a plain
|
|
21
|
+
* {@link Hook}.
|
|
30
22
|
*/
|
|
31
23
|
export type ResumedHook = Hook & {
|
|
32
24
|
resilientResume?: boolean;
|
|
@@ -37,6 +29,22 @@ export type ResumedHook = Hook & {
|
|
|
37
29
|
* This function is called externally (e.g., from an API route or server action)
|
|
38
30
|
* to send data to a hook and resume the associated workflow run.
|
|
39
31
|
*
|
|
32
|
+
* Resolving means BOTH that the `hook_received` event is durably recorded in
|
|
33
|
+
* the run's event log and that the workflow wake was accepted by the queue, in
|
|
34
|
+
* that order. A {@link HookNotFoundError} means this invocation committed no
|
|
35
|
+
* event. Any other error after the write is ambiguous only in dispatch, never
|
|
36
|
+
* in durability: the event may already be committed, and a later wake of the
|
|
37
|
+
* run (from any source) will deliver it.
|
|
38
|
+
*
|
|
39
|
+
* Prefer passing the token string over a cached {@link Hook} object. A token
|
|
40
|
+
* is looked up fresh, so the live backend can attest its atomic resume claim
|
|
41
|
+
* and the durable write becomes idempotent-on-retry (transport retries of the
|
|
42
|
+
* same write converge on one event). A supplied Hook object may carry a stale
|
|
43
|
+
* attestation, so it is deliberately ignored and the write is claim-less —
|
|
44
|
+
* meaning a lost response cannot be retried safely: retrying at the
|
|
45
|
+
* application level mints a fresh claim and can commit a second
|
|
46
|
+
* `hook_received`.
|
|
47
|
+
*
|
|
40
48
|
* @param tokenOrHook - The unique token identifying the hook, or the hook object itself
|
|
41
49
|
* @param payload - The data payload to send to the hook
|
|
42
50
|
* @returns Promise resolving to the {@link ResumedHook}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resume-hook.d.ts","sourceRoot":"","sources":["../../src/runtime/resume-hook.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"resume-hook.d.ts","sourceRoot":"","sources":["../../src/runtime/resume-hook.ts"],"names":[],"mappings":"AAMA,OAAO,EAEL,KAAK,IAAI,EASV,MAAM,iBAAiB,CAAC;AAOzB,OAAO,EAGL,KAAK,UAAU,EAGhB,MAAM,qBAAqB,CAAC;AAiN7B;;;;;;;;;GASG;AACH,wBAAsB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAGjE;AAED;;;;;;;;GAQG;AACH,MAAM,MAAM,WAAW,GAAG,IAAI,GAAG;IAAE,eAAe,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAE/D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,wBAAsB,UAAU,CAAC,CAAC,GAAG,GAAG,EACtC,WAAW,EAAE,MAAM,GAAG,IAAI,EAC1B,OAAO,EAAE,CAAC,EACV,qBAAqB,CAAC,EAAE,UAAU,GACjC,OAAO,CAAC,WAAW,CAAC,CAoBtB;AAsUD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,wBAAsB,aAAa,CACjC,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,OAAO,GACf,OAAO,CAAC,QAAQ,CAAC,CAqEnB"}
|