@delali/narsil 0.3.1-next.109 → 0.3.1-next.111
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapters/filesystem.mjs +1 -1
- package/dist/adapters/indexeddb.mjs +1 -1
- package/dist/browser/{chunk-RYWURYTW.mjs → chunk-2CBQ2PCC.mjs} +1 -1
- package/dist/browser/{chunk-3RXEGUGO.mjs → chunk-5BQPBG3G.mjs} +41 -4
- package/dist/browser/{chunk-XHRHOH2P.mjs → chunk-6YUUEMQ4.mjs} +139 -28
- package/dist/browser/{chunk-SCBBEQWD.mjs → chunk-HQOYKRMB.mjs} +13 -13
- package/dist/browser/{chunk-EQ7BQ6VZ.mjs → chunk-LJS6PREA.mjs} +1 -0
- package/dist/browser/{chunk-Z2K5AGZL.mjs → chunk-OVY4RPDS.mjs} +3 -3
- package/dist/browser/{chunk-S7KNCVPU.mjs → chunk-P7C2S5JX.mjs} +2 -2
- package/dist/browser/{durability-wiring-JJGE7MED.mjs → durability-wiring-CYAJBYCO.mjs} +48 -20
- package/dist/browser/{module-PCKQADMQ.mjs → module-DYKR4INA.mjs} +5 -5
- package/dist/browser/{restore-queue-2STSWU2E.mjs → restore-queue-RTZGJT4D.mjs} +1 -1
- package/dist/browser/{runtime-ARKW5NZX.mjs → runtime-FL5K4JOH.mjs} +1 -1
- package/dist/browser/{snapshot-3AZDQKNA.mjs → snapshot-BU6I25CW.mjs} +27 -14
- package/dist/browser/{write-XXLMPT3Y.mjs → write-RUPYHPBZ.mjs} +5 -5
- package/dist/{capabilities-D4MUmjfe.d.ts → capabilities-ByaX8Arf.d.ts} +2 -2
- package/dist/{chunk-FN75BCXC.mjs → chunk-2RAQKITH.mjs} +1 -1
- package/dist/{chunk-SAZB7ZHT.mjs → chunk-542TD4BL.mjs} +1 -1
- package/dist/{chunk-YP23IAV5.mjs → chunk-63HFWQEA.mjs} +4 -3
- package/dist/{chunk-FV5CP3E2.mjs → chunk-6ODIY6ZB.mjs} +1 -1
- package/dist/{chunk-RQ7LOBLD.mjs → chunk-6PN3U6XW.mjs} +1 -1
- package/dist/{chunk-CYXLPFBG.mjs → chunk-6S7YRUPQ.mjs} +123 -35
- package/dist/{chunk-C57FPCTL.mjs → chunk-7JOONQ24.mjs} +6 -6
- package/dist/{chunk-IBJWO5PF.mjs → chunk-7ZZQNOIY.mjs} +1 -1
- package/dist/{chunk-SYHS56F7.mjs → chunk-CUVTRLA4.mjs} +26 -13
- package/dist/{chunk-AWZVJCCW.mjs → chunk-DG62H7OD.mjs} +2 -2
- package/dist/{chunk-LWQTFKRS.mjs → chunk-FUUP45IS.mjs} +1 -1
- package/dist/{chunk-C55OFKU6.mjs → chunk-HNAP2KTG.mjs} +2 -2
- package/dist/{chunk-5LP7OU6B.mjs → chunk-IR4KQ4WB.mjs} +2 -2
- package/dist/{chunk-ICZW4J3I.mjs → chunk-IW6UR3AF.mjs} +21 -21
- package/dist/{chunk-FABI2JA7.mjs → chunk-J6YVB2XM.mjs} +1 -1
- package/dist/{chunk-H5465KUZ.mjs → chunk-JBPYFYIU.mjs} +4 -3
- package/dist/{chunk-62GK7UUS.mjs → chunk-KCQG2PJT.mjs} +3 -3
- package/dist/{chunk-U6FT7LKG.mjs → chunk-LOBYK2FG.mjs} +3 -3
- package/dist/{chunk-XY6Z7T5W.mjs → chunk-N57XXGPG.mjs} +2 -2
- package/dist/{chunk-S2CKO6PP.mjs → chunk-OBWUWZRA.mjs} +1 -0
- package/dist/{chunk-CKRP7GCS.mjs → chunk-OCB7TMUQ.mjs} +1 -1
- package/dist/{chunk-NYWUBTMH.mjs → chunk-OFYKBKKV.mjs} +1 -1
- package/dist/{chunk-VIXXQEX6.mjs → chunk-PKE2PCTS.mjs} +43 -6
- package/dist/{chunk-ZBZRBM2Z.mjs → chunk-PT7VRWS7.mjs} +3 -3
- package/dist/{chunk-DUWYU4D5.mjs → chunk-PWIWSUCX.mjs} +2 -2
- package/dist/{chunk-5W7ADHK7.mjs → chunk-QI6JW4PM.mjs} +1 -1
- package/dist/{chunk-SD2EYVU4.mjs → chunk-QIFOXLWF.mjs} +2 -2
- package/dist/{chunk-N75MAOM7.mjs → chunk-R2MRGYU5.mjs} +2 -2
- package/dist/{chunk-4GD43FSW.mjs → chunk-R2MRMH6M.mjs} +10 -10
- package/dist/{chunk-RSSLOFRP.mjs → chunk-SXVDBHYJ.mjs} +39 -8
- package/dist/{chunk-HL2GAS5N.mjs → chunk-UGKO3RG2.mjs} +7 -7
- package/dist/{chunk-5DPTHLMX.mjs → chunk-V7G627TA.mjs} +1 -1
- package/dist/{chunk-MVWWAHTR.mjs → chunk-VK45J47R.mjs} +1 -1
- package/dist/{chunk-RPIE4QCL.mjs → chunk-YH5OIL7B.mjs} +2 -0
- package/dist/{chunk-JKOBHB4A.mjs → chunk-YIDSHBQS.mjs} +2 -2
- package/dist/{chunk-PA5WZWLC.mjs → chunk-YLE75NQ5.mjs} +2 -2
- package/dist/{chunk-A2HWRBQE.mjs → chunk-YSR5L3XJ.mjs} +2 -2
- package/dist/{client-Ba9yP-Rr.d.ts → client-BdnzDFtO.d.ts} +2 -2
- package/dist/client.d.ts +6 -6
- package/dist/client.mjs +1 -0
- package/dist/{config-C-xXz8bC.d.ts → config-CSgvApt0.d.ts} +1 -1
- package/dist/{config-Dc_8-byz.d.ts → config-ujZESkJz.d.ts} +1 -1
- package/dist/{direct-executor-QH2M6AK2.mjs → direct-executor-QFAUKTCQ.mjs} +11 -11
- package/dist/distribution/coordinator/etcd.mjs +94 -5
- package/dist/distribution/transport/grpc.mjs +24 -8
- package/dist/distribution/transport/in-memory.mjs +4 -4
- package/dist/distribution/transport/tcp.mjs +6 -6
- package/dist/distribution.d.ts +5 -5
- package/dist/distribution.mjs +1232 -377
- package/dist/{durability-wiring-4HWX7OVP.mjs → durability-wiring-NUHTYXHA.mjs} +65 -38
- package/dist/embeddings/openai.mjs +2 -2
- package/dist/{engine-CMZ5XSLy.d.ts → engine-C_HSy3iz.d.ts} +1 -1
- package/dist/{events-dnvgprIl.d.ts → events-CJsXF1F9.d.ts} +1 -0
- package/dist/index.browser.mjs +3 -3
- package/dist/index.d.ts +5 -5
- package/dist/index.mjs +16 -16
- package/dist/{module-IYILOTU3.mjs → module-WP4VVGV2.mjs} +9 -9
- package/dist/partial-words.mjs +5 -5
- package/dist/pattern.mjs +3 -3
- package/dist/persistence/durability/checkpoint-worker.d.ts +12 -0
- package/dist/persistence/durability/checkpoint-worker.mjs +25 -23
- package/dist/react.d.ts +6 -6
- package/dist/react.mjs +1 -0
- package/dist/{rerank-EHJVXEDP.mjs → rerank-3POMPQNX.mjs} +4 -4
- package/dist/rerankers/http.mjs +2 -2
- package/dist/{restore-queue-BONSQWCI.mjs → restore-queue-QSLGXZJB.mjs} +1 -1
- package/dist/{runtime-LEX2F7OW.mjs → runtime-C2435MPK.mjs} +5 -5
- package/dist/server.d.ts +8 -8
- package/dist/server.mjs +12 -12
- package/dist/{snapshot-DWDLN5YW.mjs → snapshot-IV3S2TMI.mjs} +25 -25
- package/dist/synonyms.mjs +3 -3
- package/dist/{tasks-B4B2cMK5.d.ts → tasks-CI3Fvkxw.d.ts} +1 -1
- package/dist/{thread-I32PUURR.mjs → thread-THLCKMEB.mjs} +11 -11
- package/dist/vector/search-worker.mjs +4 -4
- package/dist/workers/entry.mjs +5 -5
- package/dist/{write-AOFSHACR.mjs → write-VGRTOS7N.mjs} +18 -18
- package/package.json +7 -7
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { removeDocumentVectors, prepareDocumentVectors, insertDocumentVectors, getNestedValue, requireValidFieldTypes, VECTOR_PATTERN } from './chunk-
|
|
2
|
-
import { NarsilError, ErrorCodes } from './chunk-
|
|
1
|
+
import { removeDocumentVectors, prepareDocumentVectors, insertDocumentVectors, getNestedValue, requireValidFieldTypes, VECTOR_PATTERN } from './chunk-HQOYKRMB.mjs';
|
|
2
|
+
import { NarsilError, ErrorCodes } from './chunk-LJS6PREA.mjs';
|
|
3
3
|
import { decode } from '@msgpack/msgpack';
|
|
4
4
|
|
|
5
5
|
function applyIndexEntry(entry, manager, vectorFieldPaths, vecIndexes) {
|
|
@@ -465,6 +465,42 @@ function decodePartialWords(raw, tokenCount, context) {
|
|
|
465
465
|
return { fields, spellings, spellingOffsets, spellingTokens, spellingCounts, runs, runOffsets, runEntries };
|
|
466
466
|
}
|
|
467
467
|
|
|
468
|
+
// src/serialization/keyword-segment/write-records.ts
|
|
469
|
+
var UINT64_BYTES = 8;
|
|
470
|
+
function uint64Bytes(values) {
|
|
471
|
+
const bytes = new Uint8Array(values.length * UINT64_BYTES);
|
|
472
|
+
const view = new DataView(bytes.buffer);
|
|
473
|
+
for (let at = 0; at < values.length; at++) view.setBigUint64(at * UINT64_BYTES, BigInt(values[at]), true);
|
|
474
|
+
return bytes;
|
|
475
|
+
}
|
|
476
|
+
function uint64sOf(bytes, name) {
|
|
477
|
+
const values = new Float64Array(bytes.byteLength / UINT64_BYTES);
|
|
478
|
+
const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
479
|
+
for (let at = 0; at < values.length; at++) {
|
|
480
|
+
const value = view.getBigUint64(at * UINT64_BYTES, true);
|
|
481
|
+
if (value > BigInt(Number.MAX_SAFE_INTEGER)) corrupt(`${name} holds a value above 2^53 - 1`, { at });
|
|
482
|
+
values[at] = Number(value);
|
|
483
|
+
}
|
|
484
|
+
return values;
|
|
485
|
+
}
|
|
486
|
+
function decodeWriteRecords(raw, documentCount) {
|
|
487
|
+
const rawSeqNos = requireBytesOrNil(raw.seqNos, "seqNos", UINT64_BYTES);
|
|
488
|
+
const rawTerms = requireBytesOrNil(raw.primaryTerms, "primaryTerms", UINT64_BYTES);
|
|
489
|
+
if (rawSeqNos === null !== (rawTerms === null))
|
|
490
|
+
corrupt("seqNos and primaryTerms must both be present or both absent");
|
|
491
|
+
if (rawSeqNos === null || rawTerms === null) return null;
|
|
492
|
+
const seqNos = uint64sOf(rawSeqNos, "seqNos");
|
|
493
|
+
const primaryTerms = uint64sOf(rawTerms, "primaryTerms");
|
|
494
|
+
requireCount(seqNos.length, documentCount, "seqNos");
|
|
495
|
+
requireCount(primaryTerms.length, documentCount, "primaryTerms");
|
|
496
|
+
for (let at = 0; at < documentCount; at++) {
|
|
497
|
+
if (seqNos[at] === 0 && primaryTerms[at] !== 0) {
|
|
498
|
+
corrupt(`primaryTerms gives document ${at} a term without a seqNo`, { at });
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
return { seqNos, primaryTerms };
|
|
502
|
+
}
|
|
503
|
+
|
|
468
504
|
// src/serialization/keyword-segment/decode.ts
|
|
469
505
|
function decodeSchema(raw) {
|
|
470
506
|
const schema = requireRecord(raw, "schema");
|
|
@@ -596,7 +632,8 @@ function decodeKeywordSegment(payload, shared) {
|
|
|
596
632
|
surfaceTable: decodeSurfaceForms(raw.surfaceForms, context),
|
|
597
633
|
partialWords: decodePartialWords(raw.partialWords, postings.tokenTable.offsets.length - 1, context)
|
|
598
634
|
};
|
|
599
|
-
|
|
635
|
+
const writeRecords = decodeWriteRecords(raw, documentCount);
|
|
636
|
+
return writeRecords === null ? { schema, tombstones, arrays } : { schema, tombstones, arrays, writeRecords };
|
|
600
637
|
}
|
|
601
638
|
|
|
602
|
-
export { KEYWORD_SEGMENT_ENVELOPE_VERSION, KEYWORD_SEGMENT_PAYLOAD_VERSION, applyDeleteEntry, applyIndexEntry, decodeKeywordSegment, littleEndianBytes, restoreVectorFields, setNestedValue };
|
|
639
|
+
export { KEYWORD_SEGMENT_ENVELOPE_VERSION, KEYWORD_SEGMENT_PAYLOAD_VERSION, applyDeleteEntry, applyIndexEntry, decodeKeywordSegment, littleEndianBytes, restoreVectorFields, setNestedValue, uint64Bytes };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { KEYWORD_SEGMENT_ENVELOPE_VERSION, decodeKeywordSegment, restoreVectorFields, KEYWORD_SEGMENT_PAYLOAD_VERSION, littleEndianBytes } from './chunk-
|
|
2
|
-
import { VERSION, rulesOfStoredSynonyms, flattenSchema, packChecksummedEnvelope, openChecksummedEnvelope, requireValidFieldTypes, isCompositePartition, crc32, reconstructSchemaFromMetadata, extractVectorFieldsFromSchema, readHeader, HEADER_SIZE, engineVersionParts, writeHeader, partialFieldsOf, getLanguage, decodeEveryStoredDocument, createSharedFrozenSegment, shareSegmentArrays, VECTOR_PATTERN, isQuantizationMode, isStorageMode, survivorDocumentsOf, partitionStateOf, freezeSegmentShared, createFrozenSegment, createPartitionManager, createPartitionRouter, buildSegmentPayload, resolvePartitionInsertOptions, fnv1a, selectionKeeps, decodeMapWithoutFields, prepareDocumentVectors, messagePackUpperBoundBytes, segmentArraysOf, mergeSegmentContents, resolveIndexAnalysis } from './chunk-
|
|
3
|
-
import { decodeVectorGraphPartPayload, assembleGraphParts, decodeVectorFilePayload, countDead, VECTOR_FILE_MAX_VECTORS, deadBytesFor } from './chunk-
|
|
4
|
-
import { compareCodePoints, MAX_FILE_BYTES, VALID_HNSW_METRICS } from './chunk-
|
|
5
|
-
import { NarsilError, ErrorCodes } from './chunk-
|
|
1
|
+
import { KEYWORD_SEGMENT_ENVELOPE_VERSION, decodeKeywordSegment, restoreVectorFields, KEYWORD_SEGMENT_PAYLOAD_VERSION, littleEndianBytes, uint64Bytes } from './chunk-5BQPBG3G.mjs';
|
|
2
|
+
import { VERSION, rulesOfStoredSynonyms, flattenSchema, packChecksummedEnvelope, openChecksummedEnvelope, requireValidFieldTypes, isCompositePartition, crc32, reconstructSchemaFromMetadata, extractVectorFieldsFromSchema, readHeader, HEADER_SIZE, engineVersionParts, writeHeader, partialFieldsOf, getLanguage, decodeEveryStoredDocument, createSharedFrozenSegment, shareSegmentArrays, VECTOR_PATTERN, isQuantizationMode, isStorageMode, survivorDocumentsOf, partitionStateOf, freezeSegmentShared, createFrozenSegment, createPartitionManager, createPartitionRouter, buildSegmentPayload, resolvePartitionInsertOptions, fnv1a, selectionKeeps, decodeMapWithoutFields, prepareDocumentVectors, messagePackUpperBoundBytes, segmentArraysOf, mergeSegmentContents, resolveIndexAnalysis } from './chunk-HQOYKRMB.mjs';
|
|
3
|
+
import { decodeVectorGraphPartPayload, assembleGraphParts, decodeVectorFilePayload, countDead, VECTOR_FILE_MAX_VECTORS, deadBytesFor } from './chunk-P7C2S5JX.mjs';
|
|
4
|
+
import { compareCodePoints, MAX_FILE_BYTES, VALID_HNSW_METRICS } from './chunk-2CBQ2PCC.mjs';
|
|
5
|
+
import { NarsilError, ErrorCodes } from './chunk-LJS6PREA.mjs';
|
|
6
6
|
import { decode, encode } from '@msgpack/msgpack';
|
|
7
7
|
|
|
8
8
|
// src/engine/durability-metadata.ts
|
|
@@ -733,7 +733,10 @@ function encodeSegmentManifest(manifest) {
|
|
|
733
733
|
checkpoint: manifest.checkpoint.map((c) => ({
|
|
734
734
|
partitionId: c.partitionId,
|
|
735
735
|
lastSeqNo: c.lastSeqNo,
|
|
736
|
-
primaryTerm: c.primaryTerm
|
|
736
|
+
primaryTerm: c.primaryTerm,
|
|
737
|
+
...c.termHistory === void 0 ? {} : {
|
|
738
|
+
termHistory: c.termHistory.map((start) => ({ primaryTerm: start.primaryTerm, firstSeqNo: start.firstSeqNo }))
|
|
739
|
+
}
|
|
737
740
|
})),
|
|
738
741
|
partitions: manifest.partitions.map((p) => ({
|
|
739
742
|
partitionId: p.partitionId,
|
|
@@ -922,7 +925,33 @@ function normalizeCheckpoint(raw) {
|
|
|
922
925
|
invalidManifest("has an invalid partition checkpoint", { entry });
|
|
923
926
|
}
|
|
924
927
|
seen.add(entry.partitionId);
|
|
925
|
-
|
|
928
|
+
const checkpoint = {
|
|
929
|
+
partitionId: entry.partitionId,
|
|
930
|
+
lastSeqNo: entry.lastSeqNo,
|
|
931
|
+
primaryTerm: entry.primaryTerm
|
|
932
|
+
};
|
|
933
|
+
if (entry.termHistory !== void 0) {
|
|
934
|
+
checkpoint.termHistory = normalizeTermHistory(entry.termHistory, entry.partitionId, entry.lastSeqNo);
|
|
935
|
+
}
|
|
936
|
+
return checkpoint;
|
|
937
|
+
});
|
|
938
|
+
}
|
|
939
|
+
function normalizeTermHistory(raw, partitionId, lastSeqNo) {
|
|
940
|
+
if (!Array.isArray(raw)) invalidManifest("has a term history that is not a list", { partitionId });
|
|
941
|
+
let previous = null;
|
|
942
|
+
return raw.map((start) => {
|
|
943
|
+
if (!isRecord(start) || !isSequenceNumber(start.primaryTerm) || !isSequenceNumber(start.firstSeqNo)) {
|
|
944
|
+
invalidManifest("has an invalid term history entry", { partitionId });
|
|
945
|
+
}
|
|
946
|
+
const read = { primaryTerm: start.primaryTerm, firstSeqNo: start.firstSeqNo };
|
|
947
|
+
if (read.firstSeqNo > lastSeqNo) {
|
|
948
|
+
invalidManifest(`has a term starting at seqNo ${read.firstSeqNo}, above lastSeqNo ${lastSeqNo}`, { partitionId });
|
|
949
|
+
}
|
|
950
|
+
if (previous !== null && (read.primaryTerm <= previous.primaryTerm || read.firstSeqNo <= previous.firstSeqNo)) {
|
|
951
|
+
invalidManifest("has a term history that fails to ascend strictly", { partitionId });
|
|
952
|
+
}
|
|
953
|
+
previous = read;
|
|
954
|
+
return read;
|
|
926
955
|
});
|
|
927
956
|
}
|
|
928
957
|
function normalizePartitions(raw, indexName) {
|
|
@@ -997,30 +1026,40 @@ function frozenSegmentsOf(partition, shared) {
|
|
|
997
1026
|
if (tail !== null) segments.push(tail);
|
|
998
1027
|
return segments;
|
|
999
1028
|
}
|
|
1000
|
-
function partitionContentsOf(manager, partitionId) {
|
|
1029
|
+
function partitionContentsOf(manager, partitionId, captureRecords) {
|
|
1001
1030
|
const partition = manager.getPartition(partitionId);
|
|
1002
|
-
const
|
|
1003
|
-
|
|
1031
|
+
const segments = frozenSegmentsOf(partition, false);
|
|
1032
|
+
const selections = segments.map((segment) => selectionOfMask(segment, keepMaskOf(segment)));
|
|
1033
|
+
const contents = { partitionId, docCount: partition.count(), selections };
|
|
1034
|
+
if (captureRecords !== void 0) contents.writeRecords = captureRecords(segments);
|
|
1035
|
+
return contents;
|
|
1004
1036
|
}
|
|
1005
|
-
function captureWholePartition(manager, partitionId) {
|
|
1037
|
+
function captureWholePartition(manager, partitionId, captureRecords) {
|
|
1006
1038
|
if (typeof SharedArrayBuffer !== "function") return null;
|
|
1007
1039
|
const partition = manager.getPartition(partitionId);
|
|
1008
1040
|
if (!isCompositePartition(partition) || partition.frozenSegmentCount() === 0) return null;
|
|
1041
|
+
const frozen = frozenSegmentsOf(partition, true);
|
|
1042
|
+
const records = captureRecords?.(frozen);
|
|
1009
1043
|
const segments = [];
|
|
1010
|
-
for (const segment of
|
|
1044
|
+
for (const segment of frozen) {
|
|
1011
1045
|
if (segment.sharedSnapshot === null) return null;
|
|
1012
|
-
|
|
1046
|
+
const captured = { snapshot: segment.sharedSnapshot, keep: keepMaskOf(segment) };
|
|
1047
|
+
const held = records?.get(segment);
|
|
1048
|
+
if (held !== void 0) captured.writeRecords = held;
|
|
1049
|
+
segments.push(captured);
|
|
1013
1050
|
}
|
|
1014
1051
|
return { partitionId, docCount: partition.count(), segments };
|
|
1015
1052
|
}
|
|
1016
1053
|
function contentsOfCaptured(captured) {
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
};
|
|
1054
|
+
const writeRecords = /* @__PURE__ */ new Map();
|
|
1055
|
+
const selections = captured.segments.map(({ snapshot, keep, writeRecords: held }) => {
|
|
1056
|
+
const segment = createSharedFrozenSegment(snapshot);
|
|
1057
|
+
if (held !== void 0) writeRecords.set(segment, held);
|
|
1058
|
+
return selectionOfMask(segment, keep);
|
|
1059
|
+
});
|
|
1060
|
+
const contents = { partitionId: captured.partitionId, docCount: captured.docCount, selections };
|
|
1061
|
+
if (writeRecords.size > 0) contents.writeRecords = writeRecords;
|
|
1062
|
+
return contents;
|
|
1024
1063
|
}
|
|
1025
1064
|
|
|
1026
1065
|
// src/persistence/durability/segment/store.ts
|
|
@@ -1383,6 +1422,15 @@ function optionalIndexUuid(value, payloadName) {
|
|
|
1383
1422
|
}
|
|
1384
1423
|
return value;
|
|
1385
1424
|
}
|
|
1425
|
+
function optionalPreviousPrimaryTerm(value, payloadName) {
|
|
1426
|
+
if (value === void 0 || value === null) {
|
|
1427
|
+
return void 0;
|
|
1428
|
+
}
|
|
1429
|
+
if (typeof value !== "number" || !Number.isInteger(value) || value < 0) {
|
|
1430
|
+
throw new Error(`Invalid ${payloadName}: "previousPrimaryTerm" must be a non-negative integer or absent`);
|
|
1431
|
+
}
|
|
1432
|
+
return value;
|
|
1433
|
+
}
|
|
1386
1434
|
function validateEntryPayload(decoded) {
|
|
1387
1435
|
if (!isRecord2(decoded) || !isRecord2(decoded.entry)) {
|
|
1388
1436
|
throw new Error('Invalid EntryPayload: missing or invalid "entry" field');
|
|
@@ -1413,6 +1461,7 @@ function validateEntryPayload(decoded) {
|
|
|
1413
1461
|
throw new Error('Invalid EntryPayload: "entry.checksum" must be a number');
|
|
1414
1462
|
}
|
|
1415
1463
|
optionalIndexUuid(decoded.indexUuid, "EntryPayload");
|
|
1464
|
+
optionalPreviousPrimaryTerm(decoded.previousPrimaryTerm, "EntryPayload");
|
|
1416
1465
|
return decoded;
|
|
1417
1466
|
}
|
|
1418
1467
|
function computeEntryChecksum(entry) {
|
|
@@ -1699,6 +1748,17 @@ async function* walEntriesInRange(directory, indexName, partitionId, fromSeqNoEx
|
|
|
1699
1748
|
throw durableRecordMissing(indexName, partitionId, highestRead, wal.marker);
|
|
1700
1749
|
}
|
|
1701
1750
|
}
|
|
1751
|
+
function writeRecordsOf(documents, written) {
|
|
1752
|
+
const seqNos = new Float64Array(documents.length);
|
|
1753
|
+
const primaryTerms = new Float64Array(documents.length);
|
|
1754
|
+
for (let at = 0; at < documents.length; at++) {
|
|
1755
|
+
const entry = written.get(documents[at].docId);
|
|
1756
|
+
if (entry === void 0) continue;
|
|
1757
|
+
seqNos[at] = entry.seqNo;
|
|
1758
|
+
primaryTerms[at] = entry.primaryTerm;
|
|
1759
|
+
}
|
|
1760
|
+
return { seqNos, primaryTerms };
|
|
1761
|
+
}
|
|
1702
1762
|
function everyVectorFieldIsTopLevel(vectorFieldPaths) {
|
|
1703
1763
|
for (const fieldPath of vectorFieldPaths) {
|
|
1704
1764
|
if (fieldPath.includes(".")) return false;
|
|
@@ -1716,15 +1776,18 @@ async function buildSegmentFromEntries(input) {
|
|
|
1716
1776
|
const leavesVectorsUndecoded = everyVectorFieldIsTopLevel(input.vectorFieldPaths);
|
|
1717
1777
|
const live = /* @__PURE__ */ new Map();
|
|
1718
1778
|
const deleted = /* @__PURE__ */ new Set();
|
|
1779
|
+
const written = /* @__PURE__ */ new Map();
|
|
1719
1780
|
for await (const entry of input.entries) {
|
|
1720
1781
|
if (entry.operation === "DELETE") {
|
|
1721
1782
|
deleted.add(entry.documentId);
|
|
1722
1783
|
live.delete(entry.documentId);
|
|
1784
|
+
written.delete(entry.documentId);
|
|
1723
1785
|
continue;
|
|
1724
1786
|
}
|
|
1725
1787
|
if (entry.document === null) continue;
|
|
1726
1788
|
live.delete(entry.documentId);
|
|
1727
1789
|
live.set(entry.documentId, documentWithoutVectors(entry.document, input.vectorFieldPaths, leavesVectorsUndecoded));
|
|
1790
|
+
if (input.keepsWriteRecords) written.set(entry.documentId, entry);
|
|
1728
1791
|
}
|
|
1729
1792
|
const tombstones = [];
|
|
1730
1793
|
for (const docId of deleted) {
|
|
@@ -1747,7 +1810,9 @@ async function buildSegmentFromEntries(input) {
|
|
|
1747
1810
|
payload,
|
|
1748
1811
|
documents.map((entry) => entry.document)
|
|
1749
1812
|
);
|
|
1750
|
-
|
|
1813
|
+
const built = { selections: [{ segment }], tombstones, docCount: live.size };
|
|
1814
|
+
if (input.keepsWriteRecords) built.writeRecords = /* @__PURE__ */ new Map([[segment, writeRecordsOf(documents, written)]]);
|
|
1815
|
+
return built;
|
|
1751
1816
|
}
|
|
1752
1817
|
var FIXMAP = 128;
|
|
1753
1818
|
var MAP16 = 222;
|
|
@@ -1950,7 +2015,8 @@ function encodeKeywordSegment(contents) {
|
|
|
1950
2015
|
const { arrays } = contents;
|
|
1951
2016
|
const postings = postingsInTokenOrder(arrays);
|
|
1952
2017
|
const out = new MessagePackChunks();
|
|
1953
|
-
|
|
2018
|
+
const { writeRecords } = contents;
|
|
2019
|
+
out.map(writeRecords === void 0 ? TOP_LEVEL_ENTRIES : TOP_LEVEL_ENTRIES + 2);
|
|
1954
2020
|
out.key("v").value(KEYWORD_SEGMENT_PAYLOAD_VERSION);
|
|
1955
2021
|
out.key("schema").value(contents.schema);
|
|
1956
2022
|
out.key("tombstones").value(contents.tombstones);
|
|
@@ -1988,6 +2054,10 @@ function encodeKeywordSegment(contents) {
|
|
|
1988
2054
|
writeSurfaceForms(out, arrays);
|
|
1989
2055
|
out.key("partialWords");
|
|
1990
2056
|
writePartialWords(out, arrays);
|
|
2057
|
+
if (writeRecords !== void 0) {
|
|
2058
|
+
out.key("seqNos").binary(uint64Bytes(writeRecords.seqNos));
|
|
2059
|
+
out.key("primaryTerms").binary(uint64Bytes(writeRecords.primaryTerms));
|
|
2060
|
+
}
|
|
1991
2061
|
return out;
|
|
1992
2062
|
}
|
|
1993
2063
|
|
|
@@ -2199,6 +2269,28 @@ function noSpellingsOf(analysis) {
|
|
|
2199
2269
|
if (analysis === null || analysis.fields.length === 0) return null;
|
|
2200
2270
|
return { fields: [...analysis.fields], tokens: [], spellings: [], counts: [] };
|
|
2201
2271
|
}
|
|
2272
|
+
function writeRecordsOfGroup(group, records, count) {
|
|
2273
|
+
const seqNos = new Float64Array(count);
|
|
2274
|
+
const primaryTerms = new Float64Array(count);
|
|
2275
|
+
let at = 0;
|
|
2276
|
+
for (const selection of group?.selections ?? []) {
|
|
2277
|
+
const source = records.get(selection.segment);
|
|
2278
|
+
for (let ordinal = 0; ordinal < selection.segment.arrays.documentCount; ordinal++) {
|
|
2279
|
+
if (!selectionKeeps(selection, ordinal)) continue;
|
|
2280
|
+
if (source !== void 0) {
|
|
2281
|
+
seqNos[at] = source.seqNos[ordinal];
|
|
2282
|
+
primaryTerms[at] = source.primaryTerms[ordinal];
|
|
2283
|
+
}
|
|
2284
|
+
at += 1;
|
|
2285
|
+
}
|
|
2286
|
+
}
|
|
2287
|
+
return { seqNos, primaryTerms };
|
|
2288
|
+
}
|
|
2289
|
+
function withWriteRecords(contents, group, request) {
|
|
2290
|
+
if (request.writeRecords === void 0) return contents;
|
|
2291
|
+
const writeRecords = writeRecordsOfGroup(group, request.writeRecords, contents.arrays.documentCount);
|
|
2292
|
+
return { ...contents, writeRecords };
|
|
2293
|
+
}
|
|
2202
2294
|
function contentsOfGroup(group, request, tombstones) {
|
|
2203
2295
|
const { schema, partialWordAnalysis, textAnalysis } = request;
|
|
2204
2296
|
if (group === null) {
|
|
@@ -2227,7 +2319,7 @@ function requireRoomForAnotherSegment(state) {
|
|
|
2227
2319
|
async function writeGroup(state, group) {
|
|
2228
2320
|
const { request } = state;
|
|
2229
2321
|
const tombstones = state.tombstonesWritten ? [] : [...request.tombstones];
|
|
2230
|
-
const contents = contentsOfGroup(group, request, tombstones);
|
|
2322
|
+
const contents = withWriteRecords(contentsOfGroup(group, request, tombstones), group, request);
|
|
2231
2323
|
const encoded = encodeKeywordSegment(contents);
|
|
2232
2324
|
if (HEADER_SIZE + encoded.byteLength > MAX_FILE_BYTES && group !== null && group.documentCount > 1) {
|
|
2233
2325
|
const [first, second] = halvesOf(group);
|
|
@@ -2314,6 +2406,15 @@ function applyTimeOrder(frozen, contents) {
|
|
|
2314
2406
|
}
|
|
2315
2407
|
}
|
|
2316
2408
|
}
|
|
2409
|
+
function writeRecordsOf2(frozen, contents) {
|
|
2410
|
+
if (contents.every((segment) => segment.writeRecords === void 0)) return void 0;
|
|
2411
|
+
const records = /* @__PURE__ */ new Map();
|
|
2412
|
+
for (let at = 0; at < frozen.length; at++) {
|
|
2413
|
+
const held = contents[at].writeRecords;
|
|
2414
|
+
if (held !== void 0) records.set(frozen[at], held);
|
|
2415
|
+
}
|
|
2416
|
+
return records;
|
|
2417
|
+
}
|
|
2317
2418
|
function retainedTombstones(frozen, contents) {
|
|
2318
2419
|
const retained = /* @__PURE__ */ new Set();
|
|
2319
2420
|
for (const segment of contents) {
|
|
@@ -2337,6 +2438,7 @@ async function compactPartitionSegments(input) {
|
|
|
2337
2438
|
for (const ref of windowRefs) contents.push(await readSegmentFile(input.store, ref));
|
|
2338
2439
|
const frozen = contents.map(frozenOf);
|
|
2339
2440
|
applyTimeOrder(frozen, contents);
|
|
2441
|
+
const writeRecords = writeRecordsOf2(frozen, contents);
|
|
2340
2442
|
const written = await writeSegmentsOf({
|
|
2341
2443
|
store: input.store,
|
|
2342
2444
|
indexName: input.indexName,
|
|
@@ -2347,7 +2449,8 @@ async function compactPartitionSegments(input) {
|
|
|
2347
2449
|
textAnalysis: input.textAnalysis,
|
|
2348
2450
|
selections: frozen.map((segment) => ({ segment })),
|
|
2349
2451
|
tombstones: retainedTombstones(frozen, contents),
|
|
2350
|
-
mergesIntoOneFile: true
|
|
2452
|
+
mergesIntoOneFile: true,
|
|
2453
|
+
...writeRecords === void 0 ? {} : { writeRecords }
|
|
2351
2454
|
});
|
|
2352
2455
|
return {
|
|
2353
2456
|
segments: [
|
|
@@ -2413,7 +2516,8 @@ async function writeWholePartition(context, partitionId, priorPartition, whole)
|
|
|
2413
2516
|
partialWordAnalysis: context.partialWordAnalysis,
|
|
2414
2517
|
textAnalysis: context.textAnalysis,
|
|
2415
2518
|
selections: whole.selections,
|
|
2416
|
-
tombstones: []
|
|
2519
|
+
tombstones: [],
|
|
2520
|
+
...whole.writeRecords === void 0 ? {} : { writeRecords: whole.writeRecords }
|
|
2417
2521
|
});
|
|
2418
2522
|
return { partitionId, nextSegmentId: written.nextSegmentId, segments: written.segments };
|
|
2419
2523
|
}
|
|
@@ -2423,7 +2527,8 @@ async function writeLoggedChanges(context, partitionId, priorPartition, entries)
|
|
|
2423
2527
|
config: context.config,
|
|
2424
2528
|
language: getLanguage(context.config.language ?? "english"),
|
|
2425
2529
|
vectorFieldPaths: context.vectorFieldPaths,
|
|
2426
|
-
entries
|
|
2530
|
+
entries,
|
|
2531
|
+
keepsWriteRecords: context.input.keepsWriteRecords === true
|
|
2427
2532
|
});
|
|
2428
2533
|
let segments = priorPartition ? [...priorPartition.segments] : [];
|
|
2429
2534
|
let nextSegmentId = priorPartition?.nextSegmentId ?? 0;
|
|
@@ -2437,7 +2542,8 @@ async function writeLoggedChanges(context, partitionId, priorPartition, entries)
|
|
|
2437
2542
|
partialWordAnalysis: context.partialWordAnalysis,
|
|
2438
2543
|
textAnalysis: context.textAnalysis,
|
|
2439
2544
|
selections: built.selections,
|
|
2440
|
-
tombstones: built.tombstones
|
|
2545
|
+
tombstones: built.tombstones,
|
|
2546
|
+
...built.writeRecords === void 0 ? {} : { writeRecords: built.writeRecords }
|
|
2441
2547
|
});
|
|
2442
2548
|
segments.push(...written.segments);
|
|
2443
2549
|
nextSegmentId = written.nextSegmentId;
|
|
@@ -2580,6 +2686,7 @@ async function loadPartitionSegments(store, partition, manager, options) {
|
|
|
2580
2686
|
if (options.decodesEveryDocument) decodeEveryStoredDocument(contents.arrays.documentTable);
|
|
2581
2687
|
const segment = createSharedFrozenSegment(shareSegmentArrays(contents.arrays, manager.partialWordAnalysis));
|
|
2582
2688
|
removeWhatTheSegmentReplaces(manager, segment, contents);
|
|
2689
|
+
options.writeRecords?.loadSegment(manager.indexName, partition.partitionId, segment, contents);
|
|
2583
2690
|
if (contents.arrays.documentCount > 0) manager.attachFrozenSegment(partition.partitionId, segment);
|
|
2584
2691
|
await yieldToEventLoop();
|
|
2585
2692
|
}
|
|
@@ -2626,7 +2733,11 @@ async function loadSegmentedCheckpoint(store, indexName, manifest, deps, decodes
|
|
|
2626
2733
|
{ indexName, partitionId: partition.partitionId, partitionCount: deps.manager.partitionCount }
|
|
2627
2734
|
);
|
|
2628
2735
|
}
|
|
2629
|
-
await loadPartitionSegments(store, partition, deps.manager, {
|
|
2736
|
+
await loadPartitionSegments(store, partition, deps.manager, {
|
|
2737
|
+
schema: manifest.schema,
|
|
2738
|
+
decodesEveryDocument,
|
|
2739
|
+
writeRecords: deps.writeRecords ?? null
|
|
2740
|
+
});
|
|
2630
2741
|
}
|
|
2631
2742
|
for (const vector of manifest.vectors) {
|
|
2632
2743
|
const vectorIndex = deps.vectorIndexes.get(vector.fieldPath);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { MAX_DOCUMENT_ENCODING_DEPTH, singleFoldTable, appendFoldedCodePoint, compareCodePoints, EARLIER_RELEASE_MIN_M, MIN_M, MAX_M, DOCUMENT_ENCODER_RETAINED_BUFFER_BYTES, MAX_FILE_BYTES, detectRuntime, splitWorkerBudget, resolveWorkerCount, CHECKSUM_YIELD_CHUNK_BYTES, resolveWorkerEntry, missingWorkerEntry, DEFAULT_REQUEST_TIMEOUT_MS, toReducedSortValue, resolveRequestThreadCount, defaultSortMode, holdsUnpairedSurrogate, compareComparableValues, readSortField, exceedsCodePoints, toComparableSortValue, SORT_VALUE_MAX_CODE_POINTS, compareComparableKeys, truncateSortString, sortModeOf, isSortMode, SORT_MODES, SHUTDOWN_TIMEOUT_MS, MIN_OVERSAMPLE, MAX_RENUMBERED_SEARCH_ATTEMPTS, compareSortValues, DEFAULT_BACKPRESSURE_LIMIT, CONSECUTIVE_TIMEOUTS_BEFORE_DEATH, codePointCount, noteThreadSlotGone, threadSlotOfWorker } from './chunk-
|
|
1
|
+
import { MAX_DOCUMENT_ENCODING_DEPTH, singleFoldTable, appendFoldedCodePoint, compareCodePoints, EARLIER_RELEASE_MIN_M, MIN_M, MAX_M, DOCUMENT_ENCODER_RETAINED_BUFFER_BYTES, MAX_FILE_BYTES, detectRuntime, splitWorkerBudget, resolveWorkerCount, CHECKSUM_YIELD_CHUNK_BYTES, resolveWorkerEntry, missingWorkerEntry, DEFAULT_REQUEST_TIMEOUT_MS, toReducedSortValue, resolveRequestThreadCount, defaultSortMode, holdsUnpairedSurrogate, compareComparableValues, readSortField, exceedsCodePoints, toComparableSortValue, SORT_VALUE_MAX_CODE_POINTS, compareComparableKeys, truncateSortString, sortModeOf, isSortMode, SORT_MODES, SHUTDOWN_TIMEOUT_MS, MIN_OVERSAMPLE, MAX_RENUMBERED_SEARCH_ATTEMPTS, compareSortValues, DEFAULT_BACKPRESSURE_LIMIT, CONSECUTIVE_TIMEOUTS_BEFORE_DEATH, codePointCount, noteThreadSlotGone, threadSlotOfWorker } from './chunk-2CBQ2PCC.mjs';
|
|
2
2
|
import { DEFAULT_MAX_RERANK_WINDOW, DEFAULT_RERANK_TIMEOUT_MS } from './chunk-JPTQZWJQ.mjs';
|
|
3
|
-
import { ErrorCodes, NarsilError, createNarsilError, ABSOLUTE_WINDOWS_PATH_PATTERN, MODULE_URL_SCHEME_PATTERN, MAX_SWEEP_INTERVAL_MS, MIN_SWEEP_INTERVAL_MS, STATISTICS_BROADCAST_INTERVAL_MS, MAX_INDEX_NAME_LENGTH, INDEX_NAME_PATTERN, MAX_EXPORT_LINE_BYTES, IMPORT_BATCH_DOCUMENTS, MAX_SUGGEST_LIMIT, MAX_INDEX_CONFIGURATION_BYTES, FOREIGN_STATS_TTL_MS, HEAP_PRESSURE_WARNING_FRACTION, MAX_IMPORT_REFUSALS_REPORTED, DEFAULT_SUGGEST_LIMIT, DEFAULT_FUZZY_PREFIX_LENGTH, MAX_CURSOR_LENGTH, MAX_CURSOR_ANCHOR_CODE_POINTS, MAX_SORT_FIELDS, MAX_SORT_FIELD_NAME_LENGTH, RESULT_WINDOW, DEFAULT_LIMIT, DEFAULT_OFFSET, DEFAULT_LINEAR_ALPHA, MIN_LINEAR_ALPHA, MAX_LINEAR_ALPHA, DEFAULT_RANK_CONSTANT, MIN_RANK_CONSTANT, MIN_DOCUMENTS_FOR_SEGMENTS, DEFAULT_PAGE_SIZE, DEFAULT_MAX_PER_GROUP, PREFIX_MAX_EXPANSIONS, HEAP_PRESSURE_REARM_FRACTION, MAX_TOLERANCE, MAX_PREFIX_LENGTH, BATCH_CHUNK_SIZE, MAX_DOC_ID_LENGTH } from './chunk-
|
|
3
|
+
import { ErrorCodes, NarsilError, createNarsilError, ABSOLUTE_WINDOWS_PATH_PATTERN, MODULE_URL_SCHEME_PATTERN, MAX_SWEEP_INTERVAL_MS, MIN_SWEEP_INTERVAL_MS, STATISTICS_BROADCAST_INTERVAL_MS, MAX_INDEX_NAME_LENGTH, INDEX_NAME_PATTERN, MAX_EXPORT_LINE_BYTES, IMPORT_BATCH_DOCUMENTS, MAX_SUGGEST_LIMIT, MAX_INDEX_CONFIGURATION_BYTES, FOREIGN_STATS_TTL_MS, HEAP_PRESSURE_WARNING_FRACTION, MAX_IMPORT_REFUSALS_REPORTED, DEFAULT_SUGGEST_LIMIT, DEFAULT_FUZZY_PREFIX_LENGTH, MAX_CURSOR_LENGTH, MAX_CURSOR_ANCHOR_CODE_POINTS, MAX_SORT_FIELDS, MAX_SORT_FIELD_NAME_LENGTH, RESULT_WINDOW, DEFAULT_LIMIT, DEFAULT_OFFSET, DEFAULT_LINEAR_ALPHA, MIN_LINEAR_ALPHA, MAX_LINEAR_ALPHA, DEFAULT_RANK_CONSTANT, MIN_RANK_CONSTANT, MIN_DOCUMENTS_FOR_SEGMENTS, DEFAULT_PAGE_SIZE, DEFAULT_MAX_PER_GROUP, PREFIX_MAX_EXPANSIONS, HEAP_PRESSURE_REARM_FRACTION, MAX_TOLERANCE, MAX_PREFIX_LENGTH, BATCH_CHUNK_SIZE, MAX_DOC_ID_LENGTH } from './chunk-LJS6PREA.mjs';
|
|
4
4
|
import { Encoder, Decoder, decode, encode } from '@msgpack/msgpack';
|
|
5
5
|
|
|
6
6
|
// src/analysis/registry.ts
|
|
@@ -14949,7 +14949,7 @@ function requireLoadedVectorCode() {
|
|
|
14949
14949
|
function loadVectorCode() {
|
|
14950
14950
|
if (loaded !== null) return Promise.resolve(loaded);
|
|
14951
14951
|
if (loading === null) {
|
|
14952
|
-
loading = import('./module-
|
|
14952
|
+
loading = import('./module-DYKR4INA.mjs').then(
|
|
14953
14953
|
(code) => {
|
|
14954
14954
|
loaded = code;
|
|
14955
14955
|
return code;
|
|
@@ -19026,7 +19026,7 @@ async function emitWriteEventAfter(source, indexName, write) {
|
|
|
19026
19026
|
// src/engine/core.ts
|
|
19027
19027
|
async function createEngineCore(config, hooks, capacityScope = "index") {
|
|
19028
19028
|
validateWorkerConfig(config?.workers, config?.lifecycle);
|
|
19029
|
-
const rerankSettings = config?.rerankTimeout === void 0 && config?.maxRerankWindow === void 0 ? { timeoutMs: DEFAULT_RERANK_TIMEOUT_MS, maxWindow: DEFAULT_MAX_RERANK_WINDOW } : (await import('./runtime-
|
|
19029
|
+
const rerankSettings = config?.rerankTimeout === void 0 && config?.maxRerankWindow === void 0 ? { timeoutMs: DEFAULT_RERANK_TIMEOUT_MS, maxWindow: DEFAULT_MAX_RERANK_WINDOW } : (await import('./runtime-FL5K4JOH.mjs')).resolveRerankSettings(config);
|
|
19030
19030
|
const eventHandlers = eventHandlersOf(config?.events);
|
|
19031
19031
|
const vectorWorkerCount = splitWorkerBudget(resolveWorkerCount(config?.workers?.count)).vector;
|
|
19032
19032
|
const vectorCopyPolicy = {
|
|
@@ -19037,7 +19037,7 @@ async function createEngineCore(config, hooks, capacityScope = "index") {
|
|
|
19037
19037
|
if (config?.lifecycle !== void 0 && durabilityTier === null) {
|
|
19038
19038
|
throw new NarsilError(ErrorCodes.CONFIG_INVALID, "Index lifecycle settings require durability");
|
|
19039
19039
|
}
|
|
19040
|
-
const durabilityWiring = durabilityTier === null ? null : await import('./durability-wiring-
|
|
19040
|
+
const durabilityWiring = durabilityTier === null ? null : await import('./durability-wiring-CYAJBYCO.mjs');
|
|
19041
19041
|
const filesystemDurability = durabilityTier?.kind === "wal";
|
|
19042
19042
|
const executor = createDirectExecutor({
|
|
19043
19043
|
vectorWorkerCopies: vectorCopyPolicy,
|
|
@@ -19334,7 +19334,7 @@ async function shutdownEngine(core) {
|
|
|
19334
19334
|
}
|
|
19335
19335
|
}
|
|
19336
19336
|
if (core.rerankAdapters.size > 0) {
|
|
19337
|
-
await (await import('./runtime-
|
|
19337
|
+
await (await import('./runtime-FL5K4JOH.mjs')).shutdownRerankAdapters(core.rerankAdapters);
|
|
19338
19338
|
}
|
|
19339
19339
|
await orchestrator.shutdown();
|
|
19340
19340
|
await executor.shutdown();
|
|
@@ -22470,14 +22470,14 @@ function portabilityOperations(core, config, engine) {
|
|
|
22470
22470
|
return {
|
|
22471
22471
|
snapshot(indexName) {
|
|
22472
22472
|
return withOpenIndex(indexName, async () => {
|
|
22473
|
-
const { createSnapshot } = await import('./snapshot-
|
|
22473
|
+
const { createSnapshot } = await import('./snapshot-BU6I25CW.mjs');
|
|
22474
22474
|
return createSnapshot(snapshotDepsOf(indexName));
|
|
22475
22475
|
});
|
|
22476
22476
|
},
|
|
22477
22477
|
async restore(indexName, data) {
|
|
22478
22478
|
core.guardShutdown();
|
|
22479
22479
|
validateIndexName(indexName);
|
|
22480
|
-
const restored = import('./restore-queue-
|
|
22480
|
+
const restored = import('./restore-queue-RTZGJT4D.mjs').then(
|
|
22481
22481
|
({ queueRestore }) => queueRestore(core, restoreHost, restoresInFlight, indexName, data)
|
|
22482
22482
|
);
|
|
22483
22483
|
await emitWriteEventAfter(core, indexName, restored);
|
|
@@ -22486,8 +22486,8 @@ function portabilityOperations(core, config, engine) {
|
|
|
22486
22486
|
exportDocuments(indexName) {
|
|
22487
22487
|
return withOpenIndex(indexName, async () => {
|
|
22488
22488
|
const [{ checkpointForArchive }, { documentExportStream }] = await Promise.all([
|
|
22489
|
-
import('./snapshot-
|
|
22490
|
-
import('./write-
|
|
22489
|
+
import('./snapshot-BU6I25CW.mjs'),
|
|
22490
|
+
import('./write-RUPYHPBZ.mjs')
|
|
22491
22491
|
]);
|
|
22492
22492
|
const header = indexConfigurationOf(core.requireIndex(indexName));
|
|
22493
22493
|
return documentExportStream(header, await checkpointForArchive(snapshotDepsOf(indexName)));
|
|
@@ -23737,13 +23737,13 @@ function requireCursorDepth(cursor, signature, binding) {
|
|
|
23737
23737
|
}
|
|
23738
23738
|
function hybridSearchOf(params, context, limit, offset, cursorDepth) {
|
|
23739
23739
|
if ((params.hybrid?.depth ?? null) === null) return executeHybridSearch(params, context, limit, offset, cursorDepth);
|
|
23740
|
-
return import('./runtime-
|
|
23740
|
+
return import('./runtime-FL5K4JOH.mjs').then(
|
|
23741
23741
|
(runtime) => runtime.searchFixedDepthHybrid(params, context, { cursorDepth: cursorDepth ?? 0, offset, limit }, runtimeHost)
|
|
23742
23742
|
);
|
|
23743
23743
|
}
|
|
23744
23744
|
function executeQuery(request, callerContext) {
|
|
23745
23745
|
if (request.rerank === void 0) return runQuery(request, callerContext);
|
|
23746
|
-
return import('./runtime-
|
|
23746
|
+
return import('./runtime-FL5K4JOH.mjs').then(
|
|
23747
23747
|
(runtime) => runtime.executeRerankedQuery(request, callerContext, executeQuery, runtimeHost)
|
|
23748
23748
|
);
|
|
23749
23749
|
}
|
|
@@ -24124,7 +24124,7 @@ async function runEngineQuery(core, indexName, params, options) {
|
|
|
24124
24124
|
const manager = core.requireManager(indexName);
|
|
24125
24125
|
const scoped = scopedParams(params, options);
|
|
24126
24126
|
await core.pluginRegistry.runHook("beforeSearch", { indexName, params: scoped });
|
|
24127
|
-
const rerank = scoped.rerank === void 0 ? void 0 : await import('./runtime-
|
|
24127
|
+
const rerank = scoped.rerank === void 0 ? void 0 : await import('./runtime-FL5K4JOH.mjs');
|
|
24128
24128
|
const resolvedParams = await resolveVectorText(
|
|
24129
24129
|
rerank === void 0 ? scoped : rerank.withRerankQueryText(scoped),
|
|
24130
24130
|
entry.embeddingAdapter,
|
|
@@ -70,6 +70,7 @@ var ErrorCodes = {
|
|
|
70
70
|
REPLICATION_INSYNC_REMOVAL_FAILED: "REPLICATION_INSYNC_REMOVAL_FAILED",
|
|
71
71
|
REPLICATION_ROLLBACK_FAILED: "REPLICATION_ROLLBACK_FAILED",
|
|
72
72
|
REPLICATION_OUTCOME_UNKNOWN: "REPLICATION_OUTCOME_UNKNOWN",
|
|
73
|
+
REPLICATION_WRITE_CONFLICT: "REPLICATION_WRITE_CONFLICT",
|
|
73
74
|
REPLICATION_LOG_FULL: "REPLICATION_LOG_FULL",
|
|
74
75
|
REPLICATION_ENTRY_CORRUPT: "REPLICATION_ENTRY_CORRUPT",
|
|
75
76
|
REPLICATION_SNAPSHOT_CORRUPT: "REPLICATION_SNAPSHOT_CORRUPT",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { unpackLevels, osqRecordBytes, VECTOR_FILE_MAX_VECTORS, NO_LIVE_VECTOR_AT_POSITION, readTrailer, stageQueryLevels, osqCodeBytes, osqStagedQueryBytes, bytesToVectors, VECTOR_GRAPH_PART_VECTORS, VECTOR_GRAPH_PART_PAYLOAD_VERSION, VECTOR_FILE_PAYLOAD_VERSION, deadBitsWhere, vectorsToBytes, writeRecord } from './chunk-
|
|
2
|
-
import { markSimdUnavailable, MAX_WASM_PAGES, WASM_PAGE_BYTES, VECTOR_SCRATCH_SLOTS, UNPLACED_FLAG_CHUNK_ORDINALS, COMPACTION_TOMBSTONE_RATIO, COMPACTION_ABSOLUTE_THRESHOLD, MAX_FILE_BYTES, VECTOR_BLOCK_INITIAL_SLOTS, MAX_VECTOR_ORDINALS, VECTOR_STORE_INITIAL_CAPACITY, PLACEMENT_ROOM_REQUESTS, LOCK_SPIN_ITERATIONS, LOCK_WAIT_SLICE_MS, MAX_LAYER_CAP, INITIAL_LIST_CAPACITY, OSQ_PLACEMENT_QUERY_BITS, GRAPH_LOCK_WAIT_SLICE_MS, OSQ_STEPS, OSQ_GRID, OSQ_QUERY_BITS, GRAPH_LOCK_WAIT_DEADLINE_MS, compareCodePoints, INITIAL_UPPER_SLOTS, OSQ_REFINE_ROUNDS, OSQ_REFINE_TOLERANCE, threadSlotGone, DEFAULT_EF_SEARCH, OSQ_LAMBDA, NEAREST_LINK_FALLBACK_HOSTS, FARTHEST_REJECTED_LINKS_KEPT, MAX_DOC_ID_TABLE_BYTES } from './chunk-
|
|
3
|
-
import { NarsilError, ErrorCodes, MAX_DOC_ID_LENGTH } from './chunk-
|
|
1
|
+
import { unpackLevels, osqRecordBytes, VECTOR_FILE_MAX_VECTORS, NO_LIVE_VECTOR_AT_POSITION, readTrailer, stageQueryLevels, osqCodeBytes, osqStagedQueryBytes, bytesToVectors, VECTOR_GRAPH_PART_VECTORS, VECTOR_GRAPH_PART_PAYLOAD_VERSION, VECTOR_FILE_PAYLOAD_VERSION, deadBitsWhere, vectorsToBytes, writeRecord } from './chunk-P7C2S5JX.mjs';
|
|
2
|
+
import { markSimdUnavailable, MAX_WASM_PAGES, WASM_PAGE_BYTES, VECTOR_SCRATCH_SLOTS, UNPLACED_FLAG_CHUNK_ORDINALS, COMPACTION_TOMBSTONE_RATIO, COMPACTION_ABSOLUTE_THRESHOLD, MAX_FILE_BYTES, VECTOR_BLOCK_INITIAL_SLOTS, MAX_VECTOR_ORDINALS, VECTOR_STORE_INITIAL_CAPACITY, PLACEMENT_ROOM_REQUESTS, LOCK_SPIN_ITERATIONS, LOCK_WAIT_SLICE_MS, MAX_LAYER_CAP, INITIAL_LIST_CAPACITY, OSQ_PLACEMENT_QUERY_BITS, GRAPH_LOCK_WAIT_SLICE_MS, OSQ_STEPS, OSQ_GRID, OSQ_QUERY_BITS, GRAPH_LOCK_WAIT_DEADLINE_MS, compareCodePoints, INITIAL_UPPER_SLOTS, OSQ_REFINE_ROUNDS, OSQ_REFINE_TOLERANCE, threadSlotGone, DEFAULT_EF_SEARCH, OSQ_LAMBDA, NEAREST_LINK_FALLBACK_HOSTS, FARTHEST_REJECTED_LINKS_KEPT, MAX_DOC_ID_TABLE_BYTES } from './chunk-2CBQ2PCC.mjs';
|
|
3
|
+
import { NarsilError, ErrorCodes, MAX_DOC_ID_LENGTH } from './chunk-LJS6PREA.mjs';
|
|
4
4
|
|
|
5
5
|
// src/vector/shared-buffers/growable.ts
|
|
6
6
|
function sharedMemoryAvailable() {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { MAX_M, EARLIER_RELEASE_MIN_M, MIN_M } from './chunk-
|
|
2
|
-
import { NarsilError, ErrorCodes } from './chunk-
|
|
1
|
+
import { MAX_M, EARLIER_RELEASE_MIN_M, MIN_M } from './chunk-2CBQ2PCC.mjs';
|
|
2
|
+
import { NarsilError, ErrorCodes } from './chunk-LJS6PREA.mjs';
|
|
3
3
|
|
|
4
4
|
// src/vector/vector-index/dead-bits.ts
|
|
5
5
|
var NO_LIVE_VECTOR_AT_POSITION = -1;
|