@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,83 @@
|
|
|
1
|
+
import { ErrorCodes, NarsilError } from './chunk-KUZKUONM.mjs';
|
|
2
|
+
|
|
3
|
+
// src/persistence/durability/segment/store.ts
|
|
4
|
+
function directoryCheckpointStore(directory) {
|
|
5
|
+
const store = {
|
|
6
|
+
read: (key) => directory.read(key),
|
|
7
|
+
write: (key, chunks) => directory.atomicWrite(key, chunks),
|
|
8
|
+
remove: (key) => directory.remove(key),
|
|
9
|
+
list: (prefix) => directory.list(prefix),
|
|
10
|
+
pathOf: (key) => directory.pathOf(key),
|
|
11
|
+
directory
|
|
12
|
+
};
|
|
13
|
+
const byteLength = directory.byteLength;
|
|
14
|
+
if (byteLength !== void 0) store.byteLength = (key) => byteLength.call(directory, key);
|
|
15
|
+
return store;
|
|
16
|
+
}
|
|
17
|
+
function joined(chunks) {
|
|
18
|
+
if (chunks.length === 1) return chunks[0];
|
|
19
|
+
let total = 0;
|
|
20
|
+
for (const chunk of chunks) total += chunk.byteLength;
|
|
21
|
+
const bytes = new Uint8Array(total);
|
|
22
|
+
let offset = 0;
|
|
23
|
+
for (const chunk of chunks) {
|
|
24
|
+
bytes.set(chunk, offset);
|
|
25
|
+
offset += chunk.byteLength;
|
|
26
|
+
}
|
|
27
|
+
return bytes;
|
|
28
|
+
}
|
|
29
|
+
function adapterFailure(code, verb, key, error) {
|
|
30
|
+
if (error instanceof NarsilError) return error;
|
|
31
|
+
const cause = error instanceof Error ? error.message : String(error);
|
|
32
|
+
return new NarsilError(code, `The persistence adapter failed to ${verb} "${key}": ${cause}`, { key, cause });
|
|
33
|
+
}
|
|
34
|
+
async function guarded(run, code, verb, key) {
|
|
35
|
+
try {
|
|
36
|
+
return await run();
|
|
37
|
+
} catch (error) {
|
|
38
|
+
throw adapterFailure(code, verb, key, error);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
function adapterCheckpointStore(adapter) {
|
|
42
|
+
return {
|
|
43
|
+
read: (key) => guarded(() => adapter.load(key), ErrorCodes.PERSISTENCE_LOAD_FAILED, "load", key),
|
|
44
|
+
write: (key, chunks) => guarded(() => adapter.save(key, joined(chunks)), ErrorCodes.PERSISTENCE_SAVE_FAILED, "save", key),
|
|
45
|
+
remove: (key) => guarded(() => adapter.delete(key), ErrorCodes.PERSISTENCE_DELETE_FAILED, "delete", key),
|
|
46
|
+
list: (prefix) => guarded(() => adapter.list(prefix), ErrorCodes.PERSISTENCE_LOAD_FAILED, "list", prefix)
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
async function requireListedSize(store, key, expected) {
|
|
50
|
+
const length = store.byteLength === void 0 ? void 0 : await store.byteLength(key);
|
|
51
|
+
if (length === null) missingFile(expected.what, key);
|
|
52
|
+
if (length !== void 0) requireListedLength(expected.what, key, length, expected.bytes);
|
|
53
|
+
}
|
|
54
|
+
async function readListedFile(store, key, expected) {
|
|
55
|
+
await requireListedSize(store, key, expected);
|
|
56
|
+
const bytes = await store.read(key);
|
|
57
|
+
if (bytes === null) missingFile(expected.what, key);
|
|
58
|
+
requireListedLength(expected.what, key, bytes.byteLength, expected.bytes);
|
|
59
|
+
return bytes;
|
|
60
|
+
}
|
|
61
|
+
function missingFile(what, key) {
|
|
62
|
+
throw new NarsilError(ErrorCodes.PERSISTENCE_LOAD_FAILED, `The ${what} "${key}" that the manifest lists is missing`, {
|
|
63
|
+
key
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
function requireListedLength(what, key, found, listed) {
|
|
67
|
+
if (found === listed) return;
|
|
68
|
+
throw new NarsilError(
|
|
69
|
+
ErrorCodes.PERSISTENCE_LOAD_FAILED,
|
|
70
|
+
`The ${what} "${key}" holds ${found} bytes where the manifest lists ${listed}`,
|
|
71
|
+
{ key, bytes: found, listed }
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
function requireListedChecksum(what, key, found, listed) {
|
|
75
|
+
if (found === listed) return;
|
|
76
|
+
throw new NarsilError(
|
|
77
|
+
ErrorCodes.PERSISTENCE_LOAD_FAILED,
|
|
78
|
+
`The ${what} "${key}" carries checksum ${found} where the manifest lists ${listed}`,
|
|
79
|
+
{ key, checksum: found, listed }
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export { adapterCheckpointStore, directoryCheckpointStore, readListedFile, requireListedChecksum, requireListedSize };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { SEGMENT_MANIFEST_VERSION, MANIFEST_ENVELOPE_VERSION } from './chunk-Q3TCTQCC.mjs';
|
|
2
|
+
import { packChecksummedEnvelope } from './chunk-LSM2YTKM.mjs';
|
|
3
|
+
import { encode } from '@msgpack/msgpack';
|
|
4
|
+
|
|
5
|
+
function fileRefOnTheWire(ref) {
|
|
6
|
+
return {
|
|
7
|
+
key: ref.key,
|
|
8
|
+
bytes: ref.bytes,
|
|
9
|
+
checksum: ref.checksum,
|
|
10
|
+
...ref.headOffset === void 0 ? {} : { headOffset: ref.headOffset, headLength: ref.headLength, headChecksum: ref.headChecksum }
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
function encodeSegmentManifest(manifest) {
|
|
14
|
+
const payload = encode({
|
|
15
|
+
version: SEGMENT_MANIFEST_VERSION,
|
|
16
|
+
schema: manifest.schema,
|
|
17
|
+
language: manifest.language,
|
|
18
|
+
...manifest.analysisGeneration ? { analysisGeneration: manifest.analysisGeneration } : {},
|
|
19
|
+
checkpoint: manifest.checkpoint.map((c) => ({
|
|
20
|
+
partitionId: c.partitionId,
|
|
21
|
+
lastSeqNo: c.lastSeqNo,
|
|
22
|
+
primaryTerm: c.primaryTerm,
|
|
23
|
+
...c.termHistory === void 0 ? {} : {
|
|
24
|
+
termHistory: c.termHistory.map((start) => ({ primaryTerm: start.primaryTerm, firstSeqNo: start.firstSeqNo }))
|
|
25
|
+
}
|
|
26
|
+
})),
|
|
27
|
+
partitions: manifest.partitions.map((p) => ({
|
|
28
|
+
partitionId: p.partitionId,
|
|
29
|
+
nextSegmentId: p.nextSegmentId,
|
|
30
|
+
segments: p.segments.map((s) => ({
|
|
31
|
+
id: s.id,
|
|
32
|
+
key: s.key,
|
|
33
|
+
docCount: s.docCount,
|
|
34
|
+
tombstoneCount: s.tombstoneCount,
|
|
35
|
+
bytes: s.bytes,
|
|
36
|
+
checksum: s.checksum
|
|
37
|
+
}))
|
|
38
|
+
})),
|
|
39
|
+
vectors: manifest.vectors.map((v) => ({
|
|
40
|
+
fieldPath: v.fieldPath,
|
|
41
|
+
nextFileId: v.nextFileId,
|
|
42
|
+
files: v.files.map((f) => ({ id: f.id, ...fileRefOnTheWire(f), count: f.count, dead: f.dead })),
|
|
43
|
+
graphGeneration: v.graphGeneration,
|
|
44
|
+
graphParts: v.graphParts.map(fileRefOnTheWire)
|
|
45
|
+
}))
|
|
46
|
+
});
|
|
47
|
+
return packChecksummedEnvelope([payload], MANIFEST_ENVELOPE_VERSION, "segment manifest");
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export { encodeSegmentManifest };
|
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
import { normalizeSort, requireMatchingCursor, encodePageCursor, decodePageCursor, projectionKeepsField, resolveProjection, clampRowCount, bm25SetsValue, sortSignatureOf, requireSortableFields, analyseQueryPhrases, requireLoadedPhraseCode, fanOutQuery, loadPhraseCodeFor, requireWithinResultWindow, sortModesOf, applySorting, applyPagination, countsWithoutScores, fanOutMatchCount, validatedFilterOf, createPatternWorkMeter, partialWordsToHighlight, partialWordHighlighter, pruneStatsToQueryTerms, mergeBM25Levels, everyValueFacetConfig, fulltextMatches, mergeFacets, applyPartitionFiltersBitset, readOldGenerationStatistics, readResidentMemory, partitionsIn, undeclaredFieldOnStrictIndex, MAX_BM25_K1, MAX_BM25_B } from './chunk-3HV7M5OJ.mjs';
|
|
2
|
-
import { FNV_OFFSET_BASIS, fnv1aContinue, fnv1aContinueTaggedNumbers } from './chunk-KAKQ74LS.mjs';
|
|
3
1
|
import { admittedHeapBytes } from './chunk-XIHUI4KB.mjs';
|
|
4
|
-
import { engineThreadYoungGenerationBytes } from './chunk-Q2UL2TPC.mjs';
|
|
5
2
|
import { MAX_INDEX_NAME_LENGTH, INDEX_NAME_PATTERN, MAX_DOC_ID_LENGTH, DEFAULT_LIMIT, DEFAULT_SUGGEST_LIMIT, MAX_SUGGEST_LIMIT, MAX_SUGGEST_SCATTER_LIMIT, ABSOLUTE_WINDOWS_PATH_PATTERN, MODULE_URL_SCHEME_PATTERN, DEFAULT_OFFSET } from './chunk-EEBCDP36.mjs';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
3
|
+
import { normalizeSort, requireMatchingCursor, encodePageCursor, decodePageCursor, projectionKeepsField, resolveProjection, clampRowCount, bm25SetsValue, sortSignatureOf, requireSortableFields, analyseQueryPhrases, requireLoadedPhraseCode, fanOutQuery, loadPhraseCodeFor, requireWithinResultWindow, sortModesOf, applySorting, applyPagination, countsWithoutScores, fanOutMatchCount, validatedFilterOf, createPatternWorkMeter, partialWordsToHighlight, partialWordHighlighter, pruneStatsToQueryTerms, mergeBM25Levels, everyValueFacetConfig, fulltextMatches, mergeFacets, applyPartitionFiltersBitset, readResidentMemory, partitionsIn, undeclaredFieldOnStrictIndex, MAX_BM25_K1, MAX_BM25_B } from './chunk-HWEDFLB7.mjs';
|
|
4
|
+
import { readOldGenerationStatistics } from './chunk-IPN7S4KX.mjs';
|
|
5
|
+
import { FNV_OFFSET_BASIS, fnv1aContinue, fnv1aContinueTaggedNumbers } from './chunk-KAKQ74LS.mjs';
|
|
6
|
+
import { engineThreadYoungGenerationBytes } from './chunk-Q2UL2TPC.mjs';
|
|
7
|
+
import { MIN_OVERSAMPLE } from './chunk-HVKXNBFL.mjs';
|
|
8
8
|
import { MAX_RENUMBERED_SEARCH_ATTEMPTS } from './chunk-BTPGQC6Z.mjs';
|
|
9
|
-
import {
|
|
9
|
+
import { turnIsSpent, yieldTurn } from './chunk-LQG5G2LY.mjs';
|
|
10
|
+
import { flattenSchema, partialFieldsOf } from './chunk-Z3TNWCI5.mjs';
|
|
10
11
|
import { DEFAULT_MAX_PER_GROUP, DEFAULT_FUZZY_PREFIX_LENGTH, BM25_DISPLAYED_NAME_LENGTH, DEFAULT_LINEAR_ALPHA, MIN_LINEAR_ALPHA, MAX_LINEAR_ALPHA, DEFAULT_RANK_CONSTANT, MIN_RANK_CONSTANT, RESULT_WINDOW, MAX_TOLERANCE, MAX_PREFIX_LENGTH } from './chunk-FQBFZAWG.mjs';
|
|
11
|
-
import { tokenize } from './chunk-
|
|
12
|
-
import {
|
|
12
|
+
import { tokenize } from './chunk-ZIFJXCKA.mjs';
|
|
13
|
+
import { fuzzyTermMatches } from './chunk-GES7U2PM.mjs';
|
|
14
|
+
import { isStringValuedBase, parsedTypeOf, isWordIndexedFieldType } from './chunk-3A5KI24C.mjs';
|
|
13
15
|
import { MIN_PATTERN_VALUE_LIMIT, MAX_PATTERN_VALUE_LIMIT, isPlainObject, isGeopointOrVectorType, VECTOR_PATTERN } from './chunk-L5ORED7V.mjs';
|
|
14
|
-
import { NarsilError, ErrorCodes } from './chunk-
|
|
16
|
+
import { NarsilError, ErrorCodes } from './chunk-KUZKUONM.mjs';
|
|
15
17
|
import { compareComparableKeys } from './chunk-R6A773WK.mjs';
|
|
16
18
|
import { compareCodePoints, holdsUnpairedSurrogate } from './chunk-YTJCGKM4.mjs';
|
|
17
19
|
|
|
@@ -1657,7 +1659,7 @@ function requireCursorDepth(cursor, signature, binding) {
|
|
|
1657
1659
|
}
|
|
1658
1660
|
function hybridSearchOf(params, context, limit, offset, cursorDepth) {
|
|
1659
1661
|
if ((params.hybrid?.depth ?? null) === null) return executeHybridSearch(params, context, limit, offset, cursorDepth);
|
|
1660
|
-
return import('./runtime-
|
|
1662
|
+
return import('./runtime-UZOC3NPY.mjs').then(
|
|
1661
1663
|
(runtime) => runtime.searchFixedDepthHybrid(params, context, { cursorDepth: cursorDepth ?? 0, offset, limit }, runtimeHost)
|
|
1662
1664
|
);
|
|
1663
1665
|
}
|
|
@@ -1667,7 +1669,7 @@ function executeQuery(request, callerContext) {
|
|
|
1667
1669
|
if (loadingPhraseCode === null) return runQuery(request, callerContext);
|
|
1668
1670
|
return loadingPhraseCode.then(() => runQuery(request, callerContext));
|
|
1669
1671
|
}
|
|
1670
|
-
return import('./runtime-
|
|
1672
|
+
return import('./runtime-UZOC3NPY.mjs').then(
|
|
1671
1673
|
(runtime) => runtime.executeRerankedQuery(request, callerContext, executeQuery, runtimeHost)
|
|
1672
1674
|
);
|
|
1673
1675
|
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { openChecksummedEnvelope } from './chunk-HVYICDY3.mjs';
|
|
2
|
+
import { NarsilError, ErrorCodes } from './chunk-KUZKUONM.mjs';
|
|
3
|
+
import { decode } from '@msgpack/msgpack';
|
|
4
|
+
|
|
5
|
+
var INDEX_CONFIGURATION_ENVELOPE_VERSION = 5;
|
|
6
|
+
function requireConfigurationShape(raw, what) {
|
|
7
|
+
if (raw === null || typeof raw !== "object" || Array.isArray(raw)) {
|
|
8
|
+
throw new NarsilError(ErrorCodes.CONFIG_INVALID, `The ${what} does not hold an index configuration`);
|
|
9
|
+
}
|
|
10
|
+
const configuration = raw;
|
|
11
|
+
if (configuration.schema === null || typeof configuration.schema !== "object") {
|
|
12
|
+
throw new NarsilError(ErrorCodes.CONFIG_INVALID, `The ${what} holds no schema`);
|
|
13
|
+
}
|
|
14
|
+
if (typeof configuration.language !== "string" || configuration.language.length === 0) {
|
|
15
|
+
throw new NarsilError(ErrorCodes.CONFIG_INVALID, `The ${what} holds no language`);
|
|
16
|
+
}
|
|
17
|
+
return configuration;
|
|
18
|
+
}
|
|
19
|
+
async function decodeIndexConfiguration(bytes) {
|
|
20
|
+
const { payload } = await openChecksummedEnvelope(bytes, {
|
|
21
|
+
envelopeFormatVersion: INDEX_CONFIGURATION_ENVELOPE_VERSION,
|
|
22
|
+
what: "index configuration",
|
|
23
|
+
allowsCompression: true
|
|
24
|
+
});
|
|
25
|
+
let raw;
|
|
26
|
+
try {
|
|
27
|
+
raw = decode(payload);
|
|
28
|
+
} catch {
|
|
29
|
+
throw new NarsilError(ErrorCodes.PERSISTENCE_LOAD_FAILED, "The index configuration is not MessagePack");
|
|
30
|
+
}
|
|
31
|
+
return requireConfigurationShape(raw, "index configuration");
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export { INDEX_CONFIGURATION_ENVELOPE_VERSION, decodeIndexConfiguration, requireConfigurationShape };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// src/engine/sync/serial.ts
|
|
2
|
+
var chainsByRegistry = /* @__PURE__ */ new WeakMap();
|
|
3
|
+
async function oneSyncChangeAtATime(registry, indexName, action) {
|
|
4
|
+
let chains = chainsByRegistry.get(registry);
|
|
5
|
+
if (chains === void 0) {
|
|
6
|
+
chains = /* @__PURE__ */ new Map();
|
|
7
|
+
chainsByRegistry.set(registry, chains);
|
|
8
|
+
}
|
|
9
|
+
const running = chains;
|
|
10
|
+
const current = (running.get(indexName) ?? Promise.resolve()).catch(() => void 0).then(action);
|
|
11
|
+
running.set(indexName, current);
|
|
12
|
+
try {
|
|
13
|
+
return await current;
|
|
14
|
+
} finally {
|
|
15
|
+
if (running.get(indexName) === current) running.delete(indexName);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export { oneSyncChangeAtATime };
|
|
@@ -1,164 +1,12 @@
|
|
|
1
|
+
import { flattenSchema, encodeDocument } from './chunk-Z3TNWCI5.mjs';
|
|
1
2
|
import { PARTIAL_WORD_MIN_CODE_POINTS, PARTIAL_WORDS_ADDED_PER_QUERY, DEFAULT_FUZZY_PREFIX_LENGTH } from './chunk-FQBFZAWG.mjs';
|
|
2
|
-
import { encodeStringBlob, tokenize, resolveStopWords, transformToken, visitTokens, visitSurfaceSpellings } from './chunk-
|
|
3
|
+
import { encodeStringBlob, tokenize, resolveStopWords, transformToken, visitTokens, visitSurfaceSpellings } from './chunk-ZIFJXCKA.mjs';
|
|
3
4
|
import { EARLIER_RELEASE_MIN_M, MIN_M, MAX_M } from './chunk-ZXX5GZEX.mjs';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { NarsilError, ErrorCodes } from './chunk-
|
|
5
|
+
import { fuzzyTermMatches } from './chunk-GES7U2PM.mjs';
|
|
6
|
+
import { isWordIndexedBase, parseFieldType } from './chunk-3A5KI24C.mjs';
|
|
7
|
+
import { DEFAULT_PATTERN_VALUE_LIMIT, isPlainObject, MAX_DOCUMENT_BYTES, MAX_DOCUMENT_NESTING_DEPTH, VECTOR_PATTERN } from './chunk-L5ORED7V.mjs';
|
|
8
|
+
import { NarsilError, ErrorCodes } from './chunk-KUZKUONM.mjs';
|
|
8
9
|
import { compareCodePoints, codePointCount, holdsUnpairedSurrogate, exceedsCodePoints } from './chunk-YTJCGKM4.mjs';
|
|
9
|
-
import { Encoder, encode } from '@msgpack/msgpack';
|
|
10
|
-
|
|
11
|
-
// src/schema/validator/schema.ts
|
|
12
|
-
function validateSchemaFields(schema, depth, prefix) {
|
|
13
|
-
if (depth > MAX_NESTING_DEPTH) {
|
|
14
|
-
throw new NarsilError(
|
|
15
|
-
ErrorCodes.SCHEMA_DEPTH_EXCEEDED,
|
|
16
|
-
`Schema nesting exceeds the maximum depth of ${MAX_NESTING_DEPTH} at "${prefix}"`,
|
|
17
|
-
{ path: prefix, maxDepth: MAX_NESTING_DEPTH }
|
|
18
|
-
);
|
|
19
|
-
}
|
|
20
|
-
let canonical = null;
|
|
21
|
-
const replace = (field, value) => {
|
|
22
|
-
if (canonical === null) canonical = { ...schema };
|
|
23
|
-
canonical[field] = value;
|
|
24
|
-
};
|
|
25
|
-
for (const [field, type] of Object.entries(schema)) {
|
|
26
|
-
const path = prefix ? `${prefix}.${field}` : field;
|
|
27
|
-
if (PROTOTYPE_POLLUTION_KEYS.has(field)) {
|
|
28
|
-
throw new NarsilError(ErrorCodes.SCHEMA_INVALID_TYPE, `Field name "${field}" is not allowed in a schema`, {
|
|
29
|
-
field,
|
|
30
|
-
path
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
if (!FIELD_NAME_PATTERN.test(field)) {
|
|
34
|
-
throw new NarsilError(
|
|
35
|
-
ErrorCodes.SCHEMA_INVALID_TYPE,
|
|
36
|
-
`Field name "${field}" contains characters that are not allowed; use letters, digits, and underscores only`,
|
|
37
|
-
{ field, path }
|
|
38
|
-
);
|
|
39
|
-
}
|
|
40
|
-
if (depth === 1 && RESERVED_ROOT_FIELDS.has(field)) {
|
|
41
|
-
throw new NarsilError(
|
|
42
|
-
ErrorCodes.SCHEMA_INVALID_TYPE,
|
|
43
|
-
`Field "${field}" is reserved and cannot be defined in a schema`,
|
|
44
|
-
{ field, path }
|
|
45
|
-
);
|
|
46
|
-
}
|
|
47
|
-
if (isPlainObject(type)) {
|
|
48
|
-
const nested = validateSchemaFields(type, depth + 1, path);
|
|
49
|
-
if (nested !== type) replace(field, nested);
|
|
50
|
-
continue;
|
|
51
|
-
}
|
|
52
|
-
if (typeof type !== "string") {
|
|
53
|
-
throw new NarsilError(
|
|
54
|
-
ErrorCodes.SCHEMA_INVALID_TYPE,
|
|
55
|
-
`Field "${path}" has an invalid type definition: ${String(type)}`,
|
|
56
|
-
{
|
|
57
|
-
field: path,
|
|
58
|
-
type: String(type)
|
|
59
|
-
}
|
|
60
|
-
);
|
|
61
|
-
}
|
|
62
|
-
const parsed = parseFieldType(type, path);
|
|
63
|
-
if (parsed.type !== type) replace(field, parsed.type);
|
|
64
|
-
}
|
|
65
|
-
return canonical ?? schema;
|
|
66
|
-
}
|
|
67
|
-
function validateSchema(schema) {
|
|
68
|
-
if (!isPlainObject(schema)) {
|
|
69
|
-
throw new NarsilError(ErrorCodes.SCHEMA_INVALID_TYPE, "Schema must be a plain object", {
|
|
70
|
-
received: typeof schema
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
if (Object.keys(schema).length === 0) {
|
|
74
|
-
throw new NarsilError(ErrorCodes.SCHEMA_INVALID_TYPE, "Schema must define at least one field");
|
|
75
|
-
}
|
|
76
|
-
const validated = validateSchemaFields(schema, 1, "");
|
|
77
|
-
requireTextFieldCount(schemaFieldsOf(validated).filter((field) => isWordIndexedBase(field.base)).length);
|
|
78
|
-
return validated;
|
|
79
|
-
}
|
|
80
|
-
function requireTextFieldCount(count) {
|
|
81
|
-
if (count <= MAX_TEXT_FIELDS) return;
|
|
82
|
-
throw new NarsilError(
|
|
83
|
-
ErrorCodes.SCHEMA_INVALID_TYPE,
|
|
84
|
-
`The schema declares ${count} string and string[] fields, but a schema holds at most ${MAX_TEXT_FIELDS}`,
|
|
85
|
-
{ textFields: count, maximum: MAX_TEXT_FIELDS }
|
|
86
|
-
);
|
|
87
|
-
}
|
|
88
|
-
function requireCreatableSchema(schema) {
|
|
89
|
-
for (const field of schemaFieldsOf(schema)) {
|
|
90
|
-
if (field.base !== "vector" || field.dimension <= MAX_VECTOR_DIMENSION) continue;
|
|
91
|
-
throw new NarsilError(
|
|
92
|
-
ErrorCodes.SCHEMA_INVALID_VECTOR_DIMENSION,
|
|
93
|
-
`Vector field "${field.path}" has ${field.dimension} dimensions, but a new index takes at most ${MAX_VECTOR_DIMENSION}`,
|
|
94
|
-
{ field: field.path, dimension: field.dimension, maximum: MAX_VECTOR_DIMENSION }
|
|
95
|
-
);
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
function requireValidFieldTypes(flatSchema) {
|
|
99
|
-
let textFields = 0;
|
|
100
|
-
for (const [path, type] of Object.entries(flatSchema)) {
|
|
101
|
-
if (typeof type !== "string") {
|
|
102
|
-
throw new NarsilError(
|
|
103
|
-
ErrorCodes.SCHEMA_INVALID_TYPE,
|
|
104
|
-
`Field "${path}" has an invalid type definition: ${String(type)}`,
|
|
105
|
-
{ field: path, type: String(type) }
|
|
106
|
-
);
|
|
107
|
-
}
|
|
108
|
-
if (isWordIndexedBase(parseFieldType(type, path).base)) textFields += 1;
|
|
109
|
-
}
|
|
110
|
-
requireTextFieldCount(textFields);
|
|
111
|
-
}
|
|
112
|
-
function flattenRecursive(schema, prefix, result) {
|
|
113
|
-
for (const [field, type] of Object.entries(schema)) {
|
|
114
|
-
const path = prefix ? `${prefix}.${field}` : field;
|
|
115
|
-
if (isPlainObject(type)) {
|
|
116
|
-
flattenRecursive(type, path, result);
|
|
117
|
-
} else {
|
|
118
|
-
result[path] = type;
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
var flattenedSchemas = /* @__PURE__ */ new WeakMap();
|
|
123
|
-
function flattenSchema(schema) {
|
|
124
|
-
const cached = flattenedSchemas.get(schema);
|
|
125
|
-
if (cached !== void 0) return cached;
|
|
126
|
-
const result = /* @__PURE__ */ Object.create(null);
|
|
127
|
-
flattenRecursive(schema, "", result);
|
|
128
|
-
flattenedSchemas.set(schema, Object.freeze(result));
|
|
129
|
-
return result;
|
|
130
|
-
}
|
|
131
|
-
var parsedSchemas = /* @__PURE__ */ new WeakMap();
|
|
132
|
-
function schemaFieldsOf(schema) {
|
|
133
|
-
const cached = parsedSchemas.get(schema);
|
|
134
|
-
if (cached !== void 0) return cached;
|
|
135
|
-
const fields = [];
|
|
136
|
-
for (const [path, type] of Object.entries(flattenSchema(schema))) {
|
|
137
|
-
fields.push({ ...parseFieldType(type, path), path });
|
|
138
|
-
}
|
|
139
|
-
const frozen = Object.freeze(fields);
|
|
140
|
-
parsedSchemas.set(schema, frozen);
|
|
141
|
-
return frozen;
|
|
142
|
-
}
|
|
143
|
-
var partialFieldsBySchema = /* @__PURE__ */ new WeakMap();
|
|
144
|
-
function partialFieldsOf(schema) {
|
|
145
|
-
const cached = partialFieldsBySchema.get(schema);
|
|
146
|
-
if (cached !== void 0) return cached;
|
|
147
|
-
const paths = [];
|
|
148
|
-
for (const field of schemaFieldsOf(schema)) {
|
|
149
|
-
if (field.partial) paths.push(field.path);
|
|
150
|
-
}
|
|
151
|
-
const frozen = Object.freeze(paths.sort(compareCodePoints));
|
|
152
|
-
partialFieldsBySchema.set(schema, frozen);
|
|
153
|
-
return frozen;
|
|
154
|
-
}
|
|
155
|
-
function extractVectorFieldsFromSchema(schema) {
|
|
156
|
-
const result = /* @__PURE__ */ new Map();
|
|
157
|
-
for (const field of schemaFieldsOf(schema)) {
|
|
158
|
-
if (field.base === "vector") result.set(field.path, field.dimension);
|
|
159
|
-
}
|
|
160
|
-
return result;
|
|
161
|
-
}
|
|
162
10
|
|
|
163
11
|
// src/geo/constants.ts
|
|
164
12
|
var DEG_TO_RAD = Math.PI / 180;
|
|
@@ -545,41 +393,6 @@ function validateRequiredFields(document, required) {
|
|
|
545
393
|
}
|
|
546
394
|
}
|
|
547
395
|
}
|
|
548
|
-
var INTEGER_ENCODING = { maxDepth: MAX_DOCUMENT_ENCODING_DEPTH };
|
|
549
|
-
var FLOAT_ENCODING = { maxDepth: MAX_DOCUMENT_ENCODING_DEPTH, forceIntegerToFloat: true };
|
|
550
|
-
var integerEncoder = new Encoder(INTEGER_ENCODING);
|
|
551
|
-
var floatEncoder = new Encoder(FLOAT_ENCODING);
|
|
552
|
-
function encodeExactly(document, forceIntegerToFloat) {
|
|
553
|
-
const bytes = (forceIntegerToFloat ? floatEncoder : integerEncoder).encode(document);
|
|
554
|
-
if (bytes.byteLength > DOCUMENT_ENCODER_RETAINED_BUFFER_BYTES) {
|
|
555
|
-
if (forceIntegerToFloat) floatEncoder = new Encoder(FLOAT_ENCODING);
|
|
556
|
-
else integerEncoder = new Encoder(INTEGER_ENCODING);
|
|
557
|
-
}
|
|
558
|
-
return bytes;
|
|
559
|
-
}
|
|
560
|
-
function holdsNegativeZero(value, depth) {
|
|
561
|
-
if (typeof value === "number") return Object.is(value, -0);
|
|
562
|
-
if (value === null || typeof value !== "object" || ArrayBuffer.isView(value) || depth > MAX_DOCUMENT_ENCODING_DEPTH) {
|
|
563
|
-
return false;
|
|
564
|
-
}
|
|
565
|
-
for (const child of Array.isArray(value) ? value : Object.values(value)) {
|
|
566
|
-
if (holdsNegativeZero(child, depth + 1)) return true;
|
|
567
|
-
}
|
|
568
|
-
return false;
|
|
569
|
-
}
|
|
570
|
-
function encodeDocumentReply(payload) {
|
|
571
|
-
return encode(payload, { forceIntegerToFloat: holdsNegativeZero(payload, 1 - DOCUMENT_REPLY_ENVELOPE_DEPTH) });
|
|
572
|
-
}
|
|
573
|
-
function encodeDocument(document) {
|
|
574
|
-
try {
|
|
575
|
-
return encodeExactly(document, holdsNegativeZero(document, 1));
|
|
576
|
-
} catch (error) {
|
|
577
|
-
throw new NarsilError(
|
|
578
|
-
ErrorCodes.DOC_VALIDATION_FAILED,
|
|
579
|
-
`The document cannot be encoded as MessagePack: ${error instanceof Error ? error.message : String(error)}`
|
|
580
|
-
);
|
|
581
|
-
}
|
|
582
|
-
}
|
|
583
396
|
|
|
584
397
|
// src/schema/validator/document-size.ts
|
|
585
398
|
var LARGEST_HEADER_BYTES = 5;
|
|
@@ -1632,4 +1445,4 @@ var partialWordSearchModule = {
|
|
|
1632
1445
|
highlightWords: partialWordsToHighlight
|
|
1633
1446
|
};
|
|
1634
1447
|
|
|
1635
|
-
export { ANTIMERIDIAN_SPAN_DEGREES, DEG_TO_RAD, EARTH_RADIUS_METERS, FULL_TURN_DEGREES, LOCATION_CODE_BITS_PER_AXIS, MAX_COVERING_CELLS, MAX_LATITUDE_DEGREES, MAX_LONGITUDE_DEGREES, MIN_POLYGON_POINTS, RADIUS_BOX_MARGIN_RADIANS, RADIUS_BOX_MARGIN_RATIO, VINCENTY_CONVERGENCE_THRESHOLD, VINCENTY_MAX_ITERATIONS,
|
|
1448
|
+
export { ANTIMERIDIAN_SPAN_DEGREES, DEG_TO_RAD, EARTH_RADIUS_METERS, FULL_TURN_DEGREES, LOCATION_CODE_BITS_PER_AXIS, MAX_COVERING_CELLS, MAX_LATITUDE_DEGREES, MAX_LONGITUDE_DEGREES, MIN_POLYGON_POINTS, RADIUS_BOX_MARGIN_RADIANS, RADIUS_BOX_MARGIN_RATIO, VINCENTY_CONVERGENCE_THRESHOLD, VINCENTY_MAX_ITERATIONS, expandTermPrefix, getFlatSchema, getNestedValue, getOrCreateFieldNameIndex, isLatitude, isLongitude, isQuantizationMode, isStorageMode, messagePackUpperBoundBytes, parseVectorDimension, partialWordSearchModule, partitionDocumentFrequency, raiseEarlierReleaseGraphSetting, requireDocumentWithinSizeLimit, sameFields, suggestDisplayTerms, textFieldsChanged, tokenizeOptions, validateDocument, validateDocumentStrict, validateRequiredFields, validateTextStorage, validateVectorPromotion, validateVectorStorage, visitDocumentSpellings, visitDocumentSurfaceSpellings };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { readMetadataEnvelope } from './chunk-
|
|
2
|
-
import { readCommitMarker, nextMarkerSlot, encodeMarkerSlot, markerSlotOffset, nextSegmentKey, readWalSegments, durableRecordMissing, checkpointLastSeqNo, SEGMENT_HEADER_SIZE } from './chunk-
|
|
3
|
-
import { applyDeleteEntry, applyIndexEntry } from './chunk-
|
|
1
|
+
import { readMetadataEnvelope } from './chunk-QKZHLADX.mjs';
|
|
2
|
+
import { readCommitMarker, nextMarkerSlot, encodeMarkerSlot, markerSlotOffset, nextSegmentKey, readWalSegments, durableRecordMissing, checkpointLastSeqNo, SEGMENT_HEADER_SIZE } from './chunk-X6NSJYQ3.mjs';
|
|
3
|
+
import { applyDeleteEntry, applyIndexEntry } from './chunk-62G63NMH.mjs';
|
|
4
4
|
import { turnIsSpent, yieldTurn } from './chunk-LQG5G2LY.mjs';
|
|
5
5
|
|
|
6
6
|
// src/persistence/durability/marker-writer.ts
|
|
@@ -1,15 +1,18 @@
|
|
|
1
|
+
import { encodeSegmentManifest } from './chunk-TRISKD4Q.mjs';
|
|
1
2
|
import { WIRE_BATCH_BUDGET } from './chunk-JDDXV6UF.mjs';
|
|
2
|
-
import {
|
|
3
|
-
import { restoreVectorFields } from './chunk-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
3
|
+
import { writeSegmentsOf, readSegmentFile, MERGED_SEGMENT_GROWTH_ALLOWANCE, MERGED_SEGMENT_TARGET_BYTES } from './chunk-KCUIFVVW.mjs';
|
|
4
|
+
import { restoreVectorFields } from './chunk-62G63NMH.mjs';
|
|
5
|
+
import { SEGMENT_MANIFEST_VERSION, manifestKey, manifestReferencedKeys, segmentsPrefix, snapshotBundleKey, MAX_SEGMENTS_PER_PARTITION } from './chunk-Q3TCTQCC.mjs';
|
|
6
|
+
import { DEFAULT_COMPACTION_THRESHOLD, COMPACTION_LARGEST_MERGED_DOCUMENT_COUNT, SEGMENT_FILE_FRAMING_SLACK_BYTES } from './chunk-QDZJM7NI.mjs';
|
|
7
|
+
import { ReplicationMessageTypes } from './chunk-IQ4R2I6N.mjs';
|
|
8
|
+
import { reconstructSchemaFromMetadata, prepareDocumentVectors } from './chunk-LSM2YTKM.mjs';
|
|
9
|
+
import { generateId, freezeSegmentShared, createSharedFrozenSegment, createFrozenSegment, createPartitionManager, createPartitionRouter, buildSegmentPayload, resolvePartitionInsertOptions, decodeMapWithoutFields, shareSegmentArrays } from './chunk-5FUOVJKG.mjs';
|
|
10
|
+
import { isCompositePartition, survivorDocumentsOf, partitionStateOf } from './chunk-HWEDFLB7.mjs';
|
|
11
|
+
import { crc32 } from './chunk-7GXJUJ24.mjs';
|
|
12
|
+
import { getLanguage, resolveIndexAnalysis } from './chunk-JCLTESFN.mjs';
|
|
13
|
+
import { extractVectorFieldsFromSchema, partialFieldsOf } from './chunk-Z3TNWCI5.mjs';
|
|
11
14
|
import { MAX_FILE_BYTES } from './chunk-U476IXKQ.mjs';
|
|
12
|
-
import {
|
|
15
|
+
import { ErrorCodes, NarsilError } from './chunk-KUZKUONM.mjs';
|
|
13
16
|
import { encode, decode } from '@msgpack/msgpack';
|
|
14
17
|
|
|
15
18
|
// src/persistence/durability/segment/captured-partition.ts
|
|
@@ -495,7 +498,7 @@ function checkSegmentHeader(data) {
|
|
|
495
498
|
}
|
|
496
499
|
return { ok: true };
|
|
497
500
|
}
|
|
498
|
-
function
|
|
501
|
+
function decodeWalEntry(payload) {
|
|
499
502
|
const decoded = decode(payload);
|
|
500
503
|
const { entry } = validateEntryPayload({ entry: decoded });
|
|
501
504
|
if (computeEntryChecksum(entry) !== entry.checksum) {
|
|
@@ -543,7 +546,7 @@ function readDurableRegion(data, durableByteLength, maxRecordBytes = MAX_WAL_REC
|
|
|
543
546
|
}
|
|
544
547
|
let entry;
|
|
545
548
|
try {
|
|
546
|
-
entry =
|
|
549
|
+
entry = decodeWalEntry(payload);
|
|
547
550
|
} catch (err) {
|
|
548
551
|
corrupt("WAL record payload failed to decode inside the durable region", {
|
|
549
552
|
offset,
|
|
@@ -591,7 +594,7 @@ function readTailBeyondFrontier(data, durableByteLength, lastDurableSeqNo, maxRe
|
|
|
591
594
|
}
|
|
592
595
|
let entry;
|
|
593
596
|
try {
|
|
594
|
-
entry =
|
|
597
|
+
entry = decodeWalEntry(payload);
|
|
595
598
|
} catch {
|
|
596
599
|
break;
|
|
597
600
|
}
|
|
@@ -876,7 +879,7 @@ async function compactPartitionSegments(input) {
|
|
|
876
879
|
if (paged) {
|
|
877
880
|
const { directory } = input.store;
|
|
878
881
|
if (directory === void 0) return { segments, nextSegmentId: input.nextSegmentId };
|
|
879
|
-
const { mergePagedWindow } = await import('./module-
|
|
882
|
+
const { mergePagedWindow } = await import('./module-MG7JMV2U.mjs');
|
|
880
883
|
return replacing(
|
|
881
884
|
await mergePagedWindow({
|
|
882
885
|
store: input.store,
|
|
@@ -964,7 +967,7 @@ function pagedSettingsOf(context) {
|
|
|
964
967
|
async function tombstonesOfDelta(context, older, selections, deleted) {
|
|
965
968
|
const { directory } = context.input.store;
|
|
966
969
|
if (context.input.metadata.textStorage !== "disk" || directory === void 0) return deleted;
|
|
967
|
-
const { pagedTombstonesFor } = await import('./module-
|
|
970
|
+
const { pagedTombstonesFor } = await import('./module-MG7JMV2U.mjs');
|
|
968
971
|
return pagedTombstonesFor(
|
|
969
972
|
directory,
|
|
970
973
|
older,
|
|
@@ -1120,4 +1123,4 @@ async function removeCheckpointGarbage(store, garbage) {
|
|
|
1120
1123
|
}
|
|
1121
1124
|
}
|
|
1122
1125
|
|
|
1123
|
-
export { SEGMENT_HEADER_SIZE, buildEntry, captureWholePartition, checkpointLastSeqNo, checkpointPrimaryTerm, commitCheckpointManifest, computeEntryChecksum, createAckMessage, createEntryBatchMessage, createEntryMessage, createForwardBatchMessage, createForwardBatchResultMessage, createForwardMessage, createInsyncAddMessage, createInsyncConfirmMessage, createInsyncRemoveMessage, createPrimaryResignMessage, durableRecordMissing, encodeMarkerSlot, frameRecord, markerSlotOffset, nextMarkerSlot, nextSegmentKey, optionalIndexUuid, partitionContentsOf, readCommitMarker, readWalSegments, removeCheckpointGarbage, validateAckPayload, validateEntryBatchPayload, validateEntryPayload, validateForwardBatchPayload, validateForwardBatchResultPayload, validateInsyncConfirmPayload, writeCheckpointSegments, writeSegmentHeader };
|
|
1126
|
+
export { FRAME_CRC_SIZE, MAX_WAL_RECORD_BYTES, RECORD_LENGTH_SIZE, SEGMENT_HEADER_SIZE, buildEntry, captureWholePartition, checkSegmentHeader, checkpointLastSeqNo, checkpointPrimaryTerm, commitCheckpointManifest, computeEntryChecksum, createAckMessage, createEntryBatchMessage, createEntryMessage, createForwardBatchMessage, createForwardBatchResultMessage, createForwardMessage, createInsyncAddMessage, createInsyncConfirmMessage, createInsyncRemoveMessage, createPrimaryResignMessage, decodeWalEntry, durableRecordMissing, encodeMarkerSlot, frameRecord, markerSlotOffset, nextMarkerSlot, nextSegmentKey, optionalIndexUuid, partitionContentsOf, readCommitMarker, readWalSegments, removeCheckpointGarbage, validateAckPayload, validateEntryBatchPayload, validateEntryPayload, validateForwardBatchPayload, validateForwardBatchResultPayload, validateInsyncConfirmPayload, writeCheckpointSegments, writeSegmentHeader };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// src/engine/serial-index-update.ts
|
|
2
|
+
var updatingByCore = /* @__PURE__ */ new WeakMap();
|
|
3
|
+
async function withOpenIndex(core, indexName, action) {
|
|
4
|
+
core.guardShutdown();
|
|
5
|
+
core.requireIndex(indexName);
|
|
6
|
+
const release = await core.indexState.acquire(indexName);
|
|
7
|
+
try {
|
|
8
|
+
return await action();
|
|
9
|
+
} finally {
|
|
10
|
+
release();
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
async function oneAtATime(core, indexName, action) {
|
|
14
|
+
let chains = updatingByCore.get(core);
|
|
15
|
+
if (chains === void 0) {
|
|
16
|
+
chains = /* @__PURE__ */ new Map();
|
|
17
|
+
updatingByCore.set(core, chains);
|
|
18
|
+
}
|
|
19
|
+
const updating = chains;
|
|
20
|
+
const earlier = updating.get(indexName) ?? Promise.resolve();
|
|
21
|
+
const current = earlier.catch(() => void 0).then(action);
|
|
22
|
+
updating.set(indexName, current);
|
|
23
|
+
try {
|
|
24
|
+
return await current;
|
|
25
|
+
} finally {
|
|
26
|
+
if (updating.get(indexName) === current) updating.delete(indexName);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// src/engine/sync-notify.ts
|
|
31
|
+
var listenersByRegistry = /* @__PURE__ */ new WeakMap();
|
|
32
|
+
function listenForSyncChanges(registry, listener) {
|
|
33
|
+
let listeners = listenersByRegistry.get(registry);
|
|
34
|
+
if (listeners === void 0) {
|
|
35
|
+
listeners = /* @__PURE__ */ new Set();
|
|
36
|
+
listenersByRegistry.set(registry, listeners);
|
|
37
|
+
}
|
|
38
|
+
const registered = listeners;
|
|
39
|
+
registered.add(listener);
|
|
40
|
+
return () => {
|
|
41
|
+
registered.delete(listener);
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
function emitSyncChange(registry, change) {
|
|
45
|
+
const listeners = listenersByRegistry.get(registry);
|
|
46
|
+
if (listeners === void 0) return;
|
|
47
|
+
for (const listener of [...listeners]) listener(change);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export { emitSyncChange, listenForSyncChanges, oneAtATime, withOpenIndex };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MAX_MESSAGE_SIZE_BYTES } from './chunk-UNEEFTEU.mjs';
|
|
2
|
-
import { TransportError, TransportErrorCodes } from './chunk-
|
|
2
|
+
import { TransportError, TransportErrorCodes } from './chunk-IQ4R2I6N.mjs';
|
|
3
3
|
import { encode, decode } from '@msgpack/msgpack';
|
|
4
4
|
|
|
5
5
|
// src/distribution/transport/tcp/types.ts
|