@delali/narsil 0.3.1-next.154 → 0.3.1-next.156
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NOTICE +45 -0
- 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-5BQOQ4BF.mjs} +35 -28
- package/dist/{react-native/chunks/analysis-change-entry-TNLUC6IZ.mjs → analysis-change-entry-TXX6JSMX.mjs} +1 -1
- package/dist/archive-history-E4R73RWD.mjs +29 -0
- package/dist/browser/{analysis-change-IXWPXXJJ.mjs → analysis-change-435CUEPZ.mjs} +32 -12
- package/dist/{analysis-change-entry-KYGSXW4K.mjs → browser/analysis-change-entry-HZXKPPGV.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-J433A7P3.mjs → chunk-2CFI5VVV.mjs} +5 -5
- package/dist/{react-native/chunks/chunk-3XKMRNRE.mjs → browser/chunk-2TI4SSUP.mjs} +27 -10
- package/dist/browser/chunk-3SSRJMFN.mjs +100 -0
- package/dist/browser/{chunk-2SHAKW2Z.mjs → chunk-3V7DNNZL.mjs} +515 -733
- package/dist/browser/{chunk-C4KS2QNF.mjs → chunk-4NGKC4H4.mjs} +9 -9
- package/dist/browser/{chunk-XRV72TJD.mjs → chunk-6LWDPLTB.mjs} +2 -2
- package/dist/browser/chunk-7IGKGWSQ.mjs +79 -0
- package/dist/browser/{chunk-VCOYGVP7.mjs → chunk-7U3WVJUP.mjs} +3 -3
- package/dist/browser/chunk-ATEBYXP6.mjs +10 -0
- package/dist/browser/chunk-BHFQATSC.mjs +432 -0
- package/dist/browser/chunk-CRE3G7F3.mjs +1007 -0
- package/dist/browser/{chunk-QXTPSX2H.mjs → chunk-EA63E3D2.mjs} +7 -7
- package/dist/{react-native/chunks/chunk-DCKMICOB.mjs → browser/chunk-EXQZGUQH.mjs} +1 -1
- package/dist/browser/{chunk-ML6HY7T7.mjs → chunk-G64Q6OJF.mjs} +1 -1
- package/dist/browser/chunk-GPPOG6PT.mjs +9 -0
- package/dist/browser/{chunk-EUNBNLKM.mjs → chunk-IZXVW2ZJ.mjs} +5 -5
- package/dist/browser/{chunk-G7LUMBSG.mjs → chunk-K4Q6KX3R.mjs} +30 -20
- package/dist/browser/{chunk-H6QFBMVE.mjs → chunk-KZWSX6BH.mjs} +3 -3
- package/dist/browser/chunk-M3MQE2X7.mjs +151 -0
- package/dist/browser/chunk-MGI4BCXC.mjs +63 -0
- package/dist/browser/chunk-MOG4OVDK.mjs +51 -0
- package/dist/browser/{chunk-W5X2UFWQ.mjs → chunk-NLWTBAGB.mjs} +12 -3
- package/dist/browser/{chunk-AYY6PIKL.mjs → chunk-NQAME3RK.mjs} +2 -2
- package/dist/browser/{chunk-7MEYN7V6.mjs → chunk-NXQG7DRA.mjs} +29 -14
- package/dist/browser/chunk-OEDCEZXJ.mjs +92 -0
- package/dist/{chunk-KUZKUONM.mjs → browser/chunk-SRMZXJSL.mjs} +1 -0
- package/dist/browser/chunk-SSTPBZZX.mjs +1106 -0
- package/dist/browser/{chunk-7TTWXUH6.mjs → chunk-STOWQFT3.mjs} +3 -2
- package/dist/browser/{chunk-26A5JFT2.mjs → chunk-TK63WFXK.mjs} +2 -1
- package/dist/browser/{chunk-SJB6VIZG.mjs → chunk-U3JOQGWX.mjs} +1 -1
- package/dist/browser/{chunk-AJ4HHOVT.mjs → chunk-U4YDIBUT.mjs} +4 -4
- package/dist/browser/{chunk-2FX6ROWR.mjs → chunk-VLJQW4J6.mjs} +2986 -2986
- package/dist/{react-native/chunks/chunk-3O57C2ZO.mjs → browser/chunk-WI4MR75E.mjs} +2 -2
- package/dist/browser/{chunk-3U3QR5YP.mjs → chunk-WN464PTL.mjs} +2 -2
- package/dist/browser/{chunk-U2E3HMYW.mjs → chunk-XAWNZ4G2.mjs} +11 -11
- package/dist/browser/{cold-module-VTUGDYNY.mjs → cold-module-2EHCIV4K.mjs} +20 -18
- package/dist/browser/durability-config-TIYKW6XX.mjs +89 -0
- package/dist/browser/{durability-wiring-GL4A7KDV.mjs → durability-wiring-A7BVG2DW.mjs} +50 -153
- package/dist/browser/engine-hooks-E4UD67JD.mjs +17 -0
- package/dist/browser/geo-index-HHWGMNIS.mjs +1386 -0
- package/dist/browser/import-DXYB6756.mjs +19 -0
- package/dist/browser/{methods-LMUTS7OI.mjs → methods-KTQCSIN4.mjs} +3 -3
- package/dist/browser/{module-M4JNBV6V.mjs → module-NIYMEA5R.mjs} +16 -14
- package/dist/browser/{module-EC3FYW7N.mjs → module-TCT66FWA.mjs} +10 -9
- package/dist/browser/operations-OJ3BXS55.mjs +5 -0
- package/dist/browser/{phrase-module-NPYUVX75.mjs → phrase-module-HAT3TLZN.mjs} +2 -2
- package/dist/browser/{pool-WCGDZHJP.mjs → pool-3JLET5RO.mjs} +1 -1
- package/dist/browser/restore-hooks-YPN4ZFCY.mjs +114 -0
- package/dist/browser/restore-queue-G3RQGL3Y.mjs +55 -0
- package/dist/browser/{retention-6QMRS5VK.mjs → retention-ZWVMNC3Q.mjs} +18 -15
- package/dist/browser/{runtime-3EW2AGB6.mjs → runtime-OTAGEFQW.mjs} +1 -1
- package/dist/browser/{snapshot-DN3CRVUQ.mjs → snapshot-VEQNIE6C.mjs} +71 -36
- package/dist/browser/start-BM442C6R.mjs +25 -0
- package/dist/browser/{write-WAWAFGKQ.mjs → write-2EVMZWDE.mjs} +16 -14
- package/dist/{capabilities-B3Brs1Rc.d.ts → capabilities-Da4ywVVl.d.ts} +35 -3
- package/dist/{chunk-K4B7OH65.mjs → chunk-25KDNIZZ.mjs} +2 -2
- package/dist/{chunk-O43Z4MS6.mjs → chunk-2NE7VCYE.mjs} +2 -2
- package/dist/chunk-2UV4QBHW.mjs +1092 -0
- package/dist/{chunk-3Y3J4V2R.mjs → chunk-3C7MTCCI.mjs} +1 -1
- package/dist/{chunk-TRISKD4Q.mjs → chunk-3HYC4JRF.mjs} +2 -2
- package/dist/{chunk-HVYICDY3.mjs → chunk-3OH67G7R.mjs} +1 -1
- package/dist/{chunk-PFKM7VNZ.mjs → chunk-46KY2PJD.mjs} +30 -11
- package/dist/{chunk-IJU7LL7D.mjs → chunk-4KKXNJM6.mjs} +5 -5
- package/dist/{chunk-IQ4R2I6N.mjs → chunk-5FLRXF73.mjs} +5 -1
- package/dist/{chunk-BPSKLCS7.mjs → chunk-5VV4R6P7.mjs} +3017 -3017
- package/dist/chunk-5YNRKI2C.mjs +81 -0
- package/dist/chunk-6HTGOXIK.mjs +875 -0
- package/dist/{chunk-7HCZWC7B.mjs → chunk-6I6AYAXS.mjs} +50 -8
- package/dist/{chunk-C6ASEFZI.mjs → chunk-6OEGXLBX.mjs} +1 -1
- package/dist/{chunk-DVWYODEB.mjs → chunk-6RC4K46J.mjs} +2 -2
- package/dist/chunk-7GFE3PEY.mjs +40 -0
- package/dist/{chunk-QKZHLADX.mjs → chunk-7LXHHCXZ.mjs} +28 -19
- package/dist/{chunk-JUKYYXSP.mjs → chunk-7V5IUP2T.mjs} +1 -31
- package/dist/{react-native/chunks/chunk-7GWPJDOA.mjs → chunk-A4L7YTKX.mjs} +53 -90
- package/dist/{chunk-Z3TNWCI5.mjs → chunk-BU4SAIC4.mjs} +3 -3
- package/dist/chunk-BWZ3P4MU.mjs +20 -0
- package/dist/{chunk-OKX2BBNW.mjs → chunk-CITFCZKF.mjs} +5 -4
- package/dist/{chunk-4HWZV5MK.mjs → chunk-CSLGFPFQ.mjs} +5 -5
- package/dist/chunk-DP5C7YFQ.mjs +543 -0
- package/dist/{chunk-RVKFI3A2.mjs → chunk-DWEPMFJE.mjs} +11 -8
- package/dist/{chunk-LSM2YTKM.mjs → chunk-EFBDHH5P.mjs} +87 -144
- package/dist/{chunk-NZMAXR2S.mjs → chunk-FAKFUDZZ.mjs} +121 -11
- package/dist/chunk-FB6463IN.mjs +1499 -0
- package/dist/{chunk-REL7LFLR.mjs → chunk-FCJ553HS.mjs} +3 -3
- package/dist/{chunk-MMEMEUOO.mjs → chunk-FJKKCV4D.mjs} +2 -2
- package/dist/{chunk-K7KLL263.mjs → chunk-FNGAM5B7.mjs} +14 -13
- package/dist/{chunk-DMQPFLGI.mjs → chunk-FRBFVQFN.mjs} +6 -5
- package/dist/{chunk-IBNLW3AV.mjs → chunk-FYOVBEMM.mjs} +20 -6
- package/dist/chunk-G6HRSGOU.mjs +74 -0
- package/dist/{chunk-USR7FQRZ.mjs → chunk-GH4WQ22V.mjs} +2 -2
- package/dist/chunk-GQPTDQCL.mjs +54 -0
- package/dist/{chunk-VREK3MYG.mjs → chunk-HFPMMRQT.mjs} +3 -3
- package/dist/{chunk-MLHNSAPK.mjs → chunk-HHBUCIUY.mjs} +3 -3
- package/dist/{chunk-YROWNOMH.mjs → chunk-HJJI72X7.mjs} +1 -1
- package/dist/{chunk-ECX4SGX6.mjs → chunk-I2KPOLOZ.mjs} +9 -9
- package/dist/{chunk-TV2L3BN7.mjs → chunk-I53G4JAU.mjs} +266 -265
- package/dist/{chunk-3A5KI24C.mjs → chunk-I54T6CQP.mjs} +1 -1
- package/dist/{chunk-NTZOXVUZ.mjs → chunk-I5B7RXU7.mjs} +93 -24
- package/dist/{chunk-YBJDOA2T.mjs → chunk-INJYO3BU.mjs} +1 -1
- package/dist/{react-native/chunks/chunk-KWRW5U65.mjs → chunk-J4IJTTEX.mjs} +1 -1
- package/dist/{chunk-X6NSJYQ3.mjs → chunk-JDJBQLRO.mjs} +13 -13
- package/dist/{chunk-MMBEANB2.mjs → chunk-JWRUUCWD.mjs} +3 -3
- package/dist/{chunk-AO2FAYIZ.mjs → chunk-K4ZIGL2O.mjs} +1 -1
- package/dist/{chunk-JFNKIBDT.mjs → chunk-K5QFDYST.mjs} +2 -2
- package/dist/{chunk-C73JLU4E.mjs → chunk-KF4EXSM4.mjs} +2 -2
- package/dist/{chunk-WCBA2LVZ.mjs → chunk-KHKIRS5D.mjs} +1 -1
- package/dist/{chunk-7QUGDVFC.mjs → chunk-KJ3RTZDJ.mjs} +1 -1
- package/dist/{chunk-HVKXNBFL.mjs → chunk-KKQC526K.mjs} +20 -12
- package/dist/chunk-KP7TYHWT.mjs +92 -0
- package/dist/{chunk-VMXSVVXG.mjs → chunk-L6V6BST3.mjs} +9 -22
- 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-5KGYQT6W.mjs → chunk-MQOJIO5B.mjs} +26 -9
- package/dist/{chunk-Q3TCTQCC.mjs → chunk-NF4DT3IH.mjs} +1 -1
- package/dist/{chunk-3OFU3NJT.mjs → chunk-OIJ64LGT.mjs} +1 -1
- package/dist/chunk-ORN5BLL7.mjs +11 -0
- package/dist/{chunk-HWEDFLB7.mjs → chunk-P5ZI2P2W.mjs} +126 -1701
- package/dist/{chunk-466PYR4P.mjs → chunk-PWC4VB3Q.mjs} +2 -2
- package/dist/{chunk-B7S6YEBP.mjs → chunk-QJVOLKU6.mjs} +12 -3
- package/dist/{chunk-KCUIFVVW.mjs → chunk-QOW2JPUI.mjs} +9 -9
- package/dist/chunk-RDXO6JST.mjs +63 -0
- package/dist/chunk-RLOES5SX.mjs +31 -0
- package/dist/{chunk-YPUEV6ZC.mjs → chunk-RVGRFOGN.mjs} +1 -1
- package/dist/{chunk-JCLTESFN.mjs → chunk-RZWWB2XR.mjs} +1 -1
- package/dist/chunk-S5LN746F.mjs +10 -0
- package/dist/chunk-SA5LOGO3.mjs +470 -0
- package/dist/chunk-SQJWAIF4.mjs +12 -0
- package/dist/{chunk-YTJCGKM4.mjs → chunk-TBC3XUL2.mjs} +29 -6
- package/dist/chunk-TDIK6NTV.mjs +10 -0
- package/dist/chunk-TGS5UXBE.mjs +216 -0
- package/dist/{chunk-CP5RRPJR.mjs → chunk-TQXHPFWT.mjs} +1 -1
- package/dist/{chunk-7NTMUDC5.mjs → chunk-TZ3355VS.mjs} +5 -5
- package/dist/{chunk-Q7MS6P2J.mjs → chunk-TZTRKM33.mjs} +2 -2
- package/dist/{chunk-4UMZ7KQL.mjs → chunk-U55XJEIG.mjs} +2 -1
- package/dist/{chunk-S2N75OTN.mjs → chunk-UHICS3JI.mjs} +1 -1
- package/dist/{chunk-5FUOVJKG.mjs → chunk-VTTRFF2C.mjs} +32 -19
- package/dist/{chunk-62G63NMH.mjs → chunk-WX4LAO6M.mjs} +4 -4
- package/dist/{chunk-LTUGDMV4.mjs → chunk-WZ7YV54N.mjs} +1 -1
- package/dist/chunk-XAXKV65G.mjs +72 -0
- package/dist/chunk-XXHN7J46.mjs +101 -0
- package/dist/{chunk-PGVPE7GJ.mjs → chunk-YEKL4JBK.mjs} +1 -1
- package/dist/chunk-YTWZVGCB.mjs +382 -0
- package/dist/chunk-Z2KAFCRT.mjs +30 -0
- package/dist/{chunk-LKUE5GXS.mjs → chunk-ZKP7G7TV.mjs} +2 -2
- 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-6MO2XJF2.mjs} +45 -39
- 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-FTMYY3TI.mjs +34 -0
- package/dist/distribution/coordinator/etcd.d.ts +2 -2
- package/dist/distribution/coordinator/etcd.mjs +3 -3
- package/dist/distribution/coordinator/in-memory.d.ts +2 -2
- package/dist/distribution/coordinator/in-memory.mjs +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 +6799 -5939
- package/dist/durability-config-GE4U7MCZ.mjs +89 -0
- package/dist/{durability-wiring-RHLXDIVF.mjs → durability-wiring-VIF5MOSY.mjs} +82 -179
- package/dist/embeddings/openai.mjs +2 -2
- package/dist/{sync-uXR7MmM7.d.ts → engine-CFxPYqEk.d.ts} +702 -2
- package/dist/engine-hooks-EGUGNZYE.mjs +54 -0
- package/dist/geo-index-MRH5JMIR.mjs +1387 -0
- package/dist/import-XKDPJQDP.mjs +56 -0
- package/dist/{index-nRqDM6uS.d.ts → index-C4AmUnl1.d.ts} +1 -1
- package/dist/index.browser.mjs +9 -7
- package/dist/index.d.ts +134 -9
- package/dist/index.mjs +33 -26
- package/dist/index.react-native.mjs +20 -17
- package/dist/invalidation/filesystem.mjs +2 -2
- package/dist/{long-query-thread-EMYTGSJP.mjs → long-query-thread-YA4IAYSY.mjs} +34 -28
- package/dist/{methods-ABM5ELBR.mjs → methods-7IOINERF.mjs} +3 -3
- package/dist/{module-MG7JMV2U.mjs → module-FQ4JWNQJ.mjs} +41 -34
- package/dist/{module-3OMJZUFT.mjs → module-N55W4Q5C.mjs} +14 -14
- package/dist/operations-G5EP6JPX.mjs +5 -0
- package/dist/{paged-partition-archive-UOLHOEZJ.mjs → paged-partition-archive-PXW5XAYU.mjs} +48 -38
- package/dist/partial-words.mjs +11 -9
- package/dist/pattern.mjs +6 -5
- package/dist/persistence/durability/checkpoint-worker.d.ts +8 -1
- package/dist/persistence/durability/checkpoint-worker.mjs +44 -35
- package/dist/{phrase-module-O3MDRQXP.mjs → phrase-module-XW5MKWP5.mjs} +4 -3
- 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 +88 -0
- package/dist/query-suggestions-CBYkrQ5T.d.ts +311 -0
- package/dist/query-suggestions.browser.mjs +247 -0
- package/dist/query-suggestions.d.ts +20 -0
- package/dist/query-suggestions.mjs +69 -0
- package/dist/react-native/chunks/{analysis-change-EAYO3Y6Q.mjs → analysis-change-LT5QBQ3H.mjs} +43 -22
- package/dist/{browser/analysis-change-entry-FCSHFQSS.mjs → react-native/chunks/analysis-change-entry-SCVWK6OU.mjs} +1 -1
- package/dist/react-native/chunks/archive-history-MJKUQLSU.mjs +29 -0
- package/dist/{chunk-ZIFJXCKA.mjs → react-native/chunks/chunk-2PRHILX3.mjs} +54 -20
- package/dist/react-native/chunks/{chunk-VQSKZ3EZ.mjs → chunk-3JWDECAZ.mjs} +8 -8
- package/dist/{chunk-R6A773WK.mjs → react-native/chunks/chunk-3WI35N75.mjs} +1 -1
- 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/react-native/chunks/{chunk-UWDNZDWK.mjs → chunk-4JYO3JD2.mjs} +6 -6
- 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-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-DIYDOIM4.mjs +10 -0
- package/dist/react-native/chunks/{chunk-O32RB3BL.mjs → chunk-DNXOMPAQ.mjs} +4 -4
- package/dist/react-native/chunks/{chunk-YBEW6YTR.mjs → chunk-DVDX4SDR.mjs} +2 -2
- package/dist/react-native/chunks/chunk-DXRSEWA2.mjs +12 -0
- package/dist/{browser/chunk-MYITLCHT.mjs → react-native/chunks/chunk-DZ7H7D2C.mjs} +1 -0
- package/dist/react-native/chunks/{chunk-PPEPTUVV.mjs → chunk-EJ33LCHV.mjs} +29 -6
- package/dist/react-native/chunks/{chunk-RYMDHGL4.mjs → chunk-ENLMYKSX.mjs} +3045 -3075
- package/dist/react-native/chunks/chunk-FHPW7P2O.mjs +40 -0
- package/dist/react-native/chunks/{chunk-JV6VQY2S.mjs → chunk-FTZHMRD2.mjs} +2 -1
- package/dist/react-native/chunks/{chunk-YHKZSLOC.mjs → chunk-G43IPIDG.mjs} +5 -5
- package/dist/react-native/chunks/{chunk-AUT7PMA4.mjs → chunk-GXX3DQXP.mjs} +8 -22
- package/dist/react-native/chunks/chunk-H3MDVPBO.mjs +151 -0
- package/dist/react-native/chunks/{chunk-DH3TVWWK.mjs → chunk-IYNT75CE.mjs} +12 -3
- package/dist/react-native/chunks/chunk-KV46CT4D.mjs +1007 -0
- package/dist/{browser/chunk-ZPTA75ZC.mjs → react-native/chunks/chunk-LZSLNSUN.mjs} +1 -1
- package/dist/react-native/chunks/{chunk-63YSZOXB.mjs → chunk-MIP4SOR6.mjs} +1480 -826
- package/dist/react-native/chunks/{chunk-ZBSWRSBG.mjs → chunk-MJDQU5MW.mjs} +1 -1
- package/dist/react-native/chunks/{chunk-GFYFQLJD.mjs → chunk-MUWD2H2S.mjs} +2 -2
- package/dist/react-native/chunks/{chunk-IOY2SM2P.mjs → chunk-MVXELMJX.mjs} +1 -1
- package/dist/{browser/chunk-TTD27VXX.mjs → react-native/chunks/chunk-NB3LP33V.mjs} +27 -10
- package/dist/react-native/chunks/{chunk-I5PGWQJF.mjs → chunk-PDRWWPKV.mjs} +33 -24
- package/dist/react-native/chunks/chunk-PJHAB5ZY.mjs +79 -0
- package/dist/react-native/chunks/{chunk-2CGSQM4O.mjs → chunk-POPDAGH6.mjs} +13 -13
- package/dist/react-native/chunks/{chunk-NP7DD4G5.mjs → chunk-QUKQNI3H.mjs} +5 -5
- package/dist/react-native/chunks/{chunk-EH5CFV6Z.mjs → chunk-RDWG33MM.mjs} +2 -2
- package/dist/react-native/chunks/{chunk-JX2RIAXH.mjs → chunk-SK2PWYDH.mjs} +5 -5
- package/dist/react-native/chunks/{chunk-ZYDKJXQJ.mjs → chunk-SUPXRTMD.mjs} +1 -1
- package/dist/react-native/chunks/chunk-TP6KCKER.mjs +63 -0
- package/dist/react-native/chunks/{chunk-JPAJWO6D.mjs → chunk-U4KSKA4Z.mjs} +1 -1
- package/dist/react-native/chunks/chunk-UQ4OAXKU.mjs +1106 -0
- package/dist/react-native/chunks/{chunk-VVFYOADG.mjs → chunk-VWUDIOT6.mjs} +6 -6
- package/dist/{browser/chunk-SIR3LMTV.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-NCJS3WIY.mjs → chunk-YZW4CHM6.mjs} +51 -12
- package/dist/react-native/chunks/chunk-ZLWVW734.mjs +100 -0
- package/dist/react-native/chunks/chunk-ZXZFN7FI.mjs +432 -0
- package/dist/react-native/chunks/chunk-ZZT7CEN7.mjs +92 -0
- package/dist/react-native/chunks/{cold-module-TJL6AFAD.mjs → cold-module-KVZYUGRY.mjs} +31 -28
- package/dist/react-native/chunks/durability-config-QXVZEO7T.mjs +89 -0
- package/dist/react-native/chunks/{durability-wiring-RRDYJLLM.mjs → durability-wiring-34OYO32E.mjs} +60 -162
- package/dist/react-native/chunks/engine-hooks-M7JV46NH.mjs +30 -0
- package/dist/react-native/chunks/geo-index-PX3BIHAH.mjs +1387 -0
- package/dist/react-native/chunks/gzip.react-native-HLEPDKZ3.mjs +3 -0
- package/dist/react-native/chunks/import-H6AQREWI.mjs +32 -0
- package/dist/react-native/chunks/{methods-X6F36SJE.mjs → methods-6W5U4C3H.mjs} +3 -3
- package/dist/react-native/chunks/module-LBZPGOWH.mjs +36 -0
- package/dist/react-native/chunks/{module-S4DKSWMF.mjs → module-TTEVPRCW.mjs} +14 -13
- package/dist/react-native/chunks/operations-GNRMD6EX.mjs +5 -0
- package/dist/react-native/chunks/{phrase-module-JZ37TB7N.mjs → phrase-module-QK22HSQ2.mjs} +2 -2
- package/dist/react-native/chunks/{pool-RTGXJXPU.mjs → pool-JR3NJCAF.mjs} +1 -1
- package/dist/react-native/chunks/restore-hooks-IBGIY3DR.mjs +127 -0
- package/dist/react-native/chunks/restore-queue-ZZX54AH7.mjs +55 -0
- package/dist/react-native/chunks/{retention-PPCTP2VY.mjs → retention-EW4TTDFB.mjs} +29 -25
- package/dist/react-native/chunks/{runtime-KUATOLYB.mjs → runtime-R5E3TB3J.mjs} +1 -1
- package/dist/react-native/chunks/{snapshot-ZBIEOZTZ.mjs → snapshot-REYVIN3X.mjs} +80 -44
- package/dist/react-native/chunks/start-BQK6KN3R.mjs +38 -0
- package/dist/react-native/chunks/{write-2W4FTX7J.mjs → write-FQAYCZF5.mjs} +27 -24
- package/dist/react-native/partial-words.mjs +11 -9
- package/dist/react-native/pattern.mjs +4 -4
- package/dist/react-native/query-suggestions.mjs +260 -0
- package/dist/react-native/sync.mjs +78 -15
- package/dist/react-native/synonyms.mjs +95 -27
- 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-CDERDEF4.mjs +153 -0
- package/dist/restore-queue-7NNSTROA.mjs +55 -0
- package/dist/retention-QSVBBNRM.mjs +66 -0
- 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 +303 -50
- package/dist/{snapshot-NFX2EYN2.mjs → snapshot-RH4NSKIZ.mjs} +98 -61
- package/dist/start-MCKCOGIW.mjs +66 -0
- package/dist/sync/filesystem.d.ts +4 -4
- package/dist/sync/filesystem.mjs +6 -6
- 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 +78 -16
- package/dist/synonyms.mjs +9 -8
- package/dist/{tasks-BShx8pdK.d.ts → tasks-qrJojgST.d.ts} +13 -5
- package/dist/thread-O4SBJJJS.mjs +50 -0
- 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 +8 -8
- package/dist/workers/entry.mjs +19 -8
- package/dist/{write-FGB62BHQ.mjs → write-3FK7NG3Y.mjs} +40 -33
- package/openapi.json +798 -7
- package/package.json +32 -8
- package/dist/browser/import-YI5GNB4H.mjs +0 -17
- package/dist/browser/operations-WVYLF72Q.mjs +0 -5
- package/dist/browser/restore-queue-TYIGDL5L.mjs +0 -41
- package/dist/chunk-37IVJLP6.mjs +0 -44
- package/dist/chunk-DJHHF2L5.mjs +0 -17
- package/dist/direct-executor-FI5GJHWX.mjs +0 -29
- package/dist/engine-DYu-e0oR.d.ts +0 -674
- package/dist/import-SRBNC6TE.mjs +0 -49
- 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/module-QT5HZAY4.mjs +0 -33
- 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/retention-55WA7GPU.mjs +0 -58
- package/dist/thread-P2G2FWM2.mjs +0 -44
package/dist/server.d.ts
CHANGED
|
@@ -1,18 +1,84 @@
|
|
|
1
|
-
import { G as GroupResult, Q as QueryParams,
|
|
2
|
-
export { C as ClientErrorCode, a as ClientErrorCodes, E as ErrorCode, b as ErrorCodes, N as NarsilError, c as NarsilErrorCode, S as ServerErrorCode, d as ServerErrorCodes, i as isNarsilError } from './
|
|
3
|
-
import { E as ErrorEnvelope, c as ServerOptions, N as NarsilServer } from './capabilities-
|
|
4
|
-
export { A as ASYNC_IMPORT_CAPABILITY, B as BM25_TUNING_CAPABILITY, C as CHANGE_ANALYSIS_CAPABILITY, d as CorsOptions, D as DOCUMENT_EXPORT_CAPABILITY, I as INDEX_LIFECYCLE_CAPABILITY, O as OnRequestHook, R as REBUILD_ANALYSIS_CAPABILITY, e as RequestContext, f as RequestDenial, g as RequestGrant, S as SERVER_CAPABILITIES, a as SYNONYMS_CAPABILITY, h as ServerLimits, i as ServerSyncOptions, T as TASK_CANCEL_CAPABILITY, b as TASK_FILTER_CAPABILITY } from './capabilities-
|
|
5
|
-
import { N as
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import {
|
|
9
|
-
import { S as SchemaDefinition, P as PartitionConfig, V as VectorIndexConfig, B as BM25Params, F as FieldType } from './schema-
|
|
1
|
+
import { G as GroupResult, Q as QueryParams, r as GroupConfig, h as QueryResult, f as SyncSetting, L as ListParams, m as SuggestParams, p as IndexStats, l as ListResult, o as PreflightResult, n as SuggestResult, g as Narsil } from './engine-CFxPYqEk.js';
|
|
2
|
+
export { C as ClientErrorCode, a as ClientErrorCodes, E as ErrorCode, b as ErrorCodes, N as NarsilError, c as NarsilErrorCode, S as ServerErrorCode, d as ServerErrorCodes, i as isNarsilError } from './engine-CFxPYqEk.js';
|
|
3
|
+
import { E as ErrorEnvelope, c as ServerOptions, N as NarsilServer } from './capabilities-Da4ywVVl.js';
|
|
4
|
+
export { A as ASYNC_IMPORT_CAPABILITY, B as BM25_TUNING_CAPABILITY, C as CHANGE_ANALYSIS_CAPABILITY, d as CorsOptions, D as DOCUMENT_EXPORT_CAPABILITY, I as INDEX_LIFECYCLE_CAPABILITY, O as OnRequestHook, Q as QueryIdentity, R as REBUILD_ANALYSIS_CAPABILITY, e as RequestContext, f as RequestDenial, g as RequestGrant, S as SERVER_CAPABILITIES, a as SYNONYMS_CAPABILITY, h as ServerLimits, i as ServerQuerySuggestionsOptions, j as ServerSyncOptions, T as TASK_CANCEL_CAPABILITY, b as TASK_FILTER_CAPABILITY } from './capabilities-Da4ywVVl.js';
|
|
5
|
+
import { k as CreateIndexRequest, H as HttpIndexConfig, l as BatchBody, a as ChangeAnalysisBody, m as CreateBackupBody, D as DocumentBody, n as InsertBody, o as MultiGetBody, p as RebalanceBody, q as ReplicationFactorBody, R as RestoreBackupBody, d as TaskListQuery, V as VectorFieldBody, S as SynonymSetBody, B as BackupListResponse, r as BatchResponse, C as CapabilitiesResponse, s as ClusterAllocationResponse, t as ClusterTopologyResponse, u as DocumentCountResponse, v as DocumentExistsResponse, w as DocumentIdResponse, x as DocumentPutResponse, y as DocumentRemovedResponse, z as DocumentResponse, c as ImportResult, A as IndexClearedResponse, F as IndexCreatedResponse, G as IndexDroppedResponse, J as IndexListResponse, K as IndexPartitionsResponse, L as IndexStateResponse, N as LivenessResponse, M as MemoryStatsResponse, O as MultiGetResponse, P as OkResponse, Q as ReadinessResponse, U as ReplicationFactorResponse, T as TaskListPage, f as TaskRecord, W as VectorMaintenanceResponse, X as VersionResponse, e as TaskProgress, h as TaskStepProgress, j as TaskStore } from './tasks-qrJojgST.js';
|
|
6
|
+
export { Y as BatchFailure, Z as ClusterMemberReport, _ as ClusterNodeReport, b as CreateIndexEmbedding, E as ErrorDetail, I as ImportError, $ as PartitionAllocationReport, g as TaskStatus, i as TaskType } from './tasks-qrJojgST.js';
|
|
7
|
+
import { d as QuerySuggestionsSetting, M as ManualQuerySuggestion, e as QuerySuggestionsStatus, f as RecordQueryResult, c as QuerySuggestionsPreview, a as QuerySuggestionsBuild } from './query-suggestions-CBYkrQ5T.js';
|
|
8
|
+
import { i as ClusterHealth } from './config-DMwffLKn.js';
|
|
9
|
+
import { S as SchemaDefinition, P as PartitionConfig, V as VectorIndexConfig, B as BM25Params, F as FieldType } from './schema-Jwt928nJ.js';
|
|
10
10
|
import './adapters-pljAqmrC.js';
|
|
11
11
|
import './synonyms-CpOAHPa-.js';
|
|
12
|
-
import './index-
|
|
13
|
-
import './config-
|
|
12
|
+
import './index-C4AmUnl1.js';
|
|
13
|
+
import './config-CoSig5Ox.js';
|
|
14
14
|
import './types-DvncmvuQ.js';
|
|
15
15
|
|
|
16
|
+
/**
|
|
17
|
+
* The body of `POST /indexes/{name}/query-suggestions/record`. The server
|
|
18
|
+
* takes the person and the group from its `identify` function, so the body
|
|
19
|
+
* carries the search alone.
|
|
20
|
+
*
|
|
21
|
+
* @public
|
|
22
|
+
*/
|
|
23
|
+
interface RecordQueryBody {
|
|
24
|
+
/** The search that the person followed with a click. */
|
|
25
|
+
query: string;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* The query string of `GET /indexes/{name}/query-suggestions/preview`.
|
|
29
|
+
*
|
|
30
|
+
* @public
|
|
31
|
+
*/
|
|
32
|
+
interface QuerySuggestionsPreviewQuery {
|
|
33
|
+
/** The most phrases to list, from 1 to 1,000, and 100 by default. */
|
|
34
|
+
limit?: number;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* The body of `GET` and of `PUT /indexes/{name}/query-suggestions/bans`.
|
|
38
|
+
*
|
|
39
|
+
* @public
|
|
40
|
+
*/
|
|
41
|
+
interface QueryBansBody {
|
|
42
|
+
/** The banned phrases, at most 1,000, which the engine normalises. */
|
|
43
|
+
bans: string[];
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* The body of `POST /indexes/{name}/query-suggestions/remove`.
|
|
47
|
+
*
|
|
48
|
+
* @public
|
|
49
|
+
*/
|
|
50
|
+
interface RemoveQueryBody {
|
|
51
|
+
/** The phrase to ban and to remove from every suggestions index of the index. */
|
|
52
|
+
query: string;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* The answer of `POST /indexes/{name}/query-suggestions/remove`.
|
|
56
|
+
*
|
|
57
|
+
* @public
|
|
58
|
+
*/
|
|
59
|
+
interface RemoveQueryResponse {
|
|
60
|
+
/** The number of suggestions indexes that held the phrase. */
|
|
61
|
+
suggestionIndexes: number;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* The answer of `POST /indexes/{name}/query-suggestions/manual`.
|
|
65
|
+
*
|
|
66
|
+
* @public
|
|
67
|
+
*/
|
|
68
|
+
interface ManualSuggestionResponse {
|
|
69
|
+
/** The suggestions index that holds the phrase. */
|
|
70
|
+
indexName: string;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* The query string of `GET /indexes/{name}/snapshot`.
|
|
74
|
+
*
|
|
75
|
+
* @public
|
|
76
|
+
*/
|
|
77
|
+
interface SnapshotQuery {
|
|
78
|
+
/** Under `true`, the archive also holds the index's search history. */
|
|
79
|
+
queryHistory?: 'true' | 'false';
|
|
80
|
+
}
|
|
81
|
+
|
|
16
82
|
/**
|
|
17
83
|
* Everything `POST /indexes/{name}/search` accepts, which is {@link QueryParams}
|
|
18
84
|
* with a `group` that holds no reducer, because a function cannot cross JSON.
|
|
@@ -132,6 +198,30 @@ interface HttpWireTypes {
|
|
|
132
198
|
VectorFieldBody: VectorFieldBody;
|
|
133
199
|
/** The body of `GET` and of `POST /indexes/{name}/synonyms`. */
|
|
134
200
|
SynonymSetBody: SynonymSetBody;
|
|
201
|
+
/** The body of `PUT /indexes/{name}/query-suggestions`. */
|
|
202
|
+
QuerySuggestionsSetting: QuerySuggestionsSetting;
|
|
203
|
+
/** The body of `POST /indexes/{name}/query-suggestions/record`. */
|
|
204
|
+
RecordQueryBody: RecordQueryBody;
|
|
205
|
+
/** The query string of `GET /indexes/{name}/query-suggestions/preview`. */
|
|
206
|
+
QuerySuggestionsPreviewQuery: QuerySuggestionsPreviewQuery;
|
|
207
|
+
/** The body of `GET` and of `PUT /indexes/{name}/query-suggestions/bans`. */
|
|
208
|
+
QueryBansBody: QueryBansBody;
|
|
209
|
+
/** The body of `POST /indexes/{name}/query-suggestions/remove`. */
|
|
210
|
+
RemoveQueryBody: RemoveQueryBody;
|
|
211
|
+
/** The body of `POST /indexes/{name}/query-suggestions/manual`. */
|
|
212
|
+
ManualQuerySuggestion: ManualQuerySuggestion;
|
|
213
|
+
/** The query string of `GET /indexes/{name}/snapshot`. */
|
|
214
|
+
SnapshotQuery: SnapshotQuery;
|
|
215
|
+
/** The body of `GET /indexes/{name}/query-suggestions`. */
|
|
216
|
+
QuerySuggestionsStatus: QuerySuggestionsStatus;
|
|
217
|
+
/** The body of `POST /indexes/{name}/query-suggestions/record`. */
|
|
218
|
+
RecordQueryResult: RecordQueryResult;
|
|
219
|
+
/** The body of `GET /indexes/{name}/query-suggestions/preview`. */
|
|
220
|
+
QuerySuggestionsPreview: QuerySuggestionsPreview;
|
|
221
|
+
/** The body of `POST /indexes/{name}/query-suggestions/remove`. */
|
|
222
|
+
RemoveQueryResponse: RemoveQueryResponse;
|
|
223
|
+
/** The body of `POST /indexes/{name}/query-suggestions/manual`. */
|
|
224
|
+
ManualSuggestionResponse: ManualSuggestionResponse;
|
|
135
225
|
/** The body of `GET /backups`. */
|
|
136
226
|
BackupListResponse: BackupListResponse;
|
|
137
227
|
/** The body of `POST /indexes/{name}/documents/_batch`. */
|
|
@@ -237,6 +327,12 @@ interface TaskContext {
|
|
|
237
327
|
* @param result - What the work produced.
|
|
238
328
|
*/
|
|
239
329
|
reportResult(result: ImportResult): void;
|
|
330
|
+
/**
|
|
331
|
+
* Records the build that a `querySuggestionsBuild` task ran, which the finished task then carries.
|
|
332
|
+
*
|
|
333
|
+
* @param build - The build once it ends.
|
|
334
|
+
*/
|
|
335
|
+
reportBuild(build: QuerySuggestionsBuild): void;
|
|
240
336
|
}
|
|
241
337
|
/**
|
|
242
338
|
* The work one task runs.
|
|
@@ -329,4 +425,4 @@ declare class InMemoryTaskStore implements TaskStore {
|
|
|
329
425
|
private prune;
|
|
330
426
|
}
|
|
331
427
|
|
|
332
|
-
export { BackupListResponse, BatchBody, BatchResponse, CapabilitiesResponse, ClusterAllocationResponse, ClusterTopologyResponse, CreateBackupBody, CreateIndexRequest, DocumentBody, DocumentCountResponse, DocumentExistsResponse, DocumentIdResponse, DocumentPutResponse, DocumentRemovedResponse, DocumentResponse, ErrorEnvelope, type HttpCreateIndexBody, type HttpGroupResult, type HttpIndexBody, HttpIndexConfig, type HttpQueryParams, type HttpQueryResult, type HttpWireTypeName, type HttpWireTypes, type ImportDocumentsQuery, ImportResult, InMemoryTaskStore, IndexClearedResponse, IndexCreatedResponse, IndexDroppedResponse, IndexListResponse, IndexPartitionsResponse, IndexStateResponse, InsertBody, LivenessResponse, MemoryStatsResponse, MultiGetBody, MultiGetResponse, NarsilServer, OkResponse, ReadinessResponse, RebalanceBody, type RemoveDocumentQuery, ReplicationFactorBody, ReplicationFactorResponse, RestoreBackupBody, ServerOptions, SynonymSetBody, type TaskContext, TaskListPage, TaskListQuery, type TaskOperation, TaskProgress, TaskRecord, TaskStepProgress, TaskStore, VectorFieldBody, VectorMaintenanceResponse, VersionResponse, createServer, httpStatusForNarsilError };
|
|
428
|
+
export { BackupListResponse, BatchBody, BatchResponse, CapabilitiesResponse, ClusterAllocationResponse, ClusterTopologyResponse, CreateBackupBody, CreateIndexRequest, DocumentBody, DocumentCountResponse, DocumentExistsResponse, DocumentIdResponse, DocumentPutResponse, DocumentRemovedResponse, DocumentResponse, ErrorEnvelope, type HttpCreateIndexBody, type HttpGroupResult, type HttpIndexBody, HttpIndexConfig, type HttpQueryParams, type HttpQueryResult, type HttpWireTypeName, type HttpWireTypes, type ImportDocumentsQuery, ImportResult, InMemoryTaskStore, IndexClearedResponse, IndexCreatedResponse, IndexDroppedResponse, IndexListResponse, IndexPartitionsResponse, IndexStateResponse, InsertBody, LivenessResponse, type ManualSuggestionResponse, MemoryStatsResponse, MultiGetBody, MultiGetResponse, NarsilServer, OkResponse, type QueryBansBody, type QuerySuggestionsPreviewQuery, ReadinessResponse, RebalanceBody, type RecordQueryBody, type RemoveDocumentQuery, type RemoveQueryBody, type RemoveQueryResponse, ReplicationFactorBody, ReplicationFactorResponse, RestoreBackupBody, ServerOptions, type SnapshotQuery, SynonymSetBody, type TaskContext, TaskListPage, TaskListQuery, type TaskOperation, TaskProgress, TaskRecord, TaskStepProgress, TaskStore, VectorFieldBody, VectorMaintenanceResponse, VersionResponse, createServer, httpStatusForNarsilError };
|
package/dist/server.mjs
CHANGED
|
@@ -1,74 +1,96 @@
|
|
|
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-ZKP7G7TV.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-FAKFUDZZ.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-FAKFUDZZ.mjs';
|
|
4
|
+
import { rerankOnHost } from './chunk-KHKIRS5D.mjs';
|
|
5
|
+
import { startSyncRetentionSweep, publishedSyncSnapshot, publishedArchiveLayout } from './chunk-I2KPOLOZ.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-B7S6YEBP.mjs';
|
|
14
|
-
import './chunk-V6EUBAIT.mjs';
|
|
8
|
+
import { syncServingSourceOf, writeBlockLookupOf, indexReadsOf, validateBackupName, readRestorePlacement } from './chunk-FYOVBEMM.mjs';
|
|
9
|
+
import './chunk-25KDNIZZ.mjs';
|
|
10
|
+
import { isRecord, validateIndexName } from './chunk-6I6AYAXS.mjs';
|
|
11
|
+
import './chunk-INJYO3BU.mjs';
|
|
12
|
+
import { estimatedArchiveBytes } from './chunk-TZTRKM33.mjs';
|
|
15
13
|
import './chunk-ZYAY26KG.mjs';
|
|
16
|
-
import './chunk-
|
|
17
|
-
import './chunk-
|
|
14
|
+
import './chunk-QJVOLKU6.mjs';
|
|
15
|
+
import './chunk-MQOJIO5B.mjs';
|
|
16
|
+
import './chunk-4KKXNJM6.mjs';
|
|
17
|
+
import './chunk-K4ZIGL2O.mjs';
|
|
18
18
|
import './chunk-BUMREPLU.mjs';
|
|
19
|
-
import './chunk-AO2FAYIZ.mjs';
|
|
20
|
-
import './chunk-DJHHF2L5.mjs';
|
|
21
19
|
import './chunk-37CD3OKS.mjs';
|
|
22
20
|
import './chunk-JDDXV6UF.mjs';
|
|
23
|
-
import { manifestFileRefs } from './chunk-
|
|
21
|
+
import { manifestFileRefs } from './chunk-NF4DT3IH.mjs';
|
|
24
22
|
import './chunk-QDZJM7NI.mjs';
|
|
25
|
-
import {
|
|
26
|
-
import
|
|
23
|
+
import { querySuggestions } from './chunk-BWZ3P4MU.mjs';
|
|
24
|
+
import './chunk-Z2KAFCRT.mjs';
|
|
25
|
+
import './chunk-RDXO6JST.mjs';
|
|
26
|
+
import './chunk-S5LN746F.mjs';
|
|
27
|
+
import './chunk-TGS5UXBE.mjs';
|
|
28
|
+
import './chunk-2UV4QBHW.mjs';
|
|
29
|
+
import './chunk-LNGE7SLY.mjs';
|
|
30
|
+
import './chunk-DP5C7YFQ.mjs';
|
|
31
|
+
import './chunk-KP7TYHWT.mjs';
|
|
32
|
+
import './chunk-XXHN7J46.mjs';
|
|
33
|
+
import './chunk-YTWZVGCB.mjs';
|
|
34
|
+
import './chunk-V6EUBAIT.mjs';
|
|
35
|
+
import './chunk-BEZH7VEH.mjs';
|
|
36
|
+
import './chunk-XAXKV65G.mjs';
|
|
37
|
+
import './chunk-SA5LOGO3.mjs';
|
|
38
|
+
import './chunk-GQPTDQCL.mjs';
|
|
39
|
+
import './chunk-5YNRKI2C.mjs';
|
|
40
|
+
import { rerankWindowCapOf, engineCoreOf, rulesOfStoredSynonyms, providedDocId, resolveVectorText } from './chunk-EFBDHH5P.mjs';
|
|
41
|
+
import { readMemoryFigures } from './chunk-I53G4JAU.mjs';
|
|
27
42
|
import { MAX_RERANK_WINDOW } from './chunk-HJSN7UYG.mjs';
|
|
28
|
-
import { detectRuntime } from './chunk-
|
|
43
|
+
import { detectRuntime } from './chunk-LHKOSI2J.mjs';
|
|
29
44
|
import './chunk-XIHUI4KB.mjs';
|
|
30
45
|
import './chunk-3MXV3VHR.mjs';
|
|
31
46
|
import './chunk-EEBCDP36.mjs';
|
|
32
|
-
import './chunk-
|
|
33
|
-
import './chunk-
|
|
34
|
-
import './chunk-
|
|
35
|
-
import './chunk-
|
|
47
|
+
import './chunk-VTTRFF2C.mjs';
|
|
48
|
+
import './chunk-P5ZI2P2W.mjs';
|
|
49
|
+
import './chunk-GH4WQ22V.mjs';
|
|
50
|
+
import './chunk-3OH67G7R.mjs';
|
|
36
51
|
import './chunk-IPN7S4KX.mjs';
|
|
37
52
|
import './chunk-KAKQ74LS.mjs';
|
|
38
53
|
import './chunk-7GXJUJ24.mjs';
|
|
39
54
|
import './chunk-Q2UL2TPC.mjs';
|
|
40
|
-
import './chunk-
|
|
41
|
-
import './chunk-
|
|
55
|
+
import './chunk-CITFCZKF.mjs';
|
|
56
|
+
import './chunk-RLOES5SX.mjs';
|
|
57
|
+
import './chunk-L6V6BST3.mjs';
|
|
58
|
+
import './chunk-SQJWAIF4.mjs';
|
|
59
|
+
import './chunk-FQBFZAWG.mjs';
|
|
60
|
+
import './chunk-BU4SAIC4.mjs';
|
|
61
|
+
import './chunk-GES7U2PM.mjs';
|
|
62
|
+
import './chunk-I54T6CQP.mjs';
|
|
63
|
+
import './chunk-I5B7RXU7.mjs';
|
|
42
64
|
import { listenForSyncChanges } from './chunk-Y4WPNHMC.mjs';
|
|
43
|
-
import './chunk-
|
|
65
|
+
import './chunk-RZWWB2XR.mjs';
|
|
44
66
|
import './chunk-TGP5M5R7.mjs';
|
|
67
|
+
import './chunk-G6HRSGOU.mjs';
|
|
45
68
|
import './chunk-U2BKYEC7.mjs';
|
|
69
|
+
import './chunk-6HTGOXIK.mjs';
|
|
46
70
|
import './chunk-QHPYS427.mjs';
|
|
47
71
|
import { startIdleHeapCleanup } from './chunk-QYRNLLLI.mjs';
|
|
48
|
-
import './chunk-
|
|
72
|
+
import './chunk-TDIK6NTV.mjs';
|
|
73
|
+
import './chunk-FB6463IN.mjs';
|
|
74
|
+
import './chunk-7GFE3PEY.mjs';
|
|
49
75
|
import './chunk-ZXNQEW43.mjs';
|
|
76
|
+
import './chunk-7V5IUP2T.mjs';
|
|
77
|
+
import './chunk-L5ORED7V.mjs';
|
|
78
|
+
import './chunk-X5CV2E2B.mjs';
|
|
79
|
+
import './chunk-A4L7YTKX.mjs';
|
|
80
|
+
import './chunk-U55XJEIG.mjs';
|
|
50
81
|
import './chunk-KOKM4PQN.mjs';
|
|
51
|
-
import './chunk-
|
|
82
|
+
import './chunk-ORN5BLL7.mjs';
|
|
52
83
|
import './chunk-BTPGQC6Z.mjs';
|
|
53
84
|
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
85
|
import './chunk-ZXX5GZEX.mjs';
|
|
63
|
-
import './chunk-
|
|
64
|
-
import './chunk-
|
|
65
|
-
import './chunk-
|
|
66
|
-
import './chunk-3Y3J4V2R.mjs';
|
|
86
|
+
import './chunk-RFBLQLLZ.mjs';
|
|
87
|
+
import './chunk-KKQC526K.mjs';
|
|
88
|
+
import './chunk-3C7MTCCI.mjs';
|
|
67
89
|
import './chunk-U476IXKQ.mjs';
|
|
68
|
-
import { NarsilError, ErrorCodes, ServerErrorCodes, isNarsilError } from './chunk-
|
|
69
|
-
export { ClientErrorCodes, ErrorCodes, NarsilError, ServerErrorCodes, isNarsilError } from './chunk-
|
|
70
|
-
import './chunk-
|
|
71
|
-
import { compareCodePoints } from './chunk-
|
|
90
|
+
import { NarsilError, ErrorCodes, ServerErrorCodes, isNarsilError } from './chunk-MP7ABPTD.mjs';
|
|
91
|
+
export { ClientErrorCodes, ErrorCodes, NarsilError, ServerErrorCodes, isNarsilError } from './chunk-MP7ABPTD.mjs';
|
|
92
|
+
import './chunk-J4IJTTEX.mjs';
|
|
93
|
+
import { compareCodePoints } from './chunk-TBC3XUL2.mjs';
|
|
72
94
|
import { randomUUID } from 'crypto';
|
|
73
95
|
import { encode, decode } from '@msgpack/msgpack';
|
|
74
96
|
import { createReadStream } from 'fs';
|
|
@@ -557,6 +579,10 @@ function createFeedHub(source, options = {}) {
|
|
|
557
579
|
}
|
|
558
580
|
};
|
|
559
581
|
}
|
|
582
|
+
function snapshotHistoryOf(raw) {
|
|
583
|
+
if (raw === null || raw === "false") return false;
|
|
584
|
+
return raw === "true" ? true : null;
|
|
585
|
+
}
|
|
560
586
|
function createAdminHandlers(deps) {
|
|
561
587
|
const { engine, tasks, limits } = deps;
|
|
562
588
|
async function checkpoint(ctx) {
|
|
@@ -568,8 +594,15 @@ function createAdminHandlers(deps) {
|
|
|
568
594
|
}
|
|
569
595
|
}
|
|
570
596
|
async function snapshot(ctx) {
|
|
597
|
+
const queryHistory = snapshotHistoryOf(ctx.query.get("queryHistory"));
|
|
598
|
+
if (queryHistory === null) {
|
|
599
|
+
badRequest(ctx.res, 'Query parameter "queryHistory" accepts only true or false', {
|
|
600
|
+
value: ctx.query.get("queryHistory")
|
|
601
|
+
});
|
|
602
|
+
return;
|
|
603
|
+
}
|
|
571
604
|
try {
|
|
572
|
-
const archive = await engine.snapshot(ctx.params[0]);
|
|
605
|
+
const archive = await engine.snapshot(ctx.params[0], queryHistory ? { queryHistory } : void 0);
|
|
573
606
|
if (ctx.abort.aborted) {
|
|
574
607
|
await archive.cancel();
|
|
575
608
|
return;
|
|
@@ -945,12 +978,17 @@ function createBackupHandlers(deps) {
|
|
|
945
978
|
badRequest(ctx.res, 'The body must carry the backup name as a string in "backup"', { indexName });
|
|
946
979
|
return;
|
|
947
980
|
}
|
|
981
|
+
if (body.queryHistory !== void 0 && typeof body.queryHistory !== "boolean") {
|
|
982
|
+
badRequest(ctx.res, 'The body accepts only true or false in "queryHistory"', { indexName });
|
|
983
|
+
return;
|
|
984
|
+
}
|
|
948
985
|
const backupName = validateBackupName(body.backup);
|
|
986
|
+
const queryHistory = body.queryHistory === true;
|
|
949
987
|
const record = await deps.tasks.start(
|
|
950
988
|
"backup",
|
|
951
989
|
indexName,
|
|
952
990
|
async (context) => {
|
|
953
|
-
await cluster.createBackup(indexName, backupName, stepsOf(context));
|
|
991
|
+
await cluster.createBackup(indexName, backupName, { ...stepsOf(context), queryHistory });
|
|
954
992
|
},
|
|
955
993
|
void 0,
|
|
956
994
|
backupName
|
|
@@ -1640,6 +1678,196 @@ function createMetricsHandler(deps) {
|
|
|
1640
1678
|
};
|
|
1641
1679
|
}
|
|
1642
1680
|
|
|
1681
|
+
// src/server/handlers/query-suggestions.ts
|
|
1682
|
+
var PREVIEW_LIMIT_PATTERN = /^\d{1,7}$/;
|
|
1683
|
+
function readObject(ctx) {
|
|
1684
|
+
const body = parseJson(ctx);
|
|
1685
|
+
if (body === void 0) return void 0;
|
|
1686
|
+
if (!isRecord(body)) {
|
|
1687
|
+
badRequest(ctx.res, "The body must be a JSON object");
|
|
1688
|
+
return void 0;
|
|
1689
|
+
}
|
|
1690
|
+
return body;
|
|
1691
|
+
}
|
|
1692
|
+
function readQuery(ctx, body) {
|
|
1693
|
+
if (typeof body.query === "string") return body.query;
|
|
1694
|
+
badRequest(ctx.res, 'The body must carry the phrase as a string in "query"');
|
|
1695
|
+
return void 0;
|
|
1696
|
+
}
|
|
1697
|
+
function isStringList(value) {
|
|
1698
|
+
return Array.isArray(value) && value.every((entry) => typeof entry === "string");
|
|
1699
|
+
}
|
|
1700
|
+
function isIdentity(value) {
|
|
1701
|
+
return isRecord(value) && typeof value.person === "string" && typeof value.group === "string";
|
|
1702
|
+
}
|
|
1703
|
+
function previewLimitOf(raw) {
|
|
1704
|
+
if (raw === null) return void 0;
|
|
1705
|
+
return PREVIEW_LIMIT_PATTERN.test(raw) ? Number(raw) : null;
|
|
1706
|
+
}
|
|
1707
|
+
async function identityOf(options, ctx) {
|
|
1708
|
+
if (ctx.hookContext === null) return void 0;
|
|
1709
|
+
try {
|
|
1710
|
+
const identity = await options.identify(ctx.hookContext);
|
|
1711
|
+
if (identity === null) return null;
|
|
1712
|
+
return isIdentity(identity) ? { person: identity.person, group: identity.group } : void 0;
|
|
1713
|
+
} catch {
|
|
1714
|
+
return void 0;
|
|
1715
|
+
}
|
|
1716
|
+
}
|
|
1717
|
+
function noIdentify(indexName) {
|
|
1718
|
+
return new NarsilError(
|
|
1719
|
+
ErrorCodes.QUERY_SUGGESTIONS_NOT_ENABLED,
|
|
1720
|
+
"This server has no identify function for popular query suggestions, so it counts no search",
|
|
1721
|
+
{ indexName }
|
|
1722
|
+
);
|
|
1723
|
+
}
|
|
1724
|
+
function createQuerySuggestionHandlers(deps, options) {
|
|
1725
|
+
const { engine, tasks } = deps;
|
|
1726
|
+
const suggestions = () => querySuggestions(engine);
|
|
1727
|
+
async function update(ctx) {
|
|
1728
|
+
const body = parseJson(ctx);
|
|
1729
|
+
if (body === void 0) return;
|
|
1730
|
+
try {
|
|
1731
|
+
await suggestions().updateSetting(ctx.params[0], body);
|
|
1732
|
+
respondJson(ctx, { ok: true });
|
|
1733
|
+
} catch (err) {
|
|
1734
|
+
respondError(ctx, err);
|
|
1735
|
+
}
|
|
1736
|
+
}
|
|
1737
|
+
async function status(ctx) {
|
|
1738
|
+
try {
|
|
1739
|
+
respondJson(ctx, await suggestions().status(ctx.params[0]));
|
|
1740
|
+
} catch (err) {
|
|
1741
|
+
respondError(ctx, err);
|
|
1742
|
+
}
|
|
1743
|
+
}
|
|
1744
|
+
async function record(ctx) {
|
|
1745
|
+
const body = readObject(ctx);
|
|
1746
|
+
if (body === void 0) return;
|
|
1747
|
+
const extra = Object.keys(body).filter((key) => key !== "query");
|
|
1748
|
+
if (extra.length > 0) {
|
|
1749
|
+
badRequest(ctx.res, 'The body carries the search in "query" alone, because the server identifies the person', {
|
|
1750
|
+
fields: extra
|
|
1751
|
+
});
|
|
1752
|
+
return;
|
|
1753
|
+
}
|
|
1754
|
+
const query = readQuery(ctx, body);
|
|
1755
|
+
if (query === void 0) return;
|
|
1756
|
+
const indexName = ctx.params[0];
|
|
1757
|
+
try {
|
|
1758
|
+
if (options === void 0) throw noIdentify(indexName);
|
|
1759
|
+
const identity = await identityOf(options, ctx);
|
|
1760
|
+
if (identity === void 0) {
|
|
1761
|
+
if (!ctx.abort.aborted) {
|
|
1762
|
+
sendError(ctx.res, 500, ServerErrorCodes.HOOK_ERROR, "The identify function of query suggestions failed");
|
|
1763
|
+
}
|
|
1764
|
+
return;
|
|
1765
|
+
}
|
|
1766
|
+
if (identity === null) {
|
|
1767
|
+
respondJson(ctx, { recorded: false, outcome: "unidentified" });
|
|
1768
|
+
return;
|
|
1769
|
+
}
|
|
1770
|
+
respondJson(ctx, await suggestions().recordQuery(indexName, { query, ...identity }));
|
|
1771
|
+
} catch (err) {
|
|
1772
|
+
respondError(ctx, err);
|
|
1773
|
+
}
|
|
1774
|
+
}
|
|
1775
|
+
async function build(ctx) {
|
|
1776
|
+
const indexName = ctx.params[0];
|
|
1777
|
+
try {
|
|
1778
|
+
const operations = suggestions();
|
|
1779
|
+
const current = await operations.status(indexName);
|
|
1780
|
+
if (current.setting?.enabled !== true) {
|
|
1781
|
+
throw new NarsilError(
|
|
1782
|
+
ErrorCodes.QUERY_SUGGESTIONS_NOT_ENABLED,
|
|
1783
|
+
`Index "${indexName}" has popular query suggestions off`,
|
|
1784
|
+
{ indexName }
|
|
1785
|
+
);
|
|
1786
|
+
}
|
|
1787
|
+
const task = await tasks.start("querySuggestionsBuild", indexName, async (context) => {
|
|
1788
|
+
const finished = await operations.build(indexName);
|
|
1789
|
+
context.reportBuild(finished);
|
|
1790
|
+
if (finished.status === "failed") {
|
|
1791
|
+
throw new NarsilError(
|
|
1792
|
+
finished.errorCode ?? ErrorCodes.WORKER_ACTION_FAILED,
|
|
1793
|
+
"The build of popular query suggestions failed",
|
|
1794
|
+
{ indexName, buildId: finished.buildId }
|
|
1795
|
+
);
|
|
1796
|
+
}
|
|
1797
|
+
});
|
|
1798
|
+
respondJson(ctx, task, 202);
|
|
1799
|
+
} catch (err) {
|
|
1800
|
+
respondError(ctx, err);
|
|
1801
|
+
}
|
|
1802
|
+
}
|
|
1803
|
+
async function preview(ctx) {
|
|
1804
|
+
const limit = previewLimitOf(ctx.query.get("limit"));
|
|
1805
|
+
if (limit === null) {
|
|
1806
|
+
badRequest(ctx.res, 'Query parameter "limit" must be a whole number', { value: ctx.query.get("limit") });
|
|
1807
|
+
return;
|
|
1808
|
+
}
|
|
1809
|
+
try {
|
|
1810
|
+
respondJson(ctx, await suggestions().preview(ctx.params[0], limit));
|
|
1811
|
+
} catch (err) {
|
|
1812
|
+
respondError(ctx, err);
|
|
1813
|
+
}
|
|
1814
|
+
}
|
|
1815
|
+
async function readBans(ctx) {
|
|
1816
|
+
try {
|
|
1817
|
+
respondJson(ctx, { bans: await suggestions().bans(ctx.params[0]) });
|
|
1818
|
+
} catch (err) {
|
|
1819
|
+
respondError(ctx, err);
|
|
1820
|
+
}
|
|
1821
|
+
}
|
|
1822
|
+
async function replaceBans(ctx) {
|
|
1823
|
+
const body = readObject(ctx);
|
|
1824
|
+
if (body === void 0) return;
|
|
1825
|
+
if (!isStringList(body.bans)) {
|
|
1826
|
+
badRequest(ctx.res, 'The body must carry the ban list as an array of strings in "bans"');
|
|
1827
|
+
return;
|
|
1828
|
+
}
|
|
1829
|
+
try {
|
|
1830
|
+
respondJson(ctx, { bans: await suggestions().updateBans(ctx.params[0], body.bans) });
|
|
1831
|
+
} catch (err) {
|
|
1832
|
+
respondError(ctx, err);
|
|
1833
|
+
}
|
|
1834
|
+
}
|
|
1835
|
+
async function remove(ctx) {
|
|
1836
|
+
const body = readObject(ctx);
|
|
1837
|
+
if (body === void 0) return;
|
|
1838
|
+
const query = readQuery(ctx, body);
|
|
1839
|
+
if (query === void 0) return;
|
|
1840
|
+
try {
|
|
1841
|
+
const held = await suggestions().removeQuery(ctx.params[0], query);
|
|
1842
|
+
respondJson(ctx, { suggestionIndexes: held });
|
|
1843
|
+
} catch (err) {
|
|
1844
|
+
respondError(ctx, err);
|
|
1845
|
+
}
|
|
1846
|
+
}
|
|
1847
|
+
async function manual(ctx) {
|
|
1848
|
+
const body = readObject(ctx);
|
|
1849
|
+
if (body === void 0) return;
|
|
1850
|
+
const query = readQuery(ctx, body);
|
|
1851
|
+
if (query === void 0) return;
|
|
1852
|
+
const { group, count } = body;
|
|
1853
|
+
if (typeof group !== "string" || count !== void 0 && typeof count !== "number") {
|
|
1854
|
+
badRequest(ctx.res, 'The body must carry the group as a string in "group", and any count as a number in "count"');
|
|
1855
|
+
return;
|
|
1856
|
+
}
|
|
1857
|
+
try {
|
|
1858
|
+
const name = await suggestions().addSuggestion(ctx.params[0], {
|
|
1859
|
+
group,
|
|
1860
|
+
query,
|
|
1861
|
+
...count === void 0 ? {} : { count }
|
|
1862
|
+
});
|
|
1863
|
+
respondJson(ctx, { indexName: name });
|
|
1864
|
+
} catch (err) {
|
|
1865
|
+
respondError(ctx, err);
|
|
1866
|
+
}
|
|
1867
|
+
}
|
|
1868
|
+
return { update, status, record, build, preview, readBans, replaceBans, remove, manual };
|
|
1869
|
+
}
|
|
1870
|
+
|
|
1643
1871
|
// src/server/handlers/search.ts
|
|
1644
1872
|
function createSearchHandlers(deps) {
|
|
1645
1873
|
const { engine, limits, allowRegex } = deps;
|
|
@@ -1762,6 +1990,16 @@ function assertServerLimits(limits, engineRerankWindow) {
|
|
|
1762
1990
|
assertFraction("maxBodyBytesInFlightFraction", limits.maxBodyBytesInFlightFraction);
|
|
1763
1991
|
assertRerankWindowCap(limits.maxRerankWindow, engineRerankWindow);
|
|
1764
1992
|
}
|
|
1993
|
+
function assertQuerySuggestionsOptions(options) {
|
|
1994
|
+
if (options === void 0) return;
|
|
1995
|
+
const identify = typeof options === "object" && options !== null ? Reflect.get(options, "identify") : void 0;
|
|
1996
|
+
if (typeof identify === "function") return;
|
|
1997
|
+
throw new NarsilError(
|
|
1998
|
+
ErrorCodes.CONFIG_INVALID,
|
|
1999
|
+
"querySuggestions must carry an identify function that returns the person and the group of a request",
|
|
2000
|
+
{ field: "querySuggestions.identify" }
|
|
2001
|
+
);
|
|
2002
|
+
}
|
|
1765
2003
|
function assertAllowRegex(allowRegex) {
|
|
1766
2004
|
if (allowRegex === void 0 || typeof allowRegex === "boolean") return;
|
|
1767
2005
|
throw new NarsilError(
|
|
@@ -2544,6 +2782,9 @@ var TaskRegistry = class {
|
|
|
2544
2782
|
reportSteps: (steps) => this.reportProgress(task, { steps }),
|
|
2545
2783
|
reportResult: (result) => {
|
|
2546
2784
|
task.record = { ...task.record, result };
|
|
2785
|
+
},
|
|
2786
|
+
reportBuild: (build) => {
|
|
2787
|
+
task.record = { ...task.record, build };
|
|
2547
2788
|
}
|
|
2548
2789
|
};
|
|
2549
2790
|
let settled;
|
|
@@ -2619,6 +2860,7 @@ function mainThreadHandlers(deps, syncServing) {
|
|
|
2619
2860
|
const version = createVersionHandler(deps);
|
|
2620
2861
|
const capabilities = createCapabilitiesHandler();
|
|
2621
2862
|
const syncSetting = createSyncSettingHandlers(deps.engine);
|
|
2863
|
+
const suggestions = createQuerySuggestionHandlers(deps, deps.querySuggestions);
|
|
2622
2864
|
return {
|
|
2623
2865
|
livez: health.livez,
|
|
2624
2866
|
readyz: health.readyz,
|
|
@@ -2676,7 +2918,16 @@ function mainThreadHandlers(deps, syncServing) {
|
|
|
2676
2918
|
exportDocuments: documentExport.exportDocuments,
|
|
2677
2919
|
importExport: documentExport.importExport,
|
|
2678
2920
|
updateSync: syncSetting.updateSync,
|
|
2679
|
-
syncSnapshot: createSyncSnapshotHandler(syncServing)
|
|
2921
|
+
syncSnapshot: createSyncSnapshotHandler(syncServing),
|
|
2922
|
+
updateQuerySuggestions: suggestions.update,
|
|
2923
|
+
querySuggestionsStatus: suggestions.status,
|
|
2924
|
+
recordQuery: suggestions.record,
|
|
2925
|
+
buildQuerySuggestions: suggestions.build,
|
|
2926
|
+
previewQuerySuggestions: suggestions.preview,
|
|
2927
|
+
readQueryBans: suggestions.readBans,
|
|
2928
|
+
replaceQueryBans: suggestions.replaceBans,
|
|
2929
|
+
removeQuery: suggestions.remove,
|
|
2930
|
+
addManualSuggestion: suggestions.manual
|
|
2680
2931
|
};
|
|
2681
2932
|
}
|
|
2682
2933
|
var NarsilHttpServer = class {
|
|
@@ -2698,6 +2949,7 @@ var NarsilHttpServer = class {
|
|
|
2698
2949
|
const engineRerankWindow = rerankWindowCapOf(engine);
|
|
2699
2950
|
assertServerLimits(options.limits, engineRerankWindow);
|
|
2700
2951
|
assertAllowRegex(options.allowRegex);
|
|
2952
|
+
assertQuerySuggestionsOptions(options.querySuggestions);
|
|
2701
2953
|
this.sync = resolveSyncOptions(options.sync);
|
|
2702
2954
|
this.host = options.host ?? "127.0.0.1";
|
|
2703
2955
|
this.port = options.port ?? 9876;
|
|
@@ -2721,7 +2973,8 @@ var NarsilHttpServer = class {
|
|
|
2721
2973
|
isReady: () => this.ready,
|
|
2722
2974
|
build: resolveBuild(options.build),
|
|
2723
2975
|
cluster: options.cluster,
|
|
2724
|
-
requestThreadCount: () => this.requestThreadCount
|
|
2976
|
+
requestThreadCount: () => this.requestThreadCount,
|
|
2977
|
+
querySuggestions: options.querySuggestions
|
|
2725
2978
|
};
|
|
2726
2979
|
}
|
|
2727
2980
|
async listen() {
|