@workglow/task-graph 0.2.23 → 0.2.25

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.
Files changed (75) hide show
  1. package/dist/browser.js +1957 -1622
  2. package/dist/browser.js.map +38 -23
  3. package/dist/bun.js +1958 -1623
  4. package/dist/bun.js.map +38 -23
  5. package/dist/common.d.ts +14 -0
  6. package/dist/common.d.ts.map +1 -1
  7. package/dist/node.js +1958 -1623
  8. package/dist/node.js.map +38 -23
  9. package/dist/task/CacheCoordinator.d.ts +48 -0
  10. package/dist/task/CacheCoordinator.d.ts.map +1 -0
  11. package/dist/task/FallbackTask.d.ts +1 -0
  12. package/dist/task/FallbackTask.d.ts.map +1 -1
  13. package/dist/task/FallbackTaskRunner.d.ts +3 -2
  14. package/dist/task/FallbackTaskRunner.d.ts.map +1 -1
  15. package/dist/task/GraphAsTask.d.ts +1 -0
  16. package/dist/task/GraphAsTask.d.ts.map +1 -1
  17. package/dist/task/GraphAsTaskRunner.d.ts +4 -3
  18. package/dist/task/GraphAsTaskRunner.d.ts.map +1 -1
  19. package/dist/task/ITask.d.ts +19 -3
  20. package/dist/task/ITask.d.ts.map +1 -1
  21. package/dist/task/IteratorTaskRunner.d.ts +3 -2
  22. package/dist/task/IteratorTaskRunner.d.ts.map +1 -1
  23. package/dist/task/JobQueueFactory.d.ts +1 -0
  24. package/dist/task/JobQueueFactory.d.ts.map +1 -1
  25. package/dist/task/MapTask.d.ts +1 -0
  26. package/dist/task/MapTask.d.ts.map +1 -1
  27. package/dist/task/ReduceTask.d.ts +1 -0
  28. package/dist/task/ReduceTask.d.ts.map +1 -1
  29. package/dist/task/StreamProcessor.d.ts +38 -0
  30. package/dist/task/StreamProcessor.d.ts.map +1 -0
  31. package/dist/task/TaskRunContext.d.ts +33 -0
  32. package/dist/task/TaskRunContext.d.ts.map +1 -0
  33. package/dist/task/TaskRunner.d.ts +31 -47
  34. package/dist/task/TaskRunner.d.ts.map +1 -1
  35. package/dist/task/WhileTask.d.ts +1 -0
  36. package/dist/task/WhileTask.d.ts.map +1 -1
  37. package/dist/task/WhileTaskRunner.d.ts +3 -2
  38. package/dist/task/WhileTaskRunner.d.ts.map +1 -1
  39. package/dist/task-graph/Dataflow.d.ts +1 -1
  40. package/dist/task-graph/EdgeMaterializer.d.ts +88 -0
  41. package/dist/task-graph/EdgeMaterializer.d.ts.map +1 -0
  42. package/dist/task-graph/GraphSchemaUtils.d.ts +19 -0
  43. package/dist/task-graph/GraphSchemaUtils.d.ts.map +1 -1
  44. package/dist/task-graph/IWorkflow.d.ts +11 -1
  45. package/dist/task-graph/IWorkflow.d.ts.map +1 -1
  46. package/dist/task-graph/LoopBuilderContext.d.ts +60 -0
  47. package/dist/task-graph/LoopBuilderContext.d.ts.map +1 -0
  48. package/dist/task-graph/RunContext.d.ts +39 -0
  49. package/dist/task-graph/RunContext.d.ts.map +1 -0
  50. package/dist/task-graph/RunScheduler.d.ts +81 -0
  51. package/dist/task-graph/RunScheduler.d.ts.map +1 -0
  52. package/dist/task-graph/StreamPump.d.ts +122 -0
  53. package/dist/task-graph/StreamPump.d.ts.map +1 -0
  54. package/dist/task-graph/TaskGraph.d.ts +10 -2
  55. package/dist/task-graph/TaskGraph.d.ts.map +1 -1
  56. package/dist/task-graph/TaskGraphRunner.d.ts +31 -167
  57. package/dist/task-graph/TaskGraphRunner.d.ts.map +1 -1
  58. package/dist/task-graph/Workflow.d.ts +18 -99
  59. package/dist/task-graph/Workflow.d.ts.map +1 -1
  60. package/dist/task-graph/WorkflowBuilder.d.ts +93 -0
  61. package/dist/task-graph/WorkflowBuilder.d.ts.map +1 -0
  62. package/dist/task-graph/WorkflowCacheAdapter.d.ts +19 -0
  63. package/dist/task-graph/WorkflowCacheAdapter.d.ts.map +1 -0
  64. package/dist/task-graph/WorkflowEventBridge.d.ts +41 -0
  65. package/dist/task-graph/WorkflowEventBridge.d.ts.map +1 -0
  66. package/dist/task-graph/WorkflowFactories.d.ts +52 -0
  67. package/dist/task-graph/WorkflowFactories.d.ts.map +1 -0
  68. package/dist/task-graph/WorkflowPipe.d.ts +32 -0
  69. package/dist/task-graph/WorkflowPipe.d.ts.map +1 -0
  70. package/dist/task-graph/WorkflowRunContext.d.ts +27 -0
  71. package/dist/task-graph/WorkflowRunContext.d.ts.map +1 -0
  72. package/dist/task-graph/WorkflowTask.d.ts +19 -0
  73. package/dist/task-graph/WorkflowTask.d.ts.map +1 -0
  74. package/package.json +7 -7
  75. package/src/EXECUTION_MODEL.md +13 -5
@@ -4,6 +4,7 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
  import { GraphAsTaskRunner } from "./GraphAsTaskRunner";
7
+ import type { TaskRunContext } from "./TaskRunContext";
7
8
  import type { TaskInput, TaskOutput } from "./TaskTypes";
8
9
  import type { WhileTask, WhileTaskConfig } from "./WhileTask";
9
10
  /**
@@ -20,10 +21,10 @@ export declare class WhileTaskRunner<Input extends TaskInput = TaskInput, Output
20
21
  * contains the while-loop logic, rather than the default
21
22
  * GraphAsTaskRunner behavior of running the subgraph once.
22
23
  */
23
- protected executeTask(input: Input): Promise<Output | undefined>;
24
+ protected executeTask(input: Input, ctx: TaskRunContext): Promise<Output | undefined>;
24
25
  /**
25
26
  * For WhileTask, preview runs use the task's preview hook only.
26
27
  */
27
- executeTaskPreview(input: Input): Promise<Output | undefined>;
28
+ executeTaskPreview(input: Input, _ctx: TaskRunContext): Promise<Output | undefined>;
28
29
  }
29
30
  //# sourceMappingURL=WhileTaskRunner.d.ts.map
@@ -1 +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,EAA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EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IAE/C;;;;OAIG;IACH,UAAyB,WAAW,CAClC,KAAK,EAAE,KAAK,EACZ,GAAG,EAAE,cAAc,GAClB,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAS7B;IAED;;OAEG;IACmB,kBAAkB,CACtC,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,cAAc,GACnB,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAE7B;CACF"}
@@ -68,7 +68,7 @@ export declare class Dataflow {
68
68
  * Consumes the active stream to completion and materializes the value.
69
69
  *
70
70
  * Accumulation of text-delta chunks is the responsibility of the **source
71
- * task** (via TaskRunner.executeStreamingTask when shouldAccumulate=true).
71
+ * task** (via StreamProcessor when shouldAccumulate=true).
72
72
  * When accumulation is needed the source task emits an enriched finish event
73
73
  * that carries the fully-assembled port data. All downstream edges share that
74
74
  * enriched event through tee'd ReadableStreams, so no edge needs to
@@ -0,0 +1,88 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2025 Steven Roussey <sroussey@gmail.com>
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import type { ITask } from "../task/ITask";
7
+ import type { TaskInput, TaskOutput } from "../task/TaskTypes";
8
+ import type { TaskGraph } from "./TaskGraph";
9
+ import type { TaskGraphRunner } from "./TaskGraphRunner";
10
+ /**
11
+ * @internal
12
+ * Reads inputs from incoming dataflows, writes outputs/errors to outgoing dataflows.
13
+ * Owns dataflow transforms and error-port routing.
14
+ *
15
+ * Methods take the task they operate on. None take a RunContext — the caller
16
+ * (TaskGraphRunner.runTask or RunScheduler.runLoop) is responsible for routing
17
+ * any errors that bubble out of these methods into ctx.failedTaskErrors.
18
+ *
19
+ * Holds a back-reference to the facade so it can read facade-owned long-lived
20
+ * state (`registry`, `previewRunning`) and route through the facade's
21
+ * `runScheduler` for status push and disabled cascade.
22
+ */
23
+ export declare class EdgeMaterializer {
24
+ private readonly graph;
25
+ private readonly runner;
26
+ constructor(graph: TaskGraph, runner: TaskGraphRunner);
27
+ /**
28
+ * Filters graph-level input to only include properties that are not connected via dataflows for a given task
29
+ * @param task The task to filter input for
30
+ * @param input The graph-level input
31
+ * @returns Filtered input containing only unconnected properties
32
+ */
33
+ filterInputForTask(task: ITask, input: TaskInput): TaskInput;
34
+ /**
35
+ * Copies input data from edges to a task
36
+ * @param task The task to copy input data to
37
+ */
38
+ copyInputFromEdgesToNode(task: ITask): void;
39
+ /**
40
+ * Pushes the output of a task to its target tasks
41
+ * @param node The task that produced the output
42
+ * @param results The output of the task
43
+ */
44
+ pushOutputFromNodeToEdges(node: ITask, results: TaskOutput): Promise<void>;
45
+ /**
46
+ * Pushes the error of a task to its target edges
47
+ * @param node The task that produced the error
48
+ */
49
+ pushErrorFromNodeToEdges(node: ITask): void;
50
+ /**
51
+ * Returns true if the task has any outgoing dataflow edges that use the
52
+ * error output port (`[error]`). These edges indicate that the task's
53
+ * errors should be routed to downstream handler tasks instead of failing
54
+ * the entire graph.
55
+ */
56
+ hasErrorOutputEdges(task: ITask): boolean;
57
+ /**
58
+ * Routes a failed task's error through its error-port dataflow edges.
59
+ *
60
+ * For each outgoing dataflow:
61
+ * - Error-port edges (`[error]`) receive the error data and get COMPLETED status
62
+ * - Non-error-port edges get DISABLED status (the task didn't produce normal output)
63
+ *
64
+ * After setting edge statuses, propagateDisabledStatus() cascades DISABLED
65
+ * through any downstream tasks that only had non-error inputs from this task.
66
+ */
67
+ pushErrorOutputToEdges(task: ITask): void;
68
+ /**
69
+ * Resets a task. Takes an explicit `graph` because `resetGraph` recurses
70
+ * into `node.subGraph` for nested tasks and the EdgeMaterializer's own
71
+ * `this.graph` reference is bound to the top-level graph only.
72
+ *
73
+ * @param graph The task graph that owns the task being reset
74
+ * @param task The task to reset
75
+ * @param runId The run ID
76
+ */
77
+ resetTask(graph: TaskGraph, task: ITask, runId: string): void;
78
+ /**
79
+ * Duck-typed predicate for an `ImageValue`-shaped output, used by the engine
80
+ * to decide whether to apply `previewSource` during `runPreview`. Unlike
81
+ * `isImageValue` from `@workglow/util/media`, this predicate does not check
82
+ * `instanceof ImageBitmap` / `Buffer.isBuffer`, so it remains correct across
83
+ * realm boundaries (e.g. bundle copies in test harnesses) where those identity
84
+ * checks can spuriously fail.
85
+ */
86
+ private static isImageValueShape;
87
+ }
88
+ //# sourceMappingURL=EdgeMaterializer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EdgeMaterializer.d.ts","sourceRoot":"","sources":["../../src/task-graph/EdgeMaterializer.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAG/D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEzD;;;;;;;;;;;;GAYG;AACH,qBAAa,gBAAgB;IAEzB,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,MAAM;IAFzB,YACmB,KAAK,EAAE,SAAS,EAChB,MAAM,EAAE,eAAe,EACtC;IAEJ;;;;;OAKG;IACI,kBAAkB,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,GAAG,SAAS,CAkBlE;IAED;;;OAGG;IACI,wBAAwB,CAAC,IAAI,EAAE,KAAK,QAoB1C;IAED;;;;OAIG;IACU,yBAAyB,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,iBAiDtE;IAED;;;OAGG;IACI,wBAAwB,CAAC,IAAI,EAAE,KAAK,GAAG,IAAI,CAKjD;IAED;;;;;OAKG;IACI,mBAAmB,CAAC,IAAI,EAAE,KAAK,GAAG,OAAO,CAG/C;IAED;;;;;;;;;OASG;IACI,sBAAsB,CAAC,IAAI,EAAE,KAAK,GAAG,IAAI,CAsB/C;IAED;;;;;;;;OAQG;IACI,SAAS,CAAC,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,QAuB5D;IAED;;;;;;;OAOG;IACH,OAAO,CAAC,MAAM,CAAC,iBAAiB;CAWjC"}
@@ -4,6 +4,7 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
  import type { DataPortSchema } from "@workglow/util/schema";
7
+ import type { ITask } from "../task/ITask";
7
8
  import type { JsonTaskItem, TaskGraphJson } from "../task/TaskJSON";
8
9
  import type { TaskIdType } from "../task/TaskTypes";
9
10
  import type { TaskGraph } from "./TaskGraph";
@@ -48,4 +49,22 @@ export declare function addBoundaryNodesToGraphJson(json: TaskGraphJson, graph:
48
49
  * Per-property dependencies connect them to the origin tasks using origin tracking annotations.
49
50
  */
50
51
  export declare function addBoundaryNodesToDependencyJson(items: JsonTaskItem[], graph: TaskGraph): JsonTaskItem[];
52
+ /**
53
+ * Returns true if the task's output schema has any port with TypedArray format.
54
+ * Used by adaptive workflow methods to choose scalar vs vector task variant.
55
+ */
56
+ export declare function hasVectorOutput(task: ITask): boolean;
57
+ /**
58
+ * Returns true if the input object looks like vector task input: has a "vectors"
59
+ * property that is an array with at least one TypedArray element. Used by
60
+ * adaptive workflow methods so that e.g. sum({ vectors: [new Float32Array(...)] })
61
+ * chooses the vector variant even with no previous task.
62
+ */
63
+ export declare function hasVectorLikeInput(input: unknown): boolean;
64
+ /**
65
+ * Updates InputTask/OutputTask config schemas based on their connected dataflows.
66
+ * InputTask schema reflects its outgoing dataflow targets' input schemas.
67
+ * OutputTask schema reflects its incoming dataflow sources' output schemas.
68
+ */
69
+ export declare function updateBoundaryTaskSchemas(graph: TaskGraph): void;
51
70
  //# sourceMappingURL=GraphSchemaUtils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"GraphSchemaUtils.d.ts","sourceRoot":"","sources":["../../src/task-graph/GraphSchemaUtils.ts"],"names":[],"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AAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C,MAAM,WAAW,kBAAkB;IACjC;;;OAGG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,CAAC;CACjC;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,SAAS,GAAG,GAAG,CAAC,UAAU,EAAE,MAAM,CAAC,CAqB7E;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,SAAS,EAChB,OAAO,CAAC,EAAE,kBAAkB,GAC3B,cAAc,CAkHhB;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,SAAS,EAChB,OAAO,CAAC,EAAE,kBAAkB,GAC3B,cAAc,CAqFhB;AA4CD;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,SAAS,GAAG,aAAa,CAqFhG;AAED;;;GAGG;AACH,wBAAgB,gCAAgC,CAC9C,KAAK,EAAE,YAAY,EAAE,EACrB,KAAK,EAAE,SAAS,GACf,YAAY,EAAE,CAkFhB;AAgCD;;;GAGG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,KAAK,GAAG,OAAO,CAMpD;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAU1D;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,SAAS,GAAG,IAAI,CAmHhE"}
@@ -10,7 +10,17 @@ import { GraphResult, PROPERTY_ARRAY } from "./TaskGraphRunner";
10
10
  export interface WorkflowRunConfig {
11
11
  /** Optional service registry to use for this workflow run */
12
12
  readonly registry?: ServiceRegistry;
13
- /** Resource scope for collecting heavyweight resource disposers. */
13
+ /**
14
+ * Resource scope for collecting heavyweight resource disposers during the
15
+ * workflow run.
16
+ *
17
+ * If omitted, the underlying graph runner creates a private scope and
18
+ * disposes it when the run finishes — automatic cleanup for casual callers.
19
+ *
20
+ * If provided, the caller owns the lifecycle; the runner never calls
21
+ * `disposeAll`. Use this to share resources (e.g., a loaded AI model) across
22
+ * multiple runs, then dispose at app shutdown.
23
+ */
14
24
  readonly resourceScope?: ResourceScope;
15
25
  }
16
26
  export interface IWorkflow<Input extends TaskInput = TaskInput, Output extends TaskOutput = TaskOutput> {
@@ -1 +1 @@
1
- {"version":3,"file":"IWorkflow.d.ts","sourceRoot":"","sources":["../../src/task-graph/IWorkflow.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACrE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEhE,MAAM,WAAW,iBAAiB;IAChC,6DAA6D;IAC7D,QAAQ,CAAC,QAAQ,CAAC,EAAE,eAAe,CAAC;IACpC,oEAAoE;IACpE,QAAQ,CAAC,aAAa,CAAC,EAAE,aAAa,CAAC;CACxC;AAED,MAAM,WAAW,SAAS,CACxB,KAAK,SAAS,SAAS,GAAG,SAAS,EACnC,MAAM,SAAS,UAAU,GAAG,UAAU;IAEtC,KAAK,EAAE,SAAS,CAAC;IACjB,GAAG,CACD,KAAK,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,EACtB,MAAM,CAAC,EAAE,iBAAiB,GACzB,OAAO,CAAC,WAAW,CAAC,MAAM,EAAE,OAAO,cAAc,CAAC,CAAC,CAAC;CACxD"}
1
+ {"version":3,"file":"IWorkflow.d.ts","sourceRoot":"","sources":["../../src/task-graph/IWorkflow.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACrE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEhE,MAAM,WAAW,iBAAiB;IAChC,6DAA6D;IAC7D,QAAQ,CAAC,QAAQ,CAAC,EAAE,eAAe,CAAC;IACpC;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,aAAa,CAAC;CACxC;AAED,MAAM,WAAW,SAAS,CACxB,KAAK,SAAS,SAAS,GAAG,SAAS,EACnC,MAAM,SAAS,UAAU,GAAG,UAAU;IAEtC,KAAK,EAAE,SAAS,CAAC;IACjB,GAAG,CACD,KAAK,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,EACtB,MAAM,CAAC,EAAE,iBAAiB,GACzB,OAAO,CAAC,WAAW,CAAC,MAAM,EAAE,OAAO,cAAc,CAAC,CAAC,CAAC;CACxD"}
@@ -0,0 +1,60 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2025 Steven Roussey <sroussey@gmail.com>
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import type { GraphAsTask } from "../task/GraphAsTask";
7
+ import type { ITask } from "../task/ITask";
8
+ import type { TaskGraph } from "./TaskGraph";
9
+ import type { Workflow } from "./Workflow";
10
+ /**
11
+ * @internal
12
+ */
13
+ export interface PendingLoopConnect {
14
+ readonly parent: ITask;
15
+ readonly iteratorTask: ITask;
16
+ }
17
+ /**
18
+ * @internal
19
+ * Runs deferred auto-connect for a loop iterator task on the parent
20
+ * workflow's graph. Extracted as a free function so it can be invoked
21
+ * from both {@link LoopBuilderContext.consumePendingConnect} and from
22
+ * the parent {@link Workflow}'s public delegate method (the parent is
23
+ * not itself in loop-builder mode and has no context of its own).
24
+ *
25
+ * Returns the error message if auto-connect failed, otherwise undefined.
26
+ * On failure the iterator task is removed from the parent graph; the
27
+ * caller is responsible for surfacing the error onto the parent
28
+ * workflow's `.error` (matches the non-loop auto-connect path).
29
+ */
30
+ export declare function runLoopAutoConnect(parentGraph: TaskGraph, pending: PendingLoopConnect): string | undefined;
31
+ /**
32
+ * @internal
33
+ * Holds the parent <-> child relationship for a Workflow operating in
34
+ * loop-builder mode (created by parent.addLoopTask). Owns deferred
35
+ * auto-connect state. Has no events, no DSL.
36
+ */
37
+ export declare class LoopBuilderContext {
38
+ readonly parent: Workflow;
39
+ readonly iteratorTask: GraphAsTask;
40
+ pendingLoopConnect?: PendingLoopConnect;
41
+ constructor(parent: Workflow, iteratorTask: GraphAsTask);
42
+ /**
43
+ * Promotes a populated child template graph into the iterator task's
44
+ * subGraph. No-op on empty graphs.
45
+ */
46
+ finalizeTemplate(childGraph: TaskGraph): void;
47
+ /**
48
+ * Runs auto-connect for the pending loop connect (if any), then clears it.
49
+ * Returns the error message if auto-connect failed, otherwise undefined,
50
+ * so the caller can propagate the failure to the parent workflow's `.error`.
51
+ */
52
+ consumePendingConnect(): string | undefined;
53
+ /**
54
+ * Finalizes the template and returns the parent workflow. Any deferred
55
+ * auto-connect error is surfaced onto the parent's `.error` to match the
56
+ * non-loop auto-connect path.
57
+ */
58
+ finalizeAndReturn(childGraph: TaskGraph): Workflow;
59
+ }
60
+ //# sourceMappingURL=LoopBuilderContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LoopBuilderContext.d.ts","sourceRoot":"","sources":["../../src/task-graph/LoopBuilderContext.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,MAAM,EAAE,KAAK,CAAC;IACvB,QAAQ,CAAC,YAAY,EAAE,KAAK,CAAC;CAC9B;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,kBAAkB,CAChC,WAAW,EAAE,SAAS,EACtB,OAAO,EAAE,kBAAkB,GAC1B,MAAM,GAAG,SAAS,CAmBpB;AAED;;;;;GAKG;AACH,qBAAa,kBAAkB;IAC7B,SAAgB,MAAM,EAAE,QAAQ,CAAC;IACjC,SAAgB,YAAY,EAAE,WAAW,CAAC;IACnC,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IAE/C,YAAY,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,WAAW,EAGtD;IAED;;;OAGG;IACI,gBAAgB,CAAC,UAAU,EAAE,SAAS,GAAG,IAAI,CAInD;IAED;;;;OAIG;IACI,qBAAqB,IAAI,MAAM,GAAG,SAAS,CAMjD;IAED;;;;OAIG;IACI,iBAAiB,CAAC,UAAU,EAAE,SAAS,GAAG,QAAQ,CAKxD;CACF"}
@@ -0,0 +1,39 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2025 Steven Roussey <sroussey@gmail.com>
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import type { ISpan } from "@workglow/util";
7
+ import type { IEntitlementEnforcer } from "../task/EntitlementEnforcer";
8
+ import type { TaskError, TaskGraphTimeoutError } from "../task/TaskError";
9
+ import type { TaskOutput } from "../task/TaskTypes";
10
+ /**
11
+ * @internal
12
+ * Per-run mutable state for a single TaskGraphRunner.runGraph() invocation.
13
+ * Built by TaskGraphRunner.handleStart(), discarded by handleComplete/Error/Abort.
14
+ *
15
+ * All long-lived state (graph, schedulers, registry, resourceScope, outputCache,
16
+ * accumulateLeafOutputs) stays on the facade. RunContext only holds state that is
17
+ * created at the start of a run and torn down when the run terminates.
18
+ */
19
+ export declare class RunContext {
20
+ readonly runId: string;
21
+ readonly abortController: AbortController;
22
+ readonly inProgressTasks: Map<unknown, Promise<TaskOutput>>;
23
+ readonly inProgressFunctions: Map<unknown, Promise<void>>;
24
+ readonly failedTaskErrors: Map<unknown, TaskError>;
25
+ telemetrySpan?: ISpan;
26
+ graphTimeoutTimer?: ReturnType<typeof setTimeout>;
27
+ pendingGraphTimeoutError?: TaskGraphTimeoutError;
28
+ activeEnforcer?: IEntitlementEnforcer;
29
+ private parentSignalCleanup?;
30
+ constructor(parentSignal?: AbortSignal);
31
+ /**
32
+ * Releases external listeners (parentSignal abort handler). Idempotent.
33
+ * Called by terminal handlers (handleComplete/Error/Abort) so a parent abort
34
+ * fired after this run completes does not re-trigger our abort path and emit
35
+ * a duplicate terminal event.
36
+ */
37
+ dispose(): void;
38
+ }
39
+ //# sourceMappingURL=RunContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RunContext.d.ts","sourceRoot":"","sources":["../../src/task-graph/RunContext.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAE5C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,KAAK,EAAE,SAAS,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC1E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD;;;;;;;;GAQG;AACH,qBAAa,UAAU;IACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,eAAe,EAAE,eAAe,CAAC;IAC1C,QAAQ,CAAC,eAAe,EAAE,GAAG,CAAC,OAAO,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC,CAAa;IACxE,QAAQ,CAAC,mBAAmB,EAAE,GAAG,CAAC,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAa;IACtE,QAAQ,CAAC,gBAAgB,EAAE,GAAG,CAAC,OAAO,EAAE,SAAS,CAAC,CAAa;IAE/D,aAAa,CAAC,EAAE,KAAK,CAAC;IACtB,iBAAiB,CAAC,EAAE,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC;IAClD,wBAAwB,CAAC,EAAE,qBAAqB,CAAC;IACjD,cAAc,CAAC,EAAE,oBAAoB,CAAC;IAItC,OAAO,CAAC,mBAAmB,CAAC,CAAa;IAEzC,YAAY,YAAY,CAAC,EAAE,WAAW,EAgBrC;IAED;;;;;OAKG;IACH,OAAO,IAAI,IAAI,CAGd;CACF"}
@@ -0,0 +1,81 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2025 Steven Roussey <sroussey@gmail.com>
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import type { ITask } from "../task/ITask";
7
+ import type { TaskInput, TaskOutput } from "../task/TaskTypes";
8
+ import { TaskStatus } from "../task/TaskTypes";
9
+ import type { EdgeMaterializer } from "./EdgeMaterializer";
10
+ import type { RunContext } from "./RunContext";
11
+ import type { TaskGraph, TaskGraphRunConfig } from "./TaskGraph";
12
+ import type { GraphResultArray, TaskGraphRunner } from "./TaskGraphRunner";
13
+ import type { ITaskGraphScheduler } from "./TaskGraphScheduler";
14
+ /**
15
+ * @internal
16
+ * Run-loop coordinator. Drives task selection via processScheduler,
17
+ * arms graph-level timeout, propagates disabled cascade, aggregates progress,
18
+ * and pushes status to outgoing edges.
19
+ *
20
+ * Stateless across runs — all per-run state arrives via `ctx`.
21
+ *
22
+ * Holds a back-reference to the facade so runLoop can call facade.runTask().
23
+ * This keeps runTask as the single per-task choreography point that wires
24
+ * EdgeMaterializer + StreamPump + the integration with TaskRunner.
25
+ */
26
+ export declare class RunScheduler {
27
+ private readonly graph;
28
+ private readonly processScheduler;
29
+ private readonly facade;
30
+ constructor(graph: TaskGraph, processScheduler: ITaskGraphScheduler, facade: TaskGraphRunner);
31
+ /**
32
+ * Pushes the status of a task to its target edges
33
+ * @param node The task that produced the status
34
+ *
35
+ * For ConditionalTask, this method handles selective dataflow status:
36
+ * - Active branch dataflows get COMPLETED status
37
+ * - Inactive branch dataflows get DISABLED status
38
+ */
39
+ pushStatusFromNodeToEdges(node: ITask, ctx: RunContext | undefined, status?: TaskStatus, graph?: TaskGraph): void;
40
+ /**
41
+ * Propagates DISABLED status through the graph.
42
+ *
43
+ * When a task's ALL incoming dataflows are DISABLED, that task becomes unreachable
44
+ * and should also be disabled. This cascades through the graph until no more
45
+ * tasks can be disabled.
46
+ *
47
+ * This is used by ConditionalTask to disable downstream tasks on inactive branches.
48
+ *
49
+ * `_ctx` is accepted for symmetry with other RunScheduler methods (which thread
50
+ * per-run state through the RunContext) and to leave room for future per-run
51
+ * scheduling state without a signature change. Currently unused — the cascade
52
+ * operates on graph-level task status alone.
53
+ */
54
+ propagateDisabledStatus(_ctx: RunContext | undefined, graph?: TaskGraph): void;
55
+ /**
56
+ * Handles progress updates for the task graph by averaging `progress` across tasks whose class
57
+ * declares its own `execute` (see {@link taskPrototypeHasOwnExecute}). Other nodes are ignored.
58
+ */
59
+ handleProgress(ctx: RunContext, task: ITask, progress: number | undefined, message?: string, ...args: any[]): Promise<void>;
60
+ /**
61
+ * Arms the graph-level timeout. The timer fires `pendingGraphTimeoutError`
62
+ * and aborts the run when elapsed. No-op when `timeoutMs <= 0`.
63
+ *
64
+ * @remarks Treats `timeoutMs <= 0` as "no timeout" (silent no-op), not as
65
+ * "fire immediately". Callers that want immediate cancellation should call
66
+ * `ctx.abortController.abort()` directly.
67
+ */
68
+ armGraphTimeout(timeoutMs: number, ctx: RunContext): void;
69
+ /**
70
+ * Clears the graph-level timeout timer if active.
71
+ */
72
+ clearGraphTimeout(ctx: RunContext): void;
73
+ /**
74
+ * Inner for-await loop body of {@link TaskGraphRunner.runGraph}. Drives the
75
+ * processScheduler, dispatches tasks via `facade.runTask`, routes errors,
76
+ * and pushes status/error to outgoing edges. Returns the per-leaf results
77
+ * (terminal-state precedence is the facade's responsibility).
78
+ */
79
+ runLoop<O extends TaskOutput>(input: TaskInput, config: TaskGraphRunConfig | undefined, ctx: RunContext, edgeMat: EdgeMaterializer): Promise<GraphResultArray<O>>;
80
+ }
81
+ //# sourceMappingURL=RunScheduler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RunScheduler.d.ts","sourceRoot":"","sources":["../../src/task-graph/RunScheduler.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjE,OAAO,KAAK,EAAE,gBAAgB,EAAyB,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAElG,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAEhE;;;;;;;;;;;GAWG;AACH,qBAAa,YAAY;IAErB,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,gBAAgB;IACjC,OAAO,CAAC,QAAQ,CAAC,MAAM;IAHzB,YACmB,KAAK,EAAE,SAAS,EAChB,gBAAgB,EAAE,mBAAmB,EACrC,MAAM,EAAE,eAAe,EACtC;IAEJ;;;;;;;OAOG;IACH,yBAAyB,CACvB,IAAI,EAAE,KAAK,EACX,GAAG,EAAE,UAAU,GAAG,SAAS,EAC3B,MAAM,CAAC,EAAE,UAAU,EACnB,KAAK,GAAE,SAAsB,GAC5B,IAAI,CAiDN;IAED;;;;;;;;;;;;;OAaG;IACH,uBAAuB,CAAC,IAAI,EAAE,UAAU,GAAG,SAAS,EAAE,KAAK,GAAE,SAAsB,GAAG,IAAI,CA4CzF;IAED;;;OAGG;IACG,cAAc,CAClB,GAAG,EAAE,UAAU,EACf,IAAI,EAAE,KAAK,EACX,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,OAAO,CAAC,EAAE,MAAM,EAChB,GAAG,IAAI,EAAE,GAAG,EAAE,GACb,OAAO,CAAC,IAAI,CAAC,CA2Bf;IAED;;;;;;;OAOG;IACH,eAAe,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,GAAG,IAAI,CAOxD;IAED;;OAEG;IACH,iBAAiB,CAAC,GAAG,EAAE,UAAU,GAAG,IAAI,CAKvC;IAED;;;;;OAKG;IACG,OAAO,CAAC,CAAC,SAAS,UAAU,EAChC,KAAK,EAAE,SAAS,EAChB,MAAM,EAAE,kBAAkB,GAAG,SAAS,EACtC,GAAG,EAAE,UAAU,EACf,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CA8E9B;CACF"}
@@ -0,0 +1,122 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2025 Steven Roussey <sroussey@gmail.com>
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import type { ResourceScope, ServiceRegistry } from "@workglow/util";
7
+ import type { TaskOutputRepository } from "../storage/TaskOutputRepository";
8
+ import type { ITask } from "../task/ITask";
9
+ import type { TaskInput } from "../task/TaskTypes";
10
+ import type { EdgeMaterializer } from "./EdgeMaterializer";
11
+ import type { RunContext } from "./RunContext";
12
+ import type { RunScheduler } from "./RunScheduler";
13
+ import type { TaskGraph } from "./TaskGraph";
14
+ import type { GraphSingleTaskResult } from "./TaskGraphRunner";
15
+ import type { ITaskGraphScheduler } from "./TaskGraphScheduler";
16
+ /**
17
+ * Per-call run-state inputs shared between {@link StreamPump.runStreamingTask}
18
+ * and the helpers it calls. Keeps StreamPump stateless beyond `graph`,
19
+ * `processScheduler`, and `edgeMaterializer` so the facade's mutable per-run
20
+ * state (`registry`, `outputCache`, `resourceScope`, `accumulateLeafOutputs`)
21
+ * is read at call time rather than captured at construction.
22
+ *
23
+ * @internal
24
+ */
25
+ export interface StreamingRunOptions {
26
+ readonly registry: ServiceRegistry;
27
+ readonly outputCache: TaskOutputRepository | undefined;
28
+ readonly resourceScope: ResourceScope | undefined;
29
+ readonly accumulateLeafOutputs: boolean;
30
+ readonly updateProgress: (task: ITask, progress: number | undefined, message?: string, ...args: any[]) => Promise<void>;
31
+ }
32
+ /**
33
+ * @internal
34
+ * Streaming bridge. Awaits upstream streaming inputs, runs streaming tasks,
35
+ * tees stream events to downstream edges, decides accumulation policy.
36
+ *
37
+ * `awaitStreamInputs` and `runStreamingTask` take per-call run-state as
38
+ * arguments rather than holding references, because the facade's per-run
39
+ * state (`registry`, `outputCache`, `resourceScope`, `accumulateLeafOutputs`)
40
+ * is mutable and may be reassigned between runs. Method-arg injection lets the
41
+ * facade pass the current values at call time.
42
+ *
43
+ * The {@link RunScheduler} back-reference is wired post-construction via
44
+ * {@link setRunScheduler} to break the StreamPump <-> RunScheduler import
45
+ * cycle (StreamPump calls RunScheduler for status pushes; RunScheduler
46
+ * dispatches into StreamPump indirectly via facade.runTask).
47
+ */
48
+ export declare class StreamPump {
49
+ private readonly graph;
50
+ private readonly processScheduler;
51
+ private readonly edgeMaterializer;
52
+ private runScheduler;
53
+ constructor(graph: TaskGraph, processScheduler: ITaskGraphScheduler, edgeMaterializer: EdgeMaterializer);
54
+ /**
55
+ * Wires the {@link RunScheduler} back-reference. Must be called once after
56
+ * construction, before any call to {@link runStreamingTask}.
57
+ */
58
+ setRunScheduler(rs: RunScheduler): void;
59
+ /**
60
+ * Tees streaming inputs for a streamable task — one copy goes to the task's
61
+ * executeStream() (via inputStreams), one stays on the edge for materialization
62
+ * by awaitStreamInputs.
63
+ */
64
+ prepareStreamingInputs(task: ITask): void;
65
+ /**
66
+ * For non-streaming downstream tasks, awaits completion of any active
67
+ * streams on input dataflow edges, materializing their values.
68
+ *
69
+ * Streaming upstream tasks set a ReadableStream on outgoing edges.
70
+ * Non-streaming downstream tasks cannot consume streams directly, so
71
+ * this method reads each stream to completion and accumulates the
72
+ * value (via Dataflow.awaitStreamValue) before the task reads its
73
+ * inputs through the normal getPortData() path.
74
+ */
75
+ awaitStreamInputs(task: ITask, registry: ServiceRegistry): Promise<void>;
76
+ /**
77
+ * Runs a streaming task within the DAG.
78
+ * Listens for stream events to:
79
+ * - Notify the scheduler when streaming begins (unblocking downstream streamable tasks)
80
+ * - Push stream data to outgoing dataflow edges
81
+ * - Have the source task accumulate and emit enriched finish events for
82
+ * non-streaming downstream tasks (when taskNeedsAccumulation() is true)
83
+ */
84
+ runStreamingTask<T>(task: ITask, input: TaskInput, ctx: RunContext, options: StreamingRunOptions): Promise<GraphSingleTaskResult<T>>;
85
+ /**
86
+ * Determines whether a streaming task needs to accumulate its text-delta
87
+ * chunks into an enriched finish event. Accumulation is needed when:
88
+ *
89
+ * 1. Output caching is active (the cached value must be fully materialised).
90
+ * 2. Any outgoing dataflow edge connects a streaming output port to an input
91
+ * port that is not streaming with the same mode (i.e. the downstream task
92
+ * cannot consume a raw stream and needs a completed value).
93
+ *
94
+ * When accumulation is required the source task runs with shouldAccumulate=true,
95
+ * emitting an enriched finish event that carries all accumulated port text.
96
+ * All downstream dataflow edges share that event via tee'd streams so no
97
+ * edge needs to re-accumulate independently.
98
+ */
99
+ private taskNeedsAccumulation;
100
+ /**
101
+ * Returns true if an event carries a port-specific delta (text-delta or object-delta).
102
+ */
103
+ private static isPortDelta;
104
+ /**
105
+ * Creates a ReadableStream from task streaming events, optionally filtered
106
+ * to a single port. When `portId` is undefined (DATAFLOW_ALL_PORTS), all
107
+ * events pass through. When set, only delta events matching the port plus
108
+ * control events (finish, error, snapshot) are enqueued.
109
+ *
110
+ * Also taps snapshot events to write per-port data into each edge's
111
+ * `latestSnapshot` slot for downstream peek-during-streaming.
112
+ */
113
+ private createStreamFromTaskEvents;
114
+ /**
115
+ * Pushes stream events from a streaming task to its outgoing dataflow edges.
116
+ * Creates per-port filtered ReadableStreams for specific-port edges and
117
+ * unfiltered streams for DATAFLOW_ALL_PORTS edges. Within each port group,
118
+ * uses tee() for fan-out to multiple consumers.
119
+ */
120
+ private pushStreamToEdges;
121
+ }
122
+ //# sourceMappingURL=StreamPump.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StreamPump.d.ts","sourceRoot":"","sources":["../../src/task-graph/StreamPump.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACrE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAC5E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAG3C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAGnD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAEhE;;;;;;;;GAQG;AACH,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,QAAQ,EAAE,eAAe,CAAC;IACnC,QAAQ,CAAC,WAAW,EAAE,oBAAoB,GAAG,SAAS,CAAC;IACvD,QAAQ,CAAC,aAAa,EAAE,aAAa,GAAG,SAAS,CAAC;IAClD,QAAQ,CAAC,qBAAqB,EAAE,OAAO,CAAC;IACxC,QAAQ,CAAC,cAAc,EAAE,CACvB,IAAI,EAAE,KAAK,EACX,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,OAAO,CAAC,EAAE,MAAM,EAChB,GAAG,IAAI,EAAE,GAAG,EAAE,KACX,OAAO,CAAC,IAAI,CAAC,CAAC;CACpB;AAED;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,UAAU;IAKnB,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,gBAAgB;IACjC,OAAO,CAAC,QAAQ,CAAC,gBAAgB;IALnC,OAAO,CAAC,YAAY,CAAgB;IAEpC,YACmB,KAAK,EAAE,SAAS,EAChB,gBAAgB,EAAE,mBAAmB,EACrC,gBAAgB,EAAE,gBAAgB,EACjD;IAEJ;;;OAGG;IACH,eAAe,CAAC,EAAE,EAAE,YAAY,GAAG,IAAI,CAEtC;IAED;;;;OAIG;IACH,sBAAsB,CAAC,IAAI,EAAE,KAAK,GAAG,IAAI,CAYxC;IAED;;;;;;;;;OASG;IACG,iBAAiB,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAe7E;IAED;;;;;;;OAOG;IACG,gBAAgB,CAAC,CAAC,EACtB,IAAI,EAAE,KAAK,EACX,KAAK,EAAE,SAAS,EAChB,GAAG,EAAE,UAAU,EACf,OAAO,EAAE,mBAAmB,GAC3B,OAAO,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC,CA+DnC;IAED;;;;;;;;;;;;;OAaG;IACH,OAAO,CAAC,qBAAqB;IAgC7B;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,WAAW;IAI1B;;;;;;;;OAQG;IACH,OAAO,CAAC,0BAA0B;IA8ClC;;;;;OAKG;IACH,OAAO,CAAC,iBAAiB;CAoC1B"}
@@ -55,8 +55,16 @@ export interface TaskGraphRunConfig {
55
55
  */
56
56
  enforceEntitlements?: boolean;
57
57
  /**
58
- * Resource scope for collecting heavyweight resource disposers during graph execution.
59
- * Threaded to all tasks via IExecuteContext. The caller controls disposal.
58
+ * Resource scope for collecting heavyweight resource disposers during graph
59
+ * execution. Threaded to all tasks via IExecuteContext.
60
+ *
61
+ * If omitted, the top-level runner creates a private scope and `disposeAll()`s
62
+ * it when the run finishes (success, error, or abort) — automatic cleanup for
63
+ * casual callers.
64
+ *
65
+ * If provided, the caller owns the lifecycle; the runner never calls
66
+ * `disposeAll`. Use this to share resources (e.g., a loaded AI model) across
67
+ * multiple runs, then dispose at app shutdown.
60
68
  */
61
69
  resourceScope?: ResourceScope;
62
70
  }
@@ -1 +1 @@
1
- {"version":3,"file":"TaskGraph.d.ts","sourceRoot":"","sources":["../../src/task-graph/TaskGraph.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,eAAe,EAAS,MAAM,gBAAgB,CAAC;AACtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAC1F,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACvF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAElD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAGtC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,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