@workglow/tasks 0.0.93 → 0.0.95

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
@@ -1602,6 +1602,26 @@ class InputTask extends Task13 {
1602
1602
  async executeReactive(input) {
1603
1603
  return input;
1604
1604
  }
1605
+ async* executeStream(input, context) {
1606
+ if (context.inputStreams) {
1607
+ for (const [, stream] of context.inputStreams) {
1608
+ const reader = stream.getReader();
1609
+ try {
1610
+ while (true) {
1611
+ const { done, value } = await reader.read();
1612
+ if (done)
1613
+ break;
1614
+ if (value.type === "finish")
1615
+ continue;
1616
+ yield value;
1617
+ }
1618
+ } finally {
1619
+ reader.releaseLock();
1620
+ }
1621
+ }
1622
+ }
1623
+ yield { type: "finish", data: input };
1624
+ }
1605
1625
  }
1606
1626
  Workflow16.prototype.input = CreateWorkflow15(InputTask);
1607
1627
  // src/task/JavaScriptTask.ts
@@ -6357,6 +6377,26 @@ class OutputTask extends Task17 {
6357
6377
  async executeReactive(input2) {
6358
6378
  return input2;
6359
6379
  }
6380
+ async* executeStream(input2, context) {
6381
+ if (context.inputStreams) {
6382
+ for (const [, stream] of context.inputStreams) {
6383
+ const reader = stream.getReader();
6384
+ try {
6385
+ while (true) {
6386
+ const { done, value } = await reader.read();
6387
+ if (done)
6388
+ break;
6389
+ if (value.type === "finish")
6390
+ continue;
6391
+ yield value;
6392
+ }
6393
+ } finally {
6394
+ reader.releaseLock();
6395
+ }
6396
+ }
6397
+ }
6398
+ yield { type: "finish", data: input2 };
6399
+ }
6360
6400
  }
6361
6401
  Workflow21.prototype.output = CreateWorkflow20(OutputTask);
6362
6402
  // src/task/SplitTask.ts
@@ -7022,4 +7062,4 @@ export {
7022
7062
  ArrayTask
7023
7063
  };
7024
7064
 
7025
- //# debugId=0DEA1074A872FE9464756E2164756E21
7065
+ //# debugId=A21D807CC9BF707864756E2164756E21