@workflow/core 5.0.0-beta.42 → 5.0.0-beta.44

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 (220) hide show
  1. package/dist/capabilities.d.ts +4 -4
  2. package/dist/capabilities.js +5 -5
  3. package/dist/capture-stack.d.ts +1 -1
  4. package/dist/capture-stack.js +2 -2
  5. package/dist/class-serialization.d.ts +8 -8
  6. package/dist/class-serialization.js +9 -9
  7. package/dist/classify-error.js +5 -5
  8. package/dist/context-violation-error.d.ts +5 -5
  9. package/dist/context-violation-error.d.ts.map +1 -1
  10. package/dist/context-violation-error.js +5 -5
  11. package/dist/create-hook.d.ts +10 -6
  12. package/dist/create-hook.d.ts.map +1 -1
  13. package/dist/create-hook.js +1 -1
  14. package/dist/define-hook.js +2 -2
  15. package/dist/describe-error.d.ts +7 -7
  16. package/dist/describe-error.js +8 -8
  17. package/dist/encryption.d.ts +5 -5
  18. package/dist/encryption.js +7 -7
  19. package/dist/events-consumer.d.ts +19 -7
  20. package/dist/events-consumer.d.ts.map +1 -1
  21. package/dist/events-consumer.js +33 -12
  22. package/dist/flushable-stream.d.ts +4 -4
  23. package/dist/flushable-stream.js +12 -12
  24. package/dist/global.d.ts +1 -1
  25. package/dist/global.js +1 -1
  26. package/dist/index.d.ts +1 -1
  27. package/dist/index.js +2 -2
  28. package/dist/log-format.d.ts +2 -2
  29. package/dist/log-format.js +5 -5
  30. package/dist/logger.js +4 -4
  31. package/dist/private.d.ts +39 -64
  32. package/dist/private.d.ts.map +1 -1
  33. package/dist/private.js +294 -48
  34. package/dist/replay-payload-cache.d.ts +1 -1
  35. package/dist/replay-payload-cache.js +4 -4
  36. package/dist/runtime/compute-instance.d.ts +4 -3
  37. package/dist/runtime/compute-instance.d.ts.map +1 -1
  38. package/dist/runtime/compute-instance.js +5 -4
  39. package/dist/runtime/constants.d.ts +46 -19
  40. package/dist/runtime/constants.d.ts.map +1 -1
  41. package/dist/runtime/constants.js +76 -38
  42. package/dist/runtime/count-step-started-events.d.ts +7 -7
  43. package/dist/runtime/count-step-started-events.js +4 -4
  44. package/dist/runtime/deployment-guard.d.ts +7 -7
  45. package/dist/runtime/deployment-guard.js +8 -8
  46. package/dist/runtime/get-port-lazy.d.ts +2 -2
  47. package/dist/runtime/get-port-lazy.d.ts.map +1 -1
  48. package/dist/runtime/get-port-lazy.js +37 -30
  49. package/dist/runtime/get-world-lazy.d.ts +2 -2
  50. package/dist/runtime/get-world-lazy.js +3 -3
  51. package/dist/runtime/helpers.d.ts +18 -18
  52. package/dist/runtime/helpers.js +27 -27
  53. package/dist/runtime/quickjs-entrypoint.d.ts +23 -10
  54. package/dist/runtime/quickjs-entrypoint.d.ts.map +1 -1
  55. package/dist/runtime/quickjs-entrypoint.js +200 -81
  56. package/dist/runtime/quickjs-runtime.d.ts +31 -15
  57. package/dist/runtime/quickjs-runtime.d.ts.map +1 -1
  58. package/dist/runtime/quickjs-runtime.js +126 -77
  59. package/dist/runtime/quickjs-serde.d.ts +10 -10
  60. package/dist/runtime/quickjs-serde.js +20 -20
  61. package/dist/runtime/replay-budget.d.ts +4 -4
  62. package/dist/runtime/replay-budget.js +5 -5
  63. package/dist/runtime/replay-recovery-reporter.d.ts +1 -1
  64. package/dist/runtime/replay-recovery-reporter.js +2 -2
  65. package/dist/runtime/resume-hook.d.ts +2 -2
  66. package/dist/runtime/resume-hook.js +27 -27
  67. package/dist/runtime/resume-latency.d.ts +25 -25
  68. package/dist/runtime/resume-latency.d.ts.map +1 -1
  69. package/dist/runtime/resume-latency.js +4 -4
  70. package/dist/runtime/run-id-time.d.ts +2 -2
  71. package/dist/runtime/run-id-time.js +5 -5
  72. package/dist/runtime/run.d.ts +21 -4
  73. package/dist/runtime/run.d.ts.map +1 -1
  74. package/dist/runtime/run.js +154 -35
  75. package/dist/runtime/runs.d.ts +4 -4
  76. package/dist/runtime/runs.js +2 -2
  77. package/dist/runtime/start.d.ts +3 -3
  78. package/dist/runtime/start.d.ts.map +1 -1
  79. package/dist/runtime/start.js +27 -23
  80. package/dist/runtime/step-executor.d.ts +59 -11
  81. package/dist/runtime/step-executor.d.ts.map +1 -1
  82. package/dist/runtime/step-executor.js +116 -42
  83. package/dist/runtime/step-latency.d.ts +20 -14
  84. package/dist/runtime/step-latency.d.ts.map +1 -1
  85. package/dist/runtime/step-latency.js +13 -11
  86. package/dist/runtime/step-ownership.d.ts +6 -6
  87. package/dist/runtime/step-ownership.js +8 -8
  88. package/dist/runtime/step-single-flight.d.ts +1 -1
  89. package/dist/runtime/step-single-flight.d.ts.map +1 -1
  90. package/dist/runtime/step-single-flight.js +17 -11
  91. package/dist/runtime/suspension-handler.d.ts +99 -7
  92. package/dist/runtime/suspension-handler.d.ts.map +1 -1
  93. package/dist/runtime/suspension-handler.js +678 -57
  94. package/dist/runtime/unserializable-step.d.ts +34 -0
  95. package/dist/runtime/unserializable-step.d.ts.map +1 -0
  96. package/dist/runtime/unserializable-step.js +52 -0
  97. package/dist/runtime/vm-mode.d.ts +1 -1
  98. package/dist/runtime/vm-mode.js +2 -2
  99. package/dist/runtime/wait-continuation.d.ts +31 -9
  100. package/dist/runtime/wait-continuation.d.ts.map +1 -1
  101. package/dist/runtime/wait-continuation.js +44 -13
  102. package/dist/runtime/wait-until.d.ts +1 -1
  103. package/dist/runtime/wait-until.js +2 -2
  104. package/dist/runtime/world-compatibility.d.ts +20 -9
  105. package/dist/runtime/world-compatibility.d.ts.map +1 -1
  106. package/dist/runtime/world-compatibility.js +24 -13
  107. package/dist/runtime/world-init.d.ts +5 -5
  108. package/dist/runtime/world-init.js +6 -6
  109. package/dist/runtime/world.d.ts.map +1 -1
  110. package/dist/runtime/world.js +13 -3
  111. package/dist/runtime.d.ts.map +1 -1
  112. package/dist/runtime.js +417 -213
  113. package/dist/sealed-box.d.ts +7 -7
  114. package/dist/sealed-box.js +15 -15
  115. package/dist/serialization/client.js +2 -2
  116. package/dist/serialization/codec-devalue-vm.d.ts +1 -1
  117. package/dist/serialization/codec-devalue-vm.js +4 -4
  118. package/dist/serialization/codec-devalue.d.ts +1 -1
  119. package/dist/serialization/codec-devalue.js +2 -2
  120. package/dist/serialization/codec.d.ts +4 -4
  121. package/dist/serialization/codec.js +2 -2
  122. package/dist/serialization/compression.d.ts +12 -11
  123. package/dist/serialization/compression.d.ts.map +1 -1
  124. package/dist/serialization/compression.js +16 -15
  125. package/dist/serialization/encryption.d.ts +7 -7
  126. package/dist/serialization/encryption.d.ts.map +1 -1
  127. package/dist/serialization/encryption.js +8 -8
  128. package/dist/serialization/errors.js +2 -2
  129. package/dist/serialization/format.d.ts +6 -6
  130. package/dist/serialization/format.js +7 -7
  131. package/dist/serialization/hardened.d.ts +18 -18
  132. package/dist/serialization/hardened.d.ts.map +1 -1
  133. package/dist/serialization/hardened.js +41 -32
  134. package/dist/serialization/index.d.ts +1 -1
  135. package/dist/serialization/index.js +2 -2
  136. package/dist/serialization/reducers/class-vm.d.ts +1 -1
  137. package/dist/serialization/reducers/class-vm.js +2 -2
  138. package/dist/serialization/reducers/class.js +2 -2
  139. package/dist/serialization/reducers/common-vm.js +12 -12
  140. package/dist/serialization/reducers/common.js +12 -12
  141. package/dist/serialization/reducers/step-function-vm.d.ts +1 -1
  142. package/dist/serialization/reducers/step-function-vm.js +2 -2
  143. package/dist/serialization/reducers/step-function.js +2 -2
  144. package/dist/serialization/step.js +2 -2
  145. package/dist/serialization/types.d.ts +5 -5
  146. package/dist/serialization/types.js +2 -2
  147. package/dist/serialization/workflow-vm.d.ts +1 -1
  148. package/dist/serialization/workflow-vm.d.ts.map +1 -1
  149. package/dist/serialization/workflow-vm.js +13 -10
  150. package/dist/serialization-format.d.ts +11 -11
  151. package/dist/serialization-format.d.ts.map +1 -1
  152. package/dist/serialization-format.js +29 -23
  153. package/dist/serialization.d.ts +20 -12
  154. package/dist/serialization.d.ts.map +1 -1
  155. package/dist/serialization.js +141 -99
  156. package/dist/set-attributes.js +2 -2
  157. package/dist/source-map.d.ts +1 -1
  158. package/dist/source-map.d.ts.map +1 -1
  159. package/dist/source-map.js +18 -12
  160. package/dist/step/context-storage.d.ts +5 -5
  161. package/dist/step/context-storage.js +1 -1
  162. package/dist/step/writable-stream.d.ts +3 -3
  163. package/dist/step/writable-stream.js +7 -7
  164. package/dist/step.js +12 -12
  165. package/dist/symbols.d.ts +2 -2
  166. package/dist/symbols.js +3 -3
  167. package/dist/telemetry/semantic-conventions.d.ts +21 -13
  168. package/dist/telemetry/semantic-conventions.d.ts.map +1 -1
  169. package/dist/telemetry/semantic-conventions.js +21 -15
  170. package/dist/telemetry.d.ts +9 -3
  171. package/dist/telemetry.d.ts.map +1 -1
  172. package/dist/telemetry.js +40 -10
  173. package/dist/test-support/orchestrator-context.d.ts.map +1 -1
  174. package/dist/test-support/orchestrator-context.js +12 -2
  175. package/dist/version.d.ts +1 -1
  176. package/dist/version.js +2 -2
  177. package/dist/vm/index.js +4 -4
  178. package/dist/vm/script-cache.d.ts.map +1 -1
  179. package/dist/vm/script-cache.js +23 -17
  180. package/dist/vm/uint8array-base64.js +1 -1
  181. package/dist/workflow/abort-controller.d.ts +1 -1
  182. package/dist/workflow/abort-controller.js +12 -12
  183. package/dist/workflow/create-hook.js +3 -3
  184. package/dist/workflow/get-workflow-metadata.js +2 -2
  185. package/dist/workflow/hook.js +18 -18
  186. package/dist/workflow/set-attributes.d.ts +1 -1
  187. package/dist/workflow/set-attributes.js +2 -2
  188. package/dist/workflow/sleep.js +2 -2
  189. package/dist/workflow/world-init-stub.d.ts +1 -1
  190. package/dist/workflow/world-init-stub.js +2 -2
  191. package/dist/workflow.d.ts +2 -2
  192. package/dist/workflow.js +36 -14
  193. package/docs/api-reference/create-hook.mdx +15 -15
  194. package/docs/api-reference/create-webhook.mdx +15 -15
  195. package/docs/api-reference/define-hook.mdx +10 -10
  196. package/docs/api-reference/fatal-error.mdx +2 -2
  197. package/docs/api-reference/fetch.mdx +7 -7
  198. package/docs/api-reference/get-step-metadata.mdx +2 -2
  199. package/docs/api-reference/get-workflow-metadata.mdx +3 -3
  200. package/docs/api-reference/get-writable.mdx +7 -7
  201. package/docs/api-reference/index.mdx +1 -1
  202. package/docs/api-reference/retryable-error.mdx +1 -1
  203. package/docs/api-reference/set-attributes.mdx +2 -2
  204. package/docs/api-reference/sleep.mdx +3 -3
  205. package/docs/foundations/cancellation.mdx +31 -31
  206. package/docs/foundations/errors-and-retries.mdx +42 -11
  207. package/docs/foundations/hooks.mdx +37 -37
  208. package/docs/foundations/idempotency.mdx +9 -9
  209. package/docs/foundations/serialization.mdx +21 -22
  210. package/docs/foundations/starting-workflows.mdx +36 -37
  211. package/docs/foundations/streaming.mdx +68 -39
  212. package/docs/foundations/versioning.mdx +3 -3
  213. package/docs/foundations/workflows-and-steps.mdx +9 -9
  214. package/docs/how-it-works/cancellation.mdx +62 -62
  215. package/docs/how-it-works/code-transform.mdx +66 -54
  216. package/docs/how-it-works/encryption.mdx +25 -21
  217. package/docs/how-it-works/event-sourcing.mdx +84 -28
  218. package/docs/how-it-works/framework-integrations.mdx +12 -12
  219. package/docs/how-it-works/understanding-directives.mdx +21 -21
  220. package/package.json +7 -7
@@ -6,8 +6,8 @@
6
6
  * host code operating on `JSValueHandle`s, using devalue 5.9's pluggable
7
7
  * operations (quickjs-wasi's host-side introspection primitives underneath).
8
8
  * The serde bundle previously evaluated inside the VM is gone: guest values
9
- * are read and built through handles, so no serializer code lives in or
10
- * can be tampered with from the guest realm.
9
+ * are read and built through handles, so no serializer code lives in (or
10
+ * can be tampered with from) the guest realm.
11
11
  *
12
12
  * Side-effect discipline mirrors the node:vm engine's hardened codec
13
13
  * (serialization/hardened.ts):
@@ -17,7 +17,7 @@
17
17
  * `Symbol.toStringTag`;
18
18
  * - extraction goes through intrinsics captured at boot (before any user
19
19
  * code runs) invoked with explicit receivers, or through own-property
20
- * descriptor reads patched prototypes and inherited accessors never
20
+ * descriptor reads, so patched prototypes and inherited accessors never
21
21
  * run;
22
22
  * - the only guest code serialization can execute is the same code the
23
23
  * previous in-VM codec executed by contract: a class's static
@@ -30,7 +30,7 @@
30
30
  * versa).
31
31
  *
32
32
  * Hybrid value space: reducers return host shapes (plain objects, strings,
33
- * numbers) whose leaves may be guest handles exactly how the node:vm
33
+ * numbers) whose leaves may be guest handles, exactly how the node:vm
34
34
  * codec mixes host shapes with sandbox-realm leaves. Every stringify
35
35
  * operation therefore dispatches on `JSValueHandle` and falls back to
36
36
  * devalue's default host operations for host values. Parse operations
@@ -42,7 +42,7 @@ import { JSValueHandle, type QuickJS } from 'quickjs-wasi';
42
42
  * bootstrap and BEFORE any user code. The returned handle owns the
43
43
  * container; on the baseline-snapshot path its raw box pointer
44
44
  * (`handle.ptr`) is recorded next to the snapshot and re-adopted per
45
- * restored VM via {@link adoptSerdeRoot} do NOT dispose the handle
45
+ * restored VM via {@link adoptSerdeRoot}. Do NOT dispose the handle
46
46
  * before the snapshot is taken (the box must stay live in the memory
47
47
  * image).
48
48
  */
@@ -51,14 +51,14 @@ export declare function captureSerdeRoot(vm: QuickJS): JSValueHandle;
51
51
  * Re-create the capture-root handle in a VM restored from a snapshot
52
52
  * taken while the exported root was alive, via quickjs-wasi's
53
53
  * snapshot-portable handle tokens (`importHandle` duplicates the
54
- * underlying value the returned handle is independently owned and the
54
+ * underlying value: the returned handle is independently owned and the
55
55
  * serde disposes it per restored VM). No guest code executes.
56
56
  */
57
57
  export declare function adoptSerdeRoot(vm: QuickJS, token: number): JSValueHandle;
58
58
  /**
59
59
  * Export the capture root as a snapshot-portable token to record next to
60
60
  * the baseline snapshot. The root handle must stay undisposed until the
61
- * snapshot is taken (its box and the reference it holds must be part
61
+ * snapshot is taken (its box, and the reference it holds, must be part
62
62
  * of the memory image).
63
63
  */
64
64
  export declare function exportSerdeRoot(vm: QuickJS, root: JSValueHandle): number;
@@ -70,7 +70,7 @@ export interface QuickJSSerde {
70
70
  /**
71
71
  * The reducer names this codec applies, in registration order. Exposed
72
72
  * so tests can assert exhaustiveness against the shared value-space
73
- * codec (codec-devalue-vm) a reducer added there but not here would
73
+ * codec (codec-devalue-vm): a reducer added there but not here would
74
74
  * otherwise silently round-trip values as plain objects.
75
75
  */
76
76
  reducerKeys: readonly string[];
@@ -78,7 +78,7 @@ export interface QuickJSSerde {
78
78
  reviverKeys: readonly string[];
79
79
  /**
80
80
  * Install `globalThis.process = { env: Object.freeze({...}) }` in the
81
- * VM through handles and boot-captured intrinsics only no guest
81
+ * VM through handles and boot-captured intrinsics only: no guest
82
82
  * source is evaluated, so a module-scope wrapper around JSON.parse /
83
83
  * Object.freeze cannot observe the injection. This matters on the
84
84
  * baseline-snapshot path, where env injection happens after user code
@@ -98,7 +98,7 @@ export declare function createQuickJSSerde(vm: QuickJS,
98
98
  * Pre-captured serde root (baseline-snapshot path): the container
99
99
  * `captureSerdeRoot` created BEFORE user code, re-adopted from the
100
100
  * restored memory image via `adoptSerdeRoot`. When omitted, the root
101
- * is captured now callers must guarantee no user code has run yet.
101
+ * is captured now; callers must guarantee no user code has run yet.
102
102
  * Either way, initialization below performs only plain-data property
103
103
  * reads and C-level classId reads on the container: NO guest code
104
104
  * executes here, so nothing user-patchable can observe or perturb it.