/**
 * Durable audit sink backed by the local SQLite store's append-only
 * `audit_events` ledger. Unlike {@link InMemoryAuditSink}, events survive
 * process restarts and do not grow unbounded in memory, which is what the
 * README's "append-only ledger" / "audit-safe structured events" contract
 * requires of a production bridge.
 *
 * The {@link AuditSink} interface is synchronous; `node:sqlite` is a synchronous
 * driver, so append/list map directly onto store calls with no buffering.
 */
export class SqliteAuditSink {
    #store;
    constructor(store) {
        this.#store = store;
    }
    append(event) {
        return this.#store.appendAuditEvent({
            type: event.type,
            severity: event.severity,
            message: event.message,
            metadata: event.metadata,
        });
    }
    list() {
        return this.#store.listAuditEvents();
    }
}
