import { type RotateDecision } from './rotate-policy.js'; import type { UsageSnapshot } from './usage.js'; export interface DaemonProfile { name: string; dir: string; } export interface DaemonDeps { profiles: () => DaemonProfile[]; getActive: () => string; setActive: (name: string) => void; readUsage: (dir: string) => UsageSnapshot | null; flip: (targetDir: string) => void; threshold: number; log: (message: string) => void; now: () => number; } export interface TickResult { rotated: boolean; decision: RotateDecision; } /** * One evaluation: read every account's usage, decide, and (if the active * account is capped and a healthy one exists) flip the junction and persist the * new active account. Pure given its injected deps, so it is fully testable. */ export declare function tick(deps: DaemonDeps): TickResult; export interface RunDaemonOptions { /** The active junction dir, where usage-cache.json appears for the active account. */ watchDir: string; intervalMs: number; signal: AbortSignal; } /** Run the watch-and-rotate loop until aborted. Thin wrapper over tick(). */ export declare function runDaemon(deps: DaemonDeps, options: RunDaemonOptions): Promise;