/** * Aggregated token usage parsed from a Claude CLI stream-json log file. * All fields are null when no usage data is available (e.g. copilot backend). */ export interface TokenUsage { inputTokens: number | null; outputTokens: number | null; cacheCreationInputTokens: number | null; cacheReadInputTokens: number | null; } /** * Parses token usage totals from Claude CLI stream-json log content. * * Each line of the log is a JSON object. Lines with `type === "assistant"` carry * a `message.usage` object with snake_case token counts. Multiple lines may share * the same top-level `uuid` (streaming chunks of the same message) — we deduplicate * by uuid, keeping the last occurrence, then sum across unique messages. * * For the `copilot` backend, no structured token data is available, so all-null * values are returned immediately. * * @param logContent - Raw string content of the log file (newline-separated JSON) * @param backend - The backend that produced the log ('claude' | 'copilot') * @returns Aggregated token counts, or all-null if unavailable */ export declare function parseTokenUsageFromLog(logContent: string, backend: string): TokenUsage; /** * Convenience wrapper that reads a log file from disk and calls `parseTokenUsageFromLog`. * * Returns all-null TokenUsage if the file does not exist or cannot be read. * * @param logFilePath - Absolute path to the Claude CLI log file * @param backend - The backend that produced the log ('claude' | 'copilot') * @returns Aggregated token counts, or all-null if unavailable */ export declare function parseTokenUsageFromFile(logFilePath: string, backend: string): TokenUsage; //# sourceMappingURL=token-parser.d.ts.map