@delali/narsil 0.3.1-next.193 → 0.3.1-next.196

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.
Files changed (77) hide show
  1. package/dist/browser/{chunk-UQG4HUGQ.mjs → chunk-YKHBTLYW.mjs} +15 -6
  2. package/dist/browser/{storage-leaf-N3JMQ6CF.mjs → storage-leaf-KIPJKTWU.mjs} +68 -39
  3. package/dist/{chunk-2HVQYOOD.mjs → chunk-23UYFZXF.mjs} +2 -2
  4. package/dist/{chunk-62X472AC.mjs → chunk-23WLACOL.mjs} +1 -1
  5. package/dist/{chunk-JXINPXRS.mjs → chunk-2TWR6YCG.mjs} +1 -1
  6. package/dist/{chunk-D2EJUM4A.mjs → chunk-2WKZM3FS.mjs} +21 -5
  7. package/dist/{chunk-YPEJ6ODL.mjs → chunk-3CRBNUPW.mjs} +9 -9
  8. package/dist/{chunk-6MC6BCXK.mjs → chunk-7BCL5QK5.mjs} +2 -2
  9. package/dist/{chunk-5CIHQIA4.mjs → chunk-D2H5RN3Q.mjs} +4 -4
  10. package/dist/{chunk-ZVZYJIIP.mjs → chunk-D4PSKC3O.mjs} +2 -2
  11. package/dist/{chunk-FGOGT273.mjs → chunk-DEKP2BZO.mjs} +2 -2
  12. package/dist/{chunk-HHYQMGPW.mjs → chunk-F62PEMTB.mjs} +1 -1
  13. package/dist/{chunk-TSE2VWPX.mjs → chunk-FIMLVUHE.mjs} +1 -1
  14. package/dist/{chunk-SHES4VP5.mjs → chunk-IC6LWK2D.mjs} +5 -5
  15. package/dist/{chunk-SB5HCIIO.mjs → chunk-IQAV6Z3Y.mjs} +2 -2
  16. package/dist/{chunk-GLXLSPLO.mjs → chunk-JYIH6G2H.mjs} +2 -2
  17. package/dist/{chunk-HSA3H3VW.mjs → chunk-K2KNE7W2.mjs} +22 -13
  18. package/dist/{chunk-SM2SYVIX.mjs → chunk-KFU4KW77.mjs} +1 -1
  19. package/dist/{chunk-Z6SIJH5O.mjs → chunk-NTO2EMWZ.mjs} +2 -2
  20. package/dist/{chunk-JENWA4WX.mjs → chunk-NVGSHRLW.mjs} +1 -1
  21. package/dist/{chunk-PAPQGC6I.mjs → chunk-QRKC25IO.mjs} +1 -1
  22. package/dist/{chunk-7X4IIREW.mjs → chunk-RDGMV4R3.mjs} +3 -3
  23. package/dist/{chunk-KOA6T2IC.mjs → chunk-SUFAI37B.mjs} +1 -1
  24. package/dist/{chunk-K5GNK5GE.mjs → chunk-TQ5EEJEO.mjs} +2 -2
  25. package/dist/{chunk-3N5GUXBI.mjs → chunk-V24XTYHX.mjs} +2 -2
  26. package/dist/{chunk-SIIDIGKI.mjs → chunk-V6H3ZFC3.mjs} +1 -1
  27. package/dist/{chunk-SMLUZGSI.mjs → chunk-V76B76ML.mjs} +3 -3
  28. package/dist/{direct-executor-WSZALYCV.mjs → direct-executor-7EROGEUZ.mjs} +1 -1
  29. package/dist/distribution.mjs +25 -25
  30. package/dist/index.browser.mjs +1 -1
  31. package/dist/index.mjs +1 -1
  32. package/dist/index.react-native.mjs +1 -1
  33. package/dist/{long-query-thread-N2DNPEA3.mjs → long-query-thread-DNQR25LY.mjs} +10 -10
  34. package/dist/{optional-writes-CGDBJBHQ.mjs → optional-writes-3CFEDQ7M.mjs} +3 -3
  35. package/dist/{paged-partition-archive-UK44CVXG.mjs → paged-partition-archive-YXXCF5WC.mjs} +9 -9
  36. package/dist/partial-words.browser.mjs +1 -1
  37. package/dist/partial-words.mjs +1 -1
  38. package/dist/persistence/durability/checkpoint-worker.mjs +7 -7
  39. package/dist/{query-actions-7BL3YZDW.mjs → query-actions-QCR7WPSV.mjs} +1 -1
  40. package/dist/query-suggestions/merge-worker.mjs +4 -4
  41. package/dist/query-suggestions.browser.mjs +1 -1
  42. package/dist/query-suggestions.mjs +2 -2
  43. package/dist/react-native/chunks/{chunk-LOKGE4OQ.mjs → chunk-2CDDI2XI.mjs} +2 -2
  44. package/dist/react-native/chunks/{chunk-63DZ26X5.mjs → chunk-FXZ3AFKS.mjs} +22 -13
  45. package/dist/react-native/chunks/{chunk-IP3QLETQ.mjs → chunk-HE4S2X7Q.mjs} +1 -1
  46. package/dist/react-native/chunks/{chunk-XHYOQ4K4.mjs → chunk-WDR5JEUM.mjs} +1 -1
  47. package/dist/react-native/chunks/{chunk-UYAZLGEM.mjs → chunk-YVCOZKVC.mjs} +1 -1
  48. package/dist/react-native/chunks/{chunk-BNFGA7TY.mjs → chunk-ZBY7QVQ5.mjs} +1 -1
  49. package/dist/react-native/chunks/{optional-writes-GC6JWMAF.mjs → optional-writes-ONME3PSY.mjs} +2 -2
  50. package/dist/react-native/chunks/{restore-queue-2ACONS4W.mjs → restore-queue-OGKLTLU5.mjs} +4 -4
  51. package/dist/react-native/chunks/{segment-codec-leaf-SSIWXVUG.mjs → segment-codec-leaf-PAE2HHEQ.mjs} +2 -2
  52. package/dist/react-native/chunks/{segment-merge-leaf-I2WDFE6O.mjs → segment-merge-leaf-72FIRC26.mjs} +3 -3
  53. package/dist/react-native/chunks/{storage-leaf-YXXMG4VR.mjs → storage-leaf-2T5ZTSNK.mjs} +73 -44
  54. package/dist/react-native/chunks/{store-leaf-FS7A4PZA.mjs → store-leaf-BC77ZO4Z.mjs} +3 -3
  55. package/dist/react-native/chunks/{suggestions-leaf-PSFCT5EX.mjs → suggestions-leaf-QL3H332L.mjs} +3 -3
  56. package/dist/react-native/chunks/{worker-copies-QRMISMEL.mjs → worker-copies-WIJCP6YJ.mjs} +2 -2
  57. package/dist/react-native/partial-words.mjs +1 -1
  58. package/dist/react-native/query-suggestions.mjs +1 -1
  59. package/dist/react-native/sync.mjs +1 -1
  60. package/dist/react-native/synonyms.mjs +1 -1
  61. package/dist/{rerank-4GFC26FD.mjs → rerank-GVUOXQCU.mjs} +1 -1
  62. package/dist/{restore-queue-E4EIUYVV.mjs → restore-queue-FVVCUHIY.mjs} +4 -4
  63. package/dist/{segment-codec-leaf-MP6DILVE.mjs → segment-codec-leaf-KXZPLILR.mjs} +2 -2
  64. package/dist/{segment-merge-leaf-ED2NMUC5.mjs → segment-merge-leaf-MLX5VM3E.mjs} +2 -2
  65. package/dist/server.mjs +15 -15
  66. package/dist/{storage-leaf-HQFO37W7.mjs → storage-leaf-S2RWQ63Q.mjs} +70 -57
  67. package/dist/{store-leaf-PL2G7RM5.mjs → store-leaf-JBMZL6QN.mjs} +3 -3
  68. package/dist/{suggestions-leaf-I3MEHACP.mjs → suggestions-leaf-MA2PUFB5.mjs} +5 -5
  69. package/dist/sync/filesystem.mjs +4 -4
  70. package/dist/sync.browser.mjs +1 -1
  71. package/dist/sync.mjs +1 -1
  72. package/dist/synonyms.browser.mjs +1 -1
  73. package/dist/synonyms.mjs +1 -1
  74. package/dist/{thread-LTFI3RK5.mjs → thread-LDS6OTXA.mjs} +9 -9
  75. package/dist/{worker-copies-P7YWXEP5.mjs → worker-copies-4T3SR5XZ.mjs} +4 -4
  76. package/dist/workers/entry.mjs +7 -7
  77. package/package.json +5 -5
@@ -19203,7 +19203,7 @@ var storageCode = codeLoader(async () => {
19203
19203
  loadSegmentMerge(),
19204
19204
  loadSuggestionStore(),
19205
19205
  loadVectorCore(),
19206
- import('./storage-leaf-N3JMQ6CF.mjs')
19206
+ import('./storage-leaf-KIPJKTWU.mjs')
19207
19207
  ]);
19208
19208
  code7.bindStorageHost(optionalCodeHost(), digest2, msgpack, segmentCodec2, segmentMerge2, suggestionStore2, vectorCore2);
19209
19209
  return code7;
@@ -20856,9 +20856,10 @@ function createAnalysisRebuildCoordinator(config, deps) {
20856
20856
  const rebuildMode = config?.rebuild ?? "auto";
20857
20857
  let queue = Promise.resolve();
20858
20858
  let active = null;
20859
+ let closed = false;
20859
20860
  async function rebuildNow(indexName, entry) {
20860
20861
  const manager = deps.getManager(indexName);
20861
- if (manager === void 0 || entry.abandoned) {
20862
+ if (manager === void 0 || entry.abandoned || closed) {
20862
20863
  entry.run = null;
20863
20864
  return;
20864
20865
  }
@@ -20910,7 +20911,7 @@ function createAnalysisRebuildCoordinator(config, deps) {
20910
20911
  }
20911
20912
  }
20912
20913
  function runTracked(indexName, entry) {
20913
- const done = rebuildNow(indexName, entry);
20914
+ const done = Promise.resolve().then(() => rebuildNow(indexName, entry));
20914
20915
  const tracked = { indexName, entry, done };
20915
20916
  active = tracked;
20916
20917
  return done.finally(() => {
@@ -20991,6 +20992,11 @@ function createAnalysisRebuildCoordinator(config, deps) {
20991
20992
  running.entry.abandoned = true;
20992
20993
  await running.done.catch(() => void 0);
20993
20994
  },
20995
+ async shutdown() {
20996
+ closed = true;
20997
+ for (const entry of stale.values()) entry.abandoned = true;
20998
+ await active?.done.catch(() => void 0);
20999
+ },
20994
21000
  review(indexName) {
20995
21001
  const entry = stale.get(indexName);
20996
21002
  return entry === void 0 ? Promise.resolve() : review(indexName, entry);
@@ -21881,6 +21887,7 @@ async function startEngineCore(core2, config) {
21881
21887
  }
21882
21888
  async function shutdownEngine(core2) {
21883
21889
  const { executor, durability, indexRegistry, eventHandlers, orchestrator } = core2;
21890
+ await core2.analysisRebuild.shutdown();
21884
21891
  await core2.querySuggestionHooks?.shutdown();
21885
21892
  core2.indexState.dispose();
21886
21893
  if (durability) {
@@ -23126,6 +23133,7 @@ function createNarsilFromCore(core2, config) {
23126
23133
  }
23127
23134
  }
23128
23135
  const rebalancesStarting = /* @__PURE__ */ new Map();
23136
+ let shutdownPromise = null;
23129
23137
  function withOpenIndexWrite(indexName, action) {
23130
23138
  const starting = rebalancesStarting.get(indexName);
23131
23139
  const written = starting === void 0 ? withOpenIndex2(indexName, action) : starting.then(() => withOpenIndex2(indexName, action));
@@ -23382,11 +23390,12 @@ function createNarsilFromCore(core2, config) {
23382
23390
  if (handlers.size === 0) eventHandlers.delete(key);
23383
23391
  }
23384
23392
  },
23385
- async shutdown() {
23386
- if (shutdownState.isShutdown) return;
23393
+ shutdown() {
23394
+ if (shutdownPromise !== null) return shutdownPromise;
23387
23395
  shutdownState.isShutdown = true;
23396
+ shutdownPromise = Promise.resolve().then(() => shutdownEngine(core2));
23388
23397
  abortController.abort();
23389
- await shutdownEngine(core2);
23398
+ return shutdownPromise;
23390
23399
  }
23391
23400
  };
23392
23401
  bindEngineCore(narsil, core2);
@@ -8465,6 +8465,22 @@ function frameRecord(entry) {
8465
8465
  view.setUint32(RECORD_LENGTH_SIZE + payload.length, crc32(payload), false);
8466
8466
  return frame;
8467
8467
  }
8468
+ function joinFrames(frames) {
8469
+ if (frames.length === 1) {
8470
+ return frames[0];
8471
+ }
8472
+ let totalBytes = 0;
8473
+ for (const frame of frames) {
8474
+ totalBytes += frame.length;
8475
+ }
8476
+ const joined4 = new Uint8Array(totalBytes);
8477
+ let offset = 0;
8478
+ for (const frame of frames) {
8479
+ joined4.set(frame, offset);
8480
+ offset += frame.length;
8481
+ }
8482
+ return joined4;
8483
+ }
8468
8484
  function checkSegmentHeader(data) {
8469
8485
  if (data.length < SEGMENT_HEADER_SIZE) {
8470
8486
  return { ok: false, reason: "segment shorter than the 8-byte header", code: ErrorCodes.PERSISTENCE_WAL_CORRUPT };
@@ -17058,6 +17074,8 @@ function createWalWriter(directory, config) {
17058
17074
  let highestDurableSeqNo = 0;
17059
17075
  let markerWriter = null;
17060
17076
  let durabilityLock = Promise.resolve();
17077
+ let synced = null;
17078
+ let failure = null;
17061
17079
  const coordinator = createGroupCommitCoordinator(() => withDurabilityLock(flushActiveSegment));
17062
17080
  function withDurabilityLock(fn) {
17063
17081
  const result = durabilityLock.then(fn);
@@ -17080,18 +17098,37 @@ function createWalWriter(directory, config) {
17080
17098
  }
17081
17099
  return markerWriter;
17082
17100
  }
17101
+ function latchFailure(err) {
17102
+ if (failure === null) {
17103
+ failure = { error: err };
17104
+ }
17105
+ return failure.error;
17106
+ }
17083
17107
  async function flushActiveSegment() {
17084
- if (handle === null) {
17108
+ if (failure !== null) {
17109
+ throw failure.error;
17110
+ }
17111
+ const flushing = handle;
17112
+ if (flushing === null) {
17085
17113
  return;
17086
17114
  }
17087
- const writer = await getMarkerWriter();
17088
17115
  const durableByteLength = activeBytes;
17089
17116
  const activeSegmentSeqNo = activeStartSeqNo;
17090
- const durableSeqNo = Math.max(highestAppendedSeqNo, highestDurableSeqNo);
17091
- await handle.sync();
17092
- await writer.commit({ activeSegmentSeqNo, durableByteLength, highestDurableSeqNo: durableSeqNo });
17093
- if (durableSeqNo > highestDurableSeqNo) {
17094
- highestDurableSeqNo = durableSeqNo;
17117
+ const appendedSeqNo = highestAppendedSeqNo;
17118
+ if (synced !== null && synced.startSeqNo === activeSegmentSeqNo && synced.bytes === durableByteLength) {
17119
+ return;
17120
+ }
17121
+ try {
17122
+ const writer = await getMarkerWriter();
17123
+ const durableSeqNo = Math.max(appendedSeqNo, highestDurableSeqNo);
17124
+ await flushing.sync();
17125
+ await writer.commit({ activeSegmentSeqNo, durableByteLength, highestDurableSeqNo: durableSeqNo });
17126
+ if (durableSeqNo > highestDurableSeqNo) {
17127
+ highestDurableSeqNo = durableSeqNo;
17128
+ }
17129
+ synced = { startSeqNo: activeSegmentSeqNo, bytes: durableByteLength };
17130
+ } catch (err) {
17131
+ throw latchFailure(err);
17095
17132
  }
17096
17133
  }
17097
17134
  function formatVersionFor(holdsPreviousDocument) {
@@ -17194,22 +17231,30 @@ function createWalWriter(directory, config) {
17194
17231
  }
17195
17232
  }
17196
17233
  async function swapToPreparedSegment(sealed) {
17197
- const writer = await getMarkerWriter();
17198
- const startSeqNo = highestAppendedSeqNo + 1;
17199
- const durableSeqNo = Math.max(highestAppendedSeqNo, highestDurableSeqNo);
17200
- const key = segmentKey2(config.indexName, config.partitionId, startSeqNo);
17201
- await Promise.all([sealed.sync(), directory.move(preparedKey, key)]);
17202
- handle = await directory.appendHandle(key);
17203
- activeKey = key;
17204
- activeStartSeqNo = startSeqNo;
17205
- activeBytes = SEGMENT_HEADER_SIZE;
17206
- activeFormatVersion = preparedFormatVersion;
17207
- await writer.commit({
17208
- activeSegmentSeqNo: startSeqNo,
17209
- durableByteLength: SEGMENT_HEADER_SIZE,
17210
- highestDurableSeqNo: durableSeqNo
17211
- });
17212
- highestDurableSeqNo = durableSeqNo;
17234
+ if (failure !== null) {
17235
+ throw failure.error;
17236
+ }
17237
+ try {
17238
+ const writer = await getMarkerWriter();
17239
+ const startSeqNo = highestAppendedSeqNo + 1;
17240
+ const durableSeqNo = Math.max(highestAppendedSeqNo, highestDurableSeqNo);
17241
+ const key = segmentKey2(config.indexName, config.partitionId, startSeqNo);
17242
+ await Promise.all([sealed.sync(), directory.move(preparedKey, key)]);
17243
+ handle = await directory.appendHandle(key);
17244
+ activeKey = key;
17245
+ activeStartSeqNo = startSeqNo;
17246
+ activeBytes = SEGMENT_HEADER_SIZE;
17247
+ activeFormatVersion = preparedFormatVersion;
17248
+ await writer.commit({
17249
+ activeSegmentSeqNo: startSeqNo,
17250
+ durableByteLength: SEGMENT_HEADER_SIZE,
17251
+ highestDurableSeqNo: durableSeqNo
17252
+ });
17253
+ highestDurableSeqNo = durableSeqNo;
17254
+ synced = { startSeqNo, bytes: SEGMENT_HEADER_SIZE };
17255
+ } catch (err) {
17256
+ throw latchFailure(err);
17257
+ }
17213
17258
  await sealed.close();
17214
17259
  }
17215
17260
  async function maybeRoll(nextSeqNo, appendedBytes, holdsPreviousDocument) {
@@ -17220,22 +17265,6 @@ function createWalWriter(directory, config) {
17220
17265
  await withDurabilityLock(() => rollUnderLock(nextSeqNo, formatVersionFor(holdsPreviousDocument)));
17221
17266
  }
17222
17267
  }
17223
- function joinFrames(frames) {
17224
- if (frames.length === 1) {
17225
- return frames[0];
17226
- }
17227
- let totalBytes = 0;
17228
- for (const frame of frames) {
17229
- totalBytes += frame.length;
17230
- }
17231
- const joined4 = new Uint8Array(totalBytes);
17232
- let offset = 0;
17233
- for (const frame of frames) {
17234
- joined4.set(frame, offset);
17235
- offset += frame.length;
17236
- }
17237
- return joined4;
17238
- }
17239
17268
  function framesThatFit(frames, start) {
17240
17269
  const room = segmentMaxBytes - activeBytes;
17241
17270
  let end = start + 1;
@@ -1,7 +1,7 @@
1
1
  import { restoredEmbedding, restoredPartitionConfig, readSharedConfigFields } from './chunk-M2Z5WVWW.mjs';
2
2
  import { MAX_PARTITION_COUNT, MAX_REPLICATION_FACTOR } from './chunk-JDDXV6UF.mjs';
3
- import { storedStateOf } from './chunk-KOA6T2IC.mjs';
4
- import { getLanguage, generateId, decodeSynonymRules } from './chunk-HSA3H3VW.mjs';
3
+ import { storedStateOf } from './chunk-SUFAI37B.mjs';
4
+ import { getLanguage, generateId, decodeSynonymRules } from './chunk-K2KNE7W2.mjs';
5
5
  import { decode } from './chunk-GXCDWLQI.mjs';
6
6
  import { isSyncEpoch } from './chunk-BUMREPLU.mjs';
7
7
  import { MAX_INDEX_NAME_LENGTH, INDEX_NAME_PATTERN } from './chunk-3ECIRFS5.mjs';
@@ -1,4 +1,4 @@
1
- import { loadStorageCode, resolvePartialWordAnalysis, resolvePartitionInsertOptions, yieldToEventLoop, createPartitionIndex, writePartitionDocument } from './chunk-HSA3H3VW.mjs';
1
+ import { loadStorageCode, resolvePartialWordAnalysis, resolvePartitionInsertOptions, yieldToEventLoop, createPartitionIndex, writePartitionDocument } from './chunk-K2KNE7W2.mjs';
2
2
 
3
3
  // src/partitioning/constants.ts
4
4
  var REBALANCE_CHUNK_SIZE = 1e3;
@@ -1,4 +1,4 @@
1
- import { readRecentMemoryFigures, readMemoryFigures } from './chunk-HSA3H3VW.mjs';
1
+ import { readRecentMemoryFigures, readMemoryFigures } from './chunk-K2KNE7W2.mjs';
2
2
  import { collectGarbageBeforeAnswerRefusal, collectYoungGenerationBeforeRefusal, reservedHeapBytes, admitHeapBytes } from './chunk-AOYQTX6W.mjs';
3
3
  import { NarsilError, ErrorCodes, ServerErrorCodes } from './chunk-ZKOQR7EA.mjs';
4
4
 
@@ -1,12 +1,12 @@
1
- import { PAGED_SEGMENT_ENVELOPE_VERSION, loadFailed, checkEverySectionPage, openPagedFile, sectionNamed, createSectionReader, closePagedFile, readWholeSectionChecked, readCacheOfThisThread, createReadCache, MERGE_READ_CACHE_BYTES, encodePagedSegmentHead, SECTION_ALIGNMENT_BYTES, SEGMENT_PAGE_BYTES, FILE_ASSEMBLY_CHUNK_BYTES, readListedFile, requireListedChecksum, encodeSegmentManifest, requireNativePage, ID_SAMPLE_INTERVAL, SMALLEST_BLOCK_POSTINGS, readFileRange, PAYLOAD_PREFIX_BYTES, decodePagedSegmentHead, BLOCK_SUMMARY_BYTES, DOCUMENT_BLOCK_BYTES, MAX_DOCUMENT_BLOCK_RAW_BYTES, resumePagedFile, suspendPagedFile, cachedFileBytes, LIST_VIEWS_HELD_PER_SEGMENT, WRITER_YIELD_INTERVAL_TOKENS, DOCUMENT_BLOCK_MIN_RAW_BYTES, CACHED_POSITIONS, POSITION_WIDTH_BYTES, CACHED_LIST, POSTING_WIDTH_BYTES, readFileRangeLater, CACHED_DOCUMENT_BLOCK, failNativePage, REMOVAL_BUCKET_WRITE_BUFFER_BYTES, POSTING_WRITE_ROWS, POSTING_WRITE_POSITIONS, SECTION_WRITE_BUFFER_BYTES, LARGEST_REMOVAL_BUCKET_COUNT, REMOVAL_BUCKET_TARGET_BYTES, MERGED_SEGMENT_GROWTH_ALLOWANCE, MERGED_SEGMENT_TARGET_BYTES } from './chunk-3N5GUXBI.mjs';
1
+ import { PAGED_SEGMENT_ENVELOPE_VERSION, loadFailed, checkEverySectionPage, openPagedFile, sectionNamed, createSectionReader, closePagedFile, readWholeSectionChecked, readCacheOfThisThread, createReadCache, MERGE_READ_CACHE_BYTES, encodePagedSegmentHead, SECTION_ALIGNMENT_BYTES, SEGMENT_PAGE_BYTES, FILE_ASSEMBLY_CHUNK_BYTES, readListedFile, requireListedChecksum, encodeSegmentManifest, requireNativePage, ID_SAMPLE_INTERVAL, SMALLEST_BLOCK_POSTINGS, readFileRange, PAYLOAD_PREFIX_BYTES, decodePagedSegmentHead, BLOCK_SUMMARY_BYTES, DOCUMENT_BLOCK_BYTES, MAX_DOCUMENT_BLOCK_RAW_BYTES, resumePagedFile, suspendPagedFile, cachedFileBytes, LIST_VIEWS_HELD_PER_SEGMENT, WRITER_YIELD_INTERVAL_TOKENS, DOCUMENT_BLOCK_MIN_RAW_BYTES, CACHED_POSITIONS, POSITION_WIDTH_BYTES, CACHED_LIST, POSTING_WIDTH_BYTES, readFileRangeLater, CACHED_DOCUMENT_BLOCK, failNativePage, REMOVAL_BUCKET_WRITE_BUFFER_BYTES, POSTING_WRITE_ROWS, POSTING_WRITE_POSITIONS, SECTION_WRITE_BUFFER_BYTES, LARGEST_REMOVAL_BUCKET_COUNT, REMOVAL_BUCKET_TARGET_BYTES, MERGED_SEGMENT_GROWTH_ALLOWANCE, MERGED_SEGMENT_TARGET_BYTES } from './chunk-V24XTYHX.mjs';
2
2
  import { ReplicationMessageTypes } from './chunk-5FLRXF73.mjs';
3
3
  import { WIRE_BATCH_BUDGET } from './chunk-JDDXV6UF.mjs';
4
- import { SEGMENT_MANIFEST_VERSION, manifestKey, manifestReferencedKeys, segmentsPrefix, snapshotBundleKey, MAX_SEGMENTS_PER_PARTITION, segmentKey } from './chunk-TSE2VWPX.mjs';
4
+ import { SEGMENT_MANIFEST_VERSION, manifestKey, manifestReferencedKeys, segmentsPrefix, snapshotBundleKey, MAX_SEGMENTS_PER_PARTITION, segmentKey } from './chunk-FIMLVUHE.mjs';
5
5
  import { DEFAULT_REWRITE_BYTES_PER_CHECKPOINT, DEFAULT_COMPACTION_THRESHOLD, SEGMENT_FILE_FRAMING_SLACK_BYTES, REWRITE_ABOVE_REMOVED_DOCUMENT_SHARE, COMPACTION_LARGEST_MERGED_DOCUMENT_COUNT, SEGMENT_TOKEN_TABLE_SHARE_OF_FILE } from './chunk-MSIN4NM3.mjs';
6
6
  import { encode } from './chunk-S5QMWECL.mjs';
7
7
  import { restoreVectorFields } from './chunk-R2PJKSNL.mjs';
8
- import { requireWithinFileLimit, HEADER_SIZE, crc32Init, crc32Update, crc32Final, engineVersionParts, writeHeader, crc32, openChecksummedEnvelope, readHeader, packChecksummedEnvelope } from './chunk-KOA6T2IC.mjs';
9
- import { decodeStoredDocument, generateId, wrapFrozenTokenTable, createEncodedDocumentSource, assemblePagedFrozenSegment, buildPartialWordTableFrom, mergeFieldIndexes, isCompositePartition, reconstructSchemaFromMetadata, decodeSurfaceTable, mergeDocFrequencies, TermLookup, createFrozenRemovals, selectionKeeps, fieldIndexRemapOf, mergeKeywordSources, mergeSourceSpellings, mergeSourceSurfaces, mergedPartialSpellings, createSharedFrozenSegment, shareSegmentArrays, getLanguage, emptyPendingRegions, mergePostings2, scanPostingBlocks, holdsADiscardedField, SegmentRefusal, survivorDocumentsOf, partitionStateOf, freezeSegmentShared, createFrozenSegment, createPartitionManager, createPartitionRouter, buildSegmentPayloads, resolvePartitionInsertOptions, endOfValue, segmentArraysOf, mergeSegmentContents, decodeMapWithoutFields, prepareDocumentVectors, resolveIndexAnalysis } from './chunk-HSA3H3VW.mjs';
8
+ import { requireWithinFileLimit, HEADER_SIZE, crc32Init, crc32Update, crc32Final, engineVersionParts, writeHeader, crc32, openChecksummedEnvelope, readHeader, packChecksummedEnvelope } from './chunk-SUFAI37B.mjs';
9
+ import { decodeStoredDocument, generateId, wrapFrozenTokenTable, createEncodedDocumentSource, assemblePagedFrozenSegment, buildPartialWordTableFrom, mergeFieldIndexes, isCompositePartition, reconstructSchemaFromMetadata, decodeSurfaceTable, mergeDocFrequencies, TermLookup, createFrozenRemovals, selectionKeeps, fieldIndexRemapOf, mergeKeywordSources, mergeSourceSpellings, mergeSourceSurfaces, mergedPartialSpellings, createSharedFrozenSegment, shareSegmentArrays, getLanguage, emptyPendingRegions, mergePostings2, scanPostingBlocks, holdsADiscardedField, SegmentRefusal, survivorDocumentsOf, partitionStateOf, freezeSegmentShared, createFrozenSegment, createPartitionManager, createPartitionRouter, buildSegmentPayloads, resolvePartitionInsertOptions, endOfValue, segmentArraysOf, mergeSegmentContents, decodeMapWithoutFields, prepareDocumentVectors, resolveIndexAnalysis } from './chunk-K2KNE7W2.mjs';
10
10
  import { encodeDocument } from './chunk-2CKDCC65.mjs';
11
11
  import { decode } from './chunk-GXCDWLQI.mjs';
12
12
  import { extractVectorFieldsFromSchema, VECTOR_PATTERN, requireValidFieldTypes, partialFieldsOf, messagePackUpperBoundBytes } from './chunk-7P5YWDRQ.mjs';
@@ -4123,6 +4123,22 @@ function frameRecord(entry) {
4123
4123
  view.setUint32(RECORD_LENGTH_SIZE + payload.length, crc32(payload), false);
4124
4124
  return frame;
4125
4125
  }
4126
+ function joinFrames(frames) {
4127
+ if (frames.length === 1) {
4128
+ return frames[0];
4129
+ }
4130
+ let totalBytes = 0;
4131
+ for (const frame of frames) {
4132
+ totalBytes += frame.length;
4133
+ }
4134
+ const joined = new Uint8Array(totalBytes);
4135
+ let offset = 0;
4136
+ for (const frame of frames) {
4137
+ joined.set(frame, offset);
4138
+ offset += frame.length;
4139
+ }
4140
+ return joined;
4141
+ }
4126
4142
  function checkSegmentHeader(data) {
4127
4143
  if (data.length < SEGMENT_HEADER_SIZE) {
4128
4144
  return { ok: false, reason: "segment shorter than the 8-byte header", code: ErrorCodes.PERSISTENCE_WAL_CORRUPT };
@@ -4989,4 +5005,4 @@ async function removeCheckpointGarbage(store, garbage) {
4989
5005
  }
4990
5006
  }
4991
5007
 
4992
- export { DEFAULT_LOG_RETENTION_BYTES, FRAME_CRC_SIZE, INSYNC_CAS_ATTEMPTS, KEYWORD_SEGMENT_ENVELOPE_VERSION, MAX_WAL_RECORD_BYTES, NOTHING_SAVED, RECORD_LENGTH_SIZE, SEGMENT_HEADER_SIZE, SEGMENT_TAIL_PATTERN, SNAPSHOT_CHUNK_SIZE, WAL_FORMAT_VERSION, WAL_FORMAT_VERSION_WITH_PREVIOUS_DOCUMENT, buildEntry, bytesThatSegmentsHoldInMemory, captureWholePartition, checkPagedContents, checkPagedSegmentFully, checkPagedSelections, checkSegmentHeader, checkpointGarbage, checkpointLastSeqNo, checkpointPrimaryTerm, commitCheckpointManifest, computeEntryChecksum, countsAsLatestHolder, createAckMessage, createEntryBatchMessage, createEntryMessage, createForwardBatchMessage, createForwardBatchResultMessage, createForwardMessage, createInsyncAddMessage, createInsyncConfirmMessage, createInsyncRemoveMessage, createPagedFrozenSegment, createPrimaryResignMessage, decodeKeywordSegment, decodeWalEntry, durableRecordMissing, encodeMarkerSlot, entryByteEstimate, frameRecord, isPagedSegmentFile, markerSlotOffset, mergePagedWindow, nextMarkerSlot, nextSegmentKey, openPagedSegmentScan, openPagedSnapshot, optionalIndexUuid, pagedListingOf, pagedTombstonesFor, parseSegmentStartSeqNo, partitionContentsOf, readCommitMarker, readSegmentFile, readWalSegments, removeCheckpointGarbage, removeUnusedSegmentFiles, residentSectionsOf, rewrittenHeaderKey, savedBytesOfManifest, segmentKey2 as segmentKey, validateAckPayload, validateEntryBatchPayload, validateEntryPayload, validateForwardBatchPayload, validateForwardBatchResultPayload, validateInsyncConfirmPayload, writeCheckpointSegments, writePagedSegment, writeSegmentHeader };
5008
+ export { DEFAULT_LOG_RETENTION_BYTES, FRAME_CRC_SIZE, INSYNC_CAS_ATTEMPTS, KEYWORD_SEGMENT_ENVELOPE_VERSION, MAX_WAL_RECORD_BYTES, NOTHING_SAVED, RECORD_LENGTH_SIZE, SEGMENT_HEADER_SIZE, SEGMENT_TAIL_PATTERN, SNAPSHOT_CHUNK_SIZE, WAL_FORMAT_VERSION, WAL_FORMAT_VERSION_WITH_PREVIOUS_DOCUMENT, buildEntry, bytesThatSegmentsHoldInMemory, captureWholePartition, checkPagedContents, checkPagedSegmentFully, checkPagedSelections, checkSegmentHeader, checkpointGarbage, checkpointLastSeqNo, checkpointPrimaryTerm, commitCheckpointManifest, computeEntryChecksum, countsAsLatestHolder, createAckMessage, createEntryBatchMessage, createEntryMessage, createForwardBatchMessage, createForwardBatchResultMessage, createForwardMessage, createInsyncAddMessage, createInsyncConfirmMessage, createInsyncRemoveMessage, createPagedFrozenSegment, createPrimaryResignMessage, decodeKeywordSegment, decodeWalEntry, durableRecordMissing, encodeMarkerSlot, entryByteEstimate, frameRecord, isPagedSegmentFile, joinFrames, markerSlotOffset, mergePagedWindow, nextMarkerSlot, nextSegmentKey, openPagedSegmentScan, openPagedSnapshot, optionalIndexUuid, pagedListingOf, pagedTombstonesFor, parseSegmentStartSeqNo, partitionContentsOf, readCommitMarker, readSegmentFile, readWalSegments, removeCheckpointGarbage, removeUnusedSegmentFiles, residentSectionsOf, rewrittenHeaderKey, savedBytesOfManifest, segmentKey2 as segmentKey, validateAckPayload, validateEntryBatchPayload, validateEntryPayload, validateForwardBatchPayload, validateForwardBatchResultPayload, validateInsyncConfirmPayload, writeCheckpointSegments, writePagedSegment, writeSegmentHeader };
@@ -1,18 +1,18 @@
1
- import { loadVectorField, openColdVectorField, VECTOR_FILE_ENVELOPE_VERSION, GRAPH_PART_ENVELOPE_VERSION } from './chunk-SMLUZGSI.mjs';
2
- import { engineChangeSource, ChangeCursor, createSemaphore, changePositionList, changesNotEnabled, previousDocumentRequired, invalidPositions, changePositionsOf, requireConfigurationShape, RESTORE_ESTIMATE_MARGIN, persistEpochStates, RESTORE_WORST_EXTERNAL_BYTES_PER_VECTOR_DIMENSION, RESTORE_WORST_EXTERNAL_BYTES_PER_VECTOR, RESTORE_WORST_EXTERNAL_BYTES_PER_STORED_BYTE, RESTORE_WORST_HEAP_BYTES_PER_VECTOR_DIMENSION, RESTORE_WORST_HEAP_BYTES_PER_VECTOR, RESTORE_WORST_HEAP_BYTES_PER_STORED_BYTE, RESTORE_FLOOR_EXTERNAL_BYTES_PER_VECTOR_DIMENSION, RESTORE_FLOOR_EXTERNAL_BYTES_PER_VECTOR, RESTORE_FLOOR_EXTERNAL_BYTES_PER_STORED_BYTE, RESTORE_FLOOR_HEAP_BYTES_PER_VECTOR_DIMENSION, RESTORE_FLOOR_HEAP_BYTES_PER_VECTOR, RESTORE_FLOOR_HEAP_BYTES_PER_STORED_BYTE, RESTORE_WORST_EXTERNAL_BYTES_PER_EARLIER_SNAPSHOT_VECTOR_DIMENSION, RESTORE_WORST_EXTERNAL_BYTES_PER_EARLIER_SNAPSHOT_VECTOR, RESTORE_WORST_EXTERNAL_BYTES_PER_EARLIER_SNAPSHOT_BYTE, RESTORE_WORST_HEAP_BYTES_PER_EARLIER_SNAPSHOT_VECTOR_DIMENSION, RESTORE_WORST_HEAP_BYTES_PER_EARLIER_SNAPSHOT_VECTOR, RESTORE_WORST_HEAP_BYTES_PER_EARLIER_SNAPSHOT_BYTE, RESTORE_FLOOR_EXTERNAL_BYTES_PER_EARLIER_SNAPSHOT_VECTOR_DIMENSION, RESTORE_FLOOR_EXTERNAL_BYTES_PER_EARLIER_SNAPSHOT_VECTOR, RESTORE_FLOOR_EXTERNAL_BYTES_PER_EARLIER_SNAPSHOT_BYTE, RESTORE_FLOOR_HEAP_BYTES_PER_EARLIER_SNAPSHOT_VECTOR_DIMENSION, RESTORE_FLOOR_HEAP_BYTES_PER_EARLIER_SNAPSHOT_VECTOR, RESTORE_FLOOR_HEAP_BYTES_PER_EARLIER_SNAPSHOT_BYTE } from './chunk-K5GNK5GE.mjs';
1
+ import { loadVectorField, openColdVectorField, VECTOR_FILE_ENVELOPE_VERSION, GRAPH_PART_ENVELOPE_VERSION } from './chunk-V76B76ML.mjs';
2
+ import { engineChangeSource, ChangeCursor, createSemaphore, changePositionList, changesNotEnabled, previousDocumentRequired, invalidPositions, changePositionsOf, requireConfigurationShape, RESTORE_ESTIMATE_MARGIN, persistEpochStates, RESTORE_WORST_EXTERNAL_BYTES_PER_VECTOR_DIMENSION, RESTORE_WORST_EXTERNAL_BYTES_PER_VECTOR, RESTORE_WORST_EXTERNAL_BYTES_PER_STORED_BYTE, RESTORE_WORST_HEAP_BYTES_PER_VECTOR_DIMENSION, RESTORE_WORST_HEAP_BYTES_PER_VECTOR, RESTORE_WORST_HEAP_BYTES_PER_STORED_BYTE, RESTORE_FLOOR_EXTERNAL_BYTES_PER_VECTOR_DIMENSION, RESTORE_FLOOR_EXTERNAL_BYTES_PER_VECTOR, RESTORE_FLOOR_EXTERNAL_BYTES_PER_STORED_BYTE, RESTORE_FLOOR_HEAP_BYTES_PER_VECTOR_DIMENSION, RESTORE_FLOOR_HEAP_BYTES_PER_VECTOR, RESTORE_FLOOR_HEAP_BYTES_PER_STORED_BYTE, RESTORE_WORST_EXTERNAL_BYTES_PER_EARLIER_SNAPSHOT_VECTOR_DIMENSION, RESTORE_WORST_EXTERNAL_BYTES_PER_EARLIER_SNAPSHOT_VECTOR, RESTORE_WORST_EXTERNAL_BYTES_PER_EARLIER_SNAPSHOT_BYTE, RESTORE_WORST_HEAP_BYTES_PER_EARLIER_SNAPSHOT_VECTOR_DIMENSION, RESTORE_WORST_HEAP_BYTES_PER_EARLIER_SNAPSHOT_VECTOR, RESTORE_WORST_HEAP_BYTES_PER_EARLIER_SNAPSHOT_BYTE, RESTORE_FLOOR_EXTERNAL_BYTES_PER_EARLIER_SNAPSHOT_VECTOR_DIMENSION, RESTORE_FLOOR_EXTERNAL_BYTES_PER_EARLIER_SNAPSHOT_VECTOR, RESTORE_FLOOR_EXTERNAL_BYTES_PER_EARLIER_SNAPSHOT_BYTE, RESTORE_FLOOR_HEAP_BYTES_PER_EARLIER_SNAPSHOT_VECTOR_DIMENSION, RESTORE_FLOOR_HEAP_BYTES_PER_EARLIER_SNAPSHOT_VECTOR, RESTORE_FLOOR_HEAP_BYTES_PER_EARLIER_SNAPSHOT_BYTE } from './chunk-TQ5EEJEO.mjs';
3
3
  import { restoredConfigFields, restoredEmbedding } from './chunk-M2Z5WVWW.mjs';
4
- import { ENTRIES_MESSAGE_LIMIT_BYTES, FEED_HEAD_RETRY_MS, decodeSegmentManifest, isRecord, isUint32, isSequenceNumber, ARCHIVE_CONFIG_ENTRY, ARCHIVE_MANIFEST_ENTRY, tarEnd, tarEntryHeaders, tarPadding, ARCHIVE_FILE_CHUNK_BYTES } from './chunk-Z6SIJH5O.mjs';
5
- import { isPagedSegmentFile, openPagedSegmentScan, countsAsLatestHolder, writeCheckpointSegments, commitCheckpointManifest, readSegmentFile, readCommitMarker, nextMarkerSlot, encodeMarkerSlot, markerSlotOffset, removeUnusedSegmentFiles, readWalSegments, durableRecordMissing, checkpointLastSeqNo, pagedListingOf, residentSectionsOf, partitionContentsOf, checkPagedSegmentFully, openPagedSnapshot, createPagedFrozenSegment, SEGMENT_HEADER_SIZE, KEYWORD_SEGMENT_ENVELOPE_VERSION, decodeKeywordSegment } from './chunk-D2EJUM4A.mjs';
6
- import { decodeSections, READS_AHEAD_AT_ONCE, readFileRangeLater, SEGMENT_PAGE_BYTES, RECORD_PAGE_BYTES, READ_AHEAD_CHUNK_BYTES, STABLE_HEAD_ATTEMPTS, directoryCheckpointStore } from './chunk-3N5GUXBI.mjs';
7
- import { manifestKey, segmentsPrefix, vectorFileKey, manifestFileRefs, graphPartKey } from './chunk-TSE2VWPX.mjs';
4
+ import { ENTRIES_MESSAGE_LIMIT_BYTES, FEED_HEAD_RETRY_MS, decodeSegmentManifest, isRecord, isUint32, isSequenceNumber, ARCHIVE_CONFIG_ENTRY, ARCHIVE_MANIFEST_ENTRY, tarEnd, tarEntryHeaders, tarPadding, ARCHIVE_FILE_CHUNK_BYTES } from './chunk-NTO2EMWZ.mjs';
5
+ import { isPagedSegmentFile, openPagedSegmentScan, countsAsLatestHolder, writeCheckpointSegments, commitCheckpointManifest, readSegmentFile, readCommitMarker, nextMarkerSlot, encodeMarkerSlot, markerSlotOffset, removeUnusedSegmentFiles, readWalSegments, durableRecordMissing, checkpointLastSeqNo, pagedListingOf, residentSectionsOf, partitionContentsOf, checkPagedSegmentFully, openPagedSnapshot, createPagedFrozenSegment, SEGMENT_HEADER_SIZE, KEYWORD_SEGMENT_ENVELOPE_VERSION, decodeKeywordSegment } from './chunk-2WKZM3FS.mjs';
6
+ import { decodeSections, READS_AHEAD_AT_ONCE, readFileRangeLater, SEGMENT_PAGE_BYTES, RECORD_PAGE_BYTES, READ_AHEAD_CHUNK_BYTES, STABLE_HEAD_ATTEMPTS, directoryCheckpointStore } from './chunk-V24XTYHX.mjs';
7
+ import { manifestKey, segmentsPrefix, vectorFileKey, manifestFileRefs, graphPartKey } from './chunk-FIMLVUHE.mjs';
8
8
  import { DEFAULT_COMPACTION_THRESHOLD } from './chunk-MSIN4NM3.mjs';
9
9
  import { encode } from './chunk-S5QMWECL.mjs';
10
10
  import { setNestedValue, restoreVectorFields } from './chunk-R2PJKSNL.mjs';
11
- import { DEFAULT_WRITE_AHEAD_QUEUE_MAX_SIZE, rewriteSpillOf, REBALANCE_CHUNK_SIZE, rebuildTextIndexes, textRebuildTargetOf } from './chunk-62X472AC.mjs';
11
+ import { DEFAULT_WRITE_AHEAD_QUEUE_MAX_SIZE, rewriteSpillOf, REBALANCE_CHUNK_SIZE, rebuildTextIndexes, textRebuildTargetOf } from './chunk-23WLACOL.mjs';
12
12
  import { DEFAULT_VECTOR_METRIC, defaultQuantizationFor, vectorsPerFile, vectorsToBytes, VECTOR_FILE_PAYLOAD_VERSION, decodeVectorFilePayload, isDead, bytesToVectors } from './chunk-KBU3ZFJN.mjs';
13
13
  import { oneSyncChangeAtATime } from './chunk-V6EUBAIT.mjs';
14
- import { openChecksummedEnvelope, HEADER_SIZE, packChecksummedEnvelope, packEnvelopeWithChecksum, checksumOfChunks, readHeader, crc32, engineVersionParts, writeHeader, storedStateToWire, storedStateFromWire } from './chunk-KOA6T2IC.mjs';
15
- import { resolveIndexAnalysis, getLanguage, emitEngineEvent, reconstructSchemaFromMetadata, prepareStoredSynonyms, rulesOfStoredSynonyms, resolvePartialWordAnalysis, oversizedConfigurationPayloadOf, requireEncodedConfigurationWithinSizeLimit, loadSchemaCodeFor, VERSION, DEFAULT_BM25_B, DEFAULT_BM25_K1, decodeEveryStoredDocument, createSharedFrozenSegment, shareSegmentArrays, removeDocumentVectors, prepareDocumentVectors, insertDocumentVectors, noteDocumentChurn, createPartitionIndex, writePartitionDocument, yieldToEventLoop, createPublicationGate, removedSurfaceSpellings, readHeapStatistics, readResidentMemory, prepareConfiguredSynonyms, withOpenIndex, loadGzip, prepareRemovalText, prepareDocumentText, updateDocumentVectors, holdSyncEpochChange, decodeStoredDocument, emitSyncChange, ARRAY_POSITION_GAP } from './chunk-HSA3H3VW.mjs';
14
+ import { openChecksummedEnvelope, HEADER_SIZE, packChecksummedEnvelope, packEnvelopeWithChecksum, checksumOfChunks, readHeader, crc32, engineVersionParts, writeHeader, storedStateToWire, storedStateFromWire } from './chunk-SUFAI37B.mjs';
15
+ import { resolveIndexAnalysis, getLanguage, emitEngineEvent, reconstructSchemaFromMetadata, prepareStoredSynonyms, rulesOfStoredSynonyms, resolvePartialWordAnalysis, oversizedConfigurationPayloadOf, requireEncodedConfigurationWithinSizeLimit, loadSchemaCodeFor, VERSION, DEFAULT_BM25_B, DEFAULT_BM25_K1, decodeEveryStoredDocument, createSharedFrozenSegment, shareSegmentArrays, removeDocumentVectors, prepareDocumentVectors, insertDocumentVectors, noteDocumentChurn, createPartitionIndex, writePartitionDocument, yieldToEventLoop, createPublicationGate, removedSurfaceSpellings, readHeapStatistics, readResidentMemory, prepareConfiguredSynonyms, withOpenIndex, loadGzip, prepareRemovalText, prepareDocumentText, updateDocumentVectors, holdSyncEpochChange, decodeStoredDocument, emitSyncChange, ARRAY_POSITION_GAP } from './chunk-K2KNE7W2.mjs';
16
16
  import { decode } from './chunk-GXCDWLQI.mjs';
17
17
  import { isSyncEpoch, newSyncEpoch } from './chunk-BUMREPLU.mjs';
18
18
  import { extractVectorFieldsFromSchema, flattenSchema, VECTOR_PATTERN, validateDocument, validateDocumentStrict, schemaFieldsOf, parseVectorDimension, requireValidFieldTypes, isQuantizationMode, isStorageMode, MAX_DOCUMENT_NESTING_DEPTH } from './chunk-7P5YWDRQ.mjs';
@@ -1,5 +1,5 @@
1
- import { MAX_HISTORY_FILE_BYTES, openChecksummedEnvelope, KEY_FINGERPRINT_BYTES, DAY_MS, dayFileKey, SCRAMBLED_ID_BYTES, restoreStagingPrefix, resolveSetting, QUERY_HISTORY_ARCHIVE_PREFIX, restoredFileKey, attachedRuntimeOf, MAX_INDEX_UUID_LENGTH, HEADER_SIZE, isGroup, isNormalPhrase, MAX_MAX_LENGTH, MAX_MAX_WORDS, listHistoryFolder, historyFileOf, MIN_PHRASE_TABLE_CAPACITY, PERSON_TABLE_MIN_SLOTS, PAIR_PAGE_BLOCKS, PAIR_BLOCK_SLOTS, packEnvelopeWithChecksum, crc32, MAX_PEOPLE_PER_PHRASE_IN_FILE } from './chunk-KOA6T2IC.mjs';
2
- import { loadSuggestionsCode, emitWriteEventAfter, dropEngineIndex } from './chunk-HSA3H3VW.mjs';
1
+ import { MAX_HISTORY_FILE_BYTES, openChecksummedEnvelope, KEY_FINGERPRINT_BYTES, DAY_MS, dayFileKey, SCRAMBLED_ID_BYTES, restoreStagingPrefix, resolveSetting, QUERY_HISTORY_ARCHIVE_PREFIX, restoredFileKey, attachedRuntimeOf, MAX_INDEX_UUID_LENGTH, HEADER_SIZE, isGroup, isNormalPhrase, MAX_MAX_LENGTH, MAX_MAX_WORDS, listHistoryFolder, historyFileOf, MIN_PHRASE_TABLE_CAPACITY, PERSON_TABLE_MIN_SLOTS, PAIR_PAGE_BLOCKS, PAIR_BLOCK_SLOTS, packEnvelopeWithChecksum, crc32, MAX_PEOPLE_PER_PHRASE_IN_FILE } from './chunk-SUFAI37B.mjs';
2
+ import { loadSuggestionsCode, emitWriteEventAfter, dropEngineIndex } from './chunk-K2KNE7W2.mjs';
3
3
  import { NarsilError, ErrorCodes } from './chunk-ZKOQR7EA.mjs';
4
4
 
5
5
  // src/query-suggestions/engine-hooks.ts
@@ -1,8 +1,8 @@
1
- import { encode, Merger } from './chunk-FGOGT273.mjs';
2
- import { DayStore, RestoredHistory, dayOf, sameBytes } from './chunk-6MC6BCXK.mjs';
1
+ import { encode, Merger } from './chunk-DEKP2BZO.mjs';
2
+ import { DayStore, RestoredHistory, dayOf, sameBytes } from './chunk-7BCL5QK5.mjs';
3
3
  import { oneSyncChangeAtATime } from './chunk-V6EUBAIT.mjs';
4
- import { isGroup, invalidSetting, historyFilesOf, buildRecordKey, MIN_KEY_BYTES, resolveSetting, isPerson, acceptedPhrase, removeHistoryFolder, normaliseBan, banListFromInput, validateSetting, withState, packEnvelopeWithChecksum, crc32, openChecksummedEnvelope, SCRAMBLED_ID_BYTES, KEY_FINGERPRINT_LABEL, KEY_FINGERPRINT_BYTES, removeRestoreLeftovers, HISTORY_SWEEP_INTERVAL_MS, SCHEDULE_OFF, parseSchedule, nextMatchAfter, latestMatchAtOrBefore, DAY_MS, listHistoryFolder, historyFileOf, MAX_MANUAL_SUGGESTION_COUNT, MAX_SOURCE_INDEX_NAME_LENGTH, DEFAULT_PREVIEW_LIMIT, MAX_PREVIEW_LIMIT, requireFieldsInSchema, MAX_TIMER_DELAY_MS, BUILD_WRITE_BATCH, BYTES_PER_MIB, MS_PER_SECOND, BUILD_LIST_PAGE, unionOfBans } from './chunk-KOA6T2IC.mjs';
5
- import { GROUP_FORMAT, emitEngineEvent, emitWriteEventAfter, createEngineIndex, withOpenIndex, loadDigest, SUGGESTIONS_INDEX_INFIX } from './chunk-HSA3H3VW.mjs';
4
+ import { isGroup, invalidSetting, historyFilesOf, buildRecordKey, MIN_KEY_BYTES, resolveSetting, isPerson, acceptedPhrase, removeHistoryFolder, normaliseBan, banListFromInput, validateSetting, withState, packEnvelopeWithChecksum, crc32, openChecksummedEnvelope, SCRAMBLED_ID_BYTES, KEY_FINGERPRINT_LABEL, KEY_FINGERPRINT_BYTES, removeRestoreLeftovers, HISTORY_SWEEP_INTERVAL_MS, SCHEDULE_OFF, parseSchedule, nextMatchAfter, latestMatchAtOrBefore, DAY_MS, listHistoryFolder, historyFileOf, MAX_MANUAL_SUGGESTION_COUNT, MAX_SOURCE_INDEX_NAME_LENGTH, DEFAULT_PREVIEW_LIMIT, MAX_PREVIEW_LIMIT, requireFieldsInSchema, MAX_TIMER_DELAY_MS, BUILD_WRITE_BATCH, BYTES_PER_MIB, MS_PER_SECOND, BUILD_LIST_PAGE, unionOfBans } from './chunk-SUFAI37B.mjs';
5
+ import { GROUP_FORMAT, emitEngineEvent, emitWriteEventAfter, createEngineIndex, withOpenIndex, loadDigest, SUGGESTIONS_INDEX_INFIX } from './chunk-K2KNE7W2.mjs';
6
6
  import { decode } from './chunk-GXCDWLQI.mjs';
7
7
  import { spawnNodeWorker, resolveWorkerEntry } from './chunk-RORNUNXW.mjs';
8
8
  import { NarsilError, ErrorCodes } from './chunk-ZKOQR7EA.mjs';
@@ -1,5 +1,5 @@
1
- import { getIndexMetadata } from './chunk-2HVQYOOD.mjs';
2
- import { fnv1a } from './chunk-HSA3H3VW.mjs';
1
+ import { getIndexMetadata } from './chunk-23UYFZXF.mjs';
2
+ import { fnv1a } from './chunk-K2KNE7W2.mjs';
3
3
  import { NarsilError, ErrorCodes } from './chunk-ZKOQR7EA.mjs';
4
4
 
5
5
  // src/distribution/cluster-node/routable-allocation.ts
@@ -1,5 +1,5 @@
1
- import { openCountsFile } from './chunk-6MC6BCXK.mjs';
2
- import { SCRAMBLED_ID_BYTES } from './chunk-KOA6T2IC.mjs';
1
+ import { openCountsFile } from './chunk-7BCL5QK5.mjs';
2
+ import { SCRAMBLED_ID_BYTES } from './chunk-SUFAI37B.mjs';
3
3
  export { encode } from '@msgpack/msgpack';
4
4
 
5
5
  function bindSuggestionsHost(_host, _msgpack, _suggestionStore) {
@@ -1,4 +1,4 @@
1
- import { withOpenIndex, oneAtATime, validateBM25Params, storedBM25Params, emitSyncChange } from './chunk-HSA3H3VW.mjs';
1
+ import { withOpenIndex, oneAtATime, validateBM25Params, storedBM25Params, emitSyncChange } from './chunk-K2KNE7W2.mjs';
2
2
  import { ErrorCodes } from './chunk-ZKOQR7EA.mjs';
3
3
 
4
4
  // src/engine/bm25-update.ts
@@ -1,4 +1,4 @@
1
- import { fnv1a } from './chunk-HSA3H3VW.mjs';
1
+ import { fnv1a } from './chunk-K2KNE7W2.mjs';
2
2
  import { NarsilError, ErrorCodes } from './chunk-ZKOQR7EA.mjs';
3
3
 
4
4
  // src/persistence/durability/segment/layout.ts
@@ -1,10 +1,10 @@
1
- import { syncStorageOf, INDEX_CONFIGURATION_ENVELOPE_VERSION, MAX_SNAPSHOT_ANALYSIS_ATTEMPTS, encodeIndexConfiguration } from './chunk-K5GNK5GE.mjs';
2
- import { archiveLayout } from './chunk-Z6SIJH5O.mjs';
3
- import { manifestFileRefs } from './chunk-TSE2VWPX.mjs';
1
+ import { syncStorageOf, INDEX_CONFIGURATION_ENVELOPE_VERSION, MAX_SNAPSHOT_ANALYSIS_ATTEMPTS, encodeIndexConfiguration } from './chunk-TQ5EEJEO.mjs';
2
+ import { archiveLayout } from './chunk-NTO2EMWZ.mjs';
3
+ import { manifestFileRefs } from './chunk-FIMLVUHE.mjs';
4
4
  import { DIRECTORY_IDENTITY_CHECK_INTERVAL_MS } from './chunk-MSIN4NM3.mjs';
5
5
  import { oneSyncChangeAtATime } from './chunk-V6EUBAIT.mjs';
6
- import { openChecksummedEnvelope } from './chunk-KOA6T2IC.mjs';
7
- import { withOpenIndex, emitEngineEvent } from './chunk-HSA3H3VW.mjs';
6
+ import { openChecksummedEnvelope } from './chunk-SUFAI37B.mjs';
7
+ import { withOpenIndex, emitEngineEvent } from './chunk-K2KNE7W2.mjs';
8
8
  import { decode } from './chunk-GXCDWLQI.mjs';
9
9
  import { isSyncEpoch } from './chunk-BUMREPLU.mjs';
10
10
  import { NarsilError, ErrorCodes } from './chunk-ZKOQR7EA.mjs';
@@ -1,6 +1,6 @@
1
- import { responseStopOf, sendRelayed, parseJson, validateQuery, rejectInvalid, refuseRegex, withServerRerankWindow, requestSignal, respondJson, encodeQueryResult, respondError, loadUWebSockets, childAppOf, createRouteRunner, corsHeaderReader, createSharedBodyBudget, createSharedRequestGate, registerFeedRoute, SYNC_FEED_ROUTE, CHANGES_FEED_ROUTE, registerServerRoutes, closeWhenTheProcessExits, statusLine, sendError, REQUEST_THREAD_MOVE_AFTER_MS, MAX_LONG_QUERIES_IN_FLIGHT, createDocumentReadHandlers, SERVER_CAPABILITIES, versionReport, serverRoutes, validateSuggest, isMainFeedNote, SEARCH_CLOCK_SAMPLE_UNITS, awaitDepartureConfirmation, departureConfirmation, REQUEST_THREAD_DEPARTURE_DRAIN_MS, departureConfirmed, stopResponse } from './chunk-7X4IIREW.mjs';
1
+ import { responseStopOf, sendRelayed, parseJson, validateQuery, rejectInvalid, refuseRegex, withServerRerankWindow, requestSignal, respondJson, encodeQueryResult, respondError, loadUWebSockets, childAppOf, createRouteRunner, corsHeaderReader, createSharedBodyBudget, createSharedRequestGate, registerFeedRoute, SYNC_FEED_ROUTE, CHANGES_FEED_ROUTE, registerServerRoutes, closeWhenTheProcessExits, statusLine, sendError, REQUEST_THREAD_MOVE_AFTER_MS, MAX_LONG_QUERIES_IN_FLIGHT, createDocumentReadHandlers, SERVER_CAPABILITIES, versionReport, serverRoutes, validateSuggest, isMainFeedNote, SEARCH_CLOCK_SAMPLE_UNITS, awaitDepartureConfirmation, departureConfirmation, REQUEST_THREAD_DEPARTURE_DRAIN_MS, departureConfirmed, stopResponse } from './chunk-RDGMV4R3.mjs';
2
2
  import { SYNC_CLOSE_GOING_AWAY, encodeJson } from './chunk-F6F4G322.mjs';
3
- import { importOptionalReads, loadSortingFor, holdsQuotedText, loadQueryCode, executeQuery, lazyQueryBinding, executePreflight, resolveProjection, projectionKeepsField, loadRerankRuntime, setNestedValue } from './chunk-HSA3H3VW.mjs';
3
+ import { importOptionalReads, loadSortingFor, holdsQuotedText, loadQueryCode, executeQuery, lazyQueryBinding, executePreflight, resolveProjection, projectionKeepsField, loadRerankRuntime, setNestedValue } from './chunk-K2KNE7W2.mjs';
4
4
  import { loadedMessagePack, loadMessagePack, extractVectorFieldsFromSchema } from './chunk-7P5YWDRQ.mjs';
5
5
  import { answerFromOneState } from './chunk-RORNUNXW.mjs';
6
6
  import { ServerErrorCodes, ErrorCodes, NarsilError, isNarsilError } from './chunk-ZKOQR7EA.mjs';
@@ -1,6 +1,6 @@
1
- import { isValidInteger, isRecord } from './chunk-2HVQYOOD.mjs';
1
+ import { isValidInteger, isRecord } from './chunk-23UYFZXF.mjs';
2
2
  import { MAX_REPLICATION_FACTOR, MAX_PARTITION_COUNT } from './chunk-JDDXV6UF.mjs';
3
- import { openChecksummedEnvelope, packChecksummedEnvelope, MAX_HISTORY_FILE_BYTES } from './chunk-KOA6T2IC.mjs';
3
+ import { openChecksummedEnvelope, packChecksummedEnvelope, MAX_HISTORY_FILE_BYTES } from './chunk-SUFAI37B.mjs';
4
4
  import { decode } from './chunk-GXCDWLQI.mjs';
5
5
  import { isSyncEpoch } from './chunk-BUMREPLU.mjs';
6
6
  import { joinChunks } from './chunk-GR5GMFJJ.mjs';
@@ -12682,7 +12682,7 @@ function resolvePartitionInsertOptions(config, analysis, options) {
12682
12682
 
12683
12683
  // src/core/segment-codec-code.ts
12684
12684
  var segmentCodec = codeLoader(async () => {
12685
- const [msgpack, code7] = await Promise.all([loadMessagePack(), import('./segment-codec-leaf-MP6DILVE.mjs')]);
12685
+ const [msgpack, code7] = await Promise.all([loadMessagePack(), import('./segment-codec-leaf-KXZPLILR.mjs')]);
12686
12686
  code7.bindSegmentCodecHost(optionalCodeHost(), msgpack);
12687
12687
  return code7;
12688
12688
  }, "segment codec");
@@ -12690,7 +12690,7 @@ var loadSegmentCodec = segmentCodec.load;
12690
12690
 
12691
12691
  // src/query-suggestions/store-code.ts
12692
12692
  var suggestionStore = codeLoader(async () => {
12693
- const [msgpack, code7] = await Promise.all([loadMessagePack(), import('./store-leaf-PL2G7RM5.mjs')]);
12693
+ const [msgpack, code7] = await Promise.all([loadMessagePack(), import('./store-leaf-JBMZL6QN.mjs')]);
12694
12694
  code7.bindSuggestionStoreHost(optionalCodeHost(), msgpack);
12695
12695
  return code7;
12696
12696
  }, "query suggestions store");
@@ -12771,7 +12771,7 @@ var storageCode = codeLoader(async () => {
12771
12771
  loadSegmentMerge(),
12772
12772
  loadSuggestionStore(),
12773
12773
  loadVectorCore(),
12774
- import('./storage-leaf-HQFO37W7.mjs')
12774
+ import('./storage-leaf-S2RWQ63Q.mjs')
12775
12775
  ]);
12776
12776
  code7.bindStorageHost(optionalCodeHost(), digest2, msgpack, segmentCodec2, segmentMerge2, suggestionStore2, vectorCore2);
12777
12777
  return code7;
@@ -21494,7 +21494,7 @@ function hasLanguage(name) {
21494
21494
 
21495
21495
  // src/narsil/restore-queue-code.ts
21496
21496
  var restoreQueue = codeLoader(async () => {
21497
- const [suggestionStore2, code7] = await Promise.all([loadSuggestionStore(), import('./restore-queue-E4EIUYVV.mjs')]);
21497
+ const [suggestionStore2, code7] = await Promise.all([loadSuggestionStore(), import('./restore-queue-FVVCUHIY.mjs')]);
21498
21498
  code7.bindRestoreQueueHost(optionalCodeHost(), suggestionStore2);
21499
21499
  return code7;
21500
21500
  }, "restore");
@@ -22071,7 +22071,7 @@ var loadEmbedCode = embedCode.load;
22071
22071
 
22072
22072
  // src/engine/optional-writes-code.ts
22073
22073
  var optionalWrites = codeLoader(async () => {
22074
- const [segmentCodec2, code7] = await Promise.all([loadSegmentCodec(), import('./optional-writes-CGDBJBHQ.mjs')]);
22074
+ const [segmentCodec2, code7] = await Promise.all([loadSegmentCodec(), import('./optional-writes-3CFEDQ7M.mjs')]);
22075
22075
  code7.bindOptionalWritesHost(optionalCodeHost(), segmentCodec2);
22076
22076
  return code7;
22077
22077
  }, "write");
@@ -24800,9 +24800,10 @@ function createAnalysisRebuildCoordinator(config, deps) {
24800
24800
  const rebuildMode = config?.rebuild ?? "auto";
24801
24801
  let queue = Promise.resolve();
24802
24802
  let active = null;
24803
+ let closed = false;
24803
24804
  async function rebuildNow(indexName, entry) {
24804
24805
  const manager = deps.getManager(indexName);
24805
- if (manager === void 0 || entry.abandoned) {
24806
+ if (manager === void 0 || entry.abandoned || closed) {
24806
24807
  entry.run = null;
24807
24808
  return;
24808
24809
  }
@@ -24854,7 +24855,7 @@ function createAnalysisRebuildCoordinator(config, deps) {
24854
24855
  }
24855
24856
  }
24856
24857
  function runTracked(indexName, entry) {
24857
- const done = rebuildNow(indexName, entry);
24858
+ const done = Promise.resolve().then(() => rebuildNow(indexName, entry));
24858
24859
  const tracked = { indexName, entry, done };
24859
24860
  active = tracked;
24860
24861
  return done.finally(() => {
@@ -24935,6 +24936,11 @@ function createAnalysisRebuildCoordinator(config, deps) {
24935
24936
  running.entry.abandoned = true;
24936
24937
  await running.done.catch(() => void 0);
24937
24938
  },
24939
+ async shutdown() {
24940
+ closed = true;
24941
+ for (const entry of stale.values()) entry.abandoned = true;
24942
+ await active?.done.catch(() => void 0);
24943
+ },
24938
24944
  review(indexName) {
24939
24945
  const entry = stale.get(indexName);
24940
24946
  return entry === void 0 ? Promise.resolve() : review(indexName, entry);
@@ -25529,7 +25535,7 @@ var workerCopies = codeLoader(async () => {
25529
25535
  const [segmentCodec2, segmentMerge2, code7] = await Promise.all([
25530
25536
  loadSegmentCodec(),
25531
25537
  loadSegmentMerge(),
25532
- import('./worker-copies-P7YWXEP5.mjs')
25538
+ import('./worker-copies-4T3SR5XZ.mjs')
25533
25539
  ]);
25534
25540
  code7.bindWorkerCopiesHost(optionalCodeHost(), segmentCodec2, segmentMerge2);
25535
25541
  return code7;
@@ -25926,6 +25932,7 @@ async function startEngineCore(core2, config) {
25926
25932
  }
25927
25933
  async function shutdownEngine(core2) {
25928
25934
  const { executor, durability, indexRegistry, eventHandlers, orchestrator } = core2;
25935
+ await core2.analysisRebuild.shutdown();
25929
25936
  await core2.querySuggestionHooks?.shutdown();
25930
25937
  core2.indexState.dispose();
25931
25938
  if (durability) {
@@ -29607,6 +29614,7 @@ function createNarsilFromCore(core2, config) {
29607
29614
  }
29608
29615
  }
29609
29616
  const rebalancesStarting = /* @__PURE__ */ new Map();
29617
+ let shutdownPromise = null;
29610
29618
  function withOpenIndexWrite(indexName, action) {
29611
29619
  const starting = rebalancesStarting.get(indexName);
29612
29620
  const written = starting === void 0 ? withOpenIndex2(indexName, action) : starting.then(() => withOpenIndex2(indexName, action));
@@ -29863,11 +29871,12 @@ function createNarsilFromCore(core2, config) {
29863
29871
  if (handlers.size === 0) eventHandlers.delete(key);
29864
29872
  }
29865
29873
  },
29866
- async shutdown() {
29867
- if (shutdownState.isShutdown) return;
29874
+ shutdown() {
29875
+ if (shutdownPromise !== null) return shutdownPromise;
29868
29876
  shutdownState.isShutdown = true;
29877
+ shutdownPromise = Promise.resolve().then(() => shutdownEngine(core2));
29869
29878
  abortController.abort();
29870
- await shutdownEngine(core2);
29879
+ return shutdownPromise;
29871
29880
  }
29872
29881
  };
29873
29882
  bindEngineCore(narsil, core2);
@@ -29900,7 +29909,7 @@ var suggestionsCode = codeLoader(async () => {
29900
29909
  const [msgpack, suggestionStore2, code7] = await Promise.all([
29901
29910
  loadMessagePack(),
29902
29911
  loadSuggestionStore(),
29903
- import('./suggestions-leaf-I3MEHACP.mjs')
29912
+ import('./suggestions-leaf-MA2PUFB5.mjs')
29904
29913
  ]);
29905
29914
  code7.bindSuggestionsHost(optionalCodeHost(), msgpack, suggestionStore2);
29906
29915
  return code7;
@@ -31062,7 +31071,7 @@ var segmentMerge = codeLoader(async () => {
31062
31071
  const [msgpack, codec, code7] = await Promise.all([
31063
31072
  loadMessagePack(),
31064
31073
  loadSegmentCodec(),
31065
- import('./segment-merge-leaf-ED2NMUC5.mjs')
31074
+ import('./segment-merge-leaf-MLX5VM3E.mjs')
31066
31075
  ]);
31067
31076
  code7.bindSegmentMergeHost(optionalCodeHost(), msgpack, codec);
31068
31077
  return code7;
@@ -1,4 +1,4 @@
1
- import { isCompositePartition, encodeSegmentState, freezeSegmentShared } from './chunk-HSA3H3VW.mjs';
1
+ import { isCompositePartition, encodeSegmentState, freezeSegmentShared } from './chunk-K2KNE7W2.mjs';
2
2
  import { NarsilError, ErrorCodes } from './chunk-ZKOQR7EA.mjs';
3
3
 
4
4
  // src/core/partition/frozen/share.ts
@@ -1,6 +1,6 @@
1
- import { MAX_SEGMENT_ID, MANIFEST_ENVELOPE_VERSION, EARLIER_SEGMENT_MANIFEST_VERSION, SEGMENT_MANIFEST_VERSION, MAX_SEGMENTS_PER_PARTITION, segmentKey, manifestFileRefs, graphPartKey, vectorFileKey } from './chunk-TSE2VWPX.mjs';
1
+ import { MAX_SEGMENT_ID, MANIFEST_ENVELOPE_VERSION, EARLIER_SEGMENT_MANIFEST_VERSION, SEGMENT_MANIFEST_VERSION, MAX_SEGMENTS_PER_PARTITION, segmentKey, manifestFileRefs, graphPartKey, vectorFileKey } from './chunk-FIMLVUHE.mjs';
2
2
  import { VECTOR_FILE_MAX_VECTORS, deadBytesFor } from './chunk-KBU3ZFJN.mjs';
3
- import { openChecksummedEnvelope, HEADER_SIZE, QUERY_HISTORY_ARCHIVE_PREFIX, MAX_HISTORY_FILE_BYTES } from './chunk-KOA6T2IC.mjs';
3
+ import { openChecksummedEnvelope, HEADER_SIZE, QUERY_HISTORY_ARCHIVE_PREFIX, MAX_HISTORY_FILE_BYTES } from './chunk-SUFAI37B.mjs';
4
4
  import { decode } from './chunk-GXCDWLQI.mjs';
5
5
  import { requireValidFieldTypes } from './chunk-7P5YWDRQ.mjs';
6
6
  import { MAX_FILE_BYTES } from './chunk-4PY4JYMY.mjs';
@@ -1,4 +1,4 @@
1
- import { bindResponseStop, sendError, RELAY_STREAM_CHUNKS_IN_FLIGHT } from './chunk-7X4IIREW.mjs';
1
+ import { bindResponseStop, sendError, RELAY_STREAM_CHUNKS_IN_FLIGHT } from './chunk-RDGMV4R3.mjs';
2
2
  import { ServerErrorCodes } from './chunk-ZKOQR7EA.mjs';
3
3
  import { rm } from 'fs/promises';
4
4
  import path from 'path';
@@ -1,5 +1,5 @@
1
1
  import { boundQuerySuggestionsOf } from './chunk-S2POFTLN.mjs';
2
- import { engineCoreOf, loadSuggestionsCode, GROUP_PATTERN_SOURCE, GROUP_FORMAT, SUGGESTIONS_INDEX_INFIX } from './chunk-HSA3H3VW.mjs';
2
+ import { engineCoreOf, loadSuggestionsCode, GROUP_PATTERN_SOURCE, GROUP_FORMAT, SUGGESTIONS_INDEX_INFIX } from './chunk-K2KNE7W2.mjs';
3
3
  import { NarsilError, ErrorCodes } from './chunk-ZKOQR7EA.mjs';
4
4
 
5
5
  // src/query-suggestions/index.ts
@@ -1,7 +1,7 @@
1
1
  import { CHANGES_SUBPROTOCOL, SYNC_SUBPROTOCOL, encodeJson, SYNC_CLOSE_SERVER_ERROR, encodeScore } from './chunk-F6F4G322.mjs';
2
- import { answerRefusalOf } from './chunk-JXINPXRS.mjs';
3
- import { archiveRange, FEED_SOCKET_MAX_BACKPRESSURE_BYTES, FEED_SOCKET_MAX_PAYLOAD_BYTES } from './chunk-Z6SIJH5O.mjs';
4
- import { readRecentMemoryFigures, readMemoryFigures, DEFAULT_RERANK_WINDOW } from './chunk-HSA3H3VW.mjs';
2
+ import { answerRefusalOf } from './chunk-2TWR6YCG.mjs';
3
+ import { archiveRange, FEED_SOCKET_MAX_BACKPRESSURE_BYTES, FEED_SOCKET_MAX_PAYLOAD_BYTES } from './chunk-NTO2EMWZ.mjs';
4
+ import { readRecentMemoryFigures, readMemoryFigures, DEFAULT_RERANK_WINDOW } from './chunk-K2KNE7W2.mjs';
5
5
  import { collectGarbageBeforeRefusal, collectYoungGenerationBeforeRefusal, reportRefusalAfterCollection, reservedHeapBytes, admitHeapBytes } from './chunk-AOYQTX6W.mjs';
6
6
  import { MAX_FILTER_DEPTH } from './chunk-IL5DRCNU.mjs';
7
7
  import { bindSignalStop } from './chunk-RORNUNXW.mjs';