@delali/narsil 0.2.4-next.52 → 0.2.4-next.55
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/README.md +8 -4
- package/dist/adapters/filesystem.mjs +1 -1
- package/dist/adapters/indexeddb.mjs +1 -1
- package/dist/{capabilities-CuTSXvbN.d.ts → capabilities-DlYw0Ov0.d.ts} +13 -2
- package/dist/{chunk-U36IDJN7.mjs → chunk-4NVPQ6S5.mjs} +2 -2
- package/dist/{chunk-WM7IS45M.mjs → chunk-5T6AOR37.mjs} +2 -2
- package/dist/{chunk-ULJ36FK4.mjs → chunk-BH5SYB5W.mjs} +73 -46
- package/dist/{chunk-3GWP2TO6.mjs → chunk-D2S642IV.mjs} +4 -2
- package/dist/{chunk-P4ELXVJQ.mjs → chunk-FRQVMFY7.mjs} +7 -1
- package/dist/{chunk-ZT5BRDFW.mjs → chunk-L225SHNB.mjs} +2 -2
- package/dist/{chunk-72AXTIBW.mjs → chunk-NTZYA3SJ.mjs} +3 -3
- package/dist/{chunk-EY2ULUMT.mjs → chunk-RGS7FMCB.mjs} +25 -5
- package/dist/{chunk-YPYULM5E.mjs → chunk-TVT5V4E7.mjs} +84 -33
- package/dist/{chunk-T62YOSGS.mjs → chunk-U2AL3SON.mjs} +16 -98
- package/dist/chunk-UTOFOJOR.mjs +135 -0
- package/dist/{chunk-2FO7KZ6K.mjs → chunk-XNQAIO74.mjs} +53 -8
- package/dist/{client-BMJWVxOP.d.ts → client-CQUqt9Ir.d.ts} +13 -4
- package/dist/client.d.ts +8 -8
- package/dist/client.mjs +20 -14
- package/dist/{config-qMLpi5T4.d.ts → config-CNas6wJH.d.ts} +2 -2
- package/dist/{config-BcYZkdMw.d.ts → config-bXxnJrQc.d.ts} +80 -35
- package/dist/direct-executor-RBA5O7EN.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/transport/grpc.mjs +1 -1
- package/dist/distribution.d.ts +8 -8
- package/dist/distribution.mjs +12 -12
- package/dist/embeddings/openai.mjs +1 -1
- package/dist/{engine-zhms1qId.d.ts → engine-Dj4I91Jv.d.ts} +21 -8
- package/dist/index.browser.mjs +169 -72
- package/dist/index.d.ts +7 -7
- package/dist/index.mjs +10 -10
- package/dist/{memory-OmgkX_Z2.d.ts → memory-xrXOZMbw.d.ts} +58 -13
- package/dist/persistence/durability/checkpoint-worker.d.ts +1 -1
- package/dist/persistence/durability/checkpoint-worker.mjs +10 -10
- package/dist/react.d.ts +11 -11
- package/dist/react.mjs +16 -4
- package/dist/{schema-OSWaaZzx.d.ts → schema-mLpXZBEh.d.ts} +13 -6
- package/dist/server.d.ts +13 -10
- package/dist/server.mjs +68 -20
- package/dist/{tasks-DiF1c9v2.d.ts → tasks-Df73Tjgq.d.ts} +9 -5
- package/dist/{thread-TLCX43WV.mjs → thread-5UP6MGED.mjs} +8 -8
- package/dist/{types-LEzMyjVX.d.ts → types-BTIVO8DI.d.ts} +1 -1
- package/dist/vector/search-worker.d.ts +1 -1
- package/dist/vector/search-worker.mjs +3 -3
- package/dist/workers/entry.mjs +23 -10
- package/package.json +7 -7
- package/dist/chunk-WFKIGEBY.mjs +0 -11
- package/dist/direct-executor-UJC36S2D.mjs +0 -12
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { openSharedVectorField, MAX_WORKER_COPIES, createVectorStore, osqBitsOf, createHNSWIndex, createOsqQuantizer, osqRecordBytes } from '../chunk-
|
|
1
|
+
import { openSharedVectorField, MAX_WORKER_COPIES, createVectorStore, osqBitsOf, createHNSWIndex, createOsqQuantizer, osqRecordBytes } from '../chunk-U2AL3SON.mjs';
|
|
2
2
|
import '../chunk-ZJ4CSAB2.mjs';
|
|
3
|
-
import '../chunk-
|
|
3
|
+
import '../chunk-UTOFOJOR.mjs';
|
|
4
4
|
import '../chunk-2GWVQWGA.mjs';
|
|
5
|
-
import '../chunk-
|
|
5
|
+
import '../chunk-FRQVMFY7.mjs';
|
|
6
6
|
|
|
7
7
|
// src/vector/worker-copy.ts
|
|
8
8
|
function restoreQuantizer(snapshot, store) {
|
package/dist/workers/entry.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { startIdleHeapCleanup } from '../chunk-Y3L5MDRV.mjs';
|
|
2
2
|
import { threadSlotOfWorker, isValidWorkerAction } from '../chunk-POWOTUKJ.mjs';
|
|
3
|
-
import { NarsilError,
|
|
3
|
+
import { ErrorCodes, NarsilError, isNarsilError } from '../chunk-FRQVMFY7.mjs';
|
|
4
4
|
|
|
5
5
|
// src/workers/action-handler.ts
|
|
6
|
-
function buildErrorResponse(requestId, code, message) {
|
|
7
|
-
return { type: "error", requestId, code, message };
|
|
6
|
+
function buildErrorResponse(requestId, code, message, details) {
|
|
7
|
+
return details === void 0 || Object.keys(details).length === 0 ? { type: "error", requestId, code, message } : { type: "error", requestId, code, message, details };
|
|
8
8
|
}
|
|
9
9
|
function buildSuccessResponse(requestId, data) {
|
|
10
10
|
return { type: "success", requestId, data };
|
|
@@ -18,7 +18,7 @@ async function importBootstrapModule(moduleUrl) {
|
|
|
18
18
|
await import(moduleUrl);
|
|
19
19
|
}
|
|
20
20
|
async function stopServingRequests() {
|
|
21
|
-
const { closeRequestThread } = await import('../thread-
|
|
21
|
+
const { closeRequestThread } = await import('../thread-5UP6MGED.mjs');
|
|
22
22
|
closeRequestThread();
|
|
23
23
|
}
|
|
24
24
|
function holdsCopies(executor) {
|
|
@@ -49,7 +49,7 @@ function createActionHandler(executor) {
|
|
|
49
49
|
if (!holdsCopies(executor)) {
|
|
50
50
|
throw new NarsilError(ErrorCodes.CONFIG_INVALID, "This executor holds no copies to answer requests from");
|
|
51
51
|
}
|
|
52
|
-
const starting = import('../thread-
|
|
52
|
+
const starting = import('../thread-5UP6MGED.mjs').then(
|
|
53
53
|
({ serveRequests }) => serveRequests(executor, action.settings)
|
|
54
54
|
);
|
|
55
55
|
serving.start = starting.then(
|
|
@@ -70,9 +70,10 @@ function createActionHandler(executor) {
|
|
|
70
70
|
const result = await executor.execute(action);
|
|
71
71
|
post(buildSuccessResponse(action.requestId, result));
|
|
72
72
|
} catch (err) {
|
|
73
|
-
const
|
|
73
|
+
const failure = isNarsilError(err) ? err : null;
|
|
74
|
+
const code = failure?.code ?? ErrorCodes.WORKER_ACTION_FAILED;
|
|
74
75
|
const message = err instanceof Error ? err.message : String(err);
|
|
75
|
-
post(buildErrorResponse(action.requestId, code, message));
|
|
76
|
+
post(buildErrorResponse(action.requestId, code, message, failure?.details));
|
|
76
77
|
}
|
|
77
78
|
return false;
|
|
78
79
|
};
|
|
@@ -101,7 +102,7 @@ async function setup() {
|
|
|
101
102
|
} catch {
|
|
102
103
|
parentPort = null;
|
|
103
104
|
}
|
|
104
|
-
const { createDirectExecutor } = await import('../direct-executor-
|
|
105
|
+
const { createDirectExecutor } = await import('../direct-executor-RBA5O7EN.mjs');
|
|
105
106
|
const handleAction = createActionHandler(createDirectExecutor({ threadSlot }));
|
|
106
107
|
if (parentPort) {
|
|
107
108
|
const port = parentPort;
|
|
@@ -109,7 +110,13 @@ async function setup() {
|
|
|
109
110
|
port.on("message", (raw) => {
|
|
110
111
|
if (!isValidWorkerAction(raw)) {
|
|
111
112
|
const requestId = raw?.requestId ?? "unknown";
|
|
112
|
-
port.postMessage(
|
|
113
|
+
port.postMessage(
|
|
114
|
+
buildErrorResponse(
|
|
115
|
+
requestId,
|
|
116
|
+
ErrorCodes.WORKER_ACTION_FAILED,
|
|
117
|
+
"This worker received a message that is no valid action"
|
|
118
|
+
)
|
|
119
|
+
);
|
|
113
120
|
return;
|
|
114
121
|
}
|
|
115
122
|
handleAction(raw, (msg) => port.postMessage(msg)).then((shouldClose) => {
|
|
@@ -127,7 +134,13 @@ async function setup() {
|
|
|
127
134
|
const raw = event.data;
|
|
128
135
|
if (!isValidWorkerAction(raw)) {
|
|
129
136
|
const requestId = raw?.requestId ?? "unknown";
|
|
130
|
-
webSelf.postMessage(
|
|
137
|
+
webSelf.postMessage(
|
|
138
|
+
buildErrorResponse(
|
|
139
|
+
requestId,
|
|
140
|
+
ErrorCodes.WORKER_ACTION_FAILED,
|
|
141
|
+
"This worker received a message that is no valid action"
|
|
142
|
+
)
|
|
143
|
+
);
|
|
131
144
|
return;
|
|
132
145
|
}
|
|
133
146
|
handleAction(raw, (msg) => webSelf.postMessage(msg)).then((shouldClose) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@delali/narsil",
|
|
3
|
-
"version": "0.2.4-next.
|
|
3
|
+
"version": "0.2.4-next.55",
|
|
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)",
|
|
@@ -223,11 +223,11 @@
|
|
|
223
223
|
}
|
|
224
224
|
},
|
|
225
225
|
"optionalDependencies": {
|
|
226
|
-
"@delali/narsil-native-darwin-arm64": "0.2.4-next.
|
|
227
|
-
"@delali/narsil-native-darwin-x64": "0.2.4-next.
|
|
228
|
-
"@delali/narsil-native-linux-arm64": "0.2.4-next.
|
|
229
|
-
"@delali/narsil-native-linux-x64": "0.2.4-next.
|
|
230
|
-
"@delali/narsil-native-win32-arm64": "0.2.4-next.
|
|
231
|
-
"@delali/narsil-native-win32-x64": "0.2.4-next.
|
|
226
|
+
"@delali/narsil-native-darwin-arm64": "0.2.4-next.55",
|
|
227
|
+
"@delali/narsil-native-darwin-x64": "0.2.4-next.55",
|
|
228
|
+
"@delali/narsil-native-linux-arm64": "0.2.4-next.55",
|
|
229
|
+
"@delali/narsil-native-linux-x64": "0.2.4-next.55",
|
|
230
|
+
"@delali/narsil-native-win32-arm64": "0.2.4-next.55",
|
|
231
|
+
"@delali/narsil-native-win32-x64": "0.2.4-next.55"
|
|
232
232
|
}
|
|
233
233
|
}
|
package/dist/chunk-WFKIGEBY.mjs
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
// src/vector/hnsw/constants.ts
|
|
2
|
-
var MAX_LAYER_CAP = 32;
|
|
3
|
-
var MAX_M = 512;
|
|
4
|
-
var INITIAL_UPPER_SLOTS = 64;
|
|
5
|
-
var INITIAL_LIST_CAPACITY = 64;
|
|
6
|
-
var PLACEMENT_ROOM_REQUESTS = 8;
|
|
7
|
-
var COMPACTION_TOMBSTONE_RATIO = 0.1;
|
|
8
|
-
var COMPACTION_ABSOLUTE_THRESHOLD = 1e3;
|
|
9
|
-
var DEFAULT_EF_SEARCH = 50;
|
|
10
|
-
|
|
11
|
-
export { COMPACTION_ABSOLUTE_THRESHOLD, COMPACTION_TOMBSTONE_RATIO, DEFAULT_EF_SEARCH, INITIAL_LIST_CAPACITY, INITIAL_UPPER_SLOTS, MAX_LAYER_CAP, MAX_M, PLACEMENT_ROOM_REQUESTS };
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export { createDirectExecutor } from './chunk-2FO7KZ6K.mjs';
|
|
2
|
-
import './chunk-AV4IJKD2.mjs';
|
|
3
|
-
import './chunk-WM7IS45M.mjs';
|
|
4
|
-
import './chunk-ZT5BRDFW.mjs';
|
|
5
|
-
import './chunk-TGP5M5R7.mjs';
|
|
6
|
-
import './chunk-T62YOSGS.mjs';
|
|
7
|
-
import './chunk-ZJ4CSAB2.mjs';
|
|
8
|
-
import './chunk-WFKIGEBY.mjs';
|
|
9
|
-
import './chunk-IFBKLBGB.mjs';
|
|
10
|
-
import './chunk-U2BKYEC7.mjs';
|
|
11
|
-
import './chunk-2GWVQWGA.mjs';
|
|
12
|
-
import './chunk-P4ELXVJQ.mjs';
|