@noy-db/hub 0.2.0-pre.15 → 0.2.0-pre.16

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 (197) hide show
  1. package/dist/aggregate/index.cjs +106 -10
  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 +1 -1
  6. package/dist/attestation/index.cjs.map +1 -1
  7. package/dist/attestation/index.d.cts +3 -3
  8. package/dist/attestation/index.d.ts +3 -3
  9. package/dist/attestation/index.js +4 -4
  10. package/dist/blobs/index.cjs.map +1 -1
  11. package/dist/blobs/index.d.cts +4 -4
  12. package/dist/blobs/index.d.ts +4 -4
  13. package/dist/blobs/index.js +3 -3
  14. package/dist/bundle/index.cjs +181 -46
  15. package/dist/bundle/index.cjs.map +1 -1
  16. package/dist/bundle/index.d.cts +5 -5
  17. package/dist/bundle/index.d.ts +5 -5
  18. package/dist/bundle/index.js +7 -7
  19. package/dist/{chunk-BIYRQQV6.js → chunk-3YWP3WBP.js} +3 -3
  20. package/dist/{chunk-VU7SWWT5.js → chunk-42FEUPZQ.js} +10 -6
  21. package/dist/chunk-42FEUPZQ.js.map +1 -0
  22. package/dist/{chunk-7EFFHEN5.js → chunk-667MB6AH.js} +118 -47
  23. package/dist/chunk-667MB6AH.js.map +1 -0
  24. package/dist/{chunk-A5ZOOZFB.js → chunk-6H2ZUNR7.js} +2 -2
  25. package/dist/{chunk-7HT2MEZ5.js → chunk-7BQ4QWYX.js} +3 -3
  26. package/dist/{chunk-DQU36Q7I.js → chunk-7Z7KSVA5.js} +13 -4
  27. package/dist/chunk-7Z7KSVA5.js.map +1 -0
  28. package/dist/{chunk-WBAYSNUQ.js → chunk-BI6ETQPF.js} +2 -2
  29. package/dist/{chunk-56DJ7JVK.js → chunk-BR3AMFGS.js} +2 -2
  30. package/dist/{chunk-COFPAMX6.js → chunk-DLZ2ONOD.js} +3 -3
  31. package/dist/{chunk-EYVQHAGH.js → chunk-DUREQF5W.js} +2 -2
  32. package/dist/{chunk-PE4AQGFH.js → chunk-E2CDVKMH.js} +3 -3
  33. package/dist/{chunk-GC4V7RU7.js → chunk-F3BPIPLS.js} +1 -1
  34. package/dist/{chunk-GC4V7RU7.js.map → chunk-F3BPIPLS.js.map} +1 -1
  35. package/dist/{chunk-L2FE64BU.js → chunk-FFXM3ZIF.js} +2 -2
  36. package/dist/{chunk-5LQG6ZO2.js → chunk-G4SCICH5.js} +8 -3
  37. package/dist/chunk-G4SCICH5.js.map +1 -0
  38. package/dist/{chunk-WGHU7BLI.js → chunk-GNI5STXQ.js} +2 -2
  39. package/dist/{chunk-C5T5AFWN.js → chunk-HBXJ37ZY.js} +11 -5
  40. package/dist/chunk-HBXJ37ZY.js.map +1 -0
  41. package/dist/{chunk-7PS7EOCF.js → chunk-IXBIFDEW.js} +2 -2
  42. package/dist/{chunk-LX3CB26H.js → chunk-KABJXG2F.js} +2 -2
  43. package/dist/{chunk-3EWXMOK3.js → chunk-L2BNJ6HM.js} +26 -11
  44. package/dist/chunk-L2BNJ6HM.js.map +1 -0
  45. package/dist/{chunk-DKO2QFSA.js → chunk-OB2ZJQ2D.js} +2 -2
  46. package/dist/{chunk-KIP6JLTF.js → chunk-OMAMZKKD.js} +2 -2
  47. package/dist/{chunk-EGD5DXFT.js → chunk-OQSRJG6A.js} +13 -1
  48. package/dist/chunk-OQSRJG6A.js.map +1 -0
  49. package/dist/{chunk-KI6HAJWL.js → chunk-QSUK7YWK.js} +2 -2
  50. package/dist/{chunk-YHPM5D7Y.js → chunk-QVIEAYTP.js} +61 -2
  51. package/dist/chunk-QVIEAYTP.js.map +1 -0
  52. package/dist/{chunk-NSCVNK5K.js → chunk-SCJPI4Z5.js} +3 -3
  53. package/dist/{chunk-NU6Q3FOR.js → chunk-TKIY625R.js} +11 -1
  54. package/dist/{chunk-NU6Q3FOR.js.map → chunk-TKIY625R.js.map} +1 -1
  55. package/dist/{chunk-OHVFWCJP.js → chunk-VLMPU56Q.js} +48 -18
  56. package/dist/chunk-VLMPU56Q.js.map +1 -0
  57. package/dist/{chunk-6AJBSQU4.js → chunk-XL35NSEN.js} +2 -2
  58. package/dist/consent/index.d.cts +4 -4
  59. package/dist/consent/index.d.ts +4 -4
  60. package/dist/derivations/index.cjs +24 -3
  61. package/dist/derivations/index.cjs.map +1 -1
  62. package/dist/derivations/index.d.cts +5 -5
  63. package/dist/derivations/index.d.ts +5 -5
  64. package/dist/derivations/index.js +2 -2
  65. package/dist/{dev-unlock-nVkuRLLe.d.cts → dev-unlock-8XzcD2Z4.d.cts} +1 -1
  66. package/dist/{dev-unlock-iAS8z9jc.d.ts → dev-unlock-DR3upLd1.d.ts} +1 -1
  67. package/dist/{executor-HSSRXDOB.js → executor-AZLS3KBK.js} +4 -4
  68. package/dist/{fanout-sidecar-N6OJX6QR.js → fanout-sidecar-67CMI3UT.js} +2 -2
  69. package/dist/guards/index.cjs +9 -5
  70. package/dist/guards/index.cjs.map +1 -1
  71. package/dist/guards/index.d.cts +5 -5
  72. package/dist/guards/index.d.ts +5 -5
  73. package/dist/guards/index.js +1 -1
  74. package/dist/{hash-DHOnRarj.d.ts → hash-CDjye9KV.d.ts} +1 -1
  75. package/dist/{hash-Cv6byZs7.d.cts → hash-DuQ88_5W.d.cts} +1 -1
  76. package/dist/history/index.cjs.map +1 -1
  77. package/dist/history/index.d.cts +5 -5
  78. package/dist/history/index.d.ts +5 -5
  79. package/dist/history/index.js +2 -2
  80. package/dist/i18n/index.cjs.map +1 -1
  81. package/dist/i18n/index.d.cts +4 -4
  82. package/dist/i18n/index.d.ts +4 -4
  83. package/dist/i18n/index.js +3 -3
  84. package/dist/{immutable-guard-yBEOYmif.d.cts → immutable-guard-CRPvu24K.d.cts} +16 -1
  85. package/dist/{immutable-guard-BehB1YGB.d.ts → immutable-guard-Dov3WvwF.d.ts} +16 -1
  86. package/dist/{index-D95VK1Qy.d.cts → index-C8Bk3-VF.d.cts} +1 -1
  87. package/dist/{index-XNB2r6bX.d.ts → index-nP99bXLg.d.ts} +1 -1
  88. package/dist/index.cjs +273 -52
  89. package/dist/index.cjs.map +1 -1
  90. package/dist/index.d.cts +13 -12
  91. package/dist/index.d.ts +13 -12
  92. package/dist/index.js +27 -25
  93. package/dist/index.js.map +1 -1
  94. package/dist/{issue-ADVS4OVP.js → issue-RZP3VI6O.js} +4 -4
  95. package/dist/{ledger-CWSE3BLF.js → ledger-A3LL253R.js} +3 -3
  96. package/dist/materialized-views/index.cjs +407 -5
  97. package/dist/materialized-views/index.cjs.map +1 -1
  98. package/dist/materialized-views/index.d.cts +5 -5
  99. package/dist/materialized-views/index.d.ts +5 -5
  100. package/dist/materialized-views/index.js +5 -5
  101. package/dist/noydb-WCMY2ZOW.js +35 -0
  102. package/dist/overlay-views/index.cjs +47 -17
  103. package/dist/overlay-views/index.cjs.map +1 -1
  104. package/dist/overlay-views/index.d.cts +26 -8
  105. package/dist/overlay-views/index.d.ts +26 -8
  106. package/dist/overlay-views/index.js +1 -1
  107. package/dist/periods/index.cjs.map +1 -1
  108. package/dist/periods/index.d.cts +4 -4
  109. package/dist/periods/index.d.ts +4 -4
  110. package/dist/periods/index.js +3 -3
  111. package/dist/{public-envelope-SYHEYQ3X.js → public-envelope-YP2UWMLG.js} +3 -3
  112. package/dist/query/index.cjs +24 -10
  113. package/dist/query/index.cjs.map +1 -1
  114. package/dist/query/index.d.cts +2 -2
  115. package/dist/query/index.d.ts +2 -2
  116. package/dist/query/index.js +2 -2
  117. package/dist/{registry-XGLNADIE.js → registry-EB6SISTA.js} +2 -2
  118. package/dist/{registry-DK5YWAAA.js → registry-UTA4CLQS.js} +2 -2
  119. package/dist/{revoke-ZDFKMR5E.js → revoke-HNMQZSCL.js} +4 -4
  120. package/dist/session/index.d.cts +5 -5
  121. package/dist/session/index.d.ts +5 -5
  122. package/dist/shadow/index.d.cts +4 -4
  123. package/dist/shadow/index.d.ts +4 -4
  124. package/dist/{signer-P5D7Y72U.js → signer-DCMNKXSF.js} +3 -3
  125. package/dist/snapshots/index.d.cts +4 -4
  126. package/dist/snapshots/index.d.ts +4 -4
  127. package/dist/snapshots/index.js +3 -3
  128. package/dist/{stale-JH67FU57.js → stale-W5PQTRYH.js} +2 -2
  129. package/dist/store/index.d.cts +4 -4
  130. package/dist/store/index.d.ts +4 -4
  131. package/dist/{strategy-CbneC7bS.d.ts → strategy-BtW8fAjz.d.cts} +1 -1
  132. package/dist/{strategy-CbneC7bS.d.cts → strategy-BtW8fAjz.d.ts} +1 -1
  133. package/dist/sync/index.cjs.map +1 -1
  134. package/dist/sync/index.d.cts +3 -3
  135. package/dist/sync/index.d.ts +3 -3
  136. package/dist/sync/index.js +2 -2
  137. package/dist/team/index.cjs.map +1 -1
  138. package/dist/team/index.d.cts +4 -4
  139. package/dist/team/index.d.ts +4 -4
  140. package/dist/team/index.js +5 -5
  141. package/dist/tx/index.cjs +66 -3
  142. package/dist/tx/index.cjs.map +1 -1
  143. package/dist/tx/index.d.cts +22 -6
  144. package/dist/tx/index.d.ts +22 -6
  145. package/dist/tx/index.js +7 -3
  146. package/dist/tx/index.js.map +1 -1
  147. package/dist/{types-BpPV5uyy.d.cts → types-Bze6vkwm.d.cts} +371 -139
  148. package/dist/{types-4t1-tWS4.d.ts → types-DrmBTscX.d.ts} +371 -139
  149. package/dist/{ulid-DAfenvFd.d.ts → ulid-DbBVrNSt.d.ts} +1 -1
  150. package/dist/{ulid-CiPrpGqm.d.cts → ulid-DfZlAh0u.d.cts} +1 -1
  151. package/dist/{vault-group-KOM7QRJG.js → vault-group-DX2HFQMX.js} +2 -2
  152. package/dist/{with-derivation-DBqJB3dQ.d.cts → with-derivation-CCqAchD5.d.cts} +1 -1
  153. package/dist/{with-derivation-OK9M2sJE.d.ts → with-derivation-_lySGdlm.d.ts} +1 -1
  154. package/dist/{with-materialized-view-NzuxYPDF.d.cts → with-materialized-view--4PsvMDu.d.cts} +1 -1
  155. package/dist/{with-materialized-view-Dt-ufPWQ.d.ts → with-materialized-view-QT1Tp7NO.d.ts} +1 -1
  156. package/dist/{with-overlayed-view-eDvMs6LO.d.ts → with-overlayed-view-BEXfpzSb.d.ts} +1 -1
  157. package/dist/{with-overlayed-view-CC0_ocy-.d.cts → with-overlayed-view-DlH5qmeB.d.cts} +1 -1
  158. package/package.json +3 -3
  159. package/dist/chunk-3EWXMOK3.js.map +0 -1
  160. package/dist/chunk-5LQG6ZO2.js.map +0 -1
  161. package/dist/chunk-7EFFHEN5.js.map +0 -1
  162. package/dist/chunk-C5T5AFWN.js.map +0 -1
  163. package/dist/chunk-DQU36Q7I.js.map +0 -1
  164. package/dist/chunk-EGD5DXFT.js.map +0 -1
  165. package/dist/chunk-OHVFWCJP.js.map +0 -1
  166. package/dist/chunk-VU7SWWT5.js.map +0 -1
  167. package/dist/chunk-YHPM5D7Y.js.map +0 -1
  168. package/dist/noydb-GZGFBA4E.js +0 -35
  169. /package/dist/{chunk-BIYRQQV6.js.map → chunk-3YWP3WBP.js.map} +0 -0
  170. /package/dist/{chunk-A5ZOOZFB.js.map → chunk-6H2ZUNR7.js.map} +0 -0
  171. /package/dist/{chunk-7HT2MEZ5.js.map → chunk-7BQ4QWYX.js.map} +0 -0
  172. /package/dist/{chunk-WBAYSNUQ.js.map → chunk-BI6ETQPF.js.map} +0 -0
  173. /package/dist/{chunk-56DJ7JVK.js.map → chunk-BR3AMFGS.js.map} +0 -0
  174. /package/dist/{chunk-COFPAMX6.js.map → chunk-DLZ2ONOD.js.map} +0 -0
  175. /package/dist/{chunk-EYVQHAGH.js.map → chunk-DUREQF5W.js.map} +0 -0
  176. /package/dist/{chunk-PE4AQGFH.js.map → chunk-E2CDVKMH.js.map} +0 -0
  177. /package/dist/{chunk-L2FE64BU.js.map → chunk-FFXM3ZIF.js.map} +0 -0
  178. /package/dist/{chunk-WGHU7BLI.js.map → chunk-GNI5STXQ.js.map} +0 -0
  179. /package/dist/{chunk-7PS7EOCF.js.map → chunk-IXBIFDEW.js.map} +0 -0
  180. /package/dist/{chunk-LX3CB26H.js.map → chunk-KABJXG2F.js.map} +0 -0
  181. /package/dist/{chunk-DKO2QFSA.js.map → chunk-OB2ZJQ2D.js.map} +0 -0
  182. /package/dist/{chunk-KIP6JLTF.js.map → chunk-OMAMZKKD.js.map} +0 -0
  183. /package/dist/{chunk-KI6HAJWL.js.map → chunk-QSUK7YWK.js.map} +0 -0
  184. /package/dist/{chunk-NSCVNK5K.js.map → chunk-SCJPI4Z5.js.map} +0 -0
  185. /package/dist/{chunk-6AJBSQU4.js.map → chunk-XL35NSEN.js.map} +0 -0
  186. /package/dist/{executor-HSSRXDOB.js.map → executor-AZLS3KBK.js.map} +0 -0
  187. /package/dist/{fanout-sidecar-N6OJX6QR.js.map → fanout-sidecar-67CMI3UT.js.map} +0 -0
  188. /package/dist/{issue-ADVS4OVP.js.map → issue-RZP3VI6O.js.map} +0 -0
  189. /package/dist/{ledger-CWSE3BLF.js.map → ledger-A3LL253R.js.map} +0 -0
  190. /package/dist/{noydb-GZGFBA4E.js.map → noydb-WCMY2ZOW.js.map} +0 -0
  191. /package/dist/{public-envelope-SYHEYQ3X.js.map → public-envelope-YP2UWMLG.js.map} +0 -0
  192. /package/dist/{registry-DK5YWAAA.js.map → registry-EB6SISTA.js.map} +0 -0
  193. /package/dist/{registry-XGLNADIE.js.map → registry-UTA4CLQS.js.map} +0 -0
  194. /package/dist/{revoke-ZDFKMR5E.js.map → revoke-HNMQZSCL.js.map} +0 -0
  195. /package/dist/{signer-P5D7Y72U.js.map → signer-DCMNKXSF.js.map} +0 -0
  196. /package/dist/{stale-JH67FU57.js.map → stale-W5PQTRYH.js.map} +0 -0
  197. /package/dist/{vault-group-KOM7QRJG.js.map → vault-group-DX2HFQMX.js.map} +0 -0
package/dist/index.d.cts CHANGED
@@ -1,21 +1,22 @@
1
- import { b3 as NoydbStore, bF as UserEnvelope, br as PublicEnvelope, bG as GateName, bH as GatePolicy, bI as VaultPolicy, bJ as ActiveTier, bK as FactorProof, bL as SchemaUpdateStrategy, bM as TransformFn, bN as PersistedSchemaEnvelope, bO as UpdateDecision, bP as DirectoryConfig, bQ as UserVisibility, b1 as UnlockedKeyring, bw as Vault, ba as DiffEntry } from './types-BpPV5uyy.cjs';
2
- export { bR as AccessibleVault, bS as AffectedDocument, b7 as AppendInput, bT as ArchivePolicy, bU as ArchiveResult, bV as ArchiveRunOptions, bW as ArchiveStrategy, aP as ArrayOutputSpec, z as BLOB_CHUNKS_COLLECTION, A as BLOB_COLLECTION, E as BLOB_INDEX_COLLECTION, F as BLOB_SLOTS_PREFIX, G as BLOB_VERSIONS_PREFIX, bX as BUNDLE_STORE_POLICY, M as BlobObject, N as BlobPutOptions, Q as BlobResponseOptions, T as BlobSet, bY as BuiltInGateName, bt as BundleRecipient, a9 as CONSENT_AUDIT_COLLECTION, bZ as CacheOptions, b_ as CacheStats, b$ as CapturedBlueprint, c0 as ChangeEvent, b8 as ChangeType, ai as ClosePeriodOptions, aY as Collection, c1 as CollectionChangeEvent, c2 as CollectionConflictResolver, c3 as CollectionDescriptor, az as CollectionFrame, b9 as CollectionInstant, c4 as CollectionStats, c5 as ComputedFieldError, c6 as ComputedFields, c7 as ComputedFn, c8 as Conflict, c9 as ConflictPolicy, ca as ConflictStrategy, aa as ConsentAuditEntry, ab as ConsentAuditFilter, ac as ConsentContext, ad as ConsentOp, cb as CrossTierAccessEvent, cc as CrossVaultAggregation, cd as CrossVaultGroupedAggregation, ce as CrossVaultGroupedRow, cf as CrossVaultLiveAggregation, cg as CrossVaultLiveQuery, Y as DEFAULT_CHUNK_SIZE, ch as DEFAULT_PUBLIC_ENVELOPE_SCHEMA, ci as DELEGATIONS_COLLECTION, D as DICT_COLLECTION_PREFIX, cj as DeepPartial, ck as DeepPartialOrNull, cl as DeferredNumberingConfig, cm as DelegationToken, cn as DeleteManyResult, co as DeploymentEvent, cp as DerivationDescriptor, aN as DerivationStrategy, aR as DerivationStrategyHandle, aS as DerivedFromMeta, a as DictEntry, b as DictKeyDescriptor, c as DictionaryHandle, d as DictionaryOptions, cq as DirtyEntry, cr as DryRunResult, cs as DumpSchemaOptions, ct as ELEVATION_AUDIT_COLLECTION, cu as ElevatedHandle, b5 as EncryptedEnvelope, cv as EnrollAuthenticatorOptions, cw as EnrollAuthenticatorWrappingDEKsOptions, cx as EnrollAuthenticatorWrappingKEKOptions, cy as EnrollRecoveryResult, cz as ExportCapability, cA as ExportChunk, cB as ExportFormat, cC as ExportStreamOptions, cD as FactorKind, cE as FactorProofBundle, cF as FactorRequirement, cG as FanoutQueryOptions, cH as FanoutResult, cI as FenceDoc, cJ as FenceState, cK as FieldChange, cL as FieldDescriptor, cM as FieldSource, cN as GhostRecord, cO as GrantOptions, at as GuardChange, au as GuardContext, as as GuardStrategy, aw as GuardStrategyHandle, cP as GuardViolation, cQ as HistoryConfig, cR as HistoryEntry, b4 as HistoryOptions, e as I18nMap, f as I18nTextDescriptor, g as I18nTextOptions, cS as INDEXED_STORE_POLICY, cT as ImportCapability, cU as InferOutput, cV as InternalCollectionStats, cW as IssueDelegationOptions, cX as IssueMagicLinkGrantOptions, bb as JsonPatch, bc as JsonPatchOp, cY as KeyringAuthenticator, cZ as KeyringAuthenticatorWrappingDEKs, c_ as KeyringAuthenticatorWrappingKEK, c$ as KeyringFile, L as Layer, bd as LedgerEntry, be as LedgerStore, d0 as ListAccessibleVaultsOptions, d1 as ListPageResult, d2 as ListUsersOptions, d3 as LiveQueryOptions, d4 as LiveUserEnvelope, d5 as LocaleReadOptions, d6 as Lru, d7 as LruOptions, d8 as LruStats, d9 as MAGIC_LINK_CONTENT_INFO_PREFIX, da as MAGIC_LINK_GRANTS_COLLECTION, db as MAGIC_LINK_KEK_INFO_PREFIX, dc as MagicLinkGrantPayload, dd as MagicLinkGrantRecord, bC as MaterializedFromMeta, de as MaterializedViewDescriptor, bD as MaterializedViewOutput, aV as MaterializedViewStrategy, aW as MaterializedViewStrategyHandle, df as MemoryRecipientSealer, dg as MemorySealingKeyProvider, dh as NOYDB_BACKUP_VERSION, di as NOYDB_FORMAT_VERSION, dj as NOYDB_KEYRING_VERSION, dk as NOYDB_SYNC_VERSION, dl as NextOptions, dm as Noydb, aB as NoydbBundleStore, dn as NoydbEventMap, dp as NoydbOptions, dq as NumberingAssignment, O as OnMissing, h as OnMissingPolicy, aj as OpenPeriodOptions, aT as OutputSpec, dr as OverlayViewDescriptor, aX as OverlayedViewStrategy, a_ as OverlayedViewStrategyHandle, ak as PERIODS_COLLECTION, ds as PUBLIC_ENVELOPE_FIELDS, dt as PaperRecoveryDoc, du as PaperRecoveryEntry, dv as PassphrasePolicy, dw as PassphraseValidationResult, al as PeriodRecord, dx as Permission, dy as Permissions, dz as PersistedSchemaKind, dA as PlaintextTranslatorContext, dB as PlaintextTranslatorFn, P as PolicyEnforcer, dC as PresenceHandle, dD as PresencePeer, b6 as PruneOptions, dE as PublicEnvelopeField, dF as PublicEnvelopeSchema, dG as PublicEnvelopeText, dH as PullMode, dI as PullOptions, dJ as PullPolicy, dK as PullResult, dL as PushMode, dM as PushOptions, dN as PushPolicy, dO as PushResult, dP as PutManyItemOptions, dQ as PutManyOptions, dR as PutManyResult, dS as QueryAcrossOptions, dT as QueryAcrossResult, dU as QuickUnlockState, dV as QuickUnlockStore, dW as ReAuthOperation, bv as RecipientHint, bu as RecipientSealer, aU as RecordOutputSpec, dX as RecoverPassphraseInput, dY as RecoverPassphraseResult, dZ as RecoverUserOptions, d_ as RecoveryProof, R as ResolveI18nOptions, d$ as ResolvedPublicEnvelopeSchema, aC as RetentionPolicy, e0 as RevokeOptions, b0 as Role, e1 as RotatePassphraseInput, e2 as RotateRecoveryOptions, e3 as RotateRecoveryResult, e4 as SEALED_PASSPHRASE_RECORD_ID, e5 as SchemaDelta, e6 as SchemaIntrospection, e7 as SchemaManifestRow, S as ScriptWarning, e8 as SealedEnvelope, e9 as SealedPassphrase, bs as SealingKeyProvider, ea as SequenceHandle, eb as SequenceStore, ec as SessionPolicy, ed as SetPublicEnvelopeInput, ee as ShamirRecoveryDoc, ef as ShamirRecoveryEntry, by as ShamirRecoveryProvider, eg as ShardedCollection, eh as ShardedGroupedQuery, ei as ShardedQuery, ej as ShardingConfig, ek as SkippedVault, a3 as SlotInfo, a4 as SlotRecord, el as SlotRewrapCeremony, em as SlotRewrapContext, aF as SnapshotMeta, en as StandardSchemaV1, eo as StandardSchemaV1Issue, ep as StandardSchemaV1SyncResult, eq as StateManagementVault, er as StoreAuth, es as StoreAuthKind, et as StoreCapabilities, eu as StoreTime, ev as SyncEngine, ew as SyncMetadata, ex as SyncPolicy, ey as SyncScheduler, ez as SyncSchedulerStatus, eA as SyncStatus, eB as SyncTarget, eC as SyncTargetRole, eD as SyncTransaction, eE as SyncTransactionResult, eF as TabChannel, eG as TabCoordinationOptions, eH as TabLockManager, eI as TabPresence, eJ as TabRole, eK as TierMode, eL as TranslatorAuditEntry, aJ as TxCollection, aK as TxContext, eM as TxOp, aL as TxVault, eN as USER_ENVELOPE_COLLECTION, eO as USER_ENVELOPE_MAX_BYTES, bE as UnionSource, eP as Unsubscribe, eQ as UpdateAuthenticatorOptions, eR as UpdateContext, eS as UpdateUserOptions, eT as UserApi, eU as UserEnvelopeCheckGate, eV as UserEnvelopeOversizedError, eW as UserEnvelopePresented, eX as UserInfo, eY as VaultBackup, bf as VaultEngine, aA as VaultFrame, eZ as VaultGroup, e_ as VaultGroupOptions, bg as VaultInstant, e$ as VaultPolicyOnDisk, f0 as VaultRegistryRow, f1 as VaultSchemaSnapshot, f2 as VaultSnapshot, f3 as VaultTemplate, bh as VerifyResult, a5 as VersionRecord, f4 as WarningRules, f5 as WeakPassphraseError, f6 as WeakPassphraseReason, f7 as WithArchiveOptions, f8 as WrappedDeksBlob, f9 as WriteConflict, fa as WriteEvent, fb as WriteHook, fc as WriteQueue, i as applyI18nLocale, bi as applyPatch, fd as assertStrongPassphrase, fe as buildRecipientKeyringFile, ff as burnPaperRecoveryEntry, bj as canonicalJson, bk as computePatch, x as createEnforcer, fg as createNoydb, fh as createStore, fi as deriveMagicLinkContentKey, j as dictCollectionName, k as dictKey, bl as diff, l as enforceScript, fj as enrollAuthenticator, fk as estimateEntropy, fl as evalComputedFields, fm as evaluateExportCapability, fn as evaluateImportCapability, fo as findAuthenticator, bm as formatDiff, fp as hasExportCapability, fq as hasImportCapability, fr as hasRecoveryEnrolled, bn as hashEntry, n as i18nText, o as inferScripts, p as isDictCollectionName, q as isDictKeyDescriptor, r as isI18nTextDescriptor, fs as isMagicLinkGrantExpired, ft as isPublicEnvelope, fu as issueDelegation, fv as keyringRecoverPassphrase, fw as keyringRotatePassphrase, fx as listMagicLinkGrants, fy as listUsers, fz as listUsersWithEnvelopes, fA as loadActiveDelegations, fB as loadPaperRecoveryEntries, fC as loadSealedPassphrase, fD as loadShamirRecoveryEntries, fE as magicLinkGrantRecordId, fF as mintPaperRecoveryEntry, fG as mintShamirRecoveryEntry, fH as mintWrappedDeksBlob, bo as paddedIndex, bp as parseIndex, fI as parseSealedEnvelope, fJ as readMagicLinkGrantRecord, fK as recoverUser, fL as removeAuthenticator, s as resolveI18nText, t as resolvePolicy, fM as resolvePublicEnvelopeSchema, fN as revokeDelegation, fO as revokeMagicLinkGrant, aM as runTransaction, fP as savePaperRecoveryEntries, fQ as saveSealedPassphrase, fR as saveShamirRecoveryEntries, bq as sha256Hex, fS as unwrapDeksFromBlob, fT as unwrapDeksFromPaperEntry, fU as unwrapDeksFromShamirEntry, fV as unwrapMagicLinkGrant, v as validateI18nTextValue, fW as validatePassphrase, fX as validatePublicEnvelopeInput, fY as validateSchemaInput, fZ as validateSchemaOutput, y as validateSessionPolicy, f_ as withArchive, f$ as withDeferredNumbering, g0 as writeMagicLinkGrant } from './types-BpPV5uyy.cjs';
1
+ import { a$ as NoydbStore, bD as UserEnvelope, bn as PublicEnvelope, bE as GateName, bF as GatePolicy, bG as VaultPolicy, bH as ActiveTier, bI as FactorProof, bJ as SchemaUpdateStrategy, bK as TransformFn, bL as PersistedSchemaEnvelope, bM as UpdateDecision, bN as DirectoryConfig, bO as UserVisibility, aZ as UnlockedKeyring, bs as Vault, b6 as DiffEntry } from './types-Bze6vkwm.cjs';
2
+ export { bP as AccessibleVault, bQ as AffectedDocument, b3 as AppendInput, bR as ArchivePolicy, bS as ArchiveResult, bT as ArchiveRunOptions, bU as ArchiveStrategy, aJ as ArrayOutputSpec, z as BLOB_CHUNKS_COLLECTION, A as BLOB_COLLECTION, E as BLOB_INDEX_COLLECTION, F as BLOB_SLOTS_PREFIX, G as BLOB_VERSIONS_PREFIX, bV as BUNDLE_STORE_POLICY, M as BlobObject, N as BlobPutOptions, Q as BlobResponseOptions, T as BlobSet, bW as BuiltInGateName, bp as BundleRecipient, a9 as CONSENT_AUDIT_COLLECTION, bX as CacheOptions, bY as CacheStats, bZ as CapturedBlueprint, b_ as ChangeEvent, b4 as ChangeType, ai as ClosePeriodOptions, aS as Collection, b$ as CollectionChangeEvent, c0 as CollectionConflictResolver, c1 as CollectionDescriptor, az as CollectionFrame, b5 as CollectionInstant, c2 as CollectionStats, c3 as ComputedFieldError, c4 as ComputedFields, c5 as ComputedFn, c6 as Conflict, c7 as ConflictPolicy, c8 as ConflictStrategy, aa as ConsentAuditEntry, ab as ConsentAuditFilter, ac as ConsentContext, ad as ConsentOp, c9 as CrossTierAccessEvent, ca as CrossVaultAggregation, cb as CrossVaultGroupedAggregation, cc as CrossVaultGroupedRow, cd as CrossVaultLiveAggregation, ce as CrossVaultLiveQuery, Y as DEFAULT_CHUNK_SIZE, cf as DEFAULT_PUBLIC_ENVELOPE_SCHEMA, cg as DELEGATIONS_COLLECTION, D as DICT_COLLECTION_PREFIX, ch as DeepPartial, ci as DeepPartialOrNull, cj as DeferredNumberingConfig, ck as DelegationToken, cl as DeleteManyResult, cm as DeploymentEvent, cn as DerivationDescriptor, aH as DerivationStrategy, aL as DerivationStrategyHandle, aM as DerivedFromMeta, a as DictEntry, b as DictKeyDescriptor, c as DictionaryHandle, d as DictionaryOptions, co as DirtyEntry, cp as DryRunResult, cq as DumpSchemaOptions, cr as ELEVATION_AUDIT_COLLECTION, cs as ElevatedHandle, b1 as EncryptedEnvelope, ct as EnrollAuthenticatorOptions, cu as EnrollAuthenticatorWrappingDEKsOptions, cv as EnrollAuthenticatorWrappingKEKOptions, cw as EnrollRecoveryResult, cx as ExportCapability, cy as ExportChunk, cz as ExportFormat, cA as ExportStreamOptions, cB as FactorKind, cC as FactorProofBundle, cD as FactorRequirement, cE as FanoutQueryOptions, cF as FanoutResult, cG as FenceDoc, cH as FenceState, cI as FieldChange, cJ as FieldDescriptor, cK as FieldSource, cL as GhostRecord, cM as GrantOptions, at as GuardChange, au as GuardContext, as as GuardStrategy, aw as GuardStrategyHandle, cN as GuardViolation, cO as HistoryConfig, cP as HistoryEntry, b0 as HistoryOptions, e as I18nMap, f as I18nTextDescriptor, g as I18nTextOptions, cQ as INDEXED_STORE_POLICY, cR as ImportCapability, cS as InferOutput, cT as InternalCollectionStats, cU as IssueDelegationOptions, cV as IssueMagicLinkGrantOptions, b7 as JsonPatch, b8 as JsonPatchOp, cW as KeyringAuthenticator, cX as KeyringAuthenticatorWrappingDEKs, cY as KeyringAuthenticatorWrappingKEK, cZ as KeyringFile, L as Layer, b9 as LedgerEntry, ba as LedgerStore, c_ as ListAccessibleVaultsOptions, c$ as ListPageResult, d0 as ListUsersOptions, d1 as LiveQueryOptions, d2 as LiveUserEnvelope, d3 as LocaleReadOptions, d4 as Lru, d5 as LruOptions, d6 as LruStats, d7 as MAGIC_LINK_CONTENT_INFO_PREFIX, d8 as MAGIC_LINK_GRANTS_COLLECTION, d9 as MAGIC_LINK_KEK_INFO_PREFIX, da as MagicLinkGrantPayload, db as MagicLinkGrantRecord, bz as MaterializedFromMeta, dc as MaterializedViewDescriptor, bA as MaterializedViewOutput, aP as MaterializedViewStrategy, aQ as MaterializedViewStrategyHandle, dd as MemoryRecipientSealer, de as MemorySealingKeyProvider, df as NOYDB_BACKUP_VERSION, dg as NOYDB_FORMAT_VERSION, dh as NOYDB_KEYRING_VERSION, di as NOYDB_SYNC_VERSION, dj as NextOptions, dk as Noydb, aB as NoydbBundleStore, dl as NoydbEventMap, dm as NoydbOptions, dn as NumberingAssignment, O as OnMissing, h as OnMissingPolicy, aj as OpenPeriodOptions, aN as OutputSpec, aT as OverlayFieldMergeMode, aU as OverlayFieldMergeRule, dp as OverlayViewDescriptor, aR as OverlayedViewStrategy, aW as OverlayedViewStrategyHandle, ak as PERIODS_COLLECTION, dq as PUBLIC_ENVELOPE_FIELDS, dr as PaperRecoveryDoc, ds as PaperRecoveryEntry, dt as PassphrasePolicy, du as PassphraseValidationResult, al as PeriodRecord, dv as Permission, dw as Permissions, dx as PersistedSchemaKind, dy as PlaintextTranslatorContext, dz as PlaintextTranslatorFn, P as PolicyEnforcer, dA as PresenceHandle, dB as PresencePeer, b2 as PruneOptions, dC as PublicEnvelopeField, dD as PublicEnvelopeSchema, dE as PublicEnvelopeText, dF as PullMode, dG as PullOptions, dH as PullPolicy, dI as PullResult, dJ as PushMode, dK as PushOptions, dL as PushPolicy, dM as PushResult, dN as PutManyItemOptions, dO as PutManyOptions, dP as PutManyResult, dQ as QueryAcrossOptions, dR as QueryAcrossResult, dS as QuickUnlockState, dT as QuickUnlockStore, dU as ReAuthOperation, br as RecipientHint, bq as RecipientSealer, aO as RecordOutputSpec, dV as RecoverPassphraseInput, dW as RecoverPassphraseResult, dX as RecoverUserOptions, dY as RecoveryProof, R as ResolveI18nOptions, dZ as ResolvedPublicEnvelopeSchema, aC as RetentionPolicy, d_ as RevokeOptions, aY as Role, d$ as RotatePassphraseInput, e0 as RotateRecoveryOptions, e1 as RotateRecoveryResult, e2 as SEALED_PASSPHRASE_RECORD_ID, e3 as SchemaDelta, e4 as SchemaIntrospection, e5 as SchemaManifestRow, S as ScriptWarning, e6 as SealedEnvelope, e7 as SealedPassphrase, bo as SealingKeyProvider, e8 as SequenceHandle, e9 as SequenceOptions, ea as SequenceStore, eb as SessionPolicy, ec as SetPublicEnvelopeInput, ed as ShamirRecoveryDoc, ee as ShamirRecoveryEntry, bu as ShamirRecoveryProvider, ef as ShardedCollection, eg as ShardedGroupedQuery, eh as ShardedQuery, ei as ShardingConfig, ej as SkippedVault, a3 as SlotInfo, a4 as SlotRecord, ek as SlotRewrapCeremony, el as SlotRewrapContext, aF as SnapshotMeta, em as StandardSchemaV1, en as StandardSchemaV1Issue, eo as StandardSchemaV1SyncResult, ep as StateManagementVault, eq as StoreAuth, er as StoreAuthKind, es as StoreCapabilities, et as StoreTime, eu as SyncEngine, ev as SyncMetadata, ew as SyncPolicy, ex as SyncScheduler, ey as SyncSchedulerStatus, ez as SyncStatus, eA as SyncTarget, eB as SyncTargetRole, eC as SyncTransaction, eD as SyncTransactionResult, eE as TabChannel, eF as TabCoordinationOptions, eG as TabLockManager, eH as TabPresence, eI as TabRole, eJ as TierMode, eK as TransactionInvariant, eL as TranslatorAuditEntry, eM as TxCollection, bv as TxContext, eN as TxOp, eO as TxVault, eP as USER_ENVELOPE_COLLECTION, eQ as USER_ENVELOPE_MAX_BYTES, bB as UnionArmJoin, bC as UnionSource, eR as Unsubscribe, eS as UpdateAuthenticatorOptions, eT as UpdateContext, eU as UpdateUserOptions, eV as UserApi, eW as UserEnvelopeCheckGate, eX as UserEnvelopeOversizedError, eY as UserEnvelopePresented, eZ as UserInfo, e_ as VaultBackup, bb as VaultEngine, aA as VaultFrame, e$ as VaultGroup, f0 as VaultGroupOptions, bc as VaultInstant, f1 as VaultPolicyOnDisk, f2 as VaultRegistryRow, f3 as VaultSchemaSnapshot, f4 as VaultSnapshot, f5 as VaultTemplate, bd as VerifyResult, a5 as VersionRecord, f6 as WarningRules, f7 as WeakPassphraseError, f8 as WeakPassphraseReason, f9 as WithArchiveOptions, fa as WrappedDeksBlob, fb as WriteConflict, fc as WriteEvent, fd as WriteHook, fe as WriteQueue, i as applyI18nLocale, be as applyPatch, ff as assertStrongPassphrase, fg as buildRecipientKeyringFile, fh as burnPaperRecoveryEntry, bf as canonicalJson, bg as computePatch, x as createEnforcer, fi as createNoydb, fj as createStore, fk as deriveMagicLinkContentKey, j as dictCollectionName, k as dictKey, bh as diff, l as enforceScript, fl as enrollAuthenticator, fm as estimateEntropy, fn as evalComputedFields, fo as evaluateExportCapability, fp as evaluateImportCapability, fq as findAuthenticator, bi as formatDiff, fr as hasExportCapability, fs as hasImportCapability, ft as hasRecoveryEnrolled, bj as hashEntry, n as i18nText, o as inferScripts, p as isDictCollectionName, q as isDictKeyDescriptor, r as isI18nTextDescriptor, fu as isMagicLinkGrantExpired, fv as isPublicEnvelope, fw as issueDelegation, fx as keyringRecoverPassphrase, fy as keyringRotatePassphrase, fz as listMagicLinkGrants, fA as listUsers, fB as listUsersWithEnvelopes, fC as loadActiveDelegations, fD as loadPaperRecoveryEntries, fE as loadSealedPassphrase, fF as loadShamirRecoveryEntries, fG as magicLinkGrantRecordId, fH as mintPaperRecoveryEntry, fI as mintShamirRecoveryEntry, fJ as mintWrappedDeksBlob, bk as paddedIndex, bl as parseIndex, fK as parseSealedEnvelope, fL as readMagicLinkGrantRecord, fM as recoverUser, fN as removeAuthenticator, s as resolveI18nText, t as resolvePolicy, fO as resolvePublicEnvelopeSchema, fP as resolveSequenceKey, fQ as revokeDelegation, fR as revokeMagicLinkGrant, fS as runTransaction, fT as savePaperRecoveryEntries, fU as saveSealedPassphrase, fV as saveShamirRecoveryEntries, bm as sha256Hex, fW as unwrapDeksFromBlob, fX as unwrapDeksFromPaperEntry, fY as unwrapDeksFromShamirEntry, fZ as unwrapMagicLinkGrant, v as validateI18nTextValue, f_ as validatePassphrase, f$ as validatePublicEnvelopeInput, g0 as validateSchemaInput, g1 as validateSchemaOutput, y as validateSessionPolicy, g2 as withArchive, g3 as withDeferredNumbering, g4 as writeMagicLinkGrant } from './types-Bze6vkwm.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 { a7 as NoydbError, a8 as RoundingMode } from './strategy-CbneC7bS.cjs';
6
- export { e as AggregateResult, f as AggregateSpec, g as Aggregation, h as AggregationUpstream, a9 as AlreadyElevatedError, B as AmendmentForbiddenError, W as AttestationError, Y as BackupCorruptedError, Z as BackupLedgerError, _ as BundleIntegrityError, $ as BundleSealMismatchError, a0 as BundleVersionConflictError, aa as ConflictError, ab as CrossJoinSourceUnknownError, ac as CrossJoinTooLargeError, ad as DanglingReferenceError, ae as DecryptionError, af as DelegationTargetMissingError, H as DerivationCapExceededError, J as DerivationCycleError, K as DerivationDepthError, N as DerivationOutputShapeError, O as DerivationOutputUnknownError, D as DictKeyInUseError, a as DictKeyMissingError, ag as DirectoryDisabledError, ah as ElevationExpiredError, ai as ExportCapabilityError, F as FieldFrozenError, aj as FilenameSanitizationError, G as GROUPBY_MAX_CARDINALITY, i as GROUPBY_WARN_CARDINALITY, ak as GroupCardinalityError, j as GroupedAggregation, k as GroupedQuery, l as GroupedQueryN, m as GroupedRow, n as GroupedRowN, al as ImportCapabilityError, am as IndexRequiredError, an as IndexWriteFailureError, ao as InvalidKeyError, I as InvariantError, ap as JoinTooLargeError, aq as KeyringCorruptError, ar as KeyringExpiredError, as as LedgerContentionError, o as LiveAggregation, L as LocaleNotSpecifiedError, a3 as MaterializedViewConfigError, a4 as MaterializedViewCycleError, a5 as MaterializedViewSourceUnknownError, a6 as MaterializedViewTooLargeError, at as MigrationRequiredError, M as MissingTranslationError, au as MoneyCurrencyError, av as MoneyDescriptor, aw as MoneyOptions, ax as MoneyOptionsFixed, ay as MoneyOptionsMulti, az as MoneyPrecisionError, aA as MoneyUnsupportedError, aB as NetworkError, aC as NoAccessError, aD as NonAdditiveSchemaChangeError, aE as NotFoundError, aF as NumberingUncertaintyError, P as OverlayBaseIsVirtualError, Q as OverlayCollectionUnavailableError, U as OverlayIdMismatchError, V as OverlayNameCollisionError, aG as PathEscapeError, aH as PeriodClosedError, aI as PermissionDeniedError, aJ as PrivilegeEscalationError, aK as QuiesceTimeoutError, aL as ReadOnlyAtInstantError, aM as ReadOnlyError, aN as ReadOnlyFrameError, C as RecordLockedError, p as Reducer, q as ReducerOptions, R as ReservedCollectionNameError, aO as ReservedVaultNameError, aP as SchemaFenceError, aQ as SchemaLockedError, aR as SchemaUpdateError, aS as SchemaValidationError, S as ScriptViolationError, aT as SequenceContentionError, aU as SequenceOfflineError, b as SessionExpiredError, c as SessionNotFoundError, d as SessionPolicyError, aV as ShardProvisioningError, E as SnapshotNotFoundError, aW as StoreCapabilityError, aX as TamperedError, aY as TierDemoteDeniedError, aZ as TierNotGrantedError, T as TranslatorNotConfiguredError, a_ as UniqueConstraintError, a$ as UnknownShardError, b0 as UnsupportedIndexOptionError, b1 as ValidationError, b2 as VaultTemplateNotFoundError, r as avg, t as count, u as groupAndReduce, b3 as isMoneyDescriptor, v as max, w as min, b4 as money, x as reduceRecords, z as sum } from './strategy-CbneC7bS.cjs';
7
- export { D as DEFAULT_CROSS_JOIN_MAX_ROWS, a as DEFAULT_JOIN_MAX_ROWS, J as JoinContext, b as JoinLeg, c as JoinStrategy, d as JoinableSource, L as LiveQuery, e as LiveUpstream, O as OrderBy, Q as Query, f as QueryPlan, g as QuerySource, R as RefDescriptor, h as RefIntegrityError, i as RefMode, j as RefRegistry, k as RefScopeError, l as RefViolation, S as ScanBuilder, m as ScanPageProvider, n as applyJoins, o as buildLiveQuery, p as executePlan, r as ref, q as resetJoinWarnings } from './index-D95VK1Qy.cjs';
8
- export { A as AutoCredential, n as AutoCredentialKind, c as CompressionAlgo, N as NOYDB_BUNDLE_FORMAT_VERSION, e as NOYDB_BUNDLE_MAGIC, f as NOYDB_BUNDLE_PREFIX_BYTES, g as NoydbBundleHeader, h as NoydbBundleReadResult, R as ReadNoydbBundleOptions, W as WriteNoydbBundleOptions, j as generateULID, o as hasNoydbBundleMagic, k as isULID, r as readNoydbBundle, l as readNoydbBundleHeader, p as readNoydbBundlePublicEnvelope, m as resetBrotliSupportCache, w as writeNoydbBundle } from './ulid-CiPrpGqm.cjs';
5
+ import { a7 as NoydbError, a8 as RoundingMode } from './strategy-BtW8fAjz.cjs';
6
+ export { e as AggregateResult, f as AggregateSpec, g as Aggregation, h as AggregationUpstream, a9 as AlreadyElevatedError, B as AmendmentForbiddenError, W as AttestationError, Y as BackupCorruptedError, Z as BackupLedgerError, _ as BundleIntegrityError, $ as BundleSealMismatchError, a0 as BundleVersionConflictError, aa as ConflictError, ab as CrossJoinSourceUnknownError, ac as CrossJoinTooLargeError, ad as DanglingReferenceError, ae as DecryptionError, af as DelegationTargetMissingError, H as DerivationCapExceededError, J as DerivationCycleError, K as DerivationDepthError, N as DerivationOutputShapeError, O as DerivationOutputUnknownError, D as DictKeyInUseError, a as DictKeyMissingError, ag as DirectoryDisabledError, ah as ElevationExpiredError, ai as ExportCapabilityError, F as FieldFrozenError, aj as FilenameSanitizationError, G as GROUPBY_MAX_CARDINALITY, i as GROUPBY_WARN_CARDINALITY, ak as GroupCardinalityError, j as GroupedAggregation, k as GroupedQuery, l as GroupedQueryN, m as GroupedRow, n as GroupedRowN, al as ImportCapabilityError, am as IndexRequiredError, an as IndexWriteFailureError, ao as InvalidKeyError, I as InvariantError, ap as JoinTooLargeError, aq as KeyringCorruptError, ar as KeyringExpiredError, as as LedgerContentionError, o as LiveAggregation, L as LocaleNotSpecifiedError, a3 as MaterializedViewConfigError, a4 as MaterializedViewCycleError, a5 as MaterializedViewSourceUnknownError, a6 as MaterializedViewTooLargeError, at as MigrationRequiredError, M as MissingTranslationError, au as MoneyCurrencyError, av as MoneyDescriptor, aw as MoneyOptions, ax as MoneyOptionsFixed, ay as MoneyOptionsMulti, az as MoneyPrecisionError, aA as MoneyUnsupportedError, aB as NetworkError, aC as NoAccessError, aD as NonAdditiveSchemaChangeError, aE as NotFoundError, aF as NumberingUncertaintyError, P as OverlayBaseIsVirtualError, Q as OverlayCollectionUnavailableError, U as OverlayIdMismatchError, V as OverlayNameCollisionError, aG as PathEscapeError, aH as PeriodClosedError, aI as PermissionDeniedError, aJ as PrivilegeEscalationError, aK as QuiesceTimeoutError, aL as ReadOnlyAtInstantError, aM as ReadOnlyError, aN as ReadOnlyFrameError, C as RecordLockedError, p as Reducer, q as ReducerOptions, R as ReservedCollectionNameError, aO as ReservedVaultNameError, aP as SchemaFenceError, aQ as SchemaLockedError, aR as SchemaUpdateError, aS as SchemaValidationError, S as ScriptViolationError, aT as SequenceContentionError, aU as SequenceOfflineError, b as SessionExpiredError, c as SessionNotFoundError, d as SessionPolicyError, aV as ShardProvisioningError, E as SnapshotNotFoundError, aW as StoreCapabilityError, aX as TamperedError, aY as TierDemoteDeniedError, aZ as TierNotGrantedError, T as TranslatorNotConfiguredError, a_ as UniqueConstraintError, a$ as UnknownShardError, b0 as UnsupportedIndexOptionError, b1 as ValidationError, b2 as VaultTemplateNotFoundError, r as avg, t as count, u as groupAndReduce, b3 as isMoneyDescriptor, v as max, w as min, b4 as money, x as reduceRecords, z as sum } from './strategy-BtW8fAjz.cjs';
7
+ export { D as DEFAULT_CROSS_JOIN_MAX_ROWS, a as DEFAULT_JOIN_MAX_ROWS, J as JoinContext, b as JoinLeg, c as JoinStrategy, d as JoinableSource, L as LiveQuery, e as LiveUpstream, O as OrderBy, Q as Query, f as QueryPlan, g as QuerySource, R as RefDescriptor, h as RefIntegrityError, i as RefMode, j as RefRegistry, k as RefScopeError, l as RefViolation, S as ScanBuilder, m as ScanPageProvider, n as applyJoins, o as buildLiveQuery, p as executePlan, r as ref, q as resetJoinWarnings } from './index-C8Bk3-VF.cjs';
8
+ export { A as AutoCredential, n as AutoCredentialKind, c as CompressionAlgo, N as NOYDB_BUNDLE_FORMAT_VERSION, e as NOYDB_BUNDLE_MAGIC, f as NOYDB_BUNDLE_PREFIX_BYTES, g as NoydbBundleHeader, h as NoydbBundleReadResult, R as ReadNoydbBundleOptions, W as WriteNoydbBundleOptions, j as generateULID, o as hasNoydbBundleMagic, k as isULID, r as readNoydbBundle, l as readNoydbBundleHeader, p as readNoydbBundlePublicEnvelope, m as resetBrotliSupportCache, w as writeNoydbBundle } from './ulid-DfZlAh0u.cjs';
9
9
  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';
10
- export { I as ImmutableGuardConfig, i as immutableGuard, w as withGuard } from './immutable-guard-yBEOYmif.cjs';
11
- export { w as withDerivation } from './with-derivation-DBqJB3dQ.cjs';
12
- export { w as withMaterializedView } from './with-materialized-view-NzuxYPDF.cjs';
10
+ export { TransactionStrategyOptions } from './tx/index.cjs';
11
+ export { I as ImmutableGuardConfig, i as immutableGuard, w as withGuard } from './immutable-guard-CRPvu24K.cjs';
12
+ export { w as withDerivation } from './with-derivation-CCqAchD5.cjs';
13
+ export { w as withMaterializedView } from './with-materialized-view--4PsvMDu.cjs';
13
14
  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-BmhBSPCH.cjs';
14
- export { w as withOverlayedView } from './with-overlayed-view-CC0_ocy-.cjs';
15
+ export { w as withOverlayedView } from './with-overlayed-view-DlH5qmeB.cjs';
15
16
  export { SYNC_CREDENTIALS_COLLECTION, SyncCredential, credentialStatus, deleteCredential, getCredential, listCredentials, putCredential } from './team/index.cjs';
16
- 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-nVkuRLLe.cjs';
17
+ 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-8XzcD2Z4.cjs';
17
18
  export { i as isDiscriminant } from './discriminant-BN9REW3o.cjs';
18
- export { L as LEDGER_COLLECTION, a as LEDGER_DELTAS_COLLECTION, e as envelopePayloadHash } from './hash-Cv6byZs7.cjs';
19
+ export { L as LEDGER_COLLECTION, a as LEDGER_DELTAS_COLLECTION, e as envelopePayloadHash } from './hash-DuQ88_5W.cjs';
19
20
  import './lazy-builder-eYZzLEL1.cjs';
20
21
  import '@noy-db/attestation';
21
22
 
package/dist/index.d.ts CHANGED
@@ -1,21 +1,22 @@
1
- import { b3 as NoydbStore, bF as UserEnvelope, br as PublicEnvelope, bG as GateName, bH as GatePolicy, bI as VaultPolicy, bJ as ActiveTier, bK as FactorProof, bL as SchemaUpdateStrategy, bM as TransformFn, bN as PersistedSchemaEnvelope, bO as UpdateDecision, bP as DirectoryConfig, bQ as UserVisibility, b1 as UnlockedKeyring, bw as Vault, ba as DiffEntry } from './types-4t1-tWS4.js';
2
- export { bR as AccessibleVault, bS as AffectedDocument, b7 as AppendInput, bT as ArchivePolicy, bU as ArchiveResult, bV as ArchiveRunOptions, bW as ArchiveStrategy, aP as ArrayOutputSpec, z as BLOB_CHUNKS_COLLECTION, A as BLOB_COLLECTION, E as BLOB_INDEX_COLLECTION, F as BLOB_SLOTS_PREFIX, G as BLOB_VERSIONS_PREFIX, bX as BUNDLE_STORE_POLICY, M as BlobObject, N as BlobPutOptions, Q as BlobResponseOptions, T as BlobSet, bY as BuiltInGateName, bt as BundleRecipient, a9 as CONSENT_AUDIT_COLLECTION, bZ as CacheOptions, b_ as CacheStats, b$ as CapturedBlueprint, c0 as ChangeEvent, b8 as ChangeType, ai as ClosePeriodOptions, aY as Collection, c1 as CollectionChangeEvent, c2 as CollectionConflictResolver, c3 as CollectionDescriptor, az as CollectionFrame, b9 as CollectionInstant, c4 as CollectionStats, c5 as ComputedFieldError, c6 as ComputedFields, c7 as ComputedFn, c8 as Conflict, c9 as ConflictPolicy, ca as ConflictStrategy, aa as ConsentAuditEntry, ab as ConsentAuditFilter, ac as ConsentContext, ad as ConsentOp, cb as CrossTierAccessEvent, cc as CrossVaultAggregation, cd as CrossVaultGroupedAggregation, ce as CrossVaultGroupedRow, cf as CrossVaultLiveAggregation, cg as CrossVaultLiveQuery, Y as DEFAULT_CHUNK_SIZE, ch as DEFAULT_PUBLIC_ENVELOPE_SCHEMA, ci as DELEGATIONS_COLLECTION, D as DICT_COLLECTION_PREFIX, cj as DeepPartial, ck as DeepPartialOrNull, cl as DeferredNumberingConfig, cm as DelegationToken, cn as DeleteManyResult, co as DeploymentEvent, cp as DerivationDescriptor, aN as DerivationStrategy, aR as DerivationStrategyHandle, aS as DerivedFromMeta, a as DictEntry, b as DictKeyDescriptor, c as DictionaryHandle, d as DictionaryOptions, cq as DirtyEntry, cr as DryRunResult, cs as DumpSchemaOptions, ct as ELEVATION_AUDIT_COLLECTION, cu as ElevatedHandle, b5 as EncryptedEnvelope, cv as EnrollAuthenticatorOptions, cw as EnrollAuthenticatorWrappingDEKsOptions, cx as EnrollAuthenticatorWrappingKEKOptions, cy as EnrollRecoveryResult, cz as ExportCapability, cA as ExportChunk, cB as ExportFormat, cC as ExportStreamOptions, cD as FactorKind, cE as FactorProofBundle, cF as FactorRequirement, cG as FanoutQueryOptions, cH as FanoutResult, cI as FenceDoc, cJ as FenceState, cK as FieldChange, cL as FieldDescriptor, cM as FieldSource, cN as GhostRecord, cO as GrantOptions, at as GuardChange, au as GuardContext, as as GuardStrategy, aw as GuardStrategyHandle, cP as GuardViolation, cQ as HistoryConfig, cR as HistoryEntry, b4 as HistoryOptions, e as I18nMap, f as I18nTextDescriptor, g as I18nTextOptions, cS as INDEXED_STORE_POLICY, cT as ImportCapability, cU as InferOutput, cV as InternalCollectionStats, cW as IssueDelegationOptions, cX as IssueMagicLinkGrantOptions, bb as JsonPatch, bc as JsonPatchOp, cY as KeyringAuthenticator, cZ as KeyringAuthenticatorWrappingDEKs, c_ as KeyringAuthenticatorWrappingKEK, c$ as KeyringFile, L as Layer, bd as LedgerEntry, be as LedgerStore, d0 as ListAccessibleVaultsOptions, d1 as ListPageResult, d2 as ListUsersOptions, d3 as LiveQueryOptions, d4 as LiveUserEnvelope, d5 as LocaleReadOptions, d6 as Lru, d7 as LruOptions, d8 as LruStats, d9 as MAGIC_LINK_CONTENT_INFO_PREFIX, da as MAGIC_LINK_GRANTS_COLLECTION, db as MAGIC_LINK_KEK_INFO_PREFIX, dc as MagicLinkGrantPayload, dd as MagicLinkGrantRecord, bC as MaterializedFromMeta, de as MaterializedViewDescriptor, bD as MaterializedViewOutput, aV as MaterializedViewStrategy, aW as MaterializedViewStrategyHandle, df as MemoryRecipientSealer, dg as MemorySealingKeyProvider, dh as NOYDB_BACKUP_VERSION, di as NOYDB_FORMAT_VERSION, dj as NOYDB_KEYRING_VERSION, dk as NOYDB_SYNC_VERSION, dl as NextOptions, dm as Noydb, aB as NoydbBundleStore, dn as NoydbEventMap, dp as NoydbOptions, dq as NumberingAssignment, O as OnMissing, h as OnMissingPolicy, aj as OpenPeriodOptions, aT as OutputSpec, dr as OverlayViewDescriptor, aX as OverlayedViewStrategy, a_ as OverlayedViewStrategyHandle, ak as PERIODS_COLLECTION, ds as PUBLIC_ENVELOPE_FIELDS, dt as PaperRecoveryDoc, du as PaperRecoveryEntry, dv as PassphrasePolicy, dw as PassphraseValidationResult, al as PeriodRecord, dx as Permission, dy as Permissions, dz as PersistedSchemaKind, dA as PlaintextTranslatorContext, dB as PlaintextTranslatorFn, P as PolicyEnforcer, dC as PresenceHandle, dD as PresencePeer, b6 as PruneOptions, dE as PublicEnvelopeField, dF as PublicEnvelopeSchema, dG as PublicEnvelopeText, dH as PullMode, dI as PullOptions, dJ as PullPolicy, dK as PullResult, dL as PushMode, dM as PushOptions, dN as PushPolicy, dO as PushResult, dP as PutManyItemOptions, dQ as PutManyOptions, dR as PutManyResult, dS as QueryAcrossOptions, dT as QueryAcrossResult, dU as QuickUnlockState, dV as QuickUnlockStore, dW as ReAuthOperation, bv as RecipientHint, bu as RecipientSealer, aU as RecordOutputSpec, dX as RecoverPassphraseInput, dY as RecoverPassphraseResult, dZ as RecoverUserOptions, d_ as RecoveryProof, R as ResolveI18nOptions, d$ as ResolvedPublicEnvelopeSchema, aC as RetentionPolicy, e0 as RevokeOptions, b0 as Role, e1 as RotatePassphraseInput, e2 as RotateRecoveryOptions, e3 as RotateRecoveryResult, e4 as SEALED_PASSPHRASE_RECORD_ID, e5 as SchemaDelta, e6 as SchemaIntrospection, e7 as SchemaManifestRow, S as ScriptWarning, e8 as SealedEnvelope, e9 as SealedPassphrase, bs as SealingKeyProvider, ea as SequenceHandle, eb as SequenceStore, ec as SessionPolicy, ed as SetPublicEnvelopeInput, ee as ShamirRecoveryDoc, ef as ShamirRecoveryEntry, by as ShamirRecoveryProvider, eg as ShardedCollection, eh as ShardedGroupedQuery, ei as ShardedQuery, ej as ShardingConfig, ek as SkippedVault, a3 as SlotInfo, a4 as SlotRecord, el as SlotRewrapCeremony, em as SlotRewrapContext, aF as SnapshotMeta, en as StandardSchemaV1, eo as StandardSchemaV1Issue, ep as StandardSchemaV1SyncResult, eq as StateManagementVault, er as StoreAuth, es as StoreAuthKind, et as StoreCapabilities, eu as StoreTime, ev as SyncEngine, ew as SyncMetadata, ex as SyncPolicy, ey as SyncScheduler, ez as SyncSchedulerStatus, eA as SyncStatus, eB as SyncTarget, eC as SyncTargetRole, eD as SyncTransaction, eE as SyncTransactionResult, eF as TabChannel, eG as TabCoordinationOptions, eH as TabLockManager, eI as TabPresence, eJ as TabRole, eK as TierMode, eL as TranslatorAuditEntry, aJ as TxCollection, aK as TxContext, eM as TxOp, aL as TxVault, eN as USER_ENVELOPE_COLLECTION, eO as USER_ENVELOPE_MAX_BYTES, bE as UnionSource, eP as Unsubscribe, eQ as UpdateAuthenticatorOptions, eR as UpdateContext, eS as UpdateUserOptions, eT as UserApi, eU as UserEnvelopeCheckGate, eV as UserEnvelopeOversizedError, eW as UserEnvelopePresented, eX as UserInfo, eY as VaultBackup, bf as VaultEngine, aA as VaultFrame, eZ as VaultGroup, e_ as VaultGroupOptions, bg as VaultInstant, e$ as VaultPolicyOnDisk, f0 as VaultRegistryRow, f1 as VaultSchemaSnapshot, f2 as VaultSnapshot, f3 as VaultTemplate, bh as VerifyResult, a5 as VersionRecord, f4 as WarningRules, f5 as WeakPassphraseError, f6 as WeakPassphraseReason, f7 as WithArchiveOptions, f8 as WrappedDeksBlob, f9 as WriteConflict, fa as WriteEvent, fb as WriteHook, fc as WriteQueue, i as applyI18nLocale, bi as applyPatch, fd as assertStrongPassphrase, fe as buildRecipientKeyringFile, ff as burnPaperRecoveryEntry, bj as canonicalJson, bk as computePatch, x as createEnforcer, fg as createNoydb, fh as createStore, fi as deriveMagicLinkContentKey, j as dictCollectionName, k as dictKey, bl as diff, l as enforceScript, fj as enrollAuthenticator, fk as estimateEntropy, fl as evalComputedFields, fm as evaluateExportCapability, fn as evaluateImportCapability, fo as findAuthenticator, bm as formatDiff, fp as hasExportCapability, fq as hasImportCapability, fr as hasRecoveryEnrolled, bn as hashEntry, n as i18nText, o as inferScripts, p as isDictCollectionName, q as isDictKeyDescriptor, r as isI18nTextDescriptor, fs as isMagicLinkGrantExpired, ft as isPublicEnvelope, fu as issueDelegation, fv as keyringRecoverPassphrase, fw as keyringRotatePassphrase, fx as listMagicLinkGrants, fy as listUsers, fz as listUsersWithEnvelopes, fA as loadActiveDelegations, fB as loadPaperRecoveryEntries, fC as loadSealedPassphrase, fD as loadShamirRecoveryEntries, fE as magicLinkGrantRecordId, fF as mintPaperRecoveryEntry, fG as mintShamirRecoveryEntry, fH as mintWrappedDeksBlob, bo as paddedIndex, bp as parseIndex, fI as parseSealedEnvelope, fJ as readMagicLinkGrantRecord, fK as recoverUser, fL as removeAuthenticator, s as resolveI18nText, t as resolvePolicy, fM as resolvePublicEnvelopeSchema, fN as revokeDelegation, fO as revokeMagicLinkGrant, aM as runTransaction, fP as savePaperRecoveryEntries, fQ as saveSealedPassphrase, fR as saveShamirRecoveryEntries, bq as sha256Hex, fS as unwrapDeksFromBlob, fT as unwrapDeksFromPaperEntry, fU as unwrapDeksFromShamirEntry, fV as unwrapMagicLinkGrant, v as validateI18nTextValue, fW as validatePassphrase, fX as validatePublicEnvelopeInput, fY as validateSchemaInput, fZ as validateSchemaOutput, y as validateSessionPolicy, f_ as withArchive, f$ as withDeferredNumbering, g0 as writeMagicLinkGrant } from './types-4t1-tWS4.js';
1
+ import { a$ as NoydbStore, bD as UserEnvelope, bn as PublicEnvelope, bE as GateName, bF as GatePolicy, bG as VaultPolicy, bH as ActiveTier, bI as FactorProof, bJ as SchemaUpdateStrategy, bK as TransformFn, bL as PersistedSchemaEnvelope, bM as UpdateDecision, bN as DirectoryConfig, bO as UserVisibility, aZ as UnlockedKeyring, bs as Vault, b6 as DiffEntry } from './types-DrmBTscX.js';
2
+ export { bP as AccessibleVault, bQ as AffectedDocument, b3 as AppendInput, bR as ArchivePolicy, bS as ArchiveResult, bT as ArchiveRunOptions, bU as ArchiveStrategy, aJ as ArrayOutputSpec, z as BLOB_CHUNKS_COLLECTION, A as BLOB_COLLECTION, E as BLOB_INDEX_COLLECTION, F as BLOB_SLOTS_PREFIX, G as BLOB_VERSIONS_PREFIX, bV as BUNDLE_STORE_POLICY, M as BlobObject, N as BlobPutOptions, Q as BlobResponseOptions, T as BlobSet, bW as BuiltInGateName, bp as BundleRecipient, a9 as CONSENT_AUDIT_COLLECTION, bX as CacheOptions, bY as CacheStats, bZ as CapturedBlueprint, b_ as ChangeEvent, b4 as ChangeType, ai as ClosePeriodOptions, aS as Collection, b$ as CollectionChangeEvent, c0 as CollectionConflictResolver, c1 as CollectionDescriptor, az as CollectionFrame, b5 as CollectionInstant, c2 as CollectionStats, c3 as ComputedFieldError, c4 as ComputedFields, c5 as ComputedFn, c6 as Conflict, c7 as ConflictPolicy, c8 as ConflictStrategy, aa as ConsentAuditEntry, ab as ConsentAuditFilter, ac as ConsentContext, ad as ConsentOp, c9 as CrossTierAccessEvent, ca as CrossVaultAggregation, cb as CrossVaultGroupedAggregation, cc as CrossVaultGroupedRow, cd as CrossVaultLiveAggregation, ce as CrossVaultLiveQuery, Y as DEFAULT_CHUNK_SIZE, cf as DEFAULT_PUBLIC_ENVELOPE_SCHEMA, cg as DELEGATIONS_COLLECTION, D as DICT_COLLECTION_PREFIX, ch as DeepPartial, ci as DeepPartialOrNull, cj as DeferredNumberingConfig, ck as DelegationToken, cl as DeleteManyResult, cm as DeploymentEvent, cn as DerivationDescriptor, aH as DerivationStrategy, aL as DerivationStrategyHandle, aM as DerivedFromMeta, a as DictEntry, b as DictKeyDescriptor, c as DictionaryHandle, d as DictionaryOptions, co as DirtyEntry, cp as DryRunResult, cq as DumpSchemaOptions, cr as ELEVATION_AUDIT_COLLECTION, cs as ElevatedHandle, b1 as EncryptedEnvelope, ct as EnrollAuthenticatorOptions, cu as EnrollAuthenticatorWrappingDEKsOptions, cv as EnrollAuthenticatorWrappingKEKOptions, cw as EnrollRecoveryResult, cx as ExportCapability, cy as ExportChunk, cz as ExportFormat, cA as ExportStreamOptions, cB as FactorKind, cC as FactorProofBundle, cD as FactorRequirement, cE as FanoutQueryOptions, cF as FanoutResult, cG as FenceDoc, cH as FenceState, cI as FieldChange, cJ as FieldDescriptor, cK as FieldSource, cL as GhostRecord, cM as GrantOptions, at as GuardChange, au as GuardContext, as as GuardStrategy, aw as GuardStrategyHandle, cN as GuardViolation, cO as HistoryConfig, cP as HistoryEntry, b0 as HistoryOptions, e as I18nMap, f as I18nTextDescriptor, g as I18nTextOptions, cQ as INDEXED_STORE_POLICY, cR as ImportCapability, cS as InferOutput, cT as InternalCollectionStats, cU as IssueDelegationOptions, cV as IssueMagicLinkGrantOptions, b7 as JsonPatch, b8 as JsonPatchOp, cW as KeyringAuthenticator, cX as KeyringAuthenticatorWrappingDEKs, cY as KeyringAuthenticatorWrappingKEK, cZ as KeyringFile, L as Layer, b9 as LedgerEntry, ba as LedgerStore, c_ as ListAccessibleVaultsOptions, c$ as ListPageResult, d0 as ListUsersOptions, d1 as LiveQueryOptions, d2 as LiveUserEnvelope, d3 as LocaleReadOptions, d4 as Lru, d5 as LruOptions, d6 as LruStats, d7 as MAGIC_LINK_CONTENT_INFO_PREFIX, d8 as MAGIC_LINK_GRANTS_COLLECTION, d9 as MAGIC_LINK_KEK_INFO_PREFIX, da as MagicLinkGrantPayload, db as MagicLinkGrantRecord, bz as MaterializedFromMeta, dc as MaterializedViewDescriptor, bA as MaterializedViewOutput, aP as MaterializedViewStrategy, aQ as MaterializedViewStrategyHandle, dd as MemoryRecipientSealer, de as MemorySealingKeyProvider, df as NOYDB_BACKUP_VERSION, dg as NOYDB_FORMAT_VERSION, dh as NOYDB_KEYRING_VERSION, di as NOYDB_SYNC_VERSION, dj as NextOptions, dk as Noydb, aB as NoydbBundleStore, dl as NoydbEventMap, dm as NoydbOptions, dn as NumberingAssignment, O as OnMissing, h as OnMissingPolicy, aj as OpenPeriodOptions, aN as OutputSpec, aT as OverlayFieldMergeMode, aU as OverlayFieldMergeRule, dp as OverlayViewDescriptor, aR as OverlayedViewStrategy, aW as OverlayedViewStrategyHandle, ak as PERIODS_COLLECTION, dq as PUBLIC_ENVELOPE_FIELDS, dr as PaperRecoveryDoc, ds as PaperRecoveryEntry, dt as PassphrasePolicy, du as PassphraseValidationResult, al as PeriodRecord, dv as Permission, dw as Permissions, dx as PersistedSchemaKind, dy as PlaintextTranslatorContext, dz as PlaintextTranslatorFn, P as PolicyEnforcer, dA as PresenceHandle, dB as PresencePeer, b2 as PruneOptions, dC as PublicEnvelopeField, dD as PublicEnvelopeSchema, dE as PublicEnvelopeText, dF as PullMode, dG as PullOptions, dH as PullPolicy, dI as PullResult, dJ as PushMode, dK as PushOptions, dL as PushPolicy, dM as PushResult, dN as PutManyItemOptions, dO as PutManyOptions, dP as PutManyResult, dQ as QueryAcrossOptions, dR as QueryAcrossResult, dS as QuickUnlockState, dT as QuickUnlockStore, dU as ReAuthOperation, br as RecipientHint, bq as RecipientSealer, aO as RecordOutputSpec, dV as RecoverPassphraseInput, dW as RecoverPassphraseResult, dX as RecoverUserOptions, dY as RecoveryProof, R as ResolveI18nOptions, dZ as ResolvedPublicEnvelopeSchema, aC as RetentionPolicy, d_ as RevokeOptions, aY as Role, d$ as RotatePassphraseInput, e0 as RotateRecoveryOptions, e1 as RotateRecoveryResult, e2 as SEALED_PASSPHRASE_RECORD_ID, e3 as SchemaDelta, e4 as SchemaIntrospection, e5 as SchemaManifestRow, S as ScriptWarning, e6 as SealedEnvelope, e7 as SealedPassphrase, bo as SealingKeyProvider, e8 as SequenceHandle, e9 as SequenceOptions, ea as SequenceStore, eb as SessionPolicy, ec as SetPublicEnvelopeInput, ed as ShamirRecoveryDoc, ee as ShamirRecoveryEntry, bu as ShamirRecoveryProvider, ef as ShardedCollection, eg as ShardedGroupedQuery, eh as ShardedQuery, ei as ShardingConfig, ej as SkippedVault, a3 as SlotInfo, a4 as SlotRecord, ek as SlotRewrapCeremony, el as SlotRewrapContext, aF as SnapshotMeta, em as StandardSchemaV1, en as StandardSchemaV1Issue, eo as StandardSchemaV1SyncResult, ep as StateManagementVault, eq as StoreAuth, er as StoreAuthKind, es as StoreCapabilities, et as StoreTime, eu as SyncEngine, ev as SyncMetadata, ew as SyncPolicy, ex as SyncScheduler, ey as SyncSchedulerStatus, ez as SyncStatus, eA as SyncTarget, eB as SyncTargetRole, eC as SyncTransaction, eD as SyncTransactionResult, eE as TabChannel, eF as TabCoordinationOptions, eG as TabLockManager, eH as TabPresence, eI as TabRole, eJ as TierMode, eK as TransactionInvariant, eL as TranslatorAuditEntry, eM as TxCollection, bv as TxContext, eN as TxOp, eO as TxVault, eP as USER_ENVELOPE_COLLECTION, eQ as USER_ENVELOPE_MAX_BYTES, bB as UnionArmJoin, bC as UnionSource, eR as Unsubscribe, eS as UpdateAuthenticatorOptions, eT as UpdateContext, eU as UpdateUserOptions, eV as UserApi, eW as UserEnvelopeCheckGate, eX as UserEnvelopeOversizedError, eY as UserEnvelopePresented, eZ as UserInfo, e_ as VaultBackup, bb as VaultEngine, aA as VaultFrame, e$ as VaultGroup, f0 as VaultGroupOptions, bc as VaultInstant, f1 as VaultPolicyOnDisk, f2 as VaultRegistryRow, f3 as VaultSchemaSnapshot, f4 as VaultSnapshot, f5 as VaultTemplate, bd as VerifyResult, a5 as VersionRecord, f6 as WarningRules, f7 as WeakPassphraseError, f8 as WeakPassphraseReason, f9 as WithArchiveOptions, fa as WrappedDeksBlob, fb as WriteConflict, fc as WriteEvent, fd as WriteHook, fe as WriteQueue, i as applyI18nLocale, be as applyPatch, ff as assertStrongPassphrase, fg as buildRecipientKeyringFile, fh as burnPaperRecoveryEntry, bf as canonicalJson, bg as computePatch, x as createEnforcer, fi as createNoydb, fj as createStore, fk as deriveMagicLinkContentKey, j as dictCollectionName, k as dictKey, bh as diff, l as enforceScript, fl as enrollAuthenticator, fm as estimateEntropy, fn as evalComputedFields, fo as evaluateExportCapability, fp as evaluateImportCapability, fq as findAuthenticator, bi as formatDiff, fr as hasExportCapability, fs as hasImportCapability, ft as hasRecoveryEnrolled, bj as hashEntry, n as i18nText, o as inferScripts, p as isDictCollectionName, q as isDictKeyDescriptor, r as isI18nTextDescriptor, fu as isMagicLinkGrantExpired, fv as isPublicEnvelope, fw as issueDelegation, fx as keyringRecoverPassphrase, fy as keyringRotatePassphrase, fz as listMagicLinkGrants, fA as listUsers, fB as listUsersWithEnvelopes, fC as loadActiveDelegations, fD as loadPaperRecoveryEntries, fE as loadSealedPassphrase, fF as loadShamirRecoveryEntries, fG as magicLinkGrantRecordId, fH as mintPaperRecoveryEntry, fI as mintShamirRecoveryEntry, fJ as mintWrappedDeksBlob, bk as paddedIndex, bl as parseIndex, fK as parseSealedEnvelope, fL as readMagicLinkGrantRecord, fM as recoverUser, fN as removeAuthenticator, s as resolveI18nText, t as resolvePolicy, fO as resolvePublicEnvelopeSchema, fP as resolveSequenceKey, fQ as revokeDelegation, fR as revokeMagicLinkGrant, fS as runTransaction, fT as savePaperRecoveryEntries, fU as saveSealedPassphrase, fV as saveShamirRecoveryEntries, bm as sha256Hex, fW as unwrapDeksFromBlob, fX as unwrapDeksFromPaperEntry, fY as unwrapDeksFromShamirEntry, fZ as unwrapMagicLinkGrant, v as validateI18nTextValue, f_ as validatePassphrase, f$ as validatePublicEnvelopeInput, g0 as validateSchemaInput, g1 as validateSchemaOutput, y as validateSessionPolicy, g2 as withArchive, g3 as withDeferredNumbering, g4 as writeMagicLinkGrant } from './types-DrmBTscX.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 { a7 as NoydbError, a8 as RoundingMode } from './strategy-CbneC7bS.js';
6
- export { e as AggregateResult, f as AggregateSpec, g as Aggregation, h as AggregationUpstream, a9 as AlreadyElevatedError, B as AmendmentForbiddenError, W as AttestationError, Y as BackupCorruptedError, Z as BackupLedgerError, _ as BundleIntegrityError, $ as BundleSealMismatchError, a0 as BundleVersionConflictError, aa as ConflictError, ab as CrossJoinSourceUnknownError, ac as CrossJoinTooLargeError, ad as DanglingReferenceError, ae as DecryptionError, af as DelegationTargetMissingError, H as DerivationCapExceededError, J as DerivationCycleError, K as DerivationDepthError, N as DerivationOutputShapeError, O as DerivationOutputUnknownError, D as DictKeyInUseError, a as DictKeyMissingError, ag as DirectoryDisabledError, ah as ElevationExpiredError, ai as ExportCapabilityError, F as FieldFrozenError, aj as FilenameSanitizationError, G as GROUPBY_MAX_CARDINALITY, i as GROUPBY_WARN_CARDINALITY, ak as GroupCardinalityError, j as GroupedAggregation, k as GroupedQuery, l as GroupedQueryN, m as GroupedRow, n as GroupedRowN, al as ImportCapabilityError, am as IndexRequiredError, an as IndexWriteFailureError, ao as InvalidKeyError, I as InvariantError, ap as JoinTooLargeError, aq as KeyringCorruptError, ar as KeyringExpiredError, as as LedgerContentionError, o as LiveAggregation, L as LocaleNotSpecifiedError, a3 as MaterializedViewConfigError, a4 as MaterializedViewCycleError, a5 as MaterializedViewSourceUnknownError, a6 as MaterializedViewTooLargeError, at as MigrationRequiredError, M as MissingTranslationError, au as MoneyCurrencyError, av as MoneyDescriptor, aw as MoneyOptions, ax as MoneyOptionsFixed, ay as MoneyOptionsMulti, az as MoneyPrecisionError, aA as MoneyUnsupportedError, aB as NetworkError, aC as NoAccessError, aD as NonAdditiveSchemaChangeError, aE as NotFoundError, aF as NumberingUncertaintyError, P as OverlayBaseIsVirtualError, Q as OverlayCollectionUnavailableError, U as OverlayIdMismatchError, V as OverlayNameCollisionError, aG as PathEscapeError, aH as PeriodClosedError, aI as PermissionDeniedError, aJ as PrivilegeEscalationError, aK as QuiesceTimeoutError, aL as ReadOnlyAtInstantError, aM as ReadOnlyError, aN as ReadOnlyFrameError, C as RecordLockedError, p as Reducer, q as ReducerOptions, R as ReservedCollectionNameError, aO as ReservedVaultNameError, aP as SchemaFenceError, aQ as SchemaLockedError, aR as SchemaUpdateError, aS as SchemaValidationError, S as ScriptViolationError, aT as SequenceContentionError, aU as SequenceOfflineError, b as SessionExpiredError, c as SessionNotFoundError, d as SessionPolicyError, aV as ShardProvisioningError, E as SnapshotNotFoundError, aW as StoreCapabilityError, aX as TamperedError, aY as TierDemoteDeniedError, aZ as TierNotGrantedError, T as TranslatorNotConfiguredError, a_ as UniqueConstraintError, a$ as UnknownShardError, b0 as UnsupportedIndexOptionError, b1 as ValidationError, b2 as VaultTemplateNotFoundError, r as avg, t as count, u as groupAndReduce, b3 as isMoneyDescriptor, v as max, w as min, b4 as money, x as reduceRecords, z as sum } from './strategy-CbneC7bS.js';
7
- export { D as DEFAULT_CROSS_JOIN_MAX_ROWS, a as DEFAULT_JOIN_MAX_ROWS, J as JoinContext, b as JoinLeg, c as JoinStrategy, d as JoinableSource, L as LiveQuery, e as LiveUpstream, O as OrderBy, Q as Query, f as QueryPlan, g as QuerySource, R as RefDescriptor, h as RefIntegrityError, i as RefMode, j as RefRegistry, k as RefScopeError, l as RefViolation, S as ScanBuilder, m as ScanPageProvider, n as applyJoins, o as buildLiveQuery, p as executePlan, r as ref, q as resetJoinWarnings } from './index-XNB2r6bX.js';
8
- export { A as AutoCredential, n as AutoCredentialKind, c as CompressionAlgo, N as NOYDB_BUNDLE_FORMAT_VERSION, e as NOYDB_BUNDLE_MAGIC, f as NOYDB_BUNDLE_PREFIX_BYTES, g as NoydbBundleHeader, h as NoydbBundleReadResult, R as ReadNoydbBundleOptions, W as WriteNoydbBundleOptions, j as generateULID, o as hasNoydbBundleMagic, k as isULID, r as readNoydbBundle, l as readNoydbBundleHeader, p as readNoydbBundlePublicEnvelope, m as resetBrotliSupportCache, w as writeNoydbBundle } from './ulid-DAfenvFd.js';
5
+ import { a7 as NoydbError, a8 as RoundingMode } from './strategy-BtW8fAjz.js';
6
+ export { e as AggregateResult, f as AggregateSpec, g as Aggregation, h as AggregationUpstream, a9 as AlreadyElevatedError, B as AmendmentForbiddenError, W as AttestationError, Y as BackupCorruptedError, Z as BackupLedgerError, _ as BundleIntegrityError, $ as BundleSealMismatchError, a0 as BundleVersionConflictError, aa as ConflictError, ab as CrossJoinSourceUnknownError, ac as CrossJoinTooLargeError, ad as DanglingReferenceError, ae as DecryptionError, af as DelegationTargetMissingError, H as DerivationCapExceededError, J as DerivationCycleError, K as DerivationDepthError, N as DerivationOutputShapeError, O as DerivationOutputUnknownError, D as DictKeyInUseError, a as DictKeyMissingError, ag as DirectoryDisabledError, ah as ElevationExpiredError, ai as ExportCapabilityError, F as FieldFrozenError, aj as FilenameSanitizationError, G as GROUPBY_MAX_CARDINALITY, i as GROUPBY_WARN_CARDINALITY, ak as GroupCardinalityError, j as GroupedAggregation, k as GroupedQuery, l as GroupedQueryN, m as GroupedRow, n as GroupedRowN, al as ImportCapabilityError, am as IndexRequiredError, an as IndexWriteFailureError, ao as InvalidKeyError, I as InvariantError, ap as JoinTooLargeError, aq as KeyringCorruptError, ar as KeyringExpiredError, as as LedgerContentionError, o as LiveAggregation, L as LocaleNotSpecifiedError, a3 as MaterializedViewConfigError, a4 as MaterializedViewCycleError, a5 as MaterializedViewSourceUnknownError, a6 as MaterializedViewTooLargeError, at as MigrationRequiredError, M as MissingTranslationError, au as MoneyCurrencyError, av as MoneyDescriptor, aw as MoneyOptions, ax as MoneyOptionsFixed, ay as MoneyOptionsMulti, az as MoneyPrecisionError, aA as MoneyUnsupportedError, aB as NetworkError, aC as NoAccessError, aD as NonAdditiveSchemaChangeError, aE as NotFoundError, aF as NumberingUncertaintyError, P as OverlayBaseIsVirtualError, Q as OverlayCollectionUnavailableError, U as OverlayIdMismatchError, V as OverlayNameCollisionError, aG as PathEscapeError, aH as PeriodClosedError, aI as PermissionDeniedError, aJ as PrivilegeEscalationError, aK as QuiesceTimeoutError, aL as ReadOnlyAtInstantError, aM as ReadOnlyError, aN as ReadOnlyFrameError, C as RecordLockedError, p as Reducer, q as ReducerOptions, R as ReservedCollectionNameError, aO as ReservedVaultNameError, aP as SchemaFenceError, aQ as SchemaLockedError, aR as SchemaUpdateError, aS as SchemaValidationError, S as ScriptViolationError, aT as SequenceContentionError, aU as SequenceOfflineError, b as SessionExpiredError, c as SessionNotFoundError, d as SessionPolicyError, aV as ShardProvisioningError, E as SnapshotNotFoundError, aW as StoreCapabilityError, aX as TamperedError, aY as TierDemoteDeniedError, aZ as TierNotGrantedError, T as TranslatorNotConfiguredError, a_ as UniqueConstraintError, a$ as UnknownShardError, b0 as UnsupportedIndexOptionError, b1 as ValidationError, b2 as VaultTemplateNotFoundError, r as avg, t as count, u as groupAndReduce, b3 as isMoneyDescriptor, v as max, w as min, b4 as money, x as reduceRecords, z as sum } from './strategy-BtW8fAjz.js';
7
+ export { D as DEFAULT_CROSS_JOIN_MAX_ROWS, a as DEFAULT_JOIN_MAX_ROWS, J as JoinContext, b as JoinLeg, c as JoinStrategy, d as JoinableSource, L as LiveQuery, e as LiveUpstream, O as OrderBy, Q as Query, f as QueryPlan, g as QuerySource, R as RefDescriptor, h as RefIntegrityError, i as RefMode, j as RefRegistry, k as RefScopeError, l as RefViolation, S as ScanBuilder, m as ScanPageProvider, n as applyJoins, o as buildLiveQuery, p as executePlan, r as ref, q as resetJoinWarnings } from './index-nP99bXLg.js';
8
+ export { A as AutoCredential, n as AutoCredentialKind, c as CompressionAlgo, N as NOYDB_BUNDLE_FORMAT_VERSION, e as NOYDB_BUNDLE_MAGIC, f as NOYDB_BUNDLE_PREFIX_BYTES, g as NoydbBundleHeader, h as NoydbBundleReadResult, R as ReadNoydbBundleOptions, W as WriteNoydbBundleOptions, j as generateULID, o as hasNoydbBundleMagic, k as isULID, r as readNoydbBundle, l as readNoydbBundleHeader, p as readNoydbBundlePublicEnvelope, m as resetBrotliSupportCache, w as writeNoydbBundle } from './ulid-DbBVrNSt.js';
9
9
  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';
10
- export { I as ImmutableGuardConfig, i as immutableGuard, w as withGuard } from './immutable-guard-BehB1YGB.js';
11
- export { w as withDerivation } from './with-derivation-OK9M2sJE.js';
12
- export { w as withMaterializedView } from './with-materialized-view-Dt-ufPWQ.js';
10
+ export { TransactionStrategyOptions } from './tx/index.js';
11
+ export { I as ImmutableGuardConfig, i as immutableGuard, w as withGuard } from './immutable-guard-Dov3WvwF.js';
12
+ export { w as withDerivation } from './with-derivation-_lySGdlm.js';
13
+ export { w as withMaterializedView } from './with-materialized-view-QT1Tp7NO.js';
13
14
  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-BmhBSPCH.js';
14
- export { w as withOverlayedView } from './with-overlayed-view-eDvMs6LO.js';
15
+ export { w as withOverlayedView } from './with-overlayed-view-BEXfpzSb.js';
15
16
  export { SYNC_CREDENTIALS_COLLECTION, SyncCredential, credentialStatus, deleteCredential, getCredential, listCredentials, putCredential } from './team/index.js';
16
- 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-iAS8z9jc.js';
17
+ 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-DR3upLd1.js';
17
18
  export { i as isDiscriminant } from './discriminant-BN9REW3o.js';
18
- export { L as LEDGER_COLLECTION, a as LEDGER_DELTAS_COLLECTION, e as envelopePayloadHash } from './hash-DHOnRarj.js';
19
+ export { L as LEDGER_COLLECTION, a as LEDGER_DELTAS_COLLECTION, e as envelopePayloadHash } from './hash-CDjye9KV.js';
19
20
  import './lazy-builder-ChSqcF5t.js';
20
21
  import '@noy-db/attestation';
21
22
 
package/dist/index.js CHANGED
@@ -39,11 +39,12 @@ import {
39
39
  parseBytes,
40
40
  persistSchemaIfNeeded,
41
41
  ref,
42
+ resolveSequenceKey,
42
43
  saveVaultPolicy,
43
44
  validateSchemaInput,
44
45
  validateSchemaOutput,
45
46
  withArchive
46
- } from "./chunk-7EFFHEN5.js";
47
+ } from "./chunk-667MB6AH.js";
47
48
  import {
48
49
  STATE_VAULT_NAME
49
50
  } from "./chunk-ZC7J6ZYV.js";
@@ -57,23 +58,23 @@ import {
57
58
  TxContext,
58
59
  TxVault,
59
60
  runTransaction
60
- } from "./chunk-YHPM5D7Y.js";
61
+ } from "./chunk-QVIEAYTP.js";
61
62
  import {
62
63
  withDerivation
63
- } from "./chunk-EGD5DXFT.js";
64
- import "./chunk-DQU36Q7I.js";
64
+ } from "./chunk-OQSRJG6A.js";
65
+ import "./chunk-7Z7KSVA5.js";
65
66
  import "./chunk-X73VS74Y.js";
66
67
  import {
67
68
  withMaterializedView
68
- } from "./chunk-NU6Q3FOR.js";
69
- import "./chunk-KIP6JLTF.js";
70
- import "./chunk-C5T5AFWN.js";
71
- import "./chunk-5LQG6ZO2.js";
69
+ } from "./chunk-TKIY625R.js";
70
+ import "./chunk-OMAMZKKD.js";
71
+ import "./chunk-HBXJ37ZY.js";
72
+ import "./chunk-G4SCICH5.js";
72
73
  import {
73
74
  withOverlayedView
74
75
  } from "./chunk-JD3OZAI4.js";
75
76
  import "./chunk-TS26M2SB.js";
76
- import "./chunk-OHVFWCJP.js";
77
+ import "./chunk-VLMPU56Q.js";
77
78
  import {
78
79
  isDiscriminant
79
80
  } from "./chunk-STNPB3UM.js";
@@ -92,7 +93,7 @@ import {
92
93
  parseSealedEnvelope,
93
94
  savePersistedSchema,
94
95
  saveSealedPassphrase
95
- } from "./chunk-WGHU7BLI.js";
96
+ } from "./chunk-GNI5STXQ.js";
96
97
  import {
97
98
  NOYDB_BUNDLE_FORMAT_VERSION,
98
99
  NOYDB_BUNDLE_MAGIC,
@@ -103,7 +104,7 @@ import {
103
104
  readNoydbBundlePublicEnvelope,
104
105
  resetBrotliSupportCache,
105
106
  writeNoydbBundle
106
- } from "./chunk-L2FE64BU.js";
107
+ } from "./chunk-FFXM3ZIF.js";
107
108
  import {
108
109
  PUBLIC_ENVELOPE_RECORD_ID,
109
110
  isPublicEnvelope,
@@ -111,18 +112,18 @@ import {
111
112
  readPublicEnvelope,
112
113
  savePublicEnvelope,
113
114
  validatePublicEnvelopeInput
114
- } from "./chunk-DKO2QFSA.js";
115
+ } from "./chunk-OB2ZJQ2D.js";
115
116
  import {
116
117
  CONSENT_AUDIT_COLLECTION
117
118
  } from "./chunk-FWPKCXTN.js";
118
119
  import {
119
120
  PERIODS_COLLECTION
120
- } from "./chunk-KI6HAJWL.js";
121
+ } from "./chunk-QSUK7YWK.js";
121
122
  import "./chunk-UF3BUNQZ.js";
122
123
  import {
123
124
  immutableGuard,
124
125
  withGuard
125
- } from "./chunk-VU7SWWT5.js";
126
+ } from "./chunk-42FEUPZQ.js";
126
127
  import "./chunk-A3JMGXPG.js";
127
128
  import "./chunk-UMLVJTYV.js";
128
129
  import "./chunk-ZNQYHJXX.js";
@@ -147,7 +148,7 @@ import {
147
148
  resolveI18nText,
148
149
  resolvePolicy,
149
150
  validateI18nTextValue
150
- } from "./chunk-7HT2MEZ5.js";
151
+ } from "./chunk-7BQ4QWYX.js";
151
152
  import {
152
153
  createBundleStore,
153
154
  routeStore,
@@ -167,7 +168,7 @@ import {
167
168
  getCredential,
168
169
  listCredentials,
169
170
  putCredential
170
- } from "./chunk-NSCVNK5K.js";
171
+ } from "./chunk-SCJPI4Z5.js";
171
172
  import {
172
173
  MAGIC_LINK_CONTENT_INFO_PREFIX,
173
174
  MAGIC_LINK_GRANTS_COLLECTION,
@@ -202,7 +203,7 @@ import {
202
203
  unwrapDeksFromShamirEntry,
203
204
  unwrapMagicLinkGrant,
204
205
  writeMagicLinkGrant
205
- } from "./chunk-COFPAMX6.js";
206
+ } from "./chunk-DLZ2ONOD.js";
206
207
  import {
207
208
  assertTierAccess,
208
209
  dekKey,
@@ -212,7 +213,7 @@ import {
212
213
  PresenceHandle,
213
214
  SyncEngine,
214
215
  SyncTransaction
215
- } from "./chunk-WBAYSNUQ.js";
216
+ } from "./chunk-BI6ETQPF.js";
216
217
  import {
217
218
  DIRECTORY_RECORD_ID,
218
219
  USER_ENVELOPE_COLLECTION,
@@ -240,7 +241,7 @@ import {
240
241
  saveUserEnvelope,
241
242
  validatePassphrase,
242
243
  visibilityRecordId
243
- } from "./chunk-A5ZOOZFB.js";
244
+ } from "./chunk-6H2ZUNR7.js";
244
245
  import {
245
246
  BUNDLE_STORE_POLICY,
246
247
  INDEXED_STORE_POLICY,
@@ -277,7 +278,7 @@ import {
277
278
  LedgerStore,
278
279
  applyPatch,
279
280
  computePatch
280
- } from "./chunk-56DJ7JVK.js";
281
+ } from "./chunk-BR3AMFGS.js";
281
282
  import {
282
283
  canonicalJson,
283
284
  envelopePayloadHash,
@@ -295,7 +296,7 @@ import {
295
296
  buildLiveQuery,
296
297
  executePlan,
297
298
  resetJoinWarnings
298
- } from "./chunk-EYVQHAGH.js";
299
+ } from "./chunk-DUREQF5W.js";
299
300
  import {
300
301
  CollectionIndexes
301
302
  } from "./chunk-XWH4MXIU.js";
@@ -315,7 +316,7 @@ import {
315
316
  GroupedQueryN,
316
317
  groupAndReduce,
317
318
  reduceRecords
318
- } from "./chunk-3EWXMOK3.js";
319
+ } from "./chunk-L2BNJ6HM.js";
319
320
  import {
320
321
  MoneyCurrencyError,
321
322
  MoneyPrecisionError,
@@ -342,15 +343,15 @@ import {
342
343
  detectMagic,
343
344
  detectMimeType,
344
345
  isPreCompressed
345
- } from "./chunk-LX3CB26H.js";
346
- import "./chunk-6AJBSQU4.js";
346
+ } from "./chunk-KABJXG2F.js";
347
+ import "./chunk-XL35NSEN.js";
347
348
  import {
348
349
  NOYDB_BACKUP_VERSION,
349
350
  NOYDB_FORMAT_VERSION,
350
351
  NOYDB_KEYRING_VERSION,
351
352
  NOYDB_SYNC_VERSION,
352
353
  createStore
353
- } from "./chunk-GC4V7RU7.js";
354
+ } from "./chunk-F3BPIPLS.js";
354
355
  import {
355
356
  base64ToBuffer,
356
357
  bufferToBase64,
@@ -1089,6 +1090,7 @@ export {
1089
1090
  resolveI18nText,
1090
1091
  resolvePolicy,
1091
1092
  resolveSchema as resolvePublicEnvelopeSchema,
1093
+ resolveSequenceKey,
1092
1094
  resolveSession,
1093
1095
  revokeAllSessions,
1094
1096
  revokeDelegation,
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/schema-update/strategies.ts","../src/schema-update/cutover.ts","../src/numbering/descriptor.ts","../src/money/arith.ts","../src/money/branded.ts","../src/vault-diff.ts"],"sourcesContent":["/** Bundled light update strategies. */\nimport { NonAdditiveSchemaChangeError, SchemaLockedError } from '../errors.js'\nimport type { SchemaUpdateStrategy, SchemaDelta } from './types.js'\n\n/** Allow any schema change. Explicit blind / back-compat. */\nexport function blindUpdate(): SchemaUpdateStrategy {\n return { name: 'blindUpdate', onSchemaDelta: () => ({ action: 'allow' }) }\n}\n\n/** Allow additive changes; reject non-additive ones. The safety backstop. */\nexport function additiveOnly(): SchemaUpdateStrategy {\n return {\n name: 'additiveOnly',\n onSchemaDelta(delta: SchemaDelta) {\n if (delta.kind === 'non-additive') {\n return {\n action: 'reject' as const,\n error: new NonAdditiveSchemaChangeError(\n `Non-additive schema change to \"${delta.collection}\" ` +\n `(added: [${delta.added.join(', ')}], removed: [${delta.removed.join(', ')}], ` +\n `changed: [${delta.changed.map(c => c.field).join(', ')}]). ` +\n `Register a coordinatedCutover() strategy to migrate, or revert the change.`,\n ),\n }\n }\n return { action: 'allow' as const }\n },\n }\n}\n\n/**\n * Reject schema changes. With `fields`, reject only when one of those\n * fields is added/removed/changed; otherwise reject any non-`none` delta.\n */\nexport function lockSchema(opts?: { readonly fields?: readonly string[] }): SchemaUpdateStrategy {\n const fields = opts?.fields\n return {\n name: 'lockSchema',\n onSchemaDelta(delta: SchemaDelta) {\n if (delta.kind === 'none') return { action: 'allow' as const }\n const touched = fields\n ? [...delta.added, ...delta.removed, ...delta.changed.map(c => c.field)].filter(f => fields.includes(f))\n : ['<any>']\n if (touched.length === 0) return { action: 'allow' as const }\n return {\n action: 'reject' as const,\n error: new SchemaLockedError(\n `Schema for \"${delta.collection}\" is locked` +\n (fields ? ` on fields [${fields.join(', ')}] (touched: [${touched.join(', ')}])` : '') +\n `; the change was refused.`,\n ),\n }\n },\n }\n}\n","/** The coordinatedCutover update strategy (single-step — no from/to). */\nimport type { SchemaUpdateStrategy, SchemaDelta, TransformFn } from './types.js'\n\nexport function coordinatedCutover(opts: { readonly transform: TransformFn }): SchemaUpdateStrategy {\n return {\n name: 'coordinatedCutover',\n onSchemaDelta(delta: SchemaDelta) {\n if (delta.kind === 'non-additive') {\n return { action: 'cutover' as const, transform: opts.transform }\n }\n return { action: 'allow' as const }\n },\n }\n}\n","/**\n * @category capability\n * Deferred-numbering config descriptor. See\n * docs/superpowers/specs/2026-06-08-sealed-numbering-and-store-clock-design.md.\n */\n\n/** A registered deferred-numbering series. */\nexport interface DeferredNumberingConfig {\n /** Series name — the key passed to `vault.sequence(series)`. */\n readonly series: string\n /** Collection holding the records to number. */\n readonly collection: string\n /** Field on each record where the assigned serial is written. */\n readonly field: string\n /**\n * Minimum wall-clock age (ms) before an entry is eligible at a pass, in\n * addition to the interval commit-wait. Default 0 — the store-clock\n * interval (`storeLatest ≤ now.earliest`) is the correctness mechanism.\n */\n readonly settleWindowMs: number\n}\n\n/** Declare a deferred-numbering series. Pass the result in `createNoydb({ numbering: [...] })`. */\nexport function withDeferredNumbering(config: {\n series: string\n collection: string\n field: string\n settleWindowMs?: number\n}): DeferredNumberingConfig {\n return {\n series: config.series,\n collection: config.collection,\n field: config.field,\n settleWindowMs: config.settleWindowMs ?? 0,\n }\n}\n","/**\n * Exact money arithmetic helpers (#337) — `mulRate` and `allocate`.\n *\n * Both operate on the canonical decoded string form that `get()`\n * returns (`'10000.00'`), entirely in scaled-`BigInt` space — no\n * floating-point step anywhere, exact past 2^53. They are pure\n * functions with no vault or descriptor dependency: the working scale\n * is inferred from the amount's fractional digits (a canonical money\n * string always carries exactly the field's scale) or pinned with\n * `opts.scale`.\n *\n * Why these two: app-side invariants of the form\n * `Σ parts === whole` (receipt totals, net-zero WHT pairs, proration)\n * carry ±0.01 tolerances ONLY because the math is major-unit floats +\n * round2. `mulRate` (VAT-style rate application with explicit\n * rounding) and `allocate` (largest-remainder split — parts sum to the\n * input EXACTLY, by construction) make those tolerances zero.\n */\n\nimport {\n parseToScaledInt,\n formatScaledInt,\n rescaleScaledInt,\n decimalScaleOf,\n type RoundingMode,\n} from './fixed-point.js'\nimport { MoneyUnsupportedError } from './descriptor.js'\n\nexport interface MulRateOptions {\n /**\n * Output scale (fraction digits). Defaults to the amount's own\n * fractional digits — for a canonical money string that IS the\n * field's scale.\n */\n readonly scale?: number\n /** Rounding for the final re-scale. Default `'half-up'`. */\n readonly rounding?: RoundingMode\n}\n\nexport interface AllocateOptions {\n /** Working scale. Defaults to the amount's own fractional digits. */\n readonly scale?: number\n}\n\n/** Parse `amount` at `scale` or throw the standard money TypeError. */\nfunction parseAmount(label: string, amount: number | string, scale: number, rounding?: RoundingMode): bigint {\n const r = parseToScaledInt(amount, scale, rounding)\n if (!r.ok) {\n throw new MoneyUnsupportedError(\n r.reason === 'precision'\n ? `${label}: amount ${JSON.stringify(amount)} has more precision than scale ${scale} and no rounding mode is configured`\n : `${label}: amount ${JSON.stringify(amount)} is not a finite decimal`,\n )\n }\n return r.value\n}\n\nfunction resolveScale(label: string, amount: number | string, explicit: number | undefined): number {\n if (explicit !== undefined) {\n if (!Number.isInteger(explicit) || explicit < 0) {\n throw new MoneyUnsupportedError(`${label}: scale must be a non-negative integer`)\n }\n return explicit\n }\n const inferred = decimalScaleOf(amount)\n if (inferred === null) {\n throw new MoneyUnsupportedError(`${label}: amount ${JSON.stringify(amount)} is not a finite decimal`)\n }\n return inferred\n}\n\n/**\n * Multiply a money amount by a decimal rate, exactly.\n *\n * The rate is parsed at its OWN full precision (`0.07` → `7` at scale\n * 2), the product computed in `BigInt` at `amountScale + rateScale`,\n * then re-scaled back to the output scale with the requested rounding —\n * one rounding step, at the very end.\n *\n * ```ts\n * mulRate('10000.00', 0.07) // '700.00' (VAT)\n * mulRate('33.33', '0.07') // '2.33' (half-up)\n * mulRate('33.33', 0.07, { rounding: 'floor' }) // '2.33'\n * mulRate(100, 0.07, { scale: 2 }) // '7.00'\n * ```\n */\nexport function mulRate(\n amount: number | string,\n rate: number | string,\n opts: MulRateOptions = {},\n): string {\n const scale = resolveScale('mulRate', amount, opts.scale)\n const rounding = opts.rounding ?? 'half-up'\n const a = parseAmount('mulRate', amount, scale, rounding)\n\n const rateScale = decimalScaleOf(rate)\n if (rateScale === null) {\n throw new MoneyUnsupportedError(`mulRate: rate ${JSON.stringify(rate)} is not a finite decimal`)\n }\n const r = parseToScaledInt(rate, rateScale)\n if (!r.ok) {\n throw new MoneyUnsupportedError(`mulRate: rate ${JSON.stringify(rate)} is not a finite decimal`)\n }\n\n const product = a * r.value // scaled at scale + rateScale\n return formatScaledInt(rescaleScaledInt(product, scale + rateScale, scale, rounding), scale)\n}\n\n/**\n * Split a money amount across weighted buckets with ZERO drift: the\n * returned parts sum to the input exactly, by construction\n * (largest-remainder method).\n *\n * Each bucket gets `floor(amount × weightᵢ / Σweights)`; the leftover\n * minor units (always fewer than the bucket count) go one each to the\n * buckets with the largest truncated remainders — ties broken by\n * position, earlier bucket first. Weights are parsed as exact decimals\n * (no float division anywhere); they must be non-negative with a\n * positive sum.\n *\n * ```ts\n * allocate('100.00', [1, 1, 1]) // ['33.34', '33.33', '33.33']\n * allocate('0.05', [3, 7]) // ['0.02', '0.03']\n * allocate('-100.00', [1, 1, 1]) // ['-33.34', '-33.33', '-33.33']\n * ```\n */\nexport function allocate(\n amount: number | string,\n weights: ReadonlyArray<number | string>,\n opts: AllocateOptions = {},\n): string[] {\n if (weights.length === 0) {\n throw new MoneyUnsupportedError('allocate: weights must not be empty')\n }\n const scale = resolveScale('allocate', amount, opts.scale)\n const a = parseAmount('allocate', amount, scale)\n\n // Parse every weight as an exact decimal at a common scale, so the\n // proportion arithmetic below is pure BigInt.\n let weightScale = 0\n for (const w of weights) {\n const s = decimalScaleOf(w)\n if (s === null) {\n throw new MoneyUnsupportedError(`allocate: weight ${JSON.stringify(w)} is not a finite decimal`)\n }\n if (s > weightScale) weightScale = s\n }\n const scaledWeights = weights.map(w => {\n const r = parseToScaledInt(w, weightScale)\n if (!r.ok || r.value < 0n) {\n throw new MoneyUnsupportedError(`allocate: weight ${JSON.stringify(w)} must be a non-negative decimal`)\n }\n return r.value\n })\n const sumW = scaledWeights.reduce((acc, w) => acc + w, 0n)\n if (sumW === 0n) {\n throw new MoneyUnsupportedError('allocate: weights must not all be zero')\n }\n\n // Largest-remainder over the MAGNITUDE; a negative amount negates the\n // parts at the end, so Σparts === amount holds for both signs.\n const negative = a < 0n\n const mag = negative ? -a : a\n\n const base: bigint[] = []\n const remainders: Array<{ index: number; rem: bigint }> = []\n let distributed = 0n\n for (let i = 0; i < scaledWeights.length; i++) {\n const product = mag * scaledWeights[i]!\n const share = product / sumW\n base.push(share)\n distributed += share\n remainders.push({ index: i, rem: product % sumW })\n }\n\n // Leftover minor units: strictly fewer than the bucket count.\n let leftover = mag - distributed\n remainders.sort((x, y) => (y.rem > x.rem ? 1 : y.rem < x.rem ? -1 : x.index - y.index))\n for (const { index } of remainders) {\n if (leftover === 0n) break\n base[index] = base[index]! + 1n\n leftover -= 1n\n }\n\n return base.map(p => formatScaledInt(negative && p !== 0n ? -p : p, scale))\n}\n","/**\n * Branded money output type (#338).\n *\n * The decoded read shape of a money field is an exact decimal STRING\n * (`'10000.00'`) — but a hand-written schema types it `string | number`,\n * which is honest about the input side and unhelpful on the output\n * side: every read site hand-coerces, and a missed coercion passes\n * typecheck silently (then surfaces as a runtime template warning, or\n * worse, as `'10000.00' * 100` arithmetic).\n *\n * {@link MoneyString} is the output-side brand: a `string` that has\n * been through noy-db's decode (or {@link asMoney}'s guard). Branding\n * is type-level only — zero runtime cost on the read path.\n *\n * ## Wiring the brand through a validator (the input/output asymmetry)\n *\n * Keep the permissive `string | number` on the INPUT side so write\n * sites are untouched, and brand the OUTPUT side. With Zod:\n *\n * ```ts\n * import type { MoneyString } from '@noy-db/hub'\n *\n * const moneyValue = z.union([z.number(), z.string()]) as unknown as\n * z.ZodType<MoneyString, z.ZodTypeDef, string | number>\n *\n * const Invoice = z.object({ id: z.string(), total: moneyValue })\n * type InvoiceOut = z.output<typeof Invoice> // total: MoneyString\n * type InvoiceIn = z.input<typeof Invoice> // total: string | number\n * ```\n *\n * The cast is sound for fields declared in `moneyFields`: reads pass\n * through `decodeMoneyFields`, which always produces the canonical\n * decimal string.\n */\n\nimport { decimalScaleOf } from './fixed-point.js'\nimport { MoneyUnsupportedError } from './descriptor.js'\n\ndeclare const MONEY_BRAND: unique symbol\n\n/**\n * An exact decimal string produced by noy-db's money decode\n * (`'10000.00'`). The brand exists only at the type level — at runtime\n * a `MoneyString` is a plain string.\n */\nexport type MoneyString = string & { readonly [MONEY_BRAND]: true }\n\n/**\n * Runtime-guarded cast to {@link MoneyString}. Accepts a decimal string\n * or a number, returns the canonical decimal string branded — throws\n * `MoneyUnsupportedError` on anything non-finite / non-decimal. Use at\n * trust boundaries (deserialized JSON, route params); values read\n * through `get()`/`list()` are already canonical.\n */\nexport function asMoney(value: string | number): MoneyString {\n if (!isMoneyLike(value)) {\n throw new MoneyUnsupportedError(`asMoney: ${JSON.stringify(value)} is not a finite decimal`)\n }\n return String(value).trim() as MoneyString\n}\n\n/** Type guard: is `value` a decimal string acceptable as money? */\nexport function isMoneyString(value: unknown): value is MoneyString {\n return typeof value === 'string' && isMoneyLike(value)\n}\n\n/**\n * The ONE sanctioned escape hatch to a JS `number` — explicit because\n * the conversion is lossy past 2^53. For display math and chart axes;\n * never feed the result back into stored amounts (use `mulRate` /\n * `allocate` for exact arithmetic).\n */\nexport function moneyNumber(value: MoneyString | string | number): number {\n if (!isMoneyLike(value)) {\n throw new MoneyUnsupportedError(`moneyNumber: ${JSON.stringify(value)} is not a finite decimal`)\n }\n return Number(value)\n}\n\nfunction isMoneyLike(value: unknown): boolean {\n if (typeof value === 'number') return Number.isFinite(value)\n if (typeof value !== 'string') return false\n return decimalScaleOf(value) !== null\n}\n","/**\n * Vault-level diff orchestrator.\n *\n * Compares a live `Vault`'s plaintext state against a candidate state\n * (another vault, a plain `{ collection: records[] }` map, or a vault\n * dump JSON) and returns a structured `VaultDiff` plan listing the\n * records that would be added, modified, or deleted to bring the live\n * vault into the candidate's shape.\n *\n * Builds on two existing record-level helpers:\n *\n * 1. `diff(a, b)` from `./history/diff.ts` — emits dot-pathed\n * `DiffEntry[]` with `type: 'added' | 'removed' | 'changed'` for\n * each changed field of two records. Used here for the\n * `fieldDiffs` of every `modified` entry, and (with empty result)\n * as the default deep-equal check.\n *\n * 2. `Vault.exportStream()` from `./vault.ts` — the canonical\n * decrypt-and-stream-records iterator. Used to walk both sides\n * when the candidate is itself a `Vault`. ACL-scoped: collections\n * the caller can't read silently drop out, the same way every\n * other plaintext-emitting export pipeline filters them.\n *\n * The new orchestration is the **vault-level** enumeration: bucket\n * each record id into added (only in candidate), deleted (only in\n * vault), or modified (in both with field changes); leave the\n * field-level granularity to the existing `diff()`.\n *\n * Use cases:\n *\n * - Import preview (`@noy-db/as-*` `fromString` returns a plan\n * whose body is a `VaultDiff`).\n * - Backup verification (\"does this `.noydb` bundle from yesterday\n * match the current vault?\").\n * - Two-vault reconciliation (\"what's different between Office A\n * and Office B before we sync?\").\n * - Test assertions (golden-file testing with one-liner\n * `expect(plan.summary).toEqual(...)`).\n *\n * @module\n */\n\nimport type { Vault } from './vault.js'\nimport { diff as fieldDiff, type DiffEntry as FieldDiffEntry } from './history/diff.js'\n\n// ─── Public types ──────────────────────────────────────────────────────\n\n/** Per-record entry shape — added and deleted records carry only the record value. */\nexport interface VaultDiffEntry<T = unknown> {\n readonly collection: string\n readonly id: string\n readonly record: T\n}\n\n/** Modified records carry both halves of the diff plus the field-level breakdown. */\nexport interface VaultDiffModifiedEntry<T = unknown> extends VaultDiffEntry<T> {\n /** The record as it stands in the live vault. */\n readonly before: T\n /** Top-level keys whose values differ between `before` and `record`. */\n readonly fieldsChanged: readonly string[]\n /**\n * Field-level diff entries from `diff(before, record)`. Reuses the\n * existing per-record diff helper so consumers can render git-style\n * `path: from → to` rows without re-walking the records.\n */\n readonly fieldDiffs: readonly FieldDiffEntry[]\n}\n\nexport interface VaultDiff<T = unknown> {\n readonly added: readonly VaultDiffEntry<T>[]\n readonly modified: readonly VaultDiffModifiedEntry<T>[]\n readonly deleted: readonly VaultDiffEntry<T>[]\n /** Only populated when `options.includeUnchanged: true`. */\n readonly unchanged: readonly VaultDiffEntry<T>[] | undefined\n readonly summary: {\n readonly add: number\n readonly modify: number\n readonly delete: number\n readonly total: number\n }\n /**\n * Format the diff as a human-readable string.\n *\n * - `'count'` — one line, just the numbers (`12 added · 3 modified · 0 deleted`)\n * - `'one-line'` — count plus a single overview line\n * - `'full'` — count + one row per added/modified/deleted record (default)\n */\n format(opts?: { detail?: 'count' | 'one-line' | 'full' }): string\n}\n\nexport interface DiffOptions {\n /** Restrict the diff to a subset of collections. */\n readonly collections?: readonly string[]\n /** Field on each record that carries its id. Defaults to `'id'`. */\n readonly idKey?: string\n /** Override the default deep-equal check for \"modified vs unchanged\". */\n readonly compareFn?: (a: unknown, b: unknown) => boolean\n /** If true, include unchanged records in the diff (off by default to save memory). */\n readonly includeUnchanged?: boolean\n}\n\n/**\n * Candidate state to diff the vault against:\n *\n * - A `Vault` instance — both sides are walked via `exportStream()`.\n * - A `Record<collection, records[]>` map — same shape `as-json.toObject()`\n * produces. Useful for diffing parsed file content against the live vault.\n * - A `VaultDump` (output of `vault.dump()`) — a JSON string carrying the\n * full vault state. Parsed and reduced to the map shape above.\n */\nexport type DiffCandidate<T = unknown> =\n | Vault\n | Record<string, readonly T[]>\n | string\n\n// ─── Implementation ────────────────────────────────────────────────────\n\n/**\n * Compute the diff between a live vault and a candidate state.\n *\n * Returns a fully buffered `VaultDiff` — no streaming. Memory cost is\n * O(n + m) in the row count of vault + candidate. For documented\n * 1K-50K-record vaults this is fine; a streaming variant lands as a\n * follow-up if a > 100K-record consumer arrives.\n */\nexport async function diffVault<T = unknown>(\n vault: Vault,\n candidate: DiffCandidate<T>,\n options: DiffOptions = {},\n): Promise<VaultDiff<T>> {\n const idKey = options.idKey ?? 'id'\n const filter = options.collections ? new Set(options.collections) : null\n const compareFn =\n options.compareFn ?? ((a: unknown, b: unknown) => fieldDiff(a, b).length === 0)\n\n // Side A — walk the live vault via exportStream(). Each chunk arrives\n // already decrypted and ACL-scoped, so collections the caller can't\n // read silently drop out. exportStream's records are typed `unknown[]`\n // — diffVault is the type-erasure boundary; the caller asserts the\n // record shape via the function's `<T>` generic.\n const live = new Map<string, Map<string, T>>()\n for await (const chunk of vault.exportStream({ granularity: 'collection' })) {\n if (filter && !filter.has(chunk.collection)) continue\n const collection = live.get(chunk.collection) ?? new Map<string, T>()\n for (const record of chunk.records) {\n const id = readIdField(record, idKey)\n if (!id) continue\n collection.set(id, record as T)\n }\n live.set(chunk.collection, collection)\n }\n\n // Side B — normalise the candidate into the same shape.\n const cand = await normaliseCandidate<T>(candidate, idKey, filter)\n\n // Walk every (collection, id) on either side and bucket.\n const added: VaultDiffEntry<T>[] = []\n const modified: VaultDiffModifiedEntry<T>[] = []\n const deleted: VaultDiffEntry<T>[] = []\n const unchanged: VaultDiffEntry<T>[] | undefined = options.includeUnchanged ? [] : undefined\n\n const collectionNames = new Set([...live.keys(), ...cand.keys()])\n for (const collection of [...collectionNames].sort()) {\n const liveColl = live.get(collection) ?? new Map<string, T>()\n const candColl = cand.get(collection) ?? new Map<string, T>()\n const allIds = new Set([...liveColl.keys(), ...candColl.keys()])\n\n for (const id of [...allIds].sort()) {\n const before = liveColl.get(id)\n const after = candColl.get(id)\n\n if (before === undefined && after !== undefined) {\n added.push({ collection, id, record: after })\n } else if (before !== undefined && after === undefined) {\n deleted.push({ collection, id, record: before })\n } else if (before !== undefined && after !== undefined) {\n if (compareFn(before, after)) {\n unchanged?.push({ collection, id, record: after })\n } else {\n const fieldDiffs = fieldDiff(before, after)\n const fieldsChanged = uniqueTopLevelKeys(fieldDiffs)\n modified.push({\n collection,\n id,\n record: after,\n before,\n fieldsChanged,\n fieldDiffs,\n })\n }\n }\n }\n }\n\n const summary = {\n add: added.length,\n modify: modified.length,\n delete: deleted.length,\n total: added.length + modified.length + deleted.length,\n }\n\n return {\n added,\n modified,\n deleted,\n unchanged,\n summary,\n format(opts) {\n return formatDiff(opts?.detail ?? 'full', { added, modified, deleted, summary })\n },\n }\n}\n\n// ─── Internals ─────────────────────────────────────────────────────────\n\nasync function normaliseCandidate<T>(\n candidate: DiffCandidate<T>,\n idKey: string,\n filter: Set<string> | null,\n): Promise<Map<string, Map<string, T>>> {\n const out = new Map<string, Map<string, T>>()\n\n // Vault instance — duck-type via the exportStream method (matches\n // vault.ts's structural shape without forcing a runtime instanceof check\n // that would import the class and risk circular deps).\n if (\n typeof candidate === 'object' &&\n candidate !== null &&\n 'exportStream' in candidate &&\n typeof (candidate as Vault).exportStream === 'function'\n ) {\n for await (const chunk of (candidate as Vault).exportStream({ granularity: 'collection' })) {\n if (filter && !filter.has(chunk.collection)) continue\n const collection = out.get(chunk.collection) ?? new Map<string, T>()\n for (const record of chunk.records) {\n const id = readIdField(record, idKey)\n if (!id) continue\n collection.set(id, record as T)\n }\n out.set(chunk.collection, collection)\n }\n return out\n }\n\n // String — assume a vault.dump() JSON string. Parse and reduce to the map shape.\n if (typeof candidate === 'string') {\n let parsed: unknown\n try {\n parsed = JSON.parse(candidate)\n } catch (err) {\n throw new Error(\n `diffVault: candidate string is not valid JSON (${(err as Error).message})`,\n )\n }\n return collectionsFromObject<T>(parsed, idKey, filter)\n }\n\n // Plain object — `Record<collection, records[]>` (same shape as-json.toObject() returns).\n return collectionsFromObject<T>(candidate, idKey, filter)\n}\n\nfunction collectionsFromObject<T>(\n raw: unknown,\n idKey: string,\n filter: Set<string> | null,\n): Map<string, Map<string, T>> {\n const out = new Map<string, Map<string, T>>()\n if (raw === null || typeof raw !== 'object') {\n throw new Error('diffVault: candidate must be a Vault, an object, or a JSON string')\n }\n // A vault dump JSON has a top-level shape like { _compartment, _keyring, <coll>: <records[]> }.\n // We accept both: keys starting with `_` are skipped (they're metadata), the rest are collections.\n for (const [key, value] of Object.entries(raw)) {\n if (key.startsWith('_')) continue\n if (filter && !filter.has(key)) continue\n if (!Array.isArray(value)) continue\n const collection = new Map<string, T>()\n for (const record of value as readonly T[]) {\n if (record === null || typeof record !== 'object') continue\n const id = readIdField(record, idKey)\n if (!id) continue\n collection.set(id, record)\n }\n out.set(key, collection)\n }\n return out\n}\n\nfunction uniqueTopLevelKeys(diffs: readonly FieldDiffEntry[]): readonly string[] {\n const keys = new Set<string>()\n for (const d of diffs) {\n // path is dot-separated; the top-level key is everything before the\n // first `.` or `[`. (`a.b.c` → `a`, `tags[0]` → `tags`, `(root)` → `(root)`).\n const m = /^[^.[]+/.exec(d.path)\n if (m) keys.add(m[0])\n }\n return [...keys]\n}\n\n/**\n * Pull the id field off a record without going through `String(obj)`,\n * which would emit `[object Object]` for nested objects and silently\n * collapse rows that share the same parent. Only string and number ids\n * are accepted; anything else returns the empty string and the record\n * is skipped at the call site.\n */\nfunction readIdField(record: unknown, idKey: string): string {\n if (record === null || typeof record !== 'object') return ''\n const v = (record as Record<string, unknown>)[idKey]\n if (typeof v === 'string') return v\n if (typeof v === 'number' && Number.isFinite(v)) return String(v)\n return ''\n}\n\ninterface FormatBuckets<T> {\n readonly added: readonly VaultDiffEntry<T>[]\n readonly modified: readonly VaultDiffModifiedEntry<T>[]\n readonly deleted: readonly VaultDiffEntry<T>[]\n readonly summary: VaultDiff<T>['summary']\n}\n\nfunction formatDiff<T>(\n detail: 'count' | 'one-line' | 'full',\n b: FormatBuckets<T>,\n): string {\n const head = `${b.summary.add} added · ${b.summary.modify} modified · ${b.summary.delete} deleted`\n if (detail === 'count') return head\n if (b.summary.total === 0) return head + '\\n(no changes)'\n if (detail === 'one-line') return head\n\n const rows: string[] = [head, '']\n for (const e of b.added) rows.push(`${e.collection}/${e.id}\\tadded`)\n for (const e of b.modified) {\n const fields = e.fieldDiffs\n .map((f) => `${f.path}: ${shortJSON(f.from)} → ${shortJSON(f.to)}`)\n .join(', ')\n rows.push(`${e.collection}/${e.id}\\tmodified\\t${fields}`)\n }\n for (const e of b.deleted) rows.push(`${e.collection}/${e.id}\\tdeleted`)\n return rows.join('\\n')\n}\n\nfunction shortJSON(value: unknown): string {\n if (value === undefined) return 'undefined'\n const s = JSON.stringify(value)\n // JSON.stringify returns string for any JSON value except `undefined`\n // (handled above), `function`, and `symbol`. Fall back to a static\n // tag for those — never let an arbitrary object hit the default\n // stringifier (which the lint rule explicitly bans).\n if (typeof s !== 'string') return '<unrepresentable>'\n return s.length > 60 ? s.slice(0, 57) + '...' : s\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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MAAM,SAAU,QAAO;AAClC,SAAO,EAAE,SAAS,KAAK,EAAE,MAAM,GAAG,EAAE,IAAI,QAAQ;AAClD;","names":["formatDiff"]}
1
+ {"version":3,"sources":["../src/schema-update/strategies.ts","../src/schema-update/cutover.ts","../src/numbering/descriptor.ts","../src/money/arith.ts","../src/money/branded.ts","../src/vault-diff.ts"],"sourcesContent":["/** Bundled light update strategies. */\nimport { NonAdditiveSchemaChangeError, SchemaLockedError } from '../errors.js'\nimport type { SchemaUpdateStrategy, SchemaDelta } from './types.js'\n\n/** Allow any schema change. Explicit blind / back-compat. */\nexport function blindUpdate(): SchemaUpdateStrategy {\n return { name: 'blindUpdate', onSchemaDelta: () => ({ action: 'allow' }) }\n}\n\n/** Allow additive changes; reject non-additive ones. The safety backstop. */\nexport function additiveOnly(): SchemaUpdateStrategy {\n return {\n name: 'additiveOnly',\n onSchemaDelta(delta: SchemaDelta) {\n if (delta.kind === 'non-additive') {\n return {\n action: 'reject' as const,\n error: new NonAdditiveSchemaChangeError(\n `Non-additive schema change to \"${delta.collection}\" ` +\n `(added: [${delta.added.join(', ')}], removed: [${delta.removed.join(', ')}], ` +\n `changed: [${delta.changed.map(c => c.field).join(', ')}]). ` +\n `Register a coordinatedCutover() strategy to migrate, or revert the change.`,\n ),\n }\n }\n return { action: 'allow' as const }\n },\n }\n}\n\n/**\n * Reject schema changes. With `fields`, reject only when one of those\n * fields is added/removed/changed; otherwise reject any non-`none` delta.\n */\nexport function lockSchema(opts?: { readonly fields?: readonly string[] }): SchemaUpdateStrategy {\n const fields = opts?.fields\n return {\n name: 'lockSchema',\n onSchemaDelta(delta: SchemaDelta) {\n if (delta.kind === 'none') return { action: 'allow' as const }\n const touched = fields\n ? [...delta.added, ...delta.removed, ...delta.changed.map(c => c.field)].filter(f => fields.includes(f))\n : ['<any>']\n if (touched.length === 0) return { action: 'allow' as const }\n return {\n action: 'reject' as const,\n error: new SchemaLockedError(\n `Schema for \"${delta.collection}\" is locked` +\n (fields ? ` on fields [${fields.join(', ')}] (touched: [${touched.join(', ')}])` : '') +\n `; the change was refused.`,\n ),\n }\n },\n }\n}\n","/** The coordinatedCutover update strategy (single-step — no from/to). */\nimport type { SchemaUpdateStrategy, SchemaDelta, TransformFn } from './types.js'\n\nexport function coordinatedCutover(opts: { readonly transform: TransformFn }): SchemaUpdateStrategy {\n return {\n name: 'coordinatedCutover',\n onSchemaDelta(delta: SchemaDelta) {\n if (delta.kind === 'non-additive') {\n return { action: 'cutover' as const, transform: opts.transform }\n }\n return { action: 'allow' as const }\n },\n }\n}\n","/**\n * @category capability\n * Deferred-numbering config descriptor. See\n * docs/superpowers/specs/2026-06-08-sealed-numbering-and-store-clock-design.md.\n */\n\n/** A registered deferred-numbering series. */\nexport interface DeferredNumberingConfig {\n /** Series name — the key passed to `vault.sequence(series)`. */\n readonly series: string\n /** Collection holding the records to number. */\n readonly collection: string\n /** Field on each record where the assigned serial is written. */\n readonly field: string\n /**\n * Minimum wall-clock age (ms) before an entry is eligible at a pass, in\n * addition to the interval commit-wait. Default 0 — the store-clock\n * interval (`storeLatest ≤ now.earliest`) is the correctness mechanism.\n */\n readonly settleWindowMs: number\n}\n\n/** Declare a deferred-numbering series. Pass the result in `createNoydb({ numbering: [...] })`. */\nexport function withDeferredNumbering(config: {\n series: string\n collection: string\n field: string\n settleWindowMs?: number\n}): DeferredNumberingConfig {\n return {\n series: config.series,\n collection: config.collection,\n field: config.field,\n settleWindowMs: config.settleWindowMs ?? 0,\n }\n}\n","/**\n * Exact money arithmetic helpers (#337) — `mulRate` and `allocate`.\n *\n * Both operate on the canonical decoded string form that `get()`\n * returns (`'10000.00'`), entirely in scaled-`BigInt` space — no\n * floating-point step anywhere, exact past 2^53. They are pure\n * functions with no vault or descriptor dependency: the working scale\n * is inferred from the amount's fractional digits (a canonical money\n * string always carries exactly the field's scale) or pinned with\n * `opts.scale`.\n *\n * Why these two: app-side invariants of the form\n * `Σ parts === whole` (receipt totals, net-zero WHT pairs, proration)\n * carry ±0.01 tolerances ONLY because the math is major-unit floats +\n * round2. `mulRate` (VAT-style rate application with explicit\n * rounding) and `allocate` (largest-remainder split — parts sum to the\n * input EXACTLY, by construction) make those tolerances zero.\n */\n\nimport {\n parseToScaledInt,\n formatScaledInt,\n rescaleScaledInt,\n decimalScaleOf,\n type RoundingMode,\n} from './fixed-point.js'\nimport { MoneyUnsupportedError } from './descriptor.js'\n\nexport interface MulRateOptions {\n /**\n * Output scale (fraction digits). Defaults to the amount's own\n * fractional digits — for a canonical money string that IS the\n * field's scale.\n */\n readonly scale?: number\n /** Rounding for the final re-scale. Default `'half-up'`. */\n readonly rounding?: RoundingMode\n}\n\nexport interface AllocateOptions {\n /** Working scale. Defaults to the amount's own fractional digits. */\n readonly scale?: number\n}\n\n/** Parse `amount` at `scale` or throw the standard money TypeError. */\nfunction parseAmount(label: string, amount: number | string, scale: number, rounding?: RoundingMode): bigint {\n const r = parseToScaledInt(amount, scale, rounding)\n if (!r.ok) {\n throw new MoneyUnsupportedError(\n r.reason === 'precision'\n ? `${label}: amount ${JSON.stringify(amount)} has more precision than scale ${scale} and no rounding mode is configured`\n : `${label}: amount ${JSON.stringify(amount)} is not a finite decimal`,\n )\n }\n return r.value\n}\n\nfunction resolveScale(label: string, amount: number | string, explicit: number | undefined): number {\n if (explicit !== undefined) {\n if (!Number.isInteger(explicit) || explicit < 0) {\n throw new MoneyUnsupportedError(`${label}: scale must be a non-negative integer`)\n }\n return explicit\n }\n const inferred = decimalScaleOf(amount)\n if (inferred === null) {\n throw new MoneyUnsupportedError(`${label}: amount ${JSON.stringify(amount)} is not a finite decimal`)\n }\n return inferred\n}\n\n/**\n * Multiply a money amount by a decimal rate, exactly.\n *\n * The rate is parsed at its OWN full precision (`0.07` → `7` at scale\n * 2), the product computed in `BigInt` at `amountScale + rateScale`,\n * then re-scaled back to the output scale with the requested rounding —\n * one rounding step, at the very end.\n *\n * ```ts\n * mulRate('10000.00', 0.07) // '700.00' (VAT)\n * mulRate('33.33', '0.07') // '2.33' (half-up)\n * mulRate('33.33', 0.07, { rounding: 'floor' }) // '2.33'\n * mulRate(100, 0.07, { scale: 2 }) // '7.00'\n * ```\n */\nexport function mulRate(\n amount: number | string,\n rate: number | string,\n opts: MulRateOptions = {},\n): string {\n const scale = resolveScale('mulRate', amount, opts.scale)\n const rounding = opts.rounding ?? 'half-up'\n const a = parseAmount('mulRate', amount, scale, rounding)\n\n const rateScale = decimalScaleOf(rate)\n if (rateScale === null) {\n throw new MoneyUnsupportedError(`mulRate: rate ${JSON.stringify(rate)} is not a finite decimal`)\n }\n const r = parseToScaledInt(rate, rateScale)\n if (!r.ok) {\n throw new MoneyUnsupportedError(`mulRate: rate ${JSON.stringify(rate)} is not a finite decimal`)\n }\n\n const product = a * r.value // scaled at scale + rateScale\n return formatScaledInt(rescaleScaledInt(product, scale + rateScale, scale, rounding), scale)\n}\n\n/**\n * Split a money amount across weighted buckets with ZERO drift: the\n * returned parts sum to the input exactly, by construction\n * (largest-remainder method).\n *\n * Each bucket gets `floor(amount × weightᵢ / Σweights)`; the leftover\n * minor units (always fewer than the bucket count) go one each to the\n * buckets with the largest truncated remainders — ties broken by\n * position, earlier bucket first. Weights are parsed as exact decimals\n * (no float division anywhere); they must be non-negative with a\n * positive sum.\n *\n * ```ts\n * allocate('100.00', [1, 1, 1]) // ['33.34', '33.33', '33.33']\n * allocate('0.05', [3, 7]) // ['0.02', '0.03']\n * allocate('-100.00', [1, 1, 1]) // ['-33.34', '-33.33', '-33.33']\n * ```\n */\nexport function allocate(\n amount: number | string,\n weights: ReadonlyArray<number | string>,\n opts: AllocateOptions = {},\n): string[] {\n if (weights.length === 0) {\n throw new MoneyUnsupportedError('allocate: weights must not be empty')\n }\n const scale = resolveScale('allocate', amount, opts.scale)\n const a = parseAmount('allocate', amount, scale)\n\n // Parse every weight as an exact decimal at a common scale, so the\n // proportion arithmetic below is pure BigInt.\n let weightScale = 0\n for (const w of weights) {\n const s = decimalScaleOf(w)\n if (s === null) {\n throw new MoneyUnsupportedError(`allocate: weight ${JSON.stringify(w)} is not a finite decimal`)\n }\n if (s > weightScale) weightScale = s\n }\n const scaledWeights = weights.map(w => {\n const r = parseToScaledInt(w, weightScale)\n if (!r.ok || r.value < 0n) {\n throw new MoneyUnsupportedError(`allocate: weight ${JSON.stringify(w)} must be a non-negative decimal`)\n }\n return r.value\n })\n const sumW = scaledWeights.reduce((acc, w) => acc + w, 0n)\n if (sumW === 0n) {\n throw new MoneyUnsupportedError('allocate: weights must not all be zero')\n }\n\n // Largest-remainder over the MAGNITUDE; a negative amount negates the\n // parts at the end, so Σparts === amount holds for both signs.\n const negative = a < 0n\n const mag = negative ? -a : a\n\n const base: bigint[] = []\n const remainders: Array<{ index: number; rem: bigint }> = []\n let distributed = 0n\n for (let i = 0; i < scaledWeights.length; i++) {\n const product = mag * scaledWeights[i]!\n const share = product / sumW\n base.push(share)\n distributed += share\n remainders.push({ index: i, rem: product % sumW })\n }\n\n // Leftover minor units: strictly fewer than the bucket count.\n let leftover = mag - distributed\n remainders.sort((x, y) => (y.rem > x.rem ? 1 : y.rem < x.rem ? -1 : x.index - y.index))\n for (const { index } of remainders) {\n if (leftover === 0n) break\n base[index] = base[index]! + 1n\n leftover -= 1n\n }\n\n return base.map(p => formatScaledInt(negative && p !== 0n ? -p : p, scale))\n}\n","/**\n * Branded money output type (#338).\n *\n * The decoded read shape of a money field is an exact decimal STRING\n * (`'10000.00'`) — but a hand-written schema types it `string | number`,\n * which is honest about the input side and unhelpful on the output\n * side: every read site hand-coerces, and a missed coercion passes\n * typecheck silently (then surfaces as a runtime template warning, or\n * worse, as `'10000.00' * 100` arithmetic).\n *\n * {@link MoneyString} is the output-side brand: a `string` that has\n * been through noy-db's decode (or {@link asMoney}'s guard). Branding\n * is type-level only — zero runtime cost on the read path.\n *\n * ## Wiring the brand through a validator (the input/output asymmetry)\n *\n * Keep the permissive `string | number` on the INPUT side so write\n * sites are untouched, and brand the OUTPUT side. With Zod:\n *\n * ```ts\n * import type { MoneyString } from '@noy-db/hub'\n *\n * const moneyValue = z.union([z.number(), z.string()]) as unknown as\n * z.ZodType<MoneyString, z.ZodTypeDef, string | number>\n *\n * const Invoice = z.object({ id: z.string(), total: moneyValue })\n * type InvoiceOut = z.output<typeof Invoice> // total: MoneyString\n * type InvoiceIn = z.input<typeof Invoice> // total: string | number\n * ```\n *\n * The cast is sound for fields declared in `moneyFields`: reads pass\n * through `decodeMoneyFields`, which always produces the canonical\n * decimal string.\n */\n\nimport { decimalScaleOf } from './fixed-point.js'\nimport { MoneyUnsupportedError } from './descriptor.js'\n\ndeclare const MONEY_BRAND: unique symbol\n\n/**\n * An exact decimal string produced by noy-db's money decode\n * (`'10000.00'`). The brand exists only at the type level — at runtime\n * a `MoneyString` is a plain string.\n */\nexport type MoneyString = string & { readonly [MONEY_BRAND]: true }\n\n/**\n * Runtime-guarded cast to {@link MoneyString}. Accepts a decimal string\n * or a number, returns the canonical decimal string branded — throws\n * `MoneyUnsupportedError` on anything non-finite / non-decimal. Use at\n * trust boundaries (deserialized JSON, route params); values read\n * through `get()`/`list()` are already canonical.\n */\nexport function asMoney(value: string | number): MoneyString {\n if (!isMoneyLike(value)) {\n throw new MoneyUnsupportedError(`asMoney: ${JSON.stringify(value)} is not a finite decimal`)\n }\n return String(value).trim() as MoneyString\n}\n\n/** Type guard: is `value` a decimal string acceptable as money? */\nexport function isMoneyString(value: unknown): value is MoneyString {\n return typeof value === 'string' && isMoneyLike(value)\n}\n\n/**\n * The ONE sanctioned escape hatch to a JS `number` — explicit because\n * the conversion is lossy past 2^53. For display math and chart axes;\n * never feed the result back into stored amounts (use `mulRate` /\n * `allocate` for exact arithmetic).\n */\nexport function moneyNumber(value: MoneyString | string | number): number {\n if (!isMoneyLike(value)) {\n throw new MoneyUnsupportedError(`moneyNumber: ${JSON.stringify(value)} is not a finite decimal`)\n }\n return Number(value)\n}\n\nfunction isMoneyLike(value: unknown): boolean {\n if (typeof value === 'number') return Number.isFinite(value)\n if (typeof value !== 'string') return false\n return decimalScaleOf(value) !== null\n}\n","/**\n * Vault-level diff orchestrator.\n *\n * Compares a live `Vault`'s plaintext state against a candidate state\n * (another vault, a plain `{ collection: records[] }` map, or a vault\n * dump JSON) and returns a structured `VaultDiff` plan listing the\n * records that would be added, modified, or deleted to bring the live\n * vault into the candidate's shape.\n *\n * Builds on two existing record-level helpers:\n *\n * 1. `diff(a, b)` from `./history/diff.ts` — emits dot-pathed\n * `DiffEntry[]` with `type: 'added' | 'removed' | 'changed'` for\n * each changed field of two records. Used here for the\n * `fieldDiffs` of every `modified` entry, and (with empty result)\n * as the default deep-equal check.\n *\n * 2. `Vault.exportStream()` from `./vault.ts` — the canonical\n * decrypt-and-stream-records iterator. Used to walk both sides\n * when the candidate is itself a `Vault`. ACL-scoped: collections\n * the caller can't read silently drop out, the same way every\n * other plaintext-emitting export pipeline filters them.\n *\n * The new orchestration is the **vault-level** enumeration: bucket\n * each record id into added (only in candidate), deleted (only in\n * vault), or modified (in both with field changes); leave the\n * field-level granularity to the existing `diff()`.\n *\n * Use cases:\n *\n * - Import preview (`@noy-db/as-*` `fromString` returns a plan\n * whose body is a `VaultDiff`).\n * - Backup verification (\"does this `.noydb` bundle from yesterday\n * match the current vault?\").\n * - Two-vault reconciliation (\"what's different between Office A\n * and Office B before we sync?\").\n * - Test assertions (golden-file testing with one-liner\n * `expect(plan.summary).toEqual(...)`).\n *\n * @module\n */\n\nimport type { Vault } from './vault.js'\nimport { diff as fieldDiff, type DiffEntry as FieldDiffEntry } from './history/diff.js'\n\n// ─── Public types ──────────────────────────────────────────────────────\n\n/** Per-record entry shape — added and deleted records carry only the record value. */\nexport interface VaultDiffEntry<T = unknown> {\n readonly collection: string\n readonly id: string\n readonly record: T\n}\n\n/** Modified records carry both halves of the diff plus the field-level breakdown. */\nexport interface VaultDiffModifiedEntry<T = unknown> extends VaultDiffEntry<T> {\n /** The record as it stands in the live vault. */\n readonly before: T\n /** Top-level keys whose values differ between `before` and `record`. */\n readonly fieldsChanged: readonly string[]\n /**\n * Field-level diff entries from `diff(before, record)`. Reuses the\n * existing per-record diff helper so consumers can render git-style\n * `path: from → to` rows without re-walking the records.\n */\n readonly fieldDiffs: readonly FieldDiffEntry[]\n}\n\nexport interface VaultDiff<T = unknown> {\n readonly added: readonly VaultDiffEntry<T>[]\n readonly modified: readonly VaultDiffModifiedEntry<T>[]\n readonly deleted: readonly VaultDiffEntry<T>[]\n /** Only populated when `options.includeUnchanged: true`. */\n readonly unchanged: readonly VaultDiffEntry<T>[] | undefined\n readonly summary: {\n readonly add: number\n readonly modify: number\n readonly delete: number\n readonly total: number\n }\n /**\n * Format the diff as a human-readable string.\n *\n * - `'count'` — one line, just the numbers (`12 added · 3 modified · 0 deleted`)\n * - `'one-line'` — count plus a single overview line\n * - `'full'` — count + one row per added/modified/deleted record (default)\n */\n format(opts?: { detail?: 'count' | 'one-line' | 'full' }): string\n}\n\nexport interface DiffOptions {\n /** Restrict the diff to a subset of collections. */\n readonly collections?: readonly string[]\n /** Field on each record that carries its id. Defaults to `'id'`. */\n readonly idKey?: string\n /** Override the default deep-equal check for \"modified vs unchanged\". */\n readonly compareFn?: (a: unknown, b: unknown) => boolean\n /** If true, include unchanged records in the diff (off by default to save memory). */\n readonly includeUnchanged?: boolean\n}\n\n/**\n * Candidate state to diff the vault against:\n *\n * - A `Vault` instance — both sides are walked via `exportStream()`.\n * - A `Record<collection, records[]>` map — same shape `as-json.toObject()`\n * produces. Useful for diffing parsed file content against the live vault.\n * - A `VaultDump` (output of `vault.dump()`) — a JSON string carrying the\n * full vault state. Parsed and reduced to the map shape above.\n */\nexport type DiffCandidate<T = unknown> =\n | Vault\n | Record<string, readonly T[]>\n | string\n\n// ─── Implementation ────────────────────────────────────────────────────\n\n/**\n * Compute the diff between a live vault and a candidate state.\n *\n * Returns a fully buffered `VaultDiff` — no streaming. Memory cost is\n * O(n + m) in the row count of vault + candidate. For documented\n * 1K-50K-record vaults this is fine; a streaming variant lands as a\n * follow-up if a > 100K-record consumer arrives.\n */\nexport async function diffVault<T = unknown>(\n vault: Vault,\n candidate: DiffCandidate<T>,\n options: DiffOptions = {},\n): Promise<VaultDiff<T>> {\n const idKey = options.idKey ?? 'id'\n const filter = options.collections ? new Set(options.collections) : null\n const compareFn =\n options.compareFn ?? ((a: unknown, b: unknown) => fieldDiff(a, b).length === 0)\n\n // Side A — walk the live vault via exportStream(). Each chunk arrives\n // already decrypted and ACL-scoped, so collections the caller can't\n // read silently drop out. exportStream's records are typed `unknown[]`\n // — diffVault is the type-erasure boundary; the caller asserts the\n // record shape via the function's `<T>` generic.\n const live = new Map<string, Map<string, T>>()\n for await (const chunk of vault.exportStream({ granularity: 'collection' })) {\n if (filter && !filter.has(chunk.collection)) continue\n const collection = live.get(chunk.collection) ?? new Map<string, T>()\n for (const record of chunk.records) {\n const id = readIdField(record, idKey)\n if (!id) continue\n collection.set(id, record as T)\n }\n live.set(chunk.collection, collection)\n }\n\n // Side B — normalise the candidate into the same shape.\n const cand = await normaliseCandidate<T>(candidate, idKey, filter)\n\n // Walk every (collection, id) on either side and bucket.\n const added: VaultDiffEntry<T>[] = []\n const modified: VaultDiffModifiedEntry<T>[] = []\n const deleted: VaultDiffEntry<T>[] = []\n const unchanged: VaultDiffEntry<T>[] | undefined = options.includeUnchanged ? [] : undefined\n\n const collectionNames = new Set([...live.keys(), ...cand.keys()])\n for (const collection of [...collectionNames].sort()) {\n const liveColl = live.get(collection) ?? new Map<string, T>()\n const candColl = cand.get(collection) ?? new Map<string, T>()\n const allIds = new Set([...liveColl.keys(), ...candColl.keys()])\n\n for (const id of [...allIds].sort()) {\n const before = liveColl.get(id)\n const after = candColl.get(id)\n\n if (before === undefined && after !== undefined) {\n added.push({ collection, id, record: after })\n } else if (before !== undefined && after === undefined) {\n deleted.push({ collection, id, record: before })\n } else if (before !== undefined && after !== undefined) {\n if (compareFn(before, after)) {\n unchanged?.push({ collection, id, record: after })\n } else {\n const fieldDiffs = fieldDiff(before, after)\n const fieldsChanged = uniqueTopLevelKeys(fieldDiffs)\n modified.push({\n collection,\n id,\n record: after,\n before,\n fieldsChanged,\n fieldDiffs,\n })\n }\n }\n }\n }\n\n const summary = {\n add: added.length,\n modify: modified.length,\n delete: deleted.length,\n total: added.length + modified.length + deleted.length,\n }\n\n return {\n added,\n modified,\n deleted,\n unchanged,\n summary,\n format(opts) {\n return formatDiff(opts?.detail ?? 'full', { added, modified, deleted, summary })\n },\n }\n}\n\n// ─── Internals ─────────────────────────────────────────────────────────\n\nasync function normaliseCandidate<T>(\n candidate: DiffCandidate<T>,\n idKey: string,\n filter: Set<string> | null,\n): Promise<Map<string, Map<string, T>>> {\n const out = new Map<string, Map<string, T>>()\n\n // Vault instance — duck-type via the exportStream method (matches\n // vault.ts's structural shape without forcing a runtime instanceof check\n // that would import the class and risk circular deps).\n if (\n typeof candidate === 'object' &&\n candidate !== null &&\n 'exportStream' in candidate &&\n typeof (candidate as Vault).exportStream === 'function'\n ) {\n for await (const chunk of (candidate as Vault).exportStream({ granularity: 'collection' })) {\n if (filter && !filter.has(chunk.collection)) continue\n const collection = out.get(chunk.collection) ?? new Map<string, T>()\n for (const record of chunk.records) {\n const id = readIdField(record, idKey)\n if (!id) continue\n collection.set(id, record as T)\n }\n out.set(chunk.collection, collection)\n }\n return out\n }\n\n // String — assume a vault.dump() JSON string. Parse and reduce to the map shape.\n if (typeof candidate === 'string') {\n let parsed: unknown\n try {\n parsed = JSON.parse(candidate)\n } catch (err) {\n throw new Error(\n `diffVault: candidate string is not valid JSON (${(err as Error).message})`,\n )\n }\n return collectionsFromObject<T>(parsed, idKey, filter)\n }\n\n // Plain object — `Record<collection, records[]>` (same shape as-json.toObject() returns).\n return collectionsFromObject<T>(candidate, idKey, filter)\n}\n\nfunction collectionsFromObject<T>(\n raw: unknown,\n idKey: string,\n filter: Set<string> | null,\n): Map<string, Map<string, T>> {\n const out = new Map<string, Map<string, T>>()\n if (raw === null || typeof raw !== 'object') {\n throw new Error('diffVault: candidate must be a Vault, an object, or a JSON string')\n }\n // A vault dump JSON has a top-level shape like { _compartment, _keyring, <coll>: <records[]> }.\n // We accept both: keys starting with `_` are skipped (they're metadata), the rest are collections.\n for (const [key, value] of Object.entries(raw)) {\n if (key.startsWith('_')) continue\n if (filter && !filter.has(key)) continue\n if (!Array.isArray(value)) continue\n const collection = new Map<string, T>()\n for (const record of value as readonly T[]) {\n if (record === null || typeof record !== 'object') continue\n const id = readIdField(record, idKey)\n if (!id) continue\n collection.set(id, record)\n }\n out.set(key, collection)\n }\n return out\n}\n\nfunction uniqueTopLevelKeys(diffs: readonly FieldDiffEntry[]): readonly string[] {\n const keys = new Set<string>()\n for (const d of diffs) {\n // path is dot-separated; the top-level key is everything before the\n // first `.` or `[`. (`a.b.c` → `a`, `tags[0]` → `tags`, `(root)` → `(root)`).\n const m = /^[^.[]+/.exec(d.path)\n if (m) keys.add(m[0])\n }\n return [...keys]\n}\n\n/**\n * Pull the id field off a record without going through `String(obj)`,\n * which would emit `[object Object]` for nested objects and silently\n * collapse rows that share the same parent. Only string and number ids\n * are accepted; anything else returns the empty string and the record\n * is skipped at the call site.\n */\nfunction readIdField(record: unknown, idKey: string): string {\n if (record === null || typeof record !== 'object') return ''\n const v = (record as Record<string, unknown>)[idKey]\n if (typeof v === 'string') return v\n if (typeof v === 'number' && Number.isFinite(v)) return String(v)\n return ''\n}\n\ninterface FormatBuckets<T> {\n readonly added: readonly VaultDiffEntry<T>[]\n readonly modified: readonly VaultDiffModifiedEntry<T>[]\n readonly deleted: readonly VaultDiffEntry<T>[]\n readonly summary: VaultDiff<T>['summary']\n}\n\nfunction formatDiff<T>(\n detail: 'count' | 'one-line' | 'full',\n b: FormatBuckets<T>,\n): string {\n const head = `${b.summary.add} added · ${b.summary.modify} modified · ${b.summary.delete} deleted`\n if (detail === 'count') return head\n if (b.summary.total === 0) return head + '\\n(no changes)'\n if (detail === 'one-line') return head\n\n const rows: string[] = [head, '']\n for (const e of b.added) rows.push(`${e.collection}/${e.id}\\tadded`)\n for (const e of b.modified) {\n const fields = e.fieldDiffs\n .map((f) => `${f.path}: ${shortJSON(f.from)} → ${shortJSON(f.to)}`)\n .join(', ')\n rows.push(`${e.collection}/${e.id}\\tmodified\\t${fields}`)\n }\n for (const e of b.deleted) rows.push(`${e.collection}/${e.id}\\tdeleted`)\n return rows.join('\\n')\n}\n\nfunction shortJSON(value: unknown): string {\n if (value === undefined) return 'undefined'\n const s = JSON.stringify(value)\n // JSON.stringify returns string for any JSON value except `undefined`\n // (handled above), `function`, and `symbol`. Fall back to a static\n // tag for those — never let an arbitrary object hit the default\n // stringifier (which the lint rule explicitly bans).\n if (typeof s !== 'string') return '<unrepresentable>'\n return s.length > 60 ? s.slice(0, 57) + '...' : s\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKO,SAAS,cAAoC;AAClD,SAAO,EAAE,MAAM,eAAe,eAAe,OAAO,EAAE,QAAQ,QAAQ,GAAG;AAC3E;AAGO,SAAS,eAAqC;AACnD,SAAO;AAAA,IACL,MAAM;AAAA,IACN,cAAc,OAAoB;AAChC,UAAI,MAAM,SAAS,gBAAgB;AACjC,eAAO;AAAA,UACL,QAAQ;AAAA,UACR,OAA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DEW.js";
5
5
  import "./chunk-FZU343FL.js";
6
- import "./chunk-GC4V7RU7.js";
6
+ import "./chunk-F3BPIPLS.js";
7
7
  import "./chunk-YULZKK4F.js";
8
8
  import "./chunk-535SSHBS.js";
9
9
  export {
10
10
  issueAttestationCore
11
11
  };
12
- //# sourceMappingURL=issue-ADVS4OVP.js.map
12
+ //# sourceMappingURL=issue-RZP3VI6O.js.map