@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,6 +1,6 @@
1
- import { P as PartitionConfig, A as AnyDocument, a as InsertOptions, W as WriteOptions } from './schema-mLpXZBEh.js';
2
- import { V as VectorMaintenanceResult, B as BatchResult, L as ListParams, g as ListResult, I as IndexInfo, f as IndexStats, P as PartitionStatsResult, Q as QueryParams, e as QueryResult, h as PreflightResult, j as SuggestParams, k as SuggestResult } from './memory-xrXOZMbw.js';
3
- import { e as TaskRecord, M as MemoryStatsResponse, b as ImportResult, H as HttpIndexConfig, c as TaskListQuery, T as TaskListPage } from './tasks-Df73Tjgq.js';
1
+ import { P as PartitionConfig, A as AnyDocument, a as InsertOptions, W as WriteOptions } from './schema-d5Afu03A.js';
2
+ import { V as VectorMaintenanceResult, B as BatchResult, L as ListParams, g as ListResult, I as IndexInfo, f as IndexStats, P as PartitionStatsResult, Q as QueryParams, e as QueryResult, h as PreflightResult, j as SuggestParams, k as SuggestResult } from './memory-yFaVn2xZ.js';
3
+ import { e as TaskRecord, M as MemoryStatsResponse, b as ImportResult, H as HttpIndexConfig, c as TaskListQuery, T as TaskListPage } from './tasks-CH2Dod8w.js';
4
4
 
5
5
  /**
6
6
  * This is the `fetch` implementation the client sends every request through.
package/dist/client.d.ts CHANGED
@@ -1,10 +1,10 @@
1
- export { C as ClientErrorCode, a as ClientErrorCodes, E as ErrorCode, b as ErrorCodes, N as NarsilError, c as NarsilErrorCode, S as ServerErrorCode, d as ServerErrorCodes, i as isNarsilError } from './memory-xrXOZMbw.js';
2
- export { A as ASYNC_IMPORT_CAPABILITY, E as ErrorEnvelope, I as INDEX_LIFECYCLE_CAPABILITY, R as REBUILD_ANALYSIS_CAPABILITY, S as SERVER_CAPABILITIES, T as TASK_CANCEL_CAPABILITY, a as TASK_FILTER_CAPABILITY } from './capabilities-DlYw0Ov0.js';
3
- export { C as CapabilitiesResponse, a as CreateIndexEmbedding, H as HttpIndexConfig, I as ImportError, b as ImportResult, M as MemoryStatsResponse, T as TaskListPage, c as TaskListQuery, d as TaskProgress, e as TaskRecord, f as TaskStatus, g as TaskType } from './tasks-Df73Tjgq.js';
4
- export { A as AdminOperations, B as BulkOperations, D as DocumentOperations, F as FetchFunction, I as ImportSource, a as IndexOperations, N as NarsilClient, b as NarsilClientOptions, P as PutResult, R as RequestOptions, S as SearchOperations, c as ServerOperations, d as ServerVersion, T as TaskOperations, W as WaitForTaskOptions, e as createNarsilClient } from './client-CQUqt9Ir.js';
5
- import './schema-mLpXZBEh.js';
1
+ export { C as ClientErrorCode, a as ClientErrorCodes, E as ErrorCode, b as ErrorCodes, N as NarsilError, c as NarsilErrorCode, S as ServerErrorCode, d as ServerErrorCodes, i as isNarsilError } from './memory-yFaVn2xZ.js';
2
+ export { A as ASYNC_IMPORT_CAPABILITY, E as ErrorEnvelope, I as INDEX_LIFECYCLE_CAPABILITY, R as REBUILD_ANALYSIS_CAPABILITY, S as SERVER_CAPABILITIES, T as TASK_CANCEL_CAPABILITY, a as TASK_FILTER_CAPABILITY } from './capabilities-DSsOGz6F.js';
3
+ export { C as CapabilitiesResponse, a as CreateIndexEmbedding, H as HttpIndexConfig, I as ImportError, b as ImportResult, M as MemoryStatsResponse, T as TaskListPage, c as TaskListQuery, d as TaskProgress, e as TaskRecord, f as TaskStatus, g as TaskType } from './tasks-CH2Dod8w.js';
4
+ export { A as AdminOperations, B as BulkOperations, D as DocumentOperations, F as FetchFunction, I as ImportSource, a as IndexOperations, N as NarsilClient, b as NarsilClientOptions, P as PutResult, R as RequestOptions, S as SearchOperations, c as ServerOperations, d as ServerVersion, T as TaskOperations, W as WaitForTaskOptions, e as createNarsilClient } from './client-BQK6Tf6A.js';
5
+ import './schema-d5Afu03A.js';
6
6
  import './adapters-79OIa4xm.js';
7
- import './config-CNas6wJH.js';
8
- import './config-bXxnJrQc.js';
9
- import './types-BTIVO8DI.js';
7
+ import './config-BhldZgaK.js';
8
+ import './config-DmXULPa-.js';
9
+ import './types-DAK7mnUZ.js';
10
10
  import './types-D5OwhtsQ.js';
package/dist/client.mjs CHANGED
@@ -12,6 +12,7 @@ var ErrorCodes = {
12
12
  INDEX_ALREADY_EXISTS: "INDEX_ALREADY_EXISTS",
13
13
  INDEX_ORPHANED: "INDEX_ORPHANED",
14
14
  INDEX_REOPEN_CAPACITY_EXHAUSTED: "INDEX_REOPEN_CAPACITY_EXHAUSTED",
15
+ INSTANCE_SHUT_DOWN: "INSTANCE_SHUT_DOWN",
15
16
  PARTITION_CORRUPTED: "PARTITION_CORRUPTED",
16
17
  PARTITION_REBALANCING_BACKPRESSURE: "PARTITION_REBALANCING_BACKPRESSURE",
17
18
  WORKER_CRASHED: "WORKER_CRASHED",
@@ -1,5 +1,5 @@
1
- import { N as NarsilConfig } from './config-bXxnJrQc.js';
2
- import { A as AllocationTable, N as NodeRole, a as NodeRegistration, C as ClusterCoordinator, b as NodeCapacity } from './types-BTIVO8DI.js';
1
+ import { N as NarsilConfig } from './config-DmXULPa-.js';
2
+ import { A as AllocationTable, N as NodeRole, a as NodeRegistration, C as ClusterCoordinator, b as NodeCapacity } from './types-DAK7mnUZ.js';
3
3
  import { N as NodeTransport } from './types-D5OwhtsQ.js';
4
4
 
5
5
  /**
@@ -1,15 +1,20 @@
1
1
  import { P as PersistenceAdapter, I as InvalidationAdapter, E as EmbeddingAdapter } from './adapters-79OIa4xm.js';
2
- import { Q as QueryParams, e as QueryResult } from './memory-xrXOZMbw.js';
3
- import { I as IndexConfig, A as AnyDocument } from './schema-mLpXZBEh.js';
2
+ import { Q as QueryParams, e as QueryResult } from './memory-yFaVn2xZ.js';
3
+ import { I as IndexConfig, A as AnyDocument } from './schema-d5Afu03A.js';
4
4
 
5
5
  /**
6
- * Hooks that run alongside the engine's own work, which is how you add
7
- * validation, auditing, enrichment, or metrics without forking the engine.
6
+ * Hooks that the engine calls alongside its own work, so that an application
7
+ * can add validation, auditing, enrichment, or metrics without forking the
8
+ * engine.
8
9
  *
9
10
  * Every hook is optional. A `before` hook fires first and rejects the
10
11
  * operation by throwing, while an `after` hook fires once the operation
11
- * succeeds. The engine awaits a hook that returns a promise, so slow work in
12
- * one hook slows every write or search that it covers.
12
+ * succeeds. Where a `before` hook on a write throws a {@link NarsilError}, the
13
+ * engine passes that error to the caller unchanged. It turns any other error
14
+ * into `DOC_VALIDATION_FAILED` with the same message, for a single write and
15
+ * for each entry of a batch alike. The engine awaits a hook that returns a
16
+ * promise, so slow work in one hook slows every write or search that it
17
+ * covers.
13
18
  *
14
19
  * @public
15
20
  */
@@ -311,7 +316,10 @@ interface WorkerConfig {
311
316
  /**
312
317
  * Whether the engine may hold worker copies and a vector search pool. It is
313
318
  * on everywhere but a browser page. Set it to false to hold the process to
314
- * one thread, which leaves both pools absent.
319
+ * one thread, which leaves both pools absent. Where a bundler folds
320
+ * `@delali/narsil` into an application bundle, the engine finds no worker
321
+ * entry: left unset, it answers on one thread and prints one warning, and
322
+ * set to true, `createNarsil` throws `CONFIG_INVALID`.
315
323
  */
316
324
  enabled?: boolean;
317
325
  /**
@@ -0,0 +1,12 @@
1
+ export { createDirectExecutor } from './chunk-ZZT3EAUC.mjs';
2
+ import './chunk-AV4IJKD2.mjs';
3
+ import './chunk-ZNZBXMP5.mjs';
4
+ import './chunk-L6TNPLAR.mjs';
5
+ import './chunk-TGP5M5R7.mjs';
6
+ import './chunk-THYRHHO2.mjs';
7
+ import './chunk-ZJ4CSAB2.mjs';
8
+ import './chunk-YNVIUGF5.mjs';
9
+ import './chunk-IFBKLBGB.mjs';
10
+ import './chunk-U2BKYEC7.mjs';
11
+ import './chunk-YMZCMH5M.mjs';
12
+ import './chunk-USKFU7J5.mjs';
@@ -1,5 +1,5 @@
1
- import { C as ClusterCoordinator } from '../../types-BTIVO8DI.js';
2
- import '../../schema-mLpXZBEh.js';
1
+ import { C as ClusterCoordinator } from '../../types-DAK7mnUZ.js';
2
+ import '../../schema-d5Afu03A.js';
3
3
  import '../../adapters-79OIa4xm.js';
4
4
 
5
5
  /**
@@ -1,6 +1,6 @@
1
1
  import { MAX_NODE_ID_LENGTH, MAX_WATCHERS } from '../../chunk-ORBLD3EL.mjs';
2
- import { compareCodePoints } from '../../chunk-2GWVQWGA.mjs';
3
- import { NarsilError, ErrorCodes } from '../../chunk-FRQVMFY7.mjs';
2
+ import { compareCodePoints } from '../../chunk-YMZCMH5M.mjs';
3
+ import { NarsilError, ErrorCodes } from '../../chunk-USKFU7J5.mjs';
4
4
  import { decode, encode } from '@msgpack/msgpack';
5
5
 
6
6
  // src/distribution/coordinator/etcd/types.ts
@@ -1,5 +1,5 @@
1
- import { C as ClusterCoordinator } from '../../types-BTIVO8DI.js';
2
- import '../../schema-mLpXZBEh.js';
1
+ import { C as ClusterCoordinator } from '../../types-DAK7mnUZ.js';
2
+ import '../../schema-d5Afu03A.js';
3
3
  import '../../adapters-79OIa4xm.js';
4
4
 
5
5
  /**
@@ -1,5 +1,5 @@
1
1
  import { NODE_HEARTBEAT_TTL_MS } from '../../chunk-ORBLD3EL.mjs';
2
- import { compareCodePoints } from '../../chunk-2GWVQWGA.mjs';
2
+ import { compareCodePoints } from '../../chunk-YMZCMH5M.mjs';
3
3
 
4
4
  // src/distribution/coordinator/in-memory.ts
5
5
  var NODE_HEARTBEAT_PREFIX = "_narsil/node/";
@@ -1,7 +1,7 @@
1
1
  import { decodeTransportMessage, encodeTransportMessage } from '../../chunk-OOSIDHA3.mjs';
2
2
  import { MAX_MESSAGE_SIZE_BYTES, GRPC_KEEPALIVE_TIMEOUT_MS, GRPC_KEEPALIVE_TIME_MS, GRPC_ENVELOPE_OVERHEAD_BYTES } from '../../chunk-UNEEFTEU.mjs';
3
3
  import { TransportError, TransportErrorCodes } from '../../chunk-GCM3JFVA.mjs';
4
- import { NarsilError, ErrorCodes } from '../../chunk-FRQVMFY7.mjs';
4
+ import { NarsilError, ErrorCodes } from '../../chunk-USKFU7J5.mjs';
5
5
 
6
6
  // src/distribution/transport/grpc/codec.ts
7
7
  var FIELD_ONE_LENGTH_DELIMITED_KEY = 10;
@@ -1,12 +1,12 @@
1
- import { a as CreateIndexOptions, C as ClusterNamespace, b as ClusterNodeConfig } from './config-CNas6wJH.js';
2
- export { c as ClusterControllerConfig, d as ClusterNodeInfo, e as ClusterQueryConfig, N as NodeReadiness, R as ReplicationConfig } from './config-CNas6wJH.js';
3
- import { N as NarsilEventMap, a as Narsil } from './engine-Dj4I91Jv.js';
4
- import { B as BatchResult, L as ListParams, g as ListResult, j as SuggestParams, k as SuggestResult, Q as QueryParams, h as PreflightResult, f as IndexStats, P as PartitionStatsResult, M as MemoryStats, e as QueryResult } from './memory-xrXOZMbw.js';
5
- import { I as IndexConfig, A as AnyDocument, a as InsertOptions } from './schema-mLpXZBEh.js';
6
- import { b as NodeCapacity, N as NodeRole } from './types-BTIVO8DI.js';
7
- export { c as AllocationConstraints, d as AllocationEvent, A as AllocationTable, C as ClusterCoordinator, e as NodeEvent, a as NodeRegistration, P as PartitionAssignment, f as PartitionState, S as SchemaEvent, U as UnassignedReason } from './types-BTIVO8DI.js';
1
+ import { a as CreateIndexOptions, C as ClusterNamespace, b as ClusterNodeConfig } from './config-BhldZgaK.js';
2
+ export { c as ClusterControllerConfig, d as ClusterNodeInfo, e as ClusterQueryConfig, N as NodeReadiness, R as ReplicationConfig } from './config-BhldZgaK.js';
3
+ import { N as NarsilEventMap, a as Narsil } from './engine-CIOyFozK.js';
4
+ import { B as BatchResult, L as ListParams, g as ListResult, j as SuggestParams, k as SuggestResult, Q as QueryParams, h as PreflightResult, f as IndexStats, P as PartitionStatsResult, M as MemoryStats, e as QueryResult } from './memory-yFaVn2xZ.js';
5
+ import { I as IndexConfig, A as AnyDocument, a as InsertOptions } from './schema-d5Afu03A.js';
6
+ import { b as NodeCapacity, N as NodeRole } from './types-DAK7mnUZ.js';
7
+ export { c as AllocationConstraints, d as AllocationEvent, A as AllocationTable, C as ClusterCoordinator, e as NodeEvent, a as NodeRegistration, P as PartitionAssignment, f as PartitionState, S as SchemaEvent, U as UnassignedReason } from './types-DAK7mnUZ.js';
8
8
  export { L as ListenHandler, N as NodeTransport, R as RespondFn, T as TransportConfig, a as TransportMessage } from './types-D5OwhtsQ.js';
9
- import './config-bXxnJrQc.js';
9
+ import './config-DmXULPa-.js';
10
10
  import './adapters-79OIa4xm.js';
11
11
 
12
12
  /**