agent-swarm-kit 1.0.86 → 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 +27 -20
- package/build/index.mjs +27 -20
- package/package.json +1 -1
- package/types.d.ts +0 -1
package/build/index.cjs
CHANGED
|
@@ -7217,28 +7217,25 @@ 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.
|
|
7223
7224
|
*/
|
|
7224
7225
|
var createSerialize = function () { return function (nodes) {
|
|
7225
7226
|
var lines = [];
|
|
7226
|
-
var process = function (nodes, level
|
|
7227
|
+
var process = function (nodes, level) {
|
|
7227
7228
|
var e_1, _a;
|
|
7228
7229
|
var _b;
|
|
7229
7230
|
if (level === void 0) { level = 0; }
|
|
7230
|
-
if (seen === void 0) { seen = new Set(); }
|
|
7231
7231
|
try {
|
|
7232
7232
|
for (var nodes_1 = __values(nodes), nodes_1_1 = nodes_1.next(); !nodes_1_1.done; nodes_1_1 = nodes_1.next()) {
|
|
7233
7233
|
var node = nodes_1_1.value;
|
|
7234
7234
|
var space = __spreadArray([], __read(new Array(level)), false).fill(UML_STEP).join("");
|
|
7235
|
-
if (
|
|
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) {
|
|
7235
|
+
if (((_b = node.child) === null || _b === void 0 ? void 0 : _b.length) && level < MAX_NESTING) {
|
|
7239
7236
|
lines.push("".concat(space).concat(String(node.name), ":"));
|
|
7240
7237
|
lines.push("".concat(space).concat(UML_STEP).concat(UML_BULLET, " ").concat(String(node.name), ": \"\""));
|
|
7241
|
-
process(node.child, level + 1
|
|
7238
|
+
process(node.child, level + 1);
|
|
7242
7239
|
}
|
|
7243
7240
|
else {
|
|
7244
7241
|
lines.push("".concat(space).concat(String(node.name), ": \"\""));
|
|
@@ -7269,7 +7266,6 @@ var AgentMetaService = /** @class */ (function () {
|
|
|
7269
7266
|
/**
|
|
7270
7267
|
* Creates a meta node for the given agent.
|
|
7271
7268
|
* @param {AgentName} agentName - The name of the agent.
|
|
7272
|
-
* @param {Set<AgentName>} seen - A set of seen agent names to avoid circular dependencies.
|
|
7273
7269
|
* @returns {IMetaNode} The created meta node.
|
|
7274
7270
|
*/
|
|
7275
7271
|
this.makeAgentNode = function (agentName, seen) {
|
|
@@ -7279,33 +7275,44 @@ var AgentMetaService = /** @class */ (function () {
|
|
|
7279
7275
|
agentName: agentName,
|
|
7280
7276
|
});
|
|
7281
7277
|
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
7278
|
var agentTree = [];
|
|
7284
|
-
if (dependsOn
|
|
7279
|
+
if (dependsOn) {
|
|
7285
7280
|
agentTree.push({
|
|
7286
|
-
name: "
|
|
7287
|
-
child: dependsOn
|
|
7288
|
-
.filter(function (name) { return !!name; })
|
|
7289
|
-
.map(function (dep) { return _this.makeAgentNode(dep, childSeen); }),
|
|
7281
|
+
name: "".concat(UML_TRIANGLE, " Agents"),
|
|
7290
7282
|
});
|
|
7283
|
+
var subtree = dependsOn
|
|
7284
|
+
.filter(function (name) { return !!name; })
|
|
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); });
|
|
7291
7290
|
}
|
|
7292
7291
|
if (states) {
|
|
7293
7292
|
agentTree.push({
|
|
7294
|
-
name: "
|
|
7295
|
-
child: states.filter(function (name) { return !!name; }).map(function (name) { return ({ name: name }); }),
|
|
7293
|
+
name: "".concat(UML_TRIANGLE, " States"),
|
|
7296
7294
|
});
|
|
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); });
|
|
7297
7298
|
}
|
|
7298
7299
|
if (storages) {
|
|
7299
7300
|
agentTree.push({
|
|
7300
|
-
name: "
|
|
7301
|
-
child: storages.filter(function (name) { return !!name; }).map(function (name) { return ({ name: name }); }),
|
|
7301
|
+
name: "".concat(UML_TRIANGLE, " Storages"),
|
|
7302
7302
|
});
|
|
7303
|
+
var subtree = storages
|
|
7304
|
+
.filter(function (name) { return !!name; })
|
|
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: "
|
|
7307
|
-
child: tools.filter(function (name) { return !!name; }).map(function (name) { return ({ name: name }); }),
|
|
7311
|
+
name: "".concat(UML_TRIANGLE, " Tools"),
|
|
7308
7312
|
});
|
|
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); });
|
|
7309
7316
|
}
|
|
7310
7317
|
return {
|
|
7311
7318
|
name: agentName,
|
package/build/index.mjs
CHANGED
|
@@ -7215,28 +7215,25 @@ 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.
|
|
7221
7222
|
*/
|
|
7222
7223
|
var createSerialize = function () { return function (nodes) {
|
|
7223
7224
|
var lines = [];
|
|
7224
|
-
var process = function (nodes, level
|
|
7225
|
+
var process = function (nodes, level) {
|
|
7225
7226
|
var e_1, _a;
|
|
7226
7227
|
var _b;
|
|
7227
7228
|
if (level === void 0) { level = 0; }
|
|
7228
|
-
if (seen === void 0) { seen = new Set(); }
|
|
7229
7229
|
try {
|
|
7230
7230
|
for (var nodes_1 = __values(nodes), nodes_1_1 = nodes_1.next(); !nodes_1_1.done; nodes_1_1 = nodes_1.next()) {
|
|
7231
7231
|
var node = nodes_1_1.value;
|
|
7232
7232
|
var space = __spreadArray([], __read(new Array(level)), false).fill(UML_STEP).join("");
|
|
7233
|
-
if (
|
|
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) {
|
|
7233
|
+
if (((_b = node.child) === null || _b === void 0 ? void 0 : _b.length) && level < MAX_NESTING) {
|
|
7237
7234
|
lines.push("".concat(space).concat(String(node.name), ":"));
|
|
7238
7235
|
lines.push("".concat(space).concat(UML_STEP).concat(UML_BULLET, " ").concat(String(node.name), ": \"\""));
|
|
7239
|
-
process(node.child, level + 1
|
|
7236
|
+
process(node.child, level + 1);
|
|
7240
7237
|
}
|
|
7241
7238
|
else {
|
|
7242
7239
|
lines.push("".concat(space).concat(String(node.name), ": \"\""));
|
|
@@ -7267,7 +7264,6 @@ var AgentMetaService = /** @class */ (function () {
|
|
|
7267
7264
|
/**
|
|
7268
7265
|
* Creates a meta node for the given agent.
|
|
7269
7266
|
* @param {AgentName} agentName - The name of the agent.
|
|
7270
|
-
* @param {Set<AgentName>} seen - A set of seen agent names to avoid circular dependencies.
|
|
7271
7267
|
* @returns {IMetaNode} The created meta node.
|
|
7272
7268
|
*/
|
|
7273
7269
|
this.makeAgentNode = function (agentName, seen) {
|
|
@@ -7277,33 +7273,44 @@ var AgentMetaService = /** @class */ (function () {
|
|
|
7277
7273
|
agentName: agentName,
|
|
7278
7274
|
});
|
|
7279
7275
|
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
7276
|
var agentTree = [];
|
|
7282
|
-
if (dependsOn
|
|
7277
|
+
if (dependsOn) {
|
|
7283
7278
|
agentTree.push({
|
|
7284
|
-
name: "
|
|
7285
|
-
child: dependsOn
|
|
7286
|
-
.filter(function (name) { return !!name; })
|
|
7287
|
-
.map(function (dep) { return _this.makeAgentNode(dep, childSeen); }),
|
|
7279
|
+
name: "".concat(UML_TRIANGLE, " Agents"),
|
|
7288
7280
|
});
|
|
7281
|
+
var subtree = dependsOn
|
|
7282
|
+
.filter(function (name) { return !!name; })
|
|
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); });
|
|
7289
7288
|
}
|
|
7290
7289
|
if (states) {
|
|
7291
7290
|
agentTree.push({
|
|
7292
|
-
name: "
|
|
7293
|
-
child: states.filter(function (name) { return !!name; }).map(function (name) { return ({ name: name }); }),
|
|
7291
|
+
name: "".concat(UML_TRIANGLE, " States"),
|
|
7294
7292
|
});
|
|
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); });
|
|
7295
7296
|
}
|
|
7296
7297
|
if (storages) {
|
|
7297
7298
|
agentTree.push({
|
|
7298
|
-
name: "
|
|
7299
|
-
child: storages.filter(function (name) { return !!name; }).map(function (name) { return ({ name: name }); }),
|
|
7299
|
+
name: "".concat(UML_TRIANGLE, " Storages"),
|
|
7300
7300
|
});
|
|
7301
|
+
var subtree = storages
|
|
7302
|
+
.filter(function (name) { return !!name; })
|
|
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: "
|
|
7305
|
-
child: tools.filter(function (name) { return !!name; }).map(function (name) { return ({ name: name }); }),
|
|
7309
|
+
name: "".concat(UML_TRIANGLE, " Tools"),
|
|
7306
7310
|
});
|
|
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); });
|
|
7307
7314
|
}
|
|
7308
7315
|
return {
|
|
7309
7316
|
name: agentName,
|
package/package.json
CHANGED
package/types.d.ts
CHANGED
|
@@ -3052,7 +3052,6 @@ 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
3057
|
makeAgentNode: (agentName: AgentName, seen?: Set<string>) => IMetaNode;
|