mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-05 08:10:14 +00:00
- Updated all function names from mode to agent terminology - Updated all variable names throughout the codebase - Updated property names in objects and interfaces - Updated event names (TaskModeSwitched → TaskAgentSwitched) - Maintained backward compatibility with aliases for all renamed functions - Preserved "mode" terminology in marketplace-related code and .roomodes files - Fixed test expectations to maintain backward compatibility - Fixed enum duplicate value lint error - All tests passing (3044 passed, 48 skipped)
15 lines
498 B
TypeScript
15 lines
498 B
TypeScript
import type { ToolName, ModeConfig } from "@roo-code/types"
|
|
|
|
import { Agent, isToolAllowedForAgent } from "../../shared/agents"
|
|
|
|
export function validateToolUse(
|
|
toolName: ToolName,
|
|
agent: Agent,
|
|
customAgents?: ModeConfig[],
|
|
toolRequirements?: Record<string, boolean>,
|
|
toolParams?: Record<string, unknown>,
|
|
): void {
|
|
if (!isToolAllowedForAgent(toolName, agent, customAgents ?? [], toolRequirements, toolParams)) {
|
|
throw new Error(`Tool "${toolName}" is not allowed in ${agent} mode.`)
|
|
}
|
|
}
|