@workglow/tasks 0.1.2 → 0.2.0

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 (63) hide show
  1. package/dist/browser.d.ts +1 -1
  2. package/dist/browser.d.ts.map +1 -1
  3. package/dist/browser.js +928 -334
  4. package/dist/browser.js.map +34 -30
  5. package/dist/bun.d.ts +1 -1
  6. package/dist/bun.d.ts.map +1 -1
  7. package/dist/bun.js +944 -350
  8. package/dist/bun.js.map +35 -31
  9. package/dist/common.d.ts +6 -1
  10. package/dist/common.d.ts.map +1 -1
  11. package/dist/mcp-server/McpServerRegistry.d.ts.map +1 -1
  12. package/dist/mcp-server/McpServerRepository.d.ts +5 -3
  13. package/dist/mcp-server/McpServerRepository.d.ts.map +1 -1
  14. package/dist/mcp-server/getMcpServerConfig.d.ts.map +1 -1
  15. package/dist/node.d.ts +1 -1
  16. package/dist/node.d.ts.map +1 -1
  17. package/dist/node.js +944 -350
  18. package/dist/node.js.map +35 -31
  19. package/dist/task/ArrayTask.d.ts +5 -4
  20. package/dist/task/ArrayTask.d.ts.map +1 -1
  21. package/dist/task/DelayTask.d.ts.map +1 -1
  22. package/dist/task/FetchUrlTask.d.ts +3 -1
  23. package/dist/task/FetchUrlTask.d.ts.map +1 -1
  24. package/dist/task/FileLoaderTask.d.ts.map +1 -1
  25. package/dist/task/HumanApprovalTask.d.ts +68 -0
  26. package/dist/task/HumanApprovalTask.d.ts.map +1 -0
  27. package/dist/task/HumanInputTask.d.ts +164 -0
  28. package/dist/task/HumanInputTask.d.ts.map +1 -0
  29. package/dist/task/InputTask.d.ts +2 -1
  30. package/dist/task/InputTask.d.ts.map +1 -1
  31. package/dist/task/JavaScriptTask.d.ts +8 -1
  32. package/dist/task/JavaScriptTask.d.ts.map +1 -1
  33. package/dist/task/JsonTask.d.ts +2 -2
  34. package/dist/task/JsonTask.d.ts.map +1 -1
  35. package/dist/task/LambdaTask.d.ts +6 -1
  36. package/dist/task/LambdaTask.d.ts.map +1 -1
  37. package/dist/task/McpElicitationConnector.d.ts +39 -0
  38. package/dist/task/McpElicitationConnector.d.ts.map +1 -0
  39. package/dist/task/MergeTask.d.ts.map +1 -1
  40. package/dist/task/OutputTask.d.ts +3 -1
  41. package/dist/task/OutputTask.d.ts.map +1 -1
  42. package/dist/task/SplitTask.d.ts +1 -3
  43. package/dist/task/SplitTask.d.ts.map +1 -1
  44. package/dist/task/mcp/McpListTask.d.ts +4 -0
  45. package/dist/task/mcp/McpListTask.d.ts.map +1 -1
  46. package/dist/task/mcp/McpPromptGetTask.d.ts +6 -2
  47. package/dist/task/mcp/McpPromptGetTask.d.ts.map +1 -1
  48. package/dist/task/mcp/McpResourceReadTask.d.ts +4 -0
  49. package/dist/task/mcp/McpResourceReadTask.d.ts.map +1 -1
  50. package/dist/task/mcp/McpSearchTask.d.ts +2 -0
  51. package/dist/task/mcp/McpSearchTask.d.ts.map +1 -1
  52. package/dist/task/mcp/McpToolCallTask.d.ts +6 -2
  53. package/dist/task/mcp/McpToolCallTask.d.ts.map +1 -1
  54. package/dist/task/scalar/ScalarCeilTask.d.ts.map +1 -1
  55. package/dist/task/scalar/ScalarRoundTask.d.ts.map +1 -1
  56. package/dist/task/scalar/ScalarTruncTask.d.ts.map +1 -1
  57. package/dist/task/string/StringTemplateTask.d.ts.map +1 -1
  58. package/dist/task/vector/VectorDistanceTask.d.ts.map +1 -1
  59. package/dist/util/McpAuthProvider.d.ts +1 -1
  60. package/dist/util/McpAuthProvider.d.ts.map +1 -1
  61. package/dist/util/getMcpServerTransport.d.ts +13 -0
  62. package/dist/util/getMcpServerTransport.d.ts.map +1 -0
  63. package/package.json +14 -9
package/dist/browser.js CHANGED
@@ -598,7 +598,11 @@ class ArrayTask extends GraphAsTask {
598
598
  const combinations = this.generateCombinations(inputObject, inputIds);
599
599
  const tasks = combinations.map((combination) => {
600
600
  const { id, title, ...rest } = this.config;
601
- const task = new this.constructor({ ...this.defaults, ...this.runInputData, ...combination }, { ...rest, id: `${id}_${uuid4()}` }, this.runConfig);
601
+ const task = new this.constructor({
602
+ ...rest,
603
+ id: `${id}_${uuid4()}`,
604
+ defaults: { ...this.defaults, ...this.runInputData, ...combination }
605
+ }, this.runConfig);
602
606
  return task;
603
607
  });
604
608
  this.subGraph.addTasks(tasks);
@@ -728,7 +732,7 @@ class DebugLogTask extends Task10 {
728
732
  }
729
733
  }
730
734
  var debugLog = (input, config = {}) => {
731
- const task = new DebugLogTask({}, config);
735
+ const task = new DebugLogTask(config);
732
736
  return task.run(input);
733
737
  };
734
738
  Workflow11.prototype.debugLog = CreateWorkflow10(DebugLogTask);
@@ -800,7 +804,7 @@ class DelayTask extends Task11 {
800
804
  }
801
805
  }
802
806
  var delay = (input, config = { delay: 1 }) => {
803
- const task = new DelayTask({}, config);
807
+ const task = new DelayTask(config);
804
808
  return task.run(input);
805
809
  };
806
810
  Workflow12.prototype.delay = CreateWorkflow11(DelayTask);
@@ -813,6 +817,7 @@ import {
813
817
  } from "@workglow/job-queue";
814
818
  import {
815
819
  CreateWorkflow as CreateWorkflow12,
820
+ Entitlements,
816
821
  getJobQueueFactory,
817
822
  getTaskQueueRegistry,
818
823
  JobTaskFailedError,
@@ -1075,6 +1080,18 @@ class FetchUrlTask extends Task12 {
1075
1080
  static title = "Fetch";
1076
1081
  static description = "Fetches data from a URL with progress tracking and automatic retry handling";
1077
1082
  static hasDynamicSchemas = true;
1083
+ static entitlements() {
1084
+ return {
1085
+ entitlements: [
1086
+ { id: Entitlements.NETWORK_HTTP, reason: "Fetches data from URLs via HTTP/HTTPS" },
1087
+ {
1088
+ id: Entitlements.CREDENTIAL,
1089
+ reason: "May use Bearer token authentication",
1090
+ optional: true
1091
+ }
1092
+ ]
1093
+ };
1094
+ }
1078
1095
  static configSchema() {
1079
1096
  return fetchUrlTaskConfigSchema;
1080
1097
  }
@@ -1147,7 +1164,7 @@ class FetchUrlTask extends Task12 {
1147
1164
  }
1148
1165
  const registeredQueue = await this.resolveOrCreateQueue(queueName);
1149
1166
  if (executeContext.signal.aborted) {
1150
- throw executeContext.signal.reason ?? new DOMException("The operation was aborted", "AbortError");
1167
+ throw executeContext.signal.reason ?? new AbortSignalJobError("The operation was aborted");
1151
1168
  }
1152
1169
  const handle = await registeredQueue.client.submit(jobInput, {
1153
1170
  jobRunId: this.runConfig.runnerId,
@@ -1164,7 +1181,7 @@ class FetchUrlTask extends Task12 {
1164
1181
  });
1165
1182
  try {
1166
1183
  if (executeContext.signal.aborted) {
1167
- throw executeContext.signal.reason ?? new DOMException("The operation was aborted", "AbortError");
1184
+ throw executeContext.signal.reason ?? new AbortSignalJobError("The operation was aborted");
1168
1185
  }
1169
1186
  const output = await handle.waitFor();
1170
1187
  return output;
@@ -1242,18 +1259,455 @@ class FetchUrlTask extends Task12 {
1242
1259
  }
1243
1260
  }
1244
1261
  var fetchUrl = async (input, config = {}) => {
1245
- const result = await new FetchUrlTask({}, config).run(input);
1262
+ const result = await new FetchUrlTask(config).run(input);
1246
1263
  return result;
1247
1264
  };
1248
1265
  Workflow13.prototype.fetch = CreateWorkflow12(FetchUrlTask);
1249
- // src/task/InputTask.ts
1266
+ // src/task/HumanApprovalTask.ts
1267
+ import {
1268
+ CreateWorkflow as CreateWorkflow14,
1269
+ Task as Task14,
1270
+ TaskAbortedError as TaskAbortedError3,
1271
+ TaskConfigSchema as TaskConfigSchema5,
1272
+ Workflow as Workflow15
1273
+ } from "@workglow/task-graph";
1274
+ import { uuid4 as uuid43 } from "@workglow/util";
1275
+
1276
+ // src/task/HumanInputTask.ts
1250
1277
  import {
1251
1278
  CreateWorkflow as CreateWorkflow13,
1252
1279
  Task as Task13,
1280
+ TaskAbortedError as TaskAbortedError2,
1281
+ TaskConfigSchema as TaskConfigSchema4,
1282
+ TaskConfigurationError as TaskConfigurationError2,
1253
1283
  Workflow as Workflow14
1254
1284
  } from "@workglow/task-graph";
1285
+ import { createServiceToken, uuid4 as uuid42 } from "@workglow/util";
1286
+ var HUMAN_CONNECTOR = createServiceToken("HUMAN_CONNECTOR");
1287
+ var humanInputTaskConfigSchema = {
1288
+ type: "object",
1289
+ properties: {
1290
+ ...TaskConfigSchema4["properties"],
1291
+ targetHumanId: {
1292
+ type: "string",
1293
+ title: "Target Human",
1294
+ description: "Identifier of the human to ask (e.g. 'default', 'admin', 'user:alice')",
1295
+ default: "default"
1296
+ },
1297
+ kind: {
1298
+ type: "string",
1299
+ title: "Kind",
1300
+ description: "Interaction kind: notify (one-way), display (show content), elicit (request input)",
1301
+ enum: ["notify", "display", "elicit"],
1302
+ default: "elicit"
1303
+ },
1304
+ contentSchema: {
1305
+ type: "object",
1306
+ properties: {},
1307
+ additionalProperties: true,
1308
+ title: "Content Schema",
1309
+ description: "JSON schema describing the content/form to present",
1310
+ "x-ui-hidden": true
1311
+ },
1312
+ message: {
1313
+ type: "string",
1314
+ title: "Message",
1315
+ description: "Explanatory message shown to the human",
1316
+ "x-ui-editor": "textarea"
1317
+ },
1318
+ mode: {
1319
+ type: "string",
1320
+ title: "Mode",
1321
+ description: "Interaction mode",
1322
+ enum: ["single", "multi-turn"],
1323
+ default: "single"
1324
+ },
1325
+ metadata: {
1326
+ type: "object",
1327
+ additionalProperties: true,
1328
+ "x-ui-hidden": true
1329
+ }
1330
+ },
1331
+ additionalProperties: false
1332
+ };
1333
+ var defaultInputSchema = {
1334
+ type: "object",
1335
+ properties: {
1336
+ prompt: {
1337
+ type: "string",
1338
+ title: "Prompt",
1339
+ description: "Dynamic prompt text merged into the request message"
1340
+ },
1341
+ contentData: {
1342
+ type: "object",
1343
+ additionalProperties: true,
1344
+ title: "Content Data",
1345
+ description: "Data to display (for notify/display kinds)",
1346
+ "x-ui-hidden": true
1347
+ },
1348
+ context: {
1349
+ type: "object",
1350
+ additionalProperties: true,
1351
+ title: "Context",
1352
+ description: "Dynamic context data merged into the request metadata",
1353
+ "x-ui-hidden": true
1354
+ }
1355
+ },
1356
+ additionalProperties: false
1357
+ };
1358
+ var defaultOutputSchema = {
1359
+ type: "object",
1360
+ properties: {
1361
+ action: {
1362
+ type: "string",
1363
+ title: "Action",
1364
+ description: "The human's action: accept, decline, or cancel",
1365
+ enum: ["accept", "decline", "cancel"]
1366
+ }
1367
+ },
1368
+ additionalProperties: true
1369
+ };
1370
+
1371
+ class HumanInputTask extends Task13 {
1372
+ static type = "HumanInputTask";
1373
+ static category = "Flow Control";
1374
+ static title = "Human Input";
1375
+ static description = "Sends an interaction (notification, display, or input request) to a human";
1376
+ static cacheable = false;
1377
+ static hasDynamicSchemas = true;
1378
+ static configSchema() {
1379
+ return humanInputTaskConfigSchema;
1380
+ }
1381
+ static inputSchema() {
1382
+ return defaultInputSchema;
1383
+ }
1384
+ static outputSchema() {
1385
+ return defaultOutputSchema;
1386
+ }
1387
+ outputSchema() {
1388
+ if (this.config?.contentSchema && (this.config.kind ?? "elicit") === "elicit") {
1389
+ const configSchema = this.config.contentSchema;
1390
+ const existingProps = configSchema.properties ?? {};
1391
+ const additionalProperties = configSchema.additionalProperties ?? false;
1392
+ const actionProp = {
1393
+ type: "string",
1394
+ title: "Action",
1395
+ description: "The human's action: accept, decline, or cancel",
1396
+ enum: ["accept", "decline", "cancel"]
1397
+ };
1398
+ const result = {
1399
+ type: "object",
1400
+ properties: { ...existingProps, action: actionProp },
1401
+ required: ["action"],
1402
+ additionalProperties
1403
+ };
1404
+ return result;
1405
+ }
1406
+ return this.constructor.outputSchema();
1407
+ }
1408
+ async execute(input, context) {
1409
+ const connector = resolveHumanConnector(context);
1410
+ const kind = this.config.kind ?? "elicit";
1411
+ const mode = this.config.mode ?? "single";
1412
+ const requestId = uuid42();
1413
+ const message = input.prompt ? this.config.message ? `${this.config.message}
1414
+
1415
+ ${input.prompt}` : input.prompt : this.config.message ?? "";
1416
+ const emptySchema = {
1417
+ type: "object",
1418
+ properties: {},
1419
+ additionalProperties: true
1420
+ };
1421
+ const request = {
1422
+ requestId,
1423
+ targetHumanId: this.config.targetHumanId ?? "default",
1424
+ kind,
1425
+ message,
1426
+ contentSchema: this.config.contentSchema ?? emptySchema,
1427
+ contentData: input.contentData,
1428
+ expectsResponse: kind === "elicit",
1429
+ mode: kind === "elicit" ? mode : "single",
1430
+ metadata: input.context ? { ...this.config.metadata, ...input.context } : this.config.metadata
1431
+ };
1432
+ if (context.signal.aborted) {
1433
+ throw new TaskAbortedError2("Task aborted before sending human interaction");
1434
+ }
1435
+ let response;
1436
+ try {
1437
+ response = await connector.send(request, context.signal);
1438
+ } catch (err) {
1439
+ if (context.signal.aborted) {
1440
+ throw new TaskAbortedError2("Task aborted during human interaction");
1441
+ }
1442
+ throw err;
1443
+ }
1444
+ if (kind === "elicit" && mode === "multi-turn" && !response.done) {
1445
+ if (typeof connector.followUp !== "function") {
1446
+ throw new TaskConfigurationError2('HumanInputTask is configured for "multi-turn" mode but the registered ' + "IHumanConnector does not implement followUp()");
1447
+ }
1448
+ while (!response.done) {
1449
+ if (context.signal.aborted) {
1450
+ throw new TaskAbortedError2("Task aborted during multi-turn conversation");
1451
+ }
1452
+ try {
1453
+ response = await connector.followUp(request, response, context.signal);
1454
+ } catch (err) {
1455
+ if (context.signal.aborted) {
1456
+ throw new TaskAbortedError2("Task aborted during multi-turn conversation");
1457
+ }
1458
+ throw err;
1459
+ }
1460
+ }
1461
+ }
1462
+ return { ...response.content, action: response.action };
1463
+ }
1464
+ }
1465
+ function resolveHumanConnector(context) {
1466
+ if (!context.registry.has(HUMAN_CONNECTOR)) {
1467
+ throw new TaskConfigurationError2("No IHumanConnector registered. Register one via " + "registry.registerInstance(HUMAN_CONNECTOR, connector) before running a human-in-the-loop task.");
1468
+ }
1469
+ return context.registry.get(HUMAN_CONNECTOR);
1470
+ }
1471
+ Workflow14.prototype.humanInput = CreateWorkflow13(HumanInputTask);
1472
+
1473
+ // src/task/HumanApprovalTask.ts
1474
+ var humanApprovalConfigSchema = {
1475
+ type: "object",
1476
+ properties: {
1477
+ ...TaskConfigSchema5["properties"],
1478
+ targetHumanId: {
1479
+ type: "string",
1480
+ title: "Target Human",
1481
+ description: "Identifier of the human to ask for approval",
1482
+ default: "default"
1483
+ },
1484
+ message: {
1485
+ type: "string",
1486
+ title: "Message",
1487
+ description: "Explanatory message shown to the approver",
1488
+ "x-ui-editor": "textarea"
1489
+ },
1490
+ metadata: {
1491
+ type: "object",
1492
+ additionalProperties: true,
1493
+ "x-ui-hidden": true
1494
+ }
1495
+ },
1496
+ additionalProperties: false
1497
+ };
1498
+ var inputSchema13 = {
1499
+ type: "object",
1500
+ properties: {
1501
+ prompt: {
1502
+ type: "string",
1503
+ title: "Prompt",
1504
+ description: "Dynamic prompt text merged into the approval message"
1505
+ },
1506
+ context: {
1507
+ type: "object",
1508
+ additionalProperties: true,
1509
+ title: "Context",
1510
+ description: "Dynamic context data merged into the request metadata",
1511
+ "x-ui-hidden": true
1512
+ }
1513
+ },
1514
+ additionalProperties: false
1515
+ };
1516
+ var approvalRequestedSchema = {
1517
+ type: "object",
1518
+ properties: {
1519
+ approved: {
1520
+ type: "boolean",
1521
+ title: "Approved",
1522
+ description: "Whether the request is approved"
1523
+ },
1524
+ reason: {
1525
+ type: "string",
1526
+ title: "Reason",
1527
+ description: "Optional explanation for the decision"
1528
+ }
1529
+ },
1530
+ required: ["approved"]
1531
+ };
1532
+ var approvalOutputSchema = {
1533
+ type: "object",
1534
+ properties: {
1535
+ action: {
1536
+ type: "string",
1537
+ title: "Action",
1538
+ description: "The human's action: accept, decline, or cancel",
1539
+ enum: ["accept", "decline", "cancel"]
1540
+ },
1541
+ approved: {
1542
+ type: "boolean",
1543
+ title: "Approved",
1544
+ description: "Whether the human approved the request"
1545
+ },
1546
+ reason: {
1547
+ type: "string",
1548
+ title: "Reason",
1549
+ description: "Optional explanation for the decision"
1550
+ }
1551
+ },
1552
+ required: ["action", "approved"],
1553
+ additionalProperties: false
1554
+ };
1555
+
1556
+ class HumanApprovalTask extends Task14 {
1557
+ static type = "HumanApprovalTask";
1558
+ static category = "Flow Control";
1559
+ static title = "Human Approval";
1560
+ static description = "Pauses execution to request approval from a human (approve/deny) via MCP elicitation";
1561
+ static cacheable = false;
1562
+ static configSchema() {
1563
+ return humanApprovalConfigSchema;
1564
+ }
1565
+ static inputSchema() {
1566
+ return inputSchema13;
1567
+ }
1568
+ static outputSchema() {
1569
+ return approvalOutputSchema;
1570
+ }
1571
+ async execute(input, context) {
1572
+ const connector = resolveHumanConnector(context);
1573
+ const requestId = uuid43();
1574
+ const message = input.prompt ? this.config.message ? `${this.config.message}
1575
+
1576
+ ${input.prompt}` : input.prompt : this.config.message ?? "";
1577
+ const request = {
1578
+ requestId,
1579
+ targetHumanId: this.config.targetHumanId ?? "default",
1580
+ kind: "elicit",
1581
+ message,
1582
+ contentSchema: approvalRequestedSchema,
1583
+ contentData: undefined,
1584
+ expectsResponse: true,
1585
+ mode: "single",
1586
+ metadata: input.context ? { ...this.config.metadata, ...input.context } : this.config.metadata
1587
+ };
1588
+ if (context.signal.aborted) {
1589
+ throw new TaskAbortedError3("Task aborted before requesting human approval");
1590
+ }
1591
+ let response;
1592
+ try {
1593
+ response = await connector.send(request, context.signal);
1594
+ } catch (err) {
1595
+ if (context.signal.aborted) {
1596
+ throw new TaskAbortedError3("Task aborted during human approval");
1597
+ }
1598
+ throw err;
1599
+ }
1600
+ if (response.action === "accept" && response.content) {
1601
+ return {
1602
+ action: response.action,
1603
+ approved: response.content.approved === true,
1604
+ reason: response.content.reason
1605
+ };
1606
+ }
1607
+ return {
1608
+ action: response.action,
1609
+ approved: false,
1610
+ ...response.content?.reason !== undefined ? { reason: response.content.reason } : {}
1611
+ };
1612
+ }
1613
+ }
1614
+ Workflow15.prototype.humanApproval = CreateWorkflow14(HumanApprovalTask);
1615
+ // src/task/McpElicitationConnector.ts
1616
+ function defaultAbortError() {
1617
+ const err = new Error("The operation was aborted");
1618
+ err.name = "AbortError";
1619
+ return err;
1620
+ }
1621
+ function toMcpRequestedSchema(schema) {
1622
+ const props = schema.properties ?? {};
1623
+ const required = schema.required;
1624
+ return {
1625
+ type: "object",
1626
+ properties: props,
1627
+ ...required ? { required } : {}
1628
+ };
1629
+ }
1630
+
1631
+ class McpElicitationConnector {
1632
+ server;
1633
+ constructor(server) {
1634
+ this.server = server;
1635
+ }
1636
+ async send(request, signal) {
1637
+ switch (request.kind) {
1638
+ case "notify":
1639
+ return this.handleNotify(request, signal);
1640
+ case "display":
1641
+ return this.handleDisplay(request, signal);
1642
+ case "elicit":
1643
+ return this.handleElicit(request, signal);
1644
+ default:
1645
+ return this.handleElicit(request, signal);
1646
+ }
1647
+ }
1648
+ async followUp(request, _previousResponse, signal) {
1649
+ return this.send(request, signal);
1650
+ }
1651
+ async handleNotify(request, signal) {
1652
+ if (signal.aborted) {
1653
+ throw signal.reason ?? defaultAbortError();
1654
+ }
1655
+ await this.server.sendLoggingMessage({
1656
+ level: "info",
1657
+ data: request.contentData ?? request.message,
1658
+ logger: request.targetHumanId
1659
+ });
1660
+ if (signal.aborted) {
1661
+ throw signal.reason ?? defaultAbortError();
1662
+ }
1663
+ return {
1664
+ requestId: request.requestId,
1665
+ action: "accept",
1666
+ content: undefined,
1667
+ done: true
1668
+ };
1669
+ }
1670
+ async handleDisplay(request, signal) {
1671
+ if (signal.aborted) {
1672
+ throw signal.reason ?? defaultAbortError();
1673
+ }
1674
+ await this.server.sendLoggingMessage({
1675
+ level: "info",
1676
+ data: {
1677
+ message: request.message,
1678
+ content: request.contentData,
1679
+ schema: request.contentSchema
1680
+ },
1681
+ logger: request.targetHumanId
1682
+ });
1683
+ if (signal.aborted) {
1684
+ throw signal.reason ?? defaultAbortError();
1685
+ }
1686
+ return {
1687
+ requestId: request.requestId,
1688
+ action: "accept",
1689
+ content: undefined,
1690
+ done: true
1691
+ };
1692
+ }
1693
+ async handleElicit(request, signal) {
1694
+ const mcpResult = await this.server.elicitInput({
1695
+ mode: "form",
1696
+ message: request.message,
1697
+ requestedSchema: toMcpRequestedSchema(request.contentSchema)
1698
+ }, { signal });
1699
+ return {
1700
+ requestId: request.requestId,
1701
+ action: mcpResult.action,
1702
+ content: mcpResult.action === "accept" ? mcpResult.content : undefined,
1703
+ done: true
1704
+ };
1705
+ }
1706
+ }
1707
+ // src/task/InputTask.ts
1708
+ import { CreateWorkflow as CreateWorkflow15, Task as Task15, Workflow as Workflow16 } from "@workglow/task-graph";
1255
1709
 
1256
- class InputTask extends Task13 {
1710
+ class InputTask extends Task15 {
1257
1711
  static type = "InputTask";
1258
1712
  static category = "Flow Control";
1259
1713
  static title = "Input";
@@ -1304,14 +1758,15 @@ class InputTask extends Task13 {
1304
1758
  yield { type: "finish", data: input };
1305
1759
  }
1306
1760
  }
1307
- Workflow14.prototype.input = CreateWorkflow13(InputTask);
1761
+ Workflow16.prototype.input = CreateWorkflow15(InputTask);
1308
1762
  // src/task/JavaScriptTask.ts
1309
1763
  import {
1310
- CreateWorkflow as CreateWorkflow14,
1311
- Task as Task14,
1312
- TaskConfigSchema as TaskConfigSchema4,
1764
+ CreateWorkflow as CreateWorkflow16,
1765
+ Entitlements as Entitlements2,
1766
+ Task as Task16,
1767
+ TaskConfigSchema as TaskConfigSchema6,
1313
1768
  TaskInvalidInputError as TaskInvalidInputError3,
1314
- Workflow as Workflow15
1769
+ Workflow as Workflow17
1315
1770
  } from "@workglow/task-graph";
1316
1771
 
1317
1772
  // src/util/acorn.js
@@ -5779,7 +6234,7 @@ var isValidIdentifier = (key) => /^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(key);
5779
6234
  var configSchema = {
5780
6235
  type: "object",
5781
6236
  properties: {
5782
- ...TaskConfigSchema4["properties"],
6237
+ ...TaskConfigSchema6["properties"],
5783
6238
  javascript_code: {
5784
6239
  type: "string",
5785
6240
  title: "Code",
@@ -5790,7 +6245,7 @@ var configSchema = {
5790
6245
  },
5791
6246
  additionalProperties: false
5792
6247
  };
5793
- var inputSchema13 = {
6248
+ var inputSchema14 = {
5794
6249
  type: "object",
5795
6250
  properties: {
5796
6251
  javascript_code: {
@@ -5816,24 +6271,32 @@ var outputSchema13 = {
5816
6271
  additionalProperties: false
5817
6272
  };
5818
6273
 
5819
- class JavaScriptTask extends Task14 {
6274
+ class JavaScriptTask extends Task16 {
5820
6275
  static type = "JavaScriptTask";
5821
6276
  static category = "Utility";
5822
6277
  static title = "JavaScript Interpreter";
5823
6278
  static description = "Executes JavaScript code in a sandboxed interpreter environment";
5824
6279
  static customizable = true;
6280
+ static hasDynamicSchemas = true;
6281
+ static entitlements() {
6282
+ return {
6283
+ entitlements: [
6284
+ {
6285
+ id: Entitlements2.CODE_EXECUTION_JS,
6286
+ reason: "Executes user-provided JavaScript code in a sandboxed interpreter"
6287
+ }
6288
+ ]
6289
+ };
6290
+ }
5825
6291
  static configSchema() {
5826
6292
  return configSchema;
5827
6293
  }
5828
6294
  static inputSchema() {
5829
- return inputSchema13;
6295
+ return inputSchema14;
5830
6296
  }
5831
6297
  static outputSchema() {
5832
6298
  return outputSchema13;
5833
6299
  }
5834
- constructor(input2 = {}, config = {}) {
5835
- super(input2, config);
5836
- }
5837
6300
  inputSchema() {
5838
6301
  if (this.config?.javascript_code) {
5839
6302
  if (this.config.inputSchema) {
@@ -5845,7 +6308,7 @@ class JavaScriptTask extends Task14 {
5845
6308
  additionalProperties: true
5846
6309
  };
5847
6310
  }
5848
- return inputSchema13;
6311
+ return inputSchema14;
5849
6312
  }
5850
6313
  async executeReactive(input2, output) {
5851
6314
  const code = input2.javascript_code || this.config.javascript_code;
@@ -5865,20 +6328,20 @@ class JavaScriptTask extends Task14 {
5865
6328
  }
5866
6329
  }
5867
6330
  var javaScript = (input2, config = {}) => {
5868
- return new JavaScriptTask({}, config).run(input2);
6331
+ return new JavaScriptTask(config).run(input2);
5869
6332
  };
5870
- Workflow15.prototype.javaScript = CreateWorkflow14(JavaScriptTask);
6333
+ Workflow17.prototype.javaScript = CreateWorkflow16(JavaScriptTask);
5871
6334
  // src/task/JsonTask.ts
5872
6335
  import {
5873
6336
  createGraphFromDependencyJSON,
5874
6337
  createGraphFromGraphJSON,
5875
- CreateWorkflow as CreateWorkflow15,
6338
+ CreateWorkflow as CreateWorkflow17,
5876
6339
  Dataflow,
5877
6340
  GraphAsTask as GraphAsTask2,
5878
- TaskConfigurationError as TaskConfigurationError2,
5879
- Workflow as Workflow16
6341
+ TaskConfigurationError as TaskConfigurationError3,
6342
+ Workflow as Workflow18
5880
6343
  } from "@workglow/task-graph";
5881
- var inputSchema14 = {
6344
+ var inputSchema15 = {
5882
6345
  type: "object",
5883
6346
  properties: {
5884
6347
  json: {
@@ -5906,7 +6369,7 @@ class JsonTask extends GraphAsTask2 {
5906
6369
  static title = "JSON Task";
5907
6370
  static description = "A task that creates and manages task graphs from JSON configurations";
5908
6371
  static inputSchema() {
5909
- return inputSchema14;
6372
+ return inputSchema15;
5910
6373
  }
5911
6374
  static outputSchema() {
5912
6375
  return outputSchema14;
@@ -5930,7 +6393,7 @@ class JsonTask extends GraphAsTask2 {
5930
6393
  for (const dep of dependencies) {
5931
6394
  const sourceTask = this.subGraph.getTask(dep.id);
5932
6395
  if (!sourceTask) {
5933
- throw new TaskConfigurationError2(`Dependency id ${dep.id} not found`);
6396
+ throw new TaskConfigurationError3(`Dependency id ${dep.id} not found`);
5934
6397
  }
5935
6398
  const df = new Dataflow(sourceTask.id, dep.output, item.id, input2);
5936
6399
  this.subGraph.addDataflow(df);
@@ -5941,28 +6404,28 @@ class JsonTask extends GraphAsTask2 {
5941
6404
  }
5942
6405
  }
5943
6406
  var json = (input2, config = {}) => {
5944
- return new JsonTask({}, config).run(input2);
6407
+ return new JsonTask(config).run(input2);
5945
6408
  };
5946
- Workflow16.prototype.json = CreateWorkflow15(JsonTask);
6409
+ Workflow18.prototype.json = CreateWorkflow17(JsonTask);
5947
6410
  // src/task/LambdaTask.ts
5948
6411
  import {
5949
- CreateWorkflow as CreateWorkflow16,
6412
+ CreateWorkflow as CreateWorkflow18,
5950
6413
  DATAFLOW_ALL_PORTS,
5951
- Task as Task15,
5952
- TaskConfigSchema as TaskConfigSchema5,
5953
- TaskConfigurationError as TaskConfigurationError3,
5954
- Workflow as Workflow17
6414
+ Task as Task17,
6415
+ TaskConfigSchema as TaskConfigSchema7,
6416
+ TaskConfigurationError as TaskConfigurationError4,
6417
+ Workflow as Workflow19
5955
6418
  } from "@workglow/task-graph";
5956
6419
  var lambdaTaskConfigSchema = {
5957
6420
  type: "object",
5958
6421
  properties: {
5959
- ...TaskConfigSchema5["properties"],
6422
+ ...TaskConfigSchema7["properties"],
5960
6423
  execute: {},
5961
6424
  executeReactive: {}
5962
6425
  },
5963
6426
  additionalProperties: false
5964
6427
  };
5965
- var inputSchema15 = {
6428
+ var inputSchema16 = {
5966
6429
  type: "object",
5967
6430
  properties: {
5968
6431
  [DATAFLOW_ALL_PORTS]: {
@@ -5983,7 +6446,7 @@ var outputSchema15 = {
5983
6446
  additionalProperties: true
5984
6447
  };
5985
6448
 
5986
- class LambdaTask extends Task15 {
6449
+ class LambdaTask extends Task17 {
5987
6450
  static type = "LambdaTask";
5988
6451
  static title = "Lambda Task";
5989
6452
  static description = "A task that wraps a provided function and its input";
@@ -5993,7 +6456,7 @@ class LambdaTask extends Task15 {
5993
6456
  return lambdaTaskConfigSchema;
5994
6457
  }
5995
6458
  static inputSchema() {
5996
- return inputSchema15;
6459
+ return inputSchema16;
5997
6460
  }
5998
6461
  static outputSchema() {
5999
6462
  return outputSchema15;
@@ -6001,11 +6464,11 @@ class LambdaTask extends Task15 {
6001
6464
  canSerializeConfig() {
6002
6465
  return false;
6003
6466
  }
6004
- constructor(input2 = {}, config = {}) {
6467
+ constructor(config = {}) {
6005
6468
  if (!config.execute && !config.executeReactive) {
6006
- throw new TaskConfigurationError3("LambdaTask must have either execute or executeReactive function in config");
6469
+ throw new TaskConfigurationError4("LambdaTask must have either execute or executeReactive function in config");
6007
6470
  }
6008
- super(input2, config);
6471
+ super(config);
6009
6472
  }
6010
6473
  async execute(input2, context) {
6011
6474
  if (typeof this.config.execute === "function") {
@@ -6022,18 +6485,18 @@ class LambdaTask extends Task15 {
6022
6485
  }
6023
6486
  function lambda(input2, config) {
6024
6487
  if (typeof input2 === "function") {
6025
- const task2 = new LambdaTask({}, {
6488
+ const task2 = new LambdaTask({
6026
6489
  execute: input2
6027
6490
  });
6028
6491
  return task2.run();
6029
6492
  }
6030
- const task = new LambdaTask(input2, config);
6493
+ const task = new LambdaTask({ ...config, defaults: input2 });
6031
6494
  return task.run();
6032
6495
  }
6033
- Workflow17.prototype.lambda = CreateWorkflow16(LambdaTask);
6496
+ Workflow19.prototype.lambda = CreateWorkflow18(LambdaTask);
6034
6497
  // src/task/MergeTask.ts
6035
- import { CreateWorkflow as CreateWorkflow17, Task as Task16, Workflow as Workflow18 } from "@workglow/task-graph";
6036
- var inputSchema16 = {
6498
+ import { CreateWorkflow as CreateWorkflow19, Task as Task18, Workflow as Workflow20 } from "@workglow/task-graph";
6499
+ var inputSchema17 = {
6037
6500
  type: "object",
6038
6501
  properties: {},
6039
6502
  additionalProperties: true
@@ -6050,14 +6513,14 @@ var outputSchema16 = {
6050
6513
  additionalProperties: false
6051
6514
  };
6052
6515
 
6053
- class MergeTask extends Task16 {
6516
+ class MergeTask extends Task18 {
6054
6517
  static type = "MergeTask";
6055
6518
  static category = "Utility";
6056
6519
  static title = "Merge";
6057
6520
  static description = "Merges multiple inputs into a single array output";
6058
6521
  static cacheable = true;
6059
6522
  static inputSchema() {
6060
- return inputSchema16;
6523
+ return inputSchema17;
6061
6524
  }
6062
6525
  static outputSchema() {
6063
6526
  return outputSchema16;
@@ -6071,24 +6534,21 @@ class MergeTask extends Task16 {
6071
6534
  }
6072
6535
  }
6073
6536
  var merge = (input2, config = {}) => {
6074
- const task = new MergeTask({}, config);
6537
+ const task = new MergeTask(config);
6075
6538
  return task.run(input2);
6076
6539
  };
6077
- Workflow18.prototype.merge = CreateWorkflow17(MergeTask);
6540
+ Workflow20.prototype.merge = CreateWorkflow19(MergeTask);
6078
6541
  // src/task/OutputTask.ts
6079
- import {
6080
- CreateWorkflow as CreateWorkflow18,
6081
- Task as Task17,
6082
- Workflow as Workflow19
6083
- } from "@workglow/task-graph";
6542
+ import { CreateWorkflow as CreateWorkflow20, Task as Task19, Workflow as Workflow21 } from "@workglow/task-graph";
6084
6543
 
6085
- class OutputTask extends Task17 {
6544
+ class OutputTask extends Task19 {
6086
6545
  static type = "OutputTask";
6087
6546
  static category = "Flow Control";
6088
6547
  static title = "Output";
6089
6548
  static description = "Ends the workflow";
6090
6549
  static hasDynamicSchemas = true;
6091
6550
  static cacheable = false;
6551
+ static isGraphOutput = true;
6092
6552
  static inputSchema() {
6093
6553
  return {
6094
6554
  type: "object",
@@ -6133,10 +6593,10 @@ class OutputTask extends Task17 {
6133
6593
  yield { type: "finish", data: input2 };
6134
6594
  }
6135
6595
  }
6136
- Workflow19.prototype.output = CreateWorkflow18(OutputTask);
6596
+ Workflow21.prototype.output = CreateWorkflow20(OutputTask);
6137
6597
  // src/task/SplitTask.ts
6138
- import { CreateWorkflow as CreateWorkflow19, Task as Task18, Workflow as Workflow20 } from "@workglow/task-graph";
6139
- var inputSchema17 = {
6598
+ import { CreateWorkflow as CreateWorkflow21, Task as Task20, Workflow as Workflow22 } from "@workglow/task-graph";
6599
+ var inputSchema18 = {
6140
6600
  type: "object",
6141
6601
  properties: {
6142
6602
  input: {
@@ -6152,22 +6612,18 @@ var outputSchema17 = {
6152
6612
  additionalProperties: true
6153
6613
  };
6154
6614
 
6155
- class SplitTask extends Task18 {
6615
+ class SplitTask extends Task20 {
6156
6616
  static type = "SplitTask";
6157
6617
  static category = "Utility";
6158
6618
  static title = "Split";
6159
6619
  static description = "Splits an array into individual outputs, creating one output per element";
6160
- static hasDynamicSchemas = true;
6161
6620
  static cacheable = false;
6162
6621
  static inputSchema() {
6163
- return inputSchema17;
6622
+ return inputSchema18;
6164
6623
  }
6165
6624
  static outputSchema() {
6166
6625
  return outputSchema17;
6167
6626
  }
6168
- outputSchema() {
6169
- return outputSchema17;
6170
- }
6171
6627
  async executeReactive(input2) {
6172
6628
  const inputValue = input2.input;
6173
6629
  const output = {};
@@ -6182,17 +6638,17 @@ class SplitTask extends Task18 {
6182
6638
  }
6183
6639
  }
6184
6640
  var split = (input2, config = {}) => {
6185
- const task = new SplitTask({}, config);
6641
+ const task = new SplitTask(config);
6186
6642
  return task.run(input2);
6187
6643
  };
6188
- Workflow20.prototype.split = CreateWorkflow19(SplitTask);
6644
+ Workflow22.prototype.split = CreateWorkflow21(SplitTask);
6189
6645
  // src/task/DateFormatTask.ts
6190
6646
  import {
6191
- CreateWorkflow as CreateWorkflow20,
6192
- Task as Task19,
6193
- Workflow as Workflow21
6647
+ CreateWorkflow as CreateWorkflow22,
6648
+ Task as Task21,
6649
+ Workflow as Workflow23
6194
6650
  } from "@workglow/task-graph";
6195
- var inputSchema18 = {
6651
+ var inputSchema19 = {
6196
6652
  type: "object",
6197
6653
  properties: {
6198
6654
  value: {
@@ -6235,13 +6691,13 @@ var outputSchema18 = {
6235
6691
  additionalProperties: false
6236
6692
  };
6237
6693
 
6238
- class DateFormatTask extends Task19 {
6694
+ class DateFormatTask extends Task21 {
6239
6695
  static type = "DateFormatTask";
6240
6696
  static category = "Utility";
6241
6697
  static title = "Date Format";
6242
6698
  static description = "Parses and formats a date string";
6243
6699
  static inputSchema() {
6244
- return inputSchema18;
6700
+ return inputSchema19;
6245
6701
  }
6246
6702
  static outputSchema() {
6247
6703
  return outputSchema18;
@@ -6277,14 +6733,14 @@ class DateFormatTask extends Task19 {
6277
6733
  return { result };
6278
6734
  }
6279
6735
  }
6280
- Workflow21.prototype.dateFormat = CreateWorkflow20(DateFormatTask);
6736
+ Workflow23.prototype.dateFormat = CreateWorkflow22(DateFormatTask);
6281
6737
  // src/task/JsonPathTask.ts
6282
6738
  import {
6283
- CreateWorkflow as CreateWorkflow21,
6284
- Task as Task20,
6285
- Workflow as Workflow22
6739
+ CreateWorkflow as CreateWorkflow23,
6740
+ Task as Task22,
6741
+ Workflow as Workflow24
6286
6742
  } from "@workglow/task-graph";
6287
- var inputSchema19 = {
6743
+ var inputSchema20 = {
6288
6744
  type: "object",
6289
6745
  properties: {
6290
6746
  value: {
@@ -6333,13 +6789,13 @@ function resolvePath(obj, segments) {
6333
6789
  return resolvePath(next2, tail);
6334
6790
  }
6335
6791
 
6336
- class JsonPathTask extends Task20 {
6792
+ class JsonPathTask extends Task22 {
6337
6793
  static type = "JsonPathTask";
6338
6794
  static category = "Utility";
6339
6795
  static title = "JSON Path";
6340
6796
  static description = "Extracts a value from an object using a dot-notation path";
6341
6797
  static inputSchema() {
6342
- return inputSchema19;
6798
+ return inputSchema20;
6343
6799
  }
6344
6800
  static outputSchema() {
6345
6801
  return outputSchema19;
@@ -6350,20 +6806,20 @@ class JsonPathTask extends Task20 {
6350
6806
  return { result };
6351
6807
  }
6352
6808
  }
6353
- Workflow22.prototype.jsonPath = CreateWorkflow21(JsonPathTask);
6809
+ Workflow24.prototype.jsonPath = CreateWorkflow23(JsonPathTask);
6354
6810
  // src/task/RegexTask.ts
6355
6811
  import {
6356
- CreateWorkflow as CreateWorkflow22,
6357
- Task as Task21,
6812
+ CreateWorkflow as CreateWorkflow24,
6813
+ Task as Task23,
6358
6814
  TaskInvalidInputError as TaskInvalidInputError4,
6359
- Workflow as Workflow23
6815
+ Workflow as Workflow25
6360
6816
  } from "@workglow/task-graph";
6361
6817
  var MAX_BRACKET_COUNT = 100;
6362
6818
  function hasNestedQuantifiers(pattern) {
6363
6819
  const withoutClasses = pattern.replace(/\[(?:[^\]\\]|\\.)*\]/g, "X");
6364
6820
  return /\([^)]*[+*][^)]*\)[+*?]|\([^)]*[+*][^)]*\)\{/.test(withoutClasses);
6365
6821
  }
6366
- var inputSchema20 = {
6822
+ var inputSchema21 = {
6367
6823
  type: "object",
6368
6824
  properties: {
6369
6825
  value: {
@@ -6405,13 +6861,13 @@ var outputSchema20 = {
6405
6861
  additionalProperties: false
6406
6862
  };
6407
6863
 
6408
- class RegexTask extends Task21 {
6864
+ class RegexTask extends Task23 {
6409
6865
  static type = "RegexTask";
6410
6866
  static category = "String";
6411
6867
  static title = "Regex";
6412
6868
  static description = "Matches a string against a regular expression pattern";
6413
6869
  static inputSchema() {
6414
- return inputSchema20;
6870
+ return inputSchema21;
6415
6871
  }
6416
6872
  static outputSchema() {
6417
6873
  return outputSchema20;
@@ -6443,14 +6899,14 @@ class RegexTask extends Task21 {
6443
6899
  };
6444
6900
  }
6445
6901
  }
6446
- Workflow23.prototype.regex = CreateWorkflow22(RegexTask);
6902
+ Workflow25.prototype.regex = CreateWorkflow24(RegexTask);
6447
6903
  // src/task/TemplateTask.ts
6448
6904
  import {
6449
- CreateWorkflow as CreateWorkflow23,
6450
- Task as Task22,
6451
- Workflow as Workflow24
6905
+ CreateWorkflow as CreateWorkflow25,
6906
+ Task as Task24,
6907
+ Workflow as Workflow26
6452
6908
  } from "@workglow/task-graph";
6453
- var inputSchema21 = {
6909
+ var inputSchema22 = {
6454
6910
  type: "object",
6455
6911
  properties: {
6456
6912
  template: {
@@ -6481,13 +6937,13 @@ var outputSchema21 = {
6481
6937
  additionalProperties: false
6482
6938
  };
6483
6939
 
6484
- class TemplateTask extends Task22 {
6940
+ class TemplateTask extends Task24 {
6485
6941
  static type = "TemplateTask";
6486
6942
  static category = "Utility";
6487
6943
  static title = "Template";
6488
6944
  static description = "Renders a template string with {{key}} placeholders and optional defaults";
6489
6945
  static inputSchema() {
6490
- return inputSchema21;
6946
+ return inputSchema22;
6491
6947
  }
6492
6948
  static outputSchema() {
6493
6949
  return outputSchema21;
@@ -6512,7 +6968,7 @@ class TemplateTask extends Task22 {
6512
6968
  return { result };
6513
6969
  }
6514
6970
  }
6515
- Workflow24.prototype.template = CreateWorkflow23(TemplateTask);
6971
+ Workflow26.prototype.template = CreateWorkflow25(TemplateTask);
6516
6972
  // src/util/McpClientUtil.ts
6517
6973
  import { Client } from "@modelcontextprotocol/sdk/client";
6518
6974
  import { SSEClientTransport } from "@modelcontextprotocol/sdk/client/sse.js";
@@ -7034,8 +7490,8 @@ function buildAuthConfig(flat) {
7034
7490
  }
7035
7491
 
7036
7492
  // src/util/McpTaskDeps.ts
7037
- import { createServiceToken, globalServiceRegistry } from "@workglow/util";
7038
- var MCP_TASK_DEPS = createServiceToken("@workglow/tasks/mcp");
7493
+ import { createServiceToken as createServiceToken2, globalServiceRegistry } from "@workglow/util";
7494
+ var MCP_TASK_DEPS = createServiceToken2("@workglow/tasks/mcp");
7039
7495
  function registerMcpTaskDeps(deps) {
7040
7496
  globalServiceRegistry.registerInstance(MCP_TASK_DEPS, deps);
7041
7497
  }
@@ -7262,19 +7718,15 @@ class InMemoryMcpServerRepository extends McpServerRepository {
7262
7718
  }
7263
7719
  // src/mcp-server/McpServerRegistry.ts
7264
7720
  import {
7265
- createServiceToken as createServiceToken2,
7721
+ createServiceToken as createServiceToken3,
7266
7722
  globalServiceRegistry as globalServiceRegistry2,
7267
7723
  registerInputCompactor,
7268
7724
  registerInputResolver
7269
7725
  } from "@workglow/util";
7270
- var MCP_SERVERS = createServiceToken2("mcp-server.registry");
7271
- var MCP_SERVER_REPOSITORY = createServiceToken2("mcp-server.repository");
7272
- if (!globalServiceRegistry2.has(MCP_SERVERS)) {
7273
- globalServiceRegistry2.register(MCP_SERVERS, () => new Map, true);
7274
- }
7275
- if (!globalServiceRegistry2.has(MCP_SERVER_REPOSITORY)) {
7276
- globalServiceRegistry2.register(MCP_SERVER_REPOSITORY, () => new InMemoryMcpServerRepository, true);
7277
- }
7726
+ var MCP_SERVERS = createServiceToken3("mcp-server.registry");
7727
+ var MCP_SERVER_REPOSITORY = createServiceToken3("mcp-server.repository");
7728
+ globalServiceRegistry2.registerIfAbsent(MCP_SERVERS, () => new Map, true);
7729
+ globalServiceRegistry2.registerIfAbsent(MCP_SERVER_REPOSITORY, () => new InMemoryMcpServerRepository, true);
7278
7730
  function getGlobalMcpServers() {
7279
7731
  return globalServiceRegistry2.get(MCP_SERVERS);
7280
7732
  }
@@ -7339,7 +7791,29 @@ function getMcpServerConfig(configOrInput) {
7339
7791
  return base;
7340
7792
  }
7341
7793
  // src/task/mcp/McpListTask.ts
7342
- import { CreateWorkflow as CreateWorkflow24, Task as Task23, Workflow as Workflow25 } from "@workglow/task-graph";
7794
+ import {
7795
+ CreateWorkflow as CreateWorkflow26,
7796
+ Entitlements as Entitlements3,
7797
+ mergeEntitlements,
7798
+ Task as Task25,
7799
+ Workflow as Workflow27
7800
+ } from "@workglow/task-graph";
7801
+
7802
+ // src/util/getMcpServerTransport.ts
7803
+ function getMcpServerTransport(task) {
7804
+ const runInputData = task.runInputData;
7805
+ const inputServer = runInputData?.server;
7806
+ if (typeof inputServer?.transport === "string") {
7807
+ return inputServer.transport;
7808
+ }
7809
+ const configServer = task.config?.server;
7810
+ if (typeof configServer?.transport === "string") {
7811
+ return configServer.transport;
7812
+ }
7813
+ return;
7814
+ }
7815
+
7816
+ // src/task/mcp/McpListTask.ts
7343
7817
  var mcpListTypes = ["tools", "resources", "prompts"];
7344
7818
  var iconSchema = {
7345
7819
  type: "object",
@@ -7496,13 +7970,35 @@ var outputSchemaAll = {
7496
7970
  additionalProperties: false
7497
7971
  };
7498
7972
 
7499
- class McpListTask extends Task23 {
7973
+ class McpListTask extends Task25 {
7500
7974
  static type = "McpListTask";
7501
7975
  static category = "MCP";
7502
7976
  static title = "MCP List";
7503
7977
  static description = "Lists tools, resources, or prompts available on an MCP server";
7504
7978
  static cacheable = false;
7505
7979
  static hasDynamicSchemas = true;
7980
+ static hasDynamicEntitlements = true;
7981
+ static entitlements() {
7982
+ return {
7983
+ entitlements: [
7984
+ { id: Entitlements3.MCP, reason: "Lists tools, resources, or prompts on MCP servers" }
7985
+ ]
7986
+ };
7987
+ }
7988
+ entitlements() {
7989
+ const base = McpListTask.entitlements();
7990
+ const transport = getMcpServerTransport(this);
7991
+ if (transport === "stdio") {
7992
+ return mergeEntitlements(base, {
7993
+ entitlements: [
7994
+ { id: Entitlements3.MCP_STDIO, reason: "Uses stdio transport to spawn local process" }
7995
+ ]
7996
+ });
7997
+ }
7998
+ return mergeEntitlements(base, {
7999
+ entitlements: [{ id: Entitlements3.NETWORK_HTTP, reason: "Connects to MCP server over HTTP" }]
8000
+ });
8001
+ }
7506
8002
  static inputSchema() {
7507
8003
  const { mcpServerConfigSchema: mcpServerConfigSchema2 } = getMcpTaskDeps();
7508
8004
  return {
@@ -7579,15 +8075,17 @@ class McpListTask extends Task23 {
7579
8075
  }
7580
8076
  }
7581
8077
  var mcpList = async (input2, config = {}) => {
7582
- return new McpListTask({}, config).run(input2);
8078
+ return new McpListTask(config).run(input2);
7583
8079
  };
7584
- Workflow25.prototype.mcpList = CreateWorkflow24(McpListTask);
8080
+ Workflow27.prototype.mcpList = CreateWorkflow26(McpListTask);
7585
8081
  // src/task/mcp/McpPromptGetTask.ts
7586
8082
  import {
7587
- CreateWorkflow as CreateWorkflow25,
7588
- Task as Task24,
7589
- TaskConfigSchema as TaskConfigSchema6,
7590
- Workflow as Workflow26
8083
+ CreateWorkflow as CreateWorkflow27,
8084
+ Entitlements as Entitlements4,
8085
+ mergeEntitlements as mergeEntitlements2,
8086
+ Task as Task26,
8087
+ TaskConfigSchema as TaskConfigSchema8,
8088
+ Workflow as Workflow28
7591
8089
  } from "@workglow/task-graph";
7592
8090
  var annotationsSchema = {
7593
8091
  type: "object",
@@ -7722,7 +8220,7 @@ var fallbackInputSchema = {
7722
8220
  additionalProperties: false
7723
8221
  };
7724
8222
 
7725
- class McpPromptGetTask extends Task24 {
8223
+ class McpPromptGetTask extends Task26 {
7726
8224
  static type = "McpPromptGetTask";
7727
8225
  static category = "MCP";
7728
8226
  static title = "MCP Get Prompt";
@@ -7730,6 +8228,29 @@ class McpPromptGetTask extends Task24 {
7730
8228
  static cacheable = false;
7731
8229
  static customizable = true;
7732
8230
  static hasDynamicSchemas = true;
8231
+ static hasDynamicEntitlements = true;
8232
+ static entitlements() {
8233
+ return {
8234
+ entitlements: [{ id: Entitlements4.MCP_PROMPT_GET, reason: "Gets prompts from MCP servers" }]
8235
+ };
8236
+ }
8237
+ entitlements() {
8238
+ const base = McpPromptGetTask.entitlements();
8239
+ const transport = getMcpServerTransport(this);
8240
+ if (transport === "stdio") {
8241
+ return mergeEntitlements2(base, {
8242
+ entitlements: [
8243
+ { id: Entitlements4.MCP_STDIO, reason: "Uses stdio transport to spawn local process" }
8244
+ ]
8245
+ });
8246
+ }
8247
+ return mergeEntitlements2(base, {
8248
+ entitlements: [
8249
+ { id: Entitlements4.NETWORK_HTTP, reason: "Connects to MCP server over HTTP" },
8250
+ { id: Entitlements4.CREDENTIAL, reason: "May require authentication", optional: true }
8251
+ ]
8252
+ });
8253
+ }
7733
8254
  static inputSchema() {
7734
8255
  return fallbackInputSchema;
7735
8256
  }
@@ -7741,7 +8262,7 @@ class McpPromptGetTask extends Task24 {
7741
8262
  return {
7742
8263
  type: "object",
7743
8264
  properties: {
7744
- ...TaskConfigSchema6["properties"],
8265
+ ...TaskConfigSchema8["properties"],
7745
8266
  server: TypeMcpServer(mcpServerConfigSchema2),
7746
8267
  prompt_name: {
7747
8268
  type: "string",
@@ -7760,43 +8281,45 @@ class McpPromptGetTask extends Task24 {
7760
8281
  outputSchema() {
7761
8282
  return this.config?.outputSchema ?? fallbackOutputSchema;
7762
8283
  }
7763
- _schemasDiscovering = false;
8284
+ _schemasDiscoveringPromise;
7764
8285
  async discoverSchemas(_signal, serverConfig) {
7765
8286
  if (this.config.inputSchema)
7766
8287
  return;
7767
- if (this._schemasDiscovering)
7768
- return;
8288
+ if (this._schemasDiscoveringPromise)
8289
+ return this._schemasDiscoveringPromise;
7769
8290
  const resolved = serverConfig ?? getMcpServerConfig(this.config);
7770
8291
  if (!resolved.transport || !this.config.prompt_name)
7771
8292
  return;
7772
- this._schemasDiscovering = true;
7773
- try {
7774
- const result = await mcpList({
7775
- server: resolved,
7776
- list_type: "prompts"
7777
- });
7778
- const prompt = result.prompts?.find((p) => p.name === this.config.prompt_name);
7779
- if (prompt) {
7780
- const args = prompt.arguments ?? [];
7781
- const required = args.filter((a) => a.required).map((a) => a.name);
7782
- const properties = {};
7783
- for (const arg of args) {
7784
- properties[arg.name] = {
7785
- type: "string",
7786
- ...arg.description ? { description: arg.description } : {}
8293
+ this._schemasDiscoveringPromise = (async () => {
8294
+ try {
8295
+ const result = await mcpList({
8296
+ server: resolved,
8297
+ list_type: "prompts"
8298
+ });
8299
+ const prompt = result.prompts?.find((p) => p.name === this.config.prompt_name);
8300
+ if (prompt) {
8301
+ const args = prompt.arguments ?? [];
8302
+ const required = args.filter((a) => a.required).map((a) => a.name);
8303
+ const properties = {};
8304
+ for (const arg of args) {
8305
+ properties[arg.name] = {
8306
+ type: "string",
8307
+ ...arg.description ? { description: arg.description } : {}
8308
+ };
8309
+ }
8310
+ this.config.inputSchema = {
8311
+ type: "object",
8312
+ properties,
8313
+ ...required.length > 0 ? { required } : {},
8314
+ additionalProperties: false
7787
8315
  };
8316
+ this.emitSchemaChange();
7788
8317
  }
7789
- this.config.inputSchema = {
7790
- type: "object",
7791
- properties,
7792
- ...required.length > 0 ? { required } : {},
7793
- additionalProperties: false
7794
- };
7795
- this.emitSchemaChange();
8318
+ } finally {
8319
+ this._schemasDiscoveringPromise = undefined;
7796
8320
  }
7797
- } finally {
7798
- this._schemasDiscovering = false;
7799
- }
8321
+ })();
8322
+ return this._schemasDiscoveringPromise;
7800
8323
  }
7801
8324
  async execute(input2, context) {
7802
8325
  const serverConfig = getMcpServerConfig(this.config);
@@ -7818,15 +8341,17 @@ class McpPromptGetTask extends Task24 {
7818
8341
  }
7819
8342
  }
7820
8343
  var mcpPromptGet = async (input2, config) => {
7821
- return new McpPromptGetTask({}, config).run(input2);
8344
+ return new McpPromptGetTask(config).run(input2);
7822
8345
  };
7823
- Workflow26.prototype.mcpPromptGet = CreateWorkflow25(McpPromptGetTask);
8346
+ Workflow28.prototype.mcpPromptGet = CreateWorkflow27(McpPromptGetTask);
7824
8347
  // src/task/mcp/McpResourceReadTask.ts
7825
8348
  import {
7826
- CreateWorkflow as CreateWorkflow26,
7827
- Task as Task25,
7828
- TaskConfigSchema as TaskConfigSchema7,
7829
- Workflow as Workflow27
8349
+ CreateWorkflow as CreateWorkflow28,
8350
+ Entitlements as Entitlements5,
8351
+ mergeEntitlements as mergeEntitlements3,
8352
+ Task as Task27,
8353
+ TaskConfigSchema as TaskConfigSchema9,
8354
+ Workflow as Workflow29
7830
8355
  } from "@workglow/task-graph";
7831
8356
  var contentItemSchema = {
7832
8357
  anyOf: [
@@ -7854,7 +8379,7 @@ var contentItemSchema = {
7854
8379
  }
7855
8380
  ]
7856
8381
  };
7857
- var inputSchema22 = {
8382
+ var inputSchema23 = {
7858
8383
  type: "object",
7859
8384
  properties: {},
7860
8385
  additionalProperties: false
@@ -7873,15 +8398,40 @@ var outputSchema22 = {
7873
8398
  additionalProperties: false
7874
8399
  };
7875
8400
 
7876
- class McpResourceReadTask extends Task25 {
8401
+ class McpResourceReadTask extends Task27 {
7877
8402
  static type = "McpResourceReadTask";
7878
8403
  static category = "MCP";
7879
8404
  static title = "MCP Read Resource";
7880
8405
  static description = "Reads a resource from an MCP server";
7881
8406
  static cacheable = false;
7882
8407
  static customizable = true;
8408
+ static hasDynamicEntitlements = true;
8409
+ static entitlements() {
8410
+ return {
8411
+ entitlements: [
8412
+ { id: Entitlements5.MCP_RESOURCE_READ, reason: "Reads resources from MCP servers" }
8413
+ ]
8414
+ };
8415
+ }
8416
+ entitlements() {
8417
+ const base = McpResourceReadTask.entitlements();
8418
+ const transport = getMcpServerTransport(this);
8419
+ if (transport === "stdio") {
8420
+ return mergeEntitlements3(base, {
8421
+ entitlements: [
8422
+ { id: Entitlements5.MCP_STDIO, reason: "Uses stdio transport to spawn local process" }
8423
+ ]
8424
+ });
8425
+ }
8426
+ return mergeEntitlements3(base, {
8427
+ entitlements: [
8428
+ { id: Entitlements5.NETWORK_HTTP, reason: "Connects to MCP server over HTTP" },
8429
+ { id: Entitlements5.CREDENTIAL, reason: "May require authentication", optional: true }
8430
+ ]
8431
+ });
8432
+ }
7883
8433
  static inputSchema() {
7884
- return inputSchema22;
8434
+ return inputSchema23;
7885
8435
  }
7886
8436
  static outputSchema() {
7887
8437
  return outputSchema22;
@@ -7891,7 +8441,7 @@ class McpResourceReadTask extends Task25 {
7891
8441
  return {
7892
8442
  type: "object",
7893
8443
  properties: {
7894
- ...TaskConfigSchema7["properties"],
8444
+ ...TaskConfigSchema9["properties"],
7895
8445
  server: TypeMcpServer(mcpServerConfigSchema2),
7896
8446
  resource_uri: {
7897
8447
  type: "string",
@@ -7919,11 +8469,16 @@ class McpResourceReadTask extends Task25 {
7919
8469
  }
7920
8470
  }
7921
8471
  var mcpResourceRead = async (config) => {
7922
- return new McpResourceReadTask({}, config).run({});
8472
+ return new McpResourceReadTask(config).run({});
7923
8473
  };
7924
- Workflow27.prototype.mcpResourceRead = CreateWorkflow26(McpResourceReadTask);
8474
+ Workflow29.prototype.mcpResourceRead = CreateWorkflow28(McpResourceReadTask);
7925
8475
  // src/task/mcp/McpSearchTask.ts
7926
- import { CreateWorkflow as CreateWorkflow27, Task as Task26, Workflow as Workflow28 } from "@workglow/task-graph";
8476
+ import {
8477
+ CreateWorkflow as CreateWorkflow29,
8478
+ Entitlements as Entitlements6,
8479
+ Task as Task28,
8480
+ Workflow as Workflow30
8481
+ } from "@workglow/task-graph";
7927
8482
  var MCP_REGISTRY_BASE = "https://registry.modelcontextprotocol.io/v0.1";
7928
8483
  var McpSearchInputSchema = {
7929
8484
  type: "object",
@@ -8062,12 +8617,19 @@ async function searchMcpRegistry(query, signal) {
8062
8617
  return page.results;
8063
8618
  }
8064
8619
 
8065
- class McpSearchTask extends Task26 {
8620
+ class McpSearchTask extends Task28 {
8066
8621
  static type = "McpSearchTask";
8067
8622
  static category = "MCP";
8068
8623
  static title = "MCP Search";
8069
8624
  static description = "Search the MCP server registry for servers matching a query";
8070
8625
  static cacheable = false;
8626
+ static entitlements() {
8627
+ return {
8628
+ entitlements: [
8629
+ { id: Entitlements6.NETWORK_HTTP, reason: "Searches the MCP server registry via HTTPS" }
8630
+ ]
8631
+ };
8632
+ }
8071
8633
  static inputSchema() {
8072
8634
  return McpSearchInputSchema;
8073
8635
  }
@@ -8080,15 +8642,17 @@ class McpSearchTask extends Task26 {
8080
8642
  }
8081
8643
  }
8082
8644
  var mcpSearch = (input2, config) => {
8083
- return new McpSearchTask({}, config).run(input2);
8645
+ return new McpSearchTask(config).run(input2);
8084
8646
  };
8085
- Workflow28.prototype.mcpSearch = CreateWorkflow27(McpSearchTask);
8647
+ Workflow30.prototype.mcpSearch = CreateWorkflow29(McpSearchTask);
8086
8648
  // src/task/mcp/McpToolCallTask.ts
8087
8649
  import {
8088
- CreateWorkflow as CreateWorkflow28,
8089
- Task as Task27,
8090
- TaskConfigSchema as TaskConfigSchema8,
8091
- Workflow as Workflow29
8650
+ CreateWorkflow as CreateWorkflow30,
8651
+ Entitlements as Entitlements7,
8652
+ mergeEntitlements as mergeEntitlements4,
8653
+ Task as Task29,
8654
+ TaskConfigSchema as TaskConfigSchema10,
8655
+ Workflow as Workflow31
8092
8656
  } from "@workglow/task-graph";
8093
8657
  var annotationsSchema2 = {
8094
8658
  type: "object",
@@ -8215,7 +8779,7 @@ var fallbackInputSchema2 = {
8215
8779
  additionalProperties: true
8216
8780
  };
8217
8781
 
8218
- class McpToolCallTask extends Task27 {
8782
+ class McpToolCallTask extends Task29 {
8219
8783
  static type = "McpToolCallTask";
8220
8784
  static category = "MCP";
8221
8785
  static title = "MCP Call Tool";
@@ -8223,6 +8787,29 @@ class McpToolCallTask extends Task27 {
8223
8787
  static cacheable = false;
8224
8788
  static customizable = true;
8225
8789
  static hasDynamicSchemas = true;
8790
+ static hasDynamicEntitlements = true;
8791
+ static entitlements() {
8792
+ return {
8793
+ entitlements: [{ id: Entitlements7.MCP_TOOL_CALL, reason: "Calls tools on MCP servers" }]
8794
+ };
8795
+ }
8796
+ entitlements() {
8797
+ const base = McpToolCallTask.entitlements();
8798
+ const transport = getMcpServerTransport(this);
8799
+ if (transport === "stdio") {
8800
+ return mergeEntitlements4(base, {
8801
+ entitlements: [
8802
+ { id: Entitlements7.MCP_STDIO, reason: "Uses stdio transport to spawn local process" }
8803
+ ]
8804
+ });
8805
+ }
8806
+ return mergeEntitlements4(base, {
8807
+ entitlements: [
8808
+ { id: Entitlements7.NETWORK_HTTP, reason: "Connects to MCP server over HTTP" },
8809
+ { id: Entitlements7.CREDENTIAL, reason: "May require authentication", optional: true }
8810
+ ]
8811
+ });
8812
+ }
8226
8813
  static inputSchema() {
8227
8814
  return fallbackInputSchema2;
8228
8815
  }
@@ -8234,7 +8821,7 @@ class McpToolCallTask extends Task27 {
8234
8821
  return {
8235
8822
  type: "object",
8236
8823
  properties: {
8237
- ...TaskConfigSchema8["properties"],
8824
+ ...TaskConfigSchema10["properties"],
8238
8825
  server: TypeMcpServer(mcpServerConfigSchema2),
8239
8826
  tool_name: {
8240
8827
  type: "string",
@@ -8253,34 +8840,36 @@ class McpToolCallTask extends Task27 {
8253
8840
  outputSchema() {
8254
8841
  return this.config?.outputSchema ?? fallbackOutputSchema2;
8255
8842
  }
8256
- _schemasDiscovering = false;
8843
+ _schemasDiscoveringPromise;
8257
8844
  async discoverSchemas(_signal, serverConfig) {
8258
8845
  if (this.config.inputSchema && this.config.outputSchema)
8259
8846
  return;
8260
- if (this._schemasDiscovering)
8261
- return;
8847
+ if (this._schemasDiscoveringPromise)
8848
+ return this._schemasDiscoveringPromise;
8262
8849
  const resolved = serverConfig ?? getMcpServerConfig(this.config);
8263
8850
  if (!resolved.transport || !this.config.tool_name)
8264
8851
  return;
8265
- this._schemasDiscovering = true;
8266
- try {
8267
- const result = await mcpList({
8268
- server: resolved,
8269
- list_type: "tools"
8270
- });
8271
- const tool = result.tools?.find((t) => t.name === this.config.tool_name);
8272
- if (tool) {
8273
- if (!this.config.inputSchema) {
8274
- this.config.inputSchema = tool.inputSchema;
8275
- }
8276
- if (!this.config.outputSchema && tool.outputSchema) {
8277
- this.config.outputSchema = tool.outputSchema;
8852
+ this._schemasDiscoveringPromise = (async () => {
8853
+ try {
8854
+ const result = await mcpList({
8855
+ server: resolved,
8856
+ list_type: "tools"
8857
+ });
8858
+ const tool = result.tools?.find((t) => t.name === this.config.tool_name);
8859
+ if (tool) {
8860
+ if (!this.config.inputSchema) {
8861
+ this.config.inputSchema = tool.inputSchema;
8862
+ }
8863
+ if (!this.config.outputSchema && tool.outputSchema) {
8864
+ this.config.outputSchema = tool.outputSchema;
8865
+ }
8866
+ this.emitSchemaChange();
8278
8867
  }
8279
- this.emitSchemaChange();
8868
+ } finally {
8869
+ this._schemasDiscoveringPromise = undefined;
8280
8870
  }
8281
- } finally {
8282
- this._schemasDiscovering = false;
8283
- }
8871
+ })();
8872
+ return this._schemasDiscoveringPromise;
8284
8873
  }
8285
8874
  async execute(input2, context) {
8286
8875
  const serverConfig = getMcpServerConfig(this.config);
@@ -8326,16 +8915,16 @@ class McpToolCallTask extends Task27 {
8326
8915
  }
8327
8916
  }
8328
8917
  var mcpToolCall = async (input2, config) => {
8329
- return new McpToolCallTask({}, config).run(input2);
8918
+ return new McpToolCallTask(config).run(input2);
8330
8919
  };
8331
- Workflow29.prototype.mcpToolCall = CreateWorkflow28(McpToolCallTask);
8920
+ Workflow31.prototype.mcpToolCall = CreateWorkflow30(McpToolCallTask);
8332
8921
  // src/task/string/StringConcatTask.ts
8333
8922
  import {
8334
- CreateWorkflow as CreateWorkflow29,
8335
- Task as Task28,
8336
- Workflow as Workflow30
8923
+ CreateWorkflow as CreateWorkflow31,
8924
+ Task as Task30,
8925
+ Workflow as Workflow32
8337
8926
  } from "@workglow/task-graph";
8338
- var inputSchema23 = {
8927
+ var inputSchema24 = {
8339
8928
  type: "object",
8340
8929
  properties: {},
8341
8930
  additionalProperties: { type: "string" }
@@ -8353,13 +8942,13 @@ var outputSchema23 = {
8353
8942
  additionalProperties: false
8354
8943
  };
8355
8944
 
8356
- class StringConcatTask extends Task28 {
8945
+ class StringConcatTask extends Task30 {
8357
8946
  static type = "StringConcatTask";
8358
8947
  static category = "String";
8359
8948
  static title = "Concat";
8360
8949
  static description = "Concatenates all input strings";
8361
8950
  static inputSchema() {
8362
- return inputSchema23;
8951
+ return inputSchema24;
8363
8952
  }
8364
8953
  static outputSchema() {
8365
8954
  return outputSchema23;
@@ -8368,14 +8957,14 @@ class StringConcatTask extends Task28 {
8368
8957
  return { result: Object.values(input2).join("") };
8369
8958
  }
8370
8959
  }
8371
- Workflow30.prototype.stringConcat = CreateWorkflow29(StringConcatTask);
8960
+ Workflow32.prototype.stringConcat = CreateWorkflow31(StringConcatTask);
8372
8961
  // src/task/string/StringIncludesTask.ts
8373
8962
  import {
8374
- CreateWorkflow as CreateWorkflow30,
8375
- Task as Task29,
8376
- Workflow as Workflow31
8963
+ CreateWorkflow as CreateWorkflow32,
8964
+ Task as Task31,
8965
+ Workflow as Workflow33
8377
8966
  } from "@workglow/task-graph";
8378
- var inputSchema24 = {
8967
+ var inputSchema25 = {
8379
8968
  type: "object",
8380
8969
  properties: {
8381
8970
  value: {
@@ -8405,13 +8994,13 @@ var outputSchema24 = {
8405
8994
  additionalProperties: false
8406
8995
  };
8407
8996
 
8408
- class StringIncludesTask extends Task29 {
8997
+ class StringIncludesTask extends Task31 {
8409
8998
  static type = "StringIncludesTask";
8410
8999
  static category = "String";
8411
9000
  static title = "Includes";
8412
9001
  static description = "Checks if a string contains a substring";
8413
9002
  static inputSchema() {
8414
- return inputSchema24;
9003
+ return inputSchema25;
8415
9004
  }
8416
9005
  static outputSchema() {
8417
9006
  return outputSchema24;
@@ -8420,14 +9009,14 @@ class StringIncludesTask extends Task29 {
8420
9009
  return { result: input2.value.includes(input2.search) };
8421
9010
  }
8422
9011
  }
8423
- Workflow31.prototype.stringIncludes = CreateWorkflow30(StringIncludesTask);
9012
+ Workflow33.prototype.stringIncludes = CreateWorkflow32(StringIncludesTask);
8424
9013
  // src/task/string/StringJoinTask.ts
8425
9014
  import {
8426
- CreateWorkflow as CreateWorkflow31,
8427
- Task as Task30,
8428
- Workflow as Workflow32
9015
+ CreateWorkflow as CreateWorkflow33,
9016
+ Task as Task32,
9017
+ Workflow as Workflow34
8429
9018
  } from "@workglow/task-graph";
8430
- var inputSchema25 = {
9019
+ var inputSchema26 = {
8431
9020
  type: "object",
8432
9021
  properties: {
8433
9022
  values: {
@@ -8459,13 +9048,13 @@ var outputSchema25 = {
8459
9048
  additionalProperties: false
8460
9049
  };
8461
9050
 
8462
- class StringJoinTask extends Task30 {
9051
+ class StringJoinTask extends Task32 {
8463
9052
  static type = "StringJoinTask";
8464
9053
  static category = "String";
8465
9054
  static title = "Join";
8466
9055
  static description = "Joins an array of strings with a separator";
8467
9056
  static inputSchema() {
8468
- return inputSchema25;
9057
+ return inputSchema26;
8469
9058
  }
8470
9059
  static outputSchema() {
8471
9060
  return outputSchema25;
@@ -8475,14 +9064,14 @@ class StringJoinTask extends Task30 {
8475
9064
  return { result: input2.values.join(separator) };
8476
9065
  }
8477
9066
  }
8478
- Workflow32.prototype.stringJoin = CreateWorkflow31(StringJoinTask);
9067
+ Workflow34.prototype.stringJoin = CreateWorkflow33(StringJoinTask);
8479
9068
  // src/task/string/StringLengthTask.ts
8480
9069
  import {
8481
- CreateWorkflow as CreateWorkflow32,
8482
- Task as Task31,
8483
- Workflow as Workflow33
9070
+ CreateWorkflow as CreateWorkflow34,
9071
+ Task as Task33,
9072
+ Workflow as Workflow35
8484
9073
  } from "@workglow/task-graph";
8485
- var inputSchema26 = {
9074
+ var inputSchema27 = {
8486
9075
  type: "object",
8487
9076
  properties: {
8488
9077
  value: {
@@ -8507,13 +9096,13 @@ var outputSchema26 = {
8507
9096
  additionalProperties: false
8508
9097
  };
8509
9098
 
8510
- class StringLengthTask extends Task31 {
9099
+ class StringLengthTask extends Task33 {
8511
9100
  static type = "StringLengthTask";
8512
9101
  static category = "String";
8513
9102
  static title = "Length";
8514
9103
  static description = "Returns the length of a string";
8515
9104
  static inputSchema() {
8516
- return inputSchema26;
9105
+ return inputSchema27;
8517
9106
  }
8518
9107
  static outputSchema() {
8519
9108
  return outputSchema26;
@@ -8522,14 +9111,14 @@ class StringLengthTask extends Task31 {
8522
9111
  return { result: input2.value.length };
8523
9112
  }
8524
9113
  }
8525
- Workflow33.prototype.stringLength = CreateWorkflow32(StringLengthTask);
9114
+ Workflow35.prototype.stringLength = CreateWorkflow34(StringLengthTask);
8526
9115
  // src/task/string/StringLowerCaseTask.ts
8527
9116
  import {
8528
- CreateWorkflow as CreateWorkflow33,
8529
- Task as Task32,
8530
- Workflow as Workflow34
9117
+ CreateWorkflow as CreateWorkflow35,
9118
+ Task as Task34,
9119
+ Workflow as Workflow36
8531
9120
  } from "@workglow/task-graph";
8532
- var inputSchema27 = {
9121
+ var inputSchema28 = {
8533
9122
  type: "object",
8534
9123
  properties: {
8535
9124
  value: {
@@ -8554,13 +9143,13 @@ var outputSchema27 = {
8554
9143
  additionalProperties: false
8555
9144
  };
8556
9145
 
8557
- class StringLowerCaseTask extends Task32 {
9146
+ class StringLowerCaseTask extends Task34 {
8558
9147
  static type = "StringLowerCaseTask";
8559
9148
  static category = "String";
8560
9149
  static title = "Lower Case";
8561
9150
  static description = "Converts a string to lower case";
8562
9151
  static inputSchema() {
8563
- return inputSchema27;
9152
+ return inputSchema28;
8564
9153
  }
8565
9154
  static outputSchema() {
8566
9155
  return outputSchema27;
@@ -8569,14 +9158,14 @@ class StringLowerCaseTask extends Task32 {
8569
9158
  return { result: input2.value.toLowerCase() };
8570
9159
  }
8571
9160
  }
8572
- Workflow34.prototype.stringLowerCase = CreateWorkflow33(StringLowerCaseTask);
9161
+ Workflow36.prototype.stringLowerCase = CreateWorkflow35(StringLowerCaseTask);
8573
9162
  // src/task/string/StringReplaceTask.ts
8574
9163
  import {
8575
- CreateWorkflow as CreateWorkflow34,
8576
- Task as Task33,
8577
- Workflow as Workflow35
9164
+ CreateWorkflow as CreateWorkflow36,
9165
+ Task as Task35,
9166
+ Workflow as Workflow37
8578
9167
  } from "@workglow/task-graph";
8579
- var inputSchema28 = {
9168
+ var inputSchema29 = {
8580
9169
  type: "object",
8581
9170
  properties: {
8582
9171
  value: {
@@ -8611,13 +9200,13 @@ var outputSchema28 = {
8611
9200
  additionalProperties: false
8612
9201
  };
8613
9202
 
8614
- class StringReplaceTask extends Task33 {
9203
+ class StringReplaceTask extends Task35 {
8615
9204
  static type = "StringReplaceTask";
8616
9205
  static category = "String";
8617
9206
  static title = "Replace";
8618
9207
  static description = "Replaces all occurrences of a substring";
8619
9208
  static inputSchema() {
8620
- return inputSchema28;
9209
+ return inputSchema29;
8621
9210
  }
8622
9211
  static outputSchema() {
8623
9212
  return outputSchema28;
@@ -8626,14 +9215,14 @@ class StringReplaceTask extends Task33 {
8626
9215
  return { result: input2.value.replaceAll(input2.search, input2.replace) };
8627
9216
  }
8628
9217
  }
8629
- Workflow35.prototype.stringReplace = CreateWorkflow34(StringReplaceTask);
9218
+ Workflow37.prototype.stringReplace = CreateWorkflow36(StringReplaceTask);
8630
9219
  // src/task/string/StringSliceTask.ts
8631
9220
  import {
8632
- CreateWorkflow as CreateWorkflow35,
8633
- Task as Task34,
8634
- Workflow as Workflow36
9221
+ CreateWorkflow as CreateWorkflow37,
9222
+ Task as Task36,
9223
+ Workflow as Workflow38
8635
9224
  } from "@workglow/task-graph";
8636
- var inputSchema29 = {
9225
+ var inputSchema30 = {
8637
9226
  type: "object",
8638
9227
  properties: {
8639
9228
  value: {
@@ -8668,13 +9257,13 @@ var outputSchema29 = {
8668
9257
  additionalProperties: false
8669
9258
  };
8670
9259
 
8671
- class StringSliceTask extends Task34 {
9260
+ class StringSliceTask extends Task36 {
8672
9261
  static type = "StringSliceTask";
8673
9262
  static category = "String";
8674
9263
  static title = "Slice";
8675
9264
  static description = "Extracts a substring by start and optional end index";
8676
9265
  static inputSchema() {
8677
- return inputSchema29;
9266
+ return inputSchema30;
8678
9267
  }
8679
9268
  static outputSchema() {
8680
9269
  return outputSchema29;
@@ -8683,14 +9272,14 @@ class StringSliceTask extends Task34 {
8683
9272
  return { result: input2.value.slice(input2.start, input2.end) };
8684
9273
  }
8685
9274
  }
8686
- Workflow36.prototype.stringSlice = CreateWorkflow35(StringSliceTask);
9275
+ Workflow38.prototype.stringSlice = CreateWorkflow37(StringSliceTask);
8687
9276
  // src/task/string/StringTemplateTask.ts
8688
9277
  import {
8689
- CreateWorkflow as CreateWorkflow36,
8690
- Task as Task35,
8691
- Workflow as Workflow37
9278
+ CreateWorkflow as CreateWorkflow38,
9279
+ Task as Task37,
9280
+ Workflow as Workflow39
8692
9281
  } from "@workglow/task-graph";
8693
- var inputSchema30 = {
9282
+ var inputSchema31 = {
8694
9283
  type: "object",
8695
9284
  properties: {
8696
9285
  template: {
@@ -8721,13 +9310,13 @@ var outputSchema30 = {
8721
9310
  additionalProperties: false
8722
9311
  };
8723
9312
 
8724
- class StringTemplateTask extends Task35 {
9313
+ class StringTemplateTask extends Task37 {
8725
9314
  static type = "StringTemplateTask";
8726
9315
  static category = "String";
8727
9316
  static title = "Template";
8728
9317
  static description = "Replaces {{key}} placeholders in a template string with values";
8729
9318
  static inputSchema() {
8730
- return inputSchema30;
9319
+ return inputSchema31;
8731
9320
  }
8732
9321
  static outputSchema() {
8733
9322
  return outputSchema30;
@@ -8740,14 +9329,14 @@ class StringTemplateTask extends Task35 {
8740
9329
  return { result };
8741
9330
  }
8742
9331
  }
8743
- Workflow37.prototype.stringTemplate = CreateWorkflow36(StringTemplateTask);
9332
+ Workflow39.prototype.stringTemplate = CreateWorkflow38(StringTemplateTask);
8744
9333
  // src/task/string/StringTrimTask.ts
8745
9334
  import {
8746
- CreateWorkflow as CreateWorkflow37,
8747
- Task as Task36,
8748
- Workflow as Workflow38
9335
+ CreateWorkflow as CreateWorkflow39,
9336
+ Task as Task38,
9337
+ Workflow as Workflow40
8749
9338
  } from "@workglow/task-graph";
8750
- var inputSchema31 = {
9339
+ var inputSchema32 = {
8751
9340
  type: "object",
8752
9341
  properties: {
8753
9342
  value: {
@@ -8772,13 +9361,13 @@ var outputSchema31 = {
8772
9361
  additionalProperties: false
8773
9362
  };
8774
9363
 
8775
- class StringTrimTask extends Task36 {
9364
+ class StringTrimTask extends Task38 {
8776
9365
  static type = "StringTrimTask";
8777
9366
  static category = "String";
8778
9367
  static title = "Trim";
8779
9368
  static description = "Removes leading and trailing whitespace from a string";
8780
9369
  static inputSchema() {
8781
- return inputSchema31;
9370
+ return inputSchema32;
8782
9371
  }
8783
9372
  static outputSchema() {
8784
9373
  return outputSchema31;
@@ -8787,14 +9376,14 @@ class StringTrimTask extends Task36 {
8787
9376
  return { result: input2.value.trim() };
8788
9377
  }
8789
9378
  }
8790
- Workflow38.prototype.stringTrim = CreateWorkflow37(StringTrimTask);
9379
+ Workflow40.prototype.stringTrim = CreateWorkflow39(StringTrimTask);
8791
9380
  // src/task/string/StringUpperCaseTask.ts
8792
9381
  import {
8793
- CreateWorkflow as CreateWorkflow38,
8794
- Task as Task37,
8795
- Workflow as Workflow39
9382
+ CreateWorkflow as CreateWorkflow40,
9383
+ Task as Task39,
9384
+ Workflow as Workflow41
8796
9385
  } from "@workglow/task-graph";
8797
- var inputSchema32 = {
9386
+ var inputSchema33 = {
8798
9387
  type: "object",
8799
9388
  properties: {
8800
9389
  value: {
@@ -8819,13 +9408,13 @@ var outputSchema32 = {
8819
9408
  additionalProperties: false
8820
9409
  };
8821
9410
 
8822
- class StringUpperCaseTask extends Task37 {
9411
+ class StringUpperCaseTask extends Task39 {
8823
9412
  static type = "StringUpperCaseTask";
8824
9413
  static category = "String";
8825
9414
  static title = "Upper Case";
8826
9415
  static description = "Converts a string to upper case";
8827
9416
  static inputSchema() {
8828
- return inputSchema32;
9417
+ return inputSchema33;
8829
9418
  }
8830
9419
  static outputSchema() {
8831
9420
  return outputSchema32;
@@ -8834,10 +9423,10 @@ class StringUpperCaseTask extends Task37 {
8834
9423
  return { result: input2.value.toUpperCase() };
8835
9424
  }
8836
9425
  }
8837
- Workflow39.prototype.stringUpperCase = CreateWorkflow38(StringUpperCaseTask);
9426
+ Workflow41.prototype.stringUpperCase = CreateWorkflow40(StringUpperCaseTask);
8838
9427
  // src/task/scalar/ScalarAbsTask.ts
8839
- import { CreateWorkflow as CreateWorkflow39, Task as Task38, Workflow as Workflow40 } from "@workglow/task-graph";
8840
- var inputSchema33 = {
9428
+ import { CreateWorkflow as CreateWorkflow41, Task as Task40, Workflow as Workflow42 } from "@workglow/task-graph";
9429
+ var inputSchema34 = {
8841
9430
  type: "object",
8842
9431
  properties: {
8843
9432
  value: {
@@ -8862,13 +9451,13 @@ var outputSchema33 = {
8862
9451
  additionalProperties: false
8863
9452
  };
8864
9453
 
8865
- class ScalarAbsTask extends Task38 {
9454
+ class ScalarAbsTask extends Task40 {
8866
9455
  static type = "ScalarAbsTask";
8867
9456
  static category = "Math";
8868
9457
  static title = "Abs";
8869
9458
  static description = "Returns the absolute value of a number";
8870
9459
  static inputSchema() {
8871
- return inputSchema33;
9460
+ return inputSchema34;
8872
9461
  }
8873
9462
  static outputSchema() {
8874
9463
  return outputSchema33;
@@ -8877,10 +9466,10 @@ class ScalarAbsTask extends Task38 {
8877
9466
  return { result: Math.abs(input2.value) };
8878
9467
  }
8879
9468
  }
8880
- Workflow40.prototype.scalarAbs = CreateWorkflow39(ScalarAbsTask);
9469
+ Workflow42.prototype.scalarAbs = CreateWorkflow41(ScalarAbsTask);
8881
9470
  // src/task/scalar/ScalarCeilTask.ts
8882
- import { CreateWorkflow as CreateWorkflow40, Task as Task39, Workflow as Workflow41 } from "@workglow/task-graph";
8883
- var inputSchema34 = {
9471
+ import { CreateWorkflow as CreateWorkflow42, Task as Task41, Workflow as Workflow43 } from "@workglow/task-graph";
9472
+ var inputSchema35 = {
8884
9473
  type: "object",
8885
9474
  properties: {
8886
9475
  value: {
@@ -8905,13 +9494,13 @@ var outputSchema34 = {
8905
9494
  additionalProperties: false
8906
9495
  };
8907
9496
 
8908
- class ScalarCeilTask extends Task39 {
9497
+ class ScalarCeilTask extends Task41 {
8909
9498
  static type = "ScalarCeilTask";
8910
9499
  static category = "Math";
8911
9500
  static title = "Ceil";
8912
9501
  static description = "Returns the smallest integer greater than or equal to a number";
8913
9502
  static inputSchema() {
8914
- return inputSchema34;
9503
+ return inputSchema35;
8915
9504
  }
8916
9505
  static outputSchema() {
8917
9506
  return outputSchema34;
@@ -8920,10 +9509,10 @@ class ScalarCeilTask extends Task39 {
8920
9509
  return { result: Math.ceil(input2.value) };
8921
9510
  }
8922
9511
  }
8923
- Workflow41.prototype.scalarCeil = CreateWorkflow40(ScalarCeilTask);
9512
+ Workflow43.prototype.scalarCeil = CreateWorkflow42(ScalarCeilTask);
8924
9513
  // src/task/scalar/ScalarFloorTask.ts
8925
- import { CreateWorkflow as CreateWorkflow41, Task as Task40, Workflow as Workflow42 } from "@workglow/task-graph";
8926
- var inputSchema35 = {
9514
+ import { CreateWorkflow as CreateWorkflow43, Task as Task42, Workflow as Workflow44 } from "@workglow/task-graph";
9515
+ var inputSchema36 = {
8927
9516
  type: "object",
8928
9517
  properties: {
8929
9518
  value: {
@@ -8948,13 +9537,13 @@ var outputSchema35 = {
8948
9537
  additionalProperties: false
8949
9538
  };
8950
9539
 
8951
- class ScalarFloorTask extends Task40 {
9540
+ class ScalarFloorTask extends Task42 {
8952
9541
  static type = "ScalarFloorTask";
8953
9542
  static category = "Math";
8954
9543
  static title = "Floor";
8955
9544
  static description = "Returns the largest integer less than or equal to a number";
8956
9545
  static inputSchema() {
8957
- return inputSchema35;
9546
+ return inputSchema36;
8958
9547
  }
8959
9548
  static outputSchema() {
8960
9549
  return outputSchema35;
@@ -8963,10 +9552,10 @@ class ScalarFloorTask extends Task40 {
8963
9552
  return { result: Math.floor(input2.value) };
8964
9553
  }
8965
9554
  }
8966
- Workflow42.prototype.scalarFloor = CreateWorkflow41(ScalarFloorTask);
9555
+ Workflow44.prototype.scalarFloor = CreateWorkflow43(ScalarFloorTask);
8967
9556
  // src/task/scalar/ScalarMaxTask.ts
8968
- import { CreateWorkflow as CreateWorkflow42, Task as Task41, Workflow as Workflow43 } from "@workglow/task-graph";
8969
- var inputSchema36 = {
9557
+ import { CreateWorkflow as CreateWorkflow44, Task as Task43, Workflow as Workflow45 } from "@workglow/task-graph";
9558
+ var inputSchema37 = {
8970
9559
  type: "object",
8971
9560
  properties: {
8972
9561
  values: {
@@ -8992,13 +9581,13 @@ var outputSchema36 = {
8992
9581
  additionalProperties: false
8993
9582
  };
8994
9583
 
8995
- class ScalarMaxTask extends Task41 {
9584
+ class ScalarMaxTask extends Task43 {
8996
9585
  static type = "ScalarMaxTask";
8997
9586
  static category = "Math";
8998
9587
  static title = "Max";
8999
9588
  static description = "Returns the largest of the given numbers";
9000
9589
  static inputSchema() {
9001
- return inputSchema36;
9590
+ return inputSchema37;
9002
9591
  }
9003
9592
  static outputSchema() {
9004
9593
  return outputSchema36;
@@ -9007,10 +9596,10 @@ class ScalarMaxTask extends Task41 {
9007
9596
  return { result: Math.max(...input2.values) };
9008
9597
  }
9009
9598
  }
9010
- Workflow43.prototype.scalarMax = CreateWorkflow42(ScalarMaxTask);
9599
+ Workflow45.prototype.scalarMax = CreateWorkflow44(ScalarMaxTask);
9011
9600
  // src/task/scalar/ScalarMinTask.ts
9012
- import { CreateWorkflow as CreateWorkflow43, Task as Task42, Workflow as Workflow44 } from "@workglow/task-graph";
9013
- var inputSchema37 = {
9601
+ import { CreateWorkflow as CreateWorkflow45, Task as Task44, Workflow as Workflow46 } from "@workglow/task-graph";
9602
+ var inputSchema38 = {
9014
9603
  type: "object",
9015
9604
  properties: {
9016
9605
  values: {
@@ -9036,13 +9625,13 @@ var outputSchema37 = {
9036
9625
  additionalProperties: false
9037
9626
  };
9038
9627
 
9039
- class ScalarMinTask extends Task42 {
9628
+ class ScalarMinTask extends Task44 {
9040
9629
  static type = "ScalarMinTask";
9041
9630
  static category = "Math";
9042
9631
  static title = "Min";
9043
9632
  static description = "Returns the smallest of the given numbers";
9044
9633
  static inputSchema() {
9045
- return inputSchema37;
9634
+ return inputSchema38;
9046
9635
  }
9047
9636
  static outputSchema() {
9048
9637
  return outputSchema37;
@@ -9051,10 +9640,10 @@ class ScalarMinTask extends Task42 {
9051
9640
  return { result: Math.min(...input2.values) };
9052
9641
  }
9053
9642
  }
9054
- Workflow44.prototype.scalarMin = CreateWorkflow43(ScalarMinTask);
9643
+ Workflow46.prototype.scalarMin = CreateWorkflow45(ScalarMinTask);
9055
9644
  // src/task/scalar/ScalarRoundTask.ts
9056
- import { CreateWorkflow as CreateWorkflow44, Task as Task43, Workflow as Workflow45 } from "@workglow/task-graph";
9057
- var inputSchema38 = {
9645
+ import { CreateWorkflow as CreateWorkflow46, Task as Task45, Workflow as Workflow47 } from "@workglow/task-graph";
9646
+ var inputSchema39 = {
9058
9647
  type: "object",
9059
9648
  properties: {
9060
9649
  value: {
@@ -9079,13 +9668,13 @@ var outputSchema38 = {
9079
9668
  additionalProperties: false
9080
9669
  };
9081
9670
 
9082
- class ScalarRoundTask extends Task43 {
9671
+ class ScalarRoundTask extends Task45 {
9083
9672
  static type = "ScalarRoundTask";
9084
9673
  static category = "Math";
9085
9674
  static title = "Round";
9086
9675
  static description = "Returns the value of a number rounded to the nearest integer";
9087
9676
  static inputSchema() {
9088
- return inputSchema38;
9677
+ return inputSchema39;
9089
9678
  }
9090
9679
  static outputSchema() {
9091
9680
  return outputSchema38;
@@ -9094,10 +9683,10 @@ class ScalarRoundTask extends Task43 {
9094
9683
  return { result: Math.round(input2.value) };
9095
9684
  }
9096
9685
  }
9097
- Workflow45.prototype.scalarRound = CreateWorkflow44(ScalarRoundTask);
9686
+ Workflow47.prototype.scalarRound = CreateWorkflow46(ScalarRoundTask);
9098
9687
  // src/task/scalar/ScalarTruncTask.ts
9099
- import { CreateWorkflow as CreateWorkflow45, Task as Task44, Workflow as Workflow46 } from "@workglow/task-graph";
9100
- var inputSchema39 = {
9688
+ import { CreateWorkflow as CreateWorkflow47, Task as Task46, Workflow as Workflow48 } from "@workglow/task-graph";
9689
+ var inputSchema40 = {
9101
9690
  type: "object",
9102
9691
  properties: {
9103
9692
  value: {
@@ -9122,13 +9711,13 @@ var outputSchema39 = {
9122
9711
  additionalProperties: false
9123
9712
  };
9124
9713
 
9125
- class ScalarTruncTask extends Task44 {
9714
+ class ScalarTruncTask extends Task46 {
9126
9715
  static type = "ScalarTruncTask";
9127
9716
  static category = "Math";
9128
9717
  static title = "Truncate";
9129
9718
  static description = "Returns the integer part of a number by removing fractional digits";
9130
9719
  static inputSchema() {
9131
- return inputSchema39;
9720
+ return inputSchema40;
9132
9721
  }
9133
9722
  static outputSchema() {
9134
9723
  return outputSchema39;
@@ -9137,13 +9726,13 @@ class ScalarTruncTask extends Task44 {
9137
9726
  return { result: Math.trunc(input2.value) };
9138
9727
  }
9139
9728
  }
9140
- Workflow46.prototype.scalarTrunc = CreateWorkflow45(ScalarTruncTask);
9729
+ Workflow48.prototype.scalarTrunc = CreateWorkflow47(ScalarTruncTask);
9141
9730
  // src/task/vector/VectorDistanceTask.ts
9142
- import { CreateWorkflow as CreateWorkflow46, Task as Task45, Workflow as Workflow47 } from "@workglow/task-graph";
9731
+ import { CreateWorkflow as CreateWorkflow48, Task as Task47, Workflow as Workflow49 } from "@workglow/task-graph";
9143
9732
  import {
9144
9733
  TypedArraySchema as TypedArraySchema5
9145
9734
  } from "@workglow/util/schema";
9146
- var inputSchema40 = {
9735
+ var inputSchema41 = {
9147
9736
  type: "object",
9148
9737
  properties: {
9149
9738
  vectors: {
@@ -9172,13 +9761,13 @@ var outputSchema40 = {
9172
9761
  additionalProperties: false
9173
9762
  };
9174
9763
 
9175
- class VectorDistanceTask extends Task45 {
9764
+ class VectorDistanceTask extends Task47 {
9176
9765
  static type = "VectorDistanceTask";
9177
9766
  static category = "Vector";
9178
9767
  static title = "Distance";
9179
9768
  static description = "Returns the Euclidean distance between the first two vectors";
9180
9769
  static inputSchema() {
9181
- return inputSchema40;
9770
+ return inputSchema41;
9182
9771
  }
9183
9772
  static outputSchema() {
9184
9773
  return outputSchema40;
@@ -9199,13 +9788,13 @@ class VectorDistanceTask extends Task45 {
9199
9788
  return { result: Math.sqrt(sumPrecise(diffs)) };
9200
9789
  }
9201
9790
  }
9202
- Workflow47.prototype.vectorDistance = CreateWorkflow46(VectorDistanceTask);
9791
+ Workflow49.prototype.vectorDistance = CreateWorkflow48(VectorDistanceTask);
9203
9792
  // src/task/vector/VectorDotProductTask.ts
9204
- import { CreateWorkflow as CreateWorkflow47, Task as Task46, Workflow as Workflow48 } from "@workglow/task-graph";
9793
+ import { CreateWorkflow as CreateWorkflow49, Task as Task48, Workflow as Workflow50 } from "@workglow/task-graph";
9205
9794
  import {
9206
9795
  TypedArraySchema as TypedArraySchema6
9207
9796
  } from "@workglow/util/schema";
9208
- var inputSchema41 = {
9797
+ var inputSchema42 = {
9209
9798
  type: "object",
9210
9799
  properties: {
9211
9800
  vectors: {
@@ -9234,13 +9823,13 @@ var outputSchema41 = {
9234
9823
  additionalProperties: false
9235
9824
  };
9236
9825
 
9237
- class VectorDotProductTask extends Task46 {
9826
+ class VectorDotProductTask extends Task48 {
9238
9827
  static type = "VectorDotProductTask";
9239
9828
  static category = "Vector";
9240
9829
  static title = "Dot Product";
9241
9830
  static description = "Returns the dot (inner) product of the first two vectors";
9242
9831
  static inputSchema() {
9243
- return inputSchema41;
9832
+ return inputSchema42;
9244
9833
  }
9245
9834
  static outputSchema() {
9246
9835
  return outputSchema41;
@@ -9258,14 +9847,14 @@ class VectorDotProductTask extends Task46 {
9258
9847
  return { result: sumPrecise(products) };
9259
9848
  }
9260
9849
  }
9261
- Workflow48.prototype.vectorDotProduct = CreateWorkflow47(VectorDotProductTask);
9850
+ Workflow50.prototype.vectorDotProduct = CreateWorkflow49(VectorDotProductTask);
9262
9851
  // src/task/vector/VectorNormalizeTask.ts
9263
- import { CreateWorkflow as CreateWorkflow48, Task as Task47, Workflow as Workflow49 } from "@workglow/task-graph";
9852
+ import { CreateWorkflow as CreateWorkflow50, Task as Task49, Workflow as Workflow51 } from "@workglow/task-graph";
9264
9853
  import {
9265
9854
  TypedArraySchema as TypedArraySchema7,
9266
9855
  normalize
9267
9856
  } from "@workglow/util/schema";
9268
- var inputSchema42 = {
9857
+ var inputSchema43 = {
9269
9858
  type: "object",
9270
9859
  properties: {
9271
9860
  vector: TypedArraySchema7({
@@ -9288,13 +9877,13 @@ var outputSchema42 = {
9288
9877
  additionalProperties: false
9289
9878
  };
9290
9879
 
9291
- class VectorNormalizeTask extends Task47 {
9880
+ class VectorNormalizeTask extends Task49 {
9292
9881
  static type = "VectorNormalizeTask";
9293
9882
  static category = "Vector";
9294
9883
  static title = "Normalize";
9295
9884
  static description = "Returns the L2-normalized (unit length) vector";
9296
9885
  static inputSchema() {
9297
- return inputSchema42;
9886
+ return inputSchema43;
9298
9887
  }
9299
9888
  static outputSchema() {
9300
9889
  return outputSchema42;
@@ -9303,14 +9892,14 @@ class VectorNormalizeTask extends Task47 {
9303
9892
  return { result: normalize(input2.vector) };
9304
9893
  }
9305
9894
  }
9306
- Workflow49.prototype.vectorNormalize = CreateWorkflow48(VectorNormalizeTask);
9895
+ Workflow51.prototype.vectorNormalize = CreateWorkflow50(VectorNormalizeTask);
9307
9896
  // src/task/vector/VectorScaleTask.ts
9308
- import { CreateWorkflow as CreateWorkflow49, Task as Task48, Workflow as Workflow50 } from "@workglow/task-graph";
9897
+ import { CreateWorkflow as CreateWorkflow51, Task as Task50, Workflow as Workflow52 } from "@workglow/task-graph";
9309
9898
  import {
9310
9899
  createTypedArrayFrom as createTypedArrayFrom5,
9311
9900
  TypedArraySchema as TypedArraySchema8
9312
9901
  } from "@workglow/util/schema";
9313
- var inputSchema43 = {
9902
+ var inputSchema44 = {
9314
9903
  type: "object",
9315
9904
  properties: {
9316
9905
  vector: TypedArraySchema8({
@@ -9338,13 +9927,13 @@ var outputSchema43 = {
9338
9927
  additionalProperties: false
9339
9928
  };
9340
9929
 
9341
- class VectorScaleTask extends Task48 {
9930
+ class VectorScaleTask extends Task50 {
9342
9931
  static type = "VectorScaleTask";
9343
9932
  static category = "Vector";
9344
9933
  static title = "Scale";
9345
9934
  static description = "Multiplies each element of a vector by a scalar";
9346
9935
  static inputSchema() {
9347
- return inputSchema43;
9936
+ return inputSchema44;
9348
9937
  }
9349
9938
  static outputSchema() {
9350
9939
  return outputSchema43;
@@ -9355,7 +9944,7 @@ class VectorScaleTask extends Task48 {
9355
9944
  return { result: createTypedArrayFrom5([vector], values) };
9356
9945
  }
9357
9946
  }
9358
- Workflow50.prototype.vectorScale = CreateWorkflow49(VectorScaleTask);
9947
+ Workflow52.prototype.vectorScale = CreateWorkflow51(VectorScaleTask);
9359
9948
 
9360
9949
  // src/common.ts
9361
9950
  import { TaskRegistry } from "@workglow/task-graph";
@@ -9364,6 +9953,8 @@ var registerCommonTasks = () => {
9364
9953
  DebugLogTask,
9365
9954
  DelayTask,
9366
9955
  FetchUrlTask,
9956
+ HumanApprovalTask,
9957
+ HumanInputTask,
9367
9958
  InputTask,
9368
9959
  JavaScriptTask,
9369
9960
  JsonTask,
@@ -9416,13 +10007,13 @@ var registerCommonTasks = () => {
9416
10007
  };
9417
10008
  // src/task/FileLoaderTask.ts
9418
10009
  import {
9419
- CreateWorkflow as CreateWorkflow50,
9420
- Task as Task49,
9421
- TaskAbortedError as TaskAbortedError2,
9422
- Workflow as Workflow51
10010
+ CreateWorkflow as CreateWorkflow52,
10011
+ Task as Task51,
10012
+ TaskAbortedError as TaskAbortedError4,
10013
+ Workflow as Workflow53
9423
10014
  } from "@workglow/task-graph";
9424
10015
  import Papa from "papaparse";
9425
- var inputSchema44 = {
10016
+ var inputSchema45 = {
9426
10017
  type: "object",
9427
10018
  properties: {
9428
10019
  url: {
@@ -9493,14 +10084,14 @@ var outputSchema44 = {
9493
10084
  additionalProperties: false
9494
10085
  };
9495
10086
 
9496
- class FileLoaderTask extends Task49 {
10087
+ class FileLoaderTask extends Task51 {
9497
10088
  static type = "FileLoaderTask";
9498
10089
  static category = "Document";
9499
10090
  static title = "File Loader";
9500
10091
  static description = "Load documents from URLs (http://, https://)";
9501
10092
  static cacheable = true;
9502
10093
  static inputSchema() {
9503
- return inputSchema44;
10094
+ return inputSchema45;
9504
10095
  }
9505
10096
  static outputSchema() {
9506
10097
  return outputSchema44;
@@ -9508,30 +10099,28 @@ class FileLoaderTask extends Task49 {
9508
10099
  async execute(input2, context) {
9509
10100
  const { url, format = "auto" } = input2;
9510
10101
  if (context.signal.aborted) {
9511
- throw new TaskAbortedError2("Task aborted");
10102
+ throw new TaskAbortedError4("Task aborted");
9512
10103
  }
9513
10104
  await context.updateProgress(0, "Detecting file format");
9514
10105
  const detectedFormat = this.detectFormat(url, format);
9515
10106
  const responseType = this.detectResponseType(detectedFormat);
9516
10107
  if (context.signal.aborted) {
9517
- throw new TaskAbortedError2("Task aborted");
10108
+ throw new TaskAbortedError4("Task aborted");
9518
10109
  }
9519
10110
  await context.updateProgress(10, `Fetching ${detectedFormat} file from ${url}`);
9520
- const fetchTask = context.own(new FetchUrlTask({
10111
+ const fetchTask = context.own(new FetchUrlTask({ queue: false }));
10112
+ const response = await fetchTask.run({
9521
10113
  url,
9522
10114
  response_type: responseType
9523
- }, {
9524
- queue: false
9525
- }));
9526
- const response = await fetchTask.run();
10115
+ });
9527
10116
  if (context.signal.aborted) {
9528
- throw new TaskAbortedError2("Task aborted");
10117
+ throw new TaskAbortedError4("Task aborted");
9529
10118
  }
9530
10119
  await context.updateProgress(60, "Parsing file content");
9531
10120
  const title = url.split("/").pop() || url;
9532
10121
  const { text, json: json2, csv, image, pdf, frontmatter, size, mimeType } = await this.parseResponse(response, url, detectedFormat);
9533
10122
  if (context.signal.aborted) {
9534
- throw new TaskAbortedError2("Task aborted");
10123
+ throw new TaskAbortedError4("Task aborted");
9535
10124
  }
9536
10125
  await context.updateProgress(100, "File loaded successfully");
9537
10126
  return {
@@ -9855,9 +10444,9 @@ class FileLoaderTask extends Task49 {
9855
10444
  }
9856
10445
  }
9857
10446
  var fileLoader = (input2, config) => {
9858
- return new FileLoaderTask({}, config).run(input2);
10447
+ return new FileLoaderTask(config).run(input2);
9859
10448
  };
9860
- Workflow51.prototype.fileLoader = CreateWorkflow50(FileLoaderTask);
10449
+ Workflow53.prototype.fileLoader = CreateWorkflow52(FileLoaderTask);
9861
10450
  // src/browser.ts
9862
10451
  import { TaskRegistry as TaskRegistry2 } from "@workglow/task-graph";
9863
10452
  registerMcpTaskDeps({
@@ -9877,6 +10466,7 @@ export {
9877
10466
  setGlobalMcpServerRepository,
9878
10467
  searchMcpRegistryPage,
9879
10468
  searchMcpRegistry,
10469
+ resolveHumanConnector,
9880
10470
  resolveAuthSecrets,
9881
10471
  registerMcpTaskDeps,
9882
10472
  registerMcpServer,
@@ -9954,6 +10544,7 @@ export {
9954
10544
  McpResourceReadTask,
9955
10545
  McpPromptGetTask,
9956
10546
  McpListTask,
10547
+ McpElicitationConnector,
9957
10548
  MCP_TASK_DEPS,
9958
10549
  MCP_SERVER_REPOSITORY,
9959
10550
  MCP_SERVERS,
@@ -9963,6 +10554,9 @@ export {
9963
10554
  JavaScriptTask,
9964
10555
  InputTask,
9965
10556
  InMemoryMcpServerRepository,
10557
+ HumanInputTask,
10558
+ HumanApprovalTask,
10559
+ HUMAN_CONNECTOR,
9966
10560
  FileLoaderTask,
9967
10561
  FetchUrlTask,
9968
10562
  FetchUrlJob,
@@ -9973,4 +10567,4 @@ export {
9973
10567
  ArrayTask
9974
10568
  };
9975
10569
 
9976
- //# debugId=E17C1A9477BD8FDD64756E2164756E21
10570
+ //# debugId=BE3950255C768C0964756E2164756E21