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

@@ -21,6 +21,7 @@ export const toolUseNames = [
"access_mcp_resource",
"ask_followup_question",
"attempt_completion",
"switch_mode",
] as const
// Converts array of tool call names into a union type ("execute_command" | "read_file" | ...)
@@ -47,6 +48,8 @@ export const toolParamNames = [
"diff",
"start_line",
"end_line",
"mode_slug",
"reason",
] as const
export type ToolParamName = (typeof toolParamNames)[number]
@@ -114,3 +117,8 @@ export interface AttemptCompletionToolUse extends ToolUse {
name: "attempt_completion"
params: Partial<Pick<Record<ToolParamName, string>, "result" | "command">>
}
export interface SwitchModeToolUse extends ToolUse {
name: "switch_mode"
params: Partial<Pick<Record<ToolParamName, string>, "mode_slug" | "reason">>
}