@delali/narsil 0.3.1-next.144 → 0.3.1-next.146

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 (241) hide show
  1. package/dist/adapters/filesystem.d.ts +1 -1
  2. package/dist/adapters/filesystem.mjs +101 -13
  3. package/dist/adapters/gcs.d.ts +49 -0
  4. package/dist/adapters/gcs.mjs +213 -0
  5. package/dist/adapters/indexeddb.d.ts +1 -1
  6. package/dist/adapters/indexeddb.mjs +2 -7
  7. package/dist/adapters/memory.d.ts +1 -1
  8. package/dist/adapters/memory.mjs +5 -0
  9. package/dist/adapters/s3.d.ts +53 -0
  10. package/dist/adapters/s3.mjs +263 -0
  11. package/dist/{adapters-BQFQ4PRz.d.ts → adapters-pljAqmrC.d.ts} +33 -0
  12. package/dist/analysis-change-ZCJNYBJM.mjs +39 -0
  13. package/dist/{browser/analysis-change-entry-7HR4LWL3.mjs → analysis-change-entry-YN3ELL6C.mjs} +1 -1
  14. package/dist/browser/{analysis-change-JPV775LR.mjs → analysis-change-M65AZQQG.mjs} +8 -5
  15. package/dist/{analysis-change-entry-TZTG4AZB.mjs → browser/analysis-change-entry-H3YIOLXZ.mjs} +1 -1
  16. package/dist/browser/{chunk-VFYMPCOV.mjs → chunk-2JABMB4S.mjs} +10 -6
  17. package/dist/{chunk-46NZOPHS.mjs → browser/chunk-4DYLCICG.mjs} +2 -2
  18. package/dist/browser/{chunk-MZI3TEOW.mjs → chunk-4RD3AFSB.mjs} +1 -1
  19. package/dist/browser/{chunk-WCFCHIBB.mjs → chunk-5V74FFZE.mjs} +2 -2
  20. package/dist/{chunk-NN33CZRE.mjs → browser/chunk-6OWX3OP2.mjs} +2 -2
  21. package/dist/browser/chunk-BRWY3JCN.mjs +678 -0
  22. package/dist/browser/{chunk-5DB2VDGI.mjs → chunk-BVX2MEHA.mjs} +306 -607
  23. package/dist/browser/{chunk-KTOK275N.mjs → chunk-D6UFGBF5.mjs} +15 -45
  24. package/dist/browser/{chunk-D33A5VMU.mjs → chunk-IAXZAVYL.mjs} +25 -66
  25. package/dist/browser/chunk-JNOAKDUM.mjs +31 -0
  26. package/dist/browser/{chunk-LVY2LI35.mjs → chunk-KAEVGLYN.mjs} +2 -2
  27. package/dist/browser/{chunk-3ZBJYAS4.mjs → chunk-LURXVCHG.mjs} +1 -1
  28. package/dist/browser/chunk-MPK76GVS.mjs +63 -0
  29. package/dist/browser/{chunk-ZEV26AQ6.mjs → chunk-NVEJJP4R.mjs} +1 -1
  30. package/dist/browser/{chunk-HKX2G6WH.mjs → chunk-ODQP7P3H.mjs} +455 -66
  31. package/dist/browser/{chunk-35B42UFM.mjs → chunk-PIS7ZAP7.mjs} +12 -25
  32. package/dist/browser/{chunk-TCLEOZ4P.mjs → chunk-QMNZFFD3.mjs} +4 -3
  33. package/dist/browser/{chunk-R4WUDZQV.mjs → chunk-SRL47USS.mjs} +2 -2
  34. package/dist/browser/chunk-TY7L6OXO.mjs +69 -0
  35. package/dist/browser/{chunk-MVM33ZUL.mjs → chunk-W643QV3L.mjs} +6 -5
  36. package/dist/browser/chunk-WXLBZJMT.mjs +25 -0
  37. package/dist/browser/{chunk-MWUK3DA5.mjs → chunk-XILIT5MT.mjs} +8 -8
  38. package/dist/browser/{cold-module-MJMKNUYJ.mjs → cold-module-A5S6JFDN.mjs} +20 -20
  39. package/dist/browser/{durability-wiring-SNOWIT6Z.mjs → durability-wiring-W5AVV3RF.mjs} +120 -80
  40. package/dist/browser/gzip-5S7ROJFJ.mjs +1 -0
  41. package/dist/browser/import-PTT63AGK.mjs +12 -0
  42. package/dist/browser/{module-BUFNZMEU.mjs → module-CEKA7MQH.mjs} +13 -10
  43. package/dist/browser/module-X5PGOE47.mjs +4288 -0
  44. package/dist/browser/{phrase-module-HGVBO24W.mjs → phrase-module-CNKMUY4U.mjs} +2 -1
  45. package/dist/browser/pool-DTYSPBMQ.mjs +296 -0
  46. package/dist/{restore-queue-FEYAC4SB.mjs → browser/restore-queue-DD4LWZK7.mjs} +2 -2
  47. package/dist/browser/{runtime-VEUH674B.mjs → runtime-D2ULZGCN.mjs} +3 -2
  48. package/dist/browser/{snapshot-QXBKHJAG.mjs → snapshot-DQ6A4PQP.mjs} +20 -15
  49. package/dist/browser/{write-WHFBDWQS.mjs → write-MAGRAIEH.mjs} +14 -11
  50. package/dist/{capabilities-BCdUwK_L.d.ts → capabilities-BT-HLDC8.d.ts} +3 -3
  51. package/dist/{chunk-O4LJQI4G.mjs → chunk-2HJWQPR6.mjs} +126 -4
  52. package/dist/{chunk-Z4HFMYNX.mjs → chunk-3BVGJ4JR.mjs} +36 -13
  53. package/dist/{chunk-ZPWS2SKJ.mjs → chunk-3HV7M5OJ.mjs} +272 -112
  54. package/dist/{chunk-UIKN2OTQ.mjs → chunk-3MXV3VHR.mjs} +2 -23
  55. package/dist/{browser/chunk-CCOAOO73.mjs → chunk-3SBJVQLL.mjs} +2 -2
  56. package/dist/chunk-3TVDTACC.mjs +104 -0
  57. package/dist/{chunk-YH5OIL7B.mjs → chunk-5QMHMELB.mjs} +6 -1
  58. package/dist/{chunk-SBMAWTRG.mjs → chunk-5WB2A3XU.mjs} +84 -15
  59. package/dist/{chunk-NPNK57CA.mjs → chunk-65WCV5JO.mjs} +1 -1
  60. package/dist/chunk-6BWLDLS3.mjs +58 -0
  61. package/dist/{chunk-UUZCQQG2.mjs → chunk-6C5EX2QR.mjs} +3 -3
  62. package/dist/{chunk-VEFN6X6Q.mjs → chunk-6F6USYII.mjs} +120 -13
  63. package/dist/{chunk-AST3SHFA.mjs → chunk-7HKWO4BJ.mjs} +7 -7
  64. package/dist/{chunk-W2COJ5AH.mjs → chunk-7N223GWV.mjs} +2 -2
  65. package/dist/{chunk-GWOS5DYC.mjs → chunk-ADBS5XRI.mjs} +11 -13
  66. package/dist/{chunk-TNBIK2LQ.mjs → chunk-AWNHDBKV.mjs} +430 -75
  67. package/dist/{chunk-ZMBFWQXN.mjs → chunk-B2FTZNNF.mjs} +2 -2
  68. package/dist/chunk-B7XIOAMK.mjs +100 -0
  69. package/dist/{chunk-W55X2BYN.mjs → chunk-BEZH7VEH.mjs} +1 -1
  70. package/dist/{chunk-QSK35UC2.mjs → chunk-BTPGQC6Z.mjs} +3 -11
  71. package/dist/{chunk-LA4WNDHL.mjs → chunk-CYYSZPVV.mjs} +12 -14
  72. package/dist/{chunk-SRJBFG2T.mjs → chunk-DOY6EG76.mjs} +6 -7
  73. package/dist/{chunk-6SNBQESJ.mjs → chunk-F22IOCR2.mjs} +10 -6
  74. package/dist/{chunk-J6YVB2XM.mjs → chunk-IJPK5PGM.mjs} +1 -1
  75. package/dist/{chunk-L76W3IZJ.mjs → chunk-IRWP524D.mjs} +1 -1
  76. package/dist/{chunk-XS2VM7UE.mjs → chunk-IZT3G24Q.mjs} +2 -2
  77. package/dist/{chunk-NOT5QOHU.mjs → chunk-J7M73VY7.mjs} +1 -1
  78. package/dist/chunk-K5HSUPYS.mjs +11 -0
  79. package/dist/chunk-KAKQ74LS.mjs +53 -0
  80. package/dist/{chunk-ZSWHPKGM.mjs → chunk-KYVRZAYP.mjs} +69 -2
  81. package/dist/{chunk-NRUXBYPH.mjs → chunk-KZ5GQE4Z.mjs} +5 -5
  82. package/dist/{browser/chunk-XNWPP5NS.mjs → chunk-KZQIVGW7.mjs} +2 -2
  83. package/dist/{chunk-KZL72VTC.mjs → chunk-L7TIAYPX.mjs} +11 -10
  84. package/dist/{chunk-DD2673TX.mjs → chunk-LDGGR7YT.mjs} +4 -81
  85. package/dist/{chunk-XZ3SRNDJ.mjs → chunk-LJ4ENXOD.mjs} +77 -16
  86. package/dist/chunk-LQG5G2LY.mjs +39 -0
  87. package/dist/{chunk-HNHCNTVG.mjs → chunk-MDF6PDIA.mjs} +11 -0
  88. package/dist/{chunk-74XB2SXI.mjs → chunk-NVTFQFUL.mjs} +16 -2
  89. package/dist/{chunk-BOJZGUS6.mjs → chunk-NYSONUB7.mjs} +1 -1
  90. package/dist/{chunk-WJGO5PGV.mjs → chunk-O4KUNDVF.mjs} +31 -17
  91. package/dist/{chunk-PWIWSUCX.mjs → chunk-POUYICOU.mjs} +1 -1
  92. package/dist/{chunk-EBIHRL7B.mjs → chunk-Q2UL2TPC.mjs} +1 -1
  93. package/dist/{chunk-NJJCPFXN.mjs → chunk-QEYF2SQ6.mjs} +2 -2
  94. package/dist/{chunk-7AUASRE7.mjs → chunk-QN5WVV5K.mjs} +7 -7
  95. package/dist/{chunk-RIIUZJQ3.mjs → chunk-QYRNLLLI.mjs} +1 -1
  96. package/dist/chunk-SOUZMPME.mjs +1635 -0
  97. package/dist/{chunk-C3YDYX6C.mjs → chunk-T4CJDBBE.mjs} +1 -1
  98. package/dist/{chunk-YLNSJQLX.mjs → chunk-TTCKT2RT.mjs} +5 -5
  99. package/dist/{chunk-KEIYVZUX.mjs → chunk-U2726TL5.mjs} +5 -5
  100. package/dist/{chunk-RKAVHNRW.mjs → chunk-U46IZNCW.mjs} +10 -5
  101. package/dist/{chunk-BRUUBXCB.mjs → chunk-U6NE6RCV.mjs} +10 -38
  102. package/dist/{chunk-VJEGOELZ.mjs → chunk-VP6XRMWR.mjs} +4 -4
  103. package/dist/{chunk-IO5F7ZBE.mjs → chunk-VQDZVWN3.mjs} +874 -413
  104. package/dist/{chunk-IWVEG5CX.mjs → chunk-XIHUI4KB.mjs} +2 -2
  105. package/dist/{chunk-YHUTF6EA.mjs → chunk-XKPNKR3V.mjs} +17 -47
  106. package/dist/{chunk-HJJWY6PT.mjs → chunk-YGQOPB2Z.mjs} +1 -1
  107. package/dist/chunk-YKEHQUSZ.mjs +248 -0
  108. package/dist/{chunk-GLZHNSGB.mjs → chunk-ZAYWOHVG.mjs} +1 -1
  109. package/dist/{chunk-ICW45TTU.mjs → chunk-ZEKDO7YX.mjs} +2 -2
  110. package/dist/chunk-ZXNNR73R.mjs +31 -0
  111. package/dist/{chunk-VJS4JFBQ.mjs → chunk-ZXX5GZEX.mjs} +3 -1
  112. package/dist/{chunk-RHKRTYGO.mjs → chunk-ZYKUD5NX.mjs} +9 -7
  113. package/dist/{client-B12YFALP.d.ts → client-Cn3gNxUU.d.ts} +62 -5
  114. package/dist/client.d.ts +8 -8
  115. package/dist/client.mjs +46 -0
  116. package/dist/{cold-module-4X7WJCFM.mjs → cold-module-2WWGBFJC.mjs} +43 -49
  117. package/dist/{config-CIG5yDyg.d.ts → config-CfhH1IWQ.d.ts} +150 -3
  118. package/dist/{config-BhZxIeb1.d.ts → config-aIsy7mcL.d.ts} +63 -3
  119. package/dist/direct-executor-QLVHMELJ.mjs +24 -0
  120. package/dist/distribution/coordinator/etcd.d.ts +3 -3
  121. package/dist/distribution/coordinator/etcd.mjs +1 -1
  122. package/dist/distribution/coordinator/in-memory.d.ts +3 -3
  123. package/dist/distribution/transport/grpc.mjs +4 -4
  124. package/dist/distribution/transport/in-memory.mjs +2 -2
  125. package/dist/distribution/transport/tcp.mjs +3 -3
  126. package/dist/distribution.d.ts +8 -8
  127. package/dist/distribution.mjs +16116 -14537
  128. package/dist/{durability-wiring-324D2DDD.mjs → durability-wiring-GNWQSZI3.mjs} +142 -109
  129. package/dist/embeddings/openai.d.ts +1 -1
  130. package/dist/embeddings/openai.mjs +2 -2
  131. package/dist/{engine-CtzbHOmG.d.ts → engine-CJRUHXgf.d.ts} +3 -3
  132. package/dist/gzip-F4HMIEEQ.mjs +1 -0
  133. package/dist/import-DX55PN4G.mjs +41 -0
  134. package/dist/{index-DsEurhSl.d.ts → index-MsF7e5hL.d.ts} +2 -2
  135. package/dist/index.browser.mjs +7 -4
  136. package/dist/index.d.ts +542 -8
  137. package/dist/index.mjs +29 -32
  138. package/dist/index.react-native.mjs +19 -0
  139. package/dist/invalidation/broadcast-channel.d.ts +1 -1
  140. package/dist/invalidation/filesystem.d.ts +1 -1
  141. package/dist/invalidation/filesystem.mjs +1 -1
  142. package/dist/invalidation/noop.d.ts +1 -1
  143. package/dist/{long-query-thread-4SW7RWDE.mjs → long-query-thread-SCUE62TO.mjs} +23 -25
  144. package/dist/{module-DXSJ5LT2.mjs → module-HW6IXUM6.mjs} +603 -112
  145. package/dist/module-V5K4ZP23.mjs +45 -0
  146. package/dist/{paged-partition-archive-HFP45PLU.mjs → paged-partition-archive-FDIIWZNR.mjs} +42 -41
  147. package/dist/partial-words.mjs +7 -9
  148. package/dist/pattern.mjs +4 -6
  149. package/dist/persistence/durability/checkpoint-worker.d.ts +2 -2
  150. package/dist/persistence/durability/checkpoint-worker.mjs +36 -39
  151. package/dist/{phrase-module-5QHBD2VJ.mjs → phrase-module-OUQIRUQU.mjs} +1 -1
  152. package/dist/pool-UPV5PVPY.mjs +298 -0
  153. package/dist/react-native/chunks/analysis-change-HGW3L6NY.mjs +893 -0
  154. package/dist/react-native/chunks/analysis-change-entry-BNRU6STO.mjs +1 -0
  155. package/dist/react-native/chunks/chunk-2J2727V4.mjs +495 -0
  156. package/dist/react-native/chunks/chunk-3CTWSQRW.mjs +1251 -0
  157. package/dist/react-native/chunks/chunk-5FV4ZEVA.mjs +2619 -0
  158. package/dist/react-native/chunks/chunk-7VWQLEFV.mjs +642 -0
  159. package/dist/react-native/chunks/chunk-AAAETEJK.mjs +27 -0
  160. package/dist/react-native/chunks/chunk-AM7RSBPF.mjs +32 -0
  161. package/dist/react-native/chunks/chunk-B6OD63Z3.mjs +997 -0
  162. package/dist/react-native/chunks/chunk-BRNAVOKP.mjs +177 -0
  163. package/dist/react-native/chunks/chunk-DKJTZ625.mjs +207 -0
  164. package/dist/react-native/chunks/chunk-FKGG4UOF.mjs +177 -0
  165. package/dist/{browser/chunk-6RHTAVZX.mjs → react-native/chunks/chunk-GV5KFQ6M.mjs} +38 -15
  166. package/dist/react-native/chunks/chunk-HURV3ASY.mjs +4416 -0
  167. package/dist/react-native/chunks/chunk-IO2SMUQD.mjs +10 -0
  168. package/dist/react-native/chunks/chunk-JV6VQY2S.mjs +17 -0
  169. package/dist/react-native/chunks/chunk-KUJOBRKS.mjs +217 -0
  170. package/dist/react-native/chunks/chunk-KWRW5U65.mjs +226 -0
  171. package/dist/react-native/chunks/chunk-L4M7QJNP.mjs +110 -0
  172. package/dist/react-native/chunks/chunk-LQ6Q4L5B.mjs +360 -0
  173. package/dist/react-native/chunks/chunk-LQAKO5QV.mjs +523 -0
  174. package/dist/react-native/chunks/chunk-LRGWK367.mjs +11 -0
  175. package/dist/react-native/chunks/chunk-LVIKKAA6.mjs +93 -0
  176. package/dist/react-native/chunks/chunk-NFGBOI46.mjs +14 -0
  177. package/dist/react-native/chunks/chunk-NNE4VDMM.mjs +8 -0
  178. package/dist/react-native/chunks/chunk-PPEPTUVV.mjs +56 -0
  179. package/dist/react-native/chunks/chunk-PSWKQVVT.mjs +9 -0
  180. package/dist/{chunk-KGOXHLLZ.mjs → react-native/chunks/chunk-PU55IOG4.mjs} +228 -11
  181. package/dist/react-native/chunks/chunk-QC4ZRBSX.mjs +270 -0
  182. package/dist/react-native/chunks/chunk-R4EEMYM6.mjs +21 -0
  183. package/dist/react-native/chunks/chunk-R4OPUZQ5.mjs +86 -0
  184. package/dist/react-native/chunks/chunk-SLGIAD6B.mjs +2634 -0
  185. package/dist/react-native/chunks/chunk-TJMSKBEM.mjs +25 -0
  186. package/dist/react-native/chunks/chunk-TLYD7IJ2.mjs +23 -0
  187. package/dist/react-native/chunks/chunk-UFNCLEQM.mjs +73 -0
  188. package/dist/react-native/chunks/chunk-YH7W556M.mjs +179 -0
  189. package/dist/react-native/chunks/chunk-YJSMEKRE.mjs +22385 -0
  190. package/dist/react-native/chunks/chunk-ZCKNBPQ4.mjs +79 -0
  191. package/dist/react-native/chunks/cold-module-TSFWLYWC.mjs +755 -0
  192. package/dist/react-native/chunks/durability-wiring-PZR6KOQK.mjs +4509 -0
  193. package/dist/react-native/chunks/gzip.react-native-7JWCLVOB.mjs +3 -0
  194. package/dist/react-native/chunks/import-VTODLPLO.mjs +22 -0
  195. package/dist/{browser/module-BVP4TKZU.mjs → react-native/chunks/module-JBBH6PZH.mjs} +671 -146
  196. package/dist/react-native/chunks/module-VEK2KCKU.mjs +25 -0
  197. package/dist/react-native/chunks/phrase-module-76UAPPSG.mjs +329 -0
  198. package/dist/react-native/chunks/pool-CD4ANYUI.mjs +296 -0
  199. package/dist/react-native/chunks/release-D7ZTIANM.mjs +33 -0
  200. package/dist/react-native/chunks/replace-IMZUVUOE.mjs +57 -0
  201. package/dist/{browser/restore-queue-ONYNYUDE.mjs → react-native/chunks/restore-queue-OI5EH7R3.mjs} +2 -2
  202. package/dist/react-native/chunks/runtime-3MCDLJAF.mjs +559 -0
  203. package/dist/react-native/chunks/snapshot-AUZMEV36.mjs +1205 -0
  204. package/dist/react-native/chunks/write-DDC2QBRJ.mjs +197 -0
  205. package/dist/{chunk-DQNKVOJ2.mjs → react-native/partial-words.mjs} +13 -228
  206. package/dist/react-native/pattern.mjs +2442 -0
  207. package/dist/react-native/synonyms.mjs +460 -0
  208. package/dist/react.d.ts +11 -11
  209. package/dist/react.mjs +11 -0
  210. package/dist/{rerank-KTLC3E6N.mjs → rerank-3W54N6P2.mjs} +4 -4
  211. package/dist/rerankers/http.d.ts +1 -1
  212. package/dist/rerankers/http.mjs +2 -2
  213. package/dist/restore-queue-BQWWNNQI.mjs +41 -0
  214. package/dist/{runtime-DYV75DCB.mjs → runtime-L2DZYY6N.mjs} +5 -5
  215. package/dist/{schema-B-Runv0n.d.ts → schema-D33CyXCy.d.ts} +1 -1
  216. package/dist/server.d.ts +24 -12
  217. package/dist/server.mjs +159 -38
  218. package/dist/{snapshot-CGM65VCD.mjs → snapshot-EHXTOTW5.mjs} +47 -50
  219. package/dist/synonyms.mjs +3 -4
  220. package/dist/{tasks-CjRJRGTb.d.ts → tasks-C4ElXr4P.d.ts} +59 -7
  221. package/dist/thread-I7DVHHW7.mjs +31 -0
  222. package/dist/vector/search-worker.d.ts +2 -2
  223. package/dist/vector/search-worker.mjs +8 -7
  224. package/dist/workers/entry.mjs +9 -9
  225. package/dist/{write-2DZPEQL2.mjs → write-SDJXXQ2G.mjs} +36 -39
  226. package/openapi.json +349 -2
  227. package/package.json +108 -8
  228. package/dist/analysis-change-HQUT2Z3I.mjs +0 -43
  229. package/dist/browser/import-TLB2A5LJ.mjs +0 -9
  230. package/dist/chunk-5WYVUPGD.mjs +0 -427
  231. package/dist/chunk-AV4IJKD2.mjs +0 -35
  232. package/dist/chunk-GES7U2PM.mjs +0 -68
  233. package/dist/chunk-N37VMC62.mjs +0 -18
  234. package/dist/chunk-WNBRW4Q2.mjs +0 -128
  235. package/dist/chunk-WQBCBKY3.mjs +0 -8
  236. package/dist/chunk-ZATRDAYU.mjs +0 -160
  237. package/dist/direct-executor-7XOQ7VQP.mjs +0 -28
  238. package/dist/import-OOBUW3RR.mjs +0 -44
  239. package/dist/module-IYPLWHGC.mjs +0 -48
  240. package/dist/thread-KGNAIKPD.mjs +0 -33
  241. /package/dist/{chunk-22YPZVMG.mjs → chunk-ZXNQEW43.mjs} +0 -0
@@ -0,0 +1,197 @@
1
+ import { DOCUMENT_EXPORT_VERSION, DOCUMENT_EXPORT_FORMAT } from './chunk-KUJOBRKS.mjs';
2
+ import './chunk-QC4ZRBSX.mjs';
3
+ import { decodeVectorFilePayload, isDead, bytesToVectors } from './chunk-LQ6Q4L5B.mjs';
4
+ import { encodeExactJson, encodeDocumentJson } from './chunk-R4OPUZQ5.mjs';
5
+ import './chunk-BRNAVOKP.mjs';
6
+ import { setNestedValue, KEYWORD_SEGMENT_ENVELOPE_VERSION, decodeKeywordSegment } from './chunk-7VWQLEFV.mjs';
7
+ import { decodeStoredDocument, openChecksummedEnvelope } from './chunk-YJSMEKRE.mjs';
8
+ import './chunk-LQAKO5QV.mjs';
9
+ import './chunk-NNE4VDMM.mjs';
10
+ import './chunk-L4M7QJNP.mjs';
11
+ import './chunk-IO2SMUQD.mjs';
12
+ import { EXPORT_CHUNK_BYTES } from './chunk-AM7RSBPF.mjs';
13
+ import './chunk-ZCKNBPQ4.mjs';
14
+ import './chunk-PU55IOG4.mjs';
15
+ import './chunk-TJMSKBEM.mjs';
16
+ import './chunk-DKJTZ625.mjs';
17
+ import './chunk-3CTWSQRW.mjs';
18
+ import './chunk-2J2727V4.mjs';
19
+ import './chunk-KWRW5U65.mjs';
20
+ import './chunk-PPEPTUVV.mjs';
21
+ import './chunk-LVIKKAA6.mjs';
22
+ import './chunk-AAAETEJK.mjs';
23
+ import './chunk-JV6VQY2S.mjs';
24
+ import './chunk-NFGBOI46.mjs';
25
+ import './chunk-YH7W556M.mjs';
26
+ import { decode } from '@msgpack/msgpack';
27
+
28
+ var VECTOR_FILE_ENVELOPE_VERSION = 2;
29
+ var FLOAT32_BYTES = 4;
30
+ var ENVELOPE_VERSION_OFFSET = 4;
31
+ async function locateVectors(checkpoint) {
32
+ const located = /* @__PURE__ */ new Map();
33
+ for (const field of checkpoint.manifest.vectors) {
34
+ const byDocId = /* @__PURE__ */ new Map();
35
+ for (const ref of field.files) {
36
+ const { payload } = await openChecksummedEnvelope(await checkpoint.readFile(ref), {
37
+ envelopeFormatVersion: VECTOR_FILE_ENVELOPE_VERSION,
38
+ what: `vector file "${ref.key}"`,
39
+ allowsCompression: false
40
+ });
41
+ const decoded = decodeVectorFilePayload(decode(payload));
42
+ for (let position = 0; position < decoded.docIds.length; position++) {
43
+ if (isDead(ref.dead, position)) continue;
44
+ byDocId.set(decoded.docIds[position], { ref, position, dimension: decoded.dimension });
45
+ }
46
+ }
47
+ located.set(field.fieldPath, byDocId);
48
+ }
49
+ return located;
50
+ }
51
+ async function readVector(checkpoint, location) {
52
+ const width = location.dimension * FLOAT32_BYTES;
53
+ const offset = location.ref.bytes - (location.ref.count - location.position) * width;
54
+ return Array.from(bytesToVectors((await checkpoint.readRange(location.ref, offset, width)).slice()));
55
+ }
56
+ async function readSegment(checkpoint, ref) {
57
+ const { payload } = await openChecksummedEnvelope(await checkpoint.readFile(ref), {
58
+ envelopeFormatVersion: KEYWORD_SEGMENT_ENVELOPE_VERSION,
59
+ what: `segment "${ref.key}"`,
60
+ allowsCompression: true
61
+ });
62
+ return decodeKeywordSegment(payload, false);
63
+ }
64
+ var decoder = new TextDecoder();
65
+ function idAt(contents, ordinal) {
66
+ const ids = contents.arrays.idTable;
67
+ return decoder.decode(ids.blob.subarray(ids.offsets[ordinal], ids.offsets[ordinal + 1]));
68
+ }
69
+ async function winnersOf(checkpoint, partition) {
70
+ const winners = /* @__PURE__ */ new Map();
71
+ for (let at = 0; at < partition.segments.length; at++) {
72
+ const contents = await readSegment(checkpoint, partition.segments[at]);
73
+ for (const docId of contents.tombstones) winners.delete(docId);
74
+ for (let ordinal = 0; ordinal < contents.arrays.documentCount; ordinal++) winners.set(idAt(contents, ordinal), at);
75
+ }
76
+ return winners;
77
+ }
78
+ async function wholeSegmentScan(checkpoint, ref) {
79
+ const contents = await readSegment(checkpoint, ref);
80
+ const table = contents.arrays.documentTable;
81
+ const ids = /* @__PURE__ */ new Set();
82
+ for (let ordinal = 0; ordinal < contents.arrays.documentCount; ordinal++) ids.add(idAt(contents, ordinal));
83
+ return {
84
+ count: contents.arrays.documentCount,
85
+ schema: contents.schema,
86
+ tombstones: new Set(contents.tombstones),
87
+ idAt: (ordinal) => idAt(contents, ordinal),
88
+ holds: (docId) => ids.has(docId),
89
+ storedDocumentAt: (ordinal) => decodeStoredDocument(
90
+ table.blob.subarray(table.offsets[ordinal], table.offsets[ordinal + 1]),
91
+ table.discardedFields
92
+ ),
93
+ close: () => void 0
94
+ };
95
+ }
96
+ async function wholeFileVectorReads(checkpoint) {
97
+ const located = await locateVectors(checkpoint);
98
+ return {
99
+ async vectorOf(fieldPath, docId) {
100
+ const location = located.get(fieldPath)?.get(docId);
101
+ return location === void 0 ? null : readVector(checkpoint, location);
102
+ },
103
+ close: () => located.clear()
104
+ };
105
+ }
106
+ async function* pagedDocumentLines(checkpoint) {
107
+ const { openFileVectorReads, pagedPartitionLines } = await import('./module-VEK2KCKU.mjs');
108
+ const vectors = await openFileVectorReads(checkpoint, () => wholeFileVectorReads(checkpoint));
109
+ try {
110
+ for (const partition of checkpoint.manifest.partitions) {
111
+ yield* pagedPartitionLines(checkpoint, partition, vectors, (ref) => wholeSegmentScan(checkpoint, ref));
112
+ }
113
+ } finally {
114
+ vectors.close();
115
+ }
116
+ }
117
+ async function anyPartitionIsPaged(checkpoint) {
118
+ for (const partition of checkpoint.manifest.partitions) {
119
+ for (const ref of partition.segments) {
120
+ const [version] = await checkpoint.readRange(ref, ENVELOPE_VERSION_OFFSET, 1);
121
+ if (version !== KEYWORD_SEGMENT_ENVELOPE_VERSION) return true;
122
+ }
123
+ }
124
+ return false;
125
+ }
126
+ async function* documentLines(checkpoint) {
127
+ if (await anyPartitionIsPaged(checkpoint)) {
128
+ yield* pagedDocumentLines(checkpoint);
129
+ return;
130
+ }
131
+ const vectors = await locateVectors(checkpoint);
132
+ for (const partition of checkpoint.manifest.partitions) {
133
+ const winners = await winnersOf(checkpoint, partition);
134
+ for (let at = 0; at < partition.segments.length; at++) {
135
+ const contents = await readSegment(checkpoint, partition.segments[at]);
136
+ const table = contents.arrays.documentTable;
137
+ for (let ordinal = 0; ordinal < contents.arrays.documentCount; ordinal++) {
138
+ const docId = idAt(contents, ordinal);
139
+ if (winners.get(docId) !== at) continue;
140
+ const stored = decodeStoredDocument(
141
+ table.blob.subarray(table.offsets[ordinal], table.offsets[ordinal + 1]),
142
+ table.discardedFields
143
+ );
144
+ const document = { id: docId, ...stored };
145
+ document.id = docId;
146
+ for (const [fieldPath, located] of vectors) {
147
+ const location = located.get(docId);
148
+ if (location !== void 0) setNestedValue(document, fieldPath, await readVector(checkpoint, location));
149
+ }
150
+ yield `${encodeDocumentJson(document, docId)}
151
+ `;
152
+ }
153
+ }
154
+ }
155
+ }
156
+ async function* exportLines(header, checkpoint) {
157
+ yield `${encodeExactJson({ format: DOCUMENT_EXPORT_FORMAT, version: DOCUMENT_EXPORT_VERSION, index: header }, "")}
158
+ `;
159
+ yield* documentLines(checkpoint);
160
+ }
161
+ function documentExportStream(header, checkpoint) {
162
+ const lines = exportLines(header, checkpoint);
163
+ const encoder = new TextEncoder();
164
+ let released = false;
165
+ const release = () => {
166
+ if (released) return;
167
+ released = true;
168
+ checkpoint.release();
169
+ };
170
+ return new ReadableStream({
171
+ async pull(controller) {
172
+ try {
173
+ let text = "";
174
+ while (text.length < EXPORT_CHUNK_BYTES) {
175
+ const step = await lines.next();
176
+ if (step.done) {
177
+ if (text.length > 0) controller.enqueue(encoder.encode(text));
178
+ release();
179
+ controller.close();
180
+ return;
181
+ }
182
+ text += step.value;
183
+ }
184
+ controller.enqueue(encoder.encode(text));
185
+ } catch (error) {
186
+ release();
187
+ controller.error(error);
188
+ }
189
+ },
190
+ async cancel() {
191
+ release();
192
+ await lines.return(void 0);
193
+ }
194
+ });
195
+ }
196
+
197
+ export { documentExportStream };
@@ -1,143 +1,12 @@
1
- import { flattenSchema } from './chunk-KGOXHLLZ.mjs';
2
- import { PARTIAL_WORD_MIN_CODE_POINTS, PARTIAL_WORDS_ADDED_PER_QUERY, DEFAULT_FUZZY_PREFIX_LENGTH } from './chunk-FQBFZAWG.mjs';
3
- import { fuzzyTermMatches } from './chunk-GES7U2PM.mjs';
4
- import { isWordIndexedBase } from './chunk-ZSWHPKGM.mjs';
5
- import { encodeStringBlob, tokenize, resolveStopWords, transformToken, visitTokens, visitSurfaceSpellings } from './chunk-NPNK57CA.mjs';
6
- import { compareCodePoints, codePointCount } from './chunk-YTJCGKM4.mjs';
7
-
8
- // src/core/partition/utils.ts
9
- function getOrCreateFieldNameIndex(table, fieldName) {
10
- const existing = table.indexMap.get(fieldName);
11
- if (existing !== void 0) return existing;
12
- const idx = table.names.length;
13
- table.names.push(fieldName);
14
- table.indexMap.set(fieldName, idx);
15
- return idx;
16
- }
17
- var VECTOR_PATTERN = /^vector\[(\d+)]$/;
18
- function getNestedValue(obj, path) {
19
- const parts = path.split(".");
20
- let current = obj;
21
- for (let i = 0; i < parts.length; i++) {
22
- if (current === null || current === void 0 || typeof current !== "object") return void 0;
23
- if (!Object.hasOwn(current, parts[i])) return void 0;
24
- current = current[parts[i]];
25
- }
26
- return current;
27
- }
28
- function stringArraysEqual(a, b) {
29
- if (a === b) return true;
30
- if (!a || !b) return false;
31
- if (a.length !== b.length) return false;
32
- for (let i = 0; i < a.length; i++) {
33
- if (a[i] !== b[i]) return false;
34
- }
35
- return true;
36
- }
37
- function textFieldsChanged(oldDoc, newDoc, fields) {
38
- for (const { path, base } of fields) {
39
- if (!isWordIndexedBase(base)) continue;
40
- const oldVal = getNestedValue(oldDoc, path);
41
- const newVal = getNestedValue(newDoc, path);
42
- if (base === "string") {
43
- if (oldVal !== newVal) return true;
44
- } else {
45
- if (!stringArraysEqual(oldVal, newVal)) return true;
46
- }
47
- }
48
- return false;
49
- }
50
- function parseVectorDimension(fieldType) {
51
- const match = VECTOR_PATTERN.exec(fieldType);
52
- return match ? Number.parseInt(match[1], 10) : null;
53
- }
54
- function tokenizeOptions(options) {
55
- return {
56
- stem: true,
57
- removeStopWords: true,
58
- collectSurfaces: options?.collectSurfaces === true,
59
- stopWordOverride: options?.stopWordOverride,
60
- customTokenizer: options?.customTokenizer
61
- };
62
- }
63
- function getFlatSchema(state, schema) {
64
- if (state.lastSchemaRef === schema && state.flatSchemaCache) return state.flatSchemaCache;
65
- state.flatSchemaCache = flattenSchema(schema);
66
- state.lastSchemaRef = schema;
67
- return state.flatSchemaCache;
68
- }
69
-
70
- // src/core/partition/suggestions.ts
71
- function verbatimOccurrences(state, token) {
72
- const postingList = state.invertedIdx.lookup(token);
73
- if (!postingList) return 0;
74
- const derived = postingList.totalTermFrequency - state.surfaceRegistry.stemChangedTotalFor(token);
75
- return derived > 0 ? derived : 0;
76
- }
77
- function suggestDisplayTerms(state, surfacePrefix, stemmedPrefix, limit) {
78
- if (limit <= 0 || surfacePrefix.length === 0) return [];
79
- const groups = /* @__PURE__ */ new Map();
80
- for (const candidate of state.surfaceRegistry.candidatesForPrefix(surfacePrefix)) {
81
- const postingList = state.invertedIdx.lookup(candidate.token);
82
- if (!postingList || postingList.docIdSet.size === 0) continue;
83
- let group = groups.get(candidate.token);
84
- if (!group) {
85
- group = { documentFrequency: postingList.docIdSet.size, surfaces: [] };
86
- groups.set(candidate.token, group);
87
- }
88
- group.surfaces.push({ surface: candidate.surface, occurrences: candidate.occurrences });
89
- }
90
- const termPrefixes = state.surfaceRegistry.size() === 0 && stemmedPrefix !== surfacePrefix && stemmedPrefix.length > 0 ? [surfacePrefix, stemmedPrefix] : [surfacePrefix];
91
- for (const prefix of termPrefixes) {
92
- for (const suggestion of state.invertedIdx.prefixSearch(prefix, Number.MAX_SAFE_INTEGER)) {
93
- const occurrences = verbatimOccurrences(state, suggestion.term);
94
- if (occurrences === 0) continue;
95
- let group = groups.get(suggestion.term);
96
- if (!group) {
97
- group = { documentFrequency: suggestion.documentFrequency, surfaces: [] };
98
- groups.set(suggestion.term, group);
99
- } else if (group.surfaces.some((s) => s.surface === suggestion.term)) {
100
- continue;
101
- }
102
- group.surfaces.push({ surface: suggestion.term, occurrences });
103
- }
104
- }
105
- const results = [];
106
- for (const [token, group] of groups) {
107
- results.push({ token, documentFrequency: group.documentFrequency, surfaces: group.surfaces });
108
- }
109
- results.sort((a, b) => b.documentFrequency - a.documentFrequency || compareCodePoints(a.token, b.token));
110
- if (results.length > limit) results.length = limit;
111
- return results;
112
- }
113
- function partitionDocumentFrequency(subs, token) {
114
- let documents = 0;
115
- for (const sub of subs) documents += sub.invertedIdx.documentFrequency(token);
116
- return documents;
117
- }
118
- function expandTermPrefix(subs, surfacePrefix, stemmedToken, maxExpansions) {
119
- if (maxExpansions <= 0 || surfacePrefix.length === 0) return [];
120
- const candidates = /* @__PURE__ */ new Set();
121
- const holdsSurfaceForms = subs.some((sub) => sub.surfaceRegistry.size() > 0);
122
- const termPrefixes = !holdsSurfaceForms && stemmedToken !== surfacePrefix && stemmedToken.length > 0 ? [surfacePrefix, stemmedToken] : [surfacePrefix];
123
- for (const sub of subs) {
124
- for (const candidate of sub.surfaceRegistry.candidatesForPrefix(surfacePrefix)) candidates.add(candidate.token);
125
- for (const prefix of termPrefixes) {
126
- for (const suggestion of sub.invertedIdx.prefixSearch(prefix, Number.MAX_SAFE_INTEGER)) {
127
- if (candidates.has(suggestion.term)) continue;
128
- if (verbatimOccurrences(sub, suggestion.term) > 0) candidates.add(suggestion.term);
129
- }
130
- }
131
- }
132
- const ranked = [];
133
- for (const token of candidates) {
134
- const documents = partitionDocumentFrequency(subs, token);
135
- if (documents > 0) ranked.push({ token, documents });
136
- }
137
- ranked.sort((a, b) => b.documents - a.documents || compareCodePoints(a.token, b.token));
138
- if (ranked.length > maxExpansions) ranked.length = maxExpansions;
139
- return ranked.map((entry) => entry.token);
140
- }
1
+ import { spellingCountsOf, encodePartialSpellings, countSpelling, PARTIAL_WORD_RUN_CODE_POINTS, FROZEN_PARTIAL_REMOVED_ENTRY_BYTES, sameFields, countDocumentSpellings, GROWING_PARTIAL_ENTRY_BYTES, GROWING_PARTIAL_RUN_BYTES, GROWING_PARTIAL_RUN_MEMBER_BYTES, GROWING_PARTIAL_PENDING_ENTRY_BYTES, partitionDocumentFrequency, visitDocumentSpellings, visitDocumentSurfaceSpellings, codePointCountOf, GROWING_PARTIAL_PENDING_ENTRIES_PER_ENTRY } from './chunks/chunk-PU55IOG4.mjs';
2
+ import './chunks/chunk-TJMSKBEM.mjs';
3
+ import { fuzzyTermMatches } from './chunks/chunk-DKJTZ625.mjs';
4
+ import { encodeStringBlob, tokenize, resolveStopWords, transformToken } from './chunks/chunk-2J2727V4.mjs';
5
+ import './chunks/chunk-KWRW5U65.mjs';
6
+ import { compareCodePoints, codePointCount } from './chunks/chunk-PPEPTUVV.mjs';
7
+ import { PARTIAL_WORD_MIN_CODE_POINTS, PARTIAL_WORDS_ADDED_PER_QUERY, DEFAULT_FUZZY_PREFIX_LENGTH } from './chunks/chunk-AAAETEJK.mjs';
8
+ import './chunks/chunk-JV6VQY2S.mjs';
9
+ import './chunks/chunk-YH7W556M.mjs';
141
10
 
142
11
  // src/core/partition/partial-words/text.ts
143
12
  var encoder = new TextEncoder();
@@ -220,93 +89,6 @@ function expandPartialWords(subs, analysis, requests) {
220
89
  return requests.map((request) => readers.length === 0 ? [] : addedWordsFor(subs, readers, request));
221
90
  }
222
91
 
223
- // src/core/partition/partial-words/constants.ts
224
- var PARTIAL_WORD_RUN_CODE_POINTS = 3;
225
- var GROWING_PARTIAL_ENTRY_BYTES = 104;
226
- var GROWING_PARTIAL_PENDING_ENTRY_BYTES = 8;
227
- var GROWING_PARTIAL_PENDING_ENTRIES_PER_ENTRY = 2;
228
- var GROWING_PARTIAL_RUN_BYTES = 120;
229
- var GROWING_PARTIAL_RUN_MEMBER_BYTES = 24;
230
- var FROZEN_PARTIAL_REMOVED_ENTRY_BYTES = 48;
231
-
232
- // src/core/partition/partial-words/spellings.ts
233
- var LAST_BASIC_PLANE_CODE_POINT2 = 65535;
234
- function codePointCountOf(text) {
235
- let count = 0;
236
- for (let index = 0; index < text.length; count++) {
237
- index += (text.codePointAt(index) ?? 0) > LAST_BASIC_PLANE_CODE_POINT2 ? 2 : 1;
238
- }
239
- return count;
240
- }
241
- function holdsRun(spelling) {
242
- if (spelling.length > 2 * PARTIAL_WORD_RUN_CODE_POINTS) return true;
243
- if (spelling.length <= PARTIAL_WORD_RUN_CODE_POINTS) return false;
244
- return codePointCountOf(spelling) > PARTIAL_WORD_RUN_CODE_POINTS;
245
- }
246
- function countSpelling(counts, token, spelling, change) {
247
- if (!holdsRun(spelling)) return;
248
- let byToken = counts.get(token);
249
- if (byToken === void 0) {
250
- if (change <= 0) return;
251
- byToken = /* @__PURE__ */ new Map();
252
- counts.set(token, byToken);
253
- }
254
- const next = (byToken.get(spelling) ?? 0) + change;
255
- if (next > 0) {
256
- byToken.set(spelling, next);
257
- return;
258
- }
259
- byToken.delete(spelling);
260
- if (byToken.size === 0) counts.delete(token);
261
- }
262
- function textsOf(value) {
263
- if (typeof value === "string") return [value];
264
- if (!Array.isArray(value)) return [];
265
- return value.filter((element) => typeof element === "string");
266
- }
267
- function visitFieldTexts(document, fields, visit) {
268
- for (const field of fields) {
269
- for (const text of textsOf(getNestedValue(document, field))) visit(text);
270
- }
271
- }
272
- function visitDocumentSpellings(document, analysis, visit) {
273
- const tokenizing = { ...tokenizeOptions(analysis.options), collectSurfaces: true };
274
- const visitOccurrence = (token, _position, surface) => {
275
- visit(token, surface ?? token);
276
- };
277
- visitFieldTexts(document, analysis.fields, (text) => visitTokens(text, analysis.language, tokenizing, visitOccurrence));
278
- }
279
- function visitDocumentSurfaceSpellings(document, analysis, visit) {
280
- if (analysis.options?.customTokenizer !== void 0) return;
281
- visitFieldTexts(document, analysis.fields, (text) => visitSurfaceSpellings(text, analysis.language, visit));
282
- }
283
- function countDocumentSpellings(counts, document, analysis, direction) {
284
- visitDocumentSpellings(document, analysis, (token, spelling) => countSpelling(counts, token, spelling, direction));
285
- }
286
- function spellingCountsOf(documents, analysis) {
287
- const counts = /* @__PURE__ */ new Map();
288
- for (const document of documents) countDocumentSpellings(counts, document, analysis, 1);
289
- return counts;
290
- }
291
- function encodePartialSpellings(fields, counts) {
292
- const encoded = { fields: [...fields], tokens: [], spellings: [], counts: [] };
293
- for (const [token, byToken] of counts) {
294
- for (const [spelling, count] of byToken) {
295
- encoded.tokens.push(token);
296
- encoded.spellings.push(spelling);
297
- encoded.counts.push(count);
298
- }
299
- }
300
- return encoded;
301
- }
302
- function sameFields(left, right) {
303
- if (left.length !== right.length) return false;
304
- for (let at = 0; at < left.length; at++) {
305
- if (left[at] !== right[at]) return false;
306
- }
307
- return true;
308
- }
309
-
310
92
  // src/core/partition/partial-words/frozen-table.ts
311
93
  var decoder = new TextDecoder();
312
94
  function compareEntries(left, right) {
@@ -945,4 +727,7 @@ var partialWordSearchModule = {
945
727
  highlightWords: partialWordsToHighlight
946
728
  };
947
729
 
948
- export { expandTermPrefix, getFlatSchema, getNestedValue, getOrCreateFieldNameIndex, parseVectorDimension, partialWordSearchModule, partitionDocumentFrequency, sameFields, suggestDisplayTerms, textFieldsChanged, tokenizeOptions, visitDocumentSpellings, visitDocumentSurfaceSpellings };
730
+ // src/partial-words/index.ts
731
+ var partialWordSearch = partialWordSearchModule;
732
+
733
+ export { partialWordSearch };