@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
package/dist/server.mjs
CHANGED
|
@@ -1,72 +1,88 @@
|
|
|
1
|
-
import { answerRequest } from './chunk-
|
|
2
|
-
import { DEFAULT_MAX_RETAINED_TASKS, loadUWebSockets, registerFeedRoute, resolveCors, authorizerFor, createSharedGateBuffer, gateSlotOfWorker, createBodyBudgetBuffer, createRouteRunner, corsHeaderReader, createSharedBodyBudget, MAIN_THREAD_GATE_SLOT, createSharedRequestGate, registerServerRoutes, DEFAULT_MAX_FEED_BUFFERED_BYTES, DEFAULT_MAX_FEED_CATCH_UPS, DEFAULT_MAX_FEED_CONNECTIONS, DEFAULT_FEED_WINDOW_BYTES, DEFAULT_MAX_CONCURRENT_TASKS, DEFAULT_MAX_TASK_PAGE_SIZE, DEFAULT_MAX_IMPORT_ERRORS, DEFAULT_MAX_FETCH_DOCUMENTS, DEFAULT_MAX_RESULT_WINDOW, DEFAULT_MAX_CONCURRENT_REQUESTS, DEFAULT_IMPORT_BATCH_SIZE, DEFAULT_MAX_LINE_BYTES, DEFAULT_MAX_RESTORE_BYTES, DEFAULT_MAX_IMPORT_BYTES, DEFAULT_MAX_BODY_BYTES, DEFAULT_MAX_RERANK_WINDOW, DEFAULT_MAX_BODY_BYTES_IN_FLIGHT_FRACTION, RUNNING_TASK_TTL_MS, DEFAULT_TASK_PAGE_SIZE, TERMINAL_TASK_TTL_MS, TASK_PROGRESS_WRITE_INTERVAL_MS, serializeNarsilError, createVersionHandler, createSyncSnapshotHandler, acceptorOf, MAX_BODY_BYTES_IN_FLIGHT_FRACTION, toHttpError, createDocumentReadHandlers, sendError, respondError, respondJson, sendText, PROMETHEUS_TEXT_CONTENT_TYPE, MAX_INDEX_TOUCH_INTERVAL_MS, INDEX_TOUCH_INTERVALS_PER_IDLE_TIMEOUT, closeEveryThreadAtExit, REQUEST_THREAD_CLOSE_AT_EXIT_MS, clearGateSlot, clearBodyBudgetSlot, createCloseAtExitWords, createDepartureWord, departureConfirmed, TIMER_DELAY_LIMIT_MS, FEED_HEAD_RETRY_MS, parseJson, validateCreateIndex, rejectInvalid, isRemoveOnlyBatch, validateBatch, serializeBatchResult, parseWriteJson, validateDocumentBody, validateSuggest, validateQuery, refuseRegex, withServerRerankWindow, respondAnswer, parseTaskListQuery, parseJsonOptional, validateChangeAnalysis, validateRebalance, badRequest, sendStream, SNAPSHOT_ARCHIVE_CONTENT_TYPE, DOCUMENT_EXPORT_CONTENT_TYPE, parseRefusalOf, IMPORT_FLUSHES_IN_FLIGHT, confirmDeparture, isThreadFeedNote, ENTRIES_MESSAGE_LIMIT_BYTES, SERVER_CAPABILITIES, MIN_UNBOUNDED_SERVER_LIMIT, MIN_COUNTED_SERVER_LIMIT } from './chunk-
|
|
3
|
-
export { ASYNC_IMPORT_CAPABILITY, BM25_TUNING_CAPABILITY, CHANGE_ANALYSIS_CAPABILITY, DOCUMENT_EXPORT_CAPABILITY, INDEX_LIFECYCLE_CAPABILITY, REBUILD_ANALYSIS_CAPABILITY, SERVER_CAPABILITIES, SYNONYMS_CAPABILITY, TASK_CANCEL_CAPABILITY, TASK_FILTER_CAPABILITY, httpStatusForNarsilError } from './chunk-
|
|
4
|
-
import { rerankOnHost } from './chunk-
|
|
5
|
-
import { startSyncRetentionSweep, publishedSyncSnapshot, publishedArchiveLayout } from './chunk-
|
|
6
|
-
import './chunk-
|
|
1
|
+
import { answerRequest } from './chunk-SMVH6JBE.mjs';
|
|
2
|
+
import { DEFAULT_MAX_RETAINED_TASKS, loadUWebSockets, registerFeedRoute, resolveCors, authorizerFor, createSharedGateBuffer, gateSlotOfWorker, createBodyBudgetBuffer, createRouteRunner, corsHeaderReader, createSharedBodyBudget, MAIN_THREAD_GATE_SLOT, createSharedRequestGate, registerServerRoutes, DEFAULT_MAX_FEED_BUFFERED_BYTES, DEFAULT_MAX_FEED_CATCH_UPS, DEFAULT_MAX_FEED_CONNECTIONS, DEFAULT_FEED_WINDOW_BYTES, DEFAULT_MAX_CONCURRENT_TASKS, DEFAULT_MAX_TASK_PAGE_SIZE, DEFAULT_MAX_IMPORT_ERRORS, DEFAULT_MAX_FETCH_DOCUMENTS, DEFAULT_MAX_RESULT_WINDOW, DEFAULT_MAX_CONCURRENT_REQUESTS, DEFAULT_IMPORT_BATCH_SIZE, DEFAULT_MAX_LINE_BYTES, DEFAULT_MAX_RESTORE_BYTES, DEFAULT_MAX_IMPORT_BYTES, DEFAULT_MAX_BODY_BYTES, DEFAULT_MAX_RERANK_WINDOW, DEFAULT_MAX_BODY_BYTES_IN_FLIGHT_FRACTION, RUNNING_TASK_TTL_MS, DEFAULT_TASK_PAGE_SIZE, TERMINAL_TASK_TTL_MS, TASK_PROGRESS_WRITE_INTERVAL_MS, serializeNarsilError, createVersionHandler, createSyncSnapshotHandler, acceptorOf, MAX_BODY_BYTES_IN_FLIGHT_FRACTION, toHttpError, createDocumentReadHandlers, sendError, respondError, respondJson, sendText, PROMETHEUS_TEXT_CONTENT_TYPE, MAX_INDEX_TOUCH_INTERVAL_MS, INDEX_TOUCH_INTERVALS_PER_IDLE_TIMEOUT, closeEveryThreadAtExit, REQUEST_THREAD_CLOSE_AT_EXIT_MS, clearGateSlot, clearBodyBudgetSlot, createCloseAtExitWords, createDepartureWord, departureConfirmed, TIMER_DELAY_LIMIT_MS, FEED_HEAD_RETRY_MS, parseJson, validateCreateIndex, rejectInvalid, isRemoveOnlyBatch, validateBatch, serializeBatchResult, parseWriteJson, validateDocumentBody, validateSuggest, validateQuery, refuseRegex, withServerRerankWindow, respondAnswer, parseTaskListQuery, parseJsonOptional, validateChangeAnalysis, validateRebalance, badRequest, sendStream, SNAPSHOT_ARCHIVE_CONTENT_TYPE, DOCUMENT_EXPORT_CONTENT_TYPE, parseRefusalOf, IMPORT_FLUSHES_IN_FLIGHT, confirmDeparture, isThreadFeedNote, ENTRIES_MESSAGE_LIMIT_BYTES, SERVER_CAPABILITIES, MIN_UNBOUNDED_SERVER_LIMIT, MIN_COUNTED_SERVER_LIMIT } from './chunk-DCNKVEDB.mjs';
|
|
3
|
+
export { ASYNC_IMPORT_CAPABILITY, BM25_TUNING_CAPABILITY, CHANGE_ANALYSIS_CAPABILITY, DOCUMENT_EXPORT_CAPABILITY, INDEX_LIFECYCLE_CAPABILITY, REBUILD_ANALYSIS_CAPABILITY, SERVER_CAPABILITIES, SYNONYMS_CAPABILITY, TASK_CANCEL_CAPABILITY, TASK_FILTER_CAPABILITY, httpStatusForNarsilError } from './chunk-DCNKVEDB.mjs';
|
|
4
|
+
import { rerankOnHost } from './chunk-KHKIRS5D.mjs';
|
|
5
|
+
import { startSyncRetentionSweep, publishedSyncSnapshot, publishedArchiveLayout } from './chunk-ZTW5WTGG.mjs';
|
|
6
|
+
import './chunk-YEKL4JBK.mjs';
|
|
7
7
|
import { SYNC_CLOSE_RESYNC, SYNC_CLOSE_CREDENTIAL_EXPIRED, SYNC_CLOSE_POLICY, MAX_DEVICE_MESSAGE_BYTES, SYNC_CLOSE_TOO_LARGE, deviceMessageOf, SYNC_CLOSE_SERVER_ERROR, positionList, positionsByPartition, SYNC_CLOSE_GOING_AWAY } from './chunk-KYYABCSW.mjs';
|
|
8
|
-
import { syncServingSourceOf, writeBlockLookupOf, indexReadsOf, validateBackupName, readRestorePlacement } from './chunk-
|
|
9
|
-
import './chunk-
|
|
10
|
-
import { isRecord, validateIndexName } from './chunk-
|
|
11
|
-
import
|
|
12
|
-
import './chunk-
|
|
13
|
-
import './chunk-
|
|
14
|
-
import './chunk-V6EUBAIT.mjs';
|
|
8
|
+
import { syncServingSourceOf, writeBlockLookupOf, indexReadsOf, validateBackupName, readRestorePlacement } from './chunk-QH3YIQP4.mjs';
|
|
9
|
+
import './chunk-2MANFZJ3.mjs';
|
|
10
|
+
import { isRecord, validateIndexName } from './chunk-RSVULW4Q.mjs';
|
|
11
|
+
import './chunk-INJYO3BU.mjs';
|
|
12
|
+
import { estimatedArchiveBytes } from './chunk-Q622CTMC.mjs';
|
|
13
|
+
import './chunk-QJVOLKU6.mjs';
|
|
15
14
|
import './chunk-ZYAY26KG.mjs';
|
|
16
|
-
import './chunk-
|
|
17
|
-
import './chunk-
|
|
15
|
+
import './chunk-U4BS74YN.mjs';
|
|
16
|
+
import './chunk-SY3EWKQY.mjs';
|
|
17
|
+
import './chunk-K4ZIGL2O.mjs';
|
|
18
18
|
import './chunk-BUMREPLU.mjs';
|
|
19
|
-
import './chunk-AO2FAYIZ.mjs';
|
|
20
19
|
import './chunk-DJHHF2L5.mjs';
|
|
21
20
|
import './chunk-37CD3OKS.mjs';
|
|
22
21
|
import './chunk-JDDXV6UF.mjs';
|
|
23
|
-
import { manifestFileRefs } from './chunk-
|
|
22
|
+
import { manifestFileRefs } from './chunk-NF4DT3IH.mjs';
|
|
24
23
|
import './chunk-QDZJM7NI.mjs';
|
|
25
|
-
import {
|
|
26
|
-
import
|
|
24
|
+
import { querySuggestions } from './chunk-5FVU47TB.mjs';
|
|
25
|
+
import './chunk-QUJHMPTP.mjs';
|
|
26
|
+
import './chunk-PHQNACDT.mjs';
|
|
27
|
+
import './chunk-S5LN746F.mjs';
|
|
28
|
+
import './chunk-MT2NRTA6.mjs';
|
|
29
|
+
import './chunk-3HHQLEEQ.mjs';
|
|
30
|
+
import './chunk-VHBNF4MA.mjs';
|
|
31
|
+
import './chunk-KP7TYHWT.mjs';
|
|
32
|
+
import './chunk-LNGE7SLY.mjs';
|
|
33
|
+
import './chunk-UZRZKNNZ.mjs';
|
|
34
|
+
import './chunk-H4KHPLHJ.mjs';
|
|
35
|
+
import './chunk-V6EUBAIT.mjs';
|
|
36
|
+
import './chunk-BEZH7VEH.mjs';
|
|
37
|
+
import './chunk-BDRIVYOK.mjs';
|
|
38
|
+
import './chunk-6L3XJXGU.mjs';
|
|
39
|
+
import './chunk-GQPTDQCL.mjs';
|
|
40
|
+
import './chunk-5YNRKI2C.mjs';
|
|
41
|
+
import { rerankWindowCapOf, engineCoreOf, rulesOfStoredSynonyms, providedDocId, resolveVectorText } from './chunk-KMUNHGBQ.mjs';
|
|
42
|
+
import { readMemoryFigures } from './chunk-L7ZD4L3K.mjs';
|
|
27
43
|
import { MAX_RERANK_WINDOW } from './chunk-HJSN7UYG.mjs';
|
|
28
|
-
import { detectRuntime } from './chunk-
|
|
44
|
+
import { detectRuntime } from './chunk-LHKOSI2J.mjs';
|
|
29
45
|
import './chunk-XIHUI4KB.mjs';
|
|
30
46
|
import './chunk-3MXV3VHR.mjs';
|
|
31
47
|
import './chunk-EEBCDP36.mjs';
|
|
32
|
-
import './chunk-
|
|
33
|
-
import './chunk-
|
|
34
|
-
import './chunk-
|
|
35
|
-
import './chunk-
|
|
48
|
+
import './chunk-Z2BE2MAM.mjs';
|
|
49
|
+
import './chunk-ZAUJFLEN.mjs';
|
|
50
|
+
import './chunk-GH4WQ22V.mjs';
|
|
51
|
+
import './chunk-3OH67G7R.mjs';
|
|
36
52
|
import './chunk-IPN7S4KX.mjs';
|
|
37
53
|
import './chunk-KAKQ74LS.mjs';
|
|
38
54
|
import './chunk-7GXJUJ24.mjs';
|
|
39
55
|
import './chunk-Q2UL2TPC.mjs';
|
|
40
|
-
import './chunk-
|
|
56
|
+
import './chunk-LC3FDWTX.mjs';
|
|
57
|
+
import './chunk-JUKYYXSP.mjs';
|
|
58
|
+
import './chunk-4KRC2APY.mjs';
|
|
59
|
+
import './chunk-FQBFZAWG.mjs';
|
|
60
|
+
import './chunk-WQRN64Q6.mjs';
|
|
61
|
+
import './chunk-GES7U2PM.mjs';
|
|
62
|
+
import './chunk-I54T6CQP.mjs';
|
|
63
|
+
import './chunk-YEDIDCR7.mjs';
|
|
41
64
|
import './chunk-X5CV2E2B.mjs';
|
|
42
65
|
import { listenForSyncChanges } from './chunk-Y4WPNHMC.mjs';
|
|
43
|
-
import './chunk-
|
|
66
|
+
import './chunk-RZWWB2XR.mjs';
|
|
44
67
|
import './chunk-TGP5M5R7.mjs';
|
|
68
|
+
import './chunk-4BYWRYPM.mjs';
|
|
69
|
+
import './chunk-4UMZ7KQL.mjs';
|
|
45
70
|
import './chunk-U2BKYEC7.mjs';
|
|
46
71
|
import './chunk-QHPYS427.mjs';
|
|
47
72
|
import { startIdleHeapCleanup } from './chunk-QYRNLLLI.mjs';
|
|
48
|
-
import './chunk-
|
|
73
|
+
import './chunk-HNVVEQP7.mjs';
|
|
49
74
|
import './chunk-ZXNQEW43.mjs';
|
|
75
|
+
import './chunk-L5ORED7V.mjs';
|
|
50
76
|
import './chunk-KOKM4PQN.mjs';
|
|
51
|
-
import './chunk-
|
|
77
|
+
import './chunk-Q7G3BV3Y.mjs';
|
|
52
78
|
import './chunk-BTPGQC6Z.mjs';
|
|
53
79
|
import './chunk-LQG5G2LY.mjs';
|
|
54
|
-
import './chunk-RFBLQLLZ.mjs';
|
|
55
|
-
import './chunk-OKX2BBNW.mjs';
|
|
56
|
-
import './chunk-JUKYYXSP.mjs';
|
|
57
|
-
import './chunk-VMXSVVXG.mjs';
|
|
58
|
-
import './chunk-Z3TNWCI5.mjs';
|
|
59
|
-
import './chunk-FQBFZAWG.mjs';
|
|
60
|
-
import './chunk-ZIFJXCKA.mjs';
|
|
61
|
-
import './chunk-4UMZ7KQL.mjs';
|
|
62
80
|
import './chunk-ZXX5GZEX.mjs';
|
|
63
|
-
import './chunk-
|
|
64
|
-
import './chunk-
|
|
65
|
-
import './chunk-L5ORED7V.mjs';
|
|
66
|
-
import './chunk-3Y3J4V2R.mjs';
|
|
81
|
+
import './chunk-RFBLQLLZ.mjs';
|
|
82
|
+
import './chunk-3C7MTCCI.mjs';
|
|
67
83
|
import './chunk-U476IXKQ.mjs';
|
|
68
|
-
import { NarsilError, ErrorCodes, ServerErrorCodes, isNarsilError } from './chunk-
|
|
69
|
-
export { ClientErrorCodes, ErrorCodes, NarsilError, ServerErrorCodes, isNarsilError } from './chunk-
|
|
84
|
+
import { NarsilError, ErrorCodes, ServerErrorCodes, isNarsilError } from './chunk-MP7ABPTD.mjs';
|
|
85
|
+
export { ClientErrorCodes, ErrorCodes, NarsilError, ServerErrorCodes, isNarsilError } from './chunk-MP7ABPTD.mjs';
|
|
70
86
|
import './chunk-R6A773WK.mjs';
|
|
71
87
|
import { compareCodePoints } from './chunk-YTJCGKM4.mjs';
|
|
72
88
|
import { randomUUID } from 'crypto';
|
|
@@ -557,6 +573,10 @@ function createFeedHub(source, options = {}) {
|
|
|
557
573
|
}
|
|
558
574
|
};
|
|
559
575
|
}
|
|
576
|
+
function snapshotHistoryOf(raw) {
|
|
577
|
+
if (raw === null || raw === "false") return false;
|
|
578
|
+
return raw === "true" ? true : null;
|
|
579
|
+
}
|
|
560
580
|
function createAdminHandlers(deps) {
|
|
561
581
|
const { engine, tasks, limits } = deps;
|
|
562
582
|
async function checkpoint(ctx) {
|
|
@@ -568,8 +588,15 @@ function createAdminHandlers(deps) {
|
|
|
568
588
|
}
|
|
569
589
|
}
|
|
570
590
|
async function snapshot(ctx) {
|
|
591
|
+
const queryHistory = snapshotHistoryOf(ctx.query.get("queryHistory"));
|
|
592
|
+
if (queryHistory === null) {
|
|
593
|
+
badRequest(ctx.res, 'Query parameter "queryHistory" accepts only true or false', {
|
|
594
|
+
value: ctx.query.get("queryHistory")
|
|
595
|
+
});
|
|
596
|
+
return;
|
|
597
|
+
}
|
|
571
598
|
try {
|
|
572
|
-
const archive = await engine.snapshot(ctx.params[0]);
|
|
599
|
+
const archive = await engine.snapshot(ctx.params[0], queryHistory ? { queryHistory } : void 0);
|
|
573
600
|
if (ctx.abort.aborted) {
|
|
574
601
|
await archive.cancel();
|
|
575
602
|
return;
|
|
@@ -945,12 +972,17 @@ function createBackupHandlers(deps) {
|
|
|
945
972
|
badRequest(ctx.res, 'The body must carry the backup name as a string in "backup"', { indexName });
|
|
946
973
|
return;
|
|
947
974
|
}
|
|
975
|
+
if (body.queryHistory !== void 0 && typeof body.queryHistory !== "boolean") {
|
|
976
|
+
badRequest(ctx.res, 'The body accepts only true or false in "queryHistory"', { indexName });
|
|
977
|
+
return;
|
|
978
|
+
}
|
|
948
979
|
const backupName = validateBackupName(body.backup);
|
|
980
|
+
const queryHistory = body.queryHistory === true;
|
|
949
981
|
const record = await deps.tasks.start(
|
|
950
982
|
"backup",
|
|
951
983
|
indexName,
|
|
952
984
|
async (context) => {
|
|
953
|
-
await cluster.createBackup(indexName, backupName, stepsOf(context));
|
|
985
|
+
await cluster.createBackup(indexName, backupName, { ...stepsOf(context), queryHistory });
|
|
954
986
|
},
|
|
955
987
|
void 0,
|
|
956
988
|
backupName
|
|
@@ -1640,6 +1672,196 @@ function createMetricsHandler(deps) {
|
|
|
1640
1672
|
};
|
|
1641
1673
|
}
|
|
1642
1674
|
|
|
1675
|
+
// src/server/handlers/query-suggestions.ts
|
|
1676
|
+
var PREVIEW_LIMIT_PATTERN = /^\d{1,7}$/;
|
|
1677
|
+
function readObject(ctx) {
|
|
1678
|
+
const body = parseJson(ctx);
|
|
1679
|
+
if (body === void 0) return void 0;
|
|
1680
|
+
if (!isRecord(body)) {
|
|
1681
|
+
badRequest(ctx.res, "The body must be a JSON object");
|
|
1682
|
+
return void 0;
|
|
1683
|
+
}
|
|
1684
|
+
return body;
|
|
1685
|
+
}
|
|
1686
|
+
function readQuery(ctx, body) {
|
|
1687
|
+
if (typeof body.query === "string") return body.query;
|
|
1688
|
+
badRequest(ctx.res, 'The body must carry the phrase as a string in "query"');
|
|
1689
|
+
return void 0;
|
|
1690
|
+
}
|
|
1691
|
+
function isStringList(value) {
|
|
1692
|
+
return Array.isArray(value) && value.every((entry) => typeof entry === "string");
|
|
1693
|
+
}
|
|
1694
|
+
function isIdentity(value) {
|
|
1695
|
+
return isRecord(value) && typeof value.person === "string" && typeof value.group === "string";
|
|
1696
|
+
}
|
|
1697
|
+
function previewLimitOf(raw) {
|
|
1698
|
+
if (raw === null) return void 0;
|
|
1699
|
+
return PREVIEW_LIMIT_PATTERN.test(raw) ? Number(raw) : null;
|
|
1700
|
+
}
|
|
1701
|
+
async function identityOf(options, ctx) {
|
|
1702
|
+
if (ctx.hookContext === null) return void 0;
|
|
1703
|
+
try {
|
|
1704
|
+
const identity = await options.identify(ctx.hookContext);
|
|
1705
|
+
if (identity === null) return null;
|
|
1706
|
+
return isIdentity(identity) ? { person: identity.person, group: identity.group } : void 0;
|
|
1707
|
+
} catch {
|
|
1708
|
+
return void 0;
|
|
1709
|
+
}
|
|
1710
|
+
}
|
|
1711
|
+
function noIdentify(indexName) {
|
|
1712
|
+
return new NarsilError(
|
|
1713
|
+
ErrorCodes.QUERY_SUGGESTIONS_NOT_ENABLED,
|
|
1714
|
+
"This server has no identify function for popular query suggestions, so it counts no search",
|
|
1715
|
+
{ indexName }
|
|
1716
|
+
);
|
|
1717
|
+
}
|
|
1718
|
+
function createQuerySuggestionHandlers(deps, options) {
|
|
1719
|
+
const { engine, tasks } = deps;
|
|
1720
|
+
const suggestions = () => querySuggestions(engine);
|
|
1721
|
+
async function update(ctx) {
|
|
1722
|
+
const body = parseJson(ctx);
|
|
1723
|
+
if (body === void 0) return;
|
|
1724
|
+
try {
|
|
1725
|
+
await suggestions().updateSetting(ctx.params[0], body);
|
|
1726
|
+
respondJson(ctx, { ok: true });
|
|
1727
|
+
} catch (err) {
|
|
1728
|
+
respondError(ctx, err);
|
|
1729
|
+
}
|
|
1730
|
+
}
|
|
1731
|
+
async function status(ctx) {
|
|
1732
|
+
try {
|
|
1733
|
+
respondJson(ctx, await suggestions().status(ctx.params[0]));
|
|
1734
|
+
} catch (err) {
|
|
1735
|
+
respondError(ctx, err);
|
|
1736
|
+
}
|
|
1737
|
+
}
|
|
1738
|
+
async function record(ctx) {
|
|
1739
|
+
const body = readObject(ctx);
|
|
1740
|
+
if (body === void 0) return;
|
|
1741
|
+
const extra = Object.keys(body).filter((key) => key !== "query");
|
|
1742
|
+
if (extra.length > 0) {
|
|
1743
|
+
badRequest(ctx.res, 'The body carries the search in "query" alone, because the server identifies the person', {
|
|
1744
|
+
fields: extra
|
|
1745
|
+
});
|
|
1746
|
+
return;
|
|
1747
|
+
}
|
|
1748
|
+
const query = readQuery(ctx, body);
|
|
1749
|
+
if (query === void 0) return;
|
|
1750
|
+
const indexName = ctx.params[0];
|
|
1751
|
+
try {
|
|
1752
|
+
if (options === void 0) throw noIdentify(indexName);
|
|
1753
|
+
const identity = await identityOf(options, ctx);
|
|
1754
|
+
if (identity === void 0) {
|
|
1755
|
+
if (!ctx.abort.aborted) {
|
|
1756
|
+
sendError(ctx.res, 500, ServerErrorCodes.HOOK_ERROR, "The identify function of query suggestions failed");
|
|
1757
|
+
}
|
|
1758
|
+
return;
|
|
1759
|
+
}
|
|
1760
|
+
if (identity === null) {
|
|
1761
|
+
respondJson(ctx, { recorded: false, outcome: "unidentified" });
|
|
1762
|
+
return;
|
|
1763
|
+
}
|
|
1764
|
+
respondJson(ctx, await suggestions().recordQuery(indexName, { query, ...identity }));
|
|
1765
|
+
} catch (err) {
|
|
1766
|
+
respondError(ctx, err);
|
|
1767
|
+
}
|
|
1768
|
+
}
|
|
1769
|
+
async function build(ctx) {
|
|
1770
|
+
const indexName = ctx.params[0];
|
|
1771
|
+
try {
|
|
1772
|
+
const operations = suggestions();
|
|
1773
|
+
const current = await operations.status(indexName);
|
|
1774
|
+
if (current.setting?.enabled !== true) {
|
|
1775
|
+
throw new NarsilError(
|
|
1776
|
+
ErrorCodes.QUERY_SUGGESTIONS_NOT_ENABLED,
|
|
1777
|
+
`Index "${indexName}" has popular query suggestions off`,
|
|
1778
|
+
{ indexName }
|
|
1779
|
+
);
|
|
1780
|
+
}
|
|
1781
|
+
const task = await tasks.start("querySuggestionsBuild", indexName, async (context) => {
|
|
1782
|
+
const finished = await operations.build(indexName);
|
|
1783
|
+
context.reportBuild(finished);
|
|
1784
|
+
if (finished.status === "failed") {
|
|
1785
|
+
throw new NarsilError(
|
|
1786
|
+
finished.errorCode ?? ErrorCodes.WORKER_ACTION_FAILED,
|
|
1787
|
+
"The build of popular query suggestions failed",
|
|
1788
|
+
{ indexName, buildId: finished.buildId }
|
|
1789
|
+
);
|
|
1790
|
+
}
|
|
1791
|
+
});
|
|
1792
|
+
respondJson(ctx, task, 202);
|
|
1793
|
+
} catch (err) {
|
|
1794
|
+
respondError(ctx, err);
|
|
1795
|
+
}
|
|
1796
|
+
}
|
|
1797
|
+
async function preview(ctx) {
|
|
1798
|
+
const limit = previewLimitOf(ctx.query.get("limit"));
|
|
1799
|
+
if (limit === null) {
|
|
1800
|
+
badRequest(ctx.res, 'Query parameter "limit" must be a whole number', { value: ctx.query.get("limit") });
|
|
1801
|
+
return;
|
|
1802
|
+
}
|
|
1803
|
+
try {
|
|
1804
|
+
respondJson(ctx, await suggestions().preview(ctx.params[0], limit));
|
|
1805
|
+
} catch (err) {
|
|
1806
|
+
respondError(ctx, err);
|
|
1807
|
+
}
|
|
1808
|
+
}
|
|
1809
|
+
async function readBans(ctx) {
|
|
1810
|
+
try {
|
|
1811
|
+
respondJson(ctx, { bans: await suggestions().bans(ctx.params[0]) });
|
|
1812
|
+
} catch (err) {
|
|
1813
|
+
respondError(ctx, err);
|
|
1814
|
+
}
|
|
1815
|
+
}
|
|
1816
|
+
async function replaceBans(ctx) {
|
|
1817
|
+
const body = readObject(ctx);
|
|
1818
|
+
if (body === void 0) return;
|
|
1819
|
+
if (!isStringList(body.bans)) {
|
|
1820
|
+
badRequest(ctx.res, 'The body must carry the ban list as an array of strings in "bans"');
|
|
1821
|
+
return;
|
|
1822
|
+
}
|
|
1823
|
+
try {
|
|
1824
|
+
respondJson(ctx, { bans: await suggestions().updateBans(ctx.params[0], body.bans) });
|
|
1825
|
+
} catch (err) {
|
|
1826
|
+
respondError(ctx, err);
|
|
1827
|
+
}
|
|
1828
|
+
}
|
|
1829
|
+
async function remove(ctx) {
|
|
1830
|
+
const body = readObject(ctx);
|
|
1831
|
+
if (body === void 0) return;
|
|
1832
|
+
const query = readQuery(ctx, body);
|
|
1833
|
+
if (query === void 0) return;
|
|
1834
|
+
try {
|
|
1835
|
+
const held = await suggestions().removeQuery(ctx.params[0], query);
|
|
1836
|
+
respondJson(ctx, { suggestionIndexes: held });
|
|
1837
|
+
} catch (err) {
|
|
1838
|
+
respondError(ctx, err);
|
|
1839
|
+
}
|
|
1840
|
+
}
|
|
1841
|
+
async function manual(ctx) {
|
|
1842
|
+
const body = readObject(ctx);
|
|
1843
|
+
if (body === void 0) return;
|
|
1844
|
+
const query = readQuery(ctx, body);
|
|
1845
|
+
if (query === void 0) return;
|
|
1846
|
+
const { group, count } = body;
|
|
1847
|
+
if (typeof group !== "string" || count !== void 0 && typeof count !== "number") {
|
|
1848
|
+
badRequest(ctx.res, 'The body must carry the group as a string in "group", and any count as a number in "count"');
|
|
1849
|
+
return;
|
|
1850
|
+
}
|
|
1851
|
+
try {
|
|
1852
|
+
const name = await suggestions().addSuggestion(ctx.params[0], {
|
|
1853
|
+
group,
|
|
1854
|
+
query,
|
|
1855
|
+
...count === void 0 ? {} : { count }
|
|
1856
|
+
});
|
|
1857
|
+
respondJson(ctx, { indexName: name });
|
|
1858
|
+
} catch (err) {
|
|
1859
|
+
respondError(ctx, err);
|
|
1860
|
+
}
|
|
1861
|
+
}
|
|
1862
|
+
return { update, status, record, build, preview, readBans, replaceBans, remove, manual };
|
|
1863
|
+
}
|
|
1864
|
+
|
|
1643
1865
|
// src/server/handlers/search.ts
|
|
1644
1866
|
function createSearchHandlers(deps) {
|
|
1645
1867
|
const { engine, limits, allowRegex } = deps;
|
|
@@ -1762,6 +1984,16 @@ function assertServerLimits(limits, engineRerankWindow) {
|
|
|
1762
1984
|
assertFraction("maxBodyBytesInFlightFraction", limits.maxBodyBytesInFlightFraction);
|
|
1763
1985
|
assertRerankWindowCap(limits.maxRerankWindow, engineRerankWindow);
|
|
1764
1986
|
}
|
|
1987
|
+
function assertQuerySuggestionsOptions(options) {
|
|
1988
|
+
if (options === void 0) return;
|
|
1989
|
+
const identify = typeof options === "object" && options !== null ? Reflect.get(options, "identify") : void 0;
|
|
1990
|
+
if (typeof identify === "function") return;
|
|
1991
|
+
throw new NarsilError(
|
|
1992
|
+
ErrorCodes.CONFIG_INVALID,
|
|
1993
|
+
"querySuggestions must carry an identify function that returns the person and the group of a request",
|
|
1994
|
+
{ field: "querySuggestions.identify" }
|
|
1995
|
+
);
|
|
1996
|
+
}
|
|
1765
1997
|
function assertAllowRegex(allowRegex) {
|
|
1766
1998
|
if (allowRegex === void 0 || typeof allowRegex === "boolean") return;
|
|
1767
1999
|
throw new NarsilError(
|
|
@@ -2544,6 +2776,9 @@ var TaskRegistry = class {
|
|
|
2544
2776
|
reportSteps: (steps) => this.reportProgress(task, { steps }),
|
|
2545
2777
|
reportResult: (result) => {
|
|
2546
2778
|
task.record = { ...task.record, result };
|
|
2779
|
+
},
|
|
2780
|
+
reportBuild: (build) => {
|
|
2781
|
+
task.record = { ...task.record, build };
|
|
2547
2782
|
}
|
|
2548
2783
|
};
|
|
2549
2784
|
let settled;
|
|
@@ -2619,6 +2854,7 @@ function mainThreadHandlers(deps, syncServing) {
|
|
|
2619
2854
|
const version = createVersionHandler(deps);
|
|
2620
2855
|
const capabilities = createCapabilitiesHandler();
|
|
2621
2856
|
const syncSetting = createSyncSettingHandlers(deps.engine);
|
|
2857
|
+
const suggestions = createQuerySuggestionHandlers(deps, deps.querySuggestions);
|
|
2622
2858
|
return {
|
|
2623
2859
|
livez: health.livez,
|
|
2624
2860
|
readyz: health.readyz,
|
|
@@ -2676,7 +2912,16 @@ function mainThreadHandlers(deps, syncServing) {
|
|
|
2676
2912
|
exportDocuments: documentExport.exportDocuments,
|
|
2677
2913
|
importExport: documentExport.importExport,
|
|
2678
2914
|
updateSync: syncSetting.updateSync,
|
|
2679
|
-
syncSnapshot: createSyncSnapshotHandler(syncServing)
|
|
2915
|
+
syncSnapshot: createSyncSnapshotHandler(syncServing),
|
|
2916
|
+
updateQuerySuggestions: suggestions.update,
|
|
2917
|
+
querySuggestionsStatus: suggestions.status,
|
|
2918
|
+
recordQuery: suggestions.record,
|
|
2919
|
+
buildQuerySuggestions: suggestions.build,
|
|
2920
|
+
previewQuerySuggestions: suggestions.preview,
|
|
2921
|
+
readQueryBans: suggestions.readBans,
|
|
2922
|
+
replaceQueryBans: suggestions.replaceBans,
|
|
2923
|
+
removeQuery: suggestions.remove,
|
|
2924
|
+
addManualSuggestion: suggestions.manual
|
|
2680
2925
|
};
|
|
2681
2926
|
}
|
|
2682
2927
|
var NarsilHttpServer = class {
|
|
@@ -2698,6 +2943,7 @@ var NarsilHttpServer = class {
|
|
|
2698
2943
|
const engineRerankWindow = rerankWindowCapOf(engine);
|
|
2699
2944
|
assertServerLimits(options.limits, engineRerankWindow);
|
|
2700
2945
|
assertAllowRegex(options.allowRegex);
|
|
2946
|
+
assertQuerySuggestionsOptions(options.querySuggestions);
|
|
2701
2947
|
this.sync = resolveSyncOptions(options.sync);
|
|
2702
2948
|
this.host = options.host ?? "127.0.0.1";
|
|
2703
2949
|
this.port = options.port ?? 9876;
|
|
@@ -2721,7 +2967,8 @@ var NarsilHttpServer = class {
|
|
|
2721
2967
|
isReady: () => this.ready,
|
|
2722
2968
|
build: resolveBuild(options.build),
|
|
2723
2969
|
cluster: options.cluster,
|
|
2724
|
-
requestThreadCount: () => this.requestThreadCount
|
|
2970
|
+
requestThreadCount: () => this.requestThreadCount,
|
|
2971
|
+
querySuggestions: options.querySuggestions
|
|
2725
2972
|
};
|
|
2726
2973
|
}
|
|
2727
2974
|
async listen() {
|