@output.ai/core 0.1.16 → 0.1.18-dev.pr12-egad

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 (21) hide show
  1. package/package.json +1 -1
  2. package/src/index.d.ts +400 -285
  3. package/src/tracing/processors/local/temp/traces/1767713888257_continue_as_new-19b2e908-d403-438f-af77-080d43823bea.trace +4 -0
  4. package/src/tracing/processors/local/temp/traces/1767713888294_continue_as_new-19b2e908-d403-438f-af77-080d43823bea.trace +6 -0
  5. package/src/tracing/processors/local/temp/traces/1767728879418_continue_as_new-20b3caf3-bdfe-4083-9840-95b8cb669c7c.trace +3 -0
  6. package/src/tracing/processors/local/temp/traces/1767728961526_continue_as_new-5e315608-6e29-42c5-b79a-05f82b437b40.trace +4 -0
  7. package/src/tracing/processors/local/temp/traces/1767728961568_continue_as_new-5e315608-6e29-42c5-b79a-05f82b437b40.trace +4 -0
  8. package/src/tracing/processors/local/temp/traces/1767729551367_continue_as_new-33a8b9ac-2c3d-4afe-bfa3-9f07d444dfe8.trace +4 -0
  9. package/src/tracing/processors/local/temp/traces/1767729551409_continue_as_new-33a8b9ac-2c3d-4afe-bfa3-9f07d444dfe8.trace +4 -0
  10. package/src/tracing/processors/local/temp/traces/1767729584838_continue_as_new-d18f20bb-f97a-4bfa-bfc1-48dd72b9fedf.trace +4 -0
  11. package/src/tracing/processors/local/temp/traces/1767729584880_continue_as_new-d18f20bb-f97a-4bfa-bfc1-48dd72b9fedf.trace +4 -0
  12. package/src/tracing/processors/local/temp/traces/1767730300476_continue_as_new-7887230c-c45f-4393-b26c-eae7b9f095a7.trace +4 -0
  13. package/src/tracing/processors/local/temp/traces/1767801228317_continue_as_new-7887230c-c45f-4393-b26c-eae7b9f095a7.trace +4 -0
  14. package/src/tracing/processors/local/temp/traces/1767801231585_continue_as_new-717fd020-1b29-411a-9a8c-974539c362af.trace +4 -0
  15. package/src/tracing/processors/local/temp/traces/1767801231616_continue_as_new-717fd020-1b29-411a-9a8c-974539c362af.trace +4 -0
  16. package/src/tracing/processors/local/temp/traces/1767801234199_continue_as_new-3c43d860-c2e0-4a04-808b-2676bf896426.trace +4 -0
  17. package/src/tracing/processors/local/temp/traces/1767801234233_continue_as_new-3c43d860-c2e0-4a04-808b-2676bf896426.trace +4 -0
  18. package/src/tracing/processors/local/temp/traces/1767891175397_continue_as_new-ee44babc-7690-4488-a24d-3ff258591bee.trace +4 -0
  19. package/src/tracing/processors/local/temp/traces/1767891175445_continue_as_new-ee44babc-7690-4488-a24d-3ff258591bee.trace +4 -0
  20. package/src/worker/temp/__activity_options.js +12 -0
  21. package/src/worker/temp/__workflows_entrypoint.js +21 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@output.ai/core",
3
- "version": "0.1.16",
3
+ "version": "0.1.18-dev.pr12-egad",
4
4
  "description": "The core module of the output framework",
5
5
  "type": "module",
6
6
  "exports": {
package/src/index.d.ts CHANGED
@@ -1,52 +1,189 @@
1
- // Import Zod types for dual schema support
2
1
  import type { z } from 'zod';
3
2
  import type { ActivityOptions } from '@temporalio/workflow';
4
3
 
5
- // Re-export Zod for consumers to use
4
+ /**
5
+ * Expose z from Zod as a convenience.
6
+ */
6
7
  export { z } from 'zod';
7
8
 
9
+ /*
10
+ ╭─────────────────────────╮
11
+ │ C O M M O N T Y P E S │╮
12
+ ╰─────────────────────────╯│
13
+ ╰─────────────────────────╯
14
+ */
15
+
8
16
  /**
9
17
  * Type alias for any Zod schema type.
18
+ */
19
+ export type AnyZodSchema = z.ZodType<any, any, any>; // eslint-disable-line @typescript-eslint/no-explicit-any
20
+
21
+ /**
22
+ * Native Temporal configurations for activities.
10
23
  *
11
- * Note: The use of `any` here is intentional and necessary. Zod's ZodType has three
12
- * generic parameters (Output, Def, Input) that vary based on the specific schema type.
13
- * When we want to accept ANY Zod schema (string, number, object, etc.), we must use
14
- * `any` for these parameters. Using `unknown` would be too restrictive and would
15
- * break Zod's type inference system.
24
+ * All native options are accepted except 'versioningIntent', 'taskQueue', 'allowEagerDispatch'.
16
25
  *
17
- * This is a common pattern in TypeScript when dealing with highly generic types,
18
- * and Zod itself uses this pattern internally.
26
+ * @see {@link https://typescript.temporal.io/api/interfaces/common.ActivityOptions}
19
27
  */
20
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
21
- type AnyZodSchema = z.ZodType<any, any, any>;
28
+ export type TemporalActivityOptions = Omit<ActivityOptions, 'versioningIntent' | 'taskQueue' | 'allowEagerDispatch'>;
29
+
30
+ /*
31
+ ╭─────────╮
32
+ │ S T E P │╮
33
+ ╰─────────╯│
34
+ ╰─────────╯
35
+ */
22
36
 
23
37
  /**
24
- * Activity options accepted by step/evaluator/workflow definitions.
25
- * Exposes supported Temporal ActivityOptions.
38
+ * The handler function of a step.
39
+ *
40
+ * @param input - The step input; it matches the schema defined by `inputSchema`.
41
+ *
42
+ * @returns A value matching the schema defined by `outputSchema`.
43
+ */
44
+ export type StepFunction<
45
+ InputSchema extends AnyZodSchema | undefined = undefined,
46
+ OutputSchema extends AnyZodSchema | undefined = undefined
47
+ > = InputSchema extends AnyZodSchema ?
48
+ ( input: z.infer<InputSchema> ) => Promise<OutputSchema extends AnyZodSchema ? z.infer<OutputSchema> : void> :
49
+ () => Promise<OutputSchema extends AnyZodSchema ? z.infer<OutputSchema> : void>;
50
+
51
+ /**
52
+ * A wrapper around the user defined `fn` handler function.
53
+ *
54
+ * It accepts the same input and returns the same value, calling the user function inside.
55
+ *
56
+ * It adds input and output validation based on the `inputSchema`, `outputSchema`.
57
+ *
58
+ * @param input - The Step input; it matches the schema defined by `inputSchema`.
59
+ * @returns A value matching the schema defined by `outputSchema`.
60
+ */
61
+ export type StepFunctionWrapper<StepFunction> =
62
+ Parameters<StepFunction> extends [infer Input] ?
63
+ ( input: Input ) => ReturnType<StepFunction> :
64
+ () => ReturnType<StepFunction>;
65
+
66
+ /**
67
+ * Creates a step.
68
+ *
69
+ * A step is a logical unit of work that can perform I/O. It is translated to a Temporal Activity.
70
+ *
71
+ * The step logic is defined in the `fn` handler function.
72
+ *
73
+ * The schema of the input that the function receives as the first argument is defined by the `inputSchema` option.
74
+ *
75
+ * The output of the `fn` handler must match the schema defined by `outputSchema`; otherwise, a validation error is raised.
76
+ *
77
+ * @example
78
+ * ```
79
+ * step( {
80
+ * name: 'process',
81
+ * description: 'A generic process',
82
+ * inputSchema: z.object( {
83
+ * value: z.number()
84
+ * } ),
85
+ * outputSchema: z.string(),
86
+ * fn: async input => {
87
+ * const result = await ai.call( input.value );
88
+ * return result as string;
89
+ * }
90
+ * } )
91
+ * ```
92
+ *
93
+ * @example Step without outputSchema
94
+ * ```
95
+ * step( {
96
+ * name: 'process',
97
+ * description: 'A generic process',
98
+ * inputSchema: z.object( {
99
+ * value: z.number()
100
+ * } ),
101
+ * fn: async input => {
102
+ * await ai.call( input.value );
103
+ * }
104
+ * } )
105
+ * ```
106
+ *
107
+ * @example Step without inputSchema
108
+ * ```
109
+ * step( {
110
+ * name: 'process',
111
+ * description: 'A generic process',
112
+ * outputSchema: z.string(),
113
+ * fn: async () => {
114
+ * const result = await ai.call();
115
+ * return result as string;
116
+ * }
117
+ * } )
118
+ * ```
119
+ *
120
+ * @example Step without inputSchema and outputSchema
121
+ * ```
122
+ * step( {
123
+ * name: 'process',
124
+ * description: 'A generic process',
125
+ * fn: async () => {
126
+ * await ai.call();
127
+ * }
128
+ * } )
129
+ * ```
130
+ *
131
+ * @remarks
132
+ * - Never call another step from within a step.
133
+ * - Never call a workflow from within a step.
26
134
  *
27
- * @description Exposes supported Temporal ActivityOptions
135
+ * @typeParam InputSchema - Zod schema for the step input
136
+ * @typeParam OutputSchema - Zod schema for the step output
137
+ *
138
+ * @param params - Step parameters
139
+ * @param params.name - Human-readable step name (must start with a letter or underscore, followed by letters, numbers, or underscores)
140
+ * @param params.description - Description of the step
141
+ * @param params.inputSchema - Zod schema for the `fn` input
142
+ * @param params.outputSchema - Zod schema for the `fn` output
143
+ * @param params.fn - A handler function containing the step code
144
+ * @param params.options - Temporal Activity options
145
+ * @returns \The same handler function set at `fn`
28
146
  */
29
- export type Options = Omit<ActivityOptions, 'versioningIntent' | 'taskQueue' | 'allowEagerDispatch'>;
147
+ export declare function step<
148
+ InputSchema extends AnyZodSchema | undefined = undefined,
149
+ OutputSchema extends AnyZodSchema | undefined = undefined
150
+ >( params: {
151
+ name: string;
152
+ description?: string;
153
+ inputSchema?: InputSchema;
154
+ outputSchema?: OutputSchema;
155
+ fn: StepFunction<InputSchema, OutputSchema>;
156
+ options?: TemporalActivityOptions;
157
+ } ): StepFunctionWrapper<StepFunction<InputSchema, OutputSchema>>;
158
+
159
+ /*
160
+ ╭─────────────────╮
161
+ │ W O R K F L O W │╮
162
+ ╰─────────────────╯│
163
+ ╰─────────────────╯
164
+ */
30
165
 
31
166
  /**
32
- * The last argument when calling workflows is used to configure it
167
+ * Configuration for workflow invocations.
168
+ *
169
+ * Allows overriding Temporal Activity options for this workflow.
33
170
  */
34
- export type WorkflowCallConfig = {
171
+ export type WorkflowInvocationConfiguration = {
35
172
 
36
173
  /**
37
- * Temporal Activity Options
174
+ * Native Temporal Activity options
38
175
  */
39
- options?: Options,
176
+ options?: TemporalActivityOptions,
40
177
 
41
178
  /**
42
- * Whether this workflow will run detached or not.
43
- * Detached workflows called without explicitly awaiting for the result will be "fire-an-forget", outliving the parent.
179
+ * Configures whether this workflow runs detached.
180
+ * Detached workflows called without explicitly awaiting the result are "fire-and-forget" and may outlive the parent.
44
181
  */
45
182
  detached?: boolean
46
183
  };
47
184
 
48
185
  /**
49
- * The second argument for the workflow's fn function
186
+ * The second argument passed to the workflow's `fn` function.
50
187
  */
51
188
  export type WorkflowContext<
52
189
  InputSchema extends AnyZodSchema | undefined = undefined,
@@ -58,25 +195,28 @@ export type WorkflowContext<
58
195
  */
59
196
  control: {
60
197
  /**
61
- * Lets Workflow Execution close successfully and creates a new Workflow Execution.
198
+ * Closes the current workflow execution successfully and creates a new workflow execution.
62
199
  *
63
- * The new Workflow Execution is in the same chain as previous workflow but it will generate another trace file.
200
+ * The new workflow execution is in the same chain as the previous workflow, but it generates another trace file.
64
201
  *
65
- * It is akin to a checkpoint for when the Workflow gets too long or approaches certain scaling limits.
202
+ * It acts as a checkpoint when the workflow gets too long or approaches certain scaling limits.
66
203
  *
67
204
  * It accepts input with the same schema as the parent workflow function (`inputSchema`).
68
205
  *
69
- * Calling the function needs to be the last statement for the workflow, accompanied by a `return`:
206
+ * Calling this function must be the last statement in the workflow, accompanied by a `return`:
207
+ *
208
+ * @example
70
209
  * ```js
71
210
  * return control.continueAsNew();
72
211
  * ```
73
- * Upon returning it, the parent workflow execution is closed without any output and the new execution takes its place.
212
+ * Upon returning, the parent workflow execution closes without any output, and the new execution takes its place.
74
213
  *
75
- * The function return type respects the `outputSchema` although no values are ever returned, the execution is just replaced.
214
+ * The function's return type matches `outputSchema`; although no value is returned, the execution is replaced.
76
215
  *
77
216
  * @see {@link https://docs.temporal.io/develop/typescript/continue-as-new}
78
- * @param {z.infer<InputSchema>|undefined} input - The input for the new run. Omit when the workflow has no input schema.
79
- * @returns {z.infer<OutputSchema>|void} The workflow output type for type-checking; never returns at runtime.
217
+ *
218
+ * @param input - The input for the new run. Omit when the workflow has no input schema.
219
+ * @returns The workflow output type for type-checking; never returns at runtime.
80
220
  */
81
221
  continueAsNew: InputSchema extends AnyZodSchema ?
82
222
  ( input: z.infer<InputSchema> ) => ( OutputSchema extends AnyZodSchema ? z.infer<OutputSchema> : void ) :
@@ -88,206 +228,170 @@ export type WorkflowContext<
88
228
  * Prefer returning the `continueAsNew(...)` call immediately when this becomes `true`.
89
229
  *
90
230
  * @see {@link https://docs.temporal.io/develop/typescript/continue-as-new#how-to-test}
91
- * @returns {boolean} True if a continue-as-new is suggested for the current run; otherwise false.
231
+ *
232
+ * @returns True if a continue-as-new is suggested for the current run; otherwise false.
92
233
  */
93
234
  isContinueAsNewSuggested: () => boolean
94
235
  }
95
236
  };
96
237
 
97
- /*
98
- ╭─────────╮
99
- │ S T E P │╮
100
- ╰─────────╯│
101
- ╰─────────╯
102
- */
103
-
104
- /*
105
- * There are 4 overloads of the "step" function:
106
- * - with fn receiving input and returning output;
107
- * - with fn receiving input and returning void;
108
- * - with fn receiving void and returning output;
109
- * - with fn receiving void and returning void;
110
- */
111
-
112
- /**
113
- * Creates logical unit of work defined schema for both input and output.
114
- *
115
- * @param {object} options - Step options
116
- * @param {string} options.name - Human-readable step name (only letters, numbers and "_")
117
- * @param {string} [options.description] - Description of the step
118
- * @param {z.ZodType} options.inputSchema - Zod schema for the fn input
119
- * @param {z.ZodType} options.outputSchema - Zod schema for the fn output
120
- * @param {function} options.fn - The function logic: `(input: z.infer<InputSchema>) => Promise<z.infer<OutputSchema>>`
121
- * @param {Options} [options.options] - Activity retry options
122
- * @returns {function} Function with signature: `(input: z.infer<InputSchema>) => Promise<z.infer<OutputSchema>>`
123
- */
124
- export async function step<
125
- InputSchema extends AnyZodSchema,
126
- OutputSchema extends AnyZodSchema
127
- >( options: {
128
- name: string;
129
- description?: string;
130
- inputSchema: InputSchema;
131
- outputSchema: OutputSchema;
132
- fn: ( input: z.infer<InputSchema> ) => Promise<z.infer<OutputSchema>>;
133
- options?: Options;
134
- } ): ( input: z.infer<InputSchema> ) => Promise<z.infer<OutputSchema>>;
135
-
136
238
  /**
137
- * Creates logical unit of work with defined schema for input only.
138
- *
139
- * @param {object} options - Step options
140
- * @param {string} options.name - Human-readable step name (only letters, numbers and "_")
141
- * @param {string} [options.description] - Description of the step
142
- * @param {z.ZodType} options.inputSchema - Zod schema for the fn input
143
- * @param {function} options.fn - The function logic: `(input: z.infer<InputSchema>) => Promise<void>`
144
- * @param {Options} [options.options] - Activity retry options
145
- * @returns {function} Function with signature: `(input: z.infer<InputSchema>) => Promise<void>`
239
+ * The handler function of a workflow.
240
+ *
241
+ * @param input - The workflow input; it matches the schema defined by `inputSchema`.
242
+ * @param context - A context object with tools and information.
243
+ *
244
+ * @returns A value matching the schema defined by `outputSchema`.
146
245
  */
147
- export async function step<
148
- InputSchema extends AnyZodSchema
149
- >( options: {
150
- name: string;
151
- description?: string;
152
- inputSchema: InputSchema;
153
- fn: ( input: z.infer<InputSchema> ) => Promise<void>;
154
- options?: Options;
155
- } ): ( input: z.infer<InputSchema> ) => Promise<void>;
246
+ export type WorkflowFunction<
247
+ InputSchema extends AnyZodSchema | undefined = undefined,
248
+ OutputSchema extends AnyZodSchema | undefined = undefined
249
+ > = InputSchema extends AnyZodSchema ?
250
+ ( input: z.infer<InputSchema>, context: WorkflowContext<InputSchema, OutputSchema> ) =>
251
+ Promise<OutputSchema extends AnyZodSchema ? z.infer<OutputSchema> : void> :
252
+ ( input?: undefined | null, context: WorkflowContext<InputSchema, OutputSchema> ) =>
253
+ Promise<OutputSchema extends AnyZodSchema ? z.infer<OutputSchema> : void>;
156
254
 
157
255
  /**
158
- * Creates logical unit of work with defined schema for output only.
159
- *
160
- * @param {object} options - Step options
161
- * @param {string} options.name - Human-readable step name (only letters, numbers and "_")
162
- * @param {string} [options.description] - Description of the step
163
- * @param {z.ZodType} options.outputSchema - Zod schema for the fn output
164
- * @param {function} options.fn - The function logic: `() => Promise<z.infer<OutputSchema>>`
165
- * @param {Options} [options.options] - Activity retry options
166
- * @returns {function} Function with signature: `() => Promise<z.infer<OutputSchema>>`
256
+ * A wrapper around the user defined `fn` handler function.
257
+ *
258
+ * It accepts the same input and returns the same value, calling the user function inside.
259
+ *
260
+ * The second argument is a WorkflowInvocationConfiguration object, allowing workflows configuration overwrite.
261
+ *
262
+ * It adds input and output validation based on the `inputSchema`, `outputSchema`.
263
+ *
264
+ * @param input - The workflow input; it matches the schema defined by `inputSchema`.
265
+ * @param config - Additional configuration for the invocation.
266
+ * @returns A value matching the schema defined by `outputSchema`.
167
267
  */
168
- export async function step<
169
- OutputSchema extends AnyZodSchema
170
- >( options: {
171
- name: string;
172
- description?: string;
173
- outputSchema: OutputSchema;
174
- fn: () => Promise<z.infer<OutputSchema>>;
175
- options?: Options;
176
- } ): () => Promise<z.infer<OutputSchema>>;
268
+ export type WorkflowFunctionWrapper<WorkflowFunction> =
269
+ [Parameters<WorkflowFunction>[0]] extends [undefined | null] ?
270
+ ( input?: undefined | null, config?: WorkflowInvocationConfiguration ) => ReturnType<WorkflowFunction> :
271
+ ( input: Parameters<WorkflowFunction>[0], config?: WorkflowInvocationConfiguration ) => ReturnType<WorkflowFunction>;
177
272
 
178
273
  /**
179
- * Creates logical unit of work without schemas.
180
- *
181
- * @param {object} options - Step options
182
- * @param {string} options.name - Human-readable step name (only letters, numbers and "_")
183
- * @param {string} [options.description] - Description of the step
184
- * @param {function} options.fn - The function logic: `() => Promise<void>`
185
- * @param {Options} [options.options] - Activity retry options
186
- * @returns {function} Function with signature: `() => Promise<void>`
274
+ * Creates a workflow.
275
+ *
276
+ * A workflow is an orchestration of one or more steps. It is translated to a Temporal Workflow.
277
+ *
278
+ * The workflow logic is defined in the `fn` handler function.
279
+ *
280
+ * The schema of the input that the function receives as the first argument is defined by `inputSchema`.
281
+ *
282
+ * The output of the `fn` handler must match `outputSchema`; otherwise, a validation error is raised.
283
+ *
284
+ * @remarks
285
+ * - Workflows should respect the same limitations as Temporal workflows.
286
+ * - Workflows can invoke steps or evaluators and cannot perform I/O directly.
287
+ * - The workflow `name` needs to be unique across all workflows in the project.
288
+ *
289
+ * @example
290
+ * ```
291
+ * import { step } from './my_steps.ts';
292
+ *
293
+ * workflow( {
294
+ * name: 'main',
295
+ * description: 'A generic workflow',
296
+ * inputSchema: z.object( {
297
+ * value: z.number()
298
+ * } ),
299
+ * outputSchema: z.string(),
300
+ * fn: async input => {
301
+ * const result = await step( input.value );
302
+ * return result as string;
303
+ * }
304
+ * } )
305
+ * ```
306
+ *
307
+ * @example Workflow without outputSchema
308
+ * ```
309
+ * import { step } from './my_steps.ts';
310
+ *
311
+ * workflow( {
312
+ * name: 'main',
313
+ * description: 'A generic workflow',
314
+ * inputSchema: z.object( {
315
+ * value: z.number()
316
+ * } ),
317
+ * fn: async input => {
318
+ * await step( input.value );
319
+ * }
320
+ * } )
321
+ * ```
322
+ *
323
+ * @example Workflow without inputSchema
324
+ * ```
325
+ * import { step } from './my_steps.ts';
326
+ *
327
+ * workflow( {
328
+ * name: 'main',
329
+ * description: 'A generic workflow',
330
+ * outputSchema: z.string(),
331
+ * fn: async () => {
332
+ * const result = await step();
333
+ * return result as string;
334
+ * }
335
+ * } )
336
+ * ```
337
+ *
338
+ * @example Workflow without inputSchema and outputSchema
339
+ * ```
340
+ * import { step } from './my_steps.ts';
341
+ *
342
+ * workflow( {
343
+ * name: 'main',
344
+ * description: 'A generic workflow',
345
+ * fn: async () => {
346
+ * await step();
347
+ * }
348
+ * } )
349
+ * ```
350
+ *
351
+ * @example Using continueAsNew
352
+ * The function `continueAsNew` (same as Temporal) can be used to create a new workflow with the same ID and pass different input.
353
+ *
354
+ * ```
355
+ * import { step } from './my_steps.ts';
356
+ *
357
+ * workflow( {
358
+ * name: 'main',
359
+ * description: 'A generic workflow',
360
+ * inputSchema: z.object( {
361
+ * value: z.number()
362
+ * } ),
363
+ * outputSchema: z.string(),
364
+ * fn: async ( input, context ) => {
365
+ * const result = await step( input.value );
366
+ * if ( context.control.isContinueAsNewSuggested() ) {
367
+ * return context.control.continueAsNew( input );
368
+ * }
369
+ *
370
+ * return result as string;
371
+ * }
372
+ * } )
373
+ * ```
374
+ *
375
+ * @param params - Workflow parameters
376
+ * @param params.name - Human-readable workflow name (must start with a letter or underscore, followed by letters, numbers, or underscores).
377
+ * @param params.description - Description of the workflow
378
+ * @param params.inputSchema - Zod schema for workflow input
379
+ * @param params.outputSchema - Zod schema for workflow output
380
+ * @param params.fn - A function containing the workflow code
381
+ * @param params.options - Temporal Activity options
382
+ * @returns The same handler function set at `fn` with a different signature
187
383
  */
188
- export async function step( options: {
384
+ export declare function workflow<
385
+ InputSchema extends AnyZodSchema | undefined = undefined,
386
+ OutputSchema extends AnyZodSchema | undefined = undefined
387
+ >( params: {
189
388
  name: string;
190
389
  description?: string;
191
- fn: () => Promise<void>;
192
- options?: Options;
193
- } ): () => Promise<void>;
194
-
195
- /*
196
- ╭─────────────────╮
197
- │ W O R K F L O W │╮
198
- ╰─────────────────╯│
199
- ╰─────────────────╯
200
- */
201
- /*
202
- * There are 4 overloads of the "workflow" function:
203
- * - with fn receiving input and returning output;
204
- * - with fn receiving input and returning void;
205
- * - with fn receiving void and returning output;
206
- * - with fn receiving void and returning void;
207
- */
208
-
209
- /**
210
- * Creates a workflow orchestrator with defined schema for both input and output.
211
- *
212
- * @param {object} options - Workflow options
213
- * @param {string} options.name - Unique workflow name
214
- * @param {string} [options.description] - Description of the workflow
215
- * @param {z.ZodType} options.inputSchema - Zod schema for workflow input
216
- * @param {z.ZodType} options.outputSchema - Zod schema for workflow output
217
- * @param {function} options.fn - Workflow logic
218
- * @param {Options} [options.options] - Activity retry options
219
- * @returns {function} Callable workflow function
220
- */
221
- export function workflow<
222
- InputSchema extends AnyZodSchema,
223
- OutputSchema extends AnyZodSchema
224
- >( options : {
225
- name: string,
226
- description?: string,
227
- inputSchema: InputSchema,
228
- outputSchema: OutputSchema,
229
- fn: ( input: z.infer<InputSchema>, context: WorkflowContext<InputSchema, OutputSchema> ) => Promise<z.infer<OutputSchema>>,
230
- options?: Options
231
- } ): ( input: z.infer<InputSchema>, extra?: WorkflowCallConfig ) => Promise<z.infer<OutputSchema>>;
232
-
233
- /**
234
- * Creates a workflow orchestrator with defined schema for input only.
235
- *
236
- * @param {object} options - Workflow options
237
- * @param {string} options.name - Unique workflow name
238
- * @param {string} [options.description] - Description of the workflow
239
- * @param {z.ZodType} options.inputSchema - Zod schema for workflow input
240
- * @param {function} options.fn - Workflow logic
241
- * @param {Options} [options.options] - Activity retry options
242
- * @returns {function} Callable workflow function
243
- */
244
- export function workflow<
245
- InputSchema extends AnyZodSchema
246
- >( options : {
247
- name: string,
248
- description?: string,
249
- inputSchema: InputSchema,
250
- fn: ( input: z.infer<InputSchema>, context: WorkflowContext<InputSchema, undefined> ) => Promise<void>,
251
- options?: Options
252
- } ): ( input: z.infer<InputSchema>, extra?: WorkflowCallConfig ) => Promise<void>;
253
-
254
- /**
255
- * Creates a workflow orchestrator with defined schema for output only.
256
- *
257
- * @param {object} options - Workflow options
258
- * @param {string} options.name - Unique workflow name
259
- * @param {string} [options.description] - Description of the workflow
260
- * @param {z.ZodType} options.outputSchema - Zod schema for workflow output
261
- * @param {function} options.fn - Workflow logic
262
- * @param {Options} [options.options] - Activity retry options
263
- * @returns {function} Callable workflow function
264
- */
265
- export function workflow<
266
- OutputSchema extends AnyZodSchema
267
- >( options : {
268
- name: string,
269
- description?: string,
270
- outputSchema: OutputSchema,
271
- fn: ( input?: undefined | null, context: WorkflowContext<undefined, OutputSchema> ) => Promise<z.infer<OutputSchema>>,
272
- options?: Options
273
- } ): ( input?: undefined | null, extra?: WorkflowCallConfig ) => Promise<z.infer<OutputSchema>>;
274
-
275
- /**
276
- * Creates a workflow orchestrator without defined schemas.
277
- *
278
- * @param {object} options - Workflow options
279
- * @param {string} options.name - Unique workflow name
280
- * @param {string} [options.description] - Description of the workflow
281
- * @param {function} options.fn - Workflow logic
282
- * @param {Options} [options.options] - Activity retry options
283
- * @returns {function} Callable workflow function
284
- */
285
- export function workflow( options : {
286
- name: string,
287
- description?: string,
288
- fn: ( input?: undefined | null, context: WorkflowContext<undefined, undefined> ) => Promise<void>,
289
- options?: Options
290
- } ): ( input?: undefined | null, extra?: WorkflowCallConfig ) => Promise<void>;
390
+ inputSchema?: InputSchema;
391
+ outputSchema?: OutputSchema;
392
+ fn: WorkflowFunction<InputSchema, OutputSchema>;
393
+ options?: TemporalActivityOptions;
394
+ } ): WorkflowFunctionWrapper<WorkflowFunction<InputSchema, OutputSchema>>;
291
395
 
292
396
  /*
293
397
  ╭───────────────────╮
@@ -297,31 +401,32 @@ export function workflow( options : {
297
401
  */
298
402
 
299
403
  /**
300
- * Generic EvaluationResult class, represents the result of an evaluation
404
+ * Represents the result of an evaluation.
405
+ *
406
+ * Generic base class; evaluators must return an instance of an EvaluationResult subclass.
301
407
  */
302
- class EvaluationResult {
408
+ export class EvaluationResult {
303
409
  /**
304
410
  * @constructor
305
- * @param {object} args
306
- * @param {any} args.value - The value of the evaluation
307
- * @param {number} args.confidence - The confidence on the evaluation
308
- * @param {string} [args.reasoning] - The reasoning behind the result
411
+ * @param args
412
+ * @param args.value - The value of the evaluation
413
+ * @param args.confidence - The confidence in the evaluation
414
+ * @param args.reasoning - The reasoning behind the result
309
415
  */
310
416
  constructor( args: { value: any; confidence: number; reasoning?: string } ); // eslint-disable-line @typescript-eslint/no-explicit-any
311
417
 
312
418
  /**
313
- * @returns {any} The evaluation result value
419
+ * @returns The evaluation result value
314
420
  */
315
-
316
421
  get value(): any; // eslint-disable-line @typescript-eslint/no-explicit-any
317
422
 
318
423
  /**
319
- * @returns {number} The evaluation result confidence
424
+ * @returns The evaluation result confidence
320
425
  */
321
426
  get confidence(): number;
322
427
 
323
428
  /**
324
- * @returns {string} The evaluation result reasoning
429
+ * @returns The evaluation result reasoning
325
430
  */
326
431
  get reasoning(): string;
327
432
  }
@@ -333,15 +438,15 @@ class EvaluationResult {
333
438
  export class EvaluationStringResult extends EvaluationResult {
334
439
  /**
335
440
  * @constructor
336
- * @param {object} args
337
- * @param {string} args.value - The value of the evaluation
338
- * @param {number} args.confidence - The confidence on the evaluation
339
- * @param {string} [args.reasoning] - The reasoning behind the result
441
+ * @param args
442
+ * @param args.value - The value of the evaluation
443
+ * @param args.confidence - The confidence on the evaluation
444
+ * @param args.reasoning - The reasoning behind the result
340
445
  */
341
446
  constructor( args: { value: string; confidence: number; reasoning?: string } );
342
447
 
343
448
  /**
344
- * @returns {string} The evaluation result value
449
+ * @returns The evaluation result value
345
450
  */
346
451
  get value(): string;
347
452
  }
@@ -353,15 +458,15 @@ export class EvaluationStringResult extends EvaluationResult {
353
458
  export class EvaluationNumberResult extends EvaluationResult {
354
459
  /**
355
460
  * @constructor
356
- * @param {object} args
357
- * @param {number} args.value - The value of the evaluation
358
- * @param {number} args.confidence - The confidence on the evaluation
359
- * @param {string} [args.reasoning] - The reasoning behind the result
461
+ * @param args
462
+ * @param args.value - The value of the evaluation
463
+ * @param args.confidence - The confidence on the evaluation
464
+ * @param args.reasoning - The reasoning behind the result
360
465
  */
361
466
  constructor( args: { value: number; confidence: number; reasoning?: string } );
362
467
 
363
468
  /**
364
- * @returns {number} The evaluation result value
469
+ * @returns The evaluation result value
365
470
  */
366
471
  get value(): number;
367
472
  }
@@ -373,71 +478,72 @@ export class EvaluationNumberResult extends EvaluationResult {
373
478
  export class EvaluationBooleanResult extends EvaluationResult {
374
479
  /**
375
480
  * @constructor
376
- * @param {object} args
377
- * @param {boolean} args.value - The value of the evaluation
378
- * @param {number} args.confidence - The confidence on the evaluation
379
- * @param {string} [args.reasoning] - The reasoning behind the result
481
+ * @param args
482
+ * @param args.value - The value of the evaluation
483
+ * @param args.confidence - The confidence on the evaluation
484
+ * @param args.reasoning - The reasoning behind the result
380
485
  */
381
486
  constructor( args: { value: boolean; confidence: number; reasoning?: string } );
382
487
 
383
488
  /**
384
- * @returns {boolean} The evaluation result value
489
+ * @returns The evaluation result value
385
490
  */
386
491
  get value(): boolean;
387
492
  }
388
493
 
389
- /*
390
- * There are 2 overloads of the "evaluator" function:
391
- * - with fn receiving input;
392
- * - with fn receiving void;
494
+ /**
495
+ * The handler function of an evaluator.
496
+ *
497
+ * @param input - The evaluator input; it matches the schema defined by `inputSchema`.
498
+ *
499
+ * @returns The result of the evaluation.
393
500
  */
501
+ export type EvaluatorFunction<
502
+ InputSchema extends AnyZodSchema | undefined = undefined,
503
+ Result extends EvaluationResult
504
+ > = InputSchema extends AnyZodSchema ?
505
+ ( input: z.infer<InputSchema> ) => Promise<Result> :
506
+ () => Promise<Result>;
394
507
 
395
508
  /**
396
- * Creates workflow evaluation of work defined schema for input.
397
- *
398
- * @param {object} options - Evaluator options
399
- * @param {string} options.name - Human-readable evaluator name (only letters, numbers and "_")
400
- * @param {string} [options.description] - Description of the evaluator
401
- * @param {z.ZodType} options.inputSchema - Zod schema for the fn input
402
- * @param {function} options.fn - The function logic: `(input: z.infer<InputSchema>) => Promise<z.infer<OutputSchema>>`
403
- * @param {Options} [options.options] - Activity retry options
404
- * @returns {function} Function with signature: `(input: z.infer<InputSchema>) => Promise<z.infer<OutputSchema>>`
509
+ * A wrapper around the user defined `fn` handler function.
510
+ *
511
+ * It has the same signature and returns the same value, calling the user function inside.
512
+ *
513
+ * It adds input validation based on the `inputSchema`.
405
514
  */
406
- export async function evaluator<
407
- InputSchema extends AnyZodSchema,
408
- Result extends EvaluationResult
409
- >( options: {
410
- name: string;
411
- description?: string;
412
- inputSchema: InputSchema;
413
- fn: ( input: z.infer<InputSchema> ) => Promise<Result>;
414
- options?: Options;
415
- } ): ( input: z.infer<InputSchema> ) => Promise<Result>;
515
+ export type EvaluatorFunctionWrapper<EvaluatorFunction> =
516
+ Parameters<EvaluatorFunction> extends [infer Input] ?
517
+ ( input: Input ) => ReturnType<EvaluatorFunction> :
518
+ () => ReturnType<EvaluatorFunction>;
416
519
 
417
520
  /**
418
- * Creates workflow evaluation without a defined input schema.
419
- *
420
- * @param {object} options - Evaluator options
421
- * @param {string} options.name - Human-readable evaluator name (only letters, numbers and "_")
422
- * @param {string} [options.description] - Description of the evaluator
423
- * @param {z.ZodType} options.inputSchema - Zod schema for the fn input
424
- * @param {function} options.fn - The function logic: `(input: z.infer<InputSchema>) => Promise<z.infer<OutputSchema>>`
425
- * @param {Options} [options.options] - Activity retry options
426
- * @returns {function} Function with signature: `(input: z.infer<InputSchema>) => Promise<z.infer<OutputSchema>>`
521
+ * Creates an evaluation function. It is similar to a step, but must return an EvaluationResult.
522
+ *
523
+ * It is translated to a Temporal Activity.
524
+ *
525
+ * @param params - Evaluator parameters
526
+ * @param params.name - Human-readable evaluator name (must start with a letter or underscore, followed by letters, numbers, or underscores)
527
+ * @param params.description - Description of the evaluator
528
+ * @param params.inputSchema - Zod schema for the `fn` input
529
+ * @param params.fn - A function containing the evaluator code
530
+ * @param params.options - Temporal Activity options
531
+ * @returns A wrapper function around the `fn` function
427
532
  */
428
- export async function evaluator<
533
+ export declare function evaluator<
429
534
  InputSchema extends AnyZodSchema,
430
535
  Result extends EvaluationResult
431
- >( options: {
536
+ >( params: {
432
537
  name: string;
433
538
  description?: string;
434
- fn: ( input: z.infer<InputSchema> ) => Promise<Result>;
435
- options?: Options;
436
- } ): ( input: z.infer<InputSchema> ) => Promise<Result>;
539
+ inputSchema: InputSchema;
540
+ fn: EvaluatorFunction<InputSchema, Result>;
541
+ options?: TemporalActivityOptions;
542
+ } ): EvaluatorFunctionWrapper<EvaluatorFunction<InputSchema, Result>>;
437
543
 
438
544
  /*
439
545
  ╭───────────╮
440
- │ O T H E R │╮
546
+ T O O L S │╮
441
547
  ╰───────────╯│
442
548
  ╰───────────╯
443
549
  */
@@ -448,23 +554,32 @@ export async function evaluator<
448
554
  * Sends a request via an activity; the workflow will await a corresponding
449
555
  * resume signal to continue and return the response payload.
450
556
  *
451
- * @param {object} options - Webhook request options
452
- * @param {string} options.url - Webhook request url (POST)
453
- * @param {object} [options.payload] - Webhook request payload
454
- * @returns {Promise<object>} Resolves with the response payload when resumed
557
+ * @param params - Webhook request parameters
558
+ * @param params.url - Webhook request URL (POST)
559
+ * @param params.payload - Webhook request payload
560
+ * @returns Resolves with the response payload when resumed
455
561
  */
456
- export function createWebhook( options: { url: string; payload?: object } ): Promise<object>;
562
+ export declare function createWebhook( params: { url: string; payload?: object } ): Promise<object>;
563
+
564
+ /*
565
+ ╭─────────────╮
566
+ │ E R R O R S │╮
567
+ ╰─────────────╯│
568
+ ╰─────────────╯
569
+ */
457
570
 
458
571
  /**
459
572
  * Error indicating a non-recoverable failure.
460
573
  *
461
- * Use for failures that should not be retried by the workflow runtime.
574
+ * Throw this error to end the workflow execution altogether without retries.
462
575
  */
463
576
  export class FatalError extends Error {}
464
577
 
465
578
  /**
466
579
  * Error indicating invalid input or schema validation issues.
467
580
  *
468
- * Use for problems detected during input validation or contract checks.
581
+ * This error is thrown when there are validation errors, either in the input or output, for steps, evaluators, and workflows.
582
+ *
583
+ * It will end the workflow execution without retries.
469
584
  */
470
585
  export class ValidationError extends Error {}
@@ -0,0 +1,4 @@
1
+ {"kind":"workflow","phase":"start","name":"continue_as_new","id":"continue_as_new-19b2e908-d403-438f-af77-080d43823bea","timestamp":1767713888277,"details":{"value":1}}
2
+ {"kind":"step","phase":"start","name":"/app/test_workflows/dist/continue_as_new#increment","id":"1","parentId":"continue_as_new-19b2e908-d403-438f-af77-080d43823bea","timestamp":1767713888285,"details":1}
3
+ {"kind":"step","phase":"end","name":"/app/test_workflows/dist/continue_as_new#increment","id":"1","parentId":"continue_as_new-19b2e908-d403-438f-af77-080d43823bea","timestamp":1767713888285,"details":2}
4
+ {"kind":"workflow","phase":"end","name":"continue_as_new","id":"continue_as_new-19b2e908-d403-438f-af77-080d43823bea","timestamp":1767713888293,"details":"<continued_as_new>"}
@@ -0,0 +1,6 @@
1
+ {"kind":"workflow","phase":"start","name":"continue_as_new","id":"continue_as_new-19b2e908-d403-438f-af77-080d43823bea","timestamp":1767713889325,"details":{"value":2}}
2
+ {"kind":"step","phase":"start","name":"/app/test_workflows/dist/continue_as_new#increment","id":"1","parentId":"continue_as_new-19b2e908-d403-438f-af77-080d43823bea","timestamp":1767713889333,"details":2}
3
+ {"kind":"step","phase":"end","name":"/app/test_workflows/dist/continue_as_new#increment","id":"1","parentId":"continue_as_new-19b2e908-d403-438f-af77-080d43823bea","timestamp":1767713889334,"details":3}
4
+ {"kind":"internal_step","phase":"start","name":"__internal#getTraceDestinations","id":"2","parentId":"continue_as_new-19b2e908-d403-438f-af77-080d43823bea","timestamp":1767713889345,"details":{"startTime":"2026-01-06T15:38:08.294Z","workflowId":"continue_as_new-19b2e908-d403-438f-af77-080d43823bea","workflowName":"continue_as_new"}}
5
+ {"kind":"internal_step","phase":"end","name":"__internal#getTraceDestinations","id":"2","parentId":"continue_as_new-19b2e908-d403-438f-af77-080d43823bea","timestamp":1767713889345,"details":{"local":"/Users/sz/Dev/output/test_workflows/logs/runs/continue_as_new/2026-01-06-15-38-08-294Z_continue_as_new-19b2e908-d403-438f-af77-080d43823bea.json","remote":null}}
6
+ {"kind":"workflow","phase":"end","name":"continue_as_new","id":"continue_as_new-19b2e908-d403-438f-af77-080d43823bea","timestamp":1767713889351,"details":{"output":{"result":3},"trace":{"destinations":{"local":"/Users/sz/Dev/output/test_workflows/logs/runs/continue_as_new/2026-01-06-15-38-08-294Z_continue_as_new-19b2e908-d403-438f-af77-080d43823bea.json","remote":null}}}}
@@ -0,0 +1,3 @@
1
+ {"kind":"workflow","phase":"start","name":"continue_as_new","id":"continue_as_new-20b3caf3-bdfe-4083-9840-95b8cb669c7c","timestamp":1767728879442,"details":{"value":1}}
2
+ {"kind":"step","phase":"start","name":"/app/test_workflows/dist/continue_as_new#increment","id":"1","parentId":"continue_as_new-20b3caf3-bdfe-4083-9840-95b8cb669c7c","timestamp":1767728879450,"details":1}
3
+ {"kind":"step","phase":"end","name":"/app/test_workflows/dist/continue_as_new#increment","id":"1","parentId":"continue_as_new-20b3caf3-bdfe-4083-9840-95b8cb669c7c","timestamp":1767728879451,"details":2}
@@ -0,0 +1,4 @@
1
+ {"kind":"workflow","phase":"start","name":"continue_as_new","id":"continue_as_new-5e315608-6e29-42c5-b79a-05f82b437b40","timestamp":1767728961548,"details":{"value":1}}
2
+ {"kind":"step","phase":"start","name":"/app/test_workflows/dist/continue_as_new#increment","id":"1","parentId":"continue_as_new-5e315608-6e29-42c5-b79a-05f82b437b40","timestamp":1767728961556,"details":1}
3
+ {"kind":"step","phase":"end","name":"/app/test_workflows/dist/continue_as_new#increment","id":"1","parentId":"continue_as_new-5e315608-6e29-42c5-b79a-05f82b437b40","timestamp":1767728961557,"details":2}
4
+ {"kind":"workflow","phase":"end","name":"continue_as_new","id":"continue_as_new-5e315608-6e29-42c5-b79a-05f82b437b40","timestamp":1767728961567,"details":"<continued_as_new>"}
@@ -0,0 +1,4 @@
1
+ {"kind":"workflow","phase":"start","name":"continue_as_new","id":"continue_as_new-5e315608-6e29-42c5-b79a-05f82b437b40","timestamp":1767728962590,"details":{"value":2}}
2
+ {"kind":"step","phase":"start","name":"/app/test_workflows/dist/continue_as_new#increment","id":"1","parentId":"continue_as_new-5e315608-6e29-42c5-b79a-05f82b437b40","timestamp":1767728962598,"details":2}
3
+ {"kind":"step","phase":"end","name":"/app/test_workflows/dist/continue_as_new#increment","id":"1","parentId":"continue_as_new-5e315608-6e29-42c5-b79a-05f82b437b40","timestamp":1767728962599,"details":3}
4
+ {"kind":"workflow","phase":"end","name":"continue_as_new","id":"continue_as_new-5e315608-6e29-42c5-b79a-05f82b437b40","timestamp":1767728962614,"details":{"output":{"result":3},"trace":{"destinations":{"local":"/Users/sz/Dev/output/test_workflows/logs/runs/continue_as_new/2026-01-06-19-49-21-568Z_continue_as_new-5e315608-6e29-42c5-b79a-05f82b437b40.json","remote":null}}}}
@@ -0,0 +1,4 @@
1
+ {"kind":"workflow","phase":"start","name":"continue_as_new","id":"continue_as_new-33a8b9ac-2c3d-4afe-bfa3-9f07d444dfe8","timestamp":1767729551389,"details":{"value":1}}
2
+ {"kind":"step","phase":"start","name":"/app/test_workflows/dist/continue_as_new#increment","id":"1","parentId":"continue_as_new-33a8b9ac-2c3d-4afe-bfa3-9f07d444dfe8","timestamp":1767729551398,"details":1}
3
+ {"kind":"step","phase":"end","name":"/app/test_workflows/dist/continue_as_new#increment","id":"1","parentId":"continue_as_new-33a8b9ac-2c3d-4afe-bfa3-9f07d444dfe8","timestamp":1767729551399,"details":2}
4
+ {"kind":"workflow","phase":"end","name":"continue_as_new","id":"continue_as_new-33a8b9ac-2c3d-4afe-bfa3-9f07d444dfe8","timestamp":1767729551408,"details":"<continued_as_new>"}
@@ -0,0 +1,4 @@
1
+ {"kind":"workflow","phase":"start","name":"continue_as_new","id":"continue_as_new-33a8b9ac-2c3d-4afe-bfa3-9f07d444dfe8","timestamp":1767729552441,"details":{"value":2}}
2
+ {"kind":"step","phase":"start","name":"/app/test_workflows/dist/continue_as_new#increment","id":"1","parentId":"continue_as_new-33a8b9ac-2c3d-4afe-bfa3-9f07d444dfe8","timestamp":1767729552450,"details":2}
3
+ {"kind":"step","phase":"end","name":"/app/test_workflows/dist/continue_as_new#increment","id":"1","parentId":"continue_as_new-33a8b9ac-2c3d-4afe-bfa3-9f07d444dfe8","timestamp":1767729552451,"details":3}
4
+ {"kind":"workflow","phase":"end","name":"continue_as_new","id":"continue_as_new-33a8b9ac-2c3d-4afe-bfa3-9f07d444dfe8","timestamp":1767729552466,"details":{"output":{"result":3},"trace":{"destinations":{"local":"/Users/sz/Dev/output/test_workflows/logs/runs/continue_as_new/2026-01-06-19-59-11-409Z_continue_as_new-33a8b9ac-2c3d-4afe-bfa3-9f07d444dfe8.json","remote":null}}}}
@@ -0,0 +1,4 @@
1
+ {"kind":"workflow","phase":"start","name":"continue_as_new","id":"continue_as_new-d18f20bb-f97a-4bfa-bfc1-48dd72b9fedf","timestamp":1767729584859,"details":{"value":1}}
2
+ {"kind":"step","phase":"start","name":"/app/test_workflows/dist/continue_as_new#increment","id":"1","parentId":"continue_as_new-d18f20bb-f97a-4bfa-bfc1-48dd72b9fedf","timestamp":1767729584869,"details":1}
3
+ {"kind":"step","phase":"end","name":"/app/test_workflows/dist/continue_as_new#increment","id":"1","parentId":"continue_as_new-d18f20bb-f97a-4bfa-bfc1-48dd72b9fedf","timestamp":1767729584869,"details":2}
4
+ {"kind":"workflow","phase":"end","name":"continue_as_new","id":"continue_as_new-d18f20bb-f97a-4bfa-bfc1-48dd72b9fedf","timestamp":1767729584879,"details":"<continued_as_new>"}
@@ -0,0 +1,4 @@
1
+ {"kind":"workflow","phase":"start","name":"continue_as_new","id":"continue_as_new-d18f20bb-f97a-4bfa-bfc1-48dd72b9fedf","timestamp":1767729585911,"details":{"value":2}}
2
+ {"kind":"step","phase":"start","name":"/app/test_workflows/dist/continue_as_new#increment","id":"1","parentId":"continue_as_new-d18f20bb-f97a-4bfa-bfc1-48dd72b9fedf","timestamp":1767729585922,"details":2}
3
+ {"kind":"step","phase":"end","name":"/app/test_workflows/dist/continue_as_new#increment","id":"1","parentId":"continue_as_new-d18f20bb-f97a-4bfa-bfc1-48dd72b9fedf","timestamp":1767729585922,"details":3}
4
+ {"kind":"workflow","phase":"end","name":"continue_as_new","id":"continue_as_new-d18f20bb-f97a-4bfa-bfc1-48dd72b9fedf","timestamp":1767729585938,"details":{"output":{"result":3},"trace":{"destinations":{"local":"/Users/sz/Dev/output/test_workflows/logs/runs/continue_as_new/2026-01-06-19-59-44-880Z_continue_as_new-d18f20bb-f97a-4bfa-bfc1-48dd72b9fedf.json","remote":null}}}}
@@ -0,0 +1,4 @@
1
+ {"kind":"workflow","phase":"start","name":"continue_as_new","id":"continue_as_new-7887230c-c45f-4393-b26c-eae7b9f095a7","timestamp":1767730300497,"details":{"value":1}}
2
+ {"kind":"step","phase":"start","name":"/app/test_workflows/dist/continue_as_new#increment","id":"1","parentId":"continue_as_new-7887230c-c45f-4393-b26c-eae7b9f095a7","timestamp":1767730300506,"details":1}
3
+ {"kind":"step","phase":"end","name":"/app/test_workflows/dist/continue_as_new#increment","id":"1","parentId":"continue_as_new-7887230c-c45f-4393-b26c-eae7b9f095a7","timestamp":1767730300506,"details":2}
4
+ {"kind":"workflow","phase":"end","name":"continue_as_new","id":"continue_as_new-7887230c-c45f-4393-b26c-eae7b9f095a7","timestamp":1767801228316,"details":"<continued_as_new>"}
@@ -0,0 +1,4 @@
1
+ {"kind":"workflow","phase":"start","name":"continue_as_new","id":"continue_as_new-7887230c-c45f-4393-b26c-eae7b9f095a7","timestamp":1767801228333,"details":{"value":2}}
2
+ {"kind":"step","phase":"start","name":"/app/test_workflows/dist/continue_as_new#increment","id":"1","parentId":"continue_as_new-7887230c-c45f-4393-b26c-eae7b9f095a7","timestamp":1767801228340,"details":2}
3
+ {"kind":"step","phase":"end","name":"/app/test_workflows/dist/continue_as_new#increment","id":"1","parentId":"continue_as_new-7887230c-c45f-4393-b26c-eae7b9f095a7","timestamp":1767801228341,"details":3}
4
+ {"kind":"workflow","phase":"end","name":"continue_as_new","id":"continue_as_new-7887230c-c45f-4393-b26c-eae7b9f095a7","timestamp":1767801228353,"details":{"output":{"result":3},"trace":{"destinations":{"local":"/Users/sz/Dev/output/test_workflows/logs/runs/continue_as_new/2026-01-07-15-53-48-317Z_continue_as_new-7887230c-c45f-4393-b26c-eae7b9f095a7.json","remote":null}}}}
@@ -0,0 +1,4 @@
1
+ {"kind":"workflow","phase":"start","name":"continue_as_new","id":"continue_as_new-717fd020-1b29-411a-9a8c-974539c362af","timestamp":1767801231603,"details":{"value":1}}
2
+ {"kind":"step","phase":"start","name":"/app/test_workflows/dist/continue_as_new#increment","id":"1","parentId":"continue_as_new-717fd020-1b29-411a-9a8c-974539c362af","timestamp":1767801231609,"details":1}
3
+ {"kind":"step","phase":"end","name":"/app/test_workflows/dist/continue_as_new#increment","id":"1","parentId":"continue_as_new-717fd020-1b29-411a-9a8c-974539c362af","timestamp":1767801231610,"details":2}
4
+ {"kind":"workflow","phase":"end","name":"continue_as_new","id":"continue_as_new-717fd020-1b29-411a-9a8c-974539c362af","timestamp":1767801231615,"details":"<continued_as_new>"}
@@ -0,0 +1,4 @@
1
+ {"kind":"workflow","phase":"start","name":"continue_as_new","id":"continue_as_new-717fd020-1b29-411a-9a8c-974539c362af","timestamp":1767801232633,"details":{"value":2}}
2
+ {"kind":"step","phase":"start","name":"/app/test_workflows/dist/continue_as_new#increment","id":"1","parentId":"continue_as_new-717fd020-1b29-411a-9a8c-974539c362af","timestamp":1767801232642,"details":2}
3
+ {"kind":"step","phase":"end","name":"/app/test_workflows/dist/continue_as_new#increment","id":"1","parentId":"continue_as_new-717fd020-1b29-411a-9a8c-974539c362af","timestamp":1767801232642,"details":3}
4
+ {"kind":"workflow","phase":"end","name":"continue_as_new","id":"continue_as_new-717fd020-1b29-411a-9a8c-974539c362af","timestamp":1767801232655,"details":{"output":{"result":3},"trace":{"destinations":{"local":"/Users/sz/Dev/output/test_workflows/logs/runs/continue_as_new/2026-01-07-15-53-51-616Z_continue_as_new-717fd020-1b29-411a-9a8c-974539c362af.json","remote":null}}}}
@@ -0,0 +1,4 @@
1
+ {"kind":"workflow","phase":"start","name":"continue_as_new","id":"continue_as_new-3c43d860-c2e0-4a04-808b-2676bf896426","timestamp":1767801234219,"details":{"value":1}}
2
+ {"kind":"step","phase":"start","name":"/app/test_workflows/dist/continue_as_new#increment","id":"1","parentId":"continue_as_new-3c43d860-c2e0-4a04-808b-2676bf896426","timestamp":1767801234226,"details":1}
3
+ {"kind":"step","phase":"end","name":"/app/test_workflows/dist/continue_as_new#increment","id":"1","parentId":"continue_as_new-3c43d860-c2e0-4a04-808b-2676bf896426","timestamp":1767801234227,"details":2}
4
+ {"kind":"workflow","phase":"end","name":"continue_as_new","id":"continue_as_new-3c43d860-c2e0-4a04-808b-2676bf896426","timestamp":1767801234232,"details":"<continued_as_new>"}
@@ -0,0 +1,4 @@
1
+ {"kind":"workflow","phase":"start","name":"continue_as_new","id":"continue_as_new-3c43d860-c2e0-4a04-808b-2676bf896426","timestamp":1767801235252,"details":{"value":2}}
2
+ {"kind":"step","phase":"start","name":"/app/test_workflows/dist/continue_as_new#increment","id":"1","parentId":"continue_as_new-3c43d860-c2e0-4a04-808b-2676bf896426","timestamp":1767801235258,"details":2}
3
+ {"kind":"step","phase":"end","name":"/app/test_workflows/dist/continue_as_new#increment","id":"1","parentId":"continue_as_new-3c43d860-c2e0-4a04-808b-2676bf896426","timestamp":1767801235259,"details":3}
4
+ {"kind":"workflow","phase":"end","name":"continue_as_new","id":"continue_as_new-3c43d860-c2e0-4a04-808b-2676bf896426","timestamp":1767801235272,"details":{"output":{"result":3},"trace":{"destinations":{"local":"/Users/sz/Dev/output/test_workflows/logs/runs/continue_as_new/2026-01-07-15-53-54-233Z_continue_as_new-3c43d860-c2e0-4a04-808b-2676bf896426.json","remote":null}}}}
@@ -0,0 +1,4 @@
1
+ {"kind":"workflow","phase":"start","name":"continue_as_new","id":"continue_as_new-ee44babc-7690-4488-a24d-3ff258591bee","timestamp":1767891175423,"details":{"value":1}}
2
+ {"kind":"step","phase":"start","name":"/app/test_workflows/dist/continue_as_new#increment","id":"1","parentId":"continue_as_new-ee44babc-7690-4488-a24d-3ff258591bee","timestamp":1767891175433,"details":1}
3
+ {"kind":"step","phase":"end","name":"/app/test_workflows/dist/continue_as_new#increment","id":"1","parentId":"continue_as_new-ee44babc-7690-4488-a24d-3ff258591bee","timestamp":1767891175433,"details":2}
4
+ {"kind":"workflow","phase":"end","name":"continue_as_new","id":"continue_as_new-ee44babc-7690-4488-a24d-3ff258591bee","timestamp":1767891175443,"details":"<continued_as_new>"}
@@ -0,0 +1,4 @@
1
+ {"kind":"workflow","phase":"start","name":"continue_as_new","id":"continue_as_new-ee44babc-7690-4488-a24d-3ff258591bee","timestamp":1767891176473,"details":{"value":2}}
2
+ {"kind":"step","phase":"start","name":"/app/test_workflows/dist/continue_as_new#increment","id":"1","parentId":"continue_as_new-ee44babc-7690-4488-a24d-3ff258591bee","timestamp":1767891176480,"details":2}
3
+ {"kind":"step","phase":"end","name":"/app/test_workflows/dist/continue_as_new#increment","id":"1","parentId":"continue_as_new-ee44babc-7690-4488-a24d-3ff258591bee","timestamp":1767891176481,"details":3}
4
+ {"kind":"workflow","phase":"end","name":"continue_as_new","id":"continue_as_new-ee44babc-7690-4488-a24d-3ff258591bee","timestamp":1767891176499,"details":{"output":{"result":3},"trace":{"destinations":{"local":"/Users/sz/Dev/output/test_workflows/logs/runs/continue_as_new/2026-01-08-16-52-55-445Z_continue_as_new-ee44babc-7690-4488-a24d-3ff258591bee.json","remote":null}}}}
@@ -0,0 +1,12 @@
1
+ export default {
2
+ "/app/test_workflows/dist/helper_fn#sumValues": {
3
+ "retry": {
4
+ "initialInterval": "5s"
5
+ }
6
+ },
7
+ "/app/test_workflows/dist/simple#sumValues": {
8
+ "retry": {
9
+ "initialInterval": "5s"
10
+ }
11
+ }
12
+ };
@@ -0,0 +1,21 @@
1
+ export { default as continue_as_new } from '/app/test_workflows/dist/continue_as_new/workflow.js';
2
+ export { default as test_error } from '/app/test_workflows/dist/error/workflow.js';
3
+ export { default as evaluation } from '/app/test_workflows/dist/evaluation/workflow.js';
4
+ export { default as helper_fn } from '/app/test_workflows/dist/helper_fn/workflow.js';
5
+ export { default as http } from '/app/test_workflows/dist/http/workflow.js';
6
+ export { default as nested } from '/app/test_workflows/dist/nested/workflow.js';
7
+ export { default as prompt } from '/app/test_workflows/dist/prompt/workflow.js';
8
+ export { default as shared } from '/app/test_workflows/dist/shared/workflow.js';
9
+ export { default as simple } from '/app/test_workflows/dist/simple/workflow.js';
10
+ export { default as slow } from '/app/test_workflows/dist/slow/workflow.js';
11
+ export { default as simpleLinear } from '/app/test_workflows/dist/viz_examples/01_simple_linear/workflow.js';
12
+ export { default as conditionalBranching } from '/app/test_workflows/dist/viz_examples/02_conditional_branching/workflow.js';
13
+ export { default as loopWhile } from '/app/test_workflows/dist/viz_examples/03_loop_while/workflow.js';
14
+ export { default as nestedConditions } from '/app/test_workflows/dist/viz_examples/04_nested_conditions/workflow.js';
15
+ export { default as switchStatement } from '/app/test_workflows/dist/viz_examples/05_switch_statement/workflow.js';
16
+ export { default as forLoop } from '/app/test_workflows/dist/viz_examples/07_for_loop/workflow.js';
17
+ export { default as earlyReturn } from '/app/test_workflows/dist/viz_examples/08_early_return/workflow.js';
18
+ export { default as complexWorkflow } from '/app/test_workflows/dist/viz_examples/10_complex_workflow/workflow.js';
19
+ export { default as nestedLoops } from '/app/test_workflows/dist/viz_examples/11_nested_loops/workflow.js';
20
+ export { default as webhook } from '/app/test_workflows/dist/webhook/workflow.js';
21
+ export { default as $catalog } from '/app/sdk/core/src/worker/catalog_workflow/workflow.js';