@delali/narsil 0.3.1-next.99 → 0.4.0

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 +27 -8
  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 +406 -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,31 @@
1
+ // src/serialization/gzip.ts
2
+ function streamOf(data) {
3
+ return new Blob([data.buffer.slice(data.byteOffset, data.byteOffset + data.byteLength)]).stream();
4
+ }
5
+ async function gzip(data) {
6
+ return new Uint8Array(await new Response(streamOf(data).pipeThrough(new CompressionStream("gzip"))).arrayBuffer());
7
+ }
8
+ async function gunzip(compressed, maxBytes = Number.POSITIVE_INFINITY) {
9
+ const reader = streamOf(compressed).pipeThrough(new DecompressionStream("gzip")).getReader();
10
+ const chunks = [];
11
+ let total = 0;
12
+ for (; ; ) {
13
+ const { done, value } = await reader.read();
14
+ if (done) break;
15
+ total += value.byteLength;
16
+ if (total > maxBytes) {
17
+ await reader.cancel();
18
+ throw Object.assign(new RangeError(`The compressed data inflates past ${maxBytes} bytes`), { code: "EFBIG" });
19
+ }
20
+ chunks.push(value);
21
+ }
22
+ const result = new Uint8Array(total);
23
+ let offset = 0;
24
+ for (const chunk of chunks) {
25
+ result.set(chunk, offset);
26
+ offset += chunk.byteLength;
27
+ }
28
+ return result;
29
+ }
30
+
31
+ export { gunzip, gzip };
@@ -1,4 +1,166 @@
1
- import { S as SchemaDefinition } from './schema-4W_7tk1f.js';
1
+ import { S as SchemaDefinition } from './schema-CzG9OUw5.js';
2
+
3
+ /**
4
+ * Where one partition stands in its move between nodes.
5
+ *
6
+ * `ACTIVE` is the steady state. `INITIALISING` means a node is still filling
7
+ * it, `MIGRATING` means it is moving, `DECOMMISSIONING` means it is being
8
+ * drained, and `UNASSIGNED` means no node holds it.
9
+ *
10
+ * @public
11
+ */
12
+ type PartitionState = 'UNASSIGNED' | 'INITIALISING' | 'ACTIVE' | 'MIGRATING' | 'DECOMMISSIONING';
13
+ /**
14
+ * Why a partition stays `UNASSIGNED` after the controller has asked its last holders for a copy.
15
+ *
16
+ * `HOLDER_OFFLINE` means a last holder has yet to register again, so the controller is still waiting for it.
17
+ * `HOLDER_UNREACHABLE` means a registered holder left the request unanswered or answered with a payload the
18
+ * controller could not read. `HOLDER_IDENTITY_MISMATCH` means a holder answered under a different index identity,
19
+ * so its copy holds the documents of an earlier index of the same name, or it keeps no copy of that name at all.
20
+ * `HOLDER_WITHOUT_DATA` means every holder answered under the coordinator's identity with a list that left the
21
+ * partition out.
22
+ *
23
+ * @public
24
+ */
25
+ type UnassignedReason = 'HOLDER_OFFLINE' | 'HOLDER_UNREACHABLE' | 'HOLDER_IDENTITY_MISMATCH' | 'HOLDER_WITHOUT_DATA';
26
+ /**
27
+ * Which nodes hold one partition, and where that partition stands.
28
+ *
29
+ * @public
30
+ */
31
+ interface PartitionAssignment {
32
+ /** This node accepts writes, and it is `null` while no node holds the partition. */
33
+ primary: string | null;
34
+ /** These nodes each hold a copy, including the primary. */
35
+ replicas: string[];
36
+ /** These replicas are current enough to be promoted, which is the set a failover picks from. */
37
+ inSyncSet: string[];
38
+ /**
39
+ * The controller raises this by 1 in every table write that changes `inSyncSet`, that accepts an in-sync removal, or
40
+ * that removes a node from `replicas`, and by 1 once where a write makes more than one of those changes. It refuses
41
+ * an admission that carries any other value, so an admission that a primary asked for before a removal, or before
42
+ * the replica left the assignment and dropped its copy, never adds the replica back. A table that an earlier release
43
+ * wrote leaves it absent, and every reader counts an absent value as 0.
44
+ */
45
+ inSyncVersion?: number;
46
+ /**
47
+ * The controller is moving the copies on these nodes elsewhere, and each one stays in `replicas` and in `inSyncSet`
48
+ * until the copies outside this list reach the replication factor in sync. The field is absent while no move is
49
+ * under way.
50
+ */
51
+ removingReplicas?: string[];
52
+ /** These nodes still hold a copy of a partition no node serves, and the field stays until the partition is `ACTIVE`. */
53
+ lastHolders?: string[];
54
+ /** This says where the partition stands in its move between nodes. */
55
+ state: PartitionState;
56
+ /** This rises each time the primary changes, which is what makes a stale primary's writes detectable. */
57
+ primaryTerm: number;
58
+ /** The primary has acknowledged every sequence number up to here, so every in-sync replica holds them. */
59
+ commitPoint: number;
60
+ /** Why the partition stays `UNASSIGNED`, which the controller records each time it asks the last holders. */
61
+ unassignedReason?: UnassignedReason;
62
+ }
63
+ /**
64
+ * How one index's partitions are spread across the cluster.
65
+ *
66
+ * @public
67
+ */
68
+ interface AllocationTable {
69
+ /** The table covers this index. */
70
+ indexName: string;
71
+ /** This rises on every change, so a writer detects that another controller got there first. */
72
+ version: number;
73
+ /** The cluster keeps this many copies of each partition. */
74
+ replicationFactor: number;
75
+ /** These assignments are keyed by partition id. */
76
+ assignments: Map<number, PartitionAssignment>;
77
+ /**
78
+ * The name of the index that serves this index name since a partition count change finished. A table that carries
79
+ * it holds no assignments, and every read, write, and metadata lookup for this name goes to that index. The field
80
+ * is absent until the first change of the partition count.
81
+ */
82
+ generation?: string;
83
+ /**
84
+ * The identity of the index that this table allocates, which the controller copies from the index metadata. When a
85
+ * node holds a table for a name and receives one with a different uuid, it takes the received table whatever the two
86
+ * versions are, because the name then refers to another index. The field is absent from a table that an earlier
87
+ * release wrote.
88
+ */
89
+ indexUuid?: string;
90
+ }
91
+ /**
92
+ * The registration that an allocation write expects a replica to hold when the write takes effect, which is how the
93
+ * controller keeps a replica that restarted after the primary proved its position out of the in-sync set.
94
+ *
95
+ * @public
96
+ */
97
+ interface ExpectedReplicaRegistration {
98
+ /** The replica's node. */
99
+ nodeId: string;
100
+ /** The `startedAt` that the replica's registration must carry, which a node writes anew on every start. */
101
+ startedAt: string;
102
+ }
103
+ /**
104
+ * Tells watchers that an index's allocation changed.
105
+ *
106
+ * @public
107
+ */
108
+ interface AllocationEvent {
109
+ /** This index's allocation changed. */
110
+ indexName: string;
111
+ /** The allocation now stands like this. */
112
+ table: AllocationTable;
113
+ }
114
+ /**
115
+ * The rules the allocator respects when it places partitions.
116
+ *
117
+ * The controller stores these with each index's metadata, so every node
118
+ * allocating that index applies the same rules.
119
+ *
120
+ * @public
121
+ */
122
+ interface AllocationConstraints {
123
+ /** Setting this spreads an index's replicas across zones, so losing one zone never costs every copy. */
124
+ zoneAwareness: boolean;
125
+ /** This names the key in a node's `metadata` that carries its zone. */
126
+ zoneAttribute: string;
127
+ /** One node may hold this many partitions of an index, and `null` lifts the ceiling. */
128
+ maxShardsPerNode: number | null;
129
+ }
130
+
131
+ /**
132
+ * Tells watchers that the stored metadata of an index changed.
133
+ *
134
+ * @public
135
+ */
136
+ interface IndexMetadataEvent {
137
+ /** This index's metadata changed. */
138
+ indexName: string;
139
+ /** These are the bytes of the new value, and they are `null` when the index was dropped. */
140
+ metadata: Uint8Array | null;
141
+ }
142
+ /**
143
+ * The coordinator's watch of index metadata.
144
+ *
145
+ * @public
146
+ */
147
+ interface IndexMetadataWatch {
148
+ /**
149
+ * Watches the stored metadata of every index, under the key that
150
+ * `_narsil/index/{indexName}/config` describes, and under no other key.
151
+ *
152
+ * For each key, the handler receives the values in the order that the store
153
+ * wrote them. After a lost connection, the coordinator lists the current
154
+ * values and delivers each one that changed, so a handler can miss an
155
+ * intermediate value and always receives the last one. A value that was
156
+ * written before the watch started fires nothing, so read what you need
157
+ * after the watch starts.
158
+ *
159
+ * @param handler - Called once per change.
160
+ * @returns A function that ends the watch.
161
+ */
162
+ watchIndexMetadata(handler: (event: IndexMetadataEvent) => void): Promise<() => void>;
163
+ }
2
164
 
3
165
  /**
4
166
  * What a node does in a cluster. A node may hold several roles at once.
@@ -31,13 +193,29 @@ interface NodeCapacity {
31
193
  * @public
32
194
  */
33
195
  interface NodeMemoryReport {
34
- /** The whole process holds this many bytes of resident memory, including vectors and segments kept outside the heap. */
196
+ /**
197
+ * The process holds this many bytes of resident memory, including the vectors and segments that it keeps outside the
198
+ * heap. On Linux, the figure counts only the anonymous and shared resident memory, which leaves out the pages that the
199
+ * process maps from files, because the kernel can drop those pages without ending the process. On any other system,
200
+ * Node.js reports only the whole resident memory, so the figure counts all of it.
201
+ */
35
202
  processBytes: number;
36
- /** The process may hold this many bytes, which is the container's memory limit or else the host's total memory. */
203
+ /**
204
+ * The process may hold this many bytes. Where a container sets a memory limit, this figure is that limit. Without one,
205
+ * a node on Linux reports `processBytes` plus the memory that the host reports as available, up to the host's total
206
+ * memory, so the figure falls whenever other processes on the host take memory. A node on any other system reports
207
+ * the host's total memory.
208
+ */
37
209
  processLimitBytes: number;
38
- /** The main thread's heap uses this many bytes. */
210
+ /**
211
+ * The main thread's old generation uses this many bytes. The old generation is the V8 heap without the young
212
+ * generation, which holds new objects until the collector empties it.
213
+ */
39
214
  heapBytes: number;
40
- /** The main thread's heap may grow to this many bytes. */
215
+ /**
216
+ * The main thread's old generation may grow to this many bytes. This is the `--max-old-space-size` figure where the
217
+ * process sets it, and otherwise V8's heap limit less the young generation's share.
218
+ */
41
219
  heapLimitBytes: number;
42
220
  /**
43
221
  * This is true while the node refuses writes, which starts once either figure passes the block fraction of its limit
@@ -85,6 +263,24 @@ interface NodeRegistration {
85
263
  * when it places copies.
86
264
  */
87
265
  partitionBytes?: IndexPartitionBytes[];
266
+ /**
267
+ * The node is leaving the cluster where this is true, so the controller places no new copy on it and moves every
268
+ * copy it holds to other nodes. An absent value counts as false.
269
+ */
270
+ draining?: boolean;
271
+ }
272
+ /**
273
+ * How long the coordinator is certain to keep holding a node's registration,
274
+ * measured from the moment the node sent the last renewal that the
275
+ * coordinator accepted.
276
+ *
277
+ * @public
278
+ */
279
+ interface RegistrationLease {
280
+ /** The registration stays held for at least this many more milliseconds, and the figure falls below zero once that time has passed. */
281
+ remainingMs: number;
282
+ /** The coordinator granted the lease for this many milliseconds, which is the lifetime that `remainingMs` counts down from. */
283
+ ttlMs: number;
88
284
  }
89
285
  /**
90
286
  * Tells watchers that a node joined or left.
@@ -100,78 +296,6 @@ interface NodeEvent {
100
296
  registration: NodeRegistration | null;
101
297
  }
102
298
 
103
- /**
104
- * Where one partition stands in its move between nodes.
105
- *
106
- * `ACTIVE` is the steady state. `INITIALISING` means a node is still filling
107
- * it, `MIGRATING` means it is moving, `DECOMMISSIONING` means it is being
108
- * drained, and `UNASSIGNED` means no node holds it.
109
- *
110
- * @public
111
- */
112
- type PartitionState = 'UNASSIGNED' | 'INITIALISING' | 'ACTIVE' | 'MIGRATING' | 'DECOMMISSIONING';
113
- /**
114
- * Why a partition stays `UNASSIGNED` after the controller has asked its last holders for a copy.
115
- *
116
- * `HOLDER_OFFLINE` means a last holder has yet to register again, so the controller is still waiting for it.
117
- * `HOLDER_UNREACHABLE` means a registered holder left the request unanswered or answered with a payload the
118
- * controller could not read. `HOLDER_IDENTITY_MISMATCH` means a holder answered under a different index identity,
119
- * so its copy holds the documents of an earlier index of the same name, or it keeps no copy of that name at all.
120
- * `HOLDER_WITHOUT_DATA` means every holder answered under the coordinator's identity with a list that left the
121
- * partition out.
122
- *
123
- * @public
124
- */
125
- type UnassignedReason = 'HOLDER_OFFLINE' | 'HOLDER_UNREACHABLE' | 'HOLDER_IDENTITY_MISMATCH' | 'HOLDER_WITHOUT_DATA';
126
- /**
127
- * Which nodes hold one partition, and where that partition stands.
128
- *
129
- * @public
130
- */
131
- interface PartitionAssignment {
132
- /** This node accepts writes, and it is `null` while no node holds the partition. */
133
- primary: string | null;
134
- /** These nodes each hold a copy, including the primary. */
135
- replicas: string[];
136
- /** These replicas are current enough to be promoted, which is the set a failover picks from. */
137
- inSyncSet: string[];
138
- /** These nodes still hold a copy of a partition no node serves, and the field stays until the partition is `ACTIVE`. */
139
- lastHolders?: string[];
140
- /** This says where the partition stands in its move between nodes. */
141
- state: PartitionState;
142
- /** This rises each time the primary changes, which is what makes a stale primary's writes detectable. */
143
- primaryTerm: number;
144
- /** The primary has acknowledged every sequence number up to here, so every in-sync replica holds them. */
145
- commitPoint: number;
146
- /** Why the partition stays `UNASSIGNED`, which the controller records each time it asks the last holders. */
147
- unassignedReason?: UnassignedReason;
148
- }
149
- /**
150
- * How one index's partitions are spread across the cluster.
151
- *
152
- * @public
153
- */
154
- interface AllocationTable {
155
- /** The table covers this index. */
156
- indexName: string;
157
- /** This rises on every change, so a writer detects that another controller got there first. */
158
- version: number;
159
- /** The cluster keeps this many copies of each partition. */
160
- replicationFactor: number;
161
- /** These assignments are keyed by partition id. */
162
- assignments: Map<number, PartitionAssignment>;
163
- }
164
- /**
165
- * Tells watchers that an index's allocation changed.
166
- *
167
- * @public
168
- */
169
- interface AllocationEvent {
170
- /** This index's allocation changed. */
171
- indexName: string;
172
- /** The allocation now stands like this. */
173
- table: AllocationTable;
174
- }
175
299
  /**
176
300
  * Tells watchers that an index's schema was published or dropped.
177
301
  *
@@ -185,22 +309,6 @@ interface SchemaEvent {
185
309
  /** This is the schema, and it is `null` when the index was dropped. */
186
310
  schema: SchemaDefinition | null;
187
311
  }
188
- /**
189
- * The rules the allocator respects when it places partitions.
190
- *
191
- * The controller stores these with each index's metadata, so every node
192
- * allocating that index applies the same rules.
193
- *
194
- * @public
195
- */
196
- interface AllocationConstraints {
197
- /** Setting this spreads an index's replicas across zones, so losing one zone never costs every copy. */
198
- zoneAwareness: boolean;
199
- /** This names the key in a node's `metadata` that carries its zone. */
200
- zoneAttribute: string;
201
- /** One node may hold this many partitions of an index, and `null` lifts the ceiling. */
202
- maxShardsPerNode: number | null;
203
- }
204
312
  /**
205
313
  * The shared state every cluster node reads and writes: which nodes exist,
206
314
  * which node holds each partition, who holds which lease, and what each
@@ -214,7 +322,7 @@ interface AllocationConstraints {
214
322
  *
215
323
  * @public
216
324
  */
217
- interface ClusterCoordinator {
325
+ interface ClusterCoordinator extends IndexMetadataWatch {
218
326
  /**
219
327
  * Publishes a node so that peers find it, and keeps it published while the
220
328
  * node heartbeats.
@@ -228,6 +336,39 @@ interface ClusterCoordinator {
228
336
  * @param nodeId - The node to remove.
229
337
  */
230
338
  deregisterNode(nodeId: string): Promise<void>;
339
+ /**
340
+ * Reports how much longer the coordinator is certain to hold a node's
341
+ * registration, which is how long the node may keep acting as a primary.
342
+ *
343
+ * A primary refuses writes with `PARTITION_NOT_PRIMARY` once this time runs
344
+ * out, because the controller may then have promoted another copy. A
345
+ * coordinator that leaves this member out gets no such fence, so a primary
346
+ * that loses touch with it keeps answering writes until it reads a newer
347
+ * allocation table.
348
+ *
349
+ * @param nodeId - The node whose registration this process wrote.
350
+ * @returns The time left and the lease lifetime it counts against, or
351
+ * `null` where this process holds no live registration for the node.
352
+ */
353
+ registrationLease?(nodeId: string): RegistrationLease | null;
354
+ /**
355
+ * Renews a node's registration lease once and reports how much longer the
356
+ * coordinator holds the registration after that renewal.
357
+ *
358
+ * A primary calls this before it refuses a write because
359
+ * {@link ClusterCoordinator.registrationLease} reports too little time
360
+ * left, so that a node whose renewals ran late behind its own work keeps
361
+ * serving. The coordinator cannot renew a lease that has already expired,
362
+ * so an accepted renewal shows that the registration stayed held
363
+ * throughout. A coordinator that leaves this member out leaves the
364
+ * primary with the reading from `registrationLease` alone.
365
+ *
366
+ * @param nodeId - The node whose registration this process wrote.
367
+ * @returns The time left after the renewal and the lease lifetime it counts
368
+ * against, or `null` where this process holds no live registration for the
369
+ * node.
370
+ */
371
+ confirmRegistrationLease?(nodeId: string): Promise<RegistrationLease | null>;
231
372
  /**
232
373
  * Lists the nodes currently published.
233
374
  *
@@ -249,17 +390,34 @@ interface ClusterCoordinator {
249
390
  */
250
391
  getAllocation(indexName: string): Promise<AllocationTable | null>;
251
392
  /**
252
- * Writes one index's allocation, optionally only while nobody else has
253
- * changed it first.
393
+ * Writes one index's allocation without checking the stored version or the
394
+ * controller lease, which only a test or an operator's repair should do.
395
+ *
396
+ * @param indexName - The index to write.
397
+ * @param table - The allocation to store.
398
+ * @returns True once the write has gone through.
399
+ */
400
+ putAllocation(indexName: string, table: AllocationTable): Promise<boolean>;
401
+ /**
402
+ * Writes one index's allocation while the stored table still carries the
403
+ * version that the caller read and the writer still holds the controller
404
+ * lease, checking those two and any replica registration that the caller
405
+ * gives in one atomic operation.
254
406
  *
255
407
  * @param indexName - The index to write.
256
408
  * @param table - The allocation to store.
257
- * @param expectedVersion - The version the caller read, `null` to write only
258
- * while no allocation exists, or omit it to write unconditionally.
259
- * @returns True when the write went through, and false when the expected
260
- * version no longer matched.
409
+ * @param expectedVersion - The version that the caller read, or `null` to
410
+ * write only while the index has no allocation yet.
411
+ * @param writerNodeId - The node that writes the table, which must hold the
412
+ * `_narsil/controller` lease when the write takes effect.
413
+ * @param replicaRegistration - A replica whose registration must carry the
414
+ * given `startedAt` when the write takes effect, which the controller
415
+ * passes when the write admits that replica to the in-sync set.
416
+ * @returns True when the write went through, and false when the stored
417
+ * version no longer matched, the writer did not hold the controller lease,
418
+ * or the replica was not registered with that `startedAt`.
261
419
  */
262
- putAllocation(indexName: string, table: AllocationTable, expectedVersion?: number | null): Promise<boolean>;
420
+ putAllocation(indexName: string, table: AllocationTable, expectedVersion: number | null, writerNodeId: string, replicaRegistration?: ExpectedReplicaRegistration): Promise<boolean>;
263
421
  /**
264
422
  * Removes one index's allocation, which is the last step of dropping the
265
423
  * index. Deleting an allocation that does not exist does nothing.
@@ -389,4 +547,4 @@ interface ClusterCoordinator {
389
547
  shutdown(): Promise<void>;
390
548
  }
391
549
 
392
- export type { AllocationTable as A, ClusterCoordinator as C, IndexPartitionBytes as I, NodeRole as N, PartitionAssignment as P, SchemaEvent as S, UnassignedReason as U, NodeRegistration as a, NodeCapacity as b, AllocationConstraints as c, AllocationEvent as d, NodeEvent as e, NodeMemoryReport as f, PartitionState as g };
550
+ export type { AllocationConstraints as A, ClusterCoordinator as C, ExpectedReplicaRegistration as E, IndexMetadataEvent as I, NodeRole as N, PartitionAssignment as P, RegistrationLease as R, SchemaEvent as S, UnassignedReason as U, AllocationTable as a, NodeRegistration as b, NodeCapacity as c, NodeMemoryReport as d, AllocationEvent as e, IndexMetadataWatch as f, IndexPartitionBytes as g, NodeEvent as h, PartitionState as i };
@@ -1,4 +1,4 @@
1
- export { VERSION, clearNormalizationCache, configureNormalizationCache, createNarsil, getLanguage, getNormalizationCacheSize, getStopWords, getTokenizer, hasStopWords, hasTokenizer, registerLanguage, registerPartialWordSearch, registerPatternSearch, registerStopWords, registerSynonyms, registerTokenizer, resetNormalizationCache } from './browser/chunk-NAFT3K6X.mjs';
2
- export { isSimdAvailable } from './browser/chunk-QWES44AW.mjs';
3
- import './browser/chunk-JPTQZWJQ.mjs';
4
- export { ClientErrorCodes, ErrorCodes, NarsilError, ServerErrorCodes, isNarsilError } from './browser/chunk-RELZRJNR.mjs';
1
+ export { VERSION, clearNormalizationCache, configureNormalizationCache, createNarsil, getLanguage, getNormalizationCacheSize, getStopWords, getTokenizer, hasStopWords, hasTokenizer, isSimdAvailable, registerLanguage, registerPartialWordSearch, registerPatternSearch, registerStopWords, registerSynonyms, registerTokenizer, resetNormalizationCache } from './browser/chunk-NDYADQ4Y.mjs';
2
+ import './browser/chunk-QAOVAYAG.mjs';
3
+ import './browser/chunk-YJHGOJAC.mjs';
4
+ export { ClientErrorCodes, ErrorCodes, NarsilError, ServerErrorCodes, isNarsilError } from './browser/chunk-YINZFPLT.mjs';