@delali/narsil 0.3.1-next.154 → 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.
- package/README.md +1 -0
- package/dist/adapters/filesystem.mjs +2 -2
- package/dist/adapters/gcs.mjs +2 -2
- package/dist/adapters/indexeddb.mjs +1 -1
- package/dist/adapters/s3.mjs +2 -2
- package/dist/{analysis-change-4GCRVRBW.mjs → analysis-change-3TFIHT5E.mjs} +25 -25
- package/dist/{react-native/chunks/analysis-change-entry-TNLUC6IZ.mjs → analysis-change-entry-KA6JAO4X.mjs} +1 -1
- package/dist/archive-history-E4R73RWD.mjs +29 -0
- package/dist/browser/{analysis-change-IXWPXXJJ.mjs → analysis-change-TC36BU47.mjs} +29 -10
- package/dist/{analysis-change-entry-KYGSXW4K.mjs → browser/analysis-change-entry-4MH3CZXH.mjs} +1 -1
- package/dist/browser/archive-history-4IP5XQZY.mjs +29 -0
- package/dist/browser/{chunk-4PD752F6.mjs → chunk-23XRXIBW.mjs} +1 -1
- package/dist/browser/chunk-3UIEB4QF.mjs +63 -0
- package/dist/browser/{chunk-AJ4HHOVT.mjs → chunk-4EWUGZYZ.mjs} +4 -4
- package/dist/browser/{chunk-U2E3HMYW.mjs → chunk-4WCVMOU3.mjs} +1 -1
- package/dist/browser/{chunk-QXTPSX2H.mjs → chunk-56W3HQVJ.mjs} +7 -7
- package/dist/browser/{chunk-3U3QR5YP.mjs → chunk-5TCXK5SB.mjs} +2 -2
- package/dist/browser/chunk-7IGKGWSQ.mjs +79 -0
- package/dist/browser/{chunk-J433A7P3.mjs → chunk-A5KUEGDY.mjs} +5 -5
- package/dist/browser/{chunk-XRV72TJD.mjs → chunk-ABCXENU5.mjs} +2 -2
- package/dist/browser/chunk-ATEBYXP6.mjs +10 -0
- package/dist/{react-native/chunks/chunk-3XKMRNRE.mjs → browser/chunk-BXM5XOCA.mjs} +27 -10
- package/dist/browser/chunk-CJSYBQ4J.mjs +100 -0
- package/dist/{react-native/chunks/chunk-DCKMICOB.mjs → browser/chunk-EXQZGUQH.mjs} +1 -1
- package/dist/browser/{chunk-VCOYGVP7.mjs → chunk-FNIFPFB7.mjs} +3 -3
- package/dist/browser/{chunk-ML6HY7T7.mjs → chunk-G64Q6OJF.mjs} +1 -1
- package/dist/browser/chunk-GPPOG6PT.mjs +9 -0
- package/dist/browser/chunk-IKDKX5VQ.mjs +1007 -0
- package/dist/browser/{chunk-7TTWXUH6.mjs → chunk-JIJXMI42.mjs} +3 -2
- package/dist/browser/chunk-JVBP5EYO.mjs +1106 -0
- package/dist/browser/{chunk-2FX6ROWR.mjs → chunk-K4GCSZLI.mjs} +4 -4
- package/dist/browser/{chunk-EUNBNLKM.mjs → chunk-K5AXJBLL.mjs} +5 -5
- package/dist/browser/chunk-KKAMCABR.mjs +432 -0
- package/dist/browser/{chunk-7MEYN7V6.mjs → chunk-LFIWRCEA.mjs} +1 -9
- package/dist/browser/chunk-M3MQE2X7.mjs +151 -0
- package/dist/browser/{chunk-W5X2UFWQ.mjs → chunk-NLWTBAGB.mjs} +12 -3
- package/dist/browser/chunk-OEDCEZXJ.mjs +92 -0
- package/dist/browser/{chunk-G7LUMBSG.mjs → chunk-RND5CLX3.mjs} +28 -18
- package/dist/browser/{chunk-AYY6PIKL.mjs → chunk-RQBUNZQW.mjs} +2 -2
- package/dist/browser/{chunk-C4KS2QNF.mjs → chunk-RRO3EV4C.mjs} +9 -9
- package/dist/browser/{chunk-2SHAKW2Z.mjs → chunk-SMEQ36NT.mjs} +80 -134
- package/dist/{chunk-KUZKUONM.mjs → browser/chunk-SRMZXJSL.mjs} +1 -0
- package/dist/{react-native/chunks/chunk-3O57C2ZO.mjs → browser/chunk-SUDNZKPL.mjs} +2 -2
- package/dist/browser/{chunk-SJB6VIZG.mjs → chunk-U3JOQGWX.mjs} +1 -1
- package/dist/browser/{chunk-H6QFBMVE.mjs → chunk-XY4VVBBO.mjs} +3 -3
- package/dist/browser/{cold-module-VTUGDYNY.mjs → cold-module-NEUGHUPA.mjs} +18 -17
- package/dist/browser/durability-config-TIYKW6XX.mjs +89 -0
- package/dist/browser/{durability-wiring-GL4A7KDV.mjs → durability-wiring-CVGPRO6D.mjs} +46 -150
- package/dist/browser/engine-hooks-YXMPHZKZ.mjs +16 -0
- package/dist/browser/{import-YI5GNB4H.mjs → import-OM6QAW45.mjs} +10 -9
- package/dist/browser/{methods-LMUTS7OI.mjs → methods-KTQCSIN4.mjs} +3 -3
- package/dist/browser/{module-EC3FYW7N.mjs → module-3HNFCBJ5.mjs} +10 -9
- package/dist/browser/{module-M4JNBV6V.mjs → module-E33X4AOK.mjs} +14 -13
- package/dist/browser/operations-OJ3BXS55.mjs +5 -0
- package/dist/browser/{phrase-module-NPYUVX75.mjs → phrase-module-ZXXU7S3B.mjs} +1 -1
- package/dist/browser/{pool-WCGDZHJP.mjs → pool-3JLET5RO.mjs} +1 -1
- package/dist/browser/restore-hooks-IF2ZROUP.mjs +113 -0
- package/dist/browser/restore-queue-ZBS7CJA6.mjs +55 -0
- package/dist/browser/{retention-6QMRS5VK.mjs → retention-ASWUHAYI.mjs} +16 -14
- package/dist/browser/{runtime-3EW2AGB6.mjs → runtime-OTAGEFQW.mjs} +1 -1
- package/dist/browser/{snapshot-DN3CRVUQ.mjs → snapshot-PN7ZW6Q4.mjs} +65 -31
- package/dist/browser/start-ZIRB7MQ2.mjs +24 -0
- package/dist/browser/{write-WAWAFGKQ.mjs → write-HMDYCTV2.mjs} +14 -13
- package/dist/{capabilities-B3Brs1Rc.d.ts → capabilities-Da4ywVVl.d.ts} +35 -3
- package/dist/{chunk-K4B7OH65.mjs → chunk-2MANFZJ3.mjs} +2 -2
- package/dist/{chunk-O43Z4MS6.mjs → chunk-2NE7VCYE.mjs} +2 -2
- package/dist/{chunk-3Y3J4V2R.mjs → chunk-3C7MTCCI.mjs} +1 -1
- package/dist/{chunk-RVKFI3A2.mjs → chunk-3HB3PEC6.mjs} +11 -8
- package/dist/chunk-3HHQLEEQ.mjs +1092 -0
- package/dist/{chunk-HVYICDY3.mjs → chunk-3OH67G7R.mjs} +1 -1
- package/dist/{chunk-QKZHLADX.mjs → chunk-3R4UZWQG.mjs} +26 -17
- package/dist/{chunk-ZIFJXCKA.mjs → chunk-4BYWRYPM.mjs} +1 -1
- package/dist/{chunk-VMXSVVXG.mjs → chunk-4KRC2APY.mjs} +5 -5
- package/dist/{chunk-IQ4R2I6N.mjs → chunk-5FLRXF73.mjs} +5 -1
- package/dist/chunk-5FVU47TB.mjs +20 -0
- package/dist/chunk-5YNRKI2C.mjs +81 -0
- package/dist/chunk-6L3XJXGU.mjs +470 -0
- package/dist/{chunk-C6ASEFZI.mjs → chunk-6OEGXLBX.mjs} +1 -1
- package/dist/{browser/chunk-SIR3LMTV.mjs → chunk-6RC4K46J.mjs} +2 -2
- package/dist/{chunk-466PYR4P.mjs → chunk-AILVAOLX.mjs} +2 -2
- package/dist/chunk-BDRIVYOK.mjs +72 -0
- package/dist/{chunk-TRISKD4Q.mjs → chunk-BY6ZDGYS.mjs} +2 -2
- package/dist/{chunk-NZMAXR2S.mjs → chunk-DCNKVEDB.mjs} +121 -10
- package/dist/{chunk-C73JLU4E.mjs → chunk-DIBHI6W5.mjs} +2 -2
- package/dist/{chunk-VREK3MYG.mjs → chunk-DUOLGBTE.mjs} +3 -3
- package/dist/{chunk-USR7FQRZ.mjs → chunk-GH4WQ22V.mjs} +2 -2
- package/dist/chunk-GQPTDQCL.mjs +54 -0
- package/dist/chunk-H4KHPLHJ.mjs +382 -0
- package/dist/{chunk-K7KLL263.mjs → chunk-H6VIGE62.mjs} +12 -12
- package/dist/{chunk-YROWNOMH.mjs → chunk-HJJI72X7.mjs} +1 -1
- package/dist/{chunk-37IVJLP6.mjs → chunk-HNVVEQP7.mjs} +1 -1
- package/dist/{chunk-PFKM7VNZ.mjs → chunk-HW5TNXBO.mjs} +28 -10
- package/dist/{chunk-3A5KI24C.mjs → chunk-I54T6CQP.mjs} +1 -1
- package/dist/{chunk-YBJDOA2T.mjs → chunk-INJYO3BU.mjs} +1 -1
- package/dist/{chunk-KCUIFVVW.mjs → chunk-J4IWBIVY.mjs} +9 -9
- package/dist/{chunk-AO2FAYIZ.mjs → chunk-K4ZIGL2O.mjs} +1 -1
- package/dist/{chunk-7NTMUDC5.mjs → chunk-KBDBPVLN.mjs} +5 -5
- package/dist/{chunk-JFNKIBDT.mjs → chunk-KBKEXQZA.mjs} +2 -2
- package/dist/{chunk-REL7LFLR.mjs → chunk-KFLK5NA2.mjs} +3 -3
- package/dist/{chunk-WCBA2LVZ.mjs → chunk-KHKIRS5D.mjs} +1 -1
- package/dist/{chunk-7QUGDVFC.mjs → chunk-KJ3RTZDJ.mjs} +1 -1
- package/dist/{chunk-LSM2YTKM.mjs → chunk-KMUNHGBQ.mjs} +81 -139
- package/dist/chunk-KP7TYHWT.mjs +92 -0
- package/dist/{chunk-MMBEANB2.mjs → chunk-KPIV4RUC.mjs} +3 -3
- package/dist/{chunk-62G63NMH.mjs → chunk-KXCVQWOR.mjs} +4 -4
- package/dist/{chunk-TV2L3BN7.mjs → chunk-L7ZD4L3K.mjs} +263 -263
- package/dist/{chunk-OKX2BBNW.mjs → chunk-LC3FDWTX.mjs} +2 -2
- package/dist/{chunk-URPCYQVJ.mjs → chunk-LHKOSI2J.mjs} +1 -1
- package/dist/chunk-LNGE7SLY.mjs +151 -0
- package/dist/{react-native/chunks/chunk-CUNGPR5R.mjs → chunk-MP7ABPTD.mjs} +1 -0
- package/dist/chunk-MT2NRTA6.mjs +216 -0
- package/dist/{chunk-Q3TCTQCC.mjs → chunk-NF4DT3IH.mjs} +1 -1
- package/dist/{chunk-3OFU3NJT.mjs → chunk-OIJ64LGT.mjs} +1 -1
- package/dist/{chunk-4HWZV5MK.mjs → chunk-PCRA7HTI.mjs} +5 -5
- package/dist/chunk-PHQNACDT.mjs +63 -0
- package/dist/{chunk-Q7MS6P2J.mjs → chunk-Q622CTMC.mjs} +2 -2
- package/dist/{chunk-HVKXNBFL.mjs → chunk-Q7G3BV3Y.mjs} +1 -1
- package/dist/{chunk-IBNLW3AV.mjs → chunk-QH3YIQP4.mjs} +20 -6
- package/dist/{chunk-B7S6YEBP.mjs → chunk-QJVOLKU6.mjs} +12 -3
- package/dist/chunk-QUJHMPTP.mjs +30 -0
- package/dist/{chunk-7HCZWC7B.mjs → chunk-RSVULW4Q.mjs} +49 -7
- package/dist/{chunk-YPUEV6ZC.mjs → chunk-RVGRFOGN.mjs} +1 -1
- package/dist/{chunk-JCLTESFN.mjs → chunk-RZWWB2XR.mjs} +1 -1
- package/dist/{chunk-X6NSJYQ3.mjs → chunk-S2EQU2GE.mjs} +13 -13
- package/dist/chunk-S5LN746F.mjs +10 -0
- package/dist/{chunk-MMEMEUOO.mjs → chunk-SG3JBNHY.mjs} +2 -2
- package/dist/{chunk-LKUE5GXS.mjs → chunk-SMVH6JBE.mjs} +2 -2
- package/dist/{chunk-IJU7LL7D.mjs → chunk-SY3EWKQY.mjs} +5 -5
- package/dist/{chunk-CP5RRPJR.mjs → chunk-TQXHPFWT.mjs} +1 -1
- package/dist/{chunk-5KGYQT6W.mjs → chunk-U4BS74YN.mjs} +26 -9
- package/dist/{chunk-S2N75OTN.mjs → chunk-UHICS3JI.mjs} +1 -1
- package/dist/chunk-UZRZKNNZ.mjs +101 -0
- package/dist/{chunk-DMQPFLGI.mjs → chunk-VGF7CFRP.mjs} +5 -5
- package/dist/chunk-VHBNF4MA.mjs +543 -0
- package/dist/{chunk-BPSKLCS7.mjs → chunk-VQEUR6T6.mjs} +3 -3
- package/dist/{chunk-Z3TNWCI5.mjs → chunk-WQRN64Q6.mjs} +2 -2
- package/dist/{chunk-LTUGDMV4.mjs → chunk-WZ7YV54N.mjs} +1 -1
- package/dist/{chunk-NTZOXVUZ.mjs → chunk-YEDIDCR7.mjs} +3 -3
- package/dist/{chunk-PGVPE7GJ.mjs → chunk-YEKL4JBK.mjs} +1 -1
- package/dist/{chunk-5FUOVJKG.mjs → chunk-Z2BE2MAM.mjs} +13 -13
- package/dist/{chunk-HWEDFLB7.mjs → chunk-ZAUJFLEN.mjs} +10 -10
- package/dist/{chunk-MLHNSAPK.mjs → chunk-ZHCUZZE5.mjs} +2 -2
- package/dist/{chunk-ECX4SGX6.mjs → chunk-ZTW5WTGG.mjs} +9 -9
- package/dist/{client-Df76GNKm.d.ts → client-DRv7UVeY.d.ts} +123 -11
- package/dist/client.d.ts +9 -8
- package/dist/client.mjs +65 -3
- package/dist/{cold-module-YLWMTTZG.mjs → cold-module-7XXCEGTZ.mjs} +35 -35
- package/dist/{config-B8DP2VwR.d.ts → config-CoSig5Ox.d.ts} +22 -3
- package/dist/{config-05G_hy-1.d.ts → config-DMwffLKn.d.ts} +20 -5
- package/dist/{direct-executor-FI5GJHWX.mjs → direct-executor-G5TK7NLA.mjs} +16 -16
- package/dist/distribution/coordinator/etcd.d.ts +2 -2
- package/dist/distribution/coordinator/etcd.mjs +1 -1
- package/dist/distribution/coordinator/in-memory.d.ts +2 -2
- package/dist/distribution/transport/grpc.mjs +4 -4
- package/dist/distribution/transport/in-memory.mjs +2 -2
- package/dist/distribution/transport/tcp.mjs +3 -3
- package/dist/distribution.d.ts +8 -8
- package/dist/distribution.mjs +6788 -5934
- package/dist/durability-config-GE4U7MCZ.mjs +89 -0
- package/dist/{durability-wiring-RHLXDIVF.mjs → durability-wiring-NCKUC5EO.mjs} +71 -175
- package/dist/embeddings/openai.mjs +2 -2
- package/dist/{sync-uXR7MmM7.d.ts → engine-CFxPYqEk.d.ts} +702 -2
- package/dist/engine-hooks-DHCMOADY.mjs +47 -0
- package/dist/{import-SRBNC6TE.mjs → import-NBFXFCSG.mjs} +26 -26
- package/dist/{index-nRqDM6uS.d.ts → index-C4AmUnl1.d.ts} +1 -1
- package/dist/index.browser.mjs +7 -6
- package/dist/index.d.ts +7 -7
- package/dist/index.mjs +23 -23
- package/dist/index.react-native.mjs +13 -12
- package/dist/{long-query-thread-EMYTGSJP.mjs → long-query-thread-J4DVRM4A.mjs} +25 -24
- package/dist/{methods-ABM5ELBR.mjs → methods-7IOINERF.mjs} +3 -3
- package/dist/{module-MG7JMV2U.mjs → module-DWKPBSMN.mjs} +31 -31
- package/dist/{module-3OMJZUFT.mjs → module-UN76TF7I.mjs} +11 -11
- package/dist/operations-G5EP6JPX.mjs +5 -0
- package/dist/{paged-partition-archive-UOLHOEZJ.mjs → paged-partition-archive-DPNWVSK2.mjs} +38 -34
- package/dist/partial-words.mjs +7 -7
- package/dist/pattern.mjs +3 -3
- package/dist/persistence/durability/checkpoint-worker.d.ts +8 -1
- package/dist/persistence/durability/checkpoint-worker.mjs +32 -32
- package/dist/{phrase-module-O3MDRQXP.mjs → phrase-module-ZI4WSQVH.mjs} +1 -1
- package/dist/{pool-CQXYPFLG.mjs → pool-Y4A46T36.mjs} +1 -1
- package/dist/query-suggestions/merge-worker.d.ts +55 -0
- package/dist/query-suggestions/merge-worker.mjs +81 -0
- package/dist/query-suggestions-CBYkrQ5T.d.ts +311 -0
- package/dist/query-suggestions.browser.mjs +246 -0
- package/dist/query-suggestions.d.ts +20 -0
- package/dist/query-suggestions.mjs +62 -0
- package/dist/react-native/chunks/{analysis-change-EAYO3Y6Q.mjs → analysis-change-6BPDPH6K.mjs} +36 -17
- package/dist/{browser/analysis-change-entry-FCSHFQSS.mjs → react-native/chunks/analysis-change-entry-JLL42PH6.mjs} +1 -1
- package/dist/react-native/chunks/archive-history-MJKUQLSU.mjs +29 -0
- package/dist/react-native/chunks/{chunk-O32RB3BL.mjs → chunk-3JIBF3XT.mjs} +3 -3
- package/dist/react-native/chunks/{chunk-75VWIY35.mjs → chunk-4DII3ZSM.mjs} +1 -1
- package/dist/react-native/chunks/{chunk-NKIZX26F.mjs → chunk-4J74WHQM.mjs} +2 -2
- package/dist/{browser/chunk-TTD27VXX.mjs → react-native/chunks/chunk-4LCEN2IU.mjs} +27 -10
- package/dist/react-native/chunks/{chunk-AUT7PMA4.mjs → chunk-4Y53T4YE.mjs} +5 -5
- package/dist/react-native/chunks/chunk-5CQX3XXV.mjs +17 -0
- package/dist/react-native/chunks/chunk-6VBXNFLE.mjs +9 -0
- package/dist/react-native/chunks/{chunk-SJWDBRNP.mjs → chunk-6WA3C3DV.mjs} +1 -1
- package/dist/react-native/chunks/chunk-7GRCBBME.mjs +63 -0
- package/dist/react-native/chunks/{chunk-7GWPJDOA.mjs → chunk-7PXRWYUU.mjs} +1 -1
- package/dist/react-native/chunks/{chunk-GFYFQLJD.mjs → chunk-ALOIBXWN.mjs} +2 -2
- package/dist/react-native/chunks/{chunk-VQSKZ3EZ.mjs → chunk-C3PTWYKT.mjs} +8 -8
- package/dist/react-native/chunks/{chunk-OQQVRWZ2.mjs → chunk-C5G6TJ7A.mjs} +1 -1
- package/dist/react-native/chunks/{chunk-RVAEBN74.mjs → chunk-CKNRFDTZ.mjs} +1 -1
- package/dist/react-native/chunks/{chunk-UWDNZDWK.mjs → chunk-CUH5F57W.mjs} +6 -6
- package/dist/react-native/chunks/chunk-DIYDOIM4.mjs +10 -0
- package/dist/react-native/chunks/{chunk-YBEW6YTR.mjs → chunk-DVDX4SDR.mjs} +2 -2
- package/dist/{browser/chunk-MYITLCHT.mjs → react-native/chunks/chunk-DZ7H7D2C.mjs} +1 -0
- package/dist/react-native/chunks/{chunk-RYMDHGL4.mjs → chunk-EIOYM5TO.mjs} +5 -5
- package/dist/react-native/chunks/chunk-GIZTJXYW.mjs +1007 -0
- package/dist/react-native/chunks/{chunk-NP7DD4G5.mjs → chunk-GJFXPHXI.mjs} +5 -5
- package/dist/react-native/chunks/chunk-H3MDVPBO.mjs +151 -0
- package/dist/react-native/chunks/{chunk-63YSZOXB.mjs → chunk-HUOYZJ3Q.mjs} +88 -142
- package/dist/react-native/chunks/{chunk-DH3TVWWK.mjs → chunk-IYNT75CE.mjs} +12 -3
- package/dist/react-native/chunks/{chunk-NCJS3WIY.mjs → chunk-JLIIWJUV.mjs} +1 -1
- package/dist/react-native/chunks/chunk-KJIG57UD.mjs +1106 -0
- package/dist/react-native/chunks/{chunk-JX2RIAXH.mjs → chunk-KTTAU63H.mjs} +5 -5
- package/dist/{browser/chunk-ZPTA75ZC.mjs → react-native/chunks/chunk-LZSLNSUN.mjs} +1 -1
- package/dist/react-native/chunks/{chunk-ZBSWRSBG.mjs → chunk-MJDQU5MW.mjs} +1 -1
- package/dist/react-native/chunks/{chunk-IOY2SM2P.mjs → chunk-MVXELMJX.mjs} +1 -1
- package/dist/react-native/chunks/{chunk-2CGSQM4O.mjs → chunk-N2WUOWLL.mjs} +12 -12
- package/dist/react-native/chunks/{chunk-YHKZSLOC.mjs → chunk-OL3WDV53.mjs} +5 -5
- package/dist/react-native/chunks/{chunk-VVFYOADG.mjs → chunk-PEHS2UO3.mjs} +6 -6
- package/dist/react-native/chunks/chunk-PJHAB5ZY.mjs +79 -0
- package/dist/react-native/chunks/chunk-QJXTNPLQ.mjs +100 -0
- package/dist/react-native/chunks/{chunk-EH5CFV6Z.mjs → chunk-RDWG33MM.mjs} +2 -2
- package/dist/react-native/chunks/{chunk-ZYDKJXQJ.mjs → chunk-SUPXRTMD.mjs} +1 -1
- package/dist/react-native/chunks/chunk-TYIRMPD3.mjs +432 -0
- package/dist/react-native/chunks/{chunk-JPAJWO6D.mjs → chunk-U4KSKA4Z.mjs} +1 -1
- package/dist/react-native/chunks/{chunk-I5PGWQJF.mjs → chunk-VXGE4ZXL.mjs} +31 -22
- package/dist/{chunk-DVWYODEB.mjs → react-native/chunks/chunk-WBYQRHDY.mjs} +2 -2
- package/dist/react-native/chunks/{chunk-C2H2QQFW.mjs → chunk-YH7QY657.mjs} +3 -3
- package/dist/react-native/chunks/chunk-ZZT7CEN7.mjs +92 -0
- package/dist/react-native/chunks/{cold-module-TJL6AFAD.mjs → cold-module-5PHF6DZR.mjs} +24 -23
- package/dist/react-native/chunks/durability-config-QXVZEO7T.mjs +89 -0
- package/dist/react-native/chunks/{durability-wiring-RRDYJLLM.mjs → durability-wiring-KO565FZC.mjs} +52 -156
- package/dist/react-native/chunks/engine-hooks-MVRRHH6B.mjs +28 -0
- package/dist/react-native/chunks/gzip.react-native-HLEPDKZ3.mjs +3 -0
- package/dist/react-native/chunks/import-YVZA4V4V.mjs +30 -0
- package/dist/react-native/chunks/{methods-X6F36SJE.mjs → methods-6W5U4C3H.mjs} +3 -3
- package/dist/react-native/chunks/{module-S4DKSWMF.mjs → module-H5MVPSP2.mjs} +11 -10
- package/dist/react-native/chunks/{module-QT5HZAY4.mjs → module-ZL5ZG6YB.mjs} +20 -19
- package/dist/react-native/chunks/operations-GNRMD6EX.mjs +5 -0
- package/dist/react-native/chunks/{phrase-module-JZ37TB7N.mjs → phrase-module-RTVKEWJT.mjs} +1 -1
- package/dist/react-native/chunks/{pool-RTGXJXPU.mjs → pool-JR3NJCAF.mjs} +1 -1
- package/dist/react-native/chunks/restore-hooks-SILFPU6B.mjs +125 -0
- package/dist/react-native/chunks/restore-queue-HSYP2AEC.mjs +55 -0
- package/dist/react-native/chunks/{retention-PPCTP2VY.mjs → retention-7I7UAWYK.mjs} +21 -19
- package/dist/react-native/chunks/{runtime-KUATOLYB.mjs → runtime-R5E3TB3J.mjs} +1 -1
- package/dist/react-native/chunks/{snapshot-ZBIEOZTZ.mjs → snapshot-EZYB6SLF.mjs} +70 -36
- package/dist/react-native/chunks/start-SHVZ72I5.mjs +36 -0
- package/dist/react-native/chunks/{write-2W4FTX7J.mjs → write-JUESXHDL.mjs} +20 -19
- package/dist/react-native/partial-words.mjs +7 -6
- package/dist/react-native/pattern.mjs +3 -3
- package/dist/react-native/query-suggestions.mjs +258 -0
- package/dist/react-native/sync.mjs +76 -13
- package/dist/react-native/synonyms.mjs +4 -4
- package/dist/react.d.ts +11 -11
- package/dist/react.mjs +1 -0
- package/dist/{rerank-IZOB6NII.mjs → rerank-MQ37IYRV.mjs} +4 -4
- package/dist/rerankers/http.mjs +2 -2
- package/dist/restore-hooks-HZ3ILAMO.mjs +146 -0
- package/dist/restore-queue-JVGENGGE.mjs +55 -0
- package/dist/{retention-55WA7GPU.mjs → retention-HROPV2QU.mjs} +33 -32
- package/dist/{runtime-UZOC3NPY.mjs → runtime-COIUORCN.mjs} +5 -5
- package/dist/{schema-DDauvDOv.d.ts → schema-Jwt928nJ.d.ts} +1 -1
- package/dist/server.d.ts +108 -12
- package/dist/server.mjs +293 -46
- package/dist/{snapshot-NFX2EYN2.mjs → snapshot-4HS2G2UM.mjs} +85 -54
- package/dist/start-UTWHGH42.mjs +59 -0
- package/dist/sync/filesystem.d.ts +4 -4
- package/dist/sync/filesystem.mjs +4 -4
- package/dist/sync/indexeddb.d.ts +4 -4
- package/dist/sync/indexeddb.mjs +2 -2
- package/dist/sync.browser.mjs +74 -11
- package/dist/sync.d.ts +5 -5
- package/dist/sync.mjs +76 -14
- package/dist/synonyms.mjs +5 -5
- package/dist/{tasks-BShx8pdK.d.ts → tasks-qrJojgST.d.ts} +13 -5
- package/dist/{thread-P2G2FWM2.mjs → thread-6MOXY2KD.mjs} +24 -23
- package/dist/{types-SnO7_tAI.d.ts → types-BZCGjfLn.d.ts} +2 -3
- package/dist/vector/search-worker.d.ts +1 -1
- package/dist/vector/search-worker.mjs +5 -5
- package/dist/workers/entry.mjs +8 -8
- package/dist/{write-FGB62BHQ.mjs → write-GTTWWRRG.mjs} +30 -30
- package/openapi.json +798 -7
- package/package.json +24 -7
- package/dist/browser/operations-WVYLF72Q.mjs +0 -5
- package/dist/browser/restore-queue-TYIGDL5L.mjs +0 -41
- package/dist/engine-DYu-e0oR.d.ts +0 -674
- package/dist/operations-PGOAY2KS.mjs +0 -5
- package/dist/react-native/chunks/chunk-TJMSKBEM.mjs +0 -25
- package/dist/react-native/chunks/gzip.react-native-DNB5YNFA.mjs +0 -3
- package/dist/react-native/chunks/import-JYBMEJPQ.mjs +0 -29
- package/dist/react-native/chunks/operations-RYKTSZQA.mjs +0 -5
- package/dist/react-native/chunks/restore-queue-ZBVIKJWI.mjs +0 -41
- package/dist/restore-queue-COI2GSSK.mjs +0 -41
|
@@ -1,19 +1,19 @@
|
|
|
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-
|
|
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
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 {
|
|
8
|
+
import { flattenSchema, partialFieldsOf } from './chunk-WQRN64Q6.mjs';
|
|
13
9
|
import { fuzzyTermMatches } from './chunk-GES7U2PM.mjs';
|
|
14
|
-
import { isStringValuedBase, parsedTypeOf, isWordIndexedFieldType } from './chunk-
|
|
10
|
+
import { isStringValuedBase, parsedTypeOf, isWordIndexedFieldType } from './chunk-I54T6CQP.mjs';
|
|
11
|
+
import { tokenize } from './chunk-4BYWRYPM.mjs';
|
|
15
12
|
import { MIN_PATTERN_VALUE_LIMIT, MAX_PATTERN_VALUE_LIMIT, isPlainObject, isGeopointOrVectorType, VECTOR_PATTERN } from './chunk-L5ORED7V.mjs';
|
|
16
|
-
import {
|
|
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';
|
|
17
17
|
import { compareComparableKeys } from './chunk-R6A773WK.mjs';
|
|
18
18
|
import { compareCodePoints, holdsUnpairedSurrogate } from './chunk-YTJCGKM4.mjs';
|
|
19
19
|
|
|
@@ -107,6 +107,259 @@ function readEngineMemoryFigures() {
|
|
|
107
107
|
return measure();
|
|
108
108
|
}
|
|
109
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
|
+
|
|
110
363
|
// src/search/cursor-binding.ts
|
|
111
364
|
var ABSENT_TAG = 0;
|
|
112
365
|
var NULL_TAG = 1;
|
|
@@ -317,110 +570,6 @@ function listBindingOf(filters) {
|
|
|
317
570
|
return bindingOf(values);
|
|
318
571
|
}
|
|
319
572
|
|
|
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
573
|
// src/search/query-fields.ts
|
|
425
574
|
function requireBoostableFields(boost, flatSchema) {
|
|
426
575
|
for (const [field, weight] of Object.entries(boost)) {
|
|
@@ -630,155 +779,6 @@ function requireVectorSearchable(params, context, needsVector) {
|
|
|
630
779
|
);
|
|
631
780
|
}
|
|
632
781
|
|
|
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
782
|
// src/engine/list-documents/index.ts
|
|
783
783
|
function clampListLimit(limit) {
|
|
784
784
|
const clamped = Math.max(1, clampLimit(limit));
|
|
@@ -1659,7 +1659,7 @@ function requireCursorDepth(cursor, signature, binding) {
|
|
|
1659
1659
|
}
|
|
1660
1660
|
function hybridSearchOf(params, context, limit, offset, cursorDepth) {
|
|
1661
1661
|
if ((params.hybrid?.depth ?? null) === null) return executeHybridSearch(params, context, limit, offset, cursorDepth);
|
|
1662
|
-
return import('./runtime-
|
|
1662
|
+
return import('./runtime-COIUORCN.mjs').then(
|
|
1663
1663
|
(runtime) => runtime.searchFixedDepthHybrid(params, context, { cursorDepth: cursorDepth ?? 0, offset, limit }, runtimeHost)
|
|
1664
1664
|
);
|
|
1665
1665
|
}
|
|
@@ -1669,7 +1669,7 @@ function executeQuery(request, callerContext) {
|
|
|
1669
1669
|
if (loadingPhraseCode === null) return runQuery(request, callerContext);
|
|
1670
1670
|
return loadingPhraseCode.then(() => runQuery(request, callerContext));
|
|
1671
1671
|
}
|
|
1672
|
-
return import('./runtime-
|
|
1672
|
+
return import('./runtime-COIUORCN.mjs').then(
|
|
1673
1673
|
(runtime) => runtime.executeRerankedQuery(request, callerContext, executeQuery, runtimeHost)
|
|
1674
1674
|
);
|
|
1675
1675
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { bitsetHas, bitsetSet, GrowableUint32, createBitSet, bitsetAnd, bitsetNot } from './chunk-JUKYYXSP.mjs';
|
|
2
2
|
import { tabulatedLevenshtein } from './chunk-GES7U2PM.mjs';
|
|
3
|
-
import { parsedTypeOf } from './chunk-
|
|
4
|
-
import { NarsilError, ErrorCodes } from './chunk-
|
|
3
|
+
import { parsedTypeOf } from './chunk-I54T6CQP.mjs';
|
|
4
|
+
import { NarsilError, ErrorCodes } from './chunk-MP7ABPTD.mjs';
|
|
5
5
|
import { codePointCount, exceedsCodePoints } from './chunk-YTJCGKM4.mjs';
|
|
6
6
|
|
|
7
7
|
// src/core/pattern-index/constants.ts
|