import type { ICapabilityToken, CapabilityRight } from './ICapabilityToken';
import type { SupervisionAction, ISupervisionError } from '../Supervision';
import type { IExitSignal } from '../../engine/mailbox/IMailbox';
import type { ISpawnRequest, ISpawnDecision } from './ISpawnPolicyService';
import type { IAuditService } from './IAuditService';
/**
 * Message direction for security policy lookup.
 */
export type MessageDirection = 'child-to-parent' | 'parent-to-child' | 'sibling' | 'external';
/**
 * Result of message verification.
 */
export interface IVerificationResult {
    allowed: boolean;
    reason?: string;
}
/**
 * Options for capability attenuation.
 */
export interface IAttenuationOptions {
    /** Rights to remove from the capability */
    removeRights?: CapabilityRight[];
    /** Additional caveats to add */
    addCaveats?: Record<string, unknown>;
    /** New expiration time (must be <= original) */
    expiresAt?: number;
}
/**
 * Options for minting new capabilities.
 */
export interface IMintOptions {
    /** Time to live in milliseconds (default: 1 hour) */
    ttlMs?: number;
    /** Additional caveats */
    caveats?: Record<string, unknown>;
}
/**
 * Security Realm interface.
 *
 * Joe Armstrong's insight: "Supervision tree = Security tree."
 * The supervisor that handles errors is the same entity that
 * enforces security policy for its children.
 *
 * Expert consensus (2025-12-14):
 * - NO interface split (ISP) - unified per Vision 27
 * - Composes existing Supervisor - no duplication
 * - Switch dispatch for policy sections - value objects
 *
 * See: Vision/27-SECURITY-FEDERATION-DRAFT.md
 * See: src/core/security/IMPLEMENTATION-PLAN-SECURITY.md
 */
export interface ISecurityRealm {
    /** Realm identifier (mount path) */
    readonly realm: string;
    /** Audit service for querying audit trail (Vision 27 Section 7) */
    readonly auditService: IAuditService;
    /**
     * Handle an error from a child component.
     * Delegates to composed Supervisor.
     */
    handleError(error: ISupervisionError): Promise<SupervisionAction>;
    /**
     * Handle an actor exit signal.
     * Delegates to composed Supervisor.
     */
    handleExitSignal(signal: IExitSignal): Promise<SupervisionAction>;
    /**
     * Get restart delay in milliseconds.
     */
    getRestartDelayMs(): number;
    /**
     * Check if strategy is 'restart-all'.
     */
    isRestartAllStrategy(): boolean;
    /**
     * Reset restart tracking for a child.
     */
    resetChild(childId: string): void;
    /**
     * Mint a new capability for a target.
     *
     * @param target - Mount path the capability grants access to
     * @param rights - Rights granted by this capability
     * @param options - Optional minting options
     * @returns New capability token
     */
    mintCapability(target: string, rights: CapabilityRight[], options?: IMintOptions): ICapabilityToken;
    /**
     * Attenuate a capability (reduce rights).
     *
     * Mark Miller: "Capabilities can only be attenuated, never amplified."
     *
     * @param token - Original capability token
     * @param options - Attenuation options
     * @returns Attenuated capability token
     */
    attenuateCapability(token: ICapabilityToken, options: IAttenuationOptions): ICapabilityToken;
    /**
     * Check if a capability is valid (not expired, not revoked).
     */
    isCapabilityValid(token: ICapabilityToken): boolean;
    /**
     * Revoke a capability by ID.
     */
    revokeCapability(tokenId: string): void;
    /**
     * Verify if a message is allowed by policy.
     *
     * @param direction - Message direction for policy lookup
     * @param capability - Optional capability token
     * @param context - Optional audit context (principal, target, command)
     * @returns Verification result
     */
    verifyMessage(direction: MessageDirection, capability?: ICapabilityToken, context?: {
        principal?: string;
        target?: string;
        command?: string;
    }): IVerificationResult;
    /**
     * Evaluate a spawn request against the security policy.
     *
     * Called before creating a child component to check if:
     * - The component type is allowed
     * - The props are acceptable (may be sanitized)
     * - The requestor has permission to spawn
     *
     * @param request - Spawn request details
     * @returns Decision with allowed/denied and optional modifications
     */
    evaluateSpawn(request: ISpawnRequest): ISpawnDecision;
}
//# sourceMappingURL=ISecurityRealm.d.ts.map