@hexabot-ai/agentic 3.0.1-alpha.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/LICENSE.md +120 -0
- package/README.md +231 -0
- package/dist/cjs/action/abstract-action.js +141 -0
- package/dist/cjs/action/action.js +47 -0
- package/dist/cjs/action/action.types.js +7 -0
- package/dist/cjs/bindings/base-binding.js +278 -0
- package/dist/cjs/context.js +79 -0
- package/dist/cjs/dsl.types.js +318 -0
- package/dist/cjs/index.js +52 -0
- package/dist/cjs/runner-runtime-control.js +343 -0
- package/dist/cjs/step-executors/conditional-executor.js +63 -0
- package/dist/cjs/step-executors/loop-executor.js +187 -0
- package/dist/cjs/step-executors/parallel-executor.js +51 -0
- package/dist/cjs/step-executors/skip-helpers.js +29 -0
- package/dist/cjs/step-executors/task-executor.js +155 -0
- package/dist/cjs/step-executors/types.js +7 -0
- package/dist/cjs/suspension-rebuilder.js +301 -0
- package/dist/cjs/utils/deferred.js +17 -0
- package/dist/cjs/utils/naming.js +48 -0
- package/dist/cjs/utils/timeout.js +42 -0
- package/dist/cjs/utils/workflow-definition.js +102 -0
- package/dist/cjs/workflow-compiler.js +212 -0
- package/dist/cjs/workflow-event-emitter.js +40 -0
- package/dist/cjs/workflow-runner.js +448 -0
- package/dist/cjs/workflow-types.js +7 -0
- package/dist/cjs/workflow-values.js +99 -0
- package/dist/cjs/workflow.js +243 -0
- package/dist/esm/action/abstract-action.js +137 -0
- package/dist/esm/action/action.js +44 -0
- package/dist/esm/action/action.types.js +6 -0
- package/dist/esm/bindings/base-binding.js +273 -0
- package/dist/esm/context.js +75 -0
- package/dist/esm/dsl.types.js +309 -0
- package/dist/esm/index.js +16 -0
- package/dist/esm/runner-runtime-control.js +338 -0
- package/dist/esm/step-executors/conditional-executor.js +60 -0
- package/dist/esm/step-executors/loop-executor.js +182 -0
- package/dist/esm/step-executors/parallel-executor.js +48 -0
- package/dist/esm/step-executors/skip-helpers.js +25 -0
- package/dist/esm/step-executors/task-executor.js +152 -0
- package/dist/esm/step-executors/types.js +6 -0
- package/dist/esm/suspension-rebuilder.js +296 -0
- package/dist/esm/utils/deferred.js +14 -0
- package/dist/esm/utils/naming.js +42 -0
- package/dist/esm/utils/timeout.js +37 -0
- package/dist/esm/utils/workflow-definition.js +98 -0
- package/dist/esm/workflow-compiler.js +208 -0
- package/dist/esm/workflow-event-emitter.js +36 -0
- package/dist/esm/workflow-runner.js +444 -0
- package/dist/esm/workflow-types.js +6 -0
- package/dist/esm/workflow-values.js +89 -0
- package/dist/esm/workflow.js +236 -0
- package/dist/types/action/abstract-action.d.ts +54 -0
- package/dist/types/action/abstract-action.d.ts.map +1 -0
- package/dist/types/action/action.d.ts +23 -0
- package/dist/types/action/action.d.ts.map +1 -0
- package/dist/types/action/action.types.d.ts +55 -0
- package/dist/types/action/action.types.d.ts.map +1 -0
- package/dist/types/bindings/base-binding.d.ts +52 -0
- package/dist/types/bindings/base-binding.d.ts.map +1 -0
- package/dist/types/context.d.ts +105 -0
- package/dist/types/context.d.ts.map +1 -0
- package/dist/types/dsl.types.d.ts +220 -0
- package/dist/types/dsl.types.d.ts.map +1 -0
- package/dist/types/index.d.ts +18 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/runner-runtime-control.d.ts +64 -0
- package/dist/types/runner-runtime-control.d.ts.map +1 -0
- package/dist/types/step-executors/conditional-executor.d.ts +13 -0
- package/dist/types/step-executors/conditional-executor.d.ts.map +1 -0
- package/dist/types/step-executors/loop-executor.d.ts +33 -0
- package/dist/types/step-executors/loop-executor.d.ts.map +1 -0
- package/dist/types/step-executors/parallel-executor.d.ts +14 -0
- package/dist/types/step-executors/parallel-executor.d.ts.map +1 -0
- package/dist/types/step-executors/skip-helpers.d.ts +12 -0
- package/dist/types/step-executors/skip-helpers.d.ts.map +1 -0
- package/dist/types/step-executors/task-executor.d.ts +13 -0
- package/dist/types/step-executors/task-executor.d.ts.map +1 -0
- package/dist/types/step-executors/types.d.ts +24 -0
- package/dist/types/step-executors/types.d.ts.map +1 -0
- package/dist/types/suspension-rebuilder.d.ts +67 -0
- package/dist/types/suspension-rebuilder.d.ts.map +1 -0
- package/dist/types/utils/deferred.d.ts +7 -0
- package/dist/types/utils/deferred.d.ts.map +1 -0
- package/dist/types/utils/naming.d.ts +24 -0
- package/dist/types/utils/naming.d.ts.map +1 -0
- package/dist/types/utils/timeout.d.ts +17 -0
- package/dist/types/utils/timeout.d.ts.map +1 -0
- package/dist/types/utils/workflow-definition.d.ts +3 -0
- package/dist/types/utils/workflow-definition.d.ts.map +1 -0
- package/dist/types/workflow-compiler.d.ts +12 -0
- package/dist/types/workflow-compiler.d.ts.map +1 -0
- package/dist/types/workflow-event-emitter.d.ts +70 -0
- package/dist/types/workflow-event-emitter.d.ts.map +1 -0
- package/dist/types/workflow-runner.d.ts +179 -0
- package/dist/types/workflow-runner.d.ts.map +1 -0
- package/dist/types/workflow-types.d.ts +195 -0
- package/dist/types/workflow-types.d.ts.map +1 -0
- package/dist/types/workflow-values.d.ts +34 -0
- package/dist/types/workflow-values.d.ts.map +1 -0
- package/dist/types/workflow.d.ts +75 -0
- package/dist/types/workflow.d.ts.map +1 -0
- package/examples/defs-bindings-agent/actions/ai-agent.ts +110 -0
- package/examples/defs-bindings-agent/actions/caculate-score.ts +49 -0
- package/examples/defs-bindings-agent/actions/index.ts +15 -0
- package/examples/defs-bindings-agent/bindings.ts +20 -0
- package/examples/defs-bindings-agent/context.ts +32 -0
- package/examples/defs-bindings-agent/workflow.ts +67 -0
- package/examples/defs-bindings-agent/workflow.yml +28 -0
- package/examples/full/actions/await-user-input.ts +46 -0
- package/examples/full/actions/call-llm.ts +133 -0
- package/examples/full/actions/create-ticket.ts +46 -0
- package/examples/full/actions/decision-router.ts +83 -0
- package/examples/full/actions/get-calendar-events.ts +55 -0
- package/examples/full/actions/get-user-profile.ts +72 -0
- package/examples/full/actions/index.ts +33 -0
- package/examples/full/actions/query-memory.ts +45 -0
- package/examples/full/actions/search-web.ts +53 -0
- package/examples/full/actions/send-email.ts +50 -0
- package/examples/full/context.ts +41 -0
- package/examples/full/workflow.ts +75 -0
- package/examples/full/workflow.yml +359 -0
- package/examples/loop/actions/await-reply.ts +47 -0
- package/examples/loop/actions/index.ts +19 -0
- package/examples/loop/actions/send-text-message.ts +40 -0
- package/examples/loop/context.ts +32 -0
- package/examples/loop/workflow.ts +66 -0
- package/examples/loop/workflow.yml +66 -0
- package/examples/suspend-resume/actions/format-reply.ts +43 -0
- package/examples/suspend-resume/actions/index.ts +13 -0
- package/examples/suspend-resume/actions/wait-for-user.ts +51 -0
- package/examples/suspend-resume/context.ts +32 -0
- package/examples/suspend-resume/workflow.ts +79 -0
- package/examples/suspend-resume/workflow.yml +29 -0
- package/package.json +60 -0
- package/src/__tests__/parser.test.ts +95 -0
- package/src/__tests__/suspension-rebuilder.test.ts +361 -0
- package/src/__tests__/test-helpers.ts +36 -0
- package/src/__tests__/validation.test.ts +526 -0
- package/src/__tests__/workflow-compiler.test.ts +715 -0
- package/src/__tests__/workflow-definition-path.test.ts +381 -0
- package/src/__tests__/workflow-event-emitter.test.ts +50 -0
- package/src/__tests__/workflow-runner.test.ts +1397 -0
- package/src/__tests__/workflow-values.test.ts +132 -0
- package/src/__tests__/workflow.test.ts +320 -0
- package/src/action/__tests__/abstract-action-timing.test.ts +183 -0
- package/src/action/__tests__/action.test.ts +473 -0
- package/src/action/abstract-action.ts +215 -0
- package/src/action/action.ts +83 -0
- package/src/action/action.types.ts +93 -0
- package/src/bindings/base-binding.ts +508 -0
- package/src/context.ts +179 -0
- package/src/dsl.types.ts +473 -0
- package/src/index.ts +114 -0
- package/src/runner-runtime-control.ts +544 -0
- package/src/step-executors/conditional-executor.test.ts +192 -0
- package/src/step-executors/conditional-executor.ts +83 -0
- package/src/step-executors/loop-executor.test.ts +303 -0
- package/src/step-executors/loop-executor.ts +299 -0
- package/src/step-executors/parallel-executor.test.ts +182 -0
- package/src/step-executors/parallel-executor.ts +77 -0
- package/src/step-executors/skip-helpers.ts +68 -0
- package/src/step-executors/task-executor.test.ts +257 -0
- package/src/step-executors/task-executor.ts +248 -0
- package/src/step-executors/types.ts +70 -0
- package/src/suspension-rebuilder.ts +504 -0
- package/src/utils/deferred.ts +23 -0
- package/src/utils/naming.ts +55 -0
- package/src/utils/timeout.ts +48 -0
- package/src/utils/workflow-definition.ts +173 -0
- package/src/workflow-compiler.ts +317 -0
- package/src/workflow-event-emitter.ts +86 -0
- package/src/workflow-runner.ts +603 -0
- package/src/workflow-types.ts +207 -0
- package/src/workflow-values.ts +159 -0
- package/src/workflow.ts +387 -0
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { BindingKindSchemas } from './bindings/base-binding';
|
|
3
|
+
export declare const ExpressionStringSchema: z.ZodString;
|
|
4
|
+
export type JsonValue = string | number | boolean | null | JsonValue[] | {
|
|
5
|
+
[key: string]: JsonValue;
|
|
6
|
+
};
|
|
7
|
+
export declare const DEFAULT_TIMEOUT_MS = 0;
|
|
8
|
+
export declare const DEFAULT_RETRY_SETTINGS: {
|
|
9
|
+
readonly enabled: false;
|
|
10
|
+
readonly max_attempts: 3;
|
|
11
|
+
readonly backoff_ms: 25;
|
|
12
|
+
readonly max_delay_ms: 10000;
|
|
13
|
+
readonly jitter: 0;
|
|
14
|
+
readonly multiplier: 1;
|
|
15
|
+
};
|
|
16
|
+
export type InputField = {
|
|
17
|
+
type: 'string' | 'number' | 'integer' | 'boolean' | 'array' | 'object';
|
|
18
|
+
description?: string;
|
|
19
|
+
enum?: Array<string | number | boolean>;
|
|
20
|
+
items?: InputField;
|
|
21
|
+
properties?: Record<string, InputField>;
|
|
22
|
+
};
|
|
23
|
+
export type ConditionalBranch = {
|
|
24
|
+
condition: string;
|
|
25
|
+
steps: FlowStep[];
|
|
26
|
+
} | {
|
|
27
|
+
else?: unknown;
|
|
28
|
+
steps: FlowStep[];
|
|
29
|
+
};
|
|
30
|
+
export type ConditionalBlock = {
|
|
31
|
+
description?: string;
|
|
32
|
+
when: ConditionalBranch[];
|
|
33
|
+
};
|
|
34
|
+
export type ParallelBlock = {
|
|
35
|
+
description?: string;
|
|
36
|
+
strategy?: 'wait_all' | 'wait_any';
|
|
37
|
+
steps: FlowStep[];
|
|
38
|
+
};
|
|
39
|
+
export type LoopAccumulate = {
|
|
40
|
+
as: string;
|
|
41
|
+
initial: JsonValue;
|
|
42
|
+
merge: string;
|
|
43
|
+
};
|
|
44
|
+
type BaseLoopStep = {
|
|
45
|
+
name?: string;
|
|
46
|
+
description?: string;
|
|
47
|
+
accumulate?: LoopAccumulate;
|
|
48
|
+
steps: FlowStep[];
|
|
49
|
+
};
|
|
50
|
+
export type ForEachLoopStep = BaseLoopStep & {
|
|
51
|
+
type: 'for_each';
|
|
52
|
+
for_each: {
|
|
53
|
+
item: string;
|
|
54
|
+
in: string;
|
|
55
|
+
};
|
|
56
|
+
max_concurrency?: number;
|
|
57
|
+
until?: string;
|
|
58
|
+
};
|
|
59
|
+
export type WhileLoopStep = BaseLoopStep & {
|
|
60
|
+
type: 'while';
|
|
61
|
+
while: string;
|
|
62
|
+
};
|
|
63
|
+
export type LoopStep = ForEachLoopStep | WhileLoopStep;
|
|
64
|
+
export type FlowStep = {
|
|
65
|
+
do: string;
|
|
66
|
+
} | {
|
|
67
|
+
parallel: ParallelBlock;
|
|
68
|
+
} | {
|
|
69
|
+
conditional: ConditionalBlock;
|
|
70
|
+
} | {
|
|
71
|
+
loop: LoopStep;
|
|
72
|
+
};
|
|
73
|
+
export declare const JsonValueSchema: z.ZodType<JsonValue>;
|
|
74
|
+
export declare const BaseSettingsSchema: z.ZodObject<{
|
|
75
|
+
timeout_ms: z.ZodOptional<z.ZodInt>;
|
|
76
|
+
retries: z.ZodOptional<z.ZodObject<{
|
|
77
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
78
|
+
max_attempts: z.ZodDefault<z.ZodInt>;
|
|
79
|
+
backoff_ms: z.ZodDefault<z.ZodInt>;
|
|
80
|
+
max_delay_ms: z.ZodDefault<z.ZodInt>;
|
|
81
|
+
jitter: z.ZodDefault<z.ZodNumber>;
|
|
82
|
+
multiplier: z.ZodDefault<z.ZodNumber>;
|
|
83
|
+
}, z.core.$strict>>;
|
|
84
|
+
}, z.core.$strict>;
|
|
85
|
+
export declare const SettingsSchema: z.ZodObject<{
|
|
86
|
+
timeout_ms: z.ZodOptional<z.ZodInt>;
|
|
87
|
+
retries: z.ZodOptional<z.ZodObject<{
|
|
88
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
89
|
+
max_attempts: z.ZodDefault<z.ZodInt>;
|
|
90
|
+
backoff_ms: z.ZodDefault<z.ZodInt>;
|
|
91
|
+
max_delay_ms: z.ZodDefault<z.ZodInt>;
|
|
92
|
+
jitter: z.ZodDefault<z.ZodNumber>;
|
|
93
|
+
multiplier: z.ZodDefault<z.ZodNumber>;
|
|
94
|
+
}, z.core.$strict>>;
|
|
95
|
+
}, z.core.$catchall<z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
|
|
96
|
+
export declare const TASK_KIND: "task";
|
|
97
|
+
export declare const TaskDefinitionSchema: z.ZodObject<{
|
|
98
|
+
kind: z.ZodLiteral<"task">;
|
|
99
|
+
description: z.ZodOptional<z.ZodString>;
|
|
100
|
+
action: z.ZodString;
|
|
101
|
+
inputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
|
|
102
|
+
bindings: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>>;
|
|
103
|
+
settings: z.ZodOptional<z.ZodObject<{
|
|
104
|
+
timeout_ms: z.ZodOptional<z.ZodInt>;
|
|
105
|
+
retries: z.ZodOptional<z.ZodObject<{
|
|
106
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
107
|
+
max_attempts: z.ZodDefault<z.ZodInt>;
|
|
108
|
+
backoff_ms: z.ZodDefault<z.ZodInt>;
|
|
109
|
+
max_delay_ms: z.ZodDefault<z.ZodInt>;
|
|
110
|
+
jitter: z.ZodDefault<z.ZodNumber>;
|
|
111
|
+
multiplier: z.ZodDefault<z.ZodNumber>;
|
|
112
|
+
}, z.core.$strict>>;
|
|
113
|
+
}, z.core.$catchall<z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>>;
|
|
114
|
+
}, z.core.$strict>;
|
|
115
|
+
export declare const DefDefinitionSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
116
|
+
kind: z.ZodLiteral<"task">;
|
|
117
|
+
description: z.ZodOptional<z.ZodString>;
|
|
118
|
+
action: z.ZodString;
|
|
119
|
+
inputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
|
|
120
|
+
bindings: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>>;
|
|
121
|
+
settings: z.ZodOptional<z.ZodObject<{
|
|
122
|
+
timeout_ms: z.ZodOptional<z.ZodInt>;
|
|
123
|
+
retries: z.ZodOptional<z.ZodObject<{
|
|
124
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
125
|
+
max_attempts: z.ZodDefault<z.ZodInt>;
|
|
126
|
+
backoff_ms: z.ZodDefault<z.ZodInt>;
|
|
127
|
+
max_delay_ms: z.ZodDefault<z.ZodInt>;
|
|
128
|
+
jitter: z.ZodDefault<z.ZodNumber>;
|
|
129
|
+
multiplier: z.ZodDefault<z.ZodNumber>;
|
|
130
|
+
}, z.core.$strict>>;
|
|
131
|
+
}, z.core.$catchall<z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>>;
|
|
132
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
133
|
+
kind: z.ZodString;
|
|
134
|
+
description: z.ZodOptional<z.ZodString>;
|
|
135
|
+
action: z.ZodOptional<z.ZodString>;
|
|
136
|
+
settings: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
137
|
+
bindings: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>>;
|
|
138
|
+
}, z.core.$strict>]>;
|
|
139
|
+
declare const ConditionalSchema: z.ZodType<{
|
|
140
|
+
description?: string;
|
|
141
|
+
when: ConditionalBranch[];
|
|
142
|
+
}>;
|
|
143
|
+
export declare const FlowStepSchema: z.ZodType<FlowStep>;
|
|
144
|
+
export declare const WorkflowMetadataSchema: z.ZodObject<{
|
|
145
|
+
name: z.ZodString;
|
|
146
|
+
version: z.ZodString;
|
|
147
|
+
description: z.ZodOptional<z.ZodString>;
|
|
148
|
+
}, z.core.$strict>;
|
|
149
|
+
export declare const WorkflowDefinitionSchema: z.ZodObject<{
|
|
150
|
+
inputs: z.ZodOptional<z.ZodObject<{
|
|
151
|
+
schema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<InputField, unknown, z.core.$ZodTypeInternals<InputField, unknown>>>>;
|
|
152
|
+
}, z.core.$strict>>;
|
|
153
|
+
context: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
|
|
154
|
+
defaults: z.ZodOptional<z.ZodObject<{
|
|
155
|
+
settings: z.ZodOptional<z.ZodObject<{
|
|
156
|
+
timeout_ms: z.ZodOptional<z.ZodInt>;
|
|
157
|
+
retries: z.ZodOptional<z.ZodObject<{
|
|
158
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
159
|
+
max_attempts: z.ZodDefault<z.ZodInt>;
|
|
160
|
+
backoff_ms: z.ZodDefault<z.ZodInt>;
|
|
161
|
+
max_delay_ms: z.ZodDefault<z.ZodInt>;
|
|
162
|
+
jitter: z.ZodDefault<z.ZodNumber>;
|
|
163
|
+
multiplier: z.ZodDefault<z.ZodNumber>;
|
|
164
|
+
}, z.core.$strict>>;
|
|
165
|
+
}, z.core.$catchall<z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>>;
|
|
166
|
+
}, z.core.$strict>>;
|
|
167
|
+
defs: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
|
|
168
|
+
kind: z.ZodLiteral<"task">;
|
|
169
|
+
description: z.ZodOptional<z.ZodString>;
|
|
170
|
+
action: z.ZodString;
|
|
171
|
+
inputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
|
|
172
|
+
bindings: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>>;
|
|
173
|
+
settings: z.ZodOptional<z.ZodObject<{
|
|
174
|
+
timeout_ms: z.ZodOptional<z.ZodInt>;
|
|
175
|
+
retries: z.ZodOptional<z.ZodObject<{
|
|
176
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
177
|
+
max_attempts: z.ZodDefault<z.ZodInt>;
|
|
178
|
+
backoff_ms: z.ZodDefault<z.ZodInt>;
|
|
179
|
+
max_delay_ms: z.ZodDefault<z.ZodInt>;
|
|
180
|
+
jitter: z.ZodDefault<z.ZodNumber>;
|
|
181
|
+
multiplier: z.ZodDefault<z.ZodNumber>;
|
|
182
|
+
}, z.core.$strict>>;
|
|
183
|
+
}, z.core.$catchall<z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>>;
|
|
184
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
185
|
+
kind: z.ZodString;
|
|
186
|
+
description: z.ZodOptional<z.ZodString>;
|
|
187
|
+
action: z.ZodOptional<z.ZodString>;
|
|
188
|
+
settings: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
189
|
+
bindings: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>>;
|
|
190
|
+
}, z.core.$strict>]>>;
|
|
191
|
+
flow: z.ZodArray<z.ZodType<FlowStep, unknown, z.core.$ZodTypeInternals<FlowStep, unknown>>>;
|
|
192
|
+
outputs: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
193
|
+
}, z.core.$strict>;
|
|
194
|
+
export type Settings = z.infer<typeof SettingsSchema>;
|
|
195
|
+
export type Conditional = z.infer<typeof ConditionalSchema>;
|
|
196
|
+
export type TaskDefinition = z.infer<typeof TaskDefinitionSchema>;
|
|
197
|
+
export type DefDefinition = z.infer<typeof DefDefinitionSchema>;
|
|
198
|
+
export type DefDefinitions = z.infer<typeof WorkflowDefinitionSchema>['defs'];
|
|
199
|
+
export type TaskDefinitions = Record<string, TaskDefinition>;
|
|
200
|
+
export type WorkflowMetadata = z.infer<typeof WorkflowMetadataSchema>;
|
|
201
|
+
export type WorkflowDefinition = z.infer<typeof WorkflowDefinitionSchema>;
|
|
202
|
+
export type WorkflowValidationActionMetadata = {
|
|
203
|
+
supportedBindings?: readonly string[];
|
|
204
|
+
};
|
|
205
|
+
export type ValidateWorkflowOptions = {
|
|
206
|
+
bindingKinds?: BindingKindSchemas;
|
|
207
|
+
actions?: Record<string, WorkflowValidationActionMetadata>;
|
|
208
|
+
};
|
|
209
|
+
export type WorkflowValidationResult = {
|
|
210
|
+
success: true;
|
|
211
|
+
data: WorkflowDefinition;
|
|
212
|
+
} | {
|
|
213
|
+
success: false;
|
|
214
|
+
errors: string[];
|
|
215
|
+
};
|
|
216
|
+
export declare const isTaskDefinition: (definition: DefDefinition) => definition is TaskDefinition;
|
|
217
|
+
export declare const extractTaskDefinitions: (defs: DefDefinitions) => TaskDefinitions;
|
|
218
|
+
export declare function validateWorkflow(input: string | unknown, options?: ValidateWorkflowOptions): WorkflowValidationResult;
|
|
219
|
+
export {};
|
|
220
|
+
//# sourceMappingURL=dsl.types.d.ts.map
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C,EAAE,SAAS,MAAM,EAAE,CAAC;CACvC,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG;IACpC,YAAY,CAAC,EAAE,kBAAkB,CAAC;IAClC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,gCAAgC,CAAC,CAAC;CAC5D,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAChC;IAAE,OAAO,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,kBAAkB,CAAA;CAAE,GAC3C;IAAE,OAAO,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC;AAmCzC,eAAO,MAAM,gBAAgB,GAC3B,YAAY,aAAa,KACxB,UAAU,IAAI,cAA+C,CAAC;AAEjE,eAAO,MAAM,sBAAsB,GAAI,MAAM,cAAc,KAAG,eAOtD,CAAC;AAST,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,MAAM,GAAG,OAAO,EACvB,OAAO,CAAC,EAAE,uBAAuB,GAChC,wBAAwB,CAkD1B"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export { AbstractAction } from './action/abstract-action';
|
|
2
|
+
export { defineAction } from './action/action';
|
|
3
|
+
export type { DefineActionParams } from './action/action';
|
|
4
|
+
export type { Action, ActionExecutionArgs, ActionExecutionOutcome, ActionMetadata, Actions, InferActionArgs, InferActionBindings, InferActionContext, InferActionInput, InferActionOutput, InferActionSettings, SuspensionNotice, } from './action/action.types';
|
|
5
|
+
export { BaseWorkflowContext, type ActionSnapshot, type ActionStatus, type StepExecutionRecord, type SuspensionOptions, type WorkflowRunStatus, type WorkflowRuntimeControl, type WorkflowSnapshot, } from './context';
|
|
6
|
+
export * from './dsl.types';
|
|
7
|
+
export type { BindingKindDescriptor, BindingKindSchemas, InferMountedBindingValue, InferWorkflowBindings, } from './bindings/base-binding';
|
|
8
|
+
export { compileWorkflow, Workflow as Workflow, WorkflowEventEmitter, WorkflowRunner, type FlowStepPath, type WorkflowCompileOptions, type WorkflowResumeResult, type WorkflowRunOptions, type WorkflowStartResult, } from './workflow';
|
|
9
|
+
export { StepType } from './workflow-event-emitter';
|
|
10
|
+
export type { StepInfo, WorkflowEventEmitterLike, WorkflowEventMap, } from './workflow-event-emitter';
|
|
11
|
+
export type { BaseStep as CompiledBaseStep, ConditionalBranch as CompiledConditionalBranch, ConditionalStep as CompiledConditionalStep, LoopStep as CompiledLoopStep, CompiledMapping, ParallelStep as CompiledParallelStep, CompiledStep, CompiledTask, CompiledTaskBindings, TaskStep as CompiledTaskStep, CompiledValue, CompiledWorkflow, EvaluationScope, ExecutionState, PersistedSuspension, RunnerResumeArgs, RunnerStartArgs, Suspension, ResumeResult as WorkflowResumeOutcome, StartResult as WorkflowStartOutcome, } from './workflow-types';
|
|
12
|
+
export { NonDeterministicWorkflowError } from './runner-runtime-control';
|
|
13
|
+
export { compileValue, evaluateMapping, evaluateValue, mergeSettings, type CompileValueOptions, type JsonataFunctionConfig, type JsonataFunctionImplementation, type JsonataFunctionRegistry, } from './workflow-values';
|
|
14
|
+
export { createDeferred } from './utils/deferred';
|
|
15
|
+
export type { Deferred } from './utils/deferred';
|
|
16
|
+
export { assertSnakeCaseName, isSnakeCaseName, toSnakeCase, } from './utils/naming';
|
|
17
|
+
export { sleep, withTimeout } from './utils/timeout';
|
|
18
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE1D,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,YAAY,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAE1D,YAAY,EACV,MAAM,EACN,mBAAmB,EACnB,sBAAsB,EACtB,cAAc,EACd,OAAO,EACP,eAAe,EACf,mBAAmB,EACnB,kBAAkB,EAClB,gBAAgB,EAChB,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KAAK,mBAAmB,EACxB,KAAK,qBAAqB,EAC1B,KAAK,6BAA6B,EAClC,KAAK,uBAAuB,GAC7B,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,YAAY,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEjD,OAAO,EACL,mBAAmB,EACnB,eAAe,EACf,WAAW,GACZ,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { SuspensionOptions, WorkflowRunStatus, WorkflowRuntimeControl } from './context';
|
|
2
|
+
import type { Deferred } from './utils/deferred';
|
|
3
|
+
import type { WorkflowRunner } from './workflow-runner';
|
|
4
|
+
export type RuntimeSuspensionRequest = {
|
|
5
|
+
stepId: string;
|
|
6
|
+
stepExecId: string;
|
|
7
|
+
suspendIndex: number;
|
|
8
|
+
suspendKey: string;
|
|
9
|
+
reason?: string;
|
|
10
|
+
data?: unknown;
|
|
11
|
+
awaitResults: Record<string, unknown>;
|
|
12
|
+
resume: Deferred<unknown>;
|
|
13
|
+
};
|
|
14
|
+
export type RuntimeStepReplaySeed = {
|
|
15
|
+
stepId: string;
|
|
16
|
+
stepExecId: string;
|
|
17
|
+
awaitResults?: Record<string, unknown>;
|
|
18
|
+
activeSuspension?: {
|
|
19
|
+
suspendIndex?: number;
|
|
20
|
+
suspendKey?: string;
|
|
21
|
+
reason?: string;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
export type RuntimeResolvedSuspension = {
|
|
25
|
+
stepId: string;
|
|
26
|
+
resumeData: unknown;
|
|
27
|
+
stepExecId?: string;
|
|
28
|
+
suspendIndex?: number;
|
|
29
|
+
suspendKey?: string;
|
|
30
|
+
};
|
|
31
|
+
export declare class NonDeterministicWorkflowError extends Error {
|
|
32
|
+
constructor(message: string);
|
|
33
|
+
}
|
|
34
|
+
/** Minimal wrapper that exposes runner controls to actions via the context. */
|
|
35
|
+
export declare class RunnerRuntimeControl implements WorkflowRuntimeControl {
|
|
36
|
+
private readonly runner;
|
|
37
|
+
private readonly pendingSuspensions;
|
|
38
|
+
private readonly suspensionWaiters;
|
|
39
|
+
private readonly primedResumeData;
|
|
40
|
+
private readonly stepAttempts;
|
|
41
|
+
private readonly activeStepExecutions;
|
|
42
|
+
private readonly replaySeeds;
|
|
43
|
+
constructor(runner: WorkflowRunner);
|
|
44
|
+
get status(): WorkflowRunStatus;
|
|
45
|
+
get resumeData(): unknown;
|
|
46
|
+
suspend<T = unknown>(options?: SuspensionOptions): Promise<T>;
|
|
47
|
+
resume(data?: unknown): void;
|
|
48
|
+
waitForStepSuspension(stepId: string): Promise<RuntimeSuspensionRequest>;
|
|
49
|
+
beginStepExecution(stepId: string): string;
|
|
50
|
+
prepareStepReplay(seed: RuntimeStepReplaySeed): void;
|
|
51
|
+
recordStepSuspendResult(params: RuntimeResolvedSuspension): void;
|
|
52
|
+
clearStepSuspensions(stepId: string, error?: unknown): void;
|
|
53
|
+
primeStepResumeData(stepId: string, resumeData: unknown): void;
|
|
54
|
+
getSnapshot(): import("./context").WorkflowSnapshot;
|
|
55
|
+
private enqueueSuspension;
|
|
56
|
+
private dequeueStepSuspension;
|
|
57
|
+
private dequeuePrimedResumeData;
|
|
58
|
+
private ensureStepExecution;
|
|
59
|
+
private assertReplayExpectation;
|
|
60
|
+
private normalizeAwaitResults;
|
|
61
|
+
private serializeAwaitResults;
|
|
62
|
+
private bumpStepAttemptCounter;
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=runner-runtime-control.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runner-runtime-control.d.ts","sourceRoot":"","sources":["../../src/runner-runtime-control.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,iBAAiB,EACjB,iBAAiB,EACjB,sBAAsB,EACvB,MAAM,WAAW,CAAC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
|
|
4
|
+
* Evaluate a conditional step by checking branches in order and executing the first match.
|
|
5
|
+
*
|
|
6
|
+
* @param env Executor environment providing helpers and workflow context.
|
|
7
|
+
* @param step The conditional step definition.
|
|
8
|
+
* @param state Mutable workflow execution state.
|
|
9
|
+
* @param path Path tokens locating this step within the workflow tree.
|
|
10
|
+
* @returns A suspension if a branch pauses execution, otherwise void.
|
|
11
|
+
*/
|
|
12
|
+
export declare function executeConditional(env: StepExecutorEnv, step: ConditionalStep, state: ExecutionState, path: Array<number | string>): Promise<Suspension | void>;
|
|
13
|
+
//# sourceMappingURL=conditional-executor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conditional-executor.d.ts","sourceRoot":"","sources":["../../../src/step-executors/conditional-executor.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,eAAe,EACf,cAAc,EACd,UAAU,EACX,MAAM,mBAAmB,CAAC;AAI3B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C;;;;;;;;GAQG;AACH,wBAAsB,kBAAkB,CACtC,GAAG,EAAE,eAAe,EACpB,IAAI,EAAE,eAAe,EACrB,KAAK,EAAE,cAAc,EACrB,IAAI,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,GAC3B,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CAoD5B"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { EvaluationScope, ExecutionState, LoopStep, Suspension } from '../workflow-types';
|
|
2
|
+
import type { StepExecutorEnv } from './types';
|
|
3
|
+
type LoopScope = EvaluationScope;
|
|
4
|
+
/**
|
|
5
|
+
* Execute a loop step by iterating over input items and executing child steps.
|
|
6
|
+
*
|
|
7
|
+
* @param env Executor environment with helpers and workflow context.
|
|
8
|
+
* @param step The loop step configuration.
|
|
9
|
+
* @param state Mutable workflow execution state.
|
|
10
|
+
* @param path Path tokens locating this loop within the workflow.
|
|
11
|
+
* @param startIndex Index to resume iteration from when continuing.
|
|
12
|
+
* @returns A suspension if a child step pauses execution, otherwise void.
|
|
13
|
+
*/
|
|
14
|
+
export declare function executeLoop(env: StepExecutorEnv, step: LoopStep, state: ExecutionState, path: Array<number | string>, startIndex?: number): Promise<Suspension | void>;
|
|
15
|
+
/**
|
|
16
|
+
* Update the loop accumulator using the configured merge expression.
|
|
17
|
+
*
|
|
18
|
+
* @param step The loop step containing accumulation settings.
|
|
19
|
+
* @param scope Current evaluation scope for expressions.
|
|
20
|
+
* @param previous Previous accumulator value to merge with.
|
|
21
|
+
* @returns The updated accumulator value.
|
|
22
|
+
*/
|
|
23
|
+
export declare function updateAccumulator(step: LoopStep, scope: LoopScope, previous: unknown): Promise<unknown>;
|
|
24
|
+
/**
|
|
25
|
+
* Determine whether loop execution should stop based on the `until` condition.
|
|
26
|
+
*
|
|
27
|
+
* @param step The loop step configuration.
|
|
28
|
+
* @param scope Current evaluation scope for expressions.
|
|
29
|
+
* @returns True if the loop should stop, otherwise false.
|
|
30
|
+
*/
|
|
31
|
+
export declare function shouldStopLoop(step: LoopStep, scope: LoopScope): Promise<boolean>;
|
|
32
|
+
export {};
|
|
33
|
+
//# sourceMappingURL=loop-executor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loop-executor.d.ts","sourceRoot":"","sources":["../../../src/step-executors/loop-executor.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,eAAe,EACf,cAAc,EAEd,QAAQ,EACR,UAAU,EAEX,MAAM,mBAAmB,CAAC;AAG3B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C,KAAK,SAAS,GAAG,eAAe,CAAC;AAEjC;;;;;;;;;GASG;AACH,wBAAsB,WAAW,CAC/B,GAAG,EAAE,eAAe,EACpB,IAAI,EAAE,QAAQ,EACd,KAAK,EAAE,cAAc,EACrB,IAAI,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,EAC5B,UAAU,SAAI,GACb,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CAM5B;AA+LD;;;;;;;GAOG;AACH,wBAAsB,iBAAiB,CACrC,IAAI,EAAE,QAAQ,EACd,KAAK,EAAE,SAAS,EAChB,QAAQ,EAAE,OAAO,GAChB,OAAO,CAAC,OAAO,CAAC,CASlB;AAED;;;;;;GAMG;AACH,wBAAsB,cAAc,CAClC,IAAI,EAAE,QAAQ,EACd,KAAK,EAAE,SAAS,GACf,OAAO,CAAC,OAAO,CAAC,CAQlB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ExecutionState, ParallelStep, Suspension } from '../workflow-types';
|
|
2
|
+
import type { StepExecutorEnv } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Execute a set of steps in parallel order, respecting the configured strategy.
|
|
5
|
+
*
|
|
6
|
+
* @param env Executor environment providing helpers and workflow context.
|
|
7
|
+
* @param step The parallel step definition including strategy and children.
|
|
8
|
+
* @param state Mutable workflow execution state.
|
|
9
|
+
* @param path Path tokens locating this parallel block in the workflow.
|
|
10
|
+
* @param startIndex Index to resume execution from when continuing.
|
|
11
|
+
* @returns A suspension if a child pauses execution, otherwise void.
|
|
12
|
+
*/
|
|
13
|
+
export declare function executeParallel(env: StepExecutorEnv, step: ParallelStep, state: ExecutionState, path: Array<number | string>, startIndex?: number): Promise<Suspension | void>;
|
|
14
|
+
//# sourceMappingURL=parallel-executor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parallel-executor.d.ts","sourceRoot":"","sources":["../../../src/step-executors/parallel-executor.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,cAAc,EACd,YAAY,EACZ,UAAU,EACX,MAAM,mBAAmB,CAAC;AAG3B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C;;;;;;;;;GASG;AACH,wBAAsB,eAAe,CACnC,GAAG,EAAE,eAAe,EACpB,IAAI,EAAE,YAAY,EAClB,KAAK,EAAE,cAAc,EACrB,IAAI,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,EAC5B,UAAU,SAAI,GACb,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CA6C5B"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ActionSnapshot } from '../context';
|
|
2
|
+
import { type StepInfo, type WorkflowEventMap } from '../workflow-event-emitter';
|
|
3
|
+
import type { CompiledStep } from '../workflow-types';
|
|
4
|
+
type SkipStepEnv = {
|
|
5
|
+
runId?: string;
|
|
6
|
+
buildInstanceStepInfo: (step: CompiledStep, iterationStack: number[]) => StepInfo;
|
|
7
|
+
markSnapshot: (step: StepInfo, status: ActionSnapshot['status'], reason?: string) => void;
|
|
8
|
+
emit: <K extends keyof WorkflowEventMap>(event: K, payload: WorkflowEventMap[K]) => void;
|
|
9
|
+
};
|
|
10
|
+
export declare const markStepsSkipped: (env: SkipStepEnv, steps: CompiledStep[], iterationStack: number[], reason?: string) => void;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=skip-helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skip-helpers.d.ts","sourceRoot":"","sources":["../../../src/step-executors/skip-helpers.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAEL,KAAK,QAAQ,EACb,KAAK,gBAAgB,EACtB,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD,KAAK,WAAW,GAAG;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,qBAAqB,EAAE,CACrB,IAAI,EAAE,YAAY,EAClB,cAAc,EAAE,MAAM,EAAE,KACrB,QAAQ,CAAC;IACd,YAAY,EAAE,CACZ,IAAI,EAAE,QAAQ,EACd,MAAM,EAAE,cAAc,CAAC,QAAQ,CAAC,EAChC,MAAM,CAAC,EAAE,MAAM,KACZ,IAAI,CAAC;IACV,IAAI,EAAE,CAAC,CAAC,SAAS,MAAM,gBAAgB,EACrC,KAAK,EAAE,CAAC,EACR,OAAO,EAAE,gBAAgB,CAAC,CAAC,CAAC,KACzB,IAAI,CAAC;CACX,CAAC;AA+BF,eAAO,MAAM,gBAAgB,GAC3B,KAAK,WAAW,EAChB,OAAO,YAAY,EAAE,EACrB,gBAAgB,MAAM,EAAE,EACxB,SAAS,MAAM,SAGhB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ExecutionState, Suspension, TaskStep } from '../workflow-types';
|
|
2
|
+
import type { StepExecutorEnv } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Execute a task step by running its task and handling suspension or output mapping.
|
|
5
|
+
*
|
|
6
|
+
* @param env Executor environment with compiled workflow and helpers.
|
|
7
|
+
* @param step The compiled task step to execute.
|
|
8
|
+
* @param state Mutable workflow execution state.
|
|
9
|
+
* @param _path Location of the step within the workflow (unused in this executor).
|
|
10
|
+
* @returns A suspension if the task pauses execution, otherwise void.
|
|
11
|
+
*/
|
|
12
|
+
export declare function executeTaskStep(env: StepExecutorEnv, step: TaskStep, state: ExecutionState, _path: Array<number | string>): Promise<Suspension | void>;
|
|
13
|
+
//# sourceMappingURL=task-executor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task-executor.d.ts","sourceRoot":"","sources":["../../../src/step-executors/task-executor.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAGV,cAAc,EACd,UAAU,EACV,QAAQ,EACT,MAAM,mBAAmB,CAAC;AAG3B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAO/C;;;;;;;;GAQG;AACH,wBAAsB,eAAe,CACnC,GAAG,EAAE,eAAe,EACpB,IAAI,EAAE,QAAQ,EACd,KAAK,EAAE,cAAc,EACrB,KAAK,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,GAC5B,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CAiE5B"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { ActionSnapshot, BaseWorkflowContext, StepExecutionRecord } from '../context';
|
|
2
|
+
import type { RuntimeResolvedSuspension, RuntimeStepReplaySeed, RuntimeSuspensionRequest } from '../runner-runtime-control';
|
|
3
|
+
import type { StepInfo, WorkflowEventMap } from '../workflow-event-emitter';
|
|
4
|
+
import type { CompiledStep, CompiledTask, CompiledWorkflow, ExecutionState, Suspension } from '../workflow-types';
|
|
5
|
+
export type StepExecutorEnv = {
|
|
6
|
+
compiled: CompiledWorkflow;
|
|
7
|
+
context: BaseWorkflowContext;
|
|
8
|
+
runId?: string;
|
|
9
|
+
buildInstanceStepInfo: (step: CompiledStep, iterationStack: number[]) => StepInfo;
|
|
10
|
+
markSnapshot: (step: StepInfo, status: ActionSnapshot['status'], reason?: string) => void;
|
|
11
|
+
recordStepExecution: (step: StepInfo, update: Partial<StepExecutionRecord>) => void;
|
|
12
|
+
emit: <K extends keyof WorkflowEventMap>(event: K, payload: WorkflowEventMap[K]) => void;
|
|
13
|
+
setCurrentStep: (step?: StepInfo) => void;
|
|
14
|
+
beginStepExecution?: (stepId: string) => string;
|
|
15
|
+
waitForStepSuspension: (stepId: string) => Promise<RuntimeSuspensionRequest>;
|
|
16
|
+
clearStepSuspensions: (stepId: string, error?: unknown) => void;
|
|
17
|
+
primeStepResumeData: (stepId: string, resumeData: unknown) => void;
|
|
18
|
+
prepareStepReplay?: (seed: RuntimeStepReplaySeed) => void;
|
|
19
|
+
recordStepSuspendResult?: (params: RuntimeResolvedSuspension) => void;
|
|
20
|
+
captureTaskOutput: (task: CompiledTask, state: ExecutionState, result: unknown) => Promise<void>;
|
|
21
|
+
executeFlow: (steps: CompiledStep[], state: ExecutionState, path: Array<number | string>, startIndex?: number) => Promise<Suspension | void>;
|
|
22
|
+
executeStep: (step: CompiledStep, state: ExecutionState, path: Array<number | string>) => Promise<Suspension | void>;
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/step-executors/types.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,cAAc,EACd,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EACV,yBAAyB,EACzB,qBAAqB,EACrB,wBAAwB,EACzB,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC5E,OAAO,KAAK,EACV,YAAY,EACZ,YAAY,EACZ,gBAAgB,EAChB,cAAc,EACd,UAAU,EACX,MAAM,mBAAmB,CAAC;AAE3B,MAAM,MAAM,eAAe,GAAG;IAC5B,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,OAAO,EAAE,mBAAmB,CAAC;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,qBAAqB,EAAE,CACrB,IAAI,EAAE,YAAY,EAClB,cAAc,EAAE,MAAM,EAAE,KACrB,QAAQ,CAAC;IACd,YAAY,EAAE,CACZ,IAAI,EAAE,QAAQ,EACd,MAAM,EAAE,cAAc,CAAC,QAAQ,CAAC,EAChC,MAAM,CAAC,EAAE,MAAM,KACZ,IAAI,CAAC;IACV,mBAAmB,EAAE,CACnB,IAAI,EAAE,QAAQ,EACd,MAAM,EAAE,OAAO,CAAC,mBAAmB,CAAC,KACjC,IAAI,CAAC;IACV,IAAI,EAAE,CAAC,CAAC,SAAS,MAAM,gBAAgB,EACrC,KAAK,EAAE,CAAC,EACR,OAAO,EAAE,gBAAgB,CAAC,CAAC,CAAC,KACzB,IAAI,CAAC;IACV,cAAc,EAAE,CAAC,IAAI,CAAC,EAAE,QAAQ,KAAK,IAAI,CAAC;IAC1C,kBAAkB,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,CAAC;IAChD,qBAAqB,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,wBAAwB,CAAC,CAAC;IAC7E,oBAAoB,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IAChE,mBAAmB,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;IACnE,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE,qBAAqB,KAAK,IAAI,CAAC;IAC1D,uBAAuB,CAAC,EAAE,CAAC,MAAM,EAAE,yBAAyB,KAAK,IAAI,CAAC;IACtE,iBAAiB,EAAE,CACjB,IAAI,EAAE,YAAY,EAClB,KAAK,EAAE,cAAc,EACrB,MAAM,EAAE,OAAO,KACZ,OAAO,CAAC,IAAI,CAAC,CAAC;IACnB,WAAW,EAAE,CACX,KAAK,EAAE,YAAY,EAAE,EACrB,KAAK,EAAE,cAAc,EACrB,IAAI,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,EAC5B,UAAU,CAAC,EAAE,MAAM,KAChB,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CAAC;IAChC,WAAW,EAAE,CACX,IAAI,EAAE,YAAY,EAClB,KAAK,EAAE,cAAc,EACrB,IAAI,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,KACzB,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CAAC;CACjC,CAAC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import type { ActionSnapshot, BaseWorkflowContext } from './context';
|
|
2
|
+
import type { StepExecutorEnv } from './step-executors/types';
|
|
3
|
+
import { type StepInfo, type WorkflowEventMap } from './workflow-event-emitter';
|
|
4
|
+
import type { CompiledStep, CompiledTask, CompiledWorkflow, ExecutionState, Suspension } from './workflow-types';
|
|
5
|
+
export type SuspensionRebuilderDeps = {
|
|
6
|
+
compiled: CompiledWorkflow;
|
|
7
|
+
context?: BaseWorkflowContext;
|
|
8
|
+
runId?: string;
|
|
9
|
+
createExecutorEnv: () => StepExecutorEnv;
|
|
10
|
+
buildInstanceStepInfo: (step: CompiledStep, iterationStack: number[]) => StepInfo;
|
|
11
|
+
captureTaskOutput: (task: CompiledTask, state: ExecutionState, result: unknown) => Promise<void>;
|
|
12
|
+
markSnapshot: (step: StepInfo, status: ActionSnapshot['status'], reason?: string) => void;
|
|
13
|
+
emit: <K extends keyof WorkflowEventMap>(event: K, payload: WorkflowEventMap[K]) => void;
|
|
14
|
+
executeFlow: (steps: CompiledStep[], state: ExecutionState, path: Array<number | string>, startIndex?: number) => Promise<Suspension | void>;
|
|
15
|
+
};
|
|
16
|
+
type RebuildSuspensionMetadata = {
|
|
17
|
+
stepExecId?: string;
|
|
18
|
+
suspendIndex?: number;
|
|
19
|
+
suspendKey?: string;
|
|
20
|
+
reason?: string;
|
|
21
|
+
awaitResults?: Record<string, unknown>;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Parse a suspended step id into its execution path and iteration stack.
|
|
25
|
+
*
|
|
26
|
+
* @param stepId The serialized step identifier stored in snapshots.
|
|
27
|
+
* @returns The decoded path tokens and iteration stack.
|
|
28
|
+
*/
|
|
29
|
+
export declare function parseSuspendedStepId(stepId: string): {
|
|
30
|
+
path: Array<number | string>;
|
|
31
|
+
iterationStack: number[];
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Rebuild a suspension object based on persisted state and step identifiers.
|
|
35
|
+
*
|
|
36
|
+
* @param deps Dependencies needed to reconstruct executors and events.
|
|
37
|
+
* @param param0 Persisted state and metadata about the suspended step.
|
|
38
|
+
* @param param0.state Execution state captured at suspension time.
|
|
39
|
+
* @param param0.stepId Serialized step id used to locate the suspension point.
|
|
40
|
+
* @param param0.reason Optional reason supplied when the workflow suspended.
|
|
41
|
+
* @param param0.data Arbitrary payload provided with the suspension.
|
|
42
|
+
* @returns A suspension ready to be resumed, or null if reconstruction fails.
|
|
43
|
+
*/
|
|
44
|
+
export declare function rebuildSuspension(deps: SuspensionRebuilderDeps, { state, stepId, reason, data, stepExecId, suspendIndex, suspendKey, awaitResults, }: {
|
|
45
|
+
state?: ExecutionState;
|
|
46
|
+
stepId: string;
|
|
47
|
+
reason?: string;
|
|
48
|
+
data?: unknown;
|
|
49
|
+
stepExecId?: string;
|
|
50
|
+
suspendIndex?: number;
|
|
51
|
+
suspendKey?: string;
|
|
52
|
+
awaitResults?: Record<string, unknown>;
|
|
53
|
+
}): Suspension | null;
|
|
54
|
+
/**
|
|
55
|
+
* Walk the compiled flow to rebuild the continuation matching a target path.
|
|
56
|
+
*
|
|
57
|
+
* @param deps Dependencies for executor creation and event emission.
|
|
58
|
+
* @param steps The steps to search for the suspended step.
|
|
59
|
+
* @param state Mutable execution state to thread through the traversal.
|
|
60
|
+
* @param targetPath Path tokens identifying the suspended step location.
|
|
61
|
+
* @param pathPrefix Prefix accumulated while descending the tree.
|
|
62
|
+
* @param iterationDepth Current loop depth to match iteration stacks.
|
|
63
|
+
* @returns A rebuilt suspension or null if the path cannot be matched.
|
|
64
|
+
*/
|
|
65
|
+
export declare function buildSuspensionForPath(deps: SuspensionRebuilderDeps, steps: CompiledStep[], state: ExecutionState, targetPath: Array<number | string>, pathPrefix: Array<number | string>, iterationDepth?: number, suspensionMetadata?: RebuildSuspensionMetadata): Suspension | null;
|
|
66
|
+
export {};
|
|
67
|
+
//# sourceMappingURL=suspension-rebuilder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"suspension-rebuilder.d.ts","sourceRoot":"","sources":["../../src/suspension-rebuilder.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAQrE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAEL,KAAK,QAAQ,EACb,KAAK,gBAAgB,EACtB,MAAM,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AAC,CAAC;IACpB,OAAO,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;IAC5B,MAAM,EAAE,CAAC,MAAM,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;CACpC,CAAC;AAEF,wBAAgB,cAAc,CAAC,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,CAU/C"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export type WorkflowEntity = 'action' | 'workflow' | 'predicate';
|
|
2
|
+
/**
|
|
3
|
+
* Verifies that names follow the snake_case convention required by the system.
|
|
4
|
+
*
|
|
5
|
+
* @param name - Candidate name that should be validated.
|
|
6
|
+
* @param entity - Entity type used to customize the error message.
|
|
7
|
+
* @throws Error when the name is not snake_case.
|
|
8
|
+
*/
|
|
9
|
+
export declare function assertSnakeCaseName(name: string, entity: WorkflowEntity): void;
|
|
10
|
+
/**
|
|
11
|
+
* Checks whether the provided string is snake_case compliant.
|
|
12
|
+
*
|
|
13
|
+
* @param value - Text to evaluate.
|
|
14
|
+
* @returns `true` when the value is snake_case; otherwise `false`.
|
|
15
|
+
*/
|
|
16
|
+
export declare const isSnakeCaseName: (value: string) => boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Converts arbitrary text into snake_case for use in workflow entities.
|
|
19
|
+
*
|
|
20
|
+
* @param value - Input text that should be converted.
|
|
21
|
+
* @returns Snake cased version of the input.
|
|
22
|
+
*/
|
|
23
|
+
export declare function toSnakeCase(value: string): string;
|
|
24
|
+
//# sourceMappingURL=naming.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"naming.d.ts","sourceRoot":"","sources":["../../../src/utils/naming.ts"],"names":[],"mappings":"AAQA,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,UAAU,GAAG,WAAW,CAAC;AAEjE;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,cAAc,GACrB,IAAI,CAMN;AAED;;;;;GAKG;AACH,eAAO,MAAM,eAAe,GAAI,OAAO,MAAM,KAAG,OAClB,CAAC;AAE/B;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAWjD"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolves after the specified duration; useful for retry delays.
|
|
3
|
+
*
|
|
4
|
+
* @param durationMs - Number of milliseconds to wait before resolving.
|
|
5
|
+
* @returns A promise that resolves once the duration elapses.
|
|
6
|
+
*/
|
|
7
|
+
export declare const sleep: (durationMs: number) => Promise<void>;
|
|
8
|
+
/**
|
|
9
|
+
* Wraps a promise and rejects if it does not settle within the timeout.
|
|
10
|
+
*
|
|
11
|
+
* @param promise - Operation that may take longer than the allowed timeout.
|
|
12
|
+
* @param timeoutMs - Maximum time in milliseconds to wait before rejecting.
|
|
13
|
+
* @returns The result of the original promise when it resolves in time.
|
|
14
|
+
* @throws Error when the timeout is exceeded.
|
|
15
|
+
*/
|
|
16
|
+
export declare function withTimeout<T>(promise: Promise<T>, timeoutMs?: number): Promise<T>;
|
|
17
|
+
//# sourceMappingURL=timeout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timeout.d.ts","sourceRoot":"","sources":["../../../src/utils/timeout.ts"],"names":[],"mappings":"AAMA;;;;;GAKG;AACH,eAAO,MAAM,KAAK,GAAI,YAAY,MAAM,KAAG,OAAO,CAAC,IAAI,CACI,CAAC;AAE5D;;;;;;;GAOG;AACH,wBAAsB,WAAW,CAAC,CAAC,EACjC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,EACnB,SAAS,CAAC,EAAE,MAAM,GACjB,OAAO,CAAC,CAAC,CAAC,CAqBZ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow-definition.d.ts","sourceRoot":"","sources":["../../../src/utils/workflow-definition.ts"],"names":[],"mappings":"AAMA,OAAO,EAGL,KAAK,kBAAkB,EACxB,MAAM,cAAc,CAAC;AA8HtB,eAAO,MAAM,0BAA0B,GACrC,YAAY,kBAAkB,EAC9B,iBAAiB,MAAM,EACvB,cAAc,MAAM,KACnB,kBAgCF,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Action } from './action/action.types';
|
|
2
|
+
import type { BindingKindSchemas } from './bindings/base-binding';
|
|
3
|
+
import type { WorkflowDefinition } from './dsl.types';
|
|
4
|
+
import type { CompiledWorkflow } from './workflow-types';
|
|
5
|
+
import { type CompileValueOptions } from './workflow-values';
|
|
6
|
+
export type WorkflowCompileOptions = CompileValueOptions & {
|
|
7
|
+
actions: Record<string, Action>;
|
|
8
|
+
bindingKinds?: BindingKindSchemas;
|
|
9
|
+
};
|
|
10
|
+
/** Compile a workflow definition into structures consumable by the runtime. */
|
|
11
|
+
export declare const compileWorkflow: (definition: WorkflowDefinition, options: WorkflowCompileOptions) => CompiledWorkflow;
|
|
12
|
+
//# sourceMappingURL=workflow-compiler.d.ts.map
|