@delali/narsil 0.3.1-next.152 → 0.3.1-next.154

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 (268) hide show
  1. package/README.md +2 -1
  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/{analysis-change-2OYM7ARW.mjs → analysis-change-4GCRVRBW.mjs} +27 -18
  7. package/dist/{react-native/chunks/analysis-change-entry-CXNRW324.mjs → analysis-change-entry-KYGSXW4K.mjs} +1 -1
  8. package/dist/browser/{analysis-change-2V2HZ2NY.mjs → analysis-change-IXWPXXJJ.mjs} +17 -7
  9. package/dist/{analysis-change-entry-QD7YNDEE.mjs → browser/analysis-change-entry-FCSHFQSS.mjs} +1 -1
  10. package/dist/browser/{chunk-TQ5UMFG5.mjs → chunk-2FX6ROWR.mjs} +15 -6
  11. package/dist/browser/{chunk-KWYQ6KX4.mjs → chunk-2SHAKW2Z.mjs} +119 -1922
  12. package/dist/browser/{chunk-55WYRLDZ.mjs → chunk-3U3QR5YP.mjs} +2 -2
  13. package/dist/browser/chunk-4PD752F6.mjs +85 -0
  14. package/dist/browser/chunk-5W3MMTLG.mjs +19 -0
  15. package/dist/browser/{chunk-IAXZAVYL.mjs → chunk-7MEYN7V6.mjs} +1 -151
  16. package/dist/browser/chunk-7TTWXUH6.mjs +1828 -0
  17. package/dist/browser/{chunk-CSCKZBVJ.mjs → chunk-AJ4HHOVT.mjs} +4 -4
  18. package/dist/{react-native/chunks/chunk-DFQJ4IJB.mjs → browser/chunk-AYY6PIKL.mjs} +2 -2
  19. package/dist/browser/{chunk-VD7JEUIR.mjs → chunk-C4KS2QNF.mjs} +9 -8
  20. package/dist/browser/chunk-DSXIBE6N.mjs +78 -0
  21. package/dist/browser/chunk-ELV4OZOI.mjs +29 -0
  22. package/dist/browser/{chunk-PM4MUM5N.mjs → chunk-EUNBNLKM.mjs} +6 -5
  23. package/dist/browser/{chunk-GJKXW3SF.mjs → chunk-G7LUMBSG.mjs} +137 -253
  24. package/dist/browser/{chunk-B3JM6Z74.mjs → chunk-H6QFBMVE.mjs} +3 -2
  25. package/dist/browser/chunk-J433A7P3.mjs +241 -0
  26. package/dist/browser/chunk-ML6HY7T7.mjs +96 -0
  27. package/dist/browser/chunk-ML7THVLJ.mjs +38 -0
  28. package/dist/{chunk-MDF6PDIA.mjs → browser/chunk-MYITLCHT.mjs} +7 -1
  29. package/dist/browser/{chunk-QJCO3TJU.mjs → chunk-QXTPSX2H.mjs} +9 -150
  30. package/dist/browser/{chunk-MPK76GVS.mjs → chunk-RA6LSBCM.mjs} +1 -21
  31. package/dist/browser/{chunk-7ZJTRUVW.mjs → chunk-SIR3LMTV.mjs} +2 -2
  32. package/dist/browser/{chunk-LURXVCHG.mjs → chunk-SJB6VIZG.mjs} +1 -1
  33. package/dist/browser/chunk-TTD27VXX.mjs +298 -0
  34. package/dist/browser/chunk-U2E3HMYW.mjs +151 -0
  35. package/dist/browser/{chunk-2A2IPRC3.mjs → chunk-VCOYGVP7.mjs} +5 -31
  36. package/dist/browser/chunk-VI7BQR4U.mjs +21 -0
  37. package/dist/browser/chunk-W5X2UFWQ.mjs +102 -0
  38. package/dist/browser/{chunk-HT7J73QL.mjs → chunk-XRV72TJD.mjs} +2 -2
  39. package/dist/browser/chunk-YJHGOJAC.mjs +15 -0
  40. package/dist/browser/chunk-ZI2V4VD7.mjs +21 -0
  41. package/dist/{react-native/chunks/chunk-QC4ZRBSX.mjs → browser/chunk-ZPTA75ZC.mjs} +2 -79
  42. package/dist/browser/{cold-module-YECAK4MN.mjs → cold-module-VTUGDYNY.mjs} +20 -14
  43. package/dist/browser/{durability-wiring-LM7WFL6X.mjs → durability-wiring-GL4A7KDV.mjs} +1886 -1364
  44. package/dist/browser/import-YI5GNB4H.mjs +17 -0
  45. package/dist/browser/methods-LMUTS7OI.mjs +30 -0
  46. package/dist/browser/{module-XQLEOYNM.mjs → module-EC3FYW7N.mjs} +9 -8
  47. package/dist/browser/{module-KAMRAJLE.mjs → module-M4JNBV6V.mjs} +16 -10
  48. package/dist/browser/operations-WVYLF72Q.mjs +5 -0
  49. package/dist/browser/{phrase-module-CNKMUY4U.mjs → phrase-module-NPYUVX75.mjs} +1 -1
  50. package/dist/browser/{pool-DTYSPBMQ.mjs → pool-WCGDZHJP.mjs} +3 -2
  51. package/dist/{restore-queue-AOF5OTQV.mjs → browser/restore-queue-TYIGDL5L.mjs} +2 -2
  52. package/dist/browser/retention-6QMRS5VK.mjs +207 -0
  53. package/dist/browser/{runtime-D2ULZGCN.mjs → runtime-3EW2AGB6.mjs} +1 -1
  54. package/dist/browser/{snapshot-UGZVMP4H.mjs → snapshot-DN3CRVUQ.mjs} +38 -307
  55. package/dist/browser/sync-state-P5XG6LTQ.mjs +15 -0
  56. package/dist/browser/{write-I5P5MW4O.mjs → write-WAWAFGKQ.mjs} +16 -11
  57. package/dist/{capabilities-BT-HLDC8.d.ts → capabilities-B3Brs1Rc.d.ts} +62 -7
  58. package/dist/{chunk-DGRM4EZZ.mjs → chunk-37IVJLP6.mjs} +1 -1
  59. package/dist/{chunk-KYVRZAYP.mjs → chunk-3A5KI24C.mjs} +2 -69
  60. package/dist/{chunk-POUYICOU.mjs → chunk-3OFU3NJT.mjs} +1 -1
  61. package/dist/{chunk-3TVDTACC.mjs → chunk-3Y3J4V2R.mjs} +1 -1
  62. package/dist/{chunk-FNBNZCGP.mjs → chunk-466PYR4P.mjs} +2 -2
  63. package/dist/{chunk-SEAJS664.mjs → chunk-4HWZV5MK.mjs} +5 -5
  64. package/dist/{chunk-UGVUW27S.mjs → chunk-5FUOVJKG.mjs} +13 -9
  65. package/dist/{chunk-ZHAXP7SD.mjs → chunk-5KGYQT6W.mjs} +6 -235
  66. package/dist/{chunk-NPXVQS33.mjs → chunk-62G63NMH.mjs} +4 -3
  67. package/dist/chunk-6MSZ543Y.mjs +32 -0
  68. package/dist/chunk-7GXJUJ24.mjs +49 -0
  69. package/dist/{chunk-3E4RRF5J.mjs → chunk-7HCZWC7B.mjs} +58 -8
  70. package/dist/{chunk-6RKSY3BX.mjs → chunk-7NTMUDC5.mjs} +5 -5
  71. package/dist/chunk-7QUGDVFC.mjs +101 -0
  72. package/dist/{chunk-G5KHSM6E.mjs → chunk-AO2FAYIZ.mjs} +1 -1
  73. package/dist/chunk-B7S6YEBP.mjs +102 -0
  74. package/dist/{chunk-AWNHDBKV.mjs → chunk-BPSKLCS7.mjs} +15 -7
  75. package/dist/chunk-BUMREPLU.mjs +15 -0
  76. package/dist/{chunk-T4CJDBBE.mjs → chunk-C6ASEFZI.mjs} +1 -1
  77. package/dist/{chunk-NITCPDFL.mjs → chunk-C73JLU4E.mjs} +2 -2
  78. package/dist/{chunk-NYSONUB7.mjs → chunk-CP5RRPJR.mjs} +1 -1
  79. package/dist/{chunk-TTCKT2RT.mjs → chunk-DMQPFLGI.mjs} +134 -11
  80. package/dist/{chunk-3SBJVQLL.mjs → chunk-DVWYODEB.mjs} +2 -2
  81. package/dist/chunk-ECX4SGX6.mjs +167 -0
  82. package/dist/chunk-GES7U2PM.mjs +68 -0
  83. package/dist/{chunk-NVTFQFUL.mjs → chunk-HVKXNBFL.mjs} +1 -1
  84. package/dist/chunk-HVYICDY3.mjs +214 -0
  85. package/dist/{chunk-3HV7M5OJ.mjs → chunk-HWEDFLB7.mjs} +9 -133
  86. package/dist/{chunk-52QQWEBS.mjs → chunk-IBNLW3AV.mjs} +21 -6
  87. package/dist/chunk-IJU7LL7D.mjs +242 -0
  88. package/dist/chunk-IPN7S4KX.mjs +130 -0
  89. package/dist/{chunk-5QMHMELB.mjs → chunk-IQ4R2I6N.mjs} +4 -1
  90. package/dist/chunk-JCLTESFN.mjs +96 -0
  91. package/dist/{chunk-J4BDAH2W.mjs → chunk-JFNKIBDT.mjs} +2 -2
  92. package/dist/{chunk-LDGGR7YT.mjs → chunk-K4B7OH65.mjs} +2 -2
  93. package/dist/{chunk-7TE2AJIH.mjs → chunk-K7KLL263.mjs} +13 -10
  94. package/dist/{chunk-CSHHU7PA.mjs → chunk-KCUIFVVW.mjs} +11 -30
  95. package/dist/{react-native/chunks/chunk-YH7W556M.mjs → chunk-KUZKUONM.mjs} +11 -2
  96. package/dist/chunk-KYYABCSW.mjs +72 -0
  97. package/dist/{chunk-B2FTZNNF.mjs → chunk-LKUE5GXS.mjs} +34 -14
  98. package/dist/{chunk-2PNYKG2D.mjs → chunk-LSM2YTKM.mjs} +100 -335
  99. package/dist/{chunk-DMNPYF54.mjs → chunk-LTUGDMV4.mjs} +2 -2
  100. package/dist/{chunk-FDG4KXX5.mjs → chunk-MLHNSAPK.mjs} +5 -3
  101. package/dist/{chunk-VP6XRMWR.mjs → chunk-MMBEANB2.mjs} +6 -32
  102. package/dist/{chunk-LJ4ENXOD.mjs → chunk-MMEMEUOO.mjs} +2 -2
  103. package/dist/{chunk-2HJWQPR6.mjs → chunk-NTZOXVUZ.mjs} +6 -122
  104. package/dist/{chunk-5WB2A3XU.mjs → chunk-NZMAXR2S.mjs} +397 -24
  105. package/dist/{chunk-IZT3G24Q.mjs → chunk-O43Z4MS6.mjs} +2 -2
  106. package/dist/{chunk-U46IZNCW.mjs → chunk-OKX2BBNW.mjs} +3 -2
  107. package/dist/{chunk-RBEHLIKX.mjs → chunk-PFKM7VNZ.mjs} +14 -8
  108. package/dist/chunk-PGVPE7GJ.mjs +96 -0
  109. package/dist/chunk-Q3TCTQCC.mjs +85 -0
  110. package/dist/chunk-Q7MS6P2J.mjs +74 -0
  111. package/dist/chunk-QDZJM7NI.mjs +23 -0
  112. package/dist/{chunk-ZS6CMXAE.mjs → chunk-QKZHLADX.mjs} +89 -250
  113. package/dist/{chunk-IJSFWGVW.mjs → chunk-REL7LFLR.mjs} +3 -3
  114. package/dist/chunk-RVKFI3A2.mjs +237 -0
  115. package/dist/chunk-S2N75OTN.mjs +83 -0
  116. package/dist/chunk-TRISKD4Q.mjs +50 -0
  117. package/dist/{chunk-6F6USYII.mjs → chunk-TV2L3BN7.mjs} +13 -11
  118. package/dist/{chunk-6BWLDLS3.mjs → chunk-URPCYQVJ.mjs} +1 -1
  119. package/dist/chunk-USR7FQRZ.mjs +34 -0
  120. package/dist/chunk-V6EUBAIT.mjs +19 -0
  121. package/dist/{chunk-SOUZMPME.mjs → chunk-VMXSVVXG.mjs} +7 -194
  122. package/dist/{chunk-4QCSHLNM.mjs → chunk-VREK3MYG.mjs} +3 -3
  123. package/dist/{chunk-YGQOPB2Z.mjs → chunk-WCBA2LVZ.mjs} +1 -1
  124. package/dist/{chunk-KQJVNPRM.mjs → chunk-X6NSJYQ3.mjs} +19 -16
  125. package/dist/chunk-Y4WPNHMC.mjs +50 -0
  126. package/dist/{chunk-IRWP524D.mjs → chunk-YBJDOA2T.mjs} +1 -1
  127. package/dist/{chunk-IJPK5PGM.mjs → chunk-YPUEV6ZC.mjs} +1 -1
  128. package/dist/{chunk-J7M73VY7.mjs → chunk-YROWNOMH.mjs} +1 -1
  129. package/dist/chunk-Z3TNWCI5.mjs +196 -0
  130. package/dist/{chunk-65WCV5JO.mjs → chunk-ZIFJXCKA.mjs} +1 -1
  131. package/dist/chunk-ZYAY26KG.mjs +29 -0
  132. package/dist/{client-Cn3gNxUU.d.ts → client-Df76GNKm.d.ts} +76 -6
  133. package/dist/client.d.ts +8 -7
  134. package/dist/client.mjs +56 -5
  135. package/dist/{cold-module-PYSSBIL7.mjs → cold-module-YLWMTTZG.mjs} +38 -28
  136. package/dist/{config-CfhH1IWQ.d.ts → config-05G_hy-1.d.ts} +3 -3
  137. package/dist/config-B8DP2VwR.d.ts +463 -0
  138. package/dist/{direct-executor-WYALQSMD.mjs → direct-executor-FI5GJHWX.mjs} +14 -9
  139. package/dist/distribution/coordinator/etcd.d.ts +11 -2
  140. package/dist/distribution/coordinator/etcd.mjs +268 -107
  141. package/dist/distribution/coordinator/in-memory.d.ts +2 -2
  142. package/dist/distribution/transport/grpc.mjs +4 -4
  143. package/dist/distribution/transport/in-memory.mjs +2 -2
  144. package/dist/distribution/transport/tcp.mjs +3 -3
  145. package/dist/distribution.d.ts +41 -9
  146. package/dist/distribution.mjs +1296 -117
  147. package/dist/{durability-wiring-7VBZEJLG.mjs → durability-wiring-RHLXDIVF.mjs} +1751 -1226
  148. package/dist/embeddings/openai.mjs +2 -2
  149. package/dist/{engine-CJRUHXgf.d.ts → engine-DYu-e0oR.d.ts} +50 -40
  150. package/dist/{import-GJOMB2HC.mjs → import-SRBNC6TE.mjs} +27 -19
  151. package/dist/{index-MsF7e5hL.d.ts → index-nRqDM6uS.d.ts} +1 -1
  152. package/dist/index.browser.mjs +8 -4
  153. package/dist/index.d.ts +7 -6
  154. package/dist/index.mjs +24 -16
  155. package/dist/index.react-native.mjs +17 -11
  156. package/dist/{long-query-thread-SCUE62TO.mjs → long-query-thread-EMYTGSJP.mjs} +28 -15
  157. package/dist/methods-ABM5ELBR.mjs +30 -0
  158. package/dist/{module-AVQEIB7O.mjs → module-3OMJZUFT.mjs} +12 -12
  159. package/dist/{module-6RLIKSZQ.mjs → module-MG7JMV2U.mjs} +33 -23
  160. package/dist/operations-PGOAY2KS.mjs +5 -0
  161. package/dist/{paged-partition-archive-KGRW366Y.mjs → paged-partition-archive-UOLHOEZJ.mjs} +37 -26
  162. package/dist/partial-words.mjs +6 -4
  163. package/dist/pattern.mjs +4 -3
  164. package/dist/persistence/durability/checkpoint-worker.d.ts +9 -1
  165. package/dist/persistence/durability/checkpoint-worker.mjs +34 -23
  166. package/dist/{phrase-module-OUQIRUQU.mjs → phrase-module-O3MDRQXP.mjs} +1 -1
  167. package/dist/{pool-UPV5PVPY.mjs → pool-CQXYPFLG.mjs} +2 -2
  168. package/dist/react-native/chunks/{analysis-change-DXPZRGWF.mjs → analysis-change-EAYO3Y6Q.mjs} +27 -15
  169. package/dist/{browser/analysis-change-entry-JL5U2N3Q.mjs → react-native/chunks/analysis-change-entry-TNLUC6IZ.mjs} +1 -1
  170. package/dist/react-native/chunks/{chunk-D7LFYPYI.mjs → chunk-2CGSQM4O.mjs} +12 -10
  171. package/dist/react-native/chunks/chunk-3NQOVO3K.mjs +1 -0
  172. package/dist/react-native/chunks/{chunk-R4OPUZQ5.mjs → chunk-3O57C2ZO.mjs} +2 -2
  173. package/dist/react-native/chunks/chunk-3XKMRNRE.mjs +298 -0
  174. package/dist/react-native/chunks/{chunk-IDFMNRIC.mjs → chunk-63YSZOXB.mjs} +97 -333
  175. package/dist/react-native/chunks/{chunk-UFNCLEQM.mjs → chunk-75VWIY35.mjs} +1 -1
  176. package/dist/react-native/chunks/{chunk-2J2727V4.mjs → chunk-7GWPJDOA.mjs} +1 -1
  177. package/dist/react-native/chunks/{chunk-PU55IOG4.mjs → chunk-AUT7PMA4.mjs} +6 -190
  178. package/dist/react-native/chunks/chunk-C2H2QQFW.mjs +288 -0
  179. package/dist/react-native/chunks/chunk-CHPTFFJM.mjs +43 -0
  180. package/dist/{browser/chunk-PIS7ZAP7.mjs → react-native/chunks/chunk-CUNGPR5R.mjs} +11 -2
  181. package/dist/{browser/chunk-NVEJJP4R.mjs → react-native/chunks/chunk-DCKMICOB.mjs} +2 -79
  182. package/dist/react-native/chunks/chunk-DH3TVWWK.mjs +102 -0
  183. package/dist/react-native/chunks/{chunk-ZCKNBPQ4.mjs → chunk-EH5CFV6Z.mjs} +2 -2
  184. package/dist/react-native/chunks/chunk-F753DA54.mjs +23 -0
  185. package/dist/{browser/chunk-VBX2TI5V.mjs → react-native/chunks/chunk-GFYFQLJD.mjs} +2 -2
  186. package/dist/react-native/chunks/{chunk-7IQR3SZO.mjs → chunk-I5PGWQJF.mjs} +142 -257
  187. package/dist/react-native/chunks/{chunk-NFGBOI46.mjs → chunk-IOY2SM2P.mjs} +1 -1
  188. package/dist/react-native/chunks/chunk-JDOEEMEF.mjs +38 -0
  189. package/dist/react-native/chunks/{chunk-TLYD7IJ2.mjs → chunk-JPAJWO6D.mjs} +1 -1
  190. package/dist/react-native/chunks/chunk-JWUCMVRK.mjs +15 -0
  191. package/dist/react-native/chunks/{chunk-KLZGAOLT.mjs → chunk-JX2RIAXH.mjs} +4 -4
  192. package/dist/react-native/chunks/chunk-LU3Y3P63.mjs +68 -0
  193. package/dist/react-native/chunks/{chunk-LQAKO5QV.mjs → chunk-NCJS3WIY.mjs} +2 -2
  194. package/dist/react-native/chunks/{chunk-BRNAVOKP.mjs → chunk-NKIZX26F.mjs} +2 -2
  195. package/dist/react-native/chunks/{chunk-CLE3LZ77.mjs → chunk-NP7DD4G5.mjs} +5 -4
  196. package/dist/react-native/chunks/chunk-NVVRSRX5.mjs +78 -0
  197. package/dist/react-native/chunks/chunk-O32RB3BL.mjs +191 -0
  198. package/dist/react-native/chunks/{chunk-DKJTZ625.mjs → chunk-OQQVRWZ2.mjs} +2 -69
  199. package/dist/react-native/chunks/chunk-PB2YXVQW.mjs +29 -0
  200. package/dist/react-native/chunks/chunk-Q32DDFKX.mjs +19 -0
  201. package/dist/react-native/chunks/{chunk-LRGWK367.mjs → chunk-RVAEBN74.mjs} +1 -1
  202. package/dist/react-native/chunks/{chunk-KOCTCUXW.mjs → chunk-RYMDHGL4.mjs} +16 -8
  203. package/dist/react-native/chunks/chunk-SJWDBRNP.mjs +85 -0
  204. package/dist/react-native/chunks/chunk-UNUFZ2QY.mjs +68 -0
  205. package/dist/react-native/chunks/chunk-UWDNZDWK.mjs +242 -0
  206. package/dist/react-native/chunks/{chunk-FS7BYE23.mjs → chunk-VQSKZ3EZ.mjs} +9 -152
  207. package/dist/react-native/chunks/{chunk-UCJU6WNH.mjs → chunk-VVFYOADG.mjs} +7 -6
  208. package/dist/react-native/chunks/{chunk-VGUWIZFQ.mjs → chunk-YBEW6YTR.mjs} +1 -1
  209. package/dist/react-native/chunks/{chunk-JYL35A4A.mjs → chunk-YHKZSLOC.mjs} +7 -33
  210. package/dist/react-native/chunks/{chunk-3CTWSQRW.mjs → chunk-ZBSWRSBG.mjs} +4 -30
  211. package/dist/react-native/chunks/chunk-ZYDKJXQJ.mjs +96 -0
  212. package/dist/react-native/chunks/{cold-module-KFGEWYEL.mjs → cold-module-TJL6AFAD.mjs} +29 -21
  213. package/dist/react-native/chunks/{durability-wiring-QKJB2QBT.mjs → durability-wiring-RRDYJLLM.mjs} +1882 -1358
  214. package/dist/react-native/chunks/gzip.react-native-DNB5YNFA.mjs +3 -0
  215. package/dist/react-native/chunks/import-JYBMEJPQ.mjs +29 -0
  216. package/dist/react-native/chunks/methods-X6F36SJE.mjs +30 -0
  217. package/dist/react-native/chunks/module-QT5HZAY4.mjs +33 -0
  218. package/dist/react-native/chunks/{module-UJ5VUARS.mjs → module-S4DKSWMF.mjs} +10 -9
  219. package/dist/react-native/chunks/operations-RYKTSZQA.mjs +5 -0
  220. package/dist/react-native/chunks/{phrase-module-76UAPPSG.mjs → phrase-module-JZ37TB7N.mjs} +1 -1
  221. package/dist/react-native/chunks/{pool-CD4ANYUI.mjs → pool-RTGXJXPU.mjs} +3 -2
  222. package/dist/{browser/restore-queue-UQ6AAUVX.mjs → react-native/chunks/restore-queue-ZBVIKJWI.mjs} +2 -2
  223. package/dist/react-native/chunks/retention-PPCTP2VY.mjs +219 -0
  224. package/dist/react-native/chunks/{runtime-3MCDLJAF.mjs → runtime-KUATOLYB.mjs} +1 -1
  225. package/dist/react-native/chunks/{snapshot-KVBD4LRC.mjs → snapshot-ZBIEOZTZ.mjs} +47 -314
  226. package/dist/react-native/chunks/sync-state-PASCIHHT.mjs +15 -0
  227. package/dist/react-native/chunks/{write-ES5A3WUA.mjs → write-2W4FTX7J.mjs} +25 -18
  228. package/dist/react-native/partial-words.mjs +6 -4
  229. package/dist/react-native/pattern.mjs +4 -3
  230. package/dist/react-native/sync.mjs +2236 -0
  231. package/dist/react-native/synonyms.mjs +7 -4
  232. package/dist/react.d.ts +10 -9
  233. package/dist/react.mjs +7 -1
  234. package/dist/{rerank-3W54N6P2.mjs → rerank-IZOB6NII.mjs} +4 -4
  235. package/dist/rerankers/http.mjs +2 -2
  236. package/dist/{react-native/chunks/restore-queue-H5VCN453.mjs → restore-queue-COI2GSSK.mjs} +2 -2
  237. package/dist/retention-55WA7GPU.mjs +58 -0
  238. package/dist/{runtime-L2DZYY6N.mjs → runtime-UZOC3NPY.mjs} +5 -5
  239. package/dist/{schema-D33CyXCy.d.ts → schema-DDauvDOv.d.ts} +1 -1
  240. package/dist/server.d.ts +22 -19
  241. package/dist/server.mjs +868 -50
  242. package/dist/{snapshot-WMX6JCLP.mjs → snapshot-NFX2EYN2.mjs} +62 -36
  243. package/dist/sync/filesystem.d.ts +30 -0
  244. package/dist/sync/filesystem.mjs +271 -0
  245. package/dist/sync/indexeddb.d.ts +30 -0
  246. package/dist/sync/indexeddb.mjs +237 -0
  247. package/dist/sync-state-ZWHLAFLE.mjs +15 -0
  248. package/dist/{config-aIsy7mcL.d.ts → sync-uXR7MmM7.d.ts} +53 -444
  249. package/dist/sync.browser.mjs +2231 -0
  250. package/dist/sync.d.ts +23 -0
  251. package/dist/sync.mjs +2206 -0
  252. package/dist/synonyms.mjs +5 -3
  253. package/dist/{tasks-C4ElXr4P.d.ts → tasks-BShx8pdK.d.ts} +4 -4
  254. package/dist/thread-P2G2FWM2.mjs +44 -0
  255. package/dist/types-SnO7_tAI.d.ts +228 -0
  256. package/dist/vector/search-worker.d.ts +1 -1
  257. package/dist/vector/search-worker.mjs +6 -6
  258. package/dist/workers/entry.mjs +7 -7
  259. package/dist/{write-SKJ6HW7O.mjs → write-FGB62BHQ.mjs} +31 -23
  260. package/openapi.json +119 -3
  261. package/package.json +28 -8
  262. package/dist/browser/import-QOY6ZH6X.mjs +0 -12
  263. package/dist/chunk-7LDMWKP6.mjs +0 -209
  264. package/dist/react-native/chunks/chunk-L4M7QJNP.mjs +0 -110
  265. package/dist/react-native/chunks/gzip.react-native-7JWCLVOB.mjs +0 -3
  266. package/dist/react-native/chunks/import-XFBCCENV.mjs +0 -22
  267. package/dist/react-native/chunks/module-FHJ2GOBI.mjs +0 -25
  268. package/dist/thread-I7DVHHW7.mjs +0 -31
@@ -1,6 +1,6 @@
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
- import { NarsilError, ErrorCodes, describeError } from '../../chunk-MDF6PDIA.mjs';
3
+ import { NarsilError, ErrorCodes, describeError } from '../../chunk-KUZKUONM.mjs';
4
4
  import '../../chunk-R6A773WK.mjs';
5
5
  import { compareCodePoints } from '../../chunk-YTJCGKM4.mjs';
6
6
  import { encode, decode } from '@msgpack/msgpack';
@@ -227,44 +227,202 @@ async function loadEtcd3Module() {
227
227
  }
228
228
  }
229
229
 
230
- // src/distribution/coordinator/etcd/prefix-watch.ts
231
- function connectedOrDropped(watcher) {
232
- return new Promise((resolve, reject) => {
233
- const timer = setTimeout(() => {
234
- detach();
235
- reject(
236
- new NarsilError(
237
- ErrorCodes.COORDINATOR_UNAVAILABLE,
238
- `etcd did not attach the watch within ${ETCD_WATCH_ATTACH_TIMEOUT_MS} ms`
239
- )
240
- );
241
- }, ETCD_WATCH_ATTACH_TIMEOUT_MS);
242
- timer.unref?.();
243
- const onConnected = () => {
244
- detach();
245
- resolve();
230
+ // src/distribution/coordinator/etcd/watch-stream.ts
231
+ var WatchAttachError = class extends NarsilError {
232
+ };
233
+ function shutDownError() {
234
+ return new NarsilError(ErrorCodes.CONFIG_INVALID, "Coordinator has been shut down");
235
+ }
236
+ function attachFailure(message) {
237
+ return new WatchAttachError(ErrorCodes.COORDINATOR_UNAVAILABLE, message);
238
+ }
239
+ function prefixRangeEnd(prefix) {
240
+ for (let position = prefix.length - 1; position >= 0; position--) {
241
+ const byte = prefix[position];
242
+ if (byte !== void 0 && byte < 255) {
243
+ const end = Buffer.from(prefix.subarray(0, position + 1));
244
+ end[position] = byte + 1;
245
+ return end;
246
+ }
247
+ }
248
+ return Buffer.from([0]);
249
+ }
250
+ async function openOne(client, prefix, startRevision, listener, registry) {
251
+ const stream = await client.watchClient.watch();
252
+ let attached = false;
253
+ let closing = false;
254
+ let finished = false;
255
+ let settleAttach = () => {
256
+ };
257
+ let markFinished = () => {
258
+ };
259
+ const done = new Promise((resolve) => {
260
+ markFinished = resolve;
261
+ });
262
+ const attachedOrFailed = new Promise((resolve) => {
263
+ settleAttach = resolve;
264
+ });
265
+ const watch = {
266
+ close() {
267
+ if (!closing) {
268
+ closing = true;
269
+ try {
270
+ stream.end();
271
+ stream.cancel();
272
+ } catch (_) {
273
+ }
274
+ }
275
+ return done;
276
+ }
277
+ };
278
+ function finish() {
279
+ if (finished) return;
280
+ finished = true;
281
+ registry.forget(watch);
282
+ markFinished();
283
+ if (!attached) settleAttach(attachFailure("the etcd watch stream ended before etcd attached the watch"));
284
+ else if (!closing) listener.lost();
285
+ }
286
+ function receive(response) {
287
+ if (closing || finished) return;
288
+ if (!attached) {
289
+ if (!response.created) return;
290
+ if (response.canceled) {
291
+ settleAttach(attachFailure(`etcd refused the watch: ${response.cancel_reason || "no reason given"}`));
292
+ return;
293
+ }
294
+ attached = true;
295
+ settleAttach(null);
296
+ return;
297
+ }
298
+ for (const event of response.events ?? []) {
299
+ try {
300
+ if (event.type === "Put") listener.put(event.kv);
301
+ else if (event.type === "Delete") listener.delete(event.kv);
302
+ } catch (handlerError) {
303
+ void watch.close();
304
+ listener.handlerFailed(handlerError);
305
+ listener.lost();
306
+ return;
307
+ }
308
+ }
309
+ if (response.canceled) {
310
+ void watch.close();
311
+ listener.lost();
312
+ }
313
+ }
314
+ stream.on("data", (response) => {
315
+ try {
316
+ receive(response);
317
+ } catch (_) {
318
+ }
319
+ });
320
+ stream.on("error", () => {
321
+ });
322
+ stream.on("status", () => {
323
+ try {
324
+ finish();
325
+ } catch (_) {
326
+ }
327
+ });
328
+ registry.remember(watch);
329
+ if (registry.isClosed()) {
330
+ await watch.close();
331
+ throw shutDownError();
332
+ }
333
+ const timer = setTimeout(
334
+ () => settleAttach(attachFailure(`etcd did not attach the watch within ${ETCD_WATCH_ATTACH_TIMEOUT_MS} ms`)),
335
+ ETCD_WATCH_ATTACH_TIMEOUT_MS
336
+ );
337
+ timer.unref?.();
338
+ const key = Buffer.from(prefix);
339
+ try {
340
+ stream.write({ create_request: { key, range_end: prefixRangeEnd(key), start_revision: startRevision } });
341
+ } catch (_) {
342
+ settleAttach(attachFailure("the etcd watch stream refused the watch request"));
343
+ }
344
+ const failure = await attachedOrFailed;
345
+ clearTimeout(timer);
346
+ if (failure !== null) {
347
+ await watch.close();
348
+ throw registry.isClosed() ? shutDownError() : failure;
349
+ }
350
+ return watch;
351
+ }
352
+ function createWatchStreams() {
353
+ const open = /* @__PURE__ */ new Set();
354
+ const pending = /* @__PURE__ */ new Set();
355
+ let opening = 0;
356
+ let closed = false;
357
+ function track(operation) {
358
+ const followed = operation.then(
359
+ () => {
360
+ },
361
+ () => {
362
+ }
363
+ );
364
+ pending.add(followed);
365
+ void followed.then(() => pending.delete(followed));
366
+ return operation;
367
+ }
368
+ async function openTracked(client, prefix, startRevision, listener) {
369
+ if (closed) throw shutDownError();
370
+ if (open.size + opening >= MAX_WATCHERS) {
371
+ throw new NarsilError(ErrorCodes.CONFIG_INVALID, `Maximum watcher limit (${MAX_WATCHERS}) reached`, {
372
+ currentCount: open.size + opening
373
+ });
374
+ }
375
+ opening += 1;
376
+ let reserved = true;
377
+ const releaseReservation = () => {
378
+ if (!reserved) return;
379
+ reserved = false;
380
+ opening -= 1;
246
381
  };
247
- const onDropped = (error) => {
248
- detach();
249
- reject(error);
382
+ const registry = {
383
+ remember(watch) {
384
+ releaseReservation();
385
+ open.add(watch);
386
+ },
387
+ forget: (watch) => open.delete(watch),
388
+ isClosed: () => closed
250
389
  };
251
- function detach() {
252
- clearTimeout(timer);
253
- watcher.off("connected", onConnected);
254
- watcher.off("disconnected", onDropped);
255
- watcher.off("error", onDropped);
390
+ try {
391
+ return await openOne(client, prefix, startRevision, listener, registry);
392
+ } finally {
393
+ releaseReservation();
256
394
  }
257
- watcher.once("connected", onConnected);
258
- watcher.once("disconnected", onDropped);
259
- watcher.once("error", onDropped);
260
- });
395
+ }
396
+ return {
397
+ open: (client, prefix, startRevision, listener) => track(openTracked(client, prefix, startRevision, listener)),
398
+ track,
399
+ isClosed: () => closed,
400
+ async closeAll() {
401
+ closed = true;
402
+ while (open.size > 0 || pending.size > 0) {
403
+ await Promise.all([...[...open].map((watch) => watch.close()), ...pending]);
404
+ }
405
+ }
406
+ };
407
+ }
408
+
409
+ // src/distribution/coordinator/etcd/prefix-watch.ts
410
+ function blamesTheConnection(error) {
411
+ return error instanceof WatchAttachError || !(error instanceof NarsilError);
261
412
  }
262
- async function watchPrefix(context, prefix, handlers) {
413
+ function watchPrefix(context, prefix, handlers) {
414
+ const { streams } = context;
415
+ if (streams.isClosed()) {
416
+ return Promise.reject(new NarsilError(ErrorCodes.CONFIG_INVALID, "Coordinator has been shut down"));
417
+ }
263
418
  const modRevisionByKey = /* @__PURE__ */ new Map();
264
419
  let current = null;
265
420
  let stopped = false;
266
421
  let reopenTimer = null;
267
422
  let reopenDelayMs = RECONNECT_FIRST_DELAY_MS;
423
+ function inactive() {
424
+ return stopped || streams.isClosed();
425
+ }
268
426
  function recordPut(kv) {
269
427
  modRevisionByKey.set(kv.key.toString(), kv.mod_revision);
270
428
  handlers.put(kv);
@@ -273,6 +431,13 @@ async function watchPrefix(context, prefix, handlers) {
273
431
  modRevisionByKey.delete(fullKey);
274
432
  handlers.delete(fullKey);
275
433
  }
434
+ function reportingHandlerErrors(record) {
435
+ try {
436
+ record();
437
+ } catch (error) {
438
+ context.reportHandlerError(error);
439
+ }
440
+ }
276
441
  async function listMissedChanges(reportMissedChanges) {
277
442
  const listing = await context.client.getAll().prefix(prefix).exec();
278
443
  const listedKeys = /* @__PURE__ */ new Set();
@@ -282,51 +447,54 @@ async function watchPrefix(context, prefix, handlers) {
282
447
  if (!reportMissedChanges) {
283
448
  modRevisionByKey.set(fullKey, kv.mod_revision);
284
449
  } else if (modRevisionByKey.get(fullKey) !== kv.mod_revision) {
285
- recordPut(kv);
450
+ reportingHandlerErrors(() => recordPut(kv));
286
451
  }
287
452
  }
288
453
  if (reportMissedChanges) {
289
454
  for (const fullKey of [...modRevisionByKey.keys()]) {
290
- if (!listedKeys.has(fullKey)) recordDelete(fullKey);
455
+ if (!listedKeys.has(fullKey)) reportingHandlerErrors(() => recordDelete(fullKey));
291
456
  }
292
457
  }
293
458
  return String(BigInt(listing.header.revision) + 1n);
294
459
  }
295
- async function watchFrom(startRevision2) {
460
+ async function watchFrom(startRevision) {
296
461
  const client = context.watchClient.current();
297
- const watcher = client.watch().prefix(prefix).startRevision(startRevision2).watcher();
462
+ let opened = null;
463
+ let lostWhileOpening = false;
464
+ let watch;
298
465
  try {
299
- await connectedOrDropped(watcher);
300
- } catch (error) {
301
- watcher.on("error", () => {
302
- });
303
- watcher.cancel().catch(() => {
466
+ watch = await streams.open(client, prefix, startRevision, {
467
+ put: recordPut,
468
+ delete: (kv) => recordDelete(kv.key.toString()),
469
+ handlerFailed: context.reportHandlerError,
470
+ lost() {
471
+ if (opened === null) lostWhileOpening = true;
472
+ else reopenAfterFailure(opened);
473
+ }
304
474
  });
305
- context.watchClient.replace(client);
475
+ } catch (error) {
476
+ if (!streams.isClosed() && blamesTheConnection(error)) context.watchClient.replace(client);
306
477
  throw error;
307
478
  }
308
- if (stopped || context.isShutdown()) {
309
- watcher.cancel().catch(() => {
310
- });
479
+ if (inactive()) {
480
+ await watch.close();
311
481
  return;
312
482
  }
313
- watcher.on("put", recordPut);
314
- watcher.on("delete", (kv) => recordDelete(kv.key.toString()));
315
- watcher.on("error", () => reopenAfterFailure(watcher));
316
- watcher.on("disconnected", () => reopenAfterFailure(watcher));
317
- context.addWatcher(watcher);
318
- current = watcher;
483
+ opened = watch;
484
+ current = watch;
485
+ if (lostWhileOpening) reopenAfterFailure(watch);
319
486
  }
320
487
  async function listThenWatch(reportMissedChanges) {
321
488
  await watchFrom(await listMissedChanges(reportMissedChanges));
322
489
  }
323
490
  function scheduleReopen() {
324
- if (stopped || context.isShutdown()) return;
491
+ if (inactive()) return;
325
492
  const delayMs = reopenDelayMs;
326
493
  reopenDelayMs = Math.min(reopenDelayMs * 2, RECONNECT_LONGEST_DELAY_MS);
327
494
  reopenTimer = setTimeout(() => {
328
495
  reopenTimer = null;
329
- listThenWatch(true).then(
496
+ if (inactive()) return;
497
+ streams.track(listThenWatch(true)).then(
330
498
  () => {
331
499
  reopenDelayMs = RECONNECT_FIRST_DELAY_MS;
332
500
  },
@@ -338,26 +506,29 @@ async function watchPrefix(context, prefix, handlers) {
338
506
  function reopenAfterFailure(failed) {
339
507
  if (current !== failed) return;
340
508
  current = null;
341
- context.removeWatcher(failed);
509
+ void failed.close();
342
510
  scheduleReopen();
343
511
  }
344
- const startRevision = await listMissedChanges(false);
345
- try {
346
- await watchFrom(startRevision);
347
- } catch (_) {
348
- scheduleReopen();
349
- }
350
- return () => {
351
- stopped = true;
352
- if (reopenTimer !== null) {
353
- clearTimeout(reopenTimer);
354
- reopenTimer = null;
355
- }
356
- if (current !== null) {
357
- context.removeWatcher(current);
358
- current = null;
512
+ async function start() {
513
+ const startRevision = await listMissedChanges(false);
514
+ try {
515
+ await watchFrom(startRevision);
516
+ } catch (_) {
517
+ scheduleReopen();
359
518
  }
360
- };
519
+ return () => {
520
+ stopped = true;
521
+ if (reopenTimer !== null) {
522
+ clearTimeout(reopenTimer);
523
+ reopenTimer = null;
524
+ }
525
+ if (current !== null) {
526
+ void current.close();
527
+ current = null;
528
+ }
529
+ };
530
+ }
531
+ return streams.track(start());
361
532
  }
362
533
  function serializeAllocationTable(table) {
363
534
  const serializable = {
@@ -584,6 +755,17 @@ function createEtcdWriteGuard(etcd3, maxRequestBytes) {
584
755
  };
585
756
  }
586
757
 
758
+ // src/distribution/coordinator/etcd/require-leader.ts
759
+ var ETCD_WATCH_METHOD_PATH = "/etcdserverpb.Watch/Watch";
760
+ var ETCD_REQUIRE_LEADER_METADATA_KEY = "hasleader";
761
+ var ETCD_REQUIRE_LEADER_METADATA_VALUE = "true";
762
+ function requireLeaderOnWatchStreams(properties) {
763
+ if (properties.methodDefinition.path !== ETCD_WATCH_METHOD_PATH) return properties;
764
+ const metadata = properties.metadata.clone();
765
+ metadata.set(ETCD_REQUIRE_LEADER_METADATA_KEY, ETCD_REQUIRE_LEADER_METADATA_VALUE);
766
+ return { ...properties, metadata };
767
+ }
768
+
587
769
  // src/distribution/coordinator/etcd/security.ts
588
770
  var SECURE_SCHEME = "https://";
589
771
  var LOOPBACK_IPV4 = /^127\.\d{1,3}\.\d{1,3}\.\d{1,3}$/;
@@ -751,11 +933,8 @@ function storedValueMethods(context) {
751
933
  const prefix = keys.schemaPrefix();
752
934
  return watchPrefix2(prefix, {
753
935
  put(kv) {
754
- try {
755
- const schema = deserializeSchema(kv.value);
756
- handler({ type: "schema_created", indexName: extractSuffix(kv.key.toString(), prefix), schema });
757
- } catch (_) {
758
- }
936
+ const schema = deserializeSchema(kv.value);
937
+ handler({ type: "schema_created", indexName: extractSuffix(kv.key.toString(), prefix), schema });
759
938
  },
760
939
  delete(fullKey) {
761
940
  handler({ type: "schema_dropped", indexName: extractSuffix(fullKey, prefix), schema: null });
@@ -845,7 +1024,8 @@ async function createEtcdCoordinator(config) {
845
1024
  grpcOptions: {
846
1025
  "grpc.max_receive_message_length": ETCD_MAX_RESPONSE_BYTES,
847
1026
  "grpc.keepalive_time_ms": ETCD_KEEPALIVE_TIME_MS,
848
- "grpc.keepalive_timeout_ms": ETCD_KEEPALIVE_TIMEOUT_MS
1027
+ "grpc.keepalive_timeout_ms": ETCD_KEEPALIVE_TIMEOUT_MS,
1028
+ callInvocationTransformer: requireLeaderOnWatchStreams
849
1029
  },
850
1030
  defaultCallOptions: (context) => context.isStream ? {} : { deadline: Date.now() + ETCD_CALL_TIMEOUT_MS },
851
1031
  faultHandling: { host: (endpoint) => createEndpointBreaker(endpoint, etcd3Module.isRecoverableError) },
@@ -861,30 +1041,23 @@ async function createEtcdCoordinator(config) {
861
1041
  }
862
1042
  const guard = createEtcdWriteGuard(etcd3Module, resolvedConfig.maxRequestBytes);
863
1043
  const leaseManager = new LeaseManager();
864
- const watchers = /* @__PURE__ */ new Set();
865
1044
  let isShutdown = false;
866
1045
  function assertNotShutdown() {
867
1046
  if (isShutdown) {
868
1047
  throw new NarsilError(ErrorCodes.CONFIG_INVALID, "Coordinator has been shut down");
869
1048
  }
870
1049
  }
871
- function addWatcher(watcher) {
872
- if (watchers.size >= MAX_WATCHERS) {
873
- watcher.cancel().catch(() => {
874
- });
875
- throw new NarsilError(ErrorCodes.CONFIG_INVALID, `Maximum watcher limit (${MAX_WATCHERS}) reached`, {
876
- currentCount: watchers.size
877
- });
1050
+ const watchClient = createReplaceableWatchClient(openClient);
1051
+ const streams = createWatchStreams();
1052
+ const { onWatchError } = resolvedConfig;
1053
+ function reportHandlerError(error) {
1054
+ if (onWatchError === void 0) return;
1055
+ try {
1056
+ onWatchError(error instanceof Error ? error : new Error(String(error)));
1057
+ } catch (_) {
878
1058
  }
879
- watchers.add(watcher);
880
- }
881
- function removeWatcher(watcher) {
882
- watcher.cancel().catch(() => {
883
- });
884
- watchers.delete(watcher);
885
1059
  }
886
- const watchClient = createReplaceableWatchClient(openClient);
887
- const watchContext = { client, watchClient, addWatcher, removeWatcher, isShutdown: () => isShutdown };
1060
+ const watchContext = { client, watchClient, streams, reportHandlerError };
888
1061
  const coordinator = {
889
1062
  async registerNode(registration) {
890
1063
  assertNotShutdown();
@@ -947,11 +1120,8 @@ async function createEtcdCoordinator(config) {
947
1120
  const prefix = keys.nodePrefix();
948
1121
  return watchPrefix(watchContext, prefix, {
949
1122
  put(kv) {
950
- try {
951
- const registration = deserializeNodeRegistration(kv.value);
952
- handler({ type: "node_joined", nodeId: registration.nodeId, registration });
953
- } catch (_) {
954
- }
1123
+ const registration = deserializeNodeRegistration(kv.value);
1124
+ handler({ type: "node_joined", nodeId: registration.nodeId, registration });
955
1125
  },
956
1126
  delete(fullKey) {
957
1127
  handler({ type: "node_left", nodeId: extractSuffix(fullKey, prefix), registration: null });
@@ -1008,11 +1178,8 @@ async function createEtcdCoordinator(config) {
1008
1178
  assertNotShutdown();
1009
1179
  return watchPrefix(watchContext, keys.allocationPrefix(), {
1010
1180
  put(kv) {
1011
- try {
1012
- const table = deserializeAllocationTable(kv.value);
1013
- handler({ indexName: table.indexName, table });
1014
- } catch (_) {
1015
- }
1181
+ const table = deserializeAllocationTable(kv.value);
1182
+ handler({ indexName: table.indexName, table });
1016
1183
  },
1017
1184
  delete() {
1018
1185
  }
@@ -1100,13 +1267,7 @@ async function createEtcdCoordinator(config) {
1100
1267
  return;
1101
1268
  }
1102
1269
  isShutdown = true;
1103
- const cancelPromises = [];
1104
- for (const watcher of watchers) {
1105
- cancelPromises.push(watcher.cancel().catch(() => {
1106
- }));
1107
- }
1108
- await Promise.all(cancelPromises);
1109
- watchers.clear();
1270
+ await streams.closeAll();
1110
1271
  await leaseManager.revokeAll();
1111
1272
  watchClient.close();
1112
1273
  client.close();
@@ -1,5 +1,5 @@
1
- import { C as ClusterCoordinator } from '../../index-MsF7e5hL.js';
2
- import '../../schema-D33CyXCy.js';
1
+ import { C as ClusterCoordinator } from '../../index-nRqDM6uS.js';
2
+ import '../../schema-DDauvDOv.js';
3
3
  import '../../adapters-pljAqmrC.js';
4
4
  import '../../synonyms-CpOAHPa-.js';
5
5
 
@@ -1,8 +1,8 @@
1
- import { decodeTransportMessage, encodeTransportMessage } from '../../chunk-IJPK5PGM.mjs';
2
- import { timeoutsOf, replyDeadlineMs } from '../../chunk-POUYICOU.mjs';
1
+ import { decodeTransportMessage, encodeTransportMessage } from '../../chunk-YPUEV6ZC.mjs';
2
+ import { timeoutsOf, replyDeadlineMs } from '../../chunk-3OFU3NJT.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
- import { TransportError, TransportErrorCodes } from '../../chunk-5QMHMELB.mjs';
5
- import { NarsilError, ErrorCodes } from '../../chunk-MDF6PDIA.mjs';
4
+ import { TransportError, TransportErrorCodes } from '../../chunk-IQ4R2I6N.mjs';
5
+ import { NarsilError, ErrorCodes } from '../../chunk-KUZKUONM.mjs';
6
6
 
7
7
  // src/distribution/transport/grpc/codec.ts
8
8
  var FIELD_ONE_LENGTH_DELIMITED_KEY = 10;
@@ -1,6 +1,6 @@
1
- import { timeoutsOf, replyDeadlineMs } from '../../chunk-POUYICOU.mjs';
1
+ import { timeoutsOf, replyDeadlineMs } from '../../chunk-3OFU3NJT.mjs';
2
2
  import { MAX_MESSAGE_SIZE_BYTES } from '../../chunk-UNEEFTEU.mjs';
3
- import { DEFAULT_TRANSPORT_CONFIG, TransportError, TransportErrorCodes } from '../../chunk-5QMHMELB.mjs';
3
+ import { DEFAULT_TRANSPORT_CONFIG, TransportError, TransportErrorCodes } from '../../chunk-IQ4R2I6N.mjs';
4
4
 
5
5
  // src/distribution/transport/in-memory.ts
6
6
  function createInMemoryNetwork() {
@@ -1,7 +1,7 @@
1
- import { DEFAULT_TCP_CONFIG, encodeTransportMessage, encodeFrame, FRAME_TYPE_REQUEST, FrameParser, FRAME_TYPE_RESPONSE, decodeTransportMessage, FRAME_TYPE_STREAM_CHUNK, FRAME_TYPE_STREAM_END } from '../../chunk-IJPK5PGM.mjs';
2
- import { timeoutsOf, replyDeadlineMs } from '../../chunk-POUYICOU.mjs';
1
+ import { DEFAULT_TCP_CONFIG, encodeTransportMessage, encodeFrame, FRAME_TYPE_REQUEST, FrameParser, FRAME_TYPE_RESPONSE, decodeTransportMessage, FRAME_TYPE_STREAM_CHUNK, FRAME_TYPE_STREAM_END } from '../../chunk-YPUEV6ZC.mjs';
2
+ import { timeoutsOf, replyDeadlineMs } from '../../chunk-3OFU3NJT.mjs';
3
3
  import { MAX_MESSAGE_SIZE_BYTES } from '../../chunk-UNEEFTEU.mjs';
4
- import { TransportError, TransportErrorCodes } from '../../chunk-5QMHMELB.mjs';
4
+ import { TransportError, TransportErrorCodes } from '../../chunk-IQ4R2I6N.mjs';
5
5
  import { connect as connect$1, createServer as createServer$1 } from 'net';
6
6
  import { connect, createServer } from 'tls';
7
7
 
@@ -1,13 +1,14 @@
1
- import { c as CreateIndexOptions, C as ClusterNamespace, d as ClusterNodeConfig } from './config-CfhH1IWQ.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, D as DamagedBackup, I as IndexHealth, N as NodeReadiness, P as PartitionReplicationFigure, R as ReplicaLagFigure, p as ReplicationConfig, q as RestoreBackupOptions, V as VectorRebuildWaitFigure } from './config-CfhH1IWQ.js';
1
+ import { d as CreateIndexOptions, C as ClusterNamespace, e as ClusterNodeConfig } from './config-05G_hy-1.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, D as DamagedBackup, I as IndexHealth, N as NodeReadiness, P as PartitionReplicationFigure, R as ReplicaLagFigure, p as ReplicationConfig, q as RestoreBackupOptions, V as VectorRebuildWaitFigure } from './config-05G_hy-1.js';
3
3
  import { R as RerankAdapter } from './adapters-pljAqmrC.js';
4
- import { A as AnalysisChange, N as Narsil } from './engine-CJRUHXgf.js';
5
- import { B as BatchResult, L as ListParams, f as ListResult, g as SuggestParams, h as SuggestResult, Q as QueryParams, j as PreflightResult, I as IndexInfo, k as IndexStats, P as PartitionStatsResult, M as MemoryStats, l as NarsilEventMap, m as QueryResult } from './config-aIsy7mcL.js';
6
- import { B as BM25Params, a as IndexConfig, A as AnyDocument, I as InsertOptions } from './schema-D33CyXCy.js';
7
- import { c as NodeCapacity, N as NodeRole } from './index-MsF7e5hL.js';
8
- 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-MsF7e5hL.js';
4
+ import { A as AnalysisChange, N as Narsil } from './engine-DYu-e0oR.js';
5
+ import { e as SyncSetting, o as SyncStatus, B as BatchResult, L as ListParams, l as ListResult, j as SuggestParams, n as SuggestResult, Q as QueryParams, m as PreflightResult, I as IndexInfo, k as IndexStats, P as PartitionStatsResult, M as MemoryStats, p as NarsilEventMap, f as QueryResult } from './sync-uXR7MmM7.js';
6
+ import { B as BM25Params, I as IndexConfig, A as AnyDocument, a as InsertOptions } from './schema-DDauvDOv.js';
7
+ import { c as NodeCapacity, N as NodeRole } from './index-nRqDM6uS.js';
8
+ 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-nRqDM6uS.js';
9
9
  import { a as SynonymRule } from './synonyms-CpOAHPa-.js';
10
10
  export { L as ListenHandler, N as NodeTransport, R as RespondFn, T as TransportConfig, a as TransportMessage } from './types-DvncmvuQ.js';
11
+ import './config-B8DP2VwR.js';
11
12
 
12
13
  /**
13
14
  * The cluster splits an index into this many partitions when
@@ -96,6 +97,37 @@ interface ClusterNodeSearchSettings {
96
97
  updateBM25(indexName: string, bm25: BM25Params): Promise<void>;
97
98
  }
98
99
 
100
+ /**
101
+ * Turns device sync on and off for an index across a cluster.
102
+ *
103
+ * @public
104
+ */
105
+ interface ClusterNodeSyncSettings {
106
+ /**
107
+ * Replaces the device sync setting of an index across the cluster.
108
+ *
109
+ * Turning sync on gives the index a new epoch. Changing a history limit while sync is on keeps the epoch. Turning
110
+ * sync off makes every node delete the history of its copies and close every feed of the index with close code
111
+ * 4410. The node stores the setting in the index metadata, so every node applies it through its metadata watch.
112
+ *
113
+ * @param indexName - The index whose setting the cluster replaces.
114
+ * @param setting - The new setting.
115
+ * @throws A `NarsilError` with `SYNC_BACKUP_STORE_REQUIRED` when the cluster has no backup store, with
116
+ * `SYNC_DURABILITY_REQUIRED` when this node has no write-ahead log durability, with `SYNC_NOT_READY` while a
117
+ * registered node has a specification version below 1.3, with `CONFIG_INVALID` when a history limit is not a
118
+ * positive whole number, and with `INDEX_NOT_FOUND` when no index has that name.
119
+ */
120
+ updateSync(indexName: string, setting: SyncSetting): Promise<void>;
121
+ /**
122
+ * Returns the device sync state of an index, as the index metadata holds it.
123
+ *
124
+ * @param indexName - The index whose state the cluster returns.
125
+ * @returns The setting, whether a device has asked for the snapshot, and the epoch.
126
+ * @throws A `NarsilError` with `INDEX_NOT_FOUND` when no index has that name.
127
+ */
128
+ getSync(indexName: string): Promise<SyncStatus>;
129
+ }
130
+
99
131
  /**
100
132
  * One node of a cluster, which routes each write to the partition's primary
101
133
  * and gathers each search from every partition.
@@ -106,7 +138,7 @@ interface ClusterNodeSearchSettings {
106
138
  *
107
139
  * @public
108
140
  */
109
- interface ClusterNode extends ClusterNodeSearchSettings {
141
+ interface ClusterNode extends ClusterNodeSearchSettings, ClusterNodeSyncSettings {
110
142
  /** This identifies the node across the cluster. */
111
143
  readonly nodeId: string;
112
144
  /** The node holds these roles in the cluster. */
@@ -521,4 +553,4 @@ interface ClusterEngineOptions {
521
553
  */
522
554
  declare function clusterNodeEngine(node: ClusterNode, options?: ClusterEngineOptions): Narsil;
523
555
 
524
- export { type ClusterEngineOptions, ClusterNamespace, type ClusterNode, ClusterNodeConfig, type ClusterNodeSearchSettings, CreateIndexOptions, DEFAULT_CAPACITY, DEFAULT_PARTITION_COUNT, DEFAULT_REPLICATION_FACTOR, NodeCapacity, NodeRole, clusterNodeEngine, createClusterNode };
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 };