@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
@@ -0,0 +1,196 @@
1
+ import { isWordIndexedBase, parseFieldType } from './chunk-3A5KI24C.mjs';
2
+ import { isPlainObject, MAX_TEXT_FIELDS, MAX_VECTOR_DIMENSION, MAX_NESTING_DEPTH, PROTOTYPE_POLLUTION_KEYS, FIELD_NAME_PATTERN, RESERVED_ROOT_FIELDS } from './chunk-L5ORED7V.mjs';
3
+ import { MAX_DOCUMENT_ENCODING_DEPTH, DOCUMENT_ENCODER_RETAINED_BUFFER_BYTES, DOCUMENT_REPLY_ENVELOPE_DEPTH } from './chunk-U476IXKQ.mjs';
4
+ import { NarsilError, ErrorCodes } from './chunk-KUZKUONM.mjs';
5
+ import { compareCodePoints } from './chunk-YTJCGKM4.mjs';
6
+ import { Encoder, encode } from '@msgpack/msgpack';
7
+
8
+ var INTEGER_ENCODING = { maxDepth: MAX_DOCUMENT_ENCODING_DEPTH };
9
+ var FLOAT_ENCODING = { maxDepth: MAX_DOCUMENT_ENCODING_DEPTH, forceIntegerToFloat: true };
10
+ var integerEncoder = new Encoder(INTEGER_ENCODING);
11
+ var floatEncoder = new Encoder(FLOAT_ENCODING);
12
+ function encodeExactly(document, forceIntegerToFloat) {
13
+ const bytes = (forceIntegerToFloat ? floatEncoder : integerEncoder).encode(document);
14
+ if (bytes.byteLength > DOCUMENT_ENCODER_RETAINED_BUFFER_BYTES) {
15
+ if (forceIntegerToFloat) floatEncoder = new Encoder(FLOAT_ENCODING);
16
+ else integerEncoder = new Encoder(INTEGER_ENCODING);
17
+ }
18
+ return bytes;
19
+ }
20
+ function holdsNegativeZero(value, depth) {
21
+ if (typeof value === "number") return Object.is(value, -0);
22
+ if (value === null || typeof value !== "object" || ArrayBuffer.isView(value) || depth > MAX_DOCUMENT_ENCODING_DEPTH) {
23
+ return false;
24
+ }
25
+ for (const child of Array.isArray(value) ? value : Object.values(value)) {
26
+ if (holdsNegativeZero(child, depth + 1)) return true;
27
+ }
28
+ return false;
29
+ }
30
+ function encodeDocumentReply(payload) {
31
+ return encode(payload, { forceIntegerToFloat: holdsNegativeZero(payload, 1 - DOCUMENT_REPLY_ENVELOPE_DEPTH) });
32
+ }
33
+ function encodeDocument(document) {
34
+ try {
35
+ return encodeExactly(document, holdsNegativeZero(document, 1));
36
+ } catch (error) {
37
+ throw new NarsilError(
38
+ ErrorCodes.DOC_VALIDATION_FAILED,
39
+ `The document cannot be encoded as MessagePack: ${error instanceof Error ? error.message : String(error)}`
40
+ );
41
+ }
42
+ }
43
+
44
+ // src/schema/validator/schema.ts
45
+ function validateSchemaFields(schema, depth, prefix) {
46
+ if (depth > MAX_NESTING_DEPTH) {
47
+ throw new NarsilError(
48
+ ErrorCodes.SCHEMA_DEPTH_EXCEEDED,
49
+ `Schema nesting exceeds the maximum depth of ${MAX_NESTING_DEPTH} at "${prefix}"`,
50
+ { path: prefix, maxDepth: MAX_NESTING_DEPTH }
51
+ );
52
+ }
53
+ let canonical = null;
54
+ const replace = (field, value) => {
55
+ if (canonical === null) canonical = { ...schema };
56
+ canonical[field] = value;
57
+ };
58
+ for (const [field, type] of Object.entries(schema)) {
59
+ const path = prefix ? `${prefix}.${field}` : field;
60
+ if (PROTOTYPE_POLLUTION_KEYS.has(field)) {
61
+ throw new NarsilError(ErrorCodes.SCHEMA_INVALID_TYPE, `Field name "${field}" is not allowed in a schema`, {
62
+ field,
63
+ path
64
+ });
65
+ }
66
+ if (!FIELD_NAME_PATTERN.test(field)) {
67
+ throw new NarsilError(
68
+ ErrorCodes.SCHEMA_INVALID_TYPE,
69
+ `Field name "${field}" contains characters that are not allowed; use letters, digits, and underscores only`,
70
+ { field, path }
71
+ );
72
+ }
73
+ if (depth === 1 && RESERVED_ROOT_FIELDS.has(field)) {
74
+ throw new NarsilError(
75
+ ErrorCodes.SCHEMA_INVALID_TYPE,
76
+ `Field "${field}" is reserved and cannot be defined in a schema`,
77
+ { field, path }
78
+ );
79
+ }
80
+ if (isPlainObject(type)) {
81
+ const nested = validateSchemaFields(type, depth + 1, path);
82
+ if (nested !== type) replace(field, nested);
83
+ continue;
84
+ }
85
+ if (typeof type !== "string") {
86
+ throw new NarsilError(
87
+ ErrorCodes.SCHEMA_INVALID_TYPE,
88
+ `Field "${path}" has an invalid type definition: ${String(type)}`,
89
+ {
90
+ field: path,
91
+ type: String(type)
92
+ }
93
+ );
94
+ }
95
+ const parsed = parseFieldType(type, path);
96
+ if (parsed.type !== type) replace(field, parsed.type);
97
+ }
98
+ return canonical ?? schema;
99
+ }
100
+ function validateSchema(schema) {
101
+ if (!isPlainObject(schema)) {
102
+ throw new NarsilError(ErrorCodes.SCHEMA_INVALID_TYPE, "Schema must be a plain object", {
103
+ received: typeof schema
104
+ });
105
+ }
106
+ if (Object.keys(schema).length === 0) {
107
+ throw new NarsilError(ErrorCodes.SCHEMA_INVALID_TYPE, "Schema must define at least one field");
108
+ }
109
+ const validated = validateSchemaFields(schema, 1, "");
110
+ requireTextFieldCount(schemaFieldsOf(validated).filter((field) => isWordIndexedBase(field.base)).length);
111
+ return validated;
112
+ }
113
+ function requireTextFieldCount(count) {
114
+ if (count <= MAX_TEXT_FIELDS) return;
115
+ throw new NarsilError(
116
+ ErrorCodes.SCHEMA_INVALID_TYPE,
117
+ `The schema declares ${count} string and string[] fields, but a schema holds at most ${MAX_TEXT_FIELDS}`,
118
+ { textFields: count, maximum: MAX_TEXT_FIELDS }
119
+ );
120
+ }
121
+ function requireCreatableSchema(schema) {
122
+ for (const field of schemaFieldsOf(schema)) {
123
+ if (field.base !== "vector" || field.dimension <= MAX_VECTOR_DIMENSION) continue;
124
+ throw new NarsilError(
125
+ ErrorCodes.SCHEMA_INVALID_VECTOR_DIMENSION,
126
+ `Vector field "${field.path}" has ${field.dimension} dimensions, but a new index takes at most ${MAX_VECTOR_DIMENSION}`,
127
+ { field: field.path, dimension: field.dimension, maximum: MAX_VECTOR_DIMENSION }
128
+ );
129
+ }
130
+ }
131
+ function requireValidFieldTypes(flatSchema) {
132
+ let textFields = 0;
133
+ for (const [path, type] of Object.entries(flatSchema)) {
134
+ if (typeof type !== "string") {
135
+ throw new NarsilError(
136
+ ErrorCodes.SCHEMA_INVALID_TYPE,
137
+ `Field "${path}" has an invalid type definition: ${String(type)}`,
138
+ { field: path, type: String(type) }
139
+ );
140
+ }
141
+ if (isWordIndexedBase(parseFieldType(type, path).base)) textFields += 1;
142
+ }
143
+ requireTextFieldCount(textFields);
144
+ }
145
+ function flattenRecursive(schema, prefix, result) {
146
+ for (const [field, type] of Object.entries(schema)) {
147
+ const path = prefix ? `${prefix}.${field}` : field;
148
+ if (isPlainObject(type)) {
149
+ flattenRecursive(type, path, result);
150
+ } else {
151
+ result[path] = type;
152
+ }
153
+ }
154
+ }
155
+ var flattenedSchemas = /* @__PURE__ */ new WeakMap();
156
+ function flattenSchema(schema) {
157
+ const cached = flattenedSchemas.get(schema);
158
+ if (cached !== void 0) return cached;
159
+ const result = /* @__PURE__ */ Object.create(null);
160
+ flattenRecursive(schema, "", result);
161
+ flattenedSchemas.set(schema, Object.freeze(result));
162
+ return result;
163
+ }
164
+ var parsedSchemas = /* @__PURE__ */ new WeakMap();
165
+ function schemaFieldsOf(schema) {
166
+ const cached = parsedSchemas.get(schema);
167
+ if (cached !== void 0) return cached;
168
+ const fields = [];
169
+ for (const [path, type] of Object.entries(flattenSchema(schema))) {
170
+ fields.push({ ...parseFieldType(type, path), path });
171
+ }
172
+ const frozen = Object.freeze(fields);
173
+ parsedSchemas.set(schema, frozen);
174
+ return frozen;
175
+ }
176
+ var partialFieldsBySchema = /* @__PURE__ */ new WeakMap();
177
+ function partialFieldsOf(schema) {
178
+ const cached = partialFieldsBySchema.get(schema);
179
+ if (cached !== void 0) return cached;
180
+ const paths = [];
181
+ for (const field of schemaFieldsOf(schema)) {
182
+ if (field.partial) paths.push(field.path);
183
+ }
184
+ const frozen = Object.freeze(paths.sort(compareCodePoints));
185
+ partialFieldsBySchema.set(schema, frozen);
186
+ return frozen;
187
+ }
188
+ function extractVectorFieldsFromSchema(schema) {
189
+ const result = /* @__PURE__ */ new Map();
190
+ for (const field of schemaFieldsOf(schema)) {
191
+ if (field.base === "vector") result.set(field.path, field.dimension);
192
+ }
193
+ return result;
194
+ }
195
+
196
+ export { encodeDocument, encodeDocumentReply, extractVectorFieldsFromSchema, flattenSchema, partialFieldsOf, requireCreatableSchema, requireValidFieldTypes, schemaFieldsOf, validateSchema };
@@ -1,5 +1,5 @@
1
1
  import { LOOKUP_KEY_SCRATCH_BYTES } from './chunk-4UMZ7KQL.mjs';
2
- import { createNarsilError, ErrorCodes } from './chunk-MDF6PDIA.mjs';
2
+ import { createNarsilError, ErrorCodes } from './chunk-KUZKUONM.mjs';
3
3
  import { compareCodePoints } from './chunk-YTJCGKM4.mjs';
4
4
 
5
5
  // src/core/tokenizer/constants.ts
@@ -0,0 +1,29 @@
1
+ // src/engine/snapshot/constants.ts
2
+ var RESTORE_WORST_HEAP_BYTES_PER_STORED_BYTE = 0.2;
3
+ var RESTORE_WORST_HEAP_BYTES_PER_EARLIER_SNAPSHOT_BYTE = 7.86;
4
+ var RESTORE_WORST_HEAP_BYTES_PER_VECTOR = 264;
5
+ var RESTORE_WORST_HEAP_BYTES_PER_VECTOR_DIMENSION = 0.24;
6
+ var RESTORE_WORST_HEAP_BYTES_PER_EARLIER_SNAPSHOT_VECTOR = 738;
7
+ var RESTORE_WORST_HEAP_BYTES_PER_EARLIER_SNAPSHOT_VECTOR_DIMENSION = 0.2;
8
+ var RESTORE_WORST_EXTERNAL_BYTES_PER_STORED_BYTE = 4.06;
9
+ var RESTORE_WORST_EXTERNAL_BYTES_PER_EARLIER_SNAPSHOT_BYTE = 14.5;
10
+ var RESTORE_WORST_EXTERNAL_BYTES_PER_VECTOR = 1482;
11
+ var RESTORE_WORST_EXTERNAL_BYTES_PER_VECTOR_DIMENSION = 9.29;
12
+ var RESTORE_WORST_EXTERNAL_BYTES_PER_EARLIER_SNAPSHOT_VECTOR = 2141;
13
+ var RESTORE_WORST_EXTERNAL_BYTES_PER_EARLIER_SNAPSHOT_VECTOR_DIMENSION = 24.15;
14
+ var RESTORE_FLOOR_HEAP_BYTES_PER_STORED_BYTE = 0.16;
15
+ var RESTORE_FLOOR_HEAP_BYTES_PER_EARLIER_SNAPSHOT_BYTE = 6.16;
16
+ var RESTORE_FLOOR_HEAP_BYTES_PER_VECTOR = 204;
17
+ var RESTORE_FLOOR_HEAP_BYTES_PER_VECTOR_DIMENSION = 0.17;
18
+ var RESTORE_FLOOR_HEAP_BYTES_PER_EARLIER_SNAPSHOT_VECTOR = 695;
19
+ var RESTORE_FLOOR_HEAP_BYTES_PER_EARLIER_SNAPSHOT_VECTOR_DIMENSION = 0.04;
20
+ var RESTORE_FLOOR_EXTERNAL_BYTES_PER_STORED_BYTE = 2.14;
21
+ var RESTORE_FLOOR_EXTERNAL_BYTES_PER_EARLIER_SNAPSHOT_BYTE = 5.05;
22
+ var RESTORE_FLOOR_EXTERNAL_BYTES_PER_VECTOR = 1080;
23
+ var RESTORE_FLOOR_EXTERNAL_BYTES_PER_VECTOR_DIMENSION = 0.72;
24
+ var RESTORE_FLOOR_EXTERNAL_BYTES_PER_EARLIER_SNAPSHOT_VECTOR = 1744;
25
+ var RESTORE_FLOOR_EXTERNAL_BYTES_PER_EARLIER_SNAPSHOT_VECTOR_DIMENSION = 20.05;
26
+ var RESTORE_ESTIMATE_MARGIN = 1.25;
27
+ var MAX_SNAPSHOT_ANALYSIS_ATTEMPTS = 3;
28
+
29
+ export { MAX_SNAPSHOT_ANALYSIS_ATTEMPTS, RESTORE_ESTIMATE_MARGIN, RESTORE_FLOOR_EXTERNAL_BYTES_PER_EARLIER_SNAPSHOT_BYTE, RESTORE_FLOOR_EXTERNAL_BYTES_PER_EARLIER_SNAPSHOT_VECTOR, RESTORE_FLOOR_EXTERNAL_BYTES_PER_EARLIER_SNAPSHOT_VECTOR_DIMENSION, RESTORE_FLOOR_EXTERNAL_BYTES_PER_STORED_BYTE, RESTORE_FLOOR_EXTERNAL_BYTES_PER_VECTOR, RESTORE_FLOOR_EXTERNAL_BYTES_PER_VECTOR_DIMENSION, RESTORE_FLOOR_HEAP_BYTES_PER_EARLIER_SNAPSHOT_BYTE, RESTORE_FLOOR_HEAP_BYTES_PER_EARLIER_SNAPSHOT_VECTOR, RESTORE_FLOOR_HEAP_BYTES_PER_EARLIER_SNAPSHOT_VECTOR_DIMENSION, RESTORE_FLOOR_HEAP_BYTES_PER_STORED_BYTE, RESTORE_FLOOR_HEAP_BYTES_PER_VECTOR, RESTORE_FLOOR_HEAP_BYTES_PER_VECTOR_DIMENSION, RESTORE_WORST_EXTERNAL_BYTES_PER_EARLIER_SNAPSHOT_BYTE, RESTORE_WORST_EXTERNAL_BYTES_PER_EARLIER_SNAPSHOT_VECTOR, RESTORE_WORST_EXTERNAL_BYTES_PER_EARLIER_SNAPSHOT_VECTOR_DIMENSION, RESTORE_WORST_EXTERNAL_BYTES_PER_STORED_BYTE, RESTORE_WORST_EXTERNAL_BYTES_PER_VECTOR, RESTORE_WORST_EXTERNAL_BYTES_PER_VECTOR_DIMENSION, RESTORE_WORST_HEAP_BYTES_PER_EARLIER_SNAPSHOT_BYTE, RESTORE_WORST_HEAP_BYTES_PER_EARLIER_SNAPSHOT_VECTOR, RESTORE_WORST_HEAP_BYTES_PER_EARLIER_SNAPSHOT_VECTOR_DIMENSION, RESTORE_WORST_HEAP_BYTES_PER_STORED_BYTE, RESTORE_WORST_HEAP_BYTES_PER_VECTOR, RESTORE_WORST_HEAP_BYTES_PER_VECTOR_DIMENSION };
@@ -1,8 +1,8 @@
1
- import { P as PartitionConfig, B as BM25Params, A as AnyDocument, I as InsertOptions, W as WriteOptions } from './schema-D33CyXCy.js';
2
- import { V as VectorMaintenanceResult, B as BatchResult, L as ListParams, f as ListResult, I as IndexInfo, k as IndexStats, P as PartitionStatsResult, Q as QueryParams, m as QueryResult, j as PreflightResult, g as SuggestParams, h as SuggestResult } from './config-aIsy7mcL.js';
1
+ import { P as PartitionConfig, B as BM25Params, A as AnyDocument, a as InsertOptions, W as WriteOptions } from './schema-DDauvDOv.js';
2
+ import { V as VectorMaintenanceResult, B as BatchResult, L as ListParams, l as ListResult, I as IndexInfo, k as IndexStats, P as PartitionStatsResult, Q as QueryParams, f as QueryResult, m as PreflightResult, j as SuggestParams, n as SuggestResult, e as SyncSetting } from './sync-uXR7MmM7.js';
3
3
  import { a as SynonymRule } from './synonyms-CpOAHPa-.js';
4
- import { f as TaskRecord, a as ChangeAnalysisBody, M as MemoryStatsResponse, R as RestoreBackupBody, c as ImportResult, H as HttpIndexConfig, d as TaskListQuery, T as TaskListPage } from './tasks-C4ElXr4P.js';
5
- import { B as BackupListing } from './config-CfhH1IWQ.js';
4
+ import { f as TaskRecord, a as ChangeAnalysisBody, M as MemoryStatsResponse, R as RestoreBackupBody, c as ImportResult, H as HttpIndexConfig, d as TaskListQuery, T as TaskListPage } from './tasks-BShx8pdK.js';
5
+ import { B as BackupListing } from './config-05G_hy-1.js';
6
6
 
7
7
  /**
8
8
  * This is the `fetch` implementation the client sends every request through.
@@ -937,6 +937,76 @@ interface ServerOperations {
937
937
  isReady(options?: RequestOptions): Promise<boolean>;
938
938
  }
939
939
 
940
+ /**
941
+ * Where a download of the published snapshot carries on from, which
942
+ * {@link SyncSettingOperations.syncSnapshot} takes.
943
+ *
944
+ * @public
945
+ */
946
+ interface SyncSnapshotResume {
947
+ /** The download carries on from this byte of the archive. */
948
+ offset: number;
949
+ /** The earlier part of the download carried this entity tag, which the server compares with the current one. */
950
+ entityTag: string;
951
+ }
952
+ /**
953
+ * One download of the published snapshot of an index.
954
+ *
955
+ * @public
956
+ */
957
+ interface SyncSnapshotDownload {
958
+ /** The archive carries this entity tag, 64 lowercase hexadecimal digits, which changes with each new snapshot. */
959
+ entityTag: string;
960
+ /**
961
+ * The stream starts at this byte of the archive. It is 0 where the server
962
+ * published a new snapshot after the earlier part, so the caller starts
963
+ * again from the first byte.
964
+ */
965
+ offset: number;
966
+ /** The whole archive holds this many bytes. */
967
+ totalBytes: number;
968
+ /** The bytes of the archive from `offset` to its end. */
969
+ stream: ReadableStream<Uint8Array>;
970
+ }
971
+ /**
972
+ * These methods read and replace the device sync setting of an index, as
973
+ * {@link SyncOperations} does on the engine.
974
+ *
975
+ * @public
976
+ */
977
+ interface SyncSettingOperations {
978
+ /**
979
+ * Replaces the device sync setting of an index. Turning sync on gives the
980
+ * index a new epoch, and turning it off deletes the published snapshot and
981
+ * the history and closes every feed of the index.
982
+ *
983
+ * @param indexName - The server replaces the setting of this index.
984
+ * @param setting - This is the new setting.
985
+ * @param options - This sets the signal, the deadline, and the headers for
986
+ * this request.
987
+ * @throws A `NarsilError` with `SYNC_DURABILITY_REQUIRED` when the server's
988
+ * engine has no write-ahead log durability, and with `CONFIG_INVALID` when a
989
+ * history limit is not a positive whole number.
990
+ */
991
+ updateSync(indexName: string, setting: SyncSetting, options?: RequestOptions): Promise<void>;
992
+ /**
993
+ * Downloads the published snapshot of an index with device sync on, or the
994
+ * rest of it from where an earlier download stopped. The archive restores
995
+ * through {@link Narsil.restore} like any other snapshot archive.
996
+ *
997
+ * @param indexName - The server sends the snapshot of this index.
998
+ * @param resume - Where an earlier download of the same snapshot stopped.
999
+ * @param options - This sets the signal, the deadline, and the headers for
1000
+ * this request.
1001
+ * @returns The stream, the byte it starts from, the archive's length, and
1002
+ * its entity tag.
1003
+ * @throws A `NarsilError` with `SYNC_NOT_ENABLED` when the index has sync
1004
+ * off, and with `SYNC_SNAPSHOT_PREPARING` while a cluster node takes the
1005
+ * backup that the snapshot needs.
1006
+ */
1007
+ syncSnapshot(indexName: string, resume?: SyncSnapshotResume, options?: RequestOptions): Promise<SyncSnapshotDownload>;
1008
+ }
1009
+
940
1010
  /**
941
1011
  * These settings say how {@link TaskOperations.waitForTask} follows a task.
942
1012
  *
@@ -1043,7 +1113,7 @@ interface TaskOperations {
1043
1113
  *
1044
1114
  * @public
1045
1115
  */
1046
- interface NarsilClient extends IndexOperations, DocumentOperations, BulkOperations, SearchOperations, TaskOperations, AdminOperations, BackupOperations, ServerOperations {
1116
+ interface NarsilClient extends IndexOperations, DocumentOperations, BulkOperations, SearchOperations, TaskOperations, AdminOperations, BackupOperations, ServerOperations, SyncSettingOperations {
1047
1117
  }
1048
1118
  /**
1049
1119
  * Builds a client for one Narsil server, or for a list of them that it moves
@@ -1064,4 +1134,4 @@ interface NarsilClient extends IndexOperations, DocumentOperations, BulkOperatio
1064
1134
  */
1065
1135
  declare function createNarsilClient(options: NarsilClientOptions): NarsilClient;
1066
1136
 
1067
- export { type AdminOperations as A, type BackupOperations as B, type DocumentOperations as D, type FetchFunction as F, type ImportSource as I, type NarsilClient as N, type PutResult as P, type RequestOptions as R, type SearchOperations as S, type TaskOperations as T, type WaitForTaskOptions as W, type BulkOperations as a, type IndexOperations as b, type NarsilClientOptions as c, type ServerOperations as d, type ServerVersion as e, createNarsilClient as f };
1137
+ export { type AdminOperations as A, type BackupOperations as B, type DocumentOperations as D, type FetchFunction as F, type ImportSource as I, type NarsilClient as N, type PutResult as P, type RequestOptions as R, type SearchOperations as S, type TaskOperations as T, type WaitForTaskOptions as W, type BulkOperations as a, type IndexOperations as b, type NarsilClientOptions as c, type ServerOperations as d, type ServerVersion as e, type SyncSettingOperations as f, type SyncSnapshotDownload as g, type SyncSnapshotResume as h, createNarsilClient as i };
package/dist/client.d.ts CHANGED
@@ -1,10 +1,11 @@
1
- export { B as BackupListing, a as BackupSummary, D as DamagedBackup } from './config-CfhH1IWQ.js';
2
- export { C as ClientErrorCode, a as ClientErrorCodes, E as ErrorCode, b as ErrorCodes, N as NarsilError, c as NarsilErrorCode, S as ServerErrorCode, d as ServerErrorCodes, i as isNarsilError } from './config-aIsy7mcL.js';
3
- export { A as ASYNC_IMPORT_CAPABILITY, B as BM25_TUNING_CAPABILITY, C as CHANGE_ANALYSIS_CAPABILITY, D as DOCUMENT_EXPORT_CAPABILITY, E as ErrorEnvelope, I as INDEX_LIFECYCLE_CAPABILITY, R as REBUILD_ANALYSIS_CAPABILITY, S as SERVER_CAPABILITIES, a as SYNONYMS_CAPABILITY, T as TASK_CANCEL_CAPABILITY, b as TASK_FILTER_CAPABILITY } from './capabilities-BT-HLDC8.js';
4
- export { B as BackupListResponse, C as CapabilitiesResponse, a as ChangeAnalysisBody, b as CreateIndexEmbedding, E as ErrorDetail, H as HttpIndexConfig, I as ImportError, c as ImportResult, M as MemoryStatsResponse, R as RestoreBackupBody, T as TaskListPage, d as TaskListQuery, e as TaskProgress, f as TaskRecord, g as TaskStatus, h as TaskStepProgress, i as TaskType } from './tasks-C4ElXr4P.js';
5
- export { A as AdminOperations, B as BackupOperations, a as BulkOperations, D as DocumentOperations, F as FetchFunction, I as ImportSource, b as IndexOperations, N as NarsilClient, c as NarsilClientOptions, P as PutResult, R as RequestOptions, S as SearchOperations, d as ServerOperations, e as ServerVersion, T as TaskOperations, W as WaitForTaskOptions, f as createNarsilClient } from './client-Cn3gNxUU.js';
1
+ export { B as BackupListing, a as BackupSummary, D as DamagedBackup } from './config-05G_hy-1.js';
2
+ export { C as ClientErrorCode, a as ClientErrorCodes, E as ErrorCode, b as ErrorCodes, N as NarsilError, c as NarsilErrorCode, S as ServerErrorCode, d as ServerErrorCodes, e as SyncSetting, i as isNarsilError } from './sync-uXR7MmM7.js';
3
+ export { A as ASYNC_IMPORT_CAPABILITY, B as BM25_TUNING_CAPABILITY, C as CHANGE_ANALYSIS_CAPABILITY, D as DOCUMENT_EXPORT_CAPABILITY, E as ErrorEnvelope, I as INDEX_LIFECYCLE_CAPABILITY, R as REBUILD_ANALYSIS_CAPABILITY, S as SERVER_CAPABILITIES, a as SYNONYMS_CAPABILITY, T as TASK_CANCEL_CAPABILITY, b as TASK_FILTER_CAPABILITY } from './capabilities-B3Brs1Rc.js';
4
+ export { B as BackupListResponse, C as CapabilitiesResponse, a as ChangeAnalysisBody, b as CreateIndexEmbedding, E as ErrorDetail, H as HttpIndexConfig, I as ImportError, c as ImportResult, M as MemoryStatsResponse, R as RestoreBackupBody, T as TaskListPage, d as TaskListQuery, e as TaskProgress, f as TaskRecord, g as TaskStatus, h as TaskStepProgress, i as TaskType } from './tasks-BShx8pdK.js';
5
+ export { A as AdminOperations, B as BackupOperations, a as BulkOperations, D as DocumentOperations, F as FetchFunction, I as ImportSource, b as IndexOperations, N as NarsilClient, c as NarsilClientOptions, P as PutResult, R as RequestOptions, S as SearchOperations, d as ServerOperations, e as ServerVersion, f as SyncSettingOperations, g as SyncSnapshotDownload, h as SyncSnapshotResume, T as TaskOperations, W as WaitForTaskOptions, i as createNarsilClient } from './client-Df76GNKm.js';
6
+ import './config-B8DP2VwR.js';
6
7
  import './adapters-pljAqmrC.js';
7
- import './index-MsF7e5hL.js';
8
- import './schema-D33CyXCy.js';
8
+ import './schema-DDauvDOv.js';
9
9
  import './synonyms-CpOAHPa-.js';
10
+ import './index-nRqDM6uS.js';
10
11
  import './types-DvncmvuQ.js';
package/dist/client.mjs CHANGED
@@ -34,6 +34,11 @@ var ErrorCodes = {
34
34
  BACKUP_STORE_CLAIMED: "BACKUP_STORE_CLAIMED",
35
35
  BACKUP_STORE_NOT_CONFIGURED: "BACKUP_STORE_NOT_CONFIGURED",
36
36
  BACKUP_NOT_READY: "BACKUP_NOT_READY",
37
+ SYNC_DURABILITY_REQUIRED: "SYNC_DURABILITY_REQUIRED",
38
+ SYNC_BACKUP_STORE_REQUIRED: "SYNC_BACKUP_STORE_REQUIRED",
39
+ SYNC_NOT_READY: "SYNC_NOT_READY",
40
+ SYNC_NOT_ENABLED: "SYNC_NOT_ENABLED",
41
+ SYNC_SNAPSHOT_PREPARING: "SYNC_SNAPSHOT_PREPARING",
37
42
  SEARCH_INVALID_FIELD: "SEARCH_INVALID_FIELD",
38
43
  VECTOR_DIMENSION_MISMATCH: "VECTOR_DIMENSION_MISMATCH",
39
44
  SEARCH_INVALID_FILTER: "SEARCH_INVALID_FILTER",
@@ -143,7 +148,8 @@ var ClientErrorCodes = {
143
148
  CLIENT_REQUEST_ABORTED: "CLIENT_REQUEST_ABORTED",
144
149
  CLIENT_INVALID_RESPONSE: "CLIENT_INVALID_RESPONSE",
145
150
  CLIENT_TASK_TIMEOUT: "CLIENT_TASK_TIMEOUT",
146
- CLIENT_UNEXPECTED_ERROR: "CLIENT_UNEXPECTED_ERROR"
151
+ CLIENT_UNEXPECTED_ERROR: "CLIENT_UNEXPECTED_ERROR",
152
+ SYNC_ANALYSIS_UNAVAILABLE: "SYNC_ANALYSIS_UNAVAILABLE"
147
153
  };
148
154
  var NarsilError = class extends Error {
149
155
  /** This says which failure it is. */
@@ -850,7 +856,7 @@ function createTransport(options) {
850
856
  }
851
857
  async function exchangeOnce(base, spec, keepsStream) {
852
858
  const url = `${base}${withQuery(spec.path, spec.query)}`;
853
- const headers = { ...baseHeaders, ...spec.options?.headers };
859
+ const headers = { ...baseHeaders, ...spec.headers, ...spec.options?.headers };
854
860
  if (spec.contentType !== void 0) headers["content-type"] = spec.contentType;
855
861
  const timeoutMs = resolveTimeout(spec);
856
862
  const deadline = startDeadline(timeoutMs, spec.options?.signal);
@@ -865,10 +871,10 @@ function createTransport(options) {
865
871
  const stream = response.body.pipeThrough(
866
872
  new TransformStream({ flush: () => deadline.release() })
867
873
  );
868
- return { kind: "answer", status: response.status, url, text: "", stream };
874
+ return { kind: "answer", status: response.status, url, text: "", stream, headers: response.headers };
869
875
  }
870
876
  const text = await readAnswer(response, resolveResponseCeiling(spec));
871
- return { kind: "answer", status: response.status, url, stream: null, text };
877
+ return { kind: "answer", status: response.status, url, stream: null, text, headers: response.headers };
872
878
  } catch (err) {
873
879
  const error = translateFailure(err, url, timeoutMs, deadline.expired(), spec.options?.signal);
874
880
  const sentNothing = error.code === ClientErrorCodes.CLIENT_CONNECTION_FAILED && failedBeforeSending(err);
@@ -906,6 +912,11 @@ function createTransport(options) {
906
912
  if (stream !== null) return stream;
907
913
  throw errorFromBody(status, parse(status, text, url), url);
908
914
  },
915
+ async download(spec) {
916
+ const { status, text, stream, headers, url } = await exchange(spec, true);
917
+ if (stream !== null && headers !== null) return { status, headers, stream };
918
+ throw errorFromBody(status, parse(status, text, url), url);
919
+ },
909
920
  async probe(spec) {
910
921
  const { status } = await exchange(spec);
911
922
  return status;
@@ -1017,6 +1028,45 @@ function createServerOperations(transport) {
1017
1028
  };
1018
1029
  }
1019
1030
 
1031
+ // src/client/sync.ts
1032
+ var ENTITY_TAG = /^"([0-9a-f]{64})"$/;
1033
+ var CONTENT_RANGE = /^bytes (\d+)-(\d+)\/(\d+)$/;
1034
+ function invalidDownload(message, path) {
1035
+ return new NarsilError(ClientErrorCodes.CLIENT_INVALID_RESPONSE, message, { url: path });
1036
+ }
1037
+ function createSyncSettingOperations(transport) {
1038
+ return {
1039
+ async updateSync(indexName, setting, options) {
1040
+ const path = `${indexPath(indexName)}/sync`;
1041
+ await transport.json({ method: "PUT", path, body: encodeJson(setting), contentType: "application/json", options });
1042
+ },
1043
+ async syncSnapshot(indexName, resume, options) {
1044
+ const path = `${indexPath(indexName)}/sync/snapshot`;
1045
+ const headers = resume === void 0 || resume.offset <= 0 ? {} : { range: `bytes=${resume.offset}-`, "if-range": `"${resume.entityTag}"` };
1046
+ const answer = await transport.download({ method: "GET", path, headers, defaultTimeoutMs: NO_TIMEOUT, options });
1047
+ const entityTag = ENTITY_TAG.exec(answer.headers.get("etag") ?? "")?.[1];
1048
+ if (entityTag === void 0) {
1049
+ await answer.stream.cancel();
1050
+ throw invalidDownload("The server sent the snapshot without an entity tag", path);
1051
+ }
1052
+ if (answer.status === 206) {
1053
+ const range = CONTENT_RANGE.exec(answer.headers.get("content-range") ?? "");
1054
+ if (range === null || Number(range[1]) !== resume?.offset) {
1055
+ await answer.stream.cancel();
1056
+ throw invalidDownload("The server sent a byte range other than the one that the client asked for", path);
1057
+ }
1058
+ return { entityTag, offset: Number(range[1]), totalBytes: Number(range[3]), stream: answer.stream };
1059
+ }
1060
+ const length = Number(answer.headers.get("content-length") ?? Number.NaN);
1061
+ if (!Number.isSafeInteger(length)) {
1062
+ await answer.stream.cancel();
1063
+ throw invalidDownload("The server sent the snapshot without its length", path);
1064
+ }
1065
+ return { entityTag, offset: 0, totalBytes: length, stream: answer.stream };
1066
+ }
1067
+ };
1068
+ }
1069
+
1020
1070
  // src/client/tasks.ts
1021
1071
  function isTerminal(record) {
1022
1072
  return record.status === "succeeded" || record.status === "failed" || record.status === "cancelled";
@@ -1116,7 +1166,8 @@ function createNarsilClient(options) {
1116
1166
  ...createTaskOperations(transport),
1117
1167
  ...createAdminOperations(transport),
1118
1168
  ...createBackupOperations(transport),
1119
- ...createServerOperations(transport)
1169
+ ...createServerOperations(transport),
1170
+ ...createSyncSettingOperations(transport)
1120
1171
  };
1121
1172
  }
1122
1173
 
@@ -1,52 +1,62 @@
1
- import { readWholeSectionChecked, checkEverySectionPage, readFileRange, openPagedFile, readCacheOfThisThread, createSectionReader, closePagedFile } from './chunk-7TE2AJIH.mjs';
2
- export { actionPartitionsOf, adoptSegmentsOnWorker, bytesThatSegmentsHoldInMemory, checkPagedSegmentFully, closeUnusedSegments, countsAsLatestHolder, createPagedFrozenSegment, isPagedSegmentFile, keysThatSegmentsStillRead, mergePagedWindow, openFileVectorReads, openPagedSegmentScan, openPagedSnapshot, openRewriteSpill, pagedListingOf, pagedPartitionLines, pagedTombstonesFor, prepareDiskAdoption, startReadingOpeningSectionsAhead, swapPreparedPartitions, writePagedSegment } from './chunk-7TE2AJIH.mjs';
3
- import './chunk-3SBJVQLL.mjs';
4
- import './chunk-NYSONUB7.mjs';
5
- import { loadFailed, decodeSections, SEGMENT_PAGE_BYTES, RECORD_PAGE_BYTES } from './chunk-DMNPYF54.mjs';
6
- import { isDead, VECTOR_FILE_PAYLOAD_VERSION, bytesToVectors } from './chunk-G5KHSM6E.mjs';
1
+ import { readWholeSectionChecked, checkEverySectionPage, readFileRange, openPagedFile, readCacheOfThisThread, createSectionReader, closePagedFile } from './chunk-K7KLL263.mjs';
2
+ export { actionPartitionsOf, adoptSegmentsOnWorker, bytesThatSegmentsHoldInMemory, checkPagedSegmentFully, closeUnusedSegments, countsAsLatestHolder, createPagedFrozenSegment, isPagedSegmentFile, keysThatSegmentsStillRead, mergePagedWindow, openFileVectorReads, openPagedSegmentScan, openPagedSnapshot, openRewriteSpill, pagedListingOf, pagedPartitionLines, pagedTombstonesFor, prepareDiskAdoption, startReadingOpeningSectionsAhead, swapPreparedPartitions, writePagedSegment } from './chunk-K7KLL263.mjs';
3
+ import './chunk-DVWYODEB.mjs';
4
+ import './chunk-CP5RRPJR.mjs';
5
+ import { loadFailed, decodeSections, SEGMENT_PAGE_BYTES, RECORD_PAGE_BYTES } from './chunk-LTUGDMV4.mjs';
6
+ import { isDead, VECTOR_FILE_PAYLOAD_VERSION, bytesToVectors } from './chunk-AO2FAYIZ.mjs';
7
7
  import './chunk-FOCV4CBZ.mjs';
8
- import { magnitude, defaultRescoreDepth, defaultEfSearch, computeCodeBlockLayout, toScore, osqQuantize, createOsqScratch, scalarQueryProducts, osqEstimate, osqDistance, toDistance } from './chunk-AWNHDBKV.mjs';
9
- export { createHNSWIndex, osqBitsOf } from './chunk-AWNHDBKV.mjs';
10
- import { stageQueryLevels, readTrailer } from './chunk-37CD3OKS.mjs';
8
+ import { magnitude, defaultRescoreDepth, defaultEfSearch, computeCodeBlockLayout, toScore, osqQuantize, createOsqScratch, scalarQueryProducts, osqEstimate, osqDistance, toDistance } from './chunk-BPSKLCS7.mjs';
9
+ export { createHNSWIndex, osqBitsOf } from './chunk-BPSKLCS7.mjs';
11
10
  import './chunk-DJHHF2L5.mjs';
12
- import { COLD_LOAD_WAIT_WITHOUT_SEARCH_MS, COLD_WALK_NODES_READ_AHEAD } from './chunk-CSHHU7PA.mjs';
13
- import './chunk-NPXVQS33.mjs';
14
- import './chunk-7LDMWKP6.mjs';
15
- import { yieldToEventLoop, HEADER_SIZE, crc32, readHeader } from './chunk-2PNYKG2D.mjs';
16
- import './chunk-6F6USYII.mjs';
17
- import './chunk-UGVUW27S.mjs';
18
- import './chunk-3HV7M5OJ.mjs';
19
- import './chunk-KAKQ74LS.mjs';
11
+ import { stageQueryLevels, readTrailer } from './chunk-37CD3OKS.mjs';
12
+ import { COLD_LOAD_WAIT_WITHOUT_SEARCH_MS, COLD_WALK_NODES_READ_AHEAD } from './chunk-KCUIFVVW.mjs';
13
+ import './chunk-62G63NMH.mjs';
14
+ import './chunk-S2N75OTN.mjs';
15
+ import './chunk-Q3TCTQCC.mjs';
16
+ import './chunk-QDZJM7NI.mjs';
17
+ import { yieldToEventLoop } from './chunk-LSM2YTKM.mjs';
18
+ import './chunk-TV2L3BN7.mjs';
20
19
  import './chunk-HJSN7UYG.mjs';
21
- import './chunk-6BWLDLS3.mjs';
20
+ import './chunk-URPCYQVJ.mjs';
22
21
  import './chunk-XIHUI4KB.mjs';
23
- import './chunk-Q2UL2TPC.mjs';
24
22
  import './chunk-3MXV3VHR.mjs';
25
23
  import './chunk-EEBCDP36.mjs';
26
- import './chunk-2HJWQPR6.mjs';
24
+ import './chunk-5FUOVJKG.mjs';
25
+ import './chunk-HWEDFLB7.mjs';
26
+ import './chunk-USR7FQRZ.mjs';
27
+ import { HEADER_SIZE, readHeader } from './chunk-HVYICDY3.mjs';
28
+ import './chunk-IPN7S4KX.mjs';
29
+ import './chunk-KAKQ74LS.mjs';
30
+ import { crc32 } from './chunk-7GXJUJ24.mjs';
31
+ import './chunk-Q2UL2TPC.mjs';
32
+ import './chunk-NTZOXVUZ.mjs';
27
33
  import './chunk-X5CV2E2B.mjs';
34
+ import './chunk-Y4WPNHMC.mjs';
35
+ import './chunk-JCLTESFN.mjs';
28
36
  import './chunk-TGP5M5R7.mjs';
29
37
  import './chunk-U2BKYEC7.mjs';
30
- import './chunk-DGRM4EZZ.mjs';
31
38
  import './chunk-QHPYS427.mjs';
32
39
  import './chunk-QYRNLLLI.mjs';
40
+ import './chunk-37IVJLP6.mjs';
33
41
  import './chunk-ZXNQEW43.mjs';
34
42
  import './chunk-KOKM4PQN.mjs';
35
- import './chunk-NVTFQFUL.mjs';
36
- import './chunk-LQG5G2LY.mjs';
43
+ import './chunk-HVKXNBFL.mjs';
37
44
  import './chunk-BTPGQC6Z.mjs';
45
+ import './chunk-LQG5G2LY.mjs';
38
46
  import './chunk-RFBLQLLZ.mjs';
39
- import './chunk-U46IZNCW.mjs';
47
+ import './chunk-OKX2BBNW.mjs';
40
48
  import './chunk-JUKYYXSP.mjs';
41
- import './chunk-SOUZMPME.mjs';
49
+ import './chunk-VMXSVVXG.mjs';
50
+ import './chunk-Z3TNWCI5.mjs';
42
51
  import './chunk-FQBFZAWG.mjs';
43
- import './chunk-65WCV5JO.mjs';
52
+ import './chunk-ZIFJXCKA.mjs';
44
53
  import './chunk-4UMZ7KQL.mjs';
45
54
  import './chunk-ZXX5GZEX.mjs';
46
- import './chunk-KYVRZAYP.mjs';
55
+ import './chunk-GES7U2PM.mjs';
56
+ import './chunk-3A5KI24C.mjs';
47
57
  import './chunk-L5ORED7V.mjs';
48
58
  import './chunk-U476IXKQ.mjs';
49
- import { NarsilError, ErrorCodes } from './chunk-MDF6PDIA.mjs';
59
+ import { NarsilError, ErrorCodes } from './chunk-KUZKUONM.mjs';
50
60
  import './chunk-R6A773WK.mjs';
51
61
  import { compareCodePoints } from './chunk-YTJCGKM4.mjs';
52
62
  import { decode, decodeMulti } from '@msgpack/msgpack';
@@ -1,6 +1,6 @@
1
- import { e as NarsilConfig } from './config-aIsy7mcL.js';
1
+ import { N as NarsilConfig } from './config-B8DP2VwR.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-MsF7e5hL.js';
3
+ import { A as AllocationConstraints, a as AllocationTable, N as NodeRole, b as NodeRegistration, C as ClusterCoordinator, c as NodeCapacity } from './index-nRqDM6uS.js';
4
4
  import { N as NodeTransport } from './types-DvncmvuQ.js';
5
5
 
6
6
  /**
@@ -584,4 +584,4 @@ interface ClusterNodeInfo {
584
584
  status: string;
585
585
  }
586
586
 
587
- 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, ReplicationConfig as p, RestoreBackupOptions as q };
587
+ 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, ReplicationConfig as p, RestoreBackupOptions as q };