@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
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
import { MAX_FILE_BYTES, CHECKSUM_YIELD_CHUNK_BYTES } from './chunk-6VBXNFLE.mjs';
|
|
2
|
+
import { NarsilError, ErrorCodes } from './chunk-DZ7H7D2C.mjs';
|
|
3
|
+
import { decode } from '@msgpack/msgpack';
|
|
4
|
+
|
|
5
|
+
// src/serialization/header.ts
|
|
6
|
+
var MAGIC_BYTES = new Uint8Array([78, 82, 83, 76]);
|
|
7
|
+
var HEADER_SIZE = 32;
|
|
8
|
+
var MAX_PAYLOAD_LENGTH = 4294967295;
|
|
9
|
+
var COMPRESSION_ALGORITHMS = {
|
|
10
|
+
0: "none",
|
|
11
|
+
1: "gzip",
|
|
12
|
+
2: "lz4",
|
|
13
|
+
3: "zstd"
|
|
14
|
+
};
|
|
15
|
+
var COMPRESSION_TO_BITS = {
|
|
16
|
+
none: 0,
|
|
17
|
+
gzip: 1,
|
|
18
|
+
lz4: 2,
|
|
19
|
+
zstd: 3
|
|
20
|
+
};
|
|
21
|
+
function encodeFlags(flags) {
|
|
22
|
+
let bits = 0;
|
|
23
|
+
if (flags.compressionEnabled) bits |= 1;
|
|
24
|
+
bits |= (COMPRESSION_TO_BITS[flags.compressionAlgorithm] & 3) << 1;
|
|
25
|
+
if (flags.checksumPresent) bits |= 1 << 3;
|
|
26
|
+
if (flags.encryptionEnabled) bits |= 1 << 4;
|
|
27
|
+
return bits;
|
|
28
|
+
}
|
|
29
|
+
function decodeFlags(value) {
|
|
30
|
+
const compressionEnabled = (value & 1) === 1;
|
|
31
|
+
const algorithmBits = value >> 1 & 3;
|
|
32
|
+
const checksumPresent = (value >> 3 & 1) === 1;
|
|
33
|
+
const encryptionEnabled = (value >> 4 & 1) === 1;
|
|
34
|
+
return {
|
|
35
|
+
compressionEnabled,
|
|
36
|
+
compressionAlgorithm: COMPRESSION_ALGORITHMS[algorithmBits] ?? "none",
|
|
37
|
+
checksumPresent,
|
|
38
|
+
encryptionEnabled
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
function writeHeader(header) {
|
|
42
|
+
if (header.payloadLength > MAX_PAYLOAD_LENGTH) {
|
|
43
|
+
throw new NarsilError(
|
|
44
|
+
ErrorCodes.PERSISTENCE_SAVE_FAILED,
|
|
45
|
+
`A payload of ${header.payloadLength} bytes exceeds the ${MAX_PAYLOAD_LENGTH} bytes the envelope header can describe`,
|
|
46
|
+
{ payloadLength: header.payloadLength, maxPayloadLength: MAX_PAYLOAD_LENGTH }
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
const buffer = new Uint8Array(HEADER_SIZE);
|
|
50
|
+
const view = new DataView(buffer.buffer);
|
|
51
|
+
buffer.set(MAGIC_BYTES, 0);
|
|
52
|
+
buffer[4] = header.envelopeFormatVersion & 255;
|
|
53
|
+
buffer[5] = header.engineVersionMajor & 255;
|
|
54
|
+
buffer[6] = header.engineVersionMinor & 255;
|
|
55
|
+
buffer[7] = header.engineVersionPatch & 255;
|
|
56
|
+
view.setUint32(8, header.payloadLength, false);
|
|
57
|
+
view.setUint16(12, encodeFlags(header.flags), false);
|
|
58
|
+
view.setUint32(14, header.checksum, false);
|
|
59
|
+
for (let i = 18; i < HEADER_SIZE; i++) {
|
|
60
|
+
buffer[i] = 0;
|
|
61
|
+
}
|
|
62
|
+
return buffer;
|
|
63
|
+
}
|
|
64
|
+
function hasNrslMagic(data) {
|
|
65
|
+
return data.length >= MAGIC_BYTES.length && data[0] === MAGIC_BYTES[0] && data[1] === MAGIC_BYTES[1] && data[2] === MAGIC_BYTES[2] && data[3] === MAGIC_BYTES[3];
|
|
66
|
+
}
|
|
67
|
+
function readHeader(data) {
|
|
68
|
+
if (data.length < HEADER_SIZE) {
|
|
69
|
+
throw new NarsilError(
|
|
70
|
+
ErrorCodes.ENVELOPE_INVALID_MAGIC,
|
|
71
|
+
`Expected at least ${HEADER_SIZE} bytes, received ${data.length}`
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
if (data[0] !== MAGIC_BYTES[0] || data[1] !== MAGIC_BYTES[1] || data[2] !== MAGIC_BYTES[2] || data[3] !== MAGIC_BYTES[3]) {
|
|
75
|
+
throw new NarsilError(ErrorCodes.ENVELOPE_INVALID_MAGIC, "File does not begin with NRSL magic bytes");
|
|
76
|
+
}
|
|
77
|
+
const view = new DataView(data.buffer, data.byteOffset, data.byteLength);
|
|
78
|
+
const envelopeFormatVersion = data[4];
|
|
79
|
+
const engineVersionMajor = data[5];
|
|
80
|
+
const engineVersionMinor = data[6];
|
|
81
|
+
const engineVersionPatch = data[7];
|
|
82
|
+
const payloadLength = view.getUint32(8, false);
|
|
83
|
+
const flagBits = view.getUint16(12, false);
|
|
84
|
+
const checksum = view.getUint32(14, false);
|
|
85
|
+
const reserved = data.slice(18, HEADER_SIZE);
|
|
86
|
+
return {
|
|
87
|
+
magic: "NRSL",
|
|
88
|
+
envelopeFormatVersion,
|
|
89
|
+
engineVersionMajor,
|
|
90
|
+
engineVersionMinor,
|
|
91
|
+
engineVersionPatch,
|
|
92
|
+
payloadLength,
|
|
93
|
+
flags: decodeFlags(flagBits),
|
|
94
|
+
checksum,
|
|
95
|
+
reserved
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// src/serialization/crc32.ts
|
|
100
|
+
var IEEE_POLYNOMIAL = 3988292384;
|
|
101
|
+
var ALL_BITS = 4294967295;
|
|
102
|
+
var cachedTable = null;
|
|
103
|
+
function buildTable() {
|
|
104
|
+
const table = new Uint32Array(256);
|
|
105
|
+
for (let i = 0; i < 256; i++) {
|
|
106
|
+
let crc = i;
|
|
107
|
+
for (let bit = 0; bit < 8; bit++) {
|
|
108
|
+
crc = crc & 1 ? crc >>> 1 ^ IEEE_POLYNOMIAL : crc >>> 1;
|
|
109
|
+
}
|
|
110
|
+
table[i] = crc;
|
|
111
|
+
}
|
|
112
|
+
return table;
|
|
113
|
+
}
|
|
114
|
+
function getTable() {
|
|
115
|
+
if (cachedTable === null) {
|
|
116
|
+
cachedTable = buildTable();
|
|
117
|
+
}
|
|
118
|
+
return cachedTable;
|
|
119
|
+
}
|
|
120
|
+
function crc32(data) {
|
|
121
|
+
return crc32Final(crc32Update(crc32Init(), data));
|
|
122
|
+
}
|
|
123
|
+
function crc32Init() {
|
|
124
|
+
return ALL_BITS;
|
|
125
|
+
}
|
|
126
|
+
function crc32Update(state, data) {
|
|
127
|
+
const table = getTable();
|
|
128
|
+
let crc = state;
|
|
129
|
+
for (let i = 0; i < data.length; i++) {
|
|
130
|
+
crc = crc >>> 8 ^ table[(crc ^ data[i]) & 255];
|
|
131
|
+
}
|
|
132
|
+
return crc;
|
|
133
|
+
}
|
|
134
|
+
function crc32Final(state) {
|
|
135
|
+
return (state ^ ALL_BITS) >>> 0;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
// src/serialization/chunk-checksum.ts
|
|
139
|
+
function yieldToEventLoop() {
|
|
140
|
+
if (typeof setImmediate === "function") {
|
|
141
|
+
return new Promise((resolve) => setImmediate(resolve));
|
|
142
|
+
}
|
|
143
|
+
return new Promise((resolve) => setTimeout(resolve, 0));
|
|
144
|
+
}
|
|
145
|
+
async function advanceChecksum(start, payload) {
|
|
146
|
+
let state = start;
|
|
147
|
+
for (let offset = 0; offset < payload.length; offset += CHECKSUM_YIELD_CHUNK_BYTES) {
|
|
148
|
+
const end = Math.min(offset + CHECKSUM_YIELD_CHUNK_BYTES, payload.length);
|
|
149
|
+
state = crc32Update(state, payload.subarray(offset, end));
|
|
150
|
+
if (end < payload.length) {
|
|
151
|
+
await yieldToEventLoop();
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
return state;
|
|
155
|
+
}
|
|
156
|
+
async function checksumOfChunks(chunks) {
|
|
157
|
+
let state = crc32Init();
|
|
158
|
+
for (const chunk of chunks) state = await advanceChecksum(state, chunk);
|
|
159
|
+
return crc32Final(state);
|
|
160
|
+
}
|
|
161
|
+
function payloadByteLength(chunks) {
|
|
162
|
+
let total = 0;
|
|
163
|
+
for (const chunk of chunks) total += chunk.byteLength;
|
|
164
|
+
return total;
|
|
165
|
+
}
|
|
166
|
+
function requireWithinFileLimit(byteLength, what) {
|
|
167
|
+
if (byteLength <= MAX_FILE_BYTES) return;
|
|
168
|
+
throw new NarsilError(
|
|
169
|
+
ErrorCodes.PERSISTENCE_SAVE_FAILED,
|
|
170
|
+
`The ${what} would take ${byteLength} bytes, above the file size limit of ${MAX_FILE_BYTES}`,
|
|
171
|
+
{ bytes: byteLength, maximum: MAX_FILE_BYTES }
|
|
172
|
+
);
|
|
173
|
+
}
|
|
174
|
+
function packEnvelopeWithEngineVersion(payloadChunks, envelopeFormatVersion, what, checksum, engineVersion) {
|
|
175
|
+
const payloadLength = payloadByteLength(payloadChunks);
|
|
176
|
+
requireWithinFileLimit(HEADER_SIZE + payloadLength, what);
|
|
177
|
+
const [major, minor, patch] = engineVersion;
|
|
178
|
+
const header = writeHeader({
|
|
179
|
+
envelopeFormatVersion,
|
|
180
|
+
engineVersionMajor: major,
|
|
181
|
+
engineVersionMinor: minor,
|
|
182
|
+
engineVersionPatch: patch,
|
|
183
|
+
payloadLength,
|
|
184
|
+
flags: { compressionEnabled: false, compressionAlgorithm: "none", checksumPresent: true, encryptionEnabled: false },
|
|
185
|
+
checksum});
|
|
186
|
+
return { chunks: [header, ...payloadChunks], byteLength: HEADER_SIZE + payloadLength, checksum };
|
|
187
|
+
}
|
|
188
|
+
function loadFailed(message, details) {
|
|
189
|
+
throw new NarsilError(ErrorCodes.PERSISTENCE_LOAD_FAILED, message, details);
|
|
190
|
+
}
|
|
191
|
+
async function gunzipWithinLimit(compressed, what) {
|
|
192
|
+
const { gunzip } = await import('./gzip.react-native-HLEPDKZ3.mjs');
|
|
193
|
+
try {
|
|
194
|
+
return await gunzip(compressed, MAX_FILE_BYTES);
|
|
195
|
+
} catch (error) {
|
|
196
|
+
if (error?.code === "EFBIG") {
|
|
197
|
+
loadFailed(`The ${what} inflates past the file size limit of ${MAX_FILE_BYTES} bytes`);
|
|
198
|
+
}
|
|
199
|
+
loadFailed(`The ${what} holds a gzip payload that fails to inflate`, {
|
|
200
|
+
cause: error instanceof Error ? error.message : String(error)
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
async function openChecksummedEnvelope(data, expected) {
|
|
205
|
+
const { envelopeFormatVersion, what } = expected;
|
|
206
|
+
const header = readHeader(data);
|
|
207
|
+
if (header.envelopeFormatVersion !== envelopeFormatVersion) {
|
|
208
|
+
throw new NarsilError(
|
|
209
|
+
ErrorCodes.ENVELOPE_VERSION_MISMATCH,
|
|
210
|
+
`The ${what} holds envelope format v${header.envelopeFormatVersion}, while this build reads it as v${envelopeFormatVersion}`,
|
|
211
|
+
{ version: header.envelopeFormatVersion, expected: envelopeFormatVersion }
|
|
212
|
+
);
|
|
213
|
+
}
|
|
214
|
+
if (header.flags.encryptionEnabled) {
|
|
215
|
+
throw new NarsilError(
|
|
216
|
+
ErrorCodes.ENVELOPE_VERSION_MISMATCH,
|
|
217
|
+
`The ${what} is encrypted, which this build cannot read`
|
|
218
|
+
);
|
|
219
|
+
}
|
|
220
|
+
if (header.flags.compressionEnabled && !expected.allowsCompression) {
|
|
221
|
+
loadFailed(`The ${what} is compressed, while its format stores it raw`);
|
|
222
|
+
}
|
|
223
|
+
if (header.flags.compressionEnabled && header.flags.compressionAlgorithm !== "gzip") {
|
|
224
|
+
throw new NarsilError(
|
|
225
|
+
ErrorCodes.ENVELOPE_VERSION_MISMATCH,
|
|
226
|
+
`The ${what} uses ${header.flags.compressionAlgorithm} compression, which this build cannot read`
|
|
227
|
+
);
|
|
228
|
+
}
|
|
229
|
+
if (!header.flags.checksumPresent) loadFailed(`The ${what} carries no checksum, while its format requires one`);
|
|
230
|
+
if (data.byteLength !== HEADER_SIZE + header.payloadLength) {
|
|
231
|
+
loadFailed(
|
|
232
|
+
`The ${what} holds ${data.byteLength} bytes where its header gives ${HEADER_SIZE + header.payloadLength}`,
|
|
233
|
+
{ bytes: data.byteLength, expected: HEADER_SIZE + header.payloadLength }
|
|
234
|
+
);
|
|
235
|
+
}
|
|
236
|
+
const payload = data.subarray(HEADER_SIZE);
|
|
237
|
+
const computed = await checksumOfChunks([payload]);
|
|
238
|
+
if (computed !== header.checksum) {
|
|
239
|
+
throw new NarsilError(
|
|
240
|
+
ErrorCodes.PERSISTENCE_CRC_MISMATCH,
|
|
241
|
+
`The checksum of the ${what} does not match its payload`,
|
|
242
|
+
{
|
|
243
|
+
expected: header.checksum,
|
|
244
|
+
computed
|
|
245
|
+
}
|
|
246
|
+
);
|
|
247
|
+
}
|
|
248
|
+
if (header.flags.compressionEnabled) return { header, payload: await gunzipWithinLimit(payload, what) };
|
|
249
|
+
return { header, payload };
|
|
250
|
+
}
|
|
251
|
+
var INDEX_CONFIGURATION_ENVELOPE_VERSION = 5;
|
|
252
|
+
function requireConfigurationShape(raw, what) {
|
|
253
|
+
if (raw === null || typeof raw !== "object" || Array.isArray(raw)) {
|
|
254
|
+
throw new NarsilError(ErrorCodes.CONFIG_INVALID, `The ${what} does not hold an index configuration`);
|
|
255
|
+
}
|
|
256
|
+
const configuration = raw;
|
|
257
|
+
if (configuration.schema === null || typeof configuration.schema !== "object") {
|
|
258
|
+
throw new NarsilError(ErrorCodes.CONFIG_INVALID, `The ${what} holds no schema`);
|
|
259
|
+
}
|
|
260
|
+
if (typeof configuration.language !== "string" || configuration.language.length === 0) {
|
|
261
|
+
throw new NarsilError(ErrorCodes.CONFIG_INVALID, `The ${what} holds no language`);
|
|
262
|
+
}
|
|
263
|
+
return configuration;
|
|
264
|
+
}
|
|
265
|
+
async function decodeIndexConfiguration(bytes) {
|
|
266
|
+
const { payload } = await openChecksummedEnvelope(bytes, {
|
|
267
|
+
envelopeFormatVersion: INDEX_CONFIGURATION_ENVELOPE_VERSION,
|
|
268
|
+
what: "index configuration",
|
|
269
|
+
allowsCompression: true
|
|
270
|
+
});
|
|
271
|
+
let raw;
|
|
272
|
+
try {
|
|
273
|
+
raw = decode(payload);
|
|
274
|
+
} catch {
|
|
275
|
+
throw new NarsilError(ErrorCodes.PERSISTENCE_LOAD_FAILED, "The index configuration is not MessagePack");
|
|
276
|
+
}
|
|
277
|
+
return requireConfigurationShape(raw, "index configuration");
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
// src/runtime/heap-statistics.browser.ts
|
|
281
|
+
function readHeapStatistics() {
|
|
282
|
+
return null;
|
|
283
|
+
}
|
|
284
|
+
function readOldGenerationStatistics() {
|
|
285
|
+
return null;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
export { HEADER_SIZE, INDEX_CONFIGURATION_ENVELOPE_VERSION, checksumOfChunks, crc32, crc32Final, crc32Init, crc32Update, decodeIndexConfiguration, hasNrslMagic, openChecksummedEnvelope, packEnvelopeWithEngineVersion, payloadByteLength, readHeader, readHeapStatistics, readOldGenerationStatistics, requireConfigurationShape, requireWithinFileLimit, writeHeader };
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { RESTORED_HISTORY_FOLDER, QUERY_HISTORY_FOLDER, RESTORE_STAGING_INFIX, MAX_HISTORY_FILE_BYTES } from './chunk-PJHAB5ZY.mjs';
|
|
2
|
+
|
|
3
|
+
// src/query-suggestions/history-files.ts
|
|
4
|
+
var BUILD_RECORD_FILE = "build.nrsl";
|
|
5
|
+
var DAY_FILE = /^(\d{4}-\d{2}-\d{2})\.nrsl$/;
|
|
6
|
+
var RESTORED_FILE = /^(\d{4}-\d{2}-\d{2})-(\d{4})\.nrsl$/;
|
|
7
|
+
function historyFolderOf(indexName) {
|
|
8
|
+
return `${QUERY_HISTORY_FOLDER}/${indexName}/`;
|
|
9
|
+
}
|
|
10
|
+
function dayFileKey(indexName, day) {
|
|
11
|
+
return `${historyFolderOf(indexName)}${day}.nrsl`;
|
|
12
|
+
}
|
|
13
|
+
function restoredFileKey(indexName, day, sequence) {
|
|
14
|
+
return `${historyFolderOf(indexName)}${RESTORED_HISTORY_FOLDER}/${day}-${String(sequence).padStart(4, "0")}.nrsl`;
|
|
15
|
+
}
|
|
16
|
+
function buildRecordKey(indexName) {
|
|
17
|
+
return `${historyFolderOf(indexName)}${BUILD_RECORD_FILE}`;
|
|
18
|
+
}
|
|
19
|
+
function historyFileOf(indexName, key) {
|
|
20
|
+
const folder = historyFolderOf(indexName);
|
|
21
|
+
if (!key.startsWith(folder)) return null;
|
|
22
|
+
const rest = key.slice(folder.length);
|
|
23
|
+
const own = DAY_FILE.exec(rest);
|
|
24
|
+
if (own !== null) return { key, day: own[1], restored: false };
|
|
25
|
+
const restoredPrefix = `${RESTORED_HISTORY_FOLDER}/`;
|
|
26
|
+
if (!rest.startsWith(restoredPrefix)) return null;
|
|
27
|
+
const restored = RESTORED_FILE.exec(rest.slice(restoredPrefix.length));
|
|
28
|
+
return restored === null ? null : { key, day: restored[1], restored: true };
|
|
29
|
+
}
|
|
30
|
+
function directoryFiles(storage) {
|
|
31
|
+
const { directory } = storage;
|
|
32
|
+
return {
|
|
33
|
+
listUnder: (prefix) => directory.list(prefix),
|
|
34
|
+
async read(key) {
|
|
35
|
+
const length = await directory.byteLength?.(key) ?? null;
|
|
36
|
+
if (length !== null && length > MAX_HISTORY_FILE_BYTES) return "too-long";
|
|
37
|
+
const bytes = await directory.read(key);
|
|
38
|
+
if (bytes !== null && bytes.byteLength > MAX_HISTORY_FILE_BYTES) return "too-long";
|
|
39
|
+
return bytes;
|
|
40
|
+
},
|
|
41
|
+
write: (key, bytes) => directory.atomicWrite(key, bytes),
|
|
42
|
+
remove: (key) => directory.remove(key)
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
function adapterFiles(storage) {
|
|
46
|
+
const { adapter } = storage;
|
|
47
|
+
return {
|
|
48
|
+
listUnder: (prefix) => adapter.list(prefix),
|
|
49
|
+
async read(key) {
|
|
50
|
+
const bytes = await adapter.load(key);
|
|
51
|
+
if (bytes !== null && bytes.byteLength > MAX_HISTORY_FILE_BYTES) return "too-long";
|
|
52
|
+
return bytes;
|
|
53
|
+
},
|
|
54
|
+
write: (key, bytes) => adapter.save(key, bytes),
|
|
55
|
+
remove: (key) => adapter.delete(key)
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
function memoryFiles() {
|
|
59
|
+
const files = /* @__PURE__ */ new Map();
|
|
60
|
+
return {
|
|
61
|
+
async listUnder(prefix) {
|
|
62
|
+
return [...files.keys()].filter((key) => key.startsWith(prefix)).sort();
|
|
63
|
+
},
|
|
64
|
+
async read(key) {
|
|
65
|
+
return files.get(key) ?? null;
|
|
66
|
+
},
|
|
67
|
+
async write(key, bytes) {
|
|
68
|
+
files.set(key, bytes);
|
|
69
|
+
},
|
|
70
|
+
async remove(key) {
|
|
71
|
+
files.delete(key);
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
function historyFilesOf(storage) {
|
|
76
|
+
if (storage === null) return memoryFiles();
|
|
77
|
+
return storage.kind === "directory" ? directoryFiles(storage) : adapterFiles(storage);
|
|
78
|
+
}
|
|
79
|
+
function listHistoryFolder(files, indexName) {
|
|
80
|
+
return files.listUnder(historyFolderOf(indexName));
|
|
81
|
+
}
|
|
82
|
+
async function removeHistoryFolder(files, indexName) {
|
|
83
|
+
for (const key of await listHistoryFolder(files, indexName)) await files.remove(key);
|
|
84
|
+
}
|
|
85
|
+
function restoreStagingPrefix() {
|
|
86
|
+
return `${QUERY_HISTORY_FOLDER}/${RESTORE_STAGING_INFIX}${globalThis.crypto.randomUUID()}/`;
|
|
87
|
+
}
|
|
88
|
+
async function removeRestoreLeftovers(files) {
|
|
89
|
+
for (const key of await files.listUnder(`${QUERY_HISTORY_FOLDER}/${RESTORE_STAGING_INFIX}`)) await files.remove(key);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export { buildRecordKey, dayFileKey, historyFileOf, historyFilesOf, listHistoryFolder, removeHistoryFolder, removeRestoreLeftovers, restoreStagingPrefix, restoredFileKey };
|
|
@@ -1,32 +1,41 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
import './chunk-
|
|
7
|
-
import './chunk-
|
|
8
|
-
import './chunk-
|
|
9
|
-
|
|
10
|
-
import './chunk-
|
|
11
|
-
import
|
|
12
|
-
import './chunk-
|
|
13
|
-
import './chunk-
|
|
14
|
-
import './chunk-L4M7QJNP.mjs';
|
|
1
|
+
import { readWholeSectionChecked, checkEverySectionPage, readFileRange, openPagedFile, readCacheOfThisThread, createSectionReader, closePagedFile } from './chunk-N2WUOWLL.mjs';
|
|
2
|
+
export { actionPartitionsOf, adoptSegmentsOnWorker, bytesThatSegmentsHoldInMemory, checkPagedSegmentFully, closeUnusedSegments, countsAsLatestHolder, createPagedFrozenSegment, isPagedSegmentFile, keysThatSegmentsStillRead, mergePagedWindow, openFileVectorReads, openPagedSegmentScan, openPagedSnapshot, openRewriteSpill, pagedListingOf, pagedPartitionLines, pagedTombstonesFor, prepareDiskAdoption, startReadingOpeningSectionsAhead, swapPreparedPartitions, writePagedSegment } from './chunk-N2WUOWLL.mjs';
|
|
3
|
+
import './chunk-WBYQRHDY.mjs';
|
|
4
|
+
import './chunk-4J74WHQM.mjs';
|
|
5
|
+
import { COLD_LOAD_WAIT_WITHOUT_SEARCH_MS, loadFailed, decodeSections, SEGMENT_PAGE_BYTES, RECORD_PAGE_BYTES, COLD_WALK_NODES_READ_AHEAD } from './chunk-C3PTWYKT.mjs';
|
|
6
|
+
import './chunk-GJFXPHXI.mjs';
|
|
7
|
+
import './chunk-F753DA54.mjs';
|
|
8
|
+
import { magnitude, defaultRescoreDepth, defaultEfSearch, computeCodeBlockLayout, toScore, osqQuantize, createOsqScratch, scalarQueryProducts, osqEstimate, osqDistance, toDistance } from './chunk-EIOYM5TO.mjs';
|
|
9
|
+
export { createHNSWIndex, osqBitsOf } from './chunk-EIOYM5TO.mjs';
|
|
10
|
+
import './chunk-4DII3ZSM.mjs';
|
|
11
|
+
import './chunk-6WA3C3DV.mjs';
|
|
12
|
+
import { isDead, VECTOR_FILE_PAYLOAD_VERSION, bytesToVectors, stageQueryLevels, readTrailer } from './chunk-DVDX4SDR.mjs';
|
|
13
|
+
import { yieldToEventLoop } from './chunk-HUOYZJ3Q.mjs';
|
|
15
14
|
import './chunk-IO2SMUQD.mjs';
|
|
15
|
+
import './chunk-JLIIWJUV.mjs';
|
|
16
16
|
import './chunk-AM7RSBPF.mjs';
|
|
17
|
-
import './chunk-
|
|
18
|
-
import './chunk-
|
|
19
|
-
import './chunk-
|
|
20
|
-
import './chunk-
|
|
21
|
-
import './chunk-
|
|
22
|
-
import './chunk-
|
|
17
|
+
import './chunk-MVXELMJX.mjs';
|
|
18
|
+
import './chunk-NNE4VDMM.mjs';
|
|
19
|
+
import './chunk-LU3Y3P63.mjs';
|
|
20
|
+
import './chunk-RDWG33MM.mjs';
|
|
21
|
+
import './chunk-4Y53T4YE.mjs';
|
|
22
|
+
import './chunk-UNUFZ2QY.mjs';
|
|
23
|
+
import './chunk-3NQOVO3K.mjs';
|
|
24
|
+
import './chunk-JDOEEMEF.mjs';
|
|
25
|
+
import './chunk-7PXRWYUU.mjs';
|
|
26
|
+
import { HEADER_SIZE, crc32, readHeader } from './chunk-YH7QY657.mjs';
|
|
27
|
+
import './chunk-CHPTFFJM.mjs';
|
|
28
|
+
import './chunk-3JIBF3XT.mjs';
|
|
29
|
+
import './chunk-5CQX3XXV.mjs';
|
|
30
|
+
import './chunk-6VBXNFLE.mjs';
|
|
31
|
+
import './chunk-C5G6TJ7A.mjs';
|
|
32
|
+
import './chunk-MJDQU5MW.mjs';
|
|
23
33
|
import './chunk-KWRW5U65.mjs';
|
|
24
34
|
import { compareCodePoints } from './chunk-PPEPTUVV.mjs';
|
|
25
35
|
import './chunk-LVIKKAA6.mjs';
|
|
26
36
|
import './chunk-AAAETEJK.mjs';
|
|
27
37
|
import './chunk-JV6VQY2S.mjs';
|
|
28
|
-
import './chunk-
|
|
29
|
-
import { NarsilError, ErrorCodes } from './chunk-YH7W556M.mjs';
|
|
38
|
+
import { NarsilError, ErrorCodes } from './chunk-DZ7H7D2C.mjs';
|
|
30
39
|
import { decode, decodeMulti } from '@msgpack/msgpack';
|
|
31
40
|
|
|
32
41
|
// src/persistence/paged/cold-search.ts
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { MAX_FILE_BYTES } from './chunk-6VBXNFLE.mjs';
|
|
2
|
+
import { NarsilError, ErrorCodes } from './chunk-DZ7H7D2C.mjs';
|
|
3
|
+
|
|
4
|
+
// src/engine/durability-config.ts
|
|
5
|
+
var WAL_ONLY_FIELDS = ["directory", "mode", "flushIntervalMs", "segmentMaxBytes", "compactionThreshold"];
|
|
6
|
+
function configError(message) {
|
|
7
|
+
return new NarsilError(ErrorCodes.CONFIG_INVALID, message);
|
|
8
|
+
}
|
|
9
|
+
function requireKnob(name, value, minimum) {
|
|
10
|
+
if (value === void 0) {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
if (typeof value !== "number" || !Number.isFinite(value) || value < minimum) {
|
|
14
|
+
throw configError(`durability.${name} must be a finite number of at least ${minimum}, got ${String(value)}`);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
function requireValidDurabilityConfig(durability) {
|
|
18
|
+
if (durability.tier !== void 0 && durability.tier !== "wal" && durability.tier !== "snapshot") {
|
|
19
|
+
throw configError(`durability.tier must be "wal" or "snapshot", got "${String(durability.tier)}"`);
|
|
20
|
+
}
|
|
21
|
+
if (durability.mode !== void 0 && durability.mode !== "sync" && durability.mode !== "async") {
|
|
22
|
+
throw configError(`durability.mode must be "sync" or "async", got "${String(durability.mode)}"`);
|
|
23
|
+
}
|
|
24
|
+
requireKnob("checkpointIntervalMs", durability.checkpointIntervalMs, 0);
|
|
25
|
+
requireKnob("checkpointMutationThreshold", durability.checkpointMutationThreshold, 1);
|
|
26
|
+
requireKnob("flushIntervalMs", durability.flushIntervalMs, 0);
|
|
27
|
+
requireKnob("segmentMaxBytes", durability.segmentMaxBytes, 1);
|
|
28
|
+
if (durability.segmentMaxBytes !== void 0 && durability.segmentMaxBytes > MAX_FILE_BYTES) {
|
|
29
|
+
throw configError(
|
|
30
|
+
`durability.segmentMaxBytes must be at most ${MAX_FILE_BYTES}, the largest file that every implementation reads, got ${durability.segmentMaxBytes}`
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
requireKnob("compactionThreshold", durability.compactionThreshold, 1);
|
|
34
|
+
if (durability.tier === "snapshot") {
|
|
35
|
+
for (const field of WAL_ONLY_FIELDS) {
|
|
36
|
+
if (durability[field] !== void 0) {
|
|
37
|
+
throw configError(
|
|
38
|
+
`durability.${field} applies to the write-ahead log tier only and cannot combine with durability.tier "snapshot"`
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
function filesystemBackedDirectory(config) {
|
|
45
|
+
const adapterDirectory = config.persistence?.directory;
|
|
46
|
+
if (adapterDirectory !== void 0 && adapterDirectory.trim().length > 0) {
|
|
47
|
+
return adapterDirectory;
|
|
48
|
+
}
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
function resolveDurabilityTier(config) {
|
|
52
|
+
const filesystemDirectory = filesystemBackedDirectory(config);
|
|
53
|
+
if (config.durability) {
|
|
54
|
+
requireValidDurabilityConfig(config.durability);
|
|
55
|
+
}
|
|
56
|
+
if (config.durability?.tier === "snapshot") {
|
|
57
|
+
if (config.persistence === void 0) {
|
|
58
|
+
throw configError(
|
|
59
|
+
"Snapshot durability persists through a persistence adapter. Configure persistence, or remove durability.tier"
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
return { kind: "snapshot", config: { ...config.durability }, adapter: config.persistence };
|
|
63
|
+
}
|
|
64
|
+
if (config.durability) {
|
|
65
|
+
if (config.durability.directory !== void 0 && config.durability.directory.trim().length > 0) {
|
|
66
|
+
return { kind: "wal", config: { ...config.durability } };
|
|
67
|
+
}
|
|
68
|
+
if (filesystemDirectory !== null) {
|
|
69
|
+
return { kind: "wal", config: { ...config.durability, directory: filesystemDirectory } };
|
|
70
|
+
}
|
|
71
|
+
if (config.persistence !== void 0) {
|
|
72
|
+
throw configError(
|
|
73
|
+
"WAL durability requires a filesystem directory, but the configured persistence adapter is not filesystem-backed. Use a filesystem persistence adapter or set durability.directory"
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
throw configError(
|
|
77
|
+
"Durability requires a directory. Set durability.directory explicitly, or configure a filesystem persistence adapter"
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
if (config.persistence === void 0) {
|
|
81
|
+
return null;
|
|
82
|
+
}
|
|
83
|
+
if (filesystemDirectory !== null) {
|
|
84
|
+
return { kind: "wal", config: { directory: filesystemDirectory } };
|
|
85
|
+
}
|
|
86
|
+
return { kind: "snapshot", config: {}, adapter: config.persistence };
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export { resolveDurabilityTier };
|