@delali/narsil 0.2.4-next.50 → 0.2.4-next.51

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.
@@ -1,6 +1,6 @@
1
1
  import { E as EmbeddingAdapter } from './adapters-79OIa4xm.js';
2
2
  import { C as ClusterNamespace } from './config-Czh2YNDi.js';
3
- import { h as TaskStore } from './tasks-Bn4R1NPN.js';
3
+ import { h as TaskStore } from './tasks-DT7L1p6w.js';
4
4
 
5
5
  /**
6
6
  * Context handed to {@link OnRequestHook} for every inbound request, captured
@@ -1,6 +1,6 @@
1
1
  import { P as PartitionConfig, A as AnyDocument, b as InsertOptions, W as WriteOptions } from './schema-BqRx9t4E.js';
2
- import { V as VectorMaintenanceResult, M as MemoryStats, 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, i as SuggestParams, j as SuggestResult } from './memory-Bzd5xcEW.js';
3
- import { e as TaskRecord, b as ImportResult, H as HttpIndexConfig, c as TaskListQuery, T as TaskListPage } from './tasks-Bn4R1NPN.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, i as SuggestParams, j as SuggestResult } from './memory-Bzd5xcEW.js';
3
+ import { e as TaskRecord, M as MemoryStatsResponse, b as ImportResult, H as HttpIndexConfig, c as TaskListQuery, T as TaskListPage } from './tasks-DT7L1p6w.js';
4
4
 
5
5
  /**
6
6
  * This is the `fetch` implementation the client sends every request through.
@@ -197,13 +197,13 @@ interface AdminOperations {
197
197
  rebuildAnalysis(indexName: string, options?: RequestOptions): Promise<TaskRecord>;
198
198
  /**
199
199
  * Reports the server process's heap usage, its estimate of what the indexes
200
- * hold, and each worker's heap.
200
+ * hold, each worker's heap, and how many worker threads receive requests.
201
201
  *
202
202
  * @param options - This sets the signal, the deadline, and the headers for
203
203
  * this request.
204
204
  * @returns The figures are what you size a host from.
205
205
  */
206
- getMemoryStats(options?: RequestOptions): Promise<MemoryStats>;
206
+ getMemoryStats(options?: RequestOptions): Promise<MemoryStatsResponse>;
207
207
  }
208
208
 
209
209
  /**
package/dist/client.d.ts CHANGED
@@ -1,7 +1,7 @@
1
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 } from './memory-Bzd5xcEW.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-JrVQOwi4.js';
3
- export { C as CapabilitiesResponse, a as CreateIndexEmbedding, H as HttpIndexConfig, I as ImportError, b as ImportResult, T as TaskListPage, c as TaskListQuery, d as TaskProgress, e as TaskRecord, f as TaskStatus, g as TaskType } from './tasks-Bn4R1NPN.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-CBOVHdjp.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-BWm4IITU.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-DT7L1p6w.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-B_X6_AbT.js';
5
5
  import './schema-BqRx9t4E.js';
6
6
  import './adapters-79OIa4xm.js';
7
7
  import './config-Czh2YNDi.js';
package/dist/react.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import { N as NarsilError, L as ListParams, g as ListResult, I as IndexInfo, f as IndexStats, Q as QueryParams, h as PreflightResult, e as QueryResult, i as SuggestParams, j as SuggestResult } from './memory-Bzd5xcEW.js';
2
2
  export { C as ClientErrorCode, a as ClientErrorCodes, E as ErrorCode, b as ErrorCodes, c as NarsilErrorCode, S as ServerErrorCode, d as ServerErrorCodes } from './memory-Bzd5xcEW.js';
3
- import { e as TaskRecord, d as TaskProgress, b as ImportResult, c as TaskListQuery, T as TaskListPage } from './tasks-Bn4R1NPN.js';
4
- export { I as ImportError, f as TaskStatus, g as TaskType } from './tasks-Bn4R1NPN.js';
3
+ import { e as TaskRecord, d as TaskProgress, b as ImportResult, c as TaskListQuery, T as TaskListPage } from './tasks-DT7L1p6w.js';
4
+ export { I as ImportError, f as TaskStatus, g as TaskType } from './tasks-DT7L1p6w.js';
5
5
  import { ReactNode, ReactElement } from 'react';
6
- import { N as NarsilClient, I as ImportSource } from './client-CBOVHdjp.js';
6
+ import { N as NarsilClient, I as ImportSource } from './client-B_X6_AbT.js';
7
7
  import { A as AnyDocument } from './schema-BqRx9t4E.js';
8
8
  import './adapters-79OIa4xm.js';
9
9
 
package/dist/server.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- import { b as ServerOptions, N as NarsilServer } from './capabilities-JrVQOwi4.js';
2
- export { A as ASYNC_IMPORT_CAPABILITY, C as CorsOptions, E as ErrorEnvelope, I as INDEX_LIFECYCLE_CAPABILITY, O as OnRequestHook, R as REBUILD_ANALYSIS_CAPABILITY, c as RequestContext, d as RequestDenial, S as SERVER_CAPABILITIES, e as ServerLimits, T as TASK_CANCEL_CAPABILITY, a as TASK_FILTER_CAPABILITY } from './capabilities-JrVQOwi4.js';
1
+ import { b as ServerOptions, N as NarsilServer } from './capabilities-BWm4IITU.js';
2
+ export { A as ASYNC_IMPORT_CAPABILITY, C as CorsOptions, E as ErrorEnvelope, I as INDEX_LIFECYCLE_CAPABILITY, O as OnRequestHook, R as REBUILD_ANALYSIS_CAPABILITY, c as RequestContext, d as RequestDenial, S as SERVER_CAPABILITIES, e as ServerLimits, T as TASK_CANCEL_CAPABILITY, a as TASK_FILTER_CAPABILITY } from './capabilities-BWm4IITU.js';
3
3
  import { a as Narsil } from './engine-9PtFY50q.js';
4
- import { d as TaskProgress, b as ImportResult, h as TaskStore, e as TaskRecord } from './tasks-Bn4R1NPN.js';
5
- export { C as CapabilitiesResponse, a as CreateIndexEmbedding, i as CreateIndexRequest, H as HttpIndexConfig, I as ImportError, T as TaskListPage, c as TaskListQuery, f as TaskStatus, g as TaskType } from './tasks-Bn4R1NPN.js';
4
+ import { d as TaskProgress, b as ImportResult, h as TaskStore, e as TaskRecord } from './tasks-DT7L1p6w.js';
5
+ export { C as CapabilitiesResponse, a as CreateIndexEmbedding, i as CreateIndexRequest, H as HttpIndexConfig, I as ImportError, M as MemoryStatsResponse, T as TaskListPage, c as TaskListQuery, f as TaskStatus, g as TaskType } from './tasks-DT7L1p6w.js';
6
6
  export { d as ServerErrorCodes } from './memory-Bzd5xcEW.js';
7
7
  import './adapters-79OIa4xm.js';
8
8
  import './config-Czh2YNDi.js';
package/dist/server.mjs CHANGED
@@ -59,7 +59,9 @@ function createAdminHandlers(deps) {
59
59
  }
60
60
  async function memory(ctx) {
61
61
  try {
62
- respondJson(ctx, await engine.getMemoryStats());
62
+ const stats = await engine.getMemoryStats();
63
+ const response = { ...stats, requestThreads: deps.requestThreadCount() };
64
+ respondJson(ctx, response);
63
65
  } catch (err) {
64
66
  respondError(ctx, err);
65
67
  }
@@ -1278,7 +1280,8 @@ var NarsilHttpServer = class {
1278
1280
  limits,
1279
1281
  isReady: () => this.ready,
1280
1282
  build: resolveBuild(options.build),
1281
- cluster: options.cluster
1283
+ cluster: options.cluster,
1284
+ requestThreadCount: () => this.requestThreadCount
1282
1285
  };
1283
1286
  }
1284
1287
  async listen() {
@@ -1,3 +1,5 @@
1
+ import { M as MemoryStats } from './memory-Bzd5xcEW.js';
2
+
1
3
  /** Declarative index configuration accepted over HTTP. Function-valued engine
2
4
  * options (custom tokenizer, stopWords-as-function, group reducer, embedding
3
5
  * adapter object) are not representable here; the embedding adapter is named
@@ -115,6 +117,23 @@ interface CapabilitiesResponse {
115
117
  /** Each name marks one capability this server serves. */
116
118
  capabilities: string[];
117
119
  }
120
+ /**
121
+ * The body `GET /stats/memory` answers with, which is the engine's {@link MemoryStats}
122
+ * plus the number of worker threads the server receives requests on. Only the
123
+ * server can report that count, because it starts those threads.
124
+ *
125
+ * @public
126
+ */
127
+ interface MemoryStatsResponse extends MemoryStats {
128
+ /**
129
+ * This many worker threads receive requests and answer searches from the
130
+ * copies they hold. The count is zero where the main thread answers everything
131
+ * itself, which happens under `workers.enabled: false`, on a runtime without
132
+ * worker threads, and on a cluster node's engine. See
133
+ * {@link NarsilServer.requestThreadCount}.
134
+ */
135
+ requestThreads: number;
136
+ }
118
137
 
119
138
  /**
120
139
  * Which long-running operation a task record tracks.
@@ -271,4 +290,4 @@ interface TaskStore {
271
290
  shutdown?(): Promise<void>;
272
291
  }
273
292
 
274
- export type { CapabilitiesResponse as C, HttpIndexConfig as H, ImportError as I, TaskListPage as T, CreateIndexEmbedding as a, ImportResult as b, TaskListQuery as c, TaskProgress as d, TaskRecord as e, TaskStatus as f, TaskType as g, TaskStore as h, CreateIndexRequest as i };
293
+ export type { CapabilitiesResponse as C, HttpIndexConfig as H, ImportError as I, MemoryStatsResponse as M, TaskListPage as T, CreateIndexEmbedding as a, ImportResult as b, TaskListQuery as c, TaskProgress as d, TaskRecord as e, TaskStatus as f, TaskType as g, TaskStore as h, CreateIndexRequest as i };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@delali/narsil",
3
- "version": "0.2.4-next.50",
3
+ "version": "0.2.4-next.51",
4
4
  "type": "module",
5
5
  "description": "A distributed full-text search engine with cross-language portable binary format.",
6
6
  "author": "Delali (https://sondelali.com)",