@delali/narsil 0.3.1-next.69 → 0.3.1-next.71
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.
- package/dist/{capabilities-B1wz2Zl0.d.ts → capabilities-Dt-7B4Wz.d.ts} +2 -2
- package/dist/{chunk-DD5X23E6.mjs → chunk-2STVUTNA.mjs} +1 -1
- package/dist/chunk-3JGWULDF.mjs +256 -0
- package/dist/{chunk-6TGZG2TV.mjs → chunk-653BNMAF.mjs} +190 -58
- package/dist/{chunk-YA52AC2V.mjs → chunk-FVLQ63B7.mjs} +203 -9
- package/dist/{chunk-5JLSTECC.mjs → chunk-GIVAGD3Q.mjs} +1 -1
- package/dist/{chunk-AV4IJKD2.mjs → chunk-HWQLTLNG.mjs} +18 -1
- package/dist/{chunk-6IT3MH5M.mjs → chunk-IOR2K26O.mjs} +178 -238
- package/dist/{chunk-4VU5TWCR.mjs → chunk-LMO5TJUS.mjs} +40 -35
- package/dist/{chunk-BEWOA4VV.mjs → chunk-M76V3OGJ.mjs} +508 -401
- package/dist/{chunk-YMZCMH5M.mjs → chunk-OI42GWLR.mjs} +17 -1
- package/dist/{chunk-2BDG2IWP.mjs → chunk-P4DSQ6M4.mjs} +16 -6
- package/dist/{chunk-THYRHHO2.mjs → chunk-YJDQ7NLA.mjs} +1 -1
- package/dist/{client-xVrOCYTW.d.ts → client-COek5GXK.d.ts} +3 -3
- package/dist/client.d.ts +8 -8
- package/dist/{config-CEeSV_Xo.d.ts → config-Dfanyqqt.d.ts} +2 -2
- package/dist/{config-CSvCVtB7.d.ts → config-rBpbgTw8.d.ts} +2 -2
- package/dist/direct-executor-GYJEKNV5.mjs +12 -0
- package/dist/distribution/coordinator/etcd.d.ts +2 -2
- package/dist/distribution/coordinator/etcd.mjs +1 -1
- package/dist/distribution/coordinator/in-memory.d.ts +2 -2
- package/dist/distribution/coordinator/in-memory.mjs +1 -1
- package/dist/distribution.d.ts +8 -8
- package/dist/distribution.mjs +109 -69
- package/dist/{engine-77ErLy8P.d.ts → engine-igk0aMpQ.d.ts} +109 -60
- package/dist/index.browser.mjs +1167 -749
- package/dist/index.d.ts +7 -7
- package/dist/index.mjs +10 -10
- package/dist/invalidation/filesystem.mjs +1 -1
- package/dist/{memory-CKF-9WLP.d.ts → memory-C7UMCMH3.d.ts} +35 -17
- package/dist/persistence/durability/checkpoint-worker.d.ts +2 -1
- package/dist/persistence/durability/checkpoint-worker.mjs +10 -10
- package/dist/react.d.ts +277 -182
- package/dist/react.mjs +189 -45
- package/dist/{schema-d5Afu03A.d.ts → schema-Bgzr4g7b.d.ts} +62 -10
- package/dist/server.d.ts +10 -10
- package/dist/server.mjs +11 -7
- package/dist/{tasks-BEiNxDRs.d.ts → tasks-BZt_zes6.d.ts} +3 -1
- package/dist/{thread-FLP45EUD.mjs → thread-JEVAYETR.mjs} +6 -6
- package/dist/{types-DAK7mnUZ.d.ts → types-gOUqhs2F.d.ts} +1 -1
- package/dist/vector/search-worker.d.ts +1 -1
- package/dist/vector/search-worker.mjs +2 -2
- package/dist/workers/entry.mjs +3 -3
- package/package.json +7 -7
- package/dist/chunk-VTPLKNWI.mjs +0 -135
- package/dist/direct-executor-3ZYXSGFX.mjs +0 -12
|
@@ -1,119 +1,168 @@
|
|
|
1
1
|
import { E as EmbeddingAdapter } from './adapters-79OIa4xm.js';
|
|
2
|
-
import { B as BatchResult, I as IndexInfo, f as IndexStats, P as PartitionStatsResult, L as ListParams, g as ListResult, Q as QueryParams, e as QueryResult, h as PreflightResult, j as SuggestParams, k as SuggestResult, M as MemoryStats, V as VectorMaintenanceResult } from './memory-
|
|
3
|
-
import { A as AnyDocument, a as InsertOptions, W as WriteOptions, I as IndexConfig, P as PartitionConfig } from './schema-
|
|
2
|
+
import { B as BatchResult, I as IndexInfo, f as IndexStats, P as PartitionStatsResult, L as ListParams, g as ListResult, Q as QueryParams, e as QueryResult, h as PreflightResult, j as SuggestParams, k as SuggestResult, M as MemoryStats, V as VectorMaintenanceResult } from './memory-C7UMCMH3.js';
|
|
3
|
+
import { A as AnyDocument, a as InsertOptions, W as WriteOptions, I as IndexConfig, P as PartitionConfig } from './schema-Bgzr4g7b.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* This map lists every event that the engine emits, with the payload of each
|
|
7
|
+
* one.
|
|
7
8
|
*
|
|
8
|
-
* {@link Narsil.on}
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
9
|
+
* {@link Narsil.on} registers a listener under a key from this map, so that the
|
|
10
|
+
* engine can pass the matching payload to that listener. Most of these events
|
|
11
|
+
* report work that the engine does in the background, away from the call that
|
|
12
|
+
* started it, so a failure that such an event reports never rejects a promise
|
|
13
|
+
* that you are holding.
|
|
12
14
|
*
|
|
13
15
|
* @public
|
|
14
16
|
*/
|
|
15
17
|
type NarsilEventMap = {
|
|
16
18
|
/**
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
19
|
+
* The engine emits this event after a call changes what a read returns from
|
|
20
|
+
* an index. The calls are the inserts, updates, and removals, singly or in a
|
|
21
|
+
* batch, together with `clear`, `restore`, `rebalance`, `rebuildAnalysis`,
|
|
22
|
+
* `compactVectors`, `optimizeVectors`, `createIndex`, and `dropIndex`. The
|
|
23
|
+
* engine emits the event after a call that throws as well, because a call can
|
|
24
|
+
* change the index before it throws. It also emits the event after it reloads
|
|
25
|
+
* an index, once a shared invalidation adapter reports that another instance
|
|
26
|
+
* saved that index. The engine emits one event per batch, however many
|
|
27
|
+
* documents the batch holds.
|
|
28
|
+
*
|
|
29
|
+
* The engine emits the event once a query can see the change, which means
|
|
30
|
+
* after every worker copy applies the change and after any rebalance in
|
|
31
|
+
* progress replays it. A query that a listener sends from its handler
|
|
32
|
+
* therefore returns results that include the change. The engine waits for the
|
|
33
|
+
* change to become visible only while a listener is registered for the event.
|
|
34
|
+
*/
|
|
35
|
+
write: {
|
|
36
|
+
/** This is the name of the index that changed. */
|
|
37
|
+
indexName: string;
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* A worker thread exited unexpectedly. The pool removes the thread and fails
|
|
41
|
+
* the requests that the thread was serving with `WORKER_CRASHED`. The engine
|
|
42
|
+
* then sends each of those queries again on the main thread, so the caller
|
|
43
|
+
* receives a result with no error. The remaining workers keep serving
|
|
44
|
+
* queries, because each of them holds a full worker copy of every promoted
|
|
45
|
+
* index.
|
|
46
|
+
*
|
|
47
|
+
* After a delay, the engine spawns a replacement and loads every copy onto
|
|
48
|
+
* it before it sends queries to the replacement. Once no worker is left, the
|
|
49
|
+
* main thread serves every query, because it holds every document. The first
|
|
50
|
+
* request after the delay then starts a new pool. The delay starts at one
|
|
51
|
+
* second and doubles up to a minute while replacements keep failing.
|
|
27
52
|
*/
|
|
28
53
|
workerCrash: {
|
|
29
|
-
/** This worker
|
|
54
|
+
/** This is the id of the worker that exited. */
|
|
30
55
|
workerId: number;
|
|
31
|
-
/**
|
|
56
|
+
/** These are the indexes that the worker held. */
|
|
32
57
|
indexNames: string[];
|
|
33
|
-
/** This ended the worker. */
|
|
58
|
+
/** This is the error that ended the worker. */
|
|
34
59
|
error: Error;
|
|
35
60
|
};
|
|
36
|
-
/** An index gained worker copies,
|
|
61
|
+
/** An index gained worker copies, either because it reached the copy
|
|
62
|
+
* threshold or because a request loaded its copies again after an idle
|
|
63
|
+
* spell. */
|
|
37
64
|
workerPromote: {
|
|
38
|
-
/**
|
|
65
|
+
/** This is the number of workers in the pool. */
|
|
39
66
|
workerCount: number;
|
|
40
|
-
/**
|
|
67
|
+
/** This is the reason that the index gained its copies, such as the copy
|
|
68
|
+
* threshold that it reached. */
|
|
41
69
|
reason: string;
|
|
42
70
|
};
|
|
43
|
-
/** An index could not gain worker copies
|
|
71
|
+
/** An index could not gain worker copies, so the main thread keeps serving
|
|
72
|
+
* its queries. */
|
|
44
73
|
workerPromoteFailure: {
|
|
45
|
-
/**
|
|
74
|
+
/** This is the reason that the engine tried to load the copies. */
|
|
46
75
|
reason: string;
|
|
47
|
-
/** This stopped
|
|
76
|
+
/** This is the error that stopped the load. */
|
|
48
77
|
error: Error;
|
|
49
|
-
/** This
|
|
78
|
+
/** This is true when the engine will try again at a later threshold. */
|
|
50
79
|
retryable: boolean;
|
|
51
80
|
};
|
|
52
|
-
/** An index finished spreading its documents across a new
|
|
81
|
+
/** An index finished spreading its documents across a new number of
|
|
82
|
+
* partitions. */
|
|
53
83
|
partitionRebalance: {
|
|
54
|
-
/** This index
|
|
84
|
+
/** This is the name of the index that the engine rebalanced. */
|
|
55
85
|
indexName: string;
|
|
56
|
-
/**
|
|
86
|
+
/** This is the number of partitions before the rebalance. */
|
|
57
87
|
oldCount: number;
|
|
58
|
-
/**
|
|
88
|
+
/** This is the number of partitions after the rebalance. */
|
|
59
89
|
newCount: number;
|
|
60
90
|
};
|
|
61
|
-
/**
|
|
91
|
+
/**
|
|
92
|
+
* An index passed its watermark, so its partitions are close to their
|
|
93
|
+
* capacity. On a cluster node, the engine reports the document count and the
|
|
94
|
+
* capacity of the one partition that `partitionId` identifies, which this
|
|
95
|
+
* node leads.
|
|
96
|
+
*/
|
|
62
97
|
partitionWatermark: {
|
|
63
|
-
/** This index crossed the mark. */
|
|
98
|
+
/** This is the name of the index that crossed the mark. */
|
|
64
99
|
indexName: string;
|
|
65
|
-
/**
|
|
100
|
+
/** This is the number of documents in the index, or in the partition on a
|
|
101
|
+
* cluster node. */
|
|
66
102
|
documentCount: number;
|
|
67
|
-
/**
|
|
103
|
+
/** This is the number of documents that the current partitions of the
|
|
104
|
+
* index can hold, or that the partition can hold on a cluster node. */
|
|
68
105
|
capacity: number;
|
|
69
|
-
/**
|
|
106
|
+
/** This is the number of partitions in the index. */
|
|
70
107
|
partitionCount: number;
|
|
108
|
+
/** On a cluster node, this is the partition that crossed the mark, while
|
|
109
|
+
* outside a cluster the field is absent. */
|
|
110
|
+
partitionId?: number;
|
|
71
111
|
};
|
|
72
112
|
/**
|
|
73
|
-
* The process uses nine tenths of its heap, measured during a write or a
|
|
74
|
-
* load, so the next large index
|
|
75
|
-
* error.
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
* that
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
*
|
|
113
|
+
* The process uses nine tenths of its heap, as measured during a write or a
|
|
114
|
+
* load, so the next large index can end the process with an out-of-memory
|
|
115
|
+
* error.
|
|
116
|
+
*
|
|
117
|
+
* Where `--max-old-space-size` or `--max-old-space-size-percentage` sets a
|
|
118
|
+
* limit, on the command line or in `NODE_OPTIONS`, the engine measures the
|
|
119
|
+
* used bytes against that limit, which `heapLimit` then reports. Where
|
|
120
|
+
* neither flag sets a limit, the engine measures the share of the heap that
|
|
121
|
+
* V8 reports as no longer available. V8 reports a limit about 192 MB above
|
|
122
|
+
* the true ceiling, so a process on a default heap below about 2 GB can end before
|
|
123
|
+
* this event fires.
|
|
124
|
+
*
|
|
125
|
+
* The engine emits the event once per crossing, then arms it again once the
|
|
126
|
+
* free share of the heap recovers to two tenths. Raise the limit with
|
|
83
127
|
* `--max-old-space-size-percentage` or `--max-old-space-size`, or close an
|
|
84
128
|
* idle index; see {@link ProcessMemoryReport.heapLimit}.
|
|
85
129
|
*/
|
|
86
130
|
heapPressure: {
|
|
87
|
-
/**
|
|
131
|
+
/** This is the index that a write or a load was touching when the heap
|
|
132
|
+
* reached that point. */
|
|
88
133
|
indexName: string;
|
|
89
|
-
/**
|
|
134
|
+
/** This is the heap that the process uses, in bytes. */
|
|
90
135
|
heapUsed: number;
|
|
91
|
-
/**
|
|
136
|
+
/** This is the size in bytes that the heap can grow to. */
|
|
92
137
|
heapLimit: number;
|
|
93
|
-
/**
|
|
138
|
+
/** This is the estimate of the bytes that the index holds. */
|
|
94
139
|
estimatedMemoryBytes: number;
|
|
95
140
|
};
|
|
96
|
-
/**
|
|
141
|
+
/** The engine started, completed, or failed a rebuild that brings the terms
|
|
142
|
+
* of an index up to the current analysis of its language module. */
|
|
97
143
|
analysisRebuild: {
|
|
98
|
-
/** This index
|
|
144
|
+
/** This is the name of the index under rebuild. */
|
|
99
145
|
indexName: string;
|
|
100
|
-
/**
|
|
146
|
+
/** This is the stage that the rebuild has reached. */
|
|
101
147
|
status: 'started' | 'completed' | 'failed';
|
|
102
|
-
/**
|
|
148
|
+
/** This is the number of partitions that the rebuild has covered so far. */
|
|
103
149
|
partitionsRebuilt: number;
|
|
104
|
-
/**
|
|
150
|
+
/** This is the number of partitions that the rebuild covers in total. */
|
|
105
151
|
partitionCount: number;
|
|
106
|
-
/** This stopped the rebuild,
|
|
152
|
+
/** This is the error that stopped the rebuild, which only a `failed`
|
|
153
|
+
* status includes. */
|
|
107
154
|
error?: Error;
|
|
108
155
|
};
|
|
109
|
-
/**
|
|
156
|
+
/** A write to the write-ahead log or a checkpoint failed, so the writes since
|
|
157
|
+
* the last checkpoint are at risk. */
|
|
110
158
|
durabilityError: {
|
|
111
|
-
/**
|
|
159
|
+
/** This is the error that the durability layer threw. */
|
|
112
160
|
error: Error;
|
|
113
161
|
};
|
|
114
|
-
/** The invalidation channel failed, so this instance
|
|
162
|
+
/** The invalidation channel failed, so this instance can serve partitions
|
|
163
|
+
* that another instance has since changed. */
|
|
115
164
|
invalidationError: {
|
|
116
|
-
/**
|
|
165
|
+
/** This is the error that the adapter threw. */
|
|
117
166
|
error: Error;
|
|
118
167
|
};
|
|
119
168
|
};
|