agent-swarm-kit 1.1.21 → 1.1.23

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
@@ -10022,6 +10022,7 @@ class StorageSchemaService {
10022
10022
  }
10023
10023
  }
10024
10024
 
10025
+ const STORAGE_POOL_DELAY = 0;
10025
10026
  /**
10026
10027
  * Creates a SHA-256 hash of the provided string.
10027
10028
  *
@@ -10101,7 +10102,7 @@ const WAIT_FOR_INIT_FN$1 = async (self) => {
10101
10102
  }
10102
10103
  const data = await self.params.getData(self.params.clientId, self.params.storageName, await self.params.getDefaultData(self.params.clientId, self.params.storageName));
10103
10104
  await Promise.all(data.map(functoolsKit.execpool(self._createEmbedding, {
10104
- delay: 10,
10105
+ delay: STORAGE_POOL_DELAY,
10105
10106
  maxExec: GLOBAL_CONFIG.CC_STORAGE_SEARCH_POOL,
10106
10107
  })));
10107
10108
  self._itemMap = new Map(data.map((item) => [item.id, item]));
@@ -10322,7 +10323,7 @@ class ClientStorage {
10322
10323
  }
10323
10324
  indexed.push(item, maxScore);
10324
10325
  }, {
10325
- delay: 10,
10326
+ delay: STORAGE_POOL_DELAY,
10326
10327
  maxExec: GLOBAL_CONFIG.CC_STORAGE_SEARCH_POOL,
10327
10328
  })));
10328
10329
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_DEBUG &&
@@ -12111,6 +12112,7 @@ class SwarmMetaService {
12111
12112
  * @type {number}
12112
12113
  */
12113
12114
  const THREAD_POOL_SIZE = 5;
12115
+ const THREAD_POOL_DELAY = 0;
12114
12116
  /**
12115
12117
  * List of subdirectories created for organizing documentation output.
12116
12118
  * Includes "agent" for agent Markdown files and "image" for UML diagrams, used in dumpDocs to structure the output directory.
@@ -12332,6 +12334,7 @@ class DocService {
12332
12334
  await writeFileAtomic(path.join(dirName, `./${swarmSchema.swarmName}.md`), result.join("\n"));
12333
12335
  }, {
12334
12336
  maxExec: THREAD_POOL_SIZE,
12337
+ delay: THREAD_POOL_DELAY,
12335
12338
  });
12336
12339
  /**
12337
12340
  * Writes Markdown documentation for an agent schema, detailing its name, description, UML diagram, prompts, tools, storages, states, and callbacks.
@@ -12609,6 +12612,7 @@ class DocService {
12609
12612
  await writeFileAtomic(path.join(dirName, `./agent/${agentSchema.agentName}.md`), result.join("\n"));
12610
12613
  }, {
12611
12614
  maxExec: THREAD_POOL_SIZE,
12615
+ delay: THREAD_POOL_DELAY,
12612
12616
  });
12613
12617
  /**
12614
12618
  * Generates and writes documentation for all swarms and agents in the system.
@@ -16320,6 +16324,7 @@ const createNavigateToAgent = ({ executeMessage = DEFAULT_EXECUTE_MESSAGE, emitM
16320
16324
  toolId,
16321
16325
  });
16322
16326
  const lastMessage = await getLastUserMessage(clientId);
16327
+ const lastAgent = await getAgentName(clientId);
16323
16328
  if (await functoolsKit.and(functoolsKit.not(hasNavigation(clientId, agentName)), Promise.resolve(!emitMessage))) {
16324
16329
  await commitToolOutputForce(toolId, typeof toolOutput === "string"
16325
16330
  ? toolOutput
@@ -16327,7 +16332,7 @@ const createNavigateToAgent = ({ executeMessage = DEFAULT_EXECUTE_MESSAGE, emitM
16327
16332
  await changeToAgent(agentName, clientId);
16328
16333
  await executeForce(typeof executeMessage === "string"
16329
16334
  ? executeMessage
16330
- : await executeMessage(clientId, lastMessage, agentName), clientId);
16335
+ : await executeMessage(clientId, lastMessage, lastAgent, agentName), clientId);
16331
16336
  return;
16332
16337
  }
16333
16338
  if (await functoolsKit.and(functoolsKit.not(hasNavigation(clientId, agentName)), Promise.resolve(!!emitMessage))) {
@@ -16337,7 +16342,7 @@ const createNavigateToAgent = ({ executeMessage = DEFAULT_EXECUTE_MESSAGE, emitM
16337
16342
  await changeToAgent(agentName, clientId);
16338
16343
  await emitForce(typeof emitMessage === "string"
16339
16344
  ? emitMessage
16340
- : await emitMessage(clientId, lastMessage, agentName), clientId);
16345
+ : await emitMessage(clientId, lastMessage, lastAgent, agentName), clientId);
16341
16346
  return;
16342
16347
  }
16343
16348
  await commitFlushForce(clientId);
@@ -20731,7 +20736,7 @@ const EXECPOOL_SIZE = 5;
20731
20736
  /**
20732
20737
  * Delay in milliseconds between executions in the execpool for completion requests.
20733
20738
  */
20734
- const EXECPOOL_WAIT = 100;
20739
+ const EXECPOOL_WAIT = 0;
20735
20740
  /**
20736
20741
  * Maximum retry count before the exception
20737
20742
  */
package/build/index.mjs CHANGED
@@ -10020,6 +10020,7 @@ class StorageSchemaService {
10020
10020
  }
10021
10021
  }
10022
10022
 
10023
+ const STORAGE_POOL_DELAY = 0;
10023
10024
  /**
10024
10025
  * Creates a SHA-256 hash of the provided string.
10025
10026
  *
@@ -10099,7 +10100,7 @@ const WAIT_FOR_INIT_FN$1 = async (self) => {
10099
10100
  }
10100
10101
  const data = await self.params.getData(self.params.clientId, self.params.storageName, await self.params.getDefaultData(self.params.clientId, self.params.storageName));
10101
10102
  await Promise.all(data.map(execpool(self._createEmbedding, {
10102
- delay: 10,
10103
+ delay: STORAGE_POOL_DELAY,
10103
10104
  maxExec: GLOBAL_CONFIG.CC_STORAGE_SEARCH_POOL,
10104
10105
  })));
10105
10106
  self._itemMap = new Map(data.map((item) => [item.id, item]));
@@ -10320,7 +10321,7 @@ class ClientStorage {
10320
10321
  }
10321
10322
  indexed.push(item, maxScore);
10322
10323
  }, {
10323
- delay: 10,
10324
+ delay: STORAGE_POOL_DELAY,
10324
10325
  maxExec: GLOBAL_CONFIG.CC_STORAGE_SEARCH_POOL,
10325
10326
  })));
10326
10327
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_DEBUG &&
@@ -12109,6 +12110,7 @@ class SwarmMetaService {
12109
12110
  * @type {number}
12110
12111
  */
12111
12112
  const THREAD_POOL_SIZE = 5;
12113
+ const THREAD_POOL_DELAY = 0;
12112
12114
  /**
12113
12115
  * List of subdirectories created for organizing documentation output.
12114
12116
  * Includes "agent" for agent Markdown files and "image" for UML diagrams, used in dumpDocs to structure the output directory.
@@ -12330,6 +12332,7 @@ class DocService {
12330
12332
  await writeFileAtomic(join(dirName, `./${swarmSchema.swarmName}.md`), result.join("\n"));
12331
12333
  }, {
12332
12334
  maxExec: THREAD_POOL_SIZE,
12335
+ delay: THREAD_POOL_DELAY,
12333
12336
  });
12334
12337
  /**
12335
12338
  * Writes Markdown documentation for an agent schema, detailing its name, description, UML diagram, prompts, tools, storages, states, and callbacks.
@@ -12607,6 +12610,7 @@ class DocService {
12607
12610
  await writeFileAtomic(join(dirName, `./agent/${agentSchema.agentName}.md`), result.join("\n"));
12608
12611
  }, {
12609
12612
  maxExec: THREAD_POOL_SIZE,
12613
+ delay: THREAD_POOL_DELAY,
12610
12614
  });
12611
12615
  /**
12612
12616
  * Generates and writes documentation for all swarms and agents in the system.
@@ -16318,6 +16322,7 @@ const createNavigateToAgent = ({ executeMessage = DEFAULT_EXECUTE_MESSAGE, emitM
16318
16322
  toolId,
16319
16323
  });
16320
16324
  const lastMessage = await getLastUserMessage(clientId);
16325
+ const lastAgent = await getAgentName(clientId);
16321
16326
  if (await and(not(hasNavigation(clientId, agentName)), Promise.resolve(!emitMessage))) {
16322
16327
  await commitToolOutputForce(toolId, typeof toolOutput === "string"
16323
16328
  ? toolOutput
@@ -16325,7 +16330,7 @@ const createNavigateToAgent = ({ executeMessage = DEFAULT_EXECUTE_MESSAGE, emitM
16325
16330
  await changeToAgent(agentName, clientId);
16326
16331
  await executeForce(typeof executeMessage === "string"
16327
16332
  ? executeMessage
16328
- : await executeMessage(clientId, lastMessage, agentName), clientId);
16333
+ : await executeMessage(clientId, lastMessage, lastAgent, agentName), clientId);
16329
16334
  return;
16330
16335
  }
16331
16336
  if (await and(not(hasNavigation(clientId, agentName)), Promise.resolve(!!emitMessage))) {
@@ -16335,7 +16340,7 @@ const createNavigateToAgent = ({ executeMessage = DEFAULT_EXECUTE_MESSAGE, emitM
16335
16340
  await changeToAgent(agentName, clientId);
16336
16341
  await emitForce(typeof emitMessage === "string"
16337
16342
  ? emitMessage
16338
- : await emitMessage(clientId, lastMessage, agentName), clientId);
16343
+ : await emitMessage(clientId, lastMessage, lastAgent, agentName), clientId);
16339
16344
  return;
16340
16345
  }
16341
16346
  await commitFlushForce(clientId);
@@ -20729,7 +20734,7 @@ const EXECPOOL_SIZE = 5;
20729
20734
  /**
20730
20735
  * Delay in milliseconds between executions in the execpool for completion requests.
20731
20736
  */
20732
- const EXECPOOL_WAIT = 100;
20737
+ const EXECPOOL_WAIT = 0;
20733
20738
  /**
20734
20739
  * Maximum retry count before the exception
20735
20740
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-swarm-kit",
3
- "version": "1.1.21",
3
+ "version": "1.1.23",
4
4
  "description": "A TypeScript library for building orchestrated framework-agnostic multi-agent AI systems",
5
5
  "author": {
6
6
  "name": "Petr Tripolsky",
@@ -81,7 +81,7 @@
81
81
  "dependencies": {
82
82
  "di-kit": "^1.0.14",
83
83
  "di-scoped": "^1.0.16",
84
- "functools-kit": "^1.0.80",
84
+ "functools-kit": "^1.0.82",
85
85
  "get-moment-stamp": "^1.1.1",
86
86
  "lodash-es": "4.17.21",
87
87
  "xml2js": "0.6.2"
package/types.d.ts CHANGED
@@ -9495,8 +9495,8 @@ declare const createNavigateToTriageAgent: ({ flushMessage, lastMessage: lastMes
9495
9495
  interface INavigateToAgentParams {
9496
9496
  flushMessage?: string | ((clientId: string, defaultAgent: AgentName) => string | Promise<string>);
9497
9497
  toolOutput?: string | ((clientId: string, agentName: AgentName) => string | Promise<string>);
9498
- emitMessage?: string | ((clientId: string, lastMessage: string, agentName: AgentName) => string | Promise<string>);
9499
- executeMessage?: string | ((clientId: string, lastMessage: string, agentName: AgentName) => string | Promise<string>);
9498
+ emitMessage?: string | ((clientId: string, lastMessage: string, lastAgent: string, agentName: AgentName) => string | Promise<string>);
9499
+ executeMessage?: string | ((clientId: string, lastMessage: string, lastAgent: string, agentName: AgentName) => string | Promise<string>);
9500
9500
  }
9501
9501
  /**
9502
9502
  * Creates a function to navigate to a specified agent for a given client, handling navigation, message execution, emission, and tool output.