@delali/narsil 0.3.1-next.185 → 0.3.1-next.189
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/README.md +1 -0
- package/dist/adapters/filesystem.mjs +2 -2
- package/dist/adapters/gcs.mjs +2 -2
- package/dist/adapters/indexeddb.mjs +1 -1
- package/dist/adapters/s3.mjs +2 -2
- package/dist/browser/chunk-4E5APHTM.mjs +1459 -0
- package/dist/browser/{chunk-4ZICWS4V.mjs → chunk-QAOVAYAG.mjs} +1 -1
- package/dist/browser/{chunk-CPSHS46N.mjs → chunk-WFQLSNCO.mjs} +27 -22
- package/dist/browser/{chunk-2Q45HI5H.mjs → chunk-YINZFPLT.mjs} +7 -0
- package/dist/browser/{module-XVLHJ7T7.mjs → module-VOTN3Q6X.mjs} +15 -0
- package/dist/browser/{optional-writes-ZTBHYQMN.mjs → optional-writes-J5BHKEQL.mjs} +21 -8
- package/dist/browser/{storage-leaf-4XMCITJ6.mjs → storage-leaf-62LA56U2.mjs} +14558 -13739
- package/dist/{capabilities-DAHXphRn.d.ts → capabilities-CLnQHIqV.d.ts} +51 -9
- package/dist/{chunk-KLVMK3R5.mjs → chunk-2CKDCC65.mjs} +1 -1
- package/dist/{chunk-7WXGUTWK.mjs → chunk-3JRN23HA.mjs} +17 -6
- package/dist/{chunk-5BUEBIXR.mjs → chunk-3OZ2UQJV.mjs} +18 -5
- package/dist/{chunk-VYSWVQCE.mjs → chunk-5HPILB7R.mjs} +2 -2
- package/dist/{chunk-FBQYC5OX.mjs → chunk-6G3VRWH5.mjs} +16 -13
- package/dist/{chunk-QJGDB3WR.mjs → chunk-6GHX35ZM.mjs} +2 -2
- package/dist/{chunk-H4QYQ5DE.mjs → chunk-7NCVV3ST.mjs} +2 -2
- package/dist/{chunk-X5NHWOXT.mjs → chunk-7P5YWDRQ.mjs} +2 -2
- package/dist/{chunk-F4OOBPKA.mjs → chunk-AOYQTX6W.mjs} +1 -1
- package/dist/{chunk-D6FYUTFN.mjs → chunk-ASZLNVWW.mjs} +1 -1
- package/dist/{chunk-DU23J5JG.mjs → chunk-EFS5GVBK.mjs} +6 -6
- package/dist/{chunk-FETZYCH7.mjs → chunk-F6F4G322.mjs} +26 -1
- package/dist/{chunk-IE3Q62QD.mjs → chunk-GR5GMFJJ.mjs} +1 -1
- package/dist/{chunk-Y7QUFIGV.mjs → chunk-GXED6R3Q.mjs} +2 -2
- package/dist/{chunk-LR6JJVML.mjs → chunk-GYLRKKUT.mjs} +764 -699
- package/dist/{react-native/chunks/chunk-ZUFOYZ5P.mjs → chunk-IDWDYS2N.mjs} +1 -1
- package/dist/{chunk-YM2HI5N5.mjs → chunk-IL5DRCNU.mjs} +2 -2
- package/dist/{chunk-BVZWWMOU.mjs → chunk-IWKYAO45.mjs} +2 -2
- package/dist/chunk-JEMK23OY.mjs +602 -0
- package/dist/{chunk-2YWWHMVC.mjs → chunk-JOWXHENJ.mjs} +2 -2
- package/dist/{chunk-SL53DHVE.mjs → chunk-JXDY3ZA3.mjs} +66 -40
- package/dist/{chunk-WLFOLAQI.mjs → chunk-KBU3ZFJN.mjs} +2 -2
- package/dist/{chunk-N3M4NPML.mjs → chunk-M2Z5WVWW.mjs} +1 -1
- package/dist/{chunk-2KCCQK4R.mjs → chunk-NFAWR2O4.mjs} +2 -2
- package/dist/{chunk-EWGIF6FQ.mjs → chunk-NJJN4FMM.mjs} +1 -1
- package/dist/{chunk-MHBG33R5.mjs → chunk-NM2ITITI.mjs} +76 -46
- package/dist/{chunk-WSIU6YXQ.mjs → chunk-NULDX3ID.mjs} +1732 -743
- package/dist/{chunk-II6XF6M4.mjs → chunk-P2IPUYT2.mjs} +6 -6
- package/dist/{chunk-C7YQHCSO.mjs → chunk-P4F4UWLC.mjs} +1 -1
- package/dist/{chunk-A3OAFUZI.mjs → chunk-PLLKT5NU.mjs} +2 -2
- package/dist/{chunk-FCQMZDRI.mjs → chunk-PPD4J2JI.mjs} +3 -3
- package/dist/{chunk-EDEE7ETQ.mjs → chunk-PZYBWMCL.mjs} +3 -3
- package/dist/{chunk-I2WJCRIH.mjs → chunk-R2PJKSNL.mjs} +1 -1
- package/dist/{chunk-M5I64AQW.mjs → chunk-REBDKXAH.mjs} +33 -33
- package/dist/{chunk-6SZQETSC.mjs → chunk-RORNUNXW.mjs} +5 -2
- package/dist/{chunk-CYCVPTTR.mjs → chunk-SCZI7COG.mjs} +2 -2
- package/dist/{chunk-O337MDRJ.mjs → chunk-U5IMECEX.mjs} +38 -13
- package/dist/{chunk-CODGHJVW.mjs → chunk-X2NE4VJI.mjs} +40 -12
- package/dist/{chunk-2GONI5HL.mjs → chunk-YFMM7QOT.mjs} +5 -4
- package/dist/{chunk-JDG6CCXM.mjs → chunk-YQ4RZIIN.mjs} +2 -2
- package/dist/{chunk-G3XRHAJA.mjs → chunk-ZGMCJXY5.mjs} +3 -3
- package/dist/{chunk-Q3ZZH5Z7.mjs → chunk-ZKOQR7EA.mjs} +7 -0
- package/dist/{chunk-CKEOTSF5.mjs → chunk-ZS2YUB2L.mjs} +6 -3
- package/dist/{client-DpqtT2XG.d.ts → client-uB0kp2yT.d.ts} +88 -5
- package/dist/client.d.ts +7 -7
- package/dist/client.mjs +3 -1265
- package/dist/{config-D9WR3MhO.d.ts → config-BvHQ-C7U.d.ts} +3 -3
- package/dist/{config-C687-reW.d.ts → config-PqgNY1H7.d.ts} +1 -1
- package/dist/{core-leaf-NEUM7PU3.mjs → core-leaf-TAR3GJVE.mjs} +3 -3
- package/dist/{direct-executor-37IH3ISS.mjs → direct-executor-QLBSVTEE.mjs} +8 -8
- package/dist/distribution/coordinator/etcd.d.ts +1 -1
- package/dist/distribution/coordinator/etcd.mjs +35 -15
- package/dist/distribution/coordinator/in-memory.d.ts +1 -1
- package/dist/distribution/coordinator/in-memory.mjs +16 -6
- package/dist/distribution/transport/grpc.mjs +2 -2
- package/dist/distribution/transport/tcp.mjs +2 -2
- package/dist/distribution.d.ts +70 -9
- package/dist/distribution.mjs +1694 -679
- package/dist/{durability-config-NWU2G2SJ.mjs → durability-config-VWS2K24E.mjs} +1 -1
- package/dist/{react-native/chunks/embed-4LBSQD7U.mjs → embed-4PHHKGBK.mjs} +1 -1
- package/dist/embeddings/openai.mjs +2 -2
- package/dist/{engine-De6JzTW8.d.ts → engine-qjAxJSKk.d.ts} +206 -7
- package/dist/{index-CBUl4z3E.d.ts → index-BaQIAnk0.d.ts} +137 -111
- package/dist/index.browser.mjs +3 -3
- package/dist/index.d.ts +4 -4
- package/dist/index.mjs +8 -8
- package/dist/index.react-native.mjs +9 -9
- package/dist/{long-query-thread-DIPJBMV7.mjs → long-query-thread-IKD4Z37M.mjs} +21 -21
- package/dist/{module-Z3CL4GJ4.mjs → module-NIVZ4SF2.mjs} +22 -10
- package/dist/{msgpack-leaf-7KBYOVTF.mjs → msgpack-leaf-H5ZYW7S7.mjs} +4 -4
- package/dist/{optional-reads-ENKMVQ4Q.mjs → optional-reads-5HFMF2QZ.mjs} +2 -2
- package/dist/{optional-writes-YIVJMQ4D.mjs → optional-writes-DVTVX2XY.mjs} +31 -18
- package/dist/{paged-partition-archive-IZ6U7DVN.mjs → paged-partition-archive-ES4Z5SM4.mjs} +20 -20
- package/dist/partial-words.browser.mjs +3 -3
- package/dist/partial-words.mjs +8 -8
- package/dist/pattern.browser.mjs +2 -2
- package/dist/pattern.mjs +3 -3
- package/dist/persistence/durability/checkpoint-worker.d.ts +7 -0
- package/dist/persistence/durability/checkpoint-worker.mjs +18 -18
- package/dist/{phrase-module-ZY3TLTQA.mjs → phrase-module-EFESWOCR.mjs} +2 -2
- package/dist/{query-actions-7EOKT3WD.mjs → query-actions-IC5UEWZG.mjs} +8 -8
- package/dist/query-suggestions/merge-worker.mjs +11 -11
- package/dist/query-suggestions.browser.mjs +3 -3
- package/dist/query-suggestions.d.ts +1 -1
- package/dist/query-suggestions.mjs +9 -9
- package/dist/react-native/chunks/{chunk-T5HF3FW3.mjs → chunk-3553RYCS.mjs} +3 -3
- package/dist/react-native/chunks/{chunk-TQ26BKBH.mjs → chunk-43R4GCM7.mjs} +7 -0
- package/dist/react-native/chunks/{chunk-BN6FUB7N.mjs → chunk-AN4HKLB4.mjs} +1 -1
- package/dist/react-native/chunks/{chunk-PVMEHBQO.mjs → chunk-CW2ZFXSE.mjs} +1 -1
- package/dist/react-native/chunks/{chunk-ZQPSXN6C.mjs → chunk-FJHZWUCB.mjs} +5 -5
- package/dist/react-native/chunks/{chunk-NLEFMPY3.mjs → chunk-G434H5WG.mjs} +15 -4
- package/dist/react-native/chunks/{chunk-IEY4DARA.mjs → chunk-GXY4R3GA.mjs} +2 -2
- package/dist/react-native/chunks/{chunk-SK3DPAI4.mjs → chunk-HTBY4GON.mjs} +2 -2
- package/dist/react-native/chunks/{chunk-7TPO4FLE.mjs → chunk-JZOHEHBD.mjs} +3 -3
- package/dist/react-native/chunks/{chunk-ZDDJVR7X.mjs → chunk-MRH36RN3.mjs} +2 -2
- package/dist/react-native/chunks/{chunk-YOTP2FPE.mjs → chunk-UO44MA5M.mjs} +1 -1
- package/dist/react-native/chunks/{chunk-WFQ6YQZA.mjs → chunk-UYKIV2KT.mjs} +1 -1
- package/dist/{chunk-4JBTALUC.mjs → react-native/chunks/chunk-VSN76LWE.mjs} +1 -1
- package/dist/react-native/chunks/{chunk-CBU4M3EU.mjs → chunk-XLYQ2ZMC.mjs} +222 -47
- package/dist/react-native/chunks/{chunk-OZ3XEM6D.mjs → chunk-ZUJCUPVS.mjs} +1 -1
- package/dist/react-native/chunks/{core-leaf-TPBRRWVN.mjs → core-leaf-5PVST5PR.mjs} +4 -4
- package/dist/react-native/chunks/{durability-config-RVTWSXPH.mjs → durability-config-FCSD4MXY.mjs} +1 -1
- package/dist/{embed-2QMYCD2Q.mjs → react-native/chunks/embed-HA2I7RCF.mjs} +1 -1
- package/dist/react-native/chunks/{gzip.react-native-DLO4WW27.mjs → gzip.react-native-CVM4NQG2.mjs} +2 -2
- package/dist/react-native/chunks/{module-COLNJNML.mjs → module-TN7HXWJ3.mjs} +21 -6
- package/dist/react-native/chunks/msgpack-leaf-JMNGSTRW.mjs +7 -0
- package/dist/react-native/chunks/{optional-reads-74HYI4DO.mjs → optional-reads-AFPO2FEB.mjs} +3 -3
- package/dist/react-native/chunks/{optional-writes-QETIM6BI.mjs → optional-writes-2UPNQNAN.mjs} +31 -18
- package/dist/react-native/chunks/{phrase-module-UC4YGEBB.mjs → phrase-module-IGYBK7XH.mjs} +3 -3
- package/dist/react-native/chunks/{resolve-vector-text-FU7D4QP5.mjs → resolve-vector-text-GE2CRJKI.mjs} +1 -1
- package/dist/react-native/chunks/{restore-queue-3E2MJIJS.mjs → restore-queue-DEAWTVHW.mjs} +12 -12
- package/dist/react-native/chunks/{segment-codec-leaf-IE4DXUZV.mjs → segment-codec-leaf-3LZ6HZFD.mjs} +10 -10
- package/dist/react-native/chunks/{segment-merge-leaf-62LQ5WZB.mjs → segment-merge-leaf-5OIWAPCI.mjs} +11 -11
- package/dist/react-native/chunks/{storage-leaf-LNOLKWZB.mjs → storage-leaf-LC4RZU3T.mjs} +15614 -14805
- package/dist/react-native/chunks/{store-leaf-Y7CBOPFZ.mjs → store-leaf-LQ6LWM2Q.mjs} +11 -11
- package/dist/react-native/chunks/{suggestions-leaf-PSUGL6MI.mjs → suggestions-leaf-GPNU6I72.mjs} +11 -11
- package/dist/react-native/chunks/{worker-copies-MW5O5U3D.mjs → worker-copies-32TCHOYP.mjs} +10 -10
- package/dist/react-native/partial-words.mjs +9 -9
- package/dist/react-native/pattern.mjs +5 -5
- package/dist/react-native/query-suggestions.mjs +9 -9
- package/dist/react-native/sync.mjs +433 -51
- package/dist/react-native/synonyms.mjs +9 -9
- package/dist/react.d.ts +8 -8
- package/dist/react.mjs +7 -0
- package/dist/{rerank-KTV5L7MZ.mjs → rerank-ELMGHQ3T.mjs} +8 -8
- package/dist/rerankers/http.mjs +2 -2
- package/dist/{resolve-vector-text-SD6BEMKZ.mjs → resolve-vector-text-OD4J3WHF.mjs} +2 -2
- package/dist/{restore-queue-ES7TDJ5V.mjs → restore-queue-6VCVZT5C.mjs} +11 -11
- package/dist/{segment-codec-leaf-DO75VKEV.mjs → segment-codec-leaf-XNMCUIJF.mjs} +9 -9
- package/dist/{segment-merge-leaf-JGND6LG5.mjs → segment-merge-leaf-RA4S7CC6.mjs} +9 -9
- package/dist/server.d.ts +13 -9
- package/dist/server.mjs +875 -348
- package/dist/{storage-leaf-ZI3H2WJY.mjs → storage-leaf-36SAEVV3.mjs} +5243 -5846
- package/dist/{store-leaf-YIH36Y5J.mjs → store-leaf-QAGHHLEK.mjs} +10 -10
- package/dist/{suggestions-leaf-FP5HSTFP.mjs → suggestions-leaf-JG2IP2VQ.mjs} +12 -12
- package/dist/sync/filesystem.d.ts +2 -2
- package/dist/sync/filesystem.mjs +16 -16
- package/dist/sync/indexeddb.browser.mjs +1 -1
- package/dist/sync/indexeddb.d.ts +2 -2
- package/dist/sync/indexeddb.mjs +3 -3
- package/dist/sync.browser.mjs +35 -1108
- package/dist/sync.d.ts +3 -3
- package/dist/sync.mjs +430 -51
- package/dist/synonyms.browser.mjs +3 -3
- package/dist/synonyms.mjs +8 -8
- package/dist/{tasks-X2IJQc8J.d.ts → tasks-C65V7lIr.d.ts} +3 -3
- package/dist/thread-HAE2XXFR.mjs +31 -0
- package/dist/{types-D0YasjoX.d.ts → types-CpCg-Gq-.d.ts} +1 -1
- package/dist/vector/search-worker.mjs +5 -5
- package/dist/{worker-copies-WYPRCNB7.mjs → worker-copies-IXC43Z4Q.mjs} +11 -11
- package/dist/workers/entry.mjs +14 -14
- package/openapi.json +144 -0
- package/package.json +7 -7
- package/dist/chunk-URVH6BLO.mjs +0 -217
- package/dist/react-native/chunks/msgpack-leaf-GTKLF6GJ.mjs +0 -7
- package/dist/thread-NQRNW3IH.mjs +0 -31
- /package/dist/{chunk-CV3Q2EKO.mjs → chunk-S5QMWECL.mjs} +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { loadFailed, cachedFileBytes, COLD_LOAD_WAIT_WITHOUT_SEARCH_MS, readWholeSectionChecked, checkEverySectionPage, readFileRange, openPagedFile, readCacheOfThisThread, createSectionReader, closePagedFile, COLD_GRAPH_PART_VECTORS, decodeSections, readListedFile, requireListedChecksum, requireListedSize, SEGMENT_PAGE_BYTES, RECORD_PAGE_BYTES, failNativePage, COLD_WALK_NODES_READ_AHEAD } from './chunk-
|
|
2
|
-
import { isDead, VECTOR_FILE_PAYLOAD_VERSION, bytesToVectors, decodeVectorGraphPartPayload, assembleGraphParts, decodeVectorFilePayload, requireBoundedUpperLists, osqRecordBytes, osqBitsOf, countDead, magnitude, rescoreDepth, defaultEfSearch, computeCodeBlockLayout, toScore, osqQuantize, createOsqScratch, stageQueryLevels, scalarQueryProducts, readTrailer, osqEstimate, osqDistance, toDistance, createFixedBuffer } from './chunk-
|
|
3
|
-
import { HEADER_SIZE, openChecksummedEnvelope, crc32, readHeader } from './chunk-
|
|
4
|
-
import { yieldToEventLoop, compareScores } from './chunk-
|
|
1
|
+
import { loadFailed, cachedFileBytes, COLD_LOAD_WAIT_WITHOUT_SEARCH_MS, readWholeSectionChecked, checkEverySectionPage, readFileRange, openPagedFile, readCacheOfThisThread, createSectionReader, closePagedFile, COLD_GRAPH_PART_VECTORS, decodeSections, readListedFile, requireListedChecksum, requireListedSize, SEGMENT_PAGE_BYTES, RECORD_PAGE_BYTES, failNativePage, COLD_WALK_NODES_READ_AHEAD } from './chunk-REBDKXAH.mjs';
|
|
2
|
+
import { isDead, VECTOR_FILE_PAYLOAD_VERSION, bytesToVectors, decodeVectorGraphPartPayload, assembleGraphParts, decodeVectorFilePayload, requireBoundedUpperLists, osqRecordBytes, osqBitsOf, countDead, magnitude, rescoreDepth, defaultEfSearch, computeCodeBlockLayout, toScore, osqQuantize, createOsqScratch, stageQueryLevels, scalarQueryProducts, readTrailer, osqEstimate, osqDistance, toDistance, createFixedBuffer } from './chunk-KBU3ZFJN.mjs';
|
|
3
|
+
import { HEADER_SIZE, openChecksummedEnvelope, crc32, readHeader } from './chunk-PZYBWMCL.mjs';
|
|
4
|
+
import { yieldToEventLoop, compareScores } from './chunk-JXDY3ZA3.mjs';
|
|
5
5
|
import { decode, decodeMulti } from './chunk-GXCDWLQI.mjs';
|
|
6
|
-
import { signalOfSearch, requireSearchActive } from './chunk-
|
|
6
|
+
import { signalOfSearch, requireSearchActive } from './chunk-RORNUNXW.mjs';
|
|
7
7
|
import { MIN_M, MAX_M, MAX_LAYER_CAP } from './chunk-ZXX5GZEX.mjs';
|
|
8
|
-
import { NarsilError, ErrorCodes } from './chunk-
|
|
8
|
+
import { NarsilError, ErrorCodes } from './chunk-ZKOQR7EA.mjs';
|
|
9
9
|
import { compareCodePoints } from './chunk-TGPKS2UM.mjs';
|
|
10
10
|
|
|
11
11
|
// src/persistence/paged/cold-heap.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { isCompositePartition, encodeSegmentState, freezeSegmentShared } from './chunk-
|
|
2
|
-
import { NarsilError, ErrorCodes } from './chunk-
|
|
1
|
+
import { isCompositePartition, encodeSegmentState, freezeSegmentShared } from './chunk-JXDY3ZA3.mjs';
|
|
2
|
+
import { NarsilError, ErrorCodes } from './chunk-ZKOQR7EA.mjs';
|
|
3
3
|
|
|
4
4
|
// src/core/partition/frozen/share.ts
|
|
5
5
|
function shareFrozenSegment(segment, analysis) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { getIndexMetadata } from './chunk-
|
|
2
|
-
import { fnv1a } from './chunk-
|
|
3
|
-
import { NarsilError, ErrorCodes } from './chunk-
|
|
1
|
+
import { getIndexMetadata } from './chunk-X2NE4VJI.mjs';
|
|
2
|
+
import { fnv1a } from './chunk-JXDY3ZA3.mjs';
|
|
3
|
+
import { NarsilError, ErrorCodes } from './chunk-ZKOQR7EA.mjs';
|
|
4
4
|
|
|
5
5
|
// src/distribution/cluster-node/routable-allocation.ts
|
|
6
6
|
async function routableAllocation(coordinator, indexName) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { VERSION, GROUP_PATTERN_SOURCE, loadGzip } from './chunk-
|
|
2
|
-
import { flattenSchema } from './chunk-
|
|
1
|
+
import { VERSION, GROUP_PATTERN_SOURCE, loadGzip } from './chunk-JXDY3ZA3.mjs';
|
|
2
|
+
import { flattenSchema } from './chunk-7P5YWDRQ.mjs';
|
|
3
3
|
import { NATIVE_CRC32_MIN_BYTES, MAX_FILE_BYTES, CHECKSUM_YIELD_CHUNK_BYTES } from './chunk-4PY4JYMY.mjs';
|
|
4
|
-
import { NarsilError, ErrorCodes } from './chunk-
|
|
4
|
+
import { NarsilError, ErrorCodes } from './chunk-ZKOQR7EA.mjs';
|
|
5
5
|
import { encode } from '@msgpack/msgpack';
|
|
6
6
|
import * as zlib from 'zlib';
|
|
7
7
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { SEGMENT_MANIFEST_VERSION, MANIFEST_ENVELOPE_VERSION } from './chunk-
|
|
2
|
-
import { encode } from './chunk-
|
|
3
|
-
import { createFixedBuffer, createVectorFileReader } from './chunk-
|
|
4
|
-
import { crc32, packChecksummedEnvelope, HEADER_SIZE } from './chunk-
|
|
1
|
+
import { SEGMENT_MANIFEST_VERSION, MANIFEST_ENVELOPE_VERSION } from './chunk-NFAWR2O4.mjs';
|
|
2
|
+
import { encode } from './chunk-S5QMWECL.mjs';
|
|
3
|
+
import { createFixedBuffer, createVectorFileReader } from './chunk-KBU3ZFJN.mjs';
|
|
4
|
+
import { crc32, packChecksummedEnvelope, HEADER_SIZE } from './chunk-PZYBWMCL.mjs';
|
|
5
5
|
import { decode } from './chunk-GXCDWLQI.mjs';
|
|
6
|
-
import { nativeSearchCoreIsEnabled, loadNativeCore } from './chunk-
|
|
7
|
-
import { ErrorCodes, NarsilError } from './chunk-
|
|
6
|
+
import { nativeSearchCoreIsEnabled, loadNativeCore } from './chunk-ASZLNVWW.mjs';
|
|
7
|
+
import { ErrorCodes, NarsilError } from './chunk-ZKOQR7EA.mjs';
|
|
8
8
|
|
|
9
9
|
// src/persistence/durability/segment/store.ts
|
|
10
10
|
function directoryCheckpointStore(directory) {
|
|
@@ -280,33 +280,6 @@ function encodeSegmentManifest(manifest) {
|
|
|
280
280
|
return packChecksummedEnvelope([payload], MANIFEST_ENVELOPE_VERSION, "segment manifest");
|
|
281
281
|
}
|
|
282
282
|
|
|
283
|
-
// src/persistence/paged/constants.ts
|
|
284
|
-
var THREAD_READ_CACHE_BYTES = 134217728;
|
|
285
|
-
var NATIVE_PAGE_CACHE_SHARE = 0.25;
|
|
286
|
-
var NATIVE_ASYNC_PAGE_CACHES = 4;
|
|
287
|
-
var MERGE_READ_CACHE_BYTES = 33554432;
|
|
288
|
-
var MERGED_SEGMENT_TARGET_BYTES = 1073741824;
|
|
289
|
-
var MERGED_SEGMENT_GROWTH_ALLOWANCE = 1.01;
|
|
290
|
-
var SECTION_WRITE_BUFFER_BYTES = 1048576;
|
|
291
|
-
var REMOVAL_BUCKET_WRITE_BUFFER_BYTES = 262144;
|
|
292
|
-
var REMOVAL_BUCKET_TARGET_BYTES = 67108864;
|
|
293
|
-
var LARGEST_REMOVAL_BUCKET_COUNT = 256;
|
|
294
|
-
var WRITER_YIELD_INTERVAL_TOKENS = 4096;
|
|
295
|
-
var FILE_ASSEMBLY_CHUNK_BYTES = 4194304;
|
|
296
|
-
var LARGEST_CACHED_ENTRY_SHARE = 0.25;
|
|
297
|
-
var MAX_THREAD_FILE_NUMBER = 524288;
|
|
298
|
-
var LIST_VIEWS_HELD_PER_SEGMENT = 16384;
|
|
299
|
-
var COLD_LOAD_WAIT_WITHOUT_SEARCH_MS = 400;
|
|
300
|
-
var TOMBSTONES_BETWEEN_YIELDS = 4096;
|
|
301
|
-
var STABLE_HEAD_ATTEMPTS = 8;
|
|
302
|
-
var COLD_WALK_NODES_READ_AHEAD = 8;
|
|
303
|
-
var COLD_GRAPH_PART_VECTORS = 16384;
|
|
304
|
-
var READ_AHEAD_CHUNK_BYTES = 1048576;
|
|
305
|
-
var READS_AHEAD_AT_ONCE = 4;
|
|
306
|
-
var REWRITE_SPILL_BYTES = 134217728;
|
|
307
|
-
var POSTING_WRITE_ROWS = 1024;
|
|
308
|
-
var POSTING_WRITE_POSITIONS = 4096;
|
|
309
|
-
|
|
310
283
|
// src/persistence/paged/native-file.ts
|
|
311
284
|
var PAGE_CORRUPT = -9;
|
|
312
285
|
function requireNativePage(status, path, section, page) {
|
|
@@ -345,6 +318,33 @@ function nativeSection(file, section) {
|
|
|
345
318
|
};
|
|
346
319
|
}
|
|
347
320
|
|
|
321
|
+
// src/persistence/paged/constants.ts
|
|
322
|
+
var THREAD_READ_CACHE_BYTES = 134217728;
|
|
323
|
+
var NATIVE_PAGE_CACHE_SHARE = 0.25;
|
|
324
|
+
var NATIVE_ASYNC_PAGE_CACHES = 4;
|
|
325
|
+
var MERGE_READ_CACHE_BYTES = 33554432;
|
|
326
|
+
var MERGED_SEGMENT_TARGET_BYTES = 1073741824;
|
|
327
|
+
var MERGED_SEGMENT_GROWTH_ALLOWANCE = 1.01;
|
|
328
|
+
var SECTION_WRITE_BUFFER_BYTES = 1048576;
|
|
329
|
+
var REMOVAL_BUCKET_WRITE_BUFFER_BYTES = 262144;
|
|
330
|
+
var REMOVAL_BUCKET_TARGET_BYTES = 67108864;
|
|
331
|
+
var LARGEST_REMOVAL_BUCKET_COUNT = 256;
|
|
332
|
+
var WRITER_YIELD_INTERVAL_TOKENS = 4096;
|
|
333
|
+
var FILE_ASSEMBLY_CHUNK_BYTES = 4194304;
|
|
334
|
+
var LARGEST_CACHED_ENTRY_SHARE = 0.25;
|
|
335
|
+
var MAX_THREAD_FILE_NUMBER = 524288;
|
|
336
|
+
var LIST_VIEWS_HELD_PER_SEGMENT = 16384;
|
|
337
|
+
var COLD_LOAD_WAIT_WITHOUT_SEARCH_MS = 400;
|
|
338
|
+
var TOMBSTONES_BETWEEN_YIELDS = 4096;
|
|
339
|
+
var STABLE_HEAD_ATTEMPTS = 8;
|
|
340
|
+
var COLD_WALK_NODES_READ_AHEAD = 8;
|
|
341
|
+
var COLD_GRAPH_PART_VECTORS = 16384;
|
|
342
|
+
var READ_AHEAD_CHUNK_BYTES = 1048576;
|
|
343
|
+
var READS_AHEAD_AT_ONCE = 4;
|
|
344
|
+
var REWRITE_SPILL_BYTES = 134217728;
|
|
345
|
+
var POSTING_WRITE_ROWS = 1024;
|
|
346
|
+
var POSTING_WRITE_POSITIONS = 4096;
|
|
347
|
+
|
|
348
348
|
// src/persistence/paged/page-cache.ts
|
|
349
349
|
var SLOT_BYTES = 65536;
|
|
350
350
|
var SLOT_METADATA_BYTES = 3 * BigUint64Array.BYTES_PER_ELEMENT + 2 * Uint32Array.BYTES_PER_ELEMENT;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { V8_YOUNG_GENERATION_BYTES_BY_MAJOR, SCRATCH_SLOTS_PER_THREAD_POOL } from './chunk-UPDNNOTG.mjs';
|
|
2
|
-
import { NarsilError, ErrorCodes } from './chunk-
|
|
2
|
+
import { NarsilError, ErrorCodes } from './chunk-ZKOQR7EA.mjs';
|
|
3
3
|
|
|
4
4
|
// src/core/search-stop.ts
|
|
5
5
|
var signals = /* @__PURE__ */ new WeakMap();
|
|
@@ -73,6 +73,9 @@ function answerFromOneState(manager, answer, signal) {
|
|
|
73
73
|
function createDocIdMap() {
|
|
74
74
|
return /* @__PURE__ */ new Map();
|
|
75
75
|
}
|
|
76
|
+
function shardEntryRangeOf(entries) {
|
|
77
|
+
return { shards: 1, smallest: entries, largest: entries };
|
|
78
|
+
}
|
|
76
79
|
|
|
77
80
|
// src/runtime/engine-threads.ts
|
|
78
81
|
var MEGABYTE_BYTES = 1048576;
|
|
@@ -204,4 +207,4 @@ function splitWorkerBudget(total) {
|
|
|
204
207
|
return { keyword, vector: total - keyword };
|
|
205
208
|
}
|
|
206
209
|
|
|
207
|
-
export { CONSECUTIVE_TIMEOUTS_BEFORE_DEATH, DEFAULT_BACKPRESSURE_LIMIT, DEFAULT_REQUEST_TIMEOUT_MS, SHUTDOWN_TIMEOUT_MS, WORKER_YOUNG_GENERATION_MB, answerFromOneState, bindSearchSignal, bindSignalStop, countEngineThread, createDocIdMap, detectRuntime, engineThreadYoungGenerationBytes, missingWorkerEntry, nodeThreadId, requirePinnedState, requireSearchActive, resolveRequestThreadCount, resolveWorkerCount, resolveWorkerEntry, sharedStopOfSignal, signalOfSearch, spawnNodeWorker, splitWorkerBudget, stopOfSignal, youngGenerationBytesOfThisV8 };
|
|
210
|
+
export { CONSECUTIVE_TIMEOUTS_BEFORE_DEATH, DEFAULT_BACKPRESSURE_LIMIT, DEFAULT_REQUEST_TIMEOUT_MS, SHUTDOWN_TIMEOUT_MS, WORKER_YOUNG_GENERATION_MB, answerFromOneState, bindSearchSignal, bindSignalStop, countEngineThread, createDocIdMap, detectRuntime, engineThreadYoungGenerationBytes, missingWorkerEntry, nodeThreadId, requirePinnedState, requireSearchActive, resolveRequestThreadCount, resolveWorkerCount, resolveWorkerEntry, shardEntryRangeOf, sharedStopOfSignal, signalOfSearch, spawnNodeWorker, splitWorkerBudget, stopOfSignal, youngGenerationBytesOfThisV8 };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getFs, getPath } from './chunk-HLPRHOSO.mjs';
|
|
2
2
|
import { DIRECTORY_LOCK_ATTEMPTS, DIRECTORY_LOCK_SETTLE_MS, DIRECTORY_LOCK_PROCESS_START_TOLERANCE_MS } from './chunk-MSIN4NM3.mjs';
|
|
3
|
-
import { nodeThreadId } from './chunk-
|
|
4
|
-
import { NarsilError, ErrorCodes } from './chunk-
|
|
3
|
+
import { nodeThreadId } from './chunk-RORNUNXW.mjs';
|
|
4
|
+
import { NarsilError, ErrorCodes } from './chunk-ZKOQR7EA.mjs';
|
|
5
5
|
import { compareCodePoints } from './chunk-TGPKS2UM.mjs';
|
|
6
6
|
import { openSync, close, readFileSync } from 'fs';
|
|
7
7
|
import { rename, readFile, writeFile, unlink, realpath, readdir, readlink } from 'fs/promises';
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { syncStorageOf, INDEX_CONFIGURATION_ENVELOPE_VERSION, MAX_SNAPSHOT_ANALYSIS_ATTEMPTS, encodeIndexConfiguration } from './chunk-
|
|
2
|
-
import { archiveLayout } from './chunk-
|
|
3
|
-
import { manifestFileRefs } from './chunk-
|
|
1
|
+
import { syncStorageOf, INDEX_CONFIGURATION_ENVELOPE_VERSION, MAX_SNAPSHOT_ANALYSIS_ATTEMPTS, encodeIndexConfiguration } from './chunk-JEMK23OY.mjs';
|
|
2
|
+
import { archiveLayout } from './chunk-3JRN23HA.mjs';
|
|
3
|
+
import { manifestFileRefs } from './chunk-NFAWR2O4.mjs';
|
|
4
4
|
import { DIRECTORY_IDENTITY_CHECK_INTERVAL_MS } from './chunk-MSIN4NM3.mjs';
|
|
5
5
|
import { oneSyncChangeAtATime } from './chunk-V6EUBAIT.mjs';
|
|
6
|
-
import { openChecksummedEnvelope } from './chunk-
|
|
7
|
-
import { withOpenIndex, emitEngineEvent } from './chunk-
|
|
6
|
+
import { openChecksummedEnvelope } from './chunk-PZYBWMCL.mjs';
|
|
7
|
+
import { withOpenIndex, emitEngineEvent } from './chunk-JXDY3ZA3.mjs';
|
|
8
8
|
import { decode } from './chunk-GXCDWLQI.mjs';
|
|
9
9
|
import { isSyncEpoch } from './chunk-BUMREPLU.mjs';
|
|
10
|
-
import { NarsilError, ErrorCodes } from './chunk-
|
|
10
|
+
import { NarsilError, ErrorCodes } from './chunk-ZKOQR7EA.mjs';
|
|
11
11
|
|
|
12
12
|
// src/persistence/durability/directory-watch.ts
|
|
13
13
|
function unrefInterval(tick, intervalMs) {
|
|
@@ -100,6 +100,7 @@ function createDirectoryWatch(directory, isStopped, onLost) {
|
|
|
100
100
|
// src/persistence/durability/sync/constants.ts
|
|
101
101
|
var LOG_READ_CHUNK_BYTES = 1048576;
|
|
102
102
|
var DEFAULT_HISTORY_MAX_AGE_MS = 2592e6;
|
|
103
|
+
var DEFAULT_CHANGES_HISTORY_MAX_BYTES_FLOOR = 1073741824;
|
|
103
104
|
|
|
104
105
|
// src/engine/sync/archive.ts
|
|
105
106
|
function publishedArchiveLayout(indexName, snapshot, storage) {
|
|
@@ -205,16 +206,40 @@ function stateOf(core) {
|
|
|
205
206
|
}
|
|
206
207
|
return state;
|
|
207
208
|
}
|
|
209
|
+
async function syncLimits(sync, storage, indexName) {
|
|
210
|
+
const published = sync.historyMaxBytes === void 0 ? await storage.published(indexName) : null;
|
|
211
|
+
return {
|
|
212
|
+
maxAgeMs: sync.historyMaxAgeMs ?? DEFAULT_HISTORY_MAX_AGE_MS,
|
|
213
|
+
maxBytes: sync.historyMaxBytes ?? (published === null ? Number.POSITIVE_INFINITY : publishedArchiveLayout(indexName, published, storage).byteLength)
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
async function changesLimits(changes, storage, indexName) {
|
|
217
|
+
let maxBytes = changes.historyMaxBytes;
|
|
218
|
+
if (maxBytes === void 0) {
|
|
219
|
+
const manifest = await storage.currentManifest(indexName);
|
|
220
|
+
let checkpointBytes = 0;
|
|
221
|
+
if (manifest !== null) for (const ref of manifestFileRefs(manifest)) checkpointBytes += ref.bytes;
|
|
222
|
+
maxBytes = Math.max(checkpointBytes, DEFAULT_CHANGES_HISTORY_MAX_BYTES_FLOOR);
|
|
223
|
+
}
|
|
224
|
+
return { maxAgeMs: changes.historyMaxAgeMs ?? DEFAULT_HISTORY_MAX_AGE_MS, maxBytes };
|
|
225
|
+
}
|
|
226
|
+
async function historyLimitsOf(sync, changes, storage, indexName) {
|
|
227
|
+
const kept = sync?.active === true ? await syncLimits(sync, storage, indexName) : null;
|
|
228
|
+
const captured = changes === null ? null : await changesLimits(changes, storage, indexName);
|
|
229
|
+
if (kept === null) return captured;
|
|
230
|
+
if (captured === null) return kept;
|
|
231
|
+
return { maxAgeMs: Math.max(kept.maxAgeMs, captured.maxAgeMs), maxBytes: Math.max(kept.maxBytes, captured.maxBytes) };
|
|
232
|
+
}
|
|
208
233
|
async function enforce(core, indexName) {
|
|
209
|
-
const
|
|
234
|
+
const entry = core.indexRegistry.get(indexName);
|
|
210
235
|
const storage = core.durability?.manager.syncStorage?.();
|
|
211
|
-
if (
|
|
212
|
-
const
|
|
213
|
-
|
|
214
|
-
const publishesSnapshots = core.mutationCtx.capacityScope !== "partition";
|
|
236
|
+
if (entry === void 0 || storage === void 0 || core.shutdownState.isShutdown) return;
|
|
237
|
+
const limits = await historyLimitsOf(entry.sync, entry.changes, storage, indexName);
|
|
238
|
+
if (limits === null) return;
|
|
239
|
+
const publishesSnapshots = entry.sync?.active === true && core.mutationCtx.capacityScope !== "partition";
|
|
215
240
|
await storage.enforceHistoryLimits(
|
|
216
241
|
indexName,
|
|
217
|
-
|
|
242
|
+
limits,
|
|
218
243
|
publishesSnapshots ? async () => {
|
|
219
244
|
const { unpin } = await publishedSyncSnapshot(core, indexName, true);
|
|
220
245
|
unpin();
|
|
@@ -250,7 +275,7 @@ function startSyncRetentionSweep(core) {
|
|
|
250
275
|
return;
|
|
251
276
|
}
|
|
252
277
|
for (const [indexName, entry] of core.indexRegistry) {
|
|
253
|
-
if (entry.sync?.active === true) scheduleSyncRetention(core, indexName);
|
|
278
|
+
if (entry.sync?.active === true || entry.changes !== null) scheduleSyncRetention(core, indexName);
|
|
254
279
|
}
|
|
255
280
|
}, HISTORY_SWEEP_INTERVAL_MS);
|
|
256
281
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { restoredEmbedding, restoredPartitionConfig, readSharedConfigFields } from './chunk-
|
|
1
|
+
import { restoredEmbedding, restoredPartitionConfig, readSharedConfigFields } from './chunk-M2Z5WVWW.mjs';
|
|
2
2
|
import { MAX_PARTITION_COUNT, MAX_REPLICATION_FACTOR } from './chunk-JDDXV6UF.mjs';
|
|
3
|
-
import { storedStateOf } from './chunk-
|
|
4
|
-
import { getLanguage, generateId, decodeSynonymRules } from './chunk-
|
|
3
|
+
import { storedStateOf } from './chunk-PZYBWMCL.mjs';
|
|
4
|
+
import { getLanguage, generateId, decodeSynonymRules } from './chunk-JXDY3ZA3.mjs';
|
|
5
5
|
import { decode } from './chunk-GXCDWLQI.mjs';
|
|
6
6
|
import { isSyncEpoch } from './chunk-BUMREPLU.mjs';
|
|
7
7
|
import { MAX_INDEX_NAME_LENGTH, INDEX_NAME_PATTERN } from './chunk-3ECIRFS5.mjs';
|
|
8
|
-
import { NarsilError, ErrorCodes } from './chunk-
|
|
8
|
+
import { NarsilError, ErrorCodes } from './chunk-ZKOQR7EA.mjs';
|
|
9
9
|
import { compareCodePoints } from './chunk-TGPKS2UM.mjs';
|
|
10
10
|
import { encode } from '@msgpack/msgpack';
|
|
11
11
|
|
|
@@ -57,6 +57,8 @@ var DEFAULT_NODE_LIFECYCLE_CONFIG = {
|
|
|
57
57
|
nodeHeartbeatIntervalMs: 1e4
|
|
58
58
|
};
|
|
59
59
|
var MAX_SYNONYM_GENERATION_LENGTH = 128;
|
|
60
|
+
var UNFED_REPLICA_CHECK_INTERVAL_MS = 1e3;
|
|
61
|
+
var UNFED_REPLICA_RESYNC_MS = 15e3;
|
|
60
62
|
function decodeClusterQuerySuggestionSettings(raw, reject) {
|
|
61
63
|
let state;
|
|
62
64
|
try {
|
|
@@ -97,14 +99,16 @@ function metadataWithSuggestionState(snapshot, state) {
|
|
|
97
99
|
function isPositiveSafeInteger(value) {
|
|
98
100
|
return typeof value === "number" && Number.isSafeInteger(value) && value >= 1;
|
|
99
101
|
}
|
|
100
|
-
function
|
|
101
|
-
if (!isRecord2(raw) || typeof raw.enabled !== "boolean")
|
|
102
|
+
function decodeHistorySetting(field, raw, reject) {
|
|
103
|
+
if (!isRecord2(raw) || typeof raw.enabled !== "boolean") {
|
|
104
|
+
return reject(`${field} must be a map with a boolean enabled`);
|
|
105
|
+
}
|
|
102
106
|
const { historyMaxAgeMs, historyMaxBytes } = raw;
|
|
103
107
|
if (historyMaxAgeMs !== void 0 && !isPositiveSafeInteger(historyMaxAgeMs)) {
|
|
104
|
-
return reject(
|
|
108
|
+
return reject(`${field}.historyMaxAgeMs must be a positive whole number`);
|
|
105
109
|
}
|
|
106
110
|
if (historyMaxBytes !== void 0 && !isPositiveSafeInteger(historyMaxBytes)) {
|
|
107
|
-
return reject(
|
|
111
|
+
return reject(`${field}.historyMaxBytes must be a positive whole number`);
|
|
108
112
|
}
|
|
109
113
|
return {
|
|
110
114
|
enabled: raw.enabled,
|
|
@@ -112,8 +116,17 @@ function decodeSyncSetting(raw, reject) {
|
|
|
112
116
|
...historyMaxBytes !== void 0 ? { historyMaxBytes } : {}
|
|
113
117
|
};
|
|
114
118
|
}
|
|
119
|
+
function decodeChangesSetting(raw, reject) {
|
|
120
|
+
const history = decodeHistorySetting("changes", raw, reject);
|
|
121
|
+
const previousDocument = isRecord2(raw) ? raw.previousDocument : void 0;
|
|
122
|
+
if (previousDocument !== void 0 && typeof previousDocument !== "boolean") {
|
|
123
|
+
return reject("changes.previousDocument must be a boolean");
|
|
124
|
+
}
|
|
125
|
+
return { ...history, ...previousDocument === true ? { previousDocument } : {} };
|
|
126
|
+
}
|
|
115
127
|
function decodeClusterSyncSettings(raw, reject) {
|
|
116
|
-
const sync = raw.sync === void 0 ? void 0 :
|
|
128
|
+
const sync = raw.sync === void 0 ? void 0 : decodeHistorySetting("sync", raw.sync, reject);
|
|
129
|
+
const changes = raw.changes === void 0 ? void 0 : decodeChangesSetting(raw.changes, reject);
|
|
117
130
|
if (raw.syncActive !== void 0 && typeof raw.syncActive !== "boolean") {
|
|
118
131
|
return reject("syncActive must be a boolean");
|
|
119
132
|
}
|
|
@@ -123,9 +136,13 @@ function decodeClusterSyncSettings(raw, reject) {
|
|
|
123
136
|
return {
|
|
124
137
|
...sync !== void 0 ? { sync } : {},
|
|
125
138
|
...raw.syncActive !== void 0 ? { syncActive: raw.syncActive } : {},
|
|
126
|
-
...raw.syncEpoch !== void 0 ? { syncEpoch: raw.syncEpoch } : {}
|
|
139
|
+
...raw.syncEpoch !== void 0 ? { syncEpoch: raw.syncEpoch } : {},
|
|
140
|
+
...changes !== void 0 ? { changes } : {}
|
|
127
141
|
};
|
|
128
142
|
}
|
|
143
|
+
function epochFeaturesOn(settings) {
|
|
144
|
+
return settings?.sync?.enabled === true || settings?.changes?.enabled === true;
|
|
145
|
+
}
|
|
129
146
|
function metadataWithSync(snapshot, next) {
|
|
130
147
|
const decoded = decode(snapshot.bytes);
|
|
131
148
|
const fields = isRecord2(decoded) ? decoded : {};
|
|
@@ -133,9 +150,19 @@ function metadataWithSync(snapshot, next) {
|
|
|
133
150
|
return new Uint8Array(encode({ ...fields, settings: { ...settings, ...next } }, { ignoreUndefined: true }));
|
|
134
151
|
}
|
|
135
152
|
function withoutSyncFields(settings) {
|
|
136
|
-
const { sync: _sync, syncActive: _active, syncEpoch: _epoch, ...rest } = settings;
|
|
153
|
+
const { sync: _sync, syncActive: _active, syncEpoch: _epoch, changes: _changes, ...rest } = settings;
|
|
137
154
|
return rest;
|
|
138
155
|
}
|
|
156
|
+
function syncSettingsOfSnapshot(snapshot) {
|
|
157
|
+
const settings = snapshot.settings;
|
|
158
|
+
if (settings === void 0) return {};
|
|
159
|
+
return {
|
|
160
|
+
...settings.sync !== void 0 ? { sync: settings.sync } : {},
|
|
161
|
+
...settings.syncActive !== void 0 ? { syncActive: settings.syncActive } : {},
|
|
162
|
+
...settings.syncEpoch !== void 0 ? { syncEpoch: settings.syncEpoch } : {},
|
|
163
|
+
...settings.changes !== void 0 ? { changes: settings.changes } : {}
|
|
164
|
+
};
|
|
165
|
+
}
|
|
139
166
|
|
|
140
167
|
// src/distribution/cluster/synonym-set.ts
|
|
141
168
|
var SYNONYM_CHUNK_BYTES = 1048576;
|
|
@@ -406,6 +433,7 @@ function indexConfigFromSettings(schema, settings, indexName) {
|
|
|
406
433
|
sync: _sync,
|
|
407
434
|
syncActive: _syncActive,
|
|
408
435
|
syncEpoch: _syncEpoch,
|
|
436
|
+
changes: _changes,
|
|
409
437
|
querySuggestions: _querySuggestions,
|
|
410
438
|
bannedQueries: _bannedQueries,
|
|
411
439
|
querySuggestionsSource: _querySuggestionsSource,
|
|
@@ -667,4 +695,4 @@ function storedSynonymSetOf(bytes) {
|
|
|
667
695
|
return ref === null ? null : { indexUuid: decoded.indexUuid, ref };
|
|
668
696
|
}
|
|
669
697
|
|
|
670
|
-
export { ALLOCATION_CAS_ATTEMPTS, ALLOCATION_RETRY_DELAY_MS, ANALYSIS_CHANGE_POLL_INTERVAL_MS, ANALYSIS_CHANGE_RETRY_MS, ANALYSIS_REBUILD_RESEND_MS, BOOTSTRAP_CAS_ATTEMPTS, DEFAULT_CONTROLLER_CONFIG, DEFAULT_NODE_LIFECYCLE_CONFIG, ESTIMATED_PARTITION_BYTES, HIDDEN_GENERATION_PREFIX, LEADERSHIP_IMBALANCE_THRESHOLD, MAX_RESHARD_CUTOVER_ATTEMPTS, PARTITION_STORES_TIMEOUT_MS, REBALANCE_THRESHOLD, RECOVERY_CAS_ATTEMPTS, RESHARD_CONTROLLER_POLL_INTERVAL_MS, RESHARD_CUTOVER_LAG_ENTRIES, RESHARD_CUTOVER_TIMEOUT_MS, RESHARD_FORWARD_BATCH_DOCUMENTS, RESHARD_POLL_INTERVAL_MS, RESHARD_RECORD_CAS_ATTEMPTS, RESHARD_RECORD_CHECK_INTERVAL_MS, RESHARD_RETRY_DELAY_MS, SYNC_EPOCH_CAS_ATTEMPTS, TEARDOWN_CAS_ATTEMPTS, TEARDOWN_RETRY_DELAY_MS, TEARDOWN_RETRY_ROUNDS, decodeIndexSettings, deleteSynonymSet, getClusterIndexConfig, getIndexMetadata, indexConfigFromSettings, indexConfigKey, indexMetadataSnapshotOf, indexSettingsOf, indexUuidOfStoredMetadata, isRecord, isRecord2, isValidInteger, metadataWithBm25, metadataWithSuggestionState, metadataWithSync, metadataWithSynonymSet, putGenerationMetadata, putIndexMetadata, putIndexReplicationFactor, readIndexMetadataSnapshot, readIndexState, storeSynonymSet, storedSynonymSetOf, suggestionStateOfSettings, validateIndexName, withPartitionCount };
|
|
698
|
+
export { ALLOCATION_CAS_ATTEMPTS, ALLOCATION_RETRY_DELAY_MS, ANALYSIS_CHANGE_POLL_INTERVAL_MS, ANALYSIS_CHANGE_RETRY_MS, ANALYSIS_REBUILD_RESEND_MS, BOOTSTRAP_CAS_ATTEMPTS, DEFAULT_CONTROLLER_CONFIG, DEFAULT_NODE_LIFECYCLE_CONFIG, ESTIMATED_PARTITION_BYTES, HIDDEN_GENERATION_PREFIX, LEADERSHIP_IMBALANCE_THRESHOLD, MAX_RESHARD_CUTOVER_ATTEMPTS, PARTITION_STORES_TIMEOUT_MS, REBALANCE_THRESHOLD, RECOVERY_CAS_ATTEMPTS, RESHARD_CONTROLLER_POLL_INTERVAL_MS, RESHARD_CUTOVER_LAG_ENTRIES, RESHARD_CUTOVER_TIMEOUT_MS, RESHARD_FORWARD_BATCH_DOCUMENTS, RESHARD_POLL_INTERVAL_MS, RESHARD_RECORD_CAS_ATTEMPTS, RESHARD_RECORD_CHECK_INTERVAL_MS, RESHARD_RETRY_DELAY_MS, SYNC_EPOCH_CAS_ATTEMPTS, TEARDOWN_CAS_ATTEMPTS, TEARDOWN_RETRY_DELAY_MS, TEARDOWN_RETRY_ROUNDS, UNFED_REPLICA_CHECK_INTERVAL_MS, UNFED_REPLICA_RESYNC_MS, decodeIndexSettings, deleteSynonymSet, epochFeaturesOn, getClusterIndexConfig, getIndexMetadata, indexConfigFromSettings, indexConfigKey, indexMetadataSnapshotOf, indexSettingsOf, indexUuidOfStoredMetadata, isRecord, isRecord2, isValidInteger, metadataWithBm25, metadataWithSuggestionState, metadataWithSync, metadataWithSynonymSet, putGenerationMetadata, putIndexMetadata, putIndexReplicationFactor, readIndexMetadataSnapshot, readIndexState, storeSynonymSet, storedSynonymSetOf, suggestionStateOfSettings, syncSettingsOfSnapshot, validateIndexName, withPartitionCount };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { readRecentMemoryFigures, readMemoryFigures } from './chunk-
|
|
2
|
-
import { collectGarbageBeforeAnswerRefusal, collectYoungGenerationBeforeRefusal, reservedHeapBytes, admitHeapBytes } from './chunk-
|
|
3
|
-
import { NarsilError, ErrorCodes, ServerErrorCodes } from './chunk-
|
|
1
|
+
import { readRecentMemoryFigures, readMemoryFigures } from './chunk-JXDY3ZA3.mjs';
|
|
2
|
+
import { collectGarbageBeforeAnswerRefusal, collectYoungGenerationBeforeRefusal, reservedHeapBytes, admitHeapBytes } from './chunk-AOYQTX6W.mjs';
|
|
3
|
+
import { NarsilError, ErrorCodes, ServerErrorCodes } from './chunk-ZKOQR7EA.mjs';
|
|
4
4
|
|
|
5
5
|
// src/distribution/cluster-node/constants.ts
|
|
6
6
|
var DEFAULT_PARTITION_COUNT = 5;
|
|
@@ -31,6 +31,7 @@ var SYNCED_POSITION_REPORT_TIMEOUT_MS = 5e3;
|
|
|
31
31
|
var REGISTRATION_LEASE_DRIFT_SHARE = 0.1;
|
|
32
32
|
var REGISTRATION_LEASE_CONFIRM_TIMEOUT_MS = 5e3;
|
|
33
33
|
var ADMISSION_TIMEOUT_MS = 1e4;
|
|
34
|
+
var ADMISSION_RETRIES_AFTER_IN_SYNC_CHANGE = 3;
|
|
34
35
|
var CATCH_UP_TICK_MS = 1e3;
|
|
35
36
|
var CATCH_UP_FEED_WINDOW_MS = 1e3;
|
|
36
37
|
var MAX_CATCH_UP_IN_FLIGHT_BYTES = 67108864;
|
|
@@ -224,4 +225,4 @@ function refuseEncodeWithoutRoom(documents) {
|
|
|
224
225
|
if (refusal2 !== null) throw refusal2;
|
|
225
226
|
}
|
|
226
227
|
|
|
227
|
-
export { ADMISSION_TIMEOUT_MS, ANSWER_DECODE_HEAP_BYTES_PER_PAYLOAD_BYTE, CATCH_UP_FEED_WINDOW_MS, CATCH_UP_TICK_MS, CLEAR_PAGE_SIZE, COORDINATOR_REQUEST_BUCKET_BOUNDS_SECONDS, COPY_FAILURE_ATTEMPTS, COPY_FAILURE_RETRY_DELAY_MS, DECOMMISSION_RECHECK_INTERVAL_MS, DEFAULT_BOOTSTRAP_SYNC_DEADLINE_MS, DEFAULT_CAPACITY, DEFAULT_CREATE_INDEX_WAIT_MS, DEFAULT_IN_FLIGHT_WRITE_FRACTION, DEFAULT_MAX_PER_SOURCE_SNAPSHOTS, DEFAULT_MAX_STREAMS_PER_INDEX, DEFAULT_PARTITION_COUNT, DEFAULT_REPLICATION_FACTOR, DROP_ACKNOWLEDGE_POLL_INTERVAL_MS, FETCH_GROUP_DOCUMENT_IDS, FORWARD_RETRY_DELAY_CAP_MS, FORWARD_RETRY_INITIAL_DELAY_MS, MAX_CATCH_UP_IN_FLIGHT_BYTES, MAX_DROP_ACKNOWLEDGE_WAIT_MS, MAX_NODE_LEFT_DELAY_MS, MAX_SETTINGS_REPLACEMENT_ATTEMPTS, MAX_SOURCE_ID_LENGTH, MAX_WAIT_FOR_ACTIVE_REPLICAS, MEMORY_SAMPLE_INTERVAL_MS, MIN_CONTROLLER_LEASE_TTL_MS, OUT_OF_STEP_REMOVAL_RETRY_DELAY_CAP_MS, OUT_OF_STEP_REMOVAL_RETRY_INITIAL_DELAY_MS, PARTITION_BYTES_ENTRY_BYTES, PARTITION_BYTES_INDEX_OVERHEAD_BYTES, PARTITION_BYTES_REPORT_BUDGET_BYTES, PARTITION_WRITE_CONCURRENCY, PRIMARY_CHANGE_POLL_INTERVAL_MS, PRIMARY_CHANGE_RETRY_WINDOW_MS, REGISTRATION_LEASE_CONFIRM_TIMEOUT_MS, REGISTRATION_LEASE_DRIFT_SHARE, ROLLBACK_RETRY_DELAY_CAP_MS, ROLLBACK_RETRY_INITIAL_DELAY_MS, SEARCH_CONTEXT_ENTRY_HEAP_BYTES, SEARCH_CONTEXT_REAPER_INTERVAL_MS, SETTINGS_CONTENTION_REASON, SNAPSHOT_CHUNK_YIELD_INTERVAL_MS, SYNCED_POSITION_REPORT_TIMEOUT_MS, WRITE_APPLY_YIELD_INTERVAL_MS, WRITE_MEMORY_SAMPLE_MAX_AGE_MS, answerRefusalOf, createWritePressure, estimateDocumentBytes, estimateDocumentsBytes, estimateForwardedBytes, refuseEncodeWithoutRoom, withAdmittedWrite };
|
|
228
|
+
export { ADMISSION_RETRIES_AFTER_IN_SYNC_CHANGE, ADMISSION_TIMEOUT_MS, ANSWER_DECODE_HEAP_BYTES_PER_PAYLOAD_BYTE, CATCH_UP_FEED_WINDOW_MS, CATCH_UP_TICK_MS, CLEAR_PAGE_SIZE, COORDINATOR_REQUEST_BUCKET_BOUNDS_SECONDS, COPY_FAILURE_ATTEMPTS, COPY_FAILURE_RETRY_DELAY_MS, DECOMMISSION_RECHECK_INTERVAL_MS, DEFAULT_BOOTSTRAP_SYNC_DEADLINE_MS, DEFAULT_CAPACITY, DEFAULT_CREATE_INDEX_WAIT_MS, DEFAULT_IN_FLIGHT_WRITE_FRACTION, DEFAULT_MAX_PER_SOURCE_SNAPSHOTS, DEFAULT_MAX_STREAMS_PER_INDEX, DEFAULT_PARTITION_COUNT, DEFAULT_REPLICATION_FACTOR, DROP_ACKNOWLEDGE_POLL_INTERVAL_MS, FETCH_GROUP_DOCUMENT_IDS, FORWARD_RETRY_DELAY_CAP_MS, FORWARD_RETRY_INITIAL_DELAY_MS, MAX_CATCH_UP_IN_FLIGHT_BYTES, MAX_DROP_ACKNOWLEDGE_WAIT_MS, MAX_NODE_LEFT_DELAY_MS, MAX_SETTINGS_REPLACEMENT_ATTEMPTS, MAX_SOURCE_ID_LENGTH, MAX_WAIT_FOR_ACTIVE_REPLICAS, MEMORY_SAMPLE_INTERVAL_MS, MIN_CONTROLLER_LEASE_TTL_MS, OUT_OF_STEP_REMOVAL_RETRY_DELAY_CAP_MS, OUT_OF_STEP_REMOVAL_RETRY_INITIAL_DELAY_MS, PARTITION_BYTES_ENTRY_BYTES, PARTITION_BYTES_INDEX_OVERHEAD_BYTES, PARTITION_BYTES_REPORT_BUDGET_BYTES, PARTITION_WRITE_CONCURRENCY, PRIMARY_CHANGE_POLL_INTERVAL_MS, PRIMARY_CHANGE_RETRY_WINDOW_MS, REGISTRATION_LEASE_CONFIRM_TIMEOUT_MS, REGISTRATION_LEASE_DRIFT_SHARE, ROLLBACK_RETRY_DELAY_CAP_MS, ROLLBACK_RETRY_INITIAL_DELAY_MS, SEARCH_CONTEXT_ENTRY_HEAP_BYTES, SEARCH_CONTEXT_REAPER_INTERVAL_MS, SETTINGS_CONTENTION_REASON, SNAPSHOT_CHUNK_YIELD_INTERVAL_MS, SYNCED_POSITION_REPORT_TIMEOUT_MS, WRITE_APPLY_YIELD_INTERVAL_MS, WRITE_MEMORY_SAMPLE_MAX_AGE_MS, answerRefusalOf, createWritePressure, estimateDocumentBytes, estimateDocumentsBytes, estimateForwardedBytes, refuseEncodeWithoutRoom, withAdmittedWrite };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { bindResponseStop, sendError, RELAY_STREAM_CHUNKS_IN_FLIGHT } from './chunk-
|
|
2
|
-
import { ServerErrorCodes } from './chunk-
|
|
1
|
+
import { bindResponseStop, sendError, RELAY_STREAM_CHUNKS_IN_FLIGHT } from './chunk-NM2ITITI.mjs';
|
|
2
|
+
import { ServerErrorCodes } from './chunk-ZKOQR7EA.mjs';
|
|
3
3
|
import { rm } from 'fs/promises';
|
|
4
4
|
import path from 'path';
|
|
5
5
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { MAX_HISTORY_FILE_BYTES, openChecksummedEnvelope, KEY_FINGERPRINT_BYTES, DAY_MS, dayFileKey, SCRAMBLED_ID_BYTES, restoreStagingPrefix, resolveSetting, QUERY_HISTORY_ARCHIVE_PREFIX, restoredFileKey, attachedRuntimeOf, MAX_INDEX_UUID_LENGTH, HEADER_SIZE, isGroup, isNormalPhrase, MAX_MAX_LENGTH, MAX_MAX_WORDS, listHistoryFolder, historyFileOf, MIN_PHRASE_TABLE_CAPACITY, PERSON_TABLE_MIN_SLOTS, PAIR_PAGE_BLOCKS, PAIR_BLOCK_SLOTS, packEnvelopeWithChecksum, crc32, MAX_PEOPLE_PER_PHRASE_IN_FILE } from './chunk-
|
|
2
|
-
import { loadSuggestionsCode, emitWriteEventAfter, dropEngineIndex } from './chunk-
|
|
3
|
-
import { NarsilError, ErrorCodes } from './chunk-
|
|
1
|
+
import { MAX_HISTORY_FILE_BYTES, openChecksummedEnvelope, KEY_FINGERPRINT_BYTES, DAY_MS, dayFileKey, SCRAMBLED_ID_BYTES, restoreStagingPrefix, resolveSetting, QUERY_HISTORY_ARCHIVE_PREFIX, restoredFileKey, attachedRuntimeOf, MAX_INDEX_UUID_LENGTH, HEADER_SIZE, isGroup, isNormalPhrase, MAX_MAX_LENGTH, MAX_MAX_WORDS, listHistoryFolder, historyFileOf, MIN_PHRASE_TABLE_CAPACITY, PERSON_TABLE_MIN_SLOTS, PAIR_PAGE_BLOCKS, PAIR_BLOCK_SLOTS, packEnvelopeWithChecksum, crc32, MAX_PEOPLE_PER_PHRASE_IN_FILE } from './chunk-PZYBWMCL.mjs';
|
|
2
|
+
import { loadSuggestionsCode, emitWriteEventAfter, dropEngineIndex } from './chunk-JXDY3ZA3.mjs';
|
|
3
|
+
import { NarsilError, ErrorCodes } from './chunk-ZKOQR7EA.mjs';
|
|
4
4
|
|
|
5
5
|
// src/query-suggestions/engine-hooks.ts
|
|
6
6
|
function suggestionIndexesOf(core, sourceName) {
|
|
@@ -39,6 +39,13 @@ var ErrorCodes = {
|
|
|
39
39
|
SYNC_NOT_READY: "SYNC_NOT_READY",
|
|
40
40
|
SYNC_NOT_ENABLED: "SYNC_NOT_ENABLED",
|
|
41
41
|
SYNC_SNAPSHOT_PREPARING: "SYNC_SNAPSHOT_PREPARING",
|
|
42
|
+
CHANGES_DURABILITY_REQUIRED: "CHANGES_DURABILITY_REQUIRED",
|
|
43
|
+
CHANGES_BACKUP_STORE_REQUIRED: "CHANGES_BACKUP_STORE_REQUIRED",
|
|
44
|
+
CHANGES_NOT_READY: "CHANGES_NOT_READY",
|
|
45
|
+
CHANGES_NOT_ENABLED: "CHANGES_NOT_ENABLED",
|
|
46
|
+
CHANGES_PREVIOUS_DOCUMENT_REQUIRED: "CHANGES_PREVIOUS_DOCUMENT_REQUIRED",
|
|
47
|
+
CHANGES_EXPORT_PREPARING: "CHANGES_EXPORT_PREPARING",
|
|
48
|
+
CHANGES_INVALID_POSITIONS: "CHANGES_INVALID_POSITIONS",
|
|
42
49
|
QUERY_SUGGESTIONS_NOT_ENABLED: "QUERY_SUGGESTIONS_NOT_ENABLED",
|
|
43
50
|
SEARCH_INVALID_FIELD: "SEARCH_INVALID_FIELD",
|
|
44
51
|
VECTOR_DIMENSION_MISMATCH: "VECTOR_DIMENSION_MISMATCH",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { openSharedQuantizer, STORE_ORDINAL_LAYOUT_GENERATION, searchOrdinals, withTransientAdmission, insertNode, GRAPH_RETIRED, nodeCountOf, tombstoneCountOf, VECTOR_MEMORY_LIMITS, sharedVectorStoreBytes, STORE_LIVE_COUNT, IN_MEMORY, STORE_RELEASED_VECTORS_TO_DISK, STORE_SLOTS, writeSequenceOf, openGraphState, fixedView, createSharedVectorStoreHandles, sequenceWritesOf, STORE_DOC_ID_BYTES, unplacedChunkCount, blocksGrowthBytes, oldestHeldPin, coverOrdinal, nextSequence, publishSequence, createOrdinalFilter, addToOrdinalFilter, magnitude, stampBorn, mayFree, retiredAtOf, requireBytesWithinLimit, stampRetired, openVectorBlock, NOTHING_STAGED, arenaFloat32Distance, slotByteOffset, detachNativeStore, STORE_BLOCK_COUNT, STORE_CODE_BLOCK_COUNT, createVectorFileReader, grownByteLength, growBufferTo, resetStoreHeader, STORE_CODE_COUNT, STORE_CALIBRATED, STORE_CALIBRATION_GENERATION, QUERY_STAGED, euclideanDistance, dotProduct, cosineSimilarityWithMagnitudes, createVectorBlock, ensureBlockSlots } from './chunk-
|
|
2
|
-
import { createDocIdMap } from './chunk-
|
|
3
|
-
import { NarsilError, ErrorCodes } from './chunk-
|
|
1
|
+
import { openSharedQuantizer, STORE_ORDINAL_LAYOUT_GENERATION, searchOrdinals, withTransientAdmission, insertNode, GRAPH_RETIRED, nodeCountOf, tombstoneCountOf, VECTOR_MEMORY_LIMITS, sharedVectorStoreBytes, STORE_LIVE_COUNT, IN_MEMORY, STORE_RELEASED_VECTORS_TO_DISK, STORE_SLOTS, writeSequenceOf, openGraphState, fixedView, createSharedVectorStoreHandles, sequenceWritesOf, STORE_DOC_ID_BYTES, unplacedChunkCount, blocksGrowthBytes, oldestHeldPin, coverOrdinal, nextSequence, publishSequence, createOrdinalFilter, addToOrdinalFilter, magnitude, stampBorn, mayFree, retiredAtOf, requireBytesWithinLimit, stampRetired, openVectorBlock, NOTHING_STAGED, arenaFloat32Distance, slotByteOffset, detachNativeStore, STORE_BLOCK_COUNT, STORE_CODE_BLOCK_COUNT, createVectorFileReader, grownByteLength, growBufferTo, resetStoreHeader, STORE_CODE_COUNT, STORE_CALIBRATED, STORE_CALIBRATION_GENERATION, QUERY_STAGED, euclideanDistance, dotProduct, cosineSimilarityWithMagnitudes, createVectorBlock, ensureBlockSlots } from './chunk-KBU3ZFJN.mjs';
|
|
2
|
+
import { createDocIdMap } from './chunk-RORNUNXW.mjs';
|
|
3
|
+
import { NarsilError, ErrorCodes } from './chunk-ZKOQR7EA.mjs';
|
|
4
4
|
|
|
5
5
|
// src/vector/vector-store/hot-block-distance.ts
|
|
6
6
|
function jsDistance(a, b, magA, magB, metric) {
|
|
@@ -1250,6 +1250,9 @@ function createVectorStore(options) {
|
|
|
1250
1250
|
},
|
|
1251
1251
|
growthBytesFor(vectors) {
|
|
1252
1252
|
return state.open === null ? 0 : growthBytesFor(state.open, vectors);
|
|
1253
|
+
},
|
|
1254
|
+
visitDocumentTables(visit) {
|
|
1255
|
+
visit("documents", docToOrd.size, true);
|
|
1253
1256
|
}
|
|
1254
1257
|
};
|
|
1255
1258
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { P as PartitionConfig, B as BM25Params, A as AnyDocument, a as InsertOptions, W as WriteOptions } from './schema-CzG9OUw5.js';
|
|
2
|
-
import {
|
|
2
|
+
import { o as SnapshotOptions, V as VectorMaintenanceResult, B as BatchResult, L as ListParams, y as ListResult, F as FollowChangesOptions, d as ChangesEvent, a as ChangePosition, h as ChangesStatus, g as ChangesSetting, I as IndexInfo, x as IndexStats, P as PartitionStatsResult, Q as QueryParams, t as QueryResult, z as PreflightResult, w as SuggestParams, A as SuggestResult, q as SyncStatus, p as SyncSetting } from './engine-qjAxJSKk.js';
|
|
3
3
|
import { a as SynonymRule } from './synonyms-CpOAHPa-.js';
|
|
4
|
-
import { f as TaskRecord, a as ChangeAnalysisBody, M as MemoryStatsResponse, m as CreateBackupBody, R as RestoreBackupBody, c as ImportResult, H as HttpIndexConfig, d as TaskListQuery, T as TaskListPage } from './tasks-
|
|
5
|
-
import { B as BackupListing } from './config-
|
|
4
|
+
import { f as TaskRecord, a as ChangeAnalysisBody, M as MemoryStatsResponse, m as CreateBackupBody, R as RestoreBackupBody, c as ImportResult, H as HttpIndexConfig, d as TaskListQuery, T as TaskListPage } from './tasks-C65V7lIr.js';
|
|
5
|
+
import { B as BackupListing } from './config-BvHQ-C7U.js';
|
|
6
6
|
import { d as QuerySuggestionsSetting, e as QuerySuggestionsStatus, f as RecordQueryResult, c as QuerySuggestionsPreview, M as ManualQuerySuggestion } from './query-suggestions-CBYkrQ5T.js';
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -563,6 +563,89 @@ interface BulkOperations {
|
|
|
563
563
|
startImport(indexName: string, source: ImportSource, options?: RequestOptions): Promise<TaskRecord>;
|
|
564
564
|
}
|
|
565
565
|
|
|
566
|
+
/**
|
|
567
|
+
* Where a subscription to the change feed starts, which changes it receives, and how it proves the caller's access.
|
|
568
|
+
*
|
|
569
|
+
* @public
|
|
570
|
+
*/
|
|
571
|
+
interface ChangeFeedOptions extends FollowChangesOptions {
|
|
572
|
+
/**
|
|
573
|
+
* The client offers this value as a second WebSocket subprotocol, after `narsil.changes.v1`, because a browser
|
|
574
|
+
* sends no header of the caller's choosing with a WebSocket upgrade. The server's `onRequest` hook reads it from
|
|
575
|
+
* the `sec-websocket-protocol` header. It must hold only the characters that an HTTP token allows.
|
|
576
|
+
*/
|
|
577
|
+
credential?: string;
|
|
578
|
+
}
|
|
579
|
+
/**
|
|
580
|
+
* One connection to the change feed of an index, which returns its events one at a time.
|
|
581
|
+
*
|
|
582
|
+
* The server stops sending once the changes that the caller has not acknowledged pass the window in bytes, so call
|
|
583
|
+
* {@link ChangeSubscription.ack} with each position once the caller has saved it.
|
|
584
|
+
*
|
|
585
|
+
* @public
|
|
586
|
+
*/
|
|
587
|
+
interface ChangeSubscription extends AsyncIterable<ChangesEvent> {
|
|
588
|
+
/**
|
|
589
|
+
* Tells the server that the caller has saved these positions, which frees the window for further changes. Pass
|
|
590
|
+
* only positions that the caller has saved, each at or below a `scannedSeqNo` that the feed returned. The
|
|
591
|
+
* subscription remembers the highest position of every partition and sends all of them, because the server
|
|
592
|
+
* expects each acknowledgement to cover every partition.
|
|
593
|
+
*
|
|
594
|
+
* @param positions - The saved positions of any partitions whose position moved.
|
|
595
|
+
* @throws NarsilError with `CHANGES_INVALID_POSITIONS` for a position that is not a whole number at or above
|
|
596
|
+
* zero, or for a partition that the index lacks.
|
|
597
|
+
*/
|
|
598
|
+
ack(positions: ChangePosition[]): void;
|
|
599
|
+
/** Closes the connection and ends the iteration. */
|
|
600
|
+
close(): void;
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
/**
|
|
604
|
+
* These methods read and replace the change capture setting of an index and follow its changes over the server's
|
|
605
|
+
* change feed, as {@link ChangesOperations} does on the engine.
|
|
606
|
+
*
|
|
607
|
+
* @public
|
|
608
|
+
*/
|
|
609
|
+
interface ChangesClientOperations {
|
|
610
|
+
/**
|
|
611
|
+
* Returns the change capture state of an index, as {@link ChangesOperations.getChanges} does on the engine.
|
|
612
|
+
*
|
|
613
|
+
* @param indexName - The server reports the state of this index.
|
|
614
|
+
* @param options - This sets the signal, the deadline, and the headers for this request.
|
|
615
|
+
* @returns The setting and the epoch.
|
|
616
|
+
* @throws A `NarsilError` with `INDEX_NOT_FOUND` when no index has that name.
|
|
617
|
+
*/
|
|
618
|
+
getChanges(indexName: string, options?: RequestOptions): Promise<ChangesStatus>;
|
|
619
|
+
/**
|
|
620
|
+
* Replaces the change capture setting of an index, as {@link ChangesOperations.updateChanges} does on the engine.
|
|
621
|
+
*
|
|
622
|
+
* @param indexName - The server replaces the setting of this index.
|
|
623
|
+
* @param setting - This is the new setting.
|
|
624
|
+
* @param options - This sets the signal, the deadline, and the headers for this request.
|
|
625
|
+
* @throws A `NarsilError` with `CHANGES_DURABILITY_REQUIRED` when the server's engine has no write-ahead log
|
|
626
|
+
* durability, and with `CONFIG_INVALID` when a field has the wrong type or a history limit is not a positive whole
|
|
627
|
+
* number.
|
|
628
|
+
*/
|
|
629
|
+
updateChanges(indexName: string, setting: ChangesSetting, options?: RequestOptions): Promise<void>;
|
|
630
|
+
/**
|
|
631
|
+
* Opens the change feed of an index and returns its events, as {@link ChangesOperations.followChanges} does on the
|
|
632
|
+
* engine. The server serves the feed only where its `changes` option is on.
|
|
633
|
+
*
|
|
634
|
+
* The first event gives the epoch and the positions. Each later event holds the changes of one partition in
|
|
635
|
+
* `seqNo` order, and the last event is a resync where the positions no longer lead to the index's changes. Save each
|
|
636
|
+
* `scannedSeqNo` once you apply its changes, then acknowledge it with {@link ChangeSubscription.ack}.
|
|
637
|
+
*
|
|
638
|
+
* @param indexName - The server sends the changes of this index.
|
|
639
|
+
* @param options - The epoch and positions to start from, a filter, a signal, and a credential.
|
|
640
|
+
* @returns The subscription, which opens its connection at once.
|
|
641
|
+
* @throws A `NarsilError` from the iteration with `CHANGES_NOT_ENABLED` when capture turns off, with the code in the
|
|
642
|
+
* close reason when the index's setting refuses the subscription, with `CONFIG_INVALID` when the server refuses the
|
|
643
|
+
* epoch, the positions, or the filter, and with `CLIENT_CONNECTION_FAILED` when the connection fails or the server
|
|
644
|
+
* refuses it, in which case subscribe again from the saved positions.
|
|
645
|
+
*/
|
|
646
|
+
followChanges(indexName: string, options?: ChangeFeedOptions): ChangeSubscription;
|
|
647
|
+
}
|
|
648
|
+
|
|
566
649
|
/**
|
|
567
650
|
* This says what an upsert did, which is how {@link DocumentOperations.put}
|
|
568
651
|
* reports whether the id already held a document.
|
|
@@ -1237,7 +1320,7 @@ interface TaskOperations {
|
|
|
1237
1320
|
*
|
|
1238
1321
|
* @public
|
|
1239
1322
|
*/
|
|
1240
|
-
interface NarsilClient extends IndexOperations, DocumentOperations, BulkOperations, SearchOperations, TaskOperations, AdminOperations, BackupOperations, ServerOperations, SyncSettingOperations, QuerySuggestionOperations {
|
|
1323
|
+
interface NarsilClient extends IndexOperations, DocumentOperations, BulkOperations, SearchOperations, TaskOperations, AdminOperations, BackupOperations, ServerOperations, SyncSettingOperations, ChangesClientOperations, QuerySuggestionOperations {
|
|
1241
1324
|
}
|
|
1242
1325
|
/**
|
|
1243
1326
|
* Builds a client for one Narsil server, or for a list of them that it moves
|
|
@@ -1258,4 +1341,4 @@ interface NarsilClient extends IndexOperations, DocumentOperations, BulkOperatio
|
|
|
1258
1341
|
*/
|
|
1259
1342
|
declare function createNarsilClient(options: NarsilClientOptions): NarsilClient;
|
|
1260
1343
|
|
|
1261
|
-
export { type AdminOperations as A, type BackupOperations as B, type DocumentOperations as D, type FetchFunction as F, type ImportSource as I, type NarsilClient as N, type PutResult as P, type QuerySuggestionOperations as Q, type RequestOptions as R, type SearchOperations as S, type TaskOperations as T, type WaitForTaskOptions as W, type BulkOperations as a, type
|
|
1344
|
+
export { type AdminOperations as A, type BackupOperations as B, type ChangeFeedOptions as C, type DocumentOperations as D, type FetchFunction as F, type ImportSource as I, type NarsilClient as N, type PutResult as P, type QuerySuggestionOperations as Q, type RequestOptions as R, type SearchOperations as S, type TaskOperations as T, type WaitForTaskOptions as W, type BulkOperations as a, type ChangeSubscription as b, type ChangesClientOperations as c, type IndexOperations as d, type NarsilClientOptions as e, type ServerOperations as f, type ServerVersion as g, type SyncSettingOperations as h, type SyncSnapshotDownload as i, type SyncSnapshotResume as j, createNarsilClient as k };
|
package/dist/client.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export { B as BackupListing, a as BackupSummary, D as DamagedBackup } from './config-
|
|
2
|
-
export { C as
|
|
3
|
-
export { A as ASYNC_IMPORT_CAPABILITY, B as BM25_TUNING_CAPABILITY, C as CHANGE_ANALYSIS_CAPABILITY, D as DOCUMENT_EXPORT_CAPABILITY, E as ErrorEnvelope, I as INDEX_LIFECYCLE_CAPABILITY, R as REBUILD_ANALYSIS_CAPABILITY, S as SERVER_CAPABILITIES, a as SYNONYMS_CAPABILITY, T as TASK_CANCEL_CAPABILITY, b as TASK_FILTER_CAPABILITY } from './capabilities-
|
|
4
|
-
export { B as BackupListResponse, C as CapabilitiesResponse, a as ChangeAnalysisBody, b as CreateIndexEmbedding, E as ErrorDetail, H as HttpIndexConfig, I as ImportError, c as ImportResult, M as MemoryStatsResponse, R as RestoreBackupBody, T as TaskListPage, d as TaskListQuery, e as TaskProgress, f as TaskRecord, g as TaskStatus, h as TaskStepProgress, i as TaskType } from './tasks-
|
|
1
|
+
export { B as BackupListing, a as BackupSummary, D as DamagedBackup } from './config-BvHQ-C7U.js';
|
|
2
|
+
export { C as Change, a as ChangePosition, b as ChangeType, c as ChangesBatch, d as ChangesEvent, e as ChangesOperations, f as ChangesResync, g as ChangesSetting, h as ChangesStatus, i as ChangesSubscribed, j as ClientErrorCode, k as ClientErrorCodes, E as ErrorCode, l as ErrorCodes, F as FollowChangesOptions, N as NarsilError, m as NarsilErrorCode, S as ServerErrorCode, n as ServerErrorCodes, o as SnapshotOptions, p as SyncSetting, q as SyncStatus, r as isNarsilError } from './engine-qjAxJSKk.js';
|
|
3
|
+
export { A as ASYNC_IMPORT_CAPABILITY, B as BM25_TUNING_CAPABILITY, C as CHANGE_ANALYSIS_CAPABILITY, D as DOCUMENT_EXPORT_CAPABILITY, E as ErrorEnvelope, I as INDEX_LIFECYCLE_CAPABILITY, R as REBUILD_ANALYSIS_CAPABILITY, S as SERVER_CAPABILITIES, a as SYNONYMS_CAPABILITY, T as TASK_CANCEL_CAPABILITY, b as TASK_FILTER_CAPABILITY } from './capabilities-CLnQHIqV.js';
|
|
4
|
+
export { B as BackupListResponse, C as CapabilitiesResponse, a as ChangeAnalysisBody, b as CreateIndexEmbedding, E as ErrorDetail, H as HttpIndexConfig, I as ImportError, c as ImportResult, M as MemoryStatsResponse, R as RestoreBackupBody, T as TaskListPage, d as TaskListQuery, e as TaskProgress, f as TaskRecord, g as TaskStatus, h as TaskStepProgress, i as TaskType } from './tasks-C65V7lIr.js';
|
|
5
5
|
export { M as ManualQuerySuggestion, Q as QuerySuggestionPreviewEntry, a as QuerySuggestionsBuild, b as QuerySuggestionsBuildTrigger, c as QuerySuggestionsPreview, d as QuerySuggestionsSetting, e as QuerySuggestionsStatus, R as RecordQueryOutcome, f as RecordQueryResult } from './query-suggestions-CBYkrQ5T.js';
|
|
6
|
-
export { A as AdminOperations, B as BackupOperations, a as BulkOperations, D as DocumentOperations, F as FetchFunction, I as ImportSource,
|
|
7
|
-
import './config-
|
|
6
|
+
export { A as AdminOperations, B as BackupOperations, a as BulkOperations, C as ChangeFeedOptions, b as ChangeSubscription, c as ChangesClientOperations, D as DocumentOperations, F as FetchFunction, I as ImportSource, d as IndexOperations, N as NarsilClient, e as NarsilClientOptions, P as PutResult, Q as QuerySuggestionOperations, R as RequestOptions, S as SearchOperations, f as ServerOperations, g as ServerVersion, h as SyncSettingOperations, i as SyncSnapshotDownload, j as SyncSnapshotResume, T as TaskOperations, W as WaitForTaskOptions, k as createNarsilClient } from './client-uB0kp2yT.js';
|
|
7
|
+
import './config-PqgNY1H7.js';
|
|
8
8
|
import './adapters-pljAqmrC.js';
|
|
9
9
|
import './schema-CzG9OUw5.js';
|
|
10
10
|
import './synonyms-CpOAHPa-.js';
|
|
11
|
-
import './index-
|
|
11
|
+
import './index-BaQIAnk0.js';
|
|
12
12
|
import './types-DvncmvuQ.js';
|