@noy-db/hub 0.2.0-pre.1 → 0.2.0-pre.3

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 (253) hide show
  1. package/dist/aggregate/index.cjs.map +1 -1
  2. package/dist/aggregate/index.js +2 -2
  3. package/dist/attestation/index.cjs +305 -0
  4. package/dist/attestation/index.cjs.map +1 -0
  5. package/dist/attestation/index.d.cts +52 -0
  6. package/dist/attestation/index.d.ts +52 -0
  7. package/dist/attestation/index.js +36 -0
  8. package/dist/attestation/index.js.map +1 -0
  9. package/dist/blobs/index.cjs.map +1 -1
  10. package/dist/blobs/index.d.cts +4 -3
  11. package/dist/blobs/index.d.ts +4 -3
  12. package/dist/blobs/index.js +10 -8
  13. package/dist/blobs/index.js.map +1 -1
  14. package/dist/bundle/index.cjs +17940 -129
  15. package/dist/bundle/index.cjs.map +1 -1
  16. package/dist/bundle/index.d.cts +172 -3
  17. package/dist/bundle/index.d.ts +172 -3
  18. package/dist/bundle/index.js +533 -5
  19. package/dist/bundle/index.js.map +1 -1
  20. package/dist/{chunk-CBAHB2BF.js → chunk-2EYC3WDT.js} +7 -70
  21. package/dist/chunk-2EYC3WDT.js.map +1 -0
  22. package/dist/{chunk-P7EQ2S5O.js → chunk-2XLVPKXG.js} +2 -2
  23. package/dist/chunk-4OQWR46B.js +79 -0
  24. package/dist/chunk-4OQWR46B.js.map +1 -0
  25. package/dist/{chunk-23TTQXVO.js → chunk-4UBOTYP5.js} +2 -2
  26. package/dist/chunk-4X2S7PBF.js +251 -0
  27. package/dist/chunk-4X2S7PBF.js.map +1 -0
  28. package/dist/{chunk-MKSA2V7A.js → chunk-5YHWBPOT.js} +2 -2
  29. package/dist/{chunk-DYBQG5PQ.js → chunk-6S3LLAQ5.js} +2 -2
  30. package/dist/{chunk-UA4RI7OT.js → chunk-74JEQFMT.js} +5 -5
  31. package/dist/chunk-75QDHSE4.js +59 -0
  32. package/dist/chunk-75QDHSE4.js.map +1 -0
  33. package/dist/chunk-A6SWRXUQ.js +118 -0
  34. package/dist/chunk-A6SWRXUQ.js.map +1 -0
  35. package/dist/{chunk-UZXLQCHP.js → chunk-BFI3RS42.js} +2 -2
  36. package/dist/{chunk-EGQYGYIU.js → chunk-EMEX37ZN.js} +2 -2
  37. package/dist/{chunk-PEULZC6M.js → chunk-EPK6A3WJ.js} +8 -1
  38. package/dist/chunk-EPK6A3WJ.js.map +1 -0
  39. package/dist/{chunk-VMIO4IXG.js → chunk-FBMXWVGP.js} +6 -229
  40. package/dist/chunk-FBMXWVGP.js.map +1 -0
  41. package/dist/{chunk-ZNOEIM6Y.js → chunk-FCDO7UAO.js} +2 -2
  42. package/dist/{chunk-5SCJ5UEF.js → chunk-FS7A4XNF.js} +3 -3
  43. package/dist/{chunk-YS3POABP.js → chunk-FXQYZNOW.js} +1 -1
  44. package/dist/chunk-FXQYZNOW.js.map +1 -0
  45. package/dist/{chunk-SIZWEV2Y.js → chunk-G7PAZ3TD.js} +4 -4
  46. package/dist/{chunk-SIZWEV2Y.js.map → chunk-G7PAZ3TD.js.map} +1 -1
  47. package/dist/{chunk-537VFZTR.js → chunk-GAUBWHAF.js} +4 -4
  48. package/dist/{chunk-FCXOFQAJ.js → chunk-GD3BGKAR.js} +2 -2
  49. package/dist/{chunk-DPMFBCV6.js → chunk-GDTCGIPX.js} +2 -2
  50. package/dist/{chunk-DPMFBCV6.js.map → chunk-GDTCGIPX.js.map} +1 -1
  51. package/dist/{chunk-6HPZY4ON.js → chunk-GVXBHCZ2.js} +8 -3
  52. package/dist/chunk-GVXBHCZ2.js.map +1 -0
  53. package/dist/{chunk-HB3Z2GCR.js → chunk-HGZ7DC5H.js} +2 -2
  54. package/dist/{chunk-MIQHZESA.js → chunk-IS5HWQO7.js} +5 -5
  55. package/dist/{chunk-MIQHZESA.js.map → chunk-IS5HWQO7.js.map} +1 -1
  56. package/dist/{chunk-5DWL3JBF.js → chunk-K5PVGKE4.js} +2 -2
  57. package/dist/{chunk-NIOHFJPJ.js → chunk-KMI2NBBF.js} +7 -119
  58. package/dist/chunk-KMI2NBBF.js.map +1 -0
  59. package/dist/{chunk-XGSOTWYX.js → chunk-KYKMKLJ6.js} +2 -2
  60. package/dist/chunk-LOL725S4.js +233 -0
  61. package/dist/chunk-LOL725S4.js.map +1 -0
  62. package/dist/{chunk-4TFSM22V.js → chunk-LS3JLEIB.js} +4 -4
  63. package/dist/{chunk-2AXFIYHT.js → chunk-NCO2JGKK.js} +1 -1
  64. package/dist/chunk-NCO2JGKK.js.map +1 -0
  65. package/dist/{chunk-Z72JH4KG.js → chunk-NGSPBLLE.js} +4 -34
  66. package/dist/chunk-NGSPBLLE.js.map +1 -0
  67. package/dist/{chunk-OMLIZL2P.js → chunk-NSLTPGEN.js} +2 -2
  68. package/dist/{chunk-7H6DOO3E.js → chunk-P6256WTJ.js} +211 -36
  69. package/dist/chunk-P6256WTJ.js.map +1 -0
  70. package/dist/{chunk-KESP7GOK.js → chunk-QAU5HM6Q.js} +3 -3
  71. package/dist/{chunk-34YSDCDP.js → chunk-SAVQ6E2O.js} +2 -2
  72. package/dist/chunk-T6HQMVML.js +9960 -0
  73. package/dist/chunk-T6HQMVML.js.map +1 -0
  74. package/dist/{chunk-PA6R5ZCI.js → chunk-TLFUDXVV.js} +4 -4
  75. package/dist/{chunk-WCA2NROQ.js → chunk-UOF74WQY.js} +2 -2
  76. package/dist/chunk-UVPGJXVO.js +83 -0
  77. package/dist/chunk-UVPGJXVO.js.map +1 -0
  78. package/dist/{chunk-DYECX3IX.js → chunk-WRLHNG6H.js} +2 -2
  79. package/dist/{chunk-ADQ5MQ54.js → chunk-YDLAFP36.js} +71 -1
  80. package/dist/chunk-YDLAFP36.js.map +1 -0
  81. package/dist/{chunk-I6MX32UC.js → chunk-YK72A4IT.js} +4 -4
  82. package/dist/chunk-YL2DR3HY.js +36 -0
  83. package/dist/chunk-YL2DR3HY.js.map +1 -0
  84. package/dist/{chunk-RD5LYKD6.js → chunk-ZC2AAE6J.js} +2 -2
  85. package/dist/chunk-ZUMGGHRB.js +57 -0
  86. package/dist/chunk-ZUMGGHRB.js.map +1 -0
  87. package/dist/consent/index.cjs.map +1 -1
  88. package/dist/consent/index.d.cts +4 -3
  89. package/dist/consent/index.d.ts +4 -3
  90. package/dist/consent/index.js +3 -3
  91. package/dist/{crypto-A7FRXYHC.js → crypto-H2Y3DDFW.js} +3 -3
  92. package/dist/{delegation-YBA4X4JN.js → delegation-QSC7G5QC.js} +5 -5
  93. package/dist/derivations/index.cjs.map +1 -1
  94. package/dist/derivations/index.d.cts +5 -4
  95. package/dist/derivations/index.d.ts +5 -4
  96. package/dist/derivations/index.js +4 -4
  97. package/dist/{dev-unlock-D9s-loPr.d.ts → dev-unlock-Cf2B7Kih.d.ts} +1 -1
  98. package/dist/{dev-unlock-DRwVSy2S.d.cts → dev-unlock-De3mjQWv.d.cts} +1 -1
  99. package/dist/executor-BZKFZVRC.js +8 -0
  100. package/dist/executor-GFZFDQXV.js +8 -0
  101. package/dist/executor-KT2IOZVP.js +11 -0
  102. package/dist/{fanout-sidecar-VJ52RIEY.js → fanout-sidecar-NRBWSLRK.js} +2 -2
  103. package/dist/guards/index.cjs +7 -0
  104. package/dist/guards/index.cjs.map +1 -1
  105. package/dist/guards/index.d.cts +5 -4
  106. package/dist/guards/index.d.ts +5 -4
  107. package/dist/guards/index.js +4 -4
  108. package/dist/{hash-DXXXusyk.d.ts → hash-gVn_uKhp.d.ts} +1 -1
  109. package/dist/{hash-DtRih9MQ.d.cts → hash-vBCB0-Ps.d.cts} +1 -1
  110. package/dist/history/index.cjs +2 -2
  111. package/dist/history/index.cjs.map +1 -1
  112. package/dist/history/index.d.cts +5 -4
  113. package/dist/history/index.d.ts +5 -4
  114. package/dist/history/index.js +6 -6
  115. package/dist/i18n/index.cjs.map +1 -1
  116. package/dist/i18n/index.d.cts +4 -3
  117. package/dist/i18n/index.d.ts +4 -3
  118. package/dist/i18n/index.js +14 -12
  119. package/dist/i18n/index.js.map +1 -1
  120. package/dist/{index-CNwA-B6-.d.ts → index-BF1B2HB9.d.ts} +53 -1
  121. package/dist/{index-CmVgTkqk.d.cts → index-DVkvrgpm.d.cts} +53 -1
  122. package/dist/index.cjs +1780 -64
  123. package/dist/index.cjs.map +1 -1
  124. package/dist/index.d.cts +34 -12
  125. package/dist/index.d.ts +34 -12
  126. package/dist/index.js +160 -8804
  127. package/dist/index.js.map +1 -1
  128. package/dist/indexing/index.cjs.map +1 -1
  129. package/dist/indexing/index.js +2 -2
  130. package/dist/issue-BAJ7ZB4S.js +12 -0
  131. package/dist/{ledger-3TXNP47J.js → ledger-WOEJUYTP.js} +6 -6
  132. package/dist/materialized-views/index.cjs.map +1 -1
  133. package/dist/materialized-views/index.d.cts +6 -5
  134. package/dist/materialized-views/index.d.ts +6 -5
  135. package/dist/materialized-views/index.js +6 -6
  136. package/dist/noydb-XNQSKXGO.js +34 -0
  137. package/dist/overlay-views/index.cjs.map +1 -1
  138. package/dist/overlay-views/index.d.cts +5 -4
  139. package/dist/overlay-views/index.d.ts +5 -4
  140. package/dist/overlay-views/index.js +6 -4
  141. package/dist/periods/index.cjs.map +1 -1
  142. package/dist/periods/index.d.cts +4 -3
  143. package/dist/periods/index.d.ts +4 -3
  144. package/dist/periods/index.js +6 -6
  145. package/dist/{public-envelope-PY6NKFLI.js → public-envelope-OHQ5UZFM.js} +4 -4
  146. package/dist/query/index.cjs.map +1 -1
  147. package/dist/query/index.d.cts +1 -1
  148. package/dist/query/index.d.ts +1 -1
  149. package/dist/query/index.js +3 -3
  150. package/dist/registry-2IEARCGT.js +7 -0
  151. package/dist/{registry-3L3N3PTG.js → registry-CDHASH73.js} +3 -3
  152. package/dist/registry-EMGLZGR6.js +8 -0
  153. package/dist/registry-NQALYR77.js +8 -0
  154. package/dist/registry-NQALYR77.js.map +1 -0
  155. package/dist/revoke-7JOVLZFD.js +17 -0
  156. package/dist/revoke-7JOVLZFD.js.map +1 -0
  157. package/dist/session/index.cjs.map +1 -1
  158. package/dist/session/index.d.cts +5 -4
  159. package/dist/session/index.d.ts +5 -4
  160. package/dist/session/index.js +3 -3
  161. package/dist/shadow/index.cjs.map +1 -1
  162. package/dist/shadow/index.d.cts +4 -3
  163. package/dist/shadow/index.d.ts +4 -3
  164. package/dist/shadow/index.js +2 -2
  165. package/dist/signer-M4K5HBLD.js +18 -0
  166. package/dist/signer-M4K5HBLD.js.map +1 -0
  167. package/dist/{stale-HSC5YO2O.js → stale-PAGCS4K5.js} +2 -2
  168. package/dist/stale-PAGCS4K5.js.map +1 -0
  169. package/dist/store/index.cjs.map +1 -1
  170. package/dist/store/index.d.cts +4 -3
  171. package/dist/store/index.d.ts +4 -3
  172. package/dist/store/index.js +2 -2
  173. package/dist/sync/index.cjs.map +1 -1
  174. package/dist/sync/index.d.cts +3 -2
  175. package/dist/sync/index.d.ts +3 -2
  176. package/dist/sync/index.js +4 -4
  177. package/dist/team/index.cjs.map +1 -1
  178. package/dist/team/index.d.cts +4 -3
  179. package/dist/team/index.d.ts +4 -3
  180. package/dist/team/index.js +13 -11
  181. package/dist/tx/index.cjs +81 -1
  182. package/dist/tx/index.cjs.map +1 -1
  183. package/dist/tx/index.d.cts +5 -4
  184. package/dist/tx/index.d.ts +5 -4
  185. package/dist/tx/index.js +56 -3
  186. package/dist/tx/index.js.map +1 -1
  187. package/dist/{types-C4lwMKKF.d.cts → types-CSLcfytP.d.cts} +644 -5
  188. package/dist/{types-DW9RGSSs.d.ts → types-D9eB0Rvh.d.ts} +644 -5
  189. package/dist/{index-4agOpzqd.d.ts → ulid-CG2YvAbg.d.cts} +51 -33
  190. package/dist/{index-hdFvZkBP.d.cts → ulid-CiM2OAeM.d.ts} +51 -33
  191. package/dist/util/index.cjs.map +1 -1
  192. package/dist/util/index.js +1 -1
  193. package/dist/{with-derivation-g-pGoMzL.d.ts → with-derivation-Bzpj6UTv.d.ts} +1 -1
  194. package/dist/{with-derivation-C8LDlV7t.d.cts → with-derivation-DWajFh4K.d.cts} +1 -1
  195. package/dist/{with-guard-jI1x9Z3k.d.cts → with-guard-DF_Ul3DT.d.cts} +1 -1
  196. package/dist/{with-guard-DWOCK4Ca.d.ts → with-guard-DR7U-l4v.d.ts} +1 -1
  197. package/dist/{with-materialized-view-DcTx4H3j.d.cts → with-materialized-view-_piodoIz.d.cts} +1 -1
  198. package/dist/{with-materialized-view-DaKR-N6J.d.ts → with-materialized-view-qtoJ3xKJ.d.ts} +1 -1
  199. package/dist/{with-overlayed-view-N7jYuNOS.d.ts → with-overlayed-view-DFaRfgMr.d.ts} +1 -1
  200. package/dist/{with-overlayed-view-D-6oWAgM.d.cts → with-overlayed-view-DwzCKxn2.d.cts} +1 -1
  201. package/package.json +15 -3
  202. package/dist/chunk-2AXFIYHT.js.map +0 -1
  203. package/dist/chunk-6HPZY4ON.js.map +0 -1
  204. package/dist/chunk-7H6DOO3E.js.map +0 -1
  205. package/dist/chunk-ADQ5MQ54.js.map +0 -1
  206. package/dist/chunk-CBAHB2BF.js.map +0 -1
  207. package/dist/chunk-NIOHFJPJ.js.map +0 -1
  208. package/dist/chunk-PEULZC6M.js.map +0 -1
  209. package/dist/chunk-VMIO4IXG.js.map +0 -1
  210. package/dist/chunk-YS3POABP.js.map +0 -1
  211. package/dist/chunk-Z72JH4KG.js.map +0 -1
  212. package/dist/executor-7E3VFGW7.js +0 -11
  213. package/dist/executor-CEWX2FQI.js +0 -8
  214. package/dist/executor-X4SQ3ZLC.js +0 -8
  215. package/dist/registry-O47PUPSY.js +0 -8
  216. package/dist/registry-RFGGMVNJ.js +0 -7
  217. package/dist/registry-WLLMODKN.js +0 -8
  218. /package/dist/{chunk-P7EQ2S5O.js.map → chunk-2XLVPKXG.js.map} +0 -0
  219. /package/dist/{chunk-23TTQXVO.js.map → chunk-4UBOTYP5.js.map} +0 -0
  220. /package/dist/{chunk-MKSA2V7A.js.map → chunk-5YHWBPOT.js.map} +0 -0
  221. /package/dist/{chunk-DYBQG5PQ.js.map → chunk-6S3LLAQ5.js.map} +0 -0
  222. /package/dist/{chunk-UA4RI7OT.js.map → chunk-74JEQFMT.js.map} +0 -0
  223. /package/dist/{chunk-UZXLQCHP.js.map → chunk-BFI3RS42.js.map} +0 -0
  224. /package/dist/{chunk-EGQYGYIU.js.map → chunk-EMEX37ZN.js.map} +0 -0
  225. /package/dist/{chunk-ZNOEIM6Y.js.map → chunk-FCDO7UAO.js.map} +0 -0
  226. /package/dist/{chunk-5SCJ5UEF.js.map → chunk-FS7A4XNF.js.map} +0 -0
  227. /package/dist/{chunk-537VFZTR.js.map → chunk-GAUBWHAF.js.map} +0 -0
  228. /package/dist/{chunk-FCXOFQAJ.js.map → chunk-GD3BGKAR.js.map} +0 -0
  229. /package/dist/{chunk-HB3Z2GCR.js.map → chunk-HGZ7DC5H.js.map} +0 -0
  230. /package/dist/{chunk-5DWL3JBF.js.map → chunk-K5PVGKE4.js.map} +0 -0
  231. /package/dist/{chunk-XGSOTWYX.js.map → chunk-KYKMKLJ6.js.map} +0 -0
  232. /package/dist/{chunk-4TFSM22V.js.map → chunk-LS3JLEIB.js.map} +0 -0
  233. /package/dist/{chunk-OMLIZL2P.js.map → chunk-NSLTPGEN.js.map} +0 -0
  234. /package/dist/{chunk-KESP7GOK.js.map → chunk-QAU5HM6Q.js.map} +0 -0
  235. /package/dist/{chunk-34YSDCDP.js.map → chunk-SAVQ6E2O.js.map} +0 -0
  236. /package/dist/{chunk-PA6R5ZCI.js.map → chunk-TLFUDXVV.js.map} +0 -0
  237. /package/dist/{chunk-WCA2NROQ.js.map → chunk-UOF74WQY.js.map} +0 -0
  238. /package/dist/{chunk-DYECX3IX.js.map → chunk-WRLHNG6H.js.map} +0 -0
  239. /package/dist/{chunk-I6MX32UC.js.map → chunk-YK72A4IT.js.map} +0 -0
  240. /package/dist/{chunk-RD5LYKD6.js.map → chunk-ZC2AAE6J.js.map} +0 -0
  241. /package/dist/{crypto-A7FRXYHC.js.map → crypto-H2Y3DDFW.js.map} +0 -0
  242. /package/dist/{delegation-YBA4X4JN.js.map → delegation-QSC7G5QC.js.map} +0 -0
  243. /package/dist/{executor-7E3VFGW7.js.map → executor-BZKFZVRC.js.map} +0 -0
  244. /package/dist/{executor-CEWX2FQI.js.map → executor-GFZFDQXV.js.map} +0 -0
  245. /package/dist/{executor-X4SQ3ZLC.js.map → executor-KT2IOZVP.js.map} +0 -0
  246. /package/dist/{fanout-sidecar-VJ52RIEY.js.map → fanout-sidecar-NRBWSLRK.js.map} +0 -0
  247. /package/dist/{ledger-3TXNP47J.js.map → issue-BAJ7ZB4S.js.map} +0 -0
  248. /package/dist/{public-envelope-PY6NKFLI.js.map → ledger-WOEJUYTP.js.map} +0 -0
  249. /package/dist/{registry-3L3N3PTG.js.map → noydb-XNQSKXGO.js.map} +0 -0
  250. /package/dist/{registry-O47PUPSY.js.map → public-envelope-OHQ5UZFM.js.map} +0 -0
  251. /package/dist/{registry-RFGGMVNJ.js.map → registry-2IEARCGT.js.map} +0 -0
  252. /package/dist/{registry-WLLMODKN.js.map → registry-CDHASH73.js.map} +0 -0
  253. /package/dist/{stale-HSC5YO2O.js.map → registry-EMGLZGR6.js.map} +0 -0
@@ -1,8 +1,9 @@
1
1
  import { I as IndexStrategy, d as LazyQuery } from './lazy-builder-Rpd-V3jP.js';
2
2
  import { b as AggregateSpec, A as AggregateStrategy } from './strategy-DSTrsZ8t.js';
3
3
  import { C as CrdtStrategy, a as CrdtMode, b as CrdtState } from './strategy-BSxFXGzb.js';
4
- import { N as NoydbError, Q as Query, ak as RefRegistry, ah as RefDescriptor, _ as JoinableSource, am as RefViolation, an as ScanBuilder } from './index-CNwA-B6-.js';
4
+ import { N as NoydbError, Q as Query, ar as RefRegistry, ao as RefDescriptor, a2 as JoinableSource, at as RefViolation, au as ScanBuilder } from './index-BF1B2HB9.js';
5
5
  import { F as FieldClause, I as IndexDef, C as CollectionIndexes } from './predicate-Dnu81tsS.js';
6
+ import { AttestationFieldSchema, RevocationList } from '@noy-db/attestation';
6
7
 
7
8
  /**
8
9
  * Standard Schema v1 integration.
@@ -794,8 +795,15 @@ interface LedgerEntry {
794
795
  * guards subsystem when an admin/owner uses `withTransactions(...)`
795
796
  * to repair a constraint-violating state. See `amendment` field
796
797
  * below for the structured payload.
798
+ *
799
+ * `'lifecycle'` records a non-data audit event (e.g. partition
800
+ * handover, #226) — `collection`/`id` are empty and the event detail
801
+ * lives in `reason` (e.g. `'partition-handed-over:<sealId>'`). Like
802
+ * `amendment`, it carries no data envelope, so `verifyBackupIntegrity`
803
+ * skips it in the data cross-check (it still participates in the
804
+ * tamper-evident chain).
797
805
  */
798
- readonly op: 'put' | 'delete' | 'amendment';
806
+ readonly op: 'put' | 'delete' | 'amendment' | 'lifecycle' | 'migration';
799
807
  /** The collection the mutation targeted. */
800
808
  readonly collection: string;
801
809
  /** The record id the mutation targeted. */
@@ -2541,6 +2549,220 @@ interface I18nStrategy {
2541
2549
  buildDictionaryHandle<Keys extends string = string>(opts: BuildDictionaryHandleOptions<Keys>): DictionaryHandle<Keys>;
2542
2550
  }
2543
2551
 
2552
+ /**
2553
+ * Observable write-queue (#227, M12 Slice 1).
2554
+ *
2555
+ * Tracks outstanding in-flight *logical* writes (a full Collection.put /
2556
+ * delete, including ledger + cache + derivation + MV dispatch — not just
2557
+ * the adapter call). The hub holds one tracker per instance; it is
2558
+ * framework-agnostic (no Vue/React dependency). UI layers subscribe via
2559
+ * onChange(); the migration drain (Slice 2) quiesces via onFlush().
2560
+ */
2561
+ /** Public, read-only view of the hub's write-queue. */
2562
+ interface WriteQueue {
2563
+ /** True while one or more writes are in flight (`depth > 0`). */
2564
+ readonly pending: boolean;
2565
+ /** Count of outstanding write operations. */
2566
+ readonly depth: number;
2567
+ /**
2568
+ * Subscribe to depth changes (fires on every begin and settle).
2569
+ * Returns an unsubscribe function. Intended for reactive wrappers
2570
+ * (e.g. `@noy-db/in-vue` turns this into a `ref`).
2571
+ */
2572
+ onChange(handler: () => void): () => void;
2573
+ /**
2574
+ * Resolves once `depth` reaches 0. If a write settled with an error
2575
+ * while this flush was waiting, the returned promise REJECTS with that
2576
+ * error instead — so a drain caller surfaces the failure rather than
2577
+ * hanging. Resolves immediately when already idle and error-free.
2578
+ */
2579
+ onFlush(): Promise<void>;
2580
+ }
2581
+ declare class WriteQueueTracker implements WriteQueue {
2582
+ #private;
2583
+ get pending(): boolean;
2584
+ get depth(): number;
2585
+ /** Mark one write as started. */
2586
+ begin(): void;
2587
+ /** Mark one write as finished. Pass the error if it failed. */
2588
+ settle(error?: Error): void;
2589
+ onChange(handler: () => void): () => void;
2590
+ onFlush(): Promise<void>;
2591
+ /**
2592
+ * Run `fn` as a tracked write: depth++ on entry, depth-- on settle
2593
+ * (success or failure). The fn's resolved value is returned; a thrown
2594
+ * error is re-thrown after the queue is decremented.
2595
+ */
2596
+ track<R>(fn: () => Promise<R>): Promise<R>;
2597
+ }
2598
+
2599
+ /**
2600
+ * Hub-level write lifecycle hooks (#230). `onBeforeWrite` may abort (throw);
2601
+ * `onAfterWrite` is awaited and its errors are warned, not thrown. A
2602
+ * re-entrancy flag suppresses nested firing so a handler that writes can't
2603
+ * loop. Held on the Noydb instance, threaded into every Collection.
2604
+ */
2605
+ interface WriteEvent {
2606
+ readonly op: 'create' | 'update' | 'delete';
2607
+ readonly vault: string;
2608
+ readonly collection: string;
2609
+ readonly docId: string;
2610
+ readonly before: unknown;
2611
+ readonly after: unknown;
2612
+ readonly baseVersion: number;
2613
+ readonly version: number;
2614
+ readonly userId: string;
2615
+ readonly timestamp: number;
2616
+ readonly txId: string;
2617
+ }
2618
+ type WriteHook = (event: WriteEvent) => void | Promise<void>;
2619
+ type Unsubscribe$2 = () => void;
2620
+ declare class WriteHookRegistry {
2621
+ #private;
2622
+ /** True while handlers are running — used by the write path to skip nested firing. */
2623
+ get suppressed(): boolean;
2624
+ /** True when any hook is registered (cheap gate for the write path). */
2625
+ get hasHandlers(): boolean;
2626
+ onBeforeWrite(handler: WriteHook): Unsubscribe$2;
2627
+ onAfterWrite(handler: WriteHook): Unsubscribe$2;
2628
+ /** Run before-hooks (awaited, in order). A throw propagates and aborts the write. */
2629
+ runBefore(event: WriteEvent): Promise<void>;
2630
+ /** Run after-hooks (awaited, in order). Per-handler errors are warned, not thrown. */
2631
+ runAfter(event: WriteEvent): Promise<void>;
2632
+ }
2633
+
2634
+ /**
2635
+ * Schema-update strategy framework types (#245, M12 §3a).
2636
+ *
2637
+ * The hub core detects a schema change (SchemaDelta) and dispatches it
2638
+ * through a collection's ordered strategy list. Strategies decide what
2639
+ * happens; the core only knows this interface.
2640
+ */
2641
+ /** A single changed top-level property in a schema delta. */
2642
+ interface FieldChange {
2643
+ readonly field: string;
2644
+ /** True when the field's required-ness flipped. */
2645
+ readonly requiredChanged: boolean;
2646
+ /** True when the field's subschema shape changed. */
2647
+ readonly shapeChanged: boolean;
2648
+ }
2649
+ /** The classified difference between a stored and a freshly-derived schema. */
2650
+ interface SchemaDelta {
2651
+ readonly collection: string;
2652
+ readonly kind: 'none' | 'additive' | 'non-additive';
2653
+ /** Top-level properties present in the new schema but not the old. */
2654
+ readonly added: readonly string[];
2655
+ /** Top-level properties present in the old schema but not the new. */
2656
+ readonly removed: readonly string[];
2657
+ /** Top-level properties present in both but altered. */
2658
+ readonly changed: readonly FieldChange[];
2659
+ }
2660
+ /** Context handed to a strategy alongside the delta. */
2661
+ interface UpdateContext {
2662
+ readonly collection: string;
2663
+ }
2664
+ /** Bulk transform run by the coordinatedCutover strategy (#232). */
2665
+ type TransformFn = (doc: Record<string, unknown>) => Record<string, unknown>;
2666
+ /**
2667
+ * A strategy's verdict on a detected schema change.
2668
+ * - `allow` — no objection; the dispatcher falls through to the next strategy.
2669
+ * - `reject` — terminal: refuse the change; `error` is thrown at the write path.
2670
+ * - `cutover` — terminal: run a coordinated drain-barrier (handled by #232).
2671
+ * New terminal actions may be added without breaking existing strategies.
2672
+ */
2673
+ type UpdateDecision = {
2674
+ readonly action: 'allow';
2675
+ } | {
2676
+ readonly action: 'reject';
2677
+ readonly error: Error;
2678
+ } | {
2679
+ readonly action: 'cutover';
2680
+ readonly transform: TransformFn;
2681
+ };
2682
+ /** A pluggable schema-evolution policy. */
2683
+ interface SchemaUpdateStrategy {
2684
+ readonly name: string;
2685
+ onSchemaDelta(delta: SchemaDelta, ctx: UpdateContext): UpdateDecision | Promise<UpdateDecision>;
2686
+ }
2687
+
2688
+ /**
2689
+ * Per-collection write gate (#245). Holds the (async) update decision
2690
+ * computed at registration; `Collection.put`/`delete` await it before
2691
+ * writing and throw the strategy's rejection error.
2692
+ *
2693
+ * Detection FAILURE (the promise rejecting) is deliberately NOT a write
2694
+ * block — schema detection is a fingerprint safety net, not a correctness
2695
+ * invariant (matches how persisted-schema write failures are swallowed).
2696
+ * Only an explicit `reject` decision blocks writes.
2697
+ */
2698
+
2699
+ declare class SchemaUpdateGate {
2700
+ #private;
2701
+ constructor(decision: Promise<UpdateDecision>);
2702
+ assertWritable(): Promise<void>;
2703
+ }
2704
+
2705
+ /**
2706
+ * Schema-fence document (#232). Vault-level generation counter + drain
2707
+ * state, stored at `_meta/schema-fence` using the plaintext-envelope
2708
+ * pattern of `_meta/policy` (no PII — a counter + a state enum).
2709
+ */
2710
+
2711
+ type FenceState = 'normal' | 'draining' | 'migrating' | 'complete';
2712
+ interface FenceDoc {
2713
+ readonly currentSchemaVersion: number;
2714
+ readonly fenceState: FenceState;
2715
+ }
2716
+
2717
+ /**
2718
+ * Vault-level schema-fence controller (#232).
2719
+ *
2720
+ * Owns the open-time generation snapshot, the pending-cutover registry,
2721
+ * and the cutover orchestration. 3a: single-client (the caller is the
2722
+ * migrator). 3b: a cooperative ack-barrier — after `draining`, the
2723
+ * migrator waits for the active client set (registry heartbeats) to ack
2724
+ * the draining generation before transforming. No leader election.
2725
+ */
2726
+
2727
+ /** Runs one collection's transform; supplied by the Vault (binds to a Collection). */
2728
+ type RunTransform = (collection: string, transform: TransformFn) => Promise<void>;
2729
+ declare class SchemaFenceController {
2730
+ #private;
2731
+ constructor(opts: {
2732
+ store: NoydbStore;
2733
+ vault: string;
2734
+ onFlush: () => Promise<void>;
2735
+ clientId?: string;
2736
+ now?: () => number;
2737
+ staleMs?: number;
2738
+ quiesceTimeoutMs?: number;
2739
+ emit?: (e: {
2740
+ currentSchemaVersion: number;
2741
+ fenceState: FenceState;
2742
+ }) => void;
2743
+ });
2744
+ /** Capture the generation snapshot at vault-open. */
2745
+ init(): Promise<void>;
2746
+ /** Record a per-collection pending cutover (from a registration `cutover` decision). */
2747
+ registerPendingCutover(collection: string, transform: TransformFn): void;
2748
+ /** Write-path gate. Throws when behind, fenced, or this collection is cutover-pending. */
2749
+ assertWritable(collection: string): Promise<void>;
2750
+ /**
2751
+ * Admin trigger. Drain → wait for the active set to quiesce (or time out)
2752
+ * → migrate each pending transform → bump → complete → normal. The
2753
+ * migrator excludes itself from the barrier (it drained synchronously
2754
+ * here). `onPoll` (tests) advances other clients between barrier checks;
2755
+ * production falls back to a short real delay.
2756
+ */
2757
+ runCutover(run: RunTransform, opts?: {
2758
+ onPoll?: () => Promise<void>;
2759
+ }): Promise<{
2760
+ migrated: number;
2761
+ }>;
2762
+ /** Recover a stuck drain: reset fenceState to normal at the current version (no bump). */
2763
+ abort(): Promise<void>;
2764
+ }
2765
+
2544
2766
  /**
2545
2767
  * Zero-dependency JSON diff.
2546
2768
  * Produces a flat list of changes between two plain objects.
@@ -3919,6 +4141,63 @@ declare function validatePublicEnvelopeInput(input: SetPublicEnvelopeInput, sche
3919
4141
  */
3920
4142
  declare function isPublicEnvelope(x: unknown): x is PublicEnvelope;
3921
4143
 
4144
+ /**
4145
+ * Multi-tab coordination (#228a): primary/secondary election (Web Locks)
4146
+ * + presence heartbeat (BroadcastChannel). Browser-only; opt-in; no-op
4147
+ * when the APIs are absent. The lock/channel interfaces are hub-local
4148
+ * (structurally compatible with @noy-db/by-peer + @noy-db/by-tabs, but
4149
+ * not imported — those packages depend on hub).
4150
+ */
4151
+ type TabRole = 'primary' | 'secondary' | 'unknown';
4152
+ interface TabPresence {
4153
+ readonly tabId: string;
4154
+ readonly lastSeen: number;
4155
+ readonly role: TabRole;
4156
+ }
4157
+ type Unsubscribe$1 = () => void;
4158
+ /** Structural subset of the Web Locks API / by-peer's MinimalLockManager. */
4159
+ interface TabLockManager {
4160
+ request<T>(name: string, options: {
4161
+ mode?: 'exclusive' | 'shared';
4162
+ signal?: AbortSignal;
4163
+ }, callback: (lock: unknown) => Promise<T>): Promise<T>;
4164
+ }
4165
+ /** Structural subset of by-peer's PeerChannel / a BroadcastChannel wrapper. */
4166
+ interface TabChannel {
4167
+ send(payload: string): void;
4168
+ on(event: 'message', listener: (payload: string) => void): Unsubscribe$1;
4169
+ on(event: 'close', listener: () => void): Unsubscribe$1;
4170
+ close(): void;
4171
+ readonly isOpen: boolean;
4172
+ }
4173
+ interface TabCoordinationOptions {
4174
+ readonly lockManager?: TabLockManager;
4175
+ readonly channel?: TabChannel;
4176
+ readonly tabId?: string;
4177
+ readonly lockName?: string;
4178
+ readonly heartbeatMs?: number;
4179
+ readonly staleMs?: number;
4180
+ readonly now?: () => number;
4181
+ /**
4182
+ * Close the channel on `dispose()`. Set this only for a channel the
4183
+ * coordinator owns (e.g. the one `defaultChannel()` created); leave it
4184
+ * false for a caller-injected channel so the coordinator never closes a
4185
+ * channel it didn't create. Default: false.
4186
+ */
4187
+ readonly closeChannelOnDispose?: boolean;
4188
+ /**
4189
+ * Also propagate committed writes to other tabs (#228b). Default true:
4190
+ * when tab coordination is enabled and a channel is available, a write in
4191
+ * one tab refreshes that document in every other tab. Set false to opt out.
4192
+ */
4193
+ readonly propagateWrites?: boolean;
4194
+ /**
4195
+ * Channel for write propagation (#228b) — distinct from the presence
4196
+ * channel. Default: an inline BroadcastChannel on `noydb:tab-writes`.
4197
+ */
4198
+ readonly writeChannel?: TabChannel;
4199
+ }
4200
+
3922
4201
  /**
3923
4202
  * Per-vault tier-3 (PIN / quick-resume) state — issue #11.
3924
4203
  *
@@ -4068,6 +4347,8 @@ interface AmendmentTxOptions {
4068
4347
  * facade; its `put`/`delete`/`get` calls stage ops against the tx.
4069
4348
  */
4070
4349
  declare class TxContext {
4350
+ /** Stable id for this transaction; shared by all writes it performs (#230). */
4351
+ readonly txId: string;
4071
4352
  /** @internal */
4072
4353
  readonly _ops: StagedOp[];
4073
4354
  /**
@@ -4152,6 +4433,34 @@ declare class TxCollection<T> {
4152
4433
  */
4153
4434
  declare function runTransaction<T>(db: Noydb, fn: (tx: TxContext) => Promise<T> | T, options?: AmendmentTxOptions): Promise<T>;
4154
4435
 
4436
+ /**
4437
+ * Dry-run transactions (#231). Runs the tx body to STAGE ops, then builds
4438
+ * the directly-affected diff (before = current committed via collection.get,
4439
+ * after = staged record) and collects guard violations — without executing
4440
+ * phase 2. No adapter writes, no write-hooks, no commit. MV/derivation
4441
+ * cascade is NOT simulated (v2). Mirrors the guard loop in
4442
+ * `Collection.putInternal` — keep the two in sync.
4443
+ */
4444
+
4445
+ interface AffectedDocument {
4446
+ readonly vault: string;
4447
+ readonly op: 'create' | 'update' | 'delete';
4448
+ readonly collection: string;
4449
+ readonly docId: string;
4450
+ readonly before: unknown;
4451
+ readonly after: unknown;
4452
+ }
4453
+ interface GuardViolation {
4454
+ readonly vault: string;
4455
+ readonly collection: string;
4456
+ readonly docId: string;
4457
+ readonly message: string;
4458
+ }
4459
+ interface DryRunResult {
4460
+ readonly affected: ReadonlyArray<AffectedDocument>;
4461
+ readonly guardViolations: ReadonlyArray<GuardViolation>;
4462
+ }
4463
+
4155
4464
  /**
4156
4465
  * Policy gate DSL types — issue #9.
4157
4466
  *
@@ -4320,8 +4629,12 @@ type ActiveTier = 1 | 2 | 3;
4320
4629
 
4321
4630
  /** The top-level NOYDB instance. */
4322
4631
  declare class Noydb {
4632
+ #private;
4323
4633
  private readonly options;
4324
4634
  private readonly emitter;
4635
+ private readonly writeQueueTracker;
4636
+ private readonly writeHooks;
4637
+ private readonly clientId;
4325
4638
  private readonly vaultCache;
4326
4639
  private readonly keyringCache;
4327
4640
  private readonly syncEngines;
@@ -4354,6 +4667,10 @@ declare class Noydb {
4354
4667
  private readonly publicEnvelopeSchema;
4355
4668
  private closed;
4356
4669
  private sessionTimer;
4670
+ /** Same-device multi-tab coordinator (#228); created on `enableTabCoordination()`. */
4671
+ private tabCoordinator;
4672
+ /** Cross-tab write relay (#228b); created on `enableTabCoordination()`. */
4673
+ private writeRelay;
4357
4674
  /** Per-vault policy enforcers. */
4358
4675
  private readonly policyEnforcers;
4359
4676
  private readonly txStrategy;
@@ -4657,6 +4974,15 @@ declare class Noydb {
4657
4974
  * to the vault's ledger as `op: 'amendment'`.
4658
4975
  */
4659
4976
  transaction<T>(options: AmendmentTxOptions, fn: (tx: TxContext) => Promise<T> | T): Promise<T>;
4977
+ /**
4978
+ * Dry-run a transaction (#231): run the body to stage ops, then return
4979
+ * the directly-affected diff + collected guard violations WITHOUT
4980
+ * committing (no adapter writes, no write hooks). MV/derivation cascade
4981
+ * is not simulated. Requires `withTransactions()`.
4982
+ */
4983
+ transaction(options: {
4984
+ readonly dryRun: true;
4985
+ }, fn: (tx: TxContext) => unknown): Promise<DryRunResult>;
4660
4986
  /**
4661
4987
  * Create a sync transaction for the given vault.
4662
4988
  * The vault must already be open via `openVault()`.
@@ -4721,6 +5047,52 @@ declare class Noydb {
4721
5047
  private getSyncEngine;
4722
5048
  on<K extends keyof NoydbEventMap>(event: K, handler: (data: NoydbEventMap[K]) => void): void;
4723
5049
  off<K extends keyof NoydbEventMap>(event: K, handler: (data: NoydbEventMap[K]) => void): void;
5050
+ /**
5051
+ * Observable write-queue for this hub instance. Reflects outstanding
5052
+ * in-flight writes across all collections. See {@link WriteQueue}.
5053
+ *
5054
+ * @example
5055
+ * window.addEventListener('beforeunload', (e) => {
5056
+ * if (db.writeQueue.pending) { e.preventDefault(); e.returnValue = '' }
5057
+ * })
5058
+ */
5059
+ get writeQueue(): WriteQueue;
5060
+ /**
5061
+ * @internal Mutable tracker behind {@link writeQueue}. Threaded into
5062
+ * each Collection (via Vault) so `put`/`delete` can `track()` writes.
5063
+ * Not part of the public surface — consumers use `writeQueue`.
5064
+ */
5065
+ get _writeQueueTracker(): WriteQueueTracker;
5066
+ /**
5067
+ * Register a hook that runs before each write (#230). Awaited; a throw
5068
+ * aborts the write. Returns an unsubscribe function.
5069
+ */
5070
+ onBeforeWrite(handler: WriteHook): Unsubscribe$2;
5071
+ /**
5072
+ * Register a hook that runs after each committed write (#230). Awaited;
5073
+ * a handler error is warned, never rolled back. Returns an unsubscribe fn.
5074
+ */
5075
+ onAfterWrite(handler: WriteHook): Unsubscribe$2;
5076
+ /** Subscribe to cross-tab write conflicts (#228c). Returns an unsubscribe. */
5077
+ onWriteConflict(fn: (c: WriteConflict) => void): Unsubscribe$2;
5078
+ /**
5079
+ * Enable same-device multi-tab coordination (#228): primary/secondary
5080
+ * election + presence. Browser-only — a graceful no-op (role 'unknown')
5081
+ * when Web Locks / BroadcastChannel are unavailable and nothing is
5082
+ * injected. Idempotent; returns a disposer.
5083
+ */
5084
+ enableTabCoordination(opts?: TabCoordinationOptions): {
5085
+ dispose: () => void;
5086
+ };
5087
+ private disableTabCoordination;
5088
+ get tabRole(): TabRole;
5089
+ activeTabs(): TabPresence[];
5090
+ onTabRoleChange(fn: (r: TabRole) => void): Unsubscribe$2;
5091
+ onActiveTabsChange(fn: (t: TabPresence[]) => void): Unsubscribe$2;
5092
+ /** @internal The write-hook registry, threaded into each Collection. */
5093
+ get _writeHooks(): WriteHookRegistry;
5094
+ /** @internal Stable per-instance id for schema-cutover coordination (#232). */
5095
+ get _clientId(): string;
4724
5096
  /**
4725
5097
  * Soft-lock a single vault: clear its in-memory keyring, DEKs, vault
4726
5098
  * instance, sync engine, policy enforcer, and active-tier entry —
@@ -6070,6 +6442,11 @@ declare class GuardRegistry {
6070
6442
  register<T extends Record<string, unknown>>(spec: GuardStrategy<T>): void;
6071
6443
  /** All guards registered against `collection` in registration order. */
6072
6444
  guardsFor(collection: string): ReadonlyArray<AnyGuard>;
6445
+ /** Per-collection guard counts, for introspection (#229). */
6446
+ summary(): {
6447
+ collection: string;
6448
+ count: number;
6449
+ }[];
6073
6450
  /**
6074
6451
  * Run every guard's `check` for this collection. First throw wins —
6075
6452
  * remaining guards are not invoked. Guards without a `check` skip.
@@ -6813,6 +7190,29 @@ interface PersistedSchemaEnvelope {
6813
7190
  * @module
6814
7191
  */
6815
7192
 
7193
+ /** Flat snapshot of a vault's registered schema (#229). */
7194
+ interface SchemaIntrospection {
7195
+ readonly collections: ReadonlyArray<{
7196
+ name: string;
7197
+ docCount: number;
7198
+ }>;
7199
+ readonly guards: ReadonlyArray<{
7200
+ collection: string;
7201
+ count: number;
7202
+ }>;
7203
+ readonly materializedViews: ReadonlyArray<{
7204
+ name: string;
7205
+ sourceCollections: string[];
7206
+ }>;
7207
+ readonly schemaUpdate: ReadonlyArray<{
7208
+ collection: string;
7209
+ strategies: string[];
7210
+ }>;
7211
+ readonly grants: ReadonlyArray<{
7212
+ collection: string;
7213
+ permission: Permission;
7214
+ }>;
7215
+ }
6816
7216
  /** Where the field-level info in the snapshot came from. */
6817
7217
  type FieldSource = 'persisted' | 'live-validator' | 'sampled' | 'unknown';
6818
7218
  interface FieldDescriptor {
@@ -6921,6 +7321,7 @@ interface VaultIntrospectState {
6921
7321
 
6922
7322
  /** A vault (tenant namespace) containing collections. */
6923
7323
  declare class Vault {
7324
+ #private;
6924
7325
  private readonly adapter;
6925
7326
  /** The vault's name as passed to `openVault()`. Stable for the instance lifetime. */
6926
7327
  readonly name: string;
@@ -7023,12 +7424,20 @@ declare class Vault {
7023
7424
  */
7024
7425
  private readonly reloadKeyring;
7025
7426
  private readonly collectionCache;
7427
+ /** #232 — vault-level schema cutover fence/controller. */
7428
+ readonly schemaFence: SchemaFenceController;
7026
7429
  /**
7027
7430
  * per-collection `blobFields` retention/TTL config.
7028
7431
  * Populated on `collection({ blobFields })` and read by
7029
7432
  * `vault.compact()`. Indexed by collection name.
7030
7433
  */
7031
7434
  private readonly blobFieldsRegistry;
7435
+ /**
7436
+ * Per-collection attestation field-schema (issue side). Populated on
7437
+ * `collection({ attestation })` and read by `issueAttestation()`.
7438
+ * Indexed by collection name.
7439
+ */
7440
+ private readonly attestationRegistry;
7032
7441
  /**
7033
7442
  * Per-vault ledger store. Lazy-initialized on first
7034
7443
  * `collection()` call (which passes it through to the Collection)
@@ -7249,6 +7658,15 @@ declare class Vault {
7249
7658
  * @see docs/superpowers/specs/2026-05-22-schema-dump-design.md
7250
7659
  */
7251
7660
  persistJsonSchema?: boolean;
7661
+ /**
7662
+ * Ordered schema-update strategies (#245). On a detected schema
7663
+ * change, evaluated in order; the first non-`allow` decision wins.
7664
+ * A `reject` is enforced at the write path (`put`/`delete` throw).
7665
+ * Requires `persistJsonSchema: true` (detection needs the baseline).
7666
+ */
7667
+ schemaUpdate?: readonly SchemaUpdateStrategy[];
7668
+ /** — declare the per-field schema for document attestation (issue side). */
7669
+ attestation?: AttestationFieldSchema;
7252
7670
  }): Collection<T>;
7253
7671
  /**
7254
7672
  * Await all background persisted-schema writes triggered by
@@ -7256,6 +7674,45 @@ declare class Vault {
7256
7674
  * Used in tests; production code does not need to call this.
7257
7675
  */
7258
7676
  _drainPendingSchemaWrites(): Promise<void>;
7677
+ /**
7678
+ * Run a coordinated schema cutover (#232). Drains pending writes, waits
7679
+ * for the active client set to quiesce (the ack-barrier), applies every
7680
+ * pending collection transform in bulk, bumps the vault schema generation,
7681
+ * and clears the fence. Returns the count of collections migrated.
7682
+ * `opts.onPoll` (tests) advances other clients between barrier checks.
7683
+ */
7684
+ runSchemaCutover(opts?: {
7685
+ onPoll?: () => Promise<void>;
7686
+ }): Promise<{
7687
+ migrated: number;
7688
+ }>;
7689
+ /**
7690
+ * #228b — refresh a loaded collection's view of one document from a peer
7691
+ * tab's broadcast. No-op when the collection isn't loaded in this tab
7692
+ * (it will read fresh on next open). Mirrors #runCutoverTransform's guard.
7693
+ */
7694
+ _applyRemoteWrite(collectionName: string, docId: string, action: 'put' | 'delete'): Promise<void>;
7695
+ /**
7696
+ * #228c — for a detected conflict: capture this tab's clobbered record,
7697
+ * read the common ancestor from history, converge the cache to the store's
7698
+ * authoritative value (the (b) re-read), and return all three for the
7699
+ * WriteConflict payload. Returns null when the collection isn't loaded.
7700
+ */
7701
+ _captureAndConverge(collectionName: string, docId: string, action: 'put' | 'delete', baseV: number): Promise<{
7702
+ local: unknown;
7703
+ remote: unknown;
7704
+ base: unknown;
7705
+ } | null>;
7706
+ /** Recover a stuck cutover fence (#232) — reset to normal without bumping. */
7707
+ abortSchemaCutover(): Promise<void>;
7708
+ /** Current schema-cutover fence state for this vault (#232/#233). Thin live read. */
7709
+ schemaFenceState(): Promise<FenceDoc>;
7710
+ /** @internal Start the per-client heartbeat + fence watcher once a cutover is registered (#232). */
7711
+ _ensureFenceCoordination(): void;
7712
+ /** @internal Stop the heartbeat/watcher (vault lock/close). */
7713
+ _stopFenceCoordination(): void;
7714
+ /** @internal Drive one heartbeat + watch cycle deterministically (tests). */
7715
+ _fenceTick(): Promise<void>;
7259
7716
  /**
7260
7717
  * Validate i18nText fields on a `put()`. Called by Collection just
7261
7718
  * before the adapter write, after schema validation. Throws
@@ -7431,6 +7888,22 @@ declare class Vault {
7431
7888
  */
7432
7889
  compact(options?: CompactRunOptions): Promise<CompactionResult>;
7433
7890
  exportBlobs(options?: ExportBlobsOptions): ExportBlobsHandle;
7891
+ issueAttestation(collectionName: string, id: string): Promise<{
7892
+ docId: string;
7893
+ qr: string;
7894
+ keyId: string;
7895
+ publicKeyB64: string;
7896
+ }>;
7897
+ getDocumentSigningPublicKey(): Promise<{
7898
+ keyId: string;
7899
+ publicKeyB64: string;
7900
+ }>;
7901
+ private makeIssueContext;
7902
+ revokeAttestation(docId: string): Promise<void>;
7903
+ unrevokeAttestation(docId: string): Promise<void>;
7904
+ getRevokedDocIds(): Promise<string[]>;
7905
+ publishRevocationList(): Promise<RevocationList>;
7906
+ private makeRevokeContext;
7434
7907
  private writeExportAudit;
7435
7908
  /**
7436
7909
  * Read-only accessor for the invoking keyring's export capability,
@@ -7886,6 +8359,14 @@ declare class Vault {
7886
8359
  * @see docs/superpowers/specs/2026-05-22-schema-dump-design.md
7887
8360
  */
7888
8361
  dumpSchema(opts?: DumpSchemaOptions): Promise<VaultSchemaSnapshot>;
8362
+ /**
8363
+ * Lightweight read of the vault's registered schema (#229): collections
8364
+ * (+ doc counts), guards, materialized views, schema-update strategies,
8365
+ * and the unlocked user's grants. Cheap — one `adapter.list` per
8366
+ * collection, no decryption. For a full snapshot + stats use dumpSchema().
8367
+ * Post-unlock by construction (a Vault only exists with an unlocked keyring).
8368
+ */
8369
+ introspect(): Promise<SchemaIntrospection>;
7889
8370
  /**
7890
8371
  * Internal accessor for {@link dumpVaultSchema}. Exposes the structural
7891
8372
  * state the walker needs (collection cache, registries, ref registry,
@@ -8362,12 +8843,18 @@ interface CacheStats extends LruStats {
8362
8843
  }
8363
8844
  /** A typed collection of records within a vault. */
8364
8845
  declare class Collection<T> {
8846
+ #private;
8365
8847
  private readonly adapter;
8366
8848
  private readonly vault;
8367
8849
  private readonly name;
8368
8850
  private readonly keyring;
8369
8851
  private readonly encrypted;
8370
8852
  private readonly emitter;
8853
+ private readonly writeQueue;
8854
+ private readonly schemaUpdateGate;
8855
+ private readonly schemaFence;
8856
+ private readonly writeHooks;
8857
+ private readonly activeTxId;
8371
8858
  private readonly getDEK;
8372
8859
  private readonly onDirty;
8373
8860
  private readonly historyConfig;
@@ -8635,6 +9122,21 @@ declare class Collection<T> {
8635
9122
  keyring: UnlockedKeyring;
8636
9123
  encrypted: boolean;
8637
9124
  emitter: NoydbEventEmitter;
9125
+ /**
9126
+ * Vault-level in-flight write tracker (#227). When present,
9127
+ * `put`/`delete` run inside `writeQueue.track()` so `hub.writeQueue`
9128
+ * reflects outstanding writes. Optional so direct Collection
9129
+ * construction in tests still works untracked.
9130
+ */
9131
+ writeQueue?: WriteQueueTracker | undefined;
9132
+ /** #245 — per-collection schema-update gate; `put`/`delete` await it. */
9133
+ schemaUpdateGate?: SchemaUpdateGate | undefined;
9134
+ /** #232 — vault-level fence controller; `put`/`delete` consult it. */
9135
+ schemaFence?: SchemaFenceController | undefined;
9136
+ /** #230 — hub-level write-hook registry; fired around put/delete. */
9137
+ writeHooks?: WriteHookRegistry | undefined;
9138
+ /** #230 — active transaction id supplier (null outside a transaction). */
9139
+ activeTxId?: (() => string | null) | undefined;
8638
9140
  getDEK: (collectionName: string) => Promise<CryptoKey>;
8639
9141
  historyConfig?: HistoryConfig | undefined;
8640
9142
  onDirty?: OnDirtyCallback | undefined;
@@ -8950,7 +9452,8 @@ declare class Collection<T> {
8950
9452
  pollIntervalMs?: number;
8951
9453
  }): PresenceHandle<P>;
8952
9454
  /**
8953
- * Create or update a record.
9455
+ * Create or update a record. Runs inside the hub's write-queue tracker
9456
+ * (#227) so `hub.writeQueue.pending` reflects this write.
8954
9457
  *
8955
9458
  * @param id Record identifier.
8956
9459
  * @param record The record body (validated by the collection's schema
@@ -8963,6 +9466,8 @@ declare class Collection<T> {
8963
9466
  put(id: string, record: T, options?: {
8964
9467
  readonly reason?: string;
8965
9468
  }): Promise<void>;
9469
+ /** @internal Untracked put body — call {@link put}, not this. */
9470
+ private putInternal;
8966
9471
  /**
8967
9472
  * Fire registered MV strategies whose dependency set includes this
8968
9473
  * collection. Eager-mode MVs re-materialize inline via
@@ -8988,8 +9493,20 @@ declare class Collection<T> {
8988
9493
  * cycle detection.
8989
9494
  */
8990
9495
  private dispatchDerivations;
8991
- /** Delete a record by ID. */
9496
+ /**
9497
+ * Delete a record by ID. Runs inside the hub's write-queue tracker
9498
+ * (#227) so `hub.writeQueue.pending` reflects this write.
9499
+ */
8992
9500
  delete(id: string): Promise<void>;
9501
+ /**
9502
+ * @internal #232 — bulk-rewrite every record through a cutover transform.
9503
+ * Raw adapter path (bypasses the write gate + guards — the transform is
9504
+ * trusted and runs only during the `migrating` phase). Bumps each
9505
+ * record's `_v` and appends a ledger `op:'migration'` entry.
9506
+ */
9507
+ _applyCutoverTransform(transform: (doc: Record<string, unknown>) => Record<string, unknown>): Promise<number>;
9508
+ /** @internal Untracked delete body — call {@link delete}, not this. */
9509
+ private deleteInternal;
8993
9510
  /**
8994
9511
  * @internal — system-internal delete that bypasses user-facing
8995
9512
  * delete hooks (`onDelete`, accounting-period guard, FK ref
@@ -9326,6 +9843,15 @@ declare class Collection<T> {
9326
9843
  * gone before the tx and the revert deleted it again).
9327
9844
  */
9328
9845
  _invalidateCacheEntry(id: string): Promise<void>;
9846
+ /**
9847
+ * #228b — apply a peer tab's committed write to THIS tab's in-memory view:
9848
+ * re-read the (already-persisted) envelope from the shared store + refresh
9849
+ * cache/indexes, then emit a `change` event so reactive consumers re-render.
9850
+ * Never writes to the store and never fires write hooks, so it cannot loop.
9851
+ */
9852
+ _applyRemoteChange(id: string, action: 'put' | 'delete'): Promise<void>;
9853
+ /** @internal #228c — the current in-memory record without a store read (for conflict capture). */
9854
+ _peekCached(id: string): T | null;
9329
9855
  private ensureHydrated;
9330
9856
  /** Hydrate from a pre-loaded snapshot (used by Vault). */
9331
9857
  hydrateFromSnapshot(records: Record<string, EncryptedEnvelope>): Promise<void>;
@@ -9751,6 +10277,7 @@ interface ShadowStrategy {
9751
10277
  */
9752
10278
  interface TxStrategy {
9753
10279
  runTransaction<T>(db: Noydb, fn: (tx: TxContext) => Promise<T> | T, options?: AmendmentTxOptions): Promise<T>;
10280
+ runDryRun(db: Noydb, fn: (tx: TxContext) => unknown): Promise<DryRunResult>;
9754
10281
  }
9755
10282
 
9756
10283
  /**
@@ -9897,6 +10424,18 @@ interface SessionStrategy {
9897
10424
  * - {@link MemorySealingKeyProvider} — in-memory test provider; uses
9898
10425
  * a deterministic per-instance "key" so two providers with
9899
10426
  * different ids cannot unseal each other's outputs.
10427
+ * - {@link RecipientHint} — public material a sender uses to seal
10428
+ * plaintext for a specific recipient; published by
10429
+ * {@link RecipientSealer.publishRecipientHint} and transported
10430
+ * out-of-band to the sender before bundle writes.
10431
+ * - {@link RecipientSealer} — interface for asymmetric/granted
10432
+ * providers that support recipient-target sealing (RSA-OAEP,
10433
+ * cloud-KMS asymmetric, etc.); distinct from self-only
10434
+ * {@link SealingKeyProvider} (macOS Keychain, WebAuthn-PRF).
10435
+ * - {@link MemoryRecipientSealer} — in-process reference
10436
+ * implementation of both `RecipientSealer` and
10437
+ * `SealingKeyProvider` using real WebCrypto RSA-OAEP + AES-GCM;
10438
+ * safe for tests and same-process sender/recipient scenarios.
9900
10439
  * - {@link loadSealedPassphrase} / {@link saveSealedPassphrase} —
9901
10440
  * plaintext envelope storage at `_meta/sealed-passphrase`.
9902
10441
  * Mirrors the `_meta/handle` and `_meta/public-envelope` AES-
@@ -9977,6 +10516,78 @@ declare class MemorySealingKeyProvider implements SealingKeyProvider {
9977
10516
  seal(passphrase: Uint8Array): Promise<Uint8Array>;
9978
10517
  unseal(sealed: Uint8Array): Promise<Uint8Array>;
9979
10518
  }
10519
+ /**
10520
+ * Public material a sender uses to seal-for-this-recipient. Published by
10521
+ * a recipient's RecipientSealer; transported to the sender out-of-band
10522
+ * (email, S3, in-app message). The sender obtains the hint, supplies it
10523
+ * to writeNoydbBundle's sealedCredentials.perUser[userId].hint, and the
10524
+ * hub seals each user's credential against it. Per foundation §11.4.
10525
+ */
10526
+ type RecipientHint = {
10527
+ readonly v: 1;
10528
+ /** Recipient's provider id; matches the SealedAutoUnlockEntry.pid they'll unseal under. */
10529
+ readonly pid: string;
10530
+ /** Algorithm the sender uses to produce the seal. Slice 1 ships RSA-OAEP-SHA256 only. */
10531
+ readonly alg: 'rsa-oaep-sha256';
10532
+ /** Public material — alg-specific. For 'rsa-oaep-sha256': { publicKeyPem: string }. */
10533
+ readonly material: Readonly<Record<string, unknown>>;
10534
+ };
10535
+ /**
10536
+ * Handover-capable provider. Implemented additionally by asymmetric/granted
10537
+ * providers (cloud-KMS asymmetric, Azure RSA Key Vault, AWS KMS with grant).
10538
+ * Self-only providers (macOS Keychain, env-var, WebAuthn-PRF) do NOT
10539
+ * implement this — the §11.2 capability matrix lives in the type system.
10540
+ *
10541
+ * Per foundation §11.4. A function that requires recipient-target sealing
10542
+ * takes `RecipientSealer`, not `SealingKeyProvider` — the compiler rejects
10543
+ * passing a self-only provider at the spec site.
10544
+ */
10545
+ interface RecipientSealer {
10546
+ readonly id: string;
10547
+ /** Produce hint material a sender uses to seal-for-this-recipient. */
10548
+ publishRecipientHint(): Promise<RecipientHint>;
10549
+ /**
10550
+ * Seal plaintext for the recipient described by `hint`. Returns opaque
10551
+ * bytes — same contract as `SealingKeyProvider.seal()`. The bundle
10552
+ * layer base64-encodes the bytes into `SealedAutoUnlockEntry.sealed`
10553
+ * without inspecting them.
10554
+ */
10555
+ sealForRecipient(plaintext: Uint8Array, hint: RecipientHint): Promise<Uint8Array>;
10556
+ }
10557
+ /**
10558
+ * Reference implementation of `RecipientSealer` + `SealingKeyProvider`.
10559
+ * Uses WebCrypto RSA-OAEP-SHA256 (2048-bit) to wrap a fresh 32-byte
10560
+ * AES-GCM CEK, AES-GCM-encrypts plaintext under it, and packs the
10561
+ * result into a self-describing TLV:
10562
+ *
10563
+ * byte 0 : version (0x01)
10564
+ * bytes 1..256 : RSA-OAEP-wrapped CEK (fixed 256 bytes at RSA-2048)
10565
+ * bytes 257..268: AES-GCM IV (12 bytes)
10566
+ * bytes 269.. : AES-GCM ciphertext ‖ 16-byte tag
10567
+ *
10568
+ * Implements BOTH interfaces. `seal(plaintext)` (self-target) is just
10569
+ * `sealForRecipient(plaintext, this own hint)` — same TLV. Convenient
10570
+ * for tests where one provider plays both ends. Real cloud providers
10571
+ * (`at-aws-kms`, etc.) will pick their own internal layouts; the only
10572
+ * contract is round-trip identity.
10573
+ *
10574
+ * SAFE for production within its scope — the cryptography is real
10575
+ * (RSA-OAEP + AES-GCM via WebCrypto), but the keypair lives in-process
10576
+ * and is regenerated on every construction. Not suitable as a managed
10577
+ * keychain; use it for tests and for shipping bundles where the
10578
+ * recipient instance lives in the same process as the sender (rare).
10579
+ */
10580
+ declare class MemoryRecipientSealer implements SealingKeyProvider, RecipientSealer {
10581
+ readonly id: string;
10582
+ private readonly keypair;
10583
+ constructor(opts: {
10584
+ id: string;
10585
+ });
10586
+ publishRecipientHint(): Promise<RecipientHint>;
10587
+ sealForRecipient(plaintext: Uint8Array, hint: RecipientHint): Promise<Uint8Array>;
10588
+ seal(plaintext: Uint8Array): Promise<Uint8Array>;
10589
+ unseal(bytes: Uint8Array): Promise<Uint8Array>;
10590
+ }
9980
10591
  /** Reserved id for the managed-passphrase envelope under `_meta`. */
9981
10592
  declare const SEALED_PASSPHRASE_RECORD_ID: "sealed-passphrase";
9982
10593
  /** Plaintext payload stored inside the `_meta/sealed-passphrase` envelope. */
@@ -10758,6 +11369,23 @@ interface Conflict {
10758
11369
  */
10759
11370
  readonly resolve?: (winner: EncryptedEnvelope | null) => void;
10760
11371
  }
11372
+ /**
11373
+ * #228c — a same-device cross-tab write conflict: another tab overwrote a
11374
+ * document this tab had written, having diverged from an older base. Records
11375
+ * are decrypted (cross-tab handlers reconcile in plaintext). `base` is the
11376
+ * common ancestor from history, or null when history is unavailable.
11377
+ */
11378
+ interface WriteConflict {
11379
+ readonly vault: string;
11380
+ readonly collection: string;
11381
+ readonly docId: string;
11382
+ readonly local: unknown;
11383
+ readonly remote: unknown;
11384
+ readonly base: unknown;
11385
+ readonly localVersion: number;
11386
+ readonly remoteVersion: number;
11387
+ readonly baseVersion: number;
11388
+ }
10761
11389
  type ConflictStrategy = 'local-wins' | 'remote-wins' | 'version' | ((conflict: Conflict) => 'local' | 'remote');
10762
11390
  /**
10763
11391
  * Collection-level conflict policy.
@@ -10844,9 +11472,20 @@ interface ChangeEvent {
10844
11472
  interface NoydbEventMap {
10845
11473
  'change': ChangeEvent;
10846
11474
  'error': Error;
11475
+ /**
11476
+ * Same-instance signal that this vault's schema-fence state changed
11477
+ * (#232). For UI integration (#233). Cross-client coordination goes
11478
+ * through the store, not this event.
11479
+ */
11480
+ 'schema:fence-changed': {
11481
+ vault: string;
11482
+ currentSchemaVersion: number;
11483
+ fenceState: 'normal' | 'draining' | 'migrating' | 'complete';
11484
+ };
10847
11485
  'sync:push': PushResult;
10848
11486
  'sync:pull': PullResult;
10849
11487
  'sync:conflict': Conflict;
11488
+ 'write:conflict': WriteConflict;
10850
11489
  'sync:online': void;
10851
11490
  'sync:offline': void;
10852
11491
  'sync:backup-error': {
@@ -11851,4 +12490,4 @@ interface DeleteManyResult {
11851
12490
  }>;
11852
12491
  }
11853
12492
 
11854
- export { type ConsentAuditEntry as $, type BlobObject as A, type BlobStrategy as B, type BlobPutOptions as C, DICT_COLLECTION_PREFIX as D, type BlobResponseOptions as E, BlobSet as F, type BlobStrategyOpenArgs as G, type CompactRunOptions as H, type I18nStrategy as I, type CompactionContext as J, type CompactionResult as K, DEFAULT_CHUNK_SIZE as L, EXPORT_AUDIT_COLLECTION as M, ExportBlobsAbortedError as N, type ExportBlobsAuditEntry as O, PolicyEnforcer as P, type ExportBlobsHandle as Q, type ExportBlobsOptions as R, type SessionStrategy as S, type ExportedBlob as T, type SlotInfo as U, type SlotRecord as V, type VersionRecord as W, createExportBlobsHandle as X, runCompaction as Y, type ConsentStrategy as Z, CONSENT_AUDIT_COLLECTION as _, type DictEntry as a, VaultInstant as a$, type ConsentAuditFilter as a0, type ConsentContext as a1, type ConsentOp as a2, loadConsentEntries as a3, writeConsentEntry as a4, type PeriodsStrategy as a5, type CarryForwardContext as a6, type ClosePeriodOptions as a7, type OpenPeriodOptions as a8, PERIODS_COLLECTION as a9, type DerivationStrategyHandle as aA, type DerivedFromMeta as aB, type OutputSpec as aC, type RecordOutputSpec as aD, type MaterializedViewStrategy as aE, type MaterializedViewStrategyHandle as aF, type OverlayedViewStrategy as aG, Collection as aH, OverlayedViewRegistry as aI, type OverlayedViewStrategyHandle as aJ, type SyncStrategy as aK, type Role as aL, type UnlockedKeyring as aM, type HistoryStrategy as aN, type NoydbStore as aO, type HistoryOptions as aP, type EncryptedEnvelope as aQ, type PruneOptions as aR, type AppendInput as aS, type ChangeType as aT, CollectionInstant as aU, type DiffEntry as aV, type JsonPatch as aW, type JsonPatchOp as aX, type LedgerEntry as aY, LedgerStore as aZ, type VaultEngine as a_, type PeriodRecord as aa, type ReadOnlyCollection as ab, appendPeriodLedgerEntry as ac, assertTsWritable as ad, chainAnchor as ae, loadPeriods as af, validatePeriodName as ag, type GuardStrategy as ah, type GuardChange as ai, type GuardContext as aj, GuardRegistry as ak, type GuardStrategyHandle as al, ReadOnlyVaultFacade as am, type ShadowStrategy as an, CollectionFrame as ao, VaultFrame as ap, type TxStrategy as aq, type AmendmentTxOptions as ar, TxCollection as as, TxContext as at, TxVault as au, runTransaction as av, type DerivationStrategy as aw, type DerivationContext as ax, type ArrayOutputSpec as ay, DerivationRegistry as az, type DictKeyDescriptor as b, type FactorRequirement as b$, type VerifyResult as b0, applyPatch as b1, canonicalJson as b2, computePatch as b3, diff as b4, formatDiff as b5, hashEntry as b6, paddedIndex as b7, parseIndex as b8, sha256Hex as b9, type CollectionDescriptor as bA, type CollectionStats as bB, type Conflict as bC, type ConflictPolicy as bD, type ConflictStrategy as bE, type CrossTierAccessEvent as bF, DEFAULT_PUBLIC_ENVELOPE_SCHEMA as bG, DELEGATIONS_COLLECTION as bH, type DeepPartial as bI, type DeepPartialOrNull as bJ, type DelegationToken as bK, type DeleteManyResult as bL, type DerivationDescriptor as bM, type DirtyEntry as bN, type DumpSchemaOptions as bO, ELEVATION_AUDIT_COLLECTION as bP, ElevatedHandle as bQ, type EnrollAuthenticatorOptions as bR, type EnrollAuthenticatorWrappingDEKsOptions as bS, type EnrollAuthenticatorWrappingKEKOptions as bT, type EnrollRecoveryResult as bU, type ExportCapability as bV, type ExportChunk as bW, type ExportFormat as bX, type ExportStreamOptions as bY, type FactorKind as bZ, type FactorProofBundle as b_, type MVQueryContext as ba, type RegisteredMV as bb, MaterializedViewRegistry as bc, type MaterializedFromMeta as bd, type MaterializedViewOutput as be, type UnionSource as bf, type UserEnvelope as bg, type PublicEnvelope as bh, type GateName as bi, type GatePolicy as bj, type VaultPolicy as bk, type ActiveTier as bl, type FactorProof as bm, type PersistedSchemaEnvelope as bn, type DirectoryConfig as bo, type UserVisibility as bp, Vault as bq, type AccessibleVault as br, BUNDLE_STORE_POLICY as bs, type BuiltInGateName as bt, type BundleRecipient as bu, type CacheOptions as bv, type CacheStats as bw, type ChangeEvent as bx, type CollectionChangeEvent as by, type CollectionConflictResolver as bz, DictionaryHandle as c, type PutManyItemOptions as c$, type FieldDescriptor as c0, type FieldSource as c1, type GhostRecord as c2, type GrantOptions as c3, type HistoryConfig as c4, type HistoryEntry as c5, INDEXED_STORE_POLICY as c6, type ImportCapability as c7, type InferOutput as c8, type InternalCollectionStats as c9, type NoydbBundleStore as cA, type NoydbEventMap as cB, type NoydbOptions as cC, type OverlayViewDescriptor as cD, PUBLIC_ENVELOPE_FIELDS as cE, type PaperRecoveryDoc as cF, type PaperRecoveryEntry as cG, type PassphrasePolicy as cH, type PassphraseValidationResult as cI, type Permission as cJ, type Permissions as cK, type PersistedSchemaKind as cL, type PlaintextTranslatorContext as cM, type PlaintextTranslatorFn as cN, PresenceHandle as cO, type PresencePeer as cP, type PublicEnvelopeField as cQ, type PublicEnvelopeSchema as cR, type PublicEnvelopeText as cS, type PullMode as cT, type PullOptions as cU, type PullPolicy as cV, type PullResult as cW, type PushMode as cX, type PushOptions as cY, type PushPolicy as cZ, type PushResult as c_, type IssueDelegationOptions as ca, type IssueMagicLinkGrantOptions as cb, type KeyringAuthenticator as cc, type KeyringAuthenticatorWrappingDEKs as cd, type KeyringAuthenticatorWrappingKEK as ce, type KeyringFile as cf, type ListAccessibleVaultsOptions as cg, type ListPageResult as ch, type ListUsersOptions as ci, type LiveUserEnvelope as cj, type LocaleReadOptions as ck, Lru as cl, type LruOptions as cm, type LruStats as cn, MAGIC_LINK_CONTENT_INFO_PREFIX as co, MAGIC_LINK_GRANTS_COLLECTION as cp, MAGIC_LINK_KEK_INFO_PREFIX as cq, type MagicLinkGrantPayload as cr, type MagicLinkGrantRecord as cs, type MaterializedViewDescriptor as ct, MemorySealingKeyProvider as cu, NOYDB_BACKUP_VERSION as cv, NOYDB_FORMAT_VERSION as cw, NOYDB_KEYRING_VERSION as cx, NOYDB_SYNC_VERSION as cy, Noydb as cz, type DictionaryOptions as d, type WeakPassphraseReason as d$, type PutManyOptions as d0, type PutManyResult as d1, type QueryAcrossOptions as d2, type QueryAcrossResult as d3, type QuickUnlockState as d4, QuickUnlockStore as d5, type ReAuthOperation as d6, type RecoverPassphraseInput as d7, type RecoverPassphraseResult as d8, type RecoverUserOptions as d9, type SyncPolicy as dA, SyncScheduler as dB, type SyncSchedulerStatus as dC, type SyncStatus as dD, type SyncTarget as dE, type SyncTargetRole as dF, SyncTransaction as dG, type SyncTransactionResult as dH, type TierMode as dI, type TranslatorAuditEntry as dJ, type TxOp as dK, USER_ENVELOPE_COLLECTION as dL, USER_ENVELOPE_MAX_BYTES as dM, type Unsubscribe as dN, type UpdateAuthenticatorOptions as dO, type UpdateUserOptions as dP, UserApi as dQ, type UserEnvelopeCheckGate as dR, UserEnvelopeOversizedError as dS, type UserEnvelopePresented as dT, type UserInfo as dU, type VaultBackup as dV, type VaultPolicyOnDisk as dW, type VaultSchemaSnapshot as dX, type VaultSnapshot as dY, type WarningRules as dZ, WeakPassphraseError as d_, type RecoveryProof as da, type ResolvedPublicEnvelopeSchema as db, type RevokeOptions as dc, type RotatePassphraseInput as dd, type RotateRecoveryOptions as de, type RotateRecoveryResult as df, SEALED_PASSPHRASE_RECORD_ID as dg, type SealedEnvelope as dh, type SealedPassphrase as di, type SealingKeyProvider as dj, type SessionPolicy as dk, type SetPublicEnvelopeInput as dl, type ShamirRecoveryDoc as dm, type ShamirRecoveryEntry as dn, type ShamirRecoveryProvider as dp, type SlotRewrapCeremony as dq, type SlotRewrapContext as dr, type StandardSchemaV1 as ds, type StandardSchemaV1Issue as dt, type StandardSchemaV1SyncResult as du, type StoreAuth as dv, type StoreAuthKind as dw, type StoreCapabilities as dx, SyncEngine as dy, type SyncMetadata as dz, type I18nTextDescriptor as e, type WrappedDeksBlob as e0, assertStrongPassphrase as e1, buildRecipientKeyringFile as e2, burnPaperRecoveryEntry as e3, createNoydb as e4, createStore as e5, deriveMagicLinkContentKey as e6, enrollAuthenticator as e7, estimateEntropy as e8, evaluateExportCapability as e9, revokeDelegation as eA, revokeMagicLinkGrant as eB, savePaperRecoveryEntries as eC, saveSealedPassphrase as eD, saveShamirRecoveryEntries as eE, unwrapDeksFromBlob as eF, unwrapDeksFromPaperEntry as eG, unwrapDeksFromShamirEntry as eH, unwrapMagicLinkGrant as eI, validatePassphrase as eJ, validatePublicEnvelopeInput as eK, validateSchemaInput as eL, validateSchemaOutput as eM, writeMagicLinkGrant as eN, changeSecret as eO, createOwnerKeyring as eP, ensureCollectionDEK as eQ, grant as eR, loadKeyring as eS, persistKeyring as eT, revoke as eU, updateAuthenticator as eV, updateKeyringIdentity as eW, evaluateImportCapability as ea, findAuthenticator as eb, hasExportCapability as ec, hasImportCapability as ed, hasRecoveryEnrolled as ee, isMagicLinkGrantExpired as ef, isPublicEnvelope as eg, issueDelegation as eh, recoverPassphrase as ei, rotatePassphrase as ej, listMagicLinkGrants as ek, listUsers as el, listUsersWithEnvelopes as em, loadActiveDelegations as en, loadPaperRecoveryEntries as eo, loadSealedPassphrase as ep, loadShamirRecoveryEntries as eq, magicLinkGrantRecordId as er, mintPaperRecoveryEntry as es, mintShamirRecoveryEntry as et, mintWrappedDeksBlob as eu, parseSealedEnvelope as ev, readMagicLinkGrantRecord as ew, recoverUser as ex, removeAuthenticator as ey, resolveSchema as ez, type I18nTextOptions as f, applyI18nLocale as g, dictCollectionName as h, dictKey as i, i18nText as j, isDictCollectionName as k, isDictKeyDescriptor as l, isI18nTextDescriptor as m, createEnforcer as n, validateSessionPolicy as o, BLOB_CHUNKS_COLLECTION as p, BLOB_COLLECTION as q, resolveI18nText as r, BLOB_EVICTION_AUDIT_COLLECTION as s, BLOB_INDEX_COLLECTION as t, BLOB_SLOTS_PREFIX as u, validateI18nTextValue as v, BLOB_VERSIONS_PREFIX as w, type BlobEvictionEntry as x, type BlobFieldPolicy as y, type BlobFieldsConfig as z };
12493
+ export { type ConsentAuditEntry as $, type BlobObject as A, type BlobStrategy as B, type BlobPutOptions as C, DICT_COLLECTION_PREFIX as D, type BlobResponseOptions as E, BlobSet as F, type BlobStrategyOpenArgs as G, type CompactRunOptions as H, type I18nStrategy as I, type CompactionContext as J, type CompactionResult as K, DEFAULT_CHUNK_SIZE as L, EXPORT_AUDIT_COLLECTION as M, ExportBlobsAbortedError as N, type ExportBlobsAuditEntry as O, PolicyEnforcer as P, type ExportBlobsHandle as Q, type ExportBlobsOptions as R, type SessionStrategy as S, type ExportedBlob as T, type SlotInfo as U, type SlotRecord as V, type VersionRecord as W, createExportBlobsHandle as X, runCompaction as Y, type ConsentStrategy as Z, CONSENT_AUDIT_COLLECTION as _, type DictEntry as a, VaultInstant as a$, type ConsentAuditFilter as a0, type ConsentContext as a1, type ConsentOp as a2, loadConsentEntries as a3, writeConsentEntry as a4, type PeriodsStrategy as a5, type CarryForwardContext as a6, type ClosePeriodOptions as a7, type OpenPeriodOptions as a8, PERIODS_COLLECTION as a9, type DerivationStrategyHandle as aA, type DerivedFromMeta as aB, type OutputSpec as aC, type RecordOutputSpec as aD, type MaterializedViewStrategy as aE, type MaterializedViewStrategyHandle as aF, type OverlayedViewStrategy as aG, Collection as aH, OverlayedViewRegistry as aI, type OverlayedViewStrategyHandle as aJ, type SyncStrategy as aK, type Role as aL, type UnlockedKeyring as aM, type HistoryStrategy as aN, type NoydbStore as aO, type HistoryOptions as aP, type EncryptedEnvelope as aQ, type PruneOptions as aR, type AppendInput as aS, type ChangeType as aT, CollectionInstant as aU, type DiffEntry as aV, type JsonPatch as aW, type JsonPatchOp as aX, type LedgerEntry as aY, LedgerStore as aZ, type VaultEngine as a_, type PeriodRecord as aa, type ReadOnlyCollection as ab, appendPeriodLedgerEntry as ac, assertTsWritable as ad, chainAnchor as ae, loadPeriods as af, validatePeriodName as ag, type GuardStrategy as ah, type GuardChange as ai, type GuardContext as aj, GuardRegistry as ak, type GuardStrategyHandle as al, ReadOnlyVaultFacade as am, type ShadowStrategy as an, CollectionFrame as ao, VaultFrame as ap, type TxStrategy as aq, type AmendmentTxOptions as ar, TxCollection as as, TxContext as at, TxVault as au, runTransaction as av, type DerivationStrategy as aw, type DerivationContext as ax, type ArrayOutputSpec as ay, DerivationRegistry as az, type DictKeyDescriptor as b, type EnrollAuthenticatorOptions as b$, type VerifyResult as b0, applyPatch as b1, canonicalJson as b2, computePatch as b3, diff as b4, formatDiff as b5, hashEntry as b6, paddedIndex as b7, parseIndex as b8, sha256Hex as b9, type AccessibleVault as bA, type AffectedDocument as bB, BUNDLE_STORE_POLICY as bC, type BuiltInGateName as bD, type CacheOptions as bE, type CacheStats as bF, type ChangeEvent as bG, type CollectionChangeEvent as bH, type CollectionConflictResolver as bI, type CollectionDescriptor as bJ, type CollectionStats as bK, type Conflict as bL, type ConflictPolicy as bM, type ConflictStrategy as bN, type CrossTierAccessEvent as bO, DEFAULT_PUBLIC_ENVELOPE_SCHEMA as bP, DELEGATIONS_COLLECTION as bQ, type DeepPartial as bR, type DeepPartialOrNull as bS, type DelegationToken as bT, type DeleteManyResult as bU, type DerivationDescriptor as bV, type DirtyEntry as bW, type DryRunResult as bX, type DumpSchemaOptions as bY, ELEVATION_AUDIT_COLLECTION as bZ, ElevatedHandle as b_, type PublicEnvelope as ba, type SealingKeyProvider as bb, type BundleRecipient as bc, type RecipientSealer as bd, type RecipientHint as be, Vault as bf, type RecoveryEnrollmentInput as bg, type ShamirRecoveryProvider as bh, type MVQueryContext as bi, type RegisteredMV as bj, MaterializedViewRegistry as bk, type MaterializedFromMeta as bl, type MaterializedViewOutput as bm, type UnionSource as bn, type UserEnvelope as bo, type GateName as bp, type GatePolicy as bq, type VaultPolicy as br, type ActiveTier as bs, type FactorProof as bt, type SchemaUpdateStrategy as bu, type TransformFn as bv, type PersistedSchemaEnvelope as bw, type UpdateDecision as bx, type DirectoryConfig as by, type UserVisibility as bz, DictionaryHandle as c, type PlaintextTranslatorContext as c$, type EnrollAuthenticatorWrappingDEKsOptions as c0, type EnrollAuthenticatorWrappingKEKOptions as c1, type EnrollRecoveryResult as c2, type ExportCapability as c3, type ExportChunk as c4, type ExportFormat as c5, type ExportStreamOptions as c6, type FactorKind as c7, type FactorProofBundle as c8, type FactorRequirement as c9, type LruOptions as cA, type LruStats as cB, MAGIC_LINK_CONTENT_INFO_PREFIX as cC, MAGIC_LINK_GRANTS_COLLECTION as cD, MAGIC_LINK_KEK_INFO_PREFIX as cE, type MagicLinkGrantPayload as cF, type MagicLinkGrantRecord as cG, type MaterializedViewDescriptor as cH, MemoryRecipientSealer as cI, MemorySealingKeyProvider as cJ, NOYDB_BACKUP_VERSION as cK, NOYDB_FORMAT_VERSION as cL, NOYDB_KEYRING_VERSION as cM, NOYDB_SYNC_VERSION as cN, Noydb as cO, type NoydbBundleStore as cP, type NoydbEventMap as cQ, type NoydbOptions as cR, type OverlayViewDescriptor as cS, PUBLIC_ENVELOPE_FIELDS as cT, type PaperRecoveryDoc as cU, type PaperRecoveryEntry as cV, type PassphrasePolicy as cW, type PassphraseValidationResult as cX, type Permission as cY, type Permissions as cZ, type PersistedSchemaKind as c_, type FenceDoc as ca, type FenceState as cb, type FieldChange as cc, type FieldDescriptor as cd, type FieldSource as ce, type GhostRecord as cf, type GrantOptions as cg, type GuardViolation as ch, type HistoryConfig as ci, type HistoryEntry as cj, INDEXED_STORE_POLICY as ck, type ImportCapability as cl, type InferOutput as cm, type InternalCollectionStats as cn, type IssueDelegationOptions as co, type IssueMagicLinkGrantOptions as cp, type KeyringAuthenticator as cq, type KeyringAuthenticatorWrappingDEKs as cr, type KeyringAuthenticatorWrappingKEK as cs, type KeyringFile as ct, type ListAccessibleVaultsOptions as cu, type ListPageResult as cv, type ListUsersOptions as cw, type LiveUserEnvelope as cx, type LocaleReadOptions as cy, Lru as cz, type DictionaryOptions as d, type TabRole as d$, type PlaintextTranslatorFn as d0, PresenceHandle as d1, type PresencePeer as d2, type PublicEnvelopeField as d3, type PublicEnvelopeSchema as d4, type PublicEnvelopeText as d5, type PullMode as d6, type PullOptions as d7, type PullPolicy as d8, type PullResult as d9, type SealedPassphrase as dA, type SessionPolicy as dB, type SetPublicEnvelopeInput as dC, type ShamirRecoveryDoc as dD, type ShamirRecoveryEntry as dE, type SlotRewrapCeremony as dF, type SlotRewrapContext as dG, type StandardSchemaV1 as dH, type StandardSchemaV1Issue as dI, type StandardSchemaV1SyncResult as dJ, type StoreAuth as dK, type StoreAuthKind as dL, type StoreCapabilities as dM, SyncEngine as dN, type SyncMetadata as dO, type SyncPolicy as dP, SyncScheduler as dQ, type SyncSchedulerStatus as dR, type SyncStatus as dS, type SyncTarget as dT, type SyncTargetRole as dU, SyncTransaction as dV, type SyncTransactionResult as dW, type TabChannel as dX, type TabCoordinationOptions as dY, type TabLockManager as dZ, type TabPresence as d_, type PushMode as da, type PushOptions as db, type PushPolicy as dc, type PushResult as dd, type PutManyItemOptions as de, type PutManyOptions as df, type PutManyResult as dg, type QueryAcrossOptions as dh, type QueryAcrossResult as di, type QuickUnlockState as dj, QuickUnlockStore as dk, type ReAuthOperation as dl, type RecoverPassphraseInput as dm, type RecoverPassphraseResult as dn, type RecoverUserOptions as dp, type RecoveryProof as dq, type ResolvedPublicEnvelopeSchema as dr, type RevokeOptions as ds, type RotatePassphraseInput as dt, type RotateRecoveryOptions as du, type RotateRecoveryResult as dv, SEALED_PASSPHRASE_RECORD_ID as dw, type SchemaDelta as dx, type SchemaIntrospection as dy, type SealedEnvelope as dz, type I18nTextDescriptor as e, savePaperRecoveryEntries as e$, type TierMode as e0, type TranslatorAuditEntry as e1, type TxOp as e2, USER_ENVELOPE_COLLECTION as e3, USER_ENVELOPE_MAX_BYTES as e4, type Unsubscribe as e5, type UpdateAuthenticatorOptions as e6, type UpdateContext as e7, type UpdateUserOptions as e8, UserApi as e9, findAuthenticator as eA, hasExportCapability as eB, hasImportCapability as eC, hasRecoveryEnrolled as eD, isMagicLinkGrantExpired as eE, isPublicEnvelope as eF, issueDelegation as eG, recoverPassphrase as eH, rotatePassphrase as eI, listMagicLinkGrants as eJ, listUsers as eK, listUsersWithEnvelopes as eL, loadActiveDelegations as eM, loadPaperRecoveryEntries as eN, loadSealedPassphrase as eO, loadShamirRecoveryEntries as eP, magicLinkGrantRecordId as eQ, mintPaperRecoveryEntry as eR, mintShamirRecoveryEntry as eS, mintWrappedDeksBlob as eT, parseSealedEnvelope as eU, readMagicLinkGrantRecord as eV, recoverUser as eW, removeAuthenticator as eX, resolveSchema as eY, revokeDelegation as eZ, revokeMagicLinkGrant as e_, type UserEnvelopeCheckGate as ea, UserEnvelopeOversizedError as eb, type UserEnvelopePresented as ec, type UserInfo as ed, type VaultBackup as ee, type VaultPolicyOnDisk as ef, type VaultSchemaSnapshot as eg, type VaultSnapshot as eh, type WarningRules as ei, WeakPassphraseError as ej, type WeakPassphraseReason as ek, type WrappedDeksBlob as el, type WriteConflict as em, type WriteEvent as en, type WriteHook as eo, type WriteQueue as ep, assertStrongPassphrase as eq, buildRecipientKeyringFile as er, burnPaperRecoveryEntry as es, createNoydb as et, createStore as eu, deriveMagicLinkContentKey as ev, enrollAuthenticator as ew, estimateEntropy as ex, evaluateExportCapability as ey, evaluateImportCapability as ez, type I18nTextOptions as f, saveSealedPassphrase as f0, saveShamirRecoveryEntries as f1, unwrapDeksFromBlob as f2, unwrapDeksFromPaperEntry as f3, unwrapDeksFromShamirEntry as f4, unwrapMagicLinkGrant as f5, validatePassphrase as f6, validatePublicEnvelopeInput as f7, validateSchemaInput as f8, validateSchemaOutput as f9, writeMagicLinkGrant as fa, changeSecret as fb, createOwnerKeyring as fc, ensureCollectionDEK as fd, grant as fe, loadKeyring as ff, persistKeyring as fg, revoke as fh, updateAuthenticator as fi, updateKeyringIdentity as fj, applyI18nLocale as g, dictCollectionName as h, dictKey as i, i18nText as j, isDictCollectionName as k, isDictKeyDescriptor as l, isI18nTextDescriptor as m, createEnforcer as n, validateSessionPolicy as o, BLOB_CHUNKS_COLLECTION as p, BLOB_COLLECTION as q, resolveI18nText as r, BLOB_EVICTION_AUDIT_COLLECTION as s, BLOB_INDEX_COLLECTION as t, BLOB_SLOTS_PREFIX as u, validateI18nTextValue as v, BLOB_VERSIONS_PREFIX as w, type BlobEvictionEntry as x, type BlobFieldPolicy as y, type BlobFieldsConfig as z };