@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,8 +1,10 @@
|
|
|
1
|
-
import { littleEndianBytes, KEYWORD_SEGMENT_ENVELOPE_VERSION, decodeKeywordSegment, KEYWORD_SEGMENT_PAYLOAD_VERSION, uint64Bytes } from './chunk-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { littleEndianBytes, KEYWORD_SEGMENT_ENVELOPE_VERSION, decodeKeywordSegment, KEYWORD_SEGMENT_PAYLOAD_VERSION, uint64Bytes } from './chunk-XY4VVBBO.mjs';
|
|
2
|
+
import { SEGMENT_FILE_FRAMING_SLACK_BYTES, SEGMENT_TOKEN_TABLE_SHARE_OF_FILE } from './chunk-ZI2V4VD7.mjs';
|
|
3
|
+
import { segmentKey, MAX_SEGMENTS_PER_PARTITION } from './chunk-23XRXIBW.mjs';
|
|
4
|
+
import { selectionKeeps, packChecksummedEnvelope, messagePackUpperBoundBytes, segmentArraysOf, mergeSegmentContents } from './chunk-SMEQ36NT.mjs';
|
|
5
|
+
import { crc32, openChecksummedEnvelope, HEADER_SIZE } from './chunk-JIJXMI42.mjs';
|
|
6
|
+
import { MAX_FILE_BYTES } from './chunk-GPPOG6PT.mjs';
|
|
7
|
+
import { NarsilError, ErrorCodes } from './chunk-SRMZXJSL.mjs';
|
|
6
8
|
import { decode, encode } from '@msgpack/msgpack';
|
|
7
9
|
|
|
8
10
|
// src/persistence/paged/constants.ts
|
|
@@ -513,149 +515,6 @@ async function readSegmentFile(store, ref) {
|
|
|
513
515
|
requireListedChecksum("segment", ref.key, header2.checksum, ref.checksum);
|
|
514
516
|
return decodeKeywordSegment(payload, sharesMemoryWithWorkers());
|
|
515
517
|
}
|
|
516
|
-
|
|
517
|
-
// src/persistence/durability/segment/layout.ts
|
|
518
|
-
var SEGMENT_ID_WIDTH = 16;
|
|
519
|
-
function manifestKey(indexName) {
|
|
520
|
-
return `${indexName}/manifest`;
|
|
521
|
-
}
|
|
522
|
-
function snapshotBundleKey(indexName) {
|
|
523
|
-
return `${indexName}/snapshot`;
|
|
524
|
-
}
|
|
525
|
-
function segmentPrefix(indexName, partitionId) {
|
|
526
|
-
return `${indexName}/segments/${partitionId}/`;
|
|
527
|
-
}
|
|
528
|
-
function segmentKey(indexName, partitionId, segmentId) {
|
|
529
|
-
return `${segmentPrefix(indexName, partitionId)}s${formatSegmentId(segmentId)}`;
|
|
530
|
-
}
|
|
531
|
-
function segmentsPrefix(indexName) {
|
|
532
|
-
return `${indexName}/segments/`;
|
|
533
|
-
}
|
|
534
|
-
function vectorFileKey(indexName, fieldPath, fileId) {
|
|
535
|
-
return `${segmentsPrefix(indexName)}vec-${encodeFieldPath(fieldPath)}-f${formatSegmentId(fileId)}`;
|
|
536
|
-
}
|
|
537
|
-
function requireGeneration(generation) {
|
|
538
|
-
if (Number.isSafeInteger(generation) && generation > 0) return;
|
|
539
|
-
throw new NarsilError(
|
|
540
|
-
ErrorCodes.PERSISTENCE_SAVE_FAILED,
|
|
541
|
-
`Vector graph generation ${generation} must be a positive integer`,
|
|
542
|
-
{ generation }
|
|
543
|
-
);
|
|
544
|
-
}
|
|
545
|
-
function graphPartKey(indexName, fieldPath, generation, part) {
|
|
546
|
-
requireGeneration(generation);
|
|
547
|
-
return `${segmentsPrefix(indexName)}vec-${encodeFieldPath(fieldPath)}-graph-g${generation}-p${formatSegmentId(part)}`;
|
|
548
|
-
}
|
|
549
|
-
function formatSegmentId(segmentId) {
|
|
550
|
-
if (!Number.isInteger(segmentId) || segmentId < 0) {
|
|
551
|
-
throw new NarsilError(
|
|
552
|
-
ErrorCodes.PERSISTENCE_SAVE_FAILED,
|
|
553
|
-
`Segment id ${segmentId} must be a non-negative integer`,
|
|
554
|
-
{ segmentId }
|
|
555
|
-
);
|
|
556
|
-
}
|
|
557
|
-
return segmentId.toString().padStart(SEGMENT_ID_WIDTH, "0");
|
|
558
|
-
}
|
|
559
|
-
var FIELD_PATH_PATTERN = /^[A-Za-z0-9_.]+$/;
|
|
560
|
-
function encodeFieldPath(fieldPath) {
|
|
561
|
-
if (!FIELD_PATH_PATTERN.test(fieldPath)) {
|
|
562
|
-
throw new NarsilError(
|
|
563
|
-
ErrorCodes.PERSISTENCE_SAVE_FAILED,
|
|
564
|
-
`Vector field path "${fieldPath}" contains characters that cannot be encoded in a segment key`,
|
|
565
|
-
{ fieldPath }
|
|
566
|
-
);
|
|
567
|
-
}
|
|
568
|
-
const fingerprint = fnv1a(fieldPath).toString(36);
|
|
569
|
-
return `${fieldPath.replace(/\./g, "_")}-${fingerprint}`;
|
|
570
|
-
}
|
|
571
|
-
var SEGMENT_MANIFEST_VERSION = 7;
|
|
572
|
-
var EARLIER_SEGMENT_MANIFEST_VERSION = 6;
|
|
573
|
-
var MANIFEST_ENVELOPE_VERSION = 2;
|
|
574
|
-
var MAX_SEGMENTS_PER_PARTITION = 65536;
|
|
575
|
-
var MAX_SEGMENT_ID = 281474976710655;
|
|
576
|
-
function fileRefOnTheWire(ref) {
|
|
577
|
-
return {
|
|
578
|
-
key: ref.key,
|
|
579
|
-
bytes: ref.bytes,
|
|
580
|
-
checksum: ref.checksum,
|
|
581
|
-
...ref.headOffset === void 0 ? {} : { headOffset: ref.headOffset, headLength: ref.headLength, headChecksum: ref.headChecksum }
|
|
582
|
-
};
|
|
583
|
-
}
|
|
584
|
-
function encodeSegmentManifest(manifest) {
|
|
585
|
-
const payload = encode({
|
|
586
|
-
version: SEGMENT_MANIFEST_VERSION,
|
|
587
|
-
schema: manifest.schema,
|
|
588
|
-
language: manifest.language,
|
|
589
|
-
...manifest.analysisGeneration ? { analysisGeneration: manifest.analysisGeneration } : {},
|
|
590
|
-
checkpoint: manifest.checkpoint.map((c) => ({
|
|
591
|
-
partitionId: c.partitionId,
|
|
592
|
-
lastSeqNo: c.lastSeqNo,
|
|
593
|
-
primaryTerm: c.primaryTerm,
|
|
594
|
-
...c.termHistory === void 0 ? {} : {
|
|
595
|
-
termHistory: c.termHistory.map((start) => ({ primaryTerm: start.primaryTerm, firstSeqNo: start.firstSeqNo }))
|
|
596
|
-
}
|
|
597
|
-
})),
|
|
598
|
-
partitions: manifest.partitions.map((p) => ({
|
|
599
|
-
partitionId: p.partitionId,
|
|
600
|
-
nextSegmentId: p.nextSegmentId,
|
|
601
|
-
segments: p.segments.map((s) => ({
|
|
602
|
-
id: s.id,
|
|
603
|
-
key: s.key,
|
|
604
|
-
docCount: s.docCount,
|
|
605
|
-
tombstoneCount: s.tombstoneCount,
|
|
606
|
-
bytes: s.bytes,
|
|
607
|
-
checksum: s.checksum
|
|
608
|
-
}))
|
|
609
|
-
})),
|
|
610
|
-
vectors: manifest.vectors.map((v) => ({
|
|
611
|
-
fieldPath: v.fieldPath,
|
|
612
|
-
nextFileId: v.nextFileId,
|
|
613
|
-
files: v.files.map((f) => ({ id: f.id, ...fileRefOnTheWire(f), count: f.count, dead: f.dead })),
|
|
614
|
-
graphGeneration: v.graphGeneration,
|
|
615
|
-
graphParts: v.graphParts.map(fileRefOnTheWire)
|
|
616
|
-
}))
|
|
617
|
-
});
|
|
618
|
-
return packChecksummedEnvelope([payload], MANIFEST_ENVELOPE_VERSION, "segment manifest");
|
|
619
|
-
}
|
|
620
|
-
function manifestReferencedKeys(manifest) {
|
|
621
|
-
const keys = /* @__PURE__ */ new Set();
|
|
622
|
-
for (const partition of manifest.partitions) {
|
|
623
|
-
for (const segment of partition.segments) {
|
|
624
|
-
keys.add(segment.key);
|
|
625
|
-
}
|
|
626
|
-
}
|
|
627
|
-
for (const vector of manifest.vectors) {
|
|
628
|
-
for (const file of vector.files) keys.add(file.key);
|
|
629
|
-
for (const part of vector.graphParts) keys.add(part.key);
|
|
630
|
-
}
|
|
631
|
-
return keys;
|
|
632
|
-
}
|
|
633
|
-
function manifestFileRefs(manifest) {
|
|
634
|
-
const refs = [];
|
|
635
|
-
for (const partition of manifest.partitions) refs.push(...partition.segments);
|
|
636
|
-
for (const vector of manifest.vectors) refs.push(...vector.files, ...vector.graphParts);
|
|
637
|
-
return refs;
|
|
638
|
-
}
|
|
639
|
-
|
|
640
|
-
// src/persistence/durability/constants.ts
|
|
641
|
-
var DEFAULT_CHECKPOINT_INTERVAL_MS = 3e5;
|
|
642
|
-
var DEFAULT_CHECKPOINT_MUTATION_THRESHOLD = 1e5;
|
|
643
|
-
var DEFAULT_ASYNC_FLUSH_INTERVAL_MS = 1e3;
|
|
644
|
-
var DIRECTORY_IDENTITY_CHECK_INTERVAL_MS = 1e3;
|
|
645
|
-
var DIRECTORY_LOCK_ATTEMPTS = 3;
|
|
646
|
-
var DIRECTORY_LOCK_SETTLE_MS = 50;
|
|
647
|
-
var DEFAULT_SEGMENT_MAX_BYTES = 67108864;
|
|
648
|
-
var DEFAULT_COMPACTION_THRESHOLD = 12;
|
|
649
|
-
var COMPACTION_LARGEST_MERGED_DOCUMENT_COUNT = 2e5;
|
|
650
|
-
var SEGMENT_FILE_FRAMING_SLACK_BYTES = 65536;
|
|
651
|
-
var SEGMENT_TOKEN_TABLE_SHARE_OF_FILE = 0.25;
|
|
652
|
-
var WHOLE_PARTITION_MIN_CHANGED_SHARE = 0.5;
|
|
653
|
-
var WHOLE_PARTITION_LARGEST_DOCUMENT_COUNT = 1e5;
|
|
654
|
-
var LOG_RECORDS_PER_CHECKPOINT = 1e5;
|
|
655
|
-
var WRITES_STALL_ABOVE_UNCHECKPOINTED_BYTES = 2147483648;
|
|
656
|
-
var CHECKPOINT_WORKER_TIMEOUT_MS = 6e5;
|
|
657
|
-
var CHECKPOINT_WORKER_IDLE_MS = 5e3;
|
|
658
|
-
var CHECKPOINT_TIMEOUT_RECOVERY_BACKOFF_MS = 50;
|
|
659
518
|
var ORDINAL_BYTES = 4;
|
|
660
519
|
var POSTING_BYTES = 8;
|
|
661
520
|
var VALUE_ENTRY_BYTES = 12;
|
|
@@ -911,7 +770,7 @@ async function writePagedGroup(state, group) {
|
|
|
911
770
|
const tombstones = state.tombstonesWritten ? [] : [...request.tombstones];
|
|
912
771
|
const id = state.nextSegmentId;
|
|
913
772
|
const key = segmentKey(request.indexName, request.partitionId, id);
|
|
914
|
-
const { writePagedSegment } = await import('./module-
|
|
773
|
+
const { writePagedSegment } = await import('./module-E33X4AOK.mjs');
|
|
915
774
|
const written = await writePagedSegment({
|
|
916
775
|
directory,
|
|
917
776
|
key,
|
|
@@ -995,4 +854,4 @@ async function writeSegmentsOf(request) {
|
|
|
995
854
|
return { segments: state.segments, nextSegmentId: state.nextSegmentId };
|
|
996
855
|
}
|
|
997
856
|
|
|
998
|
-
export { BLOCK_SUMMARY_BYTES,
|
|
857
|
+
export { BLOCK_SUMMARY_BYTES, COLD_LOAD_WAIT_WITHOUT_SEARCH_MS, COLD_WALK_NODES_READ_AHEAD, DOCUMENT_BLOCK_BYTES, DOCUMENT_BLOCK_MIN_RAW_BYTES, FILE_ASSEMBLY_CHUNK_BYTES, ID_SAMPLE_INTERVAL, LARGEST_CACHED_ENTRY_SHARE, LARGEST_REMOVAL_BUCKET_COUNT, LIST_VIEWS_HELD_PER_SEGMENT, MAX_DOCUMENT_BLOCK_RAW_BYTES, MAX_THREAD_FILE_NUMBER, MERGED_SEGMENT_GROWTH_ALLOWANCE, MERGED_SEGMENT_TARGET_BYTES, MERGE_READ_CACHE_BYTES, MessagePackChunks, PAGED_SEGMENT_ENVELOPE_VERSION, PAYLOAD_PREFIX_BYTES, POSITION_WIDTH_BYTES, POSTING_WIDTH_BYTES, READS_AHEAD_AT_ONCE, READ_AHEAD_CHUNK_BYTES, RECORD_PAGE_BYTES, REMOVAL_BUCKET_TARGET_BYTES, REMOVAL_BUCKET_WRITE_BUFFER_BYTES, REWRITE_SPILL_BYTES, SECTION_ALIGNMENT_BYTES, SECTION_WRITE_BUFFER_BYTES, SEGMENT_PAGE_BYTES, SMALLEST_BLOCK_POSTINGS, STABLE_HEAD_ATTEMPTS, THREAD_READ_CACHE_BYTES, TOMBSTONES_BETWEEN_YIELDS, WRITER_YIELD_INTERVAL_TOKENS, adapterCheckpointStore, decodePagedSegmentHead, decodeSections, directoryCheckpointStore, encodePagedSegmentHead, loadFailed, readListedFile, readSegmentFile, requireListedChecksum, requireListedSize, sectionNamed, writeBooleanColumns, writeEnumColumns, writeFieldLengths, writeGeopointColumns, writePartialWords, writePatternColumns, writeSegmentsOf, writeSurfaceForms, writeValueColumns };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { MAX_M, EARLIER_RELEASE_MIN_M, MIN_M } from './chunk-
|
|
2
|
-
import { NarsilError, ErrorCodes } from './chunk-
|
|
1
|
+
import { MAX_M, EARLIER_RELEASE_MIN_M, MIN_M } from './chunk-LFIWRCEA.mjs';
|
|
2
|
+
import { NarsilError, ErrorCodes } from './chunk-SRMZXJSL.mjs';
|
|
3
3
|
|
|
4
4
|
// src/vector/vector-index/dead-bits.ts
|
|
5
5
|
var NO_LIVE_VECTOR_AT_POSITION = -1;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// src/engine/sync/serial.ts
|
|
2
|
+
var chainsByRegistry = /* @__PURE__ */ new WeakMap();
|
|
3
|
+
async function oneSyncChangeAtATime(registry, indexName, action) {
|
|
4
|
+
let chains = chainsByRegistry.get(registry);
|
|
5
|
+
if (chains === void 0) {
|
|
6
|
+
chains = /* @__PURE__ */ new Map();
|
|
7
|
+
chainsByRegistry.set(registry, chains);
|
|
8
|
+
}
|
|
9
|
+
const running = chains;
|
|
10
|
+
const current = (running.get(indexName) ?? Promise.resolve()).catch(() => void 0).then(action);
|
|
11
|
+
running.set(indexName, current);
|
|
12
|
+
try {
|
|
13
|
+
return await current;
|
|
14
|
+
} finally {
|
|
15
|
+
if (running.get(indexName) === current) running.delete(indexName);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export { oneSyncChangeAtATime };
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
// src/query-suggestions/constants.ts
|
|
2
|
+
var QUERY_HISTORY_FOLDER = "_query-counts";
|
|
3
|
+
var RESTORED_HISTORY_FOLDER = "restored";
|
|
4
|
+
var RESTORE_STAGING_INFIX = ".restoring-";
|
|
5
|
+
var MAX_TIMER_DELAY_MS = 2147483647;
|
|
6
|
+
var DEFAULT_PREVIEW_LIMIT = 100;
|
|
7
|
+
var MAX_PREVIEW_LIMIT = 1e3;
|
|
8
|
+
var QUERY_HISTORY_ARCHIVE_PREFIX = "query-history/";
|
|
9
|
+
var MAX_HISTORY_FILE_BYTES = 16777216;
|
|
10
|
+
var MAX_INDEX_UUID_LENGTH = 255;
|
|
11
|
+
var KEY_FINGERPRINT_LABEL = "narsil.query-suggestions.key";
|
|
12
|
+
var SUGGESTIONS_INDEX_INFIX = ".suggestions.";
|
|
13
|
+
var MIN_KEY_BYTES = 32;
|
|
14
|
+
var SCRAMBLED_ID_BYTES = 16;
|
|
15
|
+
var KEY_FINGERPRINT_BYTES = 16;
|
|
16
|
+
var DEFAULT_MIN_PEOPLE = 4;
|
|
17
|
+
var MIN_MIN_PEOPLE = 2;
|
|
18
|
+
var MAX_MIN_PEOPLE = 4096;
|
|
19
|
+
var DEFAULT_MIN_RESULTS = 5;
|
|
20
|
+
var MIN_MIN_RESULTS = 1;
|
|
21
|
+
var MAX_MIN_RESULTS = 1e4;
|
|
22
|
+
var DEFAULT_RETENTION_DAYS = 30;
|
|
23
|
+
var MIN_RETENTION_DAYS = 1;
|
|
24
|
+
var MAX_RETENTION_DAYS = 365;
|
|
25
|
+
var DEFAULT_MAX_PHRASES_PER_DAY = 1e4;
|
|
26
|
+
var MAX_MAX_PHRASES_PER_DAY = 16384;
|
|
27
|
+
var DEFAULT_MAX_PHRASES_PER_PERSON = 100;
|
|
28
|
+
var MAX_MAX_PHRASES_PER_PERSON = 1e3;
|
|
29
|
+
var DEFAULT_MAX_PEOPLE_PER_DAY = 1e5;
|
|
30
|
+
var MAX_MAX_PEOPLE_PER_DAY = 1e5;
|
|
31
|
+
var DEFAULT_MAX_GROUPS = 100;
|
|
32
|
+
var MAX_MAX_GROUPS = 1e3;
|
|
33
|
+
var DEFAULT_MIN_LETTERS = 4;
|
|
34
|
+
var DEFAULT_MAX_LENGTH = 100;
|
|
35
|
+
var MAX_MAX_LENGTH = 150;
|
|
36
|
+
var DEFAULT_MAX_WORDS = 8;
|
|
37
|
+
var MAX_MAX_WORDS = 50;
|
|
38
|
+
var DEFAULT_MAX_DIGITS = 5;
|
|
39
|
+
var DEFAULT_MAX_MERGE_PHRASES = 1e5;
|
|
40
|
+
var MAX_MAX_MERGE_PHRASES = 5e5;
|
|
41
|
+
var DEFAULT_MERGE_MEMORY_BYTES = 134217728;
|
|
42
|
+
var MIN_MERGE_MEMORY_BYTES = 16777216;
|
|
43
|
+
var MAX_MERGE_MEMORY_BYTES = 1073741824;
|
|
44
|
+
var DEFAULT_SAVE_INTERVAL_MS = 3e5;
|
|
45
|
+
var MIN_SAVE_INTERVAL_MS = 1e3;
|
|
46
|
+
var MAX_SAVE_INTERVAL_MS = 36e5;
|
|
47
|
+
var DEFAULT_RESULT_CHECKS_PER_SECOND = 20;
|
|
48
|
+
var MAX_RESULT_CHECKS_PER_SECOND = 1e3;
|
|
49
|
+
var DEFAULT_SCHEDULE = "0 3 * * *";
|
|
50
|
+
var SCHEDULE_OFF = "off";
|
|
51
|
+
var DEFAULT_TIME_ZONE = "UTC";
|
|
52
|
+
var MAX_PERSON_PAIRS_PER_DAY = 1e7;
|
|
53
|
+
var MAX_FILE_PEOPLE_PER_DAY = 65536;
|
|
54
|
+
var MAX_MERGE_PEOPLE = 2097152;
|
|
55
|
+
var MAX_PEOPLE_PER_PHRASE_IN_FILE = 4096;
|
|
56
|
+
var MAX_FIELDS = 32;
|
|
57
|
+
var MAX_SETTING_BYTES = 16384;
|
|
58
|
+
var MAX_BANNED_PHRASES = 1e3;
|
|
59
|
+
var MAX_BAN_LIST_BYTES = 262144;
|
|
60
|
+
var MAX_BANNED_PHRASE_CODE_POINTS = 150;
|
|
61
|
+
var MAX_SOURCE_INDEX_NAME_LENGTH = 210;
|
|
62
|
+
var MAX_PERSON_UTF16_UNITS = 256;
|
|
63
|
+
var MAX_GROUP_LENGTH = 32;
|
|
64
|
+
var RAW_PHRASE_UTF16_UNITS_PER_CODE_POINT = 8;
|
|
65
|
+
var PAIR_BLOCK_SLOTS = 16;
|
|
66
|
+
var PAIR_PAGE_BLOCKS = 16384;
|
|
67
|
+
var PERSON_TABLE_MIN_SLOTS = 1024;
|
|
68
|
+
var MIN_PHRASE_TABLE_CAPACITY = 64;
|
|
69
|
+
var MAX_MANUAL_SUGGESTION_COUNT = 4294967295;
|
|
70
|
+
var BYTES_PER_MIB = 1048576;
|
|
71
|
+
var MS_PER_SECOND = 1e3;
|
|
72
|
+
var DAY_MS = 864e5;
|
|
73
|
+
var HISTORY_SWEEP_INTERVAL_MS = 36e5;
|
|
74
|
+
var SCHEDULE_LOOKAHEAD_DAYS = 2922;
|
|
75
|
+
var MAX_SCHEDULE_LENGTH = 256;
|
|
76
|
+
var BUILD_WRITE_BATCH = 500;
|
|
77
|
+
var BUILD_LIST_PAGE = 1e3;
|
|
78
|
+
|
|
79
|
+
export { BUILD_LIST_PAGE, BUILD_WRITE_BATCH, BYTES_PER_MIB, DAY_MS, DEFAULT_MAX_DIGITS, DEFAULT_MAX_GROUPS, DEFAULT_MAX_LENGTH, DEFAULT_MAX_MERGE_PHRASES, DEFAULT_MAX_PEOPLE_PER_DAY, DEFAULT_MAX_PHRASES_PER_DAY, DEFAULT_MAX_PHRASES_PER_PERSON, DEFAULT_MAX_WORDS, DEFAULT_MERGE_MEMORY_BYTES, DEFAULT_MIN_LETTERS, DEFAULT_MIN_PEOPLE, DEFAULT_MIN_RESULTS, DEFAULT_PREVIEW_LIMIT, DEFAULT_RESULT_CHECKS_PER_SECOND, DEFAULT_RETENTION_DAYS, DEFAULT_SAVE_INTERVAL_MS, DEFAULT_SCHEDULE, DEFAULT_TIME_ZONE, HISTORY_SWEEP_INTERVAL_MS, KEY_FINGERPRINT_BYTES, KEY_FINGERPRINT_LABEL, MAX_BANNED_PHRASES, MAX_BANNED_PHRASE_CODE_POINTS, MAX_BAN_LIST_BYTES, MAX_FIELDS, MAX_FILE_PEOPLE_PER_DAY, MAX_GROUP_LENGTH, MAX_HISTORY_FILE_BYTES, MAX_INDEX_UUID_LENGTH, MAX_MANUAL_SUGGESTION_COUNT, MAX_MAX_GROUPS, MAX_MAX_LENGTH, MAX_MAX_MERGE_PHRASES, MAX_MAX_PEOPLE_PER_DAY, MAX_MAX_PHRASES_PER_DAY, MAX_MAX_PHRASES_PER_PERSON, MAX_MAX_WORDS, MAX_MERGE_MEMORY_BYTES, MAX_MERGE_PEOPLE, MAX_MIN_PEOPLE, MAX_MIN_RESULTS, MAX_PEOPLE_PER_PHRASE_IN_FILE, MAX_PERSON_PAIRS_PER_DAY, MAX_PERSON_UTF16_UNITS, MAX_PREVIEW_LIMIT, MAX_RESULT_CHECKS_PER_SECOND, MAX_RETENTION_DAYS, MAX_SAVE_INTERVAL_MS, MAX_SCHEDULE_LENGTH, MAX_SETTING_BYTES, MAX_SOURCE_INDEX_NAME_LENGTH, MAX_TIMER_DELAY_MS, MIN_KEY_BYTES, MIN_MERGE_MEMORY_BYTES, MIN_MIN_PEOPLE, MIN_MIN_RESULTS, MIN_PHRASE_TABLE_CAPACITY, MIN_RETENTION_DAYS, MIN_SAVE_INTERVAL_MS, MS_PER_SECOND, PAIR_BLOCK_SLOTS, PAIR_PAGE_BLOCKS, PERSON_TABLE_MIN_SLOTS, QUERY_HISTORY_ARCHIVE_PREFIX, QUERY_HISTORY_FOLDER, RAW_PHRASE_UTF16_UNITS_PER_CODE_POINT, RESTORED_HISTORY_FOLDER, RESTORE_STAGING_INFIX, SCHEDULE_LOOKAHEAD_DAYS, SCHEDULE_OFF, SCRAMBLED_ID_BYTES, SUGGESTIONS_INDEX_INFIX };
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
import { MAX_SEGMENT_ID, MANIFEST_ENVELOPE_VERSION, EARLIER_SEGMENT_MANIFEST_VERSION, SEGMENT_MANIFEST_VERSION, MAX_SEGMENTS_PER_PARTITION, segmentKey, graphPartKey, vectorFileKey } from './chunk-23XRXIBW.mjs';
|
|
2
|
+
import { openChecksummedEnvelope, requireValidFieldTypes, HEADER_SIZE } from './chunk-JIJXMI42.mjs';
|
|
3
|
+
import { VECTOR_FILE_MAX_VECTORS, deadBytesFor } from './chunk-5TCXK5SB.mjs';
|
|
4
|
+
import { MAX_FILE_BYTES } from './chunk-GPPOG6PT.mjs';
|
|
5
|
+
import { NarsilError, ErrorCodes } from './chunk-SRMZXJSL.mjs';
|
|
6
|
+
import { decode } from '@msgpack/msgpack';
|
|
7
|
+
|
|
8
|
+
// src/persistence/durability/segment/manifest-fields.ts
|
|
9
|
+
function invalidManifest(message, details) {
|
|
10
|
+
throw new NarsilError(ErrorCodes.PERSISTENCE_LOAD_FAILED, `Segment manifest ${message}`, details);
|
|
11
|
+
}
|
|
12
|
+
function isRecord(value) {
|
|
13
|
+
return typeof value === "object" && value !== null && !Array.isArray(value) && !(value instanceof Uint8Array);
|
|
14
|
+
}
|
|
15
|
+
function isId(value) {
|
|
16
|
+
return typeof value === "number" && Number.isInteger(value) && value >= 0 && value <= MAX_SEGMENT_ID;
|
|
17
|
+
}
|
|
18
|
+
function isUint32(value) {
|
|
19
|
+
return typeof value === "number" && Number.isInteger(value) && value >= 0 && value <= 4294967295;
|
|
20
|
+
}
|
|
21
|
+
function isSequenceNumber(value) {
|
|
22
|
+
return typeof value === "number" && Number.isSafeInteger(value) && value >= 0;
|
|
23
|
+
}
|
|
24
|
+
function readFileRef(raw, expectedKey, what) {
|
|
25
|
+
if (raw.key !== expectedKey) {
|
|
26
|
+
invalidManifest(`lists the ${what} under the key "${String(raw.key)}" where it belongs at "${expectedKey}"`, {
|
|
27
|
+
key: raw.key,
|
|
28
|
+
expected: expectedKey
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
const bytes = raw.bytes;
|
|
32
|
+
if (typeof bytes !== "number" || !Number.isInteger(bytes) || bytes < HEADER_SIZE || bytes > MAX_FILE_BYTES) {
|
|
33
|
+
invalidManifest(`gives the ${what} "${expectedKey}" an invalid length`, { key: expectedKey, bytes });
|
|
34
|
+
}
|
|
35
|
+
if (!isUint32(raw.checksum)) invalidManifest(`gives the ${what} "${expectedKey}" an invalid checksum`);
|
|
36
|
+
if (raw.headOffset === void 0) return { key: expectedKey, bytes, checksum: raw.checksum };
|
|
37
|
+
const { headOffset, headLength, headChecksum } = raw;
|
|
38
|
+
if (!isSequenceNumber(headOffset) || !isUint32(headLength) || !isUint32(headChecksum)) {
|
|
39
|
+
invalidManifest(`gives the ${what} "${expectedKey}" an invalid head`, { key: expectedKey });
|
|
40
|
+
}
|
|
41
|
+
if (headOffset + headLength > bytes - HEADER_SIZE) {
|
|
42
|
+
invalidManifest(`ends the head of the ${what} "${expectedKey}" outside its payload`, {
|
|
43
|
+
key: expectedKey,
|
|
44
|
+
headOffset,
|
|
45
|
+
headLength,
|
|
46
|
+
bytes
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
return { key: expectedKey, bytes, checksum: raw.checksum, headOffset, headLength, headChecksum };
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// src/persistence/durability/segment/manifest-vectors-decode.ts
|
|
53
|
+
function normalizeFile(raw, indexName, fieldPath, nextFileId, seenIds) {
|
|
54
|
+
if (!isRecord(raw) || !isId(raw.id)) invalidManifest("has an invalid vector file reference", { fieldPath });
|
|
55
|
+
if (raw.id >= nextFileId || seenIds.has(raw.id)) {
|
|
56
|
+
invalidManifest(`lists vector file ${raw.id} of "${fieldPath}" twice or at its next file id`, { fieldPath });
|
|
57
|
+
}
|
|
58
|
+
seenIds.add(raw.id);
|
|
59
|
+
const count = raw.count;
|
|
60
|
+
if (typeof count !== "number" || !Number.isInteger(count) || count < 0 || count > VECTOR_FILE_MAX_VECTORS) {
|
|
61
|
+
invalidManifest(`gives vector file ${raw.id} of "${fieldPath}" an invalid count`, { fieldPath, count });
|
|
62
|
+
}
|
|
63
|
+
const dead = raw.dead ?? null;
|
|
64
|
+
if (dead !== null && !(dead instanceof Uint8Array)) invalidManifest("has dead vectors that are not bytes");
|
|
65
|
+
if (dead !== null && dead.byteLength !== deadBytesFor(count)) {
|
|
66
|
+
invalidManifest(`marks the dead vectors of file ${raw.id} of "${fieldPath}" with the wrong number of bytes`);
|
|
67
|
+
}
|
|
68
|
+
const ref = readFileRef(raw, vectorFileKey(indexName, fieldPath, raw.id), "vector file");
|
|
69
|
+
return { ...ref, id: raw.id, count, dead };
|
|
70
|
+
}
|
|
71
|
+
function normalizeGraphParts(raw, indexName, fieldPath, generation) {
|
|
72
|
+
if (!Array.isArray(raw)) invalidManifest(`gives "${fieldPath}" no list of graph parts`, { fieldPath });
|
|
73
|
+
if (raw.length > 0 && generation === 0) invalidManifest(`lists graph parts of "${fieldPath}" at generation 0`);
|
|
74
|
+
return raw.map((part, at) => {
|
|
75
|
+
if (!isRecord(part)) invalidManifest(`has an invalid graph part of "${fieldPath}"`, { fieldPath });
|
|
76
|
+
return readFileRef(part, graphPartKey(indexName, fieldPath, generation, at), "graph part");
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
function normalizeField(raw, indexName, seenFields) {
|
|
80
|
+
if (!isRecord(raw) || typeof raw.fieldPath !== "string") invalidManifest("has an invalid vector reference");
|
|
81
|
+
const fieldPath = raw.fieldPath;
|
|
82
|
+
if (seenFields.has(fieldPath)) invalidManifest(`lists the vector field "${fieldPath}" twice`, { fieldPath });
|
|
83
|
+
seenFields.add(fieldPath);
|
|
84
|
+
if (!isId(raw.nextFileId)) invalidManifest(`gives "${fieldPath}" an invalid next file id`, { fieldPath });
|
|
85
|
+
if (!Array.isArray(raw.files)) invalidManifest(`gives "${fieldPath}" no list of vector files`, { fieldPath });
|
|
86
|
+
if (!isId(raw.graphGeneration)) invalidManifest(`gives "${fieldPath}" an invalid graph generation`, { fieldPath });
|
|
87
|
+
const nextFileId = raw.nextFileId;
|
|
88
|
+
const seenIds = /* @__PURE__ */ new Set();
|
|
89
|
+
return {
|
|
90
|
+
fieldPath,
|
|
91
|
+
nextFileId,
|
|
92
|
+
files: raw.files.map((file) => normalizeFile(file, indexName, fieldPath, nextFileId, seenIds)),
|
|
93
|
+
graphGeneration: raw.graphGeneration,
|
|
94
|
+
graphParts: normalizeGraphParts(raw.graphParts, indexName, fieldPath, raw.graphGeneration)
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
function normalizeVectorFields(raw, indexName) {
|
|
98
|
+
if (!Array.isArray(raw)) invalidManifest("has malformed vector references");
|
|
99
|
+
const seenFields = /* @__PURE__ */ new Set();
|
|
100
|
+
return raw.map((field) => normalizeField(field, indexName, seenFields));
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// src/persistence/durability/segment/manifest-decode.ts
|
|
104
|
+
async function openManifestPayload(data) {
|
|
105
|
+
const { payload } = await openChecksummedEnvelope(data, {
|
|
106
|
+
envelopeFormatVersion: MANIFEST_ENVELOPE_VERSION,
|
|
107
|
+
what: "segment manifest",
|
|
108
|
+
allowsCompression: true
|
|
109
|
+
});
|
|
110
|
+
const raw = decode(payload);
|
|
111
|
+
if (!isRecord(raw)) invalidManifest("is not a map");
|
|
112
|
+
return raw;
|
|
113
|
+
}
|
|
114
|
+
function listedKeysOf(raw) {
|
|
115
|
+
const keys = [];
|
|
116
|
+
for (const partition of Array.isArray(raw.partitions) ? raw.partitions : []) {
|
|
117
|
+
if (!isRecord(partition) || !Array.isArray(partition.segments)) continue;
|
|
118
|
+
for (const segment of partition.segments)
|
|
119
|
+
if (isRecord(segment) && typeof segment.key === "string") keys.push(segment.key);
|
|
120
|
+
}
|
|
121
|
+
for (const field of Array.isArray(raw.vectors) ? raw.vectors : []) {
|
|
122
|
+
if (!isRecord(field)) continue;
|
|
123
|
+
for (const list of [field.files, field.graphParts]) {
|
|
124
|
+
if (!Array.isArray(list)) continue;
|
|
125
|
+
for (const file of list) if (isRecord(file) && typeof file.key === "string") keys.push(file.key);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
return keys;
|
|
129
|
+
}
|
|
130
|
+
async function decodeSegmentManifest(data, indexName) {
|
|
131
|
+
return decodeManifestPayload(await openManifestPayload(data), indexName);
|
|
132
|
+
}
|
|
133
|
+
function decodeManifestPayload(raw, indexName) {
|
|
134
|
+
if (raw.version === EARLIER_SEGMENT_MANIFEST_VERSION) return { kind: "earlier", payload: raw };
|
|
135
|
+
if (raw.version !== SEGMENT_MANIFEST_VERSION) {
|
|
136
|
+
throw new NarsilError(
|
|
137
|
+
ErrorCodes.ENVELOPE_VERSION_MISMATCH,
|
|
138
|
+
`The segment manifest of index "${indexName}" holds layout ${String(raw.version)}, which this release cannot open. Export the index with the release that wrote it and import the export`,
|
|
139
|
+
{ indexName, version: raw.version }
|
|
140
|
+
);
|
|
141
|
+
}
|
|
142
|
+
const schema = raw.schema;
|
|
143
|
+
if (!isRecord(schema)) invalidManifest("is missing its schema");
|
|
144
|
+
requireValidFieldTypes(schema);
|
|
145
|
+
if (typeof raw.language !== "string") invalidManifest("is missing its language");
|
|
146
|
+
if (raw.analysisGeneration !== void 0 && !isSequenceNumber(raw.analysisGeneration)) {
|
|
147
|
+
invalidManifest("has an invalid analysis generation");
|
|
148
|
+
}
|
|
149
|
+
return {
|
|
150
|
+
kind: "current",
|
|
151
|
+
manifest: {
|
|
152
|
+
version: SEGMENT_MANIFEST_VERSION,
|
|
153
|
+
schema,
|
|
154
|
+
language: raw.language,
|
|
155
|
+
...raw.analysisGeneration ? { analysisGeneration: raw.analysisGeneration } : {},
|
|
156
|
+
checkpoint: normalizeCheckpoint(raw.checkpoint),
|
|
157
|
+
partitions: normalizePartitions(raw.partitions, indexName),
|
|
158
|
+
vectors: normalizeVectorFields(raw.vectors, indexName)
|
|
159
|
+
}
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
function normalizeCheckpoint(raw) {
|
|
163
|
+
if (!Array.isArray(raw)) invalidManifest("is missing its checkpoint list");
|
|
164
|
+
const seen = /* @__PURE__ */ new Set();
|
|
165
|
+
return raw.map((entry) => {
|
|
166
|
+
if (!isRecord(entry) || !isUint32(entry.partitionId) || !isSequenceNumber(entry.lastSeqNo) || !isSequenceNumber(entry.primaryTerm) || seen.has(entry.partitionId)) {
|
|
167
|
+
invalidManifest("has an invalid partition checkpoint", { entry });
|
|
168
|
+
}
|
|
169
|
+
seen.add(entry.partitionId);
|
|
170
|
+
const checkpoint = {
|
|
171
|
+
partitionId: entry.partitionId,
|
|
172
|
+
lastSeqNo: entry.lastSeqNo,
|
|
173
|
+
primaryTerm: entry.primaryTerm
|
|
174
|
+
};
|
|
175
|
+
if (entry.termHistory !== void 0) {
|
|
176
|
+
checkpoint.termHistory = normalizeTermHistory(entry.termHistory, entry.partitionId, entry.lastSeqNo);
|
|
177
|
+
}
|
|
178
|
+
return checkpoint;
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
function normalizeTermHistory(raw, partitionId, lastSeqNo) {
|
|
182
|
+
if (!Array.isArray(raw)) invalidManifest("has a term history that is not a list", { partitionId });
|
|
183
|
+
let previous = null;
|
|
184
|
+
return raw.map((start) => {
|
|
185
|
+
if (!isRecord(start) || !isSequenceNumber(start.primaryTerm) || !isSequenceNumber(start.firstSeqNo)) {
|
|
186
|
+
invalidManifest("has an invalid term history entry", { partitionId });
|
|
187
|
+
}
|
|
188
|
+
const read = { primaryTerm: start.primaryTerm, firstSeqNo: start.firstSeqNo };
|
|
189
|
+
if (read.firstSeqNo > lastSeqNo) {
|
|
190
|
+
invalidManifest(`has a term starting at seqNo ${read.firstSeqNo}, above lastSeqNo ${lastSeqNo}`, { partitionId });
|
|
191
|
+
}
|
|
192
|
+
if (previous !== null && (read.primaryTerm <= previous.primaryTerm || read.firstSeqNo <= previous.firstSeqNo)) {
|
|
193
|
+
invalidManifest("has a term history that fails to ascend strictly", { partitionId });
|
|
194
|
+
}
|
|
195
|
+
previous = read;
|
|
196
|
+
return read;
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
function normalizePartitions(raw, indexName) {
|
|
200
|
+
if (!Array.isArray(raw)) invalidManifest("is missing partition entries");
|
|
201
|
+
const seen = /* @__PURE__ */ new Set();
|
|
202
|
+
return raw.map((entry) => {
|
|
203
|
+
if (!isRecord(entry) || !isUint32(entry.partitionId) || seen.has(entry.partitionId)) {
|
|
204
|
+
invalidManifest("has a partition without a valid id", { partitionId: isRecord(entry) ? entry.partitionId : null });
|
|
205
|
+
}
|
|
206
|
+
seen.add(entry.partitionId);
|
|
207
|
+
const segments = normalizeSegments(entry.segments, indexName, entry.partitionId);
|
|
208
|
+
return {
|
|
209
|
+
partitionId: entry.partitionId,
|
|
210
|
+
nextSegmentId: readNextSegmentId(entry.nextSegmentId, segments, entry.partitionId),
|
|
211
|
+
segments
|
|
212
|
+
};
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
function normalizeSegments(raw, indexName, partitionId) {
|
|
216
|
+
if (!Array.isArray(raw)) invalidManifest("has malformed segment references", { partitionId });
|
|
217
|
+
if (raw.length > MAX_SEGMENTS_PER_PARTITION) {
|
|
218
|
+
invalidManifest(`lists ${raw.length} segments for partition ${partitionId}, above ${MAX_SEGMENTS_PER_PARTITION}`);
|
|
219
|
+
}
|
|
220
|
+
const seenIds = /* @__PURE__ */ new Set();
|
|
221
|
+
return raw.map((segment) => {
|
|
222
|
+
if (!isRecord(segment) || !isId(segment.id) || !isUint32(segment.docCount) || !isUint32(segment.tombstoneCount)) {
|
|
223
|
+
invalidManifest("has an invalid segment reference", { partitionId });
|
|
224
|
+
}
|
|
225
|
+
if (seenIds.has(segment.id)) invalidManifest(`reuses segment id ${segment.id} in partition ${partitionId}`);
|
|
226
|
+
seenIds.add(segment.id);
|
|
227
|
+
const ref = readFileRef(segment, segmentKey(indexName, partitionId, segment.id), "segment");
|
|
228
|
+
return { ...ref, id: segment.id, docCount: segment.docCount, tombstoneCount: segment.tombstoneCount };
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
function readNextSegmentId(value, segments, partitionId) {
|
|
232
|
+
if (!isId(value)) invalidManifest("has an invalid next segment id", { partitionId });
|
|
233
|
+
for (const segment of segments) {
|
|
234
|
+
if (segment.id >= value) {
|
|
235
|
+
invalidManifest(`next segment id ${value} does not exceed segment id ${segment.id}`, { partitionId });
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
return value;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
export { decodeManifestPayload, decodeSegmentManifest, invalidManifest, isId, isRecord, isSequenceNumber, isUint32, listedKeysOf, openManifestPayload };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { MAX_DOCUMENT_NESTING_DEPTH } from './chunk-
|
|
2
|
-
import { NarsilError, ErrorCodes } from './chunk-
|
|
1
|
+
import { MAX_DOCUMENT_NESTING_DEPTH } from './chunk-JIJXMI42.mjs';
|
|
2
|
+
import { NarsilError, ErrorCodes } from './chunk-SRMZXJSL.mjs';
|
|
3
3
|
|
|
4
4
|
// src/serialization/base64.ts
|
|
5
5
|
var ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
@@ -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 };
|