/** * WikiHistoryService — per-page revision history (who changed what). * * Before a page is overwritten, superseded, accepted from a proposal, or * deleted, its previous content is snapshotted to * `/.wiki-history//.md` together with the author. * That gives multi-writer vaults (several teachers, several agents) an * audit trail without depending on the vault living in a git repository. * Capped per page; oldest snapshots roll off. * * @module services/wiki/wiki-history.service */ /** One snapshot. */ export interface WikiRevision { at: string; /** Who made the change that replaced this content. */ author: string; /** `write` | `supersede` | `accept_proposal` | `delete` */ action: string; bytes: number; file: string; } /** * Snapshots prior page content under `.wiki-history/`. */ export declare class WikiHistoryService { private readonly now; private static instance; private readonly logger; constructor(now?: () => Date); static getInstance(): WikiHistoryService; /** Test-only reset. */ static _resetForTesting(): void; /** * Snapshot the current content of a page before it changes. No-op when * the page does not exist yet. Never throws. * * @param vaultPath - Vault root * @param relativePath - Vault-relative page path * @param author - Session/user making the change * @param action - What is about to happen * @returns The revision written, or null */ snapshot(vaultPath: string, relativePath: string, author: string, action: string): Promise; /** * List revisions of a page, newest first. * * @param vaultPath - Vault root * @param relativePath - Vault-relative page path * @returns Revisions */ list(vaultPath: string, relativePath: string): Promise; /** * Read one revision's content (meta line stripped). * * @param file - Absolute snapshot file (from {@link list}) * @returns Content */ read(file: string): Promise; private historyDir; private prune; } //# sourceMappingURL=wiki-history.service.d.ts.map