@blokjs/helper 0.4.0 → 0.6.0

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/index.d.ts CHANGED
@@ -5,10 +5,14 @@ import Step from "./components/StepNode";
5
5
  import Trigger from "./components/Trigger";
6
6
  import Workflow from "./components/Workflow";
7
7
  import { type BranchOpts, branch } from "./components/branch";
8
+ import { type ForEachOpts, forEach } from "./components/forEach";
9
+ import { type LoopOpts, loop } from "./components/loop";
10
+ import { type SwitchCase, type SwitchOpts, switchOn } from "./components/switchOn";
11
+ import { type TryCatchOpts, tryCatch } from "./components/tryCatch";
8
12
  import { type WorkflowV2Builder, type WorkflowOpts as WorkflowV2Opts, workflow } from "./components/workflowV2";
9
13
  import { $, type DollarProxy, type ExprPath, JS_EXPR_TAG, unwrapProxies } from "./proxy/$";
10
- import { NodeType, NodeTypeSchema, RetryConfig, RetryConfigSchema, RuntimeKind, RuntimeKindSchema, StepInputs, StepOpts, V2BranchStep, V2BranchStepSchema, V2RegularStep, V2RegularStepSchema, V2Step, V2StepSchema, V2SubworkflowStep, V2SubworkflowStepSchema, V2WaitStep, V2WaitStepSchema, isBranchStep, isSubworkflowStep, isWaitStep } from "./types/StepOpts";
11
- import { AnyTriggerOpts, ConcurrencyOpts, ConcurrencyOptsFields, ConcurrencyOptsSchema, CronTriggerOpts, CronTriggerOptsSchema, DebounceOpts, DebounceOptsSchema, HTTP_METHODS, HttpMethod, HttpMethodSchema, HttpTriggerOpts, HttpTriggerOptsSchema, PubSubProvider, PubSubProviderSchema, PubSubTriggerOpts, PubSubTriggerOptsSchema, QueueProvider, QueueProviderSchema, QueueTriggerOpts, QueueTriggerOptsSchema, SSETriggerOpts, SSETriggerOptsSchema, SchedulingOpts, SchedulingOptsFields, SchedulingOptsSchema, TRIGGER_SCHEMAS, TriggerConfigMap, TriggerOpts, TriggerOptsSchema, TriggersEnum, TriggersSchema, WebSocketTriggerOpts, WebSocketTriggerOptsSchema, WebhookTriggerOpts, WebhookTriggerOptsSchema, WorkerTriggerOpts, WorkerTriggerOptsSchema, concurrencyRefinement, makeSchedulingRefinement, validateTriggerConfig } from "./types/TriggerOpts";
14
+ import { NodeType, NodeTypeSchema, RetryConfig, RetryConfigSchema, RuntimeKind, RuntimeKindSchema, StepInputs, StepOpts, V2BranchStep, V2BranchStepSchema, V2ForEachStep, V2ForEachStepSchema, V2LoopStep, V2LoopStepSchema, V2RegularStep, V2RegularStepSchema, V2Step, V2StepSchema, V2SubworkflowStep, V2SubworkflowStepSchema, V2SwitchStep, V2SwitchStepSchema, V2TryCatchStep, V2TryCatchStepSchema, V2WaitStep, V2WaitStepSchema, isBranchStep, isForEachStep, isLoopStep, isSubworkflowStep, isSwitchStep, isTryCatchStep, isWaitStep } from "./types/StepOpts";
15
+ import { AnyTriggerOpts, ConcurrencyOpts, ConcurrencyOptsFields, ConcurrencyOptsSchema, CronTriggerOpts, CronTriggerOptsSchema, DebounceOpts, DebounceOptsSchema, HTTP_METHODS, HttpMethod, HttpMethodSchema, HttpTriggerOpts, HttpTriggerOptsSchema, PubSubProvider, PubSubProviderSchema, PubSubTriggerOpts, PubSubTriggerOptsSchema, QueueProvider, QueueProviderSchema, QueueTriggerOpts, QueueTriggerOptsSchema, SSETriggerOpts, SSETriggerOptsSchema, SchedulingOpts, SchedulingOptsFields, SchedulingOptsSchema, TRIGGER_SCHEMAS, TriggerConfigMap, TriggerOpts, TriggerOptsSchema, TriggersEnum, TriggersSchema, WebSocketTriggerOpts, WebSocketTriggerOptsSchema, WebhookTriggerOpts, WebhookTriggerOptsSchema, WorkerProvider, WorkerProviderSchema, WorkerTriggerOpts, WorkerTriggerOptsSchema, concurrencyRefinement, makeSchedulingRefinement, validateTriggerConfig } from "./types/TriggerOpts";
12
16
  import { WorkflowV2, WorkflowV2Schema } from "./types/WorkflowOpts";
13
17
  import { parseDuration, tryParseDuration } from "./utils/parseDuration";
14
- export { AddElse, AddIf, ConditionOpts, HelperResponse, NodeType, NodeTypeSchema, RuntimeKind, RuntimeKindSchema, Step, StepInputs, StepOpts, Trigger, Workflow, workflow, branch, $, unwrapProxies, type BranchOpts, type WorkflowV2Opts, type WorkflowV2Builder, type DollarProxy, type ExprPath, JS_EXPR_TAG, V2Step, V2StepSchema, V2RegularStep, V2RegularStepSchema, V2BranchStep, V2BranchStepSchema, isBranchStep, V2SubworkflowStep, V2SubworkflowStepSchema, isSubworkflowStep, V2WaitStep, V2WaitStepSchema, isWaitStep, RetryConfig, RetryConfigSchema, WorkflowV2, WorkflowV2Schema, HTTP_METHODS, HttpMethod, HttpMethodSchema, ConcurrencyOpts, ConcurrencyOptsFields, ConcurrencyOptsSchema, concurrencyRefinement, DebounceOpts, DebounceOptsSchema, makeSchedulingRefinement, SchedulingOpts, SchedulingOptsFields, SchedulingOptsSchema, HttpTriggerOpts, HttpTriggerOptsSchema, TriggerOpts, TriggerOptsSchema, QueueProvider, QueueProviderSchema, QueueTriggerOpts, QueueTriggerOptsSchema, PubSubProvider, PubSubProviderSchema, PubSubTriggerOpts, PubSubTriggerOptsSchema, WorkerTriggerOpts, WorkerTriggerOptsSchema, CronTriggerOpts, CronTriggerOptsSchema, WebhookTriggerOpts, WebhookTriggerOptsSchema, WebSocketTriggerOpts, WebSocketTriggerOptsSchema, SSETriggerOpts, SSETriggerOptsSchema, TriggersSchema, TriggersEnum, TriggerConfigMap, TRIGGER_SCHEMAS, AnyTriggerOpts, validateTriggerConfig, parseDuration, tryParseDuration, };
18
+ export { AddElse, AddIf, ConditionOpts, HelperResponse, NodeType, NodeTypeSchema, RuntimeKind, RuntimeKindSchema, Step, StepInputs, StepOpts, Trigger, Workflow, workflow, branch, forEach, loop, switchOn, tryCatch, $, unwrapProxies, type BranchOpts, type ForEachOpts, type LoopOpts, type SwitchOpts, type SwitchCase, type TryCatchOpts, type WorkflowV2Opts, type WorkflowV2Builder, type DollarProxy, type ExprPath, JS_EXPR_TAG, V2Step, V2StepSchema, V2RegularStep, V2RegularStepSchema, V2BranchStep, V2BranchStepSchema, isBranchStep, V2SubworkflowStep, V2SubworkflowStepSchema, isSubworkflowStep, V2WaitStep, V2WaitStepSchema, isWaitStep, V2ForEachStep, V2ForEachStepSchema, isForEachStep, V2LoopStep, V2LoopStepSchema, isLoopStep, V2SwitchStep, V2SwitchStepSchema, isSwitchStep, V2TryCatchStep, V2TryCatchStepSchema, isTryCatchStep, RetryConfig, RetryConfigSchema, WorkflowV2, WorkflowV2Schema, HTTP_METHODS, HttpMethod, HttpMethodSchema, ConcurrencyOpts, ConcurrencyOptsFields, ConcurrencyOptsSchema, concurrencyRefinement, DebounceOpts, DebounceOptsSchema, makeSchedulingRefinement, SchedulingOpts, SchedulingOptsFields, SchedulingOptsSchema, HttpTriggerOpts, HttpTriggerOptsSchema, TriggerOpts, TriggerOptsSchema, QueueProvider, QueueProviderSchema, QueueTriggerOpts, QueueTriggerOptsSchema, PubSubProvider, PubSubProviderSchema, PubSubTriggerOpts, PubSubTriggerOptsSchema, WorkerProvider, WorkerProviderSchema, WorkerTriggerOpts, WorkerTriggerOptsSchema, CronTriggerOpts, CronTriggerOptsSchema, WebhookTriggerOpts, WebhookTriggerOptsSchema, WebSocketTriggerOpts, WebSocketTriggerOptsSchema, SSETriggerOpts, SSETriggerOptsSchema, TriggersSchema, TriggersEnum, TriggerConfigMap, TRIGGER_SCHEMAS, AnyTriggerOpts, validateTriggerConfig, parseDuration, tryParseDuration, };
package/dist/index.js CHANGED
@@ -5,23 +5,29 @@ import Step from "./components/StepNode";
5
5
  import Trigger from "./components/Trigger";
6
6
  import Workflow from "./components/Workflow";
7
7
  import { branch } from "./components/branch";
8
+ import { forEach } from "./components/forEach";
9
+ import { loop } from "./components/loop";
10
+ import { switchOn } from "./components/switchOn";
11
+ import { tryCatch } from "./components/tryCatch";
8
12
  import { workflow } from "./components/workflowV2";
9
13
  import { $, JS_EXPR_TAG, unwrapProxies } from "./proxy/$";
10
- import { NodeTypeSchema, RetryConfigSchema, RuntimeKindSchema, V2BranchStepSchema, V2RegularStepSchema, V2StepSchema, V2SubworkflowStepSchema, V2WaitStepSchema, isBranchStep, isSubworkflowStep, isWaitStep, } from "./types/StepOpts";
14
+ import { NodeTypeSchema, RetryConfigSchema, RuntimeKindSchema, V2BranchStepSchema, V2ForEachStepSchema, V2LoopStepSchema, V2RegularStepSchema, V2StepSchema, V2SubworkflowStepSchema, V2SwitchStepSchema, V2TryCatchStepSchema, V2WaitStepSchema, isBranchStep, isForEachStep, isLoopStep, isSubworkflowStep, isSwitchStep, isTryCatchStep, isWaitStep, } from "./types/StepOpts";
11
15
  import { ConcurrencyOptsFields, ConcurrencyOptsSchema, CronTriggerOptsSchema, DebounceOptsSchema,
12
16
  // HTTP method enum (canonical names + legacy * preprocess)
13
17
  HTTP_METHODS, HttpMethodSchema, HttpTriggerOptsSchema, PubSubProviderSchema, PubSubTriggerOptsSchema, QueueProviderSchema, QueueTriggerOptsSchema, SSETriggerOptsSchema, SchedulingOptsFields, SchedulingOptsSchema,
14
18
  // Trigger registry
15
19
  TRIGGER_SCHEMAS, TriggerOptsSchema,
16
20
  // Triggers enum
17
- TriggersSchema, WebSocketTriggerOptsSchema, WebhookTriggerOptsSchema, WorkerTriggerOptsSchema, concurrencyRefinement, makeSchedulingRefinement, validateTriggerConfig, } from "./types/TriggerOpts";
21
+ TriggersSchema, WebSocketTriggerOptsSchema, WebhookTriggerOptsSchema, WorkerProviderSchema, WorkerTriggerOptsSchema, concurrencyRefinement, makeSchedulingRefinement, validateTriggerConfig, } from "./types/TriggerOpts";
18
22
  import { WorkflowV2Schema } from "./types/WorkflowOpts";
19
23
  import { parseDuration, tryParseDuration } from "./utils/parseDuration";
20
24
  export { AddElse, AddIf, HelperResponse, NodeTypeSchema, RuntimeKindSchema, Step, Trigger, Workflow,
21
25
  // v2 DSL primitives — the canonical authoring surface
22
- workflow, branch, $, unwrapProxies, JS_EXPR_TAG, V2StepSchema, V2RegularStepSchema, V2BranchStepSchema, isBranchStep, V2SubworkflowStepSchema, isSubworkflowStep, V2WaitStepSchema, isWaitStep, RetryConfigSchema, WorkflowV2Schema,
26
+ workflow, branch,
27
+ // v0.5 control-flow primitives
28
+ forEach, loop, switchOn, tryCatch, $, unwrapProxies, JS_EXPR_TAG, V2StepSchema, V2RegularStepSchema, V2BranchStepSchema, isBranchStep, V2SubworkflowStepSchema, isSubworkflowStep, V2WaitStepSchema, isWaitStep, V2ForEachStepSchema, isForEachStep, V2LoopStepSchema, isLoopStep, V2SwitchStepSchema, isSwitchStep, V2TryCatchStepSchema, isTryCatchStep, RetryConfigSchema, WorkflowV2Schema,
23
29
  // HTTP method enum
24
- HTTP_METHODS, HttpMethodSchema, ConcurrencyOptsFields, ConcurrencyOptsSchema, concurrencyRefinement, DebounceOptsSchema, makeSchedulingRefinement, SchedulingOptsFields, SchedulingOptsSchema, HttpTriggerOptsSchema, TriggerOptsSchema, QueueProviderSchema, QueueTriggerOptsSchema, PubSubProviderSchema, PubSubTriggerOptsSchema, WorkerTriggerOptsSchema, CronTriggerOptsSchema, WebhookTriggerOptsSchema, WebSocketTriggerOptsSchema, SSETriggerOptsSchema, TriggersSchema, TRIGGER_SCHEMAS, validateTriggerConfig,
30
+ HTTP_METHODS, HttpMethodSchema, ConcurrencyOptsFields, ConcurrencyOptsSchema, concurrencyRefinement, DebounceOptsSchema, makeSchedulingRefinement, SchedulingOptsFields, SchedulingOptsSchema, HttpTriggerOptsSchema, TriggerOptsSchema, QueueProviderSchema, QueueTriggerOptsSchema, PubSubProviderSchema, PubSubTriggerOptsSchema, WorkerProviderSchema, WorkerTriggerOptsSchema, CronTriggerOptsSchema, WebhookTriggerOptsSchema, WebSocketTriggerOptsSchema, SSETriggerOptsSchema, TriggersSchema, TRIGGER_SCHEMAS, validateTriggerConfig,
25
31
  // Duration parser (Tier 2 #5 + #7)
26
32
  parseDuration, tryParseDuration, };
27
33
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot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EAYb,WAAW,EAGX,YAAY,EAEZ,mBAAmB,EAEnB,kBAAkB,EAClB,YAAY,EAGZ,uBAAuB,EACvB,iBAAiB,EAGjB,gBAAgB,EAChB,UAAU,EAGV,mBAAmB,EACnB,aAAa,EAEb,gBAAgB,EAChB,UAAU,EAEV,kBAAkB,EAClB,YAAY,EAEZ,oBAAoB,EACpB,cAAc,EAGd,iBAAiB,EAGjB,gBAAgB;AAChB,mBAAmB;AACnB,YAAY,EAEZ,gBAAgB,EAGhB,qBAAqB,EACrB,qBAAqB,EACrB,qBAAqB,EAGrB,kBAAkB,EAClB,wBAAwB,EAExB,oBAAoB,EACpB,oBAAoB,EAGpB,qBAAqB,EAGrB,iBAAiB,EAEjB,mBAAmB,EAEnB,sBAAsB,EAEtB,oBAAoB,EAEpB,uBAAuB,EAEvB,oBAAoB,EAEpB,uBAAuB,EAEvB,qBAAqB,EAErB,wBAAwB,EAExB,0BAA0B,EAE1B,oBAAoB,EACpB,cAAc,EAId,eAAe,EAEf,qBAAqB;AACrB,mCAAmC;AACnC,aAAa,EACb,gBAAgB,GAChB,CAAC"}
package/dist/proxy/$.d.ts CHANGED
@@ -63,6 +63,13 @@ export interface DollarProxy {
63
63
  readonly env: ExprPath;
64
64
  readonly step: ExprPath;
65
65
  readonly workflow: ExprPath;
66
+ /**
67
+ * The captured error inside a `tryCatch.catch` block (v0.5).
68
+ * Resolves to `ctx.error`; undefined inside `try`, `finally`, and
69
+ * any step outside a tryCatch. Use `$.error.message`, `$.error.name`,
70
+ * `$.error.stack`.
71
+ */
72
+ readonly error: ExprPath;
66
73
  /** Escape hatch — any property; returns a sub-path. */
67
74
  readonly [key: string]: ExprPath;
68
75
  }
@@ -1 +1 @@
1
- {"version":3,"file":"$.js","sourceRoot":"","sources":["../../src/proxy/$.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,wEAAwE;AACxE,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC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AAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QAC1B,OAAO,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAC1B,CAAC;IAED,8DAA8D;IAC9D,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC/B,MAAM,KAAK,GAAG,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;QAC3C,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,MAAM,CAAC,SAAS,EAAE,CAAC;YAClD,MAAM,GAAG,GAA4B,EAAE,CAAC;YACxC,KAAK,MAAM,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;gBACpC,GAAG,CAAC,CAAC,CAAC,GAAG,MAAM,CAAE,KAAiC,CAAC,CAAC,CAAC,CAAC,CAAC;YACxD,CAAC;YACD,OAAO,GAAG,CAAC;QACZ,CAAC;IACF,CAAC;IAED,OAAO,KAAK,CAAC;AACd,CAAC"}
@@ -28,12 +28,6 @@ export declare const StepOptsSchema: z.ZodObject<{
28
28
  type: z.ZodEnum<["local", "module", "runtime.python3", "runtime.nodejs", "runtime.bun", "runtime.go", "runtime.java", "runtime.rust", "runtime.php", "runtime.csharp", "runtime.ruby", "runtime.docker", "runtime.wasm"]>;
29
29
  inputs: z.ZodOptional<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>>;
30
30
  runtime: z.ZodOptional<z.ZodEnum<["nodejs", "bun", "python3", "go", "java", "rust", "php", "csharp", "ruby", "docker", "wasm"]>>;
31
- /**
32
- * @deprecated v2 default-stores every step's output. Set `ephemeral: true`
33
- * to opt out. `set_var: true` is now a no-op (default behaviour);
34
- * `set_var: false` is normalized to `ephemeral: true` at load time.
35
- */
36
- set_var: z.ZodOptional<z.ZodBoolean>;
37
31
  active: z.ZodOptional<z.ZodBoolean>;
38
32
  stop: z.ZodOptional<z.ZodBoolean>;
39
33
  stream_logs: z.ZodOptional<z.ZodBoolean>;
@@ -43,7 +37,6 @@ export declare const StepOptsSchema: z.ZodObject<{
43
37
  type: "local" | "module" | "runtime.python3" | "runtime.nodejs" | "runtime.bun" | "runtime.go" | "runtime.java" | "runtime.rust" | "runtime.php" | "runtime.csharp" | "runtime.ruby" | "runtime.docker" | "runtime.wasm";
44
38
  inputs?: {} | undefined;
45
39
  runtime?: "nodejs" | "bun" | "python3" | "go" | "java" | "rust" | "php" | "csharp" | "ruby" | "docker" | "wasm" | undefined;
46
- set_var?: boolean | undefined;
47
40
  active?: boolean | undefined;
48
41
  stop?: boolean | undefined;
49
42
  stream_logs?: boolean | undefined;
@@ -53,7 +46,6 @@ export declare const StepOptsSchema: z.ZodObject<{
53
46
  type: "local" | "module" | "runtime.python3" | "runtime.nodejs" | "runtime.bun" | "runtime.go" | "runtime.java" | "runtime.rust" | "runtime.php" | "runtime.csharp" | "runtime.ruby" | "runtime.docker" | "runtime.wasm";
54
47
  inputs?: {} | undefined;
55
48
  runtime?: "nodejs" | "bun" | "python3" | "go" | "java" | "rust" | "php" | "csharp" | "ruby" | "docker" | "wasm" | undefined;
56
- set_var?: boolean | undefined;
57
49
  active?: boolean | undefined;
58
50
  stop?: boolean | undefined;
59
51
  stream_logs?: boolean | undefined;
@@ -68,12 +60,6 @@ export declare const StepConditionSchema: z.ZodObject<{
68
60
  type: z.ZodEnum<["local", "module", "runtime.python3", "runtime.nodejs", "runtime.bun", "runtime.go", "runtime.java", "runtime.rust", "runtime.php", "runtime.csharp", "runtime.ruby", "runtime.docker", "runtime.wasm"]>;
69
61
  inputs: z.ZodOptional<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>>;
70
62
  runtime: z.ZodOptional<z.ZodEnum<["nodejs", "bun", "python3", "go", "java", "rust", "php", "csharp", "ruby", "docker", "wasm"]>>;
71
- /**
72
- * @deprecated v2 default-stores every step's output. Set `ephemeral: true`
73
- * to opt out. `set_var: true` is now a no-op (default behaviour);
74
- * `set_var: false` is normalized to `ephemeral: true` at load time.
75
- */
76
- set_var: z.ZodOptional<z.ZodBoolean>;
77
63
  active: z.ZodOptional<z.ZodBoolean>;
78
64
  stop: z.ZodOptional<z.ZodBoolean>;
79
65
  stream_logs: z.ZodOptional<z.ZodBoolean>;
@@ -83,7 +69,6 @@ export declare const StepConditionSchema: z.ZodObject<{
83
69
  type: "local" | "module" | "runtime.python3" | "runtime.nodejs" | "runtime.bun" | "runtime.go" | "runtime.java" | "runtime.rust" | "runtime.php" | "runtime.csharp" | "runtime.ruby" | "runtime.docker" | "runtime.wasm";
84
70
  inputs?: {} | undefined;
85
71
  runtime?: "nodejs" | "bun" | "python3" | "go" | "java" | "rust" | "php" | "csharp" | "ruby" | "docker" | "wasm" | undefined;
86
- set_var?: boolean | undefined;
87
72
  active?: boolean | undefined;
88
73
  stop?: boolean | undefined;
89
74
  stream_logs?: boolean | undefined;
@@ -93,7 +78,6 @@ export declare const StepConditionSchema: z.ZodObject<{
93
78
  type: "local" | "module" | "runtime.python3" | "runtime.nodejs" | "runtime.bun" | "runtime.go" | "runtime.java" | "runtime.rust" | "runtime.php" | "runtime.csharp" | "runtime.ruby" | "runtime.docker" | "runtime.wasm";
94
79
  inputs?: {} | undefined;
95
80
  runtime?: "nodejs" | "bun" | "python3" | "go" | "java" | "rust" | "php" | "csharp" | "ruby" | "docker" | "wasm" | undefined;
96
- set_var?: boolean | undefined;
97
81
  active?: boolean | undefined;
98
82
  stop?: boolean | undefined;
99
83
  stream_logs?: boolean | undefined;
@@ -106,7 +90,6 @@ export declare const StepConditionSchema: z.ZodObject<{
106
90
  type: "local" | "module" | "runtime.python3" | "runtime.nodejs" | "runtime.bun" | "runtime.go" | "runtime.java" | "runtime.rust" | "runtime.php" | "runtime.csharp" | "runtime.ruby" | "runtime.docker" | "runtime.wasm";
107
91
  inputs?: {} | undefined;
108
92
  runtime?: "nodejs" | "bun" | "python3" | "go" | "java" | "rust" | "php" | "csharp" | "ruby" | "docker" | "wasm" | undefined;
109
- set_var?: boolean | undefined;
110
93
  active?: boolean | undefined;
111
94
  stop?: boolean | undefined;
112
95
  stream_logs?: boolean | undefined;
@@ -119,7 +102,6 @@ export declare const StepConditionSchema: z.ZodObject<{
119
102
  type: "local" | "module" | "runtime.python3" | "runtime.nodejs" | "runtime.bun" | "runtime.go" | "runtime.java" | "runtime.rust" | "runtime.php" | "runtime.csharp" | "runtime.ruby" | "runtime.docker" | "runtime.wasm";
120
103
  inputs?: {} | undefined;
121
104
  runtime?: "nodejs" | "bun" | "python3" | "go" | "java" | "rust" | "php" | "csharp" | "ruby" | "docker" | "wasm" | undefined;
122
- set_var?: boolean | undefined;
123
105
  active?: boolean | undefined;
124
106
  stop?: boolean | undefined;
125
107
  stream_logs?: boolean | undefined;
@@ -242,21 +224,19 @@ export declare const V2RegularStepSchema: z.ZodEffects<z.ZodObject<{
242
224
  maxTimeoutInMs?: number | undefined;
243
225
  }>>;
244
226
  maxDuration: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
245
- set_var: z.ZodOptional<z.ZodBoolean>;
246
227
  }, "strip", z.ZodTypeAny, {
247
228
  id: string;
248
229
  use: string;
249
230
  type?: "local" | "module" | "runtime.python3" | "runtime.nodejs" | "runtime.bun" | "runtime.go" | "runtime.java" | "runtime.rust" | "runtime.php" | "runtime.csharp" | "runtime.ruby" | "runtime.docker" | "runtime.wasm" | undefined;
250
231
  inputs?: Record<string, unknown> | undefined;
251
232
  runtime?: "nodejs" | "bun" | "python3" | "go" | "java" | "rust" | "php" | "csharp" | "ruby" | "docker" | "wasm" | undefined;
252
- set_var?: boolean | undefined;
253
233
  active?: boolean | undefined;
254
234
  stop?: boolean | undefined;
255
235
  stream_logs?: boolean | undefined;
236
+ idempotencyKey?: string | undefined;
256
237
  as?: string | undefined;
257
238
  spread?: boolean | undefined;
258
239
  ephemeral?: boolean | undefined;
259
- idempotencyKey?: string | undefined;
260
240
  idempotencyKeyTTL?: number | undefined;
261
241
  retry?: {
262
242
  maxAttempts: number;
@@ -271,14 +251,13 @@ export declare const V2RegularStepSchema: z.ZodEffects<z.ZodObject<{
271
251
  type?: "local" | "module" | "runtime.python3" | "runtime.nodejs" | "runtime.bun" | "runtime.go" | "runtime.java" | "runtime.rust" | "runtime.php" | "runtime.csharp" | "runtime.ruby" | "runtime.docker" | "runtime.wasm" | undefined;
272
252
  inputs?: Record<string, unknown> | undefined;
273
253
  runtime?: "nodejs" | "bun" | "python3" | "go" | "java" | "rust" | "php" | "csharp" | "ruby" | "docker" | "wasm" | undefined;
274
- set_var?: boolean | undefined;
275
254
  active?: boolean | undefined;
276
255
  stop?: boolean | undefined;
277
256
  stream_logs?: boolean | undefined;
257
+ idempotencyKey?: string | undefined;
278
258
  as?: string | undefined;
279
259
  spread?: boolean | undefined;
280
260
  ephemeral?: boolean | undefined;
281
- idempotencyKey?: string | undefined;
282
261
  idempotencyKeyTTL?: number | undefined;
283
262
  retry?: {
284
263
  maxAttempts: number;
@@ -293,14 +272,13 @@ export declare const V2RegularStepSchema: z.ZodEffects<z.ZodObject<{
293
272
  type?: "local" | "module" | "runtime.python3" | "runtime.nodejs" | "runtime.bun" | "runtime.go" | "runtime.java" | "runtime.rust" | "runtime.php" | "runtime.csharp" | "runtime.ruby" | "runtime.docker" | "runtime.wasm" | undefined;
294
273
  inputs?: Record<string, unknown> | undefined;
295
274
  runtime?: "nodejs" | "bun" | "python3" | "go" | "java" | "rust" | "php" | "csharp" | "ruby" | "docker" | "wasm" | undefined;
296
- set_var?: boolean | undefined;
297
275
  active?: boolean | undefined;
298
276
  stop?: boolean | undefined;
299
277
  stream_logs?: boolean | undefined;
278
+ idempotencyKey?: string | undefined;
300
279
  as?: string | undefined;
301
280
  spread?: boolean | undefined;
302
281
  ephemeral?: boolean | undefined;
303
- idempotencyKey?: string | undefined;
304
282
  idempotencyKeyTTL?: number | undefined;
305
283
  retry?: {
306
284
  maxAttempts: number;
@@ -315,14 +293,13 @@ export declare const V2RegularStepSchema: z.ZodEffects<z.ZodObject<{
315
293
  type?: "local" | "module" | "runtime.python3" | "runtime.nodejs" | "runtime.bun" | "runtime.go" | "runtime.java" | "runtime.rust" | "runtime.php" | "runtime.csharp" | "runtime.ruby" | "runtime.docker" | "runtime.wasm" | undefined;
316
294
  inputs?: Record<string, unknown> | undefined;
317
295
  runtime?: "nodejs" | "bun" | "python3" | "go" | "java" | "rust" | "php" | "csharp" | "ruby" | "docker" | "wasm" | undefined;
318
- set_var?: boolean | undefined;
319
296
  active?: boolean | undefined;
320
297
  stop?: boolean | undefined;
321
298
  stream_logs?: boolean | undefined;
299
+ idempotencyKey?: string | undefined;
322
300
  as?: string | undefined;
323
301
  spread?: boolean | undefined;
324
302
  ephemeral?: boolean | undefined;
325
- idempotencyKey?: string | undefined;
326
303
  idempotencyKeyTTL?: number | undefined;
327
304
  retry?: {
328
305
  maxAttempts: number;
@@ -404,6 +381,15 @@ export declare const V2SubworkflowStepSchema: z.ZodType<{
404
381
  idempotencyKey?: string;
405
382
  idempotencyKeyTTL?: number;
406
383
  retry?: RetryConfig;
384
+ allowList?: readonly string[];
385
+ /**
386
+ * G2 (v0.6) — dispatch strategy. `in-process` (default) runs the
387
+ * child workflow in the same Node process; `http-self` makes an
388
+ * HTTP self-call to the deployment so multi-process deployments
389
+ * can isolate child execution. Requires the child to have an HTTP
390
+ * trigger (`trigger.http.path` set).
391
+ */
392
+ dispatch?: "in-process" | "http-self";
407
393
  }>;
408
394
  export type V2SubworkflowStep = z.infer<typeof V2SubworkflowStepSchema>;
409
395
  /**
@@ -455,10 +441,10 @@ export declare const V2WaitStepSchema: z.ZodEffects<z.ZodObject<{
455
441
  active?: boolean | undefined;
456
442
  stop?: boolean | undefined;
457
443
  concurrencyKey?: undefined;
444
+ idempotencyKey?: undefined;
458
445
  as?: string | undefined;
459
446
  spread?: undefined;
460
447
  ephemeral?: boolean | undefined;
461
- idempotencyKey?: undefined;
462
448
  retry?: undefined;
463
449
  maxDuration?: undefined;
464
450
  }, {
@@ -470,10 +456,10 @@ export declare const V2WaitStepSchema: z.ZodEffects<z.ZodObject<{
470
456
  active?: boolean | undefined;
471
457
  stop?: boolean | undefined;
472
458
  concurrencyKey?: undefined;
459
+ idempotencyKey?: undefined;
473
460
  as?: string | undefined;
474
461
  spread?: undefined;
475
462
  ephemeral?: boolean | undefined;
476
- idempotencyKey?: undefined;
477
463
  retry?: undefined;
478
464
  maxDuration?: undefined;
479
465
  }>, {
@@ -485,10 +471,10 @@ export declare const V2WaitStepSchema: z.ZodEffects<z.ZodObject<{
485
471
  active?: boolean | undefined;
486
472
  stop?: boolean | undefined;
487
473
  concurrencyKey?: undefined;
474
+ idempotencyKey?: undefined;
488
475
  as?: string | undefined;
489
476
  spread?: undefined;
490
477
  ephemeral?: boolean | undefined;
491
- idempotencyKey?: undefined;
492
478
  retry?: undefined;
493
479
  maxDuration?: undefined;
494
480
  }, {
@@ -500,25 +486,290 @@ export declare const V2WaitStepSchema: z.ZodEffects<z.ZodObject<{
500
486
  active?: boolean | undefined;
501
487
  stop?: boolean | undefined;
502
488
  concurrencyKey?: undefined;
489
+ idempotencyKey?: undefined;
503
490
  as?: string | undefined;
504
491
  spread?: undefined;
505
492
  ephemeral?: boolean | undefined;
506
- idempotencyKey?: undefined;
507
493
  retry?: undefined;
508
494
  maxDuration?: undefined;
509
495
  }>;
510
496
  export type V2WaitStep = z.infer<typeof V2WaitStepSchema>;
511
497
  /**
512
- * Discriminated v2 step — regular, branch, sub-workflow, or wait.
498
+ * V2 forEach step — iterate over a collection running a sub-pipeline
499
+ * per item. Sequential (default) or parallel with bounded concurrency.
500
+ *
501
+ * @example
502
+ * forEach({
503
+ * id: "process-orders",
504
+ * in: $.state.orders,
505
+ * as: "order",
506
+ * mode: "parallel",
507
+ * concurrency: 5,
508
+ * do: [
509
+ * { id: "charge", use: "stripe-charge", inputs: { amount: $.state.order.total } },
510
+ * ],
511
+ * })
512
+ */
513
+ export declare const V2ForEachStepSchema: z.ZodLazy<z.ZodObject<{
514
+ id: z.ZodString;
515
+ forEach: z.ZodObject<{
516
+ in: z.ZodUnknown;
517
+ as: z.ZodString;
518
+ mode: z.ZodOptional<z.ZodEnum<["sequential", "parallel"]>>;
519
+ concurrency: z.ZodOptional<z.ZodNumber>;
520
+ do: z.ZodArray<z.ZodUnknown, "many">;
521
+ }, "strip", z.ZodTypeAny, {
522
+ as: string;
523
+ do: unknown[];
524
+ mode?: "sequential" | "parallel" | undefined;
525
+ concurrency?: number | undefined;
526
+ in?: unknown;
527
+ }, {
528
+ as: string;
529
+ do: unknown[];
530
+ mode?: "sequential" | "parallel" | undefined;
531
+ concurrency?: number | undefined;
532
+ in?: unknown;
533
+ }>;
534
+ active: z.ZodOptional<z.ZodBoolean>;
535
+ stop: z.ZodOptional<z.ZodBoolean>;
536
+ }, "strip", z.ZodTypeAny, {
537
+ forEach: {
538
+ as: string;
539
+ do: unknown[];
540
+ mode?: "sequential" | "parallel" | undefined;
541
+ concurrency?: number | undefined;
542
+ in?: unknown;
543
+ };
544
+ id: string;
545
+ active?: boolean | undefined;
546
+ stop?: boolean | undefined;
547
+ }, {
548
+ forEach: {
549
+ as: string;
550
+ do: unknown[];
551
+ mode?: "sequential" | "parallel" | undefined;
552
+ concurrency?: number | undefined;
553
+ in?: unknown;
554
+ };
555
+ id: string;
556
+ active?: boolean | undefined;
557
+ stop?: boolean | undefined;
558
+ }>>;
559
+ export type V2ForEachStep = z.infer<typeof V2ForEachStepSchema>;
560
+ /**
561
+ * V2 loop step — while-loop with hard maxIterations safety cap.
562
+ *
563
+ * @example
564
+ * loop({
565
+ * id: "poll",
566
+ * while: '$.state["check-status"].status !== "done"',
567
+ * maxIterations: 60,
568
+ * do: [
569
+ * { id: "wait-tick", wait: { for: "2s" } },
570
+ * { id: "check-status", use: "@blokjs/api-call", inputs: { url: $.state.url } },
571
+ * ],
572
+ * })
573
+ */
574
+ export declare const V2LoopStepSchema: z.ZodLazy<z.ZodObject<{
575
+ id: z.ZodString;
576
+ loop: z.ZodObject<{
577
+ while: z.ZodString;
578
+ maxIterations: z.ZodOptional<z.ZodNumber>;
579
+ do: z.ZodArray<z.ZodUnknown, "many">;
580
+ }, "strip", z.ZodTypeAny, {
581
+ do: unknown[];
582
+ while: string;
583
+ maxIterations?: number | undefined;
584
+ }, {
585
+ do: unknown[];
586
+ while: string;
587
+ maxIterations?: number | undefined;
588
+ }>;
589
+ active: z.ZodOptional<z.ZodBoolean>;
590
+ stop: z.ZodOptional<z.ZodBoolean>;
591
+ }, "strip", z.ZodTypeAny, {
592
+ id: string;
593
+ loop: {
594
+ do: unknown[];
595
+ while: string;
596
+ maxIterations?: number | undefined;
597
+ };
598
+ active?: boolean | undefined;
599
+ stop?: boolean | undefined;
600
+ }, {
601
+ id: string;
602
+ loop: {
603
+ do: unknown[];
604
+ while: string;
605
+ maxIterations?: number | undefined;
606
+ };
607
+ active?: boolean | undefined;
608
+ stop?: boolean | undefined;
609
+ }>>;
610
+ export type V2LoopStep = z.infer<typeof V2LoopStepSchema>;
611
+ /**
612
+ * V2 switch step — N-way branch keyed on a value. First matching case wins.
613
+ *
614
+ * `on` resolves to a value at run time (literal, `$` proxy expression, or
615
+ * `js/...` string). Each case carries a `when` and a `do` sub-pipeline:
616
+ * - `when` is a literal → match if `on === when`.
617
+ * - `when` is an array → match if `array.includes(on)` (group related cases).
618
+ * - `default` runs when no case matches. Optional.
619
+ *
620
+ * @example
621
+ * switchOn({
622
+ * id: "route-by-tenant",
623
+ * on: $.req.headers["x-tenant-id"],
624
+ * cases: [
625
+ * { when: "acme", do: [{ id: "x", subworkflow: "acme-process" }] },
626
+ * { when: ["a","b"], do: [{ id: "y", subworkflow: "shared" }] },
627
+ * ],
628
+ * default: [{ id: "respond-403", use: "@blokjs/respond", stop: true,
629
+ * inputs: { status: 403, body: { error: "Unknown tenant" } } }],
630
+ * })
631
+ */
632
+ export declare const V2SwitchStepSchema: z.ZodLazy<z.ZodObject<{
633
+ id: z.ZodString;
634
+ switch: z.ZodObject<{
635
+ on: z.ZodUnknown;
636
+ cases: z.ZodArray<z.ZodObject<{
637
+ when: z.ZodUnknown;
638
+ do: z.ZodArray<z.ZodUnknown, "many">;
639
+ }, "strip", z.ZodTypeAny, {
640
+ do: unknown[];
641
+ when?: unknown;
642
+ }, {
643
+ do: unknown[];
644
+ when?: unknown;
645
+ }>, "many">;
646
+ default: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
647
+ }, "strip", z.ZodTypeAny, {
648
+ cases: {
649
+ do: unknown[];
650
+ when?: unknown;
651
+ }[];
652
+ on?: unknown;
653
+ default?: unknown[] | undefined;
654
+ }, {
655
+ cases: {
656
+ do: unknown[];
657
+ when?: unknown;
658
+ }[];
659
+ on?: unknown;
660
+ default?: unknown[] | undefined;
661
+ }>;
662
+ active: z.ZodOptional<z.ZodBoolean>;
663
+ stop: z.ZodOptional<z.ZodBoolean>;
664
+ }, "strip", z.ZodTypeAny, {
665
+ id: string;
666
+ switch: {
667
+ cases: {
668
+ do: unknown[];
669
+ when?: unknown;
670
+ }[];
671
+ on?: unknown;
672
+ default?: unknown[] | undefined;
673
+ };
674
+ active?: boolean | undefined;
675
+ stop?: boolean | undefined;
676
+ }, {
677
+ id: string;
678
+ switch: {
679
+ cases: {
680
+ do: unknown[];
681
+ when?: unknown;
682
+ }[];
683
+ on?: unknown;
684
+ default?: unknown[] | undefined;
685
+ };
686
+ active?: boolean | undefined;
687
+ stop?: boolean | undefined;
688
+ }>>;
689
+ export type V2SwitchStep = z.infer<typeof V2SwitchStepSchema>;
690
+ /**
691
+ * V2 tryCatch step — JS-like exception handling for sub-pipelines.
692
+ *
693
+ * - `try` block runs first.
694
+ * - On error, the `catch` block runs with `ctx.error` populated
695
+ * (`$.error.message`, `$.error.name`, `$.error.stack`). Errors thrown
696
+ * inside `catch` propagate to the next outer handler — they DO NOT
697
+ * re-trigger `catch`.
698
+ * - `finally` (if provided) runs unconditionally after try/catch — on
699
+ * normal completion, after a caught error, AND after an uncaught
700
+ * error from inside `catch`. Errors from `finally` propagate.
701
+ *
702
+ * State mutations from any block are visible to subsequent top-level
703
+ * steps (passthrough flow, like switch).
704
+ *
705
+ * @example
706
+ * tryCatch({
707
+ * id: "saga",
708
+ * try: [
709
+ * { id: "create", use: "user-create", inputs: { email: $.req.body.email } },
710
+ * { id: "notify", use: "email-send", inputs: { to: $.state.create.email } },
711
+ * ],
712
+ * catch: [
713
+ * { id: "rollback", use: "user-delete",
714
+ * inputs: { userId: $.state.create.id, reason: $.error.message } },
715
+ * ],
716
+ * finally: [
717
+ * { id: "metric", use: "@blokjs/metrics-emit", inputs: { event: "saga-attempt" } },
718
+ * ],
719
+ * })
720
+ */
721
+ export declare const V2TryCatchStepSchema: z.ZodLazy<z.ZodObject<{
722
+ id: z.ZodString;
723
+ tryCatch: z.ZodObject<{
724
+ try: z.ZodArray<z.ZodUnknown, "many">;
725
+ catch: z.ZodArray<z.ZodUnknown, "many">;
726
+ finally: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
727
+ }, "strip", z.ZodTypeAny, {
728
+ try: unknown[];
729
+ catch: unknown[];
730
+ finally?: unknown[] | undefined;
731
+ }, {
732
+ try: unknown[];
733
+ catch: unknown[];
734
+ finally?: unknown[] | undefined;
735
+ }>;
736
+ active: z.ZodOptional<z.ZodBoolean>;
737
+ stop: z.ZodOptional<z.ZodBoolean>;
738
+ }, "strip", z.ZodTypeAny, {
739
+ id: string;
740
+ tryCatch: {
741
+ try: unknown[];
742
+ catch: unknown[];
743
+ finally?: unknown[] | undefined;
744
+ };
745
+ active?: boolean | undefined;
746
+ stop?: boolean | undefined;
747
+ }, {
748
+ id: string;
749
+ tryCatch: {
750
+ try: unknown[];
751
+ catch: unknown[];
752
+ finally?: unknown[] | undefined;
753
+ };
754
+ active?: boolean | undefined;
755
+ stop?: boolean | undefined;
756
+ }>>;
757
+ export type V2TryCatchStep = z.infer<typeof V2TryCatchStepSchema>;
758
+ /**
759
+ * Discriminated v2 step — regular, branch, sub-workflow, wait, forEach, loop, switch, or tryCatch.
513
760
  *
514
761
  * Discriminators (no `kind` field needed):
515
762
  * - presence of `branch` → branch step
516
763
  * - presence of `subworkflow` → sub-workflow step
517
764
  * - presence of `wait` (object) → wait step
765
+ * - presence of `forEach` → forEach step (v0.5)
766
+ * - presence of `loop` → loop step (v0.5)
767
+ * - presence of `switch` → switch step (v0.5)
768
+ * - presence of `tryCatch` → tryCatch step (v0.5)
518
769
  * - otherwise → regular step
519
770
  */
520
- export declare const V2StepSchema: z.ZodType<V2RegularStep | V2BranchStep | V2SubworkflowStep | V2WaitStep>;
521
- export type V2Step = V2RegularStep | V2BranchStep | V2SubworkflowStep | V2WaitStep;
771
+ export declare const V2StepSchema: z.ZodType<V2RegularStep | V2BranchStep | V2SubworkflowStep | V2WaitStep | V2ForEachStep | V2LoopStep | V2SwitchStep | V2TryCatchStep>;
772
+ export type V2Step = V2RegularStep | V2BranchStep | V2SubworkflowStep | V2WaitStep | V2ForEachStep | V2LoopStep | V2SwitchStep | V2TryCatchStep;
522
773
  /**
523
774
  * Type guard — true when the step is a branch.
524
775
  */
@@ -531,3 +782,19 @@ export declare function isWaitStep(step: V2Step): step is V2WaitStep;
531
782
  * Type guard — true when the step is a sub-workflow invocation.
532
783
  */
533
784
  export declare function isSubworkflowStep(step: V2Step): step is V2SubworkflowStep;
785
+ /**
786
+ * Type guard — true when the step is a forEach iteration (v0.5).
787
+ */
788
+ export declare function isForEachStep(step: V2Step): step is V2ForEachStep;
789
+ /**
790
+ * Type guard — true when the step is a while-loop (v0.5).
791
+ */
792
+ export declare function isLoopStep(step: V2Step): step is V2LoopStep;
793
+ /**
794
+ * Type guard — true when the step is an N-way switch (v0.5).
795
+ */
796
+ export declare function isSwitchStep(step: V2Step): step is V2SwitchStep;
797
+ /**
798
+ * Type guard — true when the step is a tryCatch (v0.5).
799
+ */
800
+ export declare function isTryCatchStep(step: V2Step): step is V2TryCatchStep;