agent-swarm-kit 2.0.0 → 2.1.0
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 +20 -20
- package/build/index.mjs +20 -20
- package/package.json +2 -2
- package/types.d.ts +3 -3
package/build/index.cjs
CHANGED
|
@@ -677,7 +677,7 @@ class PersistBase {
|
|
|
677
677
|
* Creates a new `PersistBase` instance for managing persistent storage of entities.
|
|
678
678
|
* Sets up the storage directory based on the entity name (e.g., `SwarmName` for swarm-specific data) and base directory.
|
|
679
679
|
*/
|
|
680
|
-
constructor(entityName, baseDir = path.join(process.cwd(), "
|
|
680
|
+
constructor(entityName, baseDir = path.join(process.cwd(), "dump/agent")) {
|
|
681
681
|
this.entityName = entityName;
|
|
682
682
|
this.baseDir = baseDir;
|
|
683
683
|
/**
|
|
@@ -1048,7 +1048,7 @@ class PersistSwarmUtils {
|
|
|
1048
1048
|
*/
|
|
1049
1049
|
this.getActiveAgentStorage = functoolsKit.memoize(([swarmName]) => `${swarmName}`, (swarmName) => Reflect.construct(this.PersistActiveAgentFactory, [
|
|
1050
1050
|
swarmName,
|
|
1051
|
-
`./
|
|
1051
|
+
`./dump/agent/swarm/active_agent/`,
|
|
1052
1052
|
]));
|
|
1053
1053
|
/**
|
|
1054
1054
|
* Memoized function to create or retrieve storage for navigation stacks.
|
|
@@ -1057,7 +1057,7 @@ class PersistSwarmUtils {
|
|
|
1057
1057
|
*/
|
|
1058
1058
|
this.getNavigationStackStorage = functoolsKit.memoize(([swarmName]) => `${swarmName}`, (swarmName) => Reflect.construct(this.PersistNavigationStackFactory, [
|
|
1059
1059
|
swarmName,
|
|
1060
|
-
`./
|
|
1060
|
+
`./dump/agent/swarm/navigation_stack/`,
|
|
1061
1061
|
]));
|
|
1062
1062
|
/**
|
|
1063
1063
|
* Retrieves the active agent for a client within a swarm, falling back to a default if not set.
|
|
@@ -1177,7 +1177,7 @@ class PersistStateUtils {
|
|
|
1177
1177
|
*/
|
|
1178
1178
|
this.getStateStorage = functoolsKit.memoize(([stateName]) => `${stateName}`, (stateName) => Reflect.construct(this.PersistStateFactory, [
|
|
1179
1179
|
stateName,
|
|
1180
|
-
`./
|
|
1180
|
+
`./dump/agent/state/`,
|
|
1181
1181
|
]));
|
|
1182
1182
|
/**
|
|
1183
1183
|
* Sets the state for a client under a specific state name, persisting it for future retrieval.
|
|
@@ -1253,7 +1253,7 @@ class PersistStorageUtils {
|
|
|
1253
1253
|
*/
|
|
1254
1254
|
this.getPersistStorage = functoolsKit.memoize(([storageName]) => `${storageName}`, (storageName) => Reflect.construct(this.PersistStorageFactory, [
|
|
1255
1255
|
storageName,
|
|
1256
|
-
`./
|
|
1256
|
+
`./dump/agent/storage/`,
|
|
1257
1257
|
]));
|
|
1258
1258
|
/**
|
|
1259
1259
|
* Retrieves the data for a client from a specific storage, falling back to a default if unset.
|
|
@@ -1329,7 +1329,7 @@ class PersistMemoryUtils {
|
|
|
1329
1329
|
*/
|
|
1330
1330
|
this.getMemoryStorage = functoolsKit.memoize(([clientId]) => `${clientId}`, (clientId) => Reflect.construct(this.PersistMemoryFactory, [
|
|
1331
1331
|
clientId,
|
|
1332
|
-
`./
|
|
1332
|
+
`./dump/agent/memory/`,
|
|
1333
1333
|
]));
|
|
1334
1334
|
/**
|
|
1335
1335
|
* Sets the memory data for a client, persisting it for future retrieval.
|
|
@@ -1424,7 +1424,7 @@ class PersistAliveUtils {
|
|
|
1424
1424
|
*/
|
|
1425
1425
|
this.getAliveStorage = functoolsKit.memoize(([swarmName]) => `${swarmName}`, (swarmName) => Reflect.construct(this.PersistAliveFactory, [
|
|
1426
1426
|
swarmName,
|
|
1427
|
-
`./
|
|
1427
|
+
`./dump/agent/alive/`,
|
|
1428
1428
|
]));
|
|
1429
1429
|
/**
|
|
1430
1430
|
* Marks a client as online, persisting the status for future retrieval.
|
|
@@ -1511,7 +1511,7 @@ class PersistPolicyUtils {
|
|
|
1511
1511
|
*/
|
|
1512
1512
|
this.getPolicyStorage = functoolsKit.memoize(([swarmName]) => `${swarmName}`, (swarmName) => Reflect.construct(this.PersistPolicyFactory, [
|
|
1513
1513
|
swarmName,
|
|
1514
|
-
`./
|
|
1514
|
+
`./dump/agent/policy/`,
|
|
1515
1515
|
]));
|
|
1516
1516
|
/**
|
|
1517
1517
|
* Retrieves the list of banned clients for a specific policy, defaulting to an empty array if unset.
|
|
@@ -1579,7 +1579,7 @@ class PersistEmbeddingUtils {
|
|
|
1579
1579
|
*/
|
|
1580
1580
|
this.getEmbeddingStorage = functoolsKit.memoize(([embeddingName]) => `${embeddingName}`, (embeddingName) => Reflect.construct(this.PersistEmbeddingFactory, [
|
|
1581
1581
|
embeddingName,
|
|
1582
|
-
`./
|
|
1582
|
+
`./dump/agent/embedding/`,
|
|
1583
1583
|
]));
|
|
1584
1584
|
/**
|
|
1585
1585
|
* Retrieves the embedding vector for a specific string hash, returning null if not found.
|
|
@@ -1735,7 +1735,7 @@ class HistoryPersistInstance {
|
|
|
1735
1735
|
swarm$1.loggerService.debug(HISTORY_PERSIST_INSTANCE_METHOD_NAME_CTOR, {
|
|
1736
1736
|
clientId: this.clientId,
|
|
1737
1737
|
});
|
|
1738
|
-
this._persistStorage = new PersistList(this.clientId, `./
|
|
1738
|
+
this._persistStorage = new PersistList(this.clientId, `./dump/agent/history`);
|
|
1739
1739
|
if (callbacks.onInit) {
|
|
1740
1740
|
callbacks.onInit(clientId);
|
|
1741
1741
|
}
|
|
@@ -12935,9 +12935,9 @@ class DocService {
|
|
|
12935
12935
|
/**
|
|
12936
12936
|
* Dumps system-wide performance data to a JSON file using PerfService.toRecord.
|
|
12937
12937
|
* Ensures the output directory exists, then writes a timestamped file, logging the process if GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO is enabled.
|
|
12938
|
-
* Outputs to dirName/[momentStamp].[timeStamp].json (default: "
|
|
12938
|
+
* Outputs to dirName/[momentStamp].[timeStamp].json (default: "dump/agent/meta"), providing a snapshot of system performance (e.g., tied to ClientAgent executions).
|
|
12939
12939
|
*/
|
|
12940
|
-
this.dumpPerfomance = async (dirName = path.join(process.cwd(), "
|
|
12940
|
+
this.dumpPerfomance = async (dirName = path.join(process.cwd(), "dump/agent/meta")) => {
|
|
12941
12941
|
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
12942
12942
|
this.loggerService.info("docService dumpPerfomance", {
|
|
12943
12943
|
dirName,
|
|
@@ -12950,9 +12950,9 @@ class DocService {
|
|
|
12950
12950
|
/**
|
|
12951
12951
|
* Dumps performance data for a specific client to a JSON file using PerfService.toClientRecord.
|
|
12952
12952
|
* Ensures the output directory exists, then writes a client-specific timestamped file, logging the process if GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO is enabled.
|
|
12953
|
-
* Outputs to dirName/[clientId].[momentStamp].json (default: "
|
|
12953
|
+
* Outputs to dirName/[clientId].[momentStamp].json (default: "dump/agent/client"), documenting client-specific metrics (e.g., ClientAgent session performance).
|
|
12954
12954
|
*/
|
|
12955
|
-
this.dumpClientPerfomance = async (clientId, dirName = path.join(process.cwd(), "
|
|
12955
|
+
this.dumpClientPerfomance = async (clientId, dirName = path.join(process.cwd(), "dump/agent/client")) => {
|
|
12956
12956
|
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
12957
12957
|
this.loggerService.info("docService dumpPerfomance", {
|
|
12958
12958
|
dirName,
|
|
@@ -17182,7 +17182,7 @@ const METHOD_NAME_INTERVAL = "cli.dumpPerfomance.interval";
|
|
|
17182
17182
|
/**
|
|
17183
17183
|
* The internal HOF for handling the performance dump
|
|
17184
17184
|
*/
|
|
17185
|
-
const dumpPerfomanceInternal = beginContext(async (dirName = "./
|
|
17185
|
+
const dumpPerfomanceInternal = beginContext(async (dirName = "./dump/agent/meta") => {
|
|
17186
17186
|
GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
|
|
17187
17187
|
swarm$1.loggerService.log(METHOD_NAME_INTERNAL$1);
|
|
17188
17188
|
return await swarm$1.docService.dumpPerfomance(dirName);
|
|
@@ -17192,7 +17192,7 @@ const dumpPerfomanceInternal = beginContext(async (dirName = "./logs/meta") => {
|
|
|
17192
17192
|
* Logs the method name if logging is enabled in the global configuration.
|
|
17193
17193
|
*
|
|
17194
17194
|
*/
|
|
17195
|
-
const dumpPerfomance = async (dirName = "./
|
|
17195
|
+
const dumpPerfomance = async (dirName = "./dump/agent/meta") => {
|
|
17196
17196
|
GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG && swarm$1.loggerService.log(METHOD_NAME$1B);
|
|
17197
17197
|
await dumpPerfomanceInternal(dirName);
|
|
17198
17198
|
};
|
|
@@ -17201,7 +17201,7 @@ const dumpPerfomance = async (dirName = "./logs/meta") => {
|
|
|
17201
17201
|
* Logs the method name if logging is enabled in the global configuration.
|
|
17202
17202
|
*
|
|
17203
17203
|
*/
|
|
17204
|
-
dumpPerfomance.runInterval = beginContext((dirName = "./
|
|
17204
|
+
dumpPerfomance.runInterval = beginContext((dirName = "./dump/agent/meta", interval = 30000) => {
|
|
17205
17205
|
GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
|
|
17206
17206
|
swarm$1.loggerService.log(METHOD_NAME_INTERVAL);
|
|
17207
17207
|
return functoolsKit.Source.fromInterval(interval).connect(() => dumpPerfomance(dirName));
|
|
@@ -17252,7 +17252,7 @@ const METHOD_NAME_EXECUTE = "cli.dumpClientPerformance.execute";
|
|
|
17252
17252
|
* The internal HOF for handling the performance dump
|
|
17253
17253
|
*
|
|
17254
17254
|
*/
|
|
17255
|
-
const dumpClientPerformanceInternal = beginContext(async (clientId, dirName = "./
|
|
17255
|
+
const dumpClientPerformanceInternal = beginContext(async (clientId, dirName = "./dump/agent/client") => {
|
|
17256
17256
|
GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
|
|
17257
17257
|
swarm$1.loggerService.log(METHOD_NAME_INTERNAL);
|
|
17258
17258
|
return await swarm$1.docService.dumpClientPerfomance(clientId, dirName);
|
|
@@ -17262,7 +17262,7 @@ const dumpClientPerformanceInternal = beginContext(async (clientId, dirName = ".
|
|
|
17262
17262
|
* Logs the method name if logging is enabled in the global configuration.
|
|
17263
17263
|
*
|
|
17264
17264
|
*/
|
|
17265
|
-
const dumpClientPerformance = async (clientId, dirName = "./
|
|
17265
|
+
const dumpClientPerformance = async (clientId, dirName = "./dump/agent/client") => {
|
|
17266
17266
|
GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG && swarm$1.loggerService.log(METHOD_NAME$1A);
|
|
17267
17267
|
await dumpClientPerformanceInternal(clientId, dirName);
|
|
17268
17268
|
};
|
|
@@ -17271,7 +17271,7 @@ const dumpClientPerformance = async (clientId, dirName = "./logs/client") => {
|
|
|
17271
17271
|
* Logs the method name if logging is enabled in the global configuration.
|
|
17272
17272
|
*
|
|
17273
17273
|
*/
|
|
17274
|
-
dumpClientPerformance.runAfterExecute = beginContext(async (dirName = "./
|
|
17274
|
+
dumpClientPerformance.runAfterExecute = beginContext(async (dirName = "./dump/agent/client") => {
|
|
17275
17275
|
GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
|
|
17276
17276
|
swarm$1.loggerService.log(METHOD_NAME_EXECUTE);
|
|
17277
17277
|
return listenExecutionEvent("*", async ({ type, clientId }) => {
|
package/build/index.mjs
CHANGED
|
@@ -657,7 +657,7 @@ class PersistBase {
|
|
|
657
657
|
* Creates a new `PersistBase` instance for managing persistent storage of entities.
|
|
658
658
|
* Sets up the storage directory based on the entity name (e.g., `SwarmName` for swarm-specific data) and base directory.
|
|
659
659
|
*/
|
|
660
|
-
constructor(entityName, baseDir = join(process.cwd(), "
|
|
660
|
+
constructor(entityName, baseDir = join(process.cwd(), "dump/agent")) {
|
|
661
661
|
this.entityName = entityName;
|
|
662
662
|
this.baseDir = baseDir;
|
|
663
663
|
/**
|
|
@@ -1028,7 +1028,7 @@ class PersistSwarmUtils {
|
|
|
1028
1028
|
*/
|
|
1029
1029
|
this.getActiveAgentStorage = memoize(([swarmName]) => `${swarmName}`, (swarmName) => Reflect.construct(this.PersistActiveAgentFactory, [
|
|
1030
1030
|
swarmName,
|
|
1031
|
-
`./
|
|
1031
|
+
`./dump/agent/swarm/active_agent/`,
|
|
1032
1032
|
]));
|
|
1033
1033
|
/**
|
|
1034
1034
|
* Memoized function to create or retrieve storage for navigation stacks.
|
|
@@ -1037,7 +1037,7 @@ class PersistSwarmUtils {
|
|
|
1037
1037
|
*/
|
|
1038
1038
|
this.getNavigationStackStorage = memoize(([swarmName]) => `${swarmName}`, (swarmName) => Reflect.construct(this.PersistNavigationStackFactory, [
|
|
1039
1039
|
swarmName,
|
|
1040
|
-
`./
|
|
1040
|
+
`./dump/agent/swarm/navigation_stack/`,
|
|
1041
1041
|
]));
|
|
1042
1042
|
/**
|
|
1043
1043
|
* Retrieves the active agent for a client within a swarm, falling back to a default if not set.
|
|
@@ -1157,7 +1157,7 @@ class PersistStateUtils {
|
|
|
1157
1157
|
*/
|
|
1158
1158
|
this.getStateStorage = memoize(([stateName]) => `${stateName}`, (stateName) => Reflect.construct(this.PersistStateFactory, [
|
|
1159
1159
|
stateName,
|
|
1160
|
-
`./
|
|
1160
|
+
`./dump/agent/state/`,
|
|
1161
1161
|
]));
|
|
1162
1162
|
/**
|
|
1163
1163
|
* Sets the state for a client under a specific state name, persisting it for future retrieval.
|
|
@@ -1233,7 +1233,7 @@ class PersistStorageUtils {
|
|
|
1233
1233
|
*/
|
|
1234
1234
|
this.getPersistStorage = memoize(([storageName]) => `${storageName}`, (storageName) => Reflect.construct(this.PersistStorageFactory, [
|
|
1235
1235
|
storageName,
|
|
1236
|
-
`./
|
|
1236
|
+
`./dump/agent/storage/`,
|
|
1237
1237
|
]));
|
|
1238
1238
|
/**
|
|
1239
1239
|
* Retrieves the data for a client from a specific storage, falling back to a default if unset.
|
|
@@ -1309,7 +1309,7 @@ class PersistMemoryUtils {
|
|
|
1309
1309
|
*/
|
|
1310
1310
|
this.getMemoryStorage = memoize(([clientId]) => `${clientId}`, (clientId) => Reflect.construct(this.PersistMemoryFactory, [
|
|
1311
1311
|
clientId,
|
|
1312
|
-
`./
|
|
1312
|
+
`./dump/agent/memory/`,
|
|
1313
1313
|
]));
|
|
1314
1314
|
/**
|
|
1315
1315
|
* Sets the memory data for a client, persisting it for future retrieval.
|
|
@@ -1404,7 +1404,7 @@ class PersistAliveUtils {
|
|
|
1404
1404
|
*/
|
|
1405
1405
|
this.getAliveStorage = memoize(([swarmName]) => `${swarmName}`, (swarmName) => Reflect.construct(this.PersistAliveFactory, [
|
|
1406
1406
|
swarmName,
|
|
1407
|
-
`./
|
|
1407
|
+
`./dump/agent/alive/`,
|
|
1408
1408
|
]));
|
|
1409
1409
|
/**
|
|
1410
1410
|
* Marks a client as online, persisting the status for future retrieval.
|
|
@@ -1491,7 +1491,7 @@ class PersistPolicyUtils {
|
|
|
1491
1491
|
*/
|
|
1492
1492
|
this.getPolicyStorage = memoize(([swarmName]) => `${swarmName}`, (swarmName) => Reflect.construct(this.PersistPolicyFactory, [
|
|
1493
1493
|
swarmName,
|
|
1494
|
-
`./
|
|
1494
|
+
`./dump/agent/policy/`,
|
|
1495
1495
|
]));
|
|
1496
1496
|
/**
|
|
1497
1497
|
* Retrieves the list of banned clients for a specific policy, defaulting to an empty array if unset.
|
|
@@ -1559,7 +1559,7 @@ class PersistEmbeddingUtils {
|
|
|
1559
1559
|
*/
|
|
1560
1560
|
this.getEmbeddingStorage = memoize(([embeddingName]) => `${embeddingName}`, (embeddingName) => Reflect.construct(this.PersistEmbeddingFactory, [
|
|
1561
1561
|
embeddingName,
|
|
1562
|
-
`./
|
|
1562
|
+
`./dump/agent/embedding/`,
|
|
1563
1563
|
]));
|
|
1564
1564
|
/**
|
|
1565
1565
|
* Retrieves the embedding vector for a specific string hash, returning null if not found.
|
|
@@ -1715,7 +1715,7 @@ class HistoryPersistInstance {
|
|
|
1715
1715
|
swarm$1.loggerService.debug(HISTORY_PERSIST_INSTANCE_METHOD_NAME_CTOR, {
|
|
1716
1716
|
clientId: this.clientId,
|
|
1717
1717
|
});
|
|
1718
|
-
this._persistStorage = new PersistList(this.clientId, `./
|
|
1718
|
+
this._persistStorage = new PersistList(this.clientId, `./dump/agent/history`);
|
|
1719
1719
|
if (callbacks.onInit) {
|
|
1720
1720
|
callbacks.onInit(clientId);
|
|
1721
1721
|
}
|
|
@@ -12915,9 +12915,9 @@ class DocService {
|
|
|
12915
12915
|
/**
|
|
12916
12916
|
* Dumps system-wide performance data to a JSON file using PerfService.toRecord.
|
|
12917
12917
|
* Ensures the output directory exists, then writes a timestamped file, logging the process if GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO is enabled.
|
|
12918
|
-
* Outputs to dirName/[momentStamp].[timeStamp].json (default: "
|
|
12918
|
+
* Outputs to dirName/[momentStamp].[timeStamp].json (default: "dump/agent/meta"), providing a snapshot of system performance (e.g., tied to ClientAgent executions).
|
|
12919
12919
|
*/
|
|
12920
|
-
this.dumpPerfomance = async (dirName = join(process.cwd(), "
|
|
12920
|
+
this.dumpPerfomance = async (dirName = join(process.cwd(), "dump/agent/meta")) => {
|
|
12921
12921
|
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
12922
12922
|
this.loggerService.info("docService dumpPerfomance", {
|
|
12923
12923
|
dirName,
|
|
@@ -12930,9 +12930,9 @@ class DocService {
|
|
|
12930
12930
|
/**
|
|
12931
12931
|
* Dumps performance data for a specific client to a JSON file using PerfService.toClientRecord.
|
|
12932
12932
|
* Ensures the output directory exists, then writes a client-specific timestamped file, logging the process if GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO is enabled.
|
|
12933
|
-
* Outputs to dirName/[clientId].[momentStamp].json (default: "
|
|
12933
|
+
* Outputs to dirName/[clientId].[momentStamp].json (default: "dump/agent/client"), documenting client-specific metrics (e.g., ClientAgent session performance).
|
|
12934
12934
|
*/
|
|
12935
|
-
this.dumpClientPerfomance = async (clientId, dirName = join(process.cwd(), "
|
|
12935
|
+
this.dumpClientPerfomance = async (clientId, dirName = join(process.cwd(), "dump/agent/client")) => {
|
|
12936
12936
|
GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO &&
|
|
12937
12937
|
this.loggerService.info("docService dumpPerfomance", {
|
|
12938
12938
|
dirName,
|
|
@@ -17162,7 +17162,7 @@ const METHOD_NAME_INTERVAL = "cli.dumpPerfomance.interval";
|
|
|
17162
17162
|
/**
|
|
17163
17163
|
* The internal HOF for handling the performance dump
|
|
17164
17164
|
*/
|
|
17165
|
-
const dumpPerfomanceInternal = beginContext(async (dirName = "./
|
|
17165
|
+
const dumpPerfomanceInternal = beginContext(async (dirName = "./dump/agent/meta") => {
|
|
17166
17166
|
GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
|
|
17167
17167
|
swarm$1.loggerService.log(METHOD_NAME_INTERNAL$1);
|
|
17168
17168
|
return await swarm$1.docService.dumpPerfomance(dirName);
|
|
@@ -17172,7 +17172,7 @@ const dumpPerfomanceInternal = beginContext(async (dirName = "./logs/meta") => {
|
|
|
17172
17172
|
* Logs the method name if logging is enabled in the global configuration.
|
|
17173
17173
|
*
|
|
17174
17174
|
*/
|
|
17175
|
-
const dumpPerfomance = async (dirName = "./
|
|
17175
|
+
const dumpPerfomance = async (dirName = "./dump/agent/meta") => {
|
|
17176
17176
|
GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG && swarm$1.loggerService.log(METHOD_NAME$1B);
|
|
17177
17177
|
await dumpPerfomanceInternal(dirName);
|
|
17178
17178
|
};
|
|
@@ -17181,7 +17181,7 @@ const dumpPerfomance = async (dirName = "./logs/meta") => {
|
|
|
17181
17181
|
* Logs the method name if logging is enabled in the global configuration.
|
|
17182
17182
|
*
|
|
17183
17183
|
*/
|
|
17184
|
-
dumpPerfomance.runInterval = beginContext((dirName = "./
|
|
17184
|
+
dumpPerfomance.runInterval = beginContext((dirName = "./dump/agent/meta", interval = 30000) => {
|
|
17185
17185
|
GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
|
|
17186
17186
|
swarm$1.loggerService.log(METHOD_NAME_INTERVAL);
|
|
17187
17187
|
return Source.fromInterval(interval).connect(() => dumpPerfomance(dirName));
|
|
@@ -17232,7 +17232,7 @@ const METHOD_NAME_EXECUTE = "cli.dumpClientPerformance.execute";
|
|
|
17232
17232
|
* The internal HOF for handling the performance dump
|
|
17233
17233
|
*
|
|
17234
17234
|
*/
|
|
17235
|
-
const dumpClientPerformanceInternal = beginContext(async (clientId, dirName = "./
|
|
17235
|
+
const dumpClientPerformanceInternal = beginContext(async (clientId, dirName = "./dump/agent/client") => {
|
|
17236
17236
|
GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
|
|
17237
17237
|
swarm$1.loggerService.log(METHOD_NAME_INTERNAL);
|
|
17238
17238
|
return await swarm$1.docService.dumpClientPerfomance(clientId, dirName);
|
|
@@ -17242,7 +17242,7 @@ const dumpClientPerformanceInternal = beginContext(async (clientId, dirName = ".
|
|
|
17242
17242
|
* Logs the method name if logging is enabled in the global configuration.
|
|
17243
17243
|
*
|
|
17244
17244
|
*/
|
|
17245
|
-
const dumpClientPerformance = async (clientId, dirName = "./
|
|
17245
|
+
const dumpClientPerformance = async (clientId, dirName = "./dump/agent/client") => {
|
|
17246
17246
|
GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG && swarm$1.loggerService.log(METHOD_NAME$1A);
|
|
17247
17247
|
await dumpClientPerformanceInternal(clientId, dirName);
|
|
17248
17248
|
};
|
|
@@ -17251,7 +17251,7 @@ const dumpClientPerformance = async (clientId, dirName = "./logs/client") => {
|
|
|
17251
17251
|
* Logs the method name if logging is enabled in the global configuration.
|
|
17252
17252
|
*
|
|
17253
17253
|
*/
|
|
17254
|
-
dumpClientPerformance.runAfterExecute = beginContext(async (dirName = "./
|
|
17254
|
+
dumpClientPerformance.runAfterExecute = beginContext(async (dirName = "./dump/agent/client") => {
|
|
17255
17255
|
GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
|
|
17256
17256
|
swarm$1.loggerService.log(METHOD_NAME_EXECUTE);
|
|
17257
17257
|
return listenExecutionEvent("*", async ({ type, clientId }) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-swarm-kit",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "A TypeScript library for building orchestrated framework-agnostic multi-agent AI systems",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Petr Tripolsky",
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"tslib": "2.7.0",
|
|
74
74
|
"typedoc": "0.27.9",
|
|
75
75
|
"undici": "6.21.2",
|
|
76
|
-
"worker-testbed": "
|
|
76
|
+
"worker-testbed": "2.0.0"
|
|
77
77
|
},
|
|
78
78
|
"peerDependencies": {
|
|
79
79
|
"typescript": "^5.0.0"
|
package/types.d.ts
CHANGED
|
@@ -1501,7 +1501,7 @@ type TPersistBaseCtor<EntityName extends string = string, Entity extends IEntity
|
|
|
1501
1501
|
declare class PersistBase<EntityName extends string = string> implements IPersistBase {
|
|
1502
1502
|
readonly entityName: EntityName;
|
|
1503
1503
|
readonly baseDir: string;
|
|
1504
|
-
/** @private The directory path where entity files are stored (e.g., `./
|
|
1504
|
+
/** @private The directory path where entity files are stored (e.g., `./dump/agent/alive/` for alive status)*/
|
|
1505
1505
|
_directory: string;
|
|
1506
1506
|
/**
|
|
1507
1507
|
* Creates a new `PersistBase` instance for managing persistent storage of entities.
|
|
@@ -7011,13 +7011,13 @@ declare class DocService {
|
|
|
7011
7011
|
/**
|
|
7012
7012
|
* Dumps system-wide performance data to a JSON file using PerfService.toRecord.
|
|
7013
7013
|
* Ensures the output directory exists, then writes a timestamped file, logging the process if GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO is enabled.
|
|
7014
|
-
* Outputs to dirName/[momentStamp].[timeStamp].json (default: "
|
|
7014
|
+
* Outputs to dirName/[momentStamp].[timeStamp].json (default: "dump/agent/meta"), providing a snapshot of system performance (e.g., tied to ClientAgent executions).
|
|
7015
7015
|
*/
|
|
7016
7016
|
dumpPerfomance: (dirName?: string) => Promise<void>;
|
|
7017
7017
|
/**
|
|
7018
7018
|
* Dumps performance data for a specific client to a JSON file using PerfService.toClientRecord.
|
|
7019
7019
|
* Ensures the output directory exists, then writes a client-specific timestamped file, logging the process if GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO is enabled.
|
|
7020
|
-
* Outputs to dirName/[clientId].[momentStamp].json (default: "
|
|
7020
|
+
* Outputs to dirName/[clientId].[momentStamp].json (default: "dump/agent/client"), documenting client-specific metrics (e.g., ClientAgent session performance).
|
|
7021
7021
|
*/
|
|
7022
7022
|
dumpClientPerfomance: (clientId: string, dirName?: string) => Promise<void>;
|
|
7023
7023
|
}
|