@delali/narsil 0.3.1-next.153 → 0.3.1-next.154
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/dist/adapters/filesystem.mjs +2 -2
- package/dist/adapters/gcs.mjs +2 -2
- package/dist/adapters/indexeddb.mjs +1 -1
- package/dist/adapters/s3.mjs +2 -2
- package/dist/{analysis-change-2OYM7ARW.mjs → analysis-change-4GCRVRBW.mjs} +27 -18
- package/dist/{react-native/chunks/analysis-change-entry-CXNRW324.mjs → analysis-change-entry-KYGSXW4K.mjs} +1 -1
- package/dist/browser/{analysis-change-2V2HZ2NY.mjs → analysis-change-IXWPXXJJ.mjs} +17 -7
- package/dist/{analysis-change-entry-QD7YNDEE.mjs → browser/analysis-change-entry-FCSHFQSS.mjs} +1 -1
- package/dist/browser/{chunk-TQ5UMFG5.mjs → chunk-2FX6ROWR.mjs} +15 -6
- package/dist/browser/{chunk-KWYQ6KX4.mjs → chunk-2SHAKW2Z.mjs} +119 -1922
- package/dist/browser/{chunk-55WYRLDZ.mjs → chunk-3U3QR5YP.mjs} +2 -2
- package/dist/browser/chunk-4PD752F6.mjs +85 -0
- package/dist/browser/chunk-5W3MMTLG.mjs +19 -0
- package/dist/browser/{chunk-IAXZAVYL.mjs → chunk-7MEYN7V6.mjs} +1 -151
- package/dist/browser/chunk-7TTWXUH6.mjs +1828 -0
- package/dist/browser/{chunk-CSCKZBVJ.mjs → chunk-AJ4HHOVT.mjs} +4 -4
- package/dist/{react-native/chunks/chunk-DFQJ4IJB.mjs → browser/chunk-AYY6PIKL.mjs} +2 -2
- package/dist/browser/{chunk-VD7JEUIR.mjs → chunk-C4KS2QNF.mjs} +9 -8
- package/dist/browser/chunk-DSXIBE6N.mjs +78 -0
- package/dist/browser/chunk-ELV4OZOI.mjs +29 -0
- package/dist/browser/{chunk-PM4MUM5N.mjs → chunk-EUNBNLKM.mjs} +6 -5
- package/dist/browser/{chunk-GJKXW3SF.mjs → chunk-G7LUMBSG.mjs} +137 -253
- package/dist/browser/{chunk-B3JM6Z74.mjs → chunk-H6QFBMVE.mjs} +3 -2
- package/dist/browser/chunk-J433A7P3.mjs +241 -0
- package/dist/browser/chunk-ML6HY7T7.mjs +96 -0
- package/dist/browser/chunk-ML7THVLJ.mjs +38 -0
- package/dist/{chunk-MDF6PDIA.mjs → browser/chunk-MYITLCHT.mjs} +7 -1
- package/dist/browser/{chunk-QJCO3TJU.mjs → chunk-QXTPSX2H.mjs} +9 -150
- package/dist/browser/{chunk-MPK76GVS.mjs → chunk-RA6LSBCM.mjs} +1 -21
- package/dist/browser/{chunk-7ZJTRUVW.mjs → chunk-SIR3LMTV.mjs} +2 -2
- package/dist/browser/{chunk-LURXVCHG.mjs → chunk-SJB6VIZG.mjs} +1 -1
- package/dist/browser/chunk-TTD27VXX.mjs +298 -0
- package/dist/browser/chunk-U2E3HMYW.mjs +151 -0
- package/dist/browser/{chunk-2A2IPRC3.mjs → chunk-VCOYGVP7.mjs} +5 -31
- package/dist/browser/chunk-VI7BQR4U.mjs +21 -0
- package/dist/browser/chunk-W5X2UFWQ.mjs +102 -0
- package/dist/browser/{chunk-HT7J73QL.mjs → chunk-XRV72TJD.mjs} +2 -2
- package/dist/browser/chunk-YJHGOJAC.mjs +15 -0
- package/dist/browser/chunk-ZI2V4VD7.mjs +21 -0
- package/dist/{react-native/chunks/chunk-QC4ZRBSX.mjs → browser/chunk-ZPTA75ZC.mjs} +2 -79
- package/dist/browser/{cold-module-YECAK4MN.mjs → cold-module-VTUGDYNY.mjs} +20 -14
- package/dist/browser/{durability-wiring-LM7WFL6X.mjs → durability-wiring-GL4A7KDV.mjs} +1886 -1364
- package/dist/browser/import-YI5GNB4H.mjs +17 -0
- package/dist/browser/methods-LMUTS7OI.mjs +30 -0
- package/dist/browser/{module-XQLEOYNM.mjs → module-EC3FYW7N.mjs} +9 -8
- package/dist/browser/{module-KAMRAJLE.mjs → module-M4JNBV6V.mjs} +16 -10
- package/dist/browser/operations-WVYLF72Q.mjs +5 -0
- package/dist/browser/{phrase-module-CNKMUY4U.mjs → phrase-module-NPYUVX75.mjs} +1 -1
- package/dist/browser/{pool-DTYSPBMQ.mjs → pool-WCGDZHJP.mjs} +3 -2
- package/dist/{restore-queue-AOF5OTQV.mjs → browser/restore-queue-TYIGDL5L.mjs} +2 -2
- package/dist/browser/retention-6QMRS5VK.mjs +207 -0
- package/dist/browser/{runtime-D2ULZGCN.mjs → runtime-3EW2AGB6.mjs} +1 -1
- package/dist/browser/{snapshot-UGZVMP4H.mjs → snapshot-DN3CRVUQ.mjs} +38 -307
- package/dist/browser/sync-state-P5XG6LTQ.mjs +15 -0
- package/dist/browser/{write-I5P5MW4O.mjs → write-WAWAFGKQ.mjs} +16 -11
- package/dist/{capabilities-BT-HLDC8.d.ts → capabilities-B3Brs1Rc.d.ts} +62 -7
- package/dist/{chunk-DGRM4EZZ.mjs → chunk-37IVJLP6.mjs} +1 -1
- package/dist/{chunk-KYVRZAYP.mjs → chunk-3A5KI24C.mjs} +2 -69
- package/dist/{chunk-POUYICOU.mjs → chunk-3OFU3NJT.mjs} +1 -1
- package/dist/{chunk-3TVDTACC.mjs → chunk-3Y3J4V2R.mjs} +1 -1
- package/dist/{chunk-FNBNZCGP.mjs → chunk-466PYR4P.mjs} +2 -2
- package/dist/{chunk-SEAJS664.mjs → chunk-4HWZV5MK.mjs} +5 -5
- package/dist/{chunk-UGVUW27S.mjs → chunk-5FUOVJKG.mjs} +13 -9
- package/dist/{chunk-ZHAXP7SD.mjs → chunk-5KGYQT6W.mjs} +6 -235
- package/dist/{chunk-NPXVQS33.mjs → chunk-62G63NMH.mjs} +4 -3
- package/dist/chunk-6MSZ543Y.mjs +32 -0
- package/dist/chunk-7GXJUJ24.mjs +49 -0
- package/dist/{chunk-3E4RRF5J.mjs → chunk-7HCZWC7B.mjs} +58 -8
- package/dist/{chunk-6RKSY3BX.mjs → chunk-7NTMUDC5.mjs} +5 -5
- package/dist/chunk-7QUGDVFC.mjs +101 -0
- package/dist/{chunk-G5KHSM6E.mjs → chunk-AO2FAYIZ.mjs} +1 -1
- package/dist/chunk-B7S6YEBP.mjs +102 -0
- package/dist/{chunk-AWNHDBKV.mjs → chunk-BPSKLCS7.mjs} +15 -7
- package/dist/chunk-BUMREPLU.mjs +15 -0
- package/dist/{chunk-T4CJDBBE.mjs → chunk-C6ASEFZI.mjs} +1 -1
- package/dist/{chunk-NITCPDFL.mjs → chunk-C73JLU4E.mjs} +2 -2
- package/dist/{chunk-NYSONUB7.mjs → chunk-CP5RRPJR.mjs} +1 -1
- package/dist/{chunk-TTCKT2RT.mjs → chunk-DMQPFLGI.mjs} +134 -11
- package/dist/{chunk-3SBJVQLL.mjs → chunk-DVWYODEB.mjs} +2 -2
- package/dist/chunk-ECX4SGX6.mjs +167 -0
- package/dist/chunk-GES7U2PM.mjs +68 -0
- package/dist/{chunk-NVTFQFUL.mjs → chunk-HVKXNBFL.mjs} +1 -1
- package/dist/chunk-HVYICDY3.mjs +214 -0
- package/dist/{chunk-3HV7M5OJ.mjs → chunk-HWEDFLB7.mjs} +9 -133
- package/dist/{chunk-52QQWEBS.mjs → chunk-IBNLW3AV.mjs} +21 -6
- package/dist/chunk-IJU7LL7D.mjs +242 -0
- package/dist/chunk-IPN7S4KX.mjs +130 -0
- package/dist/{chunk-5QMHMELB.mjs → chunk-IQ4R2I6N.mjs} +4 -1
- package/dist/chunk-JCLTESFN.mjs +96 -0
- package/dist/{chunk-J4BDAH2W.mjs → chunk-JFNKIBDT.mjs} +2 -2
- package/dist/{chunk-LDGGR7YT.mjs → chunk-K4B7OH65.mjs} +2 -2
- package/dist/{chunk-7TE2AJIH.mjs → chunk-K7KLL263.mjs} +13 -10
- package/dist/{chunk-CSHHU7PA.mjs → chunk-KCUIFVVW.mjs} +11 -30
- package/dist/{react-native/chunks/chunk-YH7W556M.mjs → chunk-KUZKUONM.mjs} +11 -2
- package/dist/chunk-KYYABCSW.mjs +72 -0
- package/dist/{chunk-B2FTZNNF.mjs → chunk-LKUE5GXS.mjs} +34 -14
- package/dist/{chunk-2PNYKG2D.mjs → chunk-LSM2YTKM.mjs} +100 -335
- package/dist/{chunk-DMNPYF54.mjs → chunk-LTUGDMV4.mjs} +2 -2
- package/dist/{chunk-FDG4KXX5.mjs → chunk-MLHNSAPK.mjs} +5 -3
- package/dist/{chunk-VP6XRMWR.mjs → chunk-MMBEANB2.mjs} +6 -32
- package/dist/{chunk-LJ4ENXOD.mjs → chunk-MMEMEUOO.mjs} +2 -2
- package/dist/{chunk-2HJWQPR6.mjs → chunk-NTZOXVUZ.mjs} +6 -122
- package/dist/{chunk-5WB2A3XU.mjs → chunk-NZMAXR2S.mjs} +397 -24
- package/dist/{chunk-IZT3G24Q.mjs → chunk-O43Z4MS6.mjs} +2 -2
- package/dist/{chunk-U46IZNCW.mjs → chunk-OKX2BBNW.mjs} +3 -2
- package/dist/{chunk-RBEHLIKX.mjs → chunk-PFKM7VNZ.mjs} +14 -8
- package/dist/chunk-PGVPE7GJ.mjs +96 -0
- package/dist/chunk-Q3TCTQCC.mjs +85 -0
- package/dist/chunk-Q7MS6P2J.mjs +74 -0
- package/dist/chunk-QDZJM7NI.mjs +23 -0
- package/dist/{chunk-ZS6CMXAE.mjs → chunk-QKZHLADX.mjs} +89 -250
- package/dist/{chunk-IJSFWGVW.mjs → chunk-REL7LFLR.mjs} +3 -3
- package/dist/chunk-RVKFI3A2.mjs +237 -0
- package/dist/chunk-S2N75OTN.mjs +83 -0
- package/dist/chunk-TRISKD4Q.mjs +50 -0
- package/dist/{chunk-6F6USYII.mjs → chunk-TV2L3BN7.mjs} +13 -11
- package/dist/{chunk-6BWLDLS3.mjs → chunk-URPCYQVJ.mjs} +1 -1
- package/dist/chunk-USR7FQRZ.mjs +34 -0
- package/dist/chunk-V6EUBAIT.mjs +19 -0
- package/dist/{chunk-SOUZMPME.mjs → chunk-VMXSVVXG.mjs} +7 -194
- package/dist/{chunk-4QCSHLNM.mjs → chunk-VREK3MYG.mjs} +3 -3
- package/dist/{chunk-YGQOPB2Z.mjs → chunk-WCBA2LVZ.mjs} +1 -1
- package/dist/{chunk-KQJVNPRM.mjs → chunk-X6NSJYQ3.mjs} +19 -16
- package/dist/chunk-Y4WPNHMC.mjs +50 -0
- package/dist/{chunk-IRWP524D.mjs → chunk-YBJDOA2T.mjs} +1 -1
- package/dist/{chunk-IJPK5PGM.mjs → chunk-YPUEV6ZC.mjs} +1 -1
- package/dist/{chunk-J7M73VY7.mjs → chunk-YROWNOMH.mjs} +1 -1
- package/dist/chunk-Z3TNWCI5.mjs +196 -0
- package/dist/{chunk-65WCV5JO.mjs → chunk-ZIFJXCKA.mjs} +1 -1
- package/dist/chunk-ZYAY26KG.mjs +29 -0
- package/dist/{client-Cn3gNxUU.d.ts → client-Df76GNKm.d.ts} +76 -6
- package/dist/client.d.ts +8 -7
- package/dist/client.mjs +56 -5
- package/dist/{cold-module-PYSSBIL7.mjs → cold-module-YLWMTTZG.mjs} +38 -28
- package/dist/{config-CfhH1IWQ.d.ts → config-05G_hy-1.d.ts} +3 -3
- package/dist/config-B8DP2VwR.d.ts +463 -0
- package/dist/{direct-executor-WYALQSMD.mjs → direct-executor-FI5GJHWX.mjs} +14 -9
- package/dist/distribution/coordinator/etcd.d.ts +2 -2
- package/dist/distribution/coordinator/etcd.mjs +1 -1
- package/dist/distribution/coordinator/in-memory.d.ts +2 -2
- package/dist/distribution/transport/grpc.mjs +4 -4
- package/dist/distribution/transport/in-memory.mjs +2 -2
- package/dist/distribution/transport/tcp.mjs +3 -3
- package/dist/distribution.d.ts +41 -9
- package/dist/distribution.mjs +1296 -117
- package/dist/{durability-wiring-7VBZEJLG.mjs → durability-wiring-RHLXDIVF.mjs} +1751 -1226
- package/dist/embeddings/openai.mjs +2 -2
- package/dist/{engine-CJRUHXgf.d.ts → engine-DYu-e0oR.d.ts} +50 -40
- package/dist/{import-GJOMB2HC.mjs → import-SRBNC6TE.mjs} +27 -19
- package/dist/{index-MsF7e5hL.d.ts → index-nRqDM6uS.d.ts} +1 -1
- package/dist/index.browser.mjs +8 -4
- package/dist/index.d.ts +7 -6
- package/dist/index.mjs +24 -16
- package/dist/index.react-native.mjs +17 -11
- package/dist/{long-query-thread-SCUE62TO.mjs → long-query-thread-EMYTGSJP.mjs} +28 -15
- package/dist/methods-ABM5ELBR.mjs +30 -0
- package/dist/{module-AVQEIB7O.mjs → module-3OMJZUFT.mjs} +12 -12
- package/dist/{module-6RLIKSZQ.mjs → module-MG7JMV2U.mjs} +33 -23
- package/dist/operations-PGOAY2KS.mjs +5 -0
- package/dist/{paged-partition-archive-KGRW366Y.mjs → paged-partition-archive-UOLHOEZJ.mjs} +37 -26
- package/dist/partial-words.mjs +6 -4
- package/dist/pattern.mjs +4 -3
- package/dist/persistence/durability/checkpoint-worker.d.ts +9 -1
- package/dist/persistence/durability/checkpoint-worker.mjs +34 -23
- package/dist/{phrase-module-OUQIRUQU.mjs → phrase-module-O3MDRQXP.mjs} +1 -1
- package/dist/{pool-UPV5PVPY.mjs → pool-CQXYPFLG.mjs} +2 -2
- package/dist/react-native/chunks/{analysis-change-DXPZRGWF.mjs → analysis-change-EAYO3Y6Q.mjs} +27 -15
- package/dist/{browser/analysis-change-entry-JL5U2N3Q.mjs → react-native/chunks/analysis-change-entry-TNLUC6IZ.mjs} +1 -1
- package/dist/react-native/chunks/{chunk-D7LFYPYI.mjs → chunk-2CGSQM4O.mjs} +12 -10
- package/dist/react-native/chunks/chunk-3NQOVO3K.mjs +1 -0
- package/dist/react-native/chunks/{chunk-R4OPUZQ5.mjs → chunk-3O57C2ZO.mjs} +2 -2
- package/dist/react-native/chunks/chunk-3XKMRNRE.mjs +298 -0
- package/dist/react-native/chunks/{chunk-IDFMNRIC.mjs → chunk-63YSZOXB.mjs} +97 -333
- package/dist/react-native/chunks/{chunk-UFNCLEQM.mjs → chunk-75VWIY35.mjs} +1 -1
- package/dist/react-native/chunks/{chunk-2J2727V4.mjs → chunk-7GWPJDOA.mjs} +1 -1
- package/dist/react-native/chunks/{chunk-PU55IOG4.mjs → chunk-AUT7PMA4.mjs} +6 -190
- package/dist/react-native/chunks/chunk-C2H2QQFW.mjs +288 -0
- package/dist/react-native/chunks/chunk-CHPTFFJM.mjs +43 -0
- package/dist/{browser/chunk-PIS7ZAP7.mjs → react-native/chunks/chunk-CUNGPR5R.mjs} +11 -2
- package/dist/{browser/chunk-NVEJJP4R.mjs → react-native/chunks/chunk-DCKMICOB.mjs} +2 -79
- package/dist/react-native/chunks/chunk-DH3TVWWK.mjs +102 -0
- package/dist/react-native/chunks/{chunk-ZCKNBPQ4.mjs → chunk-EH5CFV6Z.mjs} +2 -2
- package/dist/react-native/chunks/chunk-F753DA54.mjs +23 -0
- package/dist/{browser/chunk-VBX2TI5V.mjs → react-native/chunks/chunk-GFYFQLJD.mjs} +2 -2
- package/dist/react-native/chunks/{chunk-7IQR3SZO.mjs → chunk-I5PGWQJF.mjs} +142 -257
- package/dist/react-native/chunks/{chunk-NFGBOI46.mjs → chunk-IOY2SM2P.mjs} +1 -1
- package/dist/react-native/chunks/chunk-JDOEEMEF.mjs +38 -0
- package/dist/react-native/chunks/{chunk-TLYD7IJ2.mjs → chunk-JPAJWO6D.mjs} +1 -1
- package/dist/react-native/chunks/chunk-JWUCMVRK.mjs +15 -0
- package/dist/react-native/chunks/{chunk-KLZGAOLT.mjs → chunk-JX2RIAXH.mjs} +4 -4
- package/dist/react-native/chunks/chunk-LU3Y3P63.mjs +68 -0
- package/dist/react-native/chunks/{chunk-LQAKO5QV.mjs → chunk-NCJS3WIY.mjs} +2 -2
- package/dist/react-native/chunks/{chunk-BRNAVOKP.mjs → chunk-NKIZX26F.mjs} +2 -2
- package/dist/react-native/chunks/{chunk-CLE3LZ77.mjs → chunk-NP7DD4G5.mjs} +5 -4
- package/dist/react-native/chunks/chunk-NVVRSRX5.mjs +78 -0
- package/dist/react-native/chunks/chunk-O32RB3BL.mjs +191 -0
- package/dist/react-native/chunks/{chunk-DKJTZ625.mjs → chunk-OQQVRWZ2.mjs} +2 -69
- package/dist/react-native/chunks/chunk-PB2YXVQW.mjs +29 -0
- package/dist/react-native/chunks/chunk-Q32DDFKX.mjs +19 -0
- package/dist/react-native/chunks/{chunk-LRGWK367.mjs → chunk-RVAEBN74.mjs} +1 -1
- package/dist/react-native/chunks/{chunk-KOCTCUXW.mjs → chunk-RYMDHGL4.mjs} +16 -8
- package/dist/react-native/chunks/chunk-SJWDBRNP.mjs +85 -0
- package/dist/react-native/chunks/chunk-UNUFZ2QY.mjs +68 -0
- package/dist/react-native/chunks/chunk-UWDNZDWK.mjs +242 -0
- package/dist/react-native/chunks/{chunk-FS7BYE23.mjs → chunk-VQSKZ3EZ.mjs} +9 -152
- package/dist/react-native/chunks/{chunk-UCJU6WNH.mjs → chunk-VVFYOADG.mjs} +7 -6
- package/dist/react-native/chunks/{chunk-VGUWIZFQ.mjs → chunk-YBEW6YTR.mjs} +1 -1
- package/dist/react-native/chunks/{chunk-JYL35A4A.mjs → chunk-YHKZSLOC.mjs} +7 -33
- package/dist/react-native/chunks/{chunk-3CTWSQRW.mjs → chunk-ZBSWRSBG.mjs} +4 -30
- package/dist/react-native/chunks/chunk-ZYDKJXQJ.mjs +96 -0
- package/dist/react-native/chunks/{cold-module-KFGEWYEL.mjs → cold-module-TJL6AFAD.mjs} +29 -21
- package/dist/react-native/chunks/{durability-wiring-QKJB2QBT.mjs → durability-wiring-RRDYJLLM.mjs} +1882 -1358
- package/dist/react-native/chunks/gzip.react-native-DNB5YNFA.mjs +3 -0
- package/dist/react-native/chunks/import-JYBMEJPQ.mjs +29 -0
- package/dist/react-native/chunks/methods-X6F36SJE.mjs +30 -0
- package/dist/react-native/chunks/module-QT5HZAY4.mjs +33 -0
- package/dist/react-native/chunks/{module-UJ5VUARS.mjs → module-S4DKSWMF.mjs} +10 -9
- package/dist/react-native/chunks/operations-RYKTSZQA.mjs +5 -0
- package/dist/react-native/chunks/{phrase-module-76UAPPSG.mjs → phrase-module-JZ37TB7N.mjs} +1 -1
- package/dist/react-native/chunks/{pool-CD4ANYUI.mjs → pool-RTGXJXPU.mjs} +3 -2
- package/dist/{browser/restore-queue-UQ6AAUVX.mjs → react-native/chunks/restore-queue-ZBVIKJWI.mjs} +2 -2
- package/dist/react-native/chunks/retention-PPCTP2VY.mjs +219 -0
- package/dist/react-native/chunks/{runtime-3MCDLJAF.mjs → runtime-KUATOLYB.mjs} +1 -1
- package/dist/react-native/chunks/{snapshot-KVBD4LRC.mjs → snapshot-ZBIEOZTZ.mjs} +47 -314
- package/dist/react-native/chunks/sync-state-PASCIHHT.mjs +15 -0
- package/dist/react-native/chunks/{write-ES5A3WUA.mjs → write-2W4FTX7J.mjs} +25 -18
- package/dist/react-native/partial-words.mjs +6 -4
- package/dist/react-native/pattern.mjs +4 -3
- package/dist/react-native/sync.mjs +2236 -0
- package/dist/react-native/synonyms.mjs +7 -4
- package/dist/react.d.ts +10 -9
- package/dist/react.mjs +7 -1
- package/dist/{rerank-3W54N6P2.mjs → rerank-IZOB6NII.mjs} +4 -4
- package/dist/rerankers/http.mjs +2 -2
- package/dist/{react-native/chunks/restore-queue-H5VCN453.mjs → restore-queue-COI2GSSK.mjs} +2 -2
- package/dist/retention-55WA7GPU.mjs +58 -0
- package/dist/{runtime-L2DZYY6N.mjs → runtime-UZOC3NPY.mjs} +5 -5
- package/dist/{schema-D33CyXCy.d.ts → schema-DDauvDOv.d.ts} +1 -1
- package/dist/server.d.ts +22 -19
- package/dist/server.mjs +868 -50
- package/dist/{snapshot-WMX6JCLP.mjs → snapshot-NFX2EYN2.mjs} +62 -36
- package/dist/sync/filesystem.d.ts +30 -0
- package/dist/sync/filesystem.mjs +271 -0
- package/dist/sync/indexeddb.d.ts +30 -0
- package/dist/sync/indexeddb.mjs +237 -0
- package/dist/sync-state-ZWHLAFLE.mjs +15 -0
- package/dist/{config-aIsy7mcL.d.ts → sync-uXR7MmM7.d.ts} +53 -444
- package/dist/sync.browser.mjs +2231 -0
- package/dist/sync.d.ts +23 -0
- package/dist/sync.mjs +2206 -0
- package/dist/synonyms.mjs +5 -3
- package/dist/{tasks-C4ElXr4P.d.ts → tasks-BShx8pdK.d.ts} +4 -4
- package/dist/thread-P2G2FWM2.mjs +44 -0
- package/dist/types-SnO7_tAI.d.ts +228 -0
- package/dist/vector/search-worker.d.ts +1 -1
- package/dist/vector/search-worker.mjs +6 -6
- package/dist/workers/entry.mjs +7 -7
- package/dist/{write-SKJ6HW7O.mjs → write-FGB62BHQ.mjs} +31 -23
- package/openapi.json +119 -3
- package/package.json +28 -8
- package/dist/browser/import-QOY6ZH6X.mjs +0 -12
- package/dist/chunk-7LDMWKP6.mjs +0 -209
- package/dist/react-native/chunks/chunk-L4M7QJNP.mjs +0 -110
- package/dist/react-native/chunks/gzip.react-native-7JWCLVOB.mjs +0 -3
- package/dist/react-native/chunks/import-XFBCCENV.mjs +0 -22
- package/dist/react-native/chunks/module-FHJ2GOBI.mjs +0 -25
- package/dist/thread-I7DVHHW7.mjs +0 -31
|
@@ -1,23 +1,35 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { restoredConfigFields, restoredEmbedding, rejectSnapshot } from './chunk-ZPTA75ZC.mjs';
|
|
2
|
+
import { requireRestoreMemory, earlierSnapshotFootprint, storedBytesOfSegments, archiveFootprint } from './chunk-VCOYGVP7.mjs';
|
|
3
|
+
import { MAX_SNAPSHOT_ANALYSIS_ATTEMPTS } from './chunk-ELV4OZOI.mjs';
|
|
4
|
+
import { indexMetadataOf, writeCheckpointSegments, writeLiveVectors, commitCheckpointManifest, SINGLE_NODE_PRIMARY_TERM, partitionContentsOf, unpackIndexSnapshotEnvelope, encodeSegmentManifest, loadSegmentedCheckpoint, writeMetadataEnvelope, readVectorFile, readGraphParts, documentsOfPayloadV2, deserializePayloadV1 } from './chunk-G7LUMBSG.mjs';
|
|
5
|
+
import { createByteReader } from './chunk-DSXIBE6N.mjs';
|
|
6
|
+
import { ARCHIVE_CONFIG_ENTRY, ARCHIVE_MANIFEST_ENTRY, tarEnd, readSnapshotArchive, tarEntryHeaders, tarPadding, ARCHIVE_FILE_CHUNK_BYTES } from './chunk-TTD27VXX.mjs';
|
|
7
|
+
import { decodeSegmentManifest } from './chunk-J433A7P3.mjs';
|
|
3
8
|
import './chunk-JNOAKDUM.mjs';
|
|
4
|
-
import {
|
|
5
|
-
import './chunk-
|
|
6
|
-
import {
|
|
7
|
-
import './chunk-
|
|
8
|
-
import './chunk-
|
|
9
|
-
import { decodeVectorIndexParts, vectorsToBytes, VECTOR_FILE_PAYLOAD_VERSION, bytesToVectors } from './chunk-55WYRLDZ.mjs';
|
|
10
|
-
import { MAX_SNAPSHOT_ANALYSIS_ATTEMPTS, requireRestoreMemory, earlierSnapshotFootprint, archiveFootprint, storedBytesOfSegments } from './chunk-2A2IPRC3.mjs';
|
|
11
|
-
import { encodeIndexConfiguration, hasNrslMagic, HEADER_SIZE, readHeader, ARRAY_POSITION_GAP, raiseEarlierReleaseGraphSetting, getLanguage, validateSchema, validatePatternValueLimit, requireSurfaceFormsForPartialFields, validateVectorPromotion, validateVectorStorage, validateTextStorage, validateRequiredFieldsInSchema, resolveIndexAnalysis, validateEmbeddingConfig, storedArrayPositionGap, prepareStoredSynonyms, loadVectorCodeFor, decodeEveryStoredDocument, parseVectorDimension, isCompositePartition, arrayPositionsAreStale, insertDocumentVectors, decodeIndexConfiguration, flattenSchema } from './chunk-KWYQ6KX4.mjs';
|
|
12
|
-
import './chunk-MPK76GVS.mjs';
|
|
9
|
+
import { readSegmentFile } from './chunk-QXTPSX2H.mjs';
|
|
10
|
+
import './chunk-H6QFBMVE.mjs';
|
|
11
|
+
import { DEFAULT_COMPACTION_THRESHOLD } from './chunk-ZI2V4VD7.mjs';
|
|
12
|
+
import { encodeIndexConfiguration, ARRAY_POSITION_GAP, raiseEarlierReleaseGraphSetting, validatePatternValueLimit, requireSurfaceFormsForPartialFields, validateVectorPromotion, validateVectorStorage, validateTextStorage, validateRequiredFieldsInSchema, validateEmbeddingConfig, storedArrayPositionGap, prepareStoredSynonyms, loadVectorCodeFor, decodeEveryStoredDocument, parseVectorDimension, isCompositePartition, arrayPositionsAreStale, insertDocumentVectors } from './chunk-2SHAKW2Z.mjs';
|
|
13
|
+
import './chunk-VI7BQR4U.mjs';
|
|
13
14
|
import './chunk-JPTQZWJQ.mjs';
|
|
15
|
+
import { manifestKey, manifestFileRefs } from './chunk-4PD752F6.mjs';
|
|
16
|
+
import { hasNrslMagic, HEADER_SIZE, readHeader, getLanguage, validateSchema, resolveIndexAnalysis, decodeIndexConfiguration, flattenSchema } from './chunk-7TTWXUH6.mjs';
|
|
17
|
+
import './chunk-RA6LSBCM.mjs';
|
|
14
18
|
import './chunk-26A5JFT2.mjs';
|
|
19
|
+
import { vectorsPerFile } from './chunk-AJ4HHOVT.mjs';
|
|
15
20
|
import './chunk-OIZS5KIX.mjs';
|
|
16
|
-
import
|
|
21
|
+
import './chunk-3I27KXQD.mjs';
|
|
22
|
+
import './chunk-2FX6ROWR.mjs';
|
|
23
|
+
import { decodeVectorIndexParts, vectorsToBytes, VECTOR_FILE_PAYLOAD_VERSION, bytesToVectors } from './chunk-3U3QR5YP.mjs';
|
|
24
|
+
import './chunk-U2E3HMYW.mjs';
|
|
17
25
|
import './chunk-TY7L6OXO.mjs';
|
|
18
26
|
import './chunk-4RD3AFSB.mjs';
|
|
27
|
+
import { MAX_FILE_BYTES } from './chunk-7MEYN7V6.mjs';
|
|
19
28
|
import './chunk-WXLBZJMT.mjs';
|
|
20
|
-
import {
|
|
29
|
+
import { oneSyncChangeAtATime } from './chunk-5W3MMTLG.mjs';
|
|
30
|
+
import { newSyncEpoch } from './chunk-YJHGOJAC.mjs';
|
|
31
|
+
import { emitSyncChange } from './chunk-ML7THVLJ.mjs';
|
|
32
|
+
import { NarsilError, ErrorCodes } from './chunk-MYITLCHT.mjs';
|
|
21
33
|
import { decode } from '@msgpack/msgpack';
|
|
22
34
|
|
|
23
35
|
// src/persistence/archive/memory-store.ts
|
|
@@ -172,297 +184,6 @@ async function buildArchiveFromMemory(input) {
|
|
|
172
184
|
};
|
|
173
185
|
}
|
|
174
186
|
|
|
175
|
-
// src/persistence/archive/constants.ts
|
|
176
|
-
var MAX_PAX_HEADER_BYTES = 65536;
|
|
177
|
-
var ARCHIVE_FILE_CHUNK_BYTES = 4194304;
|
|
178
|
-
|
|
179
|
-
// src/persistence/archive/tar.ts
|
|
180
|
-
var TAR_BLOCK_BYTES = 512;
|
|
181
|
-
var NAME_OFFSET = 0;
|
|
182
|
-
var NAME_BYTES = 100;
|
|
183
|
-
var MODE_OFFSET = 100;
|
|
184
|
-
var OWNER_OFFSET = 108;
|
|
185
|
-
var GROUP_OFFSET = 116;
|
|
186
|
-
var ID_FIELD_BYTES = 8;
|
|
187
|
-
var SIZE_OFFSET = 124;
|
|
188
|
-
var SIZE_FIELD_BYTES = 12;
|
|
189
|
-
var SIZE_FIELD_DIGITS = 11;
|
|
190
|
-
var MTIME_OFFSET = 136;
|
|
191
|
-
var MTIME_FIELD_BYTES = 12;
|
|
192
|
-
var CHECKSUM_FIELD_OFFSET = 148;
|
|
193
|
-
var CHECKSUM_FIELD_BYTES = 8;
|
|
194
|
-
var CHECKSUM_DIGITS = 6;
|
|
195
|
-
var TYPEFLAG_OFFSET = 156;
|
|
196
|
-
var MAGIC_OFFSET = 257;
|
|
197
|
-
var MAGIC_BYTES = 6;
|
|
198
|
-
var VERSION_OFFSET = 263;
|
|
199
|
-
var VERSION_BYTES = 2;
|
|
200
|
-
var PREFIX_OFFSET = 345;
|
|
201
|
-
var PREFIX_BYTES = 155;
|
|
202
|
-
var MODE_OCTAL = "0000644";
|
|
203
|
-
var ZERO_OCTAL_7 = "0000000";
|
|
204
|
-
var ZERO_OCTAL_11 = "00000000000";
|
|
205
|
-
var REGULAR_FILE = 48;
|
|
206
|
-
var OLD_REGULAR_FILE = 0;
|
|
207
|
-
var PAX_EXTENDED_HEADER = 120;
|
|
208
|
-
var PAX_HEADER_NAME = "PaxHeader";
|
|
209
|
-
var encoder = new TextEncoder();
|
|
210
|
-
var decoder = new TextDecoder("utf-8", { fatal: true });
|
|
211
|
-
function writeString(block, offset, length, value) {
|
|
212
|
-
const bytes = encoder.encode(value);
|
|
213
|
-
block.set(bytes.subarray(0, length), offset);
|
|
214
|
-
}
|
|
215
|
-
function writeOctal(block, offset, digits, value) {
|
|
216
|
-
writeString(block, offset, digits, value.toString(8).padStart(digits, "0"));
|
|
217
|
-
}
|
|
218
|
-
function headerChecksum(block) {
|
|
219
|
-
let sum = 0;
|
|
220
|
-
const checksumEnd = CHECKSUM_FIELD_OFFSET + CHECKSUM_FIELD_BYTES;
|
|
221
|
-
for (let at = 0; at < TAR_BLOCK_BYTES; at++) {
|
|
222
|
-
sum += at >= CHECKSUM_FIELD_OFFSET && at < checksumEnd ? 32 : block[at];
|
|
223
|
-
}
|
|
224
|
-
return sum;
|
|
225
|
-
}
|
|
226
|
-
function ustarBlock(name, prefix, size, typeflag) {
|
|
227
|
-
const block = new Uint8Array(TAR_BLOCK_BYTES);
|
|
228
|
-
writeString(block, NAME_OFFSET, NAME_BYTES, name);
|
|
229
|
-
writeString(block, MODE_OFFSET, ID_FIELD_BYTES, MODE_OCTAL);
|
|
230
|
-
writeString(block, OWNER_OFFSET, ID_FIELD_BYTES, ZERO_OCTAL_7);
|
|
231
|
-
writeString(block, GROUP_OFFSET, ID_FIELD_BYTES, ZERO_OCTAL_7);
|
|
232
|
-
writeOctal(block, SIZE_OFFSET, SIZE_FIELD_DIGITS, size);
|
|
233
|
-
writeString(block, MTIME_OFFSET, MTIME_FIELD_BYTES, ZERO_OCTAL_11);
|
|
234
|
-
block[TYPEFLAG_OFFSET] = typeflag;
|
|
235
|
-
writeString(block, MAGIC_OFFSET, MAGIC_BYTES, "ustar");
|
|
236
|
-
writeString(block, VERSION_OFFSET, VERSION_BYTES, "00");
|
|
237
|
-
writeString(block, PREFIX_OFFSET, PREFIX_BYTES, prefix);
|
|
238
|
-
const checksum = headerChecksum(block);
|
|
239
|
-
writeString(block, CHECKSUM_FIELD_OFFSET, CHECKSUM_DIGITS, checksum.toString(8).padStart(CHECKSUM_DIGITS, "0"));
|
|
240
|
-
block[CHECKSUM_FIELD_OFFSET + CHECKSUM_DIGITS] = 0;
|
|
241
|
-
block[CHECKSUM_FIELD_OFFSET + CHECKSUM_DIGITS + 1] = 32;
|
|
242
|
-
return block;
|
|
243
|
-
}
|
|
244
|
-
function splitForUstar(name) {
|
|
245
|
-
if (encoder.encode(name).byteLength <= NAME_BYTES) return { name, prefix: "" };
|
|
246
|
-
for (let slash = name.indexOf("/"); slash >= 0; slash = name.indexOf("/", slash + 1)) {
|
|
247
|
-
const prefix = name.slice(0, slash);
|
|
248
|
-
const rest = name.slice(slash + 1);
|
|
249
|
-
if (encoder.encode(prefix).byteLength <= PREFIX_BYTES && encoder.encode(rest).byteLength <= NAME_BYTES) {
|
|
250
|
-
return { name: rest, prefix };
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
return null;
|
|
254
|
-
}
|
|
255
|
-
function paxRecord(key, value) {
|
|
256
|
-
const body = ` ${key}=${value}
|
|
257
|
-
`;
|
|
258
|
-
const bodyBytes = encoder.encode(body).byteLength;
|
|
259
|
-
let digits = 1;
|
|
260
|
-
while (String(bodyBytes + digits).length !== digits) digits += 1;
|
|
261
|
-
return `${bodyBytes + digits}${body}`;
|
|
262
|
-
}
|
|
263
|
-
function tarPadding(size) {
|
|
264
|
-
const remainder = size % TAR_BLOCK_BYTES;
|
|
265
|
-
return new Uint8Array(remainder === 0 ? 0 : TAR_BLOCK_BYTES - remainder);
|
|
266
|
-
}
|
|
267
|
-
function tarEntryHeaders(name, size) {
|
|
268
|
-
const split = splitForUstar(name);
|
|
269
|
-
if (split !== null) return [ustarBlock(split.name, split.prefix, size, REGULAR_FILE)];
|
|
270
|
-
const record = encoder.encode(paxRecord("path", name));
|
|
271
|
-
return [
|
|
272
|
-
ustarBlock(PAX_HEADER_NAME, "", record.byteLength, PAX_EXTENDED_HEADER),
|
|
273
|
-
record,
|
|
274
|
-
tarPadding(record.byteLength),
|
|
275
|
-
ustarBlock(name.slice(-NAME_BYTES).replace(/^[^/]*\//, ""), "", size, REGULAR_FILE)
|
|
276
|
-
];
|
|
277
|
-
}
|
|
278
|
-
function tarEnd() {
|
|
279
|
-
return new Uint8Array(TAR_BLOCK_BYTES * 2);
|
|
280
|
-
}
|
|
281
|
-
function invalidArchive(message, details) {
|
|
282
|
-
throw new NarsilError(ErrorCodes.PERSISTENCE_LOAD_FAILED, `Invalid snapshot archive: ${message}`, details);
|
|
283
|
-
}
|
|
284
|
-
function readString(block, offset, length) {
|
|
285
|
-
let end = offset;
|
|
286
|
-
while (end < offset + length && block[end] !== 0) end++;
|
|
287
|
-
try {
|
|
288
|
-
return decoder.decode(block.subarray(offset, end));
|
|
289
|
-
} catch {
|
|
290
|
-
invalidArchive("an entry header holds a name that is not UTF-8");
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
function readOctal(block, offset, length, what) {
|
|
294
|
-
const text = readString(block, offset, length).trim();
|
|
295
|
-
if (!/^[0-7]+$/.test(text)) invalidArchive(`an entry header holds an invalid ${what}`);
|
|
296
|
-
const value = Number.parseInt(text, 8);
|
|
297
|
-
if (!Number.isSafeInteger(value)) invalidArchive(`an entry header holds an invalid ${what}`);
|
|
298
|
-
return value;
|
|
299
|
-
}
|
|
300
|
-
function isZeroBlock(block) {
|
|
301
|
-
for (let at = 0; at < block.length; at++) if (block[at] !== 0) return false;
|
|
302
|
-
return true;
|
|
303
|
-
}
|
|
304
|
-
function parseTarHeader(block) {
|
|
305
|
-
if (readOctal(block, CHECKSUM_FIELD_OFFSET, CHECKSUM_FIELD_BYTES, "checksum") !== headerChecksum(block)) {
|
|
306
|
-
invalidArchive("an entry header fails its checksum");
|
|
307
|
-
}
|
|
308
|
-
const typeflag = block[TYPEFLAG_OFFSET];
|
|
309
|
-
if (typeflag !== REGULAR_FILE && typeflag !== OLD_REGULAR_FILE && typeflag !== PAX_EXTENDED_HEADER) {
|
|
310
|
-
invalidArchive(`an entry has type ${String.fromCharCode(typeflag)}, while an archive holds regular files alone`);
|
|
311
|
-
}
|
|
312
|
-
const name = readString(block, NAME_OFFSET, NAME_BYTES);
|
|
313
|
-
const prefix = readString(block, PREFIX_OFFSET, PREFIX_BYTES);
|
|
314
|
-
return {
|
|
315
|
-
name: prefix.length > 0 ? `${prefix}/${name}` : name,
|
|
316
|
-
size: readOctal(block, SIZE_OFFSET, SIZE_FIELD_BYTES, "size"),
|
|
317
|
-
isPaxHeader: typeflag === PAX_EXTENDED_HEADER
|
|
318
|
-
};
|
|
319
|
-
}
|
|
320
|
-
var SPACE = 32;
|
|
321
|
-
var EQUALS = 61;
|
|
322
|
-
var NEWLINE = 10;
|
|
323
|
-
function decodeRecordText(bytes) {
|
|
324
|
-
try {
|
|
325
|
-
return decoder.decode(bytes);
|
|
326
|
-
} catch {
|
|
327
|
-
invalidArchive("a pax extended header is not UTF-8");
|
|
328
|
-
}
|
|
329
|
-
}
|
|
330
|
-
function parsePaxRecords(body) {
|
|
331
|
-
const records = /* @__PURE__ */ new Map();
|
|
332
|
-
let at = 0;
|
|
333
|
-
while (at < body.length) {
|
|
334
|
-
const space = body.indexOf(SPACE, at);
|
|
335
|
-
if (space < 0) invalidArchive("a pax extended header holds a malformed record");
|
|
336
|
-
const length = Number.parseInt(decodeRecordText(body.subarray(at, space)), 10);
|
|
337
|
-
if (!Number.isSafeInteger(length) || length <= space - at || at + length > body.length) {
|
|
338
|
-
invalidArchive("a pax extended header holds a malformed record");
|
|
339
|
-
}
|
|
340
|
-
const record = body.subarray(space + 1, at + length);
|
|
341
|
-
const equals = record.indexOf(EQUALS);
|
|
342
|
-
if (equals < 0 || record[record.length - 1] !== NEWLINE) {
|
|
343
|
-
invalidArchive("a pax extended header holds a record without a value");
|
|
344
|
-
}
|
|
345
|
-
records.set(decodeRecordText(record.subarray(0, equals)), decodeRecordText(record.subarray(equals + 1, -1)));
|
|
346
|
-
at += length;
|
|
347
|
-
}
|
|
348
|
-
return records;
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
// src/persistence/archive/read.ts
|
|
352
|
-
var ARCHIVE_CONFIG_ENTRY = "config";
|
|
353
|
-
var ARCHIVE_MANIFEST_ENTRY = "manifest";
|
|
354
|
-
var SEGMENTS_MARKER = "/segments/";
|
|
355
|
-
var CHECKSUM_OFFSET = 14;
|
|
356
|
-
async function readBlock(reader) {
|
|
357
|
-
const block = await reader.readExactly(TAR_BLOCK_BYTES);
|
|
358
|
-
if (block === null) return null;
|
|
359
|
-
if (block.byteLength < TAR_BLOCK_BYTES) invalidArchive("the archive ends inside an entry header");
|
|
360
|
-
return block;
|
|
361
|
-
}
|
|
362
|
-
async function skipPadding(reader, size) {
|
|
363
|
-
const remainder = size % TAR_BLOCK_BYTES;
|
|
364
|
-
if (remainder === 0) return;
|
|
365
|
-
const padding = await reader.readExactly(TAR_BLOCK_BYTES - remainder);
|
|
366
|
-
if (padding === null || padding.byteLength < TAR_BLOCK_BYTES - remainder) {
|
|
367
|
-
invalidArchive("the archive ends inside the padding of an entry");
|
|
368
|
-
}
|
|
369
|
-
}
|
|
370
|
-
async function readPadded(reader, size) {
|
|
371
|
-
const body = await reader.readExactly(size) ?? new Uint8Array(0);
|
|
372
|
-
if (body.byteLength < size) invalidArchive("the archive ends inside an entry");
|
|
373
|
-
await skipPadding(reader, size);
|
|
374
|
-
return body;
|
|
375
|
-
}
|
|
376
|
-
function entryBody(reader, size) {
|
|
377
|
-
let remaining = size;
|
|
378
|
-
async function* chunks() {
|
|
379
|
-
while (remaining > 0) {
|
|
380
|
-
const length = Math.min(ARCHIVE_FILE_CHUNK_BYTES, remaining);
|
|
381
|
-
const chunk = await reader.readExactly(length);
|
|
382
|
-
if (chunk === null || chunk.byteLength < length) invalidArchive("the archive ends inside an entry");
|
|
383
|
-
remaining -= length;
|
|
384
|
-
yield chunk;
|
|
385
|
-
}
|
|
386
|
-
}
|
|
387
|
-
return chunks();
|
|
388
|
-
}
|
|
389
|
-
async function nextEntryHeader(reader) {
|
|
390
|
-
const block = await readBlock(reader);
|
|
391
|
-
if (block === null || isZeroBlock(block)) return null;
|
|
392
|
-
const header = parseTarHeader(block);
|
|
393
|
-
if (!header.isPaxHeader) return { name: header.name, size: header.size };
|
|
394
|
-
if (header.size > MAX_PAX_HEADER_BYTES) invalidArchive("a pax extended header is too long");
|
|
395
|
-
const records = parsePaxRecords(await readPadded(reader, header.size));
|
|
396
|
-
const next = await readBlock(reader);
|
|
397
|
-
if (next === null || isZeroBlock(next)) invalidArchive("a pax extended header precedes no entry");
|
|
398
|
-
const entry = parseTarHeader(next);
|
|
399
|
-
if (entry.isPaxHeader) invalidArchive("a pax extended header follows another");
|
|
400
|
-
const path = records.get("path");
|
|
401
|
-
const size = records.get("size");
|
|
402
|
-
const parsedSize = size === void 0 ? entry.size : Number.parseInt(size, 10);
|
|
403
|
-
if (!Number.isSafeInteger(parsedSize) || parsedSize < 0) invalidArchive("a pax extended header holds an invalid size");
|
|
404
|
-
return { name: path ?? entry.name, size: parsedSize };
|
|
405
|
-
}
|
|
406
|
-
async function readNamedEntry(reader, expected) {
|
|
407
|
-
const header = await nextEntryHeader(reader);
|
|
408
|
-
if (header === null) invalidArchive(`the archive ends before its ${expected} entry`);
|
|
409
|
-
if (header.name !== expected) invalidArchive(`the archive holds "${header.name}" where its ${expected} entry belongs`);
|
|
410
|
-
if (header.size > MAX_FILE_BYTES) invalidArchive(`the ${expected} entry passes the file size limit`);
|
|
411
|
-
return readPadded(reader, header.size);
|
|
412
|
-
}
|
|
413
|
-
function sourceIndexNameOf(keys) {
|
|
414
|
-
const first = keys[0];
|
|
415
|
-
if (first === void 0) return "archive";
|
|
416
|
-
const at = first.indexOf(SEGMENTS_MARKER);
|
|
417
|
-
if (at <= 0) invalidArchive(`the manifest lists the key "${first}" outside any index`);
|
|
418
|
-
return first.slice(0, at);
|
|
419
|
-
}
|
|
420
|
-
function headerChecksumOf(bytes) {
|
|
421
|
-
if (bytes.byteLength < HEADER_SIZE) return -1;
|
|
422
|
-
return new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength).getUint32(CHECKSUM_OFFSET, false);
|
|
423
|
-
}
|
|
424
|
-
async function readSnapshotArchive(reader, handlers) {
|
|
425
|
-
await handlers.config(await readNamedEntry(reader, ARCHIVE_CONFIG_ENTRY));
|
|
426
|
-
const raw = await openManifestPayload(await readNamedEntry(reader, ARCHIVE_MANIFEST_ENTRY));
|
|
427
|
-
const sourceIndexName = sourceIndexNameOf(listedKeysOf(raw));
|
|
428
|
-
const decoded = decodeManifestPayload(raw, sourceIndexName);
|
|
429
|
-
if (decoded.kind !== "current") invalidArchive("the manifest holds the layout of an earlier release");
|
|
430
|
-
const manifest = decoded.manifest;
|
|
431
|
-
await handlers.manifest(manifest, sourceIndexName);
|
|
432
|
-
const files = manifestFileRefs(manifest);
|
|
433
|
-
const prefix = `${sourceIndexName}/`;
|
|
434
|
-
const listedNames = new Set(files.map((file) => file.key.slice(prefix.length)));
|
|
435
|
-
const seen = /* @__PURE__ */ new Set();
|
|
436
|
-
for (const ref of files) {
|
|
437
|
-
const expected = ref.key.slice(prefix.length);
|
|
438
|
-
const header = await nextEntryHeader(reader);
|
|
439
|
-
if (header === null) invalidArchive(`the archive ends before it holds "${expected}"`);
|
|
440
|
-
if (header.name !== expected) {
|
|
441
|
-
const why = !listedNames.has(header.name) ? "that the manifest does not list" : seen.has(header.name) ? "twice" : "out of order";
|
|
442
|
-
invalidArchive(`the archive holds the entry "${header.name}" ${why}`, { entry: header.name });
|
|
443
|
-
}
|
|
444
|
-
if (header.size !== ref.bytes) {
|
|
445
|
-
invalidArchive(`the entry "${expected}" holds ${header.size} bytes where the manifest lists ${ref.bytes}`);
|
|
446
|
-
}
|
|
447
|
-
const start = await reader.peek(Math.min(HEADER_SIZE, header.size));
|
|
448
|
-
if (headerChecksumOf(start) !== ref.checksum) {
|
|
449
|
-
invalidArchive(`the entry "${expected}" carries a checksum other than the manifest lists`, { entry: expected });
|
|
450
|
-
}
|
|
451
|
-
seen.add(expected);
|
|
452
|
-
const entry = entryBody(reader, header.size);
|
|
453
|
-
await handlers.file(expected, ref, entry);
|
|
454
|
-
let unread = await entry.next();
|
|
455
|
-
while (unread.done !== true) unread = await entry.next();
|
|
456
|
-
await skipPadding(reader, header.size);
|
|
457
|
-
}
|
|
458
|
-
const trailing = await nextEntryHeader(reader);
|
|
459
|
-
if (trailing !== null) {
|
|
460
|
-
invalidArchive(`the archive holds the entry "${trailing.name}" that the manifest does not list`, {
|
|
461
|
-
entry: trailing.name
|
|
462
|
-
});
|
|
463
|
-
}
|
|
464
|
-
}
|
|
465
|
-
|
|
466
187
|
// src/persistence/archive/write.ts
|
|
467
188
|
function entryChunks(name, bytes) {
|
|
468
189
|
return [...tarEntryHeaders(name, bytes.byteLength), bytes, tarPadding(bytes.byteLength)].filter(
|
|
@@ -562,7 +283,7 @@ async function validateStagedCheckpoint(store, manifest) {
|
|
|
562
283
|
for (const ref of partition.segments) {
|
|
563
284
|
const { directory } = store;
|
|
564
285
|
if (directory !== void 0) {
|
|
565
|
-
const { checkPagedSegmentFully, isPagedSegmentFile } = await import('./module-
|
|
286
|
+
const { checkPagedSegmentFully, isPagedSegmentFile } = await import('./module-M4JNBV6V.mjs');
|
|
566
287
|
if (await isPagedSegmentFile(directory, ref.key)) {
|
|
567
288
|
requireSchemaOfManifest(ref.key, await checkPagedSegmentFully(directory, ref), manifest);
|
|
568
289
|
continue;
|
|
@@ -695,7 +416,8 @@ function restoredRegistryEntry(prepared, manager, deps) {
|
|
|
695
416
|
synonyms: prepared.synonyms?.encoded ?? null,
|
|
696
417
|
analysisGeneration: prepared.analysisGeneration,
|
|
697
418
|
pendingAnalysis: null,
|
|
698
|
-
durableAnalysis: null
|
|
419
|
+
durableAnalysis: null,
|
|
420
|
+
sync: null
|
|
699
421
|
};
|
|
700
422
|
}
|
|
701
423
|
|
|
@@ -836,6 +558,8 @@ async function stageMetadata(indexName, staging, entry) {
|
|
|
836
558
|
}
|
|
837
559
|
async function installRestoredIndex(indexName, restored, deps) {
|
|
838
560
|
const entry = restoredRegistryEntry(restored.prepared, restored.detached.manager, deps);
|
|
561
|
+
const previousSync = deps.indexRegistry.get(indexName)?.sync ?? null;
|
|
562
|
+
if (previousSync !== null) entry.sync = { ...previousSync, active: false, epoch: newSyncEpoch() };
|
|
839
563
|
let replaced;
|
|
840
564
|
try {
|
|
841
565
|
if (restored.staging !== null) await stageMetadata(indexName, restored.staging, entry);
|
|
@@ -853,9 +577,16 @@ async function installRestoredIndex(indexName, restored, deps) {
|
|
|
853
577
|
await durable.persistMetadata(indexName);
|
|
854
578
|
await durable.checkpoint(indexName);
|
|
855
579
|
}
|
|
580
|
+
if (previousSync !== null) {
|
|
581
|
+
const storage = durable?.syncStorage?.();
|
|
582
|
+
if (storage !== void 0)
|
|
583
|
+
await oneSyncChangeAtATime(deps.indexRegistry, indexName, () => storage.release(indexName));
|
|
584
|
+
emitSyncChange(deps.indexRegistry, { kind: "epoch", indexName });
|
|
585
|
+
}
|
|
856
586
|
if (replaced !== void 0) await deps.announceIndexDropped(indexName, replaced.config);
|
|
857
587
|
await deps.announceIndexCreated(indexName, restored.prepared.config);
|
|
858
588
|
for (const vectorIndex of restored.detached.manager.getVectorIndexes().values()) {
|
|
589
|
+
vectorIndex.scheduleBuild();
|
|
859
590
|
vectorIndex.startShuffledRebuildWhenDue();
|
|
860
591
|
}
|
|
861
592
|
}
|
|
@@ -930,7 +661,7 @@ async function stageArchive(indexName, reader, staging, deps) {
|
|
|
930
661
|
if (manifest === null) missingPart("manifest");
|
|
931
662
|
const { directory } = staging;
|
|
932
663
|
if (keepsTextOnDisk(prepared, staging) && directory !== void 0) {
|
|
933
|
-
const { bytesThatSegmentsHoldInMemory } = await import('./module-
|
|
664
|
+
const { bytesThatSegmentsHoldInMemory } = await import('./module-M4JNBV6V.mjs');
|
|
934
665
|
const replacesIndex = deps.indexRegistry.has(indexName);
|
|
935
666
|
const segmentBytes = await bytesThatSegmentsHoldInMemory(directory, manifest);
|
|
936
667
|
requireRestoreMemory(indexName, archiveFootprint(prepared, manifest, replacesIndex, segmentBytes), replacesIndex);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { isSyncEpoch, newSyncEpoch } from './chunk-YJHGOJAC.mjs';
|
|
2
|
+
|
|
3
|
+
// src/engine/sync-state.ts
|
|
4
|
+
function syncStateOfMetadata(metadata) {
|
|
5
|
+
if (metadata.sync?.enabled !== true) return null;
|
|
6
|
+
const epoch = isSyncEpoch(metadata.syncEpoch) ? metadata.syncEpoch : null;
|
|
7
|
+
return {
|
|
8
|
+
...metadata.sync.historyMaxAgeMs !== void 0 ? { historyMaxAgeMs: metadata.sync.historyMaxAgeMs } : {},
|
|
9
|
+
...metadata.sync.historyMaxBytes !== void 0 ? { historyMaxBytes: metadata.sync.historyMaxBytes } : {},
|
|
10
|
+
active: epoch !== null && metadata.syncActive === true,
|
|
11
|
+
epoch: epoch ?? newSyncEpoch()
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export { syncStateOfMetadata };
|
|
@@ -1,18 +1,23 @@
|
|
|
1
|
-
import { DOCUMENT_EXPORT_VERSION, DOCUMENT_EXPORT_FORMAT } from './chunk-
|
|
2
|
-
import './chunk-
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import './chunk-
|
|
6
|
-
import {
|
|
7
|
-
import { decodeStoredDocument
|
|
8
|
-
import './chunk-
|
|
1
|
+
import { DOCUMENT_EXPORT_VERSION, DOCUMENT_EXPORT_FORMAT } from './chunk-EUNBNLKM.mjs';
|
|
2
|
+
import './chunk-ZPTA75ZC.mjs';
|
|
3
|
+
import './chunk-DSXIBE6N.mjs';
|
|
4
|
+
import { encodeExactJson, encodeDocumentJson } from './chunk-SIR3LMTV.mjs';
|
|
5
|
+
import './chunk-XRV72TJD.mjs';
|
|
6
|
+
import { setNestedValue, KEYWORD_SEGMENT_ENVELOPE_VERSION, decodeKeywordSegment } from './chunk-H6QFBMVE.mjs';
|
|
7
|
+
import { decodeStoredDocument } from './chunk-2SHAKW2Z.mjs';
|
|
8
|
+
import './chunk-VI7BQR4U.mjs';
|
|
9
9
|
import './chunk-JPTQZWJQ.mjs';
|
|
10
|
+
import { openChecksummedEnvelope } from './chunk-7TTWXUH6.mjs';
|
|
11
|
+
import './chunk-RA6LSBCM.mjs';
|
|
10
12
|
import './chunk-26A5JFT2.mjs';
|
|
11
|
-
import './chunk-
|
|
13
|
+
import { decodeVectorFilePayload, isDead, bytesToVectors } from './chunk-3U3QR5YP.mjs';
|
|
14
|
+
import './chunk-U2E3HMYW.mjs';
|
|
12
15
|
import './chunk-TY7L6OXO.mjs';
|
|
13
16
|
import { EXPORT_CHUNK_BYTES } from './chunk-4RD3AFSB.mjs';
|
|
17
|
+
import './chunk-7MEYN7V6.mjs';
|
|
14
18
|
import './chunk-WXLBZJMT.mjs';
|
|
15
|
-
import './chunk-
|
|
19
|
+
import './chunk-ML7THVLJ.mjs';
|
|
20
|
+
import './chunk-MYITLCHT.mjs';
|
|
16
21
|
import { decode } from '@msgpack/msgpack';
|
|
17
22
|
|
|
18
23
|
var VECTOR_FILE_ENVELOPE_VERSION = 2;
|
|
@@ -94,7 +99,7 @@ async function wholeFileVectorReads(checkpoint) {
|
|
|
94
99
|
};
|
|
95
100
|
}
|
|
96
101
|
async function* pagedDocumentLines(checkpoint) {
|
|
97
|
-
const { openFileVectorReads, pagedPartitionLines } = await import('./module-
|
|
102
|
+
const { openFileVectorReads, pagedPartitionLines } = await import('./module-M4JNBV6V.mjs');
|
|
98
103
|
const vectors = await openFileVectorReads(checkpoint, () => wholeFileVectorReads(checkpoint));
|
|
99
104
|
try {
|
|
100
105
|
for (const partition of checkpoint.manifest.partitions) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { E as EmbeddingAdapter, R as RerankAdapter } from './adapters-pljAqmrC.js';
|
|
2
|
-
import { C as ClusterNamespace } from './config-
|
|
3
|
-
import { E as ErrorDetail, j as TaskStore } from './tasks-
|
|
2
|
+
import { C as ClusterNamespace } from './config-05G_hy-1.js';
|
|
3
|
+
import { E as ErrorDetail, j as TaskStore } from './tasks-BShx8pdK.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Context handed to {@link OnRequestHook} for every inbound request, captured
|
|
@@ -34,17 +34,61 @@ interface RequestDenial {
|
|
|
34
34
|
/** The error envelope carries this description. */
|
|
35
35
|
message: string;
|
|
36
36
|
}
|
|
37
|
+
/**
|
|
38
|
+
* Returned by an {@link OnRequestHook} to admit a request under a credential
|
|
39
|
+
* that expires. The server closes a device sync feed with close code 4401 at
|
|
40
|
+
* `expiresAt`, so that a device has to reconnect with a fresh credential, and
|
|
41
|
+
* it treats the grant on every other route as `undefined`.
|
|
42
|
+
*
|
|
43
|
+
* @public
|
|
44
|
+
*/
|
|
45
|
+
interface RequestGrant {
|
|
46
|
+
/** The credential that admitted the request expires at this time, in milliseconds since the Unix epoch. */
|
|
47
|
+
expiresAt: number;
|
|
48
|
+
}
|
|
37
49
|
/**
|
|
38
50
|
* Runs before every routed request, which is where authentication, rate
|
|
39
|
-
* limiting, and any other admission rule goes.
|
|
51
|
+
* limiting, and any other admission rule goes. It also runs on the upgrade
|
|
52
|
+
* of a device sync feed, where a browser device can carry its credential as
|
|
53
|
+
* a `Sec-WebSocket-Protocol` value after `narsil.sync.v1`, because a browser
|
|
54
|
+
* can set no other header on a WebSocket.
|
|
40
55
|
*
|
|
41
56
|
* @param ctx - The request's method, path, headers, and peer address.
|
|
42
|
-
* @returns A {@link RequestDenial} to reject the request,
|
|
43
|
-
* let it through
|
|
57
|
+
* @returns A {@link RequestDenial} to reject the request, a
|
|
58
|
+
* {@link RequestGrant} to let it through until its credential expires, or
|
|
59
|
+
* `undefined` to let it through.
|
|
60
|
+
*
|
|
61
|
+
* @public
|
|
62
|
+
*/
|
|
63
|
+
type OnRequestHook = (ctx: RequestContext) => undefined | RequestDenial | RequestGrant | Promise<undefined | RequestDenial | RequestGrant>;
|
|
64
|
+
/**
|
|
65
|
+
* The settings of the device sync routes, `GET /indexes/{name}/sync/snapshot`
|
|
66
|
+
* and the feed at `GET /indexes/{name}/sync/feed`. Every field has a default.
|
|
44
67
|
*
|
|
45
68
|
* @public
|
|
46
69
|
*/
|
|
47
|
-
|
|
70
|
+
interface ServerSyncOptions {
|
|
71
|
+
/**
|
|
72
|
+
* The server stops sending entries to a device while the entries that it
|
|
73
|
+
* has sent, and that the device has not acknowledged, hold more than this
|
|
74
|
+
* many bytes. It defaults to 8,388,608.
|
|
75
|
+
*/
|
|
76
|
+
windowBytes?: number;
|
|
77
|
+
/** The server holds at most this many feed connections, and it answers 429 to one more. It defaults to 10,000. */
|
|
78
|
+
maxConnections?: number;
|
|
79
|
+
/**
|
|
80
|
+
* The server reads the history of at most this many feed connections at
|
|
81
|
+
* once, and it holds any other connection until one of those reads ends.
|
|
82
|
+
* It defaults to 32.
|
|
83
|
+
*/
|
|
84
|
+
maxCatchUps?: number;
|
|
85
|
+
/**
|
|
86
|
+
* The server stops reading entries for every feed while its feed
|
|
87
|
+
* connections hold this many bytes that the network has not yet taken. It
|
|
88
|
+
* defaults to 268,435,456.
|
|
89
|
+
*/
|
|
90
|
+
maxBufferedBytes?: number;
|
|
91
|
+
}
|
|
48
92
|
/**
|
|
49
93
|
* Which cross-origin requests the server accepts.
|
|
50
94
|
*
|
|
@@ -210,6 +254,17 @@ interface ServerOptions {
|
|
|
210
254
|
* factor. Without it, all three cluster routes answer 501.
|
|
211
255
|
*/
|
|
212
256
|
cluster?: ClusterNamespace;
|
|
257
|
+
/**
|
|
258
|
+
* Turns on the device sync routes, which stay off by default: the
|
|
259
|
+
* published snapshot at `GET /indexes/{name}/sync/snapshot` and the feed,
|
|
260
|
+
* a WebSocket at `GET /indexes/{name}/sync/feed`. Each index serves them
|
|
261
|
+
* only once a caller turns sync on for it with `updateSync`. A device
|
|
262
|
+
* receives the whole index, so the server refuses to start with these
|
|
263
|
+
* routes on and no {@link ServerOptions.onRequest} hook, whatever
|
|
264
|
+
* {@link ServerOptions.allowInsecure} holds. Pass `true` for the default
|
|
265
|
+
* settings.
|
|
266
|
+
*/
|
|
267
|
+
sync?: boolean | ServerSyncOptions;
|
|
213
268
|
}
|
|
214
269
|
/**
|
|
215
270
|
* The running HTTP server, as {@link createServer} returns it.
|
|
@@ -334,4 +389,4 @@ declare const BM25_TUNING_CAPABILITY = "indexes.bm25";
|
|
|
334
389
|
*/
|
|
335
390
|
declare const SERVER_CAPABILITIES: readonly string[];
|
|
336
391
|
|
|
337
|
-
export { ASYNC_IMPORT_CAPABILITY as A, BM25_TUNING_CAPABILITY as B, CHANGE_ANALYSIS_CAPABILITY as C, DOCUMENT_EXPORT_CAPABILITY as D, type ErrorEnvelope as E, INDEX_LIFECYCLE_CAPABILITY as I, type NarsilServer as N, type OnRequestHook as O, REBUILD_ANALYSIS_CAPABILITY as R, SERVER_CAPABILITIES as S, TASK_CANCEL_CAPABILITY as T, SYNONYMS_CAPABILITY as a, TASK_FILTER_CAPABILITY as b, type ServerOptions as c, type CorsOptions as d, type RequestContext as e, type RequestDenial as f, type
|
|
392
|
+
export { ASYNC_IMPORT_CAPABILITY as A, BM25_TUNING_CAPABILITY as B, CHANGE_ANALYSIS_CAPABILITY as C, DOCUMENT_EXPORT_CAPABILITY as D, type ErrorEnvelope as E, INDEX_LIFECYCLE_CAPABILITY as I, type NarsilServer as N, type OnRequestHook as O, REBUILD_ANALYSIS_CAPABILITY as R, SERVER_CAPABILITIES as S, TASK_CANCEL_CAPABILITY as T, SYNONYMS_CAPABILITY as a, TASK_FILTER_CAPABILITY as b, type ServerOptions as c, type CorsOptions as d, type RequestContext as e, type RequestDenial as f, type RequestGrant as g, type ServerLimits as h, type ServerSyncOptions as i };
|
|
@@ -14,7 +14,7 @@ function requireLoadedVectorCode() {
|
|
|
14
14
|
function loadVectorCode() {
|
|
15
15
|
if (loaded !== null) return Promise.resolve(loaded);
|
|
16
16
|
if (loading === null) {
|
|
17
|
-
loading = import('./module-
|
|
17
|
+
loading = import('./module-3OMJZUFT.mjs').then(
|
|
18
18
|
(code) => {
|
|
19
19
|
loaded = code;
|
|
20
20
|
return code;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PARSED_FIELD_TYPE_CACHE_ENTRIES, VECTOR_PATTERN, MAX_STORED_VECTOR_DIMENSION } from './chunk-L5ORED7V.mjs';
|
|
2
|
-
import { NarsilError, ErrorCodes } from './chunk-
|
|
2
|
+
import { NarsilError, ErrorCodes } from './chunk-KUZKUONM.mjs';
|
|
3
3
|
|
|
4
4
|
// src/schema/validator/field-type.ts
|
|
5
5
|
var FIELD_OPTION_ORDER = ["sortable", "pattern", "partial"];
|
|
@@ -114,71 +114,4 @@ function isStringValuedBase(base) {
|
|
|
114
114
|
return base === "string" || base === "string[]" || base === "verbatim" || base === "verbatim[]";
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
-
|
|
118
|
-
var FIRST_SURROGATE = 55296;
|
|
119
|
-
var LAST_SURROGATE = 57343;
|
|
120
|
-
var LAST_BASIC_PLANE_CODE_POINT = 65535;
|
|
121
|
-
function hasSurrogate(text) {
|
|
122
|
-
for (let index = 0; index < text.length; index++) {
|
|
123
|
-
const unit = text.charCodeAt(index);
|
|
124
|
-
if (unit >= FIRST_SURROGATE && unit <= LAST_SURROGATE) return true;
|
|
125
|
-
}
|
|
126
|
-
return false;
|
|
127
|
-
}
|
|
128
|
-
function fuzzyPrefixOf(queryTerm, prefixLength) {
|
|
129
|
-
let end = 0;
|
|
130
|
-
for (let counted = 0; counted < prefixLength && end < queryTerm.length; counted++) {
|
|
131
|
-
const codePoint = queryTerm.codePointAt(end);
|
|
132
|
-
end += codePoint !== void 0 && codePoint > LAST_BASIC_PLANE_CODE_POINT ? 2 : 1;
|
|
133
|
-
}
|
|
134
|
-
return queryTerm.slice(0, end);
|
|
135
|
-
}
|
|
136
|
-
function fuzzyTermMatches(queryTerm, indexTerm, tolerance, prefixLength) {
|
|
137
|
-
if (queryTerm === indexTerm) return true;
|
|
138
|
-
if (tolerance <= 0) return false;
|
|
139
|
-
if (!indexTerm.startsWith(fuzzyPrefixOf(queryTerm, prefixLength))) return false;
|
|
140
|
-
return boundedLevenshtein(queryTerm, indexTerm, tolerance).withinTolerance;
|
|
141
|
-
}
|
|
142
|
-
function boundedLevenshtein(a, b, tolerance) {
|
|
143
|
-
if (tolerance < 0) return { distance: -1, withinTolerance: false, cells: 0 };
|
|
144
|
-
if (a === b) return { distance: 0, withinTolerance: true, cells: 0 };
|
|
145
|
-
return tabulatedLevenshtein(a, b, tolerance);
|
|
146
|
-
}
|
|
147
|
-
function tabulatedLevenshtein(a, b, tolerance) {
|
|
148
|
-
if (tolerance < 0) return { distance: -1, withinTolerance: false, cells: 0 };
|
|
149
|
-
if (hasSurrogate(a) || hasSurrogate(b)) return bandedDistance(Array.from(a), Array.from(b), tolerance);
|
|
150
|
-
return bandedDistance(a, b, tolerance);
|
|
151
|
-
}
|
|
152
|
-
function bandedDistance(a, b, tolerance) {
|
|
153
|
-
const m = a.length;
|
|
154
|
-
const n = b.length;
|
|
155
|
-
const beyond = tolerance + 1;
|
|
156
|
-
if (Math.abs(m - n) > tolerance) return { distance: beyond, withinTolerance: false, cells: 0 };
|
|
157
|
-
let previous = new Uint32Array(n + 1).fill(beyond);
|
|
158
|
-
let current = new Uint32Array(n + 1).fill(beyond);
|
|
159
|
-
const firstRowEnd = Math.min(n, tolerance);
|
|
160
|
-
for (let j = 0; j <= firstRowEnd; j++) previous[j] = j;
|
|
161
|
-
let cells = 0;
|
|
162
|
-
for (let i = 1; i <= m; i++) {
|
|
163
|
-
const low = Math.max(1, i - tolerance);
|
|
164
|
-
const high = Math.min(n, i + tolerance);
|
|
165
|
-
current[low - 1] = low === 1 ? i : beyond;
|
|
166
|
-
let rowMin = current[low - 1];
|
|
167
|
-
const character = a[i - 1];
|
|
168
|
-
if (high >= low) cells += high - low + 1;
|
|
169
|
-
for (let j = low; j <= high; j++) {
|
|
170
|
-
const substitution = previous[j - 1] + (character === b[j - 1] ? 0 : 1);
|
|
171
|
-
const cell = Math.min(previous[j] + 1, current[j - 1] + 1, substitution, beyond);
|
|
172
|
-
current[j] = cell;
|
|
173
|
-
if (cell < rowMin) rowMin = cell;
|
|
174
|
-
}
|
|
175
|
-
if (rowMin > tolerance) return { distance: beyond, withinTolerance: false, cells };
|
|
176
|
-
const finished = previous;
|
|
177
|
-
previous = current;
|
|
178
|
-
current = finished;
|
|
179
|
-
}
|
|
180
|
-
const distance = previous[n];
|
|
181
|
-
return { distance, withinTolerance: distance <= tolerance, cells };
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
export { boundedLevenshtein, fuzzyPrefixOf, fuzzyTermMatches, isListBase, isSingleStringFieldType, isStringValuedBase, isWordIndexedBase, isWordIndexedFieldType, parseFieldType, parsedTypeOf, tabulatedLevenshtein, withSortableOption };
|
|
117
|
+
export { isListBase, isSingleStringFieldType, isStringValuedBase, isWordIndexedBase, isWordIndexedFieldType, parseFieldType, parsedTypeOf, withSortableOption };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MAX_FILE_BYTES } from './chunk-U476IXKQ.mjs';
|
|
2
|
-
import { NarsilError, ErrorCodes } from './chunk-
|
|
2
|
+
import { NarsilError, ErrorCodes } from './chunk-KUZKUONM.mjs';
|
|
3
3
|
|
|
4
4
|
// src/persistence/object-store.ts
|
|
5
5
|
function objectKeyPrefix(prefix, adapter) {
|