@noy-db/hub 0.2.0-pre.26 → 0.2.0-pre.27

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 (147) hide show
  1. package/dist/attestation/index.cjs.map +1 -1
  2. package/dist/attestation/index.d.cts +1 -1
  3. package/dist/attestation/index.d.ts +1 -1
  4. package/dist/attestation/index.js +4 -4
  5. package/dist/blobs/index.cjs.map +1 -1
  6. package/dist/blobs/index.d.cts +3 -3
  7. package/dist/blobs/index.d.ts +3 -3
  8. package/dist/blobs/index.js +4 -4
  9. package/dist/bundle/index.cjs +320 -144
  10. package/dist/bundle/index.cjs.map +1 -1
  11. package/dist/bundle/index.d.cts +3 -3
  12. package/dist/bundle/index.d.ts +3 -3
  13. package/dist/bundle/index.js +8 -8
  14. package/dist/{chunk-HUXDQIVU.js → chunk-2NYVA6FW.js} +2 -2
  15. package/dist/{chunk-OCRDV3NU.js → chunk-5EITJMUJ.js} +3 -3
  16. package/dist/{chunk-EYZJULEN.js → chunk-6H4CAHMQ.js} +2 -2
  17. package/dist/{chunk-VGAN5RLD.js → chunk-6M5JKTUQ.js} +2 -2
  18. package/dist/{chunk-N4EXCKWP.js → chunk-6ZKXFMUG.js} +2 -2
  19. package/dist/{chunk-KJ37E3R5.js → chunk-7DDTFGXY.js} +2 -2
  20. package/dist/{chunk-LR7CODVN.js → chunk-AD6RNBAW.js} +1 -1
  21. package/dist/chunk-AD6RNBAW.js.map +1 -0
  22. package/dist/{chunk-TSUICI5N.js → chunk-BMDVFBCL.js} +2 -2
  23. package/dist/{chunk-FCIZXX56.js → chunk-BOMH3637.js} +2 -2
  24. package/dist/{chunk-RZOGD7IF.js → chunk-CVTPNW2Y.js} +6 -6
  25. package/dist/{chunk-GPZHHTJU.js → chunk-DONPLWRC.js} +2 -2
  26. package/dist/{chunk-GHXOVGTX.js → chunk-HAKEZTA7.js} +3 -3
  27. package/dist/{chunk-QYQRAOEF.js → chunk-I2RX62RX.js} +2 -2
  28. package/dist/{chunk-2RHBFCWQ.js → chunk-IWGVH2RR.js} +3 -3
  29. package/dist/{chunk-Y5CTT6K5.js → chunk-K6PCTYAH.js} +2 -2
  30. package/dist/{chunk-ANLOD6IS.js → chunk-KA5A5CSD.js} +3 -3
  31. package/dist/{chunk-56ENKU46.js → chunk-KSKKLVPA.js} +97 -144
  32. package/dist/chunk-KSKKLVPA.js.map +1 -0
  33. package/dist/{chunk-UNBX2HMA.js → chunk-LXA2E3VI.js} +2 -2
  34. package/dist/{chunk-JJKXJAH2.js → chunk-PFKAT4NT.js} +3 -3
  35. package/dist/{chunk-ZCBJIDT4.js → chunk-RRCRITDM.js} +2 -2
  36. package/dist/{chunk-YP2AYE5W.js → chunk-SID2NJNF.js} +2 -2
  37. package/dist/chunk-Z3BJF7SF.js +220 -0
  38. package/dist/chunk-Z3BJF7SF.js.map +1 -0
  39. package/dist/consent/index.d.cts +2 -2
  40. package/dist/consent/index.d.ts +2 -2
  41. package/dist/{decrypt-partition-CyyJUWLR.d.ts → decrypt-partition-CptDdcCx.d.ts} +1 -1
  42. package/dist/{decrypt-partition-C71vhnND.d.cts → decrypt-partition-DmkeOB4I.d.cts} +1 -1
  43. package/dist/derivations/index.d.cts +3 -3
  44. package/dist/derivations/index.d.ts +3 -3
  45. package/dist/{dev-unlock-BdrE0kbS.d.cts → dev-unlock-DUTLA3Sc.d.cts} +1 -1
  46. package/dist/{dev-unlock-ByBkl99-.d.ts → dev-unlock-Y9znMkQ2.d.ts} +1 -1
  47. package/dist/{fanout-sidecar-ZQT4Y7PF.js → fanout-sidecar-OC4QVTS2.js} +2 -2
  48. package/dist/forget/index.js +2 -2
  49. package/dist/guards/index.d.cts +3 -3
  50. package/dist/guards/index.d.ts +3 -3
  51. package/dist/{hash-CZxVv8RH.d.ts → hash-Btl9IvQS.d.ts} +1 -1
  52. package/dist/{hash-BUkDp_8Q.d.cts → hash-DFK7cGdo.d.cts} +1 -1
  53. package/dist/history/index.cjs.map +1 -1
  54. package/dist/history/index.d.cts +3 -3
  55. package/dist/history/index.d.ts +3 -3
  56. package/dist/history/index.js +3 -3
  57. package/dist/i18n/index.cjs.map +1 -1
  58. package/dist/i18n/index.d.cts +2 -2
  59. package/dist/i18n/index.d.ts +2 -2
  60. package/dist/i18n/index.js +3 -3
  61. package/dist/{index-CBUhOmrM.d.cts → index-CqzZml-D.d.cts} +1 -1
  62. package/dist/{index-DFhKV-6A.d.ts → index-wRwJVVJQ.d.ts} +1 -1
  63. package/dist/index.cjs +316 -140
  64. package/dist/index.cjs.map +1 -1
  65. package/dist/index.d.cts +11 -11
  66. package/dist/index.d.ts +11 -11
  67. package/dist/index.js +19 -18
  68. package/dist/index.js.map +1 -1
  69. package/dist/{issue-LEBPVF3Y.js → issue-ZZ2XPOGP.js} +4 -4
  70. package/dist/kernel/index.cjs +61 -0
  71. package/dist/kernel/index.cjs.map +1 -1
  72. package/dist/kernel/index.d.cts +2 -2
  73. package/dist/kernel/index.d.ts +2 -2
  74. package/dist/kernel/index.js +7 -0
  75. package/dist/{ledger-FLRTSOYH.js → ledger-XQ4KVFQ6.js} +3 -3
  76. package/dist/materialized-views/index.d.cts +3 -3
  77. package/dist/materialized-views/index.d.ts +3 -3
  78. package/dist/{mime-magic-BAhLjkHw.d.cts → mime-magic-Co4Pyj-O.d.cts} +1 -1
  79. package/dist/{mime-magic-C1UbcBxP.d.ts → mime-magic-OiPT1qed.d.ts} +1 -1
  80. package/dist/{noydb-6FA46A4M.js → noydb-EY52NVH4.js} +15 -14
  81. package/dist/overlay-views/index.d.cts +3 -3
  82. package/dist/overlay-views/index.d.ts +3 -3
  83. package/dist/periods/index.cjs.map +1 -1
  84. package/dist/periods/index.d.cts +2 -2
  85. package/dist/periods/index.d.ts +2 -2
  86. package/dist/periods/index.js +3 -3
  87. package/dist/{public-envelope-DBKJEBBF.js → public-envelope-O6X6AUUS.js} +3 -3
  88. package/dist/{revoke-P5D3UTRX.js → revoke-QJ2HUM4W.js} +4 -4
  89. package/dist/session/index.d.cts +3 -3
  90. package/dist/session/index.d.ts +3 -3
  91. package/dist/shadow/index.d.cts +2 -2
  92. package/dist/shadow/index.d.ts +2 -2
  93. package/dist/{signer-NEQPCHMW.js → signer-SCJ6C6HQ.js} +3 -3
  94. package/dist/snapshots/index.d.cts +2 -2
  95. package/dist/snapshots/index.d.ts +2 -2
  96. package/dist/snapshots/index.js +3 -3
  97. package/dist/store/index.d.cts +2 -2
  98. package/dist/store/index.d.ts +2 -2
  99. package/dist/sync/index.cjs.map +1 -1
  100. package/dist/sync/index.d.cts +1 -1
  101. package/dist/sync/index.d.ts +1 -1
  102. package/dist/sync/index.js +2 -2
  103. package/dist/team/index.cjs.map +1 -1
  104. package/dist/team/index.d.cts +2 -2
  105. package/dist/team/index.d.ts +2 -2
  106. package/dist/team/index.js +5 -5
  107. package/dist/{transition-guard-BSLdikC_.d.ts → transition-guard-CJmb8O8q.d.ts} +1 -1
  108. package/dist/{transition-guard-DPs6al8h.d.cts → transition-guard-Dzj68JWC.d.cts} +1 -1
  109. package/dist/tx/index.d.cts +2 -2
  110. package/dist/tx/index.d.ts +2 -2
  111. package/dist/{types-CCq0WHh9.d.ts → types-CkSWJt0H.d.ts} +137 -7
  112. package/dist/{types-BCYvhKzr.d.cts → types-CwrTuYFI.d.cts} +137 -7
  113. package/dist/{with-materialized-view-DiD41wQp.d.ts → with-materialized-view-BVfcPlaE.d.ts} +1 -1
  114. package/dist/{with-materialized-view-CTHe6uh9.d.cts → with-materialized-view-dPG213gd.d.cts} +1 -1
  115. package/dist/{with-overlayed-view-Dlz5hcM8.d.cts → with-overlayed-view-CJ2UDBol.d.cts} +1 -1
  116. package/dist/{with-overlayed-view-DlbsJMhF.d.ts → with-overlayed-view-zYPQzGGh.d.ts} +1 -1
  117. package/dist/{with-rollup-BBWdrCvu.d.cts → with-rollup-B_zbRi3f.d.cts} +1 -1
  118. package/dist/{with-rollup-mT4_CWaU.d.ts → with-rollup-BvaJefEs.d.ts} +1 -1
  119. package/package.json +3 -3
  120. package/dist/chunk-56ENKU46.js.map +0 -1
  121. package/dist/chunk-LR7CODVN.js.map +0 -1
  122. /package/dist/{chunk-HUXDQIVU.js.map → chunk-2NYVA6FW.js.map} +0 -0
  123. /package/dist/{chunk-OCRDV3NU.js.map → chunk-5EITJMUJ.js.map} +0 -0
  124. /package/dist/{chunk-EYZJULEN.js.map → chunk-6H4CAHMQ.js.map} +0 -0
  125. /package/dist/{chunk-VGAN5RLD.js.map → chunk-6M5JKTUQ.js.map} +0 -0
  126. /package/dist/{chunk-N4EXCKWP.js.map → chunk-6ZKXFMUG.js.map} +0 -0
  127. /package/dist/{chunk-KJ37E3R5.js.map → chunk-7DDTFGXY.js.map} +0 -0
  128. /package/dist/{chunk-TSUICI5N.js.map → chunk-BMDVFBCL.js.map} +0 -0
  129. /package/dist/{chunk-FCIZXX56.js.map → chunk-BOMH3637.js.map} +0 -0
  130. /package/dist/{chunk-RZOGD7IF.js.map → chunk-CVTPNW2Y.js.map} +0 -0
  131. /package/dist/{chunk-GPZHHTJU.js.map → chunk-DONPLWRC.js.map} +0 -0
  132. /package/dist/{chunk-GHXOVGTX.js.map → chunk-HAKEZTA7.js.map} +0 -0
  133. /package/dist/{chunk-QYQRAOEF.js.map → chunk-I2RX62RX.js.map} +0 -0
  134. /package/dist/{chunk-2RHBFCWQ.js.map → chunk-IWGVH2RR.js.map} +0 -0
  135. /package/dist/{chunk-Y5CTT6K5.js.map → chunk-K6PCTYAH.js.map} +0 -0
  136. /package/dist/{chunk-ANLOD6IS.js.map → chunk-KA5A5CSD.js.map} +0 -0
  137. /package/dist/{chunk-UNBX2HMA.js.map → chunk-LXA2E3VI.js.map} +0 -0
  138. /package/dist/{chunk-JJKXJAH2.js.map → chunk-PFKAT4NT.js.map} +0 -0
  139. /package/dist/{chunk-ZCBJIDT4.js.map → chunk-RRCRITDM.js.map} +0 -0
  140. /package/dist/{chunk-YP2AYE5W.js.map → chunk-SID2NJNF.js.map} +0 -0
  141. /package/dist/{fanout-sidecar-ZQT4Y7PF.js.map → fanout-sidecar-OC4QVTS2.js.map} +0 -0
  142. /package/dist/{issue-LEBPVF3Y.js.map → issue-ZZ2XPOGP.js.map} +0 -0
  143. /package/dist/{ledger-FLRTSOYH.js.map → ledger-XQ4KVFQ6.js.map} +0 -0
  144. /package/dist/{noydb-6FA46A4M.js.map → noydb-EY52NVH4.js.map} +0 -0
  145. /package/dist/{public-envelope-DBKJEBBF.js.map → public-envelope-O6X6AUUS.js.map} +0 -0
  146. /package/dist/{revoke-P5D3UTRX.js.map → revoke-QJ2HUM4W.js.map} +0 -0
  147. /package/dist/{signer-NEQPCHMW.js.map → signer-SCJ6C6HQ.js.map} +0 -0
package/dist/index.d.cts CHANGED
@@ -1,27 +1,27 @@
1
- import { aW as NoydbStore, bs as UserEnvelope, bc as PublicEnvelope, bt as GateName, bu as GatePolicy, bv as VaultPolicy, bw as ActiveTier, bx as FactorProof, aY as EncryptedEnvelope, by as SchemaUpdateStrategy, bz as TransformFn, bA as PersistedSchemaEnvelope, bB as UpdateDecision, bd as SealingKeyProvider, aU as UnlockedKeyring, bC as DirectoryConfig, bD as UserVisibility, bh as Vault, b1 as DiffEntry } from './types-BCYvhKzr.cjs';
2
- export { bE as AccessibleVault, bF as AffectedDocument, a_ as AppendInput, bG as ApproveWithdrawalOptions, bH as ArchivePolicy, bI as ArchiveResult, bJ as ArchiveRunOptions, bK as ArchiveStrategy, aE as ArrayOutputSpec, o as BLOB_CHUNKS_COLLECTION, p as BLOB_COLLECTION, r as BLOB_INDEX_COLLECTION, t as BLOB_SLOTS_PREFIX, u as BLOB_VERSIONS_PREFIX, bL as BUNDLE_STORE_POLICY, z as BlobObject, A as BlobPutOptions, C as BlobResponseOptions, E as BlobSet, bM as BuiltInGateName, be as BundleRecipient, a4 as CONSENT_AUDIT_COLLECTION, bN as CacheOptions, bO as CacheStats, bP as ChangeEvent, a$ as ChangeType, ad as ClosePeriodOptions, aN as Collection, bQ as CollectionChangeEvent, bR as CollectionConflictResolver, bS as CollectionDescriptor, au as CollectionFrame, b0 as CollectionInstant, bT as CollectionStats, bU as ComputedFieldError, bV as ComputedFields, bW as ComputedFn, bX as Conflict, bY as ConflictPolicy, bZ as ConflictStrategy, a5 as ConsentAuditEntry, a6 as ConsentAuditFilter, a7 as ConsentContext, a8 as ConsentOp, b_ as CrossTierAccessEvent, b$ as CustodyApi, K as DEFAULT_CHUNK_SIZE, c0 as DEFAULT_PUBLIC_ENVELOPE_SCHEMA, c1 as DELEGATIONS_COLLECTION, D as DICT_COLLECTION_PREFIX, c2 as DeepPartial, c3 as DeepPartialOrNull, c4 as DeferredNumberingConfig, c5 as DelegationToken, c6 as DeleteManyResult, c7 as DerivationDescriptor, aC as DerivationStrategy, aG as DerivationStrategyHandle, aH as DerivedFromMeta, a as DictEntry, b as DictKeyDescriptor, c as DictionaryHandle, d as DictionaryOptions, c8 as DirtyEntry, c9 as DryRunResult, ca as DumpSchemaOptions, cb as ELEVATION_AUDIT_COLLECTION, cc as ElevatedHandle, cd as EnrollAuthenticatorOptions, ce as EnrollAuthenticatorWrappingDEKsOptions, cf as EnrollAuthenticatorWrappingKEKOptions, cg as EnrollRecoveryResult, ch as ExportAccessibleOptions, ci as ExportCapability, cj as ExportChunk, ck as ExportFormat, cl as ExportStreamOptions, cm as FactorKind, cn as FactorProofBundle, co as FactorRequirement, cp as FenceDoc, cq as FenceState, cr as FieldChange, cs as FieldDescriptor, ct as FieldSource, cu as FormattedSequenceHandle, cv as FrozenSnapshotRef, cw as GhostRecord, cx as GrantCustodianOptions, cy as GrantOptions, ao as GuardChange, ap as GuardContext, an as GuardStrategy, ar as GuardStrategyHandle, cz as GuardViolation, cA as HistoryConfig, cB as HistoryEntry, aX as HistoryOptions, cC as INDEXED_STORE_POLICY, cD as ImportCapability, cE as InferOutput, cF as InternalCollectionStats, cG as IssueDelegationOptions, cH as IssueMagicLinkGrantOptions, b2 as JsonPatch, b3 as JsonPatchOp, cI as KeyringAuthenticator, cJ as KeyringAuthenticatorWrappingDEKs, cK as KeyringAuthenticatorWrappingKEK, cL as KeyringFile, b4 as LedgerStore, cM as LiberateOptions, cN as LiberateResult, cO as LinkEndpointError, cP as LinkIntegrityError, cQ as LinkOnDelete, cR as LinkRow, cS as LinkSetHandle, cT as LinkSpec, cU as ListAccessibleVaultsOptions, cV as ListPageResult, cW as ListUsersOptions, cX as LiveUserEnvelope, cY as LocaleReadOptions, cZ as Lru, c_ as LruOptions, c$ as LruStats, d0 as MAGIC_LINK_CONTENT_INFO_PREFIX, d1 as MAGIC_LINK_GRANTS_COLLECTION, d2 as MAGIC_LINK_KEK_INFO_PREFIX, d3 as MagicLinkGrantPayload, d4 as MagicLinkGrantRecord, bo as MaterializedFromMeta, d5 as MaterializedViewDescriptor, bp as MaterializedViewOutput, aK as MaterializedViewStrategy, aL as MaterializedViewStrategyHandle, d6 as MemoryRecipientSealer, d7 as MemorySealingKeyProvider, d8 as NOYDB_BACKUP_VERSION, d9 as NOYDB_FORMAT_VERSION, da as NOYDB_KEYRING_VERSION, db as NOYDB_SYNC_VERSION, dc as NextOptions, dd as Noydb, aw as NoydbBundleStore, de as NoydbEventMap, df as NoydbOptions, dg as NumberingAssignment, T as ObjectListEntry, U as ObjectMeta, V as ObjectProjection, W as ObjectUrlOptions, ae as OpenPeriodOptions, aI as OutputSpec, aO as OverlayFieldMergeMode, aP as OverlayFieldMergeRule, dh as OverlayViewDescriptor, aM as OverlayedViewStrategy, aR as OverlayedViewStrategyHandle, af as PERIODS_COLLECTION, di as PUBLIC_ENVELOPE_FIELDS, dj as PaperRecoveryDoc, dk as PaperRecoveryEntry, dl as PassphrasePolicy, dm as PassphraseValidationResult, ag as PeriodRecord, dn as Permission, dp as Permissions, dq as PersistedSchemaKind, dr as PlaintextTranslatorContext, ds as PlaintextTranslatorFn, P as PolicyEnforcer, dt as PresenceHandle, du as PresencePeer, aZ as PruneOptions, dv as PublicEnvelopeField, dw as PublicEnvelopeSchema, dx as PublicEnvelopeText, dy as PullMode, dz as PullOptions, dA as PullPolicy, dB as PullResult, dC as PushMode, dD as PushOptions, dE as PushPolicy, dF as PushResult, dG as PutManyItemOptions, dH as PutManyOptions, dI as PutManyResult, X as PutObjectOptions, Y as PutUrlOptions, dJ as QueryAcrossOptions, dK as QueryAcrossResult, dL as QuickUnlockState, dM as QuickUnlockStore, dN as ReAuthOperation, bg as RecipientHint, bf as RecipientSealer, aJ as RecordOutputSpec, dO as RecoverPassphraseInput, dP as RecoverPassphraseResult, dQ as RecoverUserOptions, dR as RecoveryProof, dS as RejectWithdrawalOptions, dT as RequestWithdrawalOptions, dU as RequestWithdrawalResult, dV as ResolvedPublicEnvelopeSchema, ax as RetentionPolicy, dW as RevokeOptions, aT as Role, dX as RotatePassphraseInput, dY as RotateRecoveryOptions, dZ as RotateRecoveryResult, d_ as SEALED_PASSPHRASE_RECORD_ID, d$ as SchemaDelta, e0 as SchemaIntrospection, S as ScriptWarning, e1 as SealedEnvelope, e2 as SealedPassphrase, e3 as SearchEntry, e4 as SearchOptions, e5 as SearchResult, e6 as SequenceHandle, e7 as SequenceOptions, e8 as SequenceStore, e9 as SessionPolicy, ea as SetPublicEnvelopeInput, eb as ShamirRecoveryDoc, ec as ShamirRecoveryEntry, bj as ShamirRecoveryProvider, Z as SlotInfo, _ as SlotRecord, ed as SlotRewrapCeremony, ee as SlotRewrapContext, aA as SnapshotMeta, ef as StandardSchemaV1, eg as StandardSchemaV1Issue, eh as StandardSchemaV1SyncResult, e as StaticDictDescriptor, ei as StoreAuth, ej as StoreAuthKind, ek as StoreCapabilities, el as StoreTime, em as SyncEngine, en as SyncMetadata, eo as SyncPolicy, ep as SyncScheduler, eq as SyncSchedulerStatus, er as SyncStatus, es as SyncTarget, et as SyncTargetRole, eu as SyncTransaction, ev as SyncTransactionResult, ew as TabChannel, ex as TabCoordinationOptions, ey as TabLockManager, ez as TabPresence, eA as TabRole, eB as TierMode, eC as TransactionInvariant, eD as TranslatorAuditEntry, eE as TxCollection, bk as TxContext, eF as TxOp, eG as TxVault, eH as USER_ENVELOPE_COLLECTION, eI as USER_ENVELOPE_MAX_BYTES, bq as UnionArmJoin, br as UnionSource, eJ as Unsubscribe, eK as UpdateAuthenticatorOptions, eL as UpdateContext, eM as UpdateUserOptions, eN as UserApi, eO as UserEnvelopeCheckGate, eP as UserEnvelopeOversizedError, eQ as UserEnvelopePresented, eR as UserInfo, eS as VaultBackup, b5 as VaultEngine, av as VaultFrame, b6 as VaultInstant, eT as VaultPolicyOnDisk, eU as VaultSchemaSnapshot, eV as VaultSnapshot, b7 as VerifyResult, $ as VersionRecord, eW as WarningRules, eX as WeakPassphraseError, eY as WeakPassphraseReason, eZ as WithArchiveOptions, e_ as WithdrawAccessibleOptions, e$ as WithdrawResult, f0 as WithdrawalRequest, f1 as WithdrawalRequestError, f2 as WithdrawalRequestStatus, f3 as WrappedDeksBlob, f4 as WriteConflict, f5 as WriteEvent, f6 as WriteHook, f7 as WriteQueue, f8 as aesGcmOpen, b8 as applyPatch, f9 as approveWithdrawal, fa as assertStrongPassphrase, fb as buildRecipientKeyringFile, fc as burnPaperRecoveryEntry, fd as compileSequenceFormat, b9 as computePatch, n as createEnforcer, fe as createNoydb, ff as createStore, fg as deriveMagicLinkContentKey, f as dictCollectionName, g as dictKey, ba as diff, h as enforceScript, fh as enrollAuthenticator, fi as estimateEntropy, fj as evalComputedFields, fk as evaluateExportCapability, fl as evaluateImportCapability, fm as exportAccessibleData, fn as findAuthenticator, bb as formatDiff, fo as hasExportCapability, fp as hasImportCapability, fq as hasRecoveryEnrolled, i as inferScripts, j as isDictCollectionName, k as isDictKeyDescriptor, fr as isLinkCollectionName, fs as isMagicLinkGrantExpired, ft as isPublicEnvelope, l as isStaticDictDescriptor, fu as issueDelegation, fv as keyringRecoverPassphrase, fw as keyringRotatePassphrase, fx as liberateVault, fy as listMagicLinkGrants, fz as listUsers, fA as listUsersWithEnvelopes, fB as listWithdrawalRequests, fC as loadActiveDelegations, fD as loadPaperRecoveryEntries, fE as loadSealedPassphrase, fF as loadShamirRecoveryEntries, fG as magicLinkGrantRecordId, a1 as memoryObjectProjection, fH as mintPaperRecoveryEntry, fI as mintShamirRecoveryEntry, fJ as mintWrappedDeksBlob, fK as parseRsaOaepTlv, fL as parseSealedEnvelope, fM as readMagicLinkGrantRecord, fN as recoverUser, fO as rejectWithdrawal, fP as removeAuthenticator, fQ as requestWithdrawal, fR as resolvePublicEnvelopeSchema, fS as resolveSequenceKey, fT as revokeDelegation, fU as revokeMagicLinkGrant, fV as runTransaction, fW as savePaperRecoveryEntries, fX as saveSealedPassphrase, fY as saveShamirRecoveryEntries, fZ as sealRsaOaepTlv, s as staticDict, f_ as unwrapDeksFromBlob, f$ as unwrapDeksFromPaperEntry, g0 as unwrapDeksFromShamirEntry, g1 as unwrapMagicLinkGrant, g2 as validatePassphrase, g3 as validatePublicEnvelopeInput, g4 as validateSchemaInput, g5 as validateSchemaOutput, v as validateSessionPolicy, g6 as withArchive, g7 as withDeferredNumbering, g8 as withdrawAccessibleData, g9 as writeMagicLinkGrant } from './types-BCYvhKzr.cjs';
3
- export { I as ImportExternalOptions, a as ImportExternalResult, b as ImportableCollection, d as detectMagic, c as detectMimeType, i as importExternalObjects, e as isPreCompressed } from './mime-magic-BAhLjkHw.cjs';
1
+ import { aW as NoydbStore, bs as UserEnvelope, bc as PublicEnvelope, bt as GateName, bu as GatePolicy, bv as VaultPolicy, bw as ActiveTier, bx as FactorProof, aY as EncryptedEnvelope, by as SchemaUpdateStrategy, bz as TransformFn, bA as PersistedSchemaEnvelope, bB as UpdateDecision, bd as SealingKeyProvider, aU as UnlockedKeyring, bC as DirectoryConfig, bD as UserVisibility, bh as Vault, b1 as DiffEntry } from './types-CwrTuYFI.cjs';
2
+ export { bE as AccessibleVault, bF as AffectedDocument, a_ as AppendInput, bG as ApproveWithdrawalOptions, bH as ArchivePolicy, bI as ArchiveResult, bJ as ArchiveRunOptions, bK as ArchiveStrategy, aE as ArrayOutputSpec, o as BLOB_CHUNKS_COLLECTION, p as BLOB_COLLECTION, r as BLOB_INDEX_COLLECTION, t as BLOB_SLOTS_PREFIX, u as BLOB_VERSIONS_PREFIX, bL as BUNDLE_STORE_POLICY, z as BlobObject, A as BlobPutOptions, C as BlobResponseOptions, E as BlobSet, bM as BuiltInGateName, be as BundleRecipient, a4 as CONSENT_AUDIT_COLLECTION, bN as CacheOptions, bO as CacheStats, bP as ChangeEvent, a$ as ChangeType, ad as ClosePeriodOptions, aN as Collection, bQ as CollectionChangeEvent, bR as CollectionConflictResolver, bS as CollectionDescriptor, au as CollectionFrame, b0 as CollectionInstant, bT as CollectionStats, bU as ComputedFieldError, bV as ComputedFields, bW as ComputedFn, bX as Conflict, bY as ConflictPolicy, bZ as ConflictStrategy, a5 as ConsentAuditEntry, a6 as ConsentAuditFilter, a7 as ConsentContext, a8 as ConsentOp, b_ as CrossTierAccessEvent, b$ as CustodyApi, K as DEFAULT_CHUNK_SIZE, c0 as DEFAULT_PUBLIC_ENVELOPE_SCHEMA, c1 as DELEGATIONS_COLLECTION, D as DICT_COLLECTION_PREFIX, c2 as DeepPartial, c3 as DeepPartialOrNull, c4 as DeferredNumberingConfig, c5 as DelegationToken, c6 as DeleteManyResult, c7 as DerivationDescriptor, aC as DerivationStrategy, aG as DerivationStrategyHandle, aH as DerivedFromMeta, a as DictEntry, b as DictKeyDescriptor, c as DictionaryHandle, d as DictionaryOptions, c8 as DirtyEntry, c9 as DryRunResult, ca as DumpSchemaOptions, cb as ELEVATION_AUDIT_COLLECTION, cc as ElevatedHandle, cd as EnrollAuthenticatorOptions, ce as EnrollAuthenticatorWrappingDEKsOptions, cf as EnrollAuthenticatorWrappingKEKOptions, cg as EnrollRecoveryResult, ch as ExportAccessibleOptions, ci as ExportCapability, cj as ExportChunk, ck as ExportFormat, cl as ExportStreamOptions, cm as FactorKind, cn as FactorProofBundle, co as FactorRequirement, cp as FenceDoc, cq as FenceState, cr as FieldChange, cs as FieldDescriptor, ct as FieldSource, cu as FormattedSequenceHandle, cv as FrozenSnapshotRef, cw as GhostRecord, cx as GrantCustodianOptions, cy as GrantOptions, ao as GuardChange, ap as GuardContext, an as GuardStrategy, ar as GuardStrategyHandle, cz as GuardViolation, cA as HistoryConfig, cB as HistoryEntry, aX as HistoryOptions, cC as INDEXED_STORE_POLICY, cD as ImportCapability, cE as InferOutput, cF as InternalCollectionStats, cG as IssueDelegationOptions, cH as IssueMagicLinkGrantOptions, b2 as JsonPatch, b3 as JsonPatchOp, cI as KeyringAuthenticator, cJ as KeyringAuthenticatorWrappingDEKs, cK as KeyringAuthenticatorWrappingKEK, cL as KeyringFile, b4 as LedgerStore, cM as LiberateOptions, cN as LiberateResult, cO as LinkEndpointError, cP as LinkIntegrityError, cQ as LinkOnDelete, cR as LinkRow, cS as LinkSetHandle, cT as LinkSpec, cU as ListAccessibleVaultsOptions, cV as ListPageResult, cW as ListUsersOptions, cX as LiveUserEnvelope, cY as LocaleReadOptions, cZ as Lru, c_ as LruOptions, c$ as LruStats, d0 as MAGIC_LINK_CONTENT_INFO_PREFIX, d1 as MAGIC_LINK_GRANTS_COLLECTION, d2 as MAGIC_LINK_KEK_INFO_PREFIX, d3 as MagicLinkGrantPayload, d4 as MagicLinkGrantRecord, bo as MaterializedFromMeta, d5 as MaterializedViewDescriptor, bp as MaterializedViewOutput, aK as MaterializedViewStrategy, aL as MaterializedViewStrategyHandle, d6 as MemoryRecipientSealer, d7 as MemorySealingKeyProvider, d8 as NOYDB_BACKUP_VERSION, d9 as NOYDB_FORMAT_VERSION, da as NOYDB_KEYRING_VERSION, db as NOYDB_SYNC_VERSION, dc as NextOptions, dd as Noydb, aw as NoydbBundleStore, de as NoydbEventMap, df as NoydbOptions, dg as NumberingAssignment, T as ObjectListEntry, U as ObjectMeta, V as ObjectProjection, W as ObjectUrlOptions, ae as OpenPeriodOptions, aI as OutputSpec, aO as OverlayFieldMergeMode, aP as OverlayFieldMergeRule, dh as OverlayViewDescriptor, aM as OverlayedViewStrategy, aR as OverlayedViewStrategyHandle, af as PERIODS_COLLECTION, di as PUBLIC_ENVELOPE_FIELDS, dj as PaperRecoveryDoc, dk as PaperRecoveryEntry, dl as PassphrasePolicy, dm as PassphraseValidationResult, ag as PeriodRecord, dn as Permission, dp as Permissions, dq as PersistedSchemaKind, dr as PlaintextTranslatorContext, ds as PlaintextTranslatorFn, P as PolicyEnforcer, dt as PresenceHandle, du as PresencePeer, aZ as PruneOptions, dv as PublicEnvelopeField, dw as PublicEnvelopeSchema, dx as PublicEnvelopeText, dy as PullMode, dz as PullOptions, dA as PullPolicy, dB as PullResult, dC as PushMode, dD as PushOptions, dE as PushPolicy, dF as PushResult, dG as PutManyItemOptions, dH as PutManyOptions, dI as PutManyResult, X as PutObjectOptions, Y as PutUrlOptions, dJ as QueryAcrossOptions, dK as QueryAcrossResult, dL as QuickUnlockState, dM as QuickUnlockStore, dN as ReAuthOperation, bg as RecipientHint, bf as RecipientSealer, aJ as RecordOutputSpec, dO as RecoverPassphraseInput, dP as RecoverPassphraseResult, dQ as RecoverUserOptions, dR as RecoveryProof, dS as RejectWithdrawalOptions, dT as RequestWithdrawalOptions, dU as RequestWithdrawalResult, dV as ResolvedPublicEnvelopeSchema, ax as RetentionPolicy, dW as RevokeOptions, aT as Role, dX as RotatePassphraseInput, dY as RotateRecoveryOptions, dZ as RotateRecoveryResult, d_ as SEALED_PASSPHRASE_RECORD_ID, d$ as SchemaDelta, e0 as SchemaIntrospection, S as ScriptWarning, e1 as SealedEnvelope, e2 as SealedPassphrase, e3 as SearchEntry, e4 as SearchOptions, e5 as SearchResult, e6 as SequenceHandle, e7 as SequenceOptions, e8 as SequenceStore, e9 as SessionPolicy, ea as SetPublicEnvelopeInput, eb as ShamirRecoveryDoc, ec as ShamirRecoveryEntry, bj as ShamirRecoveryProvider, Z as SlotInfo, _ as SlotRecord, ed as SlotRewrapCeremony, ee as SlotRewrapContext, aA as SnapshotMeta, ef as StandardSchemaV1, eg as StandardSchemaV1Issue, eh as StandardSchemaV1SyncResult, e as StaticDictDescriptor, ei as StoreAuth, ej as StoreAuthKind, ek as StoreCapabilities, el as StoreTime, em as SyncEngine, en as SyncMetadata, eo as SyncPolicy, ep as SyncScheduler, eq as SyncSchedulerStatus, er as SyncStatus, es as SyncTarget, et as SyncTargetRole, eu as SyncTransaction, ev as SyncTransactionResult, ew as TabChannel, ex as TabCoordinationOptions, ey as TabLockManager, ez as TabPresence, eA as TabRole, eB as TierMode, eC as TransactionInvariant, eD as TranslatorAuditEntry, eE as TxCollection, bk as TxContext, eF as TxOp, eG as TxVault, eH as USER_ENVELOPE_COLLECTION, eI as USER_ENVELOPE_MAX_BYTES, bq as UnionArmJoin, br as UnionSource, eJ as Unsubscribe, eK as UpdateAuthenticatorOptions, eL as UpdateContext, eM as UpdateUserOptions, eN as UserApi, eO as UserEnvelopeCheckGate, eP as UserEnvelopeOversizedError, eQ as UserEnvelopePresented, eR as UserInfo, eS as VaultBackup, b5 as VaultEngine, av as VaultFrame, b6 as VaultInstant, eT as VaultPolicyOnDisk, eU as VaultSchemaSnapshot, eV as VaultSnapshot, b7 as VerifyResult, $ as VersionRecord, eW as WarningRules, eX as WeakPassphraseError, eY as WeakPassphraseReason, eZ as WithArchiveOptions, e_ as WithdrawAccessibleOptions, e$ as WithdrawResult, f0 as WithdrawalRequest, f1 as WithdrawalRequestError, f2 as WithdrawalRequestStatus, f3 as WrappedDeksBlob, f4 as WriteConflict, f5 as WriteEvent, f6 as WriteHook, f7 as WriteQueue, f8 as aesGcmOpen, b8 as applyPatch, f9 as approveWithdrawal, fa as assertStrongPassphrase, fb as buildRecipientKeyringFile, fc as burnPaperRecoveryEntry, fd as compileSequenceFormat, b9 as computePatch, n as createEnforcer, fe as createNoydb, ff as createStore, fg as deriveMagicLinkContentKey, f as dictCollectionName, g as dictKey, ba as diff, h as enforceScript, fh as enrollAuthenticator, fi as estimateEntropy, fj as evalComputedFields, fk as evaluateExportCapability, fl as evaluateImportCapability, fm as exportAccessibleData, fn as findAuthenticator, bb as formatDiff, fo as hasExportCapability, fp as hasImportCapability, fq as hasRecoveryEnrolled, i as inferScripts, j as isDictCollectionName, k as isDictKeyDescriptor, fr as isLinkCollectionName, fs as isMagicLinkGrantExpired, ft as isPublicEnvelope, l as isStaticDictDescriptor, fu as issueDelegation, fv as keyringRecoverPassphrase, fw as keyringRotatePassphrase, fx as liberateVault, fy as listMagicLinkGrants, fz as listUsers, fA as listUsersWithEnvelopes, fB as listWithdrawalRequests, fC as loadActiveDelegations, fD as loadPaperRecoveryEntries, fE as loadSealedPassphrase, fF as loadShamirRecoveryEntries, fG as magicLinkGrantRecordId, a1 as memoryObjectProjection, fH as mintPaperRecoveryEntry, fI as mintShamirRecoveryEntry, fJ as mintWrappedDeksBlob, fK as parseRsaOaepTlv, fL as parseSealedEnvelope, fM as readMagicLinkGrantRecord, fN as recoverUser, fO as rejectWithdrawal, fP as removeAuthenticator, fQ as requestWithdrawal, fR as resolvePublicEnvelopeSchema, fS as resolveSequenceKey, fT as revokeDelegation, fU as revokeMagicLinkGrant, fV as runTransaction, fW as savePaperRecoveryEntries, fX as saveSealedPassphrase, fY as saveShamirRecoveryEntries, fZ as sealRsaOaepTlv, s as staticDict, f_ as unwrapDeksFromBlob, f$ as unwrapDeksFromPaperEntry, g0 as unwrapDeksFromShamirEntry, g1 as unwrapMagicLinkGrant, g2 as validatePassphrase, g3 as validatePublicEnvelopeInput, g4 as validateSchemaInput, g5 as validateSchemaOutput, v as validateSessionPolicy, g6 as withArchive, g7 as withDeferredNumbering, g8 as withdrawAccessibleData, g9 as writeMagicLinkGrant } from './types-CwrTuYFI.cjs';
3
+ export { I as ImportExternalOptions, a as ImportExternalResult, b as ImportableCollection, d as detectMagic, c as detectMimeType, i as importExternalObjects, e as isPreCompressed } from './mime-magic-Co4Pyj-O.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
5
  import { N as NoydbError } from './errors-Dwk2k1xY.cjs';
6
6
  export { H as AlreadyElevatedError, A as AmendmentForbiddenError, s as AttestationError, B as BackupCorruptedError, u as BackupLedgerError, v as BundleIntegrityError, w as BundleSealMismatchError, x as BundleVersionConflictError, J as ConflictError, K as CrossJoinSourceUnknownError, Q as CrossJoinTooLargeError, V as DanglingReferenceError, W as DataResidencyError, X as DebugPlaintextError, Y as DebugReservedFieldError, Z as DecryptionError, _ as DelegationTargetMissingError, i as DerivationCapExceededError, j as DerivationCycleError, k as DerivationDepthError, l as DerivationOutputShapeError, m as DerivationOutputUnknownError, D as DictKeyInUseError, a as DictKeyMissingError, $ as DirectoryDisabledError, a0 as ElevationExpiredError, a1 as ExportCapabilityError, F as FieldFrozenError, a2 as FilenameSanitizationError, a3 as ForgetStrategyNotConfiguredError, a4 as GroupCardinalityError, I as IllegalTransitionError, a5 as ImportCapabilityError, a6 as IndexRequiredError, a7 as IndexWriteFailureError, a8 as InvalidKeyError, f as InvariantError, a9 as JoinTooLargeError, aa as KeyringCorruptError, ab as KeyringExpiredError, ac as LedgerContentionError, L as LocaleNotSpecifiedError, z as MaterializedViewConfigError, C as MaterializedViewCycleError, E as MaterializedViewSourceUnknownError, G as MaterializedViewTooLargeError, ad as MigrationRequiredError, M as MissingTranslationError, ae as NetworkError, af as NoAccessError, ag as NonAdditiveSchemaChangeError, ah as NotFoundError, ai as NumberingUncertaintyError, O as OverlayBaseIsVirtualError, n as OverlayCollectionUnavailableError, o as OverlayIdMismatchError, p as OverlayNameCollisionError, aj as PathEscapeError, ak as PeriodClosedError, al as PermissionDeniedError, am as PrivilegeEscalationError, an as QuiesceTimeoutError, ao as ReadOnlyAtInstantError, ap as ReadOnlyError, aq as ReadOnlyFrameError, ar as RecordCekNotFoundError, g as RecordLockedError, R as ReservedCollectionNameError, as as ReservedVaultNameError, at as SchemaFenceError, au as SchemaLockedError, av as SchemaUpdateError, aw as SchemaValidationError, S as ScriptViolationError, q as SealedRecordExpiredError, r as SealedRecordMismatchError, ax as SequenceContentionError, ay as SequenceOfflineError, c as SessionExpiredError, d as SessionNotFoundError, e as SessionPolicyError, az as ShardProvisioningError, h as SnapshotNotFoundError, b as StaticDictReadonlyError, aA as StoreCapabilityError, aB as TamperedError, aC as TierDemoteDeniedError, aD as TierNotGrantedError, T as TranslatorNotConfiguredError, aE as UniqueConstraintError, U as UnknownDictCodeError, aF as UnknownShardError, aG as UnsupportedIndexOptionError, aH as ValidationError, aI as VaultTemplateNotFoundError } from './errors-Dwk2k1xY.cjs';
7
- export { A as AutoCredential, m as AutoCredentialKind, c as CompressionAlgo, D as DecryptedRecord, 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, i as decryptExtractedPartition, n as hasNoydbBundleMagic, r as readNoydbBundle, k as readNoydbBundleHeader, o as readNoydbBundlePublicEnvelope, l as resetBrotliSupportCache, w as writeNoydbBundle } from './decrypt-partition-C71vhnND.cjs';
7
+ export { A as AutoCredential, m as AutoCredentialKind, c as CompressionAlgo, D as DecryptedRecord, 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, i as decryptExtractedPartition, n as hasNoydbBundleMagic, r as readNoydbBundle, k as readNoydbBundleHeader, o as readNoydbBundlePublicEnvelope, l as resetBrotliSupportCache, w as writeNoydbBundle } from './decrypt-partition-DmkeOB4I.cjs';
8
8
  export { g as generateULID, i as isULID } from './ulid-DRH25k3y.cjs';
9
9
  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, q as isRefArray, r as ref, s as refArray, t as resetJoinWarnings } from './index-DoxKSsMj.cjs';
10
10
  export { L as LedgerEntry, c as canonicalJson, h as hashEntry, p as paddedIndex, a as parseIndex, s as sha256Hex } from './index-BMmajblo.cjs';
11
11
  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';
12
- export { b as base64ToBuffer, a as bufferToBase64, d as decryptBytes, c as decryptDeterministic, e as derivePresenceKey, f as encryptBytes, g as encryptDeterministic } from './index-CBUhOmrM.cjs';
12
+ export { b as base64ToBuffer, a as bufferToBase64, d as decryptBytes, c as decryptDeterministic, e as derivePresenceKey, f as encryptBytes, g as encryptDeterministic } from './index-CqzZml-D.cjs';
13
13
  export { TransactionStrategyOptions } from './tx/index.cjs';
14
- export { I as ImmutableGuardConfig, T as TransitionGuardConfig, i as immutableGuard, t as transitionGuard, w as withGuard } from './transition-guard-DPs6al8h.cjs';
14
+ export { I as ImmutableGuardConfig, T as TransitionGuardConfig, i as immutableGuard, t as transitionGuard, w as withGuard } from './transition-guard-Dzj68JWC.cjs';
15
15
  import { K as RoundingMode } from './strategy-D1zjEV3n.cjs';
16
16
  export { h as AggregateResult, j as AggregateSpec, k as Aggregation, l as AggregationUpstream, G as GROUPBY_MAX_CARDINALITY, m as GROUPBY_WARN_CARDINALITY, n as GroupedAggregation, o as GroupedQuery, p as GroupedQueryN, q as GroupedRow, t as GroupedRowN, I as I18nMap, a as I18nTextDescriptor, b as I18nTextOptions, L as Layer, u as LiveAggregation, M as MoneyCurrencyError, N as MoneyDescriptor, P as MoneyOptions, Q as MoneyOptionsFixed, S as MoneyOptionsMulti, T as MoneyPrecisionError, U as MoneyUnsupportedError, O as OnMissing, c as OnMissingPolicy, w as Reducer, x as ReducerOptions, R as ResolveI18nOptions, d as applyI18nLocale, y as avg, B as count, C as groupAndReduce, i as i18nText, e as isI18nTextDescriptor, V as isMoneyDescriptor, D as max, E as min, W as money, F as reduceRecords, r as resolveI18nText, f as resolvePolicy, J as sum, v as validateI18nTextValue } from './strategy-D1zjEV3n.cjs';
17
- export { w as withDerivation, a as withRollup } from './with-rollup-BBWdrCvu.cjs';
18
- export { w as withMaterializedView } from './with-materialized-view-CTHe6uh9.cjs';
17
+ export { w as withDerivation, a as withRollup } from './with-rollup-B_zbRi3f.cjs';
18
+ export { w as withMaterializedView } from './with-materialized-view-dPG213gd.cjs';
19
19
  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';
20
- export { w as withOverlayedView } from './with-overlayed-view-Dlz5hcM8.cjs';
20
+ export { w as withOverlayedView } from './with-overlayed-view-CJ2UDBol.cjs';
21
21
  export { SYNC_CREDENTIALS_COLLECTION, SyncCredential, credentialStatus, deleteCredential, getCredential, listCredentials, putCredential } from './team/index.cjs';
22
- 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-BdrE0kbS.cjs';
22
+ 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-DUTLA3Sc.cjs';
23
23
  export { i as isDiscriminant } from './discriminant-BN9REW3o.cjs';
24
- export { L as LEDGER_COLLECTION, a as LEDGER_DELTAS_COLLECTION, e as envelopePayloadHash } from './hash-BUkDp_8Q.cjs';
24
+ export { L as LEDGER_COLLECTION, a as LEDGER_DELTAS_COLLECTION, e as envelopePayloadHash } from './hash-DFK7cGdo.cjs';
25
25
  import './lazy-builder-eYZzLEL1.cjs';
26
26
  import '@noy-db/attestation';
27
27
 
package/dist/index.d.ts CHANGED
@@ -1,27 +1,27 @@
1
- import { aW as NoydbStore, bs as UserEnvelope, bc as PublicEnvelope, bt as GateName, bu as GatePolicy, bv as VaultPolicy, bw as ActiveTier, bx as FactorProof, aY as EncryptedEnvelope, by as SchemaUpdateStrategy, bz as TransformFn, bA as PersistedSchemaEnvelope, bB as UpdateDecision, bd as SealingKeyProvider, aU as UnlockedKeyring, bC as DirectoryConfig, bD as UserVisibility, bh as Vault, b1 as DiffEntry } from './types-CCq0WHh9.js';
2
- export { bE as AccessibleVault, bF as AffectedDocument, a_ as AppendInput, bG as ApproveWithdrawalOptions, bH as ArchivePolicy, bI as ArchiveResult, bJ as ArchiveRunOptions, bK as ArchiveStrategy, aE as ArrayOutputSpec, o as BLOB_CHUNKS_COLLECTION, p as BLOB_COLLECTION, r as BLOB_INDEX_COLLECTION, t as BLOB_SLOTS_PREFIX, u as BLOB_VERSIONS_PREFIX, bL as BUNDLE_STORE_POLICY, z as BlobObject, A as BlobPutOptions, C as BlobResponseOptions, E as BlobSet, bM as BuiltInGateName, be as BundleRecipient, a4 as CONSENT_AUDIT_COLLECTION, bN as CacheOptions, bO as CacheStats, bP as ChangeEvent, a$ as ChangeType, ad as ClosePeriodOptions, aN as Collection, bQ as CollectionChangeEvent, bR as CollectionConflictResolver, bS as CollectionDescriptor, au as CollectionFrame, b0 as CollectionInstant, bT as CollectionStats, bU as ComputedFieldError, bV as ComputedFields, bW as ComputedFn, bX as Conflict, bY as ConflictPolicy, bZ as ConflictStrategy, a5 as ConsentAuditEntry, a6 as ConsentAuditFilter, a7 as ConsentContext, a8 as ConsentOp, b_ as CrossTierAccessEvent, b$ as CustodyApi, K as DEFAULT_CHUNK_SIZE, c0 as DEFAULT_PUBLIC_ENVELOPE_SCHEMA, c1 as DELEGATIONS_COLLECTION, D as DICT_COLLECTION_PREFIX, c2 as DeepPartial, c3 as DeepPartialOrNull, c4 as DeferredNumberingConfig, c5 as DelegationToken, c6 as DeleteManyResult, c7 as DerivationDescriptor, aC as DerivationStrategy, aG as DerivationStrategyHandle, aH as DerivedFromMeta, a as DictEntry, b as DictKeyDescriptor, c as DictionaryHandle, d as DictionaryOptions, c8 as DirtyEntry, c9 as DryRunResult, ca as DumpSchemaOptions, cb as ELEVATION_AUDIT_COLLECTION, cc as ElevatedHandle, cd as EnrollAuthenticatorOptions, ce as EnrollAuthenticatorWrappingDEKsOptions, cf as EnrollAuthenticatorWrappingKEKOptions, cg as EnrollRecoveryResult, ch as ExportAccessibleOptions, ci as ExportCapability, cj as ExportChunk, ck as ExportFormat, cl as ExportStreamOptions, cm as FactorKind, cn as FactorProofBundle, co as FactorRequirement, cp as FenceDoc, cq as FenceState, cr as FieldChange, cs as FieldDescriptor, ct as FieldSource, cu as FormattedSequenceHandle, cv as FrozenSnapshotRef, cw as GhostRecord, cx as GrantCustodianOptions, cy as GrantOptions, ao as GuardChange, ap as GuardContext, an as GuardStrategy, ar as GuardStrategyHandle, cz as GuardViolation, cA as HistoryConfig, cB as HistoryEntry, aX as HistoryOptions, cC as INDEXED_STORE_POLICY, cD as ImportCapability, cE as InferOutput, cF as InternalCollectionStats, cG as IssueDelegationOptions, cH as IssueMagicLinkGrantOptions, b2 as JsonPatch, b3 as JsonPatchOp, cI as KeyringAuthenticator, cJ as KeyringAuthenticatorWrappingDEKs, cK as KeyringAuthenticatorWrappingKEK, cL as KeyringFile, b4 as LedgerStore, cM as LiberateOptions, cN as LiberateResult, cO as LinkEndpointError, cP as LinkIntegrityError, cQ as LinkOnDelete, cR as LinkRow, cS as LinkSetHandle, cT as LinkSpec, cU as ListAccessibleVaultsOptions, cV as ListPageResult, cW as ListUsersOptions, cX as LiveUserEnvelope, cY as LocaleReadOptions, cZ as Lru, c_ as LruOptions, c$ as LruStats, d0 as MAGIC_LINK_CONTENT_INFO_PREFIX, d1 as MAGIC_LINK_GRANTS_COLLECTION, d2 as MAGIC_LINK_KEK_INFO_PREFIX, d3 as MagicLinkGrantPayload, d4 as MagicLinkGrantRecord, bo as MaterializedFromMeta, d5 as MaterializedViewDescriptor, bp as MaterializedViewOutput, aK as MaterializedViewStrategy, aL as MaterializedViewStrategyHandle, d6 as MemoryRecipientSealer, d7 as MemorySealingKeyProvider, d8 as NOYDB_BACKUP_VERSION, d9 as NOYDB_FORMAT_VERSION, da as NOYDB_KEYRING_VERSION, db as NOYDB_SYNC_VERSION, dc as NextOptions, dd as Noydb, aw as NoydbBundleStore, de as NoydbEventMap, df as NoydbOptions, dg as NumberingAssignment, T as ObjectListEntry, U as ObjectMeta, V as ObjectProjection, W as ObjectUrlOptions, ae as OpenPeriodOptions, aI as OutputSpec, aO as OverlayFieldMergeMode, aP as OverlayFieldMergeRule, dh as OverlayViewDescriptor, aM as OverlayedViewStrategy, aR as OverlayedViewStrategyHandle, af as PERIODS_COLLECTION, di as PUBLIC_ENVELOPE_FIELDS, dj as PaperRecoveryDoc, dk as PaperRecoveryEntry, dl as PassphrasePolicy, dm as PassphraseValidationResult, ag as PeriodRecord, dn as Permission, dp as Permissions, dq as PersistedSchemaKind, dr as PlaintextTranslatorContext, ds as PlaintextTranslatorFn, P as PolicyEnforcer, dt as PresenceHandle, du as PresencePeer, aZ as PruneOptions, dv as PublicEnvelopeField, dw as PublicEnvelopeSchema, dx as PublicEnvelopeText, dy as PullMode, dz as PullOptions, dA as PullPolicy, dB as PullResult, dC as PushMode, dD as PushOptions, dE as PushPolicy, dF as PushResult, dG as PutManyItemOptions, dH as PutManyOptions, dI as PutManyResult, X as PutObjectOptions, Y as PutUrlOptions, dJ as QueryAcrossOptions, dK as QueryAcrossResult, dL as QuickUnlockState, dM as QuickUnlockStore, dN as ReAuthOperation, bg as RecipientHint, bf as RecipientSealer, aJ as RecordOutputSpec, dO as RecoverPassphraseInput, dP as RecoverPassphraseResult, dQ as RecoverUserOptions, dR as RecoveryProof, dS as RejectWithdrawalOptions, dT as RequestWithdrawalOptions, dU as RequestWithdrawalResult, dV as ResolvedPublicEnvelopeSchema, ax as RetentionPolicy, dW as RevokeOptions, aT as Role, dX as RotatePassphraseInput, dY as RotateRecoveryOptions, dZ as RotateRecoveryResult, d_ as SEALED_PASSPHRASE_RECORD_ID, d$ as SchemaDelta, e0 as SchemaIntrospection, S as ScriptWarning, e1 as SealedEnvelope, e2 as SealedPassphrase, e3 as SearchEntry, e4 as SearchOptions, e5 as SearchResult, e6 as SequenceHandle, e7 as SequenceOptions, e8 as SequenceStore, e9 as SessionPolicy, ea as SetPublicEnvelopeInput, eb as ShamirRecoveryDoc, ec as ShamirRecoveryEntry, bj as ShamirRecoveryProvider, Z as SlotInfo, _ as SlotRecord, ed as SlotRewrapCeremony, ee as SlotRewrapContext, aA as SnapshotMeta, ef as StandardSchemaV1, eg as StandardSchemaV1Issue, eh as StandardSchemaV1SyncResult, e as StaticDictDescriptor, ei as StoreAuth, ej as StoreAuthKind, ek as StoreCapabilities, el as StoreTime, em as SyncEngine, en as SyncMetadata, eo as SyncPolicy, ep as SyncScheduler, eq as SyncSchedulerStatus, er as SyncStatus, es as SyncTarget, et as SyncTargetRole, eu as SyncTransaction, ev as SyncTransactionResult, ew as TabChannel, ex as TabCoordinationOptions, ey as TabLockManager, ez as TabPresence, eA as TabRole, eB as TierMode, eC as TransactionInvariant, eD as TranslatorAuditEntry, eE as TxCollection, bk as TxContext, eF as TxOp, eG as TxVault, eH as USER_ENVELOPE_COLLECTION, eI as USER_ENVELOPE_MAX_BYTES, bq as UnionArmJoin, br as UnionSource, eJ as Unsubscribe, eK as UpdateAuthenticatorOptions, eL as UpdateContext, eM as UpdateUserOptions, eN as UserApi, eO as UserEnvelopeCheckGate, eP as UserEnvelopeOversizedError, eQ as UserEnvelopePresented, eR as UserInfo, eS as VaultBackup, b5 as VaultEngine, av as VaultFrame, b6 as VaultInstant, eT as VaultPolicyOnDisk, eU as VaultSchemaSnapshot, eV as VaultSnapshot, b7 as VerifyResult, $ as VersionRecord, eW as WarningRules, eX as WeakPassphraseError, eY as WeakPassphraseReason, eZ as WithArchiveOptions, e_ as WithdrawAccessibleOptions, e$ as WithdrawResult, f0 as WithdrawalRequest, f1 as WithdrawalRequestError, f2 as WithdrawalRequestStatus, f3 as WrappedDeksBlob, f4 as WriteConflict, f5 as WriteEvent, f6 as WriteHook, f7 as WriteQueue, f8 as aesGcmOpen, b8 as applyPatch, f9 as approveWithdrawal, fa as assertStrongPassphrase, fb as buildRecipientKeyringFile, fc as burnPaperRecoveryEntry, fd as compileSequenceFormat, b9 as computePatch, n as createEnforcer, fe as createNoydb, ff as createStore, fg as deriveMagicLinkContentKey, f as dictCollectionName, g as dictKey, ba as diff, h as enforceScript, fh as enrollAuthenticator, fi as estimateEntropy, fj as evalComputedFields, fk as evaluateExportCapability, fl as evaluateImportCapability, fm as exportAccessibleData, fn as findAuthenticator, bb as formatDiff, fo as hasExportCapability, fp as hasImportCapability, fq as hasRecoveryEnrolled, i as inferScripts, j as isDictCollectionName, k as isDictKeyDescriptor, fr as isLinkCollectionName, fs as isMagicLinkGrantExpired, ft as isPublicEnvelope, l as isStaticDictDescriptor, fu as issueDelegation, fv as keyringRecoverPassphrase, fw as keyringRotatePassphrase, fx as liberateVault, fy as listMagicLinkGrants, fz as listUsers, fA as listUsersWithEnvelopes, fB as listWithdrawalRequests, fC as loadActiveDelegations, fD as loadPaperRecoveryEntries, fE as loadSealedPassphrase, fF as loadShamirRecoveryEntries, fG as magicLinkGrantRecordId, a1 as memoryObjectProjection, fH as mintPaperRecoveryEntry, fI as mintShamirRecoveryEntry, fJ as mintWrappedDeksBlob, fK as parseRsaOaepTlv, fL as parseSealedEnvelope, fM as readMagicLinkGrantRecord, fN as recoverUser, fO as rejectWithdrawal, fP as removeAuthenticator, fQ as requestWithdrawal, fR as resolvePublicEnvelopeSchema, fS as resolveSequenceKey, fT as revokeDelegation, fU as revokeMagicLinkGrant, fV as runTransaction, fW as savePaperRecoveryEntries, fX as saveSealedPassphrase, fY as saveShamirRecoveryEntries, fZ as sealRsaOaepTlv, s as staticDict, f_ as unwrapDeksFromBlob, f$ as unwrapDeksFromPaperEntry, g0 as unwrapDeksFromShamirEntry, g1 as unwrapMagicLinkGrant, g2 as validatePassphrase, g3 as validatePublicEnvelopeInput, g4 as validateSchemaInput, g5 as validateSchemaOutput, v as validateSessionPolicy, g6 as withArchive, g7 as withDeferredNumbering, g8 as withdrawAccessibleData, g9 as writeMagicLinkGrant } from './types-CCq0WHh9.js';
3
- export { I as ImportExternalOptions, a as ImportExternalResult, b as ImportableCollection, d as detectMagic, c as detectMimeType, i as importExternalObjects, e as isPreCompressed } from './mime-magic-C1UbcBxP.js';
1
+ import { aW as NoydbStore, bs as UserEnvelope, bc as PublicEnvelope, bt as GateName, bu as GatePolicy, bv as VaultPolicy, bw as ActiveTier, bx as FactorProof, aY as EncryptedEnvelope, by as SchemaUpdateStrategy, bz as TransformFn, bA as PersistedSchemaEnvelope, bB as UpdateDecision, bd as SealingKeyProvider, aU as UnlockedKeyring, bC as DirectoryConfig, bD as UserVisibility, bh as Vault, b1 as DiffEntry } from './types-CkSWJt0H.js';
2
+ export { bE as AccessibleVault, bF as AffectedDocument, a_ as AppendInput, bG as ApproveWithdrawalOptions, bH as ArchivePolicy, bI as ArchiveResult, bJ as ArchiveRunOptions, bK as ArchiveStrategy, aE as ArrayOutputSpec, o as BLOB_CHUNKS_COLLECTION, p as BLOB_COLLECTION, r as BLOB_INDEX_COLLECTION, t as BLOB_SLOTS_PREFIX, u as BLOB_VERSIONS_PREFIX, bL as BUNDLE_STORE_POLICY, z as BlobObject, A as BlobPutOptions, C as BlobResponseOptions, E as BlobSet, bM as BuiltInGateName, be as BundleRecipient, a4 as CONSENT_AUDIT_COLLECTION, bN as CacheOptions, bO as CacheStats, bP as ChangeEvent, a$ as ChangeType, ad as ClosePeriodOptions, aN as Collection, bQ as CollectionChangeEvent, bR as CollectionConflictResolver, bS as CollectionDescriptor, au as CollectionFrame, b0 as CollectionInstant, bT as CollectionStats, bU as ComputedFieldError, bV as ComputedFields, bW as ComputedFn, bX as Conflict, bY as ConflictPolicy, bZ as ConflictStrategy, a5 as ConsentAuditEntry, a6 as ConsentAuditFilter, a7 as ConsentContext, a8 as ConsentOp, b_ as CrossTierAccessEvent, b$ as CustodyApi, K as DEFAULT_CHUNK_SIZE, c0 as DEFAULT_PUBLIC_ENVELOPE_SCHEMA, c1 as DELEGATIONS_COLLECTION, D as DICT_COLLECTION_PREFIX, c2 as DeepPartial, c3 as DeepPartialOrNull, c4 as DeferredNumberingConfig, c5 as DelegationToken, c6 as DeleteManyResult, c7 as DerivationDescriptor, aC as DerivationStrategy, aG as DerivationStrategyHandle, aH as DerivedFromMeta, a as DictEntry, b as DictKeyDescriptor, c as DictionaryHandle, d as DictionaryOptions, c8 as DirtyEntry, c9 as DryRunResult, ca as DumpSchemaOptions, cb as ELEVATION_AUDIT_COLLECTION, cc as ElevatedHandle, cd as EnrollAuthenticatorOptions, ce as EnrollAuthenticatorWrappingDEKsOptions, cf as EnrollAuthenticatorWrappingKEKOptions, cg as EnrollRecoveryResult, ch as ExportAccessibleOptions, ci as ExportCapability, cj as ExportChunk, ck as ExportFormat, cl as ExportStreamOptions, cm as FactorKind, cn as FactorProofBundle, co as FactorRequirement, cp as FenceDoc, cq as FenceState, cr as FieldChange, cs as FieldDescriptor, ct as FieldSource, cu as FormattedSequenceHandle, cv as FrozenSnapshotRef, cw as GhostRecord, cx as GrantCustodianOptions, cy as GrantOptions, ao as GuardChange, ap as GuardContext, an as GuardStrategy, ar as GuardStrategyHandle, cz as GuardViolation, cA as HistoryConfig, cB as HistoryEntry, aX as HistoryOptions, cC as INDEXED_STORE_POLICY, cD as ImportCapability, cE as InferOutput, cF as InternalCollectionStats, cG as IssueDelegationOptions, cH as IssueMagicLinkGrantOptions, b2 as JsonPatch, b3 as JsonPatchOp, cI as KeyringAuthenticator, cJ as KeyringAuthenticatorWrappingDEKs, cK as KeyringAuthenticatorWrappingKEK, cL as KeyringFile, b4 as LedgerStore, cM as LiberateOptions, cN as LiberateResult, cO as LinkEndpointError, cP as LinkIntegrityError, cQ as LinkOnDelete, cR as LinkRow, cS as LinkSetHandle, cT as LinkSpec, cU as ListAccessibleVaultsOptions, cV as ListPageResult, cW as ListUsersOptions, cX as LiveUserEnvelope, cY as LocaleReadOptions, cZ as Lru, c_ as LruOptions, c$ as LruStats, d0 as MAGIC_LINK_CONTENT_INFO_PREFIX, d1 as MAGIC_LINK_GRANTS_COLLECTION, d2 as MAGIC_LINK_KEK_INFO_PREFIX, d3 as MagicLinkGrantPayload, d4 as MagicLinkGrantRecord, bo as MaterializedFromMeta, d5 as MaterializedViewDescriptor, bp as MaterializedViewOutput, aK as MaterializedViewStrategy, aL as MaterializedViewStrategyHandle, d6 as MemoryRecipientSealer, d7 as MemorySealingKeyProvider, d8 as NOYDB_BACKUP_VERSION, d9 as NOYDB_FORMAT_VERSION, da as NOYDB_KEYRING_VERSION, db as NOYDB_SYNC_VERSION, dc as NextOptions, dd as Noydb, aw as NoydbBundleStore, de as NoydbEventMap, df as NoydbOptions, dg as NumberingAssignment, T as ObjectListEntry, U as ObjectMeta, V as ObjectProjection, W as ObjectUrlOptions, ae as OpenPeriodOptions, aI as OutputSpec, aO as OverlayFieldMergeMode, aP as OverlayFieldMergeRule, dh as OverlayViewDescriptor, aM as OverlayedViewStrategy, aR as OverlayedViewStrategyHandle, af as PERIODS_COLLECTION, di as PUBLIC_ENVELOPE_FIELDS, dj as PaperRecoveryDoc, dk as PaperRecoveryEntry, dl as PassphrasePolicy, dm as PassphraseValidationResult, ag as PeriodRecord, dn as Permission, dp as Permissions, dq as PersistedSchemaKind, dr as PlaintextTranslatorContext, ds as PlaintextTranslatorFn, P as PolicyEnforcer, dt as PresenceHandle, du as PresencePeer, aZ as PruneOptions, dv as PublicEnvelopeField, dw as PublicEnvelopeSchema, dx as PublicEnvelopeText, dy as PullMode, dz as PullOptions, dA as PullPolicy, dB as PullResult, dC as PushMode, dD as PushOptions, dE as PushPolicy, dF as PushResult, dG as PutManyItemOptions, dH as PutManyOptions, dI as PutManyResult, X as PutObjectOptions, Y as PutUrlOptions, dJ as QueryAcrossOptions, dK as QueryAcrossResult, dL as QuickUnlockState, dM as QuickUnlockStore, dN as ReAuthOperation, bg as RecipientHint, bf as RecipientSealer, aJ as RecordOutputSpec, dO as RecoverPassphraseInput, dP as RecoverPassphraseResult, dQ as RecoverUserOptions, dR as RecoveryProof, dS as RejectWithdrawalOptions, dT as RequestWithdrawalOptions, dU as RequestWithdrawalResult, dV as ResolvedPublicEnvelopeSchema, ax as RetentionPolicy, dW as RevokeOptions, aT as Role, dX as RotatePassphraseInput, dY as RotateRecoveryOptions, dZ as RotateRecoveryResult, d_ as SEALED_PASSPHRASE_RECORD_ID, d$ as SchemaDelta, e0 as SchemaIntrospection, S as ScriptWarning, e1 as SealedEnvelope, e2 as SealedPassphrase, e3 as SearchEntry, e4 as SearchOptions, e5 as SearchResult, e6 as SequenceHandle, e7 as SequenceOptions, e8 as SequenceStore, e9 as SessionPolicy, ea as SetPublicEnvelopeInput, eb as ShamirRecoveryDoc, ec as ShamirRecoveryEntry, bj as ShamirRecoveryProvider, Z as SlotInfo, _ as SlotRecord, ed as SlotRewrapCeremony, ee as SlotRewrapContext, aA as SnapshotMeta, ef as StandardSchemaV1, eg as StandardSchemaV1Issue, eh as StandardSchemaV1SyncResult, e as StaticDictDescriptor, ei as StoreAuth, ej as StoreAuthKind, ek as StoreCapabilities, el as StoreTime, em as SyncEngine, en as SyncMetadata, eo as SyncPolicy, ep as SyncScheduler, eq as SyncSchedulerStatus, er as SyncStatus, es as SyncTarget, et as SyncTargetRole, eu as SyncTransaction, ev as SyncTransactionResult, ew as TabChannel, ex as TabCoordinationOptions, ey as TabLockManager, ez as TabPresence, eA as TabRole, eB as TierMode, eC as TransactionInvariant, eD as TranslatorAuditEntry, eE as TxCollection, bk as TxContext, eF as TxOp, eG as TxVault, eH as USER_ENVELOPE_COLLECTION, eI as USER_ENVELOPE_MAX_BYTES, bq as UnionArmJoin, br as UnionSource, eJ as Unsubscribe, eK as UpdateAuthenticatorOptions, eL as UpdateContext, eM as UpdateUserOptions, eN as UserApi, eO as UserEnvelopeCheckGate, eP as UserEnvelopeOversizedError, eQ as UserEnvelopePresented, eR as UserInfo, eS as VaultBackup, b5 as VaultEngine, av as VaultFrame, b6 as VaultInstant, eT as VaultPolicyOnDisk, eU as VaultSchemaSnapshot, eV as VaultSnapshot, b7 as VerifyResult, $ as VersionRecord, eW as WarningRules, eX as WeakPassphraseError, eY as WeakPassphraseReason, eZ as WithArchiveOptions, e_ as WithdrawAccessibleOptions, e$ as WithdrawResult, f0 as WithdrawalRequest, f1 as WithdrawalRequestError, f2 as WithdrawalRequestStatus, f3 as WrappedDeksBlob, f4 as WriteConflict, f5 as WriteEvent, f6 as WriteHook, f7 as WriteQueue, f8 as aesGcmOpen, b8 as applyPatch, f9 as approveWithdrawal, fa as assertStrongPassphrase, fb as buildRecipientKeyringFile, fc as burnPaperRecoveryEntry, fd as compileSequenceFormat, b9 as computePatch, n as createEnforcer, fe as createNoydb, ff as createStore, fg as deriveMagicLinkContentKey, f as dictCollectionName, g as dictKey, ba as diff, h as enforceScript, fh as enrollAuthenticator, fi as estimateEntropy, fj as evalComputedFields, fk as evaluateExportCapability, fl as evaluateImportCapability, fm as exportAccessibleData, fn as findAuthenticator, bb as formatDiff, fo as hasExportCapability, fp as hasImportCapability, fq as hasRecoveryEnrolled, i as inferScripts, j as isDictCollectionName, k as isDictKeyDescriptor, fr as isLinkCollectionName, fs as isMagicLinkGrantExpired, ft as isPublicEnvelope, l as isStaticDictDescriptor, fu as issueDelegation, fv as keyringRecoverPassphrase, fw as keyringRotatePassphrase, fx as liberateVault, fy as listMagicLinkGrants, fz as listUsers, fA as listUsersWithEnvelopes, fB as listWithdrawalRequests, fC as loadActiveDelegations, fD as loadPaperRecoveryEntries, fE as loadSealedPassphrase, fF as loadShamirRecoveryEntries, fG as magicLinkGrantRecordId, a1 as memoryObjectProjection, fH as mintPaperRecoveryEntry, fI as mintShamirRecoveryEntry, fJ as mintWrappedDeksBlob, fK as parseRsaOaepTlv, fL as parseSealedEnvelope, fM as readMagicLinkGrantRecord, fN as recoverUser, fO as rejectWithdrawal, fP as removeAuthenticator, fQ as requestWithdrawal, fR as resolvePublicEnvelopeSchema, fS as resolveSequenceKey, fT as revokeDelegation, fU as revokeMagicLinkGrant, fV as runTransaction, fW as savePaperRecoveryEntries, fX as saveSealedPassphrase, fY as saveShamirRecoveryEntries, fZ as sealRsaOaepTlv, s as staticDict, f_ as unwrapDeksFromBlob, f$ as unwrapDeksFromPaperEntry, g0 as unwrapDeksFromShamirEntry, g1 as unwrapMagicLinkGrant, g2 as validatePassphrase, g3 as validatePublicEnvelopeInput, g4 as validateSchemaInput, g5 as validateSchemaOutput, v as validateSessionPolicy, g6 as withArchive, g7 as withDeferredNumbering, g8 as withdrawAccessibleData, g9 as writeMagicLinkGrant } from './types-CkSWJt0H.js';
3
+ export { I as ImportExternalOptions, a as ImportExternalResult, b as ImportableCollection, d as detectMagic, c as detectMimeType, i as importExternalObjects, e as isPreCompressed } from './mime-magic-OiPT1qed.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
5
  import { N as NoydbError } from './errors-Dwk2k1xY.js';
6
6
  export { H as AlreadyElevatedError, A as AmendmentForbiddenError, s as AttestationError, B as BackupCorruptedError, u as BackupLedgerError, v as BundleIntegrityError, w as BundleSealMismatchError, x as BundleVersionConflictError, J as ConflictError, K as CrossJoinSourceUnknownError, Q as CrossJoinTooLargeError, V as DanglingReferenceError, W as DataResidencyError, X as DebugPlaintextError, Y as DebugReservedFieldError, Z as DecryptionError, _ as DelegationTargetMissingError, i as DerivationCapExceededError, j as DerivationCycleError, k as DerivationDepthError, l as DerivationOutputShapeError, m as DerivationOutputUnknownError, D as DictKeyInUseError, a as DictKeyMissingError, $ as DirectoryDisabledError, a0 as ElevationExpiredError, a1 as ExportCapabilityError, F as FieldFrozenError, a2 as FilenameSanitizationError, a3 as ForgetStrategyNotConfiguredError, a4 as GroupCardinalityError, I as IllegalTransitionError, a5 as ImportCapabilityError, a6 as IndexRequiredError, a7 as IndexWriteFailureError, a8 as InvalidKeyError, f as InvariantError, a9 as JoinTooLargeError, aa as KeyringCorruptError, ab as KeyringExpiredError, ac as LedgerContentionError, L as LocaleNotSpecifiedError, z as MaterializedViewConfigError, C as MaterializedViewCycleError, E as MaterializedViewSourceUnknownError, G as MaterializedViewTooLargeError, ad as MigrationRequiredError, M as MissingTranslationError, ae as NetworkError, af as NoAccessError, ag as NonAdditiveSchemaChangeError, ah as NotFoundError, ai as NumberingUncertaintyError, O as OverlayBaseIsVirtualError, n as OverlayCollectionUnavailableError, o as OverlayIdMismatchError, p as OverlayNameCollisionError, aj as PathEscapeError, ak as PeriodClosedError, al as PermissionDeniedError, am as PrivilegeEscalationError, an as QuiesceTimeoutError, ao as ReadOnlyAtInstantError, ap as ReadOnlyError, aq as ReadOnlyFrameError, ar as RecordCekNotFoundError, g as RecordLockedError, R as ReservedCollectionNameError, as as ReservedVaultNameError, at as SchemaFenceError, au as SchemaLockedError, av as SchemaUpdateError, aw as SchemaValidationError, S as ScriptViolationError, q as SealedRecordExpiredError, r as SealedRecordMismatchError, ax as SequenceContentionError, ay as SequenceOfflineError, c as SessionExpiredError, d as SessionNotFoundError, e as SessionPolicyError, az as ShardProvisioningError, h as SnapshotNotFoundError, b as StaticDictReadonlyError, aA as StoreCapabilityError, aB as TamperedError, aC as TierDemoteDeniedError, aD as TierNotGrantedError, T as TranslatorNotConfiguredError, aE as UniqueConstraintError, U as UnknownDictCodeError, aF as UnknownShardError, aG as UnsupportedIndexOptionError, aH as ValidationError, aI as VaultTemplateNotFoundError } from './errors-Dwk2k1xY.js';
7
- export { A as AutoCredential, m as AutoCredentialKind, c as CompressionAlgo, D as DecryptedRecord, 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, i as decryptExtractedPartition, n as hasNoydbBundleMagic, r as readNoydbBundle, k as readNoydbBundleHeader, o as readNoydbBundlePublicEnvelope, l as resetBrotliSupportCache, w as writeNoydbBundle } from './decrypt-partition-CyyJUWLR.js';
7
+ export { A as AutoCredential, m as AutoCredentialKind, c as CompressionAlgo, D as DecryptedRecord, 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, i as decryptExtractedPartition, n as hasNoydbBundleMagic, r as readNoydbBundle, k as readNoydbBundleHeader, o as readNoydbBundlePublicEnvelope, l as resetBrotliSupportCache, w as writeNoydbBundle } from './decrypt-partition-CptDdcCx.js';
8
8
  export { g as generateULID, i as isULID } from './ulid-DRH25k3y.js';
9
9
  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, q as isRefArray, r as ref, s as refArray, t as resetJoinWarnings } from './index-LaexBi3v.js';
10
10
  export { L as LedgerEntry, c as canonicalJson, h as hashEntry, p as paddedIndex, a as parseIndex, s as sha256Hex } from './index-BMmajblo.js';
11
11
  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';
12
- export { b as base64ToBuffer, a as bufferToBase64, d as decryptBytes, c as decryptDeterministic, e as derivePresenceKey, f as encryptBytes, g as encryptDeterministic } from './index-DFhKV-6A.js';
12
+ export { b as base64ToBuffer, a as bufferToBase64, d as decryptBytes, c as decryptDeterministic, e as derivePresenceKey, f as encryptBytes, g as encryptDeterministic } from './index-wRwJVVJQ.js';
13
13
  export { TransactionStrategyOptions } from './tx/index.js';
14
- export { I as ImmutableGuardConfig, T as TransitionGuardConfig, i as immutableGuard, t as transitionGuard, w as withGuard } from './transition-guard-BSLdikC_.js';
14
+ export { I as ImmutableGuardConfig, T as TransitionGuardConfig, i as immutableGuard, t as transitionGuard, w as withGuard } from './transition-guard-CJmb8O8q.js';
15
15
  import { K as RoundingMode } from './strategy-YQ1qJWyq.js';
16
16
  export { h as AggregateResult, j as AggregateSpec, k as Aggregation, l as AggregationUpstream, G as GROUPBY_MAX_CARDINALITY, m as GROUPBY_WARN_CARDINALITY, n as GroupedAggregation, o as GroupedQuery, p as GroupedQueryN, q as GroupedRow, t as GroupedRowN, I as I18nMap, a as I18nTextDescriptor, b as I18nTextOptions, L as Layer, u as LiveAggregation, M as MoneyCurrencyError, N as MoneyDescriptor, P as MoneyOptions, Q as MoneyOptionsFixed, S as MoneyOptionsMulti, T as MoneyPrecisionError, U as MoneyUnsupportedError, O as OnMissing, c as OnMissingPolicy, w as Reducer, x as ReducerOptions, R as ResolveI18nOptions, d as applyI18nLocale, y as avg, B as count, C as groupAndReduce, i as i18nText, e as isI18nTextDescriptor, V as isMoneyDescriptor, D as max, E as min, W as money, F as reduceRecords, r as resolveI18nText, f as resolvePolicy, J as sum, v as validateI18nTextValue } from './strategy-YQ1qJWyq.js';
17
- export { w as withDerivation, a as withRollup } from './with-rollup-mT4_CWaU.js';
18
- export { w as withMaterializedView } from './with-materialized-view-DiD41wQp.js';
17
+ export { w as withDerivation, a as withRollup } from './with-rollup-BvaJefEs.js';
18
+ export { w as withMaterializedView } from './with-materialized-view-BVfcPlaE.js';
19
19
  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';
20
- export { w as withOverlayedView } from './with-overlayed-view-DlbsJMhF.js';
20
+ export { w as withOverlayedView } from './with-overlayed-view-zYPQzGGh.js';
21
21
  export { SYNC_CREDENTIALS_COLLECTION, SyncCredential, credentialStatus, deleteCredential, getCredential, listCredentials, putCredential } from './team/index.js';
22
- 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-ByBkl99-.js';
22
+ 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-Y9znMkQ2.js';
23
23
  export { i as isDiscriminant } from './discriminant-BN9REW3o.js';
24
- export { L as LEDGER_COLLECTION, a as LEDGER_DELTAS_COLLECTION, e as envelopePayloadHash } from './hash-CZxVv8RH.js';
24
+ export { L as LEDGER_COLLECTION, a as LEDGER_DELTAS_COLLECTION, e as envelopePayloadHash } from './hash-Btl9IvQS.js';
25
25
  import './lazy-builder-ChSqcF5t.js';
26
26
  import '@noy-db/attestation';
27
27
 
package/dist/index.js CHANGED
@@ -64,10 +64,11 @@ import {
64
64
  validateSchemaOutput,
65
65
  withArchive,
66
66
  withdrawAccessibleData
67
- } from "./chunk-56ENKU46.js";
67
+ } from "./chunk-KSKKLVPA.js";
68
68
  import {
69
69
  isDiscriminant
70
70
  } from "./chunk-STNPB3UM.js";
71
+ import "./chunk-Z3BJF7SF.js";
71
72
  import {
72
73
  DEFAULT_PUBLIC_ENVELOPE_SCHEMA,
73
74
  PUBLIC_ENVELOPE_FIELDS,
@@ -131,8 +132,8 @@ import {
131
132
  importExternalObjects,
132
133
  isPreCompressed,
133
134
  memoryObjectProjection
134
- } from "./chunk-KJ37E3R5.js";
135
- import "./chunk-ZCBJIDT4.js";
135
+ } from "./chunk-7DDTFGXY.js";
136
+ import "./chunk-RRCRITDM.js";
136
137
  import "./chunk-H4XFA2LM.js";
137
138
  import {
138
139
  CollectionIndexes
@@ -175,7 +176,7 @@ import {
175
176
  } from "./chunk-J66GRPNH.js";
176
177
  import {
177
178
  decryptExtractedPartition
178
- } from "./chunk-RZOGD7IF.js";
179
+ } from "./chunk-CVTPNW2Y.js";
179
180
  import {
180
181
  MemoryRecipientSealer,
181
182
  MemorySealingKeyProvider,
@@ -189,7 +190,7 @@ import {
189
190
  savePersistedSchema,
190
191
  saveSealedPassphrase,
191
192
  sealRsaOaepTlv
192
- } from "./chunk-YP2AYE5W.js";
193
+ } from "./chunk-SID2NJNF.js";
193
194
  import {
194
195
  NOYDB_BUNDLE_FORMAT_VERSION,
195
196
  NOYDB_BUNDLE_MAGIC,
@@ -200,7 +201,7 @@ import {
200
201
  readNoydbBundlePublicEnvelope,
201
202
  resetBrotliSupportCache,
202
203
  writeNoydbBundle
203
- } from "./chunk-N4EXCKWP.js";
204
+ } from "./chunk-6ZKXFMUG.js";
204
205
  import {
205
206
  PUBLIC_ENVELOPE_RECORD_ID,
206
207
  isPublicEnvelope,
@@ -208,14 +209,14 @@ import {
208
209
  readPublicEnvelope,
209
210
  savePublicEnvelope,
210
211
  validatePublicEnvelopeInput
211
- } from "./chunk-HUXDQIVU.js";
212
- import "./chunk-Y5CTT6K5.js";
212
+ } from "./chunk-2NYVA6FW.js";
213
+ import "./chunk-K6PCTYAH.js";
213
214
  import {
214
215
  CONSENT_AUDIT_COLLECTION
215
216
  } from "./chunk-FUDVHE2U.js";
216
217
  import {
217
218
  PERIODS_COLLECTION
218
- } from "./chunk-FCIZXX56.js";
219
+ } from "./chunk-BOMH3637.js";
219
220
  import "./chunk-UF3BUNQZ.js";
220
221
  import {
221
222
  DICT_COLLECTION_PREFIX,
@@ -226,7 +227,7 @@ import {
226
227
  isDictKeyDescriptor,
227
228
  isStaticDictDescriptor,
228
229
  staticDict
229
- } from "./chunk-JJKXJAH2.js";
230
+ } from "./chunk-PFKAT4NT.js";
230
231
  import {
231
232
  applyI18nLocale,
232
233
  enforceScript,
@@ -256,7 +257,7 @@ import {
256
257
  getCredential,
257
258
  listCredentials,
258
259
  putCredential
259
- } from "./chunk-OCRDV3NU.js";
260
+ } from "./chunk-5EITJMUJ.js";
260
261
  import {
261
262
  MAGIC_LINK_CONTENT_INFO_PREFIX,
262
263
  MAGIC_LINK_GRANTS_COLLECTION,
@@ -291,7 +292,7 @@ import {
291
292
  unwrapDeksFromShamirEntry,
292
293
  unwrapMagicLinkGrant,
293
294
  writeMagicLinkGrant
294
- } from "./chunk-2RHBFCWQ.js";
295
+ } from "./chunk-IWGVH2RR.js";
295
296
  import {
296
297
  assertTierAccess,
297
298
  dekKey,
@@ -301,7 +302,7 @@ import {
301
302
  PresenceHandle,
302
303
  SyncEngine,
303
304
  SyncTransaction
304
- } from "./chunk-GPZHHTJU.js";
305
+ } from "./chunk-DONPLWRC.js";
305
306
  import {
306
307
  DIRECTORY_RECORD_ID,
307
308
  USER_ENVELOPE_COLLECTION,
@@ -329,7 +330,7 @@ import {
329
330
  saveUserEnvelope,
330
331
  validatePassphrase,
331
332
  visibilityRecordId
332
- } from "./chunk-UNBX2HMA.js";
333
+ } from "./chunk-LXA2E3VI.js";
333
334
  import {
334
335
  BUNDLE_STORE_POLICY,
335
336
  INDEXED_STORE_POLICY,
@@ -359,14 +360,14 @@ import {
359
360
  VaultInstant,
360
361
  diff,
361
362
  formatDiff
362
- } from "./chunk-VGAN5RLD.js";
363
+ } from "./chunk-6M5JKTUQ.js";
363
364
  import {
364
365
  LEDGER_COLLECTION,
365
366
  LEDGER_DELTAS_COLLECTION,
366
367
  LedgerStore,
367
368
  applyPatch,
368
369
  computePatch
369
- } from "./chunk-EYZJULEN.js";
370
+ } from "./chunk-6H4CAHMQ.js";
370
371
  import {
371
372
  canonicalJson,
372
373
  envelopePayloadHash,
@@ -375,14 +376,14 @@ import {
375
376
  parseIndex,
376
377
  sha256Hex
377
378
  } from "./chunk-PDVP3C2I.js";
378
- import "./chunk-TSUICI5N.js";
379
+ import "./chunk-BMDVFBCL.js";
379
380
  import {
380
381
  NOYDB_BACKUP_VERSION,
381
382
  NOYDB_FORMAT_VERSION,
382
383
  NOYDB_KEYRING_VERSION,
383
384
  NOYDB_SYNC_VERSION,
384
385
  createStore
385
- } from "./chunk-LR7CODVN.js";
386
+ } from "./chunk-AD6RNBAW.js";
386
387
  import {
387
388
  base64ToBuffer,
388
389
  bufferToBase64,
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/debug.ts","../src/schema-update/strategies.ts","../src/schema-update/cutover.ts","../src/numbering/descriptor.ts","../src/constants.ts","../src/money/arith.ts","../src/money/branded.ts","../src/vault-diff.ts"],"sourcesContent":["/**\n * Helpers for reading records out of a *plaintext* store (`encrypt: false`)\n * with native tooling — the programmatic core of a `noydb cat`-style unwrap.\n * See the plaintext/debug-store-mode design.\n */\nimport type { EncryptedEnvelope } from './types.js'\n\n/**\n * Extract the record from a plaintext stored envelope, handling both layouts:\n *\n * - **classic plaintext** (`encrypt: false`): the record is JSON in `_data`.\n * - **debugPlaintext**: the record's fields are inlined beside the\n * `_`-prefixed metadata (marked by `_debug`).\n *\n * Returns `null` for an empty/absent body. Throws if handed an **encrypted**\n * envelope (non-empty `_iv`) — there is no key here; decrypt through the vault\n * instead. Intended for record envelopes, not blob chunks.\n *\n * @example\n * ```ts\n * // node script over a to-file store, no vault needed:\n * const env = JSON.parse(readFileSync('data/acme/invoices/inv-1.json', 'utf8'))\n * console.log(readPlaintextRecord(env)) // → { id: 'inv-1', total: '120.00', … }\n * ```\n */\nexport function readPlaintextRecord<T = Record<string, unknown>>(\n envelope: EncryptedEnvelope,\n): T | null {\n if (envelope._iv !== '') {\n throw new Error(\n 'readPlaintextRecord: envelope is encrypted (non-empty _iv) — decrypt via the vault, not this helper',\n )\n }\n if (envelope._debug !== undefined) {\n const record: Record<string, unknown> = {}\n for (const [key, value] of Object.entries(envelope)) {\n if (!key.startsWith('_')) record[key] = value\n }\n return record as T\n }\n if (!envelope._data) return null\n return JSON.parse(envelope._data) as T\n}\n","/** 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 * Hub-core constants that must be referenceable without pulling any\n * subsystem chunk. Kept import-free.\n */\n\n/** Reserved fleet-wide control-plane vault name. Hub reserves it for an outward orchestration framework's state/control-plane vault. */\nexport const STATE_VAULT_NAME = '__noydb_state__'\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 * Unencrypted envelope metadata for the RECEIVER-side record.\n * Populated only when `diffVault` is called with `{includeMetadata: true}`.\n * Default: `undefined` (zero extra reads, no behavior change).\n *\n * Populated for `modified` (the CURRENT receiver state, before the candidate\n * is applied) and `deleted` (the receiver envelope of the record being\n * removed). `added` entries have no receiver envelope at diff time, so their\n * `metadata` is always absent.\n */\n readonly metadata?: {\n readonly version: number\n readonly timestamp: string\n readonly by?: string\n readonly source?: string\n readonly sourceTs?: string\n }\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 * When `true`, each entry in `added`, `modified`, and `deleted` will carry a\n * `metadata` field with the RECEIVER-side envelope metadata\n * (`version`, `timestamp`, `by?`, `source?`, `sourceTs?`).\n *\n * Off by default — no extra adapter reads, no behavior change for existing callers.\n * (FR-5 read surface, #445)\n */\n readonly includeMetadata?: 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: record only in candidate — no receiver envelope\n added.push({ collection, id, record: after })\n } else if (before !== undefined && after === undefined) {\n // deleted: record only in receiver — attach metadata if requested\n const metadata = options.includeMetadata\n ? (await vault.collection(collection).getMetadata(id)) ?? undefined\n : undefined\n deleted.push({ collection, id, record: before, ...(metadata !== undefined ? { metadata } : {}) })\n } else if (before !== undefined && after !== undefined) {\n if (compareFn(before, after)) {\n unchanged?.push({ collection, id, record: after })\n } else {\n // modified: record in both — attach receiver-side metadata if requested\n const metadata = options.includeMetadata\n ? (await vault.collection(collection).getMetadata(id)) ?? undefined\n : undefined\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 ...(metadata !== undefined ? { metadata } : {}),\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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A,SAASA,YACP,QACA,GACQ;AACR,QAAM,OAAO,GAAG,EAAE,QAAQ,GAAG,eAAY,EAAE,QAAQ,MAAM,kBAAe,EAAE,QAAQ,MAAM;AACxF,MAAI,WAAW,QAAS,QAAO;AAC/B,MAAI,EAAE,QAAQ,UAAU,EAAG,QAAO,OAAO;AACzC,MAAI,WAAW,WAAY,QAAO;AAElC,QAAM,OAAiB,CAAC,MAAM,EAAE;AAChC,aAAW,KAAK,EAAE,MAAO,MAAK,KAAK,GAAG,EAAE,UAAU,IAAI,EAAE,EAAE,QAAS;AACnE,aAAW,KAAK,EAAE,UAAU;AAC1B,UAAM,SAAS,EAAE,WACd,IAAI,CAAC,MAAM,GAAG,EAAE,IAAI,KAAK,UAAU,EAAE,IAAI,CAAC,WAAM,UAAU,EAAE,EAAE,CAAC,EAAE,EACjE,KAAK,IAAI;AACZ,SAAK,KAAK,GAAG,EAAE,UAAU,IAAI,EAAE,EAAE,aAAe,MAAM,EAAE;AAAA,EAC1D;AACA,aAAW,KAAK,EAAE,QAAS,MAAK,KAAK,GAAG,EAAE,UAAU,IAAI,EAAE,EAAE,UAAW;AACvE,SAAO,KAAK,KAAK,IAAI;AACvB;AAEA,SAAS,UAAU,OAAwB;AACzC,MAAI,UAAU,OAAW,QAAO;AAChC,QAAM,IAAI,KAAK,UAAU,KAAK;AAK9B,MAAI,OAAO,MAAM,SAAU,QAAO;AAClC,SAAO,EAAE,SAAS,KAAK,EAAE,MAAM,GAAG,EAAE,IAAI,QAAQ;AAClD;","names":["formatDiff"]}
1
+ {"version":3,"sources":["../src/debug.ts","../src/schema-update/strategies.ts","../src/schema-update/cutover.ts","../src/numbering/descriptor.ts","../src/constants.ts","../src/money/arith.ts","../src/money/branded.ts","../src/vault-diff.ts"],"sourcesContent":["/**\n * Helpers for reading records out of a *plaintext* store (`encrypt: false`)\n * with native tooling — the programmatic core of a `noydb cat`-style unwrap.\n * See the plaintext/debug-store-mode design.\n */\nimport type { EncryptedEnvelope } from './types.js'\n\n/**\n * Extract the record from a plaintext stored envelope, handling both layouts:\n *\n * - **classic plaintext** (`encrypt: false`): the record is JSON in `_data`.\n * - **debugPlaintext**: the record's fields are inlined beside the\n * `_`-prefixed metadata (marked by `_debug`).\n *\n * Returns `null` for an empty/absent body. Throws if handed an **encrypted**\n * envelope (non-empty `_iv`) — there is no key here; decrypt through the vault\n * instead. Intended for record envelopes, not blob chunks.\n *\n * @example\n * ```ts\n * // node script over a to-file store, no vault needed:\n * const env = JSON.parse(readFileSync('data/acme/invoices/inv-1.json', 'utf8'))\n * console.log(readPlaintextRecord(env)) // → { id: 'inv-1', total: '120.00', … }\n * ```\n */\nexport function readPlaintextRecord<T = Record<string, unknown>>(\n envelope: EncryptedEnvelope,\n): T | null {\n if (envelope._iv !== '') {\n throw new Error(\n 'readPlaintextRecord: envelope is encrypted (non-empty _iv) — decrypt via the vault, not this helper',\n )\n }\n if (envelope._debug !== undefined) {\n const record: Record<string, unknown> = {}\n for (const [key, value] of Object.entries(envelope)) {\n if (!key.startsWith('_')) record[key] = value\n }\n return record as T\n }\n if (!envelope._data) return null\n return JSON.parse(envelope._data) as T\n}\n","/** 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 * Hub-core constants that must be referenceable without pulling any\n * subsystem chunk. Kept import-free.\n */\n\n/** Reserved fleet-wide control-plane vault name. Hub reserves it for an outward orchestration framework's state/control-plane vault. */\nexport const STATE_VAULT_NAME = '__noydb_state__'\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 * Unencrypted envelope metadata for the RECEIVER-side record.\n * Populated only when `diffVault` is called with `{includeMetadata: true}`.\n * Default: `undefined` (zero extra reads, no behavior change).\n *\n * Populated for `modified` (the CURRENT receiver state, before the candidate\n * is applied) and `deleted` (the receiver envelope of the record being\n * removed). `added` entries have no receiver envelope at diff time, so their\n * `metadata` is always absent.\n */\n readonly metadata?: {\n readonly version: number\n readonly timestamp: string\n readonly by?: string\n readonly source?: string\n readonly sourceTs?: string\n }\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 * When `true`, each entry in `added`, `modified`, and `deleted` will carry a\n * `metadata` field with the RECEIVER-side envelope metadata\n * (`version`, `timestamp`, `by?`, `source?`, `sourceTs?`).\n *\n * Off by default — no extra adapter reads, no behavior change for existing callers.\n * (FR-5 read surface, #445)\n */\n readonly includeMetadata?: 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: record only in candidate — no receiver envelope\n added.push({ collection, id, record: after })\n } else if (before !== undefined && after === undefined) {\n // deleted: record only in receiver — attach metadata if requested\n const metadata = options.includeMetadata\n ? (await vault.collection(collection).getMetadata(id)) ?? undefined\n : undefined\n deleted.push({ collection, id, record: before, ...(metadata !== undefined ? { metadata } : {}) })\n } else if (before !== undefined && after !== undefined) {\n if (compareFn(before, after)) {\n unchanged?.push({ collection, id, record: after })\n } else {\n // modified: record in both — attach receiver-side metadata if requested\n const metadata = options.includeMetadata\n ? (await vault.collection(collection).getMetadata(id)) ?? undefined\n : undefined\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 ...(metadata !== undefined ? { metadata } : {}),\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBO,SAAS,oBACd,UACU;AACV,MAAI,SAAS,QAAQ,IAA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,MAAI,WAAW,WAAY,QAAO;AAElC,QAAM,OAAiB,CAAC,MAAM,EAAE;AAChC,aAAW,KAAK,EAAE,MAAO,MAAK,KAAK,GAAG,EAAE,UAAU,IAAI,EAAE,EAAE,QAAS;AACnE,aAAW,KAAK,EAAE,UAAU;AAC1B,UAAM,SAAS,EAAE,WACd,IAAI,CAAC,MAAM,GAAG,EAAE,IAAI,KAAK,UAAU,EAAE,IAAI,CAAC,WAAM,UAAU,EAAE,EAAE,CAAC,EAAE,EACjE,KAAK,IAAI;AACZ,SAAK,KAAK,GAAG,EAAE,UAAU,IAAI,EAAE,EAAE,aAAe,MAAM,EAAE;AAAA,EAC1D;AACA,aAAW,KAAK,EAAE,QAAS,MAAK,KAAK,GAAG,EAAE,UAAU,IAAI,EAAE,EAAE,UAAW;AACvE,SAAO,KAAK,KAAK,IAAI;AACvB;AAEA,SAAS,UAAU,OAAwB;AACzC,MAAI,UAAU,OAAW,QAAO;AAChC,QAAM,IAAI,KAAK,UAAU,KAAK;AAK9B,MAAI,OAAO,MAAM,SAAU,QAAO;AAClC,SAAO,EAAE,SAAS,KAAK,EAAE,MAAM,GAAG,EAAE,IAAI,QAAQ;AAClD;","names":["formatDiff"]}
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  issueAttestationCore
3
- } from "./chunk-ANLOD6IS.js";
4
- import "./chunk-QYQRAOEF.js";
3
+ } from "./chunk-KA5A5CSD.js";
4
+ import "./chunk-I2RX62RX.js";
5
5
  import "./chunk-FZU343FL.js";
6
- import "./chunk-LR7CODVN.js";
6
+ import "./chunk-AD6RNBAW.js";
7
7
  import "./chunk-7JSP3E67.js";
8
8
  import "./chunk-DDOYOMAD.js";
9
9
  export {
10
10
  issueAttestationCore
11
11
  };
12
- //# sourceMappingURL=issue-LEBPVF3Y.js.map
12
+ //# sourceMappingURL=issue-ZZ2XPOGP.js.map