@delali/narsil 0.3.1-next.152 → 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 +11 -2
- package/dist/distribution/coordinator/etcd.mjs +268 -107
- 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
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
// src/core/fuzzy.ts
|
|
2
|
+
var FIRST_SURROGATE = 55296;
|
|
3
|
+
var LAST_SURROGATE = 57343;
|
|
4
|
+
var LAST_BASIC_PLANE_CODE_POINT = 65535;
|
|
5
|
+
function hasSurrogate(text) {
|
|
6
|
+
for (let index = 0; index < text.length; index++) {
|
|
7
|
+
const unit = text.charCodeAt(index);
|
|
8
|
+
if (unit >= FIRST_SURROGATE && unit <= LAST_SURROGATE) return true;
|
|
9
|
+
}
|
|
10
|
+
return false;
|
|
11
|
+
}
|
|
12
|
+
function fuzzyPrefixOf(queryTerm, prefixLength) {
|
|
13
|
+
let end = 0;
|
|
14
|
+
for (let counted = 0; counted < prefixLength && end < queryTerm.length; counted++) {
|
|
15
|
+
const codePoint = queryTerm.codePointAt(end);
|
|
16
|
+
end += codePoint !== void 0 && codePoint > LAST_BASIC_PLANE_CODE_POINT ? 2 : 1;
|
|
17
|
+
}
|
|
18
|
+
return queryTerm.slice(0, end);
|
|
19
|
+
}
|
|
20
|
+
function fuzzyTermMatches(queryTerm, indexTerm, tolerance, prefixLength) {
|
|
21
|
+
if (queryTerm === indexTerm) return true;
|
|
22
|
+
if (tolerance <= 0) return false;
|
|
23
|
+
if (!indexTerm.startsWith(fuzzyPrefixOf(queryTerm, prefixLength))) return false;
|
|
24
|
+
return boundedLevenshtein(queryTerm, indexTerm, tolerance).withinTolerance;
|
|
25
|
+
}
|
|
26
|
+
function boundedLevenshtein(a, b, tolerance) {
|
|
27
|
+
if (tolerance < 0) return { distance: -1, withinTolerance: false, cells: 0 };
|
|
28
|
+
if (a === b) return { distance: 0, withinTolerance: true, cells: 0 };
|
|
29
|
+
return tabulatedLevenshtein(a, b, tolerance);
|
|
30
|
+
}
|
|
31
|
+
function tabulatedLevenshtein(a, b, tolerance) {
|
|
32
|
+
if (tolerance < 0) return { distance: -1, withinTolerance: false, cells: 0 };
|
|
33
|
+
if (hasSurrogate(a) || hasSurrogate(b)) return bandedDistance(Array.from(a), Array.from(b), tolerance);
|
|
34
|
+
return bandedDistance(a, b, tolerance);
|
|
35
|
+
}
|
|
36
|
+
function bandedDistance(a, b, tolerance) {
|
|
37
|
+
const m = a.length;
|
|
38
|
+
const n = b.length;
|
|
39
|
+
const beyond = tolerance + 1;
|
|
40
|
+
if (Math.abs(m - n) > tolerance) return { distance: beyond, withinTolerance: false, cells: 0 };
|
|
41
|
+
let previous = new Uint32Array(n + 1).fill(beyond);
|
|
42
|
+
let current = new Uint32Array(n + 1).fill(beyond);
|
|
43
|
+
const firstRowEnd = Math.min(n, tolerance);
|
|
44
|
+
for (let j = 0; j <= firstRowEnd; j++) previous[j] = j;
|
|
45
|
+
let cells = 0;
|
|
46
|
+
for (let i = 1; i <= m; i++) {
|
|
47
|
+
const low = Math.max(1, i - tolerance);
|
|
48
|
+
const high = Math.min(n, i + tolerance);
|
|
49
|
+
current[low - 1] = low === 1 ? i : beyond;
|
|
50
|
+
let rowMin = current[low - 1];
|
|
51
|
+
const character = a[i - 1];
|
|
52
|
+
if (high >= low) cells += high - low + 1;
|
|
53
|
+
for (let j = low; j <= high; j++) {
|
|
54
|
+
const substitution = previous[j - 1] + (character === b[j - 1] ? 0 : 1);
|
|
55
|
+
const cell = Math.min(previous[j] + 1, current[j - 1] + 1, substitution, beyond);
|
|
56
|
+
current[j] = cell;
|
|
57
|
+
if (cell < rowMin) rowMin = cell;
|
|
58
|
+
}
|
|
59
|
+
if (rowMin > tolerance) return { distance: beyond, withinTolerance: false, cells };
|
|
60
|
+
const finished = previous;
|
|
61
|
+
previous = current;
|
|
62
|
+
current = finished;
|
|
63
|
+
}
|
|
64
|
+
const distance = previous[n];
|
|
65
|
+
return { distance, withinTolerance: distance <= tolerance, cells };
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export { boundedLevenshtein, fuzzyPrefixOf, fuzzyTermMatches, tabulatedLevenshtein };
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
import { crc32Init, crc32Final, crc32Update } from './chunk-7GXJUJ24.mjs';
|
|
2
|
+
import { MAX_FILE_BYTES, CHECKSUM_YIELD_CHUNK_BYTES } from './chunk-U476IXKQ.mjs';
|
|
3
|
+
import { NarsilError, ErrorCodes } from './chunk-KUZKUONM.mjs';
|
|
4
|
+
|
|
5
|
+
// src/serialization/header.ts
|
|
6
|
+
var MAGIC_BYTES = new Uint8Array([78, 82, 83, 76]);
|
|
7
|
+
var HEADER_SIZE = 32;
|
|
8
|
+
var RESERVED_SIZE = 14;
|
|
9
|
+
var MAX_PAYLOAD_LENGTH = 4294967295;
|
|
10
|
+
var COMPRESSION_ALGORITHMS = {
|
|
11
|
+
0: "none",
|
|
12
|
+
1: "gzip",
|
|
13
|
+
2: "lz4",
|
|
14
|
+
3: "zstd"
|
|
15
|
+
};
|
|
16
|
+
var COMPRESSION_TO_BITS = {
|
|
17
|
+
none: 0,
|
|
18
|
+
gzip: 1,
|
|
19
|
+
lz4: 2,
|
|
20
|
+
zstd: 3
|
|
21
|
+
};
|
|
22
|
+
function encodeFlags(flags) {
|
|
23
|
+
let bits = 0;
|
|
24
|
+
if (flags.compressionEnabled) bits |= 1;
|
|
25
|
+
bits |= (COMPRESSION_TO_BITS[flags.compressionAlgorithm] & 3) << 1;
|
|
26
|
+
if (flags.checksumPresent) bits |= 1 << 3;
|
|
27
|
+
if (flags.encryptionEnabled) bits |= 1 << 4;
|
|
28
|
+
return bits;
|
|
29
|
+
}
|
|
30
|
+
function decodeFlags(value) {
|
|
31
|
+
const compressionEnabled = (value & 1) === 1;
|
|
32
|
+
const algorithmBits = value >> 1 & 3;
|
|
33
|
+
const checksumPresent = (value >> 3 & 1) === 1;
|
|
34
|
+
const encryptionEnabled = (value >> 4 & 1) === 1;
|
|
35
|
+
return {
|
|
36
|
+
compressionEnabled,
|
|
37
|
+
compressionAlgorithm: COMPRESSION_ALGORITHMS[algorithmBits] ?? "none",
|
|
38
|
+
checksumPresent,
|
|
39
|
+
encryptionEnabled
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
function writeHeader(header) {
|
|
43
|
+
if (header.payloadLength > MAX_PAYLOAD_LENGTH) {
|
|
44
|
+
throw new NarsilError(
|
|
45
|
+
ErrorCodes.PERSISTENCE_SAVE_FAILED,
|
|
46
|
+
`A payload of ${header.payloadLength} bytes exceeds the ${MAX_PAYLOAD_LENGTH} bytes the envelope header can describe`,
|
|
47
|
+
{ payloadLength: header.payloadLength, maxPayloadLength: MAX_PAYLOAD_LENGTH }
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
const buffer = new Uint8Array(HEADER_SIZE);
|
|
51
|
+
const view = new DataView(buffer.buffer);
|
|
52
|
+
buffer.set(MAGIC_BYTES, 0);
|
|
53
|
+
buffer[4] = header.envelopeFormatVersion & 255;
|
|
54
|
+
buffer[5] = header.engineVersionMajor & 255;
|
|
55
|
+
buffer[6] = header.engineVersionMinor & 255;
|
|
56
|
+
buffer[7] = header.engineVersionPatch & 255;
|
|
57
|
+
view.setUint32(8, header.payloadLength, false);
|
|
58
|
+
view.setUint16(12, encodeFlags(header.flags), false);
|
|
59
|
+
view.setUint32(14, header.checksum, false);
|
|
60
|
+
for (let i = 18; i < HEADER_SIZE; i++) {
|
|
61
|
+
buffer[i] = 0;
|
|
62
|
+
}
|
|
63
|
+
return buffer;
|
|
64
|
+
}
|
|
65
|
+
function hasNrslMagic(data) {
|
|
66
|
+
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];
|
|
67
|
+
}
|
|
68
|
+
function readHeader(data) {
|
|
69
|
+
if (data.length < HEADER_SIZE) {
|
|
70
|
+
throw new NarsilError(
|
|
71
|
+
ErrorCodes.ENVELOPE_INVALID_MAGIC,
|
|
72
|
+
`Expected at least ${HEADER_SIZE} bytes, received ${data.length}`
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
if (data[0] !== MAGIC_BYTES[0] || data[1] !== MAGIC_BYTES[1] || data[2] !== MAGIC_BYTES[2] || data[3] !== MAGIC_BYTES[3]) {
|
|
76
|
+
throw new NarsilError(ErrorCodes.ENVELOPE_INVALID_MAGIC, "File does not begin with NRSL magic bytes");
|
|
77
|
+
}
|
|
78
|
+
const view = new DataView(data.buffer, data.byteOffset, data.byteLength);
|
|
79
|
+
const envelopeFormatVersion = data[4];
|
|
80
|
+
const engineVersionMajor = data[5];
|
|
81
|
+
const engineVersionMinor = data[6];
|
|
82
|
+
const engineVersionPatch = data[7];
|
|
83
|
+
const payloadLength = view.getUint32(8, false);
|
|
84
|
+
const flagBits = view.getUint16(12, false);
|
|
85
|
+
const checksum = view.getUint32(14, false);
|
|
86
|
+
const reserved = data.slice(18, HEADER_SIZE);
|
|
87
|
+
return {
|
|
88
|
+
magic: "NRSL",
|
|
89
|
+
envelopeFormatVersion,
|
|
90
|
+
engineVersionMajor,
|
|
91
|
+
engineVersionMinor,
|
|
92
|
+
engineVersionPatch,
|
|
93
|
+
payloadLength,
|
|
94
|
+
flags: decodeFlags(flagBits),
|
|
95
|
+
checksum,
|
|
96
|
+
reserved
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// src/serialization/chunk-checksum.ts
|
|
101
|
+
function yieldToEventLoop() {
|
|
102
|
+
if (typeof setImmediate === "function") {
|
|
103
|
+
return new Promise((resolve) => setImmediate(resolve));
|
|
104
|
+
}
|
|
105
|
+
return new Promise((resolve) => setTimeout(resolve, 0));
|
|
106
|
+
}
|
|
107
|
+
async function advanceChecksum(start, payload) {
|
|
108
|
+
let state = start;
|
|
109
|
+
for (let offset = 0; offset < payload.length; offset += CHECKSUM_YIELD_CHUNK_BYTES) {
|
|
110
|
+
const end = Math.min(offset + CHECKSUM_YIELD_CHUNK_BYTES, payload.length);
|
|
111
|
+
state = crc32Update(state, payload.subarray(offset, end));
|
|
112
|
+
if (end < payload.length) {
|
|
113
|
+
await yieldToEventLoop();
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
return state;
|
|
117
|
+
}
|
|
118
|
+
async function checksumOfChunks(chunks) {
|
|
119
|
+
let state = crc32Init();
|
|
120
|
+
for (const chunk of chunks) state = await advanceChecksum(state, chunk);
|
|
121
|
+
return crc32Final(state);
|
|
122
|
+
}
|
|
123
|
+
function payloadByteLength(chunks) {
|
|
124
|
+
let total = 0;
|
|
125
|
+
for (const chunk of chunks) total += chunk.byteLength;
|
|
126
|
+
return total;
|
|
127
|
+
}
|
|
128
|
+
function requireWithinFileLimit(byteLength, what) {
|
|
129
|
+
if (byteLength <= MAX_FILE_BYTES) return;
|
|
130
|
+
throw new NarsilError(
|
|
131
|
+
ErrorCodes.PERSISTENCE_SAVE_FAILED,
|
|
132
|
+
`The ${what} would take ${byteLength} bytes, above the file size limit of ${MAX_FILE_BYTES}`,
|
|
133
|
+
{ bytes: byteLength, maximum: MAX_FILE_BYTES }
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
function packEnvelopeWithEngineVersion(payloadChunks, envelopeFormatVersion, what, checksum, engineVersion) {
|
|
137
|
+
const payloadLength = payloadByteLength(payloadChunks);
|
|
138
|
+
requireWithinFileLimit(HEADER_SIZE + payloadLength, what);
|
|
139
|
+
const [major, minor, patch] = engineVersion;
|
|
140
|
+
const header = writeHeader({
|
|
141
|
+
envelopeFormatVersion,
|
|
142
|
+
engineVersionMajor: major,
|
|
143
|
+
engineVersionMinor: minor,
|
|
144
|
+
engineVersionPatch: patch,
|
|
145
|
+
payloadLength,
|
|
146
|
+
flags: { compressionEnabled: false, compressionAlgorithm: "none", checksumPresent: true, encryptionEnabled: false },
|
|
147
|
+
checksum});
|
|
148
|
+
return { chunks: [header, ...payloadChunks], byteLength: HEADER_SIZE + payloadLength, checksum };
|
|
149
|
+
}
|
|
150
|
+
function loadFailed(message, details) {
|
|
151
|
+
throw new NarsilError(ErrorCodes.PERSISTENCE_LOAD_FAILED, message, details);
|
|
152
|
+
}
|
|
153
|
+
async function gunzipWithinLimit(compressed, what) {
|
|
154
|
+
const { gunzip } = await import('./gzip-F4HMIEEQ.mjs');
|
|
155
|
+
try {
|
|
156
|
+
return await gunzip(compressed, MAX_FILE_BYTES);
|
|
157
|
+
} catch (error) {
|
|
158
|
+
if (error?.code === "EFBIG") {
|
|
159
|
+
loadFailed(`The ${what} inflates past the file size limit of ${MAX_FILE_BYTES} bytes`);
|
|
160
|
+
}
|
|
161
|
+
loadFailed(`The ${what} holds a gzip payload that fails to inflate`, {
|
|
162
|
+
cause: error instanceof Error ? error.message : String(error)
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
async function openChecksummedEnvelope(data, expected) {
|
|
167
|
+
const { envelopeFormatVersion, what } = expected;
|
|
168
|
+
const header = readHeader(data);
|
|
169
|
+
if (header.envelopeFormatVersion !== envelopeFormatVersion) {
|
|
170
|
+
throw new NarsilError(
|
|
171
|
+
ErrorCodes.ENVELOPE_VERSION_MISMATCH,
|
|
172
|
+
`The ${what} holds envelope format v${header.envelopeFormatVersion}, while this build reads it as v${envelopeFormatVersion}`,
|
|
173
|
+
{ version: header.envelopeFormatVersion, expected: envelopeFormatVersion }
|
|
174
|
+
);
|
|
175
|
+
}
|
|
176
|
+
if (header.flags.encryptionEnabled) {
|
|
177
|
+
throw new NarsilError(
|
|
178
|
+
ErrorCodes.ENVELOPE_VERSION_MISMATCH,
|
|
179
|
+
`The ${what} is encrypted, which this build cannot read`
|
|
180
|
+
);
|
|
181
|
+
}
|
|
182
|
+
if (header.flags.compressionEnabled && !expected.allowsCompression) {
|
|
183
|
+
loadFailed(`The ${what} is compressed, while its format stores it raw`);
|
|
184
|
+
}
|
|
185
|
+
if (header.flags.compressionEnabled && header.flags.compressionAlgorithm !== "gzip") {
|
|
186
|
+
throw new NarsilError(
|
|
187
|
+
ErrorCodes.ENVELOPE_VERSION_MISMATCH,
|
|
188
|
+
`The ${what} uses ${header.flags.compressionAlgorithm} compression, which this build cannot read`
|
|
189
|
+
);
|
|
190
|
+
}
|
|
191
|
+
if (!header.flags.checksumPresent) loadFailed(`The ${what} carries no checksum, while its format requires one`);
|
|
192
|
+
if (data.byteLength !== HEADER_SIZE + header.payloadLength) {
|
|
193
|
+
loadFailed(
|
|
194
|
+
`The ${what} holds ${data.byteLength} bytes where its header gives ${HEADER_SIZE + header.payloadLength}`,
|
|
195
|
+
{ bytes: data.byteLength, expected: HEADER_SIZE + header.payloadLength }
|
|
196
|
+
);
|
|
197
|
+
}
|
|
198
|
+
const payload = data.subarray(HEADER_SIZE);
|
|
199
|
+
const computed = await checksumOfChunks([payload]);
|
|
200
|
+
if (computed !== header.checksum) {
|
|
201
|
+
throw new NarsilError(
|
|
202
|
+
ErrorCodes.PERSISTENCE_CRC_MISMATCH,
|
|
203
|
+
`The checksum of the ${what} does not match its payload`,
|
|
204
|
+
{
|
|
205
|
+
expected: header.checksum,
|
|
206
|
+
computed
|
|
207
|
+
}
|
|
208
|
+
);
|
|
209
|
+
}
|
|
210
|
+
if (header.flags.compressionEnabled) return { header, payload: await gunzipWithinLimit(payload, what) };
|
|
211
|
+
return { header, payload };
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
export { HEADER_SIZE, RESERVED_SIZE, checksumOfChunks, hasNrslMagic, openChecksummedEnvelope, packEnvelopeWithEngineVersion, payloadByteLength, readHeader, requireWithinFileLimit, writeHeader };
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { youngGenerationBytesOfThisV8 } from './chunk-Q2UL2TPC.mjs';
|
|
2
1
|
import { PROCESS_LIMIT_REFRESH_INTERVAL_MS } from './chunk-ZXNQEW43.mjs';
|
|
3
2
|
import { turnIsSpent, yieldTurn, createDocIdMap } from './chunk-LQG5G2LY.mjs';
|
|
4
|
-
import { PATTERN_EXPRESSION_OPERATORS, PATTERN_TEST_OPERATORS, PATTERN_ELEMENT_OPERATORS, requireTextRangeField, isFiniteNumber, invalid, requireFieldKind, kindOfValue, requireListLength, isObjectRecord, GEO_UNIT_METRES, patternSearchModule, DEFAULT_PATTERN_WORK_CAP, MAX_FILTER_DEPTH, MAX_FILTER_TESTS, TYPO_CLAIM_SLOTS_PER_WORD, FILTER_OPERAND_COPY_DEPTH, PATTERN_WORK_FLUSH_UNITS, MATCHER_STATE_BUDGET_BYTES } from './chunk-
|
|
3
|
+
import { PATTERN_EXPRESSION_OPERATORS, PATTERN_TEST_OPERATORS, PATTERN_ELEMENT_OPERATORS, requireTextRangeField, isFiniteNumber, invalid, requireFieldKind, kindOfValue, requireListLength, isObjectRecord, GEO_UNIT_METRES, patternSearchModule, DEFAULT_PATTERN_WORK_CAP, MAX_FILTER_DEPTH, MAX_FILTER_TESTS, TYPO_CLAIM_SLOTS_PER_WORD, FILTER_OPERAND_COPY_DEPTH, PATTERN_WORK_FLUSH_UNITS, MATCHER_STATE_BUDGET_BYTES } from './chunk-OKX2BBNW.mjs';
|
|
5
4
|
import { bitsetHas, createBitSet, bitsetSet, bitsetIsEmpty, bitsetOrInto, bitsetAndNotInto, bitsetAndInto, bitsetFromSet } from './chunk-JUKYYXSP.mjs';
|
|
6
|
-
import { isLatitude, MAX_LATITUDE_DEGREES, isLongitude, MAX_LONGITUDE_DEGREES, MIN_POLYGON_POINTS,
|
|
5
|
+
import { isLatitude, MAX_LATITUDE_DEGREES, isLongitude, MAX_LONGITUDE_DEGREES, MIN_POLYGON_POINTS, expandTermPrefix, suggestDisplayTerms, getNestedValue, validateDocument, validateDocumentStrict, textFieldsChanged, getFlatSchema, tokenizeOptions, partialWordSearchModule, ANTIMERIDIAN_SPAN_DEGREES, FULL_TURN_DEGREES, getOrCreateFieldNameIndex, partitionDocumentFrequency, LOCATION_CODE_BITS_PER_AXIS, MAX_COVERING_CELLS, VINCENTY_CONVERGENCE_THRESHOLD, EARTH_RADIUS_METERS, RADIUS_BOX_MARGIN_RATIO, RADIUS_BOX_MARGIN_RADIANS, DEG_TO_RAD, VINCENTY_MAX_ITERATIONS } from './chunk-VMXSVVXG.mjs';
|
|
6
|
+
import { partialFieldsOf, schemaFieldsOf, flattenSchema } from './chunk-Z3TNWCI5.mjs';
|
|
7
7
|
import { MAX_SORT_FIELDS, MAX_SORT_FIELD_NAME_LENGTH, MAX_CURSOR_LENGTH, MAX_CURSOR_ANCHOR_CODE_POINTS, RESULT_WINDOW, DEFAULT_FUZZY_PREFIX_LENGTH, DEFAULT_PAGE_SIZE, PREFIX_MAX_EXPANSIONS } from './chunk-FQBFZAWG.mjs';
|
|
8
|
-
import { tokenize, visitTokens } from './chunk-
|
|
8
|
+
import { tokenize, visitTokens } from './chunk-ZIFJXCKA.mjs';
|
|
9
9
|
import { TARGET_BLOCK_ENTRIES, SCORE_BUFFER_INITIAL_TOUCHED_CAPACITY, PRUNING_REJECTION_SLACK, SORT_COLUMN_MINIMUM_REBUILD_THRESHOLD, SORT_COLUMN_REBUILD_FRACTION_SHIFT } from './chunk-4UMZ7KQL.mjs';
|
|
10
|
-
import {
|
|
10
|
+
import { fuzzyPrefixOf, boundedLevenshtein, fuzzyTermMatches } from './chunk-GES7U2PM.mjs';
|
|
11
|
+
import { parsedTypeOf, isStringValuedBase, withSortableOption, isWordIndexedBase, isWordIndexedFieldType, isListBase } from './chunk-3A5KI24C.mjs';
|
|
11
12
|
import { isGeopointOrVectorType, PROTOTYPE_POLLUTION_KEYS } from './chunk-L5ORED7V.mjs';
|
|
12
|
-
import { NarsilError, ErrorCodes } from './chunk-
|
|
13
|
+
import { NarsilError, ErrorCodes } from './chunk-KUZKUONM.mjs';
|
|
13
14
|
import { singleFoldTable, appendFoldedCodePoint, sortModeOf, defaultSortMode, SORT_VALUE_MAX_CODE_POINTS, toReducedSortValue, readSortField, compareComparableKeys, toComparableSortValue, isSortMode, SORT_MODES, compareSortValues, compareComparableValues, truncateSortString } from './chunk-R6A773WK.mjs';
|
|
14
15
|
import { compareCodePoints, exceedsCodePoints, codePointCount, holdsUnpairedSurrogate } from './chunk-YTJCGKM4.mjs';
|
|
15
16
|
import { totalmem, freemem } from 'os';
|
|
16
|
-
import { getHeapSpaceStatistics, getHeapStatistics } from 'v8';
|
|
17
17
|
|
|
18
18
|
// src/core/partition/partial-words/platform.ts
|
|
19
19
|
function platformPartialWordSearch() {
|
|
@@ -168,130 +168,6 @@ function requirePatternSearch(fieldPath) {
|
|
|
168
168
|
{ field: fieldPath }
|
|
169
169
|
);
|
|
170
170
|
}
|
|
171
|
-
var MEGABYTE_BYTES = 1048576;
|
|
172
|
-
var IN_MEGABYTES = /^--max-old-space-size=(\d+)$/;
|
|
173
|
-
var AS_PERCENTAGE = /^--max-old-space-size-percentage=(\d+(?:\.\d+)?)$/;
|
|
174
|
-
var SEMI_SPACE_IN_MEGABYTES = /^--max-semi-space-size=(\d+)$/;
|
|
175
|
-
var YOUNG_GENERATION_SPACES = /* @__PURE__ */ new Set(["new_space", "new_large_object_space"]);
|
|
176
|
-
var V8_YOUNG_GENERATION_BYTES_PER_SEMI_SPACE_BYTE = 3;
|
|
177
|
-
function flagEntries() {
|
|
178
|
-
const fromNodeOptions = (process.env.NODE_OPTIONS ?? "").split(/\s+/).filter((entry) => entry.length > 0);
|
|
179
|
-
return [...fromNodeOptions, ...process.execArgv];
|
|
180
|
-
}
|
|
181
|
-
function memoryTheHostAllows() {
|
|
182
|
-
const constrained = process.constrainedMemory?.() ?? 0;
|
|
183
|
-
return constrained > 0 ? constrained : totalmem();
|
|
184
|
-
}
|
|
185
|
-
function readConfiguredOldSpaceMegabytes() {
|
|
186
|
-
let megabytes = null;
|
|
187
|
-
for (const entry of flagEntries()) {
|
|
188
|
-
const inMegabytes = IN_MEGABYTES.exec(entry);
|
|
189
|
-
if (inMegabytes !== null) megabytes = Number(inMegabytes[1]);
|
|
190
|
-
if (AS_PERCENTAGE.test(entry)) megabytes = null;
|
|
191
|
-
}
|
|
192
|
-
return megabytes !== null && Number.isFinite(megabytes) && megabytes > 0 ? megabytes : null;
|
|
193
|
-
}
|
|
194
|
-
function readConfiguredLimit() {
|
|
195
|
-
let megabytes = null;
|
|
196
|
-
let percentage = null;
|
|
197
|
-
for (const entry of flagEntries()) {
|
|
198
|
-
const inMegabytes = IN_MEGABYTES.exec(entry);
|
|
199
|
-
if (inMegabytes !== null) {
|
|
200
|
-
megabytes = Number(inMegabytes[1]);
|
|
201
|
-
percentage = null;
|
|
202
|
-
}
|
|
203
|
-
const asPercentage = AS_PERCENTAGE.exec(entry);
|
|
204
|
-
if (asPercentage !== null) {
|
|
205
|
-
percentage = Number(asPercentage[1]);
|
|
206
|
-
megabytes = null;
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
const bytes = megabytes !== null && megabytes > 0 ? megabytes * MEGABYTE_BYTES : percentage !== null && percentage > 0 && percentage <= 100 ? Math.floor(memoryTheHostAllows() * percentage / 100) : null;
|
|
210
|
-
return bytes !== null && Number.isFinite(bytes) && bytes > 0 ? bytes : null;
|
|
211
|
-
}
|
|
212
|
-
var configuredLimit;
|
|
213
|
-
function configuredLimitBytes() {
|
|
214
|
-
if (configuredLimit === void 0) configuredLimit = readConfiguredLimit();
|
|
215
|
-
return configuredLimit;
|
|
216
|
-
}
|
|
217
|
-
function readConfiguredYoungGeneration() {
|
|
218
|
-
let megabytes = 0;
|
|
219
|
-
for (const entry of flagEntries()) {
|
|
220
|
-
const semiSpace = SEMI_SPACE_IN_MEGABYTES.exec(entry);
|
|
221
|
-
if (semiSpace !== null) megabytes = Number(semiSpace[1]);
|
|
222
|
-
}
|
|
223
|
-
if (!Number.isFinite(megabytes) || megabytes <= 0) return null;
|
|
224
|
-
const semiSpaceBytes = 2 ** Math.ceil(Math.log2(megabytes)) * MEGABYTE_BYTES;
|
|
225
|
-
return semiSpaceBytes * V8_YOUNG_GENERATION_BYTES_PER_SEMI_SPACE_BYTE;
|
|
226
|
-
}
|
|
227
|
-
var configuredYoungGeneration;
|
|
228
|
-
function configuredYoungGenerationBytes() {
|
|
229
|
-
if (configuredYoungGeneration === void 0) configuredYoungGeneration = readConfiguredYoungGeneration();
|
|
230
|
-
return configuredYoungGeneration;
|
|
231
|
-
}
|
|
232
|
-
var heapSizeLimit;
|
|
233
|
-
function heapSizeLimitBytes() {
|
|
234
|
-
if (heapSizeLimit === void 0) heapSizeLimit = getHeapStatistics().heap_size_limit;
|
|
235
|
-
return heapSizeLimit;
|
|
236
|
-
}
|
|
237
|
-
function readYoungGenerationCeiling() {
|
|
238
|
-
const fromSemiSpace = configuredYoungGenerationBytes();
|
|
239
|
-
if (fromSemiSpace !== null) return fromSemiSpace;
|
|
240
|
-
const oldSpaceMegabytes = readConfiguredOldSpaceMegabytes();
|
|
241
|
-
if (oldSpaceMegabytes !== null) {
|
|
242
|
-
const beyondOldSpace = heapSizeLimitBytes() - oldSpaceMegabytes * MEGABYTE_BYTES;
|
|
243
|
-
if (beyondOldSpace > 0) return beyondOldSpace;
|
|
244
|
-
}
|
|
245
|
-
return youngGenerationBytesOfThisV8();
|
|
246
|
-
}
|
|
247
|
-
var youngGenerationCeiling;
|
|
248
|
-
function youngGenerationCeilingBytes() {
|
|
249
|
-
if (youngGenerationCeiling === void 0) youngGenerationCeiling = readYoungGenerationCeiling();
|
|
250
|
-
return youngGenerationCeiling;
|
|
251
|
-
}
|
|
252
|
-
function readOldGenerationStatistics() {
|
|
253
|
-
try {
|
|
254
|
-
let usedBytes = 0;
|
|
255
|
-
let committedBytes = 0;
|
|
256
|
-
let youngCapacityBytes = 0;
|
|
257
|
-
let youngUsedBytes = 0;
|
|
258
|
-
for (const space of getHeapSpaceStatistics()) {
|
|
259
|
-
if (YOUNG_GENERATION_SPACES.has(space.space_name)) {
|
|
260
|
-
youngCapacityBytes += space.space_size;
|
|
261
|
-
youngUsedBytes += space.space_used_size;
|
|
262
|
-
} else {
|
|
263
|
-
usedBytes += space.space_used_size;
|
|
264
|
-
committedBytes += space.space_size;
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
const youngCeilingBytes = youngGenerationCeilingBytes();
|
|
268
|
-
const limitBytes2 = configuredLimitBytes() ?? heapSizeLimitBytes() - youngCeilingBytes;
|
|
269
|
-
if (!Number.isFinite(usedBytes) || !Number.isFinite(limitBytes2) || limitBytes2 <= 0) return null;
|
|
270
|
-
return {
|
|
271
|
-
usedBytes,
|
|
272
|
-
limitBytes: limitBytes2,
|
|
273
|
-
youngUsedBytes: Number.isFinite(youngUsedBytes) ? youngUsedBytes : 0,
|
|
274
|
-
committedBytes: Number.isFinite(committedBytes) ? committedBytes : usedBytes,
|
|
275
|
-
youngReserveBytes: Number.isFinite(youngCapacityBytes) ? Math.max(0, youngCeilingBytes - youngCapacityBytes) : 0,
|
|
276
|
-
youngCeilingBytes
|
|
277
|
-
};
|
|
278
|
-
} catch {
|
|
279
|
-
return null;
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
function readHeapStatistics() {
|
|
283
|
-
try {
|
|
284
|
-
const stats = getHeapStatistics();
|
|
285
|
-
const usedBytes = stats.used_heap_size;
|
|
286
|
-
const limitBytes2 = stats.heap_size_limit;
|
|
287
|
-
if (!Number.isFinite(usedBytes) || !Number.isFinite(limitBytes2) || limitBytes2 <= 0) return null;
|
|
288
|
-
const available = stats.total_available_size;
|
|
289
|
-
const availableBytes = Number.isFinite(available) && available >= 0 ? available : null;
|
|
290
|
-
return { usedBytes, limitBytes: limitBytes2, availableBytes, configuredLimitBytes: configuredLimitBytes() };
|
|
291
|
-
} catch {
|
|
292
|
-
return null;
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
171
|
|
|
296
172
|
// src/core/constants.ts
|
|
297
173
|
var POSTING_LIST_COMPACTION_THRESHOLD = 0.3;
|
|
@@ -4973,7 +4849,7 @@ function requireLoadedPhraseCode() {
|
|
|
4973
4849
|
}
|
|
4974
4850
|
function loadPhraseCode() {
|
|
4975
4851
|
if (loading === null) {
|
|
4976
|
-
loading = import('./phrase-module-
|
|
4852
|
+
loading = import('./phrase-module-O3MDRQXP.mjs').then(
|
|
4977
4853
|
(code) => {
|
|
4978
4854
|
loaded = code;
|
|
4979
4855
|
return code;
|
|
@@ -9177,4 +9053,4 @@ function fanOutMatchCount(manager, params, language, schema, options) {
|
|
|
9177
9053
|
return count;
|
|
9178
9054
|
}
|
|
9179
9055
|
|
|
9180
|
-
export { ARRAY_POSITION_GAP, DEFAULT_BM25_B, DEFAULT_BM25_K1, FIELD_FILTER_OPERATORS, FILTER_EXPRESSION_KEYS, MAX_BM25_B, MAX_BM25_K1, MAX_TERM_FREQUENCY, PATTERN_HOST, ValueAffixes, analyseQueryPhrases, applyPagination, applyPartitionFiltersBitset, applyProjection, applySorting, availablePatternSearch, bm25SetsValue, buildPartialWordTableFrom, clampRowCount, cloneProjected, collectQueryTermStats, copyVectorsInto, countPartialSpelling, countsWithoutScores, createBooleanIndex, createCompositePartition, createEnumIndex, createFrozenPartialWords, createGeoIndex, createNumericIndex, createPartitionIndex, createPatternWorkMeter, createSurfaceRegistry, decodePageCursor, documentValueBytes, documentWithOwnBuffers, encodeFieldIndexes, encodePageCursor, encodePartialSpellingsOf, encodeSegmentState, everyValueFacetConfig, fanOutMatchCount, fanOutQuery, filterTestCount, fulltextMatches, holdsQuotedText, isCompositePartition, joinPatternWorkMeter, kWayMerge, loadPhraseCodeFor, mergeBM25Levels, mergeDocFrequencies, mergeFacets, mergePartitionStats, normalizeSort, oversampledFacetConfig, oversampledShardSize, partialSpellingsOfDocuments, partialWordHighlighter, partialWordsToHighlight, partitionStateOf, partitionsIn, patternIndexOf, projectIncludedPaths, projectionKeepsField, pruneStatsToQueryTerms,
|
|
9056
|
+
export { ARRAY_POSITION_GAP, DEFAULT_BM25_B, DEFAULT_BM25_K1, FIELD_FILTER_OPERATORS, FILTER_EXPRESSION_KEYS, MAX_BM25_B, MAX_BM25_K1, MAX_TERM_FREQUENCY, PATTERN_HOST, ValueAffixes, analyseQueryPhrases, applyPagination, applyPartitionFiltersBitset, applyProjection, applySorting, availablePatternSearch, bm25SetsValue, buildPartialWordTableFrom, clampRowCount, cloneProjected, collectQueryTermStats, copyVectorsInto, countPartialSpelling, countsWithoutScores, createBooleanIndex, createCompositePartition, createEnumIndex, createFrozenPartialWords, createGeoIndex, createNumericIndex, createPartitionIndex, createPatternWorkMeter, createSurfaceRegistry, decodePageCursor, documentValueBytes, documentWithOwnBuffers, encodeFieldIndexes, encodePageCursor, encodePartialSpellingsOf, encodeSegmentState, everyValueFacetConfig, fanOutMatchCount, fanOutQuery, filterTestCount, fulltextMatches, holdsQuotedText, isCompositePartition, joinPatternWorkMeter, kWayMerge, loadPhraseCodeFor, mergeBM25Levels, mergeDocFrequencies, mergeFacets, mergePartitionStats, normalizeSort, oversampledFacetConfig, oversampledShardSize, partialSpellingsOfDocuments, partialWordHighlighter, partialWordsToHighlight, partitionStateOf, partitionsIn, patternIndexOf, projectIncludedPaths, projectionKeepsField, pruneStatsToQueryTerms, readProjectedPath, readResidentMemory, readSortValues, recordValueSize, registerPartialWordSearch, registerPatternSearch, requireLoadedPhraseCode, requireMatchingCursor, requirePartialWordSearchFor, requirePatternSearch, requirePatternSearchFor, requireSortableFields, requireWithinResultWindow, resolveProjection, sanitizeGlobalStats, scanPostingBlocks, setNestedValue, sortModesOf, sortSignatureEntry, sortSignatureOf, survivorDocumentsOf, undeclaredFieldOnStrictIndex, validatedFilterOf, valueWithOwnBuffers };
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { isValidInteger, isRecord } from './chunk-
|
|
1
|
+
import { isValidInteger, isRecord } from './chunk-7HCZWC7B.mjs';
|
|
2
|
+
import { isSyncEpoch } from './chunk-BUMREPLU.mjs';
|
|
2
3
|
import { MAX_REPLICATION_FACTOR, MAX_PARTITION_COUNT } from './chunk-JDDXV6UF.mjs';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
4
|
+
import { packChecksummedEnvelope } from './chunk-LSM2YTKM.mjs';
|
|
5
|
+
import { openChecksummedEnvelope } from './chunk-HVYICDY3.mjs';
|
|
6
|
+
import { joinChunks } from './chunk-3Y3J4V2R.mjs';
|
|
5
7
|
import { MAX_FILE_BYTES } from './chunk-U476IXKQ.mjs';
|
|
6
|
-
import { NarsilError, ErrorCodes } from './chunk-
|
|
8
|
+
import { NarsilError, ErrorCodes } from './chunk-KUZKUONM.mjs';
|
|
7
9
|
import { decode, encode } from '@msgpack/msgpack';
|
|
8
10
|
|
|
9
11
|
// src/narsil/write-blocks.ts
|
|
@@ -19,6 +21,15 @@ function bindEngineWriteBlock(engine, owner) {
|
|
|
19
21
|
if (lookup !== void 0) writeBlockLookups.set(engine, lookup);
|
|
20
22
|
}
|
|
21
23
|
|
|
24
|
+
// src/server/sync/serving.ts
|
|
25
|
+
var syncServingSources = /* @__PURE__ */ new WeakMap();
|
|
26
|
+
function bindSyncServing(owner, serving) {
|
|
27
|
+
syncServingSources.set(owner, serving);
|
|
28
|
+
}
|
|
29
|
+
function syncServingSourceOf(owner) {
|
|
30
|
+
return syncServingSources.get(owner);
|
|
31
|
+
}
|
|
32
|
+
|
|
22
33
|
// src/narsil/index-reads.ts
|
|
23
34
|
var boundReads = /* @__PURE__ */ new WeakMap();
|
|
24
35
|
function bindIndexReads(engine, reads) {
|
|
@@ -56,6 +67,7 @@ var BACKUP_PUBLISH_RETRY_MS = 1e3;
|
|
|
56
67
|
var MAX_BACKUP_FILES_PER_PARTITION = 1e6;
|
|
57
68
|
var MAX_BACKUP_FILE_PATH_LENGTH = 1024;
|
|
58
69
|
var BACKUP_MANIFEST_READS_AT_ONCE = 8;
|
|
70
|
+
var SYNC_BACKUPS_KEPT = 2;
|
|
59
71
|
var MAX_CLUSTER_UUID_BYTES = 128;
|
|
60
72
|
|
|
61
73
|
// src/distribution/backups/keys.ts
|
|
@@ -130,6 +142,7 @@ function backupKeys(keyPrefix) {
|
|
|
130
142
|
}
|
|
131
143
|
var BACKUP_MANIFEST_ENVELOPE_VERSION = 1;
|
|
132
144
|
var PATH_SEGMENT_PATTERN = /^[A-Za-z0-9][A-Za-z0-9._-]*$/;
|
|
145
|
+
var SYNC_BACKUP_TAKER = "sync";
|
|
133
146
|
function damaged(backupName, reason) {
|
|
134
147
|
return new NarsilError(ErrorCodes.BACKUP_DAMAGED, `The manifest of backup '${backupName}' ${reason}`, {
|
|
135
148
|
backupName
|
|
@@ -178,7 +191,7 @@ function readBackupPartition(value, backupName, partitionCount) {
|
|
|
178
191
|
};
|
|
179
192
|
}
|
|
180
193
|
function validateManifest(raw, backupName) {
|
|
181
|
-
if (!isRecord(raw) || raw.name !== backupName || typeof raw.clusterUuid !== "string" || typeof raw.indexName !== "string" || !isCount(raw.startedAt) || !isCount(raw.completedAt) || !isValidInteger(raw.partitionCount) || raw.partitionCount < 1 || raw.partitionCount > MAX_PARTITION_COUNT || !isCount(raw.replicationFactor) || raw.replicationFactor > MAX_REPLICATION_FACTOR || !Array.isArray(raw.partitions) || raw.partitions.length !== raw.partitionCount) {
|
|
194
|
+
if (!isRecord(raw) || raw.name !== backupName || typeof raw.clusterUuid !== "string" || typeof raw.indexName !== "string" || !isCount(raw.startedAt) || !isCount(raw.completedAt) || !isValidInteger(raw.partitionCount) || raw.partitionCount < 1 || raw.partitionCount > MAX_PARTITION_COUNT || !isCount(raw.replicationFactor) || raw.replicationFactor > MAX_REPLICATION_FACTOR || !Array.isArray(raw.partitions) || raw.partitions.length !== raw.partitionCount || raw.syncEpoch !== void 0 && !isSyncEpoch(raw.syncEpoch) || !(raw.takenBy === void 0 || typeof raw.takenBy === "string")) {
|
|
182
195
|
throw damaged(backupName, "holds a malformed header");
|
|
183
196
|
}
|
|
184
197
|
const constraints = readAllocationConstraints(raw.constraints);
|
|
@@ -195,6 +208,8 @@ function validateManifest(raw, backupName) {
|
|
|
195
208
|
startedAt: raw.startedAt,
|
|
196
209
|
completedAt: raw.completedAt,
|
|
197
210
|
partitionCount,
|
|
211
|
+
...typeof raw.syncEpoch === "string" ? { syncEpoch: raw.syncEpoch } : {},
|
|
212
|
+
...typeof raw.takenBy === "string" ? { takenBy: raw.takenBy } : {},
|
|
198
213
|
replicationFactor: raw.replicationFactor,
|
|
199
214
|
constraints,
|
|
200
215
|
config: readStoredFile(raw.config, backupName),
|
|
@@ -245,4 +260,4 @@ function readRestorePlacement(request) {
|
|
|
245
260
|
return placement;
|
|
246
261
|
}
|
|
247
262
|
|
|
248
|
-
export { BACKUP_DELETES_AT_ONCE, BACKUP_FILES_AT_ONCE, BACKUP_FILE_CHUNK_BYTES, BACKUP_JOBS_KEY, BACKUP_JOB_CAS_ATTEMPTS, BACKUP_JOB_CAS_RETRY_MS, BACKUP_JOB_POLL_INTERVAL_MS, BACKUP_MANIFEST_READS_AT_ONCE, BACKUP_PARTITIONS_AT_ONCE, BACKUP_PARTITION_POLL_INTERVAL_MS, BACKUP_PARTITION_RESULT_RETENTION_MS, BACKUP_PRIMARY_WAIT_MS, BACKUP_PROGRESS_REPORT_INTERVAL_MS, BACKUP_PUBLISH_RETRY_MS, BACKUP_SWEEP_INTERVAL_MS, CLUSTER_UUID_KEY, MAX_CLUSTER_UUID_BYTES, MAX_FINISHED_BACKUP_JOBS, backupKeys, bindEngineWriteBlock, bindIndexReads, bindWriteBlockLookup, decodeBackupManifest, encodeBackupManifest, indexReadsOf, isCount, isSha256Hex, readBackupPartition, readRestorePlacement, readStoredFile, storeWithoutSaveIfAbsent, storedFilesOf, validateBackupConfig, validateBackupName, writeBlockLookupOf };
|
|
263
|
+
export { BACKUP_DELETES_AT_ONCE, BACKUP_FILES_AT_ONCE, BACKUP_FILE_CHUNK_BYTES, BACKUP_JOBS_KEY, BACKUP_JOB_CAS_ATTEMPTS, BACKUP_JOB_CAS_RETRY_MS, BACKUP_JOB_POLL_INTERVAL_MS, BACKUP_MANIFEST_READS_AT_ONCE, BACKUP_PARTITIONS_AT_ONCE, BACKUP_PARTITION_POLL_INTERVAL_MS, BACKUP_PARTITION_RESULT_RETENTION_MS, BACKUP_PRIMARY_WAIT_MS, BACKUP_PROGRESS_REPORT_INTERVAL_MS, BACKUP_PUBLISH_RETRY_MS, BACKUP_SWEEP_INTERVAL_MS, CLUSTER_UUID_KEY, MAX_CLUSTER_UUID_BYTES, MAX_FINISHED_BACKUP_JOBS, SYNC_BACKUPS_KEPT, SYNC_BACKUP_TAKER, backupKeys, bindEngineWriteBlock, bindIndexReads, bindSyncServing, bindWriteBlockLookup, decodeBackupManifest, encodeBackupManifest, indexReadsOf, isCount, isSha256Hex, readBackupPartition, readRestorePlacement, readStoredFile, storeWithoutSaveIfAbsent, storedFilesOf, syncServingSourceOf, validateBackupConfig, validateBackupName, writeBlockLookupOf };
|