@delali/narsil 0.3.1-next.153 → 0.3.1-next.155

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 (330) hide show
  1. package/README.md +3 -1
  2. package/dist/adapters/filesystem.mjs +2 -2
  3. package/dist/adapters/gcs.mjs +2 -2
  4. package/dist/adapters/indexeddb.mjs +1 -1
  5. package/dist/adapters/s3.mjs +2 -2
  6. package/dist/{analysis-change-2OYM7ARW.mjs → analysis-change-3TFIHT5E.mjs} +32 -23
  7. package/dist/{react-native/chunks/analysis-change-entry-CXNRW324.mjs → analysis-change-entry-KA6JAO4X.mjs} +1 -1
  8. package/dist/archive-history-E4R73RWD.mjs +29 -0
  9. package/dist/browser/{analysis-change-2V2HZ2NY.mjs → analysis-change-TC36BU47.mjs} +39 -10
  10. package/dist/{analysis-change-entry-QD7YNDEE.mjs → browser/analysis-change-entry-4MH3CZXH.mjs} +1 -1
  11. package/dist/browser/archive-history-4IP5XQZY.mjs +29 -0
  12. package/dist/browser/chunk-23XRXIBW.mjs +85 -0
  13. package/dist/browser/chunk-3UIEB4QF.mjs +63 -0
  14. package/dist/browser/{chunk-CSCKZBVJ.mjs → chunk-4EWUGZYZ.mjs} +4 -4
  15. package/dist/browser/chunk-4WCVMOU3.mjs +151 -0
  16. package/dist/browser/{chunk-QJCO3TJU.mjs → chunk-56W3HQVJ.mjs} +9 -150
  17. package/dist/{react-native/chunks/chunk-VGUWIZFQ.mjs → browser/chunk-5TCXK5SB.mjs} +2 -2
  18. package/dist/browser/chunk-5W3MMTLG.mjs +19 -0
  19. package/dist/browser/chunk-7IGKGWSQ.mjs +79 -0
  20. package/dist/browser/chunk-A5KUEGDY.mjs +241 -0
  21. package/dist/browser/{chunk-HT7J73QL.mjs → chunk-ABCXENU5.mjs} +2 -2
  22. package/dist/browser/chunk-ATEBYXP6.mjs +10 -0
  23. package/dist/browser/chunk-BXM5XOCA.mjs +315 -0
  24. package/dist/browser/chunk-CJSYBQ4J.mjs +100 -0
  25. package/dist/browser/chunk-DSXIBE6N.mjs +78 -0
  26. package/dist/browser/chunk-ELV4OZOI.mjs +29 -0
  27. package/dist/{react-native/chunks/chunk-QC4ZRBSX.mjs → browser/chunk-EXQZGUQH.mjs} +2 -79
  28. package/dist/browser/{chunk-2A2IPRC3.mjs → chunk-FNIFPFB7.mjs} +5 -31
  29. package/dist/browser/chunk-G64Q6OJF.mjs +96 -0
  30. package/dist/browser/chunk-GPPOG6PT.mjs +9 -0
  31. package/dist/browser/chunk-IKDKX5VQ.mjs +1007 -0
  32. package/dist/browser/chunk-JIJXMI42.mjs +1829 -0
  33. package/dist/browser/chunk-JVBP5EYO.mjs +1106 -0
  34. package/dist/browser/{chunk-TQ5UMFG5.mjs → chunk-K4GCSZLI.mjs} +15 -6
  35. package/dist/browser/{chunk-PM4MUM5N.mjs → chunk-K5AXJBLL.mjs} +6 -5
  36. package/dist/browser/chunk-KKAMCABR.mjs +432 -0
  37. package/dist/browser/{chunk-IAXZAVYL.mjs → chunk-LFIWRCEA.mjs} +1 -159
  38. package/dist/browser/chunk-M3MQE2X7.mjs +151 -0
  39. package/dist/browser/chunk-ML7THVLJ.mjs +38 -0
  40. package/dist/browser/chunk-NLWTBAGB.mjs +111 -0
  41. package/dist/browser/chunk-OEDCEZXJ.mjs +92 -0
  42. package/dist/browser/{chunk-MPK76GVS.mjs → chunk-RA6LSBCM.mjs} +1 -21
  43. package/dist/browser/{chunk-GJKXW3SF.mjs → chunk-RND5CLX3.mjs} +147 -253
  44. package/dist/{react-native/chunks/chunk-DFQJ4IJB.mjs → browser/chunk-RQBUNZQW.mjs} +2 -2
  45. package/dist/browser/{chunk-VD7JEUIR.mjs → chunk-RRO3EV4C.mjs} +9 -8
  46. package/dist/browser/{chunk-KWYQ6KX4.mjs → chunk-SMEQ36NT.mjs} +162 -2019
  47. package/dist/{chunk-MDF6PDIA.mjs → browser/chunk-SRMZXJSL.mjs} +8 -1
  48. package/dist/browser/{chunk-7ZJTRUVW.mjs → chunk-SUDNZKPL.mjs} +2 -2
  49. package/dist/browser/{chunk-LURXVCHG.mjs → chunk-U3JOQGWX.mjs} +1 -1
  50. package/dist/browser/chunk-VI7BQR4U.mjs +21 -0
  51. package/dist/browser/{chunk-B3JM6Z74.mjs → chunk-XY4VVBBO.mjs} +3 -2
  52. package/dist/browser/chunk-YJHGOJAC.mjs +15 -0
  53. package/dist/browser/chunk-ZI2V4VD7.mjs +21 -0
  54. package/dist/browser/{cold-module-YECAK4MN.mjs → cold-module-NEUGHUPA.mjs} +21 -14
  55. package/dist/browser/durability-config-TIYKW6XX.mjs +89 -0
  56. package/dist/browser/{durability-wiring-LM7WFL6X.mjs → durability-wiring-CVGPRO6D.mjs} +1299 -881
  57. package/dist/browser/engine-hooks-YXMPHZKZ.mjs +16 -0
  58. package/dist/browser/import-OM6QAW45.mjs +18 -0
  59. package/dist/browser/methods-KTQCSIN4.mjs +30 -0
  60. package/dist/browser/{module-XQLEOYNM.mjs → module-3HNFCBJ5.mjs} +10 -8
  61. package/dist/browser/{module-KAMRAJLE.mjs → module-E33X4AOK.mjs} +17 -10
  62. package/dist/browser/operations-OJ3BXS55.mjs +5 -0
  63. package/dist/browser/{phrase-module-CNKMUY4U.mjs → phrase-module-ZXXU7S3B.mjs} +1 -1
  64. package/dist/browser/{pool-DTYSPBMQ.mjs → pool-3JLET5RO.mjs} +3 -2
  65. package/dist/browser/restore-hooks-IF2ZROUP.mjs +113 -0
  66. package/dist/browser/restore-queue-ZBS7CJA6.mjs +55 -0
  67. package/dist/browser/retention-ASWUHAYI.mjs +209 -0
  68. package/dist/browser/{runtime-D2ULZGCN.mjs → runtime-OTAGEFQW.mjs} +1 -1
  69. package/dist/browser/{snapshot-UGZVMP4H.mjs → snapshot-PN7ZW6Q4.mjs} +80 -315
  70. package/dist/browser/start-ZIRB7MQ2.mjs +24 -0
  71. package/dist/browser/sync-state-P5XG6LTQ.mjs +15 -0
  72. package/dist/browser/{write-I5P5MW4O.mjs → write-HMDYCTV2.mjs} +17 -11
  73. package/dist/{capabilities-BT-HLDC8.d.ts → capabilities-Da4ywVVl.d.ts} +94 -7
  74. package/dist/{chunk-LDGGR7YT.mjs → chunk-2MANFZJ3.mjs} +2 -2
  75. package/dist/{chunk-IZT3G24Q.mjs → chunk-2NE7VCYE.mjs} +2 -2
  76. package/dist/{chunk-3TVDTACC.mjs → chunk-3C7MTCCI.mjs} +1 -1
  77. package/dist/chunk-3HB3PEC6.mjs +240 -0
  78. package/dist/chunk-3HHQLEEQ.mjs +1092 -0
  79. package/dist/chunk-3OH67G7R.mjs +214 -0
  80. package/dist/{chunk-ZS6CMXAE.mjs → chunk-3R4UZWQG.mjs} +98 -250
  81. package/dist/{chunk-65WCV5JO.mjs → chunk-4BYWRYPM.mjs} +1 -1
  82. package/dist/{chunk-SOUZMPME.mjs → chunk-4KRC2APY.mjs} +7 -194
  83. package/dist/{chunk-5QMHMELB.mjs → chunk-5FLRXF73.mjs} +8 -1
  84. package/dist/chunk-5FVU47TB.mjs +20 -0
  85. package/dist/chunk-5YNRKI2C.mjs +81 -0
  86. package/dist/chunk-6L3XJXGU.mjs +470 -0
  87. package/dist/chunk-6MSZ543Y.mjs +32 -0
  88. package/dist/{chunk-T4CJDBBE.mjs → chunk-6OEGXLBX.mjs} +1 -1
  89. package/dist/{chunk-3SBJVQLL.mjs → chunk-6RC4K46J.mjs} +2 -2
  90. package/dist/chunk-7GXJUJ24.mjs +49 -0
  91. package/dist/{chunk-FNBNZCGP.mjs → chunk-AILVAOLX.mjs} +2 -2
  92. package/dist/chunk-BDRIVYOK.mjs +72 -0
  93. package/dist/chunk-BUMREPLU.mjs +15 -0
  94. package/dist/chunk-BY6ZDGYS.mjs +50 -0
  95. package/dist/{chunk-5WB2A3XU.mjs → chunk-DCNKVEDB.mjs} +511 -27
  96. package/dist/{chunk-NITCPDFL.mjs → chunk-DIBHI6W5.mjs} +2 -2
  97. package/dist/{chunk-4QCSHLNM.mjs → chunk-DUOLGBTE.mjs} +3 -3
  98. package/dist/chunk-GES7U2PM.mjs +68 -0
  99. package/dist/chunk-GH4WQ22V.mjs +34 -0
  100. package/dist/chunk-GQPTDQCL.mjs +54 -0
  101. package/dist/chunk-H4KHPLHJ.mjs +382 -0
  102. package/dist/{chunk-7TE2AJIH.mjs → chunk-H6VIGE62.mjs} +13 -10
  103. package/dist/{chunk-J7M73VY7.mjs → chunk-HJJI72X7.mjs} +1 -1
  104. package/dist/{chunk-DGRM4EZZ.mjs → chunk-HNVVEQP7.mjs} +1 -1
  105. package/dist/{chunk-RBEHLIKX.mjs → chunk-HW5TNXBO.mjs} +35 -11
  106. package/dist/{chunk-KYVRZAYP.mjs → chunk-I54T6CQP.mjs} +2 -69
  107. package/dist/{chunk-IRWP524D.mjs → chunk-INJYO3BU.mjs} +1 -1
  108. package/dist/chunk-IPN7S4KX.mjs +130 -0
  109. package/dist/{chunk-CSHHU7PA.mjs → chunk-J4IWBIVY.mjs} +11 -30
  110. package/dist/{chunk-G5KHSM6E.mjs → chunk-K4ZIGL2O.mjs} +1 -1
  111. package/dist/{chunk-6RKSY3BX.mjs → chunk-KBDBPVLN.mjs} +5 -5
  112. package/dist/{chunk-J4BDAH2W.mjs → chunk-KBKEXQZA.mjs} +2 -2
  113. package/dist/{chunk-IJSFWGVW.mjs → chunk-KFLK5NA2.mjs} +3 -3
  114. package/dist/{chunk-YGQOPB2Z.mjs → chunk-KHKIRS5D.mjs} +1 -1
  115. package/dist/chunk-KJ3RTZDJ.mjs +101 -0
  116. package/dist/{chunk-2PNYKG2D.mjs → chunk-KMUNHGBQ.mjs} +139 -432
  117. package/dist/chunk-KP7TYHWT.mjs +92 -0
  118. package/dist/{chunk-VP6XRMWR.mjs → chunk-KPIV4RUC.mjs} +6 -32
  119. package/dist/{chunk-NPXVQS33.mjs → chunk-KXCVQWOR.mjs} +4 -3
  120. package/dist/chunk-KYYABCSW.mjs +72 -0
  121. package/dist/{chunk-6F6USYII.mjs → chunk-L7ZD4L3K.mjs} +267 -265
  122. package/dist/{chunk-U46IZNCW.mjs → chunk-LC3FDWTX.mjs} +3 -2
  123. package/dist/{chunk-6BWLDLS3.mjs → chunk-LHKOSI2J.mjs} +1 -1
  124. package/dist/chunk-LNGE7SLY.mjs +151 -0
  125. package/dist/{react-native/chunks/chunk-YH7W556M.mjs → chunk-MP7ABPTD.mjs} +12 -2
  126. package/dist/chunk-MT2NRTA6.mjs +216 -0
  127. package/dist/chunk-NF4DT3IH.mjs +85 -0
  128. package/dist/{chunk-POUYICOU.mjs → chunk-OIJ64LGT.mjs} +1 -1
  129. package/dist/{chunk-SEAJS664.mjs → chunk-PCRA7HTI.mjs} +5 -5
  130. package/dist/chunk-PHQNACDT.mjs +63 -0
  131. package/dist/chunk-Q622CTMC.mjs +74 -0
  132. package/dist/{chunk-NVTFQFUL.mjs → chunk-Q7G3BV3Y.mjs} +1 -1
  133. package/dist/chunk-QDZJM7NI.mjs +23 -0
  134. package/dist/{chunk-52QQWEBS.mjs → chunk-QH3YIQP4.mjs} +36 -7
  135. package/dist/chunk-QJVOLKU6.mjs +111 -0
  136. package/dist/chunk-QUJHMPTP.mjs +30 -0
  137. package/dist/{chunk-3E4RRF5J.mjs → chunk-RSVULW4Q.mjs} +100 -8
  138. package/dist/{chunk-IJPK5PGM.mjs → chunk-RVGRFOGN.mjs} +1 -1
  139. package/dist/chunk-RZWWB2XR.mjs +96 -0
  140. package/dist/{chunk-KQJVNPRM.mjs → chunk-S2EQU2GE.mjs} +19 -16
  141. package/dist/chunk-S5LN746F.mjs +10 -0
  142. package/dist/{chunk-LJ4ENXOD.mjs → chunk-SG3JBNHY.mjs} +2 -2
  143. package/dist/{chunk-B2FTZNNF.mjs → chunk-SMVH6JBE.mjs} +34 -14
  144. package/dist/chunk-SY3EWKQY.mjs +242 -0
  145. package/dist/{chunk-NYSONUB7.mjs → chunk-TQXHPFWT.mjs} +1 -1
  146. package/dist/{chunk-ZHAXP7SD.mjs → chunk-U4BS74YN.mjs} +26 -238
  147. package/dist/chunk-UHICS3JI.mjs +83 -0
  148. package/dist/chunk-UZRZKNNZ.mjs +101 -0
  149. package/dist/chunk-V6EUBAIT.mjs +19 -0
  150. package/dist/{chunk-TTCKT2RT.mjs → chunk-VGF7CFRP.mjs} +134 -11
  151. package/dist/chunk-VHBNF4MA.mjs +543 -0
  152. package/dist/{chunk-AWNHDBKV.mjs → chunk-VQEUR6T6.mjs} +16 -8
  153. package/dist/chunk-WQRN64Q6.mjs +196 -0
  154. package/dist/{chunk-DMNPYF54.mjs → chunk-WZ7YV54N.mjs} +2 -2
  155. package/dist/chunk-Y4WPNHMC.mjs +50 -0
  156. package/dist/{chunk-2HJWQPR6.mjs → chunk-YEDIDCR7.mjs} +6 -122
  157. package/dist/chunk-YEKL4JBK.mjs +96 -0
  158. package/dist/{chunk-UGVUW27S.mjs → chunk-Z2BE2MAM.mjs} +14 -10
  159. package/dist/{chunk-3HV7M5OJ.mjs → chunk-ZAUJFLEN.mjs} +11 -135
  160. package/dist/{chunk-FDG4KXX5.mjs → chunk-ZHCUZZE5.mjs} +6 -4
  161. package/dist/chunk-ZTW5WTGG.mjs +167 -0
  162. package/dist/chunk-ZYAY26KG.mjs +29 -0
  163. package/dist/{client-Cn3gNxUU.d.ts → client-DRv7UVeY.d.ts} +193 -11
  164. package/dist/client.d.ts +9 -7
  165. package/dist/client.mjs +120 -7
  166. package/dist/{cold-module-PYSSBIL7.mjs → cold-module-7XXCEGTZ.mjs} +43 -33
  167. package/dist/config-CoSig5Ox.d.ts +482 -0
  168. package/dist/{config-CfhH1IWQ.d.ts → config-DMwffLKn.d.ts} +20 -5
  169. package/dist/{direct-executor-WYALQSMD.mjs → direct-executor-G5TK7NLA.mjs} +18 -13
  170. package/dist/distribution/coordinator/etcd.d.ts +2 -2
  171. package/dist/distribution/coordinator/etcd.mjs +1 -1
  172. package/dist/distribution/coordinator/in-memory.d.ts +2 -2
  173. package/dist/distribution/transport/grpc.mjs +4 -4
  174. package/dist/distribution/transport/in-memory.mjs +2 -2
  175. package/dist/distribution/transport/tcp.mjs +3 -3
  176. package/dist/distribution.d.ts +41 -9
  177. package/dist/distribution.mjs +9304 -7271
  178. package/dist/durability-config-GE4U7MCZ.mjs +89 -0
  179. package/dist/{durability-wiring-7VBZEJLG.mjs → durability-wiring-NCKUC5EO.mjs} +1293 -872
  180. package/dist/embeddings/openai.mjs +2 -2
  181. package/dist/{config-aIsy7mcL.d.ts → engine-CFxPYqEk.d.ts} +716 -407
  182. package/dist/engine-hooks-DHCMOADY.mjs +47 -0
  183. package/dist/{import-GJOMB2HC.mjs → import-NBFXFCSG.mjs} +32 -24
  184. package/dist/{index-MsF7e5hL.d.ts → index-C4AmUnl1.d.ts} +1 -1
  185. package/dist/index.browser.mjs +9 -4
  186. package/dist/index.d.ts +7 -6
  187. package/dist/index.mjs +29 -21
  188. package/dist/index.react-native.mjs +19 -12
  189. package/dist/{long-query-thread-SCUE62TO.mjs → long-query-thread-J4DVRM4A.mjs} +33 -19
  190. package/dist/methods-7IOINERF.mjs +30 -0
  191. package/dist/{module-6RLIKSZQ.mjs → module-DWKPBSMN.mjs} +38 -28
  192. package/dist/{module-AVQEIB7O.mjs → module-UN76TF7I.mjs} +14 -14
  193. package/dist/operations-G5EP6JPX.mjs +5 -0
  194. package/dist/{paged-partition-archive-KGRW366Y.mjs → paged-partition-archive-DPNWVSK2.mjs} +46 -31
  195. package/dist/partial-words.mjs +7 -5
  196. package/dist/pattern.mjs +4 -3
  197. package/dist/persistence/durability/checkpoint-worker.d.ts +16 -1
  198. package/dist/persistence/durability/checkpoint-worker.mjs +40 -29
  199. package/dist/{phrase-module-OUQIRUQU.mjs → phrase-module-ZI4WSQVH.mjs} +1 -1
  200. package/dist/{pool-UPV5PVPY.mjs → pool-Y4A46T36.mjs} +2 -2
  201. package/dist/query-suggestions/merge-worker.d.ts +55 -0
  202. package/dist/query-suggestions/merge-worker.mjs +81 -0
  203. package/dist/query-suggestions-CBYkrQ5T.d.ts +311 -0
  204. package/dist/query-suggestions.browser.mjs +246 -0
  205. package/dist/query-suggestions.d.ts +20 -0
  206. package/dist/query-suggestions.mjs +62 -0
  207. package/dist/react-native/chunks/{analysis-change-DXPZRGWF.mjs → analysis-change-6BPDPH6K.mjs} +50 -19
  208. package/dist/{browser/analysis-change-entry-JL5U2N3Q.mjs → react-native/chunks/analysis-change-entry-JLL42PH6.mjs} +1 -1
  209. package/dist/react-native/chunks/archive-history-MJKUQLSU.mjs +29 -0
  210. package/dist/react-native/chunks/chunk-3JIBF3XT.mjs +191 -0
  211. package/dist/react-native/chunks/chunk-3NQOVO3K.mjs +1 -0
  212. package/dist/react-native/chunks/{chunk-UFNCLEQM.mjs → chunk-4DII3ZSM.mjs} +1 -1
  213. package/dist/react-native/chunks/{chunk-BRNAVOKP.mjs → chunk-4J74WHQM.mjs} +2 -2
  214. package/dist/react-native/chunks/chunk-4LCEN2IU.mjs +315 -0
  215. package/dist/react-native/chunks/{chunk-PU55IOG4.mjs → chunk-4Y53T4YE.mjs} +6 -190
  216. package/dist/react-native/chunks/chunk-5CQX3XXV.mjs +17 -0
  217. package/dist/react-native/chunks/chunk-6VBXNFLE.mjs +9 -0
  218. package/dist/react-native/chunks/chunk-6WA3C3DV.mjs +85 -0
  219. package/dist/react-native/chunks/chunk-7GRCBBME.mjs +63 -0
  220. package/dist/react-native/chunks/{chunk-2J2727V4.mjs → chunk-7PXRWYUU.mjs} +1 -1
  221. package/dist/{browser/chunk-VBX2TI5V.mjs → react-native/chunks/chunk-ALOIBXWN.mjs} +2 -2
  222. package/dist/react-native/chunks/{chunk-FS7BYE23.mjs → chunk-C3PTWYKT.mjs} +10 -153
  223. package/dist/react-native/chunks/{chunk-DKJTZ625.mjs → chunk-C5G6TJ7A.mjs} +2 -69
  224. package/dist/react-native/chunks/chunk-CHPTFFJM.mjs +43 -0
  225. package/dist/react-native/chunks/{chunk-LRGWK367.mjs → chunk-CKNRFDTZ.mjs} +1 -1
  226. package/dist/react-native/chunks/chunk-CUH5F57W.mjs +242 -0
  227. package/dist/react-native/chunks/chunk-DIYDOIM4.mjs +10 -0
  228. package/dist/{browser/chunk-55WYRLDZ.mjs → react-native/chunks/chunk-DVDX4SDR.mjs} +2 -2
  229. package/dist/{browser/chunk-PIS7ZAP7.mjs → react-native/chunks/chunk-DZ7H7D2C.mjs} +12 -2
  230. package/dist/react-native/chunks/{chunk-KOCTCUXW.mjs → chunk-EIOYM5TO.mjs} +17 -9
  231. package/dist/react-native/chunks/chunk-F753DA54.mjs +23 -0
  232. package/dist/react-native/chunks/chunk-GIZTJXYW.mjs +1007 -0
  233. package/dist/react-native/chunks/{chunk-CLE3LZ77.mjs → chunk-GJFXPHXI.mjs} +5 -4
  234. package/dist/react-native/chunks/chunk-H3MDVPBO.mjs +151 -0
  235. package/dist/react-native/chunks/{chunk-IDFMNRIC.mjs → chunk-HUOYZJ3Q.mjs} +140 -430
  236. package/dist/react-native/chunks/chunk-IYNT75CE.mjs +111 -0
  237. package/dist/react-native/chunks/chunk-JDOEEMEF.mjs +38 -0
  238. package/dist/react-native/chunks/{chunk-LQAKO5QV.mjs → chunk-JLIIWJUV.mjs} +2 -2
  239. package/dist/react-native/chunks/chunk-JWUCMVRK.mjs +15 -0
  240. package/dist/react-native/chunks/chunk-KJIG57UD.mjs +1106 -0
  241. package/dist/react-native/chunks/{chunk-KLZGAOLT.mjs → chunk-KTTAU63H.mjs} +5 -5
  242. package/dist/react-native/chunks/chunk-LU3Y3P63.mjs +68 -0
  243. package/dist/{browser/chunk-NVEJJP4R.mjs → react-native/chunks/chunk-LZSLNSUN.mjs} +2 -79
  244. package/dist/react-native/chunks/{chunk-3CTWSQRW.mjs → chunk-MJDQU5MW.mjs} +4 -30
  245. package/dist/react-native/chunks/{chunk-NFGBOI46.mjs → chunk-MVXELMJX.mjs} +1 -1
  246. package/dist/react-native/chunks/{chunk-D7LFYPYI.mjs → chunk-N2WUOWLL.mjs} +12 -10
  247. package/dist/react-native/chunks/chunk-NVVRSRX5.mjs +78 -0
  248. package/dist/react-native/chunks/{chunk-JYL35A4A.mjs → chunk-OL3WDV53.mjs} +7 -33
  249. package/dist/react-native/chunks/chunk-PB2YXVQW.mjs +29 -0
  250. package/dist/react-native/chunks/{chunk-UCJU6WNH.mjs → chunk-PEHS2UO3.mjs} +7 -6
  251. package/dist/react-native/chunks/chunk-PJHAB5ZY.mjs +79 -0
  252. package/dist/react-native/chunks/chunk-Q32DDFKX.mjs +19 -0
  253. package/dist/react-native/chunks/chunk-QJXTNPLQ.mjs +100 -0
  254. package/dist/react-native/chunks/{chunk-ZCKNBPQ4.mjs → chunk-RDWG33MM.mjs} +2 -2
  255. package/dist/react-native/chunks/chunk-SUPXRTMD.mjs +96 -0
  256. package/dist/react-native/chunks/chunk-TYIRMPD3.mjs +432 -0
  257. package/dist/react-native/chunks/{chunk-TLYD7IJ2.mjs → chunk-U4KSKA4Z.mjs} +1 -1
  258. package/dist/react-native/chunks/chunk-UNUFZ2QY.mjs +68 -0
  259. package/dist/react-native/chunks/{chunk-7IQR3SZO.mjs → chunk-VXGE4ZXL.mjs} +151 -257
  260. package/dist/react-native/chunks/{chunk-R4OPUZQ5.mjs → chunk-WBYQRHDY.mjs} +2 -2
  261. package/dist/react-native/chunks/chunk-YH7QY657.mjs +288 -0
  262. package/dist/react-native/chunks/chunk-ZZT7CEN7.mjs +92 -0
  263. package/dist/react-native/chunks/{cold-module-KFGEWYEL.mjs → cold-module-5PHF6DZR.mjs} +31 -22
  264. package/dist/react-native/chunks/durability-config-QXVZEO7T.mjs +89 -0
  265. package/dist/react-native/chunks/{durability-wiring-QKJB2QBT.mjs → durability-wiring-KO565FZC.mjs} +1309 -889
  266. package/dist/react-native/chunks/engine-hooks-MVRRHH6B.mjs +28 -0
  267. package/dist/react-native/chunks/gzip.react-native-HLEPDKZ3.mjs +3 -0
  268. package/dist/react-native/chunks/import-YVZA4V4V.mjs +30 -0
  269. package/dist/react-native/chunks/methods-6W5U4C3H.mjs +30 -0
  270. package/dist/react-native/chunks/{module-UJ5VUARS.mjs → module-H5MVPSP2.mjs} +13 -11
  271. package/dist/react-native/chunks/module-ZL5ZG6YB.mjs +34 -0
  272. package/dist/react-native/chunks/operations-GNRMD6EX.mjs +5 -0
  273. package/dist/react-native/chunks/{phrase-module-76UAPPSG.mjs → phrase-module-RTVKEWJT.mjs} +1 -1
  274. package/dist/react-native/chunks/{pool-CD4ANYUI.mjs → pool-JR3NJCAF.mjs} +3 -2
  275. package/dist/react-native/chunks/restore-hooks-SILFPU6B.mjs +125 -0
  276. package/dist/react-native/chunks/restore-queue-HSYP2AEC.mjs +55 -0
  277. package/dist/react-native/chunks/retention-7I7UAWYK.mjs +221 -0
  278. package/dist/react-native/chunks/{runtime-3MCDLJAF.mjs → runtime-R5E3TB3J.mjs} +1 -1
  279. package/dist/react-native/chunks/{snapshot-KVBD4LRC.mjs → snapshot-EZYB6SLF.mjs} +90 -323
  280. package/dist/react-native/chunks/start-SHVZ72I5.mjs +36 -0
  281. package/dist/react-native/chunks/sync-state-PASCIHHT.mjs +15 -0
  282. package/dist/react-native/chunks/{write-ES5A3WUA.mjs → write-JUESXHDL.mjs} +27 -19
  283. package/dist/react-native/partial-words.mjs +8 -5
  284. package/dist/react-native/pattern.mjs +4 -3
  285. package/dist/react-native/query-suggestions.mjs +258 -0
  286. package/dist/react-native/sync.mjs +2299 -0
  287. package/dist/react-native/synonyms.mjs +7 -4
  288. package/dist/react.d.ts +11 -10
  289. package/dist/react.mjs +8 -1
  290. package/dist/{rerank-3W54N6P2.mjs → rerank-MQ37IYRV.mjs} +4 -4
  291. package/dist/rerankers/http.mjs +2 -2
  292. package/dist/restore-hooks-HZ3ILAMO.mjs +146 -0
  293. package/dist/restore-queue-JVGENGGE.mjs +55 -0
  294. package/dist/retention-HROPV2QU.mjs +59 -0
  295. package/dist/{runtime-L2DZYY6N.mjs → runtime-COIUORCN.mjs} +5 -5
  296. package/dist/{schema-D33CyXCy.d.ts → schema-Jwt928nJ.d.ts} +1 -1
  297. package/dist/server.d.ts +119 -20
  298. package/dist/server.mjs +1123 -58
  299. package/dist/{snapshot-WMX6JCLP.mjs → snapshot-4HS2G2UM.mjs} +106 -49
  300. package/dist/start-UTWHGH42.mjs +59 -0
  301. package/dist/sync/filesystem.d.ts +30 -0
  302. package/dist/sync/filesystem.mjs +271 -0
  303. package/dist/sync/indexeddb.d.ts +30 -0
  304. package/dist/sync/indexeddb.mjs +237 -0
  305. package/dist/sync-state-ZWHLAFLE.mjs +15 -0
  306. package/dist/sync.browser.mjs +2294 -0
  307. package/dist/sync.d.ts +23 -0
  308. package/dist/sync.mjs +2268 -0
  309. package/dist/synonyms.mjs +6 -4
  310. package/dist/{tasks-C4ElXr4P.d.ts → tasks-qrJojgST.d.ts} +13 -5
  311. package/dist/thread-6MOXY2KD.mjs +45 -0
  312. package/dist/types-BZCGjfLn.d.ts +227 -0
  313. package/dist/vector/search-worker.d.ts +1 -1
  314. package/dist/vector/search-worker.mjs +7 -7
  315. package/dist/workers/entry.mjs +8 -8
  316. package/dist/{write-SKJ6HW7O.mjs → write-GTTWWRRG.mjs} +36 -28
  317. package/openapi.json +912 -5
  318. package/package.json +45 -8
  319. package/dist/browser/import-QOY6ZH6X.mjs +0 -12
  320. package/dist/browser/restore-queue-UQ6AAUVX.mjs +0 -41
  321. package/dist/chunk-7LDMWKP6.mjs +0 -209
  322. package/dist/engine-CJRUHXgf.d.ts +0 -664
  323. package/dist/react-native/chunks/chunk-L4M7QJNP.mjs +0 -110
  324. package/dist/react-native/chunks/chunk-TJMSKBEM.mjs +0 -25
  325. package/dist/react-native/chunks/gzip.react-native-7JWCLVOB.mjs +0 -3
  326. package/dist/react-native/chunks/import-XFBCCENV.mjs +0 -22
  327. package/dist/react-native/chunks/module-FHJ2GOBI.mjs +0 -25
  328. package/dist/react-native/chunks/restore-queue-H5VCN453.mjs +0 -41
  329. package/dist/restore-queue-AOF5OTQV.mjs +0 -41
  330. package/dist/thread-I7DVHHW7.mjs +0 -31
@@ -1,17 +1,19 @@
1
- import { normalizeSort, requireMatchingCursor, encodePageCursor, decodePageCursor, projectionKeepsField, resolveProjection, clampRowCount, bm25SetsValue, sortSignatureOf, requireSortableFields, analyseQueryPhrases, requireLoadedPhraseCode, fanOutQuery, loadPhraseCodeFor, requireWithinResultWindow, sortModesOf, applySorting, applyPagination, countsWithoutScores, fanOutMatchCount, validatedFilterOf, createPatternWorkMeter, partialWordsToHighlight, partialWordHighlighter, pruneStatsToQueryTerms, mergeBM25Levels, everyValueFacetConfig, fulltextMatches, mergeFacets, applyPartitionFiltersBitset, readOldGenerationStatistics, readResidentMemory, partitionsIn, undeclaredFieldOnStrictIndex, MAX_BM25_K1, MAX_BM25_B } from './chunk-3HV7M5OJ.mjs';
2
- import { FNV_OFFSET_BASIS, fnv1aContinue, fnv1aContinueTaggedNumbers } from './chunk-KAKQ74LS.mjs';
3
1
  import { admittedHeapBytes } from './chunk-XIHUI4KB.mjs';
4
- import { engineThreadYoungGenerationBytes } from './chunk-Q2UL2TPC.mjs';
5
2
  import { MAX_INDEX_NAME_LENGTH, INDEX_NAME_PATTERN, MAX_DOC_ID_LENGTH, DEFAULT_LIMIT, DEFAULT_SUGGEST_LIMIT, MAX_SUGGEST_LIMIT, MAX_SUGGEST_SCATTER_LIMIT, ABSOLUTE_WINDOWS_PATH_PATTERN, MODULE_URL_SCHEME_PATTERN, DEFAULT_OFFSET } from './chunk-EEBCDP36.mjs';
6
- import { MIN_OVERSAMPLE } from './chunk-NVTFQFUL.mjs';
7
- import { turnIsSpent, yieldTurn } from './chunk-LQG5G2LY.mjs';
8
- import { MAX_RENUMBERED_SEARCH_ATTEMPTS } from './chunk-BTPGQC6Z.mjs';
9
- import { flattenSchema, partialFieldsOf } from './chunk-SOUZMPME.mjs';
3
+ import { normalizeSort, requireMatchingCursor, encodePageCursor, decodePageCursor, projectionKeepsField, resolveProjection, clampRowCount, bm25SetsValue, sortSignatureOf, requireSortableFields, analyseQueryPhrases, requireLoadedPhraseCode, fanOutQuery, loadPhraseCodeFor, requireWithinResultWindow, sortModesOf, applySorting, applyPagination, countsWithoutScores, fanOutMatchCount, validatedFilterOf, createPatternWorkMeter, partialWordsToHighlight, partialWordHighlighter, pruneStatsToQueryTerms, mergeBM25Levels, everyValueFacetConfig, fulltextMatches, mergeFacets, applyPartitionFiltersBitset, readResidentMemory, partitionsIn, undeclaredFieldOnStrictIndex, MAX_BM25_K1, MAX_BM25_B } from './chunk-ZAUJFLEN.mjs';
4
+ import { readOldGenerationStatistics } from './chunk-IPN7S4KX.mjs';
5
+ import { FNV_OFFSET_BASIS, fnv1aContinue, fnv1aContinueTaggedNumbers } from './chunk-KAKQ74LS.mjs';
6
+ import { engineThreadYoungGenerationBytes } from './chunk-Q2UL2TPC.mjs';
10
7
  import { DEFAULT_MAX_PER_GROUP, DEFAULT_FUZZY_PREFIX_LENGTH, BM25_DISPLAYED_NAME_LENGTH, DEFAULT_LINEAR_ALPHA, MIN_LINEAR_ALPHA, MAX_LINEAR_ALPHA, DEFAULT_RANK_CONSTANT, MIN_RANK_CONSTANT, RESULT_WINDOW, MAX_TOLERANCE, MAX_PREFIX_LENGTH } from './chunk-FQBFZAWG.mjs';
11
- import { tokenize } from './chunk-65WCV5JO.mjs';
12
- import { isStringValuedBase, parsedTypeOf, isWordIndexedFieldType, fuzzyTermMatches } from './chunk-KYVRZAYP.mjs';
8
+ import { flattenSchema, partialFieldsOf } from './chunk-WQRN64Q6.mjs';
9
+ import { fuzzyTermMatches } from './chunk-GES7U2PM.mjs';
10
+ import { isStringValuedBase, parsedTypeOf, isWordIndexedFieldType } from './chunk-I54T6CQP.mjs';
11
+ import { tokenize } from './chunk-4BYWRYPM.mjs';
13
12
  import { MIN_PATTERN_VALUE_LIMIT, MAX_PATTERN_VALUE_LIMIT, isPlainObject, isGeopointOrVectorType, VECTOR_PATTERN } from './chunk-L5ORED7V.mjs';
14
- import { NarsilError, ErrorCodes } from './chunk-MDF6PDIA.mjs';
13
+ import { MIN_OVERSAMPLE } from './chunk-Q7G3BV3Y.mjs';
14
+ import { MAX_RENUMBERED_SEARCH_ATTEMPTS } from './chunk-BTPGQC6Z.mjs';
15
+ import { turnIsSpent, yieldTurn } from './chunk-LQG5G2LY.mjs';
16
+ import { NarsilError, ErrorCodes } from './chunk-MP7ABPTD.mjs';
15
17
  import { compareComparableKeys } from './chunk-R6A773WK.mjs';
16
18
  import { compareCodePoints, holdsUnpairedSurrogate } from './chunk-YTJCGKM4.mjs';
17
19
 
@@ -105,6 +107,259 @@ function readEngineMemoryFigures() {
105
107
  return measure();
106
108
  }
107
109
 
110
+ // src/engine/validation.ts
111
+ function now() {
112
+ if (typeof performance !== "undefined" && typeof performance.now === "function") {
113
+ return performance.now();
114
+ }
115
+ return Date.now();
116
+ }
117
+ function validateIndexName(name) {
118
+ const given = name;
119
+ if (typeof given !== "string" || name.length === 0) {
120
+ throw new NarsilError(ErrorCodes.CONFIG_INVALID, "Index name must be a string of at least one character", {
121
+ received: given === null ? "null" : typeof given
122
+ });
123
+ }
124
+ if (name.length > MAX_INDEX_NAME_LENGTH) {
125
+ throw new NarsilError(ErrorCodes.CONFIG_INVALID, `Index name must not exceed ${MAX_INDEX_NAME_LENGTH} characters`, {
126
+ indexName: name,
127
+ length: name.length
128
+ });
129
+ }
130
+ if (!INDEX_NAME_PATTERN.test(name)) {
131
+ throw new NarsilError(
132
+ ErrorCodes.CONFIG_INVALID,
133
+ `Index name "${name}" contains invalid characters; use alphanumeric, dots, hyphens, and underscores only`,
134
+ { indexName: name }
135
+ );
136
+ }
137
+ if (name.includes("..")) {
138
+ throw new NarsilError(ErrorCodes.CONFIG_INVALID, `Index name "${name}" must not contain ".."`, { indexName: name });
139
+ }
140
+ }
141
+ function validateDocId(docId) {
142
+ const given = docId;
143
+ if (typeof given !== "string") {
144
+ throw new NarsilError(ErrorCodes.DOC_VALIDATION_FAILED, "Document ID must be a string", {
145
+ received: given === null ? "null" : Array.isArray(given) ? "array" : typeof given
146
+ });
147
+ }
148
+ if (docId.length === 0) {
149
+ throw new NarsilError(ErrorCodes.DOC_VALIDATION_FAILED, "Document ID must not be empty", { docId });
150
+ }
151
+ if (docId.length > MAX_DOC_ID_LENGTH) {
152
+ throw new NarsilError(
153
+ ErrorCodes.DOC_VALIDATION_FAILED,
154
+ `Document ID must not exceed ${MAX_DOC_ID_LENGTH} characters`,
155
+ {
156
+ docId,
157
+ length: docId.length
158
+ }
159
+ );
160
+ }
161
+ if (docId.includes("\0")) {
162
+ throw new NarsilError(ErrorCodes.DOC_VALIDATION_FAILED, "Document ID must not contain null bytes", { docId });
163
+ }
164
+ if (holdsUnpairedSurrogate(docId)) {
165
+ throw new NarsilError(
166
+ ErrorCodes.DOC_VALIDATION_FAILED,
167
+ "Document ID 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",
168
+ { docId }
169
+ );
170
+ }
171
+ }
172
+ function validateBatchList(given, listed) {
173
+ if (Array.isArray(given)) return;
174
+ throw new NarsilError(ErrorCodes.DOC_VALIDATION_FAILED, `A batch takes its ${listed} as an array`, {
175
+ received: given === null ? "null" : typeof given
176
+ });
177
+ }
178
+ function validatePartitionConfig(partitions) {
179
+ const { maxDocsPerPartition, maxPartitions, watermark } = partitions;
180
+ if (maxDocsPerPartition !== void 0 && (!Number.isInteger(maxDocsPerPartition) || maxDocsPerPartition < 1)) {
181
+ throw new NarsilError(ErrorCodes.CONFIG_INVALID, "partitions.maxDocsPerPartition must be a positive integer", {
182
+ maxDocsPerPartition
183
+ });
184
+ }
185
+ if (maxPartitions !== void 0 && (!Number.isInteger(maxPartitions) || maxPartitions < 1)) {
186
+ throw new NarsilError(ErrorCodes.CONFIG_INVALID, "partitions.maxPartitions must be a positive integer", {
187
+ maxPartitions
188
+ });
189
+ }
190
+ if (watermark !== void 0 && (typeof watermark !== "number" || !(watermark > 0) || watermark > 1)) {
191
+ throw new NarsilError(ErrorCodes.CONFIG_INVALID, "partitions.watermark must be above 0 and at most 1", {
192
+ watermark
193
+ });
194
+ }
195
+ }
196
+ function requireSurfaceFormsForPartialFields(schema, surfaceForms) {
197
+ if (surfaceForms !== false) return;
198
+ const partialFields = partialFieldsOf(schema);
199
+ if (partialFields.length === 0) return;
200
+ throw new NarsilError(
201
+ ErrorCodes.CONFIG_INVALID,
202
+ `Field "${partialFields[0]}" declares "partial", which compares words as the documents wrote them, so its index needs surfaceForms left on`,
203
+ { fields: [...partialFields], surfaceForms: false }
204
+ );
205
+ }
206
+ function validatePatternValueLimit(limit) {
207
+ if (limit === void 0) return;
208
+ if (typeof limit !== "number" || !Number.isInteger(limit) || limit < MIN_PATTERN_VALUE_LIMIT || limit > MAX_PATTERN_VALUE_LIMIT) {
209
+ throw new NarsilError(
210
+ ErrorCodes.CONFIG_INVALID,
211
+ `patternValueLimit must be a whole number of code points from ${MIN_PATTERN_VALUE_LIMIT} to ${MAX_PATTERN_VALUE_LIMIT}`,
212
+ { patternValueLimit: typeof limit === "number" ? limit : String(limit) }
213
+ );
214
+ }
215
+ }
216
+ function requirePositiveSafeInteger(field, value) {
217
+ if (value === void 0) return;
218
+ if (!Number.isSafeInteger(value) || value < 1) {
219
+ throw new NarsilError(ErrorCodes.CONFIG_INVALID, `${field} must be a positive safe integer`, { field, value });
220
+ }
221
+ }
222
+ function validateBootstrapModule(bootstrapModule) {
223
+ if (bootstrapModule === void 0) return;
224
+ const absolute = bootstrapModule.startsWith("/") || ABSOLUTE_WINDOWS_PATH_PATTERN.test(bootstrapModule) || MODULE_URL_SCHEME_PATTERN.test(bootstrapModule);
225
+ if (absolute) return;
226
+ throw new NarsilError(
227
+ ErrorCodes.CONFIG_INVALID,
228
+ `workers.bootstrapModule is "${bootstrapModule}", which a worker would resolve against Narsil's own directory, so pass an absolute path or a URL such as new URL('./bootstrap.js', import.meta.url).href`,
229
+ { bootstrapModule }
230
+ );
231
+ }
232
+ function validateWorkerConfig(workers, lifecycle) {
233
+ if (workers === void 0) return;
234
+ requirePositiveSafeInteger("workers.count", workers.count);
235
+ requirePositiveSafeInteger("workers.promotionThreshold", workers.promotionThreshold);
236
+ requirePositiveSafeInteger("workers.idleTimeoutMs", workers.idleTimeoutMs);
237
+ if (workers.mainCopyQueries !== void 0 && workers.mainCopyQueries !== "lone" && workers.mainCopyQueries !== "none") {
238
+ throw new NarsilError(ErrorCodes.CONFIG_INVALID, "workers.mainCopyQueries must be 'lone' or 'none'", {
239
+ mainCopyQueries: workers.mainCopyQueries
240
+ });
241
+ }
242
+ validateBootstrapModule(workers.bootstrapModule);
243
+ const closeAfter = lifecycle?.idleTimeoutMs;
244
+ if (workers.idleTimeoutMs !== void 0 && closeAfter !== void 0 && workers.idleTimeoutMs > closeAfter) {
245
+ throw new NarsilError(
246
+ ErrorCodes.CONFIG_INVALID,
247
+ "workers.idleTimeoutMs must be at most lifecycle.idleTimeoutMs, so that an index drops its copies before it closes",
248
+ { workersIdleTimeoutMs: workers.idleTimeoutMs, lifecycleIdleTimeoutMs: closeAfter }
249
+ );
250
+ }
251
+ }
252
+ function clampLimit(limit) {
253
+ return clampRowCount(limit, DEFAULT_LIMIT);
254
+ }
255
+ function clampOffset(offset) {
256
+ return clampRowCount(offset, DEFAULT_OFFSET);
257
+ }
258
+
259
+ // src/search/bm25-params.ts
260
+ var BM25_KEYS = /* @__PURE__ */ new Set(["k1", "b", "fields"]);
261
+ var BM25_FIELD_KEYS = /* @__PURE__ */ new Set(["k1", "b"]);
262
+ function displayed(value) {
263
+ if (typeof value === "string") return `"${value.slice(0, BM25_DISPLAYED_NAME_LENGTH)}"`;
264
+ if (typeof value === "number" || typeof value === "boolean" || value === null) return String(value);
265
+ return `a value of type ${typeof value}`;
266
+ }
267
+ function requireValue(label, value, maximum, ranges) {
268
+ if (value === void 0) return;
269
+ const usable = typeof value === "number" && Number.isFinite(value) && (ranges === "stored" || value >= 0 && value <= maximum);
270
+ if (usable) return;
271
+ throw new NarsilError(
272
+ ErrorCodes.CONFIG_INVALID,
273
+ `${label} must be a finite number from 0 to ${maximum}, and this request sets ${displayed(value)}`,
274
+ { parameter: label }
275
+ );
276
+ }
277
+ function requireKnownKeys(label, value, known) {
278
+ for (const key of Object.keys(value)) {
279
+ if (known.has(key)) continue;
280
+ throw new NarsilError(
281
+ ErrorCodes.CONFIG_INVALID,
282
+ `${label} takes ${[...known].join(", ")}, and this request sets ${displayed(key)}`,
283
+ { parameter: label }
284
+ );
285
+ }
286
+ }
287
+ function requireFieldPair(name, pair, ranges) {
288
+ const label = `bm25.fields.${name.slice(0, BM25_DISPLAYED_NAME_LENGTH)}`;
289
+ if (!isPlainObject(pair)) {
290
+ throw new NarsilError(ErrorCodes.CONFIG_INVALID, `${label} must be an object that sets k1 or b`, {
291
+ parameter: label
292
+ });
293
+ }
294
+ requireKnownKeys(label, pair, BM25_FIELD_KEYS);
295
+ requireValue(`${label}.k1`, pair.k1, MAX_BM25_K1, ranges);
296
+ requireValue(`${label}.b`, pair.b, MAX_BM25_B, ranges);
297
+ }
298
+ function requireScoredField(name, flatSchema, unknownFieldCode) {
299
+ const fieldType = Object.hasOwn(flatSchema, name) ? flatSchema[name] : void 0;
300
+ if (typeof fieldType === "string" && isWordIndexedFieldType(fieldType)) return;
301
+ throw new NarsilError(
302
+ unknownFieldCode,
303
+ fieldType === void 0 ? `BM25 parameters apply to a text field that the schema declares, and the schema declares no field ${displayed(name)}` : `BM25 parameters apply to a text field alone, and the schema declares field ${displayed(name)} as ${displayed(fieldType)}`,
304
+ { field: name.slice(0, BM25_DISPLAYED_NAME_LENGTH) }
305
+ );
306
+ }
307
+ function fieldsOfCheckedSetting(raw, ranges) {
308
+ if (!isPlainObject(raw)) {
309
+ throw new NarsilError(ErrorCodes.CONFIG_INVALID, "bm25 must be an object that sets k1, b, or fields");
310
+ }
311
+ requireKnownKeys("bm25", raw, BM25_KEYS);
312
+ requireValue("bm25.k1", raw.k1, MAX_BM25_K1, ranges);
313
+ requireValue("bm25.b", raw.b, MAX_BM25_B, ranges);
314
+ const fields = raw.fields;
315
+ if (fields === void 0) return void 0;
316
+ if (!isPlainObject(fields)) {
317
+ throw new NarsilError(
318
+ ErrorCodes.CONFIG_INVALID,
319
+ "bm25.fields must be an object that maps a field to its parameters"
320
+ );
321
+ }
322
+ return fields;
323
+ }
324
+ function validateBM25Shape(raw, ranges) {
325
+ const fields = fieldsOfCheckedSetting(raw, ranges);
326
+ if (fields === void 0) return;
327
+ for (const name of Object.keys(fields)) requireFieldPair(name, fields[name], ranges);
328
+ }
329
+ function validateBM25Params(raw, schema, unknownFieldCode, ranges = "settable") {
330
+ const fields = fieldsOfCheckedSetting(raw, ranges);
331
+ if (fields === void 0) return;
332
+ const names = Object.keys(fields);
333
+ if (names.length === 0) return;
334
+ const flatSchema = flattenSchema(schema);
335
+ for (const name of names) {
336
+ requireScoredField(name, flatSchema, unknownFieldCode);
337
+ requireFieldPair(name, fields[name], ranges);
338
+ }
339
+ }
340
+ function presentPair(pair) {
341
+ return {
342
+ ...pair.k1 !== void 0 ? { k1: pair.k1 } : {},
343
+ ...pair.b !== void 0 ? { b: pair.b } : {}
344
+ };
345
+ }
346
+ function storedBM25Params(params) {
347
+ const stored = presentPair(params);
348
+ const fields = params.fields;
349
+ if (fields !== void 0) {
350
+ const kept = /* @__PURE__ */ Object.create(null);
351
+ let holdsField = false;
352
+ for (const name of Object.keys(fields)) {
353
+ const pair = presentPair(fields[name]);
354
+ if (pair.k1 === void 0 && pair.b === void 0) continue;
355
+ kept[name] = pair;
356
+ holdsField = true;
357
+ }
358
+ if (holdsField) stored.fields = kept;
359
+ }
360
+ return Object.keys(stored).length === 0 ? void 0 : stored;
361
+ }
362
+
108
363
  // src/search/cursor-binding.ts
109
364
  var ABSENT_TAG = 0;
110
365
  var NULL_TAG = 1;
@@ -315,110 +570,6 @@ function listBindingOf(filters) {
315
570
  return bindingOf(values);
316
571
  }
317
572
 
318
- // src/search/bm25-params.ts
319
- var BM25_KEYS = /* @__PURE__ */ new Set(["k1", "b", "fields"]);
320
- var BM25_FIELD_KEYS = /* @__PURE__ */ new Set(["k1", "b"]);
321
- function displayed(value) {
322
- if (typeof value === "string") return `"${value.slice(0, BM25_DISPLAYED_NAME_LENGTH)}"`;
323
- if (typeof value === "number" || typeof value === "boolean" || value === null) return String(value);
324
- return `a value of type ${typeof value}`;
325
- }
326
- function requireValue(label, value, maximum, ranges) {
327
- if (value === void 0) return;
328
- const usable = typeof value === "number" && Number.isFinite(value) && (ranges === "stored" || value >= 0 && value <= maximum);
329
- if (usable) return;
330
- throw new NarsilError(
331
- ErrorCodes.CONFIG_INVALID,
332
- `${label} must be a finite number from 0 to ${maximum}, and this request sets ${displayed(value)}`,
333
- { parameter: label }
334
- );
335
- }
336
- function requireKnownKeys(label, value, known) {
337
- for (const key of Object.keys(value)) {
338
- if (known.has(key)) continue;
339
- throw new NarsilError(
340
- ErrorCodes.CONFIG_INVALID,
341
- `${label} takes ${[...known].join(", ")}, and this request sets ${displayed(key)}`,
342
- { parameter: label }
343
- );
344
- }
345
- }
346
- function requireFieldPair(name, pair, ranges) {
347
- const label = `bm25.fields.${name.slice(0, BM25_DISPLAYED_NAME_LENGTH)}`;
348
- if (!isPlainObject(pair)) {
349
- throw new NarsilError(ErrorCodes.CONFIG_INVALID, `${label} must be an object that sets k1 or b`, {
350
- parameter: label
351
- });
352
- }
353
- requireKnownKeys(label, pair, BM25_FIELD_KEYS);
354
- requireValue(`${label}.k1`, pair.k1, MAX_BM25_K1, ranges);
355
- requireValue(`${label}.b`, pair.b, MAX_BM25_B, ranges);
356
- }
357
- function requireScoredField(name, flatSchema, unknownFieldCode) {
358
- const fieldType = Object.hasOwn(flatSchema, name) ? flatSchema[name] : void 0;
359
- if (typeof fieldType === "string" && isWordIndexedFieldType(fieldType)) return;
360
- throw new NarsilError(
361
- unknownFieldCode,
362
- fieldType === void 0 ? `BM25 parameters apply to a text field that the schema declares, and the schema declares no field ${displayed(name)}` : `BM25 parameters apply to a text field alone, and the schema declares field ${displayed(name)} as ${displayed(fieldType)}`,
363
- { field: name.slice(0, BM25_DISPLAYED_NAME_LENGTH) }
364
- );
365
- }
366
- function fieldsOfCheckedSetting(raw, ranges) {
367
- if (!isPlainObject(raw)) {
368
- throw new NarsilError(ErrorCodes.CONFIG_INVALID, "bm25 must be an object that sets k1, b, or fields");
369
- }
370
- requireKnownKeys("bm25", raw, BM25_KEYS);
371
- requireValue("bm25.k1", raw.k1, MAX_BM25_K1, ranges);
372
- requireValue("bm25.b", raw.b, MAX_BM25_B, ranges);
373
- const fields = raw.fields;
374
- if (fields === void 0) return void 0;
375
- if (!isPlainObject(fields)) {
376
- throw new NarsilError(
377
- ErrorCodes.CONFIG_INVALID,
378
- "bm25.fields must be an object that maps a field to its parameters"
379
- );
380
- }
381
- return fields;
382
- }
383
- function validateBM25Shape(raw, ranges) {
384
- const fields = fieldsOfCheckedSetting(raw, ranges);
385
- if (fields === void 0) return;
386
- for (const name of Object.keys(fields)) requireFieldPair(name, fields[name], ranges);
387
- }
388
- function validateBM25Params(raw, schema, unknownFieldCode, ranges = "settable") {
389
- const fields = fieldsOfCheckedSetting(raw, ranges);
390
- if (fields === void 0) return;
391
- const names = Object.keys(fields);
392
- if (names.length === 0) return;
393
- const flatSchema = flattenSchema(schema);
394
- for (const name of names) {
395
- requireScoredField(name, flatSchema, unknownFieldCode);
396
- requireFieldPair(name, fields[name], ranges);
397
- }
398
- }
399
- function presentPair(pair) {
400
- return {
401
- ...pair.k1 !== void 0 ? { k1: pair.k1 } : {},
402
- ...pair.b !== void 0 ? { b: pair.b } : {}
403
- };
404
- }
405
- function storedBM25Params(params) {
406
- const stored = presentPair(params);
407
- const fields = params.fields;
408
- if (fields !== void 0) {
409
- const kept = /* @__PURE__ */ Object.create(null);
410
- let holdsField = false;
411
- for (const name of Object.keys(fields)) {
412
- const pair = presentPair(fields[name]);
413
- if (pair.k1 === void 0 && pair.b === void 0) continue;
414
- kept[name] = pair;
415
- holdsField = true;
416
- }
417
- if (holdsField) stored.fields = kept;
418
- }
419
- return Object.keys(stored).length === 0 ? void 0 : stored;
420
- }
421
-
422
573
  // src/search/query-fields.ts
423
574
  function requireBoostableFields(boost, flatSchema) {
424
575
  for (const [field, weight] of Object.entries(boost)) {
@@ -628,155 +779,6 @@ function requireVectorSearchable(params, context, needsVector) {
628
779
  );
629
780
  }
630
781
 
631
- // src/engine/validation.ts
632
- function now() {
633
- if (typeof performance !== "undefined" && typeof performance.now === "function") {
634
- return performance.now();
635
- }
636
- return Date.now();
637
- }
638
- function validateIndexName(name) {
639
- const given = name;
640
- if (typeof given !== "string" || name.length === 0) {
641
- throw new NarsilError(ErrorCodes.CONFIG_INVALID, "Index name must be a string of at least one character", {
642
- received: given === null ? "null" : typeof given
643
- });
644
- }
645
- if (name.length > MAX_INDEX_NAME_LENGTH) {
646
- throw new NarsilError(ErrorCodes.CONFIG_INVALID, `Index name must not exceed ${MAX_INDEX_NAME_LENGTH} characters`, {
647
- indexName: name,
648
- length: name.length
649
- });
650
- }
651
- if (!INDEX_NAME_PATTERN.test(name)) {
652
- throw new NarsilError(
653
- ErrorCodes.CONFIG_INVALID,
654
- `Index name "${name}" contains invalid characters; use alphanumeric, dots, hyphens, and underscores only`,
655
- { indexName: name }
656
- );
657
- }
658
- if (name.includes("..")) {
659
- throw new NarsilError(ErrorCodes.CONFIG_INVALID, `Index name "${name}" must not contain ".."`, { indexName: name });
660
- }
661
- }
662
- function validateDocId(docId) {
663
- const given = docId;
664
- if (typeof given !== "string") {
665
- throw new NarsilError(ErrorCodes.DOC_VALIDATION_FAILED, "Document ID must be a string", {
666
- received: given === null ? "null" : Array.isArray(given) ? "array" : typeof given
667
- });
668
- }
669
- if (docId.length === 0) {
670
- throw new NarsilError(ErrorCodes.DOC_VALIDATION_FAILED, "Document ID must not be empty", { docId });
671
- }
672
- if (docId.length > MAX_DOC_ID_LENGTH) {
673
- throw new NarsilError(
674
- ErrorCodes.DOC_VALIDATION_FAILED,
675
- `Document ID must not exceed ${MAX_DOC_ID_LENGTH} characters`,
676
- {
677
- docId,
678
- length: docId.length
679
- }
680
- );
681
- }
682
- if (docId.includes("\0")) {
683
- throw new NarsilError(ErrorCodes.DOC_VALIDATION_FAILED, "Document ID must not contain null bytes", { docId });
684
- }
685
- if (holdsUnpairedSurrogate(docId)) {
686
- throw new NarsilError(
687
- ErrorCodes.DOC_VALIDATION_FAILED,
688
- "Document ID 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",
689
- { docId }
690
- );
691
- }
692
- }
693
- function validateBatchList(given, listed) {
694
- if (Array.isArray(given)) return;
695
- throw new NarsilError(ErrorCodes.DOC_VALIDATION_FAILED, `A batch takes its ${listed} as an array`, {
696
- received: given === null ? "null" : typeof given
697
- });
698
- }
699
- function validatePartitionConfig(partitions) {
700
- const { maxDocsPerPartition, maxPartitions, watermark } = partitions;
701
- if (maxDocsPerPartition !== void 0 && (!Number.isInteger(maxDocsPerPartition) || maxDocsPerPartition < 1)) {
702
- throw new NarsilError(ErrorCodes.CONFIG_INVALID, "partitions.maxDocsPerPartition must be a positive integer", {
703
- maxDocsPerPartition
704
- });
705
- }
706
- if (maxPartitions !== void 0 && (!Number.isInteger(maxPartitions) || maxPartitions < 1)) {
707
- throw new NarsilError(ErrorCodes.CONFIG_INVALID, "partitions.maxPartitions must be a positive integer", {
708
- maxPartitions
709
- });
710
- }
711
- if (watermark !== void 0 && (typeof watermark !== "number" || !(watermark > 0) || watermark > 1)) {
712
- throw new NarsilError(ErrorCodes.CONFIG_INVALID, "partitions.watermark must be above 0 and at most 1", {
713
- watermark
714
- });
715
- }
716
- }
717
- function requireSurfaceFormsForPartialFields(schema, surfaceForms) {
718
- if (surfaceForms !== false) return;
719
- const partialFields = partialFieldsOf(schema);
720
- if (partialFields.length === 0) return;
721
- throw new NarsilError(
722
- ErrorCodes.CONFIG_INVALID,
723
- `Field "${partialFields[0]}" declares "partial", which compares words as the documents wrote them, so its index needs surfaceForms left on`,
724
- { fields: [...partialFields], surfaceForms: false }
725
- );
726
- }
727
- function validatePatternValueLimit(limit) {
728
- if (limit === void 0) return;
729
- if (typeof limit !== "number" || !Number.isInteger(limit) || limit < MIN_PATTERN_VALUE_LIMIT || limit > MAX_PATTERN_VALUE_LIMIT) {
730
- throw new NarsilError(
731
- ErrorCodes.CONFIG_INVALID,
732
- `patternValueLimit must be a whole number of code points from ${MIN_PATTERN_VALUE_LIMIT} to ${MAX_PATTERN_VALUE_LIMIT}`,
733
- { patternValueLimit: typeof limit === "number" ? limit : String(limit) }
734
- );
735
- }
736
- }
737
- function requirePositiveSafeInteger(field, value) {
738
- if (value === void 0) return;
739
- if (!Number.isSafeInteger(value) || value < 1) {
740
- throw new NarsilError(ErrorCodes.CONFIG_INVALID, `${field} must be a positive safe integer`, { field, value });
741
- }
742
- }
743
- function validateBootstrapModule(bootstrapModule) {
744
- if (bootstrapModule === void 0) return;
745
- const absolute = bootstrapModule.startsWith("/") || ABSOLUTE_WINDOWS_PATH_PATTERN.test(bootstrapModule) || MODULE_URL_SCHEME_PATTERN.test(bootstrapModule);
746
- if (absolute) return;
747
- throw new NarsilError(
748
- ErrorCodes.CONFIG_INVALID,
749
- `workers.bootstrapModule is "${bootstrapModule}", which a worker would resolve against Narsil's own directory, so pass an absolute path or a URL such as new URL('./bootstrap.js', import.meta.url).href`,
750
- { bootstrapModule }
751
- );
752
- }
753
- function validateWorkerConfig(workers, lifecycle) {
754
- if (workers === void 0) return;
755
- requirePositiveSafeInteger("workers.count", workers.count);
756
- requirePositiveSafeInteger("workers.promotionThreshold", workers.promotionThreshold);
757
- requirePositiveSafeInteger("workers.idleTimeoutMs", workers.idleTimeoutMs);
758
- if (workers.mainCopyQueries !== void 0 && workers.mainCopyQueries !== "lone" && workers.mainCopyQueries !== "none") {
759
- throw new NarsilError(ErrorCodes.CONFIG_INVALID, "workers.mainCopyQueries must be 'lone' or 'none'", {
760
- mainCopyQueries: workers.mainCopyQueries
761
- });
762
- }
763
- validateBootstrapModule(workers.bootstrapModule);
764
- const closeAfter = lifecycle?.idleTimeoutMs;
765
- if (workers.idleTimeoutMs !== void 0 && closeAfter !== void 0 && workers.idleTimeoutMs > closeAfter) {
766
- throw new NarsilError(
767
- ErrorCodes.CONFIG_INVALID,
768
- "workers.idleTimeoutMs must be at most lifecycle.idleTimeoutMs, so that an index drops its copies before it closes",
769
- { workersIdleTimeoutMs: workers.idleTimeoutMs, lifecycleIdleTimeoutMs: closeAfter }
770
- );
771
- }
772
- }
773
- function clampLimit(limit) {
774
- return clampRowCount(limit, DEFAULT_LIMIT);
775
- }
776
- function clampOffset(offset) {
777
- return clampRowCount(offset, DEFAULT_OFFSET);
778
- }
779
-
780
782
  // src/engine/list-documents/index.ts
781
783
  function clampListLimit(limit) {
782
784
  const clamped = Math.max(1, clampLimit(limit));
@@ -1657,7 +1659,7 @@ function requireCursorDepth(cursor, signature, binding) {
1657
1659
  }
1658
1660
  function hybridSearchOf(params, context, limit, offset, cursorDepth) {
1659
1661
  if ((params.hybrid?.depth ?? null) === null) return executeHybridSearch(params, context, limit, offset, cursorDepth);
1660
- return import('./runtime-L2DZYY6N.mjs').then(
1662
+ return import('./runtime-COIUORCN.mjs').then(
1661
1663
  (runtime) => runtime.searchFixedDepthHybrid(params, context, { cursorDepth: cursorDepth ?? 0, offset, limit }, runtimeHost)
1662
1664
  );
1663
1665
  }
@@ -1667,7 +1669,7 @@ function executeQuery(request, callerContext) {
1667
1669
  if (loadingPhraseCode === null) return runQuery(request, callerContext);
1668
1670
  return loadingPhraseCode.then(() => runQuery(request, callerContext));
1669
1671
  }
1670
- return import('./runtime-L2DZYY6N.mjs').then(
1672
+ return import('./runtime-COIUORCN.mjs').then(
1671
1673
  (runtime) => runtime.executeRerankedQuery(request, callerContext, executeQuery, runtimeHost)
1672
1674
  );
1673
1675
  }
@@ -1,6 +1,7 @@
1
1
  import { bitsetHas, bitsetSet, GrowableUint32, createBitSet, bitsetAnd, bitsetNot } from './chunk-JUKYYXSP.mjs';
2
- import { parsedTypeOf, tabulatedLevenshtein } from './chunk-KYVRZAYP.mjs';
3
- import { NarsilError, ErrorCodes } from './chunk-MDF6PDIA.mjs';
2
+ import { tabulatedLevenshtein } from './chunk-GES7U2PM.mjs';
3
+ import { parsedTypeOf } from './chunk-I54T6CQP.mjs';
4
+ import { NarsilError, ErrorCodes } from './chunk-MP7ABPTD.mjs';
4
5
  import { codePointCount, exceedsCodePoints } from './chunk-YTJCGKM4.mjs';
5
6
 
6
7
  // src/core/pattern-index/constants.ts
@@ -1,5 +1,5 @@
1
1
  import { WORKER_YOUNG_GENERATION_MB } from './chunk-3MXV3VHR.mjs';
2
- import { NarsilError, ErrorCodes } from './chunk-MDF6PDIA.mjs';
2
+ import { NarsilError, ErrorCodes } from './chunk-MP7ABPTD.mjs';
3
3
 
4
4
  // src/runtime/detect.ts
5
5
  function detectRuntimeName() {