@workglow/task-graph 0.3.11 → 0.3.13
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 +3368 -3321
- package/dist/browser.js.map +36 -34
- package/dist/bun.js +3368 -3321
- package/dist/bun.js.map +36 -34
- package/dist/cache/CacheJanitor.d.ts +2 -2
- package/dist/cache/RunPrivateCacheRepo.d.ts +6 -5
- package/dist/cache/RunPrivateCacheRepo.d.ts.map +1 -1
- package/dist/common.d.ts +9 -6
- package/dist/common.d.ts.map +1 -1
- package/dist/node.js +3368 -3321
- package/dist/node.js.map +36 -34
- package/dist/storage/ITaskOutputStorage.d.ts +35 -0
- package/dist/storage/ITaskOutputStorage.d.ts.map +1 -0
- package/dist/storage/TabularTaskOutputStorage.d.ts +29 -0
- package/dist/storage/TabularTaskOutputStorage.d.ts.map +1 -0
- package/dist/storage/TaskOutputRepository.d.ts +0 -48
- package/dist/storage/TaskOutputRepository.d.ts.map +1 -1
- package/dist/storage/TaskOutputStorageSchema.d.ts +31 -0
- package/dist/storage/TaskOutputStorageSchema.d.ts.map +1 -0
- package/dist/storage/TaskOutputTabularRepository.d.ts +10 -90
- package/dist/storage/TaskOutputTabularRepository.d.ts.map +1 -1
- package/dist/task/CacheCoordinator.d.ts +8 -2
- package/dist/task/CacheCoordinator.d.ts.map +1 -1
- package/dist/task/ConditionalTask.d.ts +10 -202
- package/dist/task/ConditionalTask.d.ts.map +1 -1
- package/dist/task/FallbackTask.d.ts +7 -59
- package/dist/task/FallbackTask.d.ts.map +1 -1
- package/dist/task/GraphAsTask.d.ts +8 -28
- package/dist/task/GraphAsTask.d.ts.map +1 -1
- package/dist/task/ITask.d.ts +2 -27
- package/dist/task/ITask.d.ts.map +1 -1
- package/dist/task/InputResolver.d.ts +0 -3
- package/dist/task/InputResolver.d.ts.map +1 -1
- package/dist/task/IteratorTask.d.ts +5 -43
- package/dist/task/IteratorTask.d.ts.map +1 -1
- package/dist/task/MapTask.d.ts +1 -25
- package/dist/task/MapTask.d.ts.map +1 -1
- package/dist/task/ReduceTask.d.ts +0 -18
- package/dist/task/ReduceTask.d.ts.map +1 -1
- package/dist/task/Task.d.ts +2 -106
- package/dist/task/Task.d.ts.map +1 -1
- package/dist/task/TaskError.d.ts +2 -29
- package/dist/task/TaskError.d.ts.map +1 -1
- package/dist/task/TaskJSON.d.ts +0 -10
- package/dist/task/TaskJSON.d.ts.map +1 -1
- package/dist/task/TaskRegistry.d.ts +0 -14
- package/dist/task/TaskRegistry.d.ts.map +1 -1
- package/dist/task/TaskRunner.d.ts +0 -41
- package/dist/task/TaskRunner.d.ts.map +1 -1
- package/dist/task/WhileTask.d.ts +3 -89
- package/dist/task/WhileTask.d.ts.map +1 -1
- package/dist/task/index.d.ts +6 -6
- package/dist/task/index.d.ts.map +1 -1
- package/dist/task-graph/Conversions.d.ts +10 -0
- package/dist/task-graph/Conversions.d.ts.map +1 -1
- package/dist/task-graph/Dataflow.d.ts +1 -29
- package/dist/task-graph/Dataflow.d.ts.map +1 -1
- package/dist/task-graph/TaskGraph.d.ts +0 -29
- package/dist/task-graph/TaskGraph.d.ts.map +1 -1
- package/dist/task-graph/TaskGraphRunner.d.ts +3 -65
- package/dist/task-graph/TaskGraphRunner.d.ts.map +1 -1
- package/dist/task-graph/Workflow.d.ts +1 -60
- package/dist/task-graph/Workflow.d.ts.map +1 -1
- package/package.json +7 -7
- package/src/EXECUTION_MODEL.md +4 -4
package/dist/task/Task.d.ts
CHANGED
|
@@ -26,25 +26,10 @@ import { TaskStatus } from "./TaskTypes";
|
|
|
26
26
|
* 3. Delegating the running logic to a TaskRunner
|
|
27
27
|
*/
|
|
28
28
|
export declare class Task<Input extends TaskInput = TaskInput, Output extends TaskOutput = TaskOutput, Config extends TaskConfig = TaskConfig> implements ITask<Input, Output, Config> {
|
|
29
|
-
/**
|
|
30
|
-
* The type identifier for this task class
|
|
31
|
-
*/
|
|
32
29
|
static type: TaskTypeName;
|
|
33
|
-
/**
|
|
34
|
-
* The category this task belongs to
|
|
35
|
-
*/
|
|
36
30
|
static category: string;
|
|
37
|
-
/**
|
|
38
|
-
* The title of this task
|
|
39
|
-
*/
|
|
40
31
|
static title: string;
|
|
41
|
-
/**
|
|
42
|
-
* The description of this task
|
|
43
|
-
*/
|
|
44
32
|
static description: string;
|
|
45
|
-
/**
|
|
46
|
-
* Whether this task has side effects
|
|
47
|
-
*/
|
|
48
33
|
static cacheable: boolean;
|
|
49
34
|
/**
|
|
50
35
|
* Version number for this task class, used to bust the output cache when the task's
|
|
@@ -101,13 +86,7 @@ export declare class Task<Input extends TaskInput = TaskInput, Output extends Ta
|
|
|
101
86
|
* Subclasses override to declare their permission requirements.
|
|
102
87
|
*/
|
|
103
88
|
static entitlements(): TaskEntitlements;
|
|
104
|
-
/**
|
|
105
|
-
* Input schema for this task
|
|
106
|
-
*/
|
|
107
89
|
static inputSchema(): DataPortSchema;
|
|
108
|
-
/**
|
|
109
|
-
* Output schema for this task
|
|
110
|
-
*/
|
|
111
90
|
static outputSchema(): DataPortSchema;
|
|
112
91
|
/**
|
|
113
92
|
* Config schema for this task. Subclasses that add config properties MUST override this
|
|
@@ -138,14 +117,7 @@ export declare class Task<Input extends TaskInput = TaskInput, Output extends Ta
|
|
|
138
117
|
* and subscribe to their streaming events.
|
|
139
118
|
*/
|
|
140
119
|
parentGraph?: TaskGraph;
|
|
141
|
-
/**
|
|
142
|
-
* Task runner for handling the task execution
|
|
143
|
-
*/
|
|
144
120
|
protected _runner: TaskRunner<Input, Output, Config> | undefined;
|
|
145
|
-
/**
|
|
146
|
-
* Gets the task runner instance
|
|
147
|
-
* Creates a new one if it doesn't exist
|
|
148
|
-
*/
|
|
149
121
|
get runner(): TaskRunner<Input, Output, Config>;
|
|
150
122
|
/**
|
|
151
123
|
* Runs the task and returns the output
|
|
@@ -158,34 +130,13 @@ export declare class Task<Input extends TaskInput = TaskInput, Output extends Ta
|
|
|
158
130
|
*/
|
|
159
131
|
run(overrides?: Partial<Input>, runConfig?: Partial<IRunConfig>): Promise<Output>;
|
|
160
132
|
/**
|
|
161
|
-
* Runs the task in preview mode
|
|
162
|
-
* Delegates to the task runner
|
|
163
|
-
*
|
|
164
|
-
* @param overrides Optional input overrides
|
|
165
|
-
* @returns The task output
|
|
133
|
+
* Runs the task in preview mode. Delegates to the task runner.
|
|
166
134
|
*/
|
|
167
135
|
runPreview(overrides?: Partial<Input>): Promise<Output>;
|
|
168
|
-
/**
|
|
169
|
-
* Aborts task execution
|
|
170
|
-
* Delegates to the task runner
|
|
171
|
-
*/
|
|
172
136
|
abort(): void;
|
|
173
|
-
/**
|
|
174
|
-
* Disables task execution
|
|
175
|
-
* Delegates to the task runner
|
|
176
|
-
*/
|
|
177
137
|
disable(): Promise<void>;
|
|
178
|
-
/**
|
|
179
|
-
* Gets input schema for this task
|
|
180
|
-
*/
|
|
181
138
|
inputSchema(): DataPortSchema;
|
|
182
|
-
/**
|
|
183
|
-
* Gets output schema for this task
|
|
184
|
-
*/
|
|
185
139
|
outputSchema(): DataPortSchema;
|
|
186
|
-
/**
|
|
187
|
-
* Gets config schema for this task
|
|
188
|
-
*/
|
|
189
140
|
configSchema(): DataPortSchema;
|
|
190
141
|
/**
|
|
191
142
|
* Gets entitlements for this task instance.
|
|
@@ -258,52 +209,28 @@ export declare class Task<Input extends TaskInput = TaskInput, Output extends Ta
|
|
|
258
209
|
* This is the result of the task execution.
|
|
259
210
|
*/
|
|
260
211
|
runOutputData: Record<string, any>;
|
|
261
|
-
/**
|
|
262
|
-
* The configuration of the task
|
|
263
|
-
*/
|
|
264
212
|
config: Config;
|
|
265
213
|
/**
|
|
266
214
|
* Frozen snapshot of config at construction time, used by toJSON and
|
|
267
215
|
* as the resolution source for re-runs (so fresh lookups use original IDs).
|
|
268
216
|
*/
|
|
269
217
|
readonly originalConfig: Readonly<Record<string, unknown>> | undefined;
|
|
270
|
-
/**
|
|
271
|
-
* Task id from config (read-only).
|
|
272
|
-
*/
|
|
273
218
|
get id(): unknown;
|
|
274
219
|
/**
|
|
275
220
|
* Runtime configuration (not serialized with the task).
|
|
276
221
|
* Set via the constructor's third argument or mutated by the graph runner.
|
|
277
222
|
*/
|
|
278
223
|
runConfig: Partial<IRunConfig>;
|
|
279
|
-
/**
|
|
280
|
-
* Current status of the task
|
|
281
|
-
*/
|
|
282
224
|
status: TaskStatus;
|
|
283
225
|
/**
|
|
284
226
|
* Current progress, 0..100 for measured progress, `undefined` for
|
|
285
227
|
* indeterminate. Initialized to 0 (not started).
|
|
286
228
|
*/
|
|
287
229
|
progress: number | undefined;
|
|
288
|
-
/**
|
|
289
|
-
* When the task was created
|
|
290
|
-
*/
|
|
291
230
|
createdAt: Date;
|
|
292
|
-
/**
|
|
293
|
-
* When the task started execution
|
|
294
|
-
*/
|
|
295
231
|
startedAt?: Date;
|
|
296
|
-
/**
|
|
297
|
-
* When the task completed execution
|
|
298
|
-
*/
|
|
299
232
|
completedAt?: Date;
|
|
300
|
-
/**
|
|
301
|
-
* Error that occurred during task execution, if any
|
|
302
|
-
*/
|
|
303
233
|
error?: TaskError;
|
|
304
|
-
/**
|
|
305
|
-
* Event emitter for task lifecycle events
|
|
306
|
-
*/
|
|
307
234
|
get events(): EventEmitter<TaskEventListeners>;
|
|
308
235
|
protected _events: EventEmitter<TaskEventListeners> | undefined;
|
|
309
236
|
/**
|
|
@@ -313,13 +240,7 @@ export declare class Task<Input extends TaskInput = TaskInput, Output extends Ta
|
|
|
313
240
|
* @param runConfig Runtime configuration for the task
|
|
314
241
|
*/
|
|
315
242
|
constructor(config?: NoInfer<Partial<Config>>, runConfig?: NoInfer<Partial<IRunConfig>>);
|
|
316
|
-
/**
|
|
317
|
-
* Gets default input values from input schema
|
|
318
|
-
*/
|
|
319
243
|
getDefaultInputsFromStaticInputDefinitions(): Partial<Input>;
|
|
320
|
-
/**
|
|
321
|
-
* Resets input data to defaults
|
|
322
|
-
*/
|
|
323
244
|
resetInputData(): void;
|
|
324
245
|
/**
|
|
325
246
|
* Smart clone that deep-clones plain objects and arrays while preserving
|
|
@@ -339,17 +260,7 @@ export declare class Task<Input extends TaskInput = TaskInput, Output extends Ta
|
|
|
339
260
|
* @returns A cloned object with class instances preserved by reference
|
|
340
261
|
*/
|
|
341
262
|
private smartClone;
|
|
342
|
-
/**
|
|
343
|
-
* Sets the default input values for the task
|
|
344
|
-
*
|
|
345
|
-
* @param defaults The default input values to set
|
|
346
|
-
*/
|
|
347
263
|
setDefaults(defaults: Partial<Input>): void;
|
|
348
|
-
/**
|
|
349
|
-
* Sets input values for the task
|
|
350
|
-
*
|
|
351
|
-
* @param input Input values to set
|
|
352
|
-
*/
|
|
353
264
|
setInput(input: Partial<Input>): void;
|
|
354
265
|
/**
|
|
355
266
|
* Adds/merges input data during graph execution.
|
|
@@ -370,29 +281,14 @@ export declare class Task<Input extends TaskInput = TaskInput, Output extends Ta
|
|
|
370
281
|
* @returns The (possibly narrowed) input
|
|
371
282
|
*/
|
|
372
283
|
narrowInput(input: Partial<Input>, _registry: ServiceRegistry): Promise<Partial<Input>>;
|
|
373
|
-
/**
|
|
374
|
-
* Subscribes to an event
|
|
375
|
-
*/
|
|
376
284
|
subscribe<Event extends TaskEvents>(name: Event, fn: TaskEventListener<Event>): () => void;
|
|
377
|
-
/**
|
|
378
|
-
* Registers an event listener
|
|
379
|
-
*/
|
|
380
285
|
on<Event extends TaskEvents>(name: Event, fn: TaskEventListener<Event>): void;
|
|
381
|
-
/**
|
|
382
|
-
* Removes an event listener
|
|
383
|
-
*/
|
|
384
286
|
off<Event extends TaskEvents>(name: Event, fn: TaskEventListener<Event>): void;
|
|
385
|
-
/**
|
|
386
|
-
* Registers a one-time event listener
|
|
387
|
-
*/
|
|
388
287
|
once<Event extends TaskEvents>(name: Event, fn: TaskEventListener<Event>): void;
|
|
389
288
|
/**
|
|
390
289
|
* Returns a promise that resolves when the specified event is emitted
|
|
391
290
|
*/
|
|
392
291
|
waitOn<Event extends TaskEvents>(name: Event): Promise<TaskEventParameters<Event>>;
|
|
393
|
-
/**
|
|
394
|
-
* Emits an event
|
|
395
|
-
*/
|
|
396
292
|
emit<Event extends TaskEvents>(name: Event, ...args: TaskEventParameters<Event>): void;
|
|
397
293
|
/**
|
|
398
294
|
* Emits a schemaChange event when the task's input or output schema changes.
|
|
@@ -502,7 +398,7 @@ export declare class Task<Input extends TaskInput = TaskInput, Output extends Ta
|
|
|
502
398
|
regenerateGraph(): void;
|
|
503
399
|
}
|
|
504
400
|
/**
|
|
505
|
-
* Test helper: clear the
|
|
401
|
+
* Test helper: clear the dedup Set so each test case can re-trigger the
|
|
506
402
|
* one-time legacy-`cacheable` deprecation warning. Lives in production code
|
|
507
403
|
* (not a __tests__ file) so it's reachable from outside the package's test
|
|
508
404
|
* harness; the leading double-underscore signals "do not rely on this in
|
package/dist/task/Task.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Task.d.ts","sourceRoot":"","sources":["../../src/task/Task.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAa,YAAY,EAAS,MAAM,gBAAgB,CAAC;AAChE,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAExE,OAAO,EAAE,KAAK,WAAW,EAAwB,MAAM,sBAAsB,CAAC;AAE9E,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,KAAK,EAAE,eAAe,EAAE,sBAAsB,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAC1F,OAAO,EAAsB,KAAK,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC/E,OAAO,EAGL,SAAS,EAGV,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EACV,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACnB,UAAU,EACX,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE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AE,YAAY,CAAC,EAAE,cAAc,GAAG,IAAI,CAI5F;IAMD;;;;;;;;OAQG;IACH,OAAO,CAAC,MAAM,CAAC,mBAAmB;IAyBlC;;;;OAIG;IACH,OAAO,CAAC,8BAA8B;IAmBtC,SAAS,CAAC,MAAM,CAAC,uBAAuB,CAAC,MAAM,EAAE,cAAc;;;MAQ9D;IAED;;;;OAIG;IACH,SAAS,CAAC,MAAM,CAAC,kBAAkB,IAAI,UAAU,CA2BhD;IAED,SAAS,CAAC,kBAAkB,IAAI,UAAU,CAEzC;IAED;;OAEG;IACU,aAAa,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CA8BzD;IAMD;;;;OAIG;IACH,OAAO,CAAC,YAAY;IA4BpB;;;;OAIG;IACI,kBAAkB,IAAI,OAAO,CAEnC;IAED;;;;OAIG;IACI,MAAM,CAAC,QAAQ,CAAC,EAAE,oBAAoB,GAAG,iBAAiB,CAwDhE;IAED;;;;OAIG;IACI,gBAAgB,CAAC,OAAO,CAAC,EAAE,oBAAoB,GAAG,YAAY,CAGpE;IAMD;;;;;OAKG;IACI,WAAW,IAAI,OAAO,CAM5B;IAED,OAAO,CAAC,kBAAkB,CAExB;IAEF;;;;;;OAMG;IACH,SAAS,CAAC,SAAS,EAAE,SAAS,GAAG,SAAS,CAAa;IAEvD;;;OAGG;IACH,IAAI,QAAQ,CAAC,QAAQ,EAAE,SAAS,EAM/B;IAED;;;;;;;;;;OAUG;IACH,IAAI,QAAQ,IAAI,SAAS,CAMxB;IAED;;;;;;;OAOG;IACI,eAAe,IAAI,IAAI,CAU7B;CACF;AAED;;;;;;GAMG;AACH,wBAAgB,mCAAmC,IAAI,IAAI,CAI1D"}
|
package/dist/task/TaskError.d.ts
CHANGED
|
@@ -13,34 +13,23 @@ export declare class TaskError extends BaseError {
|
|
|
13
13
|
taskId?: unknown;
|
|
14
14
|
constructor(message: string);
|
|
15
15
|
}
|
|
16
|
-
/**
|
|
17
|
-
* A task configuration error
|
|
18
|
-
*
|
|
19
|
-
*/
|
|
20
16
|
export declare class TaskConfigurationError extends TaskError {
|
|
21
17
|
static readonly type: string;
|
|
22
18
|
constructor(message: string);
|
|
23
19
|
}
|
|
24
|
-
/**
|
|
25
|
-
* A task workflow error
|
|
26
|
-
*/
|
|
27
20
|
export declare class WorkflowError extends TaskError {
|
|
28
21
|
static readonly type: string;
|
|
29
22
|
constructor(message: string);
|
|
30
23
|
}
|
|
31
24
|
/**
|
|
32
|
-
* A task error
|
|
33
|
-
*
|
|
34
|
-
* Examples: task.abort() was called, or some other reason an abort signal was received
|
|
25
|
+
* A task error caused by a task being aborted (task.abort() or external signal).
|
|
35
26
|
*/
|
|
36
27
|
export declare class TaskAbortedError extends TaskError {
|
|
37
28
|
static readonly type: string;
|
|
38
29
|
constructor(message?: string);
|
|
39
30
|
}
|
|
40
31
|
/**
|
|
41
|
-
* A task error
|
|
42
|
-
*
|
|
43
|
-
* Examples: task.runConfig.timeout exceeded during execution
|
|
32
|
+
* A task error caused by exceeding `runConfig.timeout`.
|
|
44
33
|
*/
|
|
45
34
|
export declare class TaskTimeoutError extends TaskAbortedError {
|
|
46
35
|
static readonly type: string;
|
|
@@ -56,11 +45,6 @@ export declare class TaskGraphTimeoutError extends TaskTimeoutError {
|
|
|
56
45
|
static readonly type: string;
|
|
57
46
|
constructor(timeoutMs?: number);
|
|
58
47
|
}
|
|
59
|
-
/**
|
|
60
|
-
* A task error that is caused by a task failing
|
|
61
|
-
*
|
|
62
|
-
* Examples: task.run() threw an error
|
|
63
|
-
*/
|
|
64
48
|
export declare class TaskFailedError extends TaskError {
|
|
65
49
|
static readonly type: string;
|
|
66
50
|
constructor(message?: string);
|
|
@@ -72,25 +56,14 @@ export declare class JobTaskFailedError extends TaskFailedError {
|
|
|
72
56
|
code?: string;
|
|
73
57
|
constructor(err: JobError);
|
|
74
58
|
}
|
|
75
|
-
/**
|
|
76
|
-
* A task error that is caused by an error converting JSON to a Task
|
|
77
|
-
*/
|
|
78
59
|
export declare class TaskJSONError extends TaskError {
|
|
79
60
|
static readonly type: string;
|
|
80
61
|
constructor(message?: string);
|
|
81
62
|
}
|
|
82
|
-
/**
|
|
83
|
-
* A task error that is caused by invalid input data
|
|
84
|
-
*
|
|
85
|
-
* Examples: task.run() received invalid input data
|
|
86
|
-
*/
|
|
87
63
|
export declare class TaskInvalidInputError extends TaskError {
|
|
88
64
|
static readonly type: string;
|
|
89
65
|
constructor(message?: string);
|
|
90
66
|
}
|
|
91
|
-
/**
|
|
92
|
-
* Thrown when required entitlements are denied by the registered enforcer.
|
|
93
|
-
*/
|
|
94
67
|
export declare class TaskEntitlementError extends TaskError {
|
|
95
68
|
static readonly type: string;
|
|
96
69
|
constructor(message?: string);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TaskError.d.ts","sourceRoot":"","sources":["../../src/task/TaskError.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,qBAAa,SAAU,SAAQ,SAAS;IACtC,gBAAyB,IAAI,EAAE,MAAM,CAAe;IACpD,mEAAmE;IAC5D,QAAQ,CAAC,EAAE,MAAM,CAAC;IACzB,iEAAiE;IAC1D,MAAM,CAAC,EAAE,OAAO,CAAC;IACxB,YAAY,OAAO,EAAE,MAAM,EAE1B;CACF;AAED
|
|
1
|
+
{"version":3,"file":"TaskError.d.ts","sourceRoot":"","sources":["../../src/task/TaskError.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,qBAAa,SAAU,SAAQ,SAAS;IACtC,gBAAyB,IAAI,EAAE,MAAM,CAAe;IACpD,mEAAmE;IAC5D,QAAQ,CAAC,EAAE,MAAM,CAAC;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CAA2B;IAChE,YAAY,OAAO,GAAE,MAA6B,EAEjD;CACF;AAED,qBAAa,oBAAqB,SAAQ,SAAS;IACjD,gBAAyB,IAAI,EAAE,MAAM,CAA0B;IAC/D,YAAY,OAAO,GAAE,MAAuC,EAE3D;CACF;AAED;;;;GAIG;AACH,qBAAa,sBAAuB,SAAQ,SAAS;IACnD,gBAAyB,IAAI,EAAE,MAAM,CAA4B;IACjE,YAAY,QAAQ,EAAE,MAAM,EAK3B;CACF"}
|
package/dist/task/TaskJSON.d.ts
CHANGED
|
@@ -14,10 +14,6 @@ import { MapTaskConfig } from "./MapTask";
|
|
|
14
14
|
import { ReduceTaskConfig } from "./ReduceTask";
|
|
15
15
|
import { TaskConfig, TaskInput } from "./TaskTypes";
|
|
16
16
|
import { WhileTaskConfig } from "./WhileTask";
|
|
17
|
-
/**
|
|
18
|
-
* Represents a single task item in the JSON configuration.
|
|
19
|
-
* This structure defines how tasks should be configured in JSON format.
|
|
20
|
-
*/
|
|
21
17
|
export type JsonTaskConfig = Omit<TaskConfig & GraphAsTaskConfig & WhileTaskConfig & IteratorTaskConfig & ReduceTaskConfig & MapTaskConfig & ConditionalTaskConfig, "id" | "defaults" | "maxIterations"> & {
|
|
22
18
|
/**
|
|
23
19
|
* Optional in the JSON union because non-loop tasks don't carry it —
|
|
@@ -51,9 +47,6 @@ export type JsonTaskItem = {
|
|
|
51
47
|
/** Nested tasks for compound operations */
|
|
52
48
|
subtasks?: JsonTaskItem[];
|
|
53
49
|
};
|
|
54
|
-
/**
|
|
55
|
-
* Represents a task graph item, which can be a task or a subgraph
|
|
56
|
-
*/
|
|
57
50
|
export type TaskGraphItemJson = {
|
|
58
51
|
id: unknown;
|
|
59
52
|
type: string;
|
|
@@ -77,9 +70,6 @@ export interface TaskGraphJsonOptions {
|
|
|
77
70
|
/** When true, synthetic InputTask/OutputTask boundary nodes are added at each graph level */
|
|
78
71
|
readonly withBoundaryNodes?: boolean;
|
|
79
72
|
}
|
|
80
|
-
/**
|
|
81
|
-
* Options for deserializing tasks from JSON.
|
|
82
|
-
*/
|
|
83
73
|
export interface TaskDeserializationOptions {
|
|
84
74
|
/**
|
|
85
75
|
* Optional allowlist of task type names. When provided, only task types
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TaskJSON.d.ts","sourceRoot":"","sources":["../../src/task/TaskJSON.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEtD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAGnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"TaskJSON.d.ts","sourceRoot":"","sources":["../../src/task/TaskJSON.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEtD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAGnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;A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-29,17 +29,8 @@ declare function unregisterTask(type: string): boolean;
|
|
|
29
29
|
* It enables dynamic task instantiation and management across the application.
|
|
30
30
|
*/
|
|
31
31
|
export declare const TaskRegistry: {
|
|
32
|
-
/**
|
|
33
|
-
* Map containing all registered task constructors
|
|
34
|
-
*/
|
|
35
32
|
all: Map<string, AnyTaskConstructor>;
|
|
36
|
-
/**
|
|
37
|
-
* Function to register new task types
|
|
38
|
-
*/
|
|
39
33
|
registerTask: typeof registerTask;
|
|
40
|
-
/**
|
|
41
|
-
* Function to remove a registered task type
|
|
42
|
-
*/
|
|
43
34
|
unregisterTask: typeof unregisterTask;
|
|
44
35
|
};
|
|
45
36
|
/**
|
|
@@ -47,14 +38,9 @@ export declare const TaskRegistry: {
|
|
|
47
38
|
* Maps task type names to their constructor functions.
|
|
48
39
|
*/
|
|
49
40
|
export declare const TASK_CONSTRUCTORS: import("@workglow/util").ServiceToken<Map<string, AnyTaskConstructor>>;
|
|
50
|
-
/**
|
|
51
|
-
* Gets the global task constructors map.
|
|
52
|
-
* @returns The registered task constructors map
|
|
53
|
-
*/
|
|
54
41
|
export declare function getGlobalTaskConstructors(): Map<string, AnyTaskConstructor>;
|
|
55
42
|
/**
|
|
56
43
|
* Sets the global task constructors map, replacing the default TaskRegistry-backed factory.
|
|
57
|
-
* @param map The task constructors map to register
|
|
58
44
|
*/
|
|
59
45
|
export declare function setGlobalTaskConstructors(map: Map<string, AnyTaskConstructor>): void;
|
|
60
46
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TaskRegistry.d.ts","sourceRoot":"","sources":["../../src/task/TaskRegistry.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAML,eAAe,EAChB,MAAM,gBAAgB,CAAC;AAExB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAGhD,KAAK,kBAAkB,GAAG,gBAAgB,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;AAQ1D;;;;;;;;GAQG;AACH,iBAAS,YAAY,CAAC,SAAS,EAAE,kBAAkB,GAAG,IAAI,CA2BzD;AAED;;;;;;GAMG;AACH,iBAAS,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE7C;AAED;;;GAGG;AACH,eAAO,MAAM,YAAY
|
|
1
|
+
{"version":3,"file":"TaskRegistry.d.ts","sourceRoot":"","sources":["../../src/task/TaskRegistry.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAML,eAAe,EAChB,MAAM,gBAAgB,CAAC;AAExB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAGhD,KAAK,kBAAkB,GAAG,gBAAgB,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;AAQ1D;;;;;;;;GAQG;AACH,iBAAS,YAAY,CAAC,SAAS,EAAE,kBAAkB,GAAG,IAAI,CA2BzD;AAED;;;;;;GAMG;AACH,iBAAS,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE7C;AAED;;;GAGG;AACH,eAAO,MAAM,YAAY;;;;CAIxB,CAAC;AAMF;;;GAGG;AACH,eAAO,MAAM,iBAAiB,wEAC4C,CAAC;AAE3E,wBAAgB,yBAAyB,IAAI,GAAG,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAE3E;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,GAAG,CAAC,MAAM,EAAE,kBAAkB,CAAC,GAAG,IAAI,CAEpF;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,CAAC,EAAE,eAAe,GAAG,GAAG,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAG/F;AA8DD;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,GAAE,eAAuC,GAAG,IAAI,CAQ5F"}
|
|
@@ -19,14 +19,8 @@ import { TaskConfig, TaskInput, TaskOutput } from "./TaskTypes";
|
|
|
19
19
|
* Manages the execution lifecycle of individual tasks
|
|
20
20
|
*/
|
|
21
21
|
export declare class TaskRunner<Input extends TaskInput = TaskInput, Output extends TaskOutput = TaskOutput, Config extends TaskConfig = TaskConfig> implements ITaskRunner<Input, Output, Config> {
|
|
22
|
-
/**
|
|
23
|
-
* Whether the task is currently running
|
|
24
|
-
*/
|
|
25
22
|
protected running: boolean;
|
|
26
23
|
protected previewRunning: boolean;
|
|
27
|
-
/**
|
|
28
|
-
* The task to run
|
|
29
|
-
*/
|
|
30
24
|
readonly task: ITask<Input, Output, Config>;
|
|
31
25
|
/**
|
|
32
26
|
* Per-run state. Set by handleStart, cleared by handleComplete / handleError /
|
|
@@ -57,13 +51,7 @@ export declare class TaskRunner<Input extends TaskInput = TaskInput, Output exte
|
|
|
57
51
|
* Stream processor for the task (handles executeStream() event loop).
|
|
58
52
|
*/
|
|
59
53
|
protected readonly streamProcessor: StreamProcessor<Input, Output>;
|
|
60
|
-
/**
|
|
61
|
-
* The service registry for the task
|
|
62
|
-
*/
|
|
63
54
|
protected registry: ServiceRegistry;
|
|
64
|
-
/**
|
|
65
|
-
* Resource scope for this task run
|
|
66
|
-
*/
|
|
67
55
|
protected resourceScope?: ResourceScope;
|
|
68
56
|
/**
|
|
69
57
|
* True when `this.resourceScope` was auto-created by `run()` (caller did not
|
|
@@ -91,23 +79,8 @@ export declare class TaskRunner<Input extends TaskInput = TaskInput, Output exte
|
|
|
91
79
|
* across the process lifetime. Mirrors {@link Task.__cacheableDeprecationWarned}.
|
|
92
80
|
*/
|
|
93
81
|
private static __privateWithoutRunIdWarned;
|
|
94
|
-
/**
|
|
95
|
-
* Constructor for TaskRunner
|
|
96
|
-
* @param task The task to run
|
|
97
|
-
*/
|
|
98
82
|
constructor(task: ITask<Input, Output, Config>);
|
|
99
|
-
/**
|
|
100
|
-
* Runs the task and returns the output
|
|
101
|
-
* @param overrides Optional input overrides
|
|
102
|
-
* @param config Optional configuration overrides
|
|
103
|
-
* @returns The task output
|
|
104
|
-
*/
|
|
105
83
|
run(overrides?: Partial<Input>, config?: IRunConfig): Promise<Output>;
|
|
106
|
-
/**
|
|
107
|
-
* Runs the task in preview mode
|
|
108
|
-
* @param overrides Optional input overrides
|
|
109
|
-
* @returns The task output
|
|
110
|
-
*/
|
|
111
84
|
runPreview(overrides?: Partial<Input>): Promise<Output>;
|
|
112
85
|
/**
|
|
113
86
|
* Async iterator producing preview outputs as upstream tasks stream
|
|
@@ -132,18 +105,9 @@ export declare class TaskRunner<Input extends TaskInput = TaskInput, Output exte
|
|
|
132
105
|
* update.
|
|
133
106
|
*/
|
|
134
107
|
runPreviewStream(overrides?: Partial<Input>): AsyncIterable<Output>;
|
|
135
|
-
/**
|
|
136
|
-
* Aborts task execution
|
|
137
|
-
*/
|
|
138
108
|
abort(): void;
|
|
139
109
|
protected own<T extends Taskish<any, any>>(i: T): T;
|
|
140
|
-
/**
|
|
141
|
-
* Protected method to execute a task by delegating back to the task itself.
|
|
142
|
-
*/
|
|
143
110
|
protected executeTask(input: Input, ctx: TaskRunContext): Promise<Output | undefined>;
|
|
144
|
-
/**
|
|
145
|
-
* Protected method for preview execution delegation
|
|
146
|
-
*/
|
|
147
111
|
protected executeTaskPreview(input: Input, _ctx: TaskRunContext): Promise<Output | undefined>;
|
|
148
112
|
/**
|
|
149
113
|
* Resolves config and input schema annotations (e.g. mcp-server references)
|
|
@@ -200,11 +164,6 @@ export declare class TaskRunner<Input extends TaskInput = TaskInput, Output exte
|
|
|
200
164
|
*/
|
|
201
165
|
protected handleError(err: Error, ctx: TaskRunContext): Promise<void>;
|
|
202
166
|
protected handleErrorPreview(): Promise<void>;
|
|
203
|
-
/**
|
|
204
|
-
* Handles task progress update
|
|
205
|
-
* @param progress Progress value (0-100), or `undefined` for indeterminate
|
|
206
|
-
* @param args Additional arguments
|
|
207
|
-
*/
|
|
208
167
|
protected handleProgress(progress: number | undefined, message?: string, ...args: any[]): Promise<void>;
|
|
209
168
|
}
|
|
210
169
|
//# sourceMappingURL=TaskRunner.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TaskRunner.d.ts","sourceRoot":"","sources":["../../src/task/TaskRunner.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAIL,aAAa,EACb,eAAe,EAEhB,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE9C,OAAO,EAA0B,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAC/F,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AAEzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,OAAO,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAWjD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAc,MAAM,aAAa,CAAC;AAS5E;;;GAGG;AACH,qBAAa,UAAU,CACrB,KAAK,SAAS,SAAS,GAAG,SAAS,EACnC,MAAM,SAAS,UAAU,GAAG,UAAU,EACtC,MAAM,SAAS,UAAU,GAAG,UAAU,CACtC,YAAW,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC;IAC7C
|
|
1
|
+
{"version":3,"file":"TaskRunner.d.ts","sourceRoot":"","sources":["../../src/task/TaskRunner.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAIL,aAAa,EACb,eAAe,EAEhB,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE9C,OAAO,EAA0B,oBAAoB,EA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,WAAW,CAAC,MAAM,GAAE,UAAe,GAAG,OAAO,CAAC,cAAc,CAAC,CAwG5E;IACD,OAAO,CAAC,cAAc,CAKd;IAER,UAAgB,kBAAkB,IAAI,OAAO,CAAC,IAAI,CAAC,CAElD;IAED;;OAEG;IACH,SAAS,CAAC,iBAAiB,CAAC,GAAG,EAAE,cAAc,GAAG,IAAI,CAKrD;IAED;;;;;;;;;OASG;IACH,UAAgB,WAAW,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAkC9D;IAED,UAAgB,kBAAkB,IAAI,OAAO,CAAC,IAAI,CAAC,CAElD;IAED;;;;;OAKG;IACH,UAAgB,cAAc,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAmBjE;IAED,UAAgB,qBAAqB,IAAI,OAAO,CAAC,IAAI,CAAC,CAErD;IAED,UAAgB,aAAa,CAAC,GAAG,EAAE,cAAc,GAAG,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAa5E;IAEY,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAEpC;IAED;;;;;OAKG;IACH,UAAgB,WAAW,CAAC,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAoC1E;IAED,UAAgB,kBAAkB,IAAI,OAAO,CAAC,IAAI,CAAC,CAElD;IAED,UAAgB,cAAc,CAC5B,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,OAAO,CAAC,EAAE,MAAM,EAChB,GAAG,IAAI,EAAE,GAAG,EAAE,GACb,OAAO,CAAC,IAAI,CAAC,CAKf;CACF"}
|
package/dist/task/WhileTask.d.ts
CHANGED
|
@@ -101,9 +101,6 @@ export declare const whileTaskConfigSchema: {
|
|
|
101
101
|
readonly required: readonly ["maxIterations"];
|
|
102
102
|
readonly additionalProperties: false;
|
|
103
103
|
};
|
|
104
|
-
/**
|
|
105
|
-
* Configuration for WhileTask.
|
|
106
|
-
*/
|
|
107
104
|
export type WhileTaskConfig<Input extends TaskInput = TaskInput, Output extends TaskOutput = TaskOutput> = GraphAsTaskConfig<Input> & {
|
|
108
105
|
/**
|
|
109
106
|
* Condition function that determines whether to continue looping.
|
|
@@ -138,53 +135,15 @@ export type WhileTaskConfig<Input extends TaskInput = TaskInput, Output extends
|
|
|
138
135
|
};
|
|
139
136
|
/**
|
|
140
137
|
* WhileTask loops until a condition function returns false.
|
|
141
|
-
*
|
|
142
|
-
*
|
|
143
|
-
*
|
|
144
|
-
* - Polling until a condition is met
|
|
145
|
-
* - Convergence algorithms
|
|
146
|
-
* - Retry logic with conditions
|
|
147
|
-
*
|
|
148
|
-
* ## Features
|
|
149
|
-
*
|
|
150
|
-
* - Loops until condition returns false
|
|
151
|
-
* - Configurable maximum iterations (safety limit)
|
|
152
|
-
* - Passes output from each iteration to the next
|
|
153
|
-
* - Access to iteration count in condition function
|
|
154
|
-
*
|
|
155
|
-
* ## Usage
|
|
156
|
-
*
|
|
157
|
-
* ```typescript
|
|
158
|
-
* // Refine until quality threshold
|
|
159
|
-
* workflow
|
|
160
|
-
* .while({
|
|
161
|
-
* condition: (output, iteration) => output.quality < 0.9 && iteration < 10,
|
|
162
|
-
* maxIterations: 20
|
|
163
|
-
* })
|
|
164
|
-
* .refineResult()
|
|
165
|
-
* .evaluateQuality()
|
|
166
|
-
* .endWhile()
|
|
167
|
-
*
|
|
168
|
-
* // Retry until success
|
|
169
|
-
* workflow
|
|
170
|
-
* .while({
|
|
171
|
-
* condition: (output) => !output.success,
|
|
172
|
-
* maxIterations: 5
|
|
173
|
-
* })
|
|
174
|
-
* .attemptOperation()
|
|
175
|
-
* .endWhile()
|
|
176
|
-
* ```
|
|
177
|
-
*
|
|
178
|
-
* @template Input - The input type for the while task
|
|
179
|
-
* @template Output - The output type for the while task
|
|
180
|
-
* @template Config - The configuration type
|
|
138
|
+
* Used for iterative refinement, polling, convergence, or conditional retry.
|
|
139
|
+
* Output of each iteration is passed as input to the next when
|
|
140
|
+
* `chainIterations` is set; `maxIterations` caps total iterations.
|
|
181
141
|
*/
|
|
182
142
|
export declare class WhileTask<Input extends TaskInput = TaskInput, Output extends TaskOutput = TaskOutput, Config extends WhileTaskConfig<Input, Output> = WhileTaskConfig<Input, Output>> extends GraphAsTask<Input, Output, Config> {
|
|
183
143
|
static type: TaskTypeName;
|
|
184
144
|
static category: string;
|
|
185
145
|
static title: string;
|
|
186
146
|
static description: string;
|
|
187
|
-
/** This task has dynamic schemas based on the inner workflow */
|
|
188
147
|
static hasDynamicSchemas: boolean;
|
|
189
148
|
static configSchema(): DataPortSchema;
|
|
190
149
|
constructor(config?: Partial<Config>, runConfig?: Partial<IRunConfig>);
|
|
@@ -196,16 +155,10 @@ export declare class WhileTask<Input extends TaskInput = TaskInput, Output exten
|
|
|
196
155
|
* is unknown ahead of time.
|
|
197
156
|
*/
|
|
198
157
|
static getIterationContextSchema(): DataPortSchema;
|
|
199
|
-
/**
|
|
200
|
-
* Current iteration count during execution.
|
|
201
|
-
*/
|
|
202
158
|
protected _currentIteration: number;
|
|
203
159
|
canSerializeConfig(): boolean;
|
|
204
160
|
_runner: WhileTaskRunner<Input, Output, Config>;
|
|
205
161
|
get runner(): WhileTaskRunner<Input, Output, Config>;
|
|
206
|
-
/**
|
|
207
|
-
* Gets the condition function.
|
|
208
|
-
*/
|
|
209
162
|
get condition(): WhileConditionFn<Output> | undefined;
|
|
210
163
|
/**
|
|
211
164
|
* Gets the maximum iterations limit, resolved to a numeric cap. The raw
|
|
@@ -214,17 +167,8 @@ export declare class WhileTask<Input extends TaskInput = TaskInput, Output exten
|
|
|
214
167
|
* compare against it directly.
|
|
215
168
|
*/
|
|
216
169
|
get maxIterations(): number;
|
|
217
|
-
/**
|
|
218
|
-
* Whether to chain iteration outputs to inputs.
|
|
219
|
-
*/
|
|
220
170
|
get chainIterations(): boolean;
|
|
221
|
-
/**
|
|
222
|
-
* Gets the current iteration count.
|
|
223
|
-
*/
|
|
224
171
|
get currentIteration(): number;
|
|
225
|
-
/**
|
|
226
|
-
* Execute the while loop.
|
|
227
|
-
*/
|
|
228
172
|
/**
|
|
229
173
|
* Builds a condition function from the serialized condition fields in config.
|
|
230
174
|
*/
|
|
@@ -249,10 +193,6 @@ export declare class WhileTask<Input extends TaskInput = TaskInput, Output exten
|
|
|
249
193
|
* supporting iteration chaining.
|
|
250
194
|
*/
|
|
251
195
|
executeStream(input: Input, context: IExecuteContext): AsyncIterable<StreamEvent<Output>>;
|
|
252
|
-
/**
|
|
253
|
-
* Instance method to get the iteration context schema.
|
|
254
|
-
* Can be overridden by subclasses to customize iteration context.
|
|
255
|
-
*/
|
|
256
196
|
getIterationContextSchema(): DataPortSchema;
|
|
257
197
|
/**
|
|
258
198
|
* When chainIterations is true, the output schema from the previous
|
|
@@ -268,17 +208,8 @@ export declare class WhileTask<Input extends TaskInput = TaskInput, Output exten
|
|
|
268
208
|
* so that the dataflow compatibility check accepts array values.
|
|
269
209
|
*/
|
|
270
210
|
inputSchema(): DataPortSchema;
|
|
271
|
-
/**
|
|
272
|
-
* Static input schema for WhileTask.
|
|
273
|
-
*/
|
|
274
211
|
static inputSchema(): DataPortSchema;
|
|
275
|
-
/**
|
|
276
|
-
* Static output schema for WhileTask.
|
|
277
|
-
*/
|
|
278
212
|
static outputSchema(): DataPortSchema;
|
|
279
|
-
/**
|
|
280
|
-
* Instance output schema - returns final iteration output schema.
|
|
281
|
-
*/
|
|
282
213
|
outputSchema(): DataPortSchema;
|
|
283
214
|
}
|
|
284
215
|
declare module "../task-graph/Workflow" {
|
|
@@ -286,27 +217,10 @@ declare module "../task-graph/Workflow" {
|
|
|
286
217
|
/**
|
|
287
218
|
* Starts a while loop that continues until a condition is false.
|
|
288
219
|
* Use .endWhile() to close the loop and return to the parent workflow.
|
|
289
|
-
*
|
|
290
|
-
* @param config - Configuration for the while loop (must include condition)
|
|
291
|
-
* @returns A Workflow in loop builder mode for defining the loop body
|
|
292
|
-
*
|
|
293
|
-
* @example
|
|
294
|
-
* ```typescript
|
|
295
|
-
* workflow
|
|
296
|
-
* .while({
|
|
297
|
-
* condition: (output, iteration) => output.quality < 0.9,
|
|
298
|
-
* maxIterations: 10
|
|
299
|
-
* })
|
|
300
|
-
* .refineResult()
|
|
301
|
-
* .endWhile()
|
|
302
|
-
* ```
|
|
303
220
|
*/
|
|
304
221
|
while: CreateLoopWorkflow<TaskInput, TaskOutput, WhileTaskConfig<TaskInput, any>>;
|
|
305
222
|
/**
|
|
306
223
|
* Ends the while loop and returns to the parent workflow.
|
|
307
|
-
* Only callable on workflows in loop builder mode.
|
|
308
|
-
*
|
|
309
|
-
* @returns The parent workflow
|
|
310
224
|
*/
|
|
311
225
|
endWhile(): Workflow;
|
|
312
226
|
}
|