@delali/narsil 0.3.1-next.130 → 0.3.1-next.140

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 (120) hide show
  1. package/dist/adapters/filesystem.mjs +1 -1
  2. package/dist/adapters/indexeddb.mjs +1 -1
  3. package/dist/analysis-change-JN23AZQP.mjs +43 -0
  4. package/dist/analysis-change-entry-5JSIMEKG.mjs +1 -0
  5. package/dist/browser/analysis-change-57MIRJWR.mjs +499 -0
  6. package/dist/browser/analysis-change-entry-ICGRR3IN.mjs +1 -0
  7. package/dist/browser/{chunk-UDGB2MWT.mjs → chunk-35B42UFM.mjs} +4 -0
  8. package/dist/browser/{chunk-VBBLTD7O.mjs → chunk-3EYDURFD.mjs} +39 -27
  9. package/dist/browser/{chunk-AIIJDWMG.mjs → chunk-4MFH226Q.mjs} +1 -1
  10. package/dist/browser/{chunk-D7WQF6DV.mjs → chunk-5LYWZJE2.mjs} +2 -2
  11. package/dist/browser/chunk-67KSBUYR.mjs +173 -0
  12. package/dist/browser/{chunk-M5UAAXGU.mjs → chunk-6BSB4N6B.mjs} +2 -2
  13. package/dist/browser/{chunk-NSCSR6MA.mjs → chunk-CGVBGHBX.mjs} +81 -6
  14. package/dist/browser/chunk-E5SFTOQR.mjs +21 -0
  15. package/dist/browser/{chunk-VEGHFP2P.mjs → chunk-MZI3TEOW.mjs} +4 -2
  16. package/dist/browser/chunk-OIZS5KIX.mjs +6 -0
  17. package/dist/browser/chunk-QHNNULPW.mjs +265 -0
  18. package/dist/browser/chunk-XVMOQQ34.mjs +384 -0
  19. package/dist/browser/{chunk-2Y3CO4EQ.mjs → chunk-ZAIZQOTM.mjs} +256 -777
  20. package/dist/browser/{durability-wiring-FNZSRH4N.mjs → durability-wiring-MTIAN6VT.mjs} +145 -50
  21. package/dist/browser/import-Q7MXD6BS.mjs +8 -0
  22. package/dist/browser/{module-4HIMOQM5.mjs → module-5J3PEUEB.mjs} +7 -6
  23. package/dist/browser/{phrase-module-WESYVU7K.mjs → phrase-module-HGVBO24W.mjs} +1 -1
  24. package/dist/{restore-queue-JAMNRC6T.mjs → browser/restore-queue-DISFECE4.mjs} +8 -2
  25. package/dist/browser/{runtime-3X7ZJ5T3.mjs → runtime-VEUH674B.mjs} +2 -2
  26. package/dist/browser/{snapshot-V7VF6BN6.mjs → snapshot-YBJ5MF2M.mjs} +36 -167
  27. package/dist/browser/{write-YIC2MKRY.mjs → write-RTWI5MXL.mjs} +8 -6
  28. package/dist/{capabilities-Bl8G9taj.d.ts → capabilities-DXAmysqJ.d.ts} +11 -11
  29. package/dist/{chunk-NMXRXFGZ.mjs → chunk-4GCN34JV.mjs} +2 -2
  30. package/dist/{chunk-SOHMMNCH.mjs → chunk-6VHWXAOI.mjs} +4 -4
  31. package/dist/{chunk-2C3WXBQS.mjs → chunk-74XB2SXI.mjs} +1 -1
  32. package/dist/{chunk-QQTXT65X.mjs → chunk-B5I3IL4H.mjs} +12 -7
  33. package/dist/chunk-BDIDUW2B.mjs +387 -0
  34. package/dist/{chunk-5LX6MOIB.mjs → chunk-C3YDYX6C.mjs} +1 -1
  35. package/dist/{chunk-Y4BVTQ53.mjs → chunk-CCCGEPJM.mjs} +2 -2
  36. package/dist/{chunk-2JWNJSNE.mjs → chunk-CPCGEIOM.mjs} +11 -8
  37. package/dist/chunk-CZQ33DLW.mjs +78 -0
  38. package/dist/{chunk-4GDLFDPZ.mjs → chunk-DD2673TX.mjs} +3 -2
  39. package/dist/{chunk-RNSC4NFI.mjs → chunk-EEBCDP36.mjs} +3 -1
  40. package/dist/{chunk-HCGJKDZV.mjs → chunk-FFVLPCLH.mjs} +1 -1
  41. package/dist/{chunk-WVRDRLIC.mjs → chunk-FKARMUWH.mjs} +6 -6
  42. package/dist/{chunk-PATMDIMN.mjs → chunk-HJJWY6PT.mjs} +1 -1
  43. package/dist/chunk-HMDT3I63.mjs +21 -0
  44. package/dist/{chunk-CZ7ISLXA.mjs → chunk-HNHCNTVG.mjs} +4 -0
  45. package/dist/{chunk-RWESFSJI.mjs → chunk-IBATGS3J.mjs} +87 -61
  46. package/dist/{chunk-Y2U5VVWX.mjs → chunk-ICW45TTU.mjs} +1 -1
  47. package/dist/{chunk-T4OFG4IQ.mjs → chunk-IP4HJOGC.mjs} +90 -16
  48. package/dist/{chunk-EUCX5K74.mjs → chunk-J3EHATEZ.mjs} +3 -3
  49. package/dist/{chunk-X5CNUKD5.mjs → chunk-K3AQOZVM.mjs} +37 -20
  50. package/dist/chunk-LK3MOTXF.mjs +174 -0
  51. package/dist/{chunk-7OIQ2SIO.mjs → chunk-LLDFIKGP.mjs} +4 -4
  52. package/dist/{chunk-K77FJXKS.mjs → chunk-MTQTX4BP.mjs} +81 -8
  53. package/dist/{chunk-ZR4VM4A6.mjs → chunk-N37VMC62.mjs} +1 -18
  54. package/dist/{chunk-2WBY4Y4M.mjs → chunk-NOT5QOHU.mjs} +1 -1
  55. package/dist/{chunk-D5TFRB5G.mjs → chunk-NPNK57CA.mjs} +1 -1
  56. package/dist/{chunk-6SSVIW7Y.mjs → chunk-O4LJQI4G.mjs} +31 -5
  57. package/dist/{chunk-JJ6EUMXB.mjs → chunk-PNNVTKMT.mjs} +2 -2
  58. package/dist/{chunk-2SEL6SBS.mjs → chunk-RKAVHNRW.mjs} +2 -2
  59. package/dist/{chunk-XABMCBHA.mjs → chunk-SBMAWTRG.mjs} +684 -99
  60. package/dist/chunk-TCWQJL7O.mjs +188 -0
  61. package/dist/{chunk-2MKX2SCO.mjs → chunk-U4X4AWKL.mjs} +7 -7
  62. package/dist/{chunk-PU6SKH7O.mjs → chunk-UBXJQJII.mjs} +2 -2
  63. package/dist/chunk-UEV53BBO.mjs +480 -0
  64. package/dist/{chunk-NNO7CO3A.mjs → chunk-UIKN2OTQ.mjs} +1 -1
  65. package/dist/{chunk-F6AAXI7T.mjs → chunk-VSUYTPME.mjs} +3 -3
  66. package/dist/{chunk-TGHNXN7W.mjs → chunk-W2XDK66Z.mjs} +180 -541
  67. package/dist/{chunk-7X5JST5L.mjs → chunk-WNBRW4Q2.mjs} +16 -2
  68. package/dist/{chunk-6M6SDH3S.mjs → chunk-XMQNOD5V.mjs} +8 -8
  69. package/dist/{chunk-SZGRYEIC.mjs → chunk-XS2VM7UE.mjs} +3 -3
  70. package/dist/{chunk-JT3YZGCE.mjs → chunk-XXKWEG53.mjs} +3 -188
  71. package/dist/{chunk-YBWSV5DV.mjs → chunk-ZMBFWQXN.mjs} +2 -2
  72. package/dist/{chunk-7XY6VD7B.mjs → chunk-ZSWHPKGM.mjs} +1 -1
  73. package/dist/{client-Cx-TiqPE.d.ts → client-DApBeLbk.d.ts} +18 -3
  74. package/dist/client.d.ts +7 -8
  75. package/dist/client.mjs +11 -1
  76. package/dist/{events-DErop1LM.d.ts → config-B0H-vp4U.d.ts} +424 -2
  77. package/dist/{config-CzB9YvF_.d.ts → config-Brysl9NO.d.ts} +3 -3
  78. package/dist/{direct-executor-HQ4QVDX7.mjs → direct-executor-J5UDLPL3.mjs} +14 -14
  79. package/dist/distribution/coordinator/etcd.d.ts +2 -2
  80. package/dist/distribution/coordinator/etcd.mjs +1 -1
  81. package/dist/distribution/coordinator/in-memory.d.ts +2 -2
  82. package/dist/distribution/transport/grpc.mjs +1 -1
  83. package/dist/distribution.d.ts +24 -9
  84. package/dist/distribution.mjs +882 -192
  85. package/dist/{durability-wiring-S7OX2MAI.mjs → durability-wiring-AYOTAPNQ.mjs} +165 -70
  86. package/dist/embeddings/openai.mjs +2 -2
  87. package/dist/{engine-B_W9sdZK.d.ts → engine-CuLMbH1-.d.ts} +64 -7
  88. package/dist/import-QRZAQ5RH.mjs +43 -0
  89. package/dist/{index-CKI1fDEl.d.ts → index-HYnqS1SE.d.ts} +2 -2
  90. package/dist/index.browser.mjs +4 -4
  91. package/dist/index.d.ts +6 -7
  92. package/dist/index.mjs +20 -20
  93. package/dist/{long-query-thread-WVSMIBYP.mjs → long-query-thread-U7K5A72G.mjs} +14 -14
  94. package/dist/{module-2E4XYSGT.mjs → module-L2OZO5PQ.mjs} +11 -11
  95. package/dist/partial-words.mjs +5 -5
  96. package/dist/pattern.mjs +3 -3
  97. package/dist/persistence/durability/checkpoint-worker.d.ts +12 -1
  98. package/dist/persistence/durability/checkpoint-worker.mjs +23 -23
  99. package/dist/{phrase-module-JERF2IDG.mjs → phrase-module-5QHBD2VJ.mjs} +1 -1
  100. package/dist/react.d.ts +11 -8
  101. package/dist/react.mjs +4 -0
  102. package/dist/{rerank-DMMT4FZA.mjs → rerank-KTLC3E6N.mjs} +5 -5
  103. package/dist/rerankers/http.mjs +2 -2
  104. package/dist/{browser/restore-queue-GEZ54CA5.mjs → restore-queue-RYSRRFS4.mjs} +8 -2
  105. package/dist/{runtime-7MLQ7J64.mjs → runtime-DYV75DCB.mjs} +6 -6
  106. package/dist/{schema-CS-clLun.d.ts → schema-BTXbHCqA.d.ts} +4 -1
  107. package/dist/server.d.ts +200 -11
  108. package/dist/server.mjs +66 -23
  109. package/dist/{snapshot-DOQLGGEX.mjs → snapshot-BTRZ3MZK.mjs} +59 -190
  110. package/dist/synonyms.mjs +6 -4
  111. package/dist/tasks-DjGjK70Y.d.ts +720 -0
  112. package/dist/{thread-DNK5XWXG.mjs → thread-USB3GOPY.mjs} +13 -13
  113. package/dist/vector/search-worker.d.ts +1 -1
  114. package/dist/vector/search-worker.mjs +5 -5
  115. package/dist/workers/entry.mjs +7 -7
  116. package/dist/{write-ZKR7SNRT.mjs → write-GHTA56OW.mjs} +25 -22
  117. package/openapi.json +5310 -0
  118. package/package.json +16 -8
  119. package/dist/config-hOWGBeC6.d.ts +0 -414
  120. package/dist/tasks-BfF-VRhm.d.ts +0 -302
package/dist/server.d.ts CHANGED
@@ -1,17 +1,206 @@
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 './events-DErop1LM.js';
2
- import { c as ServerOptions, N as NarsilServer } from './capabilities-Bl8G9taj.js';
3
- export { A as ASYNC_IMPORT_CAPABILITY, B as BM25_TUNING_CAPABILITY, C as CorsOptions, D as DOCUMENT_EXPORT_CAPABILITY, E as ErrorEnvelope, I as INDEX_LIFECYCLE_CAPABILITY, O as OnRequestHook, R as REBUILD_ANALYSIS_CAPABILITY, d as RequestContext, e as RequestDenial, S as SERVER_CAPABILITIES, a as SYNONYMS_CAPABILITY, f as ServerLimits, T as TASK_CANCEL_CAPABILITY, b as TASK_FILTER_CAPABILITY } from './capabilities-Bl8G9taj.js';
4
- import { N as Narsil } from './engine-B_W9sdZK.js';
5
- import { d as TaskProgress, b as ImportResult, h as TaskStore, e as TaskRecord } from './tasks-BfF-VRhm.js';
6
- 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-BfF-VRhm.js';
7
- import './schema-CS-clLun.js';
1
+ import { G as GroupResult, Q as QueryParams, n as GroupConfig, m as QueryResult, L as ListParams, g as SuggestParams, k as IndexStats, f as ListResult, j as PreflightResult, h as SuggestResult } from './config-B0H-vp4U.js';
2
+ 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 './config-B0H-vp4U.js';
3
+ import { E as ErrorEnvelope, c as ServerOptions, N as NarsilServer } from './capabilities-DXAmysqJ.js';
4
+ export { A as ASYNC_IMPORT_CAPABILITY, B as BM25_TUNING_CAPABILITY, C as CHANGE_ANALYSIS_CAPABILITY, d as CorsOptions, D as DOCUMENT_EXPORT_CAPABILITY, I as INDEX_LIFECYCLE_CAPABILITY, O as OnRequestHook, R as REBUILD_ANALYSIS_CAPABILITY, e as RequestContext, f as RequestDenial, S as SERVER_CAPABILITIES, a as SYNONYMS_CAPABILITY, g as ServerLimits, T as TASK_CANCEL_CAPABILITY, b as TASK_FILTER_CAPABILITY } from './capabilities-DXAmysqJ.js';
5
+ import { N as Narsil } from './engine-CuLMbH1-.js';
6
+ import { j as CreateIndexRequest, H as HttpIndexConfig, B as BatchBody, a as ChangeAnalysisBody, D as DocumentBody, k as InsertBody, l as MultiGetBody, R as RebalanceBody, m as ReplicationFactorBody, d as TaskListQuery, V as VectorFieldBody, S as SynonymSetBody, n as BatchResponse, C as CapabilitiesResponse, o as ClusterAllocationResponse, p as ClusterTopologyResponse, q as DocumentCountResponse, r as DocumentExistsResponse, s as DocumentIdResponse, t as DocumentPutResponse, u as DocumentRemovedResponse, v as DocumentResponse, c as ImportResult, w as IndexClearedResponse, x as IndexCreatedResponse, y as IndexDroppedResponse, z as IndexListResponse, A as IndexPartitionsResponse, F as IndexStateResponse, L as LivenessResponse, M as MemoryStatsResponse, G as MultiGetResponse, O as OkResponse, J as ReadinessResponse, K as ReplicationFactorResponse, T as TaskListPage, f as TaskRecord, N as VectorMaintenanceResponse, P as VersionResponse, e as TaskProgress, i as TaskStore } from './tasks-DjGjK70Y.js';
7
+ export { Q as BatchFailure, U as ClusterMemberReport, W as ClusterNodeReport, b as CreateIndexEmbedding, E as ErrorDetail, I as ImportError, X as PartitionAllocationReport, g as TaskStatus, h as TaskType } from './tasks-DjGjK70Y.js';
8
+ import { e as ClusterHealth } from './config-Brysl9NO.js';
9
+ import { S as SchemaDefinition, P as PartitionConfig, V as VectorIndexConfig, B as BM25Params, F as FieldType } from './schema-BTXbHCqA.js';
8
10
  import './adapters-BQFQ4PRz.js';
9
11
  import './synonyms-CpOAHPa-.js';
10
- import './config-CzB9YvF_.js';
11
- import './config-hOWGBeC6.js';
12
- import './index-CKI1fDEl.js';
12
+ import './index-HYnqS1SE.js';
13
13
  import './types-DvncmvuQ.js';
14
14
 
15
+ /**
16
+ * Everything `POST /indexes/{name}/search` accepts, which is {@link QueryParams}
17
+ * with a `group` that holds no reducer, because a function cannot cross JSON.
18
+ *
19
+ * @public
20
+ */
21
+ type HttpQueryParams = Omit<QueryParams, 'group'> & {
22
+ /** These settings collapse the hits into groups by field value. */
23
+ group?: Omit<GroupConfig, 'reduce'>;
24
+ };
25
+ /**
26
+ * One group of hits as the server sends it, which is {@link GroupResult} with
27
+ * no reducer output, because the server refuses a query with a reducer.
28
+ *
29
+ * @public
30
+ */
31
+ type HttpGroupResult = Omit<GroupResult, 'reduced' | 'reducerError'>;
32
+ /**
33
+ * The body of `POST /indexes/{name}/search`.
34
+ *
35
+ * @public
36
+ */
37
+ type HttpQueryResult = Omit<QueryResult, 'groups'> & {
38
+ /** These groups arrive when the query asked for grouping. */
39
+ groups?: HttpGroupResult[];
40
+ };
41
+ /**
42
+ * The settings of a new index as `POST /indexes` reads them, which is
43
+ * {@link HttpIndexConfig} with each field type spelled out.
44
+ *
45
+ * @public
46
+ */
47
+ type HttpIndexBody = Omit<HttpIndexConfig, 'schema' | 'partitions' | 'vectorPromotion'> & {
48
+ /** This layout gives each value as either a field type or a nested schema. */
49
+ schema: SchemaDefinition;
50
+ /** These settings control how the index splits documents across partitions as it grows. */
51
+ partitions?: PartitionConfig;
52
+ /** These settings control when vector fields move to an HNSW graph, and how that graph is built. */
53
+ vectorPromotion?: VectorIndexConfig;
54
+ };
55
+ /**
56
+ * The body of `POST /indexes`, which is {@link CreateIndexRequest} with the
57
+ * settings of {@link HttpIndexBody}.
58
+ *
59
+ * @public
60
+ */
61
+ type HttpCreateIndexBody = Omit<CreateIndexRequest, 'config'> & {
62
+ /** This carries the schema and settings, in the subset JSON can express. */
63
+ config: HttpIndexBody;
64
+ };
65
+ /**
66
+ * The query string of `DELETE /indexes/{name}/documents/{id}`.
67
+ *
68
+ * @public
69
+ */
70
+ interface RemoveDocumentQuery {
71
+ /** Under `true`, the server answers only once every worker copy has applied the removal. */
72
+ wait?: 'true' | 'false';
73
+ }
74
+ /**
75
+ * The query string of `POST /indexes/{name}/documents/_import`.
76
+ *
77
+ * @public
78
+ */
79
+ interface ImportDocumentsQuery {
80
+ /** Under `true`, the server starts a task and answers 202 with its record. */
81
+ async?: 'true' | 'false';
82
+ }
83
+ /**
84
+ * Every named type that a route of the HTTP server sends or takes as JSON,
85
+ * under the name that the published OpenAPI file gives its schema.
86
+ *
87
+ * @public
88
+ */
89
+ interface HttpWireTypes {
90
+ /** The body of `POST /indexes/{name}/documents/_batch`, which gives the action to perform. */
91
+ BatchBody: BatchBody;
92
+ /** The body of `POST /indexes/{name}/bm25`. */
93
+ BM25Params: BM25Params;
94
+ /** The body of `POST /indexes/{name}/_change-analysis`. */
95
+ ChangeAnalysisBody: ChangeAnalysisBody;
96
+ /** The body of `POST /indexes`. */
97
+ HttpCreateIndexBody: HttpCreateIndexBody;
98
+ /** The body of a request that writes one document with a known id. */
99
+ DocumentBody: DocumentBody;
100
+ /** Every value that a field of an index schema accepts. */
101
+ FieldType: FieldType;
102
+ /** The query string of `POST /indexes/{name}/documents/_import`. */
103
+ ImportDocumentsQuery: ImportDocumentsQuery;
104
+ /** The body of `POST /indexes/{name}/documents`. */
105
+ InsertBody: InsertBody;
106
+ /** The body of `POST /indexes/{name}/documents/_list`. */
107
+ ListParams: ListParams;
108
+ /** The body of `POST /indexes/{name}/documents/_multi-get`. */
109
+ MultiGetBody: MultiGetBody;
110
+ /** The body of `POST /indexes/{name}/partition-config`. */
111
+ PartitionConfig: PartitionConfig;
112
+ /** The body of `POST /indexes/{name}/search` and of `POST /indexes/{name}/search/preflight`. */
113
+ HttpQueryParams: HttpQueryParams;
114
+ /** The body of `POST /indexes/{name}/_rebalance`. */
115
+ RebalanceBody: RebalanceBody;
116
+ /** The query string of `DELETE /indexes/{name}/documents/{id}`. */
117
+ RemoveDocumentQuery: RemoveDocumentQuery;
118
+ /** The body of `PUT /indexes/{name}/replication-factor`. */
119
+ ReplicationFactorBody: ReplicationFactorBody;
120
+ /** The body of `POST /indexes/{name}/suggest`. */
121
+ SuggestParams: SuggestParams;
122
+ /** The query string of `GET /tasks`. */
123
+ TaskListQuery: TaskListQuery;
124
+ /** The body of `POST /indexes/{name}/vectors/_compact` and of `POST /indexes/{name}/vectors/_optimize`. */
125
+ VectorFieldBody: VectorFieldBody;
126
+ /** The body of `GET` and of `POST /indexes/{name}/synonyms`. */
127
+ SynonymSetBody: SynonymSetBody;
128
+ /** The body of `POST /indexes/{name}/documents/_batch`. */
129
+ BatchResponse: BatchResponse;
130
+ /** The body of `GET /capabilities`. */
131
+ CapabilitiesResponse: CapabilitiesResponse;
132
+ /** The body of `GET /indexes/{name}/cluster`. */
133
+ ClusterAllocationResponse: ClusterAllocationResponse;
134
+ /** The body of `GET /cluster/health`. */
135
+ ClusterHealth: ClusterHealth;
136
+ /** The body of `GET /cluster`. */
137
+ ClusterTopologyResponse: ClusterTopologyResponse;
138
+ /** The body of `GET /indexes/{name}/count`. */
139
+ DocumentCountResponse: DocumentCountResponse;
140
+ /** The body of `GET /indexes/{name}/documents/{id}/_exists`. */
141
+ DocumentExistsResponse: DocumentExistsResponse;
142
+ /** The body of `POST /indexes/{name}/documents` and of `PATCH /indexes/{name}/documents/{id}`. */
143
+ DocumentIdResponse: DocumentIdResponse;
144
+ /** The body of `PUT /indexes/{name}/documents/{id}`. */
145
+ DocumentPutResponse: DocumentPutResponse;
146
+ /** The body of `DELETE /indexes/{name}/documents/{id}`. */
147
+ DocumentRemovedResponse: DocumentRemovedResponse;
148
+ /** The body of `GET /indexes/{name}/documents/{id}`. */
149
+ DocumentResponse: DocumentResponse;
150
+ /** The body of every failed response. */
151
+ ErrorEnvelope: ErrorEnvelope;
152
+ /** The body of `POST /indexes/{name}/search`. */
153
+ HttpQueryResult: HttpQueryResult;
154
+ /** The body of `POST /indexes/{name}/documents/_import` when the server finishes the import inside the request. */
155
+ ImportResult: ImportResult;
156
+ /** The body of `POST /indexes/{name}/_clear`. */
157
+ IndexClearedResponse: IndexClearedResponse;
158
+ /** The body of `POST /indexes`. */
159
+ IndexCreatedResponse: IndexCreatedResponse;
160
+ /** The body of `DELETE /indexes/{name}`. */
161
+ IndexDroppedResponse: IndexDroppedResponse;
162
+ /** The body of `GET /indexes`. */
163
+ IndexListResponse: IndexListResponse;
164
+ /** The body of `GET /indexes/{name}/partitions`. */
165
+ IndexPartitionsResponse: IndexPartitionsResponse;
166
+ /** The body of `POST /indexes/{name}/_open` and of `POST /indexes/{name}/_close`. */
167
+ IndexStateResponse: IndexStateResponse;
168
+ /** The body of `GET /indexes/{name}/stats`. */
169
+ IndexStats: IndexStats;
170
+ /** The body of `GET /livez`. */
171
+ LivenessResponse: LivenessResponse;
172
+ /** The body of `POST /indexes/{name}/documents/_list`. */
173
+ ListResult: ListResult;
174
+ /** The body of `GET /stats/memory`. */
175
+ MemoryStatsResponse: MemoryStatsResponse;
176
+ /** The body of `POST /indexes/{name}/documents/_multi-get`. */
177
+ MultiGetResponse: MultiGetResponse;
178
+ /** The body of a request that the server finishes with nothing further to report. */
179
+ OkResponse: OkResponse;
180
+ /** The body of `POST /indexes/{name}/search/preflight`. */
181
+ PreflightResult: PreflightResult;
182
+ /** The body of `GET /readyz` and of `GET /health`. */
183
+ ReadinessResponse: ReadinessResponse;
184
+ /** The body of `PUT /indexes/{name}/replication-factor`. */
185
+ ReplicationFactorResponse: ReplicationFactorResponse;
186
+ /** The body of `POST /indexes/{name}/suggest`. */
187
+ SuggestResult: SuggestResult;
188
+ /** The body of `GET /tasks`. */
189
+ TaskListPage: TaskListPage;
190
+ /** The body of every route that starts a task, and of `GET /tasks/{id}`. */
191
+ TaskRecord: TaskRecord;
192
+ /** The body of `GET /indexes/{name}/vector-maintenance`. */
193
+ VectorMaintenanceResponse: VectorMaintenanceResponse;
194
+ /** The body of `GET /version`. */
195
+ VersionResponse: VersionResponse;
196
+ }
197
+ /**
198
+ * The name of one schema in the published OpenAPI file.
199
+ *
200
+ * @public
201
+ */
202
+ type HttpWireTypeName = keyof HttpWireTypes;
203
+
15
204
  /**
16
205
  * What a running task reports back while it works, and how it learns that a
17
206
  * cancel arrived.
@@ -125,4 +314,4 @@ declare class InMemoryTaskStore implements TaskStore {
125
314
  private prune;
126
315
  }
127
316
 
128
- export { ImportResult, InMemoryTaskStore, NarsilServer, ServerOptions, type TaskContext, type TaskOperation, TaskProgress, TaskRecord, TaskStore, createServer, httpStatusForNarsilError };
317
+ export { BatchBody, BatchResponse, CapabilitiesResponse, ClusterAllocationResponse, ClusterTopologyResponse, CreateIndexRequest, DocumentBody, DocumentCountResponse, DocumentExistsResponse, DocumentIdResponse, DocumentPutResponse, DocumentRemovedResponse, DocumentResponse, ErrorEnvelope, type HttpCreateIndexBody, type HttpGroupResult, type HttpIndexBody, HttpIndexConfig, type HttpQueryParams, type HttpQueryResult, type HttpWireTypeName, type HttpWireTypes, type ImportDocumentsQuery, ImportResult, InMemoryTaskStore, IndexClearedResponse, IndexCreatedResponse, IndexDroppedResponse, IndexListResponse, IndexPartitionsResponse, IndexStateResponse, InsertBody, LivenessResponse, MemoryStatsResponse, MultiGetBody, MultiGetResponse, NarsilServer, OkResponse, ReadinessResponse, RebalanceBody, type RemoveDocumentQuery, ReplicationFactorBody, ReplicationFactorResponse, ServerOptions, SynonymSetBody, type TaskContext, TaskListPage, TaskListQuery, type TaskOperation, TaskProgress, TaskRecord, TaskStore, VectorFieldBody, VectorMaintenanceResponse, VersionResponse, createServer, httpStatusForNarsilError };
package/dist/server.mjs CHANGED
@@ -1,36 +1,37 @@
1
- import { answerRequest } from './chunk-YBWSV5DV.mjs';
2
- import { DEFAULT_MAX_RETAINED_TASKS, loadUWebSockets, resolveCors, authorizerFor, createSharedGateBuffer, gateSlotOfWorker, createBodyBudgetBuffer, createRouteRunner, corsHeaderReader, createSharedBodyBudget, MAIN_THREAD_GATE_SLOT, createSharedRequestGate, registerServerRoutes, DEFAULT_MAX_CONCURRENT_TASKS, DEFAULT_MAX_TASK_PAGE_SIZE, DEFAULT_MAX_IMPORT_ERRORS, DEFAULT_MAX_FETCH_DOCUMENTS, DEFAULT_MAX_RESULT_WINDOW, DEFAULT_MAX_CONCURRENT_REQUESTS, DEFAULT_IMPORT_BATCH_SIZE, DEFAULT_MAX_LINE_BYTES, DEFAULT_MAX_RESTORE_BYTES, DEFAULT_MAX_IMPORT_BYTES, DEFAULT_MAX_BODY_BYTES, DEFAULT_MAX_RERANK_WINDOW, DEFAULT_MAX_BODY_BYTES_IN_FLIGHT_FRACTION, RUNNING_TASK_TTL_MS, DEFAULT_TASK_PAGE_SIZE, TERMINAL_TASK_TTL_MS, TASK_PROGRESS_WRITE_INTERVAL_MS, serializeNarsilError, createVersionHandler, acceptorOf, MAX_BODY_BYTES_IN_FLIGHT_FRACTION, createDocumentReadHandlers, sendError, respondError, respondJson, sendText, MAX_INDEX_TOUCH_INTERVAL_MS, INDEX_TOUCH_INTERVALS_PER_IDLE_TIMEOUT, closeEveryThreadAtExit, REQUEST_THREAD_CLOSE_AT_EXIT_MS, clearGateSlot, clearBodyBudgetSlot, createCloseAtExitWords, createDepartureWord, departureConfirmed, parseJson, validateCreateIndex, rejectInvalid, isRemoveOnlyBatch, validateBatch, serializeBatchResult, parseWriteJson, validateDocumentBody, validateSuggest, validateQuery, refuseRegex, withServerRerankWindow, respondAnswer, parseTaskListQuery, parseJsonOptional, validateRebalance, badRequest, sendStream, SNAPSHOT_ARCHIVE_CONTENT_TYPE, DOCUMENT_EXPORT_CONTENT_TYPE, parseRefusalOf, IMPORT_FLUSHES_IN_FLIGHT, confirmDeparture, SERVER_CAPABILITIES, toHttpError, MIN_UNBOUNDED_SERVER_LIMIT, MIN_COUNTED_SERVER_LIMIT } from './chunk-XABMCBHA.mjs';
3
- export { ASYNC_IMPORT_CAPABILITY, BM25_TUNING_CAPABILITY, DOCUMENT_EXPORT_CAPABILITY, INDEX_LIFECYCLE_CAPABILITY, REBUILD_ANALYSIS_CAPABILITY, SERVER_CAPABILITIES, SYNONYMS_CAPABILITY, TASK_CANCEL_CAPABILITY, TASK_FILTER_CAPABILITY, httpStatusForNarsilError } from './chunk-XABMCBHA.mjs';
4
- import { rerankOnHost } from './chunk-PATMDIMN.mjs';
5
- import { writeBlockLookupOf, indexReadsOf, isRecord, validateIndexName } from './chunk-T4OFG4IQ.mjs';
6
- import { readMemoryFigures } from './chunk-4GDLFDPZ.mjs';
1
+ import { answerRequest } from './chunk-ZMBFWQXN.mjs';
2
+ import { DEFAULT_MAX_RETAINED_TASKS, loadUWebSockets, resolveCors, authorizerFor, createSharedGateBuffer, gateSlotOfWorker, createBodyBudgetBuffer, createRouteRunner, corsHeaderReader, createSharedBodyBudget, MAIN_THREAD_GATE_SLOT, createSharedRequestGate, registerServerRoutes, DEFAULT_MAX_CONCURRENT_TASKS, DEFAULT_MAX_TASK_PAGE_SIZE, DEFAULT_MAX_IMPORT_ERRORS, DEFAULT_MAX_FETCH_DOCUMENTS, DEFAULT_MAX_RESULT_WINDOW, DEFAULT_MAX_CONCURRENT_REQUESTS, DEFAULT_IMPORT_BATCH_SIZE, DEFAULT_MAX_LINE_BYTES, DEFAULT_MAX_RESTORE_BYTES, DEFAULT_MAX_IMPORT_BYTES, DEFAULT_MAX_BODY_BYTES, DEFAULT_MAX_RERANK_WINDOW, DEFAULT_MAX_BODY_BYTES_IN_FLIGHT_FRACTION, RUNNING_TASK_TTL_MS, DEFAULT_TASK_PAGE_SIZE, TERMINAL_TASK_TTL_MS, TASK_PROGRESS_WRITE_INTERVAL_MS, serializeNarsilError, createVersionHandler, acceptorOf, MAX_BODY_BYTES_IN_FLIGHT_FRACTION, createDocumentReadHandlers, sendError, respondError, respondJson, sendText, PROMETHEUS_TEXT_CONTENT_TYPE, MAX_INDEX_TOUCH_INTERVAL_MS, INDEX_TOUCH_INTERVALS_PER_IDLE_TIMEOUT, closeEveryThreadAtExit, REQUEST_THREAD_CLOSE_AT_EXIT_MS, clearGateSlot, clearBodyBudgetSlot, createCloseAtExitWords, createDepartureWord, departureConfirmed, parseJson, validateCreateIndex, rejectInvalid, isRemoveOnlyBatch, validateBatch, serializeBatchResult, parseWriteJson, validateDocumentBody, validateSuggest, validateQuery, refuseRegex, withServerRerankWindow, respondAnswer, parseTaskListQuery, parseJsonOptional, validateChangeAnalysis, validateRebalance, badRequest, sendStream, SNAPSHOT_ARCHIVE_CONTENT_TYPE, DOCUMENT_EXPORT_CONTENT_TYPE, parseRefusalOf, IMPORT_FLUSHES_IN_FLIGHT, confirmDeparture, SERVER_CAPABILITIES, toHttpError, MIN_UNBOUNDED_SERVER_LIMIT, MIN_COUNTED_SERVER_LIMIT } from './chunk-SBMAWTRG.mjs';
3
+ export { ASYNC_IMPORT_CAPABILITY, BM25_TUNING_CAPABILITY, CHANGE_ANALYSIS_CAPABILITY, DOCUMENT_EXPORT_CAPABILITY, INDEX_LIFECYCLE_CAPABILITY, REBUILD_ANALYSIS_CAPABILITY, SERVER_CAPABILITIES, SYNONYMS_CAPABILITY, TASK_CANCEL_CAPABILITY, TASK_FILTER_CAPABILITY, httpStatusForNarsilError } from './chunk-SBMAWTRG.mjs';
4
+ import { rerankOnHost } from './chunk-HJJWY6PT.mjs';
5
+ import { writeBlockLookupOf, indexReadsOf, isRecord, validateIndexName } from './chunk-IP4HJOGC.mjs';
6
+ import './chunk-TCWQJL7O.mjs';
7
+ import { readMemoryFigures } from './chunk-DD2673TX.mjs';
7
8
  import './chunk-IWVEG5CX.mjs';
8
9
  import './chunk-DJHHF2L5.mjs';
9
10
  import './chunk-P36MUFEJ.mjs';
10
- import { rerankWindowCapOf, engineCoreOf, providedDocId, resolveVectorText } from './chunk-JT3YZGCE.mjs';
11
+ import { rerankWindowCapOf, engineCoreOf, providedDocId, resolveVectorText } from './chunk-XXKWEG53.mjs';
11
12
  import { detectRuntime } from './chunk-AV4IJKD2.mjs';
12
- import './chunk-ZR4VM4A6.mjs';
13
+ import './chunk-N37VMC62.mjs';
13
14
  import './chunk-ZATRDAYU.mjs';
14
15
  import './chunk-EBIHRL7B.mjs';
15
16
  import { MAX_RERANK_WINDOW } from './chunk-HJSN7UYG.mjs';
16
- import './chunk-RNSC4NFI.mjs';
17
- import './chunk-TGP5M5R7.mjs';
18
- import './chunk-U2BKYEC7.mjs';
19
- import './chunk-2C3WXBQS.mjs';
17
+ import './chunk-EEBCDP36.mjs';
18
+ import './chunk-74XB2SXI.mjs';
20
19
  import './chunk-WQBCBKY3.mjs';
21
- import './chunk-PU6SKH7O.mjs';
20
+ import './chunk-UBXJQJII.mjs';
22
21
  import './chunk-U476IXKQ.mjs';
23
22
  import './chunk-FQBFZAWG.mjs';
24
23
  import './chunk-VJS4JFBQ.mjs';
25
- import './chunk-7XY6VD7B.mjs';
26
- import './chunk-7X5JST5L.mjs';
24
+ import './chunk-ZSWHPKGM.mjs';
25
+ import './chunk-WNBRW4Q2.mjs';
26
+ import './chunk-TGP5M5R7.mjs';
27
+ import './chunk-U2BKYEC7.mjs';
27
28
  import './chunk-R6A773WK.mjs';
28
29
  import './chunk-YTJCGKM4.mjs';
29
30
  import { startIdleHeapCleanup } from './chunk-RIIUZJQ3.mjs';
30
31
  import './chunk-22YPZVMG.mjs';
31
32
  import './chunk-L5ORED7V.mjs';
32
- import { NarsilError, ErrorCodes, ServerErrorCodes, isNarsilError } from './chunk-CZ7ISLXA.mjs';
33
- export { ClientErrorCodes, ErrorCodes, NarsilError, ServerErrorCodes, isNarsilError } from './chunk-CZ7ISLXA.mjs';
33
+ import { NarsilError, ErrorCodes, ServerErrorCodes, isNarsilError } from './chunk-HNHCNTVG.mjs';
34
+ export { ClientErrorCodes, ErrorCodes, NarsilError, ServerErrorCodes, isNarsilError } from './chunk-HNHCNTVG.mjs';
34
35
  import { randomUUID } from 'crypto';
35
36
  import { createReadStream } from 'fs';
36
37
  import { MessageChannel } from 'worker_threads';
@@ -151,6 +152,24 @@ function createAdminHandlers(deps) {
151
152
  const record = await tasks.start("rebuildAnalysis", name, () => engine.rebuildAnalysis(name));
152
153
  respondJson(ctx, record, 202);
153
154
  }
155
+ async function changeAnalysis(ctx) {
156
+ const body = parseJsonOptional(ctx);
157
+ if (!body) return;
158
+ const failure = validateChangeAnalysis(body);
159
+ if (failure) {
160
+ rejectInvalid(ctx, failure);
161
+ return;
162
+ }
163
+ const name = ctx.params[0];
164
+ try {
165
+ await requireIndexExists(name);
166
+ } catch (err) {
167
+ respondError(ctx, err);
168
+ return;
169
+ }
170
+ const record = await tasks.start("changeAnalysis", name, () => engine.changeAnalysis(name, body));
171
+ respondJson(ctx, record, 202);
172
+ }
154
173
  async function rebalance(ctx) {
155
174
  const body = parseJsonOptional(ctx);
156
175
  if (!body) return;
@@ -250,6 +269,7 @@ function createAdminHandlers(deps) {
250
269
  optimize,
251
270
  rebalance,
252
271
  rebuildAnalysis,
272
+ changeAnalysis,
253
273
  restore,
254
274
  getTask,
255
275
  listTasks,
@@ -317,7 +337,12 @@ function createClusterHandlers(deps) {
317
337
  }
318
338
  const table = await cluster.getAllocation(indexName);
319
339
  if (table === null) {
320
- respondJson(ctx, { indexName, allocated: false, version: null, partitions: [] });
340
+ respondJson(ctx, {
341
+ indexName,
342
+ allocated: false,
343
+ version: null,
344
+ partitions: []
345
+ });
321
346
  return;
322
347
  }
323
348
  const partitions = [];
@@ -335,7 +360,12 @@ function createClusterHandlers(deps) {
335
360
  });
336
361
  }
337
362
  partitions.sort((left, right) => left.partitionId - right.partitionId);
338
- respondJson(ctx, { indexName, allocated: partitions.length > 0, version: table.version, partitions });
363
+ respondJson(ctx, {
364
+ indexName,
365
+ allocated: partitions.length > 0,
366
+ version: table.version,
367
+ partitions
368
+ });
339
369
  } catch (err) {
340
370
  respondError(ctx, err);
341
371
  }
@@ -763,9 +793,20 @@ function mapHttpIndexConfig(http) {
763
793
  if (http.required !== void 0) config.required = http.required;
764
794
  if (http.patternValueLimit !== void 0) config.patternValueLimit = http.patternValueLimit;
765
795
  if (http.synonyms !== void 0) config.synonyms = http.synonyms;
766
- if (http.stopWords !== void 0) {
796
+ if (http.tokenizer !== void 0) {
797
+ if (typeof http.tokenizer !== "string") {
798
+ throw new NarsilError(ErrorCodes.CONFIG_INVALID, 'Field "tokenizer" must be a registered name');
799
+ }
800
+ config.tokenizer = http.tokenizer;
801
+ }
802
+ if (typeof http.stopWords === "string") {
803
+ config.stopWords = http.stopWords;
804
+ } else if (http.stopWords !== void 0) {
767
805
  if (!Array.isArray(http.stopWords) || http.stopWords.some((w) => typeof w !== "string")) {
768
- throw new NarsilError(ErrorCodes.CONFIG_INVALID, 'Field "stopWords" must be an array of strings');
806
+ throw new NarsilError(
807
+ ErrorCodes.CONFIG_INVALID,
808
+ 'Field "stopWords" must be a registered name or an array of strings'
809
+ );
769
810
  }
770
811
  config.stopWords = new Set(http.stopWords);
771
812
  }
@@ -837,7 +878,9 @@ function createIndexHandlers(deps) {
837
878
  }
838
879
  async function partitions(ctx) {
839
880
  try {
840
- respondJson(ctx, { partitions: await indexReadsOf(engine).getPartitionStats(ctx.params[0]) });
881
+ respondJson(ctx, {
882
+ partitions: await indexReadsOf(engine).getPartitionStats(ctx.params[0])
883
+ });
841
884
  } catch (err) {
842
885
  respondError(ctx, err);
843
886
  }
@@ -870,7 +913,6 @@ function createIndexHandlers(deps) {
870
913
  }
871
914
 
872
915
  // src/server/handlers/metrics.ts
873
- var PROMETHEUS_TEXT_CONTENT_TYPE = "text/plain; version=0.0.4; charset=utf-8";
874
916
  function labelValue(value) {
875
917
  return value.replaceAll("\\", "\\\\").replaceAll('"', '\\"').replaceAll("\n", "\\n");
876
918
  }
@@ -1707,6 +1749,7 @@ function mainThreadHandlers(deps) {
1707
1749
  multiGet: doc.multiGet,
1708
1750
  checkpoint: admin.checkpoint,
1709
1751
  rebuildAnalysis: admin.rebuildAnalysis,
1752
+ changeAnalysis: admin.changeAnalysis,
1710
1753
  snapshot: admin.snapshot,
1711
1754
  vectorMaintenance: admin.vectorMaintenance,
1712
1755
  compact: admin.compact,