agent-swarm-kit 1.0.88 → 1.0.89
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 +33 -2
- package/build/index.mjs +33 -2
- package/package.json +1 -1
- package/types.d.ts +6 -0
package/build/index.cjs
CHANGED
|
@@ -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.
|
|
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.
|
|
@@ -7359,7 +7390,7 @@ var SwarmMetaService = /** @class */ (function () {
|
|
|
7359
7390
|
var agentList = _this.swarmSchemaService.get(swarmName).agentList;
|
|
7360
7391
|
return {
|
|
7361
7392
|
name: swarmName,
|
|
7362
|
-
child: agentList.map(function (dep) { return _this.agentMetaService.
|
|
7393
|
+
child: agentList.map(function (dep) { return _this.agentMetaService.makeAgentNodeCommon(dep); }),
|
|
7363
7394
|
};
|
|
7364
7395
|
};
|
|
7365
7396
|
/**
|
package/build/index.mjs
CHANGED
|
@@ -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.
|
|
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.
|
|
@@ -7357,7 +7388,7 @@ var SwarmMetaService = /** @class */ (function () {
|
|
|
7357
7388
|
var agentList = _this.swarmSchemaService.get(swarmName).agentList;
|
|
7358
7389
|
return {
|
|
7359
7390
|
name: swarmName,
|
|
7360
|
-
child: agentList.map(function (dep) { return _this.agentMetaService.
|
|
7391
|
+
child: agentList.map(function (dep) { return _this.agentMetaService.makeAgentNodeCommon(dep); }),
|
|
7361
7392
|
};
|
|
7362
7393
|
};
|
|
7363
7394
|
/**
|
package/package.json
CHANGED
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.
|