@delali/narsil 0.2.4-next.42 → 0.2.4-next.44
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/{chunk-GB2IIJJG.mjs → chunk-P4ELXVJQ.mjs} +2 -4
- package/dist/{chunk-MMSWEEZT.mjs → chunk-WASNWIEK.mjs} +1452 -373
- package/dist/{chunk-GRWFY2HI.mjs → chunk-XNCJFU2E.mjs} +239 -61
- package/dist/{chunk-WU2UZEVD.mjs → chunk-XWICBGYT.mjs} +1 -1
- package/dist/{client-BobVnoIK.d.ts → client-C5BkUqB8.d.ts} +26 -3
- package/dist/client.d.ts +8 -8
- package/dist/client.mjs +12 -6
- package/dist/{config-fLC4lbmg.d.ts → config-B-ZI-ft5.d.ts} +2 -2
- package/dist/{config-Byyl1QqH.d.ts → config-BZRExglL.d.ts} +20 -3
- package/dist/{direct-executor-MSJEVPZU.mjs → direct-executor-IMXNRS7O.mjs} +2 -2
- package/dist/distribution/coordinator/etcd.d.ts +2 -2
- package/dist/distribution/coordinator/etcd.mjs +1 -1
- package/dist/distribution/coordinator/in-memory.d.ts +2 -2
- package/dist/distribution/transport/grpc.mjs +1 -1
- package/dist/distribution.d.ts +24 -10
- package/dist/distribution.mjs +1721 -1129
- package/dist/embeddings/openai.mjs +1 -1
- package/dist/{engine-BE45D5ZG.d.ts → engine-Cjr1uBLa.d.ts} +47 -24
- package/dist/index.browser.mjs +1668 -416
- package/dist/index.d.ts +9 -9
- package/dist/index.mjs +4 -4
- package/dist/{options-EXYFcem-.d.ts → options-BC68VPoE.d.ts} +10 -3
- package/dist/persistence/durability/checkpoint-worker.d.ts +3 -1
- package/dist/persistence/durability/checkpoint-worker.mjs +4 -4
- package/dist/react.d.ts +6 -6
- package/dist/react.mjs +2 -4
- package/dist/{schema-ZRbk8BgH.d.ts → schema-B7juWg8Q.d.ts} +17 -6
- package/dist/{search-DHuXwJYk.d.ts → search-DDHjfXhJ.d.ts} +35 -11
- package/dist/server.d.ts +10 -10
- package/dist/server.mjs +30 -12
- package/dist/{tasks-CnMLpfk-.d.ts → tasks-Bn4R1NPN.d.ts} +1 -1
- package/dist/{types-B5Tsaalz.d.ts → types-DsSSjY4d.d.ts} +1 -1
- 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,
|
|
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-DDHjfXhJ.js';
|
|
3
|
+
import { I as IndexConfig, A as AnyDocument, b as InsertOptions, P as PartitionConfig } from './schema-B7juWg8Q.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Every event the engine emits, with the payload each one carries.
|
|
@@ -13,18 +13,12 @@ import { I as IndexConfig, A as AnyDocument, a as InsertOptions, P as PartitionC
|
|
|
13
13
|
* @public
|
|
14
14
|
*/
|
|
15
15
|
type NarsilEventMap = {
|
|
16
|
-
/**
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
/** The adapter threw this. */
|
|
23
|
-
error: Error;
|
|
24
|
-
/** This turns true once the engine has given up retrying, which means the partition stays unsaved. */
|
|
25
|
-
retriesExhausted: boolean;
|
|
26
|
-
};
|
|
27
|
-
/** A worker thread died, and the engine has rebuilt the indexes it held. */
|
|
16
|
+
/**
|
|
17
|
+
* A worker thread died. The pool drops it and fails its outstanding requests
|
|
18
|
+
* with `WORKER_CRASHED`, while the remaining workers keep answering because
|
|
19
|
+
* each holds a full worker copy of every promoted index. Once no worker is
|
|
20
|
+
* left, queries fall back to the main thread, which holds every document.
|
|
21
|
+
*/
|
|
28
22
|
workerCrash: {
|
|
29
23
|
/** This worker died. */
|
|
30
24
|
workerId: number;
|
|
@@ -94,6 +88,28 @@ type NarsilEventMap = {
|
|
|
94
88
|
};
|
|
95
89
|
};
|
|
96
90
|
|
|
91
|
+
/**
|
|
92
|
+
* Opens and closes durable indexes without deleting them.
|
|
93
|
+
*
|
|
94
|
+
* @public
|
|
95
|
+
*/
|
|
96
|
+
interface IndexLifecycleOperations {
|
|
97
|
+
/**
|
|
98
|
+
* Loads a closed index from its durable checkpoint and resets a parked recovery failure.
|
|
99
|
+
*
|
|
100
|
+
* @param indexName - The index to load.
|
|
101
|
+
* @returns A promise that settles when the index is ready for operations.
|
|
102
|
+
*/
|
|
103
|
+
open(indexName: string): Promise<void>;
|
|
104
|
+
/**
|
|
105
|
+
* Drains active work, checkpoints the index, releases its memory, and keeps its durable files.
|
|
106
|
+
*
|
|
107
|
+
* @param indexName - The index to close.
|
|
108
|
+
* @returns A promise that settles after the index releases its memory.
|
|
109
|
+
*/
|
|
110
|
+
close(indexName: string): Promise<void>;
|
|
111
|
+
}
|
|
112
|
+
|
|
97
113
|
/**
|
|
98
114
|
* The search engine, and everything you do with it.
|
|
99
115
|
*
|
|
@@ -103,7 +119,7 @@ type NarsilEventMap = {
|
|
|
103
119
|
*
|
|
104
120
|
* @public
|
|
105
121
|
*/
|
|
106
|
-
interface Narsil {
|
|
122
|
+
interface Narsil extends IndexLifecycleOperations {
|
|
107
123
|
/**
|
|
108
124
|
* Creates an index you can insert documents into and query.
|
|
109
125
|
*
|
|
@@ -146,7 +162,7 @@ interface Narsil {
|
|
|
146
162
|
* an index grows unevenly or a rebalance is worth running.
|
|
147
163
|
*
|
|
148
164
|
* @param indexName - The index to describe.
|
|
149
|
-
* @returns One entry per partition, in partition order.
|
|
165
|
+
* @returns One entry per open partition, in partition order, or an empty list while the index is closed.
|
|
150
166
|
*/
|
|
151
167
|
getPartitionStats(indexName: string): PartitionStatsResult[];
|
|
152
168
|
/**
|
|
@@ -296,8 +312,11 @@ interface Narsil {
|
|
|
296
312
|
*/
|
|
297
313
|
query<T = AnyDocument>(indexName: string, params: QueryParams): Promise<QueryResult<T>>;
|
|
298
314
|
/**
|
|
299
|
-
* Counts what a query would match without building
|
|
300
|
-
*
|
|
315
|
+
* Counts what a query would match without building a single hit, which is
|
|
316
|
+
* how a result-count badge stays cheap. A full-text count also skips scoring
|
|
317
|
+
* unless the query carries `minScore`, which prunes matches by score, or a
|
|
318
|
+
* `termMatch` policy other than `any`, which prunes them by term coverage. A
|
|
319
|
+
* vector or hybrid count still runs its search.
|
|
301
320
|
*
|
|
302
321
|
* @param indexName - The index the query would run against.
|
|
303
322
|
* @param params - The same parameters {@link Narsil.query} takes. Anything
|
|
@@ -341,13 +360,17 @@ interface Narsil {
|
|
|
341
360
|
*/
|
|
342
361
|
snapshot(indexName: string): Promise<Uint8Array>;
|
|
343
362
|
/**
|
|
344
|
-
* Loads an index from
|
|
363
|
+
* Loads an index from snapshot bytes, replacing whatever the name held.
|
|
364
|
+
*
|
|
365
|
+
* The engine reads the `.nrsl` envelope {@link Narsil.snapshot} writes, and
|
|
366
|
+
* it also reads the headerless MessagePack form earlier releases wrote.
|
|
345
367
|
*
|
|
346
368
|
* @param indexName - The name the restored index takes.
|
|
347
369
|
* @param data - Bytes a {@link Narsil.snapshot} produced.
|
|
348
|
-
* @throws A `NarsilError` with `
|
|
349
|
-
*
|
|
350
|
-
*
|
|
370
|
+
* @throws A `NarsilError` with `ENVELOPE_VERSION_MISMATCH` when the envelope
|
|
371
|
+
* carries a different format version, `PERSISTENCE_CRC_MISMATCH` when the
|
|
372
|
+
* payload fails its checksum, or `DOC_VALIDATION_FAILED` when the bytes hold
|
|
373
|
+
* no snapshot.
|
|
351
374
|
*/
|
|
352
375
|
restore(indexName: string, data: Uint8Array): Promise<void>;
|
|
353
376
|
/**
|
|
@@ -421,7 +444,7 @@ interface Narsil {
|
|
|
421
444
|
* optimisation would cost.
|
|
422
445
|
*
|
|
423
446
|
* @param indexName - The index to describe.
|
|
424
|
-
* @returns One entry per vector field.
|
|
447
|
+
* @returns One entry per vector field, or an empty list while the index is closed.
|
|
425
448
|
*/
|
|
426
449
|
vectorMaintenanceStatus(indexName: string): VectorMaintenanceResult[];
|
|
427
450
|
/**
|
|
@@ -455,4 +478,4 @@ interface Narsil {
|
|
|
455
478
|
shutdown(): Promise<void>;
|
|
456
479
|
}
|
|
457
480
|
|
|
458
|
-
export type { NarsilEventMap as N, Narsil as a };
|
|
481
|
+
export type { IndexLifecycleOperations as I, NarsilEventMap as N, Narsil as a };
|