@workglow/task-graph 0.0.88 → 0.0.90
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/browser.js +1789 -266
- package/dist/browser.js.map +19 -11
- package/dist/bun.js +1789 -266
- package/dist/bun.js.map +19 -11
- package/dist/node.js +1789 -266
- package/dist/node.js.map +19 -11
- package/dist/task/ConditionUtils.d.ts +47 -0
- package/dist/task/ConditionUtils.d.ts.map +1 -0
- package/dist/task/ConditionalTask.d.ts +15 -0
- package/dist/task/ConditionalTask.d.ts.map +1 -1
- package/dist/task/GraphAsTask.d.ts.map +1 -1
- package/dist/task/GraphAsTaskRunner.d.ts +3 -4
- package/dist/task/GraphAsTaskRunner.d.ts.map +1 -1
- package/dist/task/IteratorTask.d.ts +177 -0
- package/dist/task/IteratorTask.d.ts.map +1 -0
- package/dist/task/IteratorTaskRunner.d.ts +36 -0
- package/dist/task/IteratorTaskRunner.d.ts.map +1 -0
- package/dist/task/MapTask.d.ts +82 -0
- package/dist/task/MapTask.d.ts.map +1 -0
- package/dist/task/ReduceTask.d.ts +61 -0
- package/dist/task/ReduceTask.d.ts.map +1 -0
- package/dist/task/Task.d.ts +2 -2
- package/dist/task/Task.d.ts.map +1 -1
- package/dist/task/WhileTask.d.ts +214 -0
- package/dist/task/WhileTask.d.ts.map +1 -0
- package/dist/task/WhileTaskRunner.d.ts +29 -0
- package/dist/task/WhileTaskRunner.d.ts.map +1 -0
- package/dist/task/index.d.ts +12 -1
- package/dist/task/index.d.ts.map +1 -1
- package/dist/task/iterationSchema.d.ts +70 -0
- package/dist/task/iterationSchema.d.ts.map +1 -0
- package/dist/task-graph/ITaskGraph.d.ts +1 -1
- package/dist/task-graph/ITaskGraph.d.ts.map +1 -1
- package/dist/task-graph/TaskGraph.d.ts +1 -1
- package/dist/task-graph/TaskGraph.d.ts.map +1 -1
- package/dist/task-graph/TaskGraphRunner.d.ts +2 -1
- package/dist/task-graph/TaskGraphRunner.d.ts.map +1 -1
- package/dist/task-graph/Workflow.d.ts +112 -8
- package/dist/task-graph/Workflow.d.ts.map +1 -1
- package/package.json +7 -7
- package/src/EXECUTION_MODEL.md +433 -0
- package/dist/task/TaskJSON.test.d.ts +0 -7
- package/dist/task/TaskJSON.test.d.ts.map +0 -1
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Steven Roussey <sroussey@gmail.com>
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import type { DataPortSchema } from "@workglow/util";
|
|
7
|
+
import { GraphAsTask, GraphAsTaskConfig } from "./GraphAsTask";
|
|
8
|
+
import type { IExecuteContext } from "./ITask";
|
|
9
|
+
import type { TaskInput, TaskOutput, TaskTypeName } from "./TaskTypes";
|
|
10
|
+
import { WhileTaskRunner } from "./WhileTaskRunner";
|
|
11
|
+
/**
|
|
12
|
+
* WhileTask context schema - only has index since count is unknown ahead of time.
|
|
13
|
+
* Properties are marked with "x-ui-iteration": true so the builder
|
|
14
|
+
* knows to hide them from parent-level display.
|
|
15
|
+
*/
|
|
16
|
+
export declare const WHILE_CONTEXT_SCHEMA: DataPortSchema;
|
|
17
|
+
/**
|
|
18
|
+
* Condition function type for WhileTask.
|
|
19
|
+
* Receives the current output and iteration count, returns whether to continue looping.
|
|
20
|
+
*
|
|
21
|
+
* @param output - The output from the last iteration
|
|
22
|
+
* @param iteration - The current iteration number (0-based)
|
|
23
|
+
* @returns true to continue looping, false to stop
|
|
24
|
+
*/
|
|
25
|
+
export type WhileConditionFn<Output> = (output: Output, iteration: number) => boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Configuration for WhileTask.
|
|
28
|
+
*/
|
|
29
|
+
export interface WhileTaskConfig<Output extends TaskOutput = TaskOutput> extends GraphAsTaskConfig {
|
|
30
|
+
/**
|
|
31
|
+
* Condition function that determines whether to continue looping.
|
|
32
|
+
* Called after each iteration with the current output and iteration count.
|
|
33
|
+
* Returns true to continue, false to stop.
|
|
34
|
+
*/
|
|
35
|
+
readonly condition?: WhileConditionFn<Output>;
|
|
36
|
+
/**
|
|
37
|
+
* Maximum number of iterations to prevent infinite loops.
|
|
38
|
+
* @default 100
|
|
39
|
+
*/
|
|
40
|
+
readonly maxIterations?: number;
|
|
41
|
+
/**
|
|
42
|
+
* Whether to pass the output of each iteration as input to the next.
|
|
43
|
+
* When true, output from iteration N becomes input to iteration N+1.
|
|
44
|
+
* @default true
|
|
45
|
+
*/
|
|
46
|
+
readonly chainIterations?: boolean;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* WhileTask loops until a condition function returns false.
|
|
50
|
+
*
|
|
51
|
+
* This task is useful for:
|
|
52
|
+
* - Iterative refinement processes
|
|
53
|
+
* - Polling until a condition is met
|
|
54
|
+
* - Convergence algorithms
|
|
55
|
+
* - Retry logic with conditions
|
|
56
|
+
*
|
|
57
|
+
* ## Features
|
|
58
|
+
*
|
|
59
|
+
* - Loops until condition returns false
|
|
60
|
+
* - Configurable maximum iterations (safety limit)
|
|
61
|
+
* - Passes output from each iteration to the next
|
|
62
|
+
* - Access to iteration count in condition function
|
|
63
|
+
*
|
|
64
|
+
* ## Usage
|
|
65
|
+
*
|
|
66
|
+
* ```typescript
|
|
67
|
+
* // Refine until quality threshold
|
|
68
|
+
* workflow
|
|
69
|
+
* .while({
|
|
70
|
+
* condition: (output, iteration) => output.quality < 0.9 && iteration < 10,
|
|
71
|
+
* maxIterations: 20
|
|
72
|
+
* })
|
|
73
|
+
* .refineResult()
|
|
74
|
+
* .evaluateQuality()
|
|
75
|
+
* .endWhile()
|
|
76
|
+
*
|
|
77
|
+
* // Retry until success
|
|
78
|
+
* workflow
|
|
79
|
+
* .while({
|
|
80
|
+
* condition: (output) => !output.success,
|
|
81
|
+
* maxIterations: 5
|
|
82
|
+
* })
|
|
83
|
+
* .attemptOperation()
|
|
84
|
+
* .endWhile()
|
|
85
|
+
* ```
|
|
86
|
+
*
|
|
87
|
+
* @template Input - The input type for the while task
|
|
88
|
+
* @template Output - The output type for the while task
|
|
89
|
+
* @template Config - The configuration type
|
|
90
|
+
*/
|
|
91
|
+
export declare class WhileTask<Input extends TaskInput = TaskInput, Output extends TaskOutput = TaskOutput, Config extends WhileTaskConfig<Output> = WhileTaskConfig<Output>> extends GraphAsTask<Input, Output, Config> {
|
|
92
|
+
static type: TaskTypeName;
|
|
93
|
+
static category: string;
|
|
94
|
+
static title: string;
|
|
95
|
+
static description: string;
|
|
96
|
+
/** This task has dynamic schemas based on the inner workflow */
|
|
97
|
+
static hasDynamicSchemas: boolean;
|
|
98
|
+
/**
|
|
99
|
+
* Returns the schema for iteration-context inputs that will be
|
|
100
|
+
* injected into the subgraph InputTask at runtime.
|
|
101
|
+
*
|
|
102
|
+
* WhileTask only provides _iterationIndex since the total count
|
|
103
|
+
* is unknown ahead of time.
|
|
104
|
+
*/
|
|
105
|
+
static getIterationContextSchema(): DataPortSchema;
|
|
106
|
+
/**
|
|
107
|
+
* Current iteration count during execution.
|
|
108
|
+
*/
|
|
109
|
+
protected _currentIteration: number;
|
|
110
|
+
constructor(input?: Partial<Input>, config?: Partial<Config>);
|
|
111
|
+
_runner: WhileTaskRunner<Input, Output, Config>;
|
|
112
|
+
get runner(): WhileTaskRunner<Input, Output, Config>;
|
|
113
|
+
/**
|
|
114
|
+
* Gets the condition function.
|
|
115
|
+
*/
|
|
116
|
+
get condition(): WhileConditionFn<Output> | undefined;
|
|
117
|
+
/**
|
|
118
|
+
* Gets the maximum iterations limit.
|
|
119
|
+
* Falls back to extras.whileConfig.maxIterations for JSON-deserialized tasks.
|
|
120
|
+
*/
|
|
121
|
+
get maxIterations(): number;
|
|
122
|
+
/**
|
|
123
|
+
* Whether to chain iteration outputs to inputs.
|
|
124
|
+
* Falls back to extras.whileConfig.chainIterations for JSON-deserialized tasks.
|
|
125
|
+
*/
|
|
126
|
+
get chainIterations(): boolean;
|
|
127
|
+
/**
|
|
128
|
+
* Gets the current iteration count.
|
|
129
|
+
*/
|
|
130
|
+
get currentIteration(): number;
|
|
131
|
+
/**
|
|
132
|
+
* Execute the while loop.
|
|
133
|
+
*/
|
|
134
|
+
/**
|
|
135
|
+
* Builds a condition function from the serialized whileConfig in extras
|
|
136
|
+
* when no condition function is directly provided in config.
|
|
137
|
+
*/
|
|
138
|
+
private buildConditionFromExtras;
|
|
139
|
+
/**
|
|
140
|
+
* Analyzes the iterationInputConfig from whileConfig to decompose
|
|
141
|
+
* array inputs into per-iteration scalar values.
|
|
142
|
+
*
|
|
143
|
+
* Returns null if no iterationInputConfig is present (normal while behavior).
|
|
144
|
+
*/
|
|
145
|
+
private analyzeArrayInputs;
|
|
146
|
+
/**
|
|
147
|
+
* Builds per-iteration input by picking the i-th element from each array port
|
|
148
|
+
* and passing scalar ports through unchanged.
|
|
149
|
+
*/
|
|
150
|
+
private buildIterationInput;
|
|
151
|
+
execute(input: Input, context: IExecuteContext): Promise<Output | undefined>;
|
|
152
|
+
/**
|
|
153
|
+
* Instance method to get the iteration context schema.
|
|
154
|
+
* Can be overridden by subclasses to customize iteration context.
|
|
155
|
+
*/
|
|
156
|
+
getIterationContextSchema(): DataPortSchema;
|
|
157
|
+
/**
|
|
158
|
+
* When chainIterations is true, the output schema from the previous
|
|
159
|
+
* iteration becomes part of the input schema for the next iteration.
|
|
160
|
+
* These chained properties should be marked with "x-ui-iteration": true.
|
|
161
|
+
*
|
|
162
|
+
* @returns Schema with chained output properties marked for iteration, or undefined if not chaining
|
|
163
|
+
*/
|
|
164
|
+
getChainedOutputSchema(): DataPortSchema | undefined;
|
|
165
|
+
/**
|
|
166
|
+
* Instance input schema override.
|
|
167
|
+
* When iterationInputConfig is present, wraps array-mode ports in array schemas
|
|
168
|
+
* so that the dataflow compatibility check accepts array values.
|
|
169
|
+
*/
|
|
170
|
+
inputSchema(): DataPortSchema;
|
|
171
|
+
/**
|
|
172
|
+
* Static input schema for WhileTask.
|
|
173
|
+
*/
|
|
174
|
+
static inputSchema(): DataPortSchema;
|
|
175
|
+
/**
|
|
176
|
+
* Static output schema for WhileTask.
|
|
177
|
+
*/
|
|
178
|
+
static outputSchema(): DataPortSchema;
|
|
179
|
+
/**
|
|
180
|
+
* Instance output schema - returns final iteration output schema.
|
|
181
|
+
*/
|
|
182
|
+
outputSchema(): DataPortSchema;
|
|
183
|
+
}
|
|
184
|
+
declare module "../task-graph/Workflow" {
|
|
185
|
+
interface Workflow {
|
|
186
|
+
/**
|
|
187
|
+
* Starts a while loop that continues until a condition is false.
|
|
188
|
+
* Use .endWhile() to close the loop and return to the parent workflow.
|
|
189
|
+
*
|
|
190
|
+
* @param config - Configuration for the while loop (must include condition)
|
|
191
|
+
* @returns A Workflow in loop builder mode for defining the loop body
|
|
192
|
+
*
|
|
193
|
+
* @example
|
|
194
|
+
* ```typescript
|
|
195
|
+
* workflow
|
|
196
|
+
* .while({
|
|
197
|
+
* condition: (output, iteration) => output.quality < 0.9,
|
|
198
|
+
* maxIterations: 10
|
|
199
|
+
* })
|
|
200
|
+
* .refineResult()
|
|
201
|
+
* .endWhile()
|
|
202
|
+
* ```
|
|
203
|
+
*/
|
|
204
|
+
while: CreateLoopWorkflow<TaskInput, TaskOutput, WhileTaskConfig<any>>;
|
|
205
|
+
/**
|
|
206
|
+
* Ends the while loop and returns to the parent workflow.
|
|
207
|
+
* Only callable on workflows in loop builder mode.
|
|
208
|
+
*
|
|
209
|
+
* @returns The parent workflow
|
|
210
|
+
*/
|
|
211
|
+
endWhile(): Workflow;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
//# sourceMappingURL=WhileTask.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WhileTask.d.ts","sourceRoot":"","sources":["../../src/task/WhileTask.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGrD,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAA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;;;;WAKG;QACH,QAAQ,IAAI,QAAQ,CAAC;KACtB;CACF"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Steven Roussey <sroussey@gmail.com>
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { GraphAsTaskRunner } from "./GraphAsTaskRunner";
|
|
7
|
+
import type { TaskInput, TaskOutput } from "./TaskTypes";
|
|
8
|
+
import type { WhileTask, WhileTaskConfig } from "./WhileTask";
|
|
9
|
+
/**
|
|
10
|
+
* Runner for WhileTask that delegates to the task's execute() method
|
|
11
|
+
* instead of directly running the subgraph once (which is what
|
|
12
|
+
* GraphAsTaskRunner does by default).
|
|
13
|
+
*
|
|
14
|
+
* This follows the same pattern as IteratorTaskRunner.
|
|
15
|
+
*/
|
|
16
|
+
export declare class WhileTaskRunner<Input extends TaskInput = TaskInput, Output extends TaskOutput = TaskOutput, Config extends WhileTaskConfig<Output> = WhileTaskConfig<Output>> extends GraphAsTaskRunner<Input, Output, Config> {
|
|
17
|
+
task: WhileTask<Input, Output, Config>;
|
|
18
|
+
/**
|
|
19
|
+
* Override executeTask to call the task's execute() method which
|
|
20
|
+
* contains the while-loop logic, rather than the default
|
|
21
|
+
* GraphAsTaskRunner behavior of running the subgraph once.
|
|
22
|
+
*/
|
|
23
|
+
protected executeTask(input: Input): Promise<Output | undefined>;
|
|
24
|
+
/**
|
|
25
|
+
* For WhileTask, reactive runs use the task's reactive hook only.
|
|
26
|
+
*/
|
|
27
|
+
executeTaskReactive(input: Input, output: Output): Promise<Output>;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=WhileTaskRunner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WhileTaskRunner.d.ts","sourceRoot":"","sources":["../../src/task/WhileTaskRunner.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9D;;;;;;GAMG;AACH,qBAAa,eAAe,CAC1B,KAAK,SAAS,SAAS,GAAG,SAAS,EACnC,MAAM,SAAS,UAAU,GAAG,UAAU,EACtC,MAAM,SAAS,eAAe,CAAC,MAAM,CAAC,GAAG,eAAe,CAAC,MAAM,CAAC,CAChE,SAAQ,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC;IACxC,IAAI,EAAE,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IAE/C;;;;OAIG;cACsB,WAAW,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAW/E;;OAEG;IACmB,mBAAmB,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAIzF"}
|
package/dist/task/index.d.ts
CHANGED
|
@@ -4,12 +4,18 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
export * from "./ConditionalTask";
|
|
7
|
+
export * from "./ConditionUtils";
|
|
7
8
|
export * from "./GraphAsTask";
|
|
8
9
|
export * from "./GraphAsTaskRunner";
|
|
9
10
|
export * from "./InputResolver";
|
|
10
11
|
export * from "./ITask";
|
|
12
|
+
export * from "./iterationSchema";
|
|
13
|
+
export * from "./IteratorTask";
|
|
14
|
+
export * from "./IteratorTaskRunner";
|
|
11
15
|
export * from "./JobQueueFactory";
|
|
12
16
|
export * from "./JobQueueTask";
|
|
17
|
+
export * from "./MapTask";
|
|
18
|
+
export * from "./ReduceTask";
|
|
13
19
|
export * from "./Task";
|
|
14
20
|
export * from "./TaskError";
|
|
15
21
|
export * from "./TaskEvents";
|
|
@@ -17,7 +23,12 @@ export * from "./TaskJSON";
|
|
|
17
23
|
export * from "./TaskQueueRegistry";
|
|
18
24
|
export * from "./TaskRegistry";
|
|
19
25
|
export * from "./TaskTypes";
|
|
26
|
+
export * from "./WhileTask";
|
|
27
|
+
export * from "./WhileTaskRunner";
|
|
20
28
|
import { ConditionalTask } from "./ConditionalTask";
|
|
21
29
|
import { GraphAsTask } from "./GraphAsTask";
|
|
22
|
-
|
|
30
|
+
import { MapTask } from "./MapTask";
|
|
31
|
+
import { ReduceTask } from "./ReduceTask";
|
|
32
|
+
import { WhileTask } from "./WhileTask";
|
|
33
|
+
export declare const registerBaseTasks: () => (typeof GraphAsTask | typeof ConditionalTask | typeof MapTask | typeof WhileTask | typeof ReduceTask)[];
|
|
23
34
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/task/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/task/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC;AACxB,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/task/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC;AACxB,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAElC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,eAAO,MAAM,iBAAiB,+GAI7B,CAAC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Steven Roussey <sroussey@gmail.com>
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*
|
|
6
|
+
* Shared iteration schema helpers used by IteratorTask/WhileTask and the builder.
|
|
7
|
+
* Re-exports context schemas and adds pure schema functions that operate on DataPortSchema.
|
|
8
|
+
*/
|
|
9
|
+
import type { DataPortSchema, PropertySchema } from "@workglow/util";
|
|
10
|
+
import { createArraySchema, createFlexibleSchema, extractBaseSchema, ITERATOR_CONTEXT_SCHEMA, type ExecutionMode, type IterationInputMode, type IterationPropertyConfig } from "./IteratorTask";
|
|
11
|
+
import { WHILE_CONTEXT_SCHEMA } from "./WhileTask";
|
|
12
|
+
export { createArraySchema, createFlexibleSchema, extractBaseSchema, ITERATOR_CONTEXT_SCHEMA, WHILE_CONTEXT_SCHEMA, type ExecutionMode, type IterationInputMode, type IterationPropertyConfig, };
|
|
13
|
+
/** Config for buildIterationInputSchema: mode and optional baseSchema (defaults to extracted from inner). */
|
|
14
|
+
export type IterationInputConfig = Record<string, {
|
|
15
|
+
mode: IterationInputMode;
|
|
16
|
+
baseSchema?: DataPortSchema;
|
|
17
|
+
}>;
|
|
18
|
+
/**
|
|
19
|
+
* Determines if a schema is a flexible type (T | T[]).
|
|
20
|
+
*/
|
|
21
|
+
export declare function isFlexibleSchema(schema: DataPortSchema): boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Determines if a schema is strictly an array type.
|
|
24
|
+
*/
|
|
25
|
+
export declare function isStrictArraySchema(schema: DataPortSchema): boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Gets the input mode for a schema property.
|
|
28
|
+
*/
|
|
29
|
+
export declare function getInputModeFromSchema(schema: DataPortSchema): IterationInputMode;
|
|
30
|
+
/**
|
|
31
|
+
* Get the appropriate iteration context schema for a given task type.
|
|
32
|
+
*/
|
|
33
|
+
export declare function getIterationContextSchemaForType(taskType: string): DataPortSchema | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* Merge iteration context schema into an existing InputNode schema.
|
|
36
|
+
*/
|
|
37
|
+
export declare function addIterationContextToSchema(existingSchema: DataPortSchema | undefined, parentTaskType: string): DataPortSchema;
|
|
38
|
+
/**
|
|
39
|
+
* Check if a schema property is an iteration-injected input.
|
|
40
|
+
*/
|
|
41
|
+
export declare function isIterationProperty(schema: PropertySchema): boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Filter out iteration properties from a schema (for parent display).
|
|
44
|
+
*/
|
|
45
|
+
export declare function filterIterationProperties(schema?: DataPortSchema): DataPortSchema | undefined;
|
|
46
|
+
/**
|
|
47
|
+
* Extract only iteration properties from a schema.
|
|
48
|
+
*/
|
|
49
|
+
export declare function extractIterationProperties(schema?: DataPortSchema): DataPortSchema | undefined;
|
|
50
|
+
/**
|
|
51
|
+
* Remove iteration properties from a schema (alias for filterIterationProperties).
|
|
52
|
+
*/
|
|
53
|
+
export declare function removeIterationProperties(schema?: DataPortSchema): DataPortSchema | undefined;
|
|
54
|
+
/**
|
|
55
|
+
* Merge chained output properties into input schema; marks output properties with "x-ui-iteration": true.
|
|
56
|
+
*/
|
|
57
|
+
export declare function mergeChainedOutputToInput(inputSchema: DataPortSchema | undefined, outputSchema: DataPortSchema | undefined): DataPortSchema;
|
|
58
|
+
/**
|
|
59
|
+
* Builds the iteration input schema from the inner schema and optional iteration input configuration.
|
|
60
|
+
*/
|
|
61
|
+
export declare function buildIterationInputSchema(innerSchema: DataPortSchema | undefined, config?: IterationInputConfig): DataPortSchema;
|
|
62
|
+
/**
|
|
63
|
+
* Find array-typed ports from an input schema.
|
|
64
|
+
*/
|
|
65
|
+
export declare function findArrayPorts(schema: DataPortSchema | undefined): string[];
|
|
66
|
+
/**
|
|
67
|
+
* Wrap a schema's properties in arrays for iteration output.
|
|
68
|
+
*/
|
|
69
|
+
export declare function wrapSchemaInArray(schema: DataPortSchema | undefined): DataPortSchema | undefined;
|
|
70
|
+
//# sourceMappingURL=iterationSchema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"iterationSchema.d.ts","sourceRoot":"","sources":["../../src/task/iterationSchema.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAErE,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EACpB,iBAAiB,EACjB,uBAAuB,EACvB,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,uBAAuB,EAC7B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAEnD,OAAO,EACL,iBAAiB,EACjB,oBAA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,yBAAyB,CACvC,WAAW,EAAE,cAAc,GAAG,SAAS,EACvC,MAAM,CAAC,EAAE,oBAAoB,GAC5B,cAAc,CA2DhB;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,cAAc,GAAG,SAAS,GAAG,MAAM,EAAE,CAgB3E;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,cAAc,GAAG,SAAS,GAAG,cAAc,GAAG,SAAS,CAmBhG"}
|
|
@@ -13,7 +13,7 @@ import { CompoundMergeStrategy, GraphResult, GraphResultArray, TaskGraphRunner }
|
|
|
13
13
|
export interface ITaskGraph {
|
|
14
14
|
get runner(): TaskGraphRunner;
|
|
15
15
|
run<ExecuteOutput extends TaskOutput>(input?: TaskInput, config?: TaskGraphRunConfig): Promise<GraphResultArray<ExecuteOutput>>;
|
|
16
|
-
runReactive<Output extends TaskOutput>(): Promise<GraphResultArray<Output>>;
|
|
16
|
+
runReactive<Output extends TaskOutput>(input?: TaskInput): Promise<GraphResultArray<Output>>;
|
|
17
17
|
mergeExecuteOutputsToRunOutput<ExecuteOutput extends TaskOutput, Merge extends CompoundMergeStrategy = CompoundMergeStrategy>(results: GraphResultArray<ExecuteOutput>, compoundMerge: Merge): GraphResult<ExecuteOutput, Merge>;
|
|
18
18
|
abort(): void;
|
|
19
19
|
disable(): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ITaskGraph.d.ts","sourceRoot":"","sources":["../../src/task-graph/ITaskGraph.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACvF,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,YAA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G,KAAK,EAAE,CAAC;IACzC,UAAU,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC;IAClC,MAAM,IAAI,aAAa,CAAC;IACxB,gBAAgB,IAAI,YAAY,EAAE,CAAC;IACnC,SAAS,CAAC,KAAK,SAAS,eAAe,EACrC,KAAK,EAAE,KAAK,EACZ,EAAE,EAAE,sBAAsB,CAAC,KAAK,CAAC,GAChC,MAAM,IAAI,CAAC;IACd,qBAAqB,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,KAAK,IAAI,GAAG,MAAM,IAAI,CAAC;IAC9F,uBAAuB,CACrB,QAAQ,EAAE,CAAC,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,GACzF,MAAM,IAAI,CAAC;IACd,yBAAyB,CACvB,QAAQ,EAAE,CAAC,UAAU,EAAE,cAAc,EAAE,MAAM,EAAE,UAAU,KAAK,IAAI,GACjE,MAAM,IAAI,CAAC;CACf"}
|
|
@@ -57,7 +57,7 @@ export declare class TaskGraph implements ITaskGraph {
|
|
|
57
57
|
* @returns A promise that resolves when all tasks are complete
|
|
58
58
|
* @throws TaskError if any tasks have failed
|
|
59
59
|
*/
|
|
60
|
-
runReactive<Output extends TaskOutput>(): Promise<GraphResultArray<Output>>;
|
|
60
|
+
runReactive<Output extends TaskOutput>(input?: TaskInput): Promise<GraphResultArray<Output>>;
|
|
61
61
|
/**
|
|
62
62
|
* Merges the execute output to the run output
|
|
63
63
|
* @param results The execute output
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TaskGraph.d.ts","sourceRoot":"","sources":["../../src/task-graph/TaskGraph.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,oBAAoB,EAAE,YAAY,EAAE,eAAe,EAAS,MAAM,gBAAgB,CAAC;AAC5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C,KAAK,CAAC;IAahF;;;;OAIG;IACH,GAAG,CAAC,KAAK,SAAS,eAAe,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE,sBAAsB,CAAC,KAAK,CAAC;IAajF;;;;OAIG;IACH,IAAI,CAAC,CAAC,SAAS,mBAAmB,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,IAAI,EAAE,uBAAuB,CAAC,CAAC,CAAC,GAAG,IAAI;IACvF,IAAI,CAAC,CAAC,SAAS,qBAAqB,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,IAAI,EAAE,8BAA8B,CAAC,CAAC,CAAC,GAAG,IAAI;IAYhG;;;;OAIG;IACH,SAAS,CAAC,UAAU,CAAC,KAAK,SAAS,qBAAqB,EACtD,IAAI,EAAE,KAAK,EACX,GAAG,IAAI,EAAE,8BAA8B,CAAC,KAAK,CAAC;IAKhD;;;;OAIG;IACH,SAAS,CAAC,QAAQ,CAAC,KAAK,SAAS,mBAAmB,EAClD,IAAI,EAAE,KAAK,EACX,GAAG,IAAI,EAAE,uBAAuB,CAAC,KAAK,CAAC;CAM1C;AAsBD;;;;;;;GAOG;AACH,wBAAgB,WAAW,CACzB,KAAK,EAAE,KAAK,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,EAC7B,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,GACnB,SAAS,CAKX"}
|
|
@@ -74,10 +74,11 @@ export declare class TaskGraphRunner {
|
|
|
74
74
|
runGraph<ExecuteOutput extends TaskOutput>(input?: TaskInput, config?: TaskGraphRunConfig): Promise<GraphResultArray<ExecuteOutput>>;
|
|
75
75
|
/**
|
|
76
76
|
* Runs the task graph in a reactive manner
|
|
77
|
+
* @param input Optional input to pass to root tasks (tasks with no incoming dataflows)
|
|
77
78
|
* @returns A promise that resolves when all tasks are complete
|
|
78
79
|
* @throws TaskConfigurationError if the graph is already running reactively
|
|
79
80
|
*/
|
|
80
|
-
runGraphReactive<Output extends TaskOutput>(): Promise<GraphResultArray<Output>>;
|
|
81
|
+
runGraphReactive<Output extends TaskOutput>(input?: TaskInput): Promise<GraphResultArray<Output>>;
|
|
81
82
|
/**
|
|
82
83
|
* Aborts the task graph execution
|
|
83
84
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TaskGraphRunner.d.ts","sourceRoot":"","sources":["../../src/task-graph/TaskGraphRunner.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAEL,yBAAyB,EAEzB,eAAe,EAEhB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAA0B,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAE/F,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAA4C,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACxF,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEtE,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAE,wBAAwB,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAEtF,MAAM,MAAM,qBAAqB,CAAC,CAAC,IAAI;IACrC,EAAE,EAAE,OAAO,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,CAAC,CAAC;CACT,CAAC;AACF,MAAM,MAAM,gBAAgB,CAAC,CAAC,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC,CAAC;AAClE,MAAM,MAAM,wBAAwB,CAAC,CAAC,IAAI,yBAAyB,CAAC,CAAC,CAAC,CAAC;AACvE,MAAM,MAAM,cAAc,CAAC,CAAC,IAAI,wBAAwB,CAAC,CAAC,CAAC,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAAC;AAElF,eAAO,MAAM,cAAc,EAAG,gBAAyB,CAAC;AACxD,eAAO,MAAM,kBAAkB,EAAG,oBAA6B,CAAC;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,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC;IAmB5F;;;;;OAKG;IACH,SAAS,CAAC,SAAS,CAAC,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM;IAehE;;;OAGG;IACI,UAAU,CAAC,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM;IAapD;;;OAGG;cACa,WAAW,CAAC,MAAM,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC;cAqDvD,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC;IAQpD;;OAEG;cACa,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;cAK/B,sBAAsB,IAAI,OAAO,CAAC,IAAI,CAAC;IAIvD;;OAEG;cACa,WAAW,CAAC,KAAK,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC;cAY5C,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC;IAIpD;;OAEG;cACa,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC;cAU5B,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC;IAIpD;;OAEG;cACa,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;IAY9C;;;;;;OAMG;cACa,cAAc,CAC5B,IAAI,EAAE,KAAK,EACX,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,MAAM,EAChB,GAAG,IAAI,EAAE,GAAG,EAAE,GACb,OAAO,CAAC,IAAI,CAAC;CAUjB"}
|
|
@@ -15,6 +15,32 @@ import { IWorkflow } from "./IWorkflow";
|
|
|
15
15
|
import { TaskGraph } from "./TaskGraph";
|
|
16
16
|
import { CompoundMergeStrategy, type PropertyArrayGraphResult } from "./TaskGraphRunner";
|
|
17
17
|
export type CreateWorkflow<I extends DataPorts, O extends DataPorts, C extends TaskConfig> = (input?: Partial<I>, config?: Partial<C>) => Workflow<I, O>;
|
|
18
|
+
export declare function CreateWorkflow<I extends DataPorts, O extends DataPorts, C extends TaskConfig = TaskConfig>(taskClass: ITaskConstructor<I, O, C>): CreateWorkflow<I, O, C>;
|
|
19
|
+
/**
|
|
20
|
+
* Type for loop workflow methods (map, while, reduce).
|
|
21
|
+
* Represents the method signature with proper `this` context.
|
|
22
|
+
* Loop methods take only a config parameter - input is not used for loop tasks.
|
|
23
|
+
*/
|
|
24
|
+
export type CreateLoopWorkflow<I extends DataPorts, O extends DataPorts, C extends TaskConfig = TaskConfig> = (this: Workflow<I, O>, config?: Partial<C>) => Workflow<I, O>;
|
|
25
|
+
/**
|
|
26
|
+
* Factory function that creates a loop workflow method for a given task class.
|
|
27
|
+
* Returns a method that can be assigned to Workflow.prototype.
|
|
28
|
+
*
|
|
29
|
+
* @param taskClass - The iterator task class (MapTask, ReduceTask, etc.)
|
|
30
|
+
* @returns A method that creates the task and returns a loop builder workflow
|
|
31
|
+
*/
|
|
32
|
+
export declare function CreateLoopWorkflow<I extends DataPorts, O extends DataPorts, C extends TaskConfig = TaskConfig>(taskClass: ITaskConstructor<I, O, C>): CreateLoopWorkflow<I, O, C>;
|
|
33
|
+
/**
|
|
34
|
+
* Type for end loop workflow methods (endMap, endBatch, etc.).
|
|
35
|
+
*/
|
|
36
|
+
export type EndLoopWorkflow = (this: Workflow) => Workflow;
|
|
37
|
+
/**
|
|
38
|
+
* Factory function that creates an end loop workflow method.
|
|
39
|
+
*
|
|
40
|
+
* @param methodName - The name of the method (for error messages)
|
|
41
|
+
* @returns A method that finalizes the loop and returns to the parent workflow
|
|
42
|
+
*/
|
|
43
|
+
export declare function CreateEndLoopWorkflow(methodName: string): EndLoopWorkflow;
|
|
18
44
|
export type WorkflowEventListeners = {
|
|
19
45
|
changed: (id: unknown) => void;
|
|
20
46
|
reset: () => void;
|
|
@@ -29,19 +55,33 @@ export type WorkflowEventParameters<Event extends WorkflowEvents> = EventParamet
|
|
|
29
55
|
/**
|
|
30
56
|
* Class for building and managing a task graph
|
|
31
57
|
* Provides methods for adding tasks, connecting outputs to inputs, and running the task graph
|
|
58
|
+
*
|
|
59
|
+
* When used with a parent workflow (loop builder mode), this class redirects task additions
|
|
60
|
+
* to the iterator task's template graph until an end method (endMap, endBatch, etc.) is called.
|
|
32
61
|
*/
|
|
33
62
|
export declare class Workflow<Input extends DataPorts = DataPorts, Output extends DataPorts = DataPorts> implements IWorkflow<Input, Output> {
|
|
34
63
|
/**
|
|
35
64
|
* Creates a new Workflow
|
|
36
65
|
*
|
|
37
|
-
* @param
|
|
66
|
+
* @param cache - Optional repository for task outputs
|
|
67
|
+
* @param parent - Optional parent workflow (for loop builder mode)
|
|
68
|
+
* @param iteratorTask - Optional iterator task being configured (for loop builder mode)
|
|
38
69
|
*/
|
|
39
|
-
constructor(
|
|
70
|
+
constructor(cache?: TaskOutputRepository, parent?: Workflow, iteratorTask?: GraphAsTask);
|
|
40
71
|
private _graph;
|
|
41
72
|
private _dataFlows;
|
|
42
73
|
private _error;
|
|
43
|
-
private
|
|
74
|
+
private _outputCache?;
|
|
44
75
|
private _abortController?;
|
|
76
|
+
private readonly _parentWorkflow?;
|
|
77
|
+
private readonly _iteratorTask?;
|
|
78
|
+
private _pendingLoopConnect?;
|
|
79
|
+
outputCache(): TaskOutputRepository | undefined;
|
|
80
|
+
/**
|
|
81
|
+
* Whether this workflow is in loop builder mode.
|
|
82
|
+
* When true, tasks are added to the template graph for an iterator task.
|
|
83
|
+
*/
|
|
84
|
+
get isLoopBuilder(): boolean;
|
|
45
85
|
/**
|
|
46
86
|
* Event emitter for task graph events
|
|
47
87
|
*/
|
|
@@ -146,10 +186,74 @@ export declare class Workflow<Input extends DataPorts = DataPorts, Output extend
|
|
|
146
186
|
* Connects outputs to inputs between tasks
|
|
147
187
|
*/
|
|
148
188
|
connect(sourceTaskId: unknown, sourceTaskPortId: string, targetTaskId: unknown, targetTaskPortId: string): Workflow;
|
|
149
|
-
|
|
189
|
+
addTaskToGraph<I extends DataPorts, O extends DataPorts, C extends TaskConfig = TaskConfig>(taskClass: ITaskConstructor<I, O, C>, input: I, config: C): ITask<I, O, C>;
|
|
190
|
+
/**
|
|
191
|
+
* Adds a task to the workflow using the same logic as createWorkflow() helpers.
|
|
192
|
+
* Auto-generates an ID, processes pending dataflows, and auto-connects to previous tasks.
|
|
193
|
+
*
|
|
194
|
+
* @param taskClass - The task class to instantiate and add
|
|
195
|
+
* @param input - Optional input values for the task
|
|
196
|
+
* @param config - Optional configuration (id will be auto-generated if not provided)
|
|
197
|
+
* @returns The workflow for chaining
|
|
198
|
+
*/
|
|
199
|
+
addTask<I extends DataPorts, O extends DataPorts, C extends TaskConfig = TaskConfig>(taskClass: ITaskConstructor<I, O, C>, input?: Partial<I>, config?: Partial<C>): Workflow<Input, Output>;
|
|
200
|
+
/**
|
|
201
|
+
* Adds an iterator/loop task to the workflow using the same auto-connect logic
|
|
202
|
+
* as regular task addition (createWorkflow), then returns a new loop builder Workflow.
|
|
203
|
+
*
|
|
204
|
+
* @param taskClass - The iterator task class (MapTask, ReduceTask, etc.)
|
|
205
|
+
* @param config - Optional configuration for the iterator task
|
|
206
|
+
* @returns A new loop builder Workflow for adding tasks inside the loop
|
|
207
|
+
*/
|
|
208
|
+
addLoopTask<I extends DataPorts, O extends DataPorts, C extends TaskConfig = TaskConfig>(taskClass: ITaskConstructor<I, O, C>, config?: Partial<C>): Workflow<I, O>;
|
|
209
|
+
/**
|
|
210
|
+
* Runs deferred auto-connect for a loop task on this (parent) workflow's graph.
|
|
211
|
+
* Called after finalizeTemplate() populates the iterator task's template graph,
|
|
212
|
+
* so that the iterator task's dynamic inputSchema() is available for matching.
|
|
213
|
+
*/
|
|
214
|
+
autoConnectLoopTask(pending?: {
|
|
215
|
+
parent: ITask;
|
|
216
|
+
iteratorTask: ITask;
|
|
217
|
+
}): void;
|
|
218
|
+
/**
|
|
219
|
+
* Options for auto-connect operation.
|
|
220
|
+
*/
|
|
221
|
+
static readonly AutoConnectOptions: unique symbol;
|
|
222
|
+
/**
|
|
223
|
+
* Auto-connects two tasks based on their schemas.
|
|
224
|
+
* Uses multiple matching strategies:
|
|
225
|
+
* 1. Match by type AND port name (highest priority)
|
|
226
|
+
* 2. Match by specific type only (format, $id) for unmatched ports
|
|
227
|
+
* 3. Look back through earlier tasks for unmatched required inputs
|
|
228
|
+
*
|
|
229
|
+
* @param graph - The task graph to add dataflows to
|
|
230
|
+
* @param sourceTask - The source task to connect from
|
|
231
|
+
* @param targetTask - The target task to connect to
|
|
232
|
+
* @param options - Optional configuration for the auto-connect operation
|
|
233
|
+
* @returns Result containing matches made, any errors, and unmatched required inputs
|
|
234
|
+
*/
|
|
235
|
+
static autoConnect(graph: TaskGraph, sourceTask: ITask, targetTask: ITask, options?: {
|
|
236
|
+
/** Keys of inputs that are already provided and don't need connection */
|
|
237
|
+
readonly providedInputKeys?: Set<string>;
|
|
238
|
+
/** Earlier tasks to search for unmatched required inputs (in reverse chronological order) */
|
|
239
|
+
readonly earlierTasks?: readonly ITask[];
|
|
240
|
+
}): {
|
|
241
|
+
readonly matches: Map<string, string>;
|
|
242
|
+
readonly error?: string;
|
|
243
|
+
readonly unmatchedRequired: readonly string[];
|
|
244
|
+
};
|
|
245
|
+
/**
|
|
246
|
+
* Finalizes the template graph and sets it on the iterator task.
|
|
247
|
+
* Only applicable in loop builder mode.
|
|
248
|
+
*/
|
|
249
|
+
finalizeTemplate(): void;
|
|
250
|
+
/**
|
|
251
|
+
* Finalizes the template graph and returns the parent workflow.
|
|
252
|
+
* Only applicable in loop builder mode.
|
|
253
|
+
*
|
|
254
|
+
* @returns The parent workflow
|
|
255
|
+
* @throws WorkflowError if not in loop builder mode
|
|
256
|
+
*/
|
|
257
|
+
finalizeAndReturn(): Workflow;
|
|
150
258
|
}
|
|
151
|
-
/**
|
|
152
|
-
* Helper function for backward compatibility
|
|
153
|
-
*/
|
|
154
|
-
export declare function CreateWorkflow<I extends DataPorts, O extends DataPorts, C extends TaskConfig = TaskConfig>(taskClass: any): CreateWorkflow<I, O, C>;
|
|
155
259
|
//# sourceMappingURL=Workflow.d.ts.map
|