@workglow/task-graph 0.2.34 → 0.2.36
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.d.ts.map +1 -1
- package/dist/browser.js +22 -18
- package/dist/browser.js.map +6 -6
- package/dist/bun.d.ts.map +1 -1
- package/dist/bun.js +22 -18
- package/dist/bun.js.map +6 -6
- package/dist/common.d.ts.map +1 -1
- package/dist/debug/console/ConsoleFormatters.d.ts.map +1 -1
- package/dist/node.d.ts.map +1 -1
- package/dist/node.js +22 -18
- package/dist/node.js.map +6 -6
- package/dist/task/FallbackTask.d.ts.map +1 -1
- package/dist/task/GraphAsTask.d.ts.map +1 -1
- package/dist/task/MapTask.d.ts.map +1 -1
- package/dist/task/ReduceTask.d.ts.map +1 -1
- package/dist/task/WhileTask.d.ts.map +1 -1
- package/dist/task/index.d.ts.map +1 -1
- package/dist/task-graph/Workflow.d.ts +3 -3
- package/dist/task-graph/Workflow.d.ts.map +1 -1
- package/dist/task-graph/WorkflowBuilder.d.ts +4 -4
- package/dist/task-graph/WorkflowBuilder.d.ts.map +1 -1
- package/dist/task-graph/WorkflowFactories.d.ts +16 -4
- package/dist/task-graph/WorkflowFactories.d.ts.map +1 -1
- package/package.json +8 -9
- package/dist/task/__tests__/DataflowJson.transforms.test.d.ts +0 -7
- package/dist/task/__tests__/DataflowJson.transforms.test.d.ts.map +0 -1
package/dist/browser.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,cAAc,UAAU,CAAC;AACzB,cAAc,mCAAmC,CAAC"}
|
package/dist/browser.js
CHANGED
|
@@ -5312,20 +5312,24 @@ class WorkflowBuilder {
|
|
|
5312
5312
|
this._dataFlows = [];
|
|
5313
5313
|
this._error = "";
|
|
5314
5314
|
}
|
|
5315
|
-
addTaskInstance(taskClass, config) {
|
|
5316
|
-
|
|
5315
|
+
addTaskInstance(taskClass, config, runConfig) {
|
|
5316
|
+
let mergedRunConfig = runConfig;
|
|
5317
|
+
if (this._registry !== undefined) {
|
|
5318
|
+
mergedRunConfig = { ...runConfig ?? {}, registry: this._registry };
|
|
5319
|
+
}
|
|
5320
|
+
const task = new taskClass(config, mergedRunConfig);
|
|
5317
5321
|
const id = this._facade.graph.addTask(task);
|
|
5318
5322
|
this._facade.events.emit("changed", id);
|
|
5319
5323
|
return task;
|
|
5320
5324
|
}
|
|
5321
|
-
addTaskWithAutoConnect(taskClass, input = {}, config = {}) {
|
|
5325
|
+
addTaskWithAutoConnect(taskClass, input = {}, config = {}, runConfig) {
|
|
5322
5326
|
this._error = "";
|
|
5323
5327
|
const parent = getLastTask(this._facade);
|
|
5324
5328
|
const task = this.addTaskInstance(taskClass, {
|
|
5325
5329
|
id: uuid47(),
|
|
5326
5330
|
...config,
|
|
5327
5331
|
defaults: input
|
|
5328
|
-
});
|
|
5332
|
+
}, runConfig);
|
|
5329
5333
|
if (this._dataFlows.length > 0) {
|
|
5330
5334
|
this._dataFlows.forEach((dataflow) => {
|
|
5331
5335
|
const taskSchema = task.inputSchema();
|
|
@@ -5369,14 +5373,14 @@ class WorkflowBuilder {
|
|
|
5369
5373
|
}
|
|
5370
5374
|
return this._facade;
|
|
5371
5375
|
}
|
|
5372
|
-
addLoopTask(taskClass, config = {}) {
|
|
5376
|
+
addLoopTask(taskClass, config = {}, runConfig) {
|
|
5373
5377
|
this._error = "";
|
|
5374
5378
|
const parent = getLastTask(this._facade);
|
|
5375
5379
|
const schema = taskClass.configSchema?.();
|
|
5376
5380
|
const required = typeof schema === "object" && schema !== null ? schema.required : undefined;
|
|
5377
5381
|
const needsMaxIterations = Array.isArray(required) && required.includes("maxIterations");
|
|
5378
5382
|
const resolvedConfig = needsMaxIterations && config.maxIterations === undefined ? { ...config, maxIterations: "unbounded" } : config;
|
|
5379
|
-
const task = this.addTaskInstance(taskClass, { id: uuid47(), ...resolvedConfig });
|
|
5383
|
+
const task = this.addTaskInstance(taskClass, { id: uuid47(), ...resolvedConfig }, runConfig);
|
|
5380
5384
|
if (this._dataFlows.length > 0) {
|
|
5381
5385
|
this._dataFlows.forEach((dataflow) => {
|
|
5382
5386
|
const taskSchema = task.inputSchema();
|
|
@@ -5564,8 +5568,8 @@ function CreateWorkflow(taskClass) {
|
|
|
5564
5568
|
return Workflow.createWorkflow(taskClass);
|
|
5565
5569
|
}
|
|
5566
5570
|
function CreateLoopWorkflow(taskClass) {
|
|
5567
|
-
return function(config = {}) {
|
|
5568
|
-
return this.addLoopTask(taskClass, config);
|
|
5571
|
+
return function(config = {}, runConfig) {
|
|
5572
|
+
return this.addLoopTask(taskClass, config, runConfig);
|
|
5569
5573
|
};
|
|
5570
5574
|
}
|
|
5571
5575
|
function CreateEndLoopWorkflow(methodName) {
|
|
@@ -5579,13 +5583,13 @@ function CreateEndLoopWorkflow(methodName) {
|
|
|
5579
5583
|
function CreateAdaptiveWorkflow(scalarClass, vectorClass) {
|
|
5580
5584
|
const scalarHelper = Workflow.createWorkflow(scalarClass);
|
|
5581
5585
|
const vectorHelper = Workflow.createWorkflow(vectorClass);
|
|
5582
|
-
return function(input = {}, config = {}) {
|
|
5586
|
+
return function(input = {}, config = {}, runConfig) {
|
|
5583
5587
|
const parent = getLastTask(this);
|
|
5584
5588
|
const useVector = parent !== undefined && hasVectorOutput(parent) || hasVectorLikeInput(input);
|
|
5585
5589
|
if (useVector) {
|
|
5586
|
-
return vectorHelper.call(this, input, config);
|
|
5590
|
+
return vectorHelper.call(this, input, config, runConfig);
|
|
5587
5591
|
}
|
|
5588
|
-
return scalarHelper.call(this, input, config);
|
|
5592
|
+
return scalarHelper.call(this, input, config, runConfig);
|
|
5589
5593
|
};
|
|
5590
5594
|
}
|
|
5591
5595
|
|
|
@@ -5626,8 +5630,8 @@ class Workflow {
|
|
|
5626
5630
|
}
|
|
5627
5631
|
events = new EventEmitter5;
|
|
5628
5632
|
static createWorkflow(taskClass) {
|
|
5629
|
-
const helper = function(input = {}, config = {}) {
|
|
5630
|
-
this._builder.addTaskWithAutoConnect(taskClass, input, config);
|
|
5633
|
+
const helper = function(input = {}, config = {}, runConfig) {
|
|
5634
|
+
this._builder.addTaskWithAutoConnect(taskClass, input, config, runConfig);
|
|
5631
5635
|
return this;
|
|
5632
5636
|
};
|
|
5633
5637
|
helper.type = taskClass.runtype ?? taskClass.type;
|
|
@@ -5764,11 +5768,11 @@ class Workflow {
|
|
|
5764
5768
|
addTaskToGraph(taskClass, config) {
|
|
5765
5769
|
return this._builder.addTaskInstance(taskClass, config);
|
|
5766
5770
|
}
|
|
5767
|
-
addTask(taskClass, input, config) {
|
|
5768
|
-
return this._builder.addTaskWithAutoConnect(taskClass, input, config);
|
|
5771
|
+
addTask(taskClass, input, config, runConfig) {
|
|
5772
|
+
return this._builder.addTaskWithAutoConnect(taskClass, input, config, runConfig);
|
|
5769
5773
|
}
|
|
5770
|
-
addLoopTask(taskClass, config = {}) {
|
|
5771
|
-
return this._builder.addLoopTask(taskClass, config);
|
|
5774
|
+
addLoopTask(taskClass, config = {}, runConfig) {
|
|
5775
|
+
return this._builder.addLoopTask(taskClass, config, runConfig);
|
|
5772
5776
|
}
|
|
5773
5777
|
if(condition) {
|
|
5774
5778
|
return this._builder.createConditional(condition);
|
|
@@ -9638,4 +9642,4 @@ export {
|
|
|
9638
9642
|
BROWSER_GRANTS
|
|
9639
9643
|
};
|
|
9640
9644
|
|
|
9641
|
-
//# debugId=
|
|
9645
|
+
//# debugId=FD6A20DDE457DDC964756E2164756E21
|