@delali/narsil 0.3.1-next.154 → 0.3.1-next.156

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 (329) hide show
  1. package/NOTICE +45 -0
  2. package/README.md +1 -0
  3. package/dist/adapters/filesystem.mjs +2 -2
  4. package/dist/adapters/gcs.mjs +2 -2
  5. package/dist/adapters/indexeddb.mjs +1 -1
  6. package/dist/adapters/s3.mjs +2 -2
  7. package/dist/{analysis-change-4GCRVRBW.mjs → analysis-change-5BQOQ4BF.mjs} +35 -28
  8. package/dist/{react-native/chunks/analysis-change-entry-TNLUC6IZ.mjs → analysis-change-entry-TXX6JSMX.mjs} +1 -1
  9. package/dist/archive-history-E4R73RWD.mjs +29 -0
  10. package/dist/browser/{analysis-change-IXWPXXJJ.mjs → analysis-change-435CUEPZ.mjs} +32 -12
  11. package/dist/{analysis-change-entry-KYGSXW4K.mjs → browser/analysis-change-entry-HZXKPPGV.mjs} +1 -1
  12. package/dist/browser/archive-history-4IP5XQZY.mjs +29 -0
  13. package/dist/browser/{chunk-4PD752F6.mjs → chunk-23XRXIBW.mjs} +1 -1
  14. package/dist/browser/{chunk-J433A7P3.mjs → chunk-2CFI5VVV.mjs} +5 -5
  15. package/dist/{react-native/chunks/chunk-3XKMRNRE.mjs → browser/chunk-2TI4SSUP.mjs} +27 -10
  16. package/dist/browser/chunk-3SSRJMFN.mjs +100 -0
  17. package/dist/browser/{chunk-2SHAKW2Z.mjs → chunk-3V7DNNZL.mjs} +515 -733
  18. package/dist/browser/{chunk-C4KS2QNF.mjs → chunk-4NGKC4H4.mjs} +9 -9
  19. package/dist/browser/{chunk-XRV72TJD.mjs → chunk-6LWDPLTB.mjs} +2 -2
  20. package/dist/browser/chunk-7IGKGWSQ.mjs +79 -0
  21. package/dist/browser/{chunk-VCOYGVP7.mjs → chunk-7U3WVJUP.mjs} +3 -3
  22. package/dist/browser/chunk-ATEBYXP6.mjs +10 -0
  23. package/dist/browser/chunk-BHFQATSC.mjs +432 -0
  24. package/dist/browser/chunk-CRE3G7F3.mjs +1007 -0
  25. package/dist/browser/{chunk-QXTPSX2H.mjs → chunk-EA63E3D2.mjs} +7 -7
  26. package/dist/{react-native/chunks/chunk-DCKMICOB.mjs → browser/chunk-EXQZGUQH.mjs} +1 -1
  27. package/dist/browser/{chunk-ML6HY7T7.mjs → chunk-G64Q6OJF.mjs} +1 -1
  28. package/dist/browser/chunk-GPPOG6PT.mjs +9 -0
  29. package/dist/browser/{chunk-EUNBNLKM.mjs → chunk-IZXVW2ZJ.mjs} +5 -5
  30. package/dist/browser/{chunk-G7LUMBSG.mjs → chunk-K4Q6KX3R.mjs} +30 -20
  31. package/dist/browser/{chunk-H6QFBMVE.mjs → chunk-KZWSX6BH.mjs} +3 -3
  32. package/dist/browser/chunk-M3MQE2X7.mjs +151 -0
  33. package/dist/browser/chunk-MGI4BCXC.mjs +63 -0
  34. package/dist/browser/chunk-MOG4OVDK.mjs +51 -0
  35. package/dist/browser/{chunk-W5X2UFWQ.mjs → chunk-NLWTBAGB.mjs} +12 -3
  36. package/dist/browser/{chunk-AYY6PIKL.mjs → chunk-NQAME3RK.mjs} +2 -2
  37. package/dist/browser/{chunk-7MEYN7V6.mjs → chunk-NXQG7DRA.mjs} +29 -14
  38. package/dist/browser/chunk-OEDCEZXJ.mjs +92 -0
  39. package/dist/{chunk-KUZKUONM.mjs → browser/chunk-SRMZXJSL.mjs} +1 -0
  40. package/dist/browser/chunk-SSTPBZZX.mjs +1106 -0
  41. package/dist/browser/{chunk-7TTWXUH6.mjs → chunk-STOWQFT3.mjs} +3 -2
  42. package/dist/browser/{chunk-26A5JFT2.mjs → chunk-TK63WFXK.mjs} +2 -1
  43. package/dist/browser/{chunk-SJB6VIZG.mjs → chunk-U3JOQGWX.mjs} +1 -1
  44. package/dist/browser/{chunk-AJ4HHOVT.mjs → chunk-U4YDIBUT.mjs} +4 -4
  45. package/dist/browser/{chunk-2FX6ROWR.mjs → chunk-VLJQW4J6.mjs} +2986 -2986
  46. package/dist/{react-native/chunks/chunk-3O57C2ZO.mjs → browser/chunk-WI4MR75E.mjs} +2 -2
  47. package/dist/browser/{chunk-3U3QR5YP.mjs → chunk-WN464PTL.mjs} +2 -2
  48. package/dist/browser/{chunk-U2E3HMYW.mjs → chunk-XAWNZ4G2.mjs} +11 -11
  49. package/dist/browser/{cold-module-VTUGDYNY.mjs → cold-module-2EHCIV4K.mjs} +20 -18
  50. package/dist/browser/durability-config-TIYKW6XX.mjs +89 -0
  51. package/dist/browser/{durability-wiring-GL4A7KDV.mjs → durability-wiring-A7BVG2DW.mjs} +50 -153
  52. package/dist/browser/engine-hooks-E4UD67JD.mjs +17 -0
  53. package/dist/browser/geo-index-HHWGMNIS.mjs +1386 -0
  54. package/dist/browser/import-DXYB6756.mjs +19 -0
  55. package/dist/browser/{methods-LMUTS7OI.mjs → methods-KTQCSIN4.mjs} +3 -3
  56. package/dist/browser/{module-M4JNBV6V.mjs → module-NIYMEA5R.mjs} +16 -14
  57. package/dist/browser/{module-EC3FYW7N.mjs → module-TCT66FWA.mjs} +10 -9
  58. package/dist/browser/operations-OJ3BXS55.mjs +5 -0
  59. package/dist/browser/{phrase-module-NPYUVX75.mjs → phrase-module-HAT3TLZN.mjs} +2 -2
  60. package/dist/browser/{pool-WCGDZHJP.mjs → pool-3JLET5RO.mjs} +1 -1
  61. package/dist/browser/restore-hooks-YPN4ZFCY.mjs +114 -0
  62. package/dist/browser/restore-queue-G3RQGL3Y.mjs +55 -0
  63. package/dist/browser/{retention-6QMRS5VK.mjs → retention-ZWVMNC3Q.mjs} +18 -15
  64. package/dist/browser/{runtime-3EW2AGB6.mjs → runtime-OTAGEFQW.mjs} +1 -1
  65. package/dist/browser/{snapshot-DN3CRVUQ.mjs → snapshot-VEQNIE6C.mjs} +71 -36
  66. package/dist/browser/start-BM442C6R.mjs +25 -0
  67. package/dist/browser/{write-WAWAFGKQ.mjs → write-2EVMZWDE.mjs} +16 -14
  68. package/dist/{capabilities-B3Brs1Rc.d.ts → capabilities-Da4ywVVl.d.ts} +35 -3
  69. package/dist/{chunk-K4B7OH65.mjs → chunk-25KDNIZZ.mjs} +2 -2
  70. package/dist/{chunk-O43Z4MS6.mjs → chunk-2NE7VCYE.mjs} +2 -2
  71. package/dist/chunk-2UV4QBHW.mjs +1092 -0
  72. package/dist/{chunk-3Y3J4V2R.mjs → chunk-3C7MTCCI.mjs} +1 -1
  73. package/dist/{chunk-TRISKD4Q.mjs → chunk-3HYC4JRF.mjs} +2 -2
  74. package/dist/{chunk-HVYICDY3.mjs → chunk-3OH67G7R.mjs} +1 -1
  75. package/dist/{chunk-PFKM7VNZ.mjs → chunk-46KY2PJD.mjs} +30 -11
  76. package/dist/{chunk-IJU7LL7D.mjs → chunk-4KKXNJM6.mjs} +5 -5
  77. package/dist/{chunk-IQ4R2I6N.mjs → chunk-5FLRXF73.mjs} +5 -1
  78. package/dist/{chunk-BPSKLCS7.mjs → chunk-5VV4R6P7.mjs} +3017 -3017
  79. package/dist/chunk-5YNRKI2C.mjs +81 -0
  80. package/dist/chunk-6HTGOXIK.mjs +875 -0
  81. package/dist/{chunk-7HCZWC7B.mjs → chunk-6I6AYAXS.mjs} +50 -8
  82. package/dist/{chunk-C6ASEFZI.mjs → chunk-6OEGXLBX.mjs} +1 -1
  83. package/dist/{chunk-DVWYODEB.mjs → chunk-6RC4K46J.mjs} +2 -2
  84. package/dist/chunk-7GFE3PEY.mjs +40 -0
  85. package/dist/{chunk-QKZHLADX.mjs → chunk-7LXHHCXZ.mjs} +28 -19
  86. package/dist/{chunk-JUKYYXSP.mjs → chunk-7V5IUP2T.mjs} +1 -31
  87. package/dist/{react-native/chunks/chunk-7GWPJDOA.mjs → chunk-A4L7YTKX.mjs} +53 -90
  88. package/dist/{chunk-Z3TNWCI5.mjs → chunk-BU4SAIC4.mjs} +3 -3
  89. package/dist/chunk-BWZ3P4MU.mjs +20 -0
  90. package/dist/{chunk-OKX2BBNW.mjs → chunk-CITFCZKF.mjs} +5 -4
  91. package/dist/{chunk-4HWZV5MK.mjs → chunk-CSLGFPFQ.mjs} +5 -5
  92. package/dist/chunk-DP5C7YFQ.mjs +543 -0
  93. package/dist/{chunk-RVKFI3A2.mjs → chunk-DWEPMFJE.mjs} +11 -8
  94. package/dist/{chunk-LSM2YTKM.mjs → chunk-EFBDHH5P.mjs} +87 -144
  95. package/dist/{chunk-NZMAXR2S.mjs → chunk-FAKFUDZZ.mjs} +121 -11
  96. package/dist/chunk-FB6463IN.mjs +1499 -0
  97. package/dist/{chunk-REL7LFLR.mjs → chunk-FCJ553HS.mjs} +3 -3
  98. package/dist/{chunk-MMEMEUOO.mjs → chunk-FJKKCV4D.mjs} +2 -2
  99. package/dist/{chunk-K7KLL263.mjs → chunk-FNGAM5B7.mjs} +14 -13
  100. package/dist/{chunk-DMQPFLGI.mjs → chunk-FRBFVQFN.mjs} +6 -5
  101. package/dist/{chunk-IBNLW3AV.mjs → chunk-FYOVBEMM.mjs} +20 -6
  102. package/dist/chunk-G6HRSGOU.mjs +74 -0
  103. package/dist/{chunk-USR7FQRZ.mjs → chunk-GH4WQ22V.mjs} +2 -2
  104. package/dist/chunk-GQPTDQCL.mjs +54 -0
  105. package/dist/{chunk-VREK3MYG.mjs → chunk-HFPMMRQT.mjs} +3 -3
  106. package/dist/{chunk-MLHNSAPK.mjs → chunk-HHBUCIUY.mjs} +3 -3
  107. package/dist/{chunk-YROWNOMH.mjs → chunk-HJJI72X7.mjs} +1 -1
  108. package/dist/{chunk-ECX4SGX6.mjs → chunk-I2KPOLOZ.mjs} +9 -9
  109. package/dist/{chunk-TV2L3BN7.mjs → chunk-I53G4JAU.mjs} +266 -265
  110. package/dist/{chunk-3A5KI24C.mjs → chunk-I54T6CQP.mjs} +1 -1
  111. package/dist/{chunk-NTZOXVUZ.mjs → chunk-I5B7RXU7.mjs} +93 -24
  112. package/dist/{chunk-YBJDOA2T.mjs → chunk-INJYO3BU.mjs} +1 -1
  113. package/dist/{react-native/chunks/chunk-KWRW5U65.mjs → chunk-J4IJTTEX.mjs} +1 -1
  114. package/dist/{chunk-X6NSJYQ3.mjs → chunk-JDJBQLRO.mjs} +13 -13
  115. package/dist/{chunk-MMBEANB2.mjs → chunk-JWRUUCWD.mjs} +3 -3
  116. package/dist/{chunk-AO2FAYIZ.mjs → chunk-K4ZIGL2O.mjs} +1 -1
  117. package/dist/{chunk-JFNKIBDT.mjs → chunk-K5QFDYST.mjs} +2 -2
  118. package/dist/{chunk-C73JLU4E.mjs → chunk-KF4EXSM4.mjs} +2 -2
  119. package/dist/{chunk-WCBA2LVZ.mjs → chunk-KHKIRS5D.mjs} +1 -1
  120. package/dist/{chunk-7QUGDVFC.mjs → chunk-KJ3RTZDJ.mjs} +1 -1
  121. package/dist/{chunk-HVKXNBFL.mjs → chunk-KKQC526K.mjs} +20 -12
  122. package/dist/chunk-KP7TYHWT.mjs +92 -0
  123. package/dist/{chunk-VMXSVVXG.mjs → chunk-L6V6BST3.mjs} +9 -22
  124. package/dist/{chunk-URPCYQVJ.mjs → chunk-LHKOSI2J.mjs} +1 -1
  125. package/dist/chunk-LNGE7SLY.mjs +151 -0
  126. package/dist/{react-native/chunks/chunk-CUNGPR5R.mjs → chunk-MP7ABPTD.mjs} +1 -0
  127. package/dist/{chunk-5KGYQT6W.mjs → chunk-MQOJIO5B.mjs} +26 -9
  128. package/dist/{chunk-Q3TCTQCC.mjs → chunk-NF4DT3IH.mjs} +1 -1
  129. package/dist/{chunk-3OFU3NJT.mjs → chunk-OIJ64LGT.mjs} +1 -1
  130. package/dist/chunk-ORN5BLL7.mjs +11 -0
  131. package/dist/{chunk-HWEDFLB7.mjs → chunk-P5ZI2P2W.mjs} +126 -1701
  132. package/dist/{chunk-466PYR4P.mjs → chunk-PWC4VB3Q.mjs} +2 -2
  133. package/dist/{chunk-B7S6YEBP.mjs → chunk-QJVOLKU6.mjs} +12 -3
  134. package/dist/{chunk-KCUIFVVW.mjs → chunk-QOW2JPUI.mjs} +9 -9
  135. package/dist/chunk-RDXO6JST.mjs +63 -0
  136. package/dist/chunk-RLOES5SX.mjs +31 -0
  137. package/dist/{chunk-YPUEV6ZC.mjs → chunk-RVGRFOGN.mjs} +1 -1
  138. package/dist/{chunk-JCLTESFN.mjs → chunk-RZWWB2XR.mjs} +1 -1
  139. package/dist/chunk-S5LN746F.mjs +10 -0
  140. package/dist/chunk-SA5LOGO3.mjs +470 -0
  141. package/dist/chunk-SQJWAIF4.mjs +12 -0
  142. package/dist/{chunk-YTJCGKM4.mjs → chunk-TBC3XUL2.mjs} +29 -6
  143. package/dist/chunk-TDIK6NTV.mjs +10 -0
  144. package/dist/chunk-TGS5UXBE.mjs +216 -0
  145. package/dist/{chunk-CP5RRPJR.mjs → chunk-TQXHPFWT.mjs} +1 -1
  146. package/dist/{chunk-7NTMUDC5.mjs → chunk-TZ3355VS.mjs} +5 -5
  147. package/dist/{chunk-Q7MS6P2J.mjs → chunk-TZTRKM33.mjs} +2 -2
  148. package/dist/{chunk-4UMZ7KQL.mjs → chunk-U55XJEIG.mjs} +2 -1
  149. package/dist/{chunk-S2N75OTN.mjs → chunk-UHICS3JI.mjs} +1 -1
  150. package/dist/{chunk-5FUOVJKG.mjs → chunk-VTTRFF2C.mjs} +32 -19
  151. package/dist/{chunk-62G63NMH.mjs → chunk-WX4LAO6M.mjs} +4 -4
  152. package/dist/{chunk-LTUGDMV4.mjs → chunk-WZ7YV54N.mjs} +1 -1
  153. package/dist/chunk-XAXKV65G.mjs +72 -0
  154. package/dist/chunk-XXHN7J46.mjs +101 -0
  155. package/dist/{chunk-PGVPE7GJ.mjs → chunk-YEKL4JBK.mjs} +1 -1
  156. package/dist/chunk-YTWZVGCB.mjs +382 -0
  157. package/dist/chunk-Z2KAFCRT.mjs +30 -0
  158. package/dist/{chunk-LKUE5GXS.mjs → chunk-ZKP7G7TV.mjs} +2 -2
  159. package/dist/{client-Df76GNKm.d.ts → client-DRv7UVeY.d.ts} +123 -11
  160. package/dist/client.d.ts +9 -8
  161. package/dist/client.mjs +65 -3
  162. package/dist/{cold-module-YLWMTTZG.mjs → cold-module-6MO2XJF2.mjs} +45 -39
  163. package/dist/{config-B8DP2VwR.d.ts → config-CoSig5Ox.d.ts} +22 -3
  164. package/dist/{config-05G_hy-1.d.ts → config-DMwffLKn.d.ts} +20 -5
  165. package/dist/direct-executor-FTMYY3TI.mjs +34 -0
  166. package/dist/distribution/coordinator/etcd.d.ts +2 -2
  167. package/dist/distribution/coordinator/etcd.mjs +3 -3
  168. package/dist/distribution/coordinator/in-memory.d.ts +2 -2
  169. package/dist/distribution/coordinator/in-memory.mjs +2 -2
  170. package/dist/distribution/transport/grpc.mjs +4 -4
  171. package/dist/distribution/transport/in-memory.mjs +2 -2
  172. package/dist/distribution/transport/tcp.mjs +3 -3
  173. package/dist/distribution.d.ts +8 -8
  174. package/dist/distribution.mjs +6799 -5939
  175. package/dist/durability-config-GE4U7MCZ.mjs +89 -0
  176. package/dist/{durability-wiring-RHLXDIVF.mjs → durability-wiring-VIF5MOSY.mjs} +82 -179
  177. package/dist/embeddings/openai.mjs +2 -2
  178. package/dist/{sync-uXR7MmM7.d.ts → engine-CFxPYqEk.d.ts} +702 -2
  179. package/dist/engine-hooks-EGUGNZYE.mjs +54 -0
  180. package/dist/geo-index-MRH5JMIR.mjs +1387 -0
  181. package/dist/import-XKDPJQDP.mjs +56 -0
  182. package/dist/{index-nRqDM6uS.d.ts → index-C4AmUnl1.d.ts} +1 -1
  183. package/dist/index.browser.mjs +9 -7
  184. package/dist/index.d.ts +134 -9
  185. package/dist/index.mjs +33 -26
  186. package/dist/index.react-native.mjs +20 -17
  187. package/dist/invalidation/filesystem.mjs +2 -2
  188. package/dist/{long-query-thread-EMYTGSJP.mjs → long-query-thread-YA4IAYSY.mjs} +34 -28
  189. package/dist/{methods-ABM5ELBR.mjs → methods-7IOINERF.mjs} +3 -3
  190. package/dist/{module-MG7JMV2U.mjs → module-FQ4JWNQJ.mjs} +41 -34
  191. package/dist/{module-3OMJZUFT.mjs → module-N55W4Q5C.mjs} +14 -14
  192. package/dist/operations-G5EP6JPX.mjs +5 -0
  193. package/dist/{paged-partition-archive-UOLHOEZJ.mjs → paged-partition-archive-PXW5XAYU.mjs} +48 -38
  194. package/dist/partial-words.mjs +11 -9
  195. package/dist/pattern.mjs +6 -5
  196. package/dist/persistence/durability/checkpoint-worker.d.ts +8 -1
  197. package/dist/persistence/durability/checkpoint-worker.mjs +44 -35
  198. package/dist/{phrase-module-O3MDRQXP.mjs → phrase-module-XW5MKWP5.mjs} +4 -3
  199. package/dist/{pool-CQXYPFLG.mjs → pool-Y4A46T36.mjs} +1 -1
  200. package/dist/query-suggestions/merge-worker.d.ts +55 -0
  201. package/dist/query-suggestions/merge-worker.mjs +88 -0
  202. package/dist/query-suggestions-CBYkrQ5T.d.ts +311 -0
  203. package/dist/query-suggestions.browser.mjs +247 -0
  204. package/dist/query-suggestions.d.ts +20 -0
  205. package/dist/query-suggestions.mjs +69 -0
  206. package/dist/react-native/chunks/{analysis-change-EAYO3Y6Q.mjs → analysis-change-LT5QBQ3H.mjs} +43 -22
  207. package/dist/{browser/analysis-change-entry-FCSHFQSS.mjs → react-native/chunks/analysis-change-entry-SCVWK6OU.mjs} +1 -1
  208. package/dist/react-native/chunks/archive-history-MJKUQLSU.mjs +29 -0
  209. package/dist/{chunk-ZIFJXCKA.mjs → react-native/chunks/chunk-2PRHILX3.mjs} +54 -20
  210. package/dist/react-native/chunks/{chunk-VQSKZ3EZ.mjs → chunk-3JWDECAZ.mjs} +8 -8
  211. package/dist/{chunk-R6A773WK.mjs → react-native/chunks/chunk-3WI35N75.mjs} +1 -1
  212. package/dist/react-native/chunks/{chunk-75VWIY35.mjs → chunk-4DII3ZSM.mjs} +1 -1
  213. package/dist/react-native/chunks/{chunk-NKIZX26F.mjs → chunk-4J74WHQM.mjs} +2 -2
  214. package/dist/react-native/chunks/{chunk-UWDNZDWK.mjs → chunk-4JYO3JD2.mjs} +6 -6
  215. package/dist/react-native/chunks/chunk-5CQX3XXV.mjs +17 -0
  216. package/dist/react-native/chunks/chunk-6VBXNFLE.mjs +9 -0
  217. package/dist/react-native/chunks/{chunk-SJWDBRNP.mjs → chunk-6WA3C3DV.mjs} +1 -1
  218. package/dist/react-native/chunks/{chunk-OQQVRWZ2.mjs → chunk-C5G6TJ7A.mjs} +1 -1
  219. package/dist/react-native/chunks/{chunk-RVAEBN74.mjs → chunk-CKNRFDTZ.mjs} +1 -1
  220. package/dist/react-native/chunks/chunk-DIYDOIM4.mjs +10 -0
  221. package/dist/react-native/chunks/{chunk-O32RB3BL.mjs → chunk-DNXOMPAQ.mjs} +4 -4
  222. package/dist/react-native/chunks/{chunk-YBEW6YTR.mjs → chunk-DVDX4SDR.mjs} +2 -2
  223. package/dist/react-native/chunks/chunk-DXRSEWA2.mjs +12 -0
  224. package/dist/{browser/chunk-MYITLCHT.mjs → react-native/chunks/chunk-DZ7H7D2C.mjs} +1 -0
  225. package/dist/react-native/chunks/{chunk-PPEPTUVV.mjs → chunk-EJ33LCHV.mjs} +29 -6
  226. package/dist/react-native/chunks/{chunk-RYMDHGL4.mjs → chunk-ENLMYKSX.mjs} +3045 -3075
  227. package/dist/react-native/chunks/chunk-FHPW7P2O.mjs +40 -0
  228. package/dist/react-native/chunks/{chunk-JV6VQY2S.mjs → chunk-FTZHMRD2.mjs} +2 -1
  229. package/dist/react-native/chunks/{chunk-YHKZSLOC.mjs → chunk-G43IPIDG.mjs} +5 -5
  230. package/dist/react-native/chunks/{chunk-AUT7PMA4.mjs → chunk-GXX3DQXP.mjs} +8 -22
  231. package/dist/react-native/chunks/chunk-H3MDVPBO.mjs +151 -0
  232. package/dist/react-native/chunks/{chunk-DH3TVWWK.mjs → chunk-IYNT75CE.mjs} +12 -3
  233. package/dist/react-native/chunks/chunk-KV46CT4D.mjs +1007 -0
  234. package/dist/{browser/chunk-ZPTA75ZC.mjs → react-native/chunks/chunk-LZSLNSUN.mjs} +1 -1
  235. package/dist/react-native/chunks/{chunk-63YSZOXB.mjs → chunk-MIP4SOR6.mjs} +1480 -826
  236. package/dist/react-native/chunks/{chunk-ZBSWRSBG.mjs → chunk-MJDQU5MW.mjs} +1 -1
  237. package/dist/react-native/chunks/{chunk-GFYFQLJD.mjs → chunk-MUWD2H2S.mjs} +2 -2
  238. package/dist/react-native/chunks/{chunk-IOY2SM2P.mjs → chunk-MVXELMJX.mjs} +1 -1
  239. package/dist/{browser/chunk-TTD27VXX.mjs → react-native/chunks/chunk-NB3LP33V.mjs} +27 -10
  240. package/dist/react-native/chunks/{chunk-I5PGWQJF.mjs → chunk-PDRWWPKV.mjs} +33 -24
  241. package/dist/react-native/chunks/chunk-PJHAB5ZY.mjs +79 -0
  242. package/dist/react-native/chunks/{chunk-2CGSQM4O.mjs → chunk-POPDAGH6.mjs} +13 -13
  243. package/dist/react-native/chunks/{chunk-NP7DD4G5.mjs → chunk-QUKQNI3H.mjs} +5 -5
  244. package/dist/react-native/chunks/{chunk-EH5CFV6Z.mjs → chunk-RDWG33MM.mjs} +2 -2
  245. package/dist/react-native/chunks/{chunk-JX2RIAXH.mjs → chunk-SK2PWYDH.mjs} +5 -5
  246. package/dist/react-native/chunks/{chunk-ZYDKJXQJ.mjs → chunk-SUPXRTMD.mjs} +1 -1
  247. package/dist/react-native/chunks/chunk-TP6KCKER.mjs +63 -0
  248. package/dist/react-native/chunks/{chunk-JPAJWO6D.mjs → chunk-U4KSKA4Z.mjs} +1 -1
  249. package/dist/react-native/chunks/chunk-UQ4OAXKU.mjs +1106 -0
  250. package/dist/react-native/chunks/{chunk-VVFYOADG.mjs → chunk-VWUDIOT6.mjs} +6 -6
  251. package/dist/{browser/chunk-SIR3LMTV.mjs → react-native/chunks/chunk-WBYQRHDY.mjs} +2 -2
  252. package/dist/react-native/chunks/{chunk-C2H2QQFW.mjs → chunk-YH7QY657.mjs} +3 -3
  253. package/dist/react-native/chunks/{chunk-NCJS3WIY.mjs → chunk-YZW4CHM6.mjs} +51 -12
  254. package/dist/react-native/chunks/chunk-ZLWVW734.mjs +100 -0
  255. package/dist/react-native/chunks/chunk-ZXZFN7FI.mjs +432 -0
  256. package/dist/react-native/chunks/chunk-ZZT7CEN7.mjs +92 -0
  257. package/dist/react-native/chunks/{cold-module-TJL6AFAD.mjs → cold-module-KVZYUGRY.mjs} +31 -28
  258. package/dist/react-native/chunks/durability-config-QXVZEO7T.mjs +89 -0
  259. package/dist/react-native/chunks/{durability-wiring-RRDYJLLM.mjs → durability-wiring-34OYO32E.mjs} +60 -162
  260. package/dist/react-native/chunks/engine-hooks-M7JV46NH.mjs +30 -0
  261. package/dist/react-native/chunks/geo-index-PX3BIHAH.mjs +1387 -0
  262. package/dist/react-native/chunks/gzip.react-native-HLEPDKZ3.mjs +3 -0
  263. package/dist/react-native/chunks/import-H6AQREWI.mjs +32 -0
  264. package/dist/react-native/chunks/{methods-X6F36SJE.mjs → methods-6W5U4C3H.mjs} +3 -3
  265. package/dist/react-native/chunks/module-LBZPGOWH.mjs +36 -0
  266. package/dist/react-native/chunks/{module-S4DKSWMF.mjs → module-TTEVPRCW.mjs} +14 -13
  267. package/dist/react-native/chunks/operations-GNRMD6EX.mjs +5 -0
  268. package/dist/react-native/chunks/{phrase-module-JZ37TB7N.mjs → phrase-module-QK22HSQ2.mjs} +2 -2
  269. package/dist/react-native/chunks/{pool-RTGXJXPU.mjs → pool-JR3NJCAF.mjs} +1 -1
  270. package/dist/react-native/chunks/restore-hooks-IBGIY3DR.mjs +127 -0
  271. package/dist/react-native/chunks/restore-queue-ZZX54AH7.mjs +55 -0
  272. package/dist/react-native/chunks/{retention-PPCTP2VY.mjs → retention-EW4TTDFB.mjs} +29 -25
  273. package/dist/react-native/chunks/{runtime-KUATOLYB.mjs → runtime-R5E3TB3J.mjs} +1 -1
  274. package/dist/react-native/chunks/{snapshot-ZBIEOZTZ.mjs → snapshot-REYVIN3X.mjs} +80 -44
  275. package/dist/react-native/chunks/start-BQK6KN3R.mjs +38 -0
  276. package/dist/react-native/chunks/{write-2W4FTX7J.mjs → write-FQAYCZF5.mjs} +27 -24
  277. package/dist/react-native/partial-words.mjs +11 -9
  278. package/dist/react-native/pattern.mjs +4 -4
  279. package/dist/react-native/query-suggestions.mjs +260 -0
  280. package/dist/react-native/sync.mjs +78 -15
  281. package/dist/react-native/synonyms.mjs +95 -27
  282. package/dist/react.d.ts +11 -11
  283. package/dist/react.mjs +1 -0
  284. package/dist/{rerank-IZOB6NII.mjs → rerank-MQ37IYRV.mjs} +4 -4
  285. package/dist/rerankers/http.mjs +2 -2
  286. package/dist/restore-hooks-CDERDEF4.mjs +153 -0
  287. package/dist/restore-queue-7NNSTROA.mjs +55 -0
  288. package/dist/retention-QSVBBNRM.mjs +66 -0
  289. package/dist/{runtime-UZOC3NPY.mjs → runtime-COIUORCN.mjs} +5 -5
  290. package/dist/{schema-DDauvDOv.d.ts → schema-Jwt928nJ.d.ts} +1 -1
  291. package/dist/server.d.ts +108 -12
  292. package/dist/server.mjs +303 -50
  293. package/dist/{snapshot-NFX2EYN2.mjs → snapshot-RH4NSKIZ.mjs} +98 -61
  294. package/dist/start-MCKCOGIW.mjs +66 -0
  295. package/dist/sync/filesystem.d.ts +4 -4
  296. package/dist/sync/filesystem.mjs +6 -6
  297. package/dist/sync/indexeddb.d.ts +4 -4
  298. package/dist/sync/indexeddb.mjs +2 -2
  299. package/dist/sync.browser.mjs +74 -11
  300. package/dist/sync.d.ts +5 -5
  301. package/dist/sync.mjs +78 -16
  302. package/dist/synonyms.mjs +9 -8
  303. package/dist/{tasks-BShx8pdK.d.ts → tasks-qrJojgST.d.ts} +13 -5
  304. package/dist/thread-O4SBJJJS.mjs +50 -0
  305. package/dist/{types-SnO7_tAI.d.ts → types-BZCGjfLn.d.ts} +2 -3
  306. package/dist/vector/search-worker.d.ts +1 -1
  307. package/dist/vector/search-worker.mjs +8 -8
  308. package/dist/workers/entry.mjs +19 -8
  309. package/dist/{write-FGB62BHQ.mjs → write-3FK7NG3Y.mjs} +40 -33
  310. package/openapi.json +798 -7
  311. package/package.json +32 -8
  312. package/dist/browser/import-YI5GNB4H.mjs +0 -17
  313. package/dist/browser/operations-WVYLF72Q.mjs +0 -5
  314. package/dist/browser/restore-queue-TYIGDL5L.mjs +0 -41
  315. package/dist/chunk-37IVJLP6.mjs +0 -44
  316. package/dist/chunk-DJHHF2L5.mjs +0 -17
  317. package/dist/direct-executor-FI5GJHWX.mjs +0 -29
  318. package/dist/engine-DYu-e0oR.d.ts +0 -674
  319. package/dist/import-SRBNC6TE.mjs +0 -49
  320. package/dist/operations-PGOAY2KS.mjs +0 -5
  321. package/dist/react-native/chunks/chunk-TJMSKBEM.mjs +0 -25
  322. package/dist/react-native/chunks/gzip.react-native-DNB5YNFA.mjs +0 -3
  323. package/dist/react-native/chunks/import-JYBMEJPQ.mjs +0 -29
  324. package/dist/react-native/chunks/module-QT5HZAY4.mjs +0 -33
  325. package/dist/react-native/chunks/operations-RYKTSZQA.mjs +0 -5
  326. package/dist/react-native/chunks/restore-queue-ZBVIKJWI.mjs +0 -41
  327. package/dist/restore-queue-COI2GSSK.mjs +0 -41
  328. package/dist/retention-55WA7GPU.mjs +0 -58
  329. package/dist/thread-P2G2FWM2.mjs +0 -44
@@ -1,21 +1,22 @@
1
1
  import { admittedHeapBytes } from './chunk-XIHUI4KB.mjs';
2
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';
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-HWEDFLB7.mjs';
3
+ import { normalizeSort, requireMatchingCursor, encodePageCursor, decodePageCursor, projectionKeepsField, resolveProjection, clampRowCount, sortSignatureOf, requireSortableFields, fanOutQuery, requireWithinResultWindow, sortModesOf, applySorting, applyPagination, countsWithoutScores, fanOutMatchCount, validatedFilterOf, createPatternWorkMeter, partialWordsToHighlight, partialWordHighlighter, pruneStatsToQueryTerms, everyValueFacetConfig, fulltextMatches, mergeFacets, applyPartitionFiltersBitset, readResidentMemory, partitionsIn, undeclaredFieldOnStrictIndex } from './chunk-P5ZI2P2W.mjs';
4
4
  import { readOldGenerationStatistics } from './chunk-IPN7S4KX.mjs';
5
5
  import { FNV_OFFSET_BASIS, fnv1aContinue, fnv1aContinueTaggedNumbers } from './chunk-KAKQ74LS.mjs';
6
6
  import { engineThreadYoungGenerationBytes } from './chunk-Q2UL2TPC.mjs';
7
- import { MIN_OVERSAMPLE } from './chunk-HVKXNBFL.mjs';
8
- import { MAX_RENUMBERED_SEARCH_ATTEMPTS } from './chunk-BTPGQC6Z.mjs';
9
- import { turnIsSpent, yieldTurn } from './chunk-LQG5G2LY.mjs';
10
- import { flattenSchema, partialFieldsOf } from './chunk-Z3TNWCI5.mjs';
11
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';
12
- import { tokenize } from './chunk-ZIFJXCKA.mjs';
8
+ import { flattenSchema, partialFieldsOf } from './chunk-BU4SAIC4.mjs';
13
9
  import { fuzzyTermMatches } from './chunk-GES7U2PM.mjs';
14
- import { isStringValuedBase, parsedTypeOf, isWordIndexedFieldType } from './chunk-3A5KI24C.mjs';
10
+ import { isStringValuedBase, parsedTypeOf, isWordIndexedFieldType } from './chunk-I54T6CQP.mjs';
11
+ import { bm25SetsValue, analyseQueryPhrases, requireLoadedPhraseCode, loadPhraseCodeFor, mergeBM25Levels, MAX_BM25_K1, MAX_BM25_B } from './chunk-FB6463IN.mjs';
15
12
  import { MIN_PATTERN_VALUE_LIMIT, MAX_PATTERN_VALUE_LIMIT, isPlainObject, isGeopointOrVectorType, VECTOR_PATTERN } from './chunk-L5ORED7V.mjs';
16
- import { NarsilError, ErrorCodes } from './chunk-KUZKUONM.mjs';
17
- import { compareComparableKeys } from './chunk-R6A773WK.mjs';
18
- import { compareCodePoints, holdsUnpairedSurrogate } from './chunk-YTJCGKM4.mjs';
13
+ import { tokenize } from './chunk-A4L7YTKX.mjs';
14
+ import { MIN_OVERSAMPLE } from './chunk-ORN5BLL7.mjs';
15
+ import { MAX_RENUMBERED_SEARCH_ATTEMPTS } from './chunk-BTPGQC6Z.mjs';
16
+ import { turnIsSpent, yieldTurn } from './chunk-LQG5G2LY.mjs';
17
+ import { NarsilError, ErrorCodes } from './chunk-MP7ABPTD.mjs';
18
+ import { compareComparableKeys } from './chunk-J4IJTTEX.mjs';
19
+ import { compareCodePoints, holdsUnpairedSurrogate } from './chunk-TBC3XUL2.mjs';
19
20
 
20
21
  // src/engine/memory/constants.ts
21
22
  var DEFAULT_BLOCK_WRITES_ABOVE = 0.9;
@@ -107,6 +108,259 @@ function readEngineMemoryFigures() {
107
108
  return measure();
108
109
  }
109
110
 
111
+ // src/engine/validation.ts
112
+ function now() {
113
+ if (typeof performance !== "undefined" && typeof performance.now === "function") {
114
+ return performance.now();
115
+ }
116
+ return Date.now();
117
+ }
118
+ function validateIndexName(name) {
119
+ const given = name;
120
+ if (typeof given !== "string" || name.length === 0) {
121
+ throw new NarsilError(ErrorCodes.CONFIG_INVALID, "Index name must be a string of at least one character", {
122
+ received: given === null ? "null" : typeof given
123
+ });
124
+ }
125
+ if (name.length > MAX_INDEX_NAME_LENGTH) {
126
+ throw new NarsilError(ErrorCodes.CONFIG_INVALID, `Index name must not exceed ${MAX_INDEX_NAME_LENGTH} characters`, {
127
+ indexName: name,
128
+ length: name.length
129
+ });
130
+ }
131
+ if (!INDEX_NAME_PATTERN.test(name)) {
132
+ throw new NarsilError(
133
+ ErrorCodes.CONFIG_INVALID,
134
+ `Index name "${name}" contains invalid characters; use alphanumeric, dots, hyphens, and underscores only`,
135
+ { indexName: name }
136
+ );
137
+ }
138
+ if (name.includes("..")) {
139
+ throw new NarsilError(ErrorCodes.CONFIG_INVALID, `Index name "${name}" must not contain ".."`, { indexName: name });
140
+ }
141
+ }
142
+ function validateDocId(docId) {
143
+ const given = docId;
144
+ if (typeof given !== "string") {
145
+ throw new NarsilError(ErrorCodes.DOC_VALIDATION_FAILED, "Document ID must be a string", {
146
+ received: given === null ? "null" : Array.isArray(given) ? "array" : typeof given
147
+ });
148
+ }
149
+ if (docId.length === 0) {
150
+ throw new NarsilError(ErrorCodes.DOC_VALIDATION_FAILED, "Document ID must not be empty", { docId });
151
+ }
152
+ if (docId.length > MAX_DOC_ID_LENGTH) {
153
+ throw new NarsilError(
154
+ ErrorCodes.DOC_VALIDATION_FAILED,
155
+ `Document ID must not exceed ${MAX_DOC_ID_LENGTH} characters`,
156
+ {
157
+ docId,
158
+ length: docId.length
159
+ }
160
+ );
161
+ }
162
+ if (docId.includes("\0")) {
163
+ throw new NarsilError(ErrorCodes.DOC_VALIDATION_FAILED, "Document ID must not contain null bytes", { docId });
164
+ }
165
+ if (holdsUnpairedSurrogate(docId)) {
166
+ throw new NarsilError(
167
+ ErrorCodes.DOC_VALIDATION_FAILED,
168
+ "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",
169
+ { docId }
170
+ );
171
+ }
172
+ }
173
+ function validateBatchList(given, listed) {
174
+ if (Array.isArray(given)) return;
175
+ throw new NarsilError(ErrorCodes.DOC_VALIDATION_FAILED, `A batch takes its ${listed} as an array`, {
176
+ received: given === null ? "null" : typeof given
177
+ });
178
+ }
179
+ function validatePartitionConfig(partitions) {
180
+ const { maxDocsPerPartition, maxPartitions, watermark } = partitions;
181
+ if (maxDocsPerPartition !== void 0 && (!Number.isInteger(maxDocsPerPartition) || maxDocsPerPartition < 1)) {
182
+ throw new NarsilError(ErrorCodes.CONFIG_INVALID, "partitions.maxDocsPerPartition must be a positive integer", {
183
+ maxDocsPerPartition
184
+ });
185
+ }
186
+ if (maxPartitions !== void 0 && (!Number.isInteger(maxPartitions) || maxPartitions < 1)) {
187
+ throw new NarsilError(ErrorCodes.CONFIG_INVALID, "partitions.maxPartitions must be a positive integer", {
188
+ maxPartitions
189
+ });
190
+ }
191
+ if (watermark !== void 0 && (typeof watermark !== "number" || !(watermark > 0) || watermark > 1)) {
192
+ throw new NarsilError(ErrorCodes.CONFIG_INVALID, "partitions.watermark must be above 0 and at most 1", {
193
+ watermark
194
+ });
195
+ }
196
+ }
197
+ function requireSurfaceFormsForPartialFields(schema, surfaceForms) {
198
+ if (surfaceForms !== false) return;
199
+ const partialFields = partialFieldsOf(schema);
200
+ if (partialFields.length === 0) return;
201
+ throw new NarsilError(
202
+ ErrorCodes.CONFIG_INVALID,
203
+ `Field "${partialFields[0]}" declares "partial", which compares words as the documents wrote them, so its index needs surfaceForms left on`,
204
+ { fields: [...partialFields], surfaceForms: false }
205
+ );
206
+ }
207
+ function validatePatternValueLimit(limit) {
208
+ if (limit === void 0) return;
209
+ if (typeof limit !== "number" || !Number.isInteger(limit) || limit < MIN_PATTERN_VALUE_LIMIT || limit > MAX_PATTERN_VALUE_LIMIT) {
210
+ throw new NarsilError(
211
+ ErrorCodes.CONFIG_INVALID,
212
+ `patternValueLimit must be a whole number of code points from ${MIN_PATTERN_VALUE_LIMIT} to ${MAX_PATTERN_VALUE_LIMIT}`,
213
+ { patternValueLimit: typeof limit === "number" ? limit : String(limit) }
214
+ );
215
+ }
216
+ }
217
+ function requirePositiveSafeInteger(field, value) {
218
+ if (value === void 0) return;
219
+ if (!Number.isSafeInteger(value) || value < 1) {
220
+ throw new NarsilError(ErrorCodes.CONFIG_INVALID, `${field} must be a positive safe integer`, { field, value });
221
+ }
222
+ }
223
+ function validateBootstrapModule(bootstrapModule) {
224
+ if (bootstrapModule === void 0) return;
225
+ const absolute = bootstrapModule.startsWith("/") || ABSOLUTE_WINDOWS_PATH_PATTERN.test(bootstrapModule) || MODULE_URL_SCHEME_PATTERN.test(bootstrapModule);
226
+ if (absolute) return;
227
+ throw new NarsilError(
228
+ ErrorCodes.CONFIG_INVALID,
229
+ `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`,
230
+ { bootstrapModule }
231
+ );
232
+ }
233
+ function validateWorkerConfig(workers, lifecycle) {
234
+ if (workers === void 0) return;
235
+ requirePositiveSafeInteger("workers.count", workers.count);
236
+ requirePositiveSafeInteger("workers.promotionThreshold", workers.promotionThreshold);
237
+ requirePositiveSafeInteger("workers.idleTimeoutMs", workers.idleTimeoutMs);
238
+ if (workers.mainCopyQueries !== void 0 && workers.mainCopyQueries !== "lone" && workers.mainCopyQueries !== "none") {
239
+ throw new NarsilError(ErrorCodes.CONFIG_INVALID, "workers.mainCopyQueries must be 'lone' or 'none'", {
240
+ mainCopyQueries: workers.mainCopyQueries
241
+ });
242
+ }
243
+ validateBootstrapModule(workers.bootstrapModule);
244
+ const closeAfter = lifecycle?.idleTimeoutMs;
245
+ if (workers.idleTimeoutMs !== void 0 && closeAfter !== void 0 && workers.idleTimeoutMs > closeAfter) {
246
+ throw new NarsilError(
247
+ ErrorCodes.CONFIG_INVALID,
248
+ "workers.idleTimeoutMs must be at most lifecycle.idleTimeoutMs, so that an index drops its copies before it closes",
249
+ { workersIdleTimeoutMs: workers.idleTimeoutMs, lifecycleIdleTimeoutMs: closeAfter }
250
+ );
251
+ }
252
+ }
253
+ function clampLimit(limit) {
254
+ return clampRowCount(limit, DEFAULT_LIMIT);
255
+ }
256
+ function clampOffset(offset) {
257
+ return clampRowCount(offset, DEFAULT_OFFSET);
258
+ }
259
+
260
+ // src/search/bm25-params.ts
261
+ var BM25_KEYS = /* @__PURE__ */ new Set(["k1", "b", "fields"]);
262
+ var BM25_FIELD_KEYS = /* @__PURE__ */ new Set(["k1", "b"]);
263
+ function displayed(value) {
264
+ if (typeof value === "string") return `"${value.slice(0, BM25_DISPLAYED_NAME_LENGTH)}"`;
265
+ if (typeof value === "number" || typeof value === "boolean" || value === null) return String(value);
266
+ return `a value of type ${typeof value}`;
267
+ }
268
+ function requireValue(label, value, maximum, ranges) {
269
+ if (value === void 0) return;
270
+ const usable = typeof value === "number" && Number.isFinite(value) && (ranges === "stored" || value >= 0 && value <= maximum);
271
+ if (usable) return;
272
+ throw new NarsilError(
273
+ ErrorCodes.CONFIG_INVALID,
274
+ `${label} must be a finite number from 0 to ${maximum}, and this request sets ${displayed(value)}`,
275
+ { parameter: label }
276
+ );
277
+ }
278
+ function requireKnownKeys(label, value, known) {
279
+ for (const key of Object.keys(value)) {
280
+ if (known.has(key)) continue;
281
+ throw new NarsilError(
282
+ ErrorCodes.CONFIG_INVALID,
283
+ `${label} takes ${[...known].join(", ")}, and this request sets ${displayed(key)}`,
284
+ { parameter: label }
285
+ );
286
+ }
287
+ }
288
+ function requireFieldPair(name, pair, ranges) {
289
+ const label = `bm25.fields.${name.slice(0, BM25_DISPLAYED_NAME_LENGTH)}`;
290
+ if (!isPlainObject(pair)) {
291
+ throw new NarsilError(ErrorCodes.CONFIG_INVALID, `${label} must be an object that sets k1 or b`, {
292
+ parameter: label
293
+ });
294
+ }
295
+ requireKnownKeys(label, pair, BM25_FIELD_KEYS);
296
+ requireValue(`${label}.k1`, pair.k1, MAX_BM25_K1, ranges);
297
+ requireValue(`${label}.b`, pair.b, MAX_BM25_B, ranges);
298
+ }
299
+ function requireScoredField(name, flatSchema, unknownFieldCode) {
300
+ const fieldType = Object.hasOwn(flatSchema, name) ? flatSchema[name] : void 0;
301
+ if (typeof fieldType === "string" && isWordIndexedFieldType(fieldType)) return;
302
+ throw new NarsilError(
303
+ unknownFieldCode,
304
+ 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)}`,
305
+ { field: name.slice(0, BM25_DISPLAYED_NAME_LENGTH) }
306
+ );
307
+ }
308
+ function fieldsOfCheckedSetting(raw, ranges) {
309
+ if (!isPlainObject(raw)) {
310
+ throw new NarsilError(ErrorCodes.CONFIG_INVALID, "bm25 must be an object that sets k1, b, or fields");
311
+ }
312
+ requireKnownKeys("bm25", raw, BM25_KEYS);
313
+ requireValue("bm25.k1", raw.k1, MAX_BM25_K1, ranges);
314
+ requireValue("bm25.b", raw.b, MAX_BM25_B, ranges);
315
+ const fields = raw.fields;
316
+ if (fields === void 0) return void 0;
317
+ if (!isPlainObject(fields)) {
318
+ throw new NarsilError(
319
+ ErrorCodes.CONFIG_INVALID,
320
+ "bm25.fields must be an object that maps a field to its parameters"
321
+ );
322
+ }
323
+ return fields;
324
+ }
325
+ function validateBM25Shape(raw, ranges) {
326
+ const fields = fieldsOfCheckedSetting(raw, ranges);
327
+ if (fields === void 0) return;
328
+ for (const name of Object.keys(fields)) requireFieldPair(name, fields[name], ranges);
329
+ }
330
+ function validateBM25Params(raw, schema, unknownFieldCode, ranges = "settable") {
331
+ const fields = fieldsOfCheckedSetting(raw, ranges);
332
+ if (fields === void 0) return;
333
+ const names = Object.keys(fields);
334
+ if (names.length === 0) return;
335
+ const flatSchema = flattenSchema(schema);
336
+ for (const name of names) {
337
+ requireScoredField(name, flatSchema, unknownFieldCode);
338
+ requireFieldPair(name, fields[name], ranges);
339
+ }
340
+ }
341
+ function presentPair(pair) {
342
+ return {
343
+ ...pair.k1 !== void 0 ? { k1: pair.k1 } : {},
344
+ ...pair.b !== void 0 ? { b: pair.b } : {}
345
+ };
346
+ }
347
+ function storedBM25Params(params) {
348
+ const stored = presentPair(params);
349
+ const fields = params.fields;
350
+ if (fields !== void 0) {
351
+ const kept = /* @__PURE__ */ Object.create(null);
352
+ let holdsField = false;
353
+ for (const name of Object.keys(fields)) {
354
+ const pair = presentPair(fields[name]);
355
+ if (pair.k1 === void 0 && pair.b === void 0) continue;
356
+ kept[name] = pair;
357
+ holdsField = true;
358
+ }
359
+ if (holdsField) stored.fields = kept;
360
+ }
361
+ return Object.keys(stored).length === 0 ? void 0 : stored;
362
+ }
363
+
110
364
  // src/search/cursor-binding.ts
111
365
  var ABSENT_TAG = 0;
112
366
  var NULL_TAG = 1;
@@ -317,110 +571,6 @@ function listBindingOf(filters) {
317
571
  return bindingOf(values);
318
572
  }
319
573
 
320
- // src/search/bm25-params.ts
321
- var BM25_KEYS = /* @__PURE__ */ new Set(["k1", "b", "fields"]);
322
- var BM25_FIELD_KEYS = /* @__PURE__ */ new Set(["k1", "b"]);
323
- function displayed(value) {
324
- if (typeof value === "string") return `"${value.slice(0, BM25_DISPLAYED_NAME_LENGTH)}"`;
325
- if (typeof value === "number" || typeof value === "boolean" || value === null) return String(value);
326
- return `a value of type ${typeof value}`;
327
- }
328
- function requireValue(label, value, maximum, ranges) {
329
- if (value === void 0) return;
330
- const usable = typeof value === "number" && Number.isFinite(value) && (ranges === "stored" || value >= 0 && value <= maximum);
331
- if (usable) return;
332
- throw new NarsilError(
333
- ErrorCodes.CONFIG_INVALID,
334
- `${label} must be a finite number from 0 to ${maximum}, and this request sets ${displayed(value)}`,
335
- { parameter: label }
336
- );
337
- }
338
- function requireKnownKeys(label, value, known) {
339
- for (const key of Object.keys(value)) {
340
- if (known.has(key)) continue;
341
- throw new NarsilError(
342
- ErrorCodes.CONFIG_INVALID,
343
- `${label} takes ${[...known].join(", ")}, and this request sets ${displayed(key)}`,
344
- { parameter: label }
345
- );
346
- }
347
- }
348
- function requireFieldPair(name, pair, ranges) {
349
- const label = `bm25.fields.${name.slice(0, BM25_DISPLAYED_NAME_LENGTH)}`;
350
- if (!isPlainObject(pair)) {
351
- throw new NarsilError(ErrorCodes.CONFIG_INVALID, `${label} must be an object that sets k1 or b`, {
352
- parameter: label
353
- });
354
- }
355
- requireKnownKeys(label, pair, BM25_FIELD_KEYS);
356
- requireValue(`${label}.k1`, pair.k1, MAX_BM25_K1, ranges);
357
- requireValue(`${label}.b`, pair.b, MAX_BM25_B, ranges);
358
- }
359
- function requireScoredField(name, flatSchema, unknownFieldCode) {
360
- const fieldType = Object.hasOwn(flatSchema, name) ? flatSchema[name] : void 0;
361
- if (typeof fieldType === "string" && isWordIndexedFieldType(fieldType)) return;
362
- throw new NarsilError(
363
- unknownFieldCode,
364
- 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)}`,
365
- { field: name.slice(0, BM25_DISPLAYED_NAME_LENGTH) }
366
- );
367
- }
368
- function fieldsOfCheckedSetting(raw, ranges) {
369
- if (!isPlainObject(raw)) {
370
- throw new NarsilError(ErrorCodes.CONFIG_INVALID, "bm25 must be an object that sets k1, b, or fields");
371
- }
372
- requireKnownKeys("bm25", raw, BM25_KEYS);
373
- requireValue("bm25.k1", raw.k1, MAX_BM25_K1, ranges);
374
- requireValue("bm25.b", raw.b, MAX_BM25_B, ranges);
375
- const fields = raw.fields;
376
- if (fields === void 0) return void 0;
377
- if (!isPlainObject(fields)) {
378
- throw new NarsilError(
379
- ErrorCodes.CONFIG_INVALID,
380
- "bm25.fields must be an object that maps a field to its parameters"
381
- );
382
- }
383
- return fields;
384
- }
385
- function validateBM25Shape(raw, ranges) {
386
- const fields = fieldsOfCheckedSetting(raw, ranges);
387
- if (fields === void 0) return;
388
- for (const name of Object.keys(fields)) requireFieldPair(name, fields[name], ranges);
389
- }
390
- function validateBM25Params(raw, schema, unknownFieldCode, ranges = "settable") {
391
- const fields = fieldsOfCheckedSetting(raw, ranges);
392
- if (fields === void 0) return;
393
- const names = Object.keys(fields);
394
- if (names.length === 0) return;
395
- const flatSchema = flattenSchema(schema);
396
- for (const name of names) {
397
- requireScoredField(name, flatSchema, unknownFieldCode);
398
- requireFieldPair(name, fields[name], ranges);
399
- }
400
- }
401
- function presentPair(pair) {
402
- return {
403
- ...pair.k1 !== void 0 ? { k1: pair.k1 } : {},
404
- ...pair.b !== void 0 ? { b: pair.b } : {}
405
- };
406
- }
407
- function storedBM25Params(params) {
408
- const stored = presentPair(params);
409
- const fields = params.fields;
410
- if (fields !== void 0) {
411
- const kept = /* @__PURE__ */ Object.create(null);
412
- let holdsField = false;
413
- for (const name of Object.keys(fields)) {
414
- const pair = presentPair(fields[name]);
415
- if (pair.k1 === void 0 && pair.b === void 0) continue;
416
- kept[name] = pair;
417
- holdsField = true;
418
- }
419
- if (holdsField) stored.fields = kept;
420
- }
421
- return Object.keys(stored).length === 0 ? void 0 : stored;
422
- }
423
-
424
574
  // src/search/query-fields.ts
425
575
  function requireBoostableFields(boost, flatSchema) {
426
576
  for (const [field, weight] of Object.entries(boost)) {
@@ -630,155 +780,6 @@ function requireVectorSearchable(params, context, needsVector) {
630
780
  );
631
781
  }
632
782
 
633
- // src/engine/validation.ts
634
- function now() {
635
- if (typeof performance !== "undefined" && typeof performance.now === "function") {
636
- return performance.now();
637
- }
638
- return Date.now();
639
- }
640
- function validateIndexName(name) {
641
- const given = name;
642
- if (typeof given !== "string" || name.length === 0) {
643
- throw new NarsilError(ErrorCodes.CONFIG_INVALID, "Index name must be a string of at least one character", {
644
- received: given === null ? "null" : typeof given
645
- });
646
- }
647
- if (name.length > MAX_INDEX_NAME_LENGTH) {
648
- throw new NarsilError(ErrorCodes.CONFIG_INVALID, `Index name must not exceed ${MAX_INDEX_NAME_LENGTH} characters`, {
649
- indexName: name,
650
- length: name.length
651
- });
652
- }
653
- if (!INDEX_NAME_PATTERN.test(name)) {
654
- throw new NarsilError(
655
- ErrorCodes.CONFIG_INVALID,
656
- `Index name "${name}" contains invalid characters; use alphanumeric, dots, hyphens, and underscores only`,
657
- { indexName: name }
658
- );
659
- }
660
- if (name.includes("..")) {
661
- throw new NarsilError(ErrorCodes.CONFIG_INVALID, `Index name "${name}" must not contain ".."`, { indexName: name });
662
- }
663
- }
664
- function validateDocId(docId) {
665
- const given = docId;
666
- if (typeof given !== "string") {
667
- throw new NarsilError(ErrorCodes.DOC_VALIDATION_FAILED, "Document ID must be a string", {
668
- received: given === null ? "null" : Array.isArray(given) ? "array" : typeof given
669
- });
670
- }
671
- if (docId.length === 0) {
672
- throw new NarsilError(ErrorCodes.DOC_VALIDATION_FAILED, "Document ID must not be empty", { docId });
673
- }
674
- if (docId.length > MAX_DOC_ID_LENGTH) {
675
- throw new NarsilError(
676
- ErrorCodes.DOC_VALIDATION_FAILED,
677
- `Document ID must not exceed ${MAX_DOC_ID_LENGTH} characters`,
678
- {
679
- docId,
680
- length: docId.length
681
- }
682
- );
683
- }
684
- if (docId.includes("\0")) {
685
- throw new NarsilError(ErrorCodes.DOC_VALIDATION_FAILED, "Document ID must not contain null bytes", { docId });
686
- }
687
- if (holdsUnpairedSurrogate(docId)) {
688
- throw new NarsilError(
689
- ErrorCodes.DOC_VALIDATION_FAILED,
690
- "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",
691
- { docId }
692
- );
693
- }
694
- }
695
- function validateBatchList(given, listed) {
696
- if (Array.isArray(given)) return;
697
- throw new NarsilError(ErrorCodes.DOC_VALIDATION_FAILED, `A batch takes its ${listed} as an array`, {
698
- received: given === null ? "null" : typeof given
699
- });
700
- }
701
- function validatePartitionConfig(partitions) {
702
- const { maxDocsPerPartition, maxPartitions, watermark } = partitions;
703
- if (maxDocsPerPartition !== void 0 && (!Number.isInteger(maxDocsPerPartition) || maxDocsPerPartition < 1)) {
704
- throw new NarsilError(ErrorCodes.CONFIG_INVALID, "partitions.maxDocsPerPartition must be a positive integer", {
705
- maxDocsPerPartition
706
- });
707
- }
708
- if (maxPartitions !== void 0 && (!Number.isInteger(maxPartitions) || maxPartitions < 1)) {
709
- throw new NarsilError(ErrorCodes.CONFIG_INVALID, "partitions.maxPartitions must be a positive integer", {
710
- maxPartitions
711
- });
712
- }
713
- if (watermark !== void 0 && (typeof watermark !== "number" || !(watermark > 0) || watermark > 1)) {
714
- throw new NarsilError(ErrorCodes.CONFIG_INVALID, "partitions.watermark must be above 0 and at most 1", {
715
- watermark
716
- });
717
- }
718
- }
719
- function requireSurfaceFormsForPartialFields(schema, surfaceForms) {
720
- if (surfaceForms !== false) return;
721
- const partialFields = partialFieldsOf(schema);
722
- if (partialFields.length === 0) return;
723
- throw new NarsilError(
724
- ErrorCodes.CONFIG_INVALID,
725
- `Field "${partialFields[0]}" declares "partial", which compares words as the documents wrote them, so its index needs surfaceForms left on`,
726
- { fields: [...partialFields], surfaceForms: false }
727
- );
728
- }
729
- function validatePatternValueLimit(limit) {
730
- if (limit === void 0) return;
731
- if (typeof limit !== "number" || !Number.isInteger(limit) || limit < MIN_PATTERN_VALUE_LIMIT || limit > MAX_PATTERN_VALUE_LIMIT) {
732
- throw new NarsilError(
733
- ErrorCodes.CONFIG_INVALID,
734
- `patternValueLimit must be a whole number of code points from ${MIN_PATTERN_VALUE_LIMIT} to ${MAX_PATTERN_VALUE_LIMIT}`,
735
- { patternValueLimit: typeof limit === "number" ? limit : String(limit) }
736
- );
737
- }
738
- }
739
- function requirePositiveSafeInteger(field, value) {
740
- if (value === void 0) return;
741
- if (!Number.isSafeInteger(value) || value < 1) {
742
- throw new NarsilError(ErrorCodes.CONFIG_INVALID, `${field} must be a positive safe integer`, { field, value });
743
- }
744
- }
745
- function validateBootstrapModule(bootstrapModule) {
746
- if (bootstrapModule === void 0) return;
747
- const absolute = bootstrapModule.startsWith("/") || ABSOLUTE_WINDOWS_PATH_PATTERN.test(bootstrapModule) || MODULE_URL_SCHEME_PATTERN.test(bootstrapModule);
748
- if (absolute) return;
749
- throw new NarsilError(
750
- ErrorCodes.CONFIG_INVALID,
751
- `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`,
752
- { bootstrapModule }
753
- );
754
- }
755
- function validateWorkerConfig(workers, lifecycle) {
756
- if (workers === void 0) return;
757
- requirePositiveSafeInteger("workers.count", workers.count);
758
- requirePositiveSafeInteger("workers.promotionThreshold", workers.promotionThreshold);
759
- requirePositiveSafeInteger("workers.idleTimeoutMs", workers.idleTimeoutMs);
760
- if (workers.mainCopyQueries !== void 0 && workers.mainCopyQueries !== "lone" && workers.mainCopyQueries !== "none") {
761
- throw new NarsilError(ErrorCodes.CONFIG_INVALID, "workers.mainCopyQueries must be 'lone' or 'none'", {
762
- mainCopyQueries: workers.mainCopyQueries
763
- });
764
- }
765
- validateBootstrapModule(workers.bootstrapModule);
766
- const closeAfter = lifecycle?.idleTimeoutMs;
767
- if (workers.idleTimeoutMs !== void 0 && closeAfter !== void 0 && workers.idleTimeoutMs > closeAfter) {
768
- throw new NarsilError(
769
- ErrorCodes.CONFIG_INVALID,
770
- "workers.idleTimeoutMs must be at most lifecycle.idleTimeoutMs, so that an index drops its copies before it closes",
771
- { workersIdleTimeoutMs: workers.idleTimeoutMs, lifecycleIdleTimeoutMs: closeAfter }
772
- );
773
- }
774
- }
775
- function clampLimit(limit) {
776
- return clampRowCount(limit, DEFAULT_LIMIT);
777
- }
778
- function clampOffset(offset) {
779
- return clampRowCount(offset, DEFAULT_OFFSET);
780
- }
781
-
782
783
  // src/engine/list-documents/index.ts
783
784
  function clampListLimit(limit) {
784
785
  const clamped = Math.max(1, clampLimit(limit));
@@ -1659,7 +1660,7 @@ function requireCursorDepth(cursor, signature, binding) {
1659
1660
  }
1660
1661
  function hybridSearchOf(params, context, limit, offset, cursorDepth) {
1661
1662
  if ((params.hybrid?.depth ?? null) === null) return executeHybridSearch(params, context, limit, offset, cursorDepth);
1662
- return import('./runtime-UZOC3NPY.mjs').then(
1663
+ return import('./runtime-COIUORCN.mjs').then(
1663
1664
  (runtime) => runtime.searchFixedDepthHybrid(params, context, { cursorDepth: cursorDepth ?? 0, offset, limit }, runtimeHost)
1664
1665
  );
1665
1666
  }
@@ -1669,7 +1670,7 @@ function executeQuery(request, callerContext) {
1669
1670
  if (loadingPhraseCode === null) return runQuery(request, callerContext);
1670
1671
  return loadingPhraseCode.then(() => runQuery(request, callerContext));
1671
1672
  }
1672
- return import('./runtime-UZOC3NPY.mjs').then(
1673
+ return import('./runtime-COIUORCN.mjs').then(
1673
1674
  (runtime) => runtime.executeRerankedQuery(request, callerContext, executeQuery, runtimeHost)
1674
1675
  );
1675
1676
  }
@@ -1,5 +1,5 @@
1
1
  import { PARSED_FIELD_TYPE_CACHE_ENTRIES, VECTOR_PATTERN, MAX_STORED_VECTOR_DIMENSION } from './chunk-L5ORED7V.mjs';
2
- import { NarsilError, ErrorCodes } from './chunk-KUZKUONM.mjs';
2
+ import { NarsilError, ErrorCodes } from './chunk-MP7ABPTD.mjs';
3
3
 
4
4
  // src/schema/validator/field-type.ts
5
5
  var FIELD_OPTION_ORDER = ["sortable", "pattern", "partial"];