@delali/narsil 0.2.3-next.34 → 0.2.3-next.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/adapters/filesystem.mjs +1 -1
- package/dist/adapters/indexeddb.mjs +1 -1
- package/dist/{chunk-EMI63EXP.mjs → chunk-GB2IIJJG.mjs} +2 -0
- package/dist/{chunk-RO4EFWE6.mjs → chunk-GRWFY2HI.mjs} +10 -1
- package/dist/{chunk-36ER4WCG.mjs → chunk-JQUL2T6I.mjs} +2 -1
- package/dist/{chunk-GN7KF675.mjs → chunk-MMSWEEZT.mjs} +88 -164
- package/dist/{chunk-GODECMDT.mjs → chunk-PM52SMBT.mjs} +1 -1
- package/dist/chunk-WU2UZEVD.mjs +137 -0
- package/dist/{client-DQHB_swQ.d.ts → client-BobVnoIK.d.ts} +2 -2
- package/dist/client.d.ts +8 -4
- package/dist/client.mjs +2 -0
- package/dist/{config-ChZ7lfqc.d.ts → config-Byyl1QqH.d.ts} +2 -2
- package/dist/config-fLC4lbmg.d.ts +194 -0
- package/dist/{direct-executor-YARCDMJF.mjs → direct-executor-MSJEVPZU.mjs} +2 -2
- package/dist/distribution/coordinator/etcd.d.ts +5 -7
- package/dist/distribution/coordinator/etcd.mjs +27 -8
- package/dist/distribution/coordinator/in-memory.d.ts +2 -2
- package/dist/distribution/transport/grpc.mjs +3 -3
- package/dist/distribution/transport/in-memory.mjs +1 -1
- package/dist/distribution/transport/tcp.mjs +2 -2
- package/dist/distribution.d.ts +10 -108
- package/dist/distribution.mjs +1328 -370
- package/dist/embeddings/openai.mjs +1 -1
- package/dist/{engine-DScGlT2Z.d.ts → engine-BE45D5ZG.d.ts} +3 -3
- package/dist/index.browser.mjs +90 -24
- package/dist/index.d.ts +7 -7
- package/dist/index.mjs +5 -4
- package/dist/{options-BORJg5XB.d.ts → options-EXYFcem-.d.ts} +9 -0
- package/dist/persistence/durability/checkpoint-worker.d.ts +3 -1
- package/dist/persistence/durability/checkpoint-worker.mjs +5 -4
- package/dist/react.d.ts +4 -4
- package/dist/react.mjs +2 -0
- package/dist/{schema-emTQfEiX.d.ts → schema-ZRbk8BgH.d.ts} +1 -0
- package/dist/{search-CQ-9bKxo.d.ts → search-DHuXwJYk.d.ts} +29 -2
- package/dist/server.d.ts +9 -5
- package/dist/server.mjs +101 -7
- package/dist/{types-BhdINMtE.d.ts → types-B5Tsaalz.d.ts} +19 -2
- package/dist/workers/entry.mjs +2 -2
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { E as EmbeddingAdapter } from './adapters-79OIa4xm.js';
|
|
2
|
-
import { I as IndexInfo, f as IndexStats, P as PartitionStatsResult, B as BatchResult, L as ListParams, g as ListResult, Q as QueryParams, e as QueryResult, h as PreflightResult, i as SuggestParams, j as SuggestResult, M as MemoryStats, V as VectorMaintenanceResult } from './search-
|
|
3
|
-
import { I as IndexConfig, A as AnyDocument, a as InsertOptions, P as PartitionConfig } from './schema-
|
|
2
|
+
import { I as IndexInfo, f as IndexStats, P as PartitionStatsResult, B as BatchResult, L as ListParams, g as ListResult, Q as QueryParams, e as QueryResult, h as PreflightResult, i as SuggestParams, j as SuggestResult, M as MemoryStats, V as VectorMaintenanceResult } from './search-DHuXwJYk.js';
|
|
3
|
+
import { I as IndexConfig, A as AnyDocument, a as InsertOptions, P as PartitionConfig } from './schema-ZRbk8BgH.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Every event the engine emits, with the payload each one carries.
|
|
@@ -455,4 +455,4 @@ interface Narsil {
|
|
|
455
455
|
shutdown(): Promise<void>;
|
|
456
456
|
}
|
|
457
457
|
|
|
458
|
-
export type {
|
|
458
|
+
export type { NarsilEventMap as N, Narsil as a };
|
package/dist/index.browser.mjs
CHANGED
|
@@ -55,6 +55,8 @@ var ErrorCodes = {
|
|
|
55
55
|
NODE_BOOTSTRAP_FAILED: "NODE_BOOTSTRAP_FAILED",
|
|
56
56
|
NODE_ALREADY_JOINED: "NODE_ALREADY_JOINED",
|
|
57
57
|
NODE_NOT_JOINED: "NODE_NOT_JOINED",
|
|
58
|
+
NODE_NOT_READY: "NODE_NOT_READY",
|
|
59
|
+
NODE_NOT_CONTROLLER: "NODE_NOT_CONTROLLER",
|
|
58
60
|
COORDINATOR_DEPENDENCY_MISSING: "COORDINATOR_DEPENDENCY_MISSING",
|
|
59
61
|
TRANSPORT_DEPENDENCY_MISSING: "TRANSPORT_DEPENDENCY_MISSING",
|
|
60
62
|
REPLICATION_ENTRY_INVALID: "REPLICATION_ENTRY_INVALID",
|
|
@@ -2544,6 +2546,9 @@ function metadataToWire(meta) {
|
|
|
2544
2546
|
if (meta.indexUuid !== void 0) {
|
|
2545
2547
|
wire.index_uuid = meta.indexUuid;
|
|
2546
2548
|
}
|
|
2549
|
+
if (meta.heldPartitions !== void 0) {
|
|
2550
|
+
wire.held_partitions = meta.heldPartitions;
|
|
2551
|
+
}
|
|
2547
2552
|
return wire;
|
|
2548
2553
|
}
|
|
2549
2554
|
function wireToMetadata(raw) {
|
|
@@ -2633,8 +2638,14 @@ function wireToMetadata(raw) {
|
|
|
2633
2638
|
if (typeof raw.index_uuid === "string" && raw.index_uuid.length > 0) {
|
|
2634
2639
|
meta.indexUuid = raw.index_uuid;
|
|
2635
2640
|
}
|
|
2641
|
+
if (Array.isArray(raw.held_partitions) && raw.held_partitions.every(isNonNegativeInteger)) {
|
|
2642
|
+
meta.heldPartitions = raw.held_partitions;
|
|
2643
|
+
}
|
|
2636
2644
|
return meta;
|
|
2637
2645
|
}
|
|
2646
|
+
function isNonNegativeInteger(value) {
|
|
2647
|
+
return typeof value === "number" && Number.isInteger(value) && value >= 0;
|
|
2648
|
+
}
|
|
2638
2649
|
function isPositiveInteger2(value) {
|
|
2639
2650
|
return typeof value === "number" && Number.isInteger(value) && value >= 1;
|
|
2640
2651
|
}
|
|
@@ -15845,7 +15856,7 @@ function normalizePartitions(raw) {
|
|
|
15845
15856
|
}
|
|
15846
15857
|
const result = [];
|
|
15847
15858
|
for (const entry of raw) {
|
|
15848
|
-
if (!
|
|
15859
|
+
if (!isNonNegativeInteger2(entry?.partitionId)) {
|
|
15849
15860
|
throw new NarsilError(ErrorCodes.PERSISTENCE_LOAD_FAILED, "Segment manifest has a partition without a valid id", {
|
|
15850
15861
|
partitionId: entry?.partitionId
|
|
15851
15862
|
});
|
|
@@ -15880,7 +15891,7 @@ function normalizeSegments(raw, partitionId) {
|
|
|
15880
15891
|
const seenIds = /* @__PURE__ */ new Set();
|
|
15881
15892
|
const result = [];
|
|
15882
15893
|
for (const segment of raw) {
|
|
15883
|
-
if (!isSegmentId(segment?.id) || !
|
|
15894
|
+
if (!isSegmentId(segment?.id) || !isNonNegativeInteger2(segment.docCount) || !isNonNegativeInteger2(segment.tombstoneCount) || !isKey(segment.key)) {
|
|
15884
15895
|
throw new NarsilError(ErrorCodes.PERSISTENCE_LOAD_FAILED, "Segment manifest has an invalid segment reference", {
|
|
15885
15896
|
partitionId,
|
|
15886
15897
|
segment
|
|
@@ -15932,7 +15943,7 @@ function normalizeVectors(raw, partitionId) {
|
|
|
15932
15943
|
}
|
|
15933
15944
|
const result = [];
|
|
15934
15945
|
for (const vector of raw) {
|
|
15935
|
-
if (typeof vector?.fieldPath !== "string" || !
|
|
15946
|
+
if (typeof vector?.fieldPath !== "string" || !isNonNegativeInteger2(vector.generation) || !isKey(vector.key)) {
|
|
15936
15947
|
throw new NarsilError(ErrorCodes.PERSISTENCE_LOAD_FAILED, "Segment manifest has an invalid vector reference", {
|
|
15937
15948
|
partitionId,
|
|
15938
15949
|
vector
|
|
@@ -15942,7 +15953,7 @@ function normalizeVectors(raw, partitionId) {
|
|
|
15942
15953
|
}
|
|
15943
15954
|
return result;
|
|
15944
15955
|
}
|
|
15945
|
-
function
|
|
15956
|
+
function isNonNegativeInteger2(value) {
|
|
15946
15957
|
return typeof value === "number" && Number.isInteger(value) && value >= 0;
|
|
15947
15958
|
}
|
|
15948
15959
|
function isSegmentId(value) {
|
|
@@ -17728,6 +17739,7 @@ function createDurabilityManager(config, hooks, directoryOverride) {
|
|
|
17728
17739
|
const mode = config.mode ?? "sync";
|
|
17729
17740
|
const flushIntervalMs = config.flushIntervalMs ?? DEFAULT_ASYNC_FLUSH_INTERVAL_MS;
|
|
17730
17741
|
const indexes = /* @__PURE__ */ new Map();
|
|
17742
|
+
const metadataWrites = /* @__PURE__ */ new Map();
|
|
17731
17743
|
let checkpointTimer = null;
|
|
17732
17744
|
let asyncFlushTimer = null;
|
|
17733
17745
|
let shuttingDown = false;
|
|
@@ -17780,6 +17792,15 @@ function createDurabilityManager(config, hooks, directoryOverride) {
|
|
|
17780
17792
|
}
|
|
17781
17793
|
return partition;
|
|
17782
17794
|
}
|
|
17795
|
+
function queueMetadataWrite(indexName, write) {
|
|
17796
|
+
const previous = metadataWrites.get(indexName) ?? Promise.resolve();
|
|
17797
|
+
const queued = previous.then(write);
|
|
17798
|
+
metadataWrites.set(
|
|
17799
|
+
indexName,
|
|
17800
|
+
queued.catch(() => void 0)
|
|
17801
|
+
);
|
|
17802
|
+
return queued;
|
|
17803
|
+
}
|
|
17783
17804
|
function startCheckpointTimer() {
|
|
17784
17805
|
if (checkpointTimer !== null || shuttingDown || fatalError !== null || checkpointIntervalMs <= 0) {
|
|
17785
17806
|
return;
|
|
@@ -17937,6 +17958,9 @@ function createDurabilityManager(config, hooks, directoryOverride) {
|
|
|
17937
17958
|
}
|
|
17938
17959
|
startCheckpointTimer();
|
|
17939
17960
|
},
|
|
17961
|
+
highestPersistedSeqNo(indexName, partitionId) {
|
|
17962
|
+
return indexes.get(indexName)?.partitions.get(partitionId)?.appliedSeqNo ?? 0;
|
|
17963
|
+
},
|
|
17940
17964
|
async recordMutation(record) {
|
|
17941
17965
|
if (fatalError !== null) {
|
|
17942
17966
|
throw fatalError;
|
|
@@ -17984,14 +18008,16 @@ function createDurabilityManager(config, hooks, directoryOverride) {
|
|
|
17984
18008
|
}
|
|
17985
18009
|
return allocatedSeqNo;
|
|
17986
18010
|
},
|
|
17987
|
-
|
|
17988
|
-
|
|
17989
|
-
|
|
17990
|
-
|
|
17991
|
-
|
|
17992
|
-
|
|
17993
|
-
|
|
17994
|
-
|
|
18011
|
+
persistMetadata(indexName) {
|
|
18012
|
+
return queueMetadataWrite(indexName, async () => {
|
|
18013
|
+
const metadata = hooks.buildMetadata(indexName);
|
|
18014
|
+
if (metadata === void 0) {
|
|
18015
|
+
return;
|
|
18016
|
+
}
|
|
18017
|
+
const bytes = await writeMetadataEnvelope(metadata, { checksum: true });
|
|
18018
|
+
await directory.atomicWrite(`${indexName}/meta`, bytes);
|
|
18019
|
+
getOrCreateIndexState(indexName);
|
|
18020
|
+
});
|
|
17995
18021
|
},
|
|
17996
18022
|
checkpoint(indexName) {
|
|
17997
18023
|
return checkpointIndex(indexName);
|
|
@@ -18048,6 +18074,7 @@ function createSnapshotOnlyManager(adapter, config, hooks, publisher) {
|
|
|
18048
18074
|
const checkpointIntervalMs = config.checkpointIntervalMs ?? DEFAULT_CHECKPOINT_INTERVAL_MS;
|
|
18049
18075
|
const checkpointMutationThreshold = config.checkpointMutationThreshold ?? DEFAULT_CHECKPOINT_MUTATION_THRESHOLD;
|
|
18050
18076
|
const indexes = /* @__PURE__ */ new Map();
|
|
18077
|
+
const metadataWrites = /* @__PURE__ */ new Map();
|
|
18051
18078
|
let checkpointTimer = null;
|
|
18052
18079
|
let shuttingDown = false;
|
|
18053
18080
|
function getOrCreateIndexState(indexName) {
|
|
@@ -18126,6 +18153,15 @@ function createSnapshotOnlyManager(adapter, config, hooks, publisher) {
|
|
|
18126
18153
|
indexState.checkpointInFlight = run;
|
|
18127
18154
|
return run;
|
|
18128
18155
|
}
|
|
18156
|
+
function queueMetadataWrite(indexName, write) {
|
|
18157
|
+
const previous = metadataWrites.get(indexName) ?? Promise.resolve();
|
|
18158
|
+
const queued = previous.then(write);
|
|
18159
|
+
metadataWrites.set(
|
|
18160
|
+
indexName,
|
|
18161
|
+
queued.catch(() => void 0)
|
|
18162
|
+
);
|
|
18163
|
+
return queued;
|
|
18164
|
+
}
|
|
18129
18165
|
async function recoverIndex(indexName) {
|
|
18130
18166
|
const metaBytes = await adapter.load(metadataKey(indexName));
|
|
18131
18167
|
if (metaBytes === null) {
|
|
@@ -18160,6 +18196,9 @@ function createSnapshotOnlyManager(adapter, config, hooks, publisher) {
|
|
|
18160
18196
|
}
|
|
18161
18197
|
startCheckpointTimer();
|
|
18162
18198
|
},
|
|
18199
|
+
highestPersistedSeqNo() {
|
|
18200
|
+
return 0;
|
|
18201
|
+
},
|
|
18163
18202
|
async recordMutation(record) {
|
|
18164
18203
|
const indexState = getOrCreateIndexState(record.indexName);
|
|
18165
18204
|
const buffered = indexState.applyChain.then(() => record.apply());
|
|
@@ -18174,14 +18213,16 @@ function createSnapshotOnlyManager(adapter, config, hooks, publisher) {
|
|
|
18174
18213
|
}
|
|
18175
18214
|
return 0;
|
|
18176
18215
|
},
|
|
18177
|
-
|
|
18178
|
-
|
|
18179
|
-
|
|
18180
|
-
|
|
18181
|
-
|
|
18182
|
-
|
|
18183
|
-
|
|
18184
|
-
|
|
18216
|
+
persistMetadata(indexName) {
|
|
18217
|
+
return queueMetadataWrite(indexName, async () => {
|
|
18218
|
+
const metadata = hooks.buildMetadata(indexName);
|
|
18219
|
+
if (metadata === void 0) {
|
|
18220
|
+
return;
|
|
18221
|
+
}
|
|
18222
|
+
const bytes = await writeMetadataEnvelope(metadata, { checksum: true });
|
|
18223
|
+
await adapter.save(metadataKey(indexName), bytes);
|
|
18224
|
+
getOrCreateIndexState(indexName);
|
|
18225
|
+
});
|
|
18185
18226
|
},
|
|
18186
18227
|
checkpoint(indexName) {
|
|
18187
18228
|
return checkpointIndex(indexName);
|
|
@@ -18274,6 +18315,9 @@ function buildMetadata(indexName, hooks) {
|
|
|
18274
18315
|
if (config.indexUuid !== void 0) {
|
|
18275
18316
|
metadata.indexUuid = config.indexUuid;
|
|
18276
18317
|
}
|
|
18318
|
+
if (config.heldPartitions !== void 0) {
|
|
18319
|
+
metadata.heldPartitions = config.heldPartitions;
|
|
18320
|
+
}
|
|
18277
18321
|
return metadata;
|
|
18278
18322
|
}
|
|
18279
18323
|
function createDurabilityIntegration(tier, hooks) {
|
|
@@ -18335,6 +18379,7 @@ function createDurabilityFromTier(tier, wiring) {
|
|
|
18335
18379
|
} : void 0;
|
|
18336
18380
|
return {
|
|
18337
18381
|
...entry.indexUuid !== null ? { indexUuid: entry.indexUuid } : {},
|
|
18382
|
+
...entry.heldPartitions !== null ? { heldPartitions: entry.heldPartitions } : {},
|
|
18338
18383
|
schema: flattenSchema(entry.config.schema),
|
|
18339
18384
|
language: entry.language.name,
|
|
18340
18385
|
k1: entry.config.bm25?.k1 ?? 1.2,
|
|
@@ -19446,7 +19491,8 @@ function createEngineCore(config) {
|
|
|
19446
19491
|
embeddingAdapter,
|
|
19447
19492
|
embeddingAdapterName: adapterName,
|
|
19448
19493
|
vectorFieldPaths: getVectorFieldPaths(indexConfig.schema),
|
|
19449
|
-
indexUuid: metadata.indexUuid ?? null
|
|
19494
|
+
indexUuid: metadata.indexUuid ?? null,
|
|
19495
|
+
heldPartitions: metadata.heldPartitions ?? null
|
|
19450
19496
|
});
|
|
19451
19497
|
if (metadata.analysisRevision !== language.revision) {
|
|
19452
19498
|
analysisRebuild.markStale({
|
|
@@ -19726,7 +19772,8 @@ async function createEngineIndex(core, config, name, indexConfig, indexUuid) {
|
|
|
19726
19772
|
embeddingAdapter: resolvedEmbeddingAdapter,
|
|
19727
19773
|
embeddingAdapterName,
|
|
19728
19774
|
vectorFieldPaths: getVectorFieldPaths(indexConfig.schema),
|
|
19729
|
-
indexUuid: null
|
|
19775
|
+
indexUuid: null,
|
|
19776
|
+
heldPartitions: null
|
|
19730
19777
|
});
|
|
19731
19778
|
if (core.durability) {
|
|
19732
19779
|
await core.durability.manager.persistMetadata(name);
|
|
@@ -21656,7 +21703,8 @@ async function restoreFromSnapshot(indexName, data, deps) {
|
|
|
21656
21703
|
embeddingAdapter,
|
|
21657
21704
|
embeddingAdapterName: adapterName,
|
|
21658
21705
|
vectorFieldPaths: vectorFieldPaths2,
|
|
21659
|
-
indexUuid: null
|
|
21706
|
+
indexUuid: null,
|
|
21707
|
+
heldPartitions: null
|
|
21660
21708
|
});
|
|
21661
21709
|
try {
|
|
21662
21710
|
const manager = deps.requireManager(indexName);
|
|
@@ -22181,6 +22229,23 @@ function partitionsFor(manager, partitionIds) {
|
|
|
22181
22229
|
}
|
|
22182
22230
|
return partitions;
|
|
22183
22231
|
}
|
|
22232
|
+
function coverageFor(manager, partitionIds) {
|
|
22233
|
+
if (partitionIds === void 0) {
|
|
22234
|
+
return {
|
|
22235
|
+
totalPartitions: manager.partitionCount,
|
|
22236
|
+
queriedPartitions: manager.partitionCount,
|
|
22237
|
+
timedOutPartitions: 0,
|
|
22238
|
+
failedPartitions: 0
|
|
22239
|
+
};
|
|
22240
|
+
}
|
|
22241
|
+
const queriedPartitions = partitionsFor(manager, partitionIds).length;
|
|
22242
|
+
return {
|
|
22243
|
+
totalPartitions: partitionIds.length,
|
|
22244
|
+
queriedPartitions,
|
|
22245
|
+
timedOutPartitions: 0,
|
|
22246
|
+
failedPartitions: partitionIds.length - queriedPartitions
|
|
22247
|
+
};
|
|
22248
|
+
}
|
|
22184
22249
|
function partitionsForVectorSearch(manager, vecIndex, partitionIds) {
|
|
22185
22250
|
if (partitionIds === void 0) {
|
|
22186
22251
|
return void 0;
|
|
@@ -22642,7 +22707,8 @@ async function executeQuery(params, context) {
|
|
|
22642
22707
|
elapsed,
|
|
22643
22708
|
cursor: nextCursor,
|
|
22644
22709
|
facets,
|
|
22645
|
-
groups
|
|
22710
|
+
groups,
|
|
22711
|
+
coverage: coverageFor(manager, context.partitionIds)
|
|
22646
22712
|
};
|
|
22647
22713
|
}
|
|
22648
22714
|
async function executePreflight(params, context) {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { c as StopWordOverride, C as CustomTokenizer } from './schema-
|
|
2
|
-
export { A as AnyDocument, B as BM25Params, E as EmbeddingFieldConfig, F as FieldType, I as IndexConfig, a as InsertOptions, P as PartitionConfig, S as SchemaDefinition, b as ScoringMode, V as VectorIndexConfig, d as VectorQuantizationMode } from './schema-
|
|
1
|
+
import { c as StopWordOverride, C as CustomTokenizer } from './schema-ZRbk8BgH.js';
|
|
2
|
+
export { A as AnyDocument, B as BM25Params, E as EmbeddingFieldConfig, F as FieldType, I as IndexConfig, a as InsertOptions, P as PartitionConfig, S as SchemaDefinition, b as ScoringMode, V as VectorIndexConfig, d as VectorQuantizationMode } from './schema-ZRbk8BgH.js';
|
|
3
3
|
import { L as LanguageModule } from './language-DB8KG1z5.js';
|
|
4
4
|
export { T as TokenizerConfig } from './language-DB8KG1z5.js';
|
|
5
|
-
export { A as ArrayFilter, B as BatchResult, C as ClientErrorCode, a as ClientErrorCodes, k as ComparisonFilter, D as DocumentProjection, E as ErrorCode, b as ErrorCodes, F as FacetConfig, l as FacetResult, m as FieldFilter, n as FilterExpression, G as GeoFilter, o as GeoPolygonFilter, p as GeoRadiusFilter, q as GroupConfig, r as GroupReducer, s as GroupResult, H as HighlightConfig, t as HighlightMatch, u as Hit, v as HybridConfig, I as IndexInfo, f as IndexStats, L as ListParams, g as ListResult, w as ListedDocument, M as MemoryStats, N as NarsilError, c as NarsilErrorCode, P as PartitionStatsResult, h as PreflightResult, x as PresenceFilter, y as ProcessMemoryReport, Q as QueryParams, e as QueryResult,
|
|
6
|
-
import { N as NarsilConfig } from './config-
|
|
7
|
-
export { A as AnalysisConfig, D as DurabilityConfig, I as IndexContext, a as InsertContext, b as NarsilPlugin, P as PartitionContext, R as RemoveContext, S as SearchContext, c as StaleAnalysis, U as UpdateContext, W as WorkerConfig, d as WorkerContext } from './config-
|
|
8
|
-
import {
|
|
9
|
-
export {
|
|
5
|
+
export { A as ArrayFilter, B as BatchResult, C as ClientErrorCode, a as ClientErrorCodes, k as ComparisonFilter, D as DocumentProjection, E as ErrorCode, b as ErrorCodes, F as FacetConfig, l as FacetResult, m as FieldFilter, n as FilterExpression, G as GeoFilter, o as GeoPolygonFilter, p as GeoRadiusFilter, q as GroupConfig, r as GroupReducer, s as GroupResult, H as HighlightConfig, t as HighlightMatch, u as Hit, v as HybridConfig, I as IndexInfo, f as IndexStats, L as ListParams, g as ListResult, w as ListedDocument, M as MemoryStats, N as NarsilError, c as NarsilErrorCode, P as PartitionStatsResult, h as PreflightResult, x as PresenceFilter, y as ProcessMemoryReport, z as QueryCoverage, Q as QueryParams, e as QueryResult, J as ScoreComponents, K as SearchMode, S as ServerErrorCode, d as ServerErrorCodes, O as SortField, R as SortSpec, T as StringFilter, i as SuggestParams, j as SuggestResult, U as TermMatchPolicy, V as VectorMaintenanceResult, W as VectorQueryConfig } from './search-DHuXwJYk.js';
|
|
6
|
+
import { N as NarsilConfig } from './config-Byyl1QqH.js';
|
|
7
|
+
export { A as AnalysisConfig, D as DurabilityConfig, I as IndexContext, a as InsertContext, b as NarsilPlugin, P as PartitionContext, R as RemoveContext, S as SearchContext, c as StaleAnalysis, U as UpdateContext, W as WorkerConfig, d as WorkerContext } from './config-Byyl1QqH.js';
|
|
8
|
+
import { a as Narsil } from './engine-BE45D5ZG.js';
|
|
9
|
+
export { N as NarsilEventMap } from './engine-BE45D5ZG.js';
|
|
10
10
|
export { E as EmbeddingAdapter, I as InvalidationAdapter, a as InvalidationEvent, b as PartitionStatistics, P as PersistenceAdapter } from './adapters-79OIa4xm.js';
|
|
11
11
|
|
|
12
12
|
/**
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
export { VERSION, createNarsil } from './chunk-
|
|
2
|
-
import './chunk-
|
|
3
|
-
|
|
1
|
+
export { VERSION, createNarsil } from './chunk-MMSWEEZT.mjs';
|
|
2
|
+
import './chunk-JQUL2T6I.mjs';
|
|
3
|
+
import './chunk-WU2UZEVD.mjs';
|
|
4
|
+
export { clearNormalizationCache, configureNormalizationCache, getLanguage, getNormalizationCacheSize, getStopWords, getTokenizer, hasStopWords, hasTokenizer, registerLanguage, registerStopWords, registerTokenizer, resetNormalizationCache } from './chunk-GRWFY2HI.mjs';
|
|
4
5
|
import './chunk-TGP5M5R7.mjs';
|
|
5
6
|
import './chunk-OBXS7OZM.mjs';
|
|
6
7
|
export { isSimdAvailable } from './chunk-WDL632CN.mjs';
|
|
@@ -8,4 +9,4 @@ import './chunk-KMMJMDUA.mjs';
|
|
|
8
9
|
import './chunk-U2BKYEC7.mjs';
|
|
9
10
|
import './chunk-BFIH7OV5.mjs';
|
|
10
11
|
import './chunk-WTONLDU3.mjs';
|
|
11
|
-
export { ClientErrorCodes, ErrorCodes, NarsilError, ServerErrorCodes } from './chunk-
|
|
12
|
+
export { ClientErrorCodes, ErrorCodes, NarsilError, ServerErrorCodes } from './chunk-GB2IIJJG.mjs';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { C as ClusterNamespace } from './config-fLC4lbmg.js';
|
|
1
2
|
import { E as EmbeddingAdapter } from './adapters-79OIa4xm.js';
|
|
2
3
|
import { h as TaskStore } from './tasks-CnMLpfk-.js';
|
|
3
4
|
|
|
@@ -194,6 +195,14 @@ interface ServerOptions {
|
|
|
194
195
|
* is controlled elsewhere.
|
|
195
196
|
*/
|
|
196
197
|
allowInsecure?: boolean;
|
|
198
|
+
/**
|
|
199
|
+
* The cluster-facing side of the node this server fronts, which is
|
|
200
|
+
* `node.cluster` on a {@link ClusterNode}. With it set, `/readyz` answers
|
|
201
|
+
* 200 only while the node reports `SERVING`, `/cluster` reports the
|
|
202
|
+
* topology, and `/indexes/:name/cluster` reports one index's allocation.
|
|
203
|
+
* Without it, both cluster routes answer 501.
|
|
204
|
+
*/
|
|
205
|
+
cluster?: ClusterNamespace;
|
|
197
206
|
}
|
|
198
207
|
/**
|
|
199
208
|
* The running HTTP server, as {@link createServer} returns it.
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import { P as PartitionConfig, b as ScoringMode, V as VectorIndexConfig } from '../../schema-
|
|
1
|
+
import { P as PartitionConfig, b as ScoringMode, V as VectorIndexConfig } from '../../schema-ZRbk8BgH.js';
|
|
2
2
|
import '../../adapters-79OIa4xm.js';
|
|
3
3
|
|
|
4
4
|
interface IndexMetadata {
|
|
5
5
|
indexName: string;
|
|
6
6
|
/** The identity a cluster gave the index at creation; absent on a single engine. */
|
|
7
7
|
indexUuid?: string;
|
|
8
|
+
/** The partitions this copy holds, which a cluster node answers a partition-stores request from. */
|
|
9
|
+
heldPartitions?: number[];
|
|
8
10
|
schema: Record<string, string>;
|
|
9
11
|
language: string;
|
|
10
12
|
partitionCount: number;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { createDurableDirectory, writeSegmentedCheckpoint } from '../../chunk-
|
|
2
|
-
import '../../chunk-
|
|
3
|
-
import '../../chunk-
|
|
1
|
+
import { createDurableDirectory, writeSegmentedCheckpoint } from '../../chunk-MMSWEEZT.mjs';
|
|
2
|
+
import '../../chunk-JQUL2T6I.mjs';
|
|
3
|
+
import '../../chunk-WU2UZEVD.mjs';
|
|
4
|
+
import '../../chunk-GRWFY2HI.mjs';
|
|
4
5
|
import '../../chunk-TGP5M5R7.mjs';
|
|
5
6
|
import '../../chunk-OBXS7OZM.mjs';
|
|
6
7
|
import '../../chunk-WDL632CN.mjs';
|
|
@@ -8,7 +9,7 @@ import '../../chunk-KMMJMDUA.mjs';
|
|
|
8
9
|
import '../../chunk-U2BKYEC7.mjs';
|
|
9
10
|
import '../../chunk-BFIH7OV5.mjs';
|
|
10
11
|
import '../../chunk-WTONLDU3.mjs';
|
|
11
|
-
import '../../chunk-
|
|
12
|
+
import '../../chunk-GB2IIJJG.mjs';
|
|
12
13
|
|
|
13
14
|
// src/persistence/durability/rebuild.ts
|
|
14
15
|
async function rebuildSnapshotFromDurable(root, metadata, targets, compactionThreshold) {
|
package/dist/react.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { N as NarsilError, L as ListParams, g as ListResult, I as IndexInfo, f as IndexStats, Q as QueryParams, h as PreflightResult, e as QueryResult, i as SuggestParams, j as SuggestResult } from './search-
|
|
2
|
-
export { C as ClientErrorCode, a as ClientErrorCodes, E as ErrorCode, b as ErrorCodes, c as NarsilErrorCode, S as ServerErrorCode, d as ServerErrorCodes } from './search-
|
|
1
|
+
import { N as NarsilError, L as ListParams, g as ListResult, I as IndexInfo, f as IndexStats, Q as QueryParams, h as PreflightResult, e as QueryResult, i as SuggestParams, j as SuggestResult } from './search-DHuXwJYk.js';
|
|
2
|
+
export { C as ClientErrorCode, a as ClientErrorCodes, E as ErrorCode, b as ErrorCodes, c as NarsilErrorCode, S as ServerErrorCode, d as ServerErrorCodes } from './search-DHuXwJYk.js';
|
|
3
3
|
import { e as TaskRecord, d as TaskProgress, b as ImportResult, c as TaskListQuery, T as TaskListPage } from './tasks-CnMLpfk-.js';
|
|
4
4
|
export { I as ImportError, f as TaskStatus, g as TaskType } from './tasks-CnMLpfk-.js';
|
|
5
5
|
import { ReactNode, ReactElement } from 'react';
|
|
6
|
-
import { N as NarsilClient, I as ImportSource } from './client-
|
|
7
|
-
import { A as AnyDocument } from './schema-
|
|
6
|
+
import { N as NarsilClient, I as ImportSource } from './client-BobVnoIK.js';
|
|
7
|
+
import { A as AnyDocument } from './schema-ZRbk8BgH.js';
|
|
8
8
|
import './adapters-79OIa4xm.js';
|
|
9
9
|
|
|
10
10
|
/**
|
package/dist/react.mjs
CHANGED
|
@@ -55,6 +55,8 @@ var ErrorCodes = {
|
|
|
55
55
|
NODE_BOOTSTRAP_FAILED: "NODE_BOOTSTRAP_FAILED",
|
|
56
56
|
NODE_ALREADY_JOINED: "NODE_ALREADY_JOINED",
|
|
57
57
|
NODE_NOT_JOINED: "NODE_NOT_JOINED",
|
|
58
|
+
NODE_NOT_READY: "NODE_NOT_READY",
|
|
59
|
+
NODE_NOT_CONTROLLER: "NODE_NOT_CONTROLLER",
|
|
58
60
|
COORDINATOR_DEPENDENCY_MISSING: "COORDINATOR_DEPENDENCY_MISSING",
|
|
59
61
|
TRANSPORT_DEPENDENCY_MISSING: "TRANSPORT_DEPENDENCY_MISSING",
|
|
60
62
|
REPLICATION_ENTRY_INVALID: "REPLICATION_ENTRY_INVALID",
|
|
@@ -9,6 +9,7 @@ import { E as EmbeddingAdapter } from './adapters-79OIa4xm.js';
|
|
|
9
9
|
* @public
|
|
10
10
|
*/
|
|
11
11
|
type AnyDocument = Record<string, unknown> & {
|
|
12
|
+
/** Identifier the engine stores this document under when you insert without passing one separately. */
|
|
12
13
|
id?: string;
|
|
13
14
|
};
|
|
14
15
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as AnyDocument, S as SchemaDefinition, b as ScoringMode } from './schema-
|
|
1
|
+
import { A as AnyDocument, S as SchemaDefinition, b as ScoringMode } from './schema-ZRbk8BgH.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Every code a {@link NarsilError} carries, grouped by the part of the engine
|
|
@@ -64,6 +64,8 @@ declare const ErrorCodes: {
|
|
|
64
64
|
readonly NODE_BOOTSTRAP_FAILED: "NODE_BOOTSTRAP_FAILED";
|
|
65
65
|
readonly NODE_ALREADY_JOINED: "NODE_ALREADY_JOINED";
|
|
66
66
|
readonly NODE_NOT_JOINED: "NODE_NOT_JOINED";
|
|
67
|
+
readonly NODE_NOT_READY: "NODE_NOT_READY";
|
|
68
|
+
readonly NODE_NOT_CONTROLLER: "NODE_NOT_CONTROLLER";
|
|
67
69
|
readonly COORDINATOR_DEPENDENCY_MISSING: "COORDINATOR_DEPENDENCY_MISSING";
|
|
68
70
|
readonly TRANSPORT_DEPENDENCY_MISSING: "TRANSPORT_DEPENDENCY_MISSING";
|
|
69
71
|
readonly REPLICATION_ENTRY_INVALID: "REPLICATION_ENTRY_INVALID";
|
|
@@ -229,6 +231,29 @@ interface QueryResult<T = AnyDocument> {
|
|
|
229
231
|
groups?: GroupResult[];
|
|
230
232
|
/** This turns true when the index's terms came from an older analysis than its language module produces now. */
|
|
231
233
|
analysisStale?: boolean;
|
|
234
|
+
/** The search read this much of the index, which is how you spot a degraded answer. */
|
|
235
|
+
coverage: QueryCoverage;
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* How much of an index one search read, which is what you check before you
|
|
239
|
+
* trust a count or a ranking.
|
|
240
|
+
*
|
|
241
|
+
* An embedded engine reads every partition it holds, so `queriedPartitions`
|
|
242
|
+
* matches `totalPartitions` there and the other two stay zero. A search across
|
|
243
|
+
* a cluster may find a node slow or unreachable, which it counts here while
|
|
244
|
+
* still returning the hits the other nodes gave it.
|
|
245
|
+
*
|
|
246
|
+
* @public
|
|
247
|
+
*/
|
|
248
|
+
interface QueryCoverage {
|
|
249
|
+
/** The search should have read this many partitions. */
|
|
250
|
+
totalPartitions: number;
|
|
251
|
+
/** The search read this many of them. */
|
|
252
|
+
queriedPartitions: number;
|
|
253
|
+
/** The search counts a partition here when the node holding it took longer than the query allowed. */
|
|
254
|
+
timedOutPartitions: number;
|
|
255
|
+
/** The search counts a partition here when the node holding it returned an error, and when no active replica served it. */
|
|
256
|
+
failedPartitions: number;
|
|
232
257
|
}
|
|
233
258
|
/**
|
|
234
259
|
* One matching document, with the score that ranked it.
|
|
@@ -806,7 +831,9 @@ interface QueryParams {
|
|
|
806
831
|
* @public
|
|
807
832
|
*/
|
|
808
833
|
type DocumentProjection = boolean | {
|
|
834
|
+
/** Names the fields to keep, so every field left out of this list is dropped. */
|
|
809
835
|
include?: string[];
|
|
836
|
+
/** Names the fields to drop, so every other field is kept. */
|
|
810
837
|
exclude?: string[];
|
|
811
838
|
};
|
|
812
839
|
/**
|
|
@@ -996,4 +1023,4 @@ interface ListParams {
|
|
|
996
1023
|
document?: DocumentProjection;
|
|
997
1024
|
}
|
|
998
1025
|
|
|
999
|
-
export { type ArrayFilter as A, type BatchResult as B, type ClientErrorCode as C, type DocumentProjection as D, type ErrorCode as E, type FacetConfig as F, type GeoFilter as G, type HighlightConfig as H, type IndexInfo as I, type
|
|
1026
|
+
export { type ArrayFilter as A, type BatchResult as B, type ClientErrorCode as C, type DocumentProjection as D, type ErrorCode as E, type FacetConfig as F, type GeoFilter as G, type HighlightConfig as H, type IndexInfo as I, type ScoreComponents as J, type SearchMode as K, type ListParams as L, type MemoryStats as M, NarsilError as N, type SortField as O, type PartitionStatsResult as P, type QueryParams as Q, type SortSpec as R, type ServerErrorCode as S, type StringFilter as T, type TermMatchPolicy as U, type VectorMaintenanceResult as V, type VectorQueryConfig as W, ClientErrorCodes as a, ErrorCodes as b, type NarsilErrorCode as c, ServerErrorCodes as d, type QueryResult as e, type IndexStats as f, type ListResult as g, type PreflightResult as h, type SuggestParams as i, type SuggestResult as j, type ComparisonFilter as k, type FacetResult as l, type FieldFilter as m, type FilterExpression as n, type GeoPolygonFilter as o, type GeoRadiusFilter as p, type GroupConfig as q, type GroupReducer as r, type GroupResult as s, type HighlightMatch as t, type Hit as u, type HybridConfig as v, type ListedDocument as w, type PresenceFilter as x, type ProcessMemoryReport as y, type QueryCoverage as z };
|
package/dist/server.d.ts
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
import { b as ServerOptions, N as NarsilServer } from './options-
|
|
2
|
-
export { A as ASYNC_IMPORT_CAPABILITY, C as CorsOptions, E as ErrorEnvelope, O as OnRequestHook, R as REBUILD_ANALYSIS_CAPABILITY, c as RequestContext, d as RequestDenial, S as SERVER_CAPABILITIES, e as ServerLimits, T as TASK_CANCEL_CAPABILITY, a as TASK_FILTER_CAPABILITY } from './options-
|
|
3
|
-
import {
|
|
1
|
+
import { b as ServerOptions, N as NarsilServer } from './options-EXYFcem-.js';
|
|
2
|
+
export { A as ASYNC_IMPORT_CAPABILITY, C as CorsOptions, E as ErrorEnvelope, O as OnRequestHook, R as REBUILD_ANALYSIS_CAPABILITY, c as RequestContext, d as RequestDenial, S as SERVER_CAPABILITIES, e as ServerLimits, T as TASK_CANCEL_CAPABILITY, a as TASK_FILTER_CAPABILITY } from './options-EXYFcem-.js';
|
|
3
|
+
import { a as Narsil } from './engine-BE45D5ZG.js';
|
|
4
4
|
import { h as TaskStore, e as TaskRecord, d as TaskProgress, b as ImportResult } from './tasks-CnMLpfk-.js';
|
|
5
5
|
export { C as CapabilitiesResponse, a as CreateIndexEmbedding, i as CreateIndexRequest, H as HttpIndexConfig, I as ImportError, T as TaskListPage, c as TaskListQuery, f as TaskStatus, g as TaskType } from './tasks-CnMLpfk-.js';
|
|
6
|
-
export { d as ServerErrorCodes } from './search-
|
|
6
|
+
export { d as ServerErrorCodes } from './search-DHuXwJYk.js';
|
|
7
|
+
import './config-fLC4lbmg.js';
|
|
8
|
+
import './config-Byyl1QqH.js';
|
|
7
9
|
import './adapters-79OIa4xm.js';
|
|
8
|
-
import './schema-
|
|
10
|
+
import './schema-ZRbk8BgH.js';
|
|
11
|
+
import './types-B5Tsaalz.js';
|
|
12
|
+
import './types-D5OwhtsQ.js';
|
|
9
13
|
|
|
10
14
|
/**
|
|
11
15
|
* Wraps a Narsil engine in an HTTP server. The caller builds and owns the engine
|