@workflow/core 5.0.0-beta.3 → 5.0.0-beta.5

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 (161) hide show
  1. package/dist/capture-stack.d.ts +16 -0
  2. package/dist/capture-stack.d.ts.map +1 -0
  3. package/dist/capture-stack.js +21 -0
  4. package/dist/classify-error.d.ts +7 -0
  5. package/dist/classify-error.d.ts.map +1 -1
  6. package/dist/classify-error.js +25 -4
  7. package/dist/context-errors.d.ts +27 -0
  8. package/dist/context-errors.d.ts.map +1 -0
  9. package/dist/context-errors.js +101 -0
  10. package/dist/context-violation-error.d.ts +97 -0
  11. package/dist/context-violation-error.d.ts.map +1 -0
  12. package/dist/context-violation-error.js +147 -0
  13. package/dist/create-hook.d.ts.map +1 -1
  14. package/dist/create-hook.js +4 -3
  15. package/dist/define-hook.d.ts.map +1 -1
  16. package/dist/define-hook.js +20 -5
  17. package/dist/describe-error.d.ts +70 -0
  18. package/dist/describe-error.d.ts.map +1 -0
  19. package/dist/describe-error.js +119 -0
  20. package/dist/encryption.d.ts.map +1 -1
  21. package/dist/encryption.js +4 -20
  22. package/dist/events-consumer.d.ts +7 -0
  23. package/dist/events-consumer.d.ts.map +1 -1
  24. package/dist/events-consumer.js +9 -2
  25. package/dist/flushable-stream.d.ts +10 -10
  26. package/dist/flushable-stream.d.ts.map +1 -1
  27. package/dist/flushable-stream.js +13 -12
  28. package/dist/global.d.ts +4 -0
  29. package/dist/global.d.ts.map +1 -1
  30. package/dist/global.js +8 -2
  31. package/dist/log-format.d.ts +25 -0
  32. package/dist/log-format.d.ts.map +1 -0
  33. package/dist/log-format.js +250 -0
  34. package/dist/logger.d.ts +28 -30
  35. package/dist/logger.d.ts.map +1 -1
  36. package/dist/logger.js +77 -31
  37. package/dist/private.js +3 -3
  38. package/dist/runtime/get-port-lazy.d.ts +10 -0
  39. package/dist/runtime/get-port-lazy.d.ts.map +1 -0
  40. package/dist/runtime/get-port-lazy.js +30 -0
  41. package/dist/runtime/get-world-lazy.d.ts +32 -0
  42. package/dist/runtime/get-world-lazy.d.ts.map +1 -0
  43. package/dist/runtime/get-world-lazy.js +56 -0
  44. package/dist/runtime/helpers.d.ts +38 -5
  45. package/dist/runtime/helpers.d.ts.map +1 -1
  46. package/dist/runtime/helpers.js +67 -18
  47. package/dist/runtime/resume-hook.js +4 -4
  48. package/dist/runtime/run.d.ts.map +1 -1
  49. package/dist/runtime/run.js +31 -6
  50. package/dist/runtime/start.js +3 -3
  51. package/dist/runtime/step-executor.d.ts +40 -0
  52. package/dist/runtime/step-executor.d.ts.map +1 -0
  53. package/dist/runtime/step-executor.js +480 -0
  54. package/dist/runtime/step-handler.d.ts.map +1 -1
  55. package/dist/runtime/step-handler.js +209 -111
  56. package/dist/runtime/suspension-handler.d.ts +22 -4
  57. package/dist/runtime/suspension-handler.d.ts.map +1 -1
  58. package/dist/runtime/suspension-handler.js +86 -73
  59. package/dist/runtime/world-init.d.ts +75 -0
  60. package/dist/runtime/world-init.d.ts.map +1 -0
  61. package/dist/runtime/world-init.js +75 -0
  62. package/dist/runtime/world.d.ts.map +1 -1
  63. package/dist/runtime/world.js +47 -18
  64. package/dist/runtime.d.ts +8 -7
  65. package/dist/runtime.d.ts.map +1 -1
  66. package/dist/runtime.js +649 -292
  67. package/dist/schemas.d.ts +1 -1
  68. package/dist/schemas.d.ts.map +1 -1
  69. package/dist/schemas.js +1 -1
  70. package/dist/serialization/client.d.ts +17 -0
  71. package/dist/serialization/client.d.ts.map +1 -0
  72. package/dist/serialization/client.js +44 -0
  73. package/dist/serialization/codec-devalue.d.ts +14 -0
  74. package/dist/serialization/codec-devalue.d.ts.map +1 -0
  75. package/dist/serialization/codec-devalue.js +98 -0
  76. package/dist/serialization/codec.d.ts +90 -0
  77. package/dist/serialization/codec.d.ts.map +1 -0
  78. package/dist/serialization/codec.js +17 -0
  79. package/dist/serialization/encryption.d.ts +32 -0
  80. package/dist/serialization/encryption.d.ts.map +1 -0
  81. package/dist/serialization/encryption.js +51 -0
  82. package/dist/serialization/errors.d.ts +21 -0
  83. package/dist/serialization/errors.d.ts.map +1 -0
  84. package/dist/serialization/errors.js +41 -0
  85. package/dist/serialization/format.d.ts +60 -0
  86. package/dist/serialization/format.d.ts.map +1 -0
  87. package/dist/serialization/format.js +97 -0
  88. package/dist/serialization/index.d.ts +18 -0
  89. package/dist/serialization/index.d.ts.map +1 -0
  90. package/dist/serialization/index.js +20 -0
  91. package/dist/serialization/reducers/class.d.ts +11 -0
  92. package/dist/serialization/reducers/class.d.ts.map +1 -0
  93. package/dist/serialization/reducers/class.js +68 -0
  94. package/dist/serialization/reducers/common.d.ts +16 -0
  95. package/dist/serialization/reducers/common.d.ts.map +1 -0
  96. package/dist/serialization/reducers/common.js +362 -0
  97. package/dist/serialization/reducers/step-function.d.ts +35 -0
  98. package/dist/serialization/reducers/step-function.d.ts.map +1 -0
  99. package/dist/serialization/reducers/step-function.js +88 -0
  100. package/dist/serialization/step.d.ts +17 -0
  101. package/dist/serialization/step.d.ts.map +1 -0
  102. package/dist/serialization/step.js +44 -0
  103. package/dist/serialization/types.d.ts +201 -0
  104. package/dist/serialization/types.d.ts.map +1 -0
  105. package/dist/serialization/types.js +21 -0
  106. package/dist/serialization/workflow.d.ts +29 -0
  107. package/dist/serialization/workflow.d.ts.map +1 -0
  108. package/dist/serialization/workflow.js +54 -0
  109. package/dist/serialization-format.d.ts.map +1 -1
  110. package/dist/serialization-format.js +77 -3
  111. package/dist/serialization.d.ts +202 -226
  112. package/dist/serialization.d.ts.map +1 -1
  113. package/dist/serialization.js +773 -633
  114. package/dist/sleep.d.ts.map +1 -1
  115. package/dist/sleep.js +3 -2
  116. package/dist/step/get-closure-vars.d.ts.map +1 -1
  117. package/dist/step/get-closure-vars.js +3 -2
  118. package/dist/step/get-step-metadata.d.ts.map +1 -1
  119. package/dist/step/get-step-metadata.js +3 -2
  120. package/dist/step/get-workflow-metadata.d.ts.map +1 -1
  121. package/dist/step/get-workflow-metadata.js +3 -2
  122. package/dist/step/writable-stream.d.ts.map +1 -1
  123. package/dist/step/writable-stream.js +3 -2
  124. package/dist/step.d.ts.map +1 -1
  125. package/dist/step.js +83 -16
  126. package/dist/symbols.d.ts +4 -0
  127. package/dist/symbols.d.ts.map +1 -1
  128. package/dist/symbols.js +5 -1
  129. package/dist/telemetry/semantic-conventions.d.ts +2 -2
  130. package/dist/telemetry/semantic-conventions.js +1 -1
  131. package/dist/util.d.ts +18 -3
  132. package/dist/util.d.ts.map +1 -1
  133. package/dist/util.js +28 -5
  134. package/dist/version.d.ts +1 -1
  135. package/dist/version.js +2 -2
  136. package/dist/vm/index.d.ts.map +1 -1
  137. package/dist/vm/index.js +3 -2
  138. package/dist/workflow/abort-controller.d.ts +65 -0
  139. package/dist/workflow/abort-controller.d.ts.map +1 -0
  140. package/dist/workflow/abort-controller.js +245 -0
  141. package/dist/workflow/create-hook.d.ts.map +1 -1
  142. package/dist/workflow/create-hook.js +3 -2
  143. package/dist/workflow/define-hook.d.ts +1 -1
  144. package/dist/workflow/define-hook.d.ts.map +1 -1
  145. package/dist/workflow/define-hook.js +8 -4
  146. package/dist/workflow/get-workflow-metadata.d.ts.map +1 -1
  147. package/dist/workflow/get-workflow-metadata.js +14 -3
  148. package/dist/workflow/index.d.ts.map +1 -1
  149. package/dist/workflow/index.js +4 -3
  150. package/dist/workflow/world-init-stub.d.ts +15 -0
  151. package/dist/workflow/world-init-stub.d.ts.map +1 -0
  152. package/dist/workflow/world-init-stub.js +15 -0
  153. package/dist/workflow.d.ts.map +1 -1
  154. package/dist/workflow.js +71 -28
  155. package/docs/foundations/cancellation.mdx +460 -0
  156. package/docs/foundations/errors-and-retries.mdx +7 -3
  157. package/docs/foundations/meta.json +1 -0
  158. package/docs/foundations/serialization.mdx +77 -41
  159. package/docs/how-it-works/cancellation.mdx +287 -0
  160. package/docs/how-it-works/meta.json +2 -1
  161. package/package.json +15 -6
@@ -1,57 +1,9 @@
1
1
  import { type CryptoKey } from './encryption.js';
2
- /**
3
- * Encryption key parameter type. Accepts a resolved key, undefined (no encryption),
4
- * or a promise that resolves to either. This allows synchronous function signatures
5
- * (e.g., getReadable()) to thread the key through without awaiting it the promise
6
- * is resolved lazily inside the first async transform() call.
7
- */
8
- export type EncryptionKeyParam = CryptoKey | undefined | Promise<CryptoKey | undefined>;
9
- /**
10
- * Known serialization format identifiers.
11
- * Each format ID is exactly 4 ASCII characters, matching the convention
12
- * used for other workflow IDs (wrun, step, wait, etc.)
13
- */
14
- export declare const SerializationFormat: {
15
- /** devalue stringify/parse with TextEncoder/TextDecoder */
16
- readonly DEVALUE_V1: "devl";
17
- /** Encrypted payload (inner payload has its own format prefix) */
18
- readonly ENCRYPTED: "encr";
19
- };
2
+ import { decrypt, type EncryptionKeyParam, encrypt } from './serialization/encryption.js';
3
+ import { decodeFormatPrefix, encodeWithFormatPrefix, isEncrypted, peekFormatPrefix } from './serialization/format.js';
4
+ import { type FormatPrefix, isFormatPrefix, SerializationFormat } from './serialization/types.js';
5
+ export { SerializationFormat, type FormatPrefix, isFormatPrefix, encodeWithFormatPrefix, decodeFormatPrefix, peekFormatPrefix, isEncrypted, encrypt, decrypt, type EncryptionKeyParam, };
20
6
  export type SerializationFormatType = (typeof SerializationFormat)[keyof typeof SerializationFormat];
21
- /**
22
- * Encode a payload with a format prefix.
23
- *
24
- * @param format - The format identifier (must be exactly 4 ASCII characters)
25
- * @param payload - The serialized payload bytes
26
- * @returns A new Uint8Array with format prefix prepended
27
- */
28
- export declare function encodeWithFormatPrefix(format: SerializationFormatType, payload: Uint8Array | unknown): Uint8Array | unknown;
29
- /**
30
- * Peek at the format prefix without consuming it.
31
- * Useful for checking if data is encrypted before deciding how to process it.
32
- *
33
- * @param data - The format-prefixed data
34
- * @returns The format identifier, or null if data is legacy/non-binary
35
- */
36
- export declare function peekFormatPrefix(data: Uint8Array | unknown): SerializationFormatType | null;
37
- /**
38
- * Check if data is encrypted (has 'encr' format prefix).
39
- *
40
- * @param data - The format-prefixed data
41
- * @returns true if data has the encrypted format prefix
42
- */
43
- export declare function isEncrypted(data: Uint8Array | unknown): boolean;
44
- /**
45
- * Decode a format-prefixed payload.
46
- *
47
- * @param data - The format-prefixed data
48
- * @returns An object with the format identifier and payload
49
- * @throws Error if the data is too short or has an unknown format
50
- */
51
- export declare function decodeFormatPrefix(data: Uint8Array | unknown): {
52
- format: SerializationFormatType;
53
- payload: Uint8Array;
54
- };
55
7
  /**
56
8
  * Detect if a readable stream is a byte stream.
57
9
  *
@@ -59,8 +11,8 @@ export declare function decodeFormatPrefix(data: Uint8Array | unknown): {
59
11
  * @returns `"bytes"` if the stream is a byte stream, `undefined` otherwise
60
12
  */
61
13
  export declare function getStreamType(stream: ReadableStream): 'bytes' | undefined;
62
- export declare function getSerializeStream(reducers: Reducers, cryptoKey: EncryptionKeyParam): TransformStream<any, Uint8Array>;
63
- export declare function getDeserializeStream(revivers: Revivers, cryptoKey: EncryptionKeyParam): TransformStream<Uint8Array, any>;
14
+ export declare function getSerializeStream(reducers: Partial<Reducers>, cryptoKey: EncryptionKeyParam): TransformStream<any, Uint8Array>;
15
+ export declare function getDeserializeStream(revivers: Partial<Revivers>, cryptoKey: EncryptionKeyParam): TransformStream<Uint8Array, any>;
64
16
  export declare class WorkflowServerReadableStream extends ReadableStream<Uint8Array> {
65
17
  #private;
66
18
  constructor(runId: string, name: string, startIndex?: number);
@@ -68,144 +20,177 @@ export declare class WorkflowServerReadableStream extends ReadableStream<Uint8Ar
68
20
  export declare class WorkflowServerWritableStream extends WritableStream<Uint8Array> {
69
21
  constructor(runId: string, name: string);
70
22
  }
71
- export interface SerializableSpecial {
72
- ArrayBuffer: string;
73
- BigInt: string;
74
- BigInt64Array: string;
75
- BigUint64Array: string;
76
- Date: string;
77
- DOMException: {
23
+ export type { Reducers, Revivers, SerializableSpecial, } from './serialization/types.js';
24
+ import type { Reducers, Revivers } from './serialization/types.js';
25
+ /**
26
+ * Reducers for serialization boundary from the client side, passing arguments
27
+ * to the workflow handler.
28
+ *
29
+ * @param global
30
+ * @param ops
31
+ * @returns
32
+ */
33
+ export declare function getExternalReducers(global: Record<string, any> | undefined, ops: Promise<void>[], runId: string, cryptoKey: EncryptionKeyParam): Partial<Reducers>;
34
+ /**
35
+ * Reducers for serialization boundary from within the workflow execution
36
+ * environment, passing return value to the client side and into step arguments.
37
+ *
38
+ * @param global
39
+ * @returns
40
+ */
41
+ export declare function getWorkflowReducers(global?: Record<string, any>): Partial<Reducers>;
42
+ /**
43
+ * Cancel dangling abort-stream readers on any AbortController instances found
44
+ * in the hydrated step arguments. Called after the step function returns
45
+ * (success or failure) to prevent reader promises from keeping the serverless
46
+ * function alive indefinitely.
47
+ */
48
+ export declare function cancelAbortReaders(...values: unknown[]): void;
49
+ /**
50
+ * Base revivers shared across all serialization boundaries.
51
+ * Composes: class + common revivers from the modular modules.
52
+ *
53
+ * This is exported because serialization-format.ts and other files reference it.
54
+ */
55
+ export declare function getCommonRevivers(global?: Record<string, any>): {
56
+ ArrayBuffer?: ((value: string) => any) | undefined;
57
+ BigInt?: ((value: string) => any) | undefined;
58
+ BigInt64Array?: ((value: string) => any) | undefined;
59
+ BigUint64Array?: ((value: string) => any) | undefined;
60
+ Date?: ((value: string) => any) | undefined;
61
+ DOMException?: ((value: {
78
62
  message: string;
79
63
  name: string;
80
64
  stack?: string;
81
65
  cause?: unknown;
82
- };
83
- Float32Array: string;
84
- Float64Array: string;
85
- Error: Record<string, any>;
86
- Headers: [string, string][];
87
- Int8Array: string;
88
- Int16Array: string;
89
- Int32Array: string;
90
- Map: [any, any][];
91
- ReadableStream: {
66
+ }) => any) | undefined;
67
+ FatalError?: ((value: {
68
+ message: string;
69
+ stack?: string;
70
+ cause?: unknown;
71
+ }) => any) | undefined;
72
+ Float32Array?: ((value: string) => any) | undefined;
73
+ Float64Array?: ((value: string) => any) | undefined;
74
+ Error?: ((value: {
75
+ name: string;
76
+ message: string;
77
+ stack?: string;
78
+ cause?: unknown;
79
+ }) => any) | undefined;
80
+ EvalError?: ((value: {
81
+ message: string;
82
+ stack?: string;
83
+ cause?: unknown;
84
+ }) => any) | undefined;
85
+ Headers?: ((value: [string, string][]) => any) | undefined;
86
+ Int8Array?: ((value: string) => any) | undefined;
87
+ Int16Array?: ((value: string) => any) | undefined;
88
+ Int32Array?: ((value: string) => any) | undefined;
89
+ Map?: ((value: [any, any][]) => any) | undefined;
90
+ RangeError?: ((value: {
91
+ message: string;
92
+ stack?: string;
93
+ cause?: unknown;
94
+ }) => any) | undefined;
95
+ ReadableStream?: ((value: {
92
96
  name: string;
93
- type?: 'bytes';
97
+ type?: "bytes";
94
98
  startIndex?: number;
95
99
  } | {
96
100
  bodyInit: any;
97
- };
98
- RegExp: {
101
+ }) => any) | undefined;
102
+ ReferenceError?: ((value: {
103
+ message: string;
104
+ stack?: string;
105
+ cause?: unknown;
106
+ }) => any) | undefined;
107
+ RegExp?: ((value: {
99
108
  source: string;
100
109
  flags: string;
101
- };
102
- Request: {
110
+ }) => any) | undefined;
111
+ RetryableError?: ((value: {
112
+ message: string;
113
+ stack?: string;
114
+ cause?: unknown;
115
+ retryAfter: number;
116
+ }) => any) | undefined;
117
+ Request?: ((value: {
103
118
  method: string;
104
119
  url: string;
105
120
  headers: Headers;
106
- body: Request['body'];
107
- duplex: Request['duplex'];
121
+ body: Request["body"];
122
+ duplex: Request["duplex"];
108
123
  responseWritable?: WritableStream<Response>;
109
- };
110
- Response: {
111
- type: Response['type'];
124
+ signal?: AbortSignal;
125
+ }) => any) | undefined;
126
+ Response?: ((value: {
127
+ type: Response["type"];
112
128
  url: string;
113
129
  status: number;
114
130
  statusText: string;
115
131
  headers: Headers;
116
- body: Response['body'];
132
+ body: Response["body"];
117
133
  redirected: boolean;
118
- };
119
- Class: {
134
+ }) => any) | undefined;
135
+ Class?: ((value: {
120
136
  classId: string;
121
- };
122
- /**
123
- * Custom serialized class instance.
124
- * The class must have a `classId` property and be registered for deserialization.
125
- */
126
- Instance: {
137
+ }) => any) | undefined;
138
+ Instance?: ((value: {
127
139
  classId: string;
128
140
  data: unknown;
129
- };
130
- Set: any[];
131
- StepFunction: {
141
+ }) => any) | undefined;
142
+ Set?: ((value: any[]) => any) | undefined;
143
+ SyntaxError?: ((value: {
144
+ message: string;
145
+ stack?: string;
146
+ cause?: unknown;
147
+ }) => any) | undefined;
148
+ StepFunction?: ((value: {
132
149
  stepId: string;
133
150
  closureVars?: Record<string, any>;
134
- };
135
- URL: string;
136
- WorkflowFunction: {
151
+ boundThis?: unknown;
152
+ boundArgs?: unknown[];
153
+ }) => any) | undefined;
154
+ TypeError?: ((value: {
155
+ message: string;
156
+ stack?: string;
157
+ cause?: unknown;
158
+ }) => any) | undefined;
159
+ URIError?: ((value: {
160
+ message: string;
161
+ stack?: string;
162
+ cause?: unknown;
163
+ }) => any) | undefined;
164
+ URL?: ((value: string) => any) | undefined;
165
+ WorkflowFunction?: ((value: {
137
166
  workflowId: string;
138
- };
139
- URLSearchParams: string;
140
- Uint8Array: string;
141
- Uint8ClampedArray: string;
142
- Uint16Array: string;
143
- Uint32Array: string;
144
- WritableStream: {
145
- name: string;
146
- };
147
- }
148
- type Reducers = {
149
- [K in keyof SerializableSpecial]: (value: any) => SerializableSpecial[K] | false;
150
- };
151
- type Revivers = {
152
- [K in keyof SerializableSpecial]: (value: SerializableSpecial[K]) => any;
153
- };
154
- /**
155
- * Reducers for serialization boundary from the client side, passing arguments
156
- * to the workflow handler.
157
- *
158
- * @param global
159
- * @param ops
160
- * @returns
161
- */
162
- export declare function getExternalReducers(global: Record<string, any> | undefined, ops: Promise<void>[], runId: string, cryptoKey: EncryptionKeyParam): Reducers;
163
- /**
164
- * Reducers for serialization boundary from within the workflow execution
165
- * environment, passing return value to the client side and into step arguments.
166
- *
167
- * @param global
168
- * @returns
169
- */
170
- export declare function getWorkflowReducers(global?: Record<string, any>): Reducers;
171
- export declare function getCommonRevivers(global?: Record<string, any>): {
172
- readonly ArrayBuffer: (value: string) => any;
173
- readonly BigInt: (value: string) => any;
174
- readonly BigInt64Array: (value: string) => any;
175
- readonly BigUint64Array: (value: string) => any;
176
- readonly Date: (value: string) => any;
177
- readonly DOMException: (value: {
167
+ }) => any) | undefined;
168
+ URLSearchParams?: ((value: string) => any) | undefined;
169
+ Uint8Array?: ((value: string) => any) | undefined;
170
+ Uint8ClampedArray?: ((value: string) => any) | undefined;
171
+ Uint16Array?: ((value: string) => any) | undefined;
172
+ Uint32Array?: ((value: string) => any) | undefined;
173
+ AggregateError?: ((value: {
178
174
  message: string;
179
- name: string;
180
175
  stack?: string;
181
176
  cause?: unknown;
182
- }) => any;
183
- readonly Error: (value: Record<string, any>) => any;
184
- readonly Float32Array: (value: string) => any;
185
- readonly Float64Array: (value: string) => any;
186
- readonly Headers: (value: [string, string][]) => any;
187
- readonly Int8Array: (value: string) => any;
188
- readonly Int16Array: (value: string) => any;
189
- readonly Int32Array: (value: string) => any;
190
- readonly Map: (value: [any, any][]) => any;
191
- readonly RegExp: (value: {
192
- source: string;
193
- flags: string;
194
- }) => any;
195
- readonly Class: (value: {
196
- classId: string;
197
- }) => Function;
198
- readonly Instance: (value: {
199
- classId: string;
200
- data: unknown;
201
- }) => any;
202
- readonly Set: (value: any[]) => any;
203
- readonly URL: (value: string) => any;
204
- readonly URLSearchParams: (value: string) => any;
205
- readonly Uint8Array: (value: string) => any;
206
- readonly Uint8ClampedArray: (value: string) => any;
207
- readonly Uint16Array: (value: string) => any;
208
- readonly Uint32Array: (value: string) => any;
177
+ errors: unknown[];
178
+ }) => any) | undefined;
179
+ WritableStream?: ((value: {
180
+ name: string;
181
+ }) => any) | undefined;
182
+ AbortController?: ((value: {
183
+ streamName: string;
184
+ hookToken: string;
185
+ aborted: boolean;
186
+ reason?: unknown;
187
+ }) => any) | undefined;
188
+ AbortSignal?: ((value: {
189
+ streamName: string;
190
+ hookToken: string;
191
+ aborted: boolean;
192
+ reason?: unknown;
193
+ }) => any) | undefined;
209
194
  };
210
195
  /**
211
196
  * Revivers for deserialization boundary from the client side,
@@ -215,7 +200,7 @@ export declare function getCommonRevivers(global?: Record<string, any>): {
215
200
  * @param ops
216
201
  * @param runId
217
202
  */
218
- export declare function getExternalRevivers(global: Record<string, any> | undefined, ops: Promise<void>[], runId: string, cryptoKey: EncryptionKeyParam): Revivers;
203
+ export declare function getExternalRevivers(global: Record<string, any> | undefined, ops: Promise<void>[], runId: string, cryptoKey: EncryptionKeyParam): Partial<Revivers>;
219
204
  /**
220
205
  * Revivers for deserialization boundary from within the workflow execution
221
206
  * environment, receiving arguments from the client side, and return values
@@ -224,95 +209,100 @@ export declare function getExternalRevivers(global: Record<string, any> | undefi
224
209
  * @param global
225
210
  * @returns
226
211
  */
227
- export declare function getWorkflowRevivers(global?: Record<string, any>): Revivers;
212
+ export declare function getWorkflowRevivers(global?: Record<string, any>): Partial<Revivers>;
228
213
  /**
229
214
  * Encrypt data if the world supports encryption.
230
215
  * Returns original data if encryption is not available.
231
216
  *
232
- * @param data - Serialized data to encrypt
233
- * @param key - Encryption key (undefined to skip encryption)
234
- * @param context - Encryption context with runId
235
- * @returns Encrypted data if encryption available, original data otherwise
217
+ * @deprecated Use `encrypt` from `./serialization/encryption.js` instead.
236
218
  */
237
219
  export declare function maybeEncrypt(data: Uint8Array, key: CryptoKey | undefined): Promise<Uint8Array>;
238
220
  /**
239
221
  * Decrypt data if it has the 'encr' prefix.
240
222
  *
241
- * @param data - Data that may be encrypted
242
- * @param key - Encryption key (undefined if no key available)
243
- * @returns Decrypted data if encrypted, original data otherwise
244
- * @throws {WorkflowRuntimeError} If the data is encrypted but no key is
245
- * available. Callers (e.g., `Run.pollReturnValue()`, `hydrateStepReturnValue`)
246
- * should be aware this can surface as a rejected promise during key rotation
247
- * or misconfiguration scenarios.
223
+ * @deprecated Use `decrypt` from `./serialization/encryption.js` instead.
248
224
  */
249
225
  export declare function maybeDecrypt(data: Uint8Array | unknown, key: CryptoKey | undefined): Promise<Uint8Array | unknown>;
250
226
  /**
251
227
  * Called from the `start()` function to serialize the workflow arguments
252
228
  * into a format that can be saved to the database and then hydrated from
253
229
  * within the workflow execution environment.
254
- *
255
- * @param value - The value to serialize
256
- * @param runId - The workflow run ID (required for encryption context)
257
- * @param key - Encryption key (undefined to skip encryption)
258
- * @param ops - Promise array for stream operations
259
- * @param global - Global object for serialization context
260
- * @param v1Compat - Enable legacy v1 compatibility mode
261
- * @returns The dehydrated value as binary data (Uint8Array) with format prefix
262
230
  */
263
231
  export declare function dehydrateWorkflowArguments(value: unknown, runId: string, key: CryptoKey | undefined, ops?: Promise<void>[], global?: Record<string, any>, v1Compat?: boolean): Promise<Uint8Array | unknown>;
264
232
  /**
265
233
  * Called from workflow execution environment to hydrate the workflow
266
234
  * arguments from the database at the start of workflow execution.
267
- *
268
- * @param value - Binary serialized data (Uint8Array) with format prefix
269
- * @param _runId - Workflow run ID (reserved for future decryption context; decryption is currently driven solely by the provided key)
270
- * @param key - Encryption key (undefined to skip decryption)
271
- * @param global - Global object for deserialization context
272
- * @param extraRevivers - Additional revivers for custom types
273
- * @returns The hydrated value
274
235
  */
275
236
  export declare function hydrateWorkflowArguments(value: Uint8Array | unknown, _runId: string, key: CryptoKey | undefined, global?: Record<string, any>, extraRevivers?: Record<string, (value: any) => any>): Promise<any>;
276
237
  /**
277
238
  * Dehydrate workflow return value for storage.
239
+ */
240
+ export declare function dehydrateWorkflowReturnValue(value: unknown, _runId: string, key: CryptoKey | undefined, global?: Record<string, any>, v1Compat?: boolean): Promise<Uint8Array | unknown>;
241
+ /**
242
+ * Called from the client side to hydrate the workflow return value
243
+ * of a completed workflow run.
244
+ */
245
+ export declare function hydrateWorkflowReturnValue(value: Uint8Array | unknown, runId: string, key: CryptoKey | undefined, ops?: Promise<void>[], global?: Record<string, any>, extraRevivers?: Record<string, (value: any) => any>): Promise<any>;
246
+ /**
247
+ * Called from the workflow handler when a step is being created.
248
+ * Dehydrates values from within the workflow execution environment.
249
+ */
250
+ export declare function dehydrateStepArguments(value: unknown, _runId: string, key: CryptoKey | undefined, global?: Record<string, any>, v1Compat?: boolean): Promise<Uint8Array | unknown>;
251
+ /**
252
+ * Called from the step handler to hydrate the arguments of a step
253
+ * from the database at the start of the step execution.
254
+ */
255
+ export declare function hydrateStepArguments(value: Uint8Array | unknown, runId: string, key: CryptoKey | undefined, ops?: Promise<any>[], global?: Record<string, any>, extraRevivers?: Record<string, (value: any) => any>): Promise<any>;
256
+ /**
257
+ * Called from the step handler when a step has completed.
258
+ * Dehydrates values from within the step execution environment.
259
+ */
260
+ export declare function dehydrateStepReturnValue(value: unknown, runId: string, key: CryptoKey | undefined, ops?: Promise<any>[], global?: Record<string, any>, v1Compat?: boolean): Promise<Uint8Array | unknown>;
261
+ /**
262
+ * Called from the step handler when a step throws. Dehydrates the thrown
263
+ * value from within the step execution environment into a format that can
264
+ * be saved to the database in a `step_failed` or `step_retrying` event.
278
265
  *
279
- * @param value - The value to serialize
266
+ * Any JavaScript value can be thrown (strings, numbers, objects, Errors,
267
+ * Error subclasses), so the same serialization pipeline used for step
268
+ * arguments and return values is applied here.
269
+ *
270
+ * @param value - The thrown value to serialize (can be any type)
280
271
  * @param runId - Run ID for encryption context
281
272
  * @param key - Encryption key (undefined to skip encryption)
273
+ * @param ops - Promise array for stream operations
282
274
  * @param global - Global object for serialization context
283
275
  * @returns The dehydrated value as binary data (Uint8Array) with format prefix
284
276
  */
285
- export declare function dehydrateWorkflowReturnValue(value: unknown, _runId: string, key: CryptoKey | undefined, global?: Record<string, any>, v1Compat?: boolean): Promise<Uint8Array | unknown>;
277
+ export declare function dehydrateStepError(value: unknown, runId: string, key: CryptoKey | undefined, ops?: Promise<any>[], global?: Record<string, any>): Promise<Uint8Array>;
286
278
  /**
287
- * Called from the client side (i.e. the execution environment where
288
- * the workflow run was initiated from) to hydrate the workflow
289
- * return value of a completed workflow run.
279
+ * Called from the workflow handler when replaying the event log of a
280
+ * `step_failed` or `step_retrying` event. Hydrates the thrown value from
281
+ * the database so the workflow can see the original thrown value.
290
282
  *
291
283
  * @param value - Binary serialized data (Uint8Array) with format prefix
292
284
  * @param runId - Run ID for decryption context
293
285
  * @param key - Encryption key (undefined to skip decryption)
294
- * @param ops - Promise array for stream operations
295
286
  * @param global - Global object for deserialization context
296
287
  * @param extraRevivers - Additional revivers for custom types
297
- * @returns The hydrated return value, ready to be consumed by the client
288
+ * @returns The hydrated thrown value, ready to reject the step promise
298
289
  */
299
- export declare function hydrateWorkflowReturnValue(value: Uint8Array | unknown, runId: string, key: CryptoKey | undefined, ops?: Promise<void>[], global?: Record<string, any>, extraRevivers?: Record<string, (value: any) => any>): Promise<any>;
290
+ export declare function hydrateStepError(value: Uint8Array | unknown, _runId: string, key: CryptoKey | undefined, global?: Record<string, any>, extraRevivers?: Record<string, (value: any) => any>): Promise<unknown>;
300
291
  /**
301
- * Called from the workflow handler when a step is being created.
302
- * Dehydrates values from within the workflow execution environment
303
- * into a format that can be saved to the database.
292
+ * Called from the workflow handler when the workflow itself throws.
293
+ * Dehydrates the thrown value from within the workflow execution environment
294
+ * into a format that can be saved to the database in a `run_failed` event.
304
295
  *
305
- * @param value - The value to serialize
296
+ * @param value - The thrown value to serialize (can be any type)
306
297
  * @param runId - Run ID for encryption context
307
298
  * @param key - Encryption key (undefined to skip encryption)
308
299
  * @param global - Global object for serialization context
309
- * @param v1Compat - Enable legacy v1 compatibility mode
310
300
  * @returns The dehydrated value as binary data (Uint8Array) with format prefix
311
301
  */
312
- export declare function dehydrateStepArguments(value: unknown, _runId: string, key: CryptoKey | undefined, global?: Record<string, any>, v1Compat?: boolean): Promise<Uint8Array | unknown>;
302
+ export declare function dehydrateRunError(value: unknown, _runId: string, key: CryptoKey | undefined, global?: Record<string, any>): Promise<Uint8Array>;
313
303
  /**
314
- * Called from the step handler to hydrate the arguments of a step
315
- * from the database at the start of the step execution.
304
+ * Called from the client side (or observability tools) to hydrate the run
305
+ * error value of a failed workflow run.
316
306
  *
317
307
  * @param value - Binary serialized data (Uint8Array) with format prefix
318
308
  * @param runId - Run ID for decryption context
@@ -320,23 +310,9 @@ export declare function dehydrateStepArguments(value: unknown, _runId: string, k
320
310
  * @param ops - Promise array for stream operations
321
311
  * @param global - Global object for deserialization context
322
312
  * @param extraRevivers - Additional revivers for custom types
323
- * @returns The hydrated value, ready to be consumed by the step user-code function
324
- */
325
- export declare function hydrateStepArguments(value: Uint8Array | unknown, runId: string, key: CryptoKey | undefined, ops?: Promise<any>[], global?: Record<string, any>, extraRevivers?: Record<string, (value: any) => any>): Promise<any>;
326
- /**
327
- * Called from the step handler when a step has completed.
328
- * Dehydrates values from within the step execution environment
329
- * into a format that can be saved to the database.
330
- *
331
- * @param value - The value to serialize
332
- * @param runId - Run ID for encryption context
333
- * @param key - Encryption key (undefined to skip encryption)
334
- * @param ops - Promise array for stream operations
335
- * @param global - Global object for serialization context
336
- * @param v1Compat - Enable legacy v1 compatibility mode
337
- * @returns The dehydrated value as binary data (Uint8Array) with format prefix
313
+ * @returns The hydrated thrown value, ready to be consumed by the client
338
314
  */
339
- export declare function dehydrateStepReturnValue(value: unknown, runId: string, key: CryptoKey | undefined, ops?: Promise<any>[], global?: Record<string, any>, v1Compat?: boolean): Promise<Uint8Array | unknown>;
315
+ export declare function hydrateRunError(value: Uint8Array | unknown, runId: string, key: CryptoKey | undefined, ops?: Promise<void>[], global?: Record<string, any>, extraRevivers?: Record<string, (value: any) => any>): Promise<unknown>;
340
316
  /**
341
317
  * Called from the workflow handler when replaying the event log of a `step_completed` event.
342
318
  * Hydrates the return value of a step from the database.
@@ -346,8 +322,8 @@ export declare function dehydrateStepReturnValue(value: unknown, runId: string,
346
322
  * @param key - Encryption key (undefined to skip decryption)
347
323
  * @param global - Global object for deserialization context
348
324
  * @param extraRevivers - Additional revivers for custom types
349
- * @returns The hydrated return value of a step, ready to be consumed by the workflow handler
325
+ * Called from the workflow handler when replaying the event log
326
+ * of a `step_completed` event.
350
327
  */
351
328
  export declare function hydrateStepReturnValue(value: Uint8Array | unknown, _runId: string, key: CryptoKey | undefined, global?: Record<string, any>, extraRevivers?: Record<string, (value: any) => any>): Promise<any>;
352
- export {};
353
329
  //# sourceMappingURL=serialization.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"serialization.d.ts","sourceRoot":"","sources":["../src/serialization.ts"],"names":[],"mappings":"AAMA,OAAO,EAGL,KAAK,SAAS,EACf,MAAM,iBAAiB,CAAC;AAEzB;;;;;GAKG;AACH,MAAM,MAAM,kBAAkB,GAC1B,SAAS,GACT,SAAS,GACT,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC,CAAC;AA2CnC;;;;GAIG;AACH,eAAO,MAAM,mBAAmB;IAC9B,2DAA2D;;IAE3D,kEAAkE;;CAE1D,CAAC;AAEX,MAAM,MAAM,uBAAuB,GACjC,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,OAAO,mBAAmB,CAAC,CAAC;AAWjE;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,uBAAuB,EAC/B,OAAO,EAAE,UAAU,GAAG,OAAO,GAC5B,UAAU,GAAG,OAAO,CAgBtB;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,UAAU,GAAG,OAAO,GACzB,uBAAuB,GAAG,IAAI,CAWhC;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,GAAG,OAAO,CAE/D;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,GAAG;IAC9D,MAAM,EAAE,uBAAuB,CAAC;IAChC,OAAO,EAAE,UAAU,CAAC;CACrB,CA6BA;AAoCD;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,GAAG,SAAS,CAMzE;AAYD,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,kBAAkB,GAC5B,eAAe,CAAC,GAAG,EAAE,UAAU,CAAC,CAgDlC;AAED,wBAAgB,o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