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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (253) hide show
  1. package/dist/aggregate/index.cjs +91 -36
  2. package/dist/aggregate/index.cjs.map +1 -1
  3. package/dist/aggregate/index.d.cts +2 -2
  4. package/dist/aggregate/index.d.ts +2 -2
  5. package/dist/aggregate/index.js +16 -9
  6. package/dist/aggregate/index.js.map +1 -1
  7. package/dist/blobs/index.cjs.map +1 -1
  8. package/dist/blobs/index.d.cts +6 -6
  9. package/dist/blobs/index.d.ts +6 -6
  10. package/dist/blobs/index.js +4 -4
  11. package/dist/bundle/index.cjs +298 -7
  12. package/dist/bundle/index.cjs.map +1 -1
  13. package/dist/bundle/index.d.cts +6 -6
  14. package/dist/bundle/index.d.ts +6 -6
  15. package/dist/bundle/index.js +15 -4
  16. package/dist/{chunk-GOUT6DND.js → chunk-23TTQXVO.js} +173 -91
  17. package/dist/chunk-23TTQXVO.js.map +1 -0
  18. package/dist/{chunk-CIMZBAZB.js → chunk-2AXFIYHT.js} +1 -1
  19. package/dist/chunk-2AXFIYHT.js.map +1 -0
  20. package/dist/chunk-34YSDCDP.js +73 -0
  21. package/dist/chunk-34YSDCDP.js.map +1 -0
  22. package/dist/{chunk-AVVPZ4BC.js → chunk-4TFSM22V.js} +4 -4
  23. package/dist/{chunk-QGZRWRSL.js → chunk-537VFZTR.js} +4 -4
  24. package/dist/{chunk-M62XNWRA.js → chunk-5DWL3JBF.js} +2 -2
  25. package/dist/{chunk-PTVMYYON.js → chunk-5SCJ5UEF.js} +3 -3
  26. package/dist/chunk-5ZGZ6HIZ.js +100 -0
  27. package/dist/chunk-5ZGZ6HIZ.js.map +1 -0
  28. package/dist/chunk-6HPZY4ON.js +291 -0
  29. package/dist/chunk-6HPZY4ON.js.map +1 -0
  30. package/dist/{chunk-EXHNQEV4.js → chunk-7H6DOO3E.js} +239 -11
  31. package/dist/chunk-7H6DOO3E.js.map +1 -0
  32. package/dist/{chunk-ACLDOTNQ.js → chunk-ADQ5MQ54.js} +275 -3
  33. package/dist/chunk-ADQ5MQ54.js.map +1 -0
  34. package/dist/chunk-CBAHB2BF.js +893 -0
  35. package/dist/chunk-CBAHB2BF.js.map +1 -0
  36. package/dist/chunk-DPMFBCV6.js +296 -0
  37. package/dist/chunk-DPMFBCV6.js.map +1 -0
  38. package/dist/chunk-DYBQG5PQ.js +34 -0
  39. package/dist/chunk-DYBQG5PQ.js.map +1 -0
  40. package/dist/{chunk-ZFKD4QMV.js → chunk-DYECX3IX.js} +3 -3
  41. package/dist/chunk-EGQYGYIU.js +51 -0
  42. package/dist/chunk-EGQYGYIU.js.map +1 -0
  43. package/dist/chunk-FCXOFQAJ.js +79 -0
  44. package/dist/chunk-FCXOFQAJ.js.map +1 -0
  45. package/dist/chunk-HB3Z2GCR.js +124 -0
  46. package/dist/chunk-HB3Z2GCR.js.map +1 -0
  47. package/dist/{chunk-SCZXXXU4.js → chunk-I6MX32UC.js} +7 -32
  48. package/dist/chunk-I6MX32UC.js.map +1 -0
  49. package/dist/{chunk-VQBTTTUN.js → chunk-KESP7GOK.js} +4 -4
  50. package/dist/{chunk-VQBTTTUN.js.map → chunk-KESP7GOK.js.map} +1 -1
  51. package/dist/{chunk-NXFEYLVG.js → chunk-MIQHZESA.js} +4 -3
  52. package/dist/{chunk-NXFEYLVG.js.map → chunk-MIQHZESA.js.map} +1 -1
  53. package/dist/chunk-MKSA2V7A.js +19 -0
  54. package/dist/chunk-MKSA2V7A.js.map +1 -0
  55. package/dist/{chunk-M5INGEFC.js → chunk-MRIBLZL3.js} +3 -1
  56. package/dist/chunk-MRIBLZL3.js.map +1 -0
  57. package/dist/{chunk-MDDTIZUO.js → chunk-NIOHFJPJ.js} +6 -6
  58. package/dist/chunk-OMLIZL2P.js +61 -0
  59. package/dist/chunk-OMLIZL2P.js.map +1 -0
  60. package/dist/{chunk-USKYUS74.js → chunk-P7EQ2S5O.js} +2 -2
  61. package/dist/{chunk-WDM5XGGS.js → chunk-PA6R5ZCI.js} +181 -11
  62. package/dist/chunk-PA6R5ZCI.js.map +1 -0
  63. package/dist/chunk-PEULZC6M.js +118 -0
  64. package/dist/chunk-PEULZC6M.js.map +1 -0
  65. package/dist/chunk-RD5LYKD6.js +82 -0
  66. package/dist/chunk-RD5LYKD6.js.map +1 -0
  67. package/dist/chunk-SIZWEV2Y.js +145 -0
  68. package/dist/chunk-SIZWEV2Y.js.map +1 -0
  69. package/dist/{chunk-QAVUREFT.js → chunk-UA4RI7OT.js} +12 -6
  70. package/dist/chunk-UA4RI7OT.js.map +1 -0
  71. package/dist/chunk-UMLVJTYV.js +20 -0
  72. package/dist/chunk-UMLVJTYV.js.map +1 -0
  73. package/dist/chunk-UZXLQCHP.js +53 -0
  74. package/dist/chunk-UZXLQCHP.js.map +1 -0
  75. package/dist/{chunk-2CSJGFCB.js → chunk-VMIO4IXG.js} +5 -5
  76. package/dist/{chunk-MR4424N3.js → chunk-WCA2NROQ.js} +2 -2
  77. package/dist/{chunk-TDR6T5CJ.js → chunk-XGSOTWYX.js} +91 -132
  78. package/dist/chunk-XGSOTWYX.js.map +1 -0
  79. package/dist/{chunk-NPC4LFV5.js → chunk-YMYK7US4.js} +2 -2
  80. package/dist/{chunk-RKJ6OL7K.js → chunk-YS3POABP.js} +1 -1
  81. package/dist/chunk-YS3POABP.js.map +1 -0
  82. package/dist/chunk-Z72JH4KG.js +209 -0
  83. package/dist/chunk-Z72JH4KG.js.map +1 -0
  84. package/dist/{chunk-R36SIKES.js → chunk-ZNOEIM6Y.js} +2 -2
  85. package/dist/consent/index.cjs.map +1 -1
  86. package/dist/consent/index.d.cts +6 -6
  87. package/dist/consent/index.d.ts +6 -6
  88. package/dist/consent/index.js +3 -3
  89. package/dist/{crypto-IVKU7YTT.js → crypto-A7FRXYHC.js} +3 -3
  90. package/dist/{delegation-2DBS2EOH.js → delegation-YBA4X4JN.js} +5 -4
  91. package/dist/derivations/index.cjs +351 -0
  92. package/dist/derivations/index.cjs.map +1 -0
  93. package/dist/derivations/index.d.cts +71 -0
  94. package/dist/derivations/index.d.ts +71 -0
  95. package/dist/derivations/index.js +27 -0
  96. package/dist/{dev-unlock-BdPp68qn.d.ts → dev-unlock-D9s-loPr.d.ts} +1 -1
  97. package/dist/{dev-unlock-Da1B0TIK.d.cts → dev-unlock-DRwVSy2S.d.cts} +1 -1
  98. package/dist/executor-7E3VFGW7.js +11 -0
  99. package/dist/executor-CEWX2FQI.js +8 -0
  100. package/dist/executor-CEWX2FQI.js.map +1 -0
  101. package/dist/executor-X4SQ3ZLC.js +8 -0
  102. package/dist/executor-X4SQ3ZLC.js.map +1 -0
  103. package/dist/fanout-sidecar-VJ52RIEY.js +51 -0
  104. package/dist/fanout-sidecar-VJ52RIEY.js.map +1 -0
  105. package/dist/guards/index.cjs +315 -0
  106. package/dist/guards/index.cjs.map +1 -0
  107. package/dist/guards/index.d.cts +30 -0
  108. package/dist/guards/index.d.ts +30 -0
  109. package/dist/guards/index.js +29 -0
  110. package/dist/guards/index.js.map +1 -0
  111. package/dist/{hash-lsoL3eEW.d.ts → hash-DXXXusyk.d.ts} +1 -1
  112. package/dist/{hash-BEfzPKwo.d.cts → hash-DtRih9MQ.d.cts} +1 -1
  113. package/dist/history/index.cjs +8 -1
  114. package/dist/history/index.cjs.map +1 -1
  115. package/dist/history/index.d.cts +7 -7
  116. package/dist/history/index.d.ts +7 -7
  117. package/dist/history/index.js +6 -6
  118. package/dist/i18n/index.cjs +81 -0
  119. package/dist/i18n/index.cjs.map +1 -1
  120. package/dist/i18n/index.d.cts +6 -6
  121. package/dist/i18n/index.d.ts +6 -6
  122. package/dist/i18n/index.js +19 -6
  123. package/dist/i18n/index.js.map +1 -1
  124. package/dist/{index-8QDuznDr.d.ts → index-4agOpzqd.d.ts} +174 -3
  125. package/dist/{index-6xNpPsxR.d.cts → index-CNwA-B6-.d.ts} +303 -5
  126. package/dist/{index-DJTf9yxn.d.ts → index-CmVgTkqk.d.cts} +303 -5
  127. package/dist/{index-CywCC1qZ.d.cts → index-hdFvZkBP.d.cts} +174 -3
  128. package/dist/index.cjs +5615 -979
  129. package/dist/index.cjs.map +1 -1
  130. package/dist/index.d.cts +207 -16
  131. package/dist/index.d.ts +207 -16
  132. package/dist/index.js +2302 -741
  133. package/dist/index.js.map +1 -1
  134. package/dist/indexing/index.cjs +2 -0
  135. package/dist/indexing/index.cjs.map +1 -1
  136. package/dist/indexing/index.d.cts +3 -3
  137. package/dist/indexing/index.d.ts +3 -3
  138. package/dist/indexing/index.js +4 -4
  139. package/dist/{lazy-builder-CZVLKh0Z.d.cts → lazy-builder-C-rPfWG0.d.cts} +1 -1
  140. package/dist/{lazy-builder-BwEoBQZ9.d.ts → lazy-builder-Rpd-V3jP.d.ts} +1 -1
  141. package/dist/{ledger-QZTTHQAQ.js → ledger-3TXNP47J.js} +6 -6
  142. package/dist/ledger-3TXNP47J.js.map +1 -0
  143. package/dist/materialized-views/index.cjs +837 -0
  144. package/dist/materialized-views/index.cjs.map +1 -0
  145. package/dist/materialized-views/index.d.cts +183 -0
  146. package/dist/materialized-views/index.d.ts +183 -0
  147. package/dist/materialized-views/index.js +45 -0
  148. package/dist/materialized-views/index.js.map +1 -0
  149. package/dist/overlay-views/index.cjs +359 -0
  150. package/dist/overlay-views/index.cjs.map +1 -0
  151. package/dist/overlay-views/index.d.cts +81 -0
  152. package/dist/overlay-views/index.d.ts +81 -0
  153. package/dist/overlay-views/index.js +23 -0
  154. package/dist/overlay-views/index.js.map +1 -0
  155. package/dist/periods/index.cjs +7 -1
  156. package/dist/periods/index.cjs.map +1 -1
  157. package/dist/periods/index.d.cts +6 -6
  158. package/dist/periods/index.d.ts +6 -6
  159. package/dist/periods/index.js +6 -6
  160. package/dist/{predicate-SBHmi6D0.d.cts → predicate-Dnu81tsS.d.cts} +25 -1
  161. package/dist/{predicate-SBHmi6D0.d.ts → predicate-Dnu81tsS.d.ts} +25 -1
  162. package/dist/{public-envelope-6JTACYJV.js → public-envelope-PY6NKFLI.js} +4 -4
  163. package/dist/public-envelope-PY6NKFLI.js.map +1 -0
  164. package/dist/query/index.cjs +302 -124
  165. package/dist/query/index.cjs.map +1 -1
  166. package/dist/query/index.d.cts +3 -3
  167. package/dist/query/index.d.ts +3 -3
  168. package/dist/query/index.js +26 -11
  169. package/dist/read-only-facade-ITU6L7BL.js +7 -0
  170. package/dist/read-only-facade-ITU6L7BL.js.map +1 -0
  171. package/dist/registry-3L3N3PTG.js +10 -0
  172. package/dist/registry-3L3N3PTG.js.map +1 -0
  173. package/dist/registry-O47PUPSY.js +8 -0
  174. package/dist/registry-O47PUPSY.js.map +1 -0
  175. package/dist/registry-RFGGMVNJ.js +7 -0
  176. package/dist/registry-RFGGMVNJ.js.map +1 -0
  177. package/dist/registry-WLLMODKN.js +8 -0
  178. package/dist/registry-WLLMODKN.js.map +1 -0
  179. package/dist/session/index.cjs +7 -1
  180. package/dist/session/index.cjs.map +1 -1
  181. package/dist/session/index.d.cts +7 -7
  182. package/dist/session/index.d.ts +7 -7
  183. package/dist/session/index.js +10 -3
  184. package/dist/session/index.js.map +1 -1
  185. package/dist/shadow/index.cjs.map +1 -1
  186. package/dist/shadow/index.d.cts +6 -6
  187. package/dist/shadow/index.d.ts +6 -6
  188. package/dist/shadow/index.js +2 -2
  189. package/dist/stale-HSC5YO2O.js +13 -0
  190. package/dist/stale-HSC5YO2O.js.map +1 -0
  191. package/dist/store/index.cjs +14 -0
  192. package/dist/store/index.cjs.map +1 -1
  193. package/dist/store/index.d.cts +6 -6
  194. package/dist/store/index.d.ts +6 -6
  195. package/dist/store/index.js +5 -2
  196. package/dist/{strategy-D-SrOLCl.d.cts → strategy-DSTrsZ8t.d.cts} +72 -19
  197. package/dist/{strategy-D-SrOLCl.d.ts → strategy-DSTrsZ8t.d.ts} +72 -19
  198. package/dist/sync/index.cjs.map +1 -1
  199. package/dist/sync/index.d.cts +5 -5
  200. package/dist/sync/index.d.ts +5 -5
  201. package/dist/sync/index.js +4 -4
  202. package/dist/team/index.cjs +1554 -2
  203. package/dist/team/index.cjs.map +1 -1
  204. package/dist/team/index.d.cts +6 -6
  205. package/dist/team/index.d.ts +6 -6
  206. package/dist/team/index.js +76 -9
  207. package/dist/tx/index.cjs +296 -44
  208. package/dist/tx/index.cjs.map +1 -1
  209. package/dist/tx/index.d.cts +6 -6
  210. package/dist/tx/index.d.ts +6 -6
  211. package/dist/tx/index.js +2 -2
  212. package/dist/{types-Bnb82f5R.d.cts → types-C4lwMKKF.d.cts} +2605 -328
  213. package/dist/{types-Bo7NSXJr.d.ts → types-DW9RGSSs.d.ts} +2605 -328
  214. package/dist/util/index.cjs.map +1 -1
  215. package/dist/util/index.js +1 -1
  216. package/dist/with-derivation-C8LDlV7t.d.cts +13 -0
  217. package/dist/with-derivation-g-pGoMzL.d.ts +13 -0
  218. package/dist/with-guard-DWOCK4Ca.d.ts +18 -0
  219. package/dist/with-guard-jI1x9Z3k.d.cts +18 -0
  220. package/dist/with-materialized-view-DaKR-N6J.d.ts +27 -0
  221. package/dist/with-materialized-view-DcTx4H3j.d.cts +27 -0
  222. package/dist/with-overlayed-view-D-6oWAgM.d.cts +13 -0
  223. package/dist/with-overlayed-view-N7jYuNOS.d.ts +13 -0
  224. package/package.json +53 -2
  225. package/dist/chunk-4PWAI7Q4.js +0 -79
  226. package/dist/chunk-4PWAI7Q4.js.map +0 -1
  227. package/dist/chunk-ACLDOTNQ.js.map +0 -1
  228. package/dist/chunk-BTDCBVJW.js +0 -160
  229. package/dist/chunk-BTDCBVJW.js.map +0 -1
  230. package/dist/chunk-CIMZBAZB.js.map +0 -1
  231. package/dist/chunk-EXHNQEV4.js.map +0 -1
  232. package/dist/chunk-GOUT6DND.js.map +0 -1
  233. package/dist/chunk-M5INGEFC.js.map +0 -1
  234. package/dist/chunk-QAVUREFT.js.map +0 -1
  235. package/dist/chunk-RKJ6OL7K.js.map +0 -1
  236. package/dist/chunk-SCZXXXU4.js.map +0 -1
  237. package/dist/chunk-TDR6T5CJ.js.map +0 -1
  238. package/dist/chunk-WDM5XGGS.js.map +0 -1
  239. /package/dist/{chunk-AVVPZ4BC.js.map → chunk-4TFSM22V.js.map} +0 -0
  240. /package/dist/{chunk-QGZRWRSL.js.map → chunk-537VFZTR.js.map} +0 -0
  241. /package/dist/{chunk-M62XNWRA.js.map → chunk-5DWL3JBF.js.map} +0 -0
  242. /package/dist/{chunk-PTVMYYON.js.map → chunk-5SCJ5UEF.js.map} +0 -0
  243. /package/dist/{chunk-ZFKD4QMV.js.map → chunk-DYECX3IX.js.map} +0 -0
  244. /package/dist/{chunk-MDDTIZUO.js.map → chunk-NIOHFJPJ.js.map} +0 -0
  245. /package/dist/{chunk-USKYUS74.js.map → chunk-P7EQ2S5O.js.map} +0 -0
  246. /package/dist/{chunk-2CSJGFCB.js.map → chunk-VMIO4IXG.js.map} +0 -0
  247. /package/dist/{chunk-MR4424N3.js.map → chunk-WCA2NROQ.js.map} +0 -0
  248. /package/dist/{chunk-NPC4LFV5.js.map → chunk-YMYK7US4.js.map} +0 -0
  249. /package/dist/{chunk-R36SIKES.js.map → chunk-ZNOEIM6Y.js.map} +0 -0
  250. /package/dist/{crypto-IVKU7YTT.js.map → crypto-A7FRXYHC.js.map} +0 -0
  251. /package/dist/{delegation-2DBS2EOH.js.map → delegation-YBA4X4JN.js.map} +0 -0
  252. /package/dist/{ledger-QZTTHQAQ.js.map → derivations/index.js.map} +0 -0
  253. /package/dist/{public-envelope-6JTACYJV.js.map → executor-7E3VFGW7.js.map} +0 -0
@@ -1,11 +1,11 @@
1
- import { B as BlobStrategy } from '../types-Bnb82f5R.cjs';
2
- export { p as BLOB_CHUNKS_COLLECTION, q as BLOB_COLLECTION, s as BLOB_EVICTION_AUDIT_COLLECTION, t as BLOB_INDEX_COLLECTION, u as BLOB_SLOTS_PREFIX, w as BLOB_VERSIONS_PREFIX, x as BlobEvictionEntry, y as BlobFieldPolicy, z as BlobFieldsConfig, A as BlobObject, C as BlobPutOptions, E as BlobResponseOptions, F as BlobSet, G as BlobStrategyOpenArgs, H as CompactRunOptions, J as CompactionContext, K as CompactionResult, L as DEFAULT_CHUNK_SIZE, M as EXPORT_AUDIT_COLLECTION, N as ExportBlobsAbortedError, O as ExportBlobsAuditEntry, Q as ExportBlobsHandle, R as ExportBlobsOptions, T as ExportedBlob, U as SlotInfo, V as SlotRecord, W as VersionRecord, X as createExportBlobsHandle, Y as runCompaction } from '../types-Bnb82f5R.cjs';
1
+ import { B as BlobStrategy } from '../types-C4lwMKKF.cjs';
2
+ export { p as BLOB_CHUNKS_COLLECTION, q as BLOB_COLLECTION, s as BLOB_EVICTION_AUDIT_COLLECTION, t as BLOB_INDEX_COLLECTION, u as BLOB_SLOTS_PREFIX, w as BLOB_VERSIONS_PREFIX, x as BlobEvictionEntry, y as BlobFieldPolicy, z as BlobFieldsConfig, A as BlobObject, C as BlobPutOptions, E as BlobResponseOptions, F as BlobSet, G as BlobStrategyOpenArgs, H as CompactRunOptions, J as CompactionContext, K as CompactionResult, L as DEFAULT_CHUNK_SIZE, M as EXPORT_AUDIT_COLLECTION, N as ExportBlobsAbortedError, O as ExportBlobsAuditEntry, Q as ExportBlobsHandle, R as ExportBlobsOptions, T as ExportedBlob, U as SlotInfo, V as SlotRecord, W as VersionRecord, X as createExportBlobsHandle, Y as runCompaction } from '../types-C4lwMKKF.cjs';
3
3
  export { d as detectMagic, a as detectMimeType, i as isPreCompressed } from '../mime-magic-CBBSOkjm.cjs';
4
- import '../lazy-builder-CZVLKh0Z.cjs';
5
- import '../predicate-SBHmi6D0.cjs';
6
- import '../strategy-D-SrOLCl.cjs';
4
+ import '../lazy-builder-C-rPfWG0.cjs';
5
+ import '../predicate-Dnu81tsS.cjs';
6
+ import '../strategy-DSTrsZ8t.cjs';
7
7
  import '../strategy-BSxFXGzb.cjs';
8
- import '../index-6xNpPsxR.cjs';
8
+ import '../index-CmVgTkqk.cjs';
9
9
 
10
10
  /**
11
11
  * Active blob strategy factory. Calling `blobs()` returns a
@@ -1,11 +1,11 @@
1
- import { B as BlobStrategy } from '../types-Bo7NSXJr.js';
2
- export { p as BLOB_CHUNKS_COLLECTION, q as BLOB_COLLECTION, s as BLOB_EVICTION_AUDIT_COLLECTION, t as BLOB_INDEX_COLLECTION, u as BLOB_SLOTS_PREFIX, w as BLOB_VERSIONS_PREFIX, x as BlobEvictionEntry, y as BlobFieldPolicy, z as BlobFieldsConfig, A as BlobObject, C as BlobPutOptions, E as BlobResponseOptions, F as BlobSet, G as BlobStrategyOpenArgs, H as CompactRunOptions, J as CompactionContext, K as CompactionResult, L as DEFAULT_CHUNK_SIZE, M as EXPORT_AUDIT_COLLECTION, N as ExportBlobsAbortedError, O as ExportBlobsAuditEntry, Q as ExportBlobsHandle, R as ExportBlobsOptions, T as ExportedBlob, U as SlotInfo, V as SlotRecord, W as VersionRecord, X as createExportBlobsHandle, Y as runCompaction } from '../types-Bo7NSXJr.js';
1
+ import { B as BlobStrategy } from '../types-DW9RGSSs.js';
2
+ export { p as BLOB_CHUNKS_COLLECTION, q as BLOB_COLLECTION, s as BLOB_EVICTION_AUDIT_COLLECTION, t as BLOB_INDEX_COLLECTION, u as BLOB_SLOTS_PREFIX, w as BLOB_VERSIONS_PREFIX, x as BlobEvictionEntry, y as BlobFieldPolicy, z as BlobFieldsConfig, A as BlobObject, C as BlobPutOptions, E as BlobResponseOptions, F as BlobSet, G as BlobStrategyOpenArgs, H as CompactRunOptions, J as CompactionContext, K as CompactionResult, L as DEFAULT_CHUNK_SIZE, M as EXPORT_AUDIT_COLLECTION, N as ExportBlobsAbortedError, O as ExportBlobsAuditEntry, Q as ExportBlobsHandle, R as ExportBlobsOptions, T as ExportedBlob, U as SlotInfo, V as SlotRecord, W as VersionRecord, X as createExportBlobsHandle, Y as runCompaction } from '../types-DW9RGSSs.js';
3
3
  export { d as detectMagic, a as detectMimeType, i as isPreCompressed } from '../mime-magic-CBBSOkjm.js';
4
- import '../lazy-builder-BwEoBQZ9.js';
5
- import '../predicate-SBHmi6D0.js';
6
- import '../strategy-D-SrOLCl.js';
4
+ import '../lazy-builder-Rpd-V3jP.js';
5
+ import '../predicate-Dnu81tsS.js';
6
+ import '../strategy-DSTrsZ8t.js';
7
7
  import '../strategy-BSxFXGzb.js';
8
- import '../index-DJTf9yxn.js';
8
+ import '../index-CNwA-B6-.js';
9
9
 
10
10
  /**
11
11
  * Active blob strategy factory. Calling `blobs()` returns a
@@ -14,10 +14,10 @@ import {
14
14
  detectMimeType,
15
15
  isPreCompressed,
16
16
  runCompaction
17
- } from "../chunk-2CSJGFCB.js";
18
- import "../chunk-RKJ6OL7K.js";
19
- import "../chunk-MR4424N3.js";
20
- import "../chunk-ACLDOTNQ.js";
17
+ } from "../chunk-VMIO4IXG.js";
18
+ import "../chunk-YS3POABP.js";
19
+ import "../chunk-WCA2NROQ.js";
20
+ import "../chunk-ADQ5MQ54.js";
21
21
 
22
22
  // src/blobs/active.ts
23
23
  function withBlobs() {
@@ -20,6 +20,11 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
20
20
  // src/bundle/index.ts
21
21
  var bundle_exports = {};
22
22
  __export(bundle_exports, {
23
+ BackupCorruptedError: () => BackupCorruptedError,
24
+ BackupLedgerError: () => BackupLedgerError,
25
+ BundleIntegrityError: () => BundleIntegrityError,
26
+ BundleSealMismatchError: () => BundleSealMismatchError,
27
+ BundleVersionConflictError: () => BundleVersionConflictError,
23
28
  COMPRESSION_BROTLI: () => COMPRESSION_BROTLI,
24
29
  COMPRESSION_GZIP: () => COMPRESSION_GZIP,
25
30
  COMPRESSION_NONE: () => COMPRESSION_NONE,
@@ -53,7 +58,8 @@ var ALLOWED_HEADER_KEYS = /* @__PURE__ */ new Set([
53
58
  "handle",
54
59
  "bodyBytes",
55
60
  "bodySha256",
56
- "publicEnvelope"
61
+ "publicEnvelope",
62
+ "autoUnlock"
57
63
  ]);
58
64
  function validateBundleHeader(parsed) {
59
65
  if (parsed === null || typeof parsed !== "object") {
@@ -108,6 +114,14 @@ function validateBundleHeader(parsed) {
108
114
  );
109
115
  }
110
116
  }
117
+ if (h["autoUnlock"] !== void 0) {
118
+ if (h["autoUnlock"] !== "unsealed" && h["autoUnlock"] !== "sealed") {
119
+ const got = typeof h["autoUnlock"] === "string" ? `"${h["autoUnlock"]}"` : typeof h["autoUnlock"];
120
+ throw new Error(
121
+ `.noydb bundle header.autoUnlock must be 'unsealed' or 'sealed' when present, got ${got}.`
122
+ );
123
+ }
124
+ }
111
125
  }
112
126
  function encodeBundleHeader(header) {
113
127
  validateBundleHeader(header);
@@ -116,7 +130,8 @@ function encodeBundleHeader(header) {
116
130
  handle: header.handle,
117
131
  bodyBytes: header.bodyBytes,
118
132
  bodySha256: header.bodySha256,
119
- ...header.publicEnvelope !== void 0 ? { publicEnvelope: header.publicEnvelope } : {}
133
+ ...header.publicEnvelope !== void 0 ? { publicEnvelope: header.publicEnvelope } : {},
134
+ ...header.autoUnlock !== void 0 ? { autoUnlock: header.autoUnlock } : {}
120
135
  });
121
136
  return new TextEncoder().encode(json);
122
137
  }
@@ -160,14 +175,276 @@ var NoydbError = class extends Error {
160
175
  this.code = code;
161
176
  }
162
177
  };
178
+ var BundleVersionConflictError = class extends NoydbError {
179
+ /** The bundle handle of the newer remote version that rejected the push. */
180
+ remoteVersion;
181
+ constructor(remoteVersion, message = "Bundle version conflict \u2014 remote has been updated") {
182
+ super("BUNDLE_VERSION_CONFLICT", message);
183
+ this.name = "BundleVersionConflictError";
184
+ this.remoteVersion = remoteVersion;
185
+ }
186
+ };
187
+ var ValidationError = class extends NoydbError {
188
+ constructor(message = "Validation error") {
189
+ super("VALIDATION_ERROR", message);
190
+ this.name = "ValidationError";
191
+ }
192
+ };
163
193
  var BundleIntegrityError = class extends NoydbError {
164
194
  constructor(message) {
165
195
  super("BUNDLE_INTEGRITY", `.noydb bundle integrity check failed: ${message}`);
166
196
  this.name = "BundleIntegrityError";
167
197
  }
168
198
  };
199
+ var BundleSealMismatchError = class extends NoydbError {
200
+ userId;
201
+ pid;
202
+ constructor(userId, pid) {
203
+ super(
204
+ "BUNDLE_SEAL_MISMATCH",
205
+ `bundle carries sealed passphrase for user "${userId}" under provider "${pid}", but no registered provider matches that pid.
206
+
207
+ Resolutions:
208
+ 1. Configure a provider matching the pid and retry import.
209
+ 2. Pass \`attemptUnsealAcrossProviders: true\` to try each registered
210
+ provider regardless of pid (extra credential prompts may surface).
211
+ 3. Inspect the bundle without unsealing \u2014 pass no \`sealingProviders\`
212
+ to receive the sealed entries unmodified for offline analysis.`
213
+ );
214
+ this.name = "BundleSealMismatchError";
215
+ this.userId = userId;
216
+ this.pid = pid;
217
+ }
218
+ };
219
+ var BackupLedgerError = class extends NoydbError {
220
+ /** First-broken-entry index, if known. */
221
+ divergedAt;
222
+ constructor(message, divergedAt) {
223
+ super("BACKUP_LEDGER", message);
224
+ this.name = "BackupLedgerError";
225
+ if (divergedAt !== void 0) this.divergedAt = divergedAt;
226
+ }
227
+ };
228
+ var BackupCorruptedError = class extends NoydbError {
229
+ /** The (collection, id) pair whose envelope failed the hash check. */
230
+ collection;
231
+ id;
232
+ constructor(collection, id, message) {
233
+ super("BACKUP_CORRUPTED", message);
234
+ this.name = "BackupCorruptedError";
235
+ this.collection = collection;
236
+ this.id = id;
237
+ }
238
+ };
169
239
 
170
240
  // src/bundle/bundle.ts
241
+ function toAutoCredentials(m) {
242
+ return Object.fromEntries(
243
+ Object.entries(m).map(([u, value]) => [u, { kind: "passphrase", value }])
244
+ );
245
+ }
246
+ function normalizeAutoUnlock(opts) {
247
+ const set = [
248
+ opts.autoCredentials,
249
+ opts.sealedCredentials,
250
+ opts.autoPassphrases,
251
+ opts.sealedPassphrases
252
+ ].filter((v) => v !== void 0).length;
253
+ if (set === 0) return null;
254
+ if (set > 1) {
255
+ throw new ValidationError(
256
+ "writeNoydbBundle: only one of autoCredentials / sealedCredentials / autoPassphrases / sealedPassphrases may be set."
257
+ );
258
+ }
259
+ if (opts.autoCredentials !== void 0) {
260
+ return { mode: "unsealed", perUser: opts.autoCredentials.perUser };
261
+ }
262
+ if (opts.autoPassphrases !== void 0) {
263
+ return { mode: "unsealed", perUser: toAutoCredentials(opts.autoPassphrases.perUser) };
264
+ }
265
+ if (opts.sealedCredentials !== void 0) {
266
+ return { mode: "sealed", provider: opts.sealedCredentials.provider, perUser: opts.sealedCredentials.perUser };
267
+ }
268
+ return {
269
+ mode: "sealed",
270
+ provider: opts.sealedPassphrases.provider,
271
+ perUser: toAutoCredentials(opts.sealedPassphrases.perUser)
272
+ };
273
+ }
274
+ function validateAutoUnlockOptions(opts, normalized) {
275
+ if (normalized === null) return null;
276
+ const VALID_KINDS = /* @__PURE__ */ new Set(["passphrase", "password", "pin"]);
277
+ for (const [userId, cred] of Object.entries(normalized.perUser)) {
278
+ if (!VALID_KINDS.has(cred.kind)) {
279
+ throw new ValidationError(
280
+ `writeNoydbBundle: credential for user '${userId}' has unsupported kind '${cred.kind}'. auto-unlock supports passphrase/password/pin only; WebAuthn is hardware-bound and cannot be bundled.`
281
+ );
282
+ }
283
+ }
284
+ if (normalized.mode === "unsealed") {
285
+ const policy = opts.autoCredentials?.policy ?? opts.autoPassphrases?.policy;
286
+ if (policy !== "public-by-design") {
287
+ throw new ValidationError(
288
+ 'writeNoydbBundle: `autoCredentials` (or `autoPassphrases`) requires `policy: "public-by-design"`. This is an explicit opt-in marker \u2014 bundling plaintext credentials is safe only when those credentials are intended to be public (demo data, sample vaults). For production credentials, use `sealedCredentials` instead.'
289
+ );
290
+ }
291
+ const userCount2 = Object.keys(normalized.perUser).length;
292
+ if (userCount2 === 0) {
293
+ throw new ValidationError(
294
+ "writeNoydbBundle: `autoCredentials.perUser` (or `autoPassphrases.perUser`) must have at least one entry."
295
+ );
296
+ }
297
+ return "unsealed";
298
+ }
299
+ const mode = opts.sealedCredentials?.mode ?? opts.sealedPassphrases?.mode;
300
+ if (mode !== "self-target") {
301
+ throw new ValidationError(
302
+ `writeNoydbBundle: \`sealedCredentials.mode\` (or \`sealedPassphrases.mode\`) must be 'self-target' in slice 1 (got '${String(mode)}'). Recipient-target sealing via the RecipientSealer interface is deferred per foundation \xA711.4.`
303
+ );
304
+ }
305
+ if (normalized.provider === void 0) {
306
+ throw new ValidationError(
307
+ "writeNoydbBundle: `sealedCredentials.provider` (or `sealedPassphrases.provider`) is required (a `SealingKeyProvider`)."
308
+ );
309
+ }
310
+ const userCount = Object.keys(normalized.perUser).length;
311
+ if (userCount === 0) {
312
+ throw new ValidationError(
313
+ "writeNoydbBundle: `sealedCredentials.perUser` (or `sealedPassphrases.perUser`) must have at least one entry."
314
+ );
315
+ }
316
+ return "sealed";
317
+ }
318
+ async function buildAutoUnlockWrapper(dumpJson, normalized) {
319
+ if (normalized.mode === "unsealed") {
320
+ return {
321
+ _noydb_bundle_body: 1,
322
+ dump: dumpJson,
323
+ _autoUnlock: {
324
+ kind: "unsealed",
325
+ perUser: { ...normalized.perUser }
326
+ }
327
+ };
328
+ }
329
+ const provider = normalized.provider;
330
+ if (provider === void 0) {
331
+ throw new Error("unreachable \u2014 validation should have caught this");
332
+ }
333
+ const sealedPerUser = {};
334
+ const encoder = new TextEncoder();
335
+ for (const [userId, cred] of Object.entries(normalized.perUser)) {
336
+ const sealed = await provider.seal(encoder.encode(cred.value));
337
+ sealedPerUser[userId] = {
338
+ pid: provider.id,
339
+ sealed: bytesToBase64(sealed),
340
+ alg: "aes-256-gcm",
341
+ kind: cred.kind
342
+ };
343
+ }
344
+ return {
345
+ _noydb_bundle_body: 1,
346
+ dump: dumpJson,
347
+ _autoUnlock: { kind: "sealed", perUser: sealedPerUser }
348
+ };
349
+ }
350
+ function parseAutoUnlockBody(bodyString) {
351
+ let parsed;
352
+ try {
353
+ parsed = JSON.parse(bodyString);
354
+ } catch (err) {
355
+ throw new BundleIntegrityError(
356
+ "header declared autoUnlock but body could not be parsed as JSON wrapper: " + (err instanceof Error ? err.message : String(err))
357
+ );
358
+ }
359
+ if (typeof parsed !== "object" || parsed === null) {
360
+ throw new BundleIntegrityError("autoUnlock body is not a JSON object");
361
+ }
362
+ const obj = parsed;
363
+ if (obj["_noydb_bundle_body"] !== 1) {
364
+ throw new BundleIntegrityError(
365
+ "autoUnlock body missing `_noydb_bundle_body: 1` discriminator"
366
+ );
367
+ }
368
+ if (typeof obj["dump"] !== "string") {
369
+ throw new BundleIntegrityError("autoUnlock body must carry a string `dump` field");
370
+ }
371
+ const blob = obj["_autoUnlock"];
372
+ if (typeof blob !== "object" || blob === null) {
373
+ throw new BundleIntegrityError("autoUnlock body missing `_autoUnlock` blob");
374
+ }
375
+ const blobObj = blob;
376
+ const kind = blobObj["kind"];
377
+ if (kind !== "unsealed" && kind !== "sealed") {
378
+ throw new BundleIntegrityError(
379
+ `autoUnlock blob has invalid kind ${String(kind)}; expected 'unsealed' or 'sealed'`
380
+ );
381
+ }
382
+ return {
383
+ dump: obj["dump"],
384
+ blob
385
+ };
386
+ }
387
+ function coerceUnsealed(entry) {
388
+ if (typeof entry === "string") return { kind: "passphrase", value: entry };
389
+ return entry;
390
+ }
391
+ async function resolveAutoUnlock(blob, opts) {
392
+ if (blob.kind === "unsealed") {
393
+ const resolved = {};
394
+ for (const [userId, entry] of Object.entries(blob.perUser)) {
395
+ resolved[userId] = coerceUnsealed(entry);
396
+ }
397
+ return { kind: "unsealed", perUser: resolved };
398
+ }
399
+ if (opts.sealingProviders === void 0 || opts.sealingProviders.length === 0) {
400
+ const passthrough = {};
401
+ for (const [userId, entry] of Object.entries(blob.perUser)) {
402
+ passthrough[userId] = { kind: entry.kind ?? "passphrase", value: entry.sealed };
403
+ }
404
+ return { kind: "sealed", perUser: passthrough };
405
+ }
406
+ const providersByPid = /* @__PURE__ */ new Map();
407
+ for (const p of opts.sealingProviders) providersByPid.set(p.id, p);
408
+ const decoder = new TextDecoder();
409
+ const unsealedMap = {};
410
+ for (const [userId, entry] of Object.entries(blob.perUser)) {
411
+ const credKind = entry.kind ?? "passphrase";
412
+ const provider = providersByPid.get(entry.pid);
413
+ if (provider === void 0) {
414
+ if (opts.attemptUnsealAcrossProviders === true) {
415
+ let opened = null;
416
+ for (const candidate of opts.sealingProviders) {
417
+ try {
418
+ const plaintextBytes2 = await candidate.unseal(base64ToBytes(entry.sealed));
419
+ opened = decoder.decode(plaintextBytes2);
420
+ break;
421
+ } catch {
422
+ }
423
+ }
424
+ if (opened === null) {
425
+ throw new BundleSealMismatchError(userId, entry.pid);
426
+ }
427
+ unsealedMap[userId] = { kind: credKind, value: opened };
428
+ continue;
429
+ }
430
+ throw new BundleSealMismatchError(userId, entry.pid);
431
+ }
432
+ const plaintextBytes = await provider.unseal(base64ToBytes(entry.sealed));
433
+ unsealedMap[userId] = { kind: credKind, value: decoder.decode(plaintextBytes) };
434
+ }
435
+ return { kind: "sealed", perUser: unsealedMap };
436
+ }
437
+ function bytesToBase64(bytes) {
438
+ let binary = "";
439
+ for (let i = 0; i < bytes.length; i++) binary += String.fromCharCode(bytes[i]);
440
+ return btoa(binary);
441
+ }
442
+ function base64ToBytes(b64) {
443
+ const binary = atob(b64);
444
+ const out = new Uint8Array(binary.length);
445
+ for (let i = 0; i < binary.length; i++) out[i] = binary.charCodeAt(i);
446
+ return out;
447
+ }
171
448
  var cachedBrotliSupport = null;
172
449
  function supportsBrotliCompression() {
173
450
  if (cachedBrotliSupport !== null) return cachedBrotliSupport;
@@ -323,12 +600,15 @@ async function writeNoydbBundle(vault, opts = {}) {
323
600
  "writeNoydbBundle: pass either exportPassphrase or recipients, not both"
324
601
  );
325
602
  }
603
+ const normalizedAutoUnlock = normalizeAutoUnlock(opts);
604
+ const autoUnlockMode = validateAutoUnlockOptions(opts, normalizedAutoUnlock);
326
605
  const handle = await vault.getBundleHandle();
327
606
  const dumpJson = await vault.dump();
328
607
  const rekeyed = await applyRecipientRewrap(vault, dumpJson, opts);
329
608
  const plainFiltered = await applyPlaintextFilters(vault, rekeyed, opts);
330
609
  const filtered = applySliceFilters(plainFiltered, opts);
331
- const dumpBytes = new TextEncoder().encode(filtered);
610
+ const bodyJsonStr = normalizedAutoUnlock === null ? filtered : JSON.stringify(await buildAutoUnlockWrapper(filtered, normalizedAutoUnlock));
611
+ const dumpBytes = new TextEncoder().encode(bodyJsonStr);
332
612
  const { format, streamFormat } = selectCompression(opts.compression);
333
613
  const body = streamFormat === null ? dumpBytes : await pumpThroughStream(dumpBytes, new CompressionStream(streamFormat));
334
614
  const bodySha256 = await sha256Hex(body);
@@ -338,7 +618,8 @@ async function writeNoydbBundle(vault, opts = {}) {
338
618
  handle,
339
619
  bodyBytes: body.length,
340
620
  bodySha256,
341
- ...publicEnvelope !== void 0 ? { publicEnvelope } : {}
621
+ ...publicEnvelope !== void 0 ? { publicEnvelope } : {},
622
+ ...autoUnlockMode !== null ? { autoUnlock: autoUnlockMode } : {}
342
623
  };
343
624
  const headerBytes = encodeBundleHeader(header);
344
625
  const prefix = new Uint8Array(NOYDB_BUNDLE_PREFIX_BYTES);
@@ -380,7 +661,7 @@ function parsePrefixAndHeader(bytes) {
380
661
  function readNoydbBundleHeader(bytes) {
381
662
  return parsePrefixAndHeader(bytes).header;
382
663
  }
383
- async function readNoydbBundle(bytes) {
664
+ async function readNoydbBundle(bytes, opts = {}) {
384
665
  const { header, bodyOffset, algo } = parsePrefixAndHeader(bytes);
385
666
  const body = bytes.slice(bodyOffset);
386
667
  if (body.length !== header.bodyBytes) {
@@ -407,8 +688,13 @@ async function readNoydbBundle(bytes) {
407
688
  );
408
689
  }
409
690
  }
410
- const dumpJson = new TextDecoder("utf-8", { fatal: true }).decode(dumpBytes);
411
- return { header, dumpJson };
691
+ const bodyString = new TextDecoder("utf-8", { fatal: true }).decode(dumpBytes);
692
+ if (header.autoUnlock === void 0) {
693
+ return { header, dumpJson: bodyString };
694
+ }
695
+ const { dump, blob } = parseAutoUnlockBody(bodyString);
696
+ const autoUnlock = await resolveAutoUnlock(blob, opts);
697
+ return { header, dumpJson: dump, autoUnlock };
412
698
  }
413
699
 
414
700
  // src/bundle/ulid.ts
@@ -439,6 +725,11 @@ function isULID(value) {
439
725
  }
440
726
  // Annotate the CommonJS export names for ESM import in node:
441
727
  0 && (module.exports = {
728
+ BackupCorruptedError,
729
+ BackupLedgerError,
730
+ BundleIntegrityError,
731
+ BundleSealMismatchError,
732
+ BundleVersionConflictError,
442
733
  COMPRESSION_BROTLI,
443
734
  COMPRESSION_GZIP,
444
735
  COMPRESSION_NONE,