@noy-db/hub 0.6.0-pre.2 → 0.6.0-pre.21

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 (499) hide show
  1. package/CHANGELOG.md +5234 -0
  2. package/codemods/0.4.0-pre.json +699 -0
  3. package/codemods/0.6.0-pre.json +211 -0
  4. package/dist/api-EYNT6KGS.js +20 -0
  5. package/dist/attestation/index.js +19 -19
  6. package/dist/{backup-YYBE5RPC.js → backup-FSC36VWC.js} +36 -18
  7. package/dist/backup-FSC36VWC.js.map +1 -0
  8. package/dist/blobs/index.js +13 -13
  9. package/dist/broker/index.js +12 -12
  10. package/dist/cargo/index.js +33 -33
  11. package/dist/{chunk-35EBKWQU.js → chunk-2LFOMUEA.js} +4 -4
  12. package/dist/{chunk-OF3L2SD6.js → chunk-32B7VCKU.js} +2 -2
  13. package/dist/{chunk-MSWYQLMQ.js → chunk-3B6S6RSI.js} +2 -2
  14. package/dist/{chunk-PJNTR2NV.js → chunk-3ENNPCIW.js} +7 -10
  15. package/dist/chunk-3ENNPCIW.js.map +1 -0
  16. package/dist/{chunk-7F4DBNSP.js → chunk-3O72ZD2E.js} +3 -3
  17. package/dist/{chunk-FNSMZQS4.js → chunk-3PMFMUFX.js} +2 -2
  18. package/dist/{chunk-WQDTCJ6W.js → chunk-45YHJ3GV.js} +11 -3
  19. package/dist/{chunk-WQDTCJ6W.js.map → chunk-45YHJ3GV.js.map} +1 -1
  20. package/dist/{chunk-NIVEDYJZ.js → chunk-4A34KWOU.js} +31 -49
  21. package/dist/chunk-4A34KWOU.js.map +1 -0
  22. package/dist/{chunk-ZJADGNYF.js → chunk-4AOERLTV.js} +1 -1
  23. package/dist/chunk-4AOERLTV.js.map +1 -0
  24. package/dist/{chunk-EDXAQ6JI.js → chunk-4N5Q23KV.js} +87 -34
  25. package/dist/chunk-4N5Q23KV.js.map +1 -0
  26. package/dist/{chunk-VV4NSB7P.js → chunk-4OQZNXQG.js} +15 -24
  27. package/dist/chunk-4OQZNXQG.js.map +1 -0
  28. package/dist/{chunk-FAXZQ5UF.js → chunk-4RAS6HN6.js} +2 -2
  29. package/dist/{chunk-C2OOEM57.js → chunk-4YL2LMXK.js} +92 -35
  30. package/dist/chunk-4YL2LMXK.js.map +1 -0
  31. package/dist/{chunk-EP7VPR7Y.js → chunk-5Q7AJ7DN.js} +11 -8
  32. package/dist/chunk-5Q7AJ7DN.js.map +1 -0
  33. package/dist/{chunk-VMCCGUQB.js → chunk-6JPGVL7X.js} +2 -2
  34. package/dist/{chunk-PRDRGL73.js → chunk-6KTVJ5ZZ.js} +17 -14
  35. package/dist/chunk-6KTVJ5ZZ.js.map +1 -0
  36. package/dist/{chunk-4MC5JRRX.js → chunk-6WO62AJW.js} +14 -15
  37. package/dist/chunk-6WO62AJW.js.map +1 -0
  38. package/dist/{chunk-WLYIROCJ.js → chunk-6YD5SYQS.js} +2 -2
  39. package/dist/{chunk-YAWK6AWF.js → chunk-7KAE7CQ2.js} +2 -2
  40. package/dist/{chunk-MWKDOHEF.js → chunk-7LNE2N2V.js} +17 -10
  41. package/dist/chunk-7LNE2N2V.js.map +1 -0
  42. package/dist/{chunk-5PR33AC4.js → chunk-7PJ3BKHS.js} +20 -17
  43. package/dist/chunk-7PJ3BKHS.js.map +1 -0
  44. package/dist/{chunk-JXIDGFKS.js → chunk-A4TOGAUW.js} +4 -2
  45. package/dist/chunk-A4TOGAUW.js.map +1 -0
  46. package/dist/{chunk-VCETL77O.js → chunk-AU3AUJIZ.js} +27 -7
  47. package/dist/chunk-AU3AUJIZ.js.map +1 -0
  48. package/dist/{chunk-NKH7GSIH.js → chunk-AUPSEJ7O.js} +4 -4
  49. package/dist/{chunk-CCZJJ4I2.js → chunk-B6IYATME.js} +4 -4
  50. package/dist/{chunk-WYZ5MYUA.js → chunk-BAHOV5I5.js} +44 -42
  51. package/dist/chunk-BAHOV5I5.js.map +1 -0
  52. package/dist/{chunk-G5APARUV.js → chunk-BEZDLIDG.js} +13 -15
  53. package/dist/chunk-BEZDLIDG.js.map +1 -0
  54. package/dist/{chunk-ERB6NDDW.js → chunk-CAGI4LLJ.js} +427 -72
  55. package/dist/chunk-CAGI4LLJ.js.map +1 -0
  56. package/dist/{chunk-4UVDI4XE.js → chunk-CLAHBPOI.js} +4 -4
  57. package/dist/{chunk-HNGSV2YC.js → chunk-CWM4GQD2.js} +39 -10
  58. package/dist/chunk-CWM4GQD2.js.map +1 -0
  59. package/dist/{chunk-HVQGCKY4.js → chunk-D3R7Q4QK.js} +2 -2
  60. package/dist/{chunk-I4F6PKUK.js → chunk-DIZ6HM7Q.js} +16 -17
  61. package/dist/chunk-DIZ6HM7Q.js.map +1 -0
  62. package/dist/{chunk-ZNACADFG.js → chunk-DVRZYAGT.js} +4 -4
  63. package/dist/chunk-DVRZYAGT.js.map +1 -0
  64. package/dist/{chunk-P7OG2ETF.js → chunk-DXKLLKME.js} +3 -3
  65. package/dist/{chunk-TDJPS3T2.js → chunk-E5SC6ENM.js} +24 -19
  66. package/dist/chunk-E5SC6ENM.js.map +1 -0
  67. package/dist/{chunk-26JMGSSC.js → chunk-EES37S2V.js} +4 -4
  68. package/dist/chunk-EES37S2V.js.map +1 -0
  69. package/dist/{chunk-JIUVJ4M7.js → chunk-EKEIEJL6.js} +2 -2
  70. package/dist/{chunk-GASWQ3XG.js → chunk-ESKIAXO2.js} +15 -16
  71. package/dist/chunk-ESKIAXO2.js.map +1 -0
  72. package/dist/{chunk-TOAIYQJR.js → chunk-FFSQFH6D.js} +7 -10
  73. package/dist/chunk-FFSQFH6D.js.map +1 -0
  74. package/dist/{chunk-DG27IUVI.js → chunk-FS7NTGCJ.js} +2 -2
  75. package/dist/{chunk-V5KYPBUR.js → chunk-FW7NGYLT.js} +11 -14
  76. package/dist/chunk-FW7NGYLT.js.map +1 -0
  77. package/dist/{chunk-52QYGZHH.js → chunk-GBBDFE6C.js} +2 -2
  78. package/dist/chunk-GBBDFE6C.js.map +1 -0
  79. package/dist/{chunk-HXGUIPQB.js → chunk-GQXFOAYZ.js} +3 -3
  80. package/dist/{chunk-BTVYJWSN.js → chunk-GTHVPVAR.js} +10 -10
  81. package/dist/{chunk-DMQCLZ4Z.js → chunk-GWO2IDAB.js} +2 -2
  82. package/dist/{chunk-6HFM7EIT.js → chunk-H3G4I3PN.js} +2 -2
  83. package/dist/chunk-HK67PX4J.js +27 -0
  84. package/dist/chunk-HK67PX4J.js.map +1 -0
  85. package/dist/{chunk-E7OBCBXS.js → chunk-HQSPF5IY.js} +22 -18
  86. package/dist/chunk-HQSPF5IY.js.map +1 -0
  87. package/dist/{chunk-VJFMXYKP.js → chunk-HR5R5JOM.js} +2 -2
  88. package/dist/{chunk-FDX7OWWI.js → chunk-HYYVT2KZ.js} +2 -2
  89. package/dist/{chunk-JRCYZEHU.js → chunk-I6QKB7MT.js} +2 -2
  90. package/dist/{chunk-MZ5ZFO2D.js → chunk-ICDHUUMQ.js} +84 -112
  91. package/dist/chunk-ICDHUUMQ.js.map +1 -0
  92. package/dist/{chunk-W5W6KHN2.js → chunk-IGNJOJEP.js} +1 -1
  93. package/dist/chunk-IGNJOJEP.js.map +1 -0
  94. package/dist/{chunk-KUDZVJKQ.js → chunk-IJ46VCWD.js} +2 -2
  95. package/dist/{chunk-4HDYQL3J.js → chunk-INMHEMXX.js} +2 -2
  96. package/dist/{chunk-66W5OOCX.js → chunk-JLYQQNY4.js} +52 -65
  97. package/dist/chunk-JLYQQNY4.js.map +1 -0
  98. package/dist/{chunk-UHXCLPGC.js → chunk-JNMTN5D5.js} +2 -2
  99. package/dist/chunk-JNMTN5D5.js.map +1 -0
  100. package/dist/{chunk-I4ZAO7F7.js → chunk-JWMBG5S3.js} +7 -11
  101. package/dist/chunk-JWMBG5S3.js.map +1 -0
  102. package/dist/chunk-KRVS7YWY.js +123 -0
  103. package/dist/chunk-KRVS7YWY.js.map +1 -0
  104. package/dist/{chunk-AR2JDFAE.js → chunk-KV6JM2IA.js} +2 -2
  105. package/dist/{chunk-PVU7LW5L.js → chunk-KX57HODD.js} +6 -6
  106. package/dist/{chunk-PY7CI6L5.js → chunk-LGFTOU27.js} +553 -275
  107. package/dist/chunk-LGFTOU27.js.map +1 -0
  108. package/dist/chunk-LN7P6MZB.js +190 -0
  109. package/dist/chunk-LN7P6MZB.js.map +1 -0
  110. package/dist/{chunk-UIBGXRDD.js → chunk-LX46B56Q.js} +25 -31
  111. package/dist/chunk-LX46B56Q.js.map +1 -0
  112. package/dist/{chunk-CEJWMBXO.js → chunk-LXECF2ZR.js} +2 -2
  113. package/dist/{chunk-7VHY5E3X.js → chunk-MSLPDFK2.js} +7 -7
  114. package/dist/{chunk-I6SDX7WX.js → chunk-MZTUTEHP.js} +16 -22
  115. package/dist/chunk-MZTUTEHP.js.map +1 -0
  116. package/dist/{chunk-VRA4Q7DA.js → chunk-NCCEDL2K.js} +55 -48
  117. package/dist/chunk-NCCEDL2K.js.map +1 -0
  118. package/dist/{chunk-HNHCQ556.js → chunk-NR2SUJ3H.js} +2 -2
  119. package/dist/{chunk-AHLJSVRL.js → chunk-NW4TY6VC.js} +5 -7
  120. package/dist/chunk-NW4TY6VC.js.map +1 -0
  121. package/dist/{chunk-RKKORO4M.js → chunk-O742QBZZ.js} +10 -10
  122. package/dist/chunk-O742QBZZ.js.map +1 -0
  123. package/dist/{chunk-VN45YLWM.js → chunk-OHOKBMTM.js} +343 -132
  124. package/dist/chunk-OHOKBMTM.js.map +1 -0
  125. package/dist/{chunk-W3TVWF6N.js → chunk-OIBEJN5H.js} +2 -2
  126. package/dist/{chunk-QD724WDJ.js → chunk-OMYCSTXL.js} +4 -4
  127. package/dist/{chunk-Z45YRGFO.js → chunk-ONVD6GBY.js} +2 -2
  128. package/dist/{chunk-TAGFGKHP.js → chunk-OTHHO3KI.js} +7 -10
  129. package/dist/chunk-OTHHO3KI.js.map +1 -0
  130. package/dist/{chunk-3737A6EA.js → chunk-P2MR5UNE.js} +75 -18
  131. package/dist/chunk-P2MR5UNE.js.map +1 -0
  132. package/dist/chunk-PENPHA45.js +66 -0
  133. package/dist/chunk-PENPHA45.js.map +1 -0
  134. package/dist/{chunk-3FSX6LDG.js → chunk-PPCOKVFA.js} +8 -3
  135. package/dist/{chunk-3FSX6LDG.js.map → chunk-PPCOKVFA.js.map} +1 -1
  136. package/dist/{chunk-VOQW5LAM.js → chunk-QSIEL6TL.js} +102 -71
  137. package/dist/chunk-QSIEL6TL.js.map +1 -0
  138. package/dist/chunk-RFO4UXKQ.js +201 -0
  139. package/dist/chunk-RFO4UXKQ.js.map +1 -0
  140. package/dist/{chunk-KCQX65FU.js → chunk-RKCRPPNB.js} +3 -3
  141. package/dist/{chunk-7TSYBD3E.js → chunk-RSXQNFGO.js} +2 -2
  142. package/dist/{chunk-SZ2K3MHL.js → chunk-S56VYR4Q.js} +8 -11
  143. package/dist/{chunk-SZ2K3MHL.js.map → chunk-S56VYR4Q.js.map} +1 -1
  144. package/dist/{chunk-7NXHMW6Y.js → chunk-SYS46BL7.js} +2 -2
  145. package/dist/{chunk-55LKVALY.js → chunk-T7IR4N2S.js} +1 -3
  146. package/dist/chunk-T7IR4N2S.js.map +1 -0
  147. package/dist/{chunk-A67356IR.js → chunk-T7JGWTES.js} +33 -8
  148. package/dist/chunk-T7JGWTES.js.map +1 -0
  149. package/dist/{chunk-WHJKIZS7.js → chunk-TDSN2O2V.js} +27 -149
  150. package/dist/chunk-TDSN2O2V.js.map +1 -0
  151. package/dist/{chunk-747LRSOO.js → chunk-TMBSPLUG.js} +2 -2
  152. package/dist/{chunk-LWSJG3LI.js → chunk-TQPASLY4.js} +7 -3
  153. package/dist/chunk-TQPASLY4.js.map +1 -0
  154. package/dist/{chunk-WKPJXWKR.js → chunk-TX5MKAHA.js} +3 -3
  155. package/dist/{chunk-HFQ6LGIO.js → chunk-U27Y4DJZ.js} +12 -10
  156. package/dist/{chunk-HFQ6LGIO.js.map → chunk-U27Y4DJZ.js.map} +1 -1
  157. package/dist/{chunk-E6427JU2.js → chunk-VVSOPRUE.js} +18 -2
  158. package/dist/chunk-VVSOPRUE.js.map +1 -0
  159. package/dist/{chunk-7G6VDWXB.js → chunk-WVE6YKMX.js} +3 -3
  160. package/dist/chunk-WVE6YKMX.js.map +1 -0
  161. package/dist/{chunk-GLKDWWNO.js → chunk-YALD3SST.js} +16 -14
  162. package/dist/chunk-YALD3SST.js.map +1 -0
  163. package/dist/{chunk-NJDQ4YSV.js → chunk-YKXZHUOW.js} +4 -4
  164. package/dist/{chunk-VW6ZZGCG.js → chunk-ZLHHE5XZ.js} +3 -3
  165. package/dist/{chunk-FUHKW252.js → chunk-ZZXLB6AS.js} +2 -2
  166. package/dist/classified/index.js +5 -5
  167. package/dist/{classified-marker-FTOX7Q5L.js → classified-marker-NA6HUV33.js} +3 -3
  168. package/dist/collection-facade-VBM35WAH.js +45 -0
  169. package/dist/{computed-6G5M3UPH.js → computed-GSTLWSY5.js} +3 -3
  170. package/dist/consent/index.js +10 -10
  171. package/dist/cover/index.js +10 -3
  172. package/dist/custody/index.js +11 -11
  173. package/dist/{dead-filter-ENRIOQIE.js → dead-filter-UALP5DJX.js} +2 -2
  174. package/dist/debug/index.js +1 -1
  175. package/dist/{delegation-SSEPLXXO.js → delegation-JLNXM7KH.js} +24 -23
  176. package/dist/delegation-JLNXM7KH.js.map +1 -0
  177. package/dist/derivations/index.js +12 -12
  178. package/dist/derive-YUO3TQYN.js +22 -0
  179. package/dist/directory/index.js +10 -10
  180. package/dist/{dispatch-RE74SH6L.js → dispatch-4ZHLSFZQ.js} +5 -5
  181. package/dist/{dispatch-BDVGYC6X.js → dispatch-77CB75KB.js} +18 -18
  182. package/dist/{enclave-52VUXNRL.js → enclave-O4NOROCJ.js} +27 -9
  183. package/dist/executor-CZDXBXKE.js +29 -0
  184. package/dist/executor-DVJAWN3B.js +9 -0
  185. package/dist/executor-VRLG4TQJ.js +9 -0
  186. package/dist/export-accessible-UXSMG7AB.js +23 -0
  187. package/dist/extract-partition-TVY7AMKH.js +38 -0
  188. package/dist/{fanout-sidecar-DTBIDOWF.js → fanout-sidecar-NLQ7QAYW.js} +18 -27
  189. package/dist/fanout-sidecar-NLQ7QAYW.js.map +1 -0
  190. package/dist/find-WSARMJBW.js +11 -0
  191. package/dist/forget/index.js +9 -9
  192. package/dist/guards/index.js +7 -7
  193. package/dist/history/index.js +23 -20
  194. package/dist/history/index.js.map +1 -1
  195. package/dist/i18n/index.js +14 -14
  196. package/dist/index.d.ts +33 -15
  197. package/dist/index.js +187 -191
  198. package/dist/index.js.map +1 -1
  199. package/dist/indexing/index.js +2 -2
  200. package/dist/introspection/index.js +11 -11
  201. package/dist/issue-3JNJNPT3.js +19 -0
  202. package/dist/kernel/constants.d.ts +18 -0
  203. package/dist/kernel/enclave/crypto.d.ts +24 -4
  204. package/dist/kernel/enclave/index.d.ts +9 -2
  205. package/dist/kernel/enclave/record-aad.d.ts +131 -0
  206. package/dist/kernel/enclave/record-envelope.d.ts +76 -0
  207. package/dist/kernel/enclave/record-keys/envelope-body.d.ts +34 -2
  208. package/dist/kernel/enclave/record-keys/lifecycle.d.ts +22 -5
  209. package/dist/kernel/enclave/record-keys/record-codec.d.ts +47 -14
  210. package/dist/kernel/enclave/record-keys/rekey-blob.d.ts +88 -0
  211. package/dist/kernel/enclave/record-keys/rekey.d.ts +68 -0
  212. package/dist/kernel/enclave/record-keys/tombstone.d.ts +3 -2
  213. package/dist/kernel/errors.d.ts +71 -12
  214. package/dist/kernel/merge-authority.d.ts +25 -0
  215. package/dist/kernel/noydb.d.ts +27 -4
  216. package/dist/kernel/query/builder.d.ts +15 -2
  217. package/dist/kernel/query/join.d.ts +27 -0
  218. package/dist/kernel/sync-policy.d.ts +0 -2
  219. package/dist/kernel/tier-visibility.d.ts +15 -0
  220. package/dist/kernel/types.d.ts +145 -12
  221. package/dist/kernel/vault.d.ts +22 -18
  222. package/dist/kernel/via/index.d.ts +11 -2
  223. package/dist/{ledger-4WJL66BW.js → ledger-MVPNG5OS.js} +11 -11
  224. package/dist/liberate-4LOJOLDT.js +24 -0
  225. package/dist/{link-set-N4ZPV6E6.js → link-set-3POMQR3I.js} +11 -11
  226. package/dist/{managed-secret-OTHS64IF.js → managed-secret-IARIJJ7Q.js} +11 -3
  227. package/dist/materialized-views/index.js +22 -21
  228. package/dist/migrate-cek-XM2ETTZW.js +19 -0
  229. package/dist/migrate-cek-XM2ETTZW.js.map +1 -0
  230. package/dist/money/index.js +12 -8
  231. package/dist/noydb-IRILUDED.js +84 -0
  232. package/dist/overlay-views/index.js +4 -4
  233. package/dist/periods/index.js +22 -12
  234. package/dist/pod/index.js +75 -86
  235. package/dist/pod-handle-MELERCKU.js +41 -0
  236. package/dist/pod-handle-MELERCKU.js.map +1 -0
  237. package/dist/policy/index.js +11 -4
  238. package/dist/port/to/index.d.ts +4 -4
  239. package/dist/port/to/locator.d.ts +54 -8
  240. package/dist/port/with/i18n-strategy.d.ts +4 -1
  241. package/dist/port/with/lookup-strategy.d.ts +4 -1
  242. package/dist/port/with/merge-authority.d.ts +52 -0
  243. package/dist/port/with/service-bus.d.ts +0 -4
  244. package/dist/port/with/strategies.d.ts +2 -0
  245. package/dist/port/with/team-strategy.d.ts +5 -1
  246. package/dist/portability/index.js +8 -8
  247. package/dist/{post-register-ZAG2CAIY.js → post-register-Z5T7FY45.js} +6 -6
  248. package/dist/query/index.js +3 -3
  249. package/dist/reduce/index.js +4 -4
  250. package/dist/register-UZ37QPDB.js +32 -0
  251. package/dist/registry-ETJNA7PO.js +9 -0
  252. package/dist/registry-F7U6KSLX.js +9 -0
  253. package/dist/registry-L4ELKX6C.js +18 -0
  254. package/dist/registry-SDT5LIGO.js +19 -0
  255. package/dist/request-withdrawal-PVFEYX57.js +31 -0
  256. package/dist/{reveal-CMOJY4VO.js → reveal-DQ2E3QAZ.js} +6 -6
  257. package/dist/revoke-YXY6SHUH.js +24 -0
  258. package/dist/satellites/index.js +1 -1
  259. package/dist/schema-update/index.js +2 -2
  260. package/dist/sealed-record/index.js +20 -13
  261. package/dist/sealed-record/index.js.map +1 -1
  262. package/dist/search/index.js +4 -4
  263. package/dist/{seed-UK4QRIUN.js → seed-DZ4ORU5N.js} +19 -22
  264. package/dist/seed-DZ4ORU5N.js.map +1 -0
  265. package/dist/sequence/index.js +9 -9
  266. package/dist/session/index.js +10 -10
  267. package/dist/shadow/index.js +2 -2
  268. package/dist/share-link/index.js +1 -1
  269. package/dist/signer-Q7XQBMPA.js +25 -0
  270. package/dist/snapshots/index.js +10 -10
  271. package/dist/snapshots/index.js.map +1 -1
  272. package/dist/{stale-ZWXSOWJI.js → stale-NI7SAXAZ.js} +10 -10
  273. package/dist/storage-3VNGSHXS.js +23 -0
  274. package/dist/{store-coordination-provider-PB6QZ57W.js → store-coordination-provider-TYKNR3OU.js} +18 -12
  275. package/dist/store-coordination-provider-TYKNR3OU.js.map +1 -0
  276. package/dist/sync/index.js +11 -11
  277. package/dist/team/index.js +15 -14
  278. package/dist/tiers/index.js +11 -10
  279. package/dist/to/index.js +17 -9
  280. package/dist/to/index.js.map +1 -1
  281. package/dist/transactions/index.js +4 -4
  282. package/dist/{ulid-PTAIMDG4.js → ulid-VQW6ERQN.js} +2 -2
  283. package/dist/util/index.js +1 -1
  284. package/dist/vault-head/index.js +115 -0
  285. package/dist/vault-head/index.js.map +1 -0
  286. package/dist/{verify-RO5RTZOJ.js → verify-6J2YLKSO.js} +5 -5
  287. package/dist/via/lookup/handle.d.ts +4 -1
  288. package/dist/via/money/exact.d.ts +44 -0
  289. package/dist/via/money/index.d.ts +2 -0
  290. package/dist/via/money/normalize.d.ts +20 -0
  291. package/dist/walk-WRA7RAPY.js +21 -0
  292. package/dist/with-audit/guards/immutable-guard.d.ts +14 -0
  293. package/dist/with-audit/periods/active.d.ts +28 -1
  294. package/dist/with-audit/periods/index.d.ts +4 -2
  295. package/dist/with-audit/periods/periods.d.ts +161 -6
  296. package/dist/with-audit/periods/strategy.d.ts +14 -5
  297. package/dist/with-audit/periods/vault-facade.d.ts +89 -10
  298. package/dist/with-audit/periods/window.d.ts +10 -0
  299. package/dist/with-audit/sealed-record/index.d.ts +13 -0
  300. package/dist/with-audit/tiers/index.d.ts +17 -2
  301. package/dist/with-cargo/adopt-partition.d.ts +1 -1
  302. package/dist/with-cargo/extract-partition.d.ts +1 -1
  303. package/dist/with-cargo/index.d.ts +2 -2
  304. package/dist/with-commit/history/history.d.ts +26 -0
  305. package/dist/with-commit/history/index.d.ts +2 -1
  306. package/dist/with-commit/history/ledger/store.d.ts +7 -1
  307. package/dist/with-commit/history/strategy.d.ts +11 -1
  308. package/dist/with-commit/numbering/index.d.ts +0 -5
  309. package/dist/with-commit/vault-head/active.d.ts +2 -0
  310. package/dist/with-commit/vault-head/head.d.ts +28 -0
  311. package/dist/with-commit/vault-head/index.d.ts +10 -0
  312. package/dist/with-commit/vault-head/strategy.d.ts +127 -0
  313. package/dist/with-commit/vault-head/verify.d.ts +90 -0
  314. package/dist/with-formula/materialized-views/types.d.ts +52 -0
  315. package/dist/with-party/directory/cover/storage.d.ts +0 -8
  316. package/dist/with-party/directory/storage.d.ts +0 -11
  317. package/dist/with-party/directory/visibility.d.ts +0 -21
  318. package/dist/with-party/policy/storage.d.ts +0 -10
  319. package/dist/with-party/team/index.d.ts +1 -1
  320. package/dist/with-party/team/keyring.d.ts +149 -3
  321. package/dist/with-party/team/noydb-facade.d.ts +5 -1
  322. package/dist/with-party/team/roster-tag.d.ts +101 -0
  323. package/dist/with-party/team/tiers.d.ts +2 -1
  324. package/dist/with-pod/format.d.ts +10 -12
  325. package/dist/with-pod/index.d.ts +10 -10
  326. package/dist/with-pod/open.d.ts +2 -2
  327. package/dist/with-pod/pod-handle.d.ts +19 -0
  328. package/dist/with-pod/pod-store.d.ts +0 -8
  329. package/dist/with-pod/{bundle.d.ts → pod.d.ts} +26 -19
  330. package/dist/with-pod/ulid.d.ts +1 -1
  331. package/dist/with-shape/blobs/blob-set.d.ts +2 -2
  332. package/dist/with-shape/introspection/index.d.ts +1 -0
  333. package/dist/with-sync/engine.d.ts +54 -5
  334. package/dist/with-sync/strategy.d.ts +3 -0
  335. package/dist/withdraw-accessible-4JTDFRFZ.js +28 -0
  336. package/package.json +13 -5
  337. package/dist/api-WVY3H3YH.js +0 -20
  338. package/dist/backup-YYBE5RPC.js.map +0 -1
  339. package/dist/bundle-handle-JEUWU2SJ.js +0 -36
  340. package/dist/bundle-handle-JEUWU2SJ.js.map +0 -1
  341. package/dist/chunk-26JMGSSC.js.map +0 -1
  342. package/dist/chunk-3737A6EA.js.map +0 -1
  343. package/dist/chunk-4MC5JRRX.js.map +0 -1
  344. package/dist/chunk-52QYGZHH.js.map +0 -1
  345. package/dist/chunk-55LKVALY.js.map +0 -1
  346. package/dist/chunk-5PR33AC4.js.map +0 -1
  347. package/dist/chunk-66W5OOCX.js.map +0 -1
  348. package/dist/chunk-7G6VDWXB.js.map +0 -1
  349. package/dist/chunk-A67356IR.js.map +0 -1
  350. package/dist/chunk-AFHQATY4.js +0 -47
  351. package/dist/chunk-AFHQATY4.js.map +0 -1
  352. package/dist/chunk-AHLJSVRL.js.map +0 -1
  353. package/dist/chunk-C2OOEM57.js.map +0 -1
  354. package/dist/chunk-DIMKRG2E.js +0 -131
  355. package/dist/chunk-DIMKRG2E.js.map +0 -1
  356. package/dist/chunk-E6427JU2.js.map +0 -1
  357. package/dist/chunk-E7OBCBXS.js.map +0 -1
  358. package/dist/chunk-EDXAQ6JI.js.map +0 -1
  359. package/dist/chunk-EP7VPR7Y.js.map +0 -1
  360. package/dist/chunk-ERB6NDDW.js.map +0 -1
  361. package/dist/chunk-G5APARUV.js.map +0 -1
  362. package/dist/chunk-GASWQ3XG.js.map +0 -1
  363. package/dist/chunk-GLKDWWNO.js.map +0 -1
  364. package/dist/chunk-HNGSV2YC.js.map +0 -1
  365. package/dist/chunk-I4F6PKUK.js.map +0 -1
  366. package/dist/chunk-I4ZAO7F7.js.map +0 -1
  367. package/dist/chunk-I6SDX7WX.js.map +0 -1
  368. package/dist/chunk-JXIDGFKS.js.map +0 -1
  369. package/dist/chunk-LWSJG3LI.js.map +0 -1
  370. package/dist/chunk-MWKDOHEF.js.map +0 -1
  371. package/dist/chunk-MZ5ZFO2D.js.map +0 -1
  372. package/dist/chunk-NIVEDYJZ.js.map +0 -1
  373. package/dist/chunk-NWCGDAV6.js +0 -45
  374. package/dist/chunk-NWCGDAV6.js.map +0 -1
  375. package/dist/chunk-PJNTR2NV.js.map +0 -1
  376. package/dist/chunk-PRDRGL73.js.map +0 -1
  377. package/dist/chunk-PY7CI6L5.js.map +0 -1
  378. package/dist/chunk-RKKORO4M.js.map +0 -1
  379. package/dist/chunk-TAGFGKHP.js.map +0 -1
  380. package/dist/chunk-TDJPS3T2.js.map +0 -1
  381. package/dist/chunk-TOAIYQJR.js.map +0 -1
  382. package/dist/chunk-UHXCLPGC.js.map +0 -1
  383. package/dist/chunk-UIBGXRDD.js.map +0 -1
  384. package/dist/chunk-V5KYPBUR.js.map +0 -1
  385. package/dist/chunk-VCETL77O.js.map +0 -1
  386. package/dist/chunk-VN45YLWM.js.map +0 -1
  387. package/dist/chunk-VOQW5LAM.js.map +0 -1
  388. package/dist/chunk-VRA4Q7DA.js.map +0 -1
  389. package/dist/chunk-VV4NSB7P.js.map +0 -1
  390. package/dist/chunk-W5W6KHN2.js.map +0 -1
  391. package/dist/chunk-WHJKIZS7.js.map +0 -1
  392. package/dist/chunk-WYZ5MYUA.js.map +0 -1
  393. package/dist/chunk-ZJADGNYF.js.map +0 -1
  394. package/dist/chunk-ZNACADFG.js.map +0 -1
  395. package/dist/collection-facade-QN5ULWYC.js +0 -45
  396. package/dist/delegation-SSEPLXXO.js.map +0 -1
  397. package/dist/derive-6V3PIZF7.js +0 -22
  398. package/dist/executor-CYJQLKKI.js +0 -9
  399. package/dist/executor-FHHLXO4Y.js +0 -28
  400. package/dist/executor-S4QIKEHW.js +0 -9
  401. package/dist/export-accessible-PE5AYKZR.js +0 -23
  402. package/dist/extract-partition-X2L26O6A.js +0 -38
  403. package/dist/fanout-sidecar-DTBIDOWF.js.map +0 -1
  404. package/dist/find-RBBYKXI7.js +0 -11
  405. package/dist/issue-RNU55YOF.js +0 -19
  406. package/dist/liberate-PX4CAT5V.js +0 -24
  407. package/dist/noydb-YPSEGK32.js +0 -83
  408. package/dist/register-TMD6YRCX.js +0 -32
  409. package/dist/registry-CZVINVQH.js +0 -9
  410. package/dist/registry-FVLDWQKT.js +0 -18
  411. package/dist/registry-IKUR2MXD.js +0 -9
  412. package/dist/registry-JET4HBLY.js +0 -19
  413. package/dist/request-withdrawal-RH55LNZL.js +0 -31
  414. package/dist/revoke-R5TBYVA6.js +0 -24
  415. package/dist/seed-UK4QRIUN.js.map +0 -1
  416. package/dist/signer-AGALOXOO.js +0 -25
  417. package/dist/storage-N7LB275C.js +0 -23
  418. package/dist/store-coordination-provider-PB6QZ57W.js.map +0 -1
  419. package/dist/walk-OCUHCYJ6.js +0 -21
  420. package/dist/with-pod/bundle-handle.d.ts +0 -9
  421. package/dist/withdraw-accessible-QQNWM5BO.js +0 -28
  422. /package/dist/{api-WVY3H3YH.js.map → api-EYNT6KGS.js.map} +0 -0
  423. /package/dist/{chunk-35EBKWQU.js.map → chunk-2LFOMUEA.js.map} +0 -0
  424. /package/dist/{chunk-OF3L2SD6.js.map → chunk-32B7VCKU.js.map} +0 -0
  425. /package/dist/{chunk-MSWYQLMQ.js.map → chunk-3B6S6RSI.js.map} +0 -0
  426. /package/dist/{chunk-7F4DBNSP.js.map → chunk-3O72ZD2E.js.map} +0 -0
  427. /package/dist/{chunk-FNSMZQS4.js.map → chunk-3PMFMUFX.js.map} +0 -0
  428. /package/dist/{chunk-FAXZQ5UF.js.map → chunk-4RAS6HN6.js.map} +0 -0
  429. /package/dist/{chunk-VMCCGUQB.js.map → chunk-6JPGVL7X.js.map} +0 -0
  430. /package/dist/{chunk-WLYIROCJ.js.map → chunk-6YD5SYQS.js.map} +0 -0
  431. /package/dist/{chunk-YAWK6AWF.js.map → chunk-7KAE7CQ2.js.map} +0 -0
  432. /package/dist/{chunk-NKH7GSIH.js.map → chunk-AUPSEJ7O.js.map} +0 -0
  433. /package/dist/{chunk-CCZJJ4I2.js.map → chunk-B6IYATME.js.map} +0 -0
  434. /package/dist/{chunk-4UVDI4XE.js.map → chunk-CLAHBPOI.js.map} +0 -0
  435. /package/dist/{chunk-HVQGCKY4.js.map → chunk-D3R7Q4QK.js.map} +0 -0
  436. /package/dist/{chunk-P7OG2ETF.js.map → chunk-DXKLLKME.js.map} +0 -0
  437. /package/dist/{chunk-JIUVJ4M7.js.map → chunk-EKEIEJL6.js.map} +0 -0
  438. /package/dist/{chunk-DG27IUVI.js.map → chunk-FS7NTGCJ.js.map} +0 -0
  439. /package/dist/{chunk-HXGUIPQB.js.map → chunk-GQXFOAYZ.js.map} +0 -0
  440. /package/dist/{chunk-BTVYJWSN.js.map → chunk-GTHVPVAR.js.map} +0 -0
  441. /package/dist/{chunk-DMQCLZ4Z.js.map → chunk-GWO2IDAB.js.map} +0 -0
  442. /package/dist/{chunk-6HFM7EIT.js.map → chunk-H3G4I3PN.js.map} +0 -0
  443. /package/dist/{chunk-VJFMXYKP.js.map → chunk-HR5R5JOM.js.map} +0 -0
  444. /package/dist/{chunk-FDX7OWWI.js.map → chunk-HYYVT2KZ.js.map} +0 -0
  445. /package/dist/{chunk-JRCYZEHU.js.map → chunk-I6QKB7MT.js.map} +0 -0
  446. /package/dist/{chunk-KUDZVJKQ.js.map → chunk-IJ46VCWD.js.map} +0 -0
  447. /package/dist/{chunk-4HDYQL3J.js.map → chunk-INMHEMXX.js.map} +0 -0
  448. /package/dist/{chunk-AR2JDFAE.js.map → chunk-KV6JM2IA.js.map} +0 -0
  449. /package/dist/{chunk-PVU7LW5L.js.map → chunk-KX57HODD.js.map} +0 -0
  450. /package/dist/{chunk-CEJWMBXO.js.map → chunk-LXECF2ZR.js.map} +0 -0
  451. /package/dist/{chunk-7VHY5E3X.js.map → chunk-MSLPDFK2.js.map} +0 -0
  452. /package/dist/{chunk-HNHCQ556.js.map → chunk-NR2SUJ3H.js.map} +0 -0
  453. /package/dist/{chunk-W3TVWF6N.js.map → chunk-OIBEJN5H.js.map} +0 -0
  454. /package/dist/{chunk-QD724WDJ.js.map → chunk-OMYCSTXL.js.map} +0 -0
  455. /package/dist/{chunk-Z45YRGFO.js.map → chunk-ONVD6GBY.js.map} +0 -0
  456. /package/dist/{chunk-KCQX65FU.js.map → chunk-RKCRPPNB.js.map} +0 -0
  457. /package/dist/{chunk-7TSYBD3E.js.map → chunk-RSXQNFGO.js.map} +0 -0
  458. /package/dist/{chunk-7NXHMW6Y.js.map → chunk-SYS46BL7.js.map} +0 -0
  459. /package/dist/{chunk-747LRSOO.js.map → chunk-TMBSPLUG.js.map} +0 -0
  460. /package/dist/{chunk-WKPJXWKR.js.map → chunk-TX5MKAHA.js.map} +0 -0
  461. /package/dist/{chunk-NJDQ4YSV.js.map → chunk-YKXZHUOW.js.map} +0 -0
  462. /package/dist/{chunk-VW6ZZGCG.js.map → chunk-ZLHHE5XZ.js.map} +0 -0
  463. /package/dist/{chunk-FUHKW252.js.map → chunk-ZZXLB6AS.js.map} +0 -0
  464. /package/dist/{classified-marker-FTOX7Q5L.js.map → classified-marker-NA6HUV33.js.map} +0 -0
  465. /package/dist/{collection-facade-QN5ULWYC.js.map → collection-facade-VBM35WAH.js.map} +0 -0
  466. /package/dist/{computed-6G5M3UPH.js.map → computed-GSTLWSY5.js.map} +0 -0
  467. /package/dist/{dead-filter-ENRIOQIE.js.map → dead-filter-UALP5DJX.js.map} +0 -0
  468. /package/dist/{derive-6V3PIZF7.js.map → derive-YUO3TQYN.js.map} +0 -0
  469. /package/dist/{dispatch-RE74SH6L.js.map → dispatch-4ZHLSFZQ.js.map} +0 -0
  470. /package/dist/{dispatch-BDVGYC6X.js.map → dispatch-77CB75KB.js.map} +0 -0
  471. /package/dist/{enclave-52VUXNRL.js.map → enclave-O4NOROCJ.js.map} +0 -0
  472. /package/dist/{executor-CYJQLKKI.js.map → executor-CZDXBXKE.js.map} +0 -0
  473. /package/dist/{executor-FHHLXO4Y.js.map → executor-DVJAWN3B.js.map} +0 -0
  474. /package/dist/{executor-S4QIKEHW.js.map → executor-VRLG4TQJ.js.map} +0 -0
  475. /package/dist/{export-accessible-PE5AYKZR.js.map → export-accessible-UXSMG7AB.js.map} +0 -0
  476. /package/dist/{extract-partition-X2L26O6A.js.map → extract-partition-TVY7AMKH.js.map} +0 -0
  477. /package/dist/{find-RBBYKXI7.js.map → find-WSARMJBW.js.map} +0 -0
  478. /package/dist/{issue-RNU55YOF.js.map → issue-3JNJNPT3.js.map} +0 -0
  479. /package/dist/{ledger-4WJL66BW.js.map → ledger-MVPNG5OS.js.map} +0 -0
  480. /package/dist/{liberate-PX4CAT5V.js.map → liberate-4LOJOLDT.js.map} +0 -0
  481. /package/dist/{link-set-N4ZPV6E6.js.map → link-set-3POMQR3I.js.map} +0 -0
  482. /package/dist/{managed-secret-OTHS64IF.js.map → managed-secret-IARIJJ7Q.js.map} +0 -0
  483. /package/dist/{noydb-YPSEGK32.js.map → noydb-IRILUDED.js.map} +0 -0
  484. /package/dist/{post-register-ZAG2CAIY.js.map → post-register-Z5T7FY45.js.map} +0 -0
  485. /package/dist/{register-TMD6YRCX.js.map → register-UZ37QPDB.js.map} +0 -0
  486. /package/dist/{registry-CZVINVQH.js.map → registry-ETJNA7PO.js.map} +0 -0
  487. /package/dist/{registry-FVLDWQKT.js.map → registry-F7U6KSLX.js.map} +0 -0
  488. /package/dist/{registry-IKUR2MXD.js.map → registry-L4ELKX6C.js.map} +0 -0
  489. /package/dist/{registry-JET4HBLY.js.map → registry-SDT5LIGO.js.map} +0 -0
  490. /package/dist/{request-withdrawal-RH55LNZL.js.map → request-withdrawal-PVFEYX57.js.map} +0 -0
  491. /package/dist/{reveal-CMOJY4VO.js.map → reveal-DQ2E3QAZ.js.map} +0 -0
  492. /package/dist/{revoke-R5TBYVA6.js.map → revoke-YXY6SHUH.js.map} +0 -0
  493. /package/dist/{signer-AGALOXOO.js.map → signer-Q7XQBMPA.js.map} +0 -0
  494. /package/dist/{stale-ZWXSOWJI.js.map → stale-NI7SAXAZ.js.map} +0 -0
  495. /package/dist/{storage-N7LB275C.js.map → storage-3VNGSHXS.js.map} +0 -0
  496. /package/dist/{ulid-PTAIMDG4.js.map → ulid-VQW6ERQN.js.map} +0 -0
  497. /package/dist/{verify-RO5RTZOJ.js.map → verify-6J2YLKSO.js.map} +0 -0
  498. /package/dist/{walk-OCUHCYJ6.js.map → walk-WRA7RAPY.js.map} +0 -0
  499. /package/dist/{withdraw-accessible-QQNWM5BO.js.map → withdraw-accessible-4JTDFRFZ.js.map} +0 -0
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  TierWriteRefusedError
3
- } from "./chunk-HNGSV2YC.js";
3
+ } from "./chunk-CWM4GQD2.js";
4
4
 
5
5
  // src/kernel/tier-visibility.ts
6
6
  async function peekLiveTier(adapter, vault, name, id) {
@@ -27,11 +27,16 @@ async function assertCutoverTierSafe(adapter, vault, name, tiersEnabled) {
27
27
  }
28
28
  }
29
29
  }
30
+ function dekKey(collection, tier) {
31
+ if (tier <= 0) return collection;
32
+ return `${collection}#${tier}`;
33
+ }
30
34
 
31
35
  export {
32
36
  liveRecordIsElevated,
33
37
  liveRecordTier,
34
38
  assertTierWritable,
35
- assertCutoverTierSafe
39
+ assertCutoverTierSafe,
40
+ dekKey
36
41
  };
37
- //# sourceMappingURL=chunk-3FSX6LDG.js.map
42
+ //# sourceMappingURL=chunk-PPCOKVFA.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/kernel/tier-visibility.ts"],"sourcesContent":["/**\n * Tier visibility helper (#712/#707): a tier-0 code path treats an elevated\n * (_tier > 0) record as invisible. History reads gate on the LIVE record's\n * tier — history snapshots keep their tier-0-wrapped CEKs and carry no _tier\n * of their own, so an elevated record's prior versions would otherwise stay\n * tier-0-decryptable (the read-gate closes the API surface; #712's at-rest\n * arc rewraps the snapshot keys). Envelope inspection only — no decryption.\n *\n * #715/#716: the write ring. Invisibility on the read side is exactly what\n * makes a tier-0 write path treat an elevated record as absent — a put()\n * believes it's a create (demotion) and a delete() writes a marker with no\n * _tier (erasing the elevation signal). `assertTierWritable` closes that by\n * refusing the write outright. Both helpers share a single envelope peek\n * (`peekLiveTier`) — no duplicated `adapter.get` per write.\n */\nimport type { NoydbStore } from './types.js'\nimport { TierWriteRefusedError } from './errors.js'\n\nasync function peekLiveTier(\n adapter: NoydbStore, vault: string, name: string, id: string,\n): Promise<number> {\n const env = await adapter.get(vault, name, id)\n return env?._tier ?? 0\n}\n\nexport async function liveRecordIsElevated(\n adapter: NoydbStore, vault: string, name: string, id: string,\n): Promise<boolean> {\n return (await peekLiveTier(adapter, vault, name, id)) > 0\n}\n\n/**\n * The tier a record's LIVE envelope currently carries (0 if untiered or\n * never moved). #724 Task 4: `BlobSet.loadSlots`/`saveSlots` use this to\n * resolve the per-record slot map's collection DEK at the record's current\n * tier by default, so the slot map's physical location follows the record\n * after `rehomeForTier` re-keys it.\n */\nexport async function liveRecordTier(\n adapter: NoydbStore, vault: string, name: string, id: string,\n): Promise<number> {\n return peekLiveTier(adapter, vault, name, id)\n}\n\n/**\n * Refuses a tier-0 `put()`/`delete()` targeting an elevated record.\n * No-op when `tiersEnabled` is false (the cost gate — collections that\n * never declare tiers pay nothing). Throws `TierWriteRefusedError` with\n * the record's ACTUAL live tier when elevated — holders included, since\n * `put()`/`delete()` are the tier-0 APIs and `putAtTier`/`elevate`/`demote`\n * are the sanctioned tier-aware paths.\n */\nexport async function assertTierWritable(\n adapter: NoydbStore, vault: string, name: string, id: string, tiersEnabled: boolean,\n): Promise<void> {\n if (!tiersEnabled) return\n const tier = await peekLiveTier(adapter, vault, name, id)\n if (tier > 0) throw new TierWriteRefusedError(name, tier)\n}\n\n/**\n * #708: ALL-OR-NOTHING pre-check for a coordinated-cutover bulk-rewrite —\n * scans every id's live tier BEFORE any record is transformed and refuses\n * on the first elevated one found. `_applyCutoverTransform` re-encrypts at\n * tier 0 with no gate of its own; without this, it would silently demote\n * an elevated record. Same cost gate as `assertTierWritable` (no-op, no\n * adapter call, when `tiersEnabled` is false).\n *\n * This pre-check guards against an ordinary `put()`/`delete()` racing the\n * cutover, because those go through the schema fence (`SchemaFenceController`\n * blocks concurrent writes during a coordinated cutover). It does NOT guard\n * against `elevate()`/`demote()`/`putAtTier()` — those tier-move paths bypass\n * the fence, so a tier move landing between this scan and the rewrite it\n * gates is not excluded. Cutover callers are expected to hold the vault\n * quiescent for tier moves on this collection for the duration of the call,\n * the same tier-quiescence assumption the documented CAS-less caller\n * (`with-shape/satellites/migrate-cek.ts`'s \"No-quiesce precondition\") makes\n * explicit for concurrent writes generally.\n */\nexport async function assertCutoverTierSafe(\n adapter: NoydbStore, vault: string, name: string, tiersEnabled: boolean,\n): Promise<void> {\n if (!tiersEnabled) return\n for (const id of await adapter.list(vault, name)) {\n const tier = await peekLiveTier(adapter, vault, name, id)\n if (tier > 0) {\n throw new TierWriteRefusedError(name, tier, `Coordinated cutover on collection \"${name}\" refused — record \"${id}\" is elevated to tier ${tier}. Demote it before a coordinated cutover.`)\n }\n }\n}\n"],"mappings":";;;;;AAkBA,eAAe,aACb,SAAqB,OAAe,MAAc,IACjC;AACjB,QAAM,MAAM,MAAM,QAAQ,IAAI,OAAO,MAAM,EAAE;AAC7C,SAAO,KAAK,SAAS;AACvB;AAEA,eAAsB,qBACpB,SAAqB,OAAe,MAAc,IAChC;AAClB,SAAQ,MAAM,aAAa,SAAS,OAAO,MAAM,EAAE,IAAK;AAC1D;AASA,eAAsB,eACpB,SAAqB,OAAe,MAAc,IACjC;AACjB,SAAO,aAAa,SAAS,OAAO,MAAM,EAAE;AAC9C;AAUA,eAAsB,mBACpB,SAAqB,OAAe,MAAc,IAAY,cAC/C;AACf,MAAI,CAAC,aAAc;AACnB,QAAM,OAAO,MAAM,aAAa,SAAS,OAAO,MAAM,EAAE;AACxD,MAAI,OAAO,EAAG,OAAM,IAAI,sBAAsB,MAAM,IAAI;AAC1D;AAqBA,eAAsB,sBACpB,SAAqB,OAAe,MAAc,cACnC;AACf,MAAI,CAAC,aAAc;AACnB,aAAW,MAAM,MAAM,QAAQ,KAAK,OAAO,IAAI,GAAG;AAChD,UAAM,OAAO,MAAM,aAAa,SAAS,OAAO,MAAM,EAAE;AACxD,QAAI,OAAO,GAAG;AACZ,YAAM,IAAI,sBAAsB,MAAM,MAAM,sCAAsC,IAAI,4BAAuB,EAAE,yBAAyB,IAAI,2CAA2C;AAAA,IACzL;AAAA,EACF;AACF;","names":[]}
1
+ {"version":3,"sources":["../src/kernel/tier-visibility.ts"],"sourcesContent":["/**\n * Tier visibility helper (#712/#707): a tier-0 code path treats an elevated\n * (_tier > 0) record as invisible. History reads gate on the LIVE record's\n * tier — history snapshots keep their tier-0-wrapped CEKs and carry no _tier\n * of their own, so an elevated record's prior versions would otherwise stay\n * tier-0-decryptable (the read-gate closes the API surface; #712's at-rest\n * arc rewraps the snapshot keys). Envelope inspection only — no decryption.\n *\n * #715/#716: the write ring. Invisibility on the read side is exactly what\n * makes a tier-0 write path treat an elevated record as absent — a put()\n * believes it's a create (demotion) and a delete() writes a marker with no\n * _tier (erasing the elevation signal). `assertTierWritable` closes that by\n * refusing the write outright. Both helpers share a single envelope peek\n * (`peekLiveTier`) — no duplicated `adapter.get` per write.\n */\nimport type { NoydbStore } from './types.js'\nimport { TierWriteRefusedError } from './errors.js'\n\nasync function peekLiveTier(\n adapter: NoydbStore, vault: string, name: string, id: string,\n): Promise<number> {\n const env = await adapter.get(vault, name, id)\n return env?._tier ?? 0\n}\n\nexport async function liveRecordIsElevated(\n adapter: NoydbStore, vault: string, name: string, id: string,\n): Promise<boolean> {\n return (await peekLiveTier(adapter, vault, name, id)) > 0\n}\n\n/**\n * The tier a record's LIVE envelope currently carries (0 if untiered or\n * never moved). #724 Task 4: `BlobSet.loadSlots`/`saveSlots` use this to\n * resolve the per-record slot map's collection DEK at the record's current\n * tier by default, so the slot map's physical location follows the record\n * after `rehomeForTier` re-keys it.\n */\nexport async function liveRecordTier(\n adapter: NoydbStore, vault: string, name: string, id: string,\n): Promise<number> {\n return peekLiveTier(adapter, vault, name, id)\n}\n\n/**\n * Refuses a tier-0 `put()`/`delete()` targeting an elevated record.\n * No-op when `tiersEnabled` is false (the cost gate — collections that\n * never declare tiers pay nothing). Throws `TierWriteRefusedError` with\n * the record's ACTUAL live tier when elevated — holders included, since\n * `put()`/`delete()` are the tier-0 APIs and `putAtTier`/`elevate`/`demote`\n * are the sanctioned tier-aware paths.\n */\nexport async function assertTierWritable(\n adapter: NoydbStore, vault: string, name: string, id: string, tiersEnabled: boolean,\n): Promise<void> {\n if (!tiersEnabled) return\n const tier = await peekLiveTier(adapter, vault, name, id)\n if (tier > 0) throw new TierWriteRefusedError(name, tier)\n}\n\n/**\n * #708: ALL-OR-NOTHING pre-check for a coordinated-cutover bulk-rewrite —\n * scans every id's live tier BEFORE any record is transformed and refuses\n * on the first elevated one found. `_applyCutoverTransform` re-encrypts at\n * tier 0 with no gate of its own; without this, it would silently demote\n * an elevated record. Same cost gate as `assertTierWritable` (no-op, no\n * adapter call, when `tiersEnabled` is false).\n *\n * This pre-check guards against an ordinary `put()`/`delete()` racing the\n * cutover, because those go through the schema fence (`SchemaFenceController`\n * blocks concurrent writes during a coordinated cutover). It does NOT guard\n * against `elevate()`/`demote()`/`putAtTier()` — those tier-move paths bypass\n * the fence, so a tier move landing between this scan and the rewrite it\n * gates is not excluded. Cutover callers are expected to hold the vault\n * quiescent for tier moves on this collection for the duration of the call,\n * the same tier-quiescence assumption the documented CAS-less caller\n * (`with-shape/satellites/migrate-cek.ts`'s \"No-quiesce precondition\") makes\n * explicit for concurrent writes generally.\n */\nexport async function assertCutoverTierSafe(\n adapter: NoydbStore, vault: string, name: string, tiersEnabled: boolean,\n): Promise<void> {\n if (!tiersEnabled) return\n for (const id of await adapter.list(vault, name)) {\n const tier = await peekLiveTier(adapter, vault, name, id)\n if (tier > 0) {\n throw new TierWriteRefusedError(name, tier, `Coordinated cutover on collection \"${name}\" refused — record \"${id}\" is elevated to tier ${tier}. Demote it before a coordinated cutover.`)\n }\n }\n}\n\n/**\n * The key a collection's DEK is stored under in `UnlockedKeyring.deks` for a\n * given tier: `collection` at tier 0, `collection#N` above it.\n *\n * Lives in the kernel because the `deks` map is a kernel type and the kernel\n * reads it — `noydb.ts` needs this to resolve the right DEK when verifying a\n * pulled envelope (#1042). `with-party/team/tiers.ts` re-exports it, so every\n * existing importer is unchanged; the definition simply moved to the layer that\n * owns the map rather than one that happens to use it.\n *\n * This move was forced by `port-layering`, and rightly: the alternative was the\n * kernel spine statically importing a `with-*` service, or duplicating the\n * naming convention in two places where it could drift.\n */\nexport function dekKey(collection: string, tier: number): string {\n if (tier <= 0) return collection\n return `${collection}#${tier}`\n}\n"],"mappings":";;;;;AAkBA,eAAe,aACb,SAAqB,OAAe,MAAc,IACjC;AACjB,QAAM,MAAM,MAAM,QAAQ,IAAI,OAAO,MAAM,EAAE;AAC7C,SAAO,KAAK,SAAS;AACvB;AAEA,eAAsB,qBACpB,SAAqB,OAAe,MAAc,IAChC;AAClB,SAAQ,MAAM,aAAa,SAAS,OAAO,MAAM,EAAE,IAAK;AAC1D;AASA,eAAsB,eACpB,SAAqB,OAAe,MAAc,IACjC;AACjB,SAAO,aAAa,SAAS,OAAO,MAAM,EAAE;AAC9C;AAUA,eAAsB,mBACpB,SAAqB,OAAe,MAAc,IAAY,cAC/C;AACf,MAAI,CAAC,aAAc;AACnB,QAAM,OAAO,MAAM,aAAa,SAAS,OAAO,MAAM,EAAE;AACxD,MAAI,OAAO,EAAG,OAAM,IAAI,sBAAsB,MAAM,IAAI;AAC1D;AAqBA,eAAsB,sBACpB,SAAqB,OAAe,MAAc,cACnC;AACf,MAAI,CAAC,aAAc;AACnB,aAAW,MAAM,MAAM,QAAQ,KAAK,OAAO,IAAI,GAAG;AAChD,UAAM,OAAO,MAAM,aAAa,SAAS,OAAO,MAAM,EAAE;AACxD,QAAI,OAAO,GAAG;AACZ,YAAM,IAAI,sBAAsB,MAAM,MAAM,sCAAsC,IAAI,4BAAuB,EAAE,yBAAyB,IAAI,2CAA2C;AAAA,IACzL;AAAA,EACF;AACF;AAgBO,SAAS,OAAO,YAAoB,MAAsB;AAC/D,MAAI,QAAQ,EAAG,QAAO;AACtB,SAAO,GAAG,UAAU,IAAI,IAAI;AAC9B;","names":[]}
@@ -1,20 +1,20 @@
1
1
  import {
2
2
  pickLocale
3
- } from "./chunk-SZ2K3MHL.js";
3
+ } from "./chunk-S56VYR4Q.js";
4
4
  import {
5
5
  sha256Hex
6
- } from "./chunk-VCETL77O.js";
6
+ } from "./chunk-AU3AUJIZ.js";
7
7
  import {
8
- BundleIntegrityError,
9
- BundleSealMismatchError,
8
+ PodIntegrityError,
9
+ PodSealMismatchError,
10
10
  ValidationError
11
- } from "./chunk-HNGSV2YC.js";
11
+ } from "./chunk-CWM4GQD2.js";
12
12
 
13
13
  // src/with-pod/format.ts
14
- var NOYDB_BUNDLE_MAGIC = new Uint8Array([78, 68, 66, 49]);
15
- var NOYDB_BUNDLE_PREFIX_BYTES = 10;
16
- var NOYDB_BUNDLE_FORMAT_VERSION = 1;
17
- var NOYDB_BUNDLE_FORMAT_VERSION_SIGNED = 2;
14
+ var NOYDB_POD_MAGIC = new Uint8Array([78, 68, 66, 49]);
15
+ var NOYDB_POD_PREFIX_BYTES = 10;
16
+ var NOYDB_POD_FORMAT_VERSION = 1;
17
+ var NOYDB_POD_FORMAT_VERSION_SIGNED = 2;
18
18
  var FLAG_COMPRESSED = 1;
19
19
  var FLAG_HAS_INTEGRITY_HASH = 2;
20
20
  var COMPRESSION_NONE = 0;
@@ -63,7 +63,7 @@ var REDIRECT_REASONS = /* @__PURE__ */ new Set([
63
63
  "tombstone",
64
64
  "repoint"
65
65
  ]);
66
- function validateBundleHeader(parsed) {
66
+ function validatePodHeaderFields(parsed) {
67
67
  if (parsed === null || typeof parsed !== "object") {
68
68
  throw new Error(
69
69
  `.noydb bundle header must be a JSON object, got ${parsed === null ? "null" : typeof parsed}`
@@ -77,9 +77,9 @@ function validateBundleHeader(parsed) {
77
77
  }
78
78
  }
79
79
  const h = parsed;
80
- if (typeof h["formatVersion"] !== "number" || h["formatVersion"] !== NOYDB_BUNDLE_FORMAT_VERSION && h["formatVersion"] !== NOYDB_BUNDLE_FORMAT_VERSION_SIGNED) {
80
+ if (typeof h["formatVersion"] !== "number" || h["formatVersion"] !== NOYDB_POD_FORMAT_VERSION && h["formatVersion"] !== NOYDB_POD_FORMAT_VERSION_SIGNED) {
81
81
  throw new Error(
82
- `.noydb bundle header.formatVersion must be ${NOYDB_BUNDLE_FORMAT_VERSION} or ${NOYDB_BUNDLE_FORMAT_VERSION_SIGNED}, got ${String(h["formatVersion"])}. The reader does not support forward-compat versions; upgrade the reader to handle newer bundles.`
82
+ `.noydb bundle header.formatVersion must be ${NOYDB_POD_FORMAT_VERSION} or ${NOYDB_POD_FORMAT_VERSION_SIGNED}, got ${String(h["formatVersion"])}. The reader does not support forward-compat versions; upgrade the reader to handle newer bundles.`
83
83
  );
84
84
  }
85
85
  if (typeof h["handle"] !== "string" || !/^[0-9A-HJKMNP-TV-Z]{26}$/.test(h["handle"])) {
@@ -264,14 +264,14 @@ function validateBundleHeader(parsed) {
264
264
  `.noydb bundle header.sig, .keyId, and .sigAlg must be present together or not at all (got ${sigFieldsPresent} of 3).`
265
265
  );
266
266
  }
267
- if (sigFieldsPresent === 3 && h["formatVersion"] !== NOYDB_BUNDLE_FORMAT_VERSION_SIGNED) {
267
+ if (sigFieldsPresent === 3 && h["formatVersion"] !== NOYDB_POD_FORMAT_VERSION_SIGNED) {
268
268
  throw new Error(
269
- `.noydb bundle header with sig/keyId/sigAlg must have formatVersion === ${NOYDB_BUNDLE_FORMAT_VERSION_SIGNED}, got ${String(h["formatVersion"])}.`
269
+ `.noydb bundle header with sig/keyId/sigAlg must have formatVersion === ${NOYDB_POD_FORMAT_VERSION_SIGNED}, got ${String(h["formatVersion"])}.`
270
270
  );
271
271
  }
272
272
  }
273
- function encodeBundleHeader(header) {
274
- validateBundleHeader(header);
273
+ function encodePodHeader(header) {
274
+ validatePodHeaderFields(header);
275
275
  const json = JSON.stringify({
276
276
  formatVersion: header.formatVersion,
277
277
  handle: header.handle,
@@ -297,7 +297,7 @@ function encodeBundleHeader(header) {
297
297
  });
298
298
  return new TextEncoder().encode(json);
299
299
  }
300
- function decodeBundleHeader(bytes) {
300
+ function decodePodHeader(bytes) {
301
301
  const json = new TextDecoder("utf-8", { fatal: true }).decode(bytes);
302
302
  let parsed;
303
303
  try {
@@ -307,7 +307,7 @@ function decodeBundleHeader(bytes) {
307
307
  `.noydb bundle header is not valid JSON: ${err.message}`
308
308
  );
309
309
  }
310
- validateBundleHeader(parsed);
310
+ validatePodHeaderFields(parsed);
311
311
  return parsed;
312
312
  }
313
313
  function readUint32BE(bytes, offset) {
@@ -319,10 +319,10 @@ function writeUint32BE(bytes, offset, value) {
319
319
  bytes[offset + 2] = value >>> 8 & 255;
320
320
  bytes[offset + 3] = value & 255;
321
321
  }
322
- function hasNoydbBundleMagic(bytes) {
323
- if (bytes.length < NOYDB_BUNDLE_MAGIC.length) return false;
324
- for (let i = 0; i < NOYDB_BUNDLE_MAGIC.length; i++) {
325
- if (bytes[i] !== NOYDB_BUNDLE_MAGIC[i]) return false;
322
+ function hasNoydbPodMagic(bytes) {
323
+ if (bytes.length < NOYDB_POD_MAGIC.length) return false;
324
+ for (let i = 0; i < NOYDB_POD_MAGIC.length; i++) {
325
+ if (bytes[i] !== NOYDB_POD_MAGIC[i]) return false;
326
326
  }
327
327
  return true;
328
328
  }
@@ -340,7 +340,42 @@ async function verifyRecord(publicKeyB64, sig, payload) {
340
340
  return ed25519Verify(publicKeyB64, sig, signedBytes(payload));
341
341
  }
342
342
 
343
- // src/with-pod/bundle.ts
343
+ // src/with-pod/pod.ts
344
+ var WRITE_POD_OPTION_KEYS = [
345
+ "compression",
346
+ "collections",
347
+ "since",
348
+ "where",
349
+ "tierAtMost",
350
+ "exportSecret",
351
+ "recipients",
352
+ "autoCredentials",
353
+ "sealedCredentials",
354
+ "autoSecrets",
355
+ "sealedSecrets",
356
+ "sign",
357
+ "engineRange",
358
+ "unlockMethods",
359
+ "hasApp",
360
+ "species",
361
+ "pointerMode",
362
+ "redirect"
363
+ ];
364
+ var RETIRED_WRITE_POD_OPTIONS = {
365
+ autoPassphrases: "autoCredentials",
366
+ sealedPassphrases: "sealedCredentials",
367
+ exportPassphrase: "exportSecret"
368
+ };
369
+ function assertKnownWritePodOptions(opts) {
370
+ const known = new Set(WRITE_POD_OPTION_KEYS);
371
+ for (const [key, value] of Object.entries(opts)) {
372
+ if (value === void 0 || known.has(key)) continue;
373
+ const replacement = RETIRED_WRITE_POD_OPTIONS[key];
374
+ throw new Error(
375
+ replacement !== void 0 ? `writePod: \`${key}\` was renamed to \`${replacement}\`. Passing the old key would have written a pod without that slot \u2014 see the 0.4.0-pre migration note.` : `writePod: unknown option \`${key}\`. Options are not ignored \u2014 a dropped write option produces a pod that is silently missing something. Known keys: ${WRITE_POD_OPTION_KEYS.join(", ")}.`
376
+ );
377
+ }
378
+ }
344
379
  function toAutoCredentials(m) {
345
380
  return Object.fromEntries(
346
381
  Object.entries(m).map(([u, value]) => [u, { kind: "secret", value }])
@@ -527,30 +562,30 @@ function parseAutoUnlockBody(bodyString) {
527
562
  try {
528
563
  parsed = JSON.parse(bodyString);
529
564
  } catch (err) {
530
- throw new BundleIntegrityError(
565
+ throw new PodIntegrityError(
531
566
  "header declared autoUnlock but body could not be parsed as JSON wrapper: " + (err instanceof Error ? err.message : String(err))
532
567
  );
533
568
  }
534
569
  if (typeof parsed !== "object" || parsed === null) {
535
- throw new BundleIntegrityError("autoUnlock body is not a JSON object");
570
+ throw new PodIntegrityError("autoUnlock body is not a JSON object");
536
571
  }
537
572
  const obj = parsed;
538
573
  if (obj["_noydb_bundle_body"] !== 1) {
539
- throw new BundleIntegrityError(
574
+ throw new PodIntegrityError(
540
575
  "autoUnlock body missing `_noydb_bundle_body: 1` discriminator"
541
576
  );
542
577
  }
543
578
  if (typeof obj["dump"] !== "string") {
544
- throw new BundleIntegrityError("autoUnlock body must carry a string `dump` field");
579
+ throw new PodIntegrityError("autoUnlock body must carry a string `dump` field");
545
580
  }
546
581
  const blob = obj["_autoUnlock"];
547
582
  if (typeof blob !== "object" || blob === null) {
548
- throw new BundleIntegrityError("autoUnlock body missing `_autoUnlock` blob");
583
+ throw new PodIntegrityError("autoUnlock body missing `_autoUnlock` blob");
549
584
  }
550
585
  const blobObj = blob;
551
586
  const kind = blobObj["kind"];
552
587
  if (kind !== "unsealed" && kind !== "sealed") {
553
- throw new BundleIntegrityError(
588
+ throw new PodIntegrityError(
554
589
  `autoUnlock blob has invalid kind ${String(kind)}; expected 'unsealed' or 'sealed'`
555
590
  );
556
591
  }
@@ -567,29 +602,29 @@ function parseExtractedPartitionBody(bodyString) {
567
602
  try {
568
603
  parsed = JSON.parse(bodyString);
569
604
  } catch (err) {
570
- throw new BundleIntegrityError(
605
+ throw new PodIntegrityError(
571
606
  "header declared extracted-partition but body could not be parsed as JSON wrapper: " + (err instanceof Error ? err.message : String(err))
572
607
  );
573
608
  }
574
609
  if (typeof parsed !== "object" || parsed === null) {
575
- throw new BundleIntegrityError("extracted-partition body is not a JSON object");
610
+ throw new PodIntegrityError("extracted-partition body is not a JSON object");
576
611
  }
577
612
  const obj = parsed;
578
613
  if (obj["_noydb_bundle_body"] !== 1) {
579
- throw new BundleIntegrityError(
614
+ throw new PodIntegrityError(
580
615
  "extracted-partition body missing `_noydb_bundle_body: 1` discriminator"
581
616
  );
582
617
  }
583
618
  if (typeof obj["dump"] !== "string") {
584
- throw new BundleIntegrityError("extracted-partition body must carry a string `dump` field");
619
+ throw new PodIntegrityError("extracted-partition body must carry a string `dump` field");
585
620
  }
586
621
  const seal = obj["_transferSeal"];
587
622
  if (typeof seal !== "object" || seal === null) {
588
- throw new BundleIntegrityError("extracted-partition body missing `_transferSeal` blob");
623
+ throw new PodIntegrityError("extracted-partition body missing `_transferSeal` blob");
589
624
  }
590
625
  const s = seal;
591
626
  if (s["v"] !== 1 || s["alg"] !== "aes-256-gcm-pre-shared" || typeof s["sealId"] !== "string" || typeof s["payload"] !== "string") {
592
- throw new BundleIntegrityError("extracted-partition `_transferSeal` blob is malformed");
627
+ throw new PodIntegrityError("extracted-partition `_transferSeal` blob is malformed");
593
628
  }
594
629
  return { dump: obj["dump"], seal };
595
630
  }
@@ -635,7 +670,7 @@ async function resolveAutoUnlock(blob, opts) {
635
670
  unsealedMap[userId] = { kind: credKind, value: entry.sealed };
636
671
  continue;
637
672
  }
638
- throw new BundleSealMismatchError(userId, entry.pid);
673
+ throw new PodSealMismatchError(userId, entry.pid);
639
674
  }
640
675
  unsealedMap[userId] = { kind: credKind, value: opened };
641
676
  continue;
@@ -644,7 +679,7 @@ async function resolveAutoUnlock(blob, opts) {
644
679
  unsealedMap[userId] = { kind: credKind, value: entry.sealed };
645
680
  continue;
646
681
  }
647
- throw new BundleSealMismatchError(userId, entry.pid);
682
+ throw new PodSealMismatchError(userId, entry.pid);
648
683
  }
649
684
  const plaintextBytes = await provider.unseal(base64ToBytes(entry.sealed));
650
685
  unsealedMap[userId] = { kind: credKind, value: decoder.decode(plaintextBytes) };
@@ -777,7 +812,7 @@ async function applySatelliteLivenessFilter(vault, dumpJson) {
777
812
  if (!backup.collections || typeof backup.collections !== "object") return dumpJson;
778
813
  if (typeof vault._introspectState !== "function") return dumpJson;
779
814
  const { adapter, name, getDEK } = vault._introspectState();
780
- const { liveBaseIdSetsForBundle } = await import("./dead-filter-ENRIOQIE.js");
815
+ const { liveBaseIdSetsForBundle } = await import("./dead-filter-UALP5DJX.js");
781
816
  const satLive = await liveBaseIdSetsForBundle(adapter, name, Object.keys(backup.collections), getDEK);
782
817
  if (satLive.size === 0) return dumpJson;
783
818
  const next = {};
@@ -817,7 +852,8 @@ async function applyPlaintextFilters(vault, dumpJson, opts) {
817
852
  if (where !== void 0) {
818
853
  const record = await vault._decryptEnvelopeForBundleFilter(
819
854
  env,
820
- collName
855
+ collName,
856
+ id
821
857
  );
822
858
  const ok = await where(record, { collection: collName, id });
823
859
  if (!ok) continue;
@@ -829,13 +865,13 @@ async function applyPlaintextFilters(vault, dumpJson, opts) {
829
865
  backup.collections = next;
830
866
  return JSON.stringify(backup);
831
867
  }
832
- async function assembleBundleContainer(opts) {
868
+ async function assemblePodContainer(opts) {
833
869
  const dumpBytes = new TextEncoder().encode(opts.bodyJsonStr);
834
870
  const { format, streamFormat } = selectCompression(opts.compression);
835
871
  const body = streamFormat === null ? dumpBytes : await pumpThroughStream(dumpBytes, new CompressionStream(streamFormat));
836
872
  const bodySha256 = await sha256Hex2(body);
837
873
  const header = {
838
- formatVersion: NOYDB_BUNDLE_FORMAT_VERSION,
874
+ formatVersion: NOYDB_POD_FORMAT_VERSION,
839
875
  handle: opts.handle,
840
876
  bodyBytes: body.length,
841
877
  bodySha256,
@@ -851,19 +887,20 @@ async function assembleBundleContainer(opts) {
851
887
  ...opts.headerExtras?.redirect !== void 0 ? { redirect: opts.headerExtras.redirect } : {}
852
888
  };
853
889
  const signed = opts.signer === void 0 ? header : await (async (s) => {
854
- const toSign = { ...header, formatVersion: NOYDB_BUNDLE_FORMAT_VERSION_SIGNED, keyId: s.keyId, sigAlg: "ed25519" };
890
+ const toSign = { ...header, formatVersion: NOYDB_POD_FORMAT_VERSION_SIGNED, keyId: s.keyId, sigAlg: "ed25519" };
855
891
  const sig = await signRecord(s.privateKeyPkcs8B64, toSign);
856
892
  return { ...toSign, sig };
857
893
  })(opts.signer);
858
- const headerBytes = encodeBundleHeader(signed);
859
- const prefix = new Uint8Array(NOYDB_BUNDLE_PREFIX_BYTES);
860
- prefix.set(NOYDB_BUNDLE_MAGIC, 0);
894
+ const headerBytes = encodePodHeader(signed);
895
+ const prefix = new Uint8Array(NOYDB_POD_PREFIX_BYTES);
896
+ prefix.set(NOYDB_POD_MAGIC, 0);
861
897
  prefix[4] = (streamFormat === null ? 0 : FLAG_COMPRESSED) | FLAG_HAS_INTEGRITY_HASH;
862
898
  prefix[5] = format;
863
899
  writeUint32BE(prefix, 6, headerBytes.length);
864
900
  return concatBytes([prefix, headerBytes, body]);
865
901
  }
866
902
  async function writePod(vault, opts = {}) {
903
+ assertKnownWritePodOptions(opts);
867
904
  if (opts.exportSecret !== void 0 && opts.recipients !== void 0) {
868
905
  throw new Error(
869
906
  "writePod: pass either exportSecret or recipients, not both"
@@ -871,7 +908,7 @@ async function writePod(vault, opts = {}) {
871
908
  }
872
909
  const normalizedAutoUnlock = normalizeAutoUnlock(opts);
873
910
  const autoUnlockMode = validateAutoUnlockOptions(opts, normalizedAutoUnlock);
874
- const handle = await vault.getBundleHandle();
911
+ const handle = await vault.getPodHandle();
875
912
  const dumpJson = await vault.dump();
876
913
  const satelliteFiltered = await applySatelliteLivenessFilter(vault, dumpJson);
877
914
  const rekeyed = await applyRecipientRewrap(vault, satelliteFiltered, opts);
@@ -880,7 +917,7 @@ async function writePod(vault, opts = {}) {
880
917
  const bodyJsonStr = normalizedAutoUnlock === null ? filtered : JSON.stringify(await buildAutoUnlockWrapper(filtered, normalizedAutoUnlock));
881
918
  const cover = await vault.getCover();
882
919
  const signer = opts.sign === false ? void 0 : opts.sign !== void 0 ? opts.sign : await vault._loadPodSigner() ?? void 0;
883
- return assembleBundleContainer({
920
+ return assemblePodContainer({
884
921
  handle,
885
922
  bodyJsonStr,
886
923
  compression: opts.compression,
@@ -899,16 +936,15 @@ async function writePod(vault, opts = {}) {
899
936
  ...signer !== void 0 ? { signer } : {}
900
937
  });
901
938
  }
902
- var writeNoydbBundle = writePod;
903
939
  function parsePrefixAndHeader(bytes) {
904
- if (!hasNoydbBundleMagic(bytes)) {
940
+ if (!hasNoydbPodMagic(bytes)) {
905
941
  throw new Error(
906
942
  `Not a .noydb bundle: missing 'NDB1' magic prefix. The first 4 bytes are ${[...bytes.slice(0, 4)].map((b) => b.toString(16).padStart(2, "0")).join(" ")}.`
907
943
  );
908
944
  }
909
- if (bytes.length < NOYDB_BUNDLE_PREFIX_BYTES) {
945
+ if (bytes.length < NOYDB_POD_PREFIX_BYTES) {
910
946
  throw new Error(
911
- `Truncated .noydb bundle: file is only ${bytes.length} bytes, which is less than the ${NOYDB_BUNDLE_PREFIX_BYTES}-byte fixed prefix.`
947
+ `Truncated .noydb bundle: file is only ${bytes.length} bytes, which is less than the ${NOYDB_POD_PREFIX_BYTES}-byte fixed prefix.`
912
948
  );
913
949
  }
914
950
  const flags = bytes[4];
@@ -919,20 +955,19 @@ function parsePrefixAndHeader(bytes) {
919
955
  );
920
956
  }
921
957
  const headerLength = readUint32BE(bytes, 6);
922
- const bodyOffset = NOYDB_BUNDLE_PREFIX_BYTES + headerLength;
958
+ const bodyOffset = NOYDB_POD_PREFIX_BYTES + headerLength;
923
959
  if (bodyOffset > bytes.length) {
924
960
  throw new Error(
925
961
  `Truncated .noydb bundle: declared header length ${headerLength} would extend past end of file (${bytes.length} bytes).`
926
962
  );
927
963
  }
928
- const headerBytes = bytes.slice(NOYDB_BUNDLE_PREFIX_BYTES, bodyOffset);
929
- const header = decodeBundleHeader(headerBytes);
964
+ const headerBytes = bytes.slice(NOYDB_POD_PREFIX_BYTES, bodyOffset);
965
+ const header = decodePodHeader(headerBytes);
930
966
  return { header, bodyOffset, algo, flags };
931
967
  }
932
968
  function readPodHeader(bytes) {
933
969
  return parsePrefixAndHeader(bytes).header;
934
970
  }
935
- var readNoydbBundleHeader = readPodHeader;
936
971
  async function verifyPodHeader(bytes, trustedKeys) {
937
972
  const { header } = parsePrefixAndHeader(bytes);
938
973
  if (header.sig === void 0 || header.keyId === void 0 || header.sigAlg === void 0) {
@@ -965,13 +1000,13 @@ async function readPod(bytes, opts = {}) {
965
1000
  const { header, bodyOffset, algo } = parsePrefixAndHeader(bytes);
966
1001
  const body = bytes.slice(bodyOffset);
967
1002
  if (body.length !== header.bodyBytes) {
968
- throw new BundleIntegrityError(
1003
+ throw new PodIntegrityError(
969
1004
  `body length ${body.length} does not match header.bodyBytes ${header.bodyBytes}. The bundle was truncated or padded between write and read.`
970
1005
  );
971
1006
  }
972
1007
  const actualSha = await sha256Hex2(body);
973
1008
  if (actualSha !== header.bodySha256) {
974
- throw new BundleIntegrityError(
1009
+ throw new PodIntegrityError(
975
1010
  `body sha256 ${actualSha} does not match header.bodySha256 ${header.bodySha256}. The bundle bytes were modified between write and read \u2014 refuse to decompress.`
976
1011
  );
977
1012
  }
@@ -983,7 +1018,7 @@ async function readPod(bytes, opts = {}) {
983
1018
  try {
984
1019
  dumpBytes = await pumpThroughStream(body, new DecompressionStream(streamFormat));
985
1020
  } catch (err) {
986
- throw new BundleIntegrityError(
1021
+ throw new PodIntegrityError(
987
1022
  `decompression failed: ${err.message}. The bundle passed the integrity hash but the body is not valid ${streamFormat} data \u2014 likely a producer bug.`
988
1023
  );
989
1024
  }
@@ -996,20 +1031,19 @@ async function readPod(bytes, opts = {}) {
996
1031
  const autoUnlock = await resolveAutoUnlock(blob, opts);
997
1032
  return { header, dumpJson: dump, autoUnlock };
998
1033
  }
999
- var readNoydbBundle = readPod;
1000
1034
 
1001
1035
  export {
1002
- NOYDB_BUNDLE_MAGIC,
1003
- NOYDB_BUNDLE_PREFIX_BYTES,
1004
- NOYDB_BUNDLE_FORMAT_VERSION,
1036
+ NOYDB_POD_MAGIC,
1037
+ NOYDB_POD_PREFIX_BYTES,
1038
+ NOYDB_POD_FORMAT_VERSION,
1005
1039
  FLAG_COMPRESSED,
1006
1040
  FLAG_HAS_INTEGRITY_HASH,
1007
1041
  COMPRESSION_NONE,
1008
1042
  COMPRESSION_GZIP,
1009
1043
  COMPRESSION_BROTLI,
1010
- validateBundleHeader,
1011
- encodeBundleHeader,
1012
- hasNoydbBundleMagic,
1044
+ validatePodHeaderFields,
1045
+ encodePodHeader,
1046
+ hasNoydbPodMagic,
1013
1047
  POD_SIG_ALG,
1014
1048
  signedBytes,
1015
1049
  signRecord,
@@ -1017,15 +1051,12 @@ export {
1017
1051
  buildExtractedPartitionWrapper,
1018
1052
  parseExtractedPartitionBody,
1019
1053
  resetBrotliSupportCache,
1020
- assembleBundleContainer,
1054
+ assemblePodContainer,
1021
1055
  writePod,
1022
- writeNoydbBundle,
1023
1056
  readPodHeader,
1024
- readNoydbBundleHeader,
1025
1057
  verifyPodHeader,
1026
1058
  readPodCover,
1027
1059
  readPodRedirect,
1028
- readPod,
1029
- readNoydbBundle
1060
+ readPod
1030
1061
  };
1031
- //# sourceMappingURL=chunk-VOQW5LAM.js.map
1062
+ //# sourceMappingURL=chunk-QSIEL6TL.js.map