@delali/narsil 0.1.15 → 0.2.1-next.25

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 (267) hide show
  1. package/NOTICE +54 -0
  2. package/README.md +38 -982
  3. package/dist/adapters/filesystem.d.ts +23 -1
  4. package/dist/adapters/filesystem.mjs +1 -1
  5. package/dist/adapters/indexeddb.d.ts +25 -1
  6. package/dist/adapters/indexeddb.mjs +1 -1
  7. package/dist/adapters/memory.d.ts +14 -1
  8. package/dist/adapters-CVqI5NBt.d.ts +149 -0
  9. package/dist/{chunk-HMO6OMZ3.mjs → chunk-ASI6AOW2.mjs} +1073 -506
  10. package/dist/{chunk-HRABJLPB.mjs → chunk-BKAI2WXI.mjs} +1 -0
  11. package/dist/{chunk-WISGW24C.mjs → chunk-FKK76OR7.mjs} +56 -55
  12. package/dist/chunk-GHJWC2E5.mjs +9 -0
  13. package/dist/chunk-KH3YGMVT.mjs +15 -0
  14. package/dist/chunk-TGP5M5R7.mjs +880 -0
  15. package/dist/chunk-U2BKYEC7.mjs +254 -0
  16. package/dist/{chunk-ALB35PRQ.mjs → chunk-UNJZ7ZDB.mjs} +18 -0
  17. package/dist/{chunk-MEW7HD75.mjs → chunk-WLR5BFL3.mjs} +2557 -1166
  18. package/dist/config-CAjTHzkH.d.ts +256 -0
  19. package/dist/direct-executor-3W4QRA4E.mjs +5 -0
  20. package/dist/distribution/coordinator/etcd.d.ts +44 -3
  21. package/dist/distribution/coordinator/etcd.mjs +2 -2
  22. package/dist/distribution/coordinator/in-memory.d.ts +14 -3
  23. package/dist/distribution.d.ts +318 -45
  24. package/dist/distribution.mjs +1875 -1772
  25. package/dist/embeddings/openai.d.ts +28 -1
  26. package/dist/embeddings/openai.mjs +1 -1
  27. package/dist/engine-CCrlfLyq.d.ts +431 -0
  28. package/dist/index.browser.mjs +4571 -1776
  29. package/dist/index.d.ts +180 -6
  30. package/dist/index.mjs +6 -5
  31. package/dist/invalidation/broadcast-channel.d.ts +20 -1
  32. package/dist/invalidation/filesystem.d.ts +24 -1
  33. package/dist/invalidation/noop.d.ts +14 -1
  34. package/dist/language-DB8KG1z5.d.ts +53 -0
  35. package/dist/languages/albanian.d.ts +15 -0
  36. package/dist/languages/albanian.mjs +103 -0
  37. package/dist/languages/amharic.d.ts +15 -0
  38. package/dist/languages/amharic.mjs +240 -0
  39. package/dist/languages/arabic.d.ts +10 -1
  40. package/dist/languages/arabic.mjs +939 -154
  41. package/dist/languages/armenian.d.ts +10 -1
  42. package/dist/languages/armenian.mjs +275 -243
  43. package/dist/languages/azerbaijani.d.ts +15 -0
  44. package/dist/languages/azerbaijani.mjs +152 -0
  45. package/dist/languages/bambara.d.ts +15 -0
  46. package/dist/languages/bambara.mjs +60 -0
  47. package/dist/languages/basque.d.ts +14 -0
  48. package/dist/languages/basque.mjs +726 -0
  49. package/dist/languages/belarusian.d.ts +15 -0
  50. package/dist/languages/belarusian.mjs +100 -0
  51. package/dist/languages/bengali.d.ts +15 -0
  52. package/dist/languages/bengali.mjs +128 -0
  53. package/dist/languages/bosnian.d.ts +15 -0
  54. package/dist/languages/bosnian.mjs +197 -0
  55. package/dist/languages/breton.d.ts +15 -0
  56. package/dist/languages/breton.mjs +96 -0
  57. package/dist/languages/bulgarian.d.ts +10 -1
  58. package/dist/languages/bulgarian.mjs +11 -2
  59. package/dist/languages/burmese.d.ts +15 -0
  60. package/dist/languages/burmese.mjs +57 -0
  61. package/dist/languages/catalan.d.ts +14 -0
  62. package/dist/languages/catalan.mjs +987 -0
  63. package/dist/languages/chinese.d.ts +11 -1
  64. package/dist/languages/chinese.mjs +4 -3
  65. package/dist/languages/croatian.d.ts +15 -0
  66. package/dist/languages/croatian.mjs +191 -0
  67. package/dist/languages/czech.d.ts +14 -0
  68. package/dist/languages/czech.mjs +628 -0
  69. package/dist/languages/dagbani.d.ts +11 -1
  70. package/dist/languages/dagbani.mjs +11 -2
  71. package/dist/languages/danish.d.ts +10 -1
  72. package/dist/languages/danish.mjs +215 -110
  73. package/dist/languages/dutch.d.ts +10 -1
  74. package/dist/languages/dutch.mjs +1248 -163
  75. package/dist/languages/english.d.ts +10 -1
  76. package/dist/languages/english.mjs +2 -1
  77. package/dist/languages/esperanto.d.ts +14 -0
  78. package/dist/languages/esperanto.mjs +689 -0
  79. package/dist/languages/estonian.d.ts +14 -0
  80. package/dist/languages/estonian.mjs +2160 -0
  81. package/dist/languages/ewe.d.ts +11 -1
  82. package/dist/languages/ewe.mjs +11 -2
  83. package/dist/languages/faroese.d.ts +15 -0
  84. package/dist/languages/faroese.mjs +93 -0
  85. package/dist/languages/fijian.d.ts +15 -0
  86. package/dist/languages/fijian.mjs +55 -0
  87. package/dist/languages/finnish.d.ts +10 -1
  88. package/dist/languages/finnish.mjs +528 -263
  89. package/dist/languages/french.d.ts +10 -1
  90. package/dist/languages/french.mjs +950 -437
  91. package/dist/languages/ga.d.ts +11 -1
  92. package/dist/languages/ga.mjs +2 -1
  93. package/dist/languages/galician.d.ts +15 -0
  94. package/dist/languages/galician.mjs +172 -0
  95. package/dist/languages/georgian.d.ts +15 -0
  96. package/dist/languages/georgian.mjs +91 -0
  97. package/dist/languages/german.d.ts +10 -1
  98. package/dist/languages/german.mjs +432 -162
  99. package/dist/languages/greek.d.ts +10 -1
  100. package/dist/languages/greek.mjs +1970 -281
  101. package/dist/languages/guarani.d.ts +15 -0
  102. package/dist/languages/guarani.mjs +132 -0
  103. package/dist/languages/gujarati.d.ts +15 -0
  104. package/dist/languages/gujarati.mjs +234 -0
  105. package/dist/languages/haitian-creole.d.ts +15 -0
  106. package/dist/languages/haitian-creole.mjs +106 -0
  107. package/dist/languages/hausa.d.ts +11 -1
  108. package/dist/languages/hausa.mjs +2 -1
  109. package/dist/languages/hawaiian.d.ts +15 -0
  110. package/dist/languages/hawaiian.mjs +69 -0
  111. package/dist/languages/hebrew.d.ts +15 -0
  112. package/dist/languages/hebrew.mjs +213 -0
  113. package/dist/languages/hindi.d.ts +10 -1
  114. package/dist/languages/hindi.mjs +175 -97
  115. package/dist/languages/hungarian.d.ts +10 -1
  116. package/dist/languages/hungarian.mjs +412 -326
  117. package/dist/languages/icelandic.d.ts +15 -0
  118. package/dist/languages/icelandic.mjs +161 -0
  119. package/dist/languages/igbo.d.ts +11 -1
  120. package/dist/languages/igbo.mjs +2 -1
  121. package/dist/languages/indonesian.d.ts +10 -1
  122. package/dist/languages/indonesian.mjs +329 -137
  123. package/dist/languages/irish.d.ts +10 -1
  124. package/dist/languages/irish.mjs +223 -139
  125. package/dist/languages/italian.d.ts +10 -1
  126. package/dist/languages/italian.mjs +703 -406
  127. package/dist/languages/japanese.d.ts +11 -1
  128. package/dist/languages/japanese.mjs +5 -108
  129. package/dist/languages/kannada.d.ts +15 -0
  130. package/dist/languages/kannada.mjs +94 -0
  131. package/dist/languages/kazakh.d.ts +15 -0
  132. package/dist/languages/kazakh.mjs +90 -0
  133. package/dist/languages/khmer.d.ts +15 -0
  134. package/dist/languages/khmer.mjs +181 -0
  135. package/dist/languages/kinyarwanda.d.ts +15 -0
  136. package/dist/languages/kinyarwanda.mjs +99 -0
  137. package/dist/languages/kirundi.d.ts +15 -0
  138. package/dist/languages/kirundi.mjs +92 -0
  139. package/dist/languages/korean.d.ts +15 -0
  140. package/dist/languages/korean.mjs +252 -0
  141. package/dist/languages/kurmanji.d.ts +15 -0
  142. package/dist/languages/kurmanji.mjs +50 -0
  143. package/dist/languages/kyrgyz.d.ts +15 -0
  144. package/dist/languages/kyrgyz.mjs +108 -0
  145. package/dist/languages/lao.d.ts +15 -0
  146. package/dist/languages/lao.mjs +63 -0
  147. package/dist/languages/latin.d.ts +15 -0
  148. package/dist/languages/latin.mjs +69 -0
  149. package/dist/languages/latvian.d.ts +15 -0
  150. package/dist/languages/latvian.mjs +173 -0
  151. package/dist/languages/lingala.d.ts +15 -0
  152. package/dist/languages/lingala.mjs +61 -0
  153. package/dist/languages/lithuanian.d.ts +14 -0
  154. package/dist/languages/lithuanian.mjs +571 -0
  155. package/dist/languages/luxembourgish.d.ts +15 -0
  156. package/dist/languages/luxembourgish.mjs +214 -0
  157. package/dist/languages/macedonian.d.ts +15 -0
  158. package/dist/languages/macedonian.mjs +808 -0
  159. package/dist/languages/malagasy.d.ts +15 -0
  160. package/dist/languages/malagasy.mjs +67 -0
  161. package/dist/languages/malay.d.ts +15 -0
  162. package/dist/languages/malay.mjs +482 -0
  163. package/dist/languages/malayalam.d.ts +15 -0
  164. package/dist/languages/malayalam.mjs +122 -0
  165. package/dist/languages/maltese.d.ts +15 -0
  166. package/dist/languages/maltese.mjs +139 -0
  167. package/dist/languages/maori.d.ts +15 -0
  168. package/dist/languages/maori.mjs +79 -0
  169. package/dist/languages/marathi.d.ts +15 -0
  170. package/dist/languages/marathi.mjs +111 -0
  171. package/dist/languages/nepali.d.ts +10 -1
  172. package/dist/languages/nepali.mjs +209 -99
  173. package/dist/languages/norwegian.d.ts +10 -1
  174. package/dist/languages/norwegian.mjs +218 -85
  175. package/dist/languages/oromo.d.ts +15 -0
  176. package/dist/languages/oromo.mjs +78 -0
  177. package/dist/languages/persian.d.ts +14 -0
  178. package/dist/languages/persian.mjs +710 -0
  179. package/dist/languages/polish.d.ts +14 -0
  180. package/dist/languages/polish.mjs +614 -0
  181. package/dist/languages/portuguese.d.ts +10 -1
  182. package/dist/languages/portuguese.mjs +613 -380
  183. package/dist/languages/punjabi.d.ts +15 -0
  184. package/dist/languages/punjabi.mjs +197 -0
  185. package/dist/languages/romanian.d.ts +10 -1
  186. package/dist/languages/romanian.mjs +561 -382
  187. package/dist/languages/russian.d.ts +10 -1
  188. package/dist/languages/russian.mjs +373 -244
  189. package/dist/languages/samoan.d.ts +15 -0
  190. package/dist/languages/samoan.mjs +63 -0
  191. package/dist/languages/sanskrit.d.ts +10 -1
  192. package/dist/languages/sanskrit.mjs +2 -2
  193. package/dist/languages/scottish-gaelic.d.ts +15 -0
  194. package/dist/languages/scottish-gaelic.mjs +370 -0
  195. package/dist/languages/serbian.d.ts +10 -1
  196. package/dist/languages/serbian.mjs +3635 -155
  197. package/dist/languages/shona.d.ts +15 -0
  198. package/dist/languages/shona.mjs +91 -0
  199. package/dist/languages/sinhala.d.ts +15 -0
  200. package/dist/languages/sinhala.mjs +182 -0
  201. package/dist/languages/slovak.d.ts +15 -0
  202. package/dist/languages/slovak.mjs +430 -0
  203. package/dist/languages/slovenian.d.ts +10 -1
  204. package/dist/languages/slovenian.mjs +11 -2
  205. package/dist/languages/sorani.d.ts +15 -0
  206. package/dist/languages/sorani.mjs +156 -0
  207. package/dist/languages/spanish.d.ts +10 -1
  208. package/dist/languages/spanish.mjs +676 -374
  209. package/dist/languages/swahili.d.ts +10 -1
  210. package/dist/languages/swahili.mjs +2 -1
  211. package/dist/languages/swedish.d.ts +10 -1
  212. package/dist/languages/swedish.mjs +237 -95
  213. package/dist/languages/tagalog.d.ts +15 -0
  214. package/dist/languages/tagalog.mjs +159 -0
  215. package/dist/languages/tamil.d.ts +10 -1
  216. package/dist/languages/tamil.mjs +836 -64
  217. package/dist/languages/tatar.d.ts +15 -0
  218. package/dist/languages/tatar.mjs +1017 -0
  219. package/dist/languages/telugu.d.ts +15 -0
  220. package/dist/languages/telugu.mjs +62 -0
  221. package/dist/languages/thai.d.ts +15 -0
  222. package/dist/languages/thai.mjs +65 -0
  223. package/dist/languages/tibetan.d.ts +15 -0
  224. package/dist/languages/tibetan.mjs +119 -0
  225. package/dist/languages/tigrinya.d.ts +15 -0
  226. package/dist/languages/tigrinya.mjs +194 -0
  227. package/dist/languages/tongan.d.ts +15 -0
  228. package/dist/languages/tongan.mjs +56 -0
  229. package/dist/languages/turkish.d.ts +10 -1
  230. package/dist/languages/turkish.mjs +1246 -393
  231. package/dist/languages/twi.d.ts +11 -1
  232. package/dist/languages/twi.mjs +13 -2
  233. package/dist/languages/ukrainian.d.ts +10 -1
  234. package/dist/languages/ukrainian.mjs +125 -47
  235. package/dist/languages/urdu.d.ts +15 -0
  236. package/dist/languages/urdu.mjs +528 -0
  237. package/dist/languages/vietnamese.d.ts +15 -0
  238. package/dist/languages/vietnamese.mjs +277 -0
  239. package/dist/languages/welsh.d.ts +15 -0
  240. package/dist/languages/welsh.mjs +446 -0
  241. package/dist/languages/wolof.d.ts +15 -0
  242. package/dist/languages/wolof.mjs +79 -0
  243. package/dist/languages/xhosa.d.ts +15 -0
  244. package/dist/languages/xhosa.mjs +95 -0
  245. package/dist/languages/yoruba.d.ts +11 -1
  246. package/dist/languages/yoruba.mjs +1 -0
  247. package/dist/languages/zulu.d.ts +11 -1
  248. package/dist/languages/zulu.mjs +2 -1
  249. package/dist/persistence/durability/checkpoint-worker.d.ts +13 -0
  250. package/dist/persistence/durability/checkpoint-worker.mjs +6 -5
  251. package/dist/schema-CE6S_aAr.d.ts +208 -0
  252. package/dist/search-CgQQIciB.d.ts +786 -0
  253. package/dist/server.d.ts +214 -12
  254. package/dist/server.mjs +41 -2
  255. package/dist/types-BV3nAKTL.d.ts +302 -0
  256. package/dist/vector/hnsw-build-worker.d.ts +68 -2
  257. package/dist/vector/hnsw-build-worker.mjs +0 -2
  258. package/dist/workers/entry.mjs +2 -2
  259. package/package.json +14 -4
  260. package/dist/adapters-Bo2JQg8b.d.ts +0 -37
  261. package/dist/chunk-TW6BXTOL.mjs +0 -338
  262. package/dist/config-CojEPOgS.d.ts +0 -481
  263. package/dist/direct-executor-E52FFGDE.mjs +0 -4
  264. package/dist/language-ONQ3iVDf.d.ts +0 -14
  265. package/dist/narsil-D-84Nvm4.d.ts +0 -72
  266. package/dist/schema-DCgkO1j4.d.ts +0 -65
  267. package/dist/types-DHX6zGeD.d.ts +0 -73
@@ -0,0 +1,15 @@
1
+ import { L as LanguageModule } from '../language-DB8KG1z5.js';
2
+
3
+ /**
4
+ * Wolof analysis: the stop word list and the rules that split Wolof
5
+ * text into tokens. Tokens are indexed as the normaliser leaves them,
6
+ * without stemming.
7
+ *
8
+ * Import it and pass it to {@link registerLanguage} before you create an index
9
+ * whose `language` is `wolof`.
10
+ *
11
+ * @public
12
+ */
13
+ declare const wolof: LanguageModule;
14
+
15
+ export { wolof };
@@ -0,0 +1,79 @@
1
+ // src/languages/wolof.ts
2
+ var stopWords = /* @__PURE__ */ new Set([
3
+ "ak",
4
+ "am",
5
+ "ba",
6
+ "ban",
7
+ "beneen",
8
+ "benn",
9
+ "bi",
10
+ "bii",
11
+ "boobu",
12
+ "bu",
13
+ "ca",
14
+ "ci",
15
+ "dafa",
16
+ "dina",
17
+ "du",
18
+ "fa",
19
+ "fi",
20
+ "fu",
21
+ "gi",
22
+ "it",
23
+ "itam",
24
+ "ji",
25
+ "ki",
26
+ "kon",
27
+ "ku",
28
+ "la",
29
+ "l\xE9pp",
30
+ "li",
31
+ "lool",
32
+ "lu",
33
+ "ma",
34
+ "man",
35
+ "mi",
36
+ "moom",
37
+ "mu",
38
+ "na",
39
+ "naa",
40
+ "na\xF1u",
41
+ "ndax",
42
+ "ndaxte",
43
+ "ne",
44
+ "\xF1\xE9pp",
45
+ "nga",
46
+ "ngeen",
47
+ "ni",
48
+ "\xF1i",
49
+ "\xF1oom",
50
+ "\xF1u",
51
+ "nun",
52
+ "rekk",
53
+ "sa",
54
+ "sama",
55
+ "seen",
56
+ "si",
57
+ "su",
58
+ "sunu",
59
+ "te",
60
+ "waaye",
61
+ "walla",
62
+ "wi",
63
+ "yeen",
64
+ "yeneen",
65
+ "y\xE9pp",
66
+ "yi",
67
+ "yii",
68
+ "yooyu",
69
+ "yow"
70
+ ]);
71
+ var wolof = {
72
+ name: "wolof",
73
+ revision: "1",
74
+ stemmer: null,
75
+ stopWords,
76
+ tokenizer: { splitPattern: /[^\p{Script=Latin}0-9]+/giu }
77
+ };
78
+
79
+ export { wolof };
@@ -0,0 +1,15 @@
1
+ import { L as LanguageModule } from '../language-DB8KG1z5.js';
2
+
3
+ /**
4
+ * Xhosa analysis: the stop word list and the rules that split Xhosa
5
+ * text into tokens. Tokens are indexed as the normaliser leaves them,
6
+ * without stemming.
7
+ *
8
+ * Import it and pass it to {@link registerLanguage} before you create an index
9
+ * whose `language` is `xhosa`.
10
+ *
11
+ * @public
12
+ */
13
+ declare const xhosa: LanguageModule;
14
+
15
+ export { xhosa };
@@ -0,0 +1,95 @@
1
+ // src/languages/xhosa.ts
2
+ var stopWords = /* @__PURE__ */ new Set([
3
+ "aba",
4
+ "abanye",
5
+ "abo",
6
+ "apho",
7
+ "bakhe",
8
+ "bona",
9
+ "bonke",
10
+ "eli",
11
+ "elo",
12
+ "emva",
13
+ "enye",
14
+ "esi",
15
+ "eso",
16
+ "ezi",
17
+ "ezinye",
18
+ "ezo",
19
+ "kakhulu",
20
+ "kamva",
21
+ "kancinci",
22
+ "kanye",
23
+ "ke",
24
+ "kodwa",
25
+ "konke",
26
+ "kuba",
27
+ "kunye",
28
+ "kwaye",
29
+ "la",
30
+ "lakhe",
31
+ "le",
32
+ "leyo",
33
+ "lo",
34
+ "lonke",
35
+ "lowo",
36
+ "malunga",
37
+ "mna",
38
+ "na",
39
+ "nangona",
40
+ "ngaphakathi",
41
+ "ngaphandle",
42
+ "ngenxa",
43
+ "ngoku",
44
+ "ngokuba",
45
+ "nina",
46
+ "nje",
47
+ "okanye",
48
+ "oko",
49
+ "oku",
50
+ "olo",
51
+ "olu",
52
+ "omnye",
53
+ "phakathi",
54
+ "phambi",
55
+ "phambili",
56
+ "phantsi",
57
+ "phezulu",
58
+ "sakhe",
59
+ "sonke",
60
+ "thina",
61
+ "ukuba",
62
+ "ukuze",
63
+ "wabo",
64
+ "wakhe",
65
+ "wakho",
66
+ "wam",
67
+ "wena",
68
+ "wenu",
69
+ "wethu",
70
+ "xa",
71
+ "yabo",
72
+ "yakhe",
73
+ "yakho",
74
+ "yam",
75
+ "yena",
76
+ "yenu",
77
+ "yethu",
78
+ "yonke",
79
+ "zabo",
80
+ "zakhe",
81
+ "zakho",
82
+ "zam",
83
+ "zenu",
84
+ "zethu",
85
+ "zonke"
86
+ ]);
87
+ var xhosa = {
88
+ name: "xhosa",
89
+ revision: "1",
90
+ stemmer: null,
91
+ stopWords,
92
+ tokenizer: { splitPattern: /[^a-z0-9-]+/gi }
93
+ };
94
+
95
+ export { xhosa };
@@ -1,5 +1,15 @@
1
- import { L as LanguageModule } from '../language-ONQ3iVDf.js';
1
+ import { L as LanguageModule } from '../language-DB8KG1z5.js';
2
2
 
3
+ /**
4
+ * Yoruba analysis: the stop word list and the rules that split Yoruba
5
+ * text into tokens. Tokens are indexed as the normaliser leaves them,
6
+ * without stemming.
7
+ *
8
+ * Import it and pass it to {@link registerLanguage} before you create an index
9
+ * whose `language` is `yoruba`.
10
+ *
11
+ * @public
12
+ */
3
13
  declare const yoruba: LanguageModule;
4
14
 
5
15
  export { yoruba };
@@ -91,6 +91,7 @@ var stopWords = /* @__PURE__ */ new Set([
91
91
  ]);
92
92
  var yoruba = {
93
93
  name: "yoruba",
94
+ revision: "1",
94
95
  stemmer: null,
95
96
  stopWords,
96
97
  tokenizer: {
@@ -1,5 +1,15 @@
1
- import { L as LanguageModule } from '../language-ONQ3iVDf.js';
1
+ import { L as LanguageModule } from '../language-DB8KG1z5.js';
2
2
 
3
+ /**
4
+ * Zulu analysis: the stop word list and the rules that split Zulu
5
+ * text into tokens. Tokens are indexed as the normaliser leaves them,
6
+ * without stemming.
7
+ *
8
+ * Import it and pass it to {@link registerLanguage} before you create an index
9
+ * whose `language` is `zulu`.
10
+ *
11
+ * @public
12
+ */
3
13
  declare const zulu: LanguageModule;
4
14
 
5
15
  export { zulu };
@@ -101,10 +101,11 @@ var stopWords = /* @__PURE__ */ new Set([
101
101
  ]);
102
102
  var zulu = {
103
103
  name: "zulu",
104
+ revision: "1",
104
105
  stemmer: null,
105
106
  stopWords,
106
107
  tokenizer: {
107
- splitPattern: /[^a-zA-Z0-9]+/gi,
108
+ splitPattern: /[^a-zA-Z0-9-]+/gi,
108
109
  normalizeDiacritics: false,
109
110
  minTokenLength: 1
110
111
  }
@@ -1,3 +1,6 @@
1
+ import { P as PartitionConfig, c as ScoringMode, V as VectorIndexConfig } from '../../schema-CE6S_aAr.js';
2
+ import '../../adapters-CVqI5NBt.js';
3
+
1
4
  interface IndexMetadata {
2
5
  indexName: string;
3
6
  schema: Record<string, string>;
@@ -17,6 +20,16 @@ interface IndexMetadata {
17
20
  embedding?: IndexEmbeddingMetadata;
18
21
  /** Persisted so recovered indexes keep collecting surface forms. */
19
22
  surfaceForms?: boolean;
23
+ analysisRevision?: string;
24
+ tokenizer?: string;
25
+ stopWords?: string;
26
+ stopWordList?: string[];
27
+ partitionLimits?: PartitionConfig;
28
+ defaultScoring?: ScoringMode;
29
+ trackPositions?: boolean;
30
+ strict?: boolean;
31
+ required?: string[];
32
+ vectorPromotion?: VectorIndexConfig;
20
33
  }
21
34
  /** Persisted so recovery can restore field mappings and rebind the adapter by
22
35
  * name; the name is absent when the index was configured with a bare instance. */
@@ -1,10 +1,11 @@
1
- import { createDurableDirectory, writeSegmentedCheckpoint } from '../../chunk-MEW7HD75.mjs';
2
- import '../../chunk-HMO6OMZ3.mjs';
1
+ import { createDurableDirectory, writeSegmentedCheckpoint } from '../../chunk-WLR5BFL3.mjs';
2
+ import '../../chunk-ASI6AOW2.mjs';
3
+ import '../../chunk-TGP5M5R7.mjs';
3
4
  import '../../chunk-S7RJJMHI.mjs';
4
5
  import '../../chunk-KMMJMDUA.mjs';
5
- import '../../chunk-TW6BXTOL.mjs';
6
- import '../../chunk-ALB35PRQ.mjs';
7
- import '../../chunk-HRABJLPB.mjs';
6
+ import '../../chunk-U2BKYEC7.mjs';
7
+ import '../../chunk-UNJZ7ZDB.mjs';
8
+ import '../../chunk-BKAI2WXI.mjs';
8
9
 
9
10
  // src/persistence/durability/rebuild.ts
10
11
  async function rebuildSnapshotFromDurable(root, metadata, targets, compactionThreshold) {
@@ -0,0 +1,208 @@
1
+ import { E as EmbeddingAdapter } from './adapters-CVqI5NBt.js';
2
+
3
+ /**
4
+ * A document as the engine stores it: any set of fields, with an optional `id`.
5
+ *
6
+ * The engine takes the `id` field as the document id when you insert without
7
+ * passing one. Every other field must match the type its schema declares.
8
+ *
9
+ * @public
10
+ */
11
+ type AnyDocument = Record<string, unknown> & {
12
+ id?: string;
13
+ };
14
+ /**
15
+ * The type a schema field declares, which sets how the engine indexes it.
16
+ *
17
+ * `string` is analysed and searchable, `number`, `boolean`, and `enum` are
18
+ * filterable and sortable, `geopoint` accepts a latitude and longitude pair,
19
+ * and `vector[N]` holds an N-dimensional embedding. Each array form indexes
20
+ * every element of the field.
21
+ *
22
+ * @public
23
+ */
24
+ type FieldType = 'string' | 'number' | 'boolean' | 'enum' | 'geopoint' | `vector[${number}]` | 'string[]' | 'number[]' | 'boolean[]' | 'enum[]';
25
+ /**
26
+ * The field layout of an index, written as a plain object.
27
+ *
28
+ * Each key names a field and each value is either its {@link FieldType} or a
29
+ * nested schema, which is how you describe an object inside a document.
30
+ * Nesting goes four levels deep.
31
+ *
32
+ * @public
33
+ */
34
+ type SchemaDefinition = {
35
+ [field: string]: FieldType | SchemaDefinition;
36
+ };
37
+ /**
38
+ * How the engine stores vectors once a field is promoted to an HNSW graph.
39
+ *
40
+ * `sq8` quantises each component to a signed byte, which cuts memory to a
41
+ * quarter and costs a small amount of recall. `none` keeps full precision.
42
+ *
43
+ * @public
44
+ */
45
+ type VectorQuantizationMode = 'sq8' | 'none';
46
+ /**
47
+ * Controls when a vector field moves from a brute-force scan to an HNSW graph,
48
+ * and how that graph is built.
49
+ *
50
+ * A small field answers faster from a brute-force scan, so the engine builds a
51
+ * graph only once the field holds enough vectors to earn one. Leave every
52
+ * field unset to accept the engine's own values.
53
+ *
54
+ * @public
55
+ */
56
+ interface VectorIndexConfig {
57
+ /** The engine promotes the field to an HNSW graph once it holds this many vectors. */
58
+ threshold?: number;
59
+ /** A filtered search prefers the graph over a scan once the field holds this many vectors. */
60
+ filterThreshold?: number;
61
+ /** These settings shape the graph: neighbours per node, build-time exploration, and the metric that ranks results. */
62
+ hnswConfig?: {
63
+ m?: number;
64
+ efConstruction?: number;
65
+ metric?: 'cosine' | 'dotProduct' | 'euclidean';
66
+ };
67
+ /** The engine stores the promoted vectors at this precision. It keeps full precision by default. */
68
+ quantization?: VectorQuantizationMode;
69
+ }
70
+ /**
71
+ * Connects an index to an embedding adapter and says which fields feed it.
72
+ *
73
+ * The engine embeds the named source fields on every insert and update, so a
74
+ * document arrives as text and is stored with its vector alongside.
75
+ *
76
+ * @public
77
+ */
78
+ interface EmbeddingFieldConfig {
79
+ /** An adapter instance, or a registered adapter name. Only a name survives
80
+ * durability recovery, since instances cannot be serialised. */
81
+ adapter?: EmbeddingAdapter | string;
82
+ /** This maps each vector field to the text field, or fields, the engine embeds into it. */
83
+ fields: Record<string, string | string[]>;
84
+ }
85
+ /**
86
+ * Replaces a language's stop word list, either with a fixed set or with a
87
+ * function that receives the language defaults and returns the set to use.
88
+ *
89
+ * @public
90
+ */
91
+ type StopWordOverride = Set<string> | ((defaults: Set<string>) => Set<string>);
92
+ /**
93
+ * Everything {@link Narsil.createIndex} needs to build an index.
94
+ *
95
+ * Only `schema` is required. The rest tune analysis, scoring, partitioning,
96
+ * and vector handling, and each one falls back to an engine default.
97
+ *
98
+ * @public
99
+ */
100
+ interface IndexConfig {
101
+ /** This layout fixes the type of every field you search, filter, or sort on. */
102
+ schema: SchemaDefinition;
103
+ /** The engine tokenises and stems text fields with the language module registered under this name. It uses English by default. */
104
+ language?: string;
105
+ /** These settings control how the index splits documents across partitions as it grows. */
106
+ partitions?: PartitionConfig;
107
+ /** A query scores this way unless it asks for another mode. */
108
+ defaultScoring?: ScoringMode;
109
+ /** These parameters tune BM25 for this index. */
110
+ bm25?: BM25Params;
111
+ /** This replaces the language's stop words, either inline or by the name a stop word list registered under. */
112
+ stopWords?: StopWordOverride | string;
113
+ /** This replaces the language's tokeniser, either inline or by the name a tokeniser registered under. */
114
+ tokenizer?: CustomTokenizer | string;
115
+ /** Setting this records term positions, which phrase queries and highlighting need. */
116
+ trackPositions?: boolean;
117
+ /** These settings control when vector fields move to an HNSW graph, and how that graph is built. */
118
+ vectorPromotion?: VectorIndexConfig;
119
+ /** Setting this rejects a document carrying a field the schema does not declare. The engine accepts extra fields by default. */
120
+ strict?: boolean;
121
+ /** These settings embed text fields into vector fields on every write. */
122
+ embedding?: EmbeddingFieldConfig;
123
+ /** The engine rejects a document that omits any of these fields. */
124
+ required?: string[];
125
+ /**
126
+ * Return the words users typed from suggest() and prefix expansion
127
+ * instead of index stems, at an insert-throughput cost. Default false.
128
+ */
129
+ surfaceForms?: boolean;
130
+ }
131
+ /**
132
+ * BM25 tuning for an index.
133
+ *
134
+ * Both parameters default to the values the literature settles on, so change
135
+ * them only once you have measured relevance on your own corpus.
136
+ *
137
+ * @public
138
+ */
139
+ interface BM25Params {
140
+ /** This saturates term frequency, so a higher value lets a repeated term keep raising a score. It defaults to 1.2. */
141
+ k1?: number;
142
+ /** This normalises by field length, from 0 for none to 1 for full. It defaults to 0.75. */
143
+ b?: number;
144
+ }
145
+ /**
146
+ * A tokeniser you supply, which replaces the language module's own.
147
+ *
148
+ * The engine calls it for every text field on write and for every query term,
149
+ * so the same rules apply on both sides.
150
+ *
151
+ * @public
152
+ */
153
+ interface CustomTokenizer {
154
+ /**
155
+ * Splits one field value into the tokens the engine indexes.
156
+ *
157
+ * @param text - The raw field value, before any stemming or stop word removal.
158
+ * @returns Each token with the character offset it starts at, which
159
+ * highlighting and phrase matching rely on.
160
+ */
161
+ tokenize(text: string): Array<{
162
+ token: string;
163
+ position: number;
164
+ }>;
165
+ }
166
+ /**
167
+ * How an index splits its documents across partitions as it grows.
168
+ *
169
+ * The engine adds a partition once a partition passes its watermark, and it
170
+ * refuses a write once every partition is full and the ceiling is reached.
171
+ *
172
+ * @public
173
+ */
174
+ interface PartitionConfig {
175
+ /** The engine refuses a write that would push one partition past this many documents. */
176
+ maxDocsPerPartition?: number;
177
+ /** The index grows to this many partitions and no further. */
178
+ maxPartitions?: number;
179
+ /** The engine adds a partition once one fills this fraction of `maxDocsPerPartition`, from 0 to 1. */
180
+ watermark?: number;
181
+ }
182
+ /**
183
+ * How a query gathers the term statistics BM25 scores with.
184
+ *
185
+ * `local` scores each partition from its own statistics, which is fastest and
186
+ * accurate enough for evenly spread data. `dfs` gathers document frequencies
187
+ * across partitions first, so every score compares like for like. `broadcast`
188
+ * sends the query to every partition and merges the results.
189
+ *
190
+ * @public
191
+ */
192
+ type ScoringMode = 'local' | 'dfs' | 'broadcast';
193
+ /**
194
+ * Per-write options for {@link Narsil.insert} and {@link Narsil.insertBatch}.
195
+ *
196
+ * @public
197
+ */
198
+ interface InsertOptions {
199
+ /**
200
+ * Setting this stores the document object you passed instead of a copy,
201
+ * which saves a clone on a large load. Changing that object afterwards
202
+ * changes the stored document with it, so pass this only for a document you
203
+ * discard.
204
+ */
205
+ skipClone?: boolean;
206
+ }
207
+
208
+ export type { AnyDocument as A, BM25Params as B, CustomTokenizer as C, EmbeddingFieldConfig as E, FieldType as F, IndexConfig as I, PartitionConfig as P, StopWordOverride as S, VectorIndexConfig as V, InsertOptions as a, SchemaDefinition as b, ScoringMode as c, VectorQuantizationMode as d };