@workglow/tasks 0.0.90 → 0.0.91

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 (57) hide show
  1. package/dist/browser.js +1155 -66
  2. package/dist/browser.js.map +26 -4
  3. package/dist/bun.js +1155 -66
  4. package/dist/bun.js.map +26 -4
  5. package/dist/common.d.ts +43 -1
  6. package/dist/common.d.ts.map +1 -1
  7. package/dist/node.js +1155 -66
  8. package/dist/node.js.map +26 -4
  9. package/dist/task/adaptive.d.ts +16 -0
  10. package/dist/task/adaptive.d.ts.map +1 -0
  11. package/dist/task/scalar/ScalarAbsTask.d.ts +71 -0
  12. package/dist/task/scalar/ScalarAbsTask.d.ts.map +1 -0
  13. package/dist/task/scalar/ScalarAddTask.d.ts +81 -0
  14. package/dist/task/scalar/ScalarAddTask.d.ts.map +1 -0
  15. package/dist/task/scalar/ScalarCeilTask.d.ts +71 -0
  16. package/dist/task/scalar/ScalarCeilTask.d.ts.map +1 -0
  17. package/dist/task/scalar/ScalarDivideTask.d.ts +81 -0
  18. package/dist/task/scalar/ScalarDivideTask.d.ts.map +1 -0
  19. package/dist/task/scalar/ScalarFloorTask.d.ts +71 -0
  20. package/dist/task/scalar/ScalarFloorTask.d.ts.map +1 -0
  21. package/dist/task/scalar/ScalarMaxTask.d.ts +77 -0
  22. package/dist/task/scalar/ScalarMaxTask.d.ts.map +1 -0
  23. package/dist/task/scalar/ScalarMinTask.d.ts +77 -0
  24. package/dist/task/scalar/ScalarMinTask.d.ts.map +1 -0
  25. package/dist/task/scalar/ScalarMultiplyTask.d.ts +81 -0
  26. package/dist/task/scalar/ScalarMultiplyTask.d.ts.map +1 -0
  27. package/dist/task/scalar/ScalarRoundTask.d.ts +71 -0
  28. package/dist/task/scalar/ScalarRoundTask.d.ts.map +1 -0
  29. package/dist/task/scalar/ScalarSubtractTask.d.ts +81 -0
  30. package/dist/task/scalar/ScalarSubtractTask.d.ts.map +1 -0
  31. package/dist/task/scalar/ScalarSumTask.d.ts +77 -0
  32. package/dist/task/scalar/ScalarSumTask.d.ts.map +1 -0
  33. package/dist/task/scalar/ScalarTruncTask.d.ts +71 -0
  34. package/dist/task/scalar/ScalarTruncTask.d.ts.map +1 -0
  35. package/dist/task/scalar/scalar.test.d.ts +7 -0
  36. package/dist/task/scalar/scalar.test.d.ts.map +1 -0
  37. package/dist/task/scalar/sumPrecise.d.ts +12 -0
  38. package/dist/task/scalar/sumPrecise.d.ts.map +1 -0
  39. package/dist/task/vector/VectorDistanceTask.d.ts +83 -0
  40. package/dist/task/vector/VectorDistanceTask.d.ts.map +1 -0
  41. package/dist/task/vector/VectorDivideTask.d.ts +85 -0
  42. package/dist/task/vector/VectorDivideTask.d.ts.map +1 -0
  43. package/dist/task/vector/VectorDotProductTask.d.ts +83 -0
  44. package/dist/task/vector/VectorDotProductTask.d.ts.map +1 -0
  45. package/dist/task/vector/VectorMultiplyTask.d.ts +85 -0
  46. package/dist/task/vector/VectorMultiplyTask.d.ts.map +1 -0
  47. package/dist/task/vector/VectorNormalizeTask.d.ts +75 -0
  48. package/dist/task/vector/VectorNormalizeTask.d.ts.map +1 -0
  49. package/dist/task/vector/VectorScaleTask.d.ts +85 -0
  50. package/dist/task/vector/VectorScaleTask.d.ts.map +1 -0
  51. package/dist/task/vector/VectorSubtractTask.d.ts +85 -0
  52. package/dist/task/vector/VectorSubtractTask.d.ts.map +1 -0
  53. package/dist/task/vector/VectorSumTask.d.ts +85 -0
  54. package/dist/task/vector/VectorSumTask.d.ts.map +1 -0
  55. package/dist/task/vector/vector.test.d.ts +7 -0
  56. package/dist/task/vector/vector.test.d.ts.map +1 -0
  57. package/package.json +9 -9
package/dist/browser.js CHANGED
@@ -622,6 +622,534 @@ var fileLoader = (input, config) => {
622
622
  };
623
623
  Workflow2.prototype.fileLoader = CreateWorkflow2(FileLoaderTask);
624
624
 
625
+ // src/task/adaptive.ts
626
+ import { CreateAdaptiveWorkflow, Workflow as Workflow12 } from "@workglow/task-graph";
627
+
628
+ // src/task/scalar/ScalarAddTask.ts
629
+ import { CreateWorkflow as CreateWorkflow3, Task as Task2, Workflow as Workflow3 } from "@workglow/task-graph";
630
+
631
+ // src/task/scalar/sumPrecise.ts
632
+ function kahanSum(values) {
633
+ let sum = 0;
634
+ let compensation = 0;
635
+ for (const value of values) {
636
+ const y = value - compensation;
637
+ const t = sum + y;
638
+ compensation = t - sum - y;
639
+ sum = t;
640
+ }
641
+ return sum;
642
+ }
643
+ var nativeSumPrecise = typeof Math.sumPrecise === "function" ? Math.sumPrecise : undefined;
644
+ var sumPrecise = nativeSumPrecise ? nativeSumPrecise.bind(Math) : kahanSum;
645
+
646
+ // src/task/scalar/ScalarAddTask.ts
647
+ var inputSchema3 = {
648
+ type: "object",
649
+ properties: {
650
+ a: {
651
+ type: "number",
652
+ title: "A",
653
+ description: "First number"
654
+ },
655
+ b: {
656
+ type: "number",
657
+ title: "B",
658
+ description: "Second number"
659
+ }
660
+ },
661
+ required: ["a", "b"],
662
+ additionalProperties: false
663
+ };
664
+ var outputSchema3 = {
665
+ type: "object",
666
+ properties: {
667
+ result: {
668
+ type: "number",
669
+ title: "Result",
670
+ description: "Sum of a and b"
671
+ }
672
+ },
673
+ required: ["result"],
674
+ additionalProperties: false
675
+ };
676
+
677
+ class ScalarAddTask extends Task2 {
678
+ static type = "ScalarAddTask";
679
+ static category = "Math";
680
+ static title = "Add";
681
+ static description = "Returns the sum of two numbers";
682
+ static inputSchema() {
683
+ return inputSchema3;
684
+ }
685
+ static outputSchema() {
686
+ return outputSchema3;
687
+ }
688
+ async execute(input, _context) {
689
+ return { result: sumPrecise([input.a, input.b]) };
690
+ }
691
+ }
692
+ Workflow3.prototype.scalarAdd = CreateWorkflow3(ScalarAddTask);
693
+
694
+ // src/task/scalar/ScalarDivideTask.ts
695
+ import { CreateWorkflow as CreateWorkflow4, Task as Task3, Workflow as Workflow4 } from "@workglow/task-graph";
696
+ var inputSchema4 = {
697
+ type: "object",
698
+ properties: {
699
+ a: {
700
+ type: "number",
701
+ title: "A",
702
+ description: "Numerator"
703
+ },
704
+ b: {
705
+ type: "number",
706
+ title: "B",
707
+ description: "Denominator"
708
+ }
709
+ },
710
+ required: ["a", "b"],
711
+ additionalProperties: false
712
+ };
713
+ var outputSchema4 = {
714
+ type: "object",
715
+ properties: {
716
+ result: {
717
+ type: "number",
718
+ title: "Result",
719
+ description: "Quotient (a / b)"
720
+ }
721
+ },
722
+ required: ["result"],
723
+ additionalProperties: false
724
+ };
725
+
726
+ class ScalarDivideTask extends Task3 {
727
+ static type = "ScalarDivideTask";
728
+ static category = "Math";
729
+ static title = "Divide";
730
+ static description = "Returns the quotient of two numbers (a / b)";
731
+ static inputSchema() {
732
+ return inputSchema4;
733
+ }
734
+ static outputSchema() {
735
+ return outputSchema4;
736
+ }
737
+ async execute(input, _context) {
738
+ return { result: input.a / input.b };
739
+ }
740
+ }
741
+ Workflow4.prototype.scalarDivide = CreateWorkflow4(ScalarDivideTask);
742
+
743
+ // src/task/scalar/ScalarMultiplyTask.ts
744
+ import { CreateWorkflow as CreateWorkflow5, Task as Task4, Workflow as Workflow5 } from "@workglow/task-graph";
745
+ var inputSchema5 = {
746
+ type: "object",
747
+ properties: {
748
+ a: {
749
+ type: "number",
750
+ title: "A",
751
+ description: "First number"
752
+ },
753
+ b: {
754
+ type: "number",
755
+ title: "B",
756
+ description: "Second number"
757
+ }
758
+ },
759
+ required: ["a", "b"],
760
+ additionalProperties: false
761
+ };
762
+ var outputSchema5 = {
763
+ type: "object",
764
+ properties: {
765
+ result: {
766
+ type: "number",
767
+ title: "Result",
768
+ description: "Product of a and b"
769
+ }
770
+ },
771
+ required: ["result"],
772
+ additionalProperties: false
773
+ };
774
+
775
+ class ScalarMultiplyTask extends Task4 {
776
+ static type = "ScalarMultiplyTask";
777
+ static category = "Math";
778
+ static title = "Multiply";
779
+ static description = "Returns the product of two numbers";
780
+ static inputSchema() {
781
+ return inputSchema5;
782
+ }
783
+ static outputSchema() {
784
+ return outputSchema5;
785
+ }
786
+ async execute(input, _context) {
787
+ return { result: input.a * input.b };
788
+ }
789
+ }
790
+ Workflow5.prototype.scalarMultiply = CreateWorkflow5(ScalarMultiplyTask);
791
+
792
+ // src/task/scalar/ScalarSubtractTask.ts
793
+ import { CreateWorkflow as CreateWorkflow6, Task as Task5, Workflow as Workflow6 } from "@workglow/task-graph";
794
+ var inputSchema6 = {
795
+ type: "object",
796
+ properties: {
797
+ a: {
798
+ type: "number",
799
+ title: "A",
800
+ description: "First number"
801
+ },
802
+ b: {
803
+ type: "number",
804
+ title: "B",
805
+ description: "Second number"
806
+ }
807
+ },
808
+ required: ["a", "b"],
809
+ additionalProperties: false
810
+ };
811
+ var outputSchema6 = {
812
+ type: "object",
813
+ properties: {
814
+ result: {
815
+ type: "number",
816
+ title: "Result",
817
+ description: "Difference (a - b)"
818
+ }
819
+ },
820
+ required: ["result"],
821
+ additionalProperties: false
822
+ };
823
+
824
+ class ScalarSubtractTask extends Task5 {
825
+ static type = "ScalarSubtractTask";
826
+ static category = "Math";
827
+ static title = "Subtract";
828
+ static description = "Returns the difference of two numbers (a - b)";
829
+ static inputSchema() {
830
+ return inputSchema6;
831
+ }
832
+ static outputSchema() {
833
+ return outputSchema6;
834
+ }
835
+ async execute(input, _context) {
836
+ return { result: input.a - input.b };
837
+ }
838
+ }
839
+ Workflow6.prototype.scalarSubtract = CreateWorkflow6(ScalarSubtractTask);
840
+
841
+ // src/task/scalar/ScalarSumTask.ts
842
+ import { CreateWorkflow as CreateWorkflow7, Task as Task6, Workflow as Workflow7 } from "@workglow/task-graph";
843
+ var inputSchema7 = {
844
+ type: "object",
845
+ properties: {
846
+ values: {
847
+ type: "array",
848
+ items: { type: "number" },
849
+ title: "Values",
850
+ description: "Array of numbers to sum"
851
+ }
852
+ },
853
+ required: ["values"],
854
+ additionalProperties: false
855
+ };
856
+ var outputSchema7 = {
857
+ type: "object",
858
+ properties: {
859
+ result: {
860
+ type: "number",
861
+ title: "Result",
862
+ description: "Sum of all values"
863
+ }
864
+ },
865
+ required: ["result"],
866
+ additionalProperties: false
867
+ };
868
+
869
+ class ScalarSumTask extends Task6 {
870
+ static type = "ScalarSumTask";
871
+ static category = "Math";
872
+ static title = "Sum";
873
+ static description = "Returns the sum of an array of numbers";
874
+ static inputSchema() {
875
+ return inputSchema7;
876
+ }
877
+ static outputSchema() {
878
+ return outputSchema7;
879
+ }
880
+ async execute(input, _context) {
881
+ return { result: sumPrecise(input.values) };
882
+ }
883
+ }
884
+ Workflow7.prototype.scalarSum = CreateWorkflow7(ScalarSumTask);
885
+
886
+ // src/task/vector/VectorDivideTask.ts
887
+ import { CreateWorkflow as CreateWorkflow8, Task as Task7, Workflow as Workflow8 } from "@workglow/task-graph";
888
+ import {
889
+ createTypedArrayFrom,
890
+ TypedArraySchema
891
+ } from "@workglow/util";
892
+ var inputSchema8 = {
893
+ type: "object",
894
+ properties: {
895
+ vectors: {
896
+ type: "array",
897
+ items: TypedArraySchema({
898
+ title: "Vector",
899
+ description: "Vector (first is numerator, rest are denominators)"
900
+ }),
901
+ title: "Vectors",
902
+ description: "Array of vectors: vectors[0] / vectors[1] / vectors[2] / ..."
903
+ }
904
+ },
905
+ required: ["vectors"],
906
+ additionalProperties: false
907
+ };
908
+ var outputSchema8 = {
909
+ type: "object",
910
+ properties: {
911
+ result: TypedArraySchema({
912
+ title: "Result",
913
+ description: "Component-wise quotient"
914
+ })
915
+ },
916
+ required: ["result"],
917
+ additionalProperties: false
918
+ };
919
+
920
+ class VectorDivideTask extends Task7 {
921
+ static type = "VectorDivideTask";
922
+ static category = "Vector";
923
+ static title = "Divide";
924
+ static description = "Returns component-wise quotient: vectors[0] / vectors[1] / vectors[2] / ...";
925
+ static inputSchema() {
926
+ return inputSchema8;
927
+ }
928
+ static outputSchema() {
929
+ return outputSchema8;
930
+ }
931
+ async execute(input, _context) {
932
+ const { vectors } = input;
933
+ if (vectors.length < 2) {
934
+ throw new Error("At least two vectors are required");
935
+ }
936
+ const len = vectors[0].length;
937
+ for (let i = 1;i < vectors.length; i++) {
938
+ if (vectors[i].length !== len) {
939
+ throw new Error("All vectors must have the same length");
940
+ }
941
+ }
942
+ const values = Array.from({ length: len }, (_, i) => {
943
+ let acc = Number(vectors[0][i]);
944
+ for (let j = 1;j < vectors.length; j++) {
945
+ acc /= Number(vectors[j][i]);
946
+ }
947
+ return acc;
948
+ });
949
+ return { result: createTypedArrayFrom(vectors, values) };
950
+ }
951
+ }
952
+ Workflow8.prototype.vectorDivide = CreateWorkflow8(VectorDivideTask);
953
+
954
+ // src/task/vector/VectorMultiplyTask.ts
955
+ import { CreateWorkflow as CreateWorkflow9, Task as Task8, Workflow as Workflow9 } from "@workglow/task-graph";
956
+ import {
957
+ createTypedArrayFrom as createTypedArrayFrom2,
958
+ TypedArraySchema as TypedArraySchema2
959
+ } from "@workglow/util";
960
+ var inputSchema9 = {
961
+ type: "object",
962
+ properties: {
963
+ vectors: {
964
+ type: "array",
965
+ items: TypedArraySchema2({
966
+ title: "Vector",
967
+ description: "Vector for component-wise product"
968
+ }),
969
+ title: "Vectors",
970
+ description: "Array of vectors to multiply component-wise"
971
+ }
972
+ },
973
+ required: ["vectors"],
974
+ additionalProperties: false
975
+ };
976
+ var outputSchema9 = {
977
+ type: "object",
978
+ properties: {
979
+ result: TypedArraySchema2({
980
+ title: "Result",
981
+ description: "Component-wise product (Hadamard product)"
982
+ })
983
+ },
984
+ required: ["result"],
985
+ additionalProperties: false
986
+ };
987
+
988
+ class VectorMultiplyTask extends Task8 {
989
+ static type = "VectorMultiplyTask";
990
+ static category = "Vector";
991
+ static title = "Multiply";
992
+ static description = "Returns the component-wise product (Hadamard product) of all vectors";
993
+ static inputSchema() {
994
+ return inputSchema9;
995
+ }
996
+ static outputSchema() {
997
+ return outputSchema9;
998
+ }
999
+ async execute(input, _context) {
1000
+ const { vectors } = input;
1001
+ if (vectors.length === 0) {
1002
+ throw new Error("At least one vector is required");
1003
+ }
1004
+ const len = vectors[0].length;
1005
+ for (let i = 1;i < vectors.length; i++) {
1006
+ if (vectors[i].length !== len) {
1007
+ throw new Error("All vectors must have the same length");
1008
+ }
1009
+ }
1010
+ const values = Array.from({ length: len }, (_, i) => vectors.reduce((acc, v) => acc * Number(v[i]), 1));
1011
+ return { result: createTypedArrayFrom2(vectors, values) };
1012
+ }
1013
+ }
1014
+ Workflow9.prototype.vectorMultiply = CreateWorkflow9(VectorMultiplyTask);
1015
+
1016
+ // src/task/vector/VectorSubtractTask.ts
1017
+ import { CreateWorkflow as CreateWorkflow10, Task as Task9, Workflow as Workflow10 } from "@workglow/task-graph";
1018
+ import {
1019
+ createTypedArrayFrom as createTypedArrayFrom3,
1020
+ TypedArraySchema as TypedArraySchema3
1021
+ } from "@workglow/util";
1022
+ var inputSchema10 = {
1023
+ type: "object",
1024
+ properties: {
1025
+ vectors: {
1026
+ type: "array",
1027
+ items: TypedArraySchema3({
1028
+ title: "Vector",
1029
+ description: "Vector (first is minuend, rest are subtrahends)"
1030
+ }),
1031
+ title: "Vectors",
1032
+ description: "Array of vectors: vectors[0] - vectors[1] - vectors[2] - ..."
1033
+ }
1034
+ },
1035
+ required: ["vectors"],
1036
+ additionalProperties: false
1037
+ };
1038
+ var outputSchema10 = {
1039
+ type: "object",
1040
+ properties: {
1041
+ result: TypedArraySchema3({
1042
+ title: "Result",
1043
+ description: "Difference of vectors"
1044
+ })
1045
+ },
1046
+ required: ["result"],
1047
+ additionalProperties: false
1048
+ };
1049
+
1050
+ class VectorSubtractTask extends Task9 {
1051
+ static type = "VectorSubtractTask";
1052
+ static category = "Vector";
1053
+ static title = "Subtract";
1054
+ static description = "Returns component-wise difference: vectors[0] - vectors[1] - vectors[2] - ...";
1055
+ static inputSchema() {
1056
+ return inputSchema10;
1057
+ }
1058
+ static outputSchema() {
1059
+ return outputSchema10;
1060
+ }
1061
+ async execute(input, _context) {
1062
+ const { vectors } = input;
1063
+ if (vectors.length < 2) {
1064
+ throw new Error("At least two vectors are required");
1065
+ }
1066
+ const len = vectors[0].length;
1067
+ for (let i = 1;i < vectors.length; i++) {
1068
+ if (vectors[i].length !== len) {
1069
+ throw new Error("All vectors must have the same length");
1070
+ }
1071
+ }
1072
+ const values = Array.from({ length: len }, (_, i) => {
1073
+ let acc = Number(vectors[0][i]);
1074
+ for (let j = 1;j < vectors.length; j++) {
1075
+ acc -= Number(vectors[j][i]);
1076
+ }
1077
+ return acc;
1078
+ });
1079
+ return { result: createTypedArrayFrom3(vectors, values) };
1080
+ }
1081
+ }
1082
+ Workflow10.prototype.vectorSubtract = CreateWorkflow10(VectorSubtractTask);
1083
+
1084
+ // src/task/vector/VectorSumTask.ts
1085
+ import { CreateWorkflow as CreateWorkflow11, Task as Task10, Workflow as Workflow11 } from "@workglow/task-graph";
1086
+ import {
1087
+ createTypedArrayFrom as createTypedArrayFrom4,
1088
+ TypedArraySchema as TypedArraySchema4
1089
+ } from "@workglow/util";
1090
+ var inputSchema11 = {
1091
+ type: "object",
1092
+ properties: {
1093
+ vectors: {
1094
+ type: "array",
1095
+ items: TypedArraySchema4({
1096
+ title: "Vector",
1097
+ description: "Vector to sum"
1098
+ }),
1099
+ title: "Vectors",
1100
+ description: "Array of vectors to sum component-wise"
1101
+ }
1102
+ },
1103
+ required: ["vectors"],
1104
+ additionalProperties: false
1105
+ };
1106
+ var outputSchema11 = {
1107
+ type: "object",
1108
+ properties: {
1109
+ result: TypedArraySchema4({
1110
+ title: "Result",
1111
+ description: "Sum of vectors"
1112
+ })
1113
+ },
1114
+ required: ["result"],
1115
+ additionalProperties: false
1116
+ };
1117
+
1118
+ class VectorSumTask extends Task10 {
1119
+ static type = "VectorSumTask";
1120
+ static category = "Vector";
1121
+ static title = "Sum";
1122
+ static description = "Returns the component-wise sum of an array of vectors";
1123
+ static inputSchema() {
1124
+ return inputSchema11;
1125
+ }
1126
+ static outputSchema() {
1127
+ return outputSchema11;
1128
+ }
1129
+ async execute(input, _context) {
1130
+ const { vectors } = input;
1131
+ if (vectors.length === 0) {
1132
+ throw new Error("At least one vector is required");
1133
+ }
1134
+ const len = vectors[0].length;
1135
+ for (let i = 1;i < vectors.length; i++) {
1136
+ if (vectors[i].length !== len) {
1137
+ throw new Error("All vectors must have the same length");
1138
+ }
1139
+ }
1140
+ const values = Array.from({ length: len }, (_, i) => sumPrecise(vectors.map((v) => Number(v[i]))));
1141
+ return { result: createTypedArrayFrom4(vectors, values) };
1142
+ }
1143
+ }
1144
+ Workflow11.prototype.vectorSum = CreateWorkflow11(VectorSumTask);
1145
+
1146
+ // src/task/adaptive.ts
1147
+ Workflow12.prototype.add = CreateAdaptiveWorkflow(ScalarAddTask, VectorSumTask);
1148
+ Workflow12.prototype.subtract = CreateAdaptiveWorkflow(ScalarSubtractTask, VectorSubtractTask);
1149
+ Workflow12.prototype.multiply = CreateAdaptiveWorkflow(ScalarMultiplyTask, VectorMultiplyTask);
1150
+ Workflow12.prototype.divide = CreateAdaptiveWorkflow(ScalarDivideTask, VectorDivideTask);
1151
+ Workflow12.prototype.sum = CreateAdaptiveWorkflow(ScalarSumTask, VectorSumTask);
1152
+
625
1153
  // src/task/ArrayTask.ts
626
1154
  import {
627
1155
  uuid4
@@ -656,12 +1184,12 @@ class ArrayTask extends GraphAsTask {
656
1184
  regenerateGraph() {
657
1185
  const arrayInputs = new Map;
658
1186
  let hasArrayInputs = false;
659
- const inputSchema3 = this.inputSchema();
660
- if (typeof inputSchema3 !== "boolean") {
661
- const keys = Object.keys(inputSchema3.properties || {});
1187
+ const inputSchema12 = this.inputSchema();
1188
+ if (typeof inputSchema12 !== "boolean") {
1189
+ const keys = Object.keys(inputSchema12.properties || {});
662
1190
  for (const inputId of keys) {
663
1191
  const inputValue = this.runInputData[inputId];
664
- const inputDef = inputSchema3.properties?.[inputId];
1192
+ const inputDef = inputSchema12.properties?.[inputId];
665
1193
  if (typeof inputDef === "object" && inputDef !== null && "x-replicate" in inputDef && inputDef["x-replicate"] === true && Array.isArray(inputValue) && inputValue.length > 1) {
666
1194
  arrayInputs.set(inputId, inputValue);
667
1195
  hasArrayInputs = true;
@@ -750,10 +1278,10 @@ class ArrayTaskRunner extends GraphAsTaskRunner {
750
1278
  }
751
1279
  }
752
1280
  // src/task/DebugLogTask.ts
753
- import { CreateWorkflow as CreateWorkflow3, Task as Task2, Workflow as Workflow3 } from "@workglow/task-graph";
1281
+ import { CreateWorkflow as CreateWorkflow12, Task as Task11, Workflow as Workflow13 } from "@workglow/task-graph";
754
1282
  var log_levels = ["dir", "log", "debug", "info", "warn", "error"];
755
1283
  var DEFAULT_LOG_LEVEL = "log";
756
- var inputSchema3 = {
1284
+ var inputSchema12 = {
757
1285
  type: "object",
758
1286
  properties: {
759
1287
  console: {
@@ -770,7 +1298,7 @@ var inputSchema3 = {
770
1298
  },
771
1299
  additionalProperties: false
772
1300
  };
773
- var outputSchema3 = {
1301
+ var outputSchema12 = {
774
1302
  type: "object",
775
1303
  properties: {
776
1304
  console: {
@@ -781,17 +1309,17 @@ var outputSchema3 = {
781
1309
  additionalProperties: false
782
1310
  };
783
1311
 
784
- class DebugLogTask extends Task2 {
1312
+ class DebugLogTask extends Task11 {
785
1313
  static type = "DebugLogTask";
786
1314
  static category = "Utility";
787
1315
  static title = "Debug Log";
788
1316
  static description = "Logs messages to the console with configurable log levels for debugging task graphs";
789
1317
  static cacheable = false;
790
1318
  static inputSchema() {
791
- return inputSchema3;
1319
+ return inputSchema12;
792
1320
  }
793
1321
  static outputSchema() {
794
- return outputSchema3;
1322
+ return outputSchema12;
795
1323
  }
796
1324
  async executeReactive(input, output) {
797
1325
  const { log_level = DEFAULT_LOG_LEVEL, console: messages } = input;
@@ -808,16 +1336,16 @@ var debugLog = (input, config = {}) => {
808
1336
  const task = new DebugLogTask({}, config);
809
1337
  return task.run(input);
810
1338
  };
811
- Workflow3.prototype.debugLog = CreateWorkflow3(DebugLogTask);
1339
+ Workflow13.prototype.debugLog = CreateWorkflow12(DebugLogTask);
812
1340
  // src/task/DelayTask.ts
813
1341
  import {
814
- CreateWorkflow as CreateWorkflow4,
815
- Task as Task3,
1342
+ CreateWorkflow as CreateWorkflow13,
1343
+ Task as Task12,
816
1344
  TaskAbortedError as TaskAbortedError2,
817
- Workflow as Workflow4
1345
+ Workflow as Workflow14
818
1346
  } from "@workglow/task-graph";
819
1347
  import { sleep } from "@workglow/util";
820
- var inputSchema4 = {
1348
+ var inputSchema13 = {
821
1349
  type: "object",
822
1350
  properties: {
823
1351
  delay: {
@@ -832,22 +1360,22 @@ var inputSchema4 = {
832
1360
  },
833
1361
  additionalProperties: false
834
1362
  };
835
- var outputSchema4 = {
1363
+ var outputSchema13 = {
836
1364
  type: "object",
837
1365
  properties: {},
838
1366
  additionalProperties: true
839
1367
  };
840
1368
 
841
- class DelayTask extends Task3 {
1369
+ class DelayTask extends Task12 {
842
1370
  static type = "DelayTask";
843
1371
  static category = "Utility";
844
1372
  static title = "Delay";
845
1373
  static description = "Delays execution for a specified duration with progress tracking";
846
1374
  static inputSchema() {
847
- return inputSchema4;
1375
+ return inputSchema13;
848
1376
  }
849
1377
  static outputSchema() {
850
- return outputSchema4;
1378
+ return outputSchema13;
851
1379
  }
852
1380
  async execute(input, executeContext) {
853
1381
  const delay = input.delay ?? 0;
@@ -871,11 +1399,11 @@ var delay = (input, config = {}) => {
871
1399
  const task = new DelayTask({}, config);
872
1400
  return task.run(input);
873
1401
  };
874
- Workflow4.prototype.delay = CreateWorkflow4(DelayTask);
1402
+ Workflow14.prototype.delay = CreateWorkflow13(DelayTask);
875
1403
  // src/task/InputTask.ts
876
- import { CreateWorkflow as CreateWorkflow5, Task as Task4, Workflow as Workflow5 } from "@workglow/task-graph";
1404
+ import { CreateWorkflow as CreateWorkflow14, Task as Task13, Workflow as Workflow15 } from "@workglow/task-graph";
877
1405
 
878
- class InputTask extends Task4 {
1406
+ class InputTask extends Task13 {
879
1407
  static type = "InputTask";
880
1408
  static category = "Flow Control";
881
1409
  static title = "Input";
@@ -909,9 +1437,9 @@ class InputTask extends Task4 {
909
1437
  return input;
910
1438
  }
911
1439
  }
912
- Workflow5.prototype.input = CreateWorkflow5(InputTask);
1440
+ Workflow15.prototype.input = CreateWorkflow14(InputTask);
913
1441
  // src/task/JavaScriptTask.ts
914
- import { CreateWorkflow as CreateWorkflow6, Task as Task5, Workflow as Workflow6 } from "@workglow/task-graph";
1442
+ import { CreateWorkflow as CreateWorkflow15, Task as Task14, Workflow as Workflow16 } from "@workglow/task-graph";
915
1443
 
916
1444
  // src/util/acorn.js
917
1445
  var options;
@@ -5374,7 +5902,7 @@ Interpreter["VALUE_IN_DESCRIPTOR"] = Interpreter.VALUE_IN_DESCRIPTOR;
5374
5902
  Interpreter["Status"] = Interpreter.Status;
5375
5903
 
5376
5904
  // src/task/JavaScriptTask.ts
5377
- var inputSchema5 = {
5905
+ var inputSchema14 = {
5378
5906
  type: "object",
5379
5907
  properties: {
5380
5908
  javascript_code: {
@@ -5388,7 +5916,7 @@ var inputSchema5 = {
5388
5916
  required: ["javascript_code"],
5389
5917
  additionalProperties: true
5390
5918
  };
5391
- var outputSchema5 = {
5919
+ var outputSchema14 = {
5392
5920
  type: "object",
5393
5921
  properties: {
5394
5922
  output: {
@@ -5400,16 +5928,16 @@ var outputSchema5 = {
5400
5928
  additionalProperties: false
5401
5929
  };
5402
5930
 
5403
- class JavaScriptTask extends Task5 {
5931
+ class JavaScriptTask extends Task14 {
5404
5932
  static type = "JavaScriptTask";
5405
5933
  static category = "Utility";
5406
5934
  static title = "JavaScript Interpreter";
5407
5935
  static description = "Executes JavaScript code in a sandboxed interpreter environment";
5408
5936
  static inputSchema() {
5409
- return inputSchema5;
5937
+ return inputSchema14;
5410
5938
  }
5411
5939
  static outputSchema() {
5412
- return outputSchema5;
5940
+ return outputSchema14;
5413
5941
  }
5414
5942
  async executeReactive(input2, output) {
5415
5943
  if (input2.javascript_code) {
@@ -5428,18 +5956,18 @@ class JavaScriptTask extends Task5 {
5428
5956
  var javaScript = (input2, config = {}) => {
5429
5957
  return new JavaScriptTask({}, config).run(input2);
5430
5958
  };
5431
- Workflow6.prototype.javaScript = CreateWorkflow6(JavaScriptTask);
5959
+ Workflow16.prototype.javaScript = CreateWorkflow15(JavaScriptTask);
5432
5960
  // src/task/JsonTask.ts
5433
5961
  import {
5434
5962
  createGraphFromDependencyJSON,
5435
5963
  createGraphFromGraphJSON,
5436
- CreateWorkflow as CreateWorkflow7,
5964
+ CreateWorkflow as CreateWorkflow16,
5437
5965
  Dataflow,
5438
5966
  GraphAsTask as GraphAsTask2,
5439
5967
  TaskConfigurationError as TaskConfigurationError2,
5440
- Workflow as Workflow7
5968
+ Workflow as Workflow17
5441
5969
  } from "@workglow/task-graph";
5442
- var inputSchema6 = {
5970
+ var inputSchema15 = {
5443
5971
  type: "object",
5444
5972
  properties: {
5445
5973
  json: {
@@ -5450,7 +5978,7 @@ var inputSchema6 = {
5450
5978
  },
5451
5979
  additionalProperties: false
5452
5980
  };
5453
- var outputSchema6 = {
5981
+ var outputSchema15 = {
5454
5982
  type: "object",
5455
5983
  properties: {
5456
5984
  output: {
@@ -5467,10 +5995,10 @@ class JsonTask extends GraphAsTask2 {
5467
5995
  static title = "JSON Task";
5468
5996
  static description = "A task that creates and manages task graphs from JSON configurations";
5469
5997
  static inputSchema() {
5470
- return inputSchema6;
5998
+ return inputSchema15;
5471
5999
  }
5472
6000
  static outputSchema() {
5473
- return outputSchema6;
6001
+ return outputSchema15;
5474
6002
  }
5475
6003
  regenerateGraph() {
5476
6004
  if (!this.runInputData.json)
@@ -5504,16 +6032,16 @@ class JsonTask extends GraphAsTask2 {
5504
6032
  var json = (input2, config = {}) => {
5505
6033
  return new JsonTask({}, config).run(input2);
5506
6034
  };
5507
- Workflow7.prototype.json = CreateWorkflow7(JsonTask);
6035
+ Workflow17.prototype.json = CreateWorkflow16(JsonTask);
5508
6036
  // src/task/LambdaTask.ts
5509
6037
  import {
5510
- CreateWorkflow as CreateWorkflow8,
6038
+ CreateWorkflow as CreateWorkflow17,
5511
6039
  DATAFLOW_ALL_PORTS,
5512
- Task as Task6,
6040
+ Task as Task15,
5513
6041
  TaskConfigurationError as TaskConfigurationError3,
5514
- Workflow as Workflow8
6042
+ Workflow as Workflow18
5515
6043
  } from "@workglow/task-graph";
5516
- var inputSchema7 = {
6044
+ var inputSchema16 = {
5517
6045
  type: "object",
5518
6046
  properties: {
5519
6047
  [DATAFLOW_ALL_PORTS]: {
@@ -5523,7 +6051,7 @@ var inputSchema7 = {
5523
6051
  },
5524
6052
  additionalProperties: true
5525
6053
  };
5526
- var outputSchema7 = {
6054
+ var outputSchema16 = {
5527
6055
  type: "object",
5528
6056
  properties: {
5529
6057
  [DATAFLOW_ALL_PORTS]: {
@@ -5534,17 +6062,17 @@ var outputSchema7 = {
5534
6062
  additionalProperties: true
5535
6063
  };
5536
6064
 
5537
- class LambdaTask extends Task6 {
6065
+ class LambdaTask extends Task15 {
5538
6066
  static type = "LambdaTask";
5539
6067
  static title = "Lambda Task";
5540
6068
  static description = "A task that wraps a provided function and its input";
5541
6069
  static category = "Hidden";
5542
6070
  static cacheable = true;
5543
6071
  static inputSchema() {
5544
- return inputSchema7;
6072
+ return inputSchema16;
5545
6073
  }
5546
6074
  static outputSchema() {
5547
- return outputSchema7;
6075
+ return outputSchema16;
5548
6076
  }
5549
6077
  constructor(input2 = {}, config = {}) {
5550
6078
  if (!config.execute && !config.executeReactive) {
@@ -5582,15 +6110,15 @@ function lambda(input2, config) {
5582
6110
  const task = new LambdaTask(input2, config);
5583
6111
  return task.run();
5584
6112
  }
5585
- Workflow8.prototype.lambda = CreateWorkflow8(LambdaTask);
6113
+ Workflow18.prototype.lambda = CreateWorkflow17(LambdaTask);
5586
6114
  // src/task/MergeTask.ts
5587
- import { CreateWorkflow as CreateWorkflow9, Task as Task7, Workflow as Workflow9 } from "@workglow/task-graph";
5588
- var inputSchema8 = {
6115
+ import { CreateWorkflow as CreateWorkflow18, Task as Task16, Workflow as Workflow19 } from "@workglow/task-graph";
6116
+ var inputSchema17 = {
5589
6117
  type: "object",
5590
6118
  properties: {},
5591
6119
  additionalProperties: true
5592
6120
  };
5593
- var outputSchema8 = {
6121
+ var outputSchema17 = {
5594
6122
  type: "object",
5595
6123
  properties: {
5596
6124
  output: {
@@ -5602,17 +6130,17 @@ var outputSchema8 = {
5602
6130
  additionalProperties: false
5603
6131
  };
5604
6132
 
5605
- class MergeTask extends Task7 {
6133
+ class MergeTask extends Task16 {
5606
6134
  static type = "MergeTask";
5607
6135
  static category = "Utility";
5608
6136
  static title = "Merge";
5609
6137
  static description = "Merges multiple inputs into a single array output";
5610
6138
  static cacheable = true;
5611
6139
  static inputSchema() {
5612
- return inputSchema8;
6140
+ return inputSchema17;
5613
6141
  }
5614
6142
  static outputSchema() {
5615
- return outputSchema8;
6143
+ return outputSchema17;
5616
6144
  }
5617
6145
  async execute(input2, _context) {
5618
6146
  const keys = Object.keys(input2).sort();
@@ -5626,11 +6154,11 @@ var merge = (input2, config = {}) => {
5626
6154
  const task = new MergeTask({}, config);
5627
6155
  return task.run(input2);
5628
6156
  };
5629
- Workflow9.prototype.merge = CreateWorkflow9(MergeTask);
6157
+ Workflow19.prototype.merge = CreateWorkflow18(MergeTask);
5630
6158
  // src/task/OutputTask.ts
5631
- import { CreateWorkflow as CreateWorkflow10, Task as Task8, Workflow as Workflow10 } from "@workglow/task-graph";
6159
+ import { CreateWorkflow as CreateWorkflow19, Task as Task17, Workflow as Workflow20 } from "@workglow/task-graph";
5632
6160
 
5633
- class OutputTask extends Task8 {
6161
+ class OutputTask extends Task17 {
5634
6162
  static type = "OutputTask";
5635
6163
  static category = "Flow Control";
5636
6164
  static title = "Output";
@@ -5664,10 +6192,10 @@ class OutputTask extends Task8 {
5664
6192
  return input2;
5665
6193
  }
5666
6194
  }
5667
- Workflow10.prototype.output = CreateWorkflow10(OutputTask);
6195
+ Workflow20.prototype.output = CreateWorkflow19(OutputTask);
5668
6196
  // src/task/SplitTask.ts
5669
- import { CreateWorkflow as CreateWorkflow11, Task as Task9, Workflow as Workflow11 } from "@workglow/task-graph";
5670
- var inputSchema9 = {
6197
+ import { CreateWorkflow as CreateWorkflow20, Task as Task18, Workflow as Workflow21 } from "@workglow/task-graph";
6198
+ var inputSchema18 = {
5671
6199
  type: "object",
5672
6200
  properties: {
5673
6201
  input: {
@@ -5677,13 +6205,13 @@ var inputSchema9 = {
5677
6205
  },
5678
6206
  additionalProperties: false
5679
6207
  };
5680
- var outputSchema9 = {
6208
+ var outputSchema18 = {
5681
6209
  type: "object",
5682
6210
  properties: {},
5683
6211
  additionalProperties: true
5684
6212
  };
5685
6213
 
5686
- class SplitTask extends Task9 {
6214
+ class SplitTask extends Task18 {
5687
6215
  static type = "SplitTask";
5688
6216
  static category = "Utility";
5689
6217
  static title = "Split";
@@ -5691,13 +6219,13 @@ class SplitTask extends Task9 {
5691
6219
  static hasDynamicSchemas = true;
5692
6220
  static cacheable = false;
5693
6221
  static inputSchema() {
5694
- return inputSchema9;
6222
+ return inputSchema18;
5695
6223
  }
5696
6224
  static outputSchema() {
5697
- return outputSchema9;
6225
+ return outputSchema18;
5698
6226
  }
5699
6227
  outputSchema() {
5700
- return outputSchema9;
6228
+ return outputSchema18;
5701
6229
  }
5702
6230
  async executeReactive(input2) {
5703
6231
  const inputValue = input2.input;
@@ -5716,7 +6244,528 @@ var split = (input2, config = {}) => {
5716
6244
  const task = new SplitTask({}, config);
5717
6245
  return task.run(input2);
5718
6246
  };
5719
- Workflow11.prototype.split = CreateWorkflow11(SplitTask);
6247
+ Workflow21.prototype.split = CreateWorkflow20(SplitTask);
6248
+ // src/task/scalar/ScalarAbsTask.ts
6249
+ import { CreateWorkflow as CreateWorkflow21, Task as Task19, Workflow as Workflow22 } from "@workglow/task-graph";
6250
+ var inputSchema19 = {
6251
+ type: "object",
6252
+ properties: {
6253
+ value: {
6254
+ type: "number",
6255
+ title: "Value",
6256
+ description: "Input number"
6257
+ }
6258
+ },
6259
+ required: ["value"],
6260
+ additionalProperties: false
6261
+ };
6262
+ var outputSchema19 = {
6263
+ type: "object",
6264
+ properties: {
6265
+ result: {
6266
+ type: "number",
6267
+ title: "Result",
6268
+ description: "Absolute value"
6269
+ }
6270
+ },
6271
+ required: ["result"],
6272
+ additionalProperties: false
6273
+ };
6274
+
6275
+ class ScalarAbsTask extends Task19 {
6276
+ static type = "ScalarAbsTask";
6277
+ static category = "Math";
6278
+ static title = "Abs";
6279
+ static description = "Returns the absolute value of a number";
6280
+ static inputSchema() {
6281
+ return inputSchema19;
6282
+ }
6283
+ static outputSchema() {
6284
+ return outputSchema19;
6285
+ }
6286
+ async execute(input2, _context) {
6287
+ return { result: Math.abs(input2.value) };
6288
+ }
6289
+ }
6290
+ Workflow22.prototype.scalarAbs = CreateWorkflow21(ScalarAbsTask);
6291
+ // src/task/scalar/ScalarCeilTask.ts
6292
+ import { CreateWorkflow as CreateWorkflow22, Task as Task20, Workflow as Workflow23 } from "@workglow/task-graph";
6293
+ var inputSchema20 = {
6294
+ type: "object",
6295
+ properties: {
6296
+ value: {
6297
+ type: "number",
6298
+ title: "Value",
6299
+ description: "Input number"
6300
+ }
6301
+ },
6302
+ required: ["value"],
6303
+ additionalProperties: false
6304
+ };
6305
+ var outputSchema20 = {
6306
+ type: "object",
6307
+ properties: {
6308
+ result: {
6309
+ type: "number",
6310
+ title: "Result",
6311
+ description: "Ceiling value"
6312
+ }
6313
+ },
6314
+ required: ["result"],
6315
+ additionalProperties: false
6316
+ };
6317
+
6318
+ class ScalarCeilTask extends Task20 {
6319
+ static type = "ScalarCeilTask";
6320
+ static category = "Math";
6321
+ static title = "Ceil";
6322
+ static description = "Returns the smallest integer greater than or equal to a number";
6323
+ static inputSchema() {
6324
+ return inputSchema20;
6325
+ }
6326
+ static outputSchema() {
6327
+ return outputSchema20;
6328
+ }
6329
+ async execute(input2, _context) {
6330
+ return { result: Math.ceil(input2.value) };
6331
+ }
6332
+ }
6333
+ Workflow23.prototype.scalarCeil = CreateWorkflow22(ScalarCeilTask);
6334
+ // src/task/scalar/ScalarFloorTask.ts
6335
+ import { CreateWorkflow as CreateWorkflow23, Task as Task21, Workflow as Workflow24 } from "@workglow/task-graph";
6336
+ var inputSchema21 = {
6337
+ type: "object",
6338
+ properties: {
6339
+ value: {
6340
+ type: "number",
6341
+ title: "Value",
6342
+ description: "Input number"
6343
+ }
6344
+ },
6345
+ required: ["value"],
6346
+ additionalProperties: false
6347
+ };
6348
+ var outputSchema21 = {
6349
+ type: "object",
6350
+ properties: {
6351
+ result: {
6352
+ type: "number",
6353
+ title: "Result",
6354
+ description: "Floored value"
6355
+ }
6356
+ },
6357
+ required: ["result"],
6358
+ additionalProperties: false
6359
+ };
6360
+
6361
+ class ScalarFloorTask extends Task21 {
6362
+ static type = "ScalarFloorTask";
6363
+ static category = "Math";
6364
+ static title = "Floor";
6365
+ static description = "Returns the largest integer less than or equal to a number";
6366
+ static inputSchema() {
6367
+ return inputSchema21;
6368
+ }
6369
+ static outputSchema() {
6370
+ return outputSchema21;
6371
+ }
6372
+ async execute(input2, _context) {
6373
+ return { result: Math.floor(input2.value) };
6374
+ }
6375
+ }
6376
+ Workflow24.prototype.scalarFloor = CreateWorkflow23(ScalarFloorTask);
6377
+ // src/task/scalar/ScalarMaxTask.ts
6378
+ import { CreateWorkflow as CreateWorkflow24, Task as Task22, Workflow as Workflow25 } from "@workglow/task-graph";
6379
+ var inputSchema22 = {
6380
+ type: "object",
6381
+ properties: {
6382
+ values: {
6383
+ type: "array",
6384
+ items: { type: "number" },
6385
+ title: "Values",
6386
+ description: "Array of numbers"
6387
+ }
6388
+ },
6389
+ required: ["values"],
6390
+ additionalProperties: false
6391
+ };
6392
+ var outputSchema22 = {
6393
+ type: "object",
6394
+ properties: {
6395
+ result: {
6396
+ type: "number",
6397
+ title: "Result",
6398
+ description: "Maximum value"
6399
+ }
6400
+ },
6401
+ required: ["result"],
6402
+ additionalProperties: false
6403
+ };
6404
+
6405
+ class ScalarMaxTask extends Task22 {
6406
+ static type = "ScalarMaxTask";
6407
+ static category = "Math";
6408
+ static title = "Max";
6409
+ static description = "Returns the largest of the given numbers";
6410
+ static inputSchema() {
6411
+ return inputSchema22;
6412
+ }
6413
+ static outputSchema() {
6414
+ return outputSchema22;
6415
+ }
6416
+ async execute(input2, _context) {
6417
+ return { result: Math.max(...input2.values) };
6418
+ }
6419
+ }
6420
+ Workflow25.prototype.scalarMax = CreateWorkflow24(ScalarMaxTask);
6421
+ // src/task/scalar/ScalarMinTask.ts
6422
+ import { CreateWorkflow as CreateWorkflow25, Task as Task23, Workflow as Workflow26 } from "@workglow/task-graph";
6423
+ var inputSchema23 = {
6424
+ type: "object",
6425
+ properties: {
6426
+ values: {
6427
+ type: "array",
6428
+ items: { type: "number" },
6429
+ title: "Values",
6430
+ description: "Array of numbers"
6431
+ }
6432
+ },
6433
+ required: ["values"],
6434
+ additionalProperties: false
6435
+ };
6436
+ var outputSchema23 = {
6437
+ type: "object",
6438
+ properties: {
6439
+ result: {
6440
+ type: "number",
6441
+ title: "Result",
6442
+ description: "Minimum value"
6443
+ }
6444
+ },
6445
+ required: ["result"],
6446
+ additionalProperties: false
6447
+ };
6448
+
6449
+ class ScalarMinTask extends Task23 {
6450
+ static type = "ScalarMinTask";
6451
+ static category = "Math";
6452
+ static title = "Min";
6453
+ static description = "Returns the smallest of the given numbers";
6454
+ static inputSchema() {
6455
+ return inputSchema23;
6456
+ }
6457
+ static outputSchema() {
6458
+ return outputSchema23;
6459
+ }
6460
+ async execute(input2, _context) {
6461
+ return { result: Math.min(...input2.values) };
6462
+ }
6463
+ }
6464
+ Workflow26.prototype.scalarMin = CreateWorkflow25(ScalarMinTask);
6465
+ // src/task/scalar/ScalarRoundTask.ts
6466
+ import { CreateWorkflow as CreateWorkflow26, Task as Task24, Workflow as Workflow27 } from "@workglow/task-graph";
6467
+ var inputSchema24 = {
6468
+ type: "object",
6469
+ properties: {
6470
+ value: {
6471
+ type: "number",
6472
+ title: "Value",
6473
+ description: "Input number"
6474
+ }
6475
+ },
6476
+ required: ["value"],
6477
+ additionalProperties: false
6478
+ };
6479
+ var outputSchema24 = {
6480
+ type: "object",
6481
+ properties: {
6482
+ result: {
6483
+ type: "number",
6484
+ title: "Result",
6485
+ description: "Rounded value"
6486
+ }
6487
+ },
6488
+ required: ["result"],
6489
+ additionalProperties: false
6490
+ };
6491
+
6492
+ class ScalarRoundTask extends Task24 {
6493
+ static type = "ScalarRoundTask";
6494
+ static category = "Math";
6495
+ static title = "Round";
6496
+ static description = "Returns the value of a number rounded to the nearest integer";
6497
+ static inputSchema() {
6498
+ return inputSchema24;
6499
+ }
6500
+ static outputSchema() {
6501
+ return outputSchema24;
6502
+ }
6503
+ async execute(input2, _context) {
6504
+ return { result: Math.round(input2.value) };
6505
+ }
6506
+ }
6507
+ Workflow27.prototype.scalarRound = CreateWorkflow26(ScalarRoundTask);
6508
+ // src/task/scalar/ScalarTruncTask.ts
6509
+ import { CreateWorkflow as CreateWorkflow27, Task as Task25, Workflow as Workflow28 } from "@workglow/task-graph";
6510
+ var inputSchema25 = {
6511
+ type: "object",
6512
+ properties: {
6513
+ value: {
6514
+ type: "number",
6515
+ title: "Value",
6516
+ description: "Input number"
6517
+ }
6518
+ },
6519
+ required: ["value"],
6520
+ additionalProperties: false
6521
+ };
6522
+ var outputSchema25 = {
6523
+ type: "object",
6524
+ properties: {
6525
+ result: {
6526
+ type: "number",
6527
+ title: "Result",
6528
+ description: "Truncated value"
6529
+ }
6530
+ },
6531
+ required: ["result"],
6532
+ additionalProperties: false
6533
+ };
6534
+
6535
+ class ScalarTruncTask extends Task25 {
6536
+ static type = "ScalarTruncTask";
6537
+ static category = "Math";
6538
+ static title = "Truncate";
6539
+ static description = "Returns the integer part of a number by removing fractional digits";
6540
+ static inputSchema() {
6541
+ return inputSchema25;
6542
+ }
6543
+ static outputSchema() {
6544
+ return outputSchema25;
6545
+ }
6546
+ async execute(input2, _context) {
6547
+ return { result: Math.trunc(input2.value) };
6548
+ }
6549
+ }
6550
+ Workflow28.prototype.scalarTrunc = CreateWorkflow27(ScalarTruncTask);
6551
+ // src/task/vector/VectorDistanceTask.ts
6552
+ import { CreateWorkflow as CreateWorkflow28, Task as Task26, Workflow as Workflow29 } from "@workglow/task-graph";
6553
+ import {
6554
+ TypedArraySchema as TypedArraySchema5
6555
+ } from "@workglow/util";
6556
+ var inputSchema26 = {
6557
+ type: "object",
6558
+ properties: {
6559
+ vectors: {
6560
+ type: "array",
6561
+ items: TypedArraySchema5({
6562
+ title: "Vector",
6563
+ description: "Vector for distance computation"
6564
+ }),
6565
+ title: "Vectors",
6566
+ description: "Array of two vectors to compute Euclidean distance"
6567
+ }
6568
+ },
6569
+ required: ["vectors"],
6570
+ additionalProperties: false
6571
+ };
6572
+ var outputSchema26 = {
6573
+ type: "object",
6574
+ properties: {
6575
+ result: {
6576
+ type: "number",
6577
+ title: "Result",
6578
+ description: "Euclidean distance between vectors"
6579
+ }
6580
+ },
6581
+ required: ["result"],
6582
+ additionalProperties: false
6583
+ };
6584
+
6585
+ class VectorDistanceTask extends Task26 {
6586
+ static type = "VectorDistanceTask";
6587
+ static category = "Vector";
6588
+ static title = "Distance";
6589
+ static description = "Returns the Euclidean distance between the first two vectors";
6590
+ static inputSchema() {
6591
+ return inputSchema26;
6592
+ }
6593
+ static outputSchema() {
6594
+ return outputSchema26;
6595
+ }
6596
+ async execute(input2, _context) {
6597
+ const { vectors } = input2;
6598
+ if (vectors.length < 2) {
6599
+ throw new Error("Exactly two vectors are required for distance");
6600
+ }
6601
+ const [a, b] = vectors;
6602
+ if (a.length !== b.length) {
6603
+ throw new Error("Vectors must have the same length");
6604
+ }
6605
+ const diffs = Array.from({ length: a.length }, (_, i) => {
6606
+ const d = Number(a[i]) - Number(b[i]);
6607
+ return d * d;
6608
+ });
6609
+ return { result: Math.sqrt(sumPrecise(diffs)) };
6610
+ }
6611
+ }
6612
+ Workflow29.prototype.vectorDistance = CreateWorkflow28(VectorDistanceTask);
6613
+ // src/task/vector/VectorDotProductTask.ts
6614
+ import { CreateWorkflow as CreateWorkflow29, Task as Task27, Workflow as Workflow30 } from "@workglow/task-graph";
6615
+ import {
6616
+ TypedArraySchema as TypedArraySchema6
6617
+ } from "@workglow/util";
6618
+ var inputSchema27 = {
6619
+ type: "object",
6620
+ properties: {
6621
+ vectors: {
6622
+ type: "array",
6623
+ items: TypedArraySchema6({
6624
+ title: "Vector",
6625
+ description: "Vector for dot product"
6626
+ }),
6627
+ title: "Vectors",
6628
+ description: "Array of two vectors to compute dot product"
6629
+ }
6630
+ },
6631
+ required: ["vectors"],
6632
+ additionalProperties: false
6633
+ };
6634
+ var outputSchema27 = {
6635
+ type: "object",
6636
+ properties: {
6637
+ result: {
6638
+ type: "number",
6639
+ title: "Result",
6640
+ description: "Dot product of the vectors"
6641
+ }
6642
+ },
6643
+ required: ["result"],
6644
+ additionalProperties: false
6645
+ };
6646
+
6647
+ class VectorDotProductTask extends Task27 {
6648
+ static type = "VectorDotProductTask";
6649
+ static category = "Vector";
6650
+ static title = "Dot Product";
6651
+ static description = "Returns the dot (inner) product of the first two vectors";
6652
+ static inputSchema() {
6653
+ return inputSchema27;
6654
+ }
6655
+ static outputSchema() {
6656
+ return outputSchema27;
6657
+ }
6658
+ async execute(input2, _context) {
6659
+ const { vectors } = input2;
6660
+ if (vectors.length < 2) {
6661
+ throw new Error("Exactly two vectors are required for dot product");
6662
+ }
6663
+ const [a, b] = vectors;
6664
+ if (a.length !== b.length) {
6665
+ throw new Error("Vectors must have the same length");
6666
+ }
6667
+ const products = Array.from({ length: a.length }, (_, i) => Number(a[i]) * Number(b[i]));
6668
+ return { result: sumPrecise(products) };
6669
+ }
6670
+ }
6671
+ Workflow30.prototype.vectorDotProduct = CreateWorkflow29(VectorDotProductTask);
6672
+ // src/task/vector/VectorNormalizeTask.ts
6673
+ import { CreateWorkflow as CreateWorkflow30, Task as Task28, Workflow as Workflow31 } from "@workglow/task-graph";
6674
+ import {
6675
+ TypedArraySchema as TypedArraySchema7,
6676
+ normalize
6677
+ } from "@workglow/util";
6678
+ var inputSchema28 = {
6679
+ type: "object",
6680
+ properties: {
6681
+ vector: TypedArraySchema7({
6682
+ title: "Vector",
6683
+ description: "Input vector to normalize"
6684
+ })
6685
+ },
6686
+ required: ["vector"],
6687
+ additionalProperties: false
6688
+ };
6689
+ var outputSchema28 = {
6690
+ type: "object",
6691
+ properties: {
6692
+ result: TypedArraySchema7({
6693
+ title: "Result",
6694
+ description: "L2-normalized vector"
6695
+ })
6696
+ },
6697
+ required: ["result"],
6698
+ additionalProperties: false
6699
+ };
6700
+
6701
+ class VectorNormalizeTask extends Task28 {
6702
+ static type = "VectorNormalizeTask";
6703
+ static category = "Vector";
6704
+ static title = "Normalize";
6705
+ static description = "Returns the L2-normalized (unit length) vector";
6706
+ static inputSchema() {
6707
+ return inputSchema28;
6708
+ }
6709
+ static outputSchema() {
6710
+ return outputSchema28;
6711
+ }
6712
+ async execute(input2, _context) {
6713
+ return { result: normalize(input2.vector) };
6714
+ }
6715
+ }
6716
+ Workflow31.prototype.vectorNormalize = CreateWorkflow30(VectorNormalizeTask);
6717
+ // src/task/vector/VectorScaleTask.ts
6718
+ import { CreateWorkflow as CreateWorkflow31, Task as Task29, Workflow as Workflow32 } from "@workglow/task-graph";
6719
+ import {
6720
+ createTypedArrayFrom as createTypedArrayFrom5,
6721
+ TypedArraySchema as TypedArraySchema8
6722
+ } from "@workglow/util";
6723
+ var inputSchema29 = {
6724
+ type: "object",
6725
+ properties: {
6726
+ vector: TypedArraySchema8({
6727
+ title: "Vector",
6728
+ description: "Input vector"
6729
+ }),
6730
+ scalar: {
6731
+ type: "number",
6732
+ title: "Scalar",
6733
+ description: "Scalar multiplier"
6734
+ }
6735
+ },
6736
+ required: ["vector", "scalar"],
6737
+ additionalProperties: false
6738
+ };
6739
+ var outputSchema29 = {
6740
+ type: "object",
6741
+ properties: {
6742
+ result: TypedArraySchema8({
6743
+ title: "Result",
6744
+ description: "Scaled vector"
6745
+ })
6746
+ },
6747
+ required: ["result"],
6748
+ additionalProperties: false
6749
+ };
6750
+
6751
+ class VectorScaleTask extends Task29 {
6752
+ static type = "VectorScaleTask";
6753
+ static category = "Vector";
6754
+ static title = "Scale";
6755
+ static description = "Multiplies each element of a vector by a scalar";
6756
+ static inputSchema() {
6757
+ return inputSchema29;
6758
+ }
6759
+ static outputSchema() {
6760
+ return outputSchema29;
6761
+ }
6762
+ async execute(input2, _context) {
6763
+ const { vector, scalar } = input2;
6764
+ const values = Array.from(vector, (v) => Number(v) * scalar);
6765
+ return { result: createTypedArrayFrom5([vector], values) };
6766
+ }
6767
+ }
6768
+ Workflow32.prototype.vectorScale = CreateWorkflow31(VectorScaleTask);
5720
6769
 
5721
6770
  // src/common.ts
5722
6771
  import { TaskRegistry } from "@workglow/task-graph";
@@ -5731,7 +6780,27 @@ var registerCommonTasks = () => {
5731
6780
  LambdaTask,
5732
6781
  MergeTask,
5733
6782
  OutputTask,
5734
- SplitTask
6783
+ SplitTask,
6784
+ ScalarAbsTask,
6785
+ ScalarAddTask,
6786
+ ScalarCeilTask,
6787
+ ScalarDivideTask,
6788
+ ScalarFloorTask,
6789
+ ScalarMaxTask,
6790
+ ScalarMinTask,
6791
+ ScalarMultiplyTask,
6792
+ ScalarRoundTask,
6793
+ ScalarSubtractTask,
6794
+ ScalarSumTask,
6795
+ ScalarTruncTask,
6796
+ VectorSumTask,
6797
+ VectorDistanceTask,
6798
+ VectorDivideTask,
6799
+ VectorDotProductTask,
6800
+ VectorMultiplyTask,
6801
+ VectorNormalizeTask,
6802
+ VectorScaleTask,
6803
+ VectorSubtractTask
5735
6804
  ];
5736
6805
  tasks.map(TaskRegistry.registerTask);
5737
6806
  return tasks;
@@ -5751,8 +6820,28 @@ export {
5751
6820
  fetchUrl,
5752
6821
  delay,
5753
6822
  debugLog,
6823
+ VectorSumTask,
6824
+ VectorSubtractTask,
6825
+ VectorScaleTask,
6826
+ VectorNormalizeTask,
6827
+ VectorMultiplyTask,
6828
+ VectorDotProductTask,
6829
+ VectorDivideTask,
6830
+ VectorDistanceTask,
5754
6831
  TypeReplicateArray,
5755
6832
  SplitTask,
6833
+ ScalarTruncTask,
6834
+ ScalarSumTask,
6835
+ ScalarSubtractTask,
6836
+ ScalarRoundTask,
6837
+ ScalarMultiplyTask,
6838
+ ScalarMinTask,
6839
+ ScalarMaxTask,
6840
+ ScalarFloorTask,
6841
+ ScalarDivideTask,
6842
+ ScalarCeilTask,
6843
+ ScalarAddTask,
6844
+ ScalarAbsTask,
5756
6845
  OutputTask,
5757
6846
  MergeTask,
5758
6847
  LambdaTask,
@@ -5767,4 +6856,4 @@ export {
5767
6856
  ArrayTask
5768
6857
  };
5769
6858
 
5770
- //# debugId=D326EDEDA4D6BDB564756E2164756E21
6859
+ //# debugId=1C4F2D27323C353864756E2164756E21