@delali/narsil 0.3.1-next.99 → 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,6 @@
|
|
|
1
|
-
import { C as ClusterCoordinator } from '../../index-
|
|
2
|
-
import '../../schema-
|
|
3
|
-
import '../../adapters-
|
|
1
|
+
import { C as ClusterCoordinator } from '../../index-B_vmxpgW.js';
|
|
2
|
+
import '../../schema-CzG9OUw5.js';
|
|
3
|
+
import '../../adapters-pljAqmrC.js';
|
|
4
4
|
import '../../synonyms-CpOAHPa-.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -1,9 +1,32 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import '../../chunk-
|
|
3
|
-
import { compareCodePoints } from '../../chunk-
|
|
1
|
+
import { indexNameOfMetadataKey } from '../../chunk-Q2AP2FSN.mjs';
|
|
2
|
+
import { CONTROLLER_LEASE_KEY, NODE_HEARTBEAT_TTL_MS } from '../../chunk-44W3CBNG.mjs';
|
|
3
|
+
import { compareCodePoints } from '../../chunk-TGPKS2UM.mjs';
|
|
4
4
|
|
|
5
|
-
// src/distribution/coordinator/
|
|
6
|
-
|
|
5
|
+
// src/distribution/coordinator/index-metadata-watchers.ts
|
|
6
|
+
function createIndexMetadataWatchers() {
|
|
7
|
+
const handlers = /* @__PURE__ */ new Set();
|
|
8
|
+
return {
|
|
9
|
+
watch(handler) {
|
|
10
|
+
handlers.add(handler);
|
|
11
|
+
return () => {
|
|
12
|
+
handlers.delete(handler);
|
|
13
|
+
};
|
|
14
|
+
},
|
|
15
|
+
emit(key, value) {
|
|
16
|
+
const indexName = indexNameOfMetadataKey(key);
|
|
17
|
+
if (indexName === null) return;
|
|
18
|
+
const metadata = value === null || value.byteLength === 0 ? null : new Uint8Array(value);
|
|
19
|
+
for (const handler of handlers) {
|
|
20
|
+
try {
|
|
21
|
+
handler({ indexName, metadata });
|
|
22
|
+
} catch (_) {
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// src/distribution/coordinator/in-memory/comparisons.ts
|
|
7
30
|
function bytesEqual(a, b) {
|
|
8
31
|
if (a.byteLength !== b.byteLength) {
|
|
9
32
|
return false;
|
|
@@ -15,16 +38,25 @@ function bytesEqual(a, b) {
|
|
|
15
38
|
}
|
|
16
39
|
return true;
|
|
17
40
|
}
|
|
41
|
+
function registrationsMatch(left, right) {
|
|
42
|
+
return JSON.stringify(left) === JSON.stringify(right);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// src/distribution/coordinator/in-memory/index.ts
|
|
46
|
+
var NODE_HEARTBEAT_PREFIX = "_narsil/node/";
|
|
18
47
|
function createInMemoryCoordinator() {
|
|
19
48
|
const nodes = /* @__PURE__ */ new Map();
|
|
49
|
+
const registeredStartedAt = /* @__PURE__ */ new Map();
|
|
20
50
|
const allocations = /* @__PURE__ */ new Map();
|
|
21
51
|
const partitionStates = /* @__PURE__ */ new Map();
|
|
22
52
|
const leases = /* @__PURE__ */ new Map();
|
|
53
|
+
const registrationsHeldUntil = /* @__PURE__ */ new Map();
|
|
23
54
|
const schemas = /* @__PURE__ */ new Map();
|
|
24
55
|
const kvStore = /* @__PURE__ */ new Map();
|
|
25
56
|
const nodeWatchers = /* @__PURE__ */ new Set();
|
|
26
57
|
const allocationWatchers = /* @__PURE__ */ new Set();
|
|
27
58
|
const schemaWatchers = /* @__PURE__ */ new Set();
|
|
59
|
+
const indexMetadataWatchers = createIndexMetadataWatchers();
|
|
28
60
|
let isShutdown = false;
|
|
29
61
|
function assertNotShutdown() {
|
|
30
62
|
if (isShutdown) {
|
|
@@ -68,6 +100,8 @@ function createInMemoryCoordinator() {
|
|
|
68
100
|
if (key.startsWith(NODE_HEARTBEAT_PREFIX)) {
|
|
69
101
|
const expiredNodeId = key.slice(NODE_HEARTBEAT_PREFIX.length);
|
|
70
102
|
nodes.delete(expiredNodeId);
|
|
103
|
+
registeredStartedAt.delete(expiredNodeId);
|
|
104
|
+
registrationsHeldUntil.delete(expiredNodeId);
|
|
71
105
|
emitNodeEvent({ type: "node_left", nodeId: expiredNodeId, registration: null });
|
|
72
106
|
}
|
|
73
107
|
}, ttlMs);
|
|
@@ -82,8 +116,11 @@ function createInMemoryCoordinator() {
|
|
|
82
116
|
const coordinator = {
|
|
83
117
|
async registerNode(registration) {
|
|
84
118
|
assertNotShutdown();
|
|
119
|
+
const renewedAt = performance.now();
|
|
85
120
|
const previous = nodes.get(registration.nodeId);
|
|
86
121
|
nodes.set(registration.nodeId, registration);
|
|
122
|
+
registeredStartedAt.set(registration.nodeId, registration.startedAt);
|
|
123
|
+
registrationsHeldUntil.set(registration.nodeId, renewedAt + NODE_HEARTBEAT_TTL_MS);
|
|
87
124
|
const heartbeatKey = `${NODE_HEARTBEAT_PREFIX}${registration.nodeId}`;
|
|
88
125
|
clearLeaseEntry(heartbeatKey);
|
|
89
126
|
const timer = createLeaseTimer(heartbeatKey, NODE_HEARTBEAT_TTL_MS);
|
|
@@ -100,12 +137,19 @@ function createInMemoryCoordinator() {
|
|
|
100
137
|
async deregisterNode(nodeId) {
|
|
101
138
|
assertNotShutdown();
|
|
102
139
|
const existed = nodes.delete(nodeId);
|
|
140
|
+
registeredStartedAt.delete(nodeId);
|
|
141
|
+
registrationsHeldUntil.delete(nodeId);
|
|
103
142
|
const heartbeatKey = `${NODE_HEARTBEAT_PREFIX}${nodeId}`;
|
|
104
143
|
clearLeaseEntry(heartbeatKey);
|
|
105
144
|
if (existed) {
|
|
106
145
|
emitNodeEvent({ type: "node_left", nodeId, registration: null });
|
|
107
146
|
}
|
|
108
147
|
},
|
|
148
|
+
registrationLease(nodeId) {
|
|
149
|
+
const heldUntil = registrationsHeldUntil.get(nodeId);
|
|
150
|
+
if (isShutdown || heldUntil === void 0) return null;
|
|
151
|
+
return { remainingMs: heldUntil - performance.now(), ttlMs: NODE_HEARTBEAT_TTL_MS };
|
|
152
|
+
},
|
|
109
153
|
async listNodes() {
|
|
110
154
|
assertNotShutdown();
|
|
111
155
|
return Array.from(nodes.values());
|
|
@@ -121,9 +165,15 @@ function createInMemoryCoordinator() {
|
|
|
121
165
|
assertNotShutdown();
|
|
122
166
|
return allocations.get(indexName) ?? null;
|
|
123
167
|
},
|
|
124
|
-
async putAllocation(indexName, table, expectedVersion) {
|
|
168
|
+
async putAllocation(indexName, table, expectedVersion, writerNodeId, replicaRegistration) {
|
|
125
169
|
assertNotShutdown();
|
|
126
170
|
if (expectedVersion !== void 0) {
|
|
171
|
+
if (!isLeaseValid(CONTROLLER_LEASE_KEY) || leases.get(CONTROLLER_LEASE_KEY)?.nodeId !== writerNodeId) {
|
|
172
|
+
return false;
|
|
173
|
+
}
|
|
174
|
+
if (replicaRegistration !== void 0 && (registeredStartedAt.get(replicaRegistration.nodeId) !== replicaRegistration.startedAt || (registrationsHeldUntil.get(replicaRegistration.nodeId) ?? 0) <= performance.now())) {
|
|
175
|
+
return false;
|
|
176
|
+
}
|
|
127
177
|
const current = allocations.get(indexName);
|
|
128
178
|
if (expectedVersion === null) {
|
|
129
179
|
if (current !== void 0) {
|
|
@@ -219,6 +269,7 @@ function createInMemoryCoordinator() {
|
|
|
219
269
|
return false;
|
|
220
270
|
}
|
|
221
271
|
kvStore.set(key, new Uint8Array(value));
|
|
272
|
+
indexMetadataWatchers.emit(key, value);
|
|
222
273
|
return true;
|
|
223
274
|
}
|
|
224
275
|
if (current === void 0) {
|
|
@@ -228,11 +279,12 @@ function createInMemoryCoordinator() {
|
|
|
228
279
|
return false;
|
|
229
280
|
}
|
|
230
281
|
kvStore.set(key, new Uint8Array(value));
|
|
282
|
+
indexMetadataWatchers.emit(key, value);
|
|
231
283
|
return true;
|
|
232
284
|
},
|
|
233
285
|
async delete(key) {
|
|
234
286
|
assertNotShutdown();
|
|
235
|
-
kvStore.delete(key);
|
|
287
|
+
if (kvStore.delete(key)) indexMetadataWatchers.emit(key, null);
|
|
236
288
|
},
|
|
237
289
|
async getSchema(indexName) {
|
|
238
290
|
assertNotShutdown();
|
|
@@ -261,6 +313,10 @@ function createInMemoryCoordinator() {
|
|
|
261
313
|
schemaWatchers.delete(handler);
|
|
262
314
|
};
|
|
263
315
|
},
|
|
316
|
+
async watchIndexMetadata(handler) {
|
|
317
|
+
assertNotShutdown();
|
|
318
|
+
return indexMetadataWatchers.watch(handler);
|
|
319
|
+
},
|
|
264
320
|
async getLeaseHolder(key) {
|
|
265
321
|
assertNotShutdown();
|
|
266
322
|
if (!isLeaseValid(key)) {
|
|
@@ -279,7 +335,9 @@ function createInMemoryCoordinator() {
|
|
|
279
335
|
clearTimeout(entry.timer);
|
|
280
336
|
}
|
|
281
337
|
leases.clear();
|
|
338
|
+
registrationsHeldUntil.clear();
|
|
282
339
|
nodes.clear();
|
|
340
|
+
registeredStartedAt.clear();
|
|
283
341
|
allocations.clear();
|
|
284
342
|
partitionStates.clear();
|
|
285
343
|
schemas.clear();
|
|
@@ -291,8 +349,5 @@ function createInMemoryCoordinator() {
|
|
|
291
349
|
};
|
|
292
350
|
return coordinator;
|
|
293
351
|
}
|
|
294
|
-
function registrationsMatch(left, right) {
|
|
295
|
-
return JSON.stringify(left) === JSON.stringify(right);
|
|
296
|
-
}
|
|
297
352
|
|
|
298
353
|
export { createInMemoryCoordinator };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { T as TransportConfig, N as NodeTransport } from '../../types-
|
|
2
|
-
import { a as TlsConfig } from '../../types-
|
|
1
|
+
import { T as TransportConfig, N as NodeTransport } from '../../types-DvncmvuQ.js';
|
|
2
|
+
import { a as TlsConfig } from '../../types-Ck97nB3D.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* How the gRPC transport listens and dials.
|
|
@@ -1,7 +1,13 @@
|
|
|
1
|
-
import { decodeTransportMessage, encodeTransportMessage } from '../../chunk-
|
|
1
|
+
import { decodeTransportMessage, encodeTransportMessage } from '../../chunk-D456ZFPQ.mjs';
|
|
2
|
+
import { timeoutsOf, replyDeadlineMs } from '../../chunk-OIJ64LGT.mjs';
|
|
2
3
|
import { MAX_MESSAGE_SIZE_BYTES, GRPC_KEEPALIVE_TIMEOUT_MS, GRPC_KEEPALIVE_TIME_MS, GRPC_ENVELOPE_OVERHEAD_BYTES } from '../../chunk-UNEEFTEU.mjs';
|
|
3
|
-
import { TransportError, TransportErrorCodes } from '../../chunk-
|
|
4
|
-
import
|
|
4
|
+
import { TransportError, TransportErrorCodes } from '../../chunk-5FLRXF73.mjs';
|
|
5
|
+
import '../../chunk-GXCDWLQI.mjs';
|
|
6
|
+
import '../../chunk-7P5YWDRQ.mjs';
|
|
7
|
+
import '../../chunk-ZXX5GZEX.mjs';
|
|
8
|
+
import '../../chunk-4PY4JYMY.mjs';
|
|
9
|
+
import { NarsilError, ErrorCodes } from '../../chunk-ZKOQR7EA.mjs';
|
|
10
|
+
import '../../chunk-TGPKS2UM.mjs';
|
|
5
11
|
|
|
6
12
|
// src/distribution/transport/grpc/codec.ts
|
|
7
13
|
var FIELD_ONE_LENGTH_DELIMITED_KEY = 10;
|
|
@@ -151,8 +157,14 @@ var GrpcClientPool = class {
|
|
|
151
157
|
}
|
|
152
158
|
async send(target, message) {
|
|
153
159
|
const messageBytes = this.encodeChecked(target, message);
|
|
154
|
-
const client = await this.
|
|
155
|
-
const responseBytes = await this.unaryCall(
|
|
160
|
+
const client = await this.readyClient(target);
|
|
161
|
+
const responseBytes = await this.unaryCall(
|
|
162
|
+
client,
|
|
163
|
+
target,
|
|
164
|
+
message.requestId,
|
|
165
|
+
messageBytes,
|
|
166
|
+
replyDeadlineMs(message.type, this.config)
|
|
167
|
+
);
|
|
156
168
|
try {
|
|
157
169
|
return decodeTransportMessage(responseBytes);
|
|
158
170
|
} catch (err) {
|
|
@@ -258,7 +270,7 @@ var GrpcClientPool = class {
|
|
|
258
270
|
}
|
|
259
271
|
assertOpen() {
|
|
260
272
|
if (this.closed) {
|
|
261
|
-
throw new TransportError(TransportErrorCodes.
|
|
273
|
+
throw new TransportError(TransportErrorCodes.CONNECT_FAILED, "gRPC client pool has been shut down");
|
|
262
274
|
}
|
|
263
275
|
}
|
|
264
276
|
getClient(target) {
|
|
@@ -276,8 +288,24 @@ var GrpcClientPool = class {
|
|
|
276
288
|
});
|
|
277
289
|
return clientPromise;
|
|
278
290
|
}
|
|
291
|
+
async readyClient(target) {
|
|
292
|
+
const client = await this.getClient(target);
|
|
293
|
+
if (client.getChannel().getConnectivityState(false) === this.grpc.connectivityState.READY) {
|
|
294
|
+
return client;
|
|
295
|
+
}
|
|
296
|
+
const ready = this.awaitReady(client, target);
|
|
297
|
+
this.clients.set(target, ready);
|
|
298
|
+
ready.catch(() => {
|
|
299
|
+
if (this.clients.get(target) === ready) {
|
|
300
|
+
this.clients.delete(target);
|
|
301
|
+
}
|
|
302
|
+
});
|
|
303
|
+
return ready;
|
|
304
|
+
}
|
|
279
305
|
connect(target) {
|
|
280
|
-
|
|
306
|
+
return this.awaitReady(new this.grpc.Client(target, this.credentials(), channelOptions()), target);
|
|
307
|
+
}
|
|
308
|
+
awaitReady(client, target) {
|
|
281
309
|
const channel = client.getChannel();
|
|
282
310
|
const { READY, SHUTDOWN, TRANSIENT_FAILURE } = this.grpc.connectivityState;
|
|
283
311
|
const deadline = Date.now() + this.config.connectTimeout;
|
|
@@ -349,7 +377,7 @@ var GrpcClientPool = class {
|
|
|
349
377
|
callOptions(timeoutMs) {
|
|
350
378
|
return { deadline: Date.now() + timeoutMs };
|
|
351
379
|
}
|
|
352
|
-
unaryCall(client, target, requestId, messageBytes) {
|
|
380
|
+
unaryCall(client, target, requestId, messageBytes, timeoutMs) {
|
|
353
381
|
return new Promise((resolve, reject) => {
|
|
354
382
|
client.makeUnaryRequest(
|
|
355
383
|
sendMethod.path,
|
|
@@ -357,7 +385,7 @@ var GrpcClientPool = class {
|
|
|
357
385
|
sendMethod.responseDeserialize,
|
|
358
386
|
messageBytes,
|
|
359
387
|
this.metadata(),
|
|
360
|
-
this.callOptions(
|
|
388
|
+
this.callOptions(timeoutMs),
|
|
361
389
|
(err, response) => {
|
|
362
390
|
if (err !== null) {
|
|
363
391
|
reject(this.mapCallError(target, requestId, err));
|
|
@@ -607,13 +635,14 @@ async function createGrpcTransport(nodeId, config) {
|
|
|
607
635
|
function assertNotShutdown() {
|
|
608
636
|
if (isShutdown) {
|
|
609
637
|
throw new TransportError(
|
|
610
|
-
TransportErrorCodes.
|
|
638
|
+
TransportErrorCodes.CONNECT_FAILED,
|
|
611
639
|
`gRPC transport for node '${nodeId}' has been shut down`,
|
|
612
640
|
{ nodeId }
|
|
613
641
|
);
|
|
614
642
|
}
|
|
615
643
|
}
|
|
616
644
|
return {
|
|
645
|
+
timeouts: timeoutsOf(resolvedConfig),
|
|
617
646
|
getPort() {
|
|
618
647
|
return server.getPort();
|
|
619
648
|
},
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { N as NodeTransport, a as TransportMessage, R as RespondFn, T as TransportConfig } from '../../types-
|
|
2
|
-
export { L as ListenHandler } from '../../types-
|
|
1
|
+
import { N as NodeTransport, a as TransportMessage, R as RespondFn, T as TransportConfig } from '../../types-DvncmvuQ.js';
|
|
2
|
+
export { L as ListenHandler } from '../../types-DvncmvuQ.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Receives a streamed response one chunk at a time.
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { timeoutsOf, replyDeadlineMs } from '../../chunk-OIJ64LGT.mjs';
|
|
1
2
|
import { MAX_MESSAGE_SIZE_BYTES } from '../../chunk-UNEEFTEU.mjs';
|
|
2
|
-
import { DEFAULT_TRANSPORT_CONFIG, TransportError, TransportErrorCodes } from '../../chunk-
|
|
3
|
+
import { DEFAULT_TRANSPORT_CONFIG, TransportError, TransportErrorCodes } from '../../chunk-5FLRXF73.mjs';
|
|
3
4
|
|
|
4
5
|
// src/distribution/transport/in-memory.ts
|
|
5
6
|
function createInMemoryNetwork() {
|
|
@@ -26,7 +27,7 @@ function createInMemoryTransport(nodeId, network, config) {
|
|
|
26
27
|
function assertNotShutdown() {
|
|
27
28
|
if (isShutdown) {
|
|
28
29
|
throw new TransportError(
|
|
29
|
-
TransportErrorCodes.
|
|
30
|
+
TransportErrorCodes.CONNECT_FAILED,
|
|
30
31
|
`Transport for node '${nodeId}' has been shut down`,
|
|
31
32
|
{ nodeId }
|
|
32
33
|
);
|
|
@@ -35,11 +36,12 @@ function createInMemoryTransport(nodeId, network, config) {
|
|
|
35
36
|
function lookupPeer(target) {
|
|
36
37
|
const peer = network.getTransport(target);
|
|
37
38
|
if (peer === void 0) {
|
|
38
|
-
throw new TransportError(TransportErrorCodes.
|
|
39
|
+
throw new TransportError(TransportErrorCodes.CONNECT_FAILED, `Node '${target}' is not reachable`, { target });
|
|
39
40
|
}
|
|
40
41
|
return peer;
|
|
41
42
|
}
|
|
42
43
|
const internal = {
|
|
44
|
+
timeouts: timeoutsOf(resolvedConfig),
|
|
43
45
|
deliverMessage(message, respond) {
|
|
44
46
|
if (listenHandler === void 0) {
|
|
45
47
|
return;
|
|
@@ -97,6 +99,7 @@ function createInMemoryTransport(nodeId, network, config) {
|
|
|
97
99
|
);
|
|
98
100
|
}
|
|
99
101
|
const peer = lookupPeer(target);
|
|
102
|
+
const timeoutMs = replyDeadlineMs(message.type, resolvedConfig);
|
|
100
103
|
return new Promise((resolve, reject) => {
|
|
101
104
|
let settled = false;
|
|
102
105
|
const timeoutId = setTimeout(() => {
|
|
@@ -105,12 +108,12 @@ function createInMemoryTransport(nodeId, network, config) {
|
|
|
105
108
|
reject(
|
|
106
109
|
new TransportError(
|
|
107
110
|
TransportErrorCodes.TIMEOUT,
|
|
108
|
-
`Request to node '${target}' timed out after ${
|
|
109
|
-
{ target, requestId: message.requestId, timeoutMs
|
|
111
|
+
`Request to node '${target}' timed out after ${timeoutMs}ms`,
|
|
112
|
+
{ target, requestId: message.requestId, timeoutMs }
|
|
110
113
|
)
|
|
111
114
|
);
|
|
112
115
|
}
|
|
113
|
-
},
|
|
116
|
+
}, timeoutMs);
|
|
114
117
|
try {
|
|
115
118
|
peer.deliverMessage(message, async (response) => {
|
|
116
119
|
if (!settled) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { N as NodeTransport } from '../../types-
|
|
2
|
-
import { T as TcpTransportConfig, a as TlsConfig } from '../../types-
|
|
1
|
+
import { N as NodeTransport } from '../../types-DvncmvuQ.js';
|
|
2
|
+
import { T as TcpTransportConfig, a as TlsConfig } from '../../types-Ck97nB3D.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Builds the TCP transport a cluster node reaches its peers through, with
|
|
@@ -1,6 +1,13 @@
|
|
|
1
|
-
import { DEFAULT_TCP_CONFIG, encodeTransportMessage, encodeFrame, FRAME_TYPE_REQUEST, FrameParser, FRAME_TYPE_RESPONSE, decodeTransportMessage, FRAME_TYPE_STREAM_CHUNK, FRAME_TYPE_STREAM_END } from '../../chunk-
|
|
1
|
+
import { DEFAULT_TCP_CONFIG, encodeTransportMessage, encodeFrame, FRAME_TYPE_REQUEST, FrameParser, FRAME_TYPE_RESPONSE, decodeTransportMessage, FRAME_TYPE_STREAM_CHUNK, FRAME_TYPE_STREAM_END } from '../../chunk-D456ZFPQ.mjs';
|
|
2
|
+
import { timeoutsOf, replyDeadlineMs } from '../../chunk-OIJ64LGT.mjs';
|
|
2
3
|
import { MAX_MESSAGE_SIZE_BYTES } from '../../chunk-UNEEFTEU.mjs';
|
|
3
|
-
import { TransportError, TransportErrorCodes } from '../../chunk-
|
|
4
|
+
import { TransportError, TransportErrorCodes } from '../../chunk-5FLRXF73.mjs';
|
|
5
|
+
import '../../chunk-GXCDWLQI.mjs';
|
|
6
|
+
import '../../chunk-7P5YWDRQ.mjs';
|
|
7
|
+
import '../../chunk-ZXX5GZEX.mjs';
|
|
8
|
+
import '../../chunk-4PY4JYMY.mjs';
|
|
9
|
+
import '../../chunk-ZKOQR7EA.mjs';
|
|
10
|
+
import '../../chunk-TGPKS2UM.mjs';
|
|
4
11
|
import { connect as connect$1, createServer as createServer$1 } from 'net';
|
|
5
12
|
import { connect, createServer } from 'tls';
|
|
6
13
|
|
|
@@ -70,7 +77,7 @@ var TcpConnectionPool = class {
|
|
|
70
77
|
}
|
|
71
78
|
async send(target, message) {
|
|
72
79
|
if (this.closed) {
|
|
73
|
-
throw new TransportError(TransportErrorCodes.
|
|
80
|
+
throw new TransportError(TransportErrorCodes.CONNECT_FAILED, "Connection pool has been shut down");
|
|
74
81
|
}
|
|
75
82
|
const messageBytes = encodeTransportMessage(message);
|
|
76
83
|
if (messageBytes.byteLength > MAX_MESSAGE_SIZE_BYTES) {
|
|
@@ -83,21 +90,18 @@ var TcpConnectionPool = class {
|
|
|
83
90
|
const socket = await this.getOrCreateConnection(target);
|
|
84
91
|
const frame = encodeFrame(FRAME_TYPE_REQUEST, message.requestId, messageBytes);
|
|
85
92
|
const pendingKey = `${target}:${message.requestId}`;
|
|
93
|
+
const timeoutMs = replyDeadlineMs(message.type, this.config);
|
|
86
94
|
return new Promise((resolve, reject) => {
|
|
87
95
|
const timer = setTimeout(() => {
|
|
88
96
|
this.pendingRequests.delete(pendingKey);
|
|
89
97
|
reject(
|
|
90
|
-
new TransportError(
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
requestId: message.requestId,
|
|
96
|
-
timeoutMs: this.config.requestTimeout
|
|
97
|
-
}
|
|
98
|
-
)
|
|
98
|
+
new TransportError(TransportErrorCodes.TIMEOUT, `Request to '${target}' timed out after ${timeoutMs}ms`, {
|
|
99
|
+
target,
|
|
100
|
+
requestId: message.requestId,
|
|
101
|
+
timeoutMs
|
|
102
|
+
})
|
|
99
103
|
);
|
|
100
|
-
},
|
|
104
|
+
}, timeoutMs);
|
|
101
105
|
this.pendingRequests.set(pendingKey, { target, resolve, reject, timer });
|
|
102
106
|
socket.write(frame, (err) => {
|
|
103
107
|
if (err) {
|
|
@@ -115,7 +119,7 @@ var TcpConnectionPool = class {
|
|
|
115
119
|
}
|
|
116
120
|
async stream(target, message, handler) {
|
|
117
121
|
if (this.closed) {
|
|
118
|
-
throw new TransportError(TransportErrorCodes.
|
|
122
|
+
throw new TransportError(TransportErrorCodes.CONNECT_FAILED, "Connection pool has been shut down");
|
|
119
123
|
}
|
|
120
124
|
const messageBytes = encodeTransportMessage(message);
|
|
121
125
|
const socket = await this.getOrCreateConnection(target);
|
|
@@ -573,13 +577,14 @@ function createTcpTransport(nodeId, config) {
|
|
|
573
577
|
function assertNotShutdown() {
|
|
574
578
|
if (isShutdown) {
|
|
575
579
|
throw new TransportError(
|
|
576
|
-
TransportErrorCodes.
|
|
580
|
+
TransportErrorCodes.CONNECT_FAILED,
|
|
577
581
|
`TCP transport for node '${nodeId}' has been shut down`,
|
|
578
582
|
{ nodeId }
|
|
579
583
|
);
|
|
580
584
|
}
|
|
581
585
|
}
|
|
582
586
|
return {
|
|
587
|
+
timeouts: timeoutsOf(resolvedConfig),
|
|
583
588
|
getPort() {
|
|
584
589
|
return server.getPort();
|
|
585
590
|
},
|