@delali/narsil 0.3.1-next.80 → 0.3.1-next.82

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/dist/adapters/filesystem.mjs +1 -1
  2. package/dist/adapters/indexeddb.mjs +1 -1
  3. package/dist/{capabilities-CcTDWh_P.d.ts → capabilities-CAdkp2P-.d.ts} +2 -2
  4. package/dist/{chunk-HJASKX4F.mjs → chunk-2453RJYK.mjs} +2 -2
  5. package/dist/{chunk-K4FZ55Q2.mjs → chunk-4CWHWOBI.mjs} +10 -10
  6. package/dist/{chunk-4QDQEJDV.mjs → chunk-4D6OH4EF.mjs} +6 -6
  7. package/dist/{chunk-P2PYEZZE.mjs → chunk-4VBG6PEH.mjs} +3 -3
  8. package/dist/{chunk-Y3L5MDRV.mjs → chunk-5XNIRLFC.mjs} +2 -2
  9. package/dist/{chunk-2E35UM3G.mjs → chunk-B3UOQJD3.mjs} +1 -1
  10. package/dist/{chunk-MEOOYKWL.mjs → chunk-GNYXCLJS.mjs} +4 -4
  11. package/dist/{chunk-NSXQCE4K.mjs → chunk-IH3GKNDQ.mjs} +190 -40
  12. package/dist/{chunk-23HJ5QXQ.mjs → chunk-IN5CH4P2.mjs} +2 -2
  13. package/dist/{chunk-OSF3SGJV.mjs → chunk-KJ7LB3TR.mjs} +2 -2
  14. package/dist/{chunk-DQABW5UQ.mjs → chunk-LS5IRM23.mjs} +1 -1
  15. package/dist/{chunk-4MQ5F4IL.mjs → chunk-OLXM65YH.mjs} +1 -1
  16. package/dist/{chunk-R2XCJIO7.mjs → chunk-SREPGC6O.mjs} +2 -2
  17. package/dist/{chunk-I64LXKO3.mjs → chunk-TPJU7NDJ.mjs} +1 -0
  18. package/dist/{chunk-YGLSR7BC.mjs → chunk-XYDP7CCJ.mjs} +5 -5
  19. package/dist/{chunk-QPYV22XH.mjs → chunk-XZF4LZ3X.mjs} +4 -3
  20. package/dist/{chunk-GG2FBGVZ.mjs → chunk-ZCKPRCYI.mjs} +1 -1
  21. package/dist/{client-CsybN673.d.ts → client-CKUtkLz3.d.ts} +2 -2
  22. package/dist/client.d.ts +7 -7
  23. package/dist/client.mjs +1 -0
  24. package/dist/{config-CFonR_gY.d.ts → config-BuIkeM5C.d.ts} +39 -3
  25. package/dist/{config-BCNQtszf.d.ts → config-CSDEPraV.d.ts} +1 -1
  26. package/dist/direct-executor-JVXDR5Y5.mjs +19 -0
  27. package/dist/distribution/coordinator/etcd.d.ts +1 -1
  28. package/dist/distribution/coordinator/etcd.mjs +1 -1
  29. package/dist/distribution/coordinator/in-memory.d.ts +1 -1
  30. package/dist/distribution/transport/grpc.mjs +1 -1
  31. package/dist/distribution.d.ts +7 -7
  32. package/dist/distribution.mjs +756 -64
  33. package/dist/embeddings/openai.mjs +1 -1
  34. package/dist/{engine-B0oIF1_r.d.ts → engine-DMNZJAUq.d.ts} +1 -1
  35. package/dist/{types-ChrVy4lH.d.ts → index-DzONZUKE.d.ts} +79 -37
  36. package/dist/index.browser.mjs +25 -23
  37. package/dist/index.d.ts +5 -5
  38. package/dist/index.mjs +14 -14
  39. package/dist/{memory-B6SBOKlS.d.ts → memory-BPKNx9Tl.d.ts} +1 -0
  40. package/dist/partial-words.mjs +4 -4
  41. package/dist/pattern.mjs +3 -3
  42. package/dist/persistence/durability/checkpoint-worker.mjs +14 -14
  43. package/dist/react.d.ts +6 -6
  44. package/dist/react.mjs +1 -0
  45. package/dist/server.d.ts +9 -9
  46. package/dist/server.mjs +18 -13
  47. package/dist/{tasks-CYAQe6qd.d.ts → tasks-DGyz586z.d.ts} +1 -1
  48. package/dist/{thread-P6QJ2Q5O.mjs → thread-33M5AOEI.mjs} +10 -10
  49. package/dist/vector/search-worker.mjs +3 -3
  50. package/dist/workers/entry.mjs +5 -5
  51. package/package.json +11 -7
  52. package/dist/direct-executor-VNMQ6NIH.mjs +0 -19
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-B6SBOKlS.js';
2
- export { A as ASYNC_IMPORT_CAPABILITY, D as DOCUMENT_EXPORT_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-CcTDWh_P.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-CYAQe6qd.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-CsybN673.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-BPKNx9Tl.js';
2
+ export { A as ASYNC_IMPORT_CAPABILITY, D as DOCUMENT_EXPORT_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-CAdkp2P-.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-DGyz586z.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-CKUtkLz3.js';
5
5
  import './schema-DgyDijhf.js';
6
6
  import './adapters-79OIa4xm.js';
7
- import './config-CFonR_gY.js';
8
- import './config-BCNQtszf.js';
9
- import './types-ChrVy4lH.js';
7
+ import './config-BuIkeM5C.js';
8
+ import './config-CSDEPraV.js';
9
+ import './index-DzONZUKE.js';
10
10
  import './types-Cb9kiY5P.js';
package/dist/client.mjs CHANGED
@@ -47,6 +47,7 @@ var ErrorCodes = {
47
47
  QUERY_NODE_TIMEOUT: "QUERY_NODE_TIMEOUT",
48
48
  QUERY_NO_ACTIVE_REPLICA: "QUERY_NO_ACTIVE_REPLICA",
49
49
  CLUSTER_OPERATION_UNSUPPORTED: "CLUSTER_OPERATION_UNSUPPORTED",
50
+ CLUSTER_WRITE_BLOCKED: "CLUSTER_WRITE_BLOCKED",
50
51
  ALLOCATION_NO_DATA_NODES: "ALLOCATION_NO_DATA_NODES",
51
52
  ALLOCATION_INVALID_CONFIG: "ALLOCATION_INVALID_CONFIG",
52
53
  ALLOCATION_FAILED: "ALLOCATION_FAILED",
@@ -1,5 +1,5 @@
1
- import { N as NarsilConfig } from './config-BCNQtszf.js';
2
- import { A as AllocationTable, N as NodeRole, a as NodeRegistration, C as ClusterCoordinator, b as NodeCapacity } from './types-ChrVy4lH.js';
1
+ import { N as NarsilConfig } from './config-CSDEPraV.js';
2
+ import { A as AllocationTable, N as NodeRole, a as NodeRegistration, C as ClusterCoordinator, b as NodeCapacity } from './index-DzONZUKE.js';
3
3
  import { N as NodeTransport } from './types-Cb9kiY5P.js';
4
4
 
5
5
  /**
@@ -56,9 +56,45 @@ interface ClusterNodeConfig {
56
56
  query?: ClusterQueryConfig;
57
57
  /** These settings govern how this node stands for controller election, and anything you leave out keeps its default. */
58
58
  controller?: ClusterControllerConfig;
59
+ /** These settings govern when this node's memory blocks writes across the cluster, and anything you leave out keeps its default. */
60
+ memory?: ClusterMemoryConfig;
59
61
  /** This receives the failures the node reports while running on its own, away from any call you made. */
60
62
  onError?: (error: Error) => void;
61
63
  }
64
+ /**
65
+ * When this node counts as full, which is what makes the cluster refuse inserts and updates to every index with a
66
+ * copy on the node.
67
+ *
68
+ * The node measures its process memory against the container's limit, or the host's memory where no container sets
69
+ * one, and its main thread's heap against the heap limit, once a second. It counts as full once either figure passes
70
+ * `blockWritesAbove` of its limit, and as clear again once both fall below `resumeWritesBelow`, so that a node hovering
71
+ * at the threshold does not switch writes on and off. Removes and searches go through while the node is full, which is
72
+ * how an operator frees memory.
73
+ *
74
+ * @public
75
+ */
76
+ interface ClusterMemoryConfig {
77
+ /**
78
+ * The node counts as full once either memory figure passes this fraction of its limit. It must lie above
79
+ * `resumeWritesBelow` and at most 1, and it is 0.9 where you name none.
80
+ */
81
+ blockWritesAbove?: number;
82
+ /**
83
+ * A full node counts as clear again once both memory figures fall below this fraction of their limits. It must lie
84
+ * above 0 and below `blockWritesAbove`, and it is 0.8 where you name none.
85
+ */
86
+ resumeWritesBelow?: number;
87
+ /**
88
+ * The node holds at most this fraction of its heap limit in the documents of inserts and updates that it has
89
+ * accepted and not yet finished, counting both the writes that clients send it and the writes that other nodes
90
+ * forward to it as primary. It refuses a write whose documents would carry that total past the limit with
91
+ * `CLUSTER_WRITE_BLOCKED`, and the error's details include the reason `write_bytes_in_flight`. It never refuses a
92
+ * replicated entry or a remove. The fraction must lie above 0 and at most 1, and it is 0.02 where you name none,
93
+ * which is low because indexing a document can take many times the size of its text in heap. A value of 1 allows
94
+ * writes in flight up to the whole heap limit.
95
+ */
96
+ inFlightWriteFraction?: number;
97
+ }
62
98
  /**
63
99
  * How long this node's turn as controller survives a fault, and how often it
64
100
  * stands for election again.
@@ -198,4 +234,4 @@ interface ClusterNodeInfo {
198
234
  status: string;
199
235
  }
200
236
 
201
- export type { ClusterNamespace as C, NodeReadiness as N, ReplicationConfig as R, CreateIndexOptions as a, ClusterNodeConfig as b, ClusterControllerConfig as c, ClusterNodeInfo as d, ClusterQueryConfig as e };
237
+ export type { ClusterNamespace as C, NodeReadiness as N, ReplicationConfig as R, CreateIndexOptions as a, ClusterNodeConfig as b, ClusterControllerConfig as c, ClusterMemoryConfig as d, ClusterNodeInfo as e, ClusterQueryConfig as f };
@@ -1,5 +1,5 @@
1
1
  import { P as PersistenceAdapter, I as InvalidationAdapter, E as EmbeddingAdapter } from './adapters-79OIa4xm.js';
2
- import { Q as QueryParams, e as QueryResult, f as NarsilEventHandlers } from './memory-B6SBOKlS.js';
2
+ import { Q as QueryParams, e as QueryResult, f as NarsilEventHandlers } from './memory-BPKNx9Tl.js';
3
3
  import { I as IndexConfig, A as AnyDocument } from './schema-DgyDijhf.js';
4
4
 
5
5
  /**
@@ -0,0 +1,19 @@
1
+ export { createDirectExecutor } from './chunk-4CWHWOBI.mjs';
2
+ import './chunk-XYDP7CCJ.mjs';
3
+ import './chunk-OLXM65YH.mjs';
4
+ import './chunk-ZCKPRCYI.mjs';
5
+ import './chunk-TGP5M5R7.mjs';
6
+ import './chunk-IN5CH4P2.mjs';
7
+ import './chunk-ZJ4CSAB2.mjs';
8
+ import './chunk-B3UOQJD3.mjs';
9
+ import './chunk-SREPGC6O.mjs';
10
+ import './chunk-WQBCBKY3.mjs';
11
+ import './chunk-4VBG6PEH.mjs';
12
+ import './chunk-KJ7LB3TR.mjs';
13
+ import './chunk-KEHK2O6P.mjs';
14
+ import './chunk-GES7U2PM.mjs';
15
+ import './chunk-LS5IRM23.mjs';
16
+ import './chunk-U2BKYEC7.mjs';
17
+ import './chunk-R6A773WK.mjs';
18
+ import './chunk-YTJCGKM4.mjs';
19
+ import './chunk-TPJU7NDJ.mjs';
@@ -1,4 +1,4 @@
1
- import { C as ClusterCoordinator } from '../../types-ChrVy4lH.js';
1
+ import { C as ClusterCoordinator } from '../../index-DzONZUKE.js';
2
2
  import '../../schema-DgyDijhf.js';
3
3
  import '../../adapters-79OIa4xm.js';
4
4
 
@@ -1,7 +1,7 @@
1
1
  import { MAX_NODE_ID_LENGTH, MAX_WATCHERS } from '../../chunk-ORBLD3EL.mjs';
2
2
  import '../../chunk-R6A773WK.mjs';
3
3
  import { compareCodePoints } from '../../chunk-YTJCGKM4.mjs';
4
- import { NarsilError, ErrorCodes } from '../../chunk-I64LXKO3.mjs';
4
+ import { NarsilError, ErrorCodes } from '../../chunk-TPJU7NDJ.mjs';
5
5
  import { decode, encode } from '@msgpack/msgpack';
6
6
 
7
7
  // src/distribution/coordinator/etcd/constants.ts
@@ -1,4 +1,4 @@
1
- import { C as ClusterCoordinator } from '../../types-ChrVy4lH.js';
1
+ import { C as ClusterCoordinator } from '../../index-DzONZUKE.js';
2
2
  import '../../schema-DgyDijhf.js';
3
3
  import '../../adapters-79OIa4xm.js';
4
4
 
@@ -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-I64LXKO3.mjs';
4
+ import { NarsilError, ErrorCodes } from '../../chunk-TPJU7NDJ.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-CFonR_gY.js';
2
- export { c as ClusterControllerConfig, d as ClusterNodeInfo, e as ClusterQueryConfig, N as NodeReadiness, R as ReplicationConfig } from './config-CFonR_gY.js';
3
- import { B as BatchResult, L as ListParams, h as ListResult, k as SuggestParams, l as SuggestResult, Q as QueryParams, j as PreflightResult, g as IndexStats, P as PartitionStatsResult, M as MemoryStats, m as NarsilEventMap, e as QueryResult } from './memory-B6SBOKlS.js';
1
+ import { a as CreateIndexOptions, C as ClusterNamespace, b as ClusterNodeConfig } from './config-BuIkeM5C.js';
2
+ export { c as ClusterControllerConfig, d as ClusterMemoryConfig, e as ClusterNodeInfo, f as ClusterQueryConfig, N as NodeReadiness, R as ReplicationConfig } from './config-BuIkeM5C.js';
3
+ import { B as BatchResult, L as ListParams, h as ListResult, k as SuggestParams, l as SuggestResult, Q as QueryParams, j as PreflightResult, g as IndexStats, P as PartitionStatsResult, M as MemoryStats, m as NarsilEventMap, e as QueryResult } from './memory-BPKNx9Tl.js';
4
4
  import { I as IndexConfig, A as AnyDocument, a as InsertOptions } from './schema-DgyDijhf.js';
5
- import { b as NodeCapacity, N as NodeRole } from './types-ChrVy4lH.js';
6
- 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-ChrVy4lH.js';
7
- import { N as Narsil } from './engine-B0oIF1_r.js';
5
+ import { b as NodeCapacity, N as NodeRole } from './index-DzONZUKE.js';
6
+ export { c as AllocationConstraints, d as AllocationEvent, A as AllocationTable, C as ClusterCoordinator, I as IndexPartitionBytes, e as NodeEvent, f as NodeMemoryReport, a as NodeRegistration, P as PartitionAssignment, g as PartitionState, S as SchemaEvent, U as UnassignedReason } from './index-DzONZUKE.js';
7
+ import { N as Narsil } from './engine-DMNZJAUq.js';
8
8
  export { L as ListenHandler, N as NodeTransport, R as RespondFn, T as TransportConfig, a as TransportMessage } from './types-Cb9kiY5P.js';
9
- import './config-BCNQtszf.js';
9
+ import './config-CSDEPraV.js';
10
10
  import './adapters-79OIa4xm.js';
11
11
 
12
12
  /**