@delali/narsil 0.3.1-next.107 → 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-JJKVYLL3.mjs → chunk-2CBQ2PCC.mjs} +1 -1
- package/dist/browser/{chunk-PA56PRWX.mjs → chunk-5BQPBG3G.mjs} +41 -4
- package/dist/browser/{chunk-NNQPZPTB.mjs → chunk-6YUUEMQ4.mjs} +139 -28
- package/dist/browser/{chunk-WZUSMF7A.mjs → chunk-HQOYKRMB.mjs} +14 -13
- package/dist/browser/{chunk-J3QB4LBD.mjs → chunk-LJS6PREA.mjs} +2 -0
- package/dist/browser/{chunk-OKZGAJEF.mjs → chunk-OVY4RPDS.mjs} +3 -3
- package/dist/browser/{chunk-OL7S2KLL.mjs → chunk-P7C2S5JX.mjs} +2 -2
- package/dist/browser/{durability-wiring-HFQULBSA.mjs → durability-wiring-CYAJBYCO.mjs} +48 -20
- package/dist/browser/{module-VROKZ7IZ.mjs → module-DYKR4INA.mjs} +5 -5
- package/dist/browser/{restore-queue-EU77FRCV.mjs → restore-queue-RTZGJT4D.mjs} +1 -1
- package/dist/browser/{runtime-JQYPNOK6.mjs → runtime-FL5K4JOH.mjs} +1 -1
- package/dist/browser/{snapshot-G77LQBZX.mjs → snapshot-BU6I25CW.mjs} +27 -14
- package/dist/browser/{write-RUC64JIH.mjs → write-RUPYHPBZ.mjs} +5 -5
- package/dist/{capabilities-ByKPha_q.d.ts → capabilities-ByaX8Arf.d.ts} +2 -2
- package/dist/{chunk-WCNN2PLX.mjs → chunk-2RAQKITH.mjs} +1 -1
- package/dist/{chunk-JSSGO4B5.mjs → chunk-542TD4BL.mjs} +1 -1
- package/dist/{chunk-KOCHOOS5.mjs → chunk-63HFWQEA.mjs} +5 -3
- package/dist/{chunk-77SO7G55.mjs → chunk-6ODIY6ZB.mjs} +1 -1
- package/dist/{chunk-VVDQNCOG.mjs → chunk-6OXNHLNZ.mjs} +1 -0
- package/dist/{chunk-CYHQNM3T.mjs → chunk-6PN3U6XW.mjs} +1 -1
- package/dist/{chunk-WCJJCBR4.mjs → chunk-6S7YRUPQ.mjs} +123 -35
- package/dist/{chunk-FEOLYA2Y.mjs → chunk-7JOONQ24.mjs} +6 -6
- package/dist/{chunk-MZW4V4DS.mjs → chunk-7ZZQNOIY.mjs} +1 -1
- package/dist/{chunk-VWFFCDOL.mjs → chunk-CUVTRLA4.mjs} +26 -13
- package/dist/{chunk-VVFKFHWE.mjs → chunk-DG62H7OD.mjs} +2 -2
- package/dist/{chunk-QALAFGF5.mjs → chunk-FUUP45IS.mjs} +1 -1
- package/dist/{chunk-2MNJ2HX7.mjs → chunk-HNAP2KTG.mjs} +2 -2
- package/dist/{chunk-RI5VNFAI.mjs → chunk-IR4KQ4WB.mjs} +2 -2
- package/dist/{chunk-CKNOGER5.mjs → chunk-IW6UR3AF.mjs} +23 -22
- package/dist/{chunk-FABI2JA7.mjs → chunk-J6YVB2XM.mjs} +1 -1
- package/dist/{chunk-UM6Z7AIP.mjs → chunk-JBPYFYIU.mjs} +4 -3
- package/dist/{chunk-WXVTQ6NO.mjs → chunk-KCQG2PJT.mjs} +3 -3
- package/dist/{chunk-OKZPYJZX.mjs → chunk-LOBYK2FG.mjs} +3 -3
- package/dist/{chunk-3BRFOMGX.mjs → chunk-N57XXGPG.mjs} +2 -2
- package/dist/{chunk-6JUOMMHQ.mjs → chunk-OBWUWZRA.mjs} +2 -0
- package/dist/{chunk-VHPVBJOI.mjs → chunk-OCB7TMUQ.mjs} +1 -1
- package/dist/{chunk-AEF2O7B4.mjs → chunk-OFYKBKKV.mjs} +1 -1
- package/dist/{chunk-IZLM2OOO.mjs → chunk-PKE2PCTS.mjs} +43 -6
- package/dist/{chunk-HNAQNAFS.mjs → chunk-PT7VRWS7.mjs} +3 -3
- package/dist/{chunk-DUWYU4D5.mjs → chunk-PWIWSUCX.mjs} +2 -2
- package/dist/{chunk-IA6I5U36.mjs → chunk-QI6JW4PM.mjs} +1 -1
- package/dist/{chunk-MJIJG4YT.mjs → chunk-QIFOXLWF.mjs} +2 -2
- package/dist/{chunk-M5EZVXIM.mjs → chunk-R2MRGYU5.mjs} +2 -2
- package/dist/{chunk-7IBX2LRA.mjs → chunk-R2MRMH6M.mjs} +11 -11
- package/dist/{chunk-5FPMDU54.mjs → chunk-SOADQINJ.mjs} +8 -1
- package/dist/{chunk-QA6F5MML.mjs → chunk-SXVDBHYJ.mjs} +39 -8
- package/dist/{chunk-NRARRUKN.mjs → chunk-UGKO3RG2.mjs} +7 -7
- package/dist/{chunk-HAQUJYMN.mjs → chunk-V7G627TA.mjs} +14 -8
- package/dist/{chunk-BRIOLMIX.mjs → chunk-VK45J47R.mjs} +1 -1
- package/dist/{chunk-RPIE4QCL.mjs → chunk-YH5OIL7B.mjs} +2 -0
- package/dist/{chunk-G6YATIRT.mjs → chunk-YIDSHBQS.mjs} +2 -2
- package/dist/{chunk-IA3H54X4.mjs → chunk-YLE75NQ5.mjs} +2 -2
- package/dist/{chunk-DNKM67DF.mjs → chunk-YSR5L3XJ.mjs} +2 -2
- package/dist/{client-DI-xIXgR.d.ts → client-BdnzDFtO.d.ts} +2 -2
- package/dist/client.d.ts +6 -6
- package/dist/client.mjs +2 -0
- package/dist/{config-DL_bDDD8.d.ts → config-CSgvApt0.d.ts} +1 -1
- package/dist/{config-BZ_e3X8w.d.ts → config-ujZESkJz.d.ts} +1 -1
- package/dist/{direct-executor-BPBD2PBK.mjs → direct-executor-QFAUKTCQ.mjs} +12 -12
- 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 +1800 -468
- package/dist/{durability-wiring-AZL4EFLO.mjs → durability-wiring-NUHTYXHA.mjs} +66 -39
- package/dist/embeddings/openai.mjs +2 -2
- package/dist/{engine-D_SYDsId.d.ts → engine-C_HSy3iz.d.ts} +1 -1
- package/dist/{events-C7_dboUr.d.ts → events-CJsXF1F9.d.ts} +2 -0
- package/dist/index.browser.mjs +3 -3
- package/dist/index.d.ts +5 -5
- package/dist/index.mjs +17 -17
- package/dist/{module-6EY7GW2W.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 +26 -24
- package/dist/react.d.ts +6 -6
- package/dist/react.mjs +2 -0
- package/dist/{rerank-WVFFZV76.mjs → rerank-3POMPQNX.mjs} +7 -7
- package/dist/rerankers/http.mjs +2 -2
- package/dist/{restore-queue-DDXFDP7U.mjs → restore-queue-QSLGXZJB.mjs} +1 -1
- package/dist/{runtime-AVUUCJWQ.mjs → runtime-C2435MPK.mjs} +5 -5
- package/dist/server.d.ts +8 -8
- package/dist/server.mjs +16 -15
- package/dist/{snapshot-IDAM65JO.mjs → snapshot-IV3S2TMI.mjs} +27 -27
- package/dist/synonyms.mjs +3 -3
- package/dist/{tasks-BhjQZ8Qf.d.ts → tasks-CI3Fvkxw.d.ts} +1 -1
- package/dist/{thread-LMSYLCPI.mjs → thread-THLCKMEB.mjs} +13 -13
- package/dist/vector/search-worker.mjs +4 -4
- package/dist/workers/entry.mjs +6 -6
- package/dist/{write-3LIFIGOL.mjs → write-VGRTOS7N.mjs} +19 -19
- package/package.json +7 -7
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
import { deserializePayloadV2, documentsOfPayloadV2 } from './chunk-
|
|
2
|
-
import { closePartitionWriter, drainIndexStateForUnload, listPersistedIndexes, loadMetadata, snapshotCheckpointFor, replayWal } from './chunk-
|
|
3
|
-
import { decodeSegmentManifest, SINGLE_NODE_PRIMARY_TERM, readMetadataEnvelope, writeMetadataEnvelope, metadataFromConfig, createSeqOwner, readSegmentManifest, reclaimUnlistedKeys, loadSegmentedCheckpoint, isRecord, invalidManifest, unpackEnvelopeBytes, isId, isUint32, isSequenceNumber, writeLiveVectors, growPartitionsTo, VECTOR_FILE_ENVELOPE_VERSION, metadataConfigOf, readCurrentManifest } from './chunk-
|
|
4
|
-
import { decodeVectorIndexParts, VECTOR_FILE_MAX_VECTORS, deadBytesFor, countDead, decodeVectorFilePayload, decodeVectorGraphPayload, graphPartsOfEarlierPayload } from './chunk-
|
|
1
|
+
import { deserializePayloadV2, documentsOfPayloadV2 } from './chunk-YSR5L3XJ.mjs';
|
|
2
|
+
import { closePartitionWriter, drainIndexStateForUnload, listPersistedIndexes, loadMetadata, snapshotCheckpointFor, replayWal } from './chunk-JBPYFYIU.mjs';
|
|
3
|
+
import { decodeSegmentManifest, SINGLE_NODE_PRIMARY_TERM, readMetadataEnvelope, writeMetadataEnvelope, metadataFromConfig, createSeqOwner, readSegmentManifest, reclaimUnlistedKeys, loadSegmentedCheckpoint, isRecord, invalidManifest, unpackEnvelopeBytes, isId, isUint32, isSequenceNumber, writeLiveVectors, growPartitionsTo, VECTOR_FILE_ENVELOPE_VERSION, metadataConfigOf, readCurrentManifest } from './chunk-SXVDBHYJ.mjs';
|
|
4
|
+
import { decodeVectorIndexParts, VECTOR_FILE_MAX_VECTORS, deadBytesFor, countDead, decodeVectorFilePayload, decodeVectorGraphPayload, graphPartsOfEarlierPayload } from './chunk-OCB7TMUQ.mjs';
|
|
5
5
|
import './chunk-37CD3OKS.mjs';
|
|
6
|
-
import { createDurableDirectory } from './chunk-
|
|
6
|
+
import { createDurableDirectory } from './chunk-YLE75NQ5.mjs';
|
|
7
7
|
import { spawnNodeWorker } from './chunk-C7SLA6CM.mjs';
|
|
8
8
|
import { getFs } from './chunk-HLPRHOSO.mjs';
|
|
9
|
-
import { DEFAULT_SEGMENT_MAX_BYTES, DEFAULT_CHECKPOINT_INTERVAL_MS, DEFAULT_CHECKPOINT_MUTATION_THRESHOLD, DEFAULT_COMPACTION_THRESHOLD, DEFAULT_ASYNC_FLUSH_INTERVAL_MS, WRITES_STALL_ABOVE_UNCHECKPOINTED_BYTES, directoryCheckpointStore, manifestKey, readListedFile, adapterCheckpointStore, snapshotBundleKey, manifestReferencedKeys, manifestFileRefs, readSegmentFile, checkpointPrimaryTerm, frameRecord, writeCheckpointSegments, partitionContentsOf, commitCheckpointManifest, removeCheckpointGarbage, MAX_SEGMENTS_PER_PARTITION, writeSegmentHeader, readCommitMarker, nextMarkerSlot, encodeMarkerSlot, markerSlotOffset, DIRECTORY_IDENTITY_CHECK_INTERVAL_MS, SEGMENT_HEADER_SIZE, buildEntry, WHOLE_PARTITION_LARGEST_DOCUMENT_COUNT, WHOLE_PARTITION_MIN_CHANGED_SHARE, captureWholePartition, checkpointLastSeqNo, CHECKPOINT_TIMEOUT_RECOVERY_BACKOFF_MS, CHECKPOINT_WORKER_TIMEOUT_MS, CHECKPOINT_WORKER_IDLE_MS, LOG_RECORDS_PER_CHECKPOINT } from './chunk-
|
|
10
|
-
import './chunk-
|
|
9
|
+
import { DEFAULT_SEGMENT_MAX_BYTES, DEFAULT_CHECKPOINT_INTERVAL_MS, DEFAULT_CHECKPOINT_MUTATION_THRESHOLD, DEFAULT_COMPACTION_THRESHOLD, DEFAULT_ASYNC_FLUSH_INTERVAL_MS, WRITES_STALL_ABOVE_UNCHECKPOINTED_BYTES, directoryCheckpointStore, manifestKey, readListedFile, adapterCheckpointStore, snapshotBundleKey, manifestReferencedKeys, manifestFileRefs, readSegmentFile, checkpointPrimaryTerm, frameRecord, writeCheckpointSegments, partitionContentsOf, commitCheckpointManifest, removeCheckpointGarbage, MAX_SEGMENTS_PER_PARTITION, writeSegmentHeader, readCommitMarker, nextMarkerSlot, encodeMarkerSlot, markerSlotOffset, DIRECTORY_IDENTITY_CHECK_INTERVAL_MS, SEGMENT_HEADER_SIZE, buildEntry, WHOLE_PARTITION_LARGEST_DOCUMENT_COUNT, WHOLE_PARTITION_MIN_CHANGED_SHARE, captureWholePartition, checkpointLastSeqNo, CHECKPOINT_TIMEOUT_RECOVERY_BACKOFF_MS, CHECKPOINT_WORKER_TIMEOUT_MS, CHECKPOINT_WORKER_IDLE_MS, LOG_RECORDS_PER_CHECKPOINT } from './chunk-6S7YRUPQ.mjs';
|
|
10
|
+
import './chunk-PKE2PCTS.mjs';
|
|
11
11
|
import './chunk-P36MUFEJ.mjs';
|
|
12
|
-
import './chunk-
|
|
13
|
-
import { openChecksummedEnvelope, HEADER_SIZE } from './chunk-
|
|
14
|
-
import './chunk-
|
|
15
|
-
import './chunk-
|
|
16
|
-
import { resolveWorkerEntry } from './chunk-
|
|
12
|
+
import './chunk-YH5OIL7B.mjs';
|
|
13
|
+
import { openChecksummedEnvelope, HEADER_SIZE } from './chunk-IW6UR3AF.mjs';
|
|
14
|
+
import './chunk-UGKO3RG2.mjs';
|
|
15
|
+
import './chunk-N57XXGPG.mjs';
|
|
16
|
+
import { resolveWorkerEntry } from './chunk-6PN3U6XW.mjs';
|
|
17
17
|
import { detectRuntime } from './chunk-AV4IJKD2.mjs';
|
|
18
|
-
import { buildSegmentPayload, resolvePartitionInsertOptions, freezeSegmentShared, createSharedFrozenSegment } from './chunk-
|
|
19
|
-
import { fnv1a } from './chunk-
|
|
20
|
-
import './chunk-
|
|
21
|
-
import './chunk-
|
|
18
|
+
import { buildSegmentPayload, resolvePartitionInsertOptions, freezeSegmentShared, createSharedFrozenSegment } from './chunk-R2MRMH6M.mjs';
|
|
19
|
+
import { fnv1a } from './chunk-7JOONQ24.mjs';
|
|
20
|
+
import './chunk-FUUP45IS.mjs';
|
|
21
|
+
import './chunk-SOADQINJ.mjs';
|
|
22
22
|
import './chunk-HJSN7UYG.mjs';
|
|
23
23
|
import { MAX_INDEX_NAME_LENGTH, INDEX_NAME_PATTERN } from './chunk-LXWDQLTW.mjs';
|
|
24
24
|
import './chunk-TGP5M5R7.mjs';
|
|
25
25
|
import './chunk-U2BKYEC7.mjs';
|
|
26
26
|
import './chunk-KOKM4PQN.mjs';
|
|
27
27
|
import './chunk-QSK35UC2.mjs';
|
|
28
|
-
import './chunk-
|
|
29
|
-
import './chunk-
|
|
28
|
+
import './chunk-VK45J47R.mjs';
|
|
29
|
+
import './chunk-HNAP2KTG.mjs';
|
|
30
30
|
import './chunk-WQBCBKY3.mjs';
|
|
31
|
-
import './chunk-
|
|
32
|
-
import { encodeDocument, requireValidFieldTypes } from './chunk-
|
|
31
|
+
import './chunk-KCQG2PJT.mjs';
|
|
32
|
+
import { encodeDocument, requireValidFieldTypes } from './chunk-DG62H7OD.mjs';
|
|
33
33
|
import { MAX_FILE_BYTES } from './chunk-U476IXKQ.mjs';
|
|
34
34
|
import './chunk-E74YLAIG.mjs';
|
|
35
35
|
import { MIN_M } from './chunk-VJS4JFBQ.mjs';
|
|
36
36
|
import './chunk-GES7U2PM.mjs';
|
|
37
|
-
import './chunk-
|
|
38
|
-
import './chunk-
|
|
37
|
+
import './chunk-6ODIY6ZB.mjs';
|
|
38
|
+
import './chunk-IR4KQ4WB.mjs';
|
|
39
39
|
import './chunk-X5CV2E2B.mjs';
|
|
40
40
|
import './chunk-7X5JST5L.mjs';
|
|
41
|
-
import './chunk-
|
|
41
|
+
import './chunk-OFYKBKKV.mjs';
|
|
42
42
|
import './chunk-R6A773WK.mjs';
|
|
43
43
|
import { compareCodePoints } from './chunk-YTJCGKM4.mjs';
|
|
44
44
|
import './chunk-CQUMNIIG.mjs';
|
|
45
|
-
import './chunk-
|
|
45
|
+
import './chunk-QI6JW4PM.mjs';
|
|
46
46
|
import './chunk-ZXZ26WSO.mjs';
|
|
47
47
|
import './chunk-RFBLQLLZ.mjs';
|
|
48
48
|
import './chunk-L5ORED7V.mjs';
|
|
49
|
-
import { NarsilError, ErrorCodes } from './chunk-
|
|
49
|
+
import { NarsilError, ErrorCodes } from './chunk-OBWUWZRA.mjs';
|
|
50
50
|
import { decode } from '@msgpack/msgpack';
|
|
51
51
|
|
|
52
52
|
// src/persistence/durability/sha256.ts
|
|
@@ -640,7 +640,7 @@ function noWholePartitions() {
|
|
|
640
640
|
return { contents: [], captured: [] };
|
|
641
641
|
}
|
|
642
642
|
function wholePartitionsWhereMostChanged(manager, rules) {
|
|
643
|
-
const { priorCheckpoint, priorPartitionIds, everyPartition, aWorkerCanSerialise } = rules;
|
|
643
|
+
const { priorCheckpoint, priorPartitionIds, everyPartition, aWorkerCanSerialise, captureRecords } = rules;
|
|
644
644
|
return (targets) => {
|
|
645
645
|
const whole = { contents: [], captured: [] };
|
|
646
646
|
const changed = targets.filter(
|
|
@@ -654,17 +654,18 @@ function wholePartitionsWhereMostChanged(manager, rules) {
|
|
|
654
654
|
const logMatchesMemory = targets.length === 1 && priorPartitionIds.every((partitionId) => partitionId === 0);
|
|
655
655
|
if (!everyPartition && !(mostOfEachChanged && logMatchesMemory)) return whole;
|
|
656
656
|
for (const { partitionId } of changed) {
|
|
657
|
-
const
|
|
657
|
+
const capture2 = captureRecords?.(partitionId);
|
|
658
|
+
const captured = aWorkerCanSerialise ? captureWholePartition(manager, partitionId, capture2) : null;
|
|
658
659
|
if (captured !== null) {
|
|
659
660
|
whole.captured.push(captured);
|
|
660
661
|
} else if (everyPartition || !aWorkerCanSerialise) {
|
|
661
|
-
whole.contents.push(partitionContentsOf(manager, partitionId));
|
|
662
|
+
whole.contents.push(partitionContentsOf(manager, partitionId, capture2));
|
|
662
663
|
}
|
|
663
664
|
}
|
|
664
665
|
return whole;
|
|
665
666
|
};
|
|
666
667
|
}
|
|
667
|
-
async function captureCheckpoint(indexState, manager, vectorIndexes, wholePartitionsOf = noWholePartitions, priorCheckpointThatLimitsTheRecords, listedVectorFields = []) {
|
|
668
|
+
async function captureCheckpoint(indexState, manager, vectorIndexes, wholePartitionsOf = noWholePartitions, priorCheckpointThatLimitsTheRecords, listedVectorFields = [], termHistoryOf) {
|
|
668
669
|
for (const vectorIndex of vectorIndexes.values()) await vectorIndex.completeGraph();
|
|
669
670
|
return whileNoMutationApplies([...indexState.partitions.values()], () => {
|
|
670
671
|
const documentCount = manager.countDocuments();
|
|
@@ -679,11 +680,13 @@ async function captureCheckpoint(indexState, manager, vectorIndexes, wholePartit
|
|
|
679
680
|
snapshotCheckpointFor(priorCheckpointThatLimitsTheRecords, partitionId) + LOG_RECORDS_PER_CHECKPOINT
|
|
680
681
|
);
|
|
681
682
|
recordsLeftInLog += appliedSeqNo - lastSeqNo;
|
|
682
|
-
|
|
683
|
+
const target = {
|
|
683
684
|
partitionId,
|
|
684
685
|
lastSeqNo,
|
|
685
686
|
primaryTerm: partition?.seqOwner.primaryTerm ?? SINGLE_NODE_PRIMARY_TERM
|
|
686
|
-
}
|
|
687
|
+
};
|
|
688
|
+
if (termHistoryOf !== void 0) target.termHistory = termHistoryOf(partitionId, lastSeqNo);
|
|
689
|
+
targets.push(target);
|
|
687
690
|
}
|
|
688
691
|
const vectorPlans = /* @__PURE__ */ new Map();
|
|
689
692
|
for (const [fieldPath, vectorIndex] of vectorIndexes) {
|
|
@@ -889,13 +892,15 @@ function workerCanWriteEverySegment(input) {
|
|
|
889
892
|
}
|
|
890
893
|
async function writeIndexCheckpointSegments(input) {
|
|
891
894
|
const { directory, metadata, targets, compactionThreshold, prior, wholePartitions, capturedPartitions } = input;
|
|
895
|
+
const { keepsWriteRecords } = input;
|
|
892
896
|
const offloaded = workerCanWriteEverySegment(input) ? await runCheckpointOnWorker({
|
|
893
897
|
root: directory.root,
|
|
894
898
|
metadata,
|
|
895
899
|
targets,
|
|
896
900
|
compactionThreshold,
|
|
897
901
|
prior,
|
|
898
|
-
capturedPartitions: [...capturedPartitions]
|
|
902
|
+
capturedPartitions: [...capturedPartitions],
|
|
903
|
+
keepsWriteRecords
|
|
899
904
|
}) : null;
|
|
900
905
|
if (offloaded !== null) {
|
|
901
906
|
return offloaded;
|
|
@@ -908,7 +913,8 @@ async function writeIndexCheckpointSegments(input) {
|
|
|
908
913
|
compactionThreshold,
|
|
909
914
|
prior,
|
|
910
915
|
wholePartitions,
|
|
911
|
-
capturedPartitions
|
|
916
|
+
capturedPartitions,
|
|
917
|
+
keepsWriteRecords
|
|
912
918
|
});
|
|
913
919
|
}
|
|
914
920
|
|
|
@@ -1013,6 +1019,8 @@ async function writeOneBoundedCheckpoint(input) {
|
|
|
1013
1019
|
}
|
|
1014
1020
|
const vectorIndexes = input.hooks.getVectorIndexes(input.indexName);
|
|
1015
1021
|
const store = directoryCheckpointStore(input.directory);
|
|
1022
|
+
const writeRecords = input.hooks.writeRecords ?? null;
|
|
1023
|
+
const { indexName } = input;
|
|
1016
1024
|
const priorManifest = await readCurrentManifest(store, input.indexName);
|
|
1017
1025
|
const capture2 = await captureCheckpoint(
|
|
1018
1026
|
input.indexState,
|
|
@@ -1022,10 +1030,14 @@ async function writeOneBoundedCheckpoint(input) {
|
|
|
1022
1030
|
priorCheckpoint: priorManifest?.checkpoint ?? [],
|
|
1023
1031
|
priorPartitionIds: (priorManifest?.partitions ?? []).map((partition) => partition.partitionId),
|
|
1024
1032
|
everyPartition: input.fromMemory,
|
|
1025
|
-
aWorkerCanSerialise: input.canOffload && checkpointWorkerIsUsable()
|
|
1033
|
+
aWorkerCanSerialise: input.canOffload && checkpointWorkerIsUsable(),
|
|
1034
|
+
...writeRecords === null ? {} : {
|
|
1035
|
+
captureRecords: (partitionId) => (segments2) => writeRecords.captureSegments(indexName, partitionId, segments2)
|
|
1036
|
+
}
|
|
1026
1037
|
}),
|
|
1027
1038
|
input.fromMemory ? void 0 : priorManifest?.checkpoint ?? [],
|
|
1028
|
-
priorManifest?.vectors ?? []
|
|
1039
|
+
priorManifest?.vectors ?? [],
|
|
1040
|
+
writeRecords === null ? void 0 : (partitionId, lastSeqNo) => writeRecords.termHistoryOf(indexName, partitionId, lastSeqNo)
|
|
1029
1041
|
);
|
|
1030
1042
|
const { targets, documentCount } = capture2;
|
|
1031
1043
|
await makeEveryAppliedMutationDurable(input.indexState, input.failPartition);
|
|
@@ -1040,7 +1052,8 @@ async function writeOneBoundedCheckpoint(input) {
|
|
|
1040
1052
|
canOffload: input.canOffload,
|
|
1041
1053
|
prior: priorManifest,
|
|
1042
1054
|
wholePartitions: capture2.wholePartitions.contents,
|
|
1043
|
-
capturedPartitions: capture2.wholePartitions.captured
|
|
1055
|
+
capturedPartitions: capture2.wholePartitions.captured,
|
|
1056
|
+
keepsWriteRecords: writeRecords !== null
|
|
1044
1057
|
})
|
|
1045
1058
|
);
|
|
1046
1059
|
await makeEveryAppliedMutationDurable(input.indexState, input.failPartition);
|
|
@@ -2436,7 +2449,8 @@ async function recoverCheckpoint(deps) {
|
|
|
2436
2449
|
}
|
|
2437
2450
|
const checkpoint = await loadSegmentedCheckpoint(deps.store, deps.indexName, decoded.manifest, {
|
|
2438
2451
|
manager: deps.manager,
|
|
2439
|
-
vectorIndexes: deps.vectorIndexes
|
|
2452
|
+
vectorIndexes: deps.vectorIndexes,
|
|
2453
|
+
writeRecords: deps.writeRecords ?? null
|
|
2440
2454
|
});
|
|
2441
2455
|
return { checkpoint: await deps.replay(checkpoint), upgradedDocumentCount: null };
|
|
2442
2456
|
}
|
|
@@ -2476,15 +2490,23 @@ async function recoverPersistedIndex(deps, indexName, metadataOnly) {
|
|
|
2476
2490
|
if (manager === void 0 || current === void 0) {
|
|
2477
2491
|
return;
|
|
2478
2492
|
}
|
|
2493
|
+
const writeRecords = hooks.writeRecords ?? null;
|
|
2494
|
+
writeRecords?.dropIndex(indexName);
|
|
2479
2495
|
const replayDeps = {
|
|
2480
2496
|
manager,
|
|
2481
2497
|
vectorFieldPaths: hooks.getVectorFieldPaths(indexName),
|
|
2482
|
-
vectorIndexes: hooks.getVectorIndexes(indexName)
|
|
2498
|
+
vectorIndexes: hooks.getVectorIndexes(indexName),
|
|
2499
|
+
writeRecords
|
|
2483
2500
|
};
|
|
2484
2501
|
const replay = async (checkpoint) => {
|
|
2485
2502
|
const replayed = [];
|
|
2486
2503
|
for (let partitionId = 0; partitionId < manager.partitionCount; partitionId += 1) {
|
|
2487
2504
|
const fromSeqNo = snapshotCheckpointFor(checkpoint, partitionId);
|
|
2505
|
+
writeRecords?.loadTermHistory(
|
|
2506
|
+
indexName,
|
|
2507
|
+
partitionId,
|
|
2508
|
+
checkpoint.find((entry) => entry.partitionId === partitionId)
|
|
2509
|
+
);
|
|
2488
2510
|
const { highestSeqNo, highestPrimaryTerm } = await replayWal(
|
|
2489
2511
|
directory,
|
|
2490
2512
|
indexName,
|
|
@@ -2511,7 +2533,8 @@ async function recoverPersistedIndex(deps, indexName, metadataOnly) {
|
|
|
2511
2533
|
compactionThreshold: deps.compactionThreshold,
|
|
2512
2534
|
keepsUnlistedFiles: deps.holdsCheckpointFiles(indexName),
|
|
2513
2535
|
replay,
|
|
2514
|
-
onLayoutUpgrade: hooks.onLayoutUpgrade
|
|
2536
|
+
onLayoutUpgrade: hooks.onLayoutUpgrade,
|
|
2537
|
+
writeRecords
|
|
2515
2538
|
});
|
|
2516
2539
|
for (const { partitionId, lastSeqNo, primaryTerm } of recovered.checkpoint) {
|
|
2517
2540
|
deps.registerPartition(indexName, partitionId, lastSeqNo, primaryTerm);
|
|
@@ -2737,6 +2760,9 @@ function createDurabilityManager(config, hooks, directoryOverride) {
|
|
|
2737
2760
|
commitDeferral = defersCommit ?? null;
|
|
2738
2761
|
},
|
|
2739
2762
|
isolatePartitionFailures: partitionFailures.isolate,
|
|
2763
|
+
keepWriteRecordsWith(keeper) {
|
|
2764
|
+
hooks.writeRecords = keeper;
|
|
2765
|
+
},
|
|
2740
2766
|
heldCheckpoints: () => heldCheckpoints.report(indexes),
|
|
2741
2767
|
async commitPartition(indexName, partitionId) {
|
|
2742
2768
|
const partition = indexes.get(indexName)?.partitions.get(partitionId);
|
|
@@ -2780,6 +2806,7 @@ function createDurabilityManager(config, hooks, directoryOverride) {
|
|
|
2780
2806
|
}
|
|
2781
2807
|
},
|
|
2782
2808
|
async removeIndex(indexName) {
|
|
2809
|
+
hooks.writeRecords?.dropIndex(indexName);
|
|
2783
2810
|
const indexState = indexes.get(indexName);
|
|
2784
2811
|
if (indexState !== void 0) {
|
|
2785
2812
|
await drainIndexStateForUnload(indexState, metadataWrites.get(indexName), closeWriterReportingFailure);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { resolveApiKey, buildSignal, postJsonWithRetry } from '../chunk-
|
|
2
|
-
import { NarsilError, ErrorCodes } from '../chunk-
|
|
1
|
+
import { resolveApiKey, buildSignal, postJsonWithRetry } from '../chunk-7ZZQNOIY.mjs';
|
|
2
|
+
import { NarsilError, ErrorCodes } from '../chunk-OBWUWZRA.mjs';
|
|
3
3
|
|
|
4
4
|
// src/embeddings/constants.ts
|
|
5
5
|
var DEFAULT_REQUEST_TIMEOUT_MS = 3e4;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { E as EmbeddingAdapter, R as RerankAdapter } from './adapters-BQFQ4PRz.js';
|
|
2
|
-
import { B as BatchResult, I as IndexInfo, k as IndexStats, l as PartitionStatsResult, L as ListParams, g as ListResult, Q as QueryParams, e as QueryResult, P as PreflightResult, h as SuggestParams, j as SuggestResult, D as DocumentImportResult, M as MemoryStats, V as VectorMaintenanceResult, m as NarsilEventMap } from './events-
|
|
2
|
+
import { B as BatchResult, I as IndexInfo, k as IndexStats, l as PartitionStatsResult, L as ListParams, g as ListResult, Q as QueryParams, e as QueryResult, P as PreflightResult, h as SuggestParams, j as SuggestResult, D as DocumentImportResult, M as MemoryStats, V as VectorMaintenanceResult, m as NarsilEventMap } from './events-CJsXF1F9.js';
|
|
3
3
|
import { A as AnyDocument, a as InsertOptions, W as WriteOptions, I as IndexConfig, P as PartitionConfig } from './schema-4W_7tk1f.js';
|
|
4
4
|
import { a as SynonymRule } from './synonyms-CpOAHPa-.js';
|
|
5
5
|
|
|
@@ -59,6 +59,7 @@ declare const ErrorCodes: {
|
|
|
59
59
|
readonly QUERY_PARTIAL_FAILURE: "QUERY_PARTIAL_FAILURE";
|
|
60
60
|
readonly QUERY_NODE_TIMEOUT: "QUERY_NODE_TIMEOUT";
|
|
61
61
|
readonly QUERY_NO_ACTIVE_REPLICA: "QUERY_NO_ACTIVE_REPLICA";
|
|
62
|
+
readonly SEARCH_CONTEXT_MISSING: "SEARCH_CONTEXT_MISSING";
|
|
62
63
|
readonly CLUSTER_OPERATION_UNSUPPORTED: "CLUSTER_OPERATION_UNSUPPORTED";
|
|
63
64
|
readonly CLUSTER_WRITE_BLOCKED: "CLUSTER_WRITE_BLOCKED";
|
|
64
65
|
readonly ALLOCATION_NO_DATA_NODES: "ALLOCATION_NO_DATA_NODES";
|
|
@@ -79,6 +80,7 @@ declare const ErrorCodes: {
|
|
|
79
80
|
readonly REPLICATION_INSYNC_REMOVAL_FAILED: "REPLICATION_INSYNC_REMOVAL_FAILED";
|
|
80
81
|
readonly REPLICATION_ROLLBACK_FAILED: "REPLICATION_ROLLBACK_FAILED";
|
|
81
82
|
readonly REPLICATION_OUTCOME_UNKNOWN: "REPLICATION_OUTCOME_UNKNOWN";
|
|
83
|
+
readonly REPLICATION_WRITE_CONFLICT: "REPLICATION_WRITE_CONFLICT";
|
|
82
84
|
readonly REPLICATION_LOG_FULL: "REPLICATION_LOG_FULL";
|
|
83
85
|
readonly REPLICATION_ENTRY_CORRUPT: "REPLICATION_ENTRY_CORRUPT";
|
|
84
86
|
readonly REPLICATION_SNAPSHOT_CORRUPT: "REPLICATION_SNAPSHOT_CORRUPT";
|
package/dist/index.browser.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { VERSION, clearNormalizationCache, configureNormalizationCache, createNarsil, getLanguage, getNormalizationCacheSize, getStopWords, getTokenizer, hasStopWords, hasTokenizer, registerLanguage, registerPartialWordSearch, registerPatternSearch, registerStopWords, registerSynonyms, registerTokenizer, resetNormalizationCache } from './browser/chunk-
|
|
2
|
-
export { isSimdAvailable } from './browser/chunk-
|
|
1
|
+
export { VERSION, clearNormalizationCache, configureNormalizationCache, createNarsil, getLanguage, getNormalizationCacheSize, getStopWords, getTokenizer, hasStopWords, hasTokenizer, registerLanguage, registerPartialWordSearch, registerPatternSearch, registerStopWords, registerSynonyms, registerTokenizer, resetNormalizationCache } from './browser/chunk-HQOYKRMB.mjs';
|
|
2
|
+
export { isSimdAvailable } from './browser/chunk-2CBQ2PCC.mjs';
|
|
3
3
|
import './browser/chunk-JPTQZWJQ.mjs';
|
|
4
|
-
export { ClientErrorCodes, ErrorCodes, NarsilError, ServerErrorCodes, isNarsilError } from './browser/chunk-
|
|
4
|
+
export { ClientErrorCodes, ErrorCodes, NarsilError, ServerErrorCodes, isNarsilError } from './browser/chunk-LJS6PREA.mjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -6,11 +6,11 @@ import { S as SynonymSearch } from './synonyms-CpOAHPa-.js';
|
|
|
6
6
|
export { O as OneWaySynonymRule, a as SynonymRule, T as TwoWaySynonymRule } from './synonyms-CpOAHPa-.js';
|
|
7
7
|
import { L as LanguageModule } from './language-DB8KG1z5.js';
|
|
8
8
|
export { T as TokenizerConfig } from './language-DB8KG1z5.js';
|
|
9
|
-
export { A as ArrayFilter, B as BatchResult, C as ClientErrorCode, a as ClientErrorCodes, n as ComparisonFilter, D as DocumentImportResult, o as DocumentProjection, E as ErrorCode, b as ErrorCodes, F as FacetConfig, p as FacetResult, q as FieldFilter, r as FilterExpression, G as GeoFilter, s as GeoPolygonFilter, t as GeoRadiusFilter, u as GroupConfig, v as GroupReducer, w as GroupResult, H as HeldCheckpointReport, x as HighlightConfig, y as HighlightMatch, z as Hit, J as HybridConfig, I as IndexInfo, k as IndexStats, L as ListParams, g as ListResult, K as ListedDocument, M as MemoryStats, N as NarsilError, c as NarsilErrorCode, f as NarsilEventHandlers, m as NarsilEventMap, l as PartitionStatsResult, P as PreflightResult, O as PresenceFilter, R as ProcessMemoryReport, T as QueryCoverage, Q as QueryParams, e as QueryResult, U as RerankConfig, W as ScoreComponents, X as SearchMode, S as ServerErrorCode, d as ServerErrorCodes, Y as SortField, Z as SortSpec, _ as StringFilter, h as SuggestParams, j as SuggestResult, $ as TermMatchPolicy, V as VectorMaintenanceResult, a0 as VectorQueryConfig, a1 as WorkerCopyReport, i as isNarsilError } from './events-
|
|
10
|
-
import { N as NarsilConfig } from './config-
|
|
11
|
-
export { A as AnalysisConfig, D as DurabilityConfig, I as IndexContext, a as IndexLifecycleConfig, b as InsertContext, M as MainCopyQueries, c as NarsilPlugin, P as PartitionContext, R as RemoveContext, S as SearchContext, d as StaleAnalysis, U as UpdateContext, W as WorkerConfig, e as WorkerContext } from './config-
|
|
12
|
-
import { N as Narsil } from './engine-
|
|
13
|
-
export { A as AdapterRegistrationOperations, B as ByteSource, D as DocumentWriteOperations, I as IndexLifecycleOperations, S as SynonymOperations } from './engine-
|
|
9
|
+
export { A as ArrayFilter, B as BatchResult, C as ClientErrorCode, a as ClientErrorCodes, n as ComparisonFilter, D as DocumentImportResult, o as DocumentProjection, E as ErrorCode, b as ErrorCodes, F as FacetConfig, p as FacetResult, q as FieldFilter, r as FilterExpression, G as GeoFilter, s as GeoPolygonFilter, t as GeoRadiusFilter, u as GroupConfig, v as GroupReducer, w as GroupResult, H as HeldCheckpointReport, x as HighlightConfig, y as HighlightMatch, z as Hit, J as HybridConfig, I as IndexInfo, k as IndexStats, L as ListParams, g as ListResult, K as ListedDocument, M as MemoryStats, N as NarsilError, c as NarsilErrorCode, f as NarsilEventHandlers, m as NarsilEventMap, l as PartitionStatsResult, P as PreflightResult, O as PresenceFilter, R as ProcessMemoryReport, T as QueryCoverage, Q as QueryParams, e as QueryResult, U as RerankConfig, W as ScoreComponents, X as SearchMode, S as ServerErrorCode, d as ServerErrorCodes, Y as SortField, Z as SortSpec, _ as StringFilter, h as SuggestParams, j as SuggestResult, $ as TermMatchPolicy, V as VectorMaintenanceResult, a0 as VectorQueryConfig, a1 as WorkerCopyReport, i as isNarsilError } from './events-CJsXF1F9.js';
|
|
10
|
+
import { N as NarsilConfig } from './config-CSgvApt0.js';
|
|
11
|
+
export { A as AnalysisConfig, D as DurabilityConfig, I as IndexContext, a as IndexLifecycleConfig, b as InsertContext, M as MainCopyQueries, c as NarsilPlugin, P as PartitionContext, R as RemoveContext, S as SearchContext, d as StaleAnalysis, U as UpdateContext, W as WorkerConfig, e as WorkerContext } from './config-CSgvApt0.js';
|
|
12
|
+
import { N as Narsil } from './engine-C_HSy3iz.js';
|
|
13
|
+
export { A as AdapterRegistrationOperations, B as ByteSource, D as DocumentWriteOperations, I as IndexLifecycleOperations, S as SynonymOperations } from './engine-C_HSy3iz.js';
|
|
14
14
|
export { E as EmbeddingAdapter, I as InvalidationAdapter, a as InvalidationEvent, b as PartitionStatistics, P as PersistenceAdapter, R as RerankAdapter } from './adapters-BQFQ4PRz.js';
|
|
15
15
|
|
|
16
16
|
/**
|
package/dist/index.mjs
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
export { VERSION, createNarsil } from './chunk-
|
|
2
|
-
import './chunk-
|
|
3
|
-
import './chunk-
|
|
4
|
-
import './chunk-
|
|
1
|
+
export { VERSION, createNarsil } from './chunk-IW6UR3AF.mjs';
|
|
2
|
+
import './chunk-UGKO3RG2.mjs';
|
|
3
|
+
import './chunk-N57XXGPG.mjs';
|
|
4
|
+
import './chunk-6PN3U6XW.mjs';
|
|
5
5
|
import './chunk-AV4IJKD2.mjs';
|
|
6
|
-
export { registerSynonyms } from './chunk-
|
|
7
|
-
export { registerPartialWordSearch, registerPatternSearch } from './chunk-
|
|
8
|
-
export { getLanguage, registerLanguage } from './chunk-
|
|
9
|
-
import './chunk-
|
|
6
|
+
export { registerSynonyms } from './chunk-R2MRMH6M.mjs';
|
|
7
|
+
export { registerPartialWordSearch, registerPatternSearch } from './chunk-7JOONQ24.mjs';
|
|
8
|
+
export { getLanguage, registerLanguage } from './chunk-FUUP45IS.mjs';
|
|
9
|
+
import './chunk-SOADQINJ.mjs';
|
|
10
10
|
import './chunk-HJSN7UYG.mjs';
|
|
11
11
|
import './chunk-LXWDQLTW.mjs';
|
|
12
12
|
import './chunk-TGP5M5R7.mjs';
|
|
13
13
|
import './chunk-U2BKYEC7.mjs';
|
|
14
14
|
export { isSimdAvailable } from './chunk-KOKM4PQN.mjs';
|
|
15
15
|
import './chunk-QSK35UC2.mjs';
|
|
16
|
-
import './chunk-
|
|
17
|
-
import './chunk-
|
|
16
|
+
import './chunk-VK45J47R.mjs';
|
|
17
|
+
import './chunk-HNAP2KTG.mjs';
|
|
18
18
|
import './chunk-WQBCBKY3.mjs';
|
|
19
|
-
import './chunk-
|
|
20
|
-
import './chunk-
|
|
19
|
+
import './chunk-KCQG2PJT.mjs';
|
|
20
|
+
import './chunk-DG62H7OD.mjs';
|
|
21
21
|
import './chunk-U476IXKQ.mjs';
|
|
22
22
|
import './chunk-E74YLAIG.mjs';
|
|
23
23
|
import './chunk-VJS4JFBQ.mjs';
|
|
24
24
|
import './chunk-GES7U2PM.mjs';
|
|
25
|
-
import './chunk-
|
|
26
|
-
export { getStopWords, getTokenizer, hasStopWords, hasTokenizer, registerStopWords, registerTokenizer } from './chunk-
|
|
25
|
+
import './chunk-6ODIY6ZB.mjs';
|
|
26
|
+
export { getStopWords, getTokenizer, hasStopWords, hasTokenizer, registerStopWords, registerTokenizer } from './chunk-IR4KQ4WB.mjs';
|
|
27
27
|
import './chunk-X5CV2E2B.mjs';
|
|
28
28
|
import './chunk-7X5JST5L.mjs';
|
|
29
|
-
export { clearNormalizationCache, configureNormalizationCache, getNormalizationCacheSize, resetNormalizationCache } from './chunk-
|
|
29
|
+
export { clearNormalizationCache, configureNormalizationCache, getNormalizationCacheSize, resetNormalizationCache } from './chunk-OFYKBKKV.mjs';
|
|
30
30
|
import './chunk-R6A773WK.mjs';
|
|
31
31
|
import './chunk-YTJCGKM4.mjs';
|
|
32
32
|
import './chunk-CQUMNIIG.mjs';
|
|
33
|
-
import './chunk-
|
|
33
|
+
import './chunk-QI6JW4PM.mjs';
|
|
34
34
|
import './chunk-ZXZ26WSO.mjs';
|
|
35
35
|
import './chunk-RFBLQLLZ.mjs';
|
|
36
36
|
import './chunk-L5ORED7V.mjs';
|
|
37
|
-
export { ClientErrorCodes, ErrorCodes, NarsilError, ServerErrorCodes, isNarsilError } from './chunk-
|
|
37
|
+
export { ClientErrorCodes, ErrorCodes, NarsilError, ServerErrorCodes, isNarsilError } from './chunk-OBWUWZRA.mjs';
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { VECTOR_WORKER_COPIES_ALLOWED, DEFAULT_PROMOTION_THRESHOLD, DEFAULT_FILTER_THRESHOLD, noBuildHistory, recordCheckpoint, planCheckpoint, deserialize, assignStorePartitions, liveSize, ordinalFilterForSubsets, handOverBuildTurns, threadsHoldCurrentLayout, filterForOptions, OSQ4_MIN_DIMENSION, emptyFieldBeforeRestore, ESTIMATED_MS_PER_TOMBSTONE, graphNeedsRebuild, ESTIMATED_MS_PER_VECTOR_REBUILD, releaseReplacedVectors, yieldBuildTurn, WORKER_COPY_MIN_VECTORS, allLiveDocIds, recalibrateFromStore, signatureOf, adoptGraph, BUILD_RETRY_MAX_DELAY_MS, BUILD_RETRY_FIRST_DELAY_MS, fieldHandlesOf, liveOrdinals, RECALIBRATION_CHUNK_VECTORS, BUILD_CHUNK_SIZE, DRIFT_CHECK_GROWTH_FACTOR, DISK_ADOPTION_YIELD_INTERVAL, adoptLoadedCalibration, RECALIBRATION_DRIFT_RATIO } from './chunk-
|
|
2
|
-
import { isDead, NO_LIVE_VECTOR_AT_POSITION, bytesToVectors } from './chunk-
|
|
3
|
-
import { createVectorStore } from './chunk-
|
|
4
|
-
export { openSharedVectorField } from './chunk-
|
|
5
|
-
import { osqBitsOf, createOsqQuantizer, STORE_ORDINAL_LAYOUT_GENERATION, ordinalFilterValues, STORE_UNPLACED_COUNT, STORE_LIVE_COUNT, STORE_REMOVED_COUNT, createOrdinalFilter, addToOrdinalFilter, nativeScoresOf, toScore, ordinalFilterHas, magnitude, nativeStoreScratchBytes, toDistance, euclideanDistance, dotProduct, cosineSimilarityWithMagnitudes, createHNSWIndex, topLayerInParts, sharedMemoryAvailable, requireWholeNeighbourLists, shuffleInPlace, createCentroidSums, centroidOfCentroidSums, meanOfCentroidSums, countOfCentroidSums, squaredLengthsOfCentroidSums, releaseLocksHeldBy } from './chunk-
|
|
6
|
-
export { releaseLocksHeldBy } from './chunk-
|
|
1
|
+
import { VECTOR_WORKER_COPIES_ALLOWED, DEFAULT_PROMOTION_THRESHOLD, DEFAULT_FILTER_THRESHOLD, noBuildHistory, recordCheckpoint, planCheckpoint, deserialize, assignStorePartitions, liveSize, ordinalFilterForSubsets, handOverBuildTurns, threadsHoldCurrentLayout, filterForOptions, OSQ4_MIN_DIMENSION, emptyFieldBeforeRestore, ESTIMATED_MS_PER_TOMBSTONE, graphNeedsRebuild, ESTIMATED_MS_PER_VECTOR_REBUILD, releaseReplacedVectors, yieldBuildTurn, WORKER_COPY_MIN_VECTORS, allLiveDocIds, recalibrateFromStore, signatureOf, adoptGraph, BUILD_RETRY_MAX_DELAY_MS, BUILD_RETRY_FIRST_DELAY_MS, fieldHandlesOf, liveOrdinals, RECALIBRATION_CHUNK_VECTORS, BUILD_CHUNK_SIZE, DRIFT_CHECK_GROWTH_FACTOR, DISK_ADOPTION_YIELD_INTERVAL, adoptLoadedCalibration, RECALIBRATION_DRIFT_RATIO } from './chunk-PT7VRWS7.mjs';
|
|
2
|
+
import { isDead, NO_LIVE_VECTOR_AT_POSITION, bytesToVectors } from './chunk-OCB7TMUQ.mjs';
|
|
3
|
+
import { createVectorStore } from './chunk-R2MRGYU5.mjs';
|
|
4
|
+
export { openSharedVectorField } from './chunk-R2MRGYU5.mjs';
|
|
5
|
+
import { osqBitsOf, createOsqQuantizer, STORE_ORDINAL_LAYOUT_GENERATION, ordinalFilterValues, STORE_UNPLACED_COUNT, STORE_LIVE_COUNT, STORE_REMOVED_COUNT, createOrdinalFilter, addToOrdinalFilter, nativeScoresOf, toScore, ordinalFilterHas, magnitude, nativeStoreScratchBytes, toDistance, euclideanDistance, dotProduct, cosineSimilarityWithMagnitudes, createHNSWIndex, topLayerInParts, sharedMemoryAvailable, requireWholeNeighbourLists, shuffleInPlace, createCentroidSums, centroidOfCentroidSums, meanOfCentroidSums, countOfCentroidSums, squaredLengthsOfCentroidSums, releaseLocksHeldBy } from './chunk-YIDSHBQS.mjs';
|
|
6
|
+
export { releaseLocksHeldBy } from './chunk-YIDSHBQS.mjs';
|
|
7
7
|
import { noteFallback } from './chunk-DJHHF2L5.mjs';
|
|
8
8
|
import './chunk-37CD3OKS.mjs';
|
|
9
9
|
import { spawnNodeWorker } from './chunk-C7SLA6CM.mjs';
|
|
10
|
-
import { resolveWorkerCount, resolveWorkerEntry, workerResourceLimits } from './chunk-
|
|
10
|
+
import { resolveWorkerCount, resolveWorkerEntry, workerResourceLimits } from './chunk-6PN3U6XW.mjs';
|
|
11
11
|
import { detectRuntime } from './chunk-AV4IJKD2.mjs';
|
|
12
12
|
import './chunk-LXWDQLTW.mjs';
|
|
13
13
|
import './chunk-KOKM4PQN.mjs';
|
|
14
14
|
import { MAX_RENUMBERED_SEARCH_ATTEMPTS, DISK_STORAGE_BLOCK_BYTES, UNPLACED_FLAG_CHUNK_ORDINALS, GRAPH_BUILD_CHUNKS_IN_FLIGHT_PER_WORKER, GRAPH_BUILD_DISPATCH_CHUNK, VECTOR_SEARCH_TIMEOUT_MS, VECTOR_SEARCH_LOAD_TIMEOUT_MS, VECTOR_SCRATCH_SLOTS, VECTOR_INSERT_TIMEOUT_MS } from './chunk-QSK35UC2.mjs';
|
|
15
|
-
import './chunk-
|
|
15
|
+
import './chunk-VK45J47R.mjs';
|
|
16
16
|
import './chunk-U476IXKQ.mjs';
|
|
17
17
|
import './chunk-E74YLAIG.mjs';
|
|
18
18
|
import './chunk-VJS4JFBQ.mjs';
|
|
19
19
|
import './chunk-R6A773WK.mjs';
|
|
20
20
|
import { compareCodePoints } from './chunk-YTJCGKM4.mjs';
|
|
21
21
|
import { noteThreadSlotLive, noteThreadSlotGone } from './chunk-RFBLQLLZ.mjs';
|
|
22
|
-
import { NarsilError, ErrorCodes, isNarsilError } from './chunk-
|
|
22
|
+
import { NarsilError, ErrorCodes, isNarsilError } from './chunk-OBWUWZRA.mjs';
|
|
23
23
|
|
|
24
24
|
// src/core/heap.ts
|
|
25
25
|
function createMaxHeap(compare) {
|
package/dist/partial-words.mjs
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { partialWordSearchModule } from './chunk-
|
|
2
|
-
import './chunk-
|
|
1
|
+
import { partialWordSearchModule } from './chunk-KCQG2PJT.mjs';
|
|
2
|
+
import './chunk-DG62H7OD.mjs';
|
|
3
3
|
import './chunk-U476IXKQ.mjs';
|
|
4
4
|
import './chunk-E74YLAIG.mjs';
|
|
5
5
|
import './chunk-VJS4JFBQ.mjs';
|
|
6
6
|
import './chunk-GES7U2PM.mjs';
|
|
7
|
-
import './chunk-
|
|
8
|
-
import './chunk-
|
|
7
|
+
import './chunk-6ODIY6ZB.mjs';
|
|
8
|
+
import './chunk-OFYKBKKV.mjs';
|
|
9
9
|
import './chunk-R6A773WK.mjs';
|
|
10
10
|
import './chunk-YTJCGKM4.mjs';
|
|
11
11
|
import './chunk-L5ORED7V.mjs';
|
|
12
|
-
import './chunk-
|
|
12
|
+
import './chunk-OBWUWZRA.mjs';
|
|
13
13
|
|
|
14
14
|
// src/partial-words/index.ts
|
|
15
15
|
var partialWordSearch = partialWordSearchModule;
|
package/dist/pattern.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { patternSearchModule } from './chunk-
|
|
1
|
+
import { patternSearchModule } from './chunk-HNAP2KTG.mjs';
|
|
2
2
|
import './chunk-WQBCBKY3.mjs';
|
|
3
3
|
import './chunk-GES7U2PM.mjs';
|
|
4
|
-
import './chunk-
|
|
4
|
+
import './chunk-6ODIY6ZB.mjs';
|
|
5
5
|
import './chunk-YTJCGKM4.mjs';
|
|
6
6
|
import './chunk-L5ORED7V.mjs';
|
|
7
|
-
import './chunk-
|
|
7
|
+
import './chunk-OBWUWZRA.mjs';
|
|
8
8
|
|
|
9
9
|
// src/pattern/index.ts
|
|
10
10
|
var patternSearch = patternSearchModule;
|
|
@@ -133,10 +133,20 @@ interface SharedSegmentSnapshot extends Omit<SegmentColumns, 'surfaceForms'> {
|
|
|
133
133
|
partialWords: PartialWordTableData | null;
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
+
interface SegmentWriteRecords {
|
|
137
|
+
seqNos: Float64Array;
|
|
138
|
+
primaryTerms: Float64Array;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
interface TermStart {
|
|
142
|
+
primaryTerm: number;
|
|
143
|
+
firstSeqNo: number;
|
|
144
|
+
}
|
|
136
145
|
interface PartitionCheckpoint {
|
|
137
146
|
partitionId: number;
|
|
138
147
|
lastSeqNo: number;
|
|
139
148
|
primaryTerm: number;
|
|
149
|
+
termHistory?: TermStart[];
|
|
140
150
|
}
|
|
141
151
|
|
|
142
152
|
interface FileRef {
|
|
@@ -210,6 +220,7 @@ type SerializedSurfaceForms = Record<string, number | [number, string]>;
|
|
|
210
220
|
interface CapturedSegment {
|
|
211
221
|
snapshot: SharedSegmentSnapshot;
|
|
212
222
|
keep: Uint8Array;
|
|
223
|
+
writeRecords?: SegmentWriteRecords;
|
|
213
224
|
}
|
|
214
225
|
interface CapturedWholePartition {
|
|
215
226
|
partitionId: number;
|
|
@@ -233,6 +244,7 @@ interface CheckpointWorkerRequest {
|
|
|
233
244
|
compactionThreshold: number;
|
|
234
245
|
prior: PriorCheckpoint | null;
|
|
235
246
|
capturedPartitions?: CapturedWholePartition[];
|
|
247
|
+
keepsWriteRecords?: boolean;
|
|
236
248
|
}
|
|
237
249
|
interface CheckpointWorkerSuccess {
|
|
238
250
|
type: 'success';
|
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
import { createDurableDirectory } from '../../chunk-
|
|
1
|
+
import { createDurableDirectory } from '../../chunk-YLE75NQ5.mjs';
|
|
2
2
|
import '../../chunk-C7SLA6CM.mjs';
|
|
3
3
|
import '../../chunk-HLPRHOSO.mjs';
|
|
4
|
-
import { CHECKPOINT_WORKER_HEARTBEAT_MS, writeCheckpointSegments, directoryCheckpointStore } from '../../chunk-
|
|
5
|
-
import '../../chunk-
|
|
4
|
+
import { CHECKPOINT_WORKER_HEARTBEAT_MS, writeCheckpointSegments, directoryCheckpointStore } from '../../chunk-6S7YRUPQ.mjs';
|
|
5
|
+
import '../../chunk-PKE2PCTS.mjs';
|
|
6
6
|
import '../../chunk-P36MUFEJ.mjs';
|
|
7
|
-
import '../../chunk-
|
|
8
|
-
import '../../chunk-
|
|
9
|
-
import '../../chunk-
|
|
10
|
-
import '../../chunk-
|
|
11
|
-
import '../../chunk-
|
|
7
|
+
import '../../chunk-YH5OIL7B.mjs';
|
|
8
|
+
import '../../chunk-IW6UR3AF.mjs';
|
|
9
|
+
import '../../chunk-UGKO3RG2.mjs';
|
|
10
|
+
import '../../chunk-N57XXGPG.mjs';
|
|
11
|
+
import '../../chunk-6PN3U6XW.mjs';
|
|
12
12
|
import '../../chunk-AV4IJKD2.mjs';
|
|
13
|
-
import '../../chunk-
|
|
14
|
-
import '../../chunk-
|
|
15
|
-
import '../../chunk-
|
|
16
|
-
import '../../chunk-
|
|
13
|
+
import '../../chunk-R2MRMH6M.mjs';
|
|
14
|
+
import '../../chunk-7JOONQ24.mjs';
|
|
15
|
+
import '../../chunk-FUUP45IS.mjs';
|
|
16
|
+
import '../../chunk-SOADQINJ.mjs';
|
|
17
17
|
import '../../chunk-HJSN7UYG.mjs';
|
|
18
18
|
import '../../chunk-LXWDQLTW.mjs';
|
|
19
19
|
import '../../chunk-TGP5M5R7.mjs';
|
|
20
20
|
import '../../chunk-U2BKYEC7.mjs';
|
|
21
21
|
import '../../chunk-KOKM4PQN.mjs';
|
|
22
22
|
import '../../chunk-QSK35UC2.mjs';
|
|
23
|
-
import '../../chunk-
|
|
24
|
-
import '../../chunk-
|
|
23
|
+
import '../../chunk-VK45J47R.mjs';
|
|
24
|
+
import '../../chunk-HNAP2KTG.mjs';
|
|
25
25
|
import '../../chunk-WQBCBKY3.mjs';
|
|
26
|
-
import '../../chunk-
|
|
27
|
-
import '../../chunk-
|
|
26
|
+
import '../../chunk-KCQG2PJT.mjs';
|
|
27
|
+
import '../../chunk-DG62H7OD.mjs';
|
|
28
28
|
import '../../chunk-U476IXKQ.mjs';
|
|
29
29
|
import '../../chunk-E74YLAIG.mjs';
|
|
30
30
|
import '../../chunk-VJS4JFBQ.mjs';
|
|
31
31
|
import '../../chunk-GES7U2PM.mjs';
|
|
32
|
-
import '../../chunk-
|
|
33
|
-
import '../../chunk-
|
|
32
|
+
import '../../chunk-6ODIY6ZB.mjs';
|
|
33
|
+
import '../../chunk-IR4KQ4WB.mjs';
|
|
34
34
|
import '../../chunk-X5CV2E2B.mjs';
|
|
35
35
|
import '../../chunk-7X5JST5L.mjs';
|
|
36
|
-
import '../../chunk-
|
|
36
|
+
import '../../chunk-OFYKBKKV.mjs';
|
|
37
37
|
import '../../chunk-R6A773WK.mjs';
|
|
38
38
|
import '../../chunk-YTJCGKM4.mjs';
|
|
39
39
|
import '../../chunk-CQUMNIIG.mjs';
|
|
40
|
-
import '../../chunk-
|
|
40
|
+
import '../../chunk-QI6JW4PM.mjs';
|
|
41
41
|
import '../../chunk-ZXZ26WSO.mjs';
|
|
42
42
|
import '../../chunk-RFBLQLLZ.mjs';
|
|
43
43
|
import '../../chunk-L5ORED7V.mjs';
|
|
44
|
-
import '../../chunk-
|
|
44
|
+
import '../../chunk-OBWUWZRA.mjs';
|
|
45
45
|
|
|
46
46
|
// src/persistence/durability/rebuild.ts
|
|
47
|
-
async function rebuildSegmentsFromDurable(root, metadata, targets, compactionThreshold, prior, capturedPartitions = []) {
|
|
47
|
+
async function rebuildSegmentsFromDurable(root, metadata, targets, compactionThreshold, prior, capturedPartitions = [], keepsWriteRecords = false) {
|
|
48
48
|
const directory = createDurableDirectory(root);
|
|
49
49
|
return writeCheckpointSegments({
|
|
50
50
|
store: directoryCheckpointStore(directory),
|
|
@@ -53,7 +53,8 @@ async function rebuildSegmentsFromDurable(root, metadata, targets, compactionThr
|
|
|
53
53
|
targets,
|
|
54
54
|
compactionThreshold,
|
|
55
55
|
prior,
|
|
56
|
-
capturedPartitions
|
|
56
|
+
capturedPartitions,
|
|
57
|
+
keepsWriteRecords
|
|
57
58
|
});
|
|
58
59
|
}
|
|
59
60
|
|
|
@@ -81,7 +82,8 @@ async function handleRequest(raw) {
|
|
|
81
82
|
request.targets,
|
|
82
83
|
request.compactionThreshold,
|
|
83
84
|
request.prior ?? null,
|
|
84
|
-
request.capturedPartitions
|
|
85
|
+
request.capturedPartitions,
|
|
86
|
+
request.keepsWriteRecords === true
|
|
85
87
|
);
|
|
86
88
|
return { type: "success", segments };
|
|
87
89
|
}
|
package/dist/react.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { N as NarsilError, L as ListParams, g as ListResult, I as IndexInfo, k as IndexStats, Q as QueryParams, P as PreflightResult, e as QueryResult, h as SuggestParams, j as SuggestResult } from './events-
|
|
2
|
-
export { C as ClientErrorCode, a as ClientErrorCodes, E as ErrorCode, b as ErrorCodes, c as NarsilErrorCode, S as ServerErrorCode, d as ServerErrorCodes, i as isNarsilError } from './events-
|
|
3
|
-
import { e as TaskRecord, d as TaskProgress, b as ImportResult, c as TaskListQuery, T as TaskListPage } from './tasks-
|
|
4
|
-
export { I as ImportError, f as TaskStatus, g as TaskType } from './tasks-
|
|
1
|
+
import { N as NarsilError, L as ListParams, g as ListResult, I as IndexInfo, k as IndexStats, Q as QueryParams, P as PreflightResult, e as QueryResult, h as SuggestParams, j as SuggestResult } from './events-CJsXF1F9.js';
|
|
2
|
+
export { C as ClientErrorCode, a as ClientErrorCodes, E as ErrorCode, b as ErrorCodes, c as NarsilErrorCode, S as ServerErrorCode, d as ServerErrorCodes, i as isNarsilError } from './events-CJsXF1F9.js';
|
|
3
|
+
import { e as TaskRecord, d as TaskProgress, b as ImportResult, c as TaskListQuery, T as TaskListPage } from './tasks-CI3Fvkxw.js';
|
|
4
|
+
export { I as ImportError, f as TaskStatus, g as TaskType } from './tasks-CI3Fvkxw.js';
|
|
5
5
|
import { ReactNode, ReactElement } from 'react';
|
|
6
|
-
import { N as Narsil } from './engine-
|
|
7
|
-
import { N as NarsilClient, I as ImportSource } from './client-
|
|
6
|
+
import { N as Narsil } from './engine-C_HSy3iz.js';
|
|
7
|
+
import { N as NarsilClient, I as ImportSource } from './client-BdnzDFtO.js';
|
|
8
8
|
import { A as AnyDocument } from './schema-4W_7tk1f.js';
|
|
9
9
|
import './synonyms-CpOAHPa-.js';
|
|
10
10
|
import './adapters-BQFQ4PRz.js';
|
package/dist/react.mjs
CHANGED
|
@@ -51,6 +51,7 @@ var ErrorCodes = {
|
|
|
51
51
|
QUERY_PARTIAL_FAILURE: "QUERY_PARTIAL_FAILURE",
|
|
52
52
|
QUERY_NODE_TIMEOUT: "QUERY_NODE_TIMEOUT",
|
|
53
53
|
QUERY_NO_ACTIVE_REPLICA: "QUERY_NO_ACTIVE_REPLICA",
|
|
54
|
+
SEARCH_CONTEXT_MISSING: "SEARCH_CONTEXT_MISSING",
|
|
54
55
|
CLUSTER_OPERATION_UNSUPPORTED: "CLUSTER_OPERATION_UNSUPPORTED",
|
|
55
56
|
CLUSTER_WRITE_BLOCKED: "CLUSTER_WRITE_BLOCKED",
|
|
56
57
|
ALLOCATION_NO_DATA_NODES: "ALLOCATION_NO_DATA_NODES",
|
|
@@ -71,6 +72,7 @@ var ErrorCodes = {
|
|
|
71
72
|
REPLICATION_INSYNC_REMOVAL_FAILED: "REPLICATION_INSYNC_REMOVAL_FAILED",
|
|
72
73
|
REPLICATION_ROLLBACK_FAILED: "REPLICATION_ROLLBACK_FAILED",
|
|
73
74
|
REPLICATION_OUTCOME_UNKNOWN: "REPLICATION_OUTCOME_UNKNOWN",
|
|
75
|
+
REPLICATION_WRITE_CONFLICT: "REPLICATION_WRITE_CONFLICT",
|
|
74
76
|
REPLICATION_LOG_FULL: "REPLICATION_LOG_FULL",
|
|
75
77
|
REPLICATION_ENTRY_CORRUPT: "REPLICATION_ENTRY_CORRUPT",
|
|
76
78
|
REPLICATION_SNAPSHOT_CORRUPT: "REPLICATION_SNAPSHOT_CORRUPT",
|