@delali/narsil 0.3.1-next.153 → 0.3.1-next.154

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 (268) hide show
  1. package/README.md +2 -1
  2. package/dist/adapters/filesystem.mjs +2 -2
  3. package/dist/adapters/gcs.mjs +2 -2
  4. package/dist/adapters/indexeddb.mjs +1 -1
  5. package/dist/adapters/s3.mjs +2 -2
  6. package/dist/{analysis-change-2OYM7ARW.mjs → analysis-change-4GCRVRBW.mjs} +27 -18
  7. package/dist/{react-native/chunks/analysis-change-entry-CXNRW324.mjs → analysis-change-entry-KYGSXW4K.mjs} +1 -1
  8. package/dist/browser/{analysis-change-2V2HZ2NY.mjs → analysis-change-IXWPXXJJ.mjs} +17 -7
  9. package/dist/{analysis-change-entry-QD7YNDEE.mjs → browser/analysis-change-entry-FCSHFQSS.mjs} +1 -1
  10. package/dist/browser/{chunk-TQ5UMFG5.mjs → chunk-2FX6ROWR.mjs} +15 -6
  11. package/dist/browser/{chunk-KWYQ6KX4.mjs → chunk-2SHAKW2Z.mjs} +119 -1922
  12. package/dist/browser/{chunk-55WYRLDZ.mjs → chunk-3U3QR5YP.mjs} +2 -2
  13. package/dist/browser/chunk-4PD752F6.mjs +85 -0
  14. package/dist/browser/chunk-5W3MMTLG.mjs +19 -0
  15. package/dist/browser/{chunk-IAXZAVYL.mjs → chunk-7MEYN7V6.mjs} +1 -151
  16. package/dist/browser/chunk-7TTWXUH6.mjs +1828 -0
  17. package/dist/browser/{chunk-CSCKZBVJ.mjs → chunk-AJ4HHOVT.mjs} +4 -4
  18. package/dist/{react-native/chunks/chunk-DFQJ4IJB.mjs → browser/chunk-AYY6PIKL.mjs} +2 -2
  19. package/dist/browser/{chunk-VD7JEUIR.mjs → chunk-C4KS2QNF.mjs} +9 -8
  20. package/dist/browser/chunk-DSXIBE6N.mjs +78 -0
  21. package/dist/browser/chunk-ELV4OZOI.mjs +29 -0
  22. package/dist/browser/{chunk-PM4MUM5N.mjs → chunk-EUNBNLKM.mjs} +6 -5
  23. package/dist/browser/{chunk-GJKXW3SF.mjs → chunk-G7LUMBSG.mjs} +137 -253
  24. package/dist/browser/{chunk-B3JM6Z74.mjs → chunk-H6QFBMVE.mjs} +3 -2
  25. package/dist/browser/chunk-J433A7P3.mjs +241 -0
  26. package/dist/browser/chunk-ML6HY7T7.mjs +96 -0
  27. package/dist/browser/chunk-ML7THVLJ.mjs +38 -0
  28. package/dist/{chunk-MDF6PDIA.mjs → browser/chunk-MYITLCHT.mjs} +7 -1
  29. package/dist/browser/{chunk-QJCO3TJU.mjs → chunk-QXTPSX2H.mjs} +9 -150
  30. package/dist/browser/{chunk-MPK76GVS.mjs → chunk-RA6LSBCM.mjs} +1 -21
  31. package/dist/browser/{chunk-7ZJTRUVW.mjs → chunk-SIR3LMTV.mjs} +2 -2
  32. package/dist/browser/{chunk-LURXVCHG.mjs → chunk-SJB6VIZG.mjs} +1 -1
  33. package/dist/browser/chunk-TTD27VXX.mjs +298 -0
  34. package/dist/browser/chunk-U2E3HMYW.mjs +151 -0
  35. package/dist/browser/{chunk-2A2IPRC3.mjs → chunk-VCOYGVP7.mjs} +5 -31
  36. package/dist/browser/chunk-VI7BQR4U.mjs +21 -0
  37. package/dist/browser/chunk-W5X2UFWQ.mjs +102 -0
  38. package/dist/browser/{chunk-HT7J73QL.mjs → chunk-XRV72TJD.mjs} +2 -2
  39. package/dist/browser/chunk-YJHGOJAC.mjs +15 -0
  40. package/dist/browser/chunk-ZI2V4VD7.mjs +21 -0
  41. package/dist/{react-native/chunks/chunk-QC4ZRBSX.mjs → browser/chunk-ZPTA75ZC.mjs} +2 -79
  42. package/dist/browser/{cold-module-YECAK4MN.mjs → cold-module-VTUGDYNY.mjs} +20 -14
  43. package/dist/browser/{durability-wiring-LM7WFL6X.mjs → durability-wiring-GL4A7KDV.mjs} +1886 -1364
  44. package/dist/browser/import-YI5GNB4H.mjs +17 -0
  45. package/dist/browser/methods-LMUTS7OI.mjs +30 -0
  46. package/dist/browser/{module-XQLEOYNM.mjs → module-EC3FYW7N.mjs} +9 -8
  47. package/dist/browser/{module-KAMRAJLE.mjs → module-M4JNBV6V.mjs} +16 -10
  48. package/dist/browser/operations-WVYLF72Q.mjs +5 -0
  49. package/dist/browser/{phrase-module-CNKMUY4U.mjs → phrase-module-NPYUVX75.mjs} +1 -1
  50. package/dist/browser/{pool-DTYSPBMQ.mjs → pool-WCGDZHJP.mjs} +3 -2
  51. package/dist/{restore-queue-AOF5OTQV.mjs → browser/restore-queue-TYIGDL5L.mjs} +2 -2
  52. package/dist/browser/retention-6QMRS5VK.mjs +207 -0
  53. package/dist/browser/{runtime-D2ULZGCN.mjs → runtime-3EW2AGB6.mjs} +1 -1
  54. package/dist/browser/{snapshot-UGZVMP4H.mjs → snapshot-DN3CRVUQ.mjs} +38 -307
  55. package/dist/browser/sync-state-P5XG6LTQ.mjs +15 -0
  56. package/dist/browser/{write-I5P5MW4O.mjs → write-WAWAFGKQ.mjs} +16 -11
  57. package/dist/{capabilities-BT-HLDC8.d.ts → capabilities-B3Brs1Rc.d.ts} +62 -7
  58. package/dist/{chunk-DGRM4EZZ.mjs → chunk-37IVJLP6.mjs} +1 -1
  59. package/dist/{chunk-KYVRZAYP.mjs → chunk-3A5KI24C.mjs} +2 -69
  60. package/dist/{chunk-POUYICOU.mjs → chunk-3OFU3NJT.mjs} +1 -1
  61. package/dist/{chunk-3TVDTACC.mjs → chunk-3Y3J4V2R.mjs} +1 -1
  62. package/dist/{chunk-FNBNZCGP.mjs → chunk-466PYR4P.mjs} +2 -2
  63. package/dist/{chunk-SEAJS664.mjs → chunk-4HWZV5MK.mjs} +5 -5
  64. package/dist/{chunk-UGVUW27S.mjs → chunk-5FUOVJKG.mjs} +13 -9
  65. package/dist/{chunk-ZHAXP7SD.mjs → chunk-5KGYQT6W.mjs} +6 -235
  66. package/dist/{chunk-NPXVQS33.mjs → chunk-62G63NMH.mjs} +4 -3
  67. package/dist/chunk-6MSZ543Y.mjs +32 -0
  68. package/dist/chunk-7GXJUJ24.mjs +49 -0
  69. package/dist/{chunk-3E4RRF5J.mjs → chunk-7HCZWC7B.mjs} +58 -8
  70. package/dist/{chunk-6RKSY3BX.mjs → chunk-7NTMUDC5.mjs} +5 -5
  71. package/dist/chunk-7QUGDVFC.mjs +101 -0
  72. package/dist/{chunk-G5KHSM6E.mjs → chunk-AO2FAYIZ.mjs} +1 -1
  73. package/dist/chunk-B7S6YEBP.mjs +102 -0
  74. package/dist/{chunk-AWNHDBKV.mjs → chunk-BPSKLCS7.mjs} +15 -7
  75. package/dist/chunk-BUMREPLU.mjs +15 -0
  76. package/dist/{chunk-T4CJDBBE.mjs → chunk-C6ASEFZI.mjs} +1 -1
  77. package/dist/{chunk-NITCPDFL.mjs → chunk-C73JLU4E.mjs} +2 -2
  78. package/dist/{chunk-NYSONUB7.mjs → chunk-CP5RRPJR.mjs} +1 -1
  79. package/dist/{chunk-TTCKT2RT.mjs → chunk-DMQPFLGI.mjs} +134 -11
  80. package/dist/{chunk-3SBJVQLL.mjs → chunk-DVWYODEB.mjs} +2 -2
  81. package/dist/chunk-ECX4SGX6.mjs +167 -0
  82. package/dist/chunk-GES7U2PM.mjs +68 -0
  83. package/dist/{chunk-NVTFQFUL.mjs → chunk-HVKXNBFL.mjs} +1 -1
  84. package/dist/chunk-HVYICDY3.mjs +214 -0
  85. package/dist/{chunk-3HV7M5OJ.mjs → chunk-HWEDFLB7.mjs} +9 -133
  86. package/dist/{chunk-52QQWEBS.mjs → chunk-IBNLW3AV.mjs} +21 -6
  87. package/dist/chunk-IJU7LL7D.mjs +242 -0
  88. package/dist/chunk-IPN7S4KX.mjs +130 -0
  89. package/dist/{chunk-5QMHMELB.mjs → chunk-IQ4R2I6N.mjs} +4 -1
  90. package/dist/chunk-JCLTESFN.mjs +96 -0
  91. package/dist/{chunk-J4BDAH2W.mjs → chunk-JFNKIBDT.mjs} +2 -2
  92. package/dist/{chunk-LDGGR7YT.mjs → chunk-K4B7OH65.mjs} +2 -2
  93. package/dist/{chunk-7TE2AJIH.mjs → chunk-K7KLL263.mjs} +13 -10
  94. package/dist/{chunk-CSHHU7PA.mjs → chunk-KCUIFVVW.mjs} +11 -30
  95. package/dist/{react-native/chunks/chunk-YH7W556M.mjs → chunk-KUZKUONM.mjs} +11 -2
  96. package/dist/chunk-KYYABCSW.mjs +72 -0
  97. package/dist/{chunk-B2FTZNNF.mjs → chunk-LKUE5GXS.mjs} +34 -14
  98. package/dist/{chunk-2PNYKG2D.mjs → chunk-LSM2YTKM.mjs} +100 -335
  99. package/dist/{chunk-DMNPYF54.mjs → chunk-LTUGDMV4.mjs} +2 -2
  100. package/dist/{chunk-FDG4KXX5.mjs → chunk-MLHNSAPK.mjs} +5 -3
  101. package/dist/{chunk-VP6XRMWR.mjs → chunk-MMBEANB2.mjs} +6 -32
  102. package/dist/{chunk-LJ4ENXOD.mjs → chunk-MMEMEUOO.mjs} +2 -2
  103. package/dist/{chunk-2HJWQPR6.mjs → chunk-NTZOXVUZ.mjs} +6 -122
  104. package/dist/{chunk-5WB2A3XU.mjs → chunk-NZMAXR2S.mjs} +397 -24
  105. package/dist/{chunk-IZT3G24Q.mjs → chunk-O43Z4MS6.mjs} +2 -2
  106. package/dist/{chunk-U46IZNCW.mjs → chunk-OKX2BBNW.mjs} +3 -2
  107. package/dist/{chunk-RBEHLIKX.mjs → chunk-PFKM7VNZ.mjs} +14 -8
  108. package/dist/chunk-PGVPE7GJ.mjs +96 -0
  109. package/dist/chunk-Q3TCTQCC.mjs +85 -0
  110. package/dist/chunk-Q7MS6P2J.mjs +74 -0
  111. package/dist/chunk-QDZJM7NI.mjs +23 -0
  112. package/dist/{chunk-ZS6CMXAE.mjs → chunk-QKZHLADX.mjs} +89 -250
  113. package/dist/{chunk-IJSFWGVW.mjs → chunk-REL7LFLR.mjs} +3 -3
  114. package/dist/chunk-RVKFI3A2.mjs +237 -0
  115. package/dist/chunk-S2N75OTN.mjs +83 -0
  116. package/dist/chunk-TRISKD4Q.mjs +50 -0
  117. package/dist/{chunk-6F6USYII.mjs → chunk-TV2L3BN7.mjs} +13 -11
  118. package/dist/{chunk-6BWLDLS3.mjs → chunk-URPCYQVJ.mjs} +1 -1
  119. package/dist/chunk-USR7FQRZ.mjs +34 -0
  120. package/dist/chunk-V6EUBAIT.mjs +19 -0
  121. package/dist/{chunk-SOUZMPME.mjs → chunk-VMXSVVXG.mjs} +7 -194
  122. package/dist/{chunk-4QCSHLNM.mjs → chunk-VREK3MYG.mjs} +3 -3
  123. package/dist/{chunk-YGQOPB2Z.mjs → chunk-WCBA2LVZ.mjs} +1 -1
  124. package/dist/{chunk-KQJVNPRM.mjs → chunk-X6NSJYQ3.mjs} +19 -16
  125. package/dist/chunk-Y4WPNHMC.mjs +50 -0
  126. package/dist/{chunk-IRWP524D.mjs → chunk-YBJDOA2T.mjs} +1 -1
  127. package/dist/{chunk-IJPK5PGM.mjs → chunk-YPUEV6ZC.mjs} +1 -1
  128. package/dist/{chunk-J7M73VY7.mjs → chunk-YROWNOMH.mjs} +1 -1
  129. package/dist/chunk-Z3TNWCI5.mjs +196 -0
  130. package/dist/{chunk-65WCV5JO.mjs → chunk-ZIFJXCKA.mjs} +1 -1
  131. package/dist/chunk-ZYAY26KG.mjs +29 -0
  132. package/dist/{client-Cn3gNxUU.d.ts → client-Df76GNKm.d.ts} +76 -6
  133. package/dist/client.d.ts +8 -7
  134. package/dist/client.mjs +56 -5
  135. package/dist/{cold-module-PYSSBIL7.mjs → cold-module-YLWMTTZG.mjs} +38 -28
  136. package/dist/{config-CfhH1IWQ.d.ts → config-05G_hy-1.d.ts} +3 -3
  137. package/dist/config-B8DP2VwR.d.ts +463 -0
  138. package/dist/{direct-executor-WYALQSMD.mjs → direct-executor-FI5GJHWX.mjs} +14 -9
  139. package/dist/distribution/coordinator/etcd.d.ts +2 -2
  140. package/dist/distribution/coordinator/etcd.mjs +1 -1
  141. package/dist/distribution/coordinator/in-memory.d.ts +2 -2
  142. package/dist/distribution/transport/grpc.mjs +4 -4
  143. package/dist/distribution/transport/in-memory.mjs +2 -2
  144. package/dist/distribution/transport/tcp.mjs +3 -3
  145. package/dist/distribution.d.ts +41 -9
  146. package/dist/distribution.mjs +1296 -117
  147. package/dist/{durability-wiring-7VBZEJLG.mjs → durability-wiring-RHLXDIVF.mjs} +1751 -1226
  148. package/dist/embeddings/openai.mjs +2 -2
  149. package/dist/{engine-CJRUHXgf.d.ts → engine-DYu-e0oR.d.ts} +50 -40
  150. package/dist/{import-GJOMB2HC.mjs → import-SRBNC6TE.mjs} +27 -19
  151. package/dist/{index-MsF7e5hL.d.ts → index-nRqDM6uS.d.ts} +1 -1
  152. package/dist/index.browser.mjs +8 -4
  153. package/dist/index.d.ts +7 -6
  154. package/dist/index.mjs +24 -16
  155. package/dist/index.react-native.mjs +17 -11
  156. package/dist/{long-query-thread-SCUE62TO.mjs → long-query-thread-EMYTGSJP.mjs} +28 -15
  157. package/dist/methods-ABM5ELBR.mjs +30 -0
  158. package/dist/{module-AVQEIB7O.mjs → module-3OMJZUFT.mjs} +12 -12
  159. package/dist/{module-6RLIKSZQ.mjs → module-MG7JMV2U.mjs} +33 -23
  160. package/dist/operations-PGOAY2KS.mjs +5 -0
  161. package/dist/{paged-partition-archive-KGRW366Y.mjs → paged-partition-archive-UOLHOEZJ.mjs} +37 -26
  162. package/dist/partial-words.mjs +6 -4
  163. package/dist/pattern.mjs +4 -3
  164. package/dist/persistence/durability/checkpoint-worker.d.ts +9 -1
  165. package/dist/persistence/durability/checkpoint-worker.mjs +34 -23
  166. package/dist/{phrase-module-OUQIRUQU.mjs → phrase-module-O3MDRQXP.mjs} +1 -1
  167. package/dist/{pool-UPV5PVPY.mjs → pool-CQXYPFLG.mjs} +2 -2
  168. package/dist/react-native/chunks/{analysis-change-DXPZRGWF.mjs → analysis-change-EAYO3Y6Q.mjs} +27 -15
  169. package/dist/{browser/analysis-change-entry-JL5U2N3Q.mjs → react-native/chunks/analysis-change-entry-TNLUC6IZ.mjs} +1 -1
  170. package/dist/react-native/chunks/{chunk-D7LFYPYI.mjs → chunk-2CGSQM4O.mjs} +12 -10
  171. package/dist/react-native/chunks/chunk-3NQOVO3K.mjs +1 -0
  172. package/dist/react-native/chunks/{chunk-R4OPUZQ5.mjs → chunk-3O57C2ZO.mjs} +2 -2
  173. package/dist/react-native/chunks/chunk-3XKMRNRE.mjs +298 -0
  174. package/dist/react-native/chunks/{chunk-IDFMNRIC.mjs → chunk-63YSZOXB.mjs} +97 -333
  175. package/dist/react-native/chunks/{chunk-UFNCLEQM.mjs → chunk-75VWIY35.mjs} +1 -1
  176. package/dist/react-native/chunks/{chunk-2J2727V4.mjs → chunk-7GWPJDOA.mjs} +1 -1
  177. package/dist/react-native/chunks/{chunk-PU55IOG4.mjs → chunk-AUT7PMA4.mjs} +6 -190
  178. package/dist/react-native/chunks/chunk-C2H2QQFW.mjs +288 -0
  179. package/dist/react-native/chunks/chunk-CHPTFFJM.mjs +43 -0
  180. package/dist/{browser/chunk-PIS7ZAP7.mjs → react-native/chunks/chunk-CUNGPR5R.mjs} +11 -2
  181. package/dist/{browser/chunk-NVEJJP4R.mjs → react-native/chunks/chunk-DCKMICOB.mjs} +2 -79
  182. package/dist/react-native/chunks/chunk-DH3TVWWK.mjs +102 -0
  183. package/dist/react-native/chunks/{chunk-ZCKNBPQ4.mjs → chunk-EH5CFV6Z.mjs} +2 -2
  184. package/dist/react-native/chunks/chunk-F753DA54.mjs +23 -0
  185. package/dist/{browser/chunk-VBX2TI5V.mjs → react-native/chunks/chunk-GFYFQLJD.mjs} +2 -2
  186. package/dist/react-native/chunks/{chunk-7IQR3SZO.mjs → chunk-I5PGWQJF.mjs} +142 -257
  187. package/dist/react-native/chunks/{chunk-NFGBOI46.mjs → chunk-IOY2SM2P.mjs} +1 -1
  188. package/dist/react-native/chunks/chunk-JDOEEMEF.mjs +38 -0
  189. package/dist/react-native/chunks/{chunk-TLYD7IJ2.mjs → chunk-JPAJWO6D.mjs} +1 -1
  190. package/dist/react-native/chunks/chunk-JWUCMVRK.mjs +15 -0
  191. package/dist/react-native/chunks/{chunk-KLZGAOLT.mjs → chunk-JX2RIAXH.mjs} +4 -4
  192. package/dist/react-native/chunks/chunk-LU3Y3P63.mjs +68 -0
  193. package/dist/react-native/chunks/{chunk-LQAKO5QV.mjs → chunk-NCJS3WIY.mjs} +2 -2
  194. package/dist/react-native/chunks/{chunk-BRNAVOKP.mjs → chunk-NKIZX26F.mjs} +2 -2
  195. package/dist/react-native/chunks/{chunk-CLE3LZ77.mjs → chunk-NP7DD4G5.mjs} +5 -4
  196. package/dist/react-native/chunks/chunk-NVVRSRX5.mjs +78 -0
  197. package/dist/react-native/chunks/chunk-O32RB3BL.mjs +191 -0
  198. package/dist/react-native/chunks/{chunk-DKJTZ625.mjs → chunk-OQQVRWZ2.mjs} +2 -69
  199. package/dist/react-native/chunks/chunk-PB2YXVQW.mjs +29 -0
  200. package/dist/react-native/chunks/chunk-Q32DDFKX.mjs +19 -0
  201. package/dist/react-native/chunks/{chunk-LRGWK367.mjs → chunk-RVAEBN74.mjs} +1 -1
  202. package/dist/react-native/chunks/{chunk-KOCTCUXW.mjs → chunk-RYMDHGL4.mjs} +16 -8
  203. package/dist/react-native/chunks/chunk-SJWDBRNP.mjs +85 -0
  204. package/dist/react-native/chunks/chunk-UNUFZ2QY.mjs +68 -0
  205. package/dist/react-native/chunks/chunk-UWDNZDWK.mjs +242 -0
  206. package/dist/react-native/chunks/{chunk-FS7BYE23.mjs → chunk-VQSKZ3EZ.mjs} +9 -152
  207. package/dist/react-native/chunks/{chunk-UCJU6WNH.mjs → chunk-VVFYOADG.mjs} +7 -6
  208. package/dist/react-native/chunks/{chunk-VGUWIZFQ.mjs → chunk-YBEW6YTR.mjs} +1 -1
  209. package/dist/react-native/chunks/{chunk-JYL35A4A.mjs → chunk-YHKZSLOC.mjs} +7 -33
  210. package/dist/react-native/chunks/{chunk-3CTWSQRW.mjs → chunk-ZBSWRSBG.mjs} +4 -30
  211. package/dist/react-native/chunks/chunk-ZYDKJXQJ.mjs +96 -0
  212. package/dist/react-native/chunks/{cold-module-KFGEWYEL.mjs → cold-module-TJL6AFAD.mjs} +29 -21
  213. package/dist/react-native/chunks/{durability-wiring-QKJB2QBT.mjs → durability-wiring-RRDYJLLM.mjs} +1882 -1358
  214. package/dist/react-native/chunks/gzip.react-native-DNB5YNFA.mjs +3 -0
  215. package/dist/react-native/chunks/import-JYBMEJPQ.mjs +29 -0
  216. package/dist/react-native/chunks/methods-X6F36SJE.mjs +30 -0
  217. package/dist/react-native/chunks/module-QT5HZAY4.mjs +33 -0
  218. package/dist/react-native/chunks/{module-UJ5VUARS.mjs → module-S4DKSWMF.mjs} +10 -9
  219. package/dist/react-native/chunks/operations-RYKTSZQA.mjs +5 -0
  220. package/dist/react-native/chunks/{phrase-module-76UAPPSG.mjs → phrase-module-JZ37TB7N.mjs} +1 -1
  221. package/dist/react-native/chunks/{pool-CD4ANYUI.mjs → pool-RTGXJXPU.mjs} +3 -2
  222. package/dist/{browser/restore-queue-UQ6AAUVX.mjs → react-native/chunks/restore-queue-ZBVIKJWI.mjs} +2 -2
  223. package/dist/react-native/chunks/retention-PPCTP2VY.mjs +219 -0
  224. package/dist/react-native/chunks/{runtime-3MCDLJAF.mjs → runtime-KUATOLYB.mjs} +1 -1
  225. package/dist/react-native/chunks/{snapshot-KVBD4LRC.mjs → snapshot-ZBIEOZTZ.mjs} +47 -314
  226. package/dist/react-native/chunks/sync-state-PASCIHHT.mjs +15 -0
  227. package/dist/react-native/chunks/{write-ES5A3WUA.mjs → write-2W4FTX7J.mjs} +25 -18
  228. package/dist/react-native/partial-words.mjs +6 -4
  229. package/dist/react-native/pattern.mjs +4 -3
  230. package/dist/react-native/sync.mjs +2236 -0
  231. package/dist/react-native/synonyms.mjs +7 -4
  232. package/dist/react.d.ts +10 -9
  233. package/dist/react.mjs +7 -1
  234. package/dist/{rerank-3W54N6P2.mjs → rerank-IZOB6NII.mjs} +4 -4
  235. package/dist/rerankers/http.mjs +2 -2
  236. package/dist/{react-native/chunks/restore-queue-H5VCN453.mjs → restore-queue-COI2GSSK.mjs} +2 -2
  237. package/dist/retention-55WA7GPU.mjs +58 -0
  238. package/dist/{runtime-L2DZYY6N.mjs → runtime-UZOC3NPY.mjs} +5 -5
  239. package/dist/{schema-D33CyXCy.d.ts → schema-DDauvDOv.d.ts} +1 -1
  240. package/dist/server.d.ts +22 -19
  241. package/dist/server.mjs +868 -50
  242. package/dist/{snapshot-WMX6JCLP.mjs → snapshot-NFX2EYN2.mjs} +62 -36
  243. package/dist/sync/filesystem.d.ts +30 -0
  244. package/dist/sync/filesystem.mjs +271 -0
  245. package/dist/sync/indexeddb.d.ts +30 -0
  246. package/dist/sync/indexeddb.mjs +237 -0
  247. package/dist/sync-state-ZWHLAFLE.mjs +15 -0
  248. package/dist/{config-aIsy7mcL.d.ts → sync-uXR7MmM7.d.ts} +53 -444
  249. package/dist/sync.browser.mjs +2231 -0
  250. package/dist/sync.d.ts +23 -0
  251. package/dist/sync.mjs +2206 -0
  252. package/dist/synonyms.mjs +5 -3
  253. package/dist/{tasks-C4ElXr4P.d.ts → tasks-BShx8pdK.d.ts} +4 -4
  254. package/dist/thread-P2G2FWM2.mjs +44 -0
  255. package/dist/types-SnO7_tAI.d.ts +228 -0
  256. package/dist/vector/search-worker.d.ts +1 -1
  257. package/dist/vector/search-worker.mjs +6 -6
  258. package/dist/workers/entry.mjs +7 -7
  259. package/dist/{write-SKJ6HW7O.mjs → write-FGB62BHQ.mjs} +31 -23
  260. package/openapi.json +119 -3
  261. package/package.json +28 -8
  262. package/dist/browser/import-QOY6ZH6X.mjs +0 -12
  263. package/dist/chunk-7LDMWKP6.mjs +0 -209
  264. package/dist/react-native/chunks/chunk-L4M7QJNP.mjs +0 -110
  265. package/dist/react-native/chunks/gzip.react-native-7JWCLVOB.mjs +0 -3
  266. package/dist/react-native/chunks/import-XFBCCENV.mjs +0 -22
  267. package/dist/react-native/chunks/module-FHJ2GOBI.mjs +0 -25
  268. package/dist/thread-I7DVHHW7.mjs +0 -31
@@ -1,15 +1,21 @@
1
1
  import { DEFAULT_VECTOR_METRIC, defaultQuantizationFor } from './chunk-HJBJBH26.mjs';
2
- import { decodeVectorGraphPartPayload, assembleGraphParts, decodeVectorFilePayload, countDead, VECTOR_FILE_MAX_VECTORS, deadBytesFor } from './chunk-VGUWIZFQ.mjs';
3
- import { gunzip, gzip } from './chunk-LRGWK367.mjs';
4
- import { MAX_SEGMENT_ID, MANIFEST_ENVELOPE_VERSION, EARLIER_SEGMENT_MANIFEST_VERSION, SEGMENT_MANIFEST_VERSION, MAX_SEGMENTS_PER_PARTITION, segmentKey, encodeSegmentManifest, manifestKey, manifestReferencedKeys, segmentsPrefix, snapshotBundleKey, readListedFile, requireListedChecksum, vectorFileKey, DEFAULT_COMPACTION_THRESHOLD, writeSegmentsOf, readSegmentFile, graphPartKey, requireListedSize, SEGMENT_PAGE_BYTES, STABLE_HEAD_ATTEMPTS, RECORD_PAGE_BYTES, MERGED_SEGMENT_GROWTH_ALLOWANCE, MERGED_SEGMENT_TARGET_BYTES, COMPACTION_LARGEST_MERGED_DOCUMENT_COUNT, SEGMENT_FILE_FRAMING_SLACK_BYTES } from './chunk-FS7BYE23.mjs';
5
- import { restoreVectorFields } from './chunk-CLE3LZ77.mjs';
6
- import { VERSION, DEFAULT_BM25_B, DEFAULT_BM25_K1, rulesOfStoredSynonyms, openChecksummedEnvelope, isCompositePartition, crc32, reconstructSchemaFromMetadata, readHeader, HEADER_SIZE, engineVersionParts, writeHeader, packChecksummedEnvelope, packEnvelopeWithChecksum, checksumOfChunks, decodeEveryStoredDocument, createSharedFrozenSegment, shareSegmentArrays, survivorDocumentsOf, partitionStateOf, freezeSegmentShared, createFrozenSegment, createPartitionManager, createPartitionRouter, buildSegmentPayload, resolvePartitionInsertOptions, decodeMapWithoutFields, prepareDocumentVectors } from './chunk-IDFMNRIC.mjs';
7
- import { flattenSchema, requireValidFieldTypes, extractVectorFieldsFromSchema, partialFieldsOf, isQuantizationMode, isStorageMode } from './chunk-PU55IOG4.mjs';
8
- import { MAX_FILE_BYTES, VALID_HNSW_METRICS } from './chunk-TJMSKBEM.mjs';
9
- import { VECTOR_PATTERN } from './chunk-DKJTZ625.mjs';
10
- import { getLanguage, resolveIndexAnalysis } from './chunk-3CTWSQRW.mjs';
2
+ import { decodeSegmentManifest } from './chunk-UWDNZDWK.mjs';
3
+ import { isSyncEpoch } from './chunk-JWUCMVRK.mjs';
4
+ import { readListedFile, requireListedChecksum, writeSegmentsOf, readSegmentFile, requireListedSize, SEGMENT_PAGE_BYTES, STABLE_HEAD_ATTEMPTS, RECORD_PAGE_BYTES, MERGED_SEGMENT_GROWTH_ALLOWANCE, MERGED_SEGMENT_TARGET_BYTES } from './chunk-VQSKZ3EZ.mjs';
5
+ import { DEFAULT_COMPACTION_THRESHOLD, COMPACTION_LARGEST_MERGED_DOCUMENT_COUNT, SEGMENT_FILE_FRAMING_SLACK_BYTES } from './chunk-F753DA54.mjs';
6
+ import { restoreVectorFields } from './chunk-NP7DD4G5.mjs';
7
+ import { VERSION, DEFAULT_BM25_B, DEFAULT_BM25_K1, rulesOfStoredSynonyms, isCompositePartition, packChecksummedEnvelope, reconstructSchemaFromMetadata, engineVersionParts, packEnvelopeWithChecksum, decodeEveryStoredDocument, createSharedFrozenSegment, shareSegmentArrays, survivorDocumentsOf, partitionStateOf, freezeSegmentShared, createFrozenSegment, createPartitionManager, createPartitionRouter, buildSegmentPayload, resolvePartitionInsertOptions, decodeMapWithoutFields, prepareDocumentVectors } from './chunk-63YSZOXB.mjs';
8
+ import { isQuantizationMode, isStorageMode } from './chunk-AUT7PMA4.mjs';
9
+ import { SEGMENT_MANIFEST_VERSION, MANIFEST_ENVELOPE_VERSION, manifestKey, manifestReferencedKeys, segmentsPrefix, snapshotBundleKey, vectorFileKey, MAX_SEGMENTS_PER_PARTITION, graphPartKey } from './chunk-SJWDBRNP.mjs';
10
+ import { decodeVectorGraphPartPayload, assembleGraphParts, decodeVectorFilePayload, countDead } from './chunk-YBEW6YTR.mjs';
11
+ import { crc32, readHeader, HEADER_SIZE, writeHeader, openChecksummedEnvelope, checksumOfChunks } from './chunk-C2H2QQFW.mjs';
12
+ import { flattenSchema, extractVectorFieldsFromSchema, requireValidFieldTypes, partialFieldsOf } from './chunk-O32RB3BL.mjs';
13
+ import { VALID_HNSW_METRICS, MAX_FILE_BYTES } from './chunk-TJMSKBEM.mjs';
14
+ import { VECTOR_PATTERN } from './chunk-OQQVRWZ2.mjs';
15
+ import { getLanguage, resolveIndexAnalysis } from './chunk-ZBSWRSBG.mjs';
11
16
  import { compareCodePoints } from './chunk-PPEPTUVV.mjs';
12
- import { NarsilError, ErrorCodes } from './chunk-YH7W556M.mjs';
17
+ import { gunzip, gzip } from './chunk-RVAEBN74.mjs';
18
+ import { NarsilError, ErrorCodes } from './chunk-CUNGPR5R.mjs';
13
19
  import { decode, encode } from '@msgpack/msgpack';
14
20
 
15
21
  // src/engine/durability-metadata.ts
@@ -107,6 +113,9 @@ function metadataFromConfig(indexName, config, partitionCount, documentCount) {
107
113
  if (config.heldPartitions !== void 0) {
108
114
  metadata.heldPartitions = config.heldPartitions;
109
115
  }
116
+ if (config.sync !== void 0) metadata.sync = config.sync;
117
+ if (config.syncActive !== void 0) metadata.syncActive = config.syncActive;
118
+ if (config.syncEpoch !== void 0) metadata.syncEpoch = config.syncEpoch;
110
119
  return metadata;
111
120
  }
112
121
  function metadataConfigOf(entry) {
@@ -141,7 +150,21 @@ function metadataConfigOf(entry) {
141
150
  ...entry.config.required !== void 0 ? { required: entry.config.required } : {},
142
151
  ...entry.config.vectorPromotion !== void 0 ? { vectorPromotion: entry.config.vectorPromotion } : {},
143
152
  ...entry.config.patternValueLimit !== void 0 ? { patternValueLimit: entry.config.patternValueLimit } : {},
144
- ...entry.synonyms !== null ? { synonyms: rulesOfStoredSynonyms(entry.synonyms) } : {}
153
+ ...entry.synonyms !== null ? { synonyms: rulesOfStoredSynonyms(entry.synonyms) } : {},
154
+ ...syncMetadataOf(entry)
155
+ };
156
+ }
157
+ function syncMetadataOf(entry) {
158
+ const sync = entry.sync;
159
+ if (sync === null) return {};
160
+ return {
161
+ sync: {
162
+ enabled: true,
163
+ ...sync.historyMaxAgeMs !== void 0 ? { historyMaxAgeMs: sync.historyMaxAgeMs } : {},
164
+ ...sync.historyMaxBytes !== void 0 ? { historyMaxBytes: sync.historyMaxBytes } : {}
165
+ },
166
+ syncActive: sync.active,
167
+ syncEpoch: sync.epoch
145
168
  };
146
169
  }
147
170
  function durableMetadataConfigOf(entry) {
@@ -350,6 +373,56 @@ function deserializePayloadV1(data) {
350
373
  const raw = decode(data);
351
374
  return wireToPartition(raw);
352
375
  }
376
+
377
+ // src/serialization/payload-v1/sync-metadata.ts
378
+ function invalid(message, details) {
379
+ throw new NarsilError(ErrorCodes.CONFIG_INVALID, `The device sync state in the index metadata ${message}`, details);
380
+ }
381
+ function isPositiveSafeInteger(value) {
382
+ return typeof value === "number" && Number.isSafeInteger(value) && value >= 1;
383
+ }
384
+ function syncMetadataToWire(meta) {
385
+ const wire = {};
386
+ if (meta.sync !== void 0) {
387
+ wire.sync = {
388
+ enabled: meta.sync.enabled,
389
+ ...meta.sync.historyMaxAgeMs !== void 0 ? { history_max_age_ms: meta.sync.historyMaxAgeMs } : {},
390
+ ...meta.sync.historyMaxBytes !== void 0 ? { history_max_bytes: meta.sync.historyMaxBytes } : {}
391
+ };
392
+ }
393
+ if (meta.syncActive !== void 0) wire.sync_active = meta.syncActive;
394
+ if (meta.syncEpoch !== void 0) wire.sync_epoch = meta.syncEpoch;
395
+ return wire;
396
+ }
397
+ function storedSyncSetting(raw) {
398
+ if (raw === null || typeof raw !== "object") invalid("holds a sync setting that is not a map", {});
399
+ const { enabled, history_max_age_ms: maxAge, history_max_bytes: maxBytes } = raw;
400
+ if (typeof enabled !== "boolean") invalid("holds a sync setting without a boolean enabled", {});
401
+ if (maxAge !== void 0 && !isPositiveSafeInteger(maxAge)) {
402
+ invalid("holds a history age limit that is not a positive whole number", { historyMaxAgeMs: String(maxAge) });
403
+ }
404
+ if (maxBytes !== void 0 && !isPositiveSafeInteger(maxBytes)) {
405
+ invalid("holds a history byte limit that is not a positive whole number", { historyMaxBytes: String(maxBytes) });
406
+ }
407
+ return {
408
+ enabled,
409
+ ...maxAge !== void 0 ? { historyMaxAgeMs: maxAge } : {},
410
+ ...maxBytes !== void 0 ? { historyMaxBytes: maxBytes } : {}
411
+ };
412
+ }
413
+ function syncMetadataFromWire(raw, meta) {
414
+ if (raw.sync !== void 0 && raw.sync !== null) meta.sync = storedSyncSetting(raw.sync);
415
+ if (raw.sync_active !== void 0 && raw.sync_active !== null) {
416
+ if (typeof raw.sync_active !== "boolean") invalid("holds a sync_active that is not a boolean", {});
417
+ meta.syncActive = raw.sync_active;
418
+ }
419
+ if (raw.sync_epoch !== void 0 && raw.sync_epoch !== null) {
420
+ if (!isSyncEpoch(raw.sync_epoch)) invalid("holds an epoch that is not 32 lowercase hexadecimal digits", {});
421
+ meta.syncEpoch = raw.sync_epoch;
422
+ }
423
+ }
424
+
425
+ // src/serialization/payload-v1/metadata.ts
353
426
  function metadataToWire(meta) {
354
427
  const wire = {
355
428
  index_name: meta.indexName,
@@ -450,7 +523,7 @@ function metadataToWire(meta) {
450
523
  if (Array.isArray(meta.synonyms) && meta.synonyms.length > 0) {
451
524
  wire.synonyms = meta.synonyms;
452
525
  }
453
- return wire;
526
+ return { ...wire, ...syncMetadataToWire(meta) };
454
527
  }
455
528
  function wireToMetadata(raw) {
456
529
  const meta = {
@@ -606,6 +679,7 @@ function wireToMetadata(raw) {
606
679
  meta.heldPartitions = raw.held_partitions;
607
680
  }
608
681
  if (raw.synonyms !== void 0 && raw.synonyms !== null) meta.synonyms = raw.synonyms;
682
+ syncMetadataFromWire(raw, meta);
609
683
  return meta;
610
684
  }
611
685
  function isNonNegativeInteger(value) {
@@ -737,239 +811,6 @@ async function readMetadataEnvelope(data) {
737
811
  return { header, metadata };
738
812
  }
739
813
 
740
- // src/persistence/durability/segment/manifest-fields.ts
741
- function invalidManifest(message, details) {
742
- throw new NarsilError(ErrorCodes.PERSISTENCE_LOAD_FAILED, `Segment manifest ${message}`, details);
743
- }
744
- function isRecord(value) {
745
- return typeof value === "object" && value !== null && !Array.isArray(value) && !(value instanceof Uint8Array);
746
- }
747
- function isId(value) {
748
- return typeof value === "number" && Number.isInteger(value) && value >= 0 && value <= MAX_SEGMENT_ID;
749
- }
750
- function isUint32(value) {
751
- return typeof value === "number" && Number.isInteger(value) && value >= 0 && value <= 4294967295;
752
- }
753
- function isSequenceNumber(value) {
754
- return typeof value === "number" && Number.isSafeInteger(value) && value >= 0;
755
- }
756
- function readFileRef(raw, expectedKey, what) {
757
- if (raw.key !== expectedKey) {
758
- invalidManifest(`lists the ${what} under the key "${String(raw.key)}" where it belongs at "${expectedKey}"`, {
759
- key: raw.key,
760
- expected: expectedKey
761
- });
762
- }
763
- const bytes = raw.bytes;
764
- if (typeof bytes !== "number" || !Number.isInteger(bytes) || bytes < HEADER_SIZE || bytes > MAX_FILE_BYTES) {
765
- invalidManifest(`gives the ${what} "${expectedKey}" an invalid length`, { key: expectedKey, bytes });
766
- }
767
- if (!isUint32(raw.checksum)) invalidManifest(`gives the ${what} "${expectedKey}" an invalid checksum`);
768
- if (raw.headOffset === void 0) return { key: expectedKey, bytes, checksum: raw.checksum };
769
- const { headOffset, headLength, headChecksum } = raw;
770
- if (!isSequenceNumber(headOffset) || !isUint32(headLength) || !isUint32(headChecksum)) {
771
- invalidManifest(`gives the ${what} "${expectedKey}" an invalid head`, { key: expectedKey });
772
- }
773
- if (headOffset + headLength > bytes - HEADER_SIZE) {
774
- invalidManifest(`ends the head of the ${what} "${expectedKey}" outside its payload`, {
775
- key: expectedKey,
776
- headOffset,
777
- headLength,
778
- bytes
779
- });
780
- }
781
- return { key: expectedKey, bytes, checksum: raw.checksum, headOffset, headLength, headChecksum };
782
- }
783
-
784
- // src/persistence/durability/segment/manifest-vectors-decode.ts
785
- function normalizeFile(raw, indexName, fieldPath, nextFileId, seenIds) {
786
- if (!isRecord(raw) || !isId(raw.id)) invalidManifest("has an invalid vector file reference", { fieldPath });
787
- if (raw.id >= nextFileId || seenIds.has(raw.id)) {
788
- invalidManifest(`lists vector file ${raw.id} of "${fieldPath}" twice or at its next file id`, { fieldPath });
789
- }
790
- seenIds.add(raw.id);
791
- const count = raw.count;
792
- if (typeof count !== "number" || !Number.isInteger(count) || count < 0 || count > VECTOR_FILE_MAX_VECTORS) {
793
- invalidManifest(`gives vector file ${raw.id} of "${fieldPath}" an invalid count`, { fieldPath, count });
794
- }
795
- const dead = raw.dead ?? null;
796
- if (dead !== null && !(dead instanceof Uint8Array)) invalidManifest("has dead vectors that are not bytes");
797
- if (dead !== null && dead.byteLength !== deadBytesFor(count)) {
798
- invalidManifest(`marks the dead vectors of file ${raw.id} of "${fieldPath}" with the wrong number of bytes`);
799
- }
800
- const ref = readFileRef(raw, vectorFileKey(indexName, fieldPath, raw.id), "vector file");
801
- return { ...ref, id: raw.id, count, dead };
802
- }
803
- function normalizeGraphParts(raw, indexName, fieldPath, generation) {
804
- if (!Array.isArray(raw)) invalidManifest(`gives "${fieldPath}" no list of graph parts`, { fieldPath });
805
- if (raw.length > 0 && generation === 0) invalidManifest(`lists graph parts of "${fieldPath}" at generation 0`);
806
- return raw.map((part, at) => {
807
- if (!isRecord(part)) invalidManifest(`has an invalid graph part of "${fieldPath}"`, { fieldPath });
808
- return readFileRef(part, graphPartKey(indexName, fieldPath, generation, at), "graph part");
809
- });
810
- }
811
- function normalizeField(raw, indexName, seenFields) {
812
- if (!isRecord(raw) || typeof raw.fieldPath !== "string") invalidManifest("has an invalid vector reference");
813
- const fieldPath = raw.fieldPath;
814
- if (seenFields.has(fieldPath)) invalidManifest(`lists the vector field "${fieldPath}" twice`, { fieldPath });
815
- seenFields.add(fieldPath);
816
- if (!isId(raw.nextFileId)) invalidManifest(`gives "${fieldPath}" an invalid next file id`, { fieldPath });
817
- if (!Array.isArray(raw.files)) invalidManifest(`gives "${fieldPath}" no list of vector files`, { fieldPath });
818
- if (!isId(raw.graphGeneration)) invalidManifest(`gives "${fieldPath}" an invalid graph generation`, { fieldPath });
819
- const nextFileId = raw.nextFileId;
820
- const seenIds = /* @__PURE__ */ new Set();
821
- return {
822
- fieldPath,
823
- nextFileId,
824
- files: raw.files.map((file) => normalizeFile(file, indexName, fieldPath, nextFileId, seenIds)),
825
- graphGeneration: raw.graphGeneration,
826
- graphParts: normalizeGraphParts(raw.graphParts, indexName, fieldPath, raw.graphGeneration)
827
- };
828
- }
829
- function normalizeVectorFields(raw, indexName) {
830
- if (!Array.isArray(raw)) invalidManifest("has malformed vector references");
831
- const seenFields = /* @__PURE__ */ new Set();
832
- return raw.map((field) => normalizeField(field, indexName, seenFields));
833
- }
834
-
835
- // src/persistence/durability/segment/manifest-decode.ts
836
- async function openManifestPayload(data) {
837
- const { payload } = await openChecksummedEnvelope(data, {
838
- envelopeFormatVersion: MANIFEST_ENVELOPE_VERSION,
839
- what: "segment manifest",
840
- allowsCompression: true
841
- });
842
- const raw = decode(payload);
843
- if (!isRecord(raw)) invalidManifest("is not a map");
844
- return raw;
845
- }
846
- function listedKeysOf(raw) {
847
- const keys = [];
848
- for (const partition of Array.isArray(raw.partitions) ? raw.partitions : []) {
849
- if (!isRecord(partition) || !Array.isArray(partition.segments)) continue;
850
- for (const segment of partition.segments)
851
- if (isRecord(segment) && typeof segment.key === "string") keys.push(segment.key);
852
- }
853
- for (const field of Array.isArray(raw.vectors) ? raw.vectors : []) {
854
- if (!isRecord(field)) continue;
855
- for (const list of [field.files, field.graphParts]) {
856
- if (!Array.isArray(list)) continue;
857
- for (const file of list) if (isRecord(file) && typeof file.key === "string") keys.push(file.key);
858
- }
859
- }
860
- return keys;
861
- }
862
- async function decodeSegmentManifest(data, indexName) {
863
- return decodeManifestPayload(await openManifestPayload(data), indexName);
864
- }
865
- function decodeManifestPayload(raw, indexName) {
866
- if (raw.version === EARLIER_SEGMENT_MANIFEST_VERSION) return { kind: "earlier", payload: raw };
867
- if (raw.version !== SEGMENT_MANIFEST_VERSION) {
868
- throw new NarsilError(
869
- ErrorCodes.ENVELOPE_VERSION_MISMATCH,
870
- `The segment manifest of index "${indexName}" holds layout ${String(raw.version)}, which this release cannot open. Export the index with the release that wrote it and import the export`,
871
- { indexName, version: raw.version }
872
- );
873
- }
874
- const schema = raw.schema;
875
- if (!isRecord(schema)) invalidManifest("is missing its schema");
876
- requireValidFieldTypes(schema);
877
- if (typeof raw.language !== "string") invalidManifest("is missing its language");
878
- if (raw.analysisGeneration !== void 0 && !isSequenceNumber(raw.analysisGeneration)) {
879
- invalidManifest("has an invalid analysis generation");
880
- }
881
- return {
882
- kind: "current",
883
- manifest: {
884
- version: SEGMENT_MANIFEST_VERSION,
885
- schema,
886
- language: raw.language,
887
- ...raw.analysisGeneration ? { analysisGeneration: raw.analysisGeneration } : {},
888
- checkpoint: normalizeCheckpoint(raw.checkpoint),
889
- partitions: normalizePartitions(raw.partitions, indexName),
890
- vectors: normalizeVectorFields(raw.vectors, indexName)
891
- }
892
- };
893
- }
894
- function normalizeCheckpoint(raw) {
895
- if (!Array.isArray(raw)) invalidManifest("is missing its checkpoint list");
896
- const seen = /* @__PURE__ */ new Set();
897
- return raw.map((entry) => {
898
- if (!isRecord(entry) || !isUint32(entry.partitionId) || !isSequenceNumber(entry.lastSeqNo) || !isSequenceNumber(entry.primaryTerm) || seen.has(entry.partitionId)) {
899
- invalidManifest("has an invalid partition checkpoint", { entry });
900
- }
901
- seen.add(entry.partitionId);
902
- const checkpoint = {
903
- partitionId: entry.partitionId,
904
- lastSeqNo: entry.lastSeqNo,
905
- primaryTerm: entry.primaryTerm
906
- };
907
- if (entry.termHistory !== void 0) {
908
- checkpoint.termHistory = normalizeTermHistory(entry.termHistory, entry.partitionId, entry.lastSeqNo);
909
- }
910
- return checkpoint;
911
- });
912
- }
913
- function normalizeTermHistory(raw, partitionId, lastSeqNo) {
914
- if (!Array.isArray(raw)) invalidManifest("has a term history that is not a list", { partitionId });
915
- let previous = null;
916
- return raw.map((start) => {
917
- if (!isRecord(start) || !isSequenceNumber(start.primaryTerm) || !isSequenceNumber(start.firstSeqNo)) {
918
- invalidManifest("has an invalid term history entry", { partitionId });
919
- }
920
- const read = { primaryTerm: start.primaryTerm, firstSeqNo: start.firstSeqNo };
921
- if (read.firstSeqNo > lastSeqNo) {
922
- invalidManifest(`has a term starting at seqNo ${read.firstSeqNo}, above lastSeqNo ${lastSeqNo}`, { partitionId });
923
- }
924
- if (previous !== null && (read.primaryTerm <= previous.primaryTerm || read.firstSeqNo <= previous.firstSeqNo)) {
925
- invalidManifest("has a term history that fails to ascend strictly", { partitionId });
926
- }
927
- previous = read;
928
- return read;
929
- });
930
- }
931
- function normalizePartitions(raw, indexName) {
932
- if (!Array.isArray(raw)) invalidManifest("is missing partition entries");
933
- const seen = /* @__PURE__ */ new Set();
934
- return raw.map((entry) => {
935
- if (!isRecord(entry) || !isUint32(entry.partitionId) || seen.has(entry.partitionId)) {
936
- invalidManifest("has a partition without a valid id", { partitionId: isRecord(entry) ? entry.partitionId : null });
937
- }
938
- seen.add(entry.partitionId);
939
- const segments = normalizeSegments(entry.segments, indexName, entry.partitionId);
940
- return {
941
- partitionId: entry.partitionId,
942
- nextSegmentId: readNextSegmentId(entry.nextSegmentId, segments, entry.partitionId),
943
- segments
944
- };
945
- });
946
- }
947
- function normalizeSegments(raw, indexName, partitionId) {
948
- if (!Array.isArray(raw)) invalidManifest("has malformed segment references", { partitionId });
949
- if (raw.length > MAX_SEGMENTS_PER_PARTITION) {
950
- invalidManifest(`lists ${raw.length} segments for partition ${partitionId}, above ${MAX_SEGMENTS_PER_PARTITION}`);
951
- }
952
- const seenIds = /* @__PURE__ */ new Set();
953
- return raw.map((segment) => {
954
- if (!isRecord(segment) || !isId(segment.id) || !isUint32(segment.docCount) || !isUint32(segment.tombstoneCount)) {
955
- invalidManifest("has an invalid segment reference", { partitionId });
956
- }
957
- if (seenIds.has(segment.id)) invalidManifest(`reuses segment id ${segment.id} in partition ${partitionId}`);
958
- seenIds.add(segment.id);
959
- const ref = readFileRef(segment, segmentKey(indexName, partitionId, segment.id), "segment");
960
- return { ...ref, id: segment.id, docCount: segment.docCount, tombstoneCount: segment.tombstoneCount };
961
- });
962
- }
963
- function readNextSegmentId(value, segments, partitionId) {
964
- if (!isId(value)) invalidManifest("has an invalid next segment id", { partitionId });
965
- for (const segment of segments) {
966
- if (segment.id >= value) {
967
- invalidManifest(`next segment id ${value} does not exceed segment id ${segment.id}`, { partitionId });
968
- }
969
- }
970
- return value;
971
- }
972
-
973
814
  // src/persistence/durability/segment/captured-partition.ts
974
815
  function keepMaskOf(segment) {
975
816
  const keep = new Uint8Array(segment.arrays.documentCount);
@@ -1382,7 +1223,7 @@ function holdsEveryHead(ref) {
1382
1223
  async function loadFieldOnDemand(store, ref, vectorIndex, resolvePartition) {
1383
1224
  const { pathOf } = store;
1384
1225
  if (pathOf === void 0 || vectorIndex.storage !== "disk" || !holdsEveryHead(ref)) return false;
1385
- const { loadFilesByParts, openColdVectorField, osqBitsOf, waitBeforeColdLoad } = await import('./cold-module-KFGEWYEL.mjs');
1226
+ const { loadFilesByParts, openColdVectorField, osqBitsOf, waitBeforeColdLoad } = await import('./cold-module-TJL6AFAD.mjs');
1386
1227
  await Promise.all([
1387
1228
  ...ref.files.map((file) => requireListedSize(store, file.key, { bytes: file.bytes, what: "vector file" })),
1388
1229
  ...ref.graphParts.map((part) => requireListedSize(store, part.key, { bytes: part.bytes, what: "graph part" }))
@@ -1570,6 +1411,50 @@ function createSeqOwner(startSeqNo, primaryTerm = SINGLE_NODE_PRIMARY_TERM) {
1570
1411
  }
1571
1412
  };
1572
1413
  }
1414
+ function fileRefOnTheWire(ref) {
1415
+ return {
1416
+ key: ref.key,
1417
+ bytes: ref.bytes,
1418
+ checksum: ref.checksum,
1419
+ ...ref.headOffset === void 0 ? {} : { headOffset: ref.headOffset, headLength: ref.headLength, headChecksum: ref.headChecksum }
1420
+ };
1421
+ }
1422
+ function encodeSegmentManifest(manifest) {
1423
+ const payload = encode({
1424
+ version: SEGMENT_MANIFEST_VERSION,
1425
+ schema: manifest.schema,
1426
+ language: manifest.language,
1427
+ ...manifest.analysisGeneration ? { analysisGeneration: manifest.analysisGeneration } : {},
1428
+ checkpoint: manifest.checkpoint.map((c) => ({
1429
+ partitionId: c.partitionId,
1430
+ lastSeqNo: c.lastSeqNo,
1431
+ primaryTerm: c.primaryTerm,
1432
+ ...c.termHistory === void 0 ? {} : {
1433
+ termHistory: c.termHistory.map((start) => ({ primaryTerm: start.primaryTerm, firstSeqNo: start.firstSeqNo }))
1434
+ }
1435
+ })),
1436
+ partitions: manifest.partitions.map((p) => ({
1437
+ partitionId: p.partitionId,
1438
+ nextSegmentId: p.nextSegmentId,
1439
+ segments: p.segments.map((s) => ({
1440
+ id: s.id,
1441
+ key: s.key,
1442
+ docCount: s.docCount,
1443
+ tombstoneCount: s.tombstoneCount,
1444
+ bytes: s.bytes,
1445
+ checksum: s.checksum
1446
+ }))
1447
+ })),
1448
+ vectors: manifest.vectors.map((v) => ({
1449
+ fieldPath: v.fieldPath,
1450
+ nextFileId: v.nextFileId,
1451
+ files: v.files.map((f) => ({ id: f.id, ...fileRefOnTheWire(f), count: f.count, dead: f.dead })),
1452
+ graphGeneration: v.graphGeneration,
1453
+ graphParts: v.graphParts.map(fileRefOnTheWire)
1454
+ }))
1455
+ });
1456
+ return packChecksummedEnvelope([payload], MANIFEST_ENVELOPE_VERSION, "segment manifest");
1457
+ }
1573
1458
 
1574
1459
  // src/persistence/durability/partition-checkpoint.ts
1575
1460
  function checkpointLastSeqNo(checkpoint, partitionId) {
@@ -1650,7 +1535,7 @@ function nextMarkerSlot(lastWrittenSlot) {
1650
1535
  function markerSlotOffset(slotIndex) {
1651
1536
  return slotIndex * COMMIT_MARKER_SLOT_SIZE;
1652
1537
  }
1653
- function isRecord2(value) {
1538
+ function isRecord(value) {
1654
1539
  return value !== null && typeof value === "object" && !Array.isArray(value);
1655
1540
  }
1656
1541
  function optionalIndexUuid(value, payloadName) {
@@ -1672,7 +1557,7 @@ function optionalPreviousPrimaryTerm(value, payloadName) {
1672
1557
  return value;
1673
1558
  }
1674
1559
  function validateEntryPayload(decoded) {
1675
- if (!isRecord2(decoded) || !isRecord2(decoded.entry)) {
1560
+ if (!isRecord(decoded) || !isRecord(decoded.entry)) {
1676
1561
  throw new Error('Invalid EntryPayload: missing or invalid "entry" field');
1677
1562
  }
1678
1563
  const entry = decoded.entry;
@@ -1761,7 +1646,7 @@ function checkSegmentHeader(data) {
1761
1646
  }
1762
1647
  return { ok: true };
1763
1648
  }
1764
- function decodeEntry(payload) {
1649
+ function decodeWalEntry(payload) {
1765
1650
  const decoded = decode(payload);
1766
1651
  const { entry } = validateEntryPayload({ entry: decoded });
1767
1652
  if (computeEntryChecksum(entry) !== entry.checksum) {
@@ -1809,7 +1694,7 @@ function readDurableRegion(data, durableByteLength, maxRecordBytes = MAX_WAL_REC
1809
1694
  }
1810
1695
  let entry;
1811
1696
  try {
1812
- entry = decodeEntry(payload);
1697
+ entry = decodeWalEntry(payload);
1813
1698
  } catch (err) {
1814
1699
  corrupt("WAL record payload failed to decode inside the durable region", {
1815
1700
  offset,
@@ -1857,7 +1742,7 @@ function readTailBeyondFrontier(data, durableByteLength, lastDurableSeqNo, maxRe
1857
1742
  }
1858
1743
  let entry;
1859
1744
  try {
1860
- entry = decodeEntry(payload);
1745
+ entry = decodeWalEntry(payload);
1861
1746
  } catch {
1862
1747
  break;
1863
1748
  }
@@ -2142,7 +2027,7 @@ async function compactPartitionSegments(input) {
2142
2027
  if (paged) {
2143
2028
  const { directory } = input.store;
2144
2029
  if (directory === void 0) return { segments, nextSegmentId: input.nextSegmentId };
2145
- const { mergePagedWindow } = await import('./module-FHJ2GOBI.mjs');
2030
+ const { mergePagedWindow } = await import('./module-QT5HZAY4.mjs');
2146
2031
  return replacing(
2147
2032
  await mergePagedWindow({
2148
2033
  store: input.store,
@@ -2230,7 +2115,7 @@ function pagedSettingsOf(context) {
2230
2115
  async function tombstonesOfDelta(context, older, selections, deleted) {
2231
2116
  const { directory } = context.input.store;
2232
2117
  if (context.input.metadata.textStorage !== "disk" || directory === void 0) return deleted;
2233
- const { pagedTombstonesFor } = await import('./module-FHJ2GOBI.mjs');
2118
+ const { pagedTombstonesFor } = await import('./module-QT5HZAY4.mjs');
2234
2119
  return pagedTombstonesFor(
2235
2120
  directory,
2236
2121
  older,
@@ -2431,7 +2316,7 @@ function removeFromPartition(manager, partitionId, docIds) {
2431
2316
  }
2432
2317
  }
2433
2318
  async function attachPagedSegment(directory, ref, partitionId, manager, options) {
2434
- const { checkPagedSegmentFully, createPagedFrozenSegment, openPagedSnapshot, pagedListingOf } = await import('./module-FHJ2GOBI.mjs');
2319
+ const { checkPagedSegmentFully, createPagedFrozenSegment, openPagedSnapshot, pagedListingOf } = await import('./module-QT5HZAY4.mjs');
2435
2320
  if (options.decodesEveryDocument) await checkPagedSegmentFully(directory, ref);
2436
2321
  const snapshot = openPagedSnapshot(await pagedListingOf(directory, ref));
2437
2322
  requireAgreedSchema(options.schema, snapshot.schema, ref.key);
@@ -2445,7 +2330,7 @@ async function loadPartitionSegments(store, partition, manager, options) {
2445
2330
  const { directory } = store;
2446
2331
  for (const ref of partition.segments) {
2447
2332
  if (manager.config.textStorage === "disk" && directory !== void 0) {
2448
- const { isPagedSegmentFile } = await import('./module-FHJ2GOBI.mjs');
2333
+ const { isPagedSegmentFile } = await import('./module-QT5HZAY4.mjs');
2449
2334
  if (await isPagedSegmentFile(directory, ref.key)) {
2450
2335
  await attachPagedSegment(directory, ref, partition.partitionId, manager, options);
2451
2336
  await yieldToEventLoop();
@@ -2501,7 +2386,7 @@ async function loadSegmentedCheckpoint(store, indexName, manifest, deps, decodes
2501
2386
  (field) => deps.vectorIndexes.get(field.fieldPath)?.storage === "disk" && field.files.some((file) => file.headOffset !== void 0)
2502
2387
  );
2503
2388
  if (!decodesEveryDocument && directory !== void 0 && opensVectorsOnDemand) {
2504
- const { startReadingOpeningSectionsAhead } = await import('./module-FHJ2GOBI.mjs');
2389
+ const { startReadingOpeningSectionsAhead } = await import('./module-QT5HZAY4.mjs');
2505
2390
  await startReadingOpeningSectionsAhead(directory, manifest);
2506
2391
  }
2507
2392
  for (const partition of manifest.partitions) {
@@ -2635,4 +2520,4 @@ function deserializePayloadV2(data) {
2635
2520
  };
2636
2521
  }
2637
2522
 
2638
- export { SEGMENT_HEADER_SIZE, SINGLE_NODE_PRIMARY_TERM, VECTOR_FILE_ENVELOPE_VERSION, buildEntry, captureWholePartition, checkpointLastSeqNo, checkpointPrimaryTerm, commitCheckpointManifest, createSeqOwner, decodeManifestPayload, decodeSegmentManifest, deserializePayloadV1, deserializePayloadV2, documentsOfPayloadV2, durableMetadataConfigOf, durableRecordMissing, encodeMarkerSlot, frameRecord, growPartitionsTo, indexMetadataOf, invalidManifest, isId, isRecord, isSequenceNumber, isUint32, listedKeysOf, loadSegmentedCheckpoint, markerSlotOffset, metadataConfigOf, metadataFromConfig, nextMarkerSlot, nextSegmentKey, openManifestPayload, partitionContentsOf, readCommitMarker, readCurrentManifest, readGraphParts, readMetadataEnvelope, readSegmentManifest, readVectorFile, readWalSegments, reclaimUnlistedKeys, removeCheckpointGarbage, unpackEnvelopeBytes, unpackIndexSnapshotEnvelope, writeCheckpointSegments, writeLiveVectors, writeMetadataEnvelope, writeSegmentHeader };
2523
+ export { FRAME_CRC_SIZE, MAX_WAL_RECORD_BYTES, RECORD_LENGTH_SIZE, SEGMENT_HEADER_SIZE, SINGLE_NODE_PRIMARY_TERM, VECTOR_FILE_ENVELOPE_VERSION, buildEntry, captureWholePartition, checkSegmentHeader, checkpointLastSeqNo, checkpointPrimaryTerm, commitCheckpointManifest, createSeqOwner, decodeWalEntry, deserializePayloadV1, deserializePayloadV2, documentsOfPayloadV2, durableMetadataConfigOf, durableRecordMissing, encodeMarkerSlot, encodeSegmentManifest, frameRecord, growPartitionsTo, indexMetadataOf, loadSegmentedCheckpoint, markerSlotOffset, metadataConfigOf, metadataFromConfig, nextMarkerSlot, nextSegmentKey, partitionContentsOf, readCommitMarker, readCurrentManifest, readGraphParts, readMetadataEnvelope, readSegmentManifest, readVectorFile, readWalSegments, reclaimUnlistedKeys, removeCheckpointGarbage, unpackEnvelopeBytes, unpackIndexSnapshotEnvelope, writeCheckpointSegments, writeLiveVectors, writeMetadataEnvelope, writeSegmentHeader };
@@ -1,4 +1,4 @@
1
- import { NarsilError, ErrorCodes } from './chunk-YH7W556M.mjs';
1
+ import { NarsilError, ErrorCodes } from './chunk-CUNGPR5R.mjs';
2
2
 
3
3
  // src/runtime/react-native-host.ts
4
4
  var REACT_NATIVE_HOST_KEY = /* @__PURE__ */ Symbol.for("@delali/narsil-react-native/host");
@@ -0,0 +1,38 @@
1
+ // src/engine/serial-index-update.ts
2
+ var updatingByCore = /* @__PURE__ */ new WeakMap();
3
+ async function withOpenIndex(core, indexName, action) {
4
+ core.guardShutdown();
5
+ core.requireIndex(indexName);
6
+ const release = await core.indexState.acquire(indexName);
7
+ try {
8
+ return await action();
9
+ } finally {
10
+ release();
11
+ }
12
+ }
13
+ async function oneAtATime(core, indexName, action) {
14
+ let chains = updatingByCore.get(core);
15
+ if (chains === void 0) {
16
+ chains = /* @__PURE__ */ new Map();
17
+ updatingByCore.set(core, chains);
18
+ }
19
+ const updating = chains;
20
+ const earlier = updating.get(indexName) ?? Promise.resolve();
21
+ const current = earlier.catch(() => void 0).then(action);
22
+ updating.set(indexName, current);
23
+ try {
24
+ return await current;
25
+ } finally {
26
+ if (updating.get(indexName) === current) updating.delete(indexName);
27
+ }
28
+ }
29
+
30
+ // src/engine/sync-notify.ts
31
+ var listenersByRegistry = /* @__PURE__ */ new WeakMap();
32
+ function emitSyncChange(registry, change) {
33
+ const listeners = listenersByRegistry.get(registry);
34
+ if (listeners === void 0) return;
35
+ for (const listener of [...listeners]) listener(change);
36
+ }
37
+
38
+ export { emitSyncChange, oneAtATime, withOpenIndex };
@@ -1,4 +1,4 @@
1
- import { resolveIndexAnalysis, getLanguage } from './chunk-3CTWSQRW.mjs';
1
+ import { resolveIndexAnalysis, getLanguage } from './chunk-ZBSWRSBG.mjs';
2
2
 
3
3
  // src/engine/analysis-change/pending-target.ts
4
4
  function configUnderAnalysis(base, language, tokenizer, stopWords) {
@@ -0,0 +1,15 @@
1
+ // src/sync/epoch.ts
2
+ var SYNC_EPOCH_BYTES = 16;
3
+ var SYNC_EPOCH_PATTERN = /^[0-9a-f]{32}$/;
4
+ function isSyncEpoch(value) {
5
+ return typeof value === "string" && SYNC_EPOCH_PATTERN.test(value);
6
+ }
7
+ function newSyncEpoch() {
8
+ const bytes = new Uint8Array(SYNC_EPOCH_BYTES);
9
+ crypto.getRandomValues(bytes);
10
+ let hex = "";
11
+ for (const byte of bytes) hex += byte.toString(16).padStart(2, "0");
12
+ return hex;
13
+ }
14
+
15
+ export { isSyncEpoch, newSyncEpoch };
@@ -1,10 +1,10 @@
1
1
  import { REBUILD_REMOVED_RATIO, BUILD_TURN_HANDOVER_AFTER_MS, DRIFT_CHECK_GROWTH_FACTOR, VECTOR_FILE_REPLACED_ABOVE_DEAD_SHARE, VECTOR_FILE_FIXED_OVERHEAD_BYTES, VECTOR_FILE_CENTROID_BYTES_PER_COMPONENT, VECTOR_FILE_STRING_HEADER_BYTES } from './chunk-HJBJBH26.mjs';
2
- import { createOrdinalFilter, addToOrdinalFilter, osqBitsOf, STORE_ORDINAL_LAYOUT_GENERATION, removeFromOrdinalFilter, createHNSWIndex, STORE_CALIBRATION_GENERATION, graphWithoutNodes, createOsqScratch, osqQuantize } from './chunk-KOCTCUXW.mjs';
3
- import { osqRecordBytes, VECTOR_FILE_MAX_VECTORS, NO_LIVE_VECTOR_AT_POSITION, bytesToVectors, VECTOR_GRAPH_PART_VECTORS, VECTOR_GRAPH_PART_PAYLOAD_VERSION, VECTOR_FILE_PAYLOAD_VERSION, deadBitsWhere, vectorsToBytes, writeRecord } from './chunk-VGUWIZFQ.mjs';
4
- import { turnsAreBudgeted, backgroundTurnIsSpent, yieldBackgroundTurn } from './chunk-LQAKO5QV.mjs';
2
+ import { createOrdinalFilter, addToOrdinalFilter, osqBitsOf, STORE_ORDINAL_LAYOUT_GENERATION, removeFromOrdinalFilter, createHNSWIndex, STORE_CALIBRATION_GENERATION, graphWithoutNodes, createOsqScratch, osqQuantize } from './chunk-RYMDHGL4.mjs';
3
+ import { turnsAreBudgeted, backgroundTurnIsSpent, yieldBackgroundTurn } from './chunk-NCJS3WIY.mjs';
5
4
  import { MAX_DOC_ID_LENGTH } from './chunk-AM7RSBPF.mjs';
5
+ import { osqRecordBytes, VECTOR_FILE_MAX_VECTORS, NO_LIVE_VECTOR_AT_POSITION, bytesToVectors, VECTOR_GRAPH_PART_VECTORS, VECTOR_GRAPH_PART_PAYLOAD_VERSION, VECTOR_FILE_PAYLOAD_VERSION, deadBitsWhere, vectorsToBytes, writeRecord } from './chunk-YBEW6YTR.mjs';
6
6
  import { MAX_FILE_BYTES } from './chunk-TJMSKBEM.mjs';
7
- import { NarsilError, ErrorCodes } from './chunk-YH7W556M.mjs';
7
+ import { NarsilError, ErrorCodes } from './chunk-CUNGPR5R.mjs';
8
8
 
9
9
  // src/vector/filter-ordinals.ts
10
10
  var UNRESOLVED_ORDINAL = -1;