/**
 * HookProfileSelector -- Per-agent posture dial with audited maintenance mode.
 *
 * Provides three named profiles (minimal / standard / strict) that bundle
 * related enforcement hooks into coherent postures. Operators pick one per
 * agent; the selector resolves which hook names are active for a given agent
 * at any point in time.
 *
 * Maintenance mode allows temporary, time-bounded, audited relaxation of hooks
 * above the safety floor. The minimal-profile hook set is the floor: it can
 * never be disabled via maintenance mode.
 *
 * See docs/runtime/hook-profile-selector.md for the full contract.
 *
 * BUILD_PLAN V3 line 267: "Hook profile selector (minimal / standard / strict)
 * with maintenance mode audit trail".
 *
 * Related PRs:
 *   PR #12 (cycle-token-budget), PR #13 (cycle-wall-clock-timeout),
 *   PR #14 (tool-rate-limit), PR #15 (session-memory),
 *   PR #17 (self-reflection-loop-detector), PR #18 (rag-source-allowlist),
 *   PR #19 (external-cross-check), PR #20 (rag-citation-enforcement).
 *
 * Compliance bindings:
 *   - HIPAA 164.308(a)(5): Security Awareness -- documented posture per agent
 *   - SOC 2 CC6.1: Logical access controls -- profile-bounded enforcement
 *   - EU AI Act Art. 9: Risk management -- tiered posture selection
 *   - ISO 42001 A.6.1.4: AI resource management -- maintenance audit trail
 *   - NIST 800-53 CM-3: Configuration change control -- profile change record
 *
 * @connexum/ai-governance
 */
export type HookProfile = 'minimal' | 'standard' | 'strict';
/**
 * MINIMAL profile hook set -- the absolute safety floor.
 *
 * These hooks are ALWAYS active regardless of profile or maintenance mode.
 * Maintenance mode CANNOT disable any hook in this set.
 *
 * - audit-chain:            SHA-256 tamper-evident audit trail (AuditIntegrity)
 * - capability-immutability: CapabilityBundle immutability enforcement
 * - web-permission-tier:    Agent web access level enforcement
 * - circuit-breaker:        CircuitBreaker fail-safe (3 failures = suspend)
 */
export declare const MINIMAL_HOOKS: ReadonlySet<string>;
/**
 * STANDARD profile additions on top of MINIMAL.
 *
 * - cycle-wall-clock-timeout: PR #13 -- wall-clock cycle timeout
 * - cycle-token-budget:       PR #12 -- per-cycle token budget gate
 * - session-memory-auto-clear: PR #15 -- session-scoped memory auto-clear
 * - tool-rate-limit:          PR #14 -- per-tool sliding-window rate gate
 *                             (pass-through by default when no rules configured)
 */
export declare const STANDARD_ADDITIONS: ReadonlySet<string>;
/**
 * STRICT profile additions on top of STANDARD.
 *
 * - rag-source-allowlist:         PR #18 -- retrieval source allowlisting
 * - rag-citation-enforcement:     PR #20 -- citation chain-of-custody
 * - self-reflection-loop-detector: PR #17 -- loop detection for self-reflecting agents
 * - external-cross-check:         PR #19 -- external verification of reflection outcomes
 *                                 (human-only mode by default; operator can flip to peer-agent)
 */
export declare const STRICT_ADDITIONS: ReadonlySet<string>;
/** Full hook set per profile (pre-computed for fast lookup). */
export declare const PROFILE_HOOKS: Record<HookProfile, ReadonlySet<string>>;
export declare class ProfileChangeReasonRequiredError extends Error {
    constructor();
}
export declare class MaintenanceDurationExceededError extends Error {
    constructor(requestedMs: number, maxMs: number);
}
export declare class MaintenanceCannotDisableFloorHookError extends Error {
    readonly hookName: string;
    constructor(hookName: string);
}
export declare class PackBindingRequiredError extends Error {
    constructor(operation: string);
}
export type HookProfileAuditEventType = 'PROFILE_CHANGED' | 'MAINTENANCE_MODE_ENTERED' | 'MAINTENANCE_MODE_EXITED' | 'MAINTENANCE_MODE_AUTO_EXITED' | 'HOOK_SKIPPED_BY_PROFILE';
export interface HookProfileAuditEvent {
    type: HookProfileAuditEventType;
    orgId: string;
    agentId: string;
    /** Severity level for downstream routing. */
    severity: 'NOTICE' | 'WARNING' | 'ERROR' | 'INFO';
    timestamp: string;
    /** SHA-256 hash of the previous event in this agent's profile chain (empty if first). */
    prevHash: string;
    /** SHA-256 hash of this event. */
    hash: string;
    data: Record<string, unknown>;
}
export interface SetProfileOptions {
    reason: string;
    packBinding: string[];
}
export interface EnterMaintenanceModeOptions {
    disabledHooks: string[];
    reason: string;
    durationMs: number;
    approvedBy: string;
}
/** 4 hours in milliseconds -- operators who need longer must explicitly renew. */
export declare const MAX_MAINTENANCE_DURATION_MS: number;
export declare class HookProfileSelector {
    /** key: `${orgId}::${agentId}` */
    private readonly profiles;
    /** key: `${orgId}::${agentId}` */
    private readonly maintenance;
    /** key: `${orgId}::${agentId}` -- last audit hash per agent */
    private readonly lastHashes;
    private readonly auditSink;
    constructor(auditSink?: (event: HookProfileAuditEvent) => void);
    /**
     * Set the active hook profile for an agent.
     *
     * @param orgId       Tenant / organisation identifier.
     * @param agentId     Agent identifier within the org.
     * @param profile     One of 'minimal' | 'standard' | 'strict'.
     * @param packBinding Compliance pack IDs that govern this agent (mandatory, non-empty).
     * @param reason      Human-readable explanation -- mandatory, must be non-empty.
     */
    setProfile(orgId: string, agentId: string, profile: HookProfile, packBinding: string[], reason: string): void;
    /**
     * Get the active profile for an agent. Returns 'standard' if not explicitly set.
     */
    getProfile(orgId: string, agentId: string): HookProfile;
    /**
     * Returns the set of currently enabled hook names for an agent.
     *
     * Resolution order:
     *   1. Start with the profile's base hook set.
     *   2. Subtract hooks currently disabled by maintenance mode.
     *   3. Apply operator explicit overrides (hook explicitly enabled wins even
     *      if maintenance mode disabled it; a hook explicitly disabled overrides
     *      the profile default).
     *
     * NOTE: Minimal-floor hooks are never returned as disabled -- maintenance mode
     * cannot subtract them and operator overrides cannot disable them.
     */
    getEnabledHooks(orgId: string, agentId: string): ReadonlySet<string>;
    /**
     * Returns whether a specific hook is currently enabled for an agent.
     *
     * This is the primary integration surface for enforcers. An enforcer calls
     * this at the top of its guard methods and becomes a pass-through when it
     * returns false.
     *
     * Usage pattern for new enforcers:
     *
     *   guardPreTool(orgId: string, agentId: string, ...): void {
     *     if (!selector.isHookEnabled(orgId, agentId, 'cycle-token-budget')) return;
     *     // ... existing guard logic ...
     *   }
     *
     * NOTE: Enforcers integrated via this API should emit a single
     * "hook skipped due to profile" audit event per cycle (not per call)
     * to avoid flooding the audit chain.
     */
    isHookEnabled(orgId: string, agentId: string, hookName: string): boolean;
    /**
     * Explicitly enable or disable a hook for an agent, overriding the profile
     * default. Floor hooks cannot be disabled.
     *
     * This is the operator-level escape hatch for individual hook customisation
     * beyond what the three profiles provide. Use sparingly.
     */
    setHookOverride(orgId: string, agentId: string, hookName: string, enabled: boolean): void;
    /**
     * Enter maintenance mode for an agent: temporarily disable specific hooks
     * above the safety floor.
     *
     * - Maximum duration: 4 hours (MAX_MAINTENANCE_DURATION_MS).
     * - Cannot disable floor hooks (minimal profile set).
     * - Reason and approvedBy are mandatory.
     * - Emits MAINTENANCE_MODE_ENTERED audit event at severity ERROR.
     * - Auto-exit fires MAINTENANCE_MODE_AUTO_EXITED at severity WARNING.
     *
     * PERSISTENCE CAVEAT (v0 limitation):
     *   The auto-exit timer is in-memory only. If the process restarts while
     *   maintenance mode is active, the timer will not fire and hooks will
     *   remain in whichever state they were last saved. On startup, callers
     *   should call checkMaintenanceExpiry() to expire any overdue entries.
     *   Persistent storage of maintenance-mode state (deadline checkpointing)
     *   is deferred to v1 as DEFERRED-HOOK-PROFILE-PERSIST-MAINTENANCE.
     */
    enterMaintenanceMode(orgId: string, agentId: string, opts: EnterMaintenanceModeOptions, packBinding: string[]): void;
    /**
     * Exit maintenance mode immediately and re-enable all temporarily-disabled hooks.
     *
     * Emits MAINTENANCE_MODE_EXITED at severity NOTICE.
     */
    exitMaintenanceMode(orgId: string, agentId: string): void;
    /**
     * Check whether a maintenance-mode entry has expired (for post-restart recovery).
     *
     * If the deadline has passed, fires auto-exit logic including the WARNING
     * audit event. Call this from application startup to handle the case where
     * a process restarted while maintenance mode was active.
     *
     * This is the v0 mitigation for the in-memory-timer limitation documented
     * in enterMaintenanceMode(). See DEFERRED-HOOK-PROFILE-PERSIST-MAINTENANCE.
     */
    checkMaintenanceExpiry(orgId: string, agentId: string): void;
    /**
     * Returns true when the agent is currently in maintenance mode.
     */
    isInMaintenanceMode(orgId: string, agentId: string): boolean;
    private autoExitMaintenanceMode;
    private key;
    private emitAudit;
}
//# sourceMappingURL=hook-profile.d.ts.map