@delali/narsil 0.2.4-next.42 → 0.2.4-next.43

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 (36) hide show
  1. package/dist/adapters/filesystem.mjs +1 -1
  2. package/dist/adapters/indexeddb.mjs +1 -1
  3. package/dist/{chunk-MMSWEEZT.mjs → chunk-KEDL6FFZ.mjs} +315 -51
  4. package/dist/{chunk-WU2UZEVD.mjs → chunk-O4Q5JYNK.mjs} +1 -1
  5. package/dist/{chunk-GB2IIJJG.mjs → chunk-TLRUUMVE.mjs} +1 -4
  6. package/dist/{chunk-GRWFY2HI.mjs → chunk-YGQMKTKG.mjs} +120 -36
  7. package/dist/{client-BobVnoIK.d.ts → client-B5uO5jL1.d.ts} +3 -3
  8. package/dist/client.d.ts +8 -8
  9. package/dist/client.mjs +1 -4
  10. package/dist/{config-Byyl1QqH.d.ts → config-B09-cud9.d.ts} +2 -2
  11. package/dist/{config-fLC4lbmg.d.ts → config-NgUCkc6a.d.ts} +2 -2
  12. package/dist/{direct-executor-MSJEVPZU.mjs → direct-executor-7O23GEHE.mjs} +2 -2
  13. package/dist/distribution/coordinator/etcd.d.ts +2 -2
  14. package/dist/distribution/coordinator/etcd.mjs +1 -1
  15. package/dist/distribution/coordinator/in-memory.d.ts +2 -2
  16. package/dist/distribution/transport/grpc.mjs +1 -1
  17. package/dist/distribution.d.ts +8 -8
  18. package/dist/distribution.mjs +705 -272
  19. package/dist/embeddings/openai.mjs +1 -1
  20. package/dist/{engine-BE45D5ZG.d.ts → engine-CjLhdDIm.d.ts} +21 -20
  21. package/dist/index.browser.mjs +436 -91
  22. package/dist/index.d.ts +7 -7
  23. package/dist/index.mjs +4 -4
  24. package/dist/{options-EXYFcem-.d.ts → options-BakECW-r.d.ts} +2 -2
  25. package/dist/persistence/durability/checkpoint-worker.d.ts +1 -1
  26. package/dist/persistence/durability/checkpoint-worker.mjs +4 -4
  27. package/dist/react.d.ts +6 -6
  28. package/dist/react.mjs +1 -4
  29. package/dist/{schema-ZRbk8BgH.d.ts → schema-DXOd96kx.d.ts} +16 -5
  30. package/dist/{search-DHuXwJYk.d.ts → search-BGouJxH4.d.ts} +22 -9
  31. package/dist/server.d.ts +10 -10
  32. package/dist/server.mjs +6 -9
  33. package/dist/{tasks-CnMLpfk-.d.ts → tasks-Bn4R1NPN.d.ts} +1 -1
  34. package/dist/{types-B5Tsaalz.d.ts → types-BTE33VZS.d.ts} +1 -1
  35. package/dist/workers/entry.mjs +2 -2
  36. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import { NarsilError, ErrorCodes } from '../chunk-GB2IIJJG.mjs';
1
+ import { NarsilError, ErrorCodes } from '../chunk-TLRUUMVE.mjs';
2
2
 
3
3
  // src/embeddings/openai.ts
4
4
  var RETRYABLE_STATUS_CODES = /* @__PURE__ */ new Set([429, 500, 502, 503]);
@@ -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-DHuXwJYk.js';
3
- import { I as IndexConfig, A as AnyDocument, a as InsertOptions, P as PartitionConfig } from './schema-ZRbk8BgH.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-BGouJxH4.js';
3
+ import { I as IndexConfig, A as AnyDocument, a as InsertOptions, P as PartitionConfig } from './schema-DXOd96kx.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
- /** A partition failed to reach the persistence adapter. */
17
- persistenceError: {
18
- /** The partition belongs to this index. */
19
- indexName: string;
20
- /** This partition failed to save. */
21
- partitionId: number;
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;
@@ -296,8 +290,11 @@ interface Narsil {
296
290
  */
297
291
  query<T = AnyDocument>(indexName: string, params: QueryParams): Promise<QueryResult<T>>;
298
292
  /**
299
- * Counts what a query would match without building or ranking a single hit,
300
- * which is how a result-count badge stays cheap.
293
+ * Counts what a query would match without building a single hit, which is
294
+ * how a result-count badge stays cheap. A full-text count also skips scoring
295
+ * unless the query carries `minScore`, which prunes matches by score, or a
296
+ * `termMatch` policy other than `any`, which prunes them by term coverage. A
297
+ * vector or hybrid count still runs its search.
301
298
  *
302
299
  * @param indexName - The index the query would run against.
303
300
  * @param params - The same parameters {@link Narsil.query} takes. Anything
@@ -341,13 +338,17 @@ interface Narsil {
341
338
  */
342
339
  snapshot(indexName: string): Promise<Uint8Array>;
343
340
  /**
344
- * Loads an index from `.nrsl` bytes, replacing whatever the name held.
341
+ * Loads an index from snapshot bytes, replacing whatever the name held.
342
+ *
343
+ * The engine reads the `.nrsl` envelope {@link Narsil.snapshot} writes, and
344
+ * it also reads the headerless MessagePack form earlier releases wrote.
345
345
  *
346
346
  * @param indexName - The name the restored index takes.
347
347
  * @param data - Bytes a {@link Narsil.snapshot} produced.
348
- * @throws A `NarsilError` with `ENVELOPE_INVALID_MAGIC` or
349
- * `ENVELOPE_VERSION_MISMATCH` when the bytes are not a file this engine
350
- * reads.
348
+ * @throws A `NarsilError` with `ENVELOPE_VERSION_MISMATCH` when the envelope
349
+ * carries a different format version, `PERSISTENCE_CRC_MISMATCH` when the
350
+ * payload fails its checksum, or `DOC_VALIDATION_FAILED` when the bytes hold
351
+ * no snapshot.
351
352
  */
352
353
  restore(indexName: string, data: Uint8Array): Promise<void>;
353
354
  /**