@delali/narsil 0.2.4-next.59 → 0.3.1-next.101
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 +9 -8
- package/dist/adapters/filesystem.d.ts +1 -1
- package/dist/adapters/filesystem.mjs +1 -1
- package/dist/adapters/indexeddb.d.ts +1 -1
- package/dist/adapters/indexeddb.mjs +1 -1
- package/dist/adapters/memory.d.ts +1 -1
- package/dist/{adapters-79OIa4xm.d.ts → adapters-BQFQ4PRz.d.ts} +27 -1
- package/dist/browser/chunk-BDOSMEEP.mjs +493 -0
- package/dist/browser/chunk-EJDUFWSO.mjs +602 -0
- package/dist/browser/chunk-HOZW3PKP.mjs +9 -0
- package/dist/browser/chunk-JOVZ6HMT.mjs +4358 -0
- package/dist/browser/chunk-JPTQZWJQ.mjs +10 -0
- package/dist/browser/chunk-KPJMDPHG.mjs +24558 -0
- package/dist/browser/chunk-PGIM3HIM.mjs +2743 -0
- package/dist/browser/chunk-RHG4O77A.mjs +206 -0
- package/dist/browser/chunk-RIJSLY2I.mjs +360 -0
- package/dist/browser/durability-wiring-SRUYT3VV.mjs +3875 -0
- package/dist/browser/module-CBB2ETYP.mjs +3111 -0
- package/dist/browser/release-76MXRPGV.mjs +33 -0
- package/dist/browser/replace-RURXTGVG.mjs +57 -0
- package/dist/browser/restore-queue-EEZQO6RF.mjs +35 -0
- package/dist/browser/runtime-7ZAHCHWR.mjs +557 -0
- package/dist/browser/snapshot-OAAA5UJ7.mjs +1210 -0
- package/dist/browser/write-7D6VIK6O.mjs +208 -0
- package/dist/{capabilities-DSsOGz6F.d.ts → capabilities-DiGlB6Sr.d.ts} +68 -7
- package/dist/chunk-2RIRGOUL.mjs +113 -0
- package/dist/chunk-37CD3OKS.mjs +87 -0
- package/dist/chunk-44W3CBNG.mjs +7 -0
- package/dist/chunk-46D6JQIG.mjs +426 -0
- package/dist/{chunk-VMRR3DQU.mjs → chunk-5JNA5SKS.mjs} +546 -35
- package/dist/chunk-747OHOUA.mjs +11 -0
- package/dist/chunk-75XIEF6H.mjs +126 -0
- package/dist/chunk-7X5JST5L.mjs +114 -0
- package/dist/chunk-BOFBLJFZ.mjs +209 -0
- package/dist/{chunk-USKFU7J5.mjs → chunk-BWJVNZPR.mjs} +8 -1
- package/dist/chunk-C7SLA6CM.mjs +19 -0
- package/dist/{chunk-POWOTUKJ.mjs → chunk-CQUMNIIG.mjs} +3 -6
- package/dist/chunk-CVXLLEQ3.mjs +1011 -0
- package/dist/chunk-DJHHF2L5.mjs +17 -0
- package/dist/chunk-E74YLAIG.mjs +24 -0
- package/dist/{chunk-UXNWQZST.mjs → chunk-EMRMGYRE.mjs} +236 -18
- package/dist/chunk-EWZLIYHV.mjs +57 -0
- package/dist/chunk-GBEEG5AN.mjs +35 -0
- package/dist/chunk-GES7U2PM.mjs +68 -0
- package/dist/chunk-HJSN7UYG.mjs +10 -0
- package/dist/chunk-HLPRHOSO.mjs +17 -0
- package/dist/chunk-HMFNFVP7.mjs +14 -0
- package/dist/chunk-J5QP52HA.mjs +1751 -0
- package/dist/{chunk-YNVIUGF5.mjs → chunk-JZVARCRZ.mjs} +3 -28
- package/dist/chunk-KOKM4PQN.mjs +52 -0
- package/dist/{chunk-B2TFROFX.mjs → chunk-KWTW6VTG.mjs} +465 -250
- package/dist/chunk-KZ3NX2P7.mjs +21 -0
- package/dist/chunk-L5ORED7V.mjs +25 -0
- package/dist/{chunk-THYRHHO2.mjs → chunk-LGAMKHA2.mjs} +2009 -2351
- package/dist/chunk-LKOB5COA.mjs +117 -0
- package/dist/chunk-LPQOEU5M.mjs +96 -0
- package/dist/{chunk-3LHGNRYE.mjs → chunk-LXWDQLTW.mjs} +7 -2
- package/dist/{chunk-L6TNPLAR.mjs → chunk-OEYI3KRB.mjs} +270 -108
- package/dist/chunk-OM362BRO.mjs +948 -0
- package/dist/chunk-OZDFA4WC.mjs +67 -0
- package/dist/chunk-P36MUFEJ.mjs +10 -0
- package/dist/chunk-PC2G76VW.mjs +2540 -0
- package/dist/{chunk-GCM3JFVA.mjs → chunk-PNEYIHA4.mjs} +11 -2
- package/dist/chunk-PNFKUCG3.mjs +1130 -0
- package/dist/chunk-Q6XWVUZX.mjs +44 -0
- package/dist/chunk-R27EMH5M.mjs +617 -0
- package/dist/{chunk-YMZCMH5M.mjs → chunk-R6A773WK.mjs} +19 -24
- package/dist/chunk-RF7PLG43.mjs +106 -0
- package/dist/chunk-RFBLQLLZ.mjs +16 -0
- package/dist/{chunk-Y3L5MDRV.mjs → chunk-RFVUDM5E.mjs} +17 -2
- package/dist/chunk-S7FL6UAH.mjs +521 -0
- package/dist/chunk-S7GNDRPS.mjs +651 -0
- package/dist/chunk-SP3NM3ZG.mjs +3537 -0
- package/dist/chunk-U476IXKQ.mjs +10 -0
- package/dist/chunk-UA3AUGNV.mjs +462 -0
- package/dist/chunk-UTG5YNXV.mjs +507 -0
- package/dist/chunk-VI4R6W25.mjs +8484 -0
- package/dist/chunk-WQBCBKY3.mjs +8 -0
- package/dist/{chunk-24RXHMEL.mjs → chunk-WVCOCKBU.mjs} +3794 -7570
- package/dist/chunk-X5CV2E2B.mjs +1 -0
- package/dist/chunk-XADZPPZI.mjs +614 -0
- package/dist/chunk-YEEQHT4V.mjs +212 -0
- package/dist/chunk-YTJCGKM4.mjs +56 -0
- package/dist/chunk-YYQIODMF.mjs +275 -0
- package/dist/chunk-ZI34TVOA.mjs +144 -0
- package/dist/{chunk-OOSIDHA3.mjs → chunk-ZKWYWW4Y.mjs} +1 -1
- package/dist/chunk-ZM7KU4YW.mjs +35 -0
- package/dist/{client-BQK6Tf6A.d.ts → client-BOStAkc5.d.ts} +160 -37
- package/dist/client.d.ts +11 -10
- package/dist/client.mjs +209 -45
- package/dist/{config-DmXULPa-.d.ts → config-Cjvzbs_j.d.ts} +51 -3
- package/dist/config-DffQlmRq.d.ts +421 -0
- package/dist/direct-executor-ZD64PPEZ.mjs +24 -0
- package/dist/distribution/coordinator/etcd.d.ts +79 -18
- package/dist/distribution/coordinator/etcd.mjs +553 -109
- package/dist/distribution/coordinator/in-memory.d.ts +4 -3
- package/dist/distribution/coordinator/in-memory.mjs +22 -3
- package/dist/distribution/transport/grpc.d.ts +2 -2
- package/dist/distribution/transport/grpc.mjs +79 -14
- package/dist/distribution/transport/in-memory.d.ts +2 -2
- package/dist/distribution/transport/in-memory.mjs +12 -7
- package/dist/distribution/transport/tcp.d.ts +2 -2
- package/dist/distribution/transport/tcp.mjs +50 -28
- package/dist/distribution.d.ts +144 -23
- package/dist/distribution.mjs +14479 -8173
- package/dist/durability-wiring-FEUBR5BT.mjs +3330 -0
- package/dist/embeddings/openai.d.ts +2 -2
- package/dist/embeddings/openai.mjs +22 -133
- package/dist/{engine-CIOyFozK.d.ts → engine-rC0vjjY-.d.ts} +165 -141
- package/dist/{memory-yFaVn2xZ.d.ts → events-DqOIg5xa.d.ts} +645 -136
- package/dist/{types-DAK7mnUZ.d.ts → index-Bkdt8nDw.d.ts} +182 -45
- package/dist/index.browser.mjs +4 -32180
- package/dist/index.d.ts +91 -20
- package/dist/index.mjs +33 -16
- package/dist/invalidation/broadcast-channel.d.ts +1 -1
- package/dist/invalidation/filesystem.d.ts +1 -1
- package/dist/invalidation/filesystem.mjs +2 -1
- package/dist/invalidation/noop.d.ts +1 -1
- package/dist/module-3S65MVCM.mjs +2151 -0
- package/dist/partial-words-DTIHO8G4.d.ts +19 -0
- package/dist/partial-words.d.ts +22 -0
- package/dist/partial-words.mjs +17 -0
- package/dist/pattern-Cledccbl.d.ts +18 -0
- package/dist/pattern.d.ts +22 -0
- package/dist/pattern.mjs +12 -0
- package/dist/persistence/durability/checkpoint-worker.d.ts +119 -72
- package/dist/persistence/durability/checkpoint-worker.mjs +51 -18
- package/dist/react.d.ts +279 -183
- package/dist/react.mjs +201 -48
- package/dist/release-BH3DKW3T.mjs +33 -0
- package/dist/replace-CEO5KJJ3.mjs +57 -0
- package/dist/rerank-K7C4WZFG.mjs +60 -0
- package/dist/rerankers/http.d.ts +50 -0
- package/dist/rerankers/http.mjs +104 -0
- package/dist/restore-queue-KQHA7ZV2.mjs +35 -0
- package/dist/runtime-6Y4ZYXOG.mjs +177 -0
- package/dist/{schema-d5Afu03A.d.ts → schema-4W_7tk1f.d.ts} +81 -11
- package/dist/server.d.ts +13 -12
- package/dist/server.mjs +611 -80
- package/dist/snapshot-QGZPODM5.mjs +799 -0
- package/dist/synonyms-CpOAHPa-.d.ts +52 -0
- package/dist/synonyms.d.ts +22 -0
- package/dist/synonyms.mjs +12 -0
- package/dist/{tasks-CH2Dod8w.d.ts → tasks-CwPTz-tP.d.ts} +10 -3
- package/dist/thread-N3IUGUS3.mjs +697 -0
- package/dist/{types-BQDlIvfS.d.ts → types-2qoitTXg.d.ts} +1 -1
- package/dist/{types-D5OwhtsQ.d.ts → types-Cz5okLml.d.ts} +2 -2
- package/dist/vector/search-worker.d.ts +46 -4
- package/dist/vector/search-worker.mjs +21 -11
- package/dist/workers/entry.mjs +9 -6
- package/dist/write-U5RI7MAX.mjs +241 -0
- package/package.json +55 -9
- package/dist/chunk-3L4U6EJQ.mjs +0 -49
- package/dist/chunk-IFBKLBGB.mjs +0 -7
- package/dist/chunk-ORBLD3EL.mjs +0 -6
- package/dist/chunk-U7KYW4BA.mjs +0 -135
- package/dist/chunk-ZJ4CSAB2.mjs +0 -13
- package/dist/chunk-ZNZBXMP5.mjs +0 -2117
- package/dist/chunk-ZZT3EAUC.mjs +0 -11168
- package/dist/config-BhldZgaK.d.ts +0 -194
- package/dist/direct-executor-ALAVE7FC.mjs +0 -12
- package/dist/serialization/crc32-worker.d.ts +0 -20
- package/dist/serialization/crc32-worker.mjs +0 -62
- package/dist/simd-DW5AtJ6B.d.ts +0 -41
- package/dist/thread-DYHEQRVY.mjs +0 -402
|
@@ -1,16 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
function adjustUtf16Unit(unit) {
|
|
3
|
-
if (unit < 55296) return unit;
|
|
4
|
-
if (unit < 57344) return unit + 8192;
|
|
5
|
-
return unit - 2048;
|
|
6
|
-
}
|
|
7
|
-
function compareCodePoints(a, b) {
|
|
8
|
-
const shorter = a.length < b.length ? a.length : b.length;
|
|
9
|
-
let i = 0;
|
|
10
|
-
while (i < shorter && a.charCodeAt(i) === b.charCodeAt(i)) i++;
|
|
11
|
-
if (i === shorter) return a.length - b.length;
|
|
12
|
-
return adjustUtf16Unit(a.charCodeAt(i)) - adjustUtf16Unit(b.charCodeAt(i));
|
|
13
|
-
}
|
|
1
|
+
import { compareCodePoints } from './chunk-YTJCGKM4.mjs';
|
|
14
2
|
|
|
15
3
|
// src/core/ordering/fold-table.ts
|
|
16
4
|
var SINGLE_FOLDS = "1t,w;1,w;1,w;1,w;1,w;1,w;1,w;1,w;1,w;1,w;1,w;1,w;1,w;1,w;1,w;1,w;1,w;1,w;1,w;1,w;1,w;1,w;1,w;1,w;1,w;1,w;2j,lj;b,w;1,w;1,w;1,w;1,w;1,w;1,w;1,w;1,w;1,w;1,w;1,w;1,w;1,w;1,w;1,w;1,w;1,w;1,w;1,w;1,w;1,w;1,w;2,w;1,w;1,w;1,w;1,w;1,w;1,w;y,1;2,1;2,1;2,1;2,1;2,1;2,1;2,1;2,1;2,1;2,1;2,1;2,1;2,1;2,1;2,1;2,1;2,1;2,1;2,1;2,1;2,1;2,1;2,1;4,1;2,1;2,1;3,1;2,1;2,1;2,1;2,1;2,1;2,1;2,1;3,1;2,1;2,1;2,1;2,1;2,1;2,1;2,1;2,1;2,1;2,1;2,1;2,1;2,1;2,1;2,1;2,1;2,1;2,1;2,1;2,1;2,1;2,1;2,-3d;1,1;2,1;2,1;2,-7g;2,5u;1,1;2,1;2,5q;1,1;2,5p;1,5p;1,1;3,27;1,5m;1,5n;1,1;2,5p;1,5r;2,5v;1,5t;1,1;4,5v;1,5x;2,5y;1,1;2,1;2,1;2,62;1,1;2,62;3,1;2,62;1,1;2,61;1,61;1,1;2,1;2,63;1,1;4,1;8,2;1,1;2,2;1,1;2,2;1,1;2,1;2,1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oldTable() {
|
|
|
49
37
|
|
|
50
38
|
// src/core/ordering/fold-compare.ts
|
|
51
39
|
var EXHAUSTED = -1;
|
|
40
|
+
function foldOf(codePoint, single, multi) {
|
|
41
|
+
if (codePoint < 128) return codePoint >= 65 && codePoint <= 90 ? codePoint + 32 : codePoint;
|
|
42
|
+
return single.get(codePoint) ?? multi.get(codePoint) ?? codePoint;
|
|
43
|
+
}
|
|
52
44
|
function nextFoldedCodePoint(text, cursor, single, multi) {
|
|
53
45
|
if (cursor.pending !== null) {
|
|
54
46
|
const cp2 = cursor.pending[cursor.pendingIndex];
|
|
@@ -62,9 +54,6 @@ function nextFoldedCodePoint(text, cursor, single, multi) {
|
|
|
62
54
|
if (cursor.index >= text.length) return EXHAUSTED;
|
|
63
55
|
let cp = text.charCodeAt(cursor.index);
|
|
64
56
|
cursor.index++;
|
|
65
|
-
if (cp < 128) {
|
|
66
|
-
return cp >= 65 && cp <= 90 ? cp + 32 : cp;
|
|
67
|
-
}
|
|
68
57
|
if (cp >= 55296 && cp < 56320 && cursor.index < text.length) {
|
|
69
58
|
const low = text.charCodeAt(cursor.index);
|
|
70
59
|
if (low >= 56320 && low < 57344) {
|
|
@@ -72,15 +61,13 @@ function nextFoldedCodePoint(text, cursor, single, multi) {
|
|
|
72
61
|
cursor.index++;
|
|
73
62
|
}
|
|
74
63
|
}
|
|
75
|
-
const
|
|
76
|
-
if (
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
if (expansion.length > 1) {
|
|
80
|
-
cursor.pending = expansion;
|
|
64
|
+
const folded = foldOf(cp, single, multi);
|
|
65
|
+
if (typeof folded === "number") return folded;
|
|
66
|
+
if (folded.length > 1) {
|
|
67
|
+
cursor.pending = folded;
|
|
81
68
|
cursor.pendingIndex = 1;
|
|
82
69
|
}
|
|
83
|
-
return
|
|
70
|
+
return folded[0];
|
|
84
71
|
}
|
|
85
72
|
function compareCaseFolded(a, b) {
|
|
86
73
|
const shorter = a.length < b.length ? a.length : b.length;
|
|
@@ -107,6 +94,14 @@ function compareSortStrings(a, b) {
|
|
|
107
94
|
if (folded !== 0) return folded;
|
|
108
95
|
return compareCodePoints(a, b);
|
|
109
96
|
}
|
|
97
|
+
function appendFoldedCodePoint(codePoint, out) {
|
|
98
|
+
const folded = foldOf(codePoint, singleFoldTable(), multiFoldTable());
|
|
99
|
+
if (typeof folded === "number") {
|
|
100
|
+
out.push(folded);
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
for (const foldedCodePoint of folded) out.push(foldedCodePoint);
|
|
104
|
+
}
|
|
110
105
|
|
|
111
106
|
// src/core/ordering/constants.ts
|
|
112
107
|
var SORT_VALUE_MAX_CODE_POINTS = 512;
|
|
@@ -228,4 +223,4 @@ function compareSortValues(aValues, bValues, directions) {
|
|
|
228
223
|
return 0;
|
|
229
224
|
}
|
|
230
225
|
|
|
231
|
-
export { SORT_MODES, SORT_VALUE_MAX_CODE_POINTS,
|
|
226
|
+
export { SORT_MODES, SORT_VALUE_MAX_CODE_POINTS, appendFoldedCodePoint, compareComparableKeys, compareComparableValues, compareSortValues, defaultSortMode, isSortMode, readSortField, singleFoldTable, sortModeOf, toComparableSortValue, toReducedSortValue, truncateSortString };
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { sanitizeSurfaceForms, patternIndexesFromWire, dropStoredVectorValues } from './chunk-PNFKUCG3.mjs';
|
|
2
|
+
import { requireValidFieldTypes } from './chunk-OEYI3KRB.mjs';
|
|
3
|
+
import { VALID_HNSW_METRICS } from './chunk-U476IXKQ.mjs';
|
|
4
|
+
import { decode } from '@msgpack/msgpack';
|
|
5
|
+
|
|
6
|
+
function validateHnswMetric(value) {
|
|
7
|
+
if (value === void 0 || value === null) return void 0;
|
|
8
|
+
if (typeof value === "string" && VALID_HNSW_METRICS.has(value)) {
|
|
9
|
+
return value;
|
|
10
|
+
}
|
|
11
|
+
return void 0;
|
|
12
|
+
}
|
|
13
|
+
function storedDocumentsOf(raw) {
|
|
14
|
+
requireValidFieldTypes(raw.schema ?? {});
|
|
15
|
+
const documents = {};
|
|
16
|
+
for (const [docId, doc] of Object.entries(raw.documents ?? {})) {
|
|
17
|
+
documents[docId] = {
|
|
18
|
+
fields: doc.fields,
|
|
19
|
+
fieldLengths: doc.field_lengths ?? {}
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
dropStoredVectorValues(documents, raw.schema ?? {});
|
|
23
|
+
return documents;
|
|
24
|
+
}
|
|
25
|
+
function documentsOfPayloadV2(data) {
|
|
26
|
+
const raw = decode(data);
|
|
27
|
+
return { documents: storedDocumentsOf(raw), schema: raw.schema ?? {} };
|
|
28
|
+
}
|
|
29
|
+
function deserializePayloadV2(data) {
|
|
30
|
+
const raw = decode(data);
|
|
31
|
+
const documents = storedDocumentsOf(raw);
|
|
32
|
+
const fieldNames = raw.inverted_index?.field_names ?? [];
|
|
33
|
+
const invertedIndex = {};
|
|
34
|
+
for (const [token, list] of Object.entries(raw.inverted_index?.entries ?? {})) {
|
|
35
|
+
const count = list.ids.length;
|
|
36
|
+
const postings = new Array(count);
|
|
37
|
+
for (let i = 0; i < count; i++) {
|
|
38
|
+
postings[i] = {
|
|
39
|
+
docId: list.ids[i],
|
|
40
|
+
termFrequency: list.tf[i],
|
|
41
|
+
field: fieldNames[list.fi[i]] ?? "",
|
|
42
|
+
positions: list.pos ? list.pos[i] : []
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
invertedIndex[token] = {
|
|
46
|
+
docFrequency: list.df,
|
|
47
|
+
postings
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
const numeric = {};
|
|
51
|
+
for (const [field, entries] of Object.entries(raw.field_indexes?.numeric ?? {})) {
|
|
52
|
+
numeric[field] = entries.map((e) => ({ value: e.value, docId: e.doc_id }));
|
|
53
|
+
}
|
|
54
|
+
const boolean = {};
|
|
55
|
+
for (const [field, idx] of Object.entries(raw.field_indexes?.boolean ?? {})) {
|
|
56
|
+
boolean[field] = { trueDocs: idx.true_docs ?? [], falseDocs: idx.false_docs ?? [] };
|
|
57
|
+
}
|
|
58
|
+
const geopoint = {};
|
|
59
|
+
for (const [field, entries] of Object.entries(raw.field_indexes?.geopoint ?? {})) {
|
|
60
|
+
geopoint[field] = entries.map((e) => ({ lat: e.lat, lon: e.lon, docId: e.doc_id }));
|
|
61
|
+
}
|
|
62
|
+
const vectorData = {};
|
|
63
|
+
for (const [field, data2] of Object.entries(raw.vector_data ?? {})) {
|
|
64
|
+
vectorData[field] = {
|
|
65
|
+
dimension: data2.dimension,
|
|
66
|
+
vectors: (data2.vectors ?? []).map((v) => ({ docId: v.doc_id, vector: v.vector })),
|
|
67
|
+
hnswGraph: data2.hnsw_graph ? {
|
|
68
|
+
entryPoint: data2.hnsw_graph.entry_point,
|
|
69
|
+
maxLayer: data2.hnsw_graph.max_layer,
|
|
70
|
+
m: data2.hnsw_graph.m,
|
|
71
|
+
efConstruction: data2.hnsw_graph.ef_construction,
|
|
72
|
+
metric: validateHnswMetric(data2.hnsw_graph.metric),
|
|
73
|
+
nodes: data2.hnsw_graph.nodes
|
|
74
|
+
} : null,
|
|
75
|
+
codes: data2.codes ? { bits: data2.codes.bits, centroid: data2.codes.centroid, records: data2.codes.records } : null
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
return {
|
|
79
|
+
indexName: raw.index_name,
|
|
80
|
+
partitionId: raw.partition_id,
|
|
81
|
+
totalPartitions: raw.total_partitions,
|
|
82
|
+
language: raw.language ?? "english",
|
|
83
|
+
schema: raw.schema ?? {},
|
|
84
|
+
docCount: raw.doc_count ?? 0,
|
|
85
|
+
avgDocLength: raw.avg_doc_length ?? 0,
|
|
86
|
+
documents,
|
|
87
|
+
invertedIndex,
|
|
88
|
+
fieldIndexes: {
|
|
89
|
+
numeric,
|
|
90
|
+
boolean,
|
|
91
|
+
enum: raw.field_indexes?.enum ?? {},
|
|
92
|
+
geopoint,
|
|
93
|
+
...patternIndexesFromWire(raw.field_indexes?.pattern)
|
|
94
|
+
},
|
|
95
|
+
surfaceForms: sanitizeSurfaceForms(raw.surface_forms),
|
|
96
|
+
vectorData,
|
|
97
|
+
statistics: {
|
|
98
|
+
totalDocuments: raw.statistics?.total_documents ?? 0,
|
|
99
|
+
totalFieldLengths: raw.statistics?.total_field_lengths ?? {},
|
|
100
|
+
averageFieldLengths: raw.statistics?.average_field_lengths ?? {},
|
|
101
|
+
docFrequencies: raw.statistics?.doc_frequencies ?? {}
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export { deserializePayloadV2, documentsOfPayloadV2 };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// src/workers/thread-slot.ts
|
|
2
|
+
var goneThreadSlots = /* @__PURE__ */ new Set();
|
|
3
|
+
function threadSlotOfWorker(workerId) {
|
|
4
|
+
return workerId + 1;
|
|
5
|
+
}
|
|
6
|
+
function noteThreadSlotLive(threadSlot) {
|
|
7
|
+
goneThreadSlots.delete(threadSlot);
|
|
8
|
+
}
|
|
9
|
+
function noteThreadSlotGone(threadSlot) {
|
|
10
|
+
goneThreadSlots.add(threadSlot);
|
|
11
|
+
}
|
|
12
|
+
function threadSlotGone(threadSlot) {
|
|
13
|
+
return goneThreadSlots.has(threadSlot);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export { noteThreadSlotGone, noteThreadSlotLive, threadSlotGone, threadSlotOfWorker };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { performance } from 'perf_hooks';
|
|
2
|
-
import {
|
|
2
|
+
import { setFlagsFromString, getHeapStatistics } from 'v8';
|
|
3
3
|
import { runInNewContext } from 'vm';
|
|
4
4
|
|
|
5
5
|
// src/runtime/idle-heap-cleanup.ts
|
|
@@ -10,6 +10,11 @@ var IDLE_HEAP_CLEANUP_QUIET_CHECKS = 2;
|
|
|
10
10
|
var IDLE_HEAP_CLEANUP_MAX_UTILISATION = 0.1;
|
|
11
11
|
var IDLE_HEAP_CLEANUP_MAX_GROWTH_BYTES = 4 * 1024 * 1024;
|
|
12
12
|
var IDLE_HEAP_CLEANUP_MIN_RECLAIMABLE_BYTES = 64 * 1024 * 1024;
|
|
13
|
+
var REFUSAL_COLLECTION_MIN_INTERVAL_MS = 1e3;
|
|
14
|
+
var REFUSAL_COLLECTION_TIME_MULTIPLE = 10;
|
|
15
|
+
var REFUSAL_YOUNG_COLLECTION_MIN_INTERVAL_MS = 10;
|
|
16
|
+
var HEAP_BLOCK_FRACTION_BELOW_V8_INEFFECTIVE_MARK_COMPACT_LINE = 0.75;
|
|
17
|
+
var HEAP_RESUME_FRACTION_BELOW_V8_INEFFECTIVE_MARK_COMPACT_LINE = 0.65;
|
|
13
18
|
|
|
14
19
|
// src/runtime/idle-heap-cleaner.ts
|
|
15
20
|
function createIdleHeapCleaner(deps) {
|
|
@@ -65,6 +70,16 @@ function collectAndReturnPages() {
|
|
|
65
70
|
return false;
|
|
66
71
|
}
|
|
67
72
|
}
|
|
73
|
+
function collectYoungGeneration() {
|
|
74
|
+
const collect = acquireCollector();
|
|
75
|
+
if (collect === null) return false;
|
|
76
|
+
try {
|
|
77
|
+
collect({ type: "minor", execution: "sync" });
|
|
78
|
+
return true;
|
|
79
|
+
} catch {
|
|
80
|
+
return false;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
68
83
|
function readHeap() {
|
|
69
84
|
try {
|
|
70
85
|
const stats = getHeapStatistics();
|
|
@@ -93,4 +108,4 @@ function startIdleHeapCleanup() {
|
|
|
93
108
|
return () => clearInterval(timer);
|
|
94
109
|
}
|
|
95
110
|
|
|
96
|
-
export { startIdleHeapCleanup };
|
|
111
|
+
export { HEAP_BLOCK_FRACTION_BELOW_V8_INEFFECTIVE_MARK_COMPACT_LINE, HEAP_RESUME_FRACTION_BELOW_V8_INEFFECTIVE_MARK_COMPACT_LINE, REFUSAL_COLLECTION_MIN_INTERVAL_MS, REFUSAL_COLLECTION_TIME_MULTIPLE, REFUSAL_YOUNG_COLLECTION_MIN_INTERVAL_MS, collectAndReturnPages, collectYoungGeneration, startIdleHeapCleanup };
|