/**
 * economy/router — EconomyRouter dual-mode (Sprint D).
 *
 * Decides WHICH model tier to use for a given task category, based on
 * observed cost-per-cycle data from OutcomeTracker. Sits ABOVE TierPolicy
 * (which produces the candidate set) and is informed by FleetCircuitBreaker.
 *
 * NOT to be confused with the compute-strategy router (withCompute, Sprint A)
 * or the legacy heuristic complexity router (src/router/llm-router.ts).
 *
 * Substrate-pure: no consumer-specific product references.
 */
import type { ModelTier, TierPolicy } from "./tier-policy.js";
import type { OutcomeTracker } from "./outcome-tracker.js";
import type { FleetCircuitBreaker } from "./circuit-breaker.js";
export type EconomyMode = "degraded" | "full";
export interface EconomyRouterConfig {
    mode: EconomyMode;
    policy: TierPolicy;
    tracker: OutcomeTracker;
    breaker: FleetCircuitBreaker;
    /** Fraction of budget to leave as buffer when filtering tiers by cost. Default 0.1 (10%). */
    budgetBuffer?: number;
}
export interface RouteDecision {
    tier: ModelTier;
    mode: EconomyMode;
    reason: string;
    blockedByBreaker: boolean;
}
/**
 * EconomyRouter — model tier selector informed by observed costs.
 *
 * Degraded mode: cost lookup is per task category.
 * Full mode (Sprint C): cost lookup is per skillId. Falls back to degraded
 *   when no skill data is available.
 */
export declare class EconomyRouter {
    private readonly _mode;
    private readonly _policy;
    private readonly _tracker;
    private readonly _breaker;
    private readonly _budgetBuffer;
    /** Total `route()` calls. */
    private _totalRouteCalls;
    /** Calls where `blockedByBreaker` was false. */
    private _nonBlockedRouteCalls;
    constructor(config: EconomyRouterConfig);
    /**
     * Decide which tier to use for a task.
     *
     * Caller is responsible for honouring `blockedByBreaker` — when true,
     * the returned tier is informational and the caller should typically
     * defer or run a degraded execution path.
     */
    route(category: string, opts?: {
        skillId?: string;
        budgetRemainingUsd?: number;
    }): RouteDecision;
    /**
     * Record outcome of a completed cycle. Propagates to OutcomeTracker
     * (which computes cost from pricing) AND to FleetCircuitBreaker.
     *
     * The model identifier sent to the tracker is `provider/model` per
     * tracker convention.
     */
    recordOutcome(runId: string, tier: ModelTier, inputTokens: number, outputTokens: number, durationMs: number, opts?: {
        skillId?: string;
        outcomeValue?: number;
        category?: string;
    }): void;
    /**
     * Routing rate: fraction of `route()` calls that returned non-blocked.
     * 0 when no calls have been made (cannot divide by zero).
     */
    get routingRate(): number;
    /**
     * Compute average cost-per-cycle observed within the rolling window.
     *
     * In "full" mode with a skillId, we filter records by skillId.
     * Falls back to category filtering when:
     *   - mode is degraded, OR
     *   - skillId is undefined, OR
     *   - no records match the skillId.
     *
     * Returns undefined when no records match (caller treats as "no history").
     */
    private _observedAvgCostUsd;
    /**
     * Estimate the cost (USD) of one tier call. Used for budget filtering.
     * Heuristic: assume 1k output tokens per call (output dominates cost).
     */
    private _estimateCallCost;
    /** Return the cheapest tier in a non-empty list (by output cost). */
    private _cheapest;
}
//# sourceMappingURL=router.d.ts.map