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

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 (330) hide show
  1. package/README.md +3 -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-3TFIHT5E.mjs} +32 -23
  7. package/dist/{react-native/chunks/analysis-change-entry-CXNRW324.mjs → analysis-change-entry-KA6JAO4X.mjs} +1 -1
  8. package/dist/archive-history-E4R73RWD.mjs +29 -0
  9. package/dist/browser/{analysis-change-2V2HZ2NY.mjs → analysis-change-TC36BU47.mjs} +39 -10
  10. package/dist/{analysis-change-entry-QD7YNDEE.mjs → browser/analysis-change-entry-4MH3CZXH.mjs} +1 -1
  11. package/dist/browser/archive-history-4IP5XQZY.mjs +29 -0
  12. package/dist/browser/chunk-23XRXIBW.mjs +85 -0
  13. package/dist/browser/chunk-3UIEB4QF.mjs +63 -0
  14. package/dist/browser/{chunk-CSCKZBVJ.mjs → chunk-4EWUGZYZ.mjs} +4 -4
  15. package/dist/browser/chunk-4WCVMOU3.mjs +151 -0
  16. package/dist/browser/{chunk-QJCO3TJU.mjs → chunk-56W3HQVJ.mjs} +9 -150
  17. package/dist/{react-native/chunks/chunk-VGUWIZFQ.mjs → browser/chunk-5TCXK5SB.mjs} +2 -2
  18. package/dist/browser/chunk-5W3MMTLG.mjs +19 -0
  19. package/dist/browser/chunk-7IGKGWSQ.mjs +79 -0
  20. package/dist/browser/chunk-A5KUEGDY.mjs +241 -0
  21. package/dist/browser/{chunk-HT7J73QL.mjs → chunk-ABCXENU5.mjs} +2 -2
  22. package/dist/browser/chunk-ATEBYXP6.mjs +10 -0
  23. package/dist/browser/chunk-BXM5XOCA.mjs +315 -0
  24. package/dist/browser/chunk-CJSYBQ4J.mjs +100 -0
  25. package/dist/browser/chunk-DSXIBE6N.mjs +78 -0
  26. package/dist/browser/chunk-ELV4OZOI.mjs +29 -0
  27. package/dist/{react-native/chunks/chunk-QC4ZRBSX.mjs → browser/chunk-EXQZGUQH.mjs} +2 -79
  28. package/dist/browser/{chunk-2A2IPRC3.mjs → chunk-FNIFPFB7.mjs} +5 -31
  29. package/dist/browser/chunk-G64Q6OJF.mjs +96 -0
  30. package/dist/browser/chunk-GPPOG6PT.mjs +9 -0
  31. package/dist/browser/chunk-IKDKX5VQ.mjs +1007 -0
  32. package/dist/browser/chunk-JIJXMI42.mjs +1829 -0
  33. package/dist/browser/chunk-JVBP5EYO.mjs +1106 -0
  34. package/dist/browser/{chunk-TQ5UMFG5.mjs → chunk-K4GCSZLI.mjs} +15 -6
  35. package/dist/browser/{chunk-PM4MUM5N.mjs → chunk-K5AXJBLL.mjs} +6 -5
  36. package/dist/browser/chunk-KKAMCABR.mjs +432 -0
  37. package/dist/browser/{chunk-IAXZAVYL.mjs → chunk-LFIWRCEA.mjs} +1 -159
  38. package/dist/browser/chunk-M3MQE2X7.mjs +151 -0
  39. package/dist/browser/chunk-ML7THVLJ.mjs +38 -0
  40. package/dist/browser/chunk-NLWTBAGB.mjs +111 -0
  41. package/dist/browser/chunk-OEDCEZXJ.mjs +92 -0
  42. package/dist/browser/{chunk-MPK76GVS.mjs → chunk-RA6LSBCM.mjs} +1 -21
  43. package/dist/browser/{chunk-GJKXW3SF.mjs → chunk-RND5CLX3.mjs} +147 -253
  44. package/dist/{react-native/chunks/chunk-DFQJ4IJB.mjs → browser/chunk-RQBUNZQW.mjs} +2 -2
  45. package/dist/browser/{chunk-VD7JEUIR.mjs → chunk-RRO3EV4C.mjs} +9 -8
  46. package/dist/browser/{chunk-KWYQ6KX4.mjs → chunk-SMEQ36NT.mjs} +162 -2019
  47. package/dist/{chunk-MDF6PDIA.mjs → browser/chunk-SRMZXJSL.mjs} +8 -1
  48. package/dist/browser/{chunk-7ZJTRUVW.mjs → chunk-SUDNZKPL.mjs} +2 -2
  49. package/dist/browser/{chunk-LURXVCHG.mjs → chunk-U3JOQGWX.mjs} +1 -1
  50. package/dist/browser/chunk-VI7BQR4U.mjs +21 -0
  51. package/dist/browser/{chunk-B3JM6Z74.mjs → chunk-XY4VVBBO.mjs} +3 -2
  52. package/dist/browser/chunk-YJHGOJAC.mjs +15 -0
  53. package/dist/browser/chunk-ZI2V4VD7.mjs +21 -0
  54. package/dist/browser/{cold-module-YECAK4MN.mjs → cold-module-NEUGHUPA.mjs} +21 -14
  55. package/dist/browser/durability-config-TIYKW6XX.mjs +89 -0
  56. package/dist/browser/{durability-wiring-LM7WFL6X.mjs → durability-wiring-CVGPRO6D.mjs} +1299 -881
  57. package/dist/browser/engine-hooks-YXMPHZKZ.mjs +16 -0
  58. package/dist/browser/import-OM6QAW45.mjs +18 -0
  59. package/dist/browser/methods-KTQCSIN4.mjs +30 -0
  60. package/dist/browser/{module-XQLEOYNM.mjs → module-3HNFCBJ5.mjs} +10 -8
  61. package/dist/browser/{module-KAMRAJLE.mjs → module-E33X4AOK.mjs} +17 -10
  62. package/dist/browser/operations-OJ3BXS55.mjs +5 -0
  63. package/dist/browser/{phrase-module-CNKMUY4U.mjs → phrase-module-ZXXU7S3B.mjs} +1 -1
  64. package/dist/browser/{pool-DTYSPBMQ.mjs → pool-3JLET5RO.mjs} +3 -2
  65. package/dist/browser/restore-hooks-IF2ZROUP.mjs +113 -0
  66. package/dist/browser/restore-queue-ZBS7CJA6.mjs +55 -0
  67. package/dist/browser/retention-ASWUHAYI.mjs +209 -0
  68. package/dist/browser/{runtime-D2ULZGCN.mjs → runtime-OTAGEFQW.mjs} +1 -1
  69. package/dist/browser/{snapshot-UGZVMP4H.mjs → snapshot-PN7ZW6Q4.mjs} +80 -315
  70. package/dist/browser/start-ZIRB7MQ2.mjs +24 -0
  71. package/dist/browser/sync-state-P5XG6LTQ.mjs +15 -0
  72. package/dist/browser/{write-I5P5MW4O.mjs → write-HMDYCTV2.mjs} +17 -11
  73. package/dist/{capabilities-BT-HLDC8.d.ts → capabilities-Da4ywVVl.d.ts} +94 -7
  74. package/dist/{chunk-LDGGR7YT.mjs → chunk-2MANFZJ3.mjs} +2 -2
  75. package/dist/{chunk-IZT3G24Q.mjs → chunk-2NE7VCYE.mjs} +2 -2
  76. package/dist/{chunk-3TVDTACC.mjs → chunk-3C7MTCCI.mjs} +1 -1
  77. package/dist/chunk-3HB3PEC6.mjs +240 -0
  78. package/dist/chunk-3HHQLEEQ.mjs +1092 -0
  79. package/dist/chunk-3OH67G7R.mjs +214 -0
  80. package/dist/{chunk-ZS6CMXAE.mjs → chunk-3R4UZWQG.mjs} +98 -250
  81. package/dist/{chunk-65WCV5JO.mjs → chunk-4BYWRYPM.mjs} +1 -1
  82. package/dist/{chunk-SOUZMPME.mjs → chunk-4KRC2APY.mjs} +7 -194
  83. package/dist/{chunk-5QMHMELB.mjs → chunk-5FLRXF73.mjs} +8 -1
  84. package/dist/chunk-5FVU47TB.mjs +20 -0
  85. package/dist/chunk-5YNRKI2C.mjs +81 -0
  86. package/dist/chunk-6L3XJXGU.mjs +470 -0
  87. package/dist/chunk-6MSZ543Y.mjs +32 -0
  88. package/dist/{chunk-T4CJDBBE.mjs → chunk-6OEGXLBX.mjs} +1 -1
  89. package/dist/{chunk-3SBJVQLL.mjs → chunk-6RC4K46J.mjs} +2 -2
  90. package/dist/chunk-7GXJUJ24.mjs +49 -0
  91. package/dist/{chunk-FNBNZCGP.mjs → chunk-AILVAOLX.mjs} +2 -2
  92. package/dist/chunk-BDRIVYOK.mjs +72 -0
  93. package/dist/chunk-BUMREPLU.mjs +15 -0
  94. package/dist/chunk-BY6ZDGYS.mjs +50 -0
  95. package/dist/{chunk-5WB2A3XU.mjs → chunk-DCNKVEDB.mjs} +511 -27
  96. package/dist/{chunk-NITCPDFL.mjs → chunk-DIBHI6W5.mjs} +2 -2
  97. package/dist/{chunk-4QCSHLNM.mjs → chunk-DUOLGBTE.mjs} +3 -3
  98. package/dist/chunk-GES7U2PM.mjs +68 -0
  99. package/dist/chunk-GH4WQ22V.mjs +34 -0
  100. package/dist/chunk-GQPTDQCL.mjs +54 -0
  101. package/dist/chunk-H4KHPLHJ.mjs +382 -0
  102. package/dist/{chunk-7TE2AJIH.mjs → chunk-H6VIGE62.mjs} +13 -10
  103. package/dist/{chunk-J7M73VY7.mjs → chunk-HJJI72X7.mjs} +1 -1
  104. package/dist/{chunk-DGRM4EZZ.mjs → chunk-HNVVEQP7.mjs} +1 -1
  105. package/dist/{chunk-RBEHLIKX.mjs → chunk-HW5TNXBO.mjs} +35 -11
  106. package/dist/{chunk-KYVRZAYP.mjs → chunk-I54T6CQP.mjs} +2 -69
  107. package/dist/{chunk-IRWP524D.mjs → chunk-INJYO3BU.mjs} +1 -1
  108. package/dist/chunk-IPN7S4KX.mjs +130 -0
  109. package/dist/{chunk-CSHHU7PA.mjs → chunk-J4IWBIVY.mjs} +11 -30
  110. package/dist/{chunk-G5KHSM6E.mjs → chunk-K4ZIGL2O.mjs} +1 -1
  111. package/dist/{chunk-6RKSY3BX.mjs → chunk-KBDBPVLN.mjs} +5 -5
  112. package/dist/{chunk-J4BDAH2W.mjs → chunk-KBKEXQZA.mjs} +2 -2
  113. package/dist/{chunk-IJSFWGVW.mjs → chunk-KFLK5NA2.mjs} +3 -3
  114. package/dist/{chunk-YGQOPB2Z.mjs → chunk-KHKIRS5D.mjs} +1 -1
  115. package/dist/chunk-KJ3RTZDJ.mjs +101 -0
  116. package/dist/{chunk-2PNYKG2D.mjs → chunk-KMUNHGBQ.mjs} +139 -432
  117. package/dist/chunk-KP7TYHWT.mjs +92 -0
  118. package/dist/{chunk-VP6XRMWR.mjs → chunk-KPIV4RUC.mjs} +6 -32
  119. package/dist/{chunk-NPXVQS33.mjs → chunk-KXCVQWOR.mjs} +4 -3
  120. package/dist/chunk-KYYABCSW.mjs +72 -0
  121. package/dist/{chunk-6F6USYII.mjs → chunk-L7ZD4L3K.mjs} +267 -265
  122. package/dist/{chunk-U46IZNCW.mjs → chunk-LC3FDWTX.mjs} +3 -2
  123. package/dist/{chunk-6BWLDLS3.mjs → chunk-LHKOSI2J.mjs} +1 -1
  124. package/dist/chunk-LNGE7SLY.mjs +151 -0
  125. package/dist/{react-native/chunks/chunk-YH7W556M.mjs → chunk-MP7ABPTD.mjs} +12 -2
  126. package/dist/chunk-MT2NRTA6.mjs +216 -0
  127. package/dist/chunk-NF4DT3IH.mjs +85 -0
  128. package/dist/{chunk-POUYICOU.mjs → chunk-OIJ64LGT.mjs} +1 -1
  129. package/dist/{chunk-SEAJS664.mjs → chunk-PCRA7HTI.mjs} +5 -5
  130. package/dist/chunk-PHQNACDT.mjs +63 -0
  131. package/dist/chunk-Q622CTMC.mjs +74 -0
  132. package/dist/{chunk-NVTFQFUL.mjs → chunk-Q7G3BV3Y.mjs} +1 -1
  133. package/dist/chunk-QDZJM7NI.mjs +23 -0
  134. package/dist/{chunk-52QQWEBS.mjs → chunk-QH3YIQP4.mjs} +36 -7
  135. package/dist/chunk-QJVOLKU6.mjs +111 -0
  136. package/dist/chunk-QUJHMPTP.mjs +30 -0
  137. package/dist/{chunk-3E4RRF5J.mjs → chunk-RSVULW4Q.mjs} +100 -8
  138. package/dist/{chunk-IJPK5PGM.mjs → chunk-RVGRFOGN.mjs} +1 -1
  139. package/dist/chunk-RZWWB2XR.mjs +96 -0
  140. package/dist/{chunk-KQJVNPRM.mjs → chunk-S2EQU2GE.mjs} +19 -16
  141. package/dist/chunk-S5LN746F.mjs +10 -0
  142. package/dist/{chunk-LJ4ENXOD.mjs → chunk-SG3JBNHY.mjs} +2 -2
  143. package/dist/{chunk-B2FTZNNF.mjs → chunk-SMVH6JBE.mjs} +34 -14
  144. package/dist/chunk-SY3EWKQY.mjs +242 -0
  145. package/dist/{chunk-NYSONUB7.mjs → chunk-TQXHPFWT.mjs} +1 -1
  146. package/dist/{chunk-ZHAXP7SD.mjs → chunk-U4BS74YN.mjs} +26 -238
  147. package/dist/chunk-UHICS3JI.mjs +83 -0
  148. package/dist/chunk-UZRZKNNZ.mjs +101 -0
  149. package/dist/chunk-V6EUBAIT.mjs +19 -0
  150. package/dist/{chunk-TTCKT2RT.mjs → chunk-VGF7CFRP.mjs} +134 -11
  151. package/dist/chunk-VHBNF4MA.mjs +543 -0
  152. package/dist/{chunk-AWNHDBKV.mjs → chunk-VQEUR6T6.mjs} +16 -8
  153. package/dist/chunk-WQRN64Q6.mjs +196 -0
  154. package/dist/{chunk-DMNPYF54.mjs → chunk-WZ7YV54N.mjs} +2 -2
  155. package/dist/chunk-Y4WPNHMC.mjs +50 -0
  156. package/dist/{chunk-2HJWQPR6.mjs → chunk-YEDIDCR7.mjs} +6 -122
  157. package/dist/chunk-YEKL4JBK.mjs +96 -0
  158. package/dist/{chunk-UGVUW27S.mjs → chunk-Z2BE2MAM.mjs} +14 -10
  159. package/dist/{chunk-3HV7M5OJ.mjs → chunk-ZAUJFLEN.mjs} +11 -135
  160. package/dist/{chunk-FDG4KXX5.mjs → chunk-ZHCUZZE5.mjs} +6 -4
  161. package/dist/chunk-ZTW5WTGG.mjs +167 -0
  162. package/dist/chunk-ZYAY26KG.mjs +29 -0
  163. package/dist/{client-Cn3gNxUU.d.ts → client-DRv7UVeY.d.ts} +193 -11
  164. package/dist/client.d.ts +9 -7
  165. package/dist/client.mjs +120 -7
  166. package/dist/{cold-module-PYSSBIL7.mjs → cold-module-7XXCEGTZ.mjs} +43 -33
  167. package/dist/config-CoSig5Ox.d.ts +482 -0
  168. package/dist/{config-CfhH1IWQ.d.ts → config-DMwffLKn.d.ts} +20 -5
  169. package/dist/{direct-executor-WYALQSMD.mjs → direct-executor-G5TK7NLA.mjs} +18 -13
  170. package/dist/distribution/coordinator/etcd.d.ts +2 -2
  171. package/dist/distribution/coordinator/etcd.mjs +1 -1
  172. package/dist/distribution/coordinator/in-memory.d.ts +2 -2
  173. package/dist/distribution/transport/grpc.mjs +4 -4
  174. package/dist/distribution/transport/in-memory.mjs +2 -2
  175. package/dist/distribution/transport/tcp.mjs +3 -3
  176. package/dist/distribution.d.ts +41 -9
  177. package/dist/distribution.mjs +9304 -7271
  178. package/dist/durability-config-GE4U7MCZ.mjs +89 -0
  179. package/dist/{durability-wiring-7VBZEJLG.mjs → durability-wiring-NCKUC5EO.mjs} +1293 -872
  180. package/dist/embeddings/openai.mjs +2 -2
  181. package/dist/{config-aIsy7mcL.d.ts → engine-CFxPYqEk.d.ts} +716 -407
  182. package/dist/engine-hooks-DHCMOADY.mjs +47 -0
  183. package/dist/{import-GJOMB2HC.mjs → import-NBFXFCSG.mjs} +32 -24
  184. package/dist/{index-MsF7e5hL.d.ts → index-C4AmUnl1.d.ts} +1 -1
  185. package/dist/index.browser.mjs +9 -4
  186. package/dist/index.d.ts +7 -6
  187. package/dist/index.mjs +29 -21
  188. package/dist/index.react-native.mjs +19 -12
  189. package/dist/{long-query-thread-SCUE62TO.mjs → long-query-thread-J4DVRM4A.mjs} +33 -19
  190. package/dist/methods-7IOINERF.mjs +30 -0
  191. package/dist/{module-6RLIKSZQ.mjs → module-DWKPBSMN.mjs} +38 -28
  192. package/dist/{module-AVQEIB7O.mjs → module-UN76TF7I.mjs} +14 -14
  193. package/dist/operations-G5EP6JPX.mjs +5 -0
  194. package/dist/{paged-partition-archive-KGRW366Y.mjs → paged-partition-archive-DPNWVSK2.mjs} +46 -31
  195. package/dist/partial-words.mjs +7 -5
  196. package/dist/pattern.mjs +4 -3
  197. package/dist/persistence/durability/checkpoint-worker.d.ts +16 -1
  198. package/dist/persistence/durability/checkpoint-worker.mjs +40 -29
  199. package/dist/{phrase-module-OUQIRUQU.mjs → phrase-module-ZI4WSQVH.mjs} +1 -1
  200. package/dist/{pool-UPV5PVPY.mjs → pool-Y4A46T36.mjs} +2 -2
  201. package/dist/query-suggestions/merge-worker.d.ts +55 -0
  202. package/dist/query-suggestions/merge-worker.mjs +81 -0
  203. package/dist/query-suggestions-CBYkrQ5T.d.ts +311 -0
  204. package/dist/query-suggestions.browser.mjs +246 -0
  205. package/dist/query-suggestions.d.ts +20 -0
  206. package/dist/query-suggestions.mjs +62 -0
  207. package/dist/react-native/chunks/{analysis-change-DXPZRGWF.mjs → analysis-change-6BPDPH6K.mjs} +50 -19
  208. package/dist/{browser/analysis-change-entry-JL5U2N3Q.mjs → react-native/chunks/analysis-change-entry-JLL42PH6.mjs} +1 -1
  209. package/dist/react-native/chunks/archive-history-MJKUQLSU.mjs +29 -0
  210. package/dist/react-native/chunks/chunk-3JIBF3XT.mjs +191 -0
  211. package/dist/react-native/chunks/chunk-3NQOVO3K.mjs +1 -0
  212. package/dist/react-native/chunks/{chunk-UFNCLEQM.mjs → chunk-4DII3ZSM.mjs} +1 -1
  213. package/dist/react-native/chunks/{chunk-BRNAVOKP.mjs → chunk-4J74WHQM.mjs} +2 -2
  214. package/dist/react-native/chunks/chunk-4LCEN2IU.mjs +315 -0
  215. package/dist/react-native/chunks/{chunk-PU55IOG4.mjs → chunk-4Y53T4YE.mjs} +6 -190
  216. package/dist/react-native/chunks/chunk-5CQX3XXV.mjs +17 -0
  217. package/dist/react-native/chunks/chunk-6VBXNFLE.mjs +9 -0
  218. package/dist/react-native/chunks/chunk-6WA3C3DV.mjs +85 -0
  219. package/dist/react-native/chunks/chunk-7GRCBBME.mjs +63 -0
  220. package/dist/react-native/chunks/{chunk-2J2727V4.mjs → chunk-7PXRWYUU.mjs} +1 -1
  221. package/dist/{browser/chunk-VBX2TI5V.mjs → react-native/chunks/chunk-ALOIBXWN.mjs} +2 -2
  222. package/dist/react-native/chunks/{chunk-FS7BYE23.mjs → chunk-C3PTWYKT.mjs} +10 -153
  223. package/dist/react-native/chunks/{chunk-DKJTZ625.mjs → chunk-C5G6TJ7A.mjs} +2 -69
  224. package/dist/react-native/chunks/chunk-CHPTFFJM.mjs +43 -0
  225. package/dist/react-native/chunks/{chunk-LRGWK367.mjs → chunk-CKNRFDTZ.mjs} +1 -1
  226. package/dist/react-native/chunks/chunk-CUH5F57W.mjs +242 -0
  227. package/dist/react-native/chunks/chunk-DIYDOIM4.mjs +10 -0
  228. package/dist/{browser/chunk-55WYRLDZ.mjs → react-native/chunks/chunk-DVDX4SDR.mjs} +2 -2
  229. package/dist/{browser/chunk-PIS7ZAP7.mjs → react-native/chunks/chunk-DZ7H7D2C.mjs} +12 -2
  230. package/dist/react-native/chunks/{chunk-KOCTCUXW.mjs → chunk-EIOYM5TO.mjs} +17 -9
  231. package/dist/react-native/chunks/chunk-F753DA54.mjs +23 -0
  232. package/dist/react-native/chunks/chunk-GIZTJXYW.mjs +1007 -0
  233. package/dist/react-native/chunks/{chunk-CLE3LZ77.mjs → chunk-GJFXPHXI.mjs} +5 -4
  234. package/dist/react-native/chunks/chunk-H3MDVPBO.mjs +151 -0
  235. package/dist/react-native/chunks/{chunk-IDFMNRIC.mjs → chunk-HUOYZJ3Q.mjs} +140 -430
  236. package/dist/react-native/chunks/chunk-IYNT75CE.mjs +111 -0
  237. package/dist/react-native/chunks/chunk-JDOEEMEF.mjs +38 -0
  238. package/dist/react-native/chunks/{chunk-LQAKO5QV.mjs → chunk-JLIIWJUV.mjs} +2 -2
  239. package/dist/react-native/chunks/chunk-JWUCMVRK.mjs +15 -0
  240. package/dist/react-native/chunks/chunk-KJIG57UD.mjs +1106 -0
  241. package/dist/react-native/chunks/{chunk-KLZGAOLT.mjs → chunk-KTTAU63H.mjs} +5 -5
  242. package/dist/react-native/chunks/chunk-LU3Y3P63.mjs +68 -0
  243. package/dist/{browser/chunk-NVEJJP4R.mjs → react-native/chunks/chunk-LZSLNSUN.mjs} +2 -79
  244. package/dist/react-native/chunks/{chunk-3CTWSQRW.mjs → chunk-MJDQU5MW.mjs} +4 -30
  245. package/dist/react-native/chunks/{chunk-NFGBOI46.mjs → chunk-MVXELMJX.mjs} +1 -1
  246. package/dist/react-native/chunks/{chunk-D7LFYPYI.mjs → chunk-N2WUOWLL.mjs} +12 -10
  247. package/dist/react-native/chunks/chunk-NVVRSRX5.mjs +78 -0
  248. package/dist/react-native/chunks/{chunk-JYL35A4A.mjs → chunk-OL3WDV53.mjs} +7 -33
  249. package/dist/react-native/chunks/chunk-PB2YXVQW.mjs +29 -0
  250. package/dist/react-native/chunks/{chunk-UCJU6WNH.mjs → chunk-PEHS2UO3.mjs} +7 -6
  251. package/dist/react-native/chunks/chunk-PJHAB5ZY.mjs +79 -0
  252. package/dist/react-native/chunks/chunk-Q32DDFKX.mjs +19 -0
  253. package/dist/react-native/chunks/chunk-QJXTNPLQ.mjs +100 -0
  254. package/dist/react-native/chunks/{chunk-ZCKNBPQ4.mjs → chunk-RDWG33MM.mjs} +2 -2
  255. package/dist/react-native/chunks/chunk-SUPXRTMD.mjs +96 -0
  256. package/dist/react-native/chunks/chunk-TYIRMPD3.mjs +432 -0
  257. package/dist/react-native/chunks/{chunk-TLYD7IJ2.mjs → chunk-U4KSKA4Z.mjs} +1 -1
  258. package/dist/react-native/chunks/chunk-UNUFZ2QY.mjs +68 -0
  259. package/dist/react-native/chunks/{chunk-7IQR3SZO.mjs → chunk-VXGE4ZXL.mjs} +151 -257
  260. package/dist/react-native/chunks/{chunk-R4OPUZQ5.mjs → chunk-WBYQRHDY.mjs} +2 -2
  261. package/dist/react-native/chunks/chunk-YH7QY657.mjs +288 -0
  262. package/dist/react-native/chunks/chunk-ZZT7CEN7.mjs +92 -0
  263. package/dist/react-native/chunks/{cold-module-KFGEWYEL.mjs → cold-module-5PHF6DZR.mjs} +31 -22
  264. package/dist/react-native/chunks/durability-config-QXVZEO7T.mjs +89 -0
  265. package/dist/react-native/chunks/{durability-wiring-QKJB2QBT.mjs → durability-wiring-KO565FZC.mjs} +1309 -889
  266. package/dist/react-native/chunks/engine-hooks-MVRRHH6B.mjs +28 -0
  267. package/dist/react-native/chunks/gzip.react-native-HLEPDKZ3.mjs +3 -0
  268. package/dist/react-native/chunks/import-YVZA4V4V.mjs +30 -0
  269. package/dist/react-native/chunks/methods-6W5U4C3H.mjs +30 -0
  270. package/dist/react-native/chunks/{module-UJ5VUARS.mjs → module-H5MVPSP2.mjs} +13 -11
  271. package/dist/react-native/chunks/module-ZL5ZG6YB.mjs +34 -0
  272. package/dist/react-native/chunks/operations-GNRMD6EX.mjs +5 -0
  273. package/dist/react-native/chunks/{phrase-module-76UAPPSG.mjs → phrase-module-RTVKEWJT.mjs} +1 -1
  274. package/dist/react-native/chunks/{pool-CD4ANYUI.mjs → pool-JR3NJCAF.mjs} +3 -2
  275. package/dist/react-native/chunks/restore-hooks-SILFPU6B.mjs +125 -0
  276. package/dist/react-native/chunks/restore-queue-HSYP2AEC.mjs +55 -0
  277. package/dist/react-native/chunks/retention-7I7UAWYK.mjs +221 -0
  278. package/dist/react-native/chunks/{runtime-3MCDLJAF.mjs → runtime-R5E3TB3J.mjs} +1 -1
  279. package/dist/react-native/chunks/{snapshot-KVBD4LRC.mjs → snapshot-EZYB6SLF.mjs} +90 -323
  280. package/dist/react-native/chunks/start-SHVZ72I5.mjs +36 -0
  281. package/dist/react-native/chunks/sync-state-PASCIHHT.mjs +15 -0
  282. package/dist/react-native/chunks/{write-ES5A3WUA.mjs → write-JUESXHDL.mjs} +27 -19
  283. package/dist/react-native/partial-words.mjs +8 -5
  284. package/dist/react-native/pattern.mjs +4 -3
  285. package/dist/react-native/query-suggestions.mjs +258 -0
  286. package/dist/react-native/sync.mjs +2299 -0
  287. package/dist/react-native/synonyms.mjs +7 -4
  288. package/dist/react.d.ts +11 -10
  289. package/dist/react.mjs +8 -1
  290. package/dist/{rerank-3W54N6P2.mjs → rerank-MQ37IYRV.mjs} +4 -4
  291. package/dist/rerankers/http.mjs +2 -2
  292. package/dist/restore-hooks-HZ3ILAMO.mjs +146 -0
  293. package/dist/restore-queue-JVGENGGE.mjs +55 -0
  294. package/dist/retention-HROPV2QU.mjs +59 -0
  295. package/dist/{runtime-L2DZYY6N.mjs → runtime-COIUORCN.mjs} +5 -5
  296. package/dist/{schema-D33CyXCy.d.ts → schema-Jwt928nJ.d.ts} +1 -1
  297. package/dist/server.d.ts +119 -20
  298. package/dist/server.mjs +1123 -58
  299. package/dist/{snapshot-WMX6JCLP.mjs → snapshot-4HS2G2UM.mjs} +106 -49
  300. package/dist/start-UTWHGH42.mjs +59 -0
  301. package/dist/sync/filesystem.d.ts +30 -0
  302. package/dist/sync/filesystem.mjs +271 -0
  303. package/dist/sync/indexeddb.d.ts +30 -0
  304. package/dist/sync/indexeddb.mjs +237 -0
  305. package/dist/sync-state-ZWHLAFLE.mjs +15 -0
  306. package/dist/sync.browser.mjs +2294 -0
  307. package/dist/sync.d.ts +23 -0
  308. package/dist/sync.mjs +2268 -0
  309. package/dist/synonyms.mjs +6 -4
  310. package/dist/{tasks-C4ElXr4P.d.ts → tasks-qrJojgST.d.ts} +13 -5
  311. package/dist/thread-6MOXY2KD.mjs +45 -0
  312. package/dist/types-BZCGjfLn.d.ts +227 -0
  313. package/dist/vector/search-worker.d.ts +1 -1
  314. package/dist/vector/search-worker.mjs +7 -7
  315. package/dist/workers/entry.mjs +8 -8
  316. package/dist/{write-SKJ6HW7O.mjs → write-GTTWWRRG.mjs} +36 -28
  317. package/openapi.json +912 -5
  318. package/package.json +45 -8
  319. package/dist/browser/import-QOY6ZH6X.mjs +0 -12
  320. package/dist/browser/restore-queue-UQ6AAUVX.mjs +0 -41
  321. package/dist/chunk-7LDMWKP6.mjs +0 -209
  322. package/dist/engine-CJRUHXgf.d.ts +0 -664
  323. package/dist/react-native/chunks/chunk-L4M7QJNP.mjs +0 -110
  324. package/dist/react-native/chunks/chunk-TJMSKBEM.mjs +0 -25
  325. package/dist/react-native/chunks/gzip.react-native-7JWCLVOB.mjs +0 -3
  326. package/dist/react-native/chunks/import-XFBCCENV.mjs +0 -22
  327. package/dist/react-native/chunks/module-FHJ2GOBI.mjs +0 -25
  328. package/dist/react-native/chunks/restore-queue-H5VCN453.mjs +0 -41
  329. package/dist/restore-queue-AOF5OTQV.mjs +0 -41
  330. package/dist/thread-I7DVHHW7.mjs +0 -31
@@ -0,0 +1,214 @@
1
+ import { crc32Init, crc32Final, crc32Update } from './chunk-7GXJUJ24.mjs';
2
+ import { MAX_FILE_BYTES, CHECKSUM_YIELD_CHUNK_BYTES } from './chunk-U476IXKQ.mjs';
3
+ import { NarsilError, ErrorCodes } from './chunk-MP7ABPTD.mjs';
4
+
5
+ // src/serialization/header.ts
6
+ var MAGIC_BYTES = new Uint8Array([78, 82, 83, 76]);
7
+ var HEADER_SIZE = 32;
8
+ var RESERVED_SIZE = 14;
9
+ var MAX_PAYLOAD_LENGTH = 4294967295;
10
+ var COMPRESSION_ALGORITHMS = {
11
+ 0: "none",
12
+ 1: "gzip",
13
+ 2: "lz4",
14
+ 3: "zstd"
15
+ };
16
+ var COMPRESSION_TO_BITS = {
17
+ none: 0,
18
+ gzip: 1,
19
+ lz4: 2,
20
+ zstd: 3
21
+ };
22
+ function encodeFlags(flags) {
23
+ let bits = 0;
24
+ if (flags.compressionEnabled) bits |= 1;
25
+ bits |= (COMPRESSION_TO_BITS[flags.compressionAlgorithm] & 3) << 1;
26
+ if (flags.checksumPresent) bits |= 1 << 3;
27
+ if (flags.encryptionEnabled) bits |= 1 << 4;
28
+ return bits;
29
+ }
30
+ function decodeFlags(value) {
31
+ const compressionEnabled = (value & 1) === 1;
32
+ const algorithmBits = value >> 1 & 3;
33
+ const checksumPresent = (value >> 3 & 1) === 1;
34
+ const encryptionEnabled = (value >> 4 & 1) === 1;
35
+ return {
36
+ compressionEnabled,
37
+ compressionAlgorithm: COMPRESSION_ALGORITHMS[algorithmBits] ?? "none",
38
+ checksumPresent,
39
+ encryptionEnabled
40
+ };
41
+ }
42
+ function writeHeader(header) {
43
+ if (header.payloadLength > MAX_PAYLOAD_LENGTH) {
44
+ throw new NarsilError(
45
+ ErrorCodes.PERSISTENCE_SAVE_FAILED,
46
+ `A payload of ${header.payloadLength} bytes exceeds the ${MAX_PAYLOAD_LENGTH} bytes the envelope header can describe`,
47
+ { payloadLength: header.payloadLength, maxPayloadLength: MAX_PAYLOAD_LENGTH }
48
+ );
49
+ }
50
+ const buffer = new Uint8Array(HEADER_SIZE);
51
+ const view = new DataView(buffer.buffer);
52
+ buffer.set(MAGIC_BYTES, 0);
53
+ buffer[4] = header.envelopeFormatVersion & 255;
54
+ buffer[5] = header.engineVersionMajor & 255;
55
+ buffer[6] = header.engineVersionMinor & 255;
56
+ buffer[7] = header.engineVersionPatch & 255;
57
+ view.setUint32(8, header.payloadLength, false);
58
+ view.setUint16(12, encodeFlags(header.flags), false);
59
+ view.setUint32(14, header.checksum, false);
60
+ for (let i = 18; i < HEADER_SIZE; i++) {
61
+ buffer[i] = 0;
62
+ }
63
+ return buffer;
64
+ }
65
+ function hasNrslMagic(data) {
66
+ return data.length >= MAGIC_BYTES.length && data[0] === MAGIC_BYTES[0] && data[1] === MAGIC_BYTES[1] && data[2] === MAGIC_BYTES[2] && data[3] === MAGIC_BYTES[3];
67
+ }
68
+ function readHeader(data) {
69
+ if (data.length < HEADER_SIZE) {
70
+ throw new NarsilError(
71
+ ErrorCodes.ENVELOPE_INVALID_MAGIC,
72
+ `Expected at least ${HEADER_SIZE} bytes, received ${data.length}`
73
+ );
74
+ }
75
+ if (data[0] !== MAGIC_BYTES[0] || data[1] !== MAGIC_BYTES[1] || data[2] !== MAGIC_BYTES[2] || data[3] !== MAGIC_BYTES[3]) {
76
+ throw new NarsilError(ErrorCodes.ENVELOPE_INVALID_MAGIC, "File does not begin with NRSL magic bytes");
77
+ }
78
+ const view = new DataView(data.buffer, data.byteOffset, data.byteLength);
79
+ const envelopeFormatVersion = data[4];
80
+ const engineVersionMajor = data[5];
81
+ const engineVersionMinor = data[6];
82
+ const engineVersionPatch = data[7];
83
+ const payloadLength = view.getUint32(8, false);
84
+ const flagBits = view.getUint16(12, false);
85
+ const checksum = view.getUint32(14, false);
86
+ const reserved = data.slice(18, HEADER_SIZE);
87
+ return {
88
+ magic: "NRSL",
89
+ envelopeFormatVersion,
90
+ engineVersionMajor,
91
+ engineVersionMinor,
92
+ engineVersionPatch,
93
+ payloadLength,
94
+ flags: decodeFlags(flagBits),
95
+ checksum,
96
+ reserved
97
+ };
98
+ }
99
+
100
+ // src/serialization/chunk-checksum.ts
101
+ function yieldToEventLoop() {
102
+ if (typeof setImmediate === "function") {
103
+ return new Promise((resolve) => setImmediate(resolve));
104
+ }
105
+ return new Promise((resolve) => setTimeout(resolve, 0));
106
+ }
107
+ async function advanceChecksum(start, payload) {
108
+ let state = start;
109
+ for (let offset = 0; offset < payload.length; offset += CHECKSUM_YIELD_CHUNK_BYTES) {
110
+ const end = Math.min(offset + CHECKSUM_YIELD_CHUNK_BYTES, payload.length);
111
+ state = crc32Update(state, payload.subarray(offset, end));
112
+ if (end < payload.length) {
113
+ await yieldToEventLoop();
114
+ }
115
+ }
116
+ return state;
117
+ }
118
+ async function checksumOfChunks(chunks) {
119
+ let state = crc32Init();
120
+ for (const chunk of chunks) state = await advanceChecksum(state, chunk);
121
+ return crc32Final(state);
122
+ }
123
+ function payloadByteLength(chunks) {
124
+ let total = 0;
125
+ for (const chunk of chunks) total += chunk.byteLength;
126
+ return total;
127
+ }
128
+ function requireWithinFileLimit(byteLength, what) {
129
+ if (byteLength <= MAX_FILE_BYTES) return;
130
+ throw new NarsilError(
131
+ ErrorCodes.PERSISTENCE_SAVE_FAILED,
132
+ `The ${what} would take ${byteLength} bytes, above the file size limit of ${MAX_FILE_BYTES}`,
133
+ { bytes: byteLength, maximum: MAX_FILE_BYTES }
134
+ );
135
+ }
136
+ function packEnvelopeWithEngineVersion(payloadChunks, envelopeFormatVersion, what, checksum, engineVersion) {
137
+ const payloadLength = payloadByteLength(payloadChunks);
138
+ requireWithinFileLimit(HEADER_SIZE + payloadLength, what);
139
+ const [major, minor, patch] = engineVersion;
140
+ const header = writeHeader({
141
+ envelopeFormatVersion,
142
+ engineVersionMajor: major,
143
+ engineVersionMinor: minor,
144
+ engineVersionPatch: patch,
145
+ payloadLength,
146
+ flags: { compressionEnabled: false, compressionAlgorithm: "none", checksumPresent: true, encryptionEnabled: false },
147
+ checksum});
148
+ return { chunks: [header, ...payloadChunks], byteLength: HEADER_SIZE + payloadLength, checksum };
149
+ }
150
+ function loadFailed(message, details) {
151
+ throw new NarsilError(ErrorCodes.PERSISTENCE_LOAD_FAILED, message, details);
152
+ }
153
+ async function gunzipWithinLimit(compressed, what) {
154
+ const { gunzip } = await import('./gzip-F4HMIEEQ.mjs');
155
+ try {
156
+ return await gunzip(compressed, MAX_FILE_BYTES);
157
+ } catch (error) {
158
+ if (error?.code === "EFBIG") {
159
+ loadFailed(`The ${what} inflates past the file size limit of ${MAX_FILE_BYTES} bytes`);
160
+ }
161
+ loadFailed(`The ${what} holds a gzip payload that fails to inflate`, {
162
+ cause: error instanceof Error ? error.message : String(error)
163
+ });
164
+ }
165
+ }
166
+ async function openChecksummedEnvelope(data, expected) {
167
+ const { envelopeFormatVersion, what } = expected;
168
+ const header = readHeader(data);
169
+ if (header.envelopeFormatVersion !== envelopeFormatVersion) {
170
+ throw new NarsilError(
171
+ ErrorCodes.ENVELOPE_VERSION_MISMATCH,
172
+ `The ${what} holds envelope format v${header.envelopeFormatVersion}, while this build reads it as v${envelopeFormatVersion}`,
173
+ { version: header.envelopeFormatVersion, expected: envelopeFormatVersion }
174
+ );
175
+ }
176
+ if (header.flags.encryptionEnabled) {
177
+ throw new NarsilError(
178
+ ErrorCodes.ENVELOPE_VERSION_MISMATCH,
179
+ `The ${what} is encrypted, which this build cannot read`
180
+ );
181
+ }
182
+ if (header.flags.compressionEnabled && !expected.allowsCompression) {
183
+ loadFailed(`The ${what} is compressed, while its format stores it raw`);
184
+ }
185
+ if (header.flags.compressionEnabled && header.flags.compressionAlgorithm !== "gzip") {
186
+ throw new NarsilError(
187
+ ErrorCodes.ENVELOPE_VERSION_MISMATCH,
188
+ `The ${what} uses ${header.flags.compressionAlgorithm} compression, which this build cannot read`
189
+ );
190
+ }
191
+ if (!header.flags.checksumPresent) loadFailed(`The ${what} carries no checksum, while its format requires one`);
192
+ if (data.byteLength !== HEADER_SIZE + header.payloadLength) {
193
+ loadFailed(
194
+ `The ${what} holds ${data.byteLength} bytes where its header gives ${HEADER_SIZE + header.payloadLength}`,
195
+ { bytes: data.byteLength, expected: HEADER_SIZE + header.payloadLength }
196
+ );
197
+ }
198
+ const payload = data.subarray(HEADER_SIZE);
199
+ const computed = await checksumOfChunks([payload]);
200
+ if (computed !== header.checksum) {
201
+ throw new NarsilError(
202
+ ErrorCodes.PERSISTENCE_CRC_MISMATCH,
203
+ `The checksum of the ${what} does not match its payload`,
204
+ {
205
+ expected: header.checksum,
206
+ computed
207
+ }
208
+ );
209
+ }
210
+ if (header.flags.compressionEnabled) return { header, payload: await gunzipWithinLimit(payload, what) };
211
+ return { header, payload };
212
+ }
213
+
214
+ export { HEADER_SIZE, RESERVED_SIZE, checksumOfChunks, hasNrslMagic, openChecksummedEnvelope, packEnvelopeWithEngineVersion, payloadByteLength, readHeader, requireWithinFileLimit, writeHeader };
@@ -1,18 +1,23 @@
1
- import { loadVectorField, VECTOR_FILE_ENVELOPE_VERSION, GRAPH_PART_ENVELOPE_VERSION } from './chunk-6RKSY3BX.mjs';
1
+ import { loadVectorField, VECTOR_FILE_ENVELOPE_VERSION, GRAPH_PART_ENVELOPE_VERSION } from './chunk-KBDBPVLN.mjs';
2
2
  import { gunzip, gzip } from './chunk-ZXNNR73R.mjs';
3
- import { SEGMENT_PAGE_BYTES, RECORD_PAGE_BYTES } from './chunk-DMNPYF54.mjs';
3
+ import { SEGMENT_PAGE_BYTES, RECORD_PAGE_BYTES } from './chunk-WZ7YV54N.mjs';
4
4
  import { defaultQuantizationFor } from './chunk-MATMVH65.mjs';
5
5
  import { DEFAULT_VECTOR_METRIC } from './chunk-VD7J552I.mjs';
6
- import { VECTOR_FILE_MAX_VECTORS, deadBytesFor } from './chunk-G5KHSM6E.mjs';
7
- import { readSegmentFile, STABLE_HEAD_ATTEMPTS } from './chunk-CSHHU7PA.mjs';
8
- import { MAX_SEGMENT_ID, MANIFEST_ENVELOPE_VERSION, EARLIER_SEGMENT_MANIFEST_VERSION, SEGMENT_MANIFEST_VERSION, MAX_SEGMENTS_PER_PARTITION, segmentKey, manifestKey, segmentsPrefix, vectorFileKey, graphPartKey } from './chunk-7LDMWKP6.mjs';
9
- import { VERSION, rulesOfStoredSynonyms, openChecksummedEnvelope, readHeader, HEADER_SIZE, crc32, engineVersionParts, writeHeader, packChecksummedEnvelope, packEnvelopeWithChecksum, checksumOfChunks } from './chunk-2PNYKG2D.mjs';
10
- import { decodeEveryStoredDocument, createSharedFrozenSegment, shareSegmentArrays } from './chunk-UGVUW27S.mjs';
11
- import { DEFAULT_BM25_B, DEFAULT_BM25_K1 } from './chunk-3HV7M5OJ.mjs';
12
- import { flattenSchema, requireValidFieldTypes, isQuantizationMode, isStorageMode } from './chunk-SOUZMPME.mjs';
6
+ import { decodeSegmentManifest } from './chunk-SY3EWKQY.mjs';
7
+ import { isSyncEpoch } from './chunk-BUMREPLU.mjs';
8
+ import { readSegmentFile, STABLE_HEAD_ATTEMPTS } from './chunk-J4IWBIVY.mjs';
9
+ import { manifestKey, segmentsPrefix, vectorFileKey, graphPartKey } from './chunk-NF4DT3IH.mjs';
10
+ import { storedStateToWire, storedStateFromWire } from './chunk-UZRZKNNZ.mjs';
11
+ import { VERSION, rulesOfStoredSynonyms, engineVersionParts, packChecksummedEnvelope, packEnvelopeWithChecksum } from './chunk-KMUNHGBQ.mjs';
12
+ import { decodeEveryStoredDocument, createSharedFrozenSegment, shareSegmentArrays } from './chunk-Z2BE2MAM.mjs';
13
+ import { DEFAULT_BM25_B, DEFAULT_BM25_K1 } from './chunk-ZAUJFLEN.mjs';
14
+ import { readHeader, HEADER_SIZE, writeHeader, checksumOfChunks } from './chunk-3OH67G7R.mjs';
15
+ import { crc32 } from './chunk-7GXJUJ24.mjs';
16
+ import { isQuantizationMode, isStorageMode } from './chunk-4KRC2APY.mjs';
17
+ import { flattenSchema, requireValidFieldTypes } from './chunk-WQRN64Q6.mjs';
13
18
  import { VECTOR_PATTERN } from './chunk-L5ORED7V.mjs';
14
- import { MAX_FILE_BYTES, VALID_HNSW_METRICS } from './chunk-U476IXKQ.mjs';
15
- import { NarsilError, ErrorCodes } from './chunk-MDF6PDIA.mjs';
19
+ import { VALID_HNSW_METRICS } from './chunk-U476IXKQ.mjs';
20
+ import { NarsilError, ErrorCodes } from './chunk-MP7ABPTD.mjs';
16
21
  import { compareCodePoints } from './chunk-YTJCGKM4.mjs';
17
22
  import { decode, encode } from '@msgpack/msgpack';
18
23
 
@@ -111,6 +116,10 @@ function metadataFromConfig(indexName, config, partitionCount, documentCount) {
111
116
  if (config.heldPartitions !== void 0) {
112
117
  metadata.heldPartitions = config.heldPartitions;
113
118
  }
119
+ if (config.sync !== void 0) metadata.sync = config.sync;
120
+ if (config.syncActive !== void 0) metadata.syncActive = config.syncActive;
121
+ if (config.syncEpoch !== void 0) metadata.syncEpoch = config.syncEpoch;
122
+ if (config.querySuggestions !== void 0) metadata.querySuggestions = config.querySuggestions;
114
123
  return metadata;
115
124
  }
116
125
  function metadataConfigOf(entry) {
@@ -145,7 +154,22 @@ function metadataConfigOf(entry) {
145
154
  ...entry.config.required !== void 0 ? { required: entry.config.required } : {},
146
155
  ...entry.config.vectorPromotion !== void 0 ? { vectorPromotion: entry.config.vectorPromotion } : {},
147
156
  ...entry.config.patternValueLimit !== void 0 ? { patternValueLimit: entry.config.patternValueLimit } : {},
148
- ...entry.synonyms !== null ? { synonyms: rulesOfStoredSynonyms(entry.synonyms) } : {}
157
+ ...entry.synonyms !== null ? { synonyms: rulesOfStoredSynonyms(entry.synonyms) } : {},
158
+ ...syncMetadataOf(entry),
159
+ ...entry.querySuggestions !== null ? { querySuggestions: entry.querySuggestions } : {}
160
+ };
161
+ }
162
+ function syncMetadataOf(entry) {
163
+ const sync = entry.sync;
164
+ if (sync === null) return {};
165
+ return {
166
+ sync: {
167
+ enabled: true,
168
+ ...sync.historyMaxAgeMs !== void 0 ? { historyMaxAgeMs: sync.historyMaxAgeMs } : {},
169
+ ...sync.historyMaxBytes !== void 0 ? { historyMaxBytes: sync.historyMaxBytes } : {}
170
+ },
171
+ syncActive: sync.active,
172
+ syncEpoch: sync.epoch
149
173
  };
150
174
  }
151
175
  function durableMetadataConfigOf(entry) {
@@ -354,6 +378,56 @@ function deserializePayloadV1(data) {
354
378
  const raw = decode(data);
355
379
  return wireToPartition(raw);
356
380
  }
381
+
382
+ // src/serialization/payload-v1/sync-metadata.ts
383
+ function invalid(message, details) {
384
+ throw new NarsilError(ErrorCodes.CONFIG_INVALID, `The device sync state in the index metadata ${message}`, details);
385
+ }
386
+ function isPositiveSafeInteger(value) {
387
+ return typeof value === "number" && Number.isSafeInteger(value) && value >= 1;
388
+ }
389
+ function syncMetadataToWire(meta) {
390
+ const wire = {};
391
+ if (meta.sync !== void 0) {
392
+ wire.sync = {
393
+ enabled: meta.sync.enabled,
394
+ ...meta.sync.historyMaxAgeMs !== void 0 ? { history_max_age_ms: meta.sync.historyMaxAgeMs } : {},
395
+ ...meta.sync.historyMaxBytes !== void 0 ? { history_max_bytes: meta.sync.historyMaxBytes } : {}
396
+ };
397
+ }
398
+ if (meta.syncActive !== void 0) wire.sync_active = meta.syncActive;
399
+ if (meta.syncEpoch !== void 0) wire.sync_epoch = meta.syncEpoch;
400
+ return wire;
401
+ }
402
+ function storedSyncSetting(raw) {
403
+ if (raw === null || typeof raw !== "object") invalid("holds a sync setting that is not a map", {});
404
+ const { enabled, history_max_age_ms: maxAge, history_max_bytes: maxBytes } = raw;
405
+ if (typeof enabled !== "boolean") invalid("holds a sync setting without a boolean enabled", {});
406
+ if (maxAge !== void 0 && !isPositiveSafeInteger(maxAge)) {
407
+ invalid("holds a history age limit that is not a positive whole number", { historyMaxAgeMs: String(maxAge) });
408
+ }
409
+ if (maxBytes !== void 0 && !isPositiveSafeInteger(maxBytes)) {
410
+ invalid("holds a history byte limit that is not a positive whole number", { historyMaxBytes: String(maxBytes) });
411
+ }
412
+ return {
413
+ enabled,
414
+ ...maxAge !== void 0 ? { historyMaxAgeMs: maxAge } : {},
415
+ ...maxBytes !== void 0 ? { historyMaxBytes: maxBytes } : {}
416
+ };
417
+ }
418
+ function syncMetadataFromWire(raw, meta) {
419
+ if (raw.sync !== void 0 && raw.sync !== null) meta.sync = storedSyncSetting(raw.sync);
420
+ if (raw.sync_active !== void 0 && raw.sync_active !== null) {
421
+ if (typeof raw.sync_active !== "boolean") invalid("holds a sync_active that is not a boolean", {});
422
+ meta.syncActive = raw.sync_active;
423
+ }
424
+ if (raw.sync_epoch !== void 0 && raw.sync_epoch !== null) {
425
+ if (!isSyncEpoch(raw.sync_epoch)) invalid("holds an epoch that is not 32 lowercase hexadecimal digits", {});
426
+ meta.syncEpoch = raw.sync_epoch;
427
+ }
428
+ }
429
+
430
+ // src/serialization/payload-v1/metadata.ts
357
431
  function metadataToWire(meta) {
358
432
  const wire = {
359
433
  index_name: meta.indexName,
@@ -454,7 +528,11 @@ function metadataToWire(meta) {
454
528
  if (Array.isArray(meta.synonyms) && meta.synonyms.length > 0) {
455
529
  wire.synonyms = meta.synonyms;
456
530
  }
457
- return wire;
531
+ return {
532
+ ...wire,
533
+ ...syncMetadataToWire(meta),
534
+ ...meta.querySuggestions !== void 0 ? storedStateToWire(meta.querySuggestions) : {}
535
+ };
458
536
  }
459
537
  function wireToMetadata(raw) {
460
538
  const meta = {
@@ -610,6 +688,9 @@ function wireToMetadata(raw) {
610
688
  meta.heldPartitions = raw.held_partitions;
611
689
  }
612
690
  if (raw.synonyms !== void 0 && raw.synonyms !== null) meta.synonyms = raw.synonyms;
691
+ syncMetadataFromWire(raw, meta);
692
+ const querySuggestions = storedStateFromWire(raw);
693
+ if (querySuggestions !== null) meta.querySuggestions = querySuggestions;
613
694
  return meta;
614
695
  }
615
696
  function isNonNegativeInteger(value) {
@@ -741,239 +822,6 @@ async function readMetadataEnvelope(data) {
741
822
  return { header, metadata };
742
823
  }
743
824
 
744
- // src/persistence/durability/segment/manifest-fields.ts
745
- function invalidManifest(message, details) {
746
- throw new NarsilError(ErrorCodes.PERSISTENCE_LOAD_FAILED, `Segment manifest ${message}`, details);
747
- }
748
- function isRecord(value) {
749
- return typeof value === "object" && value !== null && !Array.isArray(value) && !(value instanceof Uint8Array);
750
- }
751
- function isId(value) {
752
- return typeof value === "number" && Number.isInteger(value) && value >= 0 && value <= MAX_SEGMENT_ID;
753
- }
754
- function isUint32(value) {
755
- return typeof value === "number" && Number.isInteger(value) && value >= 0 && value <= 4294967295;
756
- }
757
- function isSequenceNumber(value) {
758
- return typeof value === "number" && Number.isSafeInteger(value) && value >= 0;
759
- }
760
- function readFileRef(raw, expectedKey, what) {
761
- if (raw.key !== expectedKey) {
762
- invalidManifest(`lists the ${what} under the key "${String(raw.key)}" where it belongs at "${expectedKey}"`, {
763
- key: raw.key,
764
- expected: expectedKey
765
- });
766
- }
767
- const bytes = raw.bytes;
768
- if (typeof bytes !== "number" || !Number.isInteger(bytes) || bytes < HEADER_SIZE || bytes > MAX_FILE_BYTES) {
769
- invalidManifest(`gives the ${what} "${expectedKey}" an invalid length`, { key: expectedKey, bytes });
770
- }
771
- if (!isUint32(raw.checksum)) invalidManifest(`gives the ${what} "${expectedKey}" an invalid checksum`);
772
- if (raw.headOffset === void 0) return { key: expectedKey, bytes, checksum: raw.checksum };
773
- const { headOffset, headLength, headChecksum } = raw;
774
- if (!isSequenceNumber(headOffset) || !isUint32(headLength) || !isUint32(headChecksum)) {
775
- invalidManifest(`gives the ${what} "${expectedKey}" an invalid head`, { key: expectedKey });
776
- }
777
- if (headOffset + headLength > bytes - HEADER_SIZE) {
778
- invalidManifest(`ends the head of the ${what} "${expectedKey}" outside its payload`, {
779
- key: expectedKey,
780
- headOffset,
781
- headLength,
782
- bytes
783
- });
784
- }
785
- return { key: expectedKey, bytes, checksum: raw.checksum, headOffset, headLength, headChecksum };
786
- }
787
-
788
- // src/persistence/durability/segment/manifest-vectors-decode.ts
789
- function normalizeFile(raw, indexName, fieldPath, nextFileId, seenIds) {
790
- if (!isRecord(raw) || !isId(raw.id)) invalidManifest("has an invalid vector file reference", { fieldPath });
791
- if (raw.id >= nextFileId || seenIds.has(raw.id)) {
792
- invalidManifest(`lists vector file ${raw.id} of "${fieldPath}" twice or at its next file id`, { fieldPath });
793
- }
794
- seenIds.add(raw.id);
795
- const count = raw.count;
796
- if (typeof count !== "number" || !Number.isInteger(count) || count < 0 || count > VECTOR_FILE_MAX_VECTORS) {
797
- invalidManifest(`gives vector file ${raw.id} of "${fieldPath}" an invalid count`, { fieldPath, count });
798
- }
799
- const dead = raw.dead ?? null;
800
- if (dead !== null && !(dead instanceof Uint8Array)) invalidManifest("has dead vectors that are not bytes");
801
- if (dead !== null && dead.byteLength !== deadBytesFor(count)) {
802
- invalidManifest(`marks the dead vectors of file ${raw.id} of "${fieldPath}" with the wrong number of bytes`);
803
- }
804
- const ref = readFileRef(raw, vectorFileKey(indexName, fieldPath, raw.id), "vector file");
805
- return { ...ref, id: raw.id, count, dead };
806
- }
807
- function normalizeGraphParts(raw, indexName, fieldPath, generation) {
808
- if (!Array.isArray(raw)) invalidManifest(`gives "${fieldPath}" no list of graph parts`, { fieldPath });
809
- if (raw.length > 0 && generation === 0) invalidManifest(`lists graph parts of "${fieldPath}" at generation 0`);
810
- return raw.map((part, at) => {
811
- if (!isRecord(part)) invalidManifest(`has an invalid graph part of "${fieldPath}"`, { fieldPath });
812
- return readFileRef(part, graphPartKey(indexName, fieldPath, generation, at), "graph part");
813
- });
814
- }
815
- function normalizeField(raw, indexName, seenFields) {
816
- if (!isRecord(raw) || typeof raw.fieldPath !== "string") invalidManifest("has an invalid vector reference");
817
- const fieldPath = raw.fieldPath;
818
- if (seenFields.has(fieldPath)) invalidManifest(`lists the vector field "${fieldPath}" twice`, { fieldPath });
819
- seenFields.add(fieldPath);
820
- if (!isId(raw.nextFileId)) invalidManifest(`gives "${fieldPath}" an invalid next file id`, { fieldPath });
821
- if (!Array.isArray(raw.files)) invalidManifest(`gives "${fieldPath}" no list of vector files`, { fieldPath });
822
- if (!isId(raw.graphGeneration)) invalidManifest(`gives "${fieldPath}" an invalid graph generation`, { fieldPath });
823
- const nextFileId = raw.nextFileId;
824
- const seenIds = /* @__PURE__ */ new Set();
825
- return {
826
- fieldPath,
827
- nextFileId,
828
- files: raw.files.map((file) => normalizeFile(file, indexName, fieldPath, nextFileId, seenIds)),
829
- graphGeneration: raw.graphGeneration,
830
- graphParts: normalizeGraphParts(raw.graphParts, indexName, fieldPath, raw.graphGeneration)
831
- };
832
- }
833
- function normalizeVectorFields(raw, indexName) {
834
- if (!Array.isArray(raw)) invalidManifest("has malformed vector references");
835
- const seenFields = /* @__PURE__ */ new Set();
836
- return raw.map((field) => normalizeField(field, indexName, seenFields));
837
- }
838
-
839
- // src/persistence/durability/segment/manifest-decode.ts
840
- async function openManifestPayload(data) {
841
- const { payload } = await openChecksummedEnvelope(data, {
842
- envelopeFormatVersion: MANIFEST_ENVELOPE_VERSION,
843
- what: "segment manifest",
844
- allowsCompression: true
845
- });
846
- const raw = decode(payload);
847
- if (!isRecord(raw)) invalidManifest("is not a map");
848
- return raw;
849
- }
850
- function listedKeysOf(raw) {
851
- const keys = [];
852
- for (const partition of Array.isArray(raw.partitions) ? raw.partitions : []) {
853
- if (!isRecord(partition) || !Array.isArray(partition.segments)) continue;
854
- for (const segment of partition.segments)
855
- if (isRecord(segment) && typeof segment.key === "string") keys.push(segment.key);
856
- }
857
- for (const field of Array.isArray(raw.vectors) ? raw.vectors : []) {
858
- if (!isRecord(field)) continue;
859
- for (const list of [field.files, field.graphParts]) {
860
- if (!Array.isArray(list)) continue;
861
- for (const file of list) if (isRecord(file) && typeof file.key === "string") keys.push(file.key);
862
- }
863
- }
864
- return keys;
865
- }
866
- async function decodeSegmentManifest(data, indexName) {
867
- return decodeManifestPayload(await openManifestPayload(data), indexName);
868
- }
869
- function decodeManifestPayload(raw, indexName) {
870
- if (raw.version === EARLIER_SEGMENT_MANIFEST_VERSION) return { kind: "earlier", payload: raw };
871
- if (raw.version !== SEGMENT_MANIFEST_VERSION) {
872
- throw new NarsilError(
873
- ErrorCodes.ENVELOPE_VERSION_MISMATCH,
874
- `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`,
875
- { indexName, version: raw.version }
876
- );
877
- }
878
- const schema = raw.schema;
879
- if (!isRecord(schema)) invalidManifest("is missing its schema");
880
- requireValidFieldTypes(schema);
881
- if (typeof raw.language !== "string") invalidManifest("is missing its language");
882
- if (raw.analysisGeneration !== void 0 && !isSequenceNumber(raw.analysisGeneration)) {
883
- invalidManifest("has an invalid analysis generation");
884
- }
885
- return {
886
- kind: "current",
887
- manifest: {
888
- version: SEGMENT_MANIFEST_VERSION,
889
- schema,
890
- language: raw.language,
891
- ...raw.analysisGeneration ? { analysisGeneration: raw.analysisGeneration } : {},
892
- checkpoint: normalizeCheckpoint(raw.checkpoint),
893
- partitions: normalizePartitions(raw.partitions, indexName),
894
- vectors: normalizeVectorFields(raw.vectors, indexName)
895
- }
896
- };
897
- }
898
- function normalizeCheckpoint(raw) {
899
- if (!Array.isArray(raw)) invalidManifest("is missing its checkpoint list");
900
- const seen = /* @__PURE__ */ new Set();
901
- return raw.map((entry) => {
902
- if (!isRecord(entry) || !isUint32(entry.partitionId) || !isSequenceNumber(entry.lastSeqNo) || !isSequenceNumber(entry.primaryTerm) || seen.has(entry.partitionId)) {
903
- invalidManifest("has an invalid partition checkpoint", { entry });
904
- }
905
- seen.add(entry.partitionId);
906
- const checkpoint = {
907
- partitionId: entry.partitionId,
908
- lastSeqNo: entry.lastSeqNo,
909
- primaryTerm: entry.primaryTerm
910
- };
911
- if (entry.termHistory !== void 0) {
912
- checkpoint.termHistory = normalizeTermHistory(entry.termHistory, entry.partitionId, entry.lastSeqNo);
913
- }
914
- return checkpoint;
915
- });
916
- }
917
- function normalizeTermHistory(raw, partitionId, lastSeqNo) {
918
- if (!Array.isArray(raw)) invalidManifest("has a term history that is not a list", { partitionId });
919
- let previous = null;
920
- return raw.map((start) => {
921
- if (!isRecord(start) || !isSequenceNumber(start.primaryTerm) || !isSequenceNumber(start.firstSeqNo)) {
922
- invalidManifest("has an invalid term history entry", { partitionId });
923
- }
924
- const read = { primaryTerm: start.primaryTerm, firstSeqNo: start.firstSeqNo };
925
- if (read.firstSeqNo > lastSeqNo) {
926
- invalidManifest(`has a term starting at seqNo ${read.firstSeqNo}, above lastSeqNo ${lastSeqNo}`, { partitionId });
927
- }
928
- if (previous !== null && (read.primaryTerm <= previous.primaryTerm || read.firstSeqNo <= previous.firstSeqNo)) {
929
- invalidManifest("has a term history that fails to ascend strictly", { partitionId });
930
- }
931
- previous = read;
932
- return read;
933
- });
934
- }
935
- function normalizePartitions(raw, indexName) {
936
- if (!Array.isArray(raw)) invalidManifest("is missing partition entries");
937
- const seen = /* @__PURE__ */ new Set();
938
- return raw.map((entry) => {
939
- if (!isRecord(entry) || !isUint32(entry.partitionId) || seen.has(entry.partitionId)) {
940
- invalidManifest("has a partition without a valid id", { partitionId: isRecord(entry) ? entry.partitionId : null });
941
- }
942
- seen.add(entry.partitionId);
943
- const segments = normalizeSegments(entry.segments, indexName, entry.partitionId);
944
- return {
945
- partitionId: entry.partitionId,
946
- nextSegmentId: readNextSegmentId(entry.nextSegmentId, segments, entry.partitionId),
947
- segments
948
- };
949
- });
950
- }
951
- function normalizeSegments(raw, indexName, partitionId) {
952
- if (!Array.isArray(raw)) invalidManifest("has malformed segment references", { partitionId });
953
- if (raw.length > MAX_SEGMENTS_PER_PARTITION) {
954
- invalidManifest(`lists ${raw.length} segments for partition ${partitionId}, above ${MAX_SEGMENTS_PER_PARTITION}`);
955
- }
956
- const seenIds = /* @__PURE__ */ new Set();
957
- return raw.map((segment) => {
958
- if (!isRecord(segment) || !isId(segment.id) || !isUint32(segment.docCount) || !isUint32(segment.tombstoneCount)) {
959
- invalidManifest("has an invalid segment reference", { partitionId });
960
- }
961
- if (seenIds.has(segment.id)) invalidManifest(`reuses segment id ${segment.id} in partition ${partitionId}`);
962
- seenIds.add(segment.id);
963
- const ref = readFileRef(segment, segmentKey(indexName, partitionId, segment.id), "segment");
964
- return { ...ref, id: segment.id, docCount: segment.docCount, tombstoneCount: segment.tombstoneCount };
965
- });
966
- }
967
- function readNextSegmentId(value, segments, partitionId) {
968
- if (!isId(value)) invalidManifest("has an invalid next segment id", { partitionId });
969
- for (const segment of segments) {
970
- if (segment.id >= value) {
971
- invalidManifest(`next segment id ${value} does not exceed segment id ${segment.id}`, { partitionId });
972
- }
973
- }
974
- return value;
975
- }
976
-
977
825
  // src/serialization/crc32-combine.ts
978
826
  var IEEE_POLYNOMIAL = 3988292384;
979
827
  var CRC_BITS = 32;
@@ -1441,7 +1289,7 @@ function removeFromPartition(manager, partitionId, docIds) {
1441
1289
  }
1442
1290
  }
1443
1291
  async function attachPagedSegment(directory, ref, partitionId, manager, options) {
1444
- const { checkPagedSegmentFully, createPagedFrozenSegment, openPagedSnapshot, pagedListingOf } = await import('./module-6RLIKSZQ.mjs');
1292
+ const { checkPagedSegmentFully, createPagedFrozenSegment, openPagedSnapshot, pagedListingOf } = await import('./module-DWKPBSMN.mjs');
1445
1293
  if (options.decodesEveryDocument) await checkPagedSegmentFully(directory, ref);
1446
1294
  const snapshot = openPagedSnapshot(await pagedListingOf(directory, ref));
1447
1295
  requireAgreedSchema(options.schema, snapshot.schema, ref.key);
@@ -1455,7 +1303,7 @@ async function loadPartitionSegments(store, partition, manager, options) {
1455
1303
  const { directory } = store;
1456
1304
  for (const ref of partition.segments) {
1457
1305
  if (manager.config.textStorage === "disk" && directory !== void 0) {
1458
- const { isPagedSegmentFile } = await import('./module-6RLIKSZQ.mjs');
1306
+ const { isPagedSegmentFile } = await import('./module-DWKPBSMN.mjs');
1459
1307
  if (await isPagedSegmentFile(directory, ref.key)) {
1460
1308
  await attachPagedSegment(directory, ref, partition.partitionId, manager, options);
1461
1309
  await yieldToEventLoop();
@@ -1511,7 +1359,7 @@ async function loadSegmentedCheckpoint(store, indexName, manifest, deps, decodes
1511
1359
  (field) => deps.vectorIndexes.get(field.fieldPath)?.storage === "disk" && field.files.some((file) => file.headOffset !== void 0)
1512
1360
  );
1513
1361
  if (!decodesEveryDocument && directory !== void 0 && opensVectorsOnDemand) {
1514
- const { startReadingOpeningSectionsAhead } = await import('./module-6RLIKSZQ.mjs');
1362
+ const { startReadingOpeningSectionsAhead } = await import('./module-DWKPBSMN.mjs');
1515
1363
  await startReadingOpeningSectionsAhead(directory, manifest);
1516
1364
  }
1517
1365
  for (const partition of manifest.partitions) {
@@ -1546,4 +1394,4 @@ async function reclaimUnlistedKeys(store, indexName, referenced) {
1546
1394
  }
1547
1395
  }
1548
1396
 
1549
- export { SINGLE_NODE_PRIMARY_TERM, createSeqOwner, decodeManifestPayload, decodeSegmentManifest, deserializePayloadV1, dropStoredVectorValues, durableMetadataConfigOf, growPartitionsTo, indexMetadataOf, invalidManifest, isId, isRecord, isSequenceNumber, isUint32, listedKeysOf, loadPartitionSegments, loadSegmentedCheckpoint, metadataConfigOf, metadataFromConfig, openManifestPayload, patternIndexesFromWire, readCurrentManifest, readMetadataEnvelope, readSegmentManifest, reclaimUnlistedKeys, sanitizeSurfaceForms, unpackEnvelopeBytes, unpackIndexSnapshotEnvelope, writeLiveVectors, writeMetadataEnvelope };
1397
+ export { SINGLE_NODE_PRIMARY_TERM, createSeqOwner, deserializePayloadV1, dropStoredVectorValues, durableMetadataConfigOf, growPartitionsTo, indexMetadataOf, loadPartitionSegments, loadSegmentedCheckpoint, metadataConfigOf, metadataFromConfig, patternIndexesFromWire, readCurrentManifest, readMetadataEnvelope, readSegmentManifest, reclaimUnlistedKeys, sanitizeSurfaceForms, unpackEnvelopeBytes, unpackIndexSnapshotEnvelope, writeLiveVectors, writeMetadataEnvelope };
@@ -1,5 +1,5 @@
1
1
  import { LOOKUP_KEY_SCRATCH_BYTES } from './chunk-4UMZ7KQL.mjs';
2
- import { createNarsilError, ErrorCodes } from './chunk-MDF6PDIA.mjs';
2
+ import { createNarsilError, ErrorCodes } from './chunk-MP7ABPTD.mjs';
3
3
  import { compareCodePoints } from './chunk-YTJCGKM4.mjs';
4
4
 
5
5
  // src/core/tokenizer/constants.ts