agent-swarm-kit 1.0.92 → 1.0.94
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 +423 -3
- package/build/index.mjs +423 -4
- package/package.json +1 -1
- package/types.d.ts +37 -1
package/build/index.cjs
CHANGED
|
@@ -5,6 +5,8 @@ var diKit = require('di-kit');
|
|
|
5
5
|
var functoolsKit = require('functools-kit');
|
|
6
6
|
var xml2js = require('xml2js');
|
|
7
7
|
var lodashEs = require('lodash-es');
|
|
8
|
+
var path = require('path');
|
|
9
|
+
var fs = require('fs');
|
|
8
10
|
|
|
9
11
|
/******************************************************************************
|
|
10
12
|
Copyright (c) Microsoft Corporation.
|
|
@@ -172,6 +174,7 @@ var init = (_a$2 = diKit.createActivator("agent-swarm"), _a$2.init), inject = _a
|
|
|
172
174
|
|
|
173
175
|
var baseServices$1 = {
|
|
174
176
|
busService: Symbol('busService'),
|
|
177
|
+
docService: Symbol('docService'),
|
|
175
178
|
loggerService: Symbol('loggerService'),
|
|
176
179
|
};
|
|
177
180
|
var contextServices$1 = {
|
|
@@ -1428,6 +1431,7 @@ var CC_LOGGER_ENABLE_DEBUG = false;
|
|
|
1428
1431
|
var CC_LOGGER_ENABLE_LOG = true;
|
|
1429
1432
|
var CC_LOGGER_ENABLE_CONSOLE = false;
|
|
1430
1433
|
var CC_NAME_TO_TITLE = nameToTitle;
|
|
1434
|
+
var CC_FN_PLANTUML = function () { return Promise.resolve(""); };
|
|
1431
1435
|
var GLOBAL_CONFIG = {
|
|
1432
1436
|
CC_TOOL_CALL_EXCEPTION_PROMPT: CC_TOOL_CALL_EXCEPTION_PROMPT,
|
|
1433
1437
|
CC_EMPTY_OUTPUT_PLACEHOLDERS: CC_EMPTY_OUTPUT_PLACEHOLDERS,
|
|
@@ -1450,6 +1454,7 @@ var GLOBAL_CONFIG = {
|
|
|
1450
1454
|
CC_LOGGER_ENABLE_LOG: CC_LOGGER_ENABLE_LOG,
|
|
1451
1455
|
CC_LOGGER_ENABLE_CONSOLE: CC_LOGGER_ENABLE_CONSOLE,
|
|
1452
1456
|
CC_NAME_TO_TITLE: CC_NAME_TO_TITLE,
|
|
1457
|
+
CC_FN_PLANTUML: CC_FN_PLANTUML,
|
|
1453
1458
|
};
|
|
1454
1459
|
var setConfig = function (config) {
|
|
1455
1460
|
Object.assign(GLOBAL_CONFIG, config);
|
|
@@ -1803,7 +1808,7 @@ var ClientAgent = /** @class */ (function () {
|
|
|
1803
1808
|
messages: messages,
|
|
1804
1809
|
mode: mode,
|
|
1805
1810
|
tools: (_a = this.params.tools) === null || _a === void 0 ? void 0 : _a.map(function (t) {
|
|
1806
|
-
return lodashEs.omit(t, "toolName", "call", "validate", "callbacks");
|
|
1811
|
+
return lodashEs.omit(t, "toolName", "docNote", "call", "validate", "callbacks");
|
|
1807
1812
|
}),
|
|
1808
1813
|
};
|
|
1809
1814
|
return [4 /*yield*/, this.params.completion.getCompletion(args)];
|
|
@@ -4938,6 +4943,11 @@ var AgentValidationService = /** @class */ (function () {
|
|
|
4938
4943
|
this.storageValidationService = inject(TYPES.storageValidationService);
|
|
4939
4944
|
this._agentMap = new Map();
|
|
4940
4945
|
this._agentDepsMap = new Map();
|
|
4946
|
+
this.getAgentList = function () {
|
|
4947
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
4948
|
+
_this.loggerService.info("agentValidationService getAgentList");
|
|
4949
|
+
return __spreadArray([], __read(_this._agentMap.keys()), false);
|
|
4950
|
+
};
|
|
4941
4951
|
/**
|
|
4942
4952
|
* Retrieves the storages used by the agent
|
|
4943
4953
|
* @param {agentName} agentName - The name of the swarm.
|
|
@@ -4945,6 +4955,10 @@ var AgentValidationService = /** @class */ (function () {
|
|
|
4945
4955
|
* @throws Will throw an error if the swarm is not found.
|
|
4946
4956
|
*/
|
|
4947
4957
|
this.getStorageList = function (agentName) {
|
|
4958
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
4959
|
+
_this.loggerService.info("agentValidationService getStorageList", {
|
|
4960
|
+
agentName: agentName,
|
|
4961
|
+
});
|
|
4948
4962
|
if (!_this._agentMap.has(agentName)) {
|
|
4949
4963
|
throw new Error("agent-swarm agent ".concat(agentName, " not exist (getStorageList)"));
|
|
4950
4964
|
}
|
|
@@ -4957,6 +4971,10 @@ var AgentValidationService = /** @class */ (function () {
|
|
|
4957
4971
|
* @throws Will throw an error if the swarm is not found.
|
|
4958
4972
|
*/
|
|
4959
4973
|
this.getStateList = function (agentName) {
|
|
4974
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
4975
|
+
_this.loggerService.info("agentValidationService getStateList", {
|
|
4976
|
+
agentName: agentName,
|
|
4977
|
+
});
|
|
4960
4978
|
if (!_this._agentMap.has(agentName)) {
|
|
4961
4979
|
throw new Error("agent-swarm agent ".concat(agentName, " not exist (getStateList)"));
|
|
4962
4980
|
}
|
|
@@ -5492,6 +5510,15 @@ var SwarmValidationService = /** @class */ (function () {
|
|
|
5492
5510
|
}
|
|
5493
5511
|
return swarm.agentList;
|
|
5494
5512
|
};
|
|
5513
|
+
/**
|
|
5514
|
+
* Retrieves the list of swarms
|
|
5515
|
+
* @returns {string[]} The list of swarm names
|
|
5516
|
+
*/
|
|
5517
|
+
this.getSwarmList = function () {
|
|
5518
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
5519
|
+
_this.loggerService.info("swarmValidationService getSwarmList");
|
|
5520
|
+
return __spreadArray([], __read(_this._swarmMap.keys()), false);
|
|
5521
|
+
};
|
|
5495
5522
|
/**
|
|
5496
5523
|
* Validates a swarm and its agents.
|
|
5497
5524
|
* @param {SwarmName} swarmName - The name of the swarm.
|
|
@@ -7417,7 +7444,388 @@ var SwarmMetaService = /** @class */ (function () {
|
|
|
7417
7444
|
return SwarmMetaService;
|
|
7418
7445
|
}());
|
|
7419
7446
|
|
|
7447
|
+
var THREAD_POOL_SIZE = 5;
|
|
7448
|
+
var SUBDIR_LIST = ["agent", "image"];
|
|
7449
|
+
var DocService = /** @class */ (function () {
|
|
7450
|
+
function DocService() {
|
|
7451
|
+
var _this = this;
|
|
7452
|
+
this.loggerService = inject(TYPES.loggerService);
|
|
7453
|
+
this.swarmValidationService = inject(TYPES.swarmValidationService);
|
|
7454
|
+
this.agentValidationService = inject(TYPES.agentValidationService);
|
|
7455
|
+
this.swarmSchemaService = inject(TYPES.swarmSchemaService);
|
|
7456
|
+
this.agentSchemaService = inject(TYPES.agentSchemaService);
|
|
7457
|
+
this.toolSchemaService = inject(TYPES.toolSchemaService);
|
|
7458
|
+
this.storageSchemaService = inject(TYPES.storageSchemaService);
|
|
7459
|
+
this.stateSchemaService = inject(TYPES.stateSchemaService);
|
|
7460
|
+
this.agentMetaService = inject(TYPES.agentMetaService);
|
|
7461
|
+
this.swarmMetaService = inject(TYPES.swarmMetaService);
|
|
7462
|
+
this.writeSwarmDoc = functoolsKit.execpool(function (swarmSchema, dirName) { return __awaiter(_this, void 0, void 0, function () {
|
|
7463
|
+
var result, umlSchema, umlName, umlSvg, docDescription, i, docDescription, callbackList, i;
|
|
7464
|
+
return __generator(this, function (_a) {
|
|
7465
|
+
switch (_a.label) {
|
|
7466
|
+
case 0:
|
|
7467
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
7468
|
+
this.loggerService.info("docService writeSwarmDoc", {
|
|
7469
|
+
swarmSchema: swarmSchema,
|
|
7470
|
+
});
|
|
7471
|
+
result = [];
|
|
7472
|
+
{
|
|
7473
|
+
result.push("# ".concat(swarmSchema.swarmName));
|
|
7474
|
+
if (swarmSchema.docDescription) {
|
|
7475
|
+
result.push("");
|
|
7476
|
+
result.push("> ".concat(swarmSchema.docDescription));
|
|
7477
|
+
}
|
|
7478
|
+
result.push("");
|
|
7479
|
+
}
|
|
7480
|
+
umlSchema = this.swarmMetaService.toUML(swarmSchema.swarmName);
|
|
7481
|
+
umlName = "swarm_schema_".concat(swarmSchema.swarmName, ".svg");
|
|
7482
|
+
return [4 /*yield*/, GLOBAL_CONFIG.CC_FN_PLANTUML(umlSchema)];
|
|
7483
|
+
case 1:
|
|
7484
|
+
umlSvg = _a.sent();
|
|
7485
|
+
if (umlSvg) {
|
|
7486
|
+
fs.writeFileSync(path.join(dirName, "image", umlName), umlSvg);
|
|
7487
|
+
result.push(""));
|
|
7488
|
+
result.push("");
|
|
7489
|
+
}
|
|
7490
|
+
if (swarmSchema.defaultAgent) {
|
|
7491
|
+
result.push("## Default agent");
|
|
7492
|
+
result.push("");
|
|
7493
|
+
result.push(" - [".concat(swarmSchema.defaultAgent, "](./agent/").concat(swarmSchema.defaultAgent, ".md)"));
|
|
7494
|
+
docDescription = this.agentSchemaService.get(swarmSchema.defaultAgent).docDescription;
|
|
7495
|
+
if (docDescription) {
|
|
7496
|
+
result.push("");
|
|
7497
|
+
result.push(docDescription);
|
|
7498
|
+
}
|
|
7499
|
+
result.push("");
|
|
7500
|
+
}
|
|
7501
|
+
if (swarmSchema.agentList) {
|
|
7502
|
+
result.push("## Used agents");
|
|
7503
|
+
result.push("");
|
|
7504
|
+
for (i = 0; i !== swarmSchema.agentList.length; i++) {
|
|
7505
|
+
if (!swarmSchema.agentList[i]) {
|
|
7506
|
+
continue;
|
|
7507
|
+
}
|
|
7508
|
+
result.push("".concat(i + 1, ". [").concat(swarmSchema.agentList[i], "](./agent/").concat(swarmSchema.agentList[i], ".md)"));
|
|
7509
|
+
docDescription = this.agentSchemaService.get(swarmSchema.agentList[i]).docDescription;
|
|
7510
|
+
if (docDescription) {
|
|
7511
|
+
result.push("");
|
|
7512
|
+
result.push(docDescription);
|
|
7513
|
+
}
|
|
7514
|
+
result.push("");
|
|
7515
|
+
}
|
|
7516
|
+
}
|
|
7517
|
+
if (swarmSchema.callbacks) {
|
|
7518
|
+
result.push("## Used callbacks");
|
|
7519
|
+
result.push("");
|
|
7520
|
+
callbackList = Object.keys(swarmSchema.callbacks);
|
|
7521
|
+
for (i = 0; i !== callbackList.length; i++) {
|
|
7522
|
+
result.push("".concat(i + 1, ". ").concat(callbackList[i]));
|
|
7523
|
+
}
|
|
7524
|
+
result.push("");
|
|
7525
|
+
}
|
|
7526
|
+
fs.writeFileSync(path.join(dirName, "./".concat(swarmSchema.swarmName, ".md")), result.join("\n"));
|
|
7527
|
+
return [2 /*return*/];
|
|
7528
|
+
}
|
|
7529
|
+
});
|
|
7530
|
+
}); }, {
|
|
7531
|
+
maxExec: THREAD_POOL_SIZE,
|
|
7532
|
+
});
|
|
7533
|
+
this.writeAgentDoc = functoolsKit.execpool(function (agentSchema, dirName) { return __awaiter(_this, void 0, void 0, function () {
|
|
7534
|
+
var result, umlSchema, umlName, umlSvg, i, i, docDescription, _loop_1, this_1, i, i, _a, docDescription, embedding, shared, callbacks, callbackList, i_1, i, _b, docDescription, shared, callbacks, callbackList, i_2, callbackList, i;
|
|
7535
|
+
var _c;
|
|
7536
|
+
return __generator(this, function (_d) {
|
|
7537
|
+
switch (_d.label) {
|
|
7538
|
+
case 0:
|
|
7539
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
7540
|
+
this.loggerService.info("docService writeAgentDoc", {
|
|
7541
|
+
agentSchema: agentSchema,
|
|
7542
|
+
});
|
|
7543
|
+
result = [];
|
|
7544
|
+
{
|
|
7545
|
+
result.push("# ".concat(agentSchema.agentName));
|
|
7546
|
+
if (agentSchema.docDescription) {
|
|
7547
|
+
result.push("");
|
|
7548
|
+
result.push("> ".concat(agentSchema.docDescription));
|
|
7549
|
+
}
|
|
7550
|
+
result.push("");
|
|
7551
|
+
}
|
|
7552
|
+
{
|
|
7553
|
+
result.push("**Completion:** ".concat(agentSchema.completion));
|
|
7554
|
+
result.push("");
|
|
7555
|
+
}
|
|
7556
|
+
umlSchema = this.agentMetaService.toUML(agentSchema.agentName);
|
|
7557
|
+
umlName = "agent_schema_".concat(agentSchema.agentName, ".svg");
|
|
7558
|
+
return [4 /*yield*/, GLOBAL_CONFIG.CC_FN_PLANTUML(umlSchema)];
|
|
7559
|
+
case 1:
|
|
7560
|
+
umlSvg = _d.sent();
|
|
7561
|
+
if (umlSvg) {
|
|
7562
|
+
fs.writeFileSync(path.join(dirName, "image", umlName), umlSvg);
|
|
7563
|
+
result.push(""));
|
|
7564
|
+
result.push("");
|
|
7565
|
+
}
|
|
7566
|
+
if (agentSchema.prompt) {
|
|
7567
|
+
result.push("## Main prompt");
|
|
7568
|
+
result.push("");
|
|
7569
|
+
result.push("```");
|
|
7570
|
+
result.push(agentSchema.prompt);
|
|
7571
|
+
result.push("```");
|
|
7572
|
+
result.push("");
|
|
7573
|
+
}
|
|
7574
|
+
if (agentSchema.system) {
|
|
7575
|
+
result.push("## System prompt");
|
|
7576
|
+
result.push("");
|
|
7577
|
+
for (i = 0; i !== agentSchema.system.length; i++) {
|
|
7578
|
+
if (!agentSchema.system[i]) {
|
|
7579
|
+
continue;
|
|
7580
|
+
}
|
|
7581
|
+
result.push("".concat(i + 1, ". `").concat(agentSchema.system[i], "`"));
|
|
7582
|
+
result.push("");
|
|
7583
|
+
}
|
|
7584
|
+
}
|
|
7585
|
+
if (agentSchema.dependsOn) {
|
|
7586
|
+
result.push("## Depends on");
|
|
7587
|
+
result.push("");
|
|
7588
|
+
for (i = 0; i !== agentSchema.dependsOn.length; i++) {
|
|
7589
|
+
if (!agentSchema.dependsOn[i]) {
|
|
7590
|
+
continue;
|
|
7591
|
+
}
|
|
7592
|
+
result.push("".concat(i + 1, ". [").concat(agentSchema.dependsOn[i], "](./").concat(agentSchema.dependsOn[i], ".md)"));
|
|
7593
|
+
docDescription = this.agentSchemaService.get(agentSchema.dependsOn[i]).docDescription;
|
|
7594
|
+
if (docDescription) {
|
|
7595
|
+
result.push("");
|
|
7596
|
+
result.push(docDescription);
|
|
7597
|
+
}
|
|
7598
|
+
result.push("");
|
|
7599
|
+
}
|
|
7600
|
+
}
|
|
7601
|
+
if (agentSchema.tools) {
|
|
7602
|
+
result.push("## Used tools");
|
|
7603
|
+
result.push("");
|
|
7604
|
+
_loop_1 = function (i) {
|
|
7605
|
+
if (!agentSchema.tools[i]) {
|
|
7606
|
+
return "continue";
|
|
7607
|
+
}
|
|
7608
|
+
result.push("### ".concat(i + 1, ". ").concat(agentSchema.tools[i]));
|
|
7609
|
+
var _e = this_1.toolSchemaService.get(agentSchema.tools[i]), fn = _e.function, docNote = _e.docNote, callbacks = _e.callbacks;
|
|
7610
|
+
if (fn.name) {
|
|
7611
|
+
result.push("");
|
|
7612
|
+
result.push("#### Name for model");
|
|
7613
|
+
result.push("");
|
|
7614
|
+
result.push(fn.name);
|
|
7615
|
+
}
|
|
7616
|
+
if (fn.description) {
|
|
7617
|
+
result.push("");
|
|
7618
|
+
result.push("#### Description for model");
|
|
7619
|
+
result.push("");
|
|
7620
|
+
result.push(fn.description);
|
|
7621
|
+
}
|
|
7622
|
+
if ((_c = fn.parameters) === null || _c === void 0 ? void 0 : _c.properties) {
|
|
7623
|
+
result.push("");
|
|
7624
|
+
result.push("#### Parameters for model");
|
|
7625
|
+
Object.entries(fn.parameters.properties).forEach(function (_a) {
|
|
7626
|
+
var _b = __read(_a, 2), key = _b[0], _c = _b[1], type = _c.type, description = _c.description, e = _c.enum;
|
|
7627
|
+
result.push("");
|
|
7628
|
+
result.push(" - ".concat(key));
|
|
7629
|
+
{
|
|
7630
|
+
result.push("");
|
|
7631
|
+
result.push("**Type:** ".concat(type));
|
|
7632
|
+
}
|
|
7633
|
+
{
|
|
7634
|
+
result.push("");
|
|
7635
|
+
result.push("**Description:** ".concat(description));
|
|
7636
|
+
}
|
|
7637
|
+
if (e) {
|
|
7638
|
+
result.push("");
|
|
7639
|
+
result.push("**Enum:** ".concat(e.join(", ")));
|
|
7640
|
+
}
|
|
7641
|
+
{
|
|
7642
|
+
result.push("");
|
|
7643
|
+
result.push("**Required:** [".concat(fn.parameters.required.includes(key) ? "x" : " ", "]"));
|
|
7644
|
+
}
|
|
7645
|
+
});
|
|
7646
|
+
}
|
|
7647
|
+
if (callbacks) {
|
|
7648
|
+
result.push("");
|
|
7649
|
+
result.push("#### Tool callbacks");
|
|
7650
|
+
result.push("");
|
|
7651
|
+
var callbackList = Object.keys(callbacks);
|
|
7652
|
+
for (var i_3 = 0; i_3 !== callbackList.length; i_3++) {
|
|
7653
|
+
result.push(" - ".concat(callbackList[i_3]));
|
|
7654
|
+
}
|
|
7655
|
+
}
|
|
7656
|
+
if (docNote) {
|
|
7657
|
+
result.push("");
|
|
7658
|
+
result.push("#### Note for developer");
|
|
7659
|
+
result.push("");
|
|
7660
|
+
result.push(docNote);
|
|
7661
|
+
}
|
|
7662
|
+
result.push("");
|
|
7663
|
+
};
|
|
7664
|
+
this_1 = this;
|
|
7665
|
+
for (i = 0; i !== agentSchema.tools.length; i++) {
|
|
7666
|
+
_loop_1(i);
|
|
7667
|
+
}
|
|
7668
|
+
}
|
|
7669
|
+
if (agentSchema.storages) {
|
|
7670
|
+
result.push("## Used storages");
|
|
7671
|
+
result.push("");
|
|
7672
|
+
for (i = 0; i !== agentSchema.storages.length; i++) {
|
|
7673
|
+
if (!agentSchema.storages[i]) {
|
|
7674
|
+
continue;
|
|
7675
|
+
}
|
|
7676
|
+
result.push("### ".concat(i + 1, ". ").concat(agentSchema.storages[i]));
|
|
7677
|
+
_a = this.storageSchemaService.get(agentSchema.storages[i]), docDescription = _a.docDescription, embedding = _a.embedding, shared = _a.shared, callbacks = _a.callbacks;
|
|
7678
|
+
if (docDescription) {
|
|
7679
|
+
result.push("");
|
|
7680
|
+
result.push("#### Storage description");
|
|
7681
|
+
result.push("");
|
|
7682
|
+
result.push(docDescription);
|
|
7683
|
+
}
|
|
7684
|
+
if (embedding) {
|
|
7685
|
+
result.push("");
|
|
7686
|
+
result.push("**Embedding:** ".concat(embedding));
|
|
7687
|
+
}
|
|
7688
|
+
{
|
|
7689
|
+
result.push("");
|
|
7690
|
+
result.push("**Shared:** [".concat(shared ? "x" : " ", "]"));
|
|
7691
|
+
}
|
|
7692
|
+
if (callbacks) {
|
|
7693
|
+
result.push("");
|
|
7694
|
+
result.push("#### Storage callbacks");
|
|
7695
|
+
result.push("");
|
|
7696
|
+
callbackList = Object.keys(callbacks);
|
|
7697
|
+
for (i_1 = 0; i_1 !== callbackList.length; i_1++) {
|
|
7698
|
+
result.push(" - ".concat(callbackList[i_1]));
|
|
7699
|
+
}
|
|
7700
|
+
}
|
|
7701
|
+
result.push("");
|
|
7702
|
+
}
|
|
7703
|
+
}
|
|
7704
|
+
if (agentSchema.states) {
|
|
7705
|
+
result.push("## Used states");
|
|
7706
|
+
result.push("");
|
|
7707
|
+
for (i = 0; i !== agentSchema.states.length; i++) {
|
|
7708
|
+
if (!agentSchema.states[i]) {
|
|
7709
|
+
continue;
|
|
7710
|
+
}
|
|
7711
|
+
result.push("### ".concat(i + 1, ". ").concat(agentSchema.states[i]));
|
|
7712
|
+
_b = this.stateSchemaService.get(agentSchema.states[i]), docDescription = _b.docDescription, shared = _b.shared, callbacks = _b.callbacks;
|
|
7713
|
+
if (docDescription) {
|
|
7714
|
+
result.push("");
|
|
7715
|
+
result.push("#### State description");
|
|
7716
|
+
result.push("");
|
|
7717
|
+
result.push(docDescription);
|
|
7718
|
+
}
|
|
7719
|
+
{
|
|
7720
|
+
result.push("");
|
|
7721
|
+
result.push("**Shared:** [".concat(shared ? "x" : " ", "]"));
|
|
7722
|
+
}
|
|
7723
|
+
if (callbacks) {
|
|
7724
|
+
result.push("");
|
|
7725
|
+
result.push("#### State callbacks");
|
|
7726
|
+
result.push("");
|
|
7727
|
+
callbackList = Object.keys(callbacks);
|
|
7728
|
+
for (i_2 = 0; i_2 !== callbackList.length; i_2++) {
|
|
7729
|
+
result.push(" - ".concat(callbackList[i_2]));
|
|
7730
|
+
}
|
|
7731
|
+
}
|
|
7732
|
+
result.push("");
|
|
7733
|
+
}
|
|
7734
|
+
}
|
|
7735
|
+
if (agentSchema.callbacks) {
|
|
7736
|
+
result.push("## Used callbacks");
|
|
7737
|
+
result.push("");
|
|
7738
|
+
callbackList = Object.keys(agentSchema.callbacks);
|
|
7739
|
+
for (i = 0; i !== callbackList.length; i++) {
|
|
7740
|
+
result.push("".concat(i + 1, ". ").concat(callbackList[i]));
|
|
7741
|
+
}
|
|
7742
|
+
result.push("");
|
|
7743
|
+
}
|
|
7744
|
+
fs.writeFileSync(path.join(dirName, "./agent/".concat(agentSchema.agentName, ".md")), result.join("\n"));
|
|
7745
|
+
return [2 /*return*/];
|
|
7746
|
+
}
|
|
7747
|
+
});
|
|
7748
|
+
}); }, {
|
|
7749
|
+
maxExec: THREAD_POOL_SIZE,
|
|
7750
|
+
});
|
|
7751
|
+
this.dumpDocs = function () {
|
|
7752
|
+
var args_1 = [];
|
|
7753
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
7754
|
+
args_1[_i] = arguments[_i];
|
|
7755
|
+
}
|
|
7756
|
+
return __awaiter(_this, __spreadArray([], __read(args_1), false), void 0, function (dirName) {
|
|
7757
|
+
var SUBDIR_LIST_1, SUBDIR_LIST_1_1, subDir, path$1;
|
|
7758
|
+
var e_1, _a;
|
|
7759
|
+
var _this = this;
|
|
7760
|
+
if (dirName === void 0) { dirName = path.join(process.cwd(), "docs/chat"); }
|
|
7761
|
+
return __generator(this, function (_b) {
|
|
7762
|
+
switch (_b.label) {
|
|
7763
|
+
case 0:
|
|
7764
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
7765
|
+
this.loggerService.info("docService dumpDocs", {
|
|
7766
|
+
dirName: dirName,
|
|
7767
|
+
});
|
|
7768
|
+
try {
|
|
7769
|
+
for (SUBDIR_LIST_1 = __values(SUBDIR_LIST), SUBDIR_LIST_1_1 = SUBDIR_LIST_1.next(); !SUBDIR_LIST_1_1.done; SUBDIR_LIST_1_1 = SUBDIR_LIST_1.next()) {
|
|
7770
|
+
subDir = SUBDIR_LIST_1_1.value;
|
|
7771
|
+
path$1 = path.join(dirName, subDir);
|
|
7772
|
+
if (!fs.existsSync(path$1)) {
|
|
7773
|
+
fs.mkdirSync(path$1, { recursive: true });
|
|
7774
|
+
}
|
|
7775
|
+
}
|
|
7776
|
+
}
|
|
7777
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
7778
|
+
finally {
|
|
7779
|
+
try {
|
|
7780
|
+
if (SUBDIR_LIST_1_1 && !SUBDIR_LIST_1_1.done && (_a = SUBDIR_LIST_1.return)) _a.call(SUBDIR_LIST_1);
|
|
7781
|
+
}
|
|
7782
|
+
finally { if (e_1) throw e_1.error; }
|
|
7783
|
+
}
|
|
7784
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
7785
|
+
this.loggerService.info("docService dumpDocs building swarm docs");
|
|
7786
|
+
return [4 /*yield*/, Promise.all(this.swarmValidationService.getSwarmList().map(function (swarmName) { return __awaiter(_this, void 0, void 0, function () {
|
|
7787
|
+
var swarmSchema;
|
|
7788
|
+
return __generator(this, function (_a) {
|
|
7789
|
+
switch (_a.label) {
|
|
7790
|
+
case 0:
|
|
7791
|
+
swarmSchema = this.swarmSchemaService.get(swarmName);
|
|
7792
|
+
return [4 /*yield*/, this.writeSwarmDoc(swarmSchema, dirName)];
|
|
7793
|
+
case 1:
|
|
7794
|
+
_a.sent();
|
|
7795
|
+
return [2 /*return*/];
|
|
7796
|
+
}
|
|
7797
|
+
});
|
|
7798
|
+
}); }))];
|
|
7799
|
+
case 1:
|
|
7800
|
+
_b.sent();
|
|
7801
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
7802
|
+
this.loggerService.info("docService dumpDocs building agent docs");
|
|
7803
|
+
return [4 /*yield*/, Promise.all(this.agentValidationService.getAgentList().map(function (agentName) { return __awaiter(_this, void 0, void 0, function () {
|
|
7804
|
+
var agentSchema;
|
|
7805
|
+
return __generator(this, function (_a) {
|
|
7806
|
+
switch (_a.label) {
|
|
7807
|
+
case 0:
|
|
7808
|
+
agentSchema = this.agentSchemaService.get(agentName);
|
|
7809
|
+
return [4 /*yield*/, this.writeAgentDoc(agentSchema, dirName)];
|
|
7810
|
+
case 1:
|
|
7811
|
+
_a.sent();
|
|
7812
|
+
return [2 /*return*/];
|
|
7813
|
+
}
|
|
7814
|
+
});
|
|
7815
|
+
}); }))];
|
|
7816
|
+
case 2:
|
|
7817
|
+
_b.sent();
|
|
7818
|
+
return [2 /*return*/];
|
|
7819
|
+
}
|
|
7820
|
+
});
|
|
7821
|
+
});
|
|
7822
|
+
};
|
|
7823
|
+
}
|
|
7824
|
+
return DocService;
|
|
7825
|
+
}());
|
|
7826
|
+
|
|
7420
7827
|
{
|
|
7828
|
+
provide(TYPES.docService, function () { return new DocService(); });
|
|
7421
7829
|
provide(TYPES.busService, function () { return new BusService(); });
|
|
7422
7830
|
provide(TYPES.loggerService, function () { return new LoggerService(); });
|
|
7423
7831
|
}
|
|
@@ -7471,6 +7879,7 @@ var SwarmMetaService = /** @class */ (function () {
|
|
|
7471
7879
|
}
|
|
7472
7880
|
|
|
7473
7881
|
var baseServices = {
|
|
7882
|
+
docService: inject(TYPES.docService),
|
|
7474
7883
|
busService: inject(TYPES.busService),
|
|
7475
7884
|
loggerService: inject(TYPES.loggerService),
|
|
7476
7885
|
};
|
|
@@ -7520,7 +7929,17 @@ var swarm = __assign(__assign(__assign(__assign(__assign(__assign(__assign({}, b
|
|
|
7520
7929
|
init();
|
|
7521
7930
|
var swarm$1 = swarm;
|
|
7522
7931
|
|
|
7523
|
-
var METHOD_NAME$
|
|
7932
|
+
var METHOD_NAME$F = "cli.dumpDocs";
|
|
7933
|
+
var dumpDocs = function (dirName) {
|
|
7934
|
+
if (dirName === void 0) { dirName = "./docs/chat"; }
|
|
7935
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
|
|
7936
|
+
swarm$1.loggerService.log(METHOD_NAME$F, {
|
|
7937
|
+
dirName: dirName,
|
|
7938
|
+
});
|
|
7939
|
+
return swarm$1.docService.dumpDocs(dirName);
|
|
7940
|
+
};
|
|
7941
|
+
|
|
7942
|
+
var METHOD_NAME$E = "cli.dumpAgent";
|
|
7524
7943
|
/**
|
|
7525
7944
|
* Dumps the agent information into PlantUML format.
|
|
7526
7945
|
*
|
|
@@ -7537,7 +7956,7 @@ var dumpAgent = function (agentName, _a) {
|
|
|
7537
7956
|
return swarm$1.agentMetaService.toUML(agentName, withSubtree);
|
|
7538
7957
|
};
|
|
7539
7958
|
|
|
7540
|
-
var METHOD_NAME$D = "
|
|
7959
|
+
var METHOD_NAME$D = "cli.dumpSwarm";
|
|
7541
7960
|
/**
|
|
7542
7961
|
* Dumps the swarm information into PlantUML format.
|
|
7543
7962
|
*
|
|
@@ -9842,6 +10261,7 @@ exports.commitUserMessageForce = commitUserMessageForce;
|
|
|
9842
10261
|
exports.complete = complete;
|
|
9843
10262
|
exports.disposeConnection = disposeConnection;
|
|
9844
10263
|
exports.dumpAgent = dumpAgent;
|
|
10264
|
+
exports.dumpDocs = dumpDocs;
|
|
9845
10265
|
exports.dumpSwarm = dumpSwarm;
|
|
9846
10266
|
exports.emit = emit;
|
|
9847
10267
|
exports.emitForce = emitForce;
|
package/build/index.mjs
CHANGED
|
@@ -3,6 +3,8 @@ import { createActivator } from 'di-kit';
|
|
|
3
3
|
import { trycatch, singleshot, memoize, ToolRegistry, Subject, queued, getErrorMessage, errorData, not, randomString, createAwaiter, cancelable, CANCELED_PROMISE_SYMBOL, execpool, SortedArray, schedule, ttl, Source, isObject } from 'functools-kit';
|
|
4
4
|
import xml2js from 'xml2js';
|
|
5
5
|
import { omit } from 'lodash-es';
|
|
6
|
+
import { join } from 'path';
|
|
7
|
+
import { writeFileSync, existsSync, mkdirSync } from 'fs';
|
|
6
8
|
|
|
7
9
|
/******************************************************************************
|
|
8
10
|
Copyright (c) Microsoft Corporation.
|
|
@@ -170,6 +172,7 @@ var init = (_a$2 = createActivator("agent-swarm"), _a$2.init), inject = _a$2.inj
|
|
|
170
172
|
|
|
171
173
|
var baseServices$1 = {
|
|
172
174
|
busService: Symbol('busService'),
|
|
175
|
+
docService: Symbol('docService'),
|
|
173
176
|
loggerService: Symbol('loggerService'),
|
|
174
177
|
};
|
|
175
178
|
var contextServices$1 = {
|
|
@@ -1426,6 +1429,7 @@ var CC_LOGGER_ENABLE_DEBUG = false;
|
|
|
1426
1429
|
var CC_LOGGER_ENABLE_LOG = true;
|
|
1427
1430
|
var CC_LOGGER_ENABLE_CONSOLE = false;
|
|
1428
1431
|
var CC_NAME_TO_TITLE = nameToTitle;
|
|
1432
|
+
var CC_FN_PLANTUML = function () { return Promise.resolve(""); };
|
|
1429
1433
|
var GLOBAL_CONFIG = {
|
|
1430
1434
|
CC_TOOL_CALL_EXCEPTION_PROMPT: CC_TOOL_CALL_EXCEPTION_PROMPT,
|
|
1431
1435
|
CC_EMPTY_OUTPUT_PLACEHOLDERS: CC_EMPTY_OUTPUT_PLACEHOLDERS,
|
|
@@ -1448,6 +1452,7 @@ var GLOBAL_CONFIG = {
|
|
|
1448
1452
|
CC_LOGGER_ENABLE_LOG: CC_LOGGER_ENABLE_LOG,
|
|
1449
1453
|
CC_LOGGER_ENABLE_CONSOLE: CC_LOGGER_ENABLE_CONSOLE,
|
|
1450
1454
|
CC_NAME_TO_TITLE: CC_NAME_TO_TITLE,
|
|
1455
|
+
CC_FN_PLANTUML: CC_FN_PLANTUML,
|
|
1451
1456
|
};
|
|
1452
1457
|
var setConfig = function (config) {
|
|
1453
1458
|
Object.assign(GLOBAL_CONFIG, config);
|
|
@@ -1801,7 +1806,7 @@ var ClientAgent = /** @class */ (function () {
|
|
|
1801
1806
|
messages: messages,
|
|
1802
1807
|
mode: mode,
|
|
1803
1808
|
tools: (_a = this.params.tools) === null || _a === void 0 ? void 0 : _a.map(function (t) {
|
|
1804
|
-
return omit(t, "toolName", "call", "validate", "callbacks");
|
|
1809
|
+
return omit(t, "toolName", "docNote", "call", "validate", "callbacks");
|
|
1805
1810
|
}),
|
|
1806
1811
|
};
|
|
1807
1812
|
return [4 /*yield*/, this.params.completion.getCompletion(args)];
|
|
@@ -4936,6 +4941,11 @@ var AgentValidationService = /** @class */ (function () {
|
|
|
4936
4941
|
this.storageValidationService = inject(TYPES.storageValidationService);
|
|
4937
4942
|
this._agentMap = new Map();
|
|
4938
4943
|
this._agentDepsMap = new Map();
|
|
4944
|
+
this.getAgentList = function () {
|
|
4945
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
4946
|
+
_this.loggerService.info("agentValidationService getAgentList");
|
|
4947
|
+
return __spreadArray([], __read(_this._agentMap.keys()), false);
|
|
4948
|
+
};
|
|
4939
4949
|
/**
|
|
4940
4950
|
* Retrieves the storages used by the agent
|
|
4941
4951
|
* @param {agentName} agentName - The name of the swarm.
|
|
@@ -4943,6 +4953,10 @@ var AgentValidationService = /** @class */ (function () {
|
|
|
4943
4953
|
* @throws Will throw an error if the swarm is not found.
|
|
4944
4954
|
*/
|
|
4945
4955
|
this.getStorageList = function (agentName) {
|
|
4956
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
4957
|
+
_this.loggerService.info("agentValidationService getStorageList", {
|
|
4958
|
+
agentName: agentName,
|
|
4959
|
+
});
|
|
4946
4960
|
if (!_this._agentMap.has(agentName)) {
|
|
4947
4961
|
throw new Error("agent-swarm agent ".concat(agentName, " not exist (getStorageList)"));
|
|
4948
4962
|
}
|
|
@@ -4955,6 +4969,10 @@ var AgentValidationService = /** @class */ (function () {
|
|
|
4955
4969
|
* @throws Will throw an error if the swarm is not found.
|
|
4956
4970
|
*/
|
|
4957
4971
|
this.getStateList = function (agentName) {
|
|
4972
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
4973
|
+
_this.loggerService.info("agentValidationService getStateList", {
|
|
4974
|
+
agentName: agentName,
|
|
4975
|
+
});
|
|
4958
4976
|
if (!_this._agentMap.has(agentName)) {
|
|
4959
4977
|
throw new Error("agent-swarm agent ".concat(agentName, " not exist (getStateList)"));
|
|
4960
4978
|
}
|
|
@@ -5490,6 +5508,15 @@ var SwarmValidationService = /** @class */ (function () {
|
|
|
5490
5508
|
}
|
|
5491
5509
|
return swarm.agentList;
|
|
5492
5510
|
};
|
|
5511
|
+
/**
|
|
5512
|
+
* Retrieves the list of swarms
|
|
5513
|
+
* @returns {string[]} The list of swarm names
|
|
5514
|
+
*/
|
|
5515
|
+
this.getSwarmList = function () {
|
|
5516
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
5517
|
+
_this.loggerService.info("swarmValidationService getSwarmList");
|
|
5518
|
+
return __spreadArray([], __read(_this._swarmMap.keys()), false);
|
|
5519
|
+
};
|
|
5493
5520
|
/**
|
|
5494
5521
|
* Validates a swarm and its agents.
|
|
5495
5522
|
* @param {SwarmName} swarmName - The name of the swarm.
|
|
@@ -7415,7 +7442,388 @@ var SwarmMetaService = /** @class */ (function () {
|
|
|
7415
7442
|
return SwarmMetaService;
|
|
7416
7443
|
}());
|
|
7417
7444
|
|
|
7445
|
+
var THREAD_POOL_SIZE = 5;
|
|
7446
|
+
var SUBDIR_LIST = ["agent", "image"];
|
|
7447
|
+
var DocService = /** @class */ (function () {
|
|
7448
|
+
function DocService() {
|
|
7449
|
+
var _this = this;
|
|
7450
|
+
this.loggerService = inject(TYPES.loggerService);
|
|
7451
|
+
this.swarmValidationService = inject(TYPES.swarmValidationService);
|
|
7452
|
+
this.agentValidationService = inject(TYPES.agentValidationService);
|
|
7453
|
+
this.swarmSchemaService = inject(TYPES.swarmSchemaService);
|
|
7454
|
+
this.agentSchemaService = inject(TYPES.agentSchemaService);
|
|
7455
|
+
this.toolSchemaService = inject(TYPES.toolSchemaService);
|
|
7456
|
+
this.storageSchemaService = inject(TYPES.storageSchemaService);
|
|
7457
|
+
this.stateSchemaService = inject(TYPES.stateSchemaService);
|
|
7458
|
+
this.agentMetaService = inject(TYPES.agentMetaService);
|
|
7459
|
+
this.swarmMetaService = inject(TYPES.swarmMetaService);
|
|
7460
|
+
this.writeSwarmDoc = execpool(function (swarmSchema, dirName) { return __awaiter(_this, void 0, void 0, function () {
|
|
7461
|
+
var result, umlSchema, umlName, umlSvg, docDescription, i, docDescription, callbackList, i;
|
|
7462
|
+
return __generator(this, function (_a) {
|
|
7463
|
+
switch (_a.label) {
|
|
7464
|
+
case 0:
|
|
7465
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
7466
|
+
this.loggerService.info("docService writeSwarmDoc", {
|
|
7467
|
+
swarmSchema: swarmSchema,
|
|
7468
|
+
});
|
|
7469
|
+
result = [];
|
|
7470
|
+
{
|
|
7471
|
+
result.push("# ".concat(swarmSchema.swarmName));
|
|
7472
|
+
if (swarmSchema.docDescription) {
|
|
7473
|
+
result.push("");
|
|
7474
|
+
result.push("> ".concat(swarmSchema.docDescription));
|
|
7475
|
+
}
|
|
7476
|
+
result.push("");
|
|
7477
|
+
}
|
|
7478
|
+
umlSchema = this.swarmMetaService.toUML(swarmSchema.swarmName);
|
|
7479
|
+
umlName = "swarm_schema_".concat(swarmSchema.swarmName, ".svg");
|
|
7480
|
+
return [4 /*yield*/, GLOBAL_CONFIG.CC_FN_PLANTUML(umlSchema)];
|
|
7481
|
+
case 1:
|
|
7482
|
+
umlSvg = _a.sent();
|
|
7483
|
+
if (umlSvg) {
|
|
7484
|
+
writeFileSync(join(dirName, "image", umlName), umlSvg);
|
|
7485
|
+
result.push(""));
|
|
7486
|
+
result.push("");
|
|
7487
|
+
}
|
|
7488
|
+
if (swarmSchema.defaultAgent) {
|
|
7489
|
+
result.push("## Default agent");
|
|
7490
|
+
result.push("");
|
|
7491
|
+
result.push(" - [".concat(swarmSchema.defaultAgent, "](./agent/").concat(swarmSchema.defaultAgent, ".md)"));
|
|
7492
|
+
docDescription = this.agentSchemaService.get(swarmSchema.defaultAgent).docDescription;
|
|
7493
|
+
if (docDescription) {
|
|
7494
|
+
result.push("");
|
|
7495
|
+
result.push(docDescription);
|
|
7496
|
+
}
|
|
7497
|
+
result.push("");
|
|
7498
|
+
}
|
|
7499
|
+
if (swarmSchema.agentList) {
|
|
7500
|
+
result.push("## Used agents");
|
|
7501
|
+
result.push("");
|
|
7502
|
+
for (i = 0; i !== swarmSchema.agentList.length; i++) {
|
|
7503
|
+
if (!swarmSchema.agentList[i]) {
|
|
7504
|
+
continue;
|
|
7505
|
+
}
|
|
7506
|
+
result.push("".concat(i + 1, ". [").concat(swarmSchema.agentList[i], "](./agent/").concat(swarmSchema.agentList[i], ".md)"));
|
|
7507
|
+
docDescription = this.agentSchemaService.get(swarmSchema.agentList[i]).docDescription;
|
|
7508
|
+
if (docDescription) {
|
|
7509
|
+
result.push("");
|
|
7510
|
+
result.push(docDescription);
|
|
7511
|
+
}
|
|
7512
|
+
result.push("");
|
|
7513
|
+
}
|
|
7514
|
+
}
|
|
7515
|
+
if (swarmSchema.callbacks) {
|
|
7516
|
+
result.push("## Used callbacks");
|
|
7517
|
+
result.push("");
|
|
7518
|
+
callbackList = Object.keys(swarmSchema.callbacks);
|
|
7519
|
+
for (i = 0; i !== callbackList.length; i++) {
|
|
7520
|
+
result.push("".concat(i + 1, ". ").concat(callbackList[i]));
|
|
7521
|
+
}
|
|
7522
|
+
result.push("");
|
|
7523
|
+
}
|
|
7524
|
+
writeFileSync(join(dirName, "./".concat(swarmSchema.swarmName, ".md")), result.join("\n"));
|
|
7525
|
+
return [2 /*return*/];
|
|
7526
|
+
}
|
|
7527
|
+
});
|
|
7528
|
+
}); }, {
|
|
7529
|
+
maxExec: THREAD_POOL_SIZE,
|
|
7530
|
+
});
|
|
7531
|
+
this.writeAgentDoc = execpool(function (agentSchema, dirName) { return __awaiter(_this, void 0, void 0, function () {
|
|
7532
|
+
var result, umlSchema, umlName, umlSvg, i, i, docDescription, _loop_1, this_1, i, i, _a, docDescription, embedding, shared, callbacks, callbackList, i_1, i, _b, docDescription, shared, callbacks, callbackList, i_2, callbackList, i;
|
|
7533
|
+
var _c;
|
|
7534
|
+
return __generator(this, function (_d) {
|
|
7535
|
+
switch (_d.label) {
|
|
7536
|
+
case 0:
|
|
7537
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
7538
|
+
this.loggerService.info("docService writeAgentDoc", {
|
|
7539
|
+
agentSchema: agentSchema,
|
|
7540
|
+
});
|
|
7541
|
+
result = [];
|
|
7542
|
+
{
|
|
7543
|
+
result.push("# ".concat(agentSchema.agentName));
|
|
7544
|
+
if (agentSchema.docDescription) {
|
|
7545
|
+
result.push("");
|
|
7546
|
+
result.push("> ".concat(agentSchema.docDescription));
|
|
7547
|
+
}
|
|
7548
|
+
result.push("");
|
|
7549
|
+
}
|
|
7550
|
+
{
|
|
7551
|
+
result.push("**Completion:** ".concat(agentSchema.completion));
|
|
7552
|
+
result.push("");
|
|
7553
|
+
}
|
|
7554
|
+
umlSchema = this.agentMetaService.toUML(agentSchema.agentName);
|
|
7555
|
+
umlName = "agent_schema_".concat(agentSchema.agentName, ".svg");
|
|
7556
|
+
return [4 /*yield*/, GLOBAL_CONFIG.CC_FN_PLANTUML(umlSchema)];
|
|
7557
|
+
case 1:
|
|
7558
|
+
umlSvg = _d.sent();
|
|
7559
|
+
if (umlSvg) {
|
|
7560
|
+
writeFileSync(join(dirName, "image", umlName), umlSvg);
|
|
7561
|
+
result.push(""));
|
|
7562
|
+
result.push("");
|
|
7563
|
+
}
|
|
7564
|
+
if (agentSchema.prompt) {
|
|
7565
|
+
result.push("## Main prompt");
|
|
7566
|
+
result.push("");
|
|
7567
|
+
result.push("```");
|
|
7568
|
+
result.push(agentSchema.prompt);
|
|
7569
|
+
result.push("```");
|
|
7570
|
+
result.push("");
|
|
7571
|
+
}
|
|
7572
|
+
if (agentSchema.system) {
|
|
7573
|
+
result.push("## System prompt");
|
|
7574
|
+
result.push("");
|
|
7575
|
+
for (i = 0; i !== agentSchema.system.length; i++) {
|
|
7576
|
+
if (!agentSchema.system[i]) {
|
|
7577
|
+
continue;
|
|
7578
|
+
}
|
|
7579
|
+
result.push("".concat(i + 1, ". `").concat(agentSchema.system[i], "`"));
|
|
7580
|
+
result.push("");
|
|
7581
|
+
}
|
|
7582
|
+
}
|
|
7583
|
+
if (agentSchema.dependsOn) {
|
|
7584
|
+
result.push("## Depends on");
|
|
7585
|
+
result.push("");
|
|
7586
|
+
for (i = 0; i !== agentSchema.dependsOn.length; i++) {
|
|
7587
|
+
if (!agentSchema.dependsOn[i]) {
|
|
7588
|
+
continue;
|
|
7589
|
+
}
|
|
7590
|
+
result.push("".concat(i + 1, ". [").concat(agentSchema.dependsOn[i], "](./").concat(agentSchema.dependsOn[i], ".md)"));
|
|
7591
|
+
docDescription = this.agentSchemaService.get(agentSchema.dependsOn[i]).docDescription;
|
|
7592
|
+
if (docDescription) {
|
|
7593
|
+
result.push("");
|
|
7594
|
+
result.push(docDescription);
|
|
7595
|
+
}
|
|
7596
|
+
result.push("");
|
|
7597
|
+
}
|
|
7598
|
+
}
|
|
7599
|
+
if (agentSchema.tools) {
|
|
7600
|
+
result.push("## Used tools");
|
|
7601
|
+
result.push("");
|
|
7602
|
+
_loop_1 = function (i) {
|
|
7603
|
+
if (!agentSchema.tools[i]) {
|
|
7604
|
+
return "continue";
|
|
7605
|
+
}
|
|
7606
|
+
result.push("### ".concat(i + 1, ". ").concat(agentSchema.tools[i]));
|
|
7607
|
+
var _e = this_1.toolSchemaService.get(agentSchema.tools[i]), fn = _e.function, docNote = _e.docNote, callbacks = _e.callbacks;
|
|
7608
|
+
if (fn.name) {
|
|
7609
|
+
result.push("");
|
|
7610
|
+
result.push("#### Name for model");
|
|
7611
|
+
result.push("");
|
|
7612
|
+
result.push(fn.name);
|
|
7613
|
+
}
|
|
7614
|
+
if (fn.description) {
|
|
7615
|
+
result.push("");
|
|
7616
|
+
result.push("#### Description for model");
|
|
7617
|
+
result.push("");
|
|
7618
|
+
result.push(fn.description);
|
|
7619
|
+
}
|
|
7620
|
+
if ((_c = fn.parameters) === null || _c === void 0 ? void 0 : _c.properties) {
|
|
7621
|
+
result.push("");
|
|
7622
|
+
result.push("#### Parameters for model");
|
|
7623
|
+
Object.entries(fn.parameters.properties).forEach(function (_a) {
|
|
7624
|
+
var _b = __read(_a, 2), key = _b[0], _c = _b[1], type = _c.type, description = _c.description, e = _c.enum;
|
|
7625
|
+
result.push("");
|
|
7626
|
+
result.push(" - ".concat(key));
|
|
7627
|
+
{
|
|
7628
|
+
result.push("");
|
|
7629
|
+
result.push("**Type:** ".concat(type));
|
|
7630
|
+
}
|
|
7631
|
+
{
|
|
7632
|
+
result.push("");
|
|
7633
|
+
result.push("**Description:** ".concat(description));
|
|
7634
|
+
}
|
|
7635
|
+
if (e) {
|
|
7636
|
+
result.push("");
|
|
7637
|
+
result.push("**Enum:** ".concat(e.join(", ")));
|
|
7638
|
+
}
|
|
7639
|
+
{
|
|
7640
|
+
result.push("");
|
|
7641
|
+
result.push("**Required:** [".concat(fn.parameters.required.includes(key) ? "x" : " ", "]"));
|
|
7642
|
+
}
|
|
7643
|
+
});
|
|
7644
|
+
}
|
|
7645
|
+
if (callbacks) {
|
|
7646
|
+
result.push("");
|
|
7647
|
+
result.push("#### Tool callbacks");
|
|
7648
|
+
result.push("");
|
|
7649
|
+
var callbackList = Object.keys(callbacks);
|
|
7650
|
+
for (var i_3 = 0; i_3 !== callbackList.length; i_3++) {
|
|
7651
|
+
result.push(" - ".concat(callbackList[i_3]));
|
|
7652
|
+
}
|
|
7653
|
+
}
|
|
7654
|
+
if (docNote) {
|
|
7655
|
+
result.push("");
|
|
7656
|
+
result.push("#### Note for developer");
|
|
7657
|
+
result.push("");
|
|
7658
|
+
result.push(docNote);
|
|
7659
|
+
}
|
|
7660
|
+
result.push("");
|
|
7661
|
+
};
|
|
7662
|
+
this_1 = this;
|
|
7663
|
+
for (i = 0; i !== agentSchema.tools.length; i++) {
|
|
7664
|
+
_loop_1(i);
|
|
7665
|
+
}
|
|
7666
|
+
}
|
|
7667
|
+
if (agentSchema.storages) {
|
|
7668
|
+
result.push("## Used storages");
|
|
7669
|
+
result.push("");
|
|
7670
|
+
for (i = 0; i !== agentSchema.storages.length; i++) {
|
|
7671
|
+
if (!agentSchema.storages[i]) {
|
|
7672
|
+
continue;
|
|
7673
|
+
}
|
|
7674
|
+
result.push("### ".concat(i + 1, ". ").concat(agentSchema.storages[i]));
|
|
7675
|
+
_a = this.storageSchemaService.get(agentSchema.storages[i]), docDescription = _a.docDescription, embedding = _a.embedding, shared = _a.shared, callbacks = _a.callbacks;
|
|
7676
|
+
if (docDescription) {
|
|
7677
|
+
result.push("");
|
|
7678
|
+
result.push("#### Storage description");
|
|
7679
|
+
result.push("");
|
|
7680
|
+
result.push(docDescription);
|
|
7681
|
+
}
|
|
7682
|
+
if (embedding) {
|
|
7683
|
+
result.push("");
|
|
7684
|
+
result.push("**Embedding:** ".concat(embedding));
|
|
7685
|
+
}
|
|
7686
|
+
{
|
|
7687
|
+
result.push("");
|
|
7688
|
+
result.push("**Shared:** [".concat(shared ? "x" : " ", "]"));
|
|
7689
|
+
}
|
|
7690
|
+
if (callbacks) {
|
|
7691
|
+
result.push("");
|
|
7692
|
+
result.push("#### Storage callbacks");
|
|
7693
|
+
result.push("");
|
|
7694
|
+
callbackList = Object.keys(callbacks);
|
|
7695
|
+
for (i_1 = 0; i_1 !== callbackList.length; i_1++) {
|
|
7696
|
+
result.push(" - ".concat(callbackList[i_1]));
|
|
7697
|
+
}
|
|
7698
|
+
}
|
|
7699
|
+
result.push("");
|
|
7700
|
+
}
|
|
7701
|
+
}
|
|
7702
|
+
if (agentSchema.states) {
|
|
7703
|
+
result.push("## Used states");
|
|
7704
|
+
result.push("");
|
|
7705
|
+
for (i = 0; i !== agentSchema.states.length; i++) {
|
|
7706
|
+
if (!agentSchema.states[i]) {
|
|
7707
|
+
continue;
|
|
7708
|
+
}
|
|
7709
|
+
result.push("### ".concat(i + 1, ". ").concat(agentSchema.states[i]));
|
|
7710
|
+
_b = this.stateSchemaService.get(agentSchema.states[i]), docDescription = _b.docDescription, shared = _b.shared, callbacks = _b.callbacks;
|
|
7711
|
+
if (docDescription) {
|
|
7712
|
+
result.push("");
|
|
7713
|
+
result.push("#### State description");
|
|
7714
|
+
result.push("");
|
|
7715
|
+
result.push(docDescription);
|
|
7716
|
+
}
|
|
7717
|
+
{
|
|
7718
|
+
result.push("");
|
|
7719
|
+
result.push("**Shared:** [".concat(shared ? "x" : " ", "]"));
|
|
7720
|
+
}
|
|
7721
|
+
if (callbacks) {
|
|
7722
|
+
result.push("");
|
|
7723
|
+
result.push("#### State callbacks");
|
|
7724
|
+
result.push("");
|
|
7725
|
+
callbackList = Object.keys(callbacks);
|
|
7726
|
+
for (i_2 = 0; i_2 !== callbackList.length; i_2++) {
|
|
7727
|
+
result.push(" - ".concat(callbackList[i_2]));
|
|
7728
|
+
}
|
|
7729
|
+
}
|
|
7730
|
+
result.push("");
|
|
7731
|
+
}
|
|
7732
|
+
}
|
|
7733
|
+
if (agentSchema.callbacks) {
|
|
7734
|
+
result.push("## Used callbacks");
|
|
7735
|
+
result.push("");
|
|
7736
|
+
callbackList = Object.keys(agentSchema.callbacks);
|
|
7737
|
+
for (i = 0; i !== callbackList.length; i++) {
|
|
7738
|
+
result.push("".concat(i + 1, ". ").concat(callbackList[i]));
|
|
7739
|
+
}
|
|
7740
|
+
result.push("");
|
|
7741
|
+
}
|
|
7742
|
+
writeFileSync(join(dirName, "./agent/".concat(agentSchema.agentName, ".md")), result.join("\n"));
|
|
7743
|
+
return [2 /*return*/];
|
|
7744
|
+
}
|
|
7745
|
+
});
|
|
7746
|
+
}); }, {
|
|
7747
|
+
maxExec: THREAD_POOL_SIZE,
|
|
7748
|
+
});
|
|
7749
|
+
this.dumpDocs = function () {
|
|
7750
|
+
var args_1 = [];
|
|
7751
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
7752
|
+
args_1[_i] = arguments[_i];
|
|
7753
|
+
}
|
|
7754
|
+
return __awaiter(_this, __spreadArray([], __read(args_1), false), void 0, function (dirName) {
|
|
7755
|
+
var SUBDIR_LIST_1, SUBDIR_LIST_1_1, subDir, path;
|
|
7756
|
+
var e_1, _a;
|
|
7757
|
+
var _this = this;
|
|
7758
|
+
if (dirName === void 0) { dirName = join(process.cwd(), "docs/chat"); }
|
|
7759
|
+
return __generator(this, function (_b) {
|
|
7760
|
+
switch (_b.label) {
|
|
7761
|
+
case 0:
|
|
7762
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
7763
|
+
this.loggerService.info("docService dumpDocs", {
|
|
7764
|
+
dirName: dirName,
|
|
7765
|
+
});
|
|
7766
|
+
try {
|
|
7767
|
+
for (SUBDIR_LIST_1 = __values(SUBDIR_LIST), SUBDIR_LIST_1_1 = SUBDIR_LIST_1.next(); !SUBDIR_LIST_1_1.done; SUBDIR_LIST_1_1 = SUBDIR_LIST_1.next()) {
|
|
7768
|
+
subDir = SUBDIR_LIST_1_1.value;
|
|
7769
|
+
path = join(dirName, subDir);
|
|
7770
|
+
if (!existsSync(path)) {
|
|
7771
|
+
mkdirSync(path, { recursive: true });
|
|
7772
|
+
}
|
|
7773
|
+
}
|
|
7774
|
+
}
|
|
7775
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
7776
|
+
finally {
|
|
7777
|
+
try {
|
|
7778
|
+
if (SUBDIR_LIST_1_1 && !SUBDIR_LIST_1_1.done && (_a = SUBDIR_LIST_1.return)) _a.call(SUBDIR_LIST_1);
|
|
7779
|
+
}
|
|
7780
|
+
finally { if (e_1) throw e_1.error; }
|
|
7781
|
+
}
|
|
7782
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
7783
|
+
this.loggerService.info("docService dumpDocs building swarm docs");
|
|
7784
|
+
return [4 /*yield*/, Promise.all(this.swarmValidationService.getSwarmList().map(function (swarmName) { return __awaiter(_this, void 0, void 0, function () {
|
|
7785
|
+
var swarmSchema;
|
|
7786
|
+
return __generator(this, function (_a) {
|
|
7787
|
+
switch (_a.label) {
|
|
7788
|
+
case 0:
|
|
7789
|
+
swarmSchema = this.swarmSchemaService.get(swarmName);
|
|
7790
|
+
return [4 /*yield*/, this.writeSwarmDoc(swarmSchema, dirName)];
|
|
7791
|
+
case 1:
|
|
7792
|
+
_a.sent();
|
|
7793
|
+
return [2 /*return*/];
|
|
7794
|
+
}
|
|
7795
|
+
});
|
|
7796
|
+
}); }))];
|
|
7797
|
+
case 1:
|
|
7798
|
+
_b.sent();
|
|
7799
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
7800
|
+
this.loggerService.info("docService dumpDocs building agent docs");
|
|
7801
|
+
return [4 /*yield*/, Promise.all(this.agentValidationService.getAgentList().map(function (agentName) { return __awaiter(_this, void 0, void 0, function () {
|
|
7802
|
+
var agentSchema;
|
|
7803
|
+
return __generator(this, function (_a) {
|
|
7804
|
+
switch (_a.label) {
|
|
7805
|
+
case 0:
|
|
7806
|
+
agentSchema = this.agentSchemaService.get(agentName);
|
|
7807
|
+
return [4 /*yield*/, this.writeAgentDoc(agentSchema, dirName)];
|
|
7808
|
+
case 1:
|
|
7809
|
+
_a.sent();
|
|
7810
|
+
return [2 /*return*/];
|
|
7811
|
+
}
|
|
7812
|
+
});
|
|
7813
|
+
}); }))];
|
|
7814
|
+
case 2:
|
|
7815
|
+
_b.sent();
|
|
7816
|
+
return [2 /*return*/];
|
|
7817
|
+
}
|
|
7818
|
+
});
|
|
7819
|
+
});
|
|
7820
|
+
};
|
|
7821
|
+
}
|
|
7822
|
+
return DocService;
|
|
7823
|
+
}());
|
|
7824
|
+
|
|
7418
7825
|
{
|
|
7826
|
+
provide(TYPES.docService, function () { return new DocService(); });
|
|
7419
7827
|
provide(TYPES.busService, function () { return new BusService(); });
|
|
7420
7828
|
provide(TYPES.loggerService, function () { return new LoggerService(); });
|
|
7421
7829
|
}
|
|
@@ -7469,6 +7877,7 @@ var SwarmMetaService = /** @class */ (function () {
|
|
|
7469
7877
|
}
|
|
7470
7878
|
|
|
7471
7879
|
var baseServices = {
|
|
7880
|
+
docService: inject(TYPES.docService),
|
|
7472
7881
|
busService: inject(TYPES.busService),
|
|
7473
7882
|
loggerService: inject(TYPES.loggerService),
|
|
7474
7883
|
};
|
|
@@ -7518,7 +7927,17 @@ var swarm = __assign(__assign(__assign(__assign(__assign(__assign(__assign({}, b
|
|
|
7518
7927
|
init();
|
|
7519
7928
|
var swarm$1 = swarm;
|
|
7520
7929
|
|
|
7521
|
-
var METHOD_NAME$
|
|
7930
|
+
var METHOD_NAME$F = "cli.dumpDocs";
|
|
7931
|
+
var dumpDocs = function (dirName) {
|
|
7932
|
+
if (dirName === void 0) { dirName = "./docs/chat"; }
|
|
7933
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
|
|
7934
|
+
swarm$1.loggerService.log(METHOD_NAME$F, {
|
|
7935
|
+
dirName: dirName,
|
|
7936
|
+
});
|
|
7937
|
+
return swarm$1.docService.dumpDocs(dirName);
|
|
7938
|
+
};
|
|
7939
|
+
|
|
7940
|
+
var METHOD_NAME$E = "cli.dumpAgent";
|
|
7522
7941
|
/**
|
|
7523
7942
|
* Dumps the agent information into PlantUML format.
|
|
7524
7943
|
*
|
|
@@ -7535,7 +7954,7 @@ var dumpAgent = function (agentName, _a) {
|
|
|
7535
7954
|
return swarm$1.agentMetaService.toUML(agentName, withSubtree);
|
|
7536
7955
|
};
|
|
7537
7956
|
|
|
7538
|
-
var METHOD_NAME$D = "
|
|
7957
|
+
var METHOD_NAME$D = "cli.dumpSwarm";
|
|
7539
7958
|
/**
|
|
7540
7959
|
* Dumps the swarm information into PlantUML format.
|
|
7541
7960
|
*
|
|
@@ -9808,4 +10227,4 @@ var SchemaUtils = /** @class */ (function () {
|
|
|
9808
10227
|
*/
|
|
9809
10228
|
var Schema = new SchemaUtils();
|
|
9810
10229
|
|
|
9811
|
-
export { ExecutionContextService, History, HistoryAdapter, HistoryInstance, Logger, LoggerAdapter, LoggerInstance, MethodContextService, Schema, State, Storage, addAgent, addCompletion, addEmbedding, addState, addStorage, addSwarm, addTool, cancelOutput, cancelOutputForce, changeAgent, commitFlush, commitFlushForce, commitSystemMessage, commitSystemMessageForce, commitToolOutput, commitToolOutputForce, commitUserMessage, commitUserMessageForce, complete, disposeConnection, dumpAgent, dumpSwarm, emit, emitForce, event, execute, executeForce, getAgentHistory, getAgentName, getAssistantHistory, getLastAssistantMessage, getLastSystemMessage, getLastUserMessage, getRawHistory, getSessionMode, getUserHistory, listenAgentEvent, listenAgentEventOnce, listenEvent, listenEventOnce, listenHistoryEvent, listenHistoryEventOnce, listenSessionEvent, listenSessionEventOnce, listenStateEvent, listenStateEventOnce, listenStorageEvent, listenStorageEventOnce, listenSwarmEvent, listenSwarmEventOnce, makeAutoDispose, makeConnection, session, setConfig, swarm };
|
|
10230
|
+
export { ExecutionContextService, History, HistoryAdapter, HistoryInstance, Logger, LoggerAdapter, LoggerInstance, MethodContextService, Schema, State, Storage, addAgent, addCompletion, addEmbedding, addState, addStorage, addSwarm, addTool, cancelOutput, cancelOutputForce, changeAgent, commitFlush, commitFlushForce, commitSystemMessage, commitSystemMessageForce, commitToolOutput, commitToolOutputForce, commitUserMessage, commitUserMessageForce, complete, disposeConnection, dumpAgent, dumpDocs, dumpSwarm, emit, emitForce, event, execute, executeForce, getAgentHistory, getAgentName, getAssistantHistory, getLastAssistantMessage, getLastSystemMessage, getLastUserMessage, getRawHistory, getSessionMode, getUserHistory, listenAgentEvent, listenAgentEventOnce, listenEvent, listenEventOnce, listenHistoryEvent, listenHistoryEventOnce, listenSessionEvent, listenSessionEventOnce, listenStateEvent, listenStateEventOnce, listenStorageEvent, listenStorageEventOnce, listenSwarmEvent, listenSwarmEventOnce, makeAutoDispose, makeConnection, session, setConfig, swarm };
|
package/package.json
CHANGED
package/types.d.ts
CHANGED
|
@@ -145,6 +145,8 @@ interface IStorageData {
|
|
|
145
145
|
* @template T - Type of the storage data.
|
|
146
146
|
*/
|
|
147
147
|
interface IStorageSchema<T extends IStorageData = IStorageData> {
|
|
148
|
+
/** The description for documentation */
|
|
149
|
+
docDescription?: string;
|
|
148
150
|
/**
|
|
149
151
|
* All agents will share the same ClientStorage instance
|
|
150
152
|
*/
|
|
@@ -340,6 +342,8 @@ interface IStateCallbacks<T extends IStateData = IStateData> {
|
|
|
340
342
|
* @template T - The type of the state data.
|
|
341
343
|
*/
|
|
342
344
|
interface IStateSchema<T extends IStateData = IStateData> {
|
|
345
|
+
/** The description for documentation */
|
|
346
|
+
docDescription?: string;
|
|
343
347
|
/**
|
|
344
348
|
* The agents can share the state
|
|
345
349
|
*/
|
|
@@ -563,6 +567,8 @@ interface ISwarmParams extends Omit<ISwarmSchema, keyof {
|
|
|
563
567
|
* @interface
|
|
564
568
|
*/
|
|
565
569
|
interface ISwarmSchema {
|
|
570
|
+
/** The description for documentation */
|
|
571
|
+
docDescription?: string;
|
|
566
572
|
/** Fetch the active agent on init */
|
|
567
573
|
getActiveAgent?: (clientId: string, swarmName: SwarmName, defaultAgent: AgentName) => Promise<AgentName> | AgentName;
|
|
568
574
|
/** Update the active agent after navigation */
|
|
@@ -1240,6 +1246,8 @@ interface IAgentToolCallbacks<T = Record<string, unknown>> {
|
|
|
1240
1246
|
* @template T - The type of the parameters for the tool.
|
|
1241
1247
|
*/
|
|
1242
1248
|
interface IAgentTool<T = Record<string, unknown>> extends ITool {
|
|
1249
|
+
/** The description for documentation */
|
|
1250
|
+
docNote?: string;
|
|
1243
1251
|
/** The name of the tool. */
|
|
1244
1252
|
toolName: ToolName;
|
|
1245
1253
|
/**
|
|
@@ -1380,6 +1388,8 @@ interface IAgentSchemaCallbacks {
|
|
|
1380
1388
|
* Interface representing the schema for an agent.
|
|
1381
1389
|
*/
|
|
1382
1390
|
interface IAgentSchema {
|
|
1391
|
+
/** The description for documentation */
|
|
1392
|
+
docDescription?: string;
|
|
1383
1393
|
/** The name of the agent. */
|
|
1384
1394
|
agentName: AgentName;
|
|
1385
1395
|
/** The name of the completion. */
|
|
@@ -2346,6 +2356,7 @@ declare class AgentValidationService {
|
|
|
2346
2356
|
private readonly storageValidationService;
|
|
2347
2357
|
private _agentMap;
|
|
2348
2358
|
private _agentDepsMap;
|
|
2359
|
+
getAgentList: () => string[];
|
|
2349
2360
|
/**
|
|
2350
2361
|
* Retrieves the storages used by the agent
|
|
2351
2362
|
* @param {agentName} agentName - The name of the swarm.
|
|
@@ -2552,6 +2563,11 @@ declare class SwarmValidationService {
|
|
|
2552
2563
|
* @throws Will throw an error if the swarm is not found.
|
|
2553
2564
|
*/
|
|
2554
2565
|
getAgentList: (swarmName: SwarmName) => string[];
|
|
2566
|
+
/**
|
|
2567
|
+
* Retrieves the list of swarms
|
|
2568
|
+
* @returns {string[]} The list of swarm names
|
|
2569
|
+
*/
|
|
2570
|
+
getSwarmList: () => string[];
|
|
2555
2571
|
/**
|
|
2556
2572
|
* Validates a swarm and its agents.
|
|
2557
2573
|
* @param {SwarmName} swarmName - The name of the swarm.
|
|
@@ -3091,6 +3107,22 @@ declare class SwarmMetaService {
|
|
|
3091
3107
|
toUML: (swarmName: SwarmName) => string;
|
|
3092
3108
|
}
|
|
3093
3109
|
|
|
3110
|
+
declare class DocService {
|
|
3111
|
+
private readonly loggerService;
|
|
3112
|
+
private readonly swarmValidationService;
|
|
3113
|
+
private readonly agentValidationService;
|
|
3114
|
+
private readonly swarmSchemaService;
|
|
3115
|
+
private readonly agentSchemaService;
|
|
3116
|
+
private readonly toolSchemaService;
|
|
3117
|
+
private readonly storageSchemaService;
|
|
3118
|
+
private readonly stateSchemaService;
|
|
3119
|
+
private readonly agentMetaService;
|
|
3120
|
+
private readonly swarmMetaService;
|
|
3121
|
+
private writeSwarmDoc;
|
|
3122
|
+
private writeAgentDoc;
|
|
3123
|
+
dumpDocs: (dirName?: string) => Promise<void>;
|
|
3124
|
+
}
|
|
3125
|
+
|
|
3094
3126
|
declare const swarm: {
|
|
3095
3127
|
agentValidationService: AgentValidationService;
|
|
3096
3128
|
toolValidationService: ToolValidationService;
|
|
@@ -3126,10 +3158,13 @@ declare const swarm: {
|
|
|
3126
3158
|
executionContextService: {
|
|
3127
3159
|
readonly context: IExecutionContext;
|
|
3128
3160
|
};
|
|
3161
|
+
docService: DocService;
|
|
3129
3162
|
busService: BusService;
|
|
3130
3163
|
loggerService: LoggerService;
|
|
3131
3164
|
};
|
|
3132
3165
|
|
|
3166
|
+
declare const dumpDocs: (dirName?: string) => Promise<void>;
|
|
3167
|
+
|
|
3133
3168
|
/**
|
|
3134
3169
|
* The config for UML generation
|
|
3135
3170
|
*/
|
|
@@ -3912,6 +3947,7 @@ declare const GLOBAL_CONFIG: {
|
|
|
3912
3947
|
CC_LOGGER_ENABLE_LOG: boolean;
|
|
3913
3948
|
CC_LOGGER_ENABLE_CONSOLE: boolean;
|
|
3914
3949
|
CC_NAME_TO_TITLE: (name: string) => string;
|
|
3950
|
+
CC_FN_PLANTUML: (uml: string) => Promise<string>;
|
|
3915
3951
|
};
|
|
3916
3952
|
declare const setConfig: (config: Partial<typeof GLOBAL_CONFIG>) => void;
|
|
3917
3953
|
|
|
@@ -4075,4 +4111,4 @@ declare class SchemaUtils {
|
|
|
4075
4111
|
*/
|
|
4076
4112
|
declare const Schema: SchemaUtils;
|
|
4077
4113
|
|
|
4078
|
-
export { type EventSource, ExecutionContextService, History, HistoryAdapter, HistoryInstance, type IAgentSchema, type IAgentTool, type IBaseEvent, type IBusEvent, type IBusEventContext, type ICompletionArgs, type ICompletionSchema, type ICustomEvent, type IEmbeddingSchema, type IHistoryAdapter, type IHistoryInstance, type IHistoryInstanceCallbacks, type IIncomingMessage, type ILoggerAdapter, type ILoggerInstance, type ILoggerInstanceCallbacks, type IMakeConnectionConfig, type IMakeDisposeParams, type IModelMessage, type IOutgoingMessage, type ISessionConfig, type IStateSchema, type IStorageSchema, type ISwarmSchema, type ITool, type IToolCall, Logger, LoggerAdapter, LoggerInstance, MethodContextService, type ReceiveMessageFn, Schema, type SendMessageFn$1 as SendMessageFn, State, Storage, addAgent, addCompletion, addEmbedding, addState, addStorage, addSwarm, addTool, cancelOutput, cancelOutputForce, changeAgent, commitFlush, commitFlushForce, commitSystemMessage, commitSystemMessageForce, commitToolOutput, commitToolOutputForce, commitUserMessage, commitUserMessageForce, complete, disposeConnection, dumpAgent, dumpSwarm, emit, emitForce, event, execute, executeForce, getAgentHistory, getAgentName, getAssistantHistory, getLastAssistantMessage, getLastSystemMessage, getLastUserMessage, getRawHistory, getSessionMode, getUserHistory, listenAgentEvent, listenAgentEventOnce, listenEvent, listenEventOnce, listenHistoryEvent, listenHistoryEventOnce, listenSessionEvent, listenSessionEventOnce, listenStateEvent, listenStateEventOnce, listenStorageEvent, listenStorageEventOnce, listenSwarmEvent, listenSwarmEventOnce, makeAutoDispose, makeConnection, session, setConfig, swarm };
|
|
4114
|
+
export { type EventSource, ExecutionContextService, History, HistoryAdapter, HistoryInstance, type IAgentSchema, type IAgentTool, type IBaseEvent, type IBusEvent, type IBusEventContext, type ICompletionArgs, type ICompletionSchema, type ICustomEvent, type IEmbeddingSchema, type IHistoryAdapter, type IHistoryInstance, type IHistoryInstanceCallbacks, type IIncomingMessage, type ILoggerAdapter, type ILoggerInstance, type ILoggerInstanceCallbacks, type IMakeConnectionConfig, type IMakeDisposeParams, type IModelMessage, type IOutgoingMessage, type ISessionConfig, type IStateSchema, type IStorageSchema, type ISwarmSchema, type ITool, type IToolCall, Logger, LoggerAdapter, LoggerInstance, MethodContextService, type ReceiveMessageFn, Schema, type SendMessageFn$1 as SendMessageFn, State, Storage, addAgent, addCompletion, addEmbedding, addState, addStorage, addSwarm, addTool, cancelOutput, cancelOutputForce, changeAgent, commitFlush, commitFlushForce, commitSystemMessage, commitSystemMessageForce, commitToolOutput, commitToolOutputForce, commitUserMessage, commitUserMessageForce, complete, disposeConnection, dumpAgent, dumpDocs, dumpSwarm, emit, emitForce, event, execute, executeForce, getAgentHistory, getAgentName, getAssistantHistory, getLastAssistantMessage, getLastSystemMessage, getLastUserMessage, getRawHistory, getSessionMode, getUserHistory, listenAgentEvent, listenAgentEventOnce, listenEvent, listenEventOnce, listenHistoryEvent, listenHistoryEventOnce, listenSessionEvent, listenSessionEventOnce, listenStateEvent, listenStateEventOnce, listenStorageEvent, listenStorageEventOnce, listenSwarmEvent, listenSwarmEventOnce, makeAutoDispose, makeConnection, session, setConfig, swarm };
|