/**
 * CycleTokenBudgetEnforcer -- Per-(agentId, cycleId) token budget gate.
 *
 * Tracks cumulative tokens consumed per cycle. Called from PostToolUse
 * when the LLM adapter reports token usage. On breach the gate either
 * pauses the cycle (default, requires operator approval-queue resume)
 * or terminates it immediately.
 *
 * P3-T1 coverage gap: Per-cycle token budgets with auto-pause.
 *
 * Compliance bindings:
 *   - HIPAA 164.312(b): Audit Controls -- bounded per-cycle scope
 *   - SOC 2 CC6.1: access control / resource limits
 *   - EU AI Act Art. 9: risk management (bounding inference spend per cycle)
 *   - ISO 42001 A.6.1.4: resource management for AI systems
 *
 * @connexum/ai-governance
 */
export declare class CycleTokenBudgetExceededError extends Error {
    readonly agentId: string;
    readonly cycleId: string;
    readonly tokensUsed: number;
    readonly tokenBudget: number;
    readonly packBinding: string[];
    constructor(opts: {
        agentId: string;
        cycleId: string;
        tokensUsed: number;
        tokenBudget: number;
        packBinding?: string[];
    });
}
export interface CycleTokenBudgetConfig {
    /** Default max tokens per cycle. */
    perCycleMaxTokens: number;
    /** Per-agent overrides. Agent ID -> max tokens. */
    perAgentOverrides: Record<string, number>;
    /**
     * Per-pack overrides. Pack ID -> max tokens.
     * Applied when the active pack ID matches. Per-agent overrides take
     * precedence over per-pack overrides.
     */
    perPackOverrides: Record<string, number>;
    /**
     * Breach action:
     *   'pause' (default): next PreToolUse call on the same cycle throws
     *     CycleTokenBudgetExceededError. The cycle cannot progress until
     *     an operator explicitly resumes via the approval queue.
     *   'terminate': cycle is immediately flagged as terminated and
     *     future tool calls are refused. Emits
     *     'agent:cycle-terminated-by-budget'.
     */
    onBreach: 'pause' | 'terminate';
    /**
     * Callback invoked when a cycle budget is breached (for audit integration).
     */
    onBreached?: (event: CycleTokenBudgetAuditEvent) => void;
}
export interface CycleTokenBudgetAuditEvent {
    type: 'agent:cycle-paused-by-budget' | 'agent:cycle-terminated-by-budget';
    agentId: string;
    cycleId: string;
    tokensUsed: number;
    tokenBudget: number;
    action: 'pause' | 'terminate';
    packBinding: string[];
    timestamp: string;
}
export declare class CycleTokenBudgetEnforcer {
    private readonly config;
    /** Map key: `${agentId}::${cycleId}` */
    private readonly cycles;
    constructor(config: CycleTokenBudgetConfig);
    /**
     * Resolve the token budget for a given agent and active pack set.
     */
    resolveBudget(agentId: string, activePackIds?: string[]): number;
    /**
     * PostToolUse hook entry point.
     *
     * Records `tokensUsed` for the cycle. If the cumulative total exceeds the
     * budget the gate marks the cycle as breached and emits an audit event.
     *
     * @param agentId      Identity of the calling agent.
     * @param cycleId      Unique identifier for the current agent cycle.
     * @param tokensUsed   Token count reported by the LLM adapter for this call.
     * @param activePackIds Active compliance pack IDs for override resolution.
     */
    recordUsage(agentId: string, cycleId: string, tokensUsed: number, activePackIds?: string[]): void;
    /**
     * PreToolUse hook entry point.
     *
     * Throws CycleTokenBudgetExceededError if the cycle has been breached and
     * the breach action is 'pause', or if the cycle was terminated.
     *
     * @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.
     */
    guardPreTool(agentId: string, cycleId: string, activePackIds?: string[]): void;
    /**
     * Operator resume: clears the breached flag so the cycle can continue.
     * Only meaningful when `onBreach === 'pause'`. Terminated cycles cannot
     * be resumed (immutable).
     */
    resume(agentId: string, cycleId: string): void;
    /**
     * Return the current token count for a cycle. Useful for monitoring and tests.
     */
    getUsage(agentId: string, cycleId: string): number;
    /**
     * Return whether a cycle is currently paused (breached but not terminated).
     */
    isPaused(agentId: string, cycleId: string): boolean;
    /**
     * Return whether a cycle was terminated.
     */
    isTerminated(agentId: string, cycleId: string): boolean;
    /** Remove cycle state (for testing / operator cleanup). */
    clearCycle(agentId: string, cycleId: string): void;
}
//# sourceMappingURL=cycle-token-budget.d.ts.map