Add a tool to switch modes

This commit is contained in:
Matt Rubens
2025-01-24 02:38:15 -05:00
parent 0a32e24c6d
commit d1754cace0
9 changed files with 300 additions and 1 deletions

View File

@@ -166,11 +166,14 @@ export interface ClineSayTool {
| "listFilesRecursive"
| "listCodeDefinitionNames"
| "searchFiles"
| "switchMode"
path?: string
diff?: string
content?: string
regex?: string
filePattern?: string
mode?: string
reason?: string
}
// must keep in sync with system prompt

View File

@@ -15,6 +15,7 @@ export const TOOL_DISPLAY_NAMES = {
access_mcp_resource: "access mcp resources",
ask_followup_question: "ask questions",
attempt_completion: "complete tasks",
switch_mode: "switch modes",
} as const
// Define available tool groups
@@ -29,7 +30,7 @@ export const TOOL_GROUPS: Record<string, ToolGroupValues> = {
export type ToolGroup = keyof typeof TOOL_GROUPS
// Tools that are always available to all modes
export const ALWAYS_AVAILABLE_TOOLS = ["ask_followup_question", "attempt_completion"] as const
export const ALWAYS_AVAILABLE_TOOLS = ["ask_followup_question", "attempt_completion", "switch_mode"] as const
// Tool name types for type safety
export type ToolName = keyof typeof TOOL_DISPLAY_NAMES