@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/bun.js CHANGED
@@ -593,7 +593,11 @@ class ArrayTask extends GraphAsTask {
593
593
  const combinations = this.generateCombinations(inputObject, inputIds);
594
594
  const tasks = combinations.map((combination) => {
595
595
  const { id, title, ...rest } = this.config;
596
- const task = new this.constructor({ ...this.defaults, ...this.runInputData, ...combination }, { ...rest, id: `${id}_${uuid4()}` }, this.runConfig);
596
+ const task = new this.constructor({
597
+ ...rest,
598
+ id: `${id}_${uuid4()}`,
599
+ defaults: { ...this.defaults, ...this.runInputData, ...combination }
600
+ }, this.runConfig);
597
601
  return task;
598
602
  });
599
603
  this.subGraph.addTasks(tasks);
@@ -723,7 +727,7 @@ class DebugLogTask extends Task10 {
723
727
  }
724
728
  }
725
729
  var debugLog = (input, config = {}) => {
726
- const task = new DebugLogTask({}, config);
730
+ const task = new DebugLogTask(config);
727
731
  return task.run(input);
728
732
  };
729
733
  Workflow11.prototype.debugLog = CreateWorkflow10(DebugLogTask);
@@ -795,7 +799,7 @@ class DelayTask extends Task11 {
795
799
  }
796
800
  }
797
801
  var delay = (input, config = { delay: 1 }) => {
798
- const task = new DelayTask({}, config);
802
+ const task = new DelayTask(config);
799
803
  return task.run(input);
800
804
  };
801
805
  Workflow12.prototype.delay = CreateWorkflow11(DelayTask);
@@ -808,6 +812,7 @@ import {
808
812
  } from "@workglow/job-queue";
809
813
  import {
810
814
  CreateWorkflow as CreateWorkflow12,
815
+ Entitlements,
811
816
  getJobQueueFactory,
812
817
  getTaskQueueRegistry,
813
818
  JobTaskFailedError,
@@ -1070,6 +1075,18 @@ class FetchUrlTask extends Task12 {
1070
1075
  static title = "Fetch";
1071
1076
  static description = "Fetches data from a URL with progress tracking and automatic retry handling";
1072
1077
  static hasDynamicSchemas = true;
1078
+ static entitlements() {
1079
+ return {
1080
+ entitlements: [
1081
+ { id: Entitlements.NETWORK_HTTP, reason: "Fetches data from URLs via HTTP/HTTPS" },
1082
+ {
1083
+ id: Entitlements.CREDENTIAL,
1084
+ reason: "May use Bearer token authentication",
1085
+ optional: true
1086
+ }
1087
+ ]
1088
+ };
1089
+ }
1073
1090
  static configSchema() {
1074
1091
  return fetchUrlTaskConfigSchema;
1075
1092
  }
@@ -1142,7 +1159,7 @@ class FetchUrlTask extends Task12 {
1142
1159
  }
1143
1160
  const registeredQueue = await this.resolveOrCreateQueue(queueName);
1144
1161
  if (executeContext.signal.aborted) {
1145
- throw executeContext.signal.reason ?? new DOMException("The operation was aborted", "AbortError");
1162
+ throw executeContext.signal.reason ?? new AbortSignalJobError("The operation was aborted");
1146
1163
  }
1147
1164
  const handle = await registeredQueue.client.submit(jobInput, {
1148
1165
  jobRunId: this.runConfig.runnerId,
@@ -1159,7 +1176,7 @@ class FetchUrlTask extends Task12 {
1159
1176
  });
1160
1177
  try {
1161
1178
  if (executeContext.signal.aborted) {
1162
- throw executeContext.signal.reason ?? new DOMException("The operation was aborted", "AbortError");
1179
+ throw executeContext.signal.reason ?? new AbortSignalJobError("The operation was aborted");
1163
1180
  }
1164
1181
  const output = await handle.waitFor();
1165
1182
  return output;
@@ -1237,18 +1254,455 @@ class FetchUrlTask extends Task12 {
1237
1254
  }
1238
1255
  }
1239
1256
  var fetchUrl = async (input, config = {}) => {
1240
- const result = await new FetchUrlTask({}, config).run(input);
1257
+ const result = await new FetchUrlTask(config).run(input);
1241
1258
  return result;
1242
1259
  };
1243
1260
  Workflow13.prototype.fetch = CreateWorkflow12(FetchUrlTask);
1244
- // src/task/InputTask.ts
1261
+ // src/task/HumanApprovalTask.ts
1262
+ import {
1263
+ CreateWorkflow as CreateWorkflow14,
1264
+ Task as Task14,
1265
+ TaskAbortedError as TaskAbortedError3,
1266
+ TaskConfigSchema as TaskConfigSchema5,
1267
+ Workflow as Workflow15
1268
+ } from "@workglow/task-graph";
1269
+ import { uuid4 as uuid43 } from "@workglow/util";
1270
+
1271
+ // src/task/HumanInputTask.ts
1245
1272
  import {
1246
1273
  CreateWorkflow as CreateWorkflow13,
1247
1274
  Task as Task13,
1275
+ TaskAbortedError as TaskAbortedError2,
1276
+ TaskConfigSchema as TaskConfigSchema4,
1277
+ TaskConfigurationError as TaskConfigurationError2,
1248
1278
  Workflow as Workflow14
1249
1279
  } from "@workglow/task-graph";
1280
+ import { createServiceToken, uuid4 as uuid42 } from "@workglow/util";
1281
+ var HUMAN_CONNECTOR = createServiceToken("HUMAN_CONNECTOR");
1282
+ var humanInputTaskConfigSchema = {
1283
+ type: "object",
1284
+ properties: {
1285
+ ...TaskConfigSchema4["properties"],
1286
+ targetHumanId: {
1287
+ type: "string",
1288
+ title: "Target Human",
1289
+ description: "Identifier of the human to ask (e.g. 'default', 'admin', 'user:alice')",
1290
+ default: "default"
1291
+ },
1292
+ kind: {
1293
+ type: "string",
1294
+ title: "Kind",
1295
+ description: "Interaction kind: notify (one-way), display (show content), elicit (request input)",
1296
+ enum: ["notify", "display", "elicit"],
1297
+ default: "elicit"
1298
+ },
1299
+ contentSchema: {
1300
+ type: "object",
1301
+ properties: {},
1302
+ additionalProperties: true,
1303
+ title: "Content Schema",
1304
+ description: "JSON schema describing the content/form to present",
1305
+ "x-ui-hidden": true
1306
+ },
1307
+ message: {
1308
+ type: "string",
1309
+ title: "Message",
1310
+ description: "Explanatory message shown to the human",
1311
+ "x-ui-editor": "textarea"
1312
+ },
1313
+ mode: {
1314
+ type: "string",
1315
+ title: "Mode",
1316
+ description: "Interaction mode",
1317
+ enum: ["single", "multi-turn"],
1318
+ default: "single"
1319
+ },
1320
+ metadata: {
1321
+ type: "object",
1322
+ additionalProperties: true,
1323
+ "x-ui-hidden": true
1324
+ }
1325
+ },
1326
+ additionalProperties: false
1327
+ };
1328
+ var defaultInputSchema = {
1329
+ type: "object",
1330
+ properties: {
1331
+ prompt: {
1332
+ type: "string",
1333
+ title: "Prompt",
1334
+ description: "Dynamic prompt text merged into the request message"
1335
+ },
1336
+ contentData: {
1337
+ type: "object",
1338
+ additionalProperties: true,
1339
+ title: "Content Data",
1340
+ description: "Data to display (for notify/display kinds)",
1341
+ "x-ui-hidden": true
1342
+ },
1343
+ context: {
1344
+ type: "object",
1345
+ additionalProperties: true,
1346
+ title: "Context",
1347
+ description: "Dynamic context data merged into the request metadata",
1348
+ "x-ui-hidden": true
1349
+ }
1350
+ },
1351
+ additionalProperties: false
1352
+ };
1353
+ var defaultOutputSchema = {
1354
+ type: "object",
1355
+ properties: {
1356
+ action: {
1357
+ type: "string",
1358
+ title: "Action",
1359
+ description: "The human's action: accept, decline, or cancel",
1360
+ enum: ["accept", "decline", "cancel"]
1361
+ }
1362
+ },
1363
+ additionalProperties: true
1364
+ };
1365
+
1366
+ class HumanInputTask extends Task13 {
1367
+ static type = "HumanInputTask";
1368
+ static category = "Flow Control";
1369
+ static title = "Human Input";
1370
+ static description = "Sends an interaction (notification, display, or input request) to a human";
1371
+ static cacheable = false;
1372
+ static hasDynamicSchemas = true;
1373
+ static configSchema() {
1374
+ return humanInputTaskConfigSchema;
1375
+ }
1376
+ static inputSchema() {
1377
+ return defaultInputSchema;
1378
+ }
1379
+ static outputSchema() {
1380
+ return defaultOutputSchema;
1381
+ }
1382
+ outputSchema() {
1383
+ if (this.config?.contentSchema && (this.config.kind ?? "elicit") === "elicit") {
1384
+ const configSchema = this.config.contentSchema;
1385
+ const existingProps = configSchema.properties ?? {};
1386
+ const additionalProperties = configSchema.additionalProperties ?? false;
1387
+ const actionProp = {
1388
+ type: "string",
1389
+ title: "Action",
1390
+ description: "The human's action: accept, decline, or cancel",
1391
+ enum: ["accept", "decline", "cancel"]
1392
+ };
1393
+ const result = {
1394
+ type: "object",
1395
+ properties: { ...existingProps, action: actionProp },
1396
+ required: ["action"],
1397
+ additionalProperties
1398
+ };
1399
+ return result;
1400
+ }
1401
+ return this.constructor.outputSchema();
1402
+ }
1403
+ async execute(input, context) {
1404
+ const connector = resolveHumanConnector(context);
1405
+ const kind = this.config.kind ?? "elicit";
1406
+ const mode = this.config.mode ?? "single";
1407
+ const requestId = uuid42();
1408
+ const message = input.prompt ? this.config.message ? `${this.config.message}
1409
+
1410
+ ${input.prompt}` : input.prompt : this.config.message ?? "";
1411
+ const emptySchema = {
1412
+ type: "object",
1413
+ properties: {},
1414
+ additionalProperties: true
1415
+ };
1416
+ const request = {
1417
+ requestId,
1418
+ targetHumanId: this.config.targetHumanId ?? "default",
1419
+ kind,
1420
+ message,
1421
+ contentSchema: this.config.contentSchema ?? emptySchema,
1422
+ contentData: input.contentData,
1423
+ expectsResponse: kind === "elicit",
1424
+ mode: kind === "elicit" ? mode : "single",
1425
+ metadata: input.context ? { ...this.config.metadata, ...input.context } : this.config.metadata
1426
+ };
1427
+ if (context.signal.aborted) {
1428
+ throw new TaskAbortedError2("Task aborted before sending human interaction");
1429
+ }
1430
+ let response;
1431
+ try {
1432
+ response = await connector.send(request, context.signal);
1433
+ } catch (err) {
1434
+ if (context.signal.aborted) {
1435
+ throw new TaskAbortedError2("Task aborted during human interaction");
1436
+ }
1437
+ throw err;
1438
+ }
1439
+ if (kind === "elicit" && mode === "multi-turn" && !response.done) {
1440
+ if (typeof connector.followUp !== "function") {
1441
+ throw new TaskConfigurationError2('HumanInputTask is configured for "multi-turn" mode but the registered ' + "IHumanConnector does not implement followUp()");
1442
+ }
1443
+ while (!response.done) {
1444
+ if (context.signal.aborted) {
1445
+ throw new TaskAbortedError2("Task aborted during multi-turn conversation");
1446
+ }
1447
+ try {
1448
+ response = await connector.followUp(request, response, context.signal);
1449
+ } catch (err) {
1450
+ if (context.signal.aborted) {
1451
+ throw new TaskAbortedError2("Task aborted during multi-turn conversation");
1452
+ }
1453
+ throw err;
1454
+ }
1455
+ }
1456
+ }
1457
+ return { ...response.content, action: response.action };
1458
+ }
1459
+ }
1460
+ function resolveHumanConnector(context) {
1461
+ if (!context.registry.has(HUMAN_CONNECTOR)) {
1462
+ throw new TaskConfigurationError2("No IHumanConnector registered. Register one via " + "registry.registerInstance(HUMAN_CONNECTOR, connector) before running a human-in-the-loop task.");
1463
+ }
1464
+ return context.registry.get(HUMAN_CONNECTOR);
1465
+ }
1466
+ Workflow14.prototype.humanInput = CreateWorkflow13(HumanInputTask);
1467
+
1468
+ // src/task/HumanApprovalTask.ts
1469
+ var humanApprovalConfigSchema = {
1470
+ type: "object",
1471
+ properties: {
1472
+ ...TaskConfigSchema5["properties"],
1473
+ targetHumanId: {
1474
+ type: "string",
1475
+ title: "Target Human",
1476
+ description: "Identifier of the human to ask for approval",
1477
+ default: "default"
1478
+ },
1479
+ message: {
1480
+ type: "string",
1481
+ title: "Message",
1482
+ description: "Explanatory message shown to the approver",
1483
+ "x-ui-editor": "textarea"
1484
+ },
1485
+ metadata: {
1486
+ type: "object",
1487
+ additionalProperties: true,
1488
+ "x-ui-hidden": true
1489
+ }
1490
+ },
1491
+ additionalProperties: false
1492
+ };
1493
+ var inputSchema13 = {
1494
+ type: "object",
1495
+ properties: {
1496
+ prompt: {
1497
+ type: "string",
1498
+ title: "Prompt",
1499
+ description: "Dynamic prompt text merged into the approval message"
1500
+ },
1501
+ context: {
1502
+ type: "object",
1503
+ additionalProperties: true,
1504
+ title: "Context",
1505
+ description: "Dynamic context data merged into the request metadata",
1506
+ "x-ui-hidden": true
1507
+ }
1508
+ },
1509
+ additionalProperties: false
1510
+ };
1511
+ var approvalRequestedSchema = {
1512
+ type: "object",
1513
+ properties: {
1514
+ approved: {
1515
+ type: "boolean",
1516
+ title: "Approved",
1517
+ description: "Whether the request is approved"
1518
+ },
1519
+ reason: {
1520
+ type: "string",
1521
+ title: "Reason",
1522
+ description: "Optional explanation for the decision"
1523
+ }
1524
+ },
1525
+ required: ["approved"]
1526
+ };
1527
+ var approvalOutputSchema = {
1528
+ type: "object",
1529
+ properties: {
1530
+ action: {
1531
+ type: "string",
1532
+ title: "Action",
1533
+ description: "The human's action: accept, decline, or cancel",
1534
+ enum: ["accept", "decline", "cancel"]
1535
+ },
1536
+ approved: {
1537
+ type: "boolean",
1538
+ title: "Approved",
1539
+ description: "Whether the human approved the request"
1540
+ },
1541
+ reason: {
1542
+ type: "string",
1543
+ title: "Reason",
1544
+ description: "Optional explanation for the decision"
1545
+ }
1546
+ },
1547
+ required: ["action", "approved"],
1548
+ additionalProperties: false
1549
+ };
1550
+
1551
+ class HumanApprovalTask extends Task14 {
1552
+ static type = "HumanApprovalTask";
1553
+ static category = "Flow Control";
1554
+ static title = "Human Approval";
1555
+ static description = "Pauses execution to request approval from a human (approve/deny) via MCP elicitation";
1556
+ static cacheable = false;
1557
+ static configSchema() {
1558
+ return humanApprovalConfigSchema;
1559
+ }
1560
+ static inputSchema() {
1561
+ return inputSchema13;
1562
+ }
1563
+ static outputSchema() {
1564
+ return approvalOutputSchema;
1565
+ }
1566
+ async execute(input, context) {
1567
+ const connector = resolveHumanConnector(context);
1568
+ const requestId = uuid43();
1569
+ const message = input.prompt ? this.config.message ? `${this.config.message}
1570
+
1571
+ ${input.prompt}` : input.prompt : this.config.message ?? "";
1572
+ const request = {
1573
+ requestId,
1574
+ targetHumanId: this.config.targetHumanId ?? "default",
1575
+ kind: "elicit",
1576
+ message,
1577
+ contentSchema: approvalRequestedSchema,
1578
+ contentData: undefined,
1579
+ expectsResponse: true,
1580
+ mode: "single",
1581
+ metadata: input.context ? { ...this.config.metadata, ...input.context } : this.config.metadata
1582
+ };
1583
+ if (context.signal.aborted) {
1584
+ throw new TaskAbortedError3("Task aborted before requesting human approval");
1585
+ }
1586
+ let response;
1587
+ try {
1588
+ response = await connector.send(request, context.signal);
1589
+ } catch (err) {
1590
+ if (context.signal.aborted) {
1591
+ throw new TaskAbortedError3("Task aborted during human approval");
1592
+ }
1593
+ throw err;
1594
+ }
1595
+ if (response.action === "accept" && response.content) {
1596
+ return {
1597
+ action: response.action,
1598
+ approved: response.content.approved === true,
1599
+ reason: response.content.reason
1600
+ };
1601
+ }
1602
+ return {
1603
+ action: response.action,
1604
+ approved: false,
1605
+ ...response.content?.reason !== undefined ? { reason: response.content.reason } : {}
1606
+ };
1607
+ }
1608
+ }
1609
+ Workflow15.prototype.humanApproval = CreateWorkflow14(HumanApprovalTask);
1610
+ // src/task/McpElicitationConnector.ts
1611
+ function defaultAbortError() {
1612
+ const err = new Error("The operation was aborted");
1613
+ err.name = "AbortError";
1614
+ return err;
1615
+ }
1616
+ function toMcpRequestedSchema(schema) {
1617
+ const props = schema.properties ?? {};
1618
+ const required = schema.required;
1619
+ return {
1620
+ type: "object",
1621
+ properties: props,
1622
+ ...required ? { required } : {}
1623
+ };
1624
+ }
1625
+
1626
+ class McpElicitationConnector {
1627
+ server;
1628
+ constructor(server) {
1629
+ this.server = server;
1630
+ }
1631
+ async send(request, signal) {
1632
+ switch (request.kind) {
1633
+ case "notify":
1634
+ return this.handleNotify(request, signal);
1635
+ case "display":
1636
+ return this.handleDisplay(request, signal);
1637
+ case "elicit":
1638
+ return this.handleElicit(request, signal);
1639
+ default:
1640
+ return this.handleElicit(request, signal);
1641
+ }
1642
+ }
1643
+ async followUp(request, _previousResponse, signal) {
1644
+ return this.send(request, signal);
1645
+ }
1646
+ async handleNotify(request, signal) {
1647
+ if (signal.aborted) {
1648
+ throw signal.reason ?? defaultAbortError();
1649
+ }
1650
+ await this.server.sendLoggingMessage({
1651
+ level: "info",
1652
+ data: request.contentData ?? request.message,
1653
+ logger: request.targetHumanId
1654
+ });
1655
+ if (signal.aborted) {
1656
+ throw signal.reason ?? defaultAbortError();
1657
+ }
1658
+ return {
1659
+ requestId: request.requestId,
1660
+ action: "accept",
1661
+ content: undefined,
1662
+ done: true
1663
+ };
1664
+ }
1665
+ async handleDisplay(request, signal) {
1666
+ if (signal.aborted) {
1667
+ throw signal.reason ?? defaultAbortError();
1668
+ }
1669
+ await this.server.sendLoggingMessage({
1670
+ level: "info",
1671
+ data: {
1672
+ message: request.message,
1673
+ content: request.contentData,
1674
+ schema: request.contentSchema
1675
+ },
1676
+ logger: request.targetHumanId
1677
+ });
1678
+ if (signal.aborted) {
1679
+ throw signal.reason ?? defaultAbortError();
1680
+ }
1681
+ return {
1682
+ requestId: request.requestId,
1683
+ action: "accept",
1684
+ content: undefined,
1685
+ done: true
1686
+ };
1687
+ }
1688
+ async handleElicit(request, signal) {
1689
+ const mcpResult = await this.server.elicitInput({
1690
+ mode: "form",
1691
+ message: request.message,
1692
+ requestedSchema: toMcpRequestedSchema(request.contentSchema)
1693
+ }, { signal });
1694
+ return {
1695
+ requestId: request.requestId,
1696
+ action: mcpResult.action,
1697
+ content: mcpResult.action === "accept" ? mcpResult.content : undefined,
1698
+ done: true
1699
+ };
1700
+ }
1701
+ }
1702
+ // src/task/InputTask.ts
1703
+ import { CreateWorkflow as CreateWorkflow15, Task as Task15, Workflow as Workflow16 } from "@workglow/task-graph";
1250
1704
 
1251
- class InputTask extends Task13 {
1705
+ class InputTask extends Task15 {
1252
1706
  static type = "InputTask";
1253
1707
  static category = "Flow Control";
1254
1708
  static title = "Input";
@@ -1299,14 +1753,15 @@ class InputTask extends Task13 {
1299
1753
  yield { type: "finish", data: input };
1300
1754
  }
1301
1755
  }
1302
- Workflow14.prototype.input = CreateWorkflow13(InputTask);
1756
+ Workflow16.prototype.input = CreateWorkflow15(InputTask);
1303
1757
  // src/task/JavaScriptTask.ts
1304
1758
  import {
1305
- CreateWorkflow as CreateWorkflow14,
1306
- Task as Task14,
1307
- TaskConfigSchema as TaskConfigSchema4,
1759
+ CreateWorkflow as CreateWorkflow16,
1760
+ Entitlements as Entitlements2,
1761
+ Task as Task16,
1762
+ TaskConfigSchema as TaskConfigSchema6,
1308
1763
  TaskInvalidInputError as TaskInvalidInputError3,
1309
- Workflow as Workflow15
1764
+ Workflow as Workflow17
1310
1765
  } from "@workglow/task-graph";
1311
1766
 
1312
1767
  // src/util/acorn.js
@@ -5774,7 +6229,7 @@ var isValidIdentifier = (key) => /^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(key);
5774
6229
  var configSchema = {
5775
6230
  type: "object",
5776
6231
  properties: {
5777
- ...TaskConfigSchema4["properties"],
6232
+ ...TaskConfigSchema6["properties"],
5778
6233
  javascript_code: {
5779
6234
  type: "string",
5780
6235
  title: "Code",
@@ -5785,7 +6240,7 @@ var configSchema = {
5785
6240
  },
5786
6241
  additionalProperties: false
5787
6242
  };
5788
- var inputSchema13 = {
6243
+ var inputSchema14 = {
5789
6244
  type: "object",
5790
6245
  properties: {
5791
6246
  javascript_code: {
@@ -5811,24 +6266,32 @@ var outputSchema13 = {
5811
6266
  additionalProperties: false
5812
6267
  };
5813
6268
 
5814
- class JavaScriptTask extends Task14 {
6269
+ class JavaScriptTask extends Task16 {
5815
6270
  static type = "JavaScriptTask";
5816
6271
  static category = "Utility";
5817
6272
  static title = "JavaScript Interpreter";
5818
6273
  static description = "Executes JavaScript code in a sandboxed interpreter environment";
5819
6274
  static customizable = true;
6275
+ static hasDynamicSchemas = true;
6276
+ static entitlements() {
6277
+ return {
6278
+ entitlements: [
6279
+ {
6280
+ id: Entitlements2.CODE_EXECUTION_JS,
6281
+ reason: "Executes user-provided JavaScript code in a sandboxed interpreter"
6282
+ }
6283
+ ]
6284
+ };
6285
+ }
5820
6286
  static configSchema() {
5821
6287
  return configSchema;
5822
6288
  }
5823
6289
  static inputSchema() {
5824
- return inputSchema13;
6290
+ return inputSchema14;
5825
6291
  }
5826
6292
  static outputSchema() {
5827
6293
  return outputSchema13;
5828
6294
  }
5829
- constructor(input2 = {}, config = {}) {
5830
- super(input2, config);
5831
- }
5832
6295
  inputSchema() {
5833
6296
  if (this.config?.javascript_code) {
5834
6297
  if (this.config.inputSchema) {
@@ -5840,7 +6303,7 @@ class JavaScriptTask extends Task14 {
5840
6303
  additionalProperties: true
5841
6304
  };
5842
6305
  }
5843
- return inputSchema13;
6306
+ return inputSchema14;
5844
6307
  }
5845
6308
  async executeReactive(input2, output) {
5846
6309
  const code = input2.javascript_code || this.config.javascript_code;
@@ -5860,20 +6323,20 @@ class JavaScriptTask extends Task14 {
5860
6323
  }
5861
6324
  }
5862
6325
  var javaScript = (input2, config = {}) => {
5863
- return new JavaScriptTask({}, config).run(input2);
6326
+ return new JavaScriptTask(config).run(input2);
5864
6327
  };
5865
- Workflow15.prototype.javaScript = CreateWorkflow14(JavaScriptTask);
6328
+ Workflow17.prototype.javaScript = CreateWorkflow16(JavaScriptTask);
5866
6329
  // src/task/JsonTask.ts
5867
6330
  import {
5868
6331
  createGraphFromDependencyJSON,
5869
6332
  createGraphFromGraphJSON,
5870
- CreateWorkflow as CreateWorkflow15,
6333
+ CreateWorkflow as CreateWorkflow17,
5871
6334
  Dataflow,
5872
6335
  GraphAsTask as GraphAsTask2,
5873
- TaskConfigurationError as TaskConfigurationError2,
5874
- Workflow as Workflow16
6336
+ TaskConfigurationError as TaskConfigurationError3,
6337
+ Workflow as Workflow18
5875
6338
  } from "@workglow/task-graph";
5876
- var inputSchema14 = {
6339
+ var inputSchema15 = {
5877
6340
  type: "object",
5878
6341
  properties: {
5879
6342
  json: {
@@ -5901,7 +6364,7 @@ class JsonTask extends GraphAsTask2 {
5901
6364
  static title = "JSON Task";
5902
6365
  static description = "A task that creates and manages task graphs from JSON configurations";
5903
6366
  static inputSchema() {
5904
- return inputSchema14;
6367
+ return inputSchema15;
5905
6368
  }
5906
6369
  static outputSchema() {
5907
6370
  return outputSchema14;
@@ -5925,7 +6388,7 @@ class JsonTask extends GraphAsTask2 {
5925
6388
  for (const dep of dependencies) {
5926
6389
  const sourceTask = this.subGraph.getTask(dep.id);
5927
6390
  if (!sourceTask) {
5928
- throw new TaskConfigurationError2(`Dependency id ${dep.id} not found`);
6391
+ throw new TaskConfigurationError3(`Dependency id ${dep.id} not found`);
5929
6392
  }
5930
6393
  const df = new Dataflow(sourceTask.id, dep.output, item.id, input2);
5931
6394
  this.subGraph.addDataflow(df);
@@ -5936,28 +6399,28 @@ class JsonTask extends GraphAsTask2 {
5936
6399
  }
5937
6400
  }
5938
6401
  var json = (input2, config = {}) => {
5939
- return new JsonTask({}, config).run(input2);
6402
+ return new JsonTask(config).run(input2);
5940
6403
  };
5941
- Workflow16.prototype.json = CreateWorkflow15(JsonTask);
6404
+ Workflow18.prototype.json = CreateWorkflow17(JsonTask);
5942
6405
  // src/task/LambdaTask.ts
5943
6406
  import {
5944
- CreateWorkflow as CreateWorkflow16,
6407
+ CreateWorkflow as CreateWorkflow18,
5945
6408
  DATAFLOW_ALL_PORTS,
5946
- Task as Task15,
5947
- TaskConfigSchema as TaskConfigSchema5,
5948
- TaskConfigurationError as TaskConfigurationError3,
5949
- Workflow as Workflow17
6409
+ Task as Task17,
6410
+ TaskConfigSchema as TaskConfigSchema7,
6411
+ TaskConfigurationError as TaskConfigurationError4,
6412
+ Workflow as Workflow19
5950
6413
  } from "@workglow/task-graph";
5951
6414
  var lambdaTaskConfigSchema = {
5952
6415
  type: "object",
5953
6416
  properties: {
5954
- ...TaskConfigSchema5["properties"],
6417
+ ...TaskConfigSchema7["properties"],
5955
6418
  execute: {},
5956
6419
  executeReactive: {}
5957
6420
  },
5958
6421
  additionalProperties: false
5959
6422
  };
5960
- var inputSchema15 = {
6423
+ var inputSchema16 = {
5961
6424
  type: "object",
5962
6425
  properties: {
5963
6426
  [DATAFLOW_ALL_PORTS]: {
@@ -5978,7 +6441,7 @@ var outputSchema15 = {
5978
6441
  additionalProperties: true
5979
6442
  };
5980
6443
 
5981
- class LambdaTask extends Task15 {
6444
+ class LambdaTask extends Task17 {
5982
6445
  static type = "LambdaTask";
5983
6446
  static title = "Lambda Task";
5984
6447
  static description = "A task that wraps a provided function and its input";
@@ -5988,7 +6451,7 @@ class LambdaTask extends Task15 {
5988
6451
  return lambdaTaskConfigSchema;
5989
6452
  }
5990
6453
  static inputSchema() {
5991
- return inputSchema15;
6454
+ return inputSchema16;
5992
6455
  }
5993
6456
  static outputSchema() {
5994
6457
  return outputSchema15;
@@ -5996,11 +6459,11 @@ class LambdaTask extends Task15 {
5996
6459
  canSerializeConfig() {
5997
6460
  return false;
5998
6461
  }
5999
- constructor(input2 = {}, config = {}) {
6462
+ constructor(config = {}) {
6000
6463
  if (!config.execute && !config.executeReactive) {
6001
- throw new TaskConfigurationError3("LambdaTask must have either execute or executeReactive function in config");
6464
+ throw new TaskConfigurationError4("LambdaTask must have either execute or executeReactive function in config");
6002
6465
  }
6003
- super(input2, config);
6466
+ super(config);
6004
6467
  }
6005
6468
  async execute(input2, context) {
6006
6469
  if (typeof this.config.execute === "function") {
@@ -6017,18 +6480,18 @@ class LambdaTask extends Task15 {
6017
6480
  }
6018
6481
  function lambda(input2, config) {
6019
6482
  if (typeof input2 === "function") {
6020
- const task2 = new LambdaTask({}, {
6483
+ const task2 = new LambdaTask({
6021
6484
  execute: input2
6022
6485
  });
6023
6486
  return task2.run();
6024
6487
  }
6025
- const task = new LambdaTask(input2, config);
6488
+ const task = new LambdaTask({ ...config, defaults: input2 });
6026
6489
  return task.run();
6027
6490
  }
6028
- Workflow17.prototype.lambda = CreateWorkflow16(LambdaTask);
6491
+ Workflow19.prototype.lambda = CreateWorkflow18(LambdaTask);
6029
6492
  // src/task/MergeTask.ts
6030
- import { CreateWorkflow as CreateWorkflow17, Task as Task16, Workflow as Workflow18 } from "@workglow/task-graph";
6031
- var inputSchema16 = {
6493
+ import { CreateWorkflow as CreateWorkflow19, Task as Task18, Workflow as Workflow20 } from "@workglow/task-graph";
6494
+ var inputSchema17 = {
6032
6495
  type: "object",
6033
6496
  properties: {},
6034
6497
  additionalProperties: true
@@ -6045,14 +6508,14 @@ var outputSchema16 = {
6045
6508
  additionalProperties: false
6046
6509
  };
6047
6510
 
6048
- class MergeTask extends Task16 {
6511
+ class MergeTask extends Task18 {
6049
6512
  static type = "MergeTask";
6050
6513
  static category = "Utility";
6051
6514
  static title = "Merge";
6052
6515
  static description = "Merges multiple inputs into a single array output";
6053
6516
  static cacheable = true;
6054
6517
  static inputSchema() {
6055
- return inputSchema16;
6518
+ return inputSchema17;
6056
6519
  }
6057
6520
  static outputSchema() {
6058
6521
  return outputSchema16;
@@ -6066,24 +6529,21 @@ class MergeTask extends Task16 {
6066
6529
  }
6067
6530
  }
6068
6531
  var merge = (input2, config = {}) => {
6069
- const task = new MergeTask({}, config);
6532
+ const task = new MergeTask(config);
6070
6533
  return task.run(input2);
6071
6534
  };
6072
- Workflow18.prototype.merge = CreateWorkflow17(MergeTask);
6535
+ Workflow20.prototype.merge = CreateWorkflow19(MergeTask);
6073
6536
  // src/task/OutputTask.ts
6074
- import {
6075
- CreateWorkflow as CreateWorkflow18,
6076
- Task as Task17,
6077
- Workflow as Workflow19
6078
- } from "@workglow/task-graph";
6537
+ import { CreateWorkflow as CreateWorkflow20, Task as Task19, Workflow as Workflow21 } from "@workglow/task-graph";
6079
6538
 
6080
- class OutputTask extends Task17 {
6539
+ class OutputTask extends Task19 {
6081
6540
  static type = "OutputTask";
6082
6541
  static category = "Flow Control";
6083
6542
  static title = "Output";
6084
6543
  static description = "Ends the workflow";
6085
6544
  static hasDynamicSchemas = true;
6086
6545
  static cacheable = false;
6546
+ static isGraphOutput = true;
6087
6547
  static inputSchema() {
6088
6548
  return {
6089
6549
  type: "object",
@@ -6128,10 +6588,10 @@ class OutputTask extends Task17 {
6128
6588
  yield { type: "finish", data: input2 };
6129
6589
  }
6130
6590
  }
6131
- Workflow19.prototype.output = CreateWorkflow18(OutputTask);
6591
+ Workflow21.prototype.output = CreateWorkflow20(OutputTask);
6132
6592
  // src/task/SplitTask.ts
6133
- import { CreateWorkflow as CreateWorkflow19, Task as Task18, Workflow as Workflow20 } from "@workglow/task-graph";
6134
- var inputSchema17 = {
6593
+ import { CreateWorkflow as CreateWorkflow21, Task as Task20, Workflow as Workflow22 } from "@workglow/task-graph";
6594
+ var inputSchema18 = {
6135
6595
  type: "object",
6136
6596
  properties: {
6137
6597
  input: {
@@ -6147,22 +6607,18 @@ var outputSchema17 = {
6147
6607
  additionalProperties: true
6148
6608
  };
6149
6609
 
6150
- class SplitTask extends Task18 {
6610
+ class SplitTask extends Task20 {
6151
6611
  static type = "SplitTask";
6152
6612
  static category = "Utility";
6153
6613
  static title = "Split";
6154
6614
  static description = "Splits an array into individual outputs, creating one output per element";
6155
- static hasDynamicSchemas = true;
6156
6615
  static cacheable = false;
6157
6616
  static inputSchema() {
6158
- return inputSchema17;
6617
+ return inputSchema18;
6159
6618
  }
6160
6619
  static outputSchema() {
6161
6620
  return outputSchema17;
6162
6621
  }
6163
- outputSchema() {
6164
- return outputSchema17;
6165
- }
6166
6622
  async executeReactive(input2) {
6167
6623
  const inputValue = input2.input;
6168
6624
  const output = {};
@@ -6177,17 +6633,17 @@ class SplitTask extends Task18 {
6177
6633
  }
6178
6634
  }
6179
6635
  var split = (input2, config = {}) => {
6180
- const task = new SplitTask({}, config);
6636
+ const task = new SplitTask(config);
6181
6637
  return task.run(input2);
6182
6638
  };
6183
- Workflow20.prototype.split = CreateWorkflow19(SplitTask);
6639
+ Workflow22.prototype.split = CreateWorkflow21(SplitTask);
6184
6640
  // src/task/DateFormatTask.ts
6185
6641
  import {
6186
- CreateWorkflow as CreateWorkflow20,
6187
- Task as Task19,
6188
- Workflow as Workflow21
6642
+ CreateWorkflow as CreateWorkflow22,
6643
+ Task as Task21,
6644
+ Workflow as Workflow23
6189
6645
  } from "@workglow/task-graph";
6190
- var inputSchema18 = {
6646
+ var inputSchema19 = {
6191
6647
  type: "object",
6192
6648
  properties: {
6193
6649
  value: {
@@ -6230,13 +6686,13 @@ var outputSchema18 = {
6230
6686
  additionalProperties: false
6231
6687
  };
6232
6688
 
6233
- class DateFormatTask extends Task19 {
6689
+ class DateFormatTask extends Task21 {
6234
6690
  static type = "DateFormatTask";
6235
6691
  static category = "Utility";
6236
6692
  static title = "Date Format";
6237
6693
  static description = "Parses and formats a date string";
6238
6694
  static inputSchema() {
6239
- return inputSchema18;
6695
+ return inputSchema19;
6240
6696
  }
6241
6697
  static outputSchema() {
6242
6698
  return outputSchema18;
@@ -6272,14 +6728,14 @@ class DateFormatTask extends Task19 {
6272
6728
  return { result };
6273
6729
  }
6274
6730
  }
6275
- Workflow21.prototype.dateFormat = CreateWorkflow20(DateFormatTask);
6731
+ Workflow23.prototype.dateFormat = CreateWorkflow22(DateFormatTask);
6276
6732
  // src/task/JsonPathTask.ts
6277
6733
  import {
6278
- CreateWorkflow as CreateWorkflow21,
6279
- Task as Task20,
6280
- Workflow as Workflow22
6734
+ CreateWorkflow as CreateWorkflow23,
6735
+ Task as Task22,
6736
+ Workflow as Workflow24
6281
6737
  } from "@workglow/task-graph";
6282
- var inputSchema19 = {
6738
+ var inputSchema20 = {
6283
6739
  type: "object",
6284
6740
  properties: {
6285
6741
  value: {
@@ -6328,13 +6784,13 @@ function resolvePath(obj, segments) {
6328
6784
  return resolvePath(next2, tail);
6329
6785
  }
6330
6786
 
6331
- class JsonPathTask extends Task20 {
6787
+ class JsonPathTask extends Task22 {
6332
6788
  static type = "JsonPathTask";
6333
6789
  static category = "Utility";
6334
6790
  static title = "JSON Path";
6335
6791
  static description = "Extracts a value from an object using a dot-notation path";
6336
6792
  static inputSchema() {
6337
- return inputSchema19;
6793
+ return inputSchema20;
6338
6794
  }
6339
6795
  static outputSchema() {
6340
6796
  return outputSchema19;
@@ -6345,20 +6801,20 @@ class JsonPathTask extends Task20 {
6345
6801
  return { result };
6346
6802
  }
6347
6803
  }
6348
- Workflow22.prototype.jsonPath = CreateWorkflow21(JsonPathTask);
6804
+ Workflow24.prototype.jsonPath = CreateWorkflow23(JsonPathTask);
6349
6805
  // src/task/RegexTask.ts
6350
6806
  import {
6351
- CreateWorkflow as CreateWorkflow22,
6352
- Task as Task21,
6807
+ CreateWorkflow as CreateWorkflow24,
6808
+ Task as Task23,
6353
6809
  TaskInvalidInputError as TaskInvalidInputError4,
6354
- Workflow as Workflow23
6810
+ Workflow as Workflow25
6355
6811
  } from "@workglow/task-graph";
6356
6812
  var MAX_BRACKET_COUNT = 100;
6357
6813
  function hasNestedQuantifiers(pattern) {
6358
6814
  const withoutClasses = pattern.replace(/\[(?:[^\]\\]|\\.)*\]/g, "X");
6359
6815
  return /\([^)]*[+*][^)]*\)[+*?]|\([^)]*[+*][^)]*\)\{/.test(withoutClasses);
6360
6816
  }
6361
- var inputSchema20 = {
6817
+ var inputSchema21 = {
6362
6818
  type: "object",
6363
6819
  properties: {
6364
6820
  value: {
@@ -6400,13 +6856,13 @@ var outputSchema20 = {
6400
6856
  additionalProperties: false
6401
6857
  };
6402
6858
 
6403
- class RegexTask extends Task21 {
6859
+ class RegexTask extends Task23 {
6404
6860
  static type = "RegexTask";
6405
6861
  static category = "String";
6406
6862
  static title = "Regex";
6407
6863
  static description = "Matches a string against a regular expression pattern";
6408
6864
  static inputSchema() {
6409
- return inputSchema20;
6865
+ return inputSchema21;
6410
6866
  }
6411
6867
  static outputSchema() {
6412
6868
  return outputSchema20;
@@ -6438,14 +6894,14 @@ class RegexTask extends Task21 {
6438
6894
  };
6439
6895
  }
6440
6896
  }
6441
- Workflow23.prototype.regex = CreateWorkflow22(RegexTask);
6897
+ Workflow25.prototype.regex = CreateWorkflow24(RegexTask);
6442
6898
  // src/task/TemplateTask.ts
6443
6899
  import {
6444
- CreateWorkflow as CreateWorkflow23,
6445
- Task as Task22,
6446
- Workflow as Workflow24
6900
+ CreateWorkflow as CreateWorkflow25,
6901
+ Task as Task24,
6902
+ Workflow as Workflow26
6447
6903
  } from "@workglow/task-graph";
6448
- var inputSchema21 = {
6904
+ var inputSchema22 = {
6449
6905
  type: "object",
6450
6906
  properties: {
6451
6907
  template: {
@@ -6476,13 +6932,13 @@ var outputSchema21 = {
6476
6932
  additionalProperties: false
6477
6933
  };
6478
6934
 
6479
- class TemplateTask extends Task22 {
6935
+ class TemplateTask extends Task24 {
6480
6936
  static type = "TemplateTask";
6481
6937
  static category = "Utility";
6482
6938
  static title = "Template";
6483
6939
  static description = "Renders a template string with {{key}} placeholders and optional defaults";
6484
6940
  static inputSchema() {
6485
- return inputSchema21;
6941
+ return inputSchema22;
6486
6942
  }
6487
6943
  static outputSchema() {
6488
6944
  return outputSchema21;
@@ -6507,7 +6963,7 @@ class TemplateTask extends Task22 {
6507
6963
  return { result };
6508
6964
  }
6509
6965
  }
6510
- Workflow24.prototype.template = CreateWorkflow23(TemplateTask);
6966
+ Workflow26.prototype.template = CreateWorkflow25(TemplateTask);
6511
6967
  // src/util/McpClientUtil.ts
6512
6968
  import { Client } from "@modelcontextprotocol/sdk/client";
6513
6969
  import { SSEClientTransport } from "@modelcontextprotocol/sdk/client/sse.js";
@@ -7029,8 +7485,8 @@ function buildAuthConfig(flat) {
7029
7485
  }
7030
7486
 
7031
7487
  // src/util/McpTaskDeps.ts
7032
- import { createServiceToken, globalServiceRegistry } from "@workglow/util";
7033
- var MCP_TASK_DEPS = createServiceToken("@workglow/tasks/mcp");
7488
+ import { createServiceToken as createServiceToken2, globalServiceRegistry } from "@workglow/util";
7489
+ var MCP_TASK_DEPS = createServiceToken2("@workglow/tasks/mcp");
7034
7490
  function registerMcpTaskDeps(deps) {
7035
7491
  globalServiceRegistry.registerInstance(MCP_TASK_DEPS, deps);
7036
7492
  }
@@ -7257,19 +7713,15 @@ class InMemoryMcpServerRepository extends McpServerRepository {
7257
7713
  }
7258
7714
  // src/mcp-server/McpServerRegistry.ts
7259
7715
  import {
7260
- createServiceToken as createServiceToken2,
7716
+ createServiceToken as createServiceToken3,
7261
7717
  globalServiceRegistry as globalServiceRegistry2,
7262
7718
  registerInputCompactor,
7263
7719
  registerInputResolver
7264
7720
  } from "@workglow/util";
7265
- var MCP_SERVERS = createServiceToken2("mcp-server.registry");
7266
- var MCP_SERVER_REPOSITORY = createServiceToken2("mcp-server.repository");
7267
- if (!globalServiceRegistry2.has(MCP_SERVERS)) {
7268
- globalServiceRegistry2.register(MCP_SERVERS, () => new Map, true);
7269
- }
7270
- if (!globalServiceRegistry2.has(MCP_SERVER_REPOSITORY)) {
7271
- globalServiceRegistry2.register(MCP_SERVER_REPOSITORY, () => new InMemoryMcpServerRepository, true);
7272
- }
7721
+ var MCP_SERVERS = createServiceToken3("mcp-server.registry");
7722
+ var MCP_SERVER_REPOSITORY = createServiceToken3("mcp-server.repository");
7723
+ globalServiceRegistry2.registerIfAbsent(MCP_SERVERS, () => new Map, true);
7724
+ globalServiceRegistry2.registerIfAbsent(MCP_SERVER_REPOSITORY, () => new InMemoryMcpServerRepository, true);
7273
7725
  function getGlobalMcpServers() {
7274
7726
  return globalServiceRegistry2.get(MCP_SERVERS);
7275
7727
  }
@@ -7334,7 +7786,29 @@ function getMcpServerConfig(configOrInput) {
7334
7786
  return base;
7335
7787
  }
7336
7788
  // src/task/mcp/McpListTask.ts
7337
- import { CreateWorkflow as CreateWorkflow24, Task as Task23, Workflow as Workflow25 } from "@workglow/task-graph";
7789
+ import {
7790
+ CreateWorkflow as CreateWorkflow26,
7791
+ Entitlements as Entitlements3,
7792
+ mergeEntitlements,
7793
+ Task as Task25,
7794
+ Workflow as Workflow27
7795
+ } from "@workglow/task-graph";
7796
+
7797
+ // src/util/getMcpServerTransport.ts
7798
+ function getMcpServerTransport(task) {
7799
+ const runInputData = task.runInputData;
7800
+ const inputServer = runInputData?.server;
7801
+ if (typeof inputServer?.transport === "string") {
7802
+ return inputServer.transport;
7803
+ }
7804
+ const configServer = task.config?.server;
7805
+ if (typeof configServer?.transport === "string") {
7806
+ return configServer.transport;
7807
+ }
7808
+ return;
7809
+ }
7810
+
7811
+ // src/task/mcp/McpListTask.ts
7338
7812
  var mcpListTypes = ["tools", "resources", "prompts"];
7339
7813
  var iconSchema = {
7340
7814
  type: "object",
@@ -7491,13 +7965,35 @@ var outputSchemaAll = {
7491
7965
  additionalProperties: false
7492
7966
  };
7493
7967
 
7494
- class McpListTask extends Task23 {
7968
+ class McpListTask extends Task25 {
7495
7969
  static type = "McpListTask";
7496
7970
  static category = "MCP";
7497
7971
  static title = "MCP List";
7498
7972
  static description = "Lists tools, resources, or prompts available on an MCP server";
7499
7973
  static cacheable = false;
7500
7974
  static hasDynamicSchemas = true;
7975
+ static hasDynamicEntitlements = true;
7976
+ static entitlements() {
7977
+ return {
7978
+ entitlements: [
7979
+ { id: Entitlements3.MCP, reason: "Lists tools, resources, or prompts on MCP servers" }
7980
+ ]
7981
+ };
7982
+ }
7983
+ entitlements() {
7984
+ const base = McpListTask.entitlements();
7985
+ const transport = getMcpServerTransport(this);
7986
+ if (transport === "stdio") {
7987
+ return mergeEntitlements(base, {
7988
+ entitlements: [
7989
+ { id: Entitlements3.MCP_STDIO, reason: "Uses stdio transport to spawn local process" }
7990
+ ]
7991
+ });
7992
+ }
7993
+ return mergeEntitlements(base, {
7994
+ entitlements: [{ id: Entitlements3.NETWORK_HTTP, reason: "Connects to MCP server over HTTP" }]
7995
+ });
7996
+ }
7501
7997
  static inputSchema() {
7502
7998
  const { mcpServerConfigSchema: mcpServerConfigSchema2 } = getMcpTaskDeps();
7503
7999
  return {
@@ -7574,15 +8070,17 @@ class McpListTask extends Task23 {
7574
8070
  }
7575
8071
  }
7576
8072
  var mcpList = async (input2, config = {}) => {
7577
- return new McpListTask({}, config).run(input2);
8073
+ return new McpListTask(config).run(input2);
7578
8074
  };
7579
- Workflow25.prototype.mcpList = CreateWorkflow24(McpListTask);
8075
+ Workflow27.prototype.mcpList = CreateWorkflow26(McpListTask);
7580
8076
  // src/task/mcp/McpPromptGetTask.ts
7581
8077
  import {
7582
- CreateWorkflow as CreateWorkflow25,
7583
- Task as Task24,
7584
- TaskConfigSchema as TaskConfigSchema6,
7585
- Workflow as Workflow26
8078
+ CreateWorkflow as CreateWorkflow27,
8079
+ Entitlements as Entitlements4,
8080
+ mergeEntitlements as mergeEntitlements2,
8081
+ Task as Task26,
8082
+ TaskConfigSchema as TaskConfigSchema8,
8083
+ Workflow as Workflow28
7586
8084
  } from "@workglow/task-graph";
7587
8085
  var annotationsSchema = {
7588
8086
  type: "object",
@@ -7717,7 +8215,7 @@ var fallbackInputSchema = {
7717
8215
  additionalProperties: false
7718
8216
  };
7719
8217
 
7720
- class McpPromptGetTask extends Task24 {
8218
+ class McpPromptGetTask extends Task26 {
7721
8219
  static type = "McpPromptGetTask";
7722
8220
  static category = "MCP";
7723
8221
  static title = "MCP Get Prompt";
@@ -7725,6 +8223,29 @@ class McpPromptGetTask extends Task24 {
7725
8223
  static cacheable = false;
7726
8224
  static customizable = true;
7727
8225
  static hasDynamicSchemas = true;
8226
+ static hasDynamicEntitlements = true;
8227
+ static entitlements() {
8228
+ return {
8229
+ entitlements: [{ id: Entitlements4.MCP_PROMPT_GET, reason: "Gets prompts from MCP servers" }]
8230
+ };
8231
+ }
8232
+ entitlements() {
8233
+ const base = McpPromptGetTask.entitlements();
8234
+ const transport = getMcpServerTransport(this);
8235
+ if (transport === "stdio") {
8236
+ return mergeEntitlements2(base, {
8237
+ entitlements: [
8238
+ { id: Entitlements4.MCP_STDIO, reason: "Uses stdio transport to spawn local process" }
8239
+ ]
8240
+ });
8241
+ }
8242
+ return mergeEntitlements2(base, {
8243
+ entitlements: [
8244
+ { id: Entitlements4.NETWORK_HTTP, reason: "Connects to MCP server over HTTP" },
8245
+ { id: Entitlements4.CREDENTIAL, reason: "May require authentication", optional: true }
8246
+ ]
8247
+ });
8248
+ }
7728
8249
  static inputSchema() {
7729
8250
  return fallbackInputSchema;
7730
8251
  }
@@ -7736,7 +8257,7 @@ class McpPromptGetTask extends Task24 {
7736
8257
  return {
7737
8258
  type: "object",
7738
8259
  properties: {
7739
- ...TaskConfigSchema6["properties"],
8260
+ ...TaskConfigSchema8["properties"],
7740
8261
  server: TypeMcpServer(mcpServerConfigSchema2),
7741
8262
  prompt_name: {
7742
8263
  type: "string",
@@ -7755,43 +8276,45 @@ class McpPromptGetTask extends Task24 {
7755
8276
  outputSchema() {
7756
8277
  return this.config?.outputSchema ?? fallbackOutputSchema;
7757
8278
  }
7758
- _schemasDiscovering = false;
8279
+ _schemasDiscoveringPromise;
7759
8280
  async discoverSchemas(_signal, serverConfig) {
7760
8281
  if (this.config.inputSchema)
7761
8282
  return;
7762
- if (this._schemasDiscovering)
7763
- return;
8283
+ if (this._schemasDiscoveringPromise)
8284
+ return this._schemasDiscoveringPromise;
7764
8285
  const resolved = serverConfig ?? getMcpServerConfig(this.config);
7765
8286
  if (!resolved.transport || !this.config.prompt_name)
7766
8287
  return;
7767
- this._schemasDiscovering = true;
7768
- try {
7769
- const result = await mcpList({
7770
- server: resolved,
7771
- list_type: "prompts"
7772
- });
7773
- const prompt = result.prompts?.find((p) => p.name === this.config.prompt_name);
7774
- if (prompt) {
7775
- const args = prompt.arguments ?? [];
7776
- const required = args.filter((a) => a.required).map((a) => a.name);
7777
- const properties = {};
7778
- for (const arg of args) {
7779
- properties[arg.name] = {
7780
- type: "string",
7781
- ...arg.description ? { description: arg.description } : {}
8288
+ this._schemasDiscoveringPromise = (async () => {
8289
+ try {
8290
+ const result = await mcpList({
8291
+ server: resolved,
8292
+ list_type: "prompts"
8293
+ });
8294
+ const prompt = result.prompts?.find((p) => p.name === this.config.prompt_name);
8295
+ if (prompt) {
8296
+ const args = prompt.arguments ?? [];
8297
+ const required = args.filter((a) => a.required).map((a) => a.name);
8298
+ const properties = {};
8299
+ for (const arg of args) {
8300
+ properties[arg.name] = {
8301
+ type: "string",
8302
+ ...arg.description ? { description: arg.description } : {}
8303
+ };
8304
+ }
8305
+ this.config.inputSchema = {
8306
+ type: "object",
8307
+ properties,
8308
+ ...required.length > 0 ? { required } : {},
8309
+ additionalProperties: false
7782
8310
  };
8311
+ this.emitSchemaChange();
7783
8312
  }
7784
- this.config.inputSchema = {
7785
- type: "object",
7786
- properties,
7787
- ...required.length > 0 ? { required } : {},
7788
- additionalProperties: false
7789
- };
7790
- this.emitSchemaChange();
8313
+ } finally {
8314
+ this._schemasDiscoveringPromise = undefined;
7791
8315
  }
7792
- } finally {
7793
- this._schemasDiscovering = false;
7794
- }
8316
+ })();
8317
+ return this._schemasDiscoveringPromise;
7795
8318
  }
7796
8319
  async execute(input2, context) {
7797
8320
  const serverConfig = getMcpServerConfig(this.config);
@@ -7813,15 +8336,17 @@ class McpPromptGetTask extends Task24 {
7813
8336
  }
7814
8337
  }
7815
8338
  var mcpPromptGet = async (input2, config) => {
7816
- return new McpPromptGetTask({}, config).run(input2);
8339
+ return new McpPromptGetTask(config).run(input2);
7817
8340
  };
7818
- Workflow26.prototype.mcpPromptGet = CreateWorkflow25(McpPromptGetTask);
8341
+ Workflow28.prototype.mcpPromptGet = CreateWorkflow27(McpPromptGetTask);
7819
8342
  // src/task/mcp/McpResourceReadTask.ts
7820
8343
  import {
7821
- CreateWorkflow as CreateWorkflow26,
7822
- Task as Task25,
7823
- TaskConfigSchema as TaskConfigSchema7,
7824
- Workflow as Workflow27
8344
+ CreateWorkflow as CreateWorkflow28,
8345
+ Entitlements as Entitlements5,
8346
+ mergeEntitlements as mergeEntitlements3,
8347
+ Task as Task27,
8348
+ TaskConfigSchema as TaskConfigSchema9,
8349
+ Workflow as Workflow29
7825
8350
  } from "@workglow/task-graph";
7826
8351
  var contentItemSchema = {
7827
8352
  anyOf: [
@@ -7849,7 +8374,7 @@ var contentItemSchema = {
7849
8374
  }
7850
8375
  ]
7851
8376
  };
7852
- var inputSchema22 = {
8377
+ var inputSchema23 = {
7853
8378
  type: "object",
7854
8379
  properties: {},
7855
8380
  additionalProperties: false
@@ -7868,15 +8393,40 @@ var outputSchema22 = {
7868
8393
  additionalProperties: false
7869
8394
  };
7870
8395
 
7871
- class McpResourceReadTask extends Task25 {
8396
+ class McpResourceReadTask extends Task27 {
7872
8397
  static type = "McpResourceReadTask";
7873
8398
  static category = "MCP";
7874
8399
  static title = "MCP Read Resource";
7875
8400
  static description = "Reads a resource from an MCP server";
7876
8401
  static cacheable = false;
7877
8402
  static customizable = true;
8403
+ static hasDynamicEntitlements = true;
8404
+ static entitlements() {
8405
+ return {
8406
+ entitlements: [
8407
+ { id: Entitlements5.MCP_RESOURCE_READ, reason: "Reads resources from MCP servers" }
8408
+ ]
8409
+ };
8410
+ }
8411
+ entitlements() {
8412
+ const base = McpResourceReadTask.entitlements();
8413
+ const transport = getMcpServerTransport(this);
8414
+ if (transport === "stdio") {
8415
+ return mergeEntitlements3(base, {
8416
+ entitlements: [
8417
+ { id: Entitlements5.MCP_STDIO, reason: "Uses stdio transport to spawn local process" }
8418
+ ]
8419
+ });
8420
+ }
8421
+ return mergeEntitlements3(base, {
8422
+ entitlements: [
8423
+ { id: Entitlements5.NETWORK_HTTP, reason: "Connects to MCP server over HTTP" },
8424
+ { id: Entitlements5.CREDENTIAL, reason: "May require authentication", optional: true }
8425
+ ]
8426
+ });
8427
+ }
7878
8428
  static inputSchema() {
7879
- return inputSchema22;
8429
+ return inputSchema23;
7880
8430
  }
7881
8431
  static outputSchema() {
7882
8432
  return outputSchema22;
@@ -7886,7 +8436,7 @@ class McpResourceReadTask extends Task25 {
7886
8436
  return {
7887
8437
  type: "object",
7888
8438
  properties: {
7889
- ...TaskConfigSchema7["properties"],
8439
+ ...TaskConfigSchema9["properties"],
7890
8440
  server: TypeMcpServer(mcpServerConfigSchema2),
7891
8441
  resource_uri: {
7892
8442
  type: "string",
@@ -7914,11 +8464,16 @@ class McpResourceReadTask extends Task25 {
7914
8464
  }
7915
8465
  }
7916
8466
  var mcpResourceRead = async (config) => {
7917
- return new McpResourceReadTask({}, config).run({});
8467
+ return new McpResourceReadTask(config).run({});
7918
8468
  };
7919
- Workflow27.prototype.mcpResourceRead = CreateWorkflow26(McpResourceReadTask);
8469
+ Workflow29.prototype.mcpResourceRead = CreateWorkflow28(McpResourceReadTask);
7920
8470
  // src/task/mcp/McpSearchTask.ts
7921
- import { CreateWorkflow as CreateWorkflow27, Task as Task26, Workflow as Workflow28 } from "@workglow/task-graph";
8471
+ import {
8472
+ CreateWorkflow as CreateWorkflow29,
8473
+ Entitlements as Entitlements6,
8474
+ Task as Task28,
8475
+ Workflow as Workflow30
8476
+ } from "@workglow/task-graph";
7922
8477
  var MCP_REGISTRY_BASE = "https://registry.modelcontextprotocol.io/v0.1";
7923
8478
  var McpSearchInputSchema = {
7924
8479
  type: "object",
@@ -8057,12 +8612,19 @@ async function searchMcpRegistry(query, signal) {
8057
8612
  return page.results;
8058
8613
  }
8059
8614
 
8060
- class McpSearchTask extends Task26 {
8615
+ class McpSearchTask extends Task28 {
8061
8616
  static type = "McpSearchTask";
8062
8617
  static category = "MCP";
8063
8618
  static title = "MCP Search";
8064
8619
  static description = "Search the MCP server registry for servers matching a query";
8065
8620
  static cacheable = false;
8621
+ static entitlements() {
8622
+ return {
8623
+ entitlements: [
8624
+ { id: Entitlements6.NETWORK_HTTP, reason: "Searches the MCP server registry via HTTPS" }
8625
+ ]
8626
+ };
8627
+ }
8066
8628
  static inputSchema() {
8067
8629
  return McpSearchInputSchema;
8068
8630
  }
@@ -8075,15 +8637,17 @@ class McpSearchTask extends Task26 {
8075
8637
  }
8076
8638
  }
8077
8639
  var mcpSearch = (input2, config) => {
8078
- return new McpSearchTask({}, config).run(input2);
8640
+ return new McpSearchTask(config).run(input2);
8079
8641
  };
8080
- Workflow28.prototype.mcpSearch = CreateWorkflow27(McpSearchTask);
8642
+ Workflow30.prototype.mcpSearch = CreateWorkflow29(McpSearchTask);
8081
8643
  // src/task/mcp/McpToolCallTask.ts
8082
8644
  import {
8083
- CreateWorkflow as CreateWorkflow28,
8084
- Task as Task27,
8085
- TaskConfigSchema as TaskConfigSchema8,
8086
- Workflow as Workflow29
8645
+ CreateWorkflow as CreateWorkflow30,
8646
+ Entitlements as Entitlements7,
8647
+ mergeEntitlements as mergeEntitlements4,
8648
+ Task as Task29,
8649
+ TaskConfigSchema as TaskConfigSchema10,
8650
+ Workflow as Workflow31
8087
8651
  } from "@workglow/task-graph";
8088
8652
  var annotationsSchema2 = {
8089
8653
  type: "object",
@@ -8210,7 +8774,7 @@ var fallbackInputSchema2 = {
8210
8774
  additionalProperties: true
8211
8775
  };
8212
8776
 
8213
- class McpToolCallTask extends Task27 {
8777
+ class McpToolCallTask extends Task29 {
8214
8778
  static type = "McpToolCallTask";
8215
8779
  static category = "MCP";
8216
8780
  static title = "MCP Call Tool";
@@ -8218,6 +8782,29 @@ class McpToolCallTask extends Task27 {
8218
8782
  static cacheable = false;
8219
8783
  static customizable = true;
8220
8784
  static hasDynamicSchemas = true;
8785
+ static hasDynamicEntitlements = true;
8786
+ static entitlements() {
8787
+ return {
8788
+ entitlements: [{ id: Entitlements7.MCP_TOOL_CALL, reason: "Calls tools on MCP servers" }]
8789
+ };
8790
+ }
8791
+ entitlements() {
8792
+ const base = McpToolCallTask.entitlements();
8793
+ const transport = getMcpServerTransport(this);
8794
+ if (transport === "stdio") {
8795
+ return mergeEntitlements4(base, {
8796
+ entitlements: [
8797
+ { id: Entitlements7.MCP_STDIO, reason: "Uses stdio transport to spawn local process" }
8798
+ ]
8799
+ });
8800
+ }
8801
+ return mergeEntitlements4(base, {
8802
+ entitlements: [
8803
+ { id: Entitlements7.NETWORK_HTTP, reason: "Connects to MCP server over HTTP" },
8804
+ { id: Entitlements7.CREDENTIAL, reason: "May require authentication", optional: true }
8805
+ ]
8806
+ });
8807
+ }
8221
8808
  static inputSchema() {
8222
8809
  return fallbackInputSchema2;
8223
8810
  }
@@ -8229,7 +8816,7 @@ class McpToolCallTask extends Task27 {
8229
8816
  return {
8230
8817
  type: "object",
8231
8818
  properties: {
8232
- ...TaskConfigSchema8["properties"],
8819
+ ...TaskConfigSchema10["properties"],
8233
8820
  server: TypeMcpServer(mcpServerConfigSchema2),
8234
8821
  tool_name: {
8235
8822
  type: "string",
@@ -8248,34 +8835,36 @@ class McpToolCallTask extends Task27 {
8248
8835
  outputSchema() {
8249
8836
  return this.config?.outputSchema ?? fallbackOutputSchema2;
8250
8837
  }
8251
- _schemasDiscovering = false;
8838
+ _schemasDiscoveringPromise;
8252
8839
  async discoverSchemas(_signal, serverConfig) {
8253
8840
  if (this.config.inputSchema && this.config.outputSchema)
8254
8841
  return;
8255
- if (this._schemasDiscovering)
8256
- return;
8842
+ if (this._schemasDiscoveringPromise)
8843
+ return this._schemasDiscoveringPromise;
8257
8844
  const resolved = serverConfig ?? getMcpServerConfig(this.config);
8258
8845
  if (!resolved.transport || !this.config.tool_name)
8259
8846
  return;
8260
- this._schemasDiscovering = true;
8261
- try {
8262
- const result = await mcpList({
8263
- server: resolved,
8264
- list_type: "tools"
8265
- });
8266
- const tool = result.tools?.find((t) => t.name === this.config.tool_name);
8267
- if (tool) {
8268
- if (!this.config.inputSchema) {
8269
- this.config.inputSchema = tool.inputSchema;
8270
- }
8271
- if (!this.config.outputSchema && tool.outputSchema) {
8272
- this.config.outputSchema = tool.outputSchema;
8847
+ this._schemasDiscoveringPromise = (async () => {
8848
+ try {
8849
+ const result = await mcpList({
8850
+ server: resolved,
8851
+ list_type: "tools"
8852
+ });
8853
+ const tool = result.tools?.find((t) => t.name === this.config.tool_name);
8854
+ if (tool) {
8855
+ if (!this.config.inputSchema) {
8856
+ this.config.inputSchema = tool.inputSchema;
8857
+ }
8858
+ if (!this.config.outputSchema && tool.outputSchema) {
8859
+ this.config.outputSchema = tool.outputSchema;
8860
+ }
8861
+ this.emitSchemaChange();
8273
8862
  }
8274
- this.emitSchemaChange();
8863
+ } finally {
8864
+ this._schemasDiscoveringPromise = undefined;
8275
8865
  }
8276
- } finally {
8277
- this._schemasDiscovering = false;
8278
- }
8866
+ })();
8867
+ return this._schemasDiscoveringPromise;
8279
8868
  }
8280
8869
  async execute(input2, context) {
8281
8870
  const serverConfig = getMcpServerConfig(this.config);
@@ -8321,16 +8910,16 @@ class McpToolCallTask extends Task27 {
8321
8910
  }
8322
8911
  }
8323
8912
  var mcpToolCall = async (input2, config) => {
8324
- return new McpToolCallTask({}, config).run(input2);
8913
+ return new McpToolCallTask(config).run(input2);
8325
8914
  };
8326
- Workflow29.prototype.mcpToolCall = CreateWorkflow28(McpToolCallTask);
8915
+ Workflow31.prototype.mcpToolCall = CreateWorkflow30(McpToolCallTask);
8327
8916
  // src/task/string/StringConcatTask.ts
8328
8917
  import {
8329
- CreateWorkflow as CreateWorkflow29,
8330
- Task as Task28,
8331
- Workflow as Workflow30
8918
+ CreateWorkflow as CreateWorkflow31,
8919
+ Task as Task30,
8920
+ Workflow as Workflow32
8332
8921
  } from "@workglow/task-graph";
8333
- var inputSchema23 = {
8922
+ var inputSchema24 = {
8334
8923
  type: "object",
8335
8924
  properties: {},
8336
8925
  additionalProperties: { type: "string" }
@@ -8348,13 +8937,13 @@ var outputSchema23 = {
8348
8937
  additionalProperties: false
8349
8938
  };
8350
8939
 
8351
- class StringConcatTask extends Task28 {
8940
+ class StringConcatTask extends Task30 {
8352
8941
  static type = "StringConcatTask";
8353
8942
  static category = "String";
8354
8943
  static title = "Concat";
8355
8944
  static description = "Concatenates all input strings";
8356
8945
  static inputSchema() {
8357
- return inputSchema23;
8946
+ return inputSchema24;
8358
8947
  }
8359
8948
  static outputSchema() {
8360
8949
  return outputSchema23;
@@ -8363,14 +8952,14 @@ class StringConcatTask extends Task28 {
8363
8952
  return { result: Object.values(input2).join("") };
8364
8953
  }
8365
8954
  }
8366
- Workflow30.prototype.stringConcat = CreateWorkflow29(StringConcatTask);
8955
+ Workflow32.prototype.stringConcat = CreateWorkflow31(StringConcatTask);
8367
8956
  // src/task/string/StringIncludesTask.ts
8368
8957
  import {
8369
- CreateWorkflow as CreateWorkflow30,
8370
- Task as Task29,
8371
- Workflow as Workflow31
8958
+ CreateWorkflow as CreateWorkflow32,
8959
+ Task as Task31,
8960
+ Workflow as Workflow33
8372
8961
  } from "@workglow/task-graph";
8373
- var inputSchema24 = {
8962
+ var inputSchema25 = {
8374
8963
  type: "object",
8375
8964
  properties: {
8376
8965
  value: {
@@ -8400,13 +8989,13 @@ var outputSchema24 = {
8400
8989
  additionalProperties: false
8401
8990
  };
8402
8991
 
8403
- class StringIncludesTask extends Task29 {
8992
+ class StringIncludesTask extends Task31 {
8404
8993
  static type = "StringIncludesTask";
8405
8994
  static category = "String";
8406
8995
  static title = "Includes";
8407
8996
  static description = "Checks if a string contains a substring";
8408
8997
  static inputSchema() {
8409
- return inputSchema24;
8998
+ return inputSchema25;
8410
8999
  }
8411
9000
  static outputSchema() {
8412
9001
  return outputSchema24;
@@ -8415,14 +9004,14 @@ class StringIncludesTask extends Task29 {
8415
9004
  return { result: input2.value.includes(input2.search) };
8416
9005
  }
8417
9006
  }
8418
- Workflow31.prototype.stringIncludes = CreateWorkflow30(StringIncludesTask);
9007
+ Workflow33.prototype.stringIncludes = CreateWorkflow32(StringIncludesTask);
8419
9008
  // src/task/string/StringJoinTask.ts
8420
9009
  import {
8421
- CreateWorkflow as CreateWorkflow31,
8422
- Task as Task30,
8423
- Workflow as Workflow32
9010
+ CreateWorkflow as CreateWorkflow33,
9011
+ Task as Task32,
9012
+ Workflow as Workflow34
8424
9013
  } from "@workglow/task-graph";
8425
- var inputSchema25 = {
9014
+ var inputSchema26 = {
8426
9015
  type: "object",
8427
9016
  properties: {
8428
9017
  values: {
@@ -8454,13 +9043,13 @@ var outputSchema25 = {
8454
9043
  additionalProperties: false
8455
9044
  };
8456
9045
 
8457
- class StringJoinTask extends Task30 {
9046
+ class StringJoinTask extends Task32 {
8458
9047
  static type = "StringJoinTask";
8459
9048
  static category = "String";
8460
9049
  static title = "Join";
8461
9050
  static description = "Joins an array of strings with a separator";
8462
9051
  static inputSchema() {
8463
- return inputSchema25;
9052
+ return inputSchema26;
8464
9053
  }
8465
9054
  static outputSchema() {
8466
9055
  return outputSchema25;
@@ -8470,14 +9059,14 @@ class StringJoinTask extends Task30 {
8470
9059
  return { result: input2.values.join(separator) };
8471
9060
  }
8472
9061
  }
8473
- Workflow32.prototype.stringJoin = CreateWorkflow31(StringJoinTask);
9062
+ Workflow34.prototype.stringJoin = CreateWorkflow33(StringJoinTask);
8474
9063
  // src/task/string/StringLengthTask.ts
8475
9064
  import {
8476
- CreateWorkflow as CreateWorkflow32,
8477
- Task as Task31,
8478
- Workflow as Workflow33
9065
+ CreateWorkflow as CreateWorkflow34,
9066
+ Task as Task33,
9067
+ Workflow as Workflow35
8479
9068
  } from "@workglow/task-graph";
8480
- var inputSchema26 = {
9069
+ var inputSchema27 = {
8481
9070
  type: "object",
8482
9071
  properties: {
8483
9072
  value: {
@@ -8502,13 +9091,13 @@ var outputSchema26 = {
8502
9091
  additionalProperties: false
8503
9092
  };
8504
9093
 
8505
- class StringLengthTask extends Task31 {
9094
+ class StringLengthTask extends Task33 {
8506
9095
  static type = "StringLengthTask";
8507
9096
  static category = "String";
8508
9097
  static title = "Length";
8509
9098
  static description = "Returns the length of a string";
8510
9099
  static inputSchema() {
8511
- return inputSchema26;
9100
+ return inputSchema27;
8512
9101
  }
8513
9102
  static outputSchema() {
8514
9103
  return outputSchema26;
@@ -8517,14 +9106,14 @@ class StringLengthTask extends Task31 {
8517
9106
  return { result: input2.value.length };
8518
9107
  }
8519
9108
  }
8520
- Workflow33.prototype.stringLength = CreateWorkflow32(StringLengthTask);
9109
+ Workflow35.prototype.stringLength = CreateWorkflow34(StringLengthTask);
8521
9110
  // src/task/string/StringLowerCaseTask.ts
8522
9111
  import {
8523
- CreateWorkflow as CreateWorkflow33,
8524
- Task as Task32,
8525
- Workflow as Workflow34
9112
+ CreateWorkflow as CreateWorkflow35,
9113
+ Task as Task34,
9114
+ Workflow as Workflow36
8526
9115
  } from "@workglow/task-graph";
8527
- var inputSchema27 = {
9116
+ var inputSchema28 = {
8528
9117
  type: "object",
8529
9118
  properties: {
8530
9119
  value: {
@@ -8549,13 +9138,13 @@ var outputSchema27 = {
8549
9138
  additionalProperties: false
8550
9139
  };
8551
9140
 
8552
- class StringLowerCaseTask extends Task32 {
9141
+ class StringLowerCaseTask extends Task34 {
8553
9142
  static type = "StringLowerCaseTask";
8554
9143
  static category = "String";
8555
9144
  static title = "Lower Case";
8556
9145
  static description = "Converts a string to lower case";
8557
9146
  static inputSchema() {
8558
- return inputSchema27;
9147
+ return inputSchema28;
8559
9148
  }
8560
9149
  static outputSchema() {
8561
9150
  return outputSchema27;
@@ -8564,14 +9153,14 @@ class StringLowerCaseTask extends Task32 {
8564
9153
  return { result: input2.value.toLowerCase() };
8565
9154
  }
8566
9155
  }
8567
- Workflow34.prototype.stringLowerCase = CreateWorkflow33(StringLowerCaseTask);
9156
+ Workflow36.prototype.stringLowerCase = CreateWorkflow35(StringLowerCaseTask);
8568
9157
  // src/task/string/StringReplaceTask.ts
8569
9158
  import {
8570
- CreateWorkflow as CreateWorkflow34,
8571
- Task as Task33,
8572
- Workflow as Workflow35
9159
+ CreateWorkflow as CreateWorkflow36,
9160
+ Task as Task35,
9161
+ Workflow as Workflow37
8573
9162
  } from "@workglow/task-graph";
8574
- var inputSchema28 = {
9163
+ var inputSchema29 = {
8575
9164
  type: "object",
8576
9165
  properties: {
8577
9166
  value: {
@@ -8606,13 +9195,13 @@ var outputSchema28 = {
8606
9195
  additionalProperties: false
8607
9196
  };
8608
9197
 
8609
- class StringReplaceTask extends Task33 {
9198
+ class StringReplaceTask extends Task35 {
8610
9199
  static type = "StringReplaceTask";
8611
9200
  static category = "String";
8612
9201
  static title = "Replace";
8613
9202
  static description = "Replaces all occurrences of a substring";
8614
9203
  static inputSchema() {
8615
- return inputSchema28;
9204
+ return inputSchema29;
8616
9205
  }
8617
9206
  static outputSchema() {
8618
9207
  return outputSchema28;
@@ -8621,14 +9210,14 @@ class StringReplaceTask extends Task33 {
8621
9210
  return { result: input2.value.replaceAll(input2.search, input2.replace) };
8622
9211
  }
8623
9212
  }
8624
- Workflow35.prototype.stringReplace = CreateWorkflow34(StringReplaceTask);
9213
+ Workflow37.prototype.stringReplace = CreateWorkflow36(StringReplaceTask);
8625
9214
  // src/task/string/StringSliceTask.ts
8626
9215
  import {
8627
- CreateWorkflow as CreateWorkflow35,
8628
- Task as Task34,
8629
- Workflow as Workflow36
9216
+ CreateWorkflow as CreateWorkflow37,
9217
+ Task as Task36,
9218
+ Workflow as Workflow38
8630
9219
  } from "@workglow/task-graph";
8631
- var inputSchema29 = {
9220
+ var inputSchema30 = {
8632
9221
  type: "object",
8633
9222
  properties: {
8634
9223
  value: {
@@ -8663,13 +9252,13 @@ var outputSchema29 = {
8663
9252
  additionalProperties: false
8664
9253
  };
8665
9254
 
8666
- class StringSliceTask extends Task34 {
9255
+ class StringSliceTask extends Task36 {
8667
9256
  static type = "StringSliceTask";
8668
9257
  static category = "String";
8669
9258
  static title = "Slice";
8670
9259
  static description = "Extracts a substring by start and optional end index";
8671
9260
  static inputSchema() {
8672
- return inputSchema29;
9261
+ return inputSchema30;
8673
9262
  }
8674
9263
  static outputSchema() {
8675
9264
  return outputSchema29;
@@ -8678,14 +9267,14 @@ class StringSliceTask extends Task34 {
8678
9267
  return { result: input2.value.slice(input2.start, input2.end) };
8679
9268
  }
8680
9269
  }
8681
- Workflow36.prototype.stringSlice = CreateWorkflow35(StringSliceTask);
9270
+ Workflow38.prototype.stringSlice = CreateWorkflow37(StringSliceTask);
8682
9271
  // src/task/string/StringTemplateTask.ts
8683
9272
  import {
8684
- CreateWorkflow as CreateWorkflow36,
8685
- Task as Task35,
8686
- Workflow as Workflow37
9273
+ CreateWorkflow as CreateWorkflow38,
9274
+ Task as Task37,
9275
+ Workflow as Workflow39
8687
9276
  } from "@workglow/task-graph";
8688
- var inputSchema30 = {
9277
+ var inputSchema31 = {
8689
9278
  type: "object",
8690
9279
  properties: {
8691
9280
  template: {
@@ -8716,13 +9305,13 @@ var outputSchema30 = {
8716
9305
  additionalProperties: false
8717
9306
  };
8718
9307
 
8719
- class StringTemplateTask extends Task35 {
9308
+ class StringTemplateTask extends Task37 {
8720
9309
  static type = "StringTemplateTask";
8721
9310
  static category = "String";
8722
9311
  static title = "Template";
8723
9312
  static description = "Replaces {{key}} placeholders in a template string with values";
8724
9313
  static inputSchema() {
8725
- return inputSchema30;
9314
+ return inputSchema31;
8726
9315
  }
8727
9316
  static outputSchema() {
8728
9317
  return outputSchema30;
@@ -8735,14 +9324,14 @@ class StringTemplateTask extends Task35 {
8735
9324
  return { result };
8736
9325
  }
8737
9326
  }
8738
- Workflow37.prototype.stringTemplate = CreateWorkflow36(StringTemplateTask);
9327
+ Workflow39.prototype.stringTemplate = CreateWorkflow38(StringTemplateTask);
8739
9328
  // src/task/string/StringTrimTask.ts
8740
9329
  import {
8741
- CreateWorkflow as CreateWorkflow37,
8742
- Task as Task36,
8743
- Workflow as Workflow38
9330
+ CreateWorkflow as CreateWorkflow39,
9331
+ Task as Task38,
9332
+ Workflow as Workflow40
8744
9333
  } from "@workglow/task-graph";
8745
- var inputSchema31 = {
9334
+ var inputSchema32 = {
8746
9335
  type: "object",
8747
9336
  properties: {
8748
9337
  value: {
@@ -8767,13 +9356,13 @@ var outputSchema31 = {
8767
9356
  additionalProperties: false
8768
9357
  };
8769
9358
 
8770
- class StringTrimTask extends Task36 {
9359
+ class StringTrimTask extends Task38 {
8771
9360
  static type = "StringTrimTask";
8772
9361
  static category = "String";
8773
9362
  static title = "Trim";
8774
9363
  static description = "Removes leading and trailing whitespace from a string";
8775
9364
  static inputSchema() {
8776
- return inputSchema31;
9365
+ return inputSchema32;
8777
9366
  }
8778
9367
  static outputSchema() {
8779
9368
  return outputSchema31;
@@ -8782,14 +9371,14 @@ class StringTrimTask extends Task36 {
8782
9371
  return { result: input2.value.trim() };
8783
9372
  }
8784
9373
  }
8785
- Workflow38.prototype.stringTrim = CreateWorkflow37(StringTrimTask);
9374
+ Workflow40.prototype.stringTrim = CreateWorkflow39(StringTrimTask);
8786
9375
  // src/task/string/StringUpperCaseTask.ts
8787
9376
  import {
8788
- CreateWorkflow as CreateWorkflow38,
8789
- Task as Task37,
8790
- Workflow as Workflow39
9377
+ CreateWorkflow as CreateWorkflow40,
9378
+ Task as Task39,
9379
+ Workflow as Workflow41
8791
9380
  } from "@workglow/task-graph";
8792
- var inputSchema32 = {
9381
+ var inputSchema33 = {
8793
9382
  type: "object",
8794
9383
  properties: {
8795
9384
  value: {
@@ -8814,13 +9403,13 @@ var outputSchema32 = {
8814
9403
  additionalProperties: false
8815
9404
  };
8816
9405
 
8817
- class StringUpperCaseTask extends Task37 {
9406
+ class StringUpperCaseTask extends Task39 {
8818
9407
  static type = "StringUpperCaseTask";
8819
9408
  static category = "String";
8820
9409
  static title = "Upper Case";
8821
9410
  static description = "Converts a string to upper case";
8822
9411
  static inputSchema() {
8823
- return inputSchema32;
9412
+ return inputSchema33;
8824
9413
  }
8825
9414
  static outputSchema() {
8826
9415
  return outputSchema32;
@@ -8829,10 +9418,10 @@ class StringUpperCaseTask extends Task37 {
8829
9418
  return { result: input2.value.toUpperCase() };
8830
9419
  }
8831
9420
  }
8832
- Workflow39.prototype.stringUpperCase = CreateWorkflow38(StringUpperCaseTask);
9421
+ Workflow41.prototype.stringUpperCase = CreateWorkflow40(StringUpperCaseTask);
8833
9422
  // src/task/scalar/ScalarAbsTask.ts
8834
- import { CreateWorkflow as CreateWorkflow39, Task as Task38, Workflow as Workflow40 } from "@workglow/task-graph";
8835
- var inputSchema33 = {
9423
+ import { CreateWorkflow as CreateWorkflow41, Task as Task40, Workflow as Workflow42 } from "@workglow/task-graph";
9424
+ var inputSchema34 = {
8836
9425
  type: "object",
8837
9426
  properties: {
8838
9427
  value: {
@@ -8857,13 +9446,13 @@ var outputSchema33 = {
8857
9446
  additionalProperties: false
8858
9447
  };
8859
9448
 
8860
- class ScalarAbsTask extends Task38 {
9449
+ class ScalarAbsTask extends Task40 {
8861
9450
  static type = "ScalarAbsTask";
8862
9451
  static category = "Math";
8863
9452
  static title = "Abs";
8864
9453
  static description = "Returns the absolute value of a number";
8865
9454
  static inputSchema() {
8866
- return inputSchema33;
9455
+ return inputSchema34;
8867
9456
  }
8868
9457
  static outputSchema() {
8869
9458
  return outputSchema33;
@@ -8872,10 +9461,10 @@ class ScalarAbsTask extends Task38 {
8872
9461
  return { result: Math.abs(input2.value) };
8873
9462
  }
8874
9463
  }
8875
- Workflow40.prototype.scalarAbs = CreateWorkflow39(ScalarAbsTask);
9464
+ Workflow42.prototype.scalarAbs = CreateWorkflow41(ScalarAbsTask);
8876
9465
  // src/task/scalar/ScalarCeilTask.ts
8877
- import { CreateWorkflow as CreateWorkflow40, Task as Task39, Workflow as Workflow41 } from "@workglow/task-graph";
8878
- var inputSchema34 = {
9466
+ import { CreateWorkflow as CreateWorkflow42, Task as Task41, Workflow as Workflow43 } from "@workglow/task-graph";
9467
+ var inputSchema35 = {
8879
9468
  type: "object",
8880
9469
  properties: {
8881
9470
  value: {
@@ -8900,13 +9489,13 @@ var outputSchema34 = {
8900
9489
  additionalProperties: false
8901
9490
  };
8902
9491
 
8903
- class ScalarCeilTask extends Task39 {
9492
+ class ScalarCeilTask extends Task41 {
8904
9493
  static type = "ScalarCeilTask";
8905
9494
  static category = "Math";
8906
9495
  static title = "Ceil";
8907
9496
  static description = "Returns the smallest integer greater than or equal to a number";
8908
9497
  static inputSchema() {
8909
- return inputSchema34;
9498
+ return inputSchema35;
8910
9499
  }
8911
9500
  static outputSchema() {
8912
9501
  return outputSchema34;
@@ -8915,10 +9504,10 @@ class ScalarCeilTask extends Task39 {
8915
9504
  return { result: Math.ceil(input2.value) };
8916
9505
  }
8917
9506
  }
8918
- Workflow41.prototype.scalarCeil = CreateWorkflow40(ScalarCeilTask);
9507
+ Workflow43.prototype.scalarCeil = CreateWorkflow42(ScalarCeilTask);
8919
9508
  // src/task/scalar/ScalarFloorTask.ts
8920
- import { CreateWorkflow as CreateWorkflow41, Task as Task40, Workflow as Workflow42 } from "@workglow/task-graph";
8921
- var inputSchema35 = {
9509
+ import { CreateWorkflow as CreateWorkflow43, Task as Task42, Workflow as Workflow44 } from "@workglow/task-graph";
9510
+ var inputSchema36 = {
8922
9511
  type: "object",
8923
9512
  properties: {
8924
9513
  value: {
@@ -8943,13 +9532,13 @@ var outputSchema35 = {
8943
9532
  additionalProperties: false
8944
9533
  };
8945
9534
 
8946
- class ScalarFloorTask extends Task40 {
9535
+ class ScalarFloorTask extends Task42 {
8947
9536
  static type = "ScalarFloorTask";
8948
9537
  static category = "Math";
8949
9538
  static title = "Floor";
8950
9539
  static description = "Returns the largest integer less than or equal to a number";
8951
9540
  static inputSchema() {
8952
- return inputSchema35;
9541
+ return inputSchema36;
8953
9542
  }
8954
9543
  static outputSchema() {
8955
9544
  return outputSchema35;
@@ -8958,10 +9547,10 @@ class ScalarFloorTask extends Task40 {
8958
9547
  return { result: Math.floor(input2.value) };
8959
9548
  }
8960
9549
  }
8961
- Workflow42.prototype.scalarFloor = CreateWorkflow41(ScalarFloorTask);
9550
+ Workflow44.prototype.scalarFloor = CreateWorkflow43(ScalarFloorTask);
8962
9551
  // src/task/scalar/ScalarMaxTask.ts
8963
- import { CreateWorkflow as CreateWorkflow42, Task as Task41, Workflow as Workflow43 } from "@workglow/task-graph";
8964
- var inputSchema36 = {
9552
+ import { CreateWorkflow as CreateWorkflow44, Task as Task43, Workflow as Workflow45 } from "@workglow/task-graph";
9553
+ var inputSchema37 = {
8965
9554
  type: "object",
8966
9555
  properties: {
8967
9556
  values: {
@@ -8987,13 +9576,13 @@ var outputSchema36 = {
8987
9576
  additionalProperties: false
8988
9577
  };
8989
9578
 
8990
- class ScalarMaxTask extends Task41 {
9579
+ class ScalarMaxTask extends Task43 {
8991
9580
  static type = "ScalarMaxTask";
8992
9581
  static category = "Math";
8993
9582
  static title = "Max";
8994
9583
  static description = "Returns the largest of the given numbers";
8995
9584
  static inputSchema() {
8996
- return inputSchema36;
9585
+ return inputSchema37;
8997
9586
  }
8998
9587
  static outputSchema() {
8999
9588
  return outputSchema36;
@@ -9002,10 +9591,10 @@ class ScalarMaxTask extends Task41 {
9002
9591
  return { result: Math.max(...input2.values) };
9003
9592
  }
9004
9593
  }
9005
- Workflow43.prototype.scalarMax = CreateWorkflow42(ScalarMaxTask);
9594
+ Workflow45.prototype.scalarMax = CreateWorkflow44(ScalarMaxTask);
9006
9595
  // src/task/scalar/ScalarMinTask.ts
9007
- import { CreateWorkflow as CreateWorkflow43, Task as Task42, Workflow as Workflow44 } from "@workglow/task-graph";
9008
- var inputSchema37 = {
9596
+ import { CreateWorkflow as CreateWorkflow45, Task as Task44, Workflow as Workflow46 } from "@workglow/task-graph";
9597
+ var inputSchema38 = {
9009
9598
  type: "object",
9010
9599
  properties: {
9011
9600
  values: {
@@ -9031,13 +9620,13 @@ var outputSchema37 = {
9031
9620
  additionalProperties: false
9032
9621
  };
9033
9622
 
9034
- class ScalarMinTask extends Task42 {
9623
+ class ScalarMinTask extends Task44 {
9035
9624
  static type = "ScalarMinTask";
9036
9625
  static category = "Math";
9037
9626
  static title = "Min";
9038
9627
  static description = "Returns the smallest of the given numbers";
9039
9628
  static inputSchema() {
9040
- return inputSchema37;
9629
+ return inputSchema38;
9041
9630
  }
9042
9631
  static outputSchema() {
9043
9632
  return outputSchema37;
@@ -9046,10 +9635,10 @@ class ScalarMinTask extends Task42 {
9046
9635
  return { result: Math.min(...input2.values) };
9047
9636
  }
9048
9637
  }
9049
- Workflow44.prototype.scalarMin = CreateWorkflow43(ScalarMinTask);
9638
+ Workflow46.prototype.scalarMin = CreateWorkflow45(ScalarMinTask);
9050
9639
  // src/task/scalar/ScalarRoundTask.ts
9051
- import { CreateWorkflow as CreateWorkflow44, Task as Task43, Workflow as Workflow45 } from "@workglow/task-graph";
9052
- var inputSchema38 = {
9640
+ import { CreateWorkflow as CreateWorkflow46, Task as Task45, Workflow as Workflow47 } from "@workglow/task-graph";
9641
+ var inputSchema39 = {
9053
9642
  type: "object",
9054
9643
  properties: {
9055
9644
  value: {
@@ -9074,13 +9663,13 @@ var outputSchema38 = {
9074
9663
  additionalProperties: false
9075
9664
  };
9076
9665
 
9077
- class ScalarRoundTask extends Task43 {
9666
+ class ScalarRoundTask extends Task45 {
9078
9667
  static type = "ScalarRoundTask";
9079
9668
  static category = "Math";
9080
9669
  static title = "Round";
9081
9670
  static description = "Returns the value of a number rounded to the nearest integer";
9082
9671
  static inputSchema() {
9083
- return inputSchema38;
9672
+ return inputSchema39;
9084
9673
  }
9085
9674
  static outputSchema() {
9086
9675
  return outputSchema38;
@@ -9089,10 +9678,10 @@ class ScalarRoundTask extends Task43 {
9089
9678
  return { result: Math.round(input2.value) };
9090
9679
  }
9091
9680
  }
9092
- Workflow45.prototype.scalarRound = CreateWorkflow44(ScalarRoundTask);
9681
+ Workflow47.prototype.scalarRound = CreateWorkflow46(ScalarRoundTask);
9093
9682
  // src/task/scalar/ScalarTruncTask.ts
9094
- import { CreateWorkflow as CreateWorkflow45, Task as Task44, Workflow as Workflow46 } from "@workglow/task-graph";
9095
- var inputSchema39 = {
9683
+ import { CreateWorkflow as CreateWorkflow47, Task as Task46, Workflow as Workflow48 } from "@workglow/task-graph";
9684
+ var inputSchema40 = {
9096
9685
  type: "object",
9097
9686
  properties: {
9098
9687
  value: {
@@ -9117,13 +9706,13 @@ var outputSchema39 = {
9117
9706
  additionalProperties: false
9118
9707
  };
9119
9708
 
9120
- class ScalarTruncTask extends Task44 {
9709
+ class ScalarTruncTask extends Task46 {
9121
9710
  static type = "ScalarTruncTask";
9122
9711
  static category = "Math";
9123
9712
  static title = "Truncate";
9124
9713
  static description = "Returns the integer part of a number by removing fractional digits";
9125
9714
  static inputSchema() {
9126
- return inputSchema39;
9715
+ return inputSchema40;
9127
9716
  }
9128
9717
  static outputSchema() {
9129
9718
  return outputSchema39;
@@ -9132,13 +9721,13 @@ class ScalarTruncTask extends Task44 {
9132
9721
  return { result: Math.trunc(input2.value) };
9133
9722
  }
9134
9723
  }
9135
- Workflow46.prototype.scalarTrunc = CreateWorkflow45(ScalarTruncTask);
9724
+ Workflow48.prototype.scalarTrunc = CreateWorkflow47(ScalarTruncTask);
9136
9725
  // src/task/vector/VectorDistanceTask.ts
9137
- import { CreateWorkflow as CreateWorkflow46, Task as Task45, Workflow as Workflow47 } from "@workglow/task-graph";
9726
+ import { CreateWorkflow as CreateWorkflow48, Task as Task47, Workflow as Workflow49 } from "@workglow/task-graph";
9138
9727
  import {
9139
9728
  TypedArraySchema as TypedArraySchema5
9140
9729
  } from "@workglow/util/schema";
9141
- var inputSchema40 = {
9730
+ var inputSchema41 = {
9142
9731
  type: "object",
9143
9732
  properties: {
9144
9733
  vectors: {
@@ -9167,13 +9756,13 @@ var outputSchema40 = {
9167
9756
  additionalProperties: false
9168
9757
  };
9169
9758
 
9170
- class VectorDistanceTask extends Task45 {
9759
+ class VectorDistanceTask extends Task47 {
9171
9760
  static type = "VectorDistanceTask";
9172
9761
  static category = "Vector";
9173
9762
  static title = "Distance";
9174
9763
  static description = "Returns the Euclidean distance between the first two vectors";
9175
9764
  static inputSchema() {
9176
- return inputSchema40;
9765
+ return inputSchema41;
9177
9766
  }
9178
9767
  static outputSchema() {
9179
9768
  return outputSchema40;
@@ -9194,13 +9783,13 @@ class VectorDistanceTask extends Task45 {
9194
9783
  return { result: Math.sqrt(sumPrecise(diffs)) };
9195
9784
  }
9196
9785
  }
9197
- Workflow47.prototype.vectorDistance = CreateWorkflow46(VectorDistanceTask);
9786
+ Workflow49.prototype.vectorDistance = CreateWorkflow48(VectorDistanceTask);
9198
9787
  // src/task/vector/VectorDotProductTask.ts
9199
- import { CreateWorkflow as CreateWorkflow47, Task as Task46, Workflow as Workflow48 } from "@workglow/task-graph";
9788
+ import { CreateWorkflow as CreateWorkflow49, Task as Task48, Workflow as Workflow50 } from "@workglow/task-graph";
9200
9789
  import {
9201
9790
  TypedArraySchema as TypedArraySchema6
9202
9791
  } from "@workglow/util/schema";
9203
- var inputSchema41 = {
9792
+ var inputSchema42 = {
9204
9793
  type: "object",
9205
9794
  properties: {
9206
9795
  vectors: {
@@ -9229,13 +9818,13 @@ var outputSchema41 = {
9229
9818
  additionalProperties: false
9230
9819
  };
9231
9820
 
9232
- class VectorDotProductTask extends Task46 {
9821
+ class VectorDotProductTask extends Task48 {
9233
9822
  static type = "VectorDotProductTask";
9234
9823
  static category = "Vector";
9235
9824
  static title = "Dot Product";
9236
9825
  static description = "Returns the dot (inner) product of the first two vectors";
9237
9826
  static inputSchema() {
9238
- return inputSchema41;
9827
+ return inputSchema42;
9239
9828
  }
9240
9829
  static outputSchema() {
9241
9830
  return outputSchema41;
@@ -9253,14 +9842,14 @@ class VectorDotProductTask extends Task46 {
9253
9842
  return { result: sumPrecise(products) };
9254
9843
  }
9255
9844
  }
9256
- Workflow48.prototype.vectorDotProduct = CreateWorkflow47(VectorDotProductTask);
9845
+ Workflow50.prototype.vectorDotProduct = CreateWorkflow49(VectorDotProductTask);
9257
9846
  // src/task/vector/VectorNormalizeTask.ts
9258
- import { CreateWorkflow as CreateWorkflow48, Task as Task47, Workflow as Workflow49 } from "@workglow/task-graph";
9847
+ import { CreateWorkflow as CreateWorkflow50, Task as Task49, Workflow as Workflow51 } from "@workglow/task-graph";
9259
9848
  import {
9260
9849
  TypedArraySchema as TypedArraySchema7,
9261
9850
  normalize
9262
9851
  } from "@workglow/util/schema";
9263
- var inputSchema42 = {
9852
+ var inputSchema43 = {
9264
9853
  type: "object",
9265
9854
  properties: {
9266
9855
  vector: TypedArraySchema7({
@@ -9283,13 +9872,13 @@ var outputSchema42 = {
9283
9872
  additionalProperties: false
9284
9873
  };
9285
9874
 
9286
- class VectorNormalizeTask extends Task47 {
9875
+ class VectorNormalizeTask extends Task49 {
9287
9876
  static type = "VectorNormalizeTask";
9288
9877
  static category = "Vector";
9289
9878
  static title = "Normalize";
9290
9879
  static description = "Returns the L2-normalized (unit length) vector";
9291
9880
  static inputSchema() {
9292
- return inputSchema42;
9881
+ return inputSchema43;
9293
9882
  }
9294
9883
  static outputSchema() {
9295
9884
  return outputSchema42;
@@ -9298,14 +9887,14 @@ class VectorNormalizeTask extends Task47 {
9298
9887
  return { result: normalize(input2.vector) };
9299
9888
  }
9300
9889
  }
9301
- Workflow49.prototype.vectorNormalize = CreateWorkflow48(VectorNormalizeTask);
9890
+ Workflow51.prototype.vectorNormalize = CreateWorkflow50(VectorNormalizeTask);
9302
9891
  // src/task/vector/VectorScaleTask.ts
9303
- import { CreateWorkflow as CreateWorkflow49, Task as Task48, Workflow as Workflow50 } from "@workglow/task-graph";
9892
+ import { CreateWorkflow as CreateWorkflow51, Task as Task50, Workflow as Workflow52 } from "@workglow/task-graph";
9304
9893
  import {
9305
9894
  createTypedArrayFrom as createTypedArrayFrom5,
9306
9895
  TypedArraySchema as TypedArraySchema8
9307
9896
  } from "@workglow/util/schema";
9308
- var inputSchema43 = {
9897
+ var inputSchema44 = {
9309
9898
  type: "object",
9310
9899
  properties: {
9311
9900
  vector: TypedArraySchema8({
@@ -9333,13 +9922,13 @@ var outputSchema43 = {
9333
9922
  additionalProperties: false
9334
9923
  };
9335
9924
 
9336
- class VectorScaleTask extends Task48 {
9925
+ class VectorScaleTask extends Task50 {
9337
9926
  static type = "VectorScaleTask";
9338
9927
  static category = "Vector";
9339
9928
  static title = "Scale";
9340
9929
  static description = "Multiplies each element of a vector by a scalar";
9341
9930
  static inputSchema() {
9342
- return inputSchema43;
9931
+ return inputSchema44;
9343
9932
  }
9344
9933
  static outputSchema() {
9345
9934
  return outputSchema43;
@@ -9350,7 +9939,7 @@ class VectorScaleTask extends Task48 {
9350
9939
  return { result: createTypedArrayFrom5([vector], values) };
9351
9940
  }
9352
9941
  }
9353
- Workflow50.prototype.vectorScale = CreateWorkflow49(VectorScaleTask);
9942
+ Workflow52.prototype.vectorScale = CreateWorkflow51(VectorScaleTask);
9354
9943
 
9355
9944
  // src/common.ts
9356
9945
  import { TaskRegistry } from "@workglow/task-graph";
@@ -9359,6 +9948,8 @@ var registerCommonTasks = () => {
9359
9948
  DebugLogTask,
9360
9949
  DelayTask,
9361
9950
  FetchUrlTask,
9951
+ HumanApprovalTask,
9952
+ HumanInputTask,
9362
9953
  InputTask,
9363
9954
  JavaScriptTask,
9364
9955
  JsonTask,
@@ -9411,21 +10002,21 @@ var registerCommonTasks = () => {
9411
10002
  };
9412
10003
  // src/task/FileLoaderTask.server.ts
9413
10004
  import {
9414
- CreateWorkflow as CreateWorkflow51,
9415
- TaskAbortedError as TaskAbortedError3,
9416
- Workflow as Workflow52
10005
+ CreateWorkflow as CreateWorkflow53,
10006
+ TaskAbortedError as TaskAbortedError5,
10007
+ Workflow as Workflow54
9417
10008
  } from "@workglow/task-graph";
9418
10009
  import { readFile } from "fs/promises";
9419
10010
 
9420
10011
  // src/task/FileLoaderTask.ts
9421
10012
  import {
9422
- CreateWorkflow as CreateWorkflow50,
9423
- Task as Task49,
9424
- TaskAbortedError as TaskAbortedError2,
9425
- Workflow as Workflow51
10013
+ CreateWorkflow as CreateWorkflow52,
10014
+ Task as Task51,
10015
+ TaskAbortedError as TaskAbortedError4,
10016
+ Workflow as Workflow53
9426
10017
  } from "@workglow/task-graph";
9427
10018
  import Papa from "papaparse";
9428
- var inputSchema44 = {
10019
+ var inputSchema45 = {
9429
10020
  type: "object",
9430
10021
  properties: {
9431
10022
  url: {
@@ -9496,14 +10087,14 @@ var outputSchema44 = {
9496
10087
  additionalProperties: false
9497
10088
  };
9498
10089
 
9499
- class FileLoaderTask extends Task49 {
10090
+ class FileLoaderTask extends Task51 {
9500
10091
  static type = "FileLoaderTask";
9501
10092
  static category = "Document";
9502
10093
  static title = "File Loader";
9503
10094
  static description = "Load documents from URLs (http://, https://)";
9504
10095
  static cacheable = true;
9505
10096
  static inputSchema() {
9506
- return inputSchema44;
10097
+ return inputSchema45;
9507
10098
  }
9508
10099
  static outputSchema() {
9509
10100
  return outputSchema44;
@@ -9511,30 +10102,28 @@ class FileLoaderTask extends Task49 {
9511
10102
  async execute(input2, context) {
9512
10103
  const { url, format = "auto" } = input2;
9513
10104
  if (context.signal.aborted) {
9514
- throw new TaskAbortedError2("Task aborted");
10105
+ throw new TaskAbortedError4("Task aborted");
9515
10106
  }
9516
10107
  await context.updateProgress(0, "Detecting file format");
9517
10108
  const detectedFormat = this.detectFormat(url, format);
9518
10109
  const responseType = this.detectResponseType(detectedFormat);
9519
10110
  if (context.signal.aborted) {
9520
- throw new TaskAbortedError2("Task aborted");
10111
+ throw new TaskAbortedError4("Task aborted");
9521
10112
  }
9522
10113
  await context.updateProgress(10, `Fetching ${detectedFormat} file from ${url}`);
9523
- const fetchTask = context.own(new FetchUrlTask({
10114
+ const fetchTask = context.own(new FetchUrlTask({ queue: false }));
10115
+ const response = await fetchTask.run({
9524
10116
  url,
9525
10117
  response_type: responseType
9526
- }, {
9527
- queue: false
9528
- }));
9529
- const response = await fetchTask.run();
10118
+ });
9530
10119
  if (context.signal.aborted) {
9531
- throw new TaskAbortedError2("Task aborted");
10120
+ throw new TaskAbortedError4("Task aborted");
9532
10121
  }
9533
10122
  await context.updateProgress(60, "Parsing file content");
9534
10123
  const title = url.split("/").pop() || url;
9535
10124
  const { text, json: json2, csv, image, pdf, frontmatter, size, mimeType } = await this.parseResponse(response, url, detectedFormat);
9536
10125
  if (context.signal.aborted) {
9537
- throw new TaskAbortedError2("Task aborted");
10126
+ throw new TaskAbortedError4("Task aborted");
9538
10127
  }
9539
10128
  await context.updateProgress(100, "File loaded successfully");
9540
10129
  return {
@@ -9857,7 +10446,7 @@ class FileLoaderTask extends Task49 {
9857
10446
  });
9858
10447
  }
9859
10448
  }
9860
- Workflow51.prototype.fileLoader = CreateWorkflow50(FileLoaderTask);
10449
+ Workflow53.prototype.fileLoader = CreateWorkflow52(FileLoaderTask);
9861
10450
 
9862
10451
  // src/task/FileLoaderTask.server.ts
9863
10452
  class FileLoaderTask2 extends FileLoaderTask {
@@ -9867,7 +10456,7 @@ class FileLoaderTask2 extends FileLoaderTask {
9867
10456
  return super.execute(input2, context);
9868
10457
  }
9869
10458
  if (context.signal.aborted) {
9870
- throw new TaskAbortedError3("Task aborted");
10459
+ throw new TaskAbortedError5("Task aborted");
9871
10460
  }
9872
10461
  await context.updateProgress(0, "Detecting file format");
9873
10462
  if (url.startsWith("file://")) {
@@ -9876,19 +10465,19 @@ class FileLoaderTask2 extends FileLoaderTask {
9876
10465
  const detectedFormat = this.detectFormat(url, format);
9877
10466
  const title = url.split("/").pop() || url;
9878
10467
  if (context.signal.aborted) {
9879
- throw new TaskAbortedError3("Task aborted");
10468
+ throw new TaskAbortedError5("Task aborted");
9880
10469
  }
9881
10470
  await context.updateProgress(10, `Reading ${detectedFormat} file from filesystem`);
9882
10471
  if (detectedFormat === "json") {
9883
10472
  const fileContent2 = await readFile(url, { encoding: "utf-8" });
9884
10473
  if (context.signal.aborted) {
9885
- throw new TaskAbortedError3("Task aborted");
10474
+ throw new TaskAbortedError5("Task aborted");
9886
10475
  }
9887
10476
  await context.updateProgress(50, "Parsing JSON content");
9888
10477
  const jsonData = this.parseJsonContent(fileContent2);
9889
10478
  const content = JSON.stringify(jsonData, null, 2);
9890
10479
  if (context.signal.aborted) {
9891
- throw new TaskAbortedError3("Task aborted");
10480
+ throw new TaskAbortedError5("Task aborted");
9892
10481
  }
9893
10482
  await context.updateProgress(100, "File loaded successfully");
9894
10483
  return {
@@ -9913,12 +10502,12 @@ class FileLoaderTask2 extends FileLoaderTask {
9913
10502
  throw new Error(`Failed to load CSV from ${url}`);
9914
10503
  }
9915
10504
  if (context.signal.aborted) {
9916
- throw new TaskAbortedError3("Task aborted");
10505
+ throw new TaskAbortedError5("Task aborted");
9917
10506
  }
9918
10507
  await context.updateProgress(50, "Parsing CSV content");
9919
10508
  const csvData = this.parseCsvContent(fileContent2);
9920
10509
  if (context.signal.aborted) {
9921
- throw new TaskAbortedError3("Task aborted");
10510
+ throw new TaskAbortedError5("Task aborted");
9922
10511
  }
9923
10512
  await context.updateProgress(100, "File loaded successfully");
9924
10513
  return {
@@ -9940,14 +10529,14 @@ class FileLoaderTask2 extends FileLoaderTask {
9940
10529
  if (detectedFormat === "image") {
9941
10530
  const fileBuffer = await readFile(url);
9942
10531
  if (context.signal.aborted) {
9943
- throw new TaskAbortedError3("Task aborted");
10532
+ throw new TaskAbortedError5("Task aborted");
9944
10533
  }
9945
10534
  await context.updateProgress(50, "Converting image to base64");
9946
10535
  const mimeType2 = this.getImageMimeType(url);
9947
10536
  const blob = new Blob([fileBuffer], { type: mimeType2 });
9948
10537
  const imageData = await this.blobToBase64DataURL(blob, mimeType2);
9949
10538
  if (context.signal.aborted) {
9950
- throw new TaskAbortedError3("Task aborted");
10539
+ throw new TaskAbortedError5("Task aborted");
9951
10540
  }
9952
10541
  await context.updateProgress(100, "File loaded successfully");
9953
10542
  return {
@@ -9969,14 +10558,14 @@ class FileLoaderTask2 extends FileLoaderTask {
9969
10558
  if (detectedFormat === "pdf") {
9970
10559
  const fileBuffer = await readFile(url);
9971
10560
  if (context.signal.aborted) {
9972
- throw new TaskAbortedError3("Task aborted");
10561
+ throw new TaskAbortedError5("Task aborted");
9973
10562
  }
9974
10563
  await context.updateProgress(50, "Converting PDF to base64");
9975
10564
  const mimeType2 = "application/pdf";
9976
10565
  const blob = new Blob([fileBuffer], { type: mimeType2 });
9977
10566
  const pdfData = await this.blobToBase64DataURL(blob, mimeType2);
9978
10567
  if (context.signal.aborted) {
9979
- throw new TaskAbortedError3("Task aborted");
10568
+ throw new TaskAbortedError5("Task aborted");
9980
10569
  }
9981
10570
  await context.updateProgress(100, "File loaded successfully");
9982
10571
  return {
@@ -10000,12 +10589,12 @@ class FileLoaderTask2 extends FileLoaderTask {
10000
10589
  throw new Error(`Failed to load content from ${url}`);
10001
10590
  }
10002
10591
  if (context.signal.aborted) {
10003
- throw new TaskAbortedError3("Task aborted");
10592
+ throw new TaskAbortedError5("Task aborted");
10004
10593
  }
10005
10594
  await context.updateProgress(50, `Parsing ${detectedFormat} content`);
10006
10595
  const mimeType = detectedFormat === "markdown" ? "text/markdown" : detectedFormat === "html" ? "text/html" : "text/plain";
10007
10596
  if (context.signal.aborted) {
10008
- throw new TaskAbortedError3("Task aborted");
10597
+ throw new TaskAbortedError5("Task aborted");
10009
10598
  }
10010
10599
  await context.updateProgress(100, "File loaded successfully");
10011
10600
  if (detectedFormat === "markdown") {
@@ -10044,9 +10633,9 @@ class FileLoaderTask2 extends FileLoaderTask {
10044
10633
  }
10045
10634
  }
10046
10635
  var fileLoader = (input2, config) => {
10047
- return new FileLoaderTask2({}, config).run(input2);
10636
+ return new FileLoaderTask2(config).run(input2);
10048
10637
  };
10049
- Workflow52.prototype.fileLoader = CreateWorkflow51(FileLoaderTask2);
10638
+ Workflow54.prototype.fileLoader = CreateWorkflow53(FileLoaderTask2);
10050
10639
 
10051
10640
  // src/bun.ts
10052
10641
  import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";
@@ -10070,6 +10659,7 @@ export {
10070
10659
  setGlobalMcpServerRepository,
10071
10660
  searchMcpRegistryPage,
10072
10661
  searchMcpRegistry,
10662
+ resolveHumanConnector,
10073
10663
  resolveAuthSecrets,
10074
10664
  registerMcpTaskDeps,
10075
10665
  registerMcpServer,
@@ -10147,6 +10737,7 @@ export {
10147
10737
  McpResourceReadTask,
10148
10738
  McpPromptGetTask,
10149
10739
  McpListTask,
10740
+ McpElicitationConnector,
10150
10741
  MCP_TASK_DEPS,
10151
10742
  MCP_SERVER_REPOSITORY,
10152
10743
  MCP_SERVERS,
@@ -10156,6 +10747,9 @@ export {
10156
10747
  JavaScriptTask,
10157
10748
  InputTask,
10158
10749
  InMemoryMcpServerRepository,
10750
+ HumanInputTask,
10751
+ HumanApprovalTask,
10752
+ HUMAN_CONNECTOR,
10159
10753
  FileLoaderTask2 as FileLoaderTask,
10160
10754
  FetchUrlTask,
10161
10755
  FetchUrlJob,
@@ -10166,4 +10760,4 @@ export {
10166
10760
  ArrayTask
10167
10761
  };
10168
10762
 
10169
- //# debugId=3039619901B143F864756E2164756E21
10763
+ //# debugId=DC14AA49C50E3BA564756E2164756E21