@delali/narsil 0.3.1-next.157 → 0.3.1-next.160
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
package/dist/chunk-PWGYQXML.mjs
DELETED
|
@@ -1,470 +0,0 @@
|
|
|
1
|
-
import { isGroup, isNormalPhrase } from './chunk-GQPTDQCL.mjs';
|
|
2
|
-
import { MAX_HISTORY_FILE_BYTES, KEY_FINGERPRINT_BYTES, SCRAMBLED_ID_BYTES, MAX_INDEX_UUID_LENGTH, MAX_MAX_LENGTH, MAX_MAX_WORDS, MAX_PEOPLE_PER_PHRASE_IN_FILE } from './chunk-5YNRKI2C.mjs';
|
|
3
|
-
import { packEnvelopeWithChecksum } from './chunk-FEZVDOWX.mjs';
|
|
4
|
-
import { HEADER_SIZE, openChecksummedEnvelope } from './chunk-3OH67G7R.mjs';
|
|
5
|
-
import { crc32 } from './chunk-7GXJUJ24.mjs';
|
|
6
|
-
|
|
7
|
-
// src/query-suggestions/msgpack-cursor.ts
|
|
8
|
-
var MalformedPayload = class extends Error {
|
|
9
|
-
};
|
|
10
|
-
function utf8ByteLength(text) {
|
|
11
|
-
let bytes = 0;
|
|
12
|
-
for (let i = 0; i < text.length; i++) {
|
|
13
|
-
const unit = text.charCodeAt(i);
|
|
14
|
-
if (unit < 128) bytes += 1;
|
|
15
|
-
else if (unit < 2048) bytes += 2;
|
|
16
|
-
else if (unit >= 55296 && unit <= 56319 && i + 1 < text.length) {
|
|
17
|
-
const next = text.charCodeAt(i + 1);
|
|
18
|
-
if (next >= 56320 && next <= 57343) {
|
|
19
|
-
bytes += 4;
|
|
20
|
-
i++;
|
|
21
|
-
} else bytes += 3;
|
|
22
|
-
} else bytes += 3;
|
|
23
|
-
}
|
|
24
|
-
return bytes;
|
|
25
|
-
}
|
|
26
|
-
function headerBytes(length, fixLimit) {
|
|
27
|
-
if (length <= fixLimit) return 1;
|
|
28
|
-
if (length <= 255) return 2;
|
|
29
|
-
if (length <= 65535) return 3;
|
|
30
|
-
return 5;
|
|
31
|
-
}
|
|
32
|
-
function stringSize(text) {
|
|
33
|
-
const length = utf8ByteLength(text);
|
|
34
|
-
return headerBytes(length, 31) + length;
|
|
35
|
-
}
|
|
36
|
-
function binarySize(length) {
|
|
37
|
-
return (length <= 255 ? 2 : length <= 65535 ? 3 : 5) + length;
|
|
38
|
-
}
|
|
39
|
-
function containerHeaderSize(length) {
|
|
40
|
-
if (length <= 15) return 1;
|
|
41
|
-
return length <= 65535 ? 3 : 5;
|
|
42
|
-
}
|
|
43
|
-
function uintSize(value) {
|
|
44
|
-
if (value < 128) return 1;
|
|
45
|
-
if (value <= 255) return 2;
|
|
46
|
-
if (value <= 65535) return 3;
|
|
47
|
-
if (value <= 4294967295) return 5;
|
|
48
|
-
return 9;
|
|
49
|
-
}
|
|
50
|
-
var ExactWriter = class {
|
|
51
|
-
bytes;
|
|
52
|
-
view;
|
|
53
|
-
position;
|
|
54
|
-
encoder = new TextEncoder();
|
|
55
|
-
constructor(bytes, start) {
|
|
56
|
-
this.bytes = bytes;
|
|
57
|
-
this.view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
58
|
-
this.position = start;
|
|
59
|
-
}
|
|
60
|
-
get offset() {
|
|
61
|
-
return this.position;
|
|
62
|
-
}
|
|
63
|
-
skip(length) {
|
|
64
|
-
this.position += length;
|
|
65
|
-
}
|
|
66
|
-
map(length) {
|
|
67
|
-
this.container(length, 128, 222, 223);
|
|
68
|
-
}
|
|
69
|
-
array(length) {
|
|
70
|
-
this.container(length, 144, 220, 221);
|
|
71
|
-
}
|
|
72
|
-
string(text) {
|
|
73
|
-
const length = utf8ByteLength(text);
|
|
74
|
-
if (length <= 31) this.bytes[this.position++] = 160 | length;
|
|
75
|
-
else if (length <= 255) {
|
|
76
|
-
this.bytes[this.position++] = 217;
|
|
77
|
-
this.bytes[this.position++] = length;
|
|
78
|
-
} else if (length <= 65535) {
|
|
79
|
-
this.bytes[this.position++] = 218;
|
|
80
|
-
this.view.setUint16(this.position, length);
|
|
81
|
-
this.position += 2;
|
|
82
|
-
} else {
|
|
83
|
-
this.bytes[this.position++] = 219;
|
|
84
|
-
this.view.setUint32(this.position, length);
|
|
85
|
-
this.position += 4;
|
|
86
|
-
}
|
|
87
|
-
const written = this.encoder.encodeInto(text, this.bytes.subarray(this.position, this.position + length)).written;
|
|
88
|
-
if (written !== length) throw new MalformedPayload("A string took a different number of bytes than measured");
|
|
89
|
-
this.position += length;
|
|
90
|
-
}
|
|
91
|
-
binary(source, offset, length) {
|
|
92
|
-
if (length <= 255) {
|
|
93
|
-
this.bytes[this.position++] = 196;
|
|
94
|
-
this.bytes[this.position++] = length;
|
|
95
|
-
} else if (length <= 65535) {
|
|
96
|
-
this.bytes[this.position++] = 197;
|
|
97
|
-
this.view.setUint16(this.position, length);
|
|
98
|
-
this.position += 2;
|
|
99
|
-
} else {
|
|
100
|
-
this.bytes[this.position++] = 198;
|
|
101
|
-
this.view.setUint32(this.position, length);
|
|
102
|
-
this.position += 4;
|
|
103
|
-
}
|
|
104
|
-
this.bytes.set(source.subarray(offset, offset + length), this.position);
|
|
105
|
-
this.position += length;
|
|
106
|
-
}
|
|
107
|
-
uint(value) {
|
|
108
|
-
if (value < 128) this.bytes[this.position++] = value;
|
|
109
|
-
else if (value <= 255) {
|
|
110
|
-
this.bytes[this.position++] = 204;
|
|
111
|
-
this.bytes[this.position++] = value;
|
|
112
|
-
} else if (value <= 65535) {
|
|
113
|
-
this.bytes[this.position++] = 205;
|
|
114
|
-
this.view.setUint16(this.position, value);
|
|
115
|
-
this.position += 2;
|
|
116
|
-
} else if (value <= 4294967295) {
|
|
117
|
-
this.bytes[this.position++] = 206;
|
|
118
|
-
this.view.setUint32(this.position, value);
|
|
119
|
-
this.position += 4;
|
|
120
|
-
} else {
|
|
121
|
-
this.bytes[this.position++] = 207;
|
|
122
|
-
this.view.setBigUint64(this.position, BigInt(value));
|
|
123
|
-
this.position += 8;
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
container(length, fix, sixteen, thirtyTwo) {
|
|
127
|
-
if (length <= 15) this.bytes[this.position++] = fix | length;
|
|
128
|
-
else if (length <= 65535) {
|
|
129
|
-
this.bytes[this.position++] = sixteen;
|
|
130
|
-
this.view.setUint16(this.position, length);
|
|
131
|
-
this.position += 2;
|
|
132
|
-
} else {
|
|
133
|
-
this.bytes[this.position++] = thirtyTwo;
|
|
134
|
-
this.view.setUint32(this.position, length);
|
|
135
|
-
this.position += 4;
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
};
|
|
139
|
-
var StrictReader = class {
|
|
140
|
-
bytes;
|
|
141
|
-
view;
|
|
142
|
-
position;
|
|
143
|
-
decoder = new TextDecoder("utf-8", { fatal: true });
|
|
144
|
-
constructor(bytes, start) {
|
|
145
|
-
this.bytes = bytes;
|
|
146
|
-
this.view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
147
|
-
this.position = start;
|
|
148
|
-
}
|
|
149
|
-
get offset() {
|
|
150
|
-
return this.position;
|
|
151
|
-
}
|
|
152
|
-
get atEnd() {
|
|
153
|
-
return this.position === this.bytes.byteLength;
|
|
154
|
-
}
|
|
155
|
-
map() {
|
|
156
|
-
return this.container(128, 222, 223, "a map");
|
|
157
|
-
}
|
|
158
|
-
array() {
|
|
159
|
-
return this.container(144, 220, 221, "an array");
|
|
160
|
-
}
|
|
161
|
-
string() {
|
|
162
|
-
const tag = this.byte();
|
|
163
|
-
let length;
|
|
164
|
-
if ((tag & 224) === 160) length = tag & 31;
|
|
165
|
-
else if (tag === 217) length = this.byte();
|
|
166
|
-
else if (tag === 218) length = this.uint16();
|
|
167
|
-
else if (tag === 219) length = this.uint32();
|
|
168
|
-
else throw new MalformedPayload("Expected a string");
|
|
169
|
-
const end = this.take(length);
|
|
170
|
-
try {
|
|
171
|
-
return this.decoder.decode(this.bytes.subarray(end - length, end));
|
|
172
|
-
} catch {
|
|
173
|
-
throw new MalformedPayload("A string holds invalid UTF-8");
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
binary() {
|
|
177
|
-
const tag = this.byte();
|
|
178
|
-
let length;
|
|
179
|
-
if (tag === 196) length = this.byte();
|
|
180
|
-
else if (tag === 197) length = this.uint16();
|
|
181
|
-
else if (tag === 198) length = this.uint32();
|
|
182
|
-
else throw new MalformedPayload("Expected bytes");
|
|
183
|
-
const end = this.take(length);
|
|
184
|
-
return { offset: end - length, length };
|
|
185
|
-
}
|
|
186
|
-
uint() {
|
|
187
|
-
const tag = this.byte();
|
|
188
|
-
if (tag < 128) return tag;
|
|
189
|
-
if (tag === 204) return this.byte();
|
|
190
|
-
if (tag === 205) return this.uint16();
|
|
191
|
-
if (tag === 206) return this.uint32();
|
|
192
|
-
if (tag === 207) {
|
|
193
|
-
this.take(8);
|
|
194
|
-
const value = this.view.getBigUint64(this.position - 8);
|
|
195
|
-
if (value > BigInt(Number.MAX_SAFE_INTEGER)) throw new MalformedPayload("An integer is out of range");
|
|
196
|
-
return Number(value);
|
|
197
|
-
}
|
|
198
|
-
throw new MalformedPayload("Expected an unsigned integer");
|
|
199
|
-
}
|
|
200
|
-
container(fix, sixteen, thirtyTwo, what) {
|
|
201
|
-
const tag = this.byte();
|
|
202
|
-
if ((tag & 240) === fix) return tag & 15;
|
|
203
|
-
if (tag === sixteen) return this.uint16();
|
|
204
|
-
if (tag === thirtyTwo) return this.uint32();
|
|
205
|
-
throw new MalformedPayload(`Expected ${what}`);
|
|
206
|
-
}
|
|
207
|
-
take(length) {
|
|
208
|
-
const end = this.position + length;
|
|
209
|
-
if (end > this.bytes.byteLength) throw new MalformedPayload("The payload ends early");
|
|
210
|
-
this.position = end;
|
|
211
|
-
return end;
|
|
212
|
-
}
|
|
213
|
-
byte() {
|
|
214
|
-
this.take(1);
|
|
215
|
-
return this.bytes[this.position - 1];
|
|
216
|
-
}
|
|
217
|
-
uint16() {
|
|
218
|
-
this.take(2);
|
|
219
|
-
return this.view.getUint16(this.position - 2);
|
|
220
|
-
}
|
|
221
|
-
uint32() {
|
|
222
|
-
this.take(4);
|
|
223
|
-
return this.view.getUint32(this.position - 4);
|
|
224
|
-
}
|
|
225
|
-
};
|
|
226
|
-
|
|
227
|
-
// src/query-suggestions/counts-groups.ts
|
|
228
|
-
var FILE_LIMITS = {
|
|
229
|
-
minLetters: 1,
|
|
230
|
-
maxLength: MAX_MAX_LENGTH,
|
|
231
|
-
maxWords: MAX_MAX_WORDS,
|
|
232
|
-
maxDigits: MAX_MAX_LENGTH
|
|
233
|
-
};
|
|
234
|
-
var KEY_PHRASE = "phrase";
|
|
235
|
-
var KEY_COUNT = "count";
|
|
236
|
-
var KEY_PEOPLE = "people";
|
|
237
|
-
var MAX_UINT32 = 4294967295;
|
|
238
|
-
function readPeople(reader) {
|
|
239
|
-
const people = reader.array();
|
|
240
|
-
if (people > MAX_PEOPLE_PER_PHRASE_IN_FILE) throw new MalformedPayload("A phrase lists too many people");
|
|
241
|
-
const offsets = [];
|
|
242
|
-
for (let i = 0; i < people; i++) {
|
|
243
|
-
const { offset, length } = reader.binary();
|
|
244
|
-
if (length !== SCRAMBLED_ID_BYTES) throw new MalformedPayload("A scrambled ID has the wrong length");
|
|
245
|
-
offsets.push(offset);
|
|
246
|
-
}
|
|
247
|
-
return offsets;
|
|
248
|
-
}
|
|
249
|
-
function walkGroups(reader, payload, visitor, onGroup = null) {
|
|
250
|
-
const groupCount = reader.map();
|
|
251
|
-
const validating = visitor === null && onGroup === null;
|
|
252
|
-
const seenGroups = validating ? /* @__PURE__ */ new Set() : null;
|
|
253
|
-
for (let g = 0; g < groupCount; g++) {
|
|
254
|
-
const group = reader.string();
|
|
255
|
-
onGroup?.(group);
|
|
256
|
-
if (seenGroups !== null) {
|
|
257
|
-
if (!isGroup(group) || seenGroups.has(group)) throw new MalformedPayload("A group is invalid or repeated");
|
|
258
|
-
seenGroups.add(group);
|
|
259
|
-
}
|
|
260
|
-
const phraseCount = reader.array();
|
|
261
|
-
const seenPhrases = validating ? /* @__PURE__ */ new Set() : null;
|
|
262
|
-
for (let p = 0; p < phraseCount; p++) {
|
|
263
|
-
const fields = reader.map();
|
|
264
|
-
let phrase = null;
|
|
265
|
-
let count = null;
|
|
266
|
-
let offsets = null;
|
|
267
|
-
for (let f = 0; f < fields; f++) {
|
|
268
|
-
const key = reader.string();
|
|
269
|
-
if (key === KEY_PHRASE && phrase === null) phrase = reader.string();
|
|
270
|
-
else if (key === KEY_COUNT && count === null) count = reader.uint();
|
|
271
|
-
else if (key === KEY_PEOPLE && offsets === null) offsets = readPeople(reader);
|
|
272
|
-
else throw new MalformedPayload(`A phrase holds an unexpected or repeated key "${key}"`);
|
|
273
|
-
}
|
|
274
|
-
if (phrase === null || count === null || offsets === null) throw new MalformedPayload("A phrase lacks a key");
|
|
275
|
-
if (seenPhrases !== null) {
|
|
276
|
-
if (!isNormalPhrase(phrase, FILE_LIMITS) || seenPhrases.has(phrase)) {
|
|
277
|
-
throw new MalformedPayload("A phrase is invalid or repeated");
|
|
278
|
-
}
|
|
279
|
-
if (offsets.length > count || count > MAX_UINT32) {
|
|
280
|
-
throw new MalformedPayload("A phrase lists more people than its count");
|
|
281
|
-
}
|
|
282
|
-
seenPhrases.add(phrase);
|
|
283
|
-
}
|
|
284
|
-
visitor?.(group, phrase, count, { source: payload, offsets });
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
// src/query-suggestions/counts-file.ts
|
|
290
|
-
var DAY_PATTERN = /^\d{4}-\d{2}-\d{2}$/;
|
|
291
|
-
var WHAT = "query counts file";
|
|
292
|
-
var QUERY_COUNTS_FILE_FORMAT_VERSION = 1;
|
|
293
|
-
var KEY_DAY = "day";
|
|
294
|
-
var KEY_FINGERPRINT = "keyFingerprint";
|
|
295
|
-
var KEY_SAVED_AT = "savedAt";
|
|
296
|
-
var KEY_INDEX_UUID = "indexUuid";
|
|
297
|
-
var KEY_GROUPS = "groups";
|
|
298
|
-
var KEY_PHRASE2 = "phrase";
|
|
299
|
-
var KEY_COUNT2 = "count";
|
|
300
|
-
var KEY_PEOPLE2 = "people";
|
|
301
|
-
var REQUIRED_TOP_LEVEL_KEYS = 4;
|
|
302
|
-
var PHRASE_KEYS = 3;
|
|
303
|
-
function isDay(value) {
|
|
304
|
-
if (!DAY_PATTERN.test(value)) return false;
|
|
305
|
-
const parsed = /* @__PURE__ */ new Date(`${value}T00:00:00.000Z`);
|
|
306
|
-
return !Number.isNaN(parsed.getTime()) && parsed.toISOString().slice(0, 10) === value;
|
|
307
|
-
}
|
|
308
|
-
function topLevelSize(header) {
|
|
309
|
-
const keys = REQUIRED_TOP_LEVEL_KEYS + (header.indexUuid === null ? 0 : 1);
|
|
310
|
-
return containerHeaderSize(keys) + stringSize(KEY_DAY) + stringSize(header.day) + stringSize(KEY_FINGERPRINT) + binarySize(header.fingerprint.byteLength) + stringSize(KEY_SAVED_AT) + uintSize(header.savedAt) + (header.indexUuid === null ? 0 : stringSize(KEY_INDEX_UUID) + stringSize(header.indexUuid)) + stringSize(KEY_GROUPS);
|
|
311
|
-
}
|
|
312
|
-
function writeTopLevel(writer, header) {
|
|
313
|
-
writer.map(REQUIRED_TOP_LEVEL_KEYS + (header.indexUuid === null ? 0 : 1));
|
|
314
|
-
writer.string(KEY_DAY);
|
|
315
|
-
writer.string(header.day);
|
|
316
|
-
writer.string(KEY_FINGERPRINT);
|
|
317
|
-
writer.binary(header.fingerprint, 0, header.fingerprint.byteLength);
|
|
318
|
-
writer.string(KEY_SAVED_AT);
|
|
319
|
-
writer.uint(header.savedAt);
|
|
320
|
-
if (header.indexUuid !== null) {
|
|
321
|
-
writer.string(KEY_INDEX_UUID);
|
|
322
|
-
writer.string(header.indexUuid);
|
|
323
|
-
}
|
|
324
|
-
writer.string(KEY_GROUPS);
|
|
325
|
-
}
|
|
326
|
-
function groupsSize(counts) {
|
|
327
|
-
let size = containerHeaderSize(counts.groupTables.size);
|
|
328
|
-
for (const [group, phrases] of counts.groupTables) {
|
|
329
|
-
size += stringSize(group) + containerHeaderSize(phrases.size);
|
|
330
|
-
for (const [phrase, number] of phrases) {
|
|
331
|
-
const people = counts.peopleLengthOf(number);
|
|
332
|
-
size += containerHeaderSize(PHRASE_KEYS) + stringSize(KEY_PHRASE2) + stringSize(phrase) + stringSize(KEY_COUNT2) + uintSize(counts.countOf(number)) + stringSize(KEY_PEOPLE2) + containerHeaderSize(people) + people * binarySize(SCRAMBLED_ID_BYTES);
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
|
-
return size;
|
|
336
|
-
}
|
|
337
|
-
function writeGroups(writer, counts) {
|
|
338
|
-
writer.map(counts.groupTables.size);
|
|
339
|
-
const people = counts.peopleBytes;
|
|
340
|
-
for (const [group, phrases] of counts.groupTables) {
|
|
341
|
-
writer.string(group);
|
|
342
|
-
writer.array(phrases.size);
|
|
343
|
-
for (const [phrase, number] of phrases) {
|
|
344
|
-
writer.map(PHRASE_KEYS);
|
|
345
|
-
writer.string(KEY_PHRASE2);
|
|
346
|
-
writer.string(phrase);
|
|
347
|
-
writer.string(KEY_COUNT2);
|
|
348
|
-
writer.uint(counts.countOf(number));
|
|
349
|
-
writer.string(KEY_PEOPLE2);
|
|
350
|
-
const length = counts.peopleLengthOf(number);
|
|
351
|
-
const offset = counts.peopleOffsetOf(number);
|
|
352
|
-
writer.array(length);
|
|
353
|
-
for (let i = 0; i < length; i++) writer.binary(people, offset + i * SCRAMBLED_ID_BYTES, SCRAMBLED_ID_BYTES);
|
|
354
|
-
}
|
|
355
|
-
}
|
|
356
|
-
}
|
|
357
|
-
function sealed(bytes, writer) {
|
|
358
|
-
if (writer.offset !== bytes.byteLength) throw new MalformedPayload("The query counts file took an unexpected size");
|
|
359
|
-
if (bytes.byteLength > MAX_HISTORY_FILE_BYTES) {
|
|
360
|
-
throw new MalformedPayload(`A query counts file must stay at or below ${MAX_HISTORY_FILE_BYTES} bytes`);
|
|
361
|
-
}
|
|
362
|
-
const payload = bytes.subarray(HEADER_SIZE);
|
|
363
|
-
const packed = packEnvelopeWithChecksum([payload], QUERY_COUNTS_FILE_FORMAT_VERSION, WHAT, crc32(payload));
|
|
364
|
-
bytes.set(packed.chunks[0], 0);
|
|
365
|
-
return bytes;
|
|
366
|
-
}
|
|
367
|
-
function encodeCountsFile(counts, header) {
|
|
368
|
-
const full = { ...header, day: counts.day };
|
|
369
|
-
const bytes = new Uint8Array(HEADER_SIZE + topLevelSize(full) + groupsSize(counts));
|
|
370
|
-
const writer = new ExactWriter(bytes, HEADER_SIZE);
|
|
371
|
-
writeTopLevel(writer, full);
|
|
372
|
-
writeGroups(writer, counts);
|
|
373
|
-
return sealed(bytes, writer);
|
|
374
|
-
}
|
|
375
|
-
function rewrittenFile(header, groups) {
|
|
376
|
-
const bytes = new Uint8Array(HEADER_SIZE + topLevelSize(header) + groups.byteLength);
|
|
377
|
-
const writer = new ExactWriter(bytes, HEADER_SIZE);
|
|
378
|
-
writeTopLevel(writer, header);
|
|
379
|
-
bytes.set(groups, writer.offset);
|
|
380
|
-
writer.skip(groups.byteLength);
|
|
381
|
-
return sealed(bytes, writer);
|
|
382
|
-
}
|
|
383
|
-
function readTopLevel(payload) {
|
|
384
|
-
const reader = new StrictReader(payload, 0);
|
|
385
|
-
const keys = reader.map();
|
|
386
|
-
let day = null;
|
|
387
|
-
let fingerprint = null;
|
|
388
|
-
let savedAt = null;
|
|
389
|
-
let indexUuid = null;
|
|
390
|
-
let groupsStart = null;
|
|
391
|
-
let groupsEnd = 0;
|
|
392
|
-
const seen = /* @__PURE__ */ new Set();
|
|
393
|
-
for (let i = 0; i < keys; i++) {
|
|
394
|
-
const key = reader.string();
|
|
395
|
-
if (seen.has(key)) throw new MalformedPayload(`The file holds the key "${key}" twice`);
|
|
396
|
-
seen.add(key);
|
|
397
|
-
if (key === KEY_DAY) day = reader.string();
|
|
398
|
-
else if (key === KEY_FINGERPRINT) {
|
|
399
|
-
const { offset, length } = reader.binary();
|
|
400
|
-
fingerprint = payload.subarray(offset, offset + length);
|
|
401
|
-
} else if (key === KEY_SAVED_AT) savedAt = reader.uint();
|
|
402
|
-
else if (key === KEY_INDEX_UUID) {
|
|
403
|
-
indexUuid = reader.string();
|
|
404
|
-
if (indexUuid.length === 0 || indexUuid.length > MAX_INDEX_UUID_LENGTH) {
|
|
405
|
-
throw new MalformedPayload("The file holds an indexUuid of the wrong length");
|
|
406
|
-
}
|
|
407
|
-
} else if (key === KEY_GROUPS) {
|
|
408
|
-
groupsStart = reader.offset;
|
|
409
|
-
walkGroups(reader, payload, null);
|
|
410
|
-
groupsEnd = reader.offset;
|
|
411
|
-
} else throw new MalformedPayload(`The file holds an unexpected key "${key}"`);
|
|
412
|
-
}
|
|
413
|
-
if (!reader.atEnd) throw new MalformedPayload("The payload holds bytes after its map");
|
|
414
|
-
if (day === null || fingerprint === null || savedAt === null || groupsStart === null) {
|
|
415
|
-
throw new MalformedPayload("The file lacks a required key");
|
|
416
|
-
}
|
|
417
|
-
return { day, fingerprint, savedAt, indexUuid, groupsStart, groupsEnd };
|
|
418
|
-
}
|
|
419
|
-
async function openCountsFile(bytes, expectedDay, fingerprint) {
|
|
420
|
-
if (bytes.byteLength > MAX_HISTORY_FILE_BYTES) {
|
|
421
|
-
return { kind: "damaged", reason: `The file is longer than ${MAX_HISTORY_FILE_BYTES} bytes` };
|
|
422
|
-
}
|
|
423
|
-
let payload;
|
|
424
|
-
try {
|
|
425
|
-
payload = (await openChecksummedEnvelope(bytes, {
|
|
426
|
-
envelopeFormatVersion: QUERY_COUNTS_FILE_FORMAT_VERSION,
|
|
427
|
-
what: WHAT,
|
|
428
|
-
allowsCompression: false
|
|
429
|
-
})).payload;
|
|
430
|
-
} catch (error) {
|
|
431
|
-
return { kind: "damaged", reason: error instanceof Error ? error.message : String(error) };
|
|
432
|
-
}
|
|
433
|
-
let top;
|
|
434
|
-
try {
|
|
435
|
-
top = readTopLevel(payload);
|
|
436
|
-
} catch (error) {
|
|
437
|
-
if (error instanceof MalformedPayload) return { kind: "damaged", reason: error.message };
|
|
438
|
-
throw error;
|
|
439
|
-
}
|
|
440
|
-
if (!isDay(top.day) || expectedDay !== null && top.day !== expectedDay) {
|
|
441
|
-
return { kind: "damaged", reason: "The file holds a day that differs from its key" };
|
|
442
|
-
}
|
|
443
|
-
if (top.fingerprint.byteLength !== KEY_FINGERPRINT_BYTES) {
|
|
444
|
-
return { kind: "damaged", reason: "The key fingerprint has the wrong length" };
|
|
445
|
-
}
|
|
446
|
-
if (!sameBytes(top.fingerprint, fingerprint)) return { kind: "other-key" };
|
|
447
|
-
const { groupsStart, groupsEnd, ...header } = top;
|
|
448
|
-
return {
|
|
449
|
-
kind: "counts",
|
|
450
|
-
...header,
|
|
451
|
-
visit(visitor) {
|
|
452
|
-
walkGroups(new StrictReader(payload, groupsStart), payload, visitor);
|
|
453
|
-
},
|
|
454
|
-
groupNames() {
|
|
455
|
-
const names = [];
|
|
456
|
-
walkGroups(new StrictReader(payload, groupsStart), payload, null, (group) => names.push(group));
|
|
457
|
-
return names;
|
|
458
|
-
},
|
|
459
|
-
withIndexUuid(indexUuid, savedAt) {
|
|
460
|
-
return rewrittenFile({ ...header, indexUuid, savedAt }, payload.subarray(groupsStart, groupsEnd));
|
|
461
|
-
}
|
|
462
|
-
};
|
|
463
|
-
}
|
|
464
|
-
function sameBytes(left, right) {
|
|
465
|
-
if (left.byteLength !== right.byteLength) return false;
|
|
466
|
-
for (let i = 0; i < left.byteLength; i++) if (left[i] !== right[i]) return false;
|
|
467
|
-
return true;
|
|
468
|
-
}
|
|
469
|
-
|
|
470
|
-
export { encodeCountsFile, openCountsFile, sameBytes };
|
package/dist/chunk-Q2UL2TPC.mjs
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { V8_YOUNG_GENERATION_BYTES_BY_MAJOR } from './chunk-ZXNQEW43.mjs';
|
|
2
|
-
|
|
3
|
-
// src/runtime/engine-threads.ts
|
|
4
|
-
var MEGABYTE_BYTES = 1048576;
|
|
5
|
-
var threadYoungGenerationBytes = 0;
|
|
6
|
-
function youngGenerationBytesOfThisV8() {
|
|
7
|
-
const major = Number(globalThis.process?.versions?.v8?.split(".")[0]);
|
|
8
|
-
return V8_YOUNG_GENERATION_BYTES_BY_MAJOR[major] ?? Math.max(...Object.values(V8_YOUNG_GENERATION_BYTES_BY_MAJOR));
|
|
9
|
-
}
|
|
10
|
-
function countEngineThread(thread, youngGenerationMb) {
|
|
11
|
-
const bytes = youngGenerationMb === void 0 ? youngGenerationBytesOfThisV8() : youngGenerationMb * MEGABYTE_BYTES;
|
|
12
|
-
threadYoungGenerationBytes += bytes;
|
|
13
|
-
thread.once("exit", () => {
|
|
14
|
-
threadYoungGenerationBytes -= bytes;
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
function engineThreadYoungGenerationBytes() {
|
|
18
|
-
return threadYoungGenerationBytes;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export { countEngineThread, engineThreadYoungGenerationBytes, youngGenerationBytesOfThisV8 };
|
package/dist/chunk-QHPYS427.mjs
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
// src/workers/protocol.ts
|
|
2
|
-
var KNOWN_ACTION_TYPES = [
|
|
3
|
-
"insert",
|
|
4
|
-
"remove",
|
|
5
|
-
"update",
|
|
6
|
-
"query",
|
|
7
|
-
"preflight",
|
|
8
|
-
"get",
|
|
9
|
-
"has",
|
|
10
|
-
"count",
|
|
11
|
-
"createIndex",
|
|
12
|
-
"replaceSynonyms",
|
|
13
|
-
"replaceBm25",
|
|
14
|
-
"copyLoaded",
|
|
15
|
-
"loadVectorCopy",
|
|
16
|
-
"dropVectorCopy",
|
|
17
|
-
"insertVectorOrdinals",
|
|
18
|
-
"serveRequests",
|
|
19
|
-
"serveLongQueries",
|
|
20
|
-
"stopServing",
|
|
21
|
-
"dropIndex",
|
|
22
|
-
"getStats",
|
|
23
|
-
"clear",
|
|
24
|
-
"serialize",
|
|
25
|
-
"deserialize",
|
|
26
|
-
"buildSegment",
|
|
27
|
-
"mergeSegments",
|
|
28
|
-
"attachSegments",
|
|
29
|
-
"compactSegments",
|
|
30
|
-
"swapSegments",
|
|
31
|
-
"freezeLiveTail",
|
|
32
|
-
"adoptDiskSegments",
|
|
33
|
-
"memoryReport",
|
|
34
|
-
"bootstrap",
|
|
35
|
-
"shutdown"
|
|
36
|
-
];
|
|
37
|
-
var nextRequestSequence = 0;
|
|
38
|
-
function createRequestId() {
|
|
39
|
-
nextRequestSequence += 1;
|
|
40
|
-
return String(nextRequestSequence);
|
|
41
|
-
}
|
|
42
|
-
function isValidWorkerAction(msg) {
|
|
43
|
-
if (msg === null || msg === void 0 || typeof msg !== "object") {
|
|
44
|
-
return false;
|
|
45
|
-
}
|
|
46
|
-
const candidate = msg;
|
|
47
|
-
if (typeof candidate.type !== "string" || typeof candidate.requestId !== "string") {
|
|
48
|
-
return false;
|
|
49
|
-
}
|
|
50
|
-
return KNOWN_ACTION_TYPES.includes(candidate.type);
|
|
51
|
-
}
|
|
52
|
-
function isValidWorkerResponse(msg) {
|
|
53
|
-
if (msg === null || msg === void 0 || typeof msg !== "object") {
|
|
54
|
-
return false;
|
|
55
|
-
}
|
|
56
|
-
const candidate = msg;
|
|
57
|
-
if (typeof candidate.requestId !== "string") {
|
|
58
|
-
return false;
|
|
59
|
-
}
|
|
60
|
-
if (candidate.type !== "success" && candidate.type !== "error") {
|
|
61
|
-
return false;
|
|
62
|
-
}
|
|
63
|
-
return true;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
export { createRequestId, isValidWorkerAction, isValidWorkerResponse };
|
package/dist/chunk-QJVOLKU6.mjs
DELETED
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
import { newSyncEpoch } from './chunk-BUMREPLU.mjs';
|
|
2
|
-
import { oneSyncChangeAtATime } from './chunk-V6EUBAIT.mjs';
|
|
3
|
-
import { withOpenIndex, emitSyncChange } from './chunk-Y4WPNHMC.mjs';
|
|
4
|
-
import { NarsilError, ErrorCodes } from './chunk-MP7ABPTD.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 };
|
package/dist/chunk-QLDABJZM.mjs
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { localRuntimeOf } from './chunk-VSLSGASN.mjs';
|
|
2
|
-
import { boundQuerySuggestionsOf, querySuggestionsOf } from './chunk-SOI6LTHM.mjs';
|
|
3
|
-
import { engineCoreOf } from './chunk-FEZVDOWX.mjs';
|
|
4
|
-
import { NarsilError, ErrorCodes } from './chunk-MP7ABPTD.mjs';
|
|
5
|
-
|
|
6
|
-
// src/query-suggestions/index.ts
|
|
7
|
-
function querySuggestions(engine) {
|
|
8
|
-
const bound = boundQuerySuggestionsOf(engine);
|
|
9
|
-
if (bound !== void 0) return bound();
|
|
10
|
-
const core = engineCoreOf(engine);
|
|
11
|
-
if (core === void 0) {
|
|
12
|
-
throw new NarsilError(
|
|
13
|
-
ErrorCodes.CONFIG_INVALID,
|
|
14
|
-
"Popular query suggestions need an engine that createNarsil made in this process"
|
|
15
|
-
);
|
|
16
|
-
}
|
|
17
|
-
return querySuggestionsOf(() => localRuntimeOf(core, engine, void 0));
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export { querySuggestions };
|