export interface ReceiptOptions { /** Window in days. Default 7. */ sinceDays?: number; /** Output format. */ format?: "plain" | "json"; /** Override session-log root (testing). */ rootDir?: string; } interface ToolStat { calls: number; resultBytes: number; } export interface ReceiptStats { sessions: number; windowDays: number; inputTokens: number; cacheReadTokens: number; cacheCreationTokens: number; outputTokens: number; /** Sum of bytes returned by tool_result blocks. */ toolResultBytes: number; /** Per-tool aggregates, sorted by resultBytes desc. */ byTool: Array<{ name: string; } & ToolStat>; /** Worst single tool call (largest tool_result payload). */ worstCall: { tool: string; bytes: number; sessionFile: string; } | null; } export interface CostEstimate { /** Sonnet ratecard: $3/M input, $15/M output. */ sonnetUsd: number; /** Opus ratecard: $15/M input, $75/M output. */ opusUsd: number; projectedYearlyUsd: number; } /** * Walk the Claude Code session-log root and return every `.jsonl` file * modified within the last `sinceDays` days. Cursor logs are not yet * standardized in a known location; deferred. */ export declare function findSessionLogs(opts?: ReceiptOptions): string[]; /** * Build the receipt from all session logs in the window. Pure aggregation; * no I/O outside `findSessionLogs` and `readFileSync`. */ export declare function generateReceipt(opts?: ReceiptOptions): ReceiptStats; export declare function estimateCost(stats: ReceiptStats): CostEstimate; /** * Render the receipt for the terminal. Plain ASCII, no color — meant * to be screenshotable without garbled escape codes. */ export declare function renderReceipt(stats: ReceiptStats, cost: CostEstimate): string; /** Convenience wrapper for the CLI. */ export declare function runReceipt(opts?: ReceiptOptions): string; export {};