import type { PermissionRule, PermissionMode, PermissionResult, ToolCall } from '../types';
import { KillSwitch } from './killSwitch';
/**
 * Optional trust-ladder provider. When wired, PermissionEngine consults the
 * ladder BEFORE evaluating allow/deny rules and converts low rungs into
 * deny / ask decisions:
 *
 *   rung 0 (shadow)  → deny (observe only)
 *   rung 1 (suggest) → deny (surface a card, do not execute)
 *   rung 2 (ask)     → defer to normal rule evaluation
 *   rung 3 (confirm) → ask (typed confirmation expected upstream)
 *   rung 4 (act)     → defer (autonomous execution permitted)
 *
 * The provider is sync to keep evaluate() sync. Callers that need async
 * loading should snapshot the ladder once at startup and refresh on changes.
 */
export interface TrustLadderProvider {
    /** Map a tool call to a capability key. Return undefined to skip the gate. */
    capabilityOf(call: ToolCall): string | undefined;
    /** Current rung for a capability. */
    rungOf(capability: string): 0 | 1 | 2 | 3 | 4;
}
export declare class PermissionEngine {
    private rules;
    private mode;
    /**
     * Local kill-switch state used when no shared `KillSwitch` is wired. Tests
     * and standalone callers fall back to this; the server passes its shared
     * `KillSwitch` so per-session engines see live state.
     */
    private killSwitchActive;
    private killSwitchReason;
    private killSwitch?;
    private trustLadder?;
    constructor(rules?: PermissionRule[], mode?: PermissionMode, trustLadder?: TrustLadderProvider, killSwitch?: KillSwitch);
    /** Replace or clear the trust-ladder provider at runtime. */
    setTrustLadder(provider: TrustLadderProvider | undefined): void;
    /**
     * Attach (or detach) a shared `KillSwitch` after construction. Any future
     * kill-switch read/write goes through the shared instance.
     */
    setKillSwitch(killSwitch: KillSwitch | undefined): void;
    /** Engage the global kill switch. While active, every tool call is denied. */
    engageKillSwitch(reason?: string): void;
    /** Release the kill switch and resume normal evaluation. */
    releaseKillSwitch(): void;
    isKillSwitchActive(): boolean;
    getKillSwitchReason(): string;
    evaluate(call: ToolCall): PermissionResult;
    evaluateAsync(call: ToolCall): Promise<{
        allowed: boolean;
        reason?: string;
    }>;
    private matchesRule;
    private modeDefault;
    addRule(rule: PermissionRule): void;
    setMode(mode: PermissionMode): void;
    getMode(): PermissionMode;
    getRules(): ReadonlyArray<PermissionRule>;
    private requiresProtectedExternalFileConfirmation;
}
//# sourceMappingURL=engine.d.ts.map