@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.
- package/dist/browser.js +28 -31
- package/dist/browser.js.map +55 -55
- package/dist/bun.js +30 -33
- package/dist/bun.js.map +55 -55
- package/dist/node.js +30 -33
- package/dist/node.js.map +55 -55
- package/dist/task/ArrayTask.d.ts +1 -1
- package/dist/task/ArrayTask.d.ts.map +1 -1
- package/dist/task/DateFormatTask.d.ts +1 -1
- package/dist/task/DateFormatTask.d.ts.map +1 -1
- package/dist/task/DebugLogTask.d.ts +1 -1
- package/dist/task/DebugLogTask.d.ts.map +1 -1
- package/dist/task/DelayTask.d.ts +1 -1
- package/dist/task/DelayTask.d.ts.map +1 -1
- package/dist/task/FetchUrlTask.d.ts +2 -2
- package/dist/task/FetchUrlTask.d.ts.map +1 -1
- package/dist/task/FileLoaderTask.d.ts +1 -1
- package/dist/task/FileLoaderTask.d.ts.map +1 -1
- package/dist/task/InputTask.d.ts +1 -1
- package/dist/task/InputTask.d.ts.map +1 -1
- package/dist/task/JavaScriptTask.d.ts +2 -2
- package/dist/task/JavaScriptTask.d.ts.map +1 -1
- package/dist/task/JsonPathTask.d.ts +1 -1
- package/dist/task/JsonPathTask.d.ts.map +1 -1
- package/dist/task/JsonTask.d.ts +1 -1
- package/dist/task/JsonTask.d.ts.map +1 -1
- package/dist/task/LambdaTask.d.ts +1 -1
- package/dist/task/LambdaTask.d.ts.map +1 -1
- package/dist/task/MergeTask.d.ts +1 -1
- package/dist/task/MergeTask.d.ts.map +1 -1
- package/dist/task/OutputTask.d.ts +1 -1
- package/dist/task/OutputTask.d.ts.map +1 -1
- package/dist/task/RegexTask.d.ts +1 -1
- package/dist/task/RegexTask.d.ts.map +1 -1
- package/dist/task/SplitTask.d.ts +1 -1
- package/dist/task/SplitTask.d.ts.map +1 -1
- package/dist/task/TemplateTask.d.ts +1 -1
- package/dist/task/TemplateTask.d.ts.map +1 -1
- package/dist/task/mcp/McpListTask.d.ts +3 -3
- package/dist/task/mcp/McpListTask.d.ts.map +1 -1
- package/dist/task/mcp/McpPromptGetTask.d.ts +2 -2
- package/dist/task/mcp/McpPromptGetTask.d.ts.map +1 -1
- package/dist/task/mcp/McpResourceReadTask.d.ts +1 -1
- package/dist/task/mcp/McpResourceReadTask.d.ts.map +1 -1
- package/dist/task/mcp/McpSearchTask.d.ts +1 -1
- package/dist/task/mcp/McpSearchTask.d.ts.map +1 -1
- package/dist/task/mcp/McpToolCallTask.d.ts +2 -2
- package/dist/task/mcp/McpToolCallTask.d.ts.map +1 -1
- package/dist/task/scalar/ScalarAbsTask.d.ts +1 -1
- package/dist/task/scalar/ScalarAbsTask.d.ts.map +1 -1
- package/dist/task/scalar/ScalarAddTask.d.ts +1 -1
- package/dist/task/scalar/ScalarAddTask.d.ts.map +1 -1
- package/dist/task/scalar/ScalarCeilTask.d.ts +1 -1
- package/dist/task/scalar/ScalarCeilTask.d.ts.map +1 -1
- package/dist/task/scalar/ScalarDivideTask.d.ts +1 -1
- package/dist/task/scalar/ScalarDivideTask.d.ts.map +1 -1
- package/dist/task/scalar/ScalarFloorTask.d.ts +1 -1
- package/dist/task/scalar/ScalarFloorTask.d.ts.map +1 -1
- package/dist/task/scalar/ScalarMaxTask.d.ts +1 -1
- package/dist/task/scalar/ScalarMaxTask.d.ts.map +1 -1
- package/dist/task/scalar/ScalarMinTask.d.ts +1 -1
- package/dist/task/scalar/ScalarMinTask.d.ts.map +1 -1
- package/dist/task/scalar/ScalarMultiplyTask.d.ts +1 -1
- package/dist/task/scalar/ScalarMultiplyTask.d.ts.map +1 -1
- package/dist/task/scalar/ScalarRoundTask.d.ts +1 -1
- package/dist/task/scalar/ScalarRoundTask.d.ts.map +1 -1
- package/dist/task/scalar/ScalarSubtractTask.d.ts +1 -1
- package/dist/task/scalar/ScalarSubtractTask.d.ts.map +1 -1
- package/dist/task/scalar/ScalarSumTask.d.ts +1 -1
- package/dist/task/scalar/ScalarSumTask.d.ts.map +1 -1
- package/dist/task/scalar/ScalarTruncTask.d.ts +1 -1
- package/dist/task/scalar/ScalarTruncTask.d.ts.map +1 -1
- package/dist/task/string/StringConcatTask.d.ts +1 -1
- package/dist/task/string/StringConcatTask.d.ts.map +1 -1
- package/dist/task/string/StringIncludesTask.d.ts +2 -2
- package/dist/task/string/StringIncludesTask.d.ts.map +1 -1
- package/dist/task/string/StringJoinTask.d.ts +2 -2
- package/dist/task/string/StringJoinTask.d.ts.map +1 -1
- package/dist/task/string/StringLengthTask.d.ts +2 -2
- package/dist/task/string/StringLengthTask.d.ts.map +1 -1
- package/dist/task/string/StringLowerCaseTask.d.ts +2 -2
- package/dist/task/string/StringLowerCaseTask.d.ts.map +1 -1
- package/dist/task/string/StringReplaceTask.d.ts +2 -2
- package/dist/task/string/StringReplaceTask.d.ts.map +1 -1
- package/dist/task/string/StringSliceTask.d.ts +2 -2
- package/dist/task/string/StringSliceTask.d.ts.map +1 -1
- package/dist/task/string/StringTemplateTask.d.ts +2 -2
- package/dist/task/string/StringTemplateTask.d.ts.map +1 -1
- package/dist/task/string/StringTrimTask.d.ts +2 -2
- package/dist/task/string/StringTrimTask.d.ts.map +1 -1
- package/dist/task/string/StringUpperCaseTask.d.ts +2 -2
- package/dist/task/string/StringUpperCaseTask.d.ts.map +1 -1
- package/dist/task/vector/VectorDistanceTask.d.ts +1 -1
- package/dist/task/vector/VectorDistanceTask.d.ts.map +1 -1
- package/dist/task/vector/VectorDivideTask.d.ts +1 -1
- package/dist/task/vector/VectorDivideTask.d.ts.map +1 -1
- package/dist/task/vector/VectorDotProductTask.d.ts +1 -1
- package/dist/task/vector/VectorDotProductTask.d.ts.map +1 -1
- package/dist/task/vector/VectorMultiplyTask.d.ts +1 -1
- package/dist/task/vector/VectorMultiplyTask.d.ts.map +1 -1
- package/dist/task/vector/VectorNormalizeTask.d.ts +1 -1
- package/dist/task/vector/VectorNormalizeTask.d.ts.map +1 -1
- package/dist/task/vector/VectorScaleTask.d.ts +1 -1
- package/dist/task/vector/VectorScaleTask.d.ts.map +1 -1
- package/dist/task/vector/VectorSubtractTask.d.ts +1 -1
- package/dist/task/vector/VectorSubtractTask.d.ts.map +1 -1
- package/dist/task/vector/VectorSumTask.d.ts +1 -1
- package/dist/task/vector/VectorSumTask.d.ts.map +1 -1
- package/dist/util/McpClientUtil.browser.d.ts +2 -11
- package/dist/util/McpClientUtil.browser.d.ts.map +1 -1
- package/dist/util/McpClientUtil.node.d.ts +2 -14
- package/dist/util/McpClientUtil.node.d.ts.map +1 -1
- package/dist/util/McpTaskDeps.d.ts +15 -4
- package/dist/util/McpTaskDeps.d.ts.map +1 -1
- package/package.json +9 -9
package/dist/node.js
CHANGED
|
@@ -267,7 +267,7 @@ import { CreateWorkflow as CreateWorkflow6, Task as Task6, Workflow as Workflow6
|
|
|
267
267
|
import {
|
|
268
268
|
createTypedArrayFrom,
|
|
269
269
|
TypedArraySchema
|
|
270
|
-
} from "@workglow/util";
|
|
270
|
+
} from "@workglow/util/schema";
|
|
271
271
|
var inputSchema6 = {
|
|
272
272
|
type: "object",
|
|
273
273
|
properties: {
|
|
@@ -335,7 +335,7 @@ import { CreateWorkflow as CreateWorkflow7, Task as Task7, Workflow as Workflow7
|
|
|
335
335
|
import {
|
|
336
336
|
createTypedArrayFrom as createTypedArrayFrom2,
|
|
337
337
|
TypedArraySchema as TypedArraySchema2
|
|
338
|
-
} from "@workglow/util";
|
|
338
|
+
} from "@workglow/util/schema";
|
|
339
339
|
var inputSchema7 = {
|
|
340
340
|
type: "object",
|
|
341
341
|
properties: {
|
|
@@ -397,7 +397,7 @@ import { CreateWorkflow as CreateWorkflow8, Task as Task8, Workflow as Workflow8
|
|
|
397
397
|
import {
|
|
398
398
|
createTypedArrayFrom as createTypedArrayFrom3,
|
|
399
399
|
TypedArraySchema as TypedArraySchema3
|
|
400
|
-
} from "@workglow/util";
|
|
400
|
+
} from "@workglow/util/schema";
|
|
401
401
|
var inputSchema8 = {
|
|
402
402
|
type: "object",
|
|
403
403
|
properties: {
|
|
@@ -465,7 +465,7 @@ import { CreateWorkflow as CreateWorkflow9, Task as Task9, Workflow as Workflow9
|
|
|
465
465
|
import {
|
|
466
466
|
createTypedArrayFrom as createTypedArrayFrom4,
|
|
467
467
|
TypedArraySchema as TypedArraySchema4
|
|
468
|
-
} from "@workglow/util";
|
|
468
|
+
} from "@workglow/util/schema";
|
|
469
469
|
var inputSchema9 = {
|
|
470
470
|
type: "object",
|
|
471
471
|
properties: {
|
|
@@ -530,9 +530,7 @@ Workflow10.prototype.divide = CreateAdaptiveWorkflow(ScalarDivideTask, VectorDiv
|
|
|
530
530
|
Workflow10.prototype.sum = CreateAdaptiveWorkflow(ScalarSumTask, VectorSumTask);
|
|
531
531
|
|
|
532
532
|
// src/task/ArrayTask.ts
|
|
533
|
-
import {
|
|
534
|
-
uuid4
|
|
535
|
-
} from "@workglow/util";
|
|
533
|
+
import { uuid4 } from "@workglow/util";
|
|
536
534
|
import {
|
|
537
535
|
GraphAsTask,
|
|
538
536
|
GraphAsTaskRunner,
|
|
@@ -6805,7 +6803,7 @@ class McpPromptGetTask extends Task23 {
|
|
|
6805
6803
|
return this.config?.outputSchema ?? fallbackOutputSchema;
|
|
6806
6804
|
}
|
|
6807
6805
|
_schemasDiscovering = false;
|
|
6808
|
-
async discoverSchemas(
|
|
6806
|
+
async discoverSchemas(_signal) {
|
|
6809
6807
|
if (this.config.inputSchema)
|
|
6810
6808
|
return;
|
|
6811
6809
|
if (this._schemasDiscovering)
|
|
@@ -7307,7 +7305,7 @@ class McpToolCallTask extends Task26 {
|
|
|
7307
7305
|
return this.config?.outputSchema ?? fallbackOutputSchema2;
|
|
7308
7306
|
}
|
|
7309
7307
|
_schemasDiscovering = false;
|
|
7310
|
-
async discoverSchemas(
|
|
7308
|
+
async discoverSchemas(_signal) {
|
|
7311
7309
|
if (this.config.inputSchema && this.config.outputSchema)
|
|
7312
7310
|
return;
|
|
7313
7311
|
if (this._schemasDiscovering)
|
|
@@ -7471,7 +7469,7 @@ class StringIncludesTask extends Task28 {
|
|
|
7471
7469
|
static outputSchema() {
|
|
7472
7470
|
return outputSchema24;
|
|
7473
7471
|
}
|
|
7474
|
-
async executeReactive(input2,
|
|
7472
|
+
async executeReactive(input2, _output, _context) {
|
|
7475
7473
|
return { result: input2.value.includes(input2.search) };
|
|
7476
7474
|
}
|
|
7477
7475
|
}
|
|
@@ -7525,7 +7523,7 @@ class StringJoinTask extends Task29 {
|
|
|
7525
7523
|
static outputSchema() {
|
|
7526
7524
|
return outputSchema25;
|
|
7527
7525
|
}
|
|
7528
|
-
async executeReactive(input2,
|
|
7526
|
+
async executeReactive(input2, _output, _context) {
|
|
7529
7527
|
const separator = input2.separator ?? "";
|
|
7530
7528
|
return { result: input2.values.join(separator) };
|
|
7531
7529
|
}
|
|
@@ -7573,7 +7571,7 @@ class StringLengthTask extends Task30 {
|
|
|
7573
7571
|
static outputSchema() {
|
|
7574
7572
|
return outputSchema26;
|
|
7575
7573
|
}
|
|
7576
|
-
async executeReactive(input2,
|
|
7574
|
+
async executeReactive(input2, _output, _context) {
|
|
7577
7575
|
return { result: input2.value.length };
|
|
7578
7576
|
}
|
|
7579
7577
|
}
|
|
@@ -7620,7 +7618,7 @@ class StringLowerCaseTask extends Task31 {
|
|
|
7620
7618
|
static outputSchema() {
|
|
7621
7619
|
return outputSchema27;
|
|
7622
7620
|
}
|
|
7623
|
-
async executeReactive(input2,
|
|
7621
|
+
async executeReactive(input2, _output, _context) {
|
|
7624
7622
|
return { result: input2.value.toLowerCase() };
|
|
7625
7623
|
}
|
|
7626
7624
|
}
|
|
@@ -7677,7 +7675,7 @@ class StringReplaceTask extends Task32 {
|
|
|
7677
7675
|
static outputSchema() {
|
|
7678
7676
|
return outputSchema28;
|
|
7679
7677
|
}
|
|
7680
|
-
async executeReactive(input2,
|
|
7678
|
+
async executeReactive(input2, _output, _context) {
|
|
7681
7679
|
return { result: input2.value.replaceAll(input2.search, input2.replace) };
|
|
7682
7680
|
}
|
|
7683
7681
|
}
|
|
@@ -7734,7 +7732,7 @@ class StringSliceTask extends Task33 {
|
|
|
7734
7732
|
static outputSchema() {
|
|
7735
7733
|
return outputSchema29;
|
|
7736
7734
|
}
|
|
7737
|
-
async executeReactive(input2,
|
|
7735
|
+
async executeReactive(input2, _output, _context) {
|
|
7738
7736
|
return { result: input2.value.slice(input2.start, input2.end) };
|
|
7739
7737
|
}
|
|
7740
7738
|
}
|
|
@@ -7787,7 +7785,7 @@ class StringTemplateTask extends Task34 {
|
|
|
7787
7785
|
static outputSchema() {
|
|
7788
7786
|
return outputSchema30;
|
|
7789
7787
|
}
|
|
7790
|
-
async executeReactive(input2,
|
|
7788
|
+
async executeReactive(input2, _output, _context) {
|
|
7791
7789
|
let result = input2.template;
|
|
7792
7790
|
for (const [key, value] of Object.entries(input2.values)) {
|
|
7793
7791
|
result = result.replaceAll(`{{${key}}}`, String(value));
|
|
@@ -7838,7 +7836,7 @@ class StringTrimTask extends Task35 {
|
|
|
7838
7836
|
static outputSchema() {
|
|
7839
7837
|
return outputSchema31;
|
|
7840
7838
|
}
|
|
7841
|
-
async executeReactive(input2,
|
|
7839
|
+
async executeReactive(input2, _output, _context) {
|
|
7842
7840
|
return { result: input2.value.trim() };
|
|
7843
7841
|
}
|
|
7844
7842
|
}
|
|
@@ -7885,7 +7883,7 @@ class StringUpperCaseTask extends Task36 {
|
|
|
7885
7883
|
static outputSchema() {
|
|
7886
7884
|
return outputSchema32;
|
|
7887
7885
|
}
|
|
7888
|
-
async executeReactive(input2,
|
|
7886
|
+
async executeReactive(input2, _output, _context) {
|
|
7889
7887
|
return { result: input2.value.toUpperCase() };
|
|
7890
7888
|
}
|
|
7891
7889
|
}
|
|
@@ -8197,7 +8195,7 @@ Workflow46.prototype.scalarTrunc = CreateWorkflow45(ScalarTruncTask);
|
|
|
8197
8195
|
import { CreateWorkflow as CreateWorkflow46, Task as Task44, Workflow as Workflow47 } from "@workglow/task-graph";
|
|
8198
8196
|
import {
|
|
8199
8197
|
TypedArraySchema as TypedArraySchema5
|
|
8200
|
-
} from "@workglow/util";
|
|
8198
|
+
} from "@workglow/util/schema";
|
|
8201
8199
|
var inputSchema40 = {
|
|
8202
8200
|
type: "object",
|
|
8203
8201
|
properties: {
|
|
@@ -8259,7 +8257,7 @@ Workflow47.prototype.vectorDistance = CreateWorkflow46(VectorDistanceTask);
|
|
|
8259
8257
|
import { CreateWorkflow as CreateWorkflow47, Task as Task45, Workflow as Workflow48 } from "@workglow/task-graph";
|
|
8260
8258
|
import {
|
|
8261
8259
|
TypedArraySchema as TypedArraySchema6
|
|
8262
|
-
} from "@workglow/util";
|
|
8260
|
+
} from "@workglow/util/schema";
|
|
8263
8261
|
var inputSchema41 = {
|
|
8264
8262
|
type: "object",
|
|
8265
8263
|
properties: {
|
|
@@ -8319,7 +8317,7 @@ import { CreateWorkflow as CreateWorkflow48, Task as Task46, Workflow as Workflo
|
|
|
8319
8317
|
import {
|
|
8320
8318
|
TypedArraySchema as TypedArraySchema7,
|
|
8321
8319
|
normalize
|
|
8322
|
-
} from "@workglow/util";
|
|
8320
|
+
} from "@workglow/util/schema";
|
|
8323
8321
|
var inputSchema42 = {
|
|
8324
8322
|
type: "object",
|
|
8325
8323
|
properties: {
|
|
@@ -8364,7 +8362,7 @@ import { CreateWorkflow as CreateWorkflow49, Task as Task47, Workflow as Workflo
|
|
|
8364
8362
|
import {
|
|
8365
8363
|
createTypedArrayFrom as createTypedArrayFrom5,
|
|
8366
8364
|
TypedArraySchema as TypedArraySchema8
|
|
8367
|
-
} from "@workglow/util";
|
|
8365
|
+
} from "@workglow/util/schema";
|
|
8368
8366
|
var inputSchema43 = {
|
|
8369
8367
|
type: "object",
|
|
8370
8368
|
properties: {
|
|
@@ -9042,43 +9040,42 @@ var mcpServerConfigSchema = {
|
|
|
9042
9040
|
]
|
|
9043
9041
|
};
|
|
9044
9042
|
async function createMcpClient(config, signal) {
|
|
9045
|
-
const typed = config;
|
|
9046
9043
|
let transport;
|
|
9047
|
-
let auth =
|
|
9044
|
+
let auth = config.auth ?? buildAuthConfig({ ...config });
|
|
9048
9045
|
if (auth && auth.type !== "none") {
|
|
9049
9046
|
auth = await resolveAuthSecrets(auth, getGlobalCredentialStore2());
|
|
9050
9047
|
}
|
|
9051
|
-
const authProvider =
|
|
9048
|
+
const authProvider = config.authProvider ?? (auth && auth.type !== "none" && auth.type !== "bearer" ? createAuthProvider(auth, config.server_url ?? "", getGlobalCredentialStore2()) : undefined);
|
|
9052
9049
|
const headers = {
|
|
9053
9050
|
...auth?.type === "bearer" ? { Authorization: `Bearer ${auth.token}` } : {}
|
|
9054
9051
|
};
|
|
9055
|
-
switch (
|
|
9052
|
+
switch (config.transport) {
|
|
9056
9053
|
case "stdio":
|
|
9057
9054
|
if (auth && auth.type !== "none") {
|
|
9058
9055
|
getLogger().warn("MCP auth is not supported for stdio transport; auth config ignored. " + "Use env vars to pass credentials to stdio servers.");
|
|
9059
9056
|
}
|
|
9060
9057
|
transport = new StdioClientTransport({
|
|
9061
|
-
command:
|
|
9062
|
-
args:
|
|
9063
|
-
env:
|
|
9058
|
+
command: config.command,
|
|
9059
|
+
args: config.args,
|
|
9060
|
+
env: config.env
|
|
9064
9061
|
});
|
|
9065
9062
|
break;
|
|
9066
9063
|
case "sse": {
|
|
9067
|
-
transport = new SSEClientTransport(new URL(
|
|
9064
|
+
transport = new SSEClientTransport(new URL(config.server_url), {
|
|
9068
9065
|
authProvider,
|
|
9069
9066
|
requestInit: { headers }
|
|
9070
9067
|
});
|
|
9071
9068
|
break;
|
|
9072
9069
|
}
|
|
9073
9070
|
case "streamable-http": {
|
|
9074
|
-
transport = new StreamableHTTPClientTransport(new URL(
|
|
9071
|
+
transport = new StreamableHTTPClientTransport(new URL(config.server_url), {
|
|
9075
9072
|
authProvider,
|
|
9076
9073
|
requestInit: { headers }
|
|
9077
9074
|
});
|
|
9078
9075
|
break;
|
|
9079
9076
|
}
|
|
9080
9077
|
default:
|
|
9081
|
-
throw new Error(`Unsupported transport type: ${
|
|
9078
|
+
throw new Error(`Unsupported transport type: ${config.transport}`);
|
|
9082
9079
|
}
|
|
9083
9080
|
const client = new Client({ name: "workglow-mcp-client", version: "1.0.0" });
|
|
9084
9081
|
if (signal) {
|
|
@@ -9830,4 +9827,4 @@ export {
|
|
|
9830
9827
|
ArrayTask
|
|
9831
9828
|
};
|
|
9832
9829
|
|
|
9833
|
-
//# debugId=
|
|
9830
|
+
//# debugId=5B0566F8A0FF262364756E2164756E21
|