@workglow/task-graph 0.0.122 → 0.0.124

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 (46) hide show
  1. package/dist/browser.js +18 -16
  2. package/dist/browser.js.map +23 -23
  3. package/dist/bun.js +18 -16
  4. package/dist/bun.js.map +23 -23
  5. package/dist/node.js +18 -16
  6. package/dist/node.js.map +23 -23
  7. package/dist/storage/TaskGraphTabularRepository.d.ts +1 -1
  8. package/dist/storage/TaskGraphTabularRepository.d.ts.map +1 -1
  9. package/dist/storage/TaskOutputTabularRepository.d.ts.map +1 -1
  10. package/dist/task/ConditionalTask.d.ts +1 -1
  11. package/dist/task/ConditionalTask.d.ts.map +1 -1
  12. package/dist/task/FallbackTask.d.ts +1 -1
  13. package/dist/task/FallbackTask.d.ts.map +1 -1
  14. package/dist/task/GraphAsTask.d.ts +1 -2
  15. package/dist/task/GraphAsTask.d.ts.map +1 -1
  16. package/dist/task/ITask.d.ts +7 -6
  17. package/dist/task/ITask.d.ts.map +1 -1
  18. package/dist/task/InputResolver.d.ts +2 -1
  19. package/dist/task/InputResolver.d.ts.map +1 -1
  20. package/dist/task/IteratorTask.d.ts +1 -1
  21. package/dist/task/IteratorTask.d.ts.map +1 -1
  22. package/dist/task/JobQueueTask.d.ts +1 -1
  23. package/dist/task/JobQueueTask.d.ts.map +1 -1
  24. package/dist/task/MapTask.d.ts +1 -1
  25. package/dist/task/MapTask.d.ts.map +1 -1
  26. package/dist/task/ReduceTask.d.ts +1 -1
  27. package/dist/task/ReduceTask.d.ts.map +1 -1
  28. package/dist/task/StreamTypes.d.ts +1 -1
  29. package/dist/task/StreamTypes.d.ts.map +1 -1
  30. package/dist/task/Task.d.ts +6 -6
  31. package/dist/task/Task.d.ts.map +1 -1
  32. package/dist/task/TaskEvents.d.ts +2 -1
  33. package/dist/task/TaskEvents.d.ts.map +1 -1
  34. package/dist/task/TaskRunner.d.ts.map +1 -1
  35. package/dist/task/TaskTypes.d.ts +1 -1
  36. package/dist/task/TaskTypes.d.ts.map +1 -1
  37. package/dist/task/WhileTask.d.ts +1 -1
  38. package/dist/task/WhileTask.d.ts.map +1 -1
  39. package/dist/task/iterationSchema.d.ts +1 -1
  40. package/dist/task/iterationSchema.d.ts.map +1 -1
  41. package/dist/task-graph/GraphSchemaUtils.d.ts +1 -1
  42. package/dist/task-graph/GraphSchemaUtils.d.ts.map +1 -1
  43. package/dist/task-graph/TaskGraph.d.ts +2 -1
  44. package/dist/task-graph/TaskGraph.d.ts.map +1 -1
  45. package/dist/task-graph/Workflow.d.ts.map +1 -1
  46. package/package.json +7 -12
package/dist/browser.js CHANGED
@@ -82,7 +82,7 @@ var init_TaskTypes = __esm(() => {
82
82
  });
83
83
 
84
84
  // src/task-graph/Dataflow.ts
85
- import { areSemanticallyCompatible } from "@workglow/schema";
85
+ import { areSemanticallyCompatible } from "@workglow/util/schema";
86
86
  import { EventEmitter } from "@workglow/util";
87
87
 
88
88
  class Dataflow {
@@ -948,7 +948,8 @@ class TaskRunner {
948
948
  this.task.setInput(overrides);
949
949
  const schema = this.task.constructor.inputSchema();
950
950
  this.task.runInputData = await resolveSchemaInputs(this.task.runInputData, schema, { registry: this.registry });
951
- const isValid = await this.task.validateInput(this.task.runInputData);
951
+ const inputs = this.task.runInputData;
952
+ const isValid = await this.task.validateInput(inputs);
952
953
  if (!isValid) {
953
954
  throw new TaskInvalidInputError("Invalid input data");
954
955
  }
@@ -956,7 +957,6 @@ class TaskRunner {
956
957
  await this.handleAbort();
957
958
  throw new TaskAbortedError("Promise for task created and aborted before run");
958
959
  }
959
- const inputs = this.task.runInputData;
960
960
  let outputs;
961
961
  const isStreamable = isTaskStreamable(this.task);
962
962
  if (this.task.cacheable) {
@@ -1001,11 +1001,12 @@ class TaskRunner {
1001
1001
  this.task.runInputData = await resolveSchemaInputs(this.task.runInputData, schema, { registry: this.registry });
1002
1002
  await this.handleStartReactive();
1003
1003
  try {
1004
- const isValid = await this.task.validateInput(this.task.runInputData);
1004
+ const inputs = this.task.runInputData;
1005
+ const isValid = await this.task.validateInput(inputs);
1005
1006
  if (!isValid) {
1006
1007
  throw new TaskInvalidInputError("Invalid input data");
1007
1008
  }
1008
- const resultReactive = await this.executeTaskReactive(this.task.runInputData, this.task.runOutputData);
1009
+ const resultReactive = await this.executeTaskReactive(inputs, this.task.runOutputData);
1009
1010
  this.task.runOutputData = resultReactive;
1010
1011
  await this.handleCompleteReactive();
1011
1012
  } catch (err) {
@@ -1198,7 +1199,7 @@ class TaskRunner {
1198
1199
  this.task.emit("start");
1199
1200
  this.task.emit("status", this.task.status);
1200
1201
  }
1201
- updateProgress = async (task, progress, message, ...args) => {};
1202
+ updateProgress = async (_task, _progress, _message, ..._args) => {};
1202
1203
  async handleStartReactive() {
1203
1204
  this.reactiveRunning = true;
1204
1205
  }
@@ -1305,12 +1306,8 @@ var init_TaskRunner = __esm(() => {
1305
1306
  });
1306
1307
 
1307
1308
  // src/task/Task.ts
1308
- import { compileSchema } from "@workglow/schema";
1309
- import {
1310
- deepEqual,
1311
- EventEmitter as EventEmitter3,
1312
- uuid4 as uuid42
1313
- } from "@workglow/util";
1309
+ import { compileSchema } from "@workglow/util/schema";
1310
+ import { deepEqual, EventEmitter as EventEmitter3, uuid4 as uuid42 } from "@workglow/util";
1314
1311
 
1315
1312
  class Task {
1316
1313
  static type = "Task";
@@ -1677,6 +1674,9 @@ class Task {
1677
1674
  return this.constructor.getInputSchemaNode();
1678
1675
  }
1679
1676
  async validateInput(input) {
1677
+ if (typeof input !== "object" || input === null) {
1678
+ throw new TaskInvalidInputError("Input must be an object");
1679
+ }
1680
1680
  const ctor = this.constructor;
1681
1681
  let schemaNode;
1682
1682
  if (ctor.hasDynamicSchemas) {
@@ -2905,7 +2905,7 @@ __export(exports_GraphAsTask, {
2905
2905
  graphAsTaskConfigSchema: () => graphAsTaskConfigSchema,
2906
2906
  GraphAsTask: () => GraphAsTask
2907
2907
  });
2908
- import { compileSchema as compileSchema2 } from "@workglow/schema";
2908
+ import { compileSchema as compileSchema2 } from "@workglow/util/schema";
2909
2909
  var graphAsTaskConfigSchema, GraphAsTask;
2910
2910
  var init_GraphAsTask = __esm(() => {
2911
2911
  init_GraphSchemaUtils();
@@ -3206,7 +3206,8 @@ var init_TaskGraphEvents = __esm(() => {
3206
3206
  });
3207
3207
 
3208
3208
  // src/task-graph/TaskGraph.ts
3209
- import { DirectedAcyclicGraph, EventEmitter as EventEmitter4, uuid4 as uuid44 } from "@workglow/util";
3209
+ import { DirectedAcyclicGraph } from "@workglow/util/graph";
3210
+ import { EventEmitter as EventEmitter4, uuid4 as uuid44 } from "@workglow/util";
3210
3211
 
3211
3212
  class TaskGraph {
3212
3213
  outputCache;
@@ -6708,7 +6709,8 @@ init_TaskOutputRepository();
6708
6709
 
6709
6710
  // src/storage/TaskOutputTabularRepository.ts
6710
6711
  init_TaskOutputRepository();
6711
- import { compress, decompress, makeFingerprint } from "@workglow/util";
6712
+ import { compress, decompress } from "@workglow/util/compress";
6713
+ import { makeFingerprint } from "@workglow/util";
6712
6714
  var TaskOutputSchema = {
6713
6715
  type: "object",
6714
6716
  properties: {
@@ -6914,4 +6916,4 @@ export {
6914
6916
  ConditionalTask
6915
6917
  };
6916
6918
 
6917
- //# debugId=AB5D43113632355A64756E2164756E21
6919
+ //# debugId=6A9C922AAED7B7DF64756E2164756E21