@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,6 +1,6 @@
1
- import { N as NarsilConfig } from './config-C687-reW.js';
1
+ import { N as NarsilConfig } from './config-PqgNY1H7.js';
2
2
  import { P as PersistenceAdapter } from './adapters-pljAqmrC.js';
3
- import { A as AllocationConstraints, a as AllocationTable, N as NodeRole, b as NodeRegistration, C as ClusterCoordinator, c as NodeCapacity } from './index-CBUl4z3E.js';
3
+ import { A as AllocationConstraints, a as AllocationTable, N as NodeRole, b as NodeRegistration, C as ClusterCoordinator, c as NodeCapacity } from './index-BaQIAnk0.js';
4
4
  import { N as NodeTransport } from './types-DvncmvuQ.js';
5
5
 
6
6
  /**
@@ -602,4 +602,4 @@ interface ClusterNodeInfo {
602
602
  status: string;
603
603
  }
604
604
 
605
- export type { BackupListing as B, ClusterNamespace as C, DamagedBackup as D, IndexHealth as I, NodeReadiness as N, PartitionReplicationFigure as P, ReplicaLagFigure as R, VectorRebuildWaitFigure as V, BackupSummary as a, ClusterNodeInfo as b, CreateIndexOptions as c, ClusterNodeConfig as d, BackupOperationOptions as e, BackupProgress as f, ClusterBackupConfig as g, ClusterControllerConfig as h, ClusterHealth as i, ClusterHealthStatus as j, ClusterMemoryConfig as k, ClusterMetrics as l, ClusterQueryConfig as m, CommitPointFigure as n, CoordinatorRequestFigure as o, CreateBackupOptions as p, ReplicationConfig as q, RestoreBackupOptions as r };
605
+ export type { BackupListing as B, ClusterNamespace as C, DamagedBackup as D, IndexHealth as I, NodeReadiness as N, PartitionReplicationFigure as P, ReplicaLagFigure as R, VectorRebuildWaitFigure as V, BackupSummary as a, ClusterNodeInfo as b, ClusterHealth as c, CreateIndexOptions as d, ClusterNodeConfig as e, BackupOperationOptions as f, BackupProgress as g, ClusterBackupConfig as h, ClusterControllerConfig as i, ClusterHealthStatus as j, ClusterMemoryConfig as k, ClusterMetrics as l, ClusterQueryConfig as m, CommitPointFigure as n, CoordinatorRequestFigure as o, CreateBackupOptions as p, ReplicationConfig as q, RestoreBackupOptions as r };
@@ -1,5 +1,5 @@
1
1
  import { P as PersistenceAdapter, I as InvalidationAdapter, E as EmbeddingAdapter, R as RerankAdapter } from './adapters-pljAqmrC.js';
2
- import { Q as QueryParams, j as QueryResult, k as NarsilEventHandlers } from './engine-De6JzTW8.js';
2
+ import { Q as QueryParams, t as QueryResult, u as NarsilEventHandlers } from './engine-qjAxJSKk.js';
3
3
  import { I as IndexConfig, A as AnyDocument } from './schema-CzG9OUw5.js';
4
4
 
5
5
  /**
@@ -1,8 +1,8 @@
1
- export { BUILD_CHUNK_SIZE, BUILD_RETRY_FIRST_DELAY_MS, BUILD_RETRY_MAX_DELAY_MS, BUILD_STEPS_BETWEEN_CLOCK_CHECKS, DEFAULT_FILTER_THRESHOLD, DEFAULT_PROMOTION_THRESHOLD, DEFAULT_VECTOR_METRIC, DISK_ADOPTION_YIELD_INTERVAL, DRIFT_CHECK_GROWTH_FACTOR, ESTIMATED_MS_PER_TOMBSTONE, ESTIMATED_MS_PER_VECTOR_REBUILD, GRAPH_RETIRED, IN_MEMORY, MIN_OVERSAMPLE, NOTHING_STAGED, NO_LIVE_VECTOR_AT_POSITION, QUERY_STAGED, RECALIBRATION_CHUNK_VECTORS, RECALIBRATION_DRIFT_RATIO, SEARCH_ATTEMPTS_BEFORE_HOLDING_WRITES, SEARCH_REFILL_RESERVE, SEARCH_SCAN_CHUNK_VECTORS, SHUFFLED_REBUILD_MEMORY_RETRY_MS, STORE_BLOCK_COUNT, STORE_CALIBRATED, STORE_CALIBRATION_GENERATION, STORE_CODE_BLOCK_COUNT, STORE_CODE_COUNT, STORE_DOC_ID_BYTES, STORE_LIVE_COUNT, STORE_ORDINAL_LAYOUT_GENERATION, STORE_RELEASED_VECTORS_TO_DISK, STORE_REMOVED_COUNT, STORE_SLOTS, STORE_UNPLACED_COUNT, STORE_WRITE_SEQUENCE_INT64, VECTOR_FILE_MAX_VECTORS, VECTOR_FILE_PAYLOAD_VERSION, VECTOR_MEMORY_LIMITS, VECTOR_WORKER_COPIES_ALLOWED, WORKER_COPY_MIN_VECTORS, addToOrdinalFilter, admissionAt, adoptBackgroundScheduler, adoptGraph, adoptLoadedCalibration, allLiveDocIds, arenaFloat32Distance, assembleGraphParts, assignStorePartitions, bindVectorCoreHost, blocksGrowthBytes, bytesToVectors, centroidOfCentroidSums, computeCodeBlockLayout, cosineSimilarityWithMagnitudes, countDead, countOfCentroidSums, coverOrdinal, createCentroidSums, createFixedBuffer, createHNSWIndex, createOrdinalFilter, createOsqQuantizer, createOsqScratch, createSharedVectorStoreHandles, createVectorBlock, createVectorFileReader, deadBytesFor, decodeVectorFilePayload, decodeVectorGraphPartPayload, decodeVectorGraphPayload, decodeVectorIndexParts, defaultEfSearch, defaultQuantizationFor, deserialize, detachNativeStore, dotProduct, emptyFieldBeforeRestore, ensureBlockSlots, euclideanDistance, fieldHandlesOf, filterForOptions, fixedView, graphNeedsRebuild, graphPartsOfEarlierPayload, growBufferTo, grownByteLength, handOverBuildTurns, holdAdmission, insertNode, isDead, liveOrdinals, liveSize, magnitude, mayFree, meanOfCentroidSums, nativeMetricCode, nativeScoresOf, nativeStoreFor, nativeStoreScratchBytes, nextSequence, noBuildHistory, nodeCountOf, oldestHeldPin, openGraphState, openSharedQuantizer, openVectorBlock, ordinalFilterForSubsets, ordinalFilterHas, ordinalFilterValues, osqBitsOf, osqDistance, osqEstimate, osqQuantize, osqRecordBytes, planCheckpoint, publishSequence, readTrailer, recalibrateFromStore, recordCheckpoint, releaseLocksHeldBy, releasePinsHeldBy, releaseReplacedVectors, requireBoundedUpperLists, requireBytesWithinLimit, requireUsableVectorOptions, requireWholeNeighbourLists, rescoreDepth, resetStoreHeader, retiredAtOf, scalarQueryProducts, searchOrdinals, sequenceWritesOf, sharedMemoryAvailable, sharedVectorStoreBytes, shuffleInPlace, shuffleStep, signatureOf, simdModuleLoaded, slotByteOffset, squaredLengthsOfCentroidSums, stageQueryLevels, stampBorn, stampRetired, storePinsOf, threadedNativeCore, threadsHoldCurrentLayout, toDistance, toScore, tombstoneCountOf, topLayerInParts, unplacedChunkCount, vectorsPerFile, vectorsToBytes, withNativeThreadSlot, withTransientAdmission, writeSequenceOf, writeSequenceWords, yieldBuildTurn } from './chunk-WLFOLAQI.mjs';
1
+ export { BUILD_CHUNK_SIZE, BUILD_RETRY_FIRST_DELAY_MS, BUILD_RETRY_MAX_DELAY_MS, BUILD_STEPS_BETWEEN_CLOCK_CHECKS, DEFAULT_FILTER_THRESHOLD, DEFAULT_PROMOTION_THRESHOLD, DEFAULT_VECTOR_METRIC, DISK_ADOPTION_YIELD_INTERVAL, DRIFT_CHECK_GROWTH_FACTOR, ESTIMATED_MS_PER_TOMBSTONE, ESTIMATED_MS_PER_VECTOR_REBUILD, GRAPH_RETIRED, IN_MEMORY, MIN_OVERSAMPLE, NOTHING_STAGED, NO_LIVE_VECTOR_AT_POSITION, QUERY_STAGED, RECALIBRATION_CHUNK_VECTORS, RECALIBRATION_DRIFT_RATIO, SEARCH_ATTEMPTS_BEFORE_HOLDING_WRITES, SEARCH_REFILL_RESERVE, SEARCH_SCAN_CHUNK_VECTORS, SHUFFLED_REBUILD_MEMORY_RETRY_MS, STORE_BLOCK_COUNT, STORE_CALIBRATED, STORE_CALIBRATION_GENERATION, STORE_CODE_BLOCK_COUNT, STORE_CODE_COUNT, STORE_DOC_ID_BYTES, STORE_LIVE_COUNT, STORE_ORDINAL_LAYOUT_GENERATION, STORE_RELEASED_VECTORS_TO_DISK, STORE_REMOVED_COUNT, STORE_SLOTS, STORE_UNPLACED_COUNT, STORE_WRITE_SEQUENCE_INT64, VECTOR_FILE_MAX_VECTORS, VECTOR_FILE_PAYLOAD_VERSION, VECTOR_MEMORY_LIMITS, VECTOR_WORKER_COPIES_ALLOWED, WORKER_COPY_MIN_VECTORS, addToOrdinalFilter, admissionAt, adoptBackgroundScheduler, adoptGraph, adoptLoadedCalibration, allLiveDocIds, arenaFloat32Distance, assembleGraphParts, assignStorePartitions, bindVectorCoreHost, blocksGrowthBytes, bytesToVectors, centroidOfCentroidSums, computeCodeBlockLayout, cosineSimilarityWithMagnitudes, countDead, countOfCentroidSums, coverOrdinal, createCentroidSums, createFixedBuffer, createHNSWIndex, createOrdinalFilter, createOsqQuantizer, createOsqScratch, createSharedVectorStoreHandles, createVectorBlock, createVectorFileReader, deadBytesFor, decodeVectorFilePayload, decodeVectorGraphPartPayload, decodeVectorGraphPayload, decodeVectorIndexParts, defaultEfSearch, defaultQuantizationFor, deserialize, detachNativeStore, dotProduct, emptyFieldBeforeRestore, ensureBlockSlots, euclideanDistance, fieldHandlesOf, filterForOptions, fixedView, graphNeedsRebuild, graphPartsOfEarlierPayload, growBufferTo, grownByteLength, handOverBuildTurns, holdAdmission, insertNode, isDead, liveOrdinals, liveSize, magnitude, mayFree, meanOfCentroidSums, nativeMetricCode, nativeScoresOf, nativeStoreFor, nativeStoreScratchBytes, nextSequence, noBuildHistory, nodeCountOf, oldestHeldPin, openGraphState, openSharedQuantizer, openVectorBlock, ordinalFilterForSubsets, ordinalFilterHas, ordinalFilterValues, osqBitsOf, osqDistance, osqEstimate, osqQuantize, osqRecordBytes, planCheckpoint, publishSequence, readTrailer, recalibrateFromStore, recordCheckpoint, releaseLocksHeldBy, releasePinsHeldBy, releaseReplacedVectors, requireBoundedUpperLists, requireBytesWithinLimit, requireUsableVectorOptions, requireWholeNeighbourLists, rescoreDepth, resetStoreHeader, retiredAtOf, scalarQueryProducts, searchOrdinals, sequenceWritesOf, sharedMemoryAvailable, sharedVectorStoreBytes, shuffleInPlace, shuffleStep, signatureOf, simdModuleLoaded, slotByteOffset, squaredLengthsOfCentroidSums, stageQueryLevels, stampBorn, stampRetired, storePinsOf, threadedNativeCore, threadsHoldCurrentLayout, toDistance, toScore, tombstoneCountOf, topLayerInParts, unplacedChunkCount, vectorsPerFile, vectorsToBytes, withNativeThreadSlot, withTransientAdmission, writeSequenceOf, writeSequenceWords, yieldBuildTurn } from './chunk-KBU3ZFJN.mjs';
2
2
  export { GRAPH_LOCK_WAIT_DEADLINE_MS, GRAPH_LOCK_WAIT_SLICE_MS, LOCK_SPIN_ITERATIONS, LOCK_WAIT_SLICE_MS, MAX_DOC_ID_TABLE_BYTES, MAX_VECTOR_ORDINALS, MAX_WASM_PAGES, NATIVE_ATTACH_RETRY_MS, NATIVE_THREAD_SEARCH_SLOTS, REFUSAL_COLLECTION_MIN_INTERVAL_MS, REFUSAL_COLLECTION_TIME_MULTIPLE, REFUSAL_YOUNG_COLLECTION_MIN_INTERVAL_MS, UI_THREAD_BACKGROUND_SLICE_DURING_WRITES_MS, UI_THREAD_HOP_BEFORE_TURN_WITHIN_MS, UI_THREAD_TURN_BUDGET_MS, UNPLACED_FLAG_CHUNK_ORDINALS, VECTOR_BLOCK_INITIAL_SLOTS, VECTOR_BLOCK_MAX_BYTES, VECTOR_SCRATCH_SLOTS, VECTOR_STORE_INITIAL_CAPACITY, WASM_PAGE_BYTES, backgroundTurnIsSpent, collectAndReturnPages, collectYoungGeneration, holdWritesAndBackgroundWork, threadSlotGone, turnsAreBudgeted, yieldBackgroundTurn } from './chunk-UPDNNOTG.mjs';
3
3
  export { MAX_DOC_ID_LENGTH } from './chunk-3ECIRFS5.mjs';
4
- export { NATIVE_OK, loadNativeCore, nativeSearchCoreIsEnabled, noteFallback } from './chunk-D6FYUTFN.mjs';
4
+ export { NATIVE_OK, loadNativeCore, nativeSearchCoreIsEnabled, noteFallback } from './chunk-ASZLNVWW.mjs';
5
5
  export { COMPACTION_ABSOLUTE_THRESHOLD, COMPACTION_TOMBSTONE_RATIO, CONNECT_RESTARTS_BEFORE_ONE_PASS, CONNECT_STEPS_BETWEEN_CLOCK_CHECKS, DEFAULT_EF_SEARCH, EARLIER_RELEASE_MIN_M, FARTHEST_REJECTED_LINKS_KEPT, INITIAL_LIST_CAPACITY, INITIAL_UPPER_SLOTS, MAX_LAYER_CAP, MAX_M, MIN_M, NEAREST_LINK_FALLBACK_HOSTS, PLACEMENT_ROOM_REQUESTS } from './chunk-ZXX5GZEX.mjs';
6
6
  export { MAX_FILE_BYTES } from './chunk-4PY4JYMY.mjs';
7
- export { ErrorCodes, NarsilError } from './chunk-Q3ZZH5Z7.mjs';
7
+ export { ErrorCodes, NarsilError } from './chunk-ZKOQR7EA.mjs';
8
8
  export { compareCodePoints } from './chunk-TGPKS2UM.mjs';
@@ -1,17 +1,17 @@
1
- export { createDirectExecutor } from './chunk-SL53DHVE.mjs';
2
- import './chunk-KLVMK3R5.mjs';
3
- import './chunk-F4OOBPKA.mjs';
1
+ export { createDirectExecutor } from './chunk-HSA3H3VW.mjs';
2
+ import './chunk-2CKDCC65.mjs';
3
+ import './chunk-AOYQTX6W.mjs';
4
4
  import './chunk-GXCDWLQI.mjs';
5
5
  import './chunk-BUMREPLU.mjs';
6
6
  import './chunk-7T4LAYT4.mjs';
7
- import './chunk-YM2HI5N5.mjs';
8
- import './chunk-X5NHWOXT.mjs';
7
+ import './chunk-IL5DRCNU.mjs';
8
+ import './chunk-7P5YWDRQ.mjs';
9
9
  import './chunk-U2BKYEC7.mjs';
10
- import './chunk-6SZQETSC.mjs';
10
+ import './chunk-RORNUNXW.mjs';
11
11
  import './chunk-UPDNNOTG.mjs';
12
12
  import './chunk-3ECIRFS5.mjs';
13
- import './chunk-D6FYUTFN.mjs';
13
+ import './chunk-ASZLNVWW.mjs';
14
14
  import './chunk-ZXX5GZEX.mjs';
15
15
  import './chunk-4PY4JYMY.mjs';
16
- import './chunk-Q3ZZH5Z7.mjs';
16
+ import './chunk-ZKOQR7EA.mjs';
17
17
  import './chunk-TGPKS2UM.mjs';
@@ -1,4 +1,4 @@
1
- import { C as ClusterCoordinator } from '../../index-CBUl4z3E.js';
1
+ import { C as ClusterCoordinator } from '../../index-BaQIAnk0.js';
2
2
  import '../../schema-CzG9OUw5.js';
3
3
  import '../../adapters-pljAqmrC.js';
4
4
  import '../../synonyms-CpOAHPa-.js';
@@ -1,10 +1,10 @@
1
1
  import { INDEX_METADATA_KEY_PREFIX, indexNameOfMetadataSuffix } from '../../chunk-Q2AP2FSN.mjs';
2
2
  import { MAX_NODE_ID_LENGTH, CONTROLLER_LEASE_KEY, MAX_WATCHERS } from '../../chunk-44W3CBNG.mjs';
3
3
  import { decode } from '../../chunk-GXCDWLQI.mjs';
4
- import '../../chunk-X5NHWOXT.mjs';
4
+ import '../../chunk-7P5YWDRQ.mjs';
5
5
  import '../../chunk-ZXX5GZEX.mjs';
6
6
  import '../../chunk-4PY4JYMY.mjs';
7
- import { NarsilError, ErrorCodes, describeError } from '../../chunk-Q3ZZH5Z7.mjs';
7
+ import { NarsilError, ErrorCodes, describeError } from '../../chunk-ZKOQR7EA.mjs';
8
8
  import { compareCodePoints } from '../../chunk-TGPKS2UM.mjs';
9
9
  import { encode } from '@msgpack/msgpack';
10
10
 
@@ -84,10 +84,12 @@ function buildKey(prefix, ...segments) {
84
84
  // src/distribution/coordinator/etcd/keys.ts
85
85
  var ETCD_KEY_LEASE = "lease";
86
86
  var ETCD_KEY_GENERIC = "kv";
87
+ var ETCD_KEY_NODE_STARTED_AT = "node-started-at";
87
88
  function coordinatorKeys(config) {
88
89
  const prefix = config.keyPrefix;
89
90
  return {
90
91
  node: (nodeId) => buildKey(prefix, ETCD_KEY_NODES, nodeId),
92
+ nodeStartedAt: (nodeId) => buildKey(prefix, ETCD_KEY_NODE_STARTED_AT, nodeId),
91
93
  nodePrefix: () => buildKey(prefix, ETCD_KEY_NODES),
92
94
  allocation: (indexName) => buildKey(prefix, ETCD_KEY_ALLOCATION, indexName),
93
95
  allocationPrefix: () => buildKey(prefix, ETCD_KEY_ALLOCATION),
@@ -646,7 +648,7 @@ async function writeUnderLease(context, registration) {
646
648
  if (context.leaseManager.holdsPayload(context.key, payload)) {
647
649
  return;
648
650
  }
649
- await tracked.lease.put(context.key).value(data).exec();
651
+ await putUnderLease(context, tracked.lease, registration.startedAt, data);
650
652
  context.leaseManager.track(context.key, tracked.lease, registration.nodeId, payload);
651
653
  return;
652
654
  } catch (_) {
@@ -655,7 +657,7 @@ async function writeUnderLease(context, registration) {
655
657
  }
656
658
  const lease = await grantFollowedLease(context);
657
659
  try {
658
- await context.guard.send(write, () => lease.put(context.key).value(data).exec());
660
+ await context.guard.send(write, () => putUnderLease(context, lease, registration.startedAt, data));
659
661
  } catch (error) {
660
662
  await lease.revoke().catch(() => {
661
663
  });
@@ -669,6 +671,9 @@ async function writeUnderLease(context, registration) {
669
671
  });
670
672
  }
671
673
  }
674
+ async function putUnderLease(context, lease, startedAt, data) {
675
+ await context.client.if(context.key, "Create", ">", -1).then(lease.put(context.startedAtKey).value(startedAt), lease.put(context.key).value(data)).commit();
676
+ }
672
677
  async function grantFollowedLease(context) {
673
678
  const sentAt = performance.now();
674
679
  const lease = context.client.lease(context.ttlSeconds);
@@ -690,8 +695,9 @@ async function restoreLostRegistration(context, lost, nodeId, retryDelayMs) {
690
695
  }
691
696
  let lease = null;
692
697
  try {
698
+ const { startedAt } = deserializeNodeRegistration(Buffer.from(tracked.payload));
693
699
  lease = await grantFollowedLease(context);
694
- await lease.put(context.key).value(Buffer.from(tracked.payload)).exec();
700
+ await putUnderLease(context, lease, startedAt, Buffer.from(tracked.payload));
695
701
  } catch (_) {
696
702
  await lease?.revoke().catch(() => {
697
703
  });
@@ -985,6 +991,14 @@ function validateNodeId(nodeId) {
985
991
  );
986
992
  }
987
993
  }
994
+ function isValidNodeId(nodeId) {
995
+ try {
996
+ validateNodeId(nodeId);
997
+ return true;
998
+ } catch (_) {
999
+ return false;
1000
+ }
1001
+ }
988
1002
  function validatePartitionState(value) {
989
1003
  if (!VALID_PARTITION_STATES.has(value)) {
990
1004
  throw new NarsilError(ErrorCodes.CONFIG_INVALID, `Unknown partition state '${value}'`, {
@@ -1071,6 +1085,7 @@ async function createEtcdCoordinator(config) {
1071
1085
  leaseManager,
1072
1086
  guard,
1073
1087
  key: keys.node(registration.nodeId),
1088
+ startedAtKey: keys.nodeStartedAt(registration.nodeId),
1074
1089
  ttlSeconds: resolvedConfig.nodeHeartbeatTtlSeconds,
1075
1090
  isShutdown: () => isShutdown
1076
1091
  },
@@ -1087,7 +1102,7 @@ async function createEtcdCoordinator(config) {
1087
1102
  await entry.lease.revoke().catch(() => {
1088
1103
  });
1089
1104
  }
1090
- await client.delete().key(key).exec();
1105
+ await client.if(key, "Create", ">", -1).then(client.delete().key(keys.nodeStartedAt(nodeId)), client.delete().key(key)).commit();
1091
1106
  },
1092
1107
  registrationLease(nodeId) {
1093
1108
  if (isShutdown) return null;
@@ -1140,7 +1155,7 @@ async function createEtcdCoordinator(config) {
1140
1155
  }
1141
1156
  return deserializeAllocationTable(buf);
1142
1157
  },
1143
- async putAllocation(indexName, table, expectedVersion, writerNodeId) {
1158
+ async putAllocation(indexName, table, expectedVersion, writerNodeId, replicaRegistration) {
1144
1159
  assertNotShutdown();
1145
1160
  const key = keys.allocation(indexName);
1146
1161
  const data = Buffer.from(serializeAllocationTable(table));
@@ -1152,12 +1167,20 @@ async function createEtcdCoordinator(config) {
1152
1167
  if (writerNodeId === void 0 || writerNodeId.length === 0) {
1153
1168
  return false;
1154
1169
  }
1170
+ if (replicaRegistration !== void 0 && !isValidNodeId(replicaRegistration.nodeId)) {
1171
+ return false;
1172
+ }
1155
1173
  const controllerLeaseKey = keys.lease(CONTROLLER_LEASE_KEY);
1174
+ const commitGuarded = async (txn) => {
1175
+ txn.and(controllerLeaseKey, "Value", "==", writerNodeId);
1176
+ if (replicaRegistration !== void 0) {
1177
+ txn.and(keys.node(replicaRegistration.nodeId), "Create", ">", 0);
1178
+ txn.and(keys.nodeStartedAt(replicaRegistration.nodeId), "Value", "==", replicaRegistration.startedAt);
1179
+ }
1180
+ return (await txn.then(client.put(key).value(data)).commit()).succeeded;
1181
+ };
1156
1182
  if (expectedVersion === null) {
1157
- return guard.send(write, async () => {
1158
- const txn = await client.if(key, "Create", "==", 0).and(controllerLeaseKey, "Value", "==", writerNodeId).then(client.put(key).value(data)).commit();
1159
- return txn.succeeded;
1160
- });
1183
+ return guard.send(write, () => commitGuarded(client.if(key, "Create", "==", 0)));
1161
1184
  }
1162
1185
  const response = await client.get(key).exec();
1163
1186
  if (response.kvs.length === 0) {
@@ -1168,10 +1191,7 @@ async function createEtcdCoordinator(config) {
1168
1191
  if (currentTable.version !== expectedVersion) {
1169
1192
  return false;
1170
1193
  }
1171
- return guard.send(write, async () => {
1172
- const txn = await client.if(key, "Mod", "==", kv.mod_revision).and(controllerLeaseKey, "Value", "==", writerNodeId).then(client.put(key).value(data)).commit();
1173
- return txn.succeeded;
1174
- });
1194
+ return guard.send(write, () => commitGuarded(client.if(key, "Mod", "==", kv.mod_revision)));
1175
1195
  },
1176
1196
  async deleteAllocation(indexName) {
1177
1197
  assertNotShutdown();
@@ -1,4 +1,4 @@
1
- import { C as ClusterCoordinator } from '../../index-CBUl4z3E.js';
1
+ import { C as ClusterCoordinator } from '../../index-BaQIAnk0.js';
2
2
  import '../../schema-CzG9OUw5.js';
3
3
  import '../../adapters-pljAqmrC.js';
4
4
  import '../../synonyms-CpOAHPa-.js';
@@ -26,8 +26,7 @@ function createIndexMetadataWatchers() {
26
26
  };
27
27
  }
28
28
 
29
- // src/distribution/coordinator/in-memory.ts
30
- var NODE_HEARTBEAT_PREFIX = "_narsil/node/";
29
+ // src/distribution/coordinator/in-memory/comparisons.ts
31
30
  function bytesEqual(a, b) {
32
31
  if (a.byteLength !== b.byteLength) {
33
32
  return false;
@@ -39,8 +38,15 @@ function bytesEqual(a, b) {
39
38
  }
40
39
  return true;
41
40
  }
41
+ function registrationsMatch(left, right) {
42
+ return JSON.stringify(left) === JSON.stringify(right);
43
+ }
44
+
45
+ // src/distribution/coordinator/in-memory/index.ts
46
+ var NODE_HEARTBEAT_PREFIX = "_narsil/node/";
42
47
  function createInMemoryCoordinator() {
43
48
  const nodes = /* @__PURE__ */ new Map();
49
+ const registeredStartedAt = /* @__PURE__ */ new Map();
44
50
  const allocations = /* @__PURE__ */ new Map();
45
51
  const partitionStates = /* @__PURE__ */ new Map();
46
52
  const leases = /* @__PURE__ */ new Map();
@@ -94,6 +100,7 @@ function createInMemoryCoordinator() {
94
100
  if (key.startsWith(NODE_HEARTBEAT_PREFIX)) {
95
101
  const expiredNodeId = key.slice(NODE_HEARTBEAT_PREFIX.length);
96
102
  nodes.delete(expiredNodeId);
103
+ registeredStartedAt.delete(expiredNodeId);
97
104
  registrationsHeldUntil.delete(expiredNodeId);
98
105
  emitNodeEvent({ type: "node_left", nodeId: expiredNodeId, registration: null });
99
106
  }
@@ -112,6 +119,7 @@ function createInMemoryCoordinator() {
112
119
  const renewedAt = performance.now();
113
120
  const previous = nodes.get(registration.nodeId);
114
121
  nodes.set(registration.nodeId, registration);
122
+ registeredStartedAt.set(registration.nodeId, registration.startedAt);
115
123
  registrationsHeldUntil.set(registration.nodeId, renewedAt + NODE_HEARTBEAT_TTL_MS);
116
124
  const heartbeatKey = `${NODE_HEARTBEAT_PREFIX}${registration.nodeId}`;
117
125
  clearLeaseEntry(heartbeatKey);
@@ -129,6 +137,7 @@ function createInMemoryCoordinator() {
129
137
  async deregisterNode(nodeId) {
130
138
  assertNotShutdown();
131
139
  const existed = nodes.delete(nodeId);
140
+ registeredStartedAt.delete(nodeId);
132
141
  registrationsHeldUntil.delete(nodeId);
133
142
  const heartbeatKey = `${NODE_HEARTBEAT_PREFIX}${nodeId}`;
134
143
  clearLeaseEntry(heartbeatKey);
@@ -156,12 +165,15 @@ function createInMemoryCoordinator() {
156
165
  assertNotShutdown();
157
166
  return allocations.get(indexName) ?? null;
158
167
  },
159
- async putAllocation(indexName, table, expectedVersion, writerNodeId) {
168
+ async putAllocation(indexName, table, expectedVersion, writerNodeId, replicaRegistration) {
160
169
  assertNotShutdown();
161
170
  if (expectedVersion !== void 0) {
162
171
  if (!isLeaseValid(CONTROLLER_LEASE_KEY) || leases.get(CONTROLLER_LEASE_KEY)?.nodeId !== writerNodeId) {
163
172
  return false;
164
173
  }
174
+ if (replicaRegistration !== void 0 && (registeredStartedAt.get(replicaRegistration.nodeId) !== replicaRegistration.startedAt || (registrationsHeldUntil.get(replicaRegistration.nodeId) ?? 0) <= performance.now())) {
175
+ return false;
176
+ }
165
177
  const current = allocations.get(indexName);
166
178
  if (expectedVersion === null) {
167
179
  if (current !== void 0) {
@@ -325,6 +337,7 @@ function createInMemoryCoordinator() {
325
337
  leases.clear();
326
338
  registrationsHeldUntil.clear();
327
339
  nodes.clear();
340
+ registeredStartedAt.clear();
328
341
  allocations.clear();
329
342
  partitionStates.clear();
330
343
  schemas.clear();
@@ -336,8 +349,5 @@ function createInMemoryCoordinator() {
336
349
  };
337
350
  return coordinator;
338
351
  }
339
- function registrationsMatch(left, right) {
340
- return JSON.stringify(left) === JSON.stringify(right);
341
- }
342
352
 
343
353
  export { createInMemoryCoordinator };
@@ -3,10 +3,10 @@ import { timeoutsOf, replyDeadlineMs } from '../../chunk-OIJ64LGT.mjs';
3
3
  import { MAX_MESSAGE_SIZE_BYTES, GRPC_KEEPALIVE_TIMEOUT_MS, GRPC_KEEPALIVE_TIME_MS, GRPC_ENVELOPE_OVERHEAD_BYTES } from '../../chunk-UNEEFTEU.mjs';
4
4
  import { TransportError, TransportErrorCodes } from '../../chunk-5FLRXF73.mjs';
5
5
  import '../../chunk-GXCDWLQI.mjs';
6
- import '../../chunk-X5NHWOXT.mjs';
6
+ import '../../chunk-7P5YWDRQ.mjs';
7
7
  import '../../chunk-ZXX5GZEX.mjs';
8
8
  import '../../chunk-4PY4JYMY.mjs';
9
- import { NarsilError, ErrorCodes } from '../../chunk-Q3ZZH5Z7.mjs';
9
+ import { NarsilError, ErrorCodes } from '../../chunk-ZKOQR7EA.mjs';
10
10
  import '../../chunk-TGPKS2UM.mjs';
11
11
 
12
12
  // src/distribution/transport/grpc/codec.ts
@@ -3,10 +3,10 @@ import { timeoutsOf, replyDeadlineMs } from '../../chunk-OIJ64LGT.mjs';
3
3
  import { MAX_MESSAGE_SIZE_BYTES } from '../../chunk-UNEEFTEU.mjs';
4
4
  import { TransportError, TransportErrorCodes } from '../../chunk-5FLRXF73.mjs';
5
5
  import '../../chunk-GXCDWLQI.mjs';
6
- import '../../chunk-X5NHWOXT.mjs';
6
+ import '../../chunk-7P5YWDRQ.mjs';
7
7
  import '../../chunk-ZXX5GZEX.mjs';
8
8
  import '../../chunk-4PY4JYMY.mjs';
9
- import '../../chunk-Q3ZZH5Z7.mjs';
9
+ import '../../chunk-ZKOQR7EA.mjs';
10
10
  import '../../chunk-TGPKS2UM.mjs';
11
11
  import { connect as connect$1, createServer as createServer$1 } from 'net';
12
12
  import { connect, createServer } from 'tls';
@@ -1,13 +1,13 @@
1
- import { c as CreateIndexOptions, C as ClusterNamespace, d as ClusterNodeConfig } from './config-D9WR3MhO.js';
2
- export { B as BackupListing, e as BackupOperationOptions, f as BackupProgress, a as BackupSummary, g as ClusterBackupConfig, h as ClusterControllerConfig, i as ClusterHealth, j as ClusterHealthStatus, k as ClusterMemoryConfig, l as ClusterMetrics, b as ClusterNodeInfo, m as ClusterQueryConfig, n as CommitPointFigure, o as CoordinatorRequestFigure, p as CreateBackupOptions, D as DamagedBackup, I as IndexHealth, N as NodeReadiness, P as PartitionReplicationFigure, R as ReplicaLagFigure, q as ReplicationConfig, r as RestoreBackupOptions, V as VectorRebuildWaitFigure } from './config-D9WR3MhO.js';
1
+ import { d as CreateIndexOptions, C as ClusterNamespace, e as ClusterNodeConfig } from './config-BvHQ-C7U.js';
2
+ export { B as BackupListing, f as BackupOperationOptions, g as BackupProgress, a as BackupSummary, h as ClusterBackupConfig, i as ClusterControllerConfig, c as ClusterHealth, j as ClusterHealthStatus, k as ClusterMemoryConfig, l as ClusterMetrics, b as ClusterNodeInfo, m as ClusterQueryConfig, n as CommitPointFigure, o as CoordinatorRequestFigure, p as CreateBackupOptions, D as DamagedBackup, I as IndexHealth, N as NodeReadiness, P as PartitionReplicationFigure, R as ReplicaLagFigure, q as ReplicationConfig, r as RestoreBackupOptions, V as VectorRebuildWaitFigure } from './config-BvHQ-C7U.js';
3
3
  import { R as RerankAdapter } from './adapters-pljAqmrC.js';
4
- import { f as SyncSetting, g as SyncStatus, B as BatchResult, L as ListParams, l as ListResult, m as SuggestParams, n as SuggestResult, Q as QueryParams, o as PreflightResult, I as IndexInfo, A as AnalysisChange, p as IndexStats, P as PartitionStatsResult, M as MemoryStats, q as NarsilEventMap, j as QueryResult, h as Narsil } from './engine-De6JzTW8.js';
4
+ import { g as ChangesSetting, h as ChangesStatus, F as FollowChangesOptions, d as ChangesEvent, p as SyncSetting, q as SyncStatus, B as BatchResult, L as ListParams, y as ListResult, w as SuggestParams, A as SuggestResult, Q as QueryParams, z as PreflightResult, I as IndexInfo, D as AnalysisChange, x as IndexStats, P as PartitionStatsResult, M as MemoryStats, J as NarsilEventMap, t as QueryResult, s as Narsil } from './engine-qjAxJSKk.js';
5
5
  import { B as BM25Params, I as IndexConfig, A as AnyDocument, a as InsertOptions } from './schema-CzG9OUw5.js';
6
- import { c as NodeCapacity, N as NodeRole } from './index-CBUl4z3E.js';
7
- export { A as AllocationConstraints, e as AllocationEvent, a as AllocationTable, C as ClusterCoordinator, I as IndexMetadataEvent, f as IndexMetadataWatch, g as IndexPartitionBytes, h as NodeEvent, d as NodeMemoryReport, b as NodeRegistration, P as PartitionAssignment, i as PartitionState, R as RegistrationLease, S as SchemaEvent, U as UnassignedReason } from './index-CBUl4z3E.js';
6
+ import { c as NodeCapacity, N as NodeRole } from './index-BaQIAnk0.js';
7
+ export { A as AllocationConstraints, e as AllocationEvent, a as AllocationTable, C as ClusterCoordinator, E as ExpectedReplicaRegistration, I as IndexMetadataEvent, f as IndexMetadataWatch, g as IndexPartitionBytes, h as NodeEvent, d as NodeMemoryReport, b as NodeRegistration, P as PartitionAssignment, i as PartitionState, R as RegistrationLease, S as SchemaEvent, U as UnassignedReason } from './index-BaQIAnk0.js';
8
8
  import { a as SynonymRule } from './synonyms-CpOAHPa-.js';
9
9
  export { L as ListenHandler, N as NodeTransport, R as RespondFn, T as TransportConfig, a as TransportMessage } from './types-DvncmvuQ.js';
10
- import './config-C687-reW.js';
10
+ import './config-PqgNY1H7.js';
11
11
  import './query-suggestions-CBYkrQ5T.js';
12
12
 
13
13
  /**
@@ -36,6 +36,66 @@ declare const DEFAULT_REPLICATION_FACTOR = 1;
36
36
  */
37
37
  declare const DEFAULT_CAPACITY: NodeCapacity;
38
38
 
39
+ /**
40
+ * Turns change capture on and off for an index across a cluster, follows its changes, and exports its documents.
41
+ *
42
+ * @public
43
+ */
44
+ interface ClusterNodeChanges {
45
+ /**
46
+ * Replaces the change capture setting of an index across the cluster.
47
+ *
48
+ * Turning capture on gives the index a new epoch unless device sync is on. Turning it off makes every node delete the
49
+ * history of its copies unless device sync is on, and close every change feed of the index. The node stores the
50
+ * setting in the index metadata, so every node applies it through its metadata watch.
51
+ *
52
+ * @param indexName - The index whose setting the cluster replaces.
53
+ * @param setting - The new setting.
54
+ * @throws A `NarsilError` with `CHANGES_BACKUP_STORE_REQUIRED` when the cluster has no backup store, with
55
+ * `CHANGES_DURABILITY_REQUIRED` when this node has no write-ahead log durability, with `CHANGES_NOT_READY` while a
56
+ * registered node has a specification version below 1.5, with `CONFIG_INVALID` when a field has the wrong type or a
57
+ * history limit is not a positive whole number, and with `INDEX_NOT_FOUND` when no index has that name.
58
+ */
59
+ updateChanges(indexName: string, setting: ChangesSetting): Promise<void>;
60
+ /**
61
+ * Returns the change capture state of an index, as the index metadata holds it.
62
+ *
63
+ * @param indexName - The index whose state the cluster returns.
64
+ * @returns The setting and the epoch.
65
+ * @throws A `NarsilError` with `INDEX_NOT_FOUND` when no index has that name.
66
+ */
67
+ getChanges(indexName: string): Promise<ChangesStatus>;
68
+ /**
69
+ * Returns the changes of an index above a list of positions, read from each partition's primary up to the point
70
+ * that every replica has acknowledged, and then each later change, until the signal aborts or the caller stops
71
+ * iterating.
72
+ *
73
+ * The first event gives the epoch and the positions. Each later event holds the changes of one partition in `seqNo`
74
+ * order. Where the positions no longer lead to the index's changes, the last event is a resync.
75
+ *
76
+ * @param indexName - The index whose changes the cluster returns.
77
+ * @param options - The epoch and positions to start from, a filter, and a signal.
78
+ * @returns The events, one at a time.
79
+ * @throws A `NarsilError` with `CHANGES_NOT_ENABLED` when capture is off or turns off, with `CHANGES_NOT_READY` while
80
+ * a registered node has a specification version below 1.5, with `CHANGES_INVALID_POSITIONS` for a malformed epoch or
81
+ * list of positions, with `SEARCH_INVALID_FILTER` for a filter that breaks the shape or the limits of a query's
82
+ * filters, with `SEARCH_INVALID_FIELD` for a filter that tests a field which the schema leaves out, and with
83
+ * `CHANGES_PREVIOUS_DOCUMENT_REQUIRED` for a filter while `previousDocument` is off.
84
+ */
85
+ followChanges(indexName: string, options?: FollowChangesOptions): AsyncIterable<ChangesEvent>;
86
+ /**
87
+ * Returns every document of an index with change capture on, as the newest backup of its epoch holds them, after a
88
+ * header that gives the epoch and the position of each partition at that backup.
89
+ *
90
+ * @param indexName - The index whose documents the cluster exports.
91
+ * @returns The export as a stream of JSON lines.
92
+ * @throws A `NarsilError` with `CHANGES_EXPORT_PREPARING` while the cluster takes the backup that the export needs,
93
+ * with `CHANGES_BACKUP_STORE_REQUIRED` when the cluster has no backup store, and with
94
+ * `CLUSTER_OPERATION_UNSUPPORTED` when change capture is off.
95
+ */
96
+ exportDocuments(indexName: string): Promise<ReadableStream<Uint8Array>>;
97
+ }
98
+
39
99
  /**
40
100
  * Changes the search settings of a live index across a cluster.
41
101
  *
@@ -138,7 +198,7 @@ interface ClusterNodeSyncSettings {
138
198
  *
139
199
  * @public
140
200
  */
141
- interface ClusterNode extends ClusterNodeSearchSettings, ClusterNodeSyncSettings {
201
+ interface ClusterNode extends ClusterNodeSearchSettings, ClusterNodeSyncSettings, ClusterNodeChanges {
142
202
  /** This identifies the node across the cluster. */
143
203
  readonly nodeId: string;
144
204
  /** The node holds these roles in the cluster. */
@@ -530,7 +590,8 @@ interface ClusterEngineOptions {
530
590
  * serves a single engine.
531
591
  *
532
592
  * Writes, updates, searches, suggestions, listings, counts, index creation,
533
- * index removal, analysis rebuilds, analysis changes, synonym sets, and document reads route through the cluster.
593
+ * index removal, analysis rebuilds, analysis changes, synonym sets, document reads, change capture, and the
594
+ * document export of an index with change capture on route through the cluster.
534
595
  * Checkpointing, memory statistics, index opens, index closes, engine events,
535
596
  * and rerank adapter registration reach this node's local engine, because
536
597
  * each covers a per-node fact. This node reranks the searches that it
@@ -553,4 +614,4 @@ interface ClusterEngineOptions {
553
614
  */
554
615
  declare function clusterNodeEngine(node: ClusterNode, options?: ClusterEngineOptions): Narsil;
555
616
 
556
- export { type ClusterEngineOptions, ClusterNamespace, type ClusterNode, ClusterNodeConfig, type ClusterNodeSearchSettings, type ClusterNodeSyncSettings, CreateIndexOptions, DEFAULT_CAPACITY, DEFAULT_PARTITION_COUNT, DEFAULT_REPLICATION_FACTOR, NodeCapacity, NodeRole, clusterNodeEngine, createClusterNode };
617
+ export { type ClusterEngineOptions, ClusterNamespace, type ClusterNode, type ClusterNodeChanges, ClusterNodeConfig, type ClusterNodeSearchSettings, type ClusterNodeSyncSettings, CreateIndexOptions, DEFAULT_CAPACITY, DEFAULT_PARTITION_COUNT, DEFAULT_REPLICATION_FACTOR, NodeCapacity, NodeRole, clusterNodeEngine, createClusterNode };