import type { AuditSinkDef } from '@moxxy/sdk'; import type { Session } from '../session.js'; import { type Logger } from '../logger.js'; import { type AuditProjectionOptions } from './project.js'; export interface AttachAuditOptions extends AuditProjectionOptions { readonly logger?: Logger; } export interface AuditHandle { /** Stop recording and flush. */ close(): Promise; /** True while writes are failing (the trail has a hole). */ readonly degraded: boolean; } /** * Stream a session's auditable events into a sink. * * Deliberately a SEPARATE subscription from session persistence rather than a * projection of it. The trail must survive an operator disabling session * persistence, and it records a different, smaller thing: not the conversation, * but who did what and whether it was allowed. * * Writes are fire-and-forget from the turn's perspective. Blocking a tool call * on a slow audit sink would make the trail a liveness risk, and an agent that * hangs because logging is slow is worse than one whose logging is behind. The * queue below keeps records ORDERED despite that, which the hash chain requires. */ export declare function attachAuditSink(session: Session, sink: AuditSinkDef, opts?: AttachAuditOptions): AuditHandle; //# sourceMappingURL=attach.d.ts.map