/**
 * AnthropicSubscriptionRouter — per-call routing between the two ALLOWED
 * Anthropic paths for internal intelligence calls:
 *
 *   - `claude -p` one-shots (anthropic-headless / ClaudeCliIntelligenceProvider)
 *     — the Agent SDK credit path post-2026-06-15. Prepaid accelerator.
 *   - the interactive REPL pool (InteractivePoolIntelligenceProvider)
 *     — the Max-subscription floor. Always available (Rule 1).
 *
 * Modes (intelligence.subscriptionPath.mode):
 *   - 'auto'  — drain the SDK pot while it's known-healthy, fall to the
 *               subscription floor when the pot is unknown/at-margin
 *               (decideSdkVsSubscription — same thresholds as the
 *               registry-level CostAwareRoutingPolicy, single source of
 *               truth). A failed primary gets ONE fallback attempt on the
 *               other path, with an onDegrade report — Rule 1 resilience.
 *   - 'force' — subscription pool ONLY. No SDK fallback: the whole point
 *               of force mode (soak tests, June-15 emergency lever) is
 *               proving/guaranteeing zero `claude -p` traffic. Failures
 *               are LOUD throws.
 *
 * Mode 'off' never constructs this class — buildIntelligenceProvider
 * returns the plain ClaudeCliIntelligenceProvider, byte-for-byte today's
 * behavior.
 *
 * This router sits INSIDE the circuit-breaker wrap (breaker stays
 * outermost), and BELOW the per-component IntelligenceRouter (framework
 * routing decides claude-vs-codex first; this decides WHICH Claude path).
 */
import type { IntelligenceProvider, IntelligenceOptions } from './types.js';
import type { AgentSdkCreditSnapshot } from '../providers/primitives/observability/usageMeterProvider.js';
import type { AccountUseDecision } from './AccountFollowMeSpendSlice.js';
export type SubscriptionPathMode = 'auto' | 'force';
export interface SubscriptionRouteInfo {
    /** Which path served (or was chosen for) the call. */
    path: 'sdk-credit' | 'subscription-pool';
    /** Decision reason (threshold text, 'forced', or fallback note). */
    reason: string;
    /** Attribution component when the caller supplied one. */
    component?: string;
}
export interface SubscriptionDegradeInfo {
    from: 'sdk-credit' | 'subscription-pool';
    to: 'sdk-credit' | 'subscription-pool';
    reason: string;
    component?: string;
}
export interface AnthropicSubscriptionRouterOptions {
    /** The `claude -p` provider (UNWRAPPED — the breaker wraps this router). */
    headless: IntelligenceProvider;
    /** The interactive-pool provider. */
    pool: IntelligenceProvider;
    mode: SubscriptionPathMode;
    /** Real credit reader (bootRegistration.buildReadSdkCredit) — never throws. */
    readSdkCredit: () => Promise<AgentSdkCreditSnapshot | null>;
    /** Mirrors CostAwareRoutingPolicy's default (10% of the monthly pot). */
    safetyMarginFraction?: number;
    /** Observability tap — every routing decision (T-05: no invisible routing). */
    onRoute?: (info: SubscriptionRouteInfo) => void;
    /** Observability tap — auto-mode fallback after a primary failure. */
    onDegrade?: (info: SubscriptionDegradeInfo) => void;
    /**
     * WS5.2 R7a (S5, §6.2) — OPTIONAL slice consultation. When account follow-me is enabled and
     * wired, the routing layer injects this to decide, AT SELECTION TIME, whether the subscription
     * path may use a BORROWED (follow-me) account this call or must fall back to this machine's OWN
     * account. It returns the same `AccountUseDecision` as `decideAccountUse` — `use:'own'` on EVERY
     * uncertainty (no slice / exhausted / expired / stale epoch / first-slice-under-partition / flag
     * off), `use:'borrowed'` only on a live current-epoch slice with remaining budget.
     *
     * ABSENT (the default, and ALWAYS when `multiMachine.accountFollowMe` is off) ⇒ this hook is
     * never invoked, so routing is BYTE-IDENTICAL to today. The router NEVER overspends a borrowed
     * account: it never reaches for one unless this consultation says `borrowed`, and a borrowed
     * selection here only ever scopes the subscription-pool path the pool provider already uses
     * (the pool's own account selection honors the decision via `onSliceConsult`).
     */
    consultSlice?: (options?: IntelligenceOptions) => AccountUseDecision;
    /** Observability tap — the slice consultation result for a subscription-path call. */
    onSliceConsult?: (info: {
        decision: AccountUseDecision;
        component?: string;
    }) => void;
}
export declare class AnthropicSubscriptionRouter implements IntelligenceProvider {
    private readonly opts;
    private readonly safetyMarginFraction;
    constructor(options: AnthropicSubscriptionRouterOptions);
    /**
     * WS5.2 R7a — run the (optional) slice consultation before a subscription-pool call. NO-OP when
     * `consultSlice` is unwired (the default / flag-off), so today's behavior is byte-identical. When
     * wired it surfaces the decision (own vs borrowed) to observability + the pool's account selection;
     * the router never overspends — a `use:'own'` keeps the pool on this machine's own account.
     */
    private consultSliceForSubscription;
    evaluate(prompt: string, options?: IntelligenceOptions): Promise<string>;
}
//# sourceMappingURL=AnthropicSubscriptionRouter.d.ts.map