@lobehub/chat 1.98.1 → 1.99.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 (456) hide show
  1. package/.cursor/rules/backend-architecture.mdc +93 -17
  2. package/.cursor/rules/cursor-ux.mdc +45 -35
  3. package/.cursor/rules/project-introduce.mdc +72 -6
  4. package/.cursor/rules/rules-attach.mdc +16 -7
  5. package/.eslintrc.js +10 -0
  6. package/CHANGELOG.md +52 -0
  7. package/apps/desktop/README.md +7 -0
  8. package/apps/desktop/electron-builder.js +5 -0
  9. package/apps/desktop/package.json +2 -1
  10. package/apps/desktop/src/main/const/dir.ts +3 -0
  11. package/apps/desktop/src/main/controllers/UploadFileCtr.ts +13 -8
  12. package/apps/desktop/src/main/core/App.ts +8 -0
  13. package/apps/desktop/src/main/core/StaticFileServerManager.ts +221 -0
  14. package/apps/desktop/src/main/services/fileSrv.ts +231 -44
  15. package/apps/desktop/src/main/utils/next-electron-rsc.ts +36 -5
  16. package/changelog/v1.json +18 -0
  17. package/docs/development/database-schema.dbml +70 -0
  18. package/locales/ar/common.json +2 -0
  19. package/locales/ar/components.json +35 -0
  20. package/locales/ar/error.json +2 -0
  21. package/locales/ar/image.json +100 -0
  22. package/locales/ar/metadata.json +4 -0
  23. package/locales/ar/modelProvider.json +1 -0
  24. package/locales/ar/models.json +51 -9
  25. package/locales/ar/plugin.json +22 -0
  26. package/locales/ar/providers.json +3 -0
  27. package/locales/ar/setting.json +5 -0
  28. package/locales/bg-BG/common.json +2 -0
  29. package/locales/bg-BG/components.json +35 -0
  30. package/locales/bg-BG/error.json +2 -0
  31. package/locales/bg-BG/image.json +100 -0
  32. package/locales/bg-BG/metadata.json +4 -0
  33. package/locales/bg-BG/modelProvider.json +1 -0
  34. package/locales/bg-BG/models.json +51 -9
  35. package/locales/bg-BG/plugin.json +22 -0
  36. package/locales/bg-BG/providers.json +3 -0
  37. package/locales/bg-BG/setting.json +5 -0
  38. package/locales/de-DE/common.json +2 -0
  39. package/locales/de-DE/components.json +35 -0
  40. package/locales/de-DE/error.json +2 -0
  41. package/locales/de-DE/image.json +100 -0
  42. package/locales/de-DE/metadata.json +4 -0
  43. package/locales/de-DE/modelProvider.json +1 -0
  44. package/locales/de-DE/models.json +51 -9
  45. package/locales/de-DE/plugin.json +22 -0
  46. package/locales/de-DE/providers.json +3 -0
  47. package/locales/de-DE/setting.json +5 -0
  48. package/locales/en-US/common.json +2 -0
  49. package/locales/en-US/components.json +35 -0
  50. package/locales/en-US/error.json +2 -0
  51. package/locales/en-US/image.json +100 -0
  52. package/locales/en-US/metadata.json +4 -0
  53. package/locales/en-US/modelProvider.json +1 -0
  54. package/locales/en-US/models.json +51 -9
  55. package/locales/en-US/plugin.json +22 -0
  56. package/locales/en-US/providers.json +3 -0
  57. package/locales/en-US/setting.json +5 -0
  58. package/locales/es-ES/common.json +2 -0
  59. package/locales/es-ES/components.json +35 -0
  60. package/locales/es-ES/error.json +2 -0
  61. package/locales/es-ES/image.json +100 -0
  62. package/locales/es-ES/metadata.json +4 -0
  63. package/locales/es-ES/modelProvider.json +1 -0
  64. package/locales/es-ES/models.json +51 -9
  65. package/locales/es-ES/plugin.json +22 -0
  66. package/locales/es-ES/providers.json +3 -0
  67. package/locales/es-ES/setting.json +5 -0
  68. package/locales/fa-IR/common.json +2 -0
  69. package/locales/fa-IR/components.json +35 -0
  70. package/locales/fa-IR/error.json +2 -0
  71. package/locales/fa-IR/image.json +100 -0
  72. package/locales/fa-IR/metadata.json +4 -0
  73. package/locales/fa-IR/modelProvider.json +1 -0
  74. package/locales/fa-IR/models.json +51 -9
  75. package/locales/fa-IR/plugin.json +22 -0
  76. package/locales/fa-IR/providers.json +3 -0
  77. package/locales/fa-IR/setting.json +5 -0
  78. package/locales/fr-FR/common.json +2 -0
  79. package/locales/fr-FR/components.json +35 -0
  80. package/locales/fr-FR/error.json +2 -0
  81. package/locales/fr-FR/image.json +100 -0
  82. package/locales/fr-FR/metadata.json +4 -0
  83. package/locales/fr-FR/modelProvider.json +1 -0
  84. package/locales/fr-FR/models.json +51 -9
  85. package/locales/fr-FR/plugin.json +22 -0
  86. package/locales/fr-FR/providers.json +3 -0
  87. package/locales/fr-FR/setting.json +5 -0
  88. package/locales/it-IT/common.json +2 -0
  89. package/locales/it-IT/components.json +35 -0
  90. package/locales/it-IT/error.json +2 -0
  91. package/locales/it-IT/image.json +100 -0
  92. package/locales/it-IT/metadata.json +4 -0
  93. package/locales/it-IT/modelProvider.json +1 -0
  94. package/locales/it-IT/models.json +51 -9
  95. package/locales/it-IT/plugin.json +22 -0
  96. package/locales/it-IT/providers.json +3 -0
  97. package/locales/it-IT/setting.json +5 -0
  98. package/locales/ja-JP/common.json +2 -0
  99. package/locales/ja-JP/components.json +35 -0
  100. package/locales/ja-JP/error.json +2 -0
  101. package/locales/ja-JP/image.json +100 -0
  102. package/locales/ja-JP/metadata.json +4 -0
  103. package/locales/ja-JP/modelProvider.json +1 -0
  104. package/locales/ja-JP/models.json +51 -9
  105. package/locales/ja-JP/plugin.json +22 -0
  106. package/locales/ja-JP/providers.json +3 -0
  107. package/locales/ja-JP/setting.json +5 -0
  108. package/locales/ko-KR/common.json +2 -0
  109. package/locales/ko-KR/components.json +35 -0
  110. package/locales/ko-KR/error.json +2 -0
  111. package/locales/ko-KR/image.json +100 -0
  112. package/locales/ko-KR/metadata.json +4 -0
  113. package/locales/ko-KR/modelProvider.json +1 -0
  114. package/locales/ko-KR/models.json +51 -9
  115. package/locales/ko-KR/plugin.json +22 -0
  116. package/locales/ko-KR/providers.json +3 -0
  117. package/locales/ko-KR/setting.json +5 -0
  118. package/locales/nl-NL/common.json +2 -0
  119. package/locales/nl-NL/components.json +35 -0
  120. package/locales/nl-NL/error.json +2 -0
  121. package/locales/nl-NL/image.json +100 -0
  122. package/locales/nl-NL/metadata.json +4 -0
  123. package/locales/nl-NL/modelProvider.json +1 -0
  124. package/locales/nl-NL/models.json +51 -9
  125. package/locales/nl-NL/plugin.json +22 -0
  126. package/locales/nl-NL/providers.json +3 -0
  127. package/locales/nl-NL/setting.json +5 -0
  128. package/locales/pl-PL/common.json +2 -0
  129. package/locales/pl-PL/components.json +35 -0
  130. package/locales/pl-PL/error.json +2 -0
  131. package/locales/pl-PL/image.json +100 -0
  132. package/locales/pl-PL/metadata.json +4 -0
  133. package/locales/pl-PL/modelProvider.json +1 -0
  134. package/locales/pl-PL/models.json +51 -9
  135. package/locales/pl-PL/plugin.json +22 -0
  136. package/locales/pl-PL/providers.json +3 -0
  137. package/locales/pl-PL/setting.json +5 -0
  138. package/locales/pt-BR/common.json +2 -0
  139. package/locales/pt-BR/components.json +35 -0
  140. package/locales/pt-BR/error.json +2 -0
  141. package/locales/pt-BR/image.json +100 -0
  142. package/locales/pt-BR/metadata.json +4 -0
  143. package/locales/pt-BR/modelProvider.json +1 -0
  144. package/locales/pt-BR/models.json +51 -9
  145. package/locales/pt-BR/plugin.json +22 -0
  146. package/locales/pt-BR/providers.json +3 -0
  147. package/locales/pt-BR/setting.json +5 -0
  148. package/locales/ru-RU/common.json +2 -0
  149. package/locales/ru-RU/components.json +35 -0
  150. package/locales/ru-RU/error.json +2 -0
  151. package/locales/ru-RU/image.json +100 -0
  152. package/locales/ru-RU/metadata.json +4 -0
  153. package/locales/ru-RU/modelProvider.json +1 -0
  154. package/locales/ru-RU/models.json +51 -9
  155. package/locales/ru-RU/plugin.json +22 -0
  156. package/locales/ru-RU/providers.json +3 -0
  157. package/locales/ru-RU/setting.json +5 -0
  158. package/locales/tr-TR/common.json +2 -0
  159. package/locales/tr-TR/components.json +35 -0
  160. package/locales/tr-TR/error.json +2 -0
  161. package/locales/tr-TR/image.json +100 -0
  162. package/locales/tr-TR/metadata.json +4 -0
  163. package/locales/tr-TR/modelProvider.json +1 -0
  164. package/locales/tr-TR/models.json +51 -9
  165. package/locales/tr-TR/plugin.json +22 -0
  166. package/locales/tr-TR/providers.json +3 -0
  167. package/locales/tr-TR/setting.json +5 -0
  168. package/locales/vi-VN/common.json +2 -0
  169. package/locales/vi-VN/components.json +35 -0
  170. package/locales/vi-VN/error.json +2 -0
  171. package/locales/vi-VN/image.json +100 -0
  172. package/locales/vi-VN/metadata.json +4 -0
  173. package/locales/vi-VN/modelProvider.json +1 -0
  174. package/locales/vi-VN/models.json +51 -9
  175. package/locales/vi-VN/plugin.json +22 -0
  176. package/locales/vi-VN/providers.json +3 -0
  177. package/locales/vi-VN/setting.json +5 -0
  178. package/locales/zh-CN/common.json +2 -0
  179. package/locales/zh-CN/components.json +35 -0
  180. package/locales/zh-CN/error.json +2 -0
  181. package/locales/zh-CN/image.json +100 -0
  182. package/locales/zh-CN/metadata.json +4 -0
  183. package/locales/zh-CN/modelProvider.json +1 -0
  184. package/locales/zh-CN/models.json +51 -9
  185. package/locales/zh-CN/plugin.json +22 -0
  186. package/locales/zh-CN/providers.json +3 -0
  187. package/locales/zh-CN/setting.json +5 -0
  188. package/locales/zh-TW/common.json +2 -0
  189. package/locales/zh-TW/components.json +35 -0
  190. package/locales/zh-TW/error.json +2 -0
  191. package/locales/zh-TW/image.json +100 -0
  192. package/locales/zh-TW/metadata.json +4 -0
  193. package/locales/zh-TW/modelProvider.json +1 -0
  194. package/locales/zh-TW/models.json +51 -9
  195. package/locales/zh-TW/plugin.json +22 -0
  196. package/locales/zh-TW/providers.json +3 -0
  197. package/locales/zh-TW/setting.json +5 -0
  198. package/package.json +11 -4
  199. package/packages/electron-server-ipc/src/events/file.ts +3 -1
  200. package/packages/electron-server-ipc/src/types/file.ts +15 -0
  201. package/src/app/[variants]/(main)/_layout/Desktop/SideBar/TopActions.tsx +11 -1
  202. package/src/app/[variants]/(main)/image/@menu/components/AspectRatioSelect/index.tsx +73 -0
  203. package/src/app/[variants]/(main)/image/@menu/components/SeedNumberInput/index.tsx +39 -0
  204. package/src/app/[variants]/(main)/image/@menu/components/SizeSelect/index.tsx +89 -0
  205. package/src/app/[variants]/(main)/image/@menu/default.tsx +11 -0
  206. package/src/app/[variants]/(main)/image/@menu/features/ConfigPanel/components/AspectRatioSelect.tsx +24 -0
  207. package/src/app/[variants]/(main)/image/@menu/features/ConfigPanel/components/DimensionControlGroup.tsx +107 -0
  208. package/src/app/[variants]/(main)/image/@menu/features/ConfigPanel/components/ImageNum.tsx +290 -0
  209. package/src/app/[variants]/(main)/image/@menu/features/ConfigPanel/components/ImageUpload.tsx +504 -0
  210. package/src/app/[variants]/(main)/image/@menu/features/ConfigPanel/components/ImageUrl.tsx +18 -0
  211. package/src/app/[variants]/(main)/image/@menu/features/ConfigPanel/components/ImageUrlsUpload.tsx +19 -0
  212. package/src/app/[variants]/(main)/image/@menu/features/ConfigPanel/components/ModelSelect.tsx +155 -0
  213. package/src/app/[variants]/(main)/image/@menu/features/ConfigPanel/components/MultiImagesUpload/ImageManageModal.tsx +415 -0
  214. package/src/app/[variants]/(main)/image/@menu/features/ConfigPanel/components/MultiImagesUpload/index.tsx +732 -0
  215. package/src/app/[variants]/(main)/image/@menu/features/ConfigPanel/components/SeedNumberInput.tsx +24 -0
  216. package/src/app/[variants]/(main)/image/@menu/features/ConfigPanel/components/SizeSelect.tsx +17 -0
  217. package/src/app/[variants]/(main)/image/@menu/features/ConfigPanel/components/SizeSliderInput.tsx +15 -0
  218. package/src/app/[variants]/(main)/image/@menu/features/ConfigPanel/components/StepsSliderInput.tsx +11 -0
  219. package/src/app/[variants]/(main)/image/@menu/features/ConfigPanel/constants.ts +1 -0
  220. package/src/app/[variants]/(main)/image/@menu/features/ConfigPanel/index.tsx +93 -0
  221. package/src/app/[variants]/(main)/image/@topic/default.tsx +17 -0
  222. package/src/app/[variants]/(main)/image/@topic/features/Topics/NewTopicButton.tsx +64 -0
  223. package/src/app/[variants]/(main)/image/@topic/features/Topics/SkeletonList.tsx +34 -0
  224. package/src/app/[variants]/(main)/image/@topic/features/Topics/TopicItem.tsx +136 -0
  225. package/src/app/[variants]/(main)/image/@topic/features/Topics/TopicItemContainer.tsx +91 -0
  226. package/src/app/[variants]/(main)/image/@topic/features/Topics/TopicList.tsx +57 -0
  227. package/src/app/[variants]/(main)/image/@topic/features/Topics/TopicUrlSync.tsx +37 -0
  228. package/src/app/[variants]/(main)/image/@topic/features/Topics/index.tsx +19 -0
  229. package/src/app/[variants]/(main)/image/NotSupportClient.tsx +153 -0
  230. package/src/app/[variants]/(main)/image/_layout/Desktop/Container.tsx +35 -0
  231. package/src/app/[variants]/(main)/image/_layout/Desktop/RegisterHotkeys.tsx +10 -0
  232. package/src/app/[variants]/(main)/image/_layout/Desktop/index.tsx +30 -0
  233. package/src/app/[variants]/(main)/image/_layout/Mobile/index.tsx +14 -0
  234. package/src/app/[variants]/(main)/image/_layout/type.ts +7 -0
  235. package/src/app/[variants]/(main)/image/features/GenerationFeed/BatchItem.tsx +196 -0
  236. package/src/app/[variants]/(main)/image/features/GenerationFeed/GenerationItem/ActionButtons.tsx +60 -0
  237. package/src/app/[variants]/(main)/image/features/GenerationFeed/GenerationItem/ElapsedTime.tsx +90 -0
  238. package/src/app/[variants]/(main)/image/features/GenerationFeed/GenerationItem/ErrorState.tsx +65 -0
  239. package/src/app/[variants]/(main)/image/features/GenerationFeed/GenerationItem/LoadingState.tsx +43 -0
  240. package/src/app/[variants]/(main)/image/features/GenerationFeed/GenerationItem/SuccessState.tsx +49 -0
  241. package/src/app/[variants]/(main)/image/features/GenerationFeed/GenerationItem/index.tsx +156 -0
  242. package/src/app/[variants]/(main)/image/features/GenerationFeed/GenerationItem/styles.ts +51 -0
  243. package/src/app/[variants]/(main)/image/features/GenerationFeed/GenerationItem/types.ts +39 -0
  244. package/src/app/[variants]/(main)/image/features/GenerationFeed/GenerationItem/utils.ts +11 -0
  245. package/src/app/[variants]/(main)/image/features/GenerationFeed/index.tsx +97 -0
  246. package/src/app/[variants]/(main)/image/features/ImageWorkspace/Content.tsx +48 -0
  247. package/src/app/[variants]/(main)/image/features/ImageWorkspace/EmptyState.tsx +37 -0
  248. package/src/app/[variants]/(main)/image/features/ImageWorkspace/SkeletonList.tsx +50 -0
  249. package/src/app/[variants]/(main)/image/features/ImageWorkspace/index.tsx +23 -0
  250. package/src/app/[variants]/(main)/image/features/PromptInput/Title.tsx +38 -0
  251. package/src/app/[variants]/(main)/image/features/PromptInput/index.tsx +114 -0
  252. package/src/app/[variants]/(main)/image/layout.tsx +19 -0
  253. package/src/app/[variants]/(main)/image/loading.tsx +3 -0
  254. package/src/app/[variants]/(main)/image/page.tsx +47 -0
  255. package/src/app/[variants]/(main)/settings/system-agent/index.tsx +2 -1
  256. package/src/chains/summaryGenerationTitle.ts +25 -0
  257. package/src/components/ImageItem/index.tsx +9 -6
  258. package/src/{features/Conversation/Error → components/InvalidAPIKey}/APIKeyForm/Bedrock.tsx +3 -4
  259. package/src/{features/Conversation/Error → components/InvalidAPIKey}/APIKeyForm/ProviderApiKeyForm.tsx +5 -4
  260. package/src/components/InvalidAPIKey/APIKeyForm/index.tsx +108 -0
  261. package/src/{features/Conversation/Error → components/InvalidAPIKey}/APIKeyForm/useApiKey.ts +2 -1
  262. package/src/components/InvalidAPIKey/index.tsx +30 -0
  263. package/src/components/KeyValueEditor/index.tsx +203 -0
  264. package/src/components/KeyValueEditor/utils.ts +42 -0
  265. package/src/config/aiModels/fal.ts +52 -0
  266. package/src/config/aiModels/index.ts +3 -0
  267. package/src/config/aiModels/openai.ts +20 -6
  268. package/src/config/llm.ts +6 -0
  269. package/src/config/modelProviders/fal.ts +21 -0
  270. package/src/config/modelProviders/index.ts +3 -0
  271. package/src/config/paramsSchemas/fal/flux-kontext-dev.ts +8 -0
  272. package/src/config/paramsSchemas/fal/flux-pro-kontext.ts +11 -0
  273. package/src/config/paramsSchemas/fal/flux-schnell.ts +9 -0
  274. package/src/config/paramsSchemas/fal/imagen4.ts +10 -0
  275. package/src/config/paramsSchemas/openai/gpt-image-1.ts +10 -0
  276. package/src/const/hotkeys.ts +2 -2
  277. package/src/const/image.ts +6 -0
  278. package/src/const/settings/systemAgent.ts +1 -0
  279. package/src/database/client/migrations.json +27 -0
  280. package/src/database/migrations/0026_add_autovacuum_tuning.sql +2 -0
  281. package/src/database/migrations/0027_ai_image.sql +47 -0
  282. package/src/database/migrations/meta/0027_snapshot.json +6003 -0
  283. package/src/database/migrations/meta/_journal.json +7 -0
  284. package/src/database/models/__tests__/asyncTask.test.ts +7 -5
  285. package/src/database/models/__tests__/file.test.ts +287 -0
  286. package/src/database/models/__tests__/generation.test.ts +786 -0
  287. package/src/database/models/__tests__/generationBatch.test.ts +614 -0
  288. package/src/database/models/__tests__/generationTopic.test.ts +411 -0
  289. package/src/database/models/aiModel.ts +2 -0
  290. package/src/database/models/asyncTask.ts +1 -1
  291. package/src/database/models/file.ts +28 -20
  292. package/src/database/models/generation.ts +197 -0
  293. package/src/database/models/generationBatch.ts +212 -0
  294. package/src/database/models/generationTopic.ts +131 -0
  295. package/src/database/repositories/aiInfra/index.test.ts +151 -1
  296. package/src/database/repositories/aiInfra/index.ts +28 -19
  297. package/src/database/repositories/tableViewer/index.test.ts +1 -1
  298. package/src/database/schemas/file.ts +8 -0
  299. package/src/database/schemas/generation.ts +127 -0
  300. package/src/database/schemas/index.ts +1 -0
  301. package/src/database/schemas/relations.ts +45 -1
  302. package/src/database/type.ts +2 -0
  303. package/src/database/utils/idGenerator.ts +3 -0
  304. package/src/features/Conversation/Error/ChatInvalidApiKey.tsx +39 -0
  305. package/src/features/Conversation/Error/InvalidAccessCode.tsx +2 -2
  306. package/src/features/Conversation/Error/index.tsx +3 -3
  307. package/src/features/ImageSidePanel/index.tsx +83 -0
  308. package/src/features/ImageTopicPanel/index.tsx +79 -0
  309. package/src/features/PluginDevModal/MCPManifestForm/CollapsibleSection.tsx +62 -0
  310. package/src/features/PluginDevModal/MCPManifestForm/QuickImportSection.tsx +158 -0
  311. package/src/features/PluginDevModal/MCPManifestForm/index.tsx +99 -155
  312. package/src/features/PluginStore/McpList/Detail/Settings/index.tsx +5 -2
  313. package/src/hooks/useDownloadImage.ts +31 -0
  314. package/src/hooks/useFetchGenerationTopics.ts +13 -0
  315. package/src/hooks/useHotkeys/imageScope.ts +48 -0
  316. package/src/libs/mcp/client.ts +55 -22
  317. package/src/libs/mcp/types.ts +42 -6
  318. package/src/libs/model-runtime/BaseAI.ts +3 -1
  319. package/src/libs/model-runtime/ModelRuntime.test.ts +80 -0
  320. package/src/libs/model-runtime/ModelRuntime.ts +15 -1
  321. package/src/libs/model-runtime/UniformRuntime/index.ts +4 -1
  322. package/src/libs/model-runtime/fal/index.test.ts +442 -0
  323. package/src/libs/model-runtime/fal/index.ts +88 -0
  324. package/src/libs/model-runtime/openai/index.test.ts +396 -2
  325. package/src/libs/model-runtime/openai/index.ts +129 -3
  326. package/src/libs/model-runtime/runtimeMap.ts +2 -0
  327. package/src/libs/model-runtime/types/image.ts +25 -0
  328. package/src/libs/model-runtime/types/type.ts +1 -0
  329. package/src/libs/model-runtime/utils/openaiCompatibleFactory/index.ts +10 -0
  330. package/src/libs/standard-parameters/index.ts +1 -0
  331. package/src/libs/standard-parameters/meta-schema.test.ts +214 -0
  332. package/src/libs/standard-parameters/meta-schema.ts +147 -0
  333. package/src/libs/swr/index.ts +1 -0
  334. package/src/libs/trpc/async/asyncAuth.ts +29 -8
  335. package/src/libs/trpc/async/context.ts +42 -4
  336. package/src/libs/trpc/async/index.ts +17 -4
  337. package/src/libs/trpc/async/init.ts +8 -0
  338. package/src/libs/trpc/client/lambda.ts +19 -2
  339. package/src/locales/default/common.ts +2 -0
  340. package/src/locales/default/components.ts +35 -0
  341. package/src/locales/default/error.ts +2 -0
  342. package/src/locales/default/image.ts +100 -0
  343. package/src/locales/default/index.ts +2 -0
  344. package/src/locales/default/metadata.ts +4 -0
  345. package/src/locales/default/modelProvider.ts +2 -0
  346. package/src/locales/default/plugin.ts +22 -0
  347. package/src/locales/default/setting.ts +5 -0
  348. package/src/middleware.ts +1 -0
  349. package/src/server/modules/ElectronIPCClient/index.ts +9 -1
  350. package/src/server/modules/S3/index.ts +15 -0
  351. package/src/server/routers/async/caller.ts +9 -1
  352. package/src/server/routers/async/image.ts +253 -0
  353. package/src/server/routers/async/index.ts +2 -0
  354. package/src/server/routers/lambda/aiProvider.test.ts +1 -0
  355. package/src/server/routers/lambda/generation.test.ts +267 -0
  356. package/src/server/routers/lambda/generation.ts +86 -0
  357. package/src/server/routers/lambda/generationBatch.test.ts +376 -0
  358. package/src/server/routers/lambda/generationBatch.ts +56 -0
  359. package/src/server/routers/lambda/generationTopic.test.ts +508 -0
  360. package/src/server/routers/lambda/generationTopic.ts +93 -0
  361. package/src/server/routers/lambda/image.ts +248 -0
  362. package/src/server/routers/lambda/index.ts +8 -0
  363. package/src/server/routers/tools/mcp.ts +15 -0
  364. package/src/server/services/file/__tests__/index.test.ts +135 -0
  365. package/src/server/services/file/impls/local.test.ts +153 -52
  366. package/src/server/services/file/impls/local.ts +70 -46
  367. package/src/server/services/file/impls/s3.test.ts +114 -0
  368. package/src/server/services/file/impls/s3.ts +40 -0
  369. package/src/server/services/file/impls/type.ts +10 -0
  370. package/src/server/services/file/index.ts +14 -0
  371. package/src/server/services/generation/index.ts +239 -0
  372. package/src/server/services/mcp/index.ts +20 -2
  373. package/src/services/__tests__/generation.test.ts +40 -0
  374. package/src/services/__tests__/generationBatch.test.ts +36 -0
  375. package/src/services/__tests__/generationTopic.test.ts +72 -0
  376. package/src/services/electron/file.ts +3 -1
  377. package/src/services/generation.ts +16 -0
  378. package/src/services/generationBatch.ts +25 -0
  379. package/src/services/generationTopic.ts +28 -0
  380. package/src/services/image.ts +33 -0
  381. package/src/services/mcp.ts +12 -7
  382. package/src/services/upload.ts +43 -9
  383. package/src/store/aiInfra/slices/aiProvider/action.ts +25 -5
  384. package/src/store/aiInfra/slices/aiProvider/initialState.ts +1 -0
  385. package/src/store/aiInfra/slices/aiProvider/selectors.ts +3 -0
  386. package/src/store/chat/slices/aiChat/actions/generateAIChat.ts +5 -5
  387. package/src/store/chat/slices/message/action.ts +2 -2
  388. package/src/store/chat/slices/translate/action.ts +1 -1
  389. package/src/store/global/initialState.ts +9 -0
  390. package/src/store/global/selectors/systemStatus.ts +8 -0
  391. package/src/store/image/index.ts +2 -0
  392. package/src/store/image/initialState.ts +25 -0
  393. package/src/store/image/selectors.ts +4 -0
  394. package/src/store/image/slices/createImage/action.test.ts +330 -0
  395. package/src/store/image/slices/createImage/action.ts +134 -0
  396. package/src/store/image/slices/createImage/initialState.ts +9 -0
  397. package/src/store/image/slices/createImage/selectors.test.ts +114 -0
  398. package/src/store/image/slices/createImage/selectors.ts +9 -0
  399. package/src/store/image/slices/generationBatch/action.test.ts +495 -0
  400. package/src/store/image/slices/generationBatch/action.ts +303 -0
  401. package/src/store/image/slices/generationBatch/initialState.ts +13 -0
  402. package/src/store/image/slices/generationBatch/reducer.test.ts +568 -0
  403. package/src/store/image/slices/generationBatch/reducer.ts +101 -0
  404. package/src/store/image/slices/generationBatch/selectors.test.ts +307 -0
  405. package/src/store/image/slices/generationBatch/selectors.ts +36 -0
  406. package/src/store/image/slices/generationConfig/action.test.ts +351 -0
  407. package/src/store/image/slices/generationConfig/action.ts +295 -0
  408. package/src/store/image/slices/generationConfig/hooks.test.ts +304 -0
  409. package/src/store/image/slices/generationConfig/hooks.ts +118 -0
  410. package/src/store/image/slices/generationConfig/index.ts +1 -0
  411. package/src/store/image/slices/generationConfig/initialState.ts +37 -0
  412. package/src/store/image/slices/generationConfig/selectors.test.ts +204 -0
  413. package/src/store/image/slices/generationConfig/selectors.ts +25 -0
  414. package/src/store/image/slices/generationTopic/action.test.ts +687 -0
  415. package/src/store/image/slices/generationTopic/action.ts +319 -0
  416. package/src/store/image/slices/generationTopic/index.ts +2 -0
  417. package/src/store/image/slices/generationTopic/initialState.ts +14 -0
  418. package/src/store/image/slices/generationTopic/reducer.test.ts +198 -0
  419. package/src/store/image/slices/generationTopic/reducer.ts +66 -0
  420. package/src/store/image/slices/generationTopic/selectors.test.ts +103 -0
  421. package/src/store/image/slices/generationTopic/selectors.ts +15 -0
  422. package/src/store/image/store.ts +42 -0
  423. package/src/store/image/utils/size.ts +51 -0
  424. package/src/store/tool/slices/customPlugin/action.ts +10 -1
  425. package/src/store/tool/slices/mcpStore/action.ts +6 -4
  426. package/src/store/user/slices/settings/selectors/__snapshots__/settings.test.ts.snap +4 -0
  427. package/src/store/user/slices/settings/selectors/systemAgent.ts +2 -0
  428. package/src/types/aiModel.ts +8 -3
  429. package/src/types/aiProvider.ts +1 -0
  430. package/src/types/asyncTask.ts +2 -0
  431. package/src/types/files/index.ts +5 -0
  432. package/src/types/generation/index.ts +80 -0
  433. package/src/types/hotkey.ts +2 -0
  434. package/src/types/plugins/mcp.ts +2 -6
  435. package/src/types/tool/plugin.ts +8 -0
  436. package/src/types/user/settings/keyVaults.ts +5 -0
  437. package/src/types/user/settings/systemAgent.ts +1 -0
  438. package/src/utils/client/downloadFile.ts +33 -4
  439. package/src/utils/number.test.ts +105 -0
  440. package/src/utils/number.ts +25 -0
  441. package/src/utils/server/__tests__/geo.test.ts +6 -3
  442. package/src/utils/storeDebug.test.ts +152 -0
  443. package/src/utils/storeDebug.ts +16 -7
  444. package/src/utils/time.test.ts +259 -0
  445. package/src/utils/time.ts +18 -0
  446. package/src/utils/units.ts +61 -0
  447. package/src/utils/url.test.ts +358 -9
  448. package/src/utils/url.ts +105 -3
  449. package/{vitest.server.config.ts → vitest.config.server.ts} +3 -0
  450. package/.cursor/rules/i18n/i18n-auto-attached.mdc +0 -6
  451. package/src/features/Conversation/Error/APIKeyForm/index.tsx +0 -105
  452. package/src/features/Conversation/Error/InvalidAPIKey.tsx +0 -16
  453. package/src/features/PluginDevModal/MCPManifestForm/EnvEditor.tsx +0 -227
  454. /package/.cursor/rules/{i18n/i18n.mdc → i18n.mdc} +0 -0
  455. /package/src/app/[variants]/(main)/settings/system-agent/features/{createForm.tsx → SystemAgentForm.tsx} +0 -0
  456. /package/src/{features/Conversation/Error → components/InvalidAPIKey}/APIKeyForm/LoadingContext.ts +0 -0
@@ -57,12 +57,28 @@
57
57
  }
58
58
  },
59
59
  "mcp": {
60
+ "advanced": {
61
+ "title": "高级设置"
62
+ },
60
63
  "args": {
61
64
  "desc": "传递给执行命令的参数列表,一般在这里输入 MCP 服务器名称,或启动脚本路径",
62
65
  "label": "命令参数",
63
66
  "placeholder": "例如:mcp-hello-world",
64
67
  "required": "请输入启动参数"
65
68
  },
69
+ "auth": {
70
+ "bear": "API Key",
71
+ "desc": "选择 MCP 服务器的认证方式",
72
+ "label": "认证类型",
73
+ "none": "无需认证",
74
+ "placeholder": "请选择认证类型",
75
+ "token": {
76
+ "desc": "输入你的 API Key 或 Bearer Token",
77
+ "label": "API Key",
78
+ "placeholder": "sk-xxxxx",
79
+ "required": "请输入认证令牌"
80
+ }
81
+ },
66
82
  "avatar": {
67
83
  "label": "插件图标"
68
84
  },
@@ -90,6 +106,11 @@
90
106
  "label": "MCP Server 环境变量",
91
107
  "stringifyError": "无法序列化参数,请检查参数格式"
92
108
  },
109
+ "headers": {
110
+ "add": "新增一行",
111
+ "desc": "输入请求头",
112
+ "label": "HTTP Headers"
113
+ },
93
114
  "identifier": {
94
115
  "desc": "为你的 MCP 插件指定一个名称,需要使用英文字符",
95
116
  "invalid": "标识符只能包含字母、数字、连字符和下划线",
@@ -269,6 +290,7 @@
269
290
  "showDetails": "查看详情"
270
291
  },
271
292
  "errorTypes": {
293
+ "AUTHORIZATION_ERROR": "授权验证错误",
272
294
  "CONNECTION_FAILED": "连接失败",
273
295
  "INITIALIZATION_TIMEOUT": "初始化超时",
274
296
  "PROCESS_SPAWN_ERROR": "进程启动失败",
@@ -29,6 +29,9 @@
29
29
  "deepseek": {
30
30
  "description": "DeepSeek 是一家专注于人工智能技术研究和应用的公司,其最新模型 DeepSeek-V3 多项评测成绩超越 Qwen2.5-72B 和 Llama-3.1-405B 等开源模型,性能对齐领军闭源模型 GPT-4o 与 Claude-3.5-Sonnet。"
31
31
  },
32
+ "fal": {
33
+ "description": "面向开发者的生成式媒体平台"
34
+ },
32
35
  "fireworksai": {
33
36
  "description": "Fireworks AI 是一家领先的高级语言模型服务商,专注于功能调用和多模态处理。其最新模型 Firefunction V2 基于 Llama-3,优化用于函数调用、对话及指令跟随。视觉语言模型 FireLLaVA-13B 支持图像和文本混合输入。其他 notable 模型包括 Llama 系列和 Mixtral 系列,提供高效的多语言指令跟随与生成支持。"
34
37
  },
@@ -484,6 +484,11 @@
484
484
  "placeholder": "请输入自定义提示词",
485
485
  "title": "自定义提示词"
486
486
  },
487
+ "generationTopic": {
488
+ "label": "AI 绘画话题命名模型",
489
+ "modelDesc": "指定用于 AI 绘画自动命名话题的模型",
490
+ "title": "AI 绘画自动命名话题"
491
+ },
487
492
  "helpInfo": "当创建新助手时,将以默认助手设置作为预设值。",
488
493
  "historyCompress": {
489
494
  "label": "会话历史模型",
@@ -183,6 +183,7 @@
183
183
  },
184
184
  "fullscreen": "全螢幕模式",
185
185
  "historyRange": "歷史範圍",
186
+ "import": "匯入",
186
187
  "importData": "匯入資料",
187
188
  "importModal": {
188
189
  "error": {
@@ -324,6 +325,7 @@
324
325
  }
325
326
  },
326
327
  "tab": {
328
+ "aiImage": "AI 繪畫",
327
329
  "chat": "對話",
328
330
  "discover": "發現",
329
331
  "files": "檔案",
@@ -68,6 +68,22 @@
68
68
  "GoBack": {
69
69
  "back": "返回"
70
70
  },
71
+ "ImageUpload": {
72
+ "actions": {
73
+ "changeImage": "點擊更換圖片"
74
+ },
75
+ "placeholder": {
76
+ "primary": "新增圖片",
77
+ "secondary": "點擊上傳"
78
+ }
79
+ },
80
+ "KeyValueEditor": {
81
+ "addButton": "新增一行",
82
+ "deleteTooltip": "刪除",
83
+ "duplicateKeyError": "鍵名必須唯一",
84
+ "keyPlaceholder": "鍵",
85
+ "valuePlaceholder": "值"
86
+ },
71
87
  "MaxTokenSlider": {
72
88
  "unlimited": "無限制"
73
89
  },
@@ -91,6 +107,25 @@
91
107
  "provider": "提供商",
92
108
  "title": "模型"
93
109
  },
110
+ "MultiImagesUpload": {
111
+ "actions": {
112
+ "uploadMore": "點擊上傳更多"
113
+ },
114
+ "modal": {
115
+ "complete": "完成",
116
+ "newFileIndicator": "新增",
117
+ "selectImageToPreview": "請選擇要預覽的圖片",
118
+ "title": "管理圖片 ({{count}})",
119
+ "upload": "上傳圖片"
120
+ },
121
+ "placeholder": {
122
+ "primary": "點擊上傳圖片",
123
+ "secondary": "支援多張圖片選擇"
124
+ },
125
+ "progress": {
126
+ "uploadingWithCount": "{{completed}}/{{total}} 已上傳"
127
+ }
128
+ },
94
129
  "OllamaSetupGuide": {
95
130
  "action": {
96
131
  "close": "關閉提示",
@@ -123,6 +123,7 @@
123
123
  "stt": {
124
124
  "responseError": "服務請求失敗,請檢查配置或重試"
125
125
  },
126
+ "testConnectionFailed": "測試連線失敗:{{error}}",
126
127
  "tts": {
127
128
  "responseError": "服務請求失敗,請檢查配置或重試"
128
129
  },
@@ -130,6 +131,7 @@
130
131
  "addProxyUrl": "新增 OpenAI 代理網址(選填)",
131
132
  "apiKey": {
132
133
  "description": "輸入您的 {{name}} API 金鑰即可開始會話",
134
+ "imageGenerationDescription": "輸入你的 {{name}} API Key 即可開始生成",
133
135
  "title": "使用自定義 {{name}} API 金鑰"
134
136
  },
135
137
  "closeMessage": "關閉提示",
@@ -0,0 +1,100 @@
1
+ {
2
+ "config": {
3
+ "aspectRatio": {
4
+ "label": "比例",
5
+ "lock": "鎖定寬高比",
6
+ "unlock": "解鎖寬高比"
7
+ },
8
+ "header": {
9
+ "desc": "簡單描述,即刻創作",
10
+ "title": "繪畫"
11
+ },
12
+ "height": {
13
+ "label": "高度"
14
+ },
15
+ "imageNum": {
16
+ "label": "圖片數量"
17
+ },
18
+ "imageUrl": {
19
+ "label": "參考圖"
20
+ },
21
+ "imageUrls": {
22
+ "label": "參考圖"
23
+ },
24
+ "model": {
25
+ "label": "模型"
26
+ },
27
+ "prompt": {
28
+ "placeholder": "描述你想要生成的內容"
29
+ },
30
+ "seed": {
31
+ "label": "種子",
32
+ "random": "隨機種子"
33
+ },
34
+ "size": {
35
+ "label": "尺寸"
36
+ },
37
+ "steps": {
38
+ "label": "步數"
39
+ },
40
+ "title": "AI 繪畫",
41
+ "width": {
42
+ "label": "寬度"
43
+ }
44
+ },
45
+ "generation": {
46
+ "actions": {
47
+ "applySeed": "應用種子",
48
+ "copyError": "複製錯誤訊息",
49
+ "copyPrompt": "複製提示詞",
50
+ "copySeed": "複製種子",
51
+ "delete": "刪除",
52
+ "deleteBatch": "刪除批次",
53
+ "download": "下載",
54
+ "downloadFailed": "下載圖片失敗",
55
+ "errorCopied": "錯誤訊息已複製到剪貼簿",
56
+ "errorCopyFailed": "複製錯誤訊息失敗",
57
+ "generate": "生成",
58
+ "promptCopied": "提示詞已複製到剪貼簿",
59
+ "promptCopyFailed": "複製提示詞失敗",
60
+ "reuseSettings": "重用設定",
61
+ "seedApplied": "種子已應用到配置",
62
+ "seedApplyFailed": "應用種子失敗",
63
+ "seedCopied": "種子已複製到剪貼簿",
64
+ "seedCopyFailed": "複製種子失敗"
65
+ },
66
+ "metadata": {
67
+ "count": "{{count}} 張圖片"
68
+ },
69
+ "status": {
70
+ "failed": "生成失敗",
71
+ "generating": "生成中..."
72
+ }
73
+ },
74
+ "notSupportGuide": {
75
+ "desc": "當前部署實例為客戶端資料庫模式,無法使用 AI 圖像生成功能。請切換到<1>服務端資料庫部署模式</1>,或直接使用 <3>LobeChat Cloud</3>",
76
+ "features": {
77
+ "fileIntegration": {
78
+ "desc": "與檔案管理系統深度整合,生成的圖片自動保存到檔案系統,支援統一管理和組織",
79
+ "title": "檔案系統互通"
80
+ },
81
+ "llmAssisted": {
82
+ "desc": "結合大型語言模型能力,智能優化和擴展提示詞,提升圖像生成品質(即將推出)",
83
+ "title": "LLM 輔助生圖"
84
+ },
85
+ "multiProviders": {
86
+ "desc": "支援多種 AI 繪畫服務商,包括 OpenAI gpt-image-1、Google Imagen、FAL.ai 等,提供豐富的模型選擇",
87
+ "title": "多 Providers 支援"
88
+ }
89
+ },
90
+ "title": "當前部署模式不支援 AI 繪畫"
91
+ },
92
+ "topic": {
93
+ "createNew": "新建主題",
94
+ "deleteConfirm": "刪除生成主題",
95
+ "deleteConfirmDesc": "即將刪除該生成主題,刪除後將無法復原,請謹慎操作。",
96
+ "empty": "暫無生成主題",
97
+ "title": "繪畫主題",
98
+ "untitled": "預設主題"
99
+ }
100
+ }
@@ -32,6 +32,10 @@
32
32
  "search": "搜尋",
33
33
  "title": "發現"
34
34
  },
35
+ "image": {
36
+ "description": "{{appName}} 帶給你最好的 GPT Image、Flux、Midjourney、Stable Diffusion 使用體驗",
37
+ "title": "AI 繪畫"
38
+ },
35
39
  "plugins": {
36
40
  "description": "搜尋、圖表生成、學術、圖像生成、視頻生成、語音生成、自動化工作流,定制 ChatGPT / Claude 專屬的 ToolCall 插件能力",
37
41
  "title": "插件市場"
@@ -66,6 +66,7 @@
66
66
  "customRegion": "自定義服務區域",
67
67
  "customSessionToken": "自訂 Session Token",
68
68
  "description": "輸入你的 AWS AccessKeyId / SecretAccessKey 即可開始會話。應用程式不會記錄你的驗證配置",
69
+ "imageGenerationDescription": "輸入你的 AWS AccessKeyId / SecretAccessKey 即可開始生成。應用不會記錄你的鑑權配置",
69
70
  "title": "使用自定義 Bedrock 驗證資訊"
70
71
  }
71
72
  },
@@ -203,24 +203,21 @@
203
203
  "Pro/Qwen/Qwen2.5-VL-7B-Instruct": {
204
204
  "description": "Qwen2.5-VL 是 Qwen 系列的新成員,具備強大的視覺理解能力,能分析圖像中的文字、圖表和版面配置,並能理解長影片和捕捉事件。它可以進行推理、操作工具,支援多格式物件定位和生成結構化輸出,優化了影片理解的動態解析度與影格率訓練,並提升了視覺編碼器效率。"
205
205
  },
206
+ "Pro/THUDM/GLM-4.1V-9B-Thinking": {
207
+ "description": "GLM-4.1V-9B-Thinking 是由智譜 AI 和清華大學 KEG 實驗室聯合發布的一款開源視覺語言模型(VLM),專為處理複雜的多模態認知任務而設計。該模型基於 GLM-4-9B-0414 基礎模型,通過引入「思維鏈」(Chain-of-Thought)推理機制和採用強化學習策略,顯著提升了其跨模態的推理能力和穩定性。"
208
+ },
206
209
  "Pro/THUDM/glm-4-9b-chat": {
207
210
  "description": "GLM-4-9B-Chat 是智譜 AI 推出的 GLM-4 系列預訓練模型中的開源版本。該模型在語義、數學、推理、代碼和知識等多個方面表現出色。除了支持多輪對話外,GLM-4-9B-Chat 還具備網頁瀏覽、代碼執行、自定義工具調用(Function Call)和長文本推理等高級功能。模型支持 26 種語言,包括中文、英文、日文、韓文和德文等。在多項基準測試中,GLM-4-9B-Chat 展現了優秀的性能,如 AlignBench-v2、MT-Bench、MMLU 和 C-Eval 等。該模型支持最大 128K 的上下文長度,適用於學術研究和商業應用"
208
211
  },
209
212
  "Pro/deepseek-ai/DeepSeek-R1": {
210
213
  "description": "DeepSeek-R1 是一款強化學習(RL)驅動的推理模型,解決了模型中的重複性和可讀性問題。在 RL 之前,DeepSeek-R1 引入了冷啟動數據,進一步優化了推理性能。它在數學、代碼和推理任務中與 OpenAI-o1 表現相當,並且透過精心設計的訓練方法,提升了整體效果。"
211
214
  },
212
- "Pro/deepseek-ai/DeepSeek-R1-0120": {
213
- "description": "DeepSeek-R1 是一款強化學習(RL)驅動的推理模型,解決了模型中的重複性和可讀性問題。在 RL 之前,DeepSeek-R1 引入了冷啟動資料,進一步優化了推理性能。它在數學、程式碼和推理任務中與 OpenAI-o1 表現相當,並且透過精心設計的訓練方法,提升了整體效果。"
214
- },
215
215
  "Pro/deepseek-ai/DeepSeek-R1-Distill-Qwen-7B": {
216
216
  "description": "DeepSeek-R1-Distill-Qwen-7B 是基於 Qwen2.5-Math-7B 透過知識蒸餾技術所獲得的模型。該模型使用 DeepSeek-R1 生成的 80 萬個精選樣本進行微調,展現出優異的推理能力。在多個基準測試中表現出色,其中在 MATH-500 上達到了 92.8% 的準確率,在 AIME 2024 上達到了 55.5% 的通過率,在 CodeForces 上獲得了 1189 的評分,作為 7B 規模的模型展示了較強的數學和程式設計能力。"
217
217
  },
218
218
  "Pro/deepseek-ai/DeepSeek-V3": {
219
219
  "description": "DeepSeek-V3 是一款擁有 6710 億參數的混合專家(MoE)語言模型,採用多頭潛在注意力(MLA)和 DeepSeekMoE 架構,結合無輔助損失的負載平衡策略,優化推理和訓練效率。透過在 14.8 萬億高質量tokens上預訓練,並進行監督微調和強化學習,DeepSeek-V3 在性能上超越其他開源模型,接近領先閉源模型。"
220
220
  },
221
- "Pro/deepseek-ai/DeepSeek-V3-1226": {
222
- "description": "DeepSeek-V3 是一款擁有 6710 億參數的混合專家(MoE)語言模型,採用多頭潛在注意力(MLA)和 DeepSeekMoE 架構,結合無輔助損失的負載平衡策略,優化推理和訓練效率。透過在 14.8 萬兆高品質 tokens 上預訓練,並進行監督微調和強化學習,DeepSeek-V3 在性能上超越其他開源模型,接近領先的閉源模型。"
223
- },
224
221
  "QwQ-32B-Preview": {
225
222
  "description": "QwQ-32B-Preview 是一款獨具創新的自然語言處理模型,能夠高效處理複雜的對話生成與上下文理解任務。"
226
223
  },
@@ -383,6 +380,9 @@
383
380
  "THUDM/GLM-4-9B-0414": {
384
381
  "description": "GLM-4-9B-0414 是 GLM 系列的小型模型,擁有 90 億參數。該模型繼承了 GLM-4-32B 系列的技術特點,但提供了更輕量級的部署選擇。儘管規模較小,GLM-4-9B-0414 仍在程式碼生成、網頁設計、SVG 圖形生成和基於搜索的寫作等任務上展現出色能力。"
385
382
  },
383
+ "THUDM/GLM-4.1V-9B-Thinking": {
384
+ "description": "GLM-4.1V-9B-Thinking 是由智譜 AI 和清華大學 KEG 實驗室聯合發布的一款開源視覺語言模型(VLM),專為處理複雜的多模態認知任務而設計。該模型基於 GLM-4-9B-0414 基礎模型,通過引入「思維鏈」(Chain-of-Thought)推理機制和採用強化學習策略,顯著提升了其跨模態的推理能力和穩定性。"
385
+ },
386
386
  "THUDM/GLM-Z1-32B-0414": {
387
387
  "description": "GLM-Z1-32B-0414 是一個具有深度思考能力的推理模型。該模型基於 GLM-4-32B-0414 通過冷啟動和擴展強化學習開發,並在數學、程式碼和邏輯任務上進行了進一步訓練。與基礎模型相比,GLM-Z1-32B-0414 顯著提升了數學能力和解決複雜任務的能力。"
388
388
  },
@@ -539,6 +539,9 @@
539
539
  "anthropic/claude-sonnet-4": {
540
540
  "description": "Claude Sonnet 4 可以產生近乎即時的回應或延長的逐步思考,使用者可以清楚地看到這些過程。API 使用者還可以對模型思考的時間進行細緻的控制。"
541
541
  },
542
+ "ascend-tribe/pangu-pro-moe": {
543
+ "description": "Pangu-Pro-MoE 72B-A16B 是一款 720 億參數、激活 160 億參的稀疏大型語言模型,它基於分組混合專家(MoGE)架構,它在專家選擇階段對專家進行分組,並約束 token 在每個組內激活等量專家,從而實現專家負載均衡,顯著提升模型在昇騰平台的部署效率。"
544
+ },
542
545
  "aya": {
543
546
  "description": "Aya 23 是 Cohere 推出的多語言模型,支持 23 種語言,為多元化語言應用提供便利。"
544
547
  },
@@ -548,6 +551,9 @@
548
551
  "baichuan/baichuan2-13b-chat": {
549
552
  "description": "Baichuan-13B百川智能開發的包含130億參數的開源可商用的大規模語言模型,在權威的中文和英文benchmark上均取得同尺寸最好的效果。"
550
553
  },
554
+ "baidu/ERNIE-4.5-300B-A47B": {
555
+ "description": "ERNIE-4.5-300B-A47B 是由百度公司開發的一款基於混合專家(MoE)架構的大型語言模型。該模型總參數量為 3000 億,但在推理時每個 token 僅激活 470 億參數,從而在保證強大性能的同時兼顧了計算效率。作為 ERNIE 4.5 系列的核心模型之一,在文本理解、生成、推理和程式設計等任務上展現出卓越的能力。該模型採用了一種創新的多模態異構 MoE 預訓練方法,通過文本與視覺模態的聯合訓練,有效提升了模型的綜合能力,尤其在指令遵循和世界知識記憶方面效果突出。"
556
+ },
551
557
  "c4ai-aya-expanse-32b": {
552
558
  "description": "Aya Expanse 是一款高性能的 32B 多語言模型,旨在通過指令調優、數據套利、偏好訓練和模型合併的創新,挑戰單語言模型的表現。它支持 23 種語言。"
553
559
  },
@@ -1013,6 +1019,15 @@
1013
1019
  "ernie-x1-turbo-32k": {
1014
1020
  "description": "與ERNIE-X1-32K相比,模型效果和性能更佳。"
1015
1021
  },
1022
+ "flux-kontext/dev": {
1023
+ "description": "Frontier 影像編輯模型。"
1024
+ },
1025
+ "flux-pro/kontext": {
1026
+ "description": "FLUX.1 Kontext [pro] 能夠處理文字和參考圖像作為輸入,無縫實現目標性的局部編輯和複雜的整體場景變換。"
1027
+ },
1028
+ "flux/schnell": {
1029
+ "description": "FLUX.1 [schnell] 是一個擁有120億參數的流式轉換器模型,能夠在1到4步內從文字生成高品質圖像,適合個人和商業用途。"
1030
+ },
1016
1031
  "gemini-1.0-pro-001": {
1017
1032
  "description": "Gemini 1.0 Pro 001 (Tuning) 提供穩定並可調優的性能,是複雜任務解決方案的理想選擇。"
1018
1033
  },
@@ -1097,9 +1112,6 @@
1097
1112
  "gemini-2.5-pro": {
1098
1113
  "description": "Gemini 2.5 Pro 是 Google 最先進的思維模型,能夠對程式碼、數學和 STEM 領域的複雜問題進行推理,以及使用長上下文分析大型資料集、程式碼庫和文件。"
1099
1114
  },
1100
- "gemini-2.5-pro-exp-03-25": {
1101
- "description": "Gemini 2.5 Pro 實驗版是 Google 最先進的思維模型,能夠對代碼、數學和 STEM 領域的複雜問題進行推理,還能利用長上下文來分析大型數據集、代碼庫和文檔。"
1102
- },
1103
1115
  "gemini-2.5-pro-preview-03-25": {
1104
1116
  "description": "Gemini 2.5 Pro Preview 是 Google 最先進的思維模型,能夠對程式碼、數學和STEM領域的複雜問題進行推理,以及使用長上下文分析大型數據集、程式庫和文檔。"
1105
1117
  },
@@ -1166,6 +1178,12 @@
1166
1178
  "glm-4-plus": {
1167
1179
  "description": "GLM-4-Plus作為高智能旗艦,具備強大的處理長文本和複雜任務的能力,性能全面提升。"
1168
1180
  },
1181
+ "glm-4.1v-thinking-flash": {
1182
+ "description": "GLM-4.1V-Thinking 系列模型是目前已知10B級別的VLM模型中性能最強的視覺模型,融合了同級別SOTA的各項視覺語言任務,包括影片理解、圖片問答、學科解題、OCR文字識別、文件和圖表解讀、GUI Agent、前端網頁程式設計、Grounding等,多項任務能力甚至超過8倍參數量的Qwen2.5-VL-72B。通過領先的強化學習技術,模型掌握了透過思維鏈推理的方式提升回答的準確性和豐富度,從最終效果和可解釋性等維度都顯著超過傳統的非thinking模型。"
1183
+ },
1184
+ "glm-4.1v-thinking-flashx": {
1185
+ "description": "GLM-4.1V-Thinking 系列模型是目前已知10B級別的VLM模型中性能最強的視覺模型,融合了同級別SOTA的各項視覺語言任務,包括影片理解、圖片問答、學科解題、OCR文字識別、文件和圖表解讀、GUI Agent、前端網頁程式設計、Grounding等,多項任務能力甚至超過8倍參數量的Qwen2.5-VL-72B。通過領先的強化學習技術,模型掌握了透過思維鏈推理的方式提升回答的準確性和豐富度,從最終效果和可解釋性等維度都顯著超過傳統的非thinking模型。"
1186
+ },
1169
1187
  "glm-4v": {
1170
1188
  "description": "GLM-4V提供強大的圖像理解與推理能力,支持多種視覺任務。"
1171
1189
  },
@@ -1187,6 +1205,9 @@
1187
1205
  "glm-z1-flash": {
1188
1206
  "description": "GLM-Z1 系列具備強大的複雜推理能力,在邏輯推理、數學、程式設計等領域表現優異。最大上下文長度為32K。"
1189
1207
  },
1208
+ "glm-z1-flashx": {
1209
+ "description": "高速低價:Flash增強版本,超快推理速度,更快並發保障。"
1210
+ },
1190
1211
  "glm-zero-preview": {
1191
1212
  "description": "GLM-Zero-Preview具備強大的複雜推理能力,在邏輯推理、數學、程式設計等領域表現優異。"
1192
1213
  },
@@ -1238,6 +1259,9 @@
1238
1259
  "google/gemma-2b-it": {
1239
1260
  "description": "Gemma Instruct (2B) 提供基本的指令處理能力,適合輕量級應用。"
1240
1261
  },
1262
+ "google/gemma-3-1b-it": {
1263
+ "description": "Gemma 3 1B 是谷歌的一款開源語言模型,以其在效率和性能方面樹立了新的標準。"
1264
+ },
1241
1265
  "google/gemma-3-27b-it": {
1242
1266
  "description": "Gemma 3 27B 是谷歌的一款開源語言模型,以其在效率和性能方面設立了新的標準。"
1243
1267
  },
@@ -1349,6 +1373,9 @@
1349
1373
  "gpt-4o-transcribe": {
1350
1374
  "description": "GPT-4o Transcribe 是一種使用 GPT-4o 轉錄音訊的語音轉文字模型。與原始 Whisper 模型相比,它降低了字詞錯誤率,並提升了語言識別和準確性。使用它來獲得更準確的轉錄。"
1351
1375
  },
1376
+ "gpt-image-1": {
1377
+ "description": "ChatGPT 原生多模態圖片生成模型"
1378
+ },
1352
1379
  "grok-2-1212": {
1353
1380
  "description": "該模型在準確性、指令遵循和多語言能力方面有所改進。"
1354
1381
  },
@@ -1373,6 +1400,9 @@
1373
1400
  "gryphe/mythomax-l2-13b": {
1374
1401
  "description": "MythoMax l2 13B 是一款合併了多個頂尖模型的創意與智能相結合的語言模型。"
1375
1402
  },
1403
+ "hunyuan-a13b": {
1404
+ "description": "混元第一個混合推理模型,hunyuan-standard-256K 的升級版本,總參數80B,激活13B,預設為慢思考模式,支持透過參數或指令進行快慢思考模式切換,慢快思考切換方式為 query 前加/ no_think;整體能力相較上一代全面提升,特別是數學、科學、長文理解和 Agent 能力提升顯著。"
1405
+ },
1376
1406
  "hunyuan-code": {
1377
1407
  "description": "混元最新代碼生成模型,經過 200B 高質量代碼數據增訓基座模型,迭代半年高質量 SFT 數據訓練,上下文長窗口長度增大到 8K,五大語言代碼生成自動評測指標上位居前列;五大語言 10 項考量各方面綜合代碼任務人工高質量評測上,性能處於第一梯隊。"
1378
1408
  },
@@ -1424,6 +1454,9 @@
1424
1454
  "hunyuan-t1-vision": {
1425
1455
  "description": "混元多模態理解深度思考模型,支援多模態原生長思維鏈,擅長處理各種圖片推理場景,在理科難題上相比快思考模型全面提升。"
1426
1456
  },
1457
+ "hunyuan-t1-vision-20250619": {
1458
+ "description": "混元最新版 t1-vision 多模態理解深度思考模型,支持多模態原生長思維鏈,相較上一代預設版本模型全面提升。"
1459
+ },
1427
1460
  "hunyuan-turbo": {
1428
1461
  "description": "混元全新一代大語言模型的預覽版,採用全新的混合專家模型(MoE)結構,相較於 hunyuan-pro 推理效率更快,效果表現更強。"
1429
1462
  },
@@ -1454,9 +1487,18 @@
1454
1487
  "hunyuan-turbos-role-plus": {
1455
1488
  "description": "混元最新版角色扮演模型,混元官方精調訓練推出的角色扮演模型,基於混元模型結合角色扮演場景資料集進行增訓,在角色扮演場景具有更好的基礎效果。"
1456
1489
  },
1490
+ "hunyuan-turbos-vision": {
1491
+ "description": "此模型適用於圖文理解場景,是基於混元最新 turbos 的新一代視覺語言旗艦大型模型,聚焦圖文理解相關任務,包括基於圖片的實體識別、知識問答、文案創作、拍照解題等方面,相較前一代模型全面提升。"
1492
+ },
1493
+ "hunyuan-turbos-vision-20250619": {
1494
+ "description": "混元最新版 turbos-vision 視覺語言旗艦大型模型,在圖文理解相關的任務上,包括基於圖片的實體識別、知識問答、文案創作、拍照解題等方面,相較上一代預設版本模型全面提升。"
1495
+ },
1457
1496
  "hunyuan-vision": {
1458
1497
  "description": "混元最新多模態模型,支持圖片 + 文本輸入生成文本內容。"
1459
1498
  },
1499
+ "imagen4/preview": {
1500
+ "description": "Google 最高品質的圖像生成模型"
1501
+ },
1460
1502
  "internlm/internlm2_5-7b-chat": {
1461
1503
  "description": "InternLM2.5 提供多場景下的智能對話解決方案。"
1462
1504
  },
@@ -57,12 +57,28 @@
57
57
  }
58
58
  },
59
59
  "mcp": {
60
+ "advanced": {
61
+ "title": "進階設定"
62
+ },
60
63
  "args": {
61
64
  "desc": "傳遞給執行命令的參數列表,一般在這裡輸入 MCP 伺服器名稱,或啟動腳本路徑",
62
65
  "label": "命令參數",
63
66
  "placeholder": "例如:--port 8080 --debug",
64
67
  "required": "請輸入啟動參數"
65
68
  },
69
+ "auth": {
70
+ "bear": "API 金鑰",
71
+ "desc": "選擇 MCP 伺服器的認證方式",
72
+ "label": "認證類型",
73
+ "none": "無需認證",
74
+ "placeholder": "請選擇認證類型",
75
+ "token": {
76
+ "desc": "輸入你的 API 金鑰或 Bearer Token",
77
+ "label": "API 金鑰",
78
+ "placeholder": "sk-xxxxx",
79
+ "required": "請輸入認證令牌"
80
+ }
81
+ },
66
82
  "avatar": {
67
83
  "label": "插件圖示"
68
84
  },
@@ -90,6 +106,11 @@
90
106
  "label": "MCP Server 環境變數",
91
107
  "stringifyError": "無法序列化參數,請檢查參數格式"
92
108
  },
109
+ "headers": {
110
+ "add": "新增一行",
111
+ "desc": "輸入請求標頭",
112
+ "label": "HTTP 標頭"
113
+ },
93
114
  "identifier": {
94
115
  "desc": "為你的 MCP 插件指定一個名稱,需要使用英文字符",
95
116
  "invalid": "只能輸入英文字符、數字、- 和_ 這兩個符號",
@@ -269,6 +290,7 @@
269
290
  "showDetails": "查看詳情"
270
291
  },
271
292
  "errorTypes": {
293
+ "AUTHORIZATION_ERROR": "授權驗證錯誤",
272
294
  "CONNECTION_FAILED": "連接失敗",
273
295
  "INITIALIZATION_TIMEOUT": "初始化逾時",
274
296
  "PROCESS_SPAWN_ERROR": "進程啟動失敗",
@@ -29,6 +29,9 @@
29
29
  "deepseek": {
30
30
  "description": "DeepSeek 是一家專注於人工智慧技術研究和應用的公司,其最新模型 DeepSeek-V2.5 融合了通用對話和代碼處理能力,並在人類偏好對齊、寫作任務和指令跟隨等方面實現了顯著提升。"
31
31
  },
32
+ "fal": {
33
+ "description": "面向開發者的生成式媒體平台"
34
+ },
32
35
  "fireworksai": {
33
36
  "description": "Fireworks AI 是一家領先的高級語言模型服務商,專注於功能調用和多模態處理。其最新模型 Firefunction V2 基於 Llama-3,優化用於函數調用、對話及指令跟隨。視覺語言模型 FireLLaVA-13B 支持圖像和文本混合輸入。其他 notable 模型包括 Llama 系列和 Mixtral 系列,提供高效的多語言指令跟隨與生成支持。"
34
37
  },
@@ -484,6 +484,11 @@
484
484
  "placeholder": "請輸入自訂提示詞",
485
485
  "title": "自訂提示詞"
486
486
  },
487
+ "generationTopic": {
488
+ "label": "AI 繪畫話題命名模型",
489
+ "modelDesc": "指定用於 AI 繪畫自動命名話題的模型",
490
+ "title": "AI 繪畫自動命名話題"
491
+ },
487
492
  "helpInfo": "當創建新助手時,將以預設助手設定作為預設值。",
488
493
  "historyCompress": {
489
494
  "label": "會話歷史模型",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "1.98.1",
3
+ "version": "1.99.0",
4
4
  "description": "Lobe Chat - an open-source, high-performance chatbot framework that supports speech synthesis, multimodal, and extensible Function Call plugin system. Supports one-click free deployment of your private ChatGPT/LLM web application.",
5
5
  "keywords": [
6
6
  "framework",
@@ -45,6 +45,7 @@
45
45
  "db:visualize": "dbdocs build docs/development/database-schema.dbml --project lobe-chat",
46
46
  "desktop:build": "npm run desktop:build-next && npm run desktop:prepare-dist && npm run desktop:build-electron",
47
47
  "desktop:build-electron": "tsx scripts/electronWorkflow/buildElectron.ts",
48
+ "desktop:build-local": "npm run desktop:build-next && npm run desktop:prepare-dist && npm run build-local --prefix=./apps/desktop",
48
49
  "desktop:build-next": "npm run build:electron",
49
50
  "desktop:prepare-dist": "tsx scripts/electronWorkflow/moveNextStandalone.ts",
50
51
  "dev": "next dev --turbopack -p 3010",
@@ -61,6 +62,8 @@
61
62
  "prepare": "husky",
62
63
  "prettier": "prettier -c --write \"**/**\"",
63
64
  "pull": "git pull",
65
+ "reinstall": "rm -rf pnpm-lock.yaml && rm -rf node_modules && pnpm -r exec rm -rf node_modules && pnpm install",
66
+ "reinstall:desktop": "rm -rf pnpm-lock.yaml && rm -rf node_modules && pnpm -r exec rm -rf node_modules && pnpm install --node-linker=hoisted",
64
67
  "release": "semantic-release",
65
68
  "self-hosting:docker": "docker build -t lobe-chat:local .",
66
69
  "self-hosting:docker-cn": "docker build -t lobe-chat-local --build-arg USE_CN_MIRROR=true .",
@@ -70,8 +73,8 @@
70
73
  "test": "npm run test-app && npm run test-server",
71
74
  "test-app": "vitest run --config vitest.config.ts",
72
75
  "test-app:coverage": "vitest run --config vitest.config.ts --coverage",
73
- "test-server": "TEST_SERVER_DB=1 vitest run --config vitest.server.config.ts",
74
- "test-server:coverage": "TEST_SERVER_DB=1 vitest run --config vitest.server.config.ts --coverage",
76
+ "test-server": "vitest run --config vitest.config.server.ts",
77
+ "test-server:coverage": "vitest run --config vitest.config.server.ts --coverage",
75
78
  "test:update": "vitest -u",
76
79
  "type-check": "tsgo --noEmit",
77
80
  "webhook:ngrok": "ngrok http http://localhost:3011",
@@ -132,6 +135,8 @@
132
135
  "@codesandbox/sandpack-react": "^2.20.0",
133
136
  "@cyntler/react-doc-viewer": "^1.17.0",
134
137
  "@electric-sql/pglite": "0.2.17",
138
+ "@fal-ai/client": "^1.5.0",
139
+ "@formkit/auto-animate": "^0.8.2",
135
140
  "@google/genai": "^1.6.0",
136
141
  "@huggingface/inference": "^2.8.1",
137
142
  "@icons-pack/react-simple-icons": "9.6.0",
@@ -226,6 +231,7 @@
226
231
  "plaiceholder": "^3.0.0",
227
232
  "polished": "^4.3.1",
228
233
  "posthog-js": "^1.249.0",
234
+ "pure-rand": "^7.0.1",
229
235
  "pwa-install-handler": "^2.6.2",
230
236
  "query-string": "^9.2.0",
231
237
  "random-words": "^2.0.1",
@@ -249,7 +255,7 @@
249
255
  "resolve-accept-language": "^3.1.11",
250
256
  "rtl-detect": "^1.1.2",
251
257
  "semver": "^7.7.2",
252
- "sharp": "^0.33.5",
258
+ "sharp": "^0.34.2",
253
259
  "shiki": "^3.4.2",
254
260
  "stripe": "^16.12.0",
255
261
  "superjson": "^2.2.2",
@@ -349,6 +355,7 @@
349
355
  "serwist": "^9.0.14",
350
356
  "stylelint": "^15.11.0",
351
357
  "tsx": "~4.19.4",
358
+ "type-fest": "^4.41.0",
352
359
  "typescript": "^5.8.3",
353
360
  "unified": "^11.0.5",
354
361
  "unist-util-visit": "^5.0.0",
@@ -1,6 +1,8 @@
1
- import { DeleteFilesResponse } from '../types/file';
1
+ import { CreateFileParams, DeleteFilesResponse, FileMetadata } from '../types/file';
2
2
 
3
3
  export interface FileDispatchEvents {
4
4
  deleteFiles: (paths: string[]) => DeleteFilesResponse;
5
5
  getStaticFilePath: (id: string) => string;
6
+ getFileHTTPURL: (path: string) => string;
7
+ createFile: (param: CreateFileParams) => { metadata: FileMetadata; success: boolean };
6
8
  }
@@ -2,3 +2,18 @@ export interface DeleteFilesResponse {
2
2
  errors?: { message: string; path: string }[];
3
3
  success: boolean;
4
4
  }
5
+
6
+ export interface CreateFileParams {
7
+ content: string; // Base64 encoded binary data
8
+ filename: string;
9
+ hash: string;
10
+ path: string;
11
+ type: string;
12
+ }
13
+
14
+ export interface FileMetadata {
15
+ date: string;
16
+ dirname: string;
17
+ filename: string;
18
+ path: string;
19
+ }
@@ -1,5 +1,5 @@
1
1
  import { ActionIcon, ActionIconProps } from '@lobehub/ui';
2
- import { Compass, FolderClosed, MessageSquare } from 'lucide-react';
2
+ import { Compass, FolderClosed, MessageSquare, Palette } from 'lucide-react';
3
3
  import Link from 'next/link';
4
4
  import { memo } from 'react';
5
5
  import { useTranslation } from 'react-i18next';
@@ -29,6 +29,7 @@ const TopActions = memo<TopActionProps>(({ tab, isPinned }) => {
29
29
  const isChatActive = tab === SidebarTabKey.Chat && !isPinned;
30
30
  const isFilesActive = tab === SidebarTabKey.Files;
31
31
  const isDiscoverActive = tab === SidebarTabKey.Discover;
32
+ const isImageActive = tab === SidebarTabKey.Image;
32
33
 
33
34
  return (
34
35
  <Flexbox gap={8}>
@@ -65,6 +66,15 @@ const TopActions = memo<TopActionProps>(({ tab, isPinned }) => {
65
66
  />
66
67
  </Link>
67
68
  )}
69
+ <Link aria-label={t('tab.aiImage')} href={'/image'}>
70
+ <ActionIcon
71
+ active={isImageActive}
72
+ icon={Palette}
73
+ size={ICON_SIZE}
74
+ title={t('tab.aiImage')}
75
+ tooltipProps={{ placement: 'right' }}
76
+ />
77
+ </Link>
68
78
  {showMarket && (
69
79
  <Link aria-label={t('tab.discover')} href={'/discover'}>
70
80
  <ActionIcon