/**
 * CredentialRebalancerSnapshot — pure mappers from the live system's state into the
 * balancer's read-only pass snapshot (Increment B, step B3b wiring helper).
 *
 * Spec: docs/specs/live-credential-repointing-rebalancer.md §2.4.
 *
 * The CredentialRebalancer orchestrator (B3a) consumes injected `listSlots` / `listAccounts`
 * / `resolveConfig` providers. These pure functions ARE those providers — they translate
 * the CredentialLocationLedger assignments and the SubscriptionPool accounts into the
 * policy's `SlotState` / `AccountState`, and clamp the configured balancer knobs into the
 * resolved config. Kept pure + out of server.ts so the mapping (the place a units/sign
 * bug would silently mis-steer the balancer) is unit-testable.
 */
import type { SlotState, AccountState } from './CredentialRebalancerPolicy.js';
import type { RebalancerResolvedConfig } from './CredentialRebalancer.js';
import type { SubscriptionAccount, SubscriptionAccountStatus } from './SubscriptionPool.js';
import type { CredentialAssignment } from './CredentialLocationLedger.js';
/**
 * Map the pool account lifecycle status into the policy's eligibility status.
 * Only needs-reauth/disabled are INELIGIBLE (dead credentials). rate-limited is `ok`:
 * a walled account must stay eligible so wall-avoidance can RESCUE its slot (its high
 * utilization % drives the wall objective; excluding it would strand the very slot that
 * needs help).
 */
export declare function mapAccountStatus(s: SubscriptionAccountStatus): AccountState['status'];
/** One pool account → the policy's AccountState. */
export declare function mapAccount(account: SubscriptionAccount, now: number): AccountState;
export declare function mapAccounts(accounts: readonly SubscriptionAccount[], now: number): AccountState[];
export interface SlotMapOptions {
    /** The config-home slot that is the default (`~/.claude`), so isDefault is set. */
    defaultSlot?: string | null;
    /** Optional per-slot busyness (recent activity); absent ⇒ 0 (drain has no busiest preference). */
    busynessBySlot?: Record<string, number>;
    /** Optional per-slot "drain in progress" hold (balancer-tracked); absent ⇒ false. */
    drainInProgressBySlot?: Record<string, boolean>;
    /** Optional per-slot last-audit-divergent flag (scheduled-audit-tracked); absent ⇒ false. */
    auditDivergentBySlot?: Record<string, boolean>;
}
/** One ledger assignment → the policy's SlotState. */
export declare function mapSlot(a: CredentialAssignment, opts: SlotMapOptions): SlotState;
export declare function mapSlots(assignments: readonly CredentialAssignment[], opts: SlotMapOptions): SlotState[];
/** A session snapshot the busyness computation reads — only these three fields. */
export interface BusynessSession {
    status: string;
    framework?: string;
    /** The pool account this session launched under (→ its current slot via the ledger). */
    subscriptionAccountId?: string;
}
/**
 * Per-slot busyness = count of RUNNING claude-code sessions on each slot (the drain
 * "busiest slot" signal, §2.4 — the balancer drains toward the busiest slot so an
 * expiring weekly window is spent where the work actually is). A session's slot is its
 * account's CURRENT slot (`slotOf(subscriptionAccountId)`); an UNTAGGED session (no pool
 * account — the default interactive session) counts toward the default slot. Non-running
 * or non-claude-code sessions don't count (only claude-code sessions read the credential
 * store the balancer steers). Pure; the live wiring passes `state.listSessions()`.
 */
export declare function computeBusynessBySlot(sessions: readonly BusynessSession[], slotOf: (accountId: string) => string | null, defaultSlot: string): Record<string, number>;
/** The raw balancer config block (subscriptionPool.credentialRepointing.balancer + siblings). */
export interface RawRebalancerConfig {
    passIntervalMs?: number;
    highWaterPct?: number;
    criticalPct?: number;
    maxForcedSwapsPerPass?: number;
    minScoreDelta?: number;
    drainHorizonHours?: number;
    drainHeadroomMinPct?: number;
    staleQuotaPollPeriods?: number;
    urgencyClampHours?: number;
    maxForcedOverridesPerWindow?: number;
    breakerThreshold?: number;
    auditCadenceMs?: number;
    desiredDefaultAccountId?: string | null;
    /** Number of slots — clamps maxForcedSwapsPerPass upper bound. */
    slotCount?: number;
}
/**
 * Clamp the configured knobs into the resolved config the orchestrator/policy use.
 * Cooldowns are DERIVED from the poll interval (per-pair ≥1×, per-tenant ≥2× — the
 * lag-sensored controller floors, §2.4); stale-quota is N poll periods.
 */
export declare function resolveRebalancerConfig(raw: RawRebalancerConfig): RebalancerResolvedConfig;
//# sourceMappingURL=CredentialRebalancerSnapshot.d.ts.map