/**
 * Permission Manager — enforces per-tool access control and rate limiting.
 *
 * Reads the config file every CONFIG_CACHE_MS (default 15 s) so changes
 * made via the settings UI take effect without restarting the MCP server.
 *
 * Rate limiting uses an in-memory rolling 1-hour window.
 * If no config file exists the read-only preset is enforced (safe default).
 */
import { type RateLimitWindow, type ToolName, type ResponseLimits } from "../config/schema.js";
export interface PermissionResult {
    allowed: boolean;
    /** Human-readable reason, present only when allowed === false */
    reason?: string;
}
export declare class PermissionManager {
    private rateBuckets;
    private cachedConfig;
    private lastConfigLoad;
    /**
     * Check whether a tool may be called right now.
     *
     * When no config file exists the read-only preset is enforced — agents may
     * read, search, and view analytics, but cannot send, move, delete, tag, or
     * modify any email state. Users must explicitly grant broader access via
     * the settings UI (`npm run settings`) and save a config file.
     */
    check(tool: ToolName): PermissionResult;
    /**
     * Return current call counts for each rate-limited tool (for the status UI).
     */
    rateLimitStatus(): Record<string, {
        used: number;
        limit: number;
        window: RateLimitWindow;
    }>;
    /** Return current response-size limits (hot-reloaded via 15 s config cache). */
    getResponseLimits(): ResponseLimits;
    /** Force an immediate config reload (e.g., after the settings UI saves). */
    invalidate(): void;
    private refreshConfigIfStale;
    private consumeRateSlot;
}
/** Singleton shared across the MCP server process */
export declare const permissions: PermissionManager;
//# sourceMappingURL=manager.d.ts.map