@eventcatalog/sdk 2.22.0 → 2.23.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.
package/dist/index.js CHANGED
@@ -34,7 +34,7 @@ __export(src_exports, {
34
34
  default: () => src_default
35
35
  });
36
36
  module.exports = __toCommonJS(src_exports);
37
- var import_node_path23 = require("path");
37
+ var import_node_path24 = require("path");
38
38
 
39
39
  // src/dsl/utils.ts
40
40
  var import_glob = require("glob");
@@ -1179,6 +1179,15 @@ var writeEventToService = (directory) => async (event, service, options = { path
1179
1179
  pathForEvent = (0, import_node_path4.join)(pathForEvent, event.id);
1180
1180
  await writeResource(directory, { ...event }, { ...options, path: pathForEvent, type: "event" });
1181
1181
  };
1182
+ var writeEventToAgent = (directory) => async (event, agent, options = { path: "", format: "mdx", override: false }) => {
1183
+ const resourcePath = await getResourcePath(directory, agent.id, agent.version);
1184
+ if (!resourcePath) {
1185
+ throw new Error("Agent not found");
1186
+ }
1187
+ let pathForEvent = agent.version && agent.version !== "latest" ? `${resourcePath.directory}/versioned/${agent.version}/events` : `${resourcePath.directory}/events`;
1188
+ pathForEvent = (0, import_node_path4.join)(pathForEvent, event.id);
1189
+ await writeResource(directory, { ...event }, { ...options, path: pathForEvent, type: "event" });
1190
+ };
1182
1191
  var rmEvent = (directory) => async (path8) => {
1183
1192
  await import_promises2.default.rm((0, import_node_path4.join)(directory, path8), { recursive: true });
1184
1193
  invalidateFileCache();
@@ -1219,6 +1228,15 @@ var writeCommandToService = (directory) => async (command, service, options = {
1219
1228
  pathForCommand = (0, import_node_path5.join)(pathForCommand, command.id);
1220
1229
  await writeResource(directory, { ...command }, { ...options, path: pathForCommand, type: "command" });
1221
1230
  };
1231
+ var writeCommandToAgent = (directory) => async (command, agent, options = { path: "", format: "mdx", override: false }) => {
1232
+ const resourcePath = await getResourcePath(directory, agent.id, agent.version);
1233
+ if (!resourcePath) {
1234
+ throw new Error("Agent not found");
1235
+ }
1236
+ let pathForCommand = agent.version && agent.version !== "latest" ? `${resourcePath.directory}/versioned/${agent.version}/commands` : `${resourcePath.directory}/commands`;
1237
+ pathForCommand = (0, import_node_path5.join)(pathForCommand, command.id);
1238
+ await writeResource(directory, { ...command }, { ...options, path: pathForCommand, type: "command" });
1239
+ };
1222
1240
  var rmCommand = (directory) => async (path8) => {
1223
1241
  await import_promises3.default.rm((0, import_node_path5.join)(directory, path8), { recursive: true });
1224
1242
  invalidateFileCache();
@@ -1257,6 +1275,15 @@ var writeQueryToService = (directory) => async (query, service, options = { path
1257
1275
  pathForQuery = (0, import_node_path6.join)(pathForQuery, query.id);
1258
1276
  await writeResource(directory, { ...query }, { ...options, path: pathForQuery, type: "query" });
1259
1277
  };
1278
+ var writeQueryToAgent = (directory) => async (query, agent, options = { path: "", format: "mdx", override: false }) => {
1279
+ const resourcePath = await getResourcePath(directory, agent.id, agent.version);
1280
+ if (!resourcePath) {
1281
+ throw new Error("Agent not found");
1282
+ }
1283
+ let pathForQuery = agent.version && agent.version !== "latest" ? `${resourcePath.directory}/versioned/${agent.version}/queries` : `${resourcePath.directory}/queries`;
1284
+ pathForQuery = (0, import_node_path6.join)(pathForQuery, query.id);
1285
+ await writeResource(directory, { ...query }, { ...options, path: pathForQuery, type: "query" });
1286
+ };
1260
1287
  var rmQuery = (directory) => async (path8) => {
1261
1288
  await import_promises4.default.rm((0, import_node_path6.join)(directory, path8), { recursive: true });
1262
1289
  invalidateFileCache();
@@ -1467,9 +1494,146 @@ var addDataStoreToService = (directory) => async (id, operation, dataStore, vers
1467
1494
  await writeService(pathToResource)(service, { format: extension === ".md" ? "md" : "mdx" });
1468
1495
  };
1469
1496
 
1470
- // src/domains.ts
1497
+ // src/agents.ts
1471
1498
  var import_promises6 = __toESM(require("fs/promises"));
1472
- var import_node_path8 = __toESM(require("path"));
1499
+ var import_node_path8 = require("path");
1500
+ var rewriteAgent = async (directory, id, agent, version) => {
1501
+ const agentPath = await getResourcePath(directory, id, version);
1502
+ if (!agentPath) {
1503
+ throw new Error(`Cannot find agent ${id} in the catalog`);
1504
+ }
1505
+ const extension = (0, import_node_path8.extname)(agentPath.fullPath);
1506
+ await rmAgentById(directory)(id, version, true);
1507
+ await writeAgent(directory)(agent, { path: agentPath.directory, format: extension === ".md" ? "md" : "mdx" });
1508
+ };
1509
+ var getAgent = (directory) => async (id, version) => getResource(directory, id, version, { type: "agent" });
1510
+ var getAgentByPath = (directory) => async (path8) => {
1511
+ const agent = await getResource(directory, void 0, void 0, { type: "agent" }, path8);
1512
+ return agent;
1513
+ };
1514
+ var getAgents = (directory) => async (options) => getResources(directory, {
1515
+ type: "agents",
1516
+ ignore: [
1517
+ "**/events/**",
1518
+ "**/commands/**",
1519
+ "**/queries/**",
1520
+ "**/entities/**",
1521
+ "**/channels/**",
1522
+ "**/containers/**",
1523
+ "**/data-products/**",
1524
+ "**/data-stores/**",
1525
+ "**/flows/**"
1526
+ ],
1527
+ ...options
1528
+ });
1529
+ var writeAgent = (directory) => async (agent, options = {
1530
+ path: "",
1531
+ override: false,
1532
+ format: "mdx"
1533
+ }) => {
1534
+ const resource = { ...agent };
1535
+ if (Array.isArray(agent.sends)) {
1536
+ resource.sends = uniqueVersions(agent.sends);
1537
+ }
1538
+ if (Array.isArray(agent.receives)) {
1539
+ resource.receives = uniqueVersions(agent.receives);
1540
+ }
1541
+ return await writeResource(directory, resource, { ...options, type: "agent" });
1542
+ };
1543
+ var writeVersionedAgent = (directory) => async (agent) => {
1544
+ const path8 = getVersionedDirectory(agent.id, agent.version);
1545
+ return await writeAgent(directory)({ ...agent }, { path: path8 });
1546
+ };
1547
+ var writeAgentToDomain = (directory) => async (agent, domain, options = { path: "", format: "mdx", override: false }) => {
1548
+ let pathForAgent = domain.version && domain.version !== "latest" ? `/${domain.id}/versioned/${domain.version}/agents` : `/${domain.id}/agents`;
1549
+ pathForAgent = (0, import_node_path8.join)(pathForAgent, agent.id);
1550
+ await writeResource(directory, { ...agent }, { ...options, path: pathForAgent, type: "agent" });
1551
+ };
1552
+ var versionAgent = (directory) => async (id) => versionResource(directory, id);
1553
+ var rmAgent = (directory) => async (path8) => {
1554
+ await import_promises6.default.rm((0, import_node_path8.join)(directory, path8), { recursive: true });
1555
+ invalidateFileCache();
1556
+ };
1557
+ var rmAgentById = (directory) => async (id, version, persistFiles) => {
1558
+ await rmResourceById(directory, id, version, { type: "agent", persistFiles });
1559
+ };
1560
+ var addFileToAgent = (directory) => async (id, file, version) => addFileToResource(directory, id, file, version);
1561
+ var addMessageToAgent = (directory) => async (id, direction, message, version) => {
1562
+ const agent = await getAgent(directory)(id, version);
1563
+ if (direction === "sends") {
1564
+ if (agent.sends === void 0) {
1565
+ agent.sends = [];
1566
+ }
1567
+ for (let i = 0; i < agent.sends.length; i++) {
1568
+ if (agent.sends[i].id === message.id && agent.sends[i].version === message.version) {
1569
+ return;
1570
+ }
1571
+ }
1572
+ agent.sends.push(buildMessagePointer(message));
1573
+ } else if (direction === "receives") {
1574
+ if (agent.receives === void 0) {
1575
+ agent.receives = [];
1576
+ }
1577
+ for (let i = 0; i < agent.receives.length; i++) {
1578
+ if (agent.receives[i].id === message.id && agent.receives[i].version === message.version) {
1579
+ return;
1580
+ }
1581
+ }
1582
+ agent.receives.push(buildMessagePointer(message));
1583
+ } else {
1584
+ throw new Error(`Direction ${direction} is invalid, only 'receives' and 'sends' are supported`);
1585
+ }
1586
+ await rewriteAgent(directory, id, agent, version);
1587
+ };
1588
+ var addDataStoreToAgent = (directory) => async (id, direction, dataStore, version) => {
1589
+ const agent = await getAgent(directory)(id, version);
1590
+ if (direction === "writesTo") {
1591
+ if (agent.writesTo === void 0) {
1592
+ agent.writesTo = [];
1593
+ }
1594
+ if (agent.writesTo.some((store) => store.id === dataStore.id && store.version === dataStore.version)) {
1595
+ return;
1596
+ }
1597
+ agent.writesTo.push(dataStore);
1598
+ } else if (direction === "readsFrom") {
1599
+ if (agent.readsFrom === void 0) {
1600
+ agent.readsFrom = [];
1601
+ }
1602
+ if (agent.readsFrom.some((store) => store.id === dataStore.id && store.version === dataStore.version)) {
1603
+ return;
1604
+ }
1605
+ agent.readsFrom.push(dataStore);
1606
+ } else {
1607
+ throw new Error(`Direction ${direction} is invalid, only 'writesTo' and 'readsFrom' are supported`);
1608
+ }
1609
+ await rewriteAgent(directory, id, agent, version);
1610
+ };
1611
+ var addFlowToAgent = (directory) => async (id, flow, version) => {
1612
+ const agent = await getAgent(directory)(id, version);
1613
+ if (agent.flows === void 0) {
1614
+ agent.flows = [];
1615
+ }
1616
+ if (agent.flows.some((f) => f.id === flow.id && f.version === flow.version)) {
1617
+ return;
1618
+ }
1619
+ agent.flows.push(flow);
1620
+ await rewriteAgent(directory, id, agent, version);
1621
+ };
1622
+ var agentHasVersion = (directory) => async (id, version) => {
1623
+ const file = await findFileById(directory, id, version);
1624
+ return !!file;
1625
+ };
1626
+ var isAgent = (directory) => async (path8) => {
1627
+ const agent = await getAgentByPath(directory)(path8);
1628
+ const relativePath = (0, import_node_path8.relative)(directory, path8);
1629
+ const segments = relativePath.split(/[/\\]+/);
1630
+ return !!agent && segments.includes("agents");
1631
+ };
1632
+ var toAgent = (directory) => async (file) => toResource(directory, file);
1633
+
1634
+ // src/domains.ts
1635
+ var import_promises7 = __toESM(require("fs/promises"));
1636
+ var import_node_path9 = __toESM(require("path"));
1473
1637
  var import_node_fs3 = __toESM(require("fs"));
1474
1638
  var import_gray_matter3 = __toESM(require("gray-matter"));
1475
1639
  var resolveDomainWriteDirectory = async (directory, id, version) => {
@@ -1486,7 +1650,15 @@ var resolveDomainWriteDirectory = async (directory, id, version) => {
1486
1650
  var getDomain = (directory) => async (id, version) => getResource(directory, id, version, { type: "domain" });
1487
1651
  var getDomains = (directory) => async (options) => getResources(directory, {
1488
1652
  type: "domains",
1489
- ignore: ["**/services/**", "**/events/**", "**/commands/**", "**/queries/**", "**/flows/**", "**/entities/**"],
1653
+ ignore: [
1654
+ "**/services/**",
1655
+ "**/agents/**",
1656
+ "**/events/**",
1657
+ "**/commands/**",
1658
+ "**/queries/**",
1659
+ "**/flows/**",
1660
+ "**/entities/**"
1661
+ ],
1490
1662
  ...options
1491
1663
  });
1492
1664
  var writeDomain = (directory) => async (domain, options = {
@@ -1499,6 +1671,9 @@ var writeDomain = (directory) => async (domain, options = {
1499
1671
  if (Array.isArray(domain.services)) {
1500
1672
  resource.services = uniqueVersions(domain.services);
1501
1673
  }
1674
+ if (Array.isArray(domain.agents)) {
1675
+ resource.agents = uniqueVersions(domain.agents);
1676
+ }
1502
1677
  if (Array.isArray(domain.domains)) {
1503
1678
  resource.domains = uniqueVersions(domain.domains);
1504
1679
  }
@@ -1515,7 +1690,7 @@ var writeDomain = (directory) => async (domain, options = {
1515
1690
  };
1516
1691
  var versionDomain = (directory) => async (id) => versionResource(directory, id);
1517
1692
  var rmDomain = (directory) => async (path8) => {
1518
- await import_promises6.default.rm((0, import_node_path8.join)(directory, path8), { recursive: true });
1693
+ await import_promises7.default.rm((0, import_node_path9.join)(directory, path8), { recursive: true });
1519
1694
  invalidateFileCache();
1520
1695
  };
1521
1696
  var rmDomainById = (directory) => async (id, version, persistFiles) => rmResourceById(directory, id, version, { type: "domain", persistFiles });
@@ -1528,7 +1703,7 @@ var addUbiquitousLanguageToDomain = (directory) => async (id, ubiquitousLanguage
1528
1703
  };
1529
1704
  var getUbiquitousLanguageFromDomain = (directory) => async (id, version) => {
1530
1705
  const pathToDomain = await findFileById(directory, id, version) || "";
1531
- const pathToUbiquitousLanguage = import_node_path8.default.join(import_node_path8.default.dirname(pathToDomain), "ubiquitous-language.mdx");
1706
+ const pathToUbiquitousLanguage = import_node_path9.default.join(import_node_path9.default.dirname(pathToDomain), "ubiquitous-language.mdx");
1532
1707
  const fileExists = import_node_fs3.default.existsSync(pathToUbiquitousLanguage);
1533
1708
  if (!fileExists) {
1534
1709
  return void 0;
@@ -1543,7 +1718,7 @@ var domainHasVersion = (directory) => async (id, version) => {
1543
1718
  var addServiceToDomain = (directory) => async (id, service, version) => {
1544
1719
  let domain = await getDomain(directory)(id, version);
1545
1720
  const domainPath = await getResourcePath(directory, id, version);
1546
- const extension = import_node_path8.default.extname(domainPath?.fullPath || "");
1721
+ const extension = import_node_path9.default.extname(domainPath?.fullPath || "");
1547
1722
  if (domain.services === void 0) {
1548
1723
  domain.services = [];
1549
1724
  }
@@ -1556,10 +1731,26 @@ var addServiceToDomain = (directory) => async (id, service, version) => {
1556
1731
  await rmDomainById(directory)(id, version, true);
1557
1732
  await writeDomain(writeDir)(domain, { format: extension === ".md" ? "md" : "mdx" });
1558
1733
  };
1734
+ var addAgentToDomain = (directory) => async (id, agent, version) => {
1735
+ let domain = await getDomain(directory)(id, version);
1736
+ const domainPath = await getResourcePath(directory, id, version);
1737
+ const extension = import_node_path9.default.extname(domainPath?.fullPath || "");
1738
+ if (domain.agents === void 0) {
1739
+ domain.agents = [];
1740
+ }
1741
+ const agentExistsInList = domain.agents.some((a) => a.id === agent.id && a.version === agent.version);
1742
+ if (agentExistsInList) {
1743
+ return;
1744
+ }
1745
+ domain.agents.push(agent);
1746
+ const writeDir = await resolveDomainWriteDirectory(directory, id, version);
1747
+ await rmDomainById(directory)(id, version, true);
1748
+ await writeDomain(writeDir)(domain, { format: extension === ".md" ? "md" : "mdx" });
1749
+ };
1559
1750
  var addSubDomainToDomain = (directory) => async (id, subDomain, version) => {
1560
1751
  let domain = await getDomain(directory)(id, version);
1561
1752
  const domainPath = await getResourcePath(directory, id, version);
1562
- const extension = import_node_path8.default.extname(domainPath?.fullPath || "");
1753
+ const extension = import_node_path9.default.extname(domainPath?.fullPath || "");
1563
1754
  if (domain.domains === void 0) {
1564
1755
  domain.domains = [];
1565
1756
  }
@@ -1575,7 +1766,7 @@ var addSubDomainToDomain = (directory) => async (id, subDomain, version) => {
1575
1766
  var addEntityToDomain = (directory) => async (id, entity, version) => {
1576
1767
  let domain = await getDomain(directory)(id, version);
1577
1768
  const domainPath = await getResourcePath(directory, id, version);
1578
- const extension = import_node_path8.default.extname(domainPath?.fullPath || "");
1769
+ const extension = import_node_path9.default.extname(domainPath?.fullPath || "");
1579
1770
  if (domain.entities === void 0) {
1580
1771
  domain.entities = [];
1581
1772
  }
@@ -1591,7 +1782,7 @@ var addEntityToDomain = (directory) => async (id, entity, version) => {
1591
1782
  var addDataProductToDomain = (directory) => async (id, dataProduct, version) => {
1592
1783
  let domain = await getDomain(directory)(id, version);
1593
1784
  const domainPath = await getResourcePath(directory, id, version);
1594
- const extension = import_node_path8.default.extname(domainPath?.fullPath || "");
1785
+ const extension = import_node_path9.default.extname(domainPath?.fullPath || "");
1595
1786
  if (domain.dataProducts === void 0) {
1596
1787
  domain.dataProducts = [];
1597
1788
  }
@@ -1609,7 +1800,7 @@ var addDataProductToDomain = (directory) => async (id, dataProduct, version) =>
1609
1800
  var addMessageToDomain = (directory) => async (id, direction, message, version) => {
1610
1801
  let domain = await getDomain(directory)(id, version);
1611
1802
  const domainPath = await getResourcePath(directory, id, version);
1612
- const extension = import_node_path8.default.extname(domainPath?.fullPath || "");
1803
+ const extension = import_node_path9.default.extname(domainPath?.fullPath || "");
1613
1804
  if (direction === "sends") {
1614
1805
  if (domain.sends === void 0) {
1615
1806
  domain.sends = [];
@@ -1639,13 +1830,13 @@ var addMessageToDomain = (directory) => async (id, direction, message, version)
1639
1830
  };
1640
1831
 
1641
1832
  // src/channels.ts
1642
- var import_promises7 = __toESM(require("fs/promises"));
1643
- var import_node_path9 = require("path");
1833
+ var import_promises8 = __toESM(require("fs/promises"));
1834
+ var import_node_path10 = require("path");
1644
1835
  var getChannel = (directory) => async (id, version) => getResource(directory, id, version, { type: "channel" });
1645
1836
  var getChannels = (directory) => async (options) => getResources(directory, { type: "channels", ...options });
1646
1837
  var writeChannel = (directory) => async (channel, options = { path: "" }) => writeResource(directory, { ...channel }, { ...options, type: "channel" });
1647
1838
  var rmChannel = (directory) => async (path8) => {
1648
- await import_promises7.default.rm((0, import_node_path9.join)(directory, path8), { recursive: true });
1839
+ await import_promises8.default.rm((0, import_node_path10.join)(directory, path8), { recursive: true });
1649
1840
  invalidateFileCache();
1650
1841
  };
1651
1842
  var rmChannelById = (directory) => async (id, version, persistFiles) => rmResourceById(directory, id, version, { type: "channel", persistFiles });
@@ -1676,7 +1867,7 @@ var addMessageToChannel = (directory, collection) => async (id, _message, versio
1676
1867
  const { getMessage: getMessage2, rmMessageById, writeMessage } = functions[collection];
1677
1868
  const message = await getMessage2(directory)(_message.id, _message.version);
1678
1869
  const messagePath = await getResourcePath(directory, _message.id, _message.version);
1679
- const extension = (0, import_node_path9.extname)(messagePath?.fullPath || "");
1870
+ const extension = (0, import_node_path10.extname)(messagePath?.fullPath || "");
1680
1871
  if (!message) throw new Error(`Message ${_message.id} with version ${_message.version} not found`);
1681
1872
  if (message.channels === void 0) {
1682
1873
  message.channels = [];
@@ -1688,18 +1879,18 @@ var addMessageToChannel = (directory, collection) => async (id, _message, versio
1688
1879
  throw new Error(`Cannot find message ${id} in the catalog`);
1689
1880
  }
1690
1881
  const path8 = existingResource.split(`/[\\/]+${collection}`)[0];
1691
- const pathToResource = (0, import_node_path9.join)(path8, collection);
1882
+ const pathToResource = (0, import_node_path10.join)(path8, collection);
1692
1883
  await rmMessageById(directory)(_message.id, _message.version, true);
1693
1884
  await writeMessage(pathToResource)(message, { format: extension === ".md" ? "md" : "mdx" });
1694
1885
  };
1695
1886
 
1696
1887
  // src/messages.ts
1697
- var import_node_path10 = require("path");
1888
+ var import_node_path11 = require("path");
1698
1889
  var import_node_fs4 = __toESM(require("fs"));
1699
1890
  var import_gray_matter4 = __toESM(require("gray-matter"));
1700
1891
  var import_semver5 = require("semver");
1701
1892
  var getMessageBySchemaPath = (directory) => async (path8, options) => {
1702
- const pathToMessage = (0, import_node_path10.dirname)(path8);
1893
+ const pathToMessage = (0, import_node_path11.dirname)(path8);
1703
1894
  try {
1704
1895
  const files = await getFiles(`${directory}/${pathToMessage}/index.{md,mdx}`);
1705
1896
  if (!files || files.length === 0) {
@@ -1725,7 +1916,10 @@ var getMessageBySchemaPath = (directory) => async (path8, options) => {
1725
1916
  }
1726
1917
  };
1727
1918
  var getProducersAndConsumersForMessage = (directory) => async (id, version, options) => {
1728
- const services = await getServices(directory)({ latestOnly: options?.latestOnly ?? true });
1919
+ const [services = [], agents = []] = await Promise.all([
1920
+ getServices(directory)({ latestOnly: options?.latestOnly ?? true }),
1921
+ getAgents(directory)({ latestOnly: options?.latestOnly ?? true })
1922
+ ]);
1729
1923
  const message = await getResource(directory, id, version, { type: "message" });
1730
1924
  const isMessageLatestVersion = await isLatestVersion(directory, id, version);
1731
1925
  if (!message) {
@@ -1733,11 +1927,11 @@ var getProducersAndConsumersForMessage = (directory) => async (id, version, opti
1733
1927
  }
1734
1928
  const producers = [];
1735
1929
  const consumers = [];
1736
- for (const service of services) {
1737
- const servicePublishesMessage = service.sends?.some((_message) => {
1930
+ for (const participant of [...services, ...agents]) {
1931
+ const participantPublishesMessage = participant.sends?.some((_message) => {
1738
1932
  if (_message.version) {
1739
- const isServiceUsingSemverRange = (0, import_semver5.validRange)(_message.version);
1740
- if (isServiceUsingSemverRange) {
1933
+ const isParticipantUsingSemverRange = (0, import_semver5.validRange)(_message.version);
1934
+ if (isParticipantUsingSemverRange) {
1741
1935
  return _message.id === message.id && (0, import_semver5.satisfies)(message.version, _message.version);
1742
1936
  } else {
1743
1937
  return _message.id === message.id && message.version === _message.version;
@@ -1748,10 +1942,10 @@ var getProducersAndConsumersForMessage = (directory) => async (id, version, opti
1748
1942
  }
1749
1943
  return false;
1750
1944
  });
1751
- const serviceSubscribesToMessage = service.receives?.some((_message) => {
1945
+ const participantSubscribesToMessage = participant.receives?.some((_message) => {
1752
1946
  if (_message.version) {
1753
- const isServiceUsingSemverRange = (0, import_semver5.validRange)(_message.version);
1754
- if (isServiceUsingSemverRange) {
1947
+ const isParticipantUsingSemverRange = (0, import_semver5.validRange)(_message.version);
1948
+ if (isParticipantUsingSemverRange) {
1755
1949
  return _message.id === message.id && (0, import_semver5.satisfies)(message.version, _message.version);
1756
1950
  } else {
1757
1951
  return _message.id === message.id && message.version === _message.version;
@@ -1762,11 +1956,11 @@ var getProducersAndConsumersForMessage = (directory) => async (id, version, opti
1762
1956
  }
1763
1957
  return false;
1764
1958
  });
1765
- if (servicePublishesMessage) {
1766
- producers.push(service);
1959
+ if (participantPublishesMessage) {
1960
+ producers.push(participant);
1767
1961
  }
1768
- if (serviceSubscribesToMessage) {
1769
- consumers.push(service);
1962
+ if (participantSubscribesToMessage) {
1963
+ consumers.push(participant);
1770
1964
  }
1771
1965
  }
1772
1966
  return { producers, consumers };
@@ -1794,8 +1988,8 @@ var getSchemaForMessage = (directory) => async (id, version) => {
1794
1988
  if (!file || !import_node_fs4.default.existsSync(file)) return void 0;
1795
1989
  const { data } = import_gray_matter4.default.read(file);
1796
1990
  if (!data.schemaPath) return void 0;
1797
- const resourceDirectory = (0, import_node_path10.dirname)(file);
1798
- const pathToSchema = (0, import_node_path10.join)(resourceDirectory, data.schemaPath);
1991
+ const resourceDirectory = (0, import_node_path11.dirname)(file);
1992
+ const pathToSchema = (0, import_node_path11.join)(resourceDirectory, data.schemaPath);
1799
1993
  if (!import_node_fs4.default.existsSync(pathToSchema)) return void 0;
1800
1994
  const schema = import_node_fs4.default.readFileSync(pathToSchema, "utf8");
1801
1995
  return {
@@ -1805,13 +1999,13 @@ var getSchemaForMessage = (directory) => async (id, version) => {
1805
1999
  };
1806
2000
 
1807
2001
  // src/custom-docs.ts
1808
- var import_node_path11 = __toESM(require("path"));
2002
+ var import_node_path12 = __toESM(require("path"));
1809
2003
  var import_node_fs5 = __toESM(require("fs"));
1810
- var import_promises8 = __toESM(require("fs/promises"));
2004
+ var import_promises9 = __toESM(require("fs/promises"));
1811
2005
  var import_gray_matter5 = __toESM(require("gray-matter"));
1812
2006
  var import_slugify = __toESM(require("slugify"));
1813
2007
  var getCustomDoc = (directory) => async (filePath) => {
1814
- const fullPath = import_node_path11.default.join(directory, filePath);
2008
+ const fullPath = import_node_path12.default.join(directory, filePath);
1815
2009
  const fullPathWithExtension = fullPath.endsWith(".mdx") ? fullPath : `${fullPath}.mdx`;
1816
2010
  const fileExists = import_node_fs5.default.existsSync(fullPathWithExtension);
1817
2011
  if (!fileExists) {
@@ -1830,28 +2024,28 @@ var writeCustomDoc = (directory) => async (customDoc, options = { path: "" }) =>
1830
2024
  const { fileName, ...rest } = customDoc;
1831
2025
  const name = fileName || (0, import_slugify.default)(customDoc.title, { lower: true });
1832
2026
  const withExtension = name.endsWith(".mdx") ? name : `${name}.mdx`;
1833
- const fullPath = import_node_path11.default.join(directory, options.path || "", withExtension);
1834
- import_node_fs5.default.mkdirSync(import_node_path11.default.dirname(fullPath), { recursive: true });
2027
+ const fullPath = import_node_path12.default.join(directory, options.path || "", withExtension);
2028
+ import_node_fs5.default.mkdirSync(import_node_path12.default.dirname(fullPath), { recursive: true });
1835
2029
  const document = import_gray_matter5.default.stringify(customDoc.markdown.trim(), rest);
1836
2030
  import_node_fs5.default.writeFileSync(fullPath, document);
1837
2031
  invalidateFileCache();
1838
2032
  };
1839
2033
  var rmCustomDoc = (directory) => async (filePath) => {
1840
2034
  const withExtension = filePath.endsWith(".mdx") ? filePath : `${filePath}.mdx`;
1841
- await import_promises8.default.rm((0, import_node_path11.join)(directory, withExtension), { recursive: true });
2035
+ await import_promises9.default.rm((0, import_node_path12.join)(directory, withExtension), { recursive: true });
1842
2036
  invalidateFileCache();
1843
2037
  };
1844
2038
 
1845
2039
  // src/teams.ts
1846
- var import_promises9 = __toESM(require("fs/promises"));
2040
+ var import_promises10 = __toESM(require("fs/promises"));
1847
2041
  var import_node_fs7 = __toESM(require("fs"));
1848
- var import_node_path13 = require("path");
2042
+ var import_node_path14 = require("path");
1849
2043
  var import_gray_matter7 = __toESM(require("gray-matter"));
1850
- var import_node_path14 = __toESM(require("path"));
2044
+ var import_node_path15 = __toESM(require("path"));
1851
2045
 
1852
2046
  // src/users.ts
1853
2047
  var import_node_fs6 = __toESM(require("fs"));
1854
- var import_node_path12 = require("path");
2048
+ var import_node_path13 = require("path");
1855
2049
  var import_gray_matter6 = __toESM(require("gray-matter"));
1856
2050
  var getUser = (catalogDir) => async (id) => {
1857
2051
  const files = await getFiles(`${catalogDir}/${id}.{md,mdx}`);
@@ -1889,12 +2083,12 @@ var writeUser = (catalogDir) => async (user, options = {}) => {
1889
2083
  }
1890
2084
  const { markdown, ...frontmatter } = resource;
1891
2085
  const document = import_gray_matter6.default.stringify(markdown, frontmatter);
1892
- import_node_fs6.default.mkdirSync((0, import_node_path12.join)(catalogDir, ""), { recursive: true });
1893
- import_node_fs6.default.writeFileSync((0, import_node_path12.join)(catalogDir, "", `${resource.id}.mdx`), document);
2086
+ import_node_fs6.default.mkdirSync((0, import_node_path13.join)(catalogDir, ""), { recursive: true });
2087
+ import_node_fs6.default.writeFileSync((0, import_node_path13.join)(catalogDir, "", `${resource.id}.mdx`), document);
1894
2088
  invalidateFileCache();
1895
2089
  };
1896
2090
  var rmUserById = (catalogDir) => async (id) => {
1897
- import_node_fs6.default.rmSync((0, import_node_path12.join)(catalogDir, `${id}.mdx`), { recursive: true });
2091
+ import_node_fs6.default.rmSync((0, import_node_path13.join)(catalogDir, `${id}.mdx`), { recursive: true });
1898
2092
  invalidateFileCache();
1899
2093
  };
1900
2094
 
@@ -1933,12 +2127,12 @@ var writeTeam = (catalogDir) => async (team, options = {}) => {
1933
2127
  }
1934
2128
  const { markdown, ...frontmatter } = resource;
1935
2129
  const document = import_gray_matter7.default.stringify(markdown, frontmatter);
1936
- import_node_fs7.default.mkdirSync((0, import_node_path13.join)(catalogDir, ""), { recursive: true });
1937
- import_node_fs7.default.writeFileSync((0, import_node_path13.join)(catalogDir, "", `${resource.id}.mdx`), document);
2130
+ import_node_fs7.default.mkdirSync((0, import_node_path14.join)(catalogDir, ""), { recursive: true });
2131
+ import_node_fs7.default.writeFileSync((0, import_node_path14.join)(catalogDir, "", `${resource.id}.mdx`), document);
1938
2132
  invalidateFileCache();
1939
2133
  };
1940
2134
  var rmTeamById = (catalogDir) => async (id) => {
1941
- await import_promises9.default.rm((0, import_node_path13.join)(catalogDir, `${id}.mdx`), { recursive: true });
2135
+ await import_promises10.default.rm((0, import_node_path14.join)(catalogDir, `${id}.mdx`), { recursive: true });
1942
2136
  invalidateFileCache();
1943
2137
  };
1944
2138
  var getOwnersForResource = (catalogDir) => async (id, version) => {
@@ -1947,11 +2141,11 @@ var getOwnersForResource = (catalogDir) => async (id, version) => {
1947
2141
  if (!resource) return [];
1948
2142
  if (!resource.owners) return [];
1949
2143
  for (const owner of resource.owners) {
1950
- const team = await getTeam(import_node_path14.default.join(catalogDir, "teams"))(owner);
2144
+ const team = await getTeam(import_node_path15.default.join(catalogDir, "teams"))(owner);
1951
2145
  if (team) {
1952
2146
  owners.push(team);
1953
2147
  } else {
1954
- const user = await getUser(import_node_path14.default.join(catalogDir, "users"))(owner);
2148
+ const user = await getUser(import_node_path15.default.join(catalogDir, "users"))(owner);
1955
2149
  if (user) {
1956
2150
  owners.push(user);
1957
2151
  }
@@ -1962,11 +2156,11 @@ var getOwnersForResource = (catalogDir) => async (id, version) => {
1962
2156
 
1963
2157
  // src/eventcatalog.ts
1964
2158
  var import_fs = __toESM(require("fs"));
1965
- var import_node_path15 = __toESM(require("path"));
2159
+ var import_node_path16 = __toESM(require("path"));
1966
2160
  var DUMP_VERSION = "0.0.1";
1967
2161
  var getEventCatalogVersion = async (catalogDir) => {
1968
2162
  try {
1969
- const packageJson = import_fs.default.readFileSync((0, import_node_path15.join)(catalogDir, "package.json"), "utf8");
2163
+ const packageJson = import_fs.default.readFileSync((0, import_node_path16.join)(catalogDir, "package.json"), "utf8");
1970
2164
  const packageJsonObject = JSON.parse(packageJson);
1971
2165
  return packageJsonObject["dependencies"]["@eventcatalog/core"];
1972
2166
  } catch (error) {
@@ -1979,7 +2173,7 @@ var hydrateResource = async (catalogDir, resources = [], { attachSchema = false
1979
2173
  const resourcePath = await getResourcePath(catalogDir, resource.id, resource.version);
1980
2174
  let schema = "";
1981
2175
  if (resource.schemaPath && resourcePath?.fullPath) {
1982
- const pathToSchema = import_node_path15.default.join(import_node_path15.default.dirname(resourcePath?.fullPath), resource.schemaPath);
2176
+ const pathToSchema = import_node_path16.default.join(import_node_path16.default.dirname(resourcePath?.fullPath), resource.schemaPath);
1983
2177
  if (import_fs.default.existsSync(pathToSchema)) {
1984
2178
  schema = import_fs.default.readFileSync(pathToSchema, "utf8");
1985
2179
  }
@@ -2000,7 +2194,7 @@ var filterCollection = (collection, options) => {
2000
2194
  };
2001
2195
  var getEventCatalogConfigurationFile = (directory) => async () => {
2002
2196
  try {
2003
- const path8 = (0, import_node_path15.join)(directory, "eventcatalog.config.js");
2197
+ const path8 = (0, import_node_path16.join)(directory, "eventcatalog.config.js");
2004
2198
  const configModule = await import(path8);
2005
2199
  return configModule.default;
2006
2200
  } catch (error) {
@@ -2012,6 +2206,7 @@ var dumpCatalog = (directory) => async (options) => {
2012
2206
  const {
2013
2207
  getDomains: getDomains2,
2014
2208
  getServices: getServices2,
2209
+ getAgents: getAgents2,
2015
2210
  getEvents: getEvents2,
2016
2211
  getQueries: getQueries2,
2017
2212
  getCommands: getCommands2,
@@ -2025,6 +2220,7 @@ var dumpCatalog = (directory) => async (options) => {
2025
2220
  const { includeMarkdown = true } = options || {};
2026
2221
  const domains = await getDomains2();
2027
2222
  const services = await getServices2();
2223
+ const agents = await getAgents2();
2028
2224
  const events = await getEvents2();
2029
2225
  const commands = await getCommands2();
2030
2226
  const queries = await getQueries2();
@@ -2037,6 +2233,7 @@ var dumpCatalog = (directory) => async (options) => {
2037
2233
  const [
2038
2234
  hydratedDomains,
2039
2235
  hydratedServices,
2236
+ hydratedAgents,
2040
2237
  hydratedEvents,
2041
2238
  hydratedQueries,
2042
2239
  hydratedCommands,
@@ -2049,6 +2246,7 @@ var dumpCatalog = (directory) => async (options) => {
2049
2246
  ] = await Promise.all([
2050
2247
  hydrateResource(directory, domains),
2051
2248
  hydrateResource(directory, services),
2249
+ hydrateResource(directory, agents),
2052
2250
  hydrateResource(directory, events),
2053
2251
  hydrateResource(directory, queries),
2054
2252
  hydrateResource(directory, commands),
@@ -2066,6 +2264,7 @@ var dumpCatalog = (directory) => async (options) => {
2066
2264
  resources: {
2067
2265
  domains: filterCollection(hydratedDomains, { includeMarkdown }),
2068
2266
  services: filterCollection(hydratedServices, { includeMarkdown }),
2267
+ agents: filterCollection(hydratedAgents, { includeMarkdown }),
2069
2268
  messages: {
2070
2269
  events: filterCollection(hydratedEvents, { includeMarkdown }),
2071
2270
  queries: filterCollection(hydratedQueries, { includeMarkdown }),
@@ -2083,7 +2282,7 @@ var dumpCatalog = (directory) => async (options) => {
2083
2282
 
2084
2283
  // src/snapshots.ts
2085
2284
  var import_node_fs8 = __toESM(require("fs"));
2086
- var import_node_path16 = __toESM(require("path"));
2285
+ var import_node_path17 = __toESM(require("path"));
2087
2286
  var import_node_crypto = require("crypto");
2088
2287
  var import_node_child_process = require("child_process");
2089
2288
  var import_semver6 = require("semver");
@@ -2113,6 +2312,7 @@ var flattenResources = (snapshot) => {
2113
2312
  };
2114
2313
  addResources(snapshot.resources.domains, "domain");
2115
2314
  addResources(snapshot.resources.services, "service");
2315
+ addResources(snapshot.resources.agents || [], "agent");
2116
2316
  addResources(snapshot.resources.messages.events, "event");
2117
2317
  addResources(snapshot.resources.messages.commands, "command");
2118
2318
  addResources(snapshot.resources.messages.queries, "query");
@@ -2224,7 +2424,7 @@ var getRelationshipKey = (serviceId, resourceId, resourceVersion, direction) =>
2224
2424
  };
2225
2425
  var extractRelationships = (snapshot) => {
2226
2426
  const relationships = /* @__PURE__ */ new Map();
2227
- for (const service of snapshot.resources.services) {
2427
+ for (const service of [...snapshot.resources.services, ...snapshot.resources.agents || []]) {
2228
2428
  for (const direction of ["sends", "receives"]) {
2229
2429
  const pointers = service[direction] || [];
2230
2430
  for (const pointer of pointers) {
@@ -2262,7 +2462,7 @@ var computeRelationshipDiff = (snapshotA, snapshotB) => {
2262
2462
  var SNAPSHOT_VERSION = "1.0.0";
2263
2463
  var getEventCatalogVersion2 = (catalogDir) => {
2264
2464
  try {
2265
- const packageJson = import_node_fs8.default.readFileSync(import_node_path16.default.join(catalogDir, "package.json"), "utf8");
2465
+ const packageJson = import_node_fs8.default.readFileSync(import_node_path17.default.join(catalogDir, "package.json"), "utf8");
2266
2466
  const packageJsonObject = JSON.parse(packageJson);
2267
2467
  return packageJsonObject["dependencies"]?.["@eventcatalog/core"] ?? "unknown";
2268
2468
  } catch {
@@ -2318,9 +2518,10 @@ var createSnapshot = (directory) => {
2318
2518
  return async (options) => {
2319
2519
  const { label, outputDir, git } = options || {};
2320
2520
  const sdk = src_default(directory);
2321
- const [domains, services, events, commands, queries, channels] = await Promise.all([
2521
+ const [domains, services, agents, events, commands, queries, channels] = await Promise.all([
2322
2522
  sdk.getDomains(),
2323
2523
  sdk.getServices(),
2524
+ sdk.getAgents(),
2324
2525
  sdk.getEvents(),
2325
2526
  sdk.getCommands(),
2326
2527
  sdk.getQueries(),
@@ -2333,6 +2534,7 @@ var createSnapshot = (directory) => {
2333
2534
  ]);
2334
2535
  const snapshotDomains = stripToCore(domains);
2335
2536
  const snapshotServices = stripToCore(services);
2537
+ const snapshotAgents = stripToCore(agents);
2336
2538
  const snapshotEvents = stripToCore(events);
2337
2539
  const snapshotCommands = stripToCore(commands);
2338
2540
  const snapshotQueries = stripToCore(queries);
@@ -2348,6 +2550,7 @@ var createSnapshot = (directory) => {
2348
2550
  resources: {
2349
2551
  domains: snapshotDomains,
2350
2552
  services: snapshotServices,
2553
+ agents: snapshotAgents,
2351
2554
  messages: {
2352
2555
  events: snapshotEvents,
2353
2556
  commands: snapshotCommands,
@@ -2356,10 +2559,10 @@ var createSnapshot = (directory) => {
2356
2559
  channels: snapshotChannels
2357
2560
  }
2358
2561
  };
2359
- const snapshotsDir = outputDir || import_node_path16.default.join(directory, ".snapshots");
2562
+ const snapshotsDir = outputDir || import_node_path17.default.join(directory, ".snapshots");
2360
2563
  import_node_fs8.default.mkdirSync(snapshotsDir, { recursive: true });
2361
2564
  const fileName = `${snapshotLabel}.snapshot.json`;
2362
- const filePath = import_node_path16.default.join(snapshotsDir, fileName);
2565
+ const filePath = import_node_path17.default.join(snapshotsDir, fileName);
2363
2566
  import_node_fs8.default.writeFileSync(filePath, JSON.stringify(snapshot));
2364
2567
  return { filePath, snapshot };
2365
2568
  };
@@ -2390,13 +2593,13 @@ var diffSnapshots = (directory) => async (snapshotAPath, snapshotBPath) => {
2390
2593
  };
2391
2594
  };
2392
2595
  var listSnapshots = (directory) => async () => {
2393
- const snapshotsDir = import_node_path16.default.join(directory, ".snapshots");
2596
+ const snapshotsDir = import_node_path17.default.join(directory, ".snapshots");
2394
2597
  if (!import_node_fs8.default.existsSync(snapshotsDir)) return [];
2395
2598
  const files = import_node_fs8.default.readdirSync(snapshotsDir).filter((f) => f.endsWith(".snapshot.json"));
2396
2599
  const snapshots = [];
2397
2600
  for (const file of files) {
2398
2601
  try {
2399
- const filePath = import_node_path16.default.join(snapshotsDir, file);
2602
+ const filePath = import_node_path17.default.join(snapshotsDir, file);
2400
2603
  const content = JSON.parse(import_node_fs8.default.readFileSync(filePath, "utf-8"));
2401
2604
  snapshots.push({
2402
2605
  label: content.label,
@@ -2411,9 +2614,9 @@ var listSnapshots = (directory) => async () => {
2411
2614
  };
2412
2615
 
2413
2616
  // src/changelogs.ts
2414
- var import_node_path17 = __toESM(require("path"));
2617
+ var import_node_path18 = __toESM(require("path"));
2415
2618
  var import_node_fs9 = __toESM(require("fs"));
2416
- var import_promises10 = __toESM(require("fs/promises"));
2619
+ var import_promises11 = __toESM(require("fs/promises"));
2417
2620
  var import_gray_matter8 = __toESM(require("gray-matter"));
2418
2621
  var writeChangelog = (catalogDir) => async (id, changelog, options = {}) => {
2419
2622
  const { version, format = "mdx" } = options;
@@ -2421,8 +2624,8 @@ var writeChangelog = (catalogDir) => async (id, changelog, options = {}) => {
2421
2624
  if (!resourceFile) {
2422
2625
  throw new Error(`No resource found with id: ${id}${version ? ` and version: ${version}` : ""}`);
2423
2626
  }
2424
- const resourceDir = (0, import_node_path17.dirname)(resourceFile);
2425
- const changelogPath = import_node_path17.default.join(resourceDir, `changelog.${format}`);
2627
+ const resourceDir = (0, import_node_path18.dirname)(resourceFile);
2628
+ const changelogPath = import_node_path18.default.join(resourceDir, `changelog.${format}`);
2426
2629
  const { markdown, ...frontmatter } = changelog;
2427
2630
  const fm = { ...frontmatter };
2428
2631
  if (fm.createdAt instanceof Date) {
@@ -2442,9 +2645,9 @@ var appendChangelog = (catalogDir) => async (id, changelog, options = {}) => {
2442
2645
  if (!resourceFile) {
2443
2646
  throw new Error(`No resource found with id: ${id}${version ? ` and version: ${version}` : ""}`);
2444
2647
  }
2445
- const resourceDir = (0, import_node_path17.dirname)(resourceFile);
2446
- const mdxPath = import_node_path17.default.join(resourceDir, "changelog.mdx");
2447
- const mdPath = import_node_path17.default.join(resourceDir, "changelog.md");
2648
+ const resourceDir = (0, import_node_path18.dirname)(resourceFile);
2649
+ const mdxPath = import_node_path18.default.join(resourceDir, "changelog.mdx");
2650
+ const mdPath = import_node_path18.default.join(resourceDir, "changelog.md");
2448
2651
  const existingPath = import_node_fs9.default.existsSync(mdxPath) ? mdxPath : import_node_fs9.default.existsSync(mdPath) ? mdPath : void 0;
2449
2652
  if (!existingPath) {
2450
2653
  return writeChangelog(catalogDir)(id, changelog, options);
@@ -2472,9 +2675,9 @@ var getChangelog = (catalogDir) => async (id, options = {}) => {
2472
2675
  const { version } = options;
2473
2676
  const resourceFile = await findFileById(catalogDir, id, version);
2474
2677
  if (!resourceFile) return void 0;
2475
- const resourceDir = (0, import_node_path17.dirname)(resourceFile);
2476
- const mdxPath = import_node_path17.default.join(resourceDir, "changelog.mdx");
2477
- const mdPath = import_node_path17.default.join(resourceDir, "changelog.md");
2678
+ const resourceDir = (0, import_node_path18.dirname)(resourceFile);
2679
+ const mdxPath = import_node_path18.default.join(resourceDir, "changelog.mdx");
2680
+ const mdPath = import_node_path18.default.join(resourceDir, "changelog.md");
2478
2681
  const changelogPath = import_node_fs9.default.existsSync(mdxPath) ? mdxPath : import_node_fs9.default.existsSync(mdPath) ? mdPath : void 0;
2479
2682
  if (!changelogPath) return void 0;
2480
2683
  const { data, content } = import_gray_matter8.default.read(changelogPath);
@@ -2486,21 +2689,21 @@ var rmChangelog = (catalogDir) => async (id, options = {}) => {
2486
2689
  if (!resourceFile) {
2487
2690
  throw new Error(`No resource found with id: ${id}${version ? ` and version: ${version}` : ""}`);
2488
2691
  }
2489
- const resourceDir = (0, import_node_path17.dirname)(resourceFile);
2490
- const mdxPath = import_node_path17.default.join(resourceDir, "changelog.mdx");
2491
- const mdPath = import_node_path17.default.join(resourceDir, "changelog.md");
2692
+ const resourceDir = (0, import_node_path18.dirname)(resourceFile);
2693
+ const mdxPath = import_node_path18.default.join(resourceDir, "changelog.mdx");
2694
+ const mdPath = import_node_path18.default.join(resourceDir, "changelog.md");
2492
2695
  if (import_node_fs9.default.existsSync(mdxPath)) {
2493
- await import_promises10.default.rm(mdxPath);
2696
+ await import_promises11.default.rm(mdxPath);
2494
2697
  }
2495
2698
  if (import_node_fs9.default.existsSync(mdPath)) {
2496
- await import_promises10.default.rm(mdPath);
2699
+ await import_promises11.default.rm(mdPath);
2497
2700
  }
2498
2701
  invalidateFileCache();
2499
2702
  };
2500
2703
 
2501
2704
  // src/entities.ts
2502
- var import_promises11 = __toESM(require("fs/promises"));
2503
- var import_node_path18 = require("path");
2705
+ var import_promises12 = __toESM(require("fs/promises"));
2706
+ var import_node_path19 = require("path");
2504
2707
  var getEntity = (directory) => async (id, version) => getResource(directory, id, version, { type: "entity" });
2505
2708
  var getEntities = (directory) => async (options) => getResources(directory, { type: "entities", latestOnly: options?.latestOnly });
2506
2709
  var writeEntity = (directory) => async (entity, options = {
@@ -2509,7 +2712,7 @@ var writeEntity = (directory) => async (entity, options = {
2509
2712
  format: "mdx"
2510
2713
  }) => writeResource(directory, { ...entity }, { ...options, type: "entity" });
2511
2714
  var rmEntity = (directory) => async (path8) => {
2512
- await import_promises11.default.rm((0, import_node_path18.join)(directory, path8), { recursive: true });
2715
+ await import_promises12.default.rm((0, import_node_path19.join)(directory, path8), { recursive: true });
2513
2716
  invalidateFileCache();
2514
2717
  };
2515
2718
  var rmEntityById = (directory) => async (id, version, persistFiles) => {
@@ -2522,8 +2725,8 @@ var entityHasVersion = (directory) => async (id, version) => {
2522
2725
  };
2523
2726
 
2524
2727
  // src/flows.ts
2525
- var import_promises12 = __toESM(require("fs/promises"));
2526
- var import_node_path19 = require("path");
2728
+ var import_promises13 = __toESM(require("fs/promises"));
2729
+ var import_node_path20 = require("path");
2527
2730
 
2528
2731
  // src/flow-builder.ts
2529
2732
  var cloneStep = (step) => ({
@@ -3005,16 +3208,21 @@ var writeVersionedFlow = (directory) => async (flow) => {
3005
3208
  };
3006
3209
  var writeFlowToDomain = (directory) => async (flow, domain, options = { path: "", format: "mdx", override: false }) => {
3007
3210
  let pathForFlow = domain.version && domain.version !== "latest" ? `/${domain.id}/versioned/${domain.version}/flows` : `/${domain.id}/flows`;
3008
- pathForFlow = (0, import_node_path19.join)(pathForFlow, flow.id);
3211
+ pathForFlow = (0, import_node_path20.join)(pathForFlow, flow.id);
3009
3212
  await writeResource(directory, { ...flow }, { ...options, path: pathForFlow, type: "flow" });
3010
3213
  };
3011
3214
  var writeFlowToService = (directory) => async (flow, service, options = { path: "", format: "mdx", override: false }) => {
3012
3215
  let pathForFlow = service.version && service.version !== "latest" ? `/${service.id}/versioned/${service.version}/flows` : `/${service.id}/flows`;
3013
- pathForFlow = (0, import_node_path19.join)(pathForFlow, flow.id);
3216
+ pathForFlow = (0, import_node_path20.join)(pathForFlow, flow.id);
3217
+ await writeResource(directory, { ...flow }, { ...options, path: pathForFlow, type: "flow" });
3218
+ };
3219
+ var writeFlowToAgent = (directory) => async (flow, agent, options = { path: "", format: "mdx", override: false }) => {
3220
+ let pathForFlow = agent.version && agent.version !== "latest" ? `/${agent.id}/versioned/${agent.version}/flows` : `/${agent.id}/flows`;
3221
+ pathForFlow = (0, import_node_path20.join)(pathForFlow, flow.id);
3014
3222
  await writeResource(directory, { ...flow }, { ...options, path: pathForFlow, type: "flow" });
3015
3223
  };
3016
3224
  var rmFlow = (directory) => async (path8) => {
3017
- await import_promises12.default.rm((0, import_node_path19.join)(directory, path8), { recursive: true });
3225
+ await import_promises13.default.rm((0, import_node_path20.join)(directory, path8), { recursive: true });
3018
3226
  invalidateFileCache();
3019
3227
  };
3020
3228
  var rmFlowById = (directory) => async (id, version, persistFiles) => {
@@ -3028,8 +3236,8 @@ var flowHasVersion = (directory) => async (id, version) => {
3028
3236
  var addFileToFlow = (directory) => async (id, file, version) => addFileToResource(directory, id, file, version, { type: "flow" });
3029
3237
 
3030
3238
  // src/containers.ts
3031
- var import_promises13 = __toESM(require("fs/promises"));
3032
- var import_node_path20 = require("path");
3239
+ var import_promises14 = __toESM(require("fs/promises"));
3240
+ var import_node_path21 = require("path");
3033
3241
  var getContainer = (directory) => async (id, version) => getResource(directory, id, version, { type: "container" });
3034
3242
  var getContainers = (directory) => async (options) => getResources(directory, { type: "containers", latestOnly: options?.latestOnly });
3035
3243
  var writeContainer = (directory) => async (data, options = {
@@ -3039,7 +3247,7 @@ var writeContainer = (directory) => async (data, options = {
3039
3247
  }) => writeResource(directory, { ...data }, { ...options, type: "container" });
3040
3248
  var versionContainer = (directory) => async (id) => versionResource(directory, id);
3041
3249
  var rmContainer = (directory) => async (path8) => {
3042
- await import_promises13.default.rm((0, import_node_path20.join)(directory, path8), { recursive: true });
3250
+ await import_promises14.default.rm((0, import_node_path21.join)(directory, path8), { recursive: true });
3043
3251
  invalidateFileCache();
3044
3252
  };
3045
3253
  var rmContainerById = (directory) => async (id, version, persistFiles) => {
@@ -3056,7 +3264,7 @@ var writeContainerToService = (directory) => async (container, service, options
3056
3264
  throw new Error("Service not found");
3057
3265
  }
3058
3266
  let pathForContainer = service.version && service.version !== "latest" ? `${resourcePath.directory}/versioned/${service.version}/containers` : `${resourcePath.directory}/containers`;
3059
- pathForContainer = (0, import_node_path20.join)(pathForContainer, container.id);
3267
+ pathForContainer = (0, import_node_path21.join)(pathForContainer, container.id);
3060
3268
  await writeResource(directory, { ...container }, { ...options, path: pathForContainer, type: "container" });
3061
3269
  };
3062
3270
 
@@ -3072,8 +3280,8 @@ var addFileToDataStore = addFileToContainer;
3072
3280
  var writeDataStoreToService = writeContainerToService;
3073
3281
 
3074
3282
  // src/data-products.ts
3075
- var import_promises14 = __toESM(require("fs/promises"));
3076
- var import_node_path21 = require("path");
3283
+ var import_promises15 = __toESM(require("fs/promises"));
3284
+ var import_node_path22 = require("path");
3077
3285
  var getDataProduct = (directory) => async (id, version) => getResource(directory, id, version, { type: "data-product" });
3078
3286
  var getDataProducts = (directory) => async (options) => getResources(directory, { type: "data-products", latestOnly: options?.latestOnly });
3079
3287
  var writeDataProduct = (directory) => async (dataProduct, options = {
@@ -3083,11 +3291,11 @@ var writeDataProduct = (directory) => async (dataProduct, options = {
3083
3291
  }) => writeResource(directory, { ...dataProduct }, { ...options, type: "data-product" });
3084
3292
  var writeDataProductToDomain = (directory) => async (dataProduct, domain, options = { path: "", format: "mdx", override: false }) => {
3085
3293
  let pathForDataProduct = domain.version && domain.version !== "latest" ? `/${domain.id}/versioned/${domain.version}/data-products` : `/${domain.id}/data-products`;
3086
- pathForDataProduct = (0, import_node_path21.join)(pathForDataProduct, dataProduct.id);
3294
+ pathForDataProduct = (0, import_node_path22.join)(pathForDataProduct, dataProduct.id);
3087
3295
  await writeResource(directory, { ...dataProduct }, { ...options, path: pathForDataProduct, type: "data-product" });
3088
3296
  };
3089
3297
  var rmDataProduct = (directory) => async (path8) => {
3090
- await import_promises14.default.rm((0, import_node_path21.join)(directory, path8), { recursive: true });
3298
+ await import_promises15.default.rm((0, import_node_path22.join)(directory, path8), { recursive: true });
3091
3299
  invalidateFileCache();
3092
3300
  };
3093
3301
  var rmDataProductById = (directory) => async (id, version, persistFiles) => {
@@ -3101,8 +3309,8 @@ var dataProductHasVersion = (directory) => async (id, version) => {
3101
3309
  var addFileToDataProduct = (directory) => async (id, file, version) => addFileToResource(directory, id, file, version);
3102
3310
 
3103
3311
  // src/diagrams.ts
3104
- var import_promises15 = __toESM(require("fs/promises"));
3105
- var import_node_path22 = require("path");
3312
+ var import_promises16 = __toESM(require("fs/promises"));
3313
+ var import_node_path23 = require("path");
3106
3314
  var getDiagram = (directory) => async (id, version) => getResource(directory, id, version, { type: "diagram" });
3107
3315
  var getDiagrams = (directory) => async (options) => getResources(directory, { type: "diagrams", latestOnly: options?.latestOnly });
3108
3316
  var writeDiagram = (directory) => async (diagram, options = {
@@ -3111,7 +3319,7 @@ var writeDiagram = (directory) => async (diagram, options = {
3111
3319
  format: "mdx"
3112
3320
  }) => writeResource(directory, { ...diagram }, { ...options, type: "diagram" });
3113
3321
  var rmDiagram = (directory) => async (path8) => {
3114
- await import_promises15.default.rm((0, import_node_path22.join)(directory, path8), { recursive: true });
3322
+ await import_promises16.default.rm((0, import_node_path23.join)(directory, path8), { recursive: true });
3115
3323
  invalidateFileCache();
3116
3324
  };
3117
3325
  var rmDiagramById = (directory) => async (id, version, persistFiles) => {
@@ -3133,13 +3341,13 @@ var src_default = (path8) => {
3133
3341
  * @param version - Optional id of the version to get (supports semver)
3134
3342
  * @returns Event|Undefined
3135
3343
  */
3136
- getEvent: getEvent((0, import_node_path23.join)(path8)),
3344
+ getEvent: getEvent((0, import_node_path24.join)(path8)),
3137
3345
  /**
3138
3346
  * Returns all events from EventCatalog
3139
3347
  * @param latestOnly - optional boolean, set to true to get only latest versions
3140
3348
  * @returns Event[]|Undefined
3141
3349
  */
3142
- getEvents: getEvents((0, import_node_path23.join)(path8)),
3350
+ getEvents: getEvents((0, import_node_path24.join)(path8)),
3143
3351
  /**
3144
3352
  * Adds an event to EventCatalog
3145
3353
  *
@@ -3147,7 +3355,7 @@ var src_default = (path8) => {
3147
3355
  * @param options - Optional options to write the event
3148
3356
  *
3149
3357
  */
3150
- writeEvent: writeEvent((0, import_node_path23.join)(path8, "events")),
3358
+ writeEvent: writeEvent((0, import_node_path24.join)(path8, "events")),
3151
3359
  /**
3152
3360
  * Adds an event to a service in EventCatalog
3153
3361
  *
@@ -3156,26 +3364,35 @@ var src_default = (path8) => {
3156
3364
  * @param options - Optional options to write the event
3157
3365
  *
3158
3366
  */
3159
- writeEventToService: writeEventToService((0, import_node_path23.join)(path8)),
3367
+ writeEventToService: writeEventToService((0, import_node_path24.join)(path8)),
3368
+ /**
3369
+ * Adds an event to an agent in EventCatalog
3370
+ *
3371
+ * @param event - The event to write to the agent
3372
+ * @param agent - The agent and its id to write the event to
3373
+ * @param options - Optional options to write the event
3374
+ *
3375
+ */
3376
+ writeEventToAgent: writeEventToAgent((0, import_node_path24.join)(path8)),
3160
3377
  /**
3161
3378
  * Remove an event to EventCatalog (modeled on the standard POSIX rm utility)
3162
3379
  *
3163
3380
  * @param path - The path to your event, e.g. `/Inventory/InventoryAdjusted`
3164
3381
  *
3165
3382
  */
3166
- rmEvent: rmEvent((0, import_node_path23.join)(path8, "events")),
3383
+ rmEvent: rmEvent((0, import_node_path24.join)(path8, "events")),
3167
3384
  /**
3168
3385
  * Remove an event by an Event id
3169
3386
  *
3170
3387
  * @param id - The id of the event you want to remove
3171
3388
  *
3172
3389
  */
3173
- rmEventById: rmEventById((0, import_node_path23.join)(path8)),
3390
+ rmEventById: rmEventById((0, import_node_path24.join)(path8)),
3174
3391
  /**
3175
3392
  * Moves a given event id to the version directory
3176
3393
  * @param directory
3177
3394
  */
3178
- versionEvent: versionEvent((0, import_node_path23.join)(path8)),
3395
+ versionEvent: versionEvent((0, import_node_path24.join)(path8)),
3179
3396
  /**
3180
3397
  * Adds a file to the given event
3181
3398
  * @param id - The id of the event to add the file to
@@ -3183,7 +3400,7 @@ var src_default = (path8) => {
3183
3400
  * @param version - Optional version of the event to add the file to
3184
3401
  * @returns
3185
3402
  */
3186
- addFileToEvent: addFileToEvent((0, import_node_path23.join)(path8)),
3403
+ addFileToEvent: addFileToEvent((0, import_node_path24.join)(path8)),
3187
3404
  /**
3188
3405
  * Adds a schema to the given event
3189
3406
  * @param id - The id of the event to add the schema to
@@ -3191,17 +3408,17 @@ var src_default = (path8) => {
3191
3408
  * @param version - Optional version of the event to add the schema to
3192
3409
  * @returns
3193
3410
  */
3194
- addSchemaToEvent: addSchemaToEvent((0, import_node_path23.join)(path8)),
3411
+ addSchemaToEvent: addSchemaToEvent((0, import_node_path24.join)(path8)),
3195
3412
  /**
3196
3413
  * Check to see if an event version exists
3197
3414
  * @param id - The id of the event
3198
3415
  * @param version - The version of the event (supports semver)
3199
3416
  * @returns
3200
3417
  */
3201
- eventHasVersion: eventHasVersion((0, import_node_path23.join)(path8)),
3202
- addExampleToEvent: addExampleToEvent((0, import_node_path23.join)(path8)),
3203
- getExamplesFromEvent: getExamplesFromEvent((0, import_node_path23.join)(path8)),
3204
- removeExampleFromEvent: removeExampleFromEvent((0, import_node_path23.join)(path8)),
3418
+ eventHasVersion: eventHasVersion((0, import_node_path24.join)(path8)),
3419
+ addExampleToEvent: addExampleToEvent((0, import_node_path24.join)(path8)),
3420
+ getExamplesFromEvent: getExamplesFromEvent((0, import_node_path24.join)(path8)),
3421
+ removeExampleFromEvent: removeExampleFromEvent((0, import_node_path24.join)(path8)),
3205
3422
  /**
3206
3423
  * ================================
3207
3424
  * Commands
@@ -3213,13 +3430,13 @@ var src_default = (path8) => {
3213
3430
  * @param version - Optional id of the version to get (supports semver)
3214
3431
  * @returns Command|Undefined
3215
3432
  */
3216
- getCommand: getCommand((0, import_node_path23.join)(path8)),
3433
+ getCommand: getCommand((0, import_node_path24.join)(path8)),
3217
3434
  /**
3218
3435
  * Returns all commands from EventCatalog
3219
3436
  * @param latestOnly - optional boolean, set to true to get only latest versions
3220
3437
  * @returns Command[]|Undefined
3221
3438
  */
3222
- getCommands: getCommands((0, import_node_path23.join)(path8)),
3439
+ getCommands: getCommands((0, import_node_path24.join)(path8)),
3223
3440
  /**
3224
3441
  * Adds an command to EventCatalog
3225
3442
  *
@@ -3227,7 +3444,7 @@ var src_default = (path8) => {
3227
3444
  * @param options - Optional options to write the command
3228
3445
  *
3229
3446
  */
3230
- writeCommand: writeCommand((0, import_node_path23.join)(path8, "commands")),
3447
+ writeCommand: writeCommand((0, import_node_path24.join)(path8, "commands")),
3231
3448
  /**
3232
3449
  * Adds a command to a service in EventCatalog
3233
3450
  *
@@ -3236,26 +3453,35 @@ var src_default = (path8) => {
3236
3453
  * @param options - Optional options to write the command
3237
3454
  *
3238
3455
  */
3239
- writeCommandToService: writeCommandToService((0, import_node_path23.join)(path8)),
3456
+ writeCommandToService: writeCommandToService((0, import_node_path24.join)(path8)),
3457
+ /**
3458
+ * Adds a command to an agent in EventCatalog
3459
+ *
3460
+ * @param command - The command to write to the agent
3461
+ * @param agent - The agent and its id to write the command to
3462
+ * @param options - Optional options to write the command
3463
+ *
3464
+ */
3465
+ writeCommandToAgent: writeCommandToAgent((0, import_node_path24.join)(path8)),
3240
3466
  /**
3241
3467
  * Remove an command to EventCatalog (modeled on the standard POSIX rm utility)
3242
3468
  *
3243
3469
  * @param path - The path to your command, e.g. `/Inventory/InventoryAdjusted`
3244
3470
  *
3245
3471
  */
3246
- rmCommand: rmCommand((0, import_node_path23.join)(path8, "commands")),
3472
+ rmCommand: rmCommand((0, import_node_path24.join)(path8, "commands")),
3247
3473
  /**
3248
3474
  * Remove an command by an Event id
3249
3475
  *
3250
3476
  * @param id - The id of the command you want to remove
3251
3477
  *
3252
3478
  */
3253
- rmCommandById: rmCommandById((0, import_node_path23.join)(path8)),
3479
+ rmCommandById: rmCommandById((0, import_node_path24.join)(path8)),
3254
3480
  /**
3255
3481
  * Moves a given command id to the version directory
3256
3482
  * @param directory
3257
3483
  */
3258
- versionCommand: versionCommand((0, import_node_path23.join)(path8)),
3484
+ versionCommand: versionCommand((0, import_node_path24.join)(path8)),
3259
3485
  /**
3260
3486
  * Adds a file to the given command
3261
3487
  * @param id - The id of the command to add the file to
@@ -3263,7 +3489,7 @@ var src_default = (path8) => {
3263
3489
  * @param version - Optional version of the command to add the file to
3264
3490
  * @returns
3265
3491
  */
3266
- addFileToCommand: addFileToCommand((0, import_node_path23.join)(path8)),
3492
+ addFileToCommand: addFileToCommand((0, import_node_path24.join)(path8)),
3267
3493
  /**
3268
3494
  * Adds a schema to the given command
3269
3495
  * @param id - The id of the command to add the schema to
@@ -3271,17 +3497,17 @@ var src_default = (path8) => {
3271
3497
  * @param version - Optional version of the command to add the schema to
3272
3498
  * @returns
3273
3499
  */
3274
- addSchemaToCommand: addSchemaToCommand((0, import_node_path23.join)(path8)),
3500
+ addSchemaToCommand: addSchemaToCommand((0, import_node_path24.join)(path8)),
3275
3501
  /**
3276
3502
  * Check to see if a command version exists
3277
3503
  * @param id - The id of the command
3278
3504
  * @param version - The version of the command (supports semver)
3279
3505
  * @returns
3280
3506
  */
3281
- commandHasVersion: commandHasVersion((0, import_node_path23.join)(path8)),
3282
- addExampleToCommand: addExampleToCommand((0, import_node_path23.join)(path8)),
3283
- getExamplesFromCommand: getExamplesFromCommand((0, import_node_path23.join)(path8)),
3284
- removeExampleFromCommand: removeExampleFromCommand((0, import_node_path23.join)(path8)),
3507
+ commandHasVersion: commandHasVersion((0, import_node_path24.join)(path8)),
3508
+ addExampleToCommand: addExampleToCommand((0, import_node_path24.join)(path8)),
3509
+ getExamplesFromCommand: getExamplesFromCommand((0, import_node_path24.join)(path8)),
3510
+ removeExampleFromCommand: removeExampleFromCommand((0, import_node_path24.join)(path8)),
3285
3511
  /**
3286
3512
  * ================================
3287
3513
  * Queries
@@ -3293,13 +3519,13 @@ var src_default = (path8) => {
3293
3519
  * @param version - Optional id of the version to get (supports semver)
3294
3520
  * @returns Query|Undefined
3295
3521
  */
3296
- getQuery: getQuery((0, import_node_path23.join)(path8)),
3522
+ getQuery: getQuery((0, import_node_path24.join)(path8)),
3297
3523
  /**
3298
3524
  * Returns all queries from EventCatalog
3299
3525
  * @param latestOnly - optional boolean, set to true to get only latest versions
3300
3526
  * @returns Query[]|Undefined
3301
3527
  */
3302
- getQueries: getQueries((0, import_node_path23.join)(path8)),
3528
+ getQueries: getQueries((0, import_node_path24.join)(path8)),
3303
3529
  /**
3304
3530
  * Adds a query to EventCatalog
3305
3531
  *
@@ -3307,7 +3533,7 @@ var src_default = (path8) => {
3307
3533
  * @param options - Optional options to write the event
3308
3534
  *
3309
3535
  */
3310
- writeQuery: writeQuery((0, import_node_path23.join)(path8, "queries")),
3536
+ writeQuery: writeQuery((0, import_node_path24.join)(path8, "queries")),
3311
3537
  /**
3312
3538
  * Adds a query to a service in EventCatalog
3313
3539
  *
@@ -3316,26 +3542,35 @@ var src_default = (path8) => {
3316
3542
  * @param options - Optional options to write the query
3317
3543
  *
3318
3544
  */
3319
- writeQueryToService: writeQueryToService((0, import_node_path23.join)(path8)),
3545
+ writeQueryToService: writeQueryToService((0, import_node_path24.join)(path8)),
3546
+ /**
3547
+ * Adds a query to an agent in EventCatalog
3548
+ *
3549
+ * @param query - The query to write to the agent
3550
+ * @param agent - The agent and its id to write the query to
3551
+ * @param options - Optional options to write the query
3552
+ *
3553
+ */
3554
+ writeQueryToAgent: writeQueryToAgent((0, import_node_path24.join)(path8)),
3320
3555
  /**
3321
3556
  * Remove an query to EventCatalog (modeled on the standard POSIX rm utility)
3322
3557
  *
3323
3558
  * @param path - The path to your query, e.g. `/Orders/GetOrder`
3324
3559
  *
3325
3560
  */
3326
- rmQuery: rmQuery((0, import_node_path23.join)(path8, "queries")),
3561
+ rmQuery: rmQuery((0, import_node_path24.join)(path8, "queries")),
3327
3562
  /**
3328
3563
  * Remove a query by a Query id
3329
3564
  *
3330
3565
  * @param id - The id of the query you want to remove
3331
3566
  *
3332
3567
  */
3333
- rmQueryById: rmQueryById((0, import_node_path23.join)(path8)),
3568
+ rmQueryById: rmQueryById((0, import_node_path24.join)(path8)),
3334
3569
  /**
3335
3570
  * Moves a given query id to the version directory
3336
3571
  * @param directory
3337
3572
  */
3338
- versionQuery: versionQuery((0, import_node_path23.join)(path8)),
3573
+ versionQuery: versionQuery((0, import_node_path24.join)(path8)),
3339
3574
  /**
3340
3575
  * Adds a file to the given query
3341
3576
  * @param id - The id of the query to add the file to
@@ -3343,7 +3578,7 @@ var src_default = (path8) => {
3343
3578
  * @param version - Optional version of the query to add the file to
3344
3579
  * @returns
3345
3580
  */
3346
- addFileToQuery: addFileToQuery((0, import_node_path23.join)(path8)),
3581
+ addFileToQuery: addFileToQuery((0, import_node_path24.join)(path8)),
3347
3582
  /**
3348
3583
  * Adds a schema to the given query
3349
3584
  * @param id - The id of the query to add the schema to
@@ -3351,17 +3586,17 @@ var src_default = (path8) => {
3351
3586
  * @param version - Optional version of the query to add the schema to
3352
3587
  * @returns
3353
3588
  */
3354
- addSchemaToQuery: addSchemaToQuery((0, import_node_path23.join)(path8)),
3589
+ addSchemaToQuery: addSchemaToQuery((0, import_node_path24.join)(path8)),
3355
3590
  /**
3356
3591
  * Check to see if an query version exists
3357
3592
  * @param id - The id of the query
3358
3593
  * @param version - The version of the query (supports semver)
3359
3594
  * @returns
3360
3595
  */
3361
- queryHasVersion: queryHasVersion((0, import_node_path23.join)(path8)),
3362
- addExampleToQuery: addExampleToQuery((0, import_node_path23.join)(path8)),
3363
- getExamplesFromQuery: getExamplesFromQuery((0, import_node_path23.join)(path8)),
3364
- removeExampleFromQuery: removeExampleFromQuery((0, import_node_path23.join)(path8)),
3596
+ queryHasVersion: queryHasVersion((0, import_node_path24.join)(path8)),
3597
+ addExampleToQuery: addExampleToQuery((0, import_node_path24.join)(path8)),
3598
+ getExamplesFromQuery: getExamplesFromQuery((0, import_node_path24.join)(path8)),
3599
+ removeExampleFromQuery: removeExampleFromQuery((0, import_node_path24.join)(path8)),
3365
3600
  /**
3366
3601
  * ================================
3367
3602
  * Channels
@@ -3373,13 +3608,13 @@ var src_default = (path8) => {
3373
3608
  * @param version - Optional id of the version to get (supports semver)
3374
3609
  * @returns Channel|Undefined
3375
3610
  */
3376
- getChannel: getChannel((0, import_node_path23.join)(path8)),
3611
+ getChannel: getChannel((0, import_node_path24.join)(path8)),
3377
3612
  /**
3378
3613
  * Returns all channels from EventCatalog
3379
3614
  * @param latestOnly - optional boolean, set to true to get only latest versions
3380
3615
  * @returns Channel[]|Undefined
3381
3616
  */
3382
- getChannels: getChannels((0, import_node_path23.join)(path8)),
3617
+ getChannels: getChannels((0, import_node_path24.join)(path8)),
3383
3618
  /**
3384
3619
  * Adds an channel to EventCatalog
3385
3620
  *
@@ -3387,33 +3622,33 @@ var src_default = (path8) => {
3387
3622
  * @param options - Optional options to write the channel
3388
3623
  *
3389
3624
  */
3390
- writeChannel: writeChannel((0, import_node_path23.join)(path8, "channels")),
3625
+ writeChannel: writeChannel((0, import_node_path24.join)(path8, "channels")),
3391
3626
  /**
3392
3627
  * Remove an channel to EventCatalog (modeled on the standard POSIX rm utility)
3393
3628
  *
3394
3629
  * @param path - The path to your channel, e.g. `/Inventory/InventoryAdjusted`
3395
3630
  *
3396
3631
  */
3397
- rmChannel: rmChannel((0, import_node_path23.join)(path8, "channels")),
3632
+ rmChannel: rmChannel((0, import_node_path24.join)(path8, "channels")),
3398
3633
  /**
3399
3634
  * Remove an channel by an Event id
3400
3635
  *
3401
3636
  * @param id - The id of the channel you want to remove
3402
3637
  *
3403
3638
  */
3404
- rmChannelById: rmChannelById((0, import_node_path23.join)(path8)),
3639
+ rmChannelById: rmChannelById((0, import_node_path24.join)(path8)),
3405
3640
  /**
3406
3641
  * Moves a given channel id to the version directory
3407
3642
  * @param directory
3408
3643
  */
3409
- versionChannel: versionChannel((0, import_node_path23.join)(path8)),
3644
+ versionChannel: versionChannel((0, import_node_path24.join)(path8)),
3410
3645
  /**
3411
3646
  * Check to see if a channel version exists
3412
3647
  * @param id - The id of the channel
3413
3648
  * @param version - The version of the channel (supports semver)
3414
3649
  * @returns
3415
3650
  */
3416
- channelHasVersion: channelHasVersion((0, import_node_path23.join)(path8)),
3651
+ channelHasVersion: channelHasVersion((0, import_node_path24.join)(path8)),
3417
3652
  /**
3418
3653
  * Add a channel to an event
3419
3654
  *
@@ -3430,7 +3665,7 @@ var src_default = (path8) => {
3430
3665
  *
3431
3666
  * ```
3432
3667
  */
3433
- addEventToChannel: addMessageToChannel((0, import_node_path23.join)(path8), "events"),
3668
+ addEventToChannel: addMessageToChannel((0, import_node_path24.join)(path8), "events"),
3434
3669
  /**
3435
3670
  * Add a channel to an command
3436
3671
  *
@@ -3447,7 +3682,7 @@ var src_default = (path8) => {
3447
3682
  *
3448
3683
  * ```
3449
3684
  */
3450
- addCommandToChannel: addMessageToChannel((0, import_node_path23.join)(path8), "commands"),
3685
+ addCommandToChannel: addMessageToChannel((0, import_node_path24.join)(path8), "commands"),
3451
3686
  /**
3452
3687
  * Add a channel to an query
3453
3688
  *
@@ -3464,7 +3699,7 @@ var src_default = (path8) => {
3464
3699
  *
3465
3700
  * ```
3466
3701
  */
3467
- addQueryToChannel: addMessageToChannel((0, import_node_path23.join)(path8), "queries"),
3702
+ addQueryToChannel: addMessageToChannel((0, import_node_path24.join)(path8), "queries"),
3468
3703
  /**
3469
3704
  * ================================
3470
3705
  * SERVICES
@@ -3477,14 +3712,14 @@ var src_default = (path8) => {
3477
3712
  * @param options - Optional options to write the event
3478
3713
  *
3479
3714
  */
3480
- writeService: writeService((0, import_node_path23.join)(path8, "services")),
3715
+ writeService: writeService((0, import_node_path24.join)(path8, "services")),
3481
3716
  /**
3482
3717
  * Adds a versioned service to EventCatalog
3483
3718
  *
3484
3719
  * @param service - The service to write
3485
3720
  *
3486
3721
  */
3487
- writeVersionedService: writeVersionedService((0, import_node_path23.join)(path8, "services")),
3722
+ writeVersionedService: writeVersionedService((0, import_node_path24.join)(path8, "services")),
3488
3723
  /**
3489
3724
  * Adds a service to a domain in EventCatalog
3490
3725
  *
@@ -3493,45 +3728,45 @@ var src_default = (path8) => {
3493
3728
  * @param options - Optional options to write the event
3494
3729
  *
3495
3730
  */
3496
- writeServiceToDomain: writeServiceToDomain((0, import_node_path23.join)(path8, "domains")),
3731
+ writeServiceToDomain: writeServiceToDomain((0, import_node_path24.join)(path8, "domains")),
3497
3732
  /**
3498
3733
  * Returns a service from EventCatalog
3499
3734
  * @param id - The id of the service to retrieve
3500
3735
  * @param version - Optional id of the version to get (supports semver)
3501
3736
  * @returns Service|Undefined
3502
3737
  */
3503
- getService: getService((0, import_node_path23.join)(path8)),
3738
+ getService: getService((0, import_node_path24.join)(path8)),
3504
3739
  /**
3505
3740
  * Returns a service from EventCatalog by it's path.
3506
3741
  * @param path - The path to the service to retrieve
3507
3742
  * @returns Service|Undefined
3508
3743
  */
3509
- getServiceByPath: getServiceByPath((0, import_node_path23.join)(path8)),
3744
+ getServiceByPath: getServiceByPath((0, import_node_path24.join)(path8)),
3510
3745
  /**
3511
3746
  * Returns all services from EventCatalog
3512
3747
  * @param latestOnly - optional boolean, set to true to get only latest versions
3513
3748
  * @returns Service[]|Undefined
3514
3749
  */
3515
- getServices: getServices((0, import_node_path23.join)(path8)),
3750
+ getServices: getServices((0, import_node_path24.join)(path8)),
3516
3751
  /**
3517
3752
  * Moves a given service id to the version directory
3518
3753
  * @param directory
3519
3754
  */
3520
- versionService: versionService((0, import_node_path23.join)(path8)),
3755
+ versionService: versionService((0, import_node_path24.join)(path8)),
3521
3756
  /**
3522
3757
  * Remove a service from EventCatalog (modeled on the standard POSIX rm utility)
3523
3758
  *
3524
3759
  * @param path - The path to your service, e.g. `/InventoryService`
3525
3760
  *
3526
3761
  */
3527
- rmService: rmService((0, import_node_path23.join)(path8, "services")),
3762
+ rmService: rmService((0, import_node_path24.join)(path8, "services")),
3528
3763
  /**
3529
3764
  * Remove an service by an service id
3530
3765
  *
3531
3766
  * @param id - The id of the service you want to remove
3532
3767
  *
3533
3768
  */
3534
- rmServiceById: rmServiceById((0, import_node_path23.join)(path8)),
3769
+ rmServiceById: rmServiceById((0, import_node_path24.join)(path8)),
3535
3770
  /**
3536
3771
  * Adds a file to the given service
3537
3772
  * @param id - The id of the service to add the file to
@@ -3539,21 +3774,21 @@ var src_default = (path8) => {
3539
3774
  * @param version - Optional version of the service to add the file to
3540
3775
  * @returns
3541
3776
  */
3542
- addFileToService: addFileToService((0, import_node_path23.join)(path8)),
3777
+ addFileToService: addFileToService((0, import_node_path24.join)(path8)),
3543
3778
  /**
3544
3779
  * Returns the specifications for a given service
3545
3780
  * @param id - The id of the service to retrieve the specifications for
3546
3781
  * @param version - Optional version of the service
3547
3782
  * @returns
3548
3783
  */
3549
- getSpecificationFilesForService: getSpecificationFilesForService((0, import_node_path23.join)(path8)),
3784
+ getSpecificationFilesForService: getSpecificationFilesForService((0, import_node_path24.join)(path8)),
3550
3785
  /**
3551
3786
  * Check to see if a service version exists
3552
3787
  * @param id - The id of the service
3553
3788
  * @param version - The version of the service (supports semver)
3554
3789
  * @returns
3555
3790
  */
3556
- serviceHasVersion: serviceHasVersion((0, import_node_path23.join)(path8)),
3791
+ serviceHasVersion: serviceHasVersion((0, import_node_path24.join)(path8)),
3557
3792
  /**
3558
3793
  * Add an event to a service by it's id.
3559
3794
  *
@@ -3573,7 +3808,7 @@ var src_default = (path8) => {
3573
3808
  *
3574
3809
  * ```
3575
3810
  */
3576
- addEventToService: addMessageToService((0, import_node_path23.join)(path8)),
3811
+ addEventToService: addMessageToService((0, import_node_path24.join)(path8)),
3577
3812
  /**
3578
3813
  * Add a data store to a service by it's id.
3579
3814
  *
@@ -3590,7 +3825,7 @@ var src_default = (path8) => {
3590
3825
  *
3591
3826
  * ```
3592
3827
  */
3593
- addDataStoreToService: addDataStoreToService((0, import_node_path23.join)(path8)),
3828
+ addDataStoreToService: addDataStoreToService((0, import_node_path24.join)(path8)),
3594
3829
  /**
3595
3830
  * Add a command to a service by it's id.
3596
3831
  *
@@ -3610,7 +3845,7 @@ var src_default = (path8) => {
3610
3845
  *
3611
3846
  * ```
3612
3847
  */
3613
- addCommandToService: addMessageToService((0, import_node_path23.join)(path8)),
3848
+ addCommandToService: addMessageToService((0, import_node_path24.join)(path8)),
3614
3849
  /**
3615
3850
  * Add a query to a service by it's id.
3616
3851
  *
@@ -3630,7 +3865,7 @@ var src_default = (path8) => {
3630
3865
  *
3631
3866
  * ```
3632
3867
  */
3633
- addQueryToService: addMessageToService((0, import_node_path23.join)(path8)),
3868
+ addQueryToService: addMessageToService((0, import_node_path24.join)(path8)),
3634
3869
  /**
3635
3870
  * Add an entity to a service by its id.
3636
3871
  *
@@ -3648,7 +3883,7 @@ var src_default = (path8) => {
3648
3883
  *
3649
3884
  * ```
3650
3885
  */
3651
- addEntityToService: addEntityToService((0, import_node_path23.join)(path8)),
3886
+ addEntityToService: addEntityToService((0, import_node_path24.join)(path8)),
3652
3887
  /**
3653
3888
  * Check to see if a service exists by it's path.
3654
3889
  *
@@ -3665,13 +3900,36 @@ var src_default = (path8) => {
3665
3900
  * @param path - The path to the service to check
3666
3901
  * @returns boolean
3667
3902
  */
3668
- isService: isService((0, import_node_path23.join)(path8)),
3903
+ isService: isService((0, import_node_path24.join)(path8)),
3669
3904
  /**
3670
3905
  * Converts a file to a service.
3671
3906
  * @param file - The file to convert to a service.
3672
3907
  * @returns The service.
3673
3908
  */
3674
- toService: toService((0, import_node_path23.join)(path8)),
3909
+ toService: toService((0, import_node_path24.join)(path8)),
3910
+ /**
3911
+ * ================================
3912
+ * Agents
3913
+ * ================================
3914
+ */
3915
+ writeAgent: writeAgent((0, import_node_path24.join)(path8, "agents")),
3916
+ writeVersionedAgent: writeVersionedAgent((0, import_node_path24.join)(path8, "agents")),
3917
+ writeAgentToDomain: writeAgentToDomain((0, import_node_path24.join)(path8, "domains")),
3918
+ getAgent: getAgent((0, import_node_path24.join)(path8)),
3919
+ getAgentByPath: getAgentByPath((0, import_node_path24.join)(path8)),
3920
+ getAgents: getAgents((0, import_node_path24.join)(path8)),
3921
+ versionAgent: versionAgent((0, import_node_path24.join)(path8)),
3922
+ rmAgent: rmAgent((0, import_node_path24.join)(path8, "agents")),
3923
+ rmAgentById: rmAgentById((0, import_node_path24.join)(path8)),
3924
+ addFileToAgent: addFileToAgent((0, import_node_path24.join)(path8)),
3925
+ addEventToAgent: addMessageToAgent((0, import_node_path24.join)(path8)),
3926
+ addCommandToAgent: addMessageToAgent((0, import_node_path24.join)(path8)),
3927
+ addQueryToAgent: addMessageToAgent((0, import_node_path24.join)(path8)),
3928
+ addDataStoreToAgent: addDataStoreToAgent((0, import_node_path24.join)(path8)),
3929
+ addFlowToAgent: addFlowToAgent((0, import_node_path24.join)(path8)),
3930
+ agentHasVersion: agentHasVersion((0, import_node_path24.join)(path8)),
3931
+ isAgent: isAgent((0, import_node_path24.join)(path8)),
3932
+ toAgent: toAgent((0, import_node_path24.join)(path8)),
3675
3933
  /**
3676
3934
  * ================================
3677
3935
  * Domains
@@ -3684,39 +3942,39 @@ var src_default = (path8) => {
3684
3942
  * @param options - Optional options to write the event
3685
3943
  *
3686
3944
  */
3687
- writeDomain: writeDomain((0, import_node_path23.join)(path8, "domains")),
3945
+ writeDomain: writeDomain((0, import_node_path24.join)(path8, "domains")),
3688
3946
  /**
3689
3947
  * Returns a domain from EventCatalog
3690
3948
  * @param id - The id of the domain to retrieve
3691
3949
  * @param version - Optional id of the version to get (supports semver)
3692
3950
  * @returns Domain|Undefined
3693
3951
  */
3694
- getDomain: getDomain((0, import_node_path23.join)(path8, "domains")),
3952
+ getDomain: getDomain((0, import_node_path24.join)(path8, "domains")),
3695
3953
  /**
3696
3954
  * Returns all domains from EventCatalog
3697
3955
  * @param latestOnly - optional boolean, set to true to get only latest versions
3698
3956
  * @returns Domain[]|Undefined
3699
3957
  */
3700
- getDomains: getDomains((0, import_node_path23.join)(path8)),
3958
+ getDomains: getDomains((0, import_node_path24.join)(path8)),
3701
3959
  /**
3702
3960
  * Moves a given domain id to the version directory
3703
3961
  * @param directory
3704
3962
  */
3705
- versionDomain: versionDomain((0, import_node_path23.join)(path8, "domains")),
3963
+ versionDomain: versionDomain((0, import_node_path24.join)(path8, "domains")),
3706
3964
  /**
3707
3965
  * Remove a domain from EventCatalog (modeled on the standard POSIX rm utility)
3708
3966
  *
3709
3967
  * @param path - The path to your domain, e.g. `/Payment`
3710
3968
  *
3711
3969
  */
3712
- rmDomain: rmDomain((0, import_node_path23.join)(path8, "domains")),
3970
+ rmDomain: rmDomain((0, import_node_path24.join)(path8, "domains")),
3713
3971
  /**
3714
3972
  * Remove an service by an domain id
3715
3973
  *
3716
3974
  * @param id - The id of the domain you want to remove
3717
3975
  *
3718
3976
  */
3719
- rmDomainById: rmDomainById((0, import_node_path23.join)(path8, "domains")),
3977
+ rmDomainById: rmDomainById((0, import_node_path24.join)(path8, "domains")),
3720
3978
  /**
3721
3979
  * Adds a file to the given domain
3722
3980
  * @param id - The id of the domain to add the file to
@@ -3724,28 +3982,28 @@ var src_default = (path8) => {
3724
3982
  * @param version - Optional version of the domain to add the file to
3725
3983
  * @returns
3726
3984
  */
3727
- addFileToDomain: addFileToDomain((0, import_node_path23.join)(path8, "domains")),
3985
+ addFileToDomain: addFileToDomain((0, import_node_path24.join)(path8, "domains")),
3728
3986
  /**
3729
3987
  * Adds an ubiquitous language dictionary to a domain
3730
3988
  * @param id - The id of the domain to add the ubiquitous language to
3731
3989
  * @param ubiquitousLanguageDictionary - The ubiquitous language dictionary to add
3732
3990
  * @param version - Optional version of the domain to add the ubiquitous language to
3733
3991
  */
3734
- addUbiquitousLanguageToDomain: addUbiquitousLanguageToDomain((0, import_node_path23.join)(path8, "domains")),
3992
+ addUbiquitousLanguageToDomain: addUbiquitousLanguageToDomain((0, import_node_path24.join)(path8, "domains")),
3735
3993
  /**
3736
3994
  * Get the ubiquitous language dictionary from a domain
3737
3995
  * @param id - The id of the domain to get the ubiquitous language from
3738
3996
  * @param version - Optional version of the domain to get the ubiquitous language from
3739
3997
  * @returns
3740
3998
  */
3741
- getUbiquitousLanguageFromDomain: getUbiquitousLanguageFromDomain((0, import_node_path23.join)(path8, "domains")),
3999
+ getUbiquitousLanguageFromDomain: getUbiquitousLanguageFromDomain((0, import_node_path24.join)(path8, "domains")),
3742
4000
  /**
3743
4001
  * Check to see if a domain version exists
3744
4002
  * @param id - The id of the domain
3745
4003
  * @param version - The version of the domain (supports semver)
3746
4004
  * @returns
3747
4005
  */
3748
- domainHasVersion: domainHasVersion((0, import_node_path23.join)(path8)),
4006
+ domainHasVersion: domainHasVersion((0, import_node_path24.join)(path8)),
3749
4007
  /**
3750
4008
  * Adds a given service to a domain
3751
4009
  * @param id - The id of the domain
@@ -3753,7 +4011,15 @@ var src_default = (path8) => {
3753
4011
  * @param version - (Optional) The version of the domain to add the service to
3754
4012
  * @returns
3755
4013
  */
3756
- addServiceToDomain: addServiceToDomain((0, import_node_path23.join)(path8, "domains")),
4014
+ addServiceToDomain: addServiceToDomain((0, import_node_path24.join)(path8, "domains")),
4015
+ /**
4016
+ * Adds a given agent to a domain
4017
+ * @param id - The id of the domain
4018
+ * @param agent - The id and version of the agent to add
4019
+ * @param version - (Optional) The version of the domain to add the agent to
4020
+ * @returns
4021
+ */
4022
+ addAgentToDomain: addAgentToDomain((0, import_node_path24.join)(path8, "domains")),
3757
4023
  /**
3758
4024
  * Adds a given subdomain to a domain
3759
4025
  * @param id - The id of the domain
@@ -3761,7 +4027,7 @@ var src_default = (path8) => {
3761
4027
  * @param version - (Optional) The version of the domain to add the subdomain to
3762
4028
  * @returns
3763
4029
  */
3764
- addSubDomainToDomain: addSubDomainToDomain((0, import_node_path23.join)(path8, "domains")),
4030
+ addSubDomainToDomain: addSubDomainToDomain((0, import_node_path24.join)(path8, "domains")),
3765
4031
  /**
3766
4032
  * Adds an entity to a domain
3767
4033
  * @param id - The id of the domain
@@ -3769,7 +4035,7 @@ var src_default = (path8) => {
3769
4035
  * @param version - (Optional) The version of the domain to add the entity to
3770
4036
  * @returns
3771
4037
  */
3772
- addEntityToDomain: addEntityToDomain((0, import_node_path23.join)(path8, "domains")),
4038
+ addEntityToDomain: addEntityToDomain((0, import_node_path24.join)(path8, "domains")),
3773
4039
  /**
3774
4040
  * Add an event to a domain by its id.
3775
4041
  *
@@ -3787,7 +4053,7 @@ var src_default = (path8) => {
3787
4053
  *
3788
4054
  * ```
3789
4055
  */
3790
- addEventToDomain: addMessageToDomain((0, import_node_path23.join)(path8, "domains")),
4056
+ addEventToDomain: addMessageToDomain((0, import_node_path24.join)(path8, "domains")),
3791
4057
  /**
3792
4058
  * Add a command to a domain by its id.
3793
4059
  *
@@ -3805,7 +4071,7 @@ var src_default = (path8) => {
3805
4071
  *
3806
4072
  * ```
3807
4073
  */
3808
- addCommandToDomain: addMessageToDomain((0, import_node_path23.join)(path8, "domains")),
4074
+ addCommandToDomain: addMessageToDomain((0, import_node_path24.join)(path8, "domains")),
3809
4075
  /**
3810
4076
  * Add a query to a domain by its id.
3811
4077
  *
@@ -3823,7 +4089,7 @@ var src_default = (path8) => {
3823
4089
  *
3824
4090
  * ```
3825
4091
  */
3826
- addQueryToDomain: addMessageToDomain((0, import_node_path23.join)(path8, "domains")),
4092
+ addQueryToDomain: addMessageToDomain((0, import_node_path24.join)(path8, "domains")),
3827
4093
  /**
3828
4094
  * ================================
3829
4095
  * Teams
@@ -3836,25 +4102,25 @@ var src_default = (path8) => {
3836
4102
  * @param options - Optional options to write the team
3837
4103
  *
3838
4104
  */
3839
- writeTeam: writeTeam((0, import_node_path23.join)(path8, "teams")),
4105
+ writeTeam: writeTeam((0, import_node_path24.join)(path8, "teams")),
3840
4106
  /**
3841
4107
  * Returns a team from EventCatalog
3842
4108
  * @param id - The id of the team to retrieve
3843
4109
  * @returns Team|Undefined
3844
4110
  */
3845
- getTeam: getTeam((0, import_node_path23.join)(path8, "teams")),
4111
+ getTeam: getTeam((0, import_node_path24.join)(path8, "teams")),
3846
4112
  /**
3847
4113
  * Returns all teams from EventCatalog
3848
4114
  * @returns Team[]|Undefined
3849
4115
  */
3850
- getTeams: getTeams((0, import_node_path23.join)(path8, "teams")),
4116
+ getTeams: getTeams((0, import_node_path24.join)(path8, "teams")),
3851
4117
  /**
3852
4118
  * Remove a team by the team id
3853
4119
  *
3854
4120
  * @param id - The id of the team you want to remove
3855
4121
  *
3856
4122
  */
3857
- rmTeamById: rmTeamById((0, import_node_path23.join)(path8, "teams")),
4123
+ rmTeamById: rmTeamById((0, import_node_path24.join)(path8, "teams")),
3858
4124
  /**
3859
4125
  * ================================
3860
4126
  * Users
@@ -3867,25 +4133,25 @@ var src_default = (path8) => {
3867
4133
  * @param options - Optional options to write the user
3868
4134
  *
3869
4135
  */
3870
- writeUser: writeUser((0, import_node_path23.join)(path8, "users")),
4136
+ writeUser: writeUser((0, import_node_path24.join)(path8, "users")),
3871
4137
  /**
3872
4138
  * Returns a user from EventCatalog
3873
4139
  * @param id - The id of the user to retrieve
3874
4140
  * @returns User|Undefined
3875
4141
  */
3876
- getUser: getUser((0, import_node_path23.join)(path8, "users")),
4142
+ getUser: getUser((0, import_node_path24.join)(path8, "users")),
3877
4143
  /**
3878
4144
  * Returns all user from EventCatalog
3879
4145
  * @returns User[]|Undefined
3880
4146
  */
3881
- getUsers: getUsers((0, import_node_path23.join)(path8)),
4147
+ getUsers: getUsers((0, import_node_path24.join)(path8)),
3882
4148
  /**
3883
4149
  * Remove a user by the user id
3884
4150
  *
3885
4151
  * @param id - The id of the user you want to remove
3886
4152
  *
3887
4153
  */
3888
- rmUserById: rmUserById((0, import_node_path23.join)(path8, "users")),
4154
+ rmUserById: rmUserById((0, import_node_path24.join)(path8, "users")),
3889
4155
  /**
3890
4156
  * ================================
3891
4157
  * Custom Docs
@@ -3896,32 +4162,32 @@ var src_default = (path8) => {
3896
4162
  * @param path - The path to the custom doc to retrieve
3897
4163
  * @returns CustomDoc|Undefined
3898
4164
  */
3899
- getCustomDoc: getCustomDoc((0, import_node_path23.join)(path8, "docs")),
4165
+ getCustomDoc: getCustomDoc((0, import_node_path24.join)(path8, "docs")),
3900
4166
  /**
3901
4167
  * Returns all custom docs from EventCatalog
3902
4168
  * @param options - Optional options to get custom docs from a specific path
3903
4169
  * @returns CustomDoc[]|Undefined
3904
4170
  */
3905
- getCustomDocs: getCustomDocs((0, import_node_path23.join)(path8, "docs")),
4171
+ getCustomDocs: getCustomDocs((0, import_node_path24.join)(path8, "docs")),
3906
4172
  /**
3907
4173
  * Writes a custom doc to EventCatalog
3908
4174
  * @param customDoc - The custom doc to write
3909
4175
  * @param options - Optional options to write the custom doc
3910
4176
  *
3911
4177
  */
3912
- writeCustomDoc: writeCustomDoc((0, import_node_path23.join)(path8, "docs")),
4178
+ writeCustomDoc: writeCustomDoc((0, import_node_path24.join)(path8, "docs")),
3913
4179
  /**
3914
4180
  * Removes a custom doc from EventCatalog
3915
4181
  * @param path - The path to the custom doc to remove
3916
4182
  *
3917
4183
  */
3918
- rmCustomDoc: rmCustomDoc((0, import_node_path23.join)(path8, "docs")),
4184
+ rmCustomDoc: rmCustomDoc((0, import_node_path24.join)(path8, "docs")),
3919
4185
  /**
3920
4186
  * Dumps the catalog to a JSON file.
3921
4187
  * @param directory - The directory to dump the catalog to
3922
4188
  * @returns A JSON file with the catalog
3923
4189
  */
3924
- dumpCatalog: dumpCatalog((0, import_node_path23.join)(path8)),
4190
+ dumpCatalog: dumpCatalog((0, import_node_path24.join)(path8)),
3925
4191
  /**
3926
4192
  * Returns the event catalog configuration file.
3927
4193
  * The event catalog configuration file is the file that contains the configuration for the event catalog.
@@ -3929,7 +4195,7 @@ var src_default = (path8) => {
3929
4195
  * @param directory - The directory of the catalog.
3930
4196
  * @returns A JSON object with the configuration for the event catalog.
3931
4197
  */
3932
- getEventCatalogConfigurationFile: getEventCatalogConfigurationFile((0, import_node_path23.join)(path8)),
4198
+ getEventCatalogConfigurationFile: getEventCatalogConfigurationFile((0, import_node_path24.join)(path8)),
3933
4199
  /**
3934
4200
  * ================================
3935
4201
  * Changelogs
@@ -3943,7 +4209,7 @@ var src_default = (path8) => {
3943
4209
  * @param options - Optional options (version, format)
3944
4210
  *
3945
4211
  */
3946
- writeChangelog: writeChangelog((0, import_node_path23.join)(path8)),
4212
+ writeChangelog: writeChangelog((0, import_node_path24.join)(path8)),
3947
4213
  /**
3948
4214
  * Appends a changelog entry to an existing changelog for a resource.
3949
4215
  * If no changelog exists, one is created.
@@ -3953,7 +4219,7 @@ var src_default = (path8) => {
3953
4219
  * @param options - Optional options (version, format)
3954
4220
  *
3955
4221
  */
3956
- appendChangelog: appendChangelog((0, import_node_path23.join)(path8)),
4222
+ appendChangelog: appendChangelog((0, import_node_path24.join)(path8)),
3957
4223
  /**
3958
4224
  * Returns the changelog for a resource in EventCatalog
3959
4225
  *
@@ -3961,7 +4227,7 @@ var src_default = (path8) => {
3961
4227
  * @param options - Optional options (version)
3962
4228
  * @returns Changelog|Undefined
3963
4229
  */
3964
- getChangelog: getChangelog((0, import_node_path23.join)(path8)),
4230
+ getChangelog: getChangelog((0, import_node_path24.join)(path8)),
3965
4231
  /**
3966
4232
  * Removes the changelog for a resource in EventCatalog
3967
4233
  *
@@ -3969,7 +4235,7 @@ var src_default = (path8) => {
3969
4235
  * @param options - Optional options (version)
3970
4236
  *
3971
4237
  */
3972
- rmChangelog: rmChangelog((0, import_node_path23.join)(path8)),
4238
+ rmChangelog: rmChangelog((0, import_node_path24.join)(path8)),
3973
4239
  /**
3974
4240
  * ================================
3975
4241
  * Resources Utils
@@ -3994,26 +4260,26 @@ var src_default = (path8) => {
3994
4260
  * @param path - The path to the message to retrieve
3995
4261
  * @returns Message|Undefined
3996
4262
  */
3997
- getMessageBySchemaPath: getMessageBySchemaPath((0, import_node_path23.join)(path8)),
4263
+ getMessageBySchemaPath: getMessageBySchemaPath((0, import_node_path24.join)(path8)),
3998
4264
  /**
3999
- * Returns the producers and consumers (services) for a given message
4265
+ * Returns the producers and consumers (services and agents) for a given message
4000
4266
  * @param id - The id of the message to get the producers and consumers for
4001
4267
  * @param version - Optional version of the message
4002
- * @returns { producers: Service[], consumers: Service[] }
4268
+ * @returns { producers: (Service|Agent)[], consumers: (Service|Agent)[] }
4003
4269
  */
4004
- getProducersAndConsumersForMessage: getProducersAndConsumersForMessage((0, import_node_path23.join)(path8)),
4270
+ getProducersAndConsumersForMessage: getProducersAndConsumersForMessage((0, import_node_path24.join)(path8)),
4005
4271
  /**
4006
4272
  * Returns the consumers of a given schema path
4007
4273
  * @param path - The path to the schema to get the consumers for
4008
- * @returns Service[]
4274
+ * @returns (Service|Agent)[]
4009
4275
  */
4010
- getConsumersOfSchema: getConsumersOfSchema((0, import_node_path23.join)(path8)),
4276
+ getConsumersOfSchema: getConsumersOfSchema((0, import_node_path24.join)(path8)),
4011
4277
  /**
4012
4278
  * Returns the producers of a given schema path
4013
4279
  * @param path - The path to the schema to get the producers for
4014
- * @returns Service[]
4280
+ * @returns (Service|Agent)[]
4015
4281
  */
4016
- getProducersOfSchema: getProducersOfSchema((0, import_node_path23.join)(path8)),
4282
+ getProducersOfSchema: getProducersOfSchema((0, import_node_path24.join)(path8)),
4017
4283
  /**
4018
4284
  * Returns the schema for a given message (event, command or query) by its id and version.
4019
4285
  * If no version is given, the latest version is used.
@@ -4021,14 +4287,14 @@ var src_default = (path8) => {
4021
4287
  * @param version - Optional version of the message
4022
4288
  * @returns { schema: string, fileName: string } | undefined
4023
4289
  */
4024
- getSchemaForMessage: getSchemaForMessage((0, import_node_path23.join)(path8)),
4290
+ getSchemaForMessage: getSchemaForMessage((0, import_node_path24.join)(path8)),
4025
4291
  /**
4026
4292
  * Returns the owners for a given resource (e.g domain, service, event, command, query, etc.)
4027
4293
  * @param id - The id of the resource to get the owners for
4028
4294
  * @param version - Optional version of the resource
4029
4295
  * @returns { owners: User[] }
4030
4296
  */
4031
- getOwnersForResource: getOwnersForResource((0, import_node_path23.join)(path8)),
4297
+ getOwnersForResource: getOwnersForResource((0, import_node_path24.join)(path8)),
4032
4298
  /**
4033
4299
  * ================================
4034
4300
  * Entities
@@ -4040,13 +4306,13 @@ var src_default = (path8) => {
4040
4306
  * @param version - Optional id of the version to get (supports semver)
4041
4307
  * @returns Entity|Undefined
4042
4308
  */
4043
- getEntity: getEntity((0, import_node_path23.join)(path8)),
4309
+ getEntity: getEntity((0, import_node_path24.join)(path8)),
4044
4310
  /**
4045
4311
  * Returns all entities from EventCatalog
4046
4312
  * @param latestOnly - optional boolean, set to true to get only latest versions
4047
4313
  * @returns Entity[]|Undefined
4048
4314
  */
4049
- getEntities: getEntities((0, import_node_path23.join)(path8)),
4315
+ getEntities: getEntities((0, import_node_path24.join)(path8)),
4050
4316
  /**
4051
4317
  * Adds an entity to EventCatalog
4052
4318
  *
@@ -4054,33 +4320,33 @@ var src_default = (path8) => {
4054
4320
  * @param options - Optional options to write the entity
4055
4321
  *
4056
4322
  */
4057
- writeEntity: writeEntity((0, import_node_path23.join)(path8, "entities")),
4323
+ writeEntity: writeEntity((0, import_node_path24.join)(path8, "entities")),
4058
4324
  /**
4059
4325
  * Remove an entity from EventCatalog (modeled on the standard POSIX rm utility)
4060
4326
  *
4061
4327
  * @param path - The path to your entity, e.g. `/User`
4062
4328
  *
4063
4329
  */
4064
- rmEntity: rmEntity((0, import_node_path23.join)(path8, "entities")),
4330
+ rmEntity: rmEntity((0, import_node_path24.join)(path8, "entities")),
4065
4331
  /**
4066
4332
  * Remove an entity by an entity id
4067
4333
  *
4068
4334
  * @param id - The id of the entity you want to remove
4069
4335
  *
4070
4336
  */
4071
- rmEntityById: rmEntityById((0, import_node_path23.join)(path8)),
4337
+ rmEntityById: rmEntityById((0, import_node_path24.join)(path8)),
4072
4338
  /**
4073
4339
  * Moves a given entity id to the version directory
4074
4340
  * @param id - The id of the entity to version
4075
4341
  */
4076
- versionEntity: versionEntity((0, import_node_path23.join)(path8)),
4342
+ versionEntity: versionEntity((0, import_node_path24.join)(path8)),
4077
4343
  /**
4078
4344
  * Check to see if an entity version exists
4079
4345
  * @param id - The id of the entity
4080
4346
  * @param version - The version of the entity (supports semver)
4081
4347
  * @returns
4082
4348
  */
4083
- entityHasVersion: entityHasVersion((0, import_node_path23.join)(path8)),
4349
+ entityHasVersion: entityHasVersion((0, import_node_path24.join)(path8)),
4084
4350
  /**
4085
4351
  * ================================
4086
4352
  * Flows
@@ -4093,7 +4359,7 @@ var src_default = (path8) => {
4093
4359
  * @param version - Optional version of the flow
4094
4360
  * @returns Flow
4095
4361
  */
4096
- getFlow: getFlow((0, import_node_path23.join)(path8)),
4362
+ getFlow: getFlow((0, import_node_path24.join)(path8)),
4097
4363
  /**
4098
4364
  * Returns all flows from EventCatalog
4099
4365
  *
@@ -4101,7 +4367,7 @@ var src_default = (path8) => {
4101
4367
  * @param latestOnly - optional boolean, set to true to get only latest versions
4102
4368
  * @returns Flow[]|Undefined
4103
4369
  */
4104
- getFlows: getFlows((0, import_node_path23.join)(path8)),
4370
+ getFlows: getFlows((0, import_node_path24.join)(path8)),
4105
4371
  /**
4106
4372
  * Adds a flow to EventCatalog
4107
4373
  *
@@ -4109,14 +4375,14 @@ var src_default = (path8) => {
4109
4375
  * @param options - Optional options to write the flow
4110
4376
  *
4111
4377
  */
4112
- writeFlow: writeFlow((0, import_node_path23.join)(path8, "flows")),
4378
+ writeFlow: writeFlow((0, import_node_path24.join)(path8, "flows")),
4113
4379
  /**
4114
4380
  * Adds a versioned flow to EventCatalog
4115
4381
  *
4116
4382
  * @param flow - The flow to write
4117
4383
  *
4118
4384
  */
4119
- writeVersionedFlow: writeVersionedFlow((0, import_node_path23.join)(path8, "flows")),
4385
+ writeVersionedFlow: writeVersionedFlow((0, import_node_path24.join)(path8, "flows")),
4120
4386
  /**
4121
4387
  * Adds a flow to a domain in EventCatalog
4122
4388
  *
@@ -4125,7 +4391,7 @@ var src_default = (path8) => {
4125
4391
  * @param options - Optional options to write the flow
4126
4392
  *
4127
4393
  */
4128
- writeFlowToDomain: writeFlowToDomain((0, import_node_path23.join)(path8, "domains")),
4394
+ writeFlowToDomain: writeFlowToDomain((0, import_node_path24.join)(path8, "domains")),
4129
4395
  /**
4130
4396
  * Adds a flow to a service in EventCatalog
4131
4397
  *
@@ -4134,33 +4400,42 @@ var src_default = (path8) => {
4134
4400
  * @param options - Optional options to write the flow
4135
4401
  *
4136
4402
  */
4137
- writeFlowToService: writeFlowToService((0, import_node_path23.join)(path8, "services")),
4403
+ writeFlowToService: writeFlowToService((0, import_node_path24.join)(path8, "services")),
4404
+ /**
4405
+ * Adds a flow to an agent in EventCatalog
4406
+ *
4407
+ * @param flow - The flow to write to the agent
4408
+ * @param agent - The agent and its id to write the flow to
4409
+ * @param options - Optional options to write the flow
4410
+ *
4411
+ */
4412
+ writeFlowToAgent: writeFlowToAgent((0, import_node_path24.join)(path8, "agents")),
4138
4413
  /**
4139
4414
  * Remove a flow from EventCatalog (modeled on the standard POSIX rm utility)
4140
4415
  *
4141
4416
  * @param path - The path to your flow, e.g. `/PaymentFlow`
4142
4417
  *
4143
4418
  */
4144
- rmFlow: rmFlow((0, import_node_path23.join)(path8, "flows")),
4419
+ rmFlow: rmFlow((0, import_node_path24.join)(path8, "flows")),
4145
4420
  /**
4146
4421
  * Remove a flow by a flow id
4147
4422
  *
4148
4423
  * @param id - The id of the flow you want to remove
4149
4424
  *
4150
4425
  */
4151
- rmFlowById: rmFlowById((0, import_node_path23.join)(path8)),
4426
+ rmFlowById: rmFlowById((0, import_node_path24.join)(path8)),
4152
4427
  /**
4153
4428
  * Moves a given flow id to the version directory
4154
4429
  * @param id - The id of the flow to version
4155
4430
  */
4156
- versionFlow: versionFlow((0, import_node_path23.join)(path8)),
4431
+ versionFlow: versionFlow((0, import_node_path24.join)(path8)),
4157
4432
  /**
4158
4433
  * Check to see if a flow version exists
4159
4434
  * @param id - The id of the flow
4160
4435
  * @param version - The version of the flow (supports semver)
4161
4436
  * @returns
4162
4437
  */
4163
- flowHasVersion: flowHasVersion((0, import_node_path23.join)(path8)),
4438
+ flowHasVersion: flowHasVersion((0, import_node_path24.join)(path8)),
4164
4439
  /**
4165
4440
  * Adds a file to the given flow
4166
4441
  * @param id - The id of the flow to add the file to
@@ -4168,7 +4443,7 @@ var src_default = (path8) => {
4168
4443
  * @param version - Optional version of the flow to add the file to
4169
4444
  * @returns
4170
4445
  */
4171
- addFileToFlow: addFileToFlow((0, import_node_path23.join)(path8)),
4446
+ addFileToFlow: addFileToFlow((0, import_node_path24.join)(path8)),
4172
4447
  /**
4173
4448
  * ================================
4174
4449
  * Data Stores
@@ -4180,42 +4455,42 @@ var src_default = (path8) => {
4180
4455
  * @param options - Optional options to write the data store
4181
4456
  *
4182
4457
  */
4183
- writeDataStore: writeDataStore((0, import_node_path23.join)(path8, "containers")),
4458
+ writeDataStore: writeDataStore((0, import_node_path24.join)(path8, "containers")),
4184
4459
  /**
4185
4460
  * Returns a data store from EventCatalog
4186
4461
  * @param id - The id of the data store to retrieve
4187
4462
  * @param version - Optional id of the version to get (supports semver)
4188
4463
  * @returns Container|Undefined
4189
4464
  */
4190
- getDataStore: getDataStore((0, import_node_path23.join)(path8)),
4465
+ getDataStore: getDataStore((0, import_node_path24.join)(path8)),
4191
4466
  /**
4192
4467
  * Returns all data stores from EventCatalog
4193
4468
  * @param latestOnly - optional boolean, set to true to get only latest versions
4194
4469
  * @returns Container[]|Undefined
4195
4470
  */
4196
- getDataStores: getDataStores((0, import_node_path23.join)(path8)),
4471
+ getDataStores: getDataStores((0, import_node_path24.join)(path8)),
4197
4472
  /**
4198
4473
  * Version a data store by its id
4199
4474
  * @param id - The id of the data store to version
4200
4475
  */
4201
- versionDataStore: versionDataStore((0, import_node_path23.join)(path8, "containers")),
4476
+ versionDataStore: versionDataStore((0, import_node_path24.join)(path8, "containers")),
4202
4477
  /**
4203
4478
  * Remove a data store by its path
4204
4479
  * @param path - The path to the data store to remove
4205
4480
  */
4206
- rmDataStore: rmDataStore((0, import_node_path23.join)(path8, "containers")),
4481
+ rmDataStore: rmDataStore((0, import_node_path24.join)(path8, "containers")),
4207
4482
  /**
4208
4483
  * Remove a data store by its id
4209
4484
  * @param id - The id of the data store to remove
4210
4485
  */
4211
- rmDataStoreById: rmDataStoreById((0, import_node_path23.join)(path8)),
4486
+ rmDataStoreById: rmDataStoreById((0, import_node_path24.join)(path8)),
4212
4487
  /**
4213
4488
  * Check to see if a data store version exists
4214
4489
  * @param id - The id of the data store
4215
4490
  * @param version - The version of the data store (supports semver)
4216
4491
  * @returns
4217
4492
  */
4218
- dataStoreHasVersion: dataStoreHasVersion((0, import_node_path23.join)(path8)),
4493
+ dataStoreHasVersion: dataStoreHasVersion((0, import_node_path24.join)(path8)),
4219
4494
  /**
4220
4495
  * Adds a file to a data store by its id
4221
4496
  * @param id - The id of the data store to add the file to
@@ -4223,14 +4498,14 @@ var src_default = (path8) => {
4223
4498
  * @param version - Optional version of the data store to add the file to
4224
4499
  * @returns
4225
4500
  */
4226
- addFileToDataStore: addFileToDataStore((0, import_node_path23.join)(path8)),
4501
+ addFileToDataStore: addFileToDataStore((0, import_node_path24.join)(path8)),
4227
4502
  /**
4228
4503
  * Writes a data store to a service by its id
4229
4504
  * @param dataStore - The data store to write
4230
4505
  * @param service - The service to write the data store to
4231
4506
  * @returns
4232
4507
  */
4233
- writeDataStoreToService: writeDataStoreToService((0, import_node_path23.join)(path8)),
4508
+ writeDataStoreToService: writeDataStoreToService((0, import_node_path24.join)(path8)),
4234
4509
  /**
4235
4510
  * ================================
4236
4511
  * Data Products
@@ -4242,7 +4517,7 @@ var src_default = (path8) => {
4242
4517
  * @param options - Optional options to write the data product
4243
4518
  *
4244
4519
  */
4245
- writeDataProduct: writeDataProduct((0, import_node_path23.join)(path8, "data-products")),
4520
+ writeDataProduct: writeDataProduct((0, import_node_path24.join)(path8, "data-products")),
4246
4521
  /**
4247
4522
  * Writes a data product to a domain in EventCatalog
4248
4523
  * @param dataProduct - The data product to write
@@ -4250,43 +4525,43 @@ var src_default = (path8) => {
4250
4525
  * @param options - Optional options to write the data product
4251
4526
  *
4252
4527
  */
4253
- writeDataProductToDomain: writeDataProductToDomain((0, import_node_path23.join)(path8, "domains")),
4528
+ writeDataProductToDomain: writeDataProductToDomain((0, import_node_path24.join)(path8, "domains")),
4254
4529
  /**
4255
4530
  * Returns a data product from EventCatalog
4256
4531
  * @param id - The id of the data product to retrieve
4257
4532
  * @param version - Optional id of the version to get (supports semver)
4258
4533
  * @returns DataProduct|Undefined
4259
4534
  */
4260
- getDataProduct: getDataProduct((0, import_node_path23.join)(path8)),
4535
+ getDataProduct: getDataProduct((0, import_node_path24.join)(path8)),
4261
4536
  /**
4262
4537
  * Returns all data products from EventCatalog
4263
4538
  * @param latestOnly - optional boolean, set to true to get only latest versions
4264
4539
  * @returns DataProduct[]|Undefined
4265
4540
  */
4266
- getDataProducts: getDataProducts((0, import_node_path23.join)(path8)),
4541
+ getDataProducts: getDataProducts((0, import_node_path24.join)(path8)),
4267
4542
  /**
4268
4543
  * Version a data product by its id
4269
4544
  * @param id - The id of the data product to version
4270
4545
  */
4271
- versionDataProduct: versionDataProduct((0, import_node_path23.join)(path8)),
4546
+ versionDataProduct: versionDataProduct((0, import_node_path24.join)(path8)),
4272
4547
  /**
4273
4548
  * Remove a data product by its path
4274
4549
  * @param path - The path to the data product to remove
4275
4550
  */
4276
- rmDataProduct: rmDataProduct((0, import_node_path23.join)(path8, "data-products")),
4551
+ rmDataProduct: rmDataProduct((0, import_node_path24.join)(path8, "data-products")),
4277
4552
  /**
4278
4553
  * Remove a data product by its id
4279
4554
  * @param id - The id of the data product to remove
4280
4555
  * @param version - Optional version of the data product to remove
4281
4556
  */
4282
- rmDataProductById: rmDataProductById((0, import_node_path23.join)(path8)),
4557
+ rmDataProductById: rmDataProductById((0, import_node_path24.join)(path8)),
4283
4558
  /**
4284
4559
  * Check to see if a data product version exists
4285
4560
  * @param id - The id of the data product
4286
4561
  * @param version - The version of the data product (supports semver)
4287
4562
  * @returns
4288
4563
  */
4289
- dataProductHasVersion: dataProductHasVersion((0, import_node_path23.join)(path8)),
4564
+ dataProductHasVersion: dataProductHasVersion((0, import_node_path24.join)(path8)),
4290
4565
  /**
4291
4566
  * Adds a file to a data product by its id
4292
4567
  * @param id - The id of the data product to add the file to
@@ -4294,7 +4569,7 @@ var src_default = (path8) => {
4294
4569
  * @param version - Optional version of the data product to add the file to
4295
4570
  * @returns
4296
4571
  */
4297
- addFileToDataProduct: addFileToDataProduct((0, import_node_path23.join)(path8)),
4572
+ addFileToDataProduct: addFileToDataProduct((0, import_node_path24.join)(path8)),
4298
4573
  /**
4299
4574
  * Adds a data product to a domain
4300
4575
  * @param id - The id of the domain
@@ -4302,7 +4577,7 @@ var src_default = (path8) => {
4302
4577
  * @param version - (Optional) The version of the domain to add the data product to
4303
4578
  * @returns
4304
4579
  */
4305
- addDataProductToDomain: addDataProductToDomain((0, import_node_path23.join)(path8, "domains")),
4580
+ addDataProductToDomain: addDataProductToDomain((0, import_node_path24.join)(path8, "domains")),
4306
4581
  /**
4307
4582
  * ================================
4308
4583
  * Diagrams
@@ -4314,13 +4589,13 @@ var src_default = (path8) => {
4314
4589
  * @param version - Optional id of the version to get (supports semver)
4315
4590
  * @returns Diagram|Undefined
4316
4591
  */
4317
- getDiagram: getDiagram((0, import_node_path23.join)(path8)),
4592
+ getDiagram: getDiagram((0, import_node_path24.join)(path8)),
4318
4593
  /**
4319
4594
  * Returns all diagrams from EventCatalog
4320
4595
  * @param latestOnly - optional boolean, set to true to get only latest versions
4321
4596
  * @returns Diagram[]|Undefined
4322
4597
  */
4323
- getDiagrams: getDiagrams((0, import_node_path23.join)(path8)),
4598
+ getDiagrams: getDiagrams((0, import_node_path24.join)(path8)),
4324
4599
  /**
4325
4600
  * Adds a diagram to EventCatalog
4326
4601
  *
@@ -4328,33 +4603,33 @@ var src_default = (path8) => {
4328
4603
  * @param options - Optional options to write the diagram
4329
4604
  *
4330
4605
  */
4331
- writeDiagram: writeDiagram((0, import_node_path23.join)(path8, "diagrams")),
4606
+ writeDiagram: writeDiagram((0, import_node_path24.join)(path8, "diagrams")),
4332
4607
  /**
4333
4608
  * Remove a diagram from EventCatalog (modeled on the standard POSIX rm utility)
4334
4609
  *
4335
4610
  * @param path - The path to your diagram, e.g. `/ArchitectureDiagram`
4336
4611
  *
4337
4612
  */
4338
- rmDiagram: rmDiagram((0, import_node_path23.join)(path8, "diagrams")),
4613
+ rmDiagram: rmDiagram((0, import_node_path24.join)(path8, "diagrams")),
4339
4614
  /**
4340
4615
  * Remove a diagram by a diagram id
4341
4616
  *
4342
4617
  * @param id - The id of the diagram you want to remove
4343
4618
  *
4344
4619
  */
4345
- rmDiagramById: rmDiagramById((0, import_node_path23.join)(path8)),
4620
+ rmDiagramById: rmDiagramById((0, import_node_path24.join)(path8)),
4346
4621
  /**
4347
4622
  * Moves a given diagram id to the version directory
4348
4623
  * @param id - The id of the diagram to version
4349
4624
  */
4350
- versionDiagram: versionDiagram((0, import_node_path23.join)(path8)),
4625
+ versionDiagram: versionDiagram((0, import_node_path24.join)(path8)),
4351
4626
  /**
4352
4627
  * Check to see if a diagram version exists
4353
4628
  * @param id - The id of the diagram
4354
4629
  * @param version - The version of the diagram (supports semver)
4355
4630
  * @returns
4356
4631
  */
4357
- diagramHasVersion: diagramHasVersion((0, import_node_path23.join)(path8)),
4632
+ diagramHasVersion: diagramHasVersion((0, import_node_path24.join)(path8)),
4358
4633
  /**
4359
4634
  * Adds a file to the given diagram
4360
4635
  * @param id - The id of the diagram to add the file to
@@ -4362,7 +4637,7 @@ var src_default = (path8) => {
4362
4637
  * @param version - Optional version of the diagram to add the file to
4363
4638
  * @returns
4364
4639
  */
4365
- addFileToDiagram: addFileToDiagram((0, import_node_path23.join)(path8)),
4640
+ addFileToDiagram: addFileToDiagram((0, import_node_path24.join)(path8)),
4366
4641
  /**
4367
4642
  * ================================
4368
4643
  * DSL
@@ -4381,21 +4656,21 @@ var src_default = (path8) => {
4381
4656
  * const dsl = await sdk.toDSL(services, { type: 'service', hydrate: true });
4382
4657
  * ```
4383
4658
  */
4384
- createSnapshot: createSnapshot((0, import_node_path23.join)(path8)),
4385
- diffSnapshots: diffSnapshots((0, import_node_path23.join)(path8)),
4386
- listSnapshots: listSnapshots((0, import_node_path23.join)(path8)),
4387
- toDSL: toDSL((0, import_node_path23.join)(path8), {
4388
- getEvent: getEvent((0, import_node_path23.join)(path8)),
4389
- getCommand: getCommand((0, import_node_path23.join)(path8)),
4390
- getQuery: getQuery((0, import_node_path23.join)(path8)),
4391
- getService: getService((0, import_node_path23.join)(path8)),
4392
- getServices: getServices((0, import_node_path23.join)(path8)),
4393
- getDomain: getDomain((0, import_node_path23.join)(path8, "domains")),
4394
- getChannel: getChannel((0, import_node_path23.join)(path8)),
4395
- getChannels: getChannels((0, import_node_path23.join)(path8)),
4396
- getContainer: getDataStore((0, import_node_path23.join)(path8)),
4397
- getTeam: getTeam((0, import_node_path23.join)(path8, "teams")),
4398
- getUser: getUser((0, import_node_path23.join)(path8, "users"))
4659
+ createSnapshot: createSnapshot((0, import_node_path24.join)(path8)),
4660
+ diffSnapshots: diffSnapshots((0, import_node_path24.join)(path8)),
4661
+ listSnapshots: listSnapshots((0, import_node_path24.join)(path8)),
4662
+ toDSL: toDSL((0, import_node_path24.join)(path8), {
4663
+ getEvent: getEvent((0, import_node_path24.join)(path8)),
4664
+ getCommand: getCommand((0, import_node_path24.join)(path8)),
4665
+ getQuery: getQuery((0, import_node_path24.join)(path8)),
4666
+ getService: getService((0, import_node_path24.join)(path8)),
4667
+ getServices: getServices((0, import_node_path24.join)(path8)),
4668
+ getDomain: getDomain((0, import_node_path24.join)(path8, "domains")),
4669
+ getChannel: getChannel((0, import_node_path24.join)(path8)),
4670
+ getChannels: getChannels((0, import_node_path24.join)(path8)),
4671
+ getContainer: getDataStore((0, import_node_path24.join)(path8)),
4672
+ getTeam: getTeam((0, import_node_path24.join)(path8, "teams")),
4673
+ getUser: getUser((0, import_node_path24.join)(path8, "users"))
4399
4674
  })
4400
4675
  };
4401
4676
  };