@delali/narsil 0.3.1-next.72 → 0.3.1-next.74
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-CAMzmkAg.d.ts} +19 -4
- package/dist/{chunk-P2ZZN32C.mjs → chunk-2E35UM3G.mjs} +2 -12
- package/dist/chunk-3DDUNI6N.mjs +48 -0
- package/dist/{chunk-KZTI25D3.mjs → chunk-4MQ5F4IL.mjs} +1 -1
- package/dist/{chunk-HVJYTKK7.mjs → chunk-BVBIQQKG.mjs} +947 -1327
- package/dist/{chunk-2X2ZQOAB.mjs → chunk-CTOSGRM7.mjs} +101 -21
- package/dist/{chunk-7QMTA7AA.mjs → chunk-CUZOX6CN.mjs} +7784 -4276
- package/dist/chunk-I23G3IZC.mjs +593 -0
- package/dist/{chunk-RV77FR2F.mjs → chunk-I64LXKO3.mjs} +0 -1
- package/dist/chunk-KEHK2O6P.mjs +13 -0
- package/dist/{chunk-CVPA5Q7R.mjs → chunk-LX4JERXI.mjs} +9 -6
- package/dist/{chunk-EDMCZLSJ.mjs → chunk-NOZUQM7J.mjs} +193 -13
- package/dist/{chunk-LCCL6EEH.mjs → chunk-PO53FV4Q.mjs} +93 -94
- package/dist/chunk-T5ZWEWVD.mjs +658 -0
- package/dist/{chunk-Y52WZWAU.mjs → chunk-TVFLHM7M.mjs} +4 -4
- package/dist/{chunk-QR4OKRVY.mjs → chunk-VKX2BPXD.mjs} +147 -642
- package/dist/{chunk-3HQPUCCT.mjs → chunk-XW25X6AU.mjs} +66 -237
- package/dist/{chunk-M6XF5HDE.mjs → chunk-Z3DQPOJQ.mjs} +127 -30
- package/dist/{client-C2TiW29y.d.ts → client-C-I70ArH.d.ts} +77 -26
- package/dist/client.d.ts +9 -9
- package/dist/client.mjs +44 -22
- package/dist/{config-BLguB-om.d.ts → config-C6Iw5rCX.d.ts} +11 -4
- package/dist/{config-C7Ip8Ife.d.ts → config-DJPH3IQB.d.ts} +11 -2
- package/dist/direct-executor-KFAGILJC.mjs +17 -0
- package/dist/distribution/coordinator/etcd.d.ts +29 -16
- package/dist/distribution/coordinator/etcd.mjs +162 -75
- package/dist/distribution/coordinator/in-memory.d.ts +2 -2
- 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 +9 -9
- package/dist/distribution.mjs +647 -366
- package/dist/embeddings/openai.mjs +1 -1
- package/dist/{engine-Dm4446j1.d.ts → engine-B8eRPO7m.d.ts} +97 -188
- package/dist/index.browser.mjs +12132 -8592
- package/dist/index.d.ts +27 -8
- package/dist/index.mjs +15 -14
- package/dist/{memory-CKHTU1CL.d.ts → memory-DJEwWoCi.d.ts} +1204 -968
- package/dist/partial-words-DTIHO8G4.d.ts +19 -0
- package/dist/partial-words.d.ts +22 -0
- package/dist/partial-words.mjs +11 -0
- package/dist/pattern.mjs +1 -1
- package/dist/persistence/durability/checkpoint-worker.d.ts +57 -29
- package/dist/persistence/durability/checkpoint-worker.mjs +26 -16
- package/dist/react.d.ts +7 -7
- package/dist/react.mjs +0 -1
- package/dist/{schema-BBOCdhND.d.ts → schema-DgyDijhf.d.ts} +6 -2
- package/dist/server.d.ts +11 -11
- package/dist/server.mjs +212 -32
- package/dist/{tasks-BECd0b__.d.ts → tasks-BVmAKYBh.d.ts} +3 -3
- package/dist/{thread-IBSIZZ6W.mjs → thread-W6DPKEF6.mjs} +82 -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/{types-BiUmaiWT.d.ts → types-ChrVy4lH.d.ts} +1 -1
- package/dist/vector/search-worker.d.ts +1 -1
- package/dist/vector/search-worker.mjs +4 -3
- package/dist/workers/entry.mjs +4 -4
- package/package.json +15 -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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@delali/narsil",
|
|
3
|
-
"version": "0.3.1-next.
|
|
3
|
+
"version": "0.3.1-next.74",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Distributed search engine with full-text, vector, hybrid, and geosearch. One engine, embedded or on a server, with a cross-language .nrsl format.",
|
|
6
6
|
"author": "Delali (https://sondelali.com)",
|
|
@@ -54,6 +54,10 @@
|
|
|
54
54
|
"#platform/pattern-search": {
|
|
55
55
|
"browser": "./src/core/pattern-index/platform.browser.ts",
|
|
56
56
|
"default": "./src/core/pattern-index/platform.ts"
|
|
57
|
+
},
|
|
58
|
+
"#platform/partial-word-search": {
|
|
59
|
+
"browser": "./src/core/partition/partial-words/platform.browser.ts",
|
|
60
|
+
"default": "./src/core/partition/partial-words/platform.ts"
|
|
57
61
|
}
|
|
58
62
|
},
|
|
59
63
|
"sideEffects": false,
|
|
@@ -139,6 +143,10 @@
|
|
|
139
143
|
"import": "./dist/pattern.mjs",
|
|
140
144
|
"types": "./dist/pattern.d.ts"
|
|
141
145
|
},
|
|
146
|
+
"./partial-words": {
|
|
147
|
+
"import": "./dist/partial-words.mjs",
|
|
148
|
+
"types": "./dist/partial-words.d.ts"
|
|
149
|
+
},
|
|
142
150
|
"./languages/*": {
|
|
143
151
|
"import": "./dist/languages/*.mjs",
|
|
144
152
|
"types": "./dist/languages/*.d.ts"
|
|
@@ -231,11 +239,11 @@
|
|
|
231
239
|
}
|
|
232
240
|
},
|
|
233
241
|
"optionalDependencies": {
|
|
234
|
-
"@delali/narsil-native-darwin-arm64": "0.3.1-next.
|
|
235
|
-
"@delali/narsil-native-darwin-x64": "0.3.1-next.
|
|
236
|
-
"@delali/narsil-native-linux-arm64": "0.3.1-next.
|
|
237
|
-
"@delali/narsil-native-linux-x64": "0.3.1-next.
|
|
238
|
-
"@delali/narsil-native-win32-arm64": "0.3.1-next.
|
|
239
|
-
"@delali/narsil-native-win32-x64": "0.3.1-next.
|
|
242
|
+
"@delali/narsil-native-darwin-arm64": "0.3.1-next.74",
|
|
243
|
+
"@delali/narsil-native-darwin-x64": "0.3.1-next.74",
|
|
244
|
+
"@delali/narsil-native-linux-arm64": "0.3.1-next.74",
|
|
245
|
+
"@delali/narsil-native-linux-x64": "0.3.1-next.74",
|
|
246
|
+
"@delali/narsil-native-win32-arm64": "0.3.1-next.74",
|
|
247
|
+
"@delali/narsil-native-win32-x64": "0.3.1-next.74"
|
|
240
248
|
}
|
|
241
249
|
}
|
package/dist/chunk-3L4U6EJQ.mjs
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { NATIVE_CRC32_MIN_BYTES } from './chunk-IFBKLBGB.mjs';
|
|
2
|
-
import * as zlib from 'zlib';
|
|
3
|
-
|
|
4
|
-
var candidate = zlib.crc32;
|
|
5
|
-
var nativeCrc32 = typeof candidate === "function" ? candidate : null;
|
|
6
|
-
|
|
7
|
-
// src/serialization/crc32.ts
|
|
8
|
-
var IEEE_POLYNOMIAL = 3988292384;
|
|
9
|
-
var ALL_BITS = 4294967295;
|
|
10
|
-
var cachedTable = null;
|
|
11
|
-
function buildTable() {
|
|
12
|
-
const table = new Uint32Array(256);
|
|
13
|
-
for (let i = 0; i < 256; i++) {
|
|
14
|
-
let crc = i;
|
|
15
|
-
for (let bit = 0; bit < 8; bit++) {
|
|
16
|
-
crc = crc & 1 ? crc >>> 1 ^ IEEE_POLYNOMIAL : crc >>> 1;
|
|
17
|
-
}
|
|
18
|
-
table[i] = crc;
|
|
19
|
-
}
|
|
20
|
-
return table;
|
|
21
|
-
}
|
|
22
|
-
function getTable() {
|
|
23
|
-
if (cachedTable === null) {
|
|
24
|
-
cachedTable = buildTable();
|
|
25
|
-
}
|
|
26
|
-
return cachedTable;
|
|
27
|
-
}
|
|
28
|
-
function crc322(data) {
|
|
29
|
-
return crc32Final(crc32Update(crc32Init(), data));
|
|
30
|
-
}
|
|
31
|
-
function crc32Init() {
|
|
32
|
-
return ALL_BITS;
|
|
33
|
-
}
|
|
34
|
-
function crc32Update(state, data) {
|
|
35
|
-
if (nativeCrc32 !== null && data.length >= NATIVE_CRC32_MIN_BYTES) {
|
|
36
|
-
return nativeCrc32(data, (state ^ ALL_BITS) >>> 0) ^ ALL_BITS;
|
|
37
|
-
}
|
|
38
|
-
const table = getTable();
|
|
39
|
-
let crc = state;
|
|
40
|
-
for (let i = 0; i < data.length; i++) {
|
|
41
|
-
crc = crc >>> 8 ^ table[(crc ^ data[i]) & 255];
|
|
42
|
-
}
|
|
43
|
-
return crc;
|
|
44
|
-
}
|
|
45
|
-
function crc32Final(state) {
|
|
46
|
-
return (state ^ ALL_BITS) >>> 0;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
export { crc322 as crc32, crc32Final, crc32Init, crc32Update, nativeCrc32 };
|
package/dist/chunk-IFBKLBGB.mjs
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
// src/serialization/constants.ts
|
|
2
|
-
var CHECKSUM_TIMEOUT_MS = 12e4;
|
|
3
|
-
var CHECKSUM_YIELD_CHUNK_BYTES = 4 * 1024 * 1024;
|
|
4
|
-
var NATIVE_CRC32_MIN_BYTES = 16;
|
|
5
|
-
var VALID_HNSW_METRICS = /* @__PURE__ */ new Set(["cosine", "dotProduct", "euclidean"]);
|
|
6
|
-
|
|
7
|
-
export { CHECKSUM_TIMEOUT_MS, CHECKSUM_YIELD_CHUNK_BYTES, NATIVE_CRC32_MIN_BYTES, VALID_HNSW_METRICS };
|
package/dist/chunk-XZ4PAREY.mjs
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { DEFAULT_PAGE_SIZE } from './chunk-M6XF5HDE.mjs';
|
|
2
|
-
|
|
3
|
-
// src/engine/constants.ts
|
|
4
|
-
var MIN_DOCUMENTS_FOR_SEGMENTS = 64;
|
|
5
|
-
var BATCH_CHUNK_SIZE = 1e3;
|
|
6
|
-
var DEFAULT_LIMIT = DEFAULT_PAGE_SIZE;
|
|
7
|
-
var DEFAULT_OFFSET = 0;
|
|
8
|
-
var INDEX_NAME_PATTERN = /^[a-zA-Z0-9][a-zA-Z0-9._-]*$/;
|
|
9
|
-
var ABSOLUTE_WINDOWS_PATH_PATTERN = /^[a-zA-Z]:[\\/]/;
|
|
10
|
-
var MODULE_URL_SCHEME_PATTERN = /^(file|https?|data|node):/;
|
|
11
|
-
var MAX_INDEX_NAME_LENGTH = 255;
|
|
12
|
-
var MAX_DOC_ID_LENGTH = 512;
|
|
13
|
-
var MIN_SWEEP_INTERVAL_MS = 100;
|
|
14
|
-
var MAX_SWEEP_INTERVAL_MS = 6e4;
|
|
15
|
-
var HEAP_PRESSURE_WARNING_FRACTION = 0.9;
|
|
16
|
-
var HEAP_PRESSURE_REARM_FRACTION = 0.8;
|
|
17
|
-
var STATISTICS_BROADCAST_INTERVAL_MS = 5e3;
|
|
18
|
-
var FOREIGN_STATS_TTL_MS = 6e4;
|
|
19
|
-
var DEFAULT_SUGGEST_LIMIT = 10;
|
|
20
|
-
var MAX_SUGGEST_LIMIT = 100;
|
|
21
|
-
var SUGGEST_OVERSAMPLE_FACTOR = 1.5;
|
|
22
|
-
var SUGGEST_OVERSAMPLE_PADDING = 10;
|
|
23
|
-
var MAX_SUGGEST_SCATTER_LIMIT = Math.ceil(MAX_SUGGEST_LIMIT * SUGGEST_OVERSAMPLE_FACTOR) + SUGGEST_OVERSAMPLE_PADDING;
|
|
24
|
-
|
|
25
|
-
export { ABSOLUTE_WINDOWS_PATH_PATTERN, BATCH_CHUNK_SIZE, DEFAULT_LIMIT, DEFAULT_OFFSET, DEFAULT_SUGGEST_LIMIT, FOREIGN_STATS_TTL_MS, HEAP_PRESSURE_REARM_FRACTION, HEAP_PRESSURE_WARNING_FRACTION, INDEX_NAME_PATTERN, MAX_DOC_ID_LENGTH, MAX_INDEX_NAME_LENGTH, MAX_SUGGEST_LIMIT, MAX_SUGGEST_SCATTER_LIMIT, MAX_SWEEP_INTERVAL_MS, MIN_DOCUMENTS_FOR_SEGMENTS, MIN_SWEEP_INTERVAL_MS, MODULE_URL_SCHEME_PATTERN, STATISTICS_BROADCAST_INTERVAL_MS, SUGGEST_OVERSAMPLE_FACTOR, SUGGEST_OVERSAMPLE_PADDING };
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export { createDirectExecutor } from './chunk-HVJYTKK7.mjs';
|
|
2
|
-
import './chunk-QR4OKRVY.mjs';
|
|
3
|
-
import './chunk-KZTI25D3.mjs';
|
|
4
|
-
import './chunk-M6XF5HDE.mjs';
|
|
5
|
-
import './chunk-TGP5M5R7.mjs';
|
|
6
|
-
import './chunk-LCCL6EEH.mjs';
|
|
7
|
-
import './chunk-ZJ4CSAB2.mjs';
|
|
8
|
-
import './chunk-P2ZZN32C.mjs';
|
|
9
|
-
import './chunk-IFBKLBGB.mjs';
|
|
10
|
-
import './chunk-3HQPUCCT.mjs';
|
|
11
|
-
import './chunk-ZKRV5M2P.mjs';
|
|
12
|
-
import './chunk-U2BKYEC7.mjs';
|
|
13
|
-
import './chunk-LJYTW7GT.mjs';
|
|
14
|
-
import './chunk-RV77FR2F.mjs';
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
interface ChecksumRequest {
|
|
2
|
-
buffer: ArrayBuffer;
|
|
3
|
-
byteOffset: number;
|
|
4
|
-
byteLength: number;
|
|
5
|
-
}
|
|
6
|
-
interface ChecksumResponse {
|
|
7
|
-
type: 'success';
|
|
8
|
-
checksum: number;
|
|
9
|
-
buffer: ArrayBuffer;
|
|
10
|
-
byteOffset: number;
|
|
11
|
-
byteLength: number;
|
|
12
|
-
}
|
|
13
|
-
interface ChecksumError {
|
|
14
|
-
type: 'error';
|
|
15
|
-
message: string;
|
|
16
|
-
}
|
|
17
|
-
type ChecksumWorkerMessage = ChecksumResponse | ChecksumError;
|
|
18
|
-
declare function handleRequest(raw: unknown): ChecksumResponse;
|
|
19
|
-
|
|
20
|
-
export { type ChecksumError, type ChecksumRequest, type ChecksumResponse, type ChecksumWorkerMessage, handleRequest };
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { crc32 } from '../chunk-3L4U6EJQ.mjs';
|
|
2
|
-
import '../chunk-IFBKLBGB.mjs';
|
|
3
|
-
|
|
4
|
-
// src/serialization/crc32-worker.ts
|
|
5
|
-
function handleRequest(raw) {
|
|
6
|
-
const request = raw;
|
|
7
|
-
if (!(request.buffer instanceof ArrayBuffer)) {
|
|
8
|
-
throw new Error("Checksum request is missing a transferable buffer");
|
|
9
|
-
}
|
|
10
|
-
const { byteOffset, byteLength } = request;
|
|
11
|
-
if (!Number.isInteger(byteOffset) || !Number.isInteger(byteLength) || byteOffset < 0 || byteLength < 0) {
|
|
12
|
-
throw new Error("Checksum request has an invalid range");
|
|
13
|
-
}
|
|
14
|
-
if (byteOffset + byteLength > request.buffer.byteLength) {
|
|
15
|
-
throw new Error("Checksum request range exceeds the buffer bounds");
|
|
16
|
-
}
|
|
17
|
-
const checksum = crc32(new Uint8Array(request.buffer, byteOffset, byteLength));
|
|
18
|
-
return { type: "success", checksum, buffer: request.buffer, byteOffset, byteLength };
|
|
19
|
-
}
|
|
20
|
-
async function setupAsync() {
|
|
21
|
-
let parentPort = null;
|
|
22
|
-
try {
|
|
23
|
-
const workerThreads = await import('worker_threads');
|
|
24
|
-
parentPort = workerThreads.parentPort ?? null;
|
|
25
|
-
} catch {
|
|
26
|
-
parentPort = null;
|
|
27
|
-
}
|
|
28
|
-
if (parentPort) {
|
|
29
|
-
const port = parentPort;
|
|
30
|
-
port.on("message", (raw) => {
|
|
31
|
-
try {
|
|
32
|
-
const result = handleRequest(raw);
|
|
33
|
-
port.postMessage(result, [result.buffer]);
|
|
34
|
-
} catch (err) {
|
|
35
|
-
const message = err instanceof Error ? err.message : String(err);
|
|
36
|
-
port.postMessage({ type: "error", message });
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
const globalSelf = typeof self !== "undefined" ? self : void 0;
|
|
42
|
-
if (globalSelf && typeof globalSelf.postMessage === "function") {
|
|
43
|
-
const webSelf = globalSelf;
|
|
44
|
-
webSelf.onmessage = (event) => {
|
|
45
|
-
try {
|
|
46
|
-
const result = handleRequest(event.data);
|
|
47
|
-
webSelf.postMessage(result, [result.buffer]);
|
|
48
|
-
} catch (err) {
|
|
49
|
-
const message = err instanceof Error ? err.message : String(err);
|
|
50
|
-
webSelf.postMessage({ type: "error", message });
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
function setupWorker() {
|
|
56
|
-
setupAsync().catch((err) => {
|
|
57
|
-
console.error("Checksum worker setup failed:", err);
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
setupWorker();
|
|
61
|
-
|
|
62
|
-
export { handleRequest };
|