agent-swarm-kit 1.0.88 → 1.0.90

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
@@ -7216,8 +7216,8 @@ var BusService = /** @class */ (function () {
7216
7216
 
7217
7217
  var MAX_NESTING = 10;
7218
7218
  var UML_STEP = "\t";
7219
- var UML_BULLET = "";
7220
- var UML_TRIANGLE = "";
7219
+ var UML_BULLET = "[*]";
7220
+ var UML_TRIANGLE = "[>]";
7221
7221
  /**
7222
7222
  * Creates a function to serialize meta nodes to UML format.
7223
7223
  * @returns {Function} A function that takes an array of IMetaNode and returns a string in UML format.
@@ -7280,10 +7280,11 @@ var AgentMetaService = /** @class */ (function () {
7280
7280
  agentTree.push({
7281
7281
  name: "".concat(UML_TRIANGLE, " Agents"),
7282
7282
  });
7283
+ var childSeen_1 = new Set(seen).add(agentName);
7283
7284
  var subtree = dependsOn
7284
7285
  .filter(function (name) { return !!name; })
7285
7286
  .map(!seen.has(agentName)
7286
- ? function (name) { return _this.makeAgentNode(name, new Set(seen).add(agentName)); }
7287
+ ? function (name) { return _this.makeAgentNodeCommon(name, childSeen_1); }
7287
7288
  : function (name) { return ({ name: name }); });
7288
7289
  !subtree.length && subtree.push({ name: "Nothing found" });
7289
7290
  subtree.forEach(function (node) { return agentTree.push(node); });
@@ -7319,6 +7320,36 @@ var AgentMetaService = /** @class */ (function () {
7319
7320
  child: agentTree,
7320
7321
  };
7321
7322
  };
7323
+ /**
7324
+ * Creates a meta node for the given agent.
7325
+ * @param {AgentName} agentName - The name of the agent.
7326
+ * @returns {IMetaNode} The created meta node.
7327
+ */
7328
+ this.makeAgentNodeCommon = function (agentName, seen) {
7329
+ if (seen === void 0) { seen = new Set(); }
7330
+ GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
7331
+ _this.loggerService.info("agentMetaService makeAgentNodeCommon", {
7332
+ agentName: agentName,
7333
+ });
7334
+ var dependsOn = _this.agentSchemaService.get(agentName).dependsOn;
7335
+ if (seen.has(agentName)) {
7336
+ return {
7337
+ name: agentName,
7338
+ };
7339
+ }
7340
+ else if (dependsOn) {
7341
+ var childSeen_2 = new Set(seen).add(agentName);
7342
+ return {
7343
+ name: agentName,
7344
+ child: dependsOn.map(function (name) { return _this.makeAgentNodeCommon(name, childSeen_2); }),
7345
+ };
7346
+ }
7347
+ else {
7348
+ return {
7349
+ name: agentName,
7350
+ };
7351
+ }
7352
+ };
7322
7353
  /**
7323
7354
  * Converts the meta nodes of the given agent to UML format.
7324
7355
  * @param {AgentName} agentName - The name of the agent.
@@ -7356,10 +7387,10 @@ var SwarmMetaService = /** @class */ (function () {
7356
7387
  _this.loggerService.info("swarmMetaService makeSwarmNode", {
7357
7388
  swarmName: swarmName,
7358
7389
  });
7359
- var agentList = _this.swarmSchemaService.get(swarmName).agentList;
7390
+ var defaultAgent = _this.swarmSchemaService.get(swarmName).defaultAgent;
7360
7391
  return {
7361
7392
  name: swarmName,
7362
- child: agentList.map(function (dep) { return _this.agentMetaService.makeAgentNode(dep); }),
7393
+ child: [_this.agentMetaService.makeAgentNodeCommon(defaultAgent)],
7363
7394
  };
7364
7395
  };
7365
7396
  /**
package/build/index.mjs CHANGED
@@ -7214,8 +7214,8 @@ var BusService = /** @class */ (function () {
7214
7214
 
7215
7215
  var MAX_NESTING = 10;
7216
7216
  var UML_STEP = "\t";
7217
- var UML_BULLET = "";
7218
- var UML_TRIANGLE = "";
7217
+ var UML_BULLET = "[*]";
7218
+ var UML_TRIANGLE = "[>]";
7219
7219
  /**
7220
7220
  * Creates a function to serialize meta nodes to UML format.
7221
7221
  * @returns {Function} A function that takes an array of IMetaNode and returns a string in UML format.
@@ -7278,10 +7278,11 @@ var AgentMetaService = /** @class */ (function () {
7278
7278
  agentTree.push({
7279
7279
  name: "".concat(UML_TRIANGLE, " Agents"),
7280
7280
  });
7281
+ var childSeen_1 = new Set(seen).add(agentName);
7281
7282
  var subtree = dependsOn
7282
7283
  .filter(function (name) { return !!name; })
7283
7284
  .map(!seen.has(agentName)
7284
- ? function (name) { return _this.makeAgentNode(name, new Set(seen).add(agentName)); }
7285
+ ? function (name) { return _this.makeAgentNodeCommon(name, childSeen_1); }
7285
7286
  : function (name) { return ({ name: name }); });
7286
7287
  !subtree.length && subtree.push({ name: "Nothing found" });
7287
7288
  subtree.forEach(function (node) { return agentTree.push(node); });
@@ -7317,6 +7318,36 @@ var AgentMetaService = /** @class */ (function () {
7317
7318
  child: agentTree,
7318
7319
  };
7319
7320
  };
7321
+ /**
7322
+ * Creates a meta node for the given agent.
7323
+ * @param {AgentName} agentName - The name of the agent.
7324
+ * @returns {IMetaNode} The created meta node.
7325
+ */
7326
+ this.makeAgentNodeCommon = function (agentName, seen) {
7327
+ if (seen === void 0) { seen = new Set(); }
7328
+ GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
7329
+ _this.loggerService.info("agentMetaService makeAgentNodeCommon", {
7330
+ agentName: agentName,
7331
+ });
7332
+ var dependsOn = _this.agentSchemaService.get(agentName).dependsOn;
7333
+ if (seen.has(agentName)) {
7334
+ return {
7335
+ name: agentName,
7336
+ };
7337
+ }
7338
+ else if (dependsOn) {
7339
+ var childSeen_2 = new Set(seen).add(agentName);
7340
+ return {
7341
+ name: agentName,
7342
+ child: dependsOn.map(function (name) { return _this.makeAgentNodeCommon(name, childSeen_2); }),
7343
+ };
7344
+ }
7345
+ else {
7346
+ return {
7347
+ name: agentName,
7348
+ };
7349
+ }
7350
+ };
7320
7351
  /**
7321
7352
  * Converts the meta nodes of the given agent to UML format.
7322
7353
  * @param {AgentName} agentName - The name of the agent.
@@ -7354,10 +7385,10 @@ var SwarmMetaService = /** @class */ (function () {
7354
7385
  _this.loggerService.info("swarmMetaService makeSwarmNode", {
7355
7386
  swarmName: swarmName,
7356
7387
  });
7357
- var agentList = _this.swarmSchemaService.get(swarmName).agentList;
7388
+ var defaultAgent = _this.swarmSchemaService.get(swarmName).defaultAgent;
7358
7389
  return {
7359
7390
  name: swarmName,
7360
- child: agentList.map(function (dep) { return _this.agentMetaService.makeAgentNode(dep); }),
7391
+ child: [_this.agentMetaService.makeAgentNodeCommon(defaultAgent)],
7361
7392
  };
7362
7393
  };
7363
7394
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-swarm-kit",
3
- "version": "1.0.88",
3
+ "version": "1.0.90",
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
@@ -3055,6 +3055,12 @@ declare class AgentMetaService {
3055
3055
  * @returns {IMetaNode} The created meta node.
3056
3056
  */
3057
3057
  makeAgentNode: (agentName: AgentName, seen?: Set<string>) => IMetaNode;
3058
+ /**
3059
+ * Creates a meta node for the given agent.
3060
+ * @param {AgentName} agentName - The name of the agent.
3061
+ * @returns {IMetaNode} The created meta node.
3062
+ */
3063
+ makeAgentNodeCommon: (agentName: AgentName, seen?: Set<string>) => IMetaNode;
3058
3064
  /**
3059
3065
  * Converts the meta nodes of the given agent to UML format.
3060
3066
  * @param {AgentName} agentName - The name of the agent.