/** * Persistence helpers for the vault-level policy document * (`_meta/policy`). Mirrors the bypass-AES pattern used by * `_meta/handle` — the policy document is plain JSON, the envelope's * `_iv` field is left empty. * * @see https://github.com/vLannaAi/noy-db-docs/blob/main/content/docs/services/session-tiers.md → Storage location * * @module */ import type { NoydbStore, VaultPolicy } from '../../kernel/types.js'; /** Reserved collection name for vault-level metadata documents. */ export declare const META_COLLECTION = "_meta"; /** Reserved id for the vault-level policy document. */ export declare const POLICY_RECORD_ID = "policy"; /** * Read the vault-level policy from `_meta/policy`. Returns `undefined` * when no policy has been persisted (fresh vault, or a vault written * before the policy module landed). The caller falls back to the * default preset. * * Tolerates corrupted documents the same way `_meta/handle` does: a * JSON parse failure surfaces as `undefined`, not a thrown error, so * a bad write never permanently locks a vault. */ export declare function loadVaultPolicy(store: NoydbStore, vault: string): Promise; /** * Persist the vault-level policy at `_meta/policy`. Idempotent — call * once at vault creation and again on `db.updatePolicy()` invocations. */ export declare function saveVaultPolicy(store: NoydbStore, vault: string, policy: VaultPolicy): Promise;