/** * Audit trail and compliance export. * * Exports all memory-lifecycle events from the local store in a * tamper-evident format. Each export includes a chain hash: every event * record includes a `prevHash` field linking it to the previous event, * making any after-the-fact modification detectable. * * Output formats: JSON (default) or CSV. */ import type { MemoryStore } from "../db/store.js"; export interface AuditExportRow { seq: number; id: string; type: string; memoryId: string | null; payload: Record; machine: string; schemaVersion: number; createdAt: string; hash: string; prevHash: string; } export interface AuditExport { exportedAt: string; machine: string; totalEvents: number; chainHash: string; events: AuditExportRow[]; } /** * Export all events from the store as a tamper-evident audit trail. * Each event is chained to the previous one via a SHA-256 hash. */ export declare function exportAuditTrail(store: MemoryStore, opts?: { limit?: number; sinceSeq?: number; }): Promise; /** * Verify the integrity of an audit export by recomputing the chain hashes. * Returns true if all hashes match (no tampering detected). */ export declare function verifyAuditTrail(exportData: AuditExport): Promise; /** * Render an audit export as CSV. */ export declare function renderCsv(exportData: AuditExport): string; /** * Render a summary of the audit export for CLI display. */ export declare function renderAuditSummary(exportData: AuditExport): string;