@lobehub/chat 0.153.0 → 0.154.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (160) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/docs/self-hosting/advanced/authentication.mdx +25 -18
  3. package/docs/self-hosting/advanced/authentication.zh-CN.mdx +26 -17
  4. package/docs/self-hosting/advanced/model-list.mdx +2 -2
  5. package/docs/self-hosting/advanced/model-list.zh-CN.mdx +2 -2
  6. package/docs/self-hosting/environment-variables/auth.mdx +48 -39
  7. package/docs/self-hosting/environment-variables/auth.zh-CN.mdx +49 -43
  8. package/locales/ar/auth.json +6 -0
  9. package/locales/ar/clerk.json +769 -0
  10. package/locales/ar/common.json +2 -0
  11. package/locales/ar/error.json +8 -0
  12. package/locales/bg-BG/auth.json +6 -0
  13. package/locales/bg-BG/clerk.json +769 -0
  14. package/locales/bg-BG/common.json +2 -0
  15. package/locales/bg-BG/error.json +8 -0
  16. package/locales/de-DE/auth.json +6 -0
  17. package/locales/de-DE/clerk.json +769 -0
  18. package/locales/de-DE/common.json +2 -0
  19. package/locales/de-DE/error.json +8 -0
  20. package/locales/en-US/auth.json +6 -0
  21. package/locales/en-US/clerk.json +769 -0
  22. package/locales/en-US/common.json +2 -0
  23. package/locales/en-US/error.json +8 -0
  24. package/locales/es-ES/auth.json +6 -0
  25. package/locales/es-ES/clerk.json +769 -0
  26. package/locales/es-ES/common.json +2 -0
  27. package/locales/es-ES/error.json +8 -0
  28. package/locales/fr-FR/auth.json +6 -0
  29. package/locales/fr-FR/clerk.json +769 -0
  30. package/locales/fr-FR/common.json +2 -0
  31. package/locales/fr-FR/error.json +8 -0
  32. package/locales/it-IT/auth.json +6 -0
  33. package/locales/it-IT/clerk.json +769 -0
  34. package/locales/it-IT/common.json +2 -0
  35. package/locales/it-IT/error.json +8 -0
  36. package/locales/ja-JP/auth.json +6 -0
  37. package/locales/ja-JP/clerk.json +769 -0
  38. package/locales/ja-JP/common.json +2 -0
  39. package/locales/ja-JP/error.json +8 -0
  40. package/locales/ko-KR/auth.json +6 -0
  41. package/locales/ko-KR/clerk.json +769 -0
  42. package/locales/ko-KR/common.json +2 -0
  43. package/locales/ko-KR/error.json +8 -0
  44. package/locales/nl-NL/auth.json +6 -0
  45. package/locales/nl-NL/clerk.json +769 -0
  46. package/locales/nl-NL/common.json +2 -0
  47. package/locales/nl-NL/error.json +8 -0
  48. package/locales/pl-PL/auth.json +6 -0
  49. package/locales/pl-PL/clerk.json +769 -0
  50. package/locales/pl-PL/common.json +2 -0
  51. package/locales/pl-PL/error.json +8 -0
  52. package/locales/pt-BR/auth.json +6 -0
  53. package/locales/pt-BR/clerk.json +769 -0
  54. package/locales/pt-BR/common.json +2 -0
  55. package/locales/pt-BR/error.json +8 -0
  56. package/locales/ru-RU/auth.json +6 -0
  57. package/locales/ru-RU/clerk.json +769 -0
  58. package/locales/ru-RU/common.json +2 -0
  59. package/locales/ru-RU/error.json +8 -0
  60. package/locales/tr-TR/auth.json +6 -0
  61. package/locales/tr-TR/clerk.json +769 -0
  62. package/locales/tr-TR/common.json +2 -0
  63. package/locales/tr-TR/error.json +8 -0
  64. package/locales/vi-VN/auth.json +6 -0
  65. package/locales/vi-VN/clerk.json +769 -0
  66. package/locales/vi-VN/common.json +2 -0
  67. package/locales/vi-VN/error.json +8 -0
  68. package/locales/zh-CN/auth.json +6 -0
  69. package/locales/zh-CN/clerk.json +769 -0
  70. package/locales/zh-CN/common.json +2 -0
  71. package/locales/zh-CN/error.json +8 -0
  72. package/locales/zh-TW/auth.json +6 -0
  73. package/locales/zh-TW/clerk.json +769 -0
  74. package/locales/zh-TW/common.json +2 -0
  75. package/locales/zh-TW/error.json +8 -0
  76. package/package.json +5 -1
  77. package/src/app/(auth)/layout.tsx +19 -0
  78. package/src/app/(auth)/login/[[...login]]/PageTitle.tsx +13 -0
  79. package/src/app/(auth)/login/[[...login]]/page.tsx +14 -0
  80. package/src/app/(auth)/profile/[[...slugs]]/PageTitle.tsx +13 -0
  81. package/src/app/(auth)/profile/[[...slugs]]/page.tsx +14 -0
  82. package/src/app/(auth)/signup/[[...signup]]/PageTitle.tsx +13 -0
  83. package/src/app/(auth)/signup/[[...signup]]/page.tsx +14 -0
  84. package/src/app/(main)/(mobile)/me/features/AvatarBanner.tsx +12 -40
  85. package/src/app/(main)/(mobile)/me/features/Header.tsx +37 -0
  86. package/src/app/(main)/(mobile)/me/features/style.ts +29 -0
  87. package/src/app/(main)/(mobile)/me/layout.tsx +7 -1
  88. package/src/app/(main)/(mobile)/me/loading.tsx +22 -7
  89. package/src/app/(main)/(mobile)/me/page.tsx +4 -5
  90. package/src/app/(main)/@nav/_layout/Mobile.tsx +2 -2
  91. package/src/app/(main)/market/@detail/features/{AgentDetailContent/index.tsx → AgentDetailContent.tsx} +6 -12
  92. package/src/app/(main)/market/@detail/features/Banner.tsx +46 -0
  93. package/src/app/(main)/market/@detail/features/{AgentDetailContent/Header.tsx → Header.tsx} +4 -18
  94. package/src/app/(main)/market/@detail/features/{AgentDetailContent/Loading.tsx → Loading.tsx} +5 -4
  95. package/src/app/(main)/market/@detail/features/{AgentDetailContent/style.ts → style.ts} +0 -3
  96. package/src/app/(main)/market/features/AgentCard/AgentCardBanner.tsx +13 -8
  97. package/src/app/(main)/market/loading.tsx +13 -1
  98. package/src/app/(main)/settings/common/features/Common.tsx +1 -1
  99. package/src/app/(main)/settings/common/features/Theme/index.tsx +2 -0
  100. package/src/app/(main)/settings/common/index.tsx +7 -3
  101. package/src/app/api/chat/[provider]/route.test.ts +76 -3
  102. package/src/app/api/chat/auth/index.test.ts +77 -0
  103. package/src/app/api/chat/auth/index.ts +19 -3
  104. package/src/app/api/chat/auth/utils.ts +31 -9
  105. package/src/app/api/plugin/gateway/route.ts +3 -3
  106. package/src/components/Cell/Divider.tsx +2 -0
  107. package/src/components/Cell/index.tsx +5 -1
  108. package/src/components/server/MobileNavLayout.tsx +1 -0
  109. package/src/config/auth.ts +146 -0
  110. package/src/config/server/index.ts +1 -3
  111. package/src/const/auth.ts +7 -0
  112. package/src/features/Conversation/Error/ClerkLogin/index.tsx +47 -0
  113. package/src/features/Conversation/Error/index.tsx +5 -0
  114. package/src/features/Conversation/components/InboxWelcome/AgentsSuggest.tsx +15 -6
  115. package/src/features/Conversation/components/InboxWelcome/QuestionSuggest.tsx +9 -4
  116. package/src/features/Conversation/components/InboxWelcome/index.tsx +9 -20
  117. package/src/features/DataImporter/index.tsx +4 -1
  118. package/src/features/User/PlanTag.tsx +45 -0
  119. package/src/features/User/UserAvatar.tsx +11 -5
  120. package/src/features/User/UserInfo.tsx +30 -12
  121. package/src/features/User/UserLoginOrSignup.tsx +23 -0
  122. package/src/features/User/UserPanel/PanelContent.tsx +74 -0
  123. package/src/features/User/UserPanel/UpgradeBadge.tsx +19 -0
  124. package/src/features/User/UserPanel/index.tsx +8 -27
  125. package/src/features/User/UserPanel/useMenu.tsx +49 -21
  126. package/src/features/User/__tests__/PanelContent.test.tsx +151 -0
  127. package/src/features/User/__tests__/UserAvatar.test.tsx +78 -0
  128. package/src/hooks/useGreeting/greetingTime.ts +14 -0
  129. package/src/hooks/useGreeting/index.ts +16 -0
  130. package/src/layout/AuthProvider/Clerk/UserUpdater.tsx +41 -0
  131. package/src/layout/AuthProvider/Clerk/index.tsx +26 -0
  132. package/src/layout/AuthProvider/Clerk/useAppearance.ts +118 -0
  133. package/src/layout/AuthProvider/index.tsx +8 -4
  134. package/src/libs/next-auth/index.ts +4 -6
  135. package/src/libs/next-auth/sso-providers/auth0.ts +4 -6
  136. package/src/libs/next-auth/sso-providers/authentik.ts +4 -6
  137. package/src/libs/next-auth/sso-providers/azure-ad.ts +4 -6
  138. package/src/libs/next-auth/sso-providers/github.ts +3 -5
  139. package/src/libs/next-auth/sso-providers/zitadel.ts +4 -6
  140. package/src/locales/default/auth.ts +6 -0
  141. package/src/locales/default/clerk.ts +782 -0
  142. package/src/locales/default/common.ts +4 -1
  143. package/src/locales/default/error.ts +8 -0
  144. package/src/locales/default/index.ts +4 -0
  145. package/src/middleware.ts +19 -6
  146. package/src/server/globalConfig/index.ts +2 -2
  147. package/src/store/user/selectors.ts +1 -1
  148. package/src/store/user/slices/auth/action.test.ts +105 -0
  149. package/src/store/user/slices/auth/action.ts +40 -5
  150. package/src/store/user/slices/auth/initialState.ts +15 -0
  151. package/src/store/user/slices/auth/selectors.test.ts +127 -0
  152. package/src/store/user/slices/auth/selectors.ts +38 -1
  153. package/src/store/user/slices/settings/selectors/selectors.test.ts +25 -0
  154. package/src/store/user/slices/settings/selectors/settings.ts +6 -0
  155. package/src/styles/mobileHeader.ts +7 -0
  156. package/src/types/fetch.ts +1 -0
  157. package/src/config/server/auth.ts +0 -71
  158. package/src/features/User/UserPanel/Popover.tsx +0 -35
  159. /package/src/app/(main)/market/@detail/features/{AgentDetailContent/Comment.tsx → Comment.tsx} +0 -0
  160. /package/src/app/(main)/market/@detail/features/{AgentDetailContent/TokenTag.tsx → TokenTag.tsx} +0 -0
@@ -160,6 +160,7 @@
160
160
  "newVersion": "有新版本可用:{{version}}"
161
161
  },
162
162
  "userPanel": {
163
+ "anonymousNickName": "匿名用户",
163
164
  "billing": "账单管理",
164
165
  "defaultNickname": "社区版用户",
165
166
  "discord": "社区支持",
@@ -169,6 +170,7 @@
169
170
  "help": "帮助中心",
170
171
  "moveGuide": "设置按钮搬到这里啦",
171
172
  "plans": "订阅方案",
173
+ "preview": "预览版",
172
174
  "profile": "账户管理",
173
175
  "setting": "应用设置",
174
176
  "usages": "用量统计"
@@ -1,4 +1,11 @@
1
1
  {
2
+ "clerkAuth": {
3
+ "loginSuccess": {
4
+ "action": "继续会话",
5
+ "desc": "{{greeting}},很高兴能够继续为你服务。让我们接着刚刚的话题聊下去吧",
6
+ "title": "欢迎回来, {{nickName}}"
7
+ }
8
+ },
2
9
  "error": {
3
10
  "backHome": "返回首页",
4
11
  "desc": "待会来试试,或者回到已知的世界",
@@ -57,6 +64,7 @@
57
64
  "PluginGatewayError": "很抱歉,插件网关出现错误,请检查插件网关配置是否正确",
58
65
  "PluginOpenApiInitError": "很抱歉,OpenAPI 客户端初始化失败,请检查 OpenAPI 的配置信息是否正确",
59
66
  "InvalidAccessCode": "密码不正确或为空,请输入正确的访问密码,或者添加自定义 API Key",
67
+ "InvalidClerkUser": "很抱歉,你当前尚未登录,请先登录或注册账号后继续操作",
60
68
  "LocationNotSupportError": "很抱歉,你的所在位置不支持此模型服务,可能是由于地区限制或服务未开通。请确认当前位置是否支持使用此服务,或尝试使用其他位置信息。",
61
69
  "OpenAIBizError": "请求 OpenAI 服务出错,请根据以下信息排查或重试",
62
70
  "NoOpenAIAPIKey": "OpenAI API Key 为空,请添加自定义 OpenAI API Key",
@@ -0,0 +1,6 @@
1
+ {
2
+ "login": "登入",
3
+ "loginOrSignup": "登入 / 註冊",
4
+ "signout": "登出",
5
+ "signup": "註冊"
6
+ }