@delali/narsil 0.3.1-next.153 → 0.3.1-next.154
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 +2 -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-4GCRVRBW.mjs} +27 -18
- package/dist/{react-native/chunks/analysis-change-entry-CXNRW324.mjs → analysis-change-entry-KYGSXW4K.mjs} +1 -1
- package/dist/browser/{analysis-change-2V2HZ2NY.mjs → analysis-change-IXWPXXJJ.mjs} +17 -7
- package/dist/{analysis-change-entry-QD7YNDEE.mjs → browser/analysis-change-entry-FCSHFQSS.mjs} +1 -1
- package/dist/browser/{chunk-TQ5UMFG5.mjs → chunk-2FX6ROWR.mjs} +15 -6
- package/dist/browser/{chunk-KWYQ6KX4.mjs → chunk-2SHAKW2Z.mjs} +119 -1922
- package/dist/browser/{chunk-55WYRLDZ.mjs → chunk-3U3QR5YP.mjs} +2 -2
- package/dist/browser/chunk-4PD752F6.mjs +85 -0
- package/dist/browser/chunk-5W3MMTLG.mjs +19 -0
- package/dist/browser/{chunk-IAXZAVYL.mjs → chunk-7MEYN7V6.mjs} +1 -151
- package/dist/browser/chunk-7TTWXUH6.mjs +1828 -0
- package/dist/browser/{chunk-CSCKZBVJ.mjs → chunk-AJ4HHOVT.mjs} +4 -4
- package/dist/{react-native/chunks/chunk-DFQJ4IJB.mjs → browser/chunk-AYY6PIKL.mjs} +2 -2
- package/dist/browser/{chunk-VD7JEUIR.mjs → chunk-C4KS2QNF.mjs} +9 -8
- package/dist/browser/chunk-DSXIBE6N.mjs +78 -0
- package/dist/browser/chunk-ELV4OZOI.mjs +29 -0
- package/dist/browser/{chunk-PM4MUM5N.mjs → chunk-EUNBNLKM.mjs} +6 -5
- package/dist/browser/{chunk-GJKXW3SF.mjs → chunk-G7LUMBSG.mjs} +137 -253
- package/dist/browser/{chunk-B3JM6Z74.mjs → chunk-H6QFBMVE.mjs} +3 -2
- package/dist/browser/chunk-J433A7P3.mjs +241 -0
- package/dist/browser/chunk-ML6HY7T7.mjs +96 -0
- package/dist/browser/chunk-ML7THVLJ.mjs +38 -0
- package/dist/{chunk-MDF6PDIA.mjs → browser/chunk-MYITLCHT.mjs} +7 -1
- package/dist/browser/{chunk-QJCO3TJU.mjs → chunk-QXTPSX2H.mjs} +9 -150
- package/dist/browser/{chunk-MPK76GVS.mjs → chunk-RA6LSBCM.mjs} +1 -21
- package/dist/browser/{chunk-7ZJTRUVW.mjs → chunk-SIR3LMTV.mjs} +2 -2
- package/dist/browser/{chunk-LURXVCHG.mjs → chunk-SJB6VIZG.mjs} +1 -1
- package/dist/browser/chunk-TTD27VXX.mjs +298 -0
- package/dist/browser/chunk-U2E3HMYW.mjs +151 -0
- package/dist/browser/{chunk-2A2IPRC3.mjs → chunk-VCOYGVP7.mjs} +5 -31
- package/dist/browser/chunk-VI7BQR4U.mjs +21 -0
- package/dist/browser/chunk-W5X2UFWQ.mjs +102 -0
- package/dist/browser/{chunk-HT7J73QL.mjs → chunk-XRV72TJD.mjs} +2 -2
- package/dist/browser/chunk-YJHGOJAC.mjs +15 -0
- package/dist/browser/chunk-ZI2V4VD7.mjs +21 -0
- package/dist/{react-native/chunks/chunk-QC4ZRBSX.mjs → browser/chunk-ZPTA75ZC.mjs} +2 -79
- package/dist/browser/{cold-module-YECAK4MN.mjs → cold-module-VTUGDYNY.mjs} +20 -14
- package/dist/browser/{durability-wiring-LM7WFL6X.mjs → durability-wiring-GL4A7KDV.mjs} +1886 -1364
- package/dist/browser/import-YI5GNB4H.mjs +17 -0
- package/dist/browser/methods-LMUTS7OI.mjs +30 -0
- package/dist/browser/{module-XQLEOYNM.mjs → module-EC3FYW7N.mjs} +9 -8
- package/dist/browser/{module-KAMRAJLE.mjs → module-M4JNBV6V.mjs} +16 -10
- package/dist/browser/operations-WVYLF72Q.mjs +5 -0
- package/dist/browser/{phrase-module-CNKMUY4U.mjs → phrase-module-NPYUVX75.mjs} +1 -1
- package/dist/browser/{pool-DTYSPBMQ.mjs → pool-WCGDZHJP.mjs} +3 -2
- package/dist/{restore-queue-AOF5OTQV.mjs → browser/restore-queue-TYIGDL5L.mjs} +2 -2
- package/dist/browser/retention-6QMRS5VK.mjs +207 -0
- package/dist/browser/{runtime-D2ULZGCN.mjs → runtime-3EW2AGB6.mjs} +1 -1
- package/dist/browser/{snapshot-UGZVMP4H.mjs → snapshot-DN3CRVUQ.mjs} +38 -307
- package/dist/browser/sync-state-P5XG6LTQ.mjs +15 -0
- package/dist/browser/{write-I5P5MW4O.mjs → write-WAWAFGKQ.mjs} +16 -11
- package/dist/{capabilities-BT-HLDC8.d.ts → capabilities-B3Brs1Rc.d.ts} +62 -7
- package/dist/{chunk-DGRM4EZZ.mjs → chunk-37IVJLP6.mjs} +1 -1
- package/dist/{chunk-KYVRZAYP.mjs → chunk-3A5KI24C.mjs} +2 -69
- package/dist/{chunk-POUYICOU.mjs → chunk-3OFU3NJT.mjs} +1 -1
- package/dist/{chunk-3TVDTACC.mjs → chunk-3Y3J4V2R.mjs} +1 -1
- package/dist/{chunk-FNBNZCGP.mjs → chunk-466PYR4P.mjs} +2 -2
- package/dist/{chunk-SEAJS664.mjs → chunk-4HWZV5MK.mjs} +5 -5
- package/dist/{chunk-UGVUW27S.mjs → chunk-5FUOVJKG.mjs} +13 -9
- package/dist/{chunk-ZHAXP7SD.mjs → chunk-5KGYQT6W.mjs} +6 -235
- package/dist/{chunk-NPXVQS33.mjs → chunk-62G63NMH.mjs} +4 -3
- package/dist/chunk-6MSZ543Y.mjs +32 -0
- package/dist/chunk-7GXJUJ24.mjs +49 -0
- package/dist/{chunk-3E4RRF5J.mjs → chunk-7HCZWC7B.mjs} +58 -8
- package/dist/{chunk-6RKSY3BX.mjs → chunk-7NTMUDC5.mjs} +5 -5
- package/dist/chunk-7QUGDVFC.mjs +101 -0
- package/dist/{chunk-G5KHSM6E.mjs → chunk-AO2FAYIZ.mjs} +1 -1
- package/dist/chunk-B7S6YEBP.mjs +102 -0
- package/dist/{chunk-AWNHDBKV.mjs → chunk-BPSKLCS7.mjs} +15 -7
- package/dist/chunk-BUMREPLU.mjs +15 -0
- package/dist/{chunk-T4CJDBBE.mjs → chunk-C6ASEFZI.mjs} +1 -1
- package/dist/{chunk-NITCPDFL.mjs → chunk-C73JLU4E.mjs} +2 -2
- package/dist/{chunk-NYSONUB7.mjs → chunk-CP5RRPJR.mjs} +1 -1
- package/dist/{chunk-TTCKT2RT.mjs → chunk-DMQPFLGI.mjs} +134 -11
- package/dist/{chunk-3SBJVQLL.mjs → chunk-DVWYODEB.mjs} +2 -2
- package/dist/chunk-ECX4SGX6.mjs +167 -0
- package/dist/chunk-GES7U2PM.mjs +68 -0
- package/dist/{chunk-NVTFQFUL.mjs → chunk-HVKXNBFL.mjs} +1 -1
- package/dist/chunk-HVYICDY3.mjs +214 -0
- package/dist/{chunk-3HV7M5OJ.mjs → chunk-HWEDFLB7.mjs} +9 -133
- package/dist/{chunk-52QQWEBS.mjs → chunk-IBNLW3AV.mjs} +21 -6
- package/dist/chunk-IJU7LL7D.mjs +242 -0
- package/dist/chunk-IPN7S4KX.mjs +130 -0
- package/dist/{chunk-5QMHMELB.mjs → chunk-IQ4R2I6N.mjs} +4 -1
- package/dist/chunk-JCLTESFN.mjs +96 -0
- package/dist/{chunk-J4BDAH2W.mjs → chunk-JFNKIBDT.mjs} +2 -2
- package/dist/{chunk-LDGGR7YT.mjs → chunk-K4B7OH65.mjs} +2 -2
- package/dist/{chunk-7TE2AJIH.mjs → chunk-K7KLL263.mjs} +13 -10
- package/dist/{chunk-CSHHU7PA.mjs → chunk-KCUIFVVW.mjs} +11 -30
- package/dist/{react-native/chunks/chunk-YH7W556M.mjs → chunk-KUZKUONM.mjs} +11 -2
- package/dist/chunk-KYYABCSW.mjs +72 -0
- package/dist/{chunk-B2FTZNNF.mjs → chunk-LKUE5GXS.mjs} +34 -14
- package/dist/{chunk-2PNYKG2D.mjs → chunk-LSM2YTKM.mjs} +100 -335
- package/dist/{chunk-DMNPYF54.mjs → chunk-LTUGDMV4.mjs} +2 -2
- package/dist/{chunk-FDG4KXX5.mjs → chunk-MLHNSAPK.mjs} +5 -3
- package/dist/{chunk-VP6XRMWR.mjs → chunk-MMBEANB2.mjs} +6 -32
- package/dist/{chunk-LJ4ENXOD.mjs → chunk-MMEMEUOO.mjs} +2 -2
- package/dist/{chunk-2HJWQPR6.mjs → chunk-NTZOXVUZ.mjs} +6 -122
- package/dist/{chunk-5WB2A3XU.mjs → chunk-NZMAXR2S.mjs} +397 -24
- package/dist/{chunk-IZT3G24Q.mjs → chunk-O43Z4MS6.mjs} +2 -2
- package/dist/{chunk-U46IZNCW.mjs → chunk-OKX2BBNW.mjs} +3 -2
- package/dist/{chunk-RBEHLIKX.mjs → chunk-PFKM7VNZ.mjs} +14 -8
- package/dist/chunk-PGVPE7GJ.mjs +96 -0
- package/dist/chunk-Q3TCTQCC.mjs +85 -0
- package/dist/chunk-Q7MS6P2J.mjs +74 -0
- package/dist/chunk-QDZJM7NI.mjs +23 -0
- package/dist/{chunk-ZS6CMXAE.mjs → chunk-QKZHLADX.mjs} +89 -250
- package/dist/{chunk-IJSFWGVW.mjs → chunk-REL7LFLR.mjs} +3 -3
- package/dist/chunk-RVKFI3A2.mjs +237 -0
- package/dist/chunk-S2N75OTN.mjs +83 -0
- package/dist/chunk-TRISKD4Q.mjs +50 -0
- package/dist/{chunk-6F6USYII.mjs → chunk-TV2L3BN7.mjs} +13 -11
- package/dist/{chunk-6BWLDLS3.mjs → chunk-URPCYQVJ.mjs} +1 -1
- package/dist/chunk-USR7FQRZ.mjs +34 -0
- package/dist/chunk-V6EUBAIT.mjs +19 -0
- package/dist/{chunk-SOUZMPME.mjs → chunk-VMXSVVXG.mjs} +7 -194
- package/dist/{chunk-4QCSHLNM.mjs → chunk-VREK3MYG.mjs} +3 -3
- package/dist/{chunk-YGQOPB2Z.mjs → chunk-WCBA2LVZ.mjs} +1 -1
- package/dist/{chunk-KQJVNPRM.mjs → chunk-X6NSJYQ3.mjs} +19 -16
- package/dist/chunk-Y4WPNHMC.mjs +50 -0
- package/dist/{chunk-IRWP524D.mjs → chunk-YBJDOA2T.mjs} +1 -1
- package/dist/{chunk-IJPK5PGM.mjs → chunk-YPUEV6ZC.mjs} +1 -1
- package/dist/{chunk-J7M73VY7.mjs → chunk-YROWNOMH.mjs} +1 -1
- package/dist/chunk-Z3TNWCI5.mjs +196 -0
- package/dist/{chunk-65WCV5JO.mjs → chunk-ZIFJXCKA.mjs} +1 -1
- package/dist/chunk-ZYAY26KG.mjs +29 -0
- package/dist/{client-Cn3gNxUU.d.ts → client-Df76GNKm.d.ts} +76 -6
- package/dist/client.d.ts +8 -7
- package/dist/client.mjs +56 -5
- package/dist/{cold-module-PYSSBIL7.mjs → cold-module-YLWMTTZG.mjs} +38 -28
- package/dist/{config-CfhH1IWQ.d.ts → config-05G_hy-1.d.ts} +3 -3
- package/dist/config-B8DP2VwR.d.ts +463 -0
- package/dist/{direct-executor-WYALQSMD.mjs → direct-executor-FI5GJHWX.mjs} +14 -9
- 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 +1296 -117
- package/dist/{durability-wiring-7VBZEJLG.mjs → durability-wiring-RHLXDIVF.mjs} +1751 -1226
- package/dist/embeddings/openai.mjs +2 -2
- package/dist/{engine-CJRUHXgf.d.ts → engine-DYu-e0oR.d.ts} +50 -40
- package/dist/{import-GJOMB2HC.mjs → import-SRBNC6TE.mjs} +27 -19
- package/dist/{index-MsF7e5hL.d.ts → index-nRqDM6uS.d.ts} +1 -1
- package/dist/index.browser.mjs +8 -4
- package/dist/index.d.ts +7 -6
- package/dist/index.mjs +24 -16
- package/dist/index.react-native.mjs +17 -11
- package/dist/{long-query-thread-SCUE62TO.mjs → long-query-thread-EMYTGSJP.mjs} +28 -15
- package/dist/methods-ABM5ELBR.mjs +30 -0
- package/dist/{module-AVQEIB7O.mjs → module-3OMJZUFT.mjs} +12 -12
- package/dist/{module-6RLIKSZQ.mjs → module-MG7JMV2U.mjs} +33 -23
- package/dist/operations-PGOAY2KS.mjs +5 -0
- package/dist/{paged-partition-archive-KGRW366Y.mjs → paged-partition-archive-UOLHOEZJ.mjs} +37 -26
- package/dist/partial-words.mjs +6 -4
- package/dist/pattern.mjs +4 -3
- package/dist/persistence/durability/checkpoint-worker.d.ts +9 -1
- package/dist/persistence/durability/checkpoint-worker.mjs +34 -23
- package/dist/{phrase-module-OUQIRUQU.mjs → phrase-module-O3MDRQXP.mjs} +1 -1
- package/dist/{pool-UPV5PVPY.mjs → pool-CQXYPFLG.mjs} +2 -2
- package/dist/react-native/chunks/{analysis-change-DXPZRGWF.mjs → analysis-change-EAYO3Y6Q.mjs} +27 -15
- package/dist/{browser/analysis-change-entry-JL5U2N3Q.mjs → react-native/chunks/analysis-change-entry-TNLUC6IZ.mjs} +1 -1
- package/dist/react-native/chunks/{chunk-D7LFYPYI.mjs → chunk-2CGSQM4O.mjs} +12 -10
- package/dist/react-native/chunks/chunk-3NQOVO3K.mjs +1 -0
- package/dist/react-native/chunks/{chunk-R4OPUZQ5.mjs → chunk-3O57C2ZO.mjs} +2 -2
- package/dist/react-native/chunks/chunk-3XKMRNRE.mjs +298 -0
- package/dist/react-native/chunks/{chunk-IDFMNRIC.mjs → chunk-63YSZOXB.mjs} +97 -333
- package/dist/react-native/chunks/{chunk-UFNCLEQM.mjs → chunk-75VWIY35.mjs} +1 -1
- package/dist/react-native/chunks/{chunk-2J2727V4.mjs → chunk-7GWPJDOA.mjs} +1 -1
- package/dist/react-native/chunks/{chunk-PU55IOG4.mjs → chunk-AUT7PMA4.mjs} +6 -190
- package/dist/react-native/chunks/chunk-C2H2QQFW.mjs +288 -0
- package/dist/react-native/chunks/chunk-CHPTFFJM.mjs +43 -0
- package/dist/{browser/chunk-PIS7ZAP7.mjs → react-native/chunks/chunk-CUNGPR5R.mjs} +11 -2
- package/dist/{browser/chunk-NVEJJP4R.mjs → react-native/chunks/chunk-DCKMICOB.mjs} +2 -79
- package/dist/react-native/chunks/chunk-DH3TVWWK.mjs +102 -0
- package/dist/react-native/chunks/{chunk-ZCKNBPQ4.mjs → chunk-EH5CFV6Z.mjs} +2 -2
- package/dist/react-native/chunks/chunk-F753DA54.mjs +23 -0
- package/dist/{browser/chunk-VBX2TI5V.mjs → react-native/chunks/chunk-GFYFQLJD.mjs} +2 -2
- package/dist/react-native/chunks/{chunk-7IQR3SZO.mjs → chunk-I5PGWQJF.mjs} +142 -257
- package/dist/react-native/chunks/{chunk-NFGBOI46.mjs → chunk-IOY2SM2P.mjs} +1 -1
- package/dist/react-native/chunks/chunk-JDOEEMEF.mjs +38 -0
- package/dist/react-native/chunks/{chunk-TLYD7IJ2.mjs → chunk-JPAJWO6D.mjs} +1 -1
- package/dist/react-native/chunks/chunk-JWUCMVRK.mjs +15 -0
- package/dist/react-native/chunks/{chunk-KLZGAOLT.mjs → chunk-JX2RIAXH.mjs} +4 -4
- package/dist/react-native/chunks/chunk-LU3Y3P63.mjs +68 -0
- package/dist/react-native/chunks/{chunk-LQAKO5QV.mjs → chunk-NCJS3WIY.mjs} +2 -2
- package/dist/react-native/chunks/{chunk-BRNAVOKP.mjs → chunk-NKIZX26F.mjs} +2 -2
- package/dist/react-native/chunks/{chunk-CLE3LZ77.mjs → chunk-NP7DD4G5.mjs} +5 -4
- package/dist/react-native/chunks/chunk-NVVRSRX5.mjs +78 -0
- package/dist/react-native/chunks/chunk-O32RB3BL.mjs +191 -0
- package/dist/react-native/chunks/{chunk-DKJTZ625.mjs → chunk-OQQVRWZ2.mjs} +2 -69
- package/dist/react-native/chunks/chunk-PB2YXVQW.mjs +29 -0
- package/dist/react-native/chunks/chunk-Q32DDFKX.mjs +19 -0
- package/dist/react-native/chunks/{chunk-LRGWK367.mjs → chunk-RVAEBN74.mjs} +1 -1
- package/dist/react-native/chunks/{chunk-KOCTCUXW.mjs → chunk-RYMDHGL4.mjs} +16 -8
- package/dist/react-native/chunks/chunk-SJWDBRNP.mjs +85 -0
- package/dist/react-native/chunks/chunk-UNUFZ2QY.mjs +68 -0
- package/dist/react-native/chunks/chunk-UWDNZDWK.mjs +242 -0
- package/dist/react-native/chunks/{chunk-FS7BYE23.mjs → chunk-VQSKZ3EZ.mjs} +9 -152
- package/dist/react-native/chunks/{chunk-UCJU6WNH.mjs → chunk-VVFYOADG.mjs} +7 -6
- package/dist/react-native/chunks/{chunk-VGUWIZFQ.mjs → chunk-YBEW6YTR.mjs} +1 -1
- package/dist/react-native/chunks/{chunk-JYL35A4A.mjs → chunk-YHKZSLOC.mjs} +7 -33
- package/dist/react-native/chunks/{chunk-3CTWSQRW.mjs → chunk-ZBSWRSBG.mjs} +4 -30
- package/dist/react-native/chunks/chunk-ZYDKJXQJ.mjs +96 -0
- package/dist/react-native/chunks/{cold-module-KFGEWYEL.mjs → cold-module-TJL6AFAD.mjs} +29 -21
- package/dist/react-native/chunks/{durability-wiring-QKJB2QBT.mjs → durability-wiring-RRDYJLLM.mjs} +1882 -1358
- package/dist/react-native/chunks/gzip.react-native-DNB5YNFA.mjs +3 -0
- package/dist/react-native/chunks/import-JYBMEJPQ.mjs +29 -0
- package/dist/react-native/chunks/methods-X6F36SJE.mjs +30 -0
- package/dist/react-native/chunks/module-QT5HZAY4.mjs +33 -0
- package/dist/react-native/chunks/{module-UJ5VUARS.mjs → module-S4DKSWMF.mjs} +10 -9
- package/dist/react-native/chunks/operations-RYKTSZQA.mjs +5 -0
- package/dist/react-native/chunks/{phrase-module-76UAPPSG.mjs → phrase-module-JZ37TB7N.mjs} +1 -1
- package/dist/react-native/chunks/{pool-CD4ANYUI.mjs → pool-RTGXJXPU.mjs} +3 -2
- package/dist/{browser/restore-queue-UQ6AAUVX.mjs → react-native/chunks/restore-queue-ZBVIKJWI.mjs} +2 -2
- package/dist/react-native/chunks/retention-PPCTP2VY.mjs +219 -0
- package/dist/react-native/chunks/{runtime-3MCDLJAF.mjs → runtime-KUATOLYB.mjs} +1 -1
- package/dist/react-native/chunks/{snapshot-KVBD4LRC.mjs → snapshot-ZBIEOZTZ.mjs} +47 -314
- package/dist/react-native/chunks/sync-state-PASCIHHT.mjs +15 -0
- package/dist/react-native/chunks/{write-ES5A3WUA.mjs → write-2W4FTX7J.mjs} +25 -18
- package/dist/react-native/partial-words.mjs +6 -4
- package/dist/react-native/pattern.mjs +4 -3
- package/dist/react-native/sync.mjs +2236 -0
- package/dist/react-native/synonyms.mjs +7 -4
- package/dist/react.d.ts +10 -9
- package/dist/react.mjs +7 -1
- package/dist/{rerank-3W54N6P2.mjs → rerank-IZOB6NII.mjs} +4 -4
- package/dist/rerankers/http.mjs +2 -2
- package/dist/{react-native/chunks/restore-queue-H5VCN453.mjs → restore-queue-COI2GSSK.mjs} +2 -2
- package/dist/retention-55WA7GPU.mjs +58 -0
- package/dist/{runtime-L2DZYY6N.mjs → runtime-UZOC3NPY.mjs} +5 -5
- package/dist/{schema-D33CyXCy.d.ts → schema-DDauvDOv.d.ts} +1 -1
- package/dist/server.d.ts +22 -19
- package/dist/server.mjs +868 -50
- package/dist/{snapshot-WMX6JCLP.mjs → snapshot-NFX2EYN2.mjs} +62 -36
- 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/{config-aIsy7mcL.d.ts → sync-uXR7MmM7.d.ts} +53 -444
- package/dist/sync.browser.mjs +2231 -0
- package/dist/sync.d.ts +23 -0
- package/dist/sync.mjs +2206 -0
- package/dist/synonyms.mjs +5 -3
- package/dist/{tasks-C4ElXr4P.d.ts → tasks-BShx8pdK.d.ts} +4 -4
- package/dist/thread-P2G2FWM2.mjs +44 -0
- package/dist/types-SnO7_tAI.d.ts +228 -0
- package/dist/vector/search-worker.d.ts +1 -1
- package/dist/vector/search-worker.mjs +6 -6
- package/dist/workers/entry.mjs +7 -7
- package/dist/{write-SKJ6HW7O.mjs → write-FGB62BHQ.mjs} +31 -23
- package/openapi.json +119 -3
- package/package.json +28 -8
- package/dist/browser/import-QOY6ZH6X.mjs +0 -12
- package/dist/chunk-7LDMWKP6.mjs +0 -209
- package/dist/react-native/chunks/chunk-L4M7QJNP.mjs +0 -110
- 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/thread-I7DVHHW7.mjs +0 -31
|
@@ -1,11 +1,16 @@
|
|
|
1
|
+
import { decodeSegmentManifest } from './chunk-J433A7P3.mjs';
|
|
1
2
|
import { gunzip, gzip } from './chunk-JNOAKDUM.mjs';
|
|
2
|
-
import {
|
|
3
|
-
import { restoreVectorFields } from './chunk-
|
|
3
|
+
import { readListedFile, requireListedChecksum, writeSegmentsOf, readSegmentFile, requireListedSize, SEGMENT_PAGE_BYTES, STABLE_HEAD_ATTEMPTS, RECORD_PAGE_BYTES, MERGED_SEGMENT_GROWTH_ALLOWANCE, MERGED_SEGMENT_TARGET_BYTES } from './chunk-QXTPSX2H.mjs';
|
|
4
|
+
import { restoreVectorFields } from './chunk-H6QFBMVE.mjs';
|
|
5
|
+
import { DEFAULT_COMPACTION_THRESHOLD, COMPACTION_LARGEST_MERGED_DOCUMENT_COUNT, SEGMENT_FILE_FRAMING_SLACK_BYTES } from './chunk-ZI2V4VD7.mjs';
|
|
6
|
+
import { VERSION, DEFAULT_BM25_B, DEFAULT_BM25_K1, rulesOfStoredSynonyms, isCompositePartition, packChecksummedEnvelope, reconstructSchemaFromMetadata, engineVersionParts, packEnvelopeWithChecksum, decodeEveryStoredDocument, createSharedFrozenSegment, shareSegmentArrays, isQuantizationMode, isStorageMode, survivorDocumentsOf, partitionStateOf, freezeSegmentShared, createFrozenSegment, createPartitionManager, createPartitionRouter, buildSegmentPayload, resolvePartitionInsertOptions, decodeMapWithoutFields, prepareDocumentVectors } from './chunk-2SHAKW2Z.mjs';
|
|
7
|
+
import { SEGMENT_MANIFEST_VERSION, MANIFEST_ENVELOPE_VERSION, manifestKey, manifestReferencedKeys, segmentsPrefix, snapshotBundleKey, vectorFileKey, MAX_SEGMENTS_PER_PARTITION, graphPartKey } from './chunk-4PD752F6.mjs';
|
|
8
|
+
import { flattenSchema, crc32, extractVectorFieldsFromSchema, requireValidFieldTypes, readHeader, HEADER_SIZE, writeHeader, openChecksummedEnvelope, checksumOfChunks, partialFieldsOf, getLanguage, VECTOR_PATTERN, resolveIndexAnalysis } from './chunk-7TTWXUH6.mjs';
|
|
4
9
|
import { DEFAULT_VECTOR_METRIC, defaultQuantizationFor } from './chunk-3I27KXQD.mjs';
|
|
5
|
-
import { decodeVectorGraphPartPayload, assembleGraphParts, decodeVectorFilePayload, countDead
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { NarsilError, ErrorCodes } from './chunk-
|
|
10
|
+
import { decodeVectorGraphPartPayload, assembleGraphParts, decodeVectorFilePayload, countDead } from './chunk-3U3QR5YP.mjs';
|
|
11
|
+
import { compareCodePoints, VALID_HNSW_METRICS, MAX_FILE_BYTES } from './chunk-7MEYN7V6.mjs';
|
|
12
|
+
import { isSyncEpoch } from './chunk-YJHGOJAC.mjs';
|
|
13
|
+
import { NarsilError, ErrorCodes } from './chunk-MYITLCHT.mjs';
|
|
9
14
|
import { decode, encode } from '@msgpack/msgpack';
|
|
10
15
|
|
|
11
16
|
// src/engine/durability-metadata.ts
|
|
@@ -103,6 +108,9 @@ function metadataFromConfig(indexName, config, partitionCount, documentCount) {
|
|
|
103
108
|
if (config.heldPartitions !== void 0) {
|
|
104
109
|
metadata.heldPartitions = config.heldPartitions;
|
|
105
110
|
}
|
|
111
|
+
if (config.sync !== void 0) metadata.sync = config.sync;
|
|
112
|
+
if (config.syncActive !== void 0) metadata.syncActive = config.syncActive;
|
|
113
|
+
if (config.syncEpoch !== void 0) metadata.syncEpoch = config.syncEpoch;
|
|
106
114
|
return metadata;
|
|
107
115
|
}
|
|
108
116
|
function metadataConfigOf(entry) {
|
|
@@ -137,7 +145,21 @@ function metadataConfigOf(entry) {
|
|
|
137
145
|
...entry.config.required !== void 0 ? { required: entry.config.required } : {},
|
|
138
146
|
...entry.config.vectorPromotion !== void 0 ? { vectorPromotion: entry.config.vectorPromotion } : {},
|
|
139
147
|
...entry.config.patternValueLimit !== void 0 ? { patternValueLimit: entry.config.patternValueLimit } : {},
|
|
140
|
-
...entry.synonyms !== null ? { synonyms: rulesOfStoredSynonyms(entry.synonyms) } : {}
|
|
148
|
+
...entry.synonyms !== null ? { synonyms: rulesOfStoredSynonyms(entry.synonyms) } : {},
|
|
149
|
+
...syncMetadataOf(entry)
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
function syncMetadataOf(entry) {
|
|
153
|
+
const sync = entry.sync;
|
|
154
|
+
if (sync === null) return {};
|
|
155
|
+
return {
|
|
156
|
+
sync: {
|
|
157
|
+
enabled: true,
|
|
158
|
+
...sync.historyMaxAgeMs !== void 0 ? { historyMaxAgeMs: sync.historyMaxAgeMs } : {},
|
|
159
|
+
...sync.historyMaxBytes !== void 0 ? { historyMaxBytes: sync.historyMaxBytes } : {}
|
|
160
|
+
},
|
|
161
|
+
syncActive: sync.active,
|
|
162
|
+
syncEpoch: sync.epoch
|
|
141
163
|
};
|
|
142
164
|
}
|
|
143
165
|
function durableMetadataConfigOf(entry) {
|
|
@@ -346,6 +368,56 @@ function deserializePayloadV1(data) {
|
|
|
346
368
|
const raw = decode(data);
|
|
347
369
|
return wireToPartition(raw);
|
|
348
370
|
}
|
|
371
|
+
|
|
372
|
+
// src/serialization/payload-v1/sync-metadata.ts
|
|
373
|
+
function invalid(message, details) {
|
|
374
|
+
throw new NarsilError(ErrorCodes.CONFIG_INVALID, `The device sync state in the index metadata ${message}`, details);
|
|
375
|
+
}
|
|
376
|
+
function isPositiveSafeInteger(value) {
|
|
377
|
+
return typeof value === "number" && Number.isSafeInteger(value) && value >= 1;
|
|
378
|
+
}
|
|
379
|
+
function syncMetadataToWire(meta) {
|
|
380
|
+
const wire = {};
|
|
381
|
+
if (meta.sync !== void 0) {
|
|
382
|
+
wire.sync = {
|
|
383
|
+
enabled: meta.sync.enabled,
|
|
384
|
+
...meta.sync.historyMaxAgeMs !== void 0 ? { history_max_age_ms: meta.sync.historyMaxAgeMs } : {},
|
|
385
|
+
...meta.sync.historyMaxBytes !== void 0 ? { history_max_bytes: meta.sync.historyMaxBytes } : {}
|
|
386
|
+
};
|
|
387
|
+
}
|
|
388
|
+
if (meta.syncActive !== void 0) wire.sync_active = meta.syncActive;
|
|
389
|
+
if (meta.syncEpoch !== void 0) wire.sync_epoch = meta.syncEpoch;
|
|
390
|
+
return wire;
|
|
391
|
+
}
|
|
392
|
+
function storedSyncSetting(raw) {
|
|
393
|
+
if (raw === null || typeof raw !== "object") invalid("holds a sync setting that is not a map", {});
|
|
394
|
+
const { enabled, history_max_age_ms: maxAge, history_max_bytes: maxBytes } = raw;
|
|
395
|
+
if (typeof enabled !== "boolean") invalid("holds a sync setting without a boolean enabled", {});
|
|
396
|
+
if (maxAge !== void 0 && !isPositiveSafeInteger(maxAge)) {
|
|
397
|
+
invalid("holds a history age limit that is not a positive whole number", { historyMaxAgeMs: String(maxAge) });
|
|
398
|
+
}
|
|
399
|
+
if (maxBytes !== void 0 && !isPositiveSafeInteger(maxBytes)) {
|
|
400
|
+
invalid("holds a history byte limit that is not a positive whole number", { historyMaxBytes: String(maxBytes) });
|
|
401
|
+
}
|
|
402
|
+
return {
|
|
403
|
+
enabled,
|
|
404
|
+
...maxAge !== void 0 ? { historyMaxAgeMs: maxAge } : {},
|
|
405
|
+
...maxBytes !== void 0 ? { historyMaxBytes: maxBytes } : {}
|
|
406
|
+
};
|
|
407
|
+
}
|
|
408
|
+
function syncMetadataFromWire(raw, meta) {
|
|
409
|
+
if (raw.sync !== void 0 && raw.sync !== null) meta.sync = storedSyncSetting(raw.sync);
|
|
410
|
+
if (raw.sync_active !== void 0 && raw.sync_active !== null) {
|
|
411
|
+
if (typeof raw.sync_active !== "boolean") invalid("holds a sync_active that is not a boolean", {});
|
|
412
|
+
meta.syncActive = raw.sync_active;
|
|
413
|
+
}
|
|
414
|
+
if (raw.sync_epoch !== void 0 && raw.sync_epoch !== null) {
|
|
415
|
+
if (!isSyncEpoch(raw.sync_epoch)) invalid("holds an epoch that is not 32 lowercase hexadecimal digits", {});
|
|
416
|
+
meta.syncEpoch = raw.sync_epoch;
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
// src/serialization/payload-v1/metadata.ts
|
|
349
421
|
function metadataToWire(meta) {
|
|
350
422
|
const wire = {
|
|
351
423
|
index_name: meta.indexName,
|
|
@@ -446,7 +518,7 @@ function metadataToWire(meta) {
|
|
|
446
518
|
if (Array.isArray(meta.synonyms) && meta.synonyms.length > 0) {
|
|
447
519
|
wire.synonyms = meta.synonyms;
|
|
448
520
|
}
|
|
449
|
-
return wire;
|
|
521
|
+
return { ...wire, ...syncMetadataToWire(meta) };
|
|
450
522
|
}
|
|
451
523
|
function wireToMetadata(raw) {
|
|
452
524
|
const meta = {
|
|
@@ -602,6 +674,7 @@ function wireToMetadata(raw) {
|
|
|
602
674
|
meta.heldPartitions = raw.held_partitions;
|
|
603
675
|
}
|
|
604
676
|
if (raw.synonyms !== void 0 && raw.synonyms !== null) meta.synonyms = raw.synonyms;
|
|
677
|
+
syncMetadataFromWire(raw, meta);
|
|
605
678
|
return meta;
|
|
606
679
|
}
|
|
607
680
|
function isNonNegativeInteger(value) {
|
|
@@ -733,239 +806,6 @@ async function readMetadataEnvelope(data) {
|
|
|
733
806
|
return { header, metadata };
|
|
734
807
|
}
|
|
735
808
|
|
|
736
|
-
// src/persistence/durability/segment/manifest-fields.ts
|
|
737
|
-
function invalidManifest(message, details) {
|
|
738
|
-
throw new NarsilError(ErrorCodes.PERSISTENCE_LOAD_FAILED, `Segment manifest ${message}`, details);
|
|
739
|
-
}
|
|
740
|
-
function isRecord(value) {
|
|
741
|
-
return typeof value === "object" && value !== null && !Array.isArray(value) && !(value instanceof Uint8Array);
|
|
742
|
-
}
|
|
743
|
-
function isId(value) {
|
|
744
|
-
return typeof value === "number" && Number.isInteger(value) && value >= 0 && value <= MAX_SEGMENT_ID;
|
|
745
|
-
}
|
|
746
|
-
function isUint32(value) {
|
|
747
|
-
return typeof value === "number" && Number.isInteger(value) && value >= 0 && value <= 4294967295;
|
|
748
|
-
}
|
|
749
|
-
function isSequenceNumber(value) {
|
|
750
|
-
return typeof value === "number" && Number.isSafeInteger(value) && value >= 0;
|
|
751
|
-
}
|
|
752
|
-
function readFileRef(raw, expectedKey, what) {
|
|
753
|
-
if (raw.key !== expectedKey) {
|
|
754
|
-
invalidManifest(`lists the ${what} under the key "${String(raw.key)}" where it belongs at "${expectedKey}"`, {
|
|
755
|
-
key: raw.key,
|
|
756
|
-
expected: expectedKey
|
|
757
|
-
});
|
|
758
|
-
}
|
|
759
|
-
const bytes = raw.bytes;
|
|
760
|
-
if (typeof bytes !== "number" || !Number.isInteger(bytes) || bytes < HEADER_SIZE || bytes > MAX_FILE_BYTES) {
|
|
761
|
-
invalidManifest(`gives the ${what} "${expectedKey}" an invalid length`, { key: expectedKey, bytes });
|
|
762
|
-
}
|
|
763
|
-
if (!isUint32(raw.checksum)) invalidManifest(`gives the ${what} "${expectedKey}" an invalid checksum`);
|
|
764
|
-
if (raw.headOffset === void 0) return { key: expectedKey, bytes, checksum: raw.checksum };
|
|
765
|
-
const { headOffset, headLength, headChecksum } = raw;
|
|
766
|
-
if (!isSequenceNumber(headOffset) || !isUint32(headLength) || !isUint32(headChecksum)) {
|
|
767
|
-
invalidManifest(`gives the ${what} "${expectedKey}" an invalid head`, { key: expectedKey });
|
|
768
|
-
}
|
|
769
|
-
if (headOffset + headLength > bytes - HEADER_SIZE) {
|
|
770
|
-
invalidManifest(`ends the head of the ${what} "${expectedKey}" outside its payload`, {
|
|
771
|
-
key: expectedKey,
|
|
772
|
-
headOffset,
|
|
773
|
-
headLength,
|
|
774
|
-
bytes
|
|
775
|
-
});
|
|
776
|
-
}
|
|
777
|
-
return { key: expectedKey, bytes, checksum: raw.checksum, headOffset, headLength, headChecksum };
|
|
778
|
-
}
|
|
779
|
-
|
|
780
|
-
// src/persistence/durability/segment/manifest-vectors-decode.ts
|
|
781
|
-
function normalizeFile(raw, indexName, fieldPath, nextFileId, seenIds) {
|
|
782
|
-
if (!isRecord(raw) || !isId(raw.id)) invalidManifest("has an invalid vector file reference", { fieldPath });
|
|
783
|
-
if (raw.id >= nextFileId || seenIds.has(raw.id)) {
|
|
784
|
-
invalidManifest(`lists vector file ${raw.id} of "${fieldPath}" twice or at its next file id`, { fieldPath });
|
|
785
|
-
}
|
|
786
|
-
seenIds.add(raw.id);
|
|
787
|
-
const count = raw.count;
|
|
788
|
-
if (typeof count !== "number" || !Number.isInteger(count) || count < 0 || count > VECTOR_FILE_MAX_VECTORS) {
|
|
789
|
-
invalidManifest(`gives vector file ${raw.id} of "${fieldPath}" an invalid count`, { fieldPath, count });
|
|
790
|
-
}
|
|
791
|
-
const dead = raw.dead ?? null;
|
|
792
|
-
if (dead !== null && !(dead instanceof Uint8Array)) invalidManifest("has dead vectors that are not bytes");
|
|
793
|
-
if (dead !== null && dead.byteLength !== deadBytesFor(count)) {
|
|
794
|
-
invalidManifest(`marks the dead vectors of file ${raw.id} of "${fieldPath}" with the wrong number of bytes`);
|
|
795
|
-
}
|
|
796
|
-
const ref = readFileRef(raw, vectorFileKey(indexName, fieldPath, raw.id), "vector file");
|
|
797
|
-
return { ...ref, id: raw.id, count, dead };
|
|
798
|
-
}
|
|
799
|
-
function normalizeGraphParts(raw, indexName, fieldPath, generation) {
|
|
800
|
-
if (!Array.isArray(raw)) invalidManifest(`gives "${fieldPath}" no list of graph parts`, { fieldPath });
|
|
801
|
-
if (raw.length > 0 && generation === 0) invalidManifest(`lists graph parts of "${fieldPath}" at generation 0`);
|
|
802
|
-
return raw.map((part, at) => {
|
|
803
|
-
if (!isRecord(part)) invalidManifest(`has an invalid graph part of "${fieldPath}"`, { fieldPath });
|
|
804
|
-
return readFileRef(part, graphPartKey(indexName, fieldPath, generation, at), "graph part");
|
|
805
|
-
});
|
|
806
|
-
}
|
|
807
|
-
function normalizeField(raw, indexName, seenFields) {
|
|
808
|
-
if (!isRecord(raw) || typeof raw.fieldPath !== "string") invalidManifest("has an invalid vector reference");
|
|
809
|
-
const fieldPath = raw.fieldPath;
|
|
810
|
-
if (seenFields.has(fieldPath)) invalidManifest(`lists the vector field "${fieldPath}" twice`, { fieldPath });
|
|
811
|
-
seenFields.add(fieldPath);
|
|
812
|
-
if (!isId(raw.nextFileId)) invalidManifest(`gives "${fieldPath}" an invalid next file id`, { fieldPath });
|
|
813
|
-
if (!Array.isArray(raw.files)) invalidManifest(`gives "${fieldPath}" no list of vector files`, { fieldPath });
|
|
814
|
-
if (!isId(raw.graphGeneration)) invalidManifest(`gives "${fieldPath}" an invalid graph generation`, { fieldPath });
|
|
815
|
-
const nextFileId = raw.nextFileId;
|
|
816
|
-
const seenIds = /* @__PURE__ */ new Set();
|
|
817
|
-
return {
|
|
818
|
-
fieldPath,
|
|
819
|
-
nextFileId,
|
|
820
|
-
files: raw.files.map((file) => normalizeFile(file, indexName, fieldPath, nextFileId, seenIds)),
|
|
821
|
-
graphGeneration: raw.graphGeneration,
|
|
822
|
-
graphParts: normalizeGraphParts(raw.graphParts, indexName, fieldPath, raw.graphGeneration)
|
|
823
|
-
};
|
|
824
|
-
}
|
|
825
|
-
function normalizeVectorFields(raw, indexName) {
|
|
826
|
-
if (!Array.isArray(raw)) invalidManifest("has malformed vector references");
|
|
827
|
-
const seenFields = /* @__PURE__ */ new Set();
|
|
828
|
-
return raw.map((field) => normalizeField(field, indexName, seenFields));
|
|
829
|
-
}
|
|
830
|
-
|
|
831
|
-
// src/persistence/durability/segment/manifest-decode.ts
|
|
832
|
-
async function openManifestPayload(data) {
|
|
833
|
-
const { payload } = await openChecksummedEnvelope(data, {
|
|
834
|
-
envelopeFormatVersion: MANIFEST_ENVELOPE_VERSION,
|
|
835
|
-
what: "segment manifest",
|
|
836
|
-
allowsCompression: true
|
|
837
|
-
});
|
|
838
|
-
const raw = decode(payload);
|
|
839
|
-
if (!isRecord(raw)) invalidManifest("is not a map");
|
|
840
|
-
return raw;
|
|
841
|
-
}
|
|
842
|
-
function listedKeysOf(raw) {
|
|
843
|
-
const keys = [];
|
|
844
|
-
for (const partition of Array.isArray(raw.partitions) ? raw.partitions : []) {
|
|
845
|
-
if (!isRecord(partition) || !Array.isArray(partition.segments)) continue;
|
|
846
|
-
for (const segment of partition.segments)
|
|
847
|
-
if (isRecord(segment) && typeof segment.key === "string") keys.push(segment.key);
|
|
848
|
-
}
|
|
849
|
-
for (const field of Array.isArray(raw.vectors) ? raw.vectors : []) {
|
|
850
|
-
if (!isRecord(field)) continue;
|
|
851
|
-
for (const list of [field.files, field.graphParts]) {
|
|
852
|
-
if (!Array.isArray(list)) continue;
|
|
853
|
-
for (const file of list) if (isRecord(file) && typeof file.key === "string") keys.push(file.key);
|
|
854
|
-
}
|
|
855
|
-
}
|
|
856
|
-
return keys;
|
|
857
|
-
}
|
|
858
|
-
async function decodeSegmentManifest(data, indexName) {
|
|
859
|
-
return decodeManifestPayload(await openManifestPayload(data), indexName);
|
|
860
|
-
}
|
|
861
|
-
function decodeManifestPayload(raw, indexName) {
|
|
862
|
-
if (raw.version === EARLIER_SEGMENT_MANIFEST_VERSION) return { kind: "earlier", payload: raw };
|
|
863
|
-
if (raw.version !== SEGMENT_MANIFEST_VERSION) {
|
|
864
|
-
throw new NarsilError(
|
|
865
|
-
ErrorCodes.ENVELOPE_VERSION_MISMATCH,
|
|
866
|
-
`The segment manifest of index "${indexName}" holds layout ${String(raw.version)}, which this release cannot open. Export the index with the release that wrote it and import the export`,
|
|
867
|
-
{ indexName, version: raw.version }
|
|
868
|
-
);
|
|
869
|
-
}
|
|
870
|
-
const schema = raw.schema;
|
|
871
|
-
if (!isRecord(schema)) invalidManifest("is missing its schema");
|
|
872
|
-
requireValidFieldTypes(schema);
|
|
873
|
-
if (typeof raw.language !== "string") invalidManifest("is missing its language");
|
|
874
|
-
if (raw.analysisGeneration !== void 0 && !isSequenceNumber(raw.analysisGeneration)) {
|
|
875
|
-
invalidManifest("has an invalid analysis generation");
|
|
876
|
-
}
|
|
877
|
-
return {
|
|
878
|
-
kind: "current",
|
|
879
|
-
manifest: {
|
|
880
|
-
version: SEGMENT_MANIFEST_VERSION,
|
|
881
|
-
schema,
|
|
882
|
-
language: raw.language,
|
|
883
|
-
...raw.analysisGeneration ? { analysisGeneration: raw.analysisGeneration } : {},
|
|
884
|
-
checkpoint: normalizeCheckpoint(raw.checkpoint),
|
|
885
|
-
partitions: normalizePartitions(raw.partitions, indexName),
|
|
886
|
-
vectors: normalizeVectorFields(raw.vectors, indexName)
|
|
887
|
-
}
|
|
888
|
-
};
|
|
889
|
-
}
|
|
890
|
-
function normalizeCheckpoint(raw) {
|
|
891
|
-
if (!Array.isArray(raw)) invalidManifest("is missing its checkpoint list");
|
|
892
|
-
const seen = /* @__PURE__ */ new Set();
|
|
893
|
-
return raw.map((entry) => {
|
|
894
|
-
if (!isRecord(entry) || !isUint32(entry.partitionId) || !isSequenceNumber(entry.lastSeqNo) || !isSequenceNumber(entry.primaryTerm) || seen.has(entry.partitionId)) {
|
|
895
|
-
invalidManifest("has an invalid partition checkpoint", { entry });
|
|
896
|
-
}
|
|
897
|
-
seen.add(entry.partitionId);
|
|
898
|
-
const checkpoint = {
|
|
899
|
-
partitionId: entry.partitionId,
|
|
900
|
-
lastSeqNo: entry.lastSeqNo,
|
|
901
|
-
primaryTerm: entry.primaryTerm
|
|
902
|
-
};
|
|
903
|
-
if (entry.termHistory !== void 0) {
|
|
904
|
-
checkpoint.termHistory = normalizeTermHistory(entry.termHistory, entry.partitionId, entry.lastSeqNo);
|
|
905
|
-
}
|
|
906
|
-
return checkpoint;
|
|
907
|
-
});
|
|
908
|
-
}
|
|
909
|
-
function normalizeTermHistory(raw, partitionId, lastSeqNo) {
|
|
910
|
-
if (!Array.isArray(raw)) invalidManifest("has a term history that is not a list", { partitionId });
|
|
911
|
-
let previous = null;
|
|
912
|
-
return raw.map((start) => {
|
|
913
|
-
if (!isRecord(start) || !isSequenceNumber(start.primaryTerm) || !isSequenceNumber(start.firstSeqNo)) {
|
|
914
|
-
invalidManifest("has an invalid term history entry", { partitionId });
|
|
915
|
-
}
|
|
916
|
-
const read = { primaryTerm: start.primaryTerm, firstSeqNo: start.firstSeqNo };
|
|
917
|
-
if (read.firstSeqNo > lastSeqNo) {
|
|
918
|
-
invalidManifest(`has a term starting at seqNo ${read.firstSeqNo}, above lastSeqNo ${lastSeqNo}`, { partitionId });
|
|
919
|
-
}
|
|
920
|
-
if (previous !== null && (read.primaryTerm <= previous.primaryTerm || read.firstSeqNo <= previous.firstSeqNo)) {
|
|
921
|
-
invalidManifest("has a term history that fails to ascend strictly", { partitionId });
|
|
922
|
-
}
|
|
923
|
-
previous = read;
|
|
924
|
-
return read;
|
|
925
|
-
});
|
|
926
|
-
}
|
|
927
|
-
function normalizePartitions(raw, indexName) {
|
|
928
|
-
if (!Array.isArray(raw)) invalidManifest("is missing partition entries");
|
|
929
|
-
const seen = /* @__PURE__ */ new Set();
|
|
930
|
-
return raw.map((entry) => {
|
|
931
|
-
if (!isRecord(entry) || !isUint32(entry.partitionId) || seen.has(entry.partitionId)) {
|
|
932
|
-
invalidManifest("has a partition without a valid id", { partitionId: isRecord(entry) ? entry.partitionId : null });
|
|
933
|
-
}
|
|
934
|
-
seen.add(entry.partitionId);
|
|
935
|
-
const segments = normalizeSegments(entry.segments, indexName, entry.partitionId);
|
|
936
|
-
return {
|
|
937
|
-
partitionId: entry.partitionId,
|
|
938
|
-
nextSegmentId: readNextSegmentId(entry.nextSegmentId, segments, entry.partitionId),
|
|
939
|
-
segments
|
|
940
|
-
};
|
|
941
|
-
});
|
|
942
|
-
}
|
|
943
|
-
function normalizeSegments(raw, indexName, partitionId) {
|
|
944
|
-
if (!Array.isArray(raw)) invalidManifest("has malformed segment references", { partitionId });
|
|
945
|
-
if (raw.length > MAX_SEGMENTS_PER_PARTITION) {
|
|
946
|
-
invalidManifest(`lists ${raw.length} segments for partition ${partitionId}, above ${MAX_SEGMENTS_PER_PARTITION}`);
|
|
947
|
-
}
|
|
948
|
-
const seenIds = /* @__PURE__ */ new Set();
|
|
949
|
-
return raw.map((segment) => {
|
|
950
|
-
if (!isRecord(segment) || !isId(segment.id) || !isUint32(segment.docCount) || !isUint32(segment.tombstoneCount)) {
|
|
951
|
-
invalidManifest("has an invalid segment reference", { partitionId });
|
|
952
|
-
}
|
|
953
|
-
if (seenIds.has(segment.id)) invalidManifest(`reuses segment id ${segment.id} in partition ${partitionId}`);
|
|
954
|
-
seenIds.add(segment.id);
|
|
955
|
-
const ref = readFileRef(segment, segmentKey(indexName, partitionId, segment.id), "segment");
|
|
956
|
-
return { ...ref, id: segment.id, docCount: segment.docCount, tombstoneCount: segment.tombstoneCount };
|
|
957
|
-
});
|
|
958
|
-
}
|
|
959
|
-
function readNextSegmentId(value, segments, partitionId) {
|
|
960
|
-
if (!isId(value)) invalidManifest("has an invalid next segment id", { partitionId });
|
|
961
|
-
for (const segment of segments) {
|
|
962
|
-
if (segment.id >= value) {
|
|
963
|
-
invalidManifest(`next segment id ${value} does not exceed segment id ${segment.id}`, { partitionId });
|
|
964
|
-
}
|
|
965
|
-
}
|
|
966
|
-
return value;
|
|
967
|
-
}
|
|
968
|
-
|
|
969
809
|
// src/persistence/durability/segment/captured-partition.ts
|
|
970
810
|
function keepMaskOf(segment) {
|
|
971
811
|
const keep = new Uint8Array(segment.arrays.documentCount);
|
|
@@ -1378,7 +1218,7 @@ function holdsEveryHead(ref) {
|
|
|
1378
1218
|
async function loadFieldOnDemand(store, ref, vectorIndex, resolvePartition) {
|
|
1379
1219
|
const { pathOf } = store;
|
|
1380
1220
|
if (pathOf === void 0 || vectorIndex.storage !== "disk" || !holdsEveryHead(ref)) return false;
|
|
1381
|
-
const { loadFilesByParts, openColdVectorField, osqBitsOf, waitBeforeColdLoad } = await import('./cold-module-
|
|
1221
|
+
const { loadFilesByParts, openColdVectorField, osqBitsOf, waitBeforeColdLoad } = await import('./cold-module-VTUGDYNY.mjs');
|
|
1382
1222
|
await Promise.all([
|
|
1383
1223
|
...ref.files.map((file) => requireListedSize(store, file.key, { bytes: file.bytes, what: "vector file" })),
|
|
1384
1224
|
...ref.graphParts.map((part) => requireListedSize(store, part.key, { bytes: part.bytes, what: "graph part" }))
|
|
@@ -1566,6 +1406,50 @@ function createSeqOwner(startSeqNo, primaryTerm = SINGLE_NODE_PRIMARY_TERM) {
|
|
|
1566
1406
|
}
|
|
1567
1407
|
};
|
|
1568
1408
|
}
|
|
1409
|
+
function fileRefOnTheWire(ref) {
|
|
1410
|
+
return {
|
|
1411
|
+
key: ref.key,
|
|
1412
|
+
bytes: ref.bytes,
|
|
1413
|
+
checksum: ref.checksum,
|
|
1414
|
+
...ref.headOffset === void 0 ? {} : { headOffset: ref.headOffset, headLength: ref.headLength, headChecksum: ref.headChecksum }
|
|
1415
|
+
};
|
|
1416
|
+
}
|
|
1417
|
+
function encodeSegmentManifest(manifest) {
|
|
1418
|
+
const payload = encode({
|
|
1419
|
+
version: SEGMENT_MANIFEST_VERSION,
|
|
1420
|
+
schema: manifest.schema,
|
|
1421
|
+
language: manifest.language,
|
|
1422
|
+
...manifest.analysisGeneration ? { analysisGeneration: manifest.analysisGeneration } : {},
|
|
1423
|
+
checkpoint: manifest.checkpoint.map((c) => ({
|
|
1424
|
+
partitionId: c.partitionId,
|
|
1425
|
+
lastSeqNo: c.lastSeqNo,
|
|
1426
|
+
primaryTerm: c.primaryTerm,
|
|
1427
|
+
...c.termHistory === void 0 ? {} : {
|
|
1428
|
+
termHistory: c.termHistory.map((start) => ({ primaryTerm: start.primaryTerm, firstSeqNo: start.firstSeqNo }))
|
|
1429
|
+
}
|
|
1430
|
+
})),
|
|
1431
|
+
partitions: manifest.partitions.map((p) => ({
|
|
1432
|
+
partitionId: p.partitionId,
|
|
1433
|
+
nextSegmentId: p.nextSegmentId,
|
|
1434
|
+
segments: p.segments.map((s) => ({
|
|
1435
|
+
id: s.id,
|
|
1436
|
+
key: s.key,
|
|
1437
|
+
docCount: s.docCount,
|
|
1438
|
+
tombstoneCount: s.tombstoneCount,
|
|
1439
|
+
bytes: s.bytes,
|
|
1440
|
+
checksum: s.checksum
|
|
1441
|
+
}))
|
|
1442
|
+
})),
|
|
1443
|
+
vectors: manifest.vectors.map((v) => ({
|
|
1444
|
+
fieldPath: v.fieldPath,
|
|
1445
|
+
nextFileId: v.nextFileId,
|
|
1446
|
+
files: v.files.map((f) => ({ id: f.id, ...fileRefOnTheWire(f), count: f.count, dead: f.dead })),
|
|
1447
|
+
graphGeneration: v.graphGeneration,
|
|
1448
|
+
graphParts: v.graphParts.map(fileRefOnTheWire)
|
|
1449
|
+
}))
|
|
1450
|
+
});
|
|
1451
|
+
return packChecksummedEnvelope([payload], MANIFEST_ENVELOPE_VERSION, "segment manifest");
|
|
1452
|
+
}
|
|
1569
1453
|
|
|
1570
1454
|
// src/persistence/durability/partition-checkpoint.ts
|
|
1571
1455
|
function checkpointLastSeqNo(checkpoint, partitionId) {
|
|
@@ -1646,7 +1530,7 @@ function nextMarkerSlot(lastWrittenSlot) {
|
|
|
1646
1530
|
function markerSlotOffset(slotIndex) {
|
|
1647
1531
|
return slotIndex * COMMIT_MARKER_SLOT_SIZE;
|
|
1648
1532
|
}
|
|
1649
|
-
function
|
|
1533
|
+
function isRecord(value) {
|
|
1650
1534
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
1651
1535
|
}
|
|
1652
1536
|
function optionalIndexUuid(value, payloadName) {
|
|
@@ -1668,7 +1552,7 @@ function optionalPreviousPrimaryTerm(value, payloadName) {
|
|
|
1668
1552
|
return value;
|
|
1669
1553
|
}
|
|
1670
1554
|
function validateEntryPayload(decoded) {
|
|
1671
|
-
if (!
|
|
1555
|
+
if (!isRecord(decoded) || !isRecord(decoded.entry)) {
|
|
1672
1556
|
throw new Error('Invalid EntryPayload: missing or invalid "entry" field');
|
|
1673
1557
|
}
|
|
1674
1558
|
const entry = decoded.entry;
|
|
@@ -1757,7 +1641,7 @@ function checkSegmentHeader(data) {
|
|
|
1757
1641
|
}
|
|
1758
1642
|
return { ok: true };
|
|
1759
1643
|
}
|
|
1760
|
-
function
|
|
1644
|
+
function decodeWalEntry(payload) {
|
|
1761
1645
|
const decoded = decode(payload);
|
|
1762
1646
|
const { entry } = validateEntryPayload({ entry: decoded });
|
|
1763
1647
|
if (computeEntryChecksum(entry) !== entry.checksum) {
|
|
@@ -1805,7 +1689,7 @@ function readDurableRegion(data, durableByteLength, maxRecordBytes = MAX_WAL_REC
|
|
|
1805
1689
|
}
|
|
1806
1690
|
let entry;
|
|
1807
1691
|
try {
|
|
1808
|
-
entry =
|
|
1692
|
+
entry = decodeWalEntry(payload);
|
|
1809
1693
|
} catch (err) {
|
|
1810
1694
|
corrupt("WAL record payload failed to decode inside the durable region", {
|
|
1811
1695
|
offset,
|
|
@@ -1853,7 +1737,7 @@ function readTailBeyondFrontier(data, durableByteLength, lastDurableSeqNo, maxRe
|
|
|
1853
1737
|
}
|
|
1854
1738
|
let entry;
|
|
1855
1739
|
try {
|
|
1856
|
-
entry =
|
|
1740
|
+
entry = decodeWalEntry(payload);
|
|
1857
1741
|
} catch {
|
|
1858
1742
|
break;
|
|
1859
1743
|
}
|
|
@@ -2138,7 +2022,7 @@ async function compactPartitionSegments(input) {
|
|
|
2138
2022
|
if (paged) {
|
|
2139
2023
|
const { directory } = input.store;
|
|
2140
2024
|
if (directory === void 0) return { segments, nextSegmentId: input.nextSegmentId };
|
|
2141
|
-
const { mergePagedWindow } = await import('./module-
|
|
2025
|
+
const { mergePagedWindow } = await import('./module-M4JNBV6V.mjs');
|
|
2142
2026
|
return replacing(
|
|
2143
2027
|
await mergePagedWindow({
|
|
2144
2028
|
store: input.store,
|
|
@@ -2226,7 +2110,7 @@ function pagedSettingsOf(context) {
|
|
|
2226
2110
|
async function tombstonesOfDelta(context, older, selections, deleted) {
|
|
2227
2111
|
const { directory } = context.input.store;
|
|
2228
2112
|
if (context.input.metadata.textStorage !== "disk" || directory === void 0) return deleted;
|
|
2229
|
-
const { pagedTombstonesFor } = await import('./module-
|
|
2113
|
+
const { pagedTombstonesFor } = await import('./module-M4JNBV6V.mjs');
|
|
2230
2114
|
return pagedTombstonesFor(
|
|
2231
2115
|
directory,
|
|
2232
2116
|
older,
|
|
@@ -2427,7 +2311,7 @@ function removeFromPartition(manager, partitionId, docIds) {
|
|
|
2427
2311
|
}
|
|
2428
2312
|
}
|
|
2429
2313
|
async function attachPagedSegment(directory, ref, partitionId, manager, options) {
|
|
2430
|
-
const { checkPagedSegmentFully, createPagedFrozenSegment, openPagedSnapshot, pagedListingOf } = await import('./module-
|
|
2314
|
+
const { checkPagedSegmentFully, createPagedFrozenSegment, openPagedSnapshot, pagedListingOf } = await import('./module-M4JNBV6V.mjs');
|
|
2431
2315
|
if (options.decodesEveryDocument) await checkPagedSegmentFully(directory, ref);
|
|
2432
2316
|
const snapshot = openPagedSnapshot(await pagedListingOf(directory, ref));
|
|
2433
2317
|
requireAgreedSchema(options.schema, snapshot.schema, ref.key);
|
|
@@ -2441,7 +2325,7 @@ async function loadPartitionSegments(store, partition, manager, options) {
|
|
|
2441
2325
|
const { directory } = store;
|
|
2442
2326
|
for (const ref of partition.segments) {
|
|
2443
2327
|
if (manager.config.textStorage === "disk" && directory !== void 0) {
|
|
2444
|
-
const { isPagedSegmentFile } = await import('./module-
|
|
2328
|
+
const { isPagedSegmentFile } = await import('./module-M4JNBV6V.mjs');
|
|
2445
2329
|
if (await isPagedSegmentFile(directory, ref.key)) {
|
|
2446
2330
|
await attachPagedSegment(directory, ref, partition.partitionId, manager, options);
|
|
2447
2331
|
await yieldToEventLoop();
|
|
@@ -2497,7 +2381,7 @@ async function loadSegmentedCheckpoint(store, indexName, manifest, deps, decodes
|
|
|
2497
2381
|
(field) => deps.vectorIndexes.get(field.fieldPath)?.storage === "disk" && field.files.some((file) => file.headOffset !== void 0)
|
|
2498
2382
|
);
|
|
2499
2383
|
if (!decodesEveryDocument && directory !== void 0 && opensVectorsOnDemand) {
|
|
2500
|
-
const { startReadingOpeningSectionsAhead } = await import('./module-
|
|
2384
|
+
const { startReadingOpeningSectionsAhead } = await import('./module-M4JNBV6V.mjs');
|
|
2501
2385
|
await startReadingOpeningSectionsAhead(directory, manifest);
|
|
2502
2386
|
}
|
|
2503
2387
|
for (const partition of manifest.partitions) {
|
|
@@ -2631,4 +2515,4 @@ function deserializePayloadV2(data) {
|
|
|
2631
2515
|
};
|
|
2632
2516
|
}
|
|
2633
2517
|
|
|
2634
|
-
export { SEGMENT_HEADER_SIZE, SINGLE_NODE_PRIMARY_TERM, VECTOR_FILE_ENVELOPE_VERSION, buildEntry, captureWholePartition, checkpointLastSeqNo, checkpointPrimaryTerm, commitCheckpointManifest, createSeqOwner,
|
|
2518
|
+
export { FRAME_CRC_SIZE, MAX_WAL_RECORD_BYTES, RECORD_LENGTH_SIZE, SEGMENT_HEADER_SIZE, SINGLE_NODE_PRIMARY_TERM, VECTOR_FILE_ENVELOPE_VERSION, buildEntry, captureWholePartition, checkSegmentHeader, checkpointLastSeqNo, checkpointPrimaryTerm, commitCheckpointManifest, createSeqOwner, decodeWalEntry, deserializePayloadV1, deserializePayloadV2, documentsOfPayloadV2, durableMetadataConfigOf, durableRecordMissing, encodeMarkerSlot, encodeSegmentManifest, frameRecord, growPartitionsTo, indexMetadataOf, loadSegmentedCheckpoint, markerSlotOffset, metadataConfigOf, metadataFromConfig, nextMarkerSlot, nextSegmentKey, partitionContentsOf, readCommitMarker, readCurrentManifest, readGraphParts, readMetadataEnvelope, readSegmentManifest, readVectorFile, readWalSegments, reclaimUnlistedKeys, removeCheckpointGarbage, unpackEnvelopeBytes, unpackIndexSnapshotEnvelope, writeCheckpointSegments, writeLiveVectors, writeMetadataEnvelope, writeSegmentHeader };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { removeDocumentVectors, prepareDocumentVectors, insertDocumentVectors, getNestedValue
|
|
2
|
-
import {
|
|
1
|
+
import { removeDocumentVectors, prepareDocumentVectors, insertDocumentVectors, getNestedValue } from './chunk-2SHAKW2Z.mjs';
|
|
2
|
+
import { requireValidFieldTypes, VECTOR_PATTERN } from './chunk-7TTWXUH6.mjs';
|
|
3
|
+
import { NarsilError, ErrorCodes } from './chunk-MYITLCHT.mjs';
|
|
3
4
|
import { decode } from '@msgpack/msgpack';
|
|
4
5
|
|
|
5
6
|
function applyIndexEntry(entry, manager, vectorFieldPaths, vecIndexes, schedulesGraphBuild = true) {
|