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

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 (170) hide show
  1. package/README.md +1 -0
  2. package/dist/adapters/filesystem.mjs +2 -2
  3. package/dist/adapters/gcs.mjs +2 -2
  4. package/dist/adapters/indexeddb.mjs +1 -1
  5. package/dist/adapters/s3.mjs +2 -2
  6. package/dist/browser/chunk-4E5APHTM.mjs +1459 -0
  7. package/dist/browser/{chunk-4ZICWS4V.mjs → chunk-QAOVAYAG.mjs} +1 -1
  8. package/dist/browser/{chunk-CPSHS46N.mjs → chunk-UQG4HUGQ.mjs} +82 -50
  9. package/dist/browser/{chunk-2Q45HI5H.mjs → chunk-YINZFPLT.mjs} +7 -0
  10. package/dist/browser/{module-XVLHJ7T7.mjs → module-ZZTNG5JZ.mjs} +26 -3
  11. package/dist/browser/{optional-writes-ZTBHYQMN.mjs → optional-writes-J5BHKEQL.mjs} +21 -8
  12. package/dist/browser/{storage-leaf-4XMCITJ6.mjs → storage-leaf-N3JMQ6CF.mjs} +14569 -13747
  13. package/dist/{capabilities-DAHXphRn.d.ts → capabilities-CLnQHIqV.d.ts} +51 -9
  14. package/dist/{chunk-KLVMK3R5.mjs → chunk-2CKDCC65.mjs} +1 -1
  15. package/dist/{chunk-CODGHJVW.mjs → chunk-2HVQYOOD.mjs} +40 -12
  16. package/dist/{chunk-M5I64AQW.mjs → chunk-3N5GUXBI.mjs} +33 -33
  17. package/dist/{chunk-DU23J5JG.mjs → chunk-5CIHQIA4.mjs} +6 -6
  18. package/dist/{react-native/chunks/chunk-ZUFOYZ5P.mjs → chunk-62X472AC.mjs} +1 -1
  19. package/dist/{chunk-QJGDB3WR.mjs → chunk-6GHX35ZM.mjs} +2 -2
  20. package/dist/{chunk-G3XRHAJA.mjs → chunk-6MC6BCXK.mjs} +3 -3
  21. package/dist/{chunk-X5NHWOXT.mjs → chunk-7P5YWDRQ.mjs} +2 -2
  22. package/dist/{chunk-MHBG33R5.mjs → chunk-7X4IIREW.mjs} +76 -46
  23. package/dist/{chunk-F4OOBPKA.mjs → chunk-AOYQTX6W.mjs} +1 -1
  24. package/dist/{chunk-D6FYUTFN.mjs → chunk-ASZLNVWW.mjs} +1 -1
  25. package/dist/{chunk-LR6JJVML.mjs → chunk-D2EJUM4A.mjs} +764 -699
  26. package/dist/{chunk-FETZYCH7.mjs → chunk-F6F4G322.mjs} +26 -1
  27. package/dist/{chunk-2YWWHMVC.mjs → chunk-FGOGT273.mjs} +2 -2
  28. package/dist/{chunk-5BUEBIXR.mjs → chunk-GLXLSPLO.mjs} +18 -5
  29. package/dist/{chunk-IE3Q62QD.mjs → chunk-GR5GMFJJ.mjs} +1 -1
  30. package/dist/{chunk-Y7QUFIGV.mjs → chunk-GXED6R3Q.mjs} +2 -2
  31. package/dist/{chunk-BVZWWMOU.mjs → chunk-HHYQMGPW.mjs} +2 -2
  32. package/dist/{chunk-SL53DHVE.mjs → chunk-HSA3H3VW.mjs} +121 -68
  33. package/dist/{chunk-YM2HI5N5.mjs → chunk-IL5DRCNU.mjs} +2 -2
  34. package/dist/{chunk-JDG6CCXM.mjs → chunk-JENWA4WX.mjs} +2 -2
  35. package/dist/{chunk-2GONI5HL.mjs → chunk-JXINPXRS.mjs} +5 -4
  36. package/dist/chunk-K5GNK5GE.mjs +602 -0
  37. package/dist/{chunk-WLFOLAQI.mjs → chunk-KBU3ZFJN.mjs} +2 -2
  38. package/dist/{chunk-EDEE7ETQ.mjs → chunk-KOA6T2IC.mjs} +3 -3
  39. package/dist/{chunk-N3M4NPML.mjs → chunk-M2Z5WVWW.mjs} +1 -1
  40. package/dist/{chunk-EWGIF6FQ.mjs → chunk-NJJN4FMM.mjs} +1 -1
  41. package/dist/{chunk-C7YQHCSO.mjs → chunk-P4F4UWLC.mjs} +1 -1
  42. package/dist/{chunk-VYSWVQCE.mjs → chunk-PAPQGC6I.mjs} +2 -2
  43. package/dist/{chunk-I2WJCRIH.mjs → chunk-R2PJKSNL.mjs} +1 -1
  44. package/dist/{chunk-6SZQETSC.mjs → chunk-RORNUNXW.mjs} +5 -2
  45. package/dist/{chunk-FBQYC5OX.mjs → chunk-SB5HCIIO.mjs} +16 -13
  46. package/dist/{chunk-CYCVPTTR.mjs → chunk-SCZI7COG.mjs} +2 -2
  47. package/dist/{chunk-O337MDRJ.mjs → chunk-SHES4VP5.mjs} +38 -13
  48. package/dist/{chunk-H4QYQ5DE.mjs → chunk-SIIDIGKI.mjs} +2 -2
  49. package/dist/{chunk-A3OAFUZI.mjs → chunk-SM2SYVIX.mjs} +2 -2
  50. package/dist/{chunk-II6XF6M4.mjs → chunk-SMLUZGSI.mjs} +9 -8
  51. package/dist/{chunk-2KCCQK4R.mjs → chunk-TSE2VWPX.mjs} +2 -2
  52. package/dist/{chunk-WSIU6YXQ.mjs → chunk-YPEJ6ODL.mjs} +1732 -743
  53. package/dist/{chunk-7WXGUTWK.mjs → chunk-Z6SIJH5O.mjs} +17 -6
  54. package/dist/{chunk-Q3ZZH5Z7.mjs → chunk-ZKOQR7EA.mjs} +7 -0
  55. package/dist/{chunk-CKEOTSF5.mjs → chunk-ZS2YUB2L.mjs} +6 -3
  56. package/dist/{chunk-FCQMZDRI.mjs → chunk-ZVZYJIIP.mjs} +3 -3
  57. package/dist/{client-DpqtT2XG.d.ts → client-uB0kp2yT.d.ts} +88 -5
  58. package/dist/client.d.ts +7 -7
  59. package/dist/client.mjs +3 -1265
  60. package/dist/{config-D9WR3MhO.d.ts → config-BvHQ-C7U.d.ts} +3 -3
  61. package/dist/{config-C687-reW.d.ts → config-PqgNY1H7.d.ts} +1 -1
  62. package/dist/{core-leaf-NEUM7PU3.mjs → core-leaf-TAR3GJVE.mjs} +3 -3
  63. package/dist/{direct-executor-37IH3ISS.mjs → direct-executor-WSZALYCV.mjs} +8 -8
  64. package/dist/distribution/coordinator/etcd.d.ts +1 -1
  65. package/dist/distribution/coordinator/etcd.mjs +35 -15
  66. package/dist/distribution/coordinator/in-memory.d.ts +1 -1
  67. package/dist/distribution/coordinator/in-memory.mjs +16 -6
  68. package/dist/distribution/transport/grpc.mjs +2 -2
  69. package/dist/distribution/transport/tcp.mjs +2 -2
  70. package/dist/distribution.d.ts +70 -9
  71. package/dist/distribution.mjs +1695 -680
  72. package/dist/{durability-config-NWU2G2SJ.mjs → durability-config-VWS2K24E.mjs} +1 -1
  73. package/dist/{react-native/chunks/embed-4LBSQD7U.mjs → embed-4PHHKGBK.mjs} +1 -1
  74. package/dist/embeddings/openai.mjs +2 -2
  75. package/dist/{engine-De6JzTW8.d.ts → engine-qjAxJSKk.d.ts} +206 -7
  76. package/dist/{index-CBUl4z3E.d.ts → index-BaQIAnk0.d.ts} +137 -111
  77. package/dist/index.browser.mjs +3 -3
  78. package/dist/index.d.ts +4 -4
  79. package/dist/index.mjs +8 -8
  80. package/dist/index.react-native.mjs +9 -9
  81. package/dist/{long-query-thread-DIPJBMV7.mjs → long-query-thread-N2DNPEA3.mjs} +21 -21
  82. package/dist/{module-Z3CL4GJ4.mjs → module-UQFIJQMG.mjs} +33 -13
  83. package/dist/{msgpack-leaf-7KBYOVTF.mjs → msgpack-leaf-H5ZYW7S7.mjs} +4 -4
  84. package/dist/{optional-reads-ENKMVQ4Q.mjs → optional-reads-5HFMF2QZ.mjs} +2 -2
  85. package/dist/{optional-writes-YIVJMQ4D.mjs → optional-writes-CGDBJBHQ.mjs} +31 -18
  86. package/dist/{paged-partition-archive-IZ6U7DVN.mjs → paged-partition-archive-UK44CVXG.mjs} +20 -20
  87. package/dist/partial-words.browser.mjs +3 -3
  88. package/dist/partial-words.mjs +8 -8
  89. package/dist/pattern.browser.mjs +2 -2
  90. package/dist/pattern.mjs +3 -3
  91. package/dist/persistence/durability/checkpoint-worker.d.ts +7 -0
  92. package/dist/persistence/durability/checkpoint-worker.mjs +18 -18
  93. package/dist/{phrase-module-ZY3TLTQA.mjs → phrase-module-EFESWOCR.mjs} +2 -2
  94. package/dist/{query-actions-7EOKT3WD.mjs → query-actions-7BL3YZDW.mjs} +8 -8
  95. package/dist/query-suggestions/merge-worker.mjs +11 -11
  96. package/dist/query-suggestions.browser.mjs +3 -3
  97. package/dist/query-suggestions.d.ts +1 -1
  98. package/dist/query-suggestions.mjs +9 -9
  99. package/dist/react-native/chunks/{chunk-TQ26BKBH.mjs → chunk-43R4GCM7.mjs} +7 -0
  100. package/dist/react-native/chunks/{chunk-CBU4M3EU.mjs → chunk-63DZ26X5.mjs} +277 -75
  101. package/dist/react-native/chunks/{chunk-BN6FUB7N.mjs → chunk-AN4HKLB4.mjs} +1 -1
  102. package/dist/react-native/chunks/{chunk-T5HF3FW3.mjs → chunk-BNFGA7TY.mjs} +3 -3
  103. package/dist/react-native/chunks/{chunk-PVMEHBQO.mjs → chunk-CW2ZFXSE.mjs} +1 -1
  104. package/dist/react-native/chunks/{chunk-NLEFMPY3.mjs → chunk-G434H5WG.mjs} +15 -4
  105. package/dist/react-native/chunks/{chunk-SK3DPAI4.mjs → chunk-HTBY4GON.mjs} +2 -2
  106. package/dist/react-native/chunks/{chunk-ZQPSXN6C.mjs → chunk-IP3QLETQ.mjs} +5 -5
  107. package/dist/react-native/chunks/{chunk-7TPO4FLE.mjs → chunk-LOKGE4OQ.mjs} +3 -3
  108. package/dist/react-native/chunks/{chunk-ZDDJVR7X.mjs → chunk-MRH36RN3.mjs} +2 -2
  109. package/dist/react-native/chunks/{chunk-YOTP2FPE.mjs → chunk-UO44MA5M.mjs} +1 -1
  110. package/dist/{chunk-4JBTALUC.mjs → react-native/chunks/chunk-UYAZLGEM.mjs} +1 -1
  111. package/dist/react-native/chunks/{chunk-WFQ6YQZA.mjs → chunk-UYKIV2KT.mjs} +1 -1
  112. package/dist/react-native/chunks/{chunk-IEY4DARA.mjs → chunk-XHYOQ4K4.mjs} +2 -2
  113. package/dist/react-native/chunks/{chunk-OZ3XEM6D.mjs → chunk-ZUJCUPVS.mjs} +1 -1
  114. package/dist/react-native/chunks/{core-leaf-TPBRRWVN.mjs → core-leaf-5PVST5PR.mjs} +4 -4
  115. package/dist/react-native/chunks/{durability-config-RVTWSXPH.mjs → durability-config-FCSD4MXY.mjs} +1 -1
  116. package/dist/{embed-2QMYCD2Q.mjs → react-native/chunks/embed-HA2I7RCF.mjs} +1 -1
  117. package/dist/react-native/chunks/{gzip.react-native-DLO4WW27.mjs → gzip.react-native-CVM4NQG2.mjs} +2 -2
  118. package/dist/react-native/chunks/{module-COLNJNML.mjs → module-QRCYB7QV.mjs} +32 -9
  119. package/dist/react-native/chunks/msgpack-leaf-JMNGSTRW.mjs +7 -0
  120. package/dist/react-native/chunks/{optional-reads-74HYI4DO.mjs → optional-reads-AFPO2FEB.mjs} +3 -3
  121. package/dist/react-native/chunks/{optional-writes-QETIM6BI.mjs → optional-writes-GC6JWMAF.mjs} +31 -18
  122. package/dist/react-native/chunks/{phrase-module-UC4YGEBB.mjs → phrase-module-IGYBK7XH.mjs} +3 -3
  123. package/dist/react-native/chunks/{resolve-vector-text-FU7D4QP5.mjs → resolve-vector-text-GE2CRJKI.mjs} +1 -1
  124. package/dist/react-native/chunks/{restore-queue-3E2MJIJS.mjs → restore-queue-2ACONS4W.mjs} +12 -12
  125. package/dist/react-native/chunks/{segment-codec-leaf-IE4DXUZV.mjs → segment-codec-leaf-SSIWXVUG.mjs} +10 -10
  126. package/dist/react-native/chunks/{segment-merge-leaf-62LQ5WZB.mjs → segment-merge-leaf-I2WDFE6O.mjs} +11 -11
  127. package/dist/react-native/chunks/{storage-leaf-LNOLKWZB.mjs → storage-leaf-YXXMG4VR.mjs} +14727 -13915
  128. package/dist/react-native/chunks/{store-leaf-Y7CBOPFZ.mjs → store-leaf-FS7A4PZA.mjs} +11 -11
  129. package/dist/react-native/chunks/{suggestions-leaf-PSUGL6MI.mjs → suggestions-leaf-PSFCT5EX.mjs} +11 -11
  130. package/dist/react-native/chunks/{worker-copies-MW5O5U3D.mjs → worker-copies-QRMISMEL.mjs} +10 -10
  131. package/dist/react-native/partial-words.mjs +9 -9
  132. package/dist/react-native/pattern.mjs +5 -5
  133. package/dist/react-native/query-suggestions.mjs +9 -9
  134. package/dist/react-native/sync.mjs +433 -51
  135. package/dist/react-native/synonyms.mjs +9 -9
  136. package/dist/react.d.ts +8 -8
  137. package/dist/react.mjs +7 -0
  138. package/dist/{rerank-KTV5L7MZ.mjs → rerank-4GFC26FD.mjs} +8 -8
  139. package/dist/rerankers/http.mjs +2 -2
  140. package/dist/{resolve-vector-text-SD6BEMKZ.mjs → resolve-vector-text-OD4J3WHF.mjs} +2 -2
  141. package/dist/{restore-queue-ES7TDJ5V.mjs → restore-queue-E4EIUYVV.mjs} +11 -11
  142. package/dist/{segment-codec-leaf-DO75VKEV.mjs → segment-codec-leaf-MP6DILVE.mjs} +9 -9
  143. package/dist/{segment-merge-leaf-JGND6LG5.mjs → segment-merge-leaf-ED2NMUC5.mjs} +9 -9
  144. package/dist/server.d.ts +13 -9
  145. package/dist/server.mjs +875 -348
  146. package/dist/{storage-leaf-ZI3H2WJY.mjs → storage-leaf-HQFO37W7.mjs} +5234 -5835
  147. package/dist/{store-leaf-YIH36Y5J.mjs → store-leaf-PL2G7RM5.mjs} +10 -10
  148. package/dist/{suggestions-leaf-FP5HSTFP.mjs → suggestions-leaf-I3MEHACP.mjs} +12 -12
  149. package/dist/sync/filesystem.d.ts +2 -2
  150. package/dist/sync/filesystem.mjs +16 -16
  151. package/dist/sync/indexeddb.browser.mjs +1 -1
  152. package/dist/sync/indexeddb.d.ts +2 -2
  153. package/dist/sync/indexeddb.mjs +3 -3
  154. package/dist/sync.browser.mjs +35 -1108
  155. package/dist/sync.d.ts +3 -3
  156. package/dist/sync.mjs +430 -51
  157. package/dist/synonyms.browser.mjs +3 -3
  158. package/dist/synonyms.mjs +8 -8
  159. package/dist/{tasks-X2IJQc8J.d.ts → tasks-C65V7lIr.d.ts} +3 -3
  160. package/dist/thread-LTFI3RK5.mjs +31 -0
  161. package/dist/{types-D0YasjoX.d.ts → types-CpCg-Gq-.d.ts} +1 -1
  162. package/dist/vector/search-worker.mjs +5 -5
  163. package/dist/{worker-copies-WYPRCNB7.mjs → worker-copies-P7YWXEP5.mjs} +11 -11
  164. package/dist/workers/entry.mjs +14 -14
  165. package/openapi.json +144 -0
  166. package/package.json +5 -7
  167. package/dist/chunk-URVH6BLO.mjs +0 -217
  168. package/dist/react-native/chunks/msgpack-leaf-GTKLF6GJ.mjs +0 -7
  169. package/dist/thread-NQRNW3IH.mjs +0 -31
  170. /package/dist/{chunk-CV3Q2EKO.mjs → chunk-S5QMWECL.mjs} +0 -0
@@ -1,17 +1,17 @@
1
- import { encodeDocument } from './chunk-KLVMK3R5.mjs';
2
- import { workerResourceLimits, admittedHeapBytes, collectYoungGenerationBeforeRefusal, collectGarbageBeforeRefusal } from './chunk-F4OOBPKA.mjs';
1
+ import { encodeDocument } from './chunk-2CKDCC65.mjs';
2
+ import { workerResourceLimits, admittedHeapBytes, collectYoungGenerationBeforeRefusal, collectGarbageBeforeRefusal } from './chunk-AOYQTX6W.mjs';
3
3
  import { headerAt, MAP_TAGS, decode, Decoder } from './chunk-GXCDWLQI.mjs';
4
4
  import { newSyncEpoch, isSyncEpoch } from './chunk-BUMREPLU.mjs';
5
5
  import { english } from './chunk-7T4LAYT4.mjs';
6
- import { patternSearchModule, PATTERN_EXPRESSION_OPERATORS, PATTERN_TEST_OPERATORS, PATTERN_ELEMENT_OPERATORS, requireTextRangeField, isFiniteNumber, invalid, requireFieldKind, kindOfValue, requireListLength, isObjectRecord, GEO_UNIT_METRES, matchPattern, claimsTypoPreparation, bitsetHas, bitsetClear, storedText, cachedStoredFields, storedValuesOf, DEFAULT_PATTERN_WORK_CAP, bitsetSet, discardStoredValues, MAX_FILTER_DEPTH, createBitSet, installStoredFields, storedValueBytes, bitsetIterator, PATTERN_WORK_FLUSH_UNITS, MATCHER_STATE_BUDGET_BYTES, bitsetIsEmpty, prepareStoredValues, fuzzyTermMatches, GrowableUint32, checkedSize, buildStoredValues, bitsetFromSet, MAX_FILTER_TESTS, TYPO_CLAIM_SLOTS_PER_WORD, fuzzyPrefixOf, boundedLevenshtein, bitsetAndNotInto, bitsetAndInto, bitsetOrInto, FILTER_OPERAND_COPY_DEPTH } from './chunk-YM2HI5N5.mjs';
7
- import { parsedTypeOf, isLatitude, MAX_LATITUDE_DEGREES, isLongitude, MAX_LONGITUDE_DEGREES, MIN_POLYGON_POINTS, isStringValuedBase, flattenSchema, schemaFieldsOf, getNestedValue, partialFieldsOf, MIN_PATTERN_VALUE_LIMIT, MAX_PATTERN_VALUE_LIMIT, requireLoadedMessagePack, vectorDimensionOf, isSingleStringFieldType, messagePackUpperBoundBytes, extractVectorFieldsFromSchema, validateSchema, requireCreatableSchema, validateVectorPromotion, validateVectorStorage, validateTextStorage, loadMessagePack, validateRequiredFields, requireDocumentWithinSizeLimit, raiseEarlierReleaseGraphSetting, isWordIndexedBase, PROTOTYPE_POLLUTION_KEYS, tokenizeOptions, isPlainObject, isWordIndexedFieldType, loadedMessagePack, validateDocument, validateDocumentStrict, textFieldsChanged, getFlatSchema, getOrCreateFieldNameIndex, MAX_NESTING_DEPTH, requireValidFieldTypes, parseVectorDimension, isStorageMode, isQuantizationMode, MAX_DOCUMENT_NESTING_DEPTH, withSortableOption, VECTOR_PATTERN, isListBase, isGeopointOrVectorType, MAX_COVERING_CELLS, LOCATION_CODE_BITS_PER_AXIS, LOCATION_CELLS_PER_AXIS, FULL_TURN_DEGREES, EARTH_RADIUS_METERS, DEG_TO_RAD, ANTIMERIDIAN_SPAN_DEGREES } from './chunk-X5NHWOXT.mjs';
8
- import { detectRuntime, splitWorkerBudget, resolveWorkerCount, DEFAULT_BACKPRESSURE_LIMIT, DEFAULT_REQUEST_TIMEOUT_MS, countEngineThread, requirePinnedState, createDocIdMap, SHUTDOWN_TIMEOUT_MS, stopOfSignal, requireSearchActive, resolveWorkerEntry, missingWorkerEntry, signalOfSearch, answerFromOneState, CONSECUTIVE_TIMEOUTS_BEFORE_DEATH, sharedStopOfSignal, engineThreadYoungGenerationBytes, resolveRequestThreadCount, spawnNodeWorker, bindSearchSignal, WORKER_YOUNG_GENERATION_MB, nodeThreadId, youngGenerationBytesOfThisV8 } from './chunk-6SZQETSC.mjs';
6
+ import { patternSearchModule, PATTERN_EXPRESSION_OPERATORS, PATTERN_TEST_OPERATORS, PATTERN_ELEMENT_OPERATORS, requireTextRangeField, isFiniteNumber, invalid, requireFieldKind, kindOfValue, requireListLength, isObjectRecord, GEO_UNIT_METRES, matchPattern, claimsTypoPreparation, DEFAULT_PATTERN_WORK_CAP, bitsetHas, bitsetClear, storedText, cachedStoredFields, storedValuesOf, bitsetSet, discardStoredValues, MAX_FILTER_DEPTH, createBitSet, installStoredFields, storedValueBytes, bitsetIterator, bitsetIsEmpty, prepareStoredValues, fuzzyTermMatches, MATCHER_STATE_BUDGET_BYTES, GrowableUint32, checkedSize, buildStoredValues, bitsetFromSet, MAX_FILTER_TESTS, TYPO_CLAIM_SLOTS_PER_WORD, fuzzyPrefixOf, boundedLevenshtein, bitsetAndNotInto, bitsetAndInto, bitsetOrInto, FILTER_OPERAND_COPY_DEPTH, PATTERN_WORK_FLUSH_UNITS } from './chunk-IL5DRCNU.mjs';
7
+ import { parsedTypeOf, isLatitude, MAX_LATITUDE_DEGREES, isLongitude, MAX_LONGITUDE_DEGREES, MIN_POLYGON_POINTS, isStringValuedBase, flattenSchema, schemaFieldsOf, getNestedValue, partialFieldsOf, MIN_PATTERN_VALUE_LIMIT, MAX_PATTERN_VALUE_LIMIT, requireLoadedMessagePack, vectorDimensionOf, isSingleStringFieldType, messagePackUpperBoundBytes, extractVectorFieldsFromSchema, validateSchema, requireCreatableSchema, validateVectorPromotion, validateVectorStorage, validateTextStorage, loadMessagePack, validateRequiredFields, requireDocumentWithinSizeLimit, raiseEarlierReleaseGraphSetting, isWordIndexedBase, PROTOTYPE_POLLUTION_KEYS, tokenizeOptions, isPlainObject, isWordIndexedFieldType, loadedMessagePack, validateDocument, validateDocumentStrict, textFieldsChanged, getFlatSchema, getOrCreateFieldNameIndex, MAX_NESTING_DEPTH, requireValidFieldTypes, parseVectorDimension, isStorageMode, isQuantizationMode, MAX_DOCUMENT_NESTING_DEPTH, withSortableOption, VECTOR_PATTERN, isListBase, isGeopointOrVectorType, MAX_COVERING_CELLS, LOCATION_CODE_BITS_PER_AXIS, LOCATION_CELLS_PER_AXIS, FULL_TURN_DEGREES, EARTH_RADIUS_METERS, DEG_TO_RAD, ANTIMERIDIAN_SPAN_DEGREES } from './chunk-7P5YWDRQ.mjs';
8
+ import { detectRuntime, splitWorkerBudget, resolveWorkerCount, DEFAULT_BACKPRESSURE_LIMIT, DEFAULT_REQUEST_TIMEOUT_MS, countEngineThread, requirePinnedState, createDocIdMap, SHUTDOWN_TIMEOUT_MS, stopOfSignal, requireSearchActive, resolveWorkerEntry, missingWorkerEntry, signalOfSearch, answerFromOneState, CONSECUTIVE_TIMEOUTS_BEFORE_DEATH, sharedStopOfSignal, engineThreadYoungGenerationBytes, resolveRequestThreadCount, spawnNodeWorker, bindSearchSignal, WORKER_YOUNG_GENERATION_MB, nodeThreadId, youngGenerationBytesOfThisV8 } from './chunk-RORNUNXW.mjs';
9
9
  import { changeIndexOutsideExternalWaits, turnsAreBudgeted, turnIsSpent, yieldTurn, HEAP_RESUME_FRACTION_BELOW_V8_INEFFECTIVE_MARK_COMPACT_LINE, HEAP_BLOCK_FRACTION_BELOW_V8_INEFFECTIVE_MARK_COMPACT_LINE, noteThreadSlotLive, threadSlotOfWorker, indexChangeOutsideExternalWaits, PROCESS_LIMIT_REFRESH_INTERVAL_MS, countWrite, threadSlotGone, noteThreadSlotGone, adoptSharedTurns, WASM_PAGE_BYTES, VECTOR_STORE_INITIAL_CAPACITY, VECTOR_SEARCH_TIMEOUT_MS, VECTOR_SEARCH_LOAD_TIMEOUT_MS, VECTOR_SCRATCH_SLOTS, VECTOR_INSERT_TIMEOUT_MS, VECTOR_BLOCK_MAX_BYTES, VECTOR_BLOCK_INITIAL_SLOTS, UNPLACED_FLAG_CHUNK_ORDINALS, NATIVE_THREAD_SEARCH_SLOTS, NATIVE_THREAD_SCAN_CHUNK_ORDINALS, NATIVE_ATTACH_RETRY_MS, MAX_WASM_PAGES, MAX_VECTOR_ORDINALS, MAX_RENUMBERED_SEARCH_ATTEMPTS, MAX_DOC_ID_TABLE_BYTES, LOCK_WAIT_SLICE_MS, LOCK_SPIN_ITERATIONS, GRAPH_LOCK_WAIT_SLICE_MS, GRAPH_LOCK_WAIT_DEADLINE_MS, GRAPH_BUILD_DISPATCH_CHUNK, GRAPH_BUILD_CHUNKS_IN_FLIGHT_PER_WORKER, DISK_STORAGE_BLOCK_BYTES, waitOutsideCountedWrite, collectAndReturnPages } from './chunk-UPDNNOTG.mjs';
10
10
  import { MIN_DOCUMENTS_FOR_SEGMENTS, MAX_SORT_FIELDS, MAX_SORT_FIELD_NAME_LENGTH, MAX_CURSOR_LENGTH, MAX_CURSOR_ANCHOR_CODE_POINTS, RESULT_WINDOW, PARTIAL_WORD_MIN_CODE_POINTS, PARTIAL_WORDS_ADDED_PER_QUERY, MAX_PARTITIONS, DEFAULT_LIMIT, MAX_INDEX_CONFIGURATION_BYTES, BATCH_CHUNK_SIZE, DEFAULT_FUZZY_PREFIX_LENGTH, BM25_DISPLAYED_NAME_LENGTH, MAX_INDEX_NAME_LENGTH, INDEX_NAME_PATTERN, MAX_DOC_ID_LENGTH, MAX_CALLS_ACROSS_INDEX_CHANGES, DEFAULT_PAGE_SIZE, CURSOR_BINDING_BUFFER_BYTES, ABSOLUTE_WINDOWS_PATH_PATTERN, MODULE_URL_SCHEME_PATTERN, MAX_SWEEP_INTERVAL_MS, DEFAULT_OFFSET, MIN_SWEEP_INTERVAL_MS, MIN_RANK_CONSTANT, MIN_LINEAR_ALPHA, MAX_LINEAR_ALPHA, FUSION_TIE_INSERTION_LIMIT, DEFAULT_RANK_CONSTANT, DEFAULT_LINEAR_ALPHA, STATISTICS_BROADCAST_INTERVAL_MS, MAX_IMPORT_REFUSALS_REPORTED, MAX_EXPORT_LINE_BYTES, IMPORT_BATCH_DOCUMENTS, FOREIGN_STATS_TTL_MS, EXPORT_CHUNK_BYTES, DEFAULT_MAX_PARTITIONS, ANALYSIS_HOLD_APPLY_INTERVAL_MS, ANALYSIS_CHANGE_MEMBERS, MIN_HYBRID_DEPTH, MAX_SUGGEST_SCATTER_LIMIT, MAX_SUGGEST_LIMIT, MAX_QUERY_PHRASES, MAX_PHRASE_WORDS, MAX_HYBRID_DEPTH, HYBRID_RESCORE_WINDOW, DEFAULT_SUGGEST_LIMIT, DEFAULT_MAX_PER_GROUP, HEAP_PRESSURE_WARNING_FRACTION, PREFIX_MAX_EXPANSIONS, HEAP_PRESSURE_REARM_FRACTION, MAX_TOLERANCE, MAX_PREFIX_LENGTH } from './chunk-3ECIRFS5.mjs';
11
- import { nativeSearchCoreIsEnabled, loadNativeCore, noteFallback, requireSearchBackendSettings, NATIVE_NEEDS_ROOM, NATIVE_OK } from './chunk-D6FYUTFN.mjs';
11
+ import { nativeSearchCoreIsEnabled, loadNativeCore, noteFallback, requireSearchBackendSettings, NATIVE_NEEDS_ROOM, NATIVE_OK } from './chunk-ASZLNVWW.mjs';
12
12
  import { PLACEMENT_ROOM_REQUESTS, NEAREST_LINK_FALLBACK_HOSTS, MIN_M, MAX_M, MAX_LAYER_CAP, INITIAL_UPPER_SLOTS, INITIAL_LIST_CAPACITY, FARTHEST_REJECTED_LINKS_KEPT, EARLIER_RELEASE_MIN_M, DEFAULT_EF_SEARCH, CONNECT_STEPS_BETWEEN_CLOCK_CHECKS, CONNECT_RESTARTS_BEFORE_ONE_PASS, COMPACTION_TOMBSTONE_RATIO, COMPACTION_ABSOLUTE_THRESHOLD } from './chunk-ZXX5GZEX.mjs';
13
13
  import { MAX_FILE_BYTES, VALID_HNSW_METRICS, NATIVE_CRC32_MIN_BYTES, CHECKSUM_YIELD_CHUNK_BYTES, MAX_DOCUMENT_ENCODING_DEPTH, DOCUMENT_REPLY_ENVELOPE_DEPTH, DOCUMENT_ENCODER_RETAINED_BUFFER_BYTES, BYTE_ORDER_MARK_WALK_BYTES_PER_HEADER } from './chunk-4PY4JYMY.mjs';
14
- import { NarsilError, ErrorCodes, createNarsilError, isNarsilError } from './chunk-Q3ZZH5Z7.mjs';
14
+ import { NarsilError, ErrorCodes, createNarsilError, isNarsilError } from './chunk-ZKOQR7EA.mjs';
15
15
  import { compareCodePoints, withUnpairedSurrogatesReplaced, sortModeOf, defaultSortMode, toComparableSortValue, exceedsCodePoints, codePointCount, SORT_VALUE_MAX_CODE_POINTS, holdsUnpairedSurrogate, truncateSortString, SORT_MODES, isSortMode } from './chunk-TGPKS2UM.mjs';
16
16
  import { totalmem, freemem } from 'os';
17
17
  import { getHeapStatistics, getHeapSpaceStatistics } from 'v8';
@@ -992,7 +992,7 @@ var loaded = null;
992
992
  var loading = null;
993
993
  function importOptionalReads() {
994
994
  if (loaded !== null) return Promise.resolve(loaded);
995
- loading ??= import('./optional-reads-ENKMVQ4Q.mjs').then(
995
+ loading ??= import('./optional-reads-5HFMF2QZ.mjs').then(
996
996
  (code7) => {
997
997
  code7.bindOptionalReadsHost(optionalCodeHost());
998
998
  loaded = code7;
@@ -4959,7 +4959,7 @@ function requireLoadedPhraseCode() {
4959
4959
  }
4960
4960
  function loadPhraseCode() {
4961
4961
  if (loading2 === null) {
4962
- loading2 = import('./phrase-module-ZY3TLTQA.mjs').then(
4962
+ loading2 = import('./phrase-module-EFESWOCR.mjs').then(
4963
4963
  (code7) => {
4964
4964
  code7.bindPhraseHost(optionalCodeHost());
4965
4965
  loaded2 = code7;
@@ -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-DO75VKEV.mjs')]);
12685
+ const [msgpack, code7] = await Promise.all([loadMessagePack(), import('./segment-codec-leaf-MP6DILVE.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-YIH36Y5J.mjs')]);
12693
+ const [msgpack, code7] = await Promise.all([loadMessagePack(), import('./store-leaf-PL2G7RM5.mjs')]);
12694
12694
  code7.bindSuggestionStoreHost(optionalCodeHost(), msgpack);
12695
12695
  return code7;
12696
12696
  }, "query suggestions store");
@@ -12749,7 +12749,7 @@ function markSimdUnavailable() {
12749
12749
 
12750
12750
  // src/workers/vector-core-code.ts
12751
12751
  var vectorCore = codeLoader(
12752
- () => import('./core-leaf-NEUM7PU3.mjs').then((code7) => {
12752
+ () => import('./core-leaf-TAR3GJVE.mjs').then((code7) => {
12753
12753
  code7.bindVectorCoreHost(optionalCodeHost());
12754
12754
  if (!code7.simdModuleLoaded()) markSimdUnavailable();
12755
12755
  return code7;
@@ -12771,7 +12771,7 @@ var storageCode = codeLoader(async () => {
12771
12771
  loadSegmentMerge(),
12772
12772
  loadSuggestionStore(),
12773
12773
  loadVectorCore(),
12774
- import('./storage-leaf-ZI3H2WJY.mjs')
12774
+ import('./storage-leaf-HQFO37W7.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-ES7TDJ5V.mjs')]);
21497
+ const [suggestionStore2, code7] = await Promise.all([loadSuggestionStore(), import('./restore-queue-E4EIUYVV.mjs')]);
21498
21498
  code7.bindRestoreQueueHost(optionalCodeHost(), suggestionStore2);
21499
21499
  return code7;
21500
21500
  }, "restore");
@@ -21721,7 +21721,7 @@ function storedBM25Params(params) {
21721
21721
 
21722
21722
  // src/workers/vector-code.ts
21723
21723
  var vectorCode = codeLoader(async () => {
21724
- const [vectorCore2, code7] = await Promise.all([loadVectorCore(), import('./module-Z3CL4GJ4.mjs')]);
21724
+ const [vectorCore2, code7] = await Promise.all([loadVectorCore(), import('./module-UQFIJQMG.mjs')]);
21725
21725
  code7.bindVectorHost(optionalCodeHost(), vectorCore2);
21726
21726
  return code7;
21727
21727
  }, "vector");
@@ -21953,6 +21953,7 @@ async function createEngineIndex(core2, config, name, requestedConfig, creation
21953
21953
  pendingAnalysis: null,
21954
21954
  durableAnalysis: null,
21955
21955
  sync: null,
21956
+ changes: null,
21956
21957
  querySuggestions: creation.querySuggestions ?? null
21957
21958
  });
21958
21959
  await core2.indexState.registerOpen(name);
@@ -21982,11 +21983,12 @@ async function dropEngineIndex(core2, name) {
21982
21983
  throw error;
21983
21984
  }
21984
21985
  }
21985
- if (core2.executor.getManager(name) !== void 0) core2.executor.dropIndex(name);
21986
+ if (core2.executor.getManager(name) !== void 0) await core2.executor.dropIndex(name);
21986
21987
  core2.indexRegistry.delete(name);
21987
21988
  core2.watermarkNotifier.forget(name);
21988
21989
  core2.analysisRebuild.clearStale(name);
21989
- if (entry.sync !== null) emitSyncChange(core2.indexRegistry, { kind: "dropped", indexName: name });
21990
+ if (entry.sync !== null || entry.changes !== null)
21991
+ emitSyncChange(core2.indexRegistry, { kind: "dropped", indexName: name });
21990
21992
  });
21991
21993
  await core2.querySuggestionHooks?.afterDrop(name);
21992
21994
  await runLifecycleHook(core2, "onIndexDrop", { indexName: name, config: entry.config });
@@ -22059,7 +22061,7 @@ function storedArrayPositionGap(value) {
22059
22061
 
22060
22062
  // src/engine/embed-code.ts
22061
22063
  var embedCode = codeLoader(
22062
- () => import('./embed-2QMYCD2Q.mjs').then((code7) => {
22064
+ () => import('./embed-4PHHKGBK.mjs').then((code7) => {
22063
22065
  code7.bindEmbedHost(optionalCodeHost());
22064
22066
  return code7;
22065
22067
  }),
@@ -22069,7 +22071,7 @@ var loadEmbedCode = embedCode.load;
22069
22071
 
22070
22072
  // src/engine/optional-writes-code.ts
22071
22073
  var optionalWrites = codeLoader(async () => {
22072
- const [segmentCodec2, code7] = await Promise.all([loadSegmentCodec(), import('./optional-writes-YIVJMQ4D.mjs')]);
22074
+ const [segmentCodec2, code7] = await Promise.all([loadSegmentCodec(), import('./optional-writes-CGDBJBHQ.mjs')]);
22073
22075
  code7.bindOptionalWritesHost(optionalCodeHost(), segmentCodec2);
22074
22076
  return code7;
22075
22077
  }, "write");
@@ -24028,8 +24030,21 @@ async function updateDocumentBatch(ctx, indexName, updates, options, hold) {
24028
24030
  return { succeeded, failed };
24029
24031
  }
24030
24032
 
24033
+ // src/engine/memory/document-churn.ts
24034
+ var churnByIndex = /* @__PURE__ */ new Map();
24035
+ function noteDocumentChurn(indexName, documents2) {
24036
+ if (!(documents2 > 0)) return;
24037
+ churnByIndex.set(indexName, (churnByIndex.get(indexName) ?? 0) + documents2);
24038
+ }
24039
+ function documentChurnOf(indexName) {
24040
+ return churnByIndex.get(indexName) ?? 0;
24041
+ }
24042
+
24031
24043
  // src/engine/memory/guarded-writes.ts
24032
24044
  var EMPTY_DOCUMENT = {};
24045
+ function noteGroupedChurn(ctx, indexName, documents2) {
24046
+ if (ctx.memoryWriteBlock?.grouping !== void 0) noteDocumentChurn(indexName, documents2);
24047
+ }
24033
24048
  function blockFor(ctx, indexName) {
24034
24049
  const block = ctx.memoryWriteBlock;
24035
24050
  if (block === void 0) return void 0;
@@ -24115,6 +24130,7 @@ async function insertDocumentBatch2(ctx, indexName, documents2, options, hold) {
24115
24130
  async function updateDocument2(ctx, indexName, docId, document, options, hold) {
24116
24131
  const block = blockFor(ctx, indexName);
24117
24132
  if (block === void 0) return updateDocument(ctx, indexName, docId, document, options, hold);
24133
+ noteGroupedChurn(ctx, indexName, 1);
24118
24134
  return withReservation(
24119
24135
  block.grouping,
24120
24136
  indexName,
@@ -24129,6 +24145,7 @@ async function updateDocumentBatch2(ctx, indexName, updates, options, hold) {
24129
24145
  if (grouping === void 0 || !Array.isArray(updates) || updates.length === 0) {
24130
24146
  return updateDocumentBatch(ctx, indexName, updates, options, hold);
24131
24147
  }
24148
+ noteGroupedChurn(ctx, indexName, updates.length);
24132
24149
  return writeInGroups(
24133
24150
  grouping,
24134
24151
  indexName,
@@ -24143,10 +24160,12 @@ async function updateDocumentBatch2(ctx, indexName, updates, options, hold) {
24143
24160
  );
24144
24161
  }
24145
24162
  async function removeDocument4(ctx, indexName, docId, options, hold) {
24163
+ noteGroupedChurn(ctx, indexName, 1);
24146
24164
  await removeDocument3(ctx, indexName, docId, options, hold);
24147
24165
  ctx.memoryWriteBlock?.memoryReleased();
24148
24166
  }
24149
24167
  async function removeDocumentBatch2(ctx, indexName, docIds, options, hold) {
24168
+ if (Array.isArray(docIds)) noteGroupedChurn(ctx, indexName, docIds.length);
24150
24169
  const result = await removeDocumentBatch(ctx, indexName, docIds, options, hold);
24151
24170
  if (result.succeeded.length > 0) ctx.memoryWriteBlock?.memoryReleased();
24152
24171
  return result;
@@ -24174,6 +24193,10 @@ var PATTERN_RUN_HEAP_BYTES = 512;
24174
24193
  var ENUM_VALUE_HEAP_BYTES = 256;
24175
24194
  var VECTOR_COMPONENT_HEAP_BYTES = 80;
24176
24195
  var VECTOR_DOCUMENT_HEAP_BYTES = 5120;
24196
+ var MAP_TABLE_HEADER_BYTES = 40;
24197
+ var MAP_TABLE_SLOT_BYTES = 28;
24198
+ var MAP_TABLE_MIN_CAPACITY = 4;
24199
+ var MAP_TABLE_SHRINK_DIVISOR = 4;
24177
24200
  var NORMALIZATION_EXPANSION_FACTOR = 3;
24178
24201
  var CASE_FOLD_EXPANSION_FACTOR = 3;
24179
24202
 
@@ -24933,7 +24956,7 @@ function createAnalysisRebuildCoordinator(config, deps) {
24933
24956
 
24934
24957
  // src/engine/durability-config-code.ts
24935
24958
  var durabilityConfig = codeLoader(
24936
- () => import('./durability-config-NWU2G2SJ.mjs').then((code7) => {
24959
+ () => import('./durability-config-VWS2K24E.mjs').then((code7) => {
24937
24960
  code7.bindDurabilityConfigHost(optionalCodeHost());
24938
24961
  return code7;
24939
24962
  }),
@@ -25334,7 +25357,7 @@ function wireIndexState(wiring) {
25334
25357
  } catch (error) {
25335
25358
  await orchestrator.closeIndex(indexName).catch(() => void 0);
25336
25359
  await durability.manager.unloadIndex(indexName).catch(() => void 0);
25337
- if (executor.getManager(indexName) !== void 0) executor.dropIndex(indexName);
25360
+ if (executor.getManager(indexName) !== void 0) await executor.dropIndex(indexName);
25338
25361
  throw error;
25339
25362
  }
25340
25363
  },
@@ -25352,7 +25375,7 @@ function wireIndexState(wiring) {
25352
25375
  try {
25353
25376
  await wiring.onClose?.(indexName);
25354
25377
  } finally {
25355
- if (executor.getManager(indexName) !== void 0) executor.dropIndex(indexName);
25378
+ if (executor.getManager(indexName) !== void 0) await executor.dropIndex(indexName);
25356
25379
  const entry = indexRegistry.get(indexName);
25357
25380
  if (entry !== void 0) {
25358
25381
  entry.documentCount = documentCount;
@@ -25506,7 +25529,7 @@ var workerCopies = codeLoader(async () => {
25506
25529
  const [segmentCodec2, segmentMerge2, code7] = await Promise.all([
25507
25530
  loadSegmentCodec(),
25508
25531
  loadSegmentMerge(),
25509
- import('./worker-copies-WYPRCNB7.mjs')
25532
+ import('./worker-copies-P7YWXEP5.mjs')
25510
25533
  ]);
25511
25534
  code7.bindWorkerCopiesHost(optionalCodeHost(), segmentCodec2, segmentMerge2);
25512
25535
  return code7;
@@ -28105,7 +28128,8 @@ async function resolveRunnableConfig(config) {
28105
28128
 
28106
28129
  // src/engine/sync-epoch.ts
28107
28130
  async function holdSyncEpochChange(core2, indexName) {
28108
- if ((core2.indexRegistry.get(indexName)?.sync ?? null) === null) return () => void 0;
28131
+ const entry = core2.indexRegistry.get(indexName);
28132
+ if (entry === void 0 || entry.sync === null && entry.changes === null) return () => void 0;
28109
28133
  return (await loadStorageCode()).holdRenewedSyncEpoch(core2, indexName);
28110
28134
  }
28111
28135
  async function withRenewedSyncEpoch(core2, indexName, change) {
@@ -28156,6 +28180,17 @@ function bm25Operations(core2) {
28156
28180
  };
28157
28181
  }
28158
28182
 
28183
+ // src/narsil/changes.ts
28184
+ function changesOperations(core2) {
28185
+ return {
28186
+ updateChanges: async (indexName, setting) => (await loadStorageCode()).updateChangesOf(core2, indexName, setting),
28187
+ getChanges: async (indexName) => (await loadStorageCode()).changesOf(core2, indexName),
28188
+ async *followChanges(indexName, options) {
28189
+ yield* (await loadStorageCode()).followIndexChanges(core2, indexName, options);
28190
+ }
28191
+ };
28192
+ }
28193
+
28159
28194
  // src/narsil/internals.ts
28160
28195
  var engineCores = /* @__PURE__ */ new WeakMap();
28161
28196
  var rerankWindowSources = /* @__PURE__ */ new WeakMap();
@@ -28186,16 +28221,6 @@ function rerankWindowCapOf(owner) {
28186
28221
 
28187
28222
  // src/narsil/portability.ts
28188
28223
  function portabilityOperations(core2, config, engine) {
28189
- async function withOpenIndex2(indexName, action) {
28190
- core2.guardShutdown();
28191
- core2.requireIndex(indexName);
28192
- const release = await core2.indexState.acquire(indexName);
28193
- try {
28194
- return await action();
28195
- } finally {
28196
- release();
28197
- }
28198
- }
28199
28224
  function queueRestore(indexName, data) {
28200
28225
  const { restoresInFlight } = core2;
28201
28226
  const previous = restoresInFlight.get(indexName) ?? Promise.resolve();
@@ -28230,7 +28255,7 @@ function portabilityOperations(core2, config, engine) {
28230
28255
  }
28231
28256
  return {
28232
28257
  snapshot(indexName, options) {
28233
- return withOpenIndex2(indexName, async () => {
28258
+ return withOpenIndex(core2, indexName, async () => {
28234
28259
  const { createSnapshot } = await loadStorageCode();
28235
28260
  return createSnapshot(snapshotDepsOf(indexName), options?.queryHistory === true ? core2 : null);
28236
28261
  });
@@ -28242,10 +28267,9 @@ function portabilityOperations(core2, config, engine) {
28242
28267
  core2.heapPressureNotifier.check(indexName);
28243
28268
  },
28244
28269
  exportDocuments(indexName) {
28245
- return withOpenIndex2(indexName, async () => {
28246
- const { checkpointForArchive, documentExportStream, indexConfigurationOf } = await loadStorageCode();
28247
- const header = indexConfigurationOf(core2.requireIndex(indexName));
28248
- return documentExportStream(header, await checkpointForArchive(snapshotDepsOf(indexName)));
28270
+ return withOpenIndex(core2, indexName, async () => {
28271
+ const { openDocumentExport } = await loadStorageCode();
28272
+ return openDocumentExport(core2, snapshotDepsOf(indexName));
28249
28273
  });
28250
28274
  },
28251
28275
  importDocumentExport(indexName, data) {
@@ -29273,7 +29297,7 @@ async function executePreflight(request, callerContext) {
29273
29297
 
29274
29298
  // src/engine/resolve-vector-text-code.ts
29275
29299
  var resolveVectorText = codeLoader(
29276
- () => import('./resolve-vector-text-SD6BEMKZ.mjs').then((code7) => {
29300
+ () => import('./resolve-vector-text-OD4J3WHF.mjs').then((code7) => {
29277
29301
  code7.bindResolveVectorTextHost(optionalCodeHost());
29278
29302
  return code7;
29279
29303
  }),
@@ -29358,6 +29382,7 @@ async function queryUnderHold(core2, indexName, params, resolvedParams, embedded
29358
29382
  options?.onRanked?.(manager, result);
29359
29383
  return result;
29360
29384
  } catch (error) {
29385
+ if (error instanceof NarsilError && error.code === ErrorCodes.RERANK_FAILED) throw error;
29361
29386
  if (runner?.replaced) return INDEX_REPLACED_DURING_RERANK;
29362
29387
  throw error;
29363
29388
  } finally {
@@ -29738,6 +29763,7 @@ function createNarsilFromCore(core2, config) {
29738
29763
  ...synonymOperations(core2),
29739
29764
  ...bm25Operations(core2),
29740
29765
  ...syncOperations(core2),
29766
+ ...changesOperations(core2),
29741
29767
  async checkpoint(indexName) {
29742
29768
  guardShutdown();
29743
29769
  requireIndex(indexName);
@@ -29874,7 +29900,7 @@ var suggestionsCode = codeLoader(async () => {
29874
29900
  const [msgpack, suggestionStore2, code7] = await Promise.all([
29875
29901
  loadMessagePack(),
29876
29902
  loadSuggestionStore(),
29877
- import('./suggestions-leaf-FP5HSTFP.mjs')
29903
+ import('./suggestions-leaf-I3MEHACP.mjs')
29878
29904
  ]);
29879
29905
  code7.bindSuggestionsHost(optionalCodeHost(), msgpack, suggestionStore2);
29880
29906
  return code7;
@@ -30065,14 +30091,27 @@ function ownReadsOf(current, vectorIndexes) {
30065
30091
  }
30066
30092
  };
30067
30093
  }
30068
- function replaceVectorIndexes(current, replacement, pins) {
30094
+ function createSearchRetirement(pins, indexName, pending = /* @__PURE__ */ new Map()) {
30095
+ return (free) => {
30096
+ pins.afterRelease(() => {
30097
+ const disposal = free();
30098
+ if (disposal === void 0) return;
30099
+ pending.set(disposal, indexName);
30100
+ void disposal.then(
30101
+ () => pending.delete(disposal),
30102
+ () => pending.delete(disposal)
30103
+ );
30104
+ });
30105
+ const disposals = [...pending].filter(([, owner]) => owner === indexName).map(([disposal]) => disposal);
30106
+ return Promise.all(disposals).then(() => void 0);
30107
+ };
30108
+ }
30109
+ function replaceVectorIndexes(current, replacement, retire2) {
30069
30110
  const kept = new Set(replacement.values());
30070
30111
  const retired = [...current.values()].filter((index) => !kept.has(index));
30071
30112
  current.clear();
30072
30113
  for (const [field, index] of replacement) current.set(field, index);
30073
- pins.afterRelease(() => {
30074
- for (const index of retired) index.dispose();
30075
- });
30114
+ return retire2(() => Promise.all(retired.map((index) => index.dispose())).then(() => void 0));
30076
30115
  }
30077
30116
  function watchVectorWritesFor(vectorIndexes, pins) {
30078
30117
  const watched = /* @__PURE__ */ new Map();
@@ -30427,7 +30466,7 @@ function partitionStatsOf(partitions) {
30427
30466
  }
30428
30467
 
30429
30468
  // src/partitioning/manager/index.ts
30430
- function createPartitionManager(indexName, initialConfig, initialLanguage, router, initialPartitionCount, vectorIndexes) {
30469
+ function createPartitionManager(indexName, initialConfig, initialLanguage, router, initialPartitionCount, vectorIndexes, pendingDisposals) {
30431
30470
  let config = initialConfig;
30432
30471
  let language = initialLanguage;
30433
30472
  requirePatternSearchFor(config.schema);
@@ -30442,6 +30481,7 @@ function createPartitionManager(indexName, initialConfig, initialLanguage, route
30442
30481
  const docPartitionMap = createDocIdMap();
30443
30482
  const writeLogs = createWriteLogRecorder();
30444
30483
  const pins = createStatePins(() => [...vecIndexes.keys()]);
30484
+ const afterSearchesRelease = createSearchRetirement(pins, indexName, pendingDisposals);
30445
30485
  const vectorWrites = watchVectorWritesFor(vecIndexes, pins);
30446
30486
  const ownReads = ownReadsOf({ locate: locateDocument, partitionOf }, vecIndexes);
30447
30487
  for (let i = 0; i < count; i++) {
@@ -30669,9 +30709,7 @@ function createPartitionManager(indexName, initialConfig, initialLanguage, route
30669
30709
  vectorWrites.watch();
30670
30710
  return pins.open(reads ?? ownReads.current());
30671
30711
  },
30672
- afterSearchesRelease(free) {
30673
- pins.afterRelease(free);
30674
- },
30712
+ afterSearchesRelease,
30675
30713
  fieldValues(docId, fieldPaths) {
30676
30714
  const pid = locateDocument(docId);
30677
30715
  return pid === void 0 ? void 0 : partitions[pid].fieldValues(docId, fieldPaths);
@@ -30730,7 +30768,7 @@ function createPartitionManager(indexName, initialConfig, initialLanguage, route
30730
30768
  return vecIndexes;
30731
30769
  },
30732
30770
  resetVectorIndexes(newIndexes) {
30733
- replaceVectorIndexes(vecIndexes, newIndexes, pins);
30771
+ return replaceVectorIndexes(vecIndexes, newIndexes, afterSearchesRelease);
30734
30772
  }
30735
30773
  };
30736
30774
  return manager;
@@ -31024,7 +31062,7 @@ var segmentMerge = codeLoader(async () => {
31024
31062
  const [msgpack, codec, code7] = await Promise.all([
31025
31063
  loadMessagePack(),
31026
31064
  loadSegmentCodec(),
31027
- import('./segment-merge-leaf-JGND6LG5.mjs')
31065
+ import('./segment-merge-leaf-ED2NMUC5.mjs')
31028
31066
  ]);
31029
31067
  code7.bindSegmentMergeHost(optionalCodeHost(), msgpack, codec);
31030
31068
  return code7;
@@ -31319,12 +31357,30 @@ function vectorIndexesFor(indexName, config, copies, vectorStorage, onVectorGrap
31319
31357
  }
31320
31358
  function disposeEntry(entry) {
31321
31359
  closeCopyPublicationOrder(entry.copyPublications);
31322
- entry.manager.afterSearchesRelease(() => {
31323
- for (const vectorIndex of entry.vectorIndexes.values()) vectorIndex.dispose();
31360
+ return entry.manager.afterSearchesRelease(() => {
31361
+ const disposals = [...entry.vectorIndexes.values()].map((vectorIndex) => vectorIndex.dispose());
31324
31362
  closeHeldVectorCopies(entry.vectorCopies);
31325
31363
  for (const partition of entry.manager.getAllPartitions()) partition.clear();
31364
+ return Promise.all(disposals).then(() => void 0);
31326
31365
  });
31327
31366
  }
31367
+ function createEntryBuilder(vectorStorage, onVectorGraphRepaired, pendingDisposals) {
31368
+ return (indexName, config, language, analysisStale, awaitedCopyLoad, copies, savedPartitionCount) => {
31369
+ const router = createPartitionRouter();
31370
+ const partitionCount = savedPartitionCount ?? config.partitions?.maxPartitions ?? 1;
31371
+ const vectorIndexes = vectorIndexesFor(indexName, config, copies, vectorStorage, onVectorGraphRepaired);
31372
+ const manager = createPartitionManager(
31373
+ indexName,
31374
+ config,
31375
+ language,
31376
+ router,
31377
+ partitionCount,
31378
+ vectorIndexes,
31379
+ pendingDisposals
31380
+ );
31381
+ return indexEntryOf(manager, vectorIndexes, analysisStale, awaitedCopyLoad);
31382
+ };
31383
+ }
31328
31384
  function indexEntryOf(manager, vectorIndexes, analysisStale, awaitedCopyLoad) {
31329
31385
  return {
31330
31386
  manager,
@@ -31360,6 +31416,8 @@ function createDirectExecutor(options) {
31360
31416
  const vectorWorkerCopies = options?.vectorWorkerCopies ?? NO_VECTOR_WORKER_COPIES;
31361
31417
  const threadSlot = options?.threadSlot ?? 0;
31362
31418
  const vectorStorage = options?.vectorStorage ?? "memory";
31419
+ const pendingDisposals = /* @__PURE__ */ new Map();
31420
+ const buildEntry = createEntryBuilder(vectorStorage, options?.onVectorGraphRepaired, pendingDisposals);
31363
31421
  function requireIndex(indexName) {
31364
31422
  const entry = indexes.get(indexName);
31365
31423
  if (!entry) {
@@ -31393,21 +31451,15 @@ function createDirectExecutor(options) {
31393
31451
  indexes.set(indexName, entry);
31394
31452
  return entry.manager;
31395
31453
  }
31396
- function buildEntry(indexName, config, language, analysisStale, awaitedCopyLoad, copies, savedPartitionCount) {
31397
- const router = createPartitionRouter();
31398
- const partitionCount = savedPartitionCount ?? config.partitions?.maxPartitions ?? 1;
31399
- const vectorIndexes = vectorIndexesFor(indexName, config, copies, vectorStorage, options?.onVectorGraphRepaired);
31400
- const manager = createPartitionManager(indexName, config, language, router, partitionCount, vectorIndexes);
31401
- return indexEntryOf(manager, vectorIndexes, analysisStale, awaitedCopyLoad);
31402
- }
31403
- function dropIndex(indexName) {
31404
- disposeEntry(requireIndex(indexName));
31454
+ async function dropIndex(indexName) {
31455
+ const entry = requireIndex(indexName);
31405
31456
  indexes.delete(indexName);
31457
+ await disposeEntry(entry);
31406
31458
  }
31407
- function installDetachedIndex(detached) {
31459
+ async function installDetachedIndex(detached) {
31408
31460
  const previous = indexes.get(detached.indexName);
31409
31461
  indexes.set(detached.indexName, detached.entry);
31410
- if (previous !== void 0 && previous !== detached.entry) disposeEntry(previous);
31462
+ if (previous !== void 0 && previous !== detached.entry) await disposeEntry(previous);
31411
31463
  }
31412
31464
  function listIndexes() {
31413
31465
  return Array.from(indexes.keys());
@@ -31469,7 +31521,7 @@ function createDirectExecutor(options) {
31469
31521
  options?.initializeCopyPublication?.(entry, action.publication, threadSlot);
31470
31522
  }
31471
31523
  } catch (err) {
31472
- dropIndex(action.indexName);
31524
+ await dropIndex(action.indexName);
31473
31525
  throw err;
31474
31526
  }
31475
31527
  return void 0;
@@ -31480,7 +31532,7 @@ function createDirectExecutor(options) {
31480
31532
  return void 0;
31481
31533
  }
31482
31534
  case "dropIndex": {
31483
- dropIndex(action.indexName);
31535
+ await dropIndex(action.indexName);
31484
31536
  return void 0;
31485
31537
  }
31486
31538
  case "loadVectorCopy": {
@@ -31568,7 +31620,7 @@ function createDirectExecutor(options) {
31568
31620
  case "clear": {
31569
31621
  const entry = requireIndex(action.indexName);
31570
31622
  entry.manager.clearPartitions();
31571
- entry.manager.resetVectorIndexes(
31623
+ await entry.manager.resetVectorIndexes(
31572
31624
  vectorIndexesFor(
31573
31625
  action.indexName,
31574
31626
  entry.config,
@@ -31606,6 +31658,7 @@ function createDirectExecutor(options) {
31606
31658
  await entry.manager.publication.write(() => disposeEntry(entry));
31607
31659
  }
31608
31660
  indexes.clear();
31661
+ await Promise.all(pendingDisposals.keys());
31609
31662
  return void 0;
31610
31663
  }
31611
31664
  }
@@ -31640,4 +31693,4 @@ function createDirectExecutor(options) {
31640
31693
  };
31641
31694
  }
31642
31695
 
31643
- export { ARRAY_POSITION_GAP, CASE_FOLD_EXPANSION_FACTOR, COMPACTION_SEGMENT_TRIGGER, DEFAULT_BM25_B, DEFAULT_BM25_K1, DEFAULT_COPY_IDLE_TIMEOUT_MS, DEFAULT_COPY_THRESHOLD, DEFAULT_RERANK_WINDOW, DISTINCT_TERM_HEAP_BYTES, DOCUMENT_HEAP_BYTES_PER_ESTIMATED_BYTE, DOCUMENT_PROPERTY_HEAP_BYTES, DOCUMENT_VALUE_HEAP_BYTES, ENUM_VALUE_HEAP_BYTES, FIELD_FILTER_OPERATORS, FILTER_EXPRESSION_KEYS, FULL_MEMORY_COLLECTION_INTERVAL_MS, GROUP_FORMAT, GROUP_PATTERN_SOURCE, IDLE_MERGE_DELAY_MS, LIVE_TAIL_FLUSH_DOCUMENTS, LIVE_TAIL_FREEZE_FLOOR, LOAD_BUFFER_YIELD_INTERVAL, LONG_QUERY_THREADS, MAIN_COPY_LONE_QUERY_DOCUMENTS, MAX_PENDING_REPLICATION_DOCUMENTS, MAX_RERANK_WINDOW, NORMALIZATION_EXPANSION_FACTOR, NO_REMOVED_SPELLINGS, PARTIAL_SPELLING_HEAP_BYTES, PATTERN_RUN_HEAP_BYTES, POOL_RESTART_DELAY_MAX_MS, POOL_RESTART_DELAY_MS, REPLICATION_WINDOW, RETIRED_THREADS_EXIT_WAIT_MS, SEGMENTS_PER_MERGE, SUGGESTIONS_INDEX_INFIX, SegmentRefusal, TERM_UNIT_HEAP_BYTES, TermLookup, VECTOR_COMPONENT_HEAP_BYTES, VECTOR_DOCUMENT_HEAP_BYTES, VERSION, afterCurrentTurn, alreadyPresentOnWorker, applyProjection, arrayPositionsAreStale, assemblePagedFrozenSegment, availablePatternSearch, bindOptionalWritesHost, bindQuerySignal, bindRerankWindowSource, bindSegmentCodecHost, bindSegmentMergeHost, bindWorkerCopiesHost, bm25SetsValue, buildPartialWordTableFrom, buildSegmentPayloads, clampLimit, clampRowCount, clearNormalizationCache, clearQuerySignal, compareScores, configurationPayloadOf, configureNormalizationCache, countsWithoutScores, createBooleanIndex, createCompositePartition, createDirectExecutor, createEncodedDocumentSource, createEngineCore, createEngineIndex, createEnumIndex, createFrozenRemovals, createFrozenSegment, createLoadedGeoIndex, createMemoryMonitor, createNarsil, createNarsilFromCore, createNumericIndex, createPartitionIndex, createPartitionManager, createPartitionRouter, createPublicationGate, createRequestId, createSharedFrozenSegment, createWorkerExecutor, createWorkerFactory, customTokensOf, decodeEveryStoredDocument, decodeMapWithoutFields, decodePageCursor, decodeStoredDocument, decodeSurfaceTable, decodeSynonymRules, documentsOf2 as documentsOf, dropEngineIndex, eligibleIndexNames, emitEngineEvent, emitSyncChange, emitWriteEventAfter, emptyPendingRegions, encodeDocumentTableData, encodePageCursor, encodeSegmentState, endOfValue, engineCoreOf, executePreflight, executeQuery, fanOutMatchCount, fanOutQuery, fieldIndexRemapOf, fillHits, filterTestCount, fnv1a, fnv1aUint32s, freezeEncodedSegmentShared, freezeSegmentShared, generateId, getLanguage, getNormalizationCacheSize, getStopWords, getTokenizer, getVectorFieldPaths, growPartitionsTo, hasLanguage, hasStopWords, hasTokenizer, holdSyncEpochChange, holdVectorsForRollback, holdsADiscardedField, holdsQuotedText, importOptionalReads, initializeCopyPublication, insertDocument, insertDocumentBatch, insertDocumentVectors, isCompositePartition, isDeterministicFailure, isSimdAvailable, isValidWorkerAction, isValidWorkerResponse, joinPatternWorkMeter, kWayMerge, lazyQueryBinding, listBindingOf, listenForSyncChanges, loadCursorPageFor, loadDigest, loadFacetMergesFor, loadGeoCode, loadGeoCodeFor, loadGroupingFor, loadGzip, loadOptionalWrites, loadPhraseCodeFor, loadPinningFor, loadPrefixFor, loadQueryCode, loadRerankRuntime, loadSchemaCodeFor, loadSortingFor, loadStorageCode, loadSuggestionsCode, loadVectorCode, lookupOfStoredSynonyms, memoryFractionsOf, mergeDocFrequencies, mergeEntries, mergeFacets, mergeFieldIndexes, mergeKeywordSources, mergePartitionStats, mergePostings, mergePostings2, mergeSegmentContents, mergeSourceSpellings, mergeSourceSurfaces, mergedPartialSpellings, normalizeSort, now, oneAtATime, oversampledFacetConfig, oversampledShardSize, oversizedConfigurationPayloadOf, partialWordSearchModule, partitionStateOf, patternHost, patternIndexOf, prepareConfiguredSynonyms, prepareDocumentText, prepareDocumentVectors, prepareDocumentWrite, prepareRemovalText, prepareStoredSynonyms, projectionKeepsField, providedDocId, publishCopyAction, queryBindingOf, rankPage, readHeapStatistics, readMemoryFigures, readRecentMemoryFigures, readResidentMemory, rebuildSizeIndexes, reconstructSchemaFromMetadata, regionsOverlap, registerLanguage, registerPartialWordSearch, registerPatternSearch, registerStopWords, registerSynonyms, registerTokenizer, removeDocument3 as removeDocument, removeDocumentBatch, removeDocumentBatch2, removeDocumentVectors, removedSurfaceSpellings, reportIneligible, requireEncodedConfigurationWithinSizeLimit, requireKnownConfig, requireLoadedOptionalReads, requireLoadedVectorCode, requireMatchingCursor, requirePatternSearch, requireSearchBackendSettings2 as requireSearchBackendSettings, requireSurfaceFormsForPartialFields, requireWithinResultWindow, rerankWindowCapOf, resetNormalizationCache, resolveIndexAnalysis, resolvePartialWordAnalysis, resolvePartitionInsertOptions, resolveProjection, resolveRunnableConfig, returnsEveryMatch, rollbackInsertedDocument, rollbackRemovedDocument, rollbackUpdatedDocument, rulesOfStoredSynonyms, runEngineListDocuments, runEnginePreflight, runEngineQuery, runEngineQueryStats, runEngineSuggest, runtimeHost, sanitizeGlobalStats, scanPostingBlocks, segmentArraysOf, selectionKeeps, setNestedValue, shareSegmentArrays, sortModesOf, sortSignatureEntry, sortSignatureOf, startEngineCore, storedArrayPositionGap, storedBM25Params, storedDocumentsOf, survivorDocumentsOf, synonymModule, synonymSearchModule, toError2 as toError, topLevelMapKeys, updateDocument, updateDocumentBatch, updateDocumentVectors, validateBM25Params, validateBM25Shape, validateEmbeddingConfig, validateMemoryFractions, validatePartitionConfig, validatePatternValueLimit, validateRequiredFieldsInSchema, visitTokens, withOpenIndex, workerIneligibility, workersEnabledByDefault, wrapFrozenTokenTable, writePartitionDocument, yieldToEventLoop };
31696
+ export { ARRAY_POSITION_GAP, CASE_FOLD_EXPANSION_FACTOR, COMPACTION_SEGMENT_TRIGGER, DEFAULT_BM25_B, DEFAULT_BM25_K1, DEFAULT_COPY_IDLE_TIMEOUT_MS, DEFAULT_COPY_THRESHOLD, DEFAULT_RERANK_WINDOW, DISTINCT_TERM_HEAP_BYTES, DOCUMENT_HEAP_BYTES_PER_ESTIMATED_BYTE, DOCUMENT_PROPERTY_HEAP_BYTES, DOCUMENT_VALUE_HEAP_BYTES, ENUM_VALUE_HEAP_BYTES, FIELD_FILTER_OPERATORS, FILTER_EXPRESSION_KEYS, FULL_MEMORY_COLLECTION_INTERVAL_MS, GROUP_FORMAT, GROUP_PATTERN_SOURCE, IDLE_MERGE_DELAY_MS, LIVE_TAIL_FLUSH_DOCUMENTS, LIVE_TAIL_FREEZE_FLOOR, LOAD_BUFFER_YIELD_INTERVAL, LONG_QUERY_THREADS, MAIN_COPY_LONE_QUERY_DOCUMENTS, MAP_TABLE_HEADER_BYTES, MAP_TABLE_MIN_CAPACITY, MAP_TABLE_SHRINK_DIVISOR, MAP_TABLE_SLOT_BYTES, MAX_PENDING_REPLICATION_DOCUMENTS, MAX_RERANK_WINDOW, NORMALIZATION_EXPANSION_FACTOR, NO_REMOVED_SPELLINGS, PARTIAL_SPELLING_HEAP_BYTES, PATTERN_RUN_HEAP_BYTES, POOL_RESTART_DELAY_MAX_MS, POOL_RESTART_DELAY_MS, REPLICATION_WINDOW, RETIRED_THREADS_EXIT_WAIT_MS, SEGMENTS_PER_MERGE, SUGGESTIONS_INDEX_INFIX, SegmentRefusal, TERM_UNIT_HEAP_BYTES, TermLookup, VECTOR_COMPONENT_HEAP_BYTES, VECTOR_DOCUMENT_HEAP_BYTES, VERSION, afterCurrentTurn, alreadyPresentOnWorker, applyProjection, arrayPositionsAreStale, assemblePagedFrozenSegment, availablePatternSearch, bindOptionalWritesHost, bindQuerySignal, bindRerankWindowSource, bindSegmentCodecHost, bindSegmentMergeHost, bindWorkerCopiesHost, bm25SetsValue, buildPartialWordTableFrom, buildSegmentPayloads, clampLimit, clampRowCount, clearNormalizationCache, clearQuerySignal, compareScores, configurationPayloadOf, configureNormalizationCache, countsWithoutScores, createBooleanIndex, createCompositePartition, createDirectExecutor, createEncodedDocumentSource, createEngineCore, createEngineIndex, createEnumIndex, createFrozenRemovals, createFrozenSegment, createLoadedGeoIndex, createMemoryMonitor, createNarsil, createNarsilFromCore, createNumericIndex, createPartitionIndex, createPartitionManager, createPartitionRouter, createPatternWorkMeter, createPublicationGate, createRequestId, createSharedFrozenSegment, createWorkerExecutor, createWorkerFactory, customTokensOf, decodeEveryStoredDocument, decodeMapWithoutFields, decodePageCursor, decodeStoredDocument, decodeSurfaceTable, decodeSynonymRules, documentChurnOf, documentsOf2 as documentsOf, dropEngineIndex, eligibleIndexNames, emitEngineEvent, emitSyncChange, emitWriteEventAfter, emptyPendingRegions, encodeDocumentTableData, encodePageCursor, encodeSegmentState, endOfValue, engineCoreOf, executePreflight, executeQuery, fanOutMatchCount, fanOutQuery, fieldIndexRemapOf, fillHits, filterTestCount, fnv1a, fnv1aUint32s, freezeEncodedSegmentShared, freezeSegmentShared, generateId, getLanguage, getNormalizationCacheSize, getStopWords, getTokenizer, getVectorFieldPaths, growPartitionsTo, hasLanguage, hasStopWords, hasTokenizer, holdSyncEpochChange, holdVectorsForRollback, holdsADiscardedField, holdsQuotedText, importOptionalReads, initializeCopyPublication, insertDocument, insertDocumentBatch, insertDocumentVectors, isCompositePartition, isDeterministicFailure, isSimdAvailable, isValidWorkerAction, isValidWorkerResponse, joinPatternWorkMeter, kWayMerge, lazyQueryBinding, listBindingOf, listenForSyncChanges, loadCursorPageFor, loadDigest, loadFacetMergesFor, loadGeoCode, loadGeoCodeFor, loadGroupingFor, loadGzip, loadOptionalWrites, loadPhraseCodeFor, loadPinningFor, loadPrefixFor, loadQueryCode, loadRerankRuntime, loadSchemaCodeFor, loadSortingFor, loadStorageCode, loadSuggestionsCode, loadVectorCode, lookupOfStoredSynonyms, memoryFractionsOf, mergeDocFrequencies, mergeEntries, mergeFacets, mergeFieldIndexes, mergeKeywordSources, mergePartitionStats, mergePostings, mergePostings2, mergeSegmentContents, mergeSourceSpellings, mergeSourceSurfaces, mergedPartialSpellings, normalizeSort, noteDocumentChurn, now, oneAtATime, oversampledFacetConfig, oversampledShardSize, oversizedConfigurationPayloadOf, partialWordSearchModule, partitionStateOf, patternHost, patternIndexOf, prepareConfiguredSynonyms, prepareDocumentText, prepareDocumentVectors, prepareDocumentWrite, prepareRemovalText, prepareStoredSynonyms, projectionKeepsField, providedDocId, publishCopyAction, queryBindingOf, rankPage, readHeapStatistics, readMemoryFigures, readRecentMemoryFigures, readResidentMemory, rebuildSizeIndexes, reconstructSchemaFromMetadata, regionsOverlap, registerLanguage, registerPartialWordSearch, registerPatternSearch, registerStopWords, registerSynonyms, registerTokenizer, removeDocument3 as removeDocument, removeDocumentBatch, removeDocumentBatch2, removeDocumentVectors, removedSurfaceSpellings, reportIneligible, requireEncodedConfigurationWithinSizeLimit, requireKnownConfig, requireLoadedOptionalReads, requireLoadedVectorCode, requireMatchingCursor, requirePatternSearch, requireSearchBackendSettings2 as requireSearchBackendSettings, requireSurfaceFormsForPartialFields, requireWithinResultWindow, rerankWindowCapOf, resetNormalizationCache, resolveIndexAnalysis, resolvePartialWordAnalysis, resolvePartitionInsertOptions, resolveProjection, resolveRunnableConfig, returnsEveryMatch, rollbackInsertedDocument, rollbackRemovedDocument, rollbackUpdatedDocument, rulesOfStoredSynonyms, runEngineListDocuments, runEnginePreflight, runEngineQuery, runEngineQueryStats, runEngineSuggest, runtimeHost, sanitizeGlobalStats, scanPostingBlocks, segmentArraysOf, selectionKeeps, setNestedValue, shareSegmentArrays, sortModesOf, sortSignatureEntry, sortSignatureOf, startEngineCore, storedArrayPositionGap, storedBM25Params, storedDocumentsOf, survivorDocumentsOf, synonymModule, synonymSearchModule, toError2 as toError, topLevelMapKeys, updateDocument, updateDocumentBatch, updateDocumentVectors, validQueryFilter, validateBM25Params, validateBM25Shape, validateEmbeddingConfig, validateMemoryFractions, validatePartitionConfig, validatePatternValueLimit, validateRequiredFieldsInSchema, visitTokens, withOpenIndex, workerIneligibility, workersEnabledByDefault, wrapFrozenTokenTable, writePartitionDocument, yieldToEventLoop };
@@ -1,5 +1,5 @@
1
- import { requireLoadedMessagePack, getNestedValue, parsedTypeOf } from './chunk-X5NHWOXT.mjs';
2
- import { NarsilError, ErrorCodes } from './chunk-Q3ZZH5Z7.mjs';
1
+ import { requireLoadedMessagePack, getNestedValue, parsedTypeOf } from './chunk-7P5YWDRQ.mjs';
2
+ import { NarsilError, ErrorCodes } from './chunk-ZKOQR7EA.mjs';
3
3
  import { codePointCount, exceedsCodePoints } from './chunk-TGPKS2UM.mjs';
4
4
 
5
5
  // src/core/bitset.ts
@@ -1,5 +1,5 @@
1
- import { bindResponseStop, sendError, RELAY_STREAM_CHUNKS_IN_FLIGHT } from './chunk-MHBG33R5.mjs';
2
- import { ServerErrorCodes } from './chunk-Q3ZZH5Z7.mjs';
1
+ import { bindResponseStop, sendError, RELAY_STREAM_CHUNKS_IN_FLIGHT } from './chunk-7X4IIREW.mjs';
2
+ import { ServerErrorCodes } from './chunk-ZKOQR7EA.mjs';
3
3
  import { rm } from 'fs/promises';
4
4
  import path from 'path';
5
5
 
@@ -1,6 +1,6 @@
1
- import { readRecentMemoryFigures, readMemoryFigures } from './chunk-SL53DHVE.mjs';
2
- import { collectGarbageBeforeAnswerRefusal, collectYoungGenerationBeforeRefusal, reservedHeapBytes, admitHeapBytes } from './chunk-F4OOBPKA.mjs';
3
- import { NarsilError, ErrorCodes, ServerErrorCodes } from './chunk-Q3ZZH5Z7.mjs';
1
+ import { readRecentMemoryFigures, readMemoryFigures } from './chunk-HSA3H3VW.mjs';
2
+ import { collectGarbageBeforeAnswerRefusal, collectYoungGenerationBeforeRefusal, reservedHeapBytes, admitHeapBytes } from './chunk-AOYQTX6W.mjs';
3
+ import { NarsilError, ErrorCodes, ServerErrorCodes } from './chunk-ZKOQR7EA.mjs';
4
4
 
5
5
  // src/distribution/cluster-node/constants.ts
6
6
  var DEFAULT_PARTITION_COUNT = 5;
@@ -31,6 +31,7 @@ var SYNCED_POSITION_REPORT_TIMEOUT_MS = 5e3;
31
31
  var REGISTRATION_LEASE_DRIFT_SHARE = 0.1;
32
32
  var REGISTRATION_LEASE_CONFIRM_TIMEOUT_MS = 5e3;
33
33
  var ADMISSION_TIMEOUT_MS = 1e4;
34
+ var ADMISSION_RETRIES_AFTER_IN_SYNC_CHANGE = 3;
34
35
  var CATCH_UP_TICK_MS = 1e3;
35
36
  var CATCH_UP_FEED_WINDOW_MS = 1e3;
36
37
  var MAX_CATCH_UP_IN_FLIGHT_BYTES = 67108864;
@@ -224,4 +225,4 @@ function refuseEncodeWithoutRoom(documents) {
224
225
  if (refusal2 !== null) throw refusal2;
225
226
  }
226
227
 
227
- export { ADMISSION_TIMEOUT_MS, ANSWER_DECODE_HEAP_BYTES_PER_PAYLOAD_BYTE, CATCH_UP_FEED_WINDOW_MS, CATCH_UP_TICK_MS, CLEAR_PAGE_SIZE, COORDINATOR_REQUEST_BUCKET_BOUNDS_SECONDS, COPY_FAILURE_ATTEMPTS, COPY_FAILURE_RETRY_DELAY_MS, DECOMMISSION_RECHECK_INTERVAL_MS, DEFAULT_BOOTSTRAP_SYNC_DEADLINE_MS, DEFAULT_CAPACITY, DEFAULT_CREATE_INDEX_WAIT_MS, DEFAULT_IN_FLIGHT_WRITE_FRACTION, DEFAULT_MAX_PER_SOURCE_SNAPSHOTS, DEFAULT_MAX_STREAMS_PER_INDEX, DEFAULT_PARTITION_COUNT, DEFAULT_REPLICATION_FACTOR, DROP_ACKNOWLEDGE_POLL_INTERVAL_MS, FETCH_GROUP_DOCUMENT_IDS, FORWARD_RETRY_DELAY_CAP_MS, FORWARD_RETRY_INITIAL_DELAY_MS, MAX_CATCH_UP_IN_FLIGHT_BYTES, MAX_DROP_ACKNOWLEDGE_WAIT_MS, MAX_NODE_LEFT_DELAY_MS, MAX_SETTINGS_REPLACEMENT_ATTEMPTS, MAX_SOURCE_ID_LENGTH, MAX_WAIT_FOR_ACTIVE_REPLICAS, MEMORY_SAMPLE_INTERVAL_MS, MIN_CONTROLLER_LEASE_TTL_MS, OUT_OF_STEP_REMOVAL_RETRY_DELAY_CAP_MS, OUT_OF_STEP_REMOVAL_RETRY_INITIAL_DELAY_MS, PARTITION_BYTES_ENTRY_BYTES, PARTITION_BYTES_INDEX_OVERHEAD_BYTES, PARTITION_BYTES_REPORT_BUDGET_BYTES, PARTITION_WRITE_CONCURRENCY, PRIMARY_CHANGE_POLL_INTERVAL_MS, PRIMARY_CHANGE_RETRY_WINDOW_MS, REGISTRATION_LEASE_CONFIRM_TIMEOUT_MS, REGISTRATION_LEASE_DRIFT_SHARE, ROLLBACK_RETRY_DELAY_CAP_MS, ROLLBACK_RETRY_INITIAL_DELAY_MS, SEARCH_CONTEXT_ENTRY_HEAP_BYTES, SEARCH_CONTEXT_REAPER_INTERVAL_MS, SETTINGS_CONTENTION_REASON, SNAPSHOT_CHUNK_YIELD_INTERVAL_MS, SYNCED_POSITION_REPORT_TIMEOUT_MS, WRITE_APPLY_YIELD_INTERVAL_MS, WRITE_MEMORY_SAMPLE_MAX_AGE_MS, answerRefusalOf, createWritePressure, estimateDocumentBytes, estimateDocumentsBytes, estimateForwardedBytes, refuseEncodeWithoutRoom, withAdmittedWrite };
228
+ export { ADMISSION_RETRIES_AFTER_IN_SYNC_CHANGE, ADMISSION_TIMEOUT_MS, ANSWER_DECODE_HEAP_BYTES_PER_PAYLOAD_BYTE, CATCH_UP_FEED_WINDOW_MS, CATCH_UP_TICK_MS, CLEAR_PAGE_SIZE, COORDINATOR_REQUEST_BUCKET_BOUNDS_SECONDS, COPY_FAILURE_ATTEMPTS, COPY_FAILURE_RETRY_DELAY_MS, DECOMMISSION_RECHECK_INTERVAL_MS, DEFAULT_BOOTSTRAP_SYNC_DEADLINE_MS, DEFAULT_CAPACITY, DEFAULT_CREATE_INDEX_WAIT_MS, DEFAULT_IN_FLIGHT_WRITE_FRACTION, DEFAULT_MAX_PER_SOURCE_SNAPSHOTS, DEFAULT_MAX_STREAMS_PER_INDEX, DEFAULT_PARTITION_COUNT, DEFAULT_REPLICATION_FACTOR, DROP_ACKNOWLEDGE_POLL_INTERVAL_MS, FETCH_GROUP_DOCUMENT_IDS, FORWARD_RETRY_DELAY_CAP_MS, FORWARD_RETRY_INITIAL_DELAY_MS, MAX_CATCH_UP_IN_FLIGHT_BYTES, MAX_DROP_ACKNOWLEDGE_WAIT_MS, MAX_NODE_LEFT_DELAY_MS, MAX_SETTINGS_REPLACEMENT_ATTEMPTS, MAX_SOURCE_ID_LENGTH, MAX_WAIT_FOR_ACTIVE_REPLICAS, MEMORY_SAMPLE_INTERVAL_MS, MIN_CONTROLLER_LEASE_TTL_MS, OUT_OF_STEP_REMOVAL_RETRY_DELAY_CAP_MS, OUT_OF_STEP_REMOVAL_RETRY_INITIAL_DELAY_MS, PARTITION_BYTES_ENTRY_BYTES, PARTITION_BYTES_INDEX_OVERHEAD_BYTES, PARTITION_BYTES_REPORT_BUDGET_BYTES, PARTITION_WRITE_CONCURRENCY, PRIMARY_CHANGE_POLL_INTERVAL_MS, PRIMARY_CHANGE_RETRY_WINDOW_MS, REGISTRATION_LEASE_CONFIRM_TIMEOUT_MS, REGISTRATION_LEASE_DRIFT_SHARE, ROLLBACK_RETRY_DELAY_CAP_MS, ROLLBACK_RETRY_INITIAL_DELAY_MS, SEARCH_CONTEXT_ENTRY_HEAP_BYTES, SEARCH_CONTEXT_REAPER_INTERVAL_MS, SETTINGS_CONTENTION_REASON, SNAPSHOT_CHUNK_YIELD_INTERVAL_MS, SYNCED_POSITION_REPORT_TIMEOUT_MS, WRITE_APPLY_YIELD_INTERVAL_MS, WRITE_MEMORY_SAMPLE_MAX_AGE_MS, answerRefusalOf, createWritePressure, estimateDocumentBytes, estimateDocumentsBytes, estimateForwardedBytes, refuseEncodeWithoutRoom, withAdmittedWrite };