import type { MessageStats, SessionEntry, UserMessageLink, UserMessageStats } from "./types"; /** * Parse a session file and extract all assistant message stats. * Uses incremental reading with offset tracking. * * Service-tier carry-over: `currentServiceTier` is a session-scoped piece of * state derived from `service_tier_change` entries that affects whether * subsequent OpenAI assistant replies count as premium requests. Incremental * syncs that resume past the most-recent tier change would otherwise lose * that state and silently record `premiumRequests = 0` for priority traffic * (the coding-agent stopped folding the tier into `usage.premiumRequests` * after 13f59162e — the parser is now the sole source of truth). When * `fromOffset > 0` we therefore scan the bytes preceding `fromOffset` * for the latest service-tier value before parsing the unprocessed tail. * The scan only keeps the current tier and does not materialize prefix * entries, preserving offset-based memory behavior for large sessions. */ export interface ParseSessionResult { stats: MessageStats[]; userStats: UserMessageStats[]; userLinks: UserMessageLink[]; newOffset: number; } export declare function parseSessionFile(sessionPath: string, fromOffset?: number): Promise; /** * List all session directories (folders). */ export declare function listSessionFolders(): Promise; /** * List all session files in a folder. */ export declare function listSessionFiles(folderPath: string): Promise; /** * List all session files across all folders. */ export declare function listAllSessionFiles(): Promise; /** * Find a specific entry in a session file. */ export declare function getSessionEntry(sessionPath: string, entryId: string): Promise;