@delali/narsil 0.3.1-next.157 → 0.3.1-next.161
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/dist/adapters/filesystem.mjs +3 -3
- package/dist/adapters/gcs.mjs +3 -3
- package/dist/adapters/indexeddb.mjs +1 -1
- package/dist/adapters/s3.mjs +3 -3
- package/dist/browser/{chunk-N23GL72Q.mjs → chunk-4RNSFVWI.mjs} +20777 -19056
- package/dist/browser/chunk-MMHIIL5B.mjs +564 -0
- package/dist/browser/chunk-MZHQ65VI.mjs +1228 -0
- package/dist/browser/chunk-WC2DEXWU.mjs +29 -0
- package/dist/browser/{chunk-VLJQW4J6.mjs → core-leaf-TJAGWPZZ.mjs} +4674 -3102
- package/dist/{react-native/chunks/durability-config-QXVZEO7T.mjs → browser/durability-config-SGB5ZP5K.mjs} +8 -3
- package/dist/browser/embed-RF2MPGAO.mjs +222 -0
- package/dist/{react-native/chunks/geo-index-PX3BIHAH.mjs → browser/geo-index-GNHY4PUB.mjs} +190 -93
- package/dist/{react-native/chunks/module-TTEVPRCW.mjs → browser/module-362VSIGR.mjs} +1570 -275
- package/dist/browser/msgpack-leaf-44XNWSSY.mjs +302 -0
- package/dist/browser/optional-reads-XMVPG6HG.mjs +3230 -0
- package/dist/browser/optional-writes-WMZX4OEC.mjs +3196 -0
- package/dist/browser/phrase-module-22TKMXWI.mjs +616 -0
- package/dist/browser/resolve-vector-text-KI65IHMD.mjs +60 -0
- package/dist/browser/{restore-hooks-IE3GGYHG.mjs → restore-queue-S4BWOGMU.mjs} +98 -24
- package/dist/{react-native/chunks/runtime-R5E3TB3J.mjs → browser/runtime-NU6VOVH2.mjs} +61 -25
- package/dist/browser/segment-codec-leaf-A427QJUX.mjs +554 -0
- package/dist/browser/segment-merge-leaf-7BZ54JPI.mjs +1636 -0
- package/dist/browser/storage-leaf-X6CNRHJS.mjs +18221 -0
- package/dist/browser/store-leaf-AEMTAVHX.mjs +2069 -0
- package/dist/browser/{chunk-GFAZPSWK.mjs → suggestions-leaf-3Y6MR6OF.mjs} +441 -119
- package/dist/browser/worker-copies-WQCPP3TS.mjs +2750 -0
- package/dist/{capabilities-D3AoBJoF.d.ts → capabilities-BKDrry0z.d.ts} +2 -2
- package/dist/chunk-2JRERUNZ.mjs +217 -0
- package/dist/chunk-2RIS76RJ.mjs +212 -0
- package/dist/chunk-3B775F3C.mjs +252 -0
- package/dist/{chunk-24FNVRKB.mjs → chunk-3D6RZGJH.mjs} +3 -3
- package/dist/{chunk-INJYO3BU.mjs → chunk-4CAMH7FO.mjs} +1 -1
- package/dist/{chunk-U476IXKQ.mjs → chunk-4PY4JYMY.mjs} +2 -1
- package/dist/chunk-6EZW2GQL.mjs +978 -0
- package/dist/chunk-75UNINFA.mjs +271 -0
- package/dist/chunk-77AUVDQ5.mjs +7 -0
- package/dist/{chunk-JTYPJF3T.mjs → chunk-7MWYORQC.mjs} +2 -2
- package/dist/{chunk-TGP5M5R7.mjs → chunk-7T4LAYT4.mjs} +1 -1
- package/dist/{chunk-XIHUI4KB.mjs → chunk-AB27FWZM.mjs} +8 -3
- package/dist/{chunk-FUD5XSZ5.mjs → chunk-BXM7XM4G.mjs} +7 -3
- package/dist/{chunk-HJJI72X7.mjs → chunk-C7YQHCSO.mjs} +1 -1
- package/dist/{chunk-RVGRFOGN.mjs → chunk-D456ZFPQ.mjs} +2 -1
- package/dist/{chunk-KKQC526K.mjs → chunk-E2F6LZR3.mjs} +19 -21
- package/dist/{chunk-SMOOSIAW.mjs → chunk-FE3MRIBN.mjs} +104 -13
- package/dist/{chunk-KYYABCSW.mjs → chunk-FETZYCH7.mjs} +15 -1
- package/dist/{chunk-XXJZMTZT.mjs → chunk-FVZ5DB6Y.mjs} +3 -2
- package/dist/{chunk-EYD7K3H6.mjs → chunk-GF4K7IUK.mjs} +317 -120
- package/dist/chunk-GXCDWLQI.mjs +193 -0
- package/dist/{chunk-IIRIG7H5.mjs → chunk-H64YDF5M.mjs} +3 -3
- package/dist/{browser/chunk-VY5KW3HN.mjs → chunk-HOOR4CP5.mjs} +63 -7
- package/dist/chunk-IB4BYLE3.mjs +127 -0
- package/dist/{chunk-3C7MTCCI.mjs → chunk-IE3Q62QD.mjs} +2 -2
- package/dist/chunk-IH3G6SJO.mjs +40 -0
- package/dist/chunk-JV74RKCY.mjs +3041 -0
- package/dist/{chunk-ZPZ3YGXV.mjs → chunk-K67I3RF4.mjs} +261 -101
- package/dist/chunk-KLVMK3R5.mjs +47 -0
- package/dist/{chunk-5VV4R6P7.mjs → chunk-LAWIJRMJ.mjs} +4154 -2577
- package/dist/chunk-LF4GB4PO.mjs +281 -0
- package/dist/chunk-NC4QLCZC.mjs +59 -0
- package/dist/chunk-OOO54OVC.mjs +627 -0
- package/dist/chunk-OUWZKNO3.mjs +207 -0
- package/dist/{chunk-FJKKCV4D.mjs → chunk-P5YLI5ED.mjs} +343 -182
- package/dist/{chunk-4ZTHGTVX.mjs → chunk-PTTMGRG5.mjs} +9 -10
- package/dist/{react-native/chunks/chunk-DZ7H7D2C.mjs → chunk-Q3ZZH5Z7.mjs} +6 -0
- package/dist/{browser/chunk-EKMGCRSR.mjs → chunk-QBVTYY4J.mjs} +2 -9
- package/dist/{chunk-W5EB5XKI.mjs → chunk-R4CE4IVU.mjs} +341 -183
- package/dist/chunk-S2POFTLN.mjs +10 -0
- package/dist/{chunk-KJ3RTZDJ.mjs → chunk-S3BSDBF7.mjs} +10 -3
- package/dist/{chunk-4LMSZAK6.mjs → chunk-SHGN3QIF.mjs} +69 -13
- package/dist/chunk-SXIRM4MX.mjs +3549 -0
- package/dist/{chunk-TBC3XUL2.mjs → chunk-TGPKS2UM.mjs} +47 -1
- package/dist/chunk-TINW4BSH.mjs +31301 -0
- package/dist/{cold-module-VOJXMNZB.mjs → chunk-TSLV5P2J.mjs} +397 -80
- package/dist/{chunk-HHBUCIUY.mjs → chunk-TW543F33.mjs} +3 -3
- package/dist/chunk-U6B7DUQW.mjs +788 -0
- package/dist/{chunk-OQLD2BSW.mjs → chunk-V3SGPXWQ.mjs} +8 -9
- package/dist/chunk-W34VJXY7.mjs +4723 -0
- package/dist/chunk-YETKPX5M.mjs +5 -0
- package/dist/chunk-ZQ6QY42L.mjs +59 -0
- package/dist/{client-kqSMevVi.d.ts → client-CTp8RRiK.d.ts} +4 -4
- package/dist/client.d.ts +8 -8
- package/dist/client.mjs +66 -18
- package/dist/{config-B4v_Htpu.d.ts → config-PCNzWjHL.d.ts} +6 -3
- package/dist/{config-CTP01fns.d.ts → config-_WT5grSL.d.ts} +3 -3
- package/dist/core-leaf-KXFGP74A.mjs +7 -0
- package/dist/digest-leaf-KXBGKYHZ.mjs +1 -0
- package/dist/direct-executor-MKTZBR26.mjs +16 -0
- package/dist/distribution/coordinator/etcd.d.ts +2 -2
- package/dist/distribution/coordinator/etcd.mjs +7 -4
- package/dist/distribution/coordinator/in-memory.d.ts +2 -2
- package/dist/distribution/coordinator/in-memory.mjs +1 -2
- package/dist/distribution/transport/grpc.mjs +7 -2
- package/dist/distribution/transport/tcp.mjs +7 -1
- package/dist/distribution.d.ts +7 -7
- package/dist/distribution.mjs +1199 -1092
- package/dist/{browser/durability-config-TIYKW6XX.mjs → durability-config-XV4XR7Y4.mjs} +7 -3
- package/dist/embed-4H7RTBVL.mjs +221 -0
- package/dist/embeddings/openai.mjs +2 -2
- package/dist/{engine-CkPn2PWE.d.ts → engine-DBRVR_d-.d.ts} +1252 -1239
- package/dist/{browser/geo-index-OTV7VPIR.mjs → geo-index-2ZMMWWSK.mjs} +190 -93
- package/dist/{index-C4AmUnl1.d.ts → index-Ck9w5WHz.d.ts} +1 -1
- package/dist/index.browser.mjs +4 -16
- package/dist/index.d.ts +1495 -78
- package/dist/index.mjs +14 -50
- package/dist/index.react-native.mjs +11 -28
- package/dist/invalidation/filesystem.mjs +1 -2
- package/dist/languages/albanian.mjs +1 -1
- package/dist/languages/amharic.mjs +1 -1
- package/dist/languages/arabic.mjs +1 -1
- package/dist/languages/armenian.mjs +1 -1
- package/dist/languages/azerbaijani.mjs +1 -1
- package/dist/languages/bambara.mjs +1 -1
- package/dist/languages/basque.mjs +1 -1
- package/dist/languages/belarusian.mjs +1 -1
- package/dist/languages/bengali.mjs +1 -1
- package/dist/languages/bosnian.mjs +1 -1
- package/dist/languages/breton.mjs +1 -1
- package/dist/languages/bulgarian.mjs +1 -1
- package/dist/languages/burmese.mjs +1 -1
- package/dist/languages/catalan.mjs +1 -1
- package/dist/languages/chinese.mjs +1 -1
- package/dist/languages/croatian.mjs +1 -1
- package/dist/languages/czech.mjs +1 -1
- package/dist/languages/dagbani.mjs +1 -1
- package/dist/languages/danish.mjs +1 -1
- package/dist/languages/dutch.mjs +1 -1
- package/dist/languages/english.mjs +1 -1
- package/dist/languages/esperanto.mjs +1 -1
- package/dist/languages/estonian.mjs +1 -1
- package/dist/languages/ewe.mjs +1 -1
- package/dist/languages/faroese.mjs +1 -1
- package/dist/languages/fijian.mjs +1 -1
- package/dist/languages/finnish.mjs +1 -1
- package/dist/languages/french.mjs +1 -1
- package/dist/languages/ga.mjs +1 -1
- package/dist/languages/galician.mjs +1 -1
- package/dist/languages/georgian.mjs +1 -1
- package/dist/languages/german.mjs +1 -1
- package/dist/languages/greek.mjs +1 -1
- package/dist/languages/guarani.mjs +1 -1
- package/dist/languages/gujarati.mjs +1 -1
- package/dist/languages/haitian-creole.mjs +1 -1
- package/dist/languages/hausa.mjs +1 -1
- package/dist/languages/hawaiian.mjs +1 -1
- package/dist/languages/hebrew.mjs +1 -1
- package/dist/languages/hindi.mjs +1 -1
- package/dist/languages/hungarian.mjs +1 -1
- package/dist/languages/icelandic.mjs +1 -1
- package/dist/languages/igbo.mjs +1 -1
- package/dist/languages/indonesian.mjs +1 -1
- package/dist/languages/irish.mjs +1 -1
- package/dist/languages/italian.mjs +1 -1
- package/dist/languages/japanese.mjs +1 -1
- package/dist/languages/kannada.mjs +1 -1
- package/dist/languages/kazakh.mjs +1 -1
- package/dist/languages/khmer.mjs +1 -1
- package/dist/languages/kinyarwanda.mjs +1 -1
- package/dist/languages/kirundi.mjs +1 -1
- package/dist/languages/korean.mjs +1 -1
- package/dist/languages/kurmanji.mjs +1 -1
- package/dist/languages/kyrgyz.mjs +1 -1
- package/dist/languages/lao.mjs +1 -1
- package/dist/languages/latin.mjs +1 -1
- package/dist/languages/latvian.mjs +1 -1
- package/dist/languages/lingala.mjs +1 -1
- package/dist/languages/lithuanian.mjs +1 -1
- package/dist/languages/luxembourgish.mjs +1 -1
- package/dist/languages/macedonian.mjs +1 -1
- package/dist/languages/malagasy.mjs +1 -1
- package/dist/languages/malay.mjs +1 -1
- package/dist/languages/malayalam.mjs +1 -1
- package/dist/languages/maltese.mjs +1 -1
- package/dist/languages/maori.mjs +1 -1
- package/dist/languages/marathi.mjs +1 -1
- package/dist/languages/nepali.mjs +1 -1
- package/dist/languages/norwegian.mjs +1 -1
- package/dist/languages/oromo.mjs +1 -1
- package/dist/languages/persian.mjs +1 -1
- package/dist/languages/polish.mjs +1 -1
- package/dist/languages/portuguese.mjs +1 -1
- package/dist/languages/punjabi.mjs +1 -1
- package/dist/languages/romanian.mjs +1 -1
- package/dist/languages/russian.mjs +1 -1
- package/dist/languages/samoan.mjs +1 -1
- package/dist/languages/sanskrit.mjs +1 -1
- package/dist/languages/scottish-gaelic.mjs +1 -1
- package/dist/languages/serbian.mjs +1 -1
- package/dist/languages/shona.mjs +1 -1
- package/dist/languages/sinhala.mjs +1 -1
- package/dist/languages/slovak.mjs +1 -1
- package/dist/languages/slovenian.mjs +1 -1
- package/dist/languages/sorani.mjs +1 -1
- package/dist/languages/spanish.mjs +1 -1
- package/dist/languages/swahili.mjs +1 -1
- package/dist/languages/swedish.mjs +1 -1
- package/dist/languages/tagalog.mjs +1 -1
- package/dist/languages/tamil.mjs +1 -1
- package/dist/languages/tatar.mjs +1 -1
- package/dist/languages/telugu.mjs +1 -1
- package/dist/languages/thai.mjs +1 -1
- package/dist/languages/tibetan.mjs +1 -1
- package/dist/languages/tigrinya.mjs +1 -1
- package/dist/languages/tongan.mjs +1 -1
- package/dist/languages/turkish.mjs +1 -1
- package/dist/languages/twi.mjs +1 -1
- package/dist/languages/ukrainian.mjs +1 -1
- package/dist/languages/urdu.mjs +1 -1
- package/dist/languages/vietnamese.mjs +1 -1
- package/dist/languages/welsh.mjs +1 -1
- package/dist/languages/wolof.mjs +1 -1
- package/dist/languages/xhosa.mjs +1 -1
- package/dist/languages/yoruba.mjs +1 -1
- package/dist/languages/zulu.mjs +1 -1
- package/dist/{long-query-thread-QDFQSJD6.mjs → long-query-thread-JMGNGF6V.mjs} +74 -58
- package/dist/{module-N55W4Q5C.mjs → module-ZJ6ARG6V.mjs} +444 -111
- package/dist/msgpack-leaf-5WFRP6JM.mjs +9 -0
- package/dist/optional-reads-BR3BOVZW.mjs +3373 -0
- package/dist/optional-writes-DDFHYUOH.mjs +218 -0
- package/dist/{paged-partition-archive-RLRGOXDX.mjs → paged-partition-archive-G576XGVE.mjs} +29 -69
- package/dist/partial-words.browser.mjs +1649 -0
- package/dist/partial-words.mjs +15 -14
- package/dist/{chunk-CITFCZKF.mjs → pattern.browser.mjs} +153 -186
- package/dist/pattern.mjs +6 -8
- package/dist/persistence/durability/checkpoint-worker.d.ts +32 -24
- package/dist/persistence/durability/checkpoint-worker.mjs +27 -59
- package/dist/phrase-module-XK3T44VU.mjs +634 -0
- package/dist/query-actions-OMXJEC2J.mjs +118 -0
- package/dist/query-suggestions/merge-worker.mjs +18 -54
- package/dist/query-suggestions.browser.mjs +26 -227
- package/dist/query-suggestions.d.ts +2 -2
- package/dist/query-suggestions.mjs +16 -67
- package/dist/react-native/chunks/chunk-4EXKQ2IB.mjs +565 -0
- package/dist/react-native/chunks/chunk-52QD7CBJ.mjs +52 -0
- package/dist/react-native/chunks/chunk-72OKYHZL.mjs +969 -0
- package/dist/react-native/chunks/chunk-AQOWRH2C.mjs +802 -0
- package/dist/react-native/chunks/{chunk-4COWCEY7.mjs → chunk-FTQ7JNMU.mjs} +341 -180
- package/dist/react-native/chunks/chunk-G3CUQ333.mjs +42 -0
- package/dist/react-native/chunks/{chunk-EJ33LCHV.mjs → chunk-HRDMIQ63.mjs} +53 -1
- package/dist/react-native/chunks/{chunk-4AV5PPH6.mjs → chunk-IY6U6HRA.mjs} +63 -7
- package/dist/react-native/chunks/chunk-J2NQW353.mjs +212 -0
- package/dist/react-native/chunks/chunk-L4R5ITVG.mjs +29047 -0
- package/dist/react-native/chunks/{chunk-OXM66LO6.mjs → chunk-OK3WUA6N.mjs} +2 -10
- package/dist/react-native/chunks/{chunk-MVXELMJX.mjs → chunk-PVMEHBQO.mjs} +1 -1
- package/dist/{browser/chunk-SRMZXJSL.mjs → react-native/chunks/chunk-TQ26BKBH.mjs} +6 -0
- package/dist/{browser/chunk-GPPOG6PT.mjs → react-native/chunks/chunk-VUJCSQG5.mjs} +3 -1
- package/dist/react-native/chunks/{chunk-ENLMYKSX.mjs → chunk-XEGKQKLY.mjs} +5385 -3114
- package/dist/react-native/chunks/chunk-YOTP2FPE.mjs +232 -0
- package/dist/react-native/chunks/chunk-ZIU6TWXG.mjs +127 -0
- package/dist/react-native/chunks/core-leaf-5B4JXCVA.mjs +6 -0
- package/dist/react-native/chunks/digest-leaf-X6OIFDIU.mjs +1 -0
- package/dist/{durability-config-GE4U7MCZ.mjs → react-native/chunks/durability-config-3IOXIPYZ.mjs} +7 -3
- package/dist/react-native/chunks/embed-3WQ2CCR5.mjs +221 -0
- package/dist/{geo-index-MRH5JMIR.mjs → react-native/chunks/geo-index-QEYKEVPH.mjs} +190 -93
- package/dist/react-native/chunks/{chunk-CKNRFDTZ.mjs → gzip.react-native-DLO4WW27.mjs} +2 -1
- package/dist/{browser/module-TCT66FWA.mjs → react-native/chunks/module-VUA27HZZ.mjs} +1018 -540
- package/dist/react-native/chunks/msgpack-leaf-TR66ZVAX.mjs +7 -0
- package/dist/react-native/chunks/optional-reads-WDTLLHUT.mjs +3364 -0
- package/dist/react-native/chunks/optional-writes-FZV3QW34.mjs +267 -0
- package/dist/react-native/chunks/phrase-module-KCQWVXYZ.mjs +635 -0
- package/dist/react-native/chunks/resolve-vector-text-LXRYXF7M.mjs +59 -0
- package/dist/react-native/chunks/restore-queue-EI2V2I4S.mjs +179 -0
- package/dist/{browser/runtime-OTAGEFQW.mjs → react-native/chunks/runtime-BUCSAK4U.mjs} +61 -25
- package/dist/react-native/chunks/segment-codec-leaf-6ULP7H3I.mjs +12 -0
- package/dist/react-native/chunks/segment-merge-leaf-F4GQZNK6.mjs +13 -0
- package/dist/react-native/chunks/storage-leaf-OAXBU2L6.mjs +18042 -0
- package/dist/react-native/chunks/store-leaf-GY2ZZFXB.mjs +14 -0
- package/dist/react-native/chunks/{chunk-WW2X2AEI.mjs → suggestions-leaf-SQEZ4IBS.mjs} +332 -118
- package/dist/react-native/chunks/worker-copies-EEHSCFJW.mjs +2627 -0
- package/dist/react-native/partial-words.mjs +954 -35
- package/dist/react-native/pattern.mjs +238 -111
- package/dist/react-native/query-suggestions.mjs +33 -239
- package/dist/react-native/sync.mjs +95 -52
- package/dist/react-native/synonyms.mjs +256 -112
- package/dist/react.d.ts +9 -9
- package/dist/react.mjs +6 -0
- package/dist/{rerank-MQ37IYRV.mjs → rerank-Y6MWBMTT.mjs} +17 -8
- package/dist/rerankers/http.mjs +2 -2
- package/dist/resolve-vector-text-4PDRTPNQ.mjs +2 -0
- package/dist/restore-queue-KPYSRJ4A.mjs +184 -0
- package/dist/runtime-4GKUIAKV.mjs +595 -0
- package/dist/{schema-Jwt928nJ.d.ts → schema-C_7yRJLt.d.ts} +1 -1
- package/dist/segment-codec-leaf-6IFBSBPN.mjs +17 -0
- package/dist/segment-merge-leaf-VE3FUSVE.mjs +17 -0
- package/dist/server.d.ts +33 -13
- package/dist/server.mjs +81 -100
- package/dist/{browser/durability-wiring-GVZEE46O.mjs → storage-leaf-HMIIOUYN.mjs} +2334 -931
- package/dist/store-leaf-M7T7SUZJ.mjs +19 -0
- package/dist/stored-values-BWIMpiT_.d.ts +25 -0
- package/dist/suggestions-leaf-Q3Q5D6XV.mjs +53 -0
- package/dist/sync/filesystem.d.ts +3 -3
- package/dist/sync/filesystem.mjs +27 -11
- package/dist/sync/indexeddb.browser.mjs +287 -0
- package/dist/sync/indexeddb.d.ts +3 -3
- package/dist/sync/indexeddb.mjs +7 -2
- package/dist/sync.browser.mjs +88 -72
- package/dist/sync.d.ts +4 -4
- package/dist/sync.mjs +89 -59
- package/dist/{chunk-I5B7RXU7.mjs → synonyms.browser.mjs} +248 -135
- package/dist/synonyms.mjs +15 -11
- package/dist/{tasks-CoNjxbop.d.ts → tasks-B4tT4vmP.d.ts} +4 -4
- package/dist/thread-SNILJXX3.mjs +30 -0
- package/dist/{types-DPMjfOr_.d.ts → types-CTg0KaMy.d.ts} +2 -2
- package/dist/vector/search-worker.d.ts +7 -1
- package/dist/vector/search-worker.mjs +9 -13
- package/dist/worker-copies-ZLZS2CUM.mjs +2152 -0
- package/dist/workers/entry.mjs +60 -30
- package/openapi.json +66 -50
- package/package.json +233 -8
- package/dist/analysis-change-CKEMM2MC.mjs +0 -55
- package/dist/analysis-change-entry-SEDMJ6MW.mjs +0 -1
- package/dist/archive-history-E4R73RWD.mjs +0 -29
- package/dist/browser/analysis-change-ZKGJFENM.mjs +0 -942
- package/dist/browser/analysis-change-entry-5BFUVMHJ.mjs +0 -1
- package/dist/browser/archive-history-4IP5XQZY.mjs +0 -29
- package/dist/browser/chunk-25MTVDYD.mjs +0 -432
- package/dist/browser/chunk-3I27KXQD.mjs +0 -34
- package/dist/browser/chunk-3NLMB5CC.mjs +0 -217
- package/dist/browser/chunk-4RD3AFSB.mjs +0 -32
- package/dist/browser/chunk-5W3MMTLG.mjs +0 -19
- package/dist/browser/chunk-5YWB3E2W.mjs +0 -92
- package/dist/browser/chunk-7IGKGWSQ.mjs +0 -79
- package/dist/browser/chunk-AI5UI46D.mjs +0 -12
- package/dist/browser/chunk-ATEBYXP6.mjs +0 -10
- package/dist/browser/chunk-BLT4RHCJ.mjs +0 -241
- package/dist/browser/chunk-C26SPCGQ.mjs +0 -2636
- package/dist/browser/chunk-C4FJ3WDY.mjs +0 -177
- package/dist/browser/chunk-CXNTHHA7.mjs +0 -63
- package/dist/browser/chunk-DSXIBE6N.mjs +0 -78
- package/dist/browser/chunk-DUH6QUVU.mjs +0 -2374
- package/dist/browser/chunk-ELV4OZOI.mjs +0 -29
- package/dist/browser/chunk-EXQZGUQH.mjs +0 -193
- package/dist/browser/chunk-G64Q6OJF.mjs +0 -96
- package/dist/browser/chunk-HOZW3PKP.mjs +0 -9
- package/dist/browser/chunk-HUCSHDTB.mjs +0 -100
- package/dist/browser/chunk-JPTQZWJQ.mjs +0 -10
- package/dist/browser/chunk-K3IPRX6D.mjs +0 -2559
- package/dist/browser/chunk-ML7THVLJ.mjs +0 -38
- package/dist/browser/chunk-MY2XKH22.mjs +0 -40
- package/dist/browser/chunk-NLWTBAGB.mjs +0 -111
- package/dist/browser/chunk-NXQG7DRA.mjs +0 -318
- package/dist/browser/chunk-OEDCEZXJ.mjs +0 -92
- package/dist/browser/chunk-OIZS5KIX.mjs +0 -6
- package/dist/browser/chunk-RA6LSBCM.mjs +0 -43
- package/dist/browser/chunk-TK63WFXK.mjs +0 -90
- package/dist/browser/chunk-TY7L6OXO.mjs +0 -69
- package/dist/browser/chunk-U3JOQGWX.mjs +0 -19
- package/dist/browser/chunk-U4YDIBUT.mjs +0 -653
- package/dist/browser/chunk-UATIJ4KU.mjs +0 -21
- package/dist/browser/chunk-UKOWD2K5.mjs +0 -315
- package/dist/browser/chunk-UTMHUHUV.mjs +0 -150
- package/dist/browser/chunk-V43N6TZO.mjs +0 -857
- package/dist/browser/chunk-VI7BQR4U.mjs +0 -21
- package/dist/browser/chunk-WN464PTL.mjs +0 -375
- package/dist/browser/chunk-WXLBZJMT.mjs +0 -25
- package/dist/browser/chunk-X7TXYUKO.mjs +0 -86
- package/dist/browser/chunk-XAWNZ4G2.mjs +0 -151
- package/dist/browser/chunk-Y6IBAUNO.mjs +0 -561
- package/dist/browser/chunk-ZI2V4VD7.mjs +0 -21
- package/dist/browser/cold-module-YNUUDNOM.mjs +0 -761
- package/dist/browser/engine-hooks-HBVS6YM4.mjs +0 -18
- package/dist/browser/gzip-5S7ROJFJ.mjs +0 -1
- package/dist/browser/import-5ESVMFDJ.mjs +0 -20
- package/dist/browser/methods-KTQCSIN4.mjs +0 -30
- package/dist/browser/module-NDSQLPMQ.mjs +0 -25
- package/dist/browser/operations-OJ3BXS55.mjs +0 -5
- package/dist/browser/phrase-module-HAT3TLZN.mjs +0 -328
- package/dist/browser/pool-3JLET5RO.mjs +0 -297
- package/dist/browser/release-HYXPVJVS.mjs +0 -32
- package/dist/browser/restore-queue-LQBBTODR.mjs +0 -55
- package/dist/browser/retention-TY3L3BFN.mjs +0 -211
- package/dist/browser/snapshot-5FHPPCNZ.mjs +0 -965
- package/dist/browser/start-2UZTOBG5.mjs +0 -26
- package/dist/browser/sync-state-P5XG6LTQ.mjs +0 -15
- package/dist/browser/write-ULXAN5B4.mjs +0 -196
- package/dist/chunk-2NE7VCYE.mjs +0 -212
- package/dist/chunk-2ROUFMQX.mjs +0 -543
- package/dist/chunk-37CD3OKS.mjs +0 -87
- package/dist/chunk-3MXV3VHR.mjs +0 -46
- package/dist/chunk-3OH67G7R.mjs +0 -214
- package/dist/chunk-4B7JIGQD.mjs +0 -106
- package/dist/chunk-5YNRKI2C.mjs +0 -81
- package/dist/chunk-6HTGOXIK.mjs +0 -875
- package/dist/chunk-6OEGXLBX.mjs +0 -57
- package/dist/chunk-6RC4K46J.mjs +0 -86
- package/dist/chunk-7GFE3PEY.mjs +0 -40
- package/dist/chunk-7GXJUJ24.mjs +0 -49
- package/dist/chunk-7V5IUP2T.mjs +0 -63
- package/dist/chunk-A4L7YTKX.mjs +0 -458
- package/dist/chunk-BEZH7VEH.mjs +0 -23
- package/dist/chunk-BNL5OPRV.mjs +0 -634
- package/dist/chunk-BTPGQC6Z.mjs +0 -27
- package/dist/chunk-C7XQYG6U.mjs +0 -50
- package/dist/chunk-CQZXZ75V.mjs +0 -562
- package/dist/chunk-CWS55TEX.mjs +0 -242
- package/dist/chunk-CZQ33DLW.mjs +0 -78
- package/dist/chunk-EEBCDP36.mjs +0 -32
- package/dist/chunk-FB6463IN.mjs +0 -1499
- package/dist/chunk-FCJ553HS.mjs +0 -655
- package/dist/chunk-FEZVDOWX.mjs +0 -6996
- package/dist/chunk-FOCV4CBZ.mjs +0 -87
- package/dist/chunk-FQBFZAWG.mjs +0 -27
- package/dist/chunk-G6HRSGOU.mjs +0 -74
- package/dist/chunk-GES7U2PM.mjs +0 -68
- package/dist/chunk-GH4WQ22V.mjs +0 -34
- package/dist/chunk-GPWMUPCA.mjs +0 -1126
- package/dist/chunk-GQPTDQCL.mjs +0 -54
- package/dist/chunk-HJSN7UYG.mjs +0 -10
- package/dist/chunk-I54T6CQP.mjs +0 -117
- package/dist/chunk-IPN7S4KX.mjs +0 -130
- package/dist/chunk-J4IJTTEX.mjs +0 -226
- package/dist/chunk-JSV6OQ4C.mjs +0 -74
- package/dist/chunk-K4ZIGL2O.mjs +0 -290
- package/dist/chunk-KAKQ74LS.mjs +0 -53
- package/dist/chunk-KCQYFO4K.mjs +0 -62
- package/dist/chunk-KHKIRS5D.mjs +0 -113
- package/dist/chunk-KOKM4PQN.mjs +0 -52
- package/dist/chunk-KP7TYHWT.mjs +0 -92
- package/dist/chunk-KZ3NX2P7.mjs +0 -21
- package/dist/chunk-L5ORED7V.mjs +0 -25
- package/dist/chunk-LDNCLRZU.mjs +0 -218
- package/dist/chunk-LHKOSI2J.mjs +0 -58
- package/dist/chunk-LQG5G2LY.mjs +0 -39
- package/dist/chunk-MATMVH65.mjs +0 -9
- package/dist/chunk-MP7ABPTD.mjs +0 -189
- package/dist/chunk-MW6BR4QP.mjs +0 -316
- package/dist/chunk-MWD5VPN7.mjs +0 -21
- package/dist/chunk-ODYKO5TO.mjs +0 -101
- package/dist/chunk-OG7UGJ6F.mjs +0 -63
- package/dist/chunk-ORN5BLL7.mjs +0 -11
- package/dist/chunk-OYABFKTW.mjs +0 -1974
- package/dist/chunk-P5LANSH6.mjs +0 -121
- package/dist/chunk-PELHVTO7.mjs +0 -24
- package/dist/chunk-PIH5SJ4N.mjs +0 -7481
- package/dist/chunk-PSZI4O24.mjs +0 -253
- package/dist/chunk-PV2CG7EJ.mjs +0 -886
- package/dist/chunk-PWGYQXML.mjs +0 -470
- package/dist/chunk-Q2UL2TPC.mjs +0 -21
- package/dist/chunk-QHPYS427.mjs +0 -66
- package/dist/chunk-QJVOLKU6.mjs +0 -111
- package/dist/chunk-QLDABJZM.mjs +0 -20
- package/dist/chunk-QYRNLLLI.mjs +0 -99
- package/dist/chunk-RCX4WNLC.mjs +0 -151
- package/dist/chunk-RFBLQLLZ.mjs +0 -16
- package/dist/chunk-RIHIVFIQ.mjs +0 -240
- package/dist/chunk-RLOES5SX.mjs +0 -31
- package/dist/chunk-RWURUDSP.mjs +0 -2639
- package/dist/chunk-RZWWB2XR.mjs +0 -96
- package/dist/chunk-S5LN746F.mjs +0 -10
- package/dist/chunk-SOI6LTHM.mjs +0 -216
- package/dist/chunk-SQJWAIF4.mjs +0 -12
- package/dist/chunk-TDIK6NTV.mjs +0 -10
- package/dist/chunk-TQXHPFWT.mjs +0 -177
- package/dist/chunk-U55XJEIG.mjs +0 -18
- package/dist/chunk-UD5HIS4U.mjs +0 -382
- package/dist/chunk-UHICS3JI.mjs +0 -83
- package/dist/chunk-UJDJB3NE.mjs +0 -913
- package/dist/chunk-VD7J552I.mjs +0 -28
- package/dist/chunk-VSLSGASN.mjs +0 -30
- package/dist/chunk-VZ2ONHEE.mjs +0 -3715
- package/dist/chunk-W7OSSKH5.mjs +0 -1427
- package/dist/chunk-WZ7YV54N.mjs +0 -152
- package/dist/chunk-X5CV2E2B.mjs +0 -1
- package/dist/chunk-Y4WPNHMC.mjs +0 -50
- package/dist/chunk-YEKL4JBK.mjs +0 -96
- package/dist/chunk-ZXNQEW43.mjs +0 -18
- package/dist/chunk-ZYAY26KG.mjs +0 -29
- package/dist/direct-executor-V5DRIECI.mjs +0 -34
- package/dist/durability-wiring-3TD62MBI.mjs +0 -4072
- package/dist/engine-hooks-HA3SBOBR.mjs +0 -54
- package/dist/gzip-F4HMIEEQ.mjs +0 -1
- package/dist/import-GPKLTSKA.mjs +0 -56
- package/dist/methods-7IOINERF.mjs +0 -30
- package/dist/module-JYHFTVPS.mjs +0 -63
- package/dist/operations-G5EP6JPX.mjs +0 -5
- package/dist/phrase-module-XW5MKWP5.mjs +0 -330
- package/dist/pool-Y4A46T36.mjs +0 -298
- package/dist/react-native/chunks/analysis-change-QUVDNABS.mjs +0 -934
- package/dist/react-native/chunks/analysis-change-entry-OC4XASBF.mjs +0 -1
- package/dist/react-native/chunks/archive-history-MJKUQLSU.mjs +0 -29
- package/dist/react-native/chunks/chunk-2PRHILX3.mjs +0 -529
- package/dist/react-native/chunks/chunk-3NQOVO3K.mjs +0 -1
- package/dist/react-native/chunks/chunk-3WI35N75.mjs +0 -226
- package/dist/react-native/chunks/chunk-4DII3ZSM.mjs +0 -73
- package/dist/react-native/chunks/chunk-4J74WHQM.mjs +0 -177
- package/dist/react-native/chunks/chunk-4NWR3NGS.mjs +0 -151
- package/dist/react-native/chunks/chunk-5CQX3XXV.mjs +0 -17
- package/dist/react-native/chunks/chunk-5MSX5FRT.mjs +0 -858
- package/dist/react-native/chunks/chunk-6OFDUYVX.mjs +0 -92
- package/dist/react-native/chunks/chunk-6VBXNFLE.mjs +0 -9
- package/dist/react-native/chunks/chunk-6ZELFCK5.mjs +0 -315
- package/dist/react-native/chunks/chunk-AAAETEJK.mjs +0 -27
- package/dist/react-native/chunks/chunk-AM7RSBPF.mjs +0 -32
- package/dist/react-native/chunks/chunk-BITYFZSZ.mjs +0 -242
- package/dist/react-native/chunks/chunk-C5G6TJ7A.mjs +0 -140
- package/dist/react-native/chunks/chunk-CHPTFFJM.mjs +0 -43
- package/dist/react-native/chunks/chunk-DIYDOIM4.mjs +0 -10
- package/dist/react-native/chunks/chunk-DMIFXZ3Q.mjs +0 -432
- package/dist/react-native/chunks/chunk-DVDX4SDR.mjs +0 -375
- package/dist/react-native/chunks/chunk-DXRSEWA2.mjs +0 -12
- package/dist/react-native/chunks/chunk-F753DA54.mjs +0 -23
- package/dist/react-native/chunks/chunk-FHPW7P2O.mjs +0 -40
- package/dist/react-native/chunks/chunk-FTZHMRD2.mjs +0 -18
- package/dist/react-native/chunks/chunk-HJBJBH26.mjs +0 -34
- package/dist/react-native/chunks/chunk-IAENKE2D.mjs +0 -21
- package/dist/react-native/chunks/chunk-IO2SMUQD.mjs +0 -10
- package/dist/react-native/chunks/chunk-IYNT75CE.mjs +0 -111
- package/dist/react-native/chunks/chunk-JDOEEMEF.mjs +0 -38
- package/dist/react-native/chunks/chunk-JWUCMVRK.mjs +0 -15
- package/dist/react-native/chunks/chunk-KSBYEMCB.mjs +0 -100
- package/dist/react-native/chunks/chunk-KU646XXT.mjs +0 -164
- package/dist/react-native/chunks/chunk-LU3Y3P63.mjs +0 -68
- package/dist/react-native/chunks/chunk-LVIKKAA6.mjs +0 -93
- package/dist/react-native/chunks/chunk-LZSLNSUN.mjs +0 -193
- package/dist/react-native/chunks/chunk-MJDQU5MW.mjs +0 -1225
- package/dist/react-native/chunks/chunk-NNE4VDMM.mjs +0 -8
- package/dist/react-native/chunks/chunk-NVVRSRX5.mjs +0 -78
- package/dist/react-native/chunks/chunk-OCSLSH27.mjs +0 -22723
- package/dist/react-native/chunks/chunk-PB2YXVQW.mjs +0 -29
- package/dist/react-native/chunks/chunk-PJHAB5ZY.mjs +0 -79
- package/dist/react-native/chunks/chunk-PSWKQVVT.mjs +0 -9
- package/dist/react-native/chunks/chunk-RDWG33MM.mjs +0 -79
- package/dist/react-native/chunks/chunk-SK2PWYDH.mjs +0 -654
- package/dist/react-native/chunks/chunk-SUPXRTMD.mjs +0 -96
- package/dist/react-native/chunks/chunk-TORU2OHQ.mjs +0 -218
- package/dist/react-native/chunks/chunk-U4KSKA4Z.mjs +0 -23
- package/dist/react-native/chunks/chunk-UNUFZ2QY.mjs +0 -68
- package/dist/react-native/chunks/chunk-WBYQRHDY.mjs +0 -86
- package/dist/react-native/chunks/chunk-WVWJNUMN.mjs +0 -2562
- package/dist/react-native/chunks/chunk-YH7QY657.mjs +0 -288
- package/dist/react-native/chunks/chunk-YZW4CHM6.mjs +0 -562
- package/dist/react-native/chunks/chunk-ZNZ6CPAZ.mjs +0 -562
- package/dist/react-native/chunks/chunk-ZVQMBF2H.mjs +0 -63
- package/dist/react-native/chunks/chunk-ZWAIN4GG.mjs +0 -2636
- package/dist/react-native/chunks/chunk-ZZT7CEN7.mjs +0 -92
- package/dist/react-native/chunks/cold-module-N6KFNNZA.mjs +0 -773
- package/dist/react-native/chunks/durability-wiring-RN64S2TL.mjs +0 -4984
- package/dist/react-native/chunks/engine-hooks-CWA5CKCA.mjs +0 -30
- package/dist/react-native/chunks/gzip.react-native-HLEPDKZ3.mjs +0 -3
- package/dist/react-native/chunks/import-5UAWBRJP.mjs +0 -32
- package/dist/react-native/chunks/methods-6W5U4C3H.mjs +0 -30
- package/dist/react-native/chunks/module-6RP4ZCBW.mjs +0 -37
- package/dist/react-native/chunks/operations-GNRMD6EX.mjs +0 -5
- package/dist/react-native/chunks/phrase-module-QK22HSQ2.mjs +0 -329
- package/dist/react-native/chunks/pool-JR3NJCAF.mjs +0 -297
- package/dist/react-native/chunks/release-2SIHZWDO.mjs +0 -32
- package/dist/react-native/chunks/restore-hooks-ENFMDTWC.mjs +0 -127
- package/dist/react-native/chunks/restore-queue-4R6AASE5.mjs +0 -55
- package/dist/react-native/chunks/retention-5GTFT3GR.mjs +0 -223
- package/dist/react-native/chunks/snapshot-5LGPQXFS.mjs +0 -976
- package/dist/react-native/chunks/start-ZQJVZ5DN.mjs +0 -38
- package/dist/react-native/chunks/sync-state-PASCIHHT.mjs +0 -15
- package/dist/react-native/chunks/write-6BRYIIZ7.mjs +0 -208
- package/dist/release-SMR4WJD4.mjs +0 -32
- package/dist/restore-hooks-HXLIEB4A.mjs +0 -153
- package/dist/restore-queue-LZH7LMLR.mjs +0 -55
- package/dist/retention-3K7ARGAG.mjs +0 -66
- package/dist/runtime-COIUORCN.mjs +0 -177
- package/dist/snapshot-O7ICP7NJ.mjs +0 -783
- package/dist/start-S4PFP6RS.mjs +0 -66
- package/dist/sync-state-ZWHLAFLE.mjs +0 -15
- package/dist/thread-YLJ3ZPQ3.mjs +0 -50
- package/dist/write-2OBJGLFS.mjs +0 -233
- /package/dist/browser/{chunk-M3MQE2X7.mjs → digest-leaf-64IPRPZD.mjs} +0 -0
- /package/dist/browser/{chunk-JNOAKDUM.mjs → gzip-JF3S6PPT.mjs} +0 -0
- /package/dist/{chunk-ZXNNR73R.mjs → gzip-2UCZW2MM.mjs} +0 -0
|
@@ -1,74 +1,14 @@
|
|
|
1
|
-
import { readWholeSectionChecked, checkEverySectionPage, readFileRange, openPagedFile, readCacheOfThisThread, createSectionReader, closePagedFile } from './chunk-
|
|
2
|
-
|
|
3
|
-
import './chunk-
|
|
4
|
-
import './chunk-
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import './chunk-
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
import { stageQueryLevels, readTrailer } from './chunk-37CD3OKS.mjs';
|
|
11
|
-
import { COLD_LOAD_WAIT_WITHOUT_SEARCH_MS, COLD_WALK_NODES_READ_AHEAD } from './chunk-BNL5OPRV.mjs';
|
|
12
|
-
import './chunk-CQZXZ75V.mjs';
|
|
13
|
-
import './chunk-UHICS3JI.mjs';
|
|
14
|
-
import './chunk-KCQYFO4K.mjs';
|
|
15
|
-
import './chunk-JTYPJF3T.mjs';
|
|
16
|
-
import './chunk-QDZJM7NI.mjs';
|
|
17
|
-
import { yieldToEventLoop } from './chunk-FEZVDOWX.mjs';
|
|
18
|
-
import './chunk-OYABFKTW.mjs';
|
|
19
|
-
import './chunk-HJSN7UYG.mjs';
|
|
20
|
-
import './chunk-LHKOSI2J.mjs';
|
|
21
|
-
import './chunk-XIHUI4KB.mjs';
|
|
22
|
-
import './chunk-3MXV3VHR.mjs';
|
|
23
|
-
import './chunk-EEBCDP36.mjs';
|
|
24
|
-
import './chunk-VZ2ONHEE.mjs';
|
|
25
|
-
import './chunk-PIH5SJ4N.mjs';
|
|
26
|
-
import './chunk-GH4WQ22V.mjs';
|
|
27
|
-
import { HEADER_SIZE, readHeader } from './chunk-3OH67G7R.mjs';
|
|
28
|
-
import './chunk-IPN7S4KX.mjs';
|
|
29
|
-
import './chunk-KAKQ74LS.mjs';
|
|
30
|
-
import { crc32 } from './chunk-7GXJUJ24.mjs';
|
|
31
|
-
import './chunk-Q2UL2TPC.mjs';
|
|
32
|
-
import './chunk-CITFCZKF.mjs';
|
|
33
|
-
import './chunk-RLOES5SX.mjs';
|
|
34
|
-
import './chunk-PV2CG7EJ.mjs';
|
|
35
|
-
import './chunk-FQBFZAWG.mjs';
|
|
36
|
-
import './chunk-W5EB5XKI.mjs';
|
|
37
|
-
import './chunk-SQJWAIF4.mjs';
|
|
38
|
-
import './chunk-GES7U2PM.mjs';
|
|
39
|
-
import './chunk-I54T6CQP.mjs';
|
|
40
|
-
import './chunk-I5B7RXU7.mjs';
|
|
41
|
-
import './chunk-Y4WPNHMC.mjs';
|
|
42
|
-
import './chunk-RZWWB2XR.mjs';
|
|
43
|
-
import './chunk-TGP5M5R7.mjs';
|
|
44
|
-
import './chunk-G6HRSGOU.mjs';
|
|
45
|
-
import './chunk-U2BKYEC7.mjs';
|
|
46
|
-
import './chunk-6HTGOXIK.mjs';
|
|
47
|
-
import './chunk-QHPYS427.mjs';
|
|
48
|
-
import './chunk-QYRNLLLI.mjs';
|
|
49
|
-
import './chunk-TDIK6NTV.mjs';
|
|
50
|
-
import './chunk-FB6463IN.mjs';
|
|
51
|
-
import './chunk-7GFE3PEY.mjs';
|
|
52
|
-
import './chunk-ZXNQEW43.mjs';
|
|
53
|
-
import './chunk-7V5IUP2T.mjs';
|
|
54
|
-
import './chunk-L5ORED7V.mjs';
|
|
55
|
-
import './chunk-X5CV2E2B.mjs';
|
|
56
|
-
import './chunk-A4L7YTKX.mjs';
|
|
57
|
-
import './chunk-U55XJEIG.mjs';
|
|
58
|
-
import './chunk-KOKM4PQN.mjs';
|
|
59
|
-
import './chunk-ORN5BLL7.mjs';
|
|
60
|
-
import './chunk-BTPGQC6Z.mjs';
|
|
61
|
-
import './chunk-LQG5G2LY.mjs';
|
|
62
|
-
import './chunk-ZXX5GZEX.mjs';
|
|
63
|
-
import './chunk-RFBLQLLZ.mjs';
|
|
64
|
-
import './chunk-KKQC526K.mjs';
|
|
65
|
-
import './chunk-U476IXKQ.mjs';
|
|
66
|
-
import { NarsilError, ErrorCodes } from './chunk-MP7ABPTD.mjs';
|
|
67
|
-
import './chunk-J4IJTTEX.mjs';
|
|
68
|
-
import { compareCodePoints } from './chunk-TBC3XUL2.mjs';
|
|
69
|
-
import { decode, decodeMulti } from '@msgpack/msgpack';
|
|
1
|
+
import { loadFailed, cachedFileBytes, COLD_LOAD_WAIT_WITHOUT_SEARCH_MS, readWholeSectionChecked, checkEverySectionPage, readFileRange, openPagedFile, readCacheOfThisThread, createSectionReader, closePagedFile, COLD_GRAPH_PART_VECTORS, decodeSections, readListedFile, requireListedChecksum, requireListedSize, SEGMENT_PAGE_BYTES, RECORD_PAGE_BYTES, failNativePage, COLD_WALK_NODES_READ_AHEAD } from './chunk-U6B7DUQW.mjs';
|
|
2
|
+
import { isDead, VECTOR_FILE_PAYLOAD_VERSION, bytesToVectors, decodeVectorGraphPartPayload, assembleGraphParts, decodeVectorFilePayload, osqRecordBytes, osqBitsOf, countDead, magnitude, defaultRescoreDepth, defaultEfSearch, computeCodeBlockLayout, toScore, osqQuantize, createOsqScratch, stageQueryLevels, scalarQueryProducts, readTrailer, osqEstimate, osqDistance, toDistance, createFixedBuffer } from './chunk-LAWIJRMJ.mjs';
|
|
3
|
+
import { HEADER_SIZE, openChecksummedEnvelope, crc32, readHeader } from './chunk-6EZW2GQL.mjs';
|
|
4
|
+
import { yieldToEventLoop, compareScores } from './chunk-TINW4BSH.mjs';
|
|
5
|
+
import { decode, decodeMulti } from './chunk-GXCDWLQI.mjs';
|
|
6
|
+
import { signalOfSearch, requireSearchActive } from './chunk-OUWZKNO3.mjs';
|
|
7
|
+
import { MAX_LAYER_CAP } from './chunk-ZXX5GZEX.mjs';
|
|
8
|
+
import { NarsilError, ErrorCodes } from './chunk-Q3ZZH5Z7.mjs';
|
|
9
|
+
import { compareCodePoints } from './chunk-TGPKS2UM.mjs';
|
|
70
10
|
|
|
71
|
-
// src/persistence/paged/cold-
|
|
11
|
+
// src/persistence/paged/cold-heap.ts
|
|
72
12
|
function pushMin(heap, number, distance) {
|
|
73
13
|
let at = heap.numbers.length;
|
|
74
14
|
heap.numbers.push(number);
|
|
@@ -110,6 +50,190 @@ function popMin(heap) {
|
|
|
110
50
|
function negated(heap) {
|
|
111
51
|
return heap.distances.length === 0 ? Number.POSITIVE_INFINITY : -heap.distances[0];
|
|
112
52
|
}
|
|
53
|
+
|
|
54
|
+
// src/persistence/paged/cold-native.ts
|
|
55
|
+
var STOPPED = -7;
|
|
56
|
+
var WORK_CAP = 0x7fffffffffffffffn;
|
|
57
|
+
var UINT64_MAX = 0xffffffffffffffffn;
|
|
58
|
+
var NANOSECONDS_PER_MILLISECOND = 1e6;
|
|
59
|
+
function fieldOf(data, metric) {
|
|
60
|
+
const files = [];
|
|
61
|
+
for (const file of data.files) {
|
|
62
|
+
const vectors = file.vectors.native;
|
|
63
|
+
const records = data.codes === null ? null : file.records?.native ?? null;
|
|
64
|
+
if (vectors === null || data.codes !== null && records === null) return null;
|
|
65
|
+
files.push({ first: file.firstNumber, count: file.count, dead: file.dead, vectors, records });
|
|
66
|
+
}
|
|
67
|
+
const graphParts = [];
|
|
68
|
+
for (let at = 0; at < data.parts.length; at++) {
|
|
69
|
+
const part = data.parts[at];
|
|
70
|
+
const neighbours = part.neighbours.native;
|
|
71
|
+
if (neighbours === null) return null;
|
|
72
|
+
graphParts.push({
|
|
73
|
+
first: at * COLD_GRAPH_PART_VECTORS,
|
|
74
|
+
count: part.levels.length,
|
|
75
|
+
levels: part.levels,
|
|
76
|
+
nodeOffsets: part.nodeOffsets,
|
|
77
|
+
neighbours
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
return {
|
|
81
|
+
dimension: data.dimension,
|
|
82
|
+
metric: metric === "cosine" ? 0 : metric === "dotProduct" ? 1 : 2,
|
|
83
|
+
total: data.total,
|
|
84
|
+
entryPoint: data.graph.entryPoint,
|
|
85
|
+
maxLayer: data.graph.maxLayer,
|
|
86
|
+
codes: data.codes,
|
|
87
|
+
files,
|
|
88
|
+
graphParts
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
function admission(data, accepts) {
|
|
92
|
+
if (accepts === null) return null;
|
|
93
|
+
const mask = new Uint32Array(Math.max(1, Math.ceil(data.total / 32)));
|
|
94
|
+
for (let ordinal = 0; ordinal < data.total; ordinal++) {
|
|
95
|
+
if (!data.isDeadNumber(ordinal) && accepts(data.idAt(ordinal))) mask[ordinal >>> 5] |= 1 << (ordinal & 31);
|
|
96
|
+
}
|
|
97
|
+
return mask;
|
|
98
|
+
}
|
|
99
|
+
function excludedMask(total, excluded) {
|
|
100
|
+
if (excluded.size === 0) return null;
|
|
101
|
+
const mask = new Uint32Array(Math.max(1, Math.ceil(total / 32)));
|
|
102
|
+
for (const ordinal of excluded) {
|
|
103
|
+
if (Number.isInteger(ordinal) && ordinal >= 0 && ordinal < total) mask[ordinal >>> 5] |= 1 << (ordinal & 31);
|
|
104
|
+
}
|
|
105
|
+
return mask;
|
|
106
|
+
}
|
|
107
|
+
function reportFailure(data, status, fault) {
|
|
108
|
+
let path = "";
|
|
109
|
+
let section = fault[1].toString();
|
|
110
|
+
for (const file of data.files) {
|
|
111
|
+
if (file.file.native?.handle.identity !== fault[0]) continue;
|
|
112
|
+
path = file.file.path;
|
|
113
|
+
if (file.vectors.native?.offset === fault[1]) section = "vectors";
|
|
114
|
+
else if (file.records?.native?.offset === fault[1]) section = "records";
|
|
115
|
+
break;
|
|
116
|
+
}
|
|
117
|
+
for (const part of data.parts) {
|
|
118
|
+
if (part.file.native?.handle.identity !== fault[0]) continue;
|
|
119
|
+
path = part.file.path;
|
|
120
|
+
section = "neighbours";
|
|
121
|
+
break;
|
|
122
|
+
}
|
|
123
|
+
return failNativePage(status, path, section, fault[2]);
|
|
124
|
+
}
|
|
125
|
+
function deadlineFor(core, milliseconds) {
|
|
126
|
+
const deadline = new BigUint64Array(1);
|
|
127
|
+
if (milliseconds !== void 0) {
|
|
128
|
+
const status = core.clockNow(deadline);
|
|
129
|
+
if (status !== 0 || !Number.isFinite(milliseconds) || milliseconds < 0) {
|
|
130
|
+
throw new NarsilError(ErrorCodes.CONFIG_INVALID, "The search clock could not be read", { status });
|
|
131
|
+
}
|
|
132
|
+
const expires = deadline[0] + BigInt(Math.ceil(milliseconds * NANOSECONDS_PER_MILLISECOND));
|
|
133
|
+
deadline[0] = expires > UINT64_MAX ? UINT64_MAX : expires;
|
|
134
|
+
}
|
|
135
|
+
return deadline;
|
|
136
|
+
}
|
|
137
|
+
function prepareSearch(data, query, k, options, accepts, excluded, shared) {
|
|
138
|
+
const file = data.files[0]?.file;
|
|
139
|
+
const native = file?.native;
|
|
140
|
+
if (native === void 0 || native === null || file === void 0) return null;
|
|
141
|
+
const field = fieldOf(data, options.metric);
|
|
142
|
+
if (field === null) return null;
|
|
143
|
+
const window = options.rescoreWindow ?? k;
|
|
144
|
+
let depth = window;
|
|
145
|
+
if (data.codes !== null) {
|
|
146
|
+
depth = options.oversample === void 0 ? defaultRescoreDepth(data.codes.bits, data.dimension, window) : Math.ceil(window * options.oversample);
|
|
147
|
+
}
|
|
148
|
+
const ef = Math.max(options.efSearch ?? defaultEfSearch(data.dimension, window), depth);
|
|
149
|
+
const capacity = Math.min(data.total, ef);
|
|
150
|
+
const allocate = (bytes) => shared ? createFixedBuffer(bytes) : new ArrayBuffer(bytes);
|
|
151
|
+
const ordinals = new Uint32Array(allocate(capacity * Uint32Array.BYTES_PER_ELEMENT));
|
|
152
|
+
const scores = new Float64Array(allocate(capacity * Float64Array.BYTES_PER_ELEMENT));
|
|
153
|
+
const fault = new BigUint64Array(allocate(3 * BigUint64Array.BYTES_PER_ELEMENT));
|
|
154
|
+
const meter = new BigInt64Array(allocate(2 * BigInt64Array.BYTES_PER_ELEMENT));
|
|
155
|
+
meter[1] = WORK_CAP;
|
|
156
|
+
const signal = signalOfSearch(options.clock);
|
|
157
|
+
const stop = new Uint32Array(allocate(Uint32Array.BYTES_PER_ELEMENT));
|
|
158
|
+
const accepted = admission(data, accepts);
|
|
159
|
+
const rejected = excludedMask(data.total, excluded);
|
|
160
|
+
options.clock?.check();
|
|
161
|
+
requireSearchActive(stop, signal);
|
|
162
|
+
const timed = options.clock?.nativeWindow?.();
|
|
163
|
+
const deadline = deadlineFor(native.core, timed?.milliseconds);
|
|
164
|
+
const request = {
|
|
165
|
+
query,
|
|
166
|
+
k,
|
|
167
|
+
ef,
|
|
168
|
+
rescoreDepth: depth,
|
|
169
|
+
explicitRescoreWindow: options.rescoreWindow !== void 0,
|
|
170
|
+
minSimilarity: options.minSimilarity,
|
|
171
|
+
accepted,
|
|
172
|
+
excluded: rejected
|
|
173
|
+
};
|
|
174
|
+
const abort = () => {
|
|
175
|
+
Atomics.store(stop, 0, 1);
|
|
176
|
+
};
|
|
177
|
+
signal?.addEventListener("abort", abort, { once: true });
|
|
178
|
+
return {
|
|
179
|
+
core: native.core,
|
|
180
|
+
cache: file.cache,
|
|
181
|
+
field,
|
|
182
|
+
request,
|
|
183
|
+
meter,
|
|
184
|
+
stop,
|
|
185
|
+
deadline,
|
|
186
|
+
ordinals,
|
|
187
|
+
scores,
|
|
188
|
+
fault,
|
|
189
|
+
release() {
|
|
190
|
+
signal?.removeEventListener("abort", abort);
|
|
191
|
+
},
|
|
192
|
+
finish(count) {
|
|
193
|
+
requireSearchActive(stop, signal);
|
|
194
|
+
options.clock?.tick(Number(meter[0]));
|
|
195
|
+
if (count === STOPPED && timed !== void 0) timed.expired();
|
|
196
|
+
if (count < 0) reportFailure(data, count, fault);
|
|
197
|
+
const hits = [];
|
|
198
|
+
for (let at = 0; at < count; at++) hits.push({ docId: data.idAt(ordinals[at]), score: scores[at] });
|
|
199
|
+
hits.sort((left, right) => compareScores(left.score, right.score) || compareCodePoints(left.docId, right.docId));
|
|
200
|
+
return hits.slice(0, k);
|
|
201
|
+
}
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
function searchNativeColdGraph(data, query, k, options, accepts, excluded) {
|
|
205
|
+
const search = prepareSearch(data, query, k, options, accepts, excluded, false);
|
|
206
|
+
if (search === null) return null;
|
|
207
|
+
const { core, field, request, meter, stop, deadline, ordinals, scores, fault } = search;
|
|
208
|
+
try {
|
|
209
|
+
return search.finish(
|
|
210
|
+
core.searchPagedVectors(field, request, search.cache.pageCache(), meter, stop, deadline, ordinals, scores, fault)
|
|
211
|
+
);
|
|
212
|
+
} finally {
|
|
213
|
+
search.release();
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
function searchNativeColdGraphConcurrently(data, query, k, options, accepts, excluded) {
|
|
217
|
+
const search = prepareSearch(data, query, k, options, accepts, excluded, true);
|
|
218
|
+
if (search === null) return null;
|
|
219
|
+
const { core, field, request, meter, stop, deadline, ordinals, scores, fault } = search;
|
|
220
|
+
return search.cache.withPageCache(async (cache) => {
|
|
221
|
+
const count = await core.searchPagedVectorsAsync(
|
|
222
|
+
field,
|
|
223
|
+
request,
|
|
224
|
+
cache,
|
|
225
|
+
meter,
|
|
226
|
+
stop,
|
|
227
|
+
deadline,
|
|
228
|
+
ordinals,
|
|
229
|
+
scores,
|
|
230
|
+
fault
|
|
231
|
+
);
|
|
232
|
+
return search.finish(count);
|
|
233
|
+
}).finally(search.release);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
// src/persistence/paged/cold-search.ts
|
|
113
237
|
function neighbourList(data, number, layer) {
|
|
114
238
|
const part = data.parts[Math.floor(number / COLD_GRAPH_PART_VECTORS)];
|
|
115
239
|
const offset = number % COLD_GRAPH_PART_VECTORS;
|
|
@@ -118,14 +242,18 @@ function neighbourList(data, number, layer) {
|
|
|
118
242
|
const bytes = part.neighbours.bytesAt(start, end - start);
|
|
119
243
|
const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
120
244
|
let cursor = 0;
|
|
121
|
-
|
|
245
|
+
let selected;
|
|
246
|
+
for (let current = 0; current < part.levels[offset]; current++) {
|
|
122
247
|
if (cursor + 4 > bytes.byteLength) loadFailed(`The neighbour lists of vector ${number} end inside a list`);
|
|
123
248
|
const count = view.getUint32(cursor, true);
|
|
124
249
|
if (cursor + 4 + count * 4 > bytes.byteLength)
|
|
125
250
|
loadFailed(`The neighbour list of vector ${number} runs past its node`);
|
|
126
|
-
if (current === layer)
|
|
251
|
+
if (current === layer) selected = { view, count, at: cursor + 4 };
|
|
127
252
|
cursor += 4 + count * 4;
|
|
128
253
|
}
|
|
254
|
+
if (cursor !== bytes.byteLength || selected === void 0)
|
|
255
|
+
loadFailed(`The neighbour lists of vector ${number} do not match its layers`);
|
|
256
|
+
return selected;
|
|
129
257
|
}
|
|
130
258
|
function fetchNeighbourLists(data, numbers) {
|
|
131
259
|
const reads = [];
|
|
@@ -258,22 +386,26 @@ function codeDistance(data, query, metric) {
|
|
|
258
386
|
}
|
|
259
387
|
function numbersThatCanReachTheTop(scored, k) {
|
|
260
388
|
if (k <= 0 || scored.length <= k) return scored;
|
|
261
|
-
scored.sort((a, b) =>
|
|
389
|
+
scored.sort((a, b) => compareScores(a.score, b.score));
|
|
262
390
|
const lowestKept = scored[k - 1].score;
|
|
263
391
|
let end = k;
|
|
264
|
-
while (end < scored.length && scored[end].score ===
|
|
392
|
+
while (end < scored.length && compareScores(scored[end].score, lowestKept) === 0) end += 1;
|
|
265
393
|
return scored.slice(0, end);
|
|
266
394
|
}
|
|
267
395
|
function bestHits(hits, k) {
|
|
268
|
-
return hits.sort((a, b) =>
|
|
396
|
+
return hits.sort((a, b) => compareScores(a.score, b.score) || compareCodePoints(a.docId, b.docId)).slice(0, Math.max(k, 0));
|
|
269
397
|
}
|
|
270
398
|
function searchColdGraph(data, query, k, options, accepts, excluded) {
|
|
399
|
+
const native = searchNativeColdGraph(data, query, k, options, accepts, excluded);
|
|
400
|
+
if (native !== null) return native;
|
|
271
401
|
const walk = walkColdGraph(data, query, k, options, accepts, excluded, false);
|
|
272
402
|
let step = walk.next();
|
|
273
403
|
while (step.done !== true) step = walk.next();
|
|
274
404
|
return step.value;
|
|
275
405
|
}
|
|
276
406
|
async function searchColdGraphConcurrently(data, query, k, options, accepts, excluded) {
|
|
407
|
+
const native = searchNativeColdGraphConcurrently(data, query, k, options, accepts, excluded);
|
|
408
|
+
if (native !== null) return native;
|
|
277
409
|
const walk = walkColdGraph(data, query, k, options, accepts, excluded, true);
|
|
278
410
|
let step = walk.next();
|
|
279
411
|
while (step.done !== true) {
|
|
@@ -284,12 +416,16 @@ async function searchColdGraphConcurrently(data, query, k, options, accepts, exc
|
|
|
284
416
|
}
|
|
285
417
|
function* walkColdGraph(data, query, k, options, accepts, excluded, fetchesRows) {
|
|
286
418
|
const { metric, minSimilarity } = options;
|
|
419
|
+
if (k === 0) return [];
|
|
287
420
|
const entry = entryNumberOf(data);
|
|
288
421
|
if (entry === null) return [];
|
|
289
422
|
const qMag = magnitude(query);
|
|
290
423
|
const fromCodes = codeDistance(data, query, metric);
|
|
291
424
|
const fullDistance = (number) => {
|
|
292
425
|
const vector = data.reusedVectorAt(number);
|
|
426
|
+
for (const value of vector) {
|
|
427
|
+
if (!Number.isFinite(value)) loadFailed(`Vector ${number} holds a non-finite component`);
|
|
428
|
+
}
|
|
293
429
|
return toDistance(query, vector, qMag, metric === "cosine" ? magnitude(vector) : 0, metric);
|
|
294
430
|
};
|
|
295
431
|
const distanceOf = fromCodes ?? fullDistance;
|
|
@@ -349,6 +485,8 @@ function* walkColdGraph(data, query, k, options, accepts, excluded, fetchesRows)
|
|
|
349
485
|
const hits = numbersThatCanReachTheTop(scored, k).map(({ number, score }) => ({ docId: data.idAt(number), score }));
|
|
350
486
|
return bestHits(hits, k);
|
|
351
487
|
}
|
|
488
|
+
|
|
489
|
+
// src/persistence/paged/cold-field/open-files.ts
|
|
352
490
|
var FLOAT64_BYTES = 8;
|
|
353
491
|
var CODES_KEY_AND_MAP_HEADER_BYTES = 7;
|
|
354
492
|
var BIN8_MAX_BYTES = 255;
|
|
@@ -394,6 +532,8 @@ function isUint32OfThisHost(bytes) {
|
|
|
394
532
|
return bytes.byteOffset % 4 === 0 && new Uint8Array(new Uint16Array([1]).buffer)[0] === 1;
|
|
395
533
|
}
|
|
396
534
|
function uint32ValuesOf(bytes) {
|
|
535
|
+
if (bytes.byteLength % Uint32Array.BYTES_PER_ELEMENT !== 0)
|
|
536
|
+
loadFailed("The node offsets do not hold whole uint32 values");
|
|
397
537
|
if (isUint32OfThisHost(bytes)) return new Uint32Array(bytes.buffer, bytes.byteOffset, bytes.byteLength / 4);
|
|
398
538
|
const values = new Uint32Array(bytes.byteLength / 4);
|
|
399
539
|
const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
@@ -421,7 +561,14 @@ function codesOfFile(path, sections, key) {
|
|
|
421
561
|
}
|
|
422
562
|
if (bits !== 1 && bits !== 2 && bits !== 4 && bits !== 8)
|
|
423
563
|
loadFailed(`The file "${key}" holds ${String(bits)} bit codes`);
|
|
424
|
-
|
|
564
|
+
const valuesOfCentroid = new Float32Array(centroid.length);
|
|
565
|
+
for (let at = 0; at < centroid.length; at++) {
|
|
566
|
+
const value = centroid[at];
|
|
567
|
+
if (typeof value !== "number" || !Number.isFinite(value) || !Number.isFinite(Math.fround(value)))
|
|
568
|
+
loadFailed(`The centroid of "${key}" holds an invalid float32 value`);
|
|
569
|
+
valuesOfCentroid[at] = value;
|
|
570
|
+
}
|
|
571
|
+
return { bits, centroid: valuesOfCentroid };
|
|
425
572
|
}
|
|
426
573
|
function sameCodes(left, right) {
|
|
427
574
|
if (left.bits !== right.bits || left.centroid.length !== right.centroid.length) return false;
|
|
@@ -538,8 +685,37 @@ function openParts(input) {
|
|
|
538
685
|
return graph === null ? null : { parts, graph };
|
|
539
686
|
}
|
|
540
687
|
|
|
688
|
+
// src/persistence/paged/cold-field/validation.ts
|
|
689
|
+
var UINT32_MAX = 4294967295;
|
|
690
|
+
function validateColdLayout(input, opened, parts, graph) {
|
|
691
|
+
const { dimension } = input;
|
|
692
|
+
const { codes, files } = opened;
|
|
693
|
+
if (!Number.isInteger(dimension) || dimension <= 0 || dimension > UINT32_MAX)
|
|
694
|
+
loadFailed("The disk vector field holds an invalid dimension");
|
|
695
|
+
if (codes !== null && (codes.centroid.length !== dimension || codes.centroid.some((value) => !Number.isFinite(value))))
|
|
696
|
+
loadFailed("The disk vector field holds an invalid centroid");
|
|
697
|
+
let total = 0;
|
|
698
|
+
for (const file of files) {
|
|
699
|
+
if (!Number.isInteger(file.count) || file.count <= 0 || file.count > UINT32_MAX - total || file.firstNumber !== total || file.vectors.length !== file.count * dimension * Float32Array.BYTES_PER_ELEMENT || file.dead !== null && file.dead.length !== Math.ceil(file.count / 8) || codes !== null && file.records?.length !== file.count * osqRecordBytes(dimension, codes.bits))
|
|
700
|
+
loadFailed(`The vector ranges of "${file.file.path}" do not match the field`);
|
|
701
|
+
total += file.count;
|
|
702
|
+
}
|
|
703
|
+
if (!Number.isInteger(graph.maxLayer) || graph.maxLayer < 0 || graph.maxLayer > MAX_LAYER_CAP || graph.entryPoint !== null && (!Number.isInteger(graph.entryPoint) || graph.entryPoint < 0 || graph.entryPoint >= total) || parts.length !== Math.ceil(total / COLD_GRAPH_PART_VECTORS))
|
|
704
|
+
loadFailed("The disk vector graph does not cover the field");
|
|
705
|
+
for (let at = 0; at < parts.length; at++) {
|
|
706
|
+
const part = parts[at];
|
|
707
|
+
const count = Math.min(total - at * COLD_GRAPH_PART_VECTORS, COLD_GRAPH_PART_VECTORS);
|
|
708
|
+
const { levels, nodeOffsets } = part;
|
|
709
|
+
if (levels.length !== count || nodeOffsets.length !== count + 1 || nodeOffsets[0] !== 0)
|
|
710
|
+
loadFailed(`The node ranges of "${part.file.path}" do not match the field`);
|
|
711
|
+
for (let node = 0; node < count; node++) {
|
|
712
|
+
if (levels[node] > graph.maxLayer + 1 || nodeOffsets[node] > nodeOffsets[node + 1] || nodeOffsets[node + 1] > part.neighbours.length)
|
|
713
|
+
loadFailed(`The node at position ${node} of "${part.file.path}" has invalid layers or offsets`);
|
|
714
|
+
}
|
|
715
|
+
}
|
|
716
|
+
}
|
|
717
|
+
|
|
541
718
|
// src/persistence/paged/cold-field/index.ts
|
|
542
|
-
var COLD_GRAPH_PART_VECTORS = 16384;
|
|
543
719
|
var FIXSTR = 160;
|
|
544
720
|
var FIXSTR_MAX_BYTES = 31;
|
|
545
721
|
var ASCII_MAX = 127;
|
|
@@ -677,7 +853,18 @@ function openColdVectorField(input) {
|
|
|
677
853
|
return null;
|
|
678
854
|
}
|
|
679
855
|
const { parts, graph } = graphed;
|
|
856
|
+
try {
|
|
857
|
+
validateColdLayout(input, opened, parts, graph);
|
|
858
|
+
} catch (error) {
|
|
859
|
+
closeHeldFiles(opened.files);
|
|
860
|
+
closeHeldFiles(parts);
|
|
861
|
+
throw error;
|
|
862
|
+
}
|
|
863
|
+
let activeSearches = 0;
|
|
864
|
+
let closing = false;
|
|
680
865
|
function closeAll() {
|
|
866
|
+
closing = true;
|
|
867
|
+
if (activeSearches > 0) return;
|
|
681
868
|
closeHeldFiles(opened?.files ?? []);
|
|
682
869
|
closeHeldFiles(parts);
|
|
683
870
|
}
|
|
@@ -704,17 +891,33 @@ function openColdVectorField(input) {
|
|
|
704
891
|
}
|
|
705
892
|
return {
|
|
706
893
|
liveCount: live,
|
|
707
|
-
residentBytes
|
|
894
|
+
get residentBytes() {
|
|
895
|
+
let bytes = residentBytes;
|
|
896
|
+
for (const file of opened.files) bytes += cachedFileBytes(file.file);
|
|
897
|
+
for (const part of parts) bytes += cachedFileBytes(part.file);
|
|
898
|
+
return bytes;
|
|
899
|
+
},
|
|
708
900
|
numberOf: liveNumberOf,
|
|
709
901
|
vectorOfNumber: (number) => data.vectorAt(number),
|
|
710
902
|
reusedVectorOfNumber: (number) => data.reusedVectorAt(number),
|
|
711
903
|
partitionOf: (docId) => input.resolvePartition(docId),
|
|
712
904
|
filePaths: () => [...input.files, ...input.graphParts].map((file) => file.path),
|
|
713
905
|
search: (query, k, options, accepts, excluded) => searchColdGraph(data, query, k, options, accepts, excluded),
|
|
714
|
-
searchConcurrently
|
|
906
|
+
async searchConcurrently(query, k, options, accepts, excluded) {
|
|
907
|
+
if (closing) loadFailed("The disk vector field is closed");
|
|
908
|
+
activeSearches += 1;
|
|
909
|
+
try {
|
|
910
|
+
return await searchColdGraphConcurrently(data, query, k, options, accepts, excluded);
|
|
911
|
+
} finally {
|
|
912
|
+
activeSearches -= 1;
|
|
913
|
+
if (closing) closeAll();
|
|
914
|
+
}
|
|
915
|
+
},
|
|
715
916
|
close: closeAll
|
|
716
917
|
};
|
|
717
918
|
}
|
|
919
|
+
|
|
920
|
+
// src/persistence/paged/cold-load.ts
|
|
718
921
|
var FILE_PAGE_SIZES = /* @__PURE__ */ new Set([SEGMENT_PAGE_BYTES, RECORD_PAGE_BYTES]);
|
|
719
922
|
var FLOAT32_BYTES = 4;
|
|
720
923
|
var FLOAT64_BYTES2 = 8;
|
|
@@ -797,4 +1000,118 @@ async function loadFilesByParts(files, restore, fieldPath, dimension, stillWante
|
|
|
797
1000
|
if (stillWanted()) restore.finish();
|
|
798
1001
|
}
|
|
799
1002
|
|
|
800
|
-
|
|
1003
|
+
// src/persistence/durability/segment/vector-load.ts
|
|
1004
|
+
var VECTOR_FILE_ENVELOPE_VERSION = 2;
|
|
1005
|
+
var GRAPH_PART_ENVELOPE_VERSION = 2;
|
|
1006
|
+
function liveVectorsOf(ref) {
|
|
1007
|
+
let live = 0;
|
|
1008
|
+
for (const file of ref.files) live += file.count - countDead(file.dead, file.count);
|
|
1009
|
+
return live;
|
|
1010
|
+
}
|
|
1011
|
+
async function openListedFile(store, ref, what, allowsCompression) {
|
|
1012
|
+
const bytes = await readListedFile(store, ref.key, { bytes: ref.bytes, what });
|
|
1013
|
+
const { header, payload } = await openChecksummedEnvelope(bytes, {
|
|
1014
|
+
envelopeFormatVersion: VECTOR_FILE_ENVELOPE_VERSION,
|
|
1015
|
+
what: `${what} "${ref.key}"`,
|
|
1016
|
+
allowsCompression
|
|
1017
|
+
});
|
|
1018
|
+
requireListedChecksum(what, ref.key, header.checksum, ref.checksum);
|
|
1019
|
+
return { payload, payloadLength: header.payloadLength };
|
|
1020
|
+
}
|
|
1021
|
+
async function readGraphParts(store, ref) {
|
|
1022
|
+
if (ref.graphParts.length === 0) return null;
|
|
1023
|
+
const parts = [];
|
|
1024
|
+
for (const part of ref.graphParts) {
|
|
1025
|
+
const { payload } = await openListedFile(store, part, "graph part", true);
|
|
1026
|
+
const decoded = decodeVectorGraphPartPayload(decode(payload));
|
|
1027
|
+
if (decoded.fieldName !== ref.fieldPath) {
|
|
1028
|
+
throw new NarsilError(
|
|
1029
|
+
ErrorCodes.PERSISTENCE_LOAD_FAILED,
|
|
1030
|
+
`The graph part "${part.key}" names field "${decoded.fieldName}" where the manifest lists "${ref.fieldPath}"`,
|
|
1031
|
+
{ key: part.key }
|
|
1032
|
+
);
|
|
1033
|
+
}
|
|
1034
|
+
parts.push(decoded);
|
|
1035
|
+
}
|
|
1036
|
+
return assembleGraphParts(parts);
|
|
1037
|
+
}
|
|
1038
|
+
async function readVectorFile(store, file, fieldPath) {
|
|
1039
|
+
const { payload: bytes, payloadLength } = await openListedFile(store, file, "vector file", false);
|
|
1040
|
+
const payload = decodeVectorFilePayload(decode(bytes));
|
|
1041
|
+
if (payload.docIds.length !== file.count) {
|
|
1042
|
+
throw new NarsilError(
|
|
1043
|
+
ErrorCodes.PERSISTENCE_LOAD_FAILED,
|
|
1044
|
+
`The vector file "${file.key}" holds ${payload.docIds.length} vectors where the manifest counts ${file.count}`,
|
|
1045
|
+
{ key: file.key, held: payload.docIds.length, count: file.count }
|
|
1046
|
+
);
|
|
1047
|
+
}
|
|
1048
|
+
if (payload.fieldName !== fieldPath) {
|
|
1049
|
+
throw new NarsilError(
|
|
1050
|
+
ErrorCodes.PERSISTENCE_LOAD_FAILED,
|
|
1051
|
+
`The vector file "${file.key}" names field "${payload.fieldName}" where the manifest lists "${fieldPath}"`,
|
|
1052
|
+
{ key: file.key }
|
|
1053
|
+
);
|
|
1054
|
+
}
|
|
1055
|
+
return { payload, payloadLength };
|
|
1056
|
+
}
|
|
1057
|
+
function holdsEveryHead(ref) {
|
|
1058
|
+
if (ref.graphParts.length === 0 || ref.files.length === 0) return false;
|
|
1059
|
+
return [...ref.files, ...ref.graphParts].every((file) => file.headOffset !== void 0);
|
|
1060
|
+
}
|
|
1061
|
+
async function loadFieldOnDemand(store, ref, vectorIndex, resolvePartition) {
|
|
1062
|
+
const { pathOf } = store;
|
|
1063
|
+
if (pathOf === void 0 || vectorIndex.storage !== "disk" || !holdsEveryHead(ref)) return false;
|
|
1064
|
+
await Promise.all([
|
|
1065
|
+
...ref.files.map((file) => requireListedSize(store, file.key, { bytes: file.bytes, what: "vector file" })),
|
|
1066
|
+
...ref.graphParts.map((part) => requireListedSize(store, part.key, { bytes: part.bytes, what: "graph part" }))
|
|
1067
|
+
]);
|
|
1068
|
+
const files = await Promise.all(
|
|
1069
|
+
ref.files.map(async (file) => ({ ref: file, path: await pathOf.call(store, file.key) }))
|
|
1070
|
+
);
|
|
1071
|
+
const graphParts = await Promise.all(
|
|
1072
|
+
ref.graphParts.map(async (part) => ({ ref: part, path: await pathOf.call(store, part.key) }))
|
|
1073
|
+
);
|
|
1074
|
+
const field = openColdVectorField({
|
|
1075
|
+
fieldPath: ref.fieldPath,
|
|
1076
|
+
dimension: vectorIndex.dimension,
|
|
1077
|
+
metric: vectorIndex.metric,
|
|
1078
|
+
codeBits: osqBitsOf(vectorIndex.quantization),
|
|
1079
|
+
files,
|
|
1080
|
+
graphParts,
|
|
1081
|
+
resolvePartition
|
|
1082
|
+
});
|
|
1083
|
+
if (field === null) return false;
|
|
1084
|
+
vectorIndex.openColdField(field, async (beginRestore, stillWanted, loadingWanted) => {
|
|
1085
|
+
await waitBeforeColdLoad(loadingWanted);
|
|
1086
|
+
if (!stillWanted()) return;
|
|
1087
|
+
const graph = await readGraphParts(store, ref);
|
|
1088
|
+
if (!stillWanted()) return;
|
|
1089
|
+
const restore = beginRestore({ liveVectors: liveVectorsOf(ref), holdsGraph: true, graph });
|
|
1090
|
+
await loadFilesByParts(files, restore, ref.fieldPath, vectorIndex.dimension, stillWanted);
|
|
1091
|
+
});
|
|
1092
|
+
return true;
|
|
1093
|
+
}
|
|
1094
|
+
async function loadVectorField(store, ref, vectorIndex, resolvePartition = null) {
|
|
1095
|
+
if (resolvePartition !== null && await loadFieldOnDemand(store, ref, vectorIndex, resolvePartition)) return;
|
|
1096
|
+
const restore = vectorIndex.restoreCheckpoint({
|
|
1097
|
+
liveVectors: liveVectorsOf(ref),
|
|
1098
|
+
holdsGraph: ref.graphParts.length > 0,
|
|
1099
|
+
graph: await readGraphParts(store, ref)
|
|
1100
|
+
});
|
|
1101
|
+
for (const file of ref.files) {
|
|
1102
|
+
const { payload, payloadLength } = await readVectorFile(store, file, ref.fieldPath);
|
|
1103
|
+
restore.addFile({
|
|
1104
|
+
id: file.id,
|
|
1105
|
+
key: file.key,
|
|
1106
|
+
payload,
|
|
1107
|
+
dead: file.dead,
|
|
1108
|
+
location: store.pathOf === void 0 ? null : {
|
|
1109
|
+
path: await store.pathOf(file.key),
|
|
1110
|
+
vectorsOffset: HEADER_SIZE + payloadLength - payload.vectors.byteLength
|
|
1111
|
+
}
|
|
1112
|
+
});
|
|
1113
|
+
}
|
|
1114
|
+
restore.finish();
|
|
1115
|
+
}
|
|
1116
|
+
|
|
1117
|
+
export { GRAPH_PART_ENVELOPE_VERSION, VECTOR_FILE_ENVELOPE_VERSION, loadFilesByParts, loadVectorField, openColdVectorField, readGraphParts, readVectorFile, waitBeforeColdLoad };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { getFs, getPath } from './chunk-HLPRHOSO.mjs';
|
|
2
2
|
import { DIRECTORY_LOCK_ATTEMPTS, DIRECTORY_LOCK_SETTLE_MS, DIRECTORY_LOCK_PROCESS_START_TOLERANCE_MS } from './chunk-QDZJM7NI.mjs';
|
|
3
|
-
import { nodeThreadId } from './chunk-
|
|
4
|
-
import { NarsilError, ErrorCodes } from './chunk-
|
|
5
|
-
import { compareCodePoints } from './chunk-
|
|
3
|
+
import { nodeThreadId } from './chunk-OUWZKNO3.mjs';
|
|
4
|
+
import { NarsilError, ErrorCodes } from './chunk-Q3ZZH5Z7.mjs';
|
|
5
|
+
import { compareCodePoints } from './chunk-TGPKS2UM.mjs';
|
|
6
6
|
import { openSync, close, readFileSync } from 'fs';
|
|
7
7
|
import { rename, readFile, writeFile, unlink, realpath, readdir, readlink } from 'fs/promises';
|
|
8
8
|
import { endianness } from 'os';
|