import type Database from 'better-sqlite3-multiple-ciphers'; export type AuditChannel = 'gate' | 'mcp'; export interface AuditEntry { id: number; timestamp: string; credentialId: string | null; credentialName: string | null; service: string; targetDomain: string; method: string; path: string; status: 'allowed' | 'blocked' | 'system'; blockedReason: string | null; responseCode: number | null; agentName: string | null; agentTokenPrefix: string | null; channel: AuditChannel; } export interface LedgerQuery { service?: string; credentialName?: string; status?: 'allowed' | 'blocked' | 'system'; since?: string; limit?: number; agentName?: string; } export declare class Ledger { private db; constructor(db: Database.Database); /** * Record an allowed request. */ logAllowed(params: { credentialId: string; credentialName: string; service: string; targetDomain: string; method: string; path: string; responseCode?: number; agentName?: string; agentTokenPrefix?: string; channel?: AuditChannel; }): void; /** * Record a blocked request. */ logBlocked(params: { service: string; targetDomain: string; method: string; path: string; reason: string; agentName?: string; agentTokenPrefix?: string; channel?: AuditChannel; }): void; /** * Record a system lifecycle event (startup, shutdown, seal/unseal). */ logSystem(params: { service: string; targetDomain: string; method: string; path: string; reason: string; channel?: AuditChannel; }): void; /** * Query the audit log with optional filters. */ query(params?: LedgerQuery): AuditEntry[]; /** * Get summary stats for a time period, optionally filtered by agent. */ stats(since?: string, agentName?: string): { total: number; allowed: number; blocked: number; system: number; byService: Record; }; /** * Export audit log as CSV. */ exportCsv(params?: LedgerQuery): string; /** * Export audit log as a JSON array string. */ exportJson(params?: LedgerQuery): string; /** * Export audit log as streaming JSON Lines (one JSON object per line). * Each line is a self-contained JSON object — ideal for piping into * SIEM systems, log aggregators, or processing with tools like jq. */ exportJsonLines(params?: LedgerQuery): string; } //# sourceMappingURL=ledger.d.ts.map