export type DeviationLevel = 'healthy' | 'warning' | 'medium' | 'severe' | 'no_data'; export type AnomalyKind = 'balance_drop_too_fast' | 'l1_api_stale' | 'no_byok_key' | 'price_table_outdated' | 'budget_exhausting' | 'budget_critical'; /** * 单 provider 的对账结果 (一个时间窗口内) */ export interface ReconciliationResult { provider: string; reconciled_at: string; window_start: string; window_end: string; /** L0: 本地 trajectory 估算的成本 USD */ l0_estimated_usd: number; /** L1: provider admin API 拉的真账单 USD (仅 OpenAI/Anthropic) */ l1_actual_usd?: number; /** L2: provider balance 在窗口内的下跌量 USD (仅 DeepSeek/Kimi 等) */ l2_balance_drop_usd?: number; /** 跟"真"对比的偏差百分比 (优先 L1 > L2) */ deviation_pct?: number; /** 偏差分级 */ level: DeviationLevel; /** 检测到的异常 */ anomalies: AnomalyKind[]; /** L2 当前余额 USD (仅 DeepSeek/Kimi 等有 balance) */ remaining_balance_usd?: number; /** L2 余额耗尽预测 (按当前 7 天日均) */ days_to_zero?: number | null; /** 人类可读的解释 (用于 surface 给 agent / 用户) */ human_summary: string; } /** * 对账窗口选项 */ export interface ReconcileOptions { /** ISO 8601 起始 (默认今日 00:00) */ start?: string; /** ISO 8601 结束 (默认现在) */ end?: string; /** 仅这些 provider (默认所有 vault 里有 key 的) */ providers?: string[]; } /** * Balance 历史快照 (持久化在 ~/.skillfm/balance-history.jsonl) */ export interface BalanceSnapshot { provider: string; timestamp: string; balance_usd: number; } //# sourceMappingURL=types.d.ts.map