@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,60 +1,80 @@
|
|
|
1
|
-
import { documentsOfPayloadV2 } from './chunk-
|
|
2
|
-
import { buildArchiveFromMemory, archiveStream, memoryCheckpointStore,
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { indexMetadataOf, unpackIndexSnapshotEnvelope, loadSegmentedCheckpoint, writeMetadataEnvelope, deserializePayloadV1, SINGLE_NODE_PRIMARY_TERM } from './chunk-ZS6CMXAE.mjs';
|
|
6
|
-
import { readVectorFile, readGraphParts } from './chunk-6RKSY3BX.mjs';
|
|
7
|
-
import { restoredConfigFields, restoredEmbedding, rejectSnapshot } from './chunk-IRWP524D.mjs';
|
|
1
|
+
import { documentsOfPayloadV2 } from './chunk-AILVAOLX.mjs';
|
|
2
|
+
import { buildArchiveFromMemory, archiveStream, memoryCheckpointStore, writeArchiveFile } from './chunk-3HB3PEC6.mjs';
|
|
3
|
+
import { indexMetadataOf, unpackIndexSnapshotEnvelope, loadSegmentedCheckpoint, writeMetadataEnvelope, deserializePayloadV1, SINGLE_NODE_PRIMARY_TERM } from './chunk-3R4UZWQG.mjs';
|
|
4
|
+
import { readVectorFile, readGraphParts } from './chunk-KBDBPVLN.mjs';
|
|
8
5
|
import './chunk-ZXNNR73R.mjs';
|
|
9
|
-
import './chunk-
|
|
10
|
-
import './chunk-
|
|
6
|
+
import './chunk-WZ7YV54N.mjs';
|
|
7
|
+
import './chunk-KFLK5NA2.mjs';
|
|
11
8
|
import './chunk-MATMVH65.mjs';
|
|
12
9
|
import './chunk-VD7J552I.mjs';
|
|
13
|
-
import {
|
|
14
|
-
import './chunk-
|
|
15
|
-
import './chunk-
|
|
10
|
+
import { requireRestoreMemory, earlierSnapshotFootprint, storedBytesOfSegments, archiveFootprint } from './chunk-KPIV4RUC.mjs';
|
|
11
|
+
import { restoredConfigFields, restoredEmbedding, rejectSnapshot } from './chunk-INJYO3BU.mjs';
|
|
12
|
+
import { MAX_SNAPSHOT_ANALYSIS_ATTEMPTS } from './chunk-ZYAY26KG.mjs';
|
|
13
|
+
import { createByteReader } from './chunk-CZQ33DLW.mjs';
|
|
14
|
+
import { readSnapshotArchive } from './chunk-U4BS74YN.mjs';
|
|
15
|
+
import './chunk-SY3EWKQY.mjs';
|
|
16
|
+
import { decodeVectorIndexParts, bytesToVectors } from './chunk-K4ZIGL2O.mjs';
|
|
17
|
+
import { newSyncEpoch } from './chunk-BUMREPLU.mjs';
|
|
18
|
+
import './chunk-VQEUR6T6.mjs';
|
|
16
19
|
import './chunk-DJHHF2L5.mjs';
|
|
17
|
-
import './chunk-
|
|
20
|
+
import './chunk-37CD3OKS.mjs';
|
|
21
|
+
import './chunk-S2EQU2GE.mjs';
|
|
22
|
+
import { encodeSegmentManifest } from './chunk-BY6ZDGYS.mjs';
|
|
23
|
+
import { readSegmentFile } from './chunk-J4IWBIVY.mjs';
|
|
24
|
+
import './chunk-KXCVQWOR.mjs';
|
|
25
|
+
import './chunk-UHICS3JI.mjs';
|
|
26
|
+
import './chunk-5FLRXF73.mjs';
|
|
18
27
|
import './chunk-JDDXV6UF.mjs';
|
|
19
|
-
import {
|
|
20
|
-
import './chunk-
|
|
21
|
-
import {
|
|
22
|
-
import './chunk-
|
|
23
|
-
import {
|
|
24
|
-
import
|
|
25
|
-
import
|
|
26
|
-
import {
|
|
27
|
-
import './chunk-
|
|
28
|
+
import { manifestKey, manifestFileRefs } from './chunk-NF4DT3IH.mjs';
|
|
29
|
+
import './chunk-QDZJM7NI.mjs';
|
|
30
|
+
import { storedStateOf } from './chunk-UZRZKNNZ.mjs';
|
|
31
|
+
import './chunk-H4KHPLHJ.mjs';
|
|
32
|
+
import { oneSyncChangeAtATime } from './chunk-V6EUBAIT.mjs';
|
|
33
|
+
import './chunk-GQPTDQCL.mjs';
|
|
34
|
+
import './chunk-5YNRKI2C.mjs';
|
|
35
|
+
import { encodeIndexConfiguration, validateRequiredFieldsInSchema, validateEmbeddingConfig, storedArrayPositionGap, prepareStoredSynonyms, arrayPositionsAreStale, insertDocumentVectors } from './chunk-KMUNHGBQ.mjs';
|
|
36
|
+
import { validatePatternValueLimit, requireSurfaceFormsForPartialFields } from './chunk-L7ZD4L3K.mjs';
|
|
28
37
|
import './chunk-HJSN7UYG.mjs';
|
|
29
|
-
import './chunk-
|
|
38
|
+
import './chunk-LHKOSI2J.mjs';
|
|
30
39
|
import './chunk-XIHUI4KB.mjs';
|
|
31
|
-
import './chunk-Q2UL2TPC.mjs';
|
|
32
40
|
import './chunk-3MXV3VHR.mjs';
|
|
33
41
|
import './chunk-EEBCDP36.mjs';
|
|
34
|
-
import {
|
|
42
|
+
import { decodeEveryStoredDocument } from './chunk-Z2BE2MAM.mjs';
|
|
43
|
+
import { ARRAY_POSITION_GAP, isCompositePartition } from './chunk-ZAUJFLEN.mjs';
|
|
44
|
+
import { decodeIndexConfiguration } from './chunk-GH4WQ22V.mjs';
|
|
45
|
+
import { hasNrslMagic, HEADER_SIZE, readHeader } from './chunk-3OH67G7R.mjs';
|
|
46
|
+
import './chunk-IPN7S4KX.mjs';
|
|
47
|
+
import './chunk-KAKQ74LS.mjs';
|
|
48
|
+
import './chunk-7GXJUJ24.mjs';
|
|
49
|
+
import './chunk-Q2UL2TPC.mjs';
|
|
50
|
+
import './chunk-LC3FDWTX.mjs';
|
|
51
|
+
import './chunk-JUKYYXSP.mjs';
|
|
52
|
+
import { raiseEarlierReleaseGraphSetting, validateVectorPromotion, validateVectorStorage, validateTextStorage, parseVectorDimension } from './chunk-4KRC2APY.mjs';
|
|
53
|
+
import './chunk-FQBFZAWG.mjs';
|
|
54
|
+
import { validateSchema, flattenSchema } from './chunk-WQRN64Q6.mjs';
|
|
55
|
+
import './chunk-GES7U2PM.mjs';
|
|
56
|
+
import './chunk-I54T6CQP.mjs';
|
|
57
|
+
import './chunk-YEDIDCR7.mjs';
|
|
35
58
|
import './chunk-X5CV2E2B.mjs';
|
|
59
|
+
import { emitSyncChange } from './chunk-Y4WPNHMC.mjs';
|
|
60
|
+
import { getLanguage, resolveIndexAnalysis } from './chunk-RZWWB2XR.mjs';
|
|
36
61
|
import './chunk-TGP5M5R7.mjs';
|
|
62
|
+
import './chunk-4BYWRYPM.mjs';
|
|
63
|
+
import './chunk-4UMZ7KQL.mjs';
|
|
37
64
|
import './chunk-U2BKYEC7.mjs';
|
|
38
|
-
import { loadVectorCodeFor } from './chunk-DGRM4EZZ.mjs';
|
|
39
65
|
import './chunk-QHPYS427.mjs';
|
|
40
66
|
import './chunk-QYRNLLLI.mjs';
|
|
67
|
+
import { loadVectorCodeFor } from './chunk-HNVVEQP7.mjs';
|
|
41
68
|
import './chunk-ZXNQEW43.mjs';
|
|
69
|
+
import './chunk-L5ORED7V.mjs';
|
|
42
70
|
import './chunk-KOKM4PQN.mjs';
|
|
43
|
-
import './chunk-
|
|
44
|
-
import './chunk-LQG5G2LY.mjs';
|
|
71
|
+
import './chunk-Q7G3BV3Y.mjs';
|
|
45
72
|
import './chunk-BTPGQC6Z.mjs';
|
|
46
|
-
import './chunk-
|
|
47
|
-
import './chunk-U46IZNCW.mjs';
|
|
48
|
-
import './chunk-JUKYYXSP.mjs';
|
|
49
|
-
import { raiseEarlierReleaseGraphSetting, validateSchema, validateVectorPromotion, validateVectorStorage, validateTextStorage, flattenSchema, parseVectorDimension } from './chunk-SOUZMPME.mjs';
|
|
50
|
-
import './chunk-FQBFZAWG.mjs';
|
|
51
|
-
import './chunk-65WCV5JO.mjs';
|
|
52
|
-
import './chunk-4UMZ7KQL.mjs';
|
|
73
|
+
import './chunk-LQG5G2LY.mjs';
|
|
53
74
|
import './chunk-ZXX5GZEX.mjs';
|
|
54
|
-
import './chunk-
|
|
55
|
-
import './chunk-L5ORED7V.mjs';
|
|
75
|
+
import './chunk-RFBLQLLZ.mjs';
|
|
56
76
|
import { MAX_FILE_BYTES } from './chunk-U476IXKQ.mjs';
|
|
57
|
-
import { NarsilError, ErrorCodes } from './chunk-
|
|
77
|
+
import { NarsilError, ErrorCodes } from './chunk-MP7ABPTD.mjs';
|
|
58
78
|
import './chunk-R6A773WK.mjs';
|
|
59
79
|
import './chunk-YTJCGKM4.mjs';
|
|
60
80
|
import { decode } from '@msgpack/msgpack';
|
|
@@ -84,7 +104,7 @@ async function validateStagedCheckpoint(store, manifest) {
|
|
|
84
104
|
for (const ref of partition.segments) {
|
|
85
105
|
const { directory } = store;
|
|
86
106
|
if (directory !== void 0) {
|
|
87
|
-
const { checkPagedSegmentFully, isPagedSegmentFile } = await import('./module-
|
|
107
|
+
const { checkPagedSegmentFully, isPagedSegmentFile } = await import('./module-DWKPBSMN.mjs');
|
|
88
108
|
if (await isPagedSegmentFile(directory, ref.key)) {
|
|
89
109
|
requireSchemaOfManifest(ref.key, await checkPagedSegmentFully(directory, ref), manifest);
|
|
90
110
|
continue;
|
|
@@ -181,7 +201,8 @@ function prepareRestoredIndex(configuration, deps, reject) {
|
|
|
181
201
|
storedRevision,
|
|
182
202
|
analysisGeneration,
|
|
183
203
|
storedArrayPositionGap: storedArrayPositionGap(configuration.arrayPositionGap),
|
|
184
|
-
synonyms
|
|
204
|
+
synonyms,
|
|
205
|
+
querySuggestions: storedStateOf(configuration)
|
|
185
206
|
};
|
|
186
207
|
}
|
|
187
208
|
function restoredSynonyms(raw, config, language, reject) {
|
|
@@ -217,7 +238,9 @@ function restoredRegistryEntry(prepared, manager, deps) {
|
|
|
217
238
|
synonyms: prepared.synonyms?.encoded ?? null,
|
|
218
239
|
analysisGeneration: prepared.analysisGeneration,
|
|
219
240
|
pendingAnalysis: null,
|
|
220
|
-
durableAnalysis: null
|
|
241
|
+
durableAnalysis: null,
|
|
242
|
+
sync: null,
|
|
243
|
+
querySuggestions: prepared.querySuggestions
|
|
221
244
|
};
|
|
222
245
|
}
|
|
223
246
|
|
|
@@ -330,6 +353,7 @@ async function replaceExisting(indexName, restored, entry, deps) {
|
|
|
330
353
|
for (const vectorIndex of vectorIndexes) await vectorIndex.releaseVectorFiles();
|
|
331
354
|
await commitToStorage(indexName, restored, previous?.partitionCount ?? 0, deps);
|
|
332
355
|
activate(indexName, restored, entry, deps);
|
|
356
|
+
await deps.querySuggestions?.afterActivate(entry);
|
|
333
357
|
});
|
|
334
358
|
} finally {
|
|
335
359
|
const ending = endRelease(indexName, release, deps).catch(() => void 0);
|
|
@@ -344,6 +368,7 @@ async function createFresh(indexName, restored, entry, deps) {
|
|
|
344
368
|
await deps.indexState.registerReplacing(indexName, async () => {
|
|
345
369
|
await commitToStorage(indexName, restored, 0, deps);
|
|
346
370
|
activate(indexName, restored, entry, deps);
|
|
371
|
+
await deps.querySuggestions?.afterActivate(entry);
|
|
347
372
|
});
|
|
348
373
|
} catch (error) {
|
|
349
374
|
if (deps.indexRegistry.get(indexName) === entry) deps.indexRegistry.delete(indexName);
|
|
@@ -356,10 +381,14 @@ async function stageMetadata(indexName, staging, entry) {
|
|
|
356
381
|
const metadata = indexMetadataOf(indexName, entry, entry.partitionCount);
|
|
357
382
|
await staging.store.write(`${indexName}/meta`, [await writeMetadataEnvelope(metadata, { checksum: true })]);
|
|
358
383
|
}
|
|
359
|
-
async function installRestoredIndex(indexName, restored, deps) {
|
|
384
|
+
async function installRestoredIndex(indexName, restored, deps, history = null) {
|
|
360
385
|
const entry = restoredRegistryEntry(restored.prepared, restored.detached.manager, deps);
|
|
386
|
+
const previousSync = deps.indexRegistry.get(indexName)?.sync ?? null;
|
|
387
|
+
if (previousSync !== null) entry.sync = { ...previousSync, active: false, epoch: newSyncEpoch() };
|
|
361
388
|
let replaced;
|
|
362
389
|
try {
|
|
390
|
+
if (deps.indexRegistry.has(indexName)) await deps.abandonAnalysisChange(indexName);
|
|
391
|
+
await deps.querySuggestions?.beforeInstall(entry, deps.indexRegistry.get(indexName));
|
|
363
392
|
if (restored.staging !== null) await stageMetadata(indexName, restored.staging, entry);
|
|
364
393
|
replaced = deps.indexRegistry.get(indexName);
|
|
365
394
|
if (replaced !== void 0) await replaceExisting(indexName, restored, entry, deps);
|
|
@@ -375,9 +404,17 @@ async function installRestoredIndex(indexName, restored, deps) {
|
|
|
375
404
|
await durable.persistMetadata(indexName);
|
|
376
405
|
await durable.checkpoint(indexName);
|
|
377
406
|
}
|
|
407
|
+
if (previousSync !== null) {
|
|
408
|
+
const storage = durable?.syncStorage?.();
|
|
409
|
+
if (storage !== void 0)
|
|
410
|
+
await oneSyncChangeAtATime(deps.indexRegistry, indexName, () => storage.release(indexName));
|
|
411
|
+
emitSyncChange(deps.indexRegistry, { kind: "epoch", indexName });
|
|
412
|
+
}
|
|
413
|
+
await deps.querySuggestions?.afterInstall(entry, history);
|
|
378
414
|
if (replaced !== void 0) await deps.announceIndexDropped(indexName, replaced.config);
|
|
379
415
|
await deps.announceIndexCreated(indexName, restored.prepared.config);
|
|
380
416
|
for (const vectorIndex of restored.detached.manager.getVectorIndexes().values()) {
|
|
417
|
+
vectorIndex.scheduleBuild();
|
|
381
418
|
vectorIndex.startShuffledRebuildWhenDue();
|
|
382
419
|
}
|
|
383
420
|
}
|
|
@@ -424,9 +461,14 @@ function missingPart(what) {
|
|
|
424
461
|
function keepsTextOnDisk(prepared, staging) {
|
|
425
462
|
return prepared.config.textStorage === "disk" && staging.directory !== void 0;
|
|
426
463
|
}
|
|
427
|
-
async function stageArchive(indexName, reader, staging, deps) {
|
|
428
|
-
const staged = { prepared: null, manifest: null };
|
|
464
|
+
async function stageArchive(indexName, reader, staging, deps, staged) {
|
|
429
465
|
await readSnapshotArchive(reader, {
|
|
466
|
+
history: async (chunks) => {
|
|
467
|
+
if (staged.history === void 0) {
|
|
468
|
+
staged.history = await deps.querySuggestions?.historySink(staged.prepared?.querySuggestions ?? null) ?? null;
|
|
469
|
+
}
|
|
470
|
+
await staged.history?.add(chunks);
|
|
471
|
+
},
|
|
430
472
|
config: async (bytes) => {
|
|
431
473
|
staged.prepared = prepareRestoredIndex(await decodeIndexConfiguration(bytes), deps, rejectConfiguration);
|
|
432
474
|
},
|
|
@@ -452,7 +494,7 @@ async function stageArchive(indexName, reader, staging, deps) {
|
|
|
452
494
|
if (manifest === null) missingPart("manifest");
|
|
453
495
|
const { directory } = staging;
|
|
454
496
|
if (keepsTextOnDisk(prepared, staging) && directory !== void 0) {
|
|
455
|
-
const { bytesThatSegmentsHoldInMemory } = await import('./module-
|
|
497
|
+
const { bytesThatSegmentsHoldInMemory } = await import('./module-DWKPBSMN.mjs');
|
|
456
498
|
const replacesIndex = deps.indexRegistry.has(indexName);
|
|
457
499
|
const segmentBytes = await bytesThatSegmentsHoldInMemory(directory, manifest);
|
|
458
500
|
requireRestoreMemory(indexName, archiveFootprint(prepared, manifest, replacesIndex, segmentBytes), replacesIndex);
|
|
@@ -481,9 +523,14 @@ async function loadStagedIndex(indexName, staged, staging, store, deps) {
|
|
|
481
523
|
async function restoreArchive(indexName, reader, deps) {
|
|
482
524
|
const staging = deps.durability?.manager.stageRestore?.(indexName) ?? null;
|
|
483
525
|
const store = staging?.store ?? memoryCheckpointStore();
|
|
526
|
+
const archive = { prepared: null, manifest: null, history: void 0 };
|
|
484
527
|
try {
|
|
485
|
-
const staged = await stageArchive(indexName, reader, store, deps);
|
|
486
|
-
|
|
528
|
+
const staged = await stageArchive(indexName, reader, store, deps, archive);
|
|
529
|
+
const restored = await loadStagedIndex(indexName, staged, staging, store, deps);
|
|
530
|
+
await installRestoredIndex(indexName, restored, deps, archive.history ?? null);
|
|
531
|
+
} catch (error) {
|
|
532
|
+
await archive.history?.abandon().catch(() => void 0);
|
|
533
|
+
throw error;
|
|
487
534
|
} finally {
|
|
488
535
|
await staging?.discard().catch(() => void 0);
|
|
489
536
|
await reader.close();
|
|
@@ -638,13 +685,23 @@ async function checkpointForArchive(deps) {
|
|
|
638
685
|
partitionId: null
|
|
639
686
|
});
|
|
640
687
|
}
|
|
641
|
-
async function
|
|
688
|
+
async function* queryHistoryEntries(core, indexName) {
|
|
689
|
+
const { historyArchiveEntries } = await import('./archive-history-E4R73RWD.mjs');
|
|
690
|
+
yield* historyArchiveEntries(core, indexName);
|
|
691
|
+
}
|
|
692
|
+
async function createSnapshot(deps, coreWithAddedHistory) {
|
|
693
|
+
const trailingEntries = coreWithAddedHistory === null ? void 0 : () => queryHistoryEntries(coreWithAddedHistory, deps.indexName);
|
|
642
694
|
for (let attempt = 0; attempt < MAX_SNAPSHOT_ANALYSIS_ATTEMPTS; attempt += 1) {
|
|
643
695
|
const checkpoint = await checkpointForArchive(deps);
|
|
644
696
|
try {
|
|
645
697
|
if ((checkpoint.manifest.analysisGeneration ?? 0) === deps.entry.analysisGeneration) {
|
|
646
698
|
const config = await encodeIndexConfiguration(deps.entry);
|
|
647
|
-
return archiveStream({
|
|
699
|
+
return archiveStream({
|
|
700
|
+
...checkpoint,
|
|
701
|
+
config,
|
|
702
|
+
sourceIndexName: deps.indexName,
|
|
703
|
+
...trailingEntries !== void 0 ? { trailingEntries } : {}
|
|
704
|
+
});
|
|
648
705
|
}
|
|
649
706
|
} catch (error) {
|
|
650
707
|
checkpoint.release();
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
export { localRuntimeOf } from './chunk-QUJHMPTP.mjs';
|
|
2
|
+
import './chunk-PHQNACDT.mjs';
|
|
3
|
+
import './chunk-S5LN746F.mjs';
|
|
4
|
+
import './chunk-3HHQLEEQ.mjs';
|
|
5
|
+
import './chunk-VHBNF4MA.mjs';
|
|
6
|
+
import './chunk-KP7TYHWT.mjs';
|
|
7
|
+
import './chunk-LNGE7SLY.mjs';
|
|
8
|
+
import './chunk-H4KHPLHJ.mjs';
|
|
9
|
+
import './chunk-V6EUBAIT.mjs';
|
|
10
|
+
import './chunk-BEZH7VEH.mjs';
|
|
11
|
+
import './chunk-BDRIVYOK.mjs';
|
|
12
|
+
import './chunk-6L3XJXGU.mjs';
|
|
13
|
+
import './chunk-GQPTDQCL.mjs';
|
|
14
|
+
import './chunk-5YNRKI2C.mjs';
|
|
15
|
+
import './chunk-KMUNHGBQ.mjs';
|
|
16
|
+
import './chunk-L7ZD4L3K.mjs';
|
|
17
|
+
import './chunk-HJSN7UYG.mjs';
|
|
18
|
+
import './chunk-LHKOSI2J.mjs';
|
|
19
|
+
import './chunk-XIHUI4KB.mjs';
|
|
20
|
+
import './chunk-3MXV3VHR.mjs';
|
|
21
|
+
import './chunk-EEBCDP36.mjs';
|
|
22
|
+
import './chunk-Z2BE2MAM.mjs';
|
|
23
|
+
import './chunk-ZAUJFLEN.mjs';
|
|
24
|
+
import './chunk-GH4WQ22V.mjs';
|
|
25
|
+
import './chunk-3OH67G7R.mjs';
|
|
26
|
+
import './chunk-IPN7S4KX.mjs';
|
|
27
|
+
import './chunk-KAKQ74LS.mjs';
|
|
28
|
+
import './chunk-7GXJUJ24.mjs';
|
|
29
|
+
import './chunk-Q2UL2TPC.mjs';
|
|
30
|
+
import './chunk-LC3FDWTX.mjs';
|
|
31
|
+
import './chunk-JUKYYXSP.mjs';
|
|
32
|
+
import './chunk-4KRC2APY.mjs';
|
|
33
|
+
import './chunk-FQBFZAWG.mjs';
|
|
34
|
+
import './chunk-WQRN64Q6.mjs';
|
|
35
|
+
import './chunk-GES7U2PM.mjs';
|
|
36
|
+
import './chunk-I54T6CQP.mjs';
|
|
37
|
+
import './chunk-YEDIDCR7.mjs';
|
|
38
|
+
import './chunk-X5CV2E2B.mjs';
|
|
39
|
+
import './chunk-Y4WPNHMC.mjs';
|
|
40
|
+
import './chunk-RZWWB2XR.mjs';
|
|
41
|
+
import './chunk-TGP5M5R7.mjs';
|
|
42
|
+
import './chunk-4BYWRYPM.mjs';
|
|
43
|
+
import './chunk-4UMZ7KQL.mjs';
|
|
44
|
+
import './chunk-U2BKYEC7.mjs';
|
|
45
|
+
import './chunk-QHPYS427.mjs';
|
|
46
|
+
import './chunk-QYRNLLLI.mjs';
|
|
47
|
+
import './chunk-HNVVEQP7.mjs';
|
|
48
|
+
import './chunk-ZXNQEW43.mjs';
|
|
49
|
+
import './chunk-L5ORED7V.mjs';
|
|
50
|
+
import './chunk-KOKM4PQN.mjs';
|
|
51
|
+
import './chunk-Q7G3BV3Y.mjs';
|
|
52
|
+
import './chunk-BTPGQC6Z.mjs';
|
|
53
|
+
import './chunk-LQG5G2LY.mjs';
|
|
54
|
+
import './chunk-ZXX5GZEX.mjs';
|
|
55
|
+
import './chunk-RFBLQLLZ.mjs';
|
|
56
|
+
import './chunk-U476IXKQ.mjs';
|
|
57
|
+
import './chunk-MP7ABPTD.mjs';
|
|
58
|
+
import './chunk-R6A773WK.mjs';
|
|
59
|
+
import './chunk-YTJCGKM4.mjs';
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { d as DeviceSyncStore } from '../types-BZCGjfLn.js';
|
|
2
|
+
import '../engine-CFxPYqEk.js';
|
|
3
|
+
import '../adapters-pljAqmrC.js';
|
|
4
|
+
import '../schema-Jwt928nJ.js';
|
|
5
|
+
import '../synonyms-CpOAHPa-.js';
|
|
6
|
+
import '../query-suggestions-CBYkrQ5T.js';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* The settings of {@link createFilesystemDeviceStore}.
|
|
10
|
+
*
|
|
11
|
+
* @public
|
|
12
|
+
*/
|
|
13
|
+
interface FilesystemDeviceStoreConfig {
|
|
14
|
+
/** The store keeps its files in this directory, which it creates where it is missing and locks while it is open. */
|
|
15
|
+
directory: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Opens a store that keeps a synced device's queue, kept feed entries, position, and snapshot download in files, for
|
|
19
|
+
* an app on Node.js, Electron, or another runtime with `node:fs`.
|
|
20
|
+
*
|
|
21
|
+
* Each write reaches the disk through `fsync` before its promise resolves, and the store drops a record that a crash
|
|
22
|
+
* cut short when it next opens. Only one store may hold the directory open at a time.
|
|
23
|
+
*
|
|
24
|
+
* @param config - The directory that holds the files.
|
|
25
|
+
* @returns The open store, which {@link DeviceSyncStore.close} releases.
|
|
26
|
+
* @public
|
|
27
|
+
*/
|
|
28
|
+
declare function createFilesystemDeviceStore(config: FilesystemDeviceStoreConfig): Promise<DeviceSyncStore>;
|
|
29
|
+
|
|
30
|
+
export { type FilesystemDeviceStoreConfig, createFilesystemDeviceStore };
|
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
import { replayQueue, decodeKeptEntries, encodeKeptEntries, encodeQueueRecord, encodePosition, decodePosition, decodeDownloadTag, downloadOutOfOrder, encodeDownloadTag } from '../chunk-KJ3RTZDJ.mjs';
|
|
2
|
+
import { createSerial, QUEUE_COMPACTION_BYTES, DOWNLOAD_FRAME_BYTES, STORE_FRAME_LIMIT_BYTES } from '../chunk-6MSZ543Y.mjs';
|
|
3
|
+
import '../chunk-BUMREPLU.mjs';
|
|
4
|
+
import { createDurableDirectory } from '../chunk-ZHCUZZE5.mjs';
|
|
5
|
+
import '../chunk-HLPRHOSO.mjs';
|
|
6
|
+
import '../chunk-QDZJM7NI.mjs';
|
|
7
|
+
import '../chunk-BEZH7VEH.mjs';
|
|
8
|
+
import { crc32 } from '../chunk-7GXJUJ24.mjs';
|
|
9
|
+
import '../chunk-Q2UL2TPC.mjs';
|
|
10
|
+
import '../chunk-ZXNQEW43.mjs';
|
|
11
|
+
import '../chunk-U476IXKQ.mjs';
|
|
12
|
+
import { NarsilError, ErrorCodes } from '../chunk-MP7ABPTD.mjs';
|
|
13
|
+
import '../chunk-R6A773WK.mjs';
|
|
14
|
+
import '../chunk-YTJCGKM4.mjs';
|
|
15
|
+
|
|
16
|
+
// src/sync/device/stores/frames.ts
|
|
17
|
+
var FRAME_HEADER_BYTES = 8;
|
|
18
|
+
function frameOf(payload) {
|
|
19
|
+
const frame = new Uint8Array(FRAME_HEADER_BYTES + payload.byteLength);
|
|
20
|
+
const view = new DataView(frame.buffer);
|
|
21
|
+
view.setUint32(0, payload.byteLength, false);
|
|
22
|
+
view.setUint32(4, crc32(payload), false);
|
|
23
|
+
frame.set(payload, FRAME_HEADER_BYTES);
|
|
24
|
+
return frame;
|
|
25
|
+
}
|
|
26
|
+
function readFrames(bytes) {
|
|
27
|
+
const payloads = [];
|
|
28
|
+
const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
29
|
+
let at = 0;
|
|
30
|
+
while (at + FRAME_HEADER_BYTES <= bytes.byteLength) {
|
|
31
|
+
const length = view.getUint32(at, false);
|
|
32
|
+
const checksum = view.getUint32(at + 4, false);
|
|
33
|
+
const end = at + FRAME_HEADER_BYTES + length;
|
|
34
|
+
if (length > STORE_FRAME_LIMIT_BYTES || end > bytes.byteLength) break;
|
|
35
|
+
const payload = bytes.subarray(at + FRAME_HEADER_BYTES, end);
|
|
36
|
+
if (crc32(payload) !== checksum) break;
|
|
37
|
+
payloads.push(payload);
|
|
38
|
+
at = end;
|
|
39
|
+
}
|
|
40
|
+
return { payloads, cleanLength: at };
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// src/sync/device/stores/filesystem-download.ts
|
|
44
|
+
var DOWNLOAD_TAG_KEY = "download.tag";
|
|
45
|
+
var DOWNLOAD_BYTES_KEY = "download.bin";
|
|
46
|
+
var FRAME_HEADER_BYTES2 = 8;
|
|
47
|
+
async function readHeader(readRange, at) {
|
|
48
|
+
const header = await readRange(DOWNLOAD_BYTES_KEY, at, FRAME_HEADER_BYTES2);
|
|
49
|
+
const view = new DataView(header.buffer, header.byteOffset, header.byteLength);
|
|
50
|
+
return { length: view.getUint32(0, false), checksum: view.getUint32(4, false) };
|
|
51
|
+
}
|
|
52
|
+
async function scanFrames(readRange, onDisk) {
|
|
53
|
+
let savedLength = 0;
|
|
54
|
+
let fileLength = 0;
|
|
55
|
+
while (fileLength + FRAME_HEADER_BYTES2 <= onDisk) {
|
|
56
|
+
const header = await readHeader(readRange, fileLength);
|
|
57
|
+
const end = fileLength + FRAME_HEADER_BYTES2 + header.length;
|
|
58
|
+
if (header.length === 0 || header.length > DOWNLOAD_FRAME_BYTES || end > onDisk) break;
|
|
59
|
+
const payload = await readRange(DOWNLOAD_BYTES_KEY, fileLength + FRAME_HEADER_BYTES2, header.length);
|
|
60
|
+
if (crc32(payload) !== header.checksum) break;
|
|
61
|
+
savedLength += header.length;
|
|
62
|
+
fileLength = end;
|
|
63
|
+
}
|
|
64
|
+
return { savedLength, fileLength };
|
|
65
|
+
}
|
|
66
|
+
async function openFilesystemDownload(directory) {
|
|
67
|
+
const directoryReadRange = directory.readRange;
|
|
68
|
+
if (directoryReadRange === void 0) {
|
|
69
|
+
throw new NarsilError(ErrorCodes.CONFIG_INVALID, "The device sync store needs a directory that reads by position");
|
|
70
|
+
}
|
|
71
|
+
const readRange = (key, offset, length) => directoryReadRange.call(directory, key, offset, length);
|
|
72
|
+
let entityTag = null;
|
|
73
|
+
let savedLength = 0;
|
|
74
|
+
let fileLength = 0;
|
|
75
|
+
const tagBytes = await directory.read(DOWNLOAD_TAG_KEY);
|
|
76
|
+
if (tagBytes !== null) entityTag = decodeDownloadTag(tagBytes);
|
|
77
|
+
if (entityTag === null) {
|
|
78
|
+
await directory.remove(DOWNLOAD_BYTES_KEY);
|
|
79
|
+
} else {
|
|
80
|
+
const scanned = await scanFrames(readRange, await directory.byteLength?.(DOWNLOAD_BYTES_KEY) ?? 0);
|
|
81
|
+
savedLength = scanned.savedLength;
|
|
82
|
+
fileLength = scanned.fileLength;
|
|
83
|
+
}
|
|
84
|
+
let handle = await directory.appendHandle(DOWNLOAD_BYTES_KEY);
|
|
85
|
+
if (await handle.size() !== fileLength) await handle.truncate(fileLength);
|
|
86
|
+
async function reset(nextTag) {
|
|
87
|
+
await handle.close();
|
|
88
|
+
await directory.remove(DOWNLOAD_BYTES_KEY);
|
|
89
|
+
if (nextTag === null) {
|
|
90
|
+
await directory.remove(DOWNLOAD_TAG_KEY);
|
|
91
|
+
} else {
|
|
92
|
+
await directory.atomicWrite(DOWNLOAD_TAG_KEY, encodeDownloadTag(nextTag));
|
|
93
|
+
}
|
|
94
|
+
entityTag = nextTag;
|
|
95
|
+
savedLength = 0;
|
|
96
|
+
fileLength = 0;
|
|
97
|
+
handle = await directory.appendHandle(DOWNLOAD_BYTES_KEY);
|
|
98
|
+
}
|
|
99
|
+
return {
|
|
100
|
+
async append(tag, offset, chunk) {
|
|
101
|
+
if (offset === 0) {
|
|
102
|
+
await reset(tag);
|
|
103
|
+
} else if (tag !== entityTag || offset !== savedLength) {
|
|
104
|
+
throw downloadOutOfOrder(tag, offset, tag === entityTag ? savedLength : 0);
|
|
105
|
+
}
|
|
106
|
+
try {
|
|
107
|
+
for (let at = 0; at < chunk.byteLength; at += DOWNLOAD_FRAME_BYTES) {
|
|
108
|
+
await handle.append(frameOf(chunk.subarray(at, at + DOWNLOAD_FRAME_BYTES)));
|
|
109
|
+
}
|
|
110
|
+
await handle.sync();
|
|
111
|
+
} catch (error) {
|
|
112
|
+
await handle.truncate(fileLength).catch(() => void 0);
|
|
113
|
+
throw error;
|
|
114
|
+
}
|
|
115
|
+
savedLength += chunk.byteLength;
|
|
116
|
+
fileLength = await handle.size();
|
|
117
|
+
},
|
|
118
|
+
read() {
|
|
119
|
+
const tag = entityTag;
|
|
120
|
+
if (tag === null || savedLength === 0) return null;
|
|
121
|
+
const framesEnd = fileLength;
|
|
122
|
+
return {
|
|
123
|
+
entityTag: tag,
|
|
124
|
+
byteLength: savedLength,
|
|
125
|
+
async *chunks() {
|
|
126
|
+
let at = 0;
|
|
127
|
+
while (at < framesEnd) {
|
|
128
|
+
const header = await readHeader(readRange, at);
|
|
129
|
+
yield await readRange(DOWNLOAD_BYTES_KEY, at + FRAME_HEADER_BYTES2, header.length);
|
|
130
|
+
at += FRAME_HEADER_BYTES2 + header.length;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
},
|
|
135
|
+
async clear() {
|
|
136
|
+
await reset(null);
|
|
137
|
+
},
|
|
138
|
+
async close() {
|
|
139
|
+
await handle.close();
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
// src/sync/device/stores/filesystem.ts
|
|
145
|
+
var POSITION_KEY = "position";
|
|
146
|
+
var QUEUE_KEY = "queue.log";
|
|
147
|
+
var KEPT_KEY = "kept.log";
|
|
148
|
+
async function openFramedLog(directory, key) {
|
|
149
|
+
const bytes = await directory.read(key) ?? new Uint8Array(0);
|
|
150
|
+
const { payloads, cleanLength } = readFrames(bytes);
|
|
151
|
+
const handle = await directory.appendHandle(key);
|
|
152
|
+
if (cleanLength !== bytes.byteLength) await handle.truncate(cleanLength);
|
|
153
|
+
return { handle, payloads };
|
|
154
|
+
}
|
|
155
|
+
async function appendDurably(handle, frames) {
|
|
156
|
+
const before = await handle.size();
|
|
157
|
+
try {
|
|
158
|
+
for (const frame of frames) await handle.append(frame);
|
|
159
|
+
await handle.sync();
|
|
160
|
+
} catch (error) {
|
|
161
|
+
await handle.truncate(before).catch(() => void 0);
|
|
162
|
+
throw error;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
async function createFilesystemDeviceStore(config) {
|
|
166
|
+
if (typeof config.directory !== "string" || config.directory.trim().length === 0) {
|
|
167
|
+
throw new NarsilError(ErrorCodes.CONFIG_INVALID, "The device sync store needs a directory");
|
|
168
|
+
}
|
|
169
|
+
const directory = createDurableDirectory(config.directory);
|
|
170
|
+
const lock = await directory.lock?.() ?? null;
|
|
171
|
+
try {
|
|
172
|
+
return await openStore(directory, lock);
|
|
173
|
+
} catch (error) {
|
|
174
|
+
await lock?.release().catch(() => void 0);
|
|
175
|
+
throw error;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
async function openStore(directory, lock) {
|
|
179
|
+
const serial = createSerial();
|
|
180
|
+
const queueLog = await openFramedLog(directory, QUEUE_KEY);
|
|
181
|
+
const queue = replayQueue(queueLog.payloads);
|
|
182
|
+
let queueHandle = queueLog.handle;
|
|
183
|
+
let queueFileBytes = await queueHandle.size();
|
|
184
|
+
const keptLog = await openFramedLog(directory, KEPT_KEY);
|
|
185
|
+
let keptHandle = keptLog.handle;
|
|
186
|
+
const download = await openFilesystemDownload(directory);
|
|
187
|
+
let closed = false;
|
|
188
|
+
function liveQueueBytes() {
|
|
189
|
+
let total = 0;
|
|
190
|
+
for (const bytes of queue.recordBytes.values()) total += bytes;
|
|
191
|
+
return total;
|
|
192
|
+
}
|
|
193
|
+
async function compactQueue() {
|
|
194
|
+
const frames = [frameOf(encodeQueueRecord({ type: "next", sequence: queue.nextSequence }))];
|
|
195
|
+
for (const write of [...queue.writes.values()].sort((a, b) => a.sequence - b.sequence)) {
|
|
196
|
+
frames.push(frameOf(encodeQueueRecord({ type: "write", write })));
|
|
197
|
+
}
|
|
198
|
+
await queueHandle.close();
|
|
199
|
+
await directory.atomicWrite(QUEUE_KEY, frames);
|
|
200
|
+
queueHandle = await directory.appendHandle(QUEUE_KEY);
|
|
201
|
+
queueFileBytes = await queueHandle.size();
|
|
202
|
+
}
|
|
203
|
+
function guarded(task) {
|
|
204
|
+
return serial.run(async () => {
|
|
205
|
+
if (closed) throw new NarsilError(ErrorCodes.CONFIG_INVALID, "The device sync store is closed");
|
|
206
|
+
return task();
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
return {
|
|
210
|
+
readPosition: () => guarded(async () => {
|
|
211
|
+
const bytes = await directory.read(POSITION_KEY);
|
|
212
|
+
return bytes === null ? null : decodePosition(bytes);
|
|
213
|
+
}),
|
|
214
|
+
writePosition: (position) => guarded(async () => {
|
|
215
|
+
if (position === null) {
|
|
216
|
+
await directory.remove(POSITION_KEY);
|
|
217
|
+
} else {
|
|
218
|
+
await directory.atomicWrite(POSITION_KEY, encodePosition(position));
|
|
219
|
+
}
|
|
220
|
+
}),
|
|
221
|
+
appendWrite: (write) => guarded(async () => {
|
|
222
|
+
const queued = { sequence: queue.nextSequence, documentId: write.documentId, document: write.document };
|
|
223
|
+
const frame = frameOf(encodeQueueRecord({ type: "write", write: queued }));
|
|
224
|
+
await appendDurably(queueHandle, [frame]);
|
|
225
|
+
queue.nextSequence += 1;
|
|
226
|
+
queue.writes.set(queued.sequence, queued);
|
|
227
|
+
queue.recordBytes.set(queued.sequence, frame.byteLength);
|
|
228
|
+
queueFileBytes += frame.byteLength;
|
|
229
|
+
return queued;
|
|
230
|
+
}),
|
|
231
|
+
queuedWrites: () => guarded(async () => [...queue.writes.values()].sort((a, b) => a.sequence - b.sequence)),
|
|
232
|
+
removeWrites: (sequences) => guarded(async () => {
|
|
233
|
+
const present = sequences.filter((sequence) => queue.writes.has(sequence));
|
|
234
|
+
if (present.length === 0) return;
|
|
235
|
+
const frame = frameOf(encodeQueueRecord({ type: "removed", sequences: present }));
|
|
236
|
+
await appendDurably(queueHandle, [frame]);
|
|
237
|
+
queueFileBytes += frame.byteLength;
|
|
238
|
+
for (const sequence of present) {
|
|
239
|
+
queue.writes.delete(sequence);
|
|
240
|
+
queue.recordBytes.delete(sequence);
|
|
241
|
+
}
|
|
242
|
+
if (queueFileBytes > QUEUE_COMPACTION_BYTES && liveQueueBytes() * 2 < queueFileBytes) await compactQueue();
|
|
243
|
+
}),
|
|
244
|
+
keepEntries: (entries) => guarded(async () => {
|
|
245
|
+
if (entries.length === 0) return;
|
|
246
|
+
await appendDurably(keptHandle, [frameOf(encodeKeptEntries(entries))]);
|
|
247
|
+
}),
|
|
248
|
+
keptEntries: () => guarded(async () => {
|
|
249
|
+
const bytes = await directory.read(KEPT_KEY) ?? new Uint8Array(0);
|
|
250
|
+
const kept = [];
|
|
251
|
+
for (const payload of readFrames(bytes).payloads) kept.push(...decodeKeptEntries(payload));
|
|
252
|
+
return kept;
|
|
253
|
+
}),
|
|
254
|
+
clearKeptEntries: () => guarded(async () => {
|
|
255
|
+
await keptHandle.close();
|
|
256
|
+
await directory.remove(KEPT_KEY);
|
|
257
|
+
keptHandle = await directory.appendHandle(KEPT_KEY);
|
|
258
|
+
}),
|
|
259
|
+
appendDownload: (entityTag, offset, chunk) => guarded(() => download.append(entityTag, offset, chunk)),
|
|
260
|
+
readDownload: () => guarded(async () => download.read()),
|
|
261
|
+
clearDownload: () => guarded(() => download.clear()),
|
|
262
|
+
close: () => serial.run(async () => {
|
|
263
|
+
if (closed) return;
|
|
264
|
+
closed = true;
|
|
265
|
+
await Promise.allSettled([queueHandle.close(), keptHandle.close(), download.close()]);
|
|
266
|
+
await lock?.release();
|
|
267
|
+
})
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
export { createFilesystemDeviceStore };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { d as DeviceSyncStore } from '../types-BZCGjfLn.js';
|
|
2
|
+
import '../engine-CFxPYqEk.js';
|
|
3
|
+
import '../adapters-pljAqmrC.js';
|
|
4
|
+
import '../schema-Jwt928nJ.js';
|
|
5
|
+
import '../synonyms-CpOAHPa-.js';
|
|
6
|
+
import '../query-suggestions-CBYkrQ5T.js';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* The settings of {@link createIndexedDBDeviceStore}.
|
|
10
|
+
*
|
|
11
|
+
* @public
|
|
12
|
+
*/
|
|
13
|
+
interface IndexedDBDeviceStoreConfig {
|
|
14
|
+
/** The store keeps its records in the IndexedDB database with this name, `narsil-device-sync` by default. */
|
|
15
|
+
databaseName?: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Opens a store that keeps a synced device's queue, kept feed entries, position, and snapshot download in IndexedDB,
|
|
19
|
+
* for an app in a browser.
|
|
20
|
+
*
|
|
21
|
+
* The store commits every write in a strict-durability transaction before its promise resolves.
|
|
22
|
+
*
|
|
23
|
+
* @param config - The database to use. Omit it to accept the default name.
|
|
24
|
+
* @returns The open store, which {@link DeviceSyncStore.close} releases.
|
|
25
|
+
* @throws A `NarsilError` with `CONFIG_INVALID` in a runtime without IndexedDB.
|
|
26
|
+
* @public
|
|
27
|
+
*/
|
|
28
|
+
declare function createIndexedDBDeviceStore(config?: IndexedDBDeviceStoreConfig): Promise<DeviceSyncStore>;
|
|
29
|
+
|
|
30
|
+
export { type IndexedDBDeviceStoreConfig, createIndexedDBDeviceStore };
|