agent-swarm-kit 1.0.78 → 1.0.79
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 +1209 -832
- package/build/index.mjs +1210 -834
- package/package.json +3 -2
- package/types.d.ts +26 -4
package/build/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { scoped } from 'di-scoped';
|
|
2
2
|
import { createActivator } from 'di-kit';
|
|
3
|
-
import {
|
|
4
|
-
import { omit } from 'lodash-es';
|
|
3
|
+
import { trycatch, singleshot, memoize, sleep, ToolRegistry, Subject, queued, getErrorMessage, errorData, not, randomString, createAwaiter, cancelable, CANCELED_PROMISE_SYMBOL, execpool, SortedArray, schedule, ttl, Source, isObject } from 'functools-kit';
|
|
5
4
|
import xml2js from 'xml2js';
|
|
5
|
+
import { omit } from 'lodash-es';
|
|
6
6
|
|
|
7
7
|
/******************************************************************************
|
|
8
8
|
Copyright (c) Microsoft Corporation.
|
|
@@ -323,36 +323,6 @@ var LoggerService = /** @class */ (function () {
|
|
|
323
323
|
return LoggerService;
|
|
324
324
|
}());
|
|
325
325
|
|
|
326
|
-
/**
|
|
327
|
-
* Service for managing agent schemas.
|
|
328
|
-
*/
|
|
329
|
-
var AgentSchemaService = /** @class */ (function () {
|
|
330
|
-
function AgentSchemaService() {
|
|
331
|
-
var _this = this;
|
|
332
|
-
this.loggerService = inject(TYPES.loggerService);
|
|
333
|
-
this.registry = new ToolRegistry("agentSchemaService");
|
|
334
|
-
/**
|
|
335
|
-
* Registers a new agent schema.
|
|
336
|
-
* @param {AgentName} key - The name of the agent.
|
|
337
|
-
* @param {IAgentSchema} value - The schema of the agent.
|
|
338
|
-
*/
|
|
339
|
-
this.register = function (key, value) {
|
|
340
|
-
_this.loggerService.info("agentSchemaService register", { key: key });
|
|
341
|
-
_this.registry = _this.registry.register(key, value);
|
|
342
|
-
};
|
|
343
|
-
/**
|
|
344
|
-
* Retrieves an agent schema by name.
|
|
345
|
-
* @param {AgentName} key - The name of the agent.
|
|
346
|
-
* @returns {IAgentSchema} The schema of the agent.
|
|
347
|
-
*/
|
|
348
|
-
this.get = function (key) {
|
|
349
|
-
_this.loggerService.info("agentSchemaService get", { key: key });
|
|
350
|
-
return _this.registry.get(key);
|
|
351
|
-
};
|
|
352
|
-
}
|
|
353
|
-
return AgentSchemaService;
|
|
354
|
-
}());
|
|
355
|
-
|
|
356
326
|
/**
|
|
357
327
|
* Validates that the given output string is not empty.
|
|
358
328
|
*
|
|
@@ -480,10 +450,11 @@ var HistoryInstance = /** @class */ (function () {
|
|
|
480
450
|
return __generator(this, function (_b) {
|
|
481
451
|
switch (_b.label) {
|
|
482
452
|
case 0:
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
453
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
|
|
454
|
+
swarm.loggerService.log("HistoryInstance waitForInit", {
|
|
455
|
+
clientId: this.clientId,
|
|
456
|
+
agentName: agentName,
|
|
457
|
+
});
|
|
487
458
|
if (!this.callbacks.getData) return [3 /*break*/, 2];
|
|
488
459
|
_a = this;
|
|
489
460
|
return [4 /*yield*/, this.callbacks.getData(this.clientId, agentName)];
|
|
@@ -502,10 +473,11 @@ var HistoryInstance = /** @class */ (function () {
|
|
|
502
473
|
*/
|
|
503
474
|
this.push = function (value, agentName) { return __awaiter(_this, void 0, void 0, function () {
|
|
504
475
|
return __generator(this, function (_a) {
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
476
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
|
|
477
|
+
swarm.loggerService.log("HistoryInstance push", {
|
|
478
|
+
clientId: this.clientId,
|
|
479
|
+
agentName: agentName,
|
|
480
|
+
});
|
|
509
481
|
this.callbacks.onPush &&
|
|
510
482
|
this.callbacks.onPush(value, this.clientId, agentName);
|
|
511
483
|
this._array.push(value);
|
|
@@ -521,10 +493,11 @@ var HistoryInstance = /** @class */ (function () {
|
|
|
521
493
|
*/
|
|
522
494
|
this.dispose = function (agentName) { return __awaiter(_this, void 0, void 0, function () {
|
|
523
495
|
return __generator(this, function (_a) {
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
496
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
|
|
497
|
+
swarm.loggerService.log("HistoryInstance dispose", {
|
|
498
|
+
clientId: this.clientId,
|
|
499
|
+
agentName: agentName,
|
|
500
|
+
});
|
|
528
501
|
if (agentName === null) {
|
|
529
502
|
this.callbacks.onDispose && this.callbacks.onDispose(this.clientId);
|
|
530
503
|
this._array = [];
|
|
@@ -532,9 +505,10 @@ var HistoryInstance = /** @class */ (function () {
|
|
|
532
505
|
return [2 /*return*/, Promise.resolve()];
|
|
533
506
|
});
|
|
534
507
|
}); };
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
508
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
|
|
509
|
+
swarm.loggerService.log("HistoryInstance CTOR", {
|
|
510
|
+
clientId: this.clientId,
|
|
511
|
+
});
|
|
538
512
|
if (callbacks.onInit) {
|
|
539
513
|
callbacks.onInit(clientId);
|
|
540
514
|
}
|
|
@@ -549,10 +523,11 @@ var HistoryInstance = /** @class */ (function () {
|
|
|
549
523
|
return __generator(this, function (_g) {
|
|
550
524
|
switch (_g.label) {
|
|
551
525
|
case 0:
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
526
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
|
|
527
|
+
swarm.loggerService.log("HistoryInstance iterate condition", {
|
|
528
|
+
clientId: this.clientId,
|
|
529
|
+
agentName: agentName,
|
|
530
|
+
});
|
|
556
531
|
if (!this.callbacks.onRead) return [3 /*break*/, 12];
|
|
557
532
|
this.callbacks.onReadBegin &&
|
|
558
533
|
this.callbacks.onReadBegin(this.clientId, agentName);
|
|
@@ -647,10 +622,11 @@ var HistoryInstance = /** @class */ (function () {
|
|
|
647
622
|
return __generator(this, function (_g) {
|
|
648
623
|
switch (_g.label) {
|
|
649
624
|
case 0:
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
625
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
|
|
626
|
+
swarm.loggerService.log("HistoryInstance iterate", {
|
|
627
|
+
clientId: this.clientId,
|
|
628
|
+
agentName: agentName,
|
|
629
|
+
});
|
|
654
630
|
if (!this.callbacks.onRead) return [3 /*break*/, 11];
|
|
655
631
|
this.callbacks.onReadBegin &&
|
|
656
632
|
this.callbacks.onReadBegin(this.clientId, agentName);
|
|
@@ -746,7 +722,8 @@ var HistoryUtils = /** @class */ (function () {
|
|
|
746
722
|
* @param Ctor - The constructor for the history instance.
|
|
747
723
|
*/
|
|
748
724
|
this.useHistoryAdapter = function (Ctor) {
|
|
749
|
-
|
|
725
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
|
|
726
|
+
swarm.loggerService.log("HistoryUtils useHistoryAdapter");
|
|
750
727
|
_this.HistoryFactory = Ctor;
|
|
751
728
|
};
|
|
752
729
|
/**
|
|
@@ -754,7 +731,8 @@ var HistoryUtils = /** @class */ (function () {
|
|
|
754
731
|
* @param Callbacks - The callbacks dictionary.
|
|
755
732
|
*/
|
|
756
733
|
this.useHistoryCallbacks = function (Callbacks) {
|
|
757
|
-
|
|
734
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
|
|
735
|
+
swarm.loggerService.log("HistoryUtils useHistoryCallbacks");
|
|
758
736
|
Object.assign(_this.HistoryCallbacks, Callbacks);
|
|
759
737
|
};
|
|
760
738
|
/**
|
|
@@ -769,11 +747,12 @@ var HistoryUtils = /** @class */ (function () {
|
|
|
769
747
|
return __generator(this, function (_a) {
|
|
770
748
|
switch (_a.label) {
|
|
771
749
|
case 0:
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
750
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
|
|
751
|
+
swarm.loggerService.log("HistoryUtils push", {
|
|
752
|
+
clientId: clientId,
|
|
753
|
+
agentName: agentName,
|
|
754
|
+
value: value,
|
|
755
|
+
});
|
|
777
756
|
isInitial = this.getHistory.has(clientId);
|
|
778
757
|
return [4 /*yield*/, this.getHistory(clientId)];
|
|
779
758
|
case 1:
|
|
@@ -797,10 +776,11 @@ var HistoryUtils = /** @class */ (function () {
|
|
|
797
776
|
return __generator(this, function (_a) {
|
|
798
777
|
switch (_a.label) {
|
|
799
778
|
case 0:
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
779
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
|
|
780
|
+
swarm.loggerService.log("HistoryUtils dispose", {
|
|
781
|
+
clientId: clientId,
|
|
782
|
+
agentName: agentName,
|
|
783
|
+
});
|
|
804
784
|
isInitial = this.getHistory.has(clientId);
|
|
805
785
|
return [4 /*yield*/, this.getHistory(clientId)];
|
|
806
786
|
case 1:
|
|
@@ -832,10 +812,11 @@ var HistoryUtils = /** @class */ (function () {
|
|
|
832
812
|
return __generator(this, function (_g) {
|
|
833
813
|
switch (_g.label) {
|
|
834
814
|
case 0:
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
815
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
|
|
816
|
+
swarm.loggerService.log("HistoryUtils iterate", {
|
|
817
|
+
clientId: clientId,
|
|
818
|
+
agentName: agentName,
|
|
819
|
+
});
|
|
839
820
|
isInitial = this.getHistory.has(clientId);
|
|
840
821
|
return [4 /*yield*/, __await(this.getHistory(clientId))];
|
|
841
822
|
case 1:
|
|
@@ -895,6 +876,25 @@ var HistoryAdapter = new HistoryUtils();
|
|
|
895
876
|
*/
|
|
896
877
|
var History = HistoryAdapter;
|
|
897
878
|
|
|
879
|
+
/**
|
|
880
|
+
* Convert a name to title case.
|
|
881
|
+
*
|
|
882
|
+
* @param name - The name to convert to title case.
|
|
883
|
+
* @return The name converted to title case.
|
|
884
|
+
*/
|
|
885
|
+
var nameToTitle = function (name) {
|
|
886
|
+
var _a;
|
|
887
|
+
if (!name) {
|
|
888
|
+
return undefined;
|
|
889
|
+
}
|
|
890
|
+
if (name.includes(".")) {
|
|
891
|
+
var tokens = name.split(".");
|
|
892
|
+
_a = __read(tokens.reverse(), 1), name = _a[0];
|
|
893
|
+
}
|
|
894
|
+
var _b = __read(name.split('_')), word = _b[0], rest = _b.slice(1);
|
|
895
|
+
return __spreadArray(["".concat(word.charAt(0).toUpperCase()).concat(word.slice(1))], __read(rest), false).join(' ');
|
|
896
|
+
};
|
|
897
|
+
|
|
898
898
|
/**
|
|
899
899
|
* @description `ask for agent function` in `llama3.1:8b` to troubleshoot (need CC_OLLAMA_EMIT_TOOL_PROTOCOL to be turned off)
|
|
900
900
|
*/
|
|
@@ -952,6 +952,10 @@ var CC_AGENT_OUTPUT_MAP = function (message) { return message; };
|
|
|
952
952
|
var CC_AGENT_SYSTEM_PROMPT = undefined;
|
|
953
953
|
var CC_STORAGE_SEARCH_SIMILARITY = 0.65;
|
|
954
954
|
var CC_STORAGE_SEARCH_POOL = 5;
|
|
955
|
+
var CC_LOGGER_ENABLE_INFO = false;
|
|
956
|
+
var CC_LOGGER_ENABLE_DEBUG = true;
|
|
957
|
+
var CC_LOGGER_ENABLE_LOG = true;
|
|
958
|
+
var CC_NAME_TO_TITLE = nameToTitle;
|
|
955
959
|
var GLOBAL_CONFIG = {
|
|
956
960
|
CC_TOOL_CALL_EXCEPTION_PROMPT: CC_TOOL_CALL_EXCEPTION_PROMPT,
|
|
957
961
|
CC_EMPTY_OUTPUT_PLACEHOLDERS: CC_EMPTY_OUTPUT_PLACEHOLDERS,
|
|
@@ -968,11 +972,47 @@ var GLOBAL_CONFIG = {
|
|
|
968
972
|
CC_AGENT_DISALLOWED_SYMBOLS: CC_AGENT_DISALLOWED_SYMBOLS,
|
|
969
973
|
CC_STORAGE_SEARCH_SIMILARITY: CC_STORAGE_SEARCH_SIMILARITY,
|
|
970
974
|
CC_STORAGE_SEARCH_POOL: CC_STORAGE_SEARCH_POOL,
|
|
975
|
+
CC_LOGGER_ENABLE_INFO: CC_LOGGER_ENABLE_INFO,
|
|
976
|
+
CC_LOGGER_ENABLE_DEBUG: CC_LOGGER_ENABLE_DEBUG,
|
|
977
|
+
CC_LOGGER_ENABLE_LOG: CC_LOGGER_ENABLE_LOG,
|
|
978
|
+
CC_NAME_TO_TITLE: CC_NAME_TO_TITLE,
|
|
971
979
|
};
|
|
972
980
|
var setConfig = function (config) {
|
|
973
981
|
Object.assign(GLOBAL_CONFIG, config);
|
|
974
982
|
};
|
|
975
983
|
|
|
984
|
+
/**
|
|
985
|
+
* Service for managing agent schemas.
|
|
986
|
+
*/
|
|
987
|
+
var AgentSchemaService = /** @class */ (function () {
|
|
988
|
+
function AgentSchemaService() {
|
|
989
|
+
var _this = this;
|
|
990
|
+
this.loggerService = inject(TYPES.loggerService);
|
|
991
|
+
this.registry = new ToolRegistry("agentSchemaService");
|
|
992
|
+
/**
|
|
993
|
+
* Registers a new agent schema.
|
|
994
|
+
* @param {AgentName} key - The name of the agent.
|
|
995
|
+
* @param {IAgentSchema} value - The schema of the agent.
|
|
996
|
+
*/
|
|
997
|
+
this.register = function (key, value) {
|
|
998
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
999
|
+
_this.loggerService.info("agentSchemaService register", { key: key });
|
|
1000
|
+
_this.registry = _this.registry.register(key, value);
|
|
1001
|
+
};
|
|
1002
|
+
/**
|
|
1003
|
+
* Retrieves an agent schema by name.
|
|
1004
|
+
* @param {AgentName} key - The name of the agent.
|
|
1005
|
+
* @returns {IAgentSchema} The schema of the agent.
|
|
1006
|
+
*/
|
|
1007
|
+
this.get = function (key) {
|
|
1008
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
1009
|
+
_this.loggerService.info("agentSchemaService get", { key: key });
|
|
1010
|
+
return _this.registry.get(key);
|
|
1011
|
+
};
|
|
1012
|
+
}
|
|
1013
|
+
return AgentSchemaService;
|
|
1014
|
+
}());
|
|
1015
|
+
|
|
976
1016
|
var AGENT_CHANGE_SYMBOL = Symbol("agent-change");
|
|
977
1017
|
var getPlaceholder = function () {
|
|
978
1018
|
return GLOBAL_CONFIG.CC_EMPTY_OUTPUT_PLACEHOLDERS[Math.floor(Math.random() * GLOBAL_CONFIG.CC_EMPTY_OUTPUT_PLACEHOLDERS.length)];
|
|
@@ -1006,7 +1046,8 @@ var ClientAgent = /** @class */ (function () {
|
|
|
1006
1046
|
case 0: return [4 /*yield*/, this.params.transform(rawResult, this.params.clientId, this.params.agentName)];
|
|
1007
1047
|
case 1:
|
|
1008
1048
|
result = _a.sent();
|
|
1009
|
-
|
|
1049
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_DEBUG &&
|
|
1050
|
+
this.params.logger.debug("ClientAgent agentName=".concat(this.params.agentName, " clientId=").concat(this.params.clientId, " _emitOuput"), { mode: mode, result: result, rawResult: rawResult });
|
|
1010
1051
|
validation = null;
|
|
1011
1052
|
return [4 /*yield*/, this.params.validate(result)];
|
|
1012
1053
|
case 2:
|
|
@@ -1083,7 +1124,8 @@ var ClientAgent = /** @class */ (function () {
|
|
|
1083
1124
|
return __generator(this, function (_a) {
|
|
1084
1125
|
switch (_a.label) {
|
|
1085
1126
|
case 0:
|
|
1086
|
-
|
|
1127
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_DEBUG &&
|
|
1128
|
+
this.params.logger.debug("ClientAgent agentName=".concat(this.params.agentName, " clientId=").concat(this.params.clientId, " _resurrectModel"));
|
|
1087
1129
|
this.params.onResurrect &&
|
|
1088
1130
|
this.params.onResurrect(this.params.clientId, this.params.agentName, mode, reason);
|
|
1089
1131
|
return [4 /*yield*/, this.params.history.push({
|
|
@@ -1115,7 +1157,8 @@ var ClientAgent = /** @class */ (function () {
|
|
|
1115
1157
|
return [4 /*yield*/, this.params.validate(result)];
|
|
1116
1158
|
case 6:
|
|
1117
1159
|
if (!(validation = _a.sent())) return [3 /*break*/, 8];
|
|
1118
|
-
|
|
1160
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_DEBUG &&
|
|
1161
|
+
this.params.logger.debug("ClientAgent agentName=".concat(this.params.agentName, " clientId=").concat(this.params.clientId, " _resurrectModel validation error: ").concat(validation));
|
|
1119
1162
|
content = getPlaceholder();
|
|
1120
1163
|
return [4 /*yield*/, this.params.history.push({
|
|
1121
1164
|
agentName: this.params.agentName,
|
|
@@ -1141,7 +1184,8 @@ var ClientAgent = /** @class */ (function () {
|
|
|
1141
1184
|
return __generator(this, function (_a) {
|
|
1142
1185
|
switch (_a.label) {
|
|
1143
1186
|
case 0:
|
|
1144
|
-
|
|
1187
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_DEBUG &&
|
|
1188
|
+
this.params.logger.debug("ClientAgent agentName=".concat(this.params.agentName, " clientId=").concat(this.params.clientId, " waitForOutput"));
|
|
1145
1189
|
return [4 /*yield*/, this._outputSubject.toPromise()];
|
|
1146
1190
|
case 1: return [2 /*return*/, _a.sent()];
|
|
1147
1191
|
}
|
|
@@ -1157,7 +1201,8 @@ var ClientAgent = /** @class */ (function () {
|
|
|
1157
1201
|
return __generator(this, function (_d) {
|
|
1158
1202
|
switch (_d.label) {
|
|
1159
1203
|
case 0:
|
|
1160
|
-
|
|
1204
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_DEBUG &&
|
|
1205
|
+
this.params.logger.debug("ClientAgent agentName=".concat(this.params.agentName, " clientId=").concat(this.params.clientId, " getCompletion"));
|
|
1161
1206
|
return [4 /*yield*/, this.params.history.toArrayForAgent(this.params.prompt, this.params.system)];
|
|
1162
1207
|
case 1:
|
|
1163
1208
|
messages = _d.sent();
|
|
@@ -1188,7 +1233,8 @@ var ClientAgent = /** @class */ (function () {
|
|
|
1188
1233
|
return __generator(this, function (_a) {
|
|
1189
1234
|
switch (_a.label) {
|
|
1190
1235
|
case 0:
|
|
1191
|
-
|
|
1236
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_DEBUG &&
|
|
1237
|
+
this.params.logger.debug("ClientAgent agentName=".concat(this.params.agentName, " clientId=").concat(this.params.clientId, " commitUserMessage"), { message: message });
|
|
1192
1238
|
this.params.onUserMessage &&
|
|
1193
1239
|
this.params.onUserMessage(this.params.clientId, this.params.agentName, message);
|
|
1194
1240
|
return [4 /*yield*/, this.params.history.push({
|
|
@@ -1225,7 +1271,8 @@ var ClientAgent = /** @class */ (function () {
|
|
|
1225
1271
|
return __generator(this, function (_a) {
|
|
1226
1272
|
switch (_a.label) {
|
|
1227
1273
|
case 0:
|
|
1228
|
-
|
|
1274
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_DEBUG &&
|
|
1275
|
+
this.params.logger.debug("ClientAgent agentName=".concat(this.params.agentName, " clientId=").concat(this.params.clientId, " commitFlush"));
|
|
1229
1276
|
this.params.onFlush &&
|
|
1230
1277
|
this.params.onFlush(this.params.clientId, this.params.agentName);
|
|
1231
1278
|
return [4 /*yield*/, this.params.history.push({
|
|
@@ -1260,7 +1307,8 @@ var ClientAgent = /** @class */ (function () {
|
|
|
1260
1307
|
return __generator(this, function (_a) {
|
|
1261
1308
|
switch (_a.label) {
|
|
1262
1309
|
case 0:
|
|
1263
|
-
|
|
1310
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_DEBUG &&
|
|
1311
|
+
this.params.logger.debug("ClientAgent agentName=".concat(this.params.agentName, " clientId=").concat(this.params.clientId, " commitAgentChange"));
|
|
1264
1312
|
return [4 /*yield*/, this._agentChangeSubject.next(AGENT_CHANGE_SYMBOL)];
|
|
1265
1313
|
case 1:
|
|
1266
1314
|
_a.sent();
|
|
@@ -1289,7 +1337,8 @@ var ClientAgent = /** @class */ (function () {
|
|
|
1289
1337
|
return __generator(this, function (_a) {
|
|
1290
1338
|
switch (_a.label) {
|
|
1291
1339
|
case 0:
|
|
1292
|
-
|
|
1340
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_DEBUG &&
|
|
1341
|
+
this.params.logger.debug("ClientAgent agentName=".concat(this.params.agentName, " clientId=").concat(this.params.clientId, " commitSystemMessage"), { message: message });
|
|
1293
1342
|
this.params.onSystemMessage &&
|
|
1294
1343
|
this.params.onSystemMessage(this.params.clientId, this.params.agentName, message);
|
|
1295
1344
|
return [4 /*yield*/, this.params.history.push({
|
|
@@ -1327,7 +1376,8 @@ var ClientAgent = /** @class */ (function () {
|
|
|
1327
1376
|
return __generator(this, function (_a) {
|
|
1328
1377
|
switch (_a.label) {
|
|
1329
1378
|
case 0:
|
|
1330
|
-
|
|
1379
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_DEBUG &&
|
|
1380
|
+
this.params.logger.debug("ClientAgent agentName=".concat(this.params.agentName, " clientId=").concat(this.params.clientId, " commitToolOutput"), { content: content, toolId: toolId });
|
|
1331
1381
|
this.params.onToolOutput &&
|
|
1332
1382
|
this.params.onToolOutput(toolId, this.params.clientId, this.params.agentName, content);
|
|
1333
1383
|
return [4 /*yield*/, this.params.history.push({
|
|
@@ -1373,7 +1423,8 @@ var ClientAgent = /** @class */ (function () {
|
|
|
1373
1423
|
return __generator(this, function (_h) {
|
|
1374
1424
|
switch (_h.label) {
|
|
1375
1425
|
case 0:
|
|
1376
|
-
|
|
1426
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_DEBUG &&
|
|
1427
|
+
this.params.logger.debug("ClientAgent agentName=".concat(this.params.agentName, " clientId=").concat(this.params.clientId, " execute begin"), { incoming: incoming, mode: mode });
|
|
1377
1428
|
this.params.onExecute &&
|
|
1378
1429
|
this.params.onExecute(this.params.clientId, this.params.agentName, incoming, mode);
|
|
1379
1430
|
return [4 /*yield*/, this.params.history.push({
|
|
@@ -1391,7 +1442,8 @@ var ClientAgent = /** @class */ (function () {
|
|
|
1391
1442
|
case 3:
|
|
1392
1443
|
message = _h.sent();
|
|
1393
1444
|
if (!message.tool_calls) return [3 /*break*/, 9];
|
|
1394
|
-
|
|
1445
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_DEBUG &&
|
|
1446
|
+
this.params.logger.debug("ClientAgent agentName=".concat(this.params.agentName, " clientId=").concat(this.params.clientId, " tool call begin"));
|
|
1395
1447
|
toolCalls = message.tool_calls.map(function (call) {
|
|
1396
1448
|
var _a, _b;
|
|
1397
1449
|
return ({
|
|
@@ -1411,11 +1463,13 @@ var ClientAgent = /** @class */ (function () {
|
|
|
1411
1463
|
tool = toolCalls[idx];
|
|
1412
1464
|
targetFn = (_a = this_1.params.tools) === null || _a === void 0 ? void 0 : _a.find(function (t) { return t.function.name === tool.function.name; });
|
|
1413
1465
|
if (!!targetFn) return [3 /*break*/, 3];
|
|
1414
|
-
|
|
1466
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_DEBUG &&
|
|
1467
|
+
this_1.params.logger.debug("ClientAgent agentName=".concat(this_1.params.agentName, " clientId=").concat(this_1.params.clientId, " functionName=").concat(tool.function.name, " tool function not found"), this_1.params.tools);
|
|
1415
1468
|
return [4 /*yield*/, this_1._resurrectModel(mode, "No target function for ".concat(tool.function.name))];
|
|
1416
1469
|
case 1:
|
|
1417
1470
|
result_2 = _j.sent();
|
|
1418
|
-
|
|
1471
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_DEBUG &&
|
|
1472
|
+
this_1.params.logger.debug("ClientAgent agentName=".concat(this_1.params.agentName, " clientId=").concat(this_1.params.clientId, " execute end result=").concat(result_2));
|
|
1419
1473
|
return [4 /*yield*/, this_1._emitOuput(mode, result_2)];
|
|
1420
1474
|
case 2:
|
|
1421
1475
|
_j.sent();
|
|
@@ -1431,11 +1485,13 @@ var ClientAgent = /** @class */ (function () {
|
|
|
1431
1485
|
}))];
|
|
1432
1486
|
case 4:
|
|
1433
1487
|
if (!_j.sent()) return [3 /*break*/, 7];
|
|
1434
|
-
|
|
1488
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_DEBUG &&
|
|
1489
|
+
this_1.params.logger.debug("ClientAgent agentName=".concat(this_1.params.agentName, " clientId=").concat(this_1.params.clientId, " functionName=").concat(tool.function.name, " tool validation not passed"));
|
|
1435
1490
|
return [4 /*yield*/, this_1._resurrectModel(mode, "Function validation failed: name=".concat(tool.function.name, " arguments=").concat(JSON.stringify(tool.function.arguments)))];
|
|
1436
1491
|
case 5:
|
|
1437
1492
|
result_3 = _j.sent();
|
|
1438
|
-
|
|
1493
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_DEBUG &&
|
|
1494
|
+
this_1.params.logger.debug("ClientAgent agentName=".concat(this_1.params.agentName, " clientId=").concat(this_1.params.clientId, " execute end result=").concat(result_3));
|
|
1439
1495
|
return [4 /*yield*/, this_1._emitOuput(mode, result_3)];
|
|
1440
1496
|
case 6:
|
|
1441
1497
|
_j.sent();
|
|
@@ -1472,7 +1528,8 @@ var ClientAgent = /** @class */ (function () {
|
|
|
1472
1528
|
((_b = targetFn.callbacks) === null || _b === void 0 ? void 0 : _b.onCallError(tool.id, _this.params.clientId, _this.params.agentName, tool.function.arguments, error));
|
|
1473
1529
|
_this._toolErrorSubject.next();
|
|
1474
1530
|
});
|
|
1475
|
-
|
|
1531
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_DEBUG &&
|
|
1532
|
+
this_1.params.logger.debug("ClientAgent agentName=".concat(this_1.params.agentName, " clientId=").concat(this_1.params.clientId, " functionName=").concat(tool.function.name, " tool call executing"));
|
|
1476
1533
|
return [4 /*yield*/, Promise.race([
|
|
1477
1534
|
this_1._agentChangeSubject.toPromise(),
|
|
1478
1535
|
this_1._toolCommitSubject.toPromise(),
|
|
@@ -1481,9 +1538,11 @@ var ClientAgent = /** @class */ (function () {
|
|
|
1481
1538
|
])];
|
|
1482
1539
|
case 8:
|
|
1483
1540
|
status = _j.sent();
|
|
1484
|
-
|
|
1541
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_DEBUG &&
|
|
1542
|
+
this_1.params.logger.debug("ClientAgent agentName=".concat(this_1.params.agentName, " clientId=").concat(this_1.params.clientId, " functionName=").concat(tool.function.name, " tool call end"));
|
|
1485
1543
|
if (status === AGENT_CHANGE_SYMBOL) {
|
|
1486
|
-
|
|
1544
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_DEBUG &&
|
|
1545
|
+
this_1.params.logger.debug("ClientAgent agentName=".concat(this_1.params.agentName, " clientId=").concat(this_1.params.clientId, " functionName=").concat(tool.function.name, " the next tool execution stopped due to the agent changed"));
|
|
1487
1546
|
((_f = this_1.params.callbacks) === null || _f === void 0 ? void 0 : _f.onAfterToolCalls) &&
|
|
1488
1547
|
this_1.params.callbacks.onAfterToolCalls(this_1.params.clientId, this_1.params.agentName, toolCalls);
|
|
1489
1548
|
return [2 /*return*/, { value: void 0 }];
|
|
@@ -1512,7 +1571,8 @@ var ClientAgent = /** @class */ (function () {
|
|
|
1512
1571
|
return [2 /*return*/];
|
|
1513
1572
|
case 9:
|
|
1514
1573
|
if (!message.tool_calls) {
|
|
1515
|
-
|
|
1574
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_DEBUG &&
|
|
1575
|
+
this.params.logger.debug("ClientAgent agentName=".concat(this.params.agentName, " clientId=").concat(this.params.clientId, " execute no tool calls detected"));
|
|
1516
1576
|
}
|
|
1517
1577
|
return [4 /*yield*/, this.params.transform(message.content, this.params.clientId, this.params.agentName)];
|
|
1518
1578
|
case 10:
|
|
@@ -1524,7 +1584,8 @@ var ClientAgent = /** @class */ (function () {
|
|
|
1524
1584
|
return [4 /*yield*/, this.params.validate(result)];
|
|
1525
1585
|
case 12:
|
|
1526
1586
|
if (!(validation = _h.sent())) return [3 /*break*/, 15];
|
|
1527
|
-
|
|
1587
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_DEBUG &&
|
|
1588
|
+
this.params.logger.debug("ClientAgent agentName=".concat(this.params.agentName, " clientId=").concat(this.params.clientId, " execute invalid tool call detected: ").concat(validation), { result: result });
|
|
1528
1589
|
return [4 /*yield*/, this._resurrectModel(mode, "Invalid model output: ".concat(result))];
|
|
1529
1590
|
case 13:
|
|
1530
1591
|
result1 = _h.sent();
|
|
@@ -1533,7 +1594,8 @@ var ClientAgent = /** @class */ (function () {
|
|
|
1533
1594
|
_h.sent();
|
|
1534
1595
|
return [2 /*return*/];
|
|
1535
1596
|
case 15:
|
|
1536
|
-
|
|
1597
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_DEBUG &&
|
|
1598
|
+
this.params.logger.debug("ClientAgent agentName=".concat(this.params.agentName, " clientId=").concat(this.params.clientId, " execute end result=").concat(result));
|
|
1537
1599
|
return [4 /*yield*/, this._emitOuput(mode, result)];
|
|
1538
1600
|
case 16:
|
|
1539
1601
|
_h.sent();
|
|
@@ -1547,15 +1609,17 @@ var ClientAgent = /** @class */ (function () {
|
|
|
1547
1609
|
*/
|
|
1548
1610
|
this.dispose = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
1549
1611
|
return __generator(this, function (_a) {
|
|
1550
|
-
|
|
1612
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_DEBUG &&
|
|
1613
|
+
this.params.logger.debug("ClientAgent agentName=".concat(this.params.agentName, " clientId=").concat(this.params.clientId, " dispose"));
|
|
1551
1614
|
this.params.onDispose &&
|
|
1552
1615
|
this.params.onDispose(this.params.clientId, this.params.agentName);
|
|
1553
1616
|
return [2 /*return*/];
|
|
1554
1617
|
});
|
|
1555
1618
|
}); };
|
|
1556
|
-
|
|
1557
|
-
params
|
|
1558
|
-
|
|
1619
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_DEBUG &&
|
|
1620
|
+
this.params.logger.debug("ClientAgent agentName=".concat(this.params.agentName, " clientId=").concat(this.params.clientId, " CTOR"), {
|
|
1621
|
+
params: params,
|
|
1622
|
+
});
|
|
1559
1623
|
this.params.onInit && this.params.onInit(params.clientId, params.agentName);
|
|
1560
1624
|
}
|
|
1561
1625
|
return ClientAgent;
|
|
@@ -1611,10 +1675,11 @@ var AgentConnectionService = /** @class */ (function () {
|
|
|
1611
1675
|
return __generator(this, function (_a) {
|
|
1612
1676
|
switch (_a.label) {
|
|
1613
1677
|
case 0:
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1678
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
1679
|
+
this.loggerService.info("agentConnectionService execute", {
|
|
1680
|
+
input: input,
|
|
1681
|
+
mode: mode,
|
|
1682
|
+
});
|
|
1618
1683
|
return [4 /*yield*/, this.getAgent(this.methodContextService.context.clientId, this.methodContextService.context.agentName).execute(input, mode)];
|
|
1619
1684
|
case 1: return [2 /*return*/, _a.sent()];
|
|
1620
1685
|
}
|
|
@@ -1628,7 +1693,8 @@ var AgentConnectionService = /** @class */ (function () {
|
|
|
1628
1693
|
return __generator(this, function (_a) {
|
|
1629
1694
|
switch (_a.label) {
|
|
1630
1695
|
case 0:
|
|
1631
|
-
|
|
1696
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
1697
|
+
this.loggerService.info("agentConnectionService waitForOutput");
|
|
1632
1698
|
return [4 /*yield*/, this.getAgent(this.methodContextService.context.clientId, this.methodContextService.context.agentName).waitForOutput()];
|
|
1633
1699
|
case 1: return [2 /*return*/, _a.sent()];
|
|
1634
1700
|
}
|
|
@@ -1644,10 +1710,11 @@ var AgentConnectionService = /** @class */ (function () {
|
|
|
1644
1710
|
return __generator(this, function (_a) {
|
|
1645
1711
|
switch (_a.label) {
|
|
1646
1712
|
case 0:
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1713
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
1714
|
+
this.loggerService.info("agentConnectionService commitToolOutput", {
|
|
1715
|
+
content: content,
|
|
1716
|
+
toolId: toolId,
|
|
1717
|
+
});
|
|
1651
1718
|
return [4 /*yield*/, this.getAgent(this.methodContextService.context.clientId, this.methodContextService.context.agentName).commitToolOutput(toolId, content)];
|
|
1652
1719
|
case 1: return [2 /*return*/, _a.sent()];
|
|
1653
1720
|
}
|
|
@@ -1662,9 +1729,10 @@ var AgentConnectionService = /** @class */ (function () {
|
|
|
1662
1729
|
return __generator(this, function (_a) {
|
|
1663
1730
|
switch (_a.label) {
|
|
1664
1731
|
case 0:
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1732
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
1733
|
+
this.loggerService.info("agentConnectionService commitSystemMessage", {
|
|
1734
|
+
message: message,
|
|
1735
|
+
});
|
|
1668
1736
|
return [4 /*yield*/, this.getAgent(this.methodContextService.context.clientId, this.methodContextService.context.agentName).commitSystemMessage(message)];
|
|
1669
1737
|
case 1: return [2 /*return*/, _a.sent()];
|
|
1670
1738
|
}
|
|
@@ -1679,9 +1747,10 @@ var AgentConnectionService = /** @class */ (function () {
|
|
|
1679
1747
|
return __generator(this, function (_a) {
|
|
1680
1748
|
switch (_a.label) {
|
|
1681
1749
|
case 0:
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1750
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
1751
|
+
this.loggerService.info("agentConnectionService commitUserMessage", {
|
|
1752
|
+
message: message,
|
|
1753
|
+
});
|
|
1685
1754
|
return [4 /*yield*/, this.getAgent(this.methodContextService.context.clientId, this.methodContextService.context.agentName).commitUserMessage(message)];
|
|
1686
1755
|
case 1: return [2 /*return*/, _a.sent()];
|
|
1687
1756
|
}
|
|
@@ -1695,7 +1764,8 @@ var AgentConnectionService = /** @class */ (function () {
|
|
|
1695
1764
|
return __generator(this, function (_a) {
|
|
1696
1765
|
switch (_a.label) {
|
|
1697
1766
|
case 0:
|
|
1698
|
-
|
|
1767
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
1768
|
+
this.loggerService.info("agentConnectionService commitAgentChange");
|
|
1699
1769
|
return [4 /*yield*/, this.getAgent(this.methodContextService.context.clientId, this.methodContextService.context.agentName).commitAgentChange()];
|
|
1700
1770
|
case 1: return [2 /*return*/, _a.sent()];
|
|
1701
1771
|
}
|
|
@@ -1709,7 +1779,8 @@ var AgentConnectionService = /** @class */ (function () {
|
|
|
1709
1779
|
return __generator(this, function (_a) {
|
|
1710
1780
|
switch (_a.label) {
|
|
1711
1781
|
case 0:
|
|
1712
|
-
|
|
1782
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
1783
|
+
this.loggerService.info("agentConnectionService commitFlush");
|
|
1713
1784
|
return [4 /*yield*/, this.getAgent(this.methodContextService.context.clientId, this.methodContextService.context.agentName).commitFlush()];
|
|
1714
1785
|
case 1: return [2 /*return*/, _a.sent()];
|
|
1715
1786
|
}
|
|
@@ -1724,7 +1795,8 @@ var AgentConnectionService = /** @class */ (function () {
|
|
|
1724
1795
|
return __generator(this, function (_a) {
|
|
1725
1796
|
switch (_a.label) {
|
|
1726
1797
|
case 0:
|
|
1727
|
-
|
|
1798
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
1799
|
+
this.loggerService.info("agentConnectionService dispose");
|
|
1728
1800
|
key = "".concat(this.methodContextService.context.clientId, "-").concat(this.methodContextService.context.agentName);
|
|
1729
1801
|
if (!this.getAgent.has(key)) {
|
|
1730
1802
|
return [2 /*return*/];
|
|
@@ -1763,7 +1835,8 @@ var ClientHistory = /** @class */ (function () {
|
|
|
1763
1835
|
return __generator(this, function (_a) {
|
|
1764
1836
|
switch (_a.label) {
|
|
1765
1837
|
case 0:
|
|
1766
|
-
|
|
1838
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_DEBUG &&
|
|
1839
|
+
this.params.logger.debug("ClientHistory agentName=".concat(this.params.agentName, " push"), { message: message });
|
|
1767
1840
|
return [4 /*yield*/, this.params.items.push(message, this.params.clientId, this.params.agentName)];
|
|
1768
1841
|
case 1:
|
|
1769
1842
|
_a.sent();
|
|
@@ -1771,7 +1844,7 @@ var ClientHistory = /** @class */ (function () {
|
|
|
1771
1844
|
type: "push",
|
|
1772
1845
|
source: "history-bus",
|
|
1773
1846
|
input: {
|
|
1774
|
-
message: message
|
|
1847
|
+
message: message,
|
|
1775
1848
|
},
|
|
1776
1849
|
output: {},
|
|
1777
1850
|
context: {
|
|
@@ -1795,7 +1868,8 @@ var ClientHistory = /** @class */ (function () {
|
|
|
1795
1868
|
return __generator(this, function (_g) {
|
|
1796
1869
|
switch (_g.label) {
|
|
1797
1870
|
case 0:
|
|
1798
|
-
|
|
1871
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_DEBUG &&
|
|
1872
|
+
this.params.logger.debug("ClientHistory agentName=".concat(this.params.agentName, " toArrayForRaw"));
|
|
1799
1873
|
result = [];
|
|
1800
1874
|
_g.label = 1;
|
|
1801
1875
|
case 1:
|
|
@@ -1848,7 +1922,8 @@ var ClientHistory = /** @class */ (function () {
|
|
|
1848
1922
|
return __generator(this, function (_h) {
|
|
1849
1923
|
switch (_h.label) {
|
|
1850
1924
|
case 0:
|
|
1851
|
-
|
|
1925
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_DEBUG &&
|
|
1926
|
+
this.params.logger.debug("ClientHistory agentName=".concat(this.params.agentName, " toArrayForAgent"));
|
|
1852
1927
|
commonMessagesRaw = [];
|
|
1853
1928
|
systemMessagesRaw = [];
|
|
1854
1929
|
_h.label = 1;
|
|
@@ -1989,7 +2064,8 @@ var ClientHistory = /** @class */ (function () {
|
|
|
1989
2064
|
return __generator(this, function (_a) {
|
|
1990
2065
|
switch (_a.label) {
|
|
1991
2066
|
case 0:
|
|
1992
|
-
|
|
2067
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_DEBUG &&
|
|
2068
|
+
this.params.logger.debug("ClientAgent agentName=".concat(this.params.agentName, " clientId=").concat(this.params.clientId, " dispose"));
|
|
1993
2069
|
return [4 /*yield*/, this.params.items.dispose(this.params.clientId, this.params.agentName)];
|
|
1994
2070
|
case 1:
|
|
1995
2071
|
_a.sent();
|
|
@@ -1997,9 +2073,10 @@ var ClientHistory = /** @class */ (function () {
|
|
|
1997
2073
|
}
|
|
1998
2074
|
});
|
|
1999
2075
|
}); };
|
|
2000
|
-
|
|
2001
|
-
params
|
|
2002
|
-
|
|
2076
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_DEBUG &&
|
|
2077
|
+
this.params.logger.debug("ClientHistory agentName=".concat(this.params.agentName, " clientId=").concat(this.params.clientId, " CTOR"), {
|
|
2078
|
+
params: params,
|
|
2079
|
+
});
|
|
2003
2080
|
this._filterCondition = GLOBAL_CONFIG.CC_AGENT_HISTORY_FILTER(this.params.agentName);
|
|
2004
2081
|
}
|
|
2005
2082
|
return ClientHistory;
|
|
@@ -2044,9 +2121,10 @@ var HistoryConnectionService = /** @class */ (function () {
|
|
|
2044
2121
|
return __generator(this, function (_a) {
|
|
2045
2122
|
switch (_a.label) {
|
|
2046
2123
|
case 0:
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2124
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
2125
|
+
this.loggerService.info("historyConnectionService push", {
|
|
2126
|
+
message: message,
|
|
2127
|
+
});
|
|
2050
2128
|
return [4 /*yield*/, this.getHistory(this.methodContextService.context.clientId, this.methodContextService.context.agentName).push(message)];
|
|
2051
2129
|
case 1: return [2 /*return*/, _a.sent()];
|
|
2052
2130
|
}
|
|
@@ -2061,9 +2139,10 @@ var HistoryConnectionService = /** @class */ (function () {
|
|
|
2061
2139
|
return __generator(this, function (_a) {
|
|
2062
2140
|
switch (_a.label) {
|
|
2063
2141
|
case 0:
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2142
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
2143
|
+
this.loggerService.info("historyConnectionService toArrayForAgent", {
|
|
2144
|
+
prompt: prompt,
|
|
2145
|
+
});
|
|
2067
2146
|
return [4 /*yield*/, this.getHistory(this.methodContextService.context.clientId, this.methodContextService.context.agentName).toArrayForAgent(prompt)];
|
|
2068
2147
|
case 1: return [2 /*return*/, _a.sent()];
|
|
2069
2148
|
}
|
|
@@ -2077,7 +2156,8 @@ var HistoryConnectionService = /** @class */ (function () {
|
|
|
2077
2156
|
return __generator(this, function (_a) {
|
|
2078
2157
|
switch (_a.label) {
|
|
2079
2158
|
case 0:
|
|
2080
|
-
|
|
2159
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
2160
|
+
this.loggerService.info("historyConnectionService toArrayForRaw");
|
|
2081
2161
|
return [4 /*yield*/, this.getHistory(this.methodContextService.context.clientId, this.methodContextService.context.agentName).toArrayForRaw()];
|
|
2082
2162
|
case 1: return [2 /*return*/, _a.sent()];
|
|
2083
2163
|
}
|
|
@@ -2092,7 +2172,8 @@ var HistoryConnectionService = /** @class */ (function () {
|
|
|
2092
2172
|
return __generator(this, function (_a) {
|
|
2093
2173
|
switch (_a.label) {
|
|
2094
2174
|
case 0:
|
|
2095
|
-
|
|
2175
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
2176
|
+
this.loggerService.info("historyConnectionService dispose");
|
|
2096
2177
|
key = "".concat(this.methodContextService.context.clientId, "-").concat(this.methodContextService.context.agentName);
|
|
2097
2178
|
if (!this.getHistory.has(key)) {
|
|
2098
2179
|
return [2 /*return*/];
|
|
@@ -2124,7 +2205,8 @@ var ToolSchemaService = /** @class */ (function () {
|
|
|
2124
2205
|
* @param {IAgentTool} value - The tool to register.
|
|
2125
2206
|
*/
|
|
2126
2207
|
this.register = function (key, value) {
|
|
2127
|
-
|
|
2208
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
2209
|
+
_this.loggerService.info("toolSchemaService register");
|
|
2128
2210
|
_this.registry = _this.registry.register(key, value);
|
|
2129
2211
|
};
|
|
2130
2212
|
/**
|
|
@@ -2133,7 +2215,8 @@ var ToolSchemaService = /** @class */ (function () {
|
|
|
2133
2215
|
* @returns {IAgentTool} The tool associated with the given key.
|
|
2134
2216
|
*/
|
|
2135
2217
|
this.get = function (key) {
|
|
2136
|
-
|
|
2218
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
2219
|
+
_this.loggerService.info("toolSchemaService get", { key: key });
|
|
2137
2220
|
return _this.registry.get(key);
|
|
2138
2221
|
};
|
|
2139
2222
|
}
|
|
@@ -2165,7 +2248,8 @@ var ClientSwarm = /** @class */ (function () {
|
|
|
2165
2248
|
return __generator(this, function (_d) {
|
|
2166
2249
|
switch (_d.label) {
|
|
2167
2250
|
case 0:
|
|
2168
|
-
|
|
2251
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_DEBUG &&
|
|
2252
|
+
this.params.logger.debug("ClientSwarm swarmName=".concat(this.params.swarmName, " clientId=").concat(this.params.clientId, " cancelOutput"));
|
|
2169
2253
|
_b = (_a = this._cancelOutputSubject).next;
|
|
2170
2254
|
_c = {};
|
|
2171
2255
|
return [4 /*yield*/, this.getAgentName()];
|
|
@@ -2200,7 +2284,8 @@ var ClientSwarm = /** @class */ (function () {
|
|
|
2200
2284
|
return __generator(this, function (_c) {
|
|
2201
2285
|
switch (_c.label) {
|
|
2202
2286
|
case 0:
|
|
2203
|
-
|
|
2287
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_DEBUG &&
|
|
2288
|
+
this.params.logger.debug("ClientSwarm swarmName=".concat(this.params.swarmName, " clientId=").concat(this.params.clientId, " waitForOutput"));
|
|
2204
2289
|
_a = __read(createAwaiter(), 2), awaiter = _a[0], resolve = _a[1].resolve;
|
|
2205
2290
|
getOutput = cancelable(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
2206
2291
|
var _this = this;
|
|
@@ -2246,6 +2331,7 @@ var ClientSwarm = /** @class */ (function () {
|
|
|
2246
2331
|
case 2:
|
|
2247
2332
|
expectAgent = _c.sent();
|
|
2248
2333
|
agentName !== expectAgent &&
|
|
2334
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_DEBUG &&
|
|
2249
2335
|
this.params.logger.debug("ClientSwarm swarmName=".concat(this.params.swarmName, " clientId=").concat(this.params.clientId, " waitForAgent agent miss"), { agentName: agentName, expectAgent: expectAgent });
|
|
2250
2336
|
return [4 /*yield*/, this.params.bus.emit(this.params.clientId, {
|
|
2251
2337
|
type: "wait-for-output",
|
|
@@ -2274,7 +2360,8 @@ var ClientSwarm = /** @class */ (function () {
|
|
|
2274
2360
|
return __generator(this, function (_b) {
|
|
2275
2361
|
switch (_b.label) {
|
|
2276
2362
|
case 0:
|
|
2277
|
-
|
|
2363
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_DEBUG &&
|
|
2364
|
+
this.params.logger.debug("ClientSwarm swarmName=".concat(this.params.swarmName, " clientId=").concat(this.params.clientId, " getAgentName"));
|
|
2278
2365
|
if (!(this._activeAgent === AGENT_NEED_FETCH)) return [3 /*break*/, 2];
|
|
2279
2366
|
_a = this;
|
|
2280
2367
|
return [4 /*yield*/, GLOBAL_CONFIG.CC_SWARM_DEFAULT_AGENT(this.params.clientId, this.params.swarmName, this.params.defaultAgent)];
|
|
@@ -2308,7 +2395,8 @@ var ClientSwarm = /** @class */ (function () {
|
|
|
2308
2395
|
return __generator(this, function (_a) {
|
|
2309
2396
|
switch (_a.label) {
|
|
2310
2397
|
case 0:
|
|
2311
|
-
|
|
2398
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_DEBUG &&
|
|
2399
|
+
this.params.logger.debug("ClientSwarm swarmName=".concat(this.params.swarmName, " clientId=").concat(this.params.clientId, " getAgent"));
|
|
2312
2400
|
return [4 /*yield*/, this.getAgentName()];
|
|
2313
2401
|
case 1:
|
|
2314
2402
|
agent = _a.sent();
|
|
@@ -2341,7 +2429,8 @@ var ClientSwarm = /** @class */ (function () {
|
|
|
2341
2429
|
return __generator(this, function (_a) {
|
|
2342
2430
|
switch (_a.label) {
|
|
2343
2431
|
case 0:
|
|
2344
|
-
|
|
2432
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_DEBUG &&
|
|
2433
|
+
this.params.logger.debug("ClientSwarm swarmName=".concat(this.params.swarmName, " clientId=").concat(this.params.clientId, " setAgentRef agentName=").concat(agentName));
|
|
2345
2434
|
if (!this.params.agentMap[agentName]) {
|
|
2346
2435
|
throw new Error("agent-swarm agent ".concat(agentName, " not in the swarm"));
|
|
2347
2436
|
}
|
|
@@ -2376,7 +2465,8 @@ var ClientSwarm = /** @class */ (function () {
|
|
|
2376
2465
|
return __generator(this, function (_a) {
|
|
2377
2466
|
switch (_a.label) {
|
|
2378
2467
|
case 0:
|
|
2379
|
-
|
|
2468
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_DEBUG &&
|
|
2469
|
+
this.params.logger.debug("ClientSwarm swarmName=".concat(this.params.swarmName, " clientId=").concat(this.params.clientId, " setAgentName agentName=").concat(agentName));
|
|
2380
2470
|
this._activeAgent = agentName;
|
|
2381
2471
|
return [4 /*yield*/, this.params.onAgentChanged(this.params.clientId, agentName, this.params.swarmName)];
|
|
2382
2472
|
case 1:
|
|
@@ -2399,9 +2489,10 @@ var ClientSwarm = /** @class */ (function () {
|
|
|
2399
2489
|
}
|
|
2400
2490
|
});
|
|
2401
2491
|
}); };
|
|
2402
|
-
|
|
2403
|
-
params
|
|
2404
|
-
|
|
2492
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_DEBUG &&
|
|
2493
|
+
this.params.logger.debug("ClientSwarm swarmName=".concat(this.params.swarmName, " clientId=").concat(this.params.clientId, " CTOR"), {
|
|
2494
|
+
params: params,
|
|
2495
|
+
});
|
|
2405
2496
|
}
|
|
2406
2497
|
Object.defineProperty(ClientSwarm.prototype, "_agentList", {
|
|
2407
2498
|
get: function () {
|
|
@@ -2485,7 +2576,8 @@ var SwarmConnectionService = /** @class */ (function () {
|
|
|
2485
2576
|
return __generator(this, function (_a) {
|
|
2486
2577
|
switch (_a.label) {
|
|
2487
2578
|
case 0:
|
|
2488
|
-
|
|
2579
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
2580
|
+
this.loggerService.info("swarmConnectionService cancelOutput");
|
|
2489
2581
|
return [4 /*yield*/, this.getSwarm(this.methodContextService.context.clientId, this.methodContextService.context.swarmName).cancelOutput()];
|
|
2490
2582
|
case 1: return [2 /*return*/, _a.sent()];
|
|
2491
2583
|
}
|
|
@@ -2499,7 +2591,8 @@ var SwarmConnectionService = /** @class */ (function () {
|
|
|
2499
2591
|
return __generator(this, function (_a) {
|
|
2500
2592
|
switch (_a.label) {
|
|
2501
2593
|
case 0:
|
|
2502
|
-
|
|
2594
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
2595
|
+
this.loggerService.info("swarmConnectionService waitForOutput");
|
|
2503
2596
|
return [4 /*yield*/, this.getSwarm(this.methodContextService.context.clientId, this.methodContextService.context.swarmName).waitForOutput()];
|
|
2504
2597
|
case 1: return [2 /*return*/, _a.sent()];
|
|
2505
2598
|
}
|
|
@@ -2513,7 +2606,8 @@ var SwarmConnectionService = /** @class */ (function () {
|
|
|
2513
2606
|
return __generator(this, function (_a) {
|
|
2514
2607
|
switch (_a.label) {
|
|
2515
2608
|
case 0:
|
|
2516
|
-
|
|
2609
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
2610
|
+
this.loggerService.info("swarmConnectionService getAgentName");
|
|
2517
2611
|
return [4 /*yield*/, this.getSwarm(this.methodContextService.context.clientId, this.methodContextService.context.swarmName).getAgentName()];
|
|
2518
2612
|
case 1: return [2 /*return*/, _a.sent()];
|
|
2519
2613
|
}
|
|
@@ -2527,7 +2621,8 @@ var SwarmConnectionService = /** @class */ (function () {
|
|
|
2527
2621
|
return __generator(this, function (_a) {
|
|
2528
2622
|
switch (_a.label) {
|
|
2529
2623
|
case 0:
|
|
2530
|
-
|
|
2624
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
2625
|
+
this.loggerService.info("swarmConnectionService getAgent");
|
|
2531
2626
|
return [4 /*yield*/, this.getSwarm(this.methodContextService.context.clientId, this.methodContextService.context.swarmName).getAgent()];
|
|
2532
2627
|
case 1: return [2 /*return*/, _a.sent()];
|
|
2533
2628
|
}
|
|
@@ -2543,9 +2638,10 @@ var SwarmConnectionService = /** @class */ (function () {
|
|
|
2543
2638
|
return __generator(this, function (_a) {
|
|
2544
2639
|
switch (_a.label) {
|
|
2545
2640
|
case 0:
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2641
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
2642
|
+
this.loggerService.info("swarmConnectionService setAgentRef", {
|
|
2643
|
+
agentName: agentName,
|
|
2644
|
+
});
|
|
2549
2645
|
return [4 /*yield*/, this.getSwarm(this.methodContextService.context.clientId, this.methodContextService.context.swarmName).setAgentRef(agentName, agent)];
|
|
2550
2646
|
case 1: return [2 /*return*/, _a.sent()];
|
|
2551
2647
|
}
|
|
@@ -2560,9 +2656,10 @@ var SwarmConnectionService = /** @class */ (function () {
|
|
|
2560
2656
|
return __generator(this, function (_a) {
|
|
2561
2657
|
switch (_a.label) {
|
|
2562
2658
|
case 0:
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2659
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
2660
|
+
this.loggerService.info("swarmConnectionService setAgentName", {
|
|
2661
|
+
agentName: agentName,
|
|
2662
|
+
});
|
|
2566
2663
|
return [4 /*yield*/, this.getSwarm(this.methodContextService.context.clientId, this.methodContextService.context.swarmName).setAgentName(agentName)];
|
|
2567
2664
|
case 1: return [2 /*return*/, _a.sent()];
|
|
2568
2665
|
}
|
|
@@ -2575,7 +2672,8 @@ var SwarmConnectionService = /** @class */ (function () {
|
|
|
2575
2672
|
this.dispose = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
2576
2673
|
var key;
|
|
2577
2674
|
return __generator(this, function (_a) {
|
|
2578
|
-
|
|
2675
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
2676
|
+
this.loggerService.info("swarmConnectionService dispose");
|
|
2579
2677
|
key = "".concat(this.methodContextService.context.clientId, "-").concat(this.methodContextService.context.swarmName);
|
|
2580
2678
|
if (!this.getSwarm.has(key)) {
|
|
2581
2679
|
return [2 /*return*/];
|
|
@@ -2602,7 +2700,8 @@ var SwarmSchemaService = /** @class */ (function () {
|
|
|
2602
2700
|
* @param {ISwarmSchema} value - The schema of the swarm.
|
|
2603
2701
|
*/
|
|
2604
2702
|
this.register = function (key, value) {
|
|
2605
|
-
|
|
2703
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
2704
|
+
_this.loggerService.info("swarmSchemaService register", { key: key });
|
|
2606
2705
|
_this.registry = _this.registry.register(key, value);
|
|
2607
2706
|
};
|
|
2608
2707
|
/**
|
|
@@ -2611,7 +2710,8 @@ var SwarmSchemaService = /** @class */ (function () {
|
|
|
2611
2710
|
* @returns {ISwarmSchema} The schema of the swarm.
|
|
2612
2711
|
*/
|
|
2613
2712
|
this.get = function (key) {
|
|
2614
|
-
|
|
2713
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
2714
|
+
_this.loggerService.info("swarmSchemaService get", { key: key });
|
|
2615
2715
|
return _this.registry.get(key);
|
|
2616
2716
|
};
|
|
2617
2717
|
}
|
|
@@ -2632,7 +2732,8 @@ var CompletionSchemaService = /** @class */ (function () {
|
|
|
2632
2732
|
* @param {ICompletionSchema} value - The schema to register.
|
|
2633
2733
|
*/
|
|
2634
2734
|
this.register = function (key, value) {
|
|
2635
|
-
|
|
2735
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
2736
|
+
_this.loggerService.info("completionSchemaService register", { key: key });
|
|
2636
2737
|
_this.registry = _this.registry.register(key, value);
|
|
2637
2738
|
};
|
|
2638
2739
|
/**
|
|
@@ -2641,7 +2742,8 @@ var CompletionSchemaService = /** @class */ (function () {
|
|
|
2641
2742
|
* @returns {ICompletionSchema} The retrieved schema.
|
|
2642
2743
|
*/
|
|
2643
2744
|
this.get = function (key) {
|
|
2644
|
-
|
|
2745
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
2746
|
+
_this.loggerService.info("completionSchemaService get", { key: key });
|
|
2645
2747
|
return _this.registry.get(key);
|
|
2646
2748
|
};
|
|
2647
2749
|
}
|
|
@@ -2669,9 +2771,10 @@ var ClientSession = /** @class */ (function () {
|
|
|
2669
2771
|
return __generator(this, function (_a) {
|
|
2670
2772
|
switch (_a.label) {
|
|
2671
2773
|
case 0:
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
|
|
2774
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_DEBUG &&
|
|
2775
|
+
this.params.logger.debug("ClientSession clientId=".concat(this.params.clientId, " emit"), {
|
|
2776
|
+
message: message,
|
|
2777
|
+
});
|
|
2675
2778
|
this.params.onEmit &&
|
|
2676
2779
|
this.params.onEmit(this.params.clientId, this.params.swarmName, message);
|
|
2677
2780
|
return [4 /*yield*/, this._emitSubject.next(message)];
|
|
@@ -2681,7 +2784,7 @@ var ClientSession = /** @class */ (function () {
|
|
|
2681
2784
|
type: "emit",
|
|
2682
2785
|
source: "session-bus",
|
|
2683
2786
|
input: {
|
|
2684
|
-
message: message
|
|
2787
|
+
message: message,
|
|
2685
2788
|
},
|
|
2686
2789
|
output: {},
|
|
2687
2790
|
context: {
|
|
@@ -2706,10 +2809,11 @@ var ClientSession = /** @class */ (function () {
|
|
|
2706
2809
|
return __generator(this, function (_a) {
|
|
2707
2810
|
switch (_a.label) {
|
|
2708
2811
|
case 0:
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
|
|
2812
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_DEBUG &&
|
|
2813
|
+
this.params.logger.debug("ClientSession clientId=".concat(this.params.clientId, " execute"), {
|
|
2814
|
+
message: message,
|
|
2815
|
+
mode: mode,
|
|
2816
|
+
});
|
|
2713
2817
|
this.params.onExecute &&
|
|
2714
2818
|
this.params.onExecute(this.params.clientId, this.params.swarmName, message, mode);
|
|
2715
2819
|
return [4 /*yield*/, this.params.swarm.getAgent()];
|
|
@@ -2752,10 +2856,11 @@ var ClientSession = /** @class */ (function () {
|
|
|
2752
2856
|
return __generator(this, function (_a) {
|
|
2753
2857
|
switch (_a.label) {
|
|
2754
2858
|
case 0:
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2859
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_DEBUG &&
|
|
2860
|
+
this.params.logger.debug("ClientSession clientId=".concat(this.params.clientId, " commitToolOutput"), {
|
|
2861
|
+
content: content,
|
|
2862
|
+
toolId: toolId,
|
|
2863
|
+
});
|
|
2759
2864
|
return [4 /*yield*/, this.params.swarm.getAgent()];
|
|
2760
2865
|
case 1:
|
|
2761
2866
|
agent = _a.sent();
|
|
@@ -2791,9 +2896,10 @@ var ClientSession = /** @class */ (function () {
|
|
|
2791
2896
|
return __generator(this, function (_a) {
|
|
2792
2897
|
switch (_a.label) {
|
|
2793
2898
|
case 0:
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
|
|
2899
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_DEBUG &&
|
|
2900
|
+
this.params.logger.debug("ClientSession clientId=".concat(this.params.clientId, " commitUserMessage"), {
|
|
2901
|
+
message: message,
|
|
2902
|
+
});
|
|
2797
2903
|
return [4 /*yield*/, this.params.swarm.getAgent()];
|
|
2798
2904
|
case 1:
|
|
2799
2905
|
agent = _a.sent();
|
|
@@ -2827,7 +2933,8 @@ var ClientSession = /** @class */ (function () {
|
|
|
2827
2933
|
return __generator(this, function (_a) {
|
|
2828
2934
|
switch (_a.label) {
|
|
2829
2935
|
case 0:
|
|
2830
|
-
|
|
2936
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_DEBUG &&
|
|
2937
|
+
this.params.logger.debug("ClientSession clientId=".concat(this.params.clientId, " commitFlush"));
|
|
2831
2938
|
return [4 /*yield*/, this.params.swarm.getAgent()];
|
|
2832
2939
|
case 1:
|
|
2833
2940
|
agent = _a.sent();
|
|
@@ -2860,9 +2967,10 @@ var ClientSession = /** @class */ (function () {
|
|
|
2860
2967
|
return __generator(this, function (_a) {
|
|
2861
2968
|
switch (_a.label) {
|
|
2862
2969
|
case 0:
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2970
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_DEBUG &&
|
|
2971
|
+
this.params.logger.debug("ClientSession clientId=".concat(this.params.clientId, " commitSystemMessage"), {
|
|
2972
|
+
message: message,
|
|
2973
|
+
});
|
|
2866
2974
|
return [4 /*yield*/, this.params.swarm.getAgent()];
|
|
2867
2975
|
case 1:
|
|
2868
2976
|
agent = _a.sent();
|
|
@@ -2873,7 +2981,7 @@ var ClientSession = /** @class */ (function () {
|
|
|
2873
2981
|
type: "commit-system-message",
|
|
2874
2982
|
source: "session-bus",
|
|
2875
2983
|
input: {
|
|
2876
|
-
message: message
|
|
2984
|
+
message: message,
|
|
2877
2985
|
},
|
|
2878
2986
|
output: {},
|
|
2879
2987
|
context: {
|
|
@@ -2893,7 +3001,8 @@ var ClientSession = /** @class */ (function () {
|
|
|
2893
3001
|
* @returns {ReceiveMessageFn} - The function to receive messages.
|
|
2894
3002
|
*/
|
|
2895
3003
|
this.connect = function (connector) {
|
|
2896
|
-
|
|
3004
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_DEBUG &&
|
|
3005
|
+
_this.params.logger.debug("ClientSession clientId=".concat(_this.params.clientId, " connect"));
|
|
2897
3006
|
_this.params.onConnect &&
|
|
2898
3007
|
_this.params.onConnect(_this.params.clientId, _this.params.swarmName);
|
|
2899
3008
|
_this._emitSubject.subscribe(function (data) { return __awaiter(_this, void 0, void 0, function () {
|
|
@@ -2930,7 +3039,8 @@ var ClientSession = /** @class */ (function () {
|
|
|
2930
3039
|
return __generator(this, function (_c) {
|
|
2931
3040
|
switch (_c.label) {
|
|
2932
3041
|
case 0:
|
|
2933
|
-
|
|
3042
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_DEBUG &&
|
|
3043
|
+
this.params.logger.debug("ClientSession clientId=".concat(this.params.clientId, " connect call"));
|
|
2934
3044
|
return [4 /*yield*/, this.execute(incoming.data, "user")];
|
|
2935
3045
|
case 1:
|
|
2936
3046
|
data = _c.sent();
|
|
@@ -2958,15 +3068,17 @@ var ClientSession = /** @class */ (function () {
|
|
|
2958
3068
|
*/
|
|
2959
3069
|
this.dispose = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
2960
3070
|
return __generator(this, function (_a) {
|
|
2961
|
-
|
|
3071
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_DEBUG &&
|
|
3072
|
+
this.params.logger.debug("ClientSession clientId=".concat(this.params.clientId, " dispose"));
|
|
2962
3073
|
this.params.onDispose &&
|
|
2963
3074
|
this.params.onDispose(this.params.clientId, this.params.swarmName);
|
|
2964
3075
|
return [2 /*return*/];
|
|
2965
3076
|
});
|
|
2966
3077
|
}); };
|
|
2967
|
-
|
|
2968
|
-
params
|
|
2969
|
-
|
|
3078
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_DEBUG &&
|
|
3079
|
+
this.params.logger.debug("ClientSession clientId=".concat(this.params.clientId, " CTOR"), {
|
|
3080
|
+
params: params,
|
|
3081
|
+
});
|
|
2970
3082
|
this.params.onInit && this.params.onInit(params.clientId, params.swarmName);
|
|
2971
3083
|
}
|
|
2972
3084
|
return ClientSession;
|
|
@@ -3006,9 +3118,10 @@ var SessionConnectionService = /** @class */ (function () {
|
|
|
3006
3118
|
return __generator(this, function (_a) {
|
|
3007
3119
|
switch (_a.label) {
|
|
3008
3120
|
case 0:
|
|
3009
|
-
|
|
3010
|
-
|
|
3011
|
-
|
|
3121
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
3122
|
+
this.loggerService.info("sessionConnectionService emit", {
|
|
3123
|
+
content: content,
|
|
3124
|
+
});
|
|
3012
3125
|
return [4 /*yield*/, this.getSession(this.methodContextService.context.clientId, this.methodContextService.context.swarmName).emit(content)];
|
|
3013
3126
|
case 1: return [2 /*return*/, _a.sent()];
|
|
3014
3127
|
}
|
|
@@ -3023,10 +3136,11 @@ var SessionConnectionService = /** @class */ (function () {
|
|
|
3023
3136
|
return __generator(this, function (_a) {
|
|
3024
3137
|
switch (_a.label) {
|
|
3025
3138
|
case 0:
|
|
3026
|
-
|
|
3027
|
-
|
|
3028
|
-
|
|
3029
|
-
|
|
3139
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
3140
|
+
this.loggerService.info("sessionConnectionService execute", {
|
|
3141
|
+
content: content,
|
|
3142
|
+
mode: mode,
|
|
3143
|
+
});
|
|
3030
3144
|
return [4 /*yield*/, this.getSession(this.methodContextService.context.clientId, this.methodContextService.context.swarmName).execute(content, mode)];
|
|
3031
3145
|
case 1: return [2 /*return*/, _a.sent()];
|
|
3032
3146
|
}
|
|
@@ -3038,7 +3152,8 @@ var SessionConnectionService = /** @class */ (function () {
|
|
|
3038
3152
|
* @returns {ReceiveMessageFn} The function to receive messages.
|
|
3039
3153
|
*/
|
|
3040
3154
|
this.connect = function (connector, clientId, swarmName) {
|
|
3041
|
-
|
|
3155
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
3156
|
+
_this.loggerService.info("sessionConnectionService connect");
|
|
3042
3157
|
return _this.getSession(clientId, swarmName).connect(connector);
|
|
3043
3158
|
};
|
|
3044
3159
|
/**
|
|
@@ -3051,10 +3166,11 @@ var SessionConnectionService = /** @class */ (function () {
|
|
|
3051
3166
|
return __generator(this, function (_a) {
|
|
3052
3167
|
switch (_a.label) {
|
|
3053
3168
|
case 0:
|
|
3054
|
-
|
|
3055
|
-
|
|
3056
|
-
|
|
3057
|
-
|
|
3169
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
3170
|
+
this.loggerService.info("sessionConnectionService commitToolOutput", {
|
|
3171
|
+
content: content,
|
|
3172
|
+
toolId: toolId,
|
|
3173
|
+
});
|
|
3058
3174
|
return [4 /*yield*/, this.getSession(this.methodContextService.context.clientId, this.methodContextService.context.swarmName).commitToolOutput(toolId, content)];
|
|
3059
3175
|
case 1: return [2 /*return*/, _a.sent()];
|
|
3060
3176
|
}
|
|
@@ -3069,9 +3185,10 @@ var SessionConnectionService = /** @class */ (function () {
|
|
|
3069
3185
|
return __generator(this, function (_a) {
|
|
3070
3186
|
switch (_a.label) {
|
|
3071
3187
|
case 0:
|
|
3072
|
-
|
|
3073
|
-
|
|
3074
|
-
|
|
3188
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
3189
|
+
this.loggerService.info("sessionConnectionService commitSystemMessage", {
|
|
3190
|
+
message: message,
|
|
3191
|
+
});
|
|
3075
3192
|
return [4 /*yield*/, this.getSession(this.methodContextService.context.clientId, this.methodContextService.context.swarmName).commitSystemMessage(message)];
|
|
3076
3193
|
case 1: return [2 /*return*/, _a.sent()];
|
|
3077
3194
|
}
|
|
@@ -3086,9 +3203,10 @@ var SessionConnectionService = /** @class */ (function () {
|
|
|
3086
3203
|
return __generator(this, function (_a) {
|
|
3087
3204
|
switch (_a.label) {
|
|
3088
3205
|
case 0:
|
|
3089
|
-
|
|
3090
|
-
|
|
3091
|
-
|
|
3206
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
3207
|
+
this.loggerService.info("sessionConnectionService commitUserMessage", {
|
|
3208
|
+
message: message,
|
|
3209
|
+
});
|
|
3092
3210
|
return [4 /*yield*/, this.getSession(this.methodContextService.context.clientId, this.methodContextService.context.swarmName).commitUserMessage(message)];
|
|
3093
3211
|
case 1: return [2 /*return*/, _a.sent()];
|
|
3094
3212
|
}
|
|
@@ -3103,7 +3221,8 @@ var SessionConnectionService = /** @class */ (function () {
|
|
|
3103
3221
|
return __generator(this, function (_a) {
|
|
3104
3222
|
switch (_a.label) {
|
|
3105
3223
|
case 0:
|
|
3106
|
-
|
|
3224
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
3225
|
+
this.loggerService.info("sessionConnectionService commitFlush");
|
|
3107
3226
|
return [4 /*yield*/, this.getSession(this.methodContextService.context.clientId, this.methodContextService.context.swarmName).commitFlush()];
|
|
3108
3227
|
case 1: return [2 /*return*/, _a.sent()];
|
|
3109
3228
|
}
|
|
@@ -3118,7 +3237,8 @@ var SessionConnectionService = /** @class */ (function () {
|
|
|
3118
3237
|
return __generator(this, function (_a) {
|
|
3119
3238
|
switch (_a.label) {
|
|
3120
3239
|
case 0:
|
|
3121
|
-
|
|
3240
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
3241
|
+
this.loggerService.info("sessionConnectionService dispose");
|
|
3122
3242
|
key = "".concat(this.methodContextService.context.clientId, "-").concat(this.methodContextService.context.swarmName);
|
|
3123
3243
|
if (!this.getSession.has(key)) {
|
|
3124
3244
|
return [2 /*return*/];
|
|
@@ -3154,11 +3274,12 @@ var AgentPublicService = /** @class */ (function () {
|
|
|
3154
3274
|
return __generator(this, function (_a) {
|
|
3155
3275
|
switch (_a.label) {
|
|
3156
3276
|
case 0:
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
|
|
3161
|
-
|
|
3277
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
3278
|
+
this.loggerService.info("agentPublicService createAgentRef", {
|
|
3279
|
+
methodName: methodName,
|
|
3280
|
+
clientId: clientId,
|
|
3281
|
+
agentName: agentName,
|
|
3282
|
+
});
|
|
3162
3283
|
return [4 /*yield*/, MethodContextService.runInContext(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
3163
3284
|
return __generator(this, function (_a) {
|
|
3164
3285
|
switch (_a.label) {
|
|
@@ -3190,13 +3311,14 @@ var AgentPublicService = /** @class */ (function () {
|
|
|
3190
3311
|
return __generator(this, function (_a) {
|
|
3191
3312
|
switch (_a.label) {
|
|
3192
3313
|
case 0:
|
|
3193
|
-
|
|
3194
|
-
|
|
3195
|
-
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
|
-
|
|
3199
|
-
|
|
3314
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
3315
|
+
this.loggerService.info("agentPublicService execute", {
|
|
3316
|
+
methodName: methodName,
|
|
3317
|
+
input: input,
|
|
3318
|
+
clientId: clientId,
|
|
3319
|
+
agentName: agentName,
|
|
3320
|
+
mode: mode,
|
|
3321
|
+
});
|
|
3200
3322
|
return [4 /*yield*/, MethodContextService.runInContext(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
3201
3323
|
return __generator(this, function (_a) {
|
|
3202
3324
|
switch (_a.label) {
|
|
@@ -3227,11 +3349,12 @@ var AgentPublicService = /** @class */ (function () {
|
|
|
3227
3349
|
return __generator(this, function (_a) {
|
|
3228
3350
|
switch (_a.label) {
|
|
3229
3351
|
case 0:
|
|
3230
|
-
|
|
3231
|
-
|
|
3232
|
-
|
|
3233
|
-
|
|
3234
|
-
|
|
3352
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
3353
|
+
this.loggerService.info("agentPublicService waitForOutput", {
|
|
3354
|
+
methodName: methodName,
|
|
3355
|
+
clientId: clientId,
|
|
3356
|
+
agentName: agentName,
|
|
3357
|
+
});
|
|
3235
3358
|
return [4 /*yield*/, MethodContextService.runInContext(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
3236
3359
|
return __generator(this, function (_a) {
|
|
3237
3360
|
switch (_a.label) {
|
|
@@ -3264,13 +3387,14 @@ var AgentPublicService = /** @class */ (function () {
|
|
|
3264
3387
|
return __generator(this, function (_a) {
|
|
3265
3388
|
switch (_a.label) {
|
|
3266
3389
|
case 0:
|
|
3267
|
-
|
|
3268
|
-
|
|
3269
|
-
|
|
3270
|
-
|
|
3271
|
-
|
|
3272
|
-
|
|
3273
|
-
|
|
3390
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
3391
|
+
this.loggerService.info("agentPublicService commitToolOutput", {
|
|
3392
|
+
methodName: methodName,
|
|
3393
|
+
content: content,
|
|
3394
|
+
clientId: clientId,
|
|
3395
|
+
toolId: toolId,
|
|
3396
|
+
agentName: agentName,
|
|
3397
|
+
});
|
|
3274
3398
|
return [4 /*yield*/, MethodContextService.runInContext(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
3275
3399
|
return __generator(this, function (_a) {
|
|
3276
3400
|
switch (_a.label) {
|
|
@@ -3302,12 +3426,13 @@ var AgentPublicService = /** @class */ (function () {
|
|
|
3302
3426
|
return __generator(this, function (_a) {
|
|
3303
3427
|
switch (_a.label) {
|
|
3304
3428
|
case 0:
|
|
3305
|
-
|
|
3306
|
-
|
|
3307
|
-
|
|
3308
|
-
|
|
3309
|
-
|
|
3310
|
-
|
|
3429
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
3430
|
+
this.loggerService.info("agentPublicService commitSystemMessage", {
|
|
3431
|
+
methodName: methodName,
|
|
3432
|
+
message: message,
|
|
3433
|
+
clientId: clientId,
|
|
3434
|
+
agentName: agentName,
|
|
3435
|
+
});
|
|
3311
3436
|
return [4 /*yield*/, MethodContextService.runInContext(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
3312
3437
|
return __generator(this, function (_a) {
|
|
3313
3438
|
switch (_a.label) {
|
|
@@ -3339,12 +3464,13 @@ var AgentPublicService = /** @class */ (function () {
|
|
|
3339
3464
|
return __generator(this, function (_a) {
|
|
3340
3465
|
switch (_a.label) {
|
|
3341
3466
|
case 0:
|
|
3342
|
-
|
|
3343
|
-
|
|
3344
|
-
|
|
3345
|
-
|
|
3346
|
-
|
|
3347
|
-
|
|
3467
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
3468
|
+
this.loggerService.info("agentPublicService commitUserMessage", {
|
|
3469
|
+
methodName: methodName,
|
|
3470
|
+
message: message,
|
|
3471
|
+
clientId: clientId,
|
|
3472
|
+
agentName: agentName,
|
|
3473
|
+
});
|
|
3348
3474
|
return [4 /*yield*/, MethodContextService.runInContext(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
3349
3475
|
return __generator(this, function (_a) {
|
|
3350
3476
|
switch (_a.label) {
|
|
@@ -3375,11 +3501,12 @@ var AgentPublicService = /** @class */ (function () {
|
|
|
3375
3501
|
return __generator(this, function (_a) {
|
|
3376
3502
|
switch (_a.label) {
|
|
3377
3503
|
case 0:
|
|
3378
|
-
|
|
3379
|
-
|
|
3380
|
-
|
|
3381
|
-
|
|
3382
|
-
|
|
3504
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
3505
|
+
this.loggerService.info("agentPublicService commitFlush", {
|
|
3506
|
+
methodName: methodName,
|
|
3507
|
+
clientId: clientId,
|
|
3508
|
+
agentName: agentName,
|
|
3509
|
+
});
|
|
3383
3510
|
return [4 /*yield*/, MethodContextService.runInContext(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
3384
3511
|
return __generator(this, function (_a) {
|
|
3385
3512
|
switch (_a.label) {
|
|
@@ -3410,11 +3537,12 @@ var AgentPublicService = /** @class */ (function () {
|
|
|
3410
3537
|
return __generator(this, function (_a) {
|
|
3411
3538
|
switch (_a.label) {
|
|
3412
3539
|
case 0:
|
|
3413
|
-
|
|
3414
|
-
|
|
3415
|
-
|
|
3416
|
-
|
|
3417
|
-
|
|
3540
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
3541
|
+
this.loggerService.info("agentPublicService commitAgentChange", {
|
|
3542
|
+
methodName: methodName,
|
|
3543
|
+
clientId: clientId,
|
|
3544
|
+
agentName: agentName,
|
|
3545
|
+
});
|
|
3418
3546
|
return [4 /*yield*/, MethodContextService.runInContext(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
3419
3547
|
return __generator(this, function (_a) {
|
|
3420
3548
|
switch (_a.label) {
|
|
@@ -3445,11 +3573,12 @@ var AgentPublicService = /** @class */ (function () {
|
|
|
3445
3573
|
return __generator(this, function (_a) {
|
|
3446
3574
|
switch (_a.label) {
|
|
3447
3575
|
case 0:
|
|
3448
|
-
|
|
3449
|
-
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
|
|
3576
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
3577
|
+
this.loggerService.info("agentPublicService dispose", {
|
|
3578
|
+
methodName: methodName,
|
|
3579
|
+
clientId: clientId,
|
|
3580
|
+
agentName: agentName,
|
|
3581
|
+
});
|
|
3453
3582
|
return [4 /*yield*/, MethodContextService.runInContext(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
3454
3583
|
return __generator(this, function (_a) {
|
|
3455
3584
|
switch (_a.label) {
|
|
@@ -3493,12 +3622,13 @@ var HistoryPublicService = /** @class */ (function () {
|
|
|
3493
3622
|
return __generator(this, function (_a) {
|
|
3494
3623
|
switch (_a.label) {
|
|
3495
3624
|
case 0:
|
|
3496
|
-
|
|
3497
|
-
|
|
3498
|
-
|
|
3499
|
-
|
|
3500
|
-
|
|
3501
|
-
|
|
3625
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
3626
|
+
this.loggerService.info("historyPublicService push", {
|
|
3627
|
+
methodName: methodName,
|
|
3628
|
+
message: message,
|
|
3629
|
+
clientId: clientId,
|
|
3630
|
+
agentName: agentName,
|
|
3631
|
+
});
|
|
3502
3632
|
return [4 /*yield*/, MethodContextService.runInContext(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
3503
3633
|
return __generator(this, function (_a) {
|
|
3504
3634
|
switch (_a.label) {
|
|
@@ -3530,11 +3660,12 @@ var HistoryPublicService = /** @class */ (function () {
|
|
|
3530
3660
|
return __generator(this, function (_a) {
|
|
3531
3661
|
switch (_a.label) {
|
|
3532
3662
|
case 0:
|
|
3533
|
-
|
|
3534
|
-
|
|
3535
|
-
|
|
3536
|
-
|
|
3537
|
-
|
|
3663
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
3664
|
+
this.loggerService.info("historyPublicService toArrayForAgent", {
|
|
3665
|
+
prompt: prompt,
|
|
3666
|
+
clientId: clientId,
|
|
3667
|
+
agentName: agentName,
|
|
3668
|
+
});
|
|
3538
3669
|
return [4 /*yield*/, MethodContextService.runInContext(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
3539
3670
|
return __generator(this, function (_a) {
|
|
3540
3671
|
switch (_a.label) {
|
|
@@ -3565,11 +3696,12 @@ var HistoryPublicService = /** @class */ (function () {
|
|
|
3565
3696
|
return __generator(this, function (_a) {
|
|
3566
3697
|
switch (_a.label) {
|
|
3567
3698
|
case 0:
|
|
3568
|
-
|
|
3569
|
-
|
|
3570
|
-
|
|
3571
|
-
|
|
3572
|
-
|
|
3699
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
3700
|
+
this.loggerService.info("historyPublicService toArrayForRaw", {
|
|
3701
|
+
methodName: methodName,
|
|
3702
|
+
clientId: clientId,
|
|
3703
|
+
agentName: agentName,
|
|
3704
|
+
});
|
|
3573
3705
|
return [4 /*yield*/, MethodContextService.runInContext(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
3574
3706
|
return __generator(this, function (_a) {
|
|
3575
3707
|
switch (_a.label) {
|
|
@@ -3600,10 +3732,11 @@ var HistoryPublicService = /** @class */ (function () {
|
|
|
3600
3732
|
return __generator(this, function (_a) {
|
|
3601
3733
|
switch (_a.label) {
|
|
3602
3734
|
case 0:
|
|
3603
|
-
|
|
3604
|
-
|
|
3605
|
-
|
|
3606
|
-
|
|
3735
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
3736
|
+
this.loggerService.info("historyPublicService dispose", {
|
|
3737
|
+
clientId: clientId,
|
|
3738
|
+
agentName: agentName,
|
|
3739
|
+
});
|
|
3607
3740
|
return [4 /*yield*/, MethodContextService.runInContext(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
3608
3741
|
return __generator(this, function (_a) {
|
|
3609
3742
|
switch (_a.label) {
|
|
@@ -3647,12 +3780,13 @@ var SessionPublicService = /** @class */ (function () {
|
|
|
3647
3780
|
return __generator(this, function (_a) {
|
|
3648
3781
|
switch (_a.label) {
|
|
3649
3782
|
case 0:
|
|
3650
|
-
|
|
3651
|
-
|
|
3652
|
-
|
|
3653
|
-
|
|
3654
|
-
|
|
3655
|
-
|
|
3783
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
3784
|
+
this.loggerService.info("sessionPublicService emit", {
|
|
3785
|
+
content: content,
|
|
3786
|
+
clientId: clientId,
|
|
3787
|
+
methodName: methodName,
|
|
3788
|
+
swarmName: swarmName,
|
|
3789
|
+
});
|
|
3656
3790
|
return [4 /*yield*/, MethodContextService.runInContext(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
3657
3791
|
return __generator(this, function (_a) {
|
|
3658
3792
|
switch (_a.label) {
|
|
@@ -3684,12 +3818,13 @@ var SessionPublicService = /** @class */ (function () {
|
|
|
3684
3818
|
return __generator(this, function (_a) {
|
|
3685
3819
|
switch (_a.label) {
|
|
3686
3820
|
case 0:
|
|
3687
|
-
|
|
3688
|
-
|
|
3689
|
-
|
|
3690
|
-
|
|
3691
|
-
|
|
3692
|
-
|
|
3821
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
3822
|
+
this.loggerService.info("sessionPublicService execute", {
|
|
3823
|
+
content: content,
|
|
3824
|
+
mode: mode,
|
|
3825
|
+
clientId: clientId,
|
|
3826
|
+
swarmName: swarmName,
|
|
3827
|
+
});
|
|
3693
3828
|
return [4 /*yield*/, MethodContextService.runInContext(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
3694
3829
|
return __generator(this, function (_a) {
|
|
3695
3830
|
switch (_a.label) {
|
|
@@ -3717,11 +3852,12 @@ var SessionPublicService = /** @class */ (function () {
|
|
|
3717
3852
|
* @returns {ReceiveMessageFn}
|
|
3718
3853
|
*/
|
|
3719
3854
|
this.connect = function (connector, methodName, clientId, swarmName) {
|
|
3720
|
-
|
|
3721
|
-
|
|
3722
|
-
|
|
3723
|
-
|
|
3724
|
-
|
|
3855
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
3856
|
+
_this.loggerService.info("sessionPublicService connect", {
|
|
3857
|
+
methodName: methodName,
|
|
3858
|
+
clientId: clientId,
|
|
3859
|
+
swarmName: swarmName,
|
|
3860
|
+
});
|
|
3725
3861
|
var send = _this.sessionConnectionService.connect(connector, clientId, swarmName);
|
|
3726
3862
|
return function (incoming) { return __awaiter(_this, void 0, void 0, function () {
|
|
3727
3863
|
var executionId;
|
|
@@ -3732,12 +3868,13 @@ var SessionPublicService = /** @class */ (function () {
|
|
|
3732
3868
|
return __generator(this, function (_a) {
|
|
3733
3869
|
switch (_a.label) {
|
|
3734
3870
|
case 0:
|
|
3735
|
-
|
|
3736
|
-
|
|
3737
|
-
|
|
3738
|
-
|
|
3739
|
-
|
|
3740
|
-
|
|
3871
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
|
|
3872
|
+
this.loggerService.log("sessionPublicService connect execute", {
|
|
3873
|
+
content: incoming,
|
|
3874
|
+
methodName: methodName,
|
|
3875
|
+
clientId: clientId,
|
|
3876
|
+
executionId: executionId,
|
|
3877
|
+
});
|
|
3741
3878
|
return [4 /*yield*/, send(incoming)];
|
|
3742
3879
|
case 1: return [2 /*return*/, _a.sent()];
|
|
3743
3880
|
}
|
|
@@ -3762,13 +3899,14 @@ var SessionPublicService = /** @class */ (function () {
|
|
|
3762
3899
|
return __generator(this, function (_a) {
|
|
3763
3900
|
switch (_a.label) {
|
|
3764
3901
|
case 0:
|
|
3765
|
-
|
|
3766
|
-
|
|
3767
|
-
|
|
3768
|
-
|
|
3769
|
-
|
|
3770
|
-
|
|
3771
|
-
|
|
3902
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
3903
|
+
this.loggerService.info("sessionPublicService commitToolOutput", {
|
|
3904
|
+
methodName: methodName,
|
|
3905
|
+
toolId: toolId,
|
|
3906
|
+
content: content,
|
|
3907
|
+
clientId: clientId,
|
|
3908
|
+
swarmName: swarmName,
|
|
3909
|
+
});
|
|
3772
3910
|
return [4 /*yield*/, MethodContextService.runInContext(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
3773
3911
|
return __generator(this, function (_a) {
|
|
3774
3912
|
switch (_a.label) {
|
|
@@ -3800,12 +3938,13 @@ var SessionPublicService = /** @class */ (function () {
|
|
|
3800
3938
|
return __generator(this, function (_a) {
|
|
3801
3939
|
switch (_a.label) {
|
|
3802
3940
|
case 0:
|
|
3803
|
-
|
|
3804
|
-
|
|
3805
|
-
|
|
3806
|
-
|
|
3807
|
-
|
|
3808
|
-
|
|
3941
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
3942
|
+
this.loggerService.info("sessionPublicService commitSystemMessage", {
|
|
3943
|
+
methodName: methodName,
|
|
3944
|
+
message: message,
|
|
3945
|
+
clientId: clientId,
|
|
3946
|
+
swarmName: swarmName,
|
|
3947
|
+
});
|
|
3809
3948
|
return [4 /*yield*/, MethodContextService.runInContext(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
3810
3949
|
return __generator(this, function (_a) {
|
|
3811
3950
|
switch (_a.label) {
|
|
@@ -3837,12 +3976,13 @@ var SessionPublicService = /** @class */ (function () {
|
|
|
3837
3976
|
return __generator(this, function (_a) {
|
|
3838
3977
|
switch (_a.label) {
|
|
3839
3978
|
case 0:
|
|
3840
|
-
|
|
3841
|
-
|
|
3842
|
-
|
|
3843
|
-
|
|
3844
|
-
|
|
3845
|
-
|
|
3979
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
3980
|
+
this.loggerService.info("sessionPublicService commitUserMessage", {
|
|
3981
|
+
methodName: methodName,
|
|
3982
|
+
message: message,
|
|
3983
|
+
clientId: clientId,
|
|
3984
|
+
swarmName: swarmName,
|
|
3985
|
+
});
|
|
3846
3986
|
return [4 /*yield*/, MethodContextService.runInContext(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
3847
3987
|
return __generator(this, function (_a) {
|
|
3848
3988
|
switch (_a.label) {
|
|
@@ -3873,10 +4013,11 @@ var SessionPublicService = /** @class */ (function () {
|
|
|
3873
4013
|
return __generator(this, function (_a) {
|
|
3874
4014
|
switch (_a.label) {
|
|
3875
4015
|
case 0:
|
|
3876
|
-
|
|
3877
|
-
|
|
3878
|
-
|
|
3879
|
-
|
|
4016
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
4017
|
+
this.loggerService.info("sessionPublicService commitFlush", {
|
|
4018
|
+
clientId: clientId,
|
|
4019
|
+
swarmName: swarmName,
|
|
4020
|
+
});
|
|
3880
4021
|
return [4 /*yield*/, MethodContextService.runInContext(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
3881
4022
|
return __generator(this, function (_a) {
|
|
3882
4023
|
switch (_a.label) {
|
|
@@ -3907,11 +4048,12 @@ var SessionPublicService = /** @class */ (function () {
|
|
|
3907
4048
|
return __generator(this, function (_a) {
|
|
3908
4049
|
switch (_a.label) {
|
|
3909
4050
|
case 0:
|
|
3910
|
-
|
|
3911
|
-
|
|
3912
|
-
|
|
3913
|
-
|
|
3914
|
-
|
|
4051
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
4052
|
+
this.loggerService.info("sessionPublicService dispose", {
|
|
4053
|
+
methodName: methodName,
|
|
4054
|
+
clientId: clientId,
|
|
4055
|
+
swarmName: swarmName,
|
|
4056
|
+
});
|
|
3915
4057
|
return [4 /*yield*/, MethodContextService.runInContext(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
3916
4058
|
return __generator(this, function (_a) {
|
|
3917
4059
|
switch (_a.label) {
|
|
@@ -3954,10 +4096,11 @@ var SwarmPublicService = /** @class */ (function () {
|
|
|
3954
4096
|
return __generator(this, function (_a) {
|
|
3955
4097
|
switch (_a.label) {
|
|
3956
4098
|
case 0:
|
|
3957
|
-
|
|
3958
|
-
|
|
3959
|
-
|
|
3960
|
-
|
|
4099
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
4100
|
+
this.loggerService.info("swarmPublicService cancelOutput", {
|
|
4101
|
+
clientId: clientId,
|
|
4102
|
+
swarmName: swarmName,
|
|
4103
|
+
});
|
|
3961
4104
|
return [4 /*yield*/, MethodContextService.runInContext(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
3962
4105
|
return __generator(this, function (_a) {
|
|
3963
4106
|
switch (_a.label) {
|
|
@@ -3988,11 +4131,12 @@ var SwarmPublicService = /** @class */ (function () {
|
|
|
3988
4131
|
return __generator(this, function (_a) {
|
|
3989
4132
|
switch (_a.label) {
|
|
3990
4133
|
case 0:
|
|
3991
|
-
|
|
3992
|
-
|
|
3993
|
-
|
|
3994
|
-
|
|
3995
|
-
|
|
4134
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
4135
|
+
this.loggerService.info("swarmPublicService waitForOutput", {
|
|
4136
|
+
clientId: clientId,
|
|
4137
|
+
methodName: methodName,
|
|
4138
|
+
swarmName: swarmName,
|
|
4139
|
+
});
|
|
3996
4140
|
return [4 /*yield*/, MethodContextService.runInContext(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
3997
4141
|
return __generator(this, function (_a) {
|
|
3998
4142
|
switch (_a.label) {
|
|
@@ -4023,11 +4167,12 @@ var SwarmPublicService = /** @class */ (function () {
|
|
|
4023
4167
|
return __generator(this, function (_a) {
|
|
4024
4168
|
switch (_a.label) {
|
|
4025
4169
|
case 0:
|
|
4026
|
-
|
|
4027
|
-
|
|
4028
|
-
|
|
4029
|
-
|
|
4030
|
-
|
|
4170
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
4171
|
+
this.loggerService.info("swarmPublicService getAgentName", {
|
|
4172
|
+
clientId: clientId,
|
|
4173
|
+
swarmName: swarmName,
|
|
4174
|
+
methodName: methodName,
|
|
4175
|
+
});
|
|
4031
4176
|
return [4 /*yield*/, MethodContextService.runInContext(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
4032
4177
|
return __generator(this, function (_a) {
|
|
4033
4178
|
switch (_a.label) {
|
|
@@ -4058,10 +4203,11 @@ var SwarmPublicService = /** @class */ (function () {
|
|
|
4058
4203
|
return __generator(this, function (_a) {
|
|
4059
4204
|
switch (_a.label) {
|
|
4060
4205
|
case 0:
|
|
4061
|
-
|
|
4062
|
-
|
|
4063
|
-
|
|
4064
|
-
|
|
4206
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
4207
|
+
this.loggerService.info("swarmPublicService getAgent", {
|
|
4208
|
+
clientId: clientId,
|
|
4209
|
+
swarmName: swarmName,
|
|
4210
|
+
});
|
|
4065
4211
|
return [4 /*yield*/, MethodContextService.runInContext(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
4066
4212
|
return __generator(this, function (_a) {
|
|
4067
4213
|
switch (_a.label) {
|
|
@@ -4094,13 +4240,14 @@ var SwarmPublicService = /** @class */ (function () {
|
|
|
4094
4240
|
return __generator(this, function (_a) {
|
|
4095
4241
|
switch (_a.label) {
|
|
4096
4242
|
case 0:
|
|
4097
|
-
|
|
4098
|
-
|
|
4099
|
-
|
|
4100
|
-
|
|
4101
|
-
|
|
4102
|
-
|
|
4103
|
-
|
|
4243
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
4244
|
+
this.loggerService.info("swarmPublicService setAgentRef", {
|
|
4245
|
+
methodName: methodName,
|
|
4246
|
+
agentName: agentName,
|
|
4247
|
+
agent: agent,
|
|
4248
|
+
clientId: clientId,
|
|
4249
|
+
swarmName: swarmName,
|
|
4250
|
+
});
|
|
4104
4251
|
return [4 /*yield*/, MethodContextService.runInContext(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
4105
4252
|
return __generator(this, function (_a) {
|
|
4106
4253
|
switch (_a.label) {
|
|
@@ -4132,12 +4279,13 @@ var SwarmPublicService = /** @class */ (function () {
|
|
|
4132
4279
|
return __generator(this, function (_a) {
|
|
4133
4280
|
switch (_a.label) {
|
|
4134
4281
|
case 0:
|
|
4135
|
-
|
|
4136
|
-
|
|
4137
|
-
|
|
4138
|
-
|
|
4139
|
-
|
|
4140
|
-
|
|
4282
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
4283
|
+
this.loggerService.info("swarmPublicService setAgentName", {
|
|
4284
|
+
methodName: methodName,
|
|
4285
|
+
agentName: agentName,
|
|
4286
|
+
clientId: clientId,
|
|
4287
|
+
swarmName: swarmName,
|
|
4288
|
+
});
|
|
4141
4289
|
return [4 /*yield*/, MethodContextService.runInContext(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
4142
4290
|
return __generator(this, function (_a) {
|
|
4143
4291
|
switch (_a.label) {
|
|
@@ -4168,11 +4316,12 @@ var SwarmPublicService = /** @class */ (function () {
|
|
|
4168
4316
|
return __generator(this, function (_a) {
|
|
4169
4317
|
switch (_a.label) {
|
|
4170
4318
|
case 0:
|
|
4171
|
-
|
|
4172
|
-
|
|
4173
|
-
|
|
4174
|
-
|
|
4175
|
-
|
|
4319
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
4320
|
+
this.loggerService.info("swarmPublicService dispose", {
|
|
4321
|
+
methodName: methodName,
|
|
4322
|
+
clientId: clientId,
|
|
4323
|
+
swarmName: swarmName,
|
|
4324
|
+
});
|
|
4176
4325
|
return [4 /*yield*/, MethodContextService.runInContext(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
4177
4326
|
return __generator(this, function (_a) {
|
|
4178
4327
|
switch (_a.label) {
|
|
@@ -4238,10 +4387,11 @@ var AgentValidationService = /** @class */ (function () {
|
|
|
4238
4387
|
* @throws {Error} If the agent already exists.
|
|
4239
4388
|
*/
|
|
4240
4389
|
this.addAgent = function (agentName, agentSchema) {
|
|
4241
|
-
|
|
4242
|
-
|
|
4243
|
-
|
|
4244
|
-
|
|
4390
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
4391
|
+
_this.loggerService.info("agentValidationService addAgent", {
|
|
4392
|
+
agentName: agentName,
|
|
4393
|
+
agentSchema: agentSchema,
|
|
4394
|
+
});
|
|
4245
4395
|
if (_this._agentMap.has(agentName)) {
|
|
4246
4396
|
throw new Error("agent-swarm agent ".concat(agentName, " already exist"));
|
|
4247
4397
|
}
|
|
@@ -4254,10 +4404,11 @@ var AgentValidationService = /** @class */ (function () {
|
|
|
4254
4404
|
var _b = __read(_a, 2), agentName = _b[0], storageName = _b[1];
|
|
4255
4405
|
return "".concat(agentName, "-").concat(storageName);
|
|
4256
4406
|
}, function (agentName, storageName) {
|
|
4257
|
-
|
|
4258
|
-
|
|
4259
|
-
|
|
4260
|
-
|
|
4407
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
4408
|
+
_this.loggerService.info("agentValidationService hasStorage", {
|
|
4409
|
+
agentName: agentName,
|
|
4410
|
+
storageName: storageName,
|
|
4411
|
+
});
|
|
4261
4412
|
if (!_this._agentMap.has(agentName)) {
|
|
4262
4413
|
throw new Error("agent-swarm agent ".concat(agentName, " not exist (hasStorage)"));
|
|
4263
4414
|
}
|
|
@@ -4271,10 +4422,11 @@ var AgentValidationService = /** @class */ (function () {
|
|
|
4271
4422
|
var _b = __read(_a, 2), agentName = _b[0], stateName = _b[1];
|
|
4272
4423
|
return "".concat(agentName, "-").concat(stateName);
|
|
4273
4424
|
}, function (agentName, stateName) {
|
|
4274
|
-
|
|
4275
|
-
|
|
4276
|
-
|
|
4277
|
-
|
|
4425
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
4426
|
+
_this.loggerService.info("agentValidationService hasState", {
|
|
4427
|
+
agentName: agentName,
|
|
4428
|
+
stateName: stateName,
|
|
4429
|
+
});
|
|
4278
4430
|
if (!_this._agentMap.has(agentName)) {
|
|
4279
4431
|
throw new Error("agent-swarm agent ".concat(agentName, " not exist (hasState)"));
|
|
4280
4432
|
}
|
|
@@ -4292,10 +4444,11 @@ var AgentValidationService = /** @class */ (function () {
|
|
|
4292
4444
|
return agentName;
|
|
4293
4445
|
}, function (agentName, source) {
|
|
4294
4446
|
var _a, _b;
|
|
4295
|
-
|
|
4296
|
-
|
|
4297
|
-
|
|
4298
|
-
|
|
4447
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
4448
|
+
_this.loggerService.info("agentValidationService validate", {
|
|
4449
|
+
agentName: agentName,
|
|
4450
|
+
source: source,
|
|
4451
|
+
});
|
|
4299
4452
|
var agent = _this._agentMap.get(agentName);
|
|
4300
4453
|
if (!agent) {
|
|
4301
4454
|
throw new Error("agent-swarm agent ".concat(agentName, " not found source=").concat(source));
|
|
@@ -4333,9 +4486,10 @@ var CompletionValidationService = /** @class */ (function () {
|
|
|
4333
4486
|
* @throws Will throw an error if the completion name already exists.
|
|
4334
4487
|
*/
|
|
4335
4488
|
this.addCompletion = function (completionName) {
|
|
4336
|
-
|
|
4337
|
-
|
|
4338
|
-
|
|
4489
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
4490
|
+
_this.loggerService.info("completionValidationService addCompletion", {
|
|
4491
|
+
completionName: completionName,
|
|
4492
|
+
});
|
|
4339
4493
|
if (_this._completionSet.has(completionName)) {
|
|
4340
4494
|
throw new Error("agent-swarm completion ".concat(completionName, " already exist"));
|
|
4341
4495
|
}
|
|
@@ -4351,10 +4505,11 @@ var CompletionValidationService = /** @class */ (function () {
|
|
|
4351
4505
|
var _b = __read(_a, 1), completionName = _b[0];
|
|
4352
4506
|
return completionName;
|
|
4353
4507
|
}, function (completionName, source) {
|
|
4354
|
-
|
|
4355
|
-
|
|
4356
|
-
|
|
4357
|
-
|
|
4508
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
4509
|
+
_this.loggerService.info("completionValidationService validate", {
|
|
4510
|
+
completionName: completionName,
|
|
4511
|
+
source: source,
|
|
4512
|
+
});
|
|
4358
4513
|
if (!_this._completionSet.has(completionName)) {
|
|
4359
4514
|
throw new Error("agent-swarm completion ".concat(completionName, " not found source=").concat(source));
|
|
4360
4515
|
}
|
|
@@ -4385,9 +4540,10 @@ var SessionValidationService = /** @class */ (function () {
|
|
|
4385
4540
|
* @throws Will throw an error if the session already exists.
|
|
4386
4541
|
*/
|
|
4387
4542
|
this.addSession = function (clientId, swarmName, sessionMode) {
|
|
4388
|
-
|
|
4389
|
-
|
|
4390
|
-
|
|
4543
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
4544
|
+
_this.loggerService.info("sessionValidationService addSession", {
|
|
4545
|
+
clientId: clientId,
|
|
4546
|
+
});
|
|
4391
4547
|
if (_this._sessionSwarmMap.has(clientId)) {
|
|
4392
4548
|
throw new Error("agent-swarm session clientId=".concat(clientId, " already exist"));
|
|
4393
4549
|
}
|
|
@@ -4400,10 +4556,11 @@ var SessionValidationService = /** @class */ (function () {
|
|
|
4400
4556
|
* @param {AgentName} agentName - The name of the agent.
|
|
4401
4557
|
*/
|
|
4402
4558
|
this.addAgentUsage = function (sessionId, agentName) {
|
|
4403
|
-
|
|
4404
|
-
|
|
4405
|
-
|
|
4406
|
-
|
|
4559
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
4560
|
+
_this.loggerService.info("sessionValidationService addAgentUsage", {
|
|
4561
|
+
sessionId: sessionId,
|
|
4562
|
+
agentName: agentName,
|
|
4563
|
+
});
|
|
4407
4564
|
if (_this._agentSwarmMap.has(sessionId)) {
|
|
4408
4565
|
var agents = _this._agentSwarmMap.get(sessionId);
|
|
4409
4566
|
if (!agents.includes(agentName)) {
|
|
@@ -4420,10 +4577,11 @@ var SessionValidationService = /** @class */ (function () {
|
|
|
4420
4577
|
* @param {AgentName} agentName - The name of the agent.
|
|
4421
4578
|
*/
|
|
4422
4579
|
this.addHistoryUsage = function (sessionId, agentName) {
|
|
4423
|
-
|
|
4424
|
-
|
|
4425
|
-
|
|
4426
|
-
|
|
4580
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
4581
|
+
_this.loggerService.info("sessionValidationService addHistoryUsage", {
|
|
4582
|
+
sessionId: sessionId,
|
|
4583
|
+
agentName: agentName,
|
|
4584
|
+
});
|
|
4427
4585
|
if (_this._historySwarmMap.has(sessionId)) {
|
|
4428
4586
|
var agents = _this._historySwarmMap.get(sessionId);
|
|
4429
4587
|
if (!agents.includes(agentName)) {
|
|
@@ -4440,10 +4598,11 @@ var SessionValidationService = /** @class */ (function () {
|
|
|
4440
4598
|
* @param {StorageName} storageName - The name of the storage.
|
|
4441
4599
|
*/
|
|
4442
4600
|
this.addStorageUsage = function (sessionId, storageName) {
|
|
4443
|
-
|
|
4444
|
-
|
|
4445
|
-
|
|
4446
|
-
|
|
4601
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
4602
|
+
_this.loggerService.info("sessionValidationService addStorageUsage", {
|
|
4603
|
+
sessionId: sessionId,
|
|
4604
|
+
storageName: storageName,
|
|
4605
|
+
});
|
|
4447
4606
|
if (_this._storageSwarmMap.has(sessionId)) {
|
|
4448
4607
|
var storages = _this._storageSwarmMap.get(sessionId);
|
|
4449
4608
|
if (!storages.includes(storageName)) {
|
|
@@ -4460,10 +4619,11 @@ var SessionValidationService = /** @class */ (function () {
|
|
|
4460
4619
|
* @param {StateName} stateName - The name of the state.
|
|
4461
4620
|
*/
|
|
4462
4621
|
this.addStateUsage = function (sessionId, stateName) {
|
|
4463
|
-
|
|
4464
|
-
|
|
4465
|
-
|
|
4466
|
-
|
|
4622
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
4623
|
+
_this.loggerService.info("sessionValidationService addStateUsage", {
|
|
4624
|
+
sessionId: sessionId,
|
|
4625
|
+
stateName: stateName,
|
|
4626
|
+
});
|
|
4467
4627
|
if (_this._stateSwarmMap.has(sessionId)) {
|
|
4468
4628
|
var states = _this._stateSwarmMap.get(sessionId);
|
|
4469
4629
|
if (!states.includes(stateName)) {
|
|
@@ -4481,10 +4641,11 @@ var SessionValidationService = /** @class */ (function () {
|
|
|
4481
4641
|
* @throws Will throw an error if no agents are found for the session.
|
|
4482
4642
|
*/
|
|
4483
4643
|
this.removeAgentUsage = function (sessionId, agentName) {
|
|
4484
|
-
|
|
4485
|
-
|
|
4486
|
-
|
|
4487
|
-
|
|
4644
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
4645
|
+
_this.loggerService.info("sessionValidationService removeAgentUsage", {
|
|
4646
|
+
sessionId: sessionId,
|
|
4647
|
+
agentName: agentName,
|
|
4648
|
+
});
|
|
4488
4649
|
if (_this._agentSwarmMap.has(sessionId)) {
|
|
4489
4650
|
var agents = _this._agentSwarmMap.get(sessionId);
|
|
4490
4651
|
var agentIndex = agents.indexOf(agentName);
|
|
@@ -4506,10 +4667,11 @@ var SessionValidationService = /** @class */ (function () {
|
|
|
4506
4667
|
* @throws Will throw an error if no agents are found for the session.
|
|
4507
4668
|
*/
|
|
4508
4669
|
this.removeHistoryUsage = function (sessionId, agentName) {
|
|
4509
|
-
|
|
4510
|
-
|
|
4511
|
-
|
|
4512
|
-
|
|
4670
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
4671
|
+
_this.loggerService.info("sessionValidationService removeHistoryUsage", {
|
|
4672
|
+
sessionId: sessionId,
|
|
4673
|
+
agentName: agentName,
|
|
4674
|
+
});
|
|
4513
4675
|
if (_this._historySwarmMap.has(sessionId)) {
|
|
4514
4676
|
var agents = _this._historySwarmMap.get(sessionId);
|
|
4515
4677
|
var agentIndex = agents.indexOf(agentName);
|
|
@@ -4531,10 +4693,11 @@ var SessionValidationService = /** @class */ (function () {
|
|
|
4531
4693
|
* @throws Will throw an error if no storages are found for the session.
|
|
4532
4694
|
*/
|
|
4533
4695
|
this.removeStorageUsage = function (sessionId, storageName) {
|
|
4534
|
-
|
|
4535
|
-
|
|
4536
|
-
|
|
4537
|
-
|
|
4696
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
4697
|
+
_this.loggerService.info("sessionValidationService removeStorageUsage", {
|
|
4698
|
+
sessionId: sessionId,
|
|
4699
|
+
storageName: storageName,
|
|
4700
|
+
});
|
|
4538
4701
|
if (_this._storageSwarmMap.has(sessionId)) {
|
|
4539
4702
|
var agents = _this._storageSwarmMap.get(sessionId);
|
|
4540
4703
|
var agentIndex = agents.indexOf(storageName);
|
|
@@ -4556,10 +4719,11 @@ var SessionValidationService = /** @class */ (function () {
|
|
|
4556
4719
|
* @throws Will throw an error if no states are found for the session.
|
|
4557
4720
|
*/
|
|
4558
4721
|
this.removeStateUsage = function (sessionId, stateName) {
|
|
4559
|
-
|
|
4560
|
-
|
|
4561
|
-
|
|
4562
|
-
|
|
4722
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
4723
|
+
_this.loggerService.info("sessionValidationService removeStateUsage", {
|
|
4724
|
+
sessionId: sessionId,
|
|
4725
|
+
stateName: stateName,
|
|
4726
|
+
});
|
|
4563
4727
|
if (_this._stateSwarmMap.has(sessionId)) {
|
|
4564
4728
|
var agents = _this._stateSwarmMap.get(sessionId);
|
|
4565
4729
|
var agentIndex = agents.indexOf(stateName);
|
|
@@ -4581,9 +4745,10 @@ var SessionValidationService = /** @class */ (function () {
|
|
|
4581
4745
|
* @throws Will throw an error if the session does not exist.
|
|
4582
4746
|
*/
|
|
4583
4747
|
this.getSessionMode = function (clientId) {
|
|
4584
|
-
|
|
4585
|
-
|
|
4586
|
-
|
|
4748
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
4749
|
+
_this.loggerService.info("sessionValidationService getSessionMode", {
|
|
4750
|
+
clientId: clientId,
|
|
4751
|
+
});
|
|
4587
4752
|
if (!_this._sessionModeMap.has(clientId)) {
|
|
4588
4753
|
throw new Error("agent-swarm session getSessionMode clientId=".concat(clientId, " session not exist"));
|
|
4589
4754
|
}
|
|
@@ -4594,7 +4759,8 @@ var SessionValidationService = /** @class */ (function () {
|
|
|
4594
4759
|
* @returns {boolean}
|
|
4595
4760
|
*/
|
|
4596
4761
|
this.hasSession = function (clientId) {
|
|
4597
|
-
|
|
4762
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
4763
|
+
_this.loggerService.info("sessionValidationService hasSession");
|
|
4598
4764
|
return _this._sessionSwarmMap.has(clientId);
|
|
4599
4765
|
};
|
|
4600
4766
|
/**
|
|
@@ -4602,7 +4768,8 @@ var SessionValidationService = /** @class */ (function () {
|
|
|
4602
4768
|
* @returns {SessionId[]} The list of session IDs.
|
|
4603
4769
|
*/
|
|
4604
4770
|
this.getSessionList = function () {
|
|
4605
|
-
|
|
4771
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
4772
|
+
_this.loggerService.info("sessionValidationService getSessionList");
|
|
4606
4773
|
return __spreadArray([], __read(_this._sessionSwarmMap.keys()), false);
|
|
4607
4774
|
};
|
|
4608
4775
|
/**
|
|
@@ -4612,9 +4779,10 @@ var SessionValidationService = /** @class */ (function () {
|
|
|
4612
4779
|
*/
|
|
4613
4780
|
this.getSessionAgentList = function (clientId) {
|
|
4614
4781
|
var _a;
|
|
4615
|
-
|
|
4616
|
-
|
|
4617
|
-
|
|
4782
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
4783
|
+
_this.loggerService.info("sessionValidationService getSessionAgentList", {
|
|
4784
|
+
clientId: clientId,
|
|
4785
|
+
});
|
|
4618
4786
|
return (_a = _this._agentSwarmMap.get(clientId)) !== null && _a !== void 0 ? _a : [];
|
|
4619
4787
|
};
|
|
4620
4788
|
/**
|
|
@@ -4624,9 +4792,10 @@ var SessionValidationService = /** @class */ (function () {
|
|
|
4624
4792
|
*/
|
|
4625
4793
|
this.getSessionHistoryList = function (clientId) {
|
|
4626
4794
|
var _a;
|
|
4627
|
-
|
|
4628
|
-
|
|
4629
|
-
|
|
4795
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
4796
|
+
_this.loggerService.info("sessionValidationService getSessionHistoryList", {
|
|
4797
|
+
clientId: clientId,
|
|
4798
|
+
});
|
|
4630
4799
|
return (_a = _this._agentSwarmMap.get(clientId)) !== null && _a !== void 0 ? _a : [];
|
|
4631
4800
|
};
|
|
4632
4801
|
/**
|
|
@@ -4636,9 +4805,10 @@ var SessionValidationService = /** @class */ (function () {
|
|
|
4636
4805
|
* @throws Will throw an error if the session does not exist.
|
|
4637
4806
|
*/
|
|
4638
4807
|
this.getSwarm = function (clientId) {
|
|
4639
|
-
|
|
4640
|
-
|
|
4641
|
-
|
|
4808
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
4809
|
+
_this.loggerService.info("sessionValidationService getSwarm", {
|
|
4810
|
+
clientId: clientId,
|
|
4811
|
+
});
|
|
4642
4812
|
var session = _this._sessionSwarmMap.get(clientId);
|
|
4643
4813
|
if (session === undefined) {
|
|
4644
4814
|
throw new Error("agent-swarm session clientId=".concat(clientId, " not found"));
|
|
@@ -4652,7 +4822,10 @@ var SessionValidationService = /** @class */ (function () {
|
|
|
4652
4822
|
* @throws Will throw an error if the session does not exist.
|
|
4653
4823
|
*/
|
|
4654
4824
|
this.validate = function (clientId, source) {
|
|
4655
|
-
|
|
4825
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
4826
|
+
_this.loggerService.info("sessionValidationService validate", {
|
|
4827
|
+
clientId: clientId,
|
|
4828
|
+
});
|
|
4656
4829
|
if (!_this._sessionSwarmMap.has(clientId)) {
|
|
4657
4830
|
throw new Error("agent-swarm session clientId=".concat(clientId, " not exist source=").concat(source));
|
|
4658
4831
|
}
|
|
@@ -4663,9 +4836,10 @@ var SessionValidationService = /** @class */ (function () {
|
|
|
4663
4836
|
* @param {SessionId} clientId - The ID of the client.
|
|
4664
4837
|
*/
|
|
4665
4838
|
this.removeSession = function (clientId) {
|
|
4666
|
-
|
|
4667
|
-
|
|
4668
|
-
|
|
4839
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
4840
|
+
_this.loggerService.info("sessionValidationService addSession", {
|
|
4841
|
+
clientId: clientId,
|
|
4842
|
+
});
|
|
4669
4843
|
_this._sessionSwarmMap.delete(clientId);
|
|
4670
4844
|
_this._sessionModeMap.delete(clientId);
|
|
4671
4845
|
};
|
|
@@ -4689,10 +4863,11 @@ var SwarmValidationService = /** @class */ (function () {
|
|
|
4689
4863
|
* @throws Will throw an error if the swarm already exists.
|
|
4690
4864
|
*/
|
|
4691
4865
|
this.addSwarm = function (swarmName, swarmSchema) {
|
|
4692
|
-
|
|
4693
|
-
|
|
4694
|
-
|
|
4695
|
-
|
|
4866
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
4867
|
+
_this.loggerService.info("swarmValidationService addSwarm", {
|
|
4868
|
+
swarmName: swarmName,
|
|
4869
|
+
swarmSchema: swarmSchema,
|
|
4870
|
+
});
|
|
4696
4871
|
if (_this._swarmMap.has(swarmName)) {
|
|
4697
4872
|
throw new Error("swarm-swarm swarm ".concat(swarmName, " already exist"));
|
|
4698
4873
|
}
|
|
@@ -4705,9 +4880,10 @@ var SwarmValidationService = /** @class */ (function () {
|
|
|
4705
4880
|
* @throws Will throw an error if the swarm is not found.
|
|
4706
4881
|
*/
|
|
4707
4882
|
this.getAgentList = function (swarmName) {
|
|
4708
|
-
|
|
4709
|
-
|
|
4710
|
-
|
|
4883
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
4884
|
+
_this.loggerService.info("swarmValidationService getAgentList", {
|
|
4885
|
+
swarmName: swarmName,
|
|
4886
|
+
});
|
|
4711
4887
|
var swarm = _this._swarmMap.get(swarmName);
|
|
4712
4888
|
if (!swarm) {
|
|
4713
4889
|
throw new Error("agent-swarm swarm ".concat(swarmName, " not found"));
|
|
@@ -4724,10 +4900,11 @@ var SwarmValidationService = /** @class */ (function () {
|
|
|
4724
4900
|
var _b = __read(_a, 1), swarmName = _b[0];
|
|
4725
4901
|
return swarmName;
|
|
4726
4902
|
}, function (swarmName, source) {
|
|
4727
|
-
|
|
4728
|
-
|
|
4729
|
-
|
|
4730
|
-
|
|
4903
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
4904
|
+
_this.loggerService.info("swarmValidationService validate", {
|
|
4905
|
+
swarmName: swarmName,
|
|
4906
|
+
source: source,
|
|
4907
|
+
});
|
|
4731
4908
|
var swarm = _this._swarmMap.get(swarmName);
|
|
4732
4909
|
if (!swarm) {
|
|
4733
4910
|
throw new Error("agent-swarm swarm ".concat(swarmName, " not found"));
|
|
@@ -4759,10 +4936,11 @@ var ToolValidationService = /** @class */ (function () {
|
|
|
4759
4936
|
* @throws Will throw an error if the tool already exists.
|
|
4760
4937
|
*/
|
|
4761
4938
|
this.addTool = function (toolName, toolSchema) {
|
|
4762
|
-
|
|
4763
|
-
|
|
4764
|
-
|
|
4765
|
-
|
|
4939
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
4940
|
+
_this.loggerService.info("toolValidationService addTool", {
|
|
4941
|
+
toolName: toolName,
|
|
4942
|
+
toolSchema: toolSchema,
|
|
4943
|
+
});
|
|
4766
4944
|
if (_this._toolMap.has(toolName)) {
|
|
4767
4945
|
throw new Error("agent-swarm tool ".concat(toolName, " already exist"));
|
|
4768
4946
|
}
|
|
@@ -4778,10 +4956,11 @@ var ToolValidationService = /** @class */ (function () {
|
|
|
4778
4956
|
var _b = __read(_a, 1), toolName = _b[0];
|
|
4779
4957
|
return toolName;
|
|
4780
4958
|
}, function (toolName, source) {
|
|
4781
|
-
|
|
4782
|
-
|
|
4783
|
-
|
|
4784
|
-
|
|
4959
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
4960
|
+
_this.loggerService.info("toolValidationService validate", {
|
|
4961
|
+
toolName: toolName,
|
|
4962
|
+
source: source,
|
|
4963
|
+
});
|
|
4785
4964
|
if (!_this._toolMap.has(toolName)) {
|
|
4786
4965
|
throw new Error("agent-swarm tool ".concat(toolName, " not found source=").concat(source));
|
|
4787
4966
|
}
|
|
@@ -4805,7 +4984,8 @@ var EmbeddingSchemaService = /** @class */ (function () {
|
|
|
4805
4984
|
* @param {IAgentTool} value - The embedding to register.
|
|
4806
4985
|
*/
|
|
4807
4986
|
this.register = function (key, value) {
|
|
4808
|
-
|
|
4987
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
4988
|
+
_this.loggerService.info("embeddingSchemaService register");
|
|
4809
4989
|
_this.registry = _this.registry.register(key, value);
|
|
4810
4990
|
};
|
|
4811
4991
|
/**
|
|
@@ -4814,7 +4994,8 @@ var EmbeddingSchemaService = /** @class */ (function () {
|
|
|
4814
4994
|
* @returns {IAgentTool} The embedding associated with the given key.
|
|
4815
4995
|
*/
|
|
4816
4996
|
this.get = function (key) {
|
|
4817
|
-
|
|
4997
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
4998
|
+
_this.loggerService.info("embeddingSchemaService get", { key: key });
|
|
4818
4999
|
return _this.registry.get(key);
|
|
4819
5000
|
};
|
|
4820
5001
|
}
|
|
@@ -4835,7 +5016,8 @@ var StorageSchemaService = /** @class */ (function () {
|
|
|
4835
5016
|
* @param {IStorageSchema} value - The schema to register.
|
|
4836
5017
|
*/
|
|
4837
5018
|
this.register = function (key, value) {
|
|
4838
|
-
|
|
5019
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
5020
|
+
_this.loggerService.info("storageSchemaService register", { key: key });
|
|
4839
5021
|
_this.registry = _this.registry.register(key, value);
|
|
4840
5022
|
};
|
|
4841
5023
|
/**
|
|
@@ -4844,7 +5026,8 @@ var StorageSchemaService = /** @class */ (function () {
|
|
|
4844
5026
|
* @returns {IStorageSchema} The retrieved schema.
|
|
4845
5027
|
*/
|
|
4846
5028
|
this.get = function (key) {
|
|
4847
|
-
|
|
5029
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
5030
|
+
_this.loggerService.info("storageSchemaService get", { key: key });
|
|
4848
5031
|
return _this.registry.get(key);
|
|
4849
5032
|
};
|
|
4850
5033
|
}
|
|
@@ -4878,9 +5061,10 @@ var ClientStorage = /** @class */ (function () {
|
|
|
4878
5061
|
return __generator(this, function (_a) {
|
|
4879
5062
|
switch (_a.label) {
|
|
4880
5063
|
case 0:
|
|
4881
|
-
|
|
4882
|
-
|
|
4883
|
-
|
|
5064
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_DEBUG &&
|
|
5065
|
+
this.params.logger.debug("ClientStorage storageName=".concat(this.params.storageName, " clientId=").concat(this.params.clientId, " shared=").concat(this.params.shared, " _createEmbedding"), {
|
|
5066
|
+
id: item.id,
|
|
5067
|
+
});
|
|
4884
5068
|
return [4 /*yield*/, this.params.createIndex(item)];
|
|
4885
5069
|
case 1:
|
|
4886
5070
|
index = _a.sent();
|
|
@@ -4903,7 +5087,8 @@ var ClientStorage = /** @class */ (function () {
|
|
|
4903
5087
|
return __generator(this, function (_a) {
|
|
4904
5088
|
switch (_a.label) {
|
|
4905
5089
|
case 0:
|
|
4906
|
-
|
|
5090
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_DEBUG &&
|
|
5091
|
+
this.params.logger.debug("ClientStorage storageName=".concat(this.params.storageName, " clientId=").concat(this.params.clientId, " shared=").concat(this.params.shared, " waitForInit"));
|
|
4907
5092
|
if (!this.params.getData) {
|
|
4908
5093
|
return [2 /*return*/];
|
|
4909
5094
|
}
|
|
@@ -4941,10 +5126,11 @@ var ClientStorage = /** @class */ (function () {
|
|
|
4941
5126
|
return __generator(this, function (_c) {
|
|
4942
5127
|
switch (_c.label) {
|
|
4943
5128
|
case 0:
|
|
4944
|
-
|
|
4945
|
-
|
|
4946
|
-
|
|
4947
|
-
|
|
5129
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_DEBUG &&
|
|
5130
|
+
this.params.logger.debug("ClientStorage storageName=".concat(this.params.storageName, " clientId=").concat(this.params.clientId, " shared=").concat(this.params.shared, " take"), {
|
|
5131
|
+
search: search,
|
|
5132
|
+
total: total,
|
|
5133
|
+
});
|
|
4948
5134
|
indexed = new SortedArray();
|
|
4949
5135
|
return [4 /*yield*/, this.params.createEmbedding(search)];
|
|
4950
5136
|
case 1:
|
|
@@ -4975,9 +5161,10 @@ var ClientStorage = /** @class */ (function () {
|
|
|
4975
5161
|
})))];
|
|
4976
5162
|
case 2:
|
|
4977
5163
|
_c.sent();
|
|
4978
|
-
|
|
4979
|
-
|
|
4980
|
-
|
|
5164
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_DEBUG &&
|
|
5165
|
+
this.params.logger.debug("ClientStorage storageName=".concat(this.params.storageName, " clientId=").concat(this.params.clientId, " shared=").concat(this.params.shared, " take indexed"), {
|
|
5166
|
+
indexed: indexed.getEntries(),
|
|
5167
|
+
});
|
|
4981
5168
|
if ((_a = this.params.callbacks) === null || _a === void 0 ? void 0 : _a.onSearch) {
|
|
4982
5169
|
(_b = this.params.callbacks) === null || _b === void 0 ? void 0 : _b.onSearch(search, indexed, this.params.clientId, this.params.storageName);
|
|
4983
5170
|
}
|
|
@@ -5014,9 +5201,10 @@ var ClientStorage = /** @class */ (function () {
|
|
|
5014
5201
|
return __generator(this, function (_c) {
|
|
5015
5202
|
switch (_c.label) {
|
|
5016
5203
|
case 0:
|
|
5017
|
-
|
|
5018
|
-
|
|
5019
|
-
|
|
5204
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_DEBUG &&
|
|
5205
|
+
this.params.logger.debug("ClientStorage storageName=".concat(this.params.storageName, " clientId=").concat(this.params.clientId, " shared=").concat(this.params.shared, " upsert"), {
|
|
5206
|
+
item: item,
|
|
5207
|
+
});
|
|
5020
5208
|
this._itemMap.set(item.id, item);
|
|
5021
5209
|
this._createEmbedding.clear(item.id);
|
|
5022
5210
|
return [4 /*yield*/, this._createEmbedding(item)];
|
|
@@ -5053,9 +5241,10 @@ var ClientStorage = /** @class */ (function () {
|
|
|
5053
5241
|
return __generator(this, function (_c) {
|
|
5054
5242
|
switch (_c.label) {
|
|
5055
5243
|
case 0:
|
|
5056
|
-
|
|
5057
|
-
|
|
5058
|
-
|
|
5244
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_DEBUG &&
|
|
5245
|
+
this.params.logger.debug("ClientStorage storageName=".concat(this.params.storageName, " clientId=").concat(this.params.clientId, " shared=").concat(this.params.shared, " remove"), {
|
|
5246
|
+
id: itemId,
|
|
5247
|
+
});
|
|
5059
5248
|
this._itemMap.delete(itemId);
|
|
5060
5249
|
this._createEmbedding.clear(itemId);
|
|
5061
5250
|
if ((_a = this.params.callbacks) === null || _a === void 0 ? void 0 : _a.onUpdate) {
|
|
@@ -5087,7 +5276,8 @@ var ClientStorage = /** @class */ (function () {
|
|
|
5087
5276
|
return __generator(this, function (_a) {
|
|
5088
5277
|
switch (_a.label) {
|
|
5089
5278
|
case 0:
|
|
5090
|
-
|
|
5279
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_DEBUG &&
|
|
5280
|
+
this.params.logger.debug("ClientStorage storageName=".concat(this.params.storageName, " clientId=").concat(this.params.clientId, " shared=").concat(this.params.shared, " clear"));
|
|
5091
5281
|
this._itemMap.clear();
|
|
5092
5282
|
this._createEmbedding.clear();
|
|
5093
5283
|
return [4 /*yield*/, this.params.bus.emit(this.params.clientId, {
|
|
@@ -5117,9 +5307,10 @@ var ClientStorage = /** @class */ (function () {
|
|
|
5117
5307
|
return __generator(this, function (_b) {
|
|
5118
5308
|
switch (_b.label) {
|
|
5119
5309
|
case 0:
|
|
5120
|
-
|
|
5121
|
-
|
|
5122
|
-
|
|
5310
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_DEBUG &&
|
|
5311
|
+
this.params.logger.debug("ClientStorage storageName=".concat(this.params.storageName, " clientId=").concat(this.params.clientId, " shared=").concat(this.params.shared, " get"), {
|
|
5312
|
+
id: itemId,
|
|
5313
|
+
});
|
|
5123
5314
|
result = (_a = this._itemMap.get(itemId)) !== null && _a !== void 0 ? _a : null;
|
|
5124
5315
|
return [4 /*yield*/, this.params.bus.emit(this.params.clientId, {
|
|
5125
5316
|
type: "get",
|
|
@@ -5152,7 +5343,8 @@ var ClientStorage = /** @class */ (function () {
|
|
|
5152
5343
|
return __generator(this, function (_d) {
|
|
5153
5344
|
switch (_d.label) {
|
|
5154
5345
|
case 0:
|
|
5155
|
-
|
|
5346
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_DEBUG &&
|
|
5347
|
+
this.params.logger.debug("ClientStorage storageName=".concat(this.params.storageName, " clientId=").concat(this.params.clientId, " shared=").concat(this.params.shared, " list"));
|
|
5156
5348
|
if (!filter) {
|
|
5157
5349
|
return [2 /*return*/, __spreadArray([], __read(this._itemMap.values()), false)];
|
|
5158
5350
|
}
|
|
@@ -5197,16 +5389,18 @@ var ClientStorage = /** @class */ (function () {
|
|
|
5197
5389
|
this.dispose = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
5198
5390
|
var _a;
|
|
5199
5391
|
return __generator(this, function (_b) {
|
|
5200
|
-
|
|
5392
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_DEBUG &&
|
|
5393
|
+
this.params.logger.debug("ClientStorage storageName=".concat(this.params.storageName, " clientId=").concat(this.params.clientId, " shared=").concat(this.params.shared, " dispose"));
|
|
5201
5394
|
if ((_a = this.params.callbacks) === null || _a === void 0 ? void 0 : _a.onDispose) {
|
|
5202
5395
|
this.params.callbacks.onDispose(this.params.clientId, this.params.storageName);
|
|
5203
5396
|
}
|
|
5204
5397
|
return [2 /*return*/];
|
|
5205
5398
|
});
|
|
5206
5399
|
}); };
|
|
5207
|
-
|
|
5208
|
-
params
|
|
5209
|
-
|
|
5400
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_DEBUG &&
|
|
5401
|
+
this.params.logger.debug("ClientStorage storageName=".concat(this.params.storageName, " clientId=").concat(this.params.clientId, " shared=").concat(this.params.shared, " CTOR"), {
|
|
5402
|
+
params: params,
|
|
5403
|
+
});
|
|
5210
5404
|
if ((_a = this.params.callbacks) === null || _a === void 0 ? void 0 : _a.onInit) {
|
|
5211
5405
|
this.params.callbacks.onInit(this.params.clientId, this.params.storageName);
|
|
5212
5406
|
}
|
|
@@ -5273,11 +5467,12 @@ var StorageConnectionService = /** @class */ (function () {
|
|
|
5273
5467
|
return __generator(this, function (_a) {
|
|
5274
5468
|
switch (_a.label) {
|
|
5275
5469
|
case 0:
|
|
5276
|
-
|
|
5277
|
-
|
|
5278
|
-
|
|
5279
|
-
|
|
5280
|
-
|
|
5470
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
5471
|
+
this.loggerService.info("storageConnectionService take", {
|
|
5472
|
+
search: search,
|
|
5473
|
+
total: total,
|
|
5474
|
+
score: score,
|
|
5475
|
+
});
|
|
5281
5476
|
storage = this.getStorage(this.methodContextService.context.clientId, this.methodContextService.context.storageName);
|
|
5282
5477
|
return [4 /*yield*/, storage.waitForInit()];
|
|
5283
5478
|
case 1:
|
|
@@ -5297,9 +5492,10 @@ var StorageConnectionService = /** @class */ (function () {
|
|
|
5297
5492
|
return __generator(this, function (_a) {
|
|
5298
5493
|
switch (_a.label) {
|
|
5299
5494
|
case 0:
|
|
5300
|
-
|
|
5301
|
-
|
|
5302
|
-
|
|
5495
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
5496
|
+
this.loggerService.info("storageConnectionService upsert", {
|
|
5497
|
+
item: item,
|
|
5498
|
+
});
|
|
5303
5499
|
storage = this.getStorage(this.methodContextService.context.clientId, this.methodContextService.context.storageName);
|
|
5304
5500
|
return [4 /*yield*/, storage.waitForInit()];
|
|
5305
5501
|
case 1:
|
|
@@ -5319,9 +5515,10 @@ var StorageConnectionService = /** @class */ (function () {
|
|
|
5319
5515
|
return __generator(this, function (_a) {
|
|
5320
5516
|
switch (_a.label) {
|
|
5321
5517
|
case 0:
|
|
5322
|
-
|
|
5323
|
-
|
|
5324
|
-
|
|
5518
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
5519
|
+
this.loggerService.info("storageConnectionService remove", {
|
|
5520
|
+
itemId: itemId,
|
|
5521
|
+
});
|
|
5325
5522
|
storage = this.getStorage(this.methodContextService.context.clientId, this.methodContextService.context.storageName);
|
|
5326
5523
|
return [4 /*yield*/, storage.waitForInit()];
|
|
5327
5524
|
case 1:
|
|
@@ -5341,9 +5538,10 @@ var StorageConnectionService = /** @class */ (function () {
|
|
|
5341
5538
|
return __generator(this, function (_a) {
|
|
5342
5539
|
switch (_a.label) {
|
|
5343
5540
|
case 0:
|
|
5344
|
-
|
|
5345
|
-
|
|
5346
|
-
|
|
5541
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
5542
|
+
this.loggerService.info("storageConnectionService get", {
|
|
5543
|
+
itemId: itemId,
|
|
5544
|
+
});
|
|
5347
5545
|
storage = this.getStorage(this.methodContextService.context.clientId, this.methodContextService.context.storageName);
|
|
5348
5546
|
return [4 /*yield*/, storage.waitForInit()];
|
|
5349
5547
|
case 1:
|
|
@@ -5363,7 +5561,8 @@ var StorageConnectionService = /** @class */ (function () {
|
|
|
5363
5561
|
return __generator(this, function (_a) {
|
|
5364
5562
|
switch (_a.label) {
|
|
5365
5563
|
case 0:
|
|
5366
|
-
|
|
5564
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
5565
|
+
this.loggerService.info("storageConnectionService list");
|
|
5367
5566
|
storage = this.getStorage(this.methodContextService.context.clientId, this.methodContextService.context.storageName);
|
|
5368
5567
|
return [4 /*yield*/, storage.waitForInit()];
|
|
5369
5568
|
case 1:
|
|
@@ -5382,7 +5581,8 @@ var StorageConnectionService = /** @class */ (function () {
|
|
|
5382
5581
|
return __generator(this, function (_a) {
|
|
5383
5582
|
switch (_a.label) {
|
|
5384
5583
|
case 0:
|
|
5385
|
-
|
|
5584
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
5585
|
+
this.loggerService.info("storageConnectionService clear");
|
|
5386
5586
|
storage = this.getStorage(this.methodContextService.context.clientId, this.methodContextService.context.storageName);
|
|
5387
5587
|
return [4 /*yield*/, storage.waitForInit()];
|
|
5388
5588
|
case 1:
|
|
@@ -5401,7 +5601,8 @@ var StorageConnectionService = /** @class */ (function () {
|
|
|
5401
5601
|
return __generator(this, function (_a) {
|
|
5402
5602
|
switch (_a.label) {
|
|
5403
5603
|
case 0:
|
|
5404
|
-
|
|
5604
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
5605
|
+
this.loggerService.info("storageConnectionService dispose");
|
|
5405
5606
|
key = "".concat(this.methodContextService.context.clientId, "-").concat(this.methodContextService.context.storageName);
|
|
5406
5607
|
if (!this.getStorage.has(key)) {
|
|
5407
5608
|
return [2 /*return*/];
|
|
@@ -5445,14 +5646,15 @@ var StoragePublicService = /** @class */ (function () {
|
|
|
5445
5646
|
return __generator(this, function (_a) {
|
|
5446
5647
|
switch (_a.label) {
|
|
5447
5648
|
case 0:
|
|
5448
|
-
|
|
5449
|
-
|
|
5450
|
-
|
|
5451
|
-
|
|
5452
|
-
|
|
5453
|
-
|
|
5454
|
-
|
|
5455
|
-
|
|
5649
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
5650
|
+
this.loggerService.info("storagePublicService take", {
|
|
5651
|
+
methodName: methodName,
|
|
5652
|
+
search: search,
|
|
5653
|
+
total: total,
|
|
5654
|
+
clientId: clientId,
|
|
5655
|
+
storageName: storageName,
|
|
5656
|
+
score: score,
|
|
5657
|
+
});
|
|
5456
5658
|
return [4 /*yield*/, MethodContextService.runInContext(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
5457
5659
|
return __generator(this, function (_a) {
|
|
5458
5660
|
switch (_a.label) {
|
|
@@ -5482,11 +5684,12 @@ var StoragePublicService = /** @class */ (function () {
|
|
|
5482
5684
|
return __generator(this, function (_a) {
|
|
5483
5685
|
switch (_a.label) {
|
|
5484
5686
|
case 0:
|
|
5485
|
-
|
|
5486
|
-
|
|
5487
|
-
|
|
5488
|
-
|
|
5489
|
-
|
|
5687
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
5688
|
+
this.loggerService.info("storagePublicService upsert", {
|
|
5689
|
+
item: item,
|
|
5690
|
+
clientId: clientId,
|
|
5691
|
+
storageName: storageName,
|
|
5692
|
+
});
|
|
5490
5693
|
return [4 /*yield*/, MethodContextService.runInContext(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
5491
5694
|
return __generator(this, function (_a) {
|
|
5492
5695
|
switch (_a.label) {
|
|
@@ -5516,11 +5719,12 @@ var StoragePublicService = /** @class */ (function () {
|
|
|
5516
5719
|
return __generator(this, function (_a) {
|
|
5517
5720
|
switch (_a.label) {
|
|
5518
5721
|
case 0:
|
|
5519
|
-
|
|
5520
|
-
|
|
5521
|
-
|
|
5522
|
-
|
|
5523
|
-
|
|
5722
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
5723
|
+
this.loggerService.info("storagePublicService remove", {
|
|
5724
|
+
itemId: itemId,
|
|
5725
|
+
clientId: clientId,
|
|
5726
|
+
storageName: storageName,
|
|
5727
|
+
});
|
|
5524
5728
|
return [4 /*yield*/, MethodContextService.runInContext(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
5525
5729
|
return __generator(this, function (_a) {
|
|
5526
5730
|
switch (_a.label) {
|
|
@@ -5550,12 +5754,13 @@ var StoragePublicService = /** @class */ (function () {
|
|
|
5550
5754
|
return __generator(this, function (_a) {
|
|
5551
5755
|
switch (_a.label) {
|
|
5552
5756
|
case 0:
|
|
5553
|
-
|
|
5554
|
-
|
|
5555
|
-
|
|
5556
|
-
|
|
5557
|
-
|
|
5558
|
-
|
|
5757
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
5758
|
+
this.loggerService.info("storagePublicService get", {
|
|
5759
|
+
methodName: methodName,
|
|
5760
|
+
itemId: itemId,
|
|
5761
|
+
clientId: clientId,
|
|
5762
|
+
storageName: storageName,
|
|
5763
|
+
});
|
|
5559
5764
|
return [4 /*yield*/, MethodContextService.runInContext(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
5560
5765
|
return __generator(this, function (_a) {
|
|
5561
5766
|
switch (_a.label) {
|
|
@@ -5585,11 +5790,12 @@ var StoragePublicService = /** @class */ (function () {
|
|
|
5585
5790
|
return __generator(this, function (_a) {
|
|
5586
5791
|
switch (_a.label) {
|
|
5587
5792
|
case 0:
|
|
5588
|
-
|
|
5589
|
-
|
|
5590
|
-
|
|
5591
|
-
|
|
5592
|
-
|
|
5793
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
5794
|
+
this.loggerService.info("storagePublicService list", {
|
|
5795
|
+
methodName: methodName,
|
|
5796
|
+
clientId: clientId,
|
|
5797
|
+
storageName: storageName,
|
|
5798
|
+
});
|
|
5593
5799
|
return [4 /*yield*/, MethodContextService.runInContext(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
5594
5800
|
return __generator(this, function (_a) {
|
|
5595
5801
|
switch (_a.label) {
|
|
@@ -5618,11 +5824,12 @@ var StoragePublicService = /** @class */ (function () {
|
|
|
5618
5824
|
return __generator(this, function (_a) {
|
|
5619
5825
|
switch (_a.label) {
|
|
5620
5826
|
case 0:
|
|
5621
|
-
|
|
5622
|
-
|
|
5623
|
-
|
|
5624
|
-
|
|
5625
|
-
|
|
5827
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
5828
|
+
this.loggerService.info("storagePublicService clear", {
|
|
5829
|
+
methodName: methodName,
|
|
5830
|
+
clientId: clientId,
|
|
5831
|
+
storageName: storageName,
|
|
5832
|
+
});
|
|
5626
5833
|
return [4 /*yield*/, MethodContextService.runInContext(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
5627
5834
|
return __generator(this, function (_a) {
|
|
5628
5835
|
switch (_a.label) {
|
|
@@ -5653,10 +5860,11 @@ var StoragePublicService = /** @class */ (function () {
|
|
|
5653
5860
|
return __generator(this, function (_a) {
|
|
5654
5861
|
switch (_a.label) {
|
|
5655
5862
|
case 0:
|
|
5656
|
-
|
|
5657
|
-
|
|
5658
|
-
|
|
5659
|
-
|
|
5863
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
5864
|
+
this.loggerService.info("storagePublicService dispose", {
|
|
5865
|
+
clientId: clientId,
|
|
5866
|
+
storageName: storageName,
|
|
5867
|
+
});
|
|
5660
5868
|
return [4 /*yield*/, MethodContextService.runInContext(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
5661
5869
|
return __generator(this, function (_a) {
|
|
5662
5870
|
switch (_a.label) {
|
|
@@ -5696,10 +5904,11 @@ var StorageValidationService = /** @class */ (function () {
|
|
|
5696
5904
|
* @throws {Error} If the storage already exists.
|
|
5697
5905
|
*/
|
|
5698
5906
|
this.addStorage = function (storageName, storageSchema) {
|
|
5699
|
-
|
|
5700
|
-
|
|
5701
|
-
|
|
5702
|
-
|
|
5907
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
5908
|
+
_this.loggerService.info("storageValidationService addStorage", {
|
|
5909
|
+
storageName: storageName,
|
|
5910
|
+
storageSchema: storageSchema,
|
|
5911
|
+
});
|
|
5703
5912
|
if (_this._storageMap.has(storageName)) {
|
|
5704
5913
|
throw new Error("storage-swarm storage ".concat(storageName, " already exist"));
|
|
5705
5914
|
}
|
|
@@ -5715,10 +5924,11 @@ var StorageValidationService = /** @class */ (function () {
|
|
|
5715
5924
|
var _b = __read(_a, 1), storageName = _b[0];
|
|
5716
5925
|
return storageName;
|
|
5717
5926
|
}, function (storageName, source) {
|
|
5718
|
-
|
|
5719
|
-
|
|
5720
|
-
|
|
5721
|
-
|
|
5927
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
5928
|
+
_this.loggerService.info("storageValidationService validate", {
|
|
5929
|
+
storageName: storageName,
|
|
5930
|
+
source: source,
|
|
5931
|
+
});
|
|
5722
5932
|
var storage = _this._storageMap.get(storageName);
|
|
5723
5933
|
if (!storage) {
|
|
5724
5934
|
throw new Error("storage-swarm storage ".concat(storageName, " not found source=").concat(source));
|
|
@@ -5745,10 +5955,11 @@ var EmbeddingValidationService = /** @class */ (function () {
|
|
|
5745
5955
|
* @throws Will throw an error if the embedding already exists.
|
|
5746
5956
|
*/
|
|
5747
5957
|
this.addEmbedding = function (embeddingName, embeddingSchema) {
|
|
5748
|
-
|
|
5749
|
-
|
|
5750
|
-
|
|
5751
|
-
|
|
5958
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
5959
|
+
_this.loggerService.info("embeddingValidationService addEmbedding", {
|
|
5960
|
+
embeddingName: embeddingName,
|
|
5961
|
+
embeddingSchema: embeddingSchema,
|
|
5962
|
+
});
|
|
5752
5963
|
if (_this._embeddingMap.has(embeddingName)) {
|
|
5753
5964
|
throw new Error("agent-swarm embedding ".concat(embeddingName, " already exist"));
|
|
5754
5965
|
}
|
|
@@ -5764,10 +5975,11 @@ var EmbeddingValidationService = /** @class */ (function () {
|
|
|
5764
5975
|
var _b = __read(_a, 1), embeddingName = _b[0];
|
|
5765
5976
|
return embeddingName;
|
|
5766
5977
|
}, function (embeddingName, source) {
|
|
5767
|
-
|
|
5768
|
-
|
|
5769
|
-
|
|
5770
|
-
|
|
5978
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
5979
|
+
_this.loggerService.info("embeddingValidationService validate", {
|
|
5980
|
+
embeddingName: embeddingName,
|
|
5981
|
+
source: source,
|
|
5982
|
+
});
|
|
5771
5983
|
if (!_this._embeddingMap.has(embeddingName)) {
|
|
5772
5984
|
throw new Error("agent-swarm embedding ".concat(embeddingName, " not found source=").concat(source));
|
|
5773
5985
|
}
|
|
@@ -5791,7 +6003,8 @@ var StateSchemaService = /** @class */ (function () {
|
|
|
5791
6003
|
* @param {IStateSchema} value - The schema to register.
|
|
5792
6004
|
*/
|
|
5793
6005
|
this.register = function (key, value) {
|
|
5794
|
-
|
|
6006
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
6007
|
+
_this.loggerService.info("stateSchemaService register", { key: key });
|
|
5795
6008
|
_this.registry = _this.registry.register(key, value);
|
|
5796
6009
|
};
|
|
5797
6010
|
/**
|
|
@@ -5800,7 +6013,8 @@ var StateSchemaService = /** @class */ (function () {
|
|
|
5800
6013
|
* @returns {IStateSchema} The retrieved schema.
|
|
5801
6014
|
*/
|
|
5802
6015
|
this.get = function (key) {
|
|
5803
|
-
|
|
6016
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
6017
|
+
_this.loggerService.info("stateSchemaService get", { key: key });
|
|
5804
6018
|
return _this.registry.get(key);
|
|
5805
6019
|
};
|
|
5806
6020
|
}
|
|
@@ -5834,7 +6048,7 @@ var ClientState = /** @class */ (function () {
|
|
|
5834
6048
|
console.assert(payload, "agent-swarm ClientState write action undefined payload");
|
|
5835
6049
|
_a = this;
|
|
5836
6050
|
return [4 /*yield*/, payload(this._state)];
|
|
5837
|
-
case 1: return [2 /*return*/, _a._state = _b.sent()];
|
|
6051
|
+
case 1: return [2 /*return*/, (_a._state = _b.sent())];
|
|
5838
6052
|
case 2: throw new Error("agent-swarm ClientState unknown action");
|
|
5839
6053
|
}
|
|
5840
6054
|
});
|
|
@@ -5849,12 +6063,14 @@ var ClientState = /** @class */ (function () {
|
|
|
5849
6063
|
return __generator(this, function (_c) {
|
|
5850
6064
|
switch (_c.label) {
|
|
5851
6065
|
case 0:
|
|
5852
|
-
|
|
6066
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_DEBUG &&
|
|
6067
|
+
this.params.logger.debug("ClientState stateName=".concat(this.params.stateName, " clientId=").concat(this.params.clientId, " shared=").concat(this.params.shared, " waitForInit"));
|
|
5853
6068
|
_a = this;
|
|
5854
6069
|
return [4 /*yield*/, this.params.getState(this.params.clientId, this.params.stateName)];
|
|
5855
6070
|
case 1:
|
|
5856
6071
|
_a._state = _c.sent();
|
|
5857
|
-
|
|
6072
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_DEBUG &&
|
|
6073
|
+
this.params.logger.debug("ClientState stateName=".concat(this.params.stateName, " clientId=").concat(this.params.clientId, " shared=").concat(this.params.shared, " waitForInit output"), { initialState: this._state });
|
|
5858
6074
|
if ((_b = this.params.callbacks) === null || _b === void 0 ? void 0 : _b.onLoad) {
|
|
5859
6075
|
this.params.callbacks.onLoad(this._state, this.params.clientId, this.params.stateName);
|
|
5860
6076
|
}
|
|
@@ -5873,7 +6089,8 @@ var ClientState = /** @class */ (function () {
|
|
|
5873
6089
|
return __generator(this, function (_b) {
|
|
5874
6090
|
switch (_b.label) {
|
|
5875
6091
|
case 0:
|
|
5876
|
-
|
|
6092
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_DEBUG &&
|
|
6093
|
+
this.params.logger.debug("ClientState stateName=".concat(this.params.stateName, " clientId=").concat(this.params.clientId, " shared=").concat(this.params.shared, " setState"));
|
|
5877
6094
|
return [4 /*yield*/, this.dispatch("write", function (currentState) { return __awaiter(_this, void 0, void 0, function () {
|
|
5878
6095
|
var _a, _b, middleware, e_1_1;
|
|
5879
6096
|
var e_1, _c;
|
|
@@ -5911,7 +6128,8 @@ var ClientState = /** @class */ (function () {
|
|
|
5911
6128
|
}); })];
|
|
5912
6129
|
case 1:
|
|
5913
6130
|
_b.sent();
|
|
5914
|
-
|
|
6131
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_DEBUG &&
|
|
6132
|
+
this.params.logger.debug("ClientState stateName=".concat(this.params.stateName, " clientId=").concat(this.params.clientId, " shared=").concat(this.params.shared, " setState output"), { pendingState: this._state });
|
|
5915
6133
|
this.params.setState &&
|
|
5916
6134
|
this.params.setState(this._state, this.params.clientId, this.params.stateName);
|
|
5917
6135
|
if ((_a = this.params.callbacks) === null || _a === void 0 ? void 0 : _a.onWrite) {
|
|
@@ -5944,7 +6162,8 @@ var ClientState = /** @class */ (function () {
|
|
|
5944
6162
|
return __generator(this, function (_b) {
|
|
5945
6163
|
switch (_b.label) {
|
|
5946
6164
|
case 0:
|
|
5947
|
-
|
|
6165
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_DEBUG &&
|
|
6166
|
+
this.params.logger.debug("ClientState stateName=".concat(this.params.stateName, " clientId=").concat(this.params.clientId, " shared=").concat(this.params.shared, " getState"));
|
|
5948
6167
|
return [4 /*yield*/, this.dispatch("read")];
|
|
5949
6168
|
case 1:
|
|
5950
6169
|
_b.sent();
|
|
@@ -5976,16 +6195,18 @@ var ClientState = /** @class */ (function () {
|
|
|
5976
6195
|
this.dispose = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
5977
6196
|
var _a;
|
|
5978
6197
|
return __generator(this, function (_b) {
|
|
5979
|
-
|
|
6198
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_DEBUG &&
|
|
6199
|
+
this.params.logger.debug("ClientState stateName=".concat(this.params.stateName, " clientId=").concat(this.params.clientId, " shared=").concat(this.params.shared, " dispose"));
|
|
5980
6200
|
if ((_a = this.params.callbacks) === null || _a === void 0 ? void 0 : _a.onDispose) {
|
|
5981
6201
|
this.params.callbacks.onDispose(this.params.clientId, this.params.stateName);
|
|
5982
6202
|
}
|
|
5983
6203
|
return [2 /*return*/];
|
|
5984
6204
|
});
|
|
5985
6205
|
}); };
|
|
5986
|
-
|
|
5987
|
-
params
|
|
5988
|
-
|
|
6206
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_DEBUG &&
|
|
6207
|
+
this.params.logger.debug("ClientState stateName=".concat(this.params.stateName, " clientId=").concat(this.params.clientId, " shared=").concat(this.params.shared, " CTOR"), {
|
|
6208
|
+
params: params,
|
|
6209
|
+
});
|
|
5989
6210
|
if ((_a = this.params.callbacks) === null || _a === void 0 ? void 0 : _a.onInit) {
|
|
5990
6211
|
this.params.callbacks.onInit(this.params.clientId, this.params.stateName);
|
|
5991
6212
|
}
|
|
@@ -6094,7 +6315,8 @@ var StateConnectionService = /** @class */ (function () {
|
|
|
6094
6315
|
return __generator(this, function (_a) {
|
|
6095
6316
|
switch (_a.label) {
|
|
6096
6317
|
case 0:
|
|
6097
|
-
|
|
6318
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
6319
|
+
this.loggerService.info("stateConnectionService setState");
|
|
6098
6320
|
state = this.getStateRef(this.methodContextService.context.clientId, this.methodContextService.context.stateName);
|
|
6099
6321
|
return [4 /*yield*/, state.waitForInit()];
|
|
6100
6322
|
case 1:
|
|
@@ -6113,7 +6335,8 @@ var StateConnectionService = /** @class */ (function () {
|
|
|
6113
6335
|
return __generator(this, function (_a) {
|
|
6114
6336
|
switch (_a.label) {
|
|
6115
6337
|
case 0:
|
|
6116
|
-
|
|
6338
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
6339
|
+
this.loggerService.info("stateConnectionService getState");
|
|
6117
6340
|
state = this.getStateRef(this.methodContextService.context.clientId, this.methodContextService.context.stateName);
|
|
6118
6341
|
return [4 /*yield*/, state.waitForInit()];
|
|
6119
6342
|
case 1:
|
|
@@ -6132,7 +6355,8 @@ var StateConnectionService = /** @class */ (function () {
|
|
|
6132
6355
|
return __generator(this, function (_a) {
|
|
6133
6356
|
switch (_a.label) {
|
|
6134
6357
|
case 0:
|
|
6135
|
-
|
|
6358
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
6359
|
+
this.loggerService.info("stateConnectionService dispose");
|
|
6136
6360
|
key = "".concat(this.methodContextService.context.clientId, "-").concat(this.methodContextService.context.stateName);
|
|
6137
6361
|
if (!this.getStateRef.has(key)) {
|
|
6138
6362
|
return [2 /*return*/];
|
|
@@ -6174,11 +6398,12 @@ var StatePublicService = /** @class */ (function () {
|
|
|
6174
6398
|
return __generator(this, function (_a) {
|
|
6175
6399
|
switch (_a.label) {
|
|
6176
6400
|
case 0:
|
|
6177
|
-
|
|
6178
|
-
|
|
6179
|
-
|
|
6180
|
-
|
|
6181
|
-
|
|
6401
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
6402
|
+
this.loggerService.info("statePublicService setState", {
|
|
6403
|
+
methodName: methodName,
|
|
6404
|
+
clientId: clientId,
|
|
6405
|
+
stateName: stateName,
|
|
6406
|
+
});
|
|
6182
6407
|
return [4 /*yield*/, MethodContextService.runInContext(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
6183
6408
|
return __generator(this, function (_a) {
|
|
6184
6409
|
switch (_a.label) {
|
|
@@ -6209,10 +6434,11 @@ var StatePublicService = /** @class */ (function () {
|
|
|
6209
6434
|
return __generator(this, function (_a) {
|
|
6210
6435
|
switch (_a.label) {
|
|
6211
6436
|
case 0:
|
|
6212
|
-
|
|
6213
|
-
|
|
6214
|
-
|
|
6215
|
-
|
|
6437
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
6438
|
+
this.loggerService.info("statePublicService getState", {
|
|
6439
|
+
clientId: clientId,
|
|
6440
|
+
stateName: stateName,
|
|
6441
|
+
});
|
|
6216
6442
|
return [4 /*yield*/, MethodContextService.runInContext(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
6217
6443
|
return __generator(this, function (_a) {
|
|
6218
6444
|
switch (_a.label) {
|
|
@@ -6243,11 +6469,12 @@ var StatePublicService = /** @class */ (function () {
|
|
|
6243
6469
|
return __generator(this, function (_a) {
|
|
6244
6470
|
switch (_a.label) {
|
|
6245
6471
|
case 0:
|
|
6246
|
-
|
|
6247
|
-
|
|
6248
|
-
|
|
6249
|
-
|
|
6250
|
-
|
|
6472
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
6473
|
+
this.loggerService.info("statePublicService dispose", {
|
|
6474
|
+
methodName: methodName,
|
|
6475
|
+
clientId: clientId,
|
|
6476
|
+
stateName: stateName,
|
|
6477
|
+
});
|
|
6251
6478
|
return [4 /*yield*/, MethodContextService.runInContext(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
6252
6479
|
return __generator(this, function (_a) {
|
|
6253
6480
|
switch (_a.label) {
|
|
@@ -6289,10 +6516,11 @@ var BusService = /** @class */ (function () {
|
|
|
6289
6516
|
* @param {(event: T) => void} fn - The callback function to handle the event.
|
|
6290
6517
|
*/
|
|
6291
6518
|
this.subscribe = function (clientId, source, fn) {
|
|
6292
|
-
|
|
6293
|
-
|
|
6294
|
-
|
|
6295
|
-
|
|
6519
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
6520
|
+
_this.loggerService.info("busService subscribe", {
|
|
6521
|
+
clientId: clientId,
|
|
6522
|
+
source: source,
|
|
6523
|
+
});
|
|
6296
6524
|
if (clientId === "*") {
|
|
6297
6525
|
_this._eventWildcardMap.set(source, true);
|
|
6298
6526
|
}
|
|
@@ -6308,10 +6536,11 @@ var BusService = /** @class */ (function () {
|
|
|
6308
6536
|
* @returns {Subscription} The subscription object.
|
|
6309
6537
|
*/
|
|
6310
6538
|
this.once = function (clientId, source, filterFn, fn) {
|
|
6311
|
-
|
|
6312
|
-
|
|
6313
|
-
|
|
6314
|
-
|
|
6539
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
6540
|
+
_this.loggerService.info("busService once", {
|
|
6541
|
+
clientId: clientId,
|
|
6542
|
+
source: source,
|
|
6543
|
+
});
|
|
6315
6544
|
if (clientId === "*") {
|
|
6316
6545
|
_this._eventWildcardMap.set(source, true);
|
|
6317
6546
|
}
|
|
@@ -6328,10 +6557,11 @@ var BusService = /** @class */ (function () {
|
|
|
6328
6557
|
return __generator(this, function (_a) {
|
|
6329
6558
|
switch (_a.label) {
|
|
6330
6559
|
case 0:
|
|
6331
|
-
|
|
6332
|
-
|
|
6333
|
-
|
|
6334
|
-
|
|
6560
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
6561
|
+
this.loggerService.info("busService emit", {
|
|
6562
|
+
clientId: clientId,
|
|
6563
|
+
event: event,
|
|
6564
|
+
});
|
|
6335
6565
|
if (!this.sessionValidationService.hasSession(clientId)) {
|
|
6336
6566
|
return [2 /*return*/];
|
|
6337
6567
|
}
|
|
@@ -6356,9 +6586,10 @@ var BusService = /** @class */ (function () {
|
|
|
6356
6586
|
*/
|
|
6357
6587
|
this.dispose = function (clientId) {
|
|
6358
6588
|
var e_1, _a;
|
|
6359
|
-
|
|
6360
|
-
|
|
6361
|
-
|
|
6589
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
6590
|
+
_this.loggerService.info("busService dispose", {
|
|
6591
|
+
clientId: clientId,
|
|
6592
|
+
});
|
|
6362
6593
|
try {
|
|
6363
6594
|
for (var _b = __values(_this._eventSourceSet), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
6364
6595
|
var source = _c.value;
|
|
@@ -6482,9 +6713,10 @@ init();
|
|
|
6482
6713
|
* @returns {string} The name of the added agent.
|
|
6483
6714
|
*/
|
|
6484
6715
|
var addAgent = function (agentSchema) {
|
|
6485
|
-
|
|
6486
|
-
|
|
6487
|
-
|
|
6716
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
|
|
6717
|
+
swarm.loggerService.log("function addAgent", {
|
|
6718
|
+
agentSchema: agentSchema,
|
|
6719
|
+
});
|
|
6488
6720
|
swarm.agentValidationService.addAgent(agentSchema.agentName, agentSchema);
|
|
6489
6721
|
swarm.agentSchemaService.register(agentSchema.agentName, agentSchema);
|
|
6490
6722
|
return agentSchema.agentName;
|
|
@@ -6498,9 +6730,10 @@ var addAgent = function (agentSchema) {
|
|
|
6498
6730
|
* @returns {string} The name of the completion that was added.
|
|
6499
6731
|
*/
|
|
6500
6732
|
var addCompletion = function (completionSchema) {
|
|
6501
|
-
|
|
6502
|
-
|
|
6503
|
-
|
|
6733
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
|
|
6734
|
+
swarm.loggerService.log("function addCompletion", {
|
|
6735
|
+
completionSchema: completionSchema,
|
|
6736
|
+
});
|
|
6504
6737
|
swarm.completionValidationService.addCompletion(completionSchema.completionName);
|
|
6505
6738
|
swarm.completionSchemaService.register(completionSchema.completionName, completionSchema);
|
|
6506
6739
|
return completionSchema.completionName;
|
|
@@ -6513,9 +6746,10 @@ var addCompletion = function (completionSchema) {
|
|
|
6513
6746
|
* @returns {string} The name of the added swarm.
|
|
6514
6747
|
*/
|
|
6515
6748
|
var addSwarm = function (swarmSchema) {
|
|
6516
|
-
|
|
6517
|
-
|
|
6518
|
-
|
|
6749
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
|
|
6750
|
+
swarm.loggerService.log("function addSwarm", {
|
|
6751
|
+
swarmSchema: swarmSchema,
|
|
6752
|
+
});
|
|
6519
6753
|
swarm.swarmValidationService.addSwarm(swarmSchema.swarmName, swarmSchema);
|
|
6520
6754
|
swarm.swarmSchemaService.register(swarmSchema.swarmName, swarmSchema);
|
|
6521
6755
|
return swarmSchema.swarmName;
|
|
@@ -6529,9 +6763,10 @@ var addSwarm = function (swarmSchema) {
|
|
|
6529
6763
|
* @returns {string} The name of the tool that was added.
|
|
6530
6764
|
*/
|
|
6531
6765
|
var addTool = function (toolSchema) {
|
|
6532
|
-
|
|
6533
|
-
|
|
6534
|
-
|
|
6766
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
|
|
6767
|
+
swarm.loggerService.log("function addTool", {
|
|
6768
|
+
toolSchema: toolSchema,
|
|
6769
|
+
});
|
|
6535
6770
|
swarm.toolValidationService.addTool(toolSchema.toolName, toolSchema);
|
|
6536
6771
|
swarm.toolSchemaService.register(toolSchema.toolName, toolSchema);
|
|
6537
6772
|
return toolSchema.toolName;
|
|
@@ -6544,9 +6779,10 @@ var addTool = function (toolSchema) {
|
|
|
6544
6779
|
* @returns {string} The name of the added state.
|
|
6545
6780
|
*/
|
|
6546
6781
|
var addState = function (stateSchema) {
|
|
6547
|
-
|
|
6548
|
-
|
|
6549
|
-
|
|
6782
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
|
|
6783
|
+
swarm.loggerService.log("function addState", {
|
|
6784
|
+
stateSchema: stateSchema,
|
|
6785
|
+
});
|
|
6550
6786
|
swarm.stateSchemaService.register(stateSchema.stateName, stateSchema);
|
|
6551
6787
|
if (stateSchema.shared) {
|
|
6552
6788
|
swarm.stateConnectionService
|
|
@@ -6563,9 +6799,10 @@ var addState = function (stateSchema) {
|
|
|
6563
6799
|
* @returns {string} The name of the added embedding.
|
|
6564
6800
|
*/
|
|
6565
6801
|
var addEmbedding = function (embeddingSchema) {
|
|
6566
|
-
|
|
6567
|
-
|
|
6568
|
-
|
|
6802
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
|
|
6803
|
+
swarm.loggerService.log("function addEmbedding", {
|
|
6804
|
+
embeddingSchema: embeddingSchema,
|
|
6805
|
+
});
|
|
6569
6806
|
swarm.embeddingValidationService.addEmbedding(embeddingSchema.embeddingName, embeddingSchema);
|
|
6570
6807
|
swarm.embeddingSchemaService.register(embeddingSchema.embeddingName, embeddingSchema);
|
|
6571
6808
|
return embeddingSchema.embeddingName;
|
|
@@ -6578,9 +6815,10 @@ var addEmbedding = function (embeddingSchema) {
|
|
|
6578
6815
|
* @returns {string} The name of the added storage.
|
|
6579
6816
|
*/
|
|
6580
6817
|
var addStorage = function (storageSchema) {
|
|
6581
|
-
|
|
6582
|
-
|
|
6583
|
-
|
|
6818
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
|
|
6819
|
+
swarm.loggerService.log("function addStorage", {
|
|
6820
|
+
storageSchema: storageSchema,
|
|
6821
|
+
});
|
|
6584
6822
|
swarm.storageValidationService.addStorage(storageSchema.storageName, storageSchema);
|
|
6585
6823
|
swarm.storageSchemaService.register(storageSchema.storageName, storageSchema);
|
|
6586
6824
|
if (storageSchema.shared) {
|
|
@@ -6604,12 +6842,13 @@ var commitUserMessage = function (content, clientId, agentName) { return __await
|
|
|
6604
6842
|
return __generator(this, function (_a) {
|
|
6605
6843
|
switch (_a.label) {
|
|
6606
6844
|
case 0:
|
|
6607
|
-
methodName =
|
|
6608
|
-
|
|
6609
|
-
|
|
6610
|
-
|
|
6611
|
-
|
|
6612
|
-
|
|
6845
|
+
methodName = "function commitSystemMessage";
|
|
6846
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
|
|
6847
|
+
swarm.loggerService.log("function commitSystemMessage", {
|
|
6848
|
+
content: content,
|
|
6849
|
+
clientId: clientId,
|
|
6850
|
+
agentName: agentName,
|
|
6851
|
+
});
|
|
6613
6852
|
swarm.agentValidationService.validate(agentName, "commitUserMessage");
|
|
6614
6853
|
swarm.sessionValidationService.validate(clientId, "commitUserMessage");
|
|
6615
6854
|
swarmName = swarm.sessionValidationService.getSwarm(clientId);
|
|
@@ -6618,11 +6857,12 @@ var commitUserMessage = function (content, clientId, agentName) { return __await
|
|
|
6618
6857
|
case 1:
|
|
6619
6858
|
currentAgentName = _a.sent();
|
|
6620
6859
|
if (currentAgentName !== agentName) {
|
|
6621
|
-
|
|
6622
|
-
|
|
6623
|
-
|
|
6624
|
-
|
|
6625
|
-
|
|
6860
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
|
|
6861
|
+
swarm.loggerService.log('function "commitUserMessage" skipped due to the agent change', {
|
|
6862
|
+
currentAgentName: currentAgentName,
|
|
6863
|
+
agentName: agentName,
|
|
6864
|
+
clientId: clientId,
|
|
6865
|
+
});
|
|
6626
6866
|
return [2 /*return*/];
|
|
6627
6867
|
}
|
|
6628
6868
|
return [4 /*yield*/, swarm.sessionPublicService.commitUserMessage(content, methodName, clientId, swarmName)];
|
|
@@ -6646,9 +6886,10 @@ var getAgentName = function (clientId) { return __awaiter(void 0, void 0, void 0
|
|
|
6646
6886
|
switch (_a.label) {
|
|
6647
6887
|
case 0:
|
|
6648
6888
|
methodName = "function getAgentName";
|
|
6649
|
-
|
|
6650
|
-
|
|
6651
|
-
|
|
6889
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
|
|
6890
|
+
swarm.loggerService.log("function getAgentName", {
|
|
6891
|
+
clientId: clientId,
|
|
6892
|
+
});
|
|
6652
6893
|
swarm.sessionValidationService.validate(clientId, "getAgentName");
|
|
6653
6894
|
swarmName = swarm.sessionValidationService.getSwarm(clientId);
|
|
6654
6895
|
swarm.swarmValidationService.validate(swarmName, "getAgentName");
|
|
@@ -6669,10 +6910,11 @@ var SCHEDULED_DELAY$1 = 1000;
|
|
|
6669
6910
|
*/
|
|
6670
6911
|
var makeConnection = function (connector, clientId, swarmName) {
|
|
6671
6912
|
var methodName = "function makeConnection";
|
|
6672
|
-
|
|
6673
|
-
|
|
6674
|
-
|
|
6675
|
-
|
|
6913
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
|
|
6914
|
+
swarm.loggerService.log("function makeConnection", {
|
|
6915
|
+
clientId: clientId,
|
|
6916
|
+
swarmName: swarmName,
|
|
6917
|
+
});
|
|
6676
6918
|
swarm.swarmValidationService.validate(swarmName, "makeConnection");
|
|
6677
6919
|
swarm.sessionValidationService.addSession(clientId, swarmName, "makeConnection");
|
|
6678
6920
|
var send = swarm.sessionPublicService.connect(connector, methodName, clientId, swarmName);
|
|
@@ -6866,10 +7108,11 @@ var changeAgent = function (agentName, clientId) { return __awaiter(void 0, void
|
|
|
6866
7108
|
switch (_a.label) {
|
|
6867
7109
|
case 0:
|
|
6868
7110
|
methodName = "function changeAgent";
|
|
6869
|
-
|
|
6870
|
-
|
|
6871
|
-
|
|
6872
|
-
|
|
7111
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
|
|
7112
|
+
swarm.loggerService.log("function changeAgent", {
|
|
7113
|
+
agentName: agentName,
|
|
7114
|
+
clientId: clientId,
|
|
7115
|
+
});
|
|
6873
7116
|
return [4 /*yield*/, createChangeAgent(clientId)];
|
|
6874
7117
|
case 1:
|
|
6875
7118
|
run = _a.sent();
|
|
@@ -6897,10 +7140,11 @@ var disposeConnection = function (clientId_1, swarmName_1) {
|
|
|
6897
7140
|
return __generator(this, function (_a) {
|
|
6898
7141
|
switch (_a.label) {
|
|
6899
7142
|
case 0:
|
|
6900
|
-
|
|
6901
|
-
|
|
6902
|
-
|
|
6903
|
-
|
|
7143
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
|
|
7144
|
+
swarm.loggerService.log("function disposeConnection", {
|
|
7145
|
+
clientId: clientId,
|
|
7146
|
+
swarmName: swarmName,
|
|
7147
|
+
});
|
|
6904
7148
|
swarm.swarmValidationService.validate(swarmName, "disposeConnection");
|
|
6905
7149
|
swarm.sessionValidationService.removeSession(clientId);
|
|
6906
7150
|
swarm.busService.dispose(clientId);
|
|
@@ -7031,12 +7275,13 @@ var complete = function (content, clientId, swarmName) { return __awaiter(void 0
|
|
|
7031
7275
|
case 0:
|
|
7032
7276
|
methodName = "function complete";
|
|
7033
7277
|
executionId = randomString();
|
|
7034
|
-
|
|
7035
|
-
|
|
7036
|
-
|
|
7037
|
-
|
|
7038
|
-
|
|
7039
|
-
|
|
7278
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
|
|
7279
|
+
swarm.loggerService.log("function complete", {
|
|
7280
|
+
content: content,
|
|
7281
|
+
clientId: clientId,
|
|
7282
|
+
executionId: executionId,
|
|
7283
|
+
swarmName: swarmName,
|
|
7284
|
+
});
|
|
7040
7285
|
return [4 /*yield*/, createComplete(clientId, swarmName)];
|
|
7041
7286
|
case 1:
|
|
7042
7287
|
run = _a.sent();
|
|
@@ -7069,11 +7314,12 @@ var SCHEDULED_DELAY = 1000;
|
|
|
7069
7314
|
var session = function (clientId, swarmName) {
|
|
7070
7315
|
var methodName = "function session";
|
|
7071
7316
|
var executionId = randomString();
|
|
7072
|
-
|
|
7073
|
-
|
|
7074
|
-
|
|
7075
|
-
|
|
7076
|
-
|
|
7317
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
|
|
7318
|
+
swarm.loggerService.log("function session", {
|
|
7319
|
+
clientId: clientId,
|
|
7320
|
+
swarmName: swarmName,
|
|
7321
|
+
executionId: executionId,
|
|
7322
|
+
});
|
|
7077
7323
|
swarm.swarmValidationService.validate(swarmName, "session");
|
|
7078
7324
|
swarm.sessionValidationService.addSession(clientId, swarmName, "session");
|
|
7079
7325
|
return {
|
|
@@ -7223,9 +7469,10 @@ var getRawHistory = function (clientId_1) {
|
|
|
7223
7469
|
return __generator(this, function (_a) {
|
|
7224
7470
|
switch (_a.label) {
|
|
7225
7471
|
case 0:
|
|
7226
|
-
|
|
7227
|
-
|
|
7228
|
-
|
|
7472
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
|
|
7473
|
+
swarm.loggerService.log("function getRawHistory", {
|
|
7474
|
+
clientId: clientId,
|
|
7475
|
+
});
|
|
7229
7476
|
swarm.sessionValidationService.validate(clientId, "getRawHistory");
|
|
7230
7477
|
swarmName = swarm.sessionValidationService.getSwarm(clientId);
|
|
7231
7478
|
swarm.swarmValidationService.validate(swarmName, "getRawHistory");
|
|
@@ -7254,10 +7501,11 @@ var getAgentHistory = function (clientId, agentName) { return __awaiter(void 0,
|
|
|
7254
7501
|
switch (_a.label) {
|
|
7255
7502
|
case 0:
|
|
7256
7503
|
methodName = "function getAgentHistory";
|
|
7257
|
-
|
|
7258
|
-
|
|
7259
|
-
|
|
7260
|
-
|
|
7504
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
|
|
7505
|
+
swarm.loggerService.log("function getAgentHistory", {
|
|
7506
|
+
clientId: clientId,
|
|
7507
|
+
agentName: agentName,
|
|
7508
|
+
});
|
|
7261
7509
|
swarm.agentValidationService.validate(agentName, "getAgentHistory");
|
|
7262
7510
|
prompt = swarm.agentSchemaService.get(agentName).prompt;
|
|
7263
7511
|
return [4 /*yield*/, swarm.historyPublicService.toArrayForAgent(prompt, methodName, clientId, agentName)];
|
|
@@ -7276,9 +7524,10 @@ var getAgentHistory = function (clientId, agentName) { return __awaiter(void 0,
|
|
|
7276
7524
|
var getSessionMode = function (clientId) { return __awaiter(void 0, void 0, void 0, function () {
|
|
7277
7525
|
var swarmName;
|
|
7278
7526
|
return __generator(this, function (_a) {
|
|
7279
|
-
|
|
7280
|
-
|
|
7281
|
-
|
|
7527
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
|
|
7528
|
+
swarm.loggerService.log("function getSessionMode", {
|
|
7529
|
+
clientId: clientId,
|
|
7530
|
+
});
|
|
7282
7531
|
swarmName = swarm.sessionValidationService.getSwarm(clientId);
|
|
7283
7532
|
swarm.swarmValidationService.validate(swarmName, "getSessionMode");
|
|
7284
7533
|
return [2 /*return*/, swarm.sessionValidationService.getSessionMode(clientId)];
|
|
@@ -7298,14 +7547,15 @@ var commitToolOutput = function (toolId, content, clientId, agentName) { return
|
|
|
7298
7547
|
return __generator(this, function (_a) {
|
|
7299
7548
|
switch (_a.label) {
|
|
7300
7549
|
case 0:
|
|
7301
|
-
methodName =
|
|
7302
|
-
|
|
7303
|
-
|
|
7304
|
-
|
|
7305
|
-
|
|
7306
|
-
|
|
7307
|
-
|
|
7308
|
-
|
|
7550
|
+
methodName = "function commitToolOutput";
|
|
7551
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
|
|
7552
|
+
swarm.loggerService.log("function commitToolOutput", {
|
|
7553
|
+
toolId: toolId,
|
|
7554
|
+
content: content,
|
|
7555
|
+
clientId: clientId,
|
|
7556
|
+
agentName: agentName,
|
|
7557
|
+
methodName: methodName,
|
|
7558
|
+
});
|
|
7309
7559
|
swarm.agentValidationService.validate(agentName, "commitSystemMessage");
|
|
7310
7560
|
swarm.sessionValidationService.validate(clientId, "commitToolOutput");
|
|
7311
7561
|
swarmName = swarm.sessionValidationService.getSwarm(clientId);
|
|
@@ -7314,12 +7564,13 @@ var commitToolOutput = function (toolId, content, clientId, agentName) { return
|
|
|
7314
7564
|
case 1:
|
|
7315
7565
|
currentAgentName = _a.sent();
|
|
7316
7566
|
if (currentAgentName !== agentName) {
|
|
7317
|
-
|
|
7318
|
-
|
|
7319
|
-
|
|
7320
|
-
|
|
7321
|
-
|
|
7322
|
-
|
|
7567
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
|
|
7568
|
+
swarm.loggerService.log('function "commitToolOutput" skipped due to the agent change', {
|
|
7569
|
+
toolId: toolId,
|
|
7570
|
+
currentAgentName: currentAgentName,
|
|
7571
|
+
agentName: agentName,
|
|
7572
|
+
clientId: clientId,
|
|
7573
|
+
});
|
|
7323
7574
|
return [2 /*return*/];
|
|
7324
7575
|
}
|
|
7325
7576
|
return [4 /*yield*/, swarm.sessionPublicService.commitToolOutput(toolId, content, methodName, clientId, swarmName)];
|
|
@@ -7331,7 +7582,7 @@ var commitToolOutput = function (toolId, content, clientId, agentName) { return
|
|
|
7331
7582
|
}); };
|
|
7332
7583
|
|
|
7333
7584
|
/**
|
|
7334
|
-
* Commits a system message to the active agent in
|
|
7585
|
+
* Commits a system message to the active agent in the swarm.
|
|
7335
7586
|
*
|
|
7336
7587
|
* @param {string} content - The content of the system message.
|
|
7337
7588
|
* @param {string} clientId - The ID of the client.
|
|
@@ -7343,12 +7594,13 @@ var commitSystemMessage = function (content, clientId, agentName) { return __awa
|
|
|
7343
7594
|
return __generator(this, function (_a) {
|
|
7344
7595
|
switch (_a.label) {
|
|
7345
7596
|
case 0:
|
|
7346
|
-
methodName =
|
|
7347
|
-
|
|
7348
|
-
|
|
7349
|
-
|
|
7350
|
-
|
|
7351
|
-
|
|
7597
|
+
methodName = "function commitSystemMessage";
|
|
7598
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
|
|
7599
|
+
swarm.loggerService.log("function commitSystemMessage", {
|
|
7600
|
+
content: content,
|
|
7601
|
+
clientId: clientId,
|
|
7602
|
+
agentName: agentName,
|
|
7603
|
+
});
|
|
7352
7604
|
swarm.agentValidationService.validate(agentName, "commitSystemMessage");
|
|
7353
7605
|
swarm.sessionValidationService.validate(clientId, "commitSystemMessage");
|
|
7354
7606
|
swarmName = swarm.sessionValidationService.getSwarm(clientId);
|
|
@@ -7357,11 +7609,12 @@ var commitSystemMessage = function (content, clientId, agentName) { return __awa
|
|
|
7357
7609
|
case 1:
|
|
7358
7610
|
currentAgentName = _a.sent();
|
|
7359
7611
|
if (currentAgentName !== agentName) {
|
|
7360
|
-
|
|
7361
|
-
|
|
7362
|
-
|
|
7363
|
-
|
|
7364
|
-
|
|
7612
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
|
|
7613
|
+
swarm.loggerService.log('function "commitSystemMessage" skipped due to the agent change', {
|
|
7614
|
+
currentAgentName: currentAgentName,
|
|
7615
|
+
agentName: agentName,
|
|
7616
|
+
clientId: clientId,
|
|
7617
|
+
});
|
|
7365
7618
|
return [2 /*return*/];
|
|
7366
7619
|
}
|
|
7367
7620
|
return [4 /*yield*/, swarm.sessionPublicService.commitSystemMessage(content, methodName, clientId, swarmName)];
|
|
@@ -7384,11 +7637,12 @@ var commitFlush = function (clientId, agentName) { return __awaiter(void 0, void
|
|
|
7384
7637
|
return __generator(this, function (_a) {
|
|
7385
7638
|
switch (_a.label) {
|
|
7386
7639
|
case 0:
|
|
7387
|
-
methodName =
|
|
7388
|
-
|
|
7389
|
-
|
|
7390
|
-
|
|
7391
|
-
|
|
7640
|
+
methodName = "function commitFlush";
|
|
7641
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
|
|
7642
|
+
swarm.loggerService.log("function commitFlush", {
|
|
7643
|
+
clientId: clientId,
|
|
7644
|
+
agentName: agentName,
|
|
7645
|
+
});
|
|
7392
7646
|
swarm.agentValidationService.validate(agentName, "commitFlush");
|
|
7393
7647
|
swarm.sessionValidationService.validate(clientId, "commitFlush");
|
|
7394
7648
|
swarmName = swarm.sessionValidationService.getSwarm(clientId);
|
|
@@ -7397,11 +7651,12 @@ var commitFlush = function (clientId, agentName) { return __awaiter(void 0, void
|
|
|
7397
7651
|
case 1:
|
|
7398
7652
|
currentAgentName = _a.sent();
|
|
7399
7653
|
if (currentAgentName !== agentName) {
|
|
7400
|
-
|
|
7401
|
-
|
|
7402
|
-
|
|
7403
|
-
|
|
7404
|
-
|
|
7654
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
|
|
7655
|
+
swarm.loggerService.log('function "commitFlush" skipped due to the agent change', {
|
|
7656
|
+
currentAgentName: currentAgentName,
|
|
7657
|
+
agentName: agentName,
|
|
7658
|
+
clientId: clientId,
|
|
7659
|
+
});
|
|
7405
7660
|
return [2 /*return*/];
|
|
7406
7661
|
}
|
|
7407
7662
|
return [4 /*yield*/, swarm.sessionPublicService.commitFlush(methodName, clientId, swarmName)];
|
|
@@ -7428,13 +7683,14 @@ var execute = function (content, clientId, agentName) { return __awaiter(void 0,
|
|
|
7428
7683
|
case 0:
|
|
7429
7684
|
methodName = "function execute";
|
|
7430
7685
|
executionId = randomString();
|
|
7431
|
-
|
|
7432
|
-
|
|
7433
|
-
|
|
7434
|
-
|
|
7435
|
-
|
|
7436
|
-
|
|
7437
|
-
|
|
7686
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
|
|
7687
|
+
swarm.loggerService.log("function execute", {
|
|
7688
|
+
content: content,
|
|
7689
|
+
clientId: clientId,
|
|
7690
|
+
agentName: agentName,
|
|
7691
|
+
methodName: methodName,
|
|
7692
|
+
executionId: executionId,
|
|
7693
|
+
});
|
|
7438
7694
|
swarm.agentValidationService.validate(agentName, "execute");
|
|
7439
7695
|
swarm.sessionValidationService.validate(clientId, "execute");
|
|
7440
7696
|
swarmName = swarm.sessionValidationService.getSwarm(clientId);
|
|
@@ -7443,11 +7699,12 @@ var execute = function (content, clientId, agentName) { return __awaiter(void 0,
|
|
|
7443
7699
|
case 1:
|
|
7444
7700
|
currentAgentName = _a.sent();
|
|
7445
7701
|
if (currentAgentName !== agentName) {
|
|
7446
|
-
|
|
7447
|
-
|
|
7448
|
-
|
|
7449
|
-
|
|
7450
|
-
|
|
7702
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
|
|
7703
|
+
swarm.loggerService.log('function "execute" skipped due to the agent change', {
|
|
7704
|
+
currentAgentName: currentAgentName,
|
|
7705
|
+
agentName: agentName,
|
|
7706
|
+
clientId: clientId,
|
|
7707
|
+
});
|
|
7451
7708
|
return [2 /*return*/];
|
|
7452
7709
|
}
|
|
7453
7710
|
return [2 /*return*/, ExecutionContextService.runInContext(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -7481,11 +7738,12 @@ var emit = function (content, clientId, agentName) { return __awaiter(void 0, vo
|
|
|
7481
7738
|
switch (_a.label) {
|
|
7482
7739
|
case 0:
|
|
7483
7740
|
methodName = "function emit";
|
|
7484
|
-
|
|
7485
|
-
|
|
7486
|
-
|
|
7487
|
-
|
|
7488
|
-
|
|
7741
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
|
|
7742
|
+
swarm.loggerService.log("function emit", {
|
|
7743
|
+
content: content,
|
|
7744
|
+
clientId: clientId,
|
|
7745
|
+
agentName: agentName,
|
|
7746
|
+
});
|
|
7489
7747
|
if (swarm.sessionValidationService.getSessionMode(clientId) !== "makeConnection") {
|
|
7490
7748
|
throw new Error("agent-swarm-kit emit session is not makeConnection clientId=".concat(clientId));
|
|
7491
7749
|
}
|
|
@@ -7497,11 +7755,12 @@ var emit = function (content, clientId, agentName) { return __awaiter(void 0, vo
|
|
|
7497
7755
|
case 1:
|
|
7498
7756
|
currentAgentName = _a.sent();
|
|
7499
7757
|
if (currentAgentName !== agentName) {
|
|
7500
|
-
|
|
7501
|
-
|
|
7502
|
-
|
|
7503
|
-
|
|
7504
|
-
|
|
7758
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
|
|
7759
|
+
swarm.loggerService.log('function "emit" skipped due to the agent change', {
|
|
7760
|
+
currentAgentName: currentAgentName,
|
|
7761
|
+
agentName: agentName,
|
|
7762
|
+
clientId: clientId,
|
|
7763
|
+
});
|
|
7505
7764
|
return [2 /*return*/];
|
|
7506
7765
|
}
|
|
7507
7766
|
return [4 /*yield*/, swarm.sessionPublicService.emit(content, methodName, clientId, swarmName)];
|
|
@@ -7522,12 +7781,13 @@ var commitToolOutputForce = function (toolId, content, clientId) { return __awai
|
|
|
7522
7781
|
return __generator(this, function (_a) {
|
|
7523
7782
|
switch (_a.label) {
|
|
7524
7783
|
case 0:
|
|
7525
|
-
methodName =
|
|
7526
|
-
|
|
7527
|
-
|
|
7528
|
-
|
|
7529
|
-
|
|
7530
|
-
|
|
7784
|
+
methodName = "function commitToolOutputForce";
|
|
7785
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
|
|
7786
|
+
swarm.loggerService.log("function commitToolOutputForce", {
|
|
7787
|
+
toolId: toolId,
|
|
7788
|
+
content: content,
|
|
7789
|
+
clientId: clientId,
|
|
7790
|
+
});
|
|
7531
7791
|
swarm.sessionValidationService.validate(clientId, "commitToolOutputForce");
|
|
7532
7792
|
swarmName = swarm.sessionValidationService.getSwarm(clientId);
|
|
7533
7793
|
swarm.swarmValidationService.validate(swarmName, "commitToolOutputForce");
|
|
@@ -7551,11 +7811,12 @@ var commitSystemMessageForce = function (content, clientId) { return __awaiter(v
|
|
|
7551
7811
|
return __generator(this, function (_a) {
|
|
7552
7812
|
switch (_a.label) {
|
|
7553
7813
|
case 0:
|
|
7554
|
-
methodName =
|
|
7555
|
-
|
|
7556
|
-
|
|
7557
|
-
|
|
7558
|
-
|
|
7814
|
+
methodName = "function commitSystemMessageForce";
|
|
7815
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
|
|
7816
|
+
swarm.loggerService.log("function commitSystemMessageForce", {
|
|
7817
|
+
content: content,
|
|
7818
|
+
clientId: clientId,
|
|
7819
|
+
});
|
|
7559
7820
|
swarm.sessionValidationService.validate(clientId, "commitSystemMessageForce");
|
|
7560
7821
|
swarmName = swarm.sessionValidationService.getSwarm(clientId);
|
|
7561
7822
|
swarm.swarmValidationService.validate(swarmName, "commitSystemMessageForce");
|
|
@@ -7578,11 +7839,12 @@ var commitFlushForce = function (clientId) { return __awaiter(void 0, void 0, vo
|
|
|
7578
7839
|
return __generator(this, function (_a) {
|
|
7579
7840
|
switch (_a.label) {
|
|
7580
7841
|
case 0:
|
|
7581
|
-
methodName =
|
|
7582
|
-
|
|
7583
|
-
|
|
7584
|
-
|
|
7585
|
-
|
|
7842
|
+
methodName = "function commitFlushForce";
|
|
7843
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
|
|
7844
|
+
swarm.loggerService.log("function commitFlushForce", {
|
|
7845
|
+
clientId: clientId,
|
|
7846
|
+
methodName: methodName,
|
|
7847
|
+
});
|
|
7586
7848
|
swarm.sessionValidationService.validate(clientId, "commitFlushForce");
|
|
7587
7849
|
swarmName = swarm.sessionValidationService.getSwarm(clientId);
|
|
7588
7850
|
swarm.swarmValidationService.validate(swarmName, "commitFlushForce");
|
|
@@ -7606,11 +7868,12 @@ var commitUserMessageForce = function (content, clientId) { return __awaiter(voi
|
|
|
7606
7868
|
return __generator(this, function (_a) {
|
|
7607
7869
|
switch (_a.label) {
|
|
7608
7870
|
case 0:
|
|
7609
|
-
methodName =
|
|
7610
|
-
|
|
7611
|
-
|
|
7612
|
-
|
|
7613
|
-
|
|
7871
|
+
methodName = "function commitSystemMessage";
|
|
7872
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
|
|
7873
|
+
swarm.loggerService.log("function commitSystemMessage", {
|
|
7874
|
+
content: content,
|
|
7875
|
+
clientId: clientId,
|
|
7876
|
+
});
|
|
7614
7877
|
swarm.sessionValidationService.validate(clientId, "commitUserMessageForce");
|
|
7615
7878
|
swarmName = swarm.sessionValidationService.getSwarm(clientId);
|
|
7616
7879
|
swarm.swarmValidationService.validate(swarmName, "commitUserMessageForce");
|
|
@@ -7638,10 +7901,11 @@ var emitForce = function (content, clientId) { return __awaiter(void 0, void 0,
|
|
|
7638
7901
|
switch (_a.label) {
|
|
7639
7902
|
case 0:
|
|
7640
7903
|
methodName = "function emitForce";
|
|
7641
|
-
|
|
7642
|
-
|
|
7643
|
-
|
|
7644
|
-
|
|
7904
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
|
|
7905
|
+
swarm.loggerService.log("function emitForce", {
|
|
7906
|
+
content: content,
|
|
7907
|
+
clientId: clientId,
|
|
7908
|
+
});
|
|
7645
7909
|
if (swarm.sessionValidationService.getSessionMode(clientId) !== "makeConnection") {
|
|
7646
7910
|
throw new Error("agent-swarm-kit emitForce session is not makeConnection clientId=".concat(clientId));
|
|
7647
7911
|
}
|
|
@@ -7669,11 +7933,12 @@ var executeForce = function (content, clientId) { return __awaiter(void 0, void
|
|
|
7669
7933
|
return __generator(this, function (_a) {
|
|
7670
7934
|
methodName = "function executeForce";
|
|
7671
7935
|
executionId = randomString();
|
|
7672
|
-
|
|
7673
|
-
|
|
7674
|
-
|
|
7675
|
-
|
|
7676
|
-
|
|
7936
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
|
|
7937
|
+
swarm.loggerService.log("function executeForce", {
|
|
7938
|
+
content: content,
|
|
7939
|
+
clientId: clientId,
|
|
7940
|
+
executionId: executionId,
|
|
7941
|
+
});
|
|
7677
7942
|
swarm.sessionValidationService.validate(clientId, "executeForce");
|
|
7678
7943
|
swarmName = swarm.sessionValidationService.getSwarm(clientId);
|
|
7679
7944
|
swarm.swarmValidationService.validate(swarmName, "executeForce");
|
|
@@ -7715,9 +7980,10 @@ var validateClientId$d = function (clientId) {
|
|
|
7715
7980
|
* @param {(data: T) => void} fn - The callback function to execute when the event is received. The data payload is passed as an argument to this function.
|
|
7716
7981
|
*/
|
|
7717
7982
|
var listenEvent = function (clientId, topicName, fn) {
|
|
7718
|
-
|
|
7719
|
-
|
|
7720
|
-
|
|
7983
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
|
|
7984
|
+
swarm.loggerService.log("function listenEvent", {
|
|
7985
|
+
clientId: clientId,
|
|
7986
|
+
});
|
|
7721
7987
|
if (DISALLOWED_EVENT_SOURCE_LIST$2.has(topicName)) {
|
|
7722
7988
|
throw new Error("agent-swarm listenEvent topic is reserved topicName=".concat(topicName));
|
|
7723
7989
|
}
|
|
@@ -7752,9 +8018,10 @@ var validateClientId$c = function (clientId) {
|
|
|
7752
8018
|
* @param {(data: T) => void} fn - The callback function to execute when the event is received. The data payload is passed as an argument to this function.
|
|
7753
8019
|
*/
|
|
7754
8020
|
var listenEventOnce = function (clientId, topicName, filterFn, fn) {
|
|
7755
|
-
|
|
7756
|
-
|
|
7757
|
-
|
|
8021
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
|
|
8022
|
+
swarm.loggerService.log("function listenEventOnce", {
|
|
8023
|
+
clientId: clientId,
|
|
8024
|
+
});
|
|
7758
8025
|
if (DISALLOWED_EVENT_SOURCE_LIST$1.has(topicName)) {
|
|
7759
8026
|
throw new Error("agent-swarm listenEventOnce topic is reserved topicName=".concat(topicName));
|
|
7760
8027
|
}
|
|
@@ -7780,9 +8047,10 @@ var getLastUserMessage = function (clientId) { return __awaiter(void 0, void 0,
|
|
|
7780
8047
|
switch (_a.label) {
|
|
7781
8048
|
case 0:
|
|
7782
8049
|
methodName = "function getLastUserMessage";
|
|
7783
|
-
|
|
7784
|
-
|
|
7785
|
-
|
|
8050
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
|
|
8051
|
+
swarm.loggerService.log("function getLastUserMessage", {
|
|
8052
|
+
clientId: clientId,
|
|
8053
|
+
});
|
|
7786
8054
|
return [4 /*yield*/, getRawHistory(clientId, methodName)];
|
|
7787
8055
|
case 1:
|
|
7788
8056
|
history = _a.sent();
|
|
@@ -7807,9 +8075,10 @@ var getUserHistory = function (clientId) { return __awaiter(void 0, void 0, void
|
|
|
7807
8075
|
switch (_a.label) {
|
|
7808
8076
|
case 0:
|
|
7809
8077
|
methodName = "function getUserHistory";
|
|
7810
|
-
|
|
7811
|
-
|
|
7812
|
-
|
|
8078
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
|
|
8079
|
+
swarm.loggerService.log("function getUserHistory", {
|
|
8080
|
+
clientId: clientId,
|
|
8081
|
+
});
|
|
7813
8082
|
return [4 /*yield*/, getRawHistory(clientId, methodName)];
|
|
7814
8083
|
case 1:
|
|
7815
8084
|
history = _a.sent();
|
|
@@ -7833,9 +8102,10 @@ var getAssistantHistory = function (clientId) { return __awaiter(void 0, void 0,
|
|
|
7833
8102
|
switch (_a.label) {
|
|
7834
8103
|
case 0:
|
|
7835
8104
|
methodName = "function getAssistantHistory";
|
|
7836
|
-
|
|
7837
|
-
|
|
7838
|
-
|
|
8105
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
|
|
8106
|
+
swarm.loggerService.log("function getAssistantHistory", {
|
|
8107
|
+
clientId: clientId,
|
|
8108
|
+
});
|
|
7839
8109
|
return [4 /*yield*/, getRawHistory(clientId, methodName)];
|
|
7840
8110
|
case 1:
|
|
7841
8111
|
history = _a.sent();
|
|
@@ -7859,9 +8129,10 @@ var getLastAssistantMessage = function (clientId) { return __awaiter(void 0, voi
|
|
|
7859
8129
|
switch (_a.label) {
|
|
7860
8130
|
case 0:
|
|
7861
8131
|
methodName = "function getLastAssistantMessage";
|
|
7862
|
-
|
|
7863
|
-
|
|
7864
|
-
|
|
8132
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
|
|
8133
|
+
swarm.loggerService.log("function getLastAssistantMessage", {
|
|
8134
|
+
clientId: clientId,
|
|
8135
|
+
});
|
|
7865
8136
|
return [4 /*yield*/, getRawHistory(clientId, methodName)];
|
|
7866
8137
|
case 1:
|
|
7867
8138
|
history = _a.sent();
|
|
@@ -7886,9 +8157,10 @@ var getLastSystemMessage = function (clientId) { return __awaiter(void 0, void 0
|
|
|
7886
8157
|
switch (_a.label) {
|
|
7887
8158
|
case 0:
|
|
7888
8159
|
methodName = "function getLastSystemMessage";
|
|
7889
|
-
|
|
7890
|
-
|
|
7891
|
-
|
|
8160
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
|
|
8161
|
+
swarm.loggerService.log("function getLastSystemMessage", {
|
|
8162
|
+
clientId: clientId,
|
|
8163
|
+
});
|
|
7892
8164
|
return [4 /*yield*/, getRawHistory(clientId, methodName)];
|
|
7893
8165
|
case 1:
|
|
7894
8166
|
history = _a.sent();
|
|
@@ -7912,6 +8184,11 @@ var DEFAULT_TIMEOUT = 15 * 60;
|
|
|
7912
8184
|
*/
|
|
7913
8185
|
var makeAutoDispose = function (clientId, swarmName, _a) {
|
|
7914
8186
|
var _b = _a === void 0 ? {} : _a, _c = _b.timeoutSeconds, timeoutSeconds = _c === void 0 ? DEFAULT_TIMEOUT : _c, onDestroy = _b.onDestroy;
|
|
8187
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
|
|
8188
|
+
swarm.loggerService.log("function makeAutoDispose", {
|
|
8189
|
+
clientId: clientId,
|
|
8190
|
+
swarmName: swarmName,
|
|
8191
|
+
});
|
|
7915
8192
|
var isOk = true;
|
|
7916
8193
|
var unSource = Source.fromInterval(1000)
|
|
7917
8194
|
.reduce(function (acm) {
|
|
@@ -7972,9 +8249,10 @@ var DISALLOWED_EVENT_SOURCE_LIST = new Set([
|
|
|
7972
8249
|
* @returns {boolean} - Returns true if the event was successfully emitted.
|
|
7973
8250
|
*/
|
|
7974
8251
|
var event = function (clientId, topicName, payload) {
|
|
7975
|
-
|
|
7976
|
-
|
|
7977
|
-
|
|
8252
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
|
|
8253
|
+
swarm.loggerService.log("function listenEvent", {
|
|
8254
|
+
clientId: clientId,
|
|
8255
|
+
});
|
|
7978
8256
|
if (DISALLOWED_EVENT_SOURCE_LIST.has(topicName)) {
|
|
7979
8257
|
throw new Error("agent-swarm event topic is reserved topicName=".concat(topicName));
|
|
7980
8258
|
}
|
|
@@ -7997,11 +8275,12 @@ var cancelOutput = function (clientId, agentName) { return __awaiter(void 0, voi
|
|
|
7997
8275
|
return __generator(this, function (_a) {
|
|
7998
8276
|
switch (_a.label) {
|
|
7999
8277
|
case 0:
|
|
8000
|
-
methodName =
|
|
8001
|
-
|
|
8002
|
-
|
|
8003
|
-
|
|
8004
|
-
|
|
8278
|
+
methodName = "function cancelOutput";
|
|
8279
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
|
|
8280
|
+
swarm.loggerService.log("function cancelOutput", {
|
|
8281
|
+
clientId: clientId,
|
|
8282
|
+
agentName: agentName,
|
|
8283
|
+
});
|
|
8005
8284
|
swarm.agentValidationService.validate(agentName, "cancelOutput");
|
|
8006
8285
|
swarm.sessionValidationService.validate(clientId, "cancelOutput");
|
|
8007
8286
|
swarmName = swarm.sessionValidationService.getSwarm(clientId);
|
|
@@ -8010,11 +8289,12 @@ var cancelOutput = function (clientId, agentName) { return __awaiter(void 0, voi
|
|
|
8010
8289
|
case 1:
|
|
8011
8290
|
currentAgentName = _a.sent();
|
|
8012
8291
|
if (currentAgentName !== agentName) {
|
|
8013
|
-
|
|
8014
|
-
|
|
8015
|
-
|
|
8016
|
-
|
|
8017
|
-
|
|
8292
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
|
|
8293
|
+
swarm.loggerService.log('function "cancelOutput" skipped due to the agent change', {
|
|
8294
|
+
currentAgentName: currentAgentName,
|
|
8295
|
+
agentName: agentName,
|
|
8296
|
+
clientId: clientId,
|
|
8297
|
+
});
|
|
8018
8298
|
return [2 /*return*/];
|
|
8019
8299
|
}
|
|
8020
8300
|
return [4 /*yield*/, swarm.swarmPublicService.cancelOutput(methodName, clientId, swarmName)];
|
|
@@ -8037,10 +8317,11 @@ var cancelOutputForce = function (clientId) { return __awaiter(void 0, void 0, v
|
|
|
8037
8317
|
return __generator(this, function (_a) {
|
|
8038
8318
|
switch (_a.label) {
|
|
8039
8319
|
case 0:
|
|
8040
|
-
methodName =
|
|
8041
|
-
|
|
8042
|
-
|
|
8043
|
-
|
|
8320
|
+
methodName = "function cancelOutputForce";
|
|
8321
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
|
|
8322
|
+
swarm.loggerService.log("function cancelOutputForce", {
|
|
8323
|
+
clientId: clientId,
|
|
8324
|
+
});
|
|
8044
8325
|
swarm.sessionValidationService.validate(clientId, "cancelOutputForce");
|
|
8045
8326
|
swarmName = swarm.sessionValidationService.getSwarm(clientId);
|
|
8046
8327
|
swarm.swarmValidationService.validate(swarmName, "cancelOutputForce");
|
|
@@ -8335,13 +8616,14 @@ var StorageUtils = /** @class */ (function () {
|
|
|
8335
8616
|
switch (_a.label) {
|
|
8336
8617
|
case 0:
|
|
8337
8618
|
methodName = "StorageUtils take";
|
|
8338
|
-
|
|
8339
|
-
|
|
8340
|
-
|
|
8341
|
-
|
|
8342
|
-
|
|
8343
|
-
|
|
8344
|
-
|
|
8619
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
|
|
8620
|
+
swarm.loggerService.log("StorageUtils take", {
|
|
8621
|
+
search: payload.search,
|
|
8622
|
+
total: payload.total,
|
|
8623
|
+
clientId: payload.clientId,
|
|
8624
|
+
storageName: payload.storageName,
|
|
8625
|
+
score: payload.score,
|
|
8626
|
+
});
|
|
8345
8627
|
swarm.storageValidationService.validate(payload.storageName, "StorageUtils");
|
|
8346
8628
|
if (!swarm.agentValidationService.hasStorage(payload.agentName, payload.storageName)) {
|
|
8347
8629
|
throw new Error("agent-swarm StorageUtils ".concat(payload.storageName, " not registered in ").concat(payload.agentName, " (take)"));
|
|
@@ -8366,11 +8648,12 @@ var StorageUtils = /** @class */ (function () {
|
|
|
8366
8648
|
switch (_a.label) {
|
|
8367
8649
|
case 0:
|
|
8368
8650
|
methodName = "StorageUtils upsert";
|
|
8369
|
-
|
|
8370
|
-
|
|
8371
|
-
|
|
8372
|
-
|
|
8373
|
-
|
|
8651
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
|
|
8652
|
+
swarm.loggerService.log("StorageUtils upsert", {
|
|
8653
|
+
item: payload.item,
|
|
8654
|
+
clientId: payload.clientId,
|
|
8655
|
+
storageName: payload.storageName,
|
|
8656
|
+
});
|
|
8374
8657
|
swarm.storageValidationService.validate(payload.storageName, "StorageUtils");
|
|
8375
8658
|
if (!swarm.agentValidationService.hasStorage(payload.agentName, payload.storageName)) {
|
|
8376
8659
|
throw new Error("agent-swarm StorageUtils ".concat(payload.storageName, " not registered in ").concat(payload.agentName, " (upsert)"));
|
|
@@ -8394,11 +8677,12 @@ var StorageUtils = /** @class */ (function () {
|
|
|
8394
8677
|
switch (_a.label) {
|
|
8395
8678
|
case 0:
|
|
8396
8679
|
methodName = "StorageUtils remove";
|
|
8397
|
-
|
|
8398
|
-
|
|
8399
|
-
|
|
8400
|
-
|
|
8401
|
-
|
|
8680
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
|
|
8681
|
+
swarm.loggerService.log("StorageUtils remove", {
|
|
8682
|
+
itemId: payload.itemId,
|
|
8683
|
+
clientId: payload.clientId,
|
|
8684
|
+
storageName: payload.storageName,
|
|
8685
|
+
});
|
|
8402
8686
|
swarm.storageValidationService.validate(payload.storageName, "StorageUtils");
|
|
8403
8687
|
if (!swarm.agentValidationService.hasStorage(payload.agentName, payload.storageName)) {
|
|
8404
8688
|
throw new Error("agent-swarm StorageUtils ".concat(payload.storageName, " not registered in ").concat(payload.agentName, " (remove)"));
|
|
@@ -8423,11 +8707,12 @@ var StorageUtils = /** @class */ (function () {
|
|
|
8423
8707
|
switch (_a.label) {
|
|
8424
8708
|
case 0:
|
|
8425
8709
|
methodName = "StorageUtils get";
|
|
8426
|
-
|
|
8427
|
-
|
|
8428
|
-
|
|
8429
|
-
|
|
8430
|
-
|
|
8710
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
|
|
8711
|
+
swarm.loggerService.log("StorageUtils get", {
|
|
8712
|
+
itemId: payload.itemId,
|
|
8713
|
+
clientId: payload.clientId,
|
|
8714
|
+
storageName: payload.storageName,
|
|
8715
|
+
});
|
|
8431
8716
|
swarm.storageValidationService.validate(payload.storageName, "StorageUtils");
|
|
8432
8717
|
if (!swarm.agentValidationService.hasStorage(payload.agentName, payload.storageName)) {
|
|
8433
8718
|
throw new Error("agent-swarm StorageUtils ".concat(payload.storageName, " not registered in ").concat(payload.agentName, " (get)"));
|
|
@@ -8452,10 +8737,11 @@ var StorageUtils = /** @class */ (function () {
|
|
|
8452
8737
|
switch (_a.label) {
|
|
8453
8738
|
case 0:
|
|
8454
8739
|
methodName = "StorageUtils list";
|
|
8455
|
-
|
|
8456
|
-
|
|
8457
|
-
|
|
8458
|
-
|
|
8740
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
|
|
8741
|
+
swarm.loggerService.log("StorageUtils list", {
|
|
8742
|
+
clientId: payload.clientId,
|
|
8743
|
+
storageName: payload.storageName,
|
|
8744
|
+
});
|
|
8459
8745
|
swarm.storageValidationService.validate(payload.storageName, "StorageUtils");
|
|
8460
8746
|
if (!swarm.agentValidationService.hasStorage(payload.agentName, payload.storageName)) {
|
|
8461
8747
|
throw new Error("agent-swarm StorageUtils ".concat(payload.storageName, " not registered in ").concat(payload.agentName, " (list)"));
|
|
@@ -8478,10 +8764,11 @@ var StorageUtils = /** @class */ (function () {
|
|
|
8478
8764
|
switch (_a.label) {
|
|
8479
8765
|
case 0:
|
|
8480
8766
|
methodName = "StorageUtils clear";
|
|
8481
|
-
|
|
8482
|
-
|
|
8483
|
-
|
|
8484
|
-
|
|
8767
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
|
|
8768
|
+
swarm.loggerService.log("StorageUtils clear", {
|
|
8769
|
+
clientId: payload.clientId,
|
|
8770
|
+
storageName: payload.storageName,
|
|
8771
|
+
});
|
|
8485
8772
|
swarm.storageValidationService.validate(payload.storageName, "StorageUtils");
|
|
8486
8773
|
if (!swarm.agentValidationService.hasStorage(payload.agentName, payload.storageName)) {
|
|
8487
8774
|
throw new Error("agent-swarm StorageUtils ".concat(payload.storageName, " not registered in ").concat(payload.agentName, " (clear)"));
|
|
@@ -8519,10 +8806,11 @@ var StateUtils = /** @class */ (function () {
|
|
|
8519
8806
|
switch (_a.label) {
|
|
8520
8807
|
case 0:
|
|
8521
8808
|
methodName = "StateUtils getState";
|
|
8522
|
-
|
|
8523
|
-
|
|
8524
|
-
|
|
8525
|
-
|
|
8809
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
|
|
8810
|
+
swarm.loggerService.log("StateUtils getState", {
|
|
8811
|
+
clientId: payload.clientId,
|
|
8812
|
+
stateName: payload.stateName,
|
|
8813
|
+
});
|
|
8526
8814
|
if (!swarm.agentValidationService.hasState(payload.agentName, payload.stateName)) {
|
|
8527
8815
|
throw new Error("agent-swarm StateUtils ".concat(payload.stateName, " not registered in ").concat(payload.agentName, " (getState)"));
|
|
8528
8816
|
}
|
|
@@ -8549,10 +8837,11 @@ var StateUtils = /** @class */ (function () {
|
|
|
8549
8837
|
switch (_a.label) {
|
|
8550
8838
|
case 0:
|
|
8551
8839
|
methodName = "StateUtils setState";
|
|
8552
|
-
|
|
8553
|
-
|
|
8554
|
-
|
|
8555
|
-
|
|
8840
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
|
|
8841
|
+
swarm.loggerService.log("StateUtils setState", {
|
|
8842
|
+
clientId: payload.clientId,
|
|
8843
|
+
stateName: payload.stateName,
|
|
8844
|
+
});
|
|
8556
8845
|
if (!swarm.agentValidationService.hasState(payload.agentName, payload.stateName)) {
|
|
8557
8846
|
throw new Error("agent-swarm StateUtils ".concat(payload.stateName, " not registered in ").concat(payload.agentName, " (setState)"));
|
|
8558
8847
|
}
|
|
@@ -8582,7 +8871,8 @@ var LoggerUtils = /** @class */ (function () {
|
|
|
8582
8871
|
* @param {ILogger} logger - The logger instance to be used.
|
|
8583
8872
|
*/
|
|
8584
8873
|
this.useLogger = function (logger) {
|
|
8585
|
-
|
|
8874
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
|
|
8875
|
+
swarm.loggerService.log("HistoryInstance useLogger");
|
|
8586
8876
|
swarm.loggerService.setLogger(logger);
|
|
8587
8877
|
};
|
|
8588
8878
|
}
|
|
@@ -8594,4 +8884,90 @@ var LoggerUtils = /** @class */ (function () {
|
|
|
8594
8884
|
*/
|
|
8595
8885
|
var Logger = new LoggerUtils();
|
|
8596
8886
|
|
|
8597
|
-
|
|
8887
|
+
/**
|
|
8888
|
+
* Function that recursively flattens a nested object to array of entries.
|
|
8889
|
+
*/
|
|
8890
|
+
var objectFlat = function (data) {
|
|
8891
|
+
var result = [];
|
|
8892
|
+
var process = function (entries) {
|
|
8893
|
+
if (entries === void 0) { entries = []; }
|
|
8894
|
+
return entries.forEach(function (_a) {
|
|
8895
|
+
var _b = __read(_a, 2), key = _b[0], value = _b[1];
|
|
8896
|
+
if (typeof value === "function") {
|
|
8897
|
+
return;
|
|
8898
|
+
}
|
|
8899
|
+
if (isObject(value)) {
|
|
8900
|
+
result.push(["", ""]);
|
|
8901
|
+
result.push([key, ""]);
|
|
8902
|
+
process(Object.entries(value));
|
|
8903
|
+
result.push(["", ""]);
|
|
8904
|
+
return;
|
|
8905
|
+
}
|
|
8906
|
+
if (Array.isArray(value)) {
|
|
8907
|
+
result.push(["", ""]);
|
|
8908
|
+
result.push([key, ""]);
|
|
8909
|
+
process(value.map(function (value, idx) { return [String(idx + 1), value]; }));
|
|
8910
|
+
result.push(["", ""]);
|
|
8911
|
+
return;
|
|
8912
|
+
}
|
|
8913
|
+
result.push([key, String(value)]);
|
|
8914
|
+
});
|
|
8915
|
+
};
|
|
8916
|
+
process(Object.entries(data));
|
|
8917
|
+
return result;
|
|
8918
|
+
};
|
|
8919
|
+
|
|
8920
|
+
var LIST_SEPARATOR = Array.from({ length: 80 }, function () { return "-"; });
|
|
8921
|
+
/**
|
|
8922
|
+
* Utility class for schema-related operations.
|
|
8923
|
+
*/
|
|
8924
|
+
var SchemaUtils = /** @class */ (function () {
|
|
8925
|
+
function SchemaUtils() {
|
|
8926
|
+
/**
|
|
8927
|
+
* Serializes an object or an array of objects into a formatted string.
|
|
8928
|
+
*
|
|
8929
|
+
* @template T - The type of the object.
|
|
8930
|
+
* @param {T[] | T} data - The data to serialize.
|
|
8931
|
+
* @returns {string} The serialized string.
|
|
8932
|
+
*/
|
|
8933
|
+
this.serialize = function (data) {
|
|
8934
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
|
|
8935
|
+
swarm.loggerService.log("SchemaUtils serialize", {
|
|
8936
|
+
data: data,
|
|
8937
|
+
});
|
|
8938
|
+
if (Array.isArray(data)) {
|
|
8939
|
+
return data
|
|
8940
|
+
.map(function (item) {
|
|
8941
|
+
return objectFlat(item)
|
|
8942
|
+
.map(function (_a) {
|
|
8943
|
+
var _b = __read(_a, 2), key = _b[0], value = _b[1];
|
|
8944
|
+
return [GLOBAL_CONFIG.CC_NAME_TO_TITLE(key), value];
|
|
8945
|
+
})
|
|
8946
|
+
.map(function (_a) {
|
|
8947
|
+
var _b = __read(_a, 2), key = _b[0], value = _b[1];
|
|
8948
|
+
return "".concat(key, ": ").concat(value);
|
|
8949
|
+
})
|
|
8950
|
+
.join("\n");
|
|
8951
|
+
})
|
|
8952
|
+
.join("\n".concat(LIST_SEPARATOR, "\n"));
|
|
8953
|
+
}
|
|
8954
|
+
return objectFlat(data)
|
|
8955
|
+
.map(function (_a) {
|
|
8956
|
+
var _b = __read(_a, 2), key = _b[0], value = _b[1];
|
|
8957
|
+
return [GLOBAL_CONFIG.CC_NAME_TO_TITLE(key), value];
|
|
8958
|
+
})
|
|
8959
|
+
.map(function (_a) {
|
|
8960
|
+
var _b = __read(_a, 2), key = _b[0], value = _b[1];
|
|
8961
|
+
return "".concat(key, ": ").concat(value);
|
|
8962
|
+
})
|
|
8963
|
+
.join("\n");
|
|
8964
|
+
};
|
|
8965
|
+
}
|
|
8966
|
+
return SchemaUtils;
|
|
8967
|
+
}());
|
|
8968
|
+
/**
|
|
8969
|
+
* An instance of the SchemaUtils class.
|
|
8970
|
+
*/
|
|
8971
|
+
var Schema = new SchemaUtils();
|
|
8972
|
+
|
|
8973
|
+
export { ExecutionContextService, History, HistoryAdapter, HistoryInstance, Logger, MethodContextService, Schema, State, Storage, addAgent, addCompletion, addEmbedding, addState, addStorage, addSwarm, addTool, cancelOutput, cancelOutputForce, changeAgent, commitFlush, commitFlushForce, commitSystemMessage, commitSystemMessageForce, commitToolOutput, commitToolOutputForce, commitUserMessage, commitUserMessageForce, complete, disposeConnection, 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 };
|