@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
@@ -0,0 +1,608 @@
1
+ import { N as NarsilConfig } from './config-CJ-jfI0a.js';
2
+ import { P as PersistenceAdapter } from './adapters-pljAqmrC.js';
3
+ import { A as AllocationConstraints, a as AllocationTable, N as NodeRole, b as NodeRegistration, C as ClusterCoordinator, c as NodeCapacity } from './index-B_vmxpgW.js';
4
+ import { N as NodeTransport } from './types-DvncmvuQ.js';
5
+
6
+ /**
7
+ * Where a cluster keeps its backups, which is a store outside the cluster.
8
+ *
9
+ * Give every node of the cluster the same settings, because the primary of each partition uploads that
10
+ * partition's files and the controller writes each backup's manifest.
11
+ *
12
+ * @public
13
+ */
14
+ interface ClusterBackupConfig {
15
+ /** The store that holds the backups, such as the adapter from `@delali/narsil/adapters/s3`. */
16
+ store: PersistenceAdapter;
17
+ /**
18
+ * This cluster writes every backup under this key prefix, and it refuses to write under a prefix that another
19
+ * cluster has written to. Use segments of letters, digits, `.`, `_`, and `-`, joined by `/`.
20
+ */
21
+ keyPrefix: string;
22
+ }
23
+ /**
24
+ * What a cluster records about one backup.
25
+ *
26
+ * @public
27
+ */
28
+ interface BackupSummary {
29
+ /** The name the backup was taken under. */
30
+ name: string;
31
+ /** The index the backup holds. */
32
+ indexName: string;
33
+ /** The backup started at this many milliseconds since the epoch, and it holds every write acknowledged before then. */
34
+ startedAt: number;
35
+ /** The controller wrote the backup's manifest at this many milliseconds since the epoch. */
36
+ completedAt: number;
37
+ /** The index had this many partitions, and a restore creates the same number. */
38
+ partitionCount: number;
39
+ /** The index kept this many replicas of each partition, and a restore asks for the same number. */
40
+ replicationFactor: number;
41
+ /** The backup lists this many stored files, counting each partition's manifest and the index configuration. */
42
+ files: number;
43
+ /** The files the backup lists hold this many bytes in total, including files that other backups share. */
44
+ bytes: number;
45
+ }
46
+ /**
47
+ * How far a backup, a restore, or a deletion has gone.
48
+ *
49
+ * @public
50
+ */
51
+ interface BackupProgress {
52
+ /** The operation has finished this many partitions, or this many files for a deletion. */
53
+ done: number;
54
+ /** The operation covers this many partitions, or this many files for a deletion, and 0 until it knows. */
55
+ total: number;
56
+ }
57
+ /**
58
+ * Options that every backup operation takes.
59
+ *
60
+ * @public
61
+ */
62
+ interface BackupOperationOptions {
63
+ /** Called whenever the operation reports more progress. */
64
+ onProgress?: (progress: BackupProgress) => void;
65
+ }
66
+ /**
67
+ * How {@link ClusterNamespace.createBackup} backs up an index.
68
+ *
69
+ * @public
70
+ */
71
+ interface CreateBackupOptions extends BackupOperationOptions {
72
+ /**
73
+ * Set this to true to add every node's popular query suggestion history of the index to the backup, so that a
74
+ * restore keeps the counts that a build reads. The history holds the scrambled text of what people searched for, and
75
+ * the backup keeps it after `retentionDays` ends, so leave it out unless the restored index needs those counts. A
76
+ * node that gives no answer adds nothing.
77
+ */
78
+ queryHistory?: boolean;
79
+ }
80
+ /**
81
+ * Where {@link ClusterNamespace.restoreBackup} puts a backup, and how the cluster places the restored copies.
82
+ *
83
+ * @public
84
+ */
85
+ interface RestoreBackupOptions extends BackupOperationOptions {
86
+ /** The restore creates the index under this name, and it fails where the name is taken. */
87
+ indexName: string;
88
+ /** The restored index keeps this many replicas of each partition, or the backup's number when you leave it out. */
89
+ replicationFactor?: number;
90
+ /** The rules that place the restored partitions, or the backup's rules when you leave them out. */
91
+ constraints?: AllocationConstraints;
92
+ }
93
+ /**
94
+ * A backup whose manifest the cluster can't read, which a listing shows in place of its summary.
95
+ *
96
+ * @public
97
+ */
98
+ interface DamagedBackup {
99
+ /** The name that the manifest is stored under. */
100
+ name: string;
101
+ /** Why the manifest can't be read, with the code `BACKUP_DAMAGED`. */
102
+ error: {
103
+ code: string;
104
+ message: string;
105
+ };
106
+ }
107
+ /**
108
+ * One entry of {@link ClusterNamespace.listBackups}: a summary, or a {@link DamagedBackup} where the manifest can't be
109
+ * read.
110
+ *
111
+ * @public
112
+ */
113
+ type BackupListing = BackupSummary | DamagedBackup;
114
+
115
+ /**
116
+ * How much replication history a primary keeps, and how many replicas have to
117
+ * confirm a write before it is acknowledged.
118
+ *
119
+ * A replica that falls further behind than the retained log recovers from a
120
+ * whole snapshot instead of replaying entries, so a larger retention trades
121
+ * memory for cheaper recovery.
122
+ *
123
+ * @public
124
+ */
125
+ interface ReplicationConfig {
126
+ /** A primary keeps this many bytes of replication log before it drops the oldest entries. */
127
+ logRetentionBytes: number;
128
+ /** This many replicas must acknowledge a write before the primary reports it as done. */
129
+ waitForActiveReplicas: number;
130
+ }
131
+
132
+ /**
133
+ * How well the cluster holds an index, or the whole cluster, from the best status to the worst.
134
+ *
135
+ * `green` means every partition is `ACTIVE` with a primary and `replicationFactor` in-sync replicas. `yellow` means
136
+ * every partition has a primary but some partition holds fewer in-sync replicas. `red` means some partition has no
137
+ * primary, so the documents that it holds can be neither read nor written. A primary or a replica counts only while
138
+ * its node stays registered with the coordinator, because a copy on a node that has left serves nothing.
139
+ *
140
+ * @public
141
+ */
142
+ type ClusterHealthStatus = 'green' | 'yellow' | 'red';
143
+ /**
144
+ * How well the cluster holds one index.
145
+ *
146
+ * @public
147
+ */
148
+ interface IndexHealth {
149
+ /** The index that the cluster holds. */
150
+ indexName: string;
151
+ /** The status of the index, which its weakest partition sets. */
152
+ status: ClusterHealthStatus;
153
+ /** The number of partitions that the index has. */
154
+ partitionCount: number;
155
+ /** The number of in-sync replicas besides the primary that each partition should keep. */
156
+ replicationFactor: number;
157
+ /** The number of partitions that have no primary. */
158
+ partitionsWithoutPrimary: number;
159
+ /** The number of partitions that have a primary but are not `ACTIVE` or hold fewer in-sync replicas than the factor. */
160
+ underReplicatedPartitions: number;
161
+ }
162
+ /**
163
+ * How well the cluster holds every index that it serves.
164
+ *
165
+ * @public
166
+ */
167
+ interface ClusterHealth {
168
+ /** The worst status of any index, or `green` for a cluster that holds no index. */
169
+ status: ClusterHealthStatus;
170
+ /** One entry per index, sorted by name. */
171
+ indexes: IndexHealth[];
172
+ }
173
+ /**
174
+ * How far one replica trails the primary of its partition.
175
+ *
176
+ * @public
177
+ */
178
+ interface ReplicaLagFigure {
179
+ /** The index that the partition belongs to. */
180
+ indexName: string;
181
+ /** The partition within that index. */
182
+ partitionId: number;
183
+ /** The node that holds the replica. */
184
+ replica: string;
185
+ /** The primary's last sequence number minus the highest sequence number that the replica acknowledged. */
186
+ lag: number;
187
+ }
188
+ /**
189
+ * What the allocation table records for one partition.
190
+ *
191
+ * @public
192
+ */
193
+ interface PartitionReplicationFigure {
194
+ /** The index that the partition belongs to. */
195
+ indexName: string;
196
+ /** The partition within that index. */
197
+ partitionId: number;
198
+ /**
199
+ * The floor on the commit point that the allocation table stores, which the controller raises only when it admits
200
+ * a replica, so it can trail the commit point of the partition's leader by many writes.
201
+ */
202
+ commitPointFloor: number;
203
+ /** The number of replicas besides the primary that are in the in-sync set. */
204
+ inSyncReplicas: number;
205
+ }
206
+ /**
207
+ * The live commit point of one partition that this node leads.
208
+ *
209
+ * @public
210
+ */
211
+ interface CommitPointFigure {
212
+ /** The index that the partition belongs to. */
213
+ indexName: string;
214
+ /** The partition within that index. */
215
+ partitionId: number;
216
+ /** The highest sequence number that this node has acknowledged to a client for the partition. */
217
+ commitPoint: number;
218
+ }
219
+ /**
220
+ * How long this node's calls to the coordinator took, for one kind of call.
221
+ *
222
+ * @public
223
+ */
224
+ interface CoordinatorRequestFigure {
225
+ /** The coordinator method that the node called, such as `getAllocation`. */
226
+ operation: string;
227
+ /** The upper bound of each bucket in seconds, in ascending order. */
228
+ bucketBoundsSeconds: number[];
229
+ /** The number of calls that took no longer than each bound, so each count includes the ones before it. */
230
+ bucketCounts: number[];
231
+ /** The number of calls, including those slower than every bound. */
232
+ count: number;
233
+ /** The total time that the calls took, in seconds. */
234
+ sumSeconds: number;
235
+ }
236
+ /**
237
+ * A vector field whose rebuild waits for memory on this node.
238
+ *
239
+ * @public
240
+ */
241
+ interface VectorRebuildWaitFigure {
242
+ /** The index that holds the vector field. */
243
+ indexName: string;
244
+ /** The vector field whose graph waits to be rebuilt. */
245
+ fieldName: string;
246
+ }
247
+ /**
248
+ * The replication and coordinator figures that one node reports.
249
+ *
250
+ * @public
251
+ */
252
+ interface ClusterMetrics {
253
+ /** The lag of each replica of each partition that this node leads. */
254
+ replicationLag: ReplicaLagFigure[];
255
+ /** The live commit point of each partition that this node leads. */
256
+ commitPoints: CommitPointFigure[];
257
+ /** The stored commit point floor and the in-sync replica count of every partition in the cluster. */
258
+ partitions: PartitionReplicationFigure[];
259
+ /** The timing of this node's coordinator calls, one entry per kind of call that the node has made. */
260
+ coordinatorRequests: CoordinatorRequestFigure[];
261
+ /**
262
+ * Each vector field on this node whose rebuild, the one that keeps recall up, waits because the node lacks the
263
+ * memory to hold a second graph beside the one it serves. The rebuild starts once the node has room.
264
+ */
265
+ vectorRebuildsWaitingForMemory: VectorRebuildWaitFigure[];
266
+ }
267
+
268
+ /**
269
+ * Everything {@link createClusterNode} needs to join a node to a cluster.
270
+ *
271
+ * The coordinator and the transport are the two pieces you choose: the
272
+ * coordinator holds the cluster's shared state, and the transport carries
273
+ * messages between nodes.
274
+ *
275
+ * @public
276
+ */
277
+ interface ClusterNodeConfig {
278
+ /** This node reads and writes the cluster's shared state here. Every node in a cluster must point at the same one. */
279
+ coordinator: ClusterCoordinator;
280
+ /** This node reaches its peers through this transport. */
281
+ transport: NodeTransport;
282
+ /** Peers reach this node at this address, as the transport writes it. */
283
+ address: string;
284
+ /** This node holds these roles in the cluster, and holds all three, `data`, `coordinator`, and `controller`, by default. */
285
+ roles?: NodeRole[];
286
+ /**
287
+ * This identifies the node across the cluster. Where you leave it out, a node
288
+ * with a durability directory generates an id once, stores it in that
289
+ * directory, and reuses it on every later start, so that the controller
290
+ * recognises the copies that the node holds after a restart. A node without a
291
+ * durability directory takes a new id on every start. An id that you set
292
+ * must hold at least one character and no unpaired surrogate, because the
293
+ * cluster hashes, sorts, and stores node ids as UTF-8, and the node refuses
294
+ * any other id with `CONFIG_INVALID`.
295
+ */
296
+ nodeId?: string;
297
+ /** This node offers this much capacity, which the allocator weighs. It offers {@link DEFAULT_CAPACITY} by default. */
298
+ capacity?: NodeCapacity;
299
+ /**
300
+ * These settings configure the engine this node runs locally, such as its persistence and durability.
301
+ *
302
+ * When the node sends or receives a copy of an index, it writes that copy to disk so that the copy never has to fit
303
+ * in memory. The copy goes into a `.snapshot-transfer` directory inside the durability directory, or into the
304
+ * system's temporary directory when the engine has no durability directory, and the node deletes it once the
305
+ * transfer ends.
306
+ */
307
+ engine?: NarsilConfig;
308
+ /** These replication settings override the engine's own, and anything you leave out keeps its value. */
309
+ replication?: Partial<ReplicationConfig>;
310
+ /** These settings govern how this node gathers each search from the cluster, and anything you leave out keeps its default. */
311
+ query?: ClusterQueryConfig;
312
+ /** These settings govern how this node stands for controller election, and anything you leave out keeps its default. */
313
+ controller?: ClusterControllerConfig;
314
+ /** These settings govern when this node's memory blocks writes across the cluster, and anything you leave out keeps its default. */
315
+ memory?: ClusterMemoryConfig;
316
+ /**
317
+ * The store outside the cluster where this node writes and reads backups. A node without it refuses every backup
318
+ * call with `BACKUP_STORE_NOT_CONFIGURED`.
319
+ */
320
+ backups?: ClusterBackupConfig;
321
+ /** This receives the failures the node reports while running on its own, away from any call you made. */
322
+ onError?: (error: Error) => void;
323
+ }
324
+ /**
325
+ * When this node counts as full, which is what makes the cluster refuse inserts and updates to every index with a
326
+ * copy on the node.
327
+ *
328
+ * The node measures its process memory and its main thread's heap once a second, and it compares the heap with the
329
+ * heap limit. On Linux, the process memory is the node's anonymous and shared resident memory, which leaves out the
330
+ * pages that the node maps from files, such as the pages of its vector files, because the kernel can drop those pages
331
+ * without ending the process. On any other system, Node.js reports only the whole resident memory, so the node counts
332
+ * all of it. The node compares the process memory with the container's memory limit where a container sets one.
333
+ * Without a container limit, a node on Linux compares it with that process memory plus the memory that the host
334
+ * reports as available, up to the host's total memory, so that the memory that other processes take counts against
335
+ * the node. A node on any other system compares it with the host's total memory. The node counts as full once either
336
+ * figure passes `blockWritesAbove` of its limit, and as clear again once both fall below `resumeWritesBelow`, so that a
337
+ * node hovering at the threshold does not switch writes on and off. Removes and searches go through while the node is
338
+ * full, which is how an operator frees memory.
339
+ *
340
+ * @public
341
+ */
342
+ interface ClusterMemoryConfig {
343
+ /**
344
+ * The node counts as full once either memory figure passes this fraction of its limit. It must lie above
345
+ * `resumeWritesBelow` and at most 1, and it is 0.9 where you name none.
346
+ *
347
+ * The node compares its heap with the smaller of this setting and 0.75. V8, the engine that runs Node.js, stops the
348
+ * process after four full collections in a row that each leave the old generation holding at least 0.8 of its limit,
349
+ * so a full node keeps its heap below that line. The node compares its process memory with the setting as it is.
350
+ */
351
+ blockWritesAbove?: number;
352
+ /**
353
+ * A full node counts as clear again once both memory figures fall below this fraction of their limits. It must lie
354
+ * above 0 and below `blockWritesAbove`, and it is 0.8 where you name none.
355
+ *
356
+ * The node compares its heap with the smaller of this setting and 0.65, for the same V8 rule that caps the heap side
357
+ * of `blockWritesAbove` at 0.75. The node compares its process memory with the setting as it is.
358
+ */
359
+ resumeWritesBelow?: number;
360
+ /**
361
+ * The node holds at most this fraction of its heap limit in the documents of inserts and updates that it has
362
+ * accepted and not yet finished, counting both the writes that clients send it and the writes that other nodes
363
+ * forward to it as primary. It refuses a write whose documents would carry that total past the limit with
364
+ * `CLUSTER_WRITE_BLOCKED`, and the error's details include the reason `write_bytes_in_flight`. It accepts a write
365
+ * of any size when no other insert or update is in progress, and it never refuses a replicated entry or a remove. The fraction must lie above 0 and at most 1, and it is 0.02 where you name none,
366
+ * which is low because indexing a document can take many times the size of its text in heap. A value of 1 allows
367
+ * writes in flight up to the whole heap limit.
368
+ */
369
+ inFlightWriteFraction?: number;
370
+ }
371
+ /**
372
+ * How long this node's turn as controller survives a fault, and how often it
373
+ * stands for election again.
374
+ *
375
+ * A cluster fails over no faster than the lease it grants the controller, so a
376
+ * demonstration lowers both figures and a busy cluster leaves them alone. Every
377
+ * controller-capable node in a cluster should carry the same pair.
378
+ *
379
+ * @public
380
+ */
381
+ interface ClusterControllerConfig {
382
+ /**
383
+ * The controller lease survives this many milliseconds without a renewal, so
384
+ * a controller that loses the coordinator keeps its claim for that long. The
385
+ * active controller renews the lease every third of this, and a standby takes
386
+ * the lease over up to {@link ClusterControllerConfig.standbyRetryMs} after it
387
+ * expires. It is 15000 milliseconds where you name none.
388
+ */
389
+ leaseTtlMs?: number;
390
+ /**
391
+ * A node that holds no lease stands for election again after this many
392
+ * milliseconds, whether the lease was taken or the coordinator refused the
393
+ * attempt. It is 5000 milliseconds where you name none.
394
+ */
395
+ standbyRetryMs?: number;
396
+ /**
397
+ * The controller waits this many milliseconds after a data node leaves
398
+ * before it moves that node's replicas to other nodes, which is 60000
399
+ * milliseconds where you set none. It promotes a replica at once for every
400
+ * partition that the node led, and a node that registers again under the
401
+ * same node id within this time keeps its replicas and catches up on the
402
+ * writes that it missed. Set 0 to move the replicas as soon as the node
403
+ * leaves.
404
+ */
405
+ nodeLeftDelayMs?: number;
406
+ }
407
+ /**
408
+ * How this node answers a search when one of the nodes it asked runs slowly or
409
+ * drops out.
410
+ *
411
+ * The defaults let a search answer from the nodes that did reply, so set
412
+ * `allowPartialResults` to false where a caller must never act on an
413
+ * incomplete count. Every search reports what it read in
414
+ * {@link QueryResult.coverage} whichever way you set these.
415
+ *
416
+ * @public
417
+ */
418
+ interface ClusterQueryConfig {
419
+ /**
420
+ * Set this true and a search returns the hits the reachable nodes gave,
421
+ * counting the rest in {@link QueryResult.coverage}, which is what a node
422
+ * does by default. Set it false, and a partition that times out or errors on
423
+ * every copy, or that has no active copy, fails the whole search with
424
+ * `QUERY_PARTIAL_FAILURE`.
425
+ */
426
+ allowPartialResults?: boolean;
427
+ /**
428
+ * A search waits this many milliseconds for each copy that it asks, and it
429
+ * asks the next in-sync copy of a partition once that wait runs out. The
430
+ * search counts the partition as timed out only when every copy has timed
431
+ * out, and the wait is 5000 milliseconds where you set none.
432
+ */
433
+ partitionTimeout?: number;
434
+ }
435
+ /**
436
+ * How an index is spread across the cluster when a node creates it.
437
+ *
438
+ * @public
439
+ */
440
+ interface CreateIndexOptions {
441
+ /** The cluster splits the index into this many partitions, and into {@link DEFAULT_PARTITION_COUNT} by default. */
442
+ partitionCount?: number;
443
+ /**
444
+ * The cluster keeps this many replicas of each partition besides its primary, and
445
+ * {@link DEFAULT_REPLICATION_FACTOR} by default.
446
+ */
447
+ replicationFactor?: number;
448
+ /**
449
+ * The creation returns once every partition is in service or once this many milliseconds have passed, which is
450
+ * 30000 where you name none. It returns either way, so a write sent after the deadline may be refused with
451
+ * `QUERY_ROUTING_FAILED` while the controller is still allocating. Pass 0 to return as soon as the schema is
452
+ * published.
453
+ */
454
+ waitForServingMs?: number;
455
+ }
456
+ /**
457
+ * Where a node stands between starting and shutting down, which is what a
458
+ * readiness probe reads.
459
+ *
460
+ * A node reports `STARTING` until it holds a registration. It reports
461
+ * `JOINING` while it bootstraps a partition the controller gave it, and
462
+ * `SERVING` once it serves every one of them. It reports `LEAVING` from the
463
+ * moment shutdown begins.
464
+ *
465
+ * @public
466
+ */
467
+ type NodeReadiness = 'STARTING' | 'JOINING' | 'SERVING' | 'LEAVING';
468
+ /**
469
+ * The cluster-facing side of a node, which is where you look at the cluster
470
+ * rather than at the data.
471
+ *
472
+ * @public
473
+ */
474
+ interface ClusterNamespace {
475
+ /**
476
+ * Reads how one index is spread across the cluster.
477
+ *
478
+ * After a change of the partition count, this returns the table of the layout that serves the index, carrying the
479
+ * index name that you passed.
480
+ *
481
+ * @param indexName - The index to describe.
482
+ * @returns Its allocation, or `null` when the index has none yet.
483
+ */
484
+ getAllocation(indexName: string): Promise<AllocationTable | null>;
485
+ /**
486
+ * Describes this node.
487
+ *
488
+ * @returns Its id, its roles, and where it stands.
489
+ */
490
+ getNodeInfo(): ClusterNodeInfo;
491
+ /**
492
+ * Reports whether this node is the cluster's active controller, which is the
493
+ * one node making allocation decisions.
494
+ *
495
+ * @returns True while this node holds the controller lease.
496
+ */
497
+ isControllerActive(): boolean;
498
+ /**
499
+ * Reports whether this node serves work, which is what a readiness probe
500
+ * answers with.
501
+ *
502
+ * @returns The node's readiness as it stands.
503
+ */
504
+ getReadiness(): NodeReadiness;
505
+ /**
506
+ * Lists the nodes the coordinator holds a registration for.
507
+ *
508
+ * @returns One registration per node, as each node published it.
509
+ */
510
+ listNodes(): Promise<NodeRegistration[]>;
511
+ /**
512
+ * Names the node holding the controller lease.
513
+ *
514
+ * @returns Its id, or `null` while no node holds the lease.
515
+ */
516
+ getControllerNodeId(): Promise<string | null>;
517
+ /**
518
+ * Changes how many replicas besides its primary each partition of an index keeps.
519
+ *
520
+ * The node sends the change to the active controller, which stores the factor in the index metadata and writes an
521
+ * allocation table that carries it before this call returns. A higher factor adds replicas, and each new copy
522
+ * catches up from its primary. A lower factor removes the surplus replicas, lagging ones first, and never the
523
+ * primary.
524
+ *
525
+ * @param indexName - The index to change.
526
+ * @param replicationFactor - The number of replicas besides the primary, an integer from 0 to 255.
527
+ * @returns A promise that settles once the controller has stored the factor and written the table.
528
+ * @throws A `NarsilError` with `CONFIG_INVALID` for a factor outside that range, with `INDEX_NOT_FOUND` where the
529
+ * cluster holds no index of that name, and with `NODE_NOT_CONTROLLER` while no node holds the controller lease.
530
+ */
531
+ setReplicationFactor(indexName: string, replicationFactor: number): Promise<void>;
532
+ /**
533
+ * Reports how well the cluster holds each index, from the allocation tables in the coordinator.
534
+ *
535
+ * @returns The status of each index and the worst of them as the status of the cluster.
536
+ */
537
+ getHealth(): Promise<ClusterHealth>;
538
+ /**
539
+ * Reports the replication lag and the live commit point of each partition that this node leads, the stored commit
540
+ * point floor and in-sync replica count of every partition in the cluster, and the timing of this node's
541
+ * coordinator calls.
542
+ *
543
+ * @returns The figures as they stand when the call reads them.
544
+ */
545
+ getMetrics(): Promise<ClusterMetrics>;
546
+ /**
547
+ * Backs up an index to the store in {@link ClusterNodeConfig.backups}, with every write acknowledged before the
548
+ * call starts.
549
+ *
550
+ * The primary of each partition writes a checkpoint and uploads each of its files that the store lacks, and the
551
+ * controller then writes the manifest that lists every file, so each backup restores without any other one.
552
+ *
553
+ * @param indexName - The index to back up.
554
+ * @param backupName - The backup's name, from 1 to 128 letters, digits, `.`, `_`, and `-`, starting with a letter or
555
+ * a digit.
556
+ * @param options - A callback that receives the progress, and whether the backup adds the index's popular query
557
+ * suggestion history.
558
+ * @returns What the manifest records about the backup.
559
+ * @throws A `NarsilError` with `BACKUP_ALREADY_EXISTS` for a name that the store or a running backup holds,
560
+ * `BACKUP_DURABILITY_REQUIRED` where a primary runs without write-ahead log durability, `BACKUP_STORE_CLAIMED`
561
+ * where another cluster writes under the key prefix, `BACKUP_STORE_NOT_CONFIGURED` on a node without a store, and
562
+ * `BACKUP_NOT_READY` while a node of the cluster runs an earlier release.
563
+ */
564
+ createBackup(indexName: string, backupName: string, options?: CreateBackupOptions): Promise<BackupSummary>;
565
+ /**
566
+ * Restores a backup as a new index, on a cluster of any size.
567
+ *
568
+ * Each primary checks the length and the SHA-256 digest of every file before it loads any of them, and the cluster
569
+ * creates no index when a check fails.
570
+ *
571
+ * @param backupName - The backup to restore.
572
+ * @param options - The name of the new index, its replication factor and placement rules, and a progress callback.
573
+ * @returns What the manifest records about the backup.
574
+ * @throws A `NarsilError` with `BACKUP_NOT_FOUND` where the store holds no such backup, `BACKUP_DAMAGED` where a
575
+ * file is missing or differs from the manifest, and `INDEX_ALREADY_EXISTS` where the name is taken.
576
+ */
577
+ restoreBackup(backupName: string, options: RestoreBackupOptions): Promise<BackupSummary>;
578
+ /**
579
+ * Lists the backups under the cluster's key prefix, in name order.
580
+ *
581
+ * @returns One summary per backup, and a {@link DamagedBackup} for each manifest that the node can't read.
582
+ */
583
+ listBackups(): Promise<BackupListing[]>;
584
+ /**
585
+ * Deletes a backup, along with each of its files that no other backup lists.
586
+ *
587
+ * @param backupName - The backup to delete.
588
+ * @param options - A callback that receives the progress.
589
+ * @returns A promise that settles once the controller has removed the manifest and those files.
590
+ * @throws A `NarsilError` with `BACKUP_NOT_FOUND` where the store holds no such backup.
591
+ */
592
+ deleteBackup(backupName: string, options?: BackupOperationOptions): Promise<void>;
593
+ }
594
+ /**
595
+ * What one node reports about itself.
596
+ *
597
+ * @public
598
+ */
599
+ interface ClusterNodeInfo {
600
+ /** This identifies the node across the cluster. */
601
+ nodeId: string;
602
+ /** The node holds these roles in the cluster. */
603
+ roles: ReadonlyArray<NodeRole>;
604
+ /** This says where the node stands, from joining through to shut down. */
605
+ status: string;
606
+ }
607
+
608
+ export type { BackupListing as B, ClusterNamespace as C, DamagedBackup as D, IndexHealth as I, NodeReadiness as N, PartitionReplicationFigure as P, ReplicaLagFigure as R, VectorRebuildWaitFigure as V, BackupSummary as a, ClusterNodeInfo as b, ClusterHealth as c, CreateIndexOptions as d, ClusterNodeConfig as e, BackupOperationOptions as f, BackupProgress as g, ClusterBackupConfig as h, ClusterControllerConfig as i, ClusterHealthStatus as j, ClusterMemoryConfig as k, ClusterMetrics as l, ClusterQueryConfig as m, CommitPointFigure as n, CoordinatorRequestFigure as o, CreateBackupOptions as p, ReplicationConfig as q, RestoreBackupOptions as r };