@delali/narsil 0.3.1-next.145 → 0.3.1-next.149

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 (207) hide show
  1. package/dist/adapters/filesystem.mjs +2 -2
  2. package/dist/adapters/gcs.mjs +2 -2
  3. package/dist/adapters/indexeddb.mjs +1 -1
  4. package/dist/adapters/s3.mjs +2 -2
  5. package/dist/analysis-change-ZCJNYBJM.mjs +39 -0
  6. package/dist/{analysis-change-entry-V4SQQSXQ.mjs → analysis-change-entry-YN3ELL6C.mjs} +1 -1
  7. package/dist/browser/{analysis-change-QTCQ5ETU.mjs → analysis-change-M65AZQQG.mjs} +8 -5
  8. package/dist/browser/{analysis-change-entry-KYEQSP3I.mjs → analysis-change-entry-H3YIOLXZ.mjs} +1 -1
  9. package/dist/browser/{chunk-GP4QLUQM.mjs → chunk-2JABMB4S.mjs} +10 -6
  10. package/dist/browser/{chunk-5WYWLTM5.mjs → chunk-4DYLCICG.mjs} +2 -2
  11. package/dist/browser/{chunk-75PMIFQA.mjs → chunk-4RD3AFSB.mjs} +1 -1
  12. package/dist/browser/{chunk-XWMEGKDC.mjs → chunk-5V74FFZE.mjs} +2 -2
  13. package/dist/browser/{chunk-PMBSBSCN.mjs → chunk-6OWX3OP2.mjs} +2 -2
  14. package/dist/browser/chunk-BRWY3JCN.mjs +678 -0
  15. package/dist/browser/{chunk-ZALEKEUH.mjs → chunk-BVX2MEHA.mjs} +306 -607
  16. package/dist/browser/{chunk-FXPMF65P.mjs → chunk-D6UFGBF5.mjs} +15 -45
  17. package/dist/browser/{chunk-QNDWMPV2.mjs → chunk-IAXZAVYL.mjs} +25 -66
  18. package/dist/browser/chunk-JNOAKDUM.mjs +31 -0
  19. package/dist/browser/{chunk-BTMRV5MY.mjs → chunk-KAEVGLYN.mjs} +2 -2
  20. package/dist/browser/{chunk-FHO5N7FD.mjs → chunk-LURXVCHG.mjs} +1 -1
  21. package/dist/browser/chunk-MPK76GVS.mjs +63 -0
  22. package/dist/browser/{chunk-6OFS7RUN.mjs → chunk-NVEJJP4R.mjs} +1 -1
  23. package/dist/browser/{chunk-U77XQJOY.mjs → chunk-ODQP7P3H.mjs} +455 -66
  24. package/dist/browser/{chunk-IFGTRRPU.mjs → chunk-PIS7ZAP7.mjs} +3 -25
  25. package/dist/browser/{chunk-XIHLIMFX.mjs → chunk-QMNZFFD3.mjs} +4 -3
  26. package/dist/browser/{chunk-AOKLYVTT.mjs → chunk-SRL47USS.mjs} +2 -2
  27. package/dist/browser/chunk-TY7L6OXO.mjs +69 -0
  28. package/dist/browser/{chunk-LGJ6XMH5.mjs → chunk-W643QV3L.mjs} +6 -5
  29. package/dist/browser/chunk-WXLBZJMT.mjs +25 -0
  30. package/dist/browser/{chunk-ZKVDQ5ZH.mjs → chunk-XILIT5MT.mjs} +8 -8
  31. package/dist/browser/{cold-module-Y2IJAP7S.mjs → cold-module-A5S6JFDN.mjs} +20 -20
  32. package/dist/browser/{durability-wiring-MLXZ5QQF.mjs → durability-wiring-W5AVV3RF.mjs} +53 -30
  33. package/dist/browser/gzip-5S7ROJFJ.mjs +1 -0
  34. package/dist/browser/import-PTT63AGK.mjs +12 -0
  35. package/dist/browser/{module-5LMDGXQH.mjs → module-CEKA7MQH.mjs} +13 -10
  36. package/dist/browser/module-X5PGOE47.mjs +4288 -0
  37. package/dist/browser/{phrase-module-KXNRTWCS.mjs → phrase-module-CNKMUY4U.mjs} +2 -1
  38. package/dist/browser/pool-DTYSPBMQ.mjs +296 -0
  39. package/dist/{restore-queue-UAVGBSJG.mjs → browser/restore-queue-DD4LWZK7.mjs} +2 -2
  40. package/dist/browser/{runtime-ZNEGK33G.mjs → runtime-D2ULZGCN.mjs} +3 -2
  41. package/dist/browser/{snapshot-2EGS2FYU.mjs → snapshot-DQ6A4PQP.mjs} +18 -14
  42. package/dist/browser/{write-WMZA6NSF.mjs → write-MAGRAIEH.mjs} +14 -11
  43. package/dist/{capabilities-CNnzGtqP.d.ts → capabilities-BT-HLDC8.d.ts} +2 -2
  44. package/dist/{chunk-FRJ5RGX7.mjs → chunk-2HJWQPR6.mjs} +2 -2
  45. package/dist/{chunk-DKMZ7JFW.mjs → chunk-3BVGJ4JR.mjs} +10 -4
  46. package/dist/{chunk-QYMAYU7M.mjs → chunk-3HV7M5OJ.mjs} +155 -149
  47. package/dist/chunk-3MXV3VHR.mjs +46 -0
  48. package/dist/{chunk-6FOJKNUR.mjs → chunk-3SBJVQLL.mjs} +2 -2
  49. package/dist/{chunk-PRID7CA6.mjs → chunk-3TVDTACC.mjs} +1 -1
  50. package/dist/{chunk-RTVAWNUL.mjs → chunk-5WB2A3XU.mjs} +9 -6
  51. package/dist/{chunk-LWFK3TC2.mjs → chunk-65WCV5JO.mjs} +1 -1
  52. package/dist/{chunk-G6Q5DEF5.mjs → chunk-6BWLDLS3.mjs} +3 -46
  53. package/dist/{chunk-W6M4RRAT.mjs → chunk-6C5EX2QR.mjs} +3 -3
  54. package/dist/{chunk-HOC5JP2H.mjs → chunk-6F6USYII.mjs} +119 -11
  55. package/dist/{chunk-7523VCM4.mjs → chunk-7HKWO4BJ.mjs} +7 -7
  56. package/dist/{chunk-ONDEEBTA.mjs → chunk-7N223GWV.mjs} +2 -2
  57. package/dist/{chunk-UGQULMSU.mjs → chunk-ADBS5XRI.mjs} +10 -10
  58. package/dist/{chunk-MJTEU2XK.mjs → chunk-AWNHDBKV.mjs} +429 -73
  59. package/dist/{chunk-2E2ZFOPT.mjs → chunk-B2FTZNNF.mjs} +2 -2
  60. package/dist/{chunk-NWTEJ2T7.mjs → chunk-B7XIOAMK.mjs} +3 -3
  61. package/dist/{chunk-W55X2BYN.mjs → chunk-BEZH7VEH.mjs} +1 -1
  62. package/dist/chunk-BTPGQC6Z.mjs +27 -0
  63. package/dist/{chunk-KG5N7LE6.mjs → chunk-CYYSZPVV.mjs} +11 -11
  64. package/dist/{chunk-HTMUGEFU.mjs → chunk-DOY6EG76.mjs} +6 -6
  65. package/dist/{chunk-UHVTEVF5.mjs → chunk-F22IOCR2.mjs} +10 -6
  66. package/dist/{chunk-FTQLF5JI.mjs → chunk-IRWP524D.mjs} +1 -1
  67. package/dist/{chunk-XLAI4OIO.mjs → chunk-IZT3G24Q.mjs} +2 -2
  68. package/dist/{chunk-SE7MKJVK.mjs → chunk-J7M73VY7.mjs} +1 -1
  69. package/dist/chunk-KAKQ74LS.mjs +53 -0
  70. package/dist/{chunk-GVPYMSLO.mjs → chunk-KYVRZAYP.mjs} +1 -1
  71. package/dist/{chunk-F442VZUL.mjs → chunk-KZ5GQE4Z.mjs} +5 -5
  72. package/dist/{chunk-WDEWU46C.mjs → chunk-KZQIVGW7.mjs} +2 -2
  73. package/dist/{chunk-7AJAW6NN.mjs → chunk-L7TIAYPX.mjs} +8 -8
  74. package/dist/{chunk-GRFXSEFF.mjs → chunk-LDGGR7YT.mjs} +4 -81
  75. package/dist/{chunk-WMIV7PJ7.mjs → chunk-LJ4ENXOD.mjs} +15 -14
  76. package/dist/chunk-LQG5G2LY.mjs +39 -0
  77. package/dist/{chunk-IQHZMCLX.mjs → chunk-MDF6PDIA.mjs} +2 -0
  78. package/dist/{chunk-QXH2CS4V.mjs → chunk-NVTFQFUL.mjs} +7 -26
  79. package/dist/{chunk-5K2JHKM3.mjs → chunk-NYSONUB7.mjs} +1 -1
  80. package/dist/{chunk-OH7SX5MY.mjs → chunk-O4KUNDVF.mjs} +12 -10
  81. package/dist/{chunk-EBIHRL7B.mjs → chunk-Q2UL2TPC.mjs} +1 -1
  82. package/dist/{chunk-RNUP6WZ6.mjs → chunk-QEYF2SQ6.mjs} +2 -2
  83. package/dist/{chunk-RVBUQITB.mjs → chunk-QN5WVV5K.mjs} +7 -7
  84. package/dist/{chunk-RIIUZJQ3.mjs → chunk-QYRNLLLI.mjs} +1 -1
  85. package/dist/{chunk-BTARFTEN.mjs → chunk-SOUZMPME.mjs} +4 -4
  86. package/dist/{chunk-ISUOSACK.mjs → chunk-T4CJDBBE.mjs} +1 -1
  87. package/dist/{chunk-DHEJAGVW.mjs → chunk-TTCKT2RT.mjs} +5 -5
  88. package/dist/{chunk-QU2XF7VI.mjs → chunk-U2726TL5.mjs} +5 -4
  89. package/dist/{chunk-LYKUJNAV.mjs → chunk-U46IZNCW.mjs} +2 -2
  90. package/dist/{chunk-SNB4DYL3.mjs → chunk-U6NE6RCV.mjs} +4 -4
  91. package/dist/{chunk-SA52N7G3.mjs → chunk-VP6XRMWR.mjs} +4 -4
  92. package/dist/{chunk-YUCGFPMS.mjs → chunk-VQDZVWN3.mjs} +449 -405
  93. package/dist/{chunk-IWVEG5CX.mjs → chunk-XIHUI4KB.mjs} +2 -2
  94. package/dist/{chunk-IV2XTSS2.mjs → chunk-XKPNKR3V.mjs} +16 -46
  95. package/dist/{chunk-UQS5PAS5.mjs → chunk-YGQOPB2Z.mjs} +1 -1
  96. package/dist/{chunk-SVO6NV4D.mjs → chunk-YKEHQUSZ.mjs} +4 -4
  97. package/dist/{chunk-6Z22L5RN.mjs → chunk-ZAYWOHVG.mjs} +1 -1
  98. package/dist/{chunk-QLDLQW36.mjs → chunk-ZEKDO7YX.mjs} +2 -2
  99. package/dist/chunk-ZXNNR73R.mjs +31 -0
  100. package/dist/{chunk-VJS4JFBQ.mjs → chunk-ZXX5GZEX.mjs} +3 -1
  101. package/dist/{chunk-X5SBWARI.mjs → chunk-ZYKUD5NX.mjs} +9 -7
  102. package/dist/{client-DoYPHcUn.d.ts → client-Cn3gNxUU.d.ts} +3 -3
  103. package/dist/client.d.ts +5 -5
  104. package/dist/client.mjs +2 -0
  105. package/dist/{cold-module-NUD332YD.mjs → cold-module-2WWGBFJC.mjs} +36 -33
  106. package/dist/{config-CuUfls_H.d.ts → config-CfhH1IWQ.d.ts} +1 -1
  107. package/dist/{config-Dzs46im6.d.ts → config-aIsy7mcL.d.ts} +52 -1
  108. package/dist/direct-executor-QLVHMELJ.mjs +24 -0
  109. package/dist/distribution/coordinator/etcd.mjs +1 -1
  110. package/dist/distribution/transport/grpc.mjs +1 -1
  111. package/dist/distribution.d.ts +4 -4
  112. package/dist/distribution.mjs +150 -255
  113. package/dist/{durability-wiring-K7RDXWL6.mjs → durability-wiring-GNWQSZI3.mjs} +67 -42
  114. package/dist/embeddings/openai.mjs +2 -2
  115. package/dist/{engine-C0ifUEcm.d.ts → engine-CJRUHXgf.d.ts} +1 -1
  116. package/dist/gzip-F4HMIEEQ.mjs +1 -0
  117. package/dist/import-DX55PN4G.mjs +41 -0
  118. package/dist/index.browser.mjs +7 -4
  119. package/dist/index.d.ts +539 -5
  120. package/dist/index.mjs +22 -16
  121. package/dist/index.react-native.mjs +19 -0
  122. package/dist/{long-query-thread-FKVHRCHF.mjs → long-query-thread-SCUE62TO.mjs} +20 -17
  123. package/dist/{module-GJUKW5VU.mjs → module-HW6IXUM6.mjs} +601 -108
  124. package/dist/{module-TMFIWOD2.mjs → module-V5K4ZP23.mjs} +29 -23
  125. package/dist/{paged-partition-archive-WNUEMYWM.mjs → paged-partition-archive-FDIIWZNR.mjs} +31 -25
  126. package/dist/partial-words.mjs +5 -5
  127. package/dist/pattern.mjs +3 -3
  128. package/dist/persistence/durability/checkpoint-worker.mjs +28 -22
  129. package/dist/{phrase-module-OMY3QQV7.mjs → phrase-module-OUQIRUQU.mjs} +1 -1
  130. package/dist/pool-UPV5PVPY.mjs +298 -0
  131. package/dist/react-native/chunks/analysis-change-HGW3L6NY.mjs +893 -0
  132. package/dist/react-native/chunks/analysis-change-entry-BNRU6STO.mjs +1 -0
  133. package/dist/react-native/chunks/chunk-2J2727V4.mjs +495 -0
  134. package/dist/react-native/chunks/chunk-3CTWSQRW.mjs +1251 -0
  135. package/dist/react-native/chunks/chunk-5FV4ZEVA.mjs +2619 -0
  136. package/dist/react-native/chunks/chunk-7VWQLEFV.mjs +642 -0
  137. package/dist/react-native/chunks/chunk-AAAETEJK.mjs +27 -0
  138. package/dist/react-native/chunks/chunk-AM7RSBPF.mjs +32 -0
  139. package/dist/react-native/chunks/chunk-B6OD63Z3.mjs +997 -0
  140. package/dist/react-native/chunks/chunk-BRNAVOKP.mjs +177 -0
  141. package/dist/react-native/chunks/chunk-DKJTZ625.mjs +207 -0
  142. package/dist/react-native/chunks/chunk-FKGG4UOF.mjs +177 -0
  143. package/dist/{browser/chunk-K7UFXEJS.mjs → react-native/chunks/chunk-GV5KFQ6M.mjs} +12 -6
  144. package/dist/react-native/chunks/chunk-HURV3ASY.mjs +4416 -0
  145. package/dist/react-native/chunks/chunk-IO2SMUQD.mjs +10 -0
  146. package/dist/react-native/chunks/chunk-JV6VQY2S.mjs +17 -0
  147. package/dist/react-native/chunks/chunk-KUJOBRKS.mjs +217 -0
  148. package/dist/react-native/chunks/chunk-KWRW5U65.mjs +226 -0
  149. package/dist/react-native/chunks/chunk-L4M7QJNP.mjs +110 -0
  150. package/dist/react-native/chunks/chunk-LQ6Q4L5B.mjs +360 -0
  151. package/dist/react-native/chunks/chunk-LQAKO5QV.mjs +523 -0
  152. package/dist/react-native/chunks/chunk-LRGWK367.mjs +11 -0
  153. package/dist/react-native/chunks/chunk-LVIKKAA6.mjs +93 -0
  154. package/dist/react-native/chunks/chunk-NFGBOI46.mjs +14 -0
  155. package/dist/react-native/chunks/chunk-NNE4VDMM.mjs +8 -0
  156. package/dist/react-native/chunks/chunk-PPEPTUVV.mjs +56 -0
  157. package/dist/react-native/chunks/chunk-PSWKQVVT.mjs +9 -0
  158. package/dist/react-native/chunks/chunk-PU55IOG4.mjs +910 -0
  159. package/dist/react-native/chunks/chunk-QC4ZRBSX.mjs +270 -0
  160. package/dist/react-native/chunks/chunk-R4EEMYM6.mjs +21 -0
  161. package/dist/react-native/chunks/chunk-R4OPUZQ5.mjs +86 -0
  162. package/dist/react-native/chunks/chunk-SLGIAD6B.mjs +2634 -0
  163. package/dist/react-native/chunks/chunk-TJMSKBEM.mjs +25 -0
  164. package/dist/react-native/chunks/chunk-TLYD7IJ2.mjs +23 -0
  165. package/dist/react-native/chunks/chunk-UFNCLEQM.mjs +73 -0
  166. package/dist/react-native/chunks/chunk-YH7W556M.mjs +179 -0
  167. package/dist/react-native/chunks/chunk-YJSMEKRE.mjs +22385 -0
  168. package/dist/react-native/chunks/chunk-ZCKNBPQ4.mjs +79 -0
  169. package/dist/react-native/chunks/cold-module-TSFWLYWC.mjs +755 -0
  170. package/dist/react-native/chunks/durability-wiring-PZR6KOQK.mjs +4509 -0
  171. package/dist/react-native/chunks/gzip.react-native-7JWCLVOB.mjs +3 -0
  172. package/dist/react-native/chunks/import-VTODLPLO.mjs +22 -0
  173. package/dist/{browser/module-Q6VFGLMG.mjs → react-native/chunks/module-JBBH6PZH.mjs} +609 -144
  174. package/dist/react-native/chunks/module-VEK2KCKU.mjs +25 -0
  175. package/dist/react-native/chunks/phrase-module-76UAPPSG.mjs +329 -0
  176. package/dist/react-native/chunks/pool-CD4ANYUI.mjs +296 -0
  177. package/dist/react-native/chunks/release-D7ZTIANM.mjs +33 -0
  178. package/dist/react-native/chunks/replace-IMZUVUOE.mjs +57 -0
  179. package/dist/{browser/restore-queue-SOAHKZSQ.mjs → react-native/chunks/restore-queue-OI5EH7R3.mjs} +2 -2
  180. package/dist/react-native/chunks/runtime-3MCDLJAF.mjs +559 -0
  181. package/dist/react-native/chunks/snapshot-AUZMEV36.mjs +1205 -0
  182. package/dist/react-native/chunks/write-DDC2QBRJ.mjs +197 -0
  183. package/dist/react-native/partial-words.mjs +733 -0
  184. package/dist/react-native/pattern.mjs +2442 -0
  185. package/dist/react-native/synonyms.mjs +460 -0
  186. package/dist/react.d.ts +7 -7
  187. package/dist/react.mjs +2 -0
  188. package/dist/{rerank-ZZ5CHKLW.mjs → rerank-3W54N6P2.mjs} +4 -4
  189. package/dist/rerankers/http.mjs +2 -2
  190. package/dist/restore-queue-BQWWNNQI.mjs +41 -0
  191. package/dist/{runtime-RAOCKSYA.mjs → runtime-L2DZYY6N.mjs} +5 -5
  192. package/dist/server.d.ts +8 -8
  193. package/dist/server.mjs +32 -28
  194. package/dist/{snapshot-DB5ZVCDN.mjs → snapshot-EHXTOTW5.mjs} +39 -33
  195. package/dist/synonyms.mjs +3 -3
  196. package/dist/{tasks-ChWp0wrF.d.ts → tasks-C4ElXr4P.d.ts} +2 -2
  197. package/dist/thread-I7DVHHW7.mjs +31 -0
  198. package/dist/vector/search-worker.mjs +7 -5
  199. package/dist/workers/entry.mjs +9 -9
  200. package/dist/{write-KZVTLGCI.mjs → write-SDJXXQ2G.mjs} +29 -23
  201. package/package.json +88 -7
  202. package/dist/analysis-change-D5APH4Z3.mjs +0 -34
  203. package/dist/browser/import-FTMLTPGQ.mjs +0 -9
  204. package/dist/direct-executor-FDQYQEJQ.mjs +0 -22
  205. package/dist/import-6KXFY6XI.mjs +0 -35
  206. package/dist/thread-OV6T555H.mjs +0 -28
  207. /package/dist/{chunk-22YPZVMG.mjs → chunk-ZXNQEW43.mjs} +0 -0
@@ -1,5 +1,5 @@
1
- import { collectYoungGeneration, collectAndReturnPages } from './chunk-RIIUZJQ3.mjs';
2
- import { REFUSAL_YOUNG_COLLECTION_MIN_INTERVAL_MS, REFUSAL_COLLECTION_MIN_INTERVAL_MS, REFUSAL_COLLECTION_TIME_MULTIPLE } from './chunk-22YPZVMG.mjs';
1
+ import { collectYoungGeneration, collectAndReturnPages } from './chunk-QYRNLLLI.mjs';
2
+ import { REFUSAL_YOUNG_COLLECTION_MIN_INTERVAL_MS, REFUSAL_COLLECTION_MIN_INTERVAL_MS, REFUSAL_COLLECTION_TIME_MULTIPLE } from './chunk-ZXNQEW43.mjs';
3
3
 
4
4
  // src/runtime/thread-heap.ts
5
5
  var refusalListeners = /* @__PURE__ */ new Set();
@@ -1,15 +1,16 @@
1
- import { loadVectorField, VECTOR_FILE_ENVELOPE_VERSION, GRAPH_PART_ENVELOPE_VERSION } from './chunk-F442VZUL.mjs';
2
- import { SEGMENT_PAGE_BYTES, RECORD_PAGE_BYTES } from './chunk-ONDEEBTA.mjs';
3
- import { VECTOR_FILE_MAX_VECTORS, deadBytesFor } from './chunk-QLDLQW36.mjs';
4
- import { readSegmentFile, STABLE_HEAD_ATTEMPTS } from './chunk-RVBUQITB.mjs';
5
- import { MAX_SEGMENT_ID, MANIFEST_ENVELOPE_VERSION, EARLIER_SEGMENT_MANIFEST_VERSION, SEGMENT_MANIFEST_VERSION, MAX_SEGMENTS_PER_PARTITION, segmentKey, manifestKey, segmentsPrefix, vectorFileKey, graphPartKey } from './chunk-W6M4RRAT.mjs';
6
- import { VERSION, rulesOfStoredSynonyms, openChecksummedEnvelope, readHeader, HEADER_SIZE, crc32, engineVersionParts, writeHeader, packChecksummedEnvelope, packEnvelopeWithChecksum, checksumOfChunks } from './chunk-YUCGFPMS.mjs';
7
- import { decodeEveryStoredDocument, createSharedFrozenSegment, shareSegmentArrays } from './chunk-OH7SX5MY.mjs';
8
- import { DEFAULT_BM25_B, DEFAULT_BM25_K1 } from './chunk-QYMAYU7M.mjs';
9
- import { flattenSchema, requireValidFieldTypes, isQuantizationMode, isStorageMode } from './chunk-BTARFTEN.mjs';
1
+ import { loadVectorField, VECTOR_FILE_ENVELOPE_VERSION, GRAPH_PART_ENVELOPE_VERSION } from './chunk-KZ5GQE4Z.mjs';
2
+ import { gunzip, gzip } from './chunk-ZXNNR73R.mjs';
3
+ import { SEGMENT_PAGE_BYTES, RECORD_PAGE_BYTES } from './chunk-7N223GWV.mjs';
4
+ import { VECTOR_FILE_MAX_VECTORS, deadBytesFor } from './chunk-ZEKDO7YX.mjs';
5
+ import { readSegmentFile, STABLE_HEAD_ATTEMPTS } from './chunk-QN5WVV5K.mjs';
6
+ import { MAX_SEGMENT_ID, MANIFEST_ENVELOPE_VERSION, EARLIER_SEGMENT_MANIFEST_VERSION, SEGMENT_MANIFEST_VERSION, MAX_SEGMENTS_PER_PARTITION, segmentKey, manifestKey, segmentsPrefix, vectorFileKey, graphPartKey } from './chunk-6C5EX2QR.mjs';
7
+ import { VERSION, rulesOfStoredSynonyms, openChecksummedEnvelope, readHeader, HEADER_SIZE, crc32, engineVersionParts, writeHeader, packChecksummedEnvelope, packEnvelopeWithChecksum, checksumOfChunks } from './chunk-VQDZVWN3.mjs';
8
+ import { decodeEveryStoredDocument, createSharedFrozenSegment, shareSegmentArrays } from './chunk-O4KUNDVF.mjs';
9
+ import { DEFAULT_BM25_B, DEFAULT_BM25_K1 } from './chunk-3HV7M5OJ.mjs';
10
+ import { flattenSchema, requireValidFieldTypes, isQuantizationMode, isStorageMode } from './chunk-SOUZMPME.mjs';
10
11
  import { VECTOR_PATTERN } from './chunk-L5ORED7V.mjs';
11
12
  import { MAX_FILE_BYTES, VALID_HNSW_METRICS } from './chunk-U476IXKQ.mjs';
12
- import { NarsilError, ErrorCodes } from './chunk-IQHZMCLX.mjs';
13
+ import { NarsilError, ErrorCodes } from './chunk-MDF6PDIA.mjs';
13
14
  import { compareCodePoints } from './chunk-YTJCGKM4.mjs';
14
15
  import { decode, encode } from '@msgpack/msgpack';
15
16
 
@@ -618,37 +619,6 @@ function deserializeMetadata(data) {
618
619
  var CURRENT_ENVELOPE_VERSION = 1;
619
620
  var SNAPSHOT_ENVELOPE_VERSION = 2;
620
621
  var INDEX_SNAPSHOT_ENVELOPE_VERSION = 3;
621
- async function collectStream(stream) {
622
- const reader = stream.getReader();
623
- const chunks = [];
624
- let totalLength = 0;
625
- for (; ; ) {
626
- const { done, value } = await reader.read();
627
- if (done) break;
628
- chunks.push(value);
629
- totalLength += value.length;
630
- }
631
- const result = new Uint8Array(totalLength);
632
- let offset = 0;
633
- for (const chunk of chunks) {
634
- result.set(chunk, offset);
635
- offset += chunk.length;
636
- }
637
- return result;
638
- }
639
- function toArrayBuffer(data) {
640
- return data.buffer.slice(data.byteOffset, data.byteOffset + data.byteLength);
641
- }
642
- async function compressGzip(data) {
643
- const blob = new Blob([toArrayBuffer(data)]);
644
- const compressed = blob.stream().pipeThrough(new CompressionStream("gzip"));
645
- return collectStream(compressed);
646
- }
647
- async function decompressGzip(data) {
648
- const blob = new Blob([toArrayBuffer(data)]);
649
- const decompressed = blob.stream().pipeThrough(new DecompressionStream("gzip"));
650
- return collectStream(decompressed);
651
- }
652
622
  function buildFlags(options) {
653
623
  const useCompression = options.compression === "gzip";
654
624
  return {
@@ -662,7 +632,7 @@ async function packEnvelope(payloadBytes, options) {
662
632
  const flags = buildFlags(options);
663
633
  let finalPayload = payloadBytes;
664
634
  if (flags.compressionEnabled) {
665
- finalPayload = await compressGzip(payloadBytes);
635
+ finalPayload = await gzip(payloadBytes);
666
636
  }
667
637
  const checksum = flags.checksumPresent ? crc32(finalPayload) : 0;
668
638
  const [major, minor, patch] = engineVersionParts();
@@ -723,7 +693,7 @@ async function unpackEnvelope(data, maxAcceptedVersion = CURRENT_ENVELOPE_VERSIO
723
693
  }
724
694
  }
725
695
  if (header.flags.compressionEnabled) {
726
- payloadBytes = await decompressGzip(payloadBytes);
696
+ payloadBytes = await gunzip(payloadBytes);
727
697
  }
728
698
  return { header, payloadBytes };
729
699
  }
@@ -1450,7 +1420,7 @@ function removeFromPartition(manager, partitionId, docIds) {
1450
1420
  }
1451
1421
  }
1452
1422
  async function attachPagedSegment(directory, ref, partitionId, manager, options) {
1453
- const { checkPagedSegmentFully, createPagedFrozenSegment, openPagedSnapshot, pagedListingOf } = await import('./module-TMFIWOD2.mjs');
1423
+ const { checkPagedSegmentFully, createPagedFrozenSegment, openPagedSnapshot, pagedListingOf } = await import('./module-V5K4ZP23.mjs');
1454
1424
  if (options.decodesEveryDocument) await checkPagedSegmentFully(directory, ref);
1455
1425
  const snapshot = openPagedSnapshot(await pagedListingOf(directory, ref));
1456
1426
  requireAgreedSchema(options.schema, snapshot.schema, ref.key);
@@ -1464,7 +1434,7 @@ async function loadPartitionSegments(store, partition, manager, options) {
1464
1434
  const { directory } = store;
1465
1435
  for (const ref of partition.segments) {
1466
1436
  if (manager.config.textStorage === "disk" && directory !== void 0) {
1467
- const { isPagedSegmentFile } = await import('./module-TMFIWOD2.mjs');
1437
+ const { isPagedSegmentFile } = await import('./module-V5K4ZP23.mjs');
1468
1438
  if (await isPagedSegmentFile(directory, ref.key)) {
1469
1439
  await attachPagedSegment(directory, ref, partition.partitionId, manager, options);
1470
1440
  await yieldToEventLoop();
@@ -1520,7 +1490,7 @@ async function loadSegmentedCheckpoint(store, indexName, manifest, deps, decodes
1520
1490
  (field) => deps.vectorIndexes.get(field.fieldPath)?.storage === "disk" && field.files.some((file) => file.headOffset !== void 0)
1521
1491
  );
1522
1492
  if (!decodesEveryDocument && directory !== void 0 && opensVectorsOnDemand) {
1523
- const { startReadingOpeningSectionsAhead } = await import('./module-TMFIWOD2.mjs');
1493
+ const { startReadingOpeningSectionsAhead } = await import('./module-V5K4ZP23.mjs');
1524
1494
  await startReadingOpeningSectionsAhead(directory, manifest);
1525
1495
  }
1526
1496
  for (const partition of manifest.partitions) {
@@ -1,4 +1,4 @@
1
- import { NarsilError, ErrorCodes } from './chunk-IQHZMCLX.mjs';
1
+ import { NarsilError, ErrorCodes } from './chunk-MDF6PDIA.mjs';
2
2
 
3
3
  // src/rerank/call.ts
4
4
  function unregistered(adapters, name) {
@@ -1,9 +1,9 @@
1
- import { isValidInteger, isRecord } from './chunk-SNB4DYL3.mjs';
1
+ import { isValidInteger, isRecord } from './chunk-U6NE6RCV.mjs';
2
2
  import { MAX_REPLICATION_FACTOR, MAX_PARTITION_COUNT } from './chunk-JDDXV6UF.mjs';
3
- import { openChecksummedEnvelope, packChecksummedEnvelope } from './chunk-YUCGFPMS.mjs';
4
- import { joinChunks } from './chunk-PRID7CA6.mjs';
3
+ import { openChecksummedEnvelope, packChecksummedEnvelope } from './chunk-VQDZVWN3.mjs';
4
+ import { joinChunks } from './chunk-3TVDTACC.mjs';
5
5
  import { MAX_FILE_BYTES } from './chunk-U476IXKQ.mjs';
6
- import { NarsilError, ErrorCodes } from './chunk-IQHZMCLX.mjs';
6
+ import { NarsilError, ErrorCodes } from './chunk-MDF6PDIA.mjs';
7
7
  import { decode, encode } from '@msgpack/msgpack';
8
8
 
9
9
  // src/narsil/write-blocks.ts
@@ -14,7 +14,7 @@ function requireLoadedVectorCode() {
14
14
  function loadVectorCode() {
15
15
  if (loaded !== null) return Promise.resolve(loaded);
16
16
  if (loading === null) {
17
- loading = import('./module-GJUKW5VU.mjs').then(
17
+ loading = import('./module-HW6IXUM6.mjs').then(
18
18
  (code) => {
19
19
  loaded = code;
20
20
  return code;
@@ -1,6 +1,6 @@
1
1
  import { osqRecordBytes } from './chunk-37CD3OKS.mjs';
2
- import { MAX_M, EARLIER_RELEASE_MIN_M, MIN_M } from './chunk-VJS4JFBQ.mjs';
3
- import { NarsilError, ErrorCodes } from './chunk-IQHZMCLX.mjs';
2
+ import { MAX_M, EARLIER_RELEASE_MIN_M, MIN_M } from './chunk-ZXX5GZEX.mjs';
3
+ import { NarsilError, ErrorCodes } from './chunk-MDF6PDIA.mjs';
4
4
 
5
5
  // src/vector/vector-index/dead-bits.ts
6
6
  var NO_LIVE_VECTOR_AT_POSITION = -1;
@@ -0,0 +1,31 @@
1
+ // src/serialization/gzip.ts
2
+ function streamOf(data) {
3
+ return new Blob([data.buffer.slice(data.byteOffset, data.byteOffset + data.byteLength)]).stream();
4
+ }
5
+ async function gzip(data) {
6
+ return new Uint8Array(await new Response(streamOf(data).pipeThrough(new CompressionStream("gzip"))).arrayBuffer());
7
+ }
8
+ async function gunzip(compressed, maxBytes = Number.POSITIVE_INFINITY) {
9
+ const reader = streamOf(compressed).pipeThrough(new DecompressionStream("gzip")).getReader();
10
+ const chunks = [];
11
+ let total = 0;
12
+ for (; ; ) {
13
+ const { done, value } = await reader.read();
14
+ if (done) break;
15
+ total += value.byteLength;
16
+ if (total > maxBytes) {
17
+ await reader.cancel();
18
+ throw Object.assign(new RangeError(`The compressed data inflates past ${maxBytes} bytes`), { code: "EFBIG" });
19
+ }
20
+ chunks.push(value);
21
+ }
22
+ const result = new Uint8Array(total);
23
+ let offset = 0;
24
+ for (const chunk of chunks) {
25
+ result.set(chunk, offset);
26
+ offset += chunk.byteLength;
27
+ }
28
+ return result;
29
+ }
30
+
31
+ export { gunzip, gzip };
@@ -11,5 +11,7 @@ var COMPACTION_TOMBSTONE_RATIO = 0.1;
11
11
  var COMPACTION_ABSOLUTE_THRESHOLD = 1e3;
12
12
  var DEFAULT_EF_SEARCH = 50;
13
13
  var NEAREST_LINK_FALLBACK_HOSTS = 4;
14
+ var CONNECT_STEPS_BETWEEN_CLOCK_CHECKS = 256;
15
+ var CONNECT_RESTARTS_BEFORE_ONE_PASS = 8;
14
16
 
15
- export { COMPACTION_ABSOLUTE_THRESHOLD, COMPACTION_TOMBSTONE_RATIO, DEFAULT_EF_SEARCH, EARLIER_RELEASE_MIN_M, FARTHEST_REJECTED_LINKS_KEPT, INITIAL_LIST_CAPACITY, INITIAL_UPPER_SLOTS, MAX_LAYER_CAP, MAX_M, MIN_M, NEAREST_LINK_FALLBACK_HOSTS, PLACEMENT_ROOM_REQUESTS };
17
+ export { COMPACTION_ABSOLUTE_THRESHOLD, COMPACTION_TOMBSTONE_RATIO, CONNECT_RESTARTS_BEFORE_ONE_PASS, CONNECT_STEPS_BETWEEN_CLOCK_CHECKS, DEFAULT_EF_SEARCH, EARLIER_RELEASE_MIN_M, FARTHEST_REJECTED_LINKS_KEPT, INITIAL_LIST_CAPACITY, INITIAL_UPPER_SLOTS, MAX_LAYER_CAP, MAX_M, MIN_M, NEAREST_LINK_FALLBACK_HOSTS, PLACEMENT_ROOM_REQUESTS };
@@ -1,6 +1,7 @@
1
- import { readMetadataEnvelope } from './chunk-IV2XTSS2.mjs';
2
- import { nextSegmentKey, readWalSegments, durableRecordMissing, checkpointLastSeqNo, SEGMENT_HEADER_SIZE } from './chunk-KG5N7LE6.mjs';
3
- import { applyDeleteEntry, applyIndexEntry } from './chunk-QU2XF7VI.mjs';
1
+ import { readMetadataEnvelope } from './chunk-XKPNKR3V.mjs';
2
+ import { nextSegmentKey, readWalSegments, durableRecordMissing, checkpointLastSeqNo, SEGMENT_HEADER_SIZE } from './chunk-CYYSZPVV.mjs';
3
+ import { applyDeleteEntry, applyIndexEntry } from './chunk-U2726TL5.mjs';
4
+ import { turnIsSpent, yieldTurn } from './chunk-LQG5G2LY.mjs';
4
5
 
5
6
  // src/persistence/durability/recovery.ts
6
7
  async function removeLeftoverRewriteFiles(directory, names) {
@@ -40,11 +41,12 @@ async function replayWal(directory, indexName, partitionId, fromSeqNoExclusive,
40
41
  }
41
42
  let highestSeqNo = fromSeqNoExclusive;
42
43
  let highestPrimaryTerm = 0;
43
- const replay = (entries) => {
44
+ const replay = async (entries) => {
44
45
  for (const entry of entries) {
45
46
  if (entry.seqNo <= highestSeqNo) {
46
47
  continue;
47
48
  }
49
+ if (turnIsSpent()) await yieldTurn();
48
50
  applyEntry(entry, deps);
49
51
  highestSeqNo = entry.seqNo;
50
52
  if (entry.primaryTerm > highestPrimaryTerm) {
@@ -52,9 +54,9 @@ async function replayWal(directory, indexName, partitionId, fromSeqNoExclusive,
52
54
  }
53
55
  }
54
56
  };
55
- replay(durableEntries);
57
+ await replay(durableEntries);
56
58
  if (activeTail !== null) {
57
- replay(activeTail.entries);
59
+ await replay(activeTail.entries);
58
60
  }
59
61
  await deleteOrphanSegments(directory, segments, marker.state.activeSegmentSeqNo);
60
62
  if (activeTail !== null && activeTail.cleanEnd < activeTail.segmentLength) {
@@ -127,7 +129,7 @@ function applyEntry(entry, deps) {
127
129
  applyDeleteEntry(entry, deps.manager, deps.vectorIndexes);
128
130
  return;
129
131
  }
130
- applyIndexEntry(entry, deps.manager, deps.vectorFieldPaths, deps.vectorIndexes);
132
+ applyIndexEntry(entry, deps.manager, deps.vectorFieldPaths, deps.vectorIndexes, deps.defersGraphBuilds !== true);
131
133
  }
132
134
  function snapshotCheckpointFor(checkpoint, partitionId) {
133
135
  return checkpointLastSeqNo(checkpoint, partitionId);
@@ -1,8 +1,8 @@
1
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-Dzs46im6.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';
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-ChWp0wrF.js';
5
- import { B as BackupListing } from './config-CuUfls_H.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';
6
6
 
7
7
  /**
8
8
  * This is the `fetch` implementation the client sends every request through.
package/dist/client.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- export { B as BackupListing, a as BackupSummary, D as DamagedBackup } from './config-CuUfls_H.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-Dzs46im6.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-CNnzGtqP.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-ChWp0wrF.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-DoYPHcUn.js';
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';
6
6
  import './adapters-pljAqmrC.js';
7
7
  import './index-MsF7e5hL.js';
8
8
  import './schema-D33CyXCy.js';
package/dist/client.mjs CHANGED
@@ -49,6 +49,7 @@ var ErrorCodes = {
49
49
  ENVELOPE_INVALID_MAGIC: "ENVELOPE_INVALID_MAGIC",
50
50
  PARTITION_CAPACITY_EXCEEDED: "PARTITION_CAPACITY_EXCEEDED",
51
51
  RESTORE_MEMORY_EXCEEDED: "RESTORE_MEMORY_EXCEEDED",
52
+ MEMORY_WRITE_BLOCKED: "MEMORY_WRITE_BLOCKED",
52
53
  ANALYSIS_CHANGE_REPLACED: "ANALYSIS_CHANGE_REPLACED",
53
54
  ANALYSIS_CHANGE_NOT_READY: "ANALYSIS_CHANGE_NOT_READY",
54
55
  ANALYSIS_GENERATION_MISSING: "ANALYSIS_GENERATION_MISSING",
@@ -82,6 +83,7 @@ var ErrorCodes = {
82
83
  COORDINATOR_AUTH_FAILED: "COORDINATOR_AUTH_FAILED",
83
84
  COORDINATOR_UNAVAILABLE: "COORDINATOR_UNAVAILABLE",
84
85
  TRANSPORT_DEPENDENCY_MISSING: "TRANSPORT_DEPENDENCY_MISSING",
86
+ NATIVE_DEPENDENCY_MISSING: "NATIVE_DEPENDENCY_MISSING",
85
87
  REPLICATION_ENTRY_INVALID: "REPLICATION_ENTRY_INVALID",
86
88
  REPLICATION_INSYNC_REMOVAL_FAILED: "REPLICATION_INSYNC_REMOVAL_FAILED",
87
89
  REPLICATION_ROLLBACK_FAILED: "REPLICATION_ROLLBACK_FAILED",
@@ -1,46 +1,52 @@
1
- import { readWholeSectionChecked, checkEverySectionPage, readFileRange, openPagedFile, readCacheOfThisThread, createSectionReader, closePagedFile } from './chunk-UGQULMSU.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-UGQULMSU.mjs';
3
- import './chunk-6FOJKNUR.mjs';
4
- import './chunk-5K2JHKM3.mjs';
5
- import { loadFailed, decodeSections, SEGMENT_PAGE_BYTES, RECORD_PAGE_BYTES } from './chunk-ONDEEBTA.mjs';
6
- import { isDead, VECTOR_FILE_PAYLOAD_VERSION, bytesToVectors } from './chunk-QLDLQW36.mjs';
1
+ import { readWholeSectionChecked, checkEverySectionPage, readFileRange, openPagedFile, readCacheOfThisThread, createSectionReader, closePagedFile } from './chunk-ADBS5XRI.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-ADBS5XRI.mjs';
3
+ import './chunk-3SBJVQLL.mjs';
4
+ import './chunk-NYSONUB7.mjs';
5
+ import { loadFailed, decodeSections, SEGMENT_PAGE_BYTES, RECORD_PAGE_BYTES } from './chunk-7N223GWV.mjs';
6
+ import { isDead, VECTOR_FILE_PAYLOAD_VERSION, bytesToVectors } from './chunk-ZEKDO7YX.mjs';
7
7
  import './chunk-FOCV4CBZ.mjs';
8
- import { magnitude, defaultRescoreDepth, defaultEfSearch, computeCodeBlockLayout, toScore, osqQuantize, createOsqScratch, scalarQueryProducts, osqEstimate, osqDistance, toDistance } from './chunk-MJTEU2XK.mjs';
9
- export { createHNSWIndex, osqBitsOf } from './chunk-MJTEU2XK.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
10
  import { stageQueryLevels, readTrailer } from './chunk-37CD3OKS.mjs';
11
11
  import './chunk-DJHHF2L5.mjs';
12
- import { COLD_LOAD_WAIT_WITHOUT_SEARCH_MS, COLD_WALK_NODES_READ_AHEAD } from './chunk-RVBUQITB.mjs';
13
- import './chunk-QU2XF7VI.mjs';
14
- import './chunk-W6M4RRAT.mjs';
15
- import { HEADER_SIZE, crc32 } from './chunk-YUCGFPMS.mjs';
16
- import './chunk-HOC5JP2H.mjs';
12
+ import { COLD_LOAD_WAIT_WITHOUT_SEARCH_MS, COLD_WALK_NODES_READ_AHEAD } from './chunk-QN5WVV5K.mjs';
13
+ import './chunk-U2726TL5.mjs';
14
+ import './chunk-6C5EX2QR.mjs';
15
+ import { yieldToEventLoop, HEADER_SIZE, crc32 } from './chunk-VQDZVWN3.mjs';
16
+ import './chunk-6F6USYII.mjs';
17
+ import './chunk-O4KUNDVF.mjs';
18
+ import './chunk-3HV7M5OJ.mjs';
19
+ import './chunk-KAKQ74LS.mjs';
17
20
  import './chunk-HJSN7UYG.mjs';
18
- import './chunk-G6Q5DEF5.mjs';
21
+ import './chunk-6BWLDLS3.mjs';
22
+ import './chunk-XIHUI4KB.mjs';
23
+ import './chunk-Q2UL2TPC.mjs';
24
+ import './chunk-3MXV3VHR.mjs';
19
25
  import './chunk-EEBCDP36.mjs';
20
- import './chunk-OH7SX5MY.mjs';
21
- import './chunk-QYMAYU7M.mjs';
22
- import './chunk-EBIHRL7B.mjs';
23
- import './chunk-FRJ5RGX7.mjs';
26
+ import './chunk-2HJWQPR6.mjs';
24
27
  import './chunk-X5CV2E2B.mjs';
25
28
  import './chunk-TGP5M5R7.mjs';
26
29
  import './chunk-U2BKYEC7.mjs';
30
+ import './chunk-ZAYWOHVG.mjs';
27
31
  import './chunk-QHPYS427.mjs';
28
- import './chunk-6Z22L5RN.mjs';
29
- import './chunk-22YPZVMG.mjs';
32
+ import './chunk-QYRNLLLI.mjs';
33
+ import './chunk-ZXNQEW43.mjs';
30
34
  import './chunk-KOKM4PQN.mjs';
31
- import './chunk-QXH2CS4V.mjs';
35
+ import './chunk-NVTFQFUL.mjs';
36
+ import './chunk-LQG5G2LY.mjs';
37
+ import './chunk-BTPGQC6Z.mjs';
32
38
  import './chunk-RFBLQLLZ.mjs';
33
- import './chunk-LYKUJNAV.mjs';
39
+ import './chunk-U46IZNCW.mjs';
34
40
  import './chunk-JUKYYXSP.mjs';
35
- import './chunk-BTARFTEN.mjs';
41
+ import './chunk-SOUZMPME.mjs';
36
42
  import './chunk-FQBFZAWG.mjs';
37
- import './chunk-LWFK3TC2.mjs';
43
+ import './chunk-65WCV5JO.mjs';
38
44
  import './chunk-4UMZ7KQL.mjs';
39
- import './chunk-VJS4JFBQ.mjs';
40
- import './chunk-GVPYMSLO.mjs';
45
+ import './chunk-ZXX5GZEX.mjs';
46
+ import './chunk-KYVRZAYP.mjs';
41
47
  import './chunk-L5ORED7V.mjs';
42
48
  import './chunk-U476IXKQ.mjs';
43
- import { NarsilError, ErrorCodes } from './chunk-IQHZMCLX.mjs';
49
+ import { NarsilError, ErrorCodes } from './chunk-MDF6PDIA.mjs';
44
50
  import './chunk-R6A773WK.mjs';
45
51
  import { compareCodePoints } from './chunk-YTJCGKM4.mjs';
46
52
  import { decode, decodeMulti } from '@msgpack/msgpack';
@@ -689,13 +695,10 @@ function openColdVectorField(input) {
689
695
  var FILE_PAGE_SIZES = /* @__PURE__ */ new Set([SEGMENT_PAGE_BYTES, RECORD_PAGE_BYTES]);
690
696
  var FLOAT32_BYTES = 4;
691
697
  var FLOAT64_BYTES2 = 8;
692
- function yieldToSearches() {
693
- return new Promise((resolve) => setImmediate(resolve));
694
- }
695
698
  function waitBeforeColdLoad(firstSearchAnswered) {
696
699
  return new Promise((resolve) => {
697
700
  const timer = setTimeout(resolve, COLD_LOAD_WAIT_WITHOUT_SEARCH_MS);
698
- timer.unref();
701
+ if (typeof timer.unref === "function") timer.unref();
699
702
  void firstSearchAnswered.then(() => {
700
703
  clearTimeout(timer);
701
704
  resolve();
@@ -725,7 +728,7 @@ function magnitudesOf(bytes) {
725
728
  }
726
729
  async function loadFilesByParts(files, restore, fieldPath, dimension, stillWanted) {
727
730
  for (const input of files) {
728
- await yieldToSearches();
731
+ await yieldToEventLoop();
729
732
  if (!stillWanted()) return;
730
733
  const { ref, path } = input;
731
734
  const sections = sectionsOfFile(input);
@@ -767,7 +770,7 @@ async function loadFilesByParts(files, restore, fieldPath, dimension, stillWante
767
770
  }
768
771
  });
769
772
  }
770
- await yieldToSearches();
773
+ await yieldToEventLoop();
771
774
  if (stillWanted()) restore.finish();
772
775
  }
773
776
 
@@ -1,4 +1,4 @@
1
- import { e as NarsilConfig } from './config-Dzs46im6.js';
1
+ import { e as NarsilConfig } from './config-aIsy7mcL.js';
2
2
  import { P as PersistenceAdapter } from './adapters-pljAqmrC.js';
3
3
  import { A as AllocationConstraints, a as AllocationTable, N as NodeRole, b as NodeRegistration, C as ClusterCoordinator, c as NodeCapacity } from './index-MsF7e5hL.js';
4
4
  import { N as NodeTransport } from './types-DvncmvuQ.js';
@@ -60,6 +60,7 @@ declare const ErrorCodes: {
60
60
  readonly ENVELOPE_INVALID_MAGIC: "ENVELOPE_INVALID_MAGIC";
61
61
  readonly PARTITION_CAPACITY_EXCEEDED: "PARTITION_CAPACITY_EXCEEDED";
62
62
  readonly RESTORE_MEMORY_EXCEEDED: "RESTORE_MEMORY_EXCEEDED";
63
+ readonly MEMORY_WRITE_BLOCKED: "MEMORY_WRITE_BLOCKED";
63
64
  readonly ANALYSIS_CHANGE_REPLACED: "ANALYSIS_CHANGE_REPLACED";
64
65
  readonly ANALYSIS_CHANGE_NOT_READY: "ANALYSIS_CHANGE_NOT_READY";
65
66
  readonly ANALYSIS_GENERATION_MISSING: "ANALYSIS_GENERATION_MISSING";
@@ -93,6 +94,7 @@ declare const ErrorCodes: {
93
94
  readonly COORDINATOR_AUTH_FAILED: "COORDINATOR_AUTH_FAILED";
94
95
  readonly COORDINATOR_UNAVAILABLE: "COORDINATOR_UNAVAILABLE";
95
96
  readonly TRANSPORT_DEPENDENCY_MISSING: "TRANSPORT_DEPENDENCY_MISSING";
97
+ readonly NATIVE_DEPENDENCY_MISSING: "NATIVE_DEPENDENCY_MISSING";
96
98
  readonly REPLICATION_ENTRY_INVALID: "REPLICATION_ENTRY_INVALID";
97
99
  readonly REPLICATION_INSYNC_REMOVAL_FAILED: "REPLICATION_INSYNC_REMOVAL_FAILED";
98
100
  readonly REPLICATION_ROLLBACK_FAILED: "REPLICATION_ROLLBACK_FAILED";
@@ -2032,6 +2034,55 @@ interface NarsilConfig {
2032
2034
  * `CONFIG_INVALID`.
2033
2035
  */
2034
2036
  patternWorkCap?: number;
2037
+ /**
2038
+ * These fractions set the memory levels at which the engine stops and resumes
2039
+ * accepting inserts and updates, so that a write cannot take the process past
2040
+ * its memory limit. Inside a cluster node, the node's own memory settings
2041
+ * apply in place of these. For a fraction outside the range that
2042
+ * {@link MemoryConfig} describes, {@link createNarsil} throws `CONFIG_INVALID`
2043
+ * on Node.js and on a phone. A browser reports no memory limit, so the
2044
+ * engine there ignores this setting and leaves it unchecked.
2045
+ */
2046
+ memory?: MemoryConfig;
2047
+ }
2048
+ /**
2049
+ * The memory levels at which an engine stops and resumes accepting inserts and
2050
+ * updates.
2051
+ *
2052
+ * The engine measures its process memory and its heap before a write whenever
2053
+ * its latest measurement is more than one second old. It counts as full once
2054
+ * either figure passes `blockWritesAbove` of its limit, and as clear again once
2055
+ * both fall below `resumeWritesBelow`, so that an engine near the threshold
2056
+ * does not switch writes on and off. While the engine is full, it refuses every
2057
+ * insert and update with `MEMORY_WRITE_BLOCKED` and the reason `memory_full`,
2058
+ * and it accepts removes, searches, and document reads, so that you can free
2059
+ * memory by removing documents. It also refuses a document whose indexing could
2060
+ * take the memory in use past the block level, with the reason
2061
+ * `write_would_fill_memory`. In a batch, it refuses that document and every
2062
+ * later one, and it keeps the documents that it has already indexed. A runtime
2063
+ * that reports no memory limit, such as a browser, leaves every write
2064
+ * unchecked.
2065
+ *
2066
+ * @public
2067
+ */
2068
+ interface MemoryConfig {
2069
+ /**
2070
+ * The engine counts as full once either memory figure passes this fraction
2071
+ * of its limit. It must lie above `resumeWritesBelow` and at most 1, and it
2072
+ * is 0.9 where you set none. On Node.js, the engine compares its heap with
2073
+ * the smaller of this setting and 0.75, because V8 stops a process after four
2074
+ * full collections in a row that each leave the old generation holding at
2075
+ * least 0.8 of its limit.
2076
+ */
2077
+ blockWritesAbove?: number;
2078
+ /**
2079
+ * A full engine accepts writes again once both memory figures fall below
2080
+ * this fraction of their limits. It must lie above 0 and below
2081
+ * `blockWritesAbove`, and it is 0.8 where you set none. On Node.js, the
2082
+ * engine compares its heap with the smaller of this setting and 0.65, for the
2083
+ * same reason that it caps the heap side of `blockWritesAbove` at 0.75.
2084
+ */
2085
+ resumeWritesBelow?: number;
2035
2086
  }
2036
2087
  /**
2037
2088
  * Limits on the indexes one engine keeps open in memory.
@@ -2195,4 +2246,4 @@ interface WorkerConfig {
2195
2246
  bootstrapModule?: string;
2196
2247
  }
2197
2248
 
2198
- export { type PresenceFilter as $, type AnalysisConfig as A, type BatchResult as B, type ClientErrorCode as C, type DocumentImportResult as D, type ErrorCode as E, type FacetConfig as F, type GroupResult as G, type HeldCheckpointReport as H, type IndexInfo as I, type HighlightMatch as J, type Hit as K, type ListParams as L, type MemoryStats as M, NarsilError as N, type HybridConfig as O, type PartitionStatsResult as P, type QueryParams as Q, type IndexContext as R, type ServerErrorCode as S, type IndexLifecycleConfig as T, type InsertContext as U, type VectorMaintenanceResult as V, type ListedDocument as W, type MainCopyQueries as X, type NarsilEventHandlers as Y, type NarsilPlugin as Z, type PartitionContext as _, ClientErrorCodes as a, type ProcessMemoryReport as a0, type QueryCoverage as a1, type RemoveContext as a2, type RerankConfig as a3, type ScoreComponents as a4, type SearchContext as a5, type SearchMode as a6, type SortField as a7, type SortSpec as a8, type StaleAnalysis as a9, type StringFilter as aa, type TermMatchPolicy as ab, type UpdateContext as ac, type VectorQueryConfig as ad, type WorkerConfig as ae, type WorkerContext as af, type WorkerCopyReport as ag, ErrorCodes as b, type NarsilErrorCode as c, ServerErrorCodes as d, type NarsilConfig as e, type ListResult as f, type SuggestParams as g, type SuggestResult as h, isNarsilError as i, type PreflightResult as j, type IndexStats as k, type NarsilEventMap as l, type QueryResult as m, type GroupConfig as n, type ArrayFilter as o, type ComparisonFilter as p, type DocumentProjection as q, type DurabilityConfig as r, type FacetResult as s, type FieldFilter as t, type FilterExpression as u, type GeoFilter as v, type GeoPolygonFilter as w, type GeoRadiusFilter as x, type GroupReducer as y, type HighlightConfig as z };
2249
+ export { type PartitionContext as $, type AnalysisConfig as A, type BatchResult as B, type ClientErrorCode as C, type DocumentImportResult as D, type ErrorCode as E, type FacetConfig as F, type GroupResult as G, type HeldCheckpointReport as H, type IndexInfo as I, type HighlightMatch as J, type Hit as K, type ListParams as L, type MemoryStats as M, NarsilError as N, type HybridConfig as O, type PartitionStatsResult as P, type QueryParams as Q, type IndexContext as R, type ServerErrorCode as S, type IndexLifecycleConfig as T, type InsertContext as U, type VectorMaintenanceResult as V, type ListedDocument as W, type MainCopyQueries as X, type MemoryConfig as Y, type NarsilEventHandlers as Z, type NarsilPlugin as _, ClientErrorCodes as a, type PresenceFilter as a0, type ProcessMemoryReport as a1, type QueryCoverage as a2, type RemoveContext as a3, type RerankConfig as a4, type ScoreComponents as a5, type SearchContext as a6, type SearchMode as a7, type SortField as a8, type SortSpec as a9, type StaleAnalysis as aa, type StringFilter as ab, type TermMatchPolicy as ac, type UpdateContext as ad, type VectorQueryConfig as ae, type WorkerConfig as af, type WorkerContext as ag, type WorkerCopyReport as ah, ErrorCodes as b, type NarsilErrorCode as c, ServerErrorCodes as d, type NarsilConfig as e, type ListResult as f, type SuggestParams as g, type SuggestResult as h, isNarsilError as i, type PreflightResult as j, type IndexStats as k, type NarsilEventMap as l, type QueryResult as m, type GroupConfig as n, type ArrayFilter as o, type ComparisonFilter as p, type DocumentProjection as q, type DurabilityConfig as r, type FacetResult as s, type FieldFilter as t, type FilterExpression as u, type GeoFilter as v, type GeoPolygonFilter as w, type GeoRadiusFilter as x, type GroupReducer as y, type HighlightConfig as z };
@@ -0,0 +1,24 @@
1
+ export { createDirectExecutor } from './chunk-O4KUNDVF.mjs';
2
+ import './chunk-3HV7M5OJ.mjs';
3
+ import './chunk-KAKQ74LS.mjs';
4
+ import './chunk-Q2UL2TPC.mjs';
5
+ import './chunk-2HJWQPR6.mjs';
6
+ import './chunk-X5CV2E2B.mjs';
7
+ import './chunk-TGP5M5R7.mjs';
8
+ import './chunk-U2BKYEC7.mjs';
9
+ import './chunk-ZAYWOHVG.mjs';
10
+ import './chunk-ZXNQEW43.mjs';
11
+ import './chunk-LQG5G2LY.mjs';
12
+ import './chunk-U46IZNCW.mjs';
13
+ import './chunk-JUKYYXSP.mjs';
14
+ import './chunk-SOUZMPME.mjs';
15
+ import './chunk-FQBFZAWG.mjs';
16
+ import './chunk-65WCV5JO.mjs';
17
+ import './chunk-4UMZ7KQL.mjs';
18
+ import './chunk-ZXX5GZEX.mjs';
19
+ import './chunk-KYVRZAYP.mjs';
20
+ import './chunk-L5ORED7V.mjs';
21
+ import './chunk-U476IXKQ.mjs';
22
+ import './chunk-MDF6PDIA.mjs';
23
+ import './chunk-R6A773WK.mjs';
24
+ import './chunk-YTJCGKM4.mjs';
@@ -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-IQHZMCLX.mjs';
3
+ import { NarsilError, ErrorCodes, describeError } from '../../chunk-MDF6PDIA.mjs';
4
4
  import '../../chunk-R6A773WK.mjs';
5
5
  import { compareCodePoints } from '../../chunk-YTJCGKM4.mjs';
6
6
  import { encode, decode } from '@msgpack/msgpack';
@@ -2,7 +2,7 @@ import { decodeTransportMessage, encodeTransportMessage } from '../../chunk-IJPK
2
2
  import { timeoutsOf, replyDeadlineMs } from '../../chunk-POUYICOU.mjs';
3
3
  import { MAX_MESSAGE_SIZE_BYTES, GRPC_KEEPALIVE_TIMEOUT_MS, GRPC_KEEPALIVE_TIME_MS, GRPC_ENVELOPE_OVERHEAD_BYTES } from '../../chunk-UNEEFTEU.mjs';
4
4
  import { TransportError, TransportErrorCodes } from '../../chunk-5QMHMELB.mjs';
5
- import { NarsilError, ErrorCodes } from '../../chunk-IQHZMCLX.mjs';
5
+ import { NarsilError, ErrorCodes } from '../../chunk-MDF6PDIA.mjs';
6
6
 
7
7
  // src/distribution/transport/grpc/codec.ts
8
8
  var FIELD_ONE_LENGTH_DELIMITED_KEY = 10;
@@ -1,8 +1,8 @@
1
- import { c as CreateIndexOptions, C as ClusterNamespace, d as ClusterNodeConfig } from './config-CuUfls_H.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-CuUfls_H.js';
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';
3
3
  import { R as RerankAdapter } from './adapters-pljAqmrC.js';
4
- import { A as AnalysisChange, N as Narsil } from './engine-C0ifUEcm.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-Dzs46im6.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
6
  import { B as BM25Params, a as IndexConfig, A as AnyDocument, I as InsertOptions } from './schema-D33CyXCy.js';
7
7
  import { c as NodeCapacity, N as NodeRole } from './index-MsF7e5hL.js';
8
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';