@workglow/tasks 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 (115) hide show
  1. package/dist/browser.js +28 -31
  2. package/dist/browser.js.map +55 -55
  3. package/dist/bun.js +30 -33
  4. package/dist/bun.js.map +55 -55
  5. package/dist/node.js +30 -33
  6. package/dist/node.js.map +55 -55
  7. package/dist/task/ArrayTask.d.ts +1 -1
  8. package/dist/task/ArrayTask.d.ts.map +1 -1
  9. package/dist/task/DateFormatTask.d.ts +1 -1
  10. package/dist/task/DateFormatTask.d.ts.map +1 -1
  11. package/dist/task/DebugLogTask.d.ts +1 -1
  12. package/dist/task/DebugLogTask.d.ts.map +1 -1
  13. package/dist/task/DelayTask.d.ts +1 -1
  14. package/dist/task/DelayTask.d.ts.map +1 -1
  15. package/dist/task/FetchUrlTask.d.ts +2 -2
  16. package/dist/task/FetchUrlTask.d.ts.map +1 -1
  17. package/dist/task/FileLoaderTask.d.ts +1 -1
  18. package/dist/task/FileLoaderTask.d.ts.map +1 -1
  19. package/dist/task/InputTask.d.ts +1 -1
  20. package/dist/task/InputTask.d.ts.map +1 -1
  21. package/dist/task/JavaScriptTask.d.ts +2 -2
  22. package/dist/task/JavaScriptTask.d.ts.map +1 -1
  23. package/dist/task/JsonPathTask.d.ts +1 -1
  24. package/dist/task/JsonPathTask.d.ts.map +1 -1
  25. package/dist/task/JsonTask.d.ts +1 -1
  26. package/dist/task/JsonTask.d.ts.map +1 -1
  27. package/dist/task/LambdaTask.d.ts +1 -1
  28. package/dist/task/LambdaTask.d.ts.map +1 -1
  29. package/dist/task/MergeTask.d.ts +1 -1
  30. package/dist/task/MergeTask.d.ts.map +1 -1
  31. package/dist/task/OutputTask.d.ts +1 -1
  32. package/dist/task/OutputTask.d.ts.map +1 -1
  33. package/dist/task/RegexTask.d.ts +1 -1
  34. package/dist/task/RegexTask.d.ts.map +1 -1
  35. package/dist/task/SplitTask.d.ts +1 -1
  36. package/dist/task/SplitTask.d.ts.map +1 -1
  37. package/dist/task/TemplateTask.d.ts +1 -1
  38. package/dist/task/TemplateTask.d.ts.map +1 -1
  39. package/dist/task/mcp/McpListTask.d.ts +3 -3
  40. package/dist/task/mcp/McpListTask.d.ts.map +1 -1
  41. package/dist/task/mcp/McpPromptGetTask.d.ts +2 -2
  42. package/dist/task/mcp/McpPromptGetTask.d.ts.map +1 -1
  43. package/dist/task/mcp/McpResourceReadTask.d.ts +1 -1
  44. package/dist/task/mcp/McpResourceReadTask.d.ts.map +1 -1
  45. package/dist/task/mcp/McpSearchTask.d.ts +1 -1
  46. package/dist/task/mcp/McpSearchTask.d.ts.map +1 -1
  47. package/dist/task/mcp/McpToolCallTask.d.ts +2 -2
  48. package/dist/task/mcp/McpToolCallTask.d.ts.map +1 -1
  49. package/dist/task/scalar/ScalarAbsTask.d.ts +1 -1
  50. package/dist/task/scalar/ScalarAbsTask.d.ts.map +1 -1
  51. package/dist/task/scalar/ScalarAddTask.d.ts +1 -1
  52. package/dist/task/scalar/ScalarAddTask.d.ts.map +1 -1
  53. package/dist/task/scalar/ScalarCeilTask.d.ts +1 -1
  54. package/dist/task/scalar/ScalarCeilTask.d.ts.map +1 -1
  55. package/dist/task/scalar/ScalarDivideTask.d.ts +1 -1
  56. package/dist/task/scalar/ScalarDivideTask.d.ts.map +1 -1
  57. package/dist/task/scalar/ScalarFloorTask.d.ts +1 -1
  58. package/dist/task/scalar/ScalarFloorTask.d.ts.map +1 -1
  59. package/dist/task/scalar/ScalarMaxTask.d.ts +1 -1
  60. package/dist/task/scalar/ScalarMaxTask.d.ts.map +1 -1
  61. package/dist/task/scalar/ScalarMinTask.d.ts +1 -1
  62. package/dist/task/scalar/ScalarMinTask.d.ts.map +1 -1
  63. package/dist/task/scalar/ScalarMultiplyTask.d.ts +1 -1
  64. package/dist/task/scalar/ScalarMultiplyTask.d.ts.map +1 -1
  65. package/dist/task/scalar/ScalarRoundTask.d.ts +1 -1
  66. package/dist/task/scalar/ScalarRoundTask.d.ts.map +1 -1
  67. package/dist/task/scalar/ScalarSubtractTask.d.ts +1 -1
  68. package/dist/task/scalar/ScalarSubtractTask.d.ts.map +1 -1
  69. package/dist/task/scalar/ScalarSumTask.d.ts +1 -1
  70. package/dist/task/scalar/ScalarSumTask.d.ts.map +1 -1
  71. package/dist/task/scalar/ScalarTruncTask.d.ts +1 -1
  72. package/dist/task/scalar/ScalarTruncTask.d.ts.map +1 -1
  73. package/dist/task/string/StringConcatTask.d.ts +1 -1
  74. package/dist/task/string/StringConcatTask.d.ts.map +1 -1
  75. package/dist/task/string/StringIncludesTask.d.ts +2 -2
  76. package/dist/task/string/StringIncludesTask.d.ts.map +1 -1
  77. package/dist/task/string/StringJoinTask.d.ts +2 -2
  78. package/dist/task/string/StringJoinTask.d.ts.map +1 -1
  79. package/dist/task/string/StringLengthTask.d.ts +2 -2
  80. package/dist/task/string/StringLengthTask.d.ts.map +1 -1
  81. package/dist/task/string/StringLowerCaseTask.d.ts +2 -2
  82. package/dist/task/string/StringLowerCaseTask.d.ts.map +1 -1
  83. package/dist/task/string/StringReplaceTask.d.ts +2 -2
  84. package/dist/task/string/StringReplaceTask.d.ts.map +1 -1
  85. package/dist/task/string/StringSliceTask.d.ts +2 -2
  86. package/dist/task/string/StringSliceTask.d.ts.map +1 -1
  87. package/dist/task/string/StringTemplateTask.d.ts +2 -2
  88. package/dist/task/string/StringTemplateTask.d.ts.map +1 -1
  89. package/dist/task/string/StringTrimTask.d.ts +2 -2
  90. package/dist/task/string/StringTrimTask.d.ts.map +1 -1
  91. package/dist/task/string/StringUpperCaseTask.d.ts +2 -2
  92. package/dist/task/string/StringUpperCaseTask.d.ts.map +1 -1
  93. package/dist/task/vector/VectorDistanceTask.d.ts +1 -1
  94. package/dist/task/vector/VectorDistanceTask.d.ts.map +1 -1
  95. package/dist/task/vector/VectorDivideTask.d.ts +1 -1
  96. package/dist/task/vector/VectorDivideTask.d.ts.map +1 -1
  97. package/dist/task/vector/VectorDotProductTask.d.ts +1 -1
  98. package/dist/task/vector/VectorDotProductTask.d.ts.map +1 -1
  99. package/dist/task/vector/VectorMultiplyTask.d.ts +1 -1
  100. package/dist/task/vector/VectorMultiplyTask.d.ts.map +1 -1
  101. package/dist/task/vector/VectorNormalizeTask.d.ts +1 -1
  102. package/dist/task/vector/VectorNormalizeTask.d.ts.map +1 -1
  103. package/dist/task/vector/VectorScaleTask.d.ts +1 -1
  104. package/dist/task/vector/VectorScaleTask.d.ts.map +1 -1
  105. package/dist/task/vector/VectorSubtractTask.d.ts +1 -1
  106. package/dist/task/vector/VectorSubtractTask.d.ts.map +1 -1
  107. package/dist/task/vector/VectorSumTask.d.ts +1 -1
  108. package/dist/task/vector/VectorSumTask.d.ts.map +1 -1
  109. package/dist/util/McpClientUtil.browser.d.ts +2 -11
  110. package/dist/util/McpClientUtil.browser.d.ts.map +1 -1
  111. package/dist/util/McpClientUtil.node.d.ts +2 -14
  112. package/dist/util/McpClientUtil.node.d.ts.map +1 -1
  113. package/dist/util/McpTaskDeps.d.ts +15 -4
  114. package/dist/util/McpTaskDeps.d.ts.map +1 -1
  115. package/package.json +9 -9
package/dist/browser.js CHANGED
@@ -272,7 +272,7 @@ import { CreateWorkflow as CreateWorkflow6, Task as Task6, Workflow as Workflow6
272
272
  import {
273
273
  createTypedArrayFrom,
274
274
  TypedArraySchema
275
- } from "@workglow/util";
275
+ } from "@workglow/util/schema";
276
276
  var inputSchema6 = {
277
277
  type: "object",
278
278
  properties: {
@@ -340,7 +340,7 @@ import { CreateWorkflow as CreateWorkflow7, Task as Task7, Workflow as Workflow7
340
340
  import {
341
341
  createTypedArrayFrom as createTypedArrayFrom2,
342
342
  TypedArraySchema as TypedArraySchema2
343
- } from "@workglow/util";
343
+ } from "@workglow/util/schema";
344
344
  var inputSchema7 = {
345
345
  type: "object",
346
346
  properties: {
@@ -402,7 +402,7 @@ import { CreateWorkflow as CreateWorkflow8, Task as Task8, Workflow as Workflow8
402
402
  import {
403
403
  createTypedArrayFrom as createTypedArrayFrom3,
404
404
  TypedArraySchema as TypedArraySchema3
405
- } from "@workglow/util";
405
+ } from "@workglow/util/schema";
406
406
  var inputSchema8 = {
407
407
  type: "object",
408
408
  properties: {
@@ -470,7 +470,7 @@ import { CreateWorkflow as CreateWorkflow9, Task as Task9, Workflow as Workflow9
470
470
  import {
471
471
  createTypedArrayFrom as createTypedArrayFrom4,
472
472
  TypedArraySchema as TypedArraySchema4
473
- } from "@workglow/util";
473
+ } from "@workglow/util/schema";
474
474
  var inputSchema9 = {
475
475
  type: "object",
476
476
  properties: {
@@ -535,9 +535,7 @@ Workflow10.prototype.divide = CreateAdaptiveWorkflow(ScalarDivideTask, VectorDiv
535
535
  Workflow10.prototype.sum = CreateAdaptiveWorkflow(ScalarSumTask, VectorSumTask);
536
536
 
537
537
  // src/task/ArrayTask.ts
538
- import {
539
- uuid4
540
- } from "@workglow/util";
538
+ import { uuid4 } from "@workglow/util";
541
539
  import {
542
540
  GraphAsTask,
543
541
  GraphAsTaskRunner,
@@ -6810,7 +6808,7 @@ class McpPromptGetTask extends Task23 {
6810
6808
  return this.config?.outputSchema ?? fallbackOutputSchema;
6811
6809
  }
6812
6810
  _schemasDiscovering = false;
6813
- async discoverSchemas(signal) {
6811
+ async discoverSchemas(_signal) {
6814
6812
  if (this.config.inputSchema)
6815
6813
  return;
6816
6814
  if (this._schemasDiscovering)
@@ -7312,7 +7310,7 @@ class McpToolCallTask extends Task26 {
7312
7310
  return this.config?.outputSchema ?? fallbackOutputSchema2;
7313
7311
  }
7314
7312
  _schemasDiscovering = false;
7315
- async discoverSchemas(signal) {
7313
+ async discoverSchemas(_signal) {
7316
7314
  if (this.config.inputSchema && this.config.outputSchema)
7317
7315
  return;
7318
7316
  if (this._schemasDiscovering)
@@ -7476,7 +7474,7 @@ class StringIncludesTask extends Task28 {
7476
7474
  static outputSchema() {
7477
7475
  return outputSchema24;
7478
7476
  }
7479
- async executeReactive(input2, output, _context) {
7477
+ async executeReactive(input2, _output, _context) {
7480
7478
  return { result: input2.value.includes(input2.search) };
7481
7479
  }
7482
7480
  }
@@ -7530,7 +7528,7 @@ class StringJoinTask extends Task29 {
7530
7528
  static outputSchema() {
7531
7529
  return outputSchema25;
7532
7530
  }
7533
- async executeReactive(input2, output, _context) {
7531
+ async executeReactive(input2, _output, _context) {
7534
7532
  const separator = input2.separator ?? "";
7535
7533
  return { result: input2.values.join(separator) };
7536
7534
  }
@@ -7578,7 +7576,7 @@ class StringLengthTask extends Task30 {
7578
7576
  static outputSchema() {
7579
7577
  return outputSchema26;
7580
7578
  }
7581
- async executeReactive(input2, output, _context) {
7579
+ async executeReactive(input2, _output, _context) {
7582
7580
  return { result: input2.value.length };
7583
7581
  }
7584
7582
  }
@@ -7625,7 +7623,7 @@ class StringLowerCaseTask extends Task31 {
7625
7623
  static outputSchema() {
7626
7624
  return outputSchema27;
7627
7625
  }
7628
- async executeReactive(input2, output, _context) {
7626
+ async executeReactive(input2, _output, _context) {
7629
7627
  return { result: input2.value.toLowerCase() };
7630
7628
  }
7631
7629
  }
@@ -7682,7 +7680,7 @@ class StringReplaceTask extends Task32 {
7682
7680
  static outputSchema() {
7683
7681
  return outputSchema28;
7684
7682
  }
7685
- async executeReactive(input2, output, _context) {
7683
+ async executeReactive(input2, _output, _context) {
7686
7684
  return { result: input2.value.replaceAll(input2.search, input2.replace) };
7687
7685
  }
7688
7686
  }
@@ -7739,7 +7737,7 @@ class StringSliceTask extends Task33 {
7739
7737
  static outputSchema() {
7740
7738
  return outputSchema29;
7741
7739
  }
7742
- async executeReactive(input2, output, _context) {
7740
+ async executeReactive(input2, _output, _context) {
7743
7741
  return { result: input2.value.slice(input2.start, input2.end) };
7744
7742
  }
7745
7743
  }
@@ -7792,7 +7790,7 @@ class StringTemplateTask extends Task34 {
7792
7790
  static outputSchema() {
7793
7791
  return outputSchema30;
7794
7792
  }
7795
- async executeReactive(input2, output, _context) {
7793
+ async executeReactive(input2, _output, _context) {
7796
7794
  let result = input2.template;
7797
7795
  for (const [key, value] of Object.entries(input2.values)) {
7798
7796
  result = result.replaceAll(`{{${key}}}`, String(value));
@@ -7843,7 +7841,7 @@ class StringTrimTask extends Task35 {
7843
7841
  static outputSchema() {
7844
7842
  return outputSchema31;
7845
7843
  }
7846
- async executeReactive(input2, output, _context) {
7844
+ async executeReactive(input2, _output, _context) {
7847
7845
  return { result: input2.value.trim() };
7848
7846
  }
7849
7847
  }
@@ -7890,7 +7888,7 @@ class StringUpperCaseTask extends Task36 {
7890
7888
  static outputSchema() {
7891
7889
  return outputSchema32;
7892
7890
  }
7893
- async executeReactive(input2, output, _context) {
7891
+ async executeReactive(input2, _output, _context) {
7894
7892
  return { result: input2.value.toUpperCase() };
7895
7893
  }
7896
7894
  }
@@ -8202,7 +8200,7 @@ Workflow46.prototype.scalarTrunc = CreateWorkflow45(ScalarTruncTask);
8202
8200
  import { CreateWorkflow as CreateWorkflow46, Task as Task44, Workflow as Workflow47 } from "@workglow/task-graph";
8203
8201
  import {
8204
8202
  TypedArraySchema as TypedArraySchema5
8205
- } from "@workglow/util";
8203
+ } from "@workglow/util/schema";
8206
8204
  var inputSchema40 = {
8207
8205
  type: "object",
8208
8206
  properties: {
@@ -8264,7 +8262,7 @@ Workflow47.prototype.vectorDistance = CreateWorkflow46(VectorDistanceTask);
8264
8262
  import { CreateWorkflow as CreateWorkflow47, Task as Task45, Workflow as Workflow48 } from "@workglow/task-graph";
8265
8263
  import {
8266
8264
  TypedArraySchema as TypedArraySchema6
8267
- } from "@workglow/util";
8265
+ } from "@workglow/util/schema";
8268
8266
  var inputSchema41 = {
8269
8267
  type: "object",
8270
8268
  properties: {
@@ -8324,7 +8322,7 @@ import { CreateWorkflow as CreateWorkflow48, Task as Task46, Workflow as Workflo
8324
8322
  import {
8325
8323
  TypedArraySchema as TypedArraySchema7,
8326
8324
  normalize
8327
- } from "@workglow/util";
8325
+ } from "@workglow/util/schema";
8328
8326
  var inputSchema42 = {
8329
8327
  type: "object",
8330
8328
  properties: {
@@ -8369,7 +8367,7 @@ import { CreateWorkflow as CreateWorkflow49, Task as Task47, Workflow as Workflo
8369
8367
  import {
8370
8368
  createTypedArrayFrom as createTypedArrayFrom5,
8371
8369
  TypedArraySchema as TypedArraySchema8
8372
- } from "@workglow/util";
8370
+ } from "@workglow/util/schema";
8373
8371
  var inputSchema43 = {
8374
8372
  type: "object",
8375
8373
  properties: {
@@ -9025,34 +9023,33 @@ var mcpServerConfigSchema = {
9025
9023
  ]
9026
9024
  };
9027
9025
  async function createMcpClient(config, signal) {
9028
- const typed = config;
9029
9026
  let transport;
9030
- let auth = typed.auth ?? buildAuthConfig({ ...typed });
9027
+ let auth = config.auth ?? buildAuthConfig({ ...config });
9031
9028
  if (auth && auth.type !== "none") {
9032
9029
  auth = await resolveAuthSecrets(auth, getGlobalCredentialStore2());
9033
9030
  }
9034
- const authProvider = typed.authProvider ?? (auth && auth.type !== "none" && auth.type !== "bearer" ? createAuthProvider(auth, typed.server_url ?? "", getGlobalCredentialStore2()) : undefined);
9031
+ const authProvider = config.authProvider ?? (auth && auth.type !== "none" && auth.type !== "bearer" ? createAuthProvider(auth, config.server_url ?? "", getGlobalCredentialStore2()) : undefined);
9035
9032
  const headers = {
9036
9033
  ...auth?.type === "bearer" ? { Authorization: `Bearer ${auth.token}` } : {}
9037
9034
  };
9038
9035
  const requestInit = { headers };
9039
- switch (typed.transport) {
9036
+ switch (config.transport) {
9040
9037
  case "sse": {
9041
- transport = new SSEClientTransport(new URL(typed.server_url), {
9038
+ transport = new SSEClientTransport(new URL(config.server_url), {
9042
9039
  authProvider,
9043
9040
  requestInit
9044
9041
  });
9045
9042
  break;
9046
9043
  }
9047
9044
  case "streamable-http": {
9048
- transport = new StreamableHTTPClientTransport(new URL(typed.server_url), {
9045
+ transport = new StreamableHTTPClientTransport(new URL(config.server_url), {
9049
9046
  authProvider,
9050
9047
  requestInit
9051
9048
  });
9052
9049
  break;
9053
9050
  }
9054
9051
  default:
9055
- throw new Error(`Unsupported transport type: ${typed.transport}`);
9052
+ throw new Error(`Unsupported transport type: ${config.transport}`);
9056
9053
  }
9057
9054
  const client = new Client({ name: "workglow-mcp-client", version: "1.0.0" });
9058
9055
  if (signal) {
@@ -9064,7 +9061,7 @@ async function createMcpClient(config, signal) {
9064
9061
  await client.connect(transport);
9065
9062
  } catch (err) {
9066
9063
  const message = err instanceof Error ? err.message : String(err);
9067
- const url = typed.server_url ?? "";
9064
+ const url = config.server_url ?? "";
9068
9065
  const is405 = message.includes("405") || message.includes("Method Not Allowed") || typeof err === "object" && err !== null && "status" in err && err.status === 405;
9069
9066
  if (is405) {
9070
9067
  throw new Error(`MCP connection failed with 405 Method Not Allowed for ${url}. ` + `This usually means the server does not accept GET requests. `, { cause: err });
@@ -9624,4 +9621,4 @@ export {
9624
9621
  ArrayTask
9625
9622
  };
9626
9623
 
9627
- //# debugId=6DEDB97A37FAB74D64756E2164756E21
9624
+ //# debugId=C5DDB128FFF7127C64756E2164756E21