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

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 (329) hide show
  1. package/NOTICE +45 -0
  2. package/README.md +1 -0
  3. package/dist/adapters/filesystem.mjs +2 -2
  4. package/dist/adapters/gcs.mjs +2 -2
  5. package/dist/adapters/indexeddb.mjs +1 -1
  6. package/dist/adapters/s3.mjs +2 -2
  7. package/dist/{analysis-change-4GCRVRBW.mjs → analysis-change-5BQOQ4BF.mjs} +35 -28
  8. package/dist/{react-native/chunks/analysis-change-entry-TNLUC6IZ.mjs → analysis-change-entry-TXX6JSMX.mjs} +1 -1
  9. package/dist/archive-history-E4R73RWD.mjs +29 -0
  10. package/dist/browser/{analysis-change-IXWPXXJJ.mjs → analysis-change-435CUEPZ.mjs} +32 -12
  11. package/dist/{analysis-change-entry-KYGSXW4K.mjs → browser/analysis-change-entry-HZXKPPGV.mjs} +1 -1
  12. package/dist/browser/archive-history-4IP5XQZY.mjs +29 -0
  13. package/dist/browser/{chunk-4PD752F6.mjs → chunk-23XRXIBW.mjs} +1 -1
  14. package/dist/browser/{chunk-J433A7P3.mjs → chunk-2CFI5VVV.mjs} +5 -5
  15. package/dist/{react-native/chunks/chunk-3XKMRNRE.mjs → browser/chunk-2TI4SSUP.mjs} +27 -10
  16. package/dist/browser/chunk-3SSRJMFN.mjs +100 -0
  17. package/dist/browser/{chunk-2SHAKW2Z.mjs → chunk-3V7DNNZL.mjs} +515 -733
  18. package/dist/browser/{chunk-C4KS2QNF.mjs → chunk-4NGKC4H4.mjs} +9 -9
  19. package/dist/browser/{chunk-XRV72TJD.mjs → chunk-6LWDPLTB.mjs} +2 -2
  20. package/dist/browser/chunk-7IGKGWSQ.mjs +79 -0
  21. package/dist/browser/{chunk-VCOYGVP7.mjs → chunk-7U3WVJUP.mjs} +3 -3
  22. package/dist/browser/chunk-ATEBYXP6.mjs +10 -0
  23. package/dist/browser/chunk-BHFQATSC.mjs +432 -0
  24. package/dist/browser/chunk-CRE3G7F3.mjs +1007 -0
  25. package/dist/browser/{chunk-QXTPSX2H.mjs → chunk-EA63E3D2.mjs} +7 -7
  26. package/dist/{react-native/chunks/chunk-DCKMICOB.mjs → browser/chunk-EXQZGUQH.mjs} +1 -1
  27. package/dist/browser/{chunk-ML6HY7T7.mjs → chunk-G64Q6OJF.mjs} +1 -1
  28. package/dist/browser/chunk-GPPOG6PT.mjs +9 -0
  29. package/dist/browser/{chunk-EUNBNLKM.mjs → chunk-IZXVW2ZJ.mjs} +5 -5
  30. package/dist/browser/{chunk-G7LUMBSG.mjs → chunk-K4Q6KX3R.mjs} +30 -20
  31. package/dist/browser/{chunk-H6QFBMVE.mjs → chunk-KZWSX6BH.mjs} +3 -3
  32. package/dist/browser/chunk-M3MQE2X7.mjs +151 -0
  33. package/dist/browser/chunk-MGI4BCXC.mjs +63 -0
  34. package/dist/browser/chunk-MOG4OVDK.mjs +51 -0
  35. package/dist/browser/{chunk-W5X2UFWQ.mjs → chunk-NLWTBAGB.mjs} +12 -3
  36. package/dist/browser/{chunk-AYY6PIKL.mjs → chunk-NQAME3RK.mjs} +2 -2
  37. package/dist/browser/{chunk-7MEYN7V6.mjs → chunk-NXQG7DRA.mjs} +29 -14
  38. package/dist/browser/chunk-OEDCEZXJ.mjs +92 -0
  39. package/dist/{chunk-KUZKUONM.mjs → browser/chunk-SRMZXJSL.mjs} +1 -0
  40. package/dist/browser/chunk-SSTPBZZX.mjs +1106 -0
  41. package/dist/browser/{chunk-7TTWXUH6.mjs → chunk-STOWQFT3.mjs} +3 -2
  42. package/dist/browser/{chunk-26A5JFT2.mjs → chunk-TK63WFXK.mjs} +2 -1
  43. package/dist/browser/{chunk-SJB6VIZG.mjs → chunk-U3JOQGWX.mjs} +1 -1
  44. package/dist/browser/{chunk-AJ4HHOVT.mjs → chunk-U4YDIBUT.mjs} +4 -4
  45. package/dist/browser/{chunk-2FX6ROWR.mjs → chunk-VLJQW4J6.mjs} +2986 -2986
  46. package/dist/{react-native/chunks/chunk-3O57C2ZO.mjs → browser/chunk-WI4MR75E.mjs} +2 -2
  47. package/dist/browser/{chunk-3U3QR5YP.mjs → chunk-WN464PTL.mjs} +2 -2
  48. package/dist/browser/{chunk-U2E3HMYW.mjs → chunk-XAWNZ4G2.mjs} +11 -11
  49. package/dist/browser/{cold-module-VTUGDYNY.mjs → cold-module-2EHCIV4K.mjs} +20 -18
  50. package/dist/browser/durability-config-TIYKW6XX.mjs +89 -0
  51. package/dist/browser/{durability-wiring-GL4A7KDV.mjs → durability-wiring-A7BVG2DW.mjs} +50 -153
  52. package/dist/browser/engine-hooks-E4UD67JD.mjs +17 -0
  53. package/dist/browser/geo-index-HHWGMNIS.mjs +1386 -0
  54. package/dist/browser/import-DXYB6756.mjs +19 -0
  55. package/dist/browser/{methods-LMUTS7OI.mjs → methods-KTQCSIN4.mjs} +3 -3
  56. package/dist/browser/{module-M4JNBV6V.mjs → module-NIYMEA5R.mjs} +16 -14
  57. package/dist/browser/{module-EC3FYW7N.mjs → module-TCT66FWA.mjs} +10 -9
  58. package/dist/browser/operations-OJ3BXS55.mjs +5 -0
  59. package/dist/browser/{phrase-module-NPYUVX75.mjs → phrase-module-HAT3TLZN.mjs} +2 -2
  60. package/dist/browser/{pool-WCGDZHJP.mjs → pool-3JLET5RO.mjs} +1 -1
  61. package/dist/browser/restore-hooks-YPN4ZFCY.mjs +114 -0
  62. package/dist/browser/restore-queue-G3RQGL3Y.mjs +55 -0
  63. package/dist/browser/{retention-6QMRS5VK.mjs → retention-ZWVMNC3Q.mjs} +18 -15
  64. package/dist/browser/{runtime-3EW2AGB6.mjs → runtime-OTAGEFQW.mjs} +1 -1
  65. package/dist/browser/{snapshot-DN3CRVUQ.mjs → snapshot-VEQNIE6C.mjs} +71 -36
  66. package/dist/browser/start-BM442C6R.mjs +25 -0
  67. package/dist/browser/{write-WAWAFGKQ.mjs → write-2EVMZWDE.mjs} +16 -14
  68. package/dist/{capabilities-B3Brs1Rc.d.ts → capabilities-Da4ywVVl.d.ts} +35 -3
  69. package/dist/{chunk-K4B7OH65.mjs → chunk-25KDNIZZ.mjs} +2 -2
  70. package/dist/{chunk-O43Z4MS6.mjs → chunk-2NE7VCYE.mjs} +2 -2
  71. package/dist/chunk-2UV4QBHW.mjs +1092 -0
  72. package/dist/{chunk-3Y3J4V2R.mjs → chunk-3C7MTCCI.mjs} +1 -1
  73. package/dist/{chunk-TRISKD4Q.mjs → chunk-3HYC4JRF.mjs} +2 -2
  74. package/dist/{chunk-HVYICDY3.mjs → chunk-3OH67G7R.mjs} +1 -1
  75. package/dist/{chunk-PFKM7VNZ.mjs → chunk-46KY2PJD.mjs} +30 -11
  76. package/dist/{chunk-IJU7LL7D.mjs → chunk-4KKXNJM6.mjs} +5 -5
  77. package/dist/{chunk-IQ4R2I6N.mjs → chunk-5FLRXF73.mjs} +5 -1
  78. package/dist/{chunk-BPSKLCS7.mjs → chunk-5VV4R6P7.mjs} +3017 -3017
  79. package/dist/chunk-5YNRKI2C.mjs +81 -0
  80. package/dist/chunk-6HTGOXIK.mjs +875 -0
  81. package/dist/{chunk-7HCZWC7B.mjs → chunk-6I6AYAXS.mjs} +50 -8
  82. package/dist/{chunk-C6ASEFZI.mjs → chunk-6OEGXLBX.mjs} +1 -1
  83. package/dist/{chunk-DVWYODEB.mjs → chunk-6RC4K46J.mjs} +2 -2
  84. package/dist/chunk-7GFE3PEY.mjs +40 -0
  85. package/dist/{chunk-QKZHLADX.mjs → chunk-7LXHHCXZ.mjs} +28 -19
  86. package/dist/{chunk-JUKYYXSP.mjs → chunk-7V5IUP2T.mjs} +1 -31
  87. package/dist/{react-native/chunks/chunk-7GWPJDOA.mjs → chunk-A4L7YTKX.mjs} +53 -90
  88. package/dist/{chunk-Z3TNWCI5.mjs → chunk-BU4SAIC4.mjs} +3 -3
  89. package/dist/chunk-BWZ3P4MU.mjs +20 -0
  90. package/dist/{chunk-OKX2BBNW.mjs → chunk-CITFCZKF.mjs} +5 -4
  91. package/dist/{chunk-4HWZV5MK.mjs → chunk-CSLGFPFQ.mjs} +5 -5
  92. package/dist/chunk-DP5C7YFQ.mjs +543 -0
  93. package/dist/{chunk-RVKFI3A2.mjs → chunk-DWEPMFJE.mjs} +11 -8
  94. package/dist/{chunk-LSM2YTKM.mjs → chunk-EFBDHH5P.mjs} +87 -144
  95. package/dist/{chunk-NZMAXR2S.mjs → chunk-FAKFUDZZ.mjs} +121 -11
  96. package/dist/chunk-FB6463IN.mjs +1499 -0
  97. package/dist/{chunk-REL7LFLR.mjs → chunk-FCJ553HS.mjs} +3 -3
  98. package/dist/{chunk-MMEMEUOO.mjs → chunk-FJKKCV4D.mjs} +2 -2
  99. package/dist/{chunk-K7KLL263.mjs → chunk-FNGAM5B7.mjs} +14 -13
  100. package/dist/{chunk-DMQPFLGI.mjs → chunk-FRBFVQFN.mjs} +6 -5
  101. package/dist/{chunk-IBNLW3AV.mjs → chunk-FYOVBEMM.mjs} +20 -6
  102. package/dist/chunk-G6HRSGOU.mjs +74 -0
  103. package/dist/{chunk-USR7FQRZ.mjs → chunk-GH4WQ22V.mjs} +2 -2
  104. package/dist/chunk-GQPTDQCL.mjs +54 -0
  105. package/dist/{chunk-VREK3MYG.mjs → chunk-HFPMMRQT.mjs} +3 -3
  106. package/dist/{chunk-MLHNSAPK.mjs → chunk-HHBUCIUY.mjs} +3 -3
  107. package/dist/{chunk-YROWNOMH.mjs → chunk-HJJI72X7.mjs} +1 -1
  108. package/dist/{chunk-ECX4SGX6.mjs → chunk-I2KPOLOZ.mjs} +9 -9
  109. package/dist/{chunk-TV2L3BN7.mjs → chunk-I53G4JAU.mjs} +266 -265
  110. package/dist/{chunk-3A5KI24C.mjs → chunk-I54T6CQP.mjs} +1 -1
  111. package/dist/{chunk-NTZOXVUZ.mjs → chunk-I5B7RXU7.mjs} +93 -24
  112. package/dist/{chunk-YBJDOA2T.mjs → chunk-INJYO3BU.mjs} +1 -1
  113. package/dist/{react-native/chunks/chunk-KWRW5U65.mjs → chunk-J4IJTTEX.mjs} +1 -1
  114. package/dist/{chunk-X6NSJYQ3.mjs → chunk-JDJBQLRO.mjs} +13 -13
  115. package/dist/{chunk-MMBEANB2.mjs → chunk-JWRUUCWD.mjs} +3 -3
  116. package/dist/{chunk-AO2FAYIZ.mjs → chunk-K4ZIGL2O.mjs} +1 -1
  117. package/dist/{chunk-JFNKIBDT.mjs → chunk-K5QFDYST.mjs} +2 -2
  118. package/dist/{chunk-C73JLU4E.mjs → chunk-KF4EXSM4.mjs} +2 -2
  119. package/dist/{chunk-WCBA2LVZ.mjs → chunk-KHKIRS5D.mjs} +1 -1
  120. package/dist/{chunk-7QUGDVFC.mjs → chunk-KJ3RTZDJ.mjs} +1 -1
  121. package/dist/{chunk-HVKXNBFL.mjs → chunk-KKQC526K.mjs} +20 -12
  122. package/dist/chunk-KP7TYHWT.mjs +92 -0
  123. package/dist/{chunk-VMXSVVXG.mjs → chunk-L6V6BST3.mjs} +9 -22
  124. package/dist/{chunk-URPCYQVJ.mjs → chunk-LHKOSI2J.mjs} +1 -1
  125. package/dist/chunk-LNGE7SLY.mjs +151 -0
  126. package/dist/{react-native/chunks/chunk-CUNGPR5R.mjs → chunk-MP7ABPTD.mjs} +1 -0
  127. package/dist/{chunk-5KGYQT6W.mjs → chunk-MQOJIO5B.mjs} +26 -9
  128. package/dist/{chunk-Q3TCTQCC.mjs → chunk-NF4DT3IH.mjs} +1 -1
  129. package/dist/{chunk-3OFU3NJT.mjs → chunk-OIJ64LGT.mjs} +1 -1
  130. package/dist/chunk-ORN5BLL7.mjs +11 -0
  131. package/dist/{chunk-HWEDFLB7.mjs → chunk-P5ZI2P2W.mjs} +126 -1701
  132. package/dist/{chunk-466PYR4P.mjs → chunk-PWC4VB3Q.mjs} +2 -2
  133. package/dist/{chunk-B7S6YEBP.mjs → chunk-QJVOLKU6.mjs} +12 -3
  134. package/dist/{chunk-KCUIFVVW.mjs → chunk-QOW2JPUI.mjs} +9 -9
  135. package/dist/chunk-RDXO6JST.mjs +63 -0
  136. package/dist/chunk-RLOES5SX.mjs +31 -0
  137. package/dist/{chunk-YPUEV6ZC.mjs → chunk-RVGRFOGN.mjs} +1 -1
  138. package/dist/{chunk-JCLTESFN.mjs → chunk-RZWWB2XR.mjs} +1 -1
  139. package/dist/chunk-S5LN746F.mjs +10 -0
  140. package/dist/chunk-SA5LOGO3.mjs +470 -0
  141. package/dist/chunk-SQJWAIF4.mjs +12 -0
  142. package/dist/{chunk-YTJCGKM4.mjs → chunk-TBC3XUL2.mjs} +29 -6
  143. package/dist/chunk-TDIK6NTV.mjs +10 -0
  144. package/dist/chunk-TGS5UXBE.mjs +216 -0
  145. package/dist/{chunk-CP5RRPJR.mjs → chunk-TQXHPFWT.mjs} +1 -1
  146. package/dist/{chunk-7NTMUDC5.mjs → chunk-TZ3355VS.mjs} +5 -5
  147. package/dist/{chunk-Q7MS6P2J.mjs → chunk-TZTRKM33.mjs} +2 -2
  148. package/dist/{chunk-4UMZ7KQL.mjs → chunk-U55XJEIG.mjs} +2 -1
  149. package/dist/{chunk-S2N75OTN.mjs → chunk-UHICS3JI.mjs} +1 -1
  150. package/dist/{chunk-5FUOVJKG.mjs → chunk-VTTRFF2C.mjs} +32 -19
  151. package/dist/{chunk-62G63NMH.mjs → chunk-WX4LAO6M.mjs} +4 -4
  152. package/dist/{chunk-LTUGDMV4.mjs → chunk-WZ7YV54N.mjs} +1 -1
  153. package/dist/chunk-XAXKV65G.mjs +72 -0
  154. package/dist/chunk-XXHN7J46.mjs +101 -0
  155. package/dist/{chunk-PGVPE7GJ.mjs → chunk-YEKL4JBK.mjs} +1 -1
  156. package/dist/chunk-YTWZVGCB.mjs +382 -0
  157. package/dist/chunk-Z2KAFCRT.mjs +30 -0
  158. package/dist/{chunk-LKUE5GXS.mjs → chunk-ZKP7G7TV.mjs} +2 -2
  159. package/dist/{client-Df76GNKm.d.ts → client-DRv7UVeY.d.ts} +123 -11
  160. package/dist/client.d.ts +9 -8
  161. package/dist/client.mjs +65 -3
  162. package/dist/{cold-module-YLWMTTZG.mjs → cold-module-6MO2XJF2.mjs} +45 -39
  163. package/dist/{config-B8DP2VwR.d.ts → config-CoSig5Ox.d.ts} +22 -3
  164. package/dist/{config-05G_hy-1.d.ts → config-DMwffLKn.d.ts} +20 -5
  165. package/dist/direct-executor-FTMYY3TI.mjs +34 -0
  166. package/dist/distribution/coordinator/etcd.d.ts +2 -2
  167. package/dist/distribution/coordinator/etcd.mjs +3 -3
  168. package/dist/distribution/coordinator/in-memory.d.ts +2 -2
  169. package/dist/distribution/coordinator/in-memory.mjs +2 -2
  170. package/dist/distribution/transport/grpc.mjs +4 -4
  171. package/dist/distribution/transport/in-memory.mjs +2 -2
  172. package/dist/distribution/transport/tcp.mjs +3 -3
  173. package/dist/distribution.d.ts +8 -8
  174. package/dist/distribution.mjs +6799 -5939
  175. package/dist/durability-config-GE4U7MCZ.mjs +89 -0
  176. package/dist/{durability-wiring-RHLXDIVF.mjs → durability-wiring-VIF5MOSY.mjs} +82 -179
  177. package/dist/embeddings/openai.mjs +2 -2
  178. package/dist/{sync-uXR7MmM7.d.ts → engine-CFxPYqEk.d.ts} +702 -2
  179. package/dist/engine-hooks-EGUGNZYE.mjs +54 -0
  180. package/dist/geo-index-MRH5JMIR.mjs +1387 -0
  181. package/dist/import-XKDPJQDP.mjs +56 -0
  182. package/dist/{index-nRqDM6uS.d.ts → index-C4AmUnl1.d.ts} +1 -1
  183. package/dist/index.browser.mjs +9 -7
  184. package/dist/index.d.ts +134 -9
  185. package/dist/index.mjs +33 -26
  186. package/dist/index.react-native.mjs +20 -17
  187. package/dist/invalidation/filesystem.mjs +2 -2
  188. package/dist/{long-query-thread-EMYTGSJP.mjs → long-query-thread-YA4IAYSY.mjs} +34 -28
  189. package/dist/{methods-ABM5ELBR.mjs → methods-7IOINERF.mjs} +3 -3
  190. package/dist/{module-MG7JMV2U.mjs → module-FQ4JWNQJ.mjs} +41 -34
  191. package/dist/{module-3OMJZUFT.mjs → module-N55W4Q5C.mjs} +14 -14
  192. package/dist/operations-G5EP6JPX.mjs +5 -0
  193. package/dist/{paged-partition-archive-UOLHOEZJ.mjs → paged-partition-archive-PXW5XAYU.mjs} +48 -38
  194. package/dist/partial-words.mjs +11 -9
  195. package/dist/pattern.mjs +6 -5
  196. package/dist/persistence/durability/checkpoint-worker.d.ts +8 -1
  197. package/dist/persistence/durability/checkpoint-worker.mjs +44 -35
  198. package/dist/{phrase-module-O3MDRQXP.mjs → phrase-module-XW5MKWP5.mjs} +4 -3
  199. package/dist/{pool-CQXYPFLG.mjs → pool-Y4A46T36.mjs} +1 -1
  200. package/dist/query-suggestions/merge-worker.d.ts +55 -0
  201. package/dist/query-suggestions/merge-worker.mjs +88 -0
  202. package/dist/query-suggestions-CBYkrQ5T.d.ts +311 -0
  203. package/dist/query-suggestions.browser.mjs +247 -0
  204. package/dist/query-suggestions.d.ts +20 -0
  205. package/dist/query-suggestions.mjs +69 -0
  206. package/dist/react-native/chunks/{analysis-change-EAYO3Y6Q.mjs → analysis-change-LT5QBQ3H.mjs} +43 -22
  207. package/dist/{browser/analysis-change-entry-FCSHFQSS.mjs → react-native/chunks/analysis-change-entry-SCVWK6OU.mjs} +1 -1
  208. package/dist/react-native/chunks/archive-history-MJKUQLSU.mjs +29 -0
  209. package/dist/{chunk-ZIFJXCKA.mjs → react-native/chunks/chunk-2PRHILX3.mjs} +54 -20
  210. package/dist/react-native/chunks/{chunk-VQSKZ3EZ.mjs → chunk-3JWDECAZ.mjs} +8 -8
  211. package/dist/{chunk-R6A773WK.mjs → react-native/chunks/chunk-3WI35N75.mjs} +1 -1
  212. package/dist/react-native/chunks/{chunk-75VWIY35.mjs → chunk-4DII3ZSM.mjs} +1 -1
  213. package/dist/react-native/chunks/{chunk-NKIZX26F.mjs → chunk-4J74WHQM.mjs} +2 -2
  214. package/dist/react-native/chunks/{chunk-UWDNZDWK.mjs → chunk-4JYO3JD2.mjs} +6 -6
  215. package/dist/react-native/chunks/chunk-5CQX3XXV.mjs +17 -0
  216. package/dist/react-native/chunks/chunk-6VBXNFLE.mjs +9 -0
  217. package/dist/react-native/chunks/{chunk-SJWDBRNP.mjs → chunk-6WA3C3DV.mjs} +1 -1
  218. package/dist/react-native/chunks/{chunk-OQQVRWZ2.mjs → chunk-C5G6TJ7A.mjs} +1 -1
  219. package/dist/react-native/chunks/{chunk-RVAEBN74.mjs → chunk-CKNRFDTZ.mjs} +1 -1
  220. package/dist/react-native/chunks/chunk-DIYDOIM4.mjs +10 -0
  221. package/dist/react-native/chunks/{chunk-O32RB3BL.mjs → chunk-DNXOMPAQ.mjs} +4 -4
  222. package/dist/react-native/chunks/{chunk-YBEW6YTR.mjs → chunk-DVDX4SDR.mjs} +2 -2
  223. package/dist/react-native/chunks/chunk-DXRSEWA2.mjs +12 -0
  224. package/dist/{browser/chunk-MYITLCHT.mjs → react-native/chunks/chunk-DZ7H7D2C.mjs} +1 -0
  225. package/dist/react-native/chunks/{chunk-PPEPTUVV.mjs → chunk-EJ33LCHV.mjs} +29 -6
  226. package/dist/react-native/chunks/{chunk-RYMDHGL4.mjs → chunk-ENLMYKSX.mjs} +3045 -3075
  227. package/dist/react-native/chunks/chunk-FHPW7P2O.mjs +40 -0
  228. package/dist/react-native/chunks/{chunk-JV6VQY2S.mjs → chunk-FTZHMRD2.mjs} +2 -1
  229. package/dist/react-native/chunks/{chunk-YHKZSLOC.mjs → chunk-G43IPIDG.mjs} +5 -5
  230. package/dist/react-native/chunks/{chunk-AUT7PMA4.mjs → chunk-GXX3DQXP.mjs} +8 -22
  231. package/dist/react-native/chunks/chunk-H3MDVPBO.mjs +151 -0
  232. package/dist/react-native/chunks/{chunk-DH3TVWWK.mjs → chunk-IYNT75CE.mjs} +12 -3
  233. package/dist/react-native/chunks/chunk-KV46CT4D.mjs +1007 -0
  234. package/dist/{browser/chunk-ZPTA75ZC.mjs → react-native/chunks/chunk-LZSLNSUN.mjs} +1 -1
  235. package/dist/react-native/chunks/{chunk-63YSZOXB.mjs → chunk-MIP4SOR6.mjs} +1480 -826
  236. package/dist/react-native/chunks/{chunk-ZBSWRSBG.mjs → chunk-MJDQU5MW.mjs} +1 -1
  237. package/dist/react-native/chunks/{chunk-GFYFQLJD.mjs → chunk-MUWD2H2S.mjs} +2 -2
  238. package/dist/react-native/chunks/{chunk-IOY2SM2P.mjs → chunk-MVXELMJX.mjs} +1 -1
  239. package/dist/{browser/chunk-TTD27VXX.mjs → react-native/chunks/chunk-NB3LP33V.mjs} +27 -10
  240. package/dist/react-native/chunks/{chunk-I5PGWQJF.mjs → chunk-PDRWWPKV.mjs} +33 -24
  241. package/dist/react-native/chunks/chunk-PJHAB5ZY.mjs +79 -0
  242. package/dist/react-native/chunks/{chunk-2CGSQM4O.mjs → chunk-POPDAGH6.mjs} +13 -13
  243. package/dist/react-native/chunks/{chunk-NP7DD4G5.mjs → chunk-QUKQNI3H.mjs} +5 -5
  244. package/dist/react-native/chunks/{chunk-EH5CFV6Z.mjs → chunk-RDWG33MM.mjs} +2 -2
  245. package/dist/react-native/chunks/{chunk-JX2RIAXH.mjs → chunk-SK2PWYDH.mjs} +5 -5
  246. package/dist/react-native/chunks/{chunk-ZYDKJXQJ.mjs → chunk-SUPXRTMD.mjs} +1 -1
  247. package/dist/react-native/chunks/chunk-TP6KCKER.mjs +63 -0
  248. package/dist/react-native/chunks/{chunk-JPAJWO6D.mjs → chunk-U4KSKA4Z.mjs} +1 -1
  249. package/dist/react-native/chunks/chunk-UQ4OAXKU.mjs +1106 -0
  250. package/dist/react-native/chunks/{chunk-VVFYOADG.mjs → chunk-VWUDIOT6.mjs} +6 -6
  251. package/dist/{browser/chunk-SIR3LMTV.mjs → react-native/chunks/chunk-WBYQRHDY.mjs} +2 -2
  252. package/dist/react-native/chunks/{chunk-C2H2QQFW.mjs → chunk-YH7QY657.mjs} +3 -3
  253. package/dist/react-native/chunks/{chunk-NCJS3WIY.mjs → chunk-YZW4CHM6.mjs} +51 -12
  254. package/dist/react-native/chunks/chunk-ZLWVW734.mjs +100 -0
  255. package/dist/react-native/chunks/chunk-ZXZFN7FI.mjs +432 -0
  256. package/dist/react-native/chunks/chunk-ZZT7CEN7.mjs +92 -0
  257. package/dist/react-native/chunks/{cold-module-TJL6AFAD.mjs → cold-module-KVZYUGRY.mjs} +31 -28
  258. package/dist/react-native/chunks/durability-config-QXVZEO7T.mjs +89 -0
  259. package/dist/react-native/chunks/{durability-wiring-RRDYJLLM.mjs → durability-wiring-34OYO32E.mjs} +60 -162
  260. package/dist/react-native/chunks/engine-hooks-M7JV46NH.mjs +30 -0
  261. package/dist/react-native/chunks/geo-index-PX3BIHAH.mjs +1387 -0
  262. package/dist/react-native/chunks/gzip.react-native-HLEPDKZ3.mjs +3 -0
  263. package/dist/react-native/chunks/import-H6AQREWI.mjs +32 -0
  264. package/dist/react-native/chunks/{methods-X6F36SJE.mjs → methods-6W5U4C3H.mjs} +3 -3
  265. package/dist/react-native/chunks/module-LBZPGOWH.mjs +36 -0
  266. package/dist/react-native/chunks/{module-S4DKSWMF.mjs → module-TTEVPRCW.mjs} +14 -13
  267. package/dist/react-native/chunks/operations-GNRMD6EX.mjs +5 -0
  268. package/dist/react-native/chunks/{phrase-module-JZ37TB7N.mjs → phrase-module-QK22HSQ2.mjs} +2 -2
  269. package/dist/react-native/chunks/{pool-RTGXJXPU.mjs → pool-JR3NJCAF.mjs} +1 -1
  270. package/dist/react-native/chunks/restore-hooks-IBGIY3DR.mjs +127 -0
  271. package/dist/react-native/chunks/restore-queue-ZZX54AH7.mjs +55 -0
  272. package/dist/react-native/chunks/{retention-PPCTP2VY.mjs → retention-EW4TTDFB.mjs} +29 -25
  273. package/dist/react-native/chunks/{runtime-KUATOLYB.mjs → runtime-R5E3TB3J.mjs} +1 -1
  274. package/dist/react-native/chunks/{snapshot-ZBIEOZTZ.mjs → snapshot-REYVIN3X.mjs} +80 -44
  275. package/dist/react-native/chunks/start-BQK6KN3R.mjs +38 -0
  276. package/dist/react-native/chunks/{write-2W4FTX7J.mjs → write-FQAYCZF5.mjs} +27 -24
  277. package/dist/react-native/partial-words.mjs +11 -9
  278. package/dist/react-native/pattern.mjs +4 -4
  279. package/dist/react-native/query-suggestions.mjs +260 -0
  280. package/dist/react-native/sync.mjs +78 -15
  281. package/dist/react-native/synonyms.mjs +95 -27
  282. package/dist/react.d.ts +11 -11
  283. package/dist/react.mjs +1 -0
  284. package/dist/{rerank-IZOB6NII.mjs → rerank-MQ37IYRV.mjs} +4 -4
  285. package/dist/rerankers/http.mjs +2 -2
  286. package/dist/restore-hooks-CDERDEF4.mjs +153 -0
  287. package/dist/restore-queue-7NNSTROA.mjs +55 -0
  288. package/dist/retention-QSVBBNRM.mjs +66 -0
  289. package/dist/{runtime-UZOC3NPY.mjs → runtime-COIUORCN.mjs} +5 -5
  290. package/dist/{schema-DDauvDOv.d.ts → schema-Jwt928nJ.d.ts} +1 -1
  291. package/dist/server.d.ts +108 -12
  292. package/dist/server.mjs +303 -50
  293. package/dist/{snapshot-NFX2EYN2.mjs → snapshot-RH4NSKIZ.mjs} +98 -61
  294. package/dist/start-MCKCOGIW.mjs +66 -0
  295. package/dist/sync/filesystem.d.ts +4 -4
  296. package/dist/sync/filesystem.mjs +6 -6
  297. package/dist/sync/indexeddb.d.ts +4 -4
  298. package/dist/sync/indexeddb.mjs +2 -2
  299. package/dist/sync.browser.mjs +74 -11
  300. package/dist/sync.d.ts +5 -5
  301. package/dist/sync.mjs +78 -16
  302. package/dist/synonyms.mjs +9 -8
  303. package/dist/{tasks-BShx8pdK.d.ts → tasks-qrJojgST.d.ts} +13 -5
  304. package/dist/thread-O4SBJJJS.mjs +50 -0
  305. package/dist/{types-SnO7_tAI.d.ts → types-BZCGjfLn.d.ts} +2 -3
  306. package/dist/vector/search-worker.d.ts +1 -1
  307. package/dist/vector/search-worker.mjs +8 -8
  308. package/dist/workers/entry.mjs +19 -8
  309. package/dist/{write-FGB62BHQ.mjs → write-3FK7NG3Y.mjs} +40 -33
  310. package/openapi.json +798 -7
  311. package/package.json +32 -8
  312. package/dist/browser/import-YI5GNB4H.mjs +0 -17
  313. package/dist/browser/operations-WVYLF72Q.mjs +0 -5
  314. package/dist/browser/restore-queue-TYIGDL5L.mjs +0 -41
  315. package/dist/chunk-37IVJLP6.mjs +0 -44
  316. package/dist/chunk-DJHHF2L5.mjs +0 -17
  317. package/dist/direct-executor-FI5GJHWX.mjs +0 -29
  318. package/dist/engine-DYu-e0oR.d.ts +0 -674
  319. package/dist/import-SRBNC6TE.mjs +0 -49
  320. package/dist/operations-PGOAY2KS.mjs +0 -5
  321. package/dist/react-native/chunks/chunk-TJMSKBEM.mjs +0 -25
  322. package/dist/react-native/chunks/gzip.react-native-DNB5YNFA.mjs +0 -3
  323. package/dist/react-native/chunks/import-JYBMEJPQ.mjs +0 -29
  324. package/dist/react-native/chunks/module-QT5HZAY4.mjs +0 -33
  325. package/dist/react-native/chunks/operations-RYKTSZQA.mjs +0 -5
  326. package/dist/react-native/chunks/restore-queue-ZBVIKJWI.mjs +0 -41
  327. package/dist/restore-queue-COI2GSSK.mjs +0 -41
  328. package/dist/retention-55WA7GPU.mjs +0 -58
  329. package/dist/thread-P2G2FWM2.mjs +0 -44
@@ -1,4 +1,7 @@
1
- import { A as AnyDocument, S as SchemaDefinition, B as BM25Params, b as ScoringMode } from './schema-DDauvDOv.js';
1
+ import { E as EmbeddingAdapter, R as RerankAdapter } from './adapters-pljAqmrC.js';
2
+ import { A as AnyDocument, S as SchemaDefinition, B as BM25Params, e as ScoringMode, a as InsertOptions, W as WriteOptions, I as IndexConfig, P as PartitionConfig } from './schema-Jwt928nJ.js';
3
+ import { h as QuerySuggestionsBuildEvent, j as QuerySuggestionsWarningEvent } from './query-suggestions-CBYkrQ5T.js';
4
+ import { a as SynonymRule } from './synonyms-CpOAHPa-.js';
2
5
 
3
6
  /**
4
7
  * Every code a {@link NarsilError} carries, grouped by the part of the engine
@@ -49,6 +52,7 @@ declare const ErrorCodes: {
49
52
  readonly SYNC_NOT_READY: "SYNC_NOT_READY";
50
53
  readonly SYNC_NOT_ENABLED: "SYNC_NOT_ENABLED";
51
54
  readonly SYNC_SNAPSHOT_PREPARING: "SYNC_SNAPSHOT_PREPARING";
55
+ readonly QUERY_SUGGESTIONS_NOT_ENABLED: "QUERY_SUGGESTIONS_NOT_ENABLED";
52
56
  readonly SEARCH_INVALID_FIELD: "SEARCH_INVALID_FIELD";
53
57
  readonly VECTOR_DIMENSION_MISMATCH: "VECTOR_DIMENSION_MISMATCH";
54
58
  readonly SEARCH_INVALID_FILTER: "SEARCH_INVALID_FILTER";
@@ -1784,6 +1788,17 @@ type NarsilEventMap = {
1784
1788
  /** This is the error that the adapter threw. */
1785
1789
  error: Error;
1786
1790
  };
1791
+ /**
1792
+ * A popular query suggestions build started, completed, failed, or skipped.
1793
+ * The payload carries counts alone, never a phrase.
1794
+ */
1795
+ querySuggestionsBuild: QuerySuggestionsBuildEvent;
1796
+ /**
1797
+ * The engine skipped a history file, failed to save the counts of a day,
1798
+ * reached a daily limit, or holds an index with the feature on while it has
1799
+ * no key. The payload carries no search text.
1800
+ */
1801
+ querySuggestionsWarning: QuerySuggestionsWarningEvent;
1787
1802
  };
1788
1803
  /**
1789
1804
  * This map holds a listener for any event of {@link NarsilEventMap}, so that
@@ -1795,6 +1810,154 @@ type NarsilEventHandlers = {
1795
1810
  [K in keyof NarsilEventMap]?: (payload: NarsilEventMap[K]) => void;
1796
1811
  };
1797
1812
 
1813
+ /**
1814
+ * Registers the adapters that indexes and queries reach by name, which is
1815
+ * what lets a binding outlive a restart and reach a worker thread or another
1816
+ * node.
1817
+ *
1818
+ * @public
1819
+ */
1820
+ interface AdapterRegistrationOperations {
1821
+ /**
1822
+ * Registers an embedding adapter under a name that an index config can
1823
+ * give and that durability metadata keeps. Registering a name again binds
1824
+ * every index that gives that name to the new adapter.
1825
+ *
1826
+ * @param name - The name that an index config gives in `embedding.adapter`.
1827
+ * @param adapter - The adapter that embeds documents and queries.
1828
+ */
1829
+ registerEmbeddingAdapter(name: string, adapter: EmbeddingAdapter): void;
1830
+ /**
1831
+ * Registers a rerank adapter under a name that a query gives in
1832
+ * `rerank.adapter`. Registering a name again sends every later query that
1833
+ * gives that name to the new adapter. The engine throws
1834
+ * `RERANK_CONFIG_INVALID` for an empty name and for an adapter without a
1835
+ * `rerank` function.
1836
+ *
1837
+ * @param name - The name that a query gives in `rerank.adapter`.
1838
+ * @param adapter - The adapter that scores the top hits of a query.
1839
+ */
1840
+ registerRerankAdapter(name: string, adapter: RerankAdapter): void;
1841
+ }
1842
+
1843
+ /**
1844
+ * The analysis settings that {@link AnalysisOperations.changeAnalysis} changes
1845
+ * on a live index. A key that you leave out keeps its current value.
1846
+ *
1847
+ * @public
1848
+ */
1849
+ interface AnalysisChange {
1850
+ /** This is the name of a registered language. */
1851
+ language?: string;
1852
+ /**
1853
+ * This is a name that {@link registerTokenizer} bound. Pass `null` to return
1854
+ * to the tokeniser of the language.
1855
+ */
1856
+ tokenizer?: string | null;
1857
+ /**
1858
+ * This is a name that {@link registerStopWords} bound, or a list of words.
1859
+ * Pass `null` to return to the stop words of the language.
1860
+ */
1861
+ stopWords?: string | readonly string[] | ReadonlySet<string> | null;
1862
+ }
1863
+ /**
1864
+ * Changes how an index turns text into terms while the index keeps answering
1865
+ * searches.
1866
+ *
1867
+ * @public
1868
+ */
1869
+ interface AnalysisOperations {
1870
+ /**
1871
+ * Gives you an index that matches text under new settings, while the index
1872
+ * keeps answering searches and accepting writes.
1873
+ *
1874
+ * The engine builds the new terms beside the old ones. Searches keep matching
1875
+ * under the old settings during that time, while every write that the engine
1876
+ * accepts reaches the new terms. Each search matches under one set of
1877
+ * settings, either the old or the new, and the rebuild leaves vectors alone.
1878
+ * The promise resolves once a durable checkpoint holds the new terms, or once
1879
+ * the switch happens on an engine without durability. After a restart at any
1880
+ * point, the engine goes on to finish the change.
1881
+ *
1882
+ * @param indexName - The index to change.
1883
+ * @param change - The settings to change. A change to the values that the
1884
+ * index already holds completes with no rebuild.
1885
+ * @throws A `NarsilError` with `LANGUAGE_NOT_SUPPORTED` for an unregistered
1886
+ * language, with `CONFIG_INVALID` for an unregistered name, a tokeniser
1887
+ * instance, a stop word function, or a synonym word that breaks the synonym
1888
+ * rules under the new settings, with `ANALYSIS_REBUILD_MEMORY_EXCEEDED` when a
1889
+ * second copy of the terms does not fit in memory, with
1890
+ * `ANALYSIS_CHANGE_REPLACED` when a later change or a restore replaces this
1891
+ * one or when a restore of the index is in flight, with
1892
+ * `ANALYSIS_CHANGE_NOT_READY` when the previous change has no durable
1893
+ * checkpoint yet, with `PERSISTENCE_SAVE_FAILED` when the new terms
1894
+ * answer searches before a durable checkpoint holds them, and with
1895
+ * `PARTITION_REBALANCING_BACKPRESSURE` during a rebalance.
1896
+ */
1897
+ changeAnalysis(indexName: string, change: AnalysisChange): Promise<void>;
1898
+ }
1899
+
1900
+ /**
1901
+ * Changes the BM25 setting of a live index, which
1902
+ * {@link IndexConfig.bm25} sets when the index is created.
1903
+ *
1904
+ * @public
1905
+ */
1906
+ interface BM25Operations {
1907
+ /**
1908
+ * Replaces the BM25 setting of an index, so that every search that starts
1909
+ * after the promise resolves scores under the new setting.
1910
+ *
1911
+ * The call replaces the whole setting, so a value that it leaves out returns
1912
+ * to its default, and `{}` clears the setting. The engine rebuilds nothing,
1913
+ * because the setting changes no stored token. It saves the setting with the
1914
+ * index, so the setting stays in place after a restart, and every snapshot
1915
+ * of the index includes it. Where the index has copies on worker threads,
1916
+ * the promise resolves only once every copy holds the new setting. A cursor
1917
+ * from before the change keeps working, and its next pages can repeat or
1918
+ * skip documents, because the scores that order them can change.
1919
+ *
1920
+ * @param indexName - The index whose setting the engine replaces.
1921
+ * @param bm25 - The new setting, in the shape that {@link BM25Params} describes.
1922
+ * @throws A `NarsilError` with `CONFIG_INVALID` when `k1` is not a number from
1923
+ * 0 to 1,000, when `b` is not a number from 0 to 1, or when `fields` holds a
1924
+ * name that is not a text field. The index then keeps the setting that it
1925
+ * held before the call.
1926
+ */
1927
+ updateBM25(indexName: string, bm25: BM25Params): Promise<void>;
1928
+ }
1929
+
1930
+ /**
1931
+ * The bytes that {@link Narsil.restore} and {@link Narsil.importDocumentExport}
1932
+ * accept, as one array, a stream of chunks, or an async iterable of chunks,
1933
+ * such as a Node.js file stream.
1934
+ *
1935
+ * @public
1936
+ */
1937
+ type ByteSource = Uint8Array | ReadableStream<Uint8Array> | AsyncIterable<Uint8Array>;
1938
+
1939
+ /**
1940
+ * Opens and closes durable indexes without deleting them.
1941
+ *
1942
+ * @public
1943
+ */
1944
+ interface IndexLifecycleOperations {
1945
+ /**
1946
+ * Loads a closed index from its durable checkpoint and resets a parked recovery failure.
1947
+ *
1948
+ * @param indexName - The index to load.
1949
+ * @returns A promise that settles when the index is ready for operations.
1950
+ */
1951
+ open(indexName: string): Promise<void>;
1952
+ /**
1953
+ * Drains active work, checkpoints the index, releases its memory, and keeps its durable files.
1954
+ *
1955
+ * @param indexName - The index to close.
1956
+ * @returns A promise that settles after the index releases its memory.
1957
+ */
1958
+ close(indexName: string): Promise<void>;
1959
+ }
1960
+
1798
1961
  /**
1799
1962
  * The device sync setting of one index, which {@link SyncOperations.updateSync} takes.
1800
1963
  *
@@ -1855,4 +2018,541 @@ interface SyncOperations {
1855
2018
  getSync(indexName: string): Promise<SyncStatus>;
1856
2019
  }
1857
2020
 
1858
- export { type SortField as $, type ArrayFilter as A, type BatchResult as B, type ClientErrorCode as C, type DocumentImportResult as D, type ErrorCode as E, type FacetConfig as F, type GroupResult as G, type HeldCheckpointReport as H, type IndexInfo as I, type HighlightConfig as J, type HighlightMatch as K, type ListParams as L, type MemoryStats as M, NarsilError as N, type Hit as O, type PartitionStatsResult as P, type QueryParams as Q, type HybridConfig as R, type ServerErrorCode as S, type ListedDocument as T, type PresenceFilter as U, type VectorMaintenanceResult as V, type ProcessMemoryReport as W, type QueryCoverage as X, type RerankConfig as Y, type ScoreComponents as Z, type SearchMode as _, ClientErrorCodes as a, type SortSpec as a0, type StringFilter as a1, type TermMatchPolicy as a2, type VectorQueryConfig as a3, type WorkerCopyReport as a4, ErrorCodes as b, type NarsilErrorCode as c, ServerErrorCodes as d, type SyncSetting as e, type QueryResult as f, type NarsilEventHandlers as g, type GroupConfig as h, isNarsilError as i, type SuggestParams as j, type IndexStats as k, type ListResult as l, type PreflightResult as m, type SuggestResult as n, type SyncStatus as o, type NarsilEventMap as p, type SyncOperations as q, type ComparisonFilter as r, type DocumentProjection as s, type FacetResult as t, type FieldFilter as u, type FilterExpression as v, type GeoFilter as w, type GeoPolygonFilter as x, type GeoRadiusFilter as y, type GroupReducer as z };
2021
+ /**
2022
+ * Reads and replaces the synonym set of an index, which
2023
+ * {@link IndexConfig.synonyms} sets when the index is created.
2024
+ *
2025
+ * @public
2026
+ */
2027
+ interface SynonymOperations {
2028
+ /**
2029
+ * Replaces the synonym set of an index, so that every search that starts
2030
+ * after the promise resolves expands its words with the new set.
2031
+ *
2032
+ * The engine applies the set without rebuilding the index, because a
2033
+ * synonym set changes no stored token. It saves the set with the index, so
2034
+ * the set stays in place after a restart, and every snapshot of the index
2035
+ * includes it. Where the index has copies on worker threads, the promise
2036
+ * resolves only once every copy uses the new set. Pass an empty list to
2037
+ * remove the set.
2038
+ *
2039
+ * @param indexName - The index whose set the engine replaces.
2040
+ * @param synonyms - The new set, in the shape that {@link SynonymRule}
2041
+ * describes.
2042
+ * @throws A `NarsilError` with `CONFIG_INVALID` when a rule breaks that
2043
+ * shape, when a word analyses to no token or to more than one, or when the
2044
+ * set passes 100,000 rules, 500,000 words, or 4,194,304 bytes of words in
2045
+ * UTF-8. The index then keeps the set that it held before the call.
2046
+ */
2047
+ updateSynonyms(indexName: string, synonyms: SynonymRule[]): Promise<void>;
2048
+ /**
2049
+ * Returns the synonym set of an index with every word as the caller wrote
2050
+ * it, or an empty list when the index holds no set.
2051
+ *
2052
+ * @param indexName - The index whose set the engine returns.
2053
+ */
2054
+ getSynonyms(indexName: string): Promise<SynonymRule[]>;
2055
+ }
2056
+
2057
+ /**
2058
+ * Reports on and rebuilds the graphs of an index's vector fields.
2059
+ *
2060
+ * @public
2061
+ */
2062
+ interface VectorMaintenanceOperations {
2063
+ /**
2064
+ * Rebuilds a vector field's graph without the tombstones removed documents
2065
+ * left behind, which returns the memory they held and speeds searches up.
2066
+ *
2067
+ * Read {@link VectorMaintenanceOperations.vectorMaintenanceStatus} first to
2068
+ * see whether the work is worth its cost.
2069
+ *
2070
+ * @param indexName - The index holding the field.
2071
+ * @param fieldName - The vector field to compact. Omit it to compact every
2072
+ * vector field in the index.
2073
+ */
2074
+ compactVectors(indexName: string, fieldName?: string): Promise<void>;
2075
+ /**
2076
+ * Rebuilds a vector field's graph from scratch, which recovers the recall a
2077
+ * long run of inserts and removals costs.
2078
+ *
2079
+ * This is heavier than {@link VectorMaintenanceOperations.compactVectors} and
2080
+ * gives a better graph, so run it once a search starts missing documents it
2081
+ * should find, rather than on a schedule.
2082
+ *
2083
+ * @param indexName - The index holding the field.
2084
+ * @param fieldName - The vector field to rebuild. Omit it to rebuild every
2085
+ * vector field in the index.
2086
+ */
2087
+ optimizeVectors(indexName: string, fieldName?: string): Promise<void>;
2088
+ /**
2089
+ * Reports the state of each vector field in an index, and what compaction or
2090
+ * optimisation would cost.
2091
+ *
2092
+ * @param indexName - The index to describe.
2093
+ * @returns One entry per vector field, or an empty list while the index is closed.
2094
+ */
2095
+ vectorMaintenanceStatus(indexName: string): VectorMaintenanceResult[];
2096
+ }
2097
+
2098
+ /**
2099
+ * Adds, replaces, and removes documents, and waits for the worker copies to
2100
+ * catch up with those writes.
2101
+ *
2102
+ * A write returns once the main copy holds it, and the worker copies apply
2103
+ * it afterwards, so a query that a copy answers can come back without a write
2104
+ * that returned before it. Every write takes a `wait` option for the cases
2105
+ * where the next query has to see it.
2106
+ *
2107
+ * @public
2108
+ */
2109
+ interface DocumentWriteOperations {
2110
+ /**
2111
+ * Adds one document to an index and returns the id it is stored under.
2112
+ *
2113
+ * The id comes from the `docId` argument when you pass one, otherwise from
2114
+ * the document's own `id` field, and otherwise the engine generates it. Use
2115
+ * {@link DocumentWriteOperations.insertBatch} for a large load, so that one
2116
+ * bad document cannot abandon the rest.
2117
+ *
2118
+ * @param indexName - The index that receives the document.
2119
+ * @param document - Its fields must match the types the schema declares.
2120
+ * @param docId - Pass an id to control it yourself, or omit it and read the
2121
+ * returned value. An id that differs from the document's own `id` field
2122
+ * raises `DOC_VALIDATION_FAILED`, because the stored document would
2123
+ * otherwise contradict the key that it is stored under.
2124
+ * @param options - Per-write settings, such as skipping the defensive copy
2125
+ * or waiting for every worker copy to apply the write.
2126
+ * @returns The id the document is stored under.
2127
+ */
2128
+ insert(indexName: string, document: AnyDocument, docId?: string, options?: InsertOptions): Promise<string>;
2129
+ /**
2130
+ * Adds many documents in one pass and reports each one's outcome.
2131
+ *
2132
+ * A document the engine rejects appears in `failed` with the error that
2133
+ * rejected it, and every other document is still written, which is what
2134
+ * makes this the call to load a corpus with.
2135
+ *
2136
+ * @param indexName - The index that receives the documents.
2137
+ * @param documents - The documents to write, each carrying its own id or
2138
+ * leaving the engine to generate one.
2139
+ * @param options - Per-write settings applied to every document.
2140
+ * @returns The ids written, and each rejection with its error.
2141
+ */
2142
+ insertBatch(indexName: string, documents: AnyDocument[], options?: InsertOptions): Promise<BatchResult>;
2143
+ /**
2144
+ * Removes one document.
2145
+ *
2146
+ * @param indexName - The index holding the document.
2147
+ * @param docId - The document to remove.
2148
+ * @param options - Per-write settings, such as waiting for every worker
2149
+ * copy to apply the removal.
2150
+ * @throws A `NarsilError` with `DOC_NOT_FOUND` when the index holds no such
2151
+ * document.
2152
+ */
2153
+ remove(indexName: string, docId: string, options?: WriteOptions): Promise<void>;
2154
+ /**
2155
+ * Removes many documents in one pass and reports each one's outcome.
2156
+ *
2157
+ * @param indexName - The index holding the documents.
2158
+ * @param docIds - The documents to remove.
2159
+ * @param options - Per-write settings applied to the whole batch.
2160
+ * @returns The ids removed, and each failure with its error.
2161
+ */
2162
+ removeBatch(indexName: string, docIds: string[], options?: WriteOptions): Promise<BatchResult>;
2163
+ /**
2164
+ * Replaces a stored document with the one you pass.
2165
+ *
2166
+ * The engine removes the old document and indexes the new one, so the
2167
+ * document you supply has to be complete, with every field it should hold
2168
+ * afterwards.
2169
+ *
2170
+ * @param indexName - The index holding the document.
2171
+ * @param docId - The document to replace.
2172
+ * @param document - The complete replacement.
2173
+ * @param options - Per-write settings, such as waiting for every worker
2174
+ * copy to apply the replacement.
2175
+ */
2176
+ update(indexName: string, docId: string, document: AnyDocument, options?: WriteOptions): Promise<void>;
2177
+ /**
2178
+ * Replaces many documents in one pass and reports each one's outcome.
2179
+ *
2180
+ * @param indexName - The index holding the documents.
2181
+ * @param updates - Each id with the complete document that replaces it.
2182
+ * @param options - Per-write settings applied to the whole batch.
2183
+ * @returns The ids replaced, and each failure with its error.
2184
+ */
2185
+ updateBatch(indexName: string, updates: Array<{
2186
+ docId: string;
2187
+ document: AnyDocument;
2188
+ }>, options?: WriteOptions): Promise<BatchResult>;
2189
+ /**
2190
+ * Resolves once every worker copy of an index has applied every write that
2191
+ * returned before the call.
2192
+ *
2193
+ * Call this after a run of writes, or pass `wait: true` on one write,
2194
+ * before a query that has to see them. An index that holds no copies
2195
+ * resolves at once.
2196
+ *
2197
+ * @param indexName - The index whose copies have to catch up.
2198
+ */
2199
+ waitForWrites(indexName: string): Promise<void>;
2200
+ }
2201
+
2202
+ /**
2203
+ * What {@link Narsil.snapshot} adds to the archive beyond the checkpoint.
2204
+ *
2205
+ * @public
2206
+ */
2207
+ interface SnapshotOptions {
2208
+ /**
2209
+ * Set this to add the index's popular query history, which holds raw
2210
+ * searches, so that a restore on a node with the same key keeps the counts.
2211
+ * Defaults to false, because a backup that holds history can keep searches
2212
+ * past their retention.
2213
+ */
2214
+ queryHistory?: boolean;
2215
+ }
2216
+ /**
2217
+ * The search engine, and everything you do with it.
2218
+ *
2219
+ * One instance holds every index you create, so an application usually keeps a
2220
+ * single engine for its lifetime and reaches each index by name. Build one
2221
+ * with {@link createNarsil}. Its write, open and close, synonym, analysis, BM25,
2222
+ * device sync, vector maintenance, and adapter registration methods come from
2223
+ * {@link DocumentWriteOperations}, {@link IndexLifecycleOperations},
2224
+ * {@link SynonymOperations}, {@link AnalysisOperations},
2225
+ * {@link BM25Operations}, {@link SyncOperations},
2226
+ * {@link VectorMaintenanceOperations}, and
2227
+ * {@link AdapterRegistrationOperations}.
2228
+ *
2229
+ * @public
2230
+ */
2231
+ interface Narsil extends IndexLifecycleOperations, DocumentWriteOperations, SynonymOperations, AnalysisOperations, BM25Operations, SyncOperations, VectorMaintenanceOperations, AdapterRegistrationOperations {
2232
+ /**
2233
+ * Creates an index you can insert documents into and query.
2234
+ *
2235
+ * The schema sets the type of each field, marks which fields you can
2236
+ * filter and sort on, and controls how the engine tokenises text. The
2237
+ * `language` option picks the analyser that stems those text fields.
2238
+ *
2239
+ * @param name - Every later call uses this name to reach the index.
2240
+ * @param config - This carries the schema, and the language, partitioning,
2241
+ * and scoring settings.
2242
+ */
2243
+ createIndex(name: string, config: IndexConfig): Promise<void>;
2244
+ /**
2245
+ * Removes an index and everything it holds, including whatever persistence
2246
+ * wrote for it. The documents do not come back.
2247
+ *
2248
+ * @param name - The index to drop.
2249
+ */
2250
+ dropIndex(name: string): Promise<void>;
2251
+ /**
2252
+ * Lists every index this engine holds, with its size and its language.
2253
+ *
2254
+ * @returns One entry per index, in creation order.
2255
+ */
2256
+ listIndexes(): IndexInfo[];
2257
+ /**
2258
+ * Returns one index's document count, partition count, memory estimate,
2259
+ * language, and schema.
2260
+ *
2261
+ * @param indexName - The index to describe.
2262
+ * @returns The index's current figures.
2263
+ * @throws A `NarsilError` with `INDEX_NOT_FOUND` for an unknown name.
2264
+ */
2265
+ getStats(indexName: string): IndexStats;
2266
+ /**
2267
+ * Returns per-partition figures for one index, which is where you look when
2268
+ * an index grows unevenly or a rebalance is worth running.
2269
+ *
2270
+ * @param indexName - The index to describe.
2271
+ * @returns One entry per open partition, in partition order, or an empty list while the index is closed.
2272
+ */
2273
+ getPartitionStats(indexName: string): PartitionStatsResult[];
2274
+ /**
2275
+ * Fetches one stored document by id, without searching.
2276
+ *
2277
+ * A vector field comes back as a `Float32Array`, whatever form you give it.
2278
+ * `JSON.stringify` writes one as an object keyed by index, so convert it
2279
+ * with `Array.from`, or project the field away, before you serialise the
2280
+ * document yourself. The HTTP routes convert it for you.
2281
+ *
2282
+ * @param indexName - The index holding the document.
2283
+ * @param docId - The document to fetch.
2284
+ * @returns The document, or `undefined` when the index holds no such id.
2285
+ */
2286
+ get(indexName: string, docId: string): Promise<AnyDocument | undefined>;
2287
+ /**
2288
+ * Fetches many stored documents by id in one pass.
2289
+ *
2290
+ * @param indexName - The index holding the documents.
2291
+ * @param docIds - The documents to fetch.
2292
+ * @returns A map from id to document, holding an entry for each id that
2293
+ * exists and nothing for the rest.
2294
+ */
2295
+ getMultiple(indexName: string, docIds: string[]): Promise<Map<string, AnyDocument>>;
2296
+ /**
2297
+ * Reports whether an index holds a document, without reading it.
2298
+ *
2299
+ * @param indexName - The index to check.
2300
+ * @param docId - The document to look for.
2301
+ * @returns True when the index holds that id.
2302
+ */
2303
+ has(indexName: string, docId: string): Promise<boolean>;
2304
+ /**
2305
+ * Counts the documents an index holds.
2306
+ *
2307
+ * @param indexName - The index to count.
2308
+ * @returns The document count across every partition.
2309
+ */
2310
+ countDocuments(indexName: string): Promise<number>;
2311
+ /**
2312
+ * Reads one page of stored documents in document-id order, without
2313
+ * searching, which is how you page through a whole index.
2314
+ *
2315
+ * Leave `cursor` out for the first page, pass the returned cursor back for
2316
+ * each page after it, and stop when the cursor comes back null. A document
2317
+ * that stays in the index for the whole listing comes back exactly once. The
2318
+ * engine skips a document you remove part-way through. It returns one you
2319
+ * insert part-way through once that document's id sorts above the cursor.
2320
+ * The cursor holds no engine state, so it stays valid after a restart, a
2321
+ * snapshot restore, and a rebalance.
2322
+ *
2323
+ * The engine compares document ids by their UTF-16 code units, so `"10"`
2324
+ * sorts ahead of `"9"`.
2325
+ *
2326
+ * Set `document` to drop a vector field, because the engine otherwise reads
2327
+ * every listed document's vector back out of the index.
2328
+ *
2329
+ * @typeParam T - Shape of the stored documents, which flows through to each
2330
+ * entry's `document`.
2331
+ * @param indexName - The index to walk.
2332
+ * @param params - These set the cursor, the page size, the filter, and how
2333
+ * much of each document comes back.
2334
+ * @returns The page, the cursor for the next page, how many documents the
2335
+ * listing walks in total, and the time the page took.
2336
+ */
2337
+ listDocuments<T = AnyDocument>(indexName: string, params?: ListParams): Promise<ListResult<T>>;
2338
+ /**
2339
+ * Runs a search against an index and returns the ranked hits.
2340
+ *
2341
+ * One call covers keyword search, vector search, and a hybrid of the two,
2342
+ * chosen by the `mode` parameter. BM25 ranks keyword results by default.
2343
+ * Every hit carries its score and its document, along with highlights when
2344
+ * you ask for them.
2345
+ *
2346
+ * @typeParam T - Shape of the stored documents, which flows through to each
2347
+ * hit's `document`.
2348
+ * @param indexName - The index the search runs against.
2349
+ * @param params - These set the search term, filters, field boosts, sorting,
2350
+ * facets, highlighting, and the result limit.
2351
+ * @returns The hits, the total count, the elapsed time, and any facets or
2352
+ * groups the query asked for.
2353
+ */
2354
+ query<T = AnyDocument>(indexName: string, params: QueryParams): Promise<QueryResult<T>>;
2355
+ /**
2356
+ * Counts what a query would match without building a single hit, which is
2357
+ * how a result-count badge stays cheap. A full-text count also skips scoring
2358
+ * unless the query carries `minScore`, which prunes matches by score, or a
2359
+ * `termMatch` policy other than `any`, which prunes them by term coverage. A
2360
+ * vector or hybrid count still runs its search.
2361
+ *
2362
+ * @param indexName - The index the query would run against.
2363
+ * @param params - The same parameters {@link Narsil.query} takes. Anything
2364
+ * that shapes the output alone, such as `limit` or `highlight`, is ignored.
2365
+ * @returns The match count and the time the count took.
2366
+ */
2367
+ preflight(indexName: string, params: QueryParams): Promise<PreflightResult>;
2368
+ /**
2369
+ * Returns the indexed terms that complete a prefix, ready to offer as
2370
+ * you-type suggestions.
2371
+ *
2372
+ * The terms come back as the index holds them, which means stems unless the
2373
+ * index was created with `surfaceForms`.
2374
+ *
2375
+ * @param indexName - The index to draw completions from.
2376
+ * @param params - The prefix typed so far, and how many completions to
2377
+ * return.
2378
+ * @returns The completions, most widely used first.
2379
+ */
2380
+ suggest(indexName: string, params: SuggestParams): Promise<SuggestResult>;
2381
+ /**
2382
+ * Rebuilds an index's terms from the documents it already stores, and
2383
+ * resolves once every partition carries terms the current language module
2384
+ * produced.
2385
+ *
2386
+ * An index whose stored analysis revision differs from the one its language
2387
+ * module carries answers text queries from terms an earlier analysis wrote,
2388
+ * and every such result reports `analysisStale`. Call this after the engine
2389
+ * reports a stale index to configuration that declined an automatic rebuild.
2390
+ * Calling it for an index whose terms are current does nothing.
2391
+ *
2392
+ * @param indexName - The index whose terms are rebuilt.
2393
+ */
2394
+ rebuildAnalysis(indexName: string): Promise<void>;
2395
+ /**
2396
+ * Returns a stream of the index's snapshot archive. The archive is a pax
2397
+ * file containing the index's configuration and the files of one
2398
+ * checkpoint, and any implementation of the Narsil format can restore it.
2399
+ *
2400
+ * With write-ahead log durability, the engine takes a checkpoint before it
2401
+ * starts the stream, so the archive contains every write that the engine
2402
+ * acknowledged before the call. The engine keeps that checkpoint's files on
2403
+ * disk until the stream ends or you cancel it. Without write-ahead log
2404
+ * durability, the engine builds the archive's files from the index in
2405
+ * memory.
2406
+ *
2407
+ * @param indexName - The index to stream.
2408
+ * @param options - Set `queryHistory` to add the index's popular query
2409
+ * history, which holds raw searches, after the checkpoint's files.
2410
+ * @returns A stream of the archive's bytes, which you can write to a file or
2411
+ * send over a network.
2412
+ */
2413
+ snapshot(indexName: string, options?: SnapshotOptions): Promise<ReadableStream<Uint8Array>>;
2414
+ /**
2415
+ * Creates an index from a snapshot under the name that you pass, replacing
2416
+ * any index of that name.
2417
+ *
2418
+ * The engine accepts the archive that {@link Narsil.snapshot} streams and
2419
+ * the `.nrsl` file of release 0.3. It checks each archive file against its
2420
+ * manifest and loads the restored index beside the existing one, which
2421
+ * answers requests until the swap. A failed restore leaves the existing index
2422
+ * serving, and after a crash the engine reopens either the old or the new one.
2423
+ *
2424
+ * @param indexName - The name that the restored index takes.
2425
+ * @param data - The snapshot's bytes, as an array, a stream, or async chunks.
2426
+ * @throws A `NarsilError` with `PERSISTENCE_LOAD_FAILED` when the archive is
2427
+ * malformed or a file's length differs from the manifest. The engine raises
2428
+ * `PERSISTENCE_CRC_MISMATCH` when a file's checksum differs from its
2429
+ * contents, and `ENVELOPE_VERSION_MISMATCH` when a file has a format version
2430
+ * other than the ones that this release implements. It raises
2431
+ * `CONFIG_INVALID` when the archive's configuration is invalid,
2432
+ * `DOC_VALIDATION_FAILED` when the data is empty or the release 0.3 file is
2433
+ * invalid, `RESTORE_MEMORY_EXCEEDED` when the restored index needs more
2434
+ * memory than the process has free, and `WORKER_TIMEOUT` when a
2435
+ * worker still holds the old index 30 seconds after the engine asks for it.
2436
+ */
2437
+ restore(indexName: string, data: ByteSource): Promise<void>;
2438
+ /**
2439
+ * Returns a stream of the index's document export. The export is JSON Lines
2440
+ * text whose format stays the same in every release, so you can use it to
2441
+ * move an index across releases or between implementations.
2442
+ *
2443
+ * The first line is a header containing the format name, the format
2444
+ * version, and the index configuration. Each later line contains one
2445
+ * document, with its ID under `id` and the value of each vector field as an
2446
+ * array of numbers. With write-ahead log durability, the engine exports every
2447
+ * document from one checkpoint; otherwise, it exports them from the index in
2448
+ * memory at one moment.
2449
+ *
2450
+ * JSON has no type for a date, for raw bytes, or for an infinite number or
2451
+ * `NaN`, so the engine writes each such value as a tag. Each tag is an
2452
+ * object with one key that begins with `$`, such as
2453
+ * `{"$date":[1700000000,123000000]}`. The engine also wraps a stored object
2454
+ * whose only key begins with `$` in an `$object` tag, because the import
2455
+ * decodes every other object of that shape as a tag.
2456
+ *
2457
+ * @param indexName - The index to export.
2458
+ * @returns A stream of the export's UTF-8 bytes.
2459
+ */
2460
+ exportDocuments(indexName: string): Promise<ReadableStream<Uint8Array>>;
2461
+ /**
2462
+ * Imports a document export into the named index. Where the name is free,
2463
+ * the engine creates the index from the export's configuration.
2464
+ *
2465
+ * The engine writes the documents in batches and replaces any document
2466
+ * whose ID the index already contains. Because it replaces existing
2467
+ * documents, you can run an interrupted import again to make the index equal
2468
+ * to the export. When a line is invalid or the engine rejects its document,
2469
+ * the engine records the refusal and continues with the next line.
2470
+ *
2471
+ * The engine converts each tag that {@link Narsil.exportDocuments} writes
2472
+ * into the value that the tag stands for. When an object has one key that
2473
+ * begins with `$` and that key names no tag, or when a tag holds an invalid
2474
+ * value, the engine refuses the line.
2475
+ *
2476
+ * @param indexName - The index that receives the documents.
2477
+ * @param data - The export's bytes, as one array, a stream, or an async
2478
+ * iterable of chunks.
2479
+ * @returns The number of imported documents, the number of refused lines,
2480
+ * and the 1,000 refusals with the lowest line numbers.
2481
+ * @throws A `NarsilError` with `CONFIG_INVALID` when the first line is
2482
+ * anything other than a version 1 header, or when the named index exists
2483
+ * with a different schema.
2484
+ */
2485
+ importDocumentExport(indexName: string, data: ByteSource): Promise<DocumentImportResult>;
2486
+ /**
2487
+ * Writes an index's current state to the durability directory, so a restart
2488
+ * replays less of the log.
2489
+ *
2490
+ * @param indexName - The index to checkpoint.
2491
+ */
2492
+ checkpoint(indexName: string): Promise<void>;
2493
+ /**
2494
+ * Removes every document from an index and keeps the index itself, along
2495
+ * with its schema and settings.
2496
+ *
2497
+ * @param indexName - The index to empty.
2498
+ */
2499
+ clear(indexName: string): Promise<void>;
2500
+ /**
2501
+ * Spreads an index's documents across a different number of partitions.
2502
+ *
2503
+ * The engine keeps answering queries throughout, and it queues the writes
2504
+ * that arrive while the work runs, replaying them in order once it finishes.
2505
+ *
2506
+ * @param indexName - The index to rebalance.
2507
+ * @param targetPartitionCount - Partitions the index ends up with.
2508
+ */
2509
+ rebalance(indexName: string, targetPartitionCount: number): Promise<void>;
2510
+ /**
2511
+ * Changes how an index grows into new partitions, without moving the
2512
+ * documents it already holds.
2513
+ *
2514
+ * @param indexName - The index to reconfigure.
2515
+ * @param config - The partitioning fields to change. Anything you leave out
2516
+ * keeps its current value.
2517
+ */
2518
+ updatePartitionConfig(indexName: string, config: Partial<PartitionConfig>): Promise<void>;
2519
+ /**
2520
+ * Reports what this engine and its host process are using, which is what you
2521
+ * size a host from.
2522
+ *
2523
+ * @returns Process heap figures, the engine's own estimate, and one entry
2524
+ * per worker once the engine has promoted.
2525
+ */
2526
+ getMemoryStats(): Promise<MemoryStats>;
2527
+ /**
2528
+ * Starts delivering one kind of engine event to your listener.
2529
+ *
2530
+ * These events report work the engine does on its own, away from the call
2531
+ * that triggered it, so this is where a failed background save or a worker
2532
+ * crash reaches you.
2533
+ *
2534
+ * @typeParam K - The event name, which fixes the payload the listener gets.
2535
+ * @param event - Which event to listen for.
2536
+ * @param handler - Called once per event.
2537
+ */
2538
+ on<K extends keyof NarsilEventMap>(event: K, handler: (payload: NarsilEventMap[K]) => void): void;
2539
+ /**
2540
+ * Removes a listener {@link Narsil.on} registered, so it receives no
2541
+ * further events.
2542
+ *
2543
+ * @typeParam K - The event name.
2544
+ * @param event - The event the listener was registered for.
2545
+ * @param handler - The same function reference that was registered.
2546
+ */
2547
+ off<K extends keyof NarsilEventMap>(event: K, handler: (payload: NarsilEventMap[K]) => void): void;
2548
+ /**
2549
+ * Closes the engine: it flushes pending writes, ends its workers, and
2550
+ * releases every adapter it opened.
2551
+ *
2552
+ * Call it before the process exits, because writes still in flight are lost
2553
+ * otherwise. The engine rejects new work once this starts.
2554
+ */
2555
+ shutdown(): Promise<void>;
2556
+ }
2557
+
2558
+ export { type IndexLifecycleOperations as $, type AnalysisChange as A, type BatchResult as B, type ClientErrorCode as C, type DocumentImportResult as D, type ErrorCode as E, type FacetConfig as F, type GroupResult as G, type FacetResult as H, type IndexInfo as I, type FieldFilter as J, type FilterExpression as K, type ListParams as L, type MemoryStats as M, NarsilError as N, type GeoFilter as O, type PartitionStatsResult as P, type QueryParams as Q, type GeoPolygonFilter as R, type ServerErrorCode as S, type GeoRadiusFilter as T, type GroupReducer as U, type VectorMaintenanceResult as V, type HeldCheckpointReport as W, type HighlightConfig as X, type HighlightMatch as Y, type Hit as Z, type HybridConfig as _, ClientErrorCodes as a, type ListedDocument as a0, type PresenceFilter as a1, type ProcessMemoryReport as a2, type QueryCoverage as a3, type RerankConfig as a4, type ScoreComponents as a5, type SearchMode as a6, type SortField as a7, type SortSpec as a8, type StringFilter as a9, type SyncOperations as aa, type SynonymOperations as ab, type TermMatchPolicy as ac, type VectorMaintenanceOperations as ad, type VectorQueryConfig as ae, type WorkerCopyReport as af, ErrorCodes as b, type NarsilErrorCode as c, ServerErrorCodes as d, type SnapshotOptions as e, type SyncSetting as f, type Narsil as g, type QueryResult as h, isNarsilError as i, type NarsilEventHandlers as j, type SyncStatus as k, type ListResult as l, type SuggestParams as m, type SuggestResult as n, type PreflightResult as o, type IndexStats as p, type NarsilEventMap as q, type GroupConfig as r, type AdapterRegistrationOperations as s, type AnalysisOperations as t, type ArrayFilter as u, type BM25Operations as v, type ByteSource as w, type ComparisonFilter as x, type DocumentProjection as y, type DocumentWriteOperations as z };