/**
 * CycleTimeoutEnforcer -- Wall-clock timeout gate per agent cycle.
 *
 * Fires during PreToolUse. If the wall-clock elapsed time since cycle
 * start exceeds the configured limit the gate applies one of three
 * actions: pause (approval-queue resume required), terminate
 * (cycle ends immediately), or escalate (route to human-reviewer tier).
 *
 * P3-T1 coverage gap: Cycle timeout termination as first-class control.
 *
 * Compliance bindings:
 *   - EU AI Act Art. 14: human oversight -- escalate action routes to
 *     human reviewer at the timeout boundary.
 *   - DORA Art. 17: ICT incident management -- bounded cycle duration.
 *   - SOC 2 CC7.2: system monitoring / anomaly response.
 *   - ISO 42001 A.6.1.4: AI resource management.
 *
 * @connexum/ai-governance
 */
export declare class CycleTimeoutError extends Error {
    readonly agentId: string;
    readonly cycleId: string;
    readonly elapsedMs: number;
    readonly limitMs: number;
    readonly action: CycleTimeoutAction;
    readonly packBinding: string[];
    constructor(opts: {
        agentId: string;
        cycleId: string;
        elapsedMs: number;
        limitMs: number;
        action: CycleTimeoutAction;
        packBinding?: string[];
    });
}
export type CycleTimeoutAction = 'pause' | 'terminate' | 'escalate';
export interface CycleTimeoutConfig {
    /** Default max wall-clock ms per cycle. */
    perCycleMaxMs: number;
    /** Per-agent overrides. Agent ID -> max ms. */
    perAgentOverrides: Record<string, number>;
    /**
     * Per-pack overrides. Pack ID -> max ms.
     * Per-agent overrides take precedence over per-pack overrides.
     */
    perPackOverrides: Record<string, number>;
    /**
     * Action on timeout:
     *   'pause' (default): refuse next tool call, require approval-queue resume.
     *   'terminate': emit 'agent:cycle-terminated-by-timeout', cycle ends.
     *   'escalate': route to human-reviewer tier via approval queue.
     */
    onTimeout: CycleTimeoutAction;
    /**
     * Callback invoked when a timeout fires (for audit and routing integration).
     * The caller is responsible for routing escalate events to the approval queue.
     */
    onTimedOut?: (event: CycleTimeoutAuditEvent) => void;
}
export interface CycleTimeoutAuditEvent {
    type: 'agent:cycle-paused-by-timeout' | 'agent:cycle-terminated-by-timeout' | 'agent:cycle-escalated-by-timeout';
    agentId: string;
    cycleId: string;
    elapsedMs: number;
    limitMs: number;
    action: CycleTimeoutAction;
    /** ReviewerTier for escalate action. */
    reviewerTier?: 'human-reviewer';
    packBinding: string[];
    timestamp: string;
}
export declare class CycleTimeoutEnforcer {
    private readonly config;
    /** Map key: `${agentId}::${cycleId}` */
    private readonly cycles;
    constructor(config: CycleTimeoutConfig);
    /**
     * Register a cycle start. Must be called when a new agent cycle begins so
     * the enforcer has an accurate wall-clock start time.
     *
     * Idempotent -- calling again on the same key does not reset the clock.
     */
    startCycle(agentId: string, cycleId: string): void;
    /**
     * Resolve the timeout limit for a given agent and active pack set.
     */
    resolveLimit(agentId: string, activePackIds?: string[]): number;
    /**
     * PreToolUse hook entry point.
     *
     * Checks whether the cycle has exceeded its wall-clock limit.
     * If so, applies the configured action and throws synchronously.
     *
     * If `startCycle` was never called for this key the call is implicitly
     * registered now (first-tool-use assumption).
     *
     * @param agentId      Identity of the calling agent.
     * @param cycleId      Unique identifier for the current agent cycle.
     * @param activePackIds Active compliance pack IDs for override resolution.
     */
    hook(agentId: string, cycleId: string, activePackIds?: string[]): void;
    /**
     * Operator resume: clear the timedOut flag so a paused cycle may continue.
     * Only applicable when `onTimeout === 'pause'`. Terminated cycles are immutable.
     */
    resume(agentId: string, cycleId: string): void;
    /**
     * Mark a cycle as completed (removes it from tracking).
     */
    endCycle(agentId: string, cycleId: string): void;
    /**
     * Return elapsed ms for a cycle. Returns 0 if the cycle is unknown.
     */
    getElapsed(agentId: string, cycleId: string): number;
    /** Return whether a cycle has been terminated. */
    isTerminated(agentId: string, cycleId: string): boolean;
    /** Return whether a cycle is currently paused (timed out but not terminated). */
    isPaused(agentId: string, cycleId: string): boolean;
}
//# sourceMappingURL=cycle-timeout.d.ts.map