@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,38 +0,0 @@
|
|
|
1
|
-
// src/engine/serial-index-update.ts
|
|
2
|
-
var updatingByCore = /* @__PURE__ */ new WeakMap();
|
|
3
|
-
async function withOpenIndex(core, indexName, action) {
|
|
4
|
-
core.guardShutdown();
|
|
5
|
-
core.requireIndex(indexName);
|
|
6
|
-
const release = await core.indexState.acquire(indexName);
|
|
7
|
-
try {
|
|
8
|
-
return await action();
|
|
9
|
-
} finally {
|
|
10
|
-
release();
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
async function oneAtATime(core, indexName, action) {
|
|
14
|
-
let chains = updatingByCore.get(core);
|
|
15
|
-
if (chains === void 0) {
|
|
16
|
-
chains = /* @__PURE__ */ new Map();
|
|
17
|
-
updatingByCore.set(core, chains);
|
|
18
|
-
}
|
|
19
|
-
const updating = chains;
|
|
20
|
-
const earlier = updating.get(indexName) ?? Promise.resolve();
|
|
21
|
-
const current = earlier.catch(() => void 0).then(action);
|
|
22
|
-
updating.set(indexName, current);
|
|
23
|
-
try {
|
|
24
|
-
return await current;
|
|
25
|
-
} finally {
|
|
26
|
-
if (updating.get(indexName) === current) updating.delete(indexName);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
// src/engine/sync-notify.ts
|
|
31
|
-
var listenersByRegistry = /* @__PURE__ */ new WeakMap();
|
|
32
|
-
function emitSyncChange(registry, change) {
|
|
33
|
-
const listeners = listenersByRegistry.get(registry);
|
|
34
|
-
if (listeners === void 0) return;
|
|
35
|
-
for (const listener of [...listeners]) listener(change);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export { emitSyncChange, oneAtATime, withOpenIndex };
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
// src/math/words.ts
|
|
2
|
-
var FLOAT = new Float64Array(1);
|
|
3
|
-
var SIGNED = new Int32Array(FLOAT.buffer);
|
|
4
|
-
var UNSIGNED = new Uint32Array(FLOAT.buffer);
|
|
5
|
-
var LITTLE_ENDIAN = new Uint8Array(new Uint16Array([1]).buffer)[0] === 1;
|
|
6
|
-
var HIGH = LITTLE_ENDIAN ? 1 : 0;
|
|
7
|
-
var LOW = LITTLE_ENDIAN ? 0 : 1;
|
|
8
|
-
var EXPONENT_BIAS = 1023;
|
|
9
|
-
var EXPONENT_SHIFT = 20;
|
|
10
|
-
var MAGNITUDE_MASK = 2147483647;
|
|
11
|
-
var INFINITE_HIGH_WORD = 2146435072;
|
|
12
|
-
var SMALLEST_NORMAL_HIGH_WORD = 1048576;
|
|
13
|
-
function highWord(value) {
|
|
14
|
-
FLOAT[0] = value;
|
|
15
|
-
return SIGNED[HIGH];
|
|
16
|
-
}
|
|
17
|
-
function lowWord(value) {
|
|
18
|
-
FLOAT[0] = value;
|
|
19
|
-
return UNSIGNED[LOW];
|
|
20
|
-
}
|
|
21
|
-
function fromWords(high, low) {
|
|
22
|
-
SIGNED[HIGH] = high;
|
|
23
|
-
UNSIGNED[LOW] = low;
|
|
24
|
-
return FLOAT[0];
|
|
25
|
-
}
|
|
26
|
-
function withHighWord(value, high) {
|
|
27
|
-
FLOAT[0] = value;
|
|
28
|
-
SIGNED[HIGH] = high;
|
|
29
|
-
return FLOAT[0];
|
|
30
|
-
}
|
|
31
|
-
function withLowWord(value, low) {
|
|
32
|
-
FLOAT[0] = value;
|
|
33
|
-
UNSIGNED[LOW] = low;
|
|
34
|
-
return FLOAT[0];
|
|
35
|
-
}
|
|
36
|
-
function scaleByPowerOfTwo(value, exponent) {
|
|
37
|
-
return value * fromWords(exponent + EXPONENT_BIAS << EXPONENT_SHIFT, 0);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export { INFINITE_HIGH_WORD, MAGNITUDE_MASK, SMALLEST_NORMAL_HIGH_WORD, fromWords, highWord, lowWord, scaleByPowerOfTwo, withHighWord, withLowWord };
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
import { newSyncEpoch } from './chunk-YJHGOJAC.mjs';
|
|
2
|
-
import { oneSyncChangeAtATime } from './chunk-5W3MMTLG.mjs';
|
|
3
|
-
import { withOpenIndex, emitSyncChange } from './chunk-ML7THVLJ.mjs';
|
|
4
|
-
import { NarsilError, ErrorCodes } from './chunk-SRMZXJSL.mjs';
|
|
5
|
-
|
|
6
|
-
// src/engine/sync/operations.ts
|
|
7
|
-
function invalidLimit(name, value) {
|
|
8
|
-
throw new NarsilError(ErrorCodes.CONFIG_INVALID, `The sync setting ${name} must be a positive whole number`, {
|
|
9
|
-
[name]: String(value)
|
|
10
|
-
});
|
|
11
|
-
}
|
|
12
|
-
function requireSyncSetting(setting) {
|
|
13
|
-
if (setting === null || typeof setting !== "object") {
|
|
14
|
-
throw new NarsilError(ErrorCodes.CONFIG_INVALID, "The sync setting must be an object");
|
|
15
|
-
}
|
|
16
|
-
const { enabled, historyMaxAgeMs, historyMaxBytes } = setting;
|
|
17
|
-
if (typeof enabled !== "boolean") {
|
|
18
|
-
throw new NarsilError(ErrorCodes.CONFIG_INVALID, "The sync setting needs enabled set to true or false");
|
|
19
|
-
}
|
|
20
|
-
const isLimit = (value) => typeof value === "number" && Number.isSafeInteger(value) && value >= 1;
|
|
21
|
-
if (historyMaxAgeMs !== void 0 && !isLimit(historyMaxAgeMs)) invalidLimit("historyMaxAgeMs", historyMaxAgeMs);
|
|
22
|
-
if (historyMaxBytes !== void 0 && !isLimit(historyMaxBytes)) invalidLimit("historyMaxBytes", historyMaxBytes);
|
|
23
|
-
return {
|
|
24
|
-
enabled,
|
|
25
|
-
...historyMaxAgeMs !== void 0 ? { historyMaxAgeMs } : {},
|
|
26
|
-
...historyMaxBytes !== void 0 ? { historyMaxBytes } : {}
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
function requireNoQuerySuggestions(state, indexName) {
|
|
30
|
-
if (state?.querySuggestions?.enabled !== true) return;
|
|
31
|
-
throw new NarsilError(
|
|
32
|
-
ErrorCodes.CONFIG_INVALID,
|
|
33
|
-
`Index "${indexName}" has popular query suggestions on, so it cannot sync to devices: a device receives the whole index of one user, while a suggestion comes from the searches of several people`,
|
|
34
|
-
{ indexName }
|
|
35
|
-
);
|
|
36
|
-
}
|
|
37
|
-
function syncStorageOf(core, indexName) {
|
|
38
|
-
const storage = core.durability?.manager.syncStorage?.();
|
|
39
|
-
if (storage === void 0) {
|
|
40
|
-
throw new NarsilError(
|
|
41
|
-
ErrorCodes.SYNC_DURABILITY_REQUIRED,
|
|
42
|
-
`Index "${indexName}" needs write-ahead log durability for device sync, because the feed reads the log`,
|
|
43
|
-
{ indexName }
|
|
44
|
-
);
|
|
45
|
-
}
|
|
46
|
-
return storage;
|
|
47
|
-
}
|
|
48
|
-
async function persistSyncState(core, indexName, next) {
|
|
49
|
-
const entry = core.requireIndex(indexName);
|
|
50
|
-
const previous = entry.sync;
|
|
51
|
-
entry.sync = next;
|
|
52
|
-
try {
|
|
53
|
-
await core.durability?.manager.persistMetadata(indexName);
|
|
54
|
-
} catch (error) {
|
|
55
|
-
entry.sync = previous;
|
|
56
|
-
throw error;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
function updateIndexSync(core, indexName, value) {
|
|
60
|
-
const setting = requireSyncSetting(value);
|
|
61
|
-
core.requireIndex(indexName);
|
|
62
|
-
const storage = syncStorageOf(core, indexName);
|
|
63
|
-
return withOpenIndex(
|
|
64
|
-
core,
|
|
65
|
-
indexName,
|
|
66
|
-
() => oneSyncChangeAtATime(core.indexRegistry, indexName, async () => {
|
|
67
|
-
if (setting.enabled) requireNoQuerySuggestions(core.requireIndex(indexName).querySuggestions, indexName);
|
|
68
|
-
const previous = core.requireIndex(indexName).sync;
|
|
69
|
-
if (!setting.enabled) {
|
|
70
|
-
if (previous === null) return;
|
|
71
|
-
await persistSyncState(core, indexName, null);
|
|
72
|
-
await storage.release(indexName);
|
|
73
|
-
emitSyncChange(core.indexRegistry, { kind: "off", indexName });
|
|
74
|
-
return;
|
|
75
|
-
}
|
|
76
|
-
const limits = {
|
|
77
|
-
...setting.historyMaxAgeMs !== void 0 ? { historyMaxAgeMs: setting.historyMaxAgeMs } : {},
|
|
78
|
-
...setting.historyMaxBytes !== void 0 ? { historyMaxBytes: setting.historyMaxBytes } : {}
|
|
79
|
-
};
|
|
80
|
-
if (previous !== null) {
|
|
81
|
-
await persistSyncState(core, indexName, { ...limits, active: previous.active, epoch: previous.epoch });
|
|
82
|
-
return;
|
|
83
|
-
}
|
|
84
|
-
await storage.release(indexName);
|
|
85
|
-
await persistSyncState(core, indexName, { ...limits, active: false, epoch: newSyncEpoch() });
|
|
86
|
-
})
|
|
87
|
-
);
|
|
88
|
-
}
|
|
89
|
-
async function renewWhileHeld(core, indexName) {
|
|
90
|
-
const sync = core.indexRegistry.get(indexName)?.sync ?? null;
|
|
91
|
-
if (sync === null) return;
|
|
92
|
-
await persistSyncState(core, indexName, { ...sync, active: false, epoch: newSyncEpoch() });
|
|
93
|
-
await core.durability?.manager.syncStorage?.().release(indexName);
|
|
94
|
-
emitSyncChange(core.indexRegistry, { kind: "epoch", indexName });
|
|
95
|
-
}
|
|
96
|
-
function holdRenewedSyncEpoch(core, indexName) {
|
|
97
|
-
if (core.mutationCtx.capacityScope === "partition") return Promise.resolve(() => void 0);
|
|
98
|
-
return new Promise((resolveHold, rejectHold) => {
|
|
99
|
-
void oneSyncChangeAtATime(core.indexRegistry, indexName, async () => {
|
|
100
|
-
try {
|
|
101
|
-
await renewWhileHeld(core, indexName);
|
|
102
|
-
} catch (error) {
|
|
103
|
-
rejectHold(error);
|
|
104
|
-
return;
|
|
105
|
-
}
|
|
106
|
-
await new Promise((release) => resolveHold(() => release()));
|
|
107
|
-
});
|
|
108
|
-
});
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
export { holdRenewedSyncEpoch, requireNoQuerySuggestions, requireSyncSetting, syncStorageOf, updateIndexSync };
|
|
@@ -1,318 +0,0 @@
|
|
|
1
|
-
// src/core/ordering/code-points.ts
|
|
2
|
-
function exceedsCodePoints(value, maximum) {
|
|
3
|
-
if (value.length <= maximum) return false;
|
|
4
|
-
let counted = 0;
|
|
5
|
-
let i = 0;
|
|
6
|
-
while (i < value.length) {
|
|
7
|
-
const unit = value.charCodeAt(i);
|
|
8
|
-
if (unit >= 55296 && unit < 56320 && i + 1 < value.length) {
|
|
9
|
-
const low = value.charCodeAt(i + 1);
|
|
10
|
-
if (low >= 56320 && low < 57344) i++;
|
|
11
|
-
}
|
|
12
|
-
i++;
|
|
13
|
-
counted++;
|
|
14
|
-
if (counted > maximum) return true;
|
|
15
|
-
}
|
|
16
|
-
return false;
|
|
17
|
-
}
|
|
18
|
-
var SURROGATE_UNIT = /[\ud800-\udfff]/;
|
|
19
|
-
var REPLACEMENT_CHARACTER = "\uFFFD";
|
|
20
|
-
function firstUnpairedSurrogate(value) {
|
|
21
|
-
for (let i = 0; i < value.length; i++) {
|
|
22
|
-
const unit = value.charCodeAt(i);
|
|
23
|
-
if (unit < 55296 || unit >= 57344) continue;
|
|
24
|
-
if (unit >= 56320) return i;
|
|
25
|
-
const low = value.charCodeAt(i + 1);
|
|
26
|
-
if (!(low >= 56320 && low < 57344)) return i;
|
|
27
|
-
i++;
|
|
28
|
-
}
|
|
29
|
-
return -1;
|
|
30
|
-
}
|
|
31
|
-
function holdsUnpairedSurrogate(value) {
|
|
32
|
-
return SURROGATE_UNIT.test(value) && firstUnpairedSurrogate(value) >= 0;
|
|
33
|
-
}
|
|
34
|
-
function withUnpairedSurrogatesReplaced(value) {
|
|
35
|
-
const first = firstUnpairedSurrogate(value);
|
|
36
|
-
if (first < 0) return value;
|
|
37
|
-
let repaired = value.slice(0, first);
|
|
38
|
-
for (let i = first; i < value.length; i++) {
|
|
39
|
-
const unit = value.charCodeAt(i);
|
|
40
|
-
if (unit < 55296 || unit >= 57344) {
|
|
41
|
-
repaired += value[i];
|
|
42
|
-
continue;
|
|
43
|
-
}
|
|
44
|
-
const low = value.charCodeAt(i + 1);
|
|
45
|
-
if (unit < 56320 && low >= 56320 && low < 57344) {
|
|
46
|
-
repaired += value.slice(i, i + 2);
|
|
47
|
-
i++;
|
|
48
|
-
continue;
|
|
49
|
-
}
|
|
50
|
-
repaired += REPLACEMENT_CHARACTER;
|
|
51
|
-
}
|
|
52
|
-
return repaired;
|
|
53
|
-
}
|
|
54
|
-
function codePointCount(value) {
|
|
55
|
-
let counted = 0;
|
|
56
|
-
for (let i = 0; i < value.length; i++) {
|
|
57
|
-
const unit = value.charCodeAt(i);
|
|
58
|
-
if (unit >= 55296 && unit < 56320 && i + 1 < value.length) {
|
|
59
|
-
const low = value.charCodeAt(i + 1);
|
|
60
|
-
if (low >= 56320 && low < 57344) i++;
|
|
61
|
-
}
|
|
62
|
-
counted++;
|
|
63
|
-
}
|
|
64
|
-
return counted;
|
|
65
|
-
}
|
|
66
|
-
function adjustUtf16Unit(unit) {
|
|
67
|
-
if (unit < 55296) return unit;
|
|
68
|
-
if (unit < 57344) return unit + 8192;
|
|
69
|
-
return unit - 2048;
|
|
70
|
-
}
|
|
71
|
-
function compareCodePoints(a, b) {
|
|
72
|
-
const shorter = a.length < b.length ? a.length : b.length;
|
|
73
|
-
let i = 0;
|
|
74
|
-
while (i < shorter && a.charCodeAt(i) === b.charCodeAt(i)) i++;
|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1,-tzk;1,-tzk;1,-tzk;1,-tzk;1,-tzk;1,-tzk;1,-tzk;1,-tzk;1,-tzk;1,-tzk;1,-tzk;1,-tzk;1,-tzk;1,-tzk;1,-tzk;1,-tzk;1,-tzk;1,-tzk;1,-tzk;1,-tzk;1,-tzk;1,-tzk;1,-tzk;1,-tzk;1,-tzk;1,-tzk;1,-tzk;1,-tzk;1,-tzk;1,-tzk;1,-tzk;1,-tzk;1,-tzk;1,-tzk;1,-tzk;1,-tzk;1,-tzk;1,-tzk;1,-tzk;1,-tzk;1,-tzk;1,-tzk;1,-tzk;1,-tzk;1,-tzk;1,-tzk;1,-tzk;1,-tzk;1,-tzk;1,-tzk;1,-tzk;1,-tzk;1,-tzk;1,-tzk;1,-tzk;1,-tzk;1,-tzk;1,-tzk;1,-tzk;1,-tzk;1,-tzk;1,-tzk;ggy,w;1,w;1,w;1,w;1,w;1,w;1,w;1,w;1,w;1,w;1,w;1,w;1,w;1,w;1,w;1,w;1,w;1,w;1,w;1,w;1,w;1,w;1,w;1,w;1,w;1,w;xy,14;1,14;1,14;1,14;1,14;1,14;1,14;1,14;1,14;1,14;1,14;1,14;1,14;1,14;1,14;1,14;1,14;1,14;1,14;1,14;1,14;1,14;1,14;1,14;1,14;1,14;1,14;1,14;1,14;1,14;1,14;1,14;1,14;1,14;1,14;1,14;1,14;1,14;1,14;1,14;3t,14;1,14;1,14;1,14;1,14;1,14;1,14;1,14;1,14;1,14;1,14;1,14;1,14;1,14;1,14;1,14;1,14;1,14;1,14;1,14;1,14;1,14;1,14;1,14;1,14;1,14;1,14;1,14;1,14;1,14;1,14;1,14;1,14;1,14;1,14;1,14;4d,13;1,13;1,13;1,13;1,13;1,13;1,13;1,13;1,13;1,13;1,13;2,13;1,13;1,13;1,13;1,13;1,13;1,13;1,13;1,13;1,13;1,13;1,13;1,13;1,13;1,13;2,13;1,13;1,13;1,13;1,13;1,13;1,13;2,13;1,13;1d7,1s;1,1s;1,1s;1,1s;1,1s;1,1s;1,1s;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64l,qh;1,64m,qh;1,64n,qh;1,64g,qh;1,64h,qh;1,64i,qh;1,64j,qh;1,64k,qh;1,64l,qh;1,64m,qh;1,64n,qh;1,65c,qh;1,65d,qh;1,65e,qh;1,65f,qh;1,65g,qh;1,65h,qh;1,65i,qh;1,65j,qh;1,65c,qh;1,65d,qh;1,65e,qh;1,65f,qh;1,65g,qh;1,65h,qh;1,65i,qh;1,65j,qh;1,674,qh;1,675,qh;1,676,qh;1,677,qh;1,678,qh;1,679,qh;1,67a,qh;1,67b,qh;1,674,qh;1,675,qh;1,676,qh;1,677,qh;1,678,qh;1,679,qh;1,67a,qh;1,67b,qh;3,67k,qh;1,q9,qh;1,q4,qh;2,q9,n6;1,q9,n6,qh;5,q9,qh;6,67o,qh;1,qf,qh;1,q6,qh;2,qf,n6;1,qf,n6,qh;5,qf,qh;6,qh,lk,lc;1,qh,lk,ld;3,qh,n6;1,qh,lk,n6;b,qt,lk,lc;1,qt,lk,ld;1,qp,lv;2,qt,n6;1,qt,lk,n6;b,67w,qh;1,qx,qh;1,r2,qh;2,qx,n6;1,qx,n6,qh;5,qx,qh;179g,2u,2u;1,2u,2x;1,2u,30;1,2u,2u,2x;1,2u,2u,30;1,37,38;1,37,38;d,12s,12u;1,12s,12d;1,12s,12j;1,132,12u;1,12s,12l;";
|
|
82
|
-
var singleTable = null;
|
|
83
|
-
var multiTable = null;
|
|
84
|
-
function singleFoldTable() {
|
|
85
|
-
if (singleTable === null) {
|
|
86
|
-
singleTable = /* @__PURE__ */ new Map();
|
|
87
|
-
let source = 0;
|
|
88
|
-
for (const entry of SINGLE_FOLDS.split(";")) {
|
|
89
|
-
if (entry.length === 0) continue;
|
|
90
|
-
const [delta, offset] = entry.split(",");
|
|
91
|
-
source += Number.parseInt(delta, 36);
|
|
92
|
-
singleTable.set(source, source + Number.parseInt(offset, 36));
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
return singleTable;
|
|
96
|
-
}
|
|
97
|
-
function multiFoldTable() {
|
|
98
|
-
if (multiTable === null) {
|
|
99
|
-
multiTable = /* @__PURE__ */ new Map();
|
|
100
|
-
let source = 0;
|
|
101
|
-
for (const entry of MULTI_FOLDS.split(";")) {
|
|
102
|
-
if (entry.length === 0) continue;
|
|
103
|
-
const parts = entry.split(",");
|
|
104
|
-
source += Number.parseInt(parts[0], 36);
|
|
105
|
-
multiTable.set(
|
|
106
|
-
source,
|
|
107
|
-
parts.slice(1).map((cp) => Number.parseInt(cp, 36))
|
|
108
|
-
);
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
return multiTable;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
// src/core/ordering/fold-compare.ts
|
|
115
|
-
var EXHAUSTED = -1;
|
|
116
|
-
function foldOf(codePoint, single, multi) {
|
|
117
|
-
if (codePoint < 128) return codePoint >= 65 && codePoint <= 90 ? codePoint + 32 : codePoint;
|
|
118
|
-
return single.get(codePoint) ?? multi.get(codePoint) ?? codePoint;
|
|
119
|
-
}
|
|
120
|
-
function nextFoldedCodePoint(text, cursor, single, multi) {
|
|
121
|
-
if (cursor.pending !== null) {
|
|
122
|
-
const cp2 = cursor.pending[cursor.pendingIndex];
|
|
123
|
-
cursor.pendingIndex++;
|
|
124
|
-
if (cursor.pendingIndex === cursor.pending.length) {
|
|
125
|
-
cursor.pending = null;
|
|
126
|
-
cursor.pendingIndex = 0;
|
|
127
|
-
}
|
|
128
|
-
return cp2;
|
|
129
|
-
}
|
|
130
|
-
if (cursor.index >= text.length) return EXHAUSTED;
|
|
131
|
-
let cp = text.charCodeAt(cursor.index);
|
|
132
|
-
cursor.index++;
|
|
133
|
-
if (cp >= 55296 && cp < 56320 && cursor.index < text.length) {
|
|
134
|
-
const low = text.charCodeAt(cursor.index);
|
|
135
|
-
if (low >= 56320 && low < 57344) {
|
|
136
|
-
cp = 65536 + (cp - 55296 << 10) + (low - 56320);
|
|
137
|
-
cursor.index++;
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
const folded = foldOf(cp, single, multi);
|
|
141
|
-
if (typeof folded === "number") return folded;
|
|
142
|
-
if (folded.length > 1) {
|
|
143
|
-
cursor.pending = folded;
|
|
144
|
-
cursor.pendingIndex = 1;
|
|
145
|
-
}
|
|
146
|
-
return folded[0];
|
|
147
|
-
}
|
|
148
|
-
function compareCaseFolded(a, b) {
|
|
149
|
-
const shorter = a.length < b.length ? a.length : b.length;
|
|
150
|
-
let start = 0;
|
|
151
|
-
while (start < shorter && a.charCodeAt(start) === b.charCodeAt(start)) start++;
|
|
152
|
-
if (start === a.length && start === b.length) return 0;
|
|
153
|
-
if (start > 0) {
|
|
154
|
-
const previous = a.charCodeAt(start - 1);
|
|
155
|
-
if (previous >= 55296 && previous < 56320) start--;
|
|
156
|
-
}
|
|
157
|
-
const single = singleFoldTable();
|
|
158
|
-
const multi = multiFoldTable();
|
|
159
|
-
const aCursor = { index: start, pending: null, pendingIndex: 0 };
|
|
160
|
-
const bCursor = { index: start, pending: null, pendingIndex: 0 };
|
|
161
|
-
for (; ; ) {
|
|
162
|
-
const aCp = nextFoldedCodePoint(a, aCursor, single, multi);
|
|
163
|
-
const bCp = nextFoldedCodePoint(b, bCursor, single, multi);
|
|
164
|
-
if (aCp !== bCp) return aCp - bCp;
|
|
165
|
-
if (aCp === EXHAUSTED) return 0;
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
function compareSortStrings(a, b) {
|
|
169
|
-
const folded = compareCaseFolded(a, b);
|
|
170
|
-
if (folded !== 0) return folded;
|
|
171
|
-
return compareCodePoints(a, b);
|
|
172
|
-
}
|
|
173
|
-
function appendFoldedCodePoint(codePoint, out) {
|
|
174
|
-
const folded = foldOf(codePoint, singleFoldTable(), multiFoldTable());
|
|
175
|
-
if (typeof folded === "number") {
|
|
176
|
-
out.push(folded);
|
|
177
|
-
return;
|
|
178
|
-
}
|
|
179
|
-
for (const foldedCodePoint of folded) out.push(foldedCodePoint);
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
// src/core/ordering/constants.ts
|
|
183
|
-
var SORT_VALUE_MAX_CODE_POINTS = 512;
|
|
184
|
-
|
|
185
|
-
// src/core/ordering/sort-values.ts
|
|
186
|
-
var SORT_MODES = ["min", "max", "avg", "median"];
|
|
187
|
-
function isSortMode(value) {
|
|
188
|
-
return value === "min" || value === "max" || value === "avg" || value === "median";
|
|
189
|
-
}
|
|
190
|
-
function defaultSortMode(direction) {
|
|
191
|
-
return direction === "desc" ? "max" : "min";
|
|
192
|
-
}
|
|
193
|
-
function sortModeOf(entry) {
|
|
194
|
-
return entry.mode ?? defaultSortMode(entry.direction);
|
|
195
|
-
}
|
|
196
|
-
function truncateSortString(value) {
|
|
197
|
-
if (value.length <= SORT_VALUE_MAX_CODE_POINTS) return value;
|
|
198
|
-
let index = 0;
|
|
199
|
-
let counted = 0;
|
|
200
|
-
while (index < value.length && counted < SORT_VALUE_MAX_CODE_POINTS) {
|
|
201
|
-
const unit = value.charCodeAt(index);
|
|
202
|
-
if (unit >= 55296 && unit < 56320 && index + 1 < value.length) {
|
|
203
|
-
const low = value.charCodeAt(index + 1);
|
|
204
|
-
if (low >= 56320 && low < 57344) index++;
|
|
205
|
-
}
|
|
206
|
-
index++;
|
|
207
|
-
counted++;
|
|
208
|
-
}
|
|
209
|
-
return value.slice(0, index);
|
|
210
|
-
}
|
|
211
|
-
function toComparableSortValue(value) {
|
|
212
|
-
if (typeof value === "string") return truncateSortString(value);
|
|
213
|
-
if (typeof value === "number") return Number.isFinite(value) ? value : null;
|
|
214
|
-
if (typeof value === "boolean") return value;
|
|
215
|
-
return null;
|
|
216
|
-
}
|
|
217
|
-
function numericReduction(values, mode) {
|
|
218
|
-
const numbers = [];
|
|
219
|
-
for (const element of values) {
|
|
220
|
-
if (typeof element === "number" && Number.isFinite(element)) numbers.push(element);
|
|
221
|
-
}
|
|
222
|
-
if (numbers.length === 0) return null;
|
|
223
|
-
if (mode === "avg") {
|
|
224
|
-
let mean = 0;
|
|
225
|
-
for (let index = 0; index < numbers.length; index++) {
|
|
226
|
-
mean += (numbers[index] - mean) / (index + 1);
|
|
227
|
-
}
|
|
228
|
-
return mean;
|
|
229
|
-
}
|
|
230
|
-
numbers.sort((a, b) => a - b);
|
|
231
|
-
const middle = numbers.length >> 1;
|
|
232
|
-
if (numbers.length % 2 === 1) return numbers[middle];
|
|
233
|
-
return numbers[middle - 1] / 2 + numbers[middle] / 2;
|
|
234
|
-
}
|
|
235
|
-
function toReducedSortValue(value, mode) {
|
|
236
|
-
if (!Array.isArray(value)) return toComparableSortValue(value);
|
|
237
|
-
if (mode === "avg" || mode === "median") return numericReduction(value, mode);
|
|
238
|
-
let chosen = null;
|
|
239
|
-
for (const element of value) {
|
|
240
|
-
const comparable = toComparableSortValue(element);
|
|
241
|
-
if (comparable === null) continue;
|
|
242
|
-
if (chosen === null) {
|
|
243
|
-
chosen = comparable;
|
|
244
|
-
continue;
|
|
245
|
-
}
|
|
246
|
-
const comparison = comparePresentValues(comparable, chosen);
|
|
247
|
-
if (mode === "min" ? comparison < 0 : comparison > 0) chosen = comparable;
|
|
248
|
-
}
|
|
249
|
-
return chosen;
|
|
250
|
-
}
|
|
251
|
-
function readSortField(document, path) {
|
|
252
|
-
const segments = path.split(".");
|
|
253
|
-
let current = document;
|
|
254
|
-
for (const segment of segments) {
|
|
255
|
-
if (current === null || current === void 0 || typeof current !== "object") return void 0;
|
|
256
|
-
if (!Object.hasOwn(current, segment)) return void 0;
|
|
257
|
-
current = current[segment];
|
|
258
|
-
}
|
|
259
|
-
return current;
|
|
260
|
-
}
|
|
261
|
-
function typeRank(value) {
|
|
262
|
-
if (typeof value === "number") return 0;
|
|
263
|
-
if (typeof value === "string") return 1;
|
|
264
|
-
return 2;
|
|
265
|
-
}
|
|
266
|
-
function comparePresentValues(a, b) {
|
|
267
|
-
const rankDifference = typeRank(a) - typeRank(b);
|
|
268
|
-
if (rankDifference !== 0) return rankDifference;
|
|
269
|
-
if (typeof a === "number" && typeof b === "number") return a - b;
|
|
270
|
-
if (typeof a === "string" && typeof b === "string") return compareSortStrings(a, b);
|
|
271
|
-
if (a === b) return 0;
|
|
272
|
-
return a ? 1 : -1;
|
|
273
|
-
}
|
|
274
|
-
function compareComparableValues(a, b, direction) {
|
|
275
|
-
if (a === null && b === null) return 0;
|
|
276
|
-
if (a === null) return 1;
|
|
277
|
-
if (b === null) return -1;
|
|
278
|
-
const comparison = comparePresentValues(a, b);
|
|
279
|
-
if (comparison === 0) return 0;
|
|
280
|
-
return direction === "desc" ? -comparison : comparison;
|
|
281
|
-
}
|
|
282
|
-
function compareComparableKeys(aKey, bKey, directions) {
|
|
283
|
-
for (let i = 0; i < directions.length; i++) {
|
|
284
|
-
const comparison = compareComparableValues(aKey[i] ?? null, bKey[i] ?? null, directions[i]);
|
|
285
|
-
if (comparison !== 0) return comparison;
|
|
286
|
-
}
|
|
287
|
-
return 0;
|
|
288
|
-
}
|
|
289
|
-
function compareSortValues(aValues, bValues, directions) {
|
|
290
|
-
for (let i = 0; i < directions.length; i++) {
|
|
291
|
-
const a = toComparableSortValue(aValues[i]);
|
|
292
|
-
const b = toComparableSortValue(bValues[i]);
|
|
293
|
-
if (a === null && b === null) continue;
|
|
294
|
-
if (a === null) return 1;
|
|
295
|
-
if (b === null) return -1;
|
|
296
|
-
const comparison = comparePresentValues(a, b);
|
|
297
|
-
if (comparison !== 0) return directions[i] === "desc" ? -comparison : comparison;
|
|
298
|
-
}
|
|
299
|
-
return 0;
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
// src/vector/hnsw/constants.ts
|
|
303
|
-
var MAX_LAYER_CAP = 32;
|
|
304
|
-
var MAX_M = 512;
|
|
305
|
-
var MIN_M = 2;
|
|
306
|
-
var EARLIER_RELEASE_MIN_M = 1;
|
|
307
|
-
var INITIAL_UPPER_SLOTS = 64;
|
|
308
|
-
var INITIAL_LIST_CAPACITY = 64;
|
|
309
|
-
var PLACEMENT_ROOM_REQUESTS = 8;
|
|
310
|
-
var FARTHEST_REJECTED_LINKS_KEPT = 1;
|
|
311
|
-
var COMPACTION_TOMBSTONE_RATIO = 0.1;
|
|
312
|
-
var COMPACTION_ABSOLUTE_THRESHOLD = 1e3;
|
|
313
|
-
var DEFAULT_EF_SEARCH = 50;
|
|
314
|
-
var NEAREST_LINK_FALLBACK_HOSTS = 4;
|
|
315
|
-
var CONNECT_STEPS_BETWEEN_CLOCK_CHECKS = 256;
|
|
316
|
-
var CONNECT_RESTARTS_BEFORE_ONE_PASS = 8;
|
|
317
|
-
|
|
318
|
-
export { COMPACTION_ABSOLUTE_THRESHOLD, COMPACTION_TOMBSTONE_RATIO, CONNECT_RESTARTS_BEFORE_ONE_PASS, CONNECT_STEPS_BETWEEN_CLOCK_CHECKS, DEFAULT_EF_SEARCH, EARLIER_RELEASE_MIN_M, FARTHEST_REJECTED_LINKS_KEPT, INITIAL_LIST_CAPACITY, INITIAL_UPPER_SLOTS, MAX_LAYER_CAP, MAX_M, MIN_M, NEAREST_LINK_FALLBACK_HOSTS, PLACEMENT_ROOM_REQUESTS, SORT_MODES, SORT_VALUE_MAX_CODE_POINTS, appendFoldedCodePoint, codePointCount, compareCodePoints, compareComparableKeys, compareComparableValues, compareSortValues, defaultSortMode, exceedsCodePoints, holdsUnpairedSurrogate, isSortMode, readSortField, singleFoldTable, sortModeOf, toComparableSortValue, toReducedSortValue, truncateSortString, withUnpairedSurrogatesReplaced };
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import { RESTORED_HISTORY_FOLDER, QUERY_HISTORY_FOLDER, RESTORE_STAGING_INFIX, MAX_HISTORY_FILE_BYTES } from './chunk-7IGKGWSQ.mjs';
|
|
2
|
-
|
|
3
|
-
// src/query-suggestions/history-files.ts
|
|
4
|
-
var BUILD_RECORD_FILE = "build.nrsl";
|
|
5
|
-
var DAY_FILE = /^(\d{4}-\d{2}-\d{2})\.nrsl$/;
|
|
6
|
-
var RESTORED_FILE = /^(\d{4}-\d{2}-\d{2})-(\d{4})\.nrsl$/;
|
|
7
|
-
function historyFolderOf(indexName) {
|
|
8
|
-
return `${QUERY_HISTORY_FOLDER}/${indexName}/`;
|
|
9
|
-
}
|
|
10
|
-
function dayFileKey(indexName, day) {
|
|
11
|
-
return `${historyFolderOf(indexName)}${day}.nrsl`;
|
|
12
|
-
}
|
|
13
|
-
function restoredFileKey(indexName, day, sequence) {
|
|
14
|
-
return `${historyFolderOf(indexName)}${RESTORED_HISTORY_FOLDER}/${day}-${String(sequence).padStart(4, "0")}.nrsl`;
|
|
15
|
-
}
|
|
16
|
-
function buildRecordKey(indexName) {
|
|
17
|
-
return `${historyFolderOf(indexName)}${BUILD_RECORD_FILE}`;
|
|
18
|
-
}
|
|
19
|
-
function historyFileOf(indexName, key) {
|
|
20
|
-
const folder = historyFolderOf(indexName);
|
|
21
|
-
if (!key.startsWith(folder)) return null;
|
|
22
|
-
const rest = key.slice(folder.length);
|
|
23
|
-
const own = DAY_FILE.exec(rest);
|
|
24
|
-
if (own !== null) return { key, day: own[1], restored: false };
|
|
25
|
-
const restoredPrefix = `${RESTORED_HISTORY_FOLDER}/`;
|
|
26
|
-
if (!rest.startsWith(restoredPrefix)) return null;
|
|
27
|
-
const restored = RESTORED_FILE.exec(rest.slice(restoredPrefix.length));
|
|
28
|
-
return restored === null ? null : { key, day: restored[1], restored: true };
|
|
29
|
-
}
|
|
30
|
-
function directoryFiles(storage) {
|
|
31
|
-
const { directory } = storage;
|
|
32
|
-
return {
|
|
33
|
-
listUnder: (prefix) => directory.list(prefix),
|
|
34
|
-
async read(key) {
|
|
35
|
-
const length = await directory.byteLength?.(key) ?? null;
|
|
36
|
-
if (length !== null && length > MAX_HISTORY_FILE_BYTES) return "too-long";
|
|
37
|
-
const bytes = await directory.read(key);
|
|
38
|
-
if (bytes !== null && bytes.byteLength > MAX_HISTORY_FILE_BYTES) return "too-long";
|
|
39
|
-
return bytes;
|
|
40
|
-
},
|
|
41
|
-
write: (key, bytes) => directory.atomicWrite(key, bytes),
|
|
42
|
-
remove: (key) => directory.remove(key)
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
function adapterFiles(storage) {
|
|
46
|
-
const { adapter } = storage;
|
|
47
|
-
return {
|
|
48
|
-
listUnder: (prefix) => adapter.list(prefix),
|
|
49
|
-
async read(key) {
|
|
50
|
-
const bytes = await adapter.load(key);
|
|
51
|
-
if (bytes !== null && bytes.byteLength > MAX_HISTORY_FILE_BYTES) return "too-long";
|
|
52
|
-
return bytes;
|
|
53
|
-
},
|
|
54
|
-
write: (key, bytes) => adapter.save(key, bytes),
|
|
55
|
-
remove: (key) => adapter.delete(key)
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
function memoryFiles() {
|
|
59
|
-
const files = /* @__PURE__ */ new Map();
|
|
60
|
-
return {
|
|
61
|
-
async listUnder(prefix) {
|
|
62
|
-
return [...files.keys()].filter((key) => key.startsWith(prefix)).sort();
|
|
63
|
-
},
|
|
64
|
-
async read(key) {
|
|
65
|
-
return files.get(key) ?? null;
|
|
66
|
-
},
|
|
67
|
-
async write(key, bytes) {
|
|
68
|
-
files.set(key, bytes);
|
|
69
|
-
},
|
|
70
|
-
async remove(key) {
|
|
71
|
-
files.delete(key);
|
|
72
|
-
}
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
|
-
function historyFilesOf(storage) {
|
|
76
|
-
if (storage === null) return memoryFiles();
|
|
77
|
-
return storage.kind === "directory" ? directoryFiles(storage) : adapterFiles(storage);
|
|
78
|
-
}
|
|
79
|
-
function listHistoryFolder(files, indexName) {
|
|
80
|
-
return files.listUnder(historyFolderOf(indexName));
|
|
81
|
-
}
|
|
82
|
-
async function removeHistoryFolder(files, indexName) {
|
|
83
|
-
for (const key of await listHistoryFolder(files, indexName)) await files.remove(key);
|
|
84
|
-
}
|
|
85
|
-
function restoreStagingPrefix() {
|
|
86
|
-
return `${QUERY_HISTORY_FOLDER}/${RESTORE_STAGING_INFIX}${globalThis.crypto.randomUUID()}/`;
|
|
87
|
-
}
|
|
88
|
-
async function removeRestoreLeftovers(files) {
|
|
89
|
-
for (const key of await files.listUnder(`${QUERY_HISTORY_FOLDER}/${RESTORE_STAGING_INFIX}`)) await files.remove(key);
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
export { buildRecordKey, dayFileKey, historyFileOf, historyFilesOf, listHistoryFolder, removeHistoryFolder, removeRestoreLeftovers, restoreStagingPrefix, restoredFileKey };
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
// src/core/hash.ts
|
|
2
|
-
var FNV_OFFSET_BASIS = 2166136261;
|
|
3
|
-
var FNV_PRIME = 16777619;
|
|
4
|
-
var encoder = new TextEncoder();
|
|
5
|
-
function fnv1aBytes(bytes) {
|
|
6
|
-
return fnv1aContinue(FNV_OFFSET_BASIS, bytes, bytes.length) >>> 0;
|
|
7
|
-
}
|
|
8
|
-
function fnv1aContinue(start, bytes, length) {
|
|
9
|
-
let hash = start;
|
|
10
|
-
for (let i = 0; i < length; i++) {
|
|
11
|
-
hash = Math.imul(hash ^ bytes[i], FNV_PRIME);
|
|
12
|
-
}
|
|
13
|
-
return hash;
|
|
14
|
-
}
|
|
15
|
-
var scratchNumber = new Float64Array(1);
|
|
16
|
-
var scratchBytes = new Uint8Array(scratchNumber.buffer);
|
|
17
|
-
var HOST_IS_LITTLE_ENDIAN = new Uint8Array(new Uint16Array([1]).buffer)[0] === 1;
|
|
18
|
-
function fnv1aContinueTaggedNumbers(start, tag, numbers) {
|
|
19
|
-
let hash = start;
|
|
20
|
-
const b = scratchBytes;
|
|
21
|
-
for (let i = 0; i < numbers.length; i++) {
|
|
22
|
-
scratchNumber[0] = Math.fround(numbers[i]);
|
|
23
|
-
hash = Math.imul(hash ^ tag, FNV_PRIME);
|
|
24
|
-
if (HOST_IS_LITTLE_ENDIAN) {
|
|
25
|
-
hash = Math.imul(hash ^ b[7], FNV_PRIME);
|
|
26
|
-
hash = Math.imul(hash ^ b[6], FNV_PRIME);
|
|
27
|
-
hash = Math.imul(hash ^ b[5], FNV_PRIME);
|
|
28
|
-
hash = Math.imul(hash ^ b[4], FNV_PRIME);
|
|
29
|
-
hash = Math.imul(hash ^ b[3], FNV_PRIME);
|
|
30
|
-
hash = Math.imul(hash ^ b[2], FNV_PRIME);
|
|
31
|
-
hash = Math.imul(hash ^ b[1], FNV_PRIME);
|
|
32
|
-
hash = Math.imul(hash ^ b[0], FNV_PRIME);
|
|
33
|
-
} else {
|
|
34
|
-
for (let at = 0; at < 8; at++) hash = Math.imul(hash ^ b[at], FNV_PRIME);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
return hash;
|
|
38
|
-
}
|
|
39
|
-
function fnv1a(input) {
|
|
40
|
-
return fnv1aBytes(encoder.encode(input));
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export { FNV_OFFSET_BASIS, fnv1a, fnv1aContinue, fnv1aContinueTaggedNumbers };
|