@xopcai/xopcbot 0.1.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 (535) hide show
  1. package/README.md +132 -0
  2. package/README.zh-CN.md +130 -0
  3. package/dist/__tests__/core.test.d.ts +1 -0
  4. package/dist/__tests__/core.test.js +72 -0
  5. package/dist/__tests__/core.test.js.map +1 -0
  6. package/dist/agent/fallback/__tests__/index.test.d.ts +1 -0
  7. package/dist/agent/fallback/__tests__/index.test.js +111 -0
  8. package/dist/agent/fallback/__tests__/index.test.js.map +1 -0
  9. package/dist/agent/fallback/candidates.d.ts +23 -0
  10. package/dist/agent/fallback/candidates.js +62 -0
  11. package/dist/agent/fallback/candidates.js.map +1 -0
  12. package/dist/agent/fallback/error.d.ts +22 -0
  13. package/dist/agent/fallback/error.js +27 -0
  14. package/dist/agent/fallback/error.js.map +1 -0
  15. package/dist/agent/fallback/index.d.ts +6 -0
  16. package/dist/agent/fallback/index.js +5 -0
  17. package/dist/agent/fallback/index.js.map +1 -0
  18. package/dist/agent/fallback/reason.d.ts +7 -0
  19. package/dist/agent/fallback/reason.js +78 -0
  20. package/dist/agent/fallback/reason.js.map +1 -0
  21. package/dist/agent/fallback/runner.d.ts +22 -0
  22. package/dist/agent/fallback/runner.js +34 -0
  23. package/dist/agent/fallback/runner.js.map +1 -0
  24. package/dist/agent/helpers.d.ts +38 -0
  25. package/dist/agent/helpers.js +122 -0
  26. package/dist/agent/helpers.js.map +1 -0
  27. package/dist/agent/index.d.ts +7 -0
  28. package/dist/agent/index.js +7 -0
  29. package/dist/agent/index.js.map +1 -0
  30. package/dist/agent/memory/compaction.d.ts +63 -0
  31. package/dist/agent/memory/compaction.js +233 -0
  32. package/dist/agent/memory/compaction.js.map +1 -0
  33. package/dist/agent/memory/window.d.ts +29 -0
  34. package/dist/agent/memory/window.js +64 -0
  35. package/dist/agent/memory/window.js.map +1 -0
  36. package/dist/agent/model-manager.d.ts +80 -0
  37. package/dist/agent/model-manager.js +213 -0
  38. package/dist/agent/model-manager.js.map +1 -0
  39. package/dist/agent/prompt/heartbeat.d.ts +97 -0
  40. package/dist/agent/prompt/heartbeat.js +313 -0
  41. package/dist/agent/prompt/heartbeat.js.map +1 -0
  42. package/dist/agent/prompt/index.d.ts +65 -0
  43. package/dist/agent/prompt/index.js +215 -0
  44. package/dist/agent/prompt/index.js.map +1 -0
  45. package/dist/agent/prompt/memory/index.d.ts +37 -0
  46. package/dist/agent/prompt/memory/index.js +241 -0
  47. package/dist/agent/prompt/memory/index.js.map +1 -0
  48. package/dist/agent/prompt/modes.d.ts +44 -0
  49. package/dist/agent/prompt/modes.js +167 -0
  50. package/dist/agent/prompt/modes.js.map +1 -0
  51. package/dist/agent/prompt/safety.d.ts +88 -0
  52. package/dist/agent/prompt/safety.js +290 -0
  53. package/dist/agent/prompt/safety.js.map +1 -0
  54. package/dist/agent/service.d.ts +91 -0
  55. package/dist/agent/service.js +641 -0
  56. package/dist/agent/service.js.map +1 -0
  57. package/dist/agent/session-tracker.d.ts +73 -0
  58. package/dist/agent/session-tracker.js +137 -0
  59. package/dist/agent/session-tracker.js.map +1 -0
  60. package/dist/agent/skills/__tests__/test-framework.test.d.ts +4 -0
  61. package/dist/agent/skills/__tests__/test-framework.test.js +343 -0
  62. package/dist/agent/skills/__tests__/test-framework.test.js.map +1 -0
  63. package/dist/agent/skills/config.d.ts +58 -0
  64. package/dist/agent/skills/config.js +212 -0
  65. package/dist/agent/skills/config.js.map +1 -0
  66. package/dist/agent/skills/index.d.ts +25 -0
  67. package/dist/agent/skills/index.js +349 -0
  68. package/dist/agent/skills/index.js.map +1 -0
  69. package/dist/agent/skills/installer.d.ts +38 -0
  70. package/dist/agent/skills/installer.js +352 -0
  71. package/dist/agent/skills/installer.js.map +1 -0
  72. package/dist/agent/skills/scanner.d.ts +32 -0
  73. package/dist/agent/skills/scanner.js +265 -0
  74. package/dist/agent/skills/scanner.js.map +1 -0
  75. package/dist/agent/skills/test-framework.d.ts +107 -0
  76. package/dist/agent/skills/test-framework.js +607 -0
  77. package/dist/agent/skills/test-framework.js.map +1 -0
  78. package/dist/agent/skills/types.d.ts +181 -0
  79. package/dist/agent/skills/types.js +7 -0
  80. package/dist/agent/skills/types.js.map +1 -0
  81. package/dist/agent/skills/watcher.d.ts +37 -0
  82. package/dist/agent/skills/watcher.js +124 -0
  83. package/dist/agent/skills/watcher.js.map +1 -0
  84. package/dist/agent/tools/communication.d.ts +18 -0
  85. package/dist/agent/tools/communication.js +56 -0
  86. package/dist/agent/tools/communication.js.map +1 -0
  87. package/dist/agent/tools/edit-diff.d.ts +21 -0
  88. package/dist/agent/tools/edit-diff.js +69 -0
  89. package/dist/agent/tools/edit-diff.js.map +1 -0
  90. package/dist/agent/tools/edit.d.ts +13 -0
  91. package/dist/agent/tools/edit.js +65 -0
  92. package/dist/agent/tools/edit.js.map +1 -0
  93. package/dist/agent/tools/find.d.ts +24 -0
  94. package/dist/agent/tools/find.js +99 -0
  95. package/dist/agent/tools/find.js.map +1 -0
  96. package/dist/agent/tools/grep.d.ts +33 -0
  97. package/dist/agent/tools/grep.js +183 -0
  98. package/dist/agent/tools/grep.js.map +1 -0
  99. package/dist/agent/tools/index.d.ts +13 -0
  100. package/dist/agent/tools/index.js +18 -0
  101. package/dist/agent/tools/index.js.map +1 -0
  102. package/dist/agent/tools/list-dir.d.ts +6 -0
  103. package/dist/agent/tools/list-dir.js +37 -0
  104. package/dist/agent/tools/list-dir.js.map +1 -0
  105. package/dist/agent/tools/memory-tool.d.ts +14 -0
  106. package/dist/agent/tools/memory-tool.js +81 -0
  107. package/dist/agent/tools/memory-tool.js.map +1 -0
  108. package/dist/agent/tools/path-utils.d.ts +4 -0
  109. package/dist/agent/tools/path-utils.js +13 -0
  110. package/dist/agent/tools/path-utils.js.map +1 -0
  111. package/dist/agent/tools/read.d.ts +7 -0
  112. package/dist/agent/tools/read.js +47 -0
  113. package/dist/agent/tools/read.js.map +1 -0
  114. package/dist/agent/tools/send-media.d.ts +18 -0
  115. package/dist/agent/tools/send-media.js +104 -0
  116. package/dist/agent/tools/send-media.js.map +1 -0
  117. package/dist/agent/tools/shell.d.ts +13 -0
  118. package/dist/agent/tools/shell.js +114 -0
  119. package/dist/agent/tools/shell.js.map +1 -0
  120. package/dist/agent/tools/truncate.d.ts +36 -0
  121. package/dist/agent/tools/truncate.js +98 -0
  122. package/dist/agent/tools/truncate.js.map +1 -0
  123. package/dist/agent/tools/web.d.ts +14 -0
  124. package/dist/agent/tools/web.js +109 -0
  125. package/dist/agent/tools/web.js.map +1 -0
  126. package/dist/agent/tools/write.d.ts +7 -0
  127. package/dist/agent/tools/write.js +35 -0
  128. package/dist/agent/tools/write.js.map +1 -0
  129. package/dist/agent/types.d.ts +8 -0
  130. package/dist/agent/types.js +2 -0
  131. package/dist/agent/types.js.map +1 -0
  132. package/dist/agent/typing.d.ts +9 -0
  133. package/dist/agent/typing.js +32 -0
  134. package/dist/agent/typing.js.map +1 -0
  135. package/dist/auth/index.d.ts +12 -0
  136. package/dist/auth/index.js +14 -0
  137. package/dist/auth/index.js.map +1 -0
  138. package/dist/auth/oauth/anthropic.d.ts +7 -0
  139. package/dist/auth/oauth/anthropic.js +89 -0
  140. package/dist/auth/oauth/anthropic.js.map +1 -0
  141. package/dist/auth/oauth/github-copilot.d.ts +8 -0
  142. package/dist/auth/oauth/github-copilot.js +35 -0
  143. package/dist/auth/oauth/github-copilot.js.map +1 -0
  144. package/dist/auth/oauth/google-antigravity.d.ts +7 -0
  145. package/dist/auth/oauth/google-antigravity.js +27 -0
  146. package/dist/auth/oauth/google-antigravity.js.map +1 -0
  147. package/dist/auth/oauth/google-gemini-cli.d.ts +7 -0
  148. package/dist/auth/oauth/google-gemini-cli.js +28 -0
  149. package/dist/auth/oauth/google-gemini-cli.js.map +1 -0
  150. package/dist/auth/oauth/index.d.ts +14 -0
  151. package/dist/auth/oauth/index.js +15 -0
  152. package/dist/auth/oauth/index.js.map +1 -0
  153. package/dist/auth/oauth/kimi.d.ts +8 -0
  154. package/dist/auth/oauth/kimi.js +104 -0
  155. package/dist/auth/oauth/kimi.js.map +1 -0
  156. package/dist/auth/oauth/minimax.d.ts +8 -0
  157. package/dist/auth/oauth/minimax.js +109 -0
  158. package/dist/auth/oauth/minimax.js.map +1 -0
  159. package/dist/auth/oauth/openai-codex.d.ts +7 -0
  160. package/dist/auth/oauth/openai-codex.js +33 -0
  161. package/dist/auth/oauth/openai-codex.js.map +1 -0
  162. package/dist/auth/oauth/pkce.d.ts +8 -0
  163. package/dist/auth/oauth/pkce.js +22 -0
  164. package/dist/auth/oauth/pkce.js.map +1 -0
  165. package/dist/auth/oauth/qwen.d.ts +7 -0
  166. package/dist/auth/oauth/qwen.js +114 -0
  167. package/dist/auth/oauth/qwen.js.map +1 -0
  168. package/dist/auth/oauth/types.d.ts +46 -0
  169. package/dist/auth/oauth/types.js +7 -0
  170. package/dist/auth/oauth/types.js.map +1 -0
  171. package/dist/auth/profiles/index.d.ts +16 -0
  172. package/dist/auth/profiles/index.js +17 -0
  173. package/dist/auth/profiles/index.js.map +1 -0
  174. package/dist/auth/profiles/oauth.d.ts +12 -0
  175. package/dist/auth/profiles/oauth.js +106 -0
  176. package/dist/auth/profiles/oauth.js.map +1 -0
  177. package/dist/auth/profiles/order.d.ts +19 -0
  178. package/dist/auth/profiles/order.js +63 -0
  179. package/dist/auth/profiles/order.js.map +1 -0
  180. package/dist/auth/profiles/profiles.d.ts +27 -0
  181. package/dist/auth/profiles/profiles.js +110 -0
  182. package/dist/auth/profiles/profiles.js.map +1 -0
  183. package/dist/auth/profiles/store.d.ts +17 -0
  184. package/dist/auth/profiles/store.js +234 -0
  185. package/dist/auth/profiles/store.js.map +1 -0
  186. package/dist/auth/profiles/types.d.ts +64 -0
  187. package/dist/auth/profiles/types.js +7 -0
  188. package/dist/auth/profiles/types.js.map +1 -0
  189. package/dist/auth/profiles/usage.d.ts +24 -0
  190. package/dist/auth/profiles/usage.js +99 -0
  191. package/dist/auth/profiles/usage.js.map +1 -0
  192. package/dist/auth/storage.d.ts +99 -0
  193. package/dist/auth/storage.js +315 -0
  194. package/dist/auth/storage.js.map +1 -0
  195. package/dist/bus/index.d.ts +3 -0
  196. package/dist/bus/index.js +2 -0
  197. package/dist/bus/index.js.map +1 -0
  198. package/dist/bus/queue.d.ts +20 -0
  199. package/dist/bus/queue.js +57 -0
  200. package/dist/bus/queue.js.map +1 -0
  201. package/dist/channels/__tests__/access-control.test.d.ts +4 -0
  202. package/dist/channels/__tests__/access-control.test.js +310 -0
  203. package/dist/channels/__tests__/access-control.test.js.map +1 -0
  204. package/dist/channels/__tests__/draft-stream.test.d.ts +4 -0
  205. package/dist/channels/__tests__/draft-stream.test.js +243 -0
  206. package/dist/channels/__tests__/draft-stream.test.js.map +1 -0
  207. package/dist/channels/__tests__/format.test.d.ts +4 -0
  208. package/dist/channels/__tests__/format.test.js +146 -0
  209. package/dist/channels/__tests__/format.test.js.map +1 -0
  210. package/dist/channels/__tests__/manager.test.d.ts +6 -0
  211. package/dist/channels/__tests__/manager.test.js +34 -0
  212. package/dist/channels/__tests__/manager.test.js.map +1 -0
  213. package/dist/channels/__tests__/typing-controller.test.d.ts +4 -0
  214. package/dist/channels/__tests__/typing-controller.test.js +109 -0
  215. package/dist/channels/__tests__/typing-controller.test.js.map +1 -0
  216. package/dist/channels/__tests__/update-offset-store.test.d.ts +7 -0
  217. package/dist/channels/__tests__/update-offset-store.test.js +35 -0
  218. package/dist/channels/__tests__/update-offset-store.test.js.map +1 -0
  219. package/dist/channels/access-control.d.ts +93 -0
  220. package/dist/channels/access-control.js +201 -0
  221. package/dist/channels/access-control.js.map +1 -0
  222. package/dist/channels/draft-stream.d.ts +55 -0
  223. package/dist/channels/draft-stream.js +211 -0
  224. package/dist/channels/draft-stream.js.map +1 -0
  225. package/dist/channels/format.d.ts +38 -0
  226. package/dist/channels/format.js +187 -0
  227. package/dist/channels/format.js.map +1 -0
  228. package/dist/channels/index.d.ts +22 -0
  229. package/dist/channels/index.js +23 -0
  230. package/dist/channels/index.js.map +1 -0
  231. package/dist/channels/manager.d.ts +30 -0
  232. package/dist/channels/manager.js +125 -0
  233. package/dist/channels/manager.js.map +1 -0
  234. package/dist/channels/telegram/__tests__/index.test.d.ts +4 -0
  235. package/dist/channels/telegram/__tests__/index.test.js +153 -0
  236. package/dist/channels/telegram/__tests__/index.test.js.map +1 -0
  237. package/dist/channels/telegram/__tests__/inline-keyboards.test.d.ts +4 -0
  238. package/dist/channels/telegram/__tests__/inline-keyboards.test.js +99 -0
  239. package/dist/channels/telegram/__tests__/inline-keyboards.test.js.map +1 -0
  240. package/dist/channels/telegram/client.d.ts +48 -0
  241. package/dist/channels/telegram/client.js +177 -0
  242. package/dist/channels/telegram/client.js.map +1 -0
  243. package/dist/channels/telegram/command-handler.d.ts +28 -0
  244. package/dist/channels/telegram/command-handler.js +209 -0
  245. package/dist/channels/telegram/command-handler.js.map +1 -0
  246. package/dist/channels/telegram/index.d.ts +8 -0
  247. package/dist/channels/telegram/index.js +9 -0
  248. package/dist/channels/telegram/index.js.map +1 -0
  249. package/dist/channels/telegram/inline-keyboards.d.ts +20 -0
  250. package/dist/channels/telegram/inline-keyboards.js +38 -0
  251. package/dist/channels/telegram/inline-keyboards.js.map +1 -0
  252. package/dist/channels/telegram/plugin.d.ts +33 -0
  253. package/dist/channels/telegram/plugin.js +640 -0
  254. package/dist/channels/telegram/plugin.js.map +1 -0
  255. package/dist/channels/telegram/webhook.d.ts +31 -0
  256. package/dist/channels/telegram/webhook.js +129 -0
  257. package/dist/channels/telegram/webhook.js.map +1 -0
  258. package/dist/channels/types.d.ts +186 -0
  259. package/dist/channels/types.js +7 -0
  260. package/dist/channels/types.js.map +1 -0
  261. package/dist/channels/typing-controller.d.ts +47 -0
  262. package/dist/channels/typing-controller.js +117 -0
  263. package/dist/channels/typing-controller.js.map +1 -0
  264. package/dist/channels/update-offset-store.d.ts +37 -0
  265. package/dist/channels/update-offset-store.js +165 -0
  266. package/dist/channels/update-offset-store.js.map +1 -0
  267. package/dist/channels/whatsapp/index.d.ts +4 -0
  268. package/dist/channels/whatsapp/index.js +5 -0
  269. package/dist/channels/whatsapp/index.js.map +1 -0
  270. package/dist/channels/whatsapp/plugin.d.ts +27 -0
  271. package/dist/channels/whatsapp/plugin.js +66 -0
  272. package/dist/channels/whatsapp/plugin.js.map +1 -0
  273. package/dist/cli/__tests__/registry.test.d.ts +1 -0
  274. package/dist/cli/__tests__/registry.test.js +366 -0
  275. package/dist/cli/__tests__/registry.test.js.map +1 -0
  276. package/dist/cli/commands/agent.d.ts +1 -0
  277. package/dist/cli/commands/agent.js +216 -0
  278. package/dist/cli/commands/agent.js.map +1 -0
  279. package/dist/cli/commands/auth.d.ts +6 -0
  280. package/dist/cli/commands/auth.js +440 -0
  281. package/dist/cli/commands/auth.js.map +1 -0
  282. package/dist/cli/commands/config.d.ts +1 -0
  283. package/dist/cli/commands/config.js +135 -0
  284. package/dist/cli/commands/config.js.map +1 -0
  285. package/dist/cli/commands/configure.d.ts +1 -0
  286. package/dist/cli/commands/configure.js +173 -0
  287. package/dist/cli/commands/configure.js.map +1 -0
  288. package/dist/cli/commands/cron.d.ts +1 -0
  289. package/dist/cli/commands/cron.js +81 -0
  290. package/dist/cli/commands/cron.js.map +1 -0
  291. package/dist/cli/commands/gateway.d.ts +1 -0
  292. package/dist/cli/commands/gateway.js +91 -0
  293. package/dist/cli/commands/gateway.js.map +1 -0
  294. package/dist/cli/commands/index.d.ts +0 -0
  295. package/dist/cli/commands/index.js +2 -0
  296. package/dist/cli/commands/index.js.map +1 -0
  297. package/dist/cli/commands/models.d.ts +1 -0
  298. package/dist/cli/commands/models.js +79 -0
  299. package/dist/cli/commands/models.js.map +1 -0
  300. package/dist/cli/commands/onboard.d.ts +1 -0
  301. package/dist/cli/commands/onboard.js +621 -0
  302. package/dist/cli/commands/onboard.js.map +1 -0
  303. package/dist/cli/commands/plugin.d.ts +1 -0
  304. package/dist/cli/commands/plugin.js +341 -0
  305. package/dist/cli/commands/plugin.js.map +1 -0
  306. package/dist/cli/commands/session.d.ts +1 -0
  307. package/dist/cli/commands/session.js +450 -0
  308. package/dist/cli/commands/session.js.map +1 -0
  309. package/dist/cli/commands/skills-test.d.ts +9 -0
  310. package/dist/cli/commands/skills-test.js +195 -0
  311. package/dist/cli/commands/skills-test.js.map +1 -0
  312. package/dist/cli/commands/skills.d.ts +9 -0
  313. package/dist/cli/commands/skills.js +385 -0
  314. package/dist/cli/commands/skills.js.map +1 -0
  315. package/dist/cli/index.d.ts +19 -0
  316. package/dist/cli/index.js +40 -0
  317. package/dist/cli/index.js.map +1 -0
  318. package/dist/cli/registry.d.ts +43 -0
  319. package/dist/cli/registry.js +82 -0
  320. package/dist/cli/registry.js.map +1 -0
  321. package/dist/cli/templates.d.ts +19 -0
  322. package/dist/cli/templates.js +191 -0
  323. package/dist/cli/templates.js.map +1 -0
  324. package/dist/cli/utils/colors.d.ts +13 -0
  325. package/dist/cli/utils/colors.js +16 -0
  326. package/dist/cli/utils/colors.js.map +1 -0
  327. package/dist/config/__tests__/diff.test.d.ts +1 -0
  328. package/dist/config/__tests__/diff.test.js +192 -0
  329. package/dist/config/__tests__/diff.test.js.map +1 -0
  330. package/dist/config/__tests__/loader.test.d.ts +1 -0
  331. package/dist/config/__tests__/loader.test.js +356 -0
  332. package/dist/config/__tests__/loader.test.js.map +1 -0
  333. package/dist/config/__tests__/paths.test.d.ts +1 -0
  334. package/dist/config/__tests__/paths.test.js +192 -0
  335. package/dist/config/__tests__/paths.test.js.map +1 -0
  336. package/dist/config/__tests__/reload.test.d.ts +1 -0
  337. package/dist/config/__tests__/reload.test.js +374 -0
  338. package/dist/config/__tests__/reload.test.js.map +1 -0
  339. package/dist/config/__tests__/rules.test.d.ts +1 -0
  340. package/dist/config/__tests__/rules.test.js +204 -0
  341. package/dist/config/__tests__/rules.test.js.map +1 -0
  342. package/dist/config/__tests__/schema.test.d.ts +1 -0
  343. package/dist/config/__tests__/schema.test.js +672 -0
  344. package/dist/config/__tests__/schema.test.js.map +1 -0
  345. package/dist/config/diff.d.ts +7 -0
  346. package/dist/config/diff.js +46 -0
  347. package/dist/config/diff.js.map +1 -0
  348. package/dist/config/index.d.ts +6 -0
  349. package/dist/config/index.js +7 -0
  350. package/dist/config/index.js.map +1 -0
  351. package/dist/config/loader.d.ts +5 -0
  352. package/dist/config/loader.js +81 -0
  353. package/dist/config/loader.js.map +1 -0
  354. package/dist/config/paths.d.ts +35 -0
  355. package/dist/config/paths.js +79 -0
  356. package/dist/config/paths.js.map +1 -0
  357. package/dist/config/reload.d.ts +78 -0
  358. package/dist/config/reload.js +190 -0
  359. package/dist/config/reload.js.map +1 -0
  360. package/dist/config/rules.d.ts +42 -0
  361. package/dist/config/rules.js +114 -0
  362. package/dist/config/rules.js.map +1 -0
  363. package/dist/config/schema.d.ts +1340 -0
  364. package/dist/config/schema.js +611 -0
  365. package/dist/config/schema.js.map +1 -0
  366. package/dist/cron/executor.d.ts +54 -0
  367. package/dist/cron/executor.js +364 -0
  368. package/dist/cron/executor.js.map +1 -0
  369. package/dist/cron/index.d.ts +5 -0
  370. package/dist/cron/index.js +6 -0
  371. package/dist/cron/index.js.map +1 -0
  372. package/dist/cron/persistence.d.ts +61 -0
  373. package/dist/cron/persistence.js +188 -0
  374. package/dist/cron/persistence.js.map +1 -0
  375. package/dist/cron/service.d.ts +94 -0
  376. package/dist/cron/service.js +382 -0
  377. package/dist/cron/service.js.map +1 -0
  378. package/dist/cron/types.d.ts +119 -0
  379. package/dist/cron/types.js +3 -0
  380. package/dist/cron/types.js.map +1 -0
  381. package/dist/cron/validation.d.ts +144 -0
  382. package/dist/cron/validation.js +113 -0
  383. package/dist/cron/validation.js.map +1 -0
  384. package/dist/errors/__tests__/index.test.d.ts +1 -0
  385. package/dist/errors/__tests__/index.test.js +301 -0
  386. package/dist/errors/__tests__/index.test.js.map +1 -0
  387. package/dist/errors/index.d.ts +114 -0
  388. package/dist/errors/index.js +278 -0
  389. package/dist/errors/index.js.map +1 -0
  390. package/dist/gateway/hono/app.d.ts +7 -0
  391. package/dist/gateway/hono/app.js +668 -0
  392. package/dist/gateway/hono/app.js.map +1 -0
  393. package/dist/gateway/hono/index.d.ts +2 -0
  394. package/dist/gateway/hono/index.js +3 -0
  395. package/dist/gateway/hono/index.js.map +1 -0
  396. package/dist/gateway/hono/middleware/auth.d.ts +18 -0
  397. package/dist/gateway/hono/middleware/auth.js +79 -0
  398. package/dist/gateway/hono/middleware/auth.js.map +1 -0
  399. package/dist/gateway/hono/middleware/logger.d.ts +1 -0
  400. package/dist/gateway/hono/middleware/logger.js +17 -0
  401. package/dist/gateway/hono/middleware/logger.js.map +1 -0
  402. package/dist/gateway/hono/sse.d.ts +55 -0
  403. package/dist/gateway/hono/sse.js +224 -0
  404. package/dist/gateway/hono/sse.js.map +1 -0
  405. package/dist/gateway/index.d.ts +4 -0
  406. package/dist/gateway/index.js +5 -0
  407. package/dist/gateway/index.js.map +1 -0
  408. package/dist/gateway/protocol.d.ts +28 -0
  409. package/dist/gateway/protocol.js +14 -0
  410. package/dist/gateway/protocol.js.map +1 -0
  411. package/dist/gateway/server.d.ts +19 -0
  412. package/dist/gateway/server.js +64 -0
  413. package/dist/gateway/server.js.map +1 -0
  414. package/dist/gateway/service.d.ts +265 -0
  415. package/dist/gateway/service.js +621 -0
  416. package/dist/gateway/service.js.map +1 -0
  417. package/dist/gateway/static/root/assets/main-CfIxL-cL.js +2105 -0
  418. package/dist/gateway/static/root/assets/main-CfIxL-cL.js.map +1 -0
  419. package/dist/gateway/static/root/assets/main-DndcTCgX.css +1 -0
  420. package/dist/gateway/static/root/index.html +116 -0
  421. package/dist/heartbeat/index.d.ts +1 -0
  422. package/dist/heartbeat/index.js +2 -0
  423. package/dist/heartbeat/index.js.map +1 -0
  424. package/dist/heartbeat/service.d.ts +19 -0
  425. package/dist/heartbeat/service.js +61 -0
  426. package/dist/heartbeat/service.js.map +1 -0
  427. package/dist/plugin-sdk/index.d.ts +21 -0
  428. package/dist/plugin-sdk/index.js +12 -0
  429. package/dist/plugin-sdk/index.js.map +1 -0
  430. package/dist/plugins/__tests__/api.test.d.ts +1 -0
  431. package/dist/plugins/__tests__/api.test.js +164 -0
  432. package/dist/plugins/__tests__/api.test.js.map +1 -0
  433. package/dist/plugins/__tests__/hooks.test.d.ts +1 -0
  434. package/dist/plugins/__tests__/hooks.test.js +159 -0
  435. package/dist/plugins/__tests__/hooks.test.js.map +1 -0
  436. package/dist/plugins/__tests__/loader.test.d.ts +1 -0
  437. package/dist/plugins/__tests__/loader.test.js +120 -0
  438. package/dist/plugins/__tests__/loader.test.js.map +1 -0
  439. package/dist/plugins/api.d.ts +41 -0
  440. package/dist/plugins/api.js +131 -0
  441. package/dist/plugins/api.js.map +1 -0
  442. package/dist/plugins/hooks.d.ts +153 -0
  443. package/dist/plugins/hooks.js +172 -0
  444. package/dist/plugins/hooks.js.map +1 -0
  445. package/dist/plugins/index.d.ts +11 -0
  446. package/dist/plugins/index.js +16 -0
  447. package/dist/plugins/index.js.map +1 -0
  448. package/dist/plugins/install.d.ts +59 -0
  449. package/dist/plugins/install.js +324 -0
  450. package/dist/plugins/install.js.map +1 -0
  451. package/dist/plugins/loader.d.ts +84 -0
  452. package/dist/plugins/loader.js +545 -0
  453. package/dist/plugins/loader.js.map +1 -0
  454. package/dist/plugins/types.d.ts +190 -0
  455. package/dist/plugins/types.js +7 -0
  456. package/dist/plugins/types.js.map +1 -0
  457. package/dist/providers/__tests__/registry.test.d.ts +1 -0
  458. package/dist/providers/__tests__/registry.test.js +110 -0
  459. package/dist/providers/__tests__/registry.test.js.map +1 -0
  460. package/dist/providers/api-strategies.d.ts +15 -0
  461. package/dist/providers/api-strategies.js +96 -0
  462. package/dist/providers/api-strategies.js.map +1 -0
  463. package/dist/providers/auto-discovery.d.ts +84 -0
  464. package/dist/providers/auto-discovery.js +236 -0
  465. package/dist/providers/auto-discovery.js.map +1 -0
  466. package/dist/providers/config.d.ts +25 -0
  467. package/dist/providers/config.js +42 -0
  468. package/dist/providers/config.js.map +1 -0
  469. package/dist/providers/index.d.ts +25 -0
  470. package/dist/providers/index.js +55 -0
  471. package/dist/providers/index.js.map +1 -0
  472. package/dist/providers/model-catalog.d.ts +205 -0
  473. package/dist/providers/model-catalog.js +1071 -0
  474. package/dist/providers/model-catalog.js.map +1 -0
  475. package/dist/providers/models-dev-data.d.ts +11 -0
  476. package/dist/providers/models-dev-data.js +1035 -0
  477. package/dist/providers/models-dev-data.js.map +1 -0
  478. package/dist/providers/models-dev.d.ts +30 -0
  479. package/dist/providers/models-dev.js +42 -0
  480. package/dist/providers/models-dev.js.map +1 -0
  481. package/dist/providers/pi-ai.d.ts +62 -0
  482. package/dist/providers/pi-ai.js +221 -0
  483. package/dist/providers/pi-ai.js.map +1 -0
  484. package/dist/providers/provider-catalog.d.ts +173 -0
  485. package/dist/providers/provider-catalog.js +834 -0
  486. package/dist/providers/provider-catalog.js.map +1 -0
  487. package/dist/providers/registry.d.ts +155 -0
  488. package/dist/providers/registry.js +524 -0
  489. package/dist/providers/registry.js.map +1 -0
  490. package/dist/providers/types.d.ts +95 -0
  491. package/dist/providers/types.js +7 -0
  492. package/dist/providers/types.js.map +1 -0
  493. package/dist/session/chat-manager.d.ts +49 -0
  494. package/dist/session/chat-manager.js +167 -0
  495. package/dist/session/chat-manager.js.map +1 -0
  496. package/dist/session/chat-types.d.ts +53 -0
  497. package/dist/session/chat-types.js +63 -0
  498. package/dist/session/chat-types.js.map +1 -0
  499. package/dist/session/index.d.ts +5 -0
  500. package/dist/session/index.js +5 -0
  501. package/dist/session/index.js.map +1 -0
  502. package/dist/session/manager.d.ts +103 -0
  503. package/dist/session/manager.js +200 -0
  504. package/dist/session/manager.js.map +1 -0
  505. package/dist/session/store.d.ts +114 -0
  506. package/dist/session/store.js +687 -0
  507. package/dist/session/store.js.map +1 -0
  508. package/dist/session/types.d.ts +88 -0
  509. package/dist/session/types.js +10 -0
  510. package/dist/session/types.js.map +1 -0
  511. package/dist/types/index.d.ts +177 -0
  512. package/dist/types/index.js +4 -0
  513. package/dist/types/index.js.map +1 -0
  514. package/dist/types/providers.d.ts +67 -0
  515. package/dist/types/providers.js +7 -0
  516. package/dist/types/providers.js.map +1 -0
  517. package/dist/utils/frontmatter.d.ts +17 -0
  518. package/dist/utils/frontmatter.js +104 -0
  519. package/dist/utils/frontmatter.js.map +1 -0
  520. package/dist/utils/helpers.d.ts +5 -0
  521. package/dist/utils/helpers.js +36 -0
  522. package/dist/utils/helpers.js.map +1 -0
  523. package/dist/utils/index.d.ts +2 -0
  524. package/dist/utils/index.js +3 -0
  525. package/dist/utils/index.js.map +1 -0
  526. package/dist/utils/log-store.d.ts +78 -0
  527. package/dist/utils/log-store.js +432 -0
  528. package/dist/utils/log-store.js.map +1 -0
  529. package/dist/utils/logger.d.ts +127 -0
  530. package/dist/utils/logger.js +481 -0
  531. package/dist/utils/logger.js.map +1 -0
  532. package/dist/utils/logger.types.d.ts +152 -0
  533. package/dist/utils/logger.types.js +30 -0
  534. package/dist/utils/logger.types.js.map +1 -0
  535. package/package.json +93 -0
@@ -0,0 +1,1071 @@
1
+ /**
2
+ * Model Catalog
3
+ *
4
+ * 模型能力系统 - 声明式模型定义
5
+ * - 支持多模态能力声明
6
+ * - 支持定价信息
7
+ * - 支持能力匹配和筛选
8
+ */
9
+ // ============================================
10
+ // 模型注册表
11
+ // ============================================
12
+ export const MODEL_CATALOG = [
13
+ // ============================================
14
+ // OpenAI Models
15
+ // ============================================
16
+ {
17
+ id: 'gpt-4o',
18
+ name: 'GPT-4o',
19
+ provider: 'openai',
20
+ description: 'OpenAI 旗舰多模态模型,性能与效率平衡',
21
+ family: 'GPT-4',
22
+ inputModalities: ['text', 'image'],
23
+ outputModalities: ['text'],
24
+ features: {
25
+ streaming: true,
26
+ functionCalling: true,
27
+ jsonMode: true,
28
+ reasoning: false,
29
+ systemPrompt: true,
30
+ tools: true,
31
+ vision: true,
32
+ documentUnderstanding: false,
33
+ codeExecution: false,
34
+ imageGeneration: false,
35
+ audioUnderstanding: false,
36
+ videoUnderstanding: false,
37
+ },
38
+ limits: {
39
+ contextWindow: 128000,
40
+ maxOutputTokens: 4096,
41
+ maxFileSize: 20,
42
+ maxImagesPerRequest: 10,
43
+ supportedImageTypes: ['image/jpeg', 'image/png', 'image/webp', 'image/gif'],
44
+ },
45
+ pricing: { inputPer1k: 0.0025, outputPer1k: 0.01 },
46
+ performance: {
47
+ qualityScore: 9,
48
+ speedScore: 8,
49
+ recommendedFor: ['general', 'vision', 'coding', 'analysis'],
50
+ },
51
+ recommended: true,
52
+ },
53
+ {
54
+ id: 'gpt-4o-mini',
55
+ name: 'GPT-4o Mini',
56
+ provider: 'openai',
57
+ description: '轻量级多模态模型,成本效益高',
58
+ family: 'GPT-4',
59
+ inputModalities: ['text', 'image'],
60
+ outputModalities: ['text'],
61
+ features: {
62
+ streaming: true,
63
+ functionCalling: true,
64
+ jsonMode: true,
65
+ reasoning: false,
66
+ systemPrompt: true,
67
+ tools: true,
68
+ vision: true,
69
+ documentUnderstanding: false,
70
+ codeExecution: false,
71
+ imageGeneration: false,
72
+ audioUnderstanding: false,
73
+ videoUnderstanding: false,
74
+ },
75
+ limits: {
76
+ contextWindow: 128000,
77
+ maxOutputTokens: 4096,
78
+ maxFileSize: 20,
79
+ maxImagesPerRequest: 10,
80
+ supportedImageTypes: ['image/jpeg', 'image/png', 'image/webp', 'image/gif'],
81
+ },
82
+ pricing: { inputPer1k: 0.00015, outputPer1k: 0.0006 },
83
+ performance: {
84
+ qualityScore: 7,
85
+ speedScore: 9,
86
+ recommendedFor: ['fast', 'cheap', 'simple'],
87
+ },
88
+ recommended: true,
89
+ },
90
+ {
91
+ id: 'gpt-5',
92
+ name: 'GPT-5',
93
+ provider: 'openai',
94
+ description: 'OpenAI 最新旗舰模型',
95
+ family: 'GPT-5',
96
+ inputModalities: ['text', 'image', 'audio'],
97
+ outputModalities: ['text', 'audio'],
98
+ features: {
99
+ streaming: true,
100
+ functionCalling: true,
101
+ jsonMode: true,
102
+ reasoning: true,
103
+ systemPrompt: true,
104
+ tools: true,
105
+ vision: true,
106
+ documentUnderstanding: true,
107
+ codeExecution: false,
108
+ imageGeneration: false,
109
+ audioUnderstanding: true,
110
+ videoUnderstanding: false,
111
+ },
112
+ limits: {
113
+ contextWindow: 256000,
114
+ maxOutputTokens: 16384,
115
+ maxFileSize: 50,
116
+ },
117
+ pricing: { inputPer1k: 0.01, outputPer1k: 0.03 },
118
+ performance: {
119
+ qualityScore: 10,
120
+ speedScore: 7,
121
+ recommendedFor: ['complex', 'reasoning', 'analysis', 'creative'],
122
+ },
123
+ recommended: true,
124
+ },
125
+ {
126
+ id: 'o1',
127
+ name: 'o1',
128
+ provider: 'openai',
129
+ description: 'OpenAI 推理模型,适合复杂任务',
130
+ family: 'o1',
131
+ inputModalities: ['text'],
132
+ outputModalities: ['text'],
133
+ features: {
134
+ streaming: false, // o1 不支持流式
135
+ functionCalling: true,
136
+ jsonMode: true,
137
+ reasoning: true,
138
+ systemPrompt: false, // o1 不支持 system prompt
139
+ tools: true,
140
+ vision: false,
141
+ documentUnderstanding: false,
142
+ codeExecution: false,
143
+ imageGeneration: false,
144
+ audioUnderstanding: false,
145
+ videoUnderstanding: false,
146
+ },
147
+ limits: {
148
+ contextWindow: 200000,
149
+ maxOutputTokens: 100000,
150
+ },
151
+ pricing: { inputPer1k: 0.015, outputPer1k: 0.06 },
152
+ performance: {
153
+ qualityScore: 10,
154
+ speedScore: 5,
155
+ recommendedFor: ['math', 'science', 'coding', 'complex-reasoning'],
156
+ },
157
+ },
158
+ {
159
+ id: 'o3-mini',
160
+ name: 'o3 Mini',
161
+ provider: 'openai',
162
+ description: '轻量级推理模型',
163
+ family: 'o3',
164
+ inputModalities: ['text'],
165
+ outputModalities: ['text'],
166
+ features: {
167
+ streaming: false,
168
+ functionCalling: true,
169
+ jsonMode: true,
170
+ reasoning: true,
171
+ systemPrompt: false,
172
+ tools: true,
173
+ vision: false,
174
+ documentUnderstanding: false,
175
+ codeExecution: false,
176
+ imageGeneration: false,
177
+ audioUnderstanding: false,
178
+ videoUnderstanding: false,
179
+ },
180
+ limits: {
181
+ contextWindow: 200000,
182
+ maxOutputTokens: 100000,
183
+ },
184
+ pricing: { inputPer1k: 0.0011, outputPer1k: 0.0044 },
185
+ performance: {
186
+ qualityScore: 9,
187
+ speedScore: 6,
188
+ recommendedFor: ['reasoning', 'math', 'coding'],
189
+ },
190
+ },
191
+ // ============================================
192
+ // Anthropic Models
193
+ // ============================================
194
+ {
195
+ id: 'claude-sonnet-4-5',
196
+ name: 'Claude Sonnet 4.5',
197
+ provider: 'anthropic',
198
+ description: 'Anthropic 平衡型模型,速度快性能好',
199
+ family: 'Claude 4.5',
200
+ inputModalities: ['text', 'image', 'pdf'],
201
+ outputModalities: ['text'],
202
+ features: {
203
+ streaming: true,
204
+ functionCalling: true,
205
+ jsonMode: false,
206
+ reasoning: false,
207
+ systemPrompt: true,
208
+ tools: true,
209
+ vision: true,
210
+ documentUnderstanding: true,
211
+ codeExecution: false,
212
+ imageGeneration: false,
213
+ audioUnderstanding: false,
214
+ videoUnderstanding: false,
215
+ },
216
+ limits: {
217
+ contextWindow: 200000,
218
+ maxOutputTokens: 8192,
219
+ maxFileSize: 32,
220
+ maxImagesPerRequest: 20,
221
+ supportedImageTypes: ['image/jpeg', 'image/png', 'image/webp', 'image/gif'],
222
+ supportedDocumentTypes: ['application/pdf'],
223
+ },
224
+ pricing: { inputPer1k: 0.003, outputPer1k: 0.015, cacheReadDiscount: 0.1 },
225
+ performance: {
226
+ qualityScore: 9,
227
+ speedScore: 9,
228
+ recommendedFor: ['general', 'coding', 'analysis', 'document'],
229
+ },
230
+ recommended: true,
231
+ },
232
+ {
233
+ id: 'claude-opus-4-5',
234
+ name: 'Claude Opus 4.5',
235
+ provider: 'anthropic',
236
+ description: 'Anthropic 最强模型,适合复杂任务',
237
+ family: 'Claude 4.5',
238
+ inputModalities: ['text', 'image', 'pdf'],
239
+ outputModalities: ['text'],
240
+ features: {
241
+ streaming: true,
242
+ functionCalling: true,
243
+ jsonMode: false,
244
+ reasoning: true,
245
+ systemPrompt: true,
246
+ tools: true,
247
+ vision: true,
248
+ documentUnderstanding: true,
249
+ codeExecution: false,
250
+ imageGeneration: false,
251
+ audioUnderstanding: false,
252
+ videoUnderstanding: false,
253
+ },
254
+ limits: {
255
+ contextWindow: 200000,
256
+ maxOutputTokens: 8192,
257
+ maxFileSize: 32,
258
+ maxImagesPerRequest: 20,
259
+ },
260
+ pricing: { inputPer1k: 0.015, outputPer1k: 0.075, cacheReadDiscount: 0.1 },
261
+ performance: {
262
+ qualityScore: 10,
263
+ speedScore: 7,
264
+ recommendedFor: ['complex', 'analysis', 'creative', 'research'],
265
+ },
266
+ },
267
+ {
268
+ id: 'claude-haiku-4-5',
269
+ name: 'Claude Haiku 4.5',
270
+ provider: 'anthropic',
271
+ description: 'Anthropic 轻量级模型,速度极快',
272
+ family: 'Claude 4.5',
273
+ inputModalities: ['text', 'image'],
274
+ outputModalities: ['text'],
275
+ features: {
276
+ streaming: true,
277
+ functionCalling: true,
278
+ jsonMode: false,
279
+ reasoning: false,
280
+ systemPrompt: true,
281
+ tools: true,
282
+ vision: true,
283
+ documentUnderstanding: false,
284
+ codeExecution: false,
285
+ imageGeneration: false,
286
+ audioUnderstanding: false,
287
+ videoUnderstanding: false,
288
+ },
289
+ limits: {
290
+ contextWindow: 200000,
291
+ maxOutputTokens: 4096,
292
+ },
293
+ pricing: { inputPer1k: 0.00025, outputPer1k: 0.00125, cacheReadDiscount: 0.1 },
294
+ performance: {
295
+ qualityScore: 7,
296
+ speedScore: 10,
297
+ recommendedFor: ['fast', 'cheap', 'simple', 'summarization'],
298
+ },
299
+ },
300
+ // ============================================
301
+ // Google Gemini Models
302
+ // ============================================
303
+ {
304
+ id: 'gemini-2.5-pro',
305
+ name: 'Gemini 2.5 Pro',
306
+ provider: 'google',
307
+ description: 'Google 最强多模态模型,支持视频',
308
+ family: 'Gemini 2.5',
309
+ inputModalities: ['text', 'image', 'video', 'audio', 'pdf'],
310
+ outputModalities: ['text'],
311
+ features: {
312
+ streaming: true,
313
+ functionCalling: true,
314
+ jsonMode: true,
315
+ reasoning: true,
316
+ systemPrompt: true,
317
+ tools: true,
318
+ vision: true,
319
+ documentUnderstanding: true,
320
+ codeExecution: true,
321
+ imageGeneration: false,
322
+ audioUnderstanding: true,
323
+ videoUnderstanding: true,
324
+ },
325
+ limits: {
326
+ contextWindow: 1000000, // 1M context!
327
+ maxOutputTokens: 8192,
328
+ maxFileSize: 20,
329
+ maxImagesPerRequest: 100,
330
+ supportedImageTypes: ['image/jpeg', 'image/png', 'image/webp', 'image/heic', 'image/heif'],
331
+ supportedVideoTypes: ['video/mp4', 'video/mpeg', 'video/mov', 'video/avi', 'video/x-flv', 'video/mpg', 'video/webm', 'video/wmv', 'video/3gpp'],
332
+ supportedAudioTypes: ['audio/wav', 'audio/mp3', 'audio/aiff', 'audio/aac', 'audio/ogg', 'audio/flac'],
333
+ supportedDocumentTypes: ['application/pdf'],
334
+ },
335
+ pricing: { inputPer1k: 0.00125, outputPer1k: 0.01 },
336
+ performance: {
337
+ qualityScore: 9,
338
+ speedScore: 8,
339
+ recommendedFor: ['long-context', 'video', 'multimodal', 'document'],
340
+ },
341
+ recommended: true,
342
+ },
343
+ {
344
+ id: 'gemini-2.5-flash',
345
+ name: 'Gemini 2.5 Flash',
346
+ provider: 'google',
347
+ description: 'Google 快速多模态模型',
348
+ family: 'Gemini 2.5',
349
+ inputModalities: ['text', 'image', 'video', 'audio', 'pdf'],
350
+ outputModalities: ['text'],
351
+ features: {
352
+ streaming: true,
353
+ functionCalling: true,
354
+ jsonMode: true,
355
+ reasoning: true,
356
+ systemPrompt: true,
357
+ tools: true,
358
+ vision: true,
359
+ documentUnderstanding: true,
360
+ codeExecution: true,
361
+ imageGeneration: false,
362
+ audioUnderstanding: true,
363
+ videoUnderstanding: true,
364
+ },
365
+ limits: {
366
+ contextWindow: 1000000,
367
+ maxOutputTokens: 8192,
368
+ },
369
+ pricing: { inputPer1k: 0.000075, outputPer1k: 0.0003 },
370
+ performance: {
371
+ qualityScore: 8,
372
+ speedScore: 9,
373
+ recommendedFor: ['fast', 'cheap', 'multimodal', 'long-context'],
374
+ },
375
+ recommended: true,
376
+ },
377
+ {
378
+ id: 'gemini-2.0-flash',
379
+ name: 'Gemini 2.0 Flash',
380
+ provider: 'google',
381
+ description: 'Google 2.0 系列快速模型',
382
+ family: 'Gemini 2.0',
383
+ inputModalities: ['text', 'image', 'video', 'audio'],
384
+ outputModalities: ['text'],
385
+ features: {
386
+ streaming: true,
387
+ functionCalling: true,
388
+ jsonMode: true,
389
+ reasoning: false,
390
+ systemPrompt: true,
391
+ tools: true,
392
+ vision: true,
393
+ documentUnderstanding: false,
394
+ codeExecution: false,
395
+ imageGeneration: false,
396
+ audioUnderstanding: true,
397
+ videoUnderstanding: true,
398
+ },
399
+ limits: {
400
+ contextWindow: 1000000,
401
+ maxOutputTokens: 8192,
402
+ },
403
+ pricing: { inputPer1k: 0.0001, outputPer1k: 0.0004 },
404
+ performance: {
405
+ qualityScore: 8,
406
+ speedScore: 10,
407
+ recommendedFor: ['fast', 'cheap', 'multimodal'],
408
+ },
409
+ },
410
+ // ============================================
411
+ // Qwen (通义千问)
412
+ // ============================================
413
+ {
414
+ id: 'qwen-plus',
415
+ name: 'Qwen Plus',
416
+ provider: 'qwen',
417
+ description: '通义千问 Plus,综合能力强劲',
418
+ family: 'Qwen',
419
+ inputModalities: ['text', 'image'],
420
+ outputModalities: ['text'],
421
+ features: {
422
+ streaming: true,
423
+ functionCalling: true,
424
+ jsonMode: true,
425
+ reasoning: false,
426
+ systemPrompt: true,
427
+ tools: true,
428
+ vision: true,
429
+ documentUnderstanding: false,
430
+ codeExecution: false,
431
+ imageGeneration: false,
432
+ audioUnderstanding: false,
433
+ videoUnderstanding: false,
434
+ },
435
+ limits: {
436
+ contextWindow: 131072,
437
+ maxOutputTokens: 8192,
438
+ maxImagesPerRequest: 10,
439
+ },
440
+ pricing: { inputPer1k: 0.0008, outputPer1k: 0.002 },
441
+ recommended: true,
442
+ },
443
+ {
444
+ id: 'qwen-max',
445
+ name: 'Qwen Max',
446
+ provider: 'qwen',
447
+ description: '通义千问 Max,最强能力',
448
+ family: 'Qwen',
449
+ inputModalities: ['text', 'image'],
450
+ outputModalities: ['text'],
451
+ features: {
452
+ streaming: true,
453
+ functionCalling: true,
454
+ jsonMode: true,
455
+ reasoning: true,
456
+ systemPrompt: true,
457
+ tools: true,
458
+ vision: true,
459
+ documentUnderstanding: false,
460
+ codeExecution: false,
461
+ imageGeneration: false,
462
+ audioUnderstanding: false,
463
+ videoUnderstanding: false,
464
+ },
465
+ limits: {
466
+ contextWindow: 32768,
467
+ maxOutputTokens: 8192,
468
+ },
469
+ pricing: { inputPer1k: 0.002, outputPer1k: 0.006 },
470
+ recommended: true,
471
+ },
472
+ {
473
+ id: 'qwen3-235b',
474
+ name: 'Qwen3 235B',
475
+ provider: 'qwen',
476
+ description: 'Qwen3 235B 参数模型',
477
+ family: 'Qwen3',
478
+ inputModalities: ['text'],
479
+ outputModalities: ['text'],
480
+ features: {
481
+ streaming: true,
482
+ functionCalling: true,
483
+ jsonMode: true,
484
+ reasoning: true,
485
+ systemPrompt: true,
486
+ tools: true,
487
+ vision: false,
488
+ documentUnderstanding: false,
489
+ codeExecution: false,
490
+ imageGeneration: false,
491
+ audioUnderstanding: false,
492
+ videoUnderstanding: false,
493
+ },
494
+ limits: {
495
+ contextWindow: 128000,
496
+ maxOutputTokens: 8192,
497
+ },
498
+ pricing: { inputPer1k: 0.001, outputPer1k: 0.003 },
499
+ },
500
+ // ============================================
501
+ // Kimi (月之暗面)
502
+ // ============================================
503
+ {
504
+ id: 'kimi-k2.5',
505
+ name: 'Kimi K2.5',
506
+ provider: 'kimi',
507
+ description: 'Kimi K2.5,长上下文专家',
508
+ family: 'Kimi',
509
+ inputModalities: ['text'],
510
+ outputModalities: ['text'],
511
+ features: {
512
+ streaming: true,
513
+ functionCalling: true,
514
+ jsonMode: true,
515
+ reasoning: false,
516
+ systemPrompt: true,
517
+ tools: true,
518
+ vision: false,
519
+ documentUnderstanding: true,
520
+ codeExecution: false,
521
+ imageGeneration: false,
522
+ audioUnderstanding: false,
523
+ videoUnderstanding: false,
524
+ },
525
+ limits: {
526
+ contextWindow: 256000,
527
+ maxOutputTokens: 4096,
528
+ },
529
+ pricing: { inputPer1k: 0.002, outputPer1k: 0.006 },
530
+ performance: {
531
+ qualityScore: 9,
532
+ speedScore: 8,
533
+ recommendedFor: ['long-context', 'document', 'coding'],
534
+ },
535
+ recommended: true,
536
+ },
537
+ {
538
+ id: 'kimi-k2-thinking',
539
+ name: 'Kimi K2 Thinking',
540
+ provider: 'kimi',
541
+ description: 'Kimi K2 推理版',
542
+ family: 'Kimi',
543
+ inputModalities: ['text'],
544
+ outputModalities: ['text'],
545
+ features: {
546
+ streaming: true,
547
+ functionCalling: true,
548
+ jsonMode: true,
549
+ reasoning: true,
550
+ systemPrompt: true,
551
+ tools: true,
552
+ vision: false,
553
+ documentUnderstanding: true,
554
+ codeExecution: false,
555
+ imageGeneration: false,
556
+ audioUnderstanding: false,
557
+ videoUnderstanding: false,
558
+ },
559
+ limits: {
560
+ contextWindow: 256000,
561
+ maxOutputTokens: 4096,
562
+ },
563
+ pricing: { inputPer1k: 0.002, outputPer1k: 0.006 },
564
+ },
565
+ // ============================================
566
+ // MiniMax
567
+ // ============================================
568
+ {
569
+ id: 'minimax-m2.5',
570
+ name: 'MiniMax M2.5',
571
+ provider: 'minimax',
572
+ description: 'MiniMax M2.5',
573
+ family: 'MiniMax',
574
+ inputModalities: ['text'],
575
+ outputModalities: ['text'],
576
+ features: {
577
+ streaming: true,
578
+ functionCalling: true,
579
+ jsonMode: true,
580
+ reasoning: false,
581
+ systemPrompt: true,
582
+ tools: true,
583
+ vision: false,
584
+ documentUnderstanding: false,
585
+ codeExecution: false,
586
+ imageGeneration: false,
587
+ audioUnderstanding: false,
588
+ videoUnderstanding: false,
589
+ },
590
+ limits: {
591
+ contextWindow: 1000000,
592
+ maxOutputTokens: 4096,
593
+ },
594
+ recommended: true,
595
+ },
596
+ {
597
+ id: 'minimax-m2.1',
598
+ name: 'MiniMax M2.1',
599
+ provider: 'minimax',
600
+ description: 'MiniMax M2.1',
601
+ family: 'MiniMax',
602
+ inputModalities: ['text'],
603
+ outputModalities: ['text'],
604
+ features: {
605
+ streaming: true,
606
+ functionCalling: true,
607
+ jsonMode: true,
608
+ reasoning: false,
609
+ systemPrompt: true,
610
+ tools: true,
611
+ vision: false,
612
+ documentUnderstanding: false,
613
+ codeExecution: false,
614
+ imageGeneration: false,
615
+ audioUnderstanding: false,
616
+ videoUnderstanding: false,
617
+ },
618
+ limits: {
619
+ contextWindow: 1000000,
620
+ maxOutputTokens: 4096,
621
+ },
622
+ },
623
+ // ============================================
624
+ // Zhipu (智谱)
625
+ // ============================================
626
+ {
627
+ id: 'glm-4',
628
+ name: 'GLM-4',
629
+ provider: 'zhipu',
630
+ description: '智谱 GLM-4',
631
+ family: 'GLM-4',
632
+ inputModalities: ['text', 'image'],
633
+ outputModalities: ['text'],
634
+ features: {
635
+ streaming: true,
636
+ functionCalling: true,
637
+ jsonMode: true,
638
+ reasoning: false,
639
+ systemPrompt: true,
640
+ tools: true,
641
+ vision: true,
642
+ documentUnderstanding: false,
643
+ codeExecution: false,
644
+ imageGeneration: false,
645
+ audioUnderstanding: false,
646
+ videoUnderstanding: false,
647
+ },
648
+ limits: {
649
+ contextWindow: 128000,
650
+ maxOutputTokens: 4096,
651
+ },
652
+ recommended: true,
653
+ },
654
+ {
655
+ id: 'glm-4v-flash',
656
+ name: 'GLM-4V Flash',
657
+ provider: 'zhipu',
658
+ description: 'GLM-4V Flash,视觉版',
659
+ family: 'GLM-4',
660
+ inputModalities: ['text', 'image'],
661
+ outputModalities: ['text'],
662
+ features: {
663
+ streaming: true,
664
+ functionCalling: true,
665
+ jsonMode: true,
666
+ reasoning: false,
667
+ systemPrompt: true,
668
+ tools: true,
669
+ vision: true,
670
+ documentUnderstanding: false,
671
+ codeExecution: false,
672
+ imageGeneration: false,
673
+ audioUnderstanding: false,
674
+ videoUnderstanding: false,
675
+ },
676
+ limits: {
677
+ contextWindow: 8192,
678
+ maxOutputTokens: 4096,
679
+ },
680
+ },
681
+ {
682
+ id: 'glm-5',
683
+ name: 'GLM-5',
684
+ provider: 'zhipu',
685
+ description: '智谱 GLM-5',
686
+ family: 'GLM-5',
687
+ inputModalities: ['text', 'image'],
688
+ outputModalities: ['text'],
689
+ features: {
690
+ streaming: true,
691
+ functionCalling: true,
692
+ jsonMode: true,
693
+ reasoning: true,
694
+ systemPrompt: true,
695
+ tools: true,
696
+ vision: true,
697
+ documentUnderstanding: false,
698
+ codeExecution: false,
699
+ imageGeneration: false,
700
+ audioUnderstanding: false,
701
+ videoUnderstanding: false,
702
+ },
703
+ limits: {
704
+ contextWindow: 128000,
705
+ maxOutputTokens: 8192,
706
+ },
707
+ },
708
+ // ============================================
709
+ // DeepSeek
710
+ // ============================================
711
+ {
712
+ id: 'deepseek-chat',
713
+ name: 'DeepSeek Chat',
714
+ provider: 'deepseek',
715
+ description: 'DeepSeek 对话模型',
716
+ family: 'DeepSeek',
717
+ inputModalities: ['text'],
718
+ outputModalities: ['text'],
719
+ features: {
720
+ streaming: true,
721
+ functionCalling: true,
722
+ jsonMode: true,
723
+ reasoning: false,
724
+ systemPrompt: true,
725
+ tools: true,
726
+ vision: false,
727
+ documentUnderstanding: false,
728
+ codeExecution: false,
729
+ imageGeneration: false,
730
+ audioUnderstanding: false,
731
+ videoUnderstanding: false,
732
+ },
733
+ limits: {
734
+ contextWindow: 64000,
735
+ maxOutputTokens: 8192,
736
+ },
737
+ pricing: { inputPer1k: 0.00014, outputPer1k: 0.00028 },
738
+ recommended: true,
739
+ },
740
+ {
741
+ id: 'deepseek-reasoner',
742
+ name: 'DeepSeek Reasoner',
743
+ provider: 'deepseek',
744
+ description: 'DeepSeek 推理模型(R1)',
745
+ family: 'DeepSeek',
746
+ inputModalities: ['text'],
747
+ outputModalities: ['text'],
748
+ features: {
749
+ streaming: true,
750
+ functionCalling: false,
751
+ jsonMode: true,
752
+ reasoning: true,
753
+ systemPrompt: true,
754
+ tools: false,
755
+ vision: false,
756
+ documentUnderstanding: false,
757
+ codeExecution: false,
758
+ imageGeneration: false,
759
+ audioUnderstanding: false,
760
+ videoUnderstanding: false,
761
+ },
762
+ limits: {
763
+ contextWindow: 64000,
764
+ maxOutputTokens: 8192,
765
+ },
766
+ pricing: { inputPer1k: 0.00055, outputPer1k: 0.00219 },
767
+ },
768
+ // ============================================
769
+ // Bailian Coding Plan (百炼)
770
+ // ============================================
771
+ {
772
+ id: 'qwen3-max-2026-01-23',
773
+ name: 'Qwen3 Max (Coding Plan)',
774
+ provider: 'bailian',
775
+ description: '阿里云百炼 Coding Plan qwen3-max-thinking',
776
+ family: 'Qwen3',
777
+ inputModalities: ['text'],
778
+ outputModalities: ['text'],
779
+ features: {
780
+ streaming: true,
781
+ functionCalling: true,
782
+ jsonMode: true,
783
+ reasoning: true,
784
+ systemPrompt: true,
785
+ tools: true,
786
+ vision: false,
787
+ documentUnderstanding: false,
788
+ codeExecution: false,
789
+ imageGeneration: false,
790
+ audioUnderstanding: false,
791
+ videoUnderstanding: false,
792
+ },
793
+ limits: {
794
+ contextWindow: 262144,
795
+ maxOutputTokens: 65536,
796
+ },
797
+ recommended: true,
798
+ },
799
+ {
800
+ id: 'qwen3.5-plus',
801
+ name: 'Qwen3.5 Plus (Coding Plan)',
802
+ provider: 'bailian',
803
+ description: '阿里云百炼 Coding Plan qwen3.5-plus',
804
+ family: 'Qwen3.5',
805
+ inputModalities: ['text'],
806
+ outputModalities: ['text'],
807
+ features: {
808
+ streaming: true,
809
+ functionCalling: true,
810
+ jsonMode: true,
811
+ reasoning: true,
812
+ systemPrompt: true,
813
+ tools: true,
814
+ vision: false,
815
+ documentUnderstanding: false,
816
+ codeExecution: false,
817
+ imageGeneration: false,
818
+ audioUnderstanding: false,
819
+ videoUnderstanding: false,
820
+ },
821
+ limits: {
822
+ contextWindow: 131072,
823
+ maxOutputTokens: 32768,
824
+ },
825
+ },
826
+ // ============================================
827
+ // Groq
828
+ // ============================================
829
+ {
830
+ id: 'llama-3.3-70b',
831
+ name: 'Llama 3.3 70B',
832
+ provider: 'groq',
833
+ description: 'Meta Llama 3.3 70B,极速推理',
834
+ family: 'Llama',
835
+ inputModalities: ['text'],
836
+ outputModalities: ['text'],
837
+ features: {
838
+ streaming: true,
839
+ functionCalling: true,
840
+ jsonMode: true,
841
+ reasoning: false,
842
+ systemPrompt: true,
843
+ tools: true,
844
+ vision: false,
845
+ documentUnderstanding: false,
846
+ codeExecution: false,
847
+ imageGeneration: false,
848
+ audioUnderstanding: false,
849
+ videoUnderstanding: false,
850
+ },
851
+ limits: {
852
+ contextWindow: 128000,
853
+ maxOutputTokens: 4096,
854
+ },
855
+ pricing: { inputPer1k: 0.00059, outputPer1k: 0.00079 },
856
+ performance: {
857
+ qualityScore: 8,
858
+ speedScore: 10,
859
+ recommendedFor: ['fast', 'cheap'],
860
+ },
861
+ recommended: true,
862
+ },
863
+ // ============================================
864
+ // xAI
865
+ // ============================================
866
+ {
867
+ id: 'grok-3',
868
+ name: 'Grok 3',
869
+ provider: 'xai',
870
+ description: 'xAI Grok 3',
871
+ family: 'Grok',
872
+ inputModalities: ['text', 'image'],
873
+ outputModalities: ['text'],
874
+ features: {
875
+ streaming: true,
876
+ functionCalling: true,
877
+ jsonMode: true,
878
+ reasoning: true,
879
+ systemPrompt: true,
880
+ tools: true,
881
+ vision: true,
882
+ documentUnderstanding: false,
883
+ codeExecution: false,
884
+ imageGeneration: false,
885
+ audioUnderstanding: false,
886
+ videoUnderstanding: false,
887
+ },
888
+ limits: {
889
+ contextWindow: 128000,
890
+ maxOutputTokens: 4096,
891
+ },
892
+ },
893
+ ];
894
+ // ============================================
895
+ // 辅助函数
896
+ // ============================================
897
+ /**
898
+ * 获取所有模型
899
+ */
900
+ export function getAllModels() {
901
+ return MODEL_CATALOG;
902
+ }
903
+ /**
904
+ * 根据 ID 查找模型
905
+ */
906
+ export function findModel(id) {
907
+ return MODEL_CATALOG.find(m => m.id === id);
908
+ }
909
+ /**
910
+ * 根据 Provider 获取模型
911
+ */
912
+ export function getModelsByProvider(providerId) {
913
+ return MODEL_CATALOG.filter(m => m.provider === providerId);
914
+ }
915
+ /**
916
+ * 根据 Provider 和模型 ID 查找
917
+ */
918
+ export function findModelByProvider(providerId, modelId) {
919
+ return MODEL_CATALOG.find(m => m.provider === providerId && m.id === modelId);
920
+ }
921
+ /**
922
+ * 获取推荐的模型
923
+ */
924
+ export function getRecommendedModels() {
925
+ return MODEL_CATALOG.filter(m => m.recommended && !m.deprecated);
926
+ }
927
+ /**
928
+ * 获取支持特定能力的模型
929
+ */
930
+ export function getModelsByCapability(capability) {
931
+ return MODEL_CATALOG.filter(m => m.features[capability] && !m.deprecated);
932
+ }
933
+ /**
934
+ * 获取支持特定模态的模型
935
+ */
936
+ export function getModelsByModality(modality) {
937
+ return MODEL_CATALOG.filter(m => m.inputModalities.includes(modality) && !m.deprecated);
938
+ }
939
+ /**
940
+ * 获取支持视觉的模型
941
+ */
942
+ export function getVisionModels() {
943
+ return getModelsByCapability('vision');
944
+ }
945
+ /**
946
+ * 获取支持函数调用的模型
947
+ */
948
+ export function getFunctionCallingModels() {
949
+ return getModelsByCapability('functionCalling');
950
+ }
951
+ export function getModelsForTask(task) {
952
+ switch (task) {
953
+ case 'vision':
954
+ return getVisionModels().sort((a, b) => (b.performance?.qualityScore || 0) - (a.performance?.qualityScore || 0));
955
+ case 'coding':
956
+ return MODEL_CATALOG.filter(m => m.performance?.recommendedFor?.includes('coding') && !m.deprecated);
957
+ case 'fast':
958
+ return MODEL_CATALOG.filter(m => m.performance?.recommendedFor?.includes('fast') && !m.deprecated).sort((a, b) => (b.performance?.speedScore || 0) - (a.performance?.speedScore || 0));
959
+ case 'cheap':
960
+ return MODEL_CATALOG.filter(m => !m.deprecated)
961
+ .sort((a, b) => (a.pricing?.inputPer1k || Infinity) - (b.pricing?.inputPer1k || Infinity));
962
+ case 'long-context':
963
+ return MODEL_CATALOG.filter(m => !m.deprecated)
964
+ .sort((a, b) => b.limits.contextWindow - a.limits.contextWindow);
965
+ case 'reasoning':
966
+ return getModelsByCapability('reasoning');
967
+ case 'multimodal':
968
+ return MODEL_CATALOG.filter(m => m.inputModalities.length > 1 && !m.deprecated);
969
+ case 'document':
970
+ return MODEL_CATALOG.filter(m => (m.inputModalities.includes('pdf') || m.features.documentUnderstanding) && !m.deprecated);
971
+ default:
972
+ return getRecommendedModels();
973
+ }
974
+ }
975
+ /**
976
+ * 检查模型是否支持特定模态
977
+ */
978
+ export function modelSupportsModality(modelId, modality) {
979
+ const model = findModel(modelId);
980
+ if (!model)
981
+ return false;
982
+ return model.inputModalities.includes(modality);
983
+ }
984
+ /**
985
+ * 检查模型是否支持特定功能
986
+ */
987
+ export function modelSupportsFeature(modelId, feature) {
988
+ const model = findModel(modelId);
989
+ if (!model)
990
+ return false;
991
+ return model.features[feature];
992
+ }
993
+ /**
994
+ * 估算请求成本
995
+ */
996
+ export function estimateCost(modelId, inputTokens, outputTokens) {
997
+ const model = findModel(modelId);
998
+ if (!model?.pricing)
999
+ return undefined;
1000
+ const inputCost = (inputTokens / 1000) * model.pricing.inputPer1k;
1001
+ const outputCost = (outputTokens / 1000) * model.pricing.outputPer1k;
1002
+ return inputCost + outputCost;
1003
+ }
1004
+ export function getModelComparisonInfo() {
1005
+ return MODEL_CATALOG
1006
+ .filter(m => !m.deprecated)
1007
+ .map(m => ({
1008
+ id: m.id,
1009
+ name: m.name,
1010
+ provider: m.provider,
1011
+ description: m.description,
1012
+ contextWindow: m.limits.contextWindow,
1013
+ maxOutputTokens: m.limits.maxOutputTokens,
1014
+ supportsVision: m.features.vision,
1015
+ supportsFunctions: m.features.functionCalling,
1016
+ supportsStreaming: m.features.streaming,
1017
+ inputPrice: m.pricing?.inputPer1k,
1018
+ outputPrice: m.pricing?.outputPer1k,
1019
+ recommended: m.recommended || false,
1020
+ }));
1021
+ }
1022
+ /**
1023
+ * 注册自定义模型(运行时扩展)
1024
+ */
1025
+ export function registerCustomModel(model) {
1026
+ // 检查是否已存在
1027
+ const existingIndex = MODEL_CATALOG.findIndex(m => m.id === model.id && m.provider === model.provider);
1028
+ if (existingIndex >= 0) {
1029
+ MODEL_CATALOG[existingIndex] = model;
1030
+ }
1031
+ else {
1032
+ MODEL_CATALOG.push(model);
1033
+ }
1034
+ }
1035
+ /**
1036
+ * 从远程获取模型列表(用于 OpenRouter 等动态 provider)
1037
+ */
1038
+ export async function fetchRemoteModels(_providerId, _apiKey, _baseUrl) {
1039
+ // TODO: 实现远程获取逻辑
1040
+ // 对于 OpenRouter,调用 /v1/models
1041
+ // 对于其他 provider,类似处理
1042
+ return [];
1043
+ }
1044
+ /**
1045
+ * 获取完整模型引用(provider/model)
1046
+ */
1047
+ export function getFullModelRef(model) {
1048
+ return `${model.provider}/${model.id}`;
1049
+ }
1050
+ /**
1051
+ * 解析模型引用
1052
+ */
1053
+ export function parseModelReference(ref) {
1054
+ if (ref.includes('/')) {
1055
+ const [provider, ...modelParts] = ref.split('/');
1056
+ return { provider, modelId: modelParts.join('/') };
1057
+ }
1058
+ return { modelId: ref };
1059
+ }
1060
+ /**
1061
+ * 查找模型(支持完整引用格式)
1062
+ */
1063
+ export function findModelByRef(ref) {
1064
+ const { provider, modelId } = parseModelReference(ref);
1065
+ if (provider) {
1066
+ return findModelByProvider(provider, modelId);
1067
+ }
1068
+ // 只提供 modelId,尝试在所有 provider 中查找
1069
+ return findModel(modelId);
1070
+ }
1071
+ //# sourceMappingURL=model-catalog.js.map