export class ToolPermissionContext {
    denyTools;
    denyPrefixes;
    constructor(denyTools, denyPrefixes) {
        this.denyTools = denyTools;
        this.denyPrefixes = denyPrefixes;
    }
    static fromIterables(denyTools = [], denyPrefixes = []) {
        return new ToolPermissionContext(new Set(denyTools.map(t => t.toLowerCase())), denyPrefixes);
    }
    blocks(name) {
        const lower = name.toLowerCase();
        if (this.denyTools.has(lower))
            return true;
        return this.denyPrefixes.some(p => lower.startsWith(p.toLowerCase()));
    }
    createDenial(toolName, reason) {
        return { toolName, reason };
    }
}
