/** * Date bucketing for the history overlay, mirroring TORUK Core's * `groupSessionsByDate` in `features/home/components/SessionsListPanel.jsx`. * * Kept out of the component so the rule can be tested on its own — the buckets * are the part with edge cases (midnight, the seven-day edge, a session that has * never been used, an unreadable timestamp), and none of that needs a DOM. */ import type { ChatSession } from '@/widget/controllers/createSessionStore'; import type { MessageKey } from '@/i18n'; export type HistoryBucket = { key: string; labelKey: MessageKey; items: ChatSession[]; }; /** * Bucket sessions by last activity, falling back to creation time. * * Two behaviours are Core's and deliberate: an unparseable timestamp lands in * Today rather than being dropped — a session the user can see must stay * reachable — and empty buckets are omitted so the list shows no bare headings. * Order within a bucket is left alone, because the store already sorted the list * by last activity descending. */ export declare function groupSessionsByDate(sessions: readonly ChatSession[]): HistoryBucket[];