@workglow/task-graph 0.0.85 → 0.0.87
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/README.md +1 -53
- package/dist/browser.js +1451 -355
- package/dist/browser.js.map +28 -21
- package/dist/bun.js +1451 -355
- package/dist/bun.js.map +28 -21
- package/dist/common.d.ts +1 -16
- package/dist/common.d.ts.map +1 -1
- package/dist/node.js +1451 -355
- package/dist/node.js.map +28 -21
- package/dist/storage/TaskGraphTabularRepository.d.ts +2 -2
- package/dist/storage/TaskGraphTabularRepository.d.ts.map +1 -1
- package/dist/storage/TaskOutputTabularRepository.d.ts +2 -2
- package/dist/storage/TaskOutputTabularRepository.d.ts.map +1 -1
- package/dist/task/BatchTask.d.ts +154 -0
- package/dist/task/BatchTask.d.ts.map +1 -0
- package/dist/task/ConditionalTask.d.ts +1 -0
- package/dist/task/ConditionalTask.d.ts.map +1 -1
- package/dist/task/ForEachTask.d.ts +120 -0
- package/dist/task/ForEachTask.d.ts.map +1 -0
- package/dist/task/GraphAsTask.d.ts +2 -0
- package/dist/task/GraphAsTask.d.ts.map +1 -1
- package/dist/task/GraphAsTaskRunner.d.ts +0 -1
- package/dist/task/GraphAsTaskRunner.d.ts.map +1 -1
- package/dist/task/ITask.d.ts +5 -6
- package/dist/task/ITask.d.ts.map +1 -1
- package/dist/task/InputResolver.d.ts +34 -0
- package/dist/task/InputResolver.d.ts.map +1 -0
- package/dist/task/IteratorTask.d.ts +197 -0
- package/dist/task/IteratorTask.d.ts.map +1 -0
- package/dist/task/IteratorTaskRunner.d.ts +63 -0
- package/dist/task/IteratorTaskRunner.d.ts.map +1 -0
- package/dist/task/JobQueueTask.d.ts +3 -3
- package/dist/task/JobQueueTask.d.ts.map +1 -1
- package/dist/task/MapTask.d.ts +134 -0
- package/dist/task/MapTask.d.ts.map +1 -0
- package/dist/task/ReduceTask.d.ts +155 -0
- package/dist/task/ReduceTask.d.ts.map +1 -0
- package/dist/task/Task.d.ts +22 -11
- package/dist/task/Task.d.ts.map +1 -1
- package/dist/task/TaskEvents.d.ts +1 -1
- package/dist/task/TaskEvents.d.ts.map +1 -1
- package/dist/task/TaskJSON.d.ts +1 -4
- package/dist/task/TaskJSON.d.ts.map +1 -1
- package/dist/task/TaskRunner.d.ts +6 -5
- package/dist/task/TaskRunner.d.ts.map +1 -1
- package/dist/task/TaskTypes.d.ts +0 -4
- package/dist/task/TaskTypes.d.ts.map +1 -1
- package/dist/task/WhileTask.d.ts +176 -0
- package/dist/task/WhileTask.d.ts.map +1 -0
- package/dist/task/index.d.ts +35 -0
- package/dist/task/index.d.ts.map +1 -0
- package/dist/task-graph/Dataflow.d.ts +2 -3
- package/dist/task-graph/Dataflow.d.ts.map +1 -1
- 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 +4 -4
- package/dist/task-graph/TaskGraph.d.ts.map +1 -1
- package/dist/task-graph/TaskGraphRunner.d.ts +11 -18
- package/dist/task-graph/TaskGraphRunner.d.ts.map +1 -1
- package/dist/task-graph/Workflow.d.ts +95 -9
- package/dist/task-graph/Workflow.d.ts.map +1 -1
- package/package.json +7 -7
- package/src/storage/README.md +1 -1
- package/src/task/README.md +91 -15
- package/src/task-graph/README.md +0 -2
- package/dist/task/ArrayTask.d.ts +0 -77
- package/dist/task/ArrayTask.d.ts.map +0 -1
- package/dist/task/InputTask.d.ts +0 -27
- package/dist/task/InputTask.d.ts.map +0 -1
- package/dist/task/OutputTask.d.ts +0 -27
- package/dist/task/OutputTask.d.ts.map +0 -1
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
* Copyright 2025 Steven Roussey <sroussey@gmail.com>
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import { ConvertAllToOptionalArray } from "@workglow/util";
|
|
6
|
+
import { ConvertAllToOptionalArray, ServiceRegistry } from "@workglow/util";
|
|
7
7
|
import { TaskOutputRepository } from "../storage/TaskOutputRepository";
|
|
8
8
|
import { ITask } from "../task/ITask";
|
|
9
9
|
import { TaskError } from "../task/TaskError";
|
|
10
|
-
import {
|
|
10
|
+
import { TaskInput, TaskOutput, TaskStatus } from "../task/TaskTypes";
|
|
11
11
|
import { TaskGraph, TaskGraphRunConfig } from "./TaskGraph";
|
|
12
12
|
import { DependencyBasedScheduler, TopologicalScheduler } from "./TaskGraphScheduler";
|
|
13
13
|
export type GraphSingleTaskResult<T> = {
|
|
@@ -31,7 +31,7 @@ export type CompoundMergeStrategy = typeof PROPERTY_ARRAY | typeof GRAPH_RESULT_
|
|
|
31
31
|
export type GraphResult<Output, Merge extends CompoundMergeStrategy> = GraphResultMap<Output>[Merge];
|
|
32
32
|
/**
|
|
33
33
|
* Class for running a task graph
|
|
34
|
-
* Manages the execution of tasks in a task graph, including
|
|
34
|
+
* Manages the execution of tasks in a task graph, including caching
|
|
35
35
|
*/
|
|
36
36
|
export declare class TaskGraphRunner {
|
|
37
37
|
protected processScheduler: DependencyBasedScheduler;
|
|
@@ -41,10 +41,6 @@ export declare class TaskGraphRunner {
|
|
|
41
41
|
*/
|
|
42
42
|
protected running: boolean;
|
|
43
43
|
protected reactiveRunning: boolean;
|
|
44
|
-
/**
|
|
45
|
-
* Map of provenance input for each task
|
|
46
|
-
*/
|
|
47
|
-
protected provenanceInput: Map<unknown, TaskInput>;
|
|
48
44
|
/**
|
|
49
45
|
* The task graph to run
|
|
50
46
|
*/
|
|
@@ -53,6 +49,10 @@ export declare class TaskGraphRunner {
|
|
|
53
49
|
* Output cache repository
|
|
54
50
|
*/
|
|
55
51
|
protected outputCache?: TaskOutputRepository;
|
|
52
|
+
/**
|
|
53
|
+
* Service registry for this graph run
|
|
54
|
+
*/
|
|
55
|
+
protected registry: ServiceRegistry;
|
|
56
56
|
/**
|
|
57
57
|
* AbortController for cancelling graph execution
|
|
58
58
|
*/
|
|
@@ -107,19 +107,12 @@ export declare class TaskGraphRunner {
|
|
|
107
107
|
* @param task The task to copy input data to
|
|
108
108
|
*/
|
|
109
109
|
protected copyInputFromEdgesToNode(task: ITask): void;
|
|
110
|
-
/**
|
|
111
|
-
* Retrieves the provenance input for a task
|
|
112
|
-
* @param node The task to retrieve provenance input for
|
|
113
|
-
* @returns The provenance input for the task
|
|
114
|
-
*/
|
|
115
|
-
protected getInputProvenance(node: ITask): TaskInput;
|
|
116
110
|
/**
|
|
117
111
|
* Pushes the output of a task to its target tasks
|
|
118
112
|
* @param node The task that produced the output
|
|
119
113
|
* @param results The output of the task
|
|
120
|
-
* @param nodeProvenance The provenance input for the task
|
|
121
114
|
*/
|
|
122
|
-
protected pushOutputFromNodeToEdges(node: ITask, results: TaskOutput
|
|
115
|
+
protected pushOutputFromNodeToEdges(node: ITask, results: TaskOutput): Promise<void>;
|
|
123
116
|
/**
|
|
124
117
|
* Pushes the status of a task to its target edges
|
|
125
118
|
* @param node The task that produced the status
|
|
@@ -147,12 +140,12 @@ export declare class TaskGraphRunner {
|
|
|
147
140
|
*/
|
|
148
141
|
protected propagateDisabledStatus(graph: TaskGraph): void;
|
|
149
142
|
/**
|
|
150
|
-
* Runs a task
|
|
143
|
+
* Runs a task
|
|
151
144
|
* @param task The task to run
|
|
152
|
-
* @param
|
|
145
|
+
* @param input The input for the task
|
|
153
146
|
* @returns The output of the task
|
|
154
147
|
*/
|
|
155
|
-
protected
|
|
148
|
+
protected runTask<T>(task: ITask, input: TaskInput): Promise<GraphSingleTaskResult<T>>;
|
|
156
149
|
/**
|
|
157
150
|
* Resets a task
|
|
158
151
|
* @param graph The task graph to reset
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TaskGraphRunner.d.ts","sourceRoot":"","sources":["../../src/task-graph/TaskGraphRunner.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAEL,yBAAyB,
|
|
1
|
+
{"version":3,"file":"TaskGraphRunner.d.ts","sourceRoot":"","sources":["../../src/task-graph/Task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AAE,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"}
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
import { EventEmitter, type EventParameters } from "@workglow/util";
|
|
7
|
+
import { IteratorTask } from "../common";
|
|
7
8
|
import { TaskOutputRepository } from "../storage/TaskOutputRepository";
|
|
8
9
|
import { GraphAsTask } from "../task/GraphAsTask";
|
|
9
10
|
import type { ITask, ITaskConstructor } from "../task/ITask";
|
|
@@ -14,7 +15,33 @@ import { PipeFunction, Taskish } from "./Conversions";
|
|
|
14
15
|
import { IWorkflow } from "./IWorkflow";
|
|
15
16
|
import { TaskGraph } from "./TaskGraph";
|
|
16
17
|
import { CompoundMergeStrategy, type PropertyArrayGraphResult } from "./TaskGraphRunner";
|
|
17
|
-
export type CreateWorkflow<I extends DataPorts,
|
|
18
|
+
export type CreateWorkflow<I extends DataPorts, O extends DataPorts, C extends TaskConfig> = (input?: Partial<I>, config?: Partial<C>) => Workflow<I, O>;
|
|
19
|
+
export declare function CreateWorkflow<I extends DataPorts, O extends DataPorts, C extends TaskConfig = TaskConfig>(taskClass: ITaskConstructor<I, O, C>): CreateWorkflow<I, O, C>;
|
|
20
|
+
/**
|
|
21
|
+
* Type for loop workflow methods (forEach, map, batch, while, reduce).
|
|
22
|
+
* Represents the method signature with proper `this` context.
|
|
23
|
+
* Loop methods take only a config parameter - input is not used for loop tasks.
|
|
24
|
+
*/
|
|
25
|
+
export type CreateLoopWorkflow<I extends DataPorts, O extends DataPorts, C extends TaskConfig = TaskConfig> = (this: Workflow<I, O>, config?: Partial<C>) => Workflow<I, O>;
|
|
26
|
+
/**
|
|
27
|
+
* Factory function that creates a loop workflow method for a given task class.
|
|
28
|
+
* Returns a method that can be assigned to Workflow.prototype.
|
|
29
|
+
*
|
|
30
|
+
* @param taskClass - The iterator task class (ForEachTask, MapTask, etc.)
|
|
31
|
+
* @returns A method that creates the task and returns a loop builder workflow
|
|
32
|
+
*/
|
|
33
|
+
export declare function CreateLoopWorkflow<I extends DataPorts, O extends DataPorts, C extends TaskConfig = TaskConfig>(taskClass: ITaskConstructor<I, O, C>): CreateLoopWorkflow<I, O, C>;
|
|
34
|
+
/**
|
|
35
|
+
* Type for end loop workflow methods (endForEach, endMap, etc.).
|
|
36
|
+
*/
|
|
37
|
+
export type EndLoopWorkflow = (this: Workflow) => Workflow;
|
|
38
|
+
/**
|
|
39
|
+
* Factory function that creates an end loop workflow method.
|
|
40
|
+
*
|
|
41
|
+
* @param methodName - The name of the method (for error messages)
|
|
42
|
+
* @returns A method that finalizes the loop and returns to the parent workflow
|
|
43
|
+
*/
|
|
44
|
+
export declare function CreateEndLoopWorkflow(methodName: string): EndLoopWorkflow;
|
|
18
45
|
export type WorkflowEventListeners = {
|
|
19
46
|
changed: (id: unknown) => void;
|
|
20
47
|
reset: () => void;
|
|
@@ -29,19 +56,32 @@ export type WorkflowEventParameters<Event extends WorkflowEvents> = EventParamet
|
|
|
29
56
|
/**
|
|
30
57
|
* Class for building and managing a task graph
|
|
31
58
|
* Provides methods for adding tasks, connecting outputs to inputs, and running the task graph
|
|
59
|
+
*
|
|
60
|
+
* When used with a parent workflow (loop builder mode), this class redirects task additions
|
|
61
|
+
* to the iterator task's template graph until an end method (endMap, endForEach, etc.) is called.
|
|
32
62
|
*/
|
|
33
63
|
export declare class Workflow<Input extends DataPorts = DataPorts, Output extends DataPorts = DataPorts> implements IWorkflow<Input, Output> {
|
|
34
64
|
/**
|
|
35
65
|
* Creates a new Workflow
|
|
36
66
|
*
|
|
37
|
-
* @param
|
|
67
|
+
* @param cache - Optional repository for task outputs
|
|
68
|
+
* @param parent - Optional parent workflow (for loop builder mode)
|
|
69
|
+
* @param iteratorTask - Optional iterator task being configured (for loop builder mode)
|
|
38
70
|
*/
|
|
39
|
-
constructor(
|
|
71
|
+
constructor(cache?: TaskOutputRepository, parent?: Workflow, iteratorTask?: IteratorTask);
|
|
40
72
|
private _graph;
|
|
41
73
|
private _dataFlows;
|
|
42
74
|
private _error;
|
|
43
|
-
private
|
|
75
|
+
private _outputCache?;
|
|
44
76
|
private _abortController?;
|
|
77
|
+
private readonly _parentWorkflow?;
|
|
78
|
+
private readonly _iteratorTask?;
|
|
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,56 @@ 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
|
+
* Options for auto-connect operation.
|
|
202
|
+
*/
|
|
203
|
+
static readonly AutoConnectOptions: unique symbol;
|
|
204
|
+
/**
|
|
205
|
+
* Auto-connects two tasks based on their schemas.
|
|
206
|
+
* Uses multiple matching strategies:
|
|
207
|
+
* 1. Match by type AND port name (highest priority)
|
|
208
|
+
* 2. Match by specific type only (format, $id) for unmatched ports
|
|
209
|
+
* 3. Look back through earlier tasks for unmatched required inputs
|
|
210
|
+
*
|
|
211
|
+
* @param graph - The task graph to add dataflows to
|
|
212
|
+
* @param sourceTask - The source task to connect from
|
|
213
|
+
* @param targetTask - The target task to connect to
|
|
214
|
+
* @param options - Optional configuration for the auto-connect operation
|
|
215
|
+
* @returns Result containing matches made, any errors, and unmatched required inputs
|
|
216
|
+
*/
|
|
217
|
+
static autoConnect(graph: TaskGraph, sourceTask: ITask, targetTask: ITask, options?: {
|
|
218
|
+
/** Keys of inputs that are already provided and don't need connection */
|
|
219
|
+
readonly providedInputKeys?: Set<string>;
|
|
220
|
+
/** Earlier tasks to search for unmatched required inputs (in reverse chronological order) */
|
|
221
|
+
readonly earlierTasks?: readonly ITask[];
|
|
222
|
+
}): {
|
|
223
|
+
readonly matches: Map<string, string>;
|
|
224
|
+
readonly error?: string;
|
|
225
|
+
readonly unmatchedRequired: readonly string[];
|
|
226
|
+
};
|
|
227
|
+
/**
|
|
228
|
+
* Finalizes the template graph and sets it on the iterator task.
|
|
229
|
+
* Only applicable in loop builder mode.
|
|
230
|
+
*/
|
|
231
|
+
finalizeTemplate(): void;
|
|
232
|
+
/**
|
|
233
|
+
* Finalizes the template graph and returns the parent workflow.
|
|
234
|
+
* Only applicable in loop builder mode.
|
|
235
|
+
*
|
|
236
|
+
* @returns The parent workflow
|
|
237
|
+
* @throws WorkflowError if not in loop builder mode
|
|
238
|
+
*/
|
|
239
|
+
finalizeAndReturn(): Workflow;
|
|
150
240
|
}
|
|
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
241
|
//# sourceMappingURL=Workflow.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Workflow.d.ts","sourceRoot":"","sources":["../../src/task-graph/Workflow.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"Workflow.d.ts","sourceRoot":"","sources":["../../src/task-graph/Workflow.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,YAAY,EAAqB,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACvF,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,KAAK,EAAE,KAA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AAC,GAAG,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;IAO5E;;;;;;;;OAQG;IACI,OAAO,CAAC,CAAC,SAAS,SAAS,EAAE,CAAC,SAAS,SAAS,EAAE,CAAC,SAAS,UAAU,GAAG,UAAU,EACxF,SAAS,EAAE,gBAAgB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EACpC,KAAK,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,EAClB,MAAM,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,GAClB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAS1B;;OAEG;IACH,gBAAuB,kBAAkB,EAAE,OAAO,MAAM,CAAgC;IAExF;;;;;;;;;;;;OAYG;WACW,WAAW,CACvB,KAAK,EAAE,SAAS,EAChB,UAAU,EAAE,KAAK,EACjB,UAAU,EAAE,KAAK,EACjB,OAAO,CAAC,EAAE;QACR,yEAAyE;QACzE,QAAQ,CAAC,iBAAiB,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;QACzC,6FAA6F;QAC7F,QAAQ,CAAC,YAAY,CAAC,EAAE,SAAS,KAAK,EAAE,CAAC;KAC1C,GACA;QACD,QAAQ,CAAC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACtC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QACxB,QAAQ,CAAC,iBAAiB,EAAE,SAAS,MAAM,EAAE,CAAC;KAC/C;IA4UD;;;OAGG;IACI,gBAAgB,IAAI,IAAI;IAM/B;;;;;;OAMG;IACI,iBAAiB,IAAI,QAAQ;CAOrC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workglow/task-graph",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.87",
|
|
5
5
|
"description": "Task graph management for Workglow, providing DAG construction, execution planning, and workflow orchestration.",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"watch": "concurrently -c 'auto' 'bun:watch-*'",
|
|
@@ -36,9 +36,9 @@
|
|
|
36
36
|
"access": "public"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
|
-
"@workglow/job-queue": "0.0.
|
|
40
|
-
"@workglow/storage": "0.0.
|
|
41
|
-
"@workglow/util": "0.0.
|
|
39
|
+
"@workglow/job-queue": "0.0.87",
|
|
40
|
+
"@workglow/storage": "0.0.87",
|
|
41
|
+
"@workglow/util": "0.0.87"
|
|
42
42
|
},
|
|
43
43
|
"peerDependenciesMeta": {
|
|
44
44
|
"@workglow/job-queue": {
|
|
@@ -52,8 +52,8 @@
|
|
|
52
52
|
}
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
|
-
"@workglow/job-queue": "0.0.
|
|
56
|
-
"@workglow/storage": "0.0.
|
|
57
|
-
"@workglow/util": "0.0.
|
|
55
|
+
"@workglow/job-queue": "0.0.87",
|
|
56
|
+
"@workglow/storage": "0.0.87",
|
|
57
|
+
"@workglow/util": "0.0.87"
|
|
58
58
|
}
|
|
59
59
|
}
|
package/src/storage/README.md
CHANGED
|
@@ -51,7 +51,7 @@ Tests include:
|
|
|
51
51
|
|
|
52
52
|
## Architecture Notes
|
|
53
53
|
|
|
54
|
-
- All repositories use a
|
|
54
|
+
- All repositories use a TabularStorage pattern internally
|
|
55
55
|
- Schema definitions are centralized in `TaskGraphSchema`/`TaskOutputSchema`
|
|
56
56
|
- Primary key configurations are managed through `PrimaryKeyNames` constants
|
|
57
57
|
- Event emitters provide hooks for monitoring repository operations
|
package/src/task/README.md
CHANGED
|
@@ -7,12 +7,12 @@ This module provides a flexible task processing system with support for various
|
|
|
7
7
|
- [Task Types](#task-types)
|
|
8
8
|
- [A Simple Task](#a-simple-task)
|
|
9
9
|
- [GraphAsTask](#graphastask)
|
|
10
|
-
- [ArrayTask](#arraytask)
|
|
11
10
|
- [Job Queue Tasks](#job-queue-tasks)
|
|
12
11
|
- [Task Lifecycle](#task-lifecycle)
|
|
13
12
|
- [Event Handling](#event-handling)
|
|
14
13
|
- [Input/Output Schemas](#inputoutput-schemas)
|
|
15
14
|
- [Registry \& Queues](#registry--queues)
|
|
15
|
+
- [Input Resolution](#input-resolution)
|
|
16
16
|
- [Error Handling](#error-handling)
|
|
17
17
|
- [Testing](#testing)
|
|
18
18
|
- [Installation](#installation)
|
|
@@ -22,7 +22,6 @@ This module provides a flexible task processing system with support for various
|
|
|
22
22
|
### Core Classes
|
|
23
23
|
|
|
24
24
|
- `Task`: Base class implementing core task functionality
|
|
25
|
-
- `ArrayTask`: Executes a task or a task with multiple inputs in parallel with a subGraph
|
|
26
25
|
- `JobQueueTask`: Integrates with job queue system for distributed processing
|
|
27
26
|
|
|
28
27
|
## Task Types
|
|
@@ -30,6 +29,9 @@ This module provides a flexible task processing system with support for various
|
|
|
30
29
|
### A Simple Task
|
|
31
30
|
|
|
32
31
|
```typescript
|
|
32
|
+
import { Task, type DataPortSchema } from "@workglow/task-graph";
|
|
33
|
+
import { Type } from "@sinclair/typebox";
|
|
34
|
+
|
|
33
35
|
interface MyTaskInput {
|
|
34
36
|
input: number;
|
|
35
37
|
}
|
|
@@ -70,13 +72,6 @@ class MyTask extends Task {
|
|
|
70
72
|
### GraphAsTask
|
|
71
73
|
|
|
72
74
|
- GraphAsTask tasks are tasks that contain other tasks. They are represented as an internal TaskGraph.
|
|
73
|
-
- A ArrayTask is a compound task that can run a task as normal, or if the inputs are an array and the input definition has x-replicate=true defined for that input, then the task will run parallel copies with a subGraph.
|
|
74
|
-
|
|
75
|
-
### ArrayTask
|
|
76
|
-
|
|
77
|
-
- ArrayTask is a task that can run a task as normal, or if the inputs are an arryay and the input definition has x-replicate=true, then the task will run parallel copies with a subGraph.
|
|
78
|
-
- The subGraph is a TaskGraph that is created from the inputs of the task.
|
|
79
|
-
- The results of the subGraph are combined such that the outputs are turned into arrays.
|
|
80
75
|
|
|
81
76
|
### Job Queue Tasks
|
|
82
77
|
|
|
@@ -178,6 +173,15 @@ static outputSchema = () => {
|
|
|
178
173
|
}),
|
|
179
174
|
}) satisfies DataPortSchema;
|
|
180
175
|
};
|
|
176
|
+
|
|
177
|
+
type MyInput = FromSchema<typeof MyInputSchema>;
|
|
178
|
+
type MyOutput = FromSchema<typeof MyOutputSchema>;
|
|
179
|
+
|
|
180
|
+
class MyTask extends Task<MyInput, MyOutput> {
|
|
181
|
+
static readonly type = "MyTask";
|
|
182
|
+
static inputSchema = () => MyInputSchema;
|
|
183
|
+
static outputSchema = () => MyOutputSchema;
|
|
184
|
+
}
|
|
181
185
|
```
|
|
182
186
|
|
|
183
187
|
### Using Zod
|
|
@@ -201,13 +205,16 @@ const outputSchemaZod = z.object({
|
|
|
201
205
|
type MyInput = z.infer<typeof inputSchemaZod>;
|
|
202
206
|
type MyOutput = z.infer<typeof outputSchemaZod>;
|
|
203
207
|
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
208
|
+
class MyTask extends Task<MyInput, MyOutput> {
|
|
209
|
+
static readonly type = "MyTask";
|
|
210
|
+
static inputSchema = () => {
|
|
211
|
+
return inputSchemaZod.toJSONSchema() as DataPortSchema;
|
|
212
|
+
};
|
|
207
213
|
|
|
208
|
-
static outputSchema = () => {
|
|
209
|
-
|
|
210
|
-
};
|
|
214
|
+
static outputSchema = () => {
|
|
215
|
+
return outputSchemaZod.toJSONSchema() as DataPortSchema;
|
|
216
|
+
};
|
|
217
|
+
}
|
|
211
218
|
```
|
|
212
219
|
|
|
213
220
|
## Registry & Queues
|
|
@@ -226,6 +233,75 @@ const queue = getTaskQueueRegistry().getQueue("processing");
|
|
|
226
233
|
queue.add(new MyJobTask());
|
|
227
234
|
```
|
|
228
235
|
|
|
236
|
+
## Input Resolution
|
|
237
|
+
|
|
238
|
+
The TaskRunner automatically resolves schema-annotated string inputs to their corresponding instances before task execution. This allows tasks to accept either string identifiers (like `"my-model"` or `"my-repository"`) or direct object instances, providing flexibility in how tasks are configured.
|
|
239
|
+
|
|
240
|
+
### How It Works
|
|
241
|
+
|
|
242
|
+
When a task's input schema includes properties with `format` annotations (such as `"model"`, `"model:TaskName"`, or `"storage:tabular"`), the TaskRunner inspects each input property:
|
|
243
|
+
|
|
244
|
+
- **String values** are looked up in the appropriate registry and resolved to instances
|
|
245
|
+
- **Object values** (already instances) pass through unchanged
|
|
246
|
+
|
|
247
|
+
This resolution happens automatically before `validateInput()` is called, so by the time `execute()` runs, all annotated inputs are guaranteed to be resolved objects.
|
|
248
|
+
|
|
249
|
+
### Example: Task with Repository Input
|
|
250
|
+
|
|
251
|
+
```typescript
|
|
252
|
+
import { Task } from "@workglow/task-graph";
|
|
253
|
+
import { TypeTabularStorage } from "@workglow/storage";
|
|
254
|
+
|
|
255
|
+
class DataProcessingTask extends Task<{ repository: ITabularStorage; query: string }> {
|
|
256
|
+
static readonly type = "DataProcessingTask";
|
|
257
|
+
|
|
258
|
+
static inputSchema() {
|
|
259
|
+
return {
|
|
260
|
+
type: "object",
|
|
261
|
+
properties: {
|
|
262
|
+
repository: TypeTabularStorage({
|
|
263
|
+
title: "Data Source",
|
|
264
|
+
description: "Repository to query",
|
|
265
|
+
}),
|
|
266
|
+
query: { type: "string", title: "Query" },
|
|
267
|
+
},
|
|
268
|
+
required: ["repository", "query"],
|
|
269
|
+
};
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
async execute(input: DataProcessingTaskInput, context: IExecuteContext) {
|
|
273
|
+
// repository is guaranteed to be an ITabularStorage instance
|
|
274
|
+
const data = await input.repository.getAll();
|
|
275
|
+
return { results: data };
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
// Usage with string ID (resolved automatically)
|
|
280
|
+
const task = new DataProcessingTask();
|
|
281
|
+
await task.run({ repository: "my-registered-repo", query: "test" });
|
|
282
|
+
|
|
283
|
+
// Usage with direct instance (passed through)
|
|
284
|
+
await task.run({ repository: myRepositoryInstance, query: "test" });
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
### Registering Custom Resolvers
|
|
288
|
+
|
|
289
|
+
Extend the input resolution system by registering custom resolvers for new format prefixes:
|
|
290
|
+
|
|
291
|
+
```typescript
|
|
292
|
+
import { registerInputResolver } from "@workglow/util";
|
|
293
|
+
|
|
294
|
+
// Register a resolver for "config:*" formats
|
|
295
|
+
registerInputResolver("config", async (id, format, registry) => {
|
|
296
|
+
const configRepo = registry.get(CONFIG_REPOSITORY);
|
|
297
|
+
const config = await configRepo.findById(id);
|
|
298
|
+
if (!config) {
|
|
299
|
+
throw new Error(`Configuration "${id}" not found`);
|
|
300
|
+
}
|
|
301
|
+
return config;
|
|
302
|
+
});
|
|
303
|
+
```
|
|
304
|
+
|
|
229
305
|
## Error Handling
|
|
230
306
|
|
|
231
307
|
```typescript
|
package/src/task-graph/README.md
CHANGED
|
@@ -25,7 +25,6 @@ A robust TypeScript library for creating and managing task graphs with dependenc
|
|
|
25
25
|
- Directed Acyclic Graph (DAG) structure for task dependencies
|
|
26
26
|
- Data flow management between task inputs/outputs
|
|
27
27
|
- Workflow builder API with fluent interface
|
|
28
|
-
- Provenance tracking
|
|
29
28
|
- Caching of task results (same run on same input returns cached result)
|
|
30
29
|
- Error handling and abortion support
|
|
31
30
|
- Serial and parallel execution patterns
|
|
@@ -87,7 +86,6 @@ const output = await workflow.run();
|
|
|
87
86
|
|
|
88
87
|
- Connects task outputs to inputs
|
|
89
88
|
- Value propagation
|
|
90
|
-
- Provenance tracking
|
|
91
89
|
|
|
92
90
|
### TaskGraphRunner
|
|
93
91
|
|
package/dist/task/ArrayTask.d.ts
DELETED
|
@@ -1,77 +0,0 @@
|
|
|
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 { GraphResultArray } from "../task-graph/TaskGraphRunner";
|
|
8
|
-
import { GraphAsTask } from "./GraphAsTask";
|
|
9
|
-
import { GraphAsTaskRunner } from "./GraphAsTaskRunner";
|
|
10
|
-
import { JsonTaskItem, TaskGraphItemJson } from "./TaskJSON";
|
|
11
|
-
import { TaskConfig, TaskInput, TaskOutput } from "./TaskTypes";
|
|
12
|
-
/**
|
|
13
|
-
* ArrayTask is a compound task that either:
|
|
14
|
-
* 1. Executes directly if all inputs are non-arrays
|
|
15
|
-
* 2. Creates a subGraph with one task instance per array element if any input is an array
|
|
16
|
-
* 3. Creates all combinations if multiple inputs are arrays
|
|
17
|
-
*/
|
|
18
|
-
export declare class ArrayTask<Input extends TaskInput = TaskInput, Output extends TaskOutput = TaskOutput, Config extends TaskConfig = TaskConfig> extends GraphAsTask<Input, Output, Config> {
|
|
19
|
-
/**
|
|
20
|
-
* The type identifier for this task class
|
|
21
|
-
*/
|
|
22
|
-
static type: string;
|
|
23
|
-
/**
|
|
24
|
-
* Make this task have results that look like an array
|
|
25
|
-
*/
|
|
26
|
-
static readonly compoundMerge: "PROPERTY_ARRAY";
|
|
27
|
-
/**
|
|
28
|
-
* Gets input schema for this task from the static inputSchema property, which is user defined (reverts GraphAsTask's override)
|
|
29
|
-
*/
|
|
30
|
-
inputSchema(): DataPortSchema;
|
|
31
|
-
/**
|
|
32
|
-
* Gets output schema for this task from the static outputSchema property, which is user defined (reverts GraphAsTask's override)
|
|
33
|
-
*/
|
|
34
|
-
outputSchema(): DataPortSchema;
|
|
35
|
-
/**
|
|
36
|
-
* Regenerates the task subgraph based on input arrays
|
|
37
|
-
*/
|
|
38
|
-
regenerateGraph(): void;
|
|
39
|
-
/**
|
|
40
|
-
* Generates all possible combinations of array inputs
|
|
41
|
-
* @param input Input object containing arrays
|
|
42
|
-
* @param inputMakeArray Keys of properties to generate combinations for
|
|
43
|
-
* @returns Array of input objects with all possible combinations
|
|
44
|
-
*/
|
|
45
|
-
protected generateCombinations(input: Input, inputMakeArray: Array<keyof Input>): Input[];
|
|
46
|
-
toJSON(): TaskGraphItemJson;
|
|
47
|
-
toDependencyJSON(): JsonTaskItem;
|
|
48
|
-
/**
|
|
49
|
-
* Create a custom runner for ArrayTask that overrides input passing behavior
|
|
50
|
-
* as inputs were already distributed to child tasks during graph regeneration
|
|
51
|
-
*/
|
|
52
|
-
_runner: ArrayTaskRunner<Input, Output, Config>;
|
|
53
|
-
/**
|
|
54
|
-
* Task runner for handling the task execution
|
|
55
|
-
*/
|
|
56
|
-
get runner(): ArrayTaskRunner<Input, Output, Config>;
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Custom runner for ArrayTask that passes empty input to child tasks.
|
|
60
|
-
* ArrayTask child tasks get their input values from their defaults (set during task creation),
|
|
61
|
-
* not from the parent task's input.
|
|
62
|
-
*/
|
|
63
|
-
declare class ArrayTaskRunner<Input extends TaskInput = TaskInput, Output extends TaskOutput = TaskOutput, Config extends TaskConfig = TaskConfig> extends GraphAsTaskRunner<Input, Output, Config> {
|
|
64
|
-
task: ArrayTask<Input, Output, Config>;
|
|
65
|
-
/**
|
|
66
|
-
* Override to pass empty input to subgraph.
|
|
67
|
-
* Child tasks will use their defaults instead of parent input.
|
|
68
|
-
*/
|
|
69
|
-
protected executeTaskChildren(_input: Input): Promise<GraphResultArray<Output>>;
|
|
70
|
-
/**
|
|
71
|
-
* Override to handle single task mode (no children) properly.
|
|
72
|
-
* In single task mode, call the task's executeReactive directly without fixInput.
|
|
73
|
-
*/
|
|
74
|
-
executeTaskReactive(input: Input, output: Output): Promise<Output>;
|
|
75
|
-
}
|
|
76
|
-
export {};
|
|
77
|
-
//# sourceMappingURL=ArrayTask.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ArrayTask.d.ts","sourceRoot":"","sources":["../../src/task/ArrayTask.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAS,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAG5D,O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AAE,MAAM,EAAE,MAAM,CAAC;IACxC,IAAI,EAAE,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IAE/C;;;OAGG;cACa,mBAAmB,CAAC,MAAM,EAAE,KAAK,GAAG,OAAO,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;IAIrF;;;OAGG;IACU,mBAAmB,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAWhF"}
|
package/dist/task/InputTask.d.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @copyright
|
|
3
|
-
* Copyright 2025 Steven Roussey
|
|
4
|
-
* All Rights Reserved
|
|
5
|
-
*/
|
|
6
|
-
import { IExecuteContext, IExecuteReactiveContext, Task, TaskConfig } from "@workglow/task-graph";
|
|
7
|
-
import type { DataPortSchema } from "@workglow/util";
|
|
8
|
-
export type InputTaskInput = Record<string, unknown>;
|
|
9
|
-
export type InputTaskOutput = Record<string, unknown>;
|
|
10
|
-
export type InputTaskConfig = TaskConfig & {
|
|
11
|
-
schema: DataPortSchema;
|
|
12
|
-
};
|
|
13
|
-
export declare class InputTask extends Task<InputTaskInput, InputTaskOutput, InputTaskConfig> {
|
|
14
|
-
static type: string;
|
|
15
|
-
static category: string;
|
|
16
|
-
static title: string;
|
|
17
|
-
static description: string;
|
|
18
|
-
static hasDynamicSchemas: boolean;
|
|
19
|
-
static cacheable: boolean;
|
|
20
|
-
static inputSchema(): DataPortSchema;
|
|
21
|
-
static outputSchema(): DataPortSchema;
|
|
22
|
-
inputSchema(): DataPortSchema;
|
|
23
|
-
outputSchema(): DataPortSchema;
|
|
24
|
-
execute(input: InputTaskInput, _context: IExecuteContext): Promise<InputTaskOutput>;
|
|
25
|
-
executeReactive(input: InputTaskInput, _output: InputTaskOutput, _context: IExecuteReactiveContext): Promise<InputTaskOutput>;
|
|
26
|
-
}
|
|
27
|
-
//# sourceMappingURL=InputTask.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"InputTask.d.ts","sourceRoot":"","sources":["../../src/task/InputTask.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,eAAe,EAAE,uBAAuB,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClG,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAErD,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AACrD,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AACtD,MAAM,MAAM,eAAe,GAAG,UAAU,GAAG;IACzC,MAAM,EAAE,cAAc,CAAC;CACxB,CAAC;AAEF,qBAAa,SAAU,SAAQ,IAAI,CAAC,cAAc,EAAE,eAAe,EAAE,eAAe,CAAC;IACnF,MAAM,CAAC,IAAI,SAAe;IAC1B,MAAM,CAAC,QAAQ,SAAkB;IACjC,MAAM,CAAC,KAAK,SAAW;IACvB,MAAM,CAAC,WAAW,SAAyB;IAC3C,MAAM,CAAC,iBAAiB,UAAQ;IAChC,MAAM,CAAC,SAAS,UAAS;WAEX,WAAW,IAAI,cAAc;WAQ7B,YAAY,IAAI,cAAc;IAQrC,WAAW,IAAI,cAAc;IAO7B,YAAY,IAAI,cAAc;IAOxB,OAAO,CAAC,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,eAAe;IAIxD,eAAe,CAC1B,KAAK,EAAE,cAAc,EACrB,OAAO,EAAE,eAAe,EACxB,QAAQ,EAAE,uBAAuB;CAIpC"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @copyright
|
|
3
|
-
* Copyright 2025 Steven Roussey
|
|
4
|
-
* All Rights Reserved
|
|
5
|
-
*/
|
|
6
|
-
import { IExecuteContext, IExecuteReactiveContext, Task, TaskConfig } from "@workglow/task-graph";
|
|
7
|
-
import type { DataPortSchema } from "@workglow/util";
|
|
8
|
-
export type OutputTaskInput = Record<string, unknown>;
|
|
9
|
-
export type OutputTaskOutput = Record<string, unknown>;
|
|
10
|
-
export type OutputTaskConfig = TaskConfig & {
|
|
11
|
-
schema: DataPortSchema;
|
|
12
|
-
};
|
|
13
|
-
export declare class OutputTask extends Task<OutputTaskInput, OutputTaskOutput, OutputTaskConfig> {
|
|
14
|
-
static type: string;
|
|
15
|
-
static category: string;
|
|
16
|
-
static title: string;
|
|
17
|
-
static description: string;
|
|
18
|
-
static hasDynamicSchemas: boolean;
|
|
19
|
-
static cacheable: boolean;
|
|
20
|
-
static inputSchema(): DataPortSchema;
|
|
21
|
-
static outputSchema(): DataPortSchema;
|
|
22
|
-
inputSchema(): DataPortSchema;
|
|
23
|
-
outputSchema(): DataPortSchema;
|
|
24
|
-
execute(input: OutputTaskInput, _context: IExecuteContext): Promise<OutputTaskOutput>;
|
|
25
|
-
executeReactive(input: OutputTaskInput, _output: OutputTaskOutput, _context: IExecuteReactiveContext): Promise<OutputTaskOutput>;
|
|
26
|
-
}
|
|
27
|
-
//# sourceMappingURL=OutputTask.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"OutputTask.d.ts","sourceRoot":"","sources":["../../src/task/OutputTask.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,eAAe,EAAE,uBAAuB,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClG,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAErD,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AACtD,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAEvD,MAAM,MAAM,gBAAgB,GAAG,UAAU,GAAG;IAC1C,MAAM,EAAE,cAAc,CAAC;CACxB,CAAC;AAEF,qBAAa,UAAW,SAAQ,IAAI,CAAC,eAAe,EAAE,gBAAgB,EAAE,gBAAgB,CAAC;IACvF,MAAM,CAAC,IAAI,SAAgB;IAC3B,MAAM,CAAC,QAAQ,SAAkB;IACjC,MAAM,CAAC,KAAK,SAAY;IACxB,MAAM,CAAC,WAAW,SAAuB;IACzC,MAAM,CAAC,iBAAiB,UAAQ;IAChC,MAAM,CAAC,SAAS,UAAS;WAEX,WAAW,IAAI,cAAc;WAQ7B,YAAY,IAAI,cAAc;IAQrC,WAAW,IAAI,cAAc;IAO7B,YAAY,IAAI,cAAc;IAOxB,OAAO,CAAC,KAAK,EAAE,eAAe,EAAE,QAAQ,EAAE,eAAe;IAIzD,eAAe,CAC1B,KAAK,EAAE,eAAe,EACtB,OAAO,EAAE,gBAAgB,EACzB,QAAQ,EAAE,uBAAuB;CAIpC"}
|