@lobehub/chat 1.0.0 → 1.0.2

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.

Potentially problematic release.


This version of @lobehub/chat might be problematic. Click here for more details.

Files changed (1862) hide show
  1. package/.bunfig.toml +3 -0
  2. package/.dockerignore +11 -0
  3. package/.env.example +131 -0
  4. package/.eslintignore +1 -2
  5. package/.eslintrc.js +32 -1
  6. package/.github/FUNDING.yml +13 -0
  7. package/.github/ISSUE_TEMPLATE/1_bug_report.yml +46 -22
  8. package/.github/ISSUE_TEMPLATE/1_bug_report_cn.yml +69 -0
  9. package/.github/ISSUE_TEMPLATE/2_feature_request.yml +6 -6
  10. package/.github/ISSUE_TEMPLATE/2_feature_request_cn.yml +21 -0
  11. package/.github/ISSUE_TEMPLATE/config.yml +4 -0
  12. package/.github/PULL_REQUEST_TEMPLATE.md +2 -0
  13. package/.github/workflows/docker.yml +45 -0
  14. package/.github/workflows/issue-auto-comments.yml +73 -0
  15. package/.github/workflows/issue-close-require.yml +26 -6
  16. package/.github/workflows/issues-translate.yml +14 -0
  17. package/.github/workflows/lighthouse.yml +72 -0
  18. package/.github/workflows/release.yml +46 -15
  19. package/.github/workflows/sync.yml +54 -0
  20. package/.github/workflows/test.yml +44 -16
  21. package/.github/workflows/wiki-sync.yml +19 -0
  22. package/.husky/pre-commit +0 -3
  23. package/.i18nrc.js +41 -7
  24. package/.nvmrc +1 -0
  25. package/.seorc.cjs +9 -0
  26. package/CHANGELOG.md +16675 -46
  27. package/CODE_OF_CONDUCT.md +128 -0
  28. package/CONTRIBUTING.md +88 -0
  29. package/Dockerfile +138 -0
  30. package/LICENSE +38 -0
  31. package/README.md +696 -80
  32. package/README.zh-CN.md +782 -0
  33. package/__mocks__/zustand/traditional.ts +25 -0
  34. package/codecov.yml +11 -0
  35. package/contributing/Basic/Add-New-Authentication-Providers.md +193 -0
  36. package/contributing/Basic/Add-New-Authentication-Providers.zh-CN.md +192 -0
  37. package/contributing/Basic/Architecture.md +47 -0
  38. package/contributing/Basic/Architecture.zh-CN.md +47 -0
  39. package/contributing/Basic/Chat-API.md +136 -0
  40. package/contributing/Basic/Chat-API.zh-CN.md +174 -0
  41. package/contributing/Basic/Contributing-Guidelines.md +83 -0
  42. package/contributing/Basic/Contributing-Guidelines.zh-CN.md +85 -0
  43. package/contributing/Basic/Feature-Development-Frontend.md +126 -0
  44. package/contributing/Basic/Feature-Development-Frontend.zh-CN.md +126 -0
  45. package/contributing/Basic/Feature-Development.md +713 -0
  46. package/contributing/Basic/Feature-Development.zh-CN.md +707 -0
  47. package/contributing/Basic/Folder-Structure.md +40 -0
  48. package/contributing/Basic/Folder-Structure.zh-CN.md +40 -0
  49. package/contributing/Basic/Intro.md +111 -0
  50. package/contributing/Basic/Intro.zh-CN.md +111 -0
  51. package/contributing/Basic/Resources.md +19 -0
  52. package/contributing/Basic/Resources.zh-CN.md +19 -0
  53. package/contributing/Basic/Setup-Development.md +69 -0
  54. package/contributing/Basic/Setup-Development.zh-CN.md +69 -0
  55. package/contributing/Basic/Test.md +87 -0
  56. package/contributing/Basic/Test.zh-CN.md +87 -0
  57. package/contributing/Home.md +87 -0
  58. package/contributing/Internationalization/Add-New-Locale.md +62 -0
  59. package/contributing/Internationalization/Add-New-Locale.zh-CN.md +62 -0
  60. package/contributing/Internationalization/Internationalization-Implementation.md +125 -0
  61. package/contributing/Internationalization/Internationalization-Implementation.zh-CN.md +125 -0
  62. package/contributing/Others/Lighthouse.md +65 -0
  63. package/contributing/Others/Lighthouse.zh-CN.md +65 -0
  64. package/contributing/State-Management/State-Management-Intro.md +224 -0
  65. package/contributing/State-Management/State-Management-Intro.zh-CN.md +216 -0
  66. package/contributing/State-Management/State-Management-Selectors.md +68 -0
  67. package/contributing/State-Management/State-Management-Selectors.zh-CN.md +49 -0
  68. package/contributing/Upstream-Sync.md +58 -0
  69. package/contributing/Upstream-Sync.zh-CN.md +58 -0
  70. package/contributing/_Footer.md +1 -0
  71. package/contributing/_Sidebar.md +48 -0
  72. package/docs/self-hosting/advanced/analytics.mdx +31 -0
  73. package/docs/self-hosting/advanced/analytics.zh-CN.mdx +28 -0
  74. package/docs/self-hosting/advanced/authentication.mdx +67 -0
  75. package/docs/self-hosting/advanced/authentication.zh-CN.mdx +65 -0
  76. package/docs/self-hosting/advanced/feature-flags.mdx +45 -0
  77. package/docs/self-hosting/advanced/feature-flags.zh-CN.mdx +42 -0
  78. package/docs/self-hosting/advanced/model-list.mdx +48 -0
  79. package/docs/self-hosting/advanced/model-list.zh-CN.mdx +46 -0
  80. package/docs/self-hosting/advanced/settings-url-share.mdx +132 -0
  81. package/docs/self-hosting/advanced/settings-url-share.zh-CN.mdx +131 -0
  82. package/docs/self-hosting/advanced/sso-providers/auth0.mdx +134 -0
  83. package/docs/self-hosting/advanced/sso-providers/auth0.zh-CN.mdx +126 -0
  84. package/docs/self-hosting/advanced/sso-providers/authentik.mdx +75 -0
  85. package/docs/self-hosting/advanced/sso-providers/authentik.zh-CN.mdx +69 -0
  86. package/docs/self-hosting/advanced/sso-providers/github.mdx +103 -0
  87. package/docs/self-hosting/advanced/sso-providers/github.zh-CN.mdx +95 -0
  88. package/docs/self-hosting/advanced/sso-providers/microsoft-entra-id.mdx +106 -0
  89. package/docs/self-hosting/advanced/sso-providers/microsoft-entra-id.zh-CN.mdx +100 -0
  90. package/docs/self-hosting/advanced/sso-providers/zitadel.mdx +120 -0
  91. package/docs/self-hosting/advanced/sso-providers/zitadel.zh-CN.mdx +112 -0
  92. package/docs/self-hosting/advanced/upstream-sync.mdx +161 -0
  93. package/docs/self-hosting/advanced/upstream-sync.zh-CN.mdx +153 -0
  94. package/docs/self-hosting/environment-variables/analytics.mdx +84 -0
  95. package/docs/self-hosting/environment-variables/analytics.zh-CN.mdx +82 -0
  96. package/docs/self-hosting/environment-variables/auth.mdx +171 -0
  97. package/docs/self-hosting/environment-variables/auth.zh-CN.mdx +168 -0
  98. package/docs/self-hosting/environment-variables/basic.mdx +118 -0
  99. package/docs/self-hosting/environment-variables/basic.zh-CN.mdx +114 -0
  100. package/docs/self-hosting/environment-variables/model-provider.mdx +299 -0
  101. package/docs/self-hosting/environment-variables/model-provider.zh-CN.mdx +297 -0
  102. package/docs/self-hosting/environment-variables.mdx +22 -0
  103. package/docs/self-hosting/environment-variables.zh-CN.mdx +20 -0
  104. package/docs/self-hosting/examples/azure-openai.mdx +46 -0
  105. package/docs/self-hosting/examples/azure-openai.zh-CN.mdx +48 -0
  106. package/docs/self-hosting/examples/ollama.mdx +104 -0
  107. package/docs/self-hosting/examples/ollama.zh-CN.mdx +103 -0
  108. package/docs/self-hosting/faq/no-v1-suffix.mdx +30 -0
  109. package/docs/self-hosting/faq/no-v1-suffix.zh-CN.mdx +27 -0
  110. package/docs/self-hosting/faq/proxy-with-unable-to-verify-leaf-signature.mdx +84 -0
  111. package/docs/self-hosting/faq/proxy-with-unable-to-verify-leaf-signature.zh-CN.mdx +81 -0
  112. package/docs/self-hosting/platform/docker-compose.mdx +143 -0
  113. package/docs/self-hosting/platform/docker-compose.zh-CN.mdx +134 -0
  114. package/docs/self-hosting/platform/docker.mdx +169 -0
  115. package/docs/self-hosting/platform/docker.zh-CN.mdx +167 -0
  116. package/docs/self-hosting/platform/netlify.mdx +154 -0
  117. package/docs/self-hosting/platform/netlify.zh-CN.mdx +148 -0
  118. package/docs/self-hosting/platform/railway.mdx +35 -0
  119. package/docs/self-hosting/platform/railway.zh-CN.mdx +34 -0
  120. package/docs/self-hosting/platform/repocloud.mdx +38 -0
  121. package/docs/self-hosting/platform/repocloud.zh-CN.mdx +36 -0
  122. package/docs/self-hosting/platform/sealos.mdx +37 -0
  123. package/docs/self-hosting/platform/sealos.zh-CN.mdx +36 -0
  124. package/docs/self-hosting/platform/vercel.mdx +46 -0
  125. package/docs/self-hosting/platform/vercel.zh-CN.mdx +47 -0
  126. package/docs/self-hosting/platform/zeabur.mdx +85 -0
  127. package/docs/self-hosting/platform/zeabur.zh-CN.mdx +84 -0
  128. package/docs/self-hosting/start.mdx +31 -0
  129. package/docs/self-hosting/start.zh-CN.mdx +32 -0
  130. package/docs/usage/agents/concepts.mdx +41 -0
  131. package/docs/usage/agents/concepts.zh-CN.mdx +38 -0
  132. package/docs/usage/agents/custom-agent.mdx +58 -0
  133. package/docs/usage/agents/custom-agent.zh-CN.mdx +53 -0
  134. package/docs/usage/agents/model.mdx +80 -0
  135. package/docs/usage/agents/model.zh-CN.mdx +75 -0
  136. package/docs/usage/agents/prompt.mdx +110 -0
  137. package/docs/usage/agents/prompt.zh-CN.mdx +106 -0
  138. package/docs/usage/agents/topics.mdx +27 -0
  139. package/docs/usage/agents/topics.zh-CN.mdx +25 -0
  140. package/docs/usage/features/agent-market.mdx +40 -0
  141. package/docs/usage/features/agent-market.zh-CN.mdx +36 -0
  142. package/docs/usage/features/local-llm.mdx +51 -0
  143. package/docs/usage/features/local-llm.zh-CN.mdx +43 -0
  144. package/docs/usage/features/mobile.mdx +24 -0
  145. package/docs/usage/features/mobile.zh-CN.mdx +23 -0
  146. package/docs/usage/features/more.mdx +33 -0
  147. package/docs/usage/features/more.zh-CN.mdx +28 -0
  148. package/docs/usage/features/multi-ai-providers.mdx +61 -0
  149. package/docs/usage/features/multi-ai-providers.zh-CN.mdx +61 -0
  150. package/docs/usage/features/plugin-system.mdx +89 -0
  151. package/docs/usage/features/plugin-system.zh-CN.mdx +77 -0
  152. package/docs/usage/features/pwa.mdx +73 -0
  153. package/docs/usage/features/pwa.zh-CN.mdx +73 -0
  154. package/docs/usage/features/text-to-image.mdx +26 -0
  155. package/docs/usage/features/text-to-image.zh-CN.mdx +26 -0
  156. package/docs/usage/features/theme.mdx +34 -0
  157. package/docs/usage/features/theme.zh-CN.mdx +30 -0
  158. package/docs/usage/features/tts.mdx +52 -0
  159. package/docs/usage/features/tts.zh-CN.mdx +46 -0
  160. package/docs/usage/features/vision.mdx +28 -0
  161. package/docs/usage/features/vision.zh-CN.mdx +25 -0
  162. package/docs/usage/plugins/basic-usage.mdx +69 -0
  163. package/docs/usage/plugins/basic-usage.zh-CN.mdx +67 -0
  164. package/docs/usage/plugins/custom-plugin.mdx +37 -0
  165. package/docs/usage/plugins/custom-plugin.zh-CN.mdx +35 -0
  166. package/docs/usage/plugins/development.mdx +329 -0
  167. package/docs/usage/plugins/development.zh-CN.mdx +323 -0
  168. package/docs/usage/plugins/store.mdx +30 -0
  169. package/docs/usage/plugins/store.zh-CN.mdx +27 -0
  170. package/docs/usage/providers/groq.mdx +76 -0
  171. package/docs/usage/providers/groq.zh-CN.mdx +70 -0
  172. package/docs/usage/providers/ollama/gemma.mdx +68 -0
  173. package/docs/usage/providers/ollama/gemma.zh-CN.mdx +67 -0
  174. package/docs/usage/providers/ollama/qwen.mdx +69 -0
  175. package/docs/usage/providers/ollama/qwen.zh-CN.mdx +66 -0
  176. package/docs/usage/providers/ollama.mdx +204 -0
  177. package/docs/usage/providers/ollama.zh-CN.mdx +202 -0
  178. package/docs/usage/start.mdx +46 -0
  179. package/docs/usage/start.zh-CN.mdx +38 -0
  180. package/drizzle.config.ts +29 -0
  181. package/locales/ar/auth.json +8 -0
  182. package/locales/ar/chat.json +138 -0
  183. package/locales/ar/clerk.json +769 -0
  184. package/locales/ar/common.json +224 -0
  185. package/locales/ar/components.json +16 -0
  186. package/locales/ar/error.json +114 -0
  187. package/locales/ar/market.json +32 -0
  188. package/locales/ar/metadata.json +18 -0
  189. package/locales/ar/migration.json +45 -0
  190. package/locales/ar/modelProvider.json +108 -0
  191. package/locales/ar/plugin.json +165 -0
  192. package/locales/ar/setting.json +404 -0
  193. package/locales/ar/tool.json +10 -0
  194. package/locales/ar/welcome.json +49 -0
  195. package/locales/bg-BG/auth.json +8 -0
  196. package/locales/bg-BG/chat.json +138 -0
  197. package/locales/bg-BG/clerk.json +769 -0
  198. package/locales/bg-BG/common.json +224 -0
  199. package/locales/bg-BG/components.json +16 -0
  200. package/locales/bg-BG/error.json +114 -0
  201. package/locales/bg-BG/market.json +32 -0
  202. package/locales/bg-BG/metadata.json +18 -0
  203. package/locales/bg-BG/migration.json +45 -0
  204. package/locales/bg-BG/modelProvider.json +108 -0
  205. package/locales/bg-BG/plugin.json +165 -0
  206. package/locales/bg-BG/setting.json +404 -0
  207. package/locales/bg-BG/tool.json +10 -0
  208. package/locales/bg-BG/welcome.json +49 -0
  209. package/locales/de-DE/auth.json +8 -0
  210. package/locales/de-DE/chat.json +138 -0
  211. package/locales/de-DE/clerk.json +769 -0
  212. package/locales/de-DE/common.json +224 -0
  213. package/locales/de-DE/components.json +16 -0
  214. package/locales/de-DE/error.json +114 -0
  215. package/locales/de-DE/market.json +32 -0
  216. package/locales/de-DE/metadata.json +18 -0
  217. package/locales/de-DE/migration.json +45 -0
  218. package/locales/de-DE/modelProvider.json +108 -0
  219. package/locales/de-DE/plugin.json +165 -0
  220. package/locales/de-DE/setting.json +404 -0
  221. package/locales/de-DE/tool.json +10 -0
  222. package/locales/de-DE/welcome.json +49 -0
  223. package/locales/en-US/auth.json +8 -0
  224. package/locales/en-US/chat.json +138 -0
  225. package/locales/en-US/clerk.json +769 -0
  226. package/locales/en-US/common.json +224 -0
  227. package/locales/en-US/components.json +16 -0
  228. package/locales/en-US/error.json +114 -0
  229. package/locales/en-US/market.json +32 -0
  230. package/locales/en-US/metadata.json +18 -0
  231. package/locales/en-US/migration.json +45 -0
  232. package/locales/en-US/modelProvider.json +108 -0
  233. package/locales/en-US/plugin.json +165 -0
  234. package/locales/en-US/setting.json +404 -0
  235. package/locales/en-US/tool.json +10 -0
  236. package/locales/en-US/welcome.json +49 -0
  237. package/locales/es-ES/auth.json +8 -0
  238. package/locales/es-ES/chat.json +138 -0
  239. package/locales/es-ES/clerk.json +769 -0
  240. package/locales/es-ES/common.json +224 -0
  241. package/locales/es-ES/components.json +16 -0
  242. package/locales/es-ES/error.json +114 -0
  243. package/locales/es-ES/market.json +32 -0
  244. package/locales/es-ES/metadata.json +18 -0
  245. package/locales/es-ES/migration.json +45 -0
  246. package/locales/es-ES/modelProvider.json +108 -0
  247. package/locales/es-ES/plugin.json +165 -0
  248. package/locales/es-ES/setting.json +404 -0
  249. package/locales/es-ES/tool.json +10 -0
  250. package/locales/es-ES/welcome.json +49 -0
  251. package/locales/fr-FR/auth.json +8 -0
  252. package/locales/fr-FR/chat.json +138 -0
  253. package/locales/fr-FR/clerk.json +769 -0
  254. package/locales/fr-FR/common.json +224 -0
  255. package/locales/fr-FR/components.json +16 -0
  256. package/locales/fr-FR/error.json +114 -0
  257. package/locales/fr-FR/market.json +32 -0
  258. package/locales/fr-FR/metadata.json +18 -0
  259. package/locales/fr-FR/migration.json +45 -0
  260. package/locales/fr-FR/modelProvider.json +108 -0
  261. package/locales/fr-FR/plugin.json +165 -0
  262. package/locales/fr-FR/setting.json +404 -0
  263. package/locales/fr-FR/tool.json +10 -0
  264. package/locales/fr-FR/welcome.json +49 -0
  265. package/locales/it-IT/auth.json +8 -0
  266. package/locales/it-IT/chat.json +138 -0
  267. package/locales/it-IT/clerk.json +769 -0
  268. package/locales/it-IT/common.json +224 -0
  269. package/locales/it-IT/components.json +16 -0
  270. package/locales/it-IT/error.json +114 -0
  271. package/locales/it-IT/market.json +32 -0
  272. package/locales/it-IT/metadata.json +18 -0
  273. package/locales/it-IT/migration.json +45 -0
  274. package/locales/it-IT/modelProvider.json +108 -0
  275. package/locales/it-IT/plugin.json +165 -0
  276. package/locales/it-IT/setting.json +404 -0
  277. package/locales/it-IT/tool.json +10 -0
  278. package/locales/it-IT/welcome.json +49 -0
  279. package/locales/ja-JP/auth.json +8 -0
  280. package/locales/ja-JP/chat.json +138 -0
  281. package/locales/ja-JP/clerk.json +769 -0
  282. package/locales/ja-JP/common.json +224 -0
  283. package/locales/ja-JP/components.json +16 -0
  284. package/locales/ja-JP/error.json +114 -0
  285. package/locales/ja-JP/market.json +32 -0
  286. package/locales/ja-JP/metadata.json +18 -0
  287. package/locales/ja-JP/migration.json +45 -0
  288. package/locales/ja-JP/modelProvider.json +108 -0
  289. package/locales/ja-JP/plugin.json +165 -0
  290. package/locales/ja-JP/setting.json +404 -0
  291. package/locales/ja-JP/tool.json +10 -0
  292. package/locales/ja-JP/welcome.json +49 -0
  293. package/locales/ko-KR/auth.json +8 -0
  294. package/locales/ko-KR/chat.json +138 -0
  295. package/locales/ko-KR/clerk.json +769 -0
  296. package/locales/ko-KR/common.json +224 -0
  297. package/locales/ko-KR/components.json +16 -0
  298. package/locales/ko-KR/error.json +114 -0
  299. package/locales/ko-KR/market.json +32 -0
  300. package/locales/ko-KR/metadata.json +18 -0
  301. package/locales/ko-KR/migration.json +45 -0
  302. package/locales/ko-KR/modelProvider.json +108 -0
  303. package/locales/ko-KR/plugin.json +165 -0
  304. package/locales/ko-KR/setting.json +404 -0
  305. package/locales/ko-KR/tool.json +10 -0
  306. package/locales/ko-KR/welcome.json +49 -0
  307. package/locales/nl-NL/auth.json +8 -0
  308. package/locales/nl-NL/chat.json +138 -0
  309. package/locales/nl-NL/clerk.json +769 -0
  310. package/locales/nl-NL/common.json +224 -0
  311. package/locales/nl-NL/components.json +16 -0
  312. package/locales/nl-NL/error.json +114 -0
  313. package/locales/nl-NL/market.json +32 -0
  314. package/locales/nl-NL/metadata.json +18 -0
  315. package/locales/nl-NL/migration.json +45 -0
  316. package/locales/nl-NL/modelProvider.json +108 -0
  317. package/locales/nl-NL/plugin.json +165 -0
  318. package/locales/nl-NL/setting.json +404 -0
  319. package/locales/nl-NL/tool.json +10 -0
  320. package/locales/nl-NL/welcome.json +49 -0
  321. package/locales/pl-PL/auth.json +8 -0
  322. package/locales/pl-PL/chat.json +138 -0
  323. package/locales/pl-PL/clerk.json +769 -0
  324. package/locales/pl-PL/common.json +224 -0
  325. package/locales/pl-PL/components.json +16 -0
  326. package/locales/pl-PL/error.json +114 -0
  327. package/locales/pl-PL/market.json +32 -0
  328. package/locales/pl-PL/metadata.json +18 -0
  329. package/locales/pl-PL/migration.json +45 -0
  330. package/locales/pl-PL/modelProvider.json +108 -0
  331. package/locales/pl-PL/plugin.json +165 -0
  332. package/locales/pl-PL/setting.json +404 -0
  333. package/locales/pl-PL/tool.json +10 -0
  334. package/locales/pl-PL/welcome.json +49 -0
  335. package/locales/pt-BR/auth.json +8 -0
  336. package/locales/pt-BR/chat.json +138 -0
  337. package/locales/pt-BR/clerk.json +769 -0
  338. package/locales/pt-BR/common.json +224 -0
  339. package/locales/pt-BR/components.json +16 -0
  340. package/locales/pt-BR/error.json +114 -0
  341. package/locales/pt-BR/market.json +32 -0
  342. package/locales/pt-BR/metadata.json +18 -0
  343. package/locales/pt-BR/migration.json +45 -0
  344. package/locales/pt-BR/modelProvider.json +108 -0
  345. package/locales/pt-BR/plugin.json +165 -0
  346. package/locales/pt-BR/setting.json +404 -0
  347. package/locales/pt-BR/tool.json +10 -0
  348. package/locales/pt-BR/welcome.json +49 -0
  349. package/locales/ru-RU/auth.json +8 -0
  350. package/locales/ru-RU/chat.json +138 -0
  351. package/locales/ru-RU/clerk.json +769 -0
  352. package/locales/ru-RU/common.json +224 -0
  353. package/locales/ru-RU/components.json +16 -0
  354. package/locales/ru-RU/error.json +114 -0
  355. package/locales/ru-RU/market.json +32 -0
  356. package/locales/ru-RU/metadata.json +18 -0
  357. package/locales/ru-RU/migration.json +45 -0
  358. package/locales/ru-RU/modelProvider.json +108 -0
  359. package/locales/ru-RU/plugin.json +165 -0
  360. package/locales/ru-RU/setting.json +404 -0
  361. package/locales/ru-RU/tool.json +10 -0
  362. package/locales/ru-RU/welcome.json +49 -0
  363. package/locales/tr-TR/auth.json +8 -0
  364. package/locales/tr-TR/chat.json +138 -0
  365. package/locales/tr-TR/clerk.json +769 -0
  366. package/locales/tr-TR/common.json +224 -0
  367. package/locales/tr-TR/components.json +16 -0
  368. package/locales/tr-TR/error.json +114 -0
  369. package/locales/tr-TR/market.json +32 -0
  370. package/locales/tr-TR/metadata.json +18 -0
  371. package/locales/tr-TR/migration.json +45 -0
  372. package/locales/tr-TR/modelProvider.json +108 -0
  373. package/locales/tr-TR/plugin.json +165 -0
  374. package/locales/tr-TR/setting.json +404 -0
  375. package/locales/tr-TR/tool.json +10 -0
  376. package/locales/tr-TR/welcome.json +49 -0
  377. package/locales/vi-VN/auth.json +8 -0
  378. package/locales/vi-VN/chat.json +138 -0
  379. package/locales/vi-VN/clerk.json +769 -0
  380. package/locales/vi-VN/common.json +224 -0
  381. package/locales/vi-VN/components.json +16 -0
  382. package/locales/vi-VN/error.json +114 -0
  383. package/locales/vi-VN/market.json +32 -0
  384. package/locales/vi-VN/metadata.json +18 -0
  385. package/locales/vi-VN/migration.json +45 -0
  386. package/locales/vi-VN/modelProvider.json +108 -0
  387. package/locales/vi-VN/plugin.json +165 -0
  388. package/locales/vi-VN/setting.json +404 -0
  389. package/locales/vi-VN/tool.json +10 -0
  390. package/locales/vi-VN/welcome.json +49 -0
  391. package/locales/zh-CN/auth.json +8 -0
  392. package/locales/zh-CN/chat.json +138 -0
  393. package/locales/zh-CN/clerk.json +769 -0
  394. package/locales/zh-CN/common.json +224 -0
  395. package/locales/zh-CN/components.json +16 -0
  396. package/locales/zh-CN/error.json +114 -0
  397. package/locales/zh-CN/market.json +32 -0
  398. package/locales/zh-CN/metadata.json +18 -0
  399. package/locales/zh-CN/migration.json +45 -0
  400. package/locales/zh-CN/modelProvider.json +108 -0
  401. package/locales/zh-CN/plugin.json +165 -0
  402. package/locales/zh-CN/setting.json +404 -0
  403. package/locales/zh-CN/tool.json +10 -0
  404. package/locales/zh-CN/welcome.json +49 -0
  405. package/locales/zh-TW/auth.json +8 -0
  406. package/locales/zh-TW/chat.json +138 -0
  407. package/locales/zh-TW/clerk.json +769 -0
  408. package/locales/zh-TW/common.json +224 -0
  409. package/locales/zh-TW/components.json +16 -0
  410. package/locales/zh-TW/error.json +114 -0
  411. package/locales/zh-TW/market.json +32 -0
  412. package/locales/zh-TW/metadata.json +18 -0
  413. package/locales/zh-TW/migration.json +45 -0
  414. package/locales/zh-TW/modelProvider.json +108 -0
  415. package/locales/zh-TW/plugin.json +165 -0
  416. package/locales/zh-TW/setting.json +404 -0
  417. package/locales/zh-TW/tool.json +10 -0
  418. package/locales/zh-TW/welcome.json +49 -0
  419. package/netlify.toml +10 -0
  420. package/next-sitemap.config.mjs +53 -0
  421. package/next.config.mjs +113 -16
  422. package/package.json +212 -83
  423. package/public/apple-touch-icon.png +0 -0
  424. package/public/favicon-32x32.ico +0 -0
  425. package/public/favicon.ico +0 -0
  426. package/public/icons/icon-192x192.maskable.png +0 -0
  427. package/public/icons/icon-192x192.png +0 -0
  428. package/public/icons/icon-512x512.maskable.png +0 -0
  429. package/public/icons/icon-512x512.png +0 -0
  430. package/public/images/banner_market_modal.webp +0 -0
  431. package/public/images/chatmode_chat_dark.webp +0 -0
  432. package/public/images/chatmode_chat_light.webp +0 -0
  433. package/public/images/chatmode_docs_dark.webp +0 -0
  434. package/public/images/chatmode_docs_light.webp +0 -0
  435. package/public/images/empty_topic_dark.webp +0 -0
  436. package/public/images/empty_topic_light.webp +0 -0
  437. package/public/images/logo.png +0 -0
  438. package/public/images/screenshot_background.webp +0 -0
  439. package/public/images/theme_auto.webp +0 -0
  440. package/public/images/theme_dark.webp +0 -0
  441. package/public/images/theme_light.webp +0 -0
  442. package/public/manifest.json +121 -0
  443. package/public/og/cover.png +0 -0
  444. package/public/screenshots/shot-1.desktop.png +0 -0
  445. package/public/screenshots/shot-1.mobile.png +0 -0
  446. package/public/screenshots/shot-2.desktop.png +0 -0
  447. package/public/screenshots/shot-2.mobile.png +0 -0
  448. package/public/screenshots/shot-3.desktop.png +0 -0
  449. package/public/screenshots/shot-3.mobile.png +0 -0
  450. package/public/screenshots/shot-4.desktop.png +0 -0
  451. package/public/screenshots/shot-4.mobile.png +0 -0
  452. package/public/screenshots/shot-5.desktop.png +0 -0
  453. package/public/screenshots/shot-5.mobile.png +0 -0
  454. package/public/videos/feedback.mp4 +0 -0
  455. package/public/videos/star.mp4 +0 -0
  456. package/renovate.json +13 -0
  457. package/scripts/docsWorkflow/const.ts +14 -0
  458. package/scripts/docsWorkflow/index.ts +82 -0
  459. package/scripts/docsWorkflow/toc.ts +60 -0
  460. package/scripts/docsWorkflow/utils.ts +38 -0
  461. package/scripts/i18nWorkflow/const.ts +18 -0
  462. package/scripts/i18nWorkflow/genDefaultLocale.ts +19 -0
  463. package/scripts/i18nWorkflow/genDiff.ts +50 -0
  464. package/scripts/i18nWorkflow/index.ts +11 -0
  465. package/scripts/i18nWorkflow/utils.ts +57 -0
  466. package/scripts/mdxWorkflow/index.ts +48 -0
  467. package/scripts/migrateServerDB/index.ts +30 -0
  468. package/scripts/readmeWorkflow/const.ts +19 -0
  469. package/scripts/readmeWorkflow/index.ts +12 -0
  470. package/scripts/readmeWorkflow/syncAgentIndex.ts +47 -0
  471. package/scripts/readmeWorkflow/syncPluginIndex.ts +42 -0
  472. package/scripts/readmeWorkflow/utlis.ts +52 -0
  473. package/sentry.client.config.ts +30 -0
  474. package/sentry.edge.config.ts +17 -0
  475. package/sentry.server.config.ts +19 -0
  476. package/src/app/(auth)/layout.tsx +19 -0
  477. package/src/app/(auth)/login/[[...login]]/page.tsx +21 -0
  478. package/src/app/(auth)/signup/[[...signup]]/page.tsx +21 -0
  479. package/src/app/(loading)/Client.tsx +13 -0
  480. package/src/app/(loading)/Redirect.tsx +51 -0
  481. package/src/app/(main)/(mobile)/me/(home)/__tests__/UserBanner.test.tsx +80 -0
  482. package/src/app/(main)/(mobile)/me/(home)/__tests__/useCategory.test.tsx +116 -0
  483. package/src/app/(main)/(mobile)/me/(home)/features/Category.tsx +15 -0
  484. package/src/app/(main)/(mobile)/me/(home)/features/Header.tsx +30 -0
  485. package/src/app/(main)/(mobile)/me/(home)/features/UserBanner.tsx +37 -0
  486. package/src/app/(main)/(mobile)/me/(home)/features/useCategory.tsx +118 -0
  487. package/src/app/(main)/(mobile)/me/(home)/layout.tsx +17 -0
  488. package/src/app/(main)/(mobile)/me/(home)/loading.tsx +38 -0
  489. package/src/app/(main)/(mobile)/me/(home)/page.tsx +38 -0
  490. package/src/app/(main)/(mobile)/me/data/features/Category.tsx +48 -0
  491. package/src/app/(main)/(mobile)/me/data/features/Header.tsx +33 -0
  492. package/src/app/(main)/(mobile)/me/data/layout.tsx +13 -0
  493. package/src/app/(main)/(mobile)/me/data/loading.tsx +5 -0
  494. package/src/app/(main)/(mobile)/me/data/page.tsx +27 -0
  495. package/src/app/(main)/(mobile)/me/profile/features/Category.tsx +45 -0
  496. package/src/app/(main)/(mobile)/me/profile/features/Header.tsx +33 -0
  497. package/src/app/(main)/(mobile)/me/profile/layout.tsx +16 -0
  498. package/src/app/(main)/(mobile)/me/profile/loading.tsx +5 -0
  499. package/src/app/(main)/(mobile)/me/profile/page.tsx +28 -0
  500. package/src/app/(main)/(mobile)/me/settings/features/Category.tsx +15 -0
  501. package/src/app/(main)/(mobile)/me/settings/features/Header.tsx +33 -0
  502. package/src/app/(main)/(mobile)/me/settings/features/useCategory.tsx +57 -0
  503. package/src/app/(main)/(mobile)/me/settings/layout.tsx +13 -0
  504. package/src/app/(main)/(mobile)/me/settings/loading.tsx +5 -0
  505. package/src/app/(main)/(mobile)/me/settings/page.tsx +28 -0
  506. package/src/app/(main)/@nav/_layout/Desktop/Avatar.test.tsx +55 -0
  507. package/src/app/(main)/@nav/_layout/Desktop/Avatar.tsx +53 -0
  508. package/src/app/(main)/@nav/_layout/Desktop/BottomActions.tsx +24 -0
  509. package/src/app/(main)/@nav/_layout/Desktop/TopActions.tsx +50 -0
  510. package/src/app/(main)/@nav/_layout/Desktop/index.tsx +26 -0
  511. package/src/app/(main)/@nav/_layout/Mobile.tsx +71 -0
  512. package/src/app/(main)/@nav/default.tsx +10 -0
  513. package/src/app/(main)/_layout/Desktop.tsx +33 -0
  514. package/src/app/(main)/_layout/Mobile.tsx +29 -0
  515. package/src/app/(main)/_layout/type.ts +6 -0
  516. package/src/app/(main)/chat/(workspace)/@conversation/default.tsx +23 -0
  517. package/src/app/(main)/chat/(workspace)/@conversation/features/ChatInput/Desktop/Footer/DragUpload.tsx +245 -0
  518. package/src/app/(main)/chat/(workspace)/@conversation/features/ChatInput/Desktop/Footer/LocalFiles.tsx +10 -0
  519. package/src/app/(main)/chat/(workspace)/@conversation/features/ChatInput/Desktop/Footer/SendMore.tsx +122 -0
  520. package/src/app/(main)/chat/(workspace)/@conversation/features/ChatInput/Desktop/Footer/index.tsx +173 -0
  521. package/src/app/(main)/chat/(workspace)/@conversation/features/ChatInput/Desktop/Header/index.tsx +25 -0
  522. package/src/app/(main)/chat/(workspace)/@conversation/features/ChatInput/Desktop/TextArea.test.tsx +316 -0
  523. package/src/app/(main)/chat/(workspace)/@conversation/features/ChatInput/Desktop/TextArea.tsx +129 -0
  524. package/src/app/(main)/chat/(workspace)/@conversation/features/ChatInput/Desktop/__tests__/useAutoFocus.test.ts +45 -0
  525. package/src/app/(main)/chat/(workspace)/@conversation/features/ChatInput/Desktop/index.tsx +60 -0
  526. package/src/app/(main)/chat/(workspace)/@conversation/features/ChatInput/Desktop/useAutoFocus.ts +13 -0
  527. package/src/app/(main)/chat/(workspace)/@conversation/features/ChatInput/Mobile/Files.tsx +19 -0
  528. package/src/app/(main)/chat/(workspace)/@conversation/features/ChatInput/Mobile/index.tsx +52 -0
  529. package/src/app/(main)/chat/(workspace)/@topic/_layout/Desktop.tsx +17 -0
  530. package/src/app/(main)/chat/(workspace)/@topic/_layout/Mobile.tsx +21 -0
  531. package/src/app/(main)/chat/(workspace)/@topic/default.tsx +32 -0
  532. package/src/app/(main)/chat/(workspace)/@topic/features/Header.tsx +88 -0
  533. package/src/app/(main)/chat/(workspace)/@topic/features/SkeletonList.tsx +57 -0
  534. package/src/app/(main)/chat/(workspace)/@topic/features/SystemRole/SystemRoleContent.tsx +128 -0
  535. package/src/app/(main)/chat/(workspace)/@topic/features/SystemRole/index.tsx +18 -0
  536. package/src/app/(main)/chat/(workspace)/@topic/features/SystemRole/style.ts +32 -0
  537. package/src/app/(main)/chat/(workspace)/@topic/features/TopicListContent/DefaultContent.tsx +29 -0
  538. package/src/app/(main)/chat/(workspace)/@topic/features/TopicListContent/TopicContent.tsx +211 -0
  539. package/src/app/(main)/chat/(workspace)/@topic/features/TopicListContent/TopicItem.tsx +81 -0
  540. package/src/app/(main)/chat/(workspace)/@topic/features/TopicListContent/index.tsx +107 -0
  541. package/src/app/(main)/chat/(workspace)/@topic/features/TopicSearchBar/index.tsx +42 -0
  542. package/src/app/(main)/chat/(workspace)/_layout/Desktop/ChatHeader/HeaderAction.tsx +40 -0
  543. package/src/app/(main)/chat/(workspace)/_layout/Desktop/ChatHeader/Main.tsx +91 -0
  544. package/src/app/(main)/chat/(workspace)/_layout/Desktop/ChatHeader/Tags.tsx +31 -0
  545. package/src/app/(main)/chat/(workspace)/_layout/Desktop/ChatHeader/index.tsx +8 -0
  546. package/src/app/(main)/chat/(workspace)/_layout/Desktop/HotKeys.tsx +49 -0
  547. package/src/app/(main)/chat/(workspace)/_layout/Desktop/TopicPanel.tsx +77 -0
  548. package/src/app/(main)/chat/(workspace)/_layout/Desktop/index.tsx +35 -0
  549. package/src/app/(main)/chat/(workspace)/_layout/Mobile/ChatHeader/ChatHeaderTitle.tsx +55 -0
  550. package/src/app/(main)/chat/(workspace)/_layout/Mobile/ChatHeader/index.tsx +37 -0
  551. package/src/app/(main)/chat/(workspace)/_layout/Mobile/TopicModal.tsx +35 -0
  552. package/src/app/(main)/chat/(workspace)/_layout/Mobile/index.tsx +21 -0
  553. package/src/app/(main)/chat/(workspace)/_layout/type.ts +7 -0
  554. package/src/app/(main)/chat/(workspace)/_layout/useInitAgentConfig.ts +10 -0
  555. package/src/app/(main)/chat/(workspace)/features/PluginTag/PluginStatus.tsx +108 -0
  556. package/src/app/(main)/chat/(workspace)/features/PluginTag/index.tsx +60 -0
  557. package/src/app/(main)/chat/(workspace)/features/SettingButton.tsx +25 -0
  558. package/src/app/(main)/chat/(workspace)/features/ShareButton/Preview.tsx +78 -0
  559. package/src/app/(main)/chat/(workspace)/features/ShareButton/ShareModal.tsx +164 -0
  560. package/src/app/(main)/chat/(workspace)/features/ShareButton/index.tsx +40 -0
  561. package/src/app/(main)/chat/(workspace)/features/ShareButton/style.ts +71 -0
  562. package/src/app/(main)/chat/(workspace)/features/ShareButton/type.ts +14 -0
  563. package/src/app/(main)/chat/(workspace)/features/ShareButton/useScreenshot.ts +60 -0
  564. package/src/app/(main)/chat/(workspace)/features/TelemetryNotification.tsx +93 -0
  565. package/src/app/(main)/chat/(workspace)/features/useWorkspaceModal.tsx +27 -0
  566. package/src/app/(main)/chat/(workspace)/layout.ts +11 -0
  567. package/src/app/(main)/chat/(workspace)/page.tsx +39 -0
  568. package/src/app/(main)/chat/@session/_layout/Desktop/PanelBody.tsx +22 -0
  569. package/src/app/(main)/chat/@session/_layout/Desktop/SessionHeader.tsx +59 -0
  570. package/src/app/(main)/chat/@session/_layout/Desktop/index.tsx +18 -0
  571. package/src/app/(main)/chat/@session/_layout/Mobile/SessionHeader.tsx +44 -0
  572. package/src/app/(main)/chat/@session/_layout/Mobile/index.tsx +22 -0
  573. package/src/app/(main)/chat/@session/default.tsx +29 -0
  574. package/src/app/(main)/chat/@session/features/SessionHydration.tsx +45 -0
  575. package/src/app/(main)/chat/@session/features/SessionListContent/CollapseGroup/Actions.tsx +141 -0
  576. package/src/app/(main)/chat/@session/features/SessionListContent/CollapseGroup/index.tsx +63 -0
  577. package/src/app/(main)/chat/@session/features/SessionListContent/DefaultMode.tsx +106 -0
  578. package/src/app/(main)/chat/@session/features/SessionListContent/Inbox/index.tsx +38 -0
  579. package/src/app/(main)/chat/@session/features/SessionListContent/List/AddButton.tsx +28 -0
  580. package/src/app/(main)/chat/@session/features/SessionListContent/List/Item/Actions.tsx +196 -0
  581. package/src/app/(main)/chat/@session/features/SessionListContent/List/Item/index.tsx +95 -0
  582. package/src/app/(main)/chat/@session/features/SessionListContent/List/index.tsx +67 -0
  583. package/src/app/(main)/chat/@session/features/SessionListContent/ListItem/index.tsx +67 -0
  584. package/src/app/(main)/chat/@session/features/SessionListContent/Modals/ConfigGroupModal/GroupItem.tsx +89 -0
  585. package/src/app/(main)/chat/@session/features/SessionListContent/Modals/ConfigGroupModal/index.tsx +85 -0
  586. package/src/app/(main)/chat/@session/features/SessionListContent/Modals/CreateGroupModal.tsx +70 -0
  587. package/src/app/(main)/chat/@session/features/SessionListContent/Modals/RenameGroupModal.tsx +59 -0
  588. package/src/app/(main)/chat/@session/features/SessionListContent/SearchMode.tsx +21 -0
  589. package/src/app/(main)/chat/@session/features/SessionListContent/index.tsx +18 -0
  590. package/src/app/(main)/chat/@session/features/SessionListContent/useSwitchSession.ts +26 -0
  591. package/src/app/(main)/chat/@session/features/SessionSearchBar.tsx +37 -0
  592. package/src/app/(main)/chat/@session/features/SkeletonList.tsx +51 -0
  593. package/src/app/(main)/chat/_layout/Desktop/SessionPanel.tsx +75 -0
  594. package/src/app/(main)/chat/_layout/Desktop/index.tsx +31 -0
  595. package/src/app/(main)/chat/_layout/Mobile.tsx +49 -0
  596. package/src/app/(main)/chat/_layout/type.ts +6 -0
  597. package/src/app/(main)/chat/error.tsx +5 -0
  598. package/src/app/(main)/chat/features/Migration/ExportConfigButton.tsx +33 -0
  599. package/src/app/(main)/chat/features/Migration/Failed.tsx +118 -0
  600. package/src/app/(main)/chat/features/Migration/Modal.tsx +80 -0
  601. package/src/app/(main)/chat/features/Migration/Start.tsx +106 -0
  602. package/src/app/(main)/chat/features/Migration/UpgradeButton.tsx +74 -0
  603. package/src/app/(main)/chat/features/Migration/const.ts +15 -0
  604. package/src/app/(main)/chat/features/Migration/index.tsx +39 -0
  605. package/src/app/(main)/chat/features/PageTitle/index.tsx +17 -0
  606. package/src/app/(main)/chat/layout.ts +11 -0
  607. package/src/app/(main)/chat/not-found.tsx +3 -0
  608. package/src/app/(main)/chat/settings/_layout/Desktop/Header.tsx +26 -0
  609. package/src/app/(main)/chat/settings/_layout/Desktop/index.tsx +21 -0
  610. package/src/app/(main)/chat/settings/_layout/Mobile/Header.tsx +27 -0
  611. package/src/app/(main)/chat/settings/_layout/Mobile/index.tsx +19 -0
  612. package/src/app/(main)/chat/settings/error.tsx +5 -0
  613. package/src/app/(main)/chat/settings/features/EditPage.tsx +40 -0
  614. package/src/app/(main)/chat/settings/features/HeaderContent.tsx +70 -0
  615. package/src/app/(main)/chat/settings/features/SubmitAgentButton/SubmitAgentModal.tsx +98 -0
  616. package/src/app/(main)/chat/settings/features/SubmitAgentButton/index.tsx +36 -0
  617. package/src/app/(main)/chat/settings/features/SubmitAgentButton/style.ts +46 -0
  618. package/src/app/(main)/chat/settings/layout.tsx +21 -0
  619. package/src/app/(main)/chat/settings/loading.tsx +3 -0
  620. package/src/app/(main)/chat/settings/modal/page.tsx +23 -0
  621. package/src/app/(main)/chat/settings/not-found.tsx +3 -0
  622. package/src/app/(main)/chat/settings/page.tsx +7 -0
  623. package/src/app/(main)/error.tsx +5 -0
  624. package/src/app/(main)/layout.tsx +11 -0
  625. package/src/app/(main)/market/@detail/default.tsx +12 -0
  626. package/src/app/(main)/market/@detail/features/AgentDetailContent.tsx +73 -0
  627. package/src/app/(main)/market/@detail/features/Banner.tsx +46 -0
  628. package/src/app/(main)/market/@detail/features/Comment.tsx +16 -0
  629. package/src/app/(main)/market/@detail/features/Header.tsx +81 -0
  630. package/src/app/(main)/market/@detail/features/Loading.tsx +63 -0
  631. package/src/app/(main)/market/@detail/features/TokenTag.tsx +26 -0
  632. package/src/app/(main)/market/@detail/features/style.ts +31 -0
  633. package/src/app/(main)/market/_layout/Desktop/DetailSidebar.tsx +84 -0
  634. package/src/app/(main)/market/_layout/Desktop/Header.tsx +27 -0
  635. package/src/app/(main)/market/_layout/Desktop/Hero.tsx +39 -0
  636. package/src/app/(main)/market/_layout/Desktop/index.tsx +46 -0
  637. package/src/app/(main)/market/_layout/Mobile/DetailModal.tsx +32 -0
  638. package/src/app/(main)/market/_layout/Mobile/Header.tsx +20 -0
  639. package/src/app/(main)/market/_layout/Mobile/index.tsx +25 -0
  640. package/src/app/(main)/market/_layout/type.ts +6 -0
  641. package/src/app/(main)/market/features/AgentCard/AgentCardBanner.tsx +59 -0
  642. package/src/app/(main)/market/features/AgentCard/index.tsx +139 -0
  643. package/src/app/(main)/market/features/AgentList.tsx +103 -0
  644. package/src/app/(main)/market/features/AgentSearchBar.tsx +42 -0
  645. package/src/app/(main)/market/features/ShareAgentButton/Inner.tsx +54 -0
  646. package/src/app/(main)/market/features/ShareAgentButton/index.tsx +50 -0
  647. package/src/app/(main)/market/features/TagList.tsx +69 -0
  648. package/src/app/(main)/market/layout.tsx +11 -0
  649. package/src/app/(main)/market/loading.tsx +15 -0
  650. package/src/app/(main)/market/page.tsx +44 -0
  651. package/src/app/(main)/not-found.tsx +3 -0
  652. package/src/app/(main)/profile/[[...slugs]]/Client.tsx +74 -0
  653. package/src/app/(main)/profile/[[...slugs]]/page.tsx +21 -0
  654. package/src/app/(main)/profile/_layout/Mobile/Header.tsx +26 -0
  655. package/src/app/(main)/profile/_layout/Mobile/index.tsx +16 -0
  656. package/src/app/(main)/profile/layout.tsx +20 -0
  657. package/src/app/(main)/profile/loading.tsx +23 -0
  658. package/src/app/(main)/settings/@category/default.tsx +15 -0
  659. package/src/app/(main)/settings/@category/features/CategoryContent.tsx +37 -0
  660. package/src/app/(main)/settings/@category/features/UpgradeAlert.tsx +38 -0
  661. package/src/app/(main)/settings/_layout/Desktop/Header.tsx +85 -0
  662. package/src/app/(main)/settings/_layout/Desktop/SideBar.tsx +59 -0
  663. package/src/app/(main)/settings/_layout/Desktop/index.tsx +54 -0
  664. package/src/app/(main)/settings/_layout/Mobile/Header.tsx +43 -0
  665. package/src/app/(main)/settings/_layout/Mobile/index.tsx +18 -0
  666. package/src/app/(main)/settings/_layout/type.ts +6 -0
  667. package/src/app/(main)/settings/about/features/AboutList.tsx +27 -0
  668. package/src/app/(main)/settings/about/features/Analytics.tsx +42 -0
  669. package/src/app/(main)/settings/about/features/ItemCard.tsx +45 -0
  670. package/src/app/(main)/settings/about/features/ItemLink.tsx +32 -0
  671. package/src/app/(main)/settings/about/features/Version.tsx +74 -0
  672. package/src/app/(main)/settings/about/index.tsx +139 -0
  673. package/src/app/(main)/settings/about/page.tsx +20 -0
  674. package/src/app/(main)/settings/agent/index.tsx +33 -0
  675. package/src/app/(main)/settings/agent/page.tsx +12 -0
  676. package/src/app/(main)/settings/common/features/Common.tsx +171 -0
  677. package/src/app/(main)/settings/common/features/Theme/ThemeSwatches/ThemeSwatchesNeutral.tsx +33 -0
  678. package/src/app/(main)/settings/common/features/Theme/ThemeSwatches/ThemeSwatchesPrimary.tsx +33 -0
  679. package/src/app/(main)/settings/common/features/Theme/ThemeSwatches/index.ts +2 -0
  680. package/src/app/(main)/settings/common/features/Theme/index.tsx +148 -0
  681. package/src/app/(main)/settings/common/index.tsx +15 -0
  682. package/src/app/(main)/settings/common/page.tsx +13 -0
  683. package/src/app/(main)/settings/error.tsx +5 -0
  684. package/src/app/(main)/settings/features/UpgradeAlert.tsx +42 -0
  685. package/src/app/(main)/settings/hooks/useCategory.tsx +94 -0
  686. package/src/app/(main)/settings/hooks/useSyncSettings.ts +23 -0
  687. package/src/app/(main)/settings/layout.ts +11 -0
  688. package/src/app/(main)/settings/llm/ProviderList/Azure/index.tsx +107 -0
  689. package/src/app/(main)/settings/llm/ProviderList/Bedrock/index.tsx +68 -0
  690. package/src/app/(main)/settings/llm/ProviderList/Ollama/Checker.tsx +73 -0
  691. package/src/app/(main)/settings/llm/ProviderList/Ollama/index.tsx +29 -0
  692. package/src/app/(main)/settings/llm/ProviderList/OpenAI/index.tsx +20 -0
  693. package/src/app/(main)/settings/llm/ProviderList/providers.tsx +141 -0
  694. package/src/app/(main)/settings/llm/components/Checker.tsx +111 -0
  695. package/src/app/(main)/settings/llm/components/Footer.tsx +35 -0
  696. package/src/app/(main)/settings/llm/components/ProviderConfig/index.tsx +214 -0
  697. package/src/app/(main)/settings/llm/components/ProviderModelList/CustomModelOption.tsx +93 -0
  698. package/src/app/(main)/settings/llm/components/ProviderModelList/ModelConfigModal/Form.tsx +98 -0
  699. package/src/app/(main)/settings/llm/components/ProviderModelList/ModelConfigModal/MaxTokenSlider.tsx +103 -0
  700. package/src/app/(main)/settings/llm/components/ProviderModelList/ModelConfigModal/index.tsx +78 -0
  701. package/src/app/(main)/settings/llm/components/ProviderModelList/ModelFetcher.tsx +86 -0
  702. package/src/app/(main)/settings/llm/components/ProviderModelList/Option.tsx +66 -0
  703. package/src/app/(main)/settings/llm/components/ProviderModelList/index.tsx +147 -0
  704. package/src/app/(main)/settings/llm/const.ts +20 -0
  705. package/src/app/(main)/settings/llm/index.tsx +25 -0
  706. package/src/app/(main)/settings/llm/page.tsx +23 -0
  707. package/src/app/(main)/settings/llm/type.ts +5 -0
  708. package/src/app/(main)/settings/loading.tsx +9 -0
  709. package/src/app/(main)/settings/modal/page.tsx +27 -0
  710. package/src/app/(main)/settings/not-found.tsx +3 -0
  711. package/src/app/(main)/settings/sync/features/Alert.tsx +39 -0
  712. package/src/app/(main)/settings/sync/features/DeviceInfo/Card.tsx +42 -0
  713. package/src/app/(main)/settings/sync/features/DeviceInfo/DeviceName.tsx +63 -0
  714. package/src/app/(main)/settings/sync/features/DeviceInfo/SystemIcon.tsx +29 -0
  715. package/src/app/(main)/settings/sync/features/DeviceInfo/index.tsx +103 -0
  716. package/src/app/(main)/settings/sync/features/WebRTC/ChannelNameInput.tsx +46 -0
  717. package/src/app/(main)/settings/sync/features/WebRTC/SyncSwitch/index.css +237 -0
  718. package/src/app/(main)/settings/sync/features/WebRTC/SyncSwitch/index.tsx +79 -0
  719. package/src/app/(main)/settings/sync/features/WebRTC/generateRandomRoomName.ts +4 -0
  720. package/src/app/(main)/settings/sync/features/WebRTC/index.tsx +98 -0
  721. package/src/app/(main)/settings/sync/index.tsx +17 -0
  722. package/src/app/(main)/settings/sync/page.tsx +26 -0
  723. package/src/app/(main)/settings/system-agent/features/Topic.tsx +56 -0
  724. package/src/app/(main)/settings/system-agent/features/Translation.tsx +56 -0
  725. package/src/app/(main)/settings/system-agent/features/useSync.ts +23 -0
  726. package/src/app/(main)/settings/system-agent/index.tsx +15 -0
  727. package/src/app/(main)/settings/system-agent/page.tsx +14 -0
  728. package/src/app/(main)/settings/tts/features/OpenAI.tsx +54 -0
  729. package/src/app/(main)/settings/tts/features/STT.tsx +58 -0
  730. package/src/app/(main)/settings/tts/features/const.ts +30 -0
  731. package/src/app/(main)/settings/tts/index.tsx +15 -0
  732. package/src/app/(main)/settings/tts/page.tsx +12 -0
  733. package/src/app/(main)/welcome/_layout/Desktop.tsx +36 -0
  734. package/src/app/(main)/welcome/_layout/Mobile.tsx +12 -0
  735. package/src/app/(main)/welcome/features/Actions.tsx +39 -0
  736. package/src/app/(main)/welcome/features/Hero.tsx +63 -0
  737. package/src/app/(main)/welcome/features/Logo.tsx +30 -0
  738. package/src/app/(main)/welcome/layout.tsx +10 -0
  739. package/src/app/(main)/welcome/page.tsx +41 -0
  740. package/src/app/@modal/(.)settings/modal/index.tsx +45 -0
  741. package/src/app/@modal/(.)settings/modal/layout.tsx +44 -0
  742. package/src/app/@modal/(.)settings/modal/loading.tsx +5 -0
  743. package/src/app/@modal/(.)settings/modal/page.tsx +19 -0
  744. package/src/app/@modal/_layout/SettingModalLayout.tsx +71 -0
  745. package/src/app/@modal/chat/(.)settings/modal/features/CategoryContent.tsx +37 -0
  746. package/src/app/@modal/chat/(.)settings/modal/features/useCategory.tsx +54 -0
  747. package/src/app/@modal/chat/(.)settings/modal/layout.tsx +58 -0
  748. package/src/app/@modal/chat/(.)settings/modal/loading.tsx +5 -0
  749. package/src/app/@modal/chat/(.)settings/modal/page.tsx +55 -0
  750. package/src/app/@modal/default.tsx +3 -0
  751. package/src/app/@modal/error.tsx +5 -0
  752. package/src/app/@modal/layout.tsx +34 -0
  753. package/src/app/@modal/loading.tsx +5 -0
  754. package/src/app/api/auth/[...nextauth]/route.ts +3 -0
  755. package/src/app/api/chat/[provider]/route.test.ts +222 -0
  756. package/src/app/api/chat/[provider]/route.ts +56 -0
  757. package/src/app/api/chat/agentRuntime.test.ts +333 -0
  758. package/src/app/api/chat/agentRuntime.ts +240 -0
  759. package/src/app/api/chat/anthropic/route.test.ts +28 -0
  760. package/src/app/api/chat/anthropic/route.ts +33 -0
  761. package/src/app/api/chat/apiKeyManager.test.ts +131 -0
  762. package/src/app/api/chat/apiKeyManager.ts +46 -0
  763. package/src/app/api/chat/google/route.test.ts +28 -0
  764. package/src/app/api/chat/google/route.ts +20 -0
  765. package/src/app/api/chat/minimax/route.test.ts +24 -0
  766. package/src/app/api/chat/minimax/route.ts +5 -0
  767. package/src/app/api/chat/models/[provider]/route.ts +45 -0
  768. package/src/app/api/config.test.ts +43 -0
  769. package/src/app/api/config.ts +14 -0
  770. package/src/app/api/errorResponse.test.ts +100 -0
  771. package/src/app/api/errorResponse.ts +54 -0
  772. package/src/app/api/market/AgentMarket.test.ts +55 -0
  773. package/src/app/api/market/AgentMarket.ts +25 -0
  774. package/src/app/api/market/[id]/route.ts +22 -0
  775. package/src/app/api/market/route.ts +23 -0
  776. package/src/app/api/middleware/auth/index.test.ts +77 -0
  777. package/src/app/api/middleware/auth/index.ts +62 -0
  778. package/src/app/api/middleware/auth/utils.test.ts +150 -0
  779. package/src/app/api/middleware/auth/utils.ts +83 -0
  780. package/src/app/api/openai/createBizOpenAI/auth.test.ts +53 -0
  781. package/src/app/api/openai/createBizOpenAI/auth.ts +31 -0
  782. package/src/app/api/openai/createBizOpenAI/createAzureOpenai.ts +33 -0
  783. package/src/app/api/openai/createBizOpenAI/createOpenai.ts +17 -0
  784. package/src/app/api/openai/createBizOpenAI/index.ts +37 -0
  785. package/src/app/api/openai/stt/route.ts +31 -0
  786. package/src/app/api/openai/tts/route.ts +19 -0
  787. package/src/app/api/plugin/gateway/route.ts +82 -0
  788. package/src/app/api/plugin/gateway/settings.test.ts +105 -0
  789. package/src/app/api/plugin/gateway/settings.ts +29 -0
  790. package/src/app/api/plugin/store/Store.test.ts +26 -0
  791. package/src/app/api/plugin/store/Store.ts +19 -0
  792. package/src/app/api/plugin/store/route.ts +23 -0
  793. package/src/app/api/proxy/route.ts +34 -0
  794. package/src/app/api/text-to-image/[provider]/route.ts +61 -0
  795. package/src/app/api/trace/route.ts +40 -0
  796. package/src/app/api/tts/edge-speech/route.ts +9 -0
  797. package/src/app/api/tts/microsoft-speech/route.ts +9 -0
  798. package/src/app/api/webhooks/clerk/__tests__/fixtures/createUser.json +73 -0
  799. package/src/app/api/webhooks/clerk/route.ts +159 -0
  800. package/src/app/api/webhooks/clerk/validateRequest.ts +22 -0
  801. package/src/app/error.tsx +5 -0
  802. package/src/app/global-error.tsx +20 -0
  803. package/src/app/layout.tsx +64 -0
  804. package/src/app/metadata.ts +58 -0
  805. package/src/app/not-found.tsx +3 -0
  806. package/src/app/page.tsx +23 -0
  807. package/src/app/trpc/edge/[trpc]/route.ts +28 -0
  808. package/src/app/trpc/lambda/[trpc]/route.ts +26 -0
  809. package/src/chains/__tests__/langDetect.test.ts +51 -0
  810. package/src/chains/__tests__/pickEmoji.test.ts +47 -0
  811. package/src/chains/__tests__/summaryAgentName.test.ts +57 -0
  812. package/src/chains/__tests__/summaryDescription.test.ts +83 -0
  813. package/src/chains/__tests__/summaryTags.test.ts +54 -0
  814. package/src/chains/__tests__/summaryTitle.test.ts +54 -0
  815. package/src/chains/__tests__/translate.test.ts +28 -0
  816. package/src/chains/langDetect.ts +31 -0
  817. package/src/chains/pickEmoji.ts +31 -0
  818. package/src/chains/summaryAgentName.ts +35 -0
  819. package/src/chains/summaryDescription.ts +49 -0
  820. package/src/chains/summaryTags.ts +28 -0
  821. package/src/chains/summaryTitle.ts +21 -0
  822. package/src/chains/translate.ts +17 -0
  823. package/src/components/404/index.tsx +43 -0
  824. package/src/components/Analytics/Clarity.tsx +28 -0
  825. package/src/components/Analytics/Google.tsx +7 -0
  826. package/src/components/Analytics/Plausible.tsx +16 -0
  827. package/src/components/Analytics/Posthog.tsx +22 -0
  828. package/src/components/Analytics/Umami.tsx +16 -0
  829. package/src/components/Analytics/Vercel.tsx +8 -0
  830. package/src/components/Analytics/index.tsx +44 -0
  831. package/src/components/AntdStaticMethods/index.test.tsx +43 -0
  832. package/src/components/AntdStaticMethods/index.tsx +20 -0
  833. package/src/components/BrandWatermark/index.tsx +39 -0
  834. package/src/components/BrowserIcon/components/Brave.tsx +56 -0
  835. package/src/components/BrowserIcon/components/Chrome.tsx +14 -0
  836. package/src/components/BrowserIcon/components/Chromium.tsx +14 -0
  837. package/src/components/BrowserIcon/components/Edge.tsx +36 -0
  838. package/src/components/BrowserIcon/components/Firefox.tsx +38 -0
  839. package/src/components/BrowserIcon/components/Opera.tsx +19 -0
  840. package/src/components/BrowserIcon/components/Safari.tsx +23 -0
  841. package/src/components/BrowserIcon/components/Samsung.tsx +21 -0
  842. package/src/components/BrowserIcon/index.tsx +50 -0
  843. package/src/components/BrowserIcon/types.ts +8 -0
  844. package/src/components/Cell/Divider.tsx +22 -0
  845. package/src/components/Cell/index.tsx +53 -0
  846. package/src/components/DataStyleModal/index.tsx +64 -0
  847. package/src/components/Error/index.tsx +58 -0
  848. package/src/components/Error/sentryCaptureException.ts +9 -0
  849. package/src/components/FetchErrorNotification/Description.tsx +48 -0
  850. package/src/components/FetchErrorNotification/index.tsx +15 -0
  851. package/src/components/FileList/EditableFileList.tsx +47 -0
  852. package/src/components/FileList/FileListViewer.tsx +19 -0
  853. package/src/components/FileList/index.ts +2 -0
  854. package/src/components/FileList/type.tsx +7 -0
  855. package/src/components/FullscreenLoading/index.tsx +20 -0
  856. package/src/components/GalleyGrid/Grid.tsx +36 -0
  857. package/src/components/GalleyGrid/index.tsx +58 -0
  858. package/src/components/GalleyGrid/style.ts +24 -0
  859. package/src/components/GuideModal/index.tsx +77 -0
  860. package/src/components/GuideVideo/index.tsx +30 -0
  861. package/src/components/HotKeys/index.tsx +77 -0
  862. package/src/components/ImageItem/index.tsx +75 -0
  863. package/src/components/ImageItem/style.ts +1 -0
  864. package/src/components/ManifestPreviewer/index.tsx +30 -0
  865. package/src/components/Menu/index.tsx +97 -0
  866. package/src/components/ModelIcon/index.tsx +97 -0
  867. package/src/components/ModelProviderIcon/index.tsx +118 -0
  868. package/src/components/ModelSelect/index.tsx +163 -0
  869. package/src/components/ModelTag/ModelIcon.tsx +93 -0
  870. package/src/components/ModelTag/index.tsx +13 -0
  871. package/src/components/Notification/index.tsx +95 -0
  872. package/src/components/PageTitle/index.tsx +11 -0
  873. package/src/components/SafeSpacing/index.tsx +27 -0
  874. package/src/components/SidebarHeader/index.tsx +38 -0
  875. package/src/components/SkeletonLoading/index.tsx +21 -0
  876. package/src/components/StopLoading.tsx +38 -0
  877. package/src/components/StoreHydration/ChatHydration/index.tsx +33 -0
  878. package/src/components/StructuredData/index.tsx +12 -0
  879. package/src/components/client/ClientResponsiveContent/index.tsx +32 -0
  880. package/src/components/client/ClientResponsiveLayout.tsx +32 -0
  881. package/src/components/server/MobileNavLayout.tsx +62 -0
  882. package/src/components/server/ServerLayout.tsx +19 -0
  883. package/src/config/__tests__/analytics.test.ts +70 -0
  884. package/src/config/__tests__/app.test.ts +48 -0
  885. package/src/config/__tests__/client.test.ts +40 -0
  886. package/src/config/analytics.ts +148 -0
  887. package/src/config/app.ts +60 -0
  888. package/src/config/auth.ts +149 -0
  889. package/src/config/db.ts +28 -0
  890. package/src/config/debug.ts +22 -0
  891. package/src/config/featureFlags/index.ts +31 -0
  892. package/src/config/featureFlags/schema.test.ts +59 -0
  893. package/src/config/featureFlags/schema.ts +57 -0
  894. package/src/config/featureFlags/utils/parser.test.ts +88 -0
  895. package/src/config/featureFlags/utils/parser.ts +32 -0
  896. package/src/config/file.ts +34 -0
  897. package/src/config/langfuse.ts +23 -0
  898. package/src/config/llm.ts +195 -0
  899. package/src/config/modelProviders/anthropic.ts +69 -0
  900. package/src/config/modelProviders/azure.ts +45 -0
  901. package/src/config/modelProviders/bedrock.ts +96 -0
  902. package/src/config/modelProviders/deepseek.ts +26 -0
  903. package/src/config/modelProviders/google.ts +108 -0
  904. package/src/config/modelProviders/groq.ts +48 -0
  905. package/src/config/modelProviders/index.ts +80 -0
  906. package/src/config/modelProviders/minimax.ts +50 -0
  907. package/src/config/modelProviders/mistral.ts +49 -0
  908. package/src/config/modelProviders/moonshot.ts +33 -0
  909. package/src/config/modelProviders/ollama.ts +190 -0
  910. package/src/config/modelProviders/openai.ts +142 -0
  911. package/src/config/modelProviders/openrouter.ts +125 -0
  912. package/src/config/modelProviders/perplexity.ts +52 -0
  913. package/src/config/modelProviders/qwen.ts +58 -0
  914. package/src/config/modelProviders/togetherai.ts +79 -0
  915. package/src/config/modelProviders/zeroone.ts +74 -0
  916. package/src/config/modelProviders/zhipu.ts +64 -0
  917. package/src/const/auth.ts +45 -0
  918. package/src/const/fetch.ts +27 -1
  919. package/src/const/guide.ts +86 -0
  920. package/src/const/hotkeys.ts +5 -0
  921. package/src/const/layoutTokens.ts +21 -0
  922. package/src/const/locale.ts +12 -0
  923. package/src/const/market.ts +15 -0
  924. package/src/const/message.test.ts +55 -0
  925. package/src/const/message.ts +15 -0
  926. package/src/const/meta.ts +8 -0
  927. package/src/const/plugin.ts +2 -0
  928. package/src/const/session.ts +25 -0
  929. package/src/const/settings/agent.ts +40 -0
  930. package/src/const/settings/common.ts +7 -0
  931. package/src/const/settings/index.ts +28 -0
  932. package/src/const/settings/llm.ts +96 -0
  933. package/src/const/settings/sync.ts +5 -0
  934. package/src/const/settings/systemAgent.ts +13 -0
  935. package/src/const/settings/tool.ts +5 -0
  936. package/src/const/settings/tts.ts +10 -0
  937. package/src/const/theme.ts +5 -0
  938. package/src/const/trace.ts +60 -0
  939. package/src/const/url.ts +59 -0
  940. package/src/const/user.ts +10 -0
  941. package/src/const/version.ts +6 -0
  942. package/src/database/client/core/__tests__/db-upgrade.test.ts +42 -0
  943. package/src/database/client/core/__tests__/db.test.ts +79 -0
  944. package/src/database/client/core/__tests__/model.test.ts +55 -0
  945. package/src/database/client/core/db.ts +246 -0
  946. package/src/database/client/core/index.ts +3 -0
  947. package/src/database/client/core/migrations/migrateSettingsToUser/fixtures/input.json +55 -0
  948. package/src/database/client/core/migrations/migrateSettingsToUser/fixtures/output.json +60 -0
  949. package/src/database/client/core/migrations/migrateSettingsToUser/index.test.ts +14 -0
  950. package/src/database/client/core/migrations/migrateSettingsToUser/index.ts +22 -0
  951. package/src/database/client/core/migrations/migrateSettingsToUser/type.ts +108 -0
  952. package/src/database/client/core/model.ts +252 -0
  953. package/src/database/client/core/schemas.ts +88 -0
  954. package/src/database/client/core/sync.ts +328 -0
  955. package/src/database/client/core/types/db.ts +15 -0
  956. package/src/database/client/models/__DEBUG.ts +124 -0
  957. package/src/database/client/models/__tests__/file.test.ts +83 -0
  958. package/src/database/client/models/__tests__/message.test.ts +417 -0
  959. package/src/database/client/models/__tests__/plugin.test.ts +81 -0
  960. package/src/database/client/models/__tests__/session.test.ts +254 -0
  961. package/src/database/client/models/__tests__/sessionGroup.test.ts +220 -0
  962. package/src/database/client/models/__tests__/topic.test.ts +523 -0
  963. package/src/database/client/models/__tests__/user.test.ts +82 -0
  964. package/src/database/client/models/file.ts +31 -0
  965. package/src/database/client/models/message.ts +262 -0
  966. package/src/database/client/models/plugin.ts +62 -0
  967. package/src/database/client/models/session.ts +271 -0
  968. package/src/database/client/models/sessionGroup.ts +90 -0
  969. package/src/database/client/models/topic.ts +244 -0
  970. package/src/database/client/models/user.ts +69 -0
  971. package/src/database/client/schemas/files.ts +39 -0
  972. package/src/database/client/schemas/message.ts +50 -0
  973. package/src/database/client/schemas/plugin.ts +12 -0
  974. package/src/database/client/schemas/session.ts +51 -0
  975. package/src/database/client/schemas/sessionGroup.ts +8 -0
  976. package/src/database/client/schemas/topic.ts +12 -0
  977. package/src/database/client/schemas/user.ts +40 -0
  978. package/src/database/server/core/db.ts +44 -0
  979. package/src/database/server/core/dbForTest.ts +45 -0
  980. package/src/database/server/index.ts +1 -0
  981. package/src/database/server/migrations/0000_init.sql +439 -0
  982. package/src/database/server/migrations/0001_add_client_id.sql +9 -0
  983. package/src/database/server/migrations/0002_amusing_puma.sql +9 -0
  984. package/src/database/server/migrations/meta/0000_snapshot.json +1583 -0
  985. package/src/database/server/migrations/meta/0001_snapshot.json +1636 -0
  986. package/src/database/server/migrations/meta/0002_snapshot.json +1630 -0
  987. package/src/database/server/migrations/meta/_journal.json +27 -0
  988. package/src/database/server/models/__tests__/file.test.ts +140 -0
  989. package/src/database/server/models/__tests__/message.test.ts +847 -0
  990. package/src/database/server/models/__tests__/plugin.test.ts +172 -0
  991. package/src/database/server/models/__tests__/session.test.ts +595 -0
  992. package/src/database/server/models/__tests__/topic.test.ts +623 -0
  993. package/src/database/server/models/__tests__/user.test.ts +173 -0
  994. package/src/database/server/models/_template.ts +44 -0
  995. package/src/database/server/models/file.ts +51 -0
  996. package/src/database/server/models/message.ts +378 -0
  997. package/src/database/server/models/plugin.ts +63 -0
  998. package/src/database/server/models/session.ts +290 -0
  999. package/src/database/server/models/sessionGroup.ts +69 -0
  1000. package/src/database/server/models/topic.ts +265 -0
  1001. package/src/database/server/models/user.ts +138 -0
  1002. package/src/database/server/modules/DataImporter/__tests__/fixtures/messages.json +1101 -0
  1003. package/src/database/server/modules/DataImporter/__tests__/index.test.ts +954 -0
  1004. package/src/database/server/modules/DataImporter/index.ts +333 -0
  1005. package/src/database/server/schemas/_id.ts +15 -0
  1006. package/src/database/server/schemas/lobechat.ts +601 -0
  1007. package/src/database/server/utils/idGenerator.test.ts +39 -0
  1008. package/src/database/server/utils/idGenerator.ts +26 -0
  1009. package/src/features/AgentInfo/index.tsx +70 -0
  1010. package/src/features/AgentSetting/AgentChat/index.tsx +142 -0
  1011. package/src/features/AgentSetting/AgentMeta/AutoGenerateInput.tsx +45 -0
  1012. package/src/features/AgentSetting/AgentMeta/AutoGenerateSelect.tsx +50 -0
  1013. package/src/features/AgentSetting/AgentMeta/BackgroundSwatches.tsx +27 -0
  1014. package/src/features/AgentSetting/AgentMeta/index.tsx +135 -0
  1015. package/src/features/AgentSetting/AgentModal/ModelSelect.tsx +20 -0
  1016. package/src/features/AgentSetting/AgentModal/index.tsx +95 -0
  1017. package/src/features/AgentSetting/AgentPlugin/AddPluginButton.tsx +49 -0
  1018. package/src/features/AgentSetting/AgentPlugin/LoadingList.tsx +48 -0
  1019. package/src/features/AgentSetting/AgentPlugin/LocalPluginItem.tsx +42 -0
  1020. package/src/features/AgentSetting/AgentPlugin/PluginAction/index.tsx +36 -0
  1021. package/src/features/AgentSetting/AgentPlugin/index.tsx +163 -0
  1022. package/src/features/AgentSetting/AgentPrompt/TokenTag.tsx +39 -0
  1023. package/src/features/AgentSetting/AgentPrompt/index.tsx +128 -0
  1024. package/src/features/AgentSetting/AgentTTS/SelectWithTTSPreview.tsx +120 -0
  1025. package/src/features/AgentSetting/AgentTTS/index.tsx +122 -0
  1026. package/src/features/AgentSetting/AgentTTS/options.ts +16 -0
  1027. package/src/features/AgentSetting/StoreUpdater.tsx +27 -0
  1028. package/src/features/AgentSetting/index.tsx +26 -0
  1029. package/src/features/AgentSetting/store/action.ts +287 -0
  1030. package/src/features/AgentSetting/store/index.ts +16 -0
  1031. package/src/features/AgentSetting/store/initialState.ts +28 -0
  1032. package/src/features/AgentSetting/store/reducers/config.ts +54 -0
  1033. package/src/features/AgentSetting/store/reducers/meta.ts +21 -0
  1034. package/src/features/AgentSetting/store/selectors.ts +11 -0
  1035. package/src/features/AgentSetting/useSyncAgemtSettings.ts +14 -0
  1036. package/src/features/AvatarWithUpload/index.tsx +40 -0
  1037. package/src/features/ChatInput/ActionBar/Clear.tsx +49 -0
  1038. package/src/features/ChatInput/ActionBar/FileUpload.tsx +69 -0
  1039. package/src/features/ChatInput/ActionBar/History.tsx +70 -0
  1040. package/src/features/ChatInput/ActionBar/ModelSwitch.tsx +20 -0
  1041. package/src/features/ChatInput/ActionBar/Temperature.tsx +49 -0
  1042. package/src/features/ChatInput/ActionBar/Token/TokenProgress.tsx +80 -0
  1043. package/src/features/ChatInput/ActionBar/Token/TokenTag.tsx +149 -0
  1044. package/src/features/ChatInput/ActionBar/Token/index.tsx +18 -0
  1045. package/src/features/ChatInput/ActionBar/Tools/Dropdown.tsx +145 -0
  1046. package/src/features/ChatInput/ActionBar/Tools/ToolItem.tsx +45 -0
  1047. package/src/features/ChatInput/ActionBar/Tools/index.tsx +33 -0
  1048. package/src/features/ChatInput/ActionBar/config.ts +33 -0
  1049. package/src/features/ChatInput/ActionBar/index.tsx +58 -0
  1050. package/src/features/ChatInput/STT/browser.tsx +118 -0
  1051. package/src/features/ChatInput/STT/common.tsx +120 -0
  1052. package/src/features/ChatInput/STT/index.tsx +20 -0
  1053. package/src/features/ChatInput/STT/openai.tsx +129 -0
  1054. package/src/features/ChatInput/Topic/index.tsx +41 -0
  1055. package/src/features/ChatInput/useChatInput.ts +45 -0
  1056. package/src/features/ChatInput/useSend.ts +35 -0
  1057. package/src/features/Conversation/Actions/Assistant.tsx +36 -0
  1058. package/src/features/Conversation/Actions/Error.tsx +11 -0
  1059. package/src/features/Conversation/Actions/Fallback.tsx +13 -0
  1060. package/src/features/Conversation/Actions/Tool.tsx +28 -0
  1061. package/src/features/Conversation/Actions/User.tsx +20 -0
  1062. package/src/features/Conversation/Actions/customAction.ts +37 -0
  1063. package/src/features/Conversation/Actions/index.ts +79 -0
  1064. package/src/features/Conversation/Error/APIKeyForm/Bedrock.tsx +80 -0
  1065. package/src/features/Conversation/Error/APIKeyForm/ProviderApiKeyForm.tsx +79 -0
  1066. package/src/features/Conversation/Error/APIKeyForm/ProviderAvatar.tsx +89 -0
  1067. package/src/features/Conversation/Error/APIKeyForm/index.tsx +96 -0
  1068. package/src/features/Conversation/Error/AccessCodeForm.tsx +63 -0
  1069. package/src/features/Conversation/Error/ClerkLogin/index.tsx +47 -0
  1070. package/src/features/Conversation/Error/ErrorJsonViewer.tsx +26 -0
  1071. package/src/features/Conversation/Error/InvalidAPIKey.tsx +16 -0
  1072. package/src/features/Conversation/Error/InvalidAccessCode.tsx +79 -0
  1073. package/src/features/Conversation/Error/OAuthForm.tsx +97 -0
  1074. package/src/features/Conversation/Error/OllamaBizError/InvalidOllamaModel/index.tsx +153 -0
  1075. package/src/features/Conversation/Error/OllamaBizError/InvalidOllamaModel/useDownloadMonitor.ts +46 -0
  1076. package/src/features/Conversation/Error/OllamaBizError/SetupGuide.tsx +221 -0
  1077. package/src/features/Conversation/Error/OllamaBizError/index.tsx +47 -0
  1078. package/src/features/Conversation/Error/OpenAiBizError.tsx +29 -0
  1079. package/src/features/Conversation/Error/PluginSettings.tsx +66 -0
  1080. package/src/features/Conversation/Error/index.tsx +117 -0
  1081. package/src/features/Conversation/Error/style.tsx +76 -0
  1082. package/src/features/Conversation/Extras/Assistant.test.tsx +86 -0
  1083. package/src/features/Conversation/Extras/Assistant.tsx +51 -0
  1084. package/src/features/Conversation/Extras/ExtraContainer.tsx +13 -0
  1085. package/src/features/Conversation/Extras/TTS/FilePlayer.tsx +25 -0
  1086. package/src/features/Conversation/Extras/TTS/InitPlayer.tsx +93 -0
  1087. package/src/features/Conversation/Extras/TTS/Player.tsx +61 -0
  1088. package/src/features/Conversation/Extras/TTS/index.tsx +32 -0
  1089. package/src/features/Conversation/Extras/Translate.tsx +72 -0
  1090. package/src/features/Conversation/Extras/User.tsx +36 -0
  1091. package/src/features/Conversation/Extras/index.ts +8 -0
  1092. package/src/features/Conversation/Extras/type.ts +5 -0
  1093. package/src/features/Conversation/Messages/Assistant/ToolCalls/index.tsx +73 -0
  1094. package/src/features/Conversation/Messages/Assistant/ToolCalls/style.ts +25 -0
  1095. package/src/features/Conversation/Messages/Assistant/index.tsx +51 -0
  1096. package/src/features/Conversation/Messages/Default.tsx +19 -0
  1097. package/src/features/Conversation/Messages/Tool/Inspector/PluginResultJSON.tsx +24 -0
  1098. package/src/features/Conversation/Messages/Tool/Inspector/Settings.tsx +39 -0
  1099. package/src/features/Conversation/Messages/Tool/Inspector/index.tsx +134 -0
  1100. package/src/features/Conversation/Messages/Tool/Inspector/style.ts +26 -0
  1101. package/src/features/Conversation/Messages/Tool/index.tsx +44 -0
  1102. package/src/features/Conversation/Messages/User.tsx +23 -0
  1103. package/src/features/Conversation/Messages/index.ts +38 -0
  1104. package/src/features/Conversation/Plugins/Render/BuiltinType/index.test.tsx +53 -0
  1105. package/src/features/Conversation/Plugins/Render/BuiltinType/index.tsx +29 -0
  1106. package/src/features/Conversation/Plugins/Render/DefaultType/IFrameRender/index.tsx +61 -0
  1107. package/src/features/Conversation/Plugins/Render/DefaultType/SystemJsRender/index.tsx +40 -0
  1108. package/src/features/Conversation/Plugins/Render/DefaultType/SystemJsRender/utils.ts +26 -0
  1109. package/src/features/Conversation/Plugins/Render/DefaultType/index.tsx +53 -0
  1110. package/src/features/Conversation/Plugins/Render/Loading.tsx +60 -0
  1111. package/src/features/Conversation/Plugins/Render/MarkdownType/index.tsx +25 -0
  1112. package/src/features/Conversation/Plugins/Render/StandaloneType/Iframe.tsx +163 -0
  1113. package/src/features/Conversation/Plugins/Render/StandaloneType/index.tsx +29 -0
  1114. package/src/features/Conversation/Plugins/Render/index.tsx +51 -0
  1115. package/src/features/Conversation/Plugins/Render/useParseContent.ts +15 -0
  1116. package/src/features/Conversation/Plugins/Render/utils/iframeOnReady.test.ts +75 -0
  1117. package/src/features/Conversation/Plugins/Render/utils/iframeOnReady.ts +25 -0
  1118. package/src/features/Conversation/Plugins/Render/utils/listenToPlugin.test.ts +164 -0
  1119. package/src/features/Conversation/Plugins/Render/utils/listenToPlugin.ts +98 -0
  1120. package/src/features/Conversation/Plugins/Render/utils/pluginSettings.test.ts +53 -0
  1121. package/src/features/Conversation/Plugins/Render/utils/pluginSettings.ts +17 -0
  1122. package/src/features/Conversation/Plugins/Render/utils/pluginState.test.ts +43 -0
  1123. package/src/features/Conversation/Plugins/Render/utils/pluginState.ts +20 -0
  1124. package/src/features/Conversation/Plugins/Render/utils/postMessage.test.ts +64 -0
  1125. package/src/features/Conversation/Plugins/Render/utils/postMessage.ts +28 -0
  1126. package/src/features/Conversation/components/AutoScroll.tsx +26 -0
  1127. package/src/features/Conversation/components/BackBottom/index.tsx +31 -0
  1128. package/src/features/Conversation/components/BackBottom/style.ts +36 -0
  1129. package/src/features/Conversation/components/BubblesLoading.tsx +61 -0
  1130. package/src/features/Conversation/components/ChatItem/ActionsBar.tsx +58 -0
  1131. package/src/features/Conversation/components/ChatItem/HistoryDivider.tsx +26 -0
  1132. package/src/features/Conversation/components/ChatItem/index.tsx +156 -0
  1133. package/src/features/Conversation/components/ChatList/index.tsx +21 -0
  1134. package/src/features/Conversation/components/InboxWelcome/AgentsSuggest.tsx +113 -0
  1135. package/src/features/Conversation/components/InboxWelcome/QuestionSuggest.tsx +104 -0
  1136. package/src/features/Conversation/components/InboxWelcome/index.tsx +70 -0
  1137. package/src/features/Conversation/components/OTPInput.tsx +136 -0
  1138. package/src/features/Conversation/components/SkeletonList.tsx +51 -0
  1139. package/src/features/Conversation/components/VirtualizedList/index.tsx +138 -0
  1140. package/src/features/Conversation/hooks/useChatListActionsBar.tsx +55 -0
  1141. package/src/features/Conversation/index.tsx +30 -0
  1142. package/src/features/Conversation/types/index.tsx +32 -0
  1143. package/src/features/DataImporter/Error.tsx +65 -0
  1144. package/src/features/DataImporter/FileUploading.tsx +50 -0
  1145. package/src/features/DataImporter/Loading.tsx +125 -0
  1146. package/src/features/DataImporter/SuccessResult.tsx +61 -0
  1147. package/src/features/DataImporter/index.tsx +185 -0
  1148. package/src/features/DataImporter/style.ts +17 -0
  1149. package/src/features/DebugUI/index.tsx +36 -0
  1150. package/src/features/FileList/EditableFileList.tsx +31 -0
  1151. package/src/features/FileList/FileListPreviewer.tsx +17 -0
  1152. package/src/features/FileList/index.tsx +2 -0
  1153. package/src/features/Follow/index.tsx +64 -0
  1154. package/src/features/MobileSwitchLoading/index.tsx +13 -0
  1155. package/src/features/MobileTabBar/index.tsx +61 -0
  1156. package/src/features/ModelSelect/index.tsx +67 -0
  1157. package/src/features/ModelSwitchPanel/index.tsx +113 -0
  1158. package/src/features/PWAInstall/index.tsx +72 -0
  1159. package/src/features/PluginDetailModal/APIs.tsx +43 -0
  1160. package/src/features/PluginDetailModal/Meta.tsx +57 -0
  1161. package/src/features/PluginDetailModal/index.tsx +75 -0
  1162. package/src/features/PluginDevModal/LocalForm.tsx +124 -0
  1163. package/src/features/PluginDevModal/PluginPreview.tsx +36 -0
  1164. package/src/features/PluginDevModal/UrlManifestForm.tsx +134 -0
  1165. package/src/features/PluginDevModal/index.tsx +172 -0
  1166. package/src/features/PluginSettings/PluginSettingRender.tsx +86 -0
  1167. package/src/features/PluginSettings/index.tsx +87 -0
  1168. package/src/features/PluginStore/AddPluginButton.tsx +47 -0
  1169. package/src/features/PluginStore/InstalledPluginList.tsx +61 -0
  1170. package/src/features/PluginStore/Loading.tsx +13 -0
  1171. package/src/features/PluginStore/OnlineList.tsx +89 -0
  1172. package/src/features/PluginStore/PluginItem/Action.tsx +116 -0
  1173. package/src/features/PluginStore/PluginItem/EditCustomPlugin.tsx +55 -0
  1174. package/src/features/PluginStore/PluginItem/PluginTag.tsx +58 -0
  1175. package/src/features/PluginStore/PluginItem/index.tsx +82 -0
  1176. package/src/features/PluginStore/index.tsx +57 -0
  1177. package/src/features/Setting/Footer.tsx +96 -0
  1178. package/src/features/Setting/SettingContainer.tsx +35 -0
  1179. package/src/features/SyncStatusInspector/DisableSync.tsx +79 -0
  1180. package/src/features/SyncStatusInspector/EnableSync.tsx +136 -0
  1181. package/src/features/SyncStatusInspector/EnableTag.tsx +66 -0
  1182. package/src/features/SyncStatusInspector/index.tsx +27 -0
  1183. package/src/features/User/DataStatistics.tsx +155 -0
  1184. package/src/features/User/PlanTag.tsx +45 -0
  1185. package/src/features/User/UserAvatar.tsx +75 -0
  1186. package/src/features/User/UserInfo.tsx +59 -0
  1187. package/src/features/User/UserLoginOrSignup.tsx +23 -0
  1188. package/src/features/User/UserPanel/LangButton.tsx +57 -0
  1189. package/src/features/User/UserPanel/PanelContent.tsx +85 -0
  1190. package/src/features/User/UserPanel/ThemeButton.tsx +70 -0
  1191. package/src/features/User/UserPanel/UpgradeBadge.tsx +19 -0
  1192. package/src/features/User/UserPanel/index.tsx +43 -0
  1193. package/src/features/User/UserPanel/useMenu.tsx +239 -0
  1194. package/src/features/User/UserPanel/useNewVersion.tsx +14 -0
  1195. package/src/features/User/__tests__/PanelContent.test.tsx +155 -0
  1196. package/src/features/User/__tests__/UserAvatar.test.tsx +83 -0
  1197. package/src/features/User/__tests__/useMenu.test.tsx +146 -0
  1198. package/src/hooks/_header.ts +23 -0
  1199. package/src/hooks/useActiveSettingsKey.ts +20 -0
  1200. package/src/hooks/useActiveTabKey.ts +12 -0
  1201. package/src/hooks/useDownloadSpeed.ts +50 -0
  1202. package/src/hooks/useGreeting/greetingTime.ts +14 -0
  1203. package/src/hooks/useGreeting/index.ts +16 -0
  1204. package/src/hooks/useInterceptingRoutes.test.ts +70 -0
  1205. package/src/hooks/useInterceptingRoutes.ts +46 -0
  1206. package/src/hooks/useIsMobile.ts +8 -0
  1207. package/src/hooks/useIsSubSlug.ts +12 -0
  1208. package/src/hooks/usePWAInstall.test.ts +78 -0
  1209. package/src/hooks/usePWAInstall.ts +39 -0
  1210. package/src/hooks/usePlatform.test.ts +82 -0
  1211. package/src/hooks/usePlatform.ts +32 -0
  1212. package/src/hooks/useProviderName.ts +8 -0
  1213. package/src/hooks/useQuery.test.ts +19 -0
  1214. package/src/hooks/useQuery.ts +8 -0
  1215. package/src/hooks/useQueryRoute.test.ts +86 -0
  1216. package/src/hooks/useQueryRoute.ts +46 -0
  1217. package/src/hooks/useSyncData.ts +50 -0
  1218. package/src/hooks/useTTS.ts +84 -0
  1219. package/src/hooks/useTokenCount.test.ts +41 -0
  1220. package/src/hooks/useTokenCount.ts +20 -0
  1221. package/src/layout/AuthProvider/Clerk/UserUpdater.tsx +40 -0
  1222. package/src/layout/AuthProvider/Clerk/index.tsx +26 -0
  1223. package/src/layout/AuthProvider/Clerk/useAppearance.ts +123 -0
  1224. package/src/layout/AuthProvider/NextAuth/UserUpdater.tsx +35 -0
  1225. package/src/layout/AuthProvider/NextAuth/index.tsx +17 -0
  1226. package/src/layout/AuthProvider/NoAuth/index.tsx +16 -0
  1227. package/src/layout/AuthProvider/index.tsx +17 -0
  1228. package/src/layout/GlobalProvider/AppTheme.tsx +127 -0
  1229. package/src/layout/GlobalProvider/Locale.tsx +62 -0
  1230. package/src/layout/GlobalProvider/StoreInitialization.tsx +79 -0
  1231. package/src/layout/GlobalProvider/StyleRegistry.tsx +24 -0
  1232. package/src/layout/GlobalProvider/index.tsx +100 -0
  1233. package/src/libs/agent-runtime/AgentRuntime.test.ts +416 -0
  1234. package/src/libs/agent-runtime/AgentRuntime.ts +221 -0
  1235. package/src/libs/agent-runtime/BaseAI.ts +24 -0
  1236. package/src/libs/agent-runtime/anthropic/index.test.ts +507 -0
  1237. package/src/libs/agent-runtime/anthropic/index.ts +160 -0
  1238. package/src/libs/agent-runtime/azureOpenai/index.test.ts +356 -0
  1239. package/src/libs/agent-runtime/azureOpenai/index.ts +106 -0
  1240. package/src/libs/agent-runtime/bedrock/index.test.ts +394 -0
  1241. package/src/libs/agent-runtime/bedrock/index.ts +154 -0
  1242. package/src/libs/agent-runtime/deepseek/index.test.ts +255 -0
  1243. package/src/libs/agent-runtime/deepseek/index.ts +10 -0
  1244. package/src/libs/agent-runtime/error.ts +26 -0
  1245. package/src/libs/agent-runtime/google/index.test.ts +602 -0
  1246. package/src/libs/agent-runtime/google/index.ts +336 -0
  1247. package/src/libs/agent-runtime/groq/index.test.ts +320 -0
  1248. package/src/libs/agent-runtime/groq/index.ts +25 -0
  1249. package/src/libs/agent-runtime/index.ts +22 -0
  1250. package/src/libs/agent-runtime/minimax/index.test.ts +275 -0
  1251. package/src/libs/agent-runtime/minimax/index.ts +176 -0
  1252. package/src/libs/agent-runtime/mistral/index.test.ts +331 -0
  1253. package/src/libs/agent-runtime/mistral/index.ts +21 -0
  1254. package/src/libs/agent-runtime/moonshot/index.test.ts +251 -0
  1255. package/src/libs/agent-runtime/moonshot/index.ts +10 -0
  1256. package/src/libs/agent-runtime/ollama/index.test.ts +197 -0
  1257. package/src/libs/agent-runtime/ollama/index.ts +111 -0
  1258. package/src/libs/agent-runtime/ollama/type.ts +8 -0
  1259. package/src/libs/agent-runtime/openai/__snapshots__/index.test.ts.snap +101 -0
  1260. package/src/libs/agent-runtime/openai/fixtures/openai-models.json +170 -0
  1261. package/src/libs/agent-runtime/openai/index.test.ts +245 -0
  1262. package/src/libs/agent-runtime/openai/index.ts +16 -0
  1263. package/src/libs/agent-runtime/openrouter/__snapshots__/index.test.ts.snap +82 -0
  1264. package/src/libs/agent-runtime/openrouter/fixtures/models.json +62 -0
  1265. package/src/libs/agent-runtime/openrouter/index.test.ts +312 -0
  1266. package/src/libs/agent-runtime/openrouter/index.ts +41 -0
  1267. package/src/libs/agent-runtime/openrouter/type.ts +28 -0
  1268. package/src/libs/agent-runtime/perplexity/index.test.ts +249 -0
  1269. package/src/libs/agent-runtime/perplexity/index.ts +31 -0
  1270. package/src/libs/agent-runtime/qwen/index.test.ts +251 -0
  1271. package/src/libs/agent-runtime/qwen/index.ts +28 -0
  1272. package/src/libs/agent-runtime/togetherai/__snapshots__/index.test.ts.snap +886 -0
  1273. package/src/libs/agent-runtime/togetherai/fixtures/models.json +8111 -0
  1274. package/src/libs/agent-runtime/togetherai/index.test.ts +313 -0
  1275. package/src/libs/agent-runtime/togetherai/index.ts +47 -0
  1276. package/src/libs/agent-runtime/togetherai/type.ts +75 -0
  1277. package/src/libs/agent-runtime/types/chat.ts +150 -0
  1278. package/src/libs/agent-runtime/types/index.ts +3 -0
  1279. package/src/libs/agent-runtime/types/textToImage.ts +34 -0
  1280. package/src/libs/agent-runtime/types/type.ts +44 -0
  1281. package/src/libs/agent-runtime/utils/anthropicHelpers.test.ts +233 -0
  1282. package/src/libs/agent-runtime/utils/anthropicHelpers.ts +120 -0
  1283. package/src/libs/agent-runtime/utils/createError.ts +11 -0
  1284. package/src/libs/agent-runtime/utils/debugStream.test.ts +70 -0
  1285. package/src/libs/agent-runtime/utils/debugStream.ts +48 -0
  1286. package/src/libs/agent-runtime/utils/desensitizeUrl.test.ts +47 -0
  1287. package/src/libs/agent-runtime/utils/desensitizeUrl.ts +34 -0
  1288. package/src/libs/agent-runtime/utils/handleOpenAIError.ts +39 -0
  1289. package/src/libs/agent-runtime/utils/openaiCompatibleFactory/index.test.ts +641 -0
  1290. package/src/libs/agent-runtime/utils/openaiCompatibleFactory/index.ts +294 -0
  1291. package/src/libs/agent-runtime/utils/response.ts +12 -0
  1292. package/src/libs/agent-runtime/utils/streams/anthropic.test.ts +197 -0
  1293. package/src/libs/agent-runtime/utils/streams/anthropic.ts +91 -0
  1294. package/src/libs/agent-runtime/utils/streams/bedrock/claude.ts +21 -0
  1295. package/src/libs/agent-runtime/utils/streams/bedrock/common.ts +32 -0
  1296. package/src/libs/agent-runtime/utils/streams/bedrock/index.ts +3 -0
  1297. package/src/libs/agent-runtime/utils/streams/bedrock/llama.test.ts +196 -0
  1298. package/src/libs/agent-runtime/utils/streams/bedrock/llama.ts +51 -0
  1299. package/src/libs/agent-runtime/utils/streams/google-ai.test.ts +97 -0
  1300. package/src/libs/agent-runtime/utils/streams/google-ai.ts +68 -0
  1301. package/src/libs/agent-runtime/utils/streams/index.ts +7 -0
  1302. package/src/libs/agent-runtime/utils/streams/minimax.ts +39 -0
  1303. package/src/libs/agent-runtime/utils/streams/ollama.test.ts +77 -0
  1304. package/src/libs/agent-runtime/utils/streams/ollama.ts +38 -0
  1305. package/src/libs/agent-runtime/utils/streams/openai.test.ts +263 -0
  1306. package/src/libs/agent-runtime/utils/streams/openai.ts +83 -0
  1307. package/src/libs/agent-runtime/utils/streams/protocol.ts +100 -0
  1308. package/src/libs/agent-runtime/utils/uriParser.test.ts +29 -0
  1309. package/src/libs/agent-runtime/utils/uriParser.ts +24 -0
  1310. package/src/libs/agent-runtime/zeroone/index.test.ts +299 -0
  1311. package/src/libs/agent-runtime/zeroone/index.ts +11 -0
  1312. package/src/libs/agent-runtime/zhipu/authToken.test.ts +18 -0
  1313. package/src/libs/agent-runtime/zhipu/authToken.ts +22 -0
  1314. package/src/libs/agent-runtime/zhipu/index.test.ts +322 -0
  1315. package/src/libs/agent-runtime/zhipu/index.ts +130 -0
  1316. package/src/libs/logger/index.ts +5 -0
  1317. package/src/libs/next-auth/index.ts +46 -0
  1318. package/src/libs/next-auth/sso-providers/auth0.ts +17 -0
  1319. package/src/libs/next-auth/sso-providers/authentik.ts +17 -0
  1320. package/src/libs/next-auth/sso-providers/azure-ad.ts +17 -0
  1321. package/src/libs/next-auth/sso-providers/github.ts +15 -0
  1322. package/src/libs/next-auth/sso-providers/index.ts +7 -0
  1323. package/src/libs/next-auth/sso-providers/zitadel.ts +16 -0
  1324. package/src/libs/swr/index.ts +74 -0
  1325. package/src/libs/traces/event.test.ts +158 -0
  1326. package/src/libs/traces/event.ts +133 -0
  1327. package/src/libs/traces/index.test.ts +61 -0
  1328. package/src/libs/traces/index.ts +52 -0
  1329. package/src/libs/trpc/client.ts +65 -0
  1330. package/src/libs/trpc/index.ts +42 -0
  1331. package/src/libs/trpc/init.ts +26 -0
  1332. package/src/libs/trpc/middleware/password.test.ts +88 -0
  1333. package/src/libs/trpc/middleware/password.ts +26 -0
  1334. package/src/libs/trpc/middleware/userAuth.test.ts +44 -0
  1335. package/src/libs/trpc/middleware/userAuth.ts +18 -0
  1336. package/src/locales/create.ts +51 -38
  1337. package/src/locales/default/auth.ts +8 -0
  1338. package/src/locales/default/chat.ts +139 -0
  1339. package/src/locales/default/clerk.ts +782 -0
  1340. package/src/locales/default/common.ts +214 -39
  1341. package/src/locales/default/components.ts +16 -0
  1342. package/src/locales/default/error.ts +127 -0
  1343. package/src/locales/default/index.ts +33 -0
  1344. package/src/locales/default/market.ts +32 -0
  1345. package/src/locales/default/metadata.ts +20 -0
  1346. package/src/locales/default/migration.ts +47 -0
  1347. package/src/locales/default/modelProvider.ts +111 -0
  1348. package/src/locales/default/plugin.ts +166 -0
  1349. package/src/locales/default/setting.ts +343 -32
  1350. package/src/locales/default/tool.ts +10 -0
  1351. package/src/locales/default/welcome.ts +50 -0
  1352. package/src/locales/resources.test.ts +49 -0
  1353. package/src/locales/resources.ts +114 -0
  1354. package/src/middleware.ts +47 -0
  1355. package/src/migrations/FromV0ToV1.ts +2 -4
  1356. package/src/migrations/FromV1ToV2/fixtures/input-v1-session.json +191 -0
  1357. package/src/migrations/FromV1ToV2/fixtures/output-v2.json +202 -0
  1358. package/src/migrations/FromV1ToV2/index.ts +82 -0
  1359. package/src/migrations/FromV1ToV2/migrations.test.ts +224 -0
  1360. package/src/migrations/FromV1ToV2/types/v1.ts +78 -0
  1361. package/src/migrations/FromV1ToV2/types/v2.ts +52 -0
  1362. package/src/migrations/FromV2ToV3/fixtures/input-v2-session.json +72 -0
  1363. package/src/migrations/FromV2ToV3/fixtures/output-v3-from-v1.json +203 -0
  1364. package/src/migrations/FromV2ToV3/fixtures/output-v3.json +74 -0
  1365. package/src/migrations/FromV2ToV3/index.ts +30 -0
  1366. package/src/migrations/FromV2ToV3/migrations.test.ts +42 -0
  1367. package/src/migrations/FromV2ToV3/types/v3.ts +27 -0
  1368. package/src/migrations/FromV3ToV4/fixtures/azure-input-v3.json +79 -0
  1369. package/src/migrations/FromV3ToV4/fixtures/azure-output-v4.json +75 -0
  1370. package/src/migrations/FromV3ToV4/fixtures/ollama-input-v3.json +85 -0
  1371. package/src/migrations/FromV3ToV4/fixtures/ollama-output-v4.json +85 -0
  1372. package/src/migrations/FromV3ToV4/fixtures/openai-input-v3.json +77 -0
  1373. package/src/migrations/FromV3ToV4/fixtures/openai-output-v4.json +77 -0
  1374. package/src/migrations/FromV3ToV4/fixtures/openrouter-input-v3.json +82 -0
  1375. package/src/migrations/FromV3ToV4/fixtures/openrouter-output-v4.json +85 -0
  1376. package/src/migrations/FromV3ToV4/fixtures/output-v4-from-v1.json +203 -0
  1377. package/src/migrations/FromV3ToV4/index.ts +102 -0
  1378. package/src/migrations/FromV3ToV4/migrations.test.ts +195 -0
  1379. package/src/migrations/FromV3ToV4/types/v3.ts +52 -0
  1380. package/src/migrations/FromV3ToV4/types/v4.ts +37 -0
  1381. package/src/migrations/FromV4ToV5/fixtures/from-v1-to-v5-output.json +245 -0
  1382. package/src/migrations/FromV4ToV5/fixtures/function-input-v4.json +96 -0
  1383. package/src/migrations/FromV4ToV5/fixtures/function-output-v5.json +120 -0
  1384. package/src/migrations/FromV4ToV5/index.ts +58 -0
  1385. package/src/migrations/FromV4ToV5/migrations.test.ts +49 -0
  1386. package/src/migrations/FromV4ToV5/types/v4.ts +21 -0
  1387. package/src/migrations/FromV4ToV5/types/v5.ts +27 -0
  1388. package/src/migrations/FromV5ToV6/fixtures/from-v1-to-v6-output.json +247 -0
  1389. package/src/migrations/FromV5ToV6/fixtures/session-input-v5.json +81 -0
  1390. package/src/migrations/FromV5ToV6/fixtures/session-output-v6.json +85 -0
  1391. package/src/migrations/FromV5ToV6/index.ts +61 -0
  1392. package/src/migrations/FromV5ToV6/migrations.test.ts +50 -0
  1393. package/src/migrations/FromV5ToV6/types/v5.ts +48 -0
  1394. package/src/migrations/FromV5ToV6/types/v6.ts +60 -0
  1395. package/src/migrations/FromV6ToV7/fixtures/output-v7-from-v1.json +203 -0
  1396. package/src/migrations/FromV6ToV7/fixtures/provider-input-v6.json +103 -0
  1397. package/src/migrations/FromV6ToV7/fixtures/provider-output-v7.json +118 -0
  1398. package/src/migrations/FromV6ToV7/index.ts +101 -0
  1399. package/src/migrations/FromV6ToV7/migrations.test.ts +64 -0
  1400. package/src/migrations/FromV6ToV7/types/v6.ts +61 -0
  1401. package/src/migrations/FromV6ToV7/types/v7.ts +71 -0
  1402. package/src/{utils → migrations}/VersionController.test.ts +1 -3
  1403. package/src/{utils → migrations}/VersionController.ts +6 -3
  1404. package/src/migrations/index.ts +55 -7
  1405. package/src/server/context.ts +51 -0
  1406. package/src/server/files/s3.ts +78 -0
  1407. package/src/server/globalConfig/index.ts +132 -0
  1408. package/src/server/globalConfig/parseDefaultAgent.test.ts +195 -0
  1409. package/src/server/globalConfig/parseDefaultAgent.ts +47 -0
  1410. package/src/server/globalConfig/parseSystemAgent.test.ts +95 -0
  1411. package/src/server/globalConfig/parseSystemAgent.ts +39 -0
  1412. package/src/server/keyVaultsEncrypt/index.test.ts +62 -0
  1413. package/src/server/keyVaultsEncrypt/index.ts +93 -0
  1414. package/src/server/ld.ts +218 -0
  1415. package/src/server/metadata.ts +96 -0
  1416. package/src/server/mock.ts +8 -0
  1417. package/src/server/routers/edge/config/__snapshots__/index.test.ts.snap +134 -0
  1418. package/src/server/routers/edge/config/index.test.ts +195 -0
  1419. package/src/server/routers/edge/config/index.ts +12 -0
  1420. package/src/server/routers/edge/index.ts +15 -0
  1421. package/src/server/routers/edge/upload.ts +16 -0
  1422. package/src/server/routers/lambda/file.ts +49 -0
  1423. package/src/server/routers/lambda/importer.ts +54 -0
  1424. package/src/server/routers/lambda/index.ts +28 -0
  1425. package/src/server/routers/lambda/message.ts +165 -0
  1426. package/src/server/routers/lambda/plugin.ts +100 -0
  1427. package/src/server/routers/lambda/session.ts +194 -0
  1428. package/src/server/routers/lambda/sessionGroup.ts +77 -0
  1429. package/src/server/routers/lambda/topic.ts +134 -0
  1430. package/src/server/routers/lambda/user.ts +57 -0
  1431. package/src/server/translation.ts +44 -0
  1432. package/src/services/__tests__/__snapshots__/chat.test.ts.snap +116 -0
  1433. package/src/services/__tests__/__snapshots__/tool.test.ts.snap +204 -0
  1434. package/src/services/__tests__/chat.test.ts +959 -0
  1435. package/src/services/__tests__/global.test.ts +100 -0
  1436. package/src/services/__tests__/ollama.test.ts +28 -0
  1437. package/src/services/__tests__/openai/OpenAPI_V3.json +245 -0
  1438. package/src/services/__tests__/openai/plugin.json +22 -0
  1439. package/src/services/__tests__/share.test.ts +131 -0
  1440. package/src/services/__tests__/sync.test.ts +56 -0
  1441. package/src/services/__tests__/tool.test.ts +268 -0
  1442. package/src/services/__tests__/upload.test.ts +72 -0
  1443. package/src/services/_auth.test.ts +175 -0
  1444. package/src/services/_auth.ts +75 -0
  1445. package/src/services/_header.ts +20 -0
  1446. package/src/services/_url.ts +46 -0
  1447. package/src/services/chat.ts +524 -0
  1448. package/src/services/config.ts +159 -0
  1449. package/src/services/debug.ts +40 -0
  1450. package/src/services/file/client.test.ts +160 -0
  1451. package/src/services/file/client.ts +65 -0
  1452. package/src/services/file/index.ts +6 -0
  1453. package/src/services/file/server.ts +45 -0
  1454. package/src/services/file/type.ts +9 -0
  1455. package/src/services/github.ts +42 -0
  1456. package/src/services/global.ts +29 -0
  1457. package/src/services/import/client.ts +74 -0
  1458. package/src/services/import/index.ts +6 -0
  1459. package/src/services/import/server.ts +115 -0
  1460. package/src/services/market.ts +22 -0
  1461. package/src/services/message/client.test.ts +349 -0
  1462. package/src/services/message/client.ts +83 -0
  1463. package/src/services/message/index.test.ts +48 -0
  1464. package/src/services/message/index.ts +8 -0
  1465. package/src/services/message/server.ts +93 -0
  1466. package/src/services/message/type.ts +46 -0
  1467. package/src/services/models.ts +37 -0
  1468. package/src/services/ollama.ts +83 -0
  1469. package/src/services/plugin/client.test.ts +162 -0
  1470. package/src/services/plugin/client.ts +42 -0
  1471. package/src/services/plugin/index.ts +6 -0
  1472. package/src/services/plugin/server.ts +46 -0
  1473. package/src/services/plugin/type.ts +21 -0
  1474. package/src/services/session/client.test.ts +439 -0
  1475. package/src/services/session/client.ts +180 -0
  1476. package/src/services/session/index.ts +6 -0
  1477. package/src/services/session/server.ts +148 -0
  1478. package/src/services/session/type.ts +65 -0
  1479. package/src/services/share.ts +61 -0
  1480. package/src/services/sync.ts +19 -0
  1481. package/src/services/textToImage.ts +36 -0
  1482. package/src/services/tool.ts +144 -0
  1483. package/src/services/topic/client.test.ts +245 -0
  1484. package/src/services/topic/client.ts +70 -0
  1485. package/src/services/topic/index.ts +6 -0
  1486. package/src/services/topic/server.ts +68 -0
  1487. package/src/services/topic/type.ts +34 -0
  1488. package/src/services/trace.ts +28 -0
  1489. package/src/services/upload.ts +99 -0
  1490. package/src/services/user/client.test.ts +102 -0
  1491. package/src/services/user/client.ts +52 -0
  1492. package/src/services/user/index.ts +6 -0
  1493. package/src/services/user/server.ts +28 -0
  1494. package/src/services/user/type.ts +11 -0
  1495. package/src/store/agent/index.ts +2 -0
  1496. package/src/store/agent/initialState.ts +7 -0
  1497. package/src/store/agent/selectors.ts +1 -0
  1498. package/src/store/agent/slices/chat/__snapshots__/selectors.test.ts.snap +30 -0
  1499. package/src/store/agent/slices/chat/action.test.ts +305 -0
  1500. package/src/store/agent/slices/chat/action.ts +176 -0
  1501. package/src/store/agent/slices/chat/index.ts +2 -0
  1502. package/src/store/agent/slices/chat/initialState.ts +20 -0
  1503. package/src/store/agent/slices/chat/selectors.test.ts +227 -0
  1504. package/src/store/agent/slices/chat/selectors.ts +98 -0
  1505. package/src/store/agent/store.ts +22 -0
  1506. package/src/store/chat/helpers.test.ts +109 -0
  1507. package/src/store/chat/helpers.ts +30 -0
  1508. package/src/store/chat/index.ts +3 -0
  1509. package/src/store/chat/initialState.ts +13 -0
  1510. package/src/store/chat/selectors.ts +3 -0
  1511. package/src/store/chat/slices/builtinTool/action.test.ts +104 -0
  1512. package/src/store/chat/slices/builtinTool/action.ts +101 -0
  1513. package/src/store/chat/slices/builtinTool/initialState.ts +7 -0
  1514. package/src/store/chat/slices/builtinTool/selectors.ts +11 -0
  1515. package/src/store/chat/slices/enchance/action.test.ts +126 -0
  1516. package/src/store/chat/slices/enchance/action.ts +124 -0
  1517. package/src/store/chat/slices/message/action.test.ts +1243 -0
  1518. package/src/store/chat/slices/message/action.ts +765 -0
  1519. package/src/store/chat/slices/message/initialState.ts +45 -0
  1520. package/src/store/chat/slices/message/reducer.test.ts +83 -0
  1521. package/src/store/chat/slices/message/reducer.ts +131 -0
  1522. package/src/store/chat/slices/message/selectors.test.ts +293 -0
  1523. package/src/store/chat/slices/message/selectors.ts +161 -0
  1524. package/src/store/chat/slices/message/utils.ts +7 -0
  1525. package/src/store/chat/slices/plugin/action.test.ts +660 -0
  1526. package/src/store/chat/slices/plugin/action.ts +304 -0
  1527. package/src/store/chat/slices/share/action.test.ts +213 -0
  1528. package/src/store/chat/slices/share/action.ts +122 -0
  1529. package/src/store/chat/slices/share/initialState.ts +7 -0
  1530. package/src/store/chat/slices/topic/action.test.ts +540 -0
  1531. package/src/store/chat/slices/topic/action.ts +330 -0
  1532. package/src/store/chat/slices/topic/initialState.ts +28 -0
  1533. package/src/store/chat/slices/topic/reducer.test.ts +139 -0
  1534. package/src/store/chat/slices/topic/reducer.ts +67 -0
  1535. package/src/store/chat/slices/topic/selectors.test.ts +95 -0
  1536. package/src/store/chat/slices/topic/selectors.ts +35 -0
  1537. package/src/store/chat/store.ts +44 -0
  1538. package/src/store/file/index.ts +2 -0
  1539. package/src/store/file/initialState.ts +7 -0
  1540. package/src/store/file/selectors.ts +7 -0
  1541. package/src/store/file/slices/images/action.test.ts +184 -0
  1542. package/src/store/file/slices/images/action.ts +153 -0
  1543. package/src/store/file/slices/images/initialState.ts +13 -0
  1544. package/src/store/file/slices/images/selectors.test.ts +78 -0
  1545. package/src/store/file/slices/images/selectors.ts +40 -0
  1546. package/src/store/file/slices/tts/action.test.ts +141 -0
  1547. package/src/store/file/slices/tts/action.ts +63 -0
  1548. package/src/store/file/slices/tts/index.ts +2 -0
  1549. package/src/store/file/slices/tts/selectors.ts +3 -0
  1550. package/src/store/file/store.ts +23 -0
  1551. package/src/store/global/action.test.ts +183 -0
  1552. package/src/store/global/action.ts +107 -0
  1553. package/src/store/global/index.ts +1 -0
  1554. package/src/store/global/initialState.ts +72 -0
  1555. package/src/store/global/selectors.ts +26 -0
  1556. package/src/store/global/store.ts +26 -0
  1557. package/src/store/market/action.ts +82 -0
  1558. package/src/store/market/index.ts +3 -0
  1559. package/src/store/market/initialState.ts +19 -0
  1560. package/src/store/market/selectors.ts +38 -0
  1561. package/src/store/market/store.ts +48 -0
  1562. package/src/store/middleware/createDevtools.ts +23 -0
  1563. package/src/store/middleware/createHyperStorage/index.test.ts +341 -0
  1564. package/src/store/middleware/createHyperStorage/index.ts +126 -0
  1565. package/src/store/middleware/createHyperStorage/indexedDB.test.ts +64 -0
  1566. package/src/store/middleware/createHyperStorage/indexedDB.ts +26 -0
  1567. package/src/store/middleware/createHyperStorage/keyMapper.ts +57 -0
  1568. package/src/store/middleware/createHyperStorage/localStorage.ts +18 -0
  1569. package/src/store/middleware/createHyperStorage/type.ts +25 -0
  1570. package/src/store/middleware/createHyperStorage/urlStorage.test.ts +84 -0
  1571. package/src/store/middleware/createHyperStorage/urlStorage.ts +81 -0
  1572. package/src/store/serverConfig/Provider.tsx +23 -0
  1573. package/src/store/serverConfig/index.ts +3 -0
  1574. package/src/store/serverConfig/selectors.test.ts +74 -0
  1575. package/src/store/serverConfig/selectors.ts +14 -0
  1576. package/src/store/serverConfig/store.test.ts +53 -0
  1577. package/src/store/serverConfig/store.ts +66 -0
  1578. package/src/store/session/helpers.ts +1 -0
  1579. package/src/store/session/index.ts +1 -32
  1580. package/src/store/session/initialState.ts +4 -6
  1581. package/src/store/session/selectors.ts +2 -3
  1582. package/src/store/session/slices/session/action.test.ts +232 -0
  1583. package/src/store/session/slices/session/action.ts +226 -70
  1584. package/src/store/session/slices/session/helpers.ts +17 -0
  1585. package/src/store/session/slices/session/initialState.ts +18 -19
  1586. package/src/store/session/slices/session/reducers.test.ts +79 -0
  1587. package/src/store/session/slices/session/reducers.ts +61 -0
  1588. package/src/store/session/slices/session/selectors/index.ts +2 -20
  1589. package/src/store/session/slices/session/selectors/list.test.ts +126 -0
  1590. package/src/store/session/slices/session/selectors/list.ts +45 -51
  1591. package/src/store/session/slices/session/selectors/meta.test.ts +108 -0
  1592. package/src/store/session/slices/session/selectors/meta.ts +45 -0
  1593. package/src/store/session/slices/sessionGroup/action.test.ts +133 -0
  1594. package/src/store/session/slices/sessionGroup/action.ts +73 -0
  1595. package/src/store/session/slices/sessionGroup/initialState.ts +12 -0
  1596. package/src/store/session/slices/sessionGroup/reducer.test.ts +86 -0
  1597. package/src/store/session/slices/sessionGroup/reducer.ts +56 -0
  1598. package/src/store/session/slices/sessionGroup/selectors.ts +11 -0
  1599. package/src/store/session/store.ts +25 -9
  1600. package/src/store/tool/helpers.ts +28 -0
  1601. package/src/store/tool/index.ts +2 -0
  1602. package/src/store/tool/initialState.ts +13 -0
  1603. package/src/store/tool/selectors/index.ts +5 -0
  1604. package/src/store/tool/selectors/tool.test.ts +233 -0
  1605. package/src/store/tool/selectors/tool.ts +110 -0
  1606. package/src/store/tool/slices/builtin/action.test.ts +90 -0
  1607. package/src/store/tool/slices/builtin/action.ts +54 -0
  1608. package/src/store/{session/slices/session → tool/slices/builtin}/index.ts +0 -1
  1609. package/src/store/tool/slices/builtin/initialState.ts +12 -0
  1610. package/src/store/tool/slices/builtin/selectors.test.ts +53 -0
  1611. package/src/store/tool/slices/builtin/selectors.ts +20 -0
  1612. package/src/store/tool/slices/customPlugin/action.test.ts +141 -0
  1613. package/src/store/tool/slices/customPlugin/action.ts +88 -0
  1614. package/src/store/{session/slices/chat → tool/slices/customPlugin}/index.ts +1 -1
  1615. package/src/store/tool/slices/customPlugin/initialState.ts +17 -0
  1616. package/src/store/tool/slices/customPlugin/reducers/customPluginList.ts +56 -0
  1617. package/src/store/tool/slices/customPlugin/selectors.test.ts +70 -0
  1618. package/src/store/tool/slices/customPlugin/selectors.ts +9 -0
  1619. package/src/store/tool/slices/plugin/__snapshots__/action.test.ts.snap +15 -0
  1620. package/src/store/tool/slices/plugin/action.test.ts +196 -0
  1621. package/src/store/tool/slices/plugin/action.ts +76 -0
  1622. package/src/store/tool/slices/plugin/index.ts +3 -0
  1623. package/src/store/tool/slices/plugin/initialState.ts +16 -0
  1624. package/src/store/tool/slices/plugin/reducers/manifest.ts +36 -0
  1625. package/src/store/tool/slices/plugin/selectors.test.ts +197 -0
  1626. package/src/store/tool/slices/plugin/selectors.ts +80 -0
  1627. package/src/store/tool/slices/store/action.test.ts +392 -0
  1628. package/src/store/tool/slices/store/action.ts +112 -0
  1629. package/src/store/tool/slices/store/index.ts +3 -0
  1630. package/src/store/tool/slices/store/initialState.ts +17 -0
  1631. package/src/store/tool/slices/store/selectors.test.ts +50 -0
  1632. package/src/store/tool/slices/store/selectors.ts +32 -0
  1633. package/src/store/tool/store.ts +32 -0
  1634. package/src/store/user/helpers.ts +9 -0
  1635. package/src/store/user/index.ts +1 -0
  1636. package/src/store/user/initialState.ts +22 -0
  1637. package/src/store/user/selectors.ts +13 -0
  1638. package/src/store/user/slices/auth/action.test.ts +202 -0
  1639. package/src/store/user/slices/auth/action.ts +63 -0
  1640. package/src/store/user/slices/auth/initialState.ts +28 -0
  1641. package/src/store/user/slices/auth/selectors.test.ts +143 -0
  1642. package/src/store/user/slices/auth/selectors.ts +48 -0
  1643. package/src/store/user/slices/common/action.test.ts +271 -0
  1644. package/src/store/user/slices/common/action.ts +129 -0
  1645. package/src/store/user/slices/common/initialState.ts +15 -0
  1646. package/src/store/user/slices/modelList/action.test.ts +363 -0
  1647. package/src/store/user/slices/modelList/action.ts +209 -0
  1648. package/src/store/user/slices/modelList/initialState.ts +15 -0
  1649. package/src/store/user/slices/modelList/reducers/customModelCard.test.ts +204 -0
  1650. package/src/store/user/slices/modelList/reducers/customModelCard.ts +64 -0
  1651. package/src/store/user/slices/modelList/selectors/index.ts +3 -0
  1652. package/src/store/user/slices/modelList/selectors/keyVaults.test.ts +201 -0
  1653. package/src/store/user/slices/modelList/selectors/keyVaults.ts +45 -0
  1654. package/src/store/user/slices/modelList/selectors/modelConfig.test.ts +179 -0
  1655. package/src/store/user/slices/modelList/selectors/modelConfig.ts +80 -0
  1656. package/src/store/user/slices/modelList/selectors/modelProvider.test.ts +145 -0
  1657. package/src/store/user/slices/modelList/selectors/modelProvider.ts +147 -0
  1658. package/src/store/user/slices/preference/action.test.ts +43 -0
  1659. package/src/store/user/slices/preference/action.ts +35 -0
  1660. package/src/store/user/slices/preference/initialState.ts +13 -0
  1661. package/src/store/user/slices/preference/selectors.test.ts +82 -0
  1662. package/src/store/user/slices/preference/selectors.ts +19 -0
  1663. package/src/store/user/slices/settings/action.test.ts +153 -0
  1664. package/src/store/user/slices/settings/action.ts +109 -0
  1665. package/src/store/user/slices/settings/initialState.ts +15 -0
  1666. package/src/store/user/slices/settings/selectors/__snapshots__/settings.test.ts.snap +109 -0
  1667. package/src/store/user/slices/settings/selectors/general.test.ts +45 -0
  1668. package/src/store/user/slices/settings/selectors/general.ts +40 -0
  1669. package/src/store/user/slices/settings/selectors/index.ts +3 -0
  1670. package/src/store/user/slices/settings/selectors/settings.test.ts +156 -0
  1671. package/src/store/user/slices/settings/selectors/settings.ts +52 -0
  1672. package/src/store/user/slices/settings/selectors/systemAgent.ts +16 -0
  1673. package/src/store/user/slices/sync/action.test.ts +164 -0
  1674. package/src/store/user/slices/sync/action.ts +97 -0
  1675. package/src/store/user/slices/sync/initialState.ts +13 -0
  1676. package/src/store/user/slices/sync/selectors.ts +20 -0
  1677. package/src/store/user/store.ts +42 -0
  1678. package/src/styles/antdOverride.ts +9 -20
  1679. package/src/styles/global.ts +39 -14
  1680. package/src/styles/index.ts +6 -1
  1681. package/src/styles/mobileHeader.ts +15 -0
  1682. package/src/tools/dalle/Render/Item/EditMode.tsx +66 -0
  1683. package/src/tools/dalle/Render/Item/Error.tsx +50 -0
  1684. package/src/tools/dalle/Render/Item/Image.tsx +44 -0
  1685. package/src/tools/dalle/Render/Item/ImageFileItem.tsx +77 -0
  1686. package/src/tools/dalle/Render/Item/index.tsx +88 -0
  1687. package/src/tools/dalle/Render/ToolBar.tsx +55 -0
  1688. package/src/tools/dalle/Render/index.tsx +51 -0
  1689. package/src/tools/dalle/index.ts +92 -0
  1690. package/src/tools/index.ts +11 -0
  1691. package/src/tools/renders.ts +14 -0
  1692. package/src/types/agent/index.ts +83 -0
  1693. package/src/types/exportConfig.ts +121 -14
  1694. package/src/types/fetch.ts +36 -0
  1695. package/src/types/files.ts +42 -0
  1696. package/src/types/i18next.d.ts +1 -1
  1697. package/src/types/importer.ts +128 -0
  1698. package/src/types/llm.ts +70 -12
  1699. package/src/types/locale.ts +4 -6
  1700. package/src/types/market.ts +20 -0
  1701. package/src/types/message/index.ts +82 -0
  1702. package/src/types/message/tools.ts +65 -0
  1703. package/src/types/message/translate.ts +4 -0
  1704. package/src/types/meta.ts +24 -12
  1705. package/src/types/next-auth.d.ts +23 -0
  1706. package/src/types/openai/chat.ts +128 -0
  1707. package/src/types/openai/functionCall.ts +10 -0
  1708. package/src/types/openai/image.ts +34 -0
  1709. package/src/types/openai/plugin.ts +57 -0
  1710. package/src/types/serverConfig.ts +32 -0
  1711. package/src/types/service.ts +7 -0
  1712. package/src/types/session/agentSession.ts +35 -0
  1713. package/src/types/session/index.ts +10 -0
  1714. package/src/types/session/sessionGroup.ts +24 -0
  1715. package/src/types/share.ts +7 -0
  1716. package/src/types/sync.ts +41 -0
  1717. package/src/types/tool/builtin.ts +36 -0
  1718. package/src/types/tool/dalle.ts +12 -0
  1719. package/src/types/tool/index.ts +16 -0
  1720. package/src/types/tool/plugin.ts +35 -0
  1721. package/src/types/tool/tool.ts +10 -0
  1722. package/src/types/topic.ts +9 -0
  1723. package/src/types/trace/action.ts +31 -0
  1724. package/src/types/trace/index.ts +1 -0
  1725. package/src/types/user/index.ts +44 -0
  1726. package/src/types/user/settings/general.ts +12 -0
  1727. package/src/types/user/settings/index.ts +32 -0
  1728. package/src/types/user/settings/keyVaults.ts +37 -0
  1729. package/src/types/user/settings/modelProvider.ts +34 -0
  1730. package/src/types/user/settings/sync.ts +10 -0
  1731. package/src/types/user/settings/systemAgent.ts +9 -0
  1732. package/src/types/user/settings/tool.ts +5 -0
  1733. package/src/types/user/settings/tts.ts +10 -0
  1734. package/src/utils/__snapshots__/parseModels.test.ts.snap +63 -0
  1735. package/src/utils/basePath.ts +3 -0
  1736. package/src/utils/client/switchLang.test.ts +34 -0
  1737. package/src/utils/client/switchLang.ts +10 -0
  1738. package/src/utils/compass.ts +1 -5
  1739. package/src/utils/compressImage.test.ts +59 -0
  1740. package/src/utils/compressImage.ts +29 -0
  1741. package/src/utils/config.ts +108 -0
  1742. package/src/utils/cookie.ts +10 -0
  1743. package/src/utils/difference.test.ts +46 -0
  1744. package/src/utils/difference.ts +26 -0
  1745. package/src/utils/env.ts +3 -0
  1746. package/src/utils/fetch.test.ts +534 -0
  1747. package/src/utils/fetch.ts +371 -105
  1748. package/src/utils/filter.ts +1 -1
  1749. package/src/utils/genOG.ts +20 -0
  1750. package/src/utils/imageToBase64.ts +37 -0
  1751. package/src/utils/jwt.test.ts +27 -0
  1752. package/src/utils/jwt.ts +37 -0
  1753. package/src/utils/keyboard.ts +13 -0
  1754. package/src/utils/localStorage.ts +38 -0
  1755. package/src/utils/locale.ts +16 -0
  1756. package/src/utils/merge.ts +11 -0
  1757. package/src/utils/parseMarkdown.ts +9 -0
  1758. package/src/utils/parseModels.test.ts +290 -0
  1759. package/src/utils/parseModels.ts +156 -0
  1760. package/src/utils/platform.test.ts +83 -0
  1761. package/src/utils/platform.ts +55 -0
  1762. package/src/utils/responsive.ts +40 -0
  1763. package/src/utils/speed.ts +32 -0
  1764. package/src/utils/storeDebug.ts +11 -0
  1765. package/src/utils/tokenizer.ts +5 -0
  1766. package/src/utils/toolCall.ts +21 -0
  1767. package/src/utils/trace.ts +21 -0
  1768. package/src/utils/url.test.ts +51 -0
  1769. package/src/utils/url.ts +23 -0
  1770. package/src/utils/uuid.ts +4 -4
  1771. package/src/utils/zustand.ts +8 -0
  1772. package/tests/setup-db.ts +7 -0
  1773. package/tests/setup.ts +35 -0
  1774. package/tests/utils.tsx +11 -0
  1775. package/tsconfig.json +24 -4
  1776. package/vercel.json +3 -0
  1777. package/vitest.config.ts +27 -3
  1778. package/vitest.server.config.ts +23 -0
  1779. package/.github/ISSUE_TEMPLATE/3_question.yml +0 -15
  1780. package/.github/ISSUE_TEMPLATE/4_other.md +0 -7
  1781. package/.github/dependabot.yml +0 -17
  1782. package/.github/workflows/auto-merge.yml +0 -32
  1783. package/.github/workflows/contributor-help.yml +0 -29
  1784. package/.github/workflows/issue-check-inactive.yml +0 -22
  1785. package/.github/workflows/issue-remove-inactive.yml +0 -25
  1786. package/.gitpod.yml +0 -3
  1787. package/.husky/commit-msg +0 -4
  1788. package/locales/en_US/common.json +0 -40
  1789. package/locales/en_US/setting.json +0 -97
  1790. package/locales/zh_CN/common.json +0 -40
  1791. package/locales/zh_CN/setting.json +0 -98
  1792. package/public/next.svg +0 -1
  1793. package/public/vercel.svg +0 -1
  1794. package/scripts/genDefaultLocale.mjs +0 -12
  1795. package/scripts/toc.mjs +0 -40
  1796. package/src/const/modelTokens.ts +0 -8
  1797. package/src/features/FolderPanel/index.tsx +0 -55
  1798. package/src/helpers/prompt.test.ts +0 -36
  1799. package/src/helpers/prompt.ts +0 -36
  1800. package/src/layout/index.tsx +0 -42
  1801. package/src/layout/style.ts +0 -18
  1802. package/src/locales/index.ts +0 -5
  1803. package/src/locales/resources/en_US.ts +0 -9
  1804. package/src/locales/resources/index.ts +0 -7
  1805. package/src/locales/resources/zh_CN.ts +0 -9
  1806. package/src/pages/Sidebar.tsx +0 -36
  1807. package/src/pages/_app.page.tsx +0 -13
  1808. package/src/pages/_document.page.tsx +0 -70
  1809. package/src/pages/api/LangChainStream.ts +0 -95
  1810. package/src/pages/api/chain.api.ts +0 -17
  1811. package/src/pages/api/openai.api.ts +0 -31
  1812. package/src/pages/chat/SessionList/Header.tsx +0 -56
  1813. package/src/pages/chat/SessionList/List/SessionItem.tsx +0 -90
  1814. package/src/pages/chat/SessionList/List/index.tsx +0 -31
  1815. package/src/pages/chat/SessionList/List/style.ts +0 -77
  1816. package/src/pages/chat/SessionList/index.tsx +0 -18
  1817. package/src/pages/chat/[id]/Config/ConfigCell.tsx +0 -68
  1818. package/src/pages/chat/[id]/Config/ReadMode.tsx +0 -63
  1819. package/src/pages/chat/[id]/Config/index.tsx +0 -79
  1820. package/src/pages/chat/[id]/Conversation/ChatList.tsx +0 -36
  1821. package/src/pages/chat/[id]/Conversation/Input.tsx +0 -61
  1822. package/src/pages/chat/[id]/Conversation/index.tsx +0 -32
  1823. package/src/pages/chat/[id]/Header.tsx +0 -86
  1824. package/src/pages/chat/[id]/edit/AgentConfig.tsx +0 -95
  1825. package/src/pages/chat/[id]/edit/AgentMeta.tsx +0 -117
  1826. package/src/pages/chat/[id]/edit/FormItem.tsx +0 -26
  1827. package/src/pages/chat/[id]/edit/Prompt.tsx +0 -68
  1828. package/src/pages/chat/[id]/edit/index.page.tsx +0 -62
  1829. package/src/pages/chat/[id]/edit/style.ts +0 -42
  1830. package/src/pages/chat/[id]/index.page.tsx +0 -40
  1831. package/src/pages/chat/index.page.tsx +0 -1
  1832. package/src/pages/chat/layout.tsx +0 -51
  1833. package/src/pages/index.page.tsx +0 -1
  1834. package/src/pages/setting/Header.tsx +0 -27
  1835. package/src/pages/setting/SettingForm.tsx +0 -42
  1836. package/src/pages/setting/index.page.tsx +0 -41
  1837. package/src/prompts/agent.ts +0 -65
  1838. package/src/services/chatModel.ts +0 -34
  1839. package/src/services/langChain.ts +0 -18
  1840. package/src/services/url.ts +0 -8
  1841. package/src/store/middleware/createHashStorage.ts +0 -49
  1842. package/src/store/session/slices/agentConfig/action.ts +0 -226
  1843. package/src/store/session/slices/agentConfig/initialState.ts +0 -34
  1844. package/src/store/session/slices/agentConfig/selectors.ts +0 -54
  1845. package/src/store/session/slices/chat/action.ts +0 -210
  1846. package/src/store/session/slices/chat/initialState.ts +0 -12
  1847. package/src/store/session/slices/chat/messageReducer.test.ts +0 -70
  1848. package/src/store/session/slices/chat/messageReducer.ts +0 -84
  1849. package/src/store/session/slices/chat/selectors.ts +0 -83
  1850. package/src/store/session/slices/session/reducers/session.test.ts +0 -456
  1851. package/src/store/session/slices/session/reducers/session.ts +0 -113
  1852. package/src/store/session/slices/session/selectors/chat.ts +0 -4
  1853. package/src/store/settings/action.ts +0 -31
  1854. package/src/store/settings/index.ts +0 -23
  1855. package/src/store/settings/initialState.ts +0 -25
  1856. package/src/store/settings/selectors.ts +0 -9
  1857. package/src/store/settings/store.ts +0 -13
  1858. package/src/types/chatMessage.ts +0 -46
  1859. package/src/types/langchain.ts +0 -34
  1860. package/src/types/openai.ts +0 -62
  1861. package/src/types/session.ts +0 -59
  1862. /package/src/store/{session/slices/agentConfig → file/slices/images}/index.ts +0 -0
@@ -0,0 +1,40 @@
1
+ # Directory Structure
2
+
3
+ The directory structure of LobeChat is as follows:
4
+
5
+ ```bash
6
+ src
7
+ ├── app # Main logic and state management related code for the application
8
+ ├── components # Reusable UI components
9
+ ├── config # Application configuration files, including client-side and server-side environment variables
10
+ ├── const # Used to define constants, such as action types, route names, etc.
11
+ ├── features # Function modules related to business functions, such as agent settings, plugin development pop-ups, etc.
12
+ ├── hooks # Custom utility hooks reused throughout the application
13
+ ├── layout # Application layout components, such as navigation bars, sidebars, etc.
14
+ ├── locales # Internationalization language files
15
+ ├── services # Encapsulated backend service interfaces, such as HTTP requests
16
+ ├── store # Zustand store for state management
17
+ ├── types # TypeScript type definition files
18
+ └── utils # Common utility functions
19
+ ```
20
+
21
+ ## app
22
+
23
+ In the `app` folder, we organize each route page according to the app router's [Route Groups](https://nextjs.org/docs/app/building-your-application/routing/route-groups) to separately handle the implementation of desktop and mobile code. Taking the file structure of the `welcome` page as an example:
24
+
25
+ ```bash
26
+ welcome
27
+ ├── (desktop) # Desktop implementation
28
+ │ ├── features # Desktop-specific features
29
+ │ ├── index.tsx # Main entry file for desktop
30
+ │ └── layout.desktop.tsx # Desktop layout component
31
+ ├── (mobile) # Mobile implementation
32
+ │ ├── features # Mobile-specific features
33
+ │ ├── index.tsx # Main entry file for mobile
34
+ │ └── layout.mobile.tsx # Mobile layout component
35
+ ├── features # This folder contains features code shared by both desktop and mobile, such as the Banner component
36
+ │ └── Banner
37
+ └── page.tsx # This is the main entry file for the page, used to load desktop or mobile code based on the device type
38
+ ```
39
+
40
+ In this way, we can clearly distinguish and manage desktop and mobile code, while also easily reusing code required on both devices, thereby improving development efficiency and maintaining code cleanliness and maintainability.
@@ -0,0 +1,40 @@
1
+ # 目录架构
2
+
3
+ LobeChat 的文件夹目录架构如下:
4
+
5
+ ```bash
6
+ src
7
+ ├── app # 应用主要逻辑和状态管理相关的代码
8
+ ├── components # 可复用的 UI 组件
9
+ ├── config # 应用的配置文件,包含客户端环境变量与服务端环境变量
10
+ ├── const # 用于定义常量,如 action 类型、路由名等
11
+ ├── features # 与业务功能相关的功能模块,如 Agent 设置、插件开发弹窗等
12
+ ├── hooks # 全应用复用自定义的工具 Hooks
13
+ ├── layout # 应用的布局组件,如导航栏、侧边栏等
14
+ ├── locales # 国际化的语言文件
15
+ ├── services # 封装的后端服务接口,如 HTTP 请求
16
+ ├── store # 用于状态管理的 zustand store
17
+ ├── types # TypeScript 的类型定义文件
18
+ └── utils # 通用的工具函数
19
+ ```
20
+
21
+ ## app
22
+
23
+ 在 `app` 文件夹中,我们将每个路由页面按照 app router 的 [Route Groups](https://nextjs.org/docs/app/building-your-application/routing/route-groups) 进行组织,以此来分别处理桌面端和移动端的代码实现。以 `welcome` 页面的文件结构为例:
24
+
25
+ ```bash
26
+ welcome
27
+ ├── (desktop) # 桌面端实现
28
+ │ ├── features # 桌面端特有的功能
29
+ │ ├── index.tsx # 桌面端的主入口文件
30
+ │ └── layout.desktop.tsx # 桌面端的布局组件
31
+ ├── (mobile) # 移动端实现
32
+ │ ├── features # 移动端特有的功能
33
+ │ ├── index.tsx # 移动端的主入口文件
34
+ │ └── layout.mobile.tsx # 移动端的布局组件
35
+ ├── features # 此文件夹包含双端共享的特性代码,如 Banner 组件
36
+ │ └── Banner
37
+ └── page.tsx # 此为页面的主入口文件,用于根据设备类型选择加载桌面端或移动端的代码
38
+ ```
39
+
40
+ 通过这种方式,我们可以清晰地区分和管理桌面端和移动端的代码,同时也能方便地复用在两种设备上都需要的代码,从而提高开发效率并保持代码的整洁和可维护性。
@@ -0,0 +1,111 @@
1
+ # Technical Development Getting Started Guide
2
+
3
+ Welcome to the LobeChat Technical Development Getting Started Guide. LobeChat is an AI conversation application built on the Next.js framework, incorporating a range of technology stacks to achieve diverse functionalities and features. This guide will detail the main technical components of LobeChat and how to configure and use these technologies in your development environment.
4
+
5
+ #### TOC
6
+
7
+ - [Basic Technology Stack](#basic-technology-stack)
8
+ - [Folder Directory Structure](#folder-directory-structure)
9
+ - [Local Development Environment Setup](#local-development-environment-setup)
10
+ - [Code Style and Contribution Guide](#code-style-and-contribution-guide)
11
+ - [Internationalization Implementation Guide](#internationalization-implementation-guide)
12
+ - [Appendix: Resources and References](#appendix-resources-and-references)
13
+
14
+ ## Basic Technology Stack
15
+
16
+ The core technology stack of LobeChat is as follows:
17
+
18
+ - **Framework**: We chose [Next.js](https://nextjs.org/), a powerful React framework that provides key features such as server-side rendering, routing framework, and Router Handler.
19
+ - **Component Library**: We use [Ant Design (antd)](https://ant.design/) as the basic component library, along with [lobe-ui](https://github.com/lobehub/lobe-ui) as our business component library.
20
+ - **State Management**: We selected [zustand](https://github.com/pmndrs/zustand), a lightweight and easy-to-use state management library.
21
+ - **Network Requests**: We use [swr](https://swr.vercel.app/), a React Hooks library for data fetching.
22
+ - **Routing**: For routing management, we directly use the solution provided by [Next.js](https://nextjs.org/).
23
+ - **Internationalization**: We use [i18next](https://www.i18next.com/) to support multiple languages in the application.
24
+ - **Styling**: We use [antd-style](https://github.com/ant-design/antd-style), a CSS-in-JS library that complements Ant Design.
25
+ - **Unit Testing**: We use [vitest](https://github.com/vitest-dev/vitest) for unit testing.
26
+
27
+ ## Folder Directory Structure
28
+
29
+ The folder directory structure of LobeChat is as follows:
30
+
31
+ ```bash
32
+ src
33
+ ├── app # Code related to the main logic and state management of the application
34
+ ├── components # Reusable UI components
35
+ ├── config # Application configuration files, including client and server environment variables
36
+ ├── const # Used to define constants, such as action types, route names, etc.
37
+ ├── features # Business-related feature modules, such as Agent settings, plugin development pop-ups, etc.
38
+ ├── hooks # Custom utility Hooks reusable across the application
39
+ ├── layout # Application layout components, such as navigation bars, sidebars, etc.
40
+ ├── locales # Language files for internationalization
41
+ ├── services # Encapsulated backend service interfaces, such as HTTP requests
42
+ ├── store # Zustand store for state management
43
+ ├── types # TypeScript type definition files
44
+ └── utils # General utility functions
45
+ ```
46
+
47
+ For a detailed introduction to the directory structure, see: [Folder Directory Structure](Folder-Structure.zh-CN.md)
48
+
49
+ ## Local Development Environment Setup
50
+
51
+ This section outlines setting up the development environment and local development. Before starting, please ensure that Node.js, Git, and your chosen package manager (Bun or PNPM) are installed in your local environment.
52
+
53
+ We recommend using WebStorm as your integrated development environment (IDE).
54
+
55
+ 1. **Get the code**: Clone the LobeChat code repository locally:
56
+
57
+ ```bash
58
+ git clone https://github.com/lobehub/lobe-chat.git
59
+ ```
60
+
61
+ 2. **Install dependencies**: Enter the project directory and install the required dependencies:
62
+
63
+ ```bash
64
+ cd lobe-chat
65
+ # If you use Bun
66
+ bun install
67
+ # If you use PNPM
68
+ pnpm install
69
+ ```
70
+
71
+ 3. **Run and debug**: Start the local development server and begin your development journey:
72
+
73
+ ```bash
74
+ # Start the development server with Bun
75
+ bun run dev
76
+ # Visit http://localhost:3010 to view the application
77
+ ```
78
+
79
+ > \[!IMPORTANT]\
80
+ > If you encounter the error "Could not find 'stylelint-config-recommended'" when installing dependencies with `npm`, please reinstall the dependencies using `pnpm` or `bun`.
81
+
82
+ Now, you should be able to see the welcome page of LobeChat in your browser. For a detailed environment setup guide, please refer to [Development Environment Setup Guide](Setup-Development.zh-CN.md).
83
+
84
+ ## Code Style and Contribution Guide
85
+
86
+ In the LobeChat project, we place great emphasis on the quality and consistency of the code. For this reason, we have established a series of code style standards and contribution processes to ensure that every developer can smoothly participate in the project. Here are the code style and contribution guidelines you need to follow as a developer.
87
+
88
+ - **Code Style**: We use `@lobehub/lint` to unify the code style, including ESLint, Prettier, remarklint, and stylelint configurations. Please adhere to our code standards to maintain code consistency and readability.
89
+ - **Contribution Process**: We use gitmoji and semantic release for code submission and release processes. Please use gitmoji to annotate your commit messages and ensure compliance with the semantic release standards so that our automation systems can correctly handle version control and releases.
90
+
91
+ All contributions will undergo code review. Maintainers may suggest modifications or requirements. Please respond actively to review comments and make timely adjustments. We look forward to your participation and contribution.
92
+
93
+ For detailed code style and contribution guidelines, please refer to [Code Style and Contribution Guide](Contributing-Guidelines.zh-CN.md).
94
+
95
+ ## Internationalization Implementation Guide
96
+
97
+ LobeChat uses `i18next` and `lobe-i18n` to implement multilingual support, ensuring a global user experience.
98
+
99
+ Internationalization files are located in `src/locales`, containing the default language (Chinese). We generate other language JSON files automatically through `lobe-i18n`.
100
+
101
+ If you want to add a new language, follow specific steps detailed in [New Language Addition Guide](../Internationalization/Add-New-Locale.zh-CN.md). We encourage you to participate in our internationalization efforts to provide better services to global users.
102
+
103
+ For a detailed guide on internationalization implementation, please refer to [Internationalization Implementation Guide](../Internationalization/Internationalization-Implementation.zh-CN.md).
104
+
105
+ ## Appendix: Resources and References
106
+
107
+ To support developers in better understanding and using the technology stack of LobeChat, we provide a comprehensive list of resources and references — [LobeChat Resources and References](https://github.com/lobehub/lobe-chat/wiki/Resources.zh-CN) - Visit our maintained list of resources, including tutorials, articles, and other useful links.
108
+
109
+ We encourage developers to utilize these resources to deepen their learning and enhance their skills, join community discussions through [LobeChat GitHub Discussions](https://github.com/lobehub/lobe-chat/discussions) or [Discord](https://discord.com/invite/AYFPHvv2jT), ask questions, or share your experiences.
110
+
111
+ If you have any questions or need further assistance, please do not hesitate to contact us through the above channels.
@@ -0,0 +1,111 @@
1
+ # 技术开发上手指南
2
+
3
+ 欢迎来到 LobeChat 技术开发上手指南。LobeChat 是一款基于 Next.js 框架构建的 AI 会话应用,它汇集了一系列的技术栈,以实现多样化的功能和特性。本指南将详细介绍 LobeChat 的主要技术组成,以及如何在你的开发环境中配置和使用这些技术。
4
+
5
+ #### TOC
6
+
7
+ - [基础技术栈](#基础技术栈)
8
+ - [文件夹目录架构](#文件夹目录架构)
9
+ - [本地开发环境设置](#本地开发环境设置)
10
+ - [代码风格与贡献指南](#代码风格与贡献指南)
11
+ - [国际化实现指南](#国际化实现指南)
12
+ - [附录:资源与参考](#附录资源与参考)
13
+
14
+ ## 基础技术栈
15
+
16
+ LobeChat 的核心技术栈如下:
17
+
18
+ - **框架**:我们选择了 [Next.js](https://nextjs.org/),这是一款强大的 React 框架,为我们的项目提供了服务端渲染、路由框架、Router Handler 等关键功能。
19
+ - **组件库**:我们使用了 [Ant Design (antd)](https://ant.design/) 作为基础组件库,同时引入了 [lobe-ui](https://github.com/lobehub/lobe-ui) 作为我们的业务组件库。
20
+ - **状态管理**:我们选用了 [zustand](https://github.com/pmndrs/zustand),一款轻量级且易于使用的状态管理库。
21
+ - **网络请求**:我们采用 [swr](https://swr.vercel.app/),这是一款用于数据获取的 React Hooks 库。
22
+ - **路由**:路由管理我们直接使用 [Next.js](https://nextjs.org/) 自身提供的解决方案。
23
+ - **国际化**:我们使用 [i18next](https://www.i18next.com/) 来实现应用的多语言支持。
24
+ - **样式**:我们使用 [antd-style](https://github.com/ant-design/antd-style),这是一款与 Ant Design 配套的 CSS-in-JS 库。
25
+ - **单元测试**:我们使用 [vitest](https://github.com/vitest-dev/vitest) 进行单元测试。
26
+
27
+ ## 文件夹目录架构
28
+
29
+ LobeChat 的文件夹目录架构如下:
30
+
31
+ ```bash
32
+ src
33
+ ├── app # 应用主要逻辑和状态管理相关的代码
34
+ ├── components # 可复用的 UI 组件
35
+ ├── config # 应用的配置文件,包含客户端环境变量与服务端环境变量
36
+ ├── const # 用于定义常量,如 action 类型、路由名等
37
+ ├── features # 与业务功能相关的功能模块,如 Agent 设置、插件开发弹窗等
38
+ ├── hooks # 全应用复用自定义的工具 Hooks
39
+ ├── layout # 应用的布局组件,如导航栏、侧边栏等
40
+ ├── locales # 国际化的语言文件
41
+ ├── services # 封装的后端服务接口,如 HTTP 请求
42
+ ├── store # 用于状态管理的 zustand store
43
+ ├── types # TypeScript 的类型定义文件
44
+ └── utils # 通用的工具函数
45
+ ```
46
+
47
+ 有关目录架构的详细介绍,详见: [文件夹目录架构](Folder-Structure.zh-CN.md)
48
+
49
+ ## 本地开发环境设置
50
+
51
+ 本节将概述搭建开发环境并进行本地开发。 在开始之前,请确保你的本地环境中已安装 Node.js、Git 以及你选择的包管理器(Bun 或 PNPM)。
52
+
53
+ 我们推荐使用 WebStorm 作为你的集成开发环境(IDE)。
54
+
55
+ 1. **获取代码**:克隆 LobeChat 的代码库到本地:
56
+
57
+ ```bash
58
+ git clone https://github.com/lobehub/lobe-chat.git
59
+ ```
60
+
61
+ 2. **安装依赖**:进入项目目录,并安装所需依赖:
62
+
63
+ ```bash
64
+ cd lobe-chat
65
+ # 如果你使用 Bun
66
+ bun install
67
+ # 如果你使用 PNPM
68
+ pnpm install
69
+ ```
70
+
71
+ 3. **运行与调试**:启动本地开发服务器,开始你的开发之旅:
72
+
73
+ ```bash
74
+ # 使用 Bun 启动开发服务器
75
+ bun run dev
76
+ # 访问 http://localhost:3010 查看应用
77
+ ```
78
+
79
+ > \[!IMPORTANT]\
80
+ > 如果使用`npm`安装依赖出现`Could not find "stylelint-config-recommended"`错误,请使用 `pnpm` 或者 `bun` 重新安装依赖。
81
+
82
+ 现在,你应该可以在浏览器中看到 LobeChat 的欢迎页面。详细的环境配置指南,请参考 [开发环境设置指南](Setup-Development.zh-CN.md)。
83
+
84
+ ## 代码风格与贡献指南
85
+
86
+ 在 LobeChat 项目中,我们十分重视代码的质量和一致性。为此,我们制定了一系列的代码风格规范和贡献流程,以确保每位开发者都能顺利地参与到项目中。以下是你作为开发者需要遵守的代码风格和贡献准则。
87
+
88
+ - **代码风格**:我们使用 `@lobehub/lint` 统一代码风格,包括 ESLint、Prettier、remarklint 和 stylelint 配置。请遵守我们的代码规范,以保持代码的一致性和可读性。
89
+ - **贡献流程**:我们采用 gitmoji 和 semantic release 作为代码提交和发布流程。请使用 gitmoji 标注您的提交信息,并确保遵循 semantic release 的规范,以便我们的自动化系统能够正确处理版本控制和发布。
90
+
91
+ 所有的贡献都将经过代码审查。维护者可能会提出修改建议或要求。请积极响应审查意见,并及时做出调整,我们期待你的参与和贡献。
92
+
93
+ 详细的代码风格和贡献指南,请参考 [代码风格与贡献指南](Contributing-Guidelines.zh-CN.md)。
94
+
95
+ ## 国际化实现指南
96
+
97
+ LobeChat 采用 `i18next` 和 `lobe-i18n` 实现多语言支持,确保用户全球化体验。
98
+
99
+ 国际化文件位于 `src/locales`,包含默认语言(中文)。 我们会通过 `lobe-i18n` 自动生成其他的语言 JSON 文件。
100
+
101
+ 如果要添加新语种,需遵循特定步骤,详见 [新语种添加指南](../Internationalization/Add-New-Locale.zh-CN.md)。 我们鼓励你参与我们的国际化努力,共同为全球用户提供更好的服务。
102
+
103
+ 详细的国际化实现指南指南,请参考 [国际化实现指南](../Internationalization/Internationalization-Implementation.zh-CN.md)。
104
+
105
+ ## 附录:资源与参考
106
+
107
+ 为了支持开发者更好地理解和使用 LobeChat 的技术栈,我们提供了一份详尽的资源与参考列表 —— [LobeChat 资源与参考](https://github.com/lobehub/lobe-chat/wiki/Resources.zh-CN) - 访问我们维护的资源列表,包括教程、文章和其他有用的链接。
108
+
109
+ 我们鼓励开发者利用这些资源深入学习和提升技能,通过 [LobeChat GitHub Discussions](https://github.com/lobehub/lobe-chat/discussions) 或者 [Discord](https://discord.com/invite/AYFPHvv2jT) 加入社区讨论,提出问题或分享你的经验。
110
+
111
+ 如果你有任何疑问,或者需要进一步的帮助,请不要犹豫,请通过上述渠道与我们联系。
@@ -0,0 +1,19 @@
1
+ # Resources and References
2
+
3
+ The design and development of LobeChat would not have been possible without the excellent projects in the community and ecosystem. We have used or referred to some outstanding resources and guides in the design and development process. Here are some key reference resources for developers to refer to during the development and learning process:
4
+
5
+ 1. **OpenAI API Guide**: We use OpenAI's API to access and process AI conversation data. You can check out the [OpenAI API Guide](https://platform.openai.com/docs/api-reference/introduction) for more details.
6
+
7
+ 2. **OpenAI SDK**: We use OpenAI's Node.js SDK to interact with OpenAI's API. You can view the source code and documentation on the [OpenAI SDK](https://github.com/openai/openai-node) GitHub repository.
8
+
9
+ 3. **AI SDK**: We use Vercel's AI SDK to access and process AI conversation data. You can refer to the documentation of [AI SDK](https://sdk.vercel.ai/docs) for more details.
10
+
11
+ 4. **LangChain**: Our early conversation feature was implemented based on LangChain. You can visit [LangChain](https://langchain.com) to learn more about it.
12
+
13
+ 5. **Chat-Next-Web**: Chat Next Web is an excellent project, and some of LobeChat's features and workflows are referenced from its implementation. You can view the source code and documentation on the [Chat-Next-Web](https://github.com/Yidadaa/ChatGPT-Next-Web) GitHub repository.
14
+
15
+ 6. **Next.js Documentation**: Our project is built on Next.js, and you can refer to the [Next.js Documentation](https://nextjs.org/docs) for more information about Next.js.
16
+
17
+ 7. **FlowGPT**: FlowGPT is currently the world's largest Prompt community, and some of the agents in LobeChat come from active authors in FlowGPT. You can visit [FlowGPT](https://flowgpt.com/) to learn more about it.
18
+
19
+ We will continue to update and supplement this list to provide developers with more reference resources.
@@ -0,0 +1,19 @@
1
+ # 资源与参考
2
+
3
+ LobeChat 的设计和开发离不开社区和生态中的优秀项目。我们在设计和开发过程中使用或参考了一些优秀的资源和指南。以下是一些主要的参考资源,供开发者在开发和学习过程中参考:
4
+
5
+ 1. **OpenAI API 指南**:我们使用 OpenAI 的 API 来获取和处理 AI 的会话数据。你可以查看 [OpenAI API 指南](https://platform.openai.com/docs/api-reference/introduction) 了解更多详情。
6
+
7
+ 2. **OpenAI SDK**:我们使用 OpenAI 的 Node.js SDK 来与 OpenAI 的 API 交互。你可以在 [OpenAI SDK](https://github.com/openai/openai-node) 的 GitHub 仓库中查看源码和文档。
8
+
9
+ 3. **AI SDK**:我们使用 Vercel 的 AI SDK 来获取和处理 AI 的会话数据。你可以查看 [AI SDK](https://sdk.vercel.ai/docs) 的文档来了解更多详情。
10
+
11
+ 4. **LangChain**:我们早期的会话功能是基于 LangChain 实现的。你可以访问 [LangChain](https://langchain.com) 来了解更多关于它的信息。
12
+
13
+ 5. **Chat-Next-Web**:Chat Next Web 是一个优秀的项目,LobeChat 的部分功能、Workflow 等参考了它的实现。你可以在 [Chat-Next-Web](https://github.com/Yidadaa/ChatGPT-Next-Web) 的 GitHub 仓库中查看源码和文档。
14
+
15
+ 6. **Next.js 文档**:我们的项目是基于 Next.js 构建的,你可以查看 [Next.js 文档](https://nextjs.org/docs) 来了解更多关于 Next.js 的信息。
16
+
17
+ 7. **FlowGPT**:FlowGPT 是目前全球最大的 Prompt 社区,LobeChat 中的一些 Agent 来自 FlowGPT 的活跃作者。你可以访问 [FlowGPT](https://flowgpt.com/) 来了解更多关于它的信息。
18
+
19
+ 我们会持续更新和补充这个列表,为开发者提供更多的参考资源。
@@ -0,0 +1,69 @@
1
+ # Environment Setup Guide
2
+
3
+ Welcome to the LobeChat development environment setup guide.
4
+
5
+ #### TOC
6
+
7
+ - [Online Development](#online-development)
8
+ - [Local Development](#local-development)
9
+ - [Development Environment Requirements](#development-environment-requirements)
10
+ - [Project Setup](#project-setup)
11
+
12
+ ## Online Development
13
+
14
+ If you have access to GitHub Codespaces, you can click the button below to enter the online development environment with just one click:
15
+
16
+ [![][codespaces-shield]][codespaces-link]
17
+
18
+ ## Local Development
19
+
20
+ Before starting development on LobeChat, you need to install and configure some necessary software and tools in your local environment. This document will guide you through these steps.
21
+
22
+ ### Development Environment Requirements
23
+
24
+ First, you need to install the following software:
25
+
26
+ - Node.js: LobeChat is built on Node.js, so you need to install Node.js. We recommend installing the latest stable version.
27
+ - Yarn: We use Yarn as the preferred package manager. You can download and install it from the Yarn official website.
28
+ - PNPM: We use PNPM as an auxiliary package manager. You can download and install it from the PNPM official website.
29
+ - Git: We use Git for version control. You can download and install it from the Git official website.
30
+ - IDE: You can choose your preferred integrated development environment (IDE). We recommend using WebStorm, a powerful IDE particularly suitable for TypeScript development.
31
+
32
+ ### Project Setup
33
+
34
+ After installing the above software, you can start setting up the LobeChat project.
35
+
36
+ 1. **Get the code**: First, you need to clone the LobeChat codebase from GitHub. Run the following command in the terminal:
37
+
38
+ ```bash
39
+ git clone https://github.com/lobehub/lobe-chat.git
40
+ ```
41
+
42
+ 2. **Install dependencies**: Then, navigate to the project directory and use Yarn to install the project's dependencies:
43
+
44
+ ```bash
45
+ cd lobe-chat
46
+ yarn install
47
+ ```
48
+
49
+ If you are using PNPM, you can execute:
50
+
51
+ ```bash
52
+ cd lobe-chat
53
+ pnpm install
54
+ ```
55
+
56
+ 3. **Start the development server**: After installing the dependencies, you can start the development server:
57
+
58
+ ```bash
59
+ yarn run dev
60
+ ```
61
+
62
+ Now, you can open `http://localhost:3010` in your browser, and you should see the welcome page of LobeChat. This indicates that you have successfully set up the development environment.
63
+
64
+ ![](https://github-production-user-asset-6210df.s3.amazonaws.com/28616219/274655364-414bc31e-8511-47a3-af17-209b530effc7.png)
65
+
66
+ During the development process, if you encounter any issues with environment setup or have any questions about LobeChat development, feel free to ask us at any time. We look forward to seeing your contributions!
67
+
68
+ [codespaces-link]: https://codespaces.new/lobehub/lobe-chat
69
+ [codespaces-shield]: https://github.com/codespaces/badge.svg
@@ -0,0 +1,69 @@
1
+ # 环境设置指南
2
+
3
+ 欢迎阅读 LobeChat 的开发环境设置指南。
4
+
5
+ #### TOC
6
+
7
+ - [在线开发](#在线开发)
8
+ - [本地开发](#本地开发)
9
+ - [开发环境需求](#开发环境需求)
10
+ - [项目设置](#项目设置)
11
+
12
+ ## 在线开发
13
+
14
+ 如果你有 GitHub Codespaces 的使用权限,可以点击下方按钮一键进入在线开发环境:
15
+
16
+ [![][codespaces-shield]][codespaces-link]
17
+
18
+ ## 本地开发
19
+
20
+ 在开始开发 LobeChat 之前,你需要在本地环境中安装和配置一些必要的软件和工具。本文档将指导你完成这些步骤。
21
+
22
+ ### 开发环境需求
23
+
24
+ 首先,你需要安装以下软件:
25
+
26
+ - Node.js:LobeChat 是基于 Node.js 构建的,因此你需要安装 Node.js。我们建议安装最新的稳定版。
27
+ - Bun:我们使用 Bun 作为首选包管理器。你可以从 Bun 的官方网站上下载并安装。
28
+ - PNPM:我们使用 PNPM 作为辅助包管理器。你可以从 pnpm 的官方网站上下载并安装。
29
+ - Git:我们使用 Git 进行版本控制。你可以从 Git 的官方网站上下载并安装。
30
+ - IDE:你可以选择你喜欢的集成开发环境(IDE)。我们推荐使用 WebStorm,它是一款功能强大的 IDE,特别适合 TypeScript 开发。
31
+
32
+ ### 项目设置
33
+
34
+ 完成上述软件的安装后,你可以开始设置 LobeChat 项目了。
35
+
36
+ 1. **获取代码**:首先,你需要从 GitHub 上克隆 LobeChat 的代码库。在终端中运行以下命令:
37
+
38
+ ```bash
39
+ git clone https://github.com/lobehub/lobe-chat.git
40
+ ```
41
+
42
+ 2. **安装依赖**:然后,进入项目目录,并使用 bun 安装项目的依赖包:
43
+
44
+ ```bash
45
+ cd lobe-chat
46
+ bun i
47
+ ```
48
+
49
+ 如果你使用 pnpm ,可以执行:
50
+
51
+ ```bash
52
+ cd lobe-chat
53
+ pnpm i
54
+ ```
55
+
56
+ 3. **启动开发服务器**:安装完依赖后,你可以启动开发服务器:
57
+
58
+ ```bash
59
+ bun run dev
60
+ ```
61
+
62
+ 现在,你可以在浏览器中打开 `http://localhost:3010`,你应该能看到 LobeChat 的欢迎页面。这表明你已经成功地设置了开发环境。
63
+
64
+ ![](https://github-production-user-asset-6210df.s3.amazonaws.com/28616219/274655364-414bc31e-8511-47a3-af17-209b530effc7.png)
65
+
66
+ 在开发过程中,如果你在环境设置上遇到任何问题,或者有任何关于 LobeChat 开发的问题,欢迎随时向我们提问。我们期待看到你的贡献!
67
+
68
+ [codespaces-link]: https://codespaces.new/lobehub/lobe-chat
69
+ [codespaces-shield]: https://github.com/codespaces/badge.svg
@@ -0,0 +1,87 @@
1
+ # Testing Guide
2
+
3
+ LobeChat's testing strategy includes unit testing and end-to-end (E2E) testing. Below are detailed explanations of each type of testing:
4
+
5
+ #### TOC
6
+
7
+ - [Unit Testing](#unit-testing)
8
+ - [🚧 End-to-End Testing](#-end-to-end-testing)
9
+ - [Development Testing](#development-testing)
10
+ - [1. Unit Testing](#1-unit-testing)
11
+ - [Testing Strategy](#testing-strategy)
12
+
13
+ ## Unit Testing
14
+
15
+ Unit testing is used to test the functionality of independent units in the application, such as components, functions, utility functions, etc. We use [vitest][vitest-url] for unit testing.
16
+
17
+ To run unit tests, you can use the following command:
18
+
19
+ ```
20
+ npm run test
21
+ ```
22
+
23
+ This will run all unit tests and generate a test report.
24
+
25
+ We encourage developers to write corresponding unit tests while writing code to ensure the quality and stability of the code.
26
+
27
+ ## 🚧 End-to-End Testing
28
+
29
+ End-to-end testing is used to test the functionality and performance of the application in a real environment. It simulates real user operations and verifies the application's performance in different scenarios.
30
+
31
+ Currently, there is no integrated end-to-end testing in LobeChat. We will gradually introduce end-to-end testing in subsequent iterations.
32
+
33
+ ## Development Testing
34
+
35
+ ### 1. Unit Testing
36
+
37
+ Unit testing is conducted on the smallest testable units in the application, usually functions, components, or modules. In LobeChat, we use [vitest][vitest-url] for unit testing.
38
+
39
+ #### Writing Test Cases
40
+
41
+ Before writing unit tests, you need to create a directory with the same name as the file to be tested and name the test file `<filename>.test.ts`. For example, if you want to test the `src/utils/formatDate.ts` file, the test file should be named `src/utils/formatDate.test.ts`.
42
+
43
+ In the test file, you can use the `describe` and `it` functions to organize and write test cases. The `describe` function is used to create a test suite, and the `it` function is used to write specific test cases.
44
+
45
+ ```typescript
46
+ import { formatNumber } from './formatNumber';
47
+
48
+ describe('formatNumber', () => {
49
+ it('should format number with comma separator', () => {
50
+ const result = formatNumber(1000);
51
+ expect(result).toBe('1,000');
52
+ });
53
+
54
+ it('should return the same number if it is less than 1000', () => {
55
+ const result = formatNumber(500);
56
+ expect(result).toBe('500');
57
+ });
58
+ });
59
+ ```
60
+
61
+ In test cases, you can use the `expect` function to assert whether the test results meet expectations. The `expect` function can be used with various matchers, such as `toBe`, `toEqual`, `toBeTruthy`, etc.
62
+
63
+ #### Running Unit Tests
64
+
65
+ Execute unit tests by running the following command:
66
+
67
+ ```
68
+ npm run test
69
+ ```
70
+
71
+ This will run all unit tests and output the test results.
72
+
73
+ ## Testing Strategy
74
+
75
+ To write effective test cases, you can consider the following testing strategies:
76
+
77
+ - **Boundary Testing**: Test the boundary conditions of inputs, such as minimum value, maximum value, empty value, etc.
78
+ - **Exception Testing**: Test the code handling exceptional cases, such as error handling, fallback in exceptional situations, etc.
79
+ - **Functional Testing**: Test whether various functional modules of the application work properly, including user interaction, data processing, etc.
80
+ - **Compatibility Testing**: Test the compatibility of the application on different browsers and devices.
81
+ - **Performance Testing**: Test the performance of the application under different loads, such as response time, resource utilization, etc.
82
+
83
+ Also, ensure that your test cases have good coverage, covering critical code and functionality in the application.
84
+
85
+ By properly writing and executing unit tests, integration tests, and end-to-end tests, you can improve the quality and stability of the application and promptly identify and fix potential issues.
86
+
87
+ [vitest-url]: https://vitest.dev/
@@ -0,0 +1,87 @@
1
+ # 测试指南
2
+
3
+ LobeChat 的测试策略包括单元测试和端到端 (E2E) 测试。下面是每种测试的详细说明:
4
+
5
+ #### TOC
6
+
7
+ - [单元测试](#单元测试)
8
+ - [🚧 端到端测试](#-端到端测试)
9
+ - [开发测试](#开发测试)
10
+ - [1. 单元测试](#1-单元测试)
11
+ - [测试策略](#测试策略)
12
+
13
+ ## 单元测试
14
+
15
+ 单元测试用于测试应用中的独立单元(如组件、函数、工具函数等)的功能。我们使用 [vitest][vitest-url] 进行单元测试。
16
+
17
+ 要运行单元测试,可以使用以下命令:
18
+
19
+ ```
20
+ npm run test
21
+ ```
22
+
23
+ 这将运行所有的单元测试,并生成测试报告。
24
+
25
+ 我们鼓励开发者在编写代码时,同时编写对应的单元测试,以确保代码的质量和稳定性。
26
+
27
+ ## 🚧 端到端测试
28
+
29
+ 端到端测试用于测试应用在真实环境中的功能和性能。它模拟用户的真实操作,并验证应用在不同场景下的表现。
30
+
31
+ 在 LobeChat 中,目前暂时没有集成端到端测试,我们会在后续迭代中逐步引入端到端测试。
32
+
33
+ ## 开发测试
34
+
35
+ ### 1. 单元测试
36
+
37
+ 单元测试是针对应用中的最小可测试单元进行的测试,通常是针对函数、组件或模块进行的测试。在 LobeChat 中,我们使用 [vitest][vitest-url] 进行单元测试。
38
+
39
+ #### 编写测试用例
40
+
41
+ 在编写单元测试之前,您需要创建一个与被测试文件相同的目录,并将测试文件命名为 `<filename>.test.ts`。例如,如果要测试 `src/utils/formatDate.ts` 文件,测试文件应命名为 `src/utils/formatDate.test.ts`。
42
+
43
+ 在测试文件中,您可以使用 `describe` 和 `it` 函数来组织和编写测试用例。`describe` 函数用于创建测试套件,`it` 函数用于编写具体的测试用例。
44
+
45
+ ```typescript
46
+ import { formatNumber } from './formatNumber';
47
+
48
+ describe('formatNumber', () => {
49
+ it('should format number with comma separator', () => {
50
+ const result = formatNumber(1000);
51
+ expect(result).toBe('1,000');
52
+ });
53
+
54
+ it('should return the same number if it is less than 1000', () => {
55
+ const result = formatNumber(500);
56
+ expect(result).toBe('500');
57
+ });
58
+ });
59
+ ```
60
+
61
+ 在测试用例中,您可以使用 `expect` 函数来断言测试结果是否符合预期。`expect` 函数可以与各种匹配器(matchers)一起使用,例如 `toBe`、`toEqual`、`toBeTruthy` 等。
62
+
63
+ #### 运行单元测试
64
+
65
+ 通过运行以下命令来执行单元测试:
66
+
67
+ ```
68
+ npm run test
69
+ ```
70
+
71
+ 这将运行所有的单元测试,并输出测试结果。
72
+
73
+ ## 测试策略
74
+
75
+ 为了编写有效的测试用例,您可以考虑以下测试策略:
76
+
77
+ - **边界条件测试**:测试输入的边界条件,例如最小值、最大值、空值等。
78
+ - **异常情况测试**:测试处理异常情况的代码,例如错误处理、异常情况下的回退等。
79
+ - **功能测试**:测试应用的各个功能模块是否正常工作,包括用户交互、数据处理等。
80
+ - **兼容性测试**:测试应用在不同浏览器和设备上的兼容性。
81
+ - **性能测试**:测试应用在不同负载下的性能表现,例如响应时间、资源占用等。
82
+
83
+ 同时,请确保您的测试用例具有良好的覆盖率,覆盖到应用中的关键代码和功能。
84
+
85
+ 通过合理编写和执行单元测试、集成测试和端到端测试,您可以提高应用的质量和稳定性,并及时发现和修复潜在的问题。
86
+
87
+ [vitest-url]: https://vitest.dev/