@delali/narsil 0.3.1-next.99 → 0.4.1-next.211

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 (426) hide show
  1. package/NOTICE +45 -0
  2. package/README.md +30 -11
  3. package/dist/adapters/filesystem.d.ts +1 -1
  4. package/dist/adapters/filesystem.mjs +101 -13
  5. package/dist/adapters/gcs.d.ts +49 -0
  6. package/dist/adapters/gcs.mjs +213 -0
  7. package/dist/adapters/indexeddb.d.ts +1 -1
  8. package/dist/adapters/indexeddb.mjs +2 -7
  9. package/dist/adapters/memory.d.ts +1 -1
  10. package/dist/adapters/memory.mjs +5 -0
  11. package/dist/adapters/s3.d.ts +53 -0
  12. package/dist/adapters/s3.mjs +263 -0
  13. package/dist/{adapters-BQFQ4PRz.d.ts → adapters-pljAqmrC.d.ts} +33 -0
  14. package/dist/browser/chunk-4E5APHTM.mjs +1459 -0
  15. package/dist/browser/chunk-NDYADQ4Y.mjs +23426 -0
  16. package/dist/browser/chunk-QAOVAYAG.mjs +564 -0
  17. package/dist/browser/chunk-WC2DEXWU.mjs +29 -0
  18. package/dist/browser/chunk-YINZFPLT.mjs +1239 -0
  19. package/dist/browser/chunk-YJHGOJAC.mjs +15 -0
  20. package/dist/browser/{chunk-Z7QH2XHB.mjs → core-leaf-HWAXCEWX.mjs} +3987 -2103
  21. package/dist/browser/custom-token-results-R5BIX7SL.mjs +59 -0
  22. package/dist/browser/digest-leaf-64IPRPZD.mjs +151 -0
  23. package/dist/browser/durability-config-75NSFCQN.mjs +97 -0
  24. package/dist/browser/embed-GG6PS3EA.mjs +264 -0
  25. package/dist/browser/geo-index-GNHY4PUB.mjs +1484 -0
  26. package/dist/browser/gzip-JF3S6PPT.mjs +31 -0
  27. package/dist/browser/module-ZZTNG5JZ.mjs +5762 -0
  28. package/dist/browser/msgpack-leaf-44XNWSSY.mjs +302 -0
  29. package/dist/browser/optional-reads-XMVPG6HG.mjs +3230 -0
  30. package/dist/browser/optional-writes-76DWMRQH.mjs +3603 -0
  31. package/dist/browser/phrase-module-6UGFVW5J.mjs +617 -0
  32. package/dist/browser/resolve-vector-text-XRR2OVHE.mjs +85 -0
  33. package/dist/browser/restore-queue-SG5O735W.mjs +196 -0
  34. package/dist/browser/{runtime-NYE5TB6O.mjs → runtime-OMKE7DF4.mjs} +83 -25
  35. package/dist/browser/segment-codec-leaf-A427QJUX.mjs +554 -0
  36. package/dist/browser/segment-merge-leaf-7BZ54JPI.mjs +1636 -0
  37. package/dist/browser/storage-leaf-5UTR5K7J.mjs +19829 -0
  38. package/dist/browser/store-leaf-3L33V35P.mjs +2070 -0
  39. package/dist/browser/suggestions-leaf-UBNDVKBD.mjs +1430 -0
  40. package/dist/browser/worker-copies-JXSGYR5X.mjs +2951 -0
  41. package/dist/{capabilities-BTTIs96E.d.ts → capabilities-DMte5K9_.d.ts} +162 -18
  42. package/dist/chunk-2AFZE7Y3.mjs +72 -0
  43. package/dist/chunk-2CKDCC65.mjs +47 -0
  44. package/dist/chunk-3ECIRFS5.mjs +61 -0
  45. package/dist/chunk-44W3CBNG.mjs +7 -0
  46. package/dist/chunk-4H4RG2FR.mjs +13 -0
  47. package/dist/chunk-4PY4JYMY.mjs +11 -0
  48. package/dist/chunk-4ZPVAHWF.mjs +1289 -0
  49. package/dist/chunk-5EI5CXO6.mjs +197 -0
  50. package/dist/chunk-5F5MXWS5.mjs +283 -0
  51. package/dist/{chunk-OHP7QR33.mjs → chunk-5FLRXF73.mjs} +25 -4
  52. package/dist/chunk-6FOENO4E.mjs +273 -0
  53. package/dist/chunk-6GHX35ZM.mjs +108 -0
  54. package/dist/chunk-6MSZ543Y.mjs +32 -0
  55. package/dist/chunk-6N6HHBCQ.mjs +4596 -0
  56. package/dist/{chunk-LXPIXDUJ.mjs → chunk-7P5YWDRQ.mjs} +403 -169
  57. package/dist/{chunk-TGP5M5R7.mjs → chunk-7T4LAYT4.mjs} +1 -1
  58. package/dist/{chunk-GGSH6KBQ.mjs → chunk-ASZLNVWW.mjs} +23 -3
  59. package/dist/chunk-AVBPB3MI.mjs +602 -0
  60. package/dist/{chunk-UCDF35PU.mjs → chunk-AVGUEEQ3.mjs} +494 -245
  61. package/dist/chunk-BUMREPLU.mjs +15 -0
  62. package/dist/chunk-BY6NALRK.mjs +31921 -0
  63. package/dist/chunk-C4ZMXXTL.mjs +92 -0
  64. package/dist/{chunk-2WYMG3OZ.mjs → chunk-C74KPRR7.mjs} +274 -19
  65. package/dist/{chunk-RSRVGAIQ.mjs → chunk-D456ZFPQ.mjs} +3 -2
  66. package/dist/chunk-DXZ6JDWG.mjs +797 -0
  67. package/dist/chunk-FJXJZUWF.mjs +209 -0
  68. package/dist/chunk-FS3HPPSC.mjs +212 -0
  69. package/dist/chunk-FT4KLZXW.mjs +1164 -0
  70. package/dist/chunk-GR5GMFJJ.mjs +104 -0
  71. package/dist/chunk-GXCDWLQI.mjs +193 -0
  72. package/dist/chunk-GXED6R3Q.mjs +271 -0
  73. package/dist/chunk-HLPRHOSO.mjs +17 -0
  74. package/dist/chunk-IL5DRCNU.mjs +3041 -0
  75. package/dist/{chunk-P36MUFEJ.mjs → chunk-JDDXV6UF.mjs} +2 -1
  76. package/dist/chunk-K5HSUPYS.mjs +11 -0
  77. package/dist/chunk-KYIRXTCA.mjs +100 -0
  78. package/dist/chunk-LFXS6OF7.mjs +289 -0
  79. package/dist/chunk-LNGE7SLY.mjs +151 -0
  80. package/dist/chunk-M2Z5WVWW.mjs +194 -0
  81. package/dist/{chunk-45AVKHMJ.mjs → chunk-M3B7SGJB.mjs} +63 -50
  82. package/dist/chunk-M3OW2XSP.mjs +40 -0
  83. package/dist/chunk-MFPSQZ6P.mjs +127 -0
  84. package/dist/chunk-MRCJBWJZ.mjs +1292 -0
  85. package/dist/chunk-MSIN4NM3.mjs +25 -0
  86. package/dist/chunk-MW3CJVGP.mjs +219 -0
  87. package/dist/chunk-MYM6CAVK.mjs +76 -0
  88. package/dist/chunk-NJJN4FMM.mjs +84 -0
  89. package/dist/chunk-NM7I3BM7.mjs +59 -0
  90. package/dist/chunk-OIJ64LGT.mjs +19 -0
  91. package/dist/{chunk-K7D4ZTSW.mjs → chunk-P4F4UWLC.mjs} +1 -1
  92. package/dist/chunk-Q2AP2FSN.mjs +15 -0
  93. package/dist/chunk-R2PJKSNL.mjs +54 -0
  94. package/dist/{chunk-HXJBSHXF.mjs → chunk-R724DJSG.mjs} +5056 -2619
  95. package/dist/chunk-S2POFTLN.mjs +10 -0
  96. package/dist/chunk-S5QMWECL.mjs +7 -0
  97. package/dist/chunk-SLAC5PAB.mjs +5008 -0
  98. package/dist/chunk-T4HMSZCX.mjs +5 -0
  99. package/dist/chunk-TACP6VK6.mjs +111 -0
  100. package/dist/chunk-TGPKS2UM.mjs +125 -0
  101. package/dist/chunk-TKKXPKEO.mjs +979 -0
  102. package/dist/chunk-V6EUBAIT.mjs +19 -0
  103. package/dist/chunk-XL56L4IR.mjs +228 -0
  104. package/dist/chunk-XQIAMDAG.mjs +3076 -0
  105. package/dist/chunk-YTUZ4R22.mjs +1063 -0
  106. package/dist/{chunk-KV3AZFT3.mjs → chunk-ZKOQR7EA.mjs} +45 -1
  107. package/dist/chunk-ZPJFGGGI.mjs +638 -0
  108. package/dist/chunk-ZXX5GZEX.mjs +17 -0
  109. package/dist/{client-i9eLJrw5.d.ts → client-BKqtl0_V.d.ts} +442 -22
  110. package/dist/client.d.ts +11 -10
  111. package/dist/client.mjs +8 -898
  112. package/dist/config-Bnl7L-0H.d.ts +608 -0
  113. package/dist/{config-P__Diiy4.d.ts → config-CJ-jfI0a.d.ts} +119 -9
  114. package/dist/core-leaf-6JVHEVFB.mjs +8 -0
  115. package/dist/custom-token-results-NXHBVY7U.mjs +59 -0
  116. package/dist/digest-leaf-KXBGKYHZ.mjs +1 -0
  117. package/dist/direct-executor-V3WOYU2Y.mjs +17 -0
  118. package/dist/distribution/coordinator/etcd.d.ts +63 -7
  119. package/dist/distribution/coordinator/etcd.mjs +725 -81
  120. package/dist/distribution/coordinator/in-memory.d.ts +3 -3
  121. package/dist/distribution/coordinator/in-memory.mjs +65 -10
  122. package/dist/distribution/transport/grpc.d.ts +2 -2
  123. package/dist/distribution/transport/grpc.mjs +39 -10
  124. package/dist/distribution/transport/in-memory.d.ts +2 -2
  125. package/dist/distribution/transport/in-memory.mjs +9 -6
  126. package/dist/distribution/transport/tcp.d.ts +2 -2
  127. package/dist/distribution/transport/tcp.mjs +20 -15
  128. package/dist/distribution.d.ts +267 -56
  129. package/dist/distribution.mjs +23156 -11362
  130. package/dist/durability-config-VWS2K24E.mjs +96 -0
  131. package/dist/embed-4PHHKGBK.mjs +263 -0
  132. package/dist/embeddings/openai.d.ts +1 -1
  133. package/dist/embeddings/openai.mjs +2 -2
  134. package/dist/{memory-CUEDwr-F.d.ts → engine-qjAxJSKk.d.ts} +2254 -1123
  135. package/dist/geo-index-2ZMMWWSK.mjs +1484 -0
  136. package/dist/gzip-2UCZW2MM.mjs +31 -0
  137. package/dist/{index-lcdGLyJH.d.ts → index-B_vmxpgW.d.ts} +260 -102
  138. package/dist/index.browser.mjs +4 -4
  139. package/dist/index.d.ts +2133 -57
  140. package/dist/index.mjs +16 -32
  141. package/dist/index.react-native.mjs +12 -0
  142. package/dist/invalidation/broadcast-channel.d.ts +1 -1
  143. package/dist/invalidation/filesystem.d.ts +1 -1
  144. package/dist/invalidation/filesystem.mjs +1 -2
  145. package/dist/invalidation/noop.d.ts +1 -1
  146. package/dist/languages/albanian.mjs +1 -1
  147. package/dist/languages/amharic.mjs +1 -1
  148. package/dist/languages/arabic.mjs +1 -1
  149. package/dist/languages/armenian.mjs +1 -1
  150. package/dist/languages/azerbaijani.mjs +1 -1
  151. package/dist/languages/bambara.mjs +1 -1
  152. package/dist/languages/basque.mjs +1 -1
  153. package/dist/languages/belarusian.mjs +1 -1
  154. package/dist/languages/bengali.mjs +1 -1
  155. package/dist/languages/bosnian.mjs +1 -1
  156. package/dist/languages/breton.mjs +1 -1
  157. package/dist/languages/bulgarian.mjs +1 -1
  158. package/dist/languages/burmese.mjs +1 -1
  159. package/dist/languages/catalan.mjs +1 -1
  160. package/dist/languages/chinese.mjs +1 -1
  161. package/dist/languages/croatian.mjs +1 -1
  162. package/dist/languages/czech.mjs +1 -1
  163. package/dist/languages/dagbani.mjs +1 -1
  164. package/dist/languages/danish.mjs +1 -1
  165. package/dist/languages/dutch.mjs +1 -1
  166. package/dist/languages/english.mjs +1 -1
  167. package/dist/languages/esperanto.mjs +1 -1
  168. package/dist/languages/estonian.mjs +1 -1
  169. package/dist/languages/ewe.mjs +1 -1
  170. package/dist/languages/faroese.mjs +1 -1
  171. package/dist/languages/fijian.mjs +1 -1
  172. package/dist/languages/finnish.mjs +1 -1
  173. package/dist/languages/french.mjs +1 -1
  174. package/dist/languages/ga.mjs +1 -1
  175. package/dist/languages/galician.mjs +1 -1
  176. package/dist/languages/georgian.mjs +1 -1
  177. package/dist/languages/german.mjs +1 -1
  178. package/dist/languages/greek.mjs +1 -1
  179. package/dist/languages/guarani.mjs +1 -1
  180. package/dist/languages/gujarati.mjs +1 -1
  181. package/dist/languages/haitian-creole.mjs +1 -1
  182. package/dist/languages/hausa.mjs +1 -1
  183. package/dist/languages/hawaiian.mjs +1 -1
  184. package/dist/languages/hebrew.mjs +1 -1
  185. package/dist/languages/hindi.mjs +1 -1
  186. package/dist/languages/hungarian.mjs +1 -1
  187. package/dist/languages/icelandic.mjs +1 -1
  188. package/dist/languages/igbo.mjs +1 -1
  189. package/dist/languages/indonesian.mjs +1 -1
  190. package/dist/languages/irish.mjs +1 -1
  191. package/dist/languages/italian.mjs +1 -1
  192. package/dist/languages/japanese.mjs +1 -1
  193. package/dist/languages/kannada.mjs +1 -1
  194. package/dist/languages/kazakh.mjs +1 -1
  195. package/dist/languages/khmer.mjs +1 -1
  196. package/dist/languages/kinyarwanda.mjs +1 -1
  197. package/dist/languages/kirundi.mjs +1 -1
  198. package/dist/languages/korean.mjs +1 -1
  199. package/dist/languages/kurmanji.mjs +1 -1
  200. package/dist/languages/kyrgyz.mjs +1 -1
  201. package/dist/languages/lao.mjs +1 -1
  202. package/dist/languages/latin.mjs +1 -1
  203. package/dist/languages/latvian.mjs +1 -1
  204. package/dist/languages/lingala.mjs +1 -1
  205. package/dist/languages/lithuanian.mjs +1 -1
  206. package/dist/languages/luxembourgish.mjs +1 -1
  207. package/dist/languages/macedonian.mjs +1 -1
  208. package/dist/languages/malagasy.mjs +1 -1
  209. package/dist/languages/malay.mjs +1 -1
  210. package/dist/languages/malayalam.mjs +1 -1
  211. package/dist/languages/maltese.mjs +1 -1
  212. package/dist/languages/maori.mjs +1 -1
  213. package/dist/languages/marathi.mjs +1 -1
  214. package/dist/languages/nepali.mjs +1 -1
  215. package/dist/languages/norwegian.mjs +1 -1
  216. package/dist/languages/oromo.mjs +1 -1
  217. package/dist/languages/persian.mjs +1 -1
  218. package/dist/languages/polish.mjs +1 -1
  219. package/dist/languages/portuguese.mjs +1 -1
  220. package/dist/languages/punjabi.mjs +1 -1
  221. package/dist/languages/romanian.mjs +1 -1
  222. package/dist/languages/russian.mjs +1 -1
  223. package/dist/languages/samoan.mjs +1 -1
  224. package/dist/languages/sanskrit.mjs +1 -1
  225. package/dist/languages/scottish-gaelic.mjs +1 -1
  226. package/dist/languages/serbian.mjs +1 -1
  227. package/dist/languages/shona.mjs +1 -1
  228. package/dist/languages/sinhala.mjs +1 -1
  229. package/dist/languages/slovak.mjs +1 -1
  230. package/dist/languages/slovenian.mjs +1 -1
  231. package/dist/languages/sorani.mjs +1 -1
  232. package/dist/languages/spanish.mjs +1 -1
  233. package/dist/languages/swahili.mjs +1 -1
  234. package/dist/languages/swedish.mjs +1 -1
  235. package/dist/languages/tagalog.mjs +1 -1
  236. package/dist/languages/tamil.mjs +1 -1
  237. package/dist/languages/tatar.mjs +1 -1
  238. package/dist/languages/telugu.mjs +1 -1
  239. package/dist/languages/thai.mjs +1 -1
  240. package/dist/languages/tibetan.mjs +1 -1
  241. package/dist/languages/tigrinya.mjs +1 -1
  242. package/dist/languages/tongan.mjs +1 -1
  243. package/dist/languages/turkish.mjs +1 -1
  244. package/dist/languages/twi.mjs +1 -1
  245. package/dist/languages/ukrainian.mjs +1 -1
  246. package/dist/languages/urdu.mjs +1 -1
  247. package/dist/languages/vietnamese.mjs +1 -1
  248. package/dist/languages/welsh.mjs +1 -1
  249. package/dist/languages/wolof.mjs +1 -1
  250. package/dist/languages/xhosa.mjs +1 -1
  251. package/dist/languages/yoruba.mjs +1 -1
  252. package/dist/languages/zulu.mjs +1 -1
  253. package/dist/long-query-thread-UCRK7MSI.mjs +154 -0
  254. package/dist/module-5ZSLUQII.mjs +3729 -0
  255. package/dist/msgpack-leaf-H5ZYW7S7.mjs +9 -0
  256. package/dist/optional-reads-5HFMF2QZ.mjs +3373 -0
  257. package/dist/optional-writes-4UOQKETU.mjs +247 -0
  258. package/dist/paged-partition-archive-BBRLZCIF.mjs +253 -0
  259. package/dist/partial-words.browser.mjs +1650 -0
  260. package/dist/partial-words.mjs +17 -11
  261. package/dist/{chunk-ASY5PHYI.mjs → pattern.browser.mjs} +253 -311
  262. package/dist/pattern.mjs +6 -7
  263. package/dist/persistence/durability/checkpoint-worker.d.ts +93 -25
  264. package/dist/persistence/durability/checkpoint-worker.mjs +51 -41
  265. package/dist/phrase-module-EFESWOCR.mjs +635 -0
  266. package/dist/query-actions-HMJUVWGT.mjs +119 -0
  267. package/dist/query-suggestions/merge-worker.d.ts +55 -0
  268. package/dist/query-suggestions/merge-worker.mjs +53 -0
  269. package/dist/query-suggestions-CBYkrQ5T.d.ts +311 -0
  270. package/dist/query-suggestions.browser.mjs +47 -0
  271. package/dist/query-suggestions.d.ts +20 -0
  272. package/dist/query-suggestions.mjs +19 -0
  273. package/dist/react-native/chunks/chunk-3OEFSHVV.mjs +970 -0
  274. package/dist/{browser/chunk-RELZRJNR.mjs → react-native/chunks/chunk-43R4GCM7.mjs} +49 -50
  275. package/dist/react-native/chunks/chunk-AKRYHAVG.mjs +6729 -0
  276. package/dist/react-native/chunks/chunk-CW2ZFXSE.mjs +14 -0
  277. package/dist/react-native/chunks/chunk-G3WCDTOF.mjs +29640 -0
  278. package/dist/react-native/chunks/chunk-GXXHHA2T.mjs +212 -0
  279. package/dist/react-native/chunks/chunk-H3MDVPBO.mjs +151 -0
  280. package/dist/react-native/chunks/chunk-HQEVQEDJ.mjs +52 -0
  281. package/dist/react-native/chunks/chunk-HRDMIQ63.mjs +131 -0
  282. package/dist/react-native/chunks/chunk-HTBY4GON.mjs +565 -0
  283. package/dist/react-native/chunks/chunk-LX62Y4B5.mjs +61 -0
  284. package/dist/react-native/chunks/chunk-MRH36RN3.mjs +902 -0
  285. package/dist/react-native/chunks/chunk-Q32DDFKX.mjs +19 -0
  286. package/dist/react-native/chunks/chunk-UE4ANHSX.mjs +127 -0
  287. package/dist/react-native/chunks/chunk-UNZPWLVL.mjs +1063 -0
  288. package/dist/react-native/chunks/chunk-UO44MA5M.mjs +232 -0
  289. package/dist/react-native/chunks/chunk-UYKIV2KT.mjs +42 -0
  290. package/dist/react-native/chunks/chunk-VUJCSQG5.mjs +11 -0
  291. package/dist/react-native/chunks/chunk-WVHF4ZAK.mjs +802 -0
  292. package/dist/react-native/chunks/chunk-ZUJCUPVS.mjs +54 -0
  293. package/dist/react-native/chunks/core-leaf-S2KNBWDY.mjs +7 -0
  294. package/dist/react-native/chunks/custom-token-results-3OZEMRE7.mjs +59 -0
  295. package/dist/react-native/chunks/digest-leaf-X6OIFDIU.mjs +1 -0
  296. package/dist/react-native/chunks/durability-config-FCSD4MXY.mjs +96 -0
  297. package/dist/react-native/chunks/embed-HA2I7RCF.mjs +263 -0
  298. package/dist/react-native/chunks/geo-index-QEYKEVPH.mjs +1484 -0
  299. package/dist/react-native/chunks/gzip.react-native-CVM4NQG2.mjs +12 -0
  300. package/dist/react-native/chunks/module-FMBX75GP.mjs +5209 -0
  301. package/dist/react-native/chunks/msgpack-leaf-JMNGSTRW.mjs +7 -0
  302. package/dist/react-native/chunks/optional-reads-AFPO2FEB.mjs +3364 -0
  303. package/dist/react-native/chunks/optional-writes-XOH25XZI.mjs +296 -0
  304. package/dist/react-native/chunks/phrase-module-IGYBK7XH.mjs +636 -0
  305. package/dist/react-native/chunks/replace-IMZUVUOE.mjs +57 -0
  306. package/dist/react-native/chunks/resolve-vector-text-GE2CRJKI.mjs +84 -0
  307. package/dist/react-native/chunks/restore-queue-LLNMYB4Z.mjs +187 -0
  308. package/dist/react-native/chunks/runtime-UOHD2XUJ.mjs +615 -0
  309. package/dist/react-native/chunks/segment-codec-leaf-VR6O5GLC.mjs +13 -0
  310. package/dist/react-native/chunks/segment-merge-leaf-LLMWU4EW.mjs +14 -0
  311. package/dist/react-native/chunks/storage-leaf-JD7PIDO4.mjs +19633 -0
  312. package/dist/react-native/chunks/store-leaf-4UVCMYGN.mjs +15 -0
  313. package/dist/react-native/chunks/suggestions-leaf-J5VT5RHY.mjs +1321 -0
  314. package/dist/react-native/chunks/worker-copies-ZYHY7FKJ.mjs +2831 -0
  315. package/dist/react-native/partial-words.mjs +1658 -0
  316. package/dist/react-native/pattern.mjs +2570 -0
  317. package/dist/react-native/query-suggestions.mjs +55 -0
  318. package/dist/react-native/sync.mjs +2759 -0
  319. package/dist/react-native/synonyms.mjs +676 -0
  320. package/dist/react.d.ts +12 -8
  321. package/dist/react.mjs +45 -1
  322. package/dist/{rerank-NWTKK636.mjs → rerank-RI2PMNOD.mjs} +22 -12
  323. package/dist/rerankers/http.d.ts +1 -1
  324. package/dist/rerankers/http.mjs +2 -2
  325. package/dist/resolve-vector-text-OD4J3WHF.mjs +3 -0
  326. package/dist/restore-queue-PCKWDAKQ.mjs +192 -0
  327. package/dist/runtime-USQYKN3I.mjs +615 -0
  328. package/dist/{schema-4W_7tk1f.d.ts → schema-CzG9OUw5.d.ts} +70 -30
  329. package/dist/segment-codec-leaf-QJM7I6QG.mjs +18 -0
  330. package/dist/segment-merge-leaf-4BJGIJHY.mjs +18 -0
  331. package/dist/server.d.ts +348 -22
  332. package/dist/server.mjs +2211 -327
  333. package/dist/storage-leaf-GRRRI7UV.mjs +5962 -0
  334. package/dist/store-leaf-6VMMSVBE.mjs +20 -0
  335. package/dist/stored-values-BWIMpiT_.d.ts +25 -0
  336. package/dist/suggestions-leaf-4KPTMPTL.mjs +54 -0
  337. package/dist/sync/filesystem.d.ts +30 -0
  338. package/dist/sync/filesystem.mjs +288 -0
  339. package/dist/sync/indexeddb.browser.mjs +287 -0
  340. package/dist/sync/indexeddb.d.ts +30 -0
  341. package/dist/sync/indexeddb.mjs +242 -0
  342. package/dist/sync.browser.mjs +1271 -0
  343. package/dist/sync.d.ts +23 -0
  344. package/dist/sync.mjs +2712 -0
  345. package/dist/synonyms.browser.mjs +658 -0
  346. package/dist/synonyms.mjs +17 -7
  347. package/dist/tasks-65b6t6lk.d.ts +782 -0
  348. package/dist/thread-UJ3W5LVI.mjs +31 -0
  349. package/dist/{types-B3b68nfF.d.ts → types-Ck97nB3D.d.ts} +1 -1
  350. package/dist/types-CpCg-Gq-.d.ts +227 -0
  351. package/dist/{types-Cb9kiY5P.d.ts → types-DvncmvuQ.d.ts} +12 -1
  352. package/dist/vector/search-worker.d.ts +10 -2
  353. package/dist/vector/search-worker.mjs +11 -11
  354. package/dist/worker-copies-YSXZXIGC.mjs +2232 -0
  355. package/dist/workers/entry.mjs +75 -15
  356. package/openapi.json +6840 -0
  357. package/package.json +404 -19
  358. package/dist/browser/chunk-CN4I4FZU.mjs +0 -602
  359. package/dist/browser/chunk-HOZW3PKP.mjs +0 -9
  360. package/dist/browser/chunk-JPTQZWJQ.mjs +0 -10
  361. package/dist/browser/chunk-LD55ZGU3.mjs +0 -347
  362. package/dist/browser/chunk-NAFT3K6X.mjs +0 -24546
  363. package/dist/browser/chunk-NNG3EEB6.mjs +0 -2728
  364. package/dist/browser/chunk-QWES44AW.mjs +0 -473
  365. package/dist/browser/durability-wiring-PY3L7DES.mjs +0 -3679
  366. package/dist/browser/module-PDXYHT75.mjs +0 -2822
  367. package/dist/browser/release-76MXRPGV.mjs +0 -33
  368. package/dist/browser/restore-queue-DVIYJ7RU.mjs +0 -35
  369. package/dist/browser/snapshot-J57MZK6L.mjs +0 -1207
  370. package/dist/browser/write-L7FAQA47.mjs +0 -208
  371. package/dist/chunk-37CD3OKS.mjs +0 -87
  372. package/dist/chunk-5XNIRLFC.mjs +0 -96
  373. package/dist/chunk-7X5JST5L.mjs +0 -114
  374. package/dist/chunk-AV4IJKD2.mjs +0 -35
  375. package/dist/chunk-AY3AQ3UH.mjs +0 -73
  376. package/dist/chunk-BKB3XTMI.mjs +0 -707
  377. package/dist/chunk-C7SLA6CM.mjs +0 -19
  378. package/dist/chunk-COVCQ73F.mjs +0 -587
  379. package/dist/chunk-DJHHF2L5.mjs +0 -17
  380. package/dist/chunk-E74YLAIG.mjs +0 -24
  381. package/dist/chunk-FMWRCP2C.mjs +0 -57
  382. package/dist/chunk-GES7U2PM.mjs +0 -68
  383. package/dist/chunk-HJSN7UYG.mjs +0 -10
  384. package/dist/chunk-JFRNNBOM.mjs +0 -35
  385. package/dist/chunk-K25LZA54.mjs +0 -8484
  386. package/dist/chunk-KEHK2O6P.mjs +0 -13
  387. package/dist/chunk-KOKM4PQN.mjs +0 -52
  388. package/dist/chunk-KZ3NX2P7.mjs +0 -21
  389. package/dist/chunk-L3L5YFXC.mjs +0 -614
  390. package/dist/chunk-L5ORED7V.mjs +0 -25
  391. package/dist/chunk-LH4NZNJJ.mjs +0 -1731
  392. package/dist/chunk-LU2CE5AE.mjs +0 -507
  393. package/dist/chunk-LXWDQLTW.mjs +0 -30
  394. package/dist/chunk-MHOSCQCQ.mjs +0 -948
  395. package/dist/chunk-NKRBEGJZ.mjs +0 -1705
  396. package/dist/chunk-NTRMFARG.mjs +0 -462
  397. package/dist/chunk-NW4XDSP2.mjs +0 -212
  398. package/dist/chunk-OOEXLUGR.mjs +0 -117
  399. package/dist/chunk-ORBLD3EL.mjs +0 -6
  400. package/dist/chunk-OWNZYMRE.mjs +0 -3591
  401. package/dist/chunk-PPY2GSIB.mjs +0 -44
  402. package/dist/chunk-QY7GC2MW.mjs +0 -33
  403. package/dist/chunk-R6A773WK.mjs +0 -226
  404. package/dist/chunk-R6PR4WYZ.mjs +0 -68
  405. package/dist/chunk-R7EEKAJE.mjs +0 -593
  406. package/dist/chunk-RONEOEON.mjs +0 -426
  407. package/dist/chunk-VWULPWRJ.mjs +0 -7469
  408. package/dist/chunk-WCJKUGHB.mjs +0 -262
  409. package/dist/chunk-WQBCBKY3.mjs +0 -8
  410. package/dist/chunk-X5CV2E2B.mjs +0 -1
  411. package/dist/chunk-YA7XLE2R.mjs +0 -1256
  412. package/dist/chunk-YTJCGKM4.mjs +0 -56
  413. package/dist/chunk-ZG477IPV.mjs +0 -526
  414. package/dist/chunk-ZYNAMIYX.mjs +0 -113
  415. package/dist/config-BGB_fDtq.d.ts +0 -237
  416. package/dist/direct-executor-CXZ66ACP.mjs +0 -22
  417. package/dist/durability-wiring-QTHOGFMZ.mjs +0 -3229
  418. package/dist/engine-BGCEm9E_.d.ts +0 -577
  419. package/dist/module-3NONKBZX.mjs +0 -1860
  420. package/dist/release-BH3DKW3T.mjs +0 -33
  421. package/dist/restore-queue-JPRBUYII.mjs +0 -35
  422. package/dist/runtime-ZKYZFJJC.mjs +0 -177
  423. package/dist/snapshot-HOGXNO5W.mjs +0 -793
  424. package/dist/tasks-HG3rlxx6.d.ts +0 -302
  425. package/dist/thread-B657LQXK.mjs +0 -692
  426. package/dist/write-XLIGTXBU.mjs +0 -238
@@ -1,577 +0,0 @@
1
- import { E as EmbeddingAdapter, R as RerankAdapter } from './adapters-BQFQ4PRz.js';
2
- import { B as BatchResult, m as IndexInfo, I as IndexStats, k as PartitionStatsResult, L as ListParams, g as ListResult, Q as QueryParams, e as QueryResult, P as PreflightResult, h as SuggestParams, j as SuggestResult, D as DocumentImportResult, M as MemoryStats, V as VectorMaintenanceResult, l as NarsilEventMap } from './memory-CUEDwr-F.js';
3
- import { A as AnyDocument, a as InsertOptions, W as WriteOptions, I as IndexConfig, P as PartitionConfig } from './schema-4W_7tk1f.js';
4
- import { a as SynonymRule } from './synonyms-CpOAHPa-.js';
5
-
6
- /**
7
- * Registers the adapters that indexes and queries reach by name, which is
8
- * what lets a binding outlive a restart and reach a worker thread or another
9
- * node.
10
- *
11
- * @public
12
- */
13
- interface AdapterRegistrationOperations {
14
- /**
15
- * Registers an embedding adapter under a name that an index config can
16
- * give and that durability metadata keeps. Registering a name again binds
17
- * every index that gives that name to the new adapter.
18
- *
19
- * @param name - The name that an index config gives in `embedding.adapter`.
20
- * @param adapter - The adapter that embeds documents and queries.
21
- */
22
- registerEmbeddingAdapter(name: string, adapter: EmbeddingAdapter): void;
23
- /**
24
- * Registers a rerank adapter under a name that a query gives in
25
- * `rerank.adapter`. Registering a name again sends every later query that
26
- * gives that name to the new adapter. The engine throws
27
- * `RERANK_CONFIG_INVALID` for an empty name and for an adapter without a
28
- * `rerank` function.
29
- *
30
- * @param name - The name that a query gives in `rerank.adapter`.
31
- * @param adapter - The adapter that scores the top hits of a query.
32
- */
33
- registerRerankAdapter(name: string, adapter: RerankAdapter): void;
34
- }
35
-
36
- /**
37
- * The bytes that {@link Narsil.restore} and {@link Narsil.importDocumentExport}
38
- * accept, as one array, a stream of chunks, or an async iterable of chunks,
39
- * such as a Node.js file stream.
40
- *
41
- * @public
42
- */
43
- type ByteSource = Uint8Array | ReadableStream<Uint8Array> | AsyncIterable<Uint8Array>;
44
-
45
- /**
46
- * Opens and closes durable indexes without deleting them.
47
- *
48
- * @public
49
- */
50
- interface IndexLifecycleOperations {
51
- /**
52
- * Loads a closed index from its durable checkpoint and resets a parked recovery failure.
53
- *
54
- * @param indexName - The index to load.
55
- * @returns A promise that settles when the index is ready for operations.
56
- */
57
- open(indexName: string): Promise<void>;
58
- /**
59
- * Drains active work, checkpoints the index, releases its memory, and keeps its durable files.
60
- *
61
- * @param indexName - The index to close.
62
- * @returns A promise that settles after the index releases its memory.
63
- */
64
- close(indexName: string): Promise<void>;
65
- }
66
-
67
- /**
68
- * Reads and replaces the synonym set of an index, which
69
- * {@link IndexConfig.synonyms} sets when the index is created.
70
- *
71
- * @public
72
- */
73
- interface SynonymOperations {
74
- /**
75
- * Replaces the synonym set of an index, so that every search that starts
76
- * after the promise resolves expands its words with the new set.
77
- *
78
- * The engine applies the set without rebuilding the index, because a
79
- * synonym set changes no stored token. It saves the set with the index, so
80
- * the set stays in place after a restart, and every snapshot of the index
81
- * includes it. Where the index has copies on worker threads, the promise
82
- * resolves only once every copy uses the new set. Pass an empty list to
83
- * remove the set.
84
- *
85
- * @param indexName - The index whose set the engine replaces.
86
- * @param synonyms - The new set, in the shape that {@link SynonymRule}
87
- * describes.
88
- * @throws A `NarsilError` with `CONFIG_INVALID` when a rule breaks that
89
- * shape, when a word analyses to no token or to more than one, or when the
90
- * set passes 100,000 rules, 500,000 words, or 4,194,304 bytes of words in
91
- * UTF-8. The index then keeps the set that it held before the call.
92
- */
93
- updateSynonyms(indexName: string, synonyms: SynonymRule[]): Promise<void>;
94
- /**
95
- * Returns the synonym set of an index with every word as the caller wrote
96
- * it, or an empty list when the index holds no set.
97
- *
98
- * @param indexName - The index whose set the engine returns.
99
- */
100
- getSynonyms(indexName: string): Promise<SynonymRule[]>;
101
- }
102
-
103
- /**
104
- * Adds, replaces, and removes documents, and waits for the worker copies to
105
- * catch up with those writes.
106
- *
107
- * A write returns once the main copy holds it, and the worker copies apply
108
- * it afterwards, so a query that a copy answers can come back without a write
109
- * that returned before it. Every write takes a `wait` option for the cases
110
- * where the next query has to see it.
111
- *
112
- * @public
113
- */
114
- interface DocumentWriteOperations {
115
- /**
116
- * Adds one document to an index and returns the id it is stored under.
117
- *
118
- * The id comes from the `docId` argument when you pass one, otherwise from
119
- * the document's own `id` field, and otherwise the engine generates it. Use
120
- * {@link DocumentWriteOperations.insertBatch} for a large load, so that one
121
- * bad document cannot abandon the rest.
122
- *
123
- * @param indexName - The index that receives the document.
124
- * @param document - Its fields must match the types the schema declares.
125
- * @param docId - Pass an id to control it yourself, or omit it and read the
126
- * returned value. An id that differs from the document's own `id` field
127
- * raises `DOC_VALIDATION_FAILED`, because the stored document would
128
- * otherwise contradict the key that it is stored under.
129
- * @param options - Per-write settings, such as skipping the defensive copy
130
- * or waiting for every worker copy to apply the write.
131
- * @returns The id the document is stored under.
132
- */
133
- insert(indexName: string, document: AnyDocument, docId?: string, options?: InsertOptions): Promise<string>;
134
- /**
135
- * Adds many documents in one pass and reports each one's outcome.
136
- *
137
- * A document the engine rejects appears in `failed` with the error that
138
- * rejected it, and every other document is still written, which is what
139
- * makes this the call to load a corpus with.
140
- *
141
- * @param indexName - The index that receives the documents.
142
- * @param documents - The documents to write, each carrying its own id or
143
- * leaving the engine to generate one.
144
- * @param options - Per-write settings applied to every document.
145
- * @returns The ids written, and each rejection with its error.
146
- */
147
- insertBatch(indexName: string, documents: AnyDocument[], options?: InsertOptions): Promise<BatchResult>;
148
- /**
149
- * Removes one document.
150
- *
151
- * @param indexName - The index holding the document.
152
- * @param docId - The document to remove.
153
- * @param options - Per-write settings, such as waiting for every worker
154
- * copy to apply the removal.
155
- * @throws A `NarsilError` with `DOC_NOT_FOUND` when the index holds no such
156
- * document.
157
- */
158
- remove(indexName: string, docId: string, options?: WriteOptions): Promise<void>;
159
- /**
160
- * Removes many documents in one pass and reports each one's outcome.
161
- *
162
- * @param indexName - The index holding the documents.
163
- * @param docIds - The documents to remove.
164
- * @param options - Per-write settings applied to the whole batch.
165
- * @returns The ids removed, and each failure with its error.
166
- */
167
- removeBatch(indexName: string, docIds: string[], options?: WriteOptions): Promise<BatchResult>;
168
- /**
169
- * Replaces a stored document with the one you pass.
170
- *
171
- * The engine removes the old document and indexes the new one, so the
172
- * document you supply has to be complete, with every field it should hold
173
- * afterwards.
174
- *
175
- * @param indexName - The index holding the document.
176
- * @param docId - The document to replace.
177
- * @param document - The complete replacement.
178
- * @param options - Per-write settings, such as waiting for every worker
179
- * copy to apply the replacement.
180
- */
181
- update(indexName: string, docId: string, document: AnyDocument, options?: WriteOptions): Promise<void>;
182
- /**
183
- * Replaces many documents in one pass and reports each one's outcome.
184
- *
185
- * @param indexName - The index holding the documents.
186
- * @param updates - Each id with the complete document that replaces it.
187
- * @param options - Per-write settings applied to the whole batch.
188
- * @returns The ids replaced, and each failure with its error.
189
- */
190
- updateBatch(indexName: string, updates: Array<{
191
- docId: string;
192
- document: AnyDocument;
193
- }>, options?: WriteOptions): Promise<BatchResult>;
194
- /**
195
- * Resolves once every worker copy of an index has applied every write that
196
- * returned before the call.
197
- *
198
- * Call this after a run of writes, or pass `wait: true` on one write,
199
- * before a query that has to see them. An index that holds no copies
200
- * resolves at once.
201
- *
202
- * @param indexName - The index whose copies have to catch up.
203
- */
204
- waitForWrites(indexName: string): Promise<void>;
205
- }
206
-
207
- /**
208
- * The search engine, and everything you do with it.
209
- *
210
- * One instance holds every index you create, so an application usually keeps a
211
- * single engine for its lifetime and reaches each index by name. Build one
212
- * with {@link createNarsil}. Its write, open and close, synonym, and adapter
213
- * registration methods come from {@link DocumentWriteOperations},
214
- * {@link IndexLifecycleOperations}, {@link SynonymOperations}, and
215
- * {@link AdapterRegistrationOperations}.
216
- *
217
- * @public
218
- */
219
- interface Narsil extends IndexLifecycleOperations, DocumentWriteOperations, SynonymOperations, AdapterRegistrationOperations {
220
- /**
221
- * Creates an index you can insert documents into and query.
222
- *
223
- * The schema sets the type of each field, marks which fields you can
224
- * filter and sort on, and controls how the engine tokenises text. The
225
- * `language` option picks the analyser that stems those text fields.
226
- *
227
- * @param name - Every later call uses this name to reach the index.
228
- * @param config - This carries the schema, and the language, partitioning,
229
- * and scoring settings.
230
- */
231
- createIndex(name: string, config: IndexConfig): Promise<void>;
232
- /**
233
- * Removes an index and everything it holds, including whatever persistence
234
- * wrote for it. The documents do not come back.
235
- *
236
- * @param name - The index to drop.
237
- */
238
- dropIndex(name: string): Promise<void>;
239
- /**
240
- * Lists every index this engine holds, with its size and its language.
241
- *
242
- * @returns One entry per index, in creation order.
243
- */
244
- listIndexes(): IndexInfo[];
245
- /**
246
- * Returns one index's document count, partition count, memory estimate,
247
- * language, and schema.
248
- *
249
- * @param indexName - The index to describe.
250
- * @returns The index's current figures.
251
- * @throws A `NarsilError` with `INDEX_NOT_FOUND` for an unknown name.
252
- */
253
- getStats(indexName: string): IndexStats;
254
- /**
255
- * Returns per-partition figures for one index, which is where you look when
256
- * an index grows unevenly or a rebalance is worth running.
257
- *
258
- * @param indexName - The index to describe.
259
- * @returns One entry per open partition, in partition order, or an empty list while the index is closed.
260
- */
261
- getPartitionStats(indexName: string): PartitionStatsResult[];
262
- /**
263
- * Fetches one stored document by id, without searching.
264
- *
265
- * A vector field comes back as a `Float32Array`, whatever form you give it.
266
- * `JSON.stringify` writes one as an object keyed by index, so convert it
267
- * with `Array.from`, or project the field away, before you serialise the
268
- * document yourself. The HTTP routes convert it for you.
269
- *
270
- * @param indexName - The index holding the document.
271
- * @param docId - The document to fetch.
272
- * @returns The document, or `undefined` when the index holds no such id.
273
- */
274
- get(indexName: string, docId: string): Promise<AnyDocument | undefined>;
275
- /**
276
- * Fetches many stored documents by id in one pass.
277
- *
278
- * @param indexName - The index holding the documents.
279
- * @param docIds - The documents to fetch.
280
- * @returns A map from id to document, holding an entry for each id that
281
- * exists and nothing for the rest.
282
- */
283
- getMultiple(indexName: string, docIds: string[]): Promise<Map<string, AnyDocument>>;
284
- /**
285
- * Reports whether an index holds a document, without reading it.
286
- *
287
- * @param indexName - The index to check.
288
- * @param docId - The document to look for.
289
- * @returns True when the index holds that id.
290
- */
291
- has(indexName: string, docId: string): Promise<boolean>;
292
- /**
293
- * Counts the documents an index holds.
294
- *
295
- * @param indexName - The index to count.
296
- * @returns The document count across every partition.
297
- */
298
- countDocuments(indexName: string): Promise<number>;
299
- /**
300
- * Reads one page of stored documents in document-id order, without
301
- * searching, which is how you page through a whole index.
302
- *
303
- * Leave `cursor` out for the first page, pass the returned cursor back for
304
- * each page after it, and stop when the cursor comes back null. A document
305
- * that stays in the index for the whole listing comes back exactly once. The
306
- * engine skips a document you remove part-way through. It returns one you
307
- * insert part-way through once that document's id sorts above the cursor.
308
- * The cursor holds no engine state, so it stays valid after a restart, a
309
- * snapshot restore, and a rebalance.
310
- *
311
- * The engine compares document ids by their UTF-16 code units, so `"10"`
312
- * sorts ahead of `"9"`.
313
- *
314
- * Set `document` to drop a vector field, because the engine otherwise reads
315
- * every listed document's vector back out of the index.
316
- *
317
- * @typeParam T - Shape of the stored documents, which flows through to each
318
- * entry's `document`.
319
- * @param indexName - The index to walk.
320
- * @param params - These set the cursor, the page size, the filter, and how
321
- * much of each document comes back.
322
- * @returns The page, the cursor for the next page, how many documents the
323
- * listing walks in total, and the time the page took.
324
- */
325
- listDocuments<T = AnyDocument>(indexName: string, params?: ListParams): Promise<ListResult<T>>;
326
- /**
327
- * Runs a search against an index and returns the ranked hits.
328
- *
329
- * One call covers keyword search, vector search, and a hybrid of the two,
330
- * chosen by the `mode` parameter. BM25 ranks keyword results by default.
331
- * Every hit carries its score and its document, along with highlights when
332
- * you ask for them.
333
- *
334
- * @typeParam T - Shape of the stored documents, which flows through to each
335
- * hit's `document`.
336
- * @param indexName - The index the search runs against.
337
- * @param params - These set the search term, filters, field boosts, sorting,
338
- * facets, highlighting, and the result limit.
339
- * @returns The hits, the total count, the elapsed time, and any facets or
340
- * groups the query asked for.
341
- */
342
- query<T = AnyDocument>(indexName: string, params: QueryParams): Promise<QueryResult<T>>;
343
- /**
344
- * Counts what a query would match without building a single hit, which is
345
- * how a result-count badge stays cheap. A full-text count also skips scoring
346
- * unless the query carries `minScore`, which prunes matches by score, or a
347
- * `termMatch` policy other than `any`, which prunes them by term coverage. A
348
- * vector or hybrid count still runs its search.
349
- *
350
- * @param indexName - The index the query would run against.
351
- * @param params - The same parameters {@link Narsil.query} takes. Anything
352
- * that shapes the output alone, such as `limit` or `highlight`, is ignored.
353
- * @returns The match count and the time the count took.
354
- */
355
- preflight(indexName: string, params: QueryParams): Promise<PreflightResult>;
356
- /**
357
- * Returns the indexed terms that complete a prefix, ready to offer as
358
- * you-type suggestions.
359
- *
360
- * The terms come back as the index holds them, which means stems unless the
361
- * index was created with `surfaceForms`.
362
- *
363
- * @param indexName - The index to draw completions from.
364
- * @param params - The prefix typed so far, and how many completions to
365
- * return.
366
- * @returns The completions, most widely used first.
367
- */
368
- suggest(indexName: string, params: SuggestParams): Promise<SuggestResult>;
369
- /**
370
- * Rebuilds an index's terms from the documents it already stores, and
371
- * resolves once every partition carries terms the current language module
372
- * produced.
373
- *
374
- * An index whose stored analysis revision differs from the one its language
375
- * module carries answers text queries from terms an earlier analysis wrote,
376
- * and every such result reports `analysisStale`. Call this after the engine
377
- * reports a stale index to configuration that declined an automatic rebuild.
378
- * Calling it for an index whose terms are current does nothing.
379
- *
380
- * @param indexName - The index whose terms are rebuilt.
381
- */
382
- rebuildAnalysis(indexName: string): Promise<void>;
383
- /**
384
- * Returns a stream of the index's snapshot archive. The archive is a pax
385
- * file containing the index's configuration and the files of one
386
- * checkpoint, and any implementation of the Narsil format can restore it.
387
- *
388
- * With write-ahead log durability, the engine takes a checkpoint before it
389
- * starts the stream, so the archive contains every write that the engine
390
- * acknowledged before the call. The engine keeps that checkpoint's files on
391
- * disk until the stream ends or you cancel it. Without write-ahead log
392
- * durability, the engine builds the archive's files from the index in
393
- * memory.
394
- *
395
- * @param indexName - The index to stream.
396
- * @returns A stream of the archive's bytes, which you can write to a file or
397
- * send over a network.
398
- */
399
- snapshot(indexName: string): Promise<ReadableStream<Uint8Array>>;
400
- /**
401
- * Creates an index from a snapshot under the name that you pass, replacing
402
- * any index of that name.
403
- *
404
- * The engine accepts the archive that {@link Narsil.snapshot} streams and
405
- * the `.nrsl` file of release 0.3. It checks each archive file against its
406
- * manifest and loads the restored index beside the existing one, which
407
- * answers requests until the swap. A failed restore leaves the existing index
408
- * serving, and after a crash the engine reopens either the old or the new one.
409
- *
410
- * @param indexName - The name that the restored index takes.
411
- * @param data - The snapshot's bytes, as an array, a stream, or async chunks.
412
- * @throws A `NarsilError` with `PERSISTENCE_LOAD_FAILED` when the archive is
413
- * malformed or a file's length differs from the manifest. The engine raises
414
- * `PERSISTENCE_CRC_MISMATCH` when a file's checksum differs from its
415
- * contents, and `ENVELOPE_VERSION_MISMATCH` when a file has a format version
416
- * other than the ones that this release implements. It raises
417
- * `CONFIG_INVALID` when the archive's configuration is invalid,
418
- * `DOC_VALIDATION_FAILED` when the data is empty or the release 0.3 file is
419
- * invalid, `RESTORE_MEMORY_EXCEEDED` when the restored index needs more
420
- * memory than the process has free, and `WORKER_TIMEOUT` when a
421
- * worker still holds the old index 30 seconds after the engine asks for it.
422
- */
423
- restore(indexName: string, data: ByteSource): Promise<void>;
424
- /**
425
- * Returns a stream of the index's document export. The export is JSON Lines
426
- * text whose format stays the same in every release, so you can use it to
427
- * move an index across releases or between implementations.
428
- *
429
- * The first line is a header containing the format name, the format
430
- * version, and the index configuration. Each later line contains one
431
- * document, with its ID under `id` and the value of each vector field as an
432
- * array of numbers. With write-ahead log durability, the engine exports every
433
- * document from one checkpoint; otherwise, it exports them from the index in
434
- * memory at one moment.
435
- *
436
- * JSON has no type for a date, for raw bytes, or for an infinite number or
437
- * `NaN`, so the engine writes each such value as a tag. Each tag is an
438
- * object with one key that begins with `$`, such as
439
- * `{"$date":[1700000000,123000000]}`. The engine also wraps a stored object
440
- * whose only key begins with `$` in an `$object` tag, because the import
441
- * decodes every other object of that shape as a tag.
442
- *
443
- * @param indexName - The index to export.
444
- * @returns A stream of the export's UTF-8 bytes.
445
- */
446
- exportDocuments(indexName: string): Promise<ReadableStream<Uint8Array>>;
447
- /**
448
- * Imports a document export into the named index. Where the name is free,
449
- * the engine creates the index from the export's configuration.
450
- *
451
- * The engine writes the documents in batches and replaces any document
452
- * whose ID the index already contains. Because it replaces existing
453
- * documents, you can run an interrupted import again to make the index equal
454
- * to the export. When a line is invalid or the engine rejects its document,
455
- * the engine records the refusal and continues with the next line.
456
- *
457
- * The engine converts each tag that {@link Narsil.exportDocuments} writes
458
- * into the value that the tag stands for. When an object has one key that
459
- * begins with `$` and that key names no tag, or when a tag holds an invalid
460
- * value, the engine refuses the line.
461
- *
462
- * @param indexName - The index that receives the documents.
463
- * @param data - The export's bytes, as one array, a stream, or an async
464
- * iterable of chunks.
465
- * @returns The number of imported documents, the number of refused lines,
466
- * and the 1,000 refusals with the lowest line numbers.
467
- * @throws A `NarsilError` with `CONFIG_INVALID` when the first line is
468
- * anything other than a version 1 header, or when the named index exists
469
- * with a different schema.
470
- */
471
- importDocumentExport(indexName: string, data: ByteSource): Promise<DocumentImportResult>;
472
- /**
473
- * Writes an index's current state to the durability directory, so a restart
474
- * replays less of the log.
475
- *
476
- * @param indexName - The index to checkpoint.
477
- */
478
- checkpoint(indexName: string): Promise<void>;
479
- /**
480
- * Removes every document from an index and keeps the index itself, along
481
- * with its schema and settings.
482
- *
483
- * @param indexName - The index to empty.
484
- */
485
- clear(indexName: string): Promise<void>;
486
- /**
487
- * Spreads an index's documents across a different number of partitions.
488
- *
489
- * The engine keeps answering queries throughout, and it queues the writes
490
- * that arrive while the work runs, replaying them in order once it finishes.
491
- *
492
- * @param indexName - The index to rebalance.
493
- * @param targetPartitionCount - Partitions the index ends up with.
494
- */
495
- rebalance(indexName: string, targetPartitionCount: number): Promise<void>;
496
- /**
497
- * Changes how an index grows into new partitions, without moving the
498
- * documents it already holds.
499
- *
500
- * @param indexName - The index to reconfigure.
501
- * @param config - The partitioning fields to change. Anything you leave out
502
- * keeps its current value.
503
- */
504
- updatePartitionConfig(indexName: string, config: Partial<PartitionConfig>): Promise<void>;
505
- /**
506
- * Reports what this engine and its host process are using, which is what you
507
- * size a host from.
508
- *
509
- * @returns Process heap figures, the engine's own estimate, and one entry
510
- * per worker once the engine has promoted.
511
- */
512
- getMemoryStats(): Promise<MemoryStats>;
513
- /**
514
- * Rebuilds a vector field's graph without the tombstones removed documents
515
- * left behind, which returns the memory they held and speeds searches up.
516
- *
517
- * Read {@link Narsil.vectorMaintenanceStatus} first to see whether the work
518
- * is worth its cost.
519
- *
520
- * @param indexName - The index holding the field.
521
- * @param fieldName - The vector field to compact. Omit it to compact every
522
- * vector field in the index.
523
- */
524
- compactVectors(indexName: string, fieldName?: string): Promise<void>;
525
- /**
526
- * Rebuilds a vector field's graph from scratch, which recovers the recall a
527
- * long run of inserts and removals costs.
528
- *
529
- * This is heavier than {@link Narsil.compactVectors} and gives a better
530
- * graph, so run it once a search starts missing documents it should find,
531
- * rather than on a schedule.
532
- *
533
- * @param indexName - The index holding the field.
534
- * @param fieldName - The vector field to rebuild. Omit it to rebuild every
535
- * vector field in the index.
536
- */
537
- optimizeVectors(indexName: string, fieldName?: string): Promise<void>;
538
- /**
539
- * Reports the state of each vector field in an index, and what compaction or
540
- * optimisation would cost.
541
- *
542
- * @param indexName - The index to describe.
543
- * @returns One entry per vector field, or an empty list while the index is closed.
544
- */
545
- vectorMaintenanceStatus(indexName: string): VectorMaintenanceResult[];
546
- /**
547
- * Starts delivering one kind of engine event to your listener.
548
- *
549
- * These events report work the engine does on its own, away from the call
550
- * that triggered it, so this is where a failed background save or a worker
551
- * crash reaches you.
552
- *
553
- * @typeParam K - The event name, which fixes the payload the listener gets.
554
- * @param event - Which event to listen for.
555
- * @param handler - Called once per event.
556
- */
557
- on<K extends keyof NarsilEventMap>(event: K, handler: (payload: NarsilEventMap[K]) => void): void;
558
- /**
559
- * Removes a listener {@link Narsil.on} registered, so it receives no
560
- * further events.
561
- *
562
- * @typeParam K - The event name.
563
- * @param event - The event the listener was registered for.
564
- * @param handler - The same function reference that was registered.
565
- */
566
- off<K extends keyof NarsilEventMap>(event: K, handler: (payload: NarsilEventMap[K]) => void): void;
567
- /**
568
- * Closes the engine: it flushes pending writes, ends its workers, and
569
- * releases every adapter it opened.
570
- *
571
- * Call it before the process exits, because writes still in flight are lost
572
- * otherwise. The engine rejects new work once this starts.
573
- */
574
- shutdown(): Promise<void>;
575
- }
576
-
577
- export type { AdapterRegistrationOperations as A, ByteSource as B, DocumentWriteOperations as D, IndexLifecycleOperations as I, Narsil as N, SynonymOperations as S };