export const AUTO_ALLOW_MODES = [
    "none",
    "writes",
    "commands",
    "all",
];
const WRITE_TOOLS = new Set(["write_file", "edit_file"]);
const COMMAND_TOOLS = new Set(["run_command"]);
/** Tools whose execution is gated by the permission prompt. */
export function isGatedTool(toolName) {
    return WRITE_TOOLS.has(toolName) || COMMAND_TOOLS.has(toolName);
}
/** True when `mode` would auto-allow `toolName` without prompting. */
export function shouldAutoAllow(mode, toolName) {
    if (mode === "all")
        return isGatedTool(toolName);
    if (mode === "writes")
        return WRITE_TOOLS.has(toolName);
    if (mode === "commands")
        return COMMAND_TOOLS.has(toolName);
    return false;
}
export function isAutoAllowMode(value) {
    return (value === "none" ||
        value === "writes" ||
        value === "commands" ||
        value === "all");
}
