@delali/narsil 0.3.1-next.153 → 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 +3 -1
- 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-2OYM7ARW.mjs → analysis-change-3TFIHT5E.mjs} +32 -23
- package/dist/{react-native/chunks/analysis-change-entry-CXNRW324.mjs → analysis-change-entry-KA6JAO4X.mjs} +1 -1
- package/dist/archive-history-E4R73RWD.mjs +29 -0
- package/dist/browser/{analysis-change-2V2HZ2NY.mjs → analysis-change-TC36BU47.mjs} +39 -10
- package/dist/{analysis-change-entry-QD7YNDEE.mjs → browser/analysis-change-entry-4MH3CZXH.mjs} +1 -1
- package/dist/browser/archive-history-4IP5XQZY.mjs +29 -0
- package/dist/browser/chunk-23XRXIBW.mjs +85 -0
- package/dist/browser/chunk-3UIEB4QF.mjs +63 -0
- package/dist/browser/{chunk-CSCKZBVJ.mjs → chunk-4EWUGZYZ.mjs} +4 -4
- package/dist/browser/chunk-4WCVMOU3.mjs +151 -0
- package/dist/browser/{chunk-QJCO3TJU.mjs → chunk-56W3HQVJ.mjs} +9 -150
- package/dist/{react-native/chunks/chunk-VGUWIZFQ.mjs → browser/chunk-5TCXK5SB.mjs} +2 -2
- package/dist/browser/chunk-5W3MMTLG.mjs +19 -0
- package/dist/browser/chunk-7IGKGWSQ.mjs +79 -0
- package/dist/browser/chunk-A5KUEGDY.mjs +241 -0
- package/dist/browser/{chunk-HT7J73QL.mjs → chunk-ABCXENU5.mjs} +2 -2
- package/dist/browser/chunk-ATEBYXP6.mjs +10 -0
- package/dist/browser/chunk-BXM5XOCA.mjs +315 -0
- package/dist/browser/chunk-CJSYBQ4J.mjs +100 -0
- package/dist/browser/chunk-DSXIBE6N.mjs +78 -0
- package/dist/browser/chunk-ELV4OZOI.mjs +29 -0
- package/dist/{react-native/chunks/chunk-QC4ZRBSX.mjs → browser/chunk-EXQZGUQH.mjs} +2 -79
- package/dist/browser/{chunk-2A2IPRC3.mjs → chunk-FNIFPFB7.mjs} +5 -31
- package/dist/browser/chunk-G64Q6OJF.mjs +96 -0
- package/dist/browser/chunk-GPPOG6PT.mjs +9 -0
- package/dist/browser/chunk-IKDKX5VQ.mjs +1007 -0
- package/dist/browser/chunk-JIJXMI42.mjs +1829 -0
- package/dist/browser/chunk-JVBP5EYO.mjs +1106 -0
- package/dist/browser/{chunk-TQ5UMFG5.mjs → chunk-K4GCSZLI.mjs} +15 -6
- package/dist/browser/{chunk-PM4MUM5N.mjs → chunk-K5AXJBLL.mjs} +6 -5
- package/dist/browser/chunk-KKAMCABR.mjs +432 -0
- package/dist/browser/{chunk-IAXZAVYL.mjs → chunk-LFIWRCEA.mjs} +1 -159
- package/dist/browser/chunk-M3MQE2X7.mjs +151 -0
- package/dist/browser/chunk-ML7THVLJ.mjs +38 -0
- package/dist/browser/chunk-NLWTBAGB.mjs +111 -0
- package/dist/browser/chunk-OEDCEZXJ.mjs +92 -0
- package/dist/browser/{chunk-MPK76GVS.mjs → chunk-RA6LSBCM.mjs} +1 -21
- package/dist/browser/{chunk-GJKXW3SF.mjs → chunk-RND5CLX3.mjs} +147 -253
- package/dist/{react-native/chunks/chunk-DFQJ4IJB.mjs → browser/chunk-RQBUNZQW.mjs} +2 -2
- package/dist/browser/{chunk-VD7JEUIR.mjs → chunk-RRO3EV4C.mjs} +9 -8
- package/dist/browser/{chunk-KWYQ6KX4.mjs → chunk-SMEQ36NT.mjs} +162 -2019
- package/dist/{chunk-MDF6PDIA.mjs → browser/chunk-SRMZXJSL.mjs} +8 -1
- package/dist/browser/{chunk-7ZJTRUVW.mjs → chunk-SUDNZKPL.mjs} +2 -2
- package/dist/browser/{chunk-LURXVCHG.mjs → chunk-U3JOQGWX.mjs} +1 -1
- package/dist/browser/chunk-VI7BQR4U.mjs +21 -0
- package/dist/browser/{chunk-B3JM6Z74.mjs → chunk-XY4VVBBO.mjs} +3 -2
- package/dist/browser/chunk-YJHGOJAC.mjs +15 -0
- package/dist/browser/chunk-ZI2V4VD7.mjs +21 -0
- package/dist/browser/{cold-module-YECAK4MN.mjs → cold-module-NEUGHUPA.mjs} +21 -14
- package/dist/browser/durability-config-TIYKW6XX.mjs +89 -0
- package/dist/browser/{durability-wiring-LM7WFL6X.mjs → durability-wiring-CVGPRO6D.mjs} +1299 -881
- package/dist/browser/engine-hooks-YXMPHZKZ.mjs +16 -0
- package/dist/browser/import-OM6QAW45.mjs +18 -0
- package/dist/browser/methods-KTQCSIN4.mjs +30 -0
- package/dist/browser/{module-XQLEOYNM.mjs → module-3HNFCBJ5.mjs} +10 -8
- package/dist/browser/{module-KAMRAJLE.mjs → module-E33X4AOK.mjs} +17 -10
- package/dist/browser/operations-OJ3BXS55.mjs +5 -0
- package/dist/browser/{phrase-module-CNKMUY4U.mjs → phrase-module-ZXXU7S3B.mjs} +1 -1
- package/dist/browser/{pool-DTYSPBMQ.mjs → pool-3JLET5RO.mjs} +3 -2
- package/dist/browser/restore-hooks-IF2ZROUP.mjs +113 -0
- package/dist/browser/restore-queue-ZBS7CJA6.mjs +55 -0
- package/dist/browser/retention-ASWUHAYI.mjs +209 -0
- package/dist/browser/{runtime-D2ULZGCN.mjs → runtime-OTAGEFQW.mjs} +1 -1
- package/dist/browser/{snapshot-UGZVMP4H.mjs → snapshot-PN7ZW6Q4.mjs} +80 -315
- package/dist/browser/start-ZIRB7MQ2.mjs +24 -0
- package/dist/browser/sync-state-P5XG6LTQ.mjs +15 -0
- package/dist/browser/{write-I5P5MW4O.mjs → write-HMDYCTV2.mjs} +17 -11
- package/dist/{capabilities-BT-HLDC8.d.ts → capabilities-Da4ywVVl.d.ts} +94 -7
- package/dist/{chunk-LDGGR7YT.mjs → chunk-2MANFZJ3.mjs} +2 -2
- package/dist/{chunk-IZT3G24Q.mjs → chunk-2NE7VCYE.mjs} +2 -2
- package/dist/{chunk-3TVDTACC.mjs → chunk-3C7MTCCI.mjs} +1 -1
- package/dist/chunk-3HB3PEC6.mjs +240 -0
- package/dist/chunk-3HHQLEEQ.mjs +1092 -0
- package/dist/chunk-3OH67G7R.mjs +214 -0
- package/dist/{chunk-ZS6CMXAE.mjs → chunk-3R4UZWQG.mjs} +98 -250
- package/dist/{chunk-65WCV5JO.mjs → chunk-4BYWRYPM.mjs} +1 -1
- package/dist/{chunk-SOUZMPME.mjs → chunk-4KRC2APY.mjs} +7 -194
- package/dist/{chunk-5QMHMELB.mjs → chunk-5FLRXF73.mjs} +8 -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-6MSZ543Y.mjs +32 -0
- package/dist/{chunk-T4CJDBBE.mjs → chunk-6OEGXLBX.mjs} +1 -1
- package/dist/{chunk-3SBJVQLL.mjs → chunk-6RC4K46J.mjs} +2 -2
- package/dist/chunk-7GXJUJ24.mjs +49 -0
- package/dist/{chunk-FNBNZCGP.mjs → chunk-AILVAOLX.mjs} +2 -2
- package/dist/chunk-BDRIVYOK.mjs +72 -0
- package/dist/chunk-BUMREPLU.mjs +15 -0
- package/dist/chunk-BY6ZDGYS.mjs +50 -0
- package/dist/{chunk-5WB2A3XU.mjs → chunk-DCNKVEDB.mjs} +511 -27
- package/dist/{chunk-NITCPDFL.mjs → chunk-DIBHI6W5.mjs} +2 -2
- package/dist/{chunk-4QCSHLNM.mjs → chunk-DUOLGBTE.mjs} +3 -3
- package/dist/chunk-GES7U2PM.mjs +68 -0
- package/dist/chunk-GH4WQ22V.mjs +34 -0
- package/dist/chunk-GQPTDQCL.mjs +54 -0
- package/dist/chunk-H4KHPLHJ.mjs +382 -0
- package/dist/{chunk-7TE2AJIH.mjs → chunk-H6VIGE62.mjs} +13 -10
- package/dist/{chunk-J7M73VY7.mjs → chunk-HJJI72X7.mjs} +1 -1
- package/dist/{chunk-DGRM4EZZ.mjs → chunk-HNVVEQP7.mjs} +1 -1
- package/dist/{chunk-RBEHLIKX.mjs → chunk-HW5TNXBO.mjs} +35 -11
- package/dist/{chunk-KYVRZAYP.mjs → chunk-I54T6CQP.mjs} +2 -69
- package/dist/{chunk-IRWP524D.mjs → chunk-INJYO3BU.mjs} +1 -1
- package/dist/chunk-IPN7S4KX.mjs +130 -0
- package/dist/{chunk-CSHHU7PA.mjs → chunk-J4IWBIVY.mjs} +11 -30
- package/dist/{chunk-G5KHSM6E.mjs → chunk-K4ZIGL2O.mjs} +1 -1
- package/dist/{chunk-6RKSY3BX.mjs → chunk-KBDBPVLN.mjs} +5 -5
- package/dist/{chunk-J4BDAH2W.mjs → chunk-KBKEXQZA.mjs} +2 -2
- package/dist/{chunk-IJSFWGVW.mjs → chunk-KFLK5NA2.mjs} +3 -3
- package/dist/{chunk-YGQOPB2Z.mjs → chunk-KHKIRS5D.mjs} +1 -1
- package/dist/chunk-KJ3RTZDJ.mjs +101 -0
- package/dist/{chunk-2PNYKG2D.mjs → chunk-KMUNHGBQ.mjs} +139 -432
- package/dist/chunk-KP7TYHWT.mjs +92 -0
- package/dist/{chunk-VP6XRMWR.mjs → chunk-KPIV4RUC.mjs} +6 -32
- package/dist/{chunk-NPXVQS33.mjs → chunk-KXCVQWOR.mjs} +4 -3
- package/dist/chunk-KYYABCSW.mjs +72 -0
- package/dist/{chunk-6F6USYII.mjs → chunk-L7ZD4L3K.mjs} +267 -265
- package/dist/{chunk-U46IZNCW.mjs → chunk-LC3FDWTX.mjs} +3 -2
- package/dist/{chunk-6BWLDLS3.mjs → chunk-LHKOSI2J.mjs} +1 -1
- package/dist/chunk-LNGE7SLY.mjs +151 -0
- package/dist/{react-native/chunks/chunk-YH7W556M.mjs → chunk-MP7ABPTD.mjs} +12 -2
- package/dist/chunk-MT2NRTA6.mjs +216 -0
- package/dist/chunk-NF4DT3IH.mjs +85 -0
- package/dist/{chunk-POUYICOU.mjs → chunk-OIJ64LGT.mjs} +1 -1
- package/dist/{chunk-SEAJS664.mjs → chunk-PCRA7HTI.mjs} +5 -5
- package/dist/chunk-PHQNACDT.mjs +63 -0
- package/dist/chunk-Q622CTMC.mjs +74 -0
- package/dist/{chunk-NVTFQFUL.mjs → chunk-Q7G3BV3Y.mjs} +1 -1
- package/dist/chunk-QDZJM7NI.mjs +23 -0
- package/dist/{chunk-52QQWEBS.mjs → chunk-QH3YIQP4.mjs} +36 -7
- package/dist/chunk-QJVOLKU6.mjs +111 -0
- package/dist/chunk-QUJHMPTP.mjs +30 -0
- package/dist/{chunk-3E4RRF5J.mjs → chunk-RSVULW4Q.mjs} +100 -8
- package/dist/{chunk-IJPK5PGM.mjs → chunk-RVGRFOGN.mjs} +1 -1
- package/dist/chunk-RZWWB2XR.mjs +96 -0
- package/dist/{chunk-KQJVNPRM.mjs → chunk-S2EQU2GE.mjs} +19 -16
- package/dist/chunk-S5LN746F.mjs +10 -0
- package/dist/{chunk-LJ4ENXOD.mjs → chunk-SG3JBNHY.mjs} +2 -2
- package/dist/{chunk-B2FTZNNF.mjs → chunk-SMVH6JBE.mjs} +34 -14
- package/dist/chunk-SY3EWKQY.mjs +242 -0
- package/dist/{chunk-NYSONUB7.mjs → chunk-TQXHPFWT.mjs} +1 -1
- package/dist/{chunk-ZHAXP7SD.mjs → chunk-U4BS74YN.mjs} +26 -238
- package/dist/chunk-UHICS3JI.mjs +83 -0
- package/dist/chunk-UZRZKNNZ.mjs +101 -0
- package/dist/chunk-V6EUBAIT.mjs +19 -0
- package/dist/{chunk-TTCKT2RT.mjs → chunk-VGF7CFRP.mjs} +134 -11
- package/dist/chunk-VHBNF4MA.mjs +543 -0
- package/dist/{chunk-AWNHDBKV.mjs → chunk-VQEUR6T6.mjs} +16 -8
- package/dist/chunk-WQRN64Q6.mjs +196 -0
- package/dist/{chunk-DMNPYF54.mjs → chunk-WZ7YV54N.mjs} +2 -2
- package/dist/chunk-Y4WPNHMC.mjs +50 -0
- package/dist/{chunk-2HJWQPR6.mjs → chunk-YEDIDCR7.mjs} +6 -122
- package/dist/chunk-YEKL4JBK.mjs +96 -0
- package/dist/{chunk-UGVUW27S.mjs → chunk-Z2BE2MAM.mjs} +14 -10
- package/dist/{chunk-3HV7M5OJ.mjs → chunk-ZAUJFLEN.mjs} +11 -135
- package/dist/{chunk-FDG4KXX5.mjs → chunk-ZHCUZZE5.mjs} +6 -4
- package/dist/chunk-ZTW5WTGG.mjs +167 -0
- package/dist/chunk-ZYAY26KG.mjs +29 -0
- package/dist/{client-Cn3gNxUU.d.ts → client-DRv7UVeY.d.ts} +193 -11
- package/dist/client.d.ts +9 -7
- package/dist/client.mjs +120 -7
- package/dist/{cold-module-PYSSBIL7.mjs → cold-module-7XXCEGTZ.mjs} +43 -33
- package/dist/config-CoSig5Ox.d.ts +482 -0
- package/dist/{config-CfhH1IWQ.d.ts → config-DMwffLKn.d.ts} +20 -5
- package/dist/{direct-executor-WYALQSMD.mjs → direct-executor-G5TK7NLA.mjs} +18 -13
- 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 +41 -9
- package/dist/distribution.mjs +9304 -7271
- package/dist/durability-config-GE4U7MCZ.mjs +89 -0
- package/dist/{durability-wiring-7VBZEJLG.mjs → durability-wiring-NCKUC5EO.mjs} +1293 -872
- package/dist/embeddings/openai.mjs +2 -2
- package/dist/{config-aIsy7mcL.d.ts → engine-CFxPYqEk.d.ts} +716 -407
- package/dist/engine-hooks-DHCMOADY.mjs +47 -0
- package/dist/{import-GJOMB2HC.mjs → import-NBFXFCSG.mjs} +32 -24
- package/dist/{index-MsF7e5hL.d.ts → index-C4AmUnl1.d.ts} +1 -1
- package/dist/index.browser.mjs +9 -4
- package/dist/index.d.ts +7 -6
- package/dist/index.mjs +29 -21
- package/dist/index.react-native.mjs +19 -12
- package/dist/{long-query-thread-SCUE62TO.mjs → long-query-thread-J4DVRM4A.mjs} +33 -19
- package/dist/methods-7IOINERF.mjs +30 -0
- package/dist/{module-6RLIKSZQ.mjs → module-DWKPBSMN.mjs} +38 -28
- package/dist/{module-AVQEIB7O.mjs → module-UN76TF7I.mjs} +14 -14
- package/dist/operations-G5EP6JPX.mjs +5 -0
- package/dist/{paged-partition-archive-KGRW366Y.mjs → paged-partition-archive-DPNWVSK2.mjs} +46 -31
- package/dist/partial-words.mjs +7 -5
- package/dist/pattern.mjs +4 -3
- package/dist/persistence/durability/checkpoint-worker.d.ts +16 -1
- package/dist/persistence/durability/checkpoint-worker.mjs +40 -29
- package/dist/{phrase-module-OUQIRUQU.mjs → phrase-module-ZI4WSQVH.mjs} +1 -1
- package/dist/{pool-UPV5PVPY.mjs → pool-Y4A46T36.mjs} +2 -2
- 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-DXPZRGWF.mjs → analysis-change-6BPDPH6K.mjs} +50 -19
- package/dist/{browser/analysis-change-entry-JL5U2N3Q.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-3JIBF3XT.mjs +191 -0
- package/dist/react-native/chunks/chunk-3NQOVO3K.mjs +1 -0
- package/dist/react-native/chunks/{chunk-UFNCLEQM.mjs → chunk-4DII3ZSM.mjs} +1 -1
- package/dist/react-native/chunks/{chunk-BRNAVOKP.mjs → chunk-4J74WHQM.mjs} +2 -2
- package/dist/react-native/chunks/chunk-4LCEN2IU.mjs +315 -0
- package/dist/react-native/chunks/{chunk-PU55IOG4.mjs → chunk-4Y53T4YE.mjs} +6 -190
- 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-6WA3C3DV.mjs +85 -0
- package/dist/react-native/chunks/chunk-7GRCBBME.mjs +63 -0
- package/dist/react-native/chunks/{chunk-2J2727V4.mjs → chunk-7PXRWYUU.mjs} +1 -1
- package/dist/{browser/chunk-VBX2TI5V.mjs → react-native/chunks/chunk-ALOIBXWN.mjs} +2 -2
- package/dist/react-native/chunks/{chunk-FS7BYE23.mjs → chunk-C3PTWYKT.mjs} +10 -153
- package/dist/react-native/chunks/{chunk-DKJTZ625.mjs → chunk-C5G6TJ7A.mjs} +2 -69
- package/dist/react-native/chunks/chunk-CHPTFFJM.mjs +43 -0
- package/dist/react-native/chunks/{chunk-LRGWK367.mjs → chunk-CKNRFDTZ.mjs} +1 -1
- package/dist/react-native/chunks/chunk-CUH5F57W.mjs +242 -0
- package/dist/react-native/chunks/chunk-DIYDOIM4.mjs +10 -0
- package/dist/{browser/chunk-55WYRLDZ.mjs → react-native/chunks/chunk-DVDX4SDR.mjs} +2 -2
- package/dist/{browser/chunk-PIS7ZAP7.mjs → react-native/chunks/chunk-DZ7H7D2C.mjs} +12 -2
- package/dist/react-native/chunks/{chunk-KOCTCUXW.mjs → chunk-EIOYM5TO.mjs} +17 -9
- package/dist/react-native/chunks/chunk-F753DA54.mjs +23 -0
- package/dist/react-native/chunks/chunk-GIZTJXYW.mjs +1007 -0
- package/dist/react-native/chunks/{chunk-CLE3LZ77.mjs → chunk-GJFXPHXI.mjs} +5 -4
- package/dist/react-native/chunks/chunk-H3MDVPBO.mjs +151 -0
- package/dist/react-native/chunks/{chunk-IDFMNRIC.mjs → chunk-HUOYZJ3Q.mjs} +140 -430
- package/dist/react-native/chunks/chunk-IYNT75CE.mjs +111 -0
- package/dist/react-native/chunks/chunk-JDOEEMEF.mjs +38 -0
- package/dist/react-native/chunks/{chunk-LQAKO5QV.mjs → chunk-JLIIWJUV.mjs} +2 -2
- package/dist/react-native/chunks/chunk-JWUCMVRK.mjs +15 -0
- package/dist/react-native/chunks/chunk-KJIG57UD.mjs +1106 -0
- package/dist/react-native/chunks/{chunk-KLZGAOLT.mjs → chunk-KTTAU63H.mjs} +5 -5
- package/dist/react-native/chunks/chunk-LU3Y3P63.mjs +68 -0
- package/dist/{browser/chunk-NVEJJP4R.mjs → react-native/chunks/chunk-LZSLNSUN.mjs} +2 -79
- package/dist/react-native/chunks/{chunk-3CTWSQRW.mjs → chunk-MJDQU5MW.mjs} +4 -30
- package/dist/react-native/chunks/{chunk-NFGBOI46.mjs → chunk-MVXELMJX.mjs} +1 -1
- package/dist/react-native/chunks/{chunk-D7LFYPYI.mjs → chunk-N2WUOWLL.mjs} +12 -10
- package/dist/react-native/chunks/chunk-NVVRSRX5.mjs +78 -0
- package/dist/react-native/chunks/{chunk-JYL35A4A.mjs → chunk-OL3WDV53.mjs} +7 -33
- package/dist/react-native/chunks/chunk-PB2YXVQW.mjs +29 -0
- package/dist/react-native/chunks/{chunk-UCJU6WNH.mjs → chunk-PEHS2UO3.mjs} +7 -6
- package/dist/react-native/chunks/chunk-PJHAB5ZY.mjs +79 -0
- package/dist/react-native/chunks/chunk-Q32DDFKX.mjs +19 -0
- package/dist/react-native/chunks/chunk-QJXTNPLQ.mjs +100 -0
- package/dist/react-native/chunks/{chunk-ZCKNBPQ4.mjs → chunk-RDWG33MM.mjs} +2 -2
- package/dist/react-native/chunks/chunk-SUPXRTMD.mjs +96 -0
- package/dist/react-native/chunks/chunk-TYIRMPD3.mjs +432 -0
- package/dist/react-native/chunks/{chunk-TLYD7IJ2.mjs → chunk-U4KSKA4Z.mjs} +1 -1
- package/dist/react-native/chunks/chunk-UNUFZ2QY.mjs +68 -0
- package/dist/react-native/chunks/{chunk-7IQR3SZO.mjs → chunk-VXGE4ZXL.mjs} +151 -257
- package/dist/react-native/chunks/{chunk-R4OPUZQ5.mjs → chunk-WBYQRHDY.mjs} +2 -2
- package/dist/react-native/chunks/chunk-YH7QY657.mjs +288 -0
- package/dist/react-native/chunks/chunk-ZZT7CEN7.mjs +92 -0
- package/dist/react-native/chunks/{cold-module-KFGEWYEL.mjs → cold-module-5PHF6DZR.mjs} +31 -22
- package/dist/react-native/chunks/durability-config-QXVZEO7T.mjs +89 -0
- package/dist/react-native/chunks/{durability-wiring-QKJB2QBT.mjs → durability-wiring-KO565FZC.mjs} +1309 -889
- 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-6W5U4C3H.mjs +30 -0
- package/dist/react-native/chunks/{module-UJ5VUARS.mjs → module-H5MVPSP2.mjs} +13 -11
- package/dist/react-native/chunks/module-ZL5ZG6YB.mjs +34 -0
- package/dist/react-native/chunks/operations-GNRMD6EX.mjs +5 -0
- package/dist/react-native/chunks/{phrase-module-76UAPPSG.mjs → phrase-module-RTVKEWJT.mjs} +1 -1
- package/dist/react-native/chunks/{pool-CD4ANYUI.mjs → pool-JR3NJCAF.mjs} +3 -2
- 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-7I7UAWYK.mjs +221 -0
- package/dist/react-native/chunks/{runtime-3MCDLJAF.mjs → runtime-R5E3TB3J.mjs} +1 -1
- package/dist/react-native/chunks/{snapshot-KVBD4LRC.mjs → snapshot-EZYB6SLF.mjs} +90 -323
- package/dist/react-native/chunks/start-SHVZ72I5.mjs +36 -0
- package/dist/react-native/chunks/sync-state-PASCIHHT.mjs +15 -0
- package/dist/react-native/chunks/{write-ES5A3WUA.mjs → write-JUESXHDL.mjs} +27 -19
- package/dist/react-native/partial-words.mjs +8 -5
- package/dist/react-native/pattern.mjs +4 -3
- package/dist/react-native/query-suggestions.mjs +258 -0
- package/dist/react-native/sync.mjs +2299 -0
- package/dist/react-native/synonyms.mjs +7 -4
- package/dist/react.d.ts +11 -10
- package/dist/react.mjs +8 -1
- package/dist/{rerank-3W54N6P2.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-HROPV2QU.mjs +59 -0
- package/dist/{runtime-L2DZYY6N.mjs → runtime-COIUORCN.mjs} +5 -5
- package/dist/{schema-D33CyXCy.d.ts → schema-Jwt928nJ.d.ts} +1 -1
- package/dist/server.d.ts +119 -20
- package/dist/server.mjs +1123 -58
- package/dist/{snapshot-WMX6JCLP.mjs → snapshot-4HS2G2UM.mjs} +106 -49
- package/dist/start-UTWHGH42.mjs +59 -0
- package/dist/sync/filesystem.d.ts +30 -0
- package/dist/sync/filesystem.mjs +271 -0
- package/dist/sync/indexeddb.d.ts +30 -0
- package/dist/sync/indexeddb.mjs +237 -0
- package/dist/sync-state-ZWHLAFLE.mjs +15 -0
- package/dist/sync.browser.mjs +2294 -0
- package/dist/sync.d.ts +23 -0
- package/dist/sync.mjs +2268 -0
- package/dist/synonyms.mjs +6 -4
- package/dist/{tasks-C4ElXr4P.d.ts → tasks-qrJojgST.d.ts} +13 -5
- package/dist/thread-6MOXY2KD.mjs +45 -0
- package/dist/types-BZCGjfLn.d.ts +227 -0
- package/dist/vector/search-worker.d.ts +1 -1
- package/dist/vector/search-worker.mjs +7 -7
- package/dist/workers/entry.mjs +8 -8
- package/dist/{write-SKJ6HW7O.mjs → write-GTTWWRRG.mjs} +36 -28
- package/openapi.json +912 -5
- package/package.json +45 -8
- package/dist/browser/import-QOY6ZH6X.mjs +0 -12
- package/dist/browser/restore-queue-UQ6AAUVX.mjs +0 -41
- package/dist/chunk-7LDMWKP6.mjs +0 -209
- package/dist/engine-CJRUHXgf.d.ts +0 -664
- package/dist/react-native/chunks/chunk-L4M7QJNP.mjs +0 -110
- package/dist/react-native/chunks/chunk-TJMSKBEM.mjs +0 -25
- package/dist/react-native/chunks/gzip.react-native-7JWCLVOB.mjs +0 -3
- package/dist/react-native/chunks/import-XFBCCENV.mjs +0 -22
- package/dist/react-native/chunks/module-FHJ2GOBI.mjs +0 -25
- package/dist/react-native/chunks/restore-queue-H5VCN453.mjs +0 -41
- package/dist/restore-queue-AOF5OTQV.mjs +0 -41
- package/dist/thread-I7DVHHW7.mjs +0 -31
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import { isValidInteger, isRecord } from './chunk-
|
|
1
|
+
import { isValidInteger, isRecord } from './chunk-RSVULW4Q.mjs';
|
|
2
|
+
import { isSyncEpoch } from './chunk-BUMREPLU.mjs';
|
|
2
3
|
import { MAX_REPLICATION_FACTOR, MAX_PARTITION_COUNT } from './chunk-JDDXV6UF.mjs';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
4
|
+
import { MAX_HISTORY_FILE_BYTES } from './chunk-5YNRKI2C.mjs';
|
|
5
|
+
import { packChecksummedEnvelope } from './chunk-KMUNHGBQ.mjs';
|
|
6
|
+
import { openChecksummedEnvelope } from './chunk-3OH67G7R.mjs';
|
|
7
|
+
import { joinChunks } from './chunk-3C7MTCCI.mjs';
|
|
5
8
|
import { MAX_FILE_BYTES } from './chunk-U476IXKQ.mjs';
|
|
6
|
-
import { NarsilError, ErrorCodes } from './chunk-
|
|
9
|
+
import { NarsilError, ErrorCodes } from './chunk-MP7ABPTD.mjs';
|
|
7
10
|
import { decode, encode } from '@msgpack/msgpack';
|
|
8
11
|
|
|
9
12
|
// src/narsil/write-blocks.ts
|
|
@@ -19,6 +22,15 @@ function bindEngineWriteBlock(engine, owner) {
|
|
|
19
22
|
if (lookup !== void 0) writeBlockLookups.set(engine, lookup);
|
|
20
23
|
}
|
|
21
24
|
|
|
25
|
+
// src/server/sync/serving.ts
|
|
26
|
+
var syncServingSources = /* @__PURE__ */ new WeakMap();
|
|
27
|
+
function bindSyncServing(owner, serving) {
|
|
28
|
+
syncServingSources.set(owner, serving);
|
|
29
|
+
}
|
|
30
|
+
function syncServingSourceOf(owner) {
|
|
31
|
+
return syncServingSources.get(owner);
|
|
32
|
+
}
|
|
33
|
+
|
|
22
34
|
// src/narsil/index-reads.ts
|
|
23
35
|
var boundReads = /* @__PURE__ */ new WeakMap();
|
|
24
36
|
function bindIndexReads(engine, reads) {
|
|
@@ -54,8 +66,10 @@ var BACKUP_PROGRESS_REPORT_INTERVAL_MS = 1e3;
|
|
|
54
66
|
var BACKUP_SWEEP_INTERVAL_MS = 3e4;
|
|
55
67
|
var BACKUP_PUBLISH_RETRY_MS = 1e3;
|
|
56
68
|
var MAX_BACKUP_FILES_PER_PARTITION = 1e6;
|
|
69
|
+
var MAX_BACKUP_HISTORY_FILES = 1e6;
|
|
57
70
|
var MAX_BACKUP_FILE_PATH_LENGTH = 1024;
|
|
58
71
|
var BACKUP_MANIFEST_READS_AT_ONCE = 8;
|
|
72
|
+
var SYNC_BACKUPS_KEPT = 2;
|
|
59
73
|
var MAX_CLUSTER_UUID_BYTES = 128;
|
|
60
74
|
|
|
61
75
|
// src/distribution/backups/keys.ts
|
|
@@ -130,6 +144,7 @@ function backupKeys(keyPrefix) {
|
|
|
130
144
|
}
|
|
131
145
|
var BACKUP_MANIFEST_ENVELOPE_VERSION = 1;
|
|
132
146
|
var PATH_SEGMENT_PATTERN = /^[A-Za-z0-9][A-Za-z0-9._-]*$/;
|
|
147
|
+
var SYNC_BACKUP_TAKER = "sync";
|
|
133
148
|
function damaged(backupName, reason) {
|
|
134
149
|
return new NarsilError(ErrorCodes.BACKUP_DAMAGED, `The manifest of backup '${backupName}' ${reason}`, {
|
|
135
150
|
backupName
|
|
@@ -178,7 +193,7 @@ function readBackupPartition(value, backupName, partitionCount) {
|
|
|
178
193
|
};
|
|
179
194
|
}
|
|
180
195
|
function validateManifest(raw, backupName) {
|
|
181
|
-
if (!isRecord(raw) || raw.name !== backupName || typeof raw.clusterUuid !== "string" || typeof raw.indexName !== "string" || !isCount(raw.startedAt) || !isCount(raw.completedAt) || !isValidInteger(raw.partitionCount) || raw.partitionCount < 1 || raw.partitionCount > MAX_PARTITION_COUNT || !isCount(raw.replicationFactor) || raw.replicationFactor > MAX_REPLICATION_FACTOR || !Array.isArray(raw.partitions) || raw.partitions.length !== raw.partitionCount) {
|
|
196
|
+
if (!isRecord(raw) || raw.name !== backupName || typeof raw.clusterUuid !== "string" || typeof raw.indexName !== "string" || !isCount(raw.startedAt) || !isCount(raw.completedAt) || !isValidInteger(raw.partitionCount) || raw.partitionCount < 1 || raw.partitionCount > MAX_PARTITION_COUNT || !isCount(raw.replicationFactor) || raw.replicationFactor > MAX_REPLICATION_FACTOR || !Array.isArray(raw.partitions) || raw.partitions.length !== raw.partitionCount || raw.syncEpoch !== void 0 && !isSyncEpoch(raw.syncEpoch) || !(raw.takenBy === void 0 || typeof raw.takenBy === "string")) {
|
|
182
197
|
throw damaged(backupName, "holds a malformed header");
|
|
183
198
|
}
|
|
184
199
|
const constraints = readAllocationConstraints(raw.constraints);
|
|
@@ -195,12 +210,26 @@ function validateManifest(raw, backupName) {
|
|
|
195
210
|
startedAt: raw.startedAt,
|
|
196
211
|
completedAt: raw.completedAt,
|
|
197
212
|
partitionCount,
|
|
213
|
+
...typeof raw.syncEpoch === "string" ? { syncEpoch: raw.syncEpoch } : {},
|
|
214
|
+
...typeof raw.takenBy === "string" ? { takenBy: raw.takenBy } : {},
|
|
198
215
|
replicationFactor: raw.replicationFactor,
|
|
199
216
|
constraints,
|
|
200
217
|
config: readStoredFile(raw.config, backupName),
|
|
218
|
+
...readQueryHistory(raw.queryHistory, backupName),
|
|
201
219
|
partitions
|
|
202
220
|
};
|
|
203
221
|
}
|
|
222
|
+
function readQueryHistory(value, backupName) {
|
|
223
|
+
if (value === void 0) return {};
|
|
224
|
+
if (!Array.isArray(value) || value.length > MAX_BACKUP_HISTORY_FILES) {
|
|
225
|
+
throw damaged(backupName, "holds a malformed query history list");
|
|
226
|
+
}
|
|
227
|
+
const files = value.map((entry) => readStoredFile(entry, backupName));
|
|
228
|
+
if (files.some((file) => file.bytes > MAX_HISTORY_FILE_BYTES)) {
|
|
229
|
+
throw damaged(backupName, `lists a query history file longer than ${MAX_HISTORY_FILE_BYTES} bytes`);
|
|
230
|
+
}
|
|
231
|
+
return { queryHistory: files };
|
|
232
|
+
}
|
|
204
233
|
async function decodeBackupManifest(bytes, backupName) {
|
|
205
234
|
let raw;
|
|
206
235
|
try {
|
|
@@ -220,7 +249,7 @@ async function encodeBackupManifest(manifest) {
|
|
|
220
249
|
return joinChunks(packed.chunks, packed.byteLength);
|
|
221
250
|
}
|
|
222
251
|
function storedFilesOf(manifest) {
|
|
223
|
-
const files = [manifest.config];
|
|
252
|
+
const files = [manifest.config, ...manifest.queryHistory ?? []];
|
|
224
253
|
for (const partition of manifest.partitions) files.push(partition.manifest, ...partition.files);
|
|
225
254
|
return files;
|
|
226
255
|
}
|
|
@@ -245,4 +274,4 @@ function readRestorePlacement(request) {
|
|
|
245
274
|
return placement;
|
|
246
275
|
}
|
|
247
276
|
|
|
248
|
-
export { BACKUP_DELETES_AT_ONCE, BACKUP_FILES_AT_ONCE, BACKUP_FILE_CHUNK_BYTES, BACKUP_JOBS_KEY, BACKUP_JOB_CAS_ATTEMPTS, BACKUP_JOB_CAS_RETRY_MS, BACKUP_JOB_POLL_INTERVAL_MS, BACKUP_MANIFEST_READS_AT_ONCE, BACKUP_PARTITIONS_AT_ONCE, BACKUP_PARTITION_POLL_INTERVAL_MS, BACKUP_PARTITION_RESULT_RETENTION_MS, BACKUP_PRIMARY_WAIT_MS, BACKUP_PROGRESS_REPORT_INTERVAL_MS, BACKUP_PUBLISH_RETRY_MS, BACKUP_SWEEP_INTERVAL_MS, CLUSTER_UUID_KEY, MAX_CLUSTER_UUID_BYTES, MAX_FINISHED_BACKUP_JOBS, backupKeys, bindEngineWriteBlock, bindIndexReads, bindWriteBlockLookup, decodeBackupManifest, encodeBackupManifest, indexReadsOf, isCount, isSha256Hex, readBackupPartition, readRestorePlacement, readStoredFile, storeWithoutSaveIfAbsent, storedFilesOf, validateBackupConfig, validateBackupName, writeBlockLookupOf };
|
|
277
|
+
export { BACKUP_DELETES_AT_ONCE, BACKUP_FILES_AT_ONCE, BACKUP_FILE_CHUNK_BYTES, BACKUP_JOBS_KEY, BACKUP_JOB_CAS_ATTEMPTS, BACKUP_JOB_CAS_RETRY_MS, BACKUP_JOB_POLL_INTERVAL_MS, BACKUP_MANIFEST_READS_AT_ONCE, BACKUP_PARTITIONS_AT_ONCE, BACKUP_PARTITION_POLL_INTERVAL_MS, BACKUP_PARTITION_RESULT_RETENTION_MS, BACKUP_PRIMARY_WAIT_MS, BACKUP_PROGRESS_REPORT_INTERVAL_MS, BACKUP_PUBLISH_RETRY_MS, BACKUP_SWEEP_INTERVAL_MS, CLUSTER_UUID_KEY, MAX_CLUSTER_UUID_BYTES, MAX_FINISHED_BACKUP_JOBS, SYNC_BACKUPS_KEPT, SYNC_BACKUP_TAKER, backupKeys, bindEngineWriteBlock, bindIndexReads, bindSyncServing, bindWriteBlockLookup, decodeBackupManifest, encodeBackupManifest, indexReadsOf, isCount, isSha256Hex, readBackupPartition, readRestorePlacement, readStoredFile, storeWithoutSaveIfAbsent, storedFilesOf, syncServingSourceOf, validateBackupConfig, validateBackupName, writeBlockLookupOf };
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { newSyncEpoch } from './chunk-BUMREPLU.mjs';
|
|
2
|
+
import { oneSyncChangeAtATime } from './chunk-V6EUBAIT.mjs';
|
|
3
|
+
import { withOpenIndex, emitSyncChange } from './chunk-Y4WPNHMC.mjs';
|
|
4
|
+
import { NarsilError, ErrorCodes } from './chunk-MP7ABPTD.mjs';
|
|
5
|
+
|
|
6
|
+
// src/engine/sync/operations.ts
|
|
7
|
+
function invalidLimit(name, value) {
|
|
8
|
+
throw new NarsilError(ErrorCodes.CONFIG_INVALID, `The sync setting ${name} must be a positive whole number`, {
|
|
9
|
+
[name]: String(value)
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
function requireSyncSetting(setting) {
|
|
13
|
+
if (setting === null || typeof setting !== "object") {
|
|
14
|
+
throw new NarsilError(ErrorCodes.CONFIG_INVALID, "The sync setting must be an object");
|
|
15
|
+
}
|
|
16
|
+
const { enabled, historyMaxAgeMs, historyMaxBytes } = setting;
|
|
17
|
+
if (typeof enabled !== "boolean") {
|
|
18
|
+
throw new NarsilError(ErrorCodes.CONFIG_INVALID, "The sync setting needs enabled set to true or false");
|
|
19
|
+
}
|
|
20
|
+
const isLimit = (value) => typeof value === "number" && Number.isSafeInteger(value) && value >= 1;
|
|
21
|
+
if (historyMaxAgeMs !== void 0 && !isLimit(historyMaxAgeMs)) invalidLimit("historyMaxAgeMs", historyMaxAgeMs);
|
|
22
|
+
if (historyMaxBytes !== void 0 && !isLimit(historyMaxBytes)) invalidLimit("historyMaxBytes", historyMaxBytes);
|
|
23
|
+
return {
|
|
24
|
+
enabled,
|
|
25
|
+
...historyMaxAgeMs !== void 0 ? { historyMaxAgeMs } : {},
|
|
26
|
+
...historyMaxBytes !== void 0 ? { historyMaxBytes } : {}
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
function requireNoQuerySuggestions(state, indexName) {
|
|
30
|
+
if (state?.querySuggestions?.enabled !== true) return;
|
|
31
|
+
throw new NarsilError(
|
|
32
|
+
ErrorCodes.CONFIG_INVALID,
|
|
33
|
+
`Index "${indexName}" has popular query suggestions on, so it cannot sync to devices: a device receives the whole index of one user, while a suggestion comes from the searches of several people`,
|
|
34
|
+
{ indexName }
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
function syncStorageOf(core, indexName) {
|
|
38
|
+
const storage = core.durability?.manager.syncStorage?.();
|
|
39
|
+
if (storage === void 0) {
|
|
40
|
+
throw new NarsilError(
|
|
41
|
+
ErrorCodes.SYNC_DURABILITY_REQUIRED,
|
|
42
|
+
`Index "${indexName}" needs write-ahead log durability for device sync, because the feed reads the log`,
|
|
43
|
+
{ indexName }
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
return storage;
|
|
47
|
+
}
|
|
48
|
+
async function persistSyncState(core, indexName, next) {
|
|
49
|
+
const entry = core.requireIndex(indexName);
|
|
50
|
+
const previous = entry.sync;
|
|
51
|
+
entry.sync = next;
|
|
52
|
+
try {
|
|
53
|
+
await core.durability?.manager.persistMetadata(indexName);
|
|
54
|
+
} catch (error) {
|
|
55
|
+
entry.sync = previous;
|
|
56
|
+
throw error;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
function updateIndexSync(core, indexName, value) {
|
|
60
|
+
const setting = requireSyncSetting(value);
|
|
61
|
+
core.requireIndex(indexName);
|
|
62
|
+
const storage = syncStorageOf(core, indexName);
|
|
63
|
+
return withOpenIndex(
|
|
64
|
+
core,
|
|
65
|
+
indexName,
|
|
66
|
+
() => oneSyncChangeAtATime(core.indexRegistry, indexName, async () => {
|
|
67
|
+
if (setting.enabled) requireNoQuerySuggestions(core.requireIndex(indexName).querySuggestions, indexName);
|
|
68
|
+
const previous = core.requireIndex(indexName).sync;
|
|
69
|
+
if (!setting.enabled) {
|
|
70
|
+
if (previous === null) return;
|
|
71
|
+
await persistSyncState(core, indexName, null);
|
|
72
|
+
await storage.release(indexName);
|
|
73
|
+
emitSyncChange(core.indexRegistry, { kind: "off", indexName });
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
const limits = {
|
|
77
|
+
...setting.historyMaxAgeMs !== void 0 ? { historyMaxAgeMs: setting.historyMaxAgeMs } : {},
|
|
78
|
+
...setting.historyMaxBytes !== void 0 ? { historyMaxBytes: setting.historyMaxBytes } : {}
|
|
79
|
+
};
|
|
80
|
+
if (previous !== null) {
|
|
81
|
+
await persistSyncState(core, indexName, { ...limits, active: previous.active, epoch: previous.epoch });
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
await storage.release(indexName);
|
|
85
|
+
await persistSyncState(core, indexName, { ...limits, active: false, epoch: newSyncEpoch() });
|
|
86
|
+
})
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
async function renewWhileHeld(core, indexName) {
|
|
90
|
+
const sync = core.indexRegistry.get(indexName)?.sync ?? null;
|
|
91
|
+
if (sync === null) return;
|
|
92
|
+
await persistSyncState(core, indexName, { ...sync, active: false, epoch: newSyncEpoch() });
|
|
93
|
+
await core.durability?.manager.syncStorage?.().release(indexName);
|
|
94
|
+
emitSyncChange(core.indexRegistry, { kind: "epoch", indexName });
|
|
95
|
+
}
|
|
96
|
+
function holdRenewedSyncEpoch(core, indexName) {
|
|
97
|
+
if (core.mutationCtx.capacityScope === "partition") return Promise.resolve(() => void 0);
|
|
98
|
+
return new Promise((resolveHold, rejectHold) => {
|
|
99
|
+
void oneSyncChangeAtATime(core.indexRegistry, indexName, async () => {
|
|
100
|
+
try {
|
|
101
|
+
await renewWhileHeld(core, indexName);
|
|
102
|
+
} catch (error) {
|
|
103
|
+
rejectHold(error);
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
await new Promise((release) => resolveHold(() => release()));
|
|
107
|
+
});
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export { holdRenewedSyncEpoch, requireNoQuerySuggestions, requireSyncSetting, syncStorageOf, updateIndexSync };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { installSuggestionHooks } from './chunk-PHQNACDT.mjs';
|
|
2
|
+
import { attachedRuntimeOf, attachRuntime } from './chunk-S5LN746F.mjs';
|
|
3
|
+
import { keyBytesOf, QuerySuggestionsRuntime, createLocalHost } from './chunk-3HHQLEEQ.mjs';
|
|
4
|
+
|
|
5
|
+
// src/query-suggestions/start.ts
|
|
6
|
+
var starting = /* @__PURE__ */ new WeakMap();
|
|
7
|
+
async function startRuntime(core, engine, config) {
|
|
8
|
+
const keySetting = config?.querySuggestions?.key;
|
|
9
|
+
const key = keySetting === void 0 ? null : keyBytesOf(keySetting);
|
|
10
|
+
const runtime = new QuerySuggestionsRuntime(createLocalHost(core, engine, config), key);
|
|
11
|
+
attachRuntime(core, runtime);
|
|
12
|
+
installSuggestionHooks(core);
|
|
13
|
+
await runtime.start();
|
|
14
|
+
return runtime;
|
|
15
|
+
}
|
|
16
|
+
function localRuntimeOf(core, engine, config) {
|
|
17
|
+
const attached = attachedRuntimeOf(core);
|
|
18
|
+
if (attached !== void 0) return Promise.resolve(attached);
|
|
19
|
+
const pending = starting.get(core);
|
|
20
|
+
if (pending !== void 0) return pending;
|
|
21
|
+
const started = startRuntime(core, engine, config);
|
|
22
|
+
starting.set(core, started);
|
|
23
|
+
void started.then(
|
|
24
|
+
() => starting.delete(core),
|
|
25
|
+
() => starting.delete(core)
|
|
26
|
+
);
|
|
27
|
+
return started;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export { localRuntimeOf };
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
import { restoredEmbedding, restoredPartitionConfig, readSharedConfigFields } from './chunk-
|
|
1
|
+
import { restoredEmbedding, restoredPartitionConfig, readSharedConfigFields } from './chunk-INJYO3BU.mjs';
|
|
2
|
+
import { isSyncEpoch } from './chunk-BUMREPLU.mjs';
|
|
2
3
|
import { MAX_PARTITION_COUNT, MAX_REPLICATION_FACTOR } from './chunk-JDDXV6UF.mjs';
|
|
3
|
-
import {
|
|
4
|
+
import { storedStateOf } from './chunk-UZRZKNNZ.mjs';
|
|
4
5
|
import { MAX_INDEX_NAME_LENGTH, INDEX_NAME_PATTERN } from './chunk-EEBCDP36.mjs';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
6
|
+
import { generateId } from './chunk-Z2BE2MAM.mjs';
|
|
7
|
+
import { decodeSynonymRules } from './chunk-YEDIDCR7.mjs';
|
|
8
|
+
import { getLanguage } from './chunk-RZWWB2XR.mjs';
|
|
9
|
+
import { NarsilError, ErrorCodes } from './chunk-MP7ABPTD.mjs';
|
|
7
10
|
import { compareCodePoints } from './chunk-YTJCGKM4.mjs';
|
|
8
|
-
import {
|
|
11
|
+
import { decode, encode } from '@msgpack/msgpack';
|
|
9
12
|
|
|
10
13
|
// src/distribution/payload-guards.ts
|
|
11
14
|
function isRecord(value) {
|
|
@@ -27,6 +30,7 @@ var TEARDOWN_RETRY_DELAY_MS = 500;
|
|
|
27
30
|
var TEARDOWN_RETRY_ROUNDS = 3;
|
|
28
31
|
var RECOVERY_CAS_ATTEMPTS = 5;
|
|
29
32
|
var REPLICATION_FACTOR_CAS_ATTEMPTS = 5;
|
|
33
|
+
var SYNC_EPOCH_CAS_ATTEMPTS = 5;
|
|
30
34
|
var HIDDEN_GENERATION_PREFIX = "narsil-generation-";
|
|
31
35
|
var RESHARD_CUTOVER_LAG_ENTRIES = 1e3;
|
|
32
36
|
var RESHARD_CUTOVER_TIMEOUT_MS = 1e4;
|
|
@@ -54,6 +58,85 @@ var DEFAULT_NODE_LIFECYCLE_CONFIG = {
|
|
|
54
58
|
nodeHeartbeatIntervalMs: 1e4
|
|
55
59
|
};
|
|
56
60
|
var MAX_SYNONYM_GENERATION_LENGTH = 128;
|
|
61
|
+
function decodeClusterQuerySuggestionSettings(raw, reject) {
|
|
62
|
+
let state;
|
|
63
|
+
try {
|
|
64
|
+
state = storedStateOf({
|
|
65
|
+
querySuggestions: raw.querySuggestions,
|
|
66
|
+
bannedQueries: raw.bannedQueries,
|
|
67
|
+
querySuggestionsSource: raw.querySuggestionsSource
|
|
68
|
+
});
|
|
69
|
+
} catch (error) {
|
|
70
|
+
return reject(error instanceof NarsilError ? error.message : "the query suggestion settings are malformed");
|
|
71
|
+
}
|
|
72
|
+
return state ?? {};
|
|
73
|
+
}
|
|
74
|
+
function suggestionStateOfSettings(settings) {
|
|
75
|
+
if (settings === void 0) return null;
|
|
76
|
+
const state = {
|
|
77
|
+
...settings.querySuggestions !== void 0 ? { querySuggestions: settings.querySuggestions } : {},
|
|
78
|
+
...settings.bannedQueries !== void 0 ? { bannedQueries: settings.bannedQueries } : {},
|
|
79
|
+
...settings.querySuggestionsSource !== void 0 ? { querySuggestionsSource: settings.querySuggestionsSource } : {}
|
|
80
|
+
};
|
|
81
|
+
return Object.keys(state).length === 0 ? null : state;
|
|
82
|
+
}
|
|
83
|
+
function metadataWithSuggestionState(snapshot, state) {
|
|
84
|
+
const decoded = decode(snapshot.bytes);
|
|
85
|
+
const fields = isRecord2(decoded) ? decoded : {};
|
|
86
|
+
const {
|
|
87
|
+
querySuggestions: _setting,
|
|
88
|
+
bannedQueries: _banned,
|
|
89
|
+
...settings
|
|
90
|
+
} = isRecord2(fields.settings) ? fields.settings : { language: snapshot.settings?.language ?? getLanguage("english").name };
|
|
91
|
+
const next = {
|
|
92
|
+
...settings,
|
|
93
|
+
...state?.querySuggestions !== void 0 ? { querySuggestions: state.querySuggestions } : {},
|
|
94
|
+
...state?.bannedQueries !== void 0 && state.bannedQueries.length > 0 ? { bannedQueries: state.bannedQueries } : {}
|
|
95
|
+
};
|
|
96
|
+
return new Uint8Array(encode({ ...fields, settings: next }, { ignoreUndefined: true }));
|
|
97
|
+
}
|
|
98
|
+
function isPositiveSafeInteger(value) {
|
|
99
|
+
return typeof value === "number" && Number.isSafeInteger(value) && value >= 1;
|
|
100
|
+
}
|
|
101
|
+
function decodeSyncSetting(raw, reject) {
|
|
102
|
+
if (!isRecord2(raw) || typeof raw.enabled !== "boolean") return reject("sync must be a map with a boolean enabled");
|
|
103
|
+
const { historyMaxAgeMs, historyMaxBytes } = raw;
|
|
104
|
+
if (historyMaxAgeMs !== void 0 && !isPositiveSafeInteger(historyMaxAgeMs)) {
|
|
105
|
+
return reject("sync.historyMaxAgeMs must be a positive whole number");
|
|
106
|
+
}
|
|
107
|
+
if (historyMaxBytes !== void 0 && !isPositiveSafeInteger(historyMaxBytes)) {
|
|
108
|
+
return reject("sync.historyMaxBytes must be a positive whole number");
|
|
109
|
+
}
|
|
110
|
+
return {
|
|
111
|
+
enabled: raw.enabled,
|
|
112
|
+
...historyMaxAgeMs !== void 0 ? { historyMaxAgeMs } : {},
|
|
113
|
+
...historyMaxBytes !== void 0 ? { historyMaxBytes } : {}
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
function decodeClusterSyncSettings(raw, reject) {
|
|
117
|
+
const sync = raw.sync === void 0 ? void 0 : decodeSyncSetting(raw.sync, reject);
|
|
118
|
+
if (raw.syncActive !== void 0 && typeof raw.syncActive !== "boolean") {
|
|
119
|
+
return reject("syncActive must be a boolean");
|
|
120
|
+
}
|
|
121
|
+
if (raw.syncEpoch !== void 0 && !isSyncEpoch(raw.syncEpoch)) {
|
|
122
|
+
return reject("syncEpoch must be 32 lowercase hexadecimal digits");
|
|
123
|
+
}
|
|
124
|
+
return {
|
|
125
|
+
...sync !== void 0 ? { sync } : {},
|
|
126
|
+
...raw.syncActive !== void 0 ? { syncActive: raw.syncActive } : {},
|
|
127
|
+
...raw.syncEpoch !== void 0 ? { syncEpoch: raw.syncEpoch } : {}
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
function metadataWithSync(snapshot, next) {
|
|
131
|
+
const decoded = decode(snapshot.bytes);
|
|
132
|
+
const fields = isRecord2(decoded) ? decoded : {};
|
|
133
|
+
const settings = isRecord2(fields.settings) ? withoutSyncFields(fields.settings) : { language: snapshot.settings?.language ?? getLanguage("english").name };
|
|
134
|
+
return new Uint8Array(encode({ ...fields, settings: { ...settings, ...next } }, { ignoreUndefined: true }));
|
|
135
|
+
}
|
|
136
|
+
function withoutSyncFields(settings) {
|
|
137
|
+
const { sync: _sync, syncActive: _active, syncEpoch: _epoch, ...rest } = settings;
|
|
138
|
+
return rest;
|
|
139
|
+
}
|
|
57
140
|
|
|
58
141
|
// src/distribution/cluster/synonym-set.ts
|
|
59
142
|
var SYNONYM_CHUNK_BYTES = 1048576;
|
|
@@ -300,7 +383,9 @@ function decodeIndexSettings(raw, indexName) {
|
|
|
300
383
|
...partitions !== void 0 ? { partitions } : {},
|
|
301
384
|
...embedding !== void 0 ? { embedding } : {}
|
|
302
385
|
}),
|
|
303
|
-
...synonyms !== void 0 ? { synonyms } : {}
|
|
386
|
+
...synonyms !== void 0 ? { synonyms } : {},
|
|
387
|
+
...decodeClusterSyncSettings(raw, reject),
|
|
388
|
+
...decodeClusterQuerySuggestionSettings(raw, reject)
|
|
304
389
|
};
|
|
305
390
|
}
|
|
306
391
|
function withPartitionCount(config, partitionCount) {
|
|
@@ -319,6 +404,12 @@ function indexConfigFromSettings(schema, settings, indexName) {
|
|
|
319
404
|
analysisGeneration: _generation,
|
|
320
405
|
pendingAnalysis: _pending,
|
|
321
406
|
analysisFailure: _failure,
|
|
407
|
+
sync: _sync,
|
|
408
|
+
syncActive: _syncActive,
|
|
409
|
+
syncEpoch: _syncEpoch,
|
|
410
|
+
querySuggestions: _querySuggestions,
|
|
411
|
+
bannedQueries: _bannedQueries,
|
|
412
|
+
querySuggestionsSource: _querySuggestionsSource,
|
|
322
413
|
...fields
|
|
323
414
|
} = settings;
|
|
324
415
|
return {
|
|
@@ -464,7 +555,8 @@ async function putGenerationMetadata(coordinator, sourceName, generation) {
|
|
|
464
555
|
copiedSetGeneration = held.ref.generation;
|
|
465
556
|
continue;
|
|
466
557
|
}
|
|
467
|
-
const
|
|
558
|
+
const settings = isRecord2(decoded.settings) ? withoutSyncFields(decoded.settings) : decoded.settings;
|
|
559
|
+
const bytes = new Uint8Array(encode({ ...decoded, settings, ...generation }, { ignoreUndefined: true }));
|
|
468
560
|
return coordinator.compareAndSet(key, current, bytes);
|
|
469
561
|
}
|
|
470
562
|
}
|
|
@@ -576,4 +668,4 @@ function storedSynonymSetOf(bytes) {
|
|
|
576
668
|
return ref === null ? null : { indexUuid: decoded.indexUuid, ref };
|
|
577
669
|
}
|
|
578
670
|
|
|
579
|
-
export { ALLOCATION_CAS_ATTEMPTS, ALLOCATION_RETRY_DELAY_MS, ANALYSIS_CHANGE_POLL_INTERVAL_MS, ANALYSIS_CHANGE_RETRY_MS, ANALYSIS_REBUILD_RESEND_MS, BOOTSTRAP_CAS_ATTEMPTS, DEFAULT_CONTROLLER_CONFIG, DEFAULT_NODE_LIFECYCLE_CONFIG, ESTIMATED_PARTITION_BYTES, HIDDEN_GENERATION_PREFIX, LEADERSHIP_IMBALANCE_THRESHOLD, MAX_RESHARD_CUTOVER_ATTEMPTS, PARTITION_STORES_TIMEOUT_MS, REBALANCE_THRESHOLD, RECOVERY_CAS_ATTEMPTS, RESHARD_CONTROLLER_POLL_INTERVAL_MS, RESHARD_CUTOVER_LAG_ENTRIES, RESHARD_CUTOVER_TIMEOUT_MS, RESHARD_FORWARD_BATCH_DOCUMENTS, RESHARD_POLL_INTERVAL_MS, RESHARD_RECORD_CAS_ATTEMPTS, RESHARD_RECORD_CHECK_INTERVAL_MS, RESHARD_RETRY_DELAY_MS, TEARDOWN_CAS_ATTEMPTS, TEARDOWN_RETRY_DELAY_MS, TEARDOWN_RETRY_ROUNDS, decodeIndexSettings, deleteSynonymSet, getClusterIndexConfig, getIndexMetadata, indexConfigFromSettings, indexConfigKey, indexMetadataSnapshotOf, indexSettingsOf, indexUuidOfStoredMetadata, isRecord, isRecord2, isValidInteger, metadataWithBm25, metadataWithSynonymSet, putGenerationMetadata, putIndexMetadata, putIndexReplicationFactor, readIndexMetadataSnapshot, readIndexState, storeSynonymSet, storedSynonymSetOf, validateIndexName, withPartitionCount };
|
|
671
|
+
export { ALLOCATION_CAS_ATTEMPTS, ALLOCATION_RETRY_DELAY_MS, ANALYSIS_CHANGE_POLL_INTERVAL_MS, ANALYSIS_CHANGE_RETRY_MS, ANALYSIS_REBUILD_RESEND_MS, BOOTSTRAP_CAS_ATTEMPTS, DEFAULT_CONTROLLER_CONFIG, DEFAULT_NODE_LIFECYCLE_CONFIG, ESTIMATED_PARTITION_BYTES, HIDDEN_GENERATION_PREFIX, LEADERSHIP_IMBALANCE_THRESHOLD, MAX_RESHARD_CUTOVER_ATTEMPTS, PARTITION_STORES_TIMEOUT_MS, REBALANCE_THRESHOLD, RECOVERY_CAS_ATTEMPTS, RESHARD_CONTROLLER_POLL_INTERVAL_MS, RESHARD_CUTOVER_LAG_ENTRIES, RESHARD_CUTOVER_TIMEOUT_MS, RESHARD_FORWARD_BATCH_DOCUMENTS, RESHARD_POLL_INTERVAL_MS, RESHARD_RECORD_CAS_ATTEMPTS, RESHARD_RECORD_CHECK_INTERVAL_MS, RESHARD_RETRY_DELAY_MS, SYNC_EPOCH_CAS_ATTEMPTS, TEARDOWN_CAS_ATTEMPTS, TEARDOWN_RETRY_DELAY_MS, TEARDOWN_RETRY_ROUNDS, decodeIndexSettings, deleteSynonymSet, getClusterIndexConfig, getIndexMetadata, indexConfigFromSettings, indexConfigKey, indexMetadataSnapshotOf, indexSettingsOf, indexUuidOfStoredMetadata, isRecord, isRecord2, isValidInteger, metadataWithBm25, metadataWithSuggestionState, metadataWithSync, metadataWithSynonymSet, putGenerationMetadata, putIndexMetadata, putIndexReplicationFactor, readIndexMetadataSnapshot, readIndexState, storeSynonymSet, storedSynonymSetOf, suggestionStateOfSettings, validateIndexName, withPartitionCount };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MAX_MESSAGE_SIZE_BYTES } from './chunk-UNEEFTEU.mjs';
|
|
2
|
-
import { TransportError, TransportErrorCodes } from './chunk-
|
|
2
|
+
import { TransportError, TransportErrorCodes } from './chunk-5FLRXF73.mjs';
|
|
3
3
|
import { encode, decode } from '@msgpack/msgpack';
|
|
4
4
|
|
|
5
5
|
// src/distribution/transport/tcp/types.ts
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { english } from './chunk-TGP5M5R7.mjs';
|
|
2
|
+
import { NarsilError, ErrorCodes } from './chunk-MP7ABPTD.mjs';
|
|
3
|
+
|
|
4
|
+
// src/analysis/registry.ts
|
|
5
|
+
var tokenizers = /* @__PURE__ */ new Map();
|
|
6
|
+
var stopWordSets = /* @__PURE__ */ new Map();
|
|
7
|
+
function requireName(name, kind) {
|
|
8
|
+
if (typeof name !== "string" || name.trim().length === 0) {
|
|
9
|
+
throw new NarsilError(ErrorCodes.CONFIG_INVALID, `A registered ${kind} needs a non-empty name`, { name });
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
function registerTokenizer(name, tokenizer) {
|
|
13
|
+
requireName(name, "tokenizer");
|
|
14
|
+
if (typeof tokenizer?.tokenize !== "function") {
|
|
15
|
+
throw new NarsilError(ErrorCodes.CONFIG_INVALID, `Tokenizer "${name}" needs a tokenize method`, { tokenizer: name });
|
|
16
|
+
}
|
|
17
|
+
tokenizers.set(name, tokenizer);
|
|
18
|
+
}
|
|
19
|
+
function registerStopWords(name, stopWords) {
|
|
20
|
+
requireName(name, "stop word set");
|
|
21
|
+
if (!(stopWords instanceof Set) && typeof stopWords !== "function") {
|
|
22
|
+
throw new NarsilError(
|
|
23
|
+
ErrorCodes.CONFIG_INVALID,
|
|
24
|
+
`Stop word set "${name}" needs a Set of words or a function returning one`,
|
|
25
|
+
{ stopWords: name }
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
stopWordSets.set(name, stopWords);
|
|
29
|
+
}
|
|
30
|
+
function hasTokenizer(name) {
|
|
31
|
+
return tokenizers.has(name);
|
|
32
|
+
}
|
|
33
|
+
function hasStopWords(name) {
|
|
34
|
+
return stopWordSets.has(name);
|
|
35
|
+
}
|
|
36
|
+
function getTokenizer(name) {
|
|
37
|
+
const tokenizer = tokenizers.get(name);
|
|
38
|
+
if (!tokenizer) {
|
|
39
|
+
throw new NarsilError(ErrorCodes.CONFIG_INVALID, `Tokenizer "${name}" is not registered on this engine`, {
|
|
40
|
+
tokenizer: name,
|
|
41
|
+
available: [...tokenizers.keys()]
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
return tokenizer;
|
|
45
|
+
}
|
|
46
|
+
function getStopWords(name) {
|
|
47
|
+
const stopWords = stopWordSets.get(name);
|
|
48
|
+
if (!stopWords) {
|
|
49
|
+
throw new NarsilError(ErrorCodes.CONFIG_INVALID, `Stop word set "${name}" is not registered on this engine`, {
|
|
50
|
+
stopWords: name,
|
|
51
|
+
available: [...stopWordSets.keys()]
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
return stopWords;
|
|
55
|
+
}
|
|
56
|
+
function holdsPositionsOutOfOrder(entries) {
|
|
57
|
+
for (let index = 1; index < entries.length; index++) {
|
|
58
|
+
if (entries[index].position < entries[index - 1].position) return true;
|
|
59
|
+
}
|
|
60
|
+
return false;
|
|
61
|
+
}
|
|
62
|
+
function inPositionOrder(tokenizer) {
|
|
63
|
+
return {
|
|
64
|
+
tokenize(text) {
|
|
65
|
+
const entries = tokenizer.tokenize(text);
|
|
66
|
+
if (!holdsPositionsOutOfOrder(entries)) return entries;
|
|
67
|
+
return [...entries].sort((first, second) => first.position - second.position);
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
function resolveIndexAnalysis(config) {
|
|
72
|
+
const tokenizer = typeof config.tokenizer === "string" ? getTokenizer(config.tokenizer) : config.tokenizer;
|
|
73
|
+
return {
|
|
74
|
+
stopWords: typeof config.stopWords === "string" ? getStopWords(config.stopWords) : config.stopWords,
|
|
75
|
+
customTokenizer: tokenizer === void 0 ? void 0 : inPositionOrder(tokenizer)
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// src/languages/registry.ts
|
|
80
|
+
var languages = /* @__PURE__ */ new Map();
|
|
81
|
+
languages.set("english", english);
|
|
82
|
+
function registerLanguage(module) {
|
|
83
|
+
languages.set(module.name, module);
|
|
84
|
+
}
|
|
85
|
+
function getLanguage(name) {
|
|
86
|
+
const lang = languages.get(name);
|
|
87
|
+
if (!lang) {
|
|
88
|
+
throw new NarsilError(ErrorCodes.LANGUAGE_NOT_SUPPORTED, `Language "${name}" is not registered`, { language: name });
|
|
89
|
+
}
|
|
90
|
+
return lang;
|
|
91
|
+
}
|
|
92
|
+
function hasLanguage(name) {
|
|
93
|
+
return languages.has(name);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export { getLanguage, getStopWords, getTokenizer, hasLanguage, hasStopWords, hasTokenizer, registerLanguage, registerStopWords, registerTokenizer, resolveIndexAnalysis };
|
|
@@ -1,15 +1,18 @@
|
|
|
1
|
+
import { encodeSegmentManifest } from './chunk-BY6ZDGYS.mjs';
|
|
2
|
+
import { writeSegmentsOf, readSegmentFile, MERGED_SEGMENT_GROWTH_ALLOWANCE, MERGED_SEGMENT_TARGET_BYTES } from './chunk-J4IWBIVY.mjs';
|
|
3
|
+
import { restoreVectorFields } from './chunk-KXCVQWOR.mjs';
|
|
4
|
+
import { ReplicationMessageTypes } from './chunk-5FLRXF73.mjs';
|
|
1
5
|
import { WIRE_BATCH_BUDGET } from './chunk-JDDXV6UF.mjs';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { getLanguage, resolveIndexAnalysis } from './chunk-
|
|
10
|
-
import { extractVectorFieldsFromSchema, partialFieldsOf } from './chunk-SOUZMPME.mjs';
|
|
6
|
+
import { SEGMENT_MANIFEST_VERSION, manifestKey, manifestReferencedKeys, segmentsPrefix, snapshotBundleKey, MAX_SEGMENTS_PER_PARTITION } from './chunk-NF4DT3IH.mjs';
|
|
7
|
+
import { DEFAULT_COMPACTION_THRESHOLD, COMPACTION_LARGEST_MERGED_DOCUMENT_COUNT, SEGMENT_FILE_FRAMING_SLACK_BYTES } from './chunk-QDZJM7NI.mjs';
|
|
8
|
+
import { reconstructSchemaFromMetadata, prepareDocumentVectors } from './chunk-KMUNHGBQ.mjs';
|
|
9
|
+
import { generateId, freezeSegmentShared, createSharedFrozenSegment, createFrozenSegment, createPartitionManager, createPartitionRouter, buildSegmentPayload, resolvePartitionInsertOptions, decodeMapWithoutFields, shareSegmentArrays } from './chunk-Z2BE2MAM.mjs';
|
|
10
|
+
import { isCompositePartition, survivorDocumentsOf, partitionStateOf } from './chunk-ZAUJFLEN.mjs';
|
|
11
|
+
import { crc32 } from './chunk-7GXJUJ24.mjs';
|
|
12
|
+
import { extractVectorFieldsFromSchema, partialFieldsOf } from './chunk-WQRN64Q6.mjs';
|
|
13
|
+
import { getLanguage, resolveIndexAnalysis } from './chunk-RZWWB2XR.mjs';
|
|
11
14
|
import { MAX_FILE_BYTES } from './chunk-U476IXKQ.mjs';
|
|
12
|
-
import {
|
|
15
|
+
import { ErrorCodes, NarsilError } from './chunk-MP7ABPTD.mjs';
|
|
13
16
|
import { encode, decode } from '@msgpack/msgpack';
|
|
14
17
|
|
|
15
18
|
// src/persistence/durability/segment/captured-partition.ts
|
|
@@ -495,7 +498,7 @@ function checkSegmentHeader(data) {
|
|
|
495
498
|
}
|
|
496
499
|
return { ok: true };
|
|
497
500
|
}
|
|
498
|
-
function
|
|
501
|
+
function decodeWalEntry(payload) {
|
|
499
502
|
const decoded = decode(payload);
|
|
500
503
|
const { entry } = validateEntryPayload({ entry: decoded });
|
|
501
504
|
if (computeEntryChecksum(entry) !== entry.checksum) {
|
|
@@ -543,7 +546,7 @@ function readDurableRegion(data, durableByteLength, maxRecordBytes = MAX_WAL_REC
|
|
|
543
546
|
}
|
|
544
547
|
let entry;
|
|
545
548
|
try {
|
|
546
|
-
entry =
|
|
549
|
+
entry = decodeWalEntry(payload);
|
|
547
550
|
} catch (err) {
|
|
548
551
|
corrupt("WAL record payload failed to decode inside the durable region", {
|
|
549
552
|
offset,
|
|
@@ -591,7 +594,7 @@ function readTailBeyondFrontier(data, durableByteLength, lastDurableSeqNo, maxRe
|
|
|
591
594
|
}
|
|
592
595
|
let entry;
|
|
593
596
|
try {
|
|
594
|
-
entry =
|
|
597
|
+
entry = decodeWalEntry(payload);
|
|
595
598
|
} catch {
|
|
596
599
|
break;
|
|
597
600
|
}
|
|
@@ -876,7 +879,7 @@ async function compactPartitionSegments(input) {
|
|
|
876
879
|
if (paged) {
|
|
877
880
|
const { directory } = input.store;
|
|
878
881
|
if (directory === void 0) return { segments, nextSegmentId: input.nextSegmentId };
|
|
879
|
-
const { mergePagedWindow } = await import('./module-
|
|
882
|
+
const { mergePagedWindow } = await import('./module-DWKPBSMN.mjs');
|
|
880
883
|
return replacing(
|
|
881
884
|
await mergePagedWindow({
|
|
882
885
|
store: input.store,
|
|
@@ -964,7 +967,7 @@ function pagedSettingsOf(context) {
|
|
|
964
967
|
async function tombstonesOfDelta(context, older, selections, deleted) {
|
|
965
968
|
const { directory } = context.input.store;
|
|
966
969
|
if (context.input.metadata.textStorage !== "disk" || directory === void 0) return deleted;
|
|
967
|
-
const { pagedTombstonesFor } = await import('./module-
|
|
970
|
+
const { pagedTombstonesFor } = await import('./module-DWKPBSMN.mjs');
|
|
968
971
|
return pagedTombstonesFor(
|
|
969
972
|
directory,
|
|
970
973
|
older,
|
|
@@ -1120,4 +1123,4 @@ async function removeCheckpointGarbage(store, garbage) {
|
|
|
1120
1123
|
}
|
|
1121
1124
|
}
|
|
1122
1125
|
|
|
1123
|
-
export { SEGMENT_HEADER_SIZE, buildEntry, captureWholePartition, checkpointLastSeqNo, checkpointPrimaryTerm, commitCheckpointManifest, computeEntryChecksum, createAckMessage, createEntryBatchMessage, createEntryMessage, createForwardBatchMessage, createForwardBatchResultMessage, createForwardMessage, createInsyncAddMessage, createInsyncConfirmMessage, createInsyncRemoveMessage, createPrimaryResignMessage, durableRecordMissing, encodeMarkerSlot, frameRecord, markerSlotOffset, nextMarkerSlot, nextSegmentKey, optionalIndexUuid, partitionContentsOf, readCommitMarker, readWalSegments, removeCheckpointGarbage, validateAckPayload, validateEntryBatchPayload, validateEntryPayload, validateForwardBatchPayload, validateForwardBatchResultPayload, validateInsyncConfirmPayload, writeCheckpointSegments, writeSegmentHeader };
|
|
1126
|
+
export { FRAME_CRC_SIZE, MAX_WAL_RECORD_BYTES, RECORD_LENGTH_SIZE, SEGMENT_HEADER_SIZE, buildEntry, captureWholePartition, checkSegmentHeader, checkpointLastSeqNo, checkpointPrimaryTerm, commitCheckpointManifest, computeEntryChecksum, createAckMessage, createEntryBatchMessage, createEntryMessage, createForwardBatchMessage, createForwardBatchResultMessage, createForwardMessage, createInsyncAddMessage, createInsyncConfirmMessage, createInsyncRemoveMessage, createPrimaryResignMessage, decodeWalEntry, durableRecordMissing, encodeMarkerSlot, frameRecord, markerSlotOffset, nextMarkerSlot, nextSegmentKey, optionalIndexUuid, partitionContentsOf, readCommitMarker, readWalSegments, removeCheckpointGarbage, validateAckPayload, validateEntryBatchPayload, validateEntryPayload, validateForwardBatchPayload, validateForwardBatchResultPayload, validateInsyncConfirmPayload, writeCheckpointSegments, writeSegmentHeader };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// src/query-suggestions/attached.ts
|
|
2
|
+
var runtimes = /* @__PURE__ */ new WeakMap();
|
|
3
|
+
function attachRuntime(core, runtime) {
|
|
4
|
+
runtimes.set(core, runtime);
|
|
5
|
+
}
|
|
6
|
+
function attachedRuntimeOf(core) {
|
|
7
|
+
return runtimes.get(core);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { attachRuntime, attachedRuntimeOf };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createVectorFileReader } from './chunk-FOCV4CBZ.mjs';
|
|
2
|
-
import { openSharedQuantizer, STORE_ORDINAL_LAYOUT_GENERATION, searchOrdinals, insertNode, GRAPH_RETIRED, nodeCountOf, tombstoneCountOf, VECTOR_MEMORY_LIMITS, sharedVectorStoreBytes, STORE_SLOTS, STORE_LIVE_COUNT, IN_MEMORY, resetStoreHeader, STORE_RELEASED_VECTORS_TO_DISK, magnitude, openGraphState, fixedView, createSharedVectorStoreHandles, STORE_DOC_ID_BYTES, unplacedChunkCount, blocksGrowthBytes, growBufferTo, createOrdinalFilter, addToOrdinalFilter, slotByteOffset, openVectorBlock, NOTHING_STAGED, arenaFloat32Distance, detachNativeStore, STORE_BLOCK_COUNT, STORE_CODE_BLOCK_COUNT, grownByteLength, createVectorBlock, ensureBlockSlots, QUERY_STAGED, euclideanDistance, dotProduct, cosineSimilarityWithMagnitudes } from './chunk-
|
|
2
|
+
import { openSharedQuantizer, STORE_ORDINAL_LAYOUT_GENERATION, searchOrdinals, insertNode, GRAPH_RETIRED, nodeCountOf, tombstoneCountOf, VECTOR_MEMORY_LIMITS, sharedVectorStoreBytes, STORE_SLOTS, STORE_LIVE_COUNT, IN_MEMORY, resetStoreHeader, STORE_RELEASED_VECTORS_TO_DISK, magnitude, openGraphState, fixedView, createSharedVectorStoreHandles, STORE_DOC_ID_BYTES, unplacedChunkCount, blocksGrowthBytes, growBufferTo, createOrdinalFilter, addToOrdinalFilter, slotByteOffset, openVectorBlock, NOTHING_STAGED, arenaFloat32Distance, detachNativeStore, STORE_BLOCK_COUNT, STORE_CODE_BLOCK_COUNT, grownByteLength, createVectorBlock, ensureBlockSlots, QUERY_STAGED, euclideanDistance, dotProduct, cosineSimilarityWithMagnitudes } from './chunk-VQEUR6T6.mjs';
|
|
3
3
|
import { createDocIdMap } from './chunk-LQG5G2LY.mjs';
|
|
4
|
-
import { NarsilError, ErrorCodes } from './chunk-
|
|
4
|
+
import { NarsilError, ErrorCodes } from './chunk-MP7ABPTD.mjs';
|
|
5
5
|
|
|
6
6
|
// src/vector/vector-store/hot-block-distance.ts
|
|
7
7
|
function jsDistance(a, b, magA, magB, metric) {
|