agent-swarm-kit 1.0.56 → 1.0.58

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 CHANGED
@@ -926,6 +926,7 @@ var AgentConnectionService = /** @class */ (function () {
926
926
  this.contextService = inject(TYPES.contextService);
927
927
  this.sessionValidationService = inject(TYPES.sessionValidationService);
928
928
  this.historyConnectionService = inject(TYPES.historyConnectionService);
929
+ this.storageConnectionService = inject(TYPES.storageConnectionService);
929
930
  this.agentSchemaService = inject(TYPES.agentSchemaService);
930
931
  this.toolSchemaService = inject(TYPES.toolSchemaService);
931
932
  this.completionSchemaService = inject(TYPES.completionSchemaService);
@@ -939,9 +940,14 @@ var AgentConnectionService = /** @class */ (function () {
939
940
  var _b = __read(_a, 2), clientId = _b[0], agentName = _b[1];
940
941
  return "".concat(clientId, "-").concat(agentName);
941
942
  }, function (clientId, agentName) {
942
- var _a = _this.agentSchemaService.get(agentName), prompt = _a.prompt, system = _a.system, tools = _a.tools, _b = _a.transform, transform = _b === void 0 ? GLOBAL_CONFIG.CC_AGENT_OUTPUT_TRANSFORM : _b, _c = _a.map, map = _c === void 0 ? GLOBAL_CONFIG.CC_AGENT_OUTPUT_MAP : _c, callbacks = _a.callbacks, completionName = _a.completion, _d = _a.validate, validate = _d === void 0 ? validateDefault : _d;
943
+ var _a = _this.agentSchemaService.get(agentName), prompt = _a.prompt, system = _a.system, tools = _a.tools, _b = _a.transform, transform = _b === void 0 ? GLOBAL_CONFIG.CC_AGENT_OUTPUT_TRANSFORM : _b, _c = _a.map, map = _c === void 0 ? GLOBAL_CONFIG.CC_AGENT_OUTPUT_MAP : _c, callbacks = _a.callbacks, storages = _a.storages, completionName = _a.completion, _d = _a.validate, validate = _d === void 0 ? validateDefault : _d;
943
944
  var completion = _this.completionSchemaService.get(completionName);
944
945
  _this.sessionValidationService.addAgentUsage(clientId, agentName);
946
+ storages === null || storages === void 0 ? void 0 : storages.forEach(function (storageName) {
947
+ return _this.storageConnectionService
948
+ .getStorage(clientId, storageName)
949
+ .waitForInit();
950
+ });
945
951
  return new ClientAgent(__assign({ clientId: clientId, agentName: agentName, validate: validate, logger: _this.loggerService, history: _this.historyConnectionService.getHistory(clientId, agentName), prompt: prompt, system: system, transform: transform, map: map, tools: tools === null || tools === void 0 ? void 0 : tools.map(_this.toolSchemaService.get), completion: completion }, callbacks));
946
952
  });
947
953
  /**
@@ -1230,6 +1236,10 @@ var ClientHistory = /** @class */ (function () {
1230
1236
  return agentName === _this.params.agentName;
1231
1237
  });
1232
1238
  commonMessages = commonMessagesRaw
1239
+ .map(function (_a) {
1240
+ var content = _a.content, tool_calls = _a.tool_calls, other = __rest(_a, ["content", "tool_calls"]);
1241
+ return (__assign(__assign({}, other), { tool_calls: tool_calls, content: (tool_calls === null || tool_calls === void 0 ? void 0 : tool_calls.length) ? "" : content }));
1242
+ })
1233
1243
  .filter(this._filterCondition)
1234
1244
  .slice(-GLOBAL_CONFIG.CC_KEEP_MESSAGES);
1235
1245
  assistantToolOutputCallSet = new Set(commonMessages
package/build/index.mjs CHANGED
@@ -924,6 +924,7 @@ var AgentConnectionService = /** @class */ (function () {
924
924
  this.contextService = inject(TYPES.contextService);
925
925
  this.sessionValidationService = inject(TYPES.sessionValidationService);
926
926
  this.historyConnectionService = inject(TYPES.historyConnectionService);
927
+ this.storageConnectionService = inject(TYPES.storageConnectionService);
927
928
  this.agentSchemaService = inject(TYPES.agentSchemaService);
928
929
  this.toolSchemaService = inject(TYPES.toolSchemaService);
929
930
  this.completionSchemaService = inject(TYPES.completionSchemaService);
@@ -937,9 +938,14 @@ var AgentConnectionService = /** @class */ (function () {
937
938
  var _b = __read(_a, 2), clientId = _b[0], agentName = _b[1];
938
939
  return "".concat(clientId, "-").concat(agentName);
939
940
  }, function (clientId, agentName) {
940
- var _a = _this.agentSchemaService.get(agentName), prompt = _a.prompt, system = _a.system, tools = _a.tools, _b = _a.transform, transform = _b === void 0 ? GLOBAL_CONFIG.CC_AGENT_OUTPUT_TRANSFORM : _b, _c = _a.map, map = _c === void 0 ? GLOBAL_CONFIG.CC_AGENT_OUTPUT_MAP : _c, callbacks = _a.callbacks, completionName = _a.completion, _d = _a.validate, validate = _d === void 0 ? validateDefault : _d;
941
+ var _a = _this.agentSchemaService.get(agentName), prompt = _a.prompt, system = _a.system, tools = _a.tools, _b = _a.transform, transform = _b === void 0 ? GLOBAL_CONFIG.CC_AGENT_OUTPUT_TRANSFORM : _b, _c = _a.map, map = _c === void 0 ? GLOBAL_CONFIG.CC_AGENT_OUTPUT_MAP : _c, callbacks = _a.callbacks, storages = _a.storages, completionName = _a.completion, _d = _a.validate, validate = _d === void 0 ? validateDefault : _d;
941
942
  var completion = _this.completionSchemaService.get(completionName);
942
943
  _this.sessionValidationService.addAgentUsage(clientId, agentName);
944
+ storages === null || storages === void 0 ? void 0 : storages.forEach(function (storageName) {
945
+ return _this.storageConnectionService
946
+ .getStorage(clientId, storageName)
947
+ .waitForInit();
948
+ });
943
949
  return new ClientAgent(__assign({ clientId: clientId, agentName: agentName, validate: validate, logger: _this.loggerService, history: _this.historyConnectionService.getHistory(clientId, agentName), prompt: prompt, system: system, transform: transform, map: map, tools: tools === null || tools === void 0 ? void 0 : tools.map(_this.toolSchemaService.get), completion: completion }, callbacks));
944
950
  });
945
951
  /**
@@ -1228,6 +1234,10 @@ var ClientHistory = /** @class */ (function () {
1228
1234
  return agentName === _this.params.agentName;
1229
1235
  });
1230
1236
  commonMessages = commonMessagesRaw
1237
+ .map(function (_a) {
1238
+ var content = _a.content, tool_calls = _a.tool_calls, other = __rest(_a, ["content", "tool_calls"]);
1239
+ return (__assign(__assign({}, other), { tool_calls: tool_calls, content: (tool_calls === null || tool_calls === void 0 ? void 0 : tool_calls.length) ? "" : content }));
1240
+ })
1231
1241
  .filter(this._filterCondition)
1232
1242
  .slice(-GLOBAL_CONFIG.CC_KEEP_MESSAGES);
1233
1243
  assistantToolOutputCallSet = new Set(commonMessages
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-swarm-kit",
3
- "version": "1.0.56",
3
+ "version": "1.0.58",
4
4
  "description": "A TypeScript library for building orchestrated framework-agnostic multi-agent AI systems",
5
5
  "author": {
6
6
  "name": "Petr Tripolsky",
package/types.d.ts CHANGED
@@ -915,6 +915,7 @@ declare class AgentConnectionService implements IAgent {
915
915
  private readonly contextService;
916
916
  private readonly sessionValidationService;
917
917
  private readonly historyConnectionService;
918
+ private readonly storageConnectionService;
918
919
  private readonly agentSchemaService;
919
920
  private readonly toolSchemaService;
920
921
  private readonly completionSchemaService;