export type PermissionMode = "default" | "auto" | "full_access";
export declare const PERMISSION_MODES: readonly PermissionMode[];
export type PermissionBehavior = "allow" | "ask" | "deny";
export type PermissionPromptCategory = "cross_workspace" | "high_risk_delete" | "high_risk_egress" | "destructive";
export type PermissionRiskLevel = "read" | "write" | "system" | "external_egress";
export interface PermissionRuleEntry {
    pattern: string;
    pathPrefix?: string;
    behavior: PermissionBehavior;
    reason?: string;
    source?: string;
    /**
     * When set, the rule only matches if this operation-classification flag is true
     * (in addition to pattern/pathPrefix). Lets a rule target an operation property
     * (e.g. a shell command that performs network egress) rather than just a tool name.
     */
    requireOp?: "commandNetworkEgress";
}
export type PermissionDecisionReason = {
    type: "rule";
    rule: PermissionRuleEntry;
} | {
    type: "mode";
    mode: PermissionMode;
} | {
    type: "hook";
    hookName: string;
    reason: string;
} | {
    type: "classifier";
    classifier: string;
    reason: string;
} | {
    type: "tool_check";
    reason: string;
} | {
    type: "eligibility";
    reasonCodes: string[];
} | {
    type: "sandbox";
    reason: string;
} | {
    type: "other";
    reason: string;
};
export interface PermissionAllowResult {
    behavior: "allow";
    updatedInput?: Record<string, unknown>;
    decisionReason?: PermissionDecisionReason;
}
export interface PermissionAskResult {
    behavior: "ask";
    message: string;
    toolName: string;
    input?: Record<string, unknown>;
    category?: PermissionPromptCategory;
    semanticCheck?: "delete" | "egress";
    rememberScope?: {
        kind: "directory";
        path: string;
    };
    decisionReason?: PermissionDecisionReason;
}
export interface PermissionDenyResult {
    behavior: "deny";
    message: string;
    decisionReason: PermissionDecisionReason;
}
export type PermissionResult = PermissionAllowResult | PermissionAskResult | PermissionDenyResult;
export interface PermissionConfig {
    mode: PermissionMode;
}
export interface PermissionEngineConfig extends PermissionConfig {
    rules: PermissionRuleEntry[];
}
export interface ToolPermissionCheckInput {
    toolName: string;
    arguments?: Record<string, unknown>;
    meta?: {
        riskLevel?: PermissionRiskLevel;
        isReadOnly?: boolean;
        isDangerous?: boolean;
        requiresApproval?: boolean;
        parallelSafe?: boolean;
        isDelete?: boolean;
        isEgress?: boolean;
        egressCarriesData?: boolean;
    };
}
export interface ApprovalRequest {
    approvalId: string;
    callId: string;
    toolName: string;
    arguments?: Record<string, unknown>;
    message: string;
    /** Prompt category carried through from the decision pipeline (UI hint). */
    category?: PermissionPromptCategory;
    /** When set, the host may offer a "remember this directory" scope option. */
    rememberScope?: {
        kind: "directory";
        path: string;
    };
}
export interface ApprovalResponse {
    approvalId: string;
    decision: "allow" | "deny";
    updatedInput?: Record<string, unknown>;
    /** Approval scope chosen by the user: just this call, or the whole directory. */
    scope?: "once" | "directory";
}
export interface PermissionRuleEnginePort {
    getMode(): PermissionMode;
    setMode(mode: PermissionMode): void;
    getRules(): readonly PermissionRuleEntry[];
    replaceRules(rules: PermissionRuleEntry[]): void;
}
export interface PermissionApprovalResolver {
    resolveApproval(response: ApprovalResponse): void;
}
export interface PermissionMetadataResolver extends PermissionApprovalResolver {
    setToolMeta?(tools: Array<{
        function: {
            name: string;
        };
        meta?: ToolPermissionCheckInput["meta"];
    }>): void;
    ruleEngineRef?: PermissionRuleEnginePort;
}
