agent-swarm-kit 1.0.87 → 1.0.88

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/build/index.cjs CHANGED
@@ -7217,6 +7217,7 @@ var BusService = /** @class */ (function () {
7217
7217
  var MAX_NESTING = 10;
7218
7218
  var UML_STEP = "\t";
7219
7219
  var UML_BULLET = "•";
7220
+ var UML_TRIANGLE = "►";
7220
7221
  /**
7221
7222
  * Creates a function to serialize meta nodes to UML format.
7222
7223
  * @returns {Function} A function that takes an array of IMetaNode and returns a string in UML format.
@@ -7267,7 +7268,8 @@ var AgentMetaService = /** @class */ (function () {
7267
7268
  * @param {AgentName} agentName - The name of the agent.
7268
7269
  * @returns {IMetaNode} The created meta node.
7269
7270
  */
7270
- this.makeAgentNode = function (agentName) {
7271
+ this.makeAgentNode = function (agentName, seen) {
7272
+ if (seen === void 0) { seen = new Set(); }
7271
7273
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
7272
7274
  _this.loggerService.info("agentMetaService makeAgentNode", {
7273
7275
  agentName: agentName,
@@ -7276,39 +7278,41 @@ var AgentMetaService = /** @class */ (function () {
7276
7278
  var agentTree = [];
7277
7279
  if (dependsOn) {
7278
7280
  agentTree.push({
7279
- name: "Agents",
7281
+ name: "".concat(UML_TRIANGLE, " Agents"),
7280
7282
  });
7281
- dependsOn
7283
+ var subtree = dependsOn
7282
7284
  .filter(function (name) { return !!name; })
7283
- .map(_this.makeAgentNode)
7284
- .forEach(function (node) { return agentTree.push(node); });
7285
+ .map(!seen.has(agentName)
7286
+ ? function (name) { return _this.makeAgentNode(name, new Set(seen).add(agentName)); }
7287
+ : function (name) { return ({ name: name }); });
7288
+ !subtree.length && subtree.push({ name: "Nothing found" });
7289
+ subtree.forEach(function (node) { return agentTree.push(node); });
7285
7290
  }
7286
7291
  if (states) {
7287
7292
  agentTree.push({
7288
- name: "States",
7293
+ name: "".concat(UML_TRIANGLE, " States"),
7289
7294
  });
7290
- states
7291
- .filter(function (name) { return !!name; })
7292
- .map(function (name) { return ({ name: name }); })
7293
- .forEach(function (node) { return agentTree.push(node); });
7295
+ var subtree = states.filter(function (name) { return !!name; }).map(function (name) { return ({ name: name }); });
7296
+ !subtree.length && subtree.push({ name: "Nothing found" });
7297
+ subtree.forEach(function (node) { return agentTree.push(node); });
7294
7298
  }
7295
7299
  if (storages) {
7296
7300
  agentTree.push({
7297
- name: "Storages",
7301
+ name: "".concat(UML_TRIANGLE, " Storages"),
7298
7302
  });
7299
- storages
7303
+ var subtree = storages
7300
7304
  .filter(function (name) { return !!name; })
7301
- .map(function (name) { return ({ name: name }); })
7302
- .forEach(function (node) { return agentTree.push(node); });
7305
+ .map(function (name) { return ({ name: name }); });
7306
+ !subtree.length && subtree.push({ name: "Nothing found" });
7307
+ subtree.forEach(function (node) { return agentTree.push(node); });
7303
7308
  }
7304
7309
  if (tools) {
7305
7310
  agentTree.push({
7306
- name: "Tools",
7311
+ name: "".concat(UML_TRIANGLE, " Tools"),
7307
7312
  });
7308
- tools
7309
- .filter(function (name) { return !!name; })
7310
- .map(function (name) { return ({ name: name }); })
7311
- .forEach(function (node) { return agentTree.push(node); });
7313
+ var subtree = tools.filter(function (name) { return !!name; }).map(function (name) { return ({ name: name }); });
7314
+ !subtree.length && subtree.push({ name: "Nothing found" });
7315
+ subtree.forEach(function (node) { return agentTree.push(node); });
7312
7316
  }
7313
7317
  return {
7314
7318
  name: agentName,
package/build/index.mjs CHANGED
@@ -7215,6 +7215,7 @@ var BusService = /** @class */ (function () {
7215
7215
  var MAX_NESTING = 10;
7216
7216
  var UML_STEP = "\t";
7217
7217
  var UML_BULLET = "•";
7218
+ var UML_TRIANGLE = "►";
7218
7219
  /**
7219
7220
  * Creates a function to serialize meta nodes to UML format.
7220
7221
  * @returns {Function} A function that takes an array of IMetaNode and returns a string in UML format.
@@ -7265,7 +7266,8 @@ var AgentMetaService = /** @class */ (function () {
7265
7266
  * @param {AgentName} agentName - The name of the agent.
7266
7267
  * @returns {IMetaNode} The created meta node.
7267
7268
  */
7268
- this.makeAgentNode = function (agentName) {
7269
+ this.makeAgentNode = function (agentName, seen) {
7270
+ if (seen === void 0) { seen = new Set(); }
7269
7271
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
7270
7272
  _this.loggerService.info("agentMetaService makeAgentNode", {
7271
7273
  agentName: agentName,
@@ -7274,39 +7276,41 @@ var AgentMetaService = /** @class */ (function () {
7274
7276
  var agentTree = [];
7275
7277
  if (dependsOn) {
7276
7278
  agentTree.push({
7277
- name: "Agents",
7279
+ name: "".concat(UML_TRIANGLE, " Agents"),
7278
7280
  });
7279
- dependsOn
7281
+ var subtree = dependsOn
7280
7282
  .filter(function (name) { return !!name; })
7281
- .map(_this.makeAgentNode)
7282
- .forEach(function (node) { return agentTree.push(node); });
7283
+ .map(!seen.has(agentName)
7284
+ ? function (name) { return _this.makeAgentNode(name, new Set(seen).add(agentName)); }
7285
+ : function (name) { return ({ name: name }); });
7286
+ !subtree.length && subtree.push({ name: "Nothing found" });
7287
+ subtree.forEach(function (node) { return agentTree.push(node); });
7283
7288
  }
7284
7289
  if (states) {
7285
7290
  agentTree.push({
7286
- name: "States",
7291
+ name: "".concat(UML_TRIANGLE, " States"),
7287
7292
  });
7288
- states
7289
- .filter(function (name) { return !!name; })
7290
- .map(function (name) { return ({ name: name }); })
7291
- .forEach(function (node) { return agentTree.push(node); });
7293
+ var subtree = states.filter(function (name) { return !!name; }).map(function (name) { return ({ name: name }); });
7294
+ !subtree.length && subtree.push({ name: "Nothing found" });
7295
+ subtree.forEach(function (node) { return agentTree.push(node); });
7292
7296
  }
7293
7297
  if (storages) {
7294
7298
  agentTree.push({
7295
- name: "Storages",
7299
+ name: "".concat(UML_TRIANGLE, " Storages"),
7296
7300
  });
7297
- storages
7301
+ var subtree = storages
7298
7302
  .filter(function (name) { return !!name; })
7299
- .map(function (name) { return ({ name: name }); })
7300
- .forEach(function (node) { return agentTree.push(node); });
7303
+ .map(function (name) { return ({ name: name }); });
7304
+ !subtree.length && subtree.push({ name: "Nothing found" });
7305
+ subtree.forEach(function (node) { return agentTree.push(node); });
7301
7306
  }
7302
7307
  if (tools) {
7303
7308
  agentTree.push({
7304
- name: "Tools",
7309
+ name: "".concat(UML_TRIANGLE, " Tools"),
7305
7310
  });
7306
- tools
7307
- .filter(function (name) { return !!name; })
7308
- .map(function (name) { return ({ name: name }); })
7309
- .forEach(function (node) { return agentTree.push(node); });
7311
+ var subtree = tools.filter(function (name) { return !!name; }).map(function (name) { return ({ name: name }); });
7312
+ !subtree.length && subtree.push({ name: "Nothing found" });
7313
+ subtree.forEach(function (node) { return agentTree.push(node); });
7310
7314
  }
7311
7315
  return {
7312
7316
  name: agentName,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-swarm-kit",
3
- "version": "1.0.87",
3
+ "version": "1.0.88",
4
4
  "description": "A TypeScript library for building orchestrated framework-agnostic multi-agent AI systems",
5
5
  "author": {
6
6
  "name": "Petr Tripolsky",
package/types.d.ts CHANGED
@@ -3054,7 +3054,7 @@ declare class AgentMetaService {
3054
3054
  * @param {AgentName} agentName - The name of the agent.
3055
3055
  * @returns {IMetaNode} The created meta node.
3056
3056
  */
3057
- makeAgentNode: (agentName: AgentName) => IMetaNode;
3057
+ makeAgentNode: (agentName: AgentName, seen?: Set<string>) => IMetaNode;
3058
3058
  /**
3059
3059
  * Converts the meta nodes of the given agent to UML format.
3060
3060
  * @param {AgentName} agentName - The name of the agent.