agent-swarm-kit 1.1.67 → 1.1.69

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
@@ -4121,9 +4121,19 @@ class ClientAgent {
4121
4121
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_DEBUG &&
4122
4122
  this.params.logger.debug(`ClientAgent agentName=${this.params.agentName} clientId=${this.params.clientId} _resolveTools`);
4123
4123
  const seen = new Set();
4124
- const agentToolList = this.params.tools
4125
- ? this.params.tools
4126
- : [];
4124
+ const agentToolList = [];
4125
+ if (this.params.tools) {
4126
+ await Promise.all(this.params.tools.map(async (tool) => {
4127
+ const { function: upperFn, ...other } = tool;
4128
+ const fn = typeof upperFn === "function"
4129
+ ? await upperFn(this.params.clientId, this.params.agentName)
4130
+ : upperFn;
4131
+ agentToolList.push({
4132
+ ...other,
4133
+ function: fn,
4134
+ });
4135
+ }));
4136
+ }
4127
4137
  const mcpToolList = await this.params.mcp.listTools(this.params.clientId);
4128
4138
  if (mcpToolList.length) {
4129
4139
  return agentToolList
@@ -23340,8 +23350,12 @@ class ChatUtils {
23340
23350
  clientId,
23341
23351
  swarmName,
23342
23352
  });
23353
+ if (this._chats.has(clientId)) {
23354
+ return false;
23355
+ }
23343
23356
  this.initializeCleanup();
23344
- return await this.getChatInstance(clientId, swarmName, payload).beginChat();
23357
+ await this.getChatInstance(clientId, swarmName, payload).beginChat();
23358
+ return true;
23345
23359
  };
23346
23360
  /**
23347
23361
  * Sends a message for a client
package/build/index.mjs CHANGED
@@ -4119,9 +4119,19 @@ class ClientAgent {
4119
4119
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_DEBUG &&
4120
4120
  this.params.logger.debug(`ClientAgent agentName=${this.params.agentName} clientId=${this.params.clientId} _resolveTools`);
4121
4121
  const seen = new Set();
4122
- const agentToolList = this.params.tools
4123
- ? this.params.tools
4124
- : [];
4122
+ const agentToolList = [];
4123
+ if (this.params.tools) {
4124
+ await Promise.all(this.params.tools.map(async (tool) => {
4125
+ const { function: upperFn, ...other } = tool;
4126
+ const fn = typeof upperFn === "function"
4127
+ ? await upperFn(this.params.clientId, this.params.agentName)
4128
+ : upperFn;
4129
+ agentToolList.push({
4130
+ ...other,
4131
+ function: fn,
4132
+ });
4133
+ }));
4134
+ }
4125
4135
  const mcpToolList = await this.params.mcp.listTools(this.params.clientId);
4126
4136
  if (mcpToolList.length) {
4127
4137
  return agentToolList
@@ -23338,8 +23348,12 @@ class ChatUtils {
23338
23348
  clientId,
23339
23349
  swarmName,
23340
23350
  });
23351
+ if (this._chats.has(clientId)) {
23352
+ return false;
23353
+ }
23341
23354
  this.initializeCleanup();
23342
- return await this.getChatInstance(clientId, swarmName, payload).beginChat();
23355
+ await this.getChatInstance(clientId, swarmName, payload).beginChat();
23356
+ return true;
23343
23357
  };
23344
23358
  /**
23345
23359
  * Sends a message for a client
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-swarm-kit",
3
- "version": "1.1.67",
3
+ "version": "1.1.69",
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
@@ -14409,7 +14409,7 @@ declare class ChatUtils implements IChatControl {
14409
14409
  * @param {SwarmName} swarmName - Name of the swarm
14410
14410
  * @returns {Promise<void>}
14411
14411
  */
14412
- beginChat: <Payload extends unknown = any>(clientId: SessionId, swarmName: SwarmName, payload?: Payload) => Promise<void>;
14412
+ beginChat: <Payload extends unknown = any>(clientId: SessionId, swarmName: SwarmName, payload?: Payload) => Promise<boolean>;
14413
14413
  /**
14414
14414
  * Sends a message for a client
14415
14415
  * @param {SessionId} clientId - Unique client identifier