export type ConnectorId = 'anthropic' | 'openai' | 'deepseek' | 'qwen' | 'doubao' | 'kimi'; export interface UsageRecord { /** Connector 标识 */ provider: ConnectorId; /** 模型名 (e.g. "claude-3-5-sonnet-20241022", "gpt-4o-2024-11-20") */ model: string; /** 数据时间 (ISO 8601) */ timestamp: string; /** 输入 token 数 */ input_tokens: number; /** 输出 token 数 */ output_tokens: number; /** 估算花费 (USD) */ estimated_usd: number; /** 调用次数 (本聚合周期) */ calls: number; } export interface FetchUsageOptions { start_date: Date; end_date: Date; /** 最大返回条数,防爆 */ limit?: number; } export interface PingResult { ok: boolean; /** 错误信息,绝不含 key 全文 */ error?: string; /** key fingerprint (前 8 字符 hash, 安全) */ key_fingerprint?: string; } export interface Connector { id: ConnectorId; name: string; /** 是否真实现 (false = stub, Day 2 接) */ is_real: boolean; /** * 拉用量数据 — BYOK key 通过 byok_key 参数传入,函数 scope 结束应不再持有 */ fetchUsage(byok_key: string, opts: FetchUsageOptions): Promise; /** 验 key 有效性 — 不写库 */ ping(byok_key: string): Promise; } /** key 安全处理:返前 8 字符 hash 给日志 */ export declare function maskKey(key: string): string; /** 错误信息脱敏 — 移除可能的 key 子串 */ export declare function sanitizeError(err: unknown, byok_key: string): string; //# sourceMappingURL=types.d.ts.map