@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.
Files changed (52) hide show
  1. package/README.md +39 -28
  2. package/dist/adapters/filesystem.mjs +1 -1
  3. package/dist/adapters/indexeddb.mjs +1 -1
  4. package/dist/{capabilities-DlYw0Ov0.d.ts → capabilities-DSsOGz6F.d.ts} +2 -2
  5. package/dist/{chunk-BH5SYB5W.mjs → chunk-24RXHMEL.mjs} +604 -150
  6. package/dist/{chunk-D2S642IV.mjs → chunk-3LHGNRYE.mjs} +1 -1
  7. package/dist/{chunk-TVT5V4E7.mjs → chunk-B2TFROFX.mjs} +299 -168
  8. package/dist/{chunk-L225SHNB.mjs → chunk-L6TNPLAR.mjs} +19 -5
  9. package/dist/{chunk-U2AL3SON.mjs → chunk-THYRHHO2.mjs} +3 -3
  10. package/dist/{chunk-NTZYA3SJ.mjs → chunk-U7KYW4BA.mjs} +3 -3
  11. package/dist/{chunk-FRQVMFY7.mjs → chunk-USKFU7J5.mjs} +1 -0
  12. package/dist/{chunk-4NVPQ6S5.mjs → chunk-UXNWQZST.mjs} +12 -3
  13. package/dist/{chunk-RGS7FMCB.mjs → chunk-VMRR3DQU.mjs} +74 -16
  14. package/dist/{chunk-2GWVQWGA.mjs → chunk-YMZCMH5M.mjs} +45 -1
  15. package/dist/{chunk-UTOFOJOR.mjs → chunk-YNVIUGF5.mjs} +6 -2
  16. package/dist/{chunk-5T6AOR37.mjs → chunk-ZNZBXMP5.mjs} +601 -60
  17. package/dist/{chunk-XNQAIO74.mjs → chunk-ZZT3EAUC.mjs} +177 -309
  18. package/dist/{client-CQUqt9Ir.d.ts → client-BQK6Tf6A.d.ts} +3 -3
  19. package/dist/client.d.ts +8 -8
  20. package/dist/client.mjs +1 -0
  21. package/dist/{config-CNas6wJH.d.ts → config-BhldZgaK.d.ts} +2 -2
  22. package/dist/{config-bXxnJrQc.d.ts → config-DmXULPa-.d.ts} +15 -7
  23. package/dist/direct-executor-ALAVE7FC.mjs +12 -0
  24. package/dist/distribution/coordinator/etcd.d.ts +2 -2
  25. package/dist/distribution/coordinator/etcd.mjs +2 -2
  26. package/dist/distribution/coordinator/in-memory.d.ts +2 -2
  27. package/dist/distribution/coordinator/in-memory.mjs +1 -1
  28. package/dist/distribution/transport/grpc.mjs +1 -1
  29. package/dist/distribution.d.ts +8 -8
  30. package/dist/distribution.mjs +382 -162
  31. package/dist/embeddings/openai.mjs +2 -2
  32. package/dist/{engine-Dj4I91Jv.d.ts → engine-CIOyFozK.d.ts} +15 -12
  33. package/dist/index.browser.mjs +1565 -528
  34. package/dist/index.d.ts +7 -7
  35. package/dist/index.mjs +11 -11
  36. package/dist/invalidation/filesystem.mjs +1 -1
  37. package/dist/{memory-xrXOZMbw.d.ts → memory-yFaVn2xZ.d.ts} +199 -107
  38. package/dist/persistence/durability/checkpoint-worker.d.ts +1 -1
  39. package/dist/persistence/durability/checkpoint-worker.mjs +11 -11
  40. package/dist/react.d.ts +6 -6
  41. package/dist/react.mjs +1 -0
  42. package/dist/{schema-mLpXZBEh.d.ts → schema-d5Afu03A.d.ts} +7 -2
  43. package/dist/server.d.ts +10 -10
  44. package/dist/server.mjs +10 -10
  45. package/dist/{tasks-Df73Tjgq.d.ts → tasks-CH2Dod8w.d.ts} +1 -1
  46. package/dist/{thread-5UP6MGED.mjs → thread-DYHEQRVY.mjs} +14 -10
  47. package/dist/{types-BTIVO8DI.d.ts → types-DAK7mnUZ.d.ts} +1 -1
  48. package/dist/vector/search-worker.d.ts +1 -1
  49. package/dist/vector/search-worker.mjs +4 -4
  50. package/dist/workers/entry.mjs +4 -4
  51. package/package.json +9 -9
  52. package/dist/direct-executor-RBA5O7EN.mjs +0 -12
@@ -1,7 +1,7 @@
1
- import { NarsilError, ErrorCodes } from '../chunk-FRQVMFY7.mjs';
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-xrXOZMbw.js';
3
- import { A as AnyDocument, a as InsertOptions, W as WriteOptions, I as IndexConfig, P as PartitionConfig } from './schema-mLpXZBEh.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-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 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. After a delay the
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, and
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 a {@link Narsil.snapshot} produced.
439
- * @throws A `NarsilError` with `ENVELOPE_VERSION_MISMATCH` when the envelope
440
- * carries a different format version, `PERSISTENCE_CRC_MISMATCH` when the
441
- * payload fails its checksum, or `DOC_VALIDATION_FAILED` when the bytes hold
442
- * no snapshot.
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
  /**