@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,5 +1,5 @@
|
|
|
1
|
-
import { sendError, RELAY_STREAM_CHUNKS_IN_FLIGHT } from './chunk-
|
|
2
|
-
import { ServerErrorCodes } from './chunk-
|
|
1
|
+
import { sendError, RELAY_STREAM_CHUNKS_IN_FLIGHT } from './chunk-DCNKVEDB.mjs';
|
|
2
|
+
import { ServerErrorCodes } from './chunk-MP7ABPTD.mjs';
|
|
3
3
|
import { rm } from 'fs/promises';
|
|
4
4
|
import path from 'path';
|
|
5
5
|
|
|
@@ -39,6 +39,8 @@ function createCapturingResponse(remoteAddress, requestId, sendPart) {
|
|
|
39
39
|
let finished = false;
|
|
40
40
|
let streaming = false;
|
|
41
41
|
let inFlight = 0;
|
|
42
|
+
let sizedTotal = null;
|
|
43
|
+
let writtenBytes = 0;
|
|
42
44
|
let writable = null;
|
|
43
45
|
const abort = createRelayAbort();
|
|
44
46
|
let resolveDone = () => void 0;
|
|
@@ -58,7 +60,14 @@ function createCapturingResponse(remoteAddress, requestId, sendPart) {
|
|
|
58
60
|
function startStreaming() {
|
|
59
61
|
if (streaming) return;
|
|
60
62
|
streaming = true;
|
|
61
|
-
sendPart({ type: "stream-start", requestId, status, headers }, []);
|
|
63
|
+
sendPart({ type: "stream-start", requestId, status, headers, totalSize: sizedTotal }, []);
|
|
64
|
+
}
|
|
65
|
+
function sendChunk(chunk) {
|
|
66
|
+
const copy = new Uint8Array(chunk.byteLength);
|
|
67
|
+
copy.set(chunk);
|
|
68
|
+
inFlight += 1;
|
|
69
|
+
writtenBytes += chunk.byteLength;
|
|
70
|
+
sendPart({ type: "stream-chunk", requestId, chunk: copy }, [copy.buffer]);
|
|
62
71
|
}
|
|
63
72
|
const sink = {
|
|
64
73
|
cork(callback) {
|
|
@@ -80,10 +89,7 @@ function createCapturingResponse(remoteAddress, requestId, sendPart) {
|
|
|
80
89
|
write(chunk) {
|
|
81
90
|
if (finished || abort.aborted) return true;
|
|
82
91
|
startStreaming();
|
|
83
|
-
|
|
84
|
-
copy.set(chunk);
|
|
85
|
-
inFlight += 1;
|
|
86
|
-
sendPart({ type: "stream-chunk", requestId, chunk: copy }, [copy.buffer]);
|
|
92
|
+
sendChunk(chunk);
|
|
87
93
|
return inFlight < RELAY_STREAM_CHUNKS_IN_FLIGHT;
|
|
88
94
|
},
|
|
89
95
|
pause: () => void 0,
|
|
@@ -104,11 +110,24 @@ function createCapturingResponse(remoteAddress, requestId, sendPart) {
|
|
|
104
110
|
finish(new Uint8Array(0));
|
|
105
111
|
return sink;
|
|
106
112
|
},
|
|
107
|
-
tryEnd(body) {
|
|
108
|
-
|
|
109
|
-
|
|
113
|
+
tryEnd(body, totalSize) {
|
|
114
|
+
if (finished || abort.aborted) return [true, true];
|
|
115
|
+
if (!streaming && body.byteLength >= totalSize) {
|
|
116
|
+
finish(body);
|
|
117
|
+
return [true, true];
|
|
118
|
+
}
|
|
119
|
+
if (!streaming) {
|
|
120
|
+
sizedTotal = totalSize;
|
|
121
|
+
startStreaming();
|
|
122
|
+
}
|
|
123
|
+
if (body.byteLength > 0) sendChunk(body);
|
|
124
|
+
if (sizedTotal !== null && writtenBytes >= sizedTotal) {
|
|
125
|
+
finish(new Uint8Array(0));
|
|
126
|
+
return [true, true];
|
|
127
|
+
}
|
|
128
|
+
return [inFlight < RELAY_STREAM_CHUNKS_IN_FLIGHT, false];
|
|
110
129
|
},
|
|
111
|
-
getWriteOffset: () =>
|
|
130
|
+
getWriteOffset: () => writtenBytes,
|
|
112
131
|
onWritable(handler) {
|
|
113
132
|
writable = handler;
|
|
114
133
|
return sink;
|
|
@@ -126,14 +145,14 @@ function createCapturingResponse(remoteAddress, requestId, sendPart) {
|
|
|
126
145
|
if (inFlight >= RELAY_STREAM_CHUNKS_IN_FLIGHT || writable === null) return;
|
|
127
146
|
const handler = writable;
|
|
128
147
|
writable = null;
|
|
129
|
-
handler(
|
|
148
|
+
handler(writtenBytes);
|
|
130
149
|
},
|
|
131
150
|
cancel() {
|
|
132
151
|
abort.trigger();
|
|
133
152
|
if (writable !== null) {
|
|
134
153
|
const handler = writable;
|
|
135
154
|
writable = null;
|
|
136
|
-
handler(
|
|
155
|
+
handler(writtenBytes);
|
|
137
156
|
}
|
|
138
157
|
if (!finished) {
|
|
139
158
|
finished = true;
|
|
@@ -182,7 +201,8 @@ async function answerRequest(handler, request, port, streams) {
|
|
|
182
201
|
bodyRefusal: request.bodyRefusal,
|
|
183
202
|
spooledBody: spooledBodyOf(request.spooledBody),
|
|
184
203
|
abort: captured.abort,
|
|
185
|
-
hookContext: request.hookContext
|
|
204
|
+
hookContext: request.hookContext,
|
|
205
|
+
requestHeaders: request.requestHeaders
|
|
186
206
|
};
|
|
187
207
|
try {
|
|
188
208
|
await handler(ctx);
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
import { VECTOR_FILE_MAX_VECTORS, deadBytesFor } from './chunk-K4ZIGL2O.mjs';
|
|
2
|
+
import { MAX_SEGMENT_ID, MANIFEST_ENVELOPE_VERSION, EARLIER_SEGMENT_MANIFEST_VERSION, SEGMENT_MANIFEST_VERSION, MAX_SEGMENTS_PER_PARTITION, segmentKey, graphPartKey, vectorFileKey } from './chunk-NF4DT3IH.mjs';
|
|
3
|
+
import { openChecksummedEnvelope, HEADER_SIZE } from './chunk-3OH67G7R.mjs';
|
|
4
|
+
import { requireValidFieldTypes } from './chunk-WQRN64Q6.mjs';
|
|
5
|
+
import { MAX_FILE_BYTES } from './chunk-U476IXKQ.mjs';
|
|
6
|
+
import { NarsilError, ErrorCodes } from './chunk-MP7ABPTD.mjs';
|
|
7
|
+
import { decode } from '@msgpack/msgpack';
|
|
8
|
+
|
|
9
|
+
// src/persistence/durability/segment/manifest-fields.ts
|
|
10
|
+
function invalidManifest(message, details) {
|
|
11
|
+
throw new NarsilError(ErrorCodes.PERSISTENCE_LOAD_FAILED, `Segment manifest ${message}`, details);
|
|
12
|
+
}
|
|
13
|
+
function isRecord(value) {
|
|
14
|
+
return typeof value === "object" && value !== null && !Array.isArray(value) && !(value instanceof Uint8Array);
|
|
15
|
+
}
|
|
16
|
+
function isId(value) {
|
|
17
|
+
return typeof value === "number" && Number.isInteger(value) && value >= 0 && value <= MAX_SEGMENT_ID;
|
|
18
|
+
}
|
|
19
|
+
function isUint32(value) {
|
|
20
|
+
return typeof value === "number" && Number.isInteger(value) && value >= 0 && value <= 4294967295;
|
|
21
|
+
}
|
|
22
|
+
function isSequenceNumber(value) {
|
|
23
|
+
return typeof value === "number" && Number.isSafeInteger(value) && value >= 0;
|
|
24
|
+
}
|
|
25
|
+
function readFileRef(raw, expectedKey, what) {
|
|
26
|
+
if (raw.key !== expectedKey) {
|
|
27
|
+
invalidManifest(`lists the ${what} under the key "${String(raw.key)}" where it belongs at "${expectedKey}"`, {
|
|
28
|
+
key: raw.key,
|
|
29
|
+
expected: expectedKey
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
const bytes = raw.bytes;
|
|
33
|
+
if (typeof bytes !== "number" || !Number.isInteger(bytes) || bytes < HEADER_SIZE || bytes > MAX_FILE_BYTES) {
|
|
34
|
+
invalidManifest(`gives the ${what} "${expectedKey}" an invalid length`, { key: expectedKey, bytes });
|
|
35
|
+
}
|
|
36
|
+
if (!isUint32(raw.checksum)) invalidManifest(`gives the ${what} "${expectedKey}" an invalid checksum`);
|
|
37
|
+
if (raw.headOffset === void 0) return { key: expectedKey, bytes, checksum: raw.checksum };
|
|
38
|
+
const { headOffset, headLength, headChecksum } = raw;
|
|
39
|
+
if (!isSequenceNumber(headOffset) || !isUint32(headLength) || !isUint32(headChecksum)) {
|
|
40
|
+
invalidManifest(`gives the ${what} "${expectedKey}" an invalid head`, { key: expectedKey });
|
|
41
|
+
}
|
|
42
|
+
if (headOffset + headLength > bytes - HEADER_SIZE) {
|
|
43
|
+
invalidManifest(`ends the head of the ${what} "${expectedKey}" outside its payload`, {
|
|
44
|
+
key: expectedKey,
|
|
45
|
+
headOffset,
|
|
46
|
+
headLength,
|
|
47
|
+
bytes
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
return { key: expectedKey, bytes, checksum: raw.checksum, headOffset, headLength, headChecksum };
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// src/persistence/durability/segment/manifest-vectors-decode.ts
|
|
54
|
+
function normalizeFile(raw, indexName, fieldPath, nextFileId, seenIds) {
|
|
55
|
+
if (!isRecord(raw) || !isId(raw.id)) invalidManifest("has an invalid vector file reference", { fieldPath });
|
|
56
|
+
if (raw.id >= nextFileId || seenIds.has(raw.id)) {
|
|
57
|
+
invalidManifest(`lists vector file ${raw.id} of "${fieldPath}" twice or at its next file id`, { fieldPath });
|
|
58
|
+
}
|
|
59
|
+
seenIds.add(raw.id);
|
|
60
|
+
const count = raw.count;
|
|
61
|
+
if (typeof count !== "number" || !Number.isInteger(count) || count < 0 || count > VECTOR_FILE_MAX_VECTORS) {
|
|
62
|
+
invalidManifest(`gives vector file ${raw.id} of "${fieldPath}" an invalid count`, { fieldPath, count });
|
|
63
|
+
}
|
|
64
|
+
const dead = raw.dead ?? null;
|
|
65
|
+
if (dead !== null && !(dead instanceof Uint8Array)) invalidManifest("has dead vectors that are not bytes");
|
|
66
|
+
if (dead !== null && dead.byteLength !== deadBytesFor(count)) {
|
|
67
|
+
invalidManifest(`marks the dead vectors of file ${raw.id} of "${fieldPath}" with the wrong number of bytes`);
|
|
68
|
+
}
|
|
69
|
+
const ref = readFileRef(raw, vectorFileKey(indexName, fieldPath, raw.id), "vector file");
|
|
70
|
+
return { ...ref, id: raw.id, count, dead };
|
|
71
|
+
}
|
|
72
|
+
function normalizeGraphParts(raw, indexName, fieldPath, generation) {
|
|
73
|
+
if (!Array.isArray(raw)) invalidManifest(`gives "${fieldPath}" no list of graph parts`, { fieldPath });
|
|
74
|
+
if (raw.length > 0 && generation === 0) invalidManifest(`lists graph parts of "${fieldPath}" at generation 0`);
|
|
75
|
+
return raw.map((part, at) => {
|
|
76
|
+
if (!isRecord(part)) invalidManifest(`has an invalid graph part of "${fieldPath}"`, { fieldPath });
|
|
77
|
+
return readFileRef(part, graphPartKey(indexName, fieldPath, generation, at), "graph part");
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
function normalizeField(raw, indexName, seenFields) {
|
|
81
|
+
if (!isRecord(raw) || typeof raw.fieldPath !== "string") invalidManifest("has an invalid vector reference");
|
|
82
|
+
const fieldPath = raw.fieldPath;
|
|
83
|
+
if (seenFields.has(fieldPath)) invalidManifest(`lists the vector field "${fieldPath}" twice`, { fieldPath });
|
|
84
|
+
seenFields.add(fieldPath);
|
|
85
|
+
if (!isId(raw.nextFileId)) invalidManifest(`gives "${fieldPath}" an invalid next file id`, { fieldPath });
|
|
86
|
+
if (!Array.isArray(raw.files)) invalidManifest(`gives "${fieldPath}" no list of vector files`, { fieldPath });
|
|
87
|
+
if (!isId(raw.graphGeneration)) invalidManifest(`gives "${fieldPath}" an invalid graph generation`, { fieldPath });
|
|
88
|
+
const nextFileId = raw.nextFileId;
|
|
89
|
+
const seenIds = /* @__PURE__ */ new Set();
|
|
90
|
+
return {
|
|
91
|
+
fieldPath,
|
|
92
|
+
nextFileId,
|
|
93
|
+
files: raw.files.map((file) => normalizeFile(file, indexName, fieldPath, nextFileId, seenIds)),
|
|
94
|
+
graphGeneration: raw.graphGeneration,
|
|
95
|
+
graphParts: normalizeGraphParts(raw.graphParts, indexName, fieldPath, raw.graphGeneration)
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
function normalizeVectorFields(raw, indexName) {
|
|
99
|
+
if (!Array.isArray(raw)) invalidManifest("has malformed vector references");
|
|
100
|
+
const seenFields = /* @__PURE__ */ new Set();
|
|
101
|
+
return raw.map((field) => normalizeField(field, indexName, seenFields));
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// src/persistence/durability/segment/manifest-decode.ts
|
|
105
|
+
async function openManifestPayload(data) {
|
|
106
|
+
const { payload } = await openChecksummedEnvelope(data, {
|
|
107
|
+
envelopeFormatVersion: MANIFEST_ENVELOPE_VERSION,
|
|
108
|
+
what: "segment manifest",
|
|
109
|
+
allowsCompression: true
|
|
110
|
+
});
|
|
111
|
+
const raw = decode(payload);
|
|
112
|
+
if (!isRecord(raw)) invalidManifest("is not a map");
|
|
113
|
+
return raw;
|
|
114
|
+
}
|
|
115
|
+
function listedKeysOf(raw) {
|
|
116
|
+
const keys = [];
|
|
117
|
+
for (const partition of Array.isArray(raw.partitions) ? raw.partitions : []) {
|
|
118
|
+
if (!isRecord(partition) || !Array.isArray(partition.segments)) continue;
|
|
119
|
+
for (const segment of partition.segments)
|
|
120
|
+
if (isRecord(segment) && typeof segment.key === "string") keys.push(segment.key);
|
|
121
|
+
}
|
|
122
|
+
for (const field of Array.isArray(raw.vectors) ? raw.vectors : []) {
|
|
123
|
+
if (!isRecord(field)) continue;
|
|
124
|
+
for (const list of [field.files, field.graphParts]) {
|
|
125
|
+
if (!Array.isArray(list)) continue;
|
|
126
|
+
for (const file of list) if (isRecord(file) && typeof file.key === "string") keys.push(file.key);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
return keys;
|
|
130
|
+
}
|
|
131
|
+
async function decodeSegmentManifest(data, indexName) {
|
|
132
|
+
return decodeManifestPayload(await openManifestPayload(data), indexName);
|
|
133
|
+
}
|
|
134
|
+
function decodeManifestPayload(raw, indexName) {
|
|
135
|
+
if (raw.version === EARLIER_SEGMENT_MANIFEST_VERSION) return { kind: "earlier", payload: raw };
|
|
136
|
+
if (raw.version !== SEGMENT_MANIFEST_VERSION) {
|
|
137
|
+
throw new NarsilError(
|
|
138
|
+
ErrorCodes.ENVELOPE_VERSION_MISMATCH,
|
|
139
|
+
`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`,
|
|
140
|
+
{ indexName, version: raw.version }
|
|
141
|
+
);
|
|
142
|
+
}
|
|
143
|
+
const schema = raw.schema;
|
|
144
|
+
if (!isRecord(schema)) invalidManifest("is missing its schema");
|
|
145
|
+
requireValidFieldTypes(schema);
|
|
146
|
+
if (typeof raw.language !== "string") invalidManifest("is missing its language");
|
|
147
|
+
if (raw.analysisGeneration !== void 0 && !isSequenceNumber(raw.analysisGeneration)) {
|
|
148
|
+
invalidManifest("has an invalid analysis generation");
|
|
149
|
+
}
|
|
150
|
+
return {
|
|
151
|
+
kind: "current",
|
|
152
|
+
manifest: {
|
|
153
|
+
version: SEGMENT_MANIFEST_VERSION,
|
|
154
|
+
schema,
|
|
155
|
+
language: raw.language,
|
|
156
|
+
...raw.analysisGeneration ? { analysisGeneration: raw.analysisGeneration } : {},
|
|
157
|
+
checkpoint: normalizeCheckpoint(raw.checkpoint),
|
|
158
|
+
partitions: normalizePartitions(raw.partitions, indexName),
|
|
159
|
+
vectors: normalizeVectorFields(raw.vectors, indexName)
|
|
160
|
+
}
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
function normalizeCheckpoint(raw) {
|
|
164
|
+
if (!Array.isArray(raw)) invalidManifest("is missing its checkpoint list");
|
|
165
|
+
const seen = /* @__PURE__ */ new Set();
|
|
166
|
+
return raw.map((entry) => {
|
|
167
|
+
if (!isRecord(entry) || !isUint32(entry.partitionId) || !isSequenceNumber(entry.lastSeqNo) || !isSequenceNumber(entry.primaryTerm) || seen.has(entry.partitionId)) {
|
|
168
|
+
invalidManifest("has an invalid partition checkpoint", { entry });
|
|
169
|
+
}
|
|
170
|
+
seen.add(entry.partitionId);
|
|
171
|
+
const checkpoint = {
|
|
172
|
+
partitionId: entry.partitionId,
|
|
173
|
+
lastSeqNo: entry.lastSeqNo,
|
|
174
|
+
primaryTerm: entry.primaryTerm
|
|
175
|
+
};
|
|
176
|
+
if (entry.termHistory !== void 0) {
|
|
177
|
+
checkpoint.termHistory = normalizeTermHistory(entry.termHistory, entry.partitionId, entry.lastSeqNo);
|
|
178
|
+
}
|
|
179
|
+
return checkpoint;
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
function normalizeTermHistory(raw, partitionId, lastSeqNo) {
|
|
183
|
+
if (!Array.isArray(raw)) invalidManifest("has a term history that is not a list", { partitionId });
|
|
184
|
+
let previous = null;
|
|
185
|
+
return raw.map((start) => {
|
|
186
|
+
if (!isRecord(start) || !isSequenceNumber(start.primaryTerm) || !isSequenceNumber(start.firstSeqNo)) {
|
|
187
|
+
invalidManifest("has an invalid term history entry", { partitionId });
|
|
188
|
+
}
|
|
189
|
+
const read = { primaryTerm: start.primaryTerm, firstSeqNo: start.firstSeqNo };
|
|
190
|
+
if (read.firstSeqNo > lastSeqNo) {
|
|
191
|
+
invalidManifest(`has a term starting at seqNo ${read.firstSeqNo}, above lastSeqNo ${lastSeqNo}`, { partitionId });
|
|
192
|
+
}
|
|
193
|
+
if (previous !== null && (read.primaryTerm <= previous.primaryTerm || read.firstSeqNo <= previous.firstSeqNo)) {
|
|
194
|
+
invalidManifest("has a term history that fails to ascend strictly", { partitionId });
|
|
195
|
+
}
|
|
196
|
+
previous = read;
|
|
197
|
+
return read;
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
function normalizePartitions(raw, indexName) {
|
|
201
|
+
if (!Array.isArray(raw)) invalidManifest("is missing partition entries");
|
|
202
|
+
const seen = /* @__PURE__ */ new Set();
|
|
203
|
+
return raw.map((entry) => {
|
|
204
|
+
if (!isRecord(entry) || !isUint32(entry.partitionId) || seen.has(entry.partitionId)) {
|
|
205
|
+
invalidManifest("has a partition without a valid id", { partitionId: isRecord(entry) ? entry.partitionId : null });
|
|
206
|
+
}
|
|
207
|
+
seen.add(entry.partitionId);
|
|
208
|
+
const segments = normalizeSegments(entry.segments, indexName, entry.partitionId);
|
|
209
|
+
return {
|
|
210
|
+
partitionId: entry.partitionId,
|
|
211
|
+
nextSegmentId: readNextSegmentId(entry.nextSegmentId, segments, entry.partitionId),
|
|
212
|
+
segments
|
|
213
|
+
};
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
function normalizeSegments(raw, indexName, partitionId) {
|
|
217
|
+
if (!Array.isArray(raw)) invalidManifest("has malformed segment references", { partitionId });
|
|
218
|
+
if (raw.length > MAX_SEGMENTS_PER_PARTITION) {
|
|
219
|
+
invalidManifest(`lists ${raw.length} segments for partition ${partitionId}, above ${MAX_SEGMENTS_PER_PARTITION}`);
|
|
220
|
+
}
|
|
221
|
+
const seenIds = /* @__PURE__ */ new Set();
|
|
222
|
+
return raw.map((segment) => {
|
|
223
|
+
if (!isRecord(segment) || !isId(segment.id) || !isUint32(segment.docCount) || !isUint32(segment.tombstoneCount)) {
|
|
224
|
+
invalidManifest("has an invalid segment reference", { partitionId });
|
|
225
|
+
}
|
|
226
|
+
if (seenIds.has(segment.id)) invalidManifest(`reuses segment id ${segment.id} in partition ${partitionId}`);
|
|
227
|
+
seenIds.add(segment.id);
|
|
228
|
+
const ref = readFileRef(segment, segmentKey(indexName, partitionId, segment.id), "segment");
|
|
229
|
+
return { ...ref, id: segment.id, docCount: segment.docCount, tombstoneCount: segment.tombstoneCount };
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
function readNextSegmentId(value, segments, partitionId) {
|
|
233
|
+
if (!isId(value)) invalidManifest("has an invalid next segment id", { partitionId });
|
|
234
|
+
for (const segment of segments) {
|
|
235
|
+
if (segment.id >= value) {
|
|
236
|
+
invalidManifest(`next segment id ${value} does not exceed segment id ${segment.id}`, { partitionId });
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
return value;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
export { decodeManifestPayload, decodeSegmentManifest, invalidManifest, isId, isRecord, isSequenceNumber, isUint32, listedKeysOf, openManifestPayload };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MAX_DOCUMENT_NESTING_DEPTH } from './chunk-L5ORED7V.mjs';
|
|
2
|
-
import { NarsilError, ErrorCodes } from './chunk-
|
|
2
|
+
import { NarsilError, ErrorCodes } from './chunk-MP7ABPTD.mjs';
|
|
3
3
|
|
|
4
4
|
// src/serialization/base64.ts
|
|
5
5
|
var ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
@@ -1,168 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { DEFAULT_COMPACTION_THRESHOLD } from './chunk-CSHHU7PA.mjs';
|
|
6
|
-
import { manifestKey, manifestFileRefs } from './chunk-7LDMWKP6.mjs';
|
|
7
|
-
import { HEADER_SIZE } from './chunk-2PNYKG2D.mjs';
|
|
1
|
+
import { openManifestPayload, listedKeysOf, decodeManifestPayload } from './chunk-SY3EWKQY.mjs';
|
|
2
|
+
import { manifestFileRefs } from './chunk-NF4DT3IH.mjs';
|
|
3
|
+
import { QUERY_HISTORY_ARCHIVE_PREFIX, MAX_HISTORY_FILE_BYTES } from './chunk-5YNRKI2C.mjs';
|
|
4
|
+
import { HEADER_SIZE } from './chunk-3OH67G7R.mjs';
|
|
8
5
|
import { MAX_FILE_BYTES } from './chunk-U476IXKQ.mjs';
|
|
9
|
-
import { NarsilError, ErrorCodes } from './chunk-
|
|
10
|
-
|
|
11
|
-
// src/persistence/archive/memory-store.ts
|
|
12
|
-
function joined(chunks) {
|
|
13
|
-
let total = 0;
|
|
14
|
-
for (const chunk of chunks) total += chunk.byteLength;
|
|
15
|
-
const bytes = new Uint8Array(total);
|
|
16
|
-
let offset = 0;
|
|
17
|
-
for (const chunk of chunks) {
|
|
18
|
-
bytes.set(chunk, offset);
|
|
19
|
-
offset += chunk.byteLength;
|
|
20
|
-
}
|
|
21
|
-
return bytes;
|
|
22
|
-
}
|
|
23
|
-
function memoryCheckpointStore() {
|
|
24
|
-
const files = /* @__PURE__ */ new Map();
|
|
25
|
-
return {
|
|
26
|
-
files,
|
|
27
|
-
read: async (key) => files.get(key) ?? null,
|
|
28
|
-
write: async (key, chunks) => {
|
|
29
|
-
files.set(key, joined(chunks));
|
|
30
|
-
},
|
|
31
|
-
remove: async (key) => {
|
|
32
|
-
files.delete(key);
|
|
33
|
-
},
|
|
34
|
-
list: async (prefix) => [...files.keys()].filter((key) => key.startsWith(prefix)).sort(),
|
|
35
|
-
byteLength: async (key) => files.get(key)?.byteLength ?? null
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
// src/persistence/archive/from-memory.ts
|
|
40
|
-
function frozenPlan(plan) {
|
|
41
|
-
const files = [];
|
|
42
|
-
for (let index = 0; index < plan.newFiles; index++) files.push(plan.readNewFile(index));
|
|
43
|
-
return { ...plan, readNewFile: (index) => files[index] };
|
|
44
|
-
}
|
|
45
|
-
function partitionVectorPlan(vectorIndex, docIds) {
|
|
46
|
-
const held = [];
|
|
47
|
-
const vectors = [];
|
|
48
|
-
for (const docId of docIds) {
|
|
49
|
-
const vector = vectorIndex.getVector(docId);
|
|
50
|
-
if (vector === null) continue;
|
|
51
|
-
held.push(docId);
|
|
52
|
-
vectors.push(Float32Array.from(vector));
|
|
53
|
-
}
|
|
54
|
-
const capacity = vectorsPerFile(vectorIndex.dimension, null);
|
|
55
|
-
const files = [];
|
|
56
|
-
for (let start = 0; start < held.length; start += capacity) {
|
|
57
|
-
const slice = held.slice(start, start + capacity);
|
|
58
|
-
const packed = new Float32Array(slice.length * vectorIndex.dimension);
|
|
59
|
-
for (let i = 0; i < slice.length; i++) packed.set(vectors[start + i], i * vectorIndex.dimension);
|
|
60
|
-
const payload = {
|
|
61
|
-
v: VECTOR_FILE_PAYLOAD_VERSION,
|
|
62
|
-
fieldName: vectorIndex.fieldName,
|
|
63
|
-
dimension: vectorIndex.dimension,
|
|
64
|
-
docIds: slice,
|
|
65
|
-
codes: null,
|
|
66
|
-
vectors: vectorsToBytes(packed)
|
|
67
|
-
};
|
|
68
|
-
files.push({ payload, ordinals: new Int32Array(slice.length), dead: null, magnitudes: null });
|
|
69
|
-
}
|
|
70
|
-
return {
|
|
71
|
-
unchanged: false,
|
|
72
|
-
storesHeads: false,
|
|
73
|
-
kept: [],
|
|
74
|
-
keptFiles: [],
|
|
75
|
-
newFiles: files.length,
|
|
76
|
-
graphParts: null,
|
|
77
|
-
signature: { revision: 0, graphSize: -1, calibration: null },
|
|
78
|
-
readNewFile: (index) => files[index],
|
|
79
|
-
release: () => void 0
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
function capture(input) {
|
|
83
|
-
const partitionIds = input.partitionId === null ? Array.from({ length: input.manager.partitionCount }, (_, partitionId) => partitionId) : [input.partitionId];
|
|
84
|
-
const { indexName } = input;
|
|
85
|
-
const writeRecords = input.writeRecords ?? null;
|
|
86
|
-
const targets = partitionIds.map((partitionId) => {
|
|
87
|
-
const target = {
|
|
88
|
-
partitionId,
|
|
89
|
-
lastSeqNo: input.appliedSeqNo(partitionId),
|
|
90
|
-
primaryTerm: SINGLE_NODE_PRIMARY_TERM
|
|
91
|
-
};
|
|
92
|
-
if (writeRecords !== null) target.termHistory = writeRecords.termHistoryOf(indexName, partitionId, target.lastSeqNo);
|
|
93
|
-
return target;
|
|
94
|
-
});
|
|
95
|
-
const contents = partitionIds.map(
|
|
96
|
-
(partitionId) => partitionContentsOf(
|
|
97
|
-
input.manager,
|
|
98
|
-
partitionId,
|
|
99
|
-
writeRecords === null ? void 0 : (segments) => writeRecords.captureSegments(indexName, partitionId, segments)
|
|
100
|
-
)
|
|
101
|
-
);
|
|
102
|
-
const plans = /* @__PURE__ */ new Map();
|
|
103
|
-
const partitionDocIds = input.partitionId === null ? null : [...input.manager.getPartition(input.partitionId).docIds()];
|
|
104
|
-
for (const [fieldPath, vectorIndex] of input.vectorIndexes) {
|
|
105
|
-
plans.set(
|
|
106
|
-
fieldPath,
|
|
107
|
-
partitionDocIds === null ? frozenPlan(vectorIndex.planCheckpoint(null)) : partitionVectorPlan(vectorIndex, partitionDocIds)
|
|
108
|
-
);
|
|
109
|
-
}
|
|
110
|
-
return { targets, contents, plans };
|
|
111
|
-
}
|
|
112
|
-
async function buildArchiveFromMemory(input) {
|
|
113
|
-
if (input.partitionId === null) {
|
|
114
|
-
for (const vectorIndex of input.vectorIndexes.values()) await vectorIndex.completeGraph();
|
|
115
|
-
}
|
|
116
|
-
const captured = capture(input);
|
|
117
|
-
const store = memoryCheckpointStore();
|
|
118
|
-
const written = await writeCheckpointSegments({
|
|
119
|
-
store,
|
|
120
|
-
metadata: input.metadata,
|
|
121
|
-
targets: captured.targets,
|
|
122
|
-
compactionThreshold: DEFAULT_COMPACTION_THRESHOLD,
|
|
123
|
-
prior: null,
|
|
124
|
-
wholePartitions: captured.contents,
|
|
125
|
-
keepsWriteRecords: input.writeRecords != null
|
|
126
|
-
});
|
|
127
|
-
const vectors = await writeLiveVectors({ store, indexName: input.indexName, plans: captured.plans, priorVectors: [] });
|
|
128
|
-
const refs = vectors.refs;
|
|
129
|
-
await commitCheckpointManifest(store, input.metadata, written, refs);
|
|
130
|
-
const manifestBytes = store.files.get(manifestKey(input.indexName));
|
|
131
|
-
const decoded = manifestBytes === void 0 ? null : await decodeSegmentManifest(manifestBytes, input.indexName);
|
|
132
|
-
if (manifestBytes === void 0 || decoded === null || decoded.kind !== "current") {
|
|
133
|
-
throw new NarsilError(
|
|
134
|
-
ErrorCodes.PERSISTENCE_SAVE_FAILED,
|
|
135
|
-
`The archive of index "${input.indexName}" holds no manifest`
|
|
136
|
-
);
|
|
137
|
-
}
|
|
138
|
-
return {
|
|
139
|
-
manifestBytes,
|
|
140
|
-
manifest: decoded.manifest,
|
|
141
|
-
readFile: async (ref) => {
|
|
142
|
-
const bytes = store.files.get(ref.key);
|
|
143
|
-
if (bytes === void 0) {
|
|
144
|
-
throw new NarsilError(ErrorCodes.PERSISTENCE_SAVE_FAILED, `The archive file "${ref.key}" is missing`, {
|
|
145
|
-
key: ref.key
|
|
146
|
-
});
|
|
147
|
-
}
|
|
148
|
-
return bytes;
|
|
149
|
-
},
|
|
150
|
-
readRange: async (ref, offset, length) => {
|
|
151
|
-
const bytes = store.files.get(ref.key);
|
|
152
|
-
if (bytes === void 0 || offset + length > bytes.byteLength) {
|
|
153
|
-
throw new NarsilError(ErrorCodes.PERSISTENCE_LOAD_FAILED, `The archive file "${ref.key}" is missing`, {
|
|
154
|
-
key: ref.key
|
|
155
|
-
});
|
|
156
|
-
}
|
|
157
|
-
return bytes.subarray(offset, offset + length);
|
|
158
|
-
},
|
|
159
|
-
release: () => store.files.clear()
|
|
160
|
-
};
|
|
161
|
-
}
|
|
6
|
+
import { NarsilError, ErrorCodes } from './chunk-MP7ABPTD.mjs';
|
|
162
7
|
|
|
163
8
|
// src/persistence/archive/constants.ts
|
|
164
9
|
var MAX_PAX_HEADER_BYTES = 65536;
|
|
165
10
|
var ARCHIVE_FILE_CHUNK_BYTES = 4194304;
|
|
11
|
+
var ARCHIVE_ENTRY_ESTIMATE_BYTES = 1536;
|
|
166
12
|
|
|
167
13
|
// src/persistence/archive/tar.ts
|
|
168
14
|
var TAR_BLOCK_BYTES = 512;
|
|
@@ -443,86 +289,28 @@ async function readSnapshotArchive(reader, handlers) {
|
|
|
443
289
|
while (unread.done !== true) unread = await entry.next();
|
|
444
290
|
await skipPadding(reader, header.size);
|
|
445
291
|
}
|
|
446
|
-
|
|
447
|
-
if (trailing !== null) {
|
|
448
|
-
invalidArchive(`the archive holds the entry "${trailing.name}" that the manifest does not list`, {
|
|
449
|
-
entry: trailing.name
|
|
450
|
-
});
|
|
451
|
-
}
|
|
452
|
-
}
|
|
453
|
-
|
|
454
|
-
// src/persistence/archive/write.ts
|
|
455
|
-
function entryChunks(name, bytes) {
|
|
456
|
-
return [...tarEntryHeaders(name, bytes.byteLength), bytes, tarPadding(bytes.byteLength)].filter(
|
|
457
|
-
(chunk) => chunk.byteLength > 0
|
|
458
|
-
);
|
|
459
|
-
}
|
|
460
|
-
async function* fileEntryChunks(source, name, ref) {
|
|
461
|
-
yield* tarEntryHeaders(name, ref.bytes).filter((chunk) => chunk.byteLength > 0);
|
|
462
|
-
for (let offset = 0; offset < ref.bytes; offset += ARCHIVE_FILE_CHUNK_BYTES) {
|
|
463
|
-
yield await source.readRange(ref, offset, Math.min(ARCHIVE_FILE_CHUNK_BYTES, ref.bytes - offset));
|
|
464
|
-
}
|
|
465
|
-
const padding = tarPadding(ref.bytes);
|
|
466
|
-
if (padding.byteLength > 0) yield padding;
|
|
467
|
-
}
|
|
468
|
-
async function* archiveChunks(source) {
|
|
469
|
-
yield* entryChunks(ARCHIVE_CONFIG_ENTRY, source.config);
|
|
470
|
-
yield* entryChunks(ARCHIVE_MANIFEST_ENTRY, source.manifestBytes);
|
|
471
|
-
const prefix = `${source.sourceIndexName}/`;
|
|
472
|
-
for (const ref of manifestFileRefs(source.manifest)) {
|
|
473
|
-
yield* fileEntryChunks(source, ref.key.slice(prefix.length), ref);
|
|
474
|
-
}
|
|
475
|
-
yield tarEnd();
|
|
292
|
+
await readHistoryEntries(reader, handlers);
|
|
476
293
|
}
|
|
477
|
-
function
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
if (
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
return new ReadableStream({
|
|
486
|
-
async pull(controller) {
|
|
487
|
-
try {
|
|
488
|
-
const step = await chunks.next();
|
|
489
|
-
if (step.done) {
|
|
490
|
-
release();
|
|
491
|
-
controller.close();
|
|
492
|
-
return;
|
|
493
|
-
}
|
|
494
|
-
controller.enqueue(step.value);
|
|
495
|
-
} catch (error) {
|
|
496
|
-
release();
|
|
497
|
-
controller.error(error);
|
|
498
|
-
}
|
|
499
|
-
},
|
|
500
|
-
async cancel() {
|
|
501
|
-
release();
|
|
502
|
-
await chunks.return(void 0);
|
|
294
|
+
async function readHistoryEntries(reader, handlers) {
|
|
295
|
+
for (let position = 0; ; position++) {
|
|
296
|
+
const header = await nextEntryHeader(reader);
|
|
297
|
+
if (header === null) return;
|
|
298
|
+
if (header.name !== `${QUERY_HISTORY_ARCHIVE_PREFIX}${position}`) {
|
|
299
|
+
invalidArchive(`the archive holds the entry "${header.name}" that the manifest does not list`, {
|
|
300
|
+
entry: header.name
|
|
301
|
+
});
|
|
503
302
|
}
|
|
504
|
-
|
|
505
|
-
}
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
await
|
|
514
|
-
return;
|
|
515
|
-
}
|
|
516
|
-
const receiving = `${key}.receiving`;
|
|
517
|
-
await directory.remove(receiving);
|
|
518
|
-
const handle = await directory.appendHandle(receiving);
|
|
519
|
-
try {
|
|
520
|
-
for await (const chunk of chunks) await handle.append(chunk);
|
|
521
|
-
await handle.sync();
|
|
522
|
-
} finally {
|
|
523
|
-
await handle.close();
|
|
303
|
+
if (header.size > MAX_HISTORY_FILE_BYTES) {
|
|
304
|
+
invalidArchive(`the entry "${header.name}" passes the history file limit of ${MAX_HISTORY_FILE_BYTES} bytes`, {
|
|
305
|
+
entry: header.name
|
|
306
|
+
});
|
|
307
|
+
}
|
|
308
|
+
const entry = entryBody(reader, header.size);
|
|
309
|
+
await handlers.history?.(entry);
|
|
310
|
+
let unread = await entry.next();
|
|
311
|
+
while (unread.done !== true) unread = await entry.next();
|
|
312
|
+
await skipPadding(reader, header.size);
|
|
524
313
|
}
|
|
525
|
-
await directory.move(receiving, key);
|
|
526
314
|
}
|
|
527
315
|
|
|
528
|
-
export {
|
|
316
|
+
export { ARCHIVE_CONFIG_ENTRY, ARCHIVE_ENTRY_ESTIMATE_BYTES, ARCHIVE_FILE_CHUNK_BYTES, ARCHIVE_MANIFEST_ENTRY, readSnapshotArchive, sourceIndexNameOf, tarEnd, tarEntryHeaders, tarPadding };
|