@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
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { MAX_FILE_BYTES } from './chunk-GPPOG6PT.mjs';
|
|
2
|
+
import { NarsilError, ErrorCodes } from './chunk-SRMZXJSL.mjs';
|
|
3
|
+
|
|
4
|
+
// src/engine/durability-config.ts
|
|
5
|
+
var WAL_ONLY_FIELDS = ["directory", "mode", "flushIntervalMs", "segmentMaxBytes", "compactionThreshold"];
|
|
6
|
+
function configError(message) {
|
|
7
|
+
return new NarsilError(ErrorCodes.CONFIG_INVALID, message);
|
|
8
|
+
}
|
|
9
|
+
function requireKnob(name, value, minimum) {
|
|
10
|
+
if (value === void 0) {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
if (typeof value !== "number" || !Number.isFinite(value) || value < minimum) {
|
|
14
|
+
throw configError(`durability.${name} must be a finite number of at least ${minimum}, got ${String(value)}`);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
function requireValidDurabilityConfig(durability) {
|
|
18
|
+
if (durability.tier !== void 0 && durability.tier !== "wal" && durability.tier !== "snapshot") {
|
|
19
|
+
throw configError(`durability.tier must be "wal" or "snapshot", got "${String(durability.tier)}"`);
|
|
20
|
+
}
|
|
21
|
+
if (durability.mode !== void 0 && durability.mode !== "sync" && durability.mode !== "async") {
|
|
22
|
+
throw configError(`durability.mode must be "sync" or "async", got "${String(durability.mode)}"`);
|
|
23
|
+
}
|
|
24
|
+
requireKnob("checkpointIntervalMs", durability.checkpointIntervalMs, 0);
|
|
25
|
+
requireKnob("checkpointMutationThreshold", durability.checkpointMutationThreshold, 1);
|
|
26
|
+
requireKnob("flushIntervalMs", durability.flushIntervalMs, 0);
|
|
27
|
+
requireKnob("segmentMaxBytes", durability.segmentMaxBytes, 1);
|
|
28
|
+
if (durability.segmentMaxBytes !== void 0 && durability.segmentMaxBytes > MAX_FILE_BYTES) {
|
|
29
|
+
throw configError(
|
|
30
|
+
`durability.segmentMaxBytes must be at most ${MAX_FILE_BYTES}, the largest file that every implementation reads, got ${durability.segmentMaxBytes}`
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
requireKnob("compactionThreshold", durability.compactionThreshold, 1);
|
|
34
|
+
if (durability.tier === "snapshot") {
|
|
35
|
+
for (const field of WAL_ONLY_FIELDS) {
|
|
36
|
+
if (durability[field] !== void 0) {
|
|
37
|
+
throw configError(
|
|
38
|
+
`durability.${field} applies to the write-ahead log tier only and cannot combine with durability.tier "snapshot"`
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
function filesystemBackedDirectory(config) {
|
|
45
|
+
const adapterDirectory = config.persistence?.directory;
|
|
46
|
+
if (adapterDirectory !== void 0 && adapterDirectory.trim().length > 0) {
|
|
47
|
+
return adapterDirectory;
|
|
48
|
+
}
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
function resolveDurabilityTier(config) {
|
|
52
|
+
const filesystemDirectory = filesystemBackedDirectory(config);
|
|
53
|
+
if (config.durability) {
|
|
54
|
+
requireValidDurabilityConfig(config.durability);
|
|
55
|
+
}
|
|
56
|
+
if (config.durability?.tier === "snapshot") {
|
|
57
|
+
if (config.persistence === void 0) {
|
|
58
|
+
throw configError(
|
|
59
|
+
"Snapshot durability persists through a persistence adapter. Configure persistence, or remove durability.tier"
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
return { kind: "snapshot", config: { ...config.durability }, adapter: config.persistence };
|
|
63
|
+
}
|
|
64
|
+
if (config.durability) {
|
|
65
|
+
if (config.durability.directory !== void 0 && config.durability.directory.trim().length > 0) {
|
|
66
|
+
return { kind: "wal", config: { ...config.durability } };
|
|
67
|
+
}
|
|
68
|
+
if (filesystemDirectory !== null) {
|
|
69
|
+
return { kind: "wal", config: { ...config.durability, directory: filesystemDirectory } };
|
|
70
|
+
}
|
|
71
|
+
if (config.persistence !== void 0) {
|
|
72
|
+
throw configError(
|
|
73
|
+
"WAL durability requires a filesystem directory, but the configured persistence adapter is not filesystem-backed. Use a filesystem persistence adapter or set durability.directory"
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
throw configError(
|
|
77
|
+
"Durability requires a directory. Set durability.directory explicitly, or configure a filesystem persistence adapter"
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
if (config.persistence === void 0) {
|
|
81
|
+
return null;
|
|
82
|
+
}
|
|
83
|
+
if (filesystemDirectory !== null) {
|
|
84
|
+
return { kind: "wal", config: { directory: filesystemDirectory } };
|
|
85
|
+
}
|
|
86
|
+
return { kind: "snapshot", config: {}, adapter: config.persistence };
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export { resolveDurabilityTier };
|
|
@@ -1,28 +1,33 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { decodeSegmentManifest, isRecord, invalidManifest, isId, isUint32, isSequenceNumber } from './chunk-
|
|
1
|
+
import { createDirectoryWatch, unrefInterval, LOG_READ_CHUNK_BYTES } from './chunk-G64Q6OJF.mjs';
|
|
2
|
+
import { writeMetadataEnvelope, metadataFromConfig, SINGLE_NODE_PRIMARY_TERM, readCurrentManifest, readMetadataEnvelope, createSeqOwner, SEGMENT_HEADER_SIZE, readSegmentManifest, reclaimUnlistedKeys, loadSegmentedCheckpoint, checkpointLastSeqNo, nextSegmentKey, checkSegmentHeader, RECORD_LENGTH_SIZE, MAX_WAL_RECORD_BYTES, FRAME_CRC_SIZE, decodeWalEntry, readCommitMarker, deserializePayloadV2, unpackEnvelopeBytes, checkpointPrimaryTerm, frameRecord, writeCheckpointSegments, partitionContentsOf, writeLiveVectors, commitCheckpointManifest, removeCheckpointGarbage, readWalSegments, durableRecordMissing, growPartitionsTo, writeSegmentHeader, VECTOR_FILE_ENVELOPE_VERSION, nextMarkerSlot, encodeMarkerSlot, markerSlotOffset, documentsOfPayloadV2, metadataConfigOf, durableMetadataConfigOf, buildEntry, captureWholePartition } from './chunk-RND5CLX3.mjs';
|
|
3
|
+
import { decodeSegmentManifest, isRecord, invalidManifest, isId, isUint32, isSequenceNumber } from './chunk-A5KUEGDY.mjs';
|
|
4
|
+
import './chunk-YJHGOJAC.mjs';
|
|
5
|
+
import { sha256 } from './chunk-M3MQE2X7.mjs';
|
|
6
|
+
import './chunk-CJSYBQ4J.mjs';
|
|
7
|
+
import './chunk-KKAMCABR.mjs';
|
|
8
|
+
import { QUERY_HISTORY_FOLDER } from './chunk-7IGKGWSQ.mjs';
|
|
4
9
|
import './chunk-JNOAKDUM.mjs';
|
|
5
|
-
import { adapterCheckpointStore, directoryCheckpointStore, readListedFile, readSegmentFile } from './chunk-
|
|
6
|
-
import { applyDeleteEntry, applyIndexEntry } from './chunk-
|
|
10
|
+
import { adapterCheckpointStore, directoryCheckpointStore, readListedFile, readSegmentFile } from './chunk-56W3HQVJ.mjs';
|
|
11
|
+
import { applyDeleteEntry, applyIndexEntry } from './chunk-XY4VVBBO.mjs';
|
|
7
12
|
import { DEFAULT_SEGMENT_MAX_BYTES, DEFAULT_CHECKPOINT_INTERVAL_MS, DEFAULT_CHECKPOINT_MUTATION_THRESHOLD, DEFAULT_COMPACTION_THRESHOLD, DEFAULT_ASYNC_FLUSH_INTERVAL_MS, WRITES_STALL_ABOVE_UNCHECKPOINTED_BYTES, DIRECTORY_LOCK_ATTEMPTS, DIRECTORY_LOCK_SETTLE_MS, WHOLE_PARTITION_LARGEST_DOCUMENT_COUNT, WHOLE_PARTITION_MIN_CHANGED_SHARE, CHECKPOINT_TIMEOUT_RECOVERY_BACKOFF_MS, CHECKPOINT_WORKER_TIMEOUT_MS, CHECKPOINT_WORKER_IDLE_MS, LOG_RECORDS_PER_CHECKPOINT } from './chunk-ZI2V4VD7.mjs';
|
|
8
|
-
import {
|
|
13
|
+
import { manifestKey, manifestReferencedKeys, snapshotBundleKey, manifestFileRefs, MAX_SEGMENTS_PER_PARTITION } from './chunk-23XRXIBW.mjs';
|
|
14
|
+
import { toError, packChecksummedEnvelope, buildSegmentPayload, resolvePartitionInsertOptions, freezeSegmentShared, createSharedFrozenSegment } from './chunk-SMEQ36NT.mjs';
|
|
15
|
+
import './chunk-ML7THVLJ.mjs';
|
|
9
16
|
import { createRequestId } from './chunk-VI7BQR4U.mjs';
|
|
10
17
|
import './chunk-JPTQZWJQ.mjs';
|
|
11
|
-
import {
|
|
12
|
-
import { encodeDocument, openChecksummedEnvelope, crc32, requireValidFieldTypes, HEADER_SIZE } from './chunk-7TTWXUH6.mjs';
|
|
18
|
+
import { encodeDocument, openChecksummedEnvelope, crc32, requireValidFieldTypes, HEADER_SIZE } from './chunk-JIJXMI42.mjs';
|
|
13
19
|
import { fnv1a } from './chunk-RA6LSBCM.mjs';
|
|
14
20
|
import './chunk-26A5JFT2.mjs';
|
|
15
|
-
import { nodeThreadId, spawnNodeWorker } from './chunk-HOZW3PKP.mjs';
|
|
16
21
|
import './chunk-3I27KXQD.mjs';
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
22
|
+
import { nodeThreadId, spawnNodeWorker } from './chunk-HOZW3PKP.mjs';
|
|
23
|
+
import { decodeVectorIndexParts, VECTOR_FILE_MAX_VECTORS, deadBytesFor, countDead, decodeVectorFilePayload, decodeVectorGraphPayload, graphPartsOfEarlierPayload } from './chunk-5TCXK5SB.mjs';
|
|
24
|
+
import { turnsAreBudgeted, turnIsSpent, yieldTurn, waitOutsideCountedWrite, detectRuntime, resolveWorkerEntry } from './chunk-4WCVMOU3.mjs';
|
|
19
25
|
import './chunk-TY7L6OXO.mjs';
|
|
20
26
|
import { MAX_INDEX_NAME_LENGTH, INDEX_NAME_PATTERN } from './chunk-4RD3AFSB.mjs';
|
|
21
|
-
import { compareCodePoints, MIN_M
|
|
27
|
+
import { compareCodePoints, MIN_M } from './chunk-LFIWRCEA.mjs';
|
|
28
|
+
import { MAX_FILE_BYTES } from './chunk-GPPOG6PT.mjs';
|
|
22
29
|
import './chunk-WXLBZJMT.mjs';
|
|
23
|
-
import './chunk-
|
|
24
|
-
import './chunk-ML7THVLJ.mjs';
|
|
25
|
-
import { NarsilError, ErrorCodes } from './chunk-MYITLCHT.mjs';
|
|
30
|
+
import { NarsilError, ErrorCodes } from './chunk-SRMZXJSL.mjs';
|
|
26
31
|
import { decode, encode } from '@msgpack/msgpack';
|
|
27
32
|
|
|
28
33
|
// src/persistence/durability/node-fs.browser.ts
|
|
@@ -1312,7 +1317,7 @@ async function writeOneBoundedCheckpoint(input) {
|
|
|
1312
1317
|
}
|
|
1313
1318
|
async function adoptWrittenSegments(input, manager, partitions, changes) {
|
|
1314
1319
|
const { indexName, indexState, hooks } = input;
|
|
1315
|
-
const { actionPartitionsOf, closeUnusedSegments, prepareDiskAdoption, swapPreparedPartitions } = await import('./module-
|
|
1320
|
+
const { actionPartitionsOf, closeUnusedSegments, prepareDiskAdoption, swapPreparedPartitions } = await import('./module-E33X4AOK.mjs');
|
|
1316
1321
|
const adoption = await prepareDiskAdoption(input.directory, manager, partitions);
|
|
1317
1322
|
if (adoption === null) return [];
|
|
1318
1323
|
const adopted = await whileNoMutationApplies([...indexState.partitions.values()], () => {
|
|
@@ -1367,7 +1372,7 @@ async function finishBoundedCheckpoint(input, manager, store, metadata, priorMan
|
|
|
1367
1372
|
const droppedThisCheckpoint = changes !== null && capture2.recordsLeftInLog === 0 ? new Set(await adoptWrittenSegments(input, manager, segments.partitions, changes)) : /* @__PURE__ */ new Set();
|
|
1368
1373
|
if (!input.holdsCheckpointFiles()) {
|
|
1369
1374
|
const removable = await garbageThatNoFieldStillReads(store, vectorIndexes, written.garbage);
|
|
1370
|
-
const stillRead = metadata.textStorage === "disk" ? (await import('./module-
|
|
1375
|
+
const stillRead = metadata.textStorage === "disk" ? (await import('./module-E33X4AOK.mjs')).keysThatSegmentsStillRead(manager) : /* @__PURE__ */ new Set();
|
|
1371
1376
|
const keptForSync = await input.keepsCheckpointKey();
|
|
1372
1377
|
await removeCheckpointGarbage(
|
|
1373
1378
|
store,
|
|
@@ -1528,135 +1533,6 @@ async function drainIndexStateForUnload(indexState, pendingMetadataWrite, closeW
|
|
|
1528
1533
|
}
|
|
1529
1534
|
}
|
|
1530
1535
|
|
|
1531
|
-
// src/persistence/durability/sha256.ts
|
|
1532
|
-
var ROUND_CONSTANTS = new Uint32Array([
|
|
1533
|
-
1116352408,
|
|
1534
|
-
1899447441,
|
|
1535
|
-
3049323471,
|
|
1536
|
-
3921009573,
|
|
1537
|
-
961987163,
|
|
1538
|
-
1508970993,
|
|
1539
|
-
2453635748,
|
|
1540
|
-
2870763221,
|
|
1541
|
-
3624381080,
|
|
1542
|
-
310598401,
|
|
1543
|
-
607225278,
|
|
1544
|
-
1426881987,
|
|
1545
|
-
1925078388,
|
|
1546
|
-
2162078206,
|
|
1547
|
-
2614888103,
|
|
1548
|
-
3248222580,
|
|
1549
|
-
3835390401,
|
|
1550
|
-
4022224774,
|
|
1551
|
-
264347078,
|
|
1552
|
-
604807628,
|
|
1553
|
-
770255983,
|
|
1554
|
-
1249150122,
|
|
1555
|
-
1555081692,
|
|
1556
|
-
1996064986,
|
|
1557
|
-
2554220882,
|
|
1558
|
-
2821834349,
|
|
1559
|
-
2952996808,
|
|
1560
|
-
3210313671,
|
|
1561
|
-
3336571891,
|
|
1562
|
-
3584528711,
|
|
1563
|
-
113926993,
|
|
1564
|
-
338241895,
|
|
1565
|
-
666307205,
|
|
1566
|
-
773529912,
|
|
1567
|
-
1294757372,
|
|
1568
|
-
1396182291,
|
|
1569
|
-
1695183700,
|
|
1570
|
-
1986661051,
|
|
1571
|
-
2177026350,
|
|
1572
|
-
2456956037,
|
|
1573
|
-
2730485921,
|
|
1574
|
-
2820302411,
|
|
1575
|
-
3259730800,
|
|
1576
|
-
3345764771,
|
|
1577
|
-
3516065817,
|
|
1578
|
-
3600352804,
|
|
1579
|
-
4094571909,
|
|
1580
|
-
275423344,
|
|
1581
|
-
430227734,
|
|
1582
|
-
506948616,
|
|
1583
|
-
659060556,
|
|
1584
|
-
883997877,
|
|
1585
|
-
958139571,
|
|
1586
|
-
1322822218,
|
|
1587
|
-
1537002063,
|
|
1588
|
-
1747873779,
|
|
1589
|
-
1955562222,
|
|
1590
|
-
2024104815,
|
|
1591
|
-
2227730452,
|
|
1592
|
-
2361852424,
|
|
1593
|
-
2428436474,
|
|
1594
|
-
2756734187,
|
|
1595
|
-
3204031479,
|
|
1596
|
-
3329325298
|
|
1597
|
-
]);
|
|
1598
|
-
var INITIAL_STATE = [1779033703, 3144134277, 1013904242, 2773480762, 1359893119, 2600822924, 528734635, 1541459225];
|
|
1599
|
-
var BLOCK_BYTES = 64;
|
|
1600
|
-
var LENGTH_BYTES = 8;
|
|
1601
|
-
function rotateRight(value, bits) {
|
|
1602
|
-
return value >>> bits | value << 32 - bits;
|
|
1603
|
-
}
|
|
1604
|
-
function padded(bytes) {
|
|
1605
|
-
const total = Math.ceil((bytes.byteLength + 1 + LENGTH_BYTES) / BLOCK_BYTES) * BLOCK_BYTES;
|
|
1606
|
-
const message = new Uint8Array(total);
|
|
1607
|
-
message.set(bytes);
|
|
1608
|
-
message[bytes.byteLength] = 128;
|
|
1609
|
-
const view = new DataView(message.buffer);
|
|
1610
|
-
const bitLength = bytes.byteLength * 8;
|
|
1611
|
-
view.setUint32(total - LENGTH_BYTES, Math.floor(bitLength / 4294967296), false);
|
|
1612
|
-
view.setUint32(total - 4, bitLength >>> 0, false);
|
|
1613
|
-
return view;
|
|
1614
|
-
}
|
|
1615
|
-
function sha256(bytes) {
|
|
1616
|
-
const view = padded(bytes);
|
|
1617
|
-
const state = INITIAL_STATE.slice();
|
|
1618
|
-
const words = new Uint32Array(64);
|
|
1619
|
-
for (let block = 0; block < view.byteLength; block += BLOCK_BYTES) {
|
|
1620
|
-
for (let i = 0; i < 16; i++) words[i] = view.getUint32(block + i * 4, false);
|
|
1621
|
-
for (let i = 16; i < 64; i++) {
|
|
1622
|
-
const w15 = words[i - 15];
|
|
1623
|
-
const w2 = words[i - 2];
|
|
1624
|
-
const s0 = rotateRight(w15, 7) ^ rotateRight(w15, 18) ^ w15 >>> 3;
|
|
1625
|
-
const s1 = rotateRight(w2, 17) ^ rotateRight(w2, 19) ^ w2 >>> 10;
|
|
1626
|
-
words[i] = words[i - 16] + s0 + words[i - 7] + s1 >>> 0;
|
|
1627
|
-
}
|
|
1628
|
-
let [a, b, c, d, e, f, g, h] = state;
|
|
1629
|
-
for (let i = 0; i < 64; i++) {
|
|
1630
|
-
const s1 = rotateRight(e, 6) ^ rotateRight(e, 11) ^ rotateRight(e, 25);
|
|
1631
|
-
const choice = e & f ^ ~e & g;
|
|
1632
|
-
const t1 = h + s1 + choice + ROUND_CONSTANTS[i] + words[i] >>> 0;
|
|
1633
|
-
const s0 = rotateRight(a, 2) ^ rotateRight(a, 13) ^ rotateRight(a, 22);
|
|
1634
|
-
const majority = a & b ^ a & c ^ b & c;
|
|
1635
|
-
const t2 = s0 + majority >>> 0;
|
|
1636
|
-
h = g;
|
|
1637
|
-
g = f;
|
|
1638
|
-
f = e;
|
|
1639
|
-
e = d + t1 >>> 0;
|
|
1640
|
-
d = c;
|
|
1641
|
-
c = b;
|
|
1642
|
-
b = a;
|
|
1643
|
-
a = t1 + t2 >>> 0;
|
|
1644
|
-
}
|
|
1645
|
-
state[0] = state[0] + a >>> 0;
|
|
1646
|
-
state[1] = state[1] + b >>> 0;
|
|
1647
|
-
state[2] = state[2] + c >>> 0;
|
|
1648
|
-
state[3] = state[3] + d >>> 0;
|
|
1649
|
-
state[4] = state[4] + e >>> 0;
|
|
1650
|
-
state[5] = state[5] + f >>> 0;
|
|
1651
|
-
state[6] = state[6] + g >>> 0;
|
|
1652
|
-
state[7] = state[7] + h >>> 0;
|
|
1653
|
-
}
|
|
1654
|
-
const digest = new Uint8Array(32);
|
|
1655
|
-
const out = new DataView(digest.buffer);
|
|
1656
|
-
for (let i = 0; i < 8; i++) out.setUint32(i * 4, state[i], false);
|
|
1657
|
-
return digest;
|
|
1658
|
-
}
|
|
1659
|
-
|
|
1660
1536
|
// src/persistence/durability/restore-journal.ts
|
|
1661
1537
|
var RESTORE_JOURNAL_PREFIX = ".swap-";
|
|
1662
1538
|
var RESTORE_STAGING_PREFIX = ".restore-";
|
|
@@ -2019,6 +1895,22 @@ function createArchiveCheckpointAccess(deps) {
|
|
|
2019
1895
|
};
|
|
2020
1896
|
}
|
|
2021
1897
|
|
|
1898
|
+
// src/persistence/durability/query-history.ts
|
|
1899
|
+
async function removeQueryHistoryOf(storage, indexName) {
|
|
1900
|
+
const folder = `${QUERY_HISTORY_FOLDER}/${indexName}/`;
|
|
1901
|
+
if (storage.kind === "directory") {
|
|
1902
|
+
for (const key of await storage.directory.list(folder)) await storage.directory.remove(key);
|
|
1903
|
+
return;
|
|
1904
|
+
}
|
|
1905
|
+
for (const key of await storage.adapter.list(folder)) await storage.adapter.delete(key);
|
|
1906
|
+
}
|
|
1907
|
+
function queryHistoryAccess(storage) {
|
|
1908
|
+
return {
|
|
1909
|
+
historyStorage: () => storage,
|
|
1910
|
+
removeQueryHistory: (indexName) => removeQueryHistoryOf(storage, indexName)
|
|
1911
|
+
};
|
|
1912
|
+
}
|
|
1913
|
+
|
|
2022
1914
|
// src/persistence/durability/manager-unload.ts
|
|
2023
1915
|
function createIndexUnloading(deps) {
|
|
2024
1916
|
const { directory, hooks, indexes, metadataWrites } = deps;
|
|
@@ -2035,6 +1927,7 @@ function createIndexUnloading(deps) {
|
|
|
2035
1927
|
for (const key of await directory.list(`${indexName}/`)) {
|
|
2036
1928
|
await directory.remove(key);
|
|
2037
1929
|
}
|
|
1930
|
+
await removeQueryHistoryOf({ kind: "directory", directory }, indexName);
|
|
2038
1931
|
deps.forgetSyncState(indexName);
|
|
2039
1932
|
},
|
|
2040
1933
|
async unloadIndex(indexName) {
|
|
@@ -2785,8 +2678,8 @@ function createGroupCommitCoordinator(sync) {
|
|
|
2785
2678
|
// src/persistence/durability/wal-writer.ts
|
|
2786
2679
|
var SEGMENT_TAIL_PATTERN = /^\d{16}$/;
|
|
2787
2680
|
function segmentKey(indexName, partitionId, startSeqNo) {
|
|
2788
|
-
const
|
|
2789
|
-
return `${indexName}/wal/${partitionId}/${
|
|
2681
|
+
const padded = startSeqNo.toString().padStart(16, "0");
|
|
2682
|
+
return `${indexName}/wal/${partitionId}/${padded}`;
|
|
2790
2683
|
}
|
|
2791
2684
|
function parseSegmentStartSeqNo2(key) {
|
|
2792
2685
|
const tail = key.slice(key.lastIndexOf("/") + 1);
|
|
@@ -3510,7 +3403,7 @@ var decoder = new TextDecoder();
|
|
|
3510
3403
|
async function countPagedPartition(store, partition) {
|
|
3511
3404
|
const { directory } = store;
|
|
3512
3405
|
if (directory === void 0 || partition.segments.length === 0) return null;
|
|
3513
|
-
const { countsAsLatestHolder, isPagedSegmentFile, openPagedSegmentScan } = await import('./module-
|
|
3406
|
+
const { countsAsLatestHolder, isPagedSegmentFile, openPagedSegmentScan } = await import('./module-E33X4AOK.mjs');
|
|
3514
3407
|
for (const ref of partition.segments) if (!await isPagedSegmentFile(directory, ref.key)) return null;
|
|
3515
3408
|
const scans = [];
|
|
3516
3409
|
try {
|
|
@@ -4212,6 +4105,7 @@ function createDurabilityManager(config, hooks, directoryOverride) {
|
|
|
4212
4105
|
},
|
|
4213
4106
|
...unloading,
|
|
4214
4107
|
syncStorage: () => syncStorage,
|
|
4108
|
+
...queryHistoryAccess({ kind: "directory", directory }),
|
|
4215
4109
|
...archiveAccess,
|
|
4216
4110
|
async shutdown() {
|
|
4217
4111
|
shuttingDown = true;
|
|
@@ -4615,6 +4509,7 @@ function createSnapshotOnlyManager(adapter, config, hooks, publisher) {
|
|
|
4615
4509
|
if (lastSeqNo > 0) indexState.appliedSeqNoByPartition.set(partitionId, lastSeqNo);
|
|
4616
4510
|
}
|
|
4617
4511
|
},
|
|
4512
|
+
...queryHistoryAccess({ kind: "adapter", adapter }),
|
|
4618
4513
|
async removeIndex(indexName) {
|
|
4619
4514
|
await settleRestore(indexName).catch(() => void 0);
|
|
4620
4515
|
restores.forget(indexName);
|
|
@@ -4623,6 +4518,7 @@ function createSnapshotOnlyManager(adapter, config, hooks, publisher) {
|
|
|
4623
4518
|
for (const key of await adapter.list(`${indexName}/`)) {
|
|
4624
4519
|
await adapter.delete(key);
|
|
4625
4520
|
}
|
|
4521
|
+
await removeQueryHistoryOf({ kind: "adapter", adapter }, indexName);
|
|
4626
4522
|
},
|
|
4627
4523
|
async unloadIndex(indexName) {
|
|
4628
4524
|
await settleRestore(indexName);
|
|
@@ -4768,7 +4664,7 @@ function createDurabilityFromTier(tier, wiring) {
|
|
|
4768
4664
|
keepsSyncHistory: (indexName) => wiring.indexRegistry.get(indexName)?.sync?.active === true,
|
|
4769
4665
|
onHistoryMoved(indexName) {
|
|
4770
4666
|
if (wiring.indexRegistry.get(indexName)?.sync?.active !== true) return;
|
|
4771
|
-
import('./retention-
|
|
4667
|
+
import('./retention-ASWUHAYI.mjs').then((retention) => retention.scheduleSyncRetention(wiring.engineCore(), indexName)).catch((error) => wiring.emitFatalError(error instanceof Error ? error : new Error(String(error))));
|
|
4772
4668
|
}
|
|
4773
4669
|
});
|
|
4774
4670
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export { clearLeftoversOfName, dropSuggestionIndexesOf, installSuggestionHooks, startQuerySuggestions } from './chunk-3UIEB4QF.mjs';
|
|
2
|
+
import './chunk-ATEBYXP6.mjs';
|
|
3
|
+
import './chunk-SMEQ36NT.mjs';
|
|
4
|
+
import './chunk-ML7THVLJ.mjs';
|
|
5
|
+
import './chunk-VI7BQR4U.mjs';
|
|
6
|
+
import './chunk-JPTQZWJQ.mjs';
|
|
7
|
+
import './chunk-JIJXMI42.mjs';
|
|
8
|
+
import './chunk-RA6LSBCM.mjs';
|
|
9
|
+
import './chunk-26A5JFT2.mjs';
|
|
10
|
+
import './chunk-4WCVMOU3.mjs';
|
|
11
|
+
import './chunk-TY7L6OXO.mjs';
|
|
12
|
+
import './chunk-4RD3AFSB.mjs';
|
|
13
|
+
import './chunk-LFIWRCEA.mjs';
|
|
14
|
+
import './chunk-GPPOG6PT.mjs';
|
|
15
|
+
import './chunk-WXLBZJMT.mjs';
|
|
16
|
+
import './chunk-SRMZXJSL.mjs';
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
export { DOCUMENT_EXPORT_FORMAT, DOCUMENT_EXPORT_VERSION, readDocumentExport } from './chunk-
|
|
2
|
-
import './chunk-
|
|
1
|
+
export { DOCUMENT_EXPORT_FORMAT, DOCUMENT_EXPORT_VERSION, readDocumentExport } from './chunk-K5AXJBLL.mjs';
|
|
2
|
+
import './chunk-EXQZGUQH.mjs';
|
|
3
3
|
import './chunk-DSXIBE6N.mjs';
|
|
4
|
-
import './chunk-
|
|
5
|
-
import './chunk-
|
|
4
|
+
import './chunk-ABCXENU5.mjs';
|
|
5
|
+
import './chunk-SMEQ36NT.mjs';
|
|
6
|
+
import './chunk-ML7THVLJ.mjs';
|
|
6
7
|
import './chunk-VI7BQR4U.mjs';
|
|
7
8
|
import './chunk-JPTQZWJQ.mjs';
|
|
8
|
-
import './chunk-
|
|
9
|
+
import './chunk-JIJXMI42.mjs';
|
|
9
10
|
import './chunk-RA6LSBCM.mjs';
|
|
10
11
|
import './chunk-26A5JFT2.mjs';
|
|
11
|
-
import './chunk-
|
|
12
|
+
import './chunk-4WCVMOU3.mjs';
|
|
12
13
|
import './chunk-TY7L6OXO.mjs';
|
|
13
14
|
import './chunk-4RD3AFSB.mjs';
|
|
14
|
-
import './chunk-
|
|
15
|
+
import './chunk-LFIWRCEA.mjs';
|
|
16
|
+
import './chunk-GPPOG6PT.mjs';
|
|
15
17
|
import './chunk-WXLBZJMT.mjs';
|
|
16
|
-
import './chunk-
|
|
17
|
-
import './chunk-MYITLCHT.mjs';
|
|
18
|
+
import './chunk-SRMZXJSL.mjs';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { updateIndexSync } from './chunk-
|
|
2
|
-
import './chunk-5W3MMTLG.mjs';
|
|
1
|
+
import { updateIndexSync } from './chunk-NLWTBAGB.mjs';
|
|
3
2
|
import './chunk-YJHGOJAC.mjs';
|
|
3
|
+
import './chunk-5W3MMTLG.mjs';
|
|
4
4
|
import './chunk-ML7THVLJ.mjs';
|
|
5
|
-
import './chunk-
|
|
5
|
+
import './chunk-SRMZXJSL.mjs';
|
|
6
6
|
|
|
7
7
|
// src/engine/sync/status.ts
|
|
8
8
|
function syncStatusOf(sync) {
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import { VECTOR_WORKER_COPIES_ALLOWED, noBuildHistory, recordCheckpoint, assignStorePartitions, liveSize, ordinalFilterForSubsets, handOverBuildTurns, filterForOptions, graphNeedsRebuild, yieldBuildTurn, threadsHoldCurrentLayout, emptyFieldBeforeRestore, recalibrateFromStore, signatureOf, allLiveDocIds, fieldHandlesOf, releaseReplacedVectors, adoptGraph, liveOrdinals, adoptLoadedCalibration, planCheckpoint, deserialize } from './chunk-
|
|
1
|
+
import { VECTOR_WORKER_COPIES_ALLOWED, noBuildHistory, recordCheckpoint, assignStorePartitions, liveSize, ordinalFilterForSubsets, handOverBuildTurns, filterForOptions, graphNeedsRebuild, yieldBuildTurn, threadsHoldCurrentLayout, emptyFieldBeforeRestore, recalibrateFromStore, signatureOf, allLiveDocIds, fieldHandlesOf, releaseReplacedVectors, adoptGraph, liveOrdinals, adoptLoadedCalibration, planCheckpoint, deserialize } from './chunk-4EWUGZYZ.mjs';
|
|
2
|
+
import { DEFAULT_PROMOTION_THRESHOLD, DEFAULT_FILTER_THRESHOLD, defaultQuantizationFor, DEFAULT_VECTOR_METRIC, ESTIMATED_MS_PER_TOMBSTONE, ESTIMATED_MS_PER_VECTOR_REBUILD, WORKER_COPY_MIN_VECTORS, SHUFFLED_REBUILD_MEMORY_RETRY_MS, SEARCH_ATTEMPTS_BEFORE_HOLDING_WRITES, BUILD_RETRY_MAX_DELAY_MS, BUILD_RETRY_FIRST_DELAY_MS, BUILD_STEPS_BETWEEN_CLOCK_CHECKS, RECALIBRATION_CHUNK_VECTORS, BUILD_CHUNK_SIZE, SEARCH_REFILL_RESERVE, SEARCH_SCAN_CHUNK_VECTORS, DRIFT_CHECK_GROWTH_FACTOR, RECALIBRATION_DRIFT_RATIO, DISK_ADOPTION_YIELD_INTERVAL } from './chunk-3I27KXQD.mjs';
|
|
2
3
|
import './chunk-OIZS5KIX.mjs';
|
|
3
4
|
import { spawnNodeWorker } from './chunk-HOZW3PKP.mjs';
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { createDocIdMap, turnIsSpent, yieldTurn, resolveWorkerEntry, detectRuntime, noteThreadSlotLive, noteThreadSlotGone } from './chunk-U2E3HMYW.mjs';
|
|
5
|
+
import { openSharedQuantizer, STORE_ORDINAL_LAYOUT_GENERATION, searchOrdinals, insertNode, GRAPH_RETIRED, nodeCountOf, tombstoneCountOf, osqBitsOf, createOsqQuantizer, ordinalFilterValues, openGraphState, STORE_UNPLACED_COUNT, STORE_LIVE_COUNT, STORE_REMOVED_COUNT, fixedView, adoptBackgroundScheduler, VECTOR_MEMORY_LIMITS, sharedVectorStoreBytes, STORE_SLOTS, IN_MEMORY, resetStoreHeader, STORE_RELEASED_VECTORS_TO_DISK, magnitude, turnsAreBudgeted, yieldBackgroundTurn, createOrdinalFilter, addToOrdinalFilter, nativeScoresOf, toScore, ordinalFilterHas, threadedNativeCore, openVectorBlock, NOTHING_STAGED, arenaFloat32Distance, slotByteOffset, detachNativeStore, STORE_BLOCK_COUNT, STORE_CODE_BLOCK_COUNT, createSharedVectorStoreHandles, STORE_DOC_ID_BYTES, unplacedChunkCount, blocksGrowthBytes, growBufferTo, nativeStoreScratchBytes, noteFallback, toDistance, holdWritesAndBackgroundWork, QUERY_STAGED, euclideanDistance, dotProduct, cosineSimilarityWithMagnitudes, UI_THREAD_HOP_BEFORE_TURN_WITHIN_MS, grownByteLength, createVectorBlock, ensureBlockSlots, sharedMemoryAvailable, UI_THREAD_TURN_BUDGET_MS, createHNSWIndex, topLayerInParts, shuffleInPlace, requireWholeNeighbourLists, backgroundTurnIsSpent, createCentroidSums, shuffleStep, centroidOfCentroidSums, meanOfCentroidSums, countOfCentroidSums, squaredLengthsOfCentroidSums, nativeStoreFor, withNativeThreadSlot, nativeMetricCode, NATIVE_OK, releaseLocksHeldBy, UI_THREAD_BACKGROUND_SLICE_DURING_WRITES_MS } from './chunk-K4GCSZLI.mjs';
|
|
6
|
+
export { releaseLocksHeldBy } from './chunk-K4GCSZLI.mjs';
|
|
7
|
+
import { NO_LIVE_VECTOR_AT_POSITION, bytesToVectors, isDead } from './chunk-5TCXK5SB.mjs';
|
|
8
|
+
import { createVectorFileReader } from './chunk-U3JOQGWX.mjs';
|
|
9
|
+
import { createDocIdMap, turnIsSpent, yieldTurn, resolveWorkerEntry, detectRuntime, noteThreadSlotLive, noteThreadSlotGone } from './chunk-4WCVMOU3.mjs';
|
|
10
10
|
import { MAX_RENUMBERED_SEARCH_ATTEMPTS, DISK_STORAGE_BLOCK_BYTES, UNPLACED_FLAG_CHUNK_ORDINALS, GRAPH_BUILD_CHUNKS_IN_FLIGHT_PER_WORKER, GRAPH_BUILD_DISPATCH_CHUNK, NATIVE_THREAD_SCAN_CHUNK_ORDINALS, resolveWorkerCount, WORKER_YOUNG_GENERATION_MB, VECTOR_SEARCH_TIMEOUT_MS, VECTOR_SEARCH_LOAD_TIMEOUT_MS, VECTOR_SCRATCH_SLOTS, VECTOR_INSERT_TIMEOUT_MS } from './chunk-TY7L6OXO.mjs';
|
|
11
11
|
import './chunk-4RD3AFSB.mjs';
|
|
12
|
-
import { compareCodePoints } from './chunk-
|
|
12
|
+
import { compareCodePoints } from './chunk-LFIWRCEA.mjs';
|
|
13
|
+
import './chunk-GPPOG6PT.mjs';
|
|
13
14
|
import './chunk-WXLBZJMT.mjs';
|
|
14
|
-
import { NarsilError, ErrorCodes, isNarsilError } from './chunk-
|
|
15
|
+
import { NarsilError, ErrorCodes, isNarsilError } from './chunk-SRMZXJSL.mjs';
|
|
15
16
|
|
|
16
17
|
// src/engine/vector-maintenance.ts
|
|
17
18
|
function resolveVectorIndexes(manager, indexName, fieldName) {
|
|
@@ -1,21 +1,22 @@
|
|
|
1
|
-
export { actionPartitionsOf, adoptSegmentsOnWorker, bytesThatSegmentsHoldInMemory, checkPagedSegmentFully, closeUnusedSegments, countsAsLatestHolder, createPagedFrozenSegment, isPagedSegmentFile, keysThatSegmentsStillRead, mergePagedWindow, openFileVectorReads, openPagedSegmentScan, openPagedSnapshot, openRewriteSpill, pagedListingOf, pagedPartitionLines, pagedTombstonesFor, prepareDiskAdoption, startReadingOpeningSectionsAhead, swapPreparedPartitions, writePagedSegment } from './chunk-
|
|
2
|
-
import './chunk-
|
|
3
|
-
import './chunk-
|
|
4
|
-
import './chunk-
|
|
5
|
-
import './chunk-
|
|
1
|
+
export { actionPartitionsOf, adoptSegmentsOnWorker, bytesThatSegmentsHoldInMemory, checkPagedSegmentFully, closeUnusedSegments, countsAsLatestHolder, createPagedFrozenSegment, isPagedSegmentFile, keysThatSegmentsStillRead, mergePagedWindow, openFileVectorReads, openPagedSegmentScan, openPagedSnapshot, openRewriteSpill, pagedListingOf, pagedPartitionLines, pagedTombstonesFor, prepareDiskAdoption, startReadingOpeningSectionsAhead, swapPreparedPartitions, writePagedSegment } from './chunk-RRO3EV4C.mjs';
|
|
2
|
+
import './chunk-SUDNZKPL.mjs';
|
|
3
|
+
import './chunk-ABCXENU5.mjs';
|
|
4
|
+
import './chunk-56W3HQVJ.mjs';
|
|
5
|
+
import './chunk-XY4VVBBO.mjs';
|
|
6
6
|
import './chunk-ZI2V4VD7.mjs';
|
|
7
|
-
import './chunk-
|
|
7
|
+
import './chunk-23XRXIBW.mjs';
|
|
8
|
+
import './chunk-SMEQ36NT.mjs';
|
|
9
|
+
import './chunk-ML7THVLJ.mjs';
|
|
8
10
|
import './chunk-VI7BQR4U.mjs';
|
|
9
11
|
import './chunk-JPTQZWJQ.mjs';
|
|
10
|
-
import './chunk-
|
|
11
|
-
import './chunk-7TTWXUH6.mjs';
|
|
12
|
+
import './chunk-JIJXMI42.mjs';
|
|
12
13
|
import './chunk-RA6LSBCM.mjs';
|
|
13
14
|
import './chunk-26A5JFT2.mjs';
|
|
14
|
-
import './chunk-
|
|
15
|
-
import './chunk-
|
|
15
|
+
import './chunk-U3JOQGWX.mjs';
|
|
16
|
+
import './chunk-4WCVMOU3.mjs';
|
|
16
17
|
import './chunk-TY7L6OXO.mjs';
|
|
17
18
|
import './chunk-4RD3AFSB.mjs';
|
|
18
|
-
import './chunk-
|
|
19
|
+
import './chunk-LFIWRCEA.mjs';
|
|
20
|
+
import './chunk-GPPOG6PT.mjs';
|
|
19
21
|
import './chunk-WXLBZJMT.mjs';
|
|
20
|
-
import './chunk-
|
|
21
|
-
import './chunk-MYITLCHT.mjs';
|
|
22
|
+
import './chunk-SRMZXJSL.mjs';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createBitSet, bitsetIsEmpty, GrowableUint32, PHRASE_ROWS_START, bitsetHas, bitsetSet, PHRASE_SORT_RADIX_BITS, PHRASE_SORT_CLOCK_ROWS } from './chunk-26A5JFT2.mjs';
|
|
2
2
|
import { MAX_QUERY_PHRASES, MAX_PHRASE_WORDS } from './chunk-WXLBZJMT.mjs';
|
|
3
|
-
import { NarsilError, ErrorCodes } from './chunk-
|
|
3
|
+
import { NarsilError, ErrorCodes } from './chunk-SRMZXJSL.mjs';
|
|
4
4
|
|
|
5
5
|
// src/core/partition/phrase-matching.ts
|
|
6
6
|
var UINT32_BITS = 32;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequestId } from './chunk-VI7BQR4U.mjs';
|
|
2
2
|
import { fnv1a } from './chunk-RA6LSBCM.mjs';
|
|
3
3
|
import { resolveWorkerCount, SHUTDOWN_TIMEOUT_MS } from './chunk-TY7L6OXO.mjs';
|
|
4
|
-
import { NarsilError, ErrorCodes } from './chunk-
|
|
4
|
+
import { NarsilError, ErrorCodes } from './chunk-SRMZXJSL.mjs';
|
|
5
5
|
|
|
6
6
|
// src/workers/pool-memory.ts
|
|
7
7
|
function toFinite(value) {
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { RestoredHistory } from './chunk-IKDKX5VQ.mjs';
|
|
2
|
+
import { installSuggestionHooks, clearLeftoversOfName } from './chunk-3UIEB4QF.mjs';
|
|
3
|
+
import './chunk-OEDCEZXJ.mjs';
|
|
4
|
+
import { attachedRuntimeOf } from './chunk-ATEBYXP6.mjs';
|
|
5
|
+
import { withState, unionOfBans } from './chunk-CJSYBQ4J.mjs';
|
|
6
|
+
import './chunk-KKAMCABR.mjs';
|
|
7
|
+
import { BUILD_WRITE_BATCH } from './chunk-7IGKGWSQ.mjs';
|
|
8
|
+
import { emitEngineEvent, removeDocumentBatch } from './chunk-SMEQ36NT.mjs';
|
|
9
|
+
import './chunk-ML7THVLJ.mjs';
|
|
10
|
+
import './chunk-VI7BQR4U.mjs';
|
|
11
|
+
import './chunk-JPTQZWJQ.mjs';
|
|
12
|
+
import './chunk-JIJXMI42.mjs';
|
|
13
|
+
import './chunk-RA6LSBCM.mjs';
|
|
14
|
+
import './chunk-26A5JFT2.mjs';
|
|
15
|
+
import './chunk-4WCVMOU3.mjs';
|
|
16
|
+
import './chunk-TY7L6OXO.mjs';
|
|
17
|
+
import './chunk-4RD3AFSB.mjs';
|
|
18
|
+
import './chunk-LFIWRCEA.mjs';
|
|
19
|
+
import './chunk-GPPOG6PT.mjs';
|
|
20
|
+
import './chunk-WXLBZJMT.mjs';
|
|
21
|
+
import { NarsilError, ErrorCodes } from './chunk-SRMZXJSL.mjs';
|
|
22
|
+
|
|
23
|
+
// src/query-suggestions/restore-hooks.ts
|
|
24
|
+
function warn(core, event) {
|
|
25
|
+
if (emitEngineEvent(core.eventHandlers, "querySuggestionsWarning", event) > 0) return;
|
|
26
|
+
console.warn("Popular query suggestions warning:", event);
|
|
27
|
+
}
|
|
28
|
+
function requireNoSyncConflict(indexName, entry) {
|
|
29
|
+
if (entry.sync === null || entry.querySuggestions?.querySuggestions?.enabled !== true) return;
|
|
30
|
+
throw new NarsilError(
|
|
31
|
+
ErrorCodes.CONFIG_INVALID,
|
|
32
|
+
`Index "${indexName}" has device sync on, and the archive turns popular query suggestions on, which a synced index cannot hold`,
|
|
33
|
+
{ indexName }
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
async function removeFromOthers(core, engine, indexName, bans) {
|
|
37
|
+
for (const [name, other] of core.indexRegistry) {
|
|
38
|
+
if (name === indexName || other.querySuggestions?.querySuggestionsSource?.index !== indexName) continue;
|
|
39
|
+
for (let start = 0; start < bans.length; start += BUILD_WRITE_BATCH) {
|
|
40
|
+
const result = await engine.removeBatch(name, bans.slice(start, start + BUILD_WRITE_BATCH));
|
|
41
|
+
const failure = result.failed.find((failed) => failed.error.code !== ErrorCodes.DOC_NOT_FOUND);
|
|
42
|
+
if (failure !== void 0) throw failure.error;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
async function removeFromRestored(core, indexName, bans) {
|
|
47
|
+
for (let start = 0; start < bans.length; start += BUILD_WRITE_BATCH) {
|
|
48
|
+
const result = await removeDocumentBatch(core.mutationCtx, indexName, bans.slice(start, start + BUILD_WRITE_BATCH));
|
|
49
|
+
const failure = result.failed.find((failed) => failed.error.code !== ErrorCodes.DOC_NOT_FOUND);
|
|
50
|
+
if (failure !== void 0) throw failure.error;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
async function applyBans(core, engine, indexName, entry) {
|
|
54
|
+
const bans = entry.querySuggestions?.bannedQueries ?? [];
|
|
55
|
+
if (bans.length > 0) await removeFromOthers(core, engine, indexName, bans);
|
|
56
|
+
const marker = entry.querySuggestions?.querySuggestionsSource;
|
|
57
|
+
if (marker === void 0 || marker.index === indexName) return;
|
|
58
|
+
const sourceBans = core.indexRegistry.get(marker.index)?.querySuggestions?.bannedQueries ?? [];
|
|
59
|
+
if (sourceBans.length > 0) await removeFromRestored(core, indexName, sourceBans);
|
|
60
|
+
}
|
|
61
|
+
function restoreSuggestionHooksOf(core, engine, indexName) {
|
|
62
|
+
installSuggestionHooks(core);
|
|
63
|
+
return {
|
|
64
|
+
async historySink(restored) {
|
|
65
|
+
return attachedRuntimeOf(core)?.restoredHistory(indexName, restored?.querySuggestions) ?? null;
|
|
66
|
+
},
|
|
67
|
+
async beforeInstall(entry, previous) {
|
|
68
|
+
requireNoSyncConflict(indexName, entry);
|
|
69
|
+
const previousBans = previous?.querySuggestions?.bannedQueries ?? [];
|
|
70
|
+
if (previousBans.length > 0) {
|
|
71
|
+
const restoredBans = entry.querySuggestions?.bannedQueries ?? [];
|
|
72
|
+
entry.querySuggestions = withState(entry.querySuggestions, {
|
|
73
|
+
bannedQueries: unionOfBans(previousBans, restoredBans)
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
if (previous === void 0) await clearLeftoversOfName(core, indexName);
|
|
77
|
+
},
|
|
78
|
+
async afterActivate(entry) {
|
|
79
|
+
try {
|
|
80
|
+
await applyBans(core, engine, indexName, entry);
|
|
81
|
+
} catch (error) {
|
|
82
|
+
warn(core, {
|
|
83
|
+
indexName,
|
|
84
|
+
reason: "ban-removal-failed",
|
|
85
|
+
message: error instanceof Error ? error.message : String(error)
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
async afterInstall(entry, history) {
|
|
90
|
+
const runtime = attachedRuntimeOf(core);
|
|
91
|
+
const enabled = entry.querySuggestions?.querySuggestions?.enabled === true;
|
|
92
|
+
try {
|
|
93
|
+
if (!enabled) {
|
|
94
|
+
if (runtime !== void 0) await runtime.discardHistory(indexName);
|
|
95
|
+
else await core.durability?.manager.removeQueryHistory?.(indexName);
|
|
96
|
+
} else if (runtime === void 0 || runtime.scrambler === null) {
|
|
97
|
+
warn(core, { indexName, reason: "no-key" });
|
|
98
|
+
} else if (history instanceof RestoredHistory) {
|
|
99
|
+
await history.commit();
|
|
100
|
+
}
|
|
101
|
+
} catch (error) {
|
|
102
|
+
warn(core, {
|
|
103
|
+
indexName,
|
|
104
|
+
reason: "save-failed",
|
|
105
|
+
message: error instanceof Error ? error.message : String(error)
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
runtime?.settingChanged(indexName);
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export { restoreSuggestionHooksOf };
|