@delali/narsil 0.3.1-next.109 → 0.3.1-next.112

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 (93) hide show
  1. package/dist/adapters/filesystem.mjs +1 -1
  2. package/dist/adapters/indexeddb.mjs +1 -1
  3. package/dist/browser/{chunk-RYWURYTW.mjs → chunk-2CBQ2PCC.mjs} +1 -1
  4. package/dist/browser/{chunk-EQ7BQ6VZ.mjs → chunk-LJS6PREA.mjs} +1 -0
  5. package/dist/browser/{chunk-3RXEGUGO.mjs → chunk-O5IKTA27.mjs} +41 -4
  6. package/dist/browser/{chunk-Z2K5AGZL.mjs → chunk-OVY4RPDS.mjs} +3 -3
  7. package/dist/browser/{chunk-S7KNCVPU.mjs → chunk-P7C2S5JX.mjs} +2 -2
  8. package/dist/browser/{chunk-SCBBEQWD.mjs → chunk-UR5MNN53.mjs} +189 -51
  9. package/dist/browser/{chunk-XHRHOH2P.mjs → chunk-YRYBTRWB.mjs} +139 -28
  10. package/dist/browser/{durability-wiring-JJGE7MED.mjs → durability-wiring-CPEMDDK7.mjs} +48 -20
  11. package/dist/browser/{module-PCKQADMQ.mjs → module-DYKR4INA.mjs} +5 -5
  12. package/dist/browser/{restore-queue-2STSWU2E.mjs → restore-queue-2H4QDQV4.mjs} +1 -1
  13. package/dist/browser/{runtime-ARKW5NZX.mjs → runtime-FL5K4JOH.mjs} +1 -1
  14. package/dist/browser/{snapshot-3AZDQKNA.mjs → snapshot-ISZMBDCN.mjs} +27 -14
  15. package/dist/browser/{write-XXLMPT3Y.mjs → write-IABOLE4N.mjs} +5 -5
  16. package/dist/{capabilities-D4MUmjfe.d.ts → capabilities-ByaX8Arf.d.ts} +2 -2
  17. package/dist/{chunk-CYXLPFBG.mjs → chunk-2IFU7SXG.mjs} +123 -35
  18. package/dist/{chunk-FN75BCXC.mjs → chunk-2RAQKITH.mjs} +1 -1
  19. package/dist/{chunk-VIXXQEX6.mjs → chunk-3COL24MT.mjs} +43 -6
  20. package/dist/{chunk-ICZW4J3I.mjs → chunk-3RRATITJ.mjs} +21 -21
  21. package/dist/{chunk-SAZB7ZHT.mjs → chunk-542TD4BL.mjs} +1 -1
  22. package/dist/{chunk-C57FPCTL.mjs → chunk-5WEBVYOA.mjs} +182 -44
  23. package/dist/{chunk-YP23IAV5.mjs → chunk-63HFWQEA.mjs} +4 -3
  24. package/dist/{chunk-FV5CP3E2.mjs → chunk-6ODIY6ZB.mjs} +1 -1
  25. package/dist/{chunk-RQ7LOBLD.mjs → chunk-6PN3U6XW.mjs} +1 -1
  26. package/dist/{chunk-SYHS56F7.mjs → chunk-7CI34JAP.mjs} +26 -13
  27. package/dist/{chunk-IBJWO5PF.mjs → chunk-7ZZQNOIY.mjs} +1 -1
  28. package/dist/{chunk-H5465KUZ.mjs → chunk-BVOUSX3U.mjs} +4 -3
  29. package/dist/{chunk-AWZVJCCW.mjs → chunk-DG62H7OD.mjs} +2 -2
  30. package/dist/{chunk-LWQTFKRS.mjs → chunk-FUUP45IS.mjs} +1 -1
  31. package/dist/{chunk-HL2GAS5N.mjs → chunk-GLZI636G.mjs} +7 -7
  32. package/dist/{chunk-C55OFKU6.mjs → chunk-HNAP2KTG.mjs} +2 -2
  33. package/dist/{chunk-A2HWRBQE.mjs → chunk-IBTKJIV7.mjs} +2 -2
  34. package/dist/{chunk-PA5WZWLC.mjs → chunk-IM76DLA7.mjs} +2 -2
  35. package/dist/{chunk-5LP7OU6B.mjs → chunk-IR4KQ4WB.mjs} +2 -2
  36. package/dist/{chunk-FABI2JA7.mjs → chunk-J6YVB2XM.mjs} +1 -1
  37. package/dist/{chunk-62GK7UUS.mjs → chunk-KCQG2PJT.mjs} +3 -3
  38. package/dist/{chunk-U6FT7LKG.mjs → chunk-LOBYK2FG.mjs} +3 -3
  39. package/dist/{chunk-XY6Z7T5W.mjs → chunk-N57XXGPG.mjs} +2 -2
  40. package/dist/{chunk-S2CKO6PP.mjs → chunk-OBWUWZRA.mjs} +1 -0
  41. package/dist/{chunk-CKRP7GCS.mjs → chunk-OCB7TMUQ.mjs} +1 -1
  42. package/dist/{chunk-NYWUBTMH.mjs → chunk-OFYKBKKV.mjs} +1 -1
  43. package/dist/{chunk-ZBZRBM2Z.mjs → chunk-PT7VRWS7.mjs} +3 -3
  44. package/dist/{chunk-DUWYU4D5.mjs → chunk-PWIWSUCX.mjs} +2 -2
  45. package/dist/{chunk-5W7ADHK7.mjs → chunk-QI6JW4PM.mjs} +1 -1
  46. package/dist/{chunk-SD2EYVU4.mjs → chunk-QIFOXLWF.mjs} +2 -2
  47. package/dist/{chunk-N75MAOM7.mjs → chunk-R2MRGYU5.mjs} +2 -2
  48. package/dist/{chunk-5DPTHLMX.mjs → chunk-V7G627TA.mjs} +1 -1
  49. package/dist/{chunk-4GD43FSW.mjs → chunk-V7ISFBFC.mjs} +10 -10
  50. package/dist/{chunk-MVWWAHTR.mjs → chunk-VK45J47R.mjs} +1 -1
  51. package/dist/{chunk-RSSLOFRP.mjs → chunk-VLRT47GU.mjs} +39 -8
  52. package/dist/{chunk-RPIE4QCL.mjs → chunk-YH5OIL7B.mjs} +2 -0
  53. package/dist/{chunk-JKOBHB4A.mjs → chunk-YIDSHBQS.mjs} +2 -2
  54. package/dist/{client-Ba9yP-Rr.d.ts → client-BdnzDFtO.d.ts} +2 -2
  55. package/dist/client.d.ts +6 -6
  56. package/dist/client.mjs +1 -0
  57. package/dist/{config-C-xXz8bC.d.ts → config-CSgvApt0.d.ts} +1 -1
  58. package/dist/{config-Dc_8-byz.d.ts → config-ujZESkJz.d.ts} +1 -1
  59. package/dist/{direct-executor-QH2M6AK2.mjs → direct-executor-ZSTKRA6Z.mjs} +11 -11
  60. package/dist/distribution/coordinator/etcd.mjs +94 -5
  61. package/dist/distribution/transport/grpc.mjs +24 -8
  62. package/dist/distribution/transport/in-memory.mjs +4 -4
  63. package/dist/distribution/transport/tcp.mjs +6 -6
  64. package/dist/distribution.d.ts +5 -5
  65. package/dist/distribution.mjs +1232 -377
  66. package/dist/{durability-wiring-4HWX7OVP.mjs → durability-wiring-EQTFL3B4.mjs} +65 -38
  67. package/dist/embeddings/openai.mjs +2 -2
  68. package/dist/{engine-CMZ5XSLy.d.ts → engine-C_HSy3iz.d.ts} +1 -1
  69. package/dist/{events-dnvgprIl.d.ts → events-CJsXF1F9.d.ts} +1 -0
  70. package/dist/index.browser.mjs +3 -3
  71. package/dist/index.d.ts +5 -5
  72. package/dist/index.mjs +16 -16
  73. package/dist/{module-IYILOTU3.mjs → module-WP4VVGV2.mjs} +9 -9
  74. package/dist/partial-words.mjs +5 -5
  75. package/dist/pattern.mjs +3 -3
  76. package/dist/persistence/durability/checkpoint-worker.d.ts +12 -0
  77. package/dist/persistence/durability/checkpoint-worker.mjs +25 -23
  78. package/dist/react.d.ts +6 -6
  79. package/dist/react.mjs +1 -0
  80. package/dist/{rerank-EHJVXEDP.mjs → rerank-3POMPQNX.mjs} +4 -4
  81. package/dist/rerankers/http.mjs +2 -2
  82. package/dist/{restore-queue-BONSQWCI.mjs → restore-queue-WZTMTJP2.mjs} +1 -1
  83. package/dist/{runtime-LEX2F7OW.mjs → runtime-C2435MPK.mjs} +5 -5
  84. package/dist/server.d.ts +8 -8
  85. package/dist/server.mjs +12 -12
  86. package/dist/{snapshot-DWDLN5YW.mjs → snapshot-EU6NNB2P.mjs} +25 -25
  87. package/dist/synonyms.mjs +3 -3
  88. package/dist/{tasks-B4B2cMK5.d.ts → tasks-CI3Fvkxw.d.ts} +1 -1
  89. package/dist/{thread-I32PUURR.mjs → thread-WGBCVJII.mjs} +11 -11
  90. package/dist/vector/search-worker.mjs +4 -4
  91. package/dist/workers/entry.mjs +5 -5
  92. package/dist/{write-AOFSHACR.mjs → write-CKRWS3P5.mjs} +18 -18
  93. package/package.json +7 -7
@@ -1,15 +1,15 @@
1
- import { PATTERN_EXPRESSION_OPERATORS, PATTERN_TEST_OPERATORS, PATTERN_ELEMENT_OPERATORS, requireTextRangeField, isFiniteNumber, invalid, requireFieldKind, kindOfValue, requireListLength, isObjectRecord, patternSearchModule, DEFAULT_PATTERN_WORK_CAP, bitsetHas, createBitSet, bitsetSet, bitsetIsEmpty, bitsetOrInto, bitsetAndNotInto, bitsetAndInto, bitsetFromSet, PATTERN_WORK_FLUSH_UNITS, MATCHER_STATE_BUDGET_BYTES } from './chunk-C55OFKU6.mjs';
1
+ import { PATTERN_EXPRESSION_OPERATORS, PATTERN_TEST_OPERATORS, PATTERN_ELEMENT_OPERATORS, requireTextRangeField, isFiniteNumber, invalid, requireFieldKind, kindOfValue, requireListLength, isObjectRecord, patternSearchModule, DEFAULT_PATTERN_WORK_CAP, bitsetHas, createBitSet, bitsetSet, bitsetIsEmpty, bitsetOrInto, bitsetAndNotInto, bitsetAndInto, bitsetFromSet, PATTERN_WORK_FLUSH_UNITS, MATCHER_STATE_BUDGET_BYTES } from './chunk-HNAP2KTG.mjs';
2
2
  import { GEO_UNIT_METRES, MAX_FILTER_DEPTH, MAX_FILTER_TESTS, FILTER_OPERAND_COPY_DEPTH } from './chunk-WQBCBKY3.mjs';
3
- import { expandTermPrefix, suggestDisplayTerms, getNestedValue, textFieldsChanged, getFlatSchema, tokenizeOptions, partialWordSearchModule, getOrCreateFieldNameIndex, partitionDocumentFrequency } from './chunk-62GK7UUS.mjs';
4
- import { isLatitude, MAX_LATITUDE_DEGREES, isLongitude, MAX_LONGITUDE_DEGREES, MIN_POLYGON_POINTS, partialFieldsOf, schemaFieldsOf, flattenSchema, validateDocument, validateDocumentStrict, ANTIMERIDIAN_SPAN_DEGREES, FULL_TURN_DEGREES, LOCATION_CODE_BITS_PER_AXIS, MAX_COVERING_CELLS, VINCENTY_CONVERGENCE_THRESHOLD, EARTH_RADIUS_METERS, RADIUS_BOX_MARGIN_RATIO, RADIUS_BOX_MARGIN_RADIANS, DEG_TO_RAD, VINCENTY_MAX_ITERATIONS } from './chunk-AWZVJCCW.mjs';
3
+ import { expandTermPrefix, suggestDisplayTerms, getNestedValue, textFieldsChanged, getFlatSchema, tokenizeOptions, partialWordSearchModule, getOrCreateFieldNameIndex, partitionDocumentFrequency } from './chunk-KCQG2PJT.mjs';
4
+ import { isLatitude, MAX_LATITUDE_DEGREES, isLongitude, MAX_LONGITUDE_DEGREES, MIN_POLYGON_POINTS, partialFieldsOf, schemaFieldsOf, flattenSchema, validateDocument, validateDocumentStrict, ANTIMERIDIAN_SPAN_DEGREES, FULL_TURN_DEGREES, LOCATION_CODE_BITS_PER_AXIS, MAX_COVERING_CELLS, VINCENTY_CONVERGENCE_THRESHOLD, EARTH_RADIUS_METERS, RADIUS_BOX_MARGIN_RATIO, RADIUS_BOX_MARGIN_RADIANS, DEG_TO_RAD, VINCENTY_MAX_ITERATIONS } from './chunk-DG62H7OD.mjs';
5
5
  import { MAX_SORT_FIELDS, MAX_SORT_FIELD_NAME_LENGTH, MAX_CURSOR_LENGTH, MAX_CURSOR_ANCHOR_CODE_POINTS, RESULT_WINDOW, DEFAULT_FUZZY_PREFIX_LENGTH, DEFAULT_PAGE_SIZE, PREFIX_MAX_EXPANSIONS } from './chunk-E74YLAIG.mjs';
6
6
  import { fuzzyPrefixOf, boundedLevenshtein, fuzzyTermMatches } from './chunk-GES7U2PM.mjs';
7
- import { parsedTypeOf, isStringValuedBase, withSortableOption, isWordIndexedBase, isWordIndexedFieldType, isListBase } from './chunk-FV5CP3E2.mjs';
8
- import { tokenize, SCORE_BUFFER_INITIAL_TOUCHED_CAPACITY, PRUNING_REJECTION_SLACK, visitTokens, SORT_COLUMN_MINIMUM_REBUILD_THRESHOLD, TARGET_BLOCK_ENTRIES, SORT_COLUMN_REBUILD_FRACTION_SHIFT } from './chunk-NYWUBTMH.mjs';
7
+ import { parsedTypeOf, isStringValuedBase, withSortableOption, isWordIndexedBase, isWordIndexedFieldType, isListBase } from './chunk-6ODIY6ZB.mjs';
8
+ import { tokenize, SCORE_BUFFER_INITIAL_TOUCHED_CAPACITY, PRUNING_REJECTION_SLACK, visitTokens, SORT_COLUMN_MINIMUM_REBUILD_THRESHOLD, TARGET_BLOCK_ENTRIES, SORT_COLUMN_REBUILD_FRACTION_SHIFT } from './chunk-OFYKBKKV.mjs';
9
9
  import { singleFoldTable, appendFoldedCodePoint, sortModeOf, defaultSortMode, SORT_VALUE_MAX_CODE_POINTS, toReducedSortValue, readSortField, compareComparableKeys, toComparableSortValue, isSortMode, SORT_MODES, compareSortValues, compareComparableValues, truncateSortString } from './chunk-R6A773WK.mjs';
10
10
  import { compareCodePoints, exceedsCodePoints, codePointCount, holdsUnpairedSurrogate } from './chunk-YTJCGKM4.mjs';
11
11
  import { isGeopointOrVectorType, PROTOTYPE_POLLUTION_KEYS } from './chunk-L5ORED7V.mjs';
12
- import { NarsilError, ErrorCodes } from './chunk-S2CKO6PP.mjs';
12
+ import { NarsilError, ErrorCodes } from './chunk-OBWUWZRA.mjs';
13
13
 
14
14
  // src/core/partition/partial-words/platform.ts
15
15
  function platformPartialWordSearch() {
@@ -597,6 +597,8 @@ function createDocumentStore() {
597
597
  // src/core/constants.ts
598
598
  var POSTING_LIST_COMPACTION_THRESHOLD = 0.3;
599
599
  var MAX_TERM_FREQUENCY = 65535;
600
+ var PENDING_REMOVAL_MERGE_FLOOR = 64;
601
+ var PENDING_REMOVAL_MERGE_DIVISOR = 256;
600
602
 
601
603
  // src/core/inverted-index/constants.ts
602
604
  var TERM_TABLE_START_CAPACITY = 1 << 10;
@@ -2187,6 +2189,7 @@ function vincentyDistance(lat1, lon1, lat2, lon2) {
2187
2189
  }
2188
2190
 
2189
2191
  // src/geo/geo-index.ts
2192
+ var REMOVED_DOC_ID = -1;
2190
2193
  function firstAtOrAfter(entries, code) {
2191
2194
  let lo = 0;
2192
2195
  let hi = entries.length;
@@ -2197,25 +2200,58 @@ function firstAtOrAfter(entries, code) {
2197
2200
  }
2198
2201
  return lo;
2199
2202
  }
2203
+ function dropRemoved(entries) {
2204
+ let write = 0;
2205
+ for (let read = 0; read < entries.length; read++) {
2206
+ if (entries[read].docId !== REMOVED_DOC_ID) entries[write++] = entries[read];
2207
+ }
2208
+ entries.length = write;
2209
+ }
2210
+ function mergeSortedPending(entries, pending) {
2211
+ pending.sort((left2, right2) => left2.code - right2.code || left2.docId - right2.docId);
2212
+ const mainLength = entries.length;
2213
+ for (const entry of pending) entries.push(entry);
2214
+ let left = mainLength - 1;
2215
+ let right = pending.length - 1;
2216
+ let write = entries.length - 1;
2217
+ while (right >= 0) {
2218
+ const later = left >= 0 ? entries[left] : void 0;
2219
+ const next = pending[right];
2220
+ if (later !== void 0 && (later.code > next.code || later.code === next.code && later.docId > next.docId)) {
2221
+ entries[write--] = later;
2222
+ left--;
2223
+ } else {
2224
+ entries[write--] = next;
2225
+ right--;
2226
+ }
2227
+ }
2228
+ }
2200
2229
  function createGeoIndex() {
2201
- const entries = [];
2230
+ let entries = [];
2231
+ let pending = [];
2202
2232
  const byDocument = /* @__PURE__ */ new Map();
2203
- let sorted = true;
2233
+ let removedCount = 0;
2204
2234
  function ensureSorted() {
2205
- if (sorted) return;
2206
- entries.sort((left, right) => left.code - right.code || left.docId - right.docId);
2207
- sorted = true;
2208
- }
2209
- function removeEntry(internalId) {
2210
- const entry = byDocument.get(internalId);
2211
- if (entry === void 0) return;
2212
- byDocument.delete(internalId);
2213
- ensureSorted();
2214
- for (let at = firstAtOrAfter(entries, entry.code); at < entries.length; at++) {
2215
- if (entries[at] !== entry) continue;
2216
- entries.splice(at, 1);
2217
- return;
2235
+ if (removedCount > 0) {
2236
+ dropRemoved(entries);
2237
+ dropRemoved(pending);
2238
+ removedCount = 0;
2239
+ }
2240
+ if (pending.length === 0) return;
2241
+ if (entries.length === 0) {
2242
+ pending.sort((left, right) => left.code - right.code || left.docId - right.docId);
2243
+ entries = pending;
2244
+ } else {
2245
+ mergeSortedPending(entries, pending);
2218
2246
  }
2247
+ pending = [];
2248
+ }
2249
+ function removeEntry(entry) {
2250
+ byDocument.delete(entry.docId);
2251
+ entry.docId = REMOVED_DOC_ID;
2252
+ removedCount++;
2253
+ const held = entries.length + pending.length;
2254
+ if (removedCount >= Math.max(PENDING_REMOVAL_MERGE_FLOOR, held / PENDING_REMOVAL_MERGE_DIVISOR)) ensureSorted();
2219
2255
  }
2220
2256
  function matching(boxes, passes, inside) {
2221
2257
  ensureSorted();
@@ -2234,14 +2270,15 @@ function createGeoIndex() {
2234
2270
  }
2235
2271
  const index = {
2236
2272
  insert(internalId, lat, lon) {
2237
- removeEntry(internalId);
2273
+ const existing = byDocument.get(internalId);
2274
+ if (existing !== void 0) removeEntry(existing);
2238
2275
  const entry = { lat, lon, docId: internalId, code: locationCode(lat, lon) };
2239
- entries.push(entry);
2276
+ pending.push(entry);
2240
2277
  byDocument.set(internalId, entry);
2241
- sorted = false;
2242
2278
  },
2243
2279
  remove(internalId) {
2244
- removeEntry(internalId);
2280
+ const existing = byDocument.get(internalId);
2281
+ if (existing !== void 0) removeEntry(existing);
2245
2282
  },
2246
2283
  radiusQuery(lat, lon, distanceMeters, inside, highPrecision) {
2247
2284
  const distanceFn = highPrecision ? vincentyDistance : haversineDistance;
@@ -2257,13 +2294,14 @@ function createGeoIndex() {
2257
2294
  },
2258
2295
  documentsBitset(capacity) {
2259
2296
  const bits = createBitSet(capacity);
2260
- for (const entry of entries) bitsetSet(bits, entry.docId);
2297
+ for (const docId of byDocument.keys()) bitsetSet(bits, docId);
2261
2298
  return bits;
2262
2299
  },
2263
2300
  clear() {
2264
- entries.length = 0;
2301
+ entries = [];
2302
+ pending = [];
2265
2303
  byDocument.clear();
2266
- sorted = true;
2304
+ removedCount = 0;
2267
2305
  },
2268
2306
  serialize() {
2269
2307
  ensureSorted();
@@ -2591,29 +2629,126 @@ function collectDocIdsBitset(entries, from, to, capacity) {
2591
2629
  }
2592
2630
  return bs;
2593
2631
  }
2632
+ function removalsFor(byDocument, docId, value) {
2633
+ const keys = byDocument.get(docId);
2634
+ if (keys === void 0) return void 0;
2635
+ for (const key of keys) {
2636
+ if (key.value === value) return key;
2637
+ }
2638
+ return void 0;
2639
+ }
2640
+ function groupRemovals(docIds, values, limits) {
2641
+ const byDocument = /* @__PURE__ */ new Map();
2642
+ for (let at = 0; at < docIds.length; at++) {
2643
+ const existing = removalsFor(byDocument, docIds[at], values[at]);
2644
+ if (existing !== void 0) {
2645
+ existing.limits.push(limits[at]);
2646
+ continue;
2647
+ }
2648
+ const key = { value: values[at], limits: [limits[at]], next: 0 };
2649
+ const keys = byDocument.get(docIds[at]);
2650
+ if (keys === void 0) byDocument.set(docIds[at], [key]);
2651
+ else keys.push(key);
2652
+ }
2653
+ return byDocument;
2654
+ }
2655
+ function markedDocuments(docIds) {
2656
+ let highest = 0;
2657
+ for (const docId of docIds) if (docId > highest) highest = docId;
2658
+ const marked = new Uint8Array(highest + 1);
2659
+ for (const docId of docIds) marked[docId] = 1;
2660
+ return marked;
2661
+ }
2662
+ function removeFromSorted(entries, from, marked, byDocument) {
2663
+ let write = from;
2664
+ for (let read = from; read < entries.length; read++) {
2665
+ const entry = entries[read];
2666
+ if (entry.docId < marked.length && marked[entry.docId] === 1) {
2667
+ const key = removalsFor(byDocument, entry.docId, entry.value);
2668
+ if (key !== void 0 && key.next < key.limits.length) {
2669
+ key.next++;
2670
+ continue;
2671
+ }
2672
+ }
2673
+ entries[write++] = entry;
2674
+ }
2675
+ entries.length = write;
2676
+ }
2677
+ function removeFromPending(pending, marked, byDocument) {
2678
+ let write = 0;
2679
+ for (let read = 0; read < pending.length; read++) {
2680
+ const entry = pending[read];
2681
+ if (entry.docId < marked.length && marked[entry.docId] === 1) {
2682
+ const key = removalsFor(byDocument, entry.docId, entry.value);
2683
+ if (key !== void 0) {
2684
+ while (key.next < key.limits.length && key.limits[key.next] <= read) key.next++;
2685
+ if (key.next < key.limits.length) {
2686
+ key.next++;
2687
+ continue;
2688
+ }
2689
+ }
2690
+ }
2691
+ pending[write++] = entry;
2692
+ }
2693
+ pending.length = write;
2694
+ }
2695
+ function mergeSortedPending2(entries, pending) {
2696
+ pending.sort((a, b) => a.value - b.value);
2697
+ const mainLength = entries.length;
2698
+ for (const entry of pending) entries.push(entry);
2699
+ let left = mainLength - 1;
2700
+ let right = pending.length - 1;
2701
+ let write = entries.length - 1;
2702
+ while (right >= 0) {
2703
+ if (left >= 0 && entries[left].value > pending[right].value) entries[write--] = entries[left--];
2704
+ else entries[write--] = pending[right--];
2705
+ }
2706
+ }
2594
2707
  function createNumericIndex() {
2595
2708
  let entries = [];
2596
- let sorted = true;
2709
+ let pending = [];
2710
+ const removedDocIds = [];
2711
+ const removedValues = [];
2712
+ const removedLimits = [];
2713
+ function applyRemovals() {
2714
+ const byDocument = groupRemovals(removedDocIds, removedValues, removedLimits);
2715
+ const marked = markedDocuments(removedDocIds);
2716
+ let lowest = removedValues[0];
2717
+ for (const value of removedValues) if (value < lowest) lowest = value;
2718
+ removeFromSorted(entries, lowerBound(entries, lowest), marked, byDocument);
2719
+ if (pending.length > 0) removeFromPending(pending, marked, byDocument);
2720
+ removedDocIds.length = 0;
2721
+ removedValues.length = 0;
2722
+ removedLimits.length = 0;
2723
+ }
2597
2724
  function ensureSorted() {
2598
- if (!sorted) {
2599
- entries.sort((a, b) => a.value - b.value);
2600
- sorted = true;
2725
+ if (removedDocIds.length > 0) applyRemovals();
2726
+ if (pending.length === 0) return;
2727
+ if (entries.length === 0) {
2728
+ pending.sort((a, b) => a.value - b.value);
2729
+ entries = pending;
2730
+ } else {
2731
+ mergeSortedPending2(entries, pending);
2601
2732
  }
2733
+ pending = [];
2734
+ }
2735
+ function discardPending() {
2736
+ pending = [];
2737
+ removedDocIds.length = 0;
2738
+ removedValues.length = 0;
2739
+ removedLimits.length = 0;
2602
2740
  }
2603
2741
  return {
2604
2742
  insert(internalId, value) {
2605
- entries.push({ value, docId: internalId });
2606
- sorted = false;
2743
+ pending.push({ value, docId: internalId });
2607
2744
  },
2608
2745
  remove(internalId, value) {
2609
- ensureSorted();
2610
- const start = lowerBound(entries, value);
2611
- const end = upperBound(entries, value);
2612
- for (let i = start; i < end; i++) {
2613
- if (entries[i].docId === internalId) {
2614
- entries.splice(i, 1);
2615
- return;
2616
- }
2746
+ removedDocIds.push(internalId);
2747
+ removedValues.push(value);
2748
+ removedLimits.push(pending.length);
2749
+ const held = entries.length + pending.length;
2750
+ if (removedDocIds.length >= Math.max(PENDING_REMOVAL_MERGE_FLOOR, held / PENDING_REMOVAL_MERGE_DIVISOR)) {
2751
+ ensureSorted();
2617
2752
  }
2618
2753
  },
2619
2754
  queryEq(value) {
@@ -2650,6 +2785,7 @@ function createNumericIndex() {
2650
2785
  return collectDocIds(entries, lowerBound(entries, min), upperBound(entries, max));
2651
2786
  },
2652
2787
  getAllDocIds() {
2788
+ ensureSorted();
2653
2789
  return collectDocIds(entries, 0, entries.length);
2654
2790
  },
2655
2791
  queryEqBitset(value, capacity) {
@@ -2677,9 +2813,11 @@ function createNumericIndex() {
2677
2813
  return collectDocIdsBitset(entries, lowerBound(entries, min), upperBound(entries, max), capacity);
2678
2814
  },
2679
2815
  getAllDocIdsBitset(capacity) {
2816
+ ensureSorted();
2680
2817
  return collectDocIdsBitset(entries, 0, entries.length, capacity);
2681
2818
  },
2682
2819
  count() {
2820
+ ensureSorted();
2683
2821
  return entries.length;
2684
2822
  },
2685
2823
  facetValueCounts(matched) {
@@ -2717,7 +2855,7 @@ function createNumericIndex() {
2717
2855
  },
2718
2856
  clear() {
2719
2857
  entries = [];
2720
- sorted = true;
2858
+ discardPending();
2721
2859
  },
2722
2860
  serialize() {
2723
2861
  ensureSorted();
@@ -2725,7 +2863,7 @@ function createNumericIndex() {
2725
2863
  },
2726
2864
  deserialize(data) {
2727
2865
  entries = data.slice();
2728
- sorted = true;
2866
+ discardPending();
2729
2867
  }
2730
2868
  };
2731
2869
  }
@@ -1,11 +1,11 @@
1
- import { readRecentMemoryFigures, readMemoryFigures, collectGarbageBeforeRefusal, collectYoungGenerationBeforeRefusal, reportRefusalAfterCollection, answerRefusalOf, reservedHeapBytes, admitHeapBytes } from './chunk-5DPTHLMX.mjs';
1
+ import { readRecentMemoryFigures, readMemoryFigures, collectGarbageBeforeRefusal, collectYoungGenerationBeforeRefusal, reportRefusalAfterCollection, answerRefusalOf, reservedHeapBytes, admitHeapBytes } from './chunk-V7G627TA.mjs';
2
2
  import { nativeSearchCoreIsEnabled } from './chunk-DJHHF2L5.mjs';
3
3
  import { DEFAULT_RERANK_WINDOW } from './chunk-HJSN7UYG.mjs';
4
- import { loadNativeCore } from './chunk-MVWWAHTR.mjs';
4
+ import { loadNativeCore } from './chunk-VK45J47R.mjs';
5
5
  import { MAX_FILTER_DEPTH } from './chunk-WQBCBKY3.mjs';
6
6
  import { MAX_SORT_FIELDS } from './chunk-E74YLAIG.mjs';
7
7
  import { HEAP_BLOCK_FRACTION_BELOW_V8_INEFFECTIVE_MARK_COMPACT_LINE } from './chunk-ZXZ26WSO.mjs';
8
- import { NarsilError, ServerErrorCodes, ErrorCodes } from './chunk-S2CKO6PP.mjs';
8
+ import { NarsilError, ServerErrorCodes, ErrorCodes } from './chunk-OBWUWZRA.mjs';
9
9
  import { randomUUID } from 'crypto';
10
10
  import { mkdtemp, open, rm } from 'fs/promises';
11
11
  import { tmpdir } from 'os';
@@ -218,6 +218,7 @@ var STATUS_BY_CODE = {
218
218
  REPLICATION_INSYNC_REMOVAL_FAILED: 503,
219
219
  REPLICATION_ROLLBACK_FAILED: 503,
220
220
  REPLICATION_OUTCOME_UNKNOWN: 503,
221
+ REPLICATION_WRITE_CONFLICT: 409,
221
222
  REPLICATION_LOG_FULL: 503,
222
223
  REPLICATION_ENTRY_CORRUPT: 503,
223
224
  REPLICATION_SNAPSHOT_CORRUPT: 503,
@@ -1,5 +1,5 @@
1
1
  import { PARSED_FIELD_TYPE_CACHE_ENTRIES, VECTOR_PATTERN, MAX_STORED_VECTOR_DIMENSION } from './chunk-L5ORED7V.mjs';
2
- import { NarsilError, ErrorCodes } from './chunk-S2CKO6PP.mjs';
2
+ import { NarsilError, ErrorCodes } from './chunk-OBWUWZRA.mjs';
3
3
 
4
4
  // src/schema/validator/field-type.ts
5
5
  var FIELD_OPTION_ORDER = ["sortable", "pattern", "partial"];
@@ -1,5 +1,5 @@
1
1
  import { SCRATCH_SLOTS_PER_THREAD_POOL } from './chunk-QSK35UC2.mjs';
2
- import { NarsilError, ErrorCodes } from './chunk-S2CKO6PP.mjs';
2
+ import { NarsilError, ErrorCodes } from './chunk-OBWUWZRA.mjs';
3
3
 
4
4
  // src/workers/constants.ts
5
5
  var WORKER_YOUNG_GENERATION_MB = 24;
@@ -1,10 +1,10 @@
1
- import { vectorsPerFile } from './chunk-ZBZRBM2Z.mjs';
2
- import { writeLiveVectors, decodeSegmentManifest, openManifestPayload, listedKeysOf, decodeManifestPayload, SINGLE_NODE_PRIMARY_TERM } from './chunk-RSSLOFRP.mjs';
3
- import { vectorsToBytes, VECTOR_FILE_PAYLOAD_VERSION } from './chunk-CKRP7GCS.mjs';
4
- import { writeCheckpointSegments, DEFAULT_COMPACTION_THRESHOLD, commitCheckpointManifest, manifestKey, manifestFileRefs, partitionContentsOf } from './chunk-CYXLPFBG.mjs';
5
- import { HEADER_SIZE } from './chunk-ICZW4J3I.mjs';
1
+ import { vectorsPerFile } from './chunk-PT7VRWS7.mjs';
2
+ import { writeLiveVectors, decodeSegmentManifest, openManifestPayload, listedKeysOf, decodeManifestPayload, SINGLE_NODE_PRIMARY_TERM } from './chunk-VLRT47GU.mjs';
3
+ import { vectorsToBytes, VECTOR_FILE_PAYLOAD_VERSION } from './chunk-OCB7TMUQ.mjs';
4
+ import { writeCheckpointSegments, DEFAULT_COMPACTION_THRESHOLD, commitCheckpointManifest, manifestKey, manifestFileRefs, partitionContentsOf } from './chunk-2IFU7SXG.mjs';
5
+ import { HEADER_SIZE } from './chunk-3RRATITJ.mjs';
6
6
  import { MAX_FILE_BYTES } from './chunk-U476IXKQ.mjs';
7
- import { NarsilError, ErrorCodes } from './chunk-S2CKO6PP.mjs';
7
+ import { NarsilError, ErrorCodes } from './chunk-OBWUWZRA.mjs';
8
8
 
9
9
  // src/persistence/archive/memory-store.ts
10
10
  function joined(chunks) {
@@ -77,12 +77,24 @@ function partitionVectorPlan(vectorIndex, docIds) {
77
77
  }
78
78
  function capture(input) {
79
79
  const partitionIds = input.partitionId === null ? Array.from({ length: input.manager.partitionCount }, (_, partitionId) => partitionId) : [input.partitionId];
80
- const targets = partitionIds.map((partitionId) => ({
81
- partitionId,
82
- lastSeqNo: input.appliedSeqNo(partitionId),
83
- primaryTerm: SINGLE_NODE_PRIMARY_TERM
84
- }));
85
- const contents = partitionIds.map((partitionId) => partitionContentsOf(input.manager, partitionId));
80
+ const { indexName } = input;
81
+ const writeRecords = input.writeRecords ?? null;
82
+ const targets = partitionIds.map((partitionId) => {
83
+ const target = {
84
+ partitionId,
85
+ lastSeqNo: input.appliedSeqNo(partitionId),
86
+ primaryTerm: SINGLE_NODE_PRIMARY_TERM
87
+ };
88
+ if (writeRecords !== null) target.termHistory = writeRecords.termHistoryOf(indexName, partitionId, target.lastSeqNo);
89
+ return target;
90
+ });
91
+ const contents = partitionIds.map(
92
+ (partitionId) => partitionContentsOf(
93
+ input.manager,
94
+ partitionId,
95
+ writeRecords === null ? void 0 : (segments) => writeRecords.captureSegments(indexName, partitionId, segments)
96
+ )
97
+ );
86
98
  const plans = /* @__PURE__ */ new Map();
87
99
  const partitionDocIds = input.partitionId === null ? null : [...input.manager.getPartition(input.partitionId).docIds()];
88
100
  for (const [fieldPath, vectorIndex] of input.vectorIndexes) {
@@ -105,7 +117,8 @@ async function buildArchiveFromMemory(input) {
105
117
  targets: captured.targets,
106
118
  compactionThreshold: DEFAULT_COMPACTION_THRESHOLD,
107
119
  prior: null,
108
- wholePartitions: captured.contents
120
+ wholePartitions: captured.contents,
121
+ keepsWriteRecords: input.writeRecords != null
109
122
  });
110
123
  const vectors = await writeLiveVectors({ store, indexName: input.indexName, plans: captured.plans, priorVectors: [] });
111
124
  const refs = vectors.refs;
@@ -1,4 +1,4 @@
1
- import { NarsilError } from './chunk-S2CKO6PP.mjs';
1
+ import { NarsilError } from './chunk-OBWUWZRA.mjs';
2
2
 
3
3
  // src/http-retry/constants.ts
4
4
  var RETRYABLE_STATUS_CODES = /* @__PURE__ */ new Set([429, 500, 502, 503, 504]);
@@ -1,6 +1,6 @@
1
- import { readMetadataEnvelope } from './chunk-RSSLOFRP.mjs';
2
- import { readWalSegments, durableRecordMissing, checkpointLastSeqNo, SEGMENT_HEADER_SIZE } from './chunk-CYXLPFBG.mjs';
3
- import { applyDeleteEntry, applyIndexEntry } from './chunk-VIXXQEX6.mjs';
1
+ import { readMetadataEnvelope } from './chunk-VLRT47GU.mjs';
2
+ import { readWalSegments, durableRecordMissing, checkpointLastSeqNo, SEGMENT_HEADER_SIZE } from './chunk-2IFU7SXG.mjs';
3
+ import { applyDeleteEntry, applyIndexEntry } from './chunk-3COL24MT.mjs';
4
4
 
5
5
  // src/persistence/durability/recovery.ts
6
6
  async function listPersistedIndexes(directory) {
@@ -113,6 +113,7 @@ async function truncateSegmentTail(directory, key, durableByteLength) {
113
113
  }
114
114
  }
115
115
  function applyEntry(entry, deps) {
116
+ deps.writeRecords?.replayed(entry);
116
117
  if (entry.operation === "DELETE") {
117
118
  applyDeleteEntry(entry, deps.manager, deps.vectorIndexes);
118
119
  return;
@@ -1,9 +1,9 @@
1
1
  import { MAX_DOCUMENT_ENCODING_DEPTH, DOCUMENT_ENCODER_RETAINED_BUFFER_BYTES, DOCUMENT_REPLY_ENVELOPE_DEPTH } from './chunk-U476IXKQ.mjs';
2
2
  import { EARLIER_RELEASE_MIN_M, MIN_M, MAX_M } from './chunk-VJS4JFBQ.mjs';
3
- import { isWordIndexedBase, parseFieldType } from './chunk-FV5CP3E2.mjs';
3
+ import { isWordIndexedBase, parseFieldType } from './chunk-6ODIY6ZB.mjs';
4
4
  import { compareCodePoints, holdsUnpairedSurrogate, exceedsCodePoints } from './chunk-YTJCGKM4.mjs';
5
5
  import { DEFAULT_PATTERN_VALUE_LIMIT, isPlainObject, MAX_TEXT_FIELDS, MAX_VECTOR_DIMENSION, MAX_DOCUMENT_BYTES, MAX_NESTING_DEPTH, PROTOTYPE_POLLUTION_KEYS, FIELD_NAME_PATTERN, RESERVED_ROOT_FIELDS, MAX_DOCUMENT_NESTING_DEPTH, VECTOR_PATTERN } from './chunk-L5ORED7V.mjs';
6
- import { NarsilError, ErrorCodes } from './chunk-S2CKO6PP.mjs';
6
+ import { NarsilError, ErrorCodes } from './chunk-OBWUWZRA.mjs';
7
7
  import { Encoder, encode } from '@msgpack/msgpack';
8
8
 
9
9
  // src/schema/validator/schema.ts
@@ -1,5 +1,5 @@
1
1
  import { english } from './chunk-TGP5M5R7.mjs';
2
- import { NarsilError, ErrorCodes } from './chunk-S2CKO6PP.mjs';
2
+ import { NarsilError, ErrorCodes } from './chunk-OBWUWZRA.mjs';
3
3
 
4
4
  // src/languages/registry.ts
5
5
  var languages = /* @__PURE__ */ new Map();
@@ -1,15 +1,15 @@
1
- import { normalizeSort, requireMatchingCursor, encodePageCursor, decodePageCursor, projectionKeepsField, resolveProjection, clampRowCount, sortSignatureOf, requireSortableFields, fanOutQuery, requireWithinResultWindow, sortModesOf, applySorting, applyPagination, countsWithoutScores, fanOutMatchCount, FNV_OFFSET_BASIS, validatedFilterOf, createPatternWorkMeter, partialWordsToHighlight, partialWordHighlighter, pruneStatsToQueryTerms, everyValueFacetConfig, fulltextMatches, mergeFacets, applyPartitionFiltersBitset, fnv1aContinue, partitionsIn, fnv1aContinueTaggedNumbers, undeclaredFieldOnStrictIndex } from './chunk-C57FPCTL.mjs';
1
+ import { normalizeSort, requireMatchingCursor, encodePageCursor, decodePageCursor, projectionKeepsField, resolveProjection, clampRowCount, sortSignatureOf, requireSortableFields, fanOutQuery, requireWithinResultWindow, sortModesOf, applySorting, applyPagination, countsWithoutScores, fanOutMatchCount, FNV_OFFSET_BASIS, validatedFilterOf, createPatternWorkMeter, partialWordsToHighlight, partialWordHighlighter, pruneStatsToQueryTerms, everyValueFacetConfig, fulltextMatches, mergeFacets, applyPartitionFiltersBitset, fnv1aContinue, partitionsIn, fnv1aContinueTaggedNumbers, undeclaredFieldOnStrictIndex } from './chunk-5WEBVYOA.mjs';
2
2
  import { MAX_INDEX_NAME_LENGTH, INDEX_NAME_PATTERN, MAX_DOC_ID_LENGTH, DEFAULT_LIMIT, DEFAULT_SUGGEST_LIMIT, MAX_SUGGEST_LIMIT, MAX_SUGGEST_SCATTER_LIMIT, ABSOLUTE_WINDOWS_PATH_PATTERN, MODULE_URL_SCHEME_PATTERN, DEFAULT_OFFSET } from './chunk-LXWDQLTW.mjs';
3
3
  import { MIN_OVERSAMPLE, MAX_RENUMBERED_SEARCH_ATTEMPTS } from './chunk-QSK35UC2.mjs';
4
- import { flattenSchema, partialFieldsOf } from './chunk-AWZVJCCW.mjs';
4
+ import { flattenSchema, partialFieldsOf } from './chunk-DG62H7OD.mjs';
5
5
  import { DEFAULT_MAX_PER_GROUP, DEFAULT_FUZZY_PREFIX_LENGTH, DEFAULT_LINEAR_ALPHA, MIN_LINEAR_ALPHA, MAX_LINEAR_ALPHA, DEFAULT_RANK_CONSTANT, MIN_RANK_CONSTANT, RESULT_WINDOW, MAX_TOLERANCE, MAX_PREFIX_LENGTH } from './chunk-E74YLAIG.mjs';
6
6
  import { fuzzyTermMatches } from './chunk-GES7U2PM.mjs';
7
- import { isStringValuedBase, parsedTypeOf, isWordIndexedFieldType } from './chunk-FV5CP3E2.mjs';
8
- import { tokenize } from './chunk-NYWUBTMH.mjs';
7
+ import { isStringValuedBase, parsedTypeOf, isWordIndexedFieldType } from './chunk-6ODIY6ZB.mjs';
8
+ import { tokenize } from './chunk-OFYKBKKV.mjs';
9
9
  import { compareComparableKeys } from './chunk-R6A773WK.mjs';
10
10
  import { compareCodePoints, holdsUnpairedSurrogate } from './chunk-YTJCGKM4.mjs';
11
11
  import { MIN_PATTERN_VALUE_LIMIT, MAX_PATTERN_VALUE_LIMIT, isGeopointOrVectorType, VECTOR_PATTERN } from './chunk-L5ORED7V.mjs';
12
- import { NarsilError, ErrorCodes } from './chunk-S2CKO6PP.mjs';
12
+ import { NarsilError, ErrorCodes } from './chunk-OBWUWZRA.mjs';
13
13
 
14
14
  // src/search/cursor-binding.ts
15
15
  var ABSENT_TAG = 0;
@@ -1401,13 +1401,13 @@ function requireCursorDepth(cursor, signature, binding) {
1401
1401
  }
1402
1402
  function hybridSearchOf(params, context, limit, offset, cursorDepth) {
1403
1403
  if ((params.hybrid?.depth ?? null) === null) return executeHybridSearch(params, context, limit, offset, cursorDepth);
1404
- return import('./runtime-LEX2F7OW.mjs').then(
1404
+ return import('./runtime-C2435MPK.mjs').then(
1405
1405
  (runtime) => runtime.searchFixedDepthHybrid(params, context, { cursorDepth: cursorDepth ?? 0, offset, limit }, runtimeHost)
1406
1406
  );
1407
1407
  }
1408
1408
  function executeQuery(request, callerContext) {
1409
1409
  if (request.rerank === void 0) return runQuery(request, callerContext);
1410
- return import('./runtime-LEX2F7OW.mjs').then(
1410
+ return import('./runtime-C2435MPK.mjs').then(
1411
1411
  (runtime) => runtime.executeRerankedQuery(request, callerContext, executeQuery, runtimeHost)
1412
1412
  );
1413
1413
  }
@@ -1,8 +1,8 @@
1
1
  import { MAX_FILTER_ARRAY_SIZE } from './chunk-WQBCBKY3.mjs';
2
2
  import { tabulatedLevenshtein } from './chunk-GES7U2PM.mjs';
3
- import { parsedTypeOf } from './chunk-FV5CP3E2.mjs';
3
+ import { parsedTypeOf } from './chunk-6ODIY6ZB.mjs';
4
4
  import { codePointCount, exceedsCodePoints } from './chunk-YTJCGKM4.mjs';
5
- import { NarsilError, ErrorCodes } from './chunk-S2CKO6PP.mjs';
5
+ import { NarsilError, ErrorCodes } from './chunk-OBWUWZRA.mjs';
6
6
 
7
7
  // src/core/bitset.ts
8
8
  function createBitSet(capacity) {
@@ -1,5 +1,5 @@
1
- import { sanitizeSurfaceForms, patternIndexesFromWire, dropStoredVectorValues } from './chunk-RSSLOFRP.mjs';
2
- import { requireValidFieldTypes } from './chunk-AWZVJCCW.mjs';
1
+ import { sanitizeSurfaceForms, patternIndexesFromWire, dropStoredVectorValues } from './chunk-VLRT47GU.mjs';
2
+ import { requireValidFieldTypes } from './chunk-DG62H7OD.mjs';
3
3
  import { VALID_HNSW_METRICS } from './chunk-U476IXKQ.mjs';
4
4
  import { decode } from '@msgpack/msgpack';
5
5
 
@@ -1,8 +1,8 @@
1
1
  import { nodeThreadId } from './chunk-C7SLA6CM.mjs';
2
2
  import { getFs, getPath } from './chunk-HLPRHOSO.mjs';
3
- import { DIRECTORY_LOCK_ATTEMPTS, DIRECTORY_LOCK_SETTLE_MS, DIRECTORY_LOCK_PROCESS_START_TOLERANCE_MS } from './chunk-CYXLPFBG.mjs';
3
+ import { DIRECTORY_LOCK_ATTEMPTS, DIRECTORY_LOCK_SETTLE_MS, DIRECTORY_LOCK_PROCESS_START_TOLERANCE_MS } from './chunk-2IFU7SXG.mjs';
4
4
  import { compareCodePoints } from './chunk-YTJCGKM4.mjs';
5
- import { NarsilError, ErrorCodes } from './chunk-S2CKO6PP.mjs';
5
+ import { NarsilError, ErrorCodes } from './chunk-OBWUWZRA.mjs';
6
6
  import { openSync, close, readFileSync } from 'fs';
7
7
  import { rename, readFile, writeFile, unlink, realpath, readdir, readlink } from 'fs/promises';
8
8
  import { endianness } from 'os';
@@ -1,7 +1,7 @@
1
1
  import { parseSynonymRules, encodeSynonymRules, decodeSynonymRules, SYNONYM_EXPANSION_CACHE_ENTRIES, SYNONYMS_ADDED_PER_QUERY } from './chunk-7X5JST5L.mjs';
2
- import { encodeStringBlob, tokenize, encodeLookupKey } from './chunk-NYWUBTMH.mjs';
2
+ import { encodeStringBlob, tokenize, encodeLookupKey } from './chunk-OFYKBKKV.mjs';
3
3
  import { compareCodePoints } from './chunk-YTJCGKM4.mjs';
4
- import { NarsilError, ErrorCodes } from './chunk-S2CKO6PP.mjs';
4
+ import { NarsilError, ErrorCodes } from './chunk-OBWUWZRA.mjs';
5
5
 
6
6
  // src/analysis/registry.ts
7
7
  var tokenizers = /* @__PURE__ */ new Map();
@@ -1,5 +1,5 @@
1
1
  import { MAX_MESSAGE_SIZE_BYTES } from './chunk-UNEEFTEU.mjs';
2
- import { TransportError, TransportErrorCodes } from './chunk-RPIE4QCL.mjs';
2
+ import { TransportError, TransportErrorCodes } from './chunk-YH5OIL7B.mjs';
3
3
  import { encode, decode } from '@msgpack/msgpack';
4
4
 
5
5
  // src/distribution/transport/tcp/types.ts
@@ -1,8 +1,8 @@
1
- import { flattenSchema } from './chunk-AWZVJCCW.mjs';
1
+ import { flattenSchema } from './chunk-DG62H7OD.mjs';
2
2
  import { PARTIAL_WORD_MIN_CODE_POINTS, PARTIAL_WORDS_ADDED_PER_QUERY, DEFAULT_FUZZY_PREFIX_LENGTH } from './chunk-E74YLAIG.mjs';
3
3
  import { fuzzyTermMatches } from './chunk-GES7U2PM.mjs';
4
- import { isWordIndexedBase } from './chunk-FV5CP3E2.mjs';
5
- import { encodeStringBlob, tokenize, resolveStopWords, transformToken, visitTokens, visitSurfaceSpellings } from './chunk-NYWUBTMH.mjs';
4
+ import { isWordIndexedBase } from './chunk-6ODIY6ZB.mjs';
5
+ import { encodeStringBlob, tokenize, resolveStopWords, transformToken, visitTokens, visitSurfaceSpellings } from './chunk-OFYKBKKV.mjs';
6
6
  import { compareCodePoints, codePointCount } from './chunk-YTJCGKM4.mjs';
7
7
 
8
8
  // src/core/partition/suggestions.ts
@@ -1,10 +1,10 @@
1
1
  import { MAX_PARTITION_COUNT, MAX_REPLICATION_FACTOR } from './chunk-P36MUFEJ.mjs';
2
- import { readSharedConfigFields, restoredEmbedding, restoredPartitionConfig } from './chunk-XY6Z7T5W.mjs';
3
- import { generateId, getLanguage } from './chunk-LWQTFKRS.mjs';
2
+ import { readSharedConfigFields, restoredEmbedding, restoredPartitionConfig } from './chunk-N57XXGPG.mjs';
3
+ import { generateId, getLanguage } from './chunk-FUUP45IS.mjs';
4
4
  import { MAX_INDEX_NAME_LENGTH, INDEX_NAME_PATTERN } from './chunk-LXWDQLTW.mjs';
5
5
  import { decodeSynonymRules } from './chunk-7X5JST5L.mjs';
6
6
  import { compareCodePoints } from './chunk-YTJCGKM4.mjs';
7
- import { NarsilError, ErrorCodes } from './chunk-S2CKO6PP.mjs';
7
+ import { NarsilError, ErrorCodes } from './chunk-OBWUWZRA.mjs';
8
8
  import { encode, decode } from '@msgpack/msgpack';
9
9
 
10
10
  // src/narsil/write-blocks.ts
@@ -1,5 +1,5 @@
1
- import { requireDocumentWithinSizeLimit, validateRequiredFields } from './chunk-AWZVJCCW.mjs';
2
- import { ErrorCodes, NarsilError } from './chunk-S2CKO6PP.mjs';
1
+ import { requireDocumentWithinSizeLimit, validateRequiredFields } from './chunk-DG62H7OD.mjs';
2
+ import { ErrorCodes, NarsilError } from './chunk-OBWUWZRA.mjs';
3
3
 
4
4
  // src/narsil/internals.ts
5
5
  var engineCores = /* @__PURE__ */ new WeakMap();
@@ -70,6 +70,7 @@ var ErrorCodes = {
70
70
  REPLICATION_INSYNC_REMOVAL_FAILED: "REPLICATION_INSYNC_REMOVAL_FAILED",
71
71
  REPLICATION_ROLLBACK_FAILED: "REPLICATION_ROLLBACK_FAILED",
72
72
  REPLICATION_OUTCOME_UNKNOWN: "REPLICATION_OUTCOME_UNKNOWN",
73
+ REPLICATION_WRITE_CONFLICT: "REPLICATION_WRITE_CONFLICT",
73
74
  REPLICATION_LOG_FULL: "REPLICATION_LOG_FULL",
74
75
  REPLICATION_ENTRY_CORRUPT: "REPLICATION_ENTRY_CORRUPT",
75
76
  REPLICATION_SNAPSHOT_CORRUPT: "REPLICATION_SNAPSHOT_CORRUPT",
@@ -1,6 +1,6 @@
1
1
  import { osqRecordBytes } from './chunk-37CD3OKS.mjs';
2
2
  import { MAX_M, EARLIER_RELEASE_MIN_M, MIN_M } from './chunk-VJS4JFBQ.mjs';
3
- import { NarsilError, ErrorCodes } from './chunk-S2CKO6PP.mjs';
3
+ import { NarsilError, ErrorCodes } from './chunk-OBWUWZRA.mjs';
4
4
 
5
5
  // src/vector/vector-index/dead-bits.ts
6
6
  var NO_LIVE_VECTOR_AT_POSITION = -1;
@@ -1,5 +1,5 @@
1
1
  import { compareCodePoints } from './chunk-YTJCGKM4.mjs';
2
- import { createNarsilError, ErrorCodes } from './chunk-S2CKO6PP.mjs';
2
+ import { createNarsilError, ErrorCodes } from './chunk-OBWUWZRA.mjs';
3
3
 
4
4
  // src/core/tokenizer/constants.ts
5
5
  var TOKEN_CACHE_SIZE_FLOOR = 5e4;