@delali/narsil 0.2.4-next.54 → 0.2.4-next.59
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 +39 -28
- package/dist/adapters/filesystem.mjs +1 -1
- package/dist/adapters/indexeddb.mjs +1 -1
- package/dist/{capabilities-DlYw0Ov0.d.ts → capabilities-DSsOGz6F.d.ts} +2 -2
- package/dist/{chunk-BH5SYB5W.mjs → chunk-24RXHMEL.mjs} +604 -150
- package/dist/{chunk-D2S642IV.mjs → chunk-3LHGNRYE.mjs} +1 -1
- package/dist/{chunk-TVT5V4E7.mjs → chunk-B2TFROFX.mjs} +299 -168
- package/dist/{chunk-L225SHNB.mjs → chunk-L6TNPLAR.mjs} +19 -5
- package/dist/{chunk-U2AL3SON.mjs → chunk-THYRHHO2.mjs} +3 -3
- package/dist/{chunk-NTZYA3SJ.mjs → chunk-U7KYW4BA.mjs} +3 -3
- package/dist/{chunk-FRQVMFY7.mjs → chunk-USKFU7J5.mjs} +1 -0
- package/dist/{chunk-4NVPQ6S5.mjs → chunk-UXNWQZST.mjs} +12 -3
- package/dist/{chunk-RGS7FMCB.mjs → chunk-VMRR3DQU.mjs} +74 -16
- package/dist/{chunk-2GWVQWGA.mjs → chunk-YMZCMH5M.mjs} +45 -1
- package/dist/{chunk-UTOFOJOR.mjs → chunk-YNVIUGF5.mjs} +6 -2
- package/dist/{chunk-5T6AOR37.mjs → chunk-ZNZBXMP5.mjs} +601 -60
- package/dist/{chunk-XNQAIO74.mjs → chunk-ZZT3EAUC.mjs} +177 -309
- package/dist/{client-CQUqt9Ir.d.ts → client-BQK6Tf6A.d.ts} +3 -3
- package/dist/client.d.ts +8 -8
- package/dist/client.mjs +1 -0
- package/dist/{config-CNas6wJH.d.ts → config-BhldZgaK.d.ts} +2 -2
- package/dist/{config-bXxnJrQc.d.ts → config-DmXULPa-.d.ts} +15 -7
- package/dist/direct-executor-ALAVE7FC.mjs +12 -0
- package/dist/distribution/coordinator/etcd.d.ts +2 -2
- package/dist/distribution/coordinator/etcd.mjs +2 -2
- package/dist/distribution/coordinator/in-memory.d.ts +2 -2
- package/dist/distribution/coordinator/in-memory.mjs +1 -1
- package/dist/distribution/transport/grpc.mjs +1 -1
- package/dist/distribution.d.ts +8 -8
- package/dist/distribution.mjs +382 -162
- package/dist/embeddings/openai.mjs +2 -2
- package/dist/{engine-Dj4I91Jv.d.ts → engine-CIOyFozK.d.ts} +15 -12
- package/dist/index.browser.mjs +1565 -528
- package/dist/index.d.ts +7 -7
- package/dist/index.mjs +11 -11
- package/dist/invalidation/filesystem.mjs +1 -1
- package/dist/{memory-xrXOZMbw.d.ts → memory-yFaVn2xZ.d.ts} +199 -107
- package/dist/persistence/durability/checkpoint-worker.d.ts +1 -1
- package/dist/persistence/durability/checkpoint-worker.mjs +11 -11
- package/dist/react.d.ts +6 -6
- package/dist/react.mjs +1 -0
- package/dist/{schema-mLpXZBEh.d.ts → schema-d5Afu03A.d.ts} +7 -2
- package/dist/server.d.ts +10 -10
- package/dist/server.mjs +10 -10
- package/dist/{tasks-Df73Tjgq.d.ts → tasks-CH2Dod8w.d.ts} +1 -1
- package/dist/{thread-5UP6MGED.mjs → thread-DYHEQRVY.mjs} +14 -10
- package/dist/{types-BTIVO8DI.d.ts → types-DAK7mnUZ.d.ts} +1 -1
- package/dist/vector/search-worker.d.ts +1 -1
- package/dist/vector/search-worker.mjs +4 -4
- package/dist/workers/entry.mjs +4 -4
- package/package.json +9 -9
- package/dist/direct-executor-RBA5O7EN.mjs +0 -12
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { NarsilError, ErrorCodes } from '../chunk-
|
|
1
|
+
import { NarsilError, ErrorCodes } from '../chunk-USKFU7J5.mjs';
|
|
2
2
|
|
|
3
3
|
// src/embeddings/constants.ts
|
|
4
|
-
var RETRYABLE_STATUS_CODES = /* @__PURE__ */ new Set([429, 500, 502, 503]);
|
|
4
|
+
var RETRYABLE_STATUS_CODES = /* @__PURE__ */ new Set([429, 500, 502, 503, 504]);
|
|
5
5
|
var MAX_BACKOFF_MS = 3e4;
|
|
6
6
|
var BASE_BACKOFF_MS = 1e3;
|
|
7
7
|
var MAX_JITTER_MS = 1e3;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { E as EmbeddingAdapter } from './adapters-79OIa4xm.js';
|
|
2
|
-
import { B as BatchResult, I as IndexInfo, f as IndexStats, P as PartitionStatsResult, L as ListParams, g as ListResult, Q as QueryParams, e as QueryResult, h as PreflightResult, j as SuggestParams, k as SuggestResult, M as MemoryStats, V as VectorMaintenanceResult } from './memory-
|
|
3
|
-
import { A as AnyDocument, a as InsertOptions, W as WriteOptions, I as IndexConfig, P as PartitionConfig } from './schema-
|
|
2
|
+
import { B as BatchResult, I as IndexInfo, f as IndexStats, P as PartitionStatsResult, L as ListParams, g as ListResult, Q as QueryParams, e as QueryResult, h as PreflightResult, j as SuggestParams, k as SuggestResult, M as MemoryStats, V as VectorMaintenanceResult } from './memory-yFaVn2xZ.js';
|
|
3
|
+
import { A as AnyDocument, a as InsertOptions, W as WriteOptions, I as IndexConfig, P as PartitionConfig } from './schema-d5Afu03A.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Every event the engine emits, with the payload each one carries.
|
|
@@ -14,9 +14,11 @@ import { A as AnyDocument, a as InsertOptions, W as WriteOptions, I as IndexConf
|
|
|
14
14
|
*/
|
|
15
15
|
type NarsilEventMap = {
|
|
16
16
|
/**
|
|
17
|
-
* A worker thread died. The pool drops it and fails
|
|
18
|
-
* with `WORKER_CRASHED`,
|
|
19
|
-
*
|
|
17
|
+
* A worker thread died. The pool drops it and fails the requests that it was
|
|
18
|
+
* serving with `WORKER_CRASHED`, and the engine answers each of those queries
|
|
19
|
+
* again on the main thread, so the caller receives a result and no error.
|
|
20
|
+
* The remaining workers keep answering, because each holds a full worker
|
|
21
|
+
* copy of every promoted index. After a delay the
|
|
20
22
|
* engine spawns a replacement, loads every copy onto it, and puts it back
|
|
21
23
|
* into rotation. Once no worker is left, queries fall back to the main
|
|
22
24
|
* thread, which holds every document, and the next request after the delay
|
|
@@ -431,15 +433,16 @@ interface Narsil extends IndexLifecycleOperations, DocumentWriteOperations {
|
|
|
431
433
|
/**
|
|
432
434
|
* Loads an index from snapshot bytes, replacing whatever the name held.
|
|
433
435
|
*
|
|
434
|
-
* The engine reads the `.nrsl` envelope {@link Narsil.snapshot} writes
|
|
435
|
-
* it also reads the headerless MessagePack form earlier releases wrote.
|
|
436
|
+
* The engine reads the `.nrsl` envelope that {@link Narsil.snapshot} writes.
|
|
436
437
|
*
|
|
437
438
|
* @param indexName - The name the restored index takes.
|
|
438
|
-
* @param data - Bytes
|
|
439
|
-
* @throws A `NarsilError` with `
|
|
440
|
-
*
|
|
441
|
-
*
|
|
442
|
-
*
|
|
439
|
+
* @param data - Bytes that {@link Narsil.snapshot} produced.
|
|
440
|
+
* @throws A `NarsilError` with `ENVELOPE_INVALID_MAGIC` when the bytes are
|
|
441
|
+
* shorter than an envelope header or open with anything other than the
|
|
442
|
+
* `NRSL` magic bytes, `ENVELOPE_VERSION_MISMATCH` when the envelope carries a
|
|
443
|
+
* format version other than the index snapshot format,
|
|
444
|
+
* `PERSISTENCE_CRC_MISMATCH` when the payload fails its checksum, and
|
|
445
|
+
* `DOC_VALIDATION_FAILED` when the envelope holds no valid index snapshot.
|
|
443
446
|
*/
|
|
444
447
|
restore(indexName: string, data: Uint8Array): Promise<void>;
|
|
445
448
|
/**
|