@delali/narsil 0.3.1-next.181 → 0.3.1-next.183

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 (101) hide show
  1. package/dist/browser/{chunk-JHFBQKUF.mjs → chunk-ZZUXMJIK.mjs} +12 -14
  2. package/dist/browser/{durability-config-SGB5ZP5K.mjs → durability-config-75NSFCQN.mjs} +6 -3
  3. package/dist/browser/{optional-writes-TB34FYUW.mjs → optional-writes-IQFTXANH.mjs} +2 -0
  4. package/dist/browser/{storage-leaf-QFXIWDFK.mjs → storage-leaf-2CO6SQ7R.mjs} +859 -250
  5. package/dist/{capabilities-BQIdsaWy.d.ts → capabilities-DAHXphRn.d.ts} +2 -2
  6. package/dist/{chunk-QFJMRB7D.mjs → chunk-2DK74OQL.mjs} +1 -1
  7. package/dist/{chunk-F3FDHXCJ.mjs → chunk-3OEXOSWI.mjs} +251 -50
  8. package/dist/{chunk-GO6TRSJ6.mjs → chunk-632ABEIR.mjs} +1 -1
  9. package/dist/{chunk-34IOOYXA.mjs → chunk-6ICOWB6I.mjs} +1 -1
  10. package/dist/{chunk-XNFBYAXI.mjs → chunk-C3EINJNJ.mjs} +1 -1
  11. package/dist/{chunk-JCWC75NH.mjs → chunk-C77OBNPP.mjs} +1 -1
  12. package/dist/{chunk-YPV2L7M5.mjs → chunk-CKS4QQEC.mjs} +3 -3
  13. package/dist/{chunk-2C3BXZGA.mjs → chunk-CWXR7OP4.mjs} +18 -20
  14. package/dist/{chunk-BIIROQ5Q.mjs → chunk-EGWBZSHK.mjs} +2 -2
  15. package/dist/{chunk-XQQKETAF.mjs → chunk-F2UOTRY7.mjs} +2 -2
  16. package/dist/{chunk-XTSFRWAS.mjs → chunk-FIXUVFUC.mjs} +3 -3
  17. package/dist/{chunk-Y27E2MGC.mjs → chunk-GGG5R4CU.mjs} +1 -1
  18. package/dist/{chunk-2KWTQ2P7.mjs → chunk-JVR5KMO4.mjs} +2 -2
  19. package/dist/{chunk-XITVDRRH.mjs → chunk-M3H7CTIC.mjs} +6 -6
  20. package/dist/{chunk-YXZDTKQS.mjs → chunk-MCAJOLVK.mjs} +2 -2
  21. package/dist/{chunk-QDZJM7NI.mjs → chunk-MSIN4NM3.mjs} +3 -1
  22. package/dist/{chunk-UISV46WX.mjs → chunk-NPXORGMK.mjs} +2 -2
  23. package/dist/{chunk-R7PLSVK3.mjs → chunk-OQANB7SJ.mjs} +1 -1
  24. package/dist/{chunk-KHJPMZE2.mjs → chunk-PK3BGGHO.mjs} +1 -1
  25. package/dist/{chunk-ISJ35523.mjs → chunk-PXEGKQHS.mjs} +2 -2
  26. package/dist/{chunk-LOQHA6QK.mjs → chunk-SA7U67XF.mjs} +2 -2
  27. package/dist/{chunk-JDIATDPY.mjs → chunk-T3YI4KN6.mjs} +1 -1
  28. package/dist/{chunk-ZB5X5WAK.mjs → chunk-TTTBE4TB.mjs} +10 -5
  29. package/dist/{chunk-A4XYDUVN.mjs → chunk-V7F5DOSC.mjs} +2 -2
  30. package/dist/{chunk-26E5MO3Y.mjs → chunk-WUWSUJ2X.mjs} +4 -4
  31. package/dist/{chunk-XFOL77WH.mjs → chunk-YWSIRKKQ.mjs} +1 -1
  32. package/dist/{chunk-7FC2ZILY.mjs → chunk-ZVZ2V2PZ.mjs} +37 -67
  33. package/dist/{client-CeUxvIvd.d.ts → client-DpqtT2XG.d.ts} +3 -3
  34. package/dist/client.d.ts +6 -6
  35. package/dist/{config-DehU-VGL.d.ts → config-C687-reW.d.ts} +11 -1
  36. package/dist/{config-CIpLXXxm.d.ts → config-D9WR3MhO.d.ts} +1 -1
  37. package/dist/{direct-executor-2WQSGBN3.mjs → direct-executor-JXYIL4OQ.mjs} +1 -1
  38. package/dist/distribution.d.ts +4 -4
  39. package/dist/distribution.mjs +391 -138
  40. package/dist/{durability-config-XV4XR7Y4.mjs → durability-config-NWU2G2SJ.mjs} +6 -3
  41. package/dist/{engine-P-4xhUe4.d.ts → engine-De6JzTW8.d.ts} +123 -72
  42. package/dist/index.browser.mjs +1 -1
  43. package/dist/index.d.ts +4 -4
  44. package/dist/index.mjs +1 -1
  45. package/dist/index.react-native.mjs +1 -1
  46. package/dist/{long-query-thread-AAYTLYZK.mjs → long-query-thread-HPKGRYWM.mjs} +10 -10
  47. package/dist/{optional-writes-N2DFWWZ3.mjs → optional-writes-QE7QUI45.mjs} +5 -3
  48. package/dist/{paged-partition-archive-X7L27E5Z.mjs → paged-partition-archive-IK2UOY2G.mjs} +9 -9
  49. package/dist/partial-words.browser.mjs +1 -1
  50. package/dist/partial-words.mjs +1 -1
  51. package/dist/persistence/durability/checkpoint-worker.d.ts +9 -0
  52. package/dist/persistence/durability/checkpoint-worker.mjs +23 -12
  53. package/dist/{query-actions-2JOLPELC.mjs → query-actions-COEFVUH3.mjs} +1 -1
  54. package/dist/query-suggestions/merge-worker.mjs +4 -4
  55. package/dist/query-suggestions.browser.mjs +1 -1
  56. package/dist/query-suggestions.d.ts +1 -1
  57. package/dist/query-suggestions.mjs +2 -2
  58. package/dist/react-native/chunks/{chunk-F4MIGBBP.mjs → chunk-6A5XE2MA.mjs} +18 -20
  59. package/dist/react-native/chunks/{chunk-H344ZXRH.mjs → chunk-DN2GVVR4.mjs} +1 -1
  60. package/dist/react-native/chunks/{chunk-GVWLACAT.mjs → chunk-DZ4FQW5K.mjs} +2 -2
  61. package/dist/react-native/chunks/{chunk-57R74JWC.mjs → chunk-G4YYO5TC.mjs} +1 -1
  62. package/dist/react-native/chunks/{chunk-F6BJYCF2.mjs → chunk-UPN4NUXU.mjs} +1 -1
  63. package/dist/react-native/chunks/{chunk-GGBATERA.mjs → chunk-XNIH3WIB.mjs} +1 -1
  64. package/dist/react-native/chunks/{durability-config-3IOXIPYZ.mjs → durability-config-RVTWSXPH.mjs} +6 -3
  65. package/dist/react-native/chunks/{optional-writes-TXTJ6HUZ.mjs → optional-writes-YZ7WTR7V.mjs} +4 -2
  66. package/dist/react-native/chunks/{restore-queue-SZLWIL3B.mjs → restore-queue-IGKD6Q2Y.mjs} +4 -4
  67. package/dist/react-native/chunks/{segment-codec-leaf-WMUZ5P4F.mjs → segment-codec-leaf-JTTGDT3G.mjs} +2 -2
  68. package/dist/react-native/chunks/{segment-merge-leaf-Q2OEJIQ3.mjs → segment-merge-leaf-D5ZFJRUB.mjs} +3 -3
  69. package/dist/react-native/chunks/{storage-leaf-OXYV6O6P.mjs → storage-leaf-ZKIM6IF6.mjs} +864 -255
  70. package/dist/react-native/chunks/{store-leaf-ZMDXYK4E.mjs → store-leaf-PHBOTT5J.mjs} +3 -3
  71. package/dist/react-native/chunks/{suggestions-leaf-FIMGQZ2T.mjs → suggestions-leaf-R7MIH6Q3.mjs} +3 -3
  72. package/dist/react-native/chunks/{worker-copies-72TGFYQB.mjs → worker-copies-U35KPVJ7.mjs} +2 -2
  73. package/dist/react-native/partial-words.mjs +1 -1
  74. package/dist/react-native/query-suggestions.mjs +1 -1
  75. package/dist/react-native/sync.mjs +1 -1
  76. package/dist/react-native/synonyms.mjs +1 -1
  77. package/dist/react.d.ts +7 -7
  78. package/dist/{rerank-E2HFKKGJ.mjs → rerank-LYL3D7LU.mjs} +1 -1
  79. package/dist/{restore-queue-PUVBN6L3.mjs → restore-queue-LF4DTVJC.mjs} +4 -4
  80. package/dist/{segment-codec-leaf-24Z3MMQI.mjs → segment-codec-leaf-ACALKS2C.mjs} +2 -2
  81. package/dist/{segment-merge-leaf-FQQDU45E.mjs → segment-merge-leaf-SKMPASFK.mjs} +2 -2
  82. package/dist/server.d.ts +8 -8
  83. package/dist/server.mjs +16 -16
  84. package/dist/{storage-leaf-KIA7XO6Y.mjs → storage-leaf-OJ55R4C5.mjs} +588 -158
  85. package/dist/{store-leaf-ESVLL4JO.mjs → store-leaf-CWHHEDRK.mjs} +3 -3
  86. package/dist/{suggestions-leaf-FXF4AHAY.mjs → suggestions-leaf-ZTU3ZTWJ.mjs} +5 -5
  87. package/dist/sync/filesystem.d.ts +2 -2
  88. package/dist/sync/filesystem.mjs +6 -6
  89. package/dist/sync/indexeddb.d.ts +2 -2
  90. package/dist/sync.browser.mjs +1 -1
  91. package/dist/sync.d.ts +3 -3
  92. package/dist/sync.mjs +1 -1
  93. package/dist/synonyms.browser.mjs +1 -1
  94. package/dist/synonyms.mjs +1 -1
  95. package/dist/{tasks-CXtQ3Zpp.d.ts → tasks-X2IJQc8J.d.ts} +2 -2
  96. package/dist/{thread-OWXVP2ZA.mjs → thread-BEGFRULV.mjs} +9 -9
  97. package/dist/{types-CDN70Y_C.d.ts → types-D0YasjoX.d.ts} +1 -1
  98. package/dist/{worker-copies-XXX7PF4J.mjs → worker-copies-373P6IYZ.mjs} +4 -4
  99. package/dist/workers/entry.mjs +7 -7
  100. package/openapi.json +32 -0
  101. package/package.json +7 -7
@@ -8677,7 +8677,7 @@ function resolvePartitionInsertOptions(config, analysis, options) {
8677
8677
 
8678
8678
  // src/core/segment-codec-code.ts
8679
8679
  var segmentCodec = codeLoader(async () => {
8680
- const [msgpack, code7] = await Promise.all([loadMessagePack(), import('./segment-codec-leaf-WMUZ5P4F.mjs')]);
8680
+ const [msgpack, code7] = await Promise.all([loadMessagePack(), import('./segment-codec-leaf-JTTGDT3G.mjs')]);
8681
8681
  code7.bindSegmentCodecHost(optionalCodeHost(), msgpack);
8682
8682
  return code7;
8683
8683
  }, "segment codec");
@@ -8688,7 +8688,7 @@ var segmentMerge = codeLoader(async () => {
8688
8688
  const [msgpack, codec, code7] = await Promise.all([
8689
8689
  loadMessagePack(),
8690
8690
  loadSegmentCodec(),
8691
- import('./segment-merge-leaf-Q2OEJIQ3.mjs')
8691
+ import('./segment-merge-leaf-D5ZFJRUB.mjs')
8692
8692
  ]);
8693
8693
  code7.bindSegmentMergeHost(optionalCodeHost(), msgpack, codec);
8694
8694
  return code7;
@@ -8697,7 +8697,7 @@ var loadSegmentMerge = segmentMerge.load;
8697
8697
 
8698
8698
  // src/query-suggestions/store-code.ts
8699
8699
  var suggestionStore = codeLoader(async () => {
8700
- const [msgpack, code7] = await Promise.all([loadMessagePack(), import('./store-leaf-ZMDXYK4E.mjs')]);
8700
+ const [msgpack, code7] = await Promise.all([loadMessagePack(), import('./store-leaf-PHBOTT5J.mjs')]);
8701
8701
  code7.bindSuggestionStoreHost(optionalCodeHost(), msgpack);
8702
8702
  return code7;
8703
8703
  }, "query suggestions store");
@@ -8778,7 +8778,7 @@ var storageCode = codeLoader(async () => {
8778
8778
  loadSegmentMerge(),
8779
8779
  loadSuggestionStore(),
8780
8780
  loadVectorCore(),
8781
- import('./storage-leaf-OXYV6O6P.mjs')
8781
+ import('./storage-leaf-ZKIM6IF6.mjs')
8782
8782
  ]);
8783
8783
  code7.bindStorageHost(optionalCodeHost(), digest2, msgpack, segmentCodec2, segmentMerge2, suggestionStore2, vectorCore2);
8784
8784
  return code7;
@@ -17184,8 +17184,7 @@ function assembleFrozenSegment(segmentId, source, documentSource, sharedSnapshot
17184
17184
  if (ordinal === void 0 || tombstones.has(ordinal)) return void 0;
17185
17185
  return removals.spellingsOf(ordinal);
17186
17186
  },
17187
- prepareTombstone(docId, removedSpellings, analysis) {
17188
- const ordinal = docStore.getInternalId(docId);
17187
+ prepareTombstone(docId, removedSpellings, analysis, ordinal = docStore.getInternalId(docId)) {
17189
17188
  if (ordinal === void 0 || tombstones.has(ordinal)) return void 0;
17190
17189
  const publishTombstone = tombstones.prepare(ordinal);
17191
17190
  const strings4 = analysis === void 0 ? null : prepareFrozenStrings(
@@ -19942,7 +19941,7 @@ function hasLanguage(name) {
19942
19941
 
19943
19942
  // src/narsil/restore-queue-code.ts
19944
19943
  var restoreQueue = codeLoader(async () => {
19945
- const [suggestionStore2, code7] = await Promise.all([loadSuggestionStore(), import('./restore-queue-SZLWIL3B.mjs')]);
19944
+ const [suggestionStore2, code7] = await Promise.all([loadSuggestionStore(), import('./restore-queue-IGKD6Q2Y.mjs')]);
19946
19945
  code7.bindRestoreQueueHost(optionalCodeHost(), suggestionStore2);
19947
19946
  return code7;
19948
19947
  }, "restore");
@@ -20542,7 +20541,7 @@ var loadEmbedCode = embedCode.load;
20542
20541
 
20543
20542
  // src/engine/optional-writes-code.ts
20544
20543
  var optionalWrites = codeLoader(async () => {
20545
- const [segmentCodec2, code7] = await Promise.all([loadSegmentCodec(), import('./optional-writes-TXTJ6HUZ.mjs')]);
20544
+ const [segmentCodec2, code7] = await Promise.all([loadSegmentCodec(), import('./optional-writes-YZ7WTR7V.mjs')]);
20546
20545
  code7.bindOptionalWritesHost(optionalCodeHost(), segmentCodec2);
20547
20546
  return code7;
20548
20547
  }, "write");
@@ -22439,7 +22438,7 @@ var suggestionsCode = codeLoader(async () => {
22439
22438
  const [msgpack, suggestionStore2, code7] = await Promise.all([
22440
22439
  loadMessagePack(),
22441
22440
  loadSuggestionStore(),
22442
- import('./suggestions-leaf-FIMGQZ2T.mjs')
22441
+ import('./suggestions-leaf-R7MIH6Q3.mjs')
22443
22442
  ]);
22444
22443
  code7.bindSuggestionsHost(optionalCodeHost(), msgpack, suggestionStore2);
22445
22444
  return code7;
@@ -24053,7 +24052,7 @@ var workerCopies = codeLoader(async () => {
24053
24052
  const [segmentCodec2, segmentMerge2, code7] = await Promise.all([
24054
24053
  loadSegmentCodec(),
24055
24054
  loadSegmentMerge(),
24056
- import('./worker-copies-72TGFYQB.mjs')
24055
+ import('./worker-copies-U35KPVJ7.mjs')
24057
24056
  ]);
24058
24057
  code7.bindWorkerCopiesHost(optionalCodeHost(), segmentCodec2, segmentMerge2);
24059
24058
  return code7;
@@ -25168,7 +25167,8 @@ var DURABILITY_CONFIG_KEYS = {
25168
25167
  segmentMaxBytes: true,
25169
25168
  checkpointIntervalMs: true,
25170
25169
  checkpointMutationThreshold: true,
25171
- compactionThreshold: true
25170
+ compactionThreshold: true,
25171
+ rewriteBytesPerCheckpoint: true
25172
25172
  };
25173
25173
  var WORKER_CONFIG_KEYS = {
25174
25174
  enabled: true,
@@ -26010,7 +26010,7 @@ function createAnalysisRebuildCoordinator(config, deps) {
26010
26010
 
26011
26011
  // src/engine/durability-config-code.ts
26012
26012
  var durabilityConfig = codeLoader(
26013
- () => import('./durability-config-3IOXIPYZ.mjs').then((code7) => {
26013
+ () => import('./durability-config-RVTWSXPH.mjs').then((code7) => {
26014
26014
  code7.bindDurabilityConfigHost(optionalCodeHost());
26015
26015
  return code7;
26016
26016
  }),
@@ -26729,12 +26729,6 @@ async function createEngineCore(config, hooks, capacityScope = "index") {
26729
26729
  queueDiskAdoption: orchestrator.queueDiskAdoption,
26730
26730
  awaitCopiesOfIndex: (indexName) => orchestrator.awaitReplication(indexName),
26731
26731
  publishCheckpointedPartitions: (indexName, partitions) => invalidation?.publishPartitions(indexName, partitions) ?? Promise.resolve(),
26732
- recordCheckpoint(indexName, documentCount, partitionCount) {
26733
- const entry = indexRegistry.get(indexName);
26734
- if (entry === void 0) return;
26735
- entry.documentCount = documentCount;
26736
- entry.partitionCount = partitionCount;
26737
- },
26738
26732
  engineCore: () => engineCore
26739
26733
  });
26740
26734
  const invalidationCode = config?.invalidation === void 0 ? null : durabilityWiring ?? await loadStorageCode();
@@ -28891,6 +28885,8 @@ function createNarsilFromCore(core2, config) {
28891
28885
  documentCount: manager?.countDocuments() ?? entry.documentCount,
28892
28886
  partitionCount: manager?.partitionCount ?? entry.partitionCount,
28893
28887
  estimatedMemoryBytes: manager?.estimateMemoryBytes() ?? 0,
28888
+ savedBytes: entry.storedSizes?.savedBytes,
28889
+ logBytes: entry.storedSizes?.logBytes,
28894
28890
  language: entry.language.name,
28895
28891
  schema: entry.config.schema,
28896
28892
  heldSearchStates: manager?.heldSearchStates ?? 0
@@ -28898,8 +28894,10 @@ function createNarsilFromCore(core2, config) {
28898
28894
  },
28899
28895
  getPartitionStats(indexName) {
28900
28896
  guardShutdown();
28901
- requireIndex(indexName);
28902
- return executor.getManager(indexName)?.getPartitionStats() ?? [];
28897
+ const entry = requireIndex(indexName);
28898
+ const stats = executor.getManager(indexName)?.getPartitionStats() ?? [];
28899
+ entry.storedSizes?.addTo(stats);
28900
+ return stats;
28903
28901
  },
28904
28902
  insert(indexName, document, docId, options) {
28905
28903
  return withCountedWrite(indexName, () => insertDocument2(mutationCtx, indexName, document, docId, options));
@@ -1,4 +1,4 @@
1
- import { createNumericIndex, createBooleanIndex, createEnumIndex, createLoadedGeoIndex, rebuildSizeIndexes, requirePatternSearch, patternIndexOf } from './chunk-F4MIGBBP.mjs';
1
+ import { createNumericIndex, createBooleanIndex, createEnumIndex, createLoadedGeoIndex, rebuildSizeIndexes, requirePatternSearch, patternIndexOf } from './chunk-6A5XE2MA.mjs';
2
2
  import { getFlatSchema, schemaFieldsOf, getNestedValue } from './chunk-ZDDJVR7X.mjs';
3
3
 
4
4
  // src/core/partition/pattern-snapshot.ts
@@ -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-F6BJYCF2.mjs';
2
- import { loadSuggestionsCode, emitWriteEventAfter, dropEngineIndex } from './chunk-F4MIGBBP.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-UPN4NUXU.mjs';
2
+ import { loadSuggestionsCode, emitWriteEventAfter, dropEngineIndex } from './chunk-6A5XE2MA.mjs';
3
3
  import { NarsilError, ErrorCodes } from './chunk-TQ26BKBH.mjs';
4
4
 
5
5
  // src/query-suggestions/engine-hooks.ts
@@ -1,4 +1,4 @@
1
- import { loadStorageCode, resolvePartialWordAnalysis, resolvePartitionInsertOptions, yieldToEventLoop, createPartitionIndex, writePartitionDocument } from './chunk-F4MIGBBP.mjs';
1
+ import { loadStorageCode, resolvePartialWordAnalysis, resolvePartitionInsertOptions, yieldToEventLoop, createPartitionIndex, writePartitionDocument } from './chunk-6A5XE2MA.mjs';
2
2
 
3
3
  // src/partitioning/constants.ts
4
4
  var REBALANCE_CHUNK_SIZE = 1e3;
@@ -1,4 +1,4 @@
1
- import { VERSION, GROUP_PATTERN_SOURCE, loadGzip } from './chunk-F4MIGBBP.mjs';
1
+ import { VERSION, GROUP_PATTERN_SOURCE, loadGzip } from './chunk-6A5XE2MA.mjs';
2
2
  import { flattenSchema } from './chunk-ZDDJVR7X.mjs';
3
3
  import { MAX_FILE_BYTES, CHECKSUM_YIELD_CHUNK_BYTES } from './chunk-VUJCSQG5.mjs';
4
4
  import { NarsilError, ErrorCodes } from './chunk-TQ26BKBH.mjs';
@@ -1,4 +1,4 @@
1
- import { createSurfaceRegistry, SegmentRefusal, encodeSurfaceTable, encodePartialSpellingsOf, encodeStringBlob, mergeTextAt, generateId, encodeExternalIdTableData, buildPartialWordTableFrom, wrapFrozenTokenTable, encodeDocumentTableData, topLevelMapKeys, mergeStoredFields, prepareDocumentText, recordValueSize, patternIndexOf, encodeFieldIndexes, mergeFieldRegions, sameFields, partialSpellingsOfDocuments, storedDocumentsOf, encodeFrozenTokenTableData, mergeKeywordSources, GrowingSegment, LivePostings, createSpellingTable, createNumericIndex, createBooleanIndex, createEnumIndex, createLoadedGeoIndex } from './chunk-F4MIGBBP.mjs';
1
+ import { createSurfaceRegistry, SegmentRefusal, encodeSurfaceTable, encodePartialSpellingsOf, encodeStringBlob, mergeTextAt, generateId, encodeExternalIdTableData, buildPartialWordTableFrom, wrapFrozenTokenTable, encodeDocumentTableData, topLevelMapKeys, mergeStoredFields, prepareDocumentText, recordValueSize, patternIndexOf, encodeFieldIndexes, mergeFieldRegions, sameFields, partialSpellingsOfDocuments, storedDocumentsOf, encodeFrozenTokenTableData, mergeKeywordSources, GrowingSegment, LivePostings, createSpellingTable, createNumericIndex, createBooleanIndex, createEnumIndex, createLoadedGeoIndex } from './chunk-6A5XE2MA.mjs';
2
2
  import { storedText, bitsetIterator } from './chunk-SK3DPAI4.mjs';
3
3
  import { encodeDocument } from './chunk-YOTP2FPE.mjs';
4
4
  import { schemaFieldsOf, getNestedValue, isWordIndexedBase, validateDocument, validateDocumentStrict } from './chunk-ZDDJVR7X.mjs';
@@ -10,12 +10,14 @@ var WAL_ONLY_FIELDS = ["directory", "mode", "flushIntervalMs", "segmentMaxBytes"
10
10
  function configError(message) {
11
11
  return new NarsilError(ErrorCodes.CONFIG_INVALID, message);
12
12
  }
13
- function requireKnob(name, value, minimum) {
13
+ function requireKnob(name, value, minimum, whole = false) {
14
14
  if (value === void 0) {
15
15
  return;
16
16
  }
17
- if (typeof value !== "number" || !Number.isFinite(value) || value < minimum) {
18
- throw configError(`durability.${name} must be a finite number of at least ${minimum}, got ${String(value)}`);
17
+ if (typeof value !== "number" || !(whole ? Number.isSafeInteger(value) : Number.isFinite(value)) || value < minimum) {
18
+ throw configError(
19
+ `durability.${name} must be ${whole ? "an integer" : "a finite number"} of at least ${minimum}, got ${String(value)}`
20
+ );
19
21
  }
20
22
  }
21
23
  function requireValidDurabilityConfig(durability) {
@@ -35,6 +37,7 @@ function requireValidDurabilityConfig(durability) {
35
37
  );
36
38
  }
37
39
  requireKnob("compactionThreshold", durability.compactionThreshold, 1);
40
+ requireKnob("rewriteBytesPerCheckpoint", durability.rewriteBytesPerCheckpoint, 1, true);
38
41
  if (durability.tier === "snapshot") {
39
42
  for (const field of WAL_ONLY_FIELDS) {
40
43
  if (durability[field] !== void 0) {
@@ -1,5 +1,5 @@
1
- import { readHeapStatistics, withOpenIndex, oneAtATime, validateBM25Params, storedBM25Params, loadSchemaCodeFor, loadStorageCode, lookupOfStoredSynonyms, reconstructSchemaFromMetadata, getLanguage, validatePatternValueLimit, requireSurfaceFormsForPartialFields, prepareStoredSynonyms, getVectorFieldPaths, arrayPositionsAreStale, validatePartitionConfig, emitSyncChange, validateEmbeddingConfig, isSyncEpoch, newSyncEpoch } from './chunk-F4MIGBBP.mjs';
2
- export { bindOptionalWritesHost, holdVectorsForRollback, insertDocument, insertDocumentBatch, removeDocument, removeDocumentBatch, rollbackInsertedDocument, rollbackRemovedDocument, rollbackUpdatedDocument, updateDocument, updateDocumentBatch } from './chunk-F4MIGBBP.mjs';
1
+ import { readHeapStatistics, withOpenIndex, oneAtATime, validateBM25Params, storedBM25Params, loadSchemaCodeFor, loadStorageCode, lookupOfStoredSynonyms, reconstructSchemaFromMetadata, getLanguage, validatePatternValueLimit, requireSurfaceFormsForPartialFields, prepareStoredSynonyms, getVectorFieldPaths, arrayPositionsAreStale, validatePartitionConfig, emitSyncChange, validateEmbeddingConfig, isSyncEpoch, newSyncEpoch } from './chunk-6A5XE2MA.mjs';
2
+ export { bindOptionalWritesHost, holdVectorsForRollback, insertDocument, insertDocumentBatch, removeDocument, removeDocumentBatch, rollbackInsertedDocument, rollbackRemovedDocument, rollbackUpdatedDocument, updateDocument, updateDocumentBatch } from './chunk-6A5XE2MA.mjs';
3
3
  import './chunk-J2BQTJJE.mjs';
4
4
  import './chunk-I7DTUOK2.mjs';
5
5
  import './chunk-SK3DPAI4.mjs';
@@ -208,6 +208,7 @@ async function createIndexFromMetadata(deps, metadata, loadData) {
208
208
  throw recoveryFailure(metadata, err);
209
209
  }
210
210
  deps.indexRegistry.set(metadata.indexName, {
211
+ storedSizes: deps.indexRegistry.get(metadata.indexName)?.storedSizes,
211
212
  config: indexConfig,
212
213
  language,
213
214
  embeddingAdapter: embedding.adapter,
@@ -216,6 +217,7 @@ async function createIndexFromMetadata(deps, metadata, loadData) {
216
217
  indexUuid: metadata.indexUuid ?? null,
217
218
  heldPartitions: metadata.heldPartitions ?? null,
218
219
  documentCount: metadata.documentCount ?? 0,
220
+ savedBytes: metadata.savedBytes,
219
221
  partitionCount,
220
222
  analysisRevision: metadata.analysisRevision ?? null,
221
223
  arrayPositionGap: metadata.arrayPositionGap ?? null,
@@ -1,7 +1,7 @@
1
- import { installSuggestionHooks, RestoredHistory, clearLeftoversOfName } from './chunk-GVWLACAT.mjs';
2
- export { startQuerySuggestions } from './chunk-GVWLACAT.mjs';
3
- import { attachedRuntimeOf, withState, unionOfBans, BUILD_WRITE_BATCH } from './chunk-F6BJYCF2.mjs';
4
- import { loadStorageCode, loadOptionalWrites, emitEngineEvent, removeDocumentBatch2 } from './chunk-F4MIGBBP.mjs';
1
+ import { installSuggestionHooks, RestoredHistory, clearLeftoversOfName } from './chunk-DZ4FQW5K.mjs';
2
+ export { startQuerySuggestions } from './chunk-DZ4FQW5K.mjs';
3
+ import { attachedRuntimeOf, withState, unionOfBans, BUILD_WRITE_BATCH } from './chunk-UPN4NUXU.mjs';
4
+ import { loadStorageCode, loadOptionalWrites, emitEngineEvent, removeDocumentBatch2 } from './chunk-6A5XE2MA.mjs';
5
5
  import './chunk-J2BQTJJE.mjs';
6
6
  import './chunk-I7DTUOK2.mjs';
7
7
  import './chunk-SK3DPAI4.mjs';
@@ -1,5 +1,5 @@
1
- export { DEFAULT_WRITE_AHEAD_QUEUE_MAX_SIZE, REBALANCE_CHUNK_SIZE, rebuildTextIndexes, rewriteSpillOf, textRebuildTargetOf } from './chunk-57R74JWC.mjs';
2
- export { bindSegmentCodecHost, createEncodedDocumentSource, createSharedFrozenSegment, decodeEveryStoredDocument, decodeMapWithoutFields, decodeStoredDocument, encodeDocumentTableData, endOfValue, reconstructSchemaFromMetadata, storedDocumentsOf, topLevelMapKeys } from './chunk-F4MIGBBP.mjs';
1
+ export { DEFAULT_WRITE_AHEAD_QUEUE_MAX_SIZE, REBALANCE_CHUNK_SIZE, rebuildTextIndexes, rewriteSpillOf, textRebuildTargetOf } from './chunk-G4YYO5TC.mjs';
2
+ export { bindSegmentCodecHost, createEncodedDocumentSource, createSharedFrozenSegment, decodeEveryStoredDocument, decodeMapWithoutFields, decodeStoredDocument, encodeDocumentTableData, endOfValue, reconstructSchemaFromMetadata, storedDocumentsOf, topLevelMapKeys } from './chunk-6A5XE2MA.mjs';
3
3
  import './chunk-J2BQTJJE.mjs';
4
4
  import './chunk-I7DTUOK2.mjs';
5
5
  import './chunk-SK3DPAI4.mjs';
@@ -1,6 +1,6 @@
1
- export { deserializePartition, serializePartition } from './chunk-H344ZXRH.mjs';
2
- export { alreadyPresentOnWorker, buildSegmentPayloads, createRequestId, eligibleIndexNames, fieldIndexRemapOf, freezeEncodedSegmentShared, freezeSegmentShared, holdsADiscardedField, isDeterministicFailure, isValidWorkerResponse, mergeFieldIndexes, mergeSegmentContents, mergeSourceSpellings, mergeSourceSurfaces, mergedPartialSpellings, reportIneligible, segmentArraysOf, selectionKeeps, shareSegmentArrays, toError, workerIneligibility } from './chunk-GGBATERA.mjs';
3
- export { bindSegmentMergeHost, mergePostings } from './chunk-F4MIGBBP.mjs';
1
+ export { deserializePartition, serializePartition } from './chunk-DN2GVVR4.mjs';
2
+ export { alreadyPresentOnWorker, buildSegmentPayloads, createRequestId, eligibleIndexNames, fieldIndexRemapOf, freezeEncodedSegmentShared, freezeSegmentShared, holdsADiscardedField, isDeterministicFailure, isValidWorkerResponse, mergeFieldIndexes, mergeSegmentContents, mergeSourceSpellings, mergeSourceSurfaces, mergedPartialSpellings, reportIneligible, segmentArraysOf, selectionKeeps, shareSegmentArrays, toError, workerIneligibility } from './chunk-XNIH3WIB.mjs';
3
+ export { bindSegmentMergeHost, mergePostings } from './chunk-6A5XE2MA.mjs';
4
4
  import './chunk-J2BQTJJE.mjs';
5
5
  import './chunk-I7DTUOK2.mjs';
6
6
  import './chunk-SK3DPAI4.mjs';