@wirecat/amo-cli 0.5.0 → 0.7.0

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 (281) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/README.md +2 -2
  3. package/contracts/wirecat.json +14 -0
  4. package/dist/amo/button.js +1 -1
  5. package/dist/amo/json.js +1 -1
  6. package/dist/amo/oauth.js +3 -5
  7. package/dist/amo/transport.js +3 -7
  8. package/dist/api-keys.js +1 -1
  9. package/dist/bin/amo.js +11 -11
  10. package/dist/bundle/amo.js +5 -183
  11. package/dist/bundle/{chunk-3PYE55JY.js → chunk-3HWD4BKU.js} +4 -6
  12. package/dist/bundle/{chunk-M6VZXAJC.js → chunk-4EXURQQQ.js} +21 -19
  13. package/dist/bundle/chunk-AEWYRB6F.js +8 -0
  14. package/dist/bundle/{chunk-WUFX4TKA.js → chunk-GL7CRTHR.js} +3 -3
  15. package/dist/bundle/chunk-N2UB32VN.js +76 -0
  16. package/dist/bundle/{chunk-KZ2FIDI3.js → chunk-PVVSHDMQ.js} +7 -15
  17. package/dist/bundle/program-SQH3SPOW.js +2352 -0
  18. package/dist/bundle/{instructions-AMH5RWVJ.js → source-C65ZJUTW.js} +5 -6
  19. package/dist/bundle/store-SJ2TOUGU.js +12 -0
  20. package/dist/bundle/writer-I7GBI3VE.js +12 -0
  21. package/dist/commands/account.js +1 -1
  22. package/dist/commands/api.js +1 -3
  23. package/dist/commands/crm-shared.js +2 -3
  24. package/dist/commands/schedule.js +1 -1
  25. package/dist/commands/session.js +1 -8
  26. package/dist/commands/write.js +1 -2
  27. package/dist/config.js +1 -2
  28. package/dist/context.js +1 -2
  29. package/dist/crm/activities.js +1 -1
  30. package/dist/crm/records.js +1 -1
  31. package/dist/crm/source.js +1 -1
  32. package/dist/crm/writer.js +1 -1
  33. package/dist/identity.js +4 -0
  34. package/dist/program.js +1 -2
  35. package/dist/setup/flow.js +1 -1
  36. package/dist/store.js +1 -1
  37. package/dist/version.js +1 -1
  38. package/dist/whoami.js +1 -1
  39. package/package.json +3 -3
  40. package/scenarios/first-sync.md +13 -11
  41. package/scenarios/keep-in-sync.md +7 -6
  42. package/scenarios/safe-agent-writes.md +10 -9
  43. package/dist/amo/account.d.ts +0 -18
  44. package/dist/amo/account.d.ts.map +0 -1
  45. package/dist/amo/account.js.map +0 -1
  46. package/dist/amo/allow-list.d.ts +0 -31
  47. package/dist/amo/allow-list.d.ts.map +0 -1
  48. package/dist/amo/allow-list.js.map +0 -1
  49. package/dist/amo/button.d.ts +0 -53
  50. package/dist/amo/button.d.ts.map +0 -1
  51. package/dist/amo/button.js.map +0 -1
  52. package/dist/amo/errors.d.ts +0 -12
  53. package/dist/amo/errors.d.ts.map +0 -1
  54. package/dist/amo/errors.js.map +0 -1
  55. package/dist/amo/json.d.ts +0 -3
  56. package/dist/amo/json.d.ts.map +0 -1
  57. package/dist/amo/json.js.map +0 -1
  58. package/dist/amo/oauth.d.ts +0 -64
  59. package/dist/amo/oauth.d.ts.map +0 -1
  60. package/dist/amo/oauth.js.map +0 -1
  61. package/dist/amo/operation.d.ts +0 -45
  62. package/dist/amo/operation.d.ts.map +0 -1
  63. package/dist/amo/operation.js.map +0 -1
  64. package/dist/amo/operations.d.ts +0 -3
  65. package/dist/amo/operations.d.ts.map +0 -1
  66. package/dist/amo/operations.js.map +0 -1
  67. package/dist/amo/routes.d.ts +0 -67
  68. package/dist/amo/routes.d.ts.map +0 -1
  69. package/dist/amo/routes.js.map +0 -1
  70. package/dist/amo/transport.d.ts +0 -62
  71. package/dist/amo/transport.d.ts.map +0 -1
  72. package/dist/amo/transport.js.map +0 -1
  73. package/dist/api-keys.d.ts +0 -47
  74. package/dist/api-keys.d.ts.map +0 -1
  75. package/dist/api-keys.js.map +0 -1
  76. package/dist/bin/amo.d.ts +0 -3
  77. package/dist/bin/amo.d.ts.map +0 -1
  78. package/dist/bin/amo.js.map +0 -1
  79. package/dist/bundle/agent-EFMUK732.js +0 -41
  80. package/dist/bundle/all-profiles-PIWUQWBA.js +0 -320
  81. package/dist/bundle/anthropic-47CMXBPQ.js +0 -90
  82. package/dist/bundle/app-server-QRBQODF2.js +0 -257
  83. package/dist/bundle/areas-QVHVU57Z.js +0 -63
  84. package/dist/bundle/bun-OPDGMZZQ.js +0 -169
  85. package/dist/bundle/bun-sqlite-7I4X7CZW.js +0 -75
  86. package/dist/bundle/chunk-2JHVQMVC.js +0 -16
  87. package/dist/bundle/chunk-2XBDILVW.js +0 -53
  88. package/dist/bundle/chunk-3DEQUYEG.js +0 -185
  89. package/dist/bundle/chunk-3GX6KM2E.js +0 -5302
  90. package/dist/bundle/chunk-3HC5F3P7.js +0 -24
  91. package/dist/bundle/chunk-3YM4B2GT.js +0 -63
  92. package/dist/bundle/chunk-43OW5NTG.js +0 -338
  93. package/dist/bundle/chunk-43PMSR33.js +0 -357
  94. package/dist/bundle/chunk-4N7PP76S.js +0 -6848
  95. package/dist/bundle/chunk-4VN7RI4I.js +0 -1718
  96. package/dist/bundle/chunk-57HFPNMF.js +0 -189
  97. package/dist/bundle/chunk-5UTB3ADZ.js +0 -360
  98. package/dist/bundle/chunk-633NQY2R.js +0 -80
  99. package/dist/bundle/chunk-63N46DJU.js +0 -12278
  100. package/dist/bundle/chunk-6D4VWSJD.js +0 -259
  101. package/dist/bundle/chunk-6JTHXWPE.js +0 -64
  102. package/dist/bundle/chunk-6QGUK3H7.js +0 -161
  103. package/dist/bundle/chunk-6WS6GJ4V.js +0 -30
  104. package/dist/bundle/chunk-7IR2G5XY.js +0 -559
  105. package/dist/bundle/chunk-7IWIFVXH.js +0 -52
  106. package/dist/bundle/chunk-ABX7BBS4.js +0 -388
  107. package/dist/bundle/chunk-ADLS6FVG.js +0 -24600
  108. package/dist/bundle/chunk-ADTI5RUO.js +0 -1007
  109. package/dist/bundle/chunk-AKRIUNYP.js +0 -1197
  110. package/dist/bundle/chunk-BIKOE2IW.js +0 -614
  111. package/dist/bundle/chunk-BVVMIAQ6.js +0 -37727
  112. package/dist/bundle/chunk-CGW5R4UD.js +0 -362
  113. package/dist/bundle/chunk-D4NE7EON.js +0 -170
  114. package/dist/bundle/chunk-D72URWJE.js +0 -532
  115. package/dist/bundle/chunk-DFDN6AUB.js +0 -21
  116. package/dist/bundle/chunk-DNCLQPOM.js +0 -7
  117. package/dist/bundle/chunk-DPV53EZC.js +0 -206
  118. package/dist/bundle/chunk-DQ6S5TFZ.js +0 -9539
  119. package/dist/bundle/chunk-DSJ6EAOA.js +0 -4172
  120. package/dist/bundle/chunk-DVZ75WZJ.js +0 -3752
  121. package/dist/bundle/chunk-EH6ZEJGT.js +0 -932
  122. package/dist/bundle/chunk-EHK73OSW.js +0 -2017
  123. package/dist/bundle/chunk-FNV5HLHX.js +0 -1068
  124. package/dist/bundle/chunk-FV4GQNIK.js +0 -136
  125. package/dist/bundle/chunk-G2TU5RYY.js +0 -332
  126. package/dist/bundle/chunk-GDK7ETSB.js +0 -218
  127. package/dist/bundle/chunk-GGMAIIVE.js +0 -38
  128. package/dist/bundle/chunk-GLYWZQY4.js +0 -86
  129. package/dist/bundle/chunk-H4AFNENN.js +0 -1343
  130. package/dist/bundle/chunk-HOF7GQWW.js +0 -142
  131. package/dist/bundle/chunk-HSPEU6S7.js +0 -209
  132. package/dist/bundle/chunk-IA7LLLEI.js +0 -100
  133. package/dist/bundle/chunk-IB55P46L.js +0 -334
  134. package/dist/bundle/chunk-IG2TJQJ7.js +0 -79
  135. package/dist/bundle/chunk-JG6LCSEX.js +0 -407
  136. package/dist/bundle/chunk-JLXXUEAM.js +0 -72
  137. package/dist/bundle/chunk-JXT6GY4V.js +0 -1023
  138. package/dist/bundle/chunk-K7YY6SXR.js +0 -738
  139. package/dist/bundle/chunk-KEKXERBE.js +0 -67181
  140. package/dist/bundle/chunk-KZN2BG3P.js +0 -721
  141. package/dist/bundle/chunk-LKH3UKLO.js +0 -230
  142. package/dist/bundle/chunk-LZPKBN3C.js +0 -193
  143. package/dist/bundle/chunk-MDEPJZYJ.js +0 -106
  144. package/dist/bundle/chunk-NB7EOAUZ.js +0 -123
  145. package/dist/bundle/chunk-NISH4UXM.js +0 -58
  146. package/dist/bundle/chunk-NSKMNIY6.js +0 -460
  147. package/dist/bundle/chunk-PL5P7UKW.js +0 -25216
  148. package/dist/bundle/chunk-PPSAWFJD.js +0 -1293
  149. package/dist/bundle/chunk-Q7ICVP25.js +0 -18
  150. package/dist/bundle/chunk-QFOP3KUP.js +0 -2603
  151. package/dist/bundle/chunk-R53XXHEI.js +0 -76
  152. package/dist/bundle/chunk-RIMPFMZE.js +0 -1251
  153. package/dist/bundle/chunk-RN6RT5CB.js +0 -58
  154. package/dist/bundle/chunk-RRTMPSQR.js +0 -29
  155. package/dist/bundle/chunk-S4ZHQMNM.js +0 -133
  156. package/dist/bundle/chunk-S6JG4YUH.js +0 -72
  157. package/dist/bundle/chunk-TAVI73RW.js +0 -288
  158. package/dist/bundle/chunk-TLG6ECZ2.js +0 -54
  159. package/dist/bundle/chunk-TXDR6YSF.js +0 -23
  160. package/dist/bundle/chunk-TY7NDMFY.js +0 -46
  161. package/dist/bundle/chunk-U5RJJ2EC.js +0 -353
  162. package/dist/bundle/chunk-UDSL3MUU.js +0 -2333
  163. package/dist/bundle/chunk-V2CNGXWX.js +0 -798
  164. package/dist/bundle/chunk-VB7FZOYX.js +0 -633
  165. package/dist/bundle/chunk-VZ5PPYDG.js +0 -77
  166. package/dist/bundle/chunk-W5JRXIG6.js +0 -27995
  167. package/dist/bundle/chunk-WIHN3ELW.js +0 -2793
  168. package/dist/bundle/chunk-WOPVBRPV.js +0 -29
  169. package/dist/bundle/chunk-WXJYMMEL.js +0 -95
  170. package/dist/bundle/chunk-XCCU2E3Z.js +0 -274
  171. package/dist/bundle/chunk-XEQQJBBO.js +0 -92
  172. package/dist/bundle/chunk-XUT7DSM5.js +0 -108
  173. package/dist/bundle/chunk-Y5E2WNWB.js +0 -35
  174. package/dist/bundle/chunk-YWDFYQOU.js +0 -82
  175. package/dist/bundle/chunk-ZLUIRFJX.js +0 -780
  176. package/dist/bundle/chunk-ZVVMGPBJ.js +0 -50
  177. package/dist/bundle/cli-3NXOSENF.js +0 -1239
  178. package/dist/bundle/command-contract-LNSAV5LA.js +0 -39
  179. package/dist/bundle/command-server-entry-4ZQPNUL4.js +0 -168
  180. package/dist/bundle/decode-K7U7X5EL.js +0 -296
  181. package/dist/bundle/dispatch-56FECRCU.js +0 -411
  182. package/dist/bundle/dist-PAKDDIBT.js +0 -191
  183. package/dist/bundle/dist-T54K3FJV.js +0 -7577
  184. package/dist/bundle/echarts-O3TNDAXJ.js +0 -42501
  185. package/dist/bundle/embed-SWLVG73O.js +0 -37
  186. package/dist/bundle/embedder-EJN75BPV.js +0 -110
  187. package/dist/bundle/failure-WDSX6H3B.js +0 -24
  188. package/dist/bundle/first-run-WPGUUC4Z.js +0 -28
  189. package/dist/bundle/first-screen-JMNEUQ46.js +0 -40
  190. package/dist/bundle/mcp-5HFPWC3W.js +0 -167
  191. package/dist/bundle/meeting-combined-5TKG2RYD.js +0 -24
  192. package/dist/bundle/meeting-model-YXXNETKC.js +0 -24
  193. package/dist/bundle/meeting-semantic-U7EUB3ET.js +0 -21
  194. package/dist/bundle/node-EGMCBAO7.js +0 -176
  195. package/dist/bundle/node-P4E63KXA.js +0 -2340
  196. package/dist/bundle/node-TLZSIHIJ.js +0 -21
  197. package/dist/bundle/node-sqlite-YVOGMDSP.js +0 -73
  198. package/dist/bundle/oauth-2SNRBIJM.js +0 -19
  199. package/dist/bundle/open-ABCPY5IH.js +0 -22
  200. package/dist/bundle/openai-4D6PXJR7.js +0 -237
  201. package/dist/bundle/process-SGHEN6MQ.js +0 -91
  202. package/dist/bundle/program-CBDQBZZ3.js +0 -4971
  203. package/dist/bundle/prompt-2QUK5QST.js +0 -16
  204. package/dist/bundle/recognize-QMQSJRIH.js +0 -25
  205. package/dist/bundle/remote-U7TC2BLZ.js +0 -30
  206. package/dist/bundle/rerank-5UPVXGVV.js +0 -51
  207. package/dist/bundle/serve-VX6GUM6J.js +0 -198
  208. package/dist/bundle/server-FOPC6DJ3.js +0 -219
  209. package/dist/bundle/server-OIVNOMVK.js +0 -87
  210. package/dist/bundle/source-HWS5SJIV.js +0 -46
  211. package/dist/bundle/sqlite-runtime-77NKDEXN.js +0 -19
  212. package/dist/bundle/state-X2HU6GB2.js +0 -35
  213. package/dist/bundle/store-2U4U6KL4.js +0 -184
  214. package/dist/bundle/store-3CHPHFP7.js +0 -301
  215. package/dist/bundle/store-Z3747L5F.js +0 -34
  216. package/dist/bundle/store-maintenance-command-UOSZJTVP.js +0 -74
  217. package/dist/bundle/surface-MUT72QON.js +0 -73
  218. package/dist/bundle/writer-RBKQ64ZM.js +0 -48
  219. package/dist/commands/account.d.ts +0 -4
  220. package/dist/commands/account.d.ts.map +0 -1
  221. package/dist/commands/account.js.map +0 -1
  222. package/dist/commands/api.d.ts +0 -3
  223. package/dist/commands/api.d.ts.map +0 -1
  224. package/dist/commands/api.js.map +0 -1
  225. package/dist/commands/crm-shared.d.ts +0 -8
  226. package/dist/commands/crm-shared.d.ts.map +0 -1
  227. package/dist/commands/crm-shared.js.map +0 -1
  228. package/dist/commands/schedule.d.ts +0 -3
  229. package/dist/commands/schedule.d.ts.map +0 -1
  230. package/dist/commands/schedule.js.map +0 -1
  231. package/dist/commands/session.d.ts +0 -35
  232. package/dist/commands/session.d.ts.map +0 -1
  233. package/dist/commands/session.js.map +0 -1
  234. package/dist/commands/write.d.ts +0 -14
  235. package/dist/commands/write.d.ts.map +0 -1
  236. package/dist/commands/write.js.map +0 -1
  237. package/dist/config.d.ts +0 -4
  238. package/dist/config.d.ts.map +0 -1
  239. package/dist/config.js.map +0 -1
  240. package/dist/context.d.ts +0 -62
  241. package/dist/context.d.ts.map +0 -1
  242. package/dist/context.js.map +0 -1
  243. package/dist/crm/activities.d.ts +0 -32
  244. package/dist/crm/activities.d.ts.map +0 -1
  245. package/dist/crm/activities.js.map +0 -1
  246. package/dist/crm/records.d.ts +0 -20
  247. package/dist/crm/records.d.ts.map +0 -1
  248. package/dist/crm/records.js.map +0 -1
  249. package/dist/crm/source.d.ts +0 -41
  250. package/dist/crm/source.d.ts.map +0 -1
  251. package/dist/crm/source.js.map +0 -1
  252. package/dist/crm/writer.d.ts +0 -14
  253. package/dist/crm/writer.d.ts.map +0 -1
  254. package/dist/crm/writer.js.map +0 -1
  255. package/dist/identity.d.ts +0 -7
  256. package/dist/identity.d.ts.map +0 -1
  257. package/dist/identity.js.map +0 -1
  258. package/dist/index.d.ts +0 -3
  259. package/dist/index.d.ts.map +0 -1
  260. package/dist/index.js.map +0 -1
  261. package/dist/program.d.ts +0 -6
  262. package/dist/program.d.ts.map +0 -1
  263. package/dist/program.js.map +0 -1
  264. package/dist/reasons.d.ts +0 -10
  265. package/dist/reasons.d.ts.map +0 -1
  266. package/dist/reasons.js.map +0 -1
  267. package/dist/setup/flow.d.ts +0 -2
  268. package/dist/setup/flow.d.ts.map +0 -1
  269. package/dist/setup/flow.js.map +0 -1
  270. package/dist/store.d.ts +0 -15
  271. package/dist/store.d.ts.map +0 -1
  272. package/dist/store.js.map +0 -1
  273. package/dist/version.d.ts +0 -2
  274. package/dist/version.d.ts.map +0 -1
  275. package/dist/version.js.map +0 -1
  276. package/dist/wcat.d.ts +0 -3
  277. package/dist/wcat.d.ts.map +0 -1
  278. package/dist/wcat.js.map +0 -1
  279. package/dist/whoami.d.ts +0 -24
  280. package/dist/whoami.d.ts.map +0 -1
  281. package/dist/whoami.js.map +0 -1
@@ -1,334 +0,0 @@
1
- import { createRequire as __bundleRequire } from "node:module";
2
- const require = __bundleRequire(import.meta.url);
3
- import {
4
- filesPresent,
5
- sharedModelsDirectory
6
- } from "./chunk-XCCU2E3Z.js";
7
- import {
8
- readSharedSection,
9
- sharedConfigPath,
10
- writeSharedSection
11
- } from "./chunk-AKRIUNYP.js";
12
- import {
13
- storePath
14
- } from "./chunk-TLG6ECZ2.js";
15
- import {
16
- array,
17
- check,
18
- getDotPath,
19
- integer,
20
- maxLength,
21
- maxValue,
22
- minLength,
23
- minValue,
24
- number,
25
- optional,
26
- picklist,
27
- pipe,
28
- regex,
29
- safeParse,
30
- startsWith,
31
- strictObject,
32
- string,
33
- trim,
34
- url
35
- } from "./chunk-QFOP3KUP.js";
36
- import {
37
- CliError
38
- } from "./chunk-S6JG4YUH.js";
39
- import {
40
- __name
41
- } from "./chunk-ZVVMGPBJ.js";
42
-
43
- // node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/embeddings/models.js
44
- import { existsSync } from "node:fs";
45
- import { join } from "node:path";
46
- var huggingFace = /* @__PURE__ */ __name((repository, commit) => (name) => `https://huggingface.co/${repository}/resolve/${commit}/${name}`, "huggingFace");
47
- var e5 = huggingFace("Xenova/multilingual-e5-small", "761b726dd34fb83930e26aab4e9ac3899aa1fa78");
48
- var e5Large = huggingFace("Xenova/multilingual-e5-large", "00fc3aeb3dbb95842de2ac1961d33c6319acf57b");
49
- var gemma = huggingFace("onnx-community/embeddinggemma-300m-ONNX", "5090578d9565bb06545b4552f76e6bc2c93e4a66");
50
- var TEXT_MODELS = [
51
- {
52
- id: "e5-small",
53
- title: "multilingual-e5-small, 8-bit",
54
- size: "small",
55
- languages: "about 100 languages, Russian and English among them",
56
- licence: "MIT",
57
- dims: 384,
58
- maxTokens: 512,
59
- // 100k-message corpus, one 8-thread session on Ryzen AI 9 HX 470: 31–32 chunks/s.
60
- chunksPerSecond: 31,
61
- pooling: "mean",
62
- prefix: { query: "query: ", passage: "passage: " },
63
- onnx: "onnx/model_quantized.onnx",
64
- files: [
65
- {
66
- name: "onnx/model_quantized.onnx",
67
- url: e5("onnx/model_quantized.onnx"),
68
- sha256: "f80102d3f2a1229f387d3c81909990d8945513e347b0eab049f7de3c6f98c193",
69
- bytes: 118308185
70
- },
71
- {
72
- name: "tokenizer.json",
73
- url: e5("tokenizer.json"),
74
- sha256: "0b44a9d7b51c3c62626640cda0e2c2f70fdacdc25bbbd68038369d14ebdf4c39",
75
- bytes: 17082730
76
- },
77
- {
78
- name: "tokenizer_config.json",
79
- url: e5("tokenizer_config.json"),
80
- sha256: "a1d6bc8734a6f635dc158508bef000f8e2e5a759c7d92f984b2c86e5ff53425b",
81
- bytes: 443
82
- }
83
- ]
84
- },
85
- {
86
- id: "embeddinggemma",
87
- title: "EmbeddingGemma 300M, 4-bit",
88
- size: "medium",
89
- languages: "over 100 languages \u2014 the best of the two on chat, about seven times slower",
90
- licence: "Gemma Terms of Use",
91
- terms: "https://ai.google.dev/gemma/terms",
92
- // Gemma Terms of Use §3.1: every copy carries this notice and the use restrictions of §3.2.
93
- notice: "Gemma is provided under and subject to the Gemma Terms of Use found at ai.google.dev/gemma/terms. Its use is restricted by the Gemma Prohibited Use Policy: https://ai.google.dev/gemma/prohibited_use_policy",
94
- dims: 768,
95
- maxTokens: 2048,
96
- // 2026-11-08, 1,200-character chunks, 8 threads on the Ryzen AI 9 HX 470: 8.3 chunks/s against e5-small's 52.7, so
97
- // 5 on the scale e5-small's 31 sets. It was 2, which held a memo sync to 39 chunks.
98
- chunksPerSecond: 5,
99
- pooling: "sentence_embedding",
100
- prefix: { query: "task: search result | query: ", passage: "title: none | text: " },
101
- onnx: "onnx/model_q4.onnx",
102
- externalData: "onnx/model_q4.onnx_data",
103
- files: [
104
- {
105
- name: "onnx/model_q4.onnx",
106
- url: gemma("onnx/model_q4.onnx"),
107
- sha256: "ad1dfee81a70f7944b9b9d1cc6e48075b832881cf33fab2f2b248be78f3f0043",
108
- bytes: 519322
109
- },
110
- {
111
- name: "onnx/model_q4.onnx_data",
112
- url: gemma("onnx/model_q4.onnx_data"),
113
- sha256: "599962c3143b040de2dd05e5975be3e9091dd067cacc6a8f7186e3203bab9e02",
114
- bytes: 196725760
115
- },
116
- {
117
- name: "tokenizer.json",
118
- url: gemma("tokenizer.json"),
119
- sha256: "4dda02faaf32bc91031dc8c88457ac272b00c1016cc679757d1c441b248b9c47",
120
- bytes: 20323312
121
- },
122
- {
123
- name: "tokenizer_config.json",
124
- url: gemma("tokenizer_config.json"),
125
- sha256: "3ca953eea6c3c9fcda9cf3df22949ff18b216f7c74bd6459230f3f1013953f3a",
126
- bytes: 1156830
127
- }
128
- ]
129
- },
130
- {
131
- id: "e5-large",
132
- title: "multilingual-e5-large, 8-bit",
133
- size: "large",
134
- languages: "about 100 languages, Russian and English among them \u2014 reads better than e5-small, several times slower",
135
- licence: "MIT",
136
- dims: 1024,
137
- maxTokens: 512,
138
- // 2026-11-07, one 8-thread session on the Ryzen AI 9 HX 470 while other benchmarks ran: 3.4 chunks/s.
139
- chunksPerSecond: 4,
140
- pooling: "mean",
141
- prefix: { query: "query: ", passage: "passage: " },
142
- onnx: "onnx/model_quantized.onnx",
143
- files: [
144
- {
145
- name: "onnx/model_quantized.onnx",
146
- url: e5Large("onnx/model_quantized.onnx"),
147
- sha256: "0a8d65db9a36f810ba5da15249f13145fcdc7890e6656f1fd38cd8b7c4db1fca",
148
- bytes: 561768762
149
- },
150
- {
151
- name: "tokenizer.json",
152
- url: e5Large("tokenizer.json"),
153
- sha256: "62c24cdc13d4c9952d63718d6c9fa4c287974249e16b7ade6d5a85e7bbb75626",
154
- bytes: 17082660
155
- },
156
- {
157
- name: "tokenizer_config.json",
158
- url: e5Large("tokenizer_config.json"),
159
- sha256: "efb5c0d09722e5fe59a462cd2a9976ee216d55b037597d997cd3fe833216da15",
160
- bytes: 418
161
- }
162
- ]
163
- }
164
- ];
165
- var DEFAULT_TEXT_MODEL = "embeddinggemma";
166
- var PREVIOUS_DEFAULT_TEXT_MODEL = "e5-small";
167
- var SECTION = "text_models";
168
- var slug = pipe(string(), regex(/^[a-z0-9][a-z0-9._-]{0,62}$/, "is not a model id: a-z, 0-9, . _ -"));
169
- var words = pipe(string(), trim(), minLength(1), maxLength(300));
170
- var fileName = pipe(string(), check((name) => /^[\w.-]+(\/[\w.-]+)*$/.test(name) && !name.split("/").some((part) => part === ".." || part === "."), "is not a file inside the model's folder"));
171
- var modelFile = strictObject({
172
- name: fileName,
173
- url: pipe(string(), url(), startsWith("https://", "has to be an https address")),
174
- sha256: pipe(string(), regex(/^[0-9a-f]{64}$/, "has to be a sha256 in hex")),
175
- bytes: pipe(number(), integer(), minValue(1))
176
- });
177
- var CustomTextModelShape = pipe(strictObject({
178
- id: slug,
179
- title: words,
180
- languages: words,
181
- licence: words,
182
- terms: optional(pipe(string(), url())),
183
- dims: pipe(number(), integer(), minValue(1), maxValue(8192)),
184
- maxTokens: pipe(number(), integer(), minValue(16), maxValue(32768)),
185
- chunksPerSecond: optional(pipe(number(), minValue(0.01))),
186
- pooling: picklist(["mean", "sentence_embedding"]),
187
- prefix: strictObject({
188
- query: pipe(string(), maxLength(200)),
189
- passage: pipe(string(), maxLength(200))
190
- }),
191
- onnx: fileName,
192
- externalData: optional(fileName),
193
- files: pipe(array(modelFile), minLength(1), maxLength(16))
194
- }), check((model) => !TEXT_MODELS.some((one) => one.id === model.id), "takes the id of a model this version ships; choose another"), check((model) => {
195
- const names = model.files.map(({ name }) => name);
196
- return [model.onnx, model.externalData, "tokenizer.json", "tokenizer_config.json"].every((name) => name === void 0 || names.includes(name));
197
- }, "has to list its onnx file, its external data and tokenizer.json and tokenizer_config.json among files"));
198
- var TextModelsSection = strictObject({
199
- use: optional(slug),
200
- custom: optional(array(CustomTextModelShape))
201
- });
202
- var textModelsFile = /* @__PURE__ */ __name((env = process.env) => sharedConfigPath(storePath(env), env), "textModelsFile");
203
- var readTextModelsSection = /* @__PURE__ */ __name((env = process.env) => {
204
- const path = textModelsFile(env);
205
- const section = readSharedSection(path, SECTION);
206
- if (section === void 0)
207
- return {};
208
- const checked = safeParse(TextModelsSection, section);
209
- if (!checked.success) {
210
- const issue = checked.issues[0];
211
- const at = issue ? getDotPath(issue) : null;
212
- throw new CliError("configuration_error", `${path}: ${SECTION}${at ? `.${at}` : ""} ${issue?.message ?? "is not valid"}`);
213
- }
214
- const ids = checked.output.custom?.map(({ id }) => id) ?? [];
215
- const twice = ids.find((id, at) => ids.indexOf(id) !== at);
216
- if (twice)
217
- throw new CliError("configuration_error", `${path}: ${SECTION}.custom names ${twice} twice`);
218
- return checked.output;
219
- }, "readTextModelsSection");
220
- var writeTextModelsSection = /* @__PURE__ */ __name((section, env = process.env) => writeSharedSection(textModelsFile(env), SECTION, section.use === void 0 && !section.custom?.length ? void 0 : section), "writeTextModelsSection");
221
- var textModels = /* @__PURE__ */ __name((env = process.env) => [
222
- ...TEXT_MODELS,
223
- ...(readTextModelsSection(env).custom ?? []).map((model) => ({ ...model, custom: true }))
224
- ], "textModels");
225
- var textModel = /* @__PURE__ */ __name((id, env = process.env) => {
226
- const known = textModels(env);
227
- const found = known.find((model) => model.id === id);
228
- if (!found) {
229
- throw new CliError("validation_error", `no text model ${id} \u2014 one of: ${known.map((model) => model.id).join(", ")}`);
230
- }
231
- return found;
232
- }, "textModel");
233
- var downloaded = /* @__PURE__ */ __name((id, env) => {
234
- const model = TEXT_MODELS.find((one) => one.id === id);
235
- const directory = sharedModelsDirectory("text", env);
236
- return model !== void 0 && filesPresent(model.files.map((file) => [file, join(directory, model.id, file.name)]));
237
- }, "downloaded");
238
- var chosenTextModel = /* @__PURE__ */ __name((env = process.env) => {
239
- const use = readTextModelsSection(env).use;
240
- if (use !== void 0)
241
- return { id: use, from: "chosen" };
242
- const kept = !downloaded(DEFAULT_TEXT_MODEL, env) && existsSync(join(sharedModelsDirectory("text", env), PREVIOUS_DEFAULT_TEXT_MODEL));
243
- return { id: kept ? PREVIOUS_DEFAULT_TEXT_MODEL : DEFAULT_TEXT_MODEL, from: "default" };
244
- }, "chosenTextModel");
245
- var mmarco = huggingFace("cross-encoder/mmarco-mMiniLMv2-L12-H384-v1", "1427fd652930e4ba29e8149678df786c240d8825");
246
- var bge = huggingFace("onnx-community/bge-reranker-v2-m3-ONNX", "6f5ff65298512715a1e669753bc754d2bc8f367b");
247
- var RERANK_MODELS = [
248
- {
249
- id: "mmarco",
250
- title: "mMARCO mMiniLMv2-L12 cross-encoder, 8-bit",
251
- languages: "about 100 languages, Russian and English among them",
252
- licence: "Apache-2.0",
253
- maxTokens: 512,
254
- // The x86 name is the quantizer's target; WebAssembly and native ONNX Runtime both run it on any processor.
255
- onnx: "onnx/model_quint8_avx2.onnx",
256
- files: [
257
- {
258
- name: "onnx/model_quint8_avx2.onnx",
259
- url: mmarco("onnx/model_quint8_avx2.onnx"),
260
- sha256: "6c2513767fb63d008a4377bef7a7a3555433d9436342bb53e35a3a72ffc52d4b",
261
- bytes: 118620016
262
- },
263
- {
264
- name: "tokenizer.json",
265
- url: mmarco("tokenizer.json"),
266
- sha256: "62c24cdc13d4c9952d63718d6c9fa4c287974249e16b7ade6d5a85e7bbb75626",
267
- bytes: 17082660
268
- },
269
- {
270
- name: "tokenizer_config.json",
271
- url: mmarco("tokenizer_config.json"),
272
- sha256: "e7fbfbfa6347b4e414c1cee50d142e2c2f9a895dad68b068ae83a8b564c3837e",
273
- bytes: 435
274
- }
275
- ]
276
- },
277
- {
278
- id: "bge-reranker-v2-m3",
279
- title: "BGE reranker v2 m3, 8-bit",
280
- languages: "over 100 languages \u2014 better than mmarco in the benchmark, about seven times slower",
281
- licence: "Apache-2.0 (BAAI's; the ONNX export declares none)",
282
- maxTokens: 512,
283
- onnx: "onnx/model_quantized.onnx",
284
- files: [
285
- {
286
- name: "onnx/model_quantized.onnx",
287
- url: bge("onnx/model_quantized.onnx"),
288
- sha256: "912fc1215c2dbff6499700534bd8d31253af01573861abbfc43afd1fab6cce5d",
289
- bytes: 570727094
290
- },
291
- {
292
- name: "tokenizer.json",
293
- url: bge("tokenizer.json"),
294
- sha256: "8bf8afbfd11306bd872018c53bfdf2e160a56f8edbcf49933324404791c148d3",
295
- bytes: 17082900
296
- },
297
- {
298
- name: "tokenizer_config.json",
299
- url: bge("tokenizer_config.json"),
300
- sha256: "b87c8703482b0300d3da30e201519aa641f6a450f5eb5bf1e624afbf70c74d80",
301
- bytes: 1203
302
- }
303
- ]
304
- }
305
- ];
306
- var DEFAULT_RERANK_MODEL = "mmarco";
307
- var rerankModel = /* @__PURE__ */ __name((id) => {
308
- const found = RERANK_MODELS.find((model) => model.id === id);
309
- if (!found) {
310
- throw new CliError("validation_error", `no reranker ${id} \u2014 one of: ${RERANK_MODELS.map((model) => model.id).join(", ")}`);
311
- }
312
- return found;
313
- }, "rerankModel");
314
- var vectorModelKey = /* @__PURE__ */ __name((model) => {
315
- const weights = model.custom ? model.files.find(({ name }) => name === model.onnx)?.sha256.slice(0, 12) : void 0;
316
- return `local:${model.id}${weights ? `@${weights}` : ""}:${model.dims}`;
317
- }, "vectorModelKey");
318
- var meaningFloor = /* @__PURE__ */ __name((key) => key === "local:e5-small:384" ? 0.8 : 0, "meaningFloor");
319
-
320
- export {
321
- DEFAULT_TEXT_MODEL,
322
- PREVIOUS_DEFAULT_TEXT_MODEL,
323
- CustomTextModelShape,
324
- readTextModelsSection,
325
- writeTextModelsSection,
326
- textModels,
327
- textModel,
328
- chosenTextModel,
329
- RERANK_MODELS,
330
- DEFAULT_RERANK_MODEL,
331
- rerankModel,
332
- vectorModelKey,
333
- meaningFloor
334
- };
@@ -1,79 +0,0 @@
1
- import { createRequire as __bundleRequire } from "node:module";
2
- const require = __bundleRequire(import.meta.url);
3
- import {
4
- QUERY_LIMITS,
5
- queryError
6
- } from "./chunk-DSJ6EAOA.js";
7
- import {
8
- CliError,
9
- isCliError
10
- } from "./chunk-S6JG4YUH.js";
11
- import {
12
- __name
13
- } from "./chunk-ZVVMGPBJ.js";
14
-
15
- // node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/search/lucene/types.js
16
- var QUERY_VERSION = 1;
17
- var QUERY_LIMITS2 = {
18
- ...QUERY_LIMITS,
19
- pattern: 1024,
20
- states: 1e4,
21
- expansions: 1e4,
22
- candidates: 5e4,
23
- bodyBytes: 8388608,
24
- milliseconds: 2e3,
25
- work: 1e7
26
- };
27
- var SEARCH_QUERY = {
28
- command: "search",
29
- guide: "https://github.com/WireCatLabs/cli-core/blob/main/docs/search/query-language.md"
30
- };
31
- var MESSAGE_PARSING = { ...SEARCH_QUERY, proximity: true };
32
- var MOST_WORDS_APART = 50;
33
- function searchError(reason, span, alternative) {
34
- queryError(reason, span, alternative, SEARCH_QUERY);
35
- }
36
- __name(searchError, "searchError");
37
- var ANSWER_MS = 1e3;
38
- var searchTimeLimit = /* @__PURE__ */ __name((deadline, now = Date.now()) => deadline?.explicit ? Math.max(QUERY_LIMITS2.milliseconds, deadline.endsAt - now - ANSWER_MS) : void 0, "searchTimeLimit");
39
- function outOfTime(limitMs = QUERY_LIMITS2.milliseconds) {
40
- throw new CliError("timeout", `search stopped at its time limit of ${limitMs / 1e3}s \u2014 the query is valid; add chat: or date: to search less of the store`, { reason: "query.time-limit", budget: "time", limit_ms: limitMs, complete: false });
41
- }
42
- __name(outOfTime, "outOfTime");
43
- var isQueryLimit = /* @__PURE__ */ __name((error) => isCliError(error) && (error.details.reason === "query.too-large" || error.details.reason === "query.time-limit"), "isQueryLimit");
44
- var SQLITE_TOO_LARGE = /nested too deep|too many terms in compound SELECT|Expression tree is too large|parser stack overflow/;
45
- var sqliteLimit = /* @__PURE__ */ __name((error) => {
46
- if (error instanceof Error && SQLITE_TOO_LARGE.test(error.message))
47
- exhausted("nodes");
48
- return error;
49
- }, "sqliteLimit");
50
- function exhausted(budget) {
51
- throw new CliError("validation_error", `search exceeded its ${budget} budget \u2014 narrow the chat or date range`, {
52
- reason: "query.too-large",
53
- budget,
54
- complete: false
55
- });
56
- }
57
- __name(exhausted, "exhausted");
58
- function tooWideTerm([term], budget) {
59
- if (term === void 0)
60
- exhausted(budget);
61
- const part = term.replace(/[*?]+/gu, " ").trim().split(/\s+/u).sort((a, b) => b.length - a.length)[0] ?? term;
62
- throw new CliError("validation_error", `search exceeded its ${budget} budget: ${term} is checked word by word, and too many messages hold it \u2014 write *${part}* (any word holding it, read from the index), more of the word, or add chat: or date:`, { reason: "query.too-large", budget, term, complete: false });
63
- }
64
- __name(tooWideTerm, "tooWideTerm");
65
-
66
- export {
67
- QUERY_VERSION,
68
- QUERY_LIMITS2 as QUERY_LIMITS,
69
- SEARCH_QUERY,
70
- MESSAGE_PARSING,
71
- MOST_WORDS_APART,
72
- searchError,
73
- searchTimeLimit,
74
- outOfTime,
75
- isQueryLimit,
76
- sqliteLimit,
77
- exhausted,
78
- tooWideTerm
79
- };