@delali/narsil 0.3.1-next.140 → 0.3.1-next.143
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/{analysis-change-JN23AZQP.mjs → analysis-change-HQUT2Z3I.mjs} +13 -13
- package/dist/{analysis-change-entry-5JSIMEKG.mjs → analysis-change-entry-TZTG4AZB.mjs} +1 -1
- package/dist/browser/{analysis-change-57MIRJWR.mjs → analysis-change-JPV775LR.mjs} +407 -6
- package/dist/browser/{analysis-change-entry-ICGRR3IN.mjs → analysis-change-entry-7HR4LWL3.mjs} +1 -1
- package/dist/browser/chunk-3ZBJYAS4.mjs +19 -0
- package/dist/browser/{chunk-ZAIZQOTM.mjs → chunk-5DB2VDGI.mjs} +951 -1134
- package/dist/browser/chunk-6RHTAVZX.mjs +656 -0
- package/dist/browser/chunk-CCOAOO73.mjs +86 -0
- package/dist/browser/{chunk-3EYDURFD.mjs → chunk-HKX2G6WH.mjs} +1615 -2266
- package/dist/browser/{chunk-CGVBGHBX.mjs → chunk-KTOK275N.mjs} +531 -830
- package/dist/browser/{chunk-5LYWZJE2.mjs → chunk-LVY2LI35.mjs} +1 -1
- package/dist/browser/chunk-MVM33ZUL.mjs +993 -0
- package/dist/browser/chunk-MWUK3DA5.mjs +2634 -0
- package/dist/browser/{chunk-67KSBUYR.mjs → chunk-R4WUDZQV.mjs} +8 -5
- package/dist/browser/{chunk-6BSB4N6B.mjs → chunk-TCLEOZ4P.mjs} +2 -2
- package/dist/browser/chunk-VFYMPCOV.mjs +212 -0
- package/dist/browser/chunk-WCFCHIBB.mjs +177 -0
- package/dist/browser/{chunk-E5SFTOQR.mjs → chunk-XNWPP5NS.mjs} +2 -2
- package/dist/browser/{chunk-QHNNULPW.mjs → chunk-ZEV26AQ6.mjs} +5 -0
- package/dist/browser/cold-module-MJMKNUYJ.mjs +745 -0
- package/dist/browser/{durability-wiring-MTIAN6VT.mjs → durability-wiring-SNOWIT6Z.mjs} +231 -51
- package/dist/browser/{import-Q7MXD6BS.mjs → import-TLB2A5LJ.mjs} +6 -5
- package/dist/browser/module-BUFNZMEU.mjs +12 -0
- package/dist/browser/{module-5J3PEUEB.mjs → module-BVP4TKZU.mjs} +395 -108
- package/dist/{restore-queue-RYSRRFS4.mjs → browser/restore-queue-ONYNYUDE.mjs} +2 -2
- package/dist/browser/{snapshot-YBJ5MF2M.mjs → snapshot-QXBKHJAG.mjs} +108 -25
- package/dist/browser/{write-RTWI5MXL.mjs → write-WHFBDWQS.mjs} +63 -91
- package/dist/{capabilities-DXAmysqJ.d.ts → capabilities-BCdUwK_L.d.ts} +2 -2
- package/dist/{chunk-HMDT3I63.mjs → chunk-46NZOPHS.mjs} +2 -2
- package/dist/{chunk-XXKWEG53.mjs → chunk-5WYVUPGD.mjs} +1 -1
- package/dist/chunk-6SNBQESJ.mjs +214 -0
- package/dist/chunk-7AUASRE7.mjs +653 -0
- package/dist/{chunk-4GCN34JV.mjs → chunk-AST3SHFA.mjs} +26 -24
- package/dist/chunk-BOJZGUS6.mjs +177 -0
- package/dist/{chunk-IP4HJOGC.mjs → chunk-BRUUBXCB.mjs} +4 -3
- package/dist/{chunk-J3EHATEZ.mjs → chunk-DQNKVOJ2.mjs} +63 -63
- package/dist/chunk-FOCV4CBZ.mjs +87 -0
- package/dist/{chunk-FFVLPCLH.mjs → chunk-GLZHNSGB.mjs} +1 -1
- package/dist/chunk-GWOS5DYC.mjs +2637 -0
- package/dist/{chunk-W2XDK66Z.mjs → chunk-IO5F7ZBE.mjs} +112 -438
- package/dist/{chunk-P36MUFEJ.mjs → chunk-JDDXV6UF.mjs} +2 -1
- package/dist/{chunk-LLDFIKGP.mjs → chunk-KEIYVZUX.mjs} +4 -4
- package/dist/{chunk-UBXJQJII.mjs → chunk-KGOXHLLZ.mjs} +5 -1
- package/dist/{chunk-FKARMUWH.mjs → chunk-KZL72VTC.mjs} +68 -16
- package/dist/{chunk-TCWQJL7O.mjs → chunk-L76W3IZJ.mjs} +5 -0
- package/dist/{chunk-CPCGEIOM.mjs → chunk-LA4WNDHL.mjs} +83 -799
- package/dist/{chunk-PNNVTKMT.mjs → chunk-NJJCPFXN.mjs} +2 -2
- package/dist/chunk-NN33CZRE.mjs +86 -0
- package/dist/chunk-NRUXBYPH.mjs +121 -0
- package/dist/{chunk-UJWGQIXU.mjs → chunk-QHPYS427.mjs} +1 -0
- package/dist/{chunk-VSUYTPME.mjs → chunk-RHKRTYGO.mjs} +13 -4
- package/dist/{chunk-UEV53BBO.mjs → chunk-SRJBFG2T.mjs} +406 -5
- package/dist/{chunk-K3AQOZVM.mjs → chunk-TNBIK2LQ.mjs} +1638 -1644
- package/dist/chunk-UUZCQQG2.mjs +209 -0
- package/dist/{chunk-XMQNOD5V.mjs → chunk-VEFN6X6Q.mjs} +2 -2
- package/dist/{chunk-LK3MOTXF.mjs → chunk-VJEGOELZ.mjs} +8 -5
- package/dist/chunk-W2COJ5AH.mjs +148 -0
- package/dist/{chunk-IBATGS3J.mjs → chunk-WJGO5PGV.mjs} +241 -124
- package/dist/{chunk-CCCGEPJM.mjs → chunk-XZ3SRNDJ.mjs} +24 -63
- package/dist/{chunk-MTQTX4BP.mjs → chunk-YHUTF6EA.mjs} +400 -92
- package/dist/{chunk-B5I3IL4H.mjs → chunk-YLNSJQLX.mjs} +4 -4
- package/dist/{chunk-6VHWXAOI.mjs → chunk-Z4HFMYNX.mjs} +29 -24
- package/dist/{chunk-U4X4AWKL.mjs → chunk-ZPWS2SKJ.mjs} +293 -270
- package/dist/{client-DApBeLbk.d.ts → client-B12YFALP.d.ts} +3 -3
- package/dist/client.d.ts +7 -7
- package/dist/cold-module-4X7WJCFM.mjs +783 -0
- package/dist/{config-B0H-vp4U.d.ts → config-BhZxIeb1.d.ts} +6 -1
- package/dist/{config-Brysl9NO.d.ts → config-CIG5yDyg.d.ts} +2 -2
- package/dist/{direct-executor-J5UDLPL3.mjs → direct-executor-7XOQ7VQP.mjs} +5 -5
- package/dist/distribution/coordinator/etcd.d.ts +2 -2
- package/dist/distribution/coordinator/in-memory.d.ts +2 -2
- package/dist/distribution.d.ts +7 -7
- package/dist/distribution.mjs +123 -42
- package/dist/{durability-wiring-AYOTAPNQ.mjs → durability-wiring-324D2DDD.mjs} +213 -40
- package/dist/{engine-CuLMbH1-.d.ts → engine-CtzbHOmG.d.ts} +2 -2
- package/dist/{import-QRZAQ5RH.mjs → import-OOBUW3RR.mjs} +14 -13
- package/dist/{index-HYnqS1SE.d.ts → index-DsEurhSl.d.ts} +1 -1
- package/dist/index.browser.mjs +3 -3
- package/dist/index.d.ts +6 -6
- package/dist/index.mjs +11 -11
- package/dist/{long-query-thread-U7K5A72G.mjs → long-query-thread-4SW7RWDE.mjs} +8 -8
- package/dist/{module-L2OZO5PQ.mjs → module-DXSJ5LT2.mjs} +374 -83
- package/dist/module-IYPLWHGC.mjs +48 -0
- package/dist/paged-partition-archive-HFP45PLU.mjs +269 -0
- package/dist/partial-words.mjs +2 -2
- package/dist/persistence/durability/checkpoint-worker.d.ts +5 -1
- package/dist/persistence/durability/checkpoint-worker.mjs +17 -15
- package/dist/react.d.ts +9 -9
- package/dist/{browser/restore-queue-DISFECE4.mjs → restore-queue-FEYAC4SB.mjs} +2 -2
- package/dist/{schema-BTXbHCqA.d.ts → schema-B-Runv0n.d.ts} +7 -0
- package/dist/server.d.ts +10 -10
- package/dist/server.mjs +8 -7
- package/dist/{snapshot-BTRZ3MZK.mjs → snapshot-CGM65VCD.mjs} +60 -25
- package/dist/{tasks-DjGjK70Y.d.ts → tasks-CjRJRGTb.d.ts} +6 -4
- package/dist/{thread-USB3GOPY.mjs → thread-KGNAIKPD.mjs} +8 -8
- package/dist/vector/search-worker.d.ts +1 -1
- package/dist/vector/search-worker.mjs +3 -2
- package/dist/workers/entry.mjs +7 -7
- package/dist/{write-GHTA56OW.mjs → write-2DZPEQL2.mjs} +70 -98
- package/openapi.json +13 -0
- package/package.json +12 -8
- package/dist/browser/chunk-XVMOQQ34.mjs +0 -384
- package/dist/chunk-BDIDUW2B.mjs +0 -387
- package/dist/browser/{chunk-4MFH226Q.mjs → chunk-D33A5VMU.mjs} +15 -15
|
@@ -4,7 +4,8 @@ var WIRE_BATCH_BUDGET = {
|
|
|
4
4
|
maxBytes: 8388608,
|
|
5
5
|
overheadBytes: 256
|
|
6
6
|
};
|
|
7
|
+
var PARTITION_COPY_VECTOR_RUN_BYTES = 4194304;
|
|
7
8
|
var MAX_PARTITION_COUNT = 65536;
|
|
8
9
|
var MAX_REPLICATION_FACTOR = 255;
|
|
9
10
|
|
|
10
|
-
export { MAX_PARTITION_COUNT, MAX_REPLICATION_FACTOR, WIRE_BATCH_BUDGET };
|
|
11
|
+
export { MAX_PARTITION_COUNT, MAX_REPLICATION_FACTOR, PARTITION_COPY_VECTOR_RUN_BYTES, WIRE_BATCH_BUDGET };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { removeDocumentVectors, prepareDocumentVectors, insertDocumentVectors } from './chunk-
|
|
2
|
-
import { getNestedValue } from './chunk-
|
|
3
|
-
import { requireValidFieldTypes } from './chunk-
|
|
1
|
+
import { removeDocumentVectors, prepareDocumentVectors, insertDocumentVectors } from './chunk-IO5F7ZBE.mjs';
|
|
2
|
+
import { getNestedValue } from './chunk-DQNKVOJ2.mjs';
|
|
3
|
+
import { requireValidFieldTypes } from './chunk-KGOXHLLZ.mjs';
|
|
4
4
|
import { VECTOR_PATTERN } from './chunk-L5ORED7V.mjs';
|
|
5
5
|
import { ErrorCodes, NarsilError } from './chunk-HNHCNTVG.mjs';
|
|
6
6
|
import { decode } from '@msgpack/msgpack';
|
|
@@ -648,4 +648,4 @@ function decodeKeywordSegment(payload, shared) {
|
|
|
648
648
|
return writeRecords === null ? { schema, tombstones, arrays } : { schema, tombstones, arrays, writeRecords };
|
|
649
649
|
}
|
|
650
650
|
|
|
651
|
-
export { KEYWORD_SEGMENT_ENVELOPE_VERSION, KEYWORD_SEGMENT_PAYLOAD_VERSION, applyDeleteEntry, applyIndexEntry, decodeKeywordSegment, littleEndianBytes, restoreVectorFields, setNestedValue, uint64Bytes, validateReplicationEntry };
|
|
651
|
+
export { KEYWORD_SEGMENT_ENVELOPE_VERSION, KEYWORD_SEGMENT_PAYLOAD_VERSION, applyDeleteEntry, applyIndexEntry, decodeBooleanColumns, decodeEnumColumns, decodeFieldLengths, decodeGeopointColumns, decodeKeywordSegment, decodePartialWords, decodePatternColumns, decodeSurfaceForms, decodeValueColumns, littleEndianBytes, requireEntriesAscend, requireOffsets, requireUtf8Entries, restoreVectorFields, setNestedValue, uint32sFrom, uint64Bytes, validateReplicationEntry };
|
|
@@ -650,6 +650,10 @@ function validateVectorStorage(config, filesystemDurability) {
|
|
|
650
650
|
});
|
|
651
651
|
}
|
|
652
652
|
}
|
|
653
|
+
function validateTextStorage(textStorage, filesystemDurability) {
|
|
654
|
+
if (textStorage === void 0 || textStorage === "memory" || textStorage === "disk" && filesystemDurability) return;
|
|
655
|
+
fail("textStorage must be 'memory', or 'disk' with filesystem durability", { textStorage });
|
|
656
|
+
}
|
|
653
657
|
function raiseEarlierReleaseGraphSetting(config) {
|
|
654
658
|
if (typeof config !== "object" || config === null) return config;
|
|
655
659
|
const hnsw = config.hnswConfig;
|
|
@@ -686,4 +690,4 @@ function validateVectorPromotion(config) {
|
|
|
686
690
|
}
|
|
687
691
|
}
|
|
688
692
|
|
|
689
|
-
export { ANTIMERIDIAN_SPAN_DEGREES, DEG_TO_RAD, EARTH_RADIUS_METERS, FULL_TURN_DEGREES, LOCATION_CODE_BITS_PER_AXIS, MAX_COVERING_CELLS, MAX_LATITUDE_DEGREES, MAX_LONGITUDE_DEGREES, MIN_POLYGON_POINTS, RADIUS_BOX_MARGIN_RADIANS, RADIUS_BOX_MARGIN_RATIO, VINCENTY_CONVERGENCE_THRESHOLD, VINCENTY_MAX_ITERATIONS, encodeDocument, encodeDocumentReply, extractVectorFieldsFromSchema, flattenSchema, isLatitude, isLongitude, isQuantizationMode, isStorageMode, messagePackUpperBoundBytes, partialFieldsOf, raiseEarlierReleaseGraphSetting, requireCreatableSchema, requireDocumentWithinSizeLimit, requireValidFieldTypes, schemaFieldsOf, validateDocument, validateDocumentStrict, validateRequiredFields, validateSchema, validateVectorPromotion, validateVectorStorage };
|
|
693
|
+
export { ANTIMERIDIAN_SPAN_DEGREES, DEG_TO_RAD, EARTH_RADIUS_METERS, FULL_TURN_DEGREES, LOCATION_CODE_BITS_PER_AXIS, MAX_COVERING_CELLS, MAX_LATITUDE_DEGREES, MAX_LONGITUDE_DEGREES, MIN_POLYGON_POINTS, RADIUS_BOX_MARGIN_RADIANS, RADIUS_BOX_MARGIN_RATIO, VINCENTY_CONVERGENCE_THRESHOLD, VINCENTY_MAX_ITERATIONS, encodeDocument, encodeDocumentReply, extractVectorFieldsFromSchema, flattenSchema, isLatitude, isLongitude, isQuantizationMode, isStorageMode, messagePackUpperBoundBytes, partialFieldsOf, raiseEarlierReleaseGraphSetting, requireCreatableSchema, requireDocumentWithinSizeLimit, requireValidFieldTypes, schemaFieldsOf, validateDocument, validateDocumentStrict, validateRequiredFields, validateSchema, validateTextStorage, validateVectorPromotion, validateVectorStorage };
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { writeLiveVectors, decodeSegmentManifest, openManifestPayload, listedKeysOf, decodeManifestPayload, SINGLE_NODE_PRIMARY_TERM } from './chunk-
|
|
2
|
-
import { vectorsPerFile } from './chunk-
|
|
1
|
+
import { writeLiveVectors, decodeSegmentManifest, openManifestPayload, listedKeysOf, decodeManifestPayload, SINGLE_NODE_PRIMARY_TERM } from './chunk-YHUTF6EA.mjs';
|
|
2
|
+
import { vectorsPerFile } from './chunk-Z4HFMYNX.mjs';
|
|
3
3
|
import { vectorsToBytes, VECTOR_FILE_PAYLOAD_VERSION } from './chunk-ICW45TTU.mjs';
|
|
4
|
-
import { writeCheckpointSegments,
|
|
5
|
-
import {
|
|
4
|
+
import { writeCheckpointSegments, commitCheckpointManifest, partitionContentsOf } from './chunk-LA4WNDHL.mjs';
|
|
5
|
+
import { DEFAULT_COMPACTION_THRESHOLD } from './chunk-7AUASRE7.mjs';
|
|
6
|
+
import { manifestKey, manifestFileRefs } from './chunk-UUZCQQG2.mjs';
|
|
7
|
+
import { HEADER_SIZE } from './chunk-IO5F7ZBE.mjs';
|
|
6
8
|
import { MAX_FILE_BYTES } from './chunk-U476IXKQ.mjs';
|
|
7
9
|
import { NarsilError, ErrorCodes } from './chunk-HNHCNTVG.mjs';
|
|
8
10
|
|
|
@@ -63,10 +65,11 @@ function partitionVectorPlan(vectorIndex, docIds) {
|
|
|
63
65
|
codes: null,
|
|
64
66
|
vectors: vectorsToBytes(packed)
|
|
65
67
|
};
|
|
66
|
-
files.push({ payload, ordinals: new Int32Array(slice.length), dead: null });
|
|
68
|
+
files.push({ payload, ordinals: new Int32Array(slice.length), dead: null, magnitudes: null });
|
|
67
69
|
}
|
|
68
70
|
return {
|
|
69
71
|
unchanged: false,
|
|
72
|
+
storesHeads: false,
|
|
70
73
|
kept: [],
|
|
71
74
|
keptFiles: [],
|
|
72
75
|
newFiles: files.length,
|
|
@@ -158,6 +161,7 @@ async function buildArchiveFromMemory(input) {
|
|
|
158
161
|
|
|
159
162
|
// src/persistence/archive/constants.ts
|
|
160
163
|
var MAX_PAX_HEADER_BYTES = 65536;
|
|
164
|
+
var ARCHIVE_FILE_CHUNK_BYTES = 4194304;
|
|
161
165
|
|
|
162
166
|
// src/persistence/archive/tar.ts
|
|
163
167
|
var TAR_BLOCK_BYTES = 512;
|
|
@@ -342,17 +346,32 @@ async function readBlock(reader) {
|
|
|
342
346
|
if (block.byteLength < TAR_BLOCK_BYTES) invalidArchive("the archive ends inside an entry header");
|
|
343
347
|
return block;
|
|
344
348
|
}
|
|
349
|
+
async function skipPadding(reader, size) {
|
|
350
|
+
const remainder = size % TAR_BLOCK_BYTES;
|
|
351
|
+
if (remainder === 0) return;
|
|
352
|
+
const padding = await reader.readExactly(TAR_BLOCK_BYTES - remainder);
|
|
353
|
+
if (padding === null || padding.byteLength < TAR_BLOCK_BYTES - remainder) {
|
|
354
|
+
invalidArchive("the archive ends inside the padding of an entry");
|
|
355
|
+
}
|
|
356
|
+
}
|
|
345
357
|
async function readPadded(reader, size) {
|
|
346
358
|
const body = await reader.readExactly(size) ?? new Uint8Array(0);
|
|
347
359
|
if (body.byteLength < size) invalidArchive("the archive ends inside an entry");
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
360
|
+
await skipPadding(reader, size);
|
|
361
|
+
return body;
|
|
362
|
+
}
|
|
363
|
+
function entryBody(reader, size) {
|
|
364
|
+
let remaining = size;
|
|
365
|
+
async function* chunks() {
|
|
366
|
+
while (remaining > 0) {
|
|
367
|
+
const length = Math.min(ARCHIVE_FILE_CHUNK_BYTES, remaining);
|
|
368
|
+
const chunk = await reader.readExactly(length);
|
|
369
|
+
if (chunk === null || chunk.byteLength < length) invalidArchive("the archive ends inside an entry");
|
|
370
|
+
remaining -= length;
|
|
371
|
+
yield chunk;
|
|
353
372
|
}
|
|
354
373
|
}
|
|
355
|
-
return
|
|
374
|
+
return chunks();
|
|
356
375
|
}
|
|
357
376
|
async function nextEntryHeader(reader) {
|
|
358
377
|
const block = await readBlock(reader);
|
|
@@ -412,12 +431,16 @@ async function readSnapshotArchive(reader, handlers) {
|
|
|
412
431
|
if (header.size !== ref.bytes) {
|
|
413
432
|
invalidArchive(`the entry "${expected}" holds ${header.size} bytes where the manifest lists ${ref.bytes}`);
|
|
414
433
|
}
|
|
415
|
-
const
|
|
416
|
-
if (headerChecksumOf(
|
|
434
|
+
const start = await reader.peek(Math.min(HEADER_SIZE, header.size));
|
|
435
|
+
if (headerChecksumOf(start) !== ref.checksum) {
|
|
417
436
|
invalidArchive(`the entry "${expected}" carries a checksum other than the manifest lists`, { entry: expected });
|
|
418
437
|
}
|
|
419
438
|
seen.add(expected);
|
|
420
|
-
|
|
439
|
+
const entry = entryBody(reader, header.size);
|
|
440
|
+
await handlers.file(expected, ref, entry);
|
|
441
|
+
let unread = await entry.next();
|
|
442
|
+
while (unread.done !== true) unread = await entry.next();
|
|
443
|
+
await skipPadding(reader, header.size);
|
|
421
444
|
}
|
|
422
445
|
const trailing = await nextEntryHeader(reader);
|
|
423
446
|
if (trailing !== null) {
|
|
@@ -433,12 +456,20 @@ function entryChunks(name, bytes) {
|
|
|
433
456
|
(chunk) => chunk.byteLength > 0
|
|
434
457
|
);
|
|
435
458
|
}
|
|
459
|
+
async function* fileEntryChunks(source, name, ref) {
|
|
460
|
+
yield* tarEntryHeaders(name, ref.bytes).filter((chunk) => chunk.byteLength > 0);
|
|
461
|
+
for (let offset = 0; offset < ref.bytes; offset += ARCHIVE_FILE_CHUNK_BYTES) {
|
|
462
|
+
yield await source.readRange(ref, offset, Math.min(ARCHIVE_FILE_CHUNK_BYTES, ref.bytes - offset));
|
|
463
|
+
}
|
|
464
|
+
const padding = tarPadding(ref.bytes);
|
|
465
|
+
if (padding.byteLength > 0) yield padding;
|
|
466
|
+
}
|
|
436
467
|
async function* archiveChunks(source) {
|
|
437
468
|
yield* entryChunks(ARCHIVE_CONFIG_ENTRY, source.config);
|
|
438
469
|
yield* entryChunks(ARCHIVE_MANIFEST_ENTRY, source.manifestBytes);
|
|
439
470
|
const prefix = `${source.sourceIndexName}/`;
|
|
440
471
|
for (const ref of manifestFileRefs(source.manifest)) {
|
|
441
|
-
yield*
|
|
472
|
+
yield* fileEntryChunks(source, ref.key.slice(prefix.length), ref);
|
|
442
473
|
}
|
|
443
474
|
yield tarEnd();
|
|
444
475
|
}
|
|
@@ -472,4 +503,25 @@ function archiveStream(source) {
|
|
|
472
503
|
});
|
|
473
504
|
}
|
|
474
505
|
|
|
475
|
-
|
|
506
|
+
// src/persistence/archive/file-entry.ts
|
|
507
|
+
async function writeArchiveFile(store, key, chunks) {
|
|
508
|
+
const { directory } = store;
|
|
509
|
+
if (directory === void 0) {
|
|
510
|
+
const held = [];
|
|
511
|
+
for await (const chunk of chunks) held.push(chunk);
|
|
512
|
+
await store.write(key, held);
|
|
513
|
+
return;
|
|
514
|
+
}
|
|
515
|
+
const receiving = `${key}.receiving`;
|
|
516
|
+
await directory.remove(receiving);
|
|
517
|
+
const handle = await directory.appendHandle(receiving);
|
|
518
|
+
try {
|
|
519
|
+
for await (const chunk of chunks) await handle.append(chunk);
|
|
520
|
+
await handle.sync();
|
|
521
|
+
} finally {
|
|
522
|
+
await handle.close();
|
|
523
|
+
}
|
|
524
|
+
await directory.move(receiving, key);
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
export { archiveStream, buildArchiveFromMemory, memoryCheckpointStore, readSnapshotArchive, writeArchiveFile };
|
|
@@ -157,6 +157,10 @@ function readSharedConfigFields(source, reject) {
|
|
|
157
157
|
const surfaceForms = restoredBoolean(source.surfaceForms, "surfaceForms", reject);
|
|
158
158
|
const defaultScoring = restoredScoring(source.defaultScoring, reject);
|
|
159
159
|
const trackPositions = restoredBoolean(source.trackPositions, "trackPositions", reject);
|
|
160
|
+
const { textStorage } = source;
|
|
161
|
+
if (textStorage !== void 0 && textStorage !== "memory" && textStorage !== "disk") {
|
|
162
|
+
reject("textStorage must be 'memory' or 'disk'");
|
|
163
|
+
}
|
|
160
164
|
const strict = restoredBoolean(source.strict, "strict", reject);
|
|
161
165
|
const required = restoredRequired(source.required, reject);
|
|
162
166
|
const vectorPromotion = restoredVectorPromotion(source.vectorPromotion, reject);
|
|
@@ -170,6 +174,7 @@ function readSharedConfigFields(source, reject) {
|
|
|
170
174
|
...surfaceForms !== void 0 ? { surfaceForms } : {},
|
|
171
175
|
...defaultScoring !== void 0 ? { defaultScoring } : {},
|
|
172
176
|
...trackPositions !== void 0 ? { trackPositions } : {},
|
|
177
|
+
...textStorage === "memory" || textStorage === "disk" ? { textStorage } : {},
|
|
173
178
|
...strict !== void 0 ? { strict } : {},
|
|
174
179
|
...required !== void 0 ? { required } : {},
|
|
175
180
|
...vectorPromotion !== void 0 ? { vectorPromotion } : {},
|