@cascade-flow/runner 0.2.6 → 0.2.8
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/discovery.d.ts.map +1 -1
- package/dist/index.js +48 -4
- package/dist/index.js.map +5 -5
- package/dist/subprocess-executor.d.ts.map +1 -1
- package/dist/types.d.ts +80 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subprocess-executor.d.ts","sourceRoot":"","sources":["../src/subprocess-executor.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAEhE,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACxE,OAAO,EAQL,KAAK,cAAc,EAEnB,KAAK,oBAAoB,EAC1B,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"subprocess-executor.d.ts","sourceRoot":"","sources":["../src/subprocess-executor.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAEhE,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACxE,OAAO,EAQL,KAAK,cAAc,EAEnB,KAAK,oBAAoB,EAC1B,MAAM,qBAAqB,CAAC;AA+I7B,KAAK,iBAAiB,GAAG;IACvB,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB,CAAC;AA2LF;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,uBAAuB,CAC3C,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACrC,GAAG,EAAE,aAAa,EAClB,aAAa,EAAE,MAAM,EACrB,UAAU,EAAE,MAAM,EAClB,KAAK,CAAC,EAAE,CAAC,GAAG,EAAE,QAAQ,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,EAC/C,YAAY,CAAC,EAAE,CAAC,UAAU,EAAE,cAAc,KAAK,OAAO,CAAC,IAAI,CAAC,EAC5D,kBAAkB,CAAC,EAAE,CAAC,UAAU,EAAE,oBAAoB,KAAK,OAAO,CAAC,IAAI,CAAC,EACxE,mBAAmB,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,EAC3C,OAAO,CAAC,EAAE,iBAAiB,GAC1B,OAAO,CAAC;IAAE,MAAM,EAAE,UAAU,CAAC;IAAC,IAAI,EAAE,QAAQ,EAAE,CAAA;CAAE,CAAC,CAwOnD"}
|
package/dist/types.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Shared types for the workflow runner
|
|
3
3
|
*/
|
|
4
4
|
import { z } from "zod";
|
|
5
|
-
import type { StepOutput, BaseStepDefinition, RunnerContext } from "@cascade-flow/workflow";
|
|
5
|
+
import type { StepOutput, BaseStepDefinition, RunnerContext, RetryPolicy } from "@cascade-flow/workflow";
|
|
6
6
|
export type StepModuleExport = {
|
|
7
7
|
step: BaseStepDefinition<Record<string, any>, // other steps' `step` objects
|
|
8
8
|
(args: {
|
|
@@ -24,7 +24,10 @@ export type LoadedStep = {
|
|
|
24
24
|
dir: string;
|
|
25
25
|
fn: StepModuleExport["step"]["fn"];
|
|
26
26
|
exportOutput?: boolean;
|
|
27
|
+
retry?: RetryPolicy[];
|
|
28
|
+
/** @deprecated Use `retry` instead */
|
|
27
29
|
maxRetries?: number;
|
|
30
|
+
/** @deprecated Use `retry` instead */
|
|
28
31
|
retryDelayMs?: number;
|
|
29
32
|
timeoutMs?: number;
|
|
30
33
|
dependencies: Record<string, LoadedStep>;
|
|
@@ -39,6 +42,65 @@ export declare const workflowConfigSchema: z.ZodObject<{
|
|
|
39
42
|
* Workflow configuration type inferred from Zod schema
|
|
40
43
|
*/
|
|
41
44
|
export type WorkflowConfig = z.infer<typeof workflowConfigSchema>;
|
|
45
|
+
/**
|
|
46
|
+
* Backoff configuration validation schema
|
|
47
|
+
*/
|
|
48
|
+
export declare const backoffConfigSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
49
|
+
type: z.ZodLiteral<"constant">;
|
|
50
|
+
delayMs: z.ZodNumber;
|
|
51
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
52
|
+
type: z.ZodLiteral<"exponential">;
|
|
53
|
+
initialDelayMs: z.ZodNumber;
|
|
54
|
+
maxDelayMs: z.ZodNumber;
|
|
55
|
+
multiplier: z.ZodOptional<z.ZodNumber>;
|
|
56
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
57
|
+
type: z.ZodLiteral<"linear">;
|
|
58
|
+
initialDelayMs: z.ZodNumber;
|
|
59
|
+
incrementMs: z.ZodNumber;
|
|
60
|
+
maxDelayMs: z.ZodNumber;
|
|
61
|
+
}, z.core.$strip>], "type">;
|
|
62
|
+
/**
|
|
63
|
+
* Retry policy validation schema
|
|
64
|
+
*/
|
|
65
|
+
export declare const retryPolicySchema: z.ZodObject<{
|
|
66
|
+
maxAttempts: z.ZodNumber;
|
|
67
|
+
backoff: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
68
|
+
type: z.ZodLiteral<"constant">;
|
|
69
|
+
delayMs: z.ZodNumber;
|
|
70
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
71
|
+
type: z.ZodLiteral<"exponential">;
|
|
72
|
+
initialDelayMs: z.ZodNumber;
|
|
73
|
+
maxDelayMs: z.ZodNumber;
|
|
74
|
+
multiplier: z.ZodOptional<z.ZodNumber>;
|
|
75
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
76
|
+
type: z.ZodLiteral<"linear">;
|
|
77
|
+
initialDelayMs: z.ZodNumber;
|
|
78
|
+
incrementMs: z.ZodNumber;
|
|
79
|
+
maxDelayMs: z.ZodNumber;
|
|
80
|
+
}, z.core.$strip>], "type">;
|
|
81
|
+
}, z.core.$strip>;
|
|
82
|
+
/**
|
|
83
|
+
* Retry policies array validation schema
|
|
84
|
+
* - Max 10 policies per step
|
|
85
|
+
* - Total attempts across all policies cannot exceed 100
|
|
86
|
+
*/
|
|
87
|
+
export declare const retryPoliciesSchema: z.ZodArray<z.ZodObject<{
|
|
88
|
+
maxAttempts: z.ZodNumber;
|
|
89
|
+
backoff: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
90
|
+
type: z.ZodLiteral<"constant">;
|
|
91
|
+
delayMs: z.ZodNumber;
|
|
92
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
93
|
+
type: z.ZodLiteral<"exponential">;
|
|
94
|
+
initialDelayMs: z.ZodNumber;
|
|
95
|
+
maxDelayMs: z.ZodNumber;
|
|
96
|
+
multiplier: z.ZodOptional<z.ZodNumber>;
|
|
97
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
98
|
+
type: z.ZodLiteral<"linear">;
|
|
99
|
+
initialDelayMs: z.ZodNumber;
|
|
100
|
+
incrementMs: z.ZodNumber;
|
|
101
|
+
maxDelayMs: z.ZodNumber;
|
|
102
|
+
}, z.core.$strip>], "type">;
|
|
103
|
+
}, z.core.$strip>>;
|
|
42
104
|
/**
|
|
43
105
|
* Step configuration validation schema
|
|
44
106
|
* Validates optional step properties during discovery
|
|
@@ -47,6 +109,23 @@ export declare const stepConfigSchema: z.ZodObject<{
|
|
|
47
109
|
name: z.ZodOptional<z.ZodString>;
|
|
48
110
|
dependencies: z.ZodOptional<z.ZodAny>;
|
|
49
111
|
exportOutput: z.ZodOptional<z.ZodBoolean>;
|
|
112
|
+
retry: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
113
|
+
maxAttempts: z.ZodNumber;
|
|
114
|
+
backoff: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
115
|
+
type: z.ZodLiteral<"constant">;
|
|
116
|
+
delayMs: z.ZodNumber;
|
|
117
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
118
|
+
type: z.ZodLiteral<"exponential">;
|
|
119
|
+
initialDelayMs: z.ZodNumber;
|
|
120
|
+
maxDelayMs: z.ZodNumber;
|
|
121
|
+
multiplier: z.ZodOptional<z.ZodNumber>;
|
|
122
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
123
|
+
type: z.ZodLiteral<"linear">;
|
|
124
|
+
initialDelayMs: z.ZodNumber;
|
|
125
|
+
incrementMs: z.ZodNumber;
|
|
126
|
+
maxDelayMs: z.ZodNumber;
|
|
127
|
+
}, z.core.$strip>], "type">;
|
|
128
|
+
}, z.core.$strip>>>;
|
|
50
129
|
maxRetries: z.ZodOptional<z.ZodNumber>;
|
|
51
130
|
retryDelayMs: z.ZodOptional<z.ZodNumber>;
|
|
52
131
|
timeoutMs: z.ZodOptional<z.ZodNumber>;
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EACV,UAAU,EACV,kBAAkB,EAClB,aAAa,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EACV,UAAU,EACV,kBAAkB,EAClB,aAAa,EAEb,WAAW,EACZ,MAAM,wBAAwB,CAAC;AAEhC,MAAM,MAAM,gBAAgB,GAAG;IAE7B,IAAI,EAAE,kBAAkB,CACtB,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,8BAA8B;IACnD,CAAC,IAAI,EAAE;QACL,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;QACzC,GAAG,EAAE,aAAa,CAAC;KACpB,KAAK,OAAO,CAAC,UAAU,CAAC,GAAG,UAAU,CACvC,CAAC;CACH,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|
|
1
1
|
{
|
|
2
2
|
"name": "@cascade-flow/runner",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.8",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"module": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -22,9 +22,9 @@
|
|
|
22
22
|
"test:coverage": "bun test --coverage"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@cascade-flow/backend-filesystem": "0.2.
|
|
26
|
-
"@cascade-flow/backend-interface": "0.2.
|
|
27
|
-
"@cascade-flow/workflow": "0.
|
|
25
|
+
"@cascade-flow/backend-filesystem": "0.2.8",
|
|
26
|
+
"@cascade-flow/backend-interface": "0.2.6",
|
|
27
|
+
"@cascade-flow/workflow": "0.3.1",
|
|
28
28
|
"zod": "^4.1.12"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|