// src/index.ts import { authorizeAction } from './core'; /** * The "Sudo" wrapper for AI tools. */ // eslint-disable-next-line @typescript-eslint/no-explicit-any export function protect any>( toolName: string, fn: T ): (...args: Parameters) => Promise> { return async (...args: Parameters) => { const isAuthorized = await authorizeAction(toolName, args); if (!isAuthorized) { throw new Error(`Node9: Execution of ${toolName} was denied by the user.`); } return await fn(...args); }; }