@noy-db/hub 0.1.0-pre.8 → 0.2.0-pre.1

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 +91 -36
  2. package/dist/aggregate/index.cjs.map +1 -1
  3. package/dist/aggregate/index.d.cts +2 -2
  4. package/dist/aggregate/index.d.ts +2 -2
  5. package/dist/aggregate/index.js +16 -9
  6. package/dist/aggregate/index.js.map +1 -1
  7. package/dist/blobs/index.cjs.map +1 -1
  8. package/dist/blobs/index.d.cts +6 -6
  9. package/dist/blobs/index.d.ts +6 -6
  10. package/dist/blobs/index.js +4 -4
  11. package/dist/bundle/index.cjs +298 -7
  12. package/dist/bundle/index.cjs.map +1 -1
  13. package/dist/bundle/index.d.cts +6 -6
  14. package/dist/bundle/index.d.ts +6 -6
  15. package/dist/bundle/index.js +15 -4
  16. package/dist/{chunk-GOUT6DND.js → chunk-23TTQXVO.js} +173 -91
  17. package/dist/chunk-23TTQXVO.js.map +1 -0
  18. package/dist/{chunk-CIMZBAZB.js → chunk-2AXFIYHT.js} +1 -1
  19. package/dist/chunk-2AXFIYHT.js.map +1 -0
  20. package/dist/chunk-34YSDCDP.js +73 -0
  21. package/dist/chunk-34YSDCDP.js.map +1 -0
  22. package/dist/{chunk-HC7Z5EQZ.js → chunk-4TFSM22V.js} +4 -4
  23. package/dist/{chunk-7XBQS42M.js → chunk-537VFZTR.js} +4 -4
  24. package/dist/{chunk-M62XNWRA.js → chunk-5DWL3JBF.js} +2 -2
  25. package/dist/{chunk-RSPLI376.js → chunk-5SCJ5UEF.js} +3 -3
  26. package/dist/chunk-5ZGZ6HIZ.js +100 -0
  27. package/dist/chunk-5ZGZ6HIZ.js.map +1 -0
  28. package/dist/chunk-6HPZY4ON.js +291 -0
  29. package/dist/chunk-6HPZY4ON.js.map +1 -0
  30. package/dist/{chunk-WN6UK7PM.js → chunk-7H6DOO3E.js} +239 -11
  31. package/dist/chunk-7H6DOO3E.js.map +1 -0
  32. package/dist/{chunk-ACLDOTNQ.js → chunk-ADQ5MQ54.js} +275 -3
  33. package/dist/chunk-ADQ5MQ54.js.map +1 -0
  34. package/dist/chunk-CBAHB2BF.js +893 -0
  35. package/dist/chunk-CBAHB2BF.js.map +1 -0
  36. package/dist/chunk-DPMFBCV6.js +296 -0
  37. package/dist/chunk-DPMFBCV6.js.map +1 -0
  38. package/dist/chunk-DYBQG5PQ.js +34 -0
  39. package/dist/chunk-DYBQG5PQ.js.map +1 -0
  40. package/dist/{chunk-ZFKD4QMV.js → chunk-DYECX3IX.js} +3 -3
  41. package/dist/chunk-EGQYGYIU.js +51 -0
  42. package/dist/chunk-EGQYGYIU.js.map +1 -0
  43. package/dist/chunk-FCXOFQAJ.js +79 -0
  44. package/dist/chunk-FCXOFQAJ.js.map +1 -0
  45. package/dist/chunk-HB3Z2GCR.js +124 -0
  46. package/dist/chunk-HB3Z2GCR.js.map +1 -0
  47. package/dist/{chunk-SCZXXXU4.js → chunk-I6MX32UC.js} +7 -32
  48. package/dist/chunk-I6MX32UC.js.map +1 -0
  49. package/dist/{chunk-VQBTTTUN.js → chunk-KESP7GOK.js} +4 -4
  50. package/dist/{chunk-VQBTTTUN.js.map → chunk-KESP7GOK.js.map} +1 -1
  51. package/dist/{chunk-NXFEYLVG.js → chunk-MIQHZESA.js} +4 -3
  52. package/dist/{chunk-NXFEYLVG.js.map → chunk-MIQHZESA.js.map} +1 -1
  53. package/dist/chunk-MKSA2V7A.js +19 -0
  54. package/dist/chunk-MKSA2V7A.js.map +1 -0
  55. package/dist/{chunk-M5INGEFC.js → chunk-MRIBLZL3.js} +3 -1
  56. package/dist/chunk-MRIBLZL3.js.map +1 -0
  57. package/dist/{chunk-2WGMYBYS.js → chunk-NIOHFJPJ.js} +6 -6
  58. package/dist/chunk-OMLIZL2P.js +61 -0
  59. package/dist/chunk-OMLIZL2P.js.map +1 -0
  60. package/dist/{chunk-USKYUS74.js → chunk-P7EQ2S5O.js} +2 -2
  61. package/dist/{chunk-YVFTBQHL.js → chunk-PA6R5ZCI.js} +217 -10
  62. package/dist/chunk-PA6R5ZCI.js.map +1 -0
  63. package/dist/chunk-PEULZC6M.js +118 -0
  64. package/dist/chunk-PEULZC6M.js.map +1 -0
  65. package/dist/chunk-RD5LYKD6.js +82 -0
  66. package/dist/chunk-RD5LYKD6.js.map +1 -0
  67. package/dist/chunk-SIZWEV2Y.js +145 -0
  68. package/dist/chunk-SIZWEV2Y.js.map +1 -0
  69. package/dist/{chunk-Y4CMTMUW.js → chunk-UA4RI7OT.js} +12 -6
  70. package/dist/chunk-UA4RI7OT.js.map +1 -0
  71. package/dist/chunk-UMLVJTYV.js +20 -0
  72. package/dist/chunk-UMLVJTYV.js.map +1 -0
  73. package/dist/chunk-UZXLQCHP.js +53 -0
  74. package/dist/chunk-UZXLQCHP.js.map +1 -0
  75. package/dist/{chunk-R2ZTGEVP.js → chunk-VMIO4IXG.js} +5 -5
  76. package/dist/{chunk-MR4424N3.js → chunk-WCA2NROQ.js} +2 -2
  77. package/dist/{chunk-TDR6T5CJ.js → chunk-XGSOTWYX.js} +91 -132
  78. package/dist/chunk-XGSOTWYX.js.map +1 -0
  79. package/dist/{chunk-NPC4LFV5.js → chunk-YMYK7US4.js} +2 -2
  80. package/dist/{chunk-PJK6IOBC.js → chunk-YS3POABP.js} +1 -1
  81. package/dist/chunk-YS3POABP.js.map +1 -0
  82. package/dist/chunk-Z72JH4KG.js +209 -0
  83. package/dist/chunk-Z72JH4KG.js.map +1 -0
  84. package/dist/{chunk-R36SIKES.js → chunk-ZNOEIM6Y.js} +2 -2
  85. package/dist/consent/index.cjs.map +1 -1
  86. package/dist/consent/index.d.cts +6 -6
  87. package/dist/consent/index.d.ts +6 -6
  88. package/dist/consent/index.js +3 -3
  89. package/dist/{crypto-IVKU7YTT.js → crypto-A7FRXYHC.js} +3 -3
  90. package/dist/{delegation-2DBS2EOH.js → delegation-YBA4X4JN.js} +5 -4
  91. package/dist/derivations/index.cjs +351 -0
  92. package/dist/derivations/index.cjs.map +1 -0
  93. package/dist/derivations/index.d.cts +71 -0
  94. package/dist/derivations/index.d.ts +71 -0
  95. package/dist/derivations/index.js +27 -0
  96. package/dist/{dev-unlock-BygpnIWe.d.ts → dev-unlock-D9s-loPr.d.ts} +1 -1
  97. package/dist/{dev-unlock-BZKx666y.d.cts → dev-unlock-DRwVSy2S.d.cts} +1 -1
  98. package/dist/executor-7E3VFGW7.js +11 -0
  99. package/dist/executor-CEWX2FQI.js +8 -0
  100. package/dist/executor-CEWX2FQI.js.map +1 -0
  101. package/dist/executor-X4SQ3ZLC.js +8 -0
  102. package/dist/executor-X4SQ3ZLC.js.map +1 -0
  103. package/dist/fanout-sidecar-VJ52RIEY.js +51 -0
  104. package/dist/fanout-sidecar-VJ52RIEY.js.map +1 -0
  105. package/dist/guards/index.cjs +315 -0
  106. package/dist/guards/index.cjs.map +1 -0
  107. package/dist/guards/index.d.cts +30 -0
  108. package/dist/guards/index.d.ts +30 -0
  109. package/dist/guards/index.js +29 -0
  110. package/dist/guards/index.js.map +1 -0
  111. package/dist/{hash-B0eU2Qv9.d.ts → hash-DXXXusyk.d.ts} +1 -1
  112. package/dist/{hash-CIyfmKsg.d.cts → hash-DtRih9MQ.d.cts} +1 -1
  113. package/dist/history/index.cjs +8 -1
  114. package/dist/history/index.cjs.map +1 -1
  115. package/dist/history/index.d.cts +7 -7
  116. package/dist/history/index.d.ts +7 -7
  117. package/dist/history/index.js +6 -6
  118. package/dist/i18n/index.cjs +81 -0
  119. package/dist/i18n/index.cjs.map +1 -1
  120. package/dist/i18n/index.d.cts +6 -6
  121. package/dist/i18n/index.d.ts +6 -6
  122. package/dist/i18n/index.js +19 -6
  123. package/dist/i18n/index.js.map +1 -1
  124. package/dist/{index-Dp4tKCjX.d.ts → index-4agOpzqd.d.ts} +174 -3
  125. package/dist/{index-6xNpPsxR.d.cts → index-CNwA-B6-.d.ts} +303 -5
  126. package/dist/{index-DJTf9yxn.d.ts → index-CmVgTkqk.d.cts} +303 -5
  127. package/dist/{index-DsVbTDZI.d.cts → index-hdFvZkBP.d.cts} +174 -3
  128. package/dist/index.cjs +5929 -1089
  129. package/dist/index.cjs.map +1 -1
  130. package/dist/index.d.cts +207 -16
  131. package/dist/index.d.ts +207 -16
  132. package/dist/index.js +2402 -672
  133. package/dist/index.js.map +1 -1
  134. package/dist/indexing/index.cjs +2 -0
  135. package/dist/indexing/index.cjs.map +1 -1
  136. package/dist/indexing/index.d.cts +3 -3
  137. package/dist/indexing/index.d.ts +3 -3
  138. package/dist/indexing/index.js +4 -4
  139. package/dist/{lazy-builder-CZVLKh0Z.d.cts → lazy-builder-C-rPfWG0.d.cts} +1 -1
  140. package/dist/{lazy-builder-BwEoBQZ9.d.ts → lazy-builder-Rpd-V3jP.d.ts} +1 -1
  141. package/dist/{ledger-UQIMMKO5.js → ledger-3TXNP47J.js} +6 -6
  142. package/dist/ledger-3TXNP47J.js.map +1 -0
  143. package/dist/materialized-views/index.cjs +837 -0
  144. package/dist/materialized-views/index.cjs.map +1 -0
  145. package/dist/materialized-views/index.d.cts +183 -0
  146. package/dist/materialized-views/index.d.ts +183 -0
  147. package/dist/materialized-views/index.js +45 -0
  148. package/dist/materialized-views/index.js.map +1 -0
  149. package/dist/overlay-views/index.cjs +359 -0
  150. package/dist/overlay-views/index.cjs.map +1 -0
  151. package/dist/overlay-views/index.d.cts +81 -0
  152. package/dist/overlay-views/index.d.ts +81 -0
  153. package/dist/overlay-views/index.js +23 -0
  154. package/dist/overlay-views/index.js.map +1 -0
  155. package/dist/periods/index.cjs +7 -1
  156. package/dist/periods/index.cjs.map +1 -1
  157. package/dist/periods/index.d.cts +6 -6
  158. package/dist/periods/index.d.ts +6 -6
  159. package/dist/periods/index.js +6 -6
  160. package/dist/{predicate-SBHmi6D0.d.cts → predicate-Dnu81tsS.d.cts} +25 -1
  161. package/dist/{predicate-SBHmi6D0.d.ts → predicate-Dnu81tsS.d.ts} +25 -1
  162. package/dist/{public-envelope-3QTQADDW.js → public-envelope-PY6NKFLI.js} +4 -4
  163. package/dist/public-envelope-PY6NKFLI.js.map +1 -0
  164. package/dist/query/index.cjs +302 -124
  165. package/dist/query/index.cjs.map +1 -1
  166. package/dist/query/index.d.cts +3 -3
  167. package/dist/query/index.d.ts +3 -3
  168. package/dist/query/index.js +26 -11
  169. package/dist/read-only-facade-ITU6L7BL.js +7 -0
  170. package/dist/read-only-facade-ITU6L7BL.js.map +1 -0
  171. package/dist/registry-3L3N3PTG.js +10 -0
  172. package/dist/registry-3L3N3PTG.js.map +1 -0
  173. package/dist/registry-O47PUPSY.js +8 -0
  174. package/dist/registry-O47PUPSY.js.map +1 -0
  175. package/dist/registry-RFGGMVNJ.js +7 -0
  176. package/dist/registry-RFGGMVNJ.js.map +1 -0
  177. package/dist/registry-WLLMODKN.js +8 -0
  178. package/dist/registry-WLLMODKN.js.map +1 -0
  179. package/dist/session/index.cjs +7 -1
  180. package/dist/session/index.cjs.map +1 -1
  181. package/dist/session/index.d.cts +7 -7
  182. package/dist/session/index.d.ts +7 -7
  183. package/dist/session/index.js +10 -3
  184. package/dist/session/index.js.map +1 -1
  185. package/dist/shadow/index.cjs.map +1 -1
  186. package/dist/shadow/index.d.cts +6 -6
  187. package/dist/shadow/index.d.ts +6 -6
  188. package/dist/shadow/index.js +2 -2
  189. package/dist/stale-HSC5YO2O.js +13 -0
  190. package/dist/stale-HSC5YO2O.js.map +1 -0
  191. package/dist/store/index.cjs +14 -0
  192. package/dist/store/index.cjs.map +1 -1
  193. package/dist/store/index.d.cts +6 -6
  194. package/dist/store/index.d.ts +6 -6
  195. package/dist/store/index.js +5 -2
  196. package/dist/{strategy-D-SrOLCl.d.cts → strategy-DSTrsZ8t.d.cts} +72 -19
  197. package/dist/{strategy-D-SrOLCl.d.ts → strategy-DSTrsZ8t.d.ts} +72 -19
  198. package/dist/sync/index.cjs.map +1 -1
  199. package/dist/sync/index.d.cts +5 -5
  200. package/dist/sync/index.d.ts +5 -5
  201. package/dist/sync/index.js +4 -4
  202. package/dist/team/index.cjs +1554 -2
  203. package/dist/team/index.cjs.map +1 -1
  204. package/dist/team/index.d.cts +6 -6
  205. package/dist/team/index.d.ts +6 -6
  206. package/dist/team/index.js +76 -9
  207. package/dist/tx/index.cjs +296 -44
  208. package/dist/tx/index.cjs.map +1 -1
  209. package/dist/tx/index.d.cts +6 -6
  210. package/dist/tx/index.d.ts +6 -6
  211. package/dist/tx/index.js +2 -2
  212. package/dist/{types-DD9eKKNc.d.ts → types-C4lwMKKF.d.cts} +2771 -322
  213. package/dist/{types-arFMsCtn.d.cts → types-DW9RGSSs.d.ts} +2771 -322
  214. package/dist/util/index.cjs.map +1 -1
  215. package/dist/util/index.js +1 -1
  216. package/dist/with-derivation-C8LDlV7t.d.cts +13 -0
  217. package/dist/with-derivation-g-pGoMzL.d.ts +13 -0
  218. package/dist/with-guard-DWOCK4Ca.d.ts +18 -0
  219. package/dist/with-guard-jI1x9Z3k.d.cts +18 -0
  220. package/dist/with-materialized-view-DaKR-N6J.d.ts +27 -0
  221. package/dist/with-materialized-view-DcTx4H3j.d.cts +27 -0
  222. package/dist/with-overlayed-view-D-6oWAgM.d.cts +13 -0
  223. package/dist/with-overlayed-view-N7jYuNOS.d.ts +13 -0
  224. package/package.json +53 -2
  225. package/dist/chunk-ACLDOTNQ.js.map +0 -1
  226. package/dist/chunk-BTDCBVJW.js +0 -160
  227. package/dist/chunk-BTDCBVJW.js.map +0 -1
  228. package/dist/chunk-CIMZBAZB.js.map +0 -1
  229. package/dist/chunk-GOUT6DND.js.map +0 -1
  230. package/dist/chunk-M5INGEFC.js.map +0 -1
  231. package/dist/chunk-PJK6IOBC.js.map +0 -1
  232. package/dist/chunk-SCZXXXU4.js.map +0 -1
  233. package/dist/chunk-TDR6T5CJ.js.map +0 -1
  234. package/dist/chunk-TOQK4KAN.js +0 -79
  235. package/dist/chunk-TOQK4KAN.js.map +0 -1
  236. package/dist/chunk-WN6UK7PM.js.map +0 -1
  237. package/dist/chunk-Y4CMTMUW.js.map +0 -1
  238. package/dist/chunk-YVFTBQHL.js.map +0 -1
  239. /package/dist/{chunk-HC7Z5EQZ.js.map → chunk-4TFSM22V.js.map} +0 -0
  240. /package/dist/{chunk-7XBQS42M.js.map → chunk-537VFZTR.js.map} +0 -0
  241. /package/dist/{chunk-M62XNWRA.js.map → chunk-5DWL3JBF.js.map} +0 -0
  242. /package/dist/{chunk-RSPLI376.js.map → chunk-5SCJ5UEF.js.map} +0 -0
  243. /package/dist/{chunk-ZFKD4QMV.js.map → chunk-DYECX3IX.js.map} +0 -0
  244. /package/dist/{chunk-2WGMYBYS.js.map → chunk-NIOHFJPJ.js.map} +0 -0
  245. /package/dist/{chunk-USKYUS74.js.map → chunk-P7EQ2S5O.js.map} +0 -0
  246. /package/dist/{chunk-R2ZTGEVP.js.map → chunk-VMIO4IXG.js.map} +0 -0
  247. /package/dist/{chunk-MR4424N3.js.map → chunk-WCA2NROQ.js.map} +0 -0
  248. /package/dist/{chunk-NPC4LFV5.js.map → chunk-YMYK7US4.js.map} +0 -0
  249. /package/dist/{chunk-R36SIKES.js.map → chunk-ZNOEIM6Y.js.map} +0 -0
  250. /package/dist/{crypto-IVKU7YTT.js.map → crypto-A7FRXYHC.js.map} +0 -0
  251. /package/dist/{delegation-2DBS2EOH.js.map → delegation-YBA4X4JN.js.map} +0 -0
  252. /package/dist/{ledger-UQIMMKO5.js.map → derivations/index.js.map} +0 -0
  253. /package/dist/{public-envelope-3QTQADDW.js.map → executor-7E3VFGW7.js.map} +0 -0
package/dist/index.d.cts CHANGED
@@ -1,17 +1,21 @@
1
- import { at as NoydbStore, aR as UserEnvelope, aS as PublicEnvelope, aT as GateName, aU as GatePolicy, aV as VaultPolicy, aW as ActiveTier, aX as FactorProof, ar as UnlockedKeyring, aY as Vault, aA as DiffEntry } from './types-arFMsCtn.cjs';
2
- export { aZ as AccessibleVault, ax as AppendInput, p as BLOB_CHUNKS_COLLECTION, q as BLOB_COLLECTION, t as BLOB_INDEX_COLLECTION, u as BLOB_SLOTS_PREFIX, w as BLOB_VERSIONS_PREFIX, a_ as BUNDLE_STORE_POLICY, A as BlobObject, C as BlobPutOptions, E as BlobResponseOptions, F as BlobSet, a$ as BuiltInGateName, b0 as BundleRecipient, _ as CONSENT_AUDIT_COLLECTION, b1 as CacheOptions, b2 as CacheStats, b3 as ChangeEvent, ay as ChangeType, a7 as ClosePeriodOptions, b4 as Collection, b5 as CollectionChangeEvent, b6 as CollectionConflictResolver, ai as CollectionFrame, az as CollectionInstant, b7 as Conflict, b8 as ConflictPolicy, b9 as ConflictStrategy, $ as ConsentAuditEntry, a0 as ConsentAuditFilter, a1 as ConsentContext, a2 as ConsentOp, ba as CrossTierAccessEvent, L as DEFAULT_CHUNK_SIZE, bb as DEFAULT_PUBLIC_ENVELOPE_SCHEMA, bc as DELEGATIONS_COLLECTION, D as DICT_COLLECTION_PREFIX, bd as DeepPartial, be as DelegationToken, bf as DeleteManyResult, a as DictEntry, b as DictKeyDescriptor, c as DictionaryHandle, d as DictionaryOptions, bg as DirtyEntry, bh as ELEVATION_AUDIT_COLLECTION, bi as ElevatedHandle, av as EncryptedEnvelope, bj as EnrollAuthenticatorOptions, bk as ExportCapability, bl as ExportChunk, bm as ExportFormat, bn as ExportStreamOptions, bo as FactorKind, bp as FactorRequirement, bq as GhostRecord, br as GrantOptions, bs as HistoryConfig, bt as HistoryEntry, au as HistoryOptions, e as I18nTextDescriptor, f as I18nTextOptions, bu as INDEXED_STORE_POLICY, bv as ImportCapability, bw as InferOutput, bx as IssueDelegationOptions, by as IssueMagicLinkGrantOptions, aB as JsonPatch, aC as JsonPatchOp, bz as KeyringAuthenticator, bA as KeyringFile, aD as LedgerEntry, aE as LedgerStore, bB as ListAccessibleVaultsOptions, bC as ListPageResult, bD as LiveUserEnvelope, bE as LocaleReadOptions, bF as Lru, bG as LruOptions, bH as LruStats, bI as MAGIC_LINK_CONTENT_INFO_PREFIX, bJ as MAGIC_LINK_GRANTS_COLLECTION, bK as MAGIC_LINK_KEK_INFO_PREFIX, bL as MagicLinkGrantPayload, bM as MagicLinkGrantRecord, bN as NOYDB_BACKUP_VERSION, bO as NOYDB_FORMAT_VERSION, bP as NOYDB_KEYRING_VERSION, bQ as NOYDB_SYNC_VERSION, bR as Noydb, bS as NoydbBundleStore, bT as NoydbEventMap, bU as NoydbOptions, a8 as OpenPeriodOptions, a9 as PERIODS_COLLECTION, bV as PUBLIC_ENVELOPE_FIELDS, bW as PaperRecoveryDoc, bX as PaperRecoveryEntry, bY as PassphrasePolicy, bZ as PassphraseValidationResult, aa as PeriodRecord, b_ as Permission, b$ as Permissions, c0 as PlaintextTranslatorContext, c1 as PlaintextTranslatorFn, P as PolicyEnforcer, c2 as PresenceHandle, c3 as PresencePeer, aw as PruneOptions, c4 as PublicEnvelopeField, c5 as PublicEnvelopeSchema, c6 as PublicEnvelopeText, c7 as PullMode, c8 as PullOptions, c9 as PullPolicy, ca as PullResult, cb as PushMode, cc as PushOptions, cd as PushPolicy, ce as PushResult, cf as PutManyItemOptions, cg as PutManyOptions, ch as PutManyResult, ci as QueryAcrossOptions, cj as QueryAcrossResult, ck as QuickUnlockState, cl as QuickUnlockStore, cm as ReAuthOperation, cn as RecoverPassphraseInput, co as RecoverPassphraseResult, cp as RecoverUserOptions, cq as RecoveryProof, cr as ResolvedPublicEnvelopeSchema, cs as RevokeOptions, aq as Role, ct as RotatePassphraseInput, cu as SessionPolicy, cv as SetPublicEnvelopeInput, U as SlotInfo, V as SlotRecord, cw as StandardSchemaV1, cx as StandardSchemaV1Issue, cy as StandardSchemaV1SyncResult, cz as StoreAuth, cA as StoreAuthKind, cB as StoreCapabilities, cC as SyncEngine, cD as SyncMetadata, cE as SyncPolicy, cF as SyncScheduler, cG as SyncSchedulerStatus, cH as SyncStatus, cI as SyncTarget, cJ as SyncTargetRole, cK as SyncTransaction, cL as SyncTransactionResult, cM as TierMode, cN as TranslatorAuditEntry, al as TxCollection, am as TxContext, cO as TxOp, an as TxVault, cP as USER_ENVELOPE_COLLECTION, cQ as USER_ENVELOPE_MAX_BYTES, cR as Unsubscribe, cS as UserApi, cT as UserEnvelopeCheckGate, cU as UserEnvelopeOversizedError, cV as UserEnvelopePresented, cW as UserInfo, cX as VaultBackup, aF as VaultEngine, aj as VaultFrame, aG as VaultInstant, cY as VaultPolicyOnDisk, cZ as VaultSnapshot, aH as VerifyResult, W as VersionRecord, c_ as WarningRules, c$ as WeakPassphraseError, d0 as WeakPassphraseReason, d1 as WrappedDeksBlob, g as applyI18nLocale, aI as applyPatch, d2 as assertStrongPassphrase, d3 as buildRecipientKeyringFile, d4 as burnPaperRecoveryEntry, aJ as canonicalJson, aK as computePatch, n as createEnforcer, d5 as createNoydb, d6 as createStore, d7 as deriveMagicLinkContentKey, h as dictCollectionName, i as dictKey, aL as diff, d8 as enrollAuthenticator, d9 as estimateEntropy, da as evaluateExportCapability, db as evaluateImportCapability, dc as findAuthenticator, aM as formatDiff, dd as hasExportCapability, de as hasImportCapability, df as hasRecoveryEnrolled, aN as hashEntry, j as i18nText, k as isDictCollectionName, l as isDictKeyDescriptor, m as isI18nTextDescriptor, dg as isMagicLinkGrantExpired, dh as isPublicEnvelope, di as issueDelegation, dj as keyringRecoverPassphrase, dk as keyringRotatePassphrase, dl as listMagicLinkGrants, dm as listUsers, dn as listUsersWithEnvelopes, dp as loadActiveDelegations, dq as loadPaperRecoveryEntries, dr as magicLinkGrantRecordId, ds as mintPaperRecoveryEntry, dt as mintWrappedDeksBlob, aO as paddedIndex, aP as parseIndex, du as readMagicLinkGrantRecord, dv as recoverUser, dw as removeAuthenticator, r as resolveI18nText, dx as resolvePublicEnvelopeSchema, dy as revokeDelegation, dz as revokeMagicLinkGrant, ao as runTransaction, dA as savePaperRecoveryEntries, aQ as sha256Hex, dB as unwrapDeksFromBlob, dC as unwrapDeksFromPaperEntry, dD as unwrapMagicLinkGrant, v as validateI18nTextValue, dE as validatePassphrase, dF as validatePublicEnvelopeInput, dG as validateSchemaInput, dH as validateSchemaOutput, o as validateSessionPolicy, dI as writeMagicLinkGrant } from './types-arFMsCtn.cjs';
1
+ import { aO as NoydbStore, bg as UserEnvelope, bh as PublicEnvelope, bi as GateName, bj as GatePolicy, bk as VaultPolicy, bl as ActiveTier, bm as FactorProof, bn as PersistedSchemaEnvelope, bo as DirectoryConfig, bp as UserVisibility, aM as UnlockedKeyring, bq as Vault, aV as DiffEntry } from './types-C4lwMKKF.cjs';
2
+ export { br as AccessibleVault, aS as AppendInput, ay as ArrayOutputSpec, p as BLOB_CHUNKS_COLLECTION, q as BLOB_COLLECTION, t as BLOB_INDEX_COLLECTION, u as BLOB_SLOTS_PREFIX, w as BLOB_VERSIONS_PREFIX, bs as BUNDLE_STORE_POLICY, A as BlobObject, C as BlobPutOptions, E as BlobResponseOptions, F as BlobSet, bt as BuiltInGateName, bu as BundleRecipient, _ as CONSENT_AUDIT_COLLECTION, bv as CacheOptions, bw as CacheStats, bx as ChangeEvent, aT as ChangeType, a7 as ClosePeriodOptions, aH as Collection, by as CollectionChangeEvent, bz as CollectionConflictResolver, bA as CollectionDescriptor, ao as CollectionFrame, aU as CollectionInstant, bB as CollectionStats, bC as Conflict, bD as ConflictPolicy, bE as ConflictStrategy, $ as ConsentAuditEntry, a0 as ConsentAuditFilter, a1 as ConsentContext, a2 as ConsentOp, bF as CrossTierAccessEvent, L as DEFAULT_CHUNK_SIZE, bG as DEFAULT_PUBLIC_ENVELOPE_SCHEMA, bH as DELEGATIONS_COLLECTION, D as DICT_COLLECTION_PREFIX, bI as DeepPartial, bJ as DeepPartialOrNull, bK as DelegationToken, bL as DeleteManyResult, bM as DerivationDescriptor, aw as DerivationStrategy, aA as DerivationStrategyHandle, aB as DerivedFromMeta, a as DictEntry, b as DictKeyDescriptor, c as DictionaryHandle, d as DictionaryOptions, bN as DirtyEntry, bO as DumpSchemaOptions, bP as ELEVATION_AUDIT_COLLECTION, bQ as ElevatedHandle, aQ as EncryptedEnvelope, bR as EnrollAuthenticatorOptions, bS as EnrollAuthenticatorWrappingDEKsOptions, bT as EnrollAuthenticatorWrappingKEKOptions, bU as EnrollRecoveryResult, bV as ExportCapability, bW as ExportChunk, bX as ExportFormat, bY as ExportStreamOptions, bZ as FactorKind, b_ as FactorProofBundle, b$ as FactorRequirement, c0 as FieldDescriptor, c1 as FieldSource, c2 as GhostRecord, c3 as GrantOptions, ai as GuardChange, aj as GuardContext, ah as GuardStrategy, al as GuardStrategyHandle, c4 as HistoryConfig, c5 as HistoryEntry, aP as HistoryOptions, e as I18nTextDescriptor, f as I18nTextOptions, c6 as INDEXED_STORE_POLICY, c7 as ImportCapability, c8 as InferOutput, c9 as InternalCollectionStats, ca as IssueDelegationOptions, cb as IssueMagicLinkGrantOptions, aW as JsonPatch, aX as JsonPatchOp, cc as KeyringAuthenticator, cd as KeyringAuthenticatorWrappingDEKs, ce as KeyringAuthenticatorWrappingKEK, cf as KeyringFile, aY as LedgerEntry, aZ as LedgerStore, cg as ListAccessibleVaultsOptions, ch as ListPageResult, ci as ListUsersOptions, cj as LiveUserEnvelope, ck as LocaleReadOptions, cl as Lru, cm as LruOptions, cn as LruStats, co as MAGIC_LINK_CONTENT_INFO_PREFIX, cp as MAGIC_LINK_GRANTS_COLLECTION, cq as MAGIC_LINK_KEK_INFO_PREFIX, cr as MagicLinkGrantPayload, cs as MagicLinkGrantRecord, bd as MaterializedFromMeta, ct as MaterializedViewDescriptor, be as MaterializedViewOutput, aE as MaterializedViewStrategy, aF as MaterializedViewStrategyHandle, cu as MemorySealingKeyProvider, cv as NOYDB_BACKUP_VERSION, cw as NOYDB_FORMAT_VERSION, cx as NOYDB_KEYRING_VERSION, cy as NOYDB_SYNC_VERSION, cz as Noydb, cA as NoydbBundleStore, cB as NoydbEventMap, cC as NoydbOptions, a8 as OpenPeriodOptions, aC as OutputSpec, cD as OverlayViewDescriptor, aG as OverlayedViewStrategy, aJ as OverlayedViewStrategyHandle, a9 as PERIODS_COLLECTION, cE as PUBLIC_ENVELOPE_FIELDS, cF as PaperRecoveryDoc, cG as PaperRecoveryEntry, cH as PassphrasePolicy, cI as PassphraseValidationResult, aa as PeriodRecord, cJ as Permission, cK as Permissions, cL as PersistedSchemaKind, cM as PlaintextTranslatorContext, cN as PlaintextTranslatorFn, P as PolicyEnforcer, cO as PresenceHandle, cP as PresencePeer, aR as PruneOptions, cQ as PublicEnvelopeField, cR as PublicEnvelopeSchema, cS as PublicEnvelopeText, cT as PullMode, cU as PullOptions, cV as PullPolicy, cW as PullResult, cX as PushMode, cY as PushOptions, cZ as PushPolicy, c_ as PushResult, c$ as PutManyItemOptions, d0 as PutManyOptions, d1 as PutManyResult, d2 as QueryAcrossOptions, d3 as QueryAcrossResult, d4 as QuickUnlockState, d5 as QuickUnlockStore, d6 as ReAuthOperation, aD as RecordOutputSpec, d7 as RecoverPassphraseInput, d8 as RecoverPassphraseResult, d9 as RecoverUserOptions, da as RecoveryProof, db as ResolvedPublicEnvelopeSchema, dc as RevokeOptions, aL as Role, dd as RotatePassphraseInput, de as RotateRecoveryOptions, df as RotateRecoveryResult, dg as SEALED_PASSPHRASE_RECORD_ID, dh as SealedEnvelope, di as SealedPassphrase, dj as SealingKeyProvider, dk as SessionPolicy, dl as SetPublicEnvelopeInput, dm as ShamirRecoveryDoc, dn as ShamirRecoveryEntry, dp as ShamirRecoveryProvider, U as SlotInfo, V as SlotRecord, dq as SlotRewrapCeremony, dr as SlotRewrapContext, ds as StandardSchemaV1, dt as StandardSchemaV1Issue, du as StandardSchemaV1SyncResult, dv as StoreAuth, dw as StoreAuthKind, dx as StoreCapabilities, dy as SyncEngine, dz as SyncMetadata, dA as SyncPolicy, dB as SyncScheduler, dC as SyncSchedulerStatus, dD as SyncStatus, dE as SyncTarget, dF as SyncTargetRole, dG as SyncTransaction, dH as SyncTransactionResult, dI as TierMode, dJ as TranslatorAuditEntry, as as TxCollection, at as TxContext, dK as TxOp, au as TxVault, dL as USER_ENVELOPE_COLLECTION, dM as USER_ENVELOPE_MAX_BYTES, bf as UnionSource, dN as Unsubscribe, dO as UpdateAuthenticatorOptions, dP as UpdateUserOptions, dQ as UserApi, dR as UserEnvelopeCheckGate, dS as UserEnvelopeOversizedError, dT as UserEnvelopePresented, dU as UserInfo, dV as VaultBackup, a_ as VaultEngine, ap as VaultFrame, a$ as VaultInstant, dW as VaultPolicyOnDisk, dX as VaultSchemaSnapshot, dY as VaultSnapshot, b0 as VerifyResult, W as VersionRecord, dZ as WarningRules, d_ as WeakPassphraseError, d$ as WeakPassphraseReason, e0 as WrappedDeksBlob, g as applyI18nLocale, b1 as applyPatch, e1 as assertStrongPassphrase, e2 as buildRecipientKeyringFile, e3 as burnPaperRecoveryEntry, b2 as canonicalJson, b3 as computePatch, n as createEnforcer, e4 as createNoydb, e5 as createStore, e6 as deriveMagicLinkContentKey, h as dictCollectionName, i as dictKey, b4 as diff, e7 as enrollAuthenticator, e8 as estimateEntropy, e9 as evaluateExportCapability, ea as evaluateImportCapability, eb as findAuthenticator, b5 as formatDiff, ec as hasExportCapability, ed as hasImportCapability, ee as hasRecoveryEnrolled, b6 as hashEntry, j as i18nText, k as isDictCollectionName, l as isDictKeyDescriptor, m as isI18nTextDescriptor, ef as isMagicLinkGrantExpired, eg as isPublicEnvelope, eh as issueDelegation, ei as keyringRecoverPassphrase, ej as keyringRotatePassphrase, ek as listMagicLinkGrants, el as listUsers, em as listUsersWithEnvelopes, en as loadActiveDelegations, eo as loadPaperRecoveryEntries, ep as loadSealedPassphrase, eq as loadShamirRecoveryEntries, er as magicLinkGrantRecordId, es as mintPaperRecoveryEntry, et as mintShamirRecoveryEntry, eu as mintWrappedDeksBlob, b7 as paddedIndex, b8 as parseIndex, ev as parseSealedEnvelope, ew as readMagicLinkGrantRecord, ex as recoverUser, ey as removeAuthenticator, r as resolveI18nText, ez as resolvePublicEnvelopeSchema, eA as revokeDelegation, eB as revokeMagicLinkGrant, av as runTransaction, eC as savePaperRecoveryEntries, eD as saveSealedPassphrase, eE as saveShamirRecoveryEntries, b9 as sha256Hex, eF as unwrapDeksFromBlob, eG as unwrapDeksFromPaperEntry, eH as unwrapDeksFromShamirEntry, eI as unwrapMagicLinkGrant, v as validateI18nTextValue, eJ as validatePassphrase, eK as validatePublicEnvelopeInput, eL as validateSchemaInput, eM as validateSchemaOutput, o as validateSessionPolicy, eN as writeMagicLinkGrant } from './types-C4lwMKKF.cjs';
3
3
  export { d as detectMagic, a as detectMimeType, i as isPreCompressed } from './mime-magic-CBBSOkjm.cjs';
4
4
  export { AgeRoute, BlobLifecyclePolicy, BlobStoreRoute, CircuitBreakerOptions, HealthCheckOptions, LogLevel, LoggingOptions, MetricsOptions, OverrideOptions, OverrideTarget, RetryOptions, RouteStatus, RouteStoreOptions, RoutedNoydbStore, StoreCacheOptions, StoreMiddleware, StoreOperation, SuspendOptions, WrapBundleStoreOptions, WrappedBundleNoydbStore, createBundleStore, routeStore, withCache, withCircuitBreaker, withHealthCheck, withLogging, withMetrics, withRetry, wrapBundleStore, wrapStore } from './store/index.cjs';
5
- import { N as NoydbError } from './index-6xNpPsxR.cjs';
6
- export { A as AlreadyElevatedError, B as BackupCorruptedError, a as BackupLedgerError, b as BundleIntegrityError, c as BundleVersionConflictError, C as ConflictError, D as DEFAULT_JOIN_MAX_ROWS, d as DanglingReferenceError, e as DecryptionError, f as DelegationTargetMissingError, g as DictKeyInUseError, h as DictKeyMissingError, E as ElevationExpiredError, i as ExportCapabilityError, F as FilenameSanitizationError, G as GroupCardinalityError, I as ImportCapabilityError, j as IndexRequiredError, k as IndexWriteFailureError, l as InvalidKeyError, J as JoinContext, m as JoinLeg, n as JoinStrategy, o as JoinTooLargeError, p as JoinableSource, K as KeyringExpiredError, L as LedgerContentionError, q as LiveQuery, r as LiveUpstream, s as LocaleNotSpecifiedError, M as MissingTranslationError, t as NetworkError, u as NoAccessError, v as NotFoundError, O as OrderBy, P as PathEscapeError, w as PeriodClosedError, x as PermissionDeniedError, y as PrivilegeEscalationError, Q as Query, z as QueryPlan, H as QuerySource, R as ReadOnlyAtInstantError, S as ReadOnlyError, T as ReadOnlyFrameError, U as RefDescriptor, V as RefIntegrityError, W as RefMode, X as RefRegistry, Y as RefScopeError, Z as RefViolation, _ as ReservedCollectionNameError, $ as ScanBuilder, a0 as ScanPageProvider, a1 as SchemaValidationError, a2 as SessionExpiredError, a3 as SessionNotFoundError, a4 as SessionPolicyError, a5 as StoreCapabilityError, a6 as TamperedError, a7 as TierDemoteDeniedError, a8 as TierNotGrantedError, a9 as TranslatorNotConfiguredError, aa as ValidationError, ab as applyJoins, ac as buildLiveQuery, ad as executePlan, ae as ref, af as resetJoinWarnings } from './index-6xNpPsxR.cjs';
7
- export { C as CompressionAlgo, N as NOYDB_BUNDLE_FORMAT_VERSION, a as NOYDB_BUNDLE_MAGIC, b as NOYDB_BUNDLE_PREFIX_BYTES, c as NoydbBundleHeader, d as NoydbBundleReadResult, W as WriteNoydbBundleOptions, g as generateULID, h as hasNoydbBundleMagic, i as isULID, r as readNoydbBundle, e as readNoydbBundleHeader, f as readNoydbBundlePublicEnvelope, j as resetBrotliSupportCache, w as writeNoydbBundle } from './index-DsVbTDZI.cjs';
5
+ import { N as NoydbError } from './index-CmVgTkqk.cjs';
6
+ export { q as AlreadyElevatedError, A as AmendmentForbiddenError, B as BackupCorruptedError, r as BackupLedgerError, s as BundleIntegrityError, t as BundleSealMismatchError, u as BundleVersionConflictError, C as ConflictError, v as DEFAULT_JOIN_MAX_ROWS, w as DanglingReferenceError, x as DecryptionError, y as DelegationTargetMissingError, e as DerivationCapExceededError, f as DerivationCycleError, g as DerivationDepthError, h as DerivationOutputShapeError, i as DerivationOutputUnknownError, D as DictKeyInUseError, a as DictKeyMissingError, z as DirectoryDisabledError, E as ElevationExpiredError, G as ExportCapabilityError, F as FieldFrozenError, H as FilenameSanitizationError, J as GroupCardinalityError, K as ImportCapabilityError, P as IndexRequiredError, U as IndexWriteFailureError, V as InvalidKeyError, I as InvariantError, W as JoinContext, X as JoinLeg, Y as JoinStrategy, Z as JoinTooLargeError, _ as JoinableSource, $ as KeyringCorruptError, a0 as KeyringExpiredError, a1 as LedgerContentionError, a2 as LiveQuery, a3 as LiveUpstream, L as LocaleNotSpecifiedError, m as MaterializedViewConfigError, n as MaterializedViewCycleError, o as MaterializedViewSourceUnknownError, p as MaterializedViewTooLargeError, M as MissingTranslationError, a4 as NetworkError, a5 as NoAccessError, a6 as NotFoundError, a7 as OrderBy, O as OverlayBaseIsVirtualError, j as OverlayCollectionUnavailableError, k as OverlayIdMismatchError, l as OverlayNameCollisionError, a8 as PathEscapeError, a9 as PeriodClosedError, aa as PermissionDeniedError, ab as PrivilegeEscalationError, Q as Query, ac as QueryPlan, ad as QuerySource, ae as ReadOnlyAtInstantError, af as ReadOnlyError, ag as ReadOnlyFrameError, d as RecordLockedError, ah as RefDescriptor, ai as RefIntegrityError, aj as RefMode, ak as RefRegistry, al as RefScopeError, am as RefViolation, R as ReservedCollectionNameError, an as ScanBuilder, ao as ScanPageProvider, ap as SchemaValidationError, S as SessionExpiredError, b as SessionNotFoundError, c as SessionPolicyError, aq as StoreCapabilityError, ar as TamperedError, as as TierDemoteDeniedError, at as TierNotGrantedError, T as TranslatorNotConfiguredError, au as ValidationError, av as applyJoins, aw as buildLiveQuery, ax as executePlan, ay as ref, az as resetJoinWarnings } from './index-CmVgTkqk.cjs';
7
+ export { A as AutoCredential, a as AutoCredentialKind, C as CompressionAlgo, N as NOYDB_BUNDLE_FORMAT_VERSION, b as NOYDB_BUNDLE_MAGIC, c as NOYDB_BUNDLE_PREFIX_BYTES, d as NoydbBundleHeader, e as NoydbBundleReadResult, R as ReadNoydbBundleOptions, W as WriteNoydbBundleOptions, g as generateULID, h as hasNoydbBundleMagic, i as isULID, r as readNoydbBundle, f as readNoydbBundleHeader, j as readNoydbBundlePublicEnvelope, k as resetBrotliSupportCache, w as writeNoydbBundle } from './index-hdFvZkBP.cjs';
8
8
  export { a as CrdtMode, b as CrdtState, L as LwwMapState, R as RgaState, Y as YjsState, m as mergeCrdtStates, r as resolveCrdtSnapshot } from './strategy-BSxFXGzb.cjs';
9
+ export { w as withGuard } from './with-guard-jI1x9Z3k.cjs';
10
+ export { w as withDerivation } from './with-derivation-C8LDlV7t.cjs';
11
+ export { w as withMaterializedView } from './with-materialized-view-DcTx4H3j.cjs';
12
+ export { a as Clause, C as CollectionIndexes, F as FieldClause, b as FilterClause, G as GroupClause, H as HashIndex, I as IndexDef, O as Operator, e as evaluateClause, c as evaluateFieldClause, r as readPath } from './predicate-Dnu81tsS.cjs';
13
+ export { w as withOverlayedView } from './with-overlayed-view-D-6oWAgM.cjs';
9
14
  export { SYNC_CREDENTIALS_COLLECTION, SyncCredential, credentialStatus, deleteCredential, getCredential, listCredentials, putCredential } from './team/index.cjs';
10
- export { C as CreateSessionOptions, a as CreateSessionResult, D as DevUnlockOptions, S as SessionToken, b as activeSessionCount, c as clearDevUnlock, d as createSession, e as enableDevUnlock, i as isDevUnlockActive, f as isSessionAlive, l as loadDevUnlock, r as resolveSession, g as revokeAllSessions, h as revokeSession } from './dev-unlock-BZKx666y.cjs';
11
- export { a as Clause, C as CollectionIndexes, F as FieldClause, b as FilterClause, G as GroupClause, H as HashIndex, I as IndexDef, O as Operator, e as evaluateClause, c as evaluateFieldClause, r as readPath } from './predicate-SBHmi6D0.cjs';
12
- export { a as AggregateResult, b as AggregateSpec, c as Aggregation, d as AggregationUpstream, G as GROUPBY_MAX_CARDINALITY, e as GROUPBY_WARN_CARDINALITY, f as GroupedAggregation, g as GroupedQuery, h as GroupedRow, L as LiveAggregation, R as Reducer, i as ReducerOptions, j as avg, l as count, m as groupAndReduce, n as max, o as min, r as reduceRecords, s as sum } from './strategy-D-SrOLCl.cjs';
13
- export { L as LEDGER_COLLECTION, a as LEDGER_DELTAS_COLLECTION, e as envelopePayloadHash } from './hash-CIyfmKsg.cjs';
14
- import './lazy-builder-CZVLKh0Z.cjs';
15
+ export { C as CreateSessionOptions, a as CreateSessionResult, D as DevUnlockOptions, S as SessionToken, b as activeSessionCount, c as clearDevUnlock, d as createSession, e as enableDevUnlock, i as isDevUnlockActive, f as isSessionAlive, l as loadDevUnlock, r as resolveSession, g as revokeAllSessions, h as revokeSession } from './dev-unlock-DRwVSy2S.cjs';
16
+ export { a as AggregateResult, b as AggregateSpec, c as Aggregation, d as AggregationUpstream, G as GROUPBY_MAX_CARDINALITY, e as GROUPBY_WARN_CARDINALITY, f as GroupedAggregation, g as GroupedQuery, h as GroupedQueryN, i as GroupedRow, j as GroupedRowN, L as LiveAggregation, R as Reducer, k as ReducerOptions, l as avg, n as count, o as groupAndReduce, p as max, q as min, r as reduceRecords, t as sum } from './strategy-DSTrsZ8t.cjs';
17
+ export { L as LEDGER_COLLECTION, a as LEDGER_DELTAS_COLLECTION, e as envelopePayloadHash } from './hash-DtRih9MQ.cjs';
18
+ import './lazy-builder-C-rPfWG0.cjs';
15
19
 
16
20
  /**
17
21
  * Persistence helpers for per-principal user envelopes stored at
@@ -164,13 +168,39 @@ declare class RecoveryNotEnrolledError extends NoydbError {
164
168
  constructor(message?: string);
165
169
  }
166
170
  /**
167
- * Raised by `db.recoverPassphrase` when the developer requests a
168
- * recovery profile other than `'paper'` in v0.1.0-pre.5. The other
169
- * three profiles (Shamir, multi-channel, admin-mediated) ship the API
170
- * shape now; their per-profile dispatch lands in follow-up issues.
171
+ * Raised by `openVault` when a managed-passphrase-mode vault has no
172
+ * STRONG recovery profile enrolled (#195).
173
+ *
174
+ * Managed mode means the user never types a passphrase — the unlock
175
+ * material lives in a `SealingKeyProvider` (`at-*` package). If that
176
+ * provider's key is lost AND no strong recovery is enrolled, the
177
+ * vault is irrecoverable. To prevent that footgun, managed-mode vaults
178
+ * require at least one strong recovery profile (Shamir today;
179
+ * multi-channel / admin-mediated when those ship).
180
+ *
181
+ * Paper recovery alone is NOT strong under managed mode: the user has
182
+ * no memorized passphrase to fall back on, so losing the paper sheet =
183
+ * losing every record permanently.
184
+ *
185
+ * Bootstrap with `db.openVaultAndEnrollRecovery(vault, { recovery: [{ profile: "shamir", k, n }] })`
186
+ * to atomically create-and-enroll, or call `db.enrollRecovery(vault, { profile: "shamir", ... })`
187
+ * separately before re-attempting `openVault`.
188
+ */
189
+ declare class ManagedRecoveryNotEnrolledError extends NoydbError {
190
+ readonly vault: string;
191
+ constructor(vault: string);
192
+ }
193
+ /**
194
+ * Raised by `db.recoverPassphrase` / `db.enrollRecovery` /
195
+ * `db.rotateRecovery` when the developer requests a recovery profile
196
+ * not yet wired in this hub release.
197
+ *
198
+ * Implemented: `paper` (#10, pre.5) and `shamir` (#196 slice 1, pre.16).
199
+ * Pending: `multi-channel` and `admin-mediated` (tracked under #196
200
+ * follow-up slices).
171
201
  *
172
202
  * The carried `profile` and `tracking` fields let consumers steer the
173
- * UI ("Shamir recovery is not yet wired up — open issue #N to follow").
203
+ * UI ("multi-channel recovery is not yet wired up — open issue #N to follow").
174
204
  */
175
205
  declare class RecoveryProfileNotImplementedError extends NoydbError {
176
206
  readonly profile: string;
@@ -308,6 +338,89 @@ declare function loadVaultPolicy(store: NoydbStore, vault: string): Promise<Vaul
308
338
  */
309
339
  declare function saveVaultPolicy(store: NoydbStore, vault: string, policy: VaultPolicy): Promise<void>;
310
340
 
341
+ /**
342
+ * Derive a {@link PersistedSchemaEnvelope} from a Standard Schema v1
343
+ * validator. v0 supports Zod via `zod-to-json-schema` (optional peer-dep);
344
+ * other families write a stub envelope flagging the kind.
345
+ *
346
+ * @see docs/superpowers/specs/2026-05-22-schema-dump-design.md
347
+ *
348
+ * @module
349
+ */
350
+
351
+ /**
352
+ * Heuristic Zod detection — Zod schemas carry a `_def.typeName` property
353
+ * starting with `Zod` (e.g. `ZodObject`, `ZodString`). This survives Zod's
354
+ * minor-version bumps because the typeName naming is stable across v3.
355
+ */
356
+ declare function isZodSchema(value: unknown): boolean;
357
+ declare function derivePersistedSchema(validator: unknown): Promise<PersistedSchemaEnvelope>;
358
+
359
+ /**
360
+ * Read / write the per-collection persisted-schema envelope. Mirrors the
361
+ * standard noy-db record envelope shape and is **AES-GCM encrypted with
362
+ * the collection's DEK** — the schema body (field names, enum values,
363
+ * constraints) is sensitive metadata, so it gets the same encryption
364
+ * envelope as the records it describes.
365
+ *
366
+ * Storage layout:
367
+ *
368
+ * <vault>/_schemas/<collection> → EncryptedEnvelope
369
+ *
370
+ * The DEK passed to {@link savePersistedSchema} / {@link loadPersistedSchema}
371
+ * is the same key the collection uses for its records.
372
+ *
373
+ * @module
374
+ */
375
+
376
+ /** Reserved collection name where persisted schemas live. */
377
+ declare const SCHEMAS_COLLECTION: "_schemas";
378
+ /**
379
+ * Read and decrypt the persisted-schema envelope for one collection.
380
+ * Returns `undefined` when no envelope has been written or when decryption
381
+ * fails (e.g. wrong DEK passed). Tolerates corrupted records — JSON parse
382
+ * failures surface as `undefined`, mirroring `_meta/handle`'s contract.
383
+ */
384
+ declare function loadPersistedSchema(store: NoydbStore, vault: string, collection: string, dek: CryptoKey): Promise<PersistedSchemaEnvelope | undefined>;
385
+ /**
386
+ * Encrypt and persist a schema envelope for one collection. Always
387
+ * overwrites any prior write (callers gate on hash equality before calling
388
+ * to avoid no-op writes).
389
+ */
390
+ declare function savePersistedSchema(store: NoydbStore, vault: string, collection: string, dek: CryptoKey, payload: PersistedSchemaEnvelope): Promise<void>;
391
+
392
+ /**
393
+ * Orchestrate the derive → hash → skip-or-write cycle for a collection's
394
+ * persisted JSON Schema. Called by the Vault at collection-registration
395
+ * time when the developer opts in via `collection({ persistJsonSchema:
396
+ * true })`.
397
+ *
398
+ * Skip semantics:
399
+ *
400
+ * - Zod validators: skip when the new hash equals the stored hash.
401
+ * - Non-Zod (stub envelopes have hash=null): skip when the stored
402
+ * envelope's `kind` matches the freshly-detected kind (since there's
403
+ * no body to compare yet — a kind change is the only signal).
404
+ *
405
+ * @module
406
+ */
407
+
408
+ interface PersistSchemaResult {
409
+ /** True when a fresh envelope was written to storage. */
410
+ readonly written: boolean;
411
+ /** True when an existing envelope matched and the write was skipped. */
412
+ readonly skipped: boolean;
413
+ /** The envelope that was either written or matched. */
414
+ readonly envelope: PersistedSchemaEnvelope;
415
+ }
416
+ declare function persistSchemaIfNeeded(opts: {
417
+ readonly store: NoydbStore;
418
+ readonly vault: string;
419
+ readonly collectionName: string;
420
+ readonly validator: unknown;
421
+ readonly dek: CryptoKey;
422
+ }): Promise<PersistSchemaResult>;
423
+
311
424
  /**
312
425
  * Authentication introspection — issue #13.
313
426
  *
@@ -353,6 +466,84 @@ declare function describeAllUsersAuth(store: NoydbStore, vault: string): Promise
353
466
  description: string;
354
467
  }>>;
355
468
 
469
+ /**
470
+ * Persistence helpers for the vault-level user-directory toggle
471
+ * (`_meta/directory`). Mirrors the bypass-AES pattern used by
472
+ * `_meta/policy` — the directory document is plain JSON, the
473
+ * envelope's `_iv` field is left empty.
474
+ *
475
+ * @see docs/subsystems/user-envelope.md → Directory visibility
476
+ * @see docs/subsystems/plaintext-bypass.md — every `_iv: ''` write site
477
+ *
478
+ * @module
479
+ */
480
+
481
+ /** Reserved id for the vault-level directory document. */
482
+ declare const DIRECTORY_RECORD_ID = "directory";
483
+ /**
484
+ * Read the directory toggle from `_meta/directory`. Returns `undefined`
485
+ * when no document has been persisted — callers treat that as the
486
+ * default-on case (`{ enabled: true }`).
487
+ *
488
+ * Tolerates corrupted documents the same way `_meta/policy` does: a
489
+ * JSON parse failure surfaces as `undefined`, not a thrown error, so a
490
+ * bad write never permanently breaks team enumeration.
491
+ */
492
+ declare function readDirectoryConfig(store: NoydbStore, vault: string): Promise<DirectoryConfig | undefined>;
493
+ /**
494
+ * Persist the directory toggle at `_meta/directory`. Idempotent — call
495
+ * on every `db.setDirectoryEnabled()` invocation. Owner-only at the
496
+ * caller site; this primitive does not check roles.
497
+ */
498
+ declare function persistDirectoryConfig(store: NoydbStore, vault: string, config: DirectoryConfig): Promise<void>;
499
+
500
+ /**
501
+ * Persistence helpers for the per-user visibility flag
502
+ * (`_meta/visibility/<keyringId>`). Mirrors the bypass-AES pattern used
503
+ * by `_meta/policy` — the visibility document is plain JSON, the
504
+ * envelope's `_iv` field is left empty.
505
+ *
506
+ * Stored alongside the keyring file rather than inside the encrypted
507
+ * user envelope (`_users/<keyringId>`) because:
508
+ *
509
+ * - `UserEnvelope<T>.data` is opaque-to-hub by contract — hub does not
510
+ * introspect or reserve any keys inside it. Adding `hidden` there
511
+ * would violate that contract.
512
+ * - `listUsersWithEnvelopes` filters by the flag, and the filter must
513
+ * work even when decryption fails (legacy keyrings predating the
514
+ * envelope feature, or a corrupted envelope).
515
+ *
516
+ * @see docs/subsystems/user-envelope.md → Directory visibility
517
+ * @see docs/subsystems/plaintext-bypass.md — every `_iv: ''` write site
518
+ *
519
+ * @module
520
+ */
521
+
522
+ /** Prefix for per-user visibility records inside `_meta`. */
523
+ declare const VISIBILITY_RECORD_PREFIX = "visibility/";
524
+ /** Compose the `_meta` record id for a keyring's visibility doc. */
525
+ declare function visibilityRecordId(keyringId: string): string;
526
+ /**
527
+ * Read the visibility flag for `keyringId`. Returns `undefined` when no
528
+ * document has been persisted — callers treat that as the default-visible
529
+ * case (`{ hidden: false }`).
530
+ */
531
+ declare function readUserVisibility(store: NoydbStore, vault: string, keyringId: string): Promise<UserVisibility | undefined>;
532
+ /**
533
+ * Persist the visibility flag for `keyringId` at
534
+ * `_meta/visibility/<keyringId>`. Idempotent — call on every
535
+ * `vault.user.setMyVisibility()` invocation. Own-only at the caller
536
+ * site; this primitive does not enforce keyring ownership.
537
+ */
538
+ declare function persistUserVisibility(store: NoydbStore, vault: string, keyringId: string, visibility: UserVisibility): Promise<void>;
539
+ /**
540
+ * Delete the visibility flag for `keyringId`. Called from `revoke()`
541
+ * alongside `deleteUserEnvelope` so the sidecar does not leak to a
542
+ * re-granted principal with the same `userId`. Idempotent — the store's
543
+ * `delete()` is already a no-op when the record is absent.
544
+ */
545
+ declare function deleteUserVisibility(store: NoydbStore, vault: string, keyringId: string): Promise<void>;
546
+
356
547
  interface EncryptResult {
357
548
  iv: string;
358
549
  data: string;
@@ -562,4 +753,4 @@ type DiffCandidate<T = unknown> = Vault | Record<string, readonly T[]> | string;
562
753
  */
563
754
  declare function diffVault<T = unknown>(vault: Vault, candidate: DiffCandidate<T>, options?: DiffOptions): Promise<VaultDiff<T>>;
564
755
 
565
- export { ActiveTier, type CheckGateContext, DEFAULT_FRESHNESS_MS, type DiffCandidate, DiffEntry, type DiffOptions, FactorProof, GateName, GatePolicy, META_COLLECTION, NoydbError, NoydbStore, PERSONAL_POLICY, POLICY_RECORD_ID, PUBLIC_ENVELOPE_RECORD_ID, PolicyDeniedError, type PolicyDenyReason, PublicEnvelope, RecoveryNotEnrolledError, RecoveryProfileNotImplementedError, STRICT_POLICY, UnlockedKeyring, UserEnvelope, Vault, type VaultDiff, type VaultDiffEntry, type VaultDiffModifiedEntry, VaultPolicy, assertTierAccess, base64ToBuffer, bufferToBase64, checkGate, decryptBytes, decryptDeterministic, dekKey, deleteUserEnvelope, derivePresenceKey, describeAllUsersAuth, describeAuthConfig, describeGate, describeUserAuth, diagramAuthConfig, diffVault, effectiveClearance, encryptBytes, encryptDeterministic, estimateRecordBytes, listUserEnvelopeIds, loadPublicEnvelope, loadUserEnvelope, loadVaultPolicy, mergePolicy, parseBytes, readPublicEnvelope, savePublicEnvelope, saveUserEnvelope, saveVaultPolicy };
756
+ export { ActiveTier, type CheckGateContext, DEFAULT_FRESHNESS_MS, DIRECTORY_RECORD_ID, type DiffCandidate, DiffEntry, type DiffOptions, DirectoryConfig, FactorProof, GateName, GatePolicy, META_COLLECTION, ManagedRecoveryNotEnrolledError, NoydbError, NoydbStore, PERSONAL_POLICY, POLICY_RECORD_ID, PUBLIC_ENVELOPE_RECORD_ID, type PersistSchemaResult, PersistedSchemaEnvelope, PolicyDeniedError, type PolicyDenyReason, PublicEnvelope, RecoveryNotEnrolledError, RecoveryProfileNotImplementedError, SCHEMAS_COLLECTION, STRICT_POLICY, UnlockedKeyring, UserEnvelope, UserVisibility, VISIBILITY_RECORD_PREFIX, Vault, type VaultDiff, type VaultDiffEntry, type VaultDiffModifiedEntry, VaultPolicy, assertTierAccess, base64ToBuffer, bufferToBase64, checkGate, decryptBytes, decryptDeterministic, dekKey, deleteUserEnvelope, deleteUserVisibility, derivePersistedSchema, derivePresenceKey, describeAllUsersAuth, describeAuthConfig, describeGate, describeUserAuth, diagramAuthConfig, diffVault, effectiveClearance, encryptBytes, encryptDeterministic, estimateRecordBytes, isZodSchema, listUserEnvelopeIds, loadPersistedSchema, loadPublicEnvelope, loadUserEnvelope, loadVaultPolicy, mergePolicy, parseBytes, persistDirectoryConfig, persistSchemaIfNeeded, persistUserVisibility, readDirectoryConfig, readPublicEnvelope, readUserVisibility, savePersistedSchema, savePublicEnvelope, saveUserEnvelope, saveVaultPolicy, visibilityRecordId };
package/dist/index.d.ts CHANGED
@@ -1,17 +1,21 @@
1
- import { at as NoydbStore, aR as UserEnvelope, aS as PublicEnvelope, aT as GateName, aU as GatePolicy, aV as VaultPolicy, aW as ActiveTier, aX as FactorProof, ar as UnlockedKeyring, aY as Vault, aA as DiffEntry } from './types-DD9eKKNc.js';
2
- export { aZ as AccessibleVault, ax as AppendInput, p as BLOB_CHUNKS_COLLECTION, q as BLOB_COLLECTION, t as BLOB_INDEX_COLLECTION, u as BLOB_SLOTS_PREFIX, w as BLOB_VERSIONS_PREFIX, a_ as BUNDLE_STORE_POLICY, A as BlobObject, C as BlobPutOptions, E as BlobResponseOptions, F as BlobSet, a$ as BuiltInGateName, b0 as BundleRecipient, _ as CONSENT_AUDIT_COLLECTION, b1 as CacheOptions, b2 as CacheStats, b3 as ChangeEvent, ay as ChangeType, a7 as ClosePeriodOptions, b4 as Collection, b5 as CollectionChangeEvent, b6 as CollectionConflictResolver, ai as CollectionFrame, az as CollectionInstant, b7 as Conflict, b8 as ConflictPolicy, b9 as ConflictStrategy, $ as ConsentAuditEntry, a0 as ConsentAuditFilter, a1 as ConsentContext, a2 as ConsentOp, ba as CrossTierAccessEvent, L as DEFAULT_CHUNK_SIZE, bb as DEFAULT_PUBLIC_ENVELOPE_SCHEMA, bc as DELEGATIONS_COLLECTION, D as DICT_COLLECTION_PREFIX, bd as DeepPartial, be as DelegationToken, bf as DeleteManyResult, a as DictEntry, b as DictKeyDescriptor, c as DictionaryHandle, d as DictionaryOptions, bg as DirtyEntry, bh as ELEVATION_AUDIT_COLLECTION, bi as ElevatedHandle, av as EncryptedEnvelope, bj as EnrollAuthenticatorOptions, bk as ExportCapability, bl as ExportChunk, bm as ExportFormat, bn as ExportStreamOptions, bo as FactorKind, bp as FactorRequirement, bq as GhostRecord, br as GrantOptions, bs as HistoryConfig, bt as HistoryEntry, au as HistoryOptions, e as I18nTextDescriptor, f as I18nTextOptions, bu as INDEXED_STORE_POLICY, bv as ImportCapability, bw as InferOutput, bx as IssueDelegationOptions, by as IssueMagicLinkGrantOptions, aB as JsonPatch, aC as JsonPatchOp, bz as KeyringAuthenticator, bA as KeyringFile, aD as LedgerEntry, aE as LedgerStore, bB as ListAccessibleVaultsOptions, bC as ListPageResult, bD as LiveUserEnvelope, bE as LocaleReadOptions, bF as Lru, bG as LruOptions, bH as LruStats, bI as MAGIC_LINK_CONTENT_INFO_PREFIX, bJ as MAGIC_LINK_GRANTS_COLLECTION, bK as MAGIC_LINK_KEK_INFO_PREFIX, bL as MagicLinkGrantPayload, bM as MagicLinkGrantRecord, bN as NOYDB_BACKUP_VERSION, bO as NOYDB_FORMAT_VERSION, bP as NOYDB_KEYRING_VERSION, bQ as NOYDB_SYNC_VERSION, bR as Noydb, bS as NoydbBundleStore, bT as NoydbEventMap, bU as NoydbOptions, a8 as OpenPeriodOptions, a9 as PERIODS_COLLECTION, bV as PUBLIC_ENVELOPE_FIELDS, bW as PaperRecoveryDoc, bX as PaperRecoveryEntry, bY as PassphrasePolicy, bZ as PassphraseValidationResult, aa as PeriodRecord, b_ as Permission, b$ as Permissions, c0 as PlaintextTranslatorContext, c1 as PlaintextTranslatorFn, P as PolicyEnforcer, c2 as PresenceHandle, c3 as PresencePeer, aw as PruneOptions, c4 as PublicEnvelopeField, c5 as PublicEnvelopeSchema, c6 as PublicEnvelopeText, c7 as PullMode, c8 as PullOptions, c9 as PullPolicy, ca as PullResult, cb as PushMode, cc as PushOptions, cd as PushPolicy, ce as PushResult, cf as PutManyItemOptions, cg as PutManyOptions, ch as PutManyResult, ci as QueryAcrossOptions, cj as QueryAcrossResult, ck as QuickUnlockState, cl as QuickUnlockStore, cm as ReAuthOperation, cn as RecoverPassphraseInput, co as RecoverPassphraseResult, cp as RecoverUserOptions, cq as RecoveryProof, cr as ResolvedPublicEnvelopeSchema, cs as RevokeOptions, aq as Role, ct as RotatePassphraseInput, cu as SessionPolicy, cv as SetPublicEnvelopeInput, U as SlotInfo, V as SlotRecord, cw as StandardSchemaV1, cx as StandardSchemaV1Issue, cy as StandardSchemaV1SyncResult, cz as StoreAuth, cA as StoreAuthKind, cB as StoreCapabilities, cC as SyncEngine, cD as SyncMetadata, cE as SyncPolicy, cF as SyncScheduler, cG as SyncSchedulerStatus, cH as SyncStatus, cI as SyncTarget, cJ as SyncTargetRole, cK as SyncTransaction, cL as SyncTransactionResult, cM as TierMode, cN as TranslatorAuditEntry, al as TxCollection, am as TxContext, cO as TxOp, an as TxVault, cP as USER_ENVELOPE_COLLECTION, cQ as USER_ENVELOPE_MAX_BYTES, cR as Unsubscribe, cS as UserApi, cT as UserEnvelopeCheckGate, cU as UserEnvelopeOversizedError, cV as UserEnvelopePresented, cW as UserInfo, cX as VaultBackup, aF as VaultEngine, aj as VaultFrame, aG as VaultInstant, cY as VaultPolicyOnDisk, cZ as VaultSnapshot, aH as VerifyResult, W as VersionRecord, c_ as WarningRules, c$ as WeakPassphraseError, d0 as WeakPassphraseReason, d1 as WrappedDeksBlob, g as applyI18nLocale, aI as applyPatch, d2 as assertStrongPassphrase, d3 as buildRecipientKeyringFile, d4 as burnPaperRecoveryEntry, aJ as canonicalJson, aK as computePatch, n as createEnforcer, d5 as createNoydb, d6 as createStore, d7 as deriveMagicLinkContentKey, h as dictCollectionName, i as dictKey, aL as diff, d8 as enrollAuthenticator, d9 as estimateEntropy, da as evaluateExportCapability, db as evaluateImportCapability, dc as findAuthenticator, aM as formatDiff, dd as hasExportCapability, de as hasImportCapability, df as hasRecoveryEnrolled, aN as hashEntry, j as i18nText, k as isDictCollectionName, l as isDictKeyDescriptor, m as isI18nTextDescriptor, dg as isMagicLinkGrantExpired, dh as isPublicEnvelope, di as issueDelegation, dj as keyringRecoverPassphrase, dk as keyringRotatePassphrase, dl as listMagicLinkGrants, dm as listUsers, dn as listUsersWithEnvelopes, dp as loadActiveDelegations, dq as loadPaperRecoveryEntries, dr as magicLinkGrantRecordId, ds as mintPaperRecoveryEntry, dt as mintWrappedDeksBlob, aO as paddedIndex, aP as parseIndex, du as readMagicLinkGrantRecord, dv as recoverUser, dw as removeAuthenticator, r as resolveI18nText, dx as resolvePublicEnvelopeSchema, dy as revokeDelegation, dz as revokeMagicLinkGrant, ao as runTransaction, dA as savePaperRecoveryEntries, aQ as sha256Hex, dB as unwrapDeksFromBlob, dC as unwrapDeksFromPaperEntry, dD as unwrapMagicLinkGrant, v as validateI18nTextValue, dE as validatePassphrase, dF as validatePublicEnvelopeInput, dG as validateSchemaInput, dH as validateSchemaOutput, o as validateSessionPolicy, dI as writeMagicLinkGrant } from './types-DD9eKKNc.js';
1
+ import { aO as NoydbStore, bg as UserEnvelope, bh as PublicEnvelope, bi as GateName, bj as GatePolicy, bk as VaultPolicy, bl as ActiveTier, bm as FactorProof, bn as PersistedSchemaEnvelope, bo as DirectoryConfig, bp as UserVisibility, aM as UnlockedKeyring, bq as Vault, aV as DiffEntry } from './types-DW9RGSSs.js';
2
+ export { br as AccessibleVault, aS as AppendInput, ay as ArrayOutputSpec, p as BLOB_CHUNKS_COLLECTION, q as BLOB_COLLECTION, t as BLOB_INDEX_COLLECTION, u as BLOB_SLOTS_PREFIX, w as BLOB_VERSIONS_PREFIX, bs as BUNDLE_STORE_POLICY, A as BlobObject, C as BlobPutOptions, E as BlobResponseOptions, F as BlobSet, bt as BuiltInGateName, bu as BundleRecipient, _ as CONSENT_AUDIT_COLLECTION, bv as CacheOptions, bw as CacheStats, bx as ChangeEvent, aT as ChangeType, a7 as ClosePeriodOptions, aH as Collection, by as CollectionChangeEvent, bz as CollectionConflictResolver, bA as CollectionDescriptor, ao as CollectionFrame, aU as CollectionInstant, bB as CollectionStats, bC as Conflict, bD as ConflictPolicy, bE as ConflictStrategy, $ as ConsentAuditEntry, a0 as ConsentAuditFilter, a1 as ConsentContext, a2 as ConsentOp, bF as CrossTierAccessEvent, L as DEFAULT_CHUNK_SIZE, bG as DEFAULT_PUBLIC_ENVELOPE_SCHEMA, bH as DELEGATIONS_COLLECTION, D as DICT_COLLECTION_PREFIX, bI as DeepPartial, bJ as DeepPartialOrNull, bK as DelegationToken, bL as DeleteManyResult, bM as DerivationDescriptor, aw as DerivationStrategy, aA as DerivationStrategyHandle, aB as DerivedFromMeta, a as DictEntry, b as DictKeyDescriptor, c as DictionaryHandle, d as DictionaryOptions, bN as DirtyEntry, bO as DumpSchemaOptions, bP as ELEVATION_AUDIT_COLLECTION, bQ as ElevatedHandle, aQ as EncryptedEnvelope, bR as EnrollAuthenticatorOptions, bS as EnrollAuthenticatorWrappingDEKsOptions, bT as EnrollAuthenticatorWrappingKEKOptions, bU as EnrollRecoveryResult, bV as ExportCapability, bW as ExportChunk, bX as ExportFormat, bY as ExportStreamOptions, bZ as FactorKind, b_ as FactorProofBundle, b$ as FactorRequirement, c0 as FieldDescriptor, c1 as FieldSource, c2 as GhostRecord, c3 as GrantOptions, ai as GuardChange, aj as GuardContext, ah as GuardStrategy, al as GuardStrategyHandle, c4 as HistoryConfig, c5 as HistoryEntry, aP as HistoryOptions, e as I18nTextDescriptor, f as I18nTextOptions, c6 as INDEXED_STORE_POLICY, c7 as ImportCapability, c8 as InferOutput, c9 as InternalCollectionStats, ca as IssueDelegationOptions, cb as IssueMagicLinkGrantOptions, aW as JsonPatch, aX as JsonPatchOp, cc as KeyringAuthenticator, cd as KeyringAuthenticatorWrappingDEKs, ce as KeyringAuthenticatorWrappingKEK, cf as KeyringFile, aY as LedgerEntry, aZ as LedgerStore, cg as ListAccessibleVaultsOptions, ch as ListPageResult, ci as ListUsersOptions, cj as LiveUserEnvelope, ck as LocaleReadOptions, cl as Lru, cm as LruOptions, cn as LruStats, co as MAGIC_LINK_CONTENT_INFO_PREFIX, cp as MAGIC_LINK_GRANTS_COLLECTION, cq as MAGIC_LINK_KEK_INFO_PREFIX, cr as MagicLinkGrantPayload, cs as MagicLinkGrantRecord, bd as MaterializedFromMeta, ct as MaterializedViewDescriptor, be as MaterializedViewOutput, aE as MaterializedViewStrategy, aF as MaterializedViewStrategyHandle, cu as MemorySealingKeyProvider, cv as NOYDB_BACKUP_VERSION, cw as NOYDB_FORMAT_VERSION, cx as NOYDB_KEYRING_VERSION, cy as NOYDB_SYNC_VERSION, cz as Noydb, cA as NoydbBundleStore, cB as NoydbEventMap, cC as NoydbOptions, a8 as OpenPeriodOptions, aC as OutputSpec, cD as OverlayViewDescriptor, aG as OverlayedViewStrategy, aJ as OverlayedViewStrategyHandle, a9 as PERIODS_COLLECTION, cE as PUBLIC_ENVELOPE_FIELDS, cF as PaperRecoveryDoc, cG as PaperRecoveryEntry, cH as PassphrasePolicy, cI as PassphraseValidationResult, aa as PeriodRecord, cJ as Permission, cK as Permissions, cL as PersistedSchemaKind, cM as PlaintextTranslatorContext, cN as PlaintextTranslatorFn, P as PolicyEnforcer, cO as PresenceHandle, cP as PresencePeer, aR as PruneOptions, cQ as PublicEnvelopeField, cR as PublicEnvelopeSchema, cS as PublicEnvelopeText, cT as PullMode, cU as PullOptions, cV as PullPolicy, cW as PullResult, cX as PushMode, cY as PushOptions, cZ as PushPolicy, c_ as PushResult, c$ as PutManyItemOptions, d0 as PutManyOptions, d1 as PutManyResult, d2 as QueryAcrossOptions, d3 as QueryAcrossResult, d4 as QuickUnlockState, d5 as QuickUnlockStore, d6 as ReAuthOperation, aD as RecordOutputSpec, d7 as RecoverPassphraseInput, d8 as RecoverPassphraseResult, d9 as RecoverUserOptions, da as RecoveryProof, db as ResolvedPublicEnvelopeSchema, dc as RevokeOptions, aL as Role, dd as RotatePassphraseInput, de as RotateRecoveryOptions, df as RotateRecoveryResult, dg as SEALED_PASSPHRASE_RECORD_ID, dh as SealedEnvelope, di as SealedPassphrase, dj as SealingKeyProvider, dk as SessionPolicy, dl as SetPublicEnvelopeInput, dm as ShamirRecoveryDoc, dn as ShamirRecoveryEntry, dp as ShamirRecoveryProvider, U as SlotInfo, V as SlotRecord, dq as SlotRewrapCeremony, dr as SlotRewrapContext, ds as StandardSchemaV1, dt as StandardSchemaV1Issue, du as StandardSchemaV1SyncResult, dv as StoreAuth, dw as StoreAuthKind, dx as StoreCapabilities, dy as SyncEngine, dz as SyncMetadata, dA as SyncPolicy, dB as SyncScheduler, dC as SyncSchedulerStatus, dD as SyncStatus, dE as SyncTarget, dF as SyncTargetRole, dG as SyncTransaction, dH as SyncTransactionResult, dI as TierMode, dJ as TranslatorAuditEntry, as as TxCollection, at as TxContext, dK as TxOp, au as TxVault, dL as USER_ENVELOPE_COLLECTION, dM as USER_ENVELOPE_MAX_BYTES, bf as UnionSource, dN as Unsubscribe, dO as UpdateAuthenticatorOptions, dP as UpdateUserOptions, dQ as UserApi, dR as UserEnvelopeCheckGate, dS as UserEnvelopeOversizedError, dT as UserEnvelopePresented, dU as UserInfo, dV as VaultBackup, a_ as VaultEngine, ap as VaultFrame, a$ as VaultInstant, dW as VaultPolicyOnDisk, dX as VaultSchemaSnapshot, dY as VaultSnapshot, b0 as VerifyResult, W as VersionRecord, dZ as WarningRules, d_ as WeakPassphraseError, d$ as WeakPassphraseReason, e0 as WrappedDeksBlob, g as applyI18nLocale, b1 as applyPatch, e1 as assertStrongPassphrase, e2 as buildRecipientKeyringFile, e3 as burnPaperRecoveryEntry, b2 as canonicalJson, b3 as computePatch, n as createEnforcer, e4 as createNoydb, e5 as createStore, e6 as deriveMagicLinkContentKey, h as dictCollectionName, i as dictKey, b4 as diff, e7 as enrollAuthenticator, e8 as estimateEntropy, e9 as evaluateExportCapability, ea as evaluateImportCapability, eb as findAuthenticator, b5 as formatDiff, ec as hasExportCapability, ed as hasImportCapability, ee as hasRecoveryEnrolled, b6 as hashEntry, j as i18nText, k as isDictCollectionName, l as isDictKeyDescriptor, m as isI18nTextDescriptor, ef as isMagicLinkGrantExpired, eg as isPublicEnvelope, eh as issueDelegation, ei as keyringRecoverPassphrase, ej as keyringRotatePassphrase, ek as listMagicLinkGrants, el as listUsers, em as listUsersWithEnvelopes, en as loadActiveDelegations, eo as loadPaperRecoveryEntries, ep as loadSealedPassphrase, eq as loadShamirRecoveryEntries, er as magicLinkGrantRecordId, es as mintPaperRecoveryEntry, et as mintShamirRecoveryEntry, eu as mintWrappedDeksBlob, b7 as paddedIndex, b8 as parseIndex, ev as parseSealedEnvelope, ew as readMagicLinkGrantRecord, ex as recoverUser, ey as removeAuthenticator, r as resolveI18nText, ez as resolvePublicEnvelopeSchema, eA as revokeDelegation, eB as revokeMagicLinkGrant, av as runTransaction, eC as savePaperRecoveryEntries, eD as saveSealedPassphrase, eE as saveShamirRecoveryEntries, b9 as sha256Hex, eF as unwrapDeksFromBlob, eG as unwrapDeksFromPaperEntry, eH as unwrapDeksFromShamirEntry, eI as unwrapMagicLinkGrant, v as validateI18nTextValue, eJ as validatePassphrase, eK as validatePublicEnvelopeInput, eL as validateSchemaInput, eM as validateSchemaOutput, o as validateSessionPolicy, eN as writeMagicLinkGrant } from './types-DW9RGSSs.js';
3
3
  export { d as detectMagic, a as detectMimeType, i as isPreCompressed } from './mime-magic-CBBSOkjm.js';
4
4
  export { AgeRoute, BlobLifecyclePolicy, BlobStoreRoute, CircuitBreakerOptions, HealthCheckOptions, LogLevel, LoggingOptions, MetricsOptions, OverrideOptions, OverrideTarget, RetryOptions, RouteStatus, RouteStoreOptions, RoutedNoydbStore, StoreCacheOptions, StoreMiddleware, StoreOperation, SuspendOptions, WrapBundleStoreOptions, WrappedBundleNoydbStore, createBundleStore, routeStore, withCache, withCircuitBreaker, withHealthCheck, withLogging, withMetrics, withRetry, wrapBundleStore, wrapStore } from './store/index.js';
5
- import { N as NoydbError } from './index-DJTf9yxn.js';
6
- export { A as AlreadyElevatedError, B as BackupCorruptedError, a as BackupLedgerError, b as BundleIntegrityError, c as BundleVersionConflictError, C as ConflictError, D as DEFAULT_JOIN_MAX_ROWS, d as DanglingReferenceError, e as DecryptionError, f as DelegationTargetMissingError, g as DictKeyInUseError, h as DictKeyMissingError, E as ElevationExpiredError, i as ExportCapabilityError, F as FilenameSanitizationError, G as GroupCardinalityError, I as ImportCapabilityError, j as IndexRequiredError, k as IndexWriteFailureError, l as InvalidKeyError, J as JoinContext, m as JoinLeg, n as JoinStrategy, o as JoinTooLargeError, p as JoinableSource, K as KeyringExpiredError, L as LedgerContentionError, q as LiveQuery, r as LiveUpstream, s as LocaleNotSpecifiedError, M as MissingTranslationError, t as NetworkError, u as NoAccessError, v as NotFoundError, O as OrderBy, P as PathEscapeError, w as PeriodClosedError, x as PermissionDeniedError, y as PrivilegeEscalationError, Q as Query, z as QueryPlan, H as QuerySource, R as ReadOnlyAtInstantError, S as ReadOnlyError, T as ReadOnlyFrameError, U as RefDescriptor, V as RefIntegrityError, W as RefMode, X as RefRegistry, Y as RefScopeError, Z as RefViolation, _ as ReservedCollectionNameError, $ as ScanBuilder, a0 as ScanPageProvider, a1 as SchemaValidationError, a2 as SessionExpiredError, a3 as SessionNotFoundError, a4 as SessionPolicyError, a5 as StoreCapabilityError, a6 as TamperedError, a7 as TierDemoteDeniedError, a8 as TierNotGrantedError, a9 as TranslatorNotConfiguredError, aa as ValidationError, ab as applyJoins, ac as buildLiveQuery, ad as executePlan, ae as ref, af as resetJoinWarnings } from './index-DJTf9yxn.js';
7
- export { C as CompressionAlgo, N as NOYDB_BUNDLE_FORMAT_VERSION, a as NOYDB_BUNDLE_MAGIC, b as NOYDB_BUNDLE_PREFIX_BYTES, c as NoydbBundleHeader, d as NoydbBundleReadResult, W as WriteNoydbBundleOptions, g as generateULID, h as hasNoydbBundleMagic, i as isULID, r as readNoydbBundle, e as readNoydbBundleHeader, f as readNoydbBundlePublicEnvelope, j as resetBrotliSupportCache, w as writeNoydbBundle } from './index-Dp4tKCjX.js';
5
+ import { N as NoydbError } from './index-CNwA-B6-.js';
6
+ export { q as AlreadyElevatedError, A as AmendmentForbiddenError, B as BackupCorruptedError, r as BackupLedgerError, s as BundleIntegrityError, t as BundleSealMismatchError, u as BundleVersionConflictError, C as ConflictError, v as DEFAULT_JOIN_MAX_ROWS, w as DanglingReferenceError, x as DecryptionError, y as DelegationTargetMissingError, e as DerivationCapExceededError, f as DerivationCycleError, g as DerivationDepthError, h as DerivationOutputShapeError, i as DerivationOutputUnknownError, D as DictKeyInUseError, a as DictKeyMissingError, z as DirectoryDisabledError, E as ElevationExpiredError, G as ExportCapabilityError, F as FieldFrozenError, H as FilenameSanitizationError, J as GroupCardinalityError, K as ImportCapabilityError, P as IndexRequiredError, U as IndexWriteFailureError, V as InvalidKeyError, I as InvariantError, W as JoinContext, X as JoinLeg, Y as JoinStrategy, Z as JoinTooLargeError, _ as JoinableSource, $ as KeyringCorruptError, a0 as KeyringExpiredError, a1 as LedgerContentionError, a2 as LiveQuery, a3 as LiveUpstream, L as LocaleNotSpecifiedError, m as MaterializedViewConfigError, n as MaterializedViewCycleError, o as MaterializedViewSourceUnknownError, p as MaterializedViewTooLargeError, M as MissingTranslationError, a4 as NetworkError, a5 as NoAccessError, a6 as NotFoundError, a7 as OrderBy, O as OverlayBaseIsVirtualError, j as OverlayCollectionUnavailableError, k as OverlayIdMismatchError, l as OverlayNameCollisionError, a8 as PathEscapeError, a9 as PeriodClosedError, aa as PermissionDeniedError, ab as PrivilegeEscalationError, Q as Query, ac as QueryPlan, ad as QuerySource, ae as ReadOnlyAtInstantError, af as ReadOnlyError, ag as ReadOnlyFrameError, d as RecordLockedError, ah as RefDescriptor, ai as RefIntegrityError, aj as RefMode, ak as RefRegistry, al as RefScopeError, am as RefViolation, R as ReservedCollectionNameError, an as ScanBuilder, ao as ScanPageProvider, ap as SchemaValidationError, S as SessionExpiredError, b as SessionNotFoundError, c as SessionPolicyError, aq as StoreCapabilityError, ar as TamperedError, as as TierDemoteDeniedError, at as TierNotGrantedError, T as TranslatorNotConfiguredError, au as ValidationError, av as applyJoins, aw as buildLiveQuery, ax as executePlan, ay as ref, az as resetJoinWarnings } from './index-CNwA-B6-.js';
7
+ export { A as AutoCredential, a as AutoCredentialKind, C as CompressionAlgo, N as NOYDB_BUNDLE_FORMAT_VERSION, b as NOYDB_BUNDLE_MAGIC, c as NOYDB_BUNDLE_PREFIX_BYTES, d as NoydbBundleHeader, e as NoydbBundleReadResult, R as ReadNoydbBundleOptions, W as WriteNoydbBundleOptions, g as generateULID, h as hasNoydbBundleMagic, i as isULID, r as readNoydbBundle, f as readNoydbBundleHeader, j as readNoydbBundlePublicEnvelope, k as resetBrotliSupportCache, w as writeNoydbBundle } from './index-4agOpzqd.js';
8
8
  export { a as CrdtMode, b as CrdtState, L as LwwMapState, R as RgaState, Y as YjsState, m as mergeCrdtStates, r as resolveCrdtSnapshot } from './strategy-BSxFXGzb.js';
9
+ export { w as withGuard } from './with-guard-DWOCK4Ca.js';
10
+ export { w as withDerivation } from './with-derivation-g-pGoMzL.js';
11
+ export { w as withMaterializedView } from './with-materialized-view-DaKR-N6J.js';
12
+ export { a as Clause, C as CollectionIndexes, F as FieldClause, b as FilterClause, G as GroupClause, H as HashIndex, I as IndexDef, O as Operator, e as evaluateClause, c as evaluateFieldClause, r as readPath } from './predicate-Dnu81tsS.js';
13
+ export { w as withOverlayedView } from './with-overlayed-view-N7jYuNOS.js';
9
14
  export { SYNC_CREDENTIALS_COLLECTION, SyncCredential, credentialStatus, deleteCredential, getCredential, listCredentials, putCredential } from './team/index.js';
10
- export { C as CreateSessionOptions, a as CreateSessionResult, D as DevUnlockOptions, S as SessionToken, b as activeSessionCount, c as clearDevUnlock, d as createSession, e as enableDevUnlock, i as isDevUnlockActive, f as isSessionAlive, l as loadDevUnlock, r as resolveSession, g as revokeAllSessions, h as revokeSession } from './dev-unlock-BygpnIWe.js';
11
- export { a as Clause, C as CollectionIndexes, F as FieldClause, b as FilterClause, G as GroupClause, H as HashIndex, I as IndexDef, O as Operator, e as evaluateClause, c as evaluateFieldClause, r as readPath } from './predicate-SBHmi6D0.js';
12
- export { a as AggregateResult, b as AggregateSpec, c as Aggregation, d as AggregationUpstream, G as GROUPBY_MAX_CARDINALITY, e as GROUPBY_WARN_CARDINALITY, f as GroupedAggregation, g as GroupedQuery, h as GroupedRow, L as LiveAggregation, R as Reducer, i as ReducerOptions, j as avg, l as count, m as groupAndReduce, n as max, o as min, r as reduceRecords, s as sum } from './strategy-D-SrOLCl.js';
13
- export { L as LEDGER_COLLECTION, a as LEDGER_DELTAS_COLLECTION, e as envelopePayloadHash } from './hash-B0eU2Qv9.js';
14
- import './lazy-builder-BwEoBQZ9.js';
15
+ export { C as CreateSessionOptions, a as CreateSessionResult, D as DevUnlockOptions, S as SessionToken, b as activeSessionCount, c as clearDevUnlock, d as createSession, e as enableDevUnlock, i as isDevUnlockActive, f as isSessionAlive, l as loadDevUnlock, r as resolveSession, g as revokeAllSessions, h as revokeSession } from './dev-unlock-D9s-loPr.js';
16
+ export { a as AggregateResult, b as AggregateSpec, c as Aggregation, d as AggregationUpstream, G as GROUPBY_MAX_CARDINALITY, e as GROUPBY_WARN_CARDINALITY, f as GroupedAggregation, g as GroupedQuery, h as GroupedQueryN, i as GroupedRow, j as GroupedRowN, L as LiveAggregation, R as Reducer, k as ReducerOptions, l as avg, n as count, o as groupAndReduce, p as max, q as min, r as reduceRecords, t as sum } from './strategy-DSTrsZ8t.js';
17
+ export { L as LEDGER_COLLECTION, a as LEDGER_DELTAS_COLLECTION, e as envelopePayloadHash } from './hash-DXXXusyk.js';
18
+ import './lazy-builder-Rpd-V3jP.js';
15
19
 
16
20
  /**
17
21
  * Persistence helpers for per-principal user envelopes stored at
@@ -164,13 +168,39 @@ declare class RecoveryNotEnrolledError extends NoydbError {
164
168
  constructor(message?: string);
165
169
  }
166
170
  /**
167
- * Raised by `db.recoverPassphrase` when the developer requests a
168
- * recovery profile other than `'paper'` in v0.1.0-pre.5. The other
169
- * three profiles (Shamir, multi-channel, admin-mediated) ship the API
170
- * shape now; their per-profile dispatch lands in follow-up issues.
171
+ * Raised by `openVault` when a managed-passphrase-mode vault has no
172
+ * STRONG recovery profile enrolled (#195).
173
+ *
174
+ * Managed mode means the user never types a passphrase — the unlock
175
+ * material lives in a `SealingKeyProvider` (`at-*` package). If that
176
+ * provider's key is lost AND no strong recovery is enrolled, the
177
+ * vault is irrecoverable. To prevent that footgun, managed-mode vaults
178
+ * require at least one strong recovery profile (Shamir today;
179
+ * multi-channel / admin-mediated when those ship).
180
+ *
181
+ * Paper recovery alone is NOT strong under managed mode: the user has
182
+ * no memorized passphrase to fall back on, so losing the paper sheet =
183
+ * losing every record permanently.
184
+ *
185
+ * Bootstrap with `db.openVaultAndEnrollRecovery(vault, { recovery: [{ profile: "shamir", k, n }] })`
186
+ * to atomically create-and-enroll, or call `db.enrollRecovery(vault, { profile: "shamir", ... })`
187
+ * separately before re-attempting `openVault`.
188
+ */
189
+ declare class ManagedRecoveryNotEnrolledError extends NoydbError {
190
+ readonly vault: string;
191
+ constructor(vault: string);
192
+ }
193
+ /**
194
+ * Raised by `db.recoverPassphrase` / `db.enrollRecovery` /
195
+ * `db.rotateRecovery` when the developer requests a recovery profile
196
+ * not yet wired in this hub release.
197
+ *
198
+ * Implemented: `paper` (#10, pre.5) and `shamir` (#196 slice 1, pre.16).
199
+ * Pending: `multi-channel` and `admin-mediated` (tracked under #196
200
+ * follow-up slices).
171
201
  *
172
202
  * The carried `profile` and `tracking` fields let consumers steer the
173
- * UI ("Shamir recovery is not yet wired up — open issue #N to follow").
203
+ * UI ("multi-channel recovery is not yet wired up — open issue #N to follow").
174
204
  */
175
205
  declare class RecoveryProfileNotImplementedError extends NoydbError {
176
206
  readonly profile: string;
@@ -308,6 +338,89 @@ declare function loadVaultPolicy(store: NoydbStore, vault: string): Promise<Vaul
308
338
  */
309
339
  declare function saveVaultPolicy(store: NoydbStore, vault: string, policy: VaultPolicy): Promise<void>;
310
340
 
341
+ /**
342
+ * Derive a {@link PersistedSchemaEnvelope} from a Standard Schema v1
343
+ * validator. v0 supports Zod via `zod-to-json-schema` (optional peer-dep);
344
+ * other families write a stub envelope flagging the kind.
345
+ *
346
+ * @see docs/superpowers/specs/2026-05-22-schema-dump-design.md
347
+ *
348
+ * @module
349
+ */
350
+
351
+ /**
352
+ * Heuristic Zod detection — Zod schemas carry a `_def.typeName` property
353
+ * starting with `Zod` (e.g. `ZodObject`, `ZodString`). This survives Zod's
354
+ * minor-version bumps because the typeName naming is stable across v3.
355
+ */
356
+ declare function isZodSchema(value: unknown): boolean;
357
+ declare function derivePersistedSchema(validator: unknown): Promise<PersistedSchemaEnvelope>;
358
+
359
+ /**
360
+ * Read / write the per-collection persisted-schema envelope. Mirrors the
361
+ * standard noy-db record envelope shape and is **AES-GCM encrypted with
362
+ * the collection's DEK** — the schema body (field names, enum values,
363
+ * constraints) is sensitive metadata, so it gets the same encryption
364
+ * envelope as the records it describes.
365
+ *
366
+ * Storage layout:
367
+ *
368
+ * <vault>/_schemas/<collection> → EncryptedEnvelope
369
+ *
370
+ * The DEK passed to {@link savePersistedSchema} / {@link loadPersistedSchema}
371
+ * is the same key the collection uses for its records.
372
+ *
373
+ * @module
374
+ */
375
+
376
+ /** Reserved collection name where persisted schemas live. */
377
+ declare const SCHEMAS_COLLECTION: "_schemas";
378
+ /**
379
+ * Read and decrypt the persisted-schema envelope for one collection.
380
+ * Returns `undefined` when no envelope has been written or when decryption
381
+ * fails (e.g. wrong DEK passed). Tolerates corrupted records — JSON parse
382
+ * failures surface as `undefined`, mirroring `_meta/handle`'s contract.
383
+ */
384
+ declare function loadPersistedSchema(store: NoydbStore, vault: string, collection: string, dek: CryptoKey): Promise<PersistedSchemaEnvelope | undefined>;
385
+ /**
386
+ * Encrypt and persist a schema envelope for one collection. Always
387
+ * overwrites any prior write (callers gate on hash equality before calling
388
+ * to avoid no-op writes).
389
+ */
390
+ declare function savePersistedSchema(store: NoydbStore, vault: string, collection: string, dek: CryptoKey, payload: PersistedSchemaEnvelope): Promise<void>;
391
+
392
+ /**
393
+ * Orchestrate the derive → hash → skip-or-write cycle for a collection's
394
+ * persisted JSON Schema. Called by the Vault at collection-registration
395
+ * time when the developer opts in via `collection({ persistJsonSchema:
396
+ * true })`.
397
+ *
398
+ * Skip semantics:
399
+ *
400
+ * - Zod validators: skip when the new hash equals the stored hash.
401
+ * - Non-Zod (stub envelopes have hash=null): skip when the stored
402
+ * envelope's `kind` matches the freshly-detected kind (since there's
403
+ * no body to compare yet — a kind change is the only signal).
404
+ *
405
+ * @module
406
+ */
407
+
408
+ interface PersistSchemaResult {
409
+ /** True when a fresh envelope was written to storage. */
410
+ readonly written: boolean;
411
+ /** True when an existing envelope matched and the write was skipped. */
412
+ readonly skipped: boolean;
413
+ /** The envelope that was either written or matched. */
414
+ readonly envelope: PersistedSchemaEnvelope;
415
+ }
416
+ declare function persistSchemaIfNeeded(opts: {
417
+ readonly store: NoydbStore;
418
+ readonly vault: string;
419
+ readonly collectionName: string;
420
+ readonly validator: unknown;
421
+ readonly dek: CryptoKey;
422
+ }): Promise<PersistSchemaResult>;
423
+
311
424
  /**
312
425
  * Authentication introspection — issue #13.
313
426
  *
@@ -353,6 +466,84 @@ declare function describeAllUsersAuth(store: NoydbStore, vault: string): Promise
353
466
  description: string;
354
467
  }>>;
355
468
 
469
+ /**
470
+ * Persistence helpers for the vault-level user-directory toggle
471
+ * (`_meta/directory`). Mirrors the bypass-AES pattern used by
472
+ * `_meta/policy` — the directory document is plain JSON, the
473
+ * envelope's `_iv` field is left empty.
474
+ *
475
+ * @see docs/subsystems/user-envelope.md → Directory visibility
476
+ * @see docs/subsystems/plaintext-bypass.md — every `_iv: ''` write site
477
+ *
478
+ * @module
479
+ */
480
+
481
+ /** Reserved id for the vault-level directory document. */
482
+ declare const DIRECTORY_RECORD_ID = "directory";
483
+ /**
484
+ * Read the directory toggle from `_meta/directory`. Returns `undefined`
485
+ * when no document has been persisted — callers treat that as the
486
+ * default-on case (`{ enabled: true }`).
487
+ *
488
+ * Tolerates corrupted documents the same way `_meta/policy` does: a
489
+ * JSON parse failure surfaces as `undefined`, not a thrown error, so a
490
+ * bad write never permanently breaks team enumeration.
491
+ */
492
+ declare function readDirectoryConfig(store: NoydbStore, vault: string): Promise<DirectoryConfig | undefined>;
493
+ /**
494
+ * Persist the directory toggle at `_meta/directory`. Idempotent — call
495
+ * on every `db.setDirectoryEnabled()` invocation. Owner-only at the
496
+ * caller site; this primitive does not check roles.
497
+ */
498
+ declare function persistDirectoryConfig(store: NoydbStore, vault: string, config: DirectoryConfig): Promise<void>;
499
+
500
+ /**
501
+ * Persistence helpers for the per-user visibility flag
502
+ * (`_meta/visibility/<keyringId>`). Mirrors the bypass-AES pattern used
503
+ * by `_meta/policy` — the visibility document is plain JSON, the
504
+ * envelope's `_iv` field is left empty.
505
+ *
506
+ * Stored alongside the keyring file rather than inside the encrypted
507
+ * user envelope (`_users/<keyringId>`) because:
508
+ *
509
+ * - `UserEnvelope<T>.data` is opaque-to-hub by contract — hub does not
510
+ * introspect or reserve any keys inside it. Adding `hidden` there
511
+ * would violate that contract.
512
+ * - `listUsersWithEnvelopes` filters by the flag, and the filter must
513
+ * work even when decryption fails (legacy keyrings predating the
514
+ * envelope feature, or a corrupted envelope).
515
+ *
516
+ * @see docs/subsystems/user-envelope.md → Directory visibility
517
+ * @see docs/subsystems/plaintext-bypass.md — every `_iv: ''` write site
518
+ *
519
+ * @module
520
+ */
521
+
522
+ /** Prefix for per-user visibility records inside `_meta`. */
523
+ declare const VISIBILITY_RECORD_PREFIX = "visibility/";
524
+ /** Compose the `_meta` record id for a keyring's visibility doc. */
525
+ declare function visibilityRecordId(keyringId: string): string;
526
+ /**
527
+ * Read the visibility flag for `keyringId`. Returns `undefined` when no
528
+ * document has been persisted — callers treat that as the default-visible
529
+ * case (`{ hidden: false }`).
530
+ */
531
+ declare function readUserVisibility(store: NoydbStore, vault: string, keyringId: string): Promise<UserVisibility | undefined>;
532
+ /**
533
+ * Persist the visibility flag for `keyringId` at
534
+ * `_meta/visibility/<keyringId>`. Idempotent — call on every
535
+ * `vault.user.setMyVisibility()` invocation. Own-only at the caller
536
+ * site; this primitive does not enforce keyring ownership.
537
+ */
538
+ declare function persistUserVisibility(store: NoydbStore, vault: string, keyringId: string, visibility: UserVisibility): Promise<void>;
539
+ /**
540
+ * Delete the visibility flag for `keyringId`. Called from `revoke()`
541
+ * alongside `deleteUserEnvelope` so the sidecar does not leak to a
542
+ * re-granted principal with the same `userId`. Idempotent — the store's
543
+ * `delete()` is already a no-op when the record is absent.
544
+ */
545
+ declare function deleteUserVisibility(store: NoydbStore, vault: string, keyringId: string): Promise<void>;
546
+
356
547
  interface EncryptResult {
357
548
  iv: string;
358
549
  data: string;
@@ -562,4 +753,4 @@ type DiffCandidate<T = unknown> = Vault | Record<string, readonly T[]> | string;
562
753
  */
563
754
  declare function diffVault<T = unknown>(vault: Vault, candidate: DiffCandidate<T>, options?: DiffOptions): Promise<VaultDiff<T>>;
564
755
 
565
- export { ActiveTier, type CheckGateContext, DEFAULT_FRESHNESS_MS, type DiffCandidate, DiffEntry, type DiffOptions, FactorProof, GateName, GatePolicy, META_COLLECTION, NoydbError, NoydbStore, PERSONAL_POLICY, POLICY_RECORD_ID, PUBLIC_ENVELOPE_RECORD_ID, PolicyDeniedError, type PolicyDenyReason, PublicEnvelope, RecoveryNotEnrolledError, RecoveryProfileNotImplementedError, STRICT_POLICY, UnlockedKeyring, UserEnvelope, Vault, type VaultDiff, type VaultDiffEntry, type VaultDiffModifiedEntry, VaultPolicy, assertTierAccess, base64ToBuffer, bufferToBase64, checkGate, decryptBytes, decryptDeterministic, dekKey, deleteUserEnvelope, derivePresenceKey, describeAllUsersAuth, describeAuthConfig, describeGate, describeUserAuth, diagramAuthConfig, diffVault, effectiveClearance, encryptBytes, encryptDeterministic, estimateRecordBytes, listUserEnvelopeIds, loadPublicEnvelope, loadUserEnvelope, loadVaultPolicy, mergePolicy, parseBytes, readPublicEnvelope, savePublicEnvelope, saveUserEnvelope, saveVaultPolicy };
756
+ export { ActiveTier, type CheckGateContext, DEFAULT_FRESHNESS_MS, DIRECTORY_RECORD_ID, type DiffCandidate, DiffEntry, type DiffOptions, DirectoryConfig, FactorProof, GateName, GatePolicy, META_COLLECTION, ManagedRecoveryNotEnrolledError, NoydbError, NoydbStore, PERSONAL_POLICY, POLICY_RECORD_ID, PUBLIC_ENVELOPE_RECORD_ID, type PersistSchemaResult, PersistedSchemaEnvelope, PolicyDeniedError, type PolicyDenyReason, PublicEnvelope, RecoveryNotEnrolledError, RecoveryProfileNotImplementedError, SCHEMAS_COLLECTION, STRICT_POLICY, UnlockedKeyring, UserEnvelope, UserVisibility, VISIBILITY_RECORD_PREFIX, Vault, type VaultDiff, type VaultDiffEntry, type VaultDiffModifiedEntry, VaultPolicy, assertTierAccess, base64ToBuffer, bufferToBase64, checkGate, decryptBytes, decryptDeterministic, dekKey, deleteUserEnvelope, deleteUserVisibility, derivePersistedSchema, derivePresenceKey, describeAllUsersAuth, describeAuthConfig, describeGate, describeUserAuth, diagramAuthConfig, diffVault, effectiveClearance, encryptBytes, encryptDeterministic, estimateRecordBytes, isZodSchema, listUserEnvelopeIds, loadPersistedSchema, loadPublicEnvelope, loadUserEnvelope, loadVaultPolicy, mergePolicy, parseBytes, persistDirectoryConfig, persistSchemaIfNeeded, persistUserVisibility, readDirectoryConfig, readPublicEnvelope, readUserVisibility, savePersistedSchema, savePublicEnvelope, saveUserEnvelope, saveVaultPolicy, visibilityRecordId };