@delali/narsil 0.3.1-next.112 → 0.3.1-next.115
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/browser/{chunk-UR5MNN53.mjs → chunk-2TMWIATH.mjs} +108 -67
- package/dist/browser/{chunk-OVY4RPDS.mjs → chunk-73U5DWOZ.mjs} +39 -4
- package/dist/browser/{chunk-O5IKTA27.mjs → chunk-FODCC3MK.mjs} +1 -1
- package/dist/browser/{chunk-YRYBTRWB.mjs → chunk-I45FAGOF.mjs} +2 -2
- package/dist/browser/{durability-wiring-CPEMDDK7.mjs → durability-wiring-CSMTKEYX.mjs} +3 -3
- package/dist/browser/{module-DYKR4INA.mjs → module-G2PPZV3B.mjs} +127 -33
- package/dist/browser/{restore-queue-2H4QDQV4.mjs → restore-queue-N7N42PBS.mjs} +1 -1
- package/dist/browser/{runtime-FL5K4JOH.mjs → runtime-BX6XRFYR.mjs} +2 -2
- package/dist/browser/{snapshot-ISZMBDCN.mjs → snapshot-EBH6RXQO.mjs} +6 -5
- package/dist/browser/{write-IABOLE4N.mjs → write-5ZKFINX3.mjs} +2 -2
- package/dist/{capabilities-ByaX8Arf.d.ts → capabilities-DOgB3pPf.d.ts} +2 -2
- package/dist/{chunk-ZXZ26WSO.mjs → chunk-22YPZVMG.mjs} +5 -1
- package/dist/{chunk-R2MRGYU5.mjs → chunk-4ZKBKPBV.mjs} +22 -2
- package/dist/{chunk-GLZI636G.mjs → chunk-5VVSHCXT.mjs} +27 -12
- package/dist/{chunk-3COL24MT.mjs → chunk-7EWQZQDT.mjs} +1 -1
- package/dist/{chunk-QI6JW4PM.mjs → chunk-BCNUJVTT.mjs} +1 -1
- package/dist/{chunk-3RRATITJ.mjs → chunk-BCSWODXP.mjs} +75 -55
- package/dist/{thread-WGBCVJII.mjs → chunk-DEXID4ZT.mjs} +301 -200
- package/dist/chunk-EBIHRL7B.mjs +21 -0
- package/dist/{chunk-YIDSHBQS.mjs → chunk-HC5NURS6.mjs} +33 -4
- package/dist/{chunk-V7G627TA.mjs → chunk-HFJXEFFV.mjs} +13 -62
- package/dist/{chunk-63HFWQEA.mjs → chunk-IE43SRL3.mjs} +276 -102
- package/dist/chunk-IWVEG5CX.mjs +67 -0
- package/dist/{chunk-2IFU7SXG.mjs → chunk-KGVC6KJ3.mjs} +4 -4
- package/dist/{chunk-7CI34JAP.mjs → chunk-KVLX65KD.mjs} +4 -4
- package/dist/{chunk-5WEBVYOA.mjs → chunk-N53HN5VA.mjs} +16 -9
- package/dist/chunk-N6J6EJW3.mjs +198 -0
- package/dist/{chunk-PT7VRWS7.mjs → chunk-NX7KU77V.mjs} +3 -2
- package/dist/{chunk-QIFOXLWF.mjs → chunk-OGFSUXYY.mjs} +2 -2
- package/dist/chunk-PELHVTO7.mjs +24 -0
- package/dist/{chunk-V7ISFBFC.mjs → chunk-Q62NDKEC.mjs} +5 -4
- package/dist/{chunk-6OXNHLNZ.mjs → chunk-RIIUZJQ3.mjs} +1 -1
- package/dist/{chunk-BVOUSX3U.mjs → chunk-UDZYIWDP.mjs} +3 -3
- package/dist/{chunk-HNAP2KTG.mjs → chunk-VFAXPDBH.mjs} +1 -0
- package/dist/{chunk-IBTKJIV7.mjs → chunk-VOKEYJHU.mjs} +1 -1
- package/dist/{chunk-C7SLA6CM.mjs → chunk-W55X2BYN.mjs} +5 -1
- package/dist/{chunk-IM76DLA7.mjs → chunk-YCFQ5754.mjs} +2 -2
- package/dist/{chunk-VLRT47GU.mjs → chunk-YCSRB3IN.mjs} +3 -3
- package/dist/{chunk-CQUMNIIG.mjs → chunk-Z4DZ4KK2.mjs} +1 -0
- package/dist/{chunk-SOADQINJ.mjs → chunk-ZATRDAYU.mjs} +31 -3
- package/dist/{chunk-2RAQKITH.mjs → chunk-ZR63OGT2.mjs} +1 -1
- package/dist/{client-BdnzDFtO.d.ts → client-BGzLNt78.d.ts} +2 -2
- package/dist/client.d.ts +6 -6
- package/dist/{config-ujZESkJz.d.ts → config-CS5ADSrx.d.ts} +18 -2
- package/dist/{config-CSgvApt0.d.ts → config-CSYMTTm1.d.ts} +1 -1
- package/dist/{direct-executor-ZSTKRA6Z.mjs → direct-executor-OUY4RPTU.mjs} +7 -6
- package/dist/distribution.d.ts +5 -5
- package/dist/distribution.mjs +79 -42
- package/dist/{durability-wiring-EQTFL3B4.mjs → durability-wiring-5V6DVHFK.mjs} +17 -16
- package/dist/{engine-C_HSy3iz.d.ts → engine-CCBBGmMR.d.ts} +1 -1
- package/dist/{events-CJsXF1F9.d.ts → events-D8GPB1-H.d.ts} +5 -0
- package/dist/index.browser.mjs +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.mjs +10 -9
- package/dist/long-query-thread-HMQM2FWL.mjs +118 -0
- package/dist/{module-WP4VVGV2.mjs → module-3IMTXNPW.mjs} +92 -29
- package/dist/pattern.mjs +1 -1
- package/dist/persistence/durability/checkpoint-worker.mjs +14 -13
- package/dist/react.d.ts +6 -6
- package/dist/{rerank-3POMPQNX.mjs → rerank-NYX5S7OG.mjs} +3 -3
- package/dist/{restore-queue-WZTMTJP2.mjs → restore-queue-J6PCG4ON.mjs} +1 -1
- package/dist/{runtime-C2435MPK.mjs → runtime-XNYW6AWX.mjs} +2 -2
- package/dist/server.d.ts +8 -8
- package/dist/server.mjs +110 -258
- package/dist/{snapshot-EU6NNB2P.mjs → snapshot-57WF53MK.mjs} +18 -17
- package/dist/{tasks-CI3Fvkxw.d.ts → tasks-5_LCFEzF.d.ts} +1 -1
- package/dist/thread-FDEHU5G3.mjs +31 -0
- package/dist/vector/search-worker.mjs +2 -2
- package/dist/workers/entry.mjs +19 -7
- package/dist/{write-CKRWS3P5.mjs → write-YEI7A5OR.mjs} +11 -10
- package/package.json +7 -7
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
export { createDirectExecutor } from './chunk-
|
|
2
|
-
import './chunk-
|
|
1
|
+
export { createDirectExecutor } from './chunk-Q62NDKEC.mjs';
|
|
2
|
+
import './chunk-N53HN5VA.mjs';
|
|
3
3
|
import './chunk-FUUP45IS.mjs';
|
|
4
|
-
import './chunk-
|
|
4
|
+
import './chunk-ZATRDAYU.mjs';
|
|
5
|
+
import './chunk-EBIHRL7B.mjs';
|
|
5
6
|
import './chunk-TGP5M5R7.mjs';
|
|
6
7
|
import './chunk-U2BKYEC7.mjs';
|
|
7
|
-
import './chunk-
|
|
8
|
+
import './chunk-VFAXPDBH.mjs';
|
|
8
9
|
import './chunk-WQBCBKY3.mjs';
|
|
9
10
|
import './chunk-KCQG2PJT.mjs';
|
|
10
11
|
import './chunk-DG62H7OD.mjs';
|
|
@@ -19,7 +20,7 @@ import './chunk-7X5JST5L.mjs';
|
|
|
19
20
|
import './chunk-OFYKBKKV.mjs';
|
|
20
21
|
import './chunk-R6A773WK.mjs';
|
|
21
22
|
import './chunk-YTJCGKM4.mjs';
|
|
22
|
-
import './chunk-
|
|
23
|
-
import './chunk-
|
|
23
|
+
import './chunk-BCNUJVTT.mjs';
|
|
24
|
+
import './chunk-22YPZVMG.mjs';
|
|
24
25
|
import './chunk-L5ORED7V.mjs';
|
|
25
26
|
import './chunk-OBWUWZRA.mjs';
|
package/dist/distribution.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { a as CreateIndexOptions, C as ClusterNamespace, b as ClusterNodeConfig } from './config-
|
|
2
|
-
export { c as ClusterControllerConfig, d as ClusterHealth, e as ClusterHealthStatus, f as ClusterMemoryConfig, g as ClusterMetrics, h as ClusterNodeInfo, i as ClusterQueryConfig, j as CommitPointFigure, k as CoordinatorRequestFigure, I as IndexHealth, N as NodeReadiness, P as PartitionReplicationFigure, R as ReplicaLagFigure, l as ReplicationConfig } from './config-
|
|
1
|
+
import { a as CreateIndexOptions, C as ClusterNamespace, b as ClusterNodeConfig } from './config-CS5ADSrx.js';
|
|
2
|
+
export { c as ClusterControllerConfig, d as ClusterHealth, e as ClusterHealthStatus, f as ClusterMemoryConfig, g as ClusterMetrics, h as ClusterNodeInfo, i as ClusterQueryConfig, j as CommitPointFigure, k as CoordinatorRequestFigure, I as IndexHealth, N as NodeReadiness, P as PartitionReplicationFigure, R as ReplicaLagFigure, l as ReplicationConfig, V as VectorRebuildWaitFigure } from './config-CS5ADSrx.js';
|
|
3
3
|
import { R as RerankAdapter } from './adapters-BQFQ4PRz.js';
|
|
4
|
-
import { B as BatchResult, L as ListParams, g as ListResult, h as SuggestParams, j as SuggestResult, Q as QueryParams, P as PreflightResult, I as IndexInfo, k as IndexStats, l as PartitionStatsResult, M as MemoryStats, m as NarsilEventMap, e as QueryResult } from './events-
|
|
4
|
+
import { B as BatchResult, L as ListParams, g as ListResult, h as SuggestParams, j as SuggestResult, Q as QueryParams, P as PreflightResult, I as IndexInfo, k as IndexStats, l as PartitionStatsResult, M as MemoryStats, m as NarsilEventMap, e as QueryResult } from './events-D8GPB1-H.js';
|
|
5
5
|
import { I as IndexConfig, A as AnyDocument, a as InsertOptions } from './schema-4W_7tk1f.js';
|
|
6
6
|
import { a as SynonymRule } from './synonyms-CpOAHPa-.js';
|
|
7
7
|
import { b as NodeCapacity, N as NodeRole } from './index-Cl5qQauj.js';
|
|
8
8
|
export { c as AllocationConstraints, d as AllocationEvent, A as AllocationTable, C as ClusterCoordinator, I as IndexPartitionBytes, e as NodeEvent, f as NodeMemoryReport, a as NodeRegistration, P as PartitionAssignment, g as PartitionState, R as RegistrationLease, S as SchemaEvent, U as UnassignedReason } from './index-Cl5qQauj.js';
|
|
9
|
-
import { N as Narsil } from './engine-
|
|
9
|
+
import { N as Narsil } from './engine-CCBBGmMR.js';
|
|
10
10
|
export { L as ListenHandler, N as NodeTransport, R as RespondFn, T as TransportConfig, a as TransportMessage } from './types-DvncmvuQ.js';
|
|
11
|
-
import './config-
|
|
11
|
+
import './config-CSYMTTm1.js';
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* The cluster splits an index into this many partitions when
|
package/dist/distribution.mjs
CHANGED
|
@@ -1,31 +1,34 @@
|
|
|
1
1
|
import { DEFAULT_NODE_LIFECYCLE_CONFIG, bindWriteBlockLookup, bindEngineWriteBlock, bindIndexReads, DEFAULT_CONTROLLER_CONFIG, getIndexMetadata, getClusterIndexConfig, withPartitionCount, validateIndexName, readIndexState, readIndexMetadataSnapshot, storeSynonymSet, deleteSynonymSet, indexSettingsOf, putIndexMetadata, isValidInteger, isRecord, HIDDEN_GENERATION_PREFIX, indexConfigFromSettings, metadataWithSynonymSet, indexConfigKey, RESHARD_RECORD_CAS_ATTEMPTS, indexUuidOfStoredMetadata, RESHARD_FORWARD_BATCH_DOCUMENTS, storedSynonymSetOf, RESHARD_RETRY_DELAY_MS, RESHARD_RECORD_CHECK_INTERVAL_MS, RESHARD_POLL_INTERVAL_MS, ALLOCATION_RETRY_DELAY_MS, TEARDOWN_CAS_ATTEMPTS, TEARDOWN_RETRY_ROUNDS, putIndexReplicationFactor, ALLOCATION_CAS_ATTEMPTS, TEARDOWN_RETRY_DELAY_MS, RESHARD_CONTROLLER_POLL_INTERVAL_MS, MAX_RESHARD_CUTOVER_ATTEMPTS, RECOVERY_CAS_ATTEMPTS, ESTIMATED_PARTITION_BYTES, REBALANCE_THRESHOLD, putGenerationMetadata, RESHARD_CUTOVER_LAG_ENTRIES, RESHARD_CUTOVER_TIMEOUT_MS, PARTITION_STORES_TIMEOUT_MS, LEADERSHIP_IMBALANCE_THRESHOLD, BOOTSTRAP_CAS_ATTEMPTS } from './chunk-LOBYK2FG.mjs';
|
|
2
|
-
import { MAX_WAIT_FOR_ACTIVE_REPLICAS, MIN_CONTROLLER_LEASE_TTL_MS, MAX_NODE_LEFT_DELAY_MS, DEFAULT_MAX_PER_SOURCE_SNAPSHOTS, DEFAULT_MAX_STREAMS_PER_INDEX, DEFAULT_CAPACITY, CATCH_UP_TICK_MS, DEFAULT_RESUME_WRITES_BELOW, DEFAULT_BLOCK_WRITES_ABOVE, readMemoryFigures, createWritePressure, WRITE_MEMORY_SAMPLE_MAX_AGE_MS, DEFAULT_IN_FLIGHT_WRITE_FRACTION,
|
|
3
|
-
export { DEFAULT_CAPACITY, DEFAULT_PARTITION_COUNT, DEFAULT_REPLICATION_FACTOR } from './chunk-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import './chunk-
|
|
8
|
-
import {
|
|
2
|
+
import { MAX_WAIT_FOR_ACTIVE_REPLICAS, MIN_CONTROLLER_LEASE_TTL_MS, MAX_NODE_LEFT_DELAY_MS, DEFAULT_MAX_PER_SOURCE_SNAPSHOTS, DEFAULT_MAX_STREAMS_PER_INDEX, DEFAULT_CAPACITY, CATCH_UP_TICK_MS, DEFAULT_RESUME_WRITES_BELOW, DEFAULT_BLOCK_WRITES_ABOVE, readMemoryFigures, createWritePressure, WRITE_MEMORY_SAMPLE_MAX_AGE_MS, DEFAULT_IN_FLIGHT_WRITE_FRACTION, MAX_DROP_ACKNOWLEDGE_WAIT_MS, DEFAULT_PARTITION_COUNT, DEFAULT_REPLICATION_FACTOR, DEFAULT_CREATE_INDEX_WAIT_MS, refuseEncodeWithoutRoom, readRecentMemoryFigures, DEFAULT_BOOTSTRAP_SYNC_DEADLINE_MS, MAX_SYNONYM_REPLACEMENT_ATTEMPTS, DROP_ACKNOWLEDGE_POLL_INTERVAL_MS, COORDINATOR_REQUEST_BUCKET_BOUNDS_SECONDS, COPY_FAILURE_ATTEMPTS, SEARCH_CONTEXT_REAPER_INTERVAL_MS, DECOMMISSION_RECHECK_INTERVAL_MS, answerRefusalOf, withAdmittedWrite, estimateForwardedBytes, CASE_FOLD_EXPANSION_FACTOR, PATTERN_RUN_HEAP_BYTES, ENUM_VALUE_HEAP_BYTES, MAX_SOURCE_ID_LENGTH, DOCUMENT_VALUE_HEAP_BYTES, DOCUMENT_HEAP_BYTES_PER_ESTIMATED_BYTE, DOCUMENT_PROPERTY_HEAP_BYTES, VECTOR_DOCUMENT_HEAP_BYTES, VECTOR_COMPONENT_HEAP_BYTES, NORMALIZATION_EXPANSION_FACTOR, TERM_UNIT_HEAP_BYTES, PARTITION_BYTES_INDEX_OVERHEAD_BYTES, DISTINCT_TERM_HEAP_BYTES, PARTIAL_SPELLING_HEAP_BYTES, PARTITION_BYTES_ENTRY_BYTES, PARTITION_BYTES_REPORT_BUDGET_BYTES, SNAPSHOT_CHUNK_YIELD_INTERVAL_MS, CATCH_UP_FEED_WINDOW_MS, MAX_CATCH_UP_IN_FLIGHT_BYTES, SYNCED_POSITION_REPORT_TIMEOUT_MS, ADMISSION_TIMEOUT_MS, REGISTRATION_LEASE_DRIFT_SHARE, REGISTRATION_LEASE_CONFIRM_TIMEOUT_MS, WRITE_APPLY_YIELD_INTERVAL_MS, ROLLBACK_RETRY_INITIAL_DELAY_MS, ROLLBACK_RETRY_DELAY_CAP_MS, COPY_FAILURE_RETRY_DELAY_MS, FETCH_GROUP_DOCUMENT_IDS, SEARCH_CONTEXT_ENTRY_HEAP_BYTES, FULL_MEMORY_COLLECTION_INTERVAL_MS, MEMORY_SAMPLE_INTERVAL_MS, ANSWER_DECODE_HEAP_BYTES_PER_PAYLOAD_BYTE, CLEAR_PAGE_SIZE, estimateDocumentsBytes, estimateDocumentBytes, PRIMARY_CHANGE_RETRY_WINDOW_MS, PRIMARY_CHANGE_POLL_INTERVAL_MS, PARTITION_WRITE_CONCURRENCY, FORWARD_RETRY_INITIAL_DELAY_MS, FORWARD_RETRY_DELAY_CAP_MS } from './chunk-HFJXEFFV.mjs';
|
|
3
|
+
export { DEFAULT_CAPACITY, DEFAULT_PARTITION_COUNT, DEFAULT_REPLICATION_FACTOR } from './chunk-HFJXEFFV.mjs';
|
|
4
|
+
import { addBackgroundAdmission, workWaitingForMemory } from './chunk-PELHVTO7.mjs';
|
|
5
|
+
import { onRefusalAfterCollection, reservedHeapBytes, reserveHeapBytes, collectYoungGenerationBeforeRefusal, collectGarbageBeforeRefusal } from './chunk-IWVEG5CX.mjs';
|
|
6
|
+
import { fixedHybridDepthOf, requireWithinHybridDepth, pageByPosition } from './chunk-ZR63OGT2.mjs';
|
|
7
|
+
import { closePartitionWriter, replaySyncedWal } from './chunk-UDZYIWDP.mjs';
|
|
8
|
+
import { buildArchiveFromMemory, archiveStream, memoryCheckpointStore, readSnapshotArchive } from './chunk-KVLX65KD.mjs';
|
|
9
|
+
import './chunk-NX7KU77V.mjs';
|
|
10
|
+
import { indexMetadataOf, loadPartitionSegments, readSegmentManifest, readVectorFile } from './chunk-YCSRB3IN.mjs';
|
|
9
11
|
import { decodeVectorFilePayload, bytesToVectors, isDead } from './chunk-OCB7TMUQ.mjs';
|
|
10
12
|
import { CONTROLLER_LEASE_KEY } from './chunk-44W3CBNG.mjs';
|
|
11
13
|
import { MAX_MESSAGE_SIZE_BYTES } from './chunk-UNEEFTEU.mjs';
|
|
12
|
-
import './chunk-
|
|
14
|
+
import './chunk-HC5NURS6.mjs';
|
|
13
15
|
import './chunk-DJHHF2L5.mjs';
|
|
14
16
|
import './chunk-37CD3OKS.mjs';
|
|
15
17
|
import { getPath, getFs } from './chunk-HLPRHOSO.mjs';
|
|
16
|
-
import { createForwardBatchResultMessage, validateEntryBatchPayload, createAckMessage, validateEntryPayload, validateForwardBatchPayload, readListedFile, optionalIndexUuid, computeEntryChecksum, createPrimaryResignMessage, validateInsyncConfirmPayload, buildEntry, createInsyncRemoveMessage, createEntryBatchMessage, createInsyncConfirmMessage, createEntryMessage, validateAckPayload, createInsyncAddMessage, directoryCheckpointStore, checkpointLastSeqNo, checkpointPrimaryTerm, createForwardBatchMessage, validateForwardBatchResultPayload, createForwardMessage } from './chunk-
|
|
17
|
-
import { applyIndexEntry, applyDeleteEntry, validateReplicationEntry } from './chunk-
|
|
18
|
+
import { createForwardBatchResultMessage, validateEntryBatchPayload, createAckMessage, validateEntryPayload, validateForwardBatchPayload, readListedFile, optionalIndexUuid, computeEntryChecksum, createPrimaryResignMessage, validateInsyncConfirmPayload, buildEntry, createInsyncRemoveMessage, createEntryBatchMessage, createInsyncConfirmMessage, createEntryMessage, validateAckPayload, createInsyncAddMessage, directoryCheckpointStore, checkpointLastSeqNo, checkpointPrimaryTerm, createForwardBatchMessage, validateForwardBatchResultPayload, createForwardMessage } from './chunk-KGVC6KJ3.mjs';
|
|
19
|
+
import { applyIndexEntry, applyDeleteEntry, validateReplicationEntry } from './chunk-7EWQZQDT.mjs';
|
|
18
20
|
import { MAX_PARTITION_COUNT, MAX_REPLICATION_FACTOR, WIRE_BATCH_BUDGET } from './chunk-P36MUFEJ.mjs';
|
|
19
21
|
import { TransportErrorCodes, ReplicationMessageTypes, ClusterMessageTypes, QueryMessageTypes, TransportError, DEFAULT_TRANSPORT_CONFIG } from './chunk-YH5OIL7B.mjs';
|
|
20
|
-
import { requireKnownConfig, resolveRunnableConfig, createEngineCore, startEngineCore, createNarsilFromCore, runEngineQueryStats, runEngineListDocuments, runEngineSuggest, runEnginePreflight, runEngineQuery, createEngineIndex, encodeIndexConfiguration, requireConfigurationWithinSizeLimit, prepareConfiguredSynonyms, createByteReader, openChecksummedEnvelope, emptySerializablePartition, crc32Init, crc32Final, crc32Update, yieldToEventLoop } from './chunk-
|
|
21
|
-
import { runtimeHost, requireSurfaceFormsForPartialFields, now, listBindingOf, clampLimit, hitsKeptPerGroup, queryBindingOf, resolveHybridFusion, dedupePinnedEntries, foldGroupReducer } from './chunk-
|
|
22
|
+
import { requireKnownConfig, resolveRunnableConfig, createEngineCore, startEngineCore, createNarsilFromCore, runEngineQueryStats, runEngineListDocuments, runEngineSuggest, runEnginePreflight, runEngineQuery, createEngineIndex, encodeIndexConfiguration, requireConfigurationWithinSizeLimit, prepareConfiguredSynonyms, createByteReader, openChecksummedEnvelope, emptySerializablePartition, crc32Init, crc32Final, crc32Update, yieldToEventLoop } from './chunk-BCSWODXP.mjs';
|
|
23
|
+
import { runtimeHost, requireSurfaceFormsForPartialFields, now, listBindingOf, clampLimit, hitsKeptPerGroup, queryBindingOf, resolveHybridFusion, dedupePinnedEntries, foldGroupReducer } from './chunk-5VVSHCXT.mjs';
|
|
22
24
|
import { bindRerankWindowSource, rerankWindowCapOf, providedDocId, engineCoreOf } from './chunk-N57XXGPG.mjs';
|
|
23
25
|
import './chunk-6PN3U6XW.mjs';
|
|
24
26
|
import './chunk-AV4IJKD2.mjs';
|
|
25
|
-
import { synonymModule } from './chunk-
|
|
26
|
-
import { oversampledShardSize, normalizeSort, sortModesOf, readSortValues, resolveProjection, fnv1a, applyProjection, FILTER_EXPRESSION_KEYS, filterTestCount, setNestedValue, FIELD_FILTER_OPERATORS, clampRowCount, sortSignatureOf, requireMatchingCursor, decodePageCursor, encodePageCursor, requireWithinResultWindow, sortSignatureEntry, fnv1aUint32s, mergePartitionStats } from './chunk-
|
|
27
|
+
import { synonymModule } from './chunk-Q62NDKEC.mjs';
|
|
28
|
+
import { oversampledShardSize, normalizeSort, sortModesOf, readSortValues, resolveProjection, fnv1a, applyProjection, FILTER_EXPRESSION_KEYS, filterTestCount, setNestedValue, FIELD_FILTER_OPERATORS, clampRowCount, sortSignatureOf, requireMatchingCursor, decodePageCursor, encodePageCursor, requireWithinResultWindow, sortSignatureEntry, fnv1aUint32s, mergePartitionStats } from './chunk-N53HN5VA.mjs';
|
|
27
29
|
import { generateId, getLanguage } from './chunk-FUUP45IS.mjs';
|
|
28
|
-
import './chunk-
|
|
30
|
+
import './chunk-ZATRDAYU.mjs';
|
|
31
|
+
import './chunk-EBIHRL7B.mjs';
|
|
29
32
|
import './chunk-HJSN7UYG.mjs';
|
|
30
33
|
import { MAX_DOC_ID_LENGTH, BATCH_CHUNK_SIZE, DEFAULT_SUGGEST_LIMIT, MAX_SUGGEST_LIMIT, MAX_SUGGEST_SCATTER_LIMIT, SUGGEST_OVERSAMPLE_FACTOR, SUGGEST_OVERSAMPLE_PADDING } from './chunk-LXWDQLTW.mjs';
|
|
31
34
|
import './chunk-TGP5M5R7.mjs';
|
|
@@ -33,7 +36,7 @@ import './chunk-U2BKYEC7.mjs';
|
|
|
33
36
|
import './chunk-KOKM4PQN.mjs';
|
|
34
37
|
import { MIN_OVERSAMPLE } from './chunk-QSK35UC2.mjs';
|
|
35
38
|
import './chunk-VK45J47R.mjs';
|
|
36
|
-
import { isPatternTolerance } from './chunk-
|
|
39
|
+
import { isPatternTolerance } from './chunk-VFAXPDBH.mjs';
|
|
37
40
|
import { MAX_FILTER_DEPTH, MAX_FILTER_TESTS, MAX_FILTER_ARRAY_SIZE } from './chunk-WQBCBKY3.mjs';
|
|
38
41
|
import { getNestedValue } from './chunk-KCQG2PJT.mjs';
|
|
39
42
|
import { encodeDocument, validateSchema, requireCreatableSchema, encodeDocumentReply, schemaFieldsOf, MIN_POLYGON_POINTS, isLatitude, MAX_LATITUDE_DEGREES, isLongitude, MAX_LONGITUDE_DEGREES } from './chunk-DG62H7OD.mjs';
|
|
@@ -48,10 +51,10 @@ import './chunk-7X5JST5L.mjs';
|
|
|
48
51
|
import './chunk-OFYKBKKV.mjs';
|
|
49
52
|
import { isSortMode, SORT_MODES, toComparableSortValue, compareComparableKeys, compareSortValues } from './chunk-R6A773WK.mjs';
|
|
50
53
|
import { compareCodePoints, exceedsCodePoints } from './chunk-YTJCGKM4.mjs';
|
|
51
|
-
import { collectAndReturnPages } from './chunk-
|
|
52
|
-
import './chunk-
|
|
53
|
-
import './chunk-
|
|
54
|
-
import { HEAP_RESUME_FRACTION_BELOW_V8_INEFFECTIVE_MARK_COMPACT_LINE, HEAP_BLOCK_FRACTION_BELOW_V8_INEFFECTIVE_MARK_COMPACT_LINE } from './chunk-
|
|
54
|
+
import { collectAndReturnPages } from './chunk-RIIUZJQ3.mjs';
|
|
55
|
+
import './chunk-Z4DZ4KK2.mjs';
|
|
56
|
+
import './chunk-BCNUJVTT.mjs';
|
|
57
|
+
import { HEAP_RESUME_FRACTION_BELOW_V8_INEFFECTIVE_MARK_COMPACT_LINE, HEAP_BLOCK_FRACTION_BELOW_V8_INEFFECTIVE_MARK_COMPACT_LINE } from './chunk-22YPZVMG.mjs';
|
|
55
58
|
import './chunk-RFBLQLLZ.mjs';
|
|
56
59
|
import { MAX_STORED_VECTOR_DIMENSION, MAX_NESTING_DEPTH } from './chunk-L5ORED7V.mjs';
|
|
57
60
|
import { ErrorCodes, NarsilError, describeError, ServerErrorCodes } from './chunk-OBWUWZRA.mjs';
|
|
@@ -3626,7 +3629,13 @@ async function readClusterMetrics(deps) {
|
|
|
3626
3629
|
}
|
|
3627
3630
|
}
|
|
3628
3631
|
keepAcknowledgementsOf(deps.catchUp, ledPartitionKeys);
|
|
3629
|
-
return {
|
|
3632
|
+
return {
|
|
3633
|
+
replicationLag,
|
|
3634
|
+
commitPoints,
|
|
3635
|
+
partitions,
|
|
3636
|
+
coordinatorRequests: deps.timing.figures(),
|
|
3637
|
+
vectorRebuildsWaitingForMemory: workWaitingForMemory()
|
|
3638
|
+
};
|
|
3630
3639
|
}
|
|
3631
3640
|
|
|
3632
3641
|
// src/distribution/cluster-node/cluster-namespace.ts
|
|
@@ -8316,6 +8325,7 @@ async function createClusterLocalEngine(config, hooks) {
|
|
|
8316
8325
|
core.mutationCtx.durability = createAdmittingRecorder(core, admission, core.mutationCtx.durability);
|
|
8317
8326
|
},
|
|
8318
8327
|
writeAnalysisOf: (indexName) => writeAnalysisOf(core, indexName),
|
|
8328
|
+
vectorGrowthBytesOf: (indexName, documents) => vectorGrowthBytesOf(core, indexName, documents),
|
|
8319
8329
|
restartLocalLog: (indexName, partitionId, position) => restartLocalLog(core, indexName, partitionId, position),
|
|
8320
8330
|
isolateCopyFailures: (onFailed) => core.durability?.manager.isolatePartitionFailures?.(onFailed),
|
|
8321
8331
|
emptyPartitionCopy: (indexName, partitionId) => emptyPartitionCopy(core, indexName, partitionId, writeRecords),
|
|
@@ -8363,6 +8373,13 @@ function writeAnalysisOf(core, indexName) {
|
|
|
8363
8373
|
...customTokenizer === void 0 ? {} : { customTokenizer }
|
|
8364
8374
|
};
|
|
8365
8375
|
}
|
|
8376
|
+
function vectorGrowthBytesOf(core, indexName, documents) {
|
|
8377
|
+
const manager = core.executor.getManager(indexName);
|
|
8378
|
+
if (manager === void 0 || manager === null) return 0;
|
|
8379
|
+
let bytes = 0;
|
|
8380
|
+
for (const vectorIndex of manager.getVectorIndexes().values()) bytes += vectorIndex.growthBytesFor(documents);
|
|
8381
|
+
return bytes;
|
|
8382
|
+
}
|
|
8366
8383
|
function persistedPositionOf(core, indexName, partitionId) {
|
|
8367
8384
|
const durable = core.durability?.manager;
|
|
8368
8385
|
if (durable === void 0) return { seqNo: 0, primaryTerm: 0 };
|
|
@@ -11660,28 +11677,35 @@ var WRITE_WOULD_FILL_MEMORY_REASON = "write_would_fill_memory";
|
|
|
11660
11677
|
var WRITE_EXCEEDS_MEMORY_REASON = "write_exceeds_memory";
|
|
11661
11678
|
var UNPROJECTED = { count: 0, release: () => {
|
|
11662
11679
|
} };
|
|
11663
|
-
function
|
|
11664
|
-
return
|
|
11665
|
-
|
|
11666
|
-
|
|
11667
|
-
|
|
11680
|
+
function heapRoomIn(figures, fractions) {
|
|
11681
|
+
return fractions.heapBlock * figures.heapLimitBytes - figures.heapBytes - figures.youngHeapBytes;
|
|
11682
|
+
}
|
|
11683
|
+
function processRoomIn(figures, fractions) {
|
|
11684
|
+
return fractions.processBlock * figures.processLimitBytes - figures.processBytes - figures.youngReserveBytes;
|
|
11668
11685
|
}
|
|
11669
11686
|
function createWriteProjection(options) {
|
|
11670
11687
|
const bounds = /* @__PURE__ */ new Map();
|
|
11671
|
-
function fittingCount(figures, groupBounds, start) {
|
|
11688
|
+
function fittingCount(indexName, figures, groupBounds, start) {
|
|
11672
11689
|
const end = Math.min(groupBounds.length, start + BATCH_CHUNK_SIZE);
|
|
11673
11690
|
if (figures === null) return end - start;
|
|
11674
|
-
const
|
|
11691
|
+
const reserved = reservedHeapBytes();
|
|
11692
|
+
const heapRoom = heapRoomIn(figures, options.fractions) - reserved;
|
|
11693
|
+
const processRoom = processRoomIn(figures, options.fractions) - reserved;
|
|
11694
|
+
const mostGrowth = options.vectorGrowthBytesOf(indexName, end - start);
|
|
11675
11695
|
let taken = 0;
|
|
11676
11696
|
let count2 = 0;
|
|
11677
|
-
while (start + count2 < end
|
|
11678
|
-
taken
|
|
11697
|
+
while (start + count2 < end) {
|
|
11698
|
+
const next = taken + groupBounds[start + count2];
|
|
11699
|
+
if (next > heapRoom) break;
|
|
11700
|
+
if (next + mostGrowth > processRoom && next + options.vectorGrowthBytesOf(indexName, count2 + 1) > processRoom)
|
|
11701
|
+
break;
|
|
11702
|
+
taken = next;
|
|
11679
11703
|
count2++;
|
|
11680
11704
|
}
|
|
11681
11705
|
return count2;
|
|
11682
11706
|
}
|
|
11683
|
-
function reserve(groupBounds, start, count2) {
|
|
11684
|
-
let bytes = 0;
|
|
11707
|
+
function reserve(indexName, groupBounds, start, count2) {
|
|
11708
|
+
let bytes = count2 === 0 ? 0 : options.vectorGrowthBytesOf(indexName, count2);
|
|
11685
11709
|
for (let index = start; index < start + count2; index++) bytes += groupBounds[index];
|
|
11686
11710
|
const reservation = reserveHeapBytes(bytes);
|
|
11687
11711
|
return { count: count2, release: () => reservation.release() };
|
|
@@ -11712,6 +11736,8 @@ function createWriteProjection(options) {
|
|
|
11712
11736
|
heapBytesBeforeCollection,
|
|
11713
11737
|
collectedGarbage,
|
|
11714
11738
|
processBytes: figures.processBytes,
|
|
11739
|
+
youngCeilingBytes: figures.youngCeilingBytes,
|
|
11740
|
+
youngReserveBytes: figures.youngReserveBytes,
|
|
11715
11741
|
blockBytes: blockBytesOf(figures)
|
|
11716
11742
|
}
|
|
11717
11743
|
);
|
|
@@ -11719,17 +11745,18 @@ function createWriteProjection(options) {
|
|
|
11719
11745
|
function takeGroup(indexName, groupBounds, start) {
|
|
11720
11746
|
if (start >= groupBounds.length) return UNPROJECTED;
|
|
11721
11747
|
const measured = options.measure();
|
|
11722
|
-
if (measured === null)
|
|
11748
|
+
if (measured === null)
|
|
11749
|
+
return reserve(indexName, groupBounds, start, fittingCount(indexName, null, groupBounds, start));
|
|
11723
11750
|
if (groupBounds[start] > blockBytesOf(measured)) {
|
|
11724
11751
|
throw exceedsMemory(indexName, groupBounds[start], blockBytesOf(measured));
|
|
11725
11752
|
}
|
|
11726
11753
|
let figures = measured;
|
|
11727
|
-
let count2 = fittingCount(figures, groupBounds, start);
|
|
11728
|
-
if (count2 > 0) return reserve(groupBounds, start, count2);
|
|
11754
|
+
let count2 = fittingCount(indexName, figures, groupBounds, start);
|
|
11755
|
+
if (count2 > 0) return reserve(indexName, groupBounds, start, count2);
|
|
11729
11756
|
const collectionsBefore = options.collections();
|
|
11730
11757
|
figures = options.measureWithoutGarbage() ?? figures;
|
|
11731
|
-
count2 = fittingCount(figures, groupBounds, start);
|
|
11732
|
-
if (count2 > 0) return reserve(groupBounds, start, count2);
|
|
11758
|
+
count2 = fittingCount(indexName, figures, groupBounds, start);
|
|
11759
|
+
if (count2 > 0) return reserve(indexName, groupBounds, start, count2);
|
|
11733
11760
|
const collected = options.collections() !== collectionsBefore;
|
|
11734
11761
|
if (collected) options.refusedAfterCollection(figures);
|
|
11735
11762
|
throw wouldFillMemory(indexName, groupBounds[start], figures, measured.heapBytes, collected);
|
|
@@ -16160,7 +16187,7 @@ function pageFixedDepth(placed, fused, pins, allMatchesPresent, start, page, dep
|
|
|
16160
16187
|
start,
|
|
16161
16188
|
limit: page.limit,
|
|
16162
16189
|
pinnedIds: placedIds,
|
|
16163
|
-
binding: page.binding,
|
|
16190
|
+
binding: () => page.binding,
|
|
16164
16191
|
encodeCursor: encodePageCursor
|
|
16165
16192
|
});
|
|
16166
16193
|
return { page: paged.page.map((hit) => hit.entry), cursor: paged.cursor ?? null };
|
|
@@ -17117,7 +17144,7 @@ async function queryCluster(deps, indexName, params) {
|
|
|
17117
17144
|
(reader) => searchCluster(deps, indexName, params, allocation, reader, false)
|
|
17118
17145
|
);
|
|
17119
17146
|
}
|
|
17120
|
-
const { rerankClusterQuery } = await import('./rerank-
|
|
17147
|
+
const { rerankClusterQuery } = await import('./rerank-NYX5S7OG.mjs');
|
|
17121
17148
|
return withRankedReader(
|
|
17122
17149
|
deps,
|
|
17123
17150
|
indexName,
|
|
@@ -17543,11 +17570,11 @@ function reportOf(figures, full) {
|
|
|
17543
17570
|
};
|
|
17544
17571
|
}
|
|
17545
17572
|
function atOrAboveResume(figures, fractions) {
|
|
17546
|
-
return fractionOf(figures.processBytes, figures.processLimitBytes) >= fractions.processResume || fractionOf(figures.heapBytes, figures.heapLimitBytes) >= fractions.heapResume;
|
|
17573
|
+
return fractionOf(figures.processBytes + figures.youngReserveBytes, figures.processLimitBytes) >= fractions.processResume || fractionOf(figures.heapBytes, figures.heapLimitBytes) >= fractions.heapResume;
|
|
17547
17574
|
}
|
|
17548
17575
|
function nextFullState(wasFull, figures, fractions) {
|
|
17549
17576
|
if (wasFull) return atOrAboveResume(figures, fractions);
|
|
17550
|
-
return fractionOf(figures.processBytes, figures.processLimitBytes) > fractions.processBlock || fractionOf(figures.heapBytes, figures.heapLimitBytes) > fractions.heapBlock;
|
|
17577
|
+
return fractionOf(figures.processBytes + figures.youngReserveBytes, figures.processLimitBytes) > fractions.processBlock || fractionOf(figures.heapBytes, figures.heapLimitBytes) > fractions.heapBlock;
|
|
17551
17578
|
}
|
|
17552
17579
|
function createMemoryMonitor(options) {
|
|
17553
17580
|
let latest = null;
|
|
@@ -17741,7 +17768,8 @@ function createNodeMemoryReporting(options) {
|
|
|
17741
17768
|
measureWithoutGarbage: () => monitor.measureWithoutGarbage(),
|
|
17742
17769
|
collections: () => monitor.collections(),
|
|
17743
17770
|
refusedAfterCollection: (figures) => monitor.refusedAfterCollection(figures),
|
|
17744
|
-
analysisOf: (indexName) => options.engine.writeAnalysisOf(indexName)
|
|
17771
|
+
analysisOf: (indexName) => options.engine.writeAnalysisOf(indexName),
|
|
17772
|
+
vectorGrowthBytesOf: (indexName, documents) => options.engine.vectorGrowthBytesOf(indexName, documents)
|
|
17745
17773
|
});
|
|
17746
17774
|
const heapLimitBytes = readMemoryFigures()?.heapLimitBytes ?? Number.POSITIVE_INFINITY;
|
|
17747
17775
|
const writePressure = createWritePressure({
|
|
@@ -17752,6 +17780,12 @@ function createNodeMemoryReporting(options) {
|
|
|
17752
17780
|
beforeAdmit: () => monitor.sampleIfOlderThan(WRITE_MEMORY_SAMPLE_MAX_AGE_MS)
|
|
17753
17781
|
});
|
|
17754
17782
|
let stopHearingRefusals = null;
|
|
17783
|
+
let stopAdmitting = null;
|
|
17784
|
+
function admitsBackgroundBytes(bytes) {
|
|
17785
|
+
const figures = readRecentMemoryFigures();
|
|
17786
|
+
if (figures === null) return true;
|
|
17787
|
+
return bytes <= fractions.processBlock * figures.processLimitBytes - figures.processBytes - figures.youngReserveBytes - reservedHeapBytes();
|
|
17788
|
+
}
|
|
17755
17789
|
return {
|
|
17756
17790
|
view,
|
|
17757
17791
|
writePressure,
|
|
@@ -17759,11 +17793,14 @@ function createNodeMemoryReporting(options) {
|
|
|
17759
17793
|
async start() {
|
|
17760
17794
|
monitor.start();
|
|
17761
17795
|
stopHearingRefusals ??= onRefusalAfterCollection((figures) => monitor.refusedAfterCollection(figures));
|
|
17796
|
+
stopAdmitting ??= addBackgroundAdmission(admitsBackgroundBytes);
|
|
17762
17797
|
await view.start();
|
|
17763
17798
|
},
|
|
17764
17799
|
stop() {
|
|
17765
17800
|
stopHearingRefusals?.();
|
|
17766
17801
|
stopHearingRefusals = null;
|
|
17802
|
+
stopAdmitting?.();
|
|
17803
|
+
stopAdmitting = null;
|
|
17767
17804
|
monitor.stop();
|
|
17768
17805
|
view.stop();
|
|
17769
17806
|
},
|
|
@@ -1,24 +1,25 @@
|
|
|
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-
|
|
1
|
+
import { deserializePayloadV2, documentsOfPayloadV2 } from './chunk-VOKEYJHU.mjs';
|
|
2
|
+
import { closePartitionWriter, drainIndexStateForUnload, listPersistedIndexes, loadMetadata, snapshotCheckpointFor, replayWal } from './chunk-UDZYIWDP.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-YCSRB3IN.mjs';
|
|
4
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-
|
|
7
|
-
import { spawnNodeWorker } from './chunk-
|
|
6
|
+
import { createDurableDirectory } from './chunk-YCFQ5754.mjs';
|
|
7
|
+
import { spawnNodeWorker } from './chunk-W55X2BYN.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-KGVC6KJ3.mjs';
|
|
10
|
+
import './chunk-7EWQZQDT.mjs';
|
|
11
11
|
import './chunk-P36MUFEJ.mjs';
|
|
12
12
|
import './chunk-YH5OIL7B.mjs';
|
|
13
|
-
import { openChecksummedEnvelope, HEADER_SIZE } from './chunk-
|
|
14
|
-
import './chunk-
|
|
13
|
+
import { openChecksummedEnvelope, HEADER_SIZE } from './chunk-BCSWODXP.mjs';
|
|
14
|
+
import './chunk-5VVSHCXT.mjs';
|
|
15
15
|
import './chunk-N57XXGPG.mjs';
|
|
16
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-
|
|
18
|
+
import { buildSegmentPayload, resolvePartitionInsertOptions, freezeSegmentShared, createSharedFrozenSegment } from './chunk-Q62NDKEC.mjs';
|
|
19
|
+
import { fnv1a } from './chunk-N53HN5VA.mjs';
|
|
20
20
|
import './chunk-FUUP45IS.mjs';
|
|
21
|
-
import './chunk-
|
|
21
|
+
import './chunk-ZATRDAYU.mjs';
|
|
22
|
+
import './chunk-EBIHRL7B.mjs';
|
|
22
23
|
import './chunk-HJSN7UYG.mjs';
|
|
23
24
|
import { MAX_INDEX_NAME_LENGTH, INDEX_NAME_PATTERN } from './chunk-LXWDQLTW.mjs';
|
|
24
25
|
import './chunk-TGP5M5R7.mjs';
|
|
@@ -26,7 +27,7 @@ import './chunk-U2BKYEC7.mjs';
|
|
|
26
27
|
import './chunk-KOKM4PQN.mjs';
|
|
27
28
|
import './chunk-QSK35UC2.mjs';
|
|
28
29
|
import './chunk-VK45J47R.mjs';
|
|
29
|
-
import './chunk-
|
|
30
|
+
import './chunk-VFAXPDBH.mjs';
|
|
30
31
|
import './chunk-WQBCBKY3.mjs';
|
|
31
32
|
import './chunk-KCQG2PJT.mjs';
|
|
32
33
|
import { encodeDocument, requireValidFieldTypes } from './chunk-DG62H7OD.mjs';
|
|
@@ -41,9 +42,9 @@ import './chunk-7X5JST5L.mjs';
|
|
|
41
42
|
import './chunk-OFYKBKKV.mjs';
|
|
42
43
|
import './chunk-R6A773WK.mjs';
|
|
43
44
|
import { compareCodePoints } from './chunk-YTJCGKM4.mjs';
|
|
44
|
-
import './chunk-
|
|
45
|
-
import './chunk-
|
|
46
|
-
import './chunk-
|
|
45
|
+
import './chunk-Z4DZ4KK2.mjs';
|
|
46
|
+
import './chunk-BCNUJVTT.mjs';
|
|
47
|
+
import './chunk-22YPZVMG.mjs';
|
|
47
48
|
import './chunk-RFBLQLLZ.mjs';
|
|
48
49
|
import './chunk-L5ORED7V.mjs';
|
|
49
50
|
import { NarsilError, ErrorCodes } from './chunk-OBWUWZRA.mjs';
|
|
@@ -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-D8GPB1-H.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
|
|
|
@@ -561,6 +561,11 @@ interface VectorMaintenanceResult {
|
|
|
561
561
|
bufferSize: number;
|
|
562
562
|
/** This stays true while a graph build runs. */
|
|
563
563
|
building: boolean;
|
|
564
|
+
/**
|
|
565
|
+
* This turns true while a rebuild that keeps recall up waits for the node to have
|
|
566
|
+
* room for a second graph beside the one it serves, and false once it starts.
|
|
567
|
+
*/
|
|
568
|
+
waitingForMemory: boolean;
|
|
564
569
|
/** {@link Narsil.compactVectors} would take about this many milliseconds. */
|
|
565
570
|
estimatedCompactMs: number;
|
|
566
571
|
/** {@link Narsil.optimizeVectors} would take about this many milliseconds. */
|
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-
|
|
1
|
+
export { VERSION, clearNormalizationCache, configureNormalizationCache, createNarsil, getLanguage, getNormalizationCacheSize, getStopWords, getTokenizer, hasStopWords, hasTokenizer, registerLanguage, registerPartialWordSearch, registerPatternSearch, registerStopWords, registerSynonyms, registerTokenizer, resetNormalizationCache } from './browser/chunk-2TMWIATH.mjs';
|
|
2
2
|
export { isSimdAvailable } from './browser/chunk-2CBQ2PCC.mjs';
|
|
3
3
|
import './browser/chunk-JPTQZWJQ.mjs';
|
|
4
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-D8GPB1-H.js';
|
|
10
|
+
import { N as NarsilConfig } from './config-CSYMTTm1.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-CSYMTTm1.js';
|
|
12
|
+
import { N as Narsil } from './engine-CCBBGmMR.js';
|
|
13
|
+
export { A as AdapterRegistrationOperations, B as ByteSource, D as DocumentWriteOperations, I as IndexLifecycleOperations, S as SynonymOperations } from './engine-CCBBGmMR.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,12 +1,13 @@
|
|
|
1
|
-
export { VERSION, createNarsil } from './chunk-
|
|
2
|
-
import './chunk-
|
|
1
|
+
export { VERSION, createNarsil } from './chunk-BCSWODXP.mjs';
|
|
2
|
+
import './chunk-5VVSHCXT.mjs';
|
|
3
3
|
import './chunk-N57XXGPG.mjs';
|
|
4
4
|
import './chunk-6PN3U6XW.mjs';
|
|
5
5
|
import './chunk-AV4IJKD2.mjs';
|
|
6
|
-
export { registerSynonyms } from './chunk-
|
|
7
|
-
export { registerPartialWordSearch, registerPatternSearch } from './chunk-
|
|
6
|
+
export { registerSynonyms } from './chunk-Q62NDKEC.mjs';
|
|
7
|
+
export { registerPartialWordSearch, registerPatternSearch } from './chunk-N53HN5VA.mjs';
|
|
8
8
|
export { getLanguage, registerLanguage } from './chunk-FUUP45IS.mjs';
|
|
9
|
-
import './chunk-
|
|
9
|
+
import './chunk-ZATRDAYU.mjs';
|
|
10
|
+
import './chunk-EBIHRL7B.mjs';
|
|
10
11
|
import './chunk-HJSN7UYG.mjs';
|
|
11
12
|
import './chunk-LXWDQLTW.mjs';
|
|
12
13
|
import './chunk-TGP5M5R7.mjs';
|
|
@@ -14,7 +15,7 @@ import './chunk-U2BKYEC7.mjs';
|
|
|
14
15
|
export { isSimdAvailable } from './chunk-KOKM4PQN.mjs';
|
|
15
16
|
import './chunk-QSK35UC2.mjs';
|
|
16
17
|
import './chunk-VK45J47R.mjs';
|
|
17
|
-
import './chunk-
|
|
18
|
+
import './chunk-VFAXPDBH.mjs';
|
|
18
19
|
import './chunk-WQBCBKY3.mjs';
|
|
19
20
|
import './chunk-KCQG2PJT.mjs';
|
|
20
21
|
import './chunk-DG62H7OD.mjs';
|
|
@@ -29,9 +30,9 @@ import './chunk-7X5JST5L.mjs';
|
|
|
29
30
|
export { clearNormalizationCache, configureNormalizationCache, getNormalizationCacheSize, resetNormalizationCache } from './chunk-OFYKBKKV.mjs';
|
|
30
31
|
import './chunk-R6A773WK.mjs';
|
|
31
32
|
import './chunk-YTJCGKM4.mjs';
|
|
32
|
-
import './chunk-
|
|
33
|
-
import './chunk-
|
|
34
|
-
import './chunk-
|
|
33
|
+
import './chunk-Z4DZ4KK2.mjs';
|
|
34
|
+
import './chunk-BCNUJVTT.mjs';
|
|
35
|
+
import './chunk-22YPZVMG.mjs';
|
|
35
36
|
import './chunk-RFBLQLLZ.mjs';
|
|
36
37
|
import './chunk-L5ORED7V.mjs';
|
|
37
38
|
export { ClientErrorCodes, ErrorCodes, NarsilError, ServerErrorCodes, isNarsilError } from './chunk-OBWUWZRA.mjs';
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { createRelayClient, createThreadReadEngine, searchHandler, isLongQueryPortNote } from './chunk-DEXID4ZT.mjs';
|
|
2
|
+
import { answerRequest } from './chunk-N6J6EJW3.mjs';
|
|
3
|
+
import './chunk-IE43SRL3.mjs';
|
|
4
|
+
import './chunk-KZ3NX2P7.mjs';
|
|
5
|
+
import './chunk-HFJXEFFV.mjs';
|
|
6
|
+
import './chunk-IWVEG5CX.mjs';
|
|
7
|
+
import './chunk-DJHHF2L5.mjs';
|
|
8
|
+
import './chunk-5VVSHCXT.mjs';
|
|
9
|
+
import './chunk-N53HN5VA.mjs';
|
|
10
|
+
import './chunk-ZATRDAYU.mjs';
|
|
11
|
+
import './chunk-EBIHRL7B.mjs';
|
|
12
|
+
import './chunk-HJSN7UYG.mjs';
|
|
13
|
+
import './chunk-LXWDQLTW.mjs';
|
|
14
|
+
import './chunk-QSK35UC2.mjs';
|
|
15
|
+
import './chunk-VK45J47R.mjs';
|
|
16
|
+
import './chunk-VFAXPDBH.mjs';
|
|
17
|
+
import './chunk-WQBCBKY3.mjs';
|
|
18
|
+
import './chunk-KCQG2PJT.mjs';
|
|
19
|
+
import './chunk-DG62H7OD.mjs';
|
|
20
|
+
import './chunk-U476IXKQ.mjs';
|
|
21
|
+
import './chunk-E74YLAIG.mjs';
|
|
22
|
+
import './chunk-VJS4JFBQ.mjs';
|
|
23
|
+
import './chunk-GES7U2PM.mjs';
|
|
24
|
+
import './chunk-6ODIY6ZB.mjs';
|
|
25
|
+
import './chunk-X5CV2E2B.mjs';
|
|
26
|
+
import './chunk-OFYKBKKV.mjs';
|
|
27
|
+
import './chunk-R6A773WK.mjs';
|
|
28
|
+
import './chunk-YTJCGKM4.mjs';
|
|
29
|
+
import './chunk-RIIUZJQ3.mjs';
|
|
30
|
+
import './chunk-22YPZVMG.mjs';
|
|
31
|
+
import './chunk-L5ORED7V.mjs';
|
|
32
|
+
import './chunk-OBWUWZRA.mjs';
|
|
33
|
+
|
|
34
|
+
// src/server/request-threads/long-query-thread.ts
|
|
35
|
+
var serving = null;
|
|
36
|
+
function isMovedRequest(message) {
|
|
37
|
+
if (typeof message !== "object" || message === null) return false;
|
|
38
|
+
const { type, requestId } = message;
|
|
39
|
+
return type === "request" && typeof requestId === "number";
|
|
40
|
+
}
|
|
41
|
+
function streamNote(message) {
|
|
42
|
+
if (typeof message !== "object" || message === null) return null;
|
|
43
|
+
const { type, requestId } = message;
|
|
44
|
+
if (typeof requestId !== "number") return null;
|
|
45
|
+
return type === "stream-credit" || type === "stream-cancel" ? { type, requestId } : null;
|
|
46
|
+
}
|
|
47
|
+
function answerMovesOn(port, handlers) {
|
|
48
|
+
const streams = /* @__PURE__ */ new Map();
|
|
49
|
+
port.on("message", (message) => {
|
|
50
|
+
const note = streamNote(message);
|
|
51
|
+
if (note !== null) {
|
|
52
|
+
if (note.type === "stream-credit") streams.get(note.requestId)?.credit();
|
|
53
|
+
else streams.get(note.requestId)?.cancel();
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
if (!isMovedRequest(message)) return;
|
|
57
|
+
const handler = message.route === "search" || message.route === "preflight" ? handlers[message.route] : null;
|
|
58
|
+
if (handler === null) return;
|
|
59
|
+
void answerRequest(handler, message, port, streams).then((answer) => {
|
|
60
|
+
if (answer !== null) port.postMessage(answer);
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
function serveLongQueries(executor, settings) {
|
|
65
|
+
if (serving !== null) throw new Error("This worker already answers long queries");
|
|
66
|
+
const relay = createRelayClient(settings.port, settings.touchIntervalMs);
|
|
67
|
+
const local = createThreadReadEngine({
|
|
68
|
+
executor,
|
|
69
|
+
relay,
|
|
70
|
+
searchHooks: false,
|
|
71
|
+
patternWorkCap: settings.patternWorkCap,
|
|
72
|
+
maxRerankWindow: settings.maxRerankWindow
|
|
73
|
+
});
|
|
74
|
+
const afterWrites = (answer) => async (indexName, params) => {
|
|
75
|
+
await relay.awaitWrites(indexName);
|
|
76
|
+
return answer(indexName, params);
|
|
77
|
+
};
|
|
78
|
+
const shared = {
|
|
79
|
+
limits: settings.limits,
|
|
80
|
+
allowRegex: settings.allowRegex,
|
|
81
|
+
move: async () => false
|
|
82
|
+
};
|
|
83
|
+
const query = afterWrites((name, params) => local.queryHere(name, params));
|
|
84
|
+
const preflight = afterWrites((name, params) => local.preflightHere(name, params));
|
|
85
|
+
const handlers = {
|
|
86
|
+
search: searchHandler({
|
|
87
|
+
...shared,
|
|
88
|
+
fallback: (ctx) => relay.request("search", ctx),
|
|
89
|
+
staysOnThread: (name, params) => local.canAnswer(name, params),
|
|
90
|
+
answer: query,
|
|
91
|
+
answerHere: query
|
|
92
|
+
}),
|
|
93
|
+
preflight: searchHandler({
|
|
94
|
+
...shared,
|
|
95
|
+
fallback: (ctx) => relay.request("preflight", ctx),
|
|
96
|
+
staysOnThread: (name, params) => local.canCount(name, params),
|
|
97
|
+
answer: preflight,
|
|
98
|
+
answerHere: preflight
|
|
99
|
+
})
|
|
100
|
+
};
|
|
101
|
+
const thread = { relay, ports: /* @__PURE__ */ new Set() };
|
|
102
|
+
settings.port.on("message", (message) => {
|
|
103
|
+
if (!isLongQueryPortNote(message) || serving !== thread) return;
|
|
104
|
+
thread.ports.add(message.port);
|
|
105
|
+
message.port.on("close", () => thread.ports.delete(message.port));
|
|
106
|
+
answerMovesOn(message.port, handlers);
|
|
107
|
+
});
|
|
108
|
+
serving = thread;
|
|
109
|
+
}
|
|
110
|
+
function closeLongQueryThread() {
|
|
111
|
+
if (serving === null) return;
|
|
112
|
+
const { relay, ports } = serving;
|
|
113
|
+
serving = null;
|
|
114
|
+
for (const port of ports) port.close();
|
|
115
|
+
relay.close();
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export { closeLongQueryThread, serveLongQueries };
|