@noy-db/hub 0.2.0-pre.8 → 0.2.0-pre.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/dist/attestation/index.d.cts +1 -1
  2. package/dist/attestation/index.d.ts +1 -1
  3. package/dist/blobs/index.d.cts +2 -2
  4. package/dist/blobs/index.d.ts +2 -2
  5. package/dist/bundle/index.cjs +160 -0
  6. package/dist/bundle/index.cjs.map +1 -1
  7. package/dist/bundle/index.d.cts +3 -3
  8. package/dist/bundle/index.d.ts +3 -3
  9. package/dist/bundle/index.js +1 -1
  10. package/dist/{chunk-6774ZOQ7.js → chunk-6CME4UEK.js} +154 -1
  11. package/dist/chunk-6CME4UEK.js.map +1 -0
  12. package/dist/consent/index.d.cts +2 -2
  13. package/dist/consent/index.d.ts +2 -2
  14. package/dist/derivations/index.d.cts +3 -3
  15. package/dist/derivations/index.d.ts +3 -3
  16. package/dist/{dev-unlock-p3ysikWP.d.ts → dev-unlock-B4kDxep_.d.ts} +1 -1
  17. package/dist/{dev-unlock-M4VAWNq_.d.cts → dev-unlock-BIoEFbwm.d.cts} +1 -1
  18. package/dist/guards/index.d.cts +3 -3
  19. package/dist/guards/index.d.ts +3 -3
  20. package/dist/{hash-BPsYPcv_.d.cts → hash-DdpVypUp.d.cts} +1 -1
  21. package/dist/{hash-C1GtiOhR.d.ts → hash-HJqD14vS.d.ts} +1 -1
  22. package/dist/history/index.d.cts +3 -3
  23. package/dist/history/index.d.ts +3 -3
  24. package/dist/i18n/index.d.cts +2 -2
  25. package/dist/i18n/index.d.ts +2 -2
  26. package/dist/index.cjs +153 -0
  27. package/dist/index.cjs.map +1 -1
  28. package/dist/index.d.cts +9 -9
  29. package/dist/index.d.ts +9 -9
  30. package/dist/index.js +1 -1
  31. package/dist/materialized-views/index.d.cts +3 -3
  32. package/dist/materialized-views/index.d.ts +3 -3
  33. package/dist/{noydb-LZBH3XDK.js → noydb-G725ZSZG.js} +2 -2
  34. package/dist/overlay-views/index.d.cts +3 -3
  35. package/dist/overlay-views/index.d.ts +3 -3
  36. package/dist/periods/index.d.cts +2 -2
  37. package/dist/periods/index.d.ts +2 -2
  38. package/dist/session/index.d.cts +3 -3
  39. package/dist/session/index.d.ts +3 -3
  40. package/dist/shadow/index.d.cts +2 -2
  41. package/dist/shadow/index.d.ts +2 -2
  42. package/dist/snapshots/index.cjs +37 -3
  43. package/dist/snapshots/index.cjs.map +1 -1
  44. package/dist/snapshots/index.d.cts +12 -5
  45. package/dist/snapshots/index.d.ts +12 -5
  46. package/dist/snapshots/index.js +37 -3
  47. package/dist/snapshots/index.js.map +1 -1
  48. package/dist/store/index.d.cts +2 -2
  49. package/dist/store/index.d.ts +2 -2
  50. package/dist/sync/index.d.cts +1 -1
  51. package/dist/sync/index.d.ts +1 -1
  52. package/dist/team/index.d.cts +2 -2
  53. package/dist/team/index.d.ts +2 -2
  54. package/dist/tx/index.d.cts +2 -2
  55. package/dist/tx/index.d.ts +2 -2
  56. package/dist/{types-DGU60JDt.d.ts → types-Df28QFKb.d.ts} +43 -1
  57. package/dist/{types-DjunxzJa.d.cts → types-DyXYr8rE.d.cts} +43 -1
  58. package/dist/{ulid-BFJkYRRW.d.ts → ulid-CJ8RzRrm.d.ts} +1 -1
  59. package/dist/{ulid-DPeuPgi3.d.cts → ulid-Drr7ykr6.d.cts} +1 -1
  60. package/dist/{with-derivation-DfOpKjFw.d.ts → with-derivation-DFnFByiQ.d.ts} +1 -1
  61. package/dist/{with-derivation-Df0kMlED.d.cts → with-derivation-DU3Sjazm.d.cts} +1 -1
  62. package/dist/{with-guard-C6W5RVrH.d.cts → with-guard-ByyxmEe7.d.cts} +1 -1
  63. package/dist/{with-guard-0KksDtSR.d.ts → with-guard-qube6BMI.d.ts} +1 -1
  64. package/dist/{with-materialized-view-BiasFcYx.d.ts → with-materialized-view-BLkQxoQN.d.ts} +1 -1
  65. package/dist/{with-materialized-view-BmDKyHrm.d.cts → with-materialized-view-BmEToIR1.d.cts} +1 -1
  66. package/dist/{with-overlayed-view-CA66vhHz.d.cts → with-overlayed-view-BMsQQbWm.d.cts} +1 -1
  67. package/dist/{with-overlayed-view-CQViuko_.d.ts → with-overlayed-view-CRsSEwHR.d.ts} +1 -1
  68. package/package.json +3 -3
  69. package/dist/chunk-6774ZOQ7.js.map +0 -1
  70. /package/dist/{noydb-LZBH3XDK.js.map → noydb-G725ZSZG.js.map} +0 -0
@@ -1,5 +1,5 @@
1
- import { aB as NoydbBundleStore, aC as RetentionPolicy, aD as SnapshotStrategy } from '../types-DjunxzJa.cjs';
2
- export { aE as SnapshotMeta } from '../types-DjunxzJa.cjs';
1
+ import { aB as NoydbBundleStore, aC as RetentionPolicy, aD as SnapshotPolicy, aE as SnapshotStrategy } from '../types-DyXYr8rE.cjs';
2
+ export { aF as SnapshotMeta, aG as SnapshotMode } from '../types-DyXYr8rE.cjs';
3
3
  export { f as SnapshotNotFoundError } from '../index-4fBVt8j9.cjs';
4
4
  import '../lazy-builder-wY4pMCEe.cjs';
5
5
  import '../predicate-BSAGEyu5.cjs';
@@ -11,11 +11,18 @@ interface WithSnapshotsOptions {
11
11
  /** Bundle store where snapshot blobs and the sidecar index are written. */
12
12
  store: NoydbBundleStore;
13
13
  /**
14
- * Declarative retention policy. Enforced eagerly after each `snapshot()` call.
15
- * Defaults to no retention (all snapshots kept forever).
14
+ * Declarative retention policy. Enforced eagerly after each on-demand `snapshot()`.
15
+ * Defaults to no retention (all on-demand snapshots kept forever). Never affects
16
+ * the rolling auto-snapshot.
16
17
  */
17
18
  retention?: RetentionPolicy;
19
+ /**
20
+ * Automatic-snapshot cadence. Default `mode:'manual'` ⇒ no timers; snapshots
21
+ * stay on-demand. Set `mode:'debounce'`/`'interval'` to enable auto-snapshots
22
+ * to the rolling `<vault>__auto` key.
23
+ */
24
+ snapshotPolicy?: SnapshotPolicy;
18
25
  }
19
26
  declare function withSnapshots(opts: WithSnapshotsOptions): SnapshotStrategy;
20
27
 
21
- export { RetentionPolicy, SnapshotStrategy, type WithSnapshotsOptions, withSnapshots };
28
+ export { RetentionPolicy, SnapshotPolicy, SnapshotStrategy, type WithSnapshotsOptions, withSnapshots };
@@ -1,5 +1,5 @@
1
- import { aB as NoydbBundleStore, aC as RetentionPolicy, aD as SnapshotStrategy } from '../types-DGU60JDt.js';
2
- export { aE as SnapshotMeta } from '../types-DGU60JDt.js';
1
+ import { aB as NoydbBundleStore, aC as RetentionPolicy, aD as SnapshotPolicy, aE as SnapshotStrategy } from '../types-Df28QFKb.js';
2
+ export { aF as SnapshotMeta, aG as SnapshotMode } from '../types-Df28QFKb.js';
3
3
  export { f as SnapshotNotFoundError } from '../index-D8I_pyJD.js';
4
4
  import '../lazy-builder-7tIpFyWN.js';
5
5
  import '../predicate-BSAGEyu5.js';
@@ -11,11 +11,18 @@ interface WithSnapshotsOptions {
11
11
  /** Bundle store where snapshot blobs and the sidecar index are written. */
12
12
  store: NoydbBundleStore;
13
13
  /**
14
- * Declarative retention policy. Enforced eagerly after each `snapshot()` call.
15
- * Defaults to no retention (all snapshots kept forever).
14
+ * Declarative retention policy. Enforced eagerly after each on-demand `snapshot()`.
15
+ * Defaults to no retention (all on-demand snapshots kept forever). Never affects
16
+ * the rolling auto-snapshot.
16
17
  */
17
18
  retention?: RetentionPolicy;
19
+ /**
20
+ * Automatic-snapshot cadence. Default `mode:'manual'` ⇒ no timers; snapshots
21
+ * stay on-demand. Set `mode:'debounce'`/`'interval'` to enable auto-snapshots
22
+ * to the rolling `<vault>__auto` key.
23
+ */
24
+ snapshotPolicy?: SnapshotPolicy;
18
25
  }
19
26
  declare function withSnapshots(opts: WithSnapshotsOptions): SnapshotStrategy;
20
27
 
21
- export { RetentionPolicy, SnapshotStrategy, type WithSnapshotsOptions, withSnapshots };
28
+ export { RetentionPolicy, SnapshotPolicy, SnapshotStrategy, type WithSnapshotsOptions, withSnapshots };
@@ -22,6 +22,9 @@ var SnapshotEngine = class {
22
22
  snapKey(vaultName, n) {
23
23
  return `${vaultName}__snap_${n.toString().padStart(6, "0")}`;
24
24
  }
25
+ autoKey(vaultName) {
26
+ return `${vaultName}__auto`;
27
+ }
25
28
  async readIndex(vaultName) {
26
29
  const result = await this.store.readBundle(this.indexKey(vaultName));
27
30
  if (!result) return { index: { snapshots: [], nextCounter: 1 }, indexVersion: null };
@@ -48,7 +51,9 @@ var SnapshotEngine = class {
48
51
  };
49
52
  const newIndex = {
50
53
  snapshots: [...index.snapshots, meta],
51
- nextCounter: index.nextCounter + 1
54
+ nextCounter: index.nextCounter + 1,
55
+ // Preserve the rolling auto slot — on-demand snapshots never touch it.
56
+ ...index.auto ? { auto: index.auto } : {}
52
57
  };
53
58
  const toDelete = this.applyRetention(newIndex);
54
59
  await this.writeIndex(vault.name, newIndex, indexVersion);
@@ -57,9 +62,34 @@ var SnapshotEngine = class {
57
62
  }
58
63
  return meta;
59
64
  }
65
+ /**
66
+ * Rolling auto-snapshot. Overwrites the single fixed `<vault>__auto` key and
67
+ * stores its meta in `index.auto`, separate from the immutable `snapshots`
68
+ * pool — retention never prunes it. Used by the cadence scheduler.
69
+ */
70
+ async autoSnapshot(vault, by, opts) {
71
+ const bytes = await writeNoydbBundle(vault, {});
72
+ const { index, indexVersion } = await this.readIndex(vault.name);
73
+ const key = this.autoKey(vault.name);
74
+ await this.store.writeBundle(key, bytes, null);
75
+ const meta = {
76
+ version: key,
77
+ label: opts?.label ?? "auto",
78
+ ...opts?.note !== void 0 ? { note: opts.note } : {},
79
+ exportedAt: (/* @__PURE__ */ new Date()).toISOString(),
80
+ exportedBy: by,
81
+ size: bytes.length,
82
+ integrity: "verified",
83
+ auto: true
84
+ };
85
+ index.auto = meta;
86
+ await this.writeIndex(vault.name, index, indexVersion);
87
+ return meta;
88
+ }
60
89
  async listSnapshots(vaultId) {
61
90
  const { index } = await this.readIndex(vaultId);
62
- return [...index.snapshots].reverse();
91
+ const immutable = [...index.snapshots].reverse();
92
+ return index.auto ? [index.auto, ...immutable] : immutable;
63
93
  }
64
94
  async restoreSnapshot(vault, version) {
65
95
  if (!version.startsWith(`${vault.name}__`)) throw new SnapshotNotFoundError(version);
@@ -108,7 +138,11 @@ function withSnapshots(opts) {
108
138
  },
109
139
  restoreSnapshot(vault, version) {
110
140
  return engine.restoreSnapshot(vault, version);
111
- }
141
+ },
142
+ autoSnapshot(vault, by, snapOpts) {
143
+ return engine.autoSnapshot(vault, by, snapOpts);
144
+ },
145
+ ...opts.snapshotPolicy ? { policy: opts.snapshotPolicy } : {}
112
146
  };
113
147
  }
114
148
  export {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/snapshots/engine.ts","../../src/snapshots/active.ts"],"sourcesContent":["import { writeNoydbBundle, readNoydbBundle } from '../bundle/bundle.js'\nimport { SnapshotNotFoundError } from '../errors.js'\nimport type { NoydbBundleStore } from '../types.js'\nimport type { Vault } from '../vault.js'\nimport type { SnapshotMeta, RetentionPolicy, SnapshotIndex } from './strategy.js'\n\nexport class SnapshotEngine {\n constructor(\n private readonly store: NoydbBundleStore,\n private readonly retention: RetentionPolicy,\n ) {}\n\n private indexKey(vaultName: string): string {\n return `${vaultName}__index`\n }\n\n private snapKey(vaultName: string, n: number): string {\n return `${vaultName}__snap_${n.toString().padStart(6, '0')}`\n }\n\n private async readIndex(\n vaultName: string,\n ): Promise<{ index: SnapshotIndex; indexVersion: string | null }> {\n const result = await this.store.readBundle(this.indexKey(vaultName))\n if (!result) return { index: { snapshots: [], nextCounter: 1 }, indexVersion: null }\n const text = new TextDecoder().decode(result.bytes)\n return { index: JSON.parse(text) as SnapshotIndex, indexVersion: result.version }\n }\n\n private async writeIndex(\n vaultName: string,\n index: SnapshotIndex,\n expectedVersion: string | null,\n ): Promise<void> {\n const bytes = new TextEncoder().encode(JSON.stringify(index))\n await this.store.writeBundle(this.indexKey(vaultName), bytes, expectedVersion)\n }\n\n async snapshot(\n vault: Vault,\n by: string,\n opts?: { label?: string; note?: string },\n ): Promise<SnapshotMeta> {\n const bytes = await writeNoydbBundle(vault, {})\n const { index, indexVersion } = await this.readIndex(vault.name)\n const key = this.snapKey(vault.name, index.nextCounter)\n\n // Write blob first. If the subsequent index write fails, the next snapshot()\n // call will re-derive the same key (counter not persisted) and overwrite this blob.\n // This is an accepted v1 trade-off: failure window is narrow and requires a store\n // error between the two writes. A retry produces a fresh snapshot at the same key.\n await this.store.writeBundle(key, bytes, null)\n\n const meta: SnapshotMeta = {\n version: key,\n ...(opts?.label !== undefined ? { label: opts.label } : {}),\n ...(opts?.note !== undefined ? { note: opts.note } : {}),\n exportedAt: new Date().toISOString(),\n exportedBy: by,\n size: bytes.length,\n integrity: 'verified',\n }\n\n const newIndex: SnapshotIndex = {\n snapshots: [...index.snapshots, meta],\n nextCounter: index.nextCounter + 1,\n }\n const toDelete = this.applyRetention(newIndex)\n await this.writeIndex(vault.name, newIndex, indexVersion)\n\n for (const k of toDelete) {\n await this.store.deleteBundle(k)\n }\n\n return meta\n }\n\n async listSnapshots(vaultId: string): Promise<SnapshotMeta[]> {\n const { index } = await this.readIndex(vaultId)\n return [...index.snapshots].reverse()\n }\n\n async restoreSnapshot(vault: Vault, version: string): Promise<void> {\n if (!version.startsWith(`${vault.name}__`)) throw new SnapshotNotFoundError(version)\n const result = await this.store.readBundle(version)\n if (!result) throw new SnapshotNotFoundError(version)\n const { dumpJson } = await readNoydbBundle(result.bytes)\n await vault.load(dumpJson)\n }\n\n /**\n * Applies the configured retention policy to `index`, mutating `index.snapshots`\n * in place and returning the blob keys that should be deleted from the store.\n * Called by `snapshot()` before the index is written.\n *\n * @internal — public for direct testing only\n */\n applyRetention(index: SnapshotIndex): string[] {\n const prune = this.retention.prune ?? true\n if (!prune) return []\n\n const toDelete: string[] = []\n let remaining = index.snapshots.slice()\n\n if (this.retention.keepLast !== undefined && remaining.length > this.retention.keepLast) {\n const excess = remaining.splice(0, remaining.length - this.retention.keepLast)\n toDelete.push(...excess.map(m => m.version))\n }\n\n if (this.retention.maxAgeDays !== undefined) {\n const cutoffMs = this.retention.maxAgeDays * 86_400_000\n const now = Date.now()\n const fresh = remaining.filter(m => now - new Date(m.exportedAt).getTime() <= cutoffMs)\n toDelete.push(...remaining.filter(m => !fresh.includes(m)).map(m => m.version))\n remaining = fresh\n }\n\n index.snapshots = remaining\n return toDelete\n }\n}\n","import { SnapshotEngine } from './engine.js'\nimport type { SnapshotStrategy, RetentionPolicy } from './strategy.js'\nimport type { NoydbBundleStore } from '../types.js'\nimport type { Vault } from '../vault.js'\n\nexport interface WithSnapshotsOptions {\n /** Bundle store where snapshot blobs and the sidecar index are written. */\n store: NoydbBundleStore\n /**\n * Declarative retention policy. Enforced eagerly after each `snapshot()` call.\n * Defaults to no retention (all snapshots kept forever).\n */\n retention?: RetentionPolicy\n}\n\nexport function withSnapshots(opts: WithSnapshotsOptions): SnapshotStrategy {\n const engine = new SnapshotEngine(opts.store, opts.retention ?? {})\n return {\n snapshot(vault, by, snapOpts) {\n return engine.snapshot(vault as Vault, by, snapOpts)\n },\n listSnapshots(vaultId) {\n return engine.listSnapshots(vaultId)\n },\n restoreSnapshot(vault, version) {\n return engine.restoreSnapshot(vault as Vault, version)\n },\n }\n}\n"],"mappings":"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","names":[]}
1
+ {"version":3,"sources":["../../src/snapshots/engine.ts","../../src/snapshots/active.ts"],"sourcesContent":["import { writeNoydbBundle, readNoydbBundle } from '../bundle/bundle.js'\nimport { SnapshotNotFoundError } from '../errors.js'\nimport type { NoydbBundleStore } from '../types.js'\nimport type { Vault } from '../vault.js'\nimport type { SnapshotMeta, RetentionPolicy, SnapshotIndex } from './strategy.js'\n\nexport class SnapshotEngine {\n constructor(\n private readonly store: NoydbBundleStore,\n private readonly retention: RetentionPolicy,\n ) {}\n\n private indexKey(vaultName: string): string {\n return `${vaultName}__index`\n }\n\n private snapKey(vaultName: string, n: number): string {\n return `${vaultName}__snap_${n.toString().padStart(6, '0')}`\n }\n\n private autoKey(vaultName: string): string {\n return `${vaultName}__auto`\n }\n\n private async readIndex(\n vaultName: string,\n ): Promise<{ index: SnapshotIndex; indexVersion: string | null }> {\n const result = await this.store.readBundle(this.indexKey(vaultName))\n if (!result) return { index: { snapshots: [], nextCounter: 1 }, indexVersion: null }\n const text = new TextDecoder().decode(result.bytes)\n return { index: JSON.parse(text) as SnapshotIndex, indexVersion: result.version }\n }\n\n private async writeIndex(\n vaultName: string,\n index: SnapshotIndex,\n expectedVersion: string | null,\n ): Promise<void> {\n const bytes = new TextEncoder().encode(JSON.stringify(index))\n await this.store.writeBundle(this.indexKey(vaultName), bytes, expectedVersion)\n }\n\n async snapshot(\n vault: Vault,\n by: string,\n opts?: { label?: string; note?: string },\n ): Promise<SnapshotMeta> {\n const bytes = await writeNoydbBundle(vault, {})\n const { index, indexVersion } = await this.readIndex(vault.name)\n const key = this.snapKey(vault.name, index.nextCounter)\n\n // Write blob first. If the subsequent index write fails, the next snapshot()\n // call will re-derive the same key (counter not persisted) and overwrite this blob.\n // This is an accepted v1 trade-off: failure window is narrow and requires a store\n // error between the two writes. A retry produces a fresh snapshot at the same key.\n await this.store.writeBundle(key, bytes, null)\n\n const meta: SnapshotMeta = {\n version: key,\n ...(opts?.label !== undefined ? { label: opts.label } : {}),\n ...(opts?.note !== undefined ? { note: opts.note } : {}),\n exportedAt: new Date().toISOString(),\n exportedBy: by,\n size: bytes.length,\n integrity: 'verified',\n }\n\n const newIndex: SnapshotIndex = {\n snapshots: [...index.snapshots, meta],\n nextCounter: index.nextCounter + 1,\n // Preserve the rolling auto slot — on-demand snapshots never touch it.\n ...(index.auto ? { auto: index.auto } : {}),\n }\n const toDelete = this.applyRetention(newIndex)\n await this.writeIndex(vault.name, newIndex, indexVersion)\n\n for (const k of toDelete) {\n await this.store.deleteBundle(k)\n }\n\n return meta\n }\n\n /**\n * Rolling auto-snapshot. Overwrites the single fixed `<vault>__auto` key and\n * stores its meta in `index.auto`, separate from the immutable `snapshots`\n * pool — retention never prunes it. Used by the cadence scheduler.\n */\n async autoSnapshot(\n vault: Vault,\n by: string,\n opts?: { label?: string; note?: string },\n ): Promise<SnapshotMeta> {\n const bytes = await writeNoydbBundle(vault, {})\n const { index, indexVersion } = await this.readIndex(vault.name)\n const key = this.autoKey(vault.name)\n\n // Unconditional overwrite of the rolling slot.\n await this.store.writeBundle(key, bytes, null)\n\n const meta: SnapshotMeta = {\n version: key,\n label: opts?.label ?? 'auto',\n ...(opts?.note !== undefined ? { note: opts.note } : {}),\n exportedAt: new Date().toISOString(),\n exportedBy: by,\n size: bytes.length,\n integrity: 'verified',\n auto: true,\n }\n\n index.auto = meta\n await this.writeIndex(vault.name, index, indexVersion)\n return meta\n }\n\n async listSnapshots(vaultId: string): Promise<SnapshotMeta[]> {\n const { index } = await this.readIndex(vaultId)\n const immutable = [...index.snapshots].reverse()\n return index.auto ? [index.auto, ...immutable] : immutable\n }\n\n async restoreSnapshot(vault: Vault, version: string): Promise<void> {\n if (!version.startsWith(`${vault.name}__`)) throw new SnapshotNotFoundError(version)\n const result = await this.store.readBundle(version)\n if (!result) throw new SnapshotNotFoundError(version)\n const { dumpJson } = await readNoydbBundle(result.bytes)\n await vault.load(dumpJson)\n }\n\n /**\n * Applies the configured retention policy to `index`, mutating `index.snapshots`\n * in place and returning the blob keys that should be deleted from the store.\n * Called by `snapshot()` before the index is written.\n *\n * @internal — public for direct testing only\n */\n applyRetention(index: SnapshotIndex): string[] {\n const prune = this.retention.prune ?? true\n if (!prune) return []\n\n const toDelete: string[] = []\n let remaining = index.snapshots.slice()\n\n if (this.retention.keepLast !== undefined && remaining.length > this.retention.keepLast) {\n const excess = remaining.splice(0, remaining.length - this.retention.keepLast)\n toDelete.push(...excess.map(m => m.version))\n }\n\n if (this.retention.maxAgeDays !== undefined) {\n const cutoffMs = this.retention.maxAgeDays * 86_400_000\n const now = Date.now()\n const fresh = remaining.filter(m => now - new Date(m.exportedAt).getTime() <= cutoffMs)\n toDelete.push(...remaining.filter(m => !fresh.includes(m)).map(m => m.version))\n remaining = fresh\n }\n\n index.snapshots = remaining\n return toDelete\n }\n}\n","import { SnapshotEngine } from './engine.js'\nimport type { SnapshotStrategy, RetentionPolicy } from './strategy.js'\nimport type { SnapshotPolicy } from './policy.js'\nimport type { NoydbBundleStore } from '../types.js'\nimport type { Vault } from '../vault.js'\n\nexport interface WithSnapshotsOptions {\n /** Bundle store where snapshot blobs and the sidecar index are written. */\n store: NoydbBundleStore\n /**\n * Declarative retention policy. Enforced eagerly after each on-demand `snapshot()`.\n * Defaults to no retention (all on-demand snapshots kept forever). Never affects\n * the rolling auto-snapshot.\n */\n retention?: RetentionPolicy\n /**\n * Automatic-snapshot cadence. Default `mode:'manual'` ⇒ no timers; snapshots\n * stay on-demand. Set `mode:'debounce'`/`'interval'` to enable auto-snapshots\n * to the rolling `<vault>__auto` key.\n */\n snapshotPolicy?: SnapshotPolicy\n}\n\nexport function withSnapshots(opts: WithSnapshotsOptions): SnapshotStrategy {\n const engine = new SnapshotEngine(opts.store, opts.retention ?? {})\n return {\n snapshot(vault, by, snapOpts) {\n return engine.snapshot(vault as Vault, by, snapOpts)\n },\n listSnapshots(vaultId) {\n return engine.listSnapshots(vaultId)\n },\n restoreSnapshot(vault, version) {\n return engine.restoreSnapshot(vault as Vault, version)\n },\n autoSnapshot(vault, by, snapOpts) {\n return engine.autoSnapshot(vault as Vault, by, snapOpts)\n },\n ...(opts.snapshotPolicy ? { policy: opts.snapshotPolicy } : {}),\n }\n}\n"],"mappings":"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","names":[]}
@@ -1,5 +1,5 @@
1
- import { b1 as NoydbStore, aB as NoydbBundleStore } from '../types-DjunxzJa.cjs';
2
- export { bR as BUNDLE_STORE_POLICY, cz as INDEXED_STORE_POLICY, dk as PullMode, dm as PullPolicy, dp as PushMode, dr as PushPolicy, e1 as SyncPolicy, e2 as SyncScheduler, e3 as SyncSchedulerStatus } from '../types-DjunxzJa.cjs';
1
+ import { b3 as NoydbStore, aB as NoydbBundleStore } from '../types-DyXYr8rE.cjs';
2
+ export { bT as BUNDLE_STORE_POLICY, cB as INDEXED_STORE_POLICY, dm as PullMode, dp as PullPolicy, dr as PushMode, dt as PushPolicy, e3 as SyncPolicy, e4 as SyncScheduler, e5 as SyncSchedulerStatus } from '../types-DyXYr8rE.cjs';
3
3
  export { aF as StoreCapabilityError } from '../index-4fBVt8j9.cjs';
4
4
  import '../lazy-builder-wY4pMCEe.cjs';
5
5
  import '../predicate-BSAGEyu5.cjs';
@@ -1,5 +1,5 @@
1
- import { b1 as NoydbStore, aB as NoydbBundleStore } from '../types-DGU60JDt.js';
2
- export { bR as BUNDLE_STORE_POLICY, cz as INDEXED_STORE_POLICY, dk as PullMode, dm as PullPolicy, dp as PushMode, dr as PushPolicy, e1 as SyncPolicy, e2 as SyncScheduler, e3 as SyncSchedulerStatus } from '../types-DGU60JDt.js';
1
+ import { b3 as NoydbStore, aB as NoydbBundleStore } from '../types-Df28QFKb.js';
2
+ export { bT as BUNDLE_STORE_POLICY, cB as INDEXED_STORE_POLICY, dm as PullMode, dp as PullPolicy, dr as PushMode, dt as PushPolicy, e3 as SyncPolicy, e4 as SyncScheduler, e5 as SyncSchedulerStatus } from '../types-Df28QFKb.js';
3
3
  export { aF as StoreCapabilityError } from '../index-D8I_pyJD.js';
4
4
  import '../lazy-builder-7tIpFyWN.js';
5
5
  import '../predicate-BSAGEyu5.js';
@@ -1,4 +1,4 @@
1
- import { aZ as SyncStrategy } from '../types-DjunxzJa.cjs';
1
+ import { a$ as SyncStrategy } from '../types-DyXYr8rE.cjs';
2
2
  import '../lazy-builder-wY4pMCEe.cjs';
3
3
  import '../predicate-BSAGEyu5.cjs';
4
4
  import '../strategy-DSTrsZ8t.cjs';
@@ -1,4 +1,4 @@
1
- import { aZ as SyncStrategy } from '../types-DGU60JDt.js';
1
+ import { a$ as SyncStrategy } from '../types-Df28QFKb.js';
2
2
  import '../lazy-builder-7tIpFyWN.js';
3
3
  import '../predicate-BSAGEyu5.js';
4
4
  import '../strategy-DSTrsZ8t.js';
@@ -1,5 +1,5 @@
1
- import { b1 as NoydbStore, a$ as UnlockedKeyring } from '../types-DjunxzJa.cjs';
2
- export { br as BundleRecipient, ce as EnrollAuthenticatorOptions, cf as EnrollAuthenticatorWrappingDEKsOptions, cg as EnrollAuthenticatorWrappingKEKOptions, cL as ListUsersOptions, d7 as PaperRecoveryEntry, df as PresenceHandle, dB as RecoverPassphraseInput, dC as RecoverPassphraseResult, dD as RecoverUserOptions, dE as RecoveryProof, dH as RotatePassphraseInput, dT as SlotRewrapCeremony, dU as SlotRewrapContext, d$ as SyncEngine, e7 as SyncTransaction, ek as UpdateAuthenticatorOptions, ez as WrappedDeksBlob, eF as buildRecipientKeyringFile, eG as burnPaperRecoveryEntry, fp as changeSecret, fq as createOwnerKeyring, eJ as deriveMagicLinkContentKey, eK as enrollAuthenticator, fr as ensureCollectionDEK, eM as evaluateExportCapability, eN as evaluateImportCapability, eO as findAuthenticator, fs as grant, eP as hasExportCapability, eQ as hasImportCapability, eS as isMagicLinkGrantExpired, eX as listMagicLinkGrants, eY as listUsers, eZ as listUsersWithEnvelopes, ft as loadKeyring, e$ as loadPaperRecoveryEntries, f2 as magicLinkGrantRecordId, f3 as mintPaperRecoveryEntry, f5 as mintWrappedDeksBlob, fu as persistKeyring, f7 as readMagicLinkGrantRecord, eV as recoverPassphrase, f8 as recoverUser, f9 as removeAuthenticator, fv as revoke, fc as revokeMagicLinkGrant, eW as rotatePassphrase, fd as savePaperRecoveryEntries, fg as unwrapDeksFromBlob, fh as unwrapDeksFromPaperEntry, fj as unwrapMagicLinkGrant, fw as updateAuthenticator, fx as updateKeyringIdentity, fo as writeMagicLinkGrant } from '../types-DjunxzJa.cjs';
1
+ import { b3 as NoydbStore, b1 as UnlockedKeyring } from '../types-DyXYr8rE.cjs';
2
+ export { bt as BundleRecipient, cg as EnrollAuthenticatorOptions, ch as EnrollAuthenticatorWrappingDEKsOptions, ci as EnrollAuthenticatorWrappingKEKOptions, cN as ListUsersOptions, d9 as PaperRecoveryEntry, dh as PresenceHandle, dD as RecoverPassphraseInput, dE as RecoverPassphraseResult, dF as RecoverUserOptions, dG as RecoveryProof, dJ as RotatePassphraseInput, dV as SlotRewrapCeremony, dW as SlotRewrapContext, e1 as SyncEngine, e9 as SyncTransaction, em as UpdateAuthenticatorOptions, eB as WrappedDeksBlob, eH as buildRecipientKeyringFile, eI as burnPaperRecoveryEntry, fr as changeSecret, fs as createOwnerKeyring, eL as deriveMagicLinkContentKey, eM as enrollAuthenticator, ft as ensureCollectionDEK, eO as evaluateExportCapability, eP as evaluateImportCapability, eQ as findAuthenticator, fu as grant, eR as hasExportCapability, eS as hasImportCapability, eU as isMagicLinkGrantExpired, eZ as listMagicLinkGrants, e_ as listUsers, e$ as listUsersWithEnvelopes, fv as loadKeyring, f1 as loadPaperRecoveryEntries, f4 as magicLinkGrantRecordId, f5 as mintPaperRecoveryEntry, f7 as mintWrappedDeksBlob, fw as persistKeyring, f9 as readMagicLinkGrantRecord, eX as recoverPassphrase, fa as recoverUser, fb as removeAuthenticator, fx as revoke, fe as revokeMagicLinkGrant, eY as rotatePassphrase, ff as savePaperRecoveryEntries, fi as unwrapDeksFromBlob, fj as unwrapDeksFromPaperEntry, fl as unwrapMagicLinkGrant, fy as updateAuthenticator, fz as updateKeyringIdentity, fq as writeMagicLinkGrant } from '../types-DyXYr8rE.cjs';
3
3
  import '../lazy-builder-wY4pMCEe.cjs';
4
4
  import '../predicate-BSAGEyu5.cjs';
5
5
  import '../strategy-DSTrsZ8t.cjs';
@@ -1,5 +1,5 @@
1
- import { b1 as NoydbStore, a$ as UnlockedKeyring } from '../types-DGU60JDt.js';
2
- export { br as BundleRecipient, ce as EnrollAuthenticatorOptions, cf as EnrollAuthenticatorWrappingDEKsOptions, cg as EnrollAuthenticatorWrappingKEKOptions, cL as ListUsersOptions, d7 as PaperRecoveryEntry, df as PresenceHandle, dB as RecoverPassphraseInput, dC as RecoverPassphraseResult, dD as RecoverUserOptions, dE as RecoveryProof, dH as RotatePassphraseInput, dT as SlotRewrapCeremony, dU as SlotRewrapContext, d$ as SyncEngine, e7 as SyncTransaction, ek as UpdateAuthenticatorOptions, ez as WrappedDeksBlob, eF as buildRecipientKeyringFile, eG as burnPaperRecoveryEntry, fp as changeSecret, fq as createOwnerKeyring, eJ as deriveMagicLinkContentKey, eK as enrollAuthenticator, fr as ensureCollectionDEK, eM as evaluateExportCapability, eN as evaluateImportCapability, eO as findAuthenticator, fs as grant, eP as hasExportCapability, eQ as hasImportCapability, eS as isMagicLinkGrantExpired, eX as listMagicLinkGrants, eY as listUsers, eZ as listUsersWithEnvelopes, ft as loadKeyring, e$ as loadPaperRecoveryEntries, f2 as magicLinkGrantRecordId, f3 as mintPaperRecoveryEntry, f5 as mintWrappedDeksBlob, fu as persistKeyring, f7 as readMagicLinkGrantRecord, eV as recoverPassphrase, f8 as recoverUser, f9 as removeAuthenticator, fv as revoke, fc as revokeMagicLinkGrant, eW as rotatePassphrase, fd as savePaperRecoveryEntries, fg as unwrapDeksFromBlob, fh as unwrapDeksFromPaperEntry, fj as unwrapMagicLinkGrant, fw as updateAuthenticator, fx as updateKeyringIdentity, fo as writeMagicLinkGrant } from '../types-DGU60JDt.js';
1
+ import { b3 as NoydbStore, b1 as UnlockedKeyring } from '../types-Df28QFKb.js';
2
+ export { bt as BundleRecipient, cg as EnrollAuthenticatorOptions, ch as EnrollAuthenticatorWrappingDEKsOptions, ci as EnrollAuthenticatorWrappingKEKOptions, cN as ListUsersOptions, d9 as PaperRecoveryEntry, dh as PresenceHandle, dD as RecoverPassphraseInput, dE as RecoverPassphraseResult, dF as RecoverUserOptions, dG as RecoveryProof, dJ as RotatePassphraseInput, dV as SlotRewrapCeremony, dW as SlotRewrapContext, e1 as SyncEngine, e9 as SyncTransaction, em as UpdateAuthenticatorOptions, eB as WrappedDeksBlob, eH as buildRecipientKeyringFile, eI as burnPaperRecoveryEntry, fr as changeSecret, fs as createOwnerKeyring, eL as deriveMagicLinkContentKey, eM as enrollAuthenticator, ft as ensureCollectionDEK, eO as evaluateExportCapability, eP as evaluateImportCapability, eQ as findAuthenticator, fu as grant, eR as hasExportCapability, eS as hasImportCapability, eU as isMagicLinkGrantExpired, eZ as listMagicLinkGrants, e_ as listUsers, e$ as listUsersWithEnvelopes, fv as loadKeyring, f1 as loadPaperRecoveryEntries, f4 as magicLinkGrantRecordId, f5 as mintPaperRecoveryEntry, f7 as mintWrappedDeksBlob, fw as persistKeyring, f9 as readMagicLinkGrantRecord, eX as recoverPassphrase, fa as recoverUser, fb as removeAuthenticator, fx as revoke, fe as revokeMagicLinkGrant, eY as rotatePassphrase, ff as savePaperRecoveryEntries, fi as unwrapDeksFromBlob, fj as unwrapDeksFromPaperEntry, fl as unwrapMagicLinkGrant, fy as updateAuthenticator, fz as updateKeyringIdentity, fq as writeMagicLinkGrant } from '../types-Df28QFKb.js';
3
3
  import '../lazy-builder-7tIpFyWN.js';
4
4
  import '../predicate-BSAGEyu5.js';
5
5
  import '../strategy-DSTrsZ8t.js';
@@ -1,5 +1,5 @@
1
- import { aF as TxStrategy } from '../types-DjunxzJa.cjs';
2
- export { aG as AmendmentTxOptions, aH as TxCollection, aI as TxContext, aJ as TxVault, aK as runTransaction } from '../types-DjunxzJa.cjs';
1
+ import { aH as TxStrategy } from '../types-DyXYr8rE.cjs';
2
+ export { aI as AmendmentTxOptions, aJ as TxCollection, aK as TxContext, aL as TxVault, aM as runTransaction } from '../types-DyXYr8rE.cjs';
3
3
  import '../lazy-builder-wY4pMCEe.cjs';
4
4
  import '../predicate-BSAGEyu5.cjs';
5
5
  import '../strategy-DSTrsZ8t.cjs';
@@ -1,5 +1,5 @@
1
- import { aF as TxStrategy } from '../types-DGU60JDt.js';
2
- export { aG as AmendmentTxOptions, aH as TxCollection, aI as TxContext, aJ as TxVault, aK as runTransaction } from '../types-DGU60JDt.js';
1
+ import { aH as TxStrategy } from '../types-Df28QFKb.js';
2
+ export { aI as AmendmentTxOptions, aJ as TxCollection, aK as TxContext, aL as TxVault, aM as runTransaction } from '../types-Df28QFKb.js';
3
3
  import '../lazy-builder-7tIpFyWN.js';
4
4
  import '../predicate-BSAGEyu5.js';
5
5
  import '../strategy-DSTrsZ8t.js';
@@ -4530,6 +4530,30 @@ declare class QuickUnlockStore {
4530
4530
  private clearTimer;
4531
4531
  }
4532
4532
 
4533
+ /**
4534
+ * Cadence policy for automatic snapshots. Borrows the vocabulary of the sync
4535
+ * `SyncPolicy` (debounce / interval / minInterval / onUnload) but is a separate,
4536
+ * snapshot-specific shape — automatic snapshots write the single rolling
4537
+ * `<vault>__auto` key, never the immutable on-demand pool.
4538
+ *
4539
+ * Default mode is `'manual'`: no timers, snapshots stay on-demand.
4540
+ */
4541
+ type SnapshotMode = 'manual' | 'debounce' | 'interval';
4542
+ interface SnapshotPolicy {
4543
+ /** Trigger mode. Default `'manual'` — no automatic snapshots. */
4544
+ readonly mode?: SnapshotMode;
4545
+ /** Idle delay (ms) after a write before an auto-snapshot fires. `mode:'debounce'`. Default 30_000. */
4546
+ readonly debounceMs?: number;
4547
+ /** Fixed interval (ms). `mode:'interval'`. Default 300_000. */
4548
+ readonly intervalMs?: number;
4549
+ /** Hard floor (ms) between auto-snapshots regardless of mode. Default 0. */
4550
+ readonly minIntervalMs?: number;
4551
+ /** Flush a pending auto-snapshot on tab-hide / process exit. Default true for non-manual modes. */
4552
+ readonly onUnload?: boolean;
4553
+ /** Label applied to each auto-snapshot. Default `'auto'`. */
4554
+ readonly label?: string;
4555
+ }
4556
+
4533
4557
  interface SnapshotMeta {
4534
4558
  readonly version: string;
4535
4559
  readonly label?: string;
@@ -4544,6 +4568,8 @@ interface SnapshotMeta {
4544
4568
  * lacking a ledgerHead; not produced by the current engine.
4545
4569
  */
4546
4570
  readonly integrity: 'verified' | 'legacy-unverifiable';
4571
+ /** `true` for the rolling auto-snapshot; absent on on-demand checkpoints. */
4572
+ readonly auto?: true;
4547
4573
  }
4548
4574
  interface RetentionPolicy {
4549
4575
  readonly keepLast?: number;
@@ -4558,6 +4584,13 @@ interface SnapshotStrategy {
4558
4584
  }): Promise<SnapshotMeta>;
4559
4585
  listSnapshots(vaultId: string): Promise<SnapshotMeta[]>;
4560
4586
  restoreSnapshot(vault: unknown, version: string): Promise<void>;
4587
+ /** Rolling auto-snapshot to the fixed `<vault>__auto` key. */
4588
+ autoSnapshot(vault: unknown, by: string, opts?: {
4589
+ label?: string;
4590
+ note?: string;
4591
+ }): Promise<SnapshotMeta>;
4592
+ /** Configured cadence policy. Undefined or `mode:'manual'` ⇒ no scheduler is wired. */
4593
+ readonly policy?: SnapshotPolicy;
4561
4594
  }
4562
4595
 
4563
4596
  /**
@@ -4990,6 +5023,8 @@ declare class Noydb {
4990
5023
  private readonly sessionStrategy;
4991
5024
  private readonly syncStrategy;
4992
5025
  private readonly snapshotStrategy;
5026
+ private snapshotScheduler;
5027
+ private readonly dirtySnapshotVaults;
4993
5028
  /**
4994
5029
  * Currently-running multi-record transaction, set by
4995
5030
  * `runTransaction` at the start of Phase 2 (commit) and cleared in
@@ -5970,6 +6005,13 @@ declare class Noydb {
5970
6005
  label?: string;
5971
6006
  note?: string;
5972
6007
  }): Promise<SnapshotMeta>;
6008
+ /**
6009
+ * Wire the automatic-snapshot cadence when a non-manual `snapshotPolicy` is
6010
+ * configured. Subscribes to `onAfterWrite` to mark the written vault dirty and
6011
+ * nudge the scheduler; the scheduler fires `autoSnapshot()` per dirty vault.
6012
+ * No-op for `mode:'manual'` or no policy.
6013
+ */
6014
+ private initSnapshotCadence;
5973
6015
  /**
5974
6016
  * List all snapshots for the given vault, newest first.
5975
6017
  * Reads only the sidecar index — does not download snapshot bytes.
@@ -12773,4 +12815,4 @@ interface DeleteManyResult {
12773
12815
  }>;
12774
12816
  }
12775
12817
 
12776
- export { type ExportBlobsAuditEntry as $, BLOB_COLLECTION as A, type BlobStrategy as B, BLOB_EVICTION_AUDIT_COLLECTION as C, DICT_COLLECTION_PREFIX as D, BLOB_INDEX_COLLECTION as E, BLOB_SLOTS_PREFIX as F, BLOB_VERSIONS_PREFIX as G, type BlobEvictionEntry as H, type I18nStrategy as I, type BlobFieldPolicy as J, type BlobFieldsConfig as K, type Layer as L, type BlobObject as M, type BlobPutOptions as N, type OnMissing as O, PolicyEnforcer as P, type BlobResponseOptions as Q, type ResolveI18nOptions as R, type ScriptWarning as S, BlobSet as T, type BlobStrategyOpenArgs as U, type CompactRunOptions as V, type CompactionContext as W, type CompactionResult as X, DEFAULT_CHUNK_SIZE as Y, EXPORT_AUDIT_COLLECTION as Z, ExportBlobsAbortedError as _, type DictEntry as a, type UnlockedKeyring as a$, type ExportBlobsHandle as a0, type ExportBlobsOptions as a1, type ExportedBlob as a2, type SlotInfo as a3, type SlotRecord as a4, type VersionRecord as a5, createExportBlobsHandle as a6, runCompaction as a7, type ConsentStrategy as a8, CONSENT_AUDIT_COLLECTION as a9, VaultFrame as aA, type NoydbBundleStore as aB, type RetentionPolicy as aC, type SnapshotStrategy as aD, type SnapshotMeta as aE, type TxStrategy as aF, type AmendmentTxOptions as aG, TxCollection as aH, TxContext as aI, TxVault as aJ, runTransaction as aK, type DerivationStrategy as aL, type DerivationContext as aM, type ArrayOutputSpec as aN, DerivationRegistry as aO, type DerivationStrategyHandle as aP, type DerivedFromMeta as aQ, type OutputSpec as aR, type RecordOutputSpec as aS, type MaterializedViewStrategy as aT, type MaterializedViewStrategyHandle as aU, type OverlayedViewStrategy as aV, Collection as aW, OverlayedViewRegistry as aX, type OverlayedViewStrategyHandle as aY, type SyncStrategy as aZ, type Role as a_, type ConsentAuditEntry as aa, type ConsentAuditFilter as ab, type ConsentContext as ac, type ConsentOp as ad, loadConsentEntries as ae, writeConsentEntry as af, type PeriodsStrategy as ag, type CarryForwardContext as ah, type ClosePeriodOptions as ai, type OpenPeriodOptions as aj, PERIODS_COLLECTION as ak, type PeriodRecord as al, type ReadOnlyCollection as am, appendPeriodLedgerEntry as an, assertTsWritable as ao, chainAnchor as ap, loadPeriods as aq, validatePeriodName as ar, type GuardStrategy as as, type GuardChange as at, type GuardContext as au, GuardRegistry as av, type GuardStrategyHandle as aw, ReadOnlyVaultFacade as ax, type ShadowStrategy as ay, CollectionFrame as az, type DictKeyDescriptor as b, type ConflictPolicy as b$, type HistoryStrategy as b0, type NoydbStore as b1, type HistoryOptions as b2, type EncryptedEnvelope as b3, type PruneOptions as b4, type AppendInput as b5, type ChangeType as b6, CollectionInstant as b7, type DiffEntry as b8, type JsonPatch as b9, type MaterializedFromMeta as bA, type MaterializedViewOutput as bB, type UnionSource as bC, type UserEnvelope as bD, type GateName as bE, type GatePolicy as bF, type VaultPolicy as bG, type ActiveTier as bH, type FactorProof as bI, type SchemaUpdateStrategy as bJ, type TransformFn as bK, type PersistedSchemaEnvelope as bL, type UpdateDecision as bM, type DirectoryConfig as bN, type UserVisibility as bO, type AccessibleVault as bP, type AffectedDocument as bQ, BUNDLE_STORE_POLICY as bR, type BuiltInGateName as bS, type CacheOptions as bT, type CacheStats as bU, type ChangeEvent as bV, type CollectionChangeEvent as bW, type CollectionConflictResolver as bX, type CollectionDescriptor as bY, type CollectionStats as bZ, type Conflict as b_, type JsonPatchOp as ba, type LedgerEntry as bb, LedgerStore as bc, type VaultEngine as bd, VaultInstant as be, type VerifyResult as bf, applyPatch as bg, canonicalJson as bh, computePatch as bi, diff as bj, formatDiff as bk, hashEntry as bl, paddedIndex as bm, parseIndex as bn, sha256Hex as bo, type PublicEnvelope as bp, type SealingKeyProvider as bq, type BundleRecipient as br, type RecipientSealer as bs, type RecipientHint as bt, Vault as bu, type RecoveryEnrollmentInput as bv, type ShamirRecoveryProvider as bw, type MVQueryContext as bx, type RegisteredMV as by, MaterializedViewRegistry as bz, DictionaryHandle as c, NOYDB_KEYRING_VERSION as c$, type ConflictStrategy as c0, type CrossTierAccessEvent as c1, DEFAULT_PUBLIC_ENVELOPE_SCHEMA as c2, DELEGATIONS_COLLECTION as c3, type DeepPartial as c4, type DeepPartialOrNull as c5, type DelegationToken as c6, type DeleteManyResult as c7, type DerivationDescriptor as c8, type DirtyEntry as c9, type ImportCapability as cA, type InferOutput as cB, type InternalCollectionStats as cC, type IssueDelegationOptions as cD, type IssueMagicLinkGrantOptions as cE, type KeyringAuthenticator as cF, type KeyringAuthenticatorWrappingDEKs as cG, type KeyringAuthenticatorWrappingKEK as cH, type KeyringFile as cI, type ListAccessibleVaultsOptions as cJ, type ListPageResult as cK, type ListUsersOptions as cL, type LiveUserEnvelope as cM, type LocaleReadOptions as cN, Lru as cO, type LruOptions as cP, type LruStats as cQ, MAGIC_LINK_CONTENT_INFO_PREFIX as cR, MAGIC_LINK_GRANTS_COLLECTION as cS, MAGIC_LINK_KEK_INFO_PREFIX as cT, type MagicLinkGrantPayload as cU, type MagicLinkGrantRecord as cV, type MaterializedViewDescriptor as cW, MemoryRecipientSealer as cX, MemorySealingKeyProvider as cY, NOYDB_BACKUP_VERSION as cZ, NOYDB_FORMAT_VERSION as c_, type DryRunResult as ca, type DumpSchemaOptions as cb, ELEVATION_AUDIT_COLLECTION as cc, ElevatedHandle as cd, type EnrollAuthenticatorOptions as ce, type EnrollAuthenticatorWrappingDEKsOptions as cf, type EnrollAuthenticatorWrappingKEKOptions as cg, type EnrollRecoveryResult as ch, type ExportCapability as ci, type ExportChunk as cj, type ExportFormat as ck, type ExportStreamOptions as cl, type FactorKind as cm, type FactorProofBundle as cn, type FactorRequirement as co, type FenceDoc as cp, type FenceState as cq, type FieldChange as cr, type FieldDescriptor as cs, type FieldSource as ct, type GhostRecord as cu, type GrantOptions as cv, type GuardViolation as cw, type HistoryConfig as cx, type HistoryEntry as cy, INDEXED_STORE_POLICY as cz, type DictionaryOptions as d, SyncEngine as d$, NOYDB_SYNC_VERSION as d0, Noydb as d1, type NoydbEventMap as d2, type NoydbOptions as d3, type OverlayViewDescriptor as d4, PUBLIC_ENVELOPE_FIELDS as d5, type PaperRecoveryDoc as d6, type PaperRecoveryEntry as d7, type PassphrasePolicy as d8, type PassphraseValidationResult as d9, type ReAuthOperation as dA, type RecoverPassphraseInput as dB, type RecoverPassphraseResult as dC, type RecoverUserOptions as dD, type RecoveryProof as dE, type ResolvedPublicEnvelopeSchema as dF, type RevokeOptions as dG, type RotatePassphraseInput as dH, type RotateRecoveryOptions as dI, type RotateRecoveryResult as dJ, SEALED_PASSPHRASE_RECORD_ID as dK, type SchemaDelta as dL, type SchemaIntrospection as dM, type SealedEnvelope as dN, type SealedPassphrase as dO, type SessionPolicy as dP, type SetPublicEnvelopeInput as dQ, type ShamirRecoveryDoc as dR, type ShamirRecoveryEntry as dS, type SlotRewrapCeremony as dT, type SlotRewrapContext as dU, type StandardSchemaV1 as dV, type StandardSchemaV1Issue as dW, type StandardSchemaV1SyncResult as dX, type StoreAuth as dY, type StoreAuthKind as dZ, type StoreCapabilities as d_, type Permission as da, type Permissions as db, type PersistedSchemaKind as dc, type PlaintextTranslatorContext as dd, type PlaintextTranslatorFn as de, PresenceHandle as df, type PresencePeer as dg, type PublicEnvelopeField as dh, type PublicEnvelopeSchema as di, type PublicEnvelopeText as dj, type PullMode as dk, type PullOptions as dl, type PullPolicy as dm, type PullResult as dn, type PushMode as dp, type PushOptions as dq, type PushPolicy as dr, type PushResult as ds, type PutManyItemOptions as dt, type PutManyOptions as du, type PutManyResult as dv, type QueryAcrossOptions as dw, type QueryAcrossResult as dx, type QuickUnlockState as dy, QuickUnlockStore as dz, type I18nMap as e, loadPaperRecoveryEntries as e$, type SyncMetadata as e0, type SyncPolicy as e1, SyncScheduler as e2, type SyncSchedulerStatus as e3, type SyncStatus as e4, type SyncTarget as e5, type SyncTargetRole as e6, SyncTransaction as e7, type SyncTransactionResult as e8, type TabChannel as e9, type WriteConflict as eA, type WriteEvent as eB, type WriteHook as eC, type WriteQueue as eD, assertStrongPassphrase as eE, buildRecipientKeyringFile as eF, burnPaperRecoveryEntry as eG, createNoydb as eH, createStore as eI, deriveMagicLinkContentKey as eJ, enrollAuthenticator as eK, estimateEntropy as eL, evaluateExportCapability as eM, evaluateImportCapability as eN, findAuthenticator as eO, hasExportCapability as eP, hasImportCapability as eQ, hasRecoveryEnrolled as eR, isMagicLinkGrantExpired as eS, isPublicEnvelope as eT, issueDelegation as eU, recoverPassphrase as eV, rotatePassphrase as eW, listMagicLinkGrants as eX, listUsers as eY, listUsersWithEnvelopes as eZ, loadActiveDelegations as e_, type TabCoordinationOptions as ea, type TabLockManager as eb, type TabPresence as ec, type TabRole as ed, type TierMode as ee, type TranslatorAuditEntry as ef, type TxOp as eg, USER_ENVELOPE_COLLECTION as eh, USER_ENVELOPE_MAX_BYTES as ei, type Unsubscribe as ej, type UpdateAuthenticatorOptions as ek, type UpdateContext as el, type UpdateUserOptions as em, UserApi as en, type UserEnvelopeCheckGate as eo, UserEnvelopeOversizedError as ep, type UserEnvelopePresented as eq, type UserInfo as er, type VaultBackup as es, type VaultPolicyOnDisk as et, type VaultSchemaSnapshot as eu, type VaultSnapshot as ev, type WarningRules as ew, WeakPassphraseError as ex, type WeakPassphraseReason as ey, type WrappedDeksBlob as ez, type I18nTextDescriptor as f, loadSealedPassphrase as f0, loadShamirRecoveryEntries as f1, magicLinkGrantRecordId as f2, mintPaperRecoveryEntry as f3, mintShamirRecoveryEntry as f4, mintWrappedDeksBlob as f5, parseSealedEnvelope as f6, readMagicLinkGrantRecord as f7, recoverUser as f8, removeAuthenticator as f9, resolveSchema as fa, revokeDelegation as fb, revokeMagicLinkGrant as fc, savePaperRecoveryEntries as fd, saveSealedPassphrase as fe, saveShamirRecoveryEntries as ff, unwrapDeksFromBlob as fg, unwrapDeksFromPaperEntry as fh, unwrapDeksFromShamirEntry as fi, unwrapMagicLinkGrant as fj, validatePassphrase as fk, validatePublicEnvelopeInput as fl, validateSchemaInput as fm, validateSchemaOutput as fn, writeMagicLinkGrant as fo, changeSecret as fp, createOwnerKeyring as fq, ensureCollectionDEK as fr, grant as fs, loadKeyring as ft, persistKeyring as fu, revoke as fv, updateAuthenticator as fw, updateKeyringIdentity as fx, type I18nTextOptions as g, type OnMissingPolicy as h, applyI18nLocale as i, dictCollectionName as j, dictKey as k, enforceScript as l, getAtPath as m, i18nText as n, inferScripts as o, isDictCollectionName as p, isDictKeyDescriptor as q, isI18nTextDescriptor as r, resolveI18nText as s, resolvePolicy as t, setAtPathInPlace as u, validateI18nTextValue as v, type SessionStrategy as w, createEnforcer as x, validateSessionPolicy as y, BLOB_CHUNKS_COLLECTION as z };
12818
+ export { type ExportBlobsAuditEntry as $, BLOB_COLLECTION as A, type BlobStrategy as B, BLOB_EVICTION_AUDIT_COLLECTION as C, DICT_COLLECTION_PREFIX as D, BLOB_INDEX_COLLECTION as E, BLOB_SLOTS_PREFIX as F, BLOB_VERSIONS_PREFIX as G, type BlobEvictionEntry as H, type I18nStrategy as I, type BlobFieldPolicy as J, type BlobFieldsConfig as K, type Layer as L, type BlobObject as M, type BlobPutOptions as N, type OnMissing as O, PolicyEnforcer as P, type BlobResponseOptions as Q, type ResolveI18nOptions as R, type ScriptWarning as S, BlobSet as T, type BlobStrategyOpenArgs as U, type CompactRunOptions as V, type CompactionContext as W, type CompactionResult as X, DEFAULT_CHUNK_SIZE as Y, EXPORT_AUDIT_COLLECTION as Z, ExportBlobsAbortedError as _, type DictEntry as a, type SyncStrategy as a$, type ExportBlobsHandle as a0, type ExportBlobsOptions as a1, type ExportedBlob as a2, type SlotInfo as a3, type SlotRecord as a4, type VersionRecord as a5, createExportBlobsHandle as a6, runCompaction as a7, type ConsentStrategy as a8, CONSENT_AUDIT_COLLECTION as a9, VaultFrame as aA, type NoydbBundleStore as aB, type RetentionPolicy as aC, type SnapshotPolicy as aD, type SnapshotStrategy as aE, type SnapshotMeta as aF, type SnapshotMode as aG, type TxStrategy as aH, type AmendmentTxOptions as aI, TxCollection as aJ, TxContext as aK, TxVault as aL, runTransaction as aM, type DerivationStrategy as aN, type DerivationContext as aO, type ArrayOutputSpec as aP, DerivationRegistry as aQ, type DerivationStrategyHandle as aR, type DerivedFromMeta as aS, type OutputSpec as aT, type RecordOutputSpec as aU, type MaterializedViewStrategy as aV, type MaterializedViewStrategyHandle as aW, type OverlayedViewStrategy as aX, Collection as aY, OverlayedViewRegistry as aZ, type OverlayedViewStrategyHandle as a_, type ConsentAuditEntry as aa, type ConsentAuditFilter as ab, type ConsentContext as ac, type ConsentOp as ad, loadConsentEntries as ae, writeConsentEntry as af, type PeriodsStrategy as ag, type CarryForwardContext as ah, type ClosePeriodOptions as ai, type OpenPeriodOptions as aj, PERIODS_COLLECTION as ak, type PeriodRecord as al, type ReadOnlyCollection as am, appendPeriodLedgerEntry as an, assertTsWritable as ao, chainAnchor as ap, loadPeriods as aq, validatePeriodName as ar, type GuardStrategy as as, type GuardChange as at, type GuardContext as au, GuardRegistry as av, type GuardStrategyHandle as aw, ReadOnlyVaultFacade as ax, type ShadowStrategy as ay, CollectionFrame as az, type DictKeyDescriptor as b, type CollectionStats as b$, type Role as b0, type UnlockedKeyring as b1, type HistoryStrategy as b2, type NoydbStore as b3, type HistoryOptions as b4, type EncryptedEnvelope as b5, type PruneOptions as b6, type AppendInput as b7, type ChangeType as b8, CollectionInstant as b9, type RegisteredMV as bA, MaterializedViewRegistry as bB, type MaterializedFromMeta as bC, type MaterializedViewOutput as bD, type UnionSource as bE, type UserEnvelope as bF, type GateName as bG, type GatePolicy as bH, type VaultPolicy as bI, type ActiveTier as bJ, type FactorProof as bK, type SchemaUpdateStrategy as bL, type TransformFn as bM, type PersistedSchemaEnvelope as bN, type UpdateDecision as bO, type DirectoryConfig as bP, type UserVisibility as bQ, type AccessibleVault as bR, type AffectedDocument as bS, BUNDLE_STORE_POLICY as bT, type BuiltInGateName as bU, type CacheOptions as bV, type CacheStats as bW, type ChangeEvent as bX, type CollectionChangeEvent as bY, type CollectionConflictResolver as bZ, type CollectionDescriptor as b_, type DiffEntry as ba, type JsonPatch as bb, type JsonPatchOp as bc, type LedgerEntry as bd, LedgerStore as be, type VaultEngine as bf, VaultInstant as bg, type VerifyResult as bh, applyPatch as bi, canonicalJson as bj, computePatch as bk, diff as bl, formatDiff as bm, hashEntry as bn, paddedIndex as bo, parseIndex as bp, sha256Hex as bq, type PublicEnvelope as br, type SealingKeyProvider as bs, type BundleRecipient as bt, type RecipientSealer as bu, type RecipientHint as bv, Vault as bw, type RecoveryEnrollmentInput as bx, type ShamirRecoveryProvider as by, type MVQueryContext as bz, DictionaryHandle as c, NOYDB_BACKUP_VERSION as c$, type Conflict as c0, type ConflictPolicy as c1, type ConflictStrategy as c2, type CrossTierAccessEvent as c3, DEFAULT_PUBLIC_ENVELOPE_SCHEMA as c4, DELEGATIONS_COLLECTION as c5, type DeepPartial as c6, type DeepPartialOrNull as c7, type DelegationToken as c8, type DeleteManyResult as c9, type HistoryEntry as cA, INDEXED_STORE_POLICY as cB, type ImportCapability as cC, type InferOutput as cD, type InternalCollectionStats as cE, type IssueDelegationOptions as cF, type IssueMagicLinkGrantOptions as cG, type KeyringAuthenticator as cH, type KeyringAuthenticatorWrappingDEKs as cI, type KeyringAuthenticatorWrappingKEK as cJ, type KeyringFile as cK, type ListAccessibleVaultsOptions as cL, type ListPageResult as cM, type ListUsersOptions as cN, type LiveUserEnvelope as cO, type LocaleReadOptions as cP, Lru as cQ, type LruOptions as cR, type LruStats as cS, MAGIC_LINK_CONTENT_INFO_PREFIX as cT, MAGIC_LINK_GRANTS_COLLECTION as cU, MAGIC_LINK_KEK_INFO_PREFIX as cV, type MagicLinkGrantPayload as cW, type MagicLinkGrantRecord as cX, type MaterializedViewDescriptor as cY, MemoryRecipientSealer as cZ, MemorySealingKeyProvider as c_, type DerivationDescriptor as ca, type DirtyEntry as cb, type DryRunResult as cc, type DumpSchemaOptions as cd, ELEVATION_AUDIT_COLLECTION as ce, ElevatedHandle as cf, type EnrollAuthenticatorOptions as cg, type EnrollAuthenticatorWrappingDEKsOptions as ch, type EnrollAuthenticatorWrappingKEKOptions as ci, type EnrollRecoveryResult as cj, type ExportCapability as ck, type ExportChunk as cl, type ExportFormat as cm, type ExportStreamOptions as cn, type FactorKind as co, type FactorProofBundle as cp, type FactorRequirement as cq, type FenceDoc as cr, type FenceState as cs, type FieldChange as ct, type FieldDescriptor as cu, type FieldSource as cv, type GhostRecord as cw, type GrantOptions as cx, type GuardViolation as cy, type HistoryConfig as cz, type DictionaryOptions as d, type StoreAuthKind as d$, NOYDB_FORMAT_VERSION as d0, NOYDB_KEYRING_VERSION as d1, NOYDB_SYNC_VERSION as d2, Noydb as d3, type NoydbEventMap as d4, type NoydbOptions as d5, type OverlayViewDescriptor as d6, PUBLIC_ENVELOPE_FIELDS as d7, type PaperRecoveryDoc as d8, type PaperRecoveryEntry as d9, type QuickUnlockState as dA, QuickUnlockStore as dB, type ReAuthOperation as dC, type RecoverPassphraseInput as dD, type RecoverPassphraseResult as dE, type RecoverUserOptions as dF, type RecoveryProof as dG, type ResolvedPublicEnvelopeSchema as dH, type RevokeOptions as dI, type RotatePassphraseInput as dJ, type RotateRecoveryOptions as dK, type RotateRecoveryResult as dL, SEALED_PASSPHRASE_RECORD_ID as dM, type SchemaDelta as dN, type SchemaIntrospection as dO, type SealedEnvelope as dP, type SealedPassphrase as dQ, type SessionPolicy as dR, type SetPublicEnvelopeInput as dS, type ShamirRecoveryDoc as dT, type ShamirRecoveryEntry as dU, type SlotRewrapCeremony as dV, type SlotRewrapContext as dW, type StandardSchemaV1 as dX, type StandardSchemaV1Issue as dY, type StandardSchemaV1SyncResult as dZ, type StoreAuth as d_, type PassphrasePolicy as da, type PassphraseValidationResult as db, type Permission as dc, type Permissions as dd, type PersistedSchemaKind as de, type PlaintextTranslatorContext as df, type PlaintextTranslatorFn as dg, PresenceHandle as dh, type PresencePeer as di, type PublicEnvelopeField as dj, type PublicEnvelopeSchema as dk, type PublicEnvelopeText as dl, type PullMode as dm, type PullOptions as dn, type PullPolicy as dp, type PullResult as dq, type PushMode as dr, type PushOptions as ds, type PushPolicy as dt, type PushResult as du, type PutManyItemOptions as dv, type PutManyOptions as dw, type PutManyResult as dx, type QueryAcrossOptions as dy, type QueryAcrossResult as dz, type I18nMap as e, listUsersWithEnvelopes as e$, type StoreCapabilities as e0, SyncEngine as e1, type SyncMetadata as e2, type SyncPolicy as e3, SyncScheduler as e4, type SyncSchedulerStatus as e5, type SyncStatus as e6, type SyncTarget as e7, type SyncTargetRole as e8, SyncTransaction as e9, type WeakPassphraseReason as eA, type WrappedDeksBlob as eB, type WriteConflict as eC, type WriteEvent as eD, type WriteHook as eE, type WriteQueue as eF, assertStrongPassphrase as eG, buildRecipientKeyringFile as eH, burnPaperRecoveryEntry as eI, createNoydb as eJ, createStore as eK, deriveMagicLinkContentKey as eL, enrollAuthenticator as eM, estimateEntropy as eN, evaluateExportCapability as eO, evaluateImportCapability as eP, findAuthenticator as eQ, hasExportCapability as eR, hasImportCapability as eS, hasRecoveryEnrolled as eT, isMagicLinkGrantExpired as eU, isPublicEnvelope as eV, issueDelegation as eW, recoverPassphrase as eX, rotatePassphrase as eY, listMagicLinkGrants as eZ, listUsers as e_, type SyncTransactionResult as ea, type TabChannel as eb, type TabCoordinationOptions as ec, type TabLockManager as ed, type TabPresence as ee, type TabRole as ef, type TierMode as eg, type TranslatorAuditEntry as eh, type TxOp as ei, USER_ENVELOPE_COLLECTION as ej, USER_ENVELOPE_MAX_BYTES as ek, type Unsubscribe as el, type UpdateAuthenticatorOptions as em, type UpdateContext as en, type UpdateUserOptions as eo, UserApi as ep, type UserEnvelopeCheckGate as eq, UserEnvelopeOversizedError as er, type UserEnvelopePresented as es, type UserInfo as et, type VaultBackup as eu, type VaultPolicyOnDisk as ev, type VaultSchemaSnapshot as ew, type VaultSnapshot as ex, type WarningRules as ey, WeakPassphraseError as ez, type I18nTextDescriptor as f, loadActiveDelegations as f0, loadPaperRecoveryEntries as f1, loadSealedPassphrase as f2, loadShamirRecoveryEntries as f3, magicLinkGrantRecordId as f4, mintPaperRecoveryEntry as f5, mintShamirRecoveryEntry as f6, mintWrappedDeksBlob as f7, parseSealedEnvelope as f8, readMagicLinkGrantRecord as f9, recoverUser as fa, removeAuthenticator as fb, resolveSchema as fc, revokeDelegation as fd, revokeMagicLinkGrant as fe, savePaperRecoveryEntries as ff, saveSealedPassphrase as fg, saveShamirRecoveryEntries as fh, unwrapDeksFromBlob as fi, unwrapDeksFromPaperEntry as fj, unwrapDeksFromShamirEntry as fk, unwrapMagicLinkGrant as fl, validatePassphrase as fm, validatePublicEnvelopeInput as fn, validateSchemaInput as fo, validateSchemaOutput as fp, writeMagicLinkGrant as fq, changeSecret as fr, createOwnerKeyring as fs, ensureCollectionDEK as ft, grant as fu, loadKeyring as fv, persistKeyring as fw, revoke as fx, updateAuthenticator as fy, updateKeyringIdentity as fz, type I18nTextOptions as g, type OnMissingPolicy as h, applyI18nLocale as i, dictCollectionName as j, dictKey as k, enforceScript as l, getAtPath as m, i18nText as n, inferScripts as o, isDictCollectionName as p, isDictKeyDescriptor as q, isI18nTextDescriptor as r, resolveI18nText as s, resolvePolicy as t, setAtPathInPlace as u, validateI18nTextValue as v, type SessionStrategy as w, createEnforcer as x, validateSessionPolicy as y, BLOB_CHUNKS_COLLECTION as z };
@@ -4530,6 +4530,30 @@ declare class QuickUnlockStore {
4530
4530
  private clearTimer;
4531
4531
  }
4532
4532
 
4533
+ /**
4534
+ * Cadence policy for automatic snapshots. Borrows the vocabulary of the sync
4535
+ * `SyncPolicy` (debounce / interval / minInterval / onUnload) but is a separate,
4536
+ * snapshot-specific shape — automatic snapshots write the single rolling
4537
+ * `<vault>__auto` key, never the immutable on-demand pool.
4538
+ *
4539
+ * Default mode is `'manual'`: no timers, snapshots stay on-demand.
4540
+ */
4541
+ type SnapshotMode = 'manual' | 'debounce' | 'interval';
4542
+ interface SnapshotPolicy {
4543
+ /** Trigger mode. Default `'manual'` — no automatic snapshots. */
4544
+ readonly mode?: SnapshotMode;
4545
+ /** Idle delay (ms) after a write before an auto-snapshot fires. `mode:'debounce'`. Default 30_000. */
4546
+ readonly debounceMs?: number;
4547
+ /** Fixed interval (ms). `mode:'interval'`. Default 300_000. */
4548
+ readonly intervalMs?: number;
4549
+ /** Hard floor (ms) between auto-snapshots regardless of mode. Default 0. */
4550
+ readonly minIntervalMs?: number;
4551
+ /** Flush a pending auto-snapshot on tab-hide / process exit. Default true for non-manual modes. */
4552
+ readonly onUnload?: boolean;
4553
+ /** Label applied to each auto-snapshot. Default `'auto'`. */
4554
+ readonly label?: string;
4555
+ }
4556
+
4533
4557
  interface SnapshotMeta {
4534
4558
  readonly version: string;
4535
4559
  readonly label?: string;
@@ -4544,6 +4568,8 @@ interface SnapshotMeta {
4544
4568
  * lacking a ledgerHead; not produced by the current engine.
4545
4569
  */
4546
4570
  readonly integrity: 'verified' | 'legacy-unverifiable';
4571
+ /** `true` for the rolling auto-snapshot; absent on on-demand checkpoints. */
4572
+ readonly auto?: true;
4547
4573
  }
4548
4574
  interface RetentionPolicy {
4549
4575
  readonly keepLast?: number;
@@ -4558,6 +4584,13 @@ interface SnapshotStrategy {
4558
4584
  }): Promise<SnapshotMeta>;
4559
4585
  listSnapshots(vaultId: string): Promise<SnapshotMeta[]>;
4560
4586
  restoreSnapshot(vault: unknown, version: string): Promise<void>;
4587
+ /** Rolling auto-snapshot to the fixed `<vault>__auto` key. */
4588
+ autoSnapshot(vault: unknown, by: string, opts?: {
4589
+ label?: string;
4590
+ note?: string;
4591
+ }): Promise<SnapshotMeta>;
4592
+ /** Configured cadence policy. Undefined or `mode:'manual'` ⇒ no scheduler is wired. */
4593
+ readonly policy?: SnapshotPolicy;
4561
4594
  }
4562
4595
 
4563
4596
  /**
@@ -4990,6 +5023,8 @@ declare class Noydb {
4990
5023
  private readonly sessionStrategy;
4991
5024
  private readonly syncStrategy;
4992
5025
  private readonly snapshotStrategy;
5026
+ private snapshotScheduler;
5027
+ private readonly dirtySnapshotVaults;
4993
5028
  /**
4994
5029
  * Currently-running multi-record transaction, set by
4995
5030
  * `runTransaction` at the start of Phase 2 (commit) and cleared in
@@ -5970,6 +6005,13 @@ declare class Noydb {
5970
6005
  label?: string;
5971
6006
  note?: string;
5972
6007
  }): Promise<SnapshotMeta>;
6008
+ /**
6009
+ * Wire the automatic-snapshot cadence when a non-manual `snapshotPolicy` is
6010
+ * configured. Subscribes to `onAfterWrite` to mark the written vault dirty and
6011
+ * nudge the scheduler; the scheduler fires `autoSnapshot()` per dirty vault.
6012
+ * No-op for `mode:'manual'` or no policy.
6013
+ */
6014
+ private initSnapshotCadence;
5973
6015
  /**
5974
6016
  * List all snapshots for the given vault, newest first.
5975
6017
  * Reads only the sidecar index — does not download snapshot bytes.
@@ -12773,4 +12815,4 @@ interface DeleteManyResult {
12773
12815
  }>;
12774
12816
  }
12775
12817
 
12776
- export { type ExportBlobsAuditEntry as $, BLOB_COLLECTION as A, type BlobStrategy as B, BLOB_EVICTION_AUDIT_COLLECTION as C, DICT_COLLECTION_PREFIX as D, BLOB_INDEX_COLLECTION as E, BLOB_SLOTS_PREFIX as F, BLOB_VERSIONS_PREFIX as G, type BlobEvictionEntry as H, type I18nStrategy as I, type BlobFieldPolicy as J, type BlobFieldsConfig as K, type Layer as L, type BlobObject as M, type BlobPutOptions as N, type OnMissing as O, PolicyEnforcer as P, type BlobResponseOptions as Q, type ResolveI18nOptions as R, type ScriptWarning as S, BlobSet as T, type BlobStrategyOpenArgs as U, type CompactRunOptions as V, type CompactionContext as W, type CompactionResult as X, DEFAULT_CHUNK_SIZE as Y, EXPORT_AUDIT_COLLECTION as Z, ExportBlobsAbortedError as _, type DictEntry as a, type UnlockedKeyring as a$, type ExportBlobsHandle as a0, type ExportBlobsOptions as a1, type ExportedBlob as a2, type SlotInfo as a3, type SlotRecord as a4, type VersionRecord as a5, createExportBlobsHandle as a6, runCompaction as a7, type ConsentStrategy as a8, CONSENT_AUDIT_COLLECTION as a9, VaultFrame as aA, type NoydbBundleStore as aB, type RetentionPolicy as aC, type SnapshotStrategy as aD, type SnapshotMeta as aE, type TxStrategy as aF, type AmendmentTxOptions as aG, TxCollection as aH, TxContext as aI, TxVault as aJ, runTransaction as aK, type DerivationStrategy as aL, type DerivationContext as aM, type ArrayOutputSpec as aN, DerivationRegistry as aO, type DerivationStrategyHandle as aP, type DerivedFromMeta as aQ, type OutputSpec as aR, type RecordOutputSpec as aS, type MaterializedViewStrategy as aT, type MaterializedViewStrategyHandle as aU, type OverlayedViewStrategy as aV, Collection as aW, OverlayedViewRegistry as aX, type OverlayedViewStrategyHandle as aY, type SyncStrategy as aZ, type Role as a_, type ConsentAuditEntry as aa, type ConsentAuditFilter as ab, type ConsentContext as ac, type ConsentOp as ad, loadConsentEntries as ae, writeConsentEntry as af, type PeriodsStrategy as ag, type CarryForwardContext as ah, type ClosePeriodOptions as ai, type OpenPeriodOptions as aj, PERIODS_COLLECTION as ak, type PeriodRecord as al, type ReadOnlyCollection as am, appendPeriodLedgerEntry as an, assertTsWritable as ao, chainAnchor as ap, loadPeriods as aq, validatePeriodName as ar, type GuardStrategy as as, type GuardChange as at, type GuardContext as au, GuardRegistry as av, type GuardStrategyHandle as aw, ReadOnlyVaultFacade as ax, type ShadowStrategy as ay, CollectionFrame as az, type DictKeyDescriptor as b, type ConflictPolicy as b$, type HistoryStrategy as b0, type NoydbStore as b1, type HistoryOptions as b2, type EncryptedEnvelope as b3, type PruneOptions as b4, type AppendInput as b5, type ChangeType as b6, CollectionInstant as b7, type DiffEntry as b8, type JsonPatch as b9, type MaterializedFromMeta as bA, type MaterializedViewOutput as bB, type UnionSource as bC, type UserEnvelope as bD, type GateName as bE, type GatePolicy as bF, type VaultPolicy as bG, type ActiveTier as bH, type FactorProof as bI, type SchemaUpdateStrategy as bJ, type TransformFn as bK, type PersistedSchemaEnvelope as bL, type UpdateDecision as bM, type DirectoryConfig as bN, type UserVisibility as bO, type AccessibleVault as bP, type AffectedDocument as bQ, BUNDLE_STORE_POLICY as bR, type BuiltInGateName as bS, type CacheOptions as bT, type CacheStats as bU, type ChangeEvent as bV, type CollectionChangeEvent as bW, type CollectionConflictResolver as bX, type CollectionDescriptor as bY, type CollectionStats as bZ, type Conflict as b_, type JsonPatchOp as ba, type LedgerEntry as bb, LedgerStore as bc, type VaultEngine as bd, VaultInstant as be, type VerifyResult as bf, applyPatch as bg, canonicalJson as bh, computePatch as bi, diff as bj, formatDiff as bk, hashEntry as bl, paddedIndex as bm, parseIndex as bn, sha256Hex as bo, type PublicEnvelope as bp, type SealingKeyProvider as bq, type BundleRecipient as br, type RecipientSealer as bs, type RecipientHint as bt, Vault as bu, type RecoveryEnrollmentInput as bv, type ShamirRecoveryProvider as bw, type MVQueryContext as bx, type RegisteredMV as by, MaterializedViewRegistry as bz, DictionaryHandle as c, NOYDB_KEYRING_VERSION as c$, type ConflictStrategy as c0, type CrossTierAccessEvent as c1, DEFAULT_PUBLIC_ENVELOPE_SCHEMA as c2, DELEGATIONS_COLLECTION as c3, type DeepPartial as c4, type DeepPartialOrNull as c5, type DelegationToken as c6, type DeleteManyResult as c7, type DerivationDescriptor as c8, type DirtyEntry as c9, type ImportCapability as cA, type InferOutput as cB, type InternalCollectionStats as cC, type IssueDelegationOptions as cD, type IssueMagicLinkGrantOptions as cE, type KeyringAuthenticator as cF, type KeyringAuthenticatorWrappingDEKs as cG, type KeyringAuthenticatorWrappingKEK as cH, type KeyringFile as cI, type ListAccessibleVaultsOptions as cJ, type ListPageResult as cK, type ListUsersOptions as cL, type LiveUserEnvelope as cM, type LocaleReadOptions as cN, Lru as cO, type LruOptions as cP, type LruStats as cQ, MAGIC_LINK_CONTENT_INFO_PREFIX as cR, MAGIC_LINK_GRANTS_COLLECTION as cS, MAGIC_LINK_KEK_INFO_PREFIX as cT, type MagicLinkGrantPayload as cU, type MagicLinkGrantRecord as cV, type MaterializedViewDescriptor as cW, MemoryRecipientSealer as cX, MemorySealingKeyProvider as cY, NOYDB_BACKUP_VERSION as cZ, NOYDB_FORMAT_VERSION as c_, type DryRunResult as ca, type DumpSchemaOptions as cb, ELEVATION_AUDIT_COLLECTION as cc, ElevatedHandle as cd, type EnrollAuthenticatorOptions as ce, type EnrollAuthenticatorWrappingDEKsOptions as cf, type EnrollAuthenticatorWrappingKEKOptions as cg, type EnrollRecoveryResult as ch, type ExportCapability as ci, type ExportChunk as cj, type ExportFormat as ck, type ExportStreamOptions as cl, type FactorKind as cm, type FactorProofBundle as cn, type FactorRequirement as co, type FenceDoc as cp, type FenceState as cq, type FieldChange as cr, type FieldDescriptor as cs, type FieldSource as ct, type GhostRecord as cu, type GrantOptions as cv, type GuardViolation as cw, type HistoryConfig as cx, type HistoryEntry as cy, INDEXED_STORE_POLICY as cz, type DictionaryOptions as d, SyncEngine as d$, NOYDB_SYNC_VERSION as d0, Noydb as d1, type NoydbEventMap as d2, type NoydbOptions as d3, type OverlayViewDescriptor as d4, PUBLIC_ENVELOPE_FIELDS as d5, type PaperRecoveryDoc as d6, type PaperRecoveryEntry as d7, type PassphrasePolicy as d8, type PassphraseValidationResult as d9, type ReAuthOperation as dA, type RecoverPassphraseInput as dB, type RecoverPassphraseResult as dC, type RecoverUserOptions as dD, type RecoveryProof as dE, type ResolvedPublicEnvelopeSchema as dF, type RevokeOptions as dG, type RotatePassphraseInput as dH, type RotateRecoveryOptions as dI, type RotateRecoveryResult as dJ, SEALED_PASSPHRASE_RECORD_ID as dK, type SchemaDelta as dL, type SchemaIntrospection as dM, type SealedEnvelope as dN, type SealedPassphrase as dO, type SessionPolicy as dP, type SetPublicEnvelopeInput as dQ, type ShamirRecoveryDoc as dR, type ShamirRecoveryEntry as dS, type SlotRewrapCeremony as dT, type SlotRewrapContext as dU, type StandardSchemaV1 as dV, type StandardSchemaV1Issue as dW, type StandardSchemaV1SyncResult as dX, type StoreAuth as dY, type StoreAuthKind as dZ, type StoreCapabilities as d_, type Permission as da, type Permissions as db, type PersistedSchemaKind as dc, type PlaintextTranslatorContext as dd, type PlaintextTranslatorFn as de, PresenceHandle as df, type PresencePeer as dg, type PublicEnvelopeField as dh, type PublicEnvelopeSchema as di, type PublicEnvelopeText as dj, type PullMode as dk, type PullOptions as dl, type PullPolicy as dm, type PullResult as dn, type PushMode as dp, type PushOptions as dq, type PushPolicy as dr, type PushResult as ds, type PutManyItemOptions as dt, type PutManyOptions as du, type PutManyResult as dv, type QueryAcrossOptions as dw, type QueryAcrossResult as dx, type QuickUnlockState as dy, QuickUnlockStore as dz, type I18nMap as e, loadPaperRecoveryEntries as e$, type SyncMetadata as e0, type SyncPolicy as e1, SyncScheduler as e2, type SyncSchedulerStatus as e3, type SyncStatus as e4, type SyncTarget as e5, type SyncTargetRole as e6, SyncTransaction as e7, type SyncTransactionResult as e8, type TabChannel as e9, type WriteConflict as eA, type WriteEvent as eB, type WriteHook as eC, type WriteQueue as eD, assertStrongPassphrase as eE, buildRecipientKeyringFile as eF, burnPaperRecoveryEntry as eG, createNoydb as eH, createStore as eI, deriveMagicLinkContentKey as eJ, enrollAuthenticator as eK, estimateEntropy as eL, evaluateExportCapability as eM, evaluateImportCapability as eN, findAuthenticator as eO, hasExportCapability as eP, hasImportCapability as eQ, hasRecoveryEnrolled as eR, isMagicLinkGrantExpired as eS, isPublicEnvelope as eT, issueDelegation as eU, recoverPassphrase as eV, rotatePassphrase as eW, listMagicLinkGrants as eX, listUsers as eY, listUsersWithEnvelopes as eZ, loadActiveDelegations as e_, type TabCoordinationOptions as ea, type TabLockManager as eb, type TabPresence as ec, type TabRole as ed, type TierMode as ee, type TranslatorAuditEntry as ef, type TxOp as eg, USER_ENVELOPE_COLLECTION as eh, USER_ENVELOPE_MAX_BYTES as ei, type Unsubscribe as ej, type UpdateAuthenticatorOptions as ek, type UpdateContext as el, type UpdateUserOptions as em, UserApi as en, type UserEnvelopeCheckGate as eo, UserEnvelopeOversizedError as ep, type UserEnvelopePresented as eq, type UserInfo as er, type VaultBackup as es, type VaultPolicyOnDisk as et, type VaultSchemaSnapshot as eu, type VaultSnapshot as ev, type WarningRules as ew, WeakPassphraseError as ex, type WeakPassphraseReason as ey, type WrappedDeksBlob as ez, type I18nTextDescriptor as f, loadSealedPassphrase as f0, loadShamirRecoveryEntries as f1, magicLinkGrantRecordId as f2, mintPaperRecoveryEntry as f3, mintShamirRecoveryEntry as f4, mintWrappedDeksBlob as f5, parseSealedEnvelope as f6, readMagicLinkGrantRecord as f7, recoverUser as f8, removeAuthenticator as f9, resolveSchema as fa, revokeDelegation as fb, revokeMagicLinkGrant as fc, savePaperRecoveryEntries as fd, saveSealedPassphrase as fe, saveShamirRecoveryEntries as ff, unwrapDeksFromBlob as fg, unwrapDeksFromPaperEntry as fh, unwrapDeksFromShamirEntry as fi, unwrapMagicLinkGrant as fj, validatePassphrase as fk, validatePublicEnvelopeInput as fl, validateSchemaInput as fm, validateSchemaOutput as fn, writeMagicLinkGrant as fo, changeSecret as fp, createOwnerKeyring as fq, ensureCollectionDEK as fr, grant as fs, loadKeyring as ft, persistKeyring as fu, revoke as fv, updateAuthenticator as fw, updateKeyringIdentity as fx, type I18nTextOptions as g, type OnMissingPolicy as h, applyI18nLocale as i, dictCollectionName as j, dictKey as k, enforceScript as l, getAtPath as m, i18nText as n, inferScripts as o, isDictCollectionName as p, isDictKeyDescriptor as q, isI18nTextDescriptor as r, resolveI18nText as s, resolvePolicy as t, setAtPathInPlace as u, validateI18nTextValue as v, type SessionStrategy as w, createEnforcer as x, validateSessionPolicy as y, BLOB_CHUNKS_COLLECTION as z };
12818
+ export { type ExportBlobsAuditEntry as $, BLOB_COLLECTION as A, type BlobStrategy as B, BLOB_EVICTION_AUDIT_COLLECTION as C, DICT_COLLECTION_PREFIX as D, BLOB_INDEX_COLLECTION as E, BLOB_SLOTS_PREFIX as F, BLOB_VERSIONS_PREFIX as G, type BlobEvictionEntry as H, type I18nStrategy as I, type BlobFieldPolicy as J, type BlobFieldsConfig as K, type Layer as L, type BlobObject as M, type BlobPutOptions as N, type OnMissing as O, PolicyEnforcer as P, type BlobResponseOptions as Q, type ResolveI18nOptions as R, type ScriptWarning as S, BlobSet as T, type BlobStrategyOpenArgs as U, type CompactRunOptions as V, type CompactionContext as W, type CompactionResult as X, DEFAULT_CHUNK_SIZE as Y, EXPORT_AUDIT_COLLECTION as Z, ExportBlobsAbortedError as _, type DictEntry as a, type SyncStrategy as a$, type ExportBlobsHandle as a0, type ExportBlobsOptions as a1, type ExportedBlob as a2, type SlotInfo as a3, type SlotRecord as a4, type VersionRecord as a5, createExportBlobsHandle as a6, runCompaction as a7, type ConsentStrategy as a8, CONSENT_AUDIT_COLLECTION as a9, VaultFrame as aA, type NoydbBundleStore as aB, type RetentionPolicy as aC, type SnapshotPolicy as aD, type SnapshotStrategy as aE, type SnapshotMeta as aF, type SnapshotMode as aG, type TxStrategy as aH, type AmendmentTxOptions as aI, TxCollection as aJ, TxContext as aK, TxVault as aL, runTransaction as aM, type DerivationStrategy as aN, type DerivationContext as aO, type ArrayOutputSpec as aP, DerivationRegistry as aQ, type DerivationStrategyHandle as aR, type DerivedFromMeta as aS, type OutputSpec as aT, type RecordOutputSpec as aU, type MaterializedViewStrategy as aV, type MaterializedViewStrategyHandle as aW, type OverlayedViewStrategy as aX, Collection as aY, OverlayedViewRegistry as aZ, type OverlayedViewStrategyHandle as a_, type ConsentAuditEntry as aa, type ConsentAuditFilter as ab, type ConsentContext as ac, type ConsentOp as ad, loadConsentEntries as ae, writeConsentEntry as af, type PeriodsStrategy as ag, type CarryForwardContext as ah, type ClosePeriodOptions as ai, type OpenPeriodOptions as aj, PERIODS_COLLECTION as ak, type PeriodRecord as al, type ReadOnlyCollection as am, appendPeriodLedgerEntry as an, assertTsWritable as ao, chainAnchor as ap, loadPeriods as aq, validatePeriodName as ar, type GuardStrategy as as, type GuardChange as at, type GuardContext as au, GuardRegistry as av, type GuardStrategyHandle as aw, ReadOnlyVaultFacade as ax, type ShadowStrategy as ay, CollectionFrame as az, type DictKeyDescriptor as b, type CollectionStats as b$, type Role as b0, type UnlockedKeyring as b1, type HistoryStrategy as b2, type NoydbStore as b3, type HistoryOptions as b4, type EncryptedEnvelope as b5, type PruneOptions as b6, type AppendInput as b7, type ChangeType as b8, CollectionInstant as b9, type RegisteredMV as bA, MaterializedViewRegistry as bB, type MaterializedFromMeta as bC, type MaterializedViewOutput as bD, type UnionSource as bE, type UserEnvelope as bF, type GateName as bG, type GatePolicy as bH, type VaultPolicy as bI, type ActiveTier as bJ, type FactorProof as bK, type SchemaUpdateStrategy as bL, type TransformFn as bM, type PersistedSchemaEnvelope as bN, type UpdateDecision as bO, type DirectoryConfig as bP, type UserVisibility as bQ, type AccessibleVault as bR, type AffectedDocument as bS, BUNDLE_STORE_POLICY as bT, type BuiltInGateName as bU, type CacheOptions as bV, type CacheStats as bW, type ChangeEvent as bX, type CollectionChangeEvent as bY, type CollectionConflictResolver as bZ, type CollectionDescriptor as b_, type DiffEntry as ba, type JsonPatch as bb, type JsonPatchOp as bc, type LedgerEntry as bd, LedgerStore as be, type VaultEngine as bf, VaultInstant as bg, type VerifyResult as bh, applyPatch as bi, canonicalJson as bj, computePatch as bk, diff as bl, formatDiff as bm, hashEntry as bn, paddedIndex as bo, parseIndex as bp, sha256Hex as bq, type PublicEnvelope as br, type SealingKeyProvider as bs, type BundleRecipient as bt, type RecipientSealer as bu, type RecipientHint as bv, Vault as bw, type RecoveryEnrollmentInput as bx, type ShamirRecoveryProvider as by, type MVQueryContext as bz, DictionaryHandle as c, NOYDB_BACKUP_VERSION as c$, type Conflict as c0, type ConflictPolicy as c1, type ConflictStrategy as c2, type CrossTierAccessEvent as c3, DEFAULT_PUBLIC_ENVELOPE_SCHEMA as c4, DELEGATIONS_COLLECTION as c5, type DeepPartial as c6, type DeepPartialOrNull as c7, type DelegationToken as c8, type DeleteManyResult as c9, type HistoryEntry as cA, INDEXED_STORE_POLICY as cB, type ImportCapability as cC, type InferOutput as cD, type InternalCollectionStats as cE, type IssueDelegationOptions as cF, type IssueMagicLinkGrantOptions as cG, type KeyringAuthenticator as cH, type KeyringAuthenticatorWrappingDEKs as cI, type KeyringAuthenticatorWrappingKEK as cJ, type KeyringFile as cK, type ListAccessibleVaultsOptions as cL, type ListPageResult as cM, type ListUsersOptions as cN, type LiveUserEnvelope as cO, type LocaleReadOptions as cP, Lru as cQ, type LruOptions as cR, type LruStats as cS, MAGIC_LINK_CONTENT_INFO_PREFIX as cT, MAGIC_LINK_GRANTS_COLLECTION as cU, MAGIC_LINK_KEK_INFO_PREFIX as cV, type MagicLinkGrantPayload as cW, type MagicLinkGrantRecord as cX, type MaterializedViewDescriptor as cY, MemoryRecipientSealer as cZ, MemorySealingKeyProvider as c_, type DerivationDescriptor as ca, type DirtyEntry as cb, type DryRunResult as cc, type DumpSchemaOptions as cd, ELEVATION_AUDIT_COLLECTION as ce, ElevatedHandle as cf, type EnrollAuthenticatorOptions as cg, type EnrollAuthenticatorWrappingDEKsOptions as ch, type EnrollAuthenticatorWrappingKEKOptions as ci, type EnrollRecoveryResult as cj, type ExportCapability as ck, type ExportChunk as cl, type ExportFormat as cm, type ExportStreamOptions as cn, type FactorKind as co, type FactorProofBundle as cp, type FactorRequirement as cq, type FenceDoc as cr, type FenceState as cs, type FieldChange as ct, type FieldDescriptor as cu, type FieldSource as cv, type GhostRecord as cw, type GrantOptions as cx, type GuardViolation as cy, type HistoryConfig as cz, type DictionaryOptions as d, type StoreAuthKind as d$, NOYDB_FORMAT_VERSION as d0, NOYDB_KEYRING_VERSION as d1, NOYDB_SYNC_VERSION as d2, Noydb as d3, type NoydbEventMap as d4, type NoydbOptions as d5, type OverlayViewDescriptor as d6, PUBLIC_ENVELOPE_FIELDS as d7, type PaperRecoveryDoc as d8, type PaperRecoveryEntry as d9, type QuickUnlockState as dA, QuickUnlockStore as dB, type ReAuthOperation as dC, type RecoverPassphraseInput as dD, type RecoverPassphraseResult as dE, type RecoverUserOptions as dF, type RecoveryProof as dG, type ResolvedPublicEnvelopeSchema as dH, type RevokeOptions as dI, type RotatePassphraseInput as dJ, type RotateRecoveryOptions as dK, type RotateRecoveryResult as dL, SEALED_PASSPHRASE_RECORD_ID as dM, type SchemaDelta as dN, type SchemaIntrospection as dO, type SealedEnvelope as dP, type SealedPassphrase as dQ, type SessionPolicy as dR, type SetPublicEnvelopeInput as dS, type ShamirRecoveryDoc as dT, type ShamirRecoveryEntry as dU, type SlotRewrapCeremony as dV, type SlotRewrapContext as dW, type StandardSchemaV1 as dX, type StandardSchemaV1Issue as dY, type StandardSchemaV1SyncResult as dZ, type StoreAuth as d_, type PassphrasePolicy as da, type PassphraseValidationResult as db, type Permission as dc, type Permissions as dd, type PersistedSchemaKind as de, type PlaintextTranslatorContext as df, type PlaintextTranslatorFn as dg, PresenceHandle as dh, type PresencePeer as di, type PublicEnvelopeField as dj, type PublicEnvelopeSchema as dk, type PublicEnvelopeText as dl, type PullMode as dm, type PullOptions as dn, type PullPolicy as dp, type PullResult as dq, type PushMode as dr, type PushOptions as ds, type PushPolicy as dt, type PushResult as du, type PutManyItemOptions as dv, type PutManyOptions as dw, type PutManyResult as dx, type QueryAcrossOptions as dy, type QueryAcrossResult as dz, type I18nMap as e, listUsersWithEnvelopes as e$, type StoreCapabilities as e0, SyncEngine as e1, type SyncMetadata as e2, type SyncPolicy as e3, SyncScheduler as e4, type SyncSchedulerStatus as e5, type SyncStatus as e6, type SyncTarget as e7, type SyncTargetRole as e8, SyncTransaction as e9, type WeakPassphraseReason as eA, type WrappedDeksBlob as eB, type WriteConflict as eC, type WriteEvent as eD, type WriteHook as eE, type WriteQueue as eF, assertStrongPassphrase as eG, buildRecipientKeyringFile as eH, burnPaperRecoveryEntry as eI, createNoydb as eJ, createStore as eK, deriveMagicLinkContentKey as eL, enrollAuthenticator as eM, estimateEntropy as eN, evaluateExportCapability as eO, evaluateImportCapability as eP, findAuthenticator as eQ, hasExportCapability as eR, hasImportCapability as eS, hasRecoveryEnrolled as eT, isMagicLinkGrantExpired as eU, isPublicEnvelope as eV, issueDelegation as eW, recoverPassphrase as eX, rotatePassphrase as eY, listMagicLinkGrants as eZ, listUsers as e_, type SyncTransactionResult as ea, type TabChannel as eb, type TabCoordinationOptions as ec, type TabLockManager as ed, type TabPresence as ee, type TabRole as ef, type TierMode as eg, type TranslatorAuditEntry as eh, type TxOp as ei, USER_ENVELOPE_COLLECTION as ej, USER_ENVELOPE_MAX_BYTES as ek, type Unsubscribe as el, type UpdateAuthenticatorOptions as em, type UpdateContext as en, type UpdateUserOptions as eo, UserApi as ep, type UserEnvelopeCheckGate as eq, UserEnvelopeOversizedError as er, type UserEnvelopePresented as es, type UserInfo as et, type VaultBackup as eu, type VaultPolicyOnDisk as ev, type VaultSchemaSnapshot as ew, type VaultSnapshot as ex, type WarningRules as ey, WeakPassphraseError as ez, type I18nTextDescriptor as f, loadActiveDelegations as f0, loadPaperRecoveryEntries as f1, loadSealedPassphrase as f2, loadShamirRecoveryEntries as f3, magicLinkGrantRecordId as f4, mintPaperRecoveryEntry as f5, mintShamirRecoveryEntry as f6, mintWrappedDeksBlob as f7, parseSealedEnvelope as f8, readMagicLinkGrantRecord as f9, recoverUser as fa, removeAuthenticator as fb, resolveSchema as fc, revokeDelegation as fd, revokeMagicLinkGrant as fe, savePaperRecoveryEntries as ff, saveSealedPassphrase as fg, saveShamirRecoveryEntries as fh, unwrapDeksFromBlob as fi, unwrapDeksFromPaperEntry as fj, unwrapDeksFromShamirEntry as fk, unwrapMagicLinkGrant as fl, validatePassphrase as fm, validatePublicEnvelopeInput as fn, validateSchemaInput as fo, validateSchemaOutput as fp, writeMagicLinkGrant as fq, changeSecret as fr, createOwnerKeyring as fs, ensureCollectionDEK as ft, grant as fu, loadKeyring as fv, persistKeyring as fw, revoke as fx, updateAuthenticator as fy, updateKeyringIdentity as fz, type I18nTextOptions as g, type OnMissingPolicy as h, applyI18nLocale as i, dictCollectionName as j, dictKey as k, enforceScript as l, getAtPath as m, i18nText as n, inferScripts as o, isDictCollectionName as p, isDictKeyDescriptor as q, isI18nTextDescriptor as r, resolveI18nText as s, resolvePolicy as t, setAtPathInPlace as u, validateI18nTextValue as v, type SessionStrategy as w, createEnforcer as x, validateSessionPolicy as y, BLOB_CHUNKS_COLLECTION as z };
@@ -1,4 +1,4 @@
1
- import { bp as PublicEnvelope, bq as SealingKeyProvider, br as BundleRecipient, bs as RecipientSealer, bt as RecipientHint, bu as Vault } from './types-DGU60JDt.js';
1
+ import { br as PublicEnvelope, bs as SealingKeyProvider, bt as BundleRecipient, bu as RecipientSealer, bv as RecipientHint, bw as Vault } from './types-Df28QFKb.js';
2
2
 
3
3
  /**
4
4
  * `.noydb` container format — byte layout, header schema, validators.
@@ -1,4 +1,4 @@
1
- import { bp as PublicEnvelope, bq as SealingKeyProvider, br as BundleRecipient, bs as RecipientSealer, bt as RecipientHint, bu as Vault } from './types-DjunxzJa.cjs';
1
+ import { br as PublicEnvelope, bs as SealingKeyProvider, bt as BundleRecipient, bu as RecipientSealer, bv as RecipientHint, bw as Vault } from './types-DyXYr8rE.cjs';
2
2
 
3
3
  /**
4
4
  * `.noydb` container format — byte layout, header schema, validators.
@@ -1,4 +1,4 @@
1
- import { aL as DerivationStrategy, aP as DerivationStrategyHandle } from './types-DGU60JDt.js';
1
+ import { aN as DerivationStrategy, aR as DerivationStrategyHandle } from './types-Df28QFKb.js';
2
2
 
3
3
  /**
4
4
  * Register a deterministic derivation: one source collection → one or
@@ -1,4 +1,4 @@
1
- import { aL as DerivationStrategy, aP as DerivationStrategyHandle } from './types-DjunxzJa.cjs';
1
+ import { aN as DerivationStrategy, aR as DerivationStrategyHandle } from './types-DyXYr8rE.cjs';
2
2
 
3
3
  /**
4
4
  * Register a deterministic derivation: one source collection → one or
@@ -1,4 +1,4 @@
1
- import { as as GuardStrategy, aw as GuardStrategyHandle } from './types-DjunxzJa.cjs';
1
+ import { as as GuardStrategy, aw as GuardStrategyHandle } from './types-DyXYr8rE.cjs';
2
2
 
3
3
  /**
4
4
  * Register a guard for a collection. Guards run on every `put()` /
@@ -1,4 +1,4 @@
1
- import { as as GuardStrategy, aw as GuardStrategyHandle } from './types-DGU60JDt.js';
1
+ import { as as GuardStrategy, aw as GuardStrategyHandle } from './types-Df28QFKb.js';
2
2
 
3
3
  /**
4
4
  * Register a guard for a collection. Guards run on every `put()` /
@@ -1,4 +1,4 @@
1
- import { aT as MaterializedViewStrategy, aU as MaterializedViewStrategyHandle } from './types-DGU60JDt.js';
1
+ import { aV as MaterializedViewStrategy, aW as MaterializedViewStrategyHandle } from './types-Df28QFKb.js';
2
2
 
3
3
  /**
4
4
  * Register a materialized view: a declared query whose result is
@@ -1,4 +1,4 @@
1
- import { aT as MaterializedViewStrategy, aU as MaterializedViewStrategyHandle } from './types-DjunxzJa.cjs';
1
+ import { aV as MaterializedViewStrategy, aW as MaterializedViewStrategyHandle } from './types-DyXYr8rE.cjs';
2
2
 
3
3
  /**
4
4
  * Register a materialized view: a declared query whose result is
@@ -1,4 +1,4 @@
1
- import { aV as OverlayedViewStrategy, aY as OverlayedViewStrategyHandle } from './types-DjunxzJa.cjs';
1
+ import { aX as OverlayedViewStrategy, a_ as OverlayedViewStrategyHandle } from './types-DyXYr8rE.cjs';
2
2
 
3
3
  /**
4
4
  * Register a read-shadow overlay: bind an MV-owned base collection to
@@ -1,4 +1,4 @@
1
- import { aV as OverlayedViewStrategy, aY as OverlayedViewStrategyHandle } from './types-DGU60JDt.js';
1
+ import { aX as OverlayedViewStrategy, a_ as OverlayedViewStrategyHandle } from './types-Df28QFKb.js';
2
2
 
3
3
  /**
4
4
  * Register a read-shadow overlay: bind an MV-owned base collection to