@delali/narsil 0.3.1-next.154 → 0.3.1-next.155
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/adapters/filesystem.mjs +2 -2
- package/dist/adapters/gcs.mjs +2 -2
- package/dist/adapters/indexeddb.mjs +1 -1
- package/dist/adapters/s3.mjs +2 -2
- package/dist/{analysis-change-4GCRVRBW.mjs → analysis-change-3TFIHT5E.mjs} +25 -25
- package/dist/{react-native/chunks/analysis-change-entry-TNLUC6IZ.mjs → analysis-change-entry-KA6JAO4X.mjs} +1 -1
- package/dist/archive-history-E4R73RWD.mjs +29 -0
- package/dist/browser/{analysis-change-IXWPXXJJ.mjs → analysis-change-TC36BU47.mjs} +29 -10
- package/dist/{analysis-change-entry-KYGSXW4K.mjs → browser/analysis-change-entry-4MH3CZXH.mjs} +1 -1
- package/dist/browser/archive-history-4IP5XQZY.mjs +29 -0
- package/dist/browser/{chunk-4PD752F6.mjs → chunk-23XRXIBW.mjs} +1 -1
- package/dist/browser/chunk-3UIEB4QF.mjs +63 -0
- package/dist/browser/{chunk-AJ4HHOVT.mjs → chunk-4EWUGZYZ.mjs} +4 -4
- package/dist/browser/{chunk-U2E3HMYW.mjs → chunk-4WCVMOU3.mjs} +1 -1
- package/dist/browser/{chunk-QXTPSX2H.mjs → chunk-56W3HQVJ.mjs} +7 -7
- package/dist/browser/{chunk-3U3QR5YP.mjs → chunk-5TCXK5SB.mjs} +2 -2
- package/dist/browser/chunk-7IGKGWSQ.mjs +79 -0
- package/dist/browser/{chunk-J433A7P3.mjs → chunk-A5KUEGDY.mjs} +5 -5
- package/dist/browser/{chunk-XRV72TJD.mjs → chunk-ABCXENU5.mjs} +2 -2
- package/dist/browser/chunk-ATEBYXP6.mjs +10 -0
- package/dist/{react-native/chunks/chunk-3XKMRNRE.mjs → browser/chunk-BXM5XOCA.mjs} +27 -10
- package/dist/browser/chunk-CJSYBQ4J.mjs +100 -0
- package/dist/{react-native/chunks/chunk-DCKMICOB.mjs → browser/chunk-EXQZGUQH.mjs} +1 -1
- package/dist/browser/{chunk-VCOYGVP7.mjs → chunk-FNIFPFB7.mjs} +3 -3
- package/dist/browser/{chunk-ML6HY7T7.mjs → chunk-G64Q6OJF.mjs} +1 -1
- package/dist/browser/chunk-GPPOG6PT.mjs +9 -0
- package/dist/browser/chunk-IKDKX5VQ.mjs +1007 -0
- package/dist/browser/{chunk-7TTWXUH6.mjs → chunk-JIJXMI42.mjs} +3 -2
- package/dist/browser/chunk-JVBP5EYO.mjs +1106 -0
- package/dist/browser/{chunk-2FX6ROWR.mjs → chunk-K4GCSZLI.mjs} +4 -4
- package/dist/browser/{chunk-EUNBNLKM.mjs → chunk-K5AXJBLL.mjs} +5 -5
- package/dist/browser/chunk-KKAMCABR.mjs +432 -0
- package/dist/browser/{chunk-7MEYN7V6.mjs → chunk-LFIWRCEA.mjs} +1 -9
- package/dist/browser/chunk-M3MQE2X7.mjs +151 -0
- package/dist/browser/{chunk-W5X2UFWQ.mjs → chunk-NLWTBAGB.mjs} +12 -3
- package/dist/browser/chunk-OEDCEZXJ.mjs +92 -0
- package/dist/browser/{chunk-G7LUMBSG.mjs → chunk-RND5CLX3.mjs} +28 -18
- package/dist/browser/{chunk-AYY6PIKL.mjs → chunk-RQBUNZQW.mjs} +2 -2
- package/dist/browser/{chunk-C4KS2QNF.mjs → chunk-RRO3EV4C.mjs} +9 -9
- package/dist/browser/{chunk-2SHAKW2Z.mjs → chunk-SMEQ36NT.mjs} +80 -134
- package/dist/{chunk-KUZKUONM.mjs → browser/chunk-SRMZXJSL.mjs} +1 -0
- package/dist/{react-native/chunks/chunk-3O57C2ZO.mjs → browser/chunk-SUDNZKPL.mjs} +2 -2
- package/dist/browser/{chunk-SJB6VIZG.mjs → chunk-U3JOQGWX.mjs} +1 -1
- package/dist/browser/{chunk-H6QFBMVE.mjs → chunk-XY4VVBBO.mjs} +3 -3
- package/dist/browser/{cold-module-VTUGDYNY.mjs → cold-module-NEUGHUPA.mjs} +18 -17
- package/dist/browser/durability-config-TIYKW6XX.mjs +89 -0
- package/dist/browser/{durability-wiring-GL4A7KDV.mjs → durability-wiring-CVGPRO6D.mjs} +46 -150
- package/dist/browser/engine-hooks-YXMPHZKZ.mjs +16 -0
- package/dist/browser/{import-YI5GNB4H.mjs → import-OM6QAW45.mjs} +10 -9
- package/dist/browser/{methods-LMUTS7OI.mjs → methods-KTQCSIN4.mjs} +3 -3
- package/dist/browser/{module-EC3FYW7N.mjs → module-3HNFCBJ5.mjs} +10 -9
- package/dist/browser/{module-M4JNBV6V.mjs → module-E33X4AOK.mjs} +14 -13
- package/dist/browser/operations-OJ3BXS55.mjs +5 -0
- package/dist/browser/{phrase-module-NPYUVX75.mjs → phrase-module-ZXXU7S3B.mjs} +1 -1
- package/dist/browser/{pool-WCGDZHJP.mjs → pool-3JLET5RO.mjs} +1 -1
- package/dist/browser/restore-hooks-IF2ZROUP.mjs +113 -0
- package/dist/browser/restore-queue-ZBS7CJA6.mjs +55 -0
- package/dist/browser/{retention-6QMRS5VK.mjs → retention-ASWUHAYI.mjs} +16 -14
- package/dist/browser/{runtime-3EW2AGB6.mjs → runtime-OTAGEFQW.mjs} +1 -1
- package/dist/browser/{snapshot-DN3CRVUQ.mjs → snapshot-PN7ZW6Q4.mjs} +65 -31
- package/dist/browser/start-ZIRB7MQ2.mjs +24 -0
- package/dist/browser/{write-WAWAFGKQ.mjs → write-HMDYCTV2.mjs} +14 -13
- package/dist/{capabilities-B3Brs1Rc.d.ts → capabilities-Da4ywVVl.d.ts} +35 -3
- package/dist/{chunk-K4B7OH65.mjs → chunk-2MANFZJ3.mjs} +2 -2
- package/dist/{chunk-O43Z4MS6.mjs → chunk-2NE7VCYE.mjs} +2 -2
- package/dist/{chunk-3Y3J4V2R.mjs → chunk-3C7MTCCI.mjs} +1 -1
- package/dist/{chunk-RVKFI3A2.mjs → chunk-3HB3PEC6.mjs} +11 -8
- package/dist/chunk-3HHQLEEQ.mjs +1092 -0
- package/dist/{chunk-HVYICDY3.mjs → chunk-3OH67G7R.mjs} +1 -1
- package/dist/{chunk-QKZHLADX.mjs → chunk-3R4UZWQG.mjs} +26 -17
- package/dist/{chunk-ZIFJXCKA.mjs → chunk-4BYWRYPM.mjs} +1 -1
- package/dist/{chunk-VMXSVVXG.mjs → chunk-4KRC2APY.mjs} +5 -5
- package/dist/{chunk-IQ4R2I6N.mjs → chunk-5FLRXF73.mjs} +5 -1
- package/dist/chunk-5FVU47TB.mjs +20 -0
- package/dist/chunk-5YNRKI2C.mjs +81 -0
- package/dist/chunk-6L3XJXGU.mjs +470 -0
- package/dist/{chunk-C6ASEFZI.mjs → chunk-6OEGXLBX.mjs} +1 -1
- package/dist/{browser/chunk-SIR3LMTV.mjs → chunk-6RC4K46J.mjs} +2 -2
- package/dist/{chunk-466PYR4P.mjs → chunk-AILVAOLX.mjs} +2 -2
- package/dist/chunk-BDRIVYOK.mjs +72 -0
- package/dist/{chunk-TRISKD4Q.mjs → chunk-BY6ZDGYS.mjs} +2 -2
- package/dist/{chunk-NZMAXR2S.mjs → chunk-DCNKVEDB.mjs} +121 -10
- package/dist/{chunk-C73JLU4E.mjs → chunk-DIBHI6W5.mjs} +2 -2
- package/dist/{chunk-VREK3MYG.mjs → chunk-DUOLGBTE.mjs} +3 -3
- package/dist/{chunk-USR7FQRZ.mjs → chunk-GH4WQ22V.mjs} +2 -2
- package/dist/chunk-GQPTDQCL.mjs +54 -0
- package/dist/chunk-H4KHPLHJ.mjs +382 -0
- package/dist/{chunk-K7KLL263.mjs → chunk-H6VIGE62.mjs} +12 -12
- package/dist/{chunk-YROWNOMH.mjs → chunk-HJJI72X7.mjs} +1 -1
- package/dist/{chunk-37IVJLP6.mjs → chunk-HNVVEQP7.mjs} +1 -1
- package/dist/{chunk-PFKM7VNZ.mjs → chunk-HW5TNXBO.mjs} +28 -10
- package/dist/{chunk-3A5KI24C.mjs → chunk-I54T6CQP.mjs} +1 -1
- package/dist/{chunk-YBJDOA2T.mjs → chunk-INJYO3BU.mjs} +1 -1
- package/dist/{chunk-KCUIFVVW.mjs → chunk-J4IWBIVY.mjs} +9 -9
- package/dist/{chunk-AO2FAYIZ.mjs → chunk-K4ZIGL2O.mjs} +1 -1
- package/dist/{chunk-7NTMUDC5.mjs → chunk-KBDBPVLN.mjs} +5 -5
- package/dist/{chunk-JFNKIBDT.mjs → chunk-KBKEXQZA.mjs} +2 -2
- package/dist/{chunk-REL7LFLR.mjs → chunk-KFLK5NA2.mjs} +3 -3
- package/dist/{chunk-WCBA2LVZ.mjs → chunk-KHKIRS5D.mjs} +1 -1
- package/dist/{chunk-7QUGDVFC.mjs → chunk-KJ3RTZDJ.mjs} +1 -1
- package/dist/{chunk-LSM2YTKM.mjs → chunk-KMUNHGBQ.mjs} +81 -139
- package/dist/chunk-KP7TYHWT.mjs +92 -0
- package/dist/{chunk-MMBEANB2.mjs → chunk-KPIV4RUC.mjs} +3 -3
- package/dist/{chunk-62G63NMH.mjs → chunk-KXCVQWOR.mjs} +4 -4
- package/dist/{chunk-TV2L3BN7.mjs → chunk-L7ZD4L3K.mjs} +263 -263
- package/dist/{chunk-OKX2BBNW.mjs → chunk-LC3FDWTX.mjs} +2 -2
- package/dist/{chunk-URPCYQVJ.mjs → chunk-LHKOSI2J.mjs} +1 -1
- package/dist/chunk-LNGE7SLY.mjs +151 -0
- package/dist/{react-native/chunks/chunk-CUNGPR5R.mjs → chunk-MP7ABPTD.mjs} +1 -0
- package/dist/chunk-MT2NRTA6.mjs +216 -0
- package/dist/{chunk-Q3TCTQCC.mjs → chunk-NF4DT3IH.mjs} +1 -1
- package/dist/{chunk-3OFU3NJT.mjs → chunk-OIJ64LGT.mjs} +1 -1
- package/dist/{chunk-4HWZV5MK.mjs → chunk-PCRA7HTI.mjs} +5 -5
- package/dist/chunk-PHQNACDT.mjs +63 -0
- package/dist/{chunk-Q7MS6P2J.mjs → chunk-Q622CTMC.mjs} +2 -2
- package/dist/{chunk-HVKXNBFL.mjs → chunk-Q7G3BV3Y.mjs} +1 -1
- package/dist/{chunk-IBNLW3AV.mjs → chunk-QH3YIQP4.mjs} +20 -6
- package/dist/{chunk-B7S6YEBP.mjs → chunk-QJVOLKU6.mjs} +12 -3
- package/dist/chunk-QUJHMPTP.mjs +30 -0
- package/dist/{chunk-7HCZWC7B.mjs → chunk-RSVULW4Q.mjs} +49 -7
- package/dist/{chunk-YPUEV6ZC.mjs → chunk-RVGRFOGN.mjs} +1 -1
- package/dist/{chunk-JCLTESFN.mjs → chunk-RZWWB2XR.mjs} +1 -1
- package/dist/{chunk-X6NSJYQ3.mjs → chunk-S2EQU2GE.mjs} +13 -13
- package/dist/chunk-S5LN746F.mjs +10 -0
- package/dist/{chunk-MMEMEUOO.mjs → chunk-SG3JBNHY.mjs} +2 -2
- package/dist/{chunk-LKUE5GXS.mjs → chunk-SMVH6JBE.mjs} +2 -2
- package/dist/{chunk-IJU7LL7D.mjs → chunk-SY3EWKQY.mjs} +5 -5
- package/dist/{chunk-CP5RRPJR.mjs → chunk-TQXHPFWT.mjs} +1 -1
- package/dist/{chunk-5KGYQT6W.mjs → chunk-U4BS74YN.mjs} +26 -9
- package/dist/{chunk-S2N75OTN.mjs → chunk-UHICS3JI.mjs} +1 -1
- package/dist/chunk-UZRZKNNZ.mjs +101 -0
- package/dist/{chunk-DMQPFLGI.mjs → chunk-VGF7CFRP.mjs} +5 -5
- package/dist/chunk-VHBNF4MA.mjs +543 -0
- package/dist/{chunk-BPSKLCS7.mjs → chunk-VQEUR6T6.mjs} +3 -3
- package/dist/{chunk-Z3TNWCI5.mjs → chunk-WQRN64Q6.mjs} +2 -2
- package/dist/{chunk-LTUGDMV4.mjs → chunk-WZ7YV54N.mjs} +1 -1
- package/dist/{chunk-NTZOXVUZ.mjs → chunk-YEDIDCR7.mjs} +3 -3
- package/dist/{chunk-PGVPE7GJ.mjs → chunk-YEKL4JBK.mjs} +1 -1
- package/dist/{chunk-5FUOVJKG.mjs → chunk-Z2BE2MAM.mjs} +13 -13
- package/dist/{chunk-HWEDFLB7.mjs → chunk-ZAUJFLEN.mjs} +10 -10
- package/dist/{chunk-MLHNSAPK.mjs → chunk-ZHCUZZE5.mjs} +2 -2
- package/dist/{chunk-ECX4SGX6.mjs → chunk-ZTW5WTGG.mjs} +9 -9
- package/dist/{client-Df76GNKm.d.ts → client-DRv7UVeY.d.ts} +123 -11
- package/dist/client.d.ts +9 -8
- package/dist/client.mjs +65 -3
- package/dist/{cold-module-YLWMTTZG.mjs → cold-module-7XXCEGTZ.mjs} +35 -35
- package/dist/{config-B8DP2VwR.d.ts → config-CoSig5Ox.d.ts} +22 -3
- package/dist/{config-05G_hy-1.d.ts → config-DMwffLKn.d.ts} +20 -5
- package/dist/{direct-executor-FI5GJHWX.mjs → direct-executor-G5TK7NLA.mjs} +16 -16
- package/dist/distribution/coordinator/etcd.d.ts +2 -2
- package/dist/distribution/coordinator/etcd.mjs +1 -1
- package/dist/distribution/coordinator/in-memory.d.ts +2 -2
- package/dist/distribution/transport/grpc.mjs +4 -4
- package/dist/distribution/transport/in-memory.mjs +2 -2
- package/dist/distribution/transport/tcp.mjs +3 -3
- package/dist/distribution.d.ts +8 -8
- package/dist/distribution.mjs +6788 -5934
- package/dist/durability-config-GE4U7MCZ.mjs +89 -0
- package/dist/{durability-wiring-RHLXDIVF.mjs → durability-wiring-NCKUC5EO.mjs} +71 -175
- package/dist/embeddings/openai.mjs +2 -2
- package/dist/{sync-uXR7MmM7.d.ts → engine-CFxPYqEk.d.ts} +702 -2
- package/dist/engine-hooks-DHCMOADY.mjs +47 -0
- package/dist/{import-SRBNC6TE.mjs → import-NBFXFCSG.mjs} +26 -26
- package/dist/{index-nRqDM6uS.d.ts → index-C4AmUnl1.d.ts} +1 -1
- package/dist/index.browser.mjs +7 -6
- package/dist/index.d.ts +7 -7
- package/dist/index.mjs +23 -23
- package/dist/index.react-native.mjs +13 -12
- package/dist/{long-query-thread-EMYTGSJP.mjs → long-query-thread-J4DVRM4A.mjs} +25 -24
- package/dist/{methods-ABM5ELBR.mjs → methods-7IOINERF.mjs} +3 -3
- package/dist/{module-MG7JMV2U.mjs → module-DWKPBSMN.mjs} +31 -31
- package/dist/{module-3OMJZUFT.mjs → module-UN76TF7I.mjs} +11 -11
- package/dist/operations-G5EP6JPX.mjs +5 -0
- package/dist/{paged-partition-archive-UOLHOEZJ.mjs → paged-partition-archive-DPNWVSK2.mjs} +38 -34
- package/dist/partial-words.mjs +7 -7
- package/dist/pattern.mjs +3 -3
- package/dist/persistence/durability/checkpoint-worker.d.ts +8 -1
- package/dist/persistence/durability/checkpoint-worker.mjs +32 -32
- package/dist/{phrase-module-O3MDRQXP.mjs → phrase-module-ZI4WSQVH.mjs} +1 -1
- package/dist/{pool-CQXYPFLG.mjs → pool-Y4A46T36.mjs} +1 -1
- package/dist/query-suggestions/merge-worker.d.ts +55 -0
- package/dist/query-suggestions/merge-worker.mjs +81 -0
- package/dist/query-suggestions-CBYkrQ5T.d.ts +311 -0
- package/dist/query-suggestions.browser.mjs +246 -0
- package/dist/query-suggestions.d.ts +20 -0
- package/dist/query-suggestions.mjs +62 -0
- package/dist/react-native/chunks/{analysis-change-EAYO3Y6Q.mjs → analysis-change-6BPDPH6K.mjs} +36 -17
- package/dist/{browser/analysis-change-entry-FCSHFQSS.mjs → react-native/chunks/analysis-change-entry-JLL42PH6.mjs} +1 -1
- package/dist/react-native/chunks/archive-history-MJKUQLSU.mjs +29 -0
- package/dist/react-native/chunks/{chunk-O32RB3BL.mjs → chunk-3JIBF3XT.mjs} +3 -3
- package/dist/react-native/chunks/{chunk-75VWIY35.mjs → chunk-4DII3ZSM.mjs} +1 -1
- package/dist/react-native/chunks/{chunk-NKIZX26F.mjs → chunk-4J74WHQM.mjs} +2 -2
- package/dist/{browser/chunk-TTD27VXX.mjs → react-native/chunks/chunk-4LCEN2IU.mjs} +27 -10
- package/dist/react-native/chunks/{chunk-AUT7PMA4.mjs → chunk-4Y53T4YE.mjs} +5 -5
- package/dist/react-native/chunks/chunk-5CQX3XXV.mjs +17 -0
- package/dist/react-native/chunks/chunk-6VBXNFLE.mjs +9 -0
- package/dist/react-native/chunks/{chunk-SJWDBRNP.mjs → chunk-6WA3C3DV.mjs} +1 -1
- package/dist/react-native/chunks/chunk-7GRCBBME.mjs +63 -0
- package/dist/react-native/chunks/{chunk-7GWPJDOA.mjs → chunk-7PXRWYUU.mjs} +1 -1
- package/dist/react-native/chunks/{chunk-GFYFQLJD.mjs → chunk-ALOIBXWN.mjs} +2 -2
- package/dist/react-native/chunks/{chunk-VQSKZ3EZ.mjs → chunk-C3PTWYKT.mjs} +8 -8
- package/dist/react-native/chunks/{chunk-OQQVRWZ2.mjs → chunk-C5G6TJ7A.mjs} +1 -1
- package/dist/react-native/chunks/{chunk-RVAEBN74.mjs → chunk-CKNRFDTZ.mjs} +1 -1
- package/dist/react-native/chunks/{chunk-UWDNZDWK.mjs → chunk-CUH5F57W.mjs} +6 -6
- package/dist/react-native/chunks/chunk-DIYDOIM4.mjs +10 -0
- package/dist/react-native/chunks/{chunk-YBEW6YTR.mjs → chunk-DVDX4SDR.mjs} +2 -2
- package/dist/{browser/chunk-MYITLCHT.mjs → react-native/chunks/chunk-DZ7H7D2C.mjs} +1 -0
- package/dist/react-native/chunks/{chunk-RYMDHGL4.mjs → chunk-EIOYM5TO.mjs} +5 -5
- package/dist/react-native/chunks/chunk-GIZTJXYW.mjs +1007 -0
- package/dist/react-native/chunks/{chunk-NP7DD4G5.mjs → chunk-GJFXPHXI.mjs} +5 -5
- package/dist/react-native/chunks/chunk-H3MDVPBO.mjs +151 -0
- package/dist/react-native/chunks/{chunk-63YSZOXB.mjs → chunk-HUOYZJ3Q.mjs} +88 -142
- package/dist/react-native/chunks/{chunk-DH3TVWWK.mjs → chunk-IYNT75CE.mjs} +12 -3
- package/dist/react-native/chunks/{chunk-NCJS3WIY.mjs → chunk-JLIIWJUV.mjs} +1 -1
- package/dist/react-native/chunks/chunk-KJIG57UD.mjs +1106 -0
- package/dist/react-native/chunks/{chunk-JX2RIAXH.mjs → chunk-KTTAU63H.mjs} +5 -5
- package/dist/{browser/chunk-ZPTA75ZC.mjs → react-native/chunks/chunk-LZSLNSUN.mjs} +1 -1
- package/dist/react-native/chunks/{chunk-ZBSWRSBG.mjs → chunk-MJDQU5MW.mjs} +1 -1
- package/dist/react-native/chunks/{chunk-IOY2SM2P.mjs → chunk-MVXELMJX.mjs} +1 -1
- package/dist/react-native/chunks/{chunk-2CGSQM4O.mjs → chunk-N2WUOWLL.mjs} +12 -12
- package/dist/react-native/chunks/{chunk-YHKZSLOC.mjs → chunk-OL3WDV53.mjs} +5 -5
- package/dist/react-native/chunks/{chunk-VVFYOADG.mjs → chunk-PEHS2UO3.mjs} +6 -6
- package/dist/react-native/chunks/chunk-PJHAB5ZY.mjs +79 -0
- package/dist/react-native/chunks/chunk-QJXTNPLQ.mjs +100 -0
- package/dist/react-native/chunks/{chunk-EH5CFV6Z.mjs → chunk-RDWG33MM.mjs} +2 -2
- package/dist/react-native/chunks/{chunk-ZYDKJXQJ.mjs → chunk-SUPXRTMD.mjs} +1 -1
- package/dist/react-native/chunks/chunk-TYIRMPD3.mjs +432 -0
- package/dist/react-native/chunks/{chunk-JPAJWO6D.mjs → chunk-U4KSKA4Z.mjs} +1 -1
- package/dist/react-native/chunks/{chunk-I5PGWQJF.mjs → chunk-VXGE4ZXL.mjs} +31 -22
- package/dist/{chunk-DVWYODEB.mjs → react-native/chunks/chunk-WBYQRHDY.mjs} +2 -2
- package/dist/react-native/chunks/{chunk-C2H2QQFW.mjs → chunk-YH7QY657.mjs} +3 -3
- package/dist/react-native/chunks/chunk-ZZT7CEN7.mjs +92 -0
- package/dist/react-native/chunks/{cold-module-TJL6AFAD.mjs → cold-module-5PHF6DZR.mjs} +24 -23
- package/dist/react-native/chunks/durability-config-QXVZEO7T.mjs +89 -0
- package/dist/react-native/chunks/{durability-wiring-RRDYJLLM.mjs → durability-wiring-KO565FZC.mjs} +52 -156
- package/dist/react-native/chunks/engine-hooks-MVRRHH6B.mjs +28 -0
- package/dist/react-native/chunks/gzip.react-native-HLEPDKZ3.mjs +3 -0
- package/dist/react-native/chunks/import-YVZA4V4V.mjs +30 -0
- package/dist/react-native/chunks/{methods-X6F36SJE.mjs → methods-6W5U4C3H.mjs} +3 -3
- package/dist/react-native/chunks/{module-S4DKSWMF.mjs → module-H5MVPSP2.mjs} +11 -10
- package/dist/react-native/chunks/{module-QT5HZAY4.mjs → module-ZL5ZG6YB.mjs} +20 -19
- package/dist/react-native/chunks/operations-GNRMD6EX.mjs +5 -0
- package/dist/react-native/chunks/{phrase-module-JZ37TB7N.mjs → phrase-module-RTVKEWJT.mjs} +1 -1
- package/dist/react-native/chunks/{pool-RTGXJXPU.mjs → pool-JR3NJCAF.mjs} +1 -1
- package/dist/react-native/chunks/restore-hooks-SILFPU6B.mjs +125 -0
- package/dist/react-native/chunks/restore-queue-HSYP2AEC.mjs +55 -0
- package/dist/react-native/chunks/{retention-PPCTP2VY.mjs → retention-7I7UAWYK.mjs} +21 -19
- package/dist/react-native/chunks/{runtime-KUATOLYB.mjs → runtime-R5E3TB3J.mjs} +1 -1
- package/dist/react-native/chunks/{snapshot-ZBIEOZTZ.mjs → snapshot-EZYB6SLF.mjs} +70 -36
- package/dist/react-native/chunks/start-SHVZ72I5.mjs +36 -0
- package/dist/react-native/chunks/{write-2W4FTX7J.mjs → write-JUESXHDL.mjs} +20 -19
- package/dist/react-native/partial-words.mjs +7 -6
- package/dist/react-native/pattern.mjs +3 -3
- package/dist/react-native/query-suggestions.mjs +258 -0
- package/dist/react-native/sync.mjs +76 -13
- package/dist/react-native/synonyms.mjs +4 -4
- package/dist/react.d.ts +11 -11
- package/dist/react.mjs +1 -0
- package/dist/{rerank-IZOB6NII.mjs → rerank-MQ37IYRV.mjs} +4 -4
- package/dist/rerankers/http.mjs +2 -2
- package/dist/restore-hooks-HZ3ILAMO.mjs +146 -0
- package/dist/restore-queue-JVGENGGE.mjs +55 -0
- package/dist/{retention-55WA7GPU.mjs → retention-HROPV2QU.mjs} +33 -32
- package/dist/{runtime-UZOC3NPY.mjs → runtime-COIUORCN.mjs} +5 -5
- package/dist/{schema-DDauvDOv.d.ts → schema-Jwt928nJ.d.ts} +1 -1
- package/dist/server.d.ts +108 -12
- package/dist/server.mjs +293 -46
- package/dist/{snapshot-NFX2EYN2.mjs → snapshot-4HS2G2UM.mjs} +85 -54
- package/dist/start-UTWHGH42.mjs +59 -0
- package/dist/sync/filesystem.d.ts +4 -4
- package/dist/sync/filesystem.mjs +4 -4
- package/dist/sync/indexeddb.d.ts +4 -4
- package/dist/sync/indexeddb.mjs +2 -2
- package/dist/sync.browser.mjs +74 -11
- package/dist/sync.d.ts +5 -5
- package/dist/sync.mjs +76 -14
- package/dist/synonyms.mjs +5 -5
- package/dist/{tasks-BShx8pdK.d.ts → tasks-qrJojgST.d.ts} +13 -5
- package/dist/{thread-P2G2FWM2.mjs → thread-6MOXY2KD.mjs} +24 -23
- package/dist/{types-SnO7_tAI.d.ts → types-BZCGjfLn.d.ts} +2 -3
- package/dist/vector/search-worker.d.ts +1 -1
- package/dist/vector/search-worker.mjs +5 -5
- package/dist/workers/entry.mjs +8 -8
- package/dist/{write-FGB62BHQ.mjs → write-GTTWWRRG.mjs} +30 -30
- package/openapi.json +798 -7
- package/package.json +24 -7
- package/dist/browser/operations-WVYLF72Q.mjs +0 -5
- package/dist/browser/restore-queue-TYIGDL5L.mjs +0 -41
- package/dist/engine-DYu-e0oR.d.ts +0 -674
- package/dist/operations-PGOAY2KS.mjs +0 -5
- package/dist/react-native/chunks/chunk-TJMSKBEM.mjs +0 -25
- package/dist/react-native/chunks/gzip.react-native-DNB5YNFA.mjs +0 -3
- package/dist/react-native/chunks/import-JYBMEJPQ.mjs +0 -29
- package/dist/react-native/chunks/operations-RYKTSZQA.mjs +0 -5
- package/dist/react-native/chunks/restore-queue-ZBVIKJWI.mjs +0 -41
- package/dist/restore-queue-COI2GSSK.mjs +0 -41
|
@@ -1,31 +1,30 @@
|
|
|
1
|
-
import { DEFAULT_BLOCK_WRITES_ABOVE, DEFAULT_RESUME_WRITES_BELOW, validateWorkerConfig, validateIndexName, validatePatternValueLimit, requireSurfaceFormsForPartialFields, validateBM25Params, validatePartitionConfig, executeQuery, lazyQueryBinding, executePreflight, executeSuggest, executeListDocuments, ENGINE_MEMORY_FIGURES_MAX_AGE_MS, storedBM25Params, readEngineMemoryFigures, FULL_MEMORY_COLLECTION_INTERVAL_MS
|
|
1
|
+
import { DEFAULT_BLOCK_WRITES_ABOVE, DEFAULT_RESUME_WRITES_BELOW, validateWorkerConfig, validateIndexName, validatePatternValueLimit, requireSurfaceFormsForPartialFields, validateBM25Params, validatePartitionConfig, executeQuery, lazyQueryBinding, executePreflight, executeSuggest, executeListDocuments, validateBatchList, ENGINE_MEMORY_FIGURES_MAX_AGE_MS, validateDocId, storedBM25Params, readEngineMemoryFigures, FULL_MEMORY_COLLECTION_INTERVAL_MS } from './chunk-L7ZD4L3K.mjs';
|
|
2
2
|
import { DEFAULT_MAX_RERANK_WINDOW, DEFAULT_RERANK_TIMEOUT_MS } from './chunk-HJSN7UYG.mjs';
|
|
3
|
-
import { detectRuntime, resolveWorkerEntry, missingWorkerEntry, workerResourceLimits } from './chunk-
|
|
3
|
+
import { detectRuntime, resolveWorkerEntry, missingWorkerEntry, workerResourceLimits } from './chunk-LHKOSI2J.mjs';
|
|
4
4
|
import { collectYoungGenerationBeforeRefusal, collectGarbageBeforeRefusal } from './chunk-XIHUI4KB.mjs';
|
|
5
|
-
import { splitWorkerBudget, resolveWorkerCount,
|
|
6
|
-
import { MAX_INDEX_CONFIGURATION_BYTES, MAX_SWEEP_INTERVAL_MS, MIN_SWEEP_INTERVAL_MS, STATISTICS_BROADCAST_INTERVAL_MS, HEAP_PRESSURE_WARNING_FRACTION, FOREIGN_STATS_TTL_MS, MIN_DOCUMENTS_FOR_SEGMENTS, HEAP_PRESSURE_REARM_FRACTION
|
|
7
|
-
import { resolvePartialWordAnalysis, resolvePartitionInsertOptions, isEmptySynonymSet, synonymModule, createDirectExecutor, generateId, createPartitionRouter, availableSynonymModule, mergeFrozenSegments, createSharedFrozenSegment, freezeSegmentShared, createFrozenSegment } from './chunk-
|
|
8
|
-
import { ARRAY_POSITION_GAP, requirePatternSearchFor, requirePartialWordSearchFor, loadPhraseCodeFor, collectQueryTermStats, requireLoadedPhraseCode, createPartitionIndex, mergePartitionStats, oversampledFacetConfig, availablePatternSearch, PATTERN_HOST, kWayMerge, mergeFacets, isCompositePartition, encodeSegmentState } from './chunk-
|
|
9
|
-
import { INDEX_CONFIGURATION_ENVELOPE_VERSION } from './chunk-
|
|
10
|
-
import { requireWithinFileLimit, HEADER_SIZE, payloadByteLength, checksumOfChunks, packEnvelopeWithEngineVersion } from './chunk-
|
|
5
|
+
import { splitWorkerBudget, resolveWorkerCount, resolveRequestThreadCount, DEFAULT_REQUEST_TIMEOUT_MS, DEFAULT_BACKPRESSURE_LIMIT, SHUTDOWN_TIMEOUT_MS, CONSECUTIVE_TIMEOUTS_BEFORE_DEATH } from './chunk-3MXV3VHR.mjs';
|
|
6
|
+
import { MAX_INDEX_CONFIGURATION_BYTES, BATCH_CHUNK_SIZE, MAX_SWEEP_INTERVAL_MS, MIN_SWEEP_INTERVAL_MS, STATISTICS_BROADCAST_INTERVAL_MS, HEAP_PRESSURE_WARNING_FRACTION, FOREIGN_STATS_TTL_MS, MIN_DOCUMENTS_FOR_SEGMENTS, HEAP_PRESSURE_REARM_FRACTION } from './chunk-EEBCDP36.mjs';
|
|
7
|
+
import { resolvePartialWordAnalysis, resolvePartitionInsertOptions, isEmptySynonymSet, synonymModule, createDirectExecutor, generateId, createPartitionRouter, availableSynonymModule, mergeFrozenSegments, createSharedFrozenSegment, freezeSegmentShared, createFrozenSegment } from './chunk-Z2BE2MAM.mjs';
|
|
8
|
+
import { ARRAY_POSITION_GAP, requirePatternSearchFor, requirePartialWordSearchFor, loadPhraseCodeFor, collectQueryTermStats, requireLoadedPhraseCode, createPartitionIndex, mergePartitionStats, oversampledFacetConfig, availablePatternSearch, PATTERN_HOST, kWayMerge, mergeFacets, isCompositePartition, encodeSegmentState } from './chunk-ZAUJFLEN.mjs';
|
|
9
|
+
import { INDEX_CONFIGURATION_ENVELOPE_VERSION } from './chunk-GH4WQ22V.mjs';
|
|
10
|
+
import { requireWithinFileLimit, HEADER_SIZE, payloadByteLength, checksumOfChunks, packEnvelopeWithEngineVersion } from './chunk-3OH67G7R.mjs';
|
|
11
11
|
import { readHeapStatistics } from './chunk-IPN7S4KX.mjs';
|
|
12
12
|
import { fnv1a } from './chunk-KAKQ74LS.mjs';
|
|
13
13
|
import { countEngineThread } from './chunk-Q2UL2TPC.mjs';
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
14
|
+
import { DEFAULT_PATTERN_WORK_CAP, MATCHER_STATE_BUDGET_BYTES } from './chunk-LC3FDWTX.mjs';
|
|
15
|
+
import { raiseEarlierReleaseGraphSetting, getNestedValue, messagePackUpperBoundBytes, validateVectorPromotion, validateVectorStorage, validateTextStorage, validateRequiredFields, requireDocumentWithinSizeLimit, validateDocument, validateDocumentStrict } from './chunk-4KRC2APY.mjs';
|
|
16
|
+
import { flattenSchema, validateSchema, requireCreatableSchema, schemaFieldsOf, extractVectorFieldsFromSchema } from './chunk-WQRN64Q6.mjs';
|
|
17
|
+
import { isSingleStringFieldType } from './chunk-I54T6CQP.mjs';
|
|
18
|
+
import { emitSyncChange, withOpenIndex, oneAtATime } from './chunk-Y4WPNHMC.mjs';
|
|
19
|
+
import { getLanguage } from './chunk-RZWWB2XR.mjs';
|
|
16
20
|
import { createRequestId, isValidWorkerResponse } from './chunk-QHPYS427.mjs';
|
|
17
21
|
import { collectAndReturnPages } from './chunk-QYRNLLLI.mjs';
|
|
18
|
-
import { loadVectorCodeFor, loadedVectorCode, loadVectorCode, requireLoadedVectorCode } from './chunk-
|
|
22
|
+
import { loadVectorCodeFor, loadedVectorCode, loadVectorCode, requireLoadedVectorCode } from './chunk-HNVVEQP7.mjs';
|
|
19
23
|
import { HEAP_RESUME_FRACTION_BELOW_V8_INEFFECTIVE_MARK_COMPACT_LINE, HEAP_BLOCK_FRACTION_BELOW_V8_INEFFECTIVE_MARK_COMPACT_LINE } from './chunk-ZXNQEW43.mjs';
|
|
20
|
-
import { requireSearchBackendSettings } from './chunk-
|
|
21
|
-
import {
|
|
24
|
+
import { requireSearchBackendSettings } from './chunk-Q7G3BV3Y.mjs';
|
|
25
|
+
import { turnsAreBudgeted, turnIsSpent, yieldTurn, countWrite, indexChangeOutsideExternalWaits, changeIndexOutsideExternalWaits } from './chunk-LQG5G2LY.mjs';
|
|
22
26
|
import { noteThreadSlotLive, threadSlotOfWorker, noteThreadSlotGone } from './chunk-RFBLQLLZ.mjs';
|
|
23
|
-
import {
|
|
24
|
-
import { raiseEarlierReleaseGraphSetting, getNestedValue, messagePackUpperBoundBytes, validateVectorPromotion, validateVectorStorage, validateTextStorage, validateRequiredFields, requireDocumentWithinSizeLimit, validateDocument, validateDocumentStrict } from './chunk-VMXSVVXG.mjs';
|
|
25
|
-
import { flattenSchema, validateSchema, requireCreatableSchema, schemaFieldsOf, extractVectorFieldsFromSchema } from './chunk-Z3TNWCI5.mjs';
|
|
26
|
-
import { isSingleStringFieldType } from './chunk-3A5KI24C.mjs';
|
|
27
|
-
import { MAX_FILE_BYTES } from './chunk-U476IXKQ.mjs';
|
|
28
|
-
import { ErrorCodes, NarsilError } from './chunk-KUZKUONM.mjs';
|
|
27
|
+
import { ErrorCodes, NarsilError } from './chunk-MP7ABPTD.mjs';
|
|
29
28
|
import { compareCodePoints } from './chunk-YTJCGKM4.mjs';
|
|
30
29
|
import { encode } from '@msgpack/msgpack';
|
|
31
30
|
|
|
@@ -276,7 +275,8 @@ var NARSIL_CONFIG_KEYS = {
|
|
|
276
275
|
lifecycle: true,
|
|
277
276
|
patternWorkCap: true,
|
|
278
277
|
events: true,
|
|
279
|
-
memory: true
|
|
278
|
+
memory: true,
|
|
279
|
+
querySuggestions: true
|
|
280
280
|
};
|
|
281
281
|
var EVENT_NAMES = {
|
|
282
282
|
write: true,
|
|
@@ -290,7 +290,9 @@ var EVENT_NAMES = {
|
|
|
290
290
|
layoutUpgrade: true,
|
|
291
291
|
checkpointHeld: true,
|
|
292
292
|
durabilityError: true,
|
|
293
|
-
invalidationError: true
|
|
293
|
+
invalidationError: true,
|
|
294
|
+
querySuggestionsBuild: true,
|
|
295
|
+
querySuggestionsWarning: true
|
|
294
296
|
};
|
|
295
297
|
var DURABILITY_CONFIG_KEYS = {
|
|
296
298
|
tier: true,
|
|
@@ -612,7 +614,7 @@ var TEXT_REBUILD_SWITCH_BACKLOG_DOCUMENTS = 1e3;
|
|
|
612
614
|
// src/partitioning/rewrite-spill-of.ts
|
|
613
615
|
async function rewriteSpillOf(storage, manager, target) {
|
|
614
616
|
if (storage === void 0 || (target?.config ?? manager.config).textStorage !== "disk") return null;
|
|
615
|
-
const { openRewriteSpill } = await import('./module-
|
|
617
|
+
const { openRewriteSpill } = await import('./module-DWKPBSMN.mjs');
|
|
616
618
|
return openRewriteSpill(storage, manager, target);
|
|
617
619
|
}
|
|
618
620
|
|
|
@@ -924,91 +926,6 @@ function createAnalysisRebuildCoordinator(config, deps) {
|
|
|
924
926
|
};
|
|
925
927
|
}
|
|
926
928
|
|
|
927
|
-
// src/engine/durability-config.ts
|
|
928
|
-
var WAL_ONLY_FIELDS = ["directory", "mode", "flushIntervalMs", "segmentMaxBytes", "compactionThreshold"];
|
|
929
|
-
function configError(message) {
|
|
930
|
-
return new NarsilError(ErrorCodes.CONFIG_INVALID, message);
|
|
931
|
-
}
|
|
932
|
-
function requireKnob(name, value, minimum) {
|
|
933
|
-
if (value === void 0) {
|
|
934
|
-
return;
|
|
935
|
-
}
|
|
936
|
-
if (typeof value !== "number" || !Number.isFinite(value) || value < minimum) {
|
|
937
|
-
throw configError(`durability.${name} must be a finite number of at least ${minimum}, got ${String(value)}`);
|
|
938
|
-
}
|
|
939
|
-
}
|
|
940
|
-
function requireValidDurabilityConfig(durability) {
|
|
941
|
-
if (durability.tier !== void 0 && durability.tier !== "wal" && durability.tier !== "snapshot") {
|
|
942
|
-
throw configError(`durability.tier must be "wal" or "snapshot", got "${String(durability.tier)}"`);
|
|
943
|
-
}
|
|
944
|
-
if (durability.mode !== void 0 && durability.mode !== "sync" && durability.mode !== "async") {
|
|
945
|
-
throw configError(`durability.mode must be "sync" or "async", got "${String(durability.mode)}"`);
|
|
946
|
-
}
|
|
947
|
-
requireKnob("checkpointIntervalMs", durability.checkpointIntervalMs, 0);
|
|
948
|
-
requireKnob("checkpointMutationThreshold", durability.checkpointMutationThreshold, 1);
|
|
949
|
-
requireKnob("flushIntervalMs", durability.flushIntervalMs, 0);
|
|
950
|
-
requireKnob("segmentMaxBytes", durability.segmentMaxBytes, 1);
|
|
951
|
-
if (durability.segmentMaxBytes !== void 0 && durability.segmentMaxBytes > MAX_FILE_BYTES) {
|
|
952
|
-
throw configError(
|
|
953
|
-
`durability.segmentMaxBytes must be at most ${MAX_FILE_BYTES}, the largest file that every implementation reads, got ${durability.segmentMaxBytes}`
|
|
954
|
-
);
|
|
955
|
-
}
|
|
956
|
-
requireKnob("compactionThreshold", durability.compactionThreshold, 1);
|
|
957
|
-
if (durability.tier === "snapshot") {
|
|
958
|
-
for (const field of WAL_ONLY_FIELDS) {
|
|
959
|
-
if (durability[field] !== void 0) {
|
|
960
|
-
throw configError(
|
|
961
|
-
`durability.${field} applies to the write-ahead log tier only and cannot combine with durability.tier "snapshot"`
|
|
962
|
-
);
|
|
963
|
-
}
|
|
964
|
-
}
|
|
965
|
-
}
|
|
966
|
-
}
|
|
967
|
-
function filesystemBackedDirectory(config) {
|
|
968
|
-
const adapterDirectory = config.persistence?.directory;
|
|
969
|
-
if (adapterDirectory !== void 0 && adapterDirectory.trim().length > 0) {
|
|
970
|
-
return adapterDirectory;
|
|
971
|
-
}
|
|
972
|
-
return null;
|
|
973
|
-
}
|
|
974
|
-
function resolveDurabilityTier(config) {
|
|
975
|
-
const filesystemDirectory = filesystemBackedDirectory(config);
|
|
976
|
-
if (config.durability) {
|
|
977
|
-
requireValidDurabilityConfig(config.durability);
|
|
978
|
-
}
|
|
979
|
-
if (config.durability?.tier === "snapshot") {
|
|
980
|
-
if (config.persistence === void 0) {
|
|
981
|
-
throw configError(
|
|
982
|
-
"Snapshot durability persists through a persistence adapter. Configure persistence, or remove durability.tier"
|
|
983
|
-
);
|
|
984
|
-
}
|
|
985
|
-
return { kind: "snapshot", config: { ...config.durability }, adapter: config.persistence };
|
|
986
|
-
}
|
|
987
|
-
if (config.durability) {
|
|
988
|
-
if (config.durability.directory !== void 0 && config.durability.directory.trim().length > 0) {
|
|
989
|
-
return { kind: "wal", config: { ...config.durability } };
|
|
990
|
-
}
|
|
991
|
-
if (filesystemDirectory !== null) {
|
|
992
|
-
return { kind: "wal", config: { ...config.durability, directory: filesystemDirectory } };
|
|
993
|
-
}
|
|
994
|
-
if (config.persistence !== void 0) {
|
|
995
|
-
throw configError(
|
|
996
|
-
"WAL durability requires a filesystem directory, but the configured persistence adapter is not filesystem-backed. Use a filesystem persistence adapter or set durability.directory"
|
|
997
|
-
);
|
|
998
|
-
}
|
|
999
|
-
throw configError(
|
|
1000
|
-
"Durability requires a directory. Set durability.directory explicitly, or configure a filesystem persistence adapter"
|
|
1001
|
-
);
|
|
1002
|
-
}
|
|
1003
|
-
if (config.persistence === void 0) {
|
|
1004
|
-
return null;
|
|
1005
|
-
}
|
|
1006
|
-
if (filesystemDirectory !== null) {
|
|
1007
|
-
return { kind: "wal", config: { directory: filesystemDirectory } };
|
|
1008
|
-
}
|
|
1009
|
-
return { kind: "snapshot", config: {}, adapter: config.persistence };
|
|
1010
|
-
}
|
|
1011
|
-
|
|
1012
929
|
// src/engine/array-positions.ts
|
|
1013
930
|
function holdsStringArrayField(schema) {
|
|
1014
931
|
return schemaFieldsOf(schema).some((field) => field.base === "string[]");
|
|
@@ -1156,7 +1073,7 @@ async function createIndexFromMetadata(deps, metadata, loadData) {
|
|
|
1156
1073
|
const existing = deps.indexRegistry.get(metadata.indexName);
|
|
1157
1074
|
if (existing !== void 0) {
|
|
1158
1075
|
if ((metadata.analysisGeneration ?? 0) > existing.analysisGeneration) {
|
|
1159
|
-
const { adoptSavedAnalysis } = await import('./analysis-change-
|
|
1076
|
+
const { adoptSavedAnalysis } = await import('./analysis-change-3TFIHT5E.mjs');
|
|
1160
1077
|
adoptSavedAnalysis(deps.executor.getManager(metadata.indexName), existing, metadata);
|
|
1161
1078
|
}
|
|
1162
1079
|
if (loadData && deps.executor.getManager(metadata.indexName) === void 0) {
|
|
@@ -1212,7 +1129,8 @@ async function createIndexFromMetadata(deps, metadata, loadData) {
|
|
|
1212
1129
|
analysisGeneration: metadata.analysisGeneration ?? 0,
|
|
1213
1130
|
pendingAnalysis: metadata.pendingAnalysis ?? null,
|
|
1214
1131
|
durableAnalysis: null,
|
|
1215
|
-
sync: metadata.sync?.enabled === true ? (await import('./sync-state-ZWHLAFLE.mjs')).syncStateOfMetadata(metadata) : null
|
|
1132
|
+
sync: metadata.sync?.enabled === true ? (await import('./sync-state-ZWHLAFLE.mjs')).syncStateOfMetadata(metadata) : null,
|
|
1133
|
+
querySuggestions: metadata.querySuggestions ?? null
|
|
1216
1134
|
});
|
|
1217
1135
|
if (loadData) await deps.indexState().registerOpen(metadata.indexName);
|
|
1218
1136
|
else deps.indexState().registerClosed(metadata.indexName);
|
|
@@ -3302,7 +3220,7 @@ async function startPool(state) {
|
|
|
3302
3220
|
);
|
|
3303
3221
|
}
|
|
3304
3222
|
eligibleIndexNames(state);
|
|
3305
|
-
const [factory, { createWorkerPool }] = await Promise.all([createWorkerFactory(), import('./pool-
|
|
3223
|
+
const [factory, { createWorkerPool }] = await Promise.all([createWorkerFactory(), import('./pool-Y4A46T36.mjs')]);
|
|
3306
3224
|
let started = null;
|
|
3307
3225
|
const pool = createWorkerPool({
|
|
3308
3226
|
count: state.keywordWorkerCount + state.longQueryWorkerCount,
|
|
@@ -3993,18 +3911,18 @@ async function emitWriteEventAfter(source, indexName, write) {
|
|
|
3993
3911
|
// src/engine/core.ts
|
|
3994
3912
|
async function createEngineCore(config, hooks, capacityScope = "index") {
|
|
3995
3913
|
validateWorkerConfig(config?.workers, config?.lifecycle);
|
|
3996
|
-
const rerankSettings = config?.rerankTimeout === void 0 && config?.maxRerankWindow === void 0 ? { timeoutMs: DEFAULT_RERANK_TIMEOUT_MS, maxWindow: DEFAULT_MAX_RERANK_WINDOW } : (await import('./runtime-
|
|
3914
|
+
const rerankSettings = config?.rerankTimeout === void 0 && config?.maxRerankWindow === void 0 ? { timeoutMs: DEFAULT_RERANK_TIMEOUT_MS, maxWindow: DEFAULT_MAX_RERANK_WINDOW } : (await import('./runtime-COIUORCN.mjs')).resolveRerankSettings(config);
|
|
3997
3915
|
const eventHandlers = eventHandlersOf(config?.events);
|
|
3998
3916
|
const vectorWorkerCount = splitWorkerBudget(resolveWorkerCount(config?.workers?.count)).vector;
|
|
3999
3917
|
const vectorCopyPolicy = {
|
|
4000
3918
|
enabled: (config?.workers?.enabled ?? workersEnabledByDefault()) && vectorWorkerCount > 0,
|
|
4001
3919
|
count: vectorWorkerCount
|
|
4002
3920
|
};
|
|
4003
|
-
const durabilityTier = config !== void 0 ? resolveDurabilityTier(config) : null;
|
|
3921
|
+
const durabilityTier = config !== void 0 && (config.durability || config.persistence !== void 0) ? (await import('./durability-config-GE4U7MCZ.mjs')).resolveDurabilityTier(config) : null;
|
|
4004
3922
|
if (config?.lifecycle !== void 0 && durabilityTier === null) {
|
|
4005
3923
|
throw new NarsilError(ErrorCodes.CONFIG_INVALID, "Index lifecycle settings require durability");
|
|
4006
3924
|
}
|
|
4007
|
-
const durabilityWiring = durabilityTier === null ? null : await import('./durability-wiring-
|
|
3925
|
+
const durabilityWiring = durabilityTier === null ? null : await import('./durability-wiring-NCKUC5EO.mjs');
|
|
4008
3926
|
const filesystemDurability = durabilityTier?.kind === "wal";
|
|
4009
3927
|
const executor = createDirectExecutor({
|
|
4010
3928
|
vectorWorkerCopies: vectorCopyPolicy,
|
|
@@ -4190,7 +4108,7 @@ async function createEngineCore(config, hooks, capacityScope = "index") {
|
|
|
4190
4108
|
requireManager,
|
|
4191
4109
|
resumeChange: async (indexName) => {
|
|
4192
4110
|
if ((indexRegistry.get(indexName)?.pendingAnalysis ?? null) === null) return;
|
|
4193
|
-
await (await import('./analysis-change-entry-
|
|
4111
|
+
await (await import('./analysis-change-entry-KA6JAO4X.mjs')).resumeChangeOf(engineCore, indexName);
|
|
4194
4112
|
},
|
|
4195
4113
|
onClose: hooks?.onIndexClose,
|
|
4196
4114
|
onOpen: (indexName) => {
|
|
@@ -4251,6 +4169,7 @@ async function createEngineCore(config, hooks, capacityScope = "index") {
|
|
|
4251
4169
|
orchestrator,
|
|
4252
4170
|
rebalanceRouter,
|
|
4253
4171
|
rebalancingIndexes,
|
|
4172
|
+
restoresInFlight: /* @__PURE__ */ new Map(),
|
|
4254
4173
|
waqMap,
|
|
4255
4174
|
guardShutdown,
|
|
4256
4175
|
requireIndex,
|
|
@@ -4275,7 +4194,7 @@ async function startEngineCore(core, config) {
|
|
|
4275
4194
|
checkHeapAfterRecovery(core);
|
|
4276
4195
|
}
|
|
4277
4196
|
if (core.invalidation) await core.invalidation.start();
|
|
4278
|
-
if (core.durability) await (await import('./analysis-change-entry-
|
|
4197
|
+
if (core.durability) await (await import('./analysis-change-entry-KA6JAO4X.mjs')).resumeEveryChange(core);
|
|
4279
4198
|
if (config?.lifecycle === void 0) await core.analysisRebuild.reviewStaleIndexes();
|
|
4280
4199
|
} catch (err) {
|
|
4281
4200
|
await core.durability?.manager.shutdown().catch(() => void 0);
|
|
@@ -4285,6 +4204,7 @@ async function startEngineCore(core, config) {
|
|
|
4285
4204
|
}
|
|
4286
4205
|
async function shutdownEngine(core) {
|
|
4287
4206
|
const { executor, durability, indexRegistry, eventHandlers, orchestrator } = core;
|
|
4207
|
+
await core.querySuggestionHooks?.shutdown();
|
|
4288
4208
|
core.indexState.dispose();
|
|
4289
4209
|
if (durability) {
|
|
4290
4210
|
await durability.manager.shutdown();
|
|
@@ -4313,7 +4233,7 @@ async function shutdownEngine(core) {
|
|
|
4313
4233
|
}
|
|
4314
4234
|
}
|
|
4315
4235
|
if (core.rerankAdapters.size > 0) {
|
|
4316
|
-
await (await import('./runtime-
|
|
4236
|
+
await (await import('./runtime-COIUORCN.mjs')).shutdownRerankAdapters(core.rerankAdapters);
|
|
4317
4237
|
}
|
|
4318
4238
|
await orchestrator.shutdown();
|
|
4319
4239
|
await executor.shutdown();
|
|
@@ -4391,7 +4311,8 @@ function indexConfigurationOf(entry) {
|
|
|
4391
4311
|
synonyms,
|
|
4392
4312
|
entry.analysisGeneration
|
|
4393
4313
|
);
|
|
4394
|
-
|
|
4314
|
+
const withSuggestions = { ...payload, ...entry.querySuggestions };
|
|
4315
|
+
return entry.sync === null ? withSuggestions : { ...withSuggestions, syncEpoch: entry.sync.epoch };
|
|
4395
4316
|
}
|
|
4396
4317
|
function requireConfigurationWithinSizeLimit(config, language) {
|
|
4397
4318
|
const adapter = config.embedding?.adapter;
|
|
@@ -4558,6 +4479,7 @@ async function createEngineIndex(core, config, name, requestedConfig, creation =
|
|
|
4558
4479
|
const language = getLanguage(indexConfig.language ?? "english");
|
|
4559
4480
|
if (appliesCreationLimits) requireConfigurationWithinSizeLimit(indexConfig, language);
|
|
4560
4481
|
const synonyms = prepareConfiguredSynonyms(configured, language, appliesCreationLimits);
|
|
4482
|
+
await core.querySuggestionHooks?.beforeCreate(name);
|
|
4561
4483
|
core.executor.createIndex(name, indexConfig, language, false, synonyms?.lookup ?? null);
|
|
4562
4484
|
core.indexRegistry.set(name, {
|
|
4563
4485
|
config: indexConfig,
|
|
@@ -4575,7 +4497,8 @@ async function createEngineIndex(core, config, name, requestedConfig, creation =
|
|
|
4575
4497
|
analysisGeneration: 0,
|
|
4576
4498
|
pendingAnalysis: null,
|
|
4577
4499
|
durableAnalysis: null,
|
|
4578
|
-
sync: null
|
|
4500
|
+
sync: null,
|
|
4501
|
+
querySuggestions: creation.querySuggestions ?? null
|
|
4579
4502
|
});
|
|
4580
4503
|
await core.indexState.registerOpen(name);
|
|
4581
4504
|
if (core.durability) {
|
|
@@ -4588,10 +4511,11 @@ async function dropEngineIndex(core, name) {
|
|
|
4588
4511
|
const entry = core.requireIndex(name);
|
|
4589
4512
|
const changeRecorded = () => entry.pendingAnalysis !== null || entry.durableAnalysis !== null;
|
|
4590
4513
|
const abandonChange = async () => {
|
|
4591
|
-
await (await import('./analysis-change-entry-
|
|
4514
|
+
await (await import('./analysis-change-entry-KA6JAO4X.mjs')).abandonChangeOf(core, name);
|
|
4592
4515
|
};
|
|
4593
4516
|
if (changeRecorded()) await abandonChange();
|
|
4594
4517
|
await core.indexState.drop(name, async () => {
|
|
4518
|
+
await core.querySuggestionHooks?.beforeDrop(name);
|
|
4595
4519
|
await core.analysisRebuild.abandon(name);
|
|
4596
4520
|
if (changeRecorded()) await abandonChange();
|
|
4597
4521
|
await core.orchestrator.closeIndex(name);
|
|
@@ -4609,6 +4533,7 @@ async function dropEngineIndex(core, name) {
|
|
|
4609
4533
|
core.analysisRebuild.clearStale(name);
|
|
4610
4534
|
if (entry.sync !== null) emitSyncChange(core.indexRegistry, { kind: "dropped", indexName: name });
|
|
4611
4535
|
});
|
|
4536
|
+
await core.querySuggestionHooks?.afterDrop(name);
|
|
4612
4537
|
await runLifecycleHook(core, "onIndexDrop", { indexName: name, config: entry.config });
|
|
4613
4538
|
}
|
|
4614
4539
|
function registerEngineEmbeddingAdapter(core, name, adapter) {
|
|
@@ -6347,7 +6272,7 @@ async function dropEngineIndex2(core, name) {
|
|
|
6347
6272
|
// src/engine/sync-epoch.ts
|
|
6348
6273
|
async function holdSyncEpochChange(core, indexName) {
|
|
6349
6274
|
if ((core.indexRegistry.get(indexName)?.sync ?? null) === null) return () => void 0;
|
|
6350
|
-
return (await import('./operations-
|
|
6275
|
+
return (await import('./operations-G5EP6JPX.mjs')).holdRenewedSyncEpoch(core, indexName);
|
|
6351
6276
|
}
|
|
6352
6277
|
async function withRenewedSyncEpoch(core, indexName, change) {
|
|
6353
6278
|
const release = await holdSyncEpochChange(core, indexName);
|
|
@@ -6476,7 +6401,23 @@ function portabilityOperations(core, config, engine) {
|
|
|
6476
6401
|
release();
|
|
6477
6402
|
}
|
|
6478
6403
|
}
|
|
6479
|
-
|
|
6404
|
+
function queueRestore(indexName, data) {
|
|
6405
|
+
const { restoresInFlight } = core;
|
|
6406
|
+
const previous = restoresInFlight.get(indexName) ?? Promise.resolve();
|
|
6407
|
+
const restored = previous.then(async () => {
|
|
6408
|
+
const { runRestore } = await import('./restore-queue-JVGENGGE.mjs');
|
|
6409
|
+
await runRestore(core, restoreHost, indexName, data, engine());
|
|
6410
|
+
});
|
|
6411
|
+
const settled2 = restored.then(
|
|
6412
|
+
() => void 0,
|
|
6413
|
+
() => void 0
|
|
6414
|
+
);
|
|
6415
|
+
restoresInFlight.set(indexName, settled2);
|
|
6416
|
+
void settled2.then(() => {
|
|
6417
|
+
if (restoresInFlight.get(indexName) === settled2) restoresInFlight.delete(indexName);
|
|
6418
|
+
});
|
|
6419
|
+
return restored;
|
|
6420
|
+
}
|
|
6480
6421
|
const restoreHost = {
|
|
6481
6422
|
getVectorFieldPaths,
|
|
6482
6423
|
announceIndexCreated: (name, restoredConfig) => announceIndexCreated(core, name, restoredConfig),
|
|
@@ -6493,26 +6434,23 @@ function portabilityOperations(core, config, engine) {
|
|
|
6493
6434
|
};
|
|
6494
6435
|
}
|
|
6495
6436
|
return {
|
|
6496
|
-
snapshot(indexName) {
|
|
6437
|
+
snapshot(indexName, options) {
|
|
6497
6438
|
return withOpenIndex2(indexName, async () => {
|
|
6498
|
-
const { createSnapshot } = await import('./snapshot-
|
|
6499
|
-
return createSnapshot(snapshotDepsOf(indexName));
|
|
6439
|
+
const { createSnapshot } = await import('./snapshot-4HS2G2UM.mjs');
|
|
6440
|
+
return createSnapshot(snapshotDepsOf(indexName), options?.queryHistory === true ? core : null);
|
|
6500
6441
|
});
|
|
6501
6442
|
},
|
|
6502
6443
|
async restore(indexName, data) {
|
|
6503
6444
|
core.guardShutdown();
|
|
6504
6445
|
validateIndexName(indexName);
|
|
6505
|
-
|
|
6506
|
-
({ queueRestore }) => queueRestore(core, restoreHost, restoresInFlight, indexName, data)
|
|
6507
|
-
);
|
|
6508
|
-
await emitWriteEventAfter(core, indexName, restored);
|
|
6446
|
+
await emitWriteEventAfter(core, indexName, queueRestore(indexName, data));
|
|
6509
6447
|
core.heapPressureNotifier.check(indexName);
|
|
6510
6448
|
},
|
|
6511
6449
|
exportDocuments(indexName) {
|
|
6512
6450
|
return withOpenIndex2(indexName, async () => {
|
|
6513
6451
|
const [{ checkpointForArchive }, { documentExportStream }] = await Promise.all([
|
|
6514
|
-
import('./snapshot-
|
|
6515
|
-
import('./write-
|
|
6452
|
+
import('./snapshot-4HS2G2UM.mjs'),
|
|
6453
|
+
import('./write-GTTWWRRG.mjs')
|
|
6516
6454
|
]);
|
|
6517
6455
|
const header = indexConfigurationOf(core.requireIndex(indexName));
|
|
6518
6456
|
return documentExportStream(header, await checkpointForArchive(snapshotDepsOf(indexName)));
|
|
@@ -6520,7 +6458,7 @@ function portabilityOperations(core, config, engine) {
|
|
|
6520
6458
|
},
|
|
6521
6459
|
importDocumentExport(indexName, data) {
|
|
6522
6460
|
core.guardShutdown();
|
|
6523
|
-
const imported = import('./import-
|
|
6461
|
+
const imported = import('./import-NBFXFCSG.mjs').then(
|
|
6524
6462
|
({ readDocumentExport }) => readDocumentExport(engine(), indexName, data)
|
|
6525
6463
|
);
|
|
6526
6464
|
return emitWriteEventAfter(core, indexName, imported);
|
|
@@ -6631,7 +6569,7 @@ async function runEngineQuery(core, indexName, params, options) {
|
|
|
6631
6569
|
const manager = core.requireManager(indexName);
|
|
6632
6570
|
const scoped = scopedParams(params, options);
|
|
6633
6571
|
await core.pluginRegistry.runHook("beforeSearch", { indexName, params: scoped });
|
|
6634
|
-
const rerank = scoped.rerank === void 0 ? void 0 : await import('./runtime-
|
|
6572
|
+
const rerank = scoped.rerank === void 0 ? void 0 : await import('./runtime-COIUORCN.mjs');
|
|
6635
6573
|
const resolvedParams = await resolveVectorText(
|
|
6636
6574
|
rerank === void 0 ? scoped : rerank.withRerankQueryText(scoped),
|
|
6637
6575
|
entry.embeddingAdapter,
|
|
@@ -6781,8 +6719,8 @@ async function runEngineListDocuments(core, indexName, params, partitionIds) {
|
|
|
6781
6719
|
// src/narsil/sync.ts
|
|
6782
6720
|
function syncOperations(core) {
|
|
6783
6721
|
return {
|
|
6784
|
-
updateSync: async (indexName, setting) => (await import('./methods-
|
|
6785
|
-
getSync: async (indexName) => (await import('./methods-
|
|
6722
|
+
updateSync: async (indexName, setting) => (await import('./methods-7IOINERF.mjs')).updateSyncOf(core, indexName, setting),
|
|
6723
|
+
getSync: async (indexName) => (await import('./methods-7IOINERF.mjs')).syncOf(core, indexName)
|
|
6786
6724
|
};
|
|
6787
6725
|
}
|
|
6788
6726
|
|
|
@@ -6964,7 +6902,7 @@ function createNarsilFromCore(core, config) {
|
|
|
6964
6902
|
const entry = requireIndex(indexName);
|
|
6965
6903
|
await withOpenIndexWrite(indexName, async () => {
|
|
6966
6904
|
if (entry.pendingAnalysis === null) return core.analysisRebuild.rebuild(indexName);
|
|
6967
|
-
return (await import('./analysis-change-
|
|
6905
|
+
return (await import('./analysis-change-3TFIHT5E.mjs')).resumeAnalysisChange(core, indexName);
|
|
6968
6906
|
});
|
|
6969
6907
|
},
|
|
6970
6908
|
async changeAnalysis(indexName, change) {
|
|
@@ -6972,7 +6910,7 @@ function createNarsilFromCore(core, config) {
|
|
|
6972
6910
|
requireIndex(indexName);
|
|
6973
6911
|
const changed = withOpenIndex2(
|
|
6974
6912
|
indexName,
|
|
6975
|
-
async () => (await import('./analysis-change-
|
|
6913
|
+
async () => (await import('./analysis-change-3TFIHT5E.mjs')).changeIndexAnalysis(core, indexName, change)
|
|
6976
6914
|
);
|
|
6977
6915
|
await emitWriteEventAfter(core, indexName, changed);
|
|
6978
6916
|
},
|
|
@@ -7007,7 +6945,7 @@ function createNarsilFromCore(core, config) {
|
|
|
7007
6945
|
const rebalanced = withOpenIndex2(
|
|
7008
6946
|
indexName,
|
|
7009
6947
|
() => withRenewedSyncEpoch(core, indexName, async () => {
|
|
7010
|
-
const { executeRebalance } = await import('./analysis-change-
|
|
6948
|
+
const { executeRebalance } = await import('./analysis-change-3TFIHT5E.mjs');
|
|
7011
6949
|
const running = executeRebalance(requireManager(indexName), indexName, targetPartitionCount, rebalanceCtx);
|
|
7012
6950
|
releaseWrites();
|
|
7013
6951
|
await running;
|
|
@@ -7129,10 +7067,14 @@ async function createNarsil(config) {
|
|
|
7129
7067
|
const runnableConfig = await resolveRunnableConfig(config);
|
|
7130
7068
|
const core = await createEngineCore(runnableConfig);
|
|
7131
7069
|
await startEngineCore(core, runnableConfig);
|
|
7132
|
-
|
|
7070
|
+
const engine = createNarsilFromCore(core, runnableConfig);
|
|
7071
|
+
if (runnableConfig?.querySuggestions !== void 0 || core.durability !== null) {
|
|
7072
|
+
await (await import('./engine-hooks-DHCMOADY.mjs')).startQuerySuggestions(core, engine, runnableConfig);
|
|
7073
|
+
}
|
|
7074
|
+
return engine;
|
|
7133
7075
|
}
|
|
7134
7076
|
|
|
7135
7077
|
// src/index.ts
|
|
7136
7078
|
var VERSION = "0.1.0";
|
|
7137
7079
|
|
|
7138
|
-
export { DEFAULT_WRITE_AHEAD_QUEUE_MAX_SIZE, REBALANCE_CHUNK_SIZE, VERSION, applyStoredIndexBm25, arrayPositionsAreStale, bindRerankWindowSource, createEngineCore, createEngineIndex, createMemoryMonitor, createNarsil, createNarsilFromCore, deleteNestedValue, emitEngineEvent, emptySerializablePartition, encodeIndexConfiguration, engineCoreOf, engineVersionParts, extractVectorFromDoc, holdSyncEpochChange, insertDocumentVectors, memoryFractionsOf, packChecksummedEnvelope, packEnvelopeWithChecksum, prepareConfiguredSynonyms, prepareDocumentVectors, prepareStoredSynonyms, providedDocId, rebuildTextIndexes, reconstructSchemaFromMetadata, removeDocumentVectors, requireConfigurationWithinSizeLimit, requireKnownConfig, rerankWindowCapOf, resolveRunnableConfig, resolveVectorText, rewriteSpillOf, rulesOfStoredSynonyms, runEngineListDocuments, runEnginePreflight, runEngineQuery, runEngineQueryStats, runEngineSuggest, startEngineCore, storedArrayPositionGap, textRebuildTargetOf, toError2 as toError, validateEmbeddingConfig, validateMemoryFractions, validateRequiredFieldsInSchema, vectorsEqual, yieldToEventLoop };
|
|
7080
|
+
export { DEFAULT_WRITE_AHEAD_QUEUE_MAX_SIZE, REBALANCE_CHUNK_SIZE, VERSION, applyStoredIndexBm25, arrayPositionsAreStale, bindRerankWindowSource, createEngineCore, createEngineIndex, createMemoryMonitor, createNarsil, createNarsilFromCore, deleteNestedValue, dropEngineIndex, emitEngineEvent, emitWriteEventAfter, emptySerializablePartition, encodeIndexConfiguration, engineCoreOf, engineVersionParts, extractVectorFromDoc, holdSyncEpochChange, insertDocumentVectors, memoryFractionsOf, packChecksummedEnvelope, packEnvelopeWithChecksum, prepareConfiguredSynonyms, prepareDocumentVectors, prepareStoredSynonyms, providedDocId, rebuildTextIndexes, reconstructSchemaFromMetadata, removeDocumentBatch2 as removeDocumentBatch, removeDocumentVectors, requireConfigurationWithinSizeLimit, requireKnownConfig, rerankWindowCapOf, resolveRunnableConfig, resolveVectorText, rewriteSpillOf, rulesOfStoredSynonyms, runEngineListDocuments, runEnginePreflight, runEngineQuery, runEngineQueryStats, runEngineSuggest, startEngineCore, storedArrayPositionGap, textRebuildTargetOf, toError2 as toError, validateEmbeddingConfig, validateMemoryFractions, validateRequiredFieldsInSchema, vectorsEqual, yieldToEventLoop };
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { QUERY_HISTORY_FOLDER, RESTORED_HISTORY_FOLDER, RESTORE_STAGING_INFIX, MAX_HISTORY_FILE_BYTES } from './chunk-5YNRKI2C.mjs';
|
|
2
|
+
|
|
3
|
+
// src/query-suggestions/history-files.ts
|
|
4
|
+
var BUILD_RECORD_FILE = "build.nrsl";
|
|
5
|
+
var DAY_FILE = /^(\d{4}-\d{2}-\d{2})\.nrsl$/;
|
|
6
|
+
var RESTORED_FILE = /^(\d{4}-\d{2}-\d{2})-(\d{4})\.nrsl$/;
|
|
7
|
+
function historyFolderOf(indexName) {
|
|
8
|
+
return `${QUERY_HISTORY_FOLDER}/${indexName}/`;
|
|
9
|
+
}
|
|
10
|
+
function dayFileKey(indexName, day) {
|
|
11
|
+
return `${historyFolderOf(indexName)}${day}.nrsl`;
|
|
12
|
+
}
|
|
13
|
+
function restoredFileKey(indexName, day, sequence) {
|
|
14
|
+
return `${historyFolderOf(indexName)}${RESTORED_HISTORY_FOLDER}/${day}-${String(sequence).padStart(4, "0")}.nrsl`;
|
|
15
|
+
}
|
|
16
|
+
function buildRecordKey(indexName) {
|
|
17
|
+
return `${historyFolderOf(indexName)}${BUILD_RECORD_FILE}`;
|
|
18
|
+
}
|
|
19
|
+
function historyFileOf(indexName, key) {
|
|
20
|
+
const folder = historyFolderOf(indexName);
|
|
21
|
+
if (!key.startsWith(folder)) return null;
|
|
22
|
+
const rest = key.slice(folder.length);
|
|
23
|
+
const own = DAY_FILE.exec(rest);
|
|
24
|
+
if (own !== null) return { key, day: own[1], restored: false };
|
|
25
|
+
const restoredPrefix = `${RESTORED_HISTORY_FOLDER}/`;
|
|
26
|
+
if (!rest.startsWith(restoredPrefix)) return null;
|
|
27
|
+
const restored = RESTORED_FILE.exec(rest.slice(restoredPrefix.length));
|
|
28
|
+
return restored === null ? null : { key, day: restored[1], restored: true };
|
|
29
|
+
}
|
|
30
|
+
function directoryFiles(storage) {
|
|
31
|
+
const { directory } = storage;
|
|
32
|
+
return {
|
|
33
|
+
listUnder: (prefix) => directory.list(prefix),
|
|
34
|
+
async read(key) {
|
|
35
|
+
const length = await directory.byteLength?.(key) ?? null;
|
|
36
|
+
if (length !== null && length > MAX_HISTORY_FILE_BYTES) return "too-long";
|
|
37
|
+
const bytes = await directory.read(key);
|
|
38
|
+
if (bytes !== null && bytes.byteLength > MAX_HISTORY_FILE_BYTES) return "too-long";
|
|
39
|
+
return bytes;
|
|
40
|
+
},
|
|
41
|
+
write: (key, bytes) => directory.atomicWrite(key, bytes),
|
|
42
|
+
remove: (key) => directory.remove(key)
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
function adapterFiles(storage) {
|
|
46
|
+
const { adapter } = storage;
|
|
47
|
+
return {
|
|
48
|
+
listUnder: (prefix) => adapter.list(prefix),
|
|
49
|
+
async read(key) {
|
|
50
|
+
const bytes = await adapter.load(key);
|
|
51
|
+
if (bytes !== null && bytes.byteLength > MAX_HISTORY_FILE_BYTES) return "too-long";
|
|
52
|
+
return bytes;
|
|
53
|
+
},
|
|
54
|
+
write: (key, bytes) => adapter.save(key, bytes),
|
|
55
|
+
remove: (key) => adapter.delete(key)
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
function memoryFiles() {
|
|
59
|
+
const files = /* @__PURE__ */ new Map();
|
|
60
|
+
return {
|
|
61
|
+
async listUnder(prefix) {
|
|
62
|
+
return [...files.keys()].filter((key) => key.startsWith(prefix)).sort();
|
|
63
|
+
},
|
|
64
|
+
async read(key) {
|
|
65
|
+
return files.get(key) ?? null;
|
|
66
|
+
},
|
|
67
|
+
async write(key, bytes) {
|
|
68
|
+
files.set(key, bytes);
|
|
69
|
+
},
|
|
70
|
+
async remove(key) {
|
|
71
|
+
files.delete(key);
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
function historyFilesOf(storage) {
|
|
76
|
+
if (storage === null) return memoryFiles();
|
|
77
|
+
return storage.kind === "directory" ? directoryFiles(storage) : adapterFiles(storage);
|
|
78
|
+
}
|
|
79
|
+
function listHistoryFolder(files, indexName) {
|
|
80
|
+
return files.listUnder(historyFolderOf(indexName));
|
|
81
|
+
}
|
|
82
|
+
async function removeHistoryFolder(files, indexName) {
|
|
83
|
+
for (const key of await listHistoryFolder(files, indexName)) await files.remove(key);
|
|
84
|
+
}
|
|
85
|
+
function restoreStagingPrefix() {
|
|
86
|
+
return `${QUERY_HISTORY_FOLDER}/${RESTORE_STAGING_INFIX}${globalThis.crypto.randomUUID()}/`;
|
|
87
|
+
}
|
|
88
|
+
async function removeRestoreLeftovers(files) {
|
|
89
|
+
for (const key of await files.listUnder(`${QUERY_HISTORY_FOLDER}/${RESTORE_STAGING_INFIX}`)) await files.remove(key);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export { buildRecordKey, dayFileKey, historyFileOf, historyFilesOf, historyFolderOf, listHistoryFolder, removeHistoryFolder, removeRestoreLeftovers, restoreStagingPrefix, restoredFileKey };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { RESTORE_ESTIMATE_MARGIN, RESTORE_WORST_EXTERNAL_BYTES_PER_VECTOR_DIMENSION, RESTORE_WORST_EXTERNAL_BYTES_PER_VECTOR, RESTORE_WORST_EXTERNAL_BYTES_PER_STORED_BYTE, RESTORE_WORST_HEAP_BYTES_PER_VECTOR_DIMENSION, RESTORE_WORST_HEAP_BYTES_PER_VECTOR, RESTORE_WORST_HEAP_BYTES_PER_STORED_BYTE, RESTORE_FLOOR_EXTERNAL_BYTES_PER_VECTOR_DIMENSION, RESTORE_FLOOR_EXTERNAL_BYTES_PER_VECTOR, RESTORE_FLOOR_EXTERNAL_BYTES_PER_STORED_BYTE, RESTORE_FLOOR_HEAP_BYTES_PER_VECTOR_DIMENSION, RESTORE_FLOOR_HEAP_BYTES_PER_VECTOR, RESTORE_FLOOR_HEAP_BYTES_PER_STORED_BYTE, RESTORE_WORST_EXTERNAL_BYTES_PER_EARLIER_SNAPSHOT_VECTOR_DIMENSION, RESTORE_WORST_EXTERNAL_BYTES_PER_EARLIER_SNAPSHOT_VECTOR, RESTORE_WORST_EXTERNAL_BYTES_PER_EARLIER_SNAPSHOT_BYTE, RESTORE_WORST_HEAP_BYTES_PER_EARLIER_SNAPSHOT_VECTOR_DIMENSION, RESTORE_WORST_HEAP_BYTES_PER_EARLIER_SNAPSHOT_VECTOR, RESTORE_WORST_HEAP_BYTES_PER_EARLIER_SNAPSHOT_BYTE, RESTORE_FLOOR_EXTERNAL_BYTES_PER_EARLIER_SNAPSHOT_VECTOR_DIMENSION, RESTORE_FLOOR_EXTERNAL_BYTES_PER_EARLIER_SNAPSHOT_VECTOR, RESTORE_FLOOR_EXTERNAL_BYTES_PER_EARLIER_SNAPSHOT_BYTE, RESTORE_FLOOR_HEAP_BYTES_PER_EARLIER_SNAPSHOT_VECTOR_DIMENSION, RESTORE_FLOOR_HEAP_BYTES_PER_EARLIER_SNAPSHOT_VECTOR, RESTORE_FLOOR_HEAP_BYTES_PER_EARLIER_SNAPSHOT_BYTE } from './chunk-ZYAY26KG.mjs';
|
|
2
|
-
import { readResidentMemory } from './chunk-
|
|
2
|
+
import { readResidentMemory } from './chunk-ZAUJFLEN.mjs';
|
|
3
3
|
import { readHeapStatistics } from './chunk-IPN7S4KX.mjs';
|
|
4
|
+
import { extractVectorFieldsFromSchema } from './chunk-WQRN64Q6.mjs';
|
|
4
5
|
import { collectAndReturnPages } from './chunk-QYRNLLLI.mjs';
|
|
5
|
-
import {
|
|
6
|
-
import { NarsilError, ErrorCodes } from './chunk-KUZKUONM.mjs';
|
|
6
|
+
import { NarsilError, ErrorCodes } from './chunk-MP7ABPTD.mjs';
|
|
7
7
|
|
|
8
8
|
// src/engine/snapshot/memory-budget.ts
|
|
9
9
|
var MEGABYTE_BYTES = 1048576;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { removeDocumentVectors, prepareDocumentVectors, insertDocumentVectors } from './chunk-
|
|
2
|
-
import { getNestedValue } from './chunk-
|
|
3
|
-
import { requireValidFieldTypes } from './chunk-
|
|
1
|
+
import { removeDocumentVectors, prepareDocumentVectors, insertDocumentVectors } from './chunk-KMUNHGBQ.mjs';
|
|
2
|
+
import { getNestedValue } from './chunk-4KRC2APY.mjs';
|
|
3
|
+
import { requireValidFieldTypes } from './chunk-WQRN64Q6.mjs';
|
|
4
4
|
import { VECTOR_PATTERN } from './chunk-L5ORED7V.mjs';
|
|
5
|
-
import { ErrorCodes, NarsilError } from './chunk-
|
|
5
|
+
import { ErrorCodes, NarsilError } from './chunk-MP7ABPTD.mjs';
|
|
6
6
|
import { decode } from '@msgpack/msgpack';
|
|
7
7
|
|
|
8
8
|
function validateReplicationEntry(entry, localPrimaryTerm, log) {
|