@workglow/task-graph 0.0.88 → 0.0.89

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/bun.js CHANGED
@@ -1202,16 +1202,18 @@ class TaskGraphRunner {
1202
1202
  await this.handleComplete();
1203
1203
  return results;
1204
1204
  }
1205
- async runGraphReactive() {
1205
+ async runGraphReactive(input = {}) {
1206
1206
  await this.handleStartReactive();
1207
1207
  const results = [];
1208
1208
  try {
1209
1209
  for await (const task of this.reactiveScheduler.tasks()) {
1210
+ const isRootTask = this.graph.getSourceDataflows(task.config.id).length === 0;
1210
1211
  if (task.status === TaskStatus.PENDING) {
1211
1212
  task.resetInputData();
1212
1213
  this.copyInputFromEdgesToNode(task);
1213
1214
  }
1214
- const taskResult = await task.runReactive();
1215
+ const taskInput = isRootTask ? input : {};
1216
+ const taskResult = await task.runReactive(taskInput);
1215
1217
  await this.pushOutputFromNodeToEdges(task, taskResult);
1216
1218
  if (this.graph.getTargetDataflows(task.config.id).length === 0) {
1217
1219
  results.push({
@@ -1512,7 +1514,7 @@ class GraphAsTaskRunner extends TaskRunner {
1512
1514
  return results;
1513
1515
  }
1514
1516
  async executeTaskChildrenReactive() {
1515
- return this.task.subGraph.runReactive();
1517
+ return this.task.subGraph.runReactive(this.task.runInputData);
1516
1518
  }
1517
1519
  async handleDisable() {
1518
1520
  if (this.task.hasChildren()) {
@@ -2283,8 +2285,8 @@ class TaskGraph {
2283
2285
  parentSignal: config?.parentSignal || undefined
2284
2286
  });
2285
2287
  }
2286
- runReactive() {
2287
- return this.runner.runGraphReactive();
2288
+ runReactive(input = {}) {
2289
+ return this.runner.runGraphReactive(input);
2288
2290
  }
2289
2291
  mergeExecuteOutputsToRunOutput(results, compoundMerge) {
2290
2292
  return this.runner.mergeExecuteOutputsToRunOutput(results, compoundMerge);
@@ -3068,4 +3070,4 @@ export {
3068
3070
  ConditionalTask
3069
3071
  };
3070
3072
 
3071
- //# debugId=0C9B0184C88D909D64756E2164756E21
3073
+ //# debugId=B92DF56229C4FC4064756E2164756E21