@delali/narsil 0.3.1-next.98 → 0.4.0
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/NOTICE +45 -0
- package/README.md +27 -8
- package/dist/adapters/filesystem.d.ts +1 -1
- package/dist/adapters/filesystem.mjs +101 -13
- package/dist/adapters/gcs.d.ts +49 -0
- package/dist/adapters/gcs.mjs +213 -0
- package/dist/adapters/indexeddb.d.ts +1 -1
- package/dist/adapters/indexeddb.mjs +2 -7
- package/dist/adapters/memory.d.ts +1 -1
- package/dist/adapters/memory.mjs +5 -0
- package/dist/adapters/s3.d.ts +53 -0
- package/dist/adapters/s3.mjs +263 -0
- package/dist/{adapters-BQFQ4PRz.d.ts → adapters-pljAqmrC.d.ts} +33 -0
- package/dist/browser/chunk-4E5APHTM.mjs +1459 -0
- package/dist/browser/chunk-NDYADQ4Y.mjs +23426 -0
- package/dist/browser/chunk-QAOVAYAG.mjs +564 -0
- package/dist/browser/chunk-WC2DEXWU.mjs +29 -0
- package/dist/browser/chunk-YINZFPLT.mjs +1239 -0
- package/dist/browser/chunk-YJHGOJAC.mjs +15 -0
- package/dist/browser/{chunk-Z7QH2XHB.mjs → core-leaf-HWAXCEWX.mjs} +3987 -2103
- package/dist/browser/custom-token-results-R5BIX7SL.mjs +59 -0
- package/dist/browser/digest-leaf-64IPRPZD.mjs +151 -0
- package/dist/browser/durability-config-75NSFCQN.mjs +97 -0
- package/dist/browser/embed-GG6PS3EA.mjs +264 -0
- package/dist/browser/geo-index-GNHY4PUB.mjs +1484 -0
- package/dist/browser/gzip-JF3S6PPT.mjs +31 -0
- package/dist/browser/module-ZZTNG5JZ.mjs +5762 -0
- package/dist/browser/msgpack-leaf-44XNWSSY.mjs +302 -0
- package/dist/browser/optional-reads-XMVPG6HG.mjs +3230 -0
- package/dist/browser/optional-writes-76DWMRQH.mjs +3603 -0
- package/dist/browser/phrase-module-6UGFVW5J.mjs +617 -0
- package/dist/browser/resolve-vector-text-XRR2OVHE.mjs +85 -0
- package/dist/browser/restore-queue-SG5O735W.mjs +196 -0
- package/dist/browser/{runtime-NYE5TB6O.mjs → runtime-OMKE7DF4.mjs} +83 -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-5UTR5K7J.mjs +19829 -0
- package/dist/browser/store-leaf-3L33V35P.mjs +2070 -0
- package/dist/browser/suggestions-leaf-UBNDVKBD.mjs +1430 -0
- package/dist/browser/worker-copies-JXSGYR5X.mjs +2951 -0
- package/dist/{capabilities-BTTIs96E.d.ts → capabilities-DMte5K9_.d.ts} +162 -18
- package/dist/chunk-2AFZE7Y3.mjs +72 -0
- package/dist/chunk-2CKDCC65.mjs +47 -0
- package/dist/chunk-3ECIRFS5.mjs +61 -0
- package/dist/chunk-44W3CBNG.mjs +7 -0
- package/dist/chunk-4H4RG2FR.mjs +13 -0
- package/dist/chunk-4PY4JYMY.mjs +11 -0
- package/dist/chunk-4ZPVAHWF.mjs +1289 -0
- package/dist/chunk-5EI5CXO6.mjs +197 -0
- package/dist/chunk-5F5MXWS5.mjs +283 -0
- package/dist/{chunk-OHP7QR33.mjs → chunk-5FLRXF73.mjs} +25 -4
- package/dist/chunk-6FOENO4E.mjs +273 -0
- package/dist/chunk-6GHX35ZM.mjs +108 -0
- package/dist/chunk-6MSZ543Y.mjs +32 -0
- package/dist/chunk-6N6HHBCQ.mjs +4596 -0
- package/dist/{chunk-LXPIXDUJ.mjs → chunk-7P5YWDRQ.mjs} +403 -169
- package/dist/{chunk-TGP5M5R7.mjs → chunk-7T4LAYT4.mjs} +1 -1
- package/dist/{chunk-GGSH6KBQ.mjs → chunk-ASZLNVWW.mjs} +23 -3
- package/dist/chunk-AVBPB3MI.mjs +602 -0
- package/dist/{chunk-UCDF35PU.mjs → chunk-AVGUEEQ3.mjs} +494 -245
- package/dist/chunk-BUMREPLU.mjs +15 -0
- package/dist/chunk-BY6NALRK.mjs +31921 -0
- package/dist/chunk-C4ZMXXTL.mjs +92 -0
- package/dist/{chunk-2WYMG3OZ.mjs → chunk-C74KPRR7.mjs} +274 -19
- package/dist/{chunk-RSRVGAIQ.mjs → chunk-D456ZFPQ.mjs} +3 -2
- package/dist/chunk-DXZ6JDWG.mjs +797 -0
- package/dist/chunk-FJXJZUWF.mjs +209 -0
- package/dist/chunk-FS3HPPSC.mjs +212 -0
- package/dist/chunk-FT4KLZXW.mjs +1164 -0
- package/dist/chunk-GR5GMFJJ.mjs +104 -0
- package/dist/chunk-GXCDWLQI.mjs +193 -0
- package/dist/chunk-GXED6R3Q.mjs +271 -0
- package/dist/chunk-HLPRHOSO.mjs +17 -0
- package/dist/chunk-IL5DRCNU.mjs +3041 -0
- package/dist/{chunk-P36MUFEJ.mjs → chunk-JDDXV6UF.mjs} +2 -1
- package/dist/chunk-K5HSUPYS.mjs +11 -0
- package/dist/chunk-KYIRXTCA.mjs +100 -0
- package/dist/chunk-LFXS6OF7.mjs +289 -0
- package/dist/chunk-LNGE7SLY.mjs +151 -0
- package/dist/chunk-M2Z5WVWW.mjs +194 -0
- package/dist/{chunk-45AVKHMJ.mjs → chunk-M3B7SGJB.mjs} +63 -50
- package/dist/chunk-M3OW2XSP.mjs +40 -0
- package/dist/chunk-MFPSQZ6P.mjs +127 -0
- package/dist/chunk-MRCJBWJZ.mjs +1292 -0
- package/dist/chunk-MSIN4NM3.mjs +25 -0
- package/dist/chunk-MW3CJVGP.mjs +219 -0
- package/dist/chunk-MYM6CAVK.mjs +76 -0
- package/dist/chunk-NJJN4FMM.mjs +84 -0
- package/dist/chunk-NM7I3BM7.mjs +59 -0
- package/dist/chunk-OIJ64LGT.mjs +19 -0
- package/dist/{chunk-K7D4ZTSW.mjs → chunk-P4F4UWLC.mjs} +1 -1
- package/dist/chunk-Q2AP2FSN.mjs +15 -0
- package/dist/chunk-R2PJKSNL.mjs +54 -0
- package/dist/{chunk-HXJBSHXF.mjs → chunk-R724DJSG.mjs} +5056 -2619
- package/dist/chunk-S2POFTLN.mjs +10 -0
- package/dist/chunk-S5QMWECL.mjs +7 -0
- package/dist/chunk-SLAC5PAB.mjs +5008 -0
- package/dist/chunk-T4HMSZCX.mjs +5 -0
- package/dist/chunk-TACP6VK6.mjs +111 -0
- package/dist/chunk-TGPKS2UM.mjs +125 -0
- package/dist/chunk-TKKXPKEO.mjs +979 -0
- package/dist/chunk-V6EUBAIT.mjs +19 -0
- package/dist/chunk-XL56L4IR.mjs +228 -0
- package/dist/chunk-XQIAMDAG.mjs +3076 -0
- package/dist/chunk-YTUZ4R22.mjs +1063 -0
- package/dist/{chunk-KV3AZFT3.mjs → chunk-ZKOQR7EA.mjs} +45 -1
- package/dist/chunk-ZPJFGGGI.mjs +638 -0
- package/dist/chunk-ZXX5GZEX.mjs +17 -0
- package/dist/{client-i9eLJrw5.d.ts → client-BKqtl0_V.d.ts} +442 -22
- package/dist/client.d.ts +11 -10
- package/dist/client.mjs +8 -898
- package/dist/config-Bnl7L-0H.d.ts +608 -0
- package/dist/{config-P__Diiy4.d.ts → config-CJ-jfI0a.d.ts} +119 -9
- package/dist/core-leaf-6JVHEVFB.mjs +8 -0
- package/dist/custom-token-results-NXHBVY7U.mjs +59 -0
- package/dist/digest-leaf-KXBGKYHZ.mjs +1 -0
- package/dist/direct-executor-V3WOYU2Y.mjs +17 -0
- package/dist/distribution/coordinator/etcd.d.ts +63 -7
- package/dist/distribution/coordinator/etcd.mjs +725 -81
- package/dist/distribution/coordinator/in-memory.d.ts +3 -3
- package/dist/distribution/coordinator/in-memory.mjs +65 -10
- package/dist/distribution/transport/grpc.d.ts +2 -2
- package/dist/distribution/transport/grpc.mjs +39 -10
- package/dist/distribution/transport/in-memory.d.ts +2 -2
- package/dist/distribution/transport/in-memory.mjs +9 -6
- package/dist/distribution/transport/tcp.d.ts +2 -2
- package/dist/distribution/transport/tcp.mjs +20 -15
- package/dist/distribution.d.ts +267 -56
- package/dist/distribution.mjs +23156 -11362
- package/dist/durability-config-VWS2K24E.mjs +96 -0
- package/dist/embed-4PHHKGBK.mjs +263 -0
- package/dist/embeddings/openai.d.ts +1 -1
- package/dist/embeddings/openai.mjs +2 -2
- package/dist/{memory-CUEDwr-F.d.ts → engine-qjAxJSKk.d.ts} +2254 -1123
- package/dist/geo-index-2ZMMWWSK.mjs +1484 -0
- package/dist/gzip-2UCZW2MM.mjs +31 -0
- package/dist/{index-lcdGLyJH.d.ts → index-B_vmxpgW.d.ts} +260 -102
- package/dist/index.browser.mjs +4 -4
- package/dist/index.d.ts +2133 -57
- package/dist/index.mjs +16 -32
- package/dist/index.react-native.mjs +12 -0
- package/dist/invalidation/broadcast-channel.d.ts +1 -1
- package/dist/invalidation/filesystem.d.ts +1 -1
- package/dist/invalidation/filesystem.mjs +1 -2
- package/dist/invalidation/noop.d.ts +1 -1
- 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-UCRK7MSI.mjs +154 -0
- package/dist/module-5ZSLUQII.mjs +3729 -0
- package/dist/msgpack-leaf-H5ZYW7S7.mjs +9 -0
- package/dist/optional-reads-5HFMF2QZ.mjs +3373 -0
- package/dist/optional-writes-4UOQKETU.mjs +247 -0
- package/dist/paged-partition-archive-BBRLZCIF.mjs +253 -0
- package/dist/partial-words.browser.mjs +1650 -0
- package/dist/partial-words.mjs +17 -11
- package/dist/{chunk-ASY5PHYI.mjs → pattern.browser.mjs} +253 -311
- package/dist/pattern.mjs +6 -7
- package/dist/persistence/durability/checkpoint-worker.d.ts +93 -25
- package/dist/persistence/durability/checkpoint-worker.mjs +51 -41
- package/dist/phrase-module-EFESWOCR.mjs +635 -0
- package/dist/query-actions-HMJUVWGT.mjs +119 -0
- package/dist/query-suggestions/merge-worker.d.ts +55 -0
- package/dist/query-suggestions/merge-worker.mjs +53 -0
- package/dist/query-suggestions-CBYkrQ5T.d.ts +311 -0
- package/dist/query-suggestions.browser.mjs +47 -0
- package/dist/query-suggestions.d.ts +20 -0
- package/dist/query-suggestions.mjs +19 -0
- package/dist/react-native/chunks/chunk-3OEFSHVV.mjs +970 -0
- package/dist/{browser/chunk-RELZRJNR.mjs → react-native/chunks/chunk-43R4GCM7.mjs} +49 -50
- package/dist/react-native/chunks/chunk-AKRYHAVG.mjs +6729 -0
- package/dist/react-native/chunks/chunk-CW2ZFXSE.mjs +14 -0
- package/dist/react-native/chunks/chunk-G3WCDTOF.mjs +29640 -0
- package/dist/react-native/chunks/chunk-GXXHHA2T.mjs +212 -0
- package/dist/react-native/chunks/chunk-H3MDVPBO.mjs +151 -0
- package/dist/react-native/chunks/chunk-HQEVQEDJ.mjs +52 -0
- package/dist/react-native/chunks/chunk-HRDMIQ63.mjs +131 -0
- package/dist/react-native/chunks/chunk-HTBY4GON.mjs +565 -0
- package/dist/react-native/chunks/chunk-LX62Y4B5.mjs +61 -0
- package/dist/react-native/chunks/chunk-MRH36RN3.mjs +902 -0
- package/dist/react-native/chunks/chunk-Q32DDFKX.mjs +19 -0
- package/dist/react-native/chunks/chunk-UE4ANHSX.mjs +127 -0
- package/dist/react-native/chunks/chunk-UNZPWLVL.mjs +1063 -0
- package/dist/react-native/chunks/chunk-UO44MA5M.mjs +232 -0
- package/dist/react-native/chunks/chunk-UYKIV2KT.mjs +42 -0
- package/dist/react-native/chunks/chunk-VUJCSQG5.mjs +11 -0
- package/dist/react-native/chunks/chunk-WVHF4ZAK.mjs +802 -0
- package/dist/react-native/chunks/chunk-ZUJCUPVS.mjs +54 -0
- package/dist/react-native/chunks/core-leaf-S2KNBWDY.mjs +7 -0
- package/dist/react-native/chunks/custom-token-results-3OZEMRE7.mjs +59 -0
- package/dist/react-native/chunks/digest-leaf-X6OIFDIU.mjs +1 -0
- package/dist/react-native/chunks/durability-config-FCSD4MXY.mjs +96 -0
- package/dist/react-native/chunks/embed-HA2I7RCF.mjs +263 -0
- package/dist/react-native/chunks/geo-index-QEYKEVPH.mjs +1484 -0
- package/dist/react-native/chunks/gzip.react-native-CVM4NQG2.mjs +12 -0
- package/dist/react-native/chunks/module-FMBX75GP.mjs +5209 -0
- package/dist/react-native/chunks/msgpack-leaf-JMNGSTRW.mjs +7 -0
- package/dist/react-native/chunks/optional-reads-AFPO2FEB.mjs +3364 -0
- package/dist/react-native/chunks/optional-writes-XOH25XZI.mjs +296 -0
- package/dist/react-native/chunks/phrase-module-IGYBK7XH.mjs +636 -0
- package/dist/react-native/chunks/replace-IMZUVUOE.mjs +57 -0
- package/dist/react-native/chunks/resolve-vector-text-GE2CRJKI.mjs +84 -0
- package/dist/react-native/chunks/restore-queue-LLNMYB4Z.mjs +187 -0
- package/dist/react-native/chunks/runtime-UOHD2XUJ.mjs +615 -0
- package/dist/react-native/chunks/segment-codec-leaf-VR6O5GLC.mjs +13 -0
- package/dist/react-native/chunks/segment-merge-leaf-LLMWU4EW.mjs +14 -0
- package/dist/react-native/chunks/storage-leaf-JD7PIDO4.mjs +19633 -0
- package/dist/react-native/chunks/store-leaf-4UVCMYGN.mjs +15 -0
- package/dist/react-native/chunks/suggestions-leaf-J5VT5RHY.mjs +1321 -0
- package/dist/react-native/chunks/worker-copies-ZYHY7FKJ.mjs +2831 -0
- package/dist/react-native/partial-words.mjs +1658 -0
- package/dist/react-native/pattern.mjs +2570 -0
- package/dist/react-native/query-suggestions.mjs +55 -0
- package/dist/react-native/sync.mjs +2759 -0
- package/dist/react-native/synonyms.mjs +676 -0
- package/dist/react.d.ts +12 -8
- package/dist/react.mjs +45 -1
- package/dist/{rerank-NWTKK636.mjs → rerank-RI2PMNOD.mjs} +22 -12
- package/dist/rerankers/http.d.ts +1 -1
- package/dist/rerankers/http.mjs +2 -2
- package/dist/resolve-vector-text-OD4J3WHF.mjs +3 -0
- package/dist/restore-queue-PCKWDAKQ.mjs +192 -0
- package/dist/runtime-USQYKN3I.mjs +615 -0
- package/dist/{schema-4W_7tk1f.d.ts → schema-CzG9OUw5.d.ts} +70 -30
- package/dist/segment-codec-leaf-QJM7I6QG.mjs +18 -0
- package/dist/segment-merge-leaf-4BJGIJHY.mjs +18 -0
- package/dist/server.d.ts +348 -22
- package/dist/server.mjs +2211 -327
- package/dist/storage-leaf-GRRRI7UV.mjs +5962 -0
- package/dist/store-leaf-6VMMSVBE.mjs +20 -0
- package/dist/stored-values-BWIMpiT_.d.ts +25 -0
- package/dist/suggestions-leaf-4KPTMPTL.mjs +54 -0
- package/dist/sync/filesystem.d.ts +30 -0
- package/dist/sync/filesystem.mjs +288 -0
- package/dist/sync/indexeddb.browser.mjs +287 -0
- package/dist/sync/indexeddb.d.ts +30 -0
- package/dist/sync/indexeddb.mjs +242 -0
- package/dist/sync.browser.mjs +1271 -0
- package/dist/sync.d.ts +23 -0
- package/dist/sync.mjs +2712 -0
- package/dist/synonyms.browser.mjs +658 -0
- package/dist/synonyms.mjs +17 -7
- package/dist/tasks-65b6t6lk.d.ts +782 -0
- package/dist/thread-UJ3W5LVI.mjs +31 -0
- package/dist/{types-B3b68nfF.d.ts → types-Ck97nB3D.d.ts} +1 -1
- package/dist/types-CpCg-Gq-.d.ts +227 -0
- package/dist/{types-Cb9kiY5P.d.ts → types-DvncmvuQ.d.ts} +12 -1
- package/dist/vector/search-worker.d.ts +10 -2
- package/dist/vector/search-worker.mjs +11 -11
- package/dist/worker-copies-YSXZXIGC.mjs +2232 -0
- package/dist/workers/entry.mjs +75 -15
- package/openapi.json +6840 -0
- package/package.json +406 -19
- package/dist/browser/chunk-CN4I4FZU.mjs +0 -602
- package/dist/browser/chunk-HOZW3PKP.mjs +0 -9
- package/dist/browser/chunk-JPTQZWJQ.mjs +0 -10
- package/dist/browser/chunk-LD55ZGU3.mjs +0 -347
- package/dist/browser/chunk-NAFT3K6X.mjs +0 -24546
- package/dist/browser/chunk-NNG3EEB6.mjs +0 -2728
- package/dist/browser/chunk-QWES44AW.mjs +0 -473
- package/dist/browser/durability-wiring-PY3L7DES.mjs +0 -3679
- package/dist/browser/module-PDXYHT75.mjs +0 -2822
- package/dist/browser/release-76MXRPGV.mjs +0 -33
- package/dist/browser/restore-queue-DVIYJ7RU.mjs +0 -35
- package/dist/browser/snapshot-J57MZK6L.mjs +0 -1207
- package/dist/browser/write-L7FAQA47.mjs +0 -208
- package/dist/chunk-37CD3OKS.mjs +0 -87
- package/dist/chunk-5XNIRLFC.mjs +0 -96
- package/dist/chunk-7X5JST5L.mjs +0 -114
- package/dist/chunk-AV4IJKD2.mjs +0 -35
- package/dist/chunk-AY3AQ3UH.mjs +0 -73
- package/dist/chunk-BKB3XTMI.mjs +0 -707
- package/dist/chunk-C7SLA6CM.mjs +0 -19
- package/dist/chunk-COVCQ73F.mjs +0 -587
- package/dist/chunk-DJHHF2L5.mjs +0 -17
- package/dist/chunk-E74YLAIG.mjs +0 -24
- package/dist/chunk-FMWRCP2C.mjs +0 -57
- package/dist/chunk-GES7U2PM.mjs +0 -68
- package/dist/chunk-HJSN7UYG.mjs +0 -10
- package/dist/chunk-JFRNNBOM.mjs +0 -35
- package/dist/chunk-K25LZA54.mjs +0 -8484
- package/dist/chunk-KEHK2O6P.mjs +0 -13
- package/dist/chunk-KOKM4PQN.mjs +0 -52
- package/dist/chunk-KZ3NX2P7.mjs +0 -21
- package/dist/chunk-L3L5YFXC.mjs +0 -614
- package/dist/chunk-L5ORED7V.mjs +0 -25
- package/dist/chunk-LH4NZNJJ.mjs +0 -1731
- package/dist/chunk-LU2CE5AE.mjs +0 -507
- package/dist/chunk-LXWDQLTW.mjs +0 -30
- package/dist/chunk-MHOSCQCQ.mjs +0 -948
- package/dist/chunk-NKRBEGJZ.mjs +0 -1705
- package/dist/chunk-NTRMFARG.mjs +0 -462
- package/dist/chunk-NW4XDSP2.mjs +0 -212
- package/dist/chunk-OOEXLUGR.mjs +0 -117
- package/dist/chunk-ORBLD3EL.mjs +0 -6
- package/dist/chunk-OWNZYMRE.mjs +0 -3591
- package/dist/chunk-PPY2GSIB.mjs +0 -44
- package/dist/chunk-QY7GC2MW.mjs +0 -33
- package/dist/chunk-R6A773WK.mjs +0 -226
- package/dist/chunk-R6PR4WYZ.mjs +0 -68
- package/dist/chunk-R7EEKAJE.mjs +0 -593
- package/dist/chunk-RONEOEON.mjs +0 -426
- package/dist/chunk-VWULPWRJ.mjs +0 -7469
- package/dist/chunk-WCJKUGHB.mjs +0 -262
- package/dist/chunk-WQBCBKY3.mjs +0 -8
- package/dist/chunk-X5CV2E2B.mjs +0 -1
- package/dist/chunk-YA7XLE2R.mjs +0 -1256
- package/dist/chunk-YTJCGKM4.mjs +0 -56
- package/dist/chunk-ZG477IPV.mjs +0 -526
- package/dist/chunk-ZYNAMIYX.mjs +0 -113
- package/dist/config-BGB_fDtq.d.ts +0 -237
- package/dist/direct-executor-CXZ66ACP.mjs +0 -22
- package/dist/durability-wiring-QTHOGFMZ.mjs +0 -3229
- package/dist/engine-BGCEm9E_.d.ts +0 -577
- package/dist/module-3NONKBZX.mjs +0 -1860
- package/dist/release-BH3DKW3T.mjs +0 -33
- package/dist/restore-queue-JPRBUYII.mjs +0 -35
- package/dist/runtime-ZKYZFJJC.mjs +0 -177
- package/dist/snapshot-HOGXNO5W.mjs +0 -793
- package/dist/tasks-HG3rlxx6.d.ts +0 -302
- package/dist/thread-B657LQXK.mjs +0 -692
- package/dist/write-XLIGTXBU.mjs +0 -238
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { E as EmbeddingAdapter, R as RerankAdapter } from './adapters-
|
|
2
|
-
import { C as ClusterNamespace } from './config-
|
|
3
|
-
import {
|
|
1
|
+
import { E as EmbeddingAdapter, R as RerankAdapter } from './adapters-pljAqmrC.js';
|
|
2
|
+
import { C as ClusterNamespace } from './config-Bnl7L-0H.js';
|
|
3
|
+
import { l as RecordedQuery } from './query-suggestions-CBYkrQ5T.js';
|
|
4
|
+
import { E as ErrorDetail, j as TaskStore } from './tasks-65b6t6lk.js';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* Context handed to {@link OnRequestHook} for every inbound request, captured
|
|
@@ -34,17 +35,92 @@ interface RequestDenial {
|
|
|
34
35
|
/** The error envelope carries this description. */
|
|
35
36
|
message: string;
|
|
36
37
|
}
|
|
38
|
+
/**
|
|
39
|
+
* Returned by an {@link OnRequestHook} to admit a request under a credential
|
|
40
|
+
* that expires. The server closes a device sync feed or a change feed with
|
|
41
|
+
* close code 4401 at `expiresAt`, so that the peer has to reconnect with a
|
|
42
|
+
* fresh credential, and it treats the grant on every other route as
|
|
43
|
+
* `undefined`.
|
|
44
|
+
*
|
|
45
|
+
* @public
|
|
46
|
+
*/
|
|
47
|
+
interface RequestGrant {
|
|
48
|
+
/** The credential that admitted the request expires at this time, in milliseconds since the Unix epoch. */
|
|
49
|
+
expiresAt: number;
|
|
50
|
+
}
|
|
37
51
|
/**
|
|
38
52
|
* Runs before every routed request, which is where authentication, rate
|
|
39
|
-
* limiting, and any other admission rule goes.
|
|
53
|
+
* limiting, and any other admission rule goes. It also runs on the upgrade
|
|
54
|
+
* of a device sync feed or a change feed, where a browser can carry its
|
|
55
|
+
* credential as a `Sec-WebSocket-Protocol` value after `narsil.sync.v1` or
|
|
56
|
+
* `narsil.changes.v1`, because a browser can set no other header on a
|
|
57
|
+
* WebSocket.
|
|
40
58
|
*
|
|
41
59
|
* @param ctx - The request's method, path, headers, and peer address.
|
|
42
|
-
* @returns A {@link RequestDenial} to reject the request,
|
|
43
|
-
* let it through
|
|
60
|
+
* @returns A {@link RequestDenial} to reject the request, a
|
|
61
|
+
* {@link RequestGrant} to let it through until its credential expires, or
|
|
62
|
+
* `undefined` to let it through.
|
|
63
|
+
*
|
|
64
|
+
* @public
|
|
65
|
+
*/
|
|
66
|
+
type OnRequestHook = (ctx: RequestContext) => undefined | RequestDenial | RequestGrant | Promise<undefined | RequestDenial | RequestGrant>;
|
|
67
|
+
/**
|
|
68
|
+
* The settings of the device sync routes, `GET /indexes/{name}/sync/snapshot`
|
|
69
|
+
* and the feed at `GET /indexes/{name}/sync/feed`. Every field has a default.
|
|
44
70
|
*
|
|
45
71
|
* @public
|
|
46
72
|
*/
|
|
47
|
-
|
|
73
|
+
interface ServerSyncOptions {
|
|
74
|
+
/**
|
|
75
|
+
* The server stops sending entries to a device while the entries that it
|
|
76
|
+
* has sent, and that the device has not acknowledged, hold more than this
|
|
77
|
+
* many bytes. It defaults to 8,388,608.
|
|
78
|
+
*/
|
|
79
|
+
windowBytes?: number;
|
|
80
|
+
/** The server holds at most this many feed connections, and it answers 429 to one more. It defaults to 10,000. */
|
|
81
|
+
maxConnections?: number;
|
|
82
|
+
/**
|
|
83
|
+
* The server reads the history of at most this many feed connections at
|
|
84
|
+
* once, and it holds any other connection until one of those reads ends.
|
|
85
|
+
* It defaults to 32.
|
|
86
|
+
*/
|
|
87
|
+
maxCatchUps?: number;
|
|
88
|
+
/**
|
|
89
|
+
* The server stops reading entries for every feed while its feed
|
|
90
|
+
* connections hold this many bytes that the network has not yet taken. It
|
|
91
|
+
* defaults to 268,435,456.
|
|
92
|
+
*/
|
|
93
|
+
maxBufferedBytes?: number;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* The settings of the change feed at `GET /indexes/{name}/changes/feed`. Every
|
|
97
|
+
* field has a default, and the server counts the connections and the
|
|
98
|
+
* catch-ups of this feed apart from those of the device sync feed.
|
|
99
|
+
*
|
|
100
|
+
* @public
|
|
101
|
+
*/
|
|
102
|
+
interface ServerChangesOptions {
|
|
103
|
+
/**
|
|
104
|
+
* The server stops sending changes to a subscriber while the changes that
|
|
105
|
+
* it has sent, and that the subscriber has not acknowledged, hold more than
|
|
106
|
+
* this many bytes. It defaults to 8,388,608.
|
|
107
|
+
*/
|
|
108
|
+
windowBytes?: number;
|
|
109
|
+
/** The server holds at most this many change feed connections, and it answers 429 to one more. It defaults to 10,000. */
|
|
110
|
+
maxConnections?: number;
|
|
111
|
+
/**
|
|
112
|
+
* The server reads the history of at most this many change feed
|
|
113
|
+
* connections at once, and it holds any other connection until one of
|
|
114
|
+
* those reads ends. It defaults to 32.
|
|
115
|
+
*/
|
|
116
|
+
maxCatchUps?: number;
|
|
117
|
+
/**
|
|
118
|
+
* The server stops reading changes for every subscriber while its change
|
|
119
|
+
* feed connections hold this many bytes that the network has not yet
|
|
120
|
+
* taken. It defaults to 268,435,456.
|
|
121
|
+
*/
|
|
122
|
+
maxBufferedBytes?: number;
|
|
123
|
+
}
|
|
48
124
|
/**
|
|
49
125
|
* Which cross-origin requests the server accepts.
|
|
50
126
|
*
|
|
@@ -85,6 +161,13 @@ interface ServerLimits {
|
|
|
85
161
|
importBatchSize?: number;
|
|
86
162
|
/** Maximum requests executing engine work at once, counted across every request thread; excess is shed with 429. Omit or 0 to disable. */
|
|
87
163
|
maxConcurrentRequests?: number;
|
|
164
|
+
/** The server holds request bodies up to this fraction of the memory that
|
|
165
|
+
* the host allows the process, counting them across every request thread
|
|
166
|
+
* from the first byte of a body until its request finishes. The server
|
|
167
|
+
* answers 429 to a body that can take the total past this fraction before it
|
|
168
|
+
* buffers any more of that body, unless no other body is in flight. The
|
|
169
|
+
* fraction is 0.05 by default, and 0 removes the bound. */
|
|
170
|
+
maxBodyBytesInFlightFraction?: number;
|
|
88
171
|
/** Ceiling for a search's `limit`, `offset`, and `group.maxPerGroup`, so one
|
|
89
172
|
* request cannot ask for an unbounded result set. Excess → 400. Defaults to
|
|
90
173
|
* 10000, matching the cluster query result window. */
|
|
@@ -198,10 +281,64 @@ interface ServerOptions {
|
|
|
198
281
|
* The cluster-facing side of the node this server fronts, which is
|
|
199
282
|
* `node.cluster` on a {@link ClusterNode}. With it set, `/readyz` answers
|
|
200
283
|
* 200 only while the node reports `SERVING`, `/cluster` reports the
|
|
201
|
-
* topology,
|
|
202
|
-
*
|
|
284
|
+
* topology, `/indexes/:name/cluster` reports one index's allocation, and
|
|
285
|
+
* `PUT /indexes/:name/replication-factor` changes one index's replication
|
|
286
|
+
* factor. Without it, all three cluster routes answer 501.
|
|
203
287
|
*/
|
|
204
288
|
cluster?: ClusterNamespace;
|
|
289
|
+
/**
|
|
290
|
+
* Turns on the device sync routes, which stay off by default: the
|
|
291
|
+
* published snapshot at `GET /indexes/{name}/sync/snapshot` and the feed,
|
|
292
|
+
* a WebSocket at `GET /indexes/{name}/sync/feed`. Each index serves them
|
|
293
|
+
* only once a caller turns sync on for it with `updateSync`. A device
|
|
294
|
+
* receives the whole index, so the server refuses to start with these
|
|
295
|
+
* routes on and no {@link ServerOptions.onRequest} hook, whatever
|
|
296
|
+
* {@link ServerOptions.allowInsecure} holds. Pass `true` for the default
|
|
297
|
+
* settings.
|
|
298
|
+
*/
|
|
299
|
+
sync?: boolean | ServerSyncOptions;
|
|
300
|
+
/**
|
|
301
|
+
* Turns on the change feed, a WebSocket at
|
|
302
|
+
* `GET /indexes/{name}/changes/feed`, which stays off by default. Each index
|
|
303
|
+
* serves it only once a caller turns capture on for it with
|
|
304
|
+
* `updateChanges`. A subscriber receives every document of the index, so
|
|
305
|
+
* the server refuses to start with the feed on and no
|
|
306
|
+
* {@link ServerOptions.onRequest} hook, whatever
|
|
307
|
+
* {@link ServerOptions.allowInsecure} holds. Pass `true` for the default
|
|
308
|
+
* settings.
|
|
309
|
+
*/
|
|
310
|
+
changes?: boolean | ServerChangesOptions;
|
|
311
|
+
/**
|
|
312
|
+
* Lets `POST /indexes/{name}/query-suggestions/record` count searches. The
|
|
313
|
+
* server takes the person and the group from
|
|
314
|
+
* {@link ServerQuerySuggestionsOptions.identify}, never from the request
|
|
315
|
+
* body, so that a caller can't choose them. Without it, that route answers
|
|
316
|
+
* 404 `QUERY_SUGGESTIONS_NOT_ENABLED`.
|
|
317
|
+
*/
|
|
318
|
+
querySuggestions?: ServerQuerySuggestionsOptions;
|
|
319
|
+
}
|
|
320
|
+
/**
|
|
321
|
+
* The person and the group that a search counts for, with the rules of
|
|
322
|
+
* {@link RecordedQuery}.
|
|
323
|
+
*
|
|
324
|
+
* @public
|
|
325
|
+
*/
|
|
326
|
+
type QueryIdentity = Pick<RecordedQuery, 'person' | 'group'>;
|
|
327
|
+
/**
|
|
328
|
+
* How the server names the person behind a search that it counts for popular
|
|
329
|
+
* query suggestions.
|
|
330
|
+
*
|
|
331
|
+
* @public
|
|
332
|
+
*/
|
|
333
|
+
interface ServerQuerySuggestionsOptions {
|
|
334
|
+
/**
|
|
335
|
+
* Returns the person and the group of a request, or `null` to count
|
|
336
|
+
* nothing, which the server reports as the outcome `unidentified`.
|
|
337
|
+
*
|
|
338
|
+
* @param ctx - The request's method, path, headers, and peer address.
|
|
339
|
+
* @returns The person and the group, or `null`.
|
|
340
|
+
*/
|
|
341
|
+
identify(ctx: RequestContext): QueryIdentity | null | Promise<QueryIdentity | null>;
|
|
205
342
|
}
|
|
206
343
|
/**
|
|
207
344
|
* The running HTTP server, as {@link createServer} returns it.
|
|
@@ -248,14 +385,7 @@ interface NarsilServer {
|
|
|
248
385
|
*/
|
|
249
386
|
interface ErrorEnvelope {
|
|
250
387
|
/** This describes the failure. */
|
|
251
|
-
error:
|
|
252
|
-
/** This code comes from either {@link ServerErrorCodes} or {@link ErrorCodes}. */
|
|
253
|
-
code: string;
|
|
254
|
-
/** This describes the failure, for a log or a person. */
|
|
255
|
-
message: string;
|
|
256
|
-
/** These values are behind the failure, such as the field or limit involved. */
|
|
257
|
-
details?: Record<string, unknown>;
|
|
258
|
-
};
|
|
388
|
+
error: ErrorDetail;
|
|
259
389
|
}
|
|
260
390
|
|
|
261
391
|
/**
|
|
@@ -285,6 +415,13 @@ declare const TASK_FILTER_CAPABILITY = "tasks.filter";
|
|
|
285
415
|
* @public
|
|
286
416
|
*/
|
|
287
417
|
declare const REBUILD_ANALYSIS_CAPABILITY = "indexes.rebuildAnalysis";
|
|
418
|
+
/**
|
|
419
|
+
* Marks that `POST /indexes/{name}/_change-analysis` changes the language, the
|
|
420
|
+
* tokeniser, or the stop words of a live index.
|
|
421
|
+
*
|
|
422
|
+
* @public
|
|
423
|
+
*/
|
|
424
|
+
declare const CHANGE_ANALYSIS_CAPABILITY = "indexes.changeAnalysis";
|
|
288
425
|
/**
|
|
289
426
|
* Marks that `POST /indexes/{name}/_open` and `POST /indexes/{name}/_close`
|
|
290
427
|
* load and release an index's server memory.
|
|
@@ -308,6 +445,13 @@ declare const DOCUMENT_EXPORT_CAPABILITY = "indexes.documentExport";
|
|
|
308
445
|
* @public
|
|
309
446
|
*/
|
|
310
447
|
declare const SYNONYMS_CAPABILITY = "indexes.synonyms";
|
|
448
|
+
/**
|
|
449
|
+
* Marks a server that replaces the BM25 setting of an index at
|
|
450
|
+
* `POST /indexes/{name}/bm25`.
|
|
451
|
+
*
|
|
452
|
+
* @public
|
|
453
|
+
*/
|
|
454
|
+
declare const BM25_TUNING_CAPABILITY = "indexes.bm25";
|
|
311
455
|
/**
|
|
312
456
|
* Every capability this server announces at `/capabilities`.
|
|
313
457
|
*
|
|
@@ -319,4 +463,4 @@ declare const SYNONYMS_CAPABILITY = "indexes.synonyms";
|
|
|
319
463
|
*/
|
|
320
464
|
declare const SERVER_CAPABILITIES: readonly string[];
|
|
321
465
|
|
|
322
|
-
export { ASYNC_IMPORT_CAPABILITY as A,
|
|
466
|
+
export { ASYNC_IMPORT_CAPABILITY as A, BM25_TUNING_CAPABILITY as B, CHANGE_ANALYSIS_CAPABILITY as C, DOCUMENT_EXPORT_CAPABILITY as D, type ErrorEnvelope as E, INDEX_LIFECYCLE_CAPABILITY as I, type NarsilServer as N, type OnRequestHook as O, type QueryIdentity as Q, REBUILD_ANALYSIS_CAPABILITY as R, SERVER_CAPABILITIES as S, TASK_CANCEL_CAPABILITY as T, SYNONYMS_CAPABILITY as a, TASK_FILTER_CAPABILITY as b, type ServerOptions as c, type CorsOptions as d, type RequestContext as e, type RequestDenial as f, type RequestGrant as g, type ServerChangesOptions as h, type ServerLimits as i, type ServerQuerySuggestionsOptions as j, type ServerSyncOptions as k };
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { WORKER_YOUNG_GENERATION_MB } from './chunk-FJXJZUWF.mjs';
|
|
2
|
+
import { REFUSAL_YOUNG_COLLECTION_MIN_INTERVAL_MS, collectYoungGeneration, collectAndReturnPages, REFUSAL_COLLECTION_MIN_INTERVAL_MS, REFUSAL_COLLECTION_TIME_MULTIPLE } from './chunk-5EI5CXO6.mjs';
|
|
3
|
+
|
|
4
|
+
// src/workers/resource-limits.ts
|
|
5
|
+
function workerResourceLimits() {
|
|
6
|
+
return { maxYoungGenerationSizeMb: WORKER_YOUNG_GENERATION_MB };
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
// src/runtime/thread-heap.ts
|
|
10
|
+
var refusalListeners = /* @__PURE__ */ new Set();
|
|
11
|
+
var reservedBytes = 0;
|
|
12
|
+
var admittedBytes = 0;
|
|
13
|
+
var lastYoungCollectionAt = Number.NEGATIVE_INFINITY;
|
|
14
|
+
function reservedHeapBytes() {
|
|
15
|
+
return reservedBytes;
|
|
16
|
+
}
|
|
17
|
+
function admittedHeapBytes() {
|
|
18
|
+
return admittedBytes;
|
|
19
|
+
}
|
|
20
|
+
function admitHeapBytes(bytes) {
|
|
21
|
+
admittedBytes += bytes;
|
|
22
|
+
}
|
|
23
|
+
function chargeHeapBytes(bytes) {
|
|
24
|
+
reservedBytes += bytes;
|
|
25
|
+
if (bytes > 0) admittedBytes += bytes;
|
|
26
|
+
}
|
|
27
|
+
function reserveHeapBytes(bytes) {
|
|
28
|
+
reservedBytes += bytes;
|
|
29
|
+
admittedBytes += bytes;
|
|
30
|
+
let released = false;
|
|
31
|
+
return {
|
|
32
|
+
release() {
|
|
33
|
+
if (released) return;
|
|
34
|
+
released = true;
|
|
35
|
+
reservedBytes -= bytes;
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
function onRefusalAfterCollection(listener) {
|
|
40
|
+
refusalListeners.add(listener);
|
|
41
|
+
return () => {
|
|
42
|
+
refusalListeners.delete(listener);
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
function reportRefusalAfterCollection(figures) {
|
|
46
|
+
for (const listener of refusalListeners) listener(figures);
|
|
47
|
+
}
|
|
48
|
+
function refusalCollector() {
|
|
49
|
+
let lastCollectionAt = Number.NEGATIVE_INFINITY;
|
|
50
|
+
let intervalMs = REFUSAL_COLLECTION_MIN_INTERVAL_MS;
|
|
51
|
+
return () => {
|
|
52
|
+
const startedAt = performance.now();
|
|
53
|
+
if (startedAt - lastCollectionAt < intervalMs) return false;
|
|
54
|
+
lastCollectionAt = startedAt;
|
|
55
|
+
if (!collectAndReturnPages()) return false;
|
|
56
|
+
intervalMs = Math.max(
|
|
57
|
+
REFUSAL_COLLECTION_MIN_INTERVAL_MS,
|
|
58
|
+
(performance.now() - startedAt) * REFUSAL_COLLECTION_TIME_MULTIPLE
|
|
59
|
+
);
|
|
60
|
+
return true;
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
var collectGarbageBeforeRefusal = refusalCollector();
|
|
64
|
+
var collectGarbageBeforeAnswerRefusal = refusalCollector();
|
|
65
|
+
function collectYoungGenerationBeforeRefusal() {
|
|
66
|
+
const startedAt = performance.now();
|
|
67
|
+
if (startedAt - lastYoungCollectionAt < REFUSAL_YOUNG_COLLECTION_MIN_INTERVAL_MS) return false;
|
|
68
|
+
lastYoungCollectionAt = startedAt;
|
|
69
|
+
return collectYoungGeneration();
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export { admitHeapBytes, admittedHeapBytes, chargeHeapBytes, collectGarbageBeforeAnswerRefusal, collectGarbageBeforeRefusal, collectYoungGenerationBeforeRefusal, onRefusalAfterCollection, reportRefusalAfterCollection, reserveHeapBytes, reservedHeapBytes, workerResourceLimits };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { MAX_DOCUMENT_ENCODING_DEPTH, DOCUMENT_ENCODER_RETAINED_BUFFER_BYTES, DOCUMENT_REPLY_ENVELOPE_DEPTH } from './chunk-4PY4JYMY.mjs';
|
|
2
|
+
import { NarsilError, ErrorCodes } from './chunk-ZKOQR7EA.mjs';
|
|
3
|
+
import { encode, Encoder } from '@msgpack/msgpack';
|
|
4
|
+
|
|
5
|
+
var integerEncoder;
|
|
6
|
+
var floatEncoder;
|
|
7
|
+
function encodeExactly(document, forceIntegerToFloat) {
|
|
8
|
+
let encoder;
|
|
9
|
+
if (forceIntegerToFloat) {
|
|
10
|
+
floatEncoder ??= new Encoder({ maxDepth: MAX_DOCUMENT_ENCODING_DEPTH, forceIntegerToFloat: true });
|
|
11
|
+
encoder = floatEncoder;
|
|
12
|
+
} else {
|
|
13
|
+
integerEncoder ??= new Encoder({ maxDepth: MAX_DOCUMENT_ENCODING_DEPTH });
|
|
14
|
+
encoder = integerEncoder;
|
|
15
|
+
}
|
|
16
|
+
const bytes = encoder.encode(document);
|
|
17
|
+
if (bytes.byteLength > DOCUMENT_ENCODER_RETAINED_BUFFER_BYTES) {
|
|
18
|
+
if (forceIntegerToFloat) floatEncoder = void 0;
|
|
19
|
+
else integerEncoder = void 0;
|
|
20
|
+
}
|
|
21
|
+
return bytes;
|
|
22
|
+
}
|
|
23
|
+
function holdsNegativeZero(value, depth) {
|
|
24
|
+
if (typeof value === "number") return Object.is(value, -0);
|
|
25
|
+
if (value === null || typeof value !== "object" || ArrayBuffer.isView(value) || depth > MAX_DOCUMENT_ENCODING_DEPTH) {
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
for (const child of Array.isArray(value) ? value : Object.values(value)) {
|
|
29
|
+
if (holdsNegativeZero(child, depth + 1)) return true;
|
|
30
|
+
}
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
33
|
+
function encodeDocumentReply(payload) {
|
|
34
|
+
return encode(payload, { forceIntegerToFloat: holdsNegativeZero(payload, 1 - DOCUMENT_REPLY_ENVELOPE_DEPTH) });
|
|
35
|
+
}
|
|
36
|
+
function encodeDocument(document) {
|
|
37
|
+
try {
|
|
38
|
+
return encodeExactly(document, holdsNegativeZero(document, 1));
|
|
39
|
+
} catch (error) {
|
|
40
|
+
throw new NarsilError(
|
|
41
|
+
ErrorCodes.DOC_VALIDATION_FAILED,
|
|
42
|
+
`The document cannot be encoded as MessagePack: ${error instanceof Error ? error.message : String(error)}`
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export { encodeDocument, encodeDocumentReply };
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
// src/search/constants.ts
|
|
2
|
+
var RESULT_WINDOW = 1e4;
|
|
3
|
+
var DEFAULT_PAGE_SIZE = 10;
|
|
4
|
+
var BM25_DISPLAYED_NAME_LENGTH = 64;
|
|
5
|
+
var MAX_CURSOR_LENGTH = 40960;
|
|
6
|
+
var CURSOR_BINDING_BUFFER_BYTES = 256;
|
|
7
|
+
var MAX_SORT_FIELDS = 8;
|
|
8
|
+
var MAX_SORT_FIELD_NAME_LENGTH = 255;
|
|
9
|
+
var MAX_CURSOR_ANCHOR_CODE_POINTS = 512;
|
|
10
|
+
var PREFIX_MAX_EXPANSIONS = 50;
|
|
11
|
+
var PARTIAL_WORDS_ADDED_PER_QUERY = 50;
|
|
12
|
+
var PARTIAL_WORD_MIN_CODE_POINTS = 3;
|
|
13
|
+
var DEFAULT_FUZZY_PREFIX_LENGTH = 2;
|
|
14
|
+
var MAX_TOLERANCE = 10;
|
|
15
|
+
var MAX_PREFIX_LENGTH = 1024;
|
|
16
|
+
var MAX_PHRASE_WORDS = 32;
|
|
17
|
+
var MAX_QUERY_PHRASES = 32;
|
|
18
|
+
var DEFAULT_MAX_PER_GROUP = 1;
|
|
19
|
+
var DEFAULT_RANK_CONSTANT = 60;
|
|
20
|
+
var MIN_RANK_CONSTANT = 1;
|
|
21
|
+
var DEFAULT_LINEAR_ALPHA = 0.5;
|
|
22
|
+
var MIN_LINEAR_ALPHA = 0;
|
|
23
|
+
var MAX_LINEAR_ALPHA = 1;
|
|
24
|
+
var MIN_HYBRID_DEPTH = 1;
|
|
25
|
+
var MAX_HYBRID_DEPTH = 1e4;
|
|
26
|
+
var HYBRID_RESCORE_WINDOW = 10;
|
|
27
|
+
var FUSION_TIE_INSERTION_LIMIT = 16;
|
|
28
|
+
|
|
29
|
+
// src/engine/constants.ts
|
|
30
|
+
var MIN_DOCUMENTS_FOR_SEGMENTS = 64;
|
|
31
|
+
var BATCH_CHUNK_SIZE = 1e3;
|
|
32
|
+
var ANALYSIS_HOLD_APPLY_INTERVAL_MS = 100;
|
|
33
|
+
var ANALYSIS_CHANGE_MEMBERS = ["language", "tokenizer", "stopWords"];
|
|
34
|
+
var DEFAULT_LIMIT = DEFAULT_PAGE_SIZE;
|
|
35
|
+
var DEFAULT_OFFSET = 0;
|
|
36
|
+
var INDEX_NAME_PATTERN = /^[a-zA-Z0-9][a-zA-Z0-9._-]*$/;
|
|
37
|
+
var ABSOLUTE_WINDOWS_PATH_PATTERN = /^[a-zA-Z]:[\\/]/;
|
|
38
|
+
var MODULE_URL_SCHEME_PATTERN = /^(file|https?|data|node):/;
|
|
39
|
+
var MAX_INDEX_NAME_LENGTH = 255;
|
|
40
|
+
var MAX_DOC_ID_LENGTH = 512;
|
|
41
|
+
var DEFAULT_MAX_PARTITIONS = 1;
|
|
42
|
+
var MAX_PARTITIONS = 65536;
|
|
43
|
+
var EXPORT_CHUNK_BYTES = 1048576;
|
|
44
|
+
var MAX_EXPORT_LINE_BYTES = 117443592;
|
|
45
|
+
var MAX_INDEX_CONFIGURATION_BYTES = 16777216;
|
|
46
|
+
var IMPORT_BATCH_DOCUMENTS = 1e3;
|
|
47
|
+
var MAX_IMPORT_REFUSALS_REPORTED = 1e3;
|
|
48
|
+
var MAX_CALLS_ACROSS_INDEX_CHANGES = 3;
|
|
49
|
+
var MIN_SWEEP_INTERVAL_MS = 100;
|
|
50
|
+
var MAX_SWEEP_INTERVAL_MS = 6e4;
|
|
51
|
+
var HEAP_PRESSURE_WARNING_FRACTION = 0.9;
|
|
52
|
+
var HEAP_PRESSURE_REARM_FRACTION = 0.8;
|
|
53
|
+
var STATISTICS_BROADCAST_INTERVAL_MS = 5e3;
|
|
54
|
+
var FOREIGN_STATS_TTL_MS = 6e4;
|
|
55
|
+
var DEFAULT_SUGGEST_LIMIT = 10;
|
|
56
|
+
var MAX_SUGGEST_LIMIT = 100;
|
|
57
|
+
var SUGGEST_OVERSAMPLE_FACTOR = 1.5;
|
|
58
|
+
var SUGGEST_OVERSAMPLE_PADDING = 10;
|
|
59
|
+
var MAX_SUGGEST_SCATTER_LIMIT = Math.ceil(MAX_SUGGEST_LIMIT * SUGGEST_OVERSAMPLE_FACTOR) + SUGGEST_OVERSAMPLE_PADDING;
|
|
60
|
+
|
|
61
|
+
export { ABSOLUTE_WINDOWS_PATH_PATTERN, ANALYSIS_CHANGE_MEMBERS, ANALYSIS_HOLD_APPLY_INTERVAL_MS, BATCH_CHUNK_SIZE, BM25_DISPLAYED_NAME_LENGTH, CURSOR_BINDING_BUFFER_BYTES, DEFAULT_FUZZY_PREFIX_LENGTH, DEFAULT_LIMIT, DEFAULT_LINEAR_ALPHA, DEFAULT_MAX_PARTITIONS, DEFAULT_MAX_PER_GROUP, DEFAULT_OFFSET, DEFAULT_PAGE_SIZE, DEFAULT_RANK_CONSTANT, DEFAULT_SUGGEST_LIMIT, EXPORT_CHUNK_BYTES, FOREIGN_STATS_TTL_MS, FUSION_TIE_INSERTION_LIMIT, HEAP_PRESSURE_REARM_FRACTION, HEAP_PRESSURE_WARNING_FRACTION, HYBRID_RESCORE_WINDOW, IMPORT_BATCH_DOCUMENTS, INDEX_NAME_PATTERN, MAX_CALLS_ACROSS_INDEX_CHANGES, MAX_CURSOR_ANCHOR_CODE_POINTS, MAX_CURSOR_LENGTH, MAX_DOC_ID_LENGTH, MAX_EXPORT_LINE_BYTES, MAX_HYBRID_DEPTH, MAX_IMPORT_REFUSALS_REPORTED, MAX_INDEX_CONFIGURATION_BYTES, MAX_INDEX_NAME_LENGTH, MAX_LINEAR_ALPHA, MAX_PARTITIONS, MAX_PHRASE_WORDS, MAX_PREFIX_LENGTH, MAX_QUERY_PHRASES, MAX_SORT_FIELDS, MAX_SORT_FIELD_NAME_LENGTH, MAX_SUGGEST_LIMIT, MAX_SUGGEST_SCATTER_LIMIT, MAX_SWEEP_INTERVAL_MS, MAX_TOLERANCE, MIN_DOCUMENTS_FOR_SEGMENTS, MIN_HYBRID_DEPTH, MIN_LINEAR_ALPHA, MIN_RANK_CONSTANT, MIN_SWEEP_INTERVAL_MS, MODULE_URL_SCHEME_PATTERN, PARTIAL_WORDS_ADDED_PER_QUERY, PARTIAL_WORD_MIN_CODE_POINTS, PREFIX_MAX_EXPANSIONS, RESULT_WINDOW, STATISTICS_BROADCAST_INTERVAL_MS, SUGGEST_OVERSAMPLE_FACTOR, SUGGEST_OVERSAMPLE_PADDING };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// src/distribution/coordinator/constants.ts
|
|
2
|
+
var MAX_NODE_ID_LENGTH = 255;
|
|
3
|
+
var MAX_WATCHERS = 64;
|
|
4
|
+
var NODE_HEARTBEAT_TTL_MS = 3e4;
|
|
5
|
+
var CONTROLLER_LEASE_KEY = "_narsil/controller";
|
|
6
|
+
|
|
7
|
+
export { CONTROLLER_LEASE_KEY, MAX_NODE_ID_LENGTH, MAX_WATCHERS, NODE_HEARTBEAT_TTL_MS };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// src/workers/executor.ts
|
|
2
|
+
function executeUntilAnswered(executor, action, settled) {
|
|
3
|
+
try {
|
|
4
|
+
if (executor.executeUntilAnswered !== void 0) return executor.executeUntilAnswered(action, settled);
|
|
5
|
+
const answered = executor.execute(action);
|
|
6
|
+
return settled === void 0 ? answered : answered.finally(settled);
|
|
7
|
+
} catch (error) {
|
|
8
|
+
settled?.();
|
|
9
|
+
return Promise.reject(error);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export { executeUntilAnswered };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// src/serialization/constants.ts
|
|
2
|
+
var CHECKSUM_YIELD_CHUNK_BYTES = 4 * 1024 * 1024;
|
|
3
|
+
var NATIVE_CRC32_MIN_BYTES = 16;
|
|
4
|
+
var MAX_FILE_BYTES = 2147483647;
|
|
5
|
+
var MAX_DOCUMENT_ENCODING_DEPTH = 100;
|
|
6
|
+
var DOCUMENT_REPLY_ENVELOPE_DEPTH = 4;
|
|
7
|
+
var BYTE_ORDER_MARK_WALK_BYTES_PER_HEADER = 256;
|
|
8
|
+
var DOCUMENT_ENCODER_RETAINED_BUFFER_BYTES = 1048576;
|
|
9
|
+
var VALID_HNSW_METRICS = /* @__PURE__ */ new Set(["cosine", "dotProduct", "euclidean"]);
|
|
10
|
+
|
|
11
|
+
export { BYTE_ORDER_MARK_WALK_BYTES_PER_HEADER, CHECKSUM_YIELD_CHUNK_BYTES, DOCUMENT_ENCODER_RETAINED_BUFFER_BYTES, DOCUMENT_REPLY_ENVELOPE_DEPTH, MAX_DOCUMENT_ENCODING_DEPTH, MAX_FILE_BYTES, NATIVE_CRC32_MIN_BYTES, VALID_HNSW_METRICS };
|