interface Message { sender: 'ai' | 'user'; content: string; at: string; } type ThreadStatus = 'active' | 'resolved' | 'waiting' | 'needs-reply' | 'review'; interface Thread { id: string; title: string; status: ThreadStatus; messages: Message[]; createdAt: string; updatedAt: string; } type ThreadFilter = ThreadStatus | 'inbox'; interface ThreadFilters { status?: ThreadFilter; } interface ListOptions { status?: ThreadFilter; json?: boolean; dir?: string; } interface CommandOptions { json?: boolean; dir?: string; from?: 'ai' | 'user'; status?: ThreadStatus; dryRun?: boolean; } declare function readThreads(dir: string): Promise; declare function writeThreads(dir: string, threads: Thread[]): Promise; declare function mutateThreads(dir: string, updater: (threads: Thread[]) => Promise | T): Promise; declare function createThread(dir: string, title: string): Promise; declare function listThreads(dir: string, filters?: ThreadFilters): Promise; declare function getThread(dir: string, id: string): Promise; declare function addMessage(dir: string, id: string, content: string, sender?: 'ai' | 'user', status?: ThreadStatus): Promise; declare function resolveThread(dir: string, id: string): Promise; declare function reopenThread(dir: string, id: string): Promise; declare function purgeThreads(dir: string, dryRun?: boolean): Promise; declare function formatAge(date: Date, now?: Date): string; declare function formatThreadList(threads: Thread[], now?: Date): string; declare function formatThread(thread: Thread): string; export { type CommandOptions, type ListOptions, type Message, type Thread, type ThreadFilter, type ThreadFilters, type ThreadStatus, addMessage, createThread, formatAge, formatThread, formatThreadList, getThread, listThreads, mutateThreads, purgeThreads, readThreads, reopenThread, resolveThread, writeThreads };