Skip to content

Commit e64d05d

Browse files
committed
patch
1 parent 97eb49f commit e64d05d

5 files changed

Lines changed: 17 additions & 5 deletions

File tree

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "agent-swarm-kit",
3-
"version": "1.1.157",
3+
"version": "1.1.158",
44
"description": "A TypeScript library for building orchestrated framework-agnostic multi-agent AI systems",
55
"author": {
66
"name": "Petr Tripolsky",

src/functions/alias/addAgentNavigation.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* @module addAgentNavigation
44
*/
55

6-
import { AgentName, ToolName } from "../../interfaces/Agent.interface";
6+
import { AgentName, IAgentTool, ToolName } from "../../interfaces/Agent.interface";
77
import swarm from "../../lib";
88
import { GLOBAL_CONFIG } from "../../config/params";
99
import beginContext from "../../utils/beginContext";
@@ -29,6 +29,8 @@ interface IAgentNavigationParams extends INavigateToAgentParams {
2929
navigateTo: AgentName;
3030
/** Optional documentation note for the tool.*/
3131
docNote?: string;
32+
/** Optional function to determine if the tool is available.*/
33+
isAvailable?: IAgentTool["isAvailable"];
3234
}
3335

3436
/**
@@ -40,6 +42,7 @@ const addAgentNavigationInternal = beginContext(
4042
docNote,
4143
description,
4244
navigateTo,
45+
isAvailable,
4346
...navigateProps
4447
}: IAgentNavigationParams) => {
4548
GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG && swarm.loggerService.log(METHOD_NAME);
@@ -49,6 +52,7 @@ const addAgentNavigationInternal = beginContext(
4952
const toolSchema = addTool({
5053
toolName,
5154
docNote,
55+
isAvailable,
5256
call: async ({ toolId, clientId, toolCalls }) => {
5357
if (toolCalls.length > 1) {
5458
console.error("agent-swarm addAgentNavigation model called multiple tools within navigation execution");

src/functions/alias/addTriageNavigation.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* @module addTriageNavigation
44
*/
55

6-
import { AgentName, ToolName } from "../../interfaces/Agent.interface";
6+
import { AgentName, IAgentTool, ToolName } from "../../interfaces/Agent.interface";
77
import swarm from "../../lib";
88
import { GLOBAL_CONFIG } from "../../config/params";
99
import beginContext from "../../utils/beginContext";
@@ -27,6 +27,8 @@ interface ITriageNavigationParams extends INavigateToTriageParams {
2727
description: string;
2828
/** Optional documentation note for the tool.*/
2929
docNote?: string;
30+
/** Optional function to determine if the tool is available.*/
31+
isAvailable?: IAgentTool["isAvailable"];
3032
}
3133

3234
/**
@@ -37,6 +39,7 @@ const addTriageNavigationInternal = beginContext(
3739
toolName,
3840
docNote,
3941
description,
42+
isAvailable,
4043
...navigateProps
4144
}: ITriageNavigationParams) => {
4245
GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG && swarm.loggerService.log(METHOD_NAME);
@@ -46,6 +49,7 @@ const addTriageNavigationInternal = beginContext(
4649
const toolSchema = addTool({
4750
toolName,
4851
docNote,
52+
isAvailable,
4953
call: async ({ toolId, clientId, toolCalls }) => {
5054
if (toolCalls.length > 1) {
5155
console.error("agent-swarm addTriageNavigation model called multiple tools within navigation execution");

types.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9814,6 +9814,8 @@ interface IAgentNavigationParams extends INavigateToAgentParams {
98149814
navigateTo: AgentName;
98159815
/** Optional documentation note for the tool.*/
98169816
docNote?: string;
9817+
/** Optional function to determine if the tool is available.*/
9818+
isAvailable?: IAgentTool["isAvailable"];
98179819
}
98189820
/**
98199821
* Creates and registers a navigation tool for an agent to navigate to another specified agent.
@@ -9839,6 +9841,8 @@ interface ITriageNavigationParams extends INavigateToTriageParams {
98399841
description: string;
98409842
/** Optional documentation note for the tool.*/
98419843
docNote?: string;
9844+
/** Optional function to determine if the tool is available.*/
9845+
isAvailable?: IAgentTool["isAvailable"];
98429846
}
98439847
/**
98449848
* Creates and registers a triage navigation tool for an agent to navigate to a triage agent.

0 commit comments

Comments
 (0)