import type { StoreInfo } from '../../models/usage-record.js'; /** * OpenCode stores its database under the XDG data directory. That single fact is * the most important thing in this file: a sandboxed launcher (the VSCode snap, * for one) exports its own XDG_DATA_HOME, so the *same user* can end up with two * completely disjoint OpenCode histories. On the machine this was developed * against, `~/.local/share/opencode` held 174 sessions while the snap's * XDG_DATA_HOME held the 276 sessions `opencode stats` actually reports. * * So we resolve the store the way OpenCode itself does (primary), and we also * *report* every other store we can find, rather than silently reading one and * pretending it is all the data. */ export declare function discoverOpenCodeStores(): StoreInfo[]; export declare function primaryStore(stores: StoreInfo[]): StoreInfo | undefined; /** * The latest write to a database, in ms. OpenCode runs in WAL mode, so a new * turn lands in `-wal` and reaches the main file only at a checkpoint: the main * file's mtime alone can trail the real last write by a whole session. * * An empty `-wal` is not a write. OpenCode deletes `-wal` when it closes, and * our own read-only open creates an empty one in its place, stamped with the * time of our read, so counting it made `status` report our sync as OpenCode * writing. A real write always leaves frames in `-wal`, and a checkpoint that * empties it also moves the main file's mtime. */ export declare function lastWriteMs(dbPath: string): number | undefined;