agent-swarm-kit 1.1.49 → 1.1.50

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
@@ -3694,7 +3694,7 @@ const createPlaceholder = () => GLOBAL_CONFIG.CC_EMPTY_OUTPUT_PLACEHOLDERS[Math.
3694
3694
  * @param {ClientAgent} self - The ClientAgent instance, providing context (e.g., clientId, agentName) and subjects.
3695
3695
  * @returns {Promise<void>} Resolves when the tool call completes or errors, with side effects via callbacks and subjects.
3696
3696
  */
3697
- const createToolCall = async (idx, tool, toolCalls, targetFn, self) => {
3697
+ const createToolCall = async (idx, tool, toolCalls, targetFn, reason, self) => {
3698
3698
  try {
3699
3699
  await targetFn.call({
3700
3700
  toolId: tool.id,
@@ -3703,6 +3703,7 @@ const createToolCall = async (idx, tool, toolCalls, targetFn, self) => {
3703
3703
  params: tool.function.arguments,
3704
3704
  isLast: idx === toolCalls.length - 1,
3705
3705
  abortSignal: self._toolAbortController.signal,
3706
+ callReason: reason,
3706
3707
  toolCalls,
3707
3708
  });
3708
3709
  targetFn.callbacks?.onAfterCall &&
@@ -3934,7 +3935,7 @@ const EXECUTE_FN = async (incoming, mode, self) => {
3934
3935
  console.warn(`agent-swarm no tool output after ${TOOL_NO_OUTPUT_WARNING_TIMEOUT}ms clientId=${self.params.clientId} agentName=${self.params.agentName} toolId=${tool.id} functionName=${tool.function.name}`);
3935
3936
  }
3936
3937
  });
3937
- createToolCall(idx, tool, toolCalls, targetFn, self);
3938
+ createToolCall(idx, tool, toolCalls, targetFn, message.content || "", self);
3938
3939
  const status = await statusAwaiter;
3939
3940
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_DEBUG &&
3940
3941
  self.params.logger.debug(`ClientAgent agentName=${self.params.agentName} clientId=${self.params.clientId} functionName=${tool.function.name} tool call end`);
package/build/index.mjs CHANGED
@@ -3692,7 +3692,7 @@ const createPlaceholder = () => GLOBAL_CONFIG.CC_EMPTY_OUTPUT_PLACEHOLDERS[Math.
3692
3692
  * @param {ClientAgent} self - The ClientAgent instance, providing context (e.g., clientId, agentName) and subjects.
3693
3693
  * @returns {Promise<void>} Resolves when the tool call completes or errors, with side effects via callbacks and subjects.
3694
3694
  */
3695
- const createToolCall = async (idx, tool, toolCalls, targetFn, self) => {
3695
+ const createToolCall = async (idx, tool, toolCalls, targetFn, reason, self) => {
3696
3696
  try {
3697
3697
  await targetFn.call({
3698
3698
  toolId: tool.id,
@@ -3701,6 +3701,7 @@ const createToolCall = async (idx, tool, toolCalls, targetFn, self) => {
3701
3701
  params: tool.function.arguments,
3702
3702
  isLast: idx === toolCalls.length - 1,
3703
3703
  abortSignal: self._toolAbortController.signal,
3704
+ callReason: reason,
3704
3705
  toolCalls,
3705
3706
  });
3706
3707
  targetFn.callbacks?.onAfterCall &&
@@ -3932,7 +3933,7 @@ const EXECUTE_FN = async (incoming, mode, self) => {
3932
3933
  console.warn(`agent-swarm no tool output after ${TOOL_NO_OUTPUT_WARNING_TIMEOUT}ms clientId=${self.params.clientId} agentName=${self.params.agentName} toolId=${tool.id} functionName=${tool.function.name}`);
3933
3934
  }
3934
3935
  });
3935
- createToolCall(idx, tool, toolCalls, targetFn, self);
3936
+ createToolCall(idx, tool, toolCalls, targetFn, message.content || "", self);
3936
3937
  const status = await statusAwaiter;
3937
3938
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_DEBUG &&
3938
3939
  self.params.logger.debug(`ClientAgent agentName=${self.params.agentName} clientId=${self.params.clientId} functionName=${tool.function.name} tool call end`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-swarm-kit",
3
- "version": "1.1.49",
3
+ "version": "1.1.50",
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
@@ -3384,6 +3384,7 @@ interface IAgentTool<T = Record<string, ToolValue>> extends ITool {
3384
3384
  params: T;
3385
3385
  toolCalls: IToolCall[];
3386
3386
  abortSignal: TAbortSignal;
3387
+ callReason: string;
3387
3388
  isLast: boolean;
3388
3389
  }): Promise<void>;
3389
3390
  /**