import { type XdgOptions } from "./xdg.js"; import type { Plan } from "./plan.js"; import type { SourceWithContent } from "./synthesize.js"; import type { VerificationReport } from "./verify.js"; import type { CostEstimate } from "./pricing.js"; import type { RoundTrace } from "./agent.js"; export interface SessionRecord { schema: 1; id: string; createdAt: number; question: string; plan: Plan; rounds: RoundTrace[]; sources: SourceWithContent[]; answer: string; verification?: VerificationReport; cost: CostEstimate; llm: { baseUrl: string; model: string; }; parentId?: string; tags?: string[]; } export interface SessionMeta { id: string; createdAt: number; question: string; sourceCount: number; rounds: number; model: string; tags?: string[]; } export interface SessionStorageOptions { dir: string; } export declare function defaultSessionsDir(env?: Record, opts?: XdgOptions): string; export declare function generateSessionId(now?: Date): string; export declare function saveSession(record: SessionRecord, opts: SessionStorageOptions): Promise; export declare function loadSession(id: string, opts: SessionStorageOptions): Promise; export declare function listSessions(opts: SessionStorageOptions): Promise<{ sessions: SessionMeta[]; bad: string[]; }>; export declare function loadAllSessions(opts: SessionStorageOptions): Promise<{ records: SessionRecord[]; bad: string[]; }>; export declare function resolveSessionId(prefix: string, opts: SessionStorageOptions): Promise; export declare function renderSessionsList(metas: SessionMeta[]): string; export declare function normalizeTags(raw: string[]): string[]; export declare function tagSession(id: string, tags: string[], opts: SessionStorageOptions): Promise; export declare function untagSession(id: string, tags: string[], opts: SessionStorageOptions): Promise; export declare function humanDuration(ms: number): string; export declare function deleteSession(id: string, opts: SessionStorageOptions): Promise; export interface PruneCriteria { olderThanMs?: number; keep?: number; now?: number; } export declare function selectSessionsToPrune(metas: SessionMeta[], crit: PruneCriteria): SessionMeta[]; export declare function pruneSessions(opts: SessionStorageOptions, crit: PruneCriteria & { dryRun?: boolean; }): Promise<{ removed: SessionMeta[]; remaining: number; bad: string[]; }>; export declare function parseDuration(s: string | undefined): number | undefined; //# sourceMappingURL=sessions.d.ts.map