agent-swarm-kit 1.0.90 → 1.0.91

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
@@ -7341,7 +7341,9 @@ var AgentMetaService = /** @class */ (function () {
7341
7341
  var childSeen_2 = new Set(seen).add(agentName);
7342
7342
  return {
7343
7343
  name: agentName,
7344
- child: dependsOn.map(function (name) { return _this.makeAgentNodeCommon(name, childSeen_2); }),
7344
+ child: dependsOn.map(function (name) {
7345
+ return _this.makeAgentNodeCommon(name, childSeen_2);
7346
+ }),
7345
7347
  };
7346
7348
  }
7347
7349
  else {
@@ -7355,12 +7357,17 @@ var AgentMetaService = /** @class */ (function () {
7355
7357
  * @param {AgentName} agentName - The name of the agent.
7356
7358
  * @returns {string} The UML representation of the agent's meta nodes.
7357
7359
  */
7358
- this.toUML = function (agentName) {
7360
+ this.toUML = function (agentName, withSubtree) {
7361
+ if (withSubtree === void 0) { withSubtree = false; }
7359
7362
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
7360
7363
  _this.loggerService.info("agentMetaService toUML", {
7361
7364
  agentName: agentName,
7362
7365
  });
7363
- var rootNode = _this.makeAgentNode(agentName);
7366
+ var subtree = new Set();
7367
+ if (!withSubtree) {
7368
+ subtree.add(agentName);
7369
+ }
7370
+ var rootNode = _this.makeAgentNode(agentName, subtree);
7364
7371
  return _this.serialize([rootNode]);
7365
7372
  };
7366
7373
  }
@@ -7520,13 +7527,14 @@ var METHOD_NAME$E = "function.dumpAgent";
7520
7527
  * @param {SwarmName} swarmName - The name of the swarm to be dumped.
7521
7528
  * @returns {string} The UML representation of the swarm.
7522
7529
  */
7523
- var dumpAgent = function (agentName) {
7530
+ var dumpAgent = function (agentName, _a) {
7531
+ var _b = _a === void 0 ? {} : _a, _c = _b.withSubtree, withSubtree = _c === void 0 ? false : _c;
7524
7532
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
7525
7533
  swarm$1.loggerService.log(METHOD_NAME$E, {
7526
7534
  agentName: agentName,
7527
7535
  });
7528
7536
  swarm$1.agentValidationService.validate(agentName, METHOD_NAME$E);
7529
- return swarm$1.agentMetaService.toUML(agentName);
7537
+ return swarm$1.agentMetaService.toUML(agentName, withSubtree);
7530
7538
  };
7531
7539
 
7532
7540
  var METHOD_NAME$D = "function.dumpSwarm";
package/build/index.mjs CHANGED
@@ -7339,7 +7339,9 @@ var AgentMetaService = /** @class */ (function () {
7339
7339
  var childSeen_2 = new Set(seen).add(agentName);
7340
7340
  return {
7341
7341
  name: agentName,
7342
- child: dependsOn.map(function (name) { return _this.makeAgentNodeCommon(name, childSeen_2); }),
7342
+ child: dependsOn.map(function (name) {
7343
+ return _this.makeAgentNodeCommon(name, childSeen_2);
7344
+ }),
7343
7345
  };
7344
7346
  }
7345
7347
  else {
@@ -7353,12 +7355,17 @@ var AgentMetaService = /** @class */ (function () {
7353
7355
  * @param {AgentName} agentName - The name of the agent.
7354
7356
  * @returns {string} The UML representation of the agent's meta nodes.
7355
7357
  */
7356
- this.toUML = function (agentName) {
7358
+ this.toUML = function (agentName, withSubtree) {
7359
+ if (withSubtree === void 0) { withSubtree = false; }
7357
7360
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
7358
7361
  _this.loggerService.info("agentMetaService toUML", {
7359
7362
  agentName: agentName,
7360
7363
  });
7361
- var rootNode = _this.makeAgentNode(agentName);
7364
+ var subtree = new Set();
7365
+ if (!withSubtree) {
7366
+ subtree.add(agentName);
7367
+ }
7368
+ var rootNode = _this.makeAgentNode(agentName, subtree);
7362
7369
  return _this.serialize([rootNode]);
7363
7370
  };
7364
7371
  }
@@ -7518,13 +7525,14 @@ var METHOD_NAME$E = "function.dumpAgent";
7518
7525
  * @param {SwarmName} swarmName - The name of the swarm to be dumped.
7519
7526
  * @returns {string} The UML representation of the swarm.
7520
7527
  */
7521
- var dumpAgent = function (agentName) {
7528
+ var dumpAgent = function (agentName, _a) {
7529
+ var _b = _a === void 0 ? {} : _a, _c = _b.withSubtree, withSubtree = _c === void 0 ? false : _c;
7522
7530
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
7523
7531
  swarm$1.loggerService.log(METHOD_NAME$E, {
7524
7532
  agentName: agentName,
7525
7533
  });
7526
7534
  swarm$1.agentValidationService.validate(agentName, METHOD_NAME$E);
7527
- return swarm$1.agentMetaService.toUML(agentName);
7535
+ return swarm$1.agentMetaService.toUML(agentName, withSubtree);
7528
7536
  };
7529
7537
 
7530
7538
  var METHOD_NAME$D = "function.dumpSwarm";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-swarm-kit",
3
- "version": "1.0.90",
3
+ "version": "1.0.91",
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
@@ -3066,7 +3066,7 @@ declare class AgentMetaService {
3066
3066
  * @param {AgentName} agentName - The name of the agent.
3067
3067
  * @returns {string} The UML representation of the agent's meta nodes.
3068
3068
  */
3069
- toUML: (agentName: AgentName) => string;
3069
+ toUML: (agentName: AgentName, withSubtree?: boolean) => string;
3070
3070
  }
3071
3071
 
3072
3072
  /**
@@ -3130,13 +3130,19 @@ declare const swarm: {
3130
3130
  loggerService: LoggerService;
3131
3131
  };
3132
3132
 
3133
+ /**
3134
+ * The config for UML generation
3135
+ */
3136
+ interface IConfig {
3137
+ withSubtree: boolean;
3138
+ }
3133
3139
  /**
3134
3140
  * Dumps the agent information into PlantUML format.
3135
3141
  *
3136
3142
  * @param {SwarmName} swarmName - The name of the swarm to be dumped.
3137
3143
  * @returns {string} The UML representation of the swarm.
3138
3144
  */
3139
- declare const dumpAgent: (agentName: AgentName) => string;
3145
+ declare const dumpAgent: (agentName: AgentName, { withSubtree }?: Partial<IConfig>) => string;
3140
3146
 
3141
3147
  /**
3142
3148
  * Dumps the swarm information into PlantUML format.