import { type SessionListRow } from "../../../session-list-model.js"; export type ChatRecord = { id: string; workspaceId: string; title: string; updatedAt: number; pinned: boolean; archived: boolean; /** Present when the app holds a full or list row, needed for pin and archive. */ row: SessionListRow | null; /** When `row` was last read from the server (ms), so its status is known to be current. */ readAt: number; }; export declare function chatRecordFromRow(row: SessionListRow, readAt?: number): ChatRecord; /** * Changes when a row's status marks could change (working, waiting, needs you, * failed, unread, scheduled, creator), so a status-only change re-renders the * lists. Raw fields only: the marks themselves are drawn by the lazy lists. */ export declare function chatStatusKey(row: SessionListRow | null): string; /** Remember rows the app has read (sidebar pages, search results, the open chat). */ export declare function rememberChats(subjectId: string, rows: readonly SessionListRow[]): void; /** The chat was opened: move it to the front of the recent list. */ export declare function recordChatVisit(subjectId: string, row: SessionListRow): void; /** A chat was deleted or is no longer reachable: forget it. */ export declare function forgetChat(subjectId: string, chatId: string): void; /** The sidebar reports the chats it shows, in order, so next and previous follow it. */ export declare function setSidebarOrder(subjectId: string, workspaceId: string, order: readonly string[], pinnedOrder: readonly string[]): void; export type ChatDirectorySnapshot = Readonly<{ /** Chats in every workspace; each record names its workspace. */ rows: ReadonlyMap; /** Recently opened chats across workspaces, most recent first. */ recent: readonly string[]; /** The given workspace's sidebar order and pinned order. */ sidebarOrder: readonly string[]; pinnedOrder: readonly string[]; version: number; }>; export declare function readChatDirectory(subjectId: string, workspaceId: string): ChatDirectorySnapshot; /** Re-renders when the directory changes; read the snapshot through `readChatDirectory`. */ export declare function useChatDirectoryVersion(subjectId: string): number;