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