import { PersistentStore } from '../state/persistent-store.js'; import type { ChannelIngressPolicyInput, ChannelPolicyAuditRecord, ChannelPolicyDecision, ChannelPolicyRecord, ChannelSurface } from './types.js'; interface ChannelPolicySnapshot extends Record { readonly policies: readonly ChannelPolicyRecord[]; readonly audit: readonly ChannelPolicyAuditRecord[]; } export declare class ChannelPolicyManager { private readonly store; private readonly policies; private readonly audit; private loaded; private auditFlushTimer; /** Whole-store writes run one at a time, in call order. See StoreWriteQueue. */ private readonly writes; constructor(options: { readonly store?: PersistentStore | undefined; readonly storePath?: string | undefined; }); start(): Promise; listPolicies(): ChannelPolicyRecord[]; listAudit(limit?: number): ChannelPolicyAuditRecord[]; getPolicy(surface: ChannelSurface): ChannelPolicyRecord; upsertPolicy(surface: ChannelSurface, patch: Partial>): Promise; evaluateIngress(input: ChannelIngressPolicyInput): Promise; private scheduleAuditFlush; /** * Flush any pending debounced audit writes and stop the flush timer. Call on * graceful shutdown so the last batch of audit records is durably persisted. */ stop(): Promise; /** * Write the policies and audit trail as they stand at THIS call, after every * write already queued has finished. * * Two paths write this file and they were ordered only against themselves: * `upsertPolicy` awaited its write, and the debounced audit flush ran on a * private chain. `evaluateIngress` schedules a flush on EVERY inbound message, * so a "disable this surface" ruling, or the owner-allowlist seeding that * decides which sender the surface answers at all, arriving while a flush was * in flight could be overwritten by that flush's older snapshot. The surface * comes back enabled, or the allowlist comes back empty and adopts the next * sender that speaks. */ private persist; } export {}; //# sourceMappingURL=policy-manager.d.ts.map