/** * Persists the reversible pseudonym map outside searchable content in agent-scoped cache * storage. AES-256-GCM uses settings key material with dedicated AAD; plaintext persistence, * invalid snapshots, wrong keys, and tampering fail explicitly. The encrypted snapshot * contains a separate mint salt for stable pseudonyms. */ import { type PseudonymMapSnapshot } from "./pii-pseudonym-map.js"; import type { ScrubMarkerCache } from "./pii-scrub-markers.js"; /** * The single cache key the map is persisted under. Deliberately inside the * `pii:` namespace next to the scrub done-markers; the trailing `:v1` is the * BLOB FORMAT version (snapshot schema), not the scrub ruleset version. */ export declare const PII_PSEUDONYM_MAP_CACHE_KEY = "pii:pseudonym-map:v1"; /** Domain-separation AAD for the map ciphertext. */ export declare const PII_PSEUDONYM_MAP_AAD = "elizaos:pii-pseudonym-map:v1"; /** Thrown when the protected store cannot prove the artifact is intact. */ export declare class PseudonymMapStoreError extends Error { constructor(message: string); } /** * Persistence seam for the corpus pseudonym map. Implementations MUST keep the * artifact outside every retrieval surface (never a document/memory row, never * embedded, never indexed) — confidentiality is structural, not filter-based. */ export interface PseudonymMapStore { /** The persisted snapshot, or `null` when none exists yet. */ load(): Promise; /** Persist the snapshot (idempotent overwrite of the single artifact). */ save(snapshot: PseudonymMapSnapshot): Promise; } export interface EncryptedCachePseudonymMapStoreOptions { /** * Encryption salt. Defaults to the canonical secret-settings salt * (`getSalt()` — `SECRET_SALT`, production-enforced non-default). Tests pass * a fixed value. */ readonly encryptionSalt?: string; } /** * The default protected store: AES-256-GCM-encrypted blob in the runtime * cache under {@link PII_PSEUDONYM_MAP_CACHE_KEY}. See the module doc for the * confidentiality contract. */ export declare class EncryptedCachePseudonymMapStore implements PseudonymMapStore { private readonly cache; private readonly key; constructor(cache: ScrubMarkerCache, options?: EncryptedCachePseudonymMapStoreOptions); load(): Promise; save(snapshot: PseudonymMapSnapshot): Promise; }