/** * File-backed DecisionLogStore. * * Appends one signed decision entry per line (NDJSON) to * ~/.agentguard//decisions.ndjson * * This is the default persistence used by the CLI/wizard path so that a signed * ledger survives across process runs and can be read by `agentguard serve` * and `aggregateLedger` without the user having to wire up Postgres or Redis. * * Same interface as PostgresDecisionLogStore / InMemoryDecisionLogStore. The * append is line-atomic (fs.appendFileSync of a single "\n"-terminated line), * so concurrent writers do not interleave partial lines. Ordering/chain * integrity remains the SpendGuard decision lock's responsibility. * * When `publicKeyHex` is supplied, it is embedded on each written line so that * `agentguard serve`'s click-to-verify and `aggregateLedger` integrity checks * can recover the verifying key from the ledger itself. The extra field is * ignored by the DecisionLogStore read path (only SignedDecisionLogEntry fields * are consumed by the SDK). * * Patent notice: Protected by U.S. patent-pending technology * (App. Nos. 63/983,615; 63/983,621; 63/983,843; 63/984,626; * 64/071,781; 64/071,789). */ import type { SignedDecisionLogEntry, DecisionLogStore } from '../types'; export interface NdjsonStoreOptions { /** Base directory. Defaults to AGENTGUARD_HOME or ~/.agentguard. */ home?: string; /** Optional hex public key embedded per line so the ledger is self-verifying. */ publicKeyHex?: string; } export declare class NdjsonDecisionLogStore implements DecisionLogStore { readonly filePath: string; private readonly publicKeyHex?; constructor(tenant: string, options?: NdjsonStoreOptions); append(entry: SignedDecisionLogEntry): Promise; getLatest(signerFingerprint?: string): Promise; read(fromSequence: number, limit: number, signerFingerprint?: string): Promise; /** Remove the underlying file (used by deterministic flows like `agentguard demo`). */ reset(): void; /** Parsed entries in sequence order, optionally filtered by signer. */ private readAll; } //# sourceMappingURL=ndjson-store.d.ts.map