@pgflow/dsl 0.13.3 → 0.14.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/CHANGELOG.md CHANGED
@@ -1,5 +1,37 @@
1
1
  # @pgflow/dsl
2
2
 
3
+ ## 0.14.1
4
+
5
+ ### Patch Changes
6
+
7
+ - f41d0f1: Enforce JSON-compatible step outputs at .step() construction time
8
+ - f41d0f1: Make skippable leaf step keys optional in ExtractFlowOutput type
9
+
10
+ ## 0.14.0
11
+
12
+ ### Minor Changes
13
+
14
+ - 320a106: Add conditional step execution with skip infrastructure
15
+
16
+ **New DSL Options:**
17
+
18
+ - `if` - Run step only when input contains specified pattern
19
+ - `ifNot` - Run step only when input does NOT contain pattern
20
+ - `whenUnmet` - Control behavior when condition not met (fail/skip/skip-cascade)
21
+ - `retriesExhausted` - Control behavior after all retries fail (fail/skip/skip-cascade)
22
+
23
+ **New Types:**
24
+
25
+ - `ContainmentPattern<T>` - Type-safe JSON containment patterns for conditions
26
+ - `StepMeta` - Track skippable dependencies for proper type inference
27
+
28
+ **Schema Changes:**
29
+
30
+ - New columns: required_input_pattern, forbidden_input_pattern, when_unmet, when_exhausted, skip_reason, skipped_at
31
+ - New step status: 'skipped'
32
+ - New function: cascade_skip_steps() for skip propagation
33
+ - FlowShape condition fields for auto-compilation drift detection
34
+
3
35
  ## 0.13.3
4
36
 
5
37
  ## 0.13.2
@@ -1 +1 @@
1
- {"version":3,"file":"compile-flow.d.ts","sourceRoot":"","sources":["../src/compile-flow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAsC,MAAM,UAAU,CAAC;AAEvE;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,EAAE,CA+BnD"}
1
+ {"version":3,"file":"compile-flow.d.ts","sourceRoot":"","sources":["../src/compile-flow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAsC,MAAM,UAAU,CAAC;AAEvE;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,EAAE,CAsCnD"}
@@ -7,9 +7,10 @@
7
7
  */
8
8
  export function compileFlow(flow) {
9
9
  const statements = [];
10
+ const escapedFlowSlug = escapeSqlLiteral(flow.slug);
10
11
  // Create the flow
11
12
  const flowOptions = formatRuntimeOptions(flow.options);
12
- statements.push(`SELECT pgflow.create_flow('${flow.slug}'${flowOptions});`);
13
+ statements.push(`SELECT pgflow.create_flow('${escapedFlowSlug}'${flowOptions});`);
13
14
  // Add steps in the order they were defined
14
15
  for (const stepSlug of flow.stepOrder) {
15
16
  const step = flow.getStepDefinition(stepSlug);
@@ -17,7 +18,9 @@ export function compileFlow(flow) {
17
18
  // Format dependencies array if it exists
18
19
  let depsClause = '';
19
20
  if (step.dependencies.length > 0) {
20
- const depsArray = step.dependencies.map((dep) => `'${dep}'`).join(', ');
21
+ const depsArray = step.dependencies
22
+ .map((dep) => `'${escapeSqlLiteral(dep)}'`)
23
+ .join(', ');
21
24
  depsClause = `, ARRAY[${depsArray}]`;
22
25
  }
23
26
  // Add step_type parameter for map steps
@@ -25,7 +28,7 @@ export function compileFlow(flow) {
25
28
  if (step.stepType === 'map') {
26
29
  stepTypeClause = `, step_type => 'map'`;
27
30
  }
28
- statements.push(`SELECT pgflow.add_step('${flow.slug}', '${step.slug}'${depsClause}${stepOptions}${stepTypeClause});`);
31
+ statements.push(`SELECT pgflow.add_step('${escapedFlowSlug}', '${escapeSqlLiteral(step.slug)}'${depsClause}${stepOptions}${stepTypeClause});`);
29
32
  }
30
33
  return statements;
31
34
  }
@@ -46,5 +49,22 @@ function formatRuntimeOptions(options) {
46
49
  if ('startDelay' in options && options.startDelay !== undefined) {
47
50
  parts.push(`start_delay => ${options.startDelay}`);
48
51
  }
52
+ if ('if' in options && options.if !== undefined) {
53
+ const jsonStr = JSON.stringify(options.if);
54
+ parts.push(`required_input_pattern => '${escapeSqlLiteral(jsonStr)}'`);
55
+ }
56
+ if ('ifNot' in options && options.ifNot !== undefined) {
57
+ const jsonStr = JSON.stringify(options.ifNot);
58
+ parts.push(`forbidden_input_pattern => '${escapeSqlLiteral(jsonStr)}'`);
59
+ }
60
+ if ('whenUnmet' in options && options.whenUnmet !== undefined) {
61
+ parts.push(`when_unmet => '${escapeSqlLiteral(options.whenUnmet)}'`);
62
+ }
63
+ if ('whenExhausted' in options && options.whenExhausted !== undefined) {
64
+ parts.push(`when_exhausted => '${escapeSqlLiteral(options.whenExhausted)}'`);
65
+ }
49
66
  return parts.length > 0 ? `, ${parts.join(', ')}` : '';
50
67
  }
68
+ function escapeSqlLiteral(value) {
69
+ return value.replace(/'/g, "''");
70
+ }
package/dist/dsl.d.ts CHANGED
@@ -4,7 +4,25 @@ export type Json = string | number | boolean | null | Json[] | {
4
4
  export type Simplify<T> = {
5
5
  [KeyType in keyof T]: T[KeyType];
6
6
  } & {};
7
+ /**
8
+ * ContainmentPattern<T> - Type for JSON containment (@>) patterns
9
+ *
10
+ * Matches PostgreSQL's @> containment semantics where a pattern is a
11
+ * recursive partial structure that the target must contain:
12
+ * - Primitives: exact value match
13
+ * - Objects: all keys optional, recursively applied
14
+ * - Arrays: elements expected to be present in target array
15
+ */
16
+ export type ContainmentPattern<T> = T extends readonly (infer U)[] ? ContainmentPattern<U>[] : T extends object ? {
17
+ [K in keyof T]?: ContainmentPattern<T[K]>;
18
+ } : T;
7
19
  type AwaitedReturn<T> = T extends (...args: any[]) => Promise<infer R> ? R : T extends (...args: any[]) => infer R ? R : never;
20
+ type JsonCompatible<T> = T extends string | number | boolean | null ? T : T extends readonly [any, ...any[]] ? {
21
+ [K in keyof T]: JsonCompatible<Exclude<T[K], undefined>>;
22
+ } : T extends readonly (infer U)[] ? JsonCompatible<U>[] : T extends (...args: any[]) => any ? never : T extends object ? {
23
+ [K in keyof T]: JsonCompatible<Exclude<T[K], undefined>>;
24
+ } : never;
25
+ type EnforceJsonOutput<THandler extends (...args: any[]) => any> = THandler & ((...args: Parameters<THandler>) => JsonCompatible<AwaitedReturn<THandler>> | Promise<JsonCompatible<AwaitedReturn<THandler>>>);
8
26
  export interface Env {
9
27
  [key: string]: string | undefined;
10
28
  }
@@ -13,8 +31,13 @@ export interface UserEnv extends Env {
13
31
  }
14
32
  export type AnyInput = Json;
15
33
  export type AnyOutput = Json;
34
+ export type SkippableMode = 'skip' | 'skip-cascade' | false;
35
+ export interface StepMeta<TOutput = AnyOutput, TSkippable extends SkippableMode = SkippableMode> {
36
+ output: TOutput;
37
+ skippable: TSkippable;
38
+ }
16
39
  export type EmptySteps = Record<never, never>;
17
- export type AnySteps = Record<string, AnyOutput>;
40
+ export type AnySteps = Record<string, StepMeta>;
18
41
  export type EmptyDeps = Record<never, never[]>;
19
42
  export type DefaultDeps = Record<string, string[]>;
20
43
  export type AnyDeps = Record<string, string[]>;
@@ -45,13 +68,22 @@ export type AllStepInputs<TFlow extends AnyFlow> = {
45
68
  * @template TFlow - The Flow type to extract from
46
69
  */
47
70
  export type ExtractFlowOutput<TFlow extends AnyFlow> = TFlow extends Flow<infer _TI, infer _TC, infer _TS, infer _TD, infer _TEnv> ? {
48
- [K in keyof ExtractFlowLeafSteps<TFlow> as K extends string ? K : never]: StepOutput<TFlow, K & string>;
71
+ [K in keyof ExtractFlowLeafSteps<TFlow> as K extends string ? GetSkippableMode<TFlow, K> extends false ? K : never : never]: StepOutput<TFlow, K & string>;
72
+ } & {
73
+ [K in keyof ExtractFlowLeafSteps<TFlow> as K extends string ? GetSkippableMode<TFlow, K> extends false ? never : K : never]?: StepOutput<TFlow, K & string>;
74
+ } : never;
75
+ /**
76
+ * Extracts the steps type from a Flow (unwraps StepMeta to just output types)
77
+ * @template TFlow - The Flow type to extract from
78
+ */
79
+ export type ExtractFlowSteps<TFlow extends AnyFlow> = TFlow extends Flow<infer _TI, infer _TC, infer TS, infer _TD, infer _TEnv> ? {
80
+ [K in keyof TS]: TS[K]['output'];
49
81
  } : never;
50
82
  /**
51
- * Extracts the steps type from a Flow
83
+ * Extracts the raw steps type from a Flow (includes StepMeta structure with skippable info)
52
84
  * @template TFlow - The Flow type to extract from
53
85
  */
54
- export type ExtractFlowSteps<TFlow extends AnyFlow> = TFlow extends Flow<infer _TI, infer _TC, infer TS, infer _TD, infer _TEnv> ? TS : never;
86
+ export type ExtractFlowStepsRaw<TFlow extends AnyFlow> = TFlow extends Flow<infer _TI, infer _TC, infer TS, infer _TD, infer _TEnv> ? TS : never;
55
87
  /**
56
88
  * Extracts the dependencies type from a Flow
57
89
  * @template TFlow - The Flow type to extract from
@@ -91,7 +123,7 @@ export type ExtractFlowContext<TFlow extends AnyFlow> = TFlow extends Flow<infer
91
123
  * }
92
124
  * ```
93
125
  */
94
- export type CompatibleFlow<F extends AnyFlow, PlatformResources extends Record<string, unknown>, UserResources extends Record<string, unknown> = Record<string, never>> = (FlowContext<ExtractFlowEnv<F>> & PlatformResources & UserResources) extends ExtractFlowContext<F> ? F : never;
126
+ export type CompatibleFlow<F extends AnyFlow, PlatformResources extends Record<string, unknown>, UserResources extends Record<string, unknown> = Record<string, never>> = FlowContext<ExtractFlowEnv<F>> & PlatformResources & UserResources extends ExtractFlowContext<F> ? F : never;
95
127
  /**
96
128
  * Extracts the dependencies type from a Flow
97
129
  * @template TFlow - The Flow type to extract from
@@ -99,23 +131,43 @@ export type CompatibleFlow<F extends AnyFlow, PlatformResources extends Record<s
99
131
  type StepDepsOf<TFlow extends AnyFlow, TStepSlug extends string> = TStepSlug extends keyof ExtractFlowDeps<TFlow> ? ExtractFlowDeps<TFlow>[TStepSlug][number] : never;
100
132
  /**
101
133
  * Extracts only the leaf steps from a Flow (steps that are not dependencies of any other steps)
134
+ * Returns the output types, not the full StepMeta structure
102
135
  * @template TFlow - The Flow type to extract from
103
136
  */
104
137
  export type ExtractFlowLeafSteps<TFlow extends AnyFlow> = {
105
138
  [K in keyof ExtractFlowSteps<TFlow> as K extends string ? K extends ExtractFlowDeps<TFlow>[keyof ExtractFlowDeps<TFlow>][number] ? never : K : never]: ExtractFlowSteps<TFlow>[K];
106
139
  };
107
140
  export type StepOutput<TFlow extends AnyFlow, TStepSlug extends string> = TStepSlug extends keyof ExtractFlowSteps<TFlow> ? ExtractFlowSteps<TFlow>[TStepSlug] : never;
141
+ /**
142
+ * Gets the skippable mode for a step ('skip' | 'skip-cascade' | false)
143
+ * @template TFlow - The Flow type
144
+ * @template TStepSlug - The step slug to check
145
+ */
146
+ export type GetSkippableMode<TFlow extends AnyFlow, TStepSlug extends string> = TStepSlug extends keyof ExtractFlowStepsRaw<TFlow> ? ExtractFlowStepsRaw<TFlow>[TStepSlug]['skippable'] : false;
147
+ /**
148
+ * Checks if a step makes its dependents' deps optional (only 'skip' mode, not 'skip-cascade')
149
+ * With 'skip-cascade', dependents are also skipped at runtime, so if handler runs, dep succeeded.
150
+ */
151
+ export type IsStepSkippable<TFlow extends AnyFlow, TStepSlug extends string> = GetSkippableMode<TFlow, TStepSlug> extends 'skip' ? true : false;
152
+ type RequiredDeps<TFlow extends AnyFlow, TStepSlug extends string> = {
153
+ [K in Extract<keyof ExtractFlowSteps<TFlow>, StepDepsOf<TFlow, TStepSlug>> as GetSkippableMode<TFlow, K & string> extends 'skip' ? never : K]: ExtractFlowSteps<TFlow>[K];
154
+ };
155
+ type OptionalDeps<TFlow extends AnyFlow, TStepSlug extends string> = {
156
+ [K in Extract<keyof ExtractFlowSteps<TFlow>, StepDepsOf<TFlow, TStepSlug>> as GetSkippableMode<TFlow, K & string> extends 'skip' ? K : never]?: ExtractFlowSteps<TFlow>[K];
157
+ };
108
158
  /**
109
159
  * Asymmetric step input type:
110
160
  * - Root steps (no dependencies): receive flow input directly
111
161
  * - Dependent steps: receive only their dependencies (flow input available via context)
162
+ * - Skippable deps (whenUnmet/whenExhausted: 'skip') are optional
163
+ * - Cascade deps (whenUnmet/whenExhausted: 'skip-cascade') are required
164
+ * (because if handler runs, the dependency must have succeeded)
165
+ * - All other deps are required
112
166
  *
113
167
  * This enables functional composition where subflows can receive typed inputs
114
168
  * without the 'run' wrapper that previously blocked type matching.
115
169
  */
116
- export type StepInput<TFlow extends AnyFlow, TStepSlug extends string> = StepDepsOf<TFlow, TStepSlug> extends never ? ExtractFlowInput<TFlow> : {
117
- [K in Extract<keyof ExtractFlowSteps<TFlow>, StepDepsOf<TFlow, TStepSlug>>]: ExtractFlowSteps<TFlow>[K];
118
- };
170
+ export type StepInput<TFlow extends AnyFlow, TStepSlug extends string> = StepDepsOf<TFlow, TStepSlug> extends never ? ExtractFlowInput<TFlow> : Simplify<RequiredDeps<TFlow, TStepSlug> & OptionalDeps<TFlow, TStepSlug>>;
119
171
  export interface RuntimeOptions {
120
172
  maxAttempts?: number;
121
173
  baseDelay?: number;
@@ -160,9 +212,171 @@ export interface FlowContext<TEnv extends Env = Env, TFlowInput extends AnyInput
160
212
  flowInput: Promise<TFlowInput>;
161
213
  }
162
214
  export type Context<T extends Record<string, unknown> = Record<string, never>, TEnv extends Env = Env> = FlowContext<TEnv> & T;
215
+ /**
216
+ * Options for handling unmet conditions (when 'if' pattern doesn't match input)
217
+ *
218
+ * @example
219
+ * // Fail the step (and run) when pattern doesn't match
220
+ * { if: { enabled: true }, whenUnmet: 'fail' }
221
+ *
222
+ * @example
223
+ * // Skip this step only when pattern doesn't match
224
+ * { if: { enabled: true }, whenUnmet: 'skip' }
225
+ *
226
+ * @example
227
+ * // Skip this step and all dependents when pattern doesn't match
228
+ * { if: { enabled: true }, whenUnmet: 'skip-cascade' }
229
+ *
230
+ * @remarks
231
+ * - `'fail'`: When pattern doesn't match, step fails -> run fails (default)
232
+ * - `'skip'`: When pattern doesn't match, skip step and continue (step key omitted from dependent inputs)
233
+ * - `'skip-cascade'`: When pattern doesn't match, skip step + mark all dependents as skipped
234
+ */
235
+ export type WhenUnmetMode = 'fail' | 'skip' | 'skip-cascade';
236
+ /**
237
+ * Options for handling errors after all retries are exhausted
238
+ *
239
+ * @example
240
+ * // Fail the run after retries exhausted (default)
241
+ * { whenExhausted: 'fail' }
242
+ *
243
+ * @example
244
+ * // Skip this step after retries exhausted, continue run
245
+ * { whenExhausted: 'skip' }
246
+ *
247
+ * @example
248
+ * // Skip this step and all dependents after retries exhausted
249
+ * { whenExhausted: 'skip-cascade' }
250
+ *
251
+ * @remarks
252
+ * - `'fail'`: Step fails -> run fails (default behavior)
253
+ * - `'skip'`: Mark step as skipped, continue run (step key omitted from dependent inputs)
254
+ * - `'skip-cascade'`: Skip step + mark all dependents as skipped too
255
+ *
256
+ * @note
257
+ * TYPE_VIOLATION errors (e.g., single step returns non-array for map dependent)
258
+ * are NOT subject to whenExhausted - these always hard fail as they indicate
259
+ * programming errors, not runtime conditions.
260
+ */
261
+ export type WhenExhaustedMode = 'fail' | 'skip' | 'skip-cascade';
262
+ /**
263
+ * Helper type for dependent step handlers - creates deps object with correct optionality.
264
+ * Only steps with 'skip' mode (not 'skip-cascade') make deps optional.
265
+ * With 'skip-cascade', dependents are also skipped at runtime, so if handler runs, dep succeeded.
266
+ */
267
+ type DepsWithOptionalSkippable<TSteps extends AnySteps, TDeps extends string> = {
268
+ [K in TDeps as K extends keyof TSteps ? TSteps[K]['skippable'] extends 'skip' ? never : K : K]: K extends keyof TSteps ? TSteps[K]['output'] : never;
269
+ } & {
270
+ [K in TDeps as K extends keyof TSteps ? TSteps[K]['skippable'] extends 'skip' ? K : never : never]?: K extends keyof TSteps ? TSteps[K]['output'] : never;
271
+ };
163
272
  export interface StepRuntimeOptions extends RuntimeOptions {
164
273
  startDelay?: number;
274
+ /**
275
+ * Pattern to match using PostgreSQL's @> (contains) operator
276
+ *
277
+ * @example
278
+ * // Root step: match against flow input
279
+ * { if: { role: 'admin', active: true } }
280
+ *
281
+ * @example
282
+ * // Dependent step: match against dependency outputs
283
+ * { if: { prevStep: { status: 'success' } } }
284
+ *
285
+ * @remarks
286
+ * - Primitives: exact value match
287
+ * - Objects: all keys optional, recursively applied
288
+ * - Arrays: elements expected to be present in target array
289
+ *
290
+ * @see WhenUnmetMode for controlling what happens when pattern doesn't match
291
+ */
292
+ if?: Json;
293
+ /**
294
+ * Negative pattern - step executes when input does NOT match this pattern
295
+ *
296
+ * @example
297
+ * // Root step: execute when NOT an admin
298
+ * { ifNot: { role: 'admin' } }
299
+ *
300
+ * @example
301
+ * // Combined with 'if' for AND semantics: "active admin who is NOT suspended"
302
+ * { if: { role: 'admin', active: true }, ifNot: { suspended: true } }
303
+ *
304
+ * @remarks
305
+ * - Uses PostgreSQL's @> containment check, negated
306
+ * - When combined with 'if', BOTH must pass (AND semantics)
307
+ * - For mutual exclusion: use same pattern with if on one step, ifNot on another
308
+ *
309
+ * @see WhenUnmetMode for controlling what happens when condition not met
310
+ */
311
+ ifNot?: Json;
312
+ /**
313
+ * What to do when the 'if' pattern doesn't match the input
314
+ *
315
+ * @default 'skip'
316
+ *
317
+ * @example
318
+ * { whenUnmet: 'fail' } // Pattern doesn't match -> step fails -> run fails
319
+ * { whenUnmet: 'skip' } // Pattern doesn't match -> skip step, continue run
320
+ * { whenUnmet: 'skip-cascade' } // Pattern doesn't match -> skip step + all dependents
321
+ *
322
+ * @see WhenUnmetMode for detailed documentation of each mode
323
+ */
324
+ whenUnmet?: WhenUnmetMode;
325
+ /**
326
+ * What to do when handler throws an error after all retries are exhausted
327
+ *
328
+ * @default 'fail'
329
+ *
330
+ * @example
331
+ * { whenExhausted: 'fail' } // Step fails -> run fails
332
+ * { whenExhausted: 'skip' } // Skip step, continue run
333
+ * { whenExhausted: 'skip-cascade' } // Skip step + all dependents
334
+ *
335
+ * @remarks
336
+ * Only applies after maxAttempts retries are exhausted.
337
+ * TYPE_VIOLATION errors always fail regardless of this setting.
338
+ *
339
+ * @see WhenExhaustedMode for detailed documentation of each mode
340
+ */
341
+ whenExhausted?: WhenExhaustedMode;
342
+ }
343
+ interface BaseStepRuntimeOptions extends RuntimeOptions {
344
+ startDelay?: number;
345
+ whenExhausted?: WhenExhaustedMode;
165
346
  }
347
+ /**
348
+ * Condition with 'if' required (ifNot optional) - allows whenUnmet.
349
+ * whenUnmet only makes sense when there's a condition to be "unmet".
350
+ */
351
+ type WithIfCondition<T> = {
352
+ if: ContainmentPattern<T>;
353
+ ifNot?: ContainmentPattern<T>;
354
+ whenUnmet?: WhenUnmetMode;
355
+ };
356
+ /**
357
+ * Condition with 'ifNot' required (if optional) - allows whenUnmet.
358
+ */
359
+ type WithIfNotCondition<T> = {
360
+ if?: ContainmentPattern<T>;
361
+ ifNot: ContainmentPattern<T>;
362
+ whenUnmet?: WhenUnmetMode;
363
+ };
364
+ /**
365
+ * No condition - if, ifNot, and whenUnmet are all forbidden.
366
+ * This ensures whenUnmet can only be used with a condition.
367
+ */
368
+ type WithoutCondition = {
369
+ if?: never;
370
+ ifNot?: never;
371
+ whenUnmet?: never;
372
+ };
373
+ /**
374
+ * Discriminated union for condition options.
375
+ * whenUnmet is only allowed when if or ifNot is provided.
376
+ */
377
+ type ConditionOpts<T> = WithIfCondition<T> | WithIfNotCondition<T> | WithoutCondition;
378
+ export type RootStepOptions<TFlowInput> = BaseStepRuntimeOptions & ConditionOpts<TFlowInput>;
379
+ export type DependentStepOptions<TDeps> = BaseStepRuntimeOptions & ConditionOpts<TDeps>;
166
380
  export interface StepDefinition<TInput extends AnyInput, TOutput extends AnyOutput, TContext = FlowContext> {
167
381
  slug: string;
168
382
  handler: (input: TInput, context: TContext) => TOutput | Promise<TOutput>;
@@ -192,28 +406,83 @@ Steps extends AnySteps = EmptySteps, StepDependencies extends AnyDeps = EmptyDep
192
406
  * Returns the step definition with asymmetric input typing:
193
407
  * - Root steps (no dependencies): input is flowInput directly
194
408
  * - Dependent steps: input is deps object only (flowInput available via context)
409
+ * - Skippable deps are optional, required deps are required
195
410
  *
196
411
  * @throws Error if the step with the given slug doesn't exist
197
412
  */
198
413
  getStepDefinition<SlugType extends keyof Steps & keyof StepDependencies>(slug: SlugType): StepDefinition<StepDependencies[SlugType] extends [] | readonly [] ? TFlowInput : Simplify<{
199
- [K in StepDependencies[SlugType][number]]: K extends keyof Steps ? Steps[K] : never;
200
- }>, // Dependent step: only deps
201
- Steps[SlugType], FlowContext<TEnv, TFlowInput> & TContext>;
202
- step<Slug extends string, TOutput>(opts: Simplify<{
414
+ [K in StepDependencies[SlugType][number] as K extends keyof Steps ? Steps[K]['skippable'] extends 'skip' ? never : K : never]: K extends keyof Steps ? Steps[K]['output'] : never;
415
+ } & {
416
+ [K in StepDependencies[SlugType][number] as K extends keyof Steps ? Steps[K]['skippable'] extends 'skip' ? K : never : never]?: K extends keyof Steps ? Steps[K]['output'] : never;
417
+ }>, // Dependent step: only deps (skippable deps optional)
418
+ Steps[SlugType]['output'], FlowContext<TEnv, TFlowInput> & TContext>;
419
+ step<Slug extends string, THandler extends (flowInput: TFlowInput, context: FlowContext<TEnv, TFlowInput> & TContext) => any, TRetries extends WhenExhaustedMode | undefined = undefined>(opts: Simplify<{
420
+ slug: Slug extends keyof Steps ? never : Slug;
421
+ dependsOn?: never;
422
+ whenExhausted?: TRetries;
423
+ } & WithoutCondition & Omit<BaseStepRuntimeOptions, 'whenExhausted'>>, handler: EnforceJsonOutput<THandler>): Flow<TFlowInput, TContext, Steps & {
424
+ [K in Slug]: StepMeta<JsonCompatible<AwaitedReturn<THandler>>, TRetries extends 'skip' | 'skip-cascade' ? TRetries : false>;
425
+ }, StepDependencies & {
426
+ [K in Slug]: [];
427
+ }, TEnv>;
428
+ step<Slug extends string, THandler extends (flowInput: TFlowInput, context: FlowContext<TEnv, TFlowInput> & TContext) => any, TRetries extends WhenExhaustedMode | undefined = undefined>(opts: Simplify<{
203
429
  slug: Slug extends keyof Steps ? never : Slug;
204
430
  dependsOn?: never;
205
- } & StepRuntimeOptions>, handler: (flowInput: TFlowInput, context: FlowContext<TEnv, TFlowInput> & TContext) => TOutput | Promise<TOutput>): Flow<TFlowInput, TContext, Steps & {
206
- [K in Slug]: Awaited<TOutput>;
431
+ whenExhausted?: TRetries;
432
+ } & ((WithIfCondition<TFlowInput> & {
433
+ whenUnmet?: undefined;
434
+ }) | (WithIfNotCondition<TFlowInput> & {
435
+ whenUnmet?: undefined;
436
+ })) & Omit<BaseStepRuntimeOptions, 'whenExhausted'>>, handler: EnforceJsonOutput<THandler>): Flow<TFlowInput, TContext, Steps & {
437
+ [K in Slug]: StepMeta<JsonCompatible<AwaitedReturn<THandler>>, 'skip'>;
207
438
  }, StepDependencies & {
208
439
  [K in Slug]: [];
209
440
  }, TEnv>;
210
- step<Slug extends string, Deps extends Extract<keyof Steps, string>, TOutput>(opts: Simplify<{
441
+ step<Slug extends string, THandler extends (flowInput: TFlowInput, context: FlowContext<TEnv, TFlowInput> & TContext) => any, TWhenUnmet extends WhenUnmetMode, TRetries extends WhenExhaustedMode | undefined = undefined>(opts: Simplify<{
442
+ slug: Slug extends keyof Steps ? never : Slug;
443
+ dependsOn?: never;
444
+ whenExhausted?: TRetries;
445
+ } & ((WithIfCondition<TFlowInput> & {
446
+ whenUnmet: TWhenUnmet;
447
+ }) | (WithIfNotCondition<TFlowInput> & {
448
+ whenUnmet: TWhenUnmet;
449
+ })) & Omit<BaseStepRuntimeOptions, 'whenExhausted'>>, handler: EnforceJsonOutput<THandler>): Flow<TFlowInput, TContext, Steps & {
450
+ [K in Slug]: StepMeta<JsonCompatible<AwaitedReturn<THandler>>, TWhenUnmet extends 'skip' | 'skip-cascade' ? TWhenUnmet : TRetries extends 'skip' | 'skip-cascade' ? TRetries : false>;
451
+ }, StepDependencies & {
452
+ [K in Slug]: [];
453
+ }, TEnv>;
454
+ step<Slug extends string, Deps extends Extract<keyof Steps, string>, THandler extends (deps: Simplify<DepsWithOptionalSkippable<Steps, Deps>>, context: FlowContext<TEnv, TFlowInput> & TContext) => any, TRetries extends WhenExhaustedMode | undefined = undefined>(opts: Simplify<{
455
+ slug: Slug extends keyof Steps ? never : Slug;
456
+ dependsOn: [Deps, ...Deps[]];
457
+ whenExhausted?: TRetries;
458
+ } & WithoutCondition & Omit<BaseStepRuntimeOptions, 'whenExhausted'>>, handler: EnforceJsonOutput<THandler>): Flow<TFlowInput, TContext, Steps & {
459
+ [K in Slug]: StepMeta<JsonCompatible<AwaitedReturn<THandler>>, TRetries extends 'skip' | 'skip-cascade' ? TRetries : false>;
460
+ }, StepDependencies & {
461
+ [K in Slug]: Deps[];
462
+ }, TEnv>;
463
+ step<Slug extends string, Deps extends Extract<keyof Steps, string>, THandler extends (deps: Simplify<DepsWithOptionalSkippable<Steps, Deps>>, context: FlowContext<TEnv, TFlowInput> & TContext) => any, TRetries extends WhenExhaustedMode | undefined = undefined>(opts: Simplify<{
464
+ slug: Slug extends keyof Steps ? never : Slug;
465
+ dependsOn: [Deps, ...Deps[]];
466
+ whenExhausted?: TRetries;
467
+ } & ((WithIfCondition<Simplify<DepsWithOptionalSkippable<Steps, Deps>>> & {
468
+ whenUnmet?: undefined;
469
+ }) | (WithIfNotCondition<Simplify<DepsWithOptionalSkippable<Steps, Deps>>> & {
470
+ whenUnmet?: undefined;
471
+ })) & Omit<BaseStepRuntimeOptions, 'whenExhausted'>>, handler: EnforceJsonOutput<THandler>): Flow<TFlowInput, TContext, Steps & {
472
+ [K in Slug]: StepMeta<JsonCompatible<AwaitedReturn<THandler>>, 'skip'>;
473
+ }, StepDependencies & {
474
+ [K in Slug]: Deps[];
475
+ }, TEnv>;
476
+ step<Slug extends string, Deps extends Extract<keyof Steps, string>, THandler extends (deps: Simplify<DepsWithOptionalSkippable<Steps, Deps>>, context: FlowContext<TEnv, TFlowInput> & TContext) => any, TWhenUnmet extends WhenUnmetMode, TRetries extends WhenExhaustedMode | undefined = undefined>(opts: Simplify<{
211
477
  slug: Slug extends keyof Steps ? never : Slug;
212
478
  dependsOn: [Deps, ...Deps[]];
213
- } & StepRuntimeOptions>, handler: (deps: {
214
- [K in Deps]: K extends keyof Steps ? Steps[K] : never;
215
- }, context: FlowContext<TEnv, TFlowInput> & TContext) => TOutput | Promise<TOutput>): Flow<TFlowInput, TContext, Steps & {
216
- [K in Slug]: Awaited<TOutput>;
479
+ whenExhausted?: TRetries;
480
+ } & ((WithIfCondition<Simplify<DepsWithOptionalSkippable<Steps, Deps>>> & {
481
+ whenUnmet: TWhenUnmet;
482
+ }) | (WithIfNotCondition<Simplify<DepsWithOptionalSkippable<Steps, Deps>>> & {
483
+ whenUnmet: TWhenUnmet;
484
+ })) & Omit<BaseStepRuntimeOptions, 'whenExhausted'>>, handler: EnforceJsonOutput<THandler>): Flow<TFlowInput, TContext, Steps & {
485
+ [K in Slug]: StepMeta<JsonCompatible<AwaitedReturn<THandler>>, TWhenUnmet extends 'skip' | 'skip-cascade' ? TWhenUnmet : TRetries extends 'skip' | 'skip-cascade' ? TRetries : false>;
217
486
  }, StepDependencies & {
218
487
  [K in Slug]: Deps[];
219
488
  }, TEnv>;
@@ -230,21 +499,29 @@ Steps extends AnySteps = EmptySteps, StepDependencies extends AnyDeps = EmptyDep
230
499
  * @param handler - Function that processes input and returns an array (null/undefined rejected)
231
500
  * @returns A new Flow instance with the array step added
232
501
  */
233
- array<Slug extends string, TOutput extends readonly any[]>(opts: Simplify<{
502
+ array<Slug extends string, TOutput extends readonly any[], TWhenUnmet extends WhenUnmetMode | undefined = undefined, TRetries extends WhenExhaustedMode | undefined = undefined>(opts: Simplify<{
234
503
  slug: Slug extends keyof Steps ? never : Slug;
235
504
  dependsOn?: never;
236
- } & StepRuntimeOptions>, handler: (flowInput: TFlowInput, context: FlowContext<TEnv, TFlowInput> & TContext) => TOutput | Promise<TOutput>): Flow<TFlowInput, TContext, Steps & {
237
- [K in Slug]: Awaited<TOutput>;
505
+ whenExhausted?: TRetries;
506
+ } & ((WithIfCondition<TFlowInput> & {
507
+ whenUnmet?: TWhenUnmet;
508
+ }) | (WithIfNotCondition<TFlowInput> & {
509
+ whenUnmet?: TWhenUnmet;
510
+ }) | WithoutCondition) & Omit<BaseStepRuntimeOptions, 'whenExhausted'>>, handler: (flowInput: TFlowInput, context: FlowContext<TEnv, TFlowInput> & TContext) => JsonCompatible<TOutput> | Promise<JsonCompatible<TOutput>>): Flow<TFlowInput, TContext, Steps & {
511
+ [K in Slug]: StepMeta<JsonCompatible<Awaited<TOutput>>, TWhenUnmet extends 'skip' | 'skip-cascade' ? TWhenUnmet : TRetries extends 'skip' | 'skip-cascade' ? TRetries : false>;
238
512
  }, StepDependencies & {
239
513
  [K in Slug]: [];
240
514
  }, TEnv>;
241
- array<Slug extends string, Deps extends Extract<keyof Steps, string>, TOutput extends readonly any[]>(opts: Simplify<{
515
+ array<Slug extends string, Deps extends Extract<keyof Steps, string>, TOutput extends readonly any[], TWhenUnmet extends WhenUnmetMode | undefined = undefined, TRetries extends WhenExhaustedMode | undefined = undefined>(opts: Simplify<{
242
516
  slug: Slug extends keyof Steps ? never : Slug;
243
517
  dependsOn: [Deps, ...Deps[]];
244
- } & StepRuntimeOptions>, handler: (deps: {
245
- [K in Deps]: K extends keyof Steps ? Steps[K] : never;
246
- }, context: FlowContext<TEnv, TFlowInput> & TContext) => TOutput | Promise<TOutput>): Flow<TFlowInput, TContext, Steps & {
247
- [K in Slug]: Awaited<TOutput>;
518
+ whenExhausted?: TRetries;
519
+ } & ((WithIfCondition<Simplify<DepsWithOptionalSkippable<Steps, Deps>>> & {
520
+ whenUnmet?: TWhenUnmet;
521
+ }) | (WithIfNotCondition<Simplify<DepsWithOptionalSkippable<Steps, Deps>>> & {
522
+ whenUnmet?: TWhenUnmet;
523
+ }) | WithoutCondition) & Omit<BaseStepRuntimeOptions, 'whenExhausted'>>, handler: (deps: Simplify<DepsWithOptionalSkippable<Steps, Deps>>, context: FlowContext<TEnv, TFlowInput> & TContext) => JsonCompatible<TOutput> | Promise<JsonCompatible<TOutput>>): Flow<TFlowInput, TContext, Steps & {
524
+ [K in Slug]: StepMeta<JsonCompatible<Awaited<TOutput>>, TWhenUnmet extends 'skip' | 'skip-cascade' ? TWhenUnmet : TRetries extends 'skip' | 'skip-cascade' ? TRetries : false>;
248
525
  }, StepDependencies & {
249
526
  [K in Slug]: Deps[];
250
527
  }, TEnv>;
@@ -259,18 +536,32 @@ Steps extends AnySteps = EmptySteps, StepDependencies extends AnyDeps = EmptyDep
259
536
  * @param handler - Function that processes individual array elements
260
537
  * @returns A new Flow instance with the map step added
261
538
  */
262
- map<Slug extends string, THandler extends TFlowInput extends readonly (infer Item)[] ? (item: Item, context: FlowContext<TEnv, TFlowInput> & TContext) => Json | Promise<Json> : never>(opts: Simplify<{
539
+ map<Slug extends string, THandler extends TFlowInput extends readonly (infer Item)[] ? (item: Item, context: FlowContext<TEnv, TFlowInput> & TContext) => any : never, TWhenUnmet extends WhenUnmetMode | undefined = undefined, TRetries extends WhenExhaustedMode | undefined = undefined>(opts: Simplify<{
263
540
  slug: Slug extends keyof Steps ? never : Slug;
264
- } & StepRuntimeOptions>, handler: THandler): Flow<TFlowInput, TContext, Steps & {
265
- [K in Slug]: AwaitedReturn<THandler>[];
541
+ whenExhausted?: TRetries;
542
+ } & ((WithIfCondition<TFlowInput> & {
543
+ whenUnmet?: TWhenUnmet;
544
+ }) | (WithIfNotCondition<TFlowInput> & {
545
+ whenUnmet?: TWhenUnmet;
546
+ }) | WithoutCondition) & Omit<BaseStepRuntimeOptions, 'whenExhausted'>>, handler: EnforceJsonOutput<THandler>): Flow<TFlowInput, TContext, Steps & {
547
+ [K in Slug]: StepMeta<JsonCompatible<AwaitedReturn<THandler>>[], TWhenUnmet extends 'skip' | 'skip-cascade' ? TWhenUnmet : TRetries extends 'skip' | 'skip-cascade' ? TRetries : false>;
266
548
  }, StepDependencies & {
267
549
  [K in Slug]: [];
268
550
  }, TEnv>;
269
- map<Slug extends string, TArrayDep extends Extract<keyof Steps, string>, THandler extends Steps[TArrayDep] extends readonly (infer Item)[] ? (item: Item, context: FlowContext<TEnv, TFlowInput> & TContext) => Json | Promise<Json> : never>(opts: Simplify<{
551
+ map<Slug extends string, TArrayDep extends Extract<keyof Steps, string>, THandler extends Steps[TArrayDep]['output'] extends readonly (infer Item)[] ? (item: Item, context: FlowContext<TEnv, TFlowInput> & TContext) => any : never, TWhenUnmet extends WhenUnmetMode | undefined = undefined, TRetries extends WhenExhaustedMode | undefined = undefined>(opts: Simplify<{
270
552
  slug: Slug extends keyof Steps ? never : Slug;
271
553
  array: TArrayDep;
272
- } & StepRuntimeOptions>, handler: THandler): Flow<TFlowInput, TContext, Steps & {
273
- [K in Slug]: AwaitedReturn<THandler>[];
554
+ whenExhausted?: TRetries;
555
+ } & ((WithIfCondition<{
556
+ [K in TArrayDep]: Steps[K]['output'];
557
+ }> & {
558
+ whenUnmet?: TWhenUnmet;
559
+ }) | (WithIfNotCondition<{
560
+ [K in TArrayDep]: Steps[K]['output'];
561
+ }> & {
562
+ whenUnmet?: TWhenUnmet;
563
+ }) | WithoutCondition) & Omit<BaseStepRuntimeOptions, 'whenExhausted'>>, handler: EnforceJsonOutput<THandler>): Flow<TFlowInput, TContext, Steps & {
564
+ [K in Slug]: StepMeta<JsonCompatible<AwaitedReturn<THandler>>[], TWhenUnmet extends 'skip' | 'skip-cascade' ? TWhenUnmet : TRetries extends 'skip' | 'skip-cascade' ? TRetries : false>;
274
565
  }, StepDependencies & {
275
566
  [K in Slug]: [TArrayDep];
276
567
  }, TEnv>;
package/dist/dsl.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"dsl.d.ts","sourceRoot":"","sources":["../src/dsl.ts"],"names":[],"mappings":"AAOA,MAAM,MAAM,IAAI,GACZ,MAAM,GACN,MAAM,GACN,OAAO,GACP,IAAI,GACJ,IAAI,EAAE,GACN;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAAC;AAG5B,MAAM,MAAM,QAAQ,CAAC,CAAC,IAAI;KAAG,OAAO,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC;CAAE,GAAG,EAAE,CAAC;AAKpE,KAAK,aAAa,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC,GAClE,CAAC,GACD,CAAC,SAA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input typing:
32
32
  * - Root steps (no dependencies): input is flowInput directly
33
33
  * - Dependent steps: input is deps object only (flowInput available via context)
34
+ * - Skippable deps are optional, required deps are required
34
35
  *
35
36
  * @throws Error if the step with the given slug doesn't exist
36
37
  */
@@ -39,9 +40,6 @@ export class Flow {
39
40
  if (!(slug in this.stepDefinitions)) {
40
41
  throw new Error(`Step "${String(slug)}" does not exist in flow "${this.slug}"`);
41
42
  }
42
- // Use a type assertion directive to tell TypeScript that this is safe
43
- // @ts-expect-error The type system cannot track that this.stepDefinitions[slug] has the correct type
44
- // but we know it's safe because we only add steps through the strongly-typed `step` method
45
43
  return this.stepDefinitions[slug];
46
44
  }
47
45
  // Implementation (type safety enforced by overloads above)
@@ -71,6 +69,14 @@ export class Flow {
71
69
  options.timeout = opts.timeout;
72
70
  if (opts.startDelay !== undefined)
73
71
  options.startDelay = opts.startDelay;
72
+ if (opts.if !== undefined)
73
+ options.if = opts.if;
74
+ if (opts.ifNot !== undefined)
75
+ options.ifNot = opts.ifNot;
76
+ if (opts.whenUnmet !== undefined)
77
+ options.whenUnmet = opts.whenUnmet;
78
+ if (opts.whenExhausted !== undefined)
79
+ options.whenExhausted = opts.whenExhausted;
74
80
  // Validate runtime options (optional for step level)
75
81
  validateRuntimeOptions(options, { optional: true });
76
82
  // Create step definition (type assertions needed due to complex generic constraints)
@@ -127,6 +133,14 @@ export class Flow {
127
133
  options.timeout = opts.timeout;
128
134
  if (opts.startDelay !== undefined)
129
135
  options.startDelay = opts.startDelay;
136
+ if (opts.if !== undefined)
137
+ options.if = opts.if;
138
+ if (opts.ifNot !== undefined)
139
+ options.ifNot = opts.ifNot;
140
+ if (opts.whenUnmet !== undefined)
141
+ options.whenUnmet = opts.whenUnmet;
142
+ if (opts.whenExhausted !== undefined)
143
+ options.whenExhausted = opts.whenExhausted;
130
144
  // Validate runtime options
131
145
  validateRuntimeOptions(options, { optional: true });
132
146
  // Create the map step definition with stepType
@@ -3,19 +3,19 @@ type Input = {
3
3
  url: string;
4
4
  };
5
5
  export declare const AnalyzeWebsite: Flow<Input, {}, import("./dsl.js").EmptySteps & {
6
- website: {
6
+ website: import("./dsl.js").StepMeta<{
7
7
  content: string;
8
- };
8
+ }, false>;
9
9
  } & {
10
- sentiment: {
10
+ sentiment: import("./dsl.js").StepMeta<{
11
11
  score: number;
12
- };
12
+ }, false>;
13
13
  } & {
14
- summary: {
14
+ summary: import("./dsl.js").StepMeta<{
15
15
  aiSummary: string;
16
- };
16
+ }, false>;
17
17
  } & {
18
- saveToDb: string;
18
+ saveToDb: import("./dsl.js").StepMeta<string, false>;
19
19
  }, import("./dsl.js").EmptyDeps & {
20
20
  website: [];
21
21
  } & {
@@ -1,4 +1,15 @@
1
- import { AnyFlow } from './dsl.js';
1
+ import { AnyFlow, WhenUnmetMode, WhenExhaustedMode, Json } from './dsl.js';
2
+ /**
3
+ * Input pattern wrapper - explicit representation to avoid null vs JSON-null ambiguity.
4
+ * - { defined: false } means no pattern (don't check)
5
+ * - { defined: true, value: Json } means pattern is set (check against value)
6
+ */
7
+ export type InputPattern = {
8
+ defined: false;
9
+ } | {
10
+ defined: true;
11
+ value: Json;
12
+ };
2
13
  /**
3
14
  * Step-level options that can be included in the shape for creation,
4
15
  * but are NOT compared during shape comparison (runtime tunable).
@@ -24,11 +35,18 @@ export interface FlowShapeOptions {
24
35
  * The `options` field is included for flow creation but NOT compared during
25
36
  * shape comparison. Options can be tuned at runtime via SQL without
26
37
  * requiring recompilation. See: /deploy/tune-flow-config/
38
+ *
39
+ * `whenUnmet`, `whenExhausted`, and pattern fields ARE structural - they affect
40
+ * DAG execution semantics and must match between worker and database.
27
41
  */
28
42
  export interface StepShape {
29
43
  slug: string;
30
44
  stepType: 'single' | 'map';
31
45
  dependencies: string[];
46
+ whenUnmet: WhenUnmetMode;
47
+ whenExhausted: WhenExhaustedMode;
48
+ requiredInputPattern: InputPattern;
49
+ forbiddenInputPattern: InputPattern;
32
50
  options?: StepShapeOptions;
33
51
  }
34
52
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"flow-shape.d.ts","sourceRoot":"","sources":["../src/flow-shape.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAMnC;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,QAAQ,GAAG,KAAK,CAAC;IAC3B,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,OAAO,CAAC,EAAE,gBAAgB,CAAC;CAC5B;AAED;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,SAAS,EAAE,CAAC;IACnB,OAAO,CAAC,EAAE,gBAAgB,CAAC;CAC5B;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,OAAO,CAAC;IACf,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB;AAyBD;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,OAAO,GAAG,SAAS,CAwCzD;AAMD;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAC/B,CAAC,EAAE,SAAS,EACZ,CAAC,EAAE,SAAS,GACX,qBAAqB,CA6BvB"}
1
+ {"version":3,"file":"flow-shape.d.ts","sourceRoot":"","sources":["../src/flow-shape.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,aAAa,EA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H,wBAAgB,iBAAiB,CAC/B,CAAC,EAAE,SAAS,EACZ,CAAC,EAAE,SAAS,GACX,qBAAqB,CAiCvB"}
@@ -33,6 +33,16 @@ export function extractFlowShape(flow) {
33
33
  stepType: stepDef.stepType ?? 'single',
34
34
  // Sort dependencies alphabetically for deterministic comparison
35
35
  dependencies: [...stepDef.dependencies].sort(),
36
+ // Condition modes are structural - they affect DAG execution semantics
37
+ whenUnmet: stepDef.options.whenUnmet ?? 'skip',
38
+ whenExhausted: stepDef.options.whenExhausted ?? 'fail',
39
+ // Input patterns use explicit wrapper to avoid null vs JSON-null ambiguity
40
+ requiredInputPattern: stepDef.options.if !== undefined
41
+ ? { defined: true, value: stepDef.options.if }
42
+ : { defined: false },
43
+ forbiddenInputPattern: stepDef.options.ifNot !== undefined
44
+ ? { defined: true, value: stepDef.options.ifNot }
45
+ : { defined: false },
36
46
  };
37
47
  // Only include options if at least one is defined
38
48
  const stepOptions = {
@@ -116,4 +126,23 @@ function compareSteps(a, b, index, differences) {
116
126
  if (aDeps !== bDeps) {
117
127
  differences.push(`Step at index ${index}: dependencies differ [${a.dependencies.join(', ')}] vs [${b.dependencies.join(', ')}]`);
118
128
  }
129
+ // Compare condition modes (structural - affects DAG execution semantics)
130
+ if (a.whenUnmet !== b.whenUnmet) {
131
+ differences.push(`Step at index ${index}: whenUnmet differs '${a.whenUnmet}' vs '${b.whenUnmet}'`);
132
+ }
133
+ if (a.whenExhausted !== b.whenExhausted) {
134
+ differences.push(`Step at index ${index}: whenExhausted differs '${a.whenExhausted}' vs '${b.whenExhausted}'`);
135
+ }
136
+ // Compare pattern fields (structural - affects DAG execution semantics)
137
+ // Uses wrapper objects: { defined: false } or { defined: true, value: Json }
138
+ const aReqPattern = JSON.stringify(a.requiredInputPattern);
139
+ const bReqPattern = JSON.stringify(b.requiredInputPattern);
140
+ if (aReqPattern !== bReqPattern) {
141
+ differences.push(`Step at index ${index}: requiredInputPattern differs '${aReqPattern}' vs '${bReqPattern}'`);
142
+ }
143
+ const aForbPattern = JSON.stringify(a.forbiddenInputPattern);
144
+ const bForbPattern = JSON.stringify(b.forbiddenInputPattern);
145
+ if (aForbPattern !== bForbPattern) {
146
+ differences.push(`Step at index ${index}: forbiddenInputPattern differs '${aForbPattern}' vs '${bForbPattern}'`);
147
+ }
119
148
  }
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pgflow/dsl",
3
- "version": "0.13.3",
3
+ "version": "0.14.1",
4
4
  "license": "Apache-2.0",
5
5
  "repository": {
6
6
  "type": "git",
package/dist/utils.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  /**
2
2
  * Validates a slug string according to the following rules:
3
3
  * - Cannot start with a number
4
- * - Cannot start with an underscore
5
- * - Cannot contain spaces
6
- * - Cannot contain special characters like /, :, ?, #
4
+ * - Cannot be empty
5
+ * - Cannot use reserved words
6
+ * - Must contain only letters, numbers, and underscores
7
7
  * - Cannot be longer than 128 characters
8
8
  *
9
9
  * @param slug The slug string to validate
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAsB/C;AAED;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE;IAAE,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,EAC5F,IAAI,GAAE,0BAAgD,GACrD,IAAI,CAiCN"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAsB/C;AAED;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE;IACP,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,EACD,IAAI,GAAE,0BAAgD,GACrD,IAAI,CAiCN"}
package/dist/utils.js CHANGED
@@ -1,29 +1,29 @@
1
1
  /**
2
2
  * Validates a slug string according to the following rules:
3
3
  * - Cannot start with a number
4
- * - Cannot start with an underscore
5
- * - Cannot contain spaces
6
- * - Cannot contain special characters like /, :, ?, #
4
+ * - Cannot be empty
5
+ * - Cannot use reserved words
6
+ * - Must contain only letters, numbers, and underscores
7
7
  * - Cannot be longer than 128 characters
8
8
  *
9
9
  * @param slug The slug string to validate
10
10
  * @throws Error if the slug is invalid
11
11
  */
12
12
  export function validateSlug(slug) {
13
+ if (slug.length === 0) {
14
+ throw new Error('Slug cannot be empty');
15
+ }
13
16
  if (slug.length > 128) {
14
17
  throw new Error(`Slug '${slug}' cannot be longer than 128 characters`);
15
18
  }
19
+ if (slug === 'run') {
20
+ throw new Error(`Slug 'run' is reserved and cannot be used`);
21
+ }
16
22
  if (/^\d/.test(slug)) {
17
23
  throw new Error(`Slug '${slug}' cannot start with a number`);
18
24
  }
19
- if (/^_/.test(slug)) {
20
- throw new Error(`Slug '${slug}' cannot start with an underscore`);
21
- }
22
- if (/\s/.test(slug)) {
23
- throw new Error(`Slug '${slug}' cannot contain spaces`);
24
- }
25
- if (/[/:#\-?]/.test(slug)) {
26
- throw new Error(`Slug '${slug}' cannot contain special characters like /, :, ?, #, -`);
25
+ if (!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(slug)) {
26
+ throw new Error(`Slug '${slug}' can only contain letters, numbers, and underscores`);
27
27
  }
28
28
  }
29
29
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pgflow/dsl",
3
- "version": "0.13.3",
3
+ "version": "0.14.1",
4
4
  "license": "Apache-2.0",
5
5
  "repository": {
6
6
  "type": "git",