@delali/narsil 0.3.1-next.72 → 0.3.1-next.73
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 +2 -2
- package/dist/adapters/filesystem.mjs +1 -1
- package/dist/adapters/indexeddb.mjs +1 -1
- package/dist/{capabilities-D6gjjQyA.d.ts → capabilities-CYeAWYxQ.d.ts} +19 -4
- package/dist/{chunk-Y52WZWAU.mjs → chunk-2WLD2NFW.mjs} +4 -4
- package/dist/{chunk-QR4OKRVY.mjs → chunk-3YKWSO54.mjs} +8 -3
- package/dist/{chunk-KZTI25D3.mjs → chunk-4MQ5F4IL.mjs} +1 -1
- package/dist/{chunk-CVPA5Q7R.mjs → chunk-AFKH4ZK3.mjs} +9 -6
- package/dist/{chunk-M6XF5HDE.mjs → chunk-AK3BLGCI.mjs} +141 -11
- package/dist/{chunk-7QMTA7AA.mjs → chunk-CVFAFZSN.mjs} +7771 -4271
- package/dist/{chunk-RV77FR2F.mjs → chunk-I64LXKO3.mjs} +0 -1
- package/dist/{chunk-EDMCZLSJ.mjs → chunk-LPBWCHBE.mjs} +193 -13
- package/dist/{chunk-P2ZZN32C.mjs → chunk-PU43WDY4.mjs} +4 -2
- package/dist/{chunk-HVJYTKK7.mjs → chunk-THMSFOJO.mjs} +365 -774
- package/dist/{chunk-LCCL6EEH.mjs → chunk-WVDFG45M.mjs} +92 -94
- package/dist/{chunk-3HQPUCCT.mjs → chunk-XW25X6AU.mjs} +66 -237
- package/dist/{chunk-2X2ZQOAB.mjs → chunk-ZULSEZCE.mjs} +3 -4
- package/dist/{client-C2TiW29y.d.ts → client-D698E5ge.d.ts} +76 -25
- package/dist/client.d.ts +7 -7
- package/dist/client.mjs +44 -22
- package/dist/{config-BLguB-om.d.ts → config-Bv8etwUZ.d.ts} +10 -3
- package/dist/{config-C7Ip8Ife.d.ts → config-QXU3HMpq.d.ts} +10 -1
- package/dist/direct-executor-5SRDFZAS.mjs +13 -0
- package/dist/distribution/coordinator/etcd.d.ts +27 -14
- package/dist/distribution/coordinator/etcd.mjs +162 -75
- package/dist/distribution/transport/grpc.d.ts +2 -2
- package/dist/distribution/transport/grpc.mjs +22 -2
- package/dist/distribution/transport/in-memory.d.ts +2 -2
- package/dist/distribution/transport/in-memory.mjs +6 -3
- package/dist/distribution/transport/tcp.d.ts +2 -2
- package/dist/distribution/transport/tcp.mjs +40 -16
- package/dist/distribution.d.ts +6 -6
- package/dist/distribution.mjs +637 -366
- package/dist/embeddings/openai.mjs +1 -1
- package/dist/{engine-Dm4446j1.d.ts → engine-D_OzKZ-6.d.ts} +96 -187
- package/dist/index.browser.mjs +7179 -4031
- package/dist/index.d.ts +5 -5
- package/dist/index.mjs +11 -14
- package/dist/{memory-CKHTU1CL.d.ts → memory-B4jMmygw.d.ts} +213 -2
- package/dist/pattern.mjs +1 -1
- package/dist/persistence/durability/checkpoint-worker.d.ts +24 -16
- package/dist/persistence/durability/checkpoint-worker.mjs +22 -16
- package/dist/react.d.ts +6 -6
- package/dist/react.mjs +0 -1
- package/dist/server.d.ts +9 -9
- package/dist/server.mjs +210 -32
- package/dist/{tasks-BECd0b__.d.ts → tasks-DpgCpW1x.d.ts} +3 -3
- package/dist/{thread-IBSIZZ6W.mjs → thread-3LNVA43V.mjs} +79 -21
- package/dist/{types-BQDlIvfS.d.ts → types-B3b68nfF.d.ts} +1 -1
- package/dist/{types-D5OwhtsQ.d.ts → types-Cb9kiY5P.d.ts} +1 -1
- package/dist/vector/search-worker.mjs +3 -3
- package/dist/workers/entry.mjs +4 -4
- package/package.json +7 -7
- package/dist/chunk-3L4U6EJQ.mjs +0 -49
- package/dist/chunk-IFBKLBGB.mjs +0 -7
- package/dist/chunk-XZ4PAREY.mjs +0 -25
- package/dist/direct-executor-SVCHXR74.mjs +0 -14
- package/dist/serialization/crc32-worker.d.ts +0 -20
- package/dist/serialization/crc32-worker.mjs +0 -62
|
@@ -72,7 +72,6 @@ var ErrorCodes = {
|
|
|
72
72
|
SNAPSHOT_SYNC_UNAUTHORIZED: "SNAPSHOT_SYNC_UNAUTHORIZED",
|
|
73
73
|
SNAPSHOT_SYNC_REQUEST_INVALID: "SNAPSHOT_SYNC_REQUEST_INVALID",
|
|
74
74
|
SNAPSHOT_SYNC_INDEX_NOT_FOUND: "SNAPSHOT_SYNC_INDEX_NOT_FOUND",
|
|
75
|
-
SNAPSHOT_SYNC_TOO_LARGE: "SNAPSHOT_SYNC_TOO_LARGE",
|
|
76
75
|
SNAPSHOT_SYNC_CAPACITY_EXHAUSTED: "SNAPSHOT_SYNC_CAPACITY_EXHAUSTED",
|
|
77
76
|
SNAPSHOT_SYNC_SNAPSHOT_FAILED: "SNAPSHOT_SYNC_SNAPSHOT_FAILED",
|
|
78
77
|
SNAPSHOT_SYNC_DECODE_FAILED: "SNAPSHOT_SYNC_DECODE_FAILED",
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import { MAX_SORT_FIELDS } from './chunk-
|
|
2
|
-
import { nativeSearchCoreIsEnabled, loadNativeCore } from './chunk-
|
|
3
|
-
import { NarsilError, ServerErrorCodes, ErrorCodes } from './chunk-
|
|
1
|
+
import { MAX_SORT_FIELDS } from './chunk-AK3BLGCI.mjs';
|
|
2
|
+
import { nativeSearchCoreIsEnabled, loadNativeCore } from './chunk-PU43WDY4.mjs';
|
|
3
|
+
import { NarsilError, ServerErrorCodes, ErrorCodes } from './chunk-I64LXKO3.mjs';
|
|
4
|
+
import { mkdtemp, open, rm } from 'fs/promises';
|
|
5
|
+
import { tmpdir } from 'os';
|
|
6
|
+
import path from 'path';
|
|
4
7
|
|
|
5
8
|
// src/server/capabilities.ts
|
|
6
9
|
var ASYNC_IMPORT_CAPABILITY = "documents.import.async";
|
|
@@ -8,12 +11,14 @@ var TASK_CANCEL_CAPABILITY = "tasks.cancel";
|
|
|
8
11
|
var TASK_FILTER_CAPABILITY = "tasks.filter";
|
|
9
12
|
var REBUILD_ANALYSIS_CAPABILITY = "indexes.rebuildAnalysis";
|
|
10
13
|
var INDEX_LIFECYCLE_CAPABILITY = "indexes.lifecycle";
|
|
14
|
+
var DOCUMENT_EXPORT_CAPABILITY = "indexes.documentExport";
|
|
11
15
|
var SERVER_CAPABILITIES = [
|
|
12
16
|
ASYNC_IMPORT_CAPABILITY,
|
|
13
17
|
TASK_CANCEL_CAPABILITY,
|
|
14
18
|
TASK_FILTER_CAPABILITY,
|
|
15
19
|
REBUILD_ANALYSIS_CAPABILITY,
|
|
16
|
-
INDEX_LIFECYCLE_CAPABILITY
|
|
20
|
+
INDEX_LIFECYCLE_CAPABILITY,
|
|
21
|
+
DOCUMENT_EXPORT_CAPABILITY
|
|
17
22
|
];
|
|
18
23
|
|
|
19
24
|
// src/server/concurrency-gate.ts
|
|
@@ -171,7 +176,6 @@ var STATUS_BY_CODE = {
|
|
|
171
176
|
SNAPSHOT_SYNC_HEADER_INVALID: 400,
|
|
172
177
|
SNAPSHOT_SYNC_FRAME_INVALID: 400,
|
|
173
178
|
SNAPSHOT_SYNC_INDEX_NOT_FOUND: 404,
|
|
174
|
-
SNAPSHOT_SYNC_TOO_LARGE: 413,
|
|
175
179
|
SNAPSHOT_SYNC_CHUNK_SIZE_EXCEEDED: 413,
|
|
176
180
|
SNAPSHOT_SYNC_ABORTED: 409,
|
|
177
181
|
SNAPSHOT_SYNC_CAPACITY_EXHAUSTED: 503,
|
|
@@ -226,6 +230,11 @@ function encodeJson(value) {
|
|
|
226
230
|
var BYTES_PER_MB = 1024 * 1024;
|
|
227
231
|
var DEFAULT_MAX_BODY_BYTES = 16 * BYTES_PER_MB;
|
|
228
232
|
var DEFAULT_MAX_IMPORT_BYTES = 100 * BYTES_PER_MB;
|
|
233
|
+
var DEFAULT_MAX_RESTORE_BYTES = 64 * 1024 * BYTES_PER_MB;
|
|
234
|
+
var SPOOL_PAUSE_ABOVE_BYTES = 8 * BYTES_PER_MB;
|
|
235
|
+
var SNAPSHOT_ARCHIVE_CONTENT_TYPE = "application/x-tar";
|
|
236
|
+
var DOCUMENT_EXPORT_CONTENT_TYPE = "application/x-ndjson";
|
|
237
|
+
var RELAY_STREAM_CHUNKS_IN_FLIGHT = 4;
|
|
229
238
|
var DEFAULT_MAX_LINE_BYTES = 4 * BYTES_PER_MB;
|
|
230
239
|
var DEFAULT_IMPORT_BATCH_SIZE = 1e3;
|
|
231
240
|
var IMPORT_FLUSHES_IN_FLIGHT = 4;
|
|
@@ -300,8 +309,56 @@ function sendError(res, status, code, message, details) {
|
|
|
300
309
|
res.writeStatus(statusLine(status)).writeHeader("Content-Type", "application/json").end(payload);
|
|
301
310
|
});
|
|
302
311
|
}
|
|
303
|
-
function
|
|
304
|
-
|
|
312
|
+
async function sendStream(res, abort, source, headers) {
|
|
313
|
+
const reader = source.getReader();
|
|
314
|
+
let wake = null;
|
|
315
|
+
abort.onAbort(() => wake?.());
|
|
316
|
+
const waitUntilWritable = () => new Promise((resolve) => {
|
|
317
|
+
wake = () => {
|
|
318
|
+
wake = null;
|
|
319
|
+
resolve();
|
|
320
|
+
};
|
|
321
|
+
res.onWritable(() => {
|
|
322
|
+
wake?.();
|
|
323
|
+
return true;
|
|
324
|
+
});
|
|
325
|
+
});
|
|
326
|
+
let started = false;
|
|
327
|
+
const begin = () => {
|
|
328
|
+
if (started) return;
|
|
329
|
+
started = true;
|
|
330
|
+
res.writeStatus(statusLine(200));
|
|
331
|
+
for (const [key, value] of headers) res.writeHeader(key, value);
|
|
332
|
+
};
|
|
333
|
+
try {
|
|
334
|
+
for (; ; ) {
|
|
335
|
+
const step = await reader.read();
|
|
336
|
+
if (abort.aborted) {
|
|
337
|
+
await reader.cancel().catch(() => void 0);
|
|
338
|
+
return;
|
|
339
|
+
}
|
|
340
|
+
if (step.done) {
|
|
341
|
+
res.cork(() => {
|
|
342
|
+
begin();
|
|
343
|
+
res.end();
|
|
344
|
+
});
|
|
345
|
+
return;
|
|
346
|
+
}
|
|
347
|
+
let writable = true;
|
|
348
|
+
res.cork(() => {
|
|
349
|
+
begin();
|
|
350
|
+
writable = res.write(step.value);
|
|
351
|
+
});
|
|
352
|
+
if (!writable && !abort.aborted) await waitUntilWritable();
|
|
353
|
+
}
|
|
354
|
+
} catch (err) {
|
|
355
|
+
await reader.cancel().catch(() => void 0);
|
|
356
|
+
if (abort.aborted) return;
|
|
357
|
+
if (!started) throw err;
|
|
358
|
+
res.cork(() => {
|
|
359
|
+
res.close();
|
|
360
|
+
});
|
|
361
|
+
}
|
|
305
362
|
}
|
|
306
363
|
function sendRelayed(res, abort, status, headers, body) {
|
|
307
364
|
if (abort.aborted) return;
|
|
@@ -496,7 +553,14 @@ function validateRebalance(body) {
|
|
|
496
553
|
}
|
|
497
554
|
return null;
|
|
498
555
|
}
|
|
499
|
-
var TASK_TYPES = [
|
|
556
|
+
var TASK_TYPES = [
|
|
557
|
+
"optimizeVectors",
|
|
558
|
+
"rebalance",
|
|
559
|
+
"restore",
|
|
560
|
+
"import",
|
|
561
|
+
"importExport",
|
|
562
|
+
"rebuildAnalysis"
|
|
563
|
+
];
|
|
500
564
|
var TASK_STATUSES = ["running", "succeeded", "failed", "cancelled"];
|
|
501
565
|
function parseCountParam(raw, field, minimum) {
|
|
502
566
|
if (raw === null) return minimum;
|
|
@@ -631,6 +695,87 @@ function createVersionHandler(deps) {
|
|
|
631
695
|
}
|
|
632
696
|
return { report };
|
|
633
697
|
}
|
|
698
|
+
var NotAdmittedError = class extends Error {
|
|
699
|
+
};
|
|
700
|
+
async function removeDirectory(directory) {
|
|
701
|
+
if (directory !== null) await rm(directory, { recursive: true, force: true });
|
|
702
|
+
}
|
|
703
|
+
function spoolBody(res, maxBytes, abort, admitted) {
|
|
704
|
+
return new Promise((resolve, reject) => {
|
|
705
|
+
const state = {
|
|
706
|
+
directory: null,
|
|
707
|
+
handle: null,
|
|
708
|
+
chain: Promise.resolve(),
|
|
709
|
+
queued: 0,
|
|
710
|
+
total: 0,
|
|
711
|
+
paused: true,
|
|
712
|
+
done: false
|
|
713
|
+
};
|
|
714
|
+
const fail = (error, answer) => {
|
|
715
|
+
if (state.done) return;
|
|
716
|
+
state.done = true;
|
|
717
|
+
if (answer && !abort.aborted) {
|
|
718
|
+
sendError(res, 500, ServerErrorCodes.INTERNAL_ERROR, "The server could not store the request body");
|
|
719
|
+
}
|
|
720
|
+
void state.chain.catch(() => void 0).then(async () => {
|
|
721
|
+
await state.handle?.close().catch(() => void 0);
|
|
722
|
+
await removeDirectory(state.directory).catch(() => void 0);
|
|
723
|
+
}).finally(() => reject(error));
|
|
724
|
+
};
|
|
725
|
+
const failFromChain = (error) => {
|
|
726
|
+
if (error instanceof NotAdmittedError) fail(error, false);
|
|
727
|
+
else fail(error instanceof Error ? error : new Error(String(error)), true);
|
|
728
|
+
};
|
|
729
|
+
res.pause();
|
|
730
|
+
state.chain = (async () => {
|
|
731
|
+
if (!await admitted) throw new NotAdmittedError("the request was not admitted");
|
|
732
|
+
state.directory = await mkdtemp(path.join(tmpdir(), "narsil-spool-"));
|
|
733
|
+
state.handle = await open(path.join(state.directory, "body"), "w");
|
|
734
|
+
if (!abort.aborted && !state.done && state.queued <= SPOOL_PAUSE_ABOVE_BYTES) {
|
|
735
|
+
state.paused = false;
|
|
736
|
+
res.resume();
|
|
737
|
+
}
|
|
738
|
+
})();
|
|
739
|
+
state.chain.catch(failFromChain);
|
|
740
|
+
abort.onAbort(() => fail(new Error("aborted"), false));
|
|
741
|
+
res.onData((chunk, isLast) => {
|
|
742
|
+
if (state.done || abort.aborted) return;
|
|
743
|
+
state.total += chunk.byteLength;
|
|
744
|
+
if (maxBytes > 0 && state.total > maxBytes) {
|
|
745
|
+
sendError(res, 413, ServerErrorCodes.PAYLOAD_TOO_LARGE, "Request body exceeds the configured size limit");
|
|
746
|
+
fail(new Error("payload too large"), false);
|
|
747
|
+
return;
|
|
748
|
+
}
|
|
749
|
+
const copy = new Uint8Array(chunk.slice(0));
|
|
750
|
+
state.queued += copy.byteLength;
|
|
751
|
+
if (!state.paused && state.queued > SPOOL_PAUSE_ABOVE_BYTES) {
|
|
752
|
+
state.paused = true;
|
|
753
|
+
res.pause();
|
|
754
|
+
}
|
|
755
|
+
state.chain = state.chain.then(async () => {
|
|
756
|
+
if (state.handle === null) throw new Error("the spool file is not open");
|
|
757
|
+
await state.handle.write(copy);
|
|
758
|
+
state.queued -= copy.byteLength;
|
|
759
|
+
if (state.paused && state.queued <= SPOOL_PAUSE_ABOVE_BYTES && !abort.aborted && !state.done) {
|
|
760
|
+
state.paused = false;
|
|
761
|
+
res.resume();
|
|
762
|
+
}
|
|
763
|
+
});
|
|
764
|
+
state.chain.catch(failFromChain);
|
|
765
|
+
if (!isLast) return;
|
|
766
|
+
state.chain.then(async () => {
|
|
767
|
+
if (state.done) return;
|
|
768
|
+
state.done = true;
|
|
769
|
+
await state.handle?.close();
|
|
770
|
+
resolve({
|
|
771
|
+
path: path.join(state.directory ?? "", "body"),
|
|
772
|
+
bytes: state.total,
|
|
773
|
+
remove: () => removeDirectory(state.directory)
|
|
774
|
+
});
|
|
775
|
+
}, failFromChain);
|
|
776
|
+
});
|
|
777
|
+
});
|
|
778
|
+
}
|
|
634
779
|
|
|
635
780
|
// src/server/request.ts
|
|
636
781
|
function initAbortHandler(res) {
|
|
@@ -732,6 +877,19 @@ function sinkWritingAfterStatus(res, headers) {
|
|
|
732
877
|
res.end(body);
|
|
733
878
|
return sink;
|
|
734
879
|
},
|
|
880
|
+
write(chunk) {
|
|
881
|
+
return res.write(chunk);
|
|
882
|
+
},
|
|
883
|
+
pause() {
|
|
884
|
+
res.pause();
|
|
885
|
+
},
|
|
886
|
+
resume() {
|
|
887
|
+
res.resume();
|
|
888
|
+
},
|
|
889
|
+
close() {
|
|
890
|
+
res.close();
|
|
891
|
+
return sink;
|
|
892
|
+
},
|
|
735
893
|
endWithoutBody() {
|
|
736
894
|
res.endWithoutBody();
|
|
737
895
|
return sink;
|
|
@@ -830,18 +988,33 @@ function createRouteRunner(deps) {
|
|
|
830
988
|
}
|
|
831
989
|
const bodyPromise = needsBody ? readBody(res, opts.maxBytes, abort, declaredBytes) : Promise.resolve(null);
|
|
832
990
|
const hookPromise = hookContext !== null && authorize !== void 0 ? authorize(hookContext) : Promise.resolve({ allowed: true });
|
|
833
|
-
|
|
834
|
-
|
|
991
|
+
const spoolPromise = opts.spoolsBody === true ? spoolBody(
|
|
992
|
+
res,
|
|
993
|
+
opts.maxBytes,
|
|
994
|
+
abort,
|
|
995
|
+
hookPromise.then((authorization) => authorization.allowed)
|
|
996
|
+
).catch(() => null) : Promise.resolve(null);
|
|
997
|
+
Promise.all([bodyPromise, spoolPromise, hookPromise]).then(async ([rawBody, spooledBody, authorization]) => {
|
|
998
|
+
const discardSpool = () => {
|
|
999
|
+
void spooledBody?.remove().catch(() => void 0);
|
|
1000
|
+
};
|
|
1001
|
+
if (abort.aborted) {
|
|
1002
|
+
discardSpool();
|
|
1003
|
+
return;
|
|
1004
|
+
}
|
|
835
1005
|
if (!authorization.allowed) {
|
|
1006
|
+
discardSpool();
|
|
836
1007
|
sendDenial(res, authorization);
|
|
837
1008
|
return;
|
|
838
1009
|
}
|
|
1010
|
+
if (opts.spoolsBody === true && spooledBody === null) return;
|
|
839
1011
|
if (gated && !gate.tryAcquire()) {
|
|
1012
|
+
discardSpool();
|
|
840
1013
|
sendError(res, 429, ServerErrorCodes.TOO_MANY_REQUESTS, "The server is at capacity; retry shortly");
|
|
841
1014
|
return;
|
|
842
1015
|
}
|
|
843
1016
|
try {
|
|
844
|
-
await handler({ res, params, query, contentType, rawBody, abort, hookContext });
|
|
1017
|
+
await handler({ res, params, query, contentType, rawBody, spooledBody, abort, hookContext });
|
|
845
1018
|
} catch (err) {
|
|
846
1019
|
if (!abort.aborted) {
|
|
847
1020
|
sendError(res, 500, ServerErrorCodes.INTERNAL_ERROR, "An unexpected error occurred");
|
|
@@ -916,7 +1089,14 @@ function serverRoutes(limits) {
|
|
|
916
1089
|
method: "post",
|
|
917
1090
|
path: "/indexes/:name/restore",
|
|
918
1091
|
handler: "restore",
|
|
919
|
-
options: { paramCount: 1,
|
|
1092
|
+
options: { paramCount: 1, spoolsBody: true, maxBytes: limits.maxRestoreBytes }
|
|
1093
|
+
},
|
|
1094
|
+
{ method: "get", path: "/indexes/:name/export", handler: "exportDocuments", options: named },
|
|
1095
|
+
{
|
|
1096
|
+
method: "post",
|
|
1097
|
+
path: "/indexes/:name/import",
|
|
1098
|
+
handler: "importExport",
|
|
1099
|
+
options: { paramCount: 1, spoolsBody: true, maxBytes: limits.maxRestoreBytes }
|
|
920
1100
|
}
|
|
921
1101
|
];
|
|
922
1102
|
}
|
|
@@ -975,4 +1155,4 @@ function childAppOf(app) {
|
|
|
975
1155
|
return candidate;
|
|
976
1156
|
}
|
|
977
1157
|
|
|
978
|
-
export { ASYNC_IMPORT_CAPABILITY, DEFAULT_IMPORT_BATCH_SIZE, DEFAULT_MAX_BODY_BYTES, DEFAULT_MAX_CONCURRENT_REQUESTS, DEFAULT_MAX_CONCURRENT_TASKS, DEFAULT_MAX_FETCH_DOCUMENTS, DEFAULT_MAX_IMPORT_BYTES, DEFAULT_MAX_IMPORT_ERRORS, DEFAULT_MAX_LINE_BYTES, DEFAULT_MAX_RESULT_WINDOW, DEFAULT_MAX_RETAINED_TASKS, DEFAULT_MAX_TASK_PAGE_SIZE, DEFAULT_TASK_PAGE_SIZE, IMPORT_FLUSHES_IN_FLIGHT, INDEX_LIFECYCLE_CAPABILITY, INDEX_TOUCH_INTERVALS_PER_IDLE_TIMEOUT, MAIN_THREAD_GATE_SLOT, MAX_INDEX_TOUCH_INTERVAL_MS, MIN_COUNTED_SERVER_LIMIT, MIN_UNBOUNDED_SERVER_LIMIT, REBUILD_ANALYSIS_CAPABILITY, RUNNING_TASK_TTL_MS, SERVER_CAPABILITIES, TASK_CANCEL_CAPABILITY, TASK_FILTER_CAPABILITY, TASK_PROGRESS_WRITE_INTERVAL_MS, TERMINAL_TASK_TTL_MS, acceptorOf, authorizerFor, badRequest, childAppOf, clearGateSlot, corsHeaderReader, createDocumentReadHandlers, createRouteRunner, createSharedGateBuffer, createSharedRequestGate, createVersionHandler, gateSlotOfWorker, httpStatusForNarsilError, loadUWebSockets, parseJson, parseJsonOptional, parseTaskListQuery, registerServerRoutes, rejectInvalid, resolveCors, respondError, respondJson,
|
|
1158
|
+
export { ASYNC_IMPORT_CAPABILITY, DEFAULT_IMPORT_BATCH_SIZE, DEFAULT_MAX_BODY_BYTES, DEFAULT_MAX_CONCURRENT_REQUESTS, DEFAULT_MAX_CONCURRENT_TASKS, DEFAULT_MAX_FETCH_DOCUMENTS, DEFAULT_MAX_IMPORT_BYTES, DEFAULT_MAX_IMPORT_ERRORS, DEFAULT_MAX_LINE_BYTES, DEFAULT_MAX_RESTORE_BYTES, DEFAULT_MAX_RESULT_WINDOW, DEFAULT_MAX_RETAINED_TASKS, DEFAULT_MAX_TASK_PAGE_SIZE, DEFAULT_TASK_PAGE_SIZE, DOCUMENT_EXPORT_CAPABILITY, DOCUMENT_EXPORT_CONTENT_TYPE, IMPORT_FLUSHES_IN_FLIGHT, INDEX_LIFECYCLE_CAPABILITY, INDEX_TOUCH_INTERVALS_PER_IDLE_TIMEOUT, MAIN_THREAD_GATE_SLOT, MAX_INDEX_TOUCH_INTERVAL_MS, MIN_COUNTED_SERVER_LIMIT, MIN_UNBOUNDED_SERVER_LIMIT, REBUILD_ANALYSIS_CAPABILITY, RELAY_STREAM_CHUNKS_IN_FLIGHT, RUNNING_TASK_TTL_MS, SERVER_CAPABILITIES, SNAPSHOT_ARCHIVE_CONTENT_TYPE, TASK_CANCEL_CAPABILITY, TASK_FILTER_CAPABILITY, TASK_PROGRESS_WRITE_INTERVAL_MS, TERMINAL_TASK_TTL_MS, acceptorOf, authorizerFor, badRequest, childAppOf, clearGateSlot, corsHeaderReader, createDocumentReadHandlers, createRouteRunner, createSharedGateBuffer, createSharedRequestGate, createVersionHandler, gateSlotOfWorker, httpStatusForNarsilError, loadUWebSockets, parseJson, parseJsonOptional, parseTaskListQuery, registerServerRoutes, rejectInvalid, resolveCors, respondError, respondJson, sendError, sendRelayed, sendStream, serializeBatchResult, serializeNarsilError, serverRoutes, statusLine, toHttpError, validateBatch, validateCreateIndex, validateDocumentBody, validateQuery, validateRebalance, validateSuggest, versionReport };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { NarsilError, ErrorCodes } from './chunk-
|
|
1
|
+
import { NarsilError, ErrorCodes } from './chunk-I64LXKO3.mjs';
|
|
2
2
|
import { existsSync } from 'fs';
|
|
3
3
|
import { createRequire } from 'module';
|
|
4
4
|
import { join, dirname } from 'path';
|
|
@@ -6,6 +6,8 @@ import { join, dirname } from 'path';
|
|
|
6
6
|
// src/vector/hnsw/constants.ts
|
|
7
7
|
var MAX_LAYER_CAP = 32;
|
|
8
8
|
var MAX_M = 512;
|
|
9
|
+
var MIN_M = 2;
|
|
10
|
+
var EARLIER_RELEASE_MIN_M = 1;
|
|
9
11
|
var INITIAL_UPPER_SLOTS = 64;
|
|
10
12
|
var INITIAL_LIST_CAPACITY = 64;
|
|
11
13
|
var PLACEMENT_ROOM_REQUESTS = 8;
|
|
@@ -136,4 +138,4 @@ function loadNativeCore() {
|
|
|
136
138
|
return loaded;
|
|
137
139
|
}
|
|
138
140
|
|
|
139
|
-
export { COMPACTION_ABSOLUTE_THRESHOLD, COMPACTION_TOMBSTONE_RATIO, DEFAULT_EF_SEARCH, INITIAL_LIST_CAPACITY, INITIAL_UPPER_SLOTS, MAX_LAYER_CAP, MAX_M, PLACEMENT_ROOM_REQUESTS, loadNativeCore, nativeSearchCoreIsEnabled, noteFallback, requireSearchBackendSettings, stopUsingTheNativeSearchCore };
|
|
141
|
+
export { COMPACTION_ABSOLUTE_THRESHOLD, COMPACTION_TOMBSTONE_RATIO, DEFAULT_EF_SEARCH, EARLIER_RELEASE_MIN_M, INITIAL_LIST_CAPACITY, INITIAL_UPPER_SLOTS, MAX_LAYER_CAP, MAX_M, MIN_M, PLACEMENT_ROOM_REQUESTS, loadNativeCore, nativeSearchCoreIsEnabled, noteFallback, requireSearchBackendSettings, stopUsingTheNativeSearchCore };
|