import { getConfigSnapshot } from '../config/index.js';
import type { PermissionRequestHandler } from './prompt.js';
import type { PolicyRuntimeState } from '../runtime/permissions/policy-runtime.js';
import type { FeatureFlagManager } from '../runtime/feature-flags/index.js';
import type { HookDispatcher } from '../hooks/index.js';
import type { ConfigManager } from '../config/manager.js';
import type { PermissionCategory, PermissionCheckResult } from './types.js';
export type { PermissionMode } from '../config/schema.js';
export type { PermissionCategory, PermissionRiskLevel, PermissionDecisionSource, PermissionDecisionReasonCode, PermissionRequestAnalysis, PermissionCheckResult, } from './types.js';
type PermissionConfigSnapshot = ReturnType<typeof getConfigSnapshot>;
export interface PermissionConfigReader {
    isAutoApproveEnabled(): boolean;
    getSnapshot(): PermissionConfigSnapshot;
    getWorkingDirectory(): string | null;
}
export declare function createPermissionConfigReader(configManager: Pick<ConfigManager, 'get' | 'getRaw' | 'getWorkingDirectory'>): PermissionConfigReader;
/**
 * PermissionManager - Controls tool execution approval.
 *
 * Approval logic (priority order):
 *   1. --no-worries-just-vibes flag OR mode='allow-all' -> auto-approve everything
 *   2. mode='custom' -> check per-tool config action ('allow'/'prompt'/'deny')
 *   3. mode='prompt' (default) -> auto-approve reads, prompt for writes/execute/delegate
 *   4. Session approval cache hit -> use cached decision
 *   5. Ask the shell-owned permission controller and block until user responds
 */
export declare class PermissionManager {
    private sessionApprovals;
    private readonly requestPermission;
    private readonly configReader;
    private readonly hookDispatcher;
    private readonly policyRuntimeState;
    private readonly featureFlags;
    constructor(requestPermission: PermissionRequestHandler | undefined, configReader: PermissionConfigReader, policyRuntimeState: Pick<PolicyRuntimeState, 'recordPermissionRequest' | 'recordPermissionDecision' | 'getRegistry'>, hookDispatcher?: Pick<HookDispatcher, 'fire'> | null, featureFlags?: Pick<FeatureFlagManager, 'isEnabled'> | null);
    /**
     * check - Returns a Promise that resolves to true (approved) or false (denied).
     * Blocks orchestrator until the user responds when a prompt is needed.
     */
    check(toolName: string, args: Record<string, unknown>): Promise<boolean>;
    checkDetailed(toolName: string, args: Record<string, unknown>): Promise<PermissionCheckResult>;
    /** Returns the permission category for a tool name. Unknown tools default to 'delegate'. */
    getCategory(toolName: string, args?: Record<string, unknown>): PermissionCategory;
    /**
     * getApprovalKey - Stable key for session-level "always approve" decisions.
     * Includes the most meaningful argument to distinguish different invocations.
     */
    private getApprovalKey;
    private result;
    private evaluateRuntimePolicy;
    private mapEvaluatorDecision;
    private emitAndReturn;
    private fireHook;
}
//# sourceMappingURL=manager.d.ts.map