@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,902 @@
1
+ import { compareCodePoints, EARLIER_RELEASE_MIN_M, MIN_M, MAX_M, holdsUnpairedSurrogate, exceedsCodePoints } from './chunk-HRDMIQ63.mjs';
2
+ import { MAX_DOCUMENT_ENCODING_DEPTH, DOCUMENT_REPLY_ENVELOPE_DEPTH, DOCUMENT_ENCODER_RETAINED_BUFFER_BYTES, BYTE_ORDER_MARK_WALK_BYTES_PER_HEADER } from './chunk-VUJCSQG5.mjs';
3
+ import { NarsilError, ErrorCodes } from './chunk-43R4GCM7.mjs';
4
+
5
+ // src/schema/constants.ts
6
+ var MAX_NESTING_DEPTH = 4;
7
+ var MAX_DOCUMENT_NESTING_DEPTH = 32;
8
+ var DEFAULT_PATTERN_VALUE_LIMIT = 8192;
9
+ var MIN_PATTERN_VALUE_LIMIT = 1;
10
+ var MAX_PATTERN_VALUE_LIMIT = 65536;
11
+ var MAX_VECTOR_DIMENSION = 4096;
12
+ var MAX_STORED_VECTOR_DIMENSION = 65535;
13
+ var MAX_TEXT_FIELDS = 65536;
14
+ var MAX_DOCUMENT_BYTES = 16777216;
15
+ var PARSED_FIELD_TYPE_CACHE_ENTRIES = 1024;
16
+
17
+ // src/schema/validator/shared.ts
18
+ var VECTOR_PATTERN = /^vector\[(\d+)]$/;
19
+ var VECTOR_TYPE_PATTERN = /^vector\[(.*)]$/;
20
+ function vectorDimensionOf(fieldType) {
21
+ const match = VECTOR_PATTERN.exec(fieldType);
22
+ return match === null ? null : Number.parseInt(match[1], 10);
23
+ }
24
+ function isGeopointOrVectorType(fieldType) {
25
+ return fieldType === "geopoint" || fieldType !== void 0 && VECTOR_PATTERN.test(fieldType);
26
+ }
27
+ var FIELD_NAME_PATTERN = /^[A-Za-z0-9_]+$/;
28
+ var RESERVED_ROOT_FIELDS = /* @__PURE__ */ new Set(["id"]);
29
+ var PROTOTYPE_POLLUTION_KEYS = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]);
30
+ function isPlainObject(value) {
31
+ return typeof value === "object" && value !== null && !Array.isArray(value);
32
+ }
33
+
34
+ // src/schema/validator/field-type.ts
35
+ var FIELD_OPTION_ORDER = ["sortable", "pattern", "partial"];
36
+ var OPTIONS_BY_BASE = {
37
+ string: FIELD_OPTION_ORDER,
38
+ "string[]": FIELD_OPTION_ORDER,
39
+ verbatim: ["sortable"],
40
+ "verbatim[]": ["sortable"],
41
+ number: [],
42
+ "number[]": [],
43
+ boolean: [],
44
+ "boolean[]": [],
45
+ enum: [],
46
+ "enum[]": [],
47
+ geopoint: [],
48
+ vector: []
49
+ };
50
+ var TYPE_SEPARATOR = ":";
51
+ function isNamedBase(name) {
52
+ return name !== "vector" && Object.hasOwn(OPTIONS_BY_BASE, name);
53
+ }
54
+ function describeAllowedOptions(baseName, allowed) {
55
+ if (allowed.length === 0) return `the "${baseName}" type has no options`;
56
+ const quoted = allowed.map((option) => `"${option}"`);
57
+ if (quoted.length === 1) return `the only option of the "${baseName}" type is ${quoted[0]}`;
58
+ return `the options of the "${baseName}" type are ${quoted.slice(0, -1).join(", ")}, and ${quoted[quoted.length - 1]}`;
59
+ }
60
+ function invalidType(path, type, message) {
61
+ throw new NarsilError(ErrorCodes.SCHEMA_INVALID_TYPE, message, { field: path, type });
62
+ }
63
+ function parseBase(baseName, path, type) {
64
+ if (isNamedBase(baseName)) return { base: baseName, dimension: 0 };
65
+ const vectorMatch = VECTOR_TYPE_PATTERN.exec(baseName);
66
+ if (vectorMatch === null) {
67
+ invalidType(path, type, `Field "${path}" has an unsupported type: "${type}"`);
68
+ }
69
+ const dimension = vectorDimensionOf(baseName) ?? Number.NaN;
70
+ if (!(dimension > 0 && dimension <= MAX_STORED_VECTOR_DIMENSION)) {
71
+ throw new NarsilError(
72
+ ErrorCodes.SCHEMA_INVALID_VECTOR_DIMENSION,
73
+ `Vector field "${path}" has ${vectorMatch[1]} dimensions, but a vector field holds from 1 to ${MAX_STORED_VECTOR_DIMENSION}`,
74
+ { field: path, dimension, maximum: MAX_STORED_VECTOR_DIMENSION }
75
+ );
76
+ }
77
+ return { base: "vector", dimension };
78
+ }
79
+ function parseFieldType(type, path) {
80
+ const separatorIndex = type.indexOf(TYPE_SEPARATOR);
81
+ const baseName = separatorIndex === -1 ? type : type.slice(0, separatorIndex);
82
+ const { base, dimension } = parseBase(baseName, path, type);
83
+ const allowed = OPTIONS_BY_BASE[base];
84
+ const options = /* @__PURE__ */ new Set();
85
+ if (separatorIndex !== -1) {
86
+ for (const option of type.slice(separatorIndex + 1).split(TYPE_SEPARATOR)) {
87
+ if (!allowed.includes(option)) {
88
+ invalidType(
89
+ path,
90
+ type,
91
+ `Field "${path}" has type "${type}" with the option "${option}", but ${describeAllowedOptions(baseName, allowed)}`
92
+ );
93
+ }
94
+ if (options.has(option)) {
95
+ invalidType(path, type, `Field "${path}" has the "${option}" option twice in type "${type}"`);
96
+ }
97
+ options.add(option);
98
+ }
99
+ }
100
+ const ordered = FIELD_OPTION_ORDER.filter((option) => options.has(option));
101
+ const verbatim = base === "verbatim" || base === "verbatim[]";
102
+ return {
103
+ type: [baseName, ...ordered].join(TYPE_SEPARATOR),
104
+ base,
105
+ sortable: options.has("sortable"),
106
+ pattern: verbatim || options.has("pattern"),
107
+ partial: options.has("partial"),
108
+ dimension
109
+ };
110
+ }
111
+ var parsedTypesByName = /* @__PURE__ */ new Map();
112
+ function parsedTypeOf(type) {
113
+ if (type === void 0) return void 0;
114
+ const known = parsedTypesByName.get(type);
115
+ if (known !== void 0) return known;
116
+ try {
117
+ const parsed = Object.freeze(parseFieldType(type, ""));
118
+ if (parsedTypesByName.size < PARSED_FIELD_TYPE_CACHE_ENTRIES) parsedTypesByName.set(type, parsed);
119
+ return parsed;
120
+ } catch {
121
+ return void 0;
122
+ }
123
+ }
124
+ function withSortableOption(parsed) {
125
+ if (parsed.sortable) return parsed.type;
126
+ const separatorIndex = parsed.type.indexOf(TYPE_SEPARATOR);
127
+ const baseName = separatorIndex === -1 ? parsed.type : parsed.type.slice(0, separatorIndex);
128
+ return parseFieldType(`${baseName}${TYPE_SEPARATOR}sortable${parsed.type.slice(baseName.length)}`, "").type;
129
+ }
130
+ function isListBase(base) {
131
+ return base.endsWith("[]");
132
+ }
133
+ function isWordIndexedBase(base) {
134
+ return base === "string" || base === "string[]";
135
+ }
136
+ function isSingleStringFieldType(fieldType) {
137
+ return parsedTypeOf(fieldType)?.base === "string";
138
+ }
139
+ function isWordIndexedFieldType(fieldType) {
140
+ const parsed = parsedTypeOf(fieldType);
141
+ return parsed !== void 0 && isWordIndexedBase(parsed.base);
142
+ }
143
+ function isStringValuedBase(base) {
144
+ return base === "string" || base === "string[]" || base === "verbatim" || base === "verbatim[]";
145
+ }
146
+
147
+ // src/geo/constants.ts
148
+ var DEG_TO_RAD = Math.PI / 180;
149
+ var MAX_LATITUDE_DEGREES = 90;
150
+ var MAX_LONGITUDE_DEGREES = 180;
151
+ var MIN_POLYGON_POINTS = 3;
152
+ var ANTIMERIDIAN_SPAN_DEGREES = 180;
153
+ var FULL_TURN_DEGREES = 360;
154
+ var EARTH_RADIUS_METERS = 63710088e-1;
155
+ var LOCATION_CODE_BITS_PER_AXIS = 26;
156
+ var LOCATION_CELLS_PER_AXIS = 2 ** LOCATION_CODE_BITS_PER_AXIS;
157
+ var MAX_COVERING_CELLS = 16;
158
+
159
+ // src/geo/coordinates.ts
160
+ function isLatitude(value) {
161
+ return value >= -MAX_LATITUDE_DEGREES && value <= MAX_LATITUDE_DEGREES;
162
+ }
163
+ function isLongitude(value) {
164
+ return value >= -MAX_LONGITUDE_DEGREES && value <= MAX_LONGITUDE_DEGREES;
165
+ }
166
+
167
+ // src/schema/validator/field-values.ts
168
+ function validateGeopoint(path, value) {
169
+ if (!isPlainObject(value)) {
170
+ throw new NarsilError(
171
+ ErrorCodes.SCHEMA_INVALID_GEOPOINT,
172
+ `Field "${path}" expected a geopoint object with lat and lon`,
173
+ {
174
+ field: path,
175
+ received: Array.isArray(value) ? "array" : typeof value
176
+ }
177
+ );
178
+ }
179
+ if (typeof value.lat !== "number" || typeof value.lon !== "number" || Number.isNaN(value.lat) || Number.isNaN(value.lon)) {
180
+ throw new NarsilError(ErrorCodes.SCHEMA_INVALID_GEOPOINT, `Field "${path}" geopoint requires numeric lat and lon`, {
181
+ field: path,
182
+ lat: Number.isNaN(value.lat) ? "NaN" : typeof value.lat,
183
+ lon: Number.isNaN(value.lon) ? "NaN" : typeof value.lon
184
+ });
185
+ }
186
+ if (!isLatitude(value.lat)) {
187
+ throw new NarsilError(
188
+ ErrorCodes.SCHEMA_INVALID_GEOPOINT,
189
+ `Field "${path}" geopoint lat must be between -90 and 90`,
190
+ {
191
+ field: path,
192
+ lat: value.lat
193
+ }
194
+ );
195
+ }
196
+ if (!isLongitude(value.lon)) {
197
+ throw new NarsilError(
198
+ ErrorCodes.SCHEMA_INVALID_GEOPOINT,
199
+ `Field "${path}" geopoint lon must be between -180 and 180`,
200
+ {
201
+ field: path,
202
+ lon: value.lon
203
+ }
204
+ );
205
+ }
206
+ }
207
+ function validateVector(path, value, expectedDimension) {
208
+ const isArray = Array.isArray(value);
209
+ const isFloat32 = value instanceof Float32Array;
210
+ if (!isArray && !isFloat32) {
211
+ throw new NarsilError(
212
+ ErrorCodes.DOC_VALIDATION_FAILED,
213
+ `Field "${path}" expected a vector (Array or Float32Array)`,
214
+ { field: path, received: typeof value }
215
+ );
216
+ }
217
+ const arr = value;
218
+ if (arr.length !== expectedDimension) {
219
+ throw new NarsilError(
220
+ ErrorCodes.DOC_VALIDATION_FAILED,
221
+ `Field "${path}" expected vector of dimension ${expectedDimension}, got ${arr.length}`,
222
+ { field: path, expected: expectedDimension, received: arr.length }
223
+ );
224
+ }
225
+ for (let i = 0; i < arr.length; i++) {
226
+ if (typeof arr[i] !== "number" || !Number.isFinite(Math.fround(arr[i]))) {
227
+ throw new NarsilError(
228
+ ErrorCodes.DOC_VALIDATION_FAILED,
229
+ `Field "${path}" vector element at index ${i} is not a valid number`,
230
+ { field: path, index: i, value: arr[i] }
231
+ );
232
+ }
233
+ }
234
+ }
235
+ function validateTypedArray(path, value, elementType) {
236
+ if (!Array.isArray(value)) {
237
+ throw new NarsilError(ErrorCodes.DOC_VALIDATION_FAILED, `Field "${path}" expected an array`, {
238
+ field: path,
239
+ received: typeof value
240
+ });
241
+ }
242
+ for (let i = 0; i < value.length; i++) {
243
+ const el = value[i];
244
+ if (typeof el !== elementType) {
245
+ throw new NarsilError(
246
+ ErrorCodes.DOC_VALIDATION_FAILED,
247
+ `Field "${path}" array element at index ${i} expected ${elementType}, got ${typeof el}`,
248
+ { field: path, index: i, expected: elementType, received: typeof el }
249
+ );
250
+ }
251
+ if (elementType === "number" && !Number.isFinite(el)) {
252
+ throw new NarsilError(
253
+ ErrorCodes.DOC_VALIDATION_FAILED,
254
+ `Field "${path}" array element at index ${i} is ${String(el)}, while a number field holds finite numbers alone`,
255
+ { field: path, index: i }
256
+ );
257
+ }
258
+ }
259
+ }
260
+ function validatePatternValue(path, value, patternValueLimit, index) {
261
+ if (!exceedsCodePoints(value, patternValueLimit)) return;
262
+ const subject = index === void 0 ? `The value of field "${path}"` : `Element ${index} of field "${path}"`;
263
+ throw new NarsilError(
264
+ ErrorCodes.DOC_VALIDATION_FAILED,
265
+ `${subject} is longer than ${patternValueLimit} code points, which is the pattern value limit of this index`,
266
+ { field: path, limit: patternValueLimit, ...index === void 0 ? {} : { index } }
267
+ );
268
+ }
269
+ function validateFieldValue(path, value, type, patternValueLimit) {
270
+ switch (type.base) {
271
+ case "string":
272
+ case "verbatim":
273
+ if (typeof value !== "string") {
274
+ throw new NarsilError(
275
+ ErrorCodes.DOC_VALIDATION_FAILED,
276
+ `Field "${path}" expected string, got ${typeof value}`,
277
+ {
278
+ field: path,
279
+ expected: "string",
280
+ received: typeof value
281
+ }
282
+ );
283
+ }
284
+ if (type.pattern) validatePatternValue(path, value, patternValueLimit);
285
+ return;
286
+ case "number":
287
+ if (typeof value !== "number" || !Number.isFinite(value)) {
288
+ throw new NarsilError(ErrorCodes.DOC_VALIDATION_FAILED, `Field "${path}" expected a finite number`, {
289
+ field: path,
290
+ expected: "number",
291
+ received: typeof value === "number" ? String(value) : typeof value
292
+ });
293
+ }
294
+ return;
295
+ case "boolean":
296
+ if (typeof value !== "boolean") {
297
+ throw new NarsilError(
298
+ ErrorCodes.DOC_VALIDATION_FAILED,
299
+ `Field "${path}" expected boolean, got ${typeof value}`,
300
+ {
301
+ field: path,
302
+ expected: "boolean",
303
+ received: typeof value
304
+ }
305
+ );
306
+ }
307
+ return;
308
+ case "enum":
309
+ if (typeof value !== "string") {
310
+ throw new NarsilError(
311
+ ErrorCodes.DOC_VALIDATION_FAILED,
312
+ `Field "${path}" expected enum (string), got ${typeof value}`,
313
+ {
314
+ field: path,
315
+ expected: "enum",
316
+ received: typeof value
317
+ }
318
+ );
319
+ }
320
+ return;
321
+ case "geopoint":
322
+ validateGeopoint(path, value);
323
+ return;
324
+ case "string[]":
325
+ case "verbatim[]":
326
+ validateTypedArray(path, value, "string");
327
+ if (type.pattern) {
328
+ const elements = value;
329
+ for (let i = 0; i < elements.length; i++) validatePatternValue(path, elements[i], patternValueLimit, i);
330
+ }
331
+ return;
332
+ case "number[]":
333
+ validateTypedArray(path, value, "number");
334
+ return;
335
+ case "boolean[]":
336
+ validateTypedArray(path, value, "boolean");
337
+ return;
338
+ case "enum[]":
339
+ validateTypedArray(path, value, "string");
340
+ return;
341
+ case "vector":
342
+ validateVector(path, value, type.dimension);
343
+ return;
344
+ }
345
+ }
346
+
347
+ // src/schema/validator/storable.ts
348
+ var RESERVED_OBJECT_KEYS = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]);
349
+ var UNPAIRED_SURROGATE_REASON = "holds an unpaired surrogate, the half of a character such as an emoji whose other half is missing, so the engine cannot store it as UTF-8";
350
+ function reject(path, reason) {
351
+ throw new NarsilError(ErrorCodes.DOC_VALIDATION_FAILED, `Field "${path === "" ? "(document)" : path}" ${reason}`, {
352
+ field: path
353
+ });
354
+ }
355
+ function isPlainObject2(value) {
356
+ const proto = Object.getPrototypeOf(value);
357
+ return proto === Object.prototype || proto === null;
358
+ }
359
+ function walkStorable(value, path, depth, ancestors, skip) {
360
+ if (value === null || value === void 0) return;
361
+ const kind = typeof value;
362
+ if (kind === "string") {
363
+ if (holdsUnpairedSurrogate(value)) reject(path, UNPAIRED_SURROGATE_REASON);
364
+ return;
365
+ }
366
+ if (kind === "boolean" || kind === "number") return;
367
+ if (kind === "bigint" || kind === "symbol" || kind === "function") {
368
+ reject(path, `holds a ${kind}, which cannot be stored or recovered`);
369
+ }
370
+ const container = value;
371
+ if (container instanceof Date) {
372
+ if (Number.isNaN(container.getTime())) reject(path, "holds an invalid date, which the engine cannot store");
373
+ return;
374
+ }
375
+ if (container instanceof Uint8Array) return;
376
+ const isArray = Array.isArray(container);
377
+ if (!isArray && !isPlainObject2(container)) {
378
+ reject(
379
+ path,
380
+ "holds a value that does not survive storage; use plain objects, arrays, strings, numbers, booleans, dates, or Uint8Array bytes"
381
+ );
382
+ }
383
+ if (depth >= MAX_DOCUMENT_NESTING_DEPTH) {
384
+ reject(path, `nests deeper than ${MAX_DOCUMENT_NESTING_DEPTH} levels`);
385
+ }
386
+ if (ancestors.has(container)) {
387
+ reject(path, "refers back to one of its own ancestors");
388
+ }
389
+ ancestors.add(container);
390
+ if (isArray) {
391
+ const items = container;
392
+ for (let i = 0; i < items.length; i++) {
393
+ walkStorable(items[i], `${path}[${i}]`, depth + 1, ancestors, skip);
394
+ }
395
+ } else {
396
+ const record = container;
397
+ for (const key of Object.keys(record)) {
398
+ const keyPath = path === "" ? key : `${path}.${key}`;
399
+ if (RESERVED_OBJECT_KEYS.has(key)) {
400
+ reject(keyPath, "uses a reserved object key");
401
+ }
402
+ if (holdsUnpairedSurrogate(key)) reject(keyPath, `has a name that ${UNPAIRED_SURROGATE_REASON}`);
403
+ if (skip.has(keyPath)) continue;
404
+ walkStorable(record[key], keyPath, depth + 1, ancestors, skip);
405
+ }
406
+ }
407
+ ancestors.delete(container);
408
+ }
409
+ function assertStorableDocument(document, skipFieldPaths) {
410
+ walkStorable(document, "", 0, /* @__PURE__ */ new Set(), skipFieldPaths ?? /* @__PURE__ */ new Set());
411
+ }
412
+
413
+ // src/schema/validator/document.ts
414
+ var vectorPathCache = /* @__PURE__ */ new WeakMap();
415
+ function vectorFieldPaths(schema) {
416
+ let paths = vectorPathCache.get(schema);
417
+ if (paths !== void 0) return paths;
418
+ paths = /* @__PURE__ */ new Set();
419
+ const collect = (level, prefix) => {
420
+ for (const [field, type] of Object.entries(level)) {
421
+ const path = prefix === "" ? field : `${prefix}.${field}`;
422
+ if (typeof type === "string" && VECTOR_PATTERN.test(type)) {
423
+ paths?.add(path);
424
+ } else if (isPlainObject(type)) {
425
+ collect(type, path);
426
+ }
427
+ }
428
+ };
429
+ collect(schema, "");
430
+ vectorPathCache.set(schema, paths);
431
+ return paths;
432
+ }
433
+ var parsedLevelCache = /* @__PURE__ */ new WeakMap();
434
+ function parsedLevel(schema, prefix) {
435
+ let entries = parsedLevelCache.get(schema);
436
+ if (entries !== void 0) return entries;
437
+ entries = Object.entries(schema).map(([field, type]) => {
438
+ if (isPlainObject(type)) return { field, nested: type, type: null };
439
+ const path = prefix ? `${prefix}.${field}` : field;
440
+ return { field, nested: null, type: parseFieldType(type, path) };
441
+ });
442
+ parsedLevelCache.set(schema, entries);
443
+ return entries;
444
+ }
445
+ function validateDocumentFields(doc, schema, prefix, patternValueLimit) {
446
+ for (const { field, nested, type } of parsedLevel(schema, prefix)) {
447
+ const value = doc[field];
448
+ if (value === void 0 || value === null) continue;
449
+ const path = prefix ? `${prefix}.${field}` : field;
450
+ if (nested !== null) {
451
+ if (!isPlainObject(value)) {
452
+ throw new NarsilError(ErrorCodes.DOC_VALIDATION_FAILED, `Field "${path}" expected an object`, {
453
+ field: path,
454
+ received: Array.isArray(value) ? "array" : typeof value
455
+ });
456
+ }
457
+ validateDocumentFields(value, nested, path, patternValueLimit);
458
+ continue;
459
+ }
460
+ if (type !== null) validateFieldValue(path, value, type, patternValueLimit);
461
+ }
462
+ }
463
+ function validateDocument(document, schema, patternValueLimit = DEFAULT_PATTERN_VALUE_LIMIT) {
464
+ if (!isPlainObject(document)) {
465
+ throw new NarsilError(ErrorCodes.DOC_VALIDATION_FAILED, "Document must be a plain object", {
466
+ received: typeof document
467
+ });
468
+ }
469
+ requireIdFieldKey(document);
470
+ assertStorableDocument(document, vectorFieldPaths(schema));
471
+ validateDocumentFields(document, schema, "", patternValueLimit);
472
+ }
473
+ function requireIdFieldKey(document) {
474
+ if (!Object.hasOwn(document, "id")) return;
475
+ const id = document.id;
476
+ if (typeof id === "string" && id.length > 0) return;
477
+ throw new NarsilError(
478
+ ErrorCodes.DOC_VALIDATION_FAILED,
479
+ `Field "id" holds ${typeof id === "string" ? "an empty string" : id === null ? "null" : `a ${typeof id}`}, while the engine stores a document under its id field, so that field must hold a non-empty string`,
480
+ { field: "id", received: id === null ? "null" : typeof id }
481
+ );
482
+ }
483
+ function collectExtraFields(doc, schema, prefix, extras) {
484
+ for (const key of Object.keys(doc)) {
485
+ if (key === "id") continue;
486
+ const path = prefix ? `${prefix}.${key}` : key;
487
+ if (!Object.hasOwn(schema, key)) {
488
+ extras.push(path);
489
+ continue;
490
+ }
491
+ const schemaType = schema[key];
492
+ if (isPlainObject(schemaType) && isPlainObject(doc[key])) {
493
+ collectExtraFields(doc[key], schemaType, path, extras);
494
+ }
495
+ }
496
+ }
497
+ function validateDocumentStrict(document, schema) {
498
+ const extras = [];
499
+ collectExtraFields(document, schema, "", extras);
500
+ if (extras.length > 0) {
501
+ throw new NarsilError(
502
+ ErrorCodes.DOC_VALIDATION_FAILED,
503
+ `Document contains fields not defined in schema: ${extras.join(", ")}`,
504
+ { extraFields: extras }
505
+ );
506
+ }
507
+ }
508
+ function resolveNestedValue(document, path) {
509
+ if (!path.includes(".")) return document[path];
510
+ const segments = path.split(".");
511
+ let current = document;
512
+ for (const segment of segments) {
513
+ if (current === null || current === void 0 || typeof current !== "object") return void 0;
514
+ current = current[segment];
515
+ }
516
+ return current;
517
+ }
518
+ function validateRequiredFields(document, required) {
519
+ if (required.length === 0) return;
520
+ for (const field of required) {
521
+ const value = resolveNestedValue(document, field);
522
+ if (value === void 0 || value === null) {
523
+ throw new NarsilError(ErrorCodes.DOC_MISSING_REQUIRED_FIELD, `Document is missing required field "${field}"`, {
524
+ field
525
+ });
526
+ }
527
+ }
528
+ }
529
+
530
+ // src/schema/validator/document-size.ts
531
+ var LARGEST_HEADER_BYTES = 5;
532
+ var LARGEST_NUMBER_BYTES = 9;
533
+ var LARGEST_TIMESTAMP_BYTES = 15;
534
+ var LARGEST_UTF8_BYTES_PER_UNIT = 3;
535
+ function upperBoundBytes(value, budget, depth) {
536
+ if (value === null || value === void 0 || typeof value === "boolean") return 1;
537
+ if (typeof value === "number") return LARGEST_NUMBER_BYTES;
538
+ if (typeof value === "string") return LARGEST_HEADER_BYTES + value.length * LARGEST_UTF8_BYTES_PER_UNIT;
539
+ if (value instanceof Date) return LARGEST_TIMESTAMP_BYTES;
540
+ if (ArrayBuffer.isView(value)) return LARGEST_HEADER_BYTES + value.byteLength;
541
+ if (typeof value !== "object" || depth > MAX_DOCUMENT_NESTING_DEPTH) return LARGEST_NUMBER_BYTES;
542
+ let total = LARGEST_HEADER_BYTES;
543
+ if (Array.isArray(value)) {
544
+ for (const item of value) {
545
+ total += upperBoundBytes(item, budget - total, depth + 1);
546
+ if (total > budget) return total;
547
+ }
548
+ return total;
549
+ }
550
+ const record = value;
551
+ for (const key of Object.keys(record)) {
552
+ total += LARGEST_HEADER_BYTES + key.length * LARGEST_UTF8_BYTES_PER_UNIT;
553
+ total += upperBoundBytes(record[key], budget - total, depth + 1);
554
+ if (total > budget) return total;
555
+ }
556
+ return total;
557
+ }
558
+ function messagePackUpperBoundBytes(value) {
559
+ return upperBoundBytes(value, Number.POSITIVE_INFINITY, 0);
560
+ }
561
+ function encodedBytesOf(code, document) {
562
+ try {
563
+ return code.encodeDocument(document).byteLength;
564
+ } catch {
565
+ return null;
566
+ }
567
+ }
568
+ function requireDocumentWithinSizeLimit(document) {
569
+ if (upperBoundBytes(document, MAX_DOCUMENT_BYTES, 0) <= MAX_DOCUMENT_BYTES) return null;
570
+ const code = loadedMessagePack();
571
+ if (code !== null) {
572
+ requireEncodedDocumentWithinSizeLimit(code, document);
573
+ return null;
574
+ }
575
+ return loadMessagePack().then((loaded2) => requireEncodedDocumentWithinSizeLimit(loaded2, document));
576
+ }
577
+ function requireEncodedDocumentWithinSizeLimit(code, document) {
578
+ const encodedBytes = encodedBytesOf(code, document);
579
+ if (encodedBytes === null || encodedBytes <= MAX_DOCUMENT_BYTES) return;
580
+ throw new NarsilError(
581
+ ErrorCodes.DOC_VALIDATION_FAILED,
582
+ `The document takes ${encodedBytes} bytes as MessagePack, vector values included, but a document may take at most ${MAX_DOCUMENT_BYTES}`,
583
+ { bytes: encodedBytes, maximum: MAX_DOCUMENT_BYTES }
584
+ );
585
+ }
586
+
587
+ // src/schema/validator/schema.ts
588
+ function validateSchemaFields(schema, depth, prefix) {
589
+ if (depth > MAX_NESTING_DEPTH) {
590
+ throw new NarsilError(
591
+ ErrorCodes.SCHEMA_DEPTH_EXCEEDED,
592
+ `Schema nesting exceeds the maximum depth of ${MAX_NESTING_DEPTH} at "${prefix}"`,
593
+ { path: prefix, maxDepth: MAX_NESTING_DEPTH }
594
+ );
595
+ }
596
+ let canonical = null;
597
+ const replace = (field, value) => {
598
+ if (canonical === null) canonical = { ...schema };
599
+ canonical[field] = value;
600
+ };
601
+ for (const [field, type] of Object.entries(schema)) {
602
+ const path = prefix ? `${prefix}.${field}` : field;
603
+ if (PROTOTYPE_POLLUTION_KEYS.has(field)) {
604
+ throw new NarsilError(ErrorCodes.SCHEMA_INVALID_TYPE, `Field name "${field}" is not allowed in a schema`, {
605
+ field,
606
+ path
607
+ });
608
+ }
609
+ if (!FIELD_NAME_PATTERN.test(field)) {
610
+ throw new NarsilError(
611
+ ErrorCodes.SCHEMA_INVALID_TYPE,
612
+ `Field name "${field}" contains characters that are not allowed; use letters, digits, and underscores only`,
613
+ { field, path }
614
+ );
615
+ }
616
+ if (depth === 1 && RESERVED_ROOT_FIELDS.has(field)) {
617
+ throw new NarsilError(
618
+ ErrorCodes.SCHEMA_INVALID_TYPE,
619
+ `Field "${field}" is reserved and cannot be defined in a schema`,
620
+ { field, path }
621
+ );
622
+ }
623
+ if (isPlainObject(type)) {
624
+ const nested = validateSchemaFields(type, depth + 1, path);
625
+ if (nested !== type) replace(field, nested);
626
+ continue;
627
+ }
628
+ if (typeof type !== "string") {
629
+ throw new NarsilError(
630
+ ErrorCodes.SCHEMA_INVALID_TYPE,
631
+ `Field "${path}" has an invalid type definition: ${String(type)}`,
632
+ {
633
+ field: path,
634
+ type: String(type)
635
+ }
636
+ );
637
+ }
638
+ const parsed = parseFieldType(type, path);
639
+ if (parsed.type !== type) replace(field, parsed.type);
640
+ }
641
+ return canonical ?? schema;
642
+ }
643
+ function validateSchema(schema) {
644
+ if (!isPlainObject(schema)) {
645
+ throw new NarsilError(ErrorCodes.SCHEMA_INVALID_TYPE, "Schema must be a plain object", {
646
+ received: typeof schema
647
+ });
648
+ }
649
+ if (Object.keys(schema).length === 0) {
650
+ throw new NarsilError(ErrorCodes.SCHEMA_INVALID_TYPE, "Schema must define at least one field");
651
+ }
652
+ const validated = validateSchemaFields(schema, 1, "");
653
+ requireTextFieldCount(schemaFieldsOf(validated).filter((field) => isWordIndexedBase(field.base)).length);
654
+ return validated;
655
+ }
656
+ function requireTextFieldCount(count) {
657
+ if (count <= MAX_TEXT_FIELDS) return;
658
+ throw new NarsilError(
659
+ ErrorCodes.SCHEMA_INVALID_TYPE,
660
+ `The schema declares ${count} string and string[] fields, but a schema holds at most ${MAX_TEXT_FIELDS}`,
661
+ { textFields: count, maximum: MAX_TEXT_FIELDS }
662
+ );
663
+ }
664
+ function requireCreatableSchema(schema) {
665
+ for (const field of schemaFieldsOf(schema)) {
666
+ if (field.base !== "vector" || field.dimension <= MAX_VECTOR_DIMENSION) continue;
667
+ throw new NarsilError(
668
+ ErrorCodes.SCHEMA_INVALID_VECTOR_DIMENSION,
669
+ `Vector field "${field.path}" has ${field.dimension} dimensions, but a new index takes at most ${MAX_VECTOR_DIMENSION}`,
670
+ { field: field.path, dimension: field.dimension, maximum: MAX_VECTOR_DIMENSION }
671
+ );
672
+ }
673
+ }
674
+ function requireValidFieldTypes(flatSchema) {
675
+ let textFields = 0;
676
+ for (const [path, type] of Object.entries(flatSchema)) {
677
+ if (typeof type !== "string") {
678
+ throw new NarsilError(
679
+ ErrorCodes.SCHEMA_INVALID_TYPE,
680
+ `Field "${path}" has an invalid type definition: ${String(type)}`,
681
+ { field: path, type: String(type) }
682
+ );
683
+ }
684
+ if (isWordIndexedBase(parseFieldType(type, path).base)) textFields += 1;
685
+ }
686
+ requireTextFieldCount(textFields);
687
+ }
688
+ function flattenRecursive(schema, prefix, result) {
689
+ for (const [field, type] of Object.entries(schema)) {
690
+ const path = prefix ? `${prefix}.${field}` : field;
691
+ if (isPlainObject(type)) {
692
+ flattenRecursive(type, path, result);
693
+ } else {
694
+ result[path] = type;
695
+ }
696
+ }
697
+ }
698
+ var flattenedSchemas = /* @__PURE__ */ new WeakMap();
699
+ function flattenSchema(schema) {
700
+ const cached = flattenedSchemas.get(schema);
701
+ if (cached !== void 0) return cached;
702
+ const result = /* @__PURE__ */ Object.create(null);
703
+ flattenRecursive(schema, "", result);
704
+ flattenedSchemas.set(schema, Object.freeze(result));
705
+ return result;
706
+ }
707
+ var parsedSchemas = /* @__PURE__ */ new WeakMap();
708
+ function schemaFieldsOf(schema) {
709
+ const cached = parsedSchemas.get(schema);
710
+ if (cached !== void 0) return cached;
711
+ const fields = [];
712
+ for (const [path, type] of Object.entries(flattenSchema(schema))) {
713
+ fields.push({ ...parseFieldType(type, path), path });
714
+ }
715
+ const frozen = Object.freeze(fields);
716
+ parsedSchemas.set(schema, frozen);
717
+ return frozen;
718
+ }
719
+ var partialFieldsBySchema = /* @__PURE__ */ new WeakMap();
720
+ function partialFieldsOf(schema) {
721
+ const cached = partialFieldsBySchema.get(schema);
722
+ if (cached !== void 0) return cached;
723
+ const paths = [];
724
+ for (const field of schemaFieldsOf(schema)) {
725
+ if (field.partial) paths.push(field.path);
726
+ }
727
+ const frozen = Object.freeze(paths.sort(compareCodePoints));
728
+ partialFieldsBySchema.set(schema, frozen);
729
+ return frozen;
730
+ }
731
+ function extractVectorFieldsFromSchema(schema) {
732
+ const result = /* @__PURE__ */ new Map();
733
+ for (const field of schemaFieldsOf(schema)) {
734
+ if (field.base === "vector") result.set(field.path, field.dimension);
735
+ }
736
+ return result;
737
+ }
738
+
739
+ // src/schema/validator/vector-promotion.ts
740
+ var QUANTIZATION_MODES = /* @__PURE__ */ new Set(["osq8", "osq4", "osq2", "osq1", "none"]);
741
+ var STORAGE_MODES = /* @__PURE__ */ new Set(["memory", "disk"]);
742
+ function fail(message, details) {
743
+ throw new NarsilError(ErrorCodes.CONFIG_INVALID, message, details);
744
+ }
745
+ function isPositiveInteger(value) {
746
+ return Number.isInteger(value) && value >= 1;
747
+ }
748
+ function isQuantizationMode(value) {
749
+ return typeof value === "string" && QUANTIZATION_MODES.has(value);
750
+ }
751
+ function isStorageMode(value) {
752
+ return typeof value === "string" && STORAGE_MODES.has(value);
753
+ }
754
+ function validateVectorStorage(config, filesystemDurability) {
755
+ if (config?.storage === "disk" && !filesystemDurability) {
756
+ fail("vectorPromotion.storage 'disk' needs filesystem durability, because a checkpoint file holds the vectors", {
757
+ storage: config.storage
758
+ });
759
+ }
760
+ }
761
+ function validateTextStorage(textStorage, filesystemDurability) {
762
+ if (textStorage === void 0 || textStorage === "memory" || textStorage === "disk" && filesystemDurability) return;
763
+ fail("textStorage must be 'memory', or 'disk' with filesystem durability", { textStorage });
764
+ }
765
+ function raiseEarlierReleaseGraphSetting(config) {
766
+ if (typeof config !== "object" || config === null) return config;
767
+ const hnsw = config.hnswConfig;
768
+ if (typeof hnsw !== "object" || hnsw === null) return config;
769
+ if (hnsw.m !== EARLIER_RELEASE_MIN_M) return config;
770
+ return { ...config, hnswConfig: { ...hnsw, m: MIN_M } };
771
+ }
772
+ function validateVectorPromotion(config) {
773
+ if (config === void 0) return;
774
+ if (config.threshold !== void 0 && !isPositiveInteger(config.threshold)) {
775
+ fail("vectorPromotion.threshold must be a positive integer", { threshold: config.threshold });
776
+ }
777
+ const quantization = config.quantization;
778
+ if (quantization !== void 0 && !isQuantizationMode(quantization)) {
779
+ fail("vectorPromotion.quantization must be 'osq8', 'osq4', 'osq2', 'osq1', or 'none'", { quantization });
780
+ }
781
+ const storage = config.storage;
782
+ if (storage !== void 0 && !isStorageMode(storage)) {
783
+ fail("vectorPromotion.storage must be 'memory' or 'disk'", { storage });
784
+ }
785
+ const hnsw = config.hnswConfig;
786
+ if (hnsw === void 0) return;
787
+ if (hnsw.m !== void 0 && (!Number.isInteger(hnsw.m) || hnsw.m < MIN_M || hnsw.m > MAX_M)) {
788
+ fail(`vectorPromotion.hnswConfig.m must be a whole number from ${MIN_M} to ${MAX_M}`, { m: hnsw.m });
789
+ }
790
+ if (hnsw.efConstruction !== void 0 && !isPositiveInteger(hnsw.efConstruction)) {
791
+ fail("vectorPromotion.hnswConfig.efConstruction must be a positive integer", {
792
+ efConstruction: hnsw.efConstruction
793
+ });
794
+ }
795
+ const metric = hnsw.metric;
796
+ if (metric !== void 0 && metric !== "cosine" && metric !== "dotProduct" && metric !== "euclidean") {
797
+ fail("vectorPromotion.hnswConfig.metric must be 'cosine', 'dotProduct', or 'euclidean'", { metric });
798
+ }
799
+ }
800
+
801
+ // src/core/partition/utils.ts
802
+ function getOrCreateFieldNameIndex(table, fieldName) {
803
+ const existing = table.indexMap.get(fieldName);
804
+ if (existing !== void 0) return existing;
805
+ const idx = table.names.length;
806
+ table.names.push(fieldName);
807
+ table.indexMap.set(fieldName, idx);
808
+ return idx;
809
+ }
810
+ function getNestedValue(obj, path) {
811
+ if (obj === null || typeof obj !== "object") return void 0;
812
+ if (!path.includes(".")) return Object.hasOwn(obj, path) ? obj[path] : void 0;
813
+ const parts = path.split(".");
814
+ let current = obj;
815
+ for (let i = 0; i < parts.length; i++) {
816
+ if (current === null || current === void 0 || typeof current !== "object") return void 0;
817
+ if (!Object.hasOwn(current, parts[i])) return void 0;
818
+ current = current[parts[i]];
819
+ }
820
+ return current;
821
+ }
822
+ function stringArraysEqual(a, b) {
823
+ if (a === b) return true;
824
+ if (!a || !b) return false;
825
+ if (a.length !== b.length) return false;
826
+ for (let i = 0; i < a.length; i++) {
827
+ if (a[i] !== b[i]) return false;
828
+ }
829
+ return true;
830
+ }
831
+ function textFieldsChanged(oldDoc, newDoc, fields) {
832
+ for (const { path, base } of fields) {
833
+ if (!isWordIndexedBase(base)) continue;
834
+ const oldVal = getNestedValue(oldDoc, path);
835
+ const newVal = getNestedValue(newDoc, path);
836
+ if (base === "string") {
837
+ if (oldVal !== newVal) return true;
838
+ } else {
839
+ if (!stringArraysEqual(oldVal, newVal)) return true;
840
+ }
841
+ }
842
+ return false;
843
+ }
844
+ function parseVectorDimension(fieldType) {
845
+ return vectorDimensionOf(fieldType);
846
+ }
847
+ function tokenizeOptions(options) {
848
+ return {
849
+ stem: true,
850
+ removeStopWords: true,
851
+ collectSurfaces: options?.collectSurfaces === true,
852
+ stopWordOverride: options?.stopWordOverride,
853
+ customTokenizer: options?.customTokenizer,
854
+ textSource: "document"
855
+ };
856
+ }
857
+ function getFlatSchema(state, schema) {
858
+ if (state.lastSchemaRef === schema && state.flatSchemaCache) return state.flatSchemaCache;
859
+ state.flatSchemaCache = flattenSchema(schema);
860
+ state.lastSchemaRef = schema;
861
+ return state.flatSchemaCache;
862
+ }
863
+
864
+ // src/serialization/msgpack-code.ts
865
+ var loaded = null;
866
+ var loading = null;
867
+ function loadMessagePack() {
868
+ if (loaded !== null) return Promise.resolve(loaded);
869
+ loading ??= import('./msgpack-leaf-JMNGSTRW.mjs').then(
870
+ (code) => {
871
+ code.bindMsgpackHost({
872
+ BYTE_ORDER_MARK_WALK_BYTES_PER_HEADER,
873
+ DOCUMENT_ENCODER_RETAINED_BUFFER_BYTES,
874
+ DOCUMENT_REPLY_ENVELOPE_DEPTH,
875
+ ErrorCodes,
876
+ getNestedValue,
877
+ MAX_DOCUMENT_ENCODING_DEPTH,
878
+ NarsilError
879
+ });
880
+ loaded = code;
881
+ return code;
882
+ },
883
+ (cause) => {
884
+ loading = null;
885
+ throw new NarsilError(ErrorCodes.CONFIG_INVALID, "The MessagePack code could not load", {
886
+ cause: cause instanceof Error ? cause.message : String(cause)
887
+ });
888
+ }
889
+ );
890
+ return loading;
891
+ }
892
+ function loadedMessagePack() {
893
+ return loaded;
894
+ }
895
+ function requireLoadedMessagePack() {
896
+ if (loaded === null) {
897
+ throw new NarsilError(ErrorCodes.CONFIG_INVALID, "The engine reached MessagePack code before it loaded that code");
898
+ }
899
+ return loaded;
900
+ }
901
+
902
+ export { ANTIMERIDIAN_SPAN_DEGREES, DEG_TO_RAD, EARTH_RADIUS_METERS, FULL_TURN_DEGREES, LOCATION_CELLS_PER_AXIS, LOCATION_CODE_BITS_PER_AXIS, MAX_COVERING_CELLS, MAX_DOCUMENT_NESTING_DEPTH, MAX_LATITUDE_DEGREES, MAX_LONGITUDE_DEGREES, MAX_NESTING_DEPTH, MAX_PATTERN_VALUE_LIMIT, MIN_PATTERN_VALUE_LIMIT, MIN_POLYGON_POINTS, PROTOTYPE_POLLUTION_KEYS, VECTOR_PATTERN, extractVectorFieldsFromSchema, flattenSchema, getFlatSchema, getNestedValue, getOrCreateFieldNameIndex, isGeopointOrVectorType, isLatitude, isListBase, isLongitude, isPlainObject, isQuantizationMode, isSingleStringFieldType, isStorageMode, isStringValuedBase, isWordIndexedBase, isWordIndexedFieldType, loadMessagePack, loadedMessagePack, messagePackUpperBoundBytes, parseVectorDimension, parsedTypeOf, partialFieldsOf, raiseEarlierReleaseGraphSetting, requireCreatableSchema, requireDocumentWithinSizeLimit, requireLoadedMessagePack, requireValidFieldTypes, schemaFieldsOf, textFieldsChanged, tokenizeOptions, validateDocument, validateDocumentStrict, validateRequiredFields, validateSchema, validateTextStorage, validateVectorPromotion, validateVectorStorage, vectorDimensionOf, withSortableOption };