agent-swarm-kit 1.0.86 → 1.0.87

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
@@ -7223,22 +7223,18 @@ var UML_BULLET = "•";
7223
7223
  */
7224
7224
  var createSerialize = function () { return function (nodes) {
7225
7225
  var lines = [];
7226
- var process = function (nodes, level, seen) {
7226
+ var process = function (nodes, level) {
7227
7227
  var e_1, _a;
7228
7228
  var _b;
7229
7229
  if (level === void 0) { level = 0; }
7230
- if (seen === void 0) { seen = new Set(); }
7231
7230
  try {
7232
7231
  for (var nodes_1 = __values(nodes), nodes_1_1 = nodes_1.next(); !nodes_1_1.done; nodes_1_1 = nodes_1.next()) {
7233
7232
  var node = nodes_1_1.value;
7234
7233
  var space = __spreadArray([], __read(new Array(level)), false).fill(UML_STEP).join("");
7235
- if (seen.has(node.name)) {
7236
- lines.push("".concat(space).concat(String(node.name), ": \"\""));
7237
- }
7238
- else if (((_b = node.child) === null || _b === void 0 ? void 0 : _b.length) && level < MAX_NESTING) {
7234
+ if (((_b = node.child) === null || _b === void 0 ? void 0 : _b.length) && level < MAX_NESTING) {
7239
7235
  lines.push("".concat(space).concat(String(node.name), ":"));
7240
7236
  lines.push("".concat(space).concat(UML_STEP).concat(UML_BULLET, " ").concat(String(node.name), ": \"\""));
7241
- process(node.child, level + 1, seen.add(node.name));
7237
+ process(node.child, level + 1);
7242
7238
  }
7243
7239
  else {
7244
7240
  lines.push("".concat(space).concat(String(node.name), ": \"\""));
@@ -7269,43 +7265,50 @@ var AgentMetaService = /** @class */ (function () {
7269
7265
  /**
7270
7266
  * Creates a meta node for the given agent.
7271
7267
  * @param {AgentName} agentName - The name of the agent.
7272
- * @param {Set<AgentName>} seen - A set of seen agent names to avoid circular dependencies.
7273
7268
  * @returns {IMetaNode} The created meta node.
7274
7269
  */
7275
- this.makeAgentNode = function (agentName, seen) {
7276
- if (seen === void 0) { seen = new Set(); }
7270
+ this.makeAgentNode = function (agentName) {
7277
7271
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
7278
7272
  _this.loggerService.info("agentMetaService makeAgentNode", {
7279
7273
  agentName: agentName,
7280
7274
  });
7281
7275
  var _a = _this.agentSchemaService.get(agentName), dependsOn = _a.dependsOn, states = _a.states, storages = _a.storages, tools = _a.tools;
7282
- var childSeen = seen.add(agentName);
7283
7276
  var agentTree = [];
7284
- if (dependsOn && !seen.has(agentName)) {
7277
+ if (dependsOn) {
7285
7278
  agentTree.push({
7286
- name: "Agents (".concat(agentName, ")"),
7287
- child: dependsOn
7288
- .filter(function (name) { return !!name; })
7289
- .map(function (dep) { return _this.makeAgentNode(dep, childSeen); }),
7279
+ name: "Agents",
7290
7280
  });
7281
+ dependsOn
7282
+ .filter(function (name) { return !!name; })
7283
+ .map(_this.makeAgentNode)
7284
+ .forEach(function (node) { return agentTree.push(node); });
7291
7285
  }
7292
7286
  if (states) {
7293
7287
  agentTree.push({
7294
- name: "States (".concat(agentName, ")"),
7295
- child: states.filter(function (name) { return !!name; }).map(function (name) { return ({ name: name }); }),
7288
+ name: "States",
7296
7289
  });
7290
+ states
7291
+ .filter(function (name) { return !!name; })
7292
+ .map(function (name) { return ({ name: name }); })
7293
+ .forEach(function (node) { return agentTree.push(node); });
7297
7294
  }
7298
7295
  if (storages) {
7299
7296
  agentTree.push({
7300
- name: "Storages (".concat(agentName, ")"),
7301
- child: storages.filter(function (name) { return !!name; }).map(function (name) { return ({ name: name }); }),
7297
+ name: "Storages",
7302
7298
  });
7299
+ storages
7300
+ .filter(function (name) { return !!name; })
7301
+ .map(function (name) { return ({ name: name }); })
7302
+ .forEach(function (node) { return agentTree.push(node); });
7303
7303
  }
7304
7304
  if (tools) {
7305
7305
  agentTree.push({
7306
- name: "Tools (".concat(agentName, ")"),
7307
- child: tools.filter(function (name) { return !!name; }).map(function (name) { return ({ name: name }); }),
7306
+ name: "Tools",
7308
7307
  });
7308
+ tools
7309
+ .filter(function (name) { return !!name; })
7310
+ .map(function (name) { return ({ name: name }); })
7311
+ .forEach(function (node) { return agentTree.push(node); });
7309
7312
  }
7310
7313
  return {
7311
7314
  name: agentName,
package/build/index.mjs CHANGED
@@ -7221,22 +7221,18 @@ var UML_BULLET = "•";
7221
7221
  */
7222
7222
  var createSerialize = function () { return function (nodes) {
7223
7223
  var lines = [];
7224
- var process = function (nodes, level, seen) {
7224
+ var process = function (nodes, level) {
7225
7225
  var e_1, _a;
7226
7226
  var _b;
7227
7227
  if (level === void 0) { level = 0; }
7228
- if (seen === void 0) { seen = new Set(); }
7229
7228
  try {
7230
7229
  for (var nodes_1 = __values(nodes), nodes_1_1 = nodes_1.next(); !nodes_1_1.done; nodes_1_1 = nodes_1.next()) {
7231
7230
  var node = nodes_1_1.value;
7232
7231
  var space = __spreadArray([], __read(new Array(level)), false).fill(UML_STEP).join("");
7233
- if (seen.has(node.name)) {
7234
- lines.push("".concat(space).concat(String(node.name), ": \"\""));
7235
- }
7236
- else if (((_b = node.child) === null || _b === void 0 ? void 0 : _b.length) && level < MAX_NESTING) {
7232
+ if (((_b = node.child) === null || _b === void 0 ? void 0 : _b.length) && level < MAX_NESTING) {
7237
7233
  lines.push("".concat(space).concat(String(node.name), ":"));
7238
7234
  lines.push("".concat(space).concat(UML_STEP).concat(UML_BULLET, " ").concat(String(node.name), ": \"\""));
7239
- process(node.child, level + 1, seen.add(node.name));
7235
+ process(node.child, level + 1);
7240
7236
  }
7241
7237
  else {
7242
7238
  lines.push("".concat(space).concat(String(node.name), ": \"\""));
@@ -7267,43 +7263,50 @@ var AgentMetaService = /** @class */ (function () {
7267
7263
  /**
7268
7264
  * Creates a meta node for the given agent.
7269
7265
  * @param {AgentName} agentName - The name of the agent.
7270
- * @param {Set<AgentName>} seen - A set of seen agent names to avoid circular dependencies.
7271
7266
  * @returns {IMetaNode} The created meta node.
7272
7267
  */
7273
- this.makeAgentNode = function (agentName, seen) {
7274
- if (seen === void 0) { seen = new Set(); }
7268
+ this.makeAgentNode = function (agentName) {
7275
7269
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
7276
7270
  _this.loggerService.info("agentMetaService makeAgentNode", {
7277
7271
  agentName: agentName,
7278
7272
  });
7279
7273
  var _a = _this.agentSchemaService.get(agentName), dependsOn = _a.dependsOn, states = _a.states, storages = _a.storages, tools = _a.tools;
7280
- var childSeen = seen.add(agentName);
7281
7274
  var agentTree = [];
7282
- if (dependsOn && !seen.has(agentName)) {
7275
+ if (dependsOn) {
7283
7276
  agentTree.push({
7284
- name: "Agents (".concat(agentName, ")"),
7285
- child: dependsOn
7286
- .filter(function (name) { return !!name; })
7287
- .map(function (dep) { return _this.makeAgentNode(dep, childSeen); }),
7277
+ name: "Agents",
7288
7278
  });
7279
+ dependsOn
7280
+ .filter(function (name) { return !!name; })
7281
+ .map(_this.makeAgentNode)
7282
+ .forEach(function (node) { return agentTree.push(node); });
7289
7283
  }
7290
7284
  if (states) {
7291
7285
  agentTree.push({
7292
- name: "States (".concat(agentName, ")"),
7293
- child: states.filter(function (name) { return !!name; }).map(function (name) { return ({ name: name }); }),
7286
+ name: "States",
7294
7287
  });
7288
+ states
7289
+ .filter(function (name) { return !!name; })
7290
+ .map(function (name) { return ({ name: name }); })
7291
+ .forEach(function (node) { return agentTree.push(node); });
7295
7292
  }
7296
7293
  if (storages) {
7297
7294
  agentTree.push({
7298
- name: "Storages (".concat(agentName, ")"),
7299
- child: storages.filter(function (name) { return !!name; }).map(function (name) { return ({ name: name }); }),
7295
+ name: "Storages",
7300
7296
  });
7297
+ storages
7298
+ .filter(function (name) { return !!name; })
7299
+ .map(function (name) { return ({ name: name }); })
7300
+ .forEach(function (node) { return agentTree.push(node); });
7301
7301
  }
7302
7302
  if (tools) {
7303
7303
  agentTree.push({
7304
- name: "Tools (".concat(agentName, ")"),
7305
- child: tools.filter(function (name) { return !!name; }).map(function (name) { return ({ name: name }); }),
7304
+ name: "Tools",
7306
7305
  });
7306
+ tools
7307
+ .filter(function (name) { return !!name; })
7308
+ .map(function (name) { return ({ name: name }); })
7309
+ .forEach(function (node) { return agentTree.push(node); });
7307
7310
  }
7308
7311
  return {
7309
7312
  name: agentName,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-swarm-kit",
3
- "version": "1.0.86",
3
+ "version": "1.0.87",
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
@@ -3052,10 +3052,9 @@ declare class AgentMetaService {
3052
3052
  /**
3053
3053
  * Creates a meta node for the given agent.
3054
3054
  * @param {AgentName} agentName - The name of the agent.
3055
- * @param {Set<AgentName>} seen - A set of seen agent names to avoid circular dependencies.
3056
3055
  * @returns {IMetaNode} The created meta node.
3057
3056
  */
3058
- makeAgentNode: (agentName: AgentName, seen?: Set<string>) => IMetaNode;
3057
+ makeAgentNode: (agentName: AgentName) => IMetaNode;
3059
3058
  /**
3060
3059
  * Converts the meta nodes of the given agent to UML format.
3061
3060
  * @param {AgentName} agentName - The name of the agent.