@lobehub/chat 1.77.11 → 1.77.13
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.
- package/.github/scripts/pr-comment.js +111 -55
- package/CHANGELOG.md +51 -0
- package/changelog/v1.json +18 -0
- package/docs/self-hosting/environment-variables/basic.mdx +39 -0
- package/docs/self-hosting/environment-variables/basic.zh-CN.mdx +40 -1
- package/locales/ar/hotkey.json +4 -0
- package/locales/ar/models.json +6 -0
- package/locales/bg-BG/hotkey.json +4 -0
- package/locales/bg-BG/models.json +6 -0
- package/locales/de-DE/hotkey.json +4 -0
- package/locales/de-DE/models.json +6 -0
- package/locales/en-US/hotkey.json +4 -0
- package/locales/en-US/models.json +6 -0
- package/locales/es-ES/hotkey.json +4 -0
- package/locales/es-ES/models.json +6 -0
- package/locales/fa-IR/hotkey.json +4 -0
- package/locales/fa-IR/models.json +6 -0
- package/locales/fr-FR/hotkey.json +4 -0
- package/locales/fr-FR/models.json +6 -0
- package/locales/it-IT/hotkey.json +4 -0
- package/locales/it-IT/models.json +6 -0
- package/locales/ja-JP/hotkey.json +4 -0
- package/locales/ja-JP/models.json +6 -0
- package/locales/ko-KR/hotkey.json +4 -0
- package/locales/ko-KR/models.json +6 -0
- package/locales/nl-NL/hotkey.json +4 -0
- package/locales/nl-NL/models.json +6 -0
- package/locales/pl-PL/hotkey.json +4 -0
- package/locales/pl-PL/models.json +6 -0
- package/locales/pt-BR/hotkey.json +4 -0
- package/locales/pt-BR/models.json +6 -0
- package/locales/ru-RU/hotkey.json +4 -0
- package/locales/ru-RU/models.json +6 -0
- package/locales/tr-TR/hotkey.json +4 -0
- package/locales/tr-TR/models.json +6 -0
- package/locales/vi-VN/hotkey.json +4 -0
- package/locales/vi-VN/models.json +6 -0
- package/locales/zh-CN/hotkey.json +4 -0
- package/locales/zh-CN/models.json +7 -1
- package/locales/zh-TW/hotkey.json +4 -0
- package/locales/zh-TW/models.json +6 -0
- package/package.json +1 -1
- package/packages/electron-client-ipc/src/dispatch.ts +29 -0
- package/packages/electron-client-ipc/src/events/index.ts +9 -2
- package/packages/electron-client-ipc/src/events/menu.ts +5 -0
- package/packages/electron-client-ipc/src/events/search.ts +4 -0
- package/packages/electron-client-ipc/src/events/system.ts +3 -0
- package/packages/electron-client-ipc/src/events/windows.ts +8 -0
- package/packages/electron-client-ipc/src/index.ts +1 -0
- package/scripts/migrateServerDB/index.ts +3 -2
- package/src/app/[variants]/(main)/(mobile)/me/(home)/__tests__/UserBanner.test.tsx +1 -0
- package/src/app/[variants]/(main)/_layout/Desktop/SideBar/TopActions.tsx +3 -2
- package/src/app/[variants]/(main)/_layout/Desktop/SideBar/index.tsx +24 -5
- package/src/app/[variants]/(main)/_layout/Desktop/Titlebar.tsx +27 -0
- package/src/app/[variants]/(main)/_layout/Desktop/index.tsx +32 -3
- package/src/app/[variants]/(main)/chat/(workspace)/_layout/Desktop/ChatHeader/index.tsx +12 -2
- package/src/app/[variants]/(main)/chat/(workspace)/page.tsx +2 -1
- package/src/app/[variants]/(main)/settings/hotkey/features/HotkeySetting.tsx +15 -6
- package/src/app/[variants]/(main)/settings/hotkey/page.tsx +10 -1
- package/src/app/[variants]/(main)/settings/provider/features/ProviderConfig/index.tsx +3 -1
- package/src/app/desktop/devtools/page.tsx +37 -38
- package/src/config/aiModels/google.ts +25 -1
- package/src/config/aiModels/novita.ts +1 -32
- package/src/config/aiModels/ollama.ts +12 -1
- package/src/config/aiModels/qwen.ts +1 -1
- package/src/const/hotkeys.ts +10 -0
- package/src/features/DevPanel/PostgresViewer/SchemaSidebar/index.tsx +1 -1
- package/src/features/User/UserPanel/index.tsx +1 -1
- package/src/features/User/__tests__/PanelContent.test.tsx +1 -0
- package/src/libs/trpc/index.ts +1 -0
- package/src/libs/trpc/middleware/userAuth.ts +2 -3
- package/src/locales/default/hotkey.ts +4 -0
- package/src/server/globalConfig/genServerAiProviderConfig.ts +12 -3
- package/src/server/globalConfig/index.ts +6 -1
- package/src/server/globalConfig/parseSystemAgent.test.ts +56 -0
- package/src/server/globalConfig/parseSystemAgent.ts +25 -0
- package/src/server/services/changelog/index.test.ts +2 -0
- package/src/server/services/changelog/index.ts +6 -2
- package/src/services/__tests__/chat.test.ts +3 -0
- package/src/services/electron/devtools.ts +1 -1
- package/src/store/user/slices/modelList/selectors/modelConfig.ts +4 -0
- package/src/styles/global.ts +14 -0
- package/src/types/hotkey.ts +1 -0
- package/tsconfig.json +1 -6
- package/packages/electron-client-ipc/src/events/devtools.ts +0 -6
- package/src/app/[variants]/(main)/settings/hotkey/index.tsx +0 -9
- package/src/types/electron.ts +0 -11
- package/src/utils/electron/dispatch.ts +0 -10
@@ -65,6 +65,7 @@ beforeEach(() => {
|
|
65
65
|
vi.mock('@/const/version', () => ({
|
66
66
|
isServerMode: false,
|
67
67
|
isDeprecatedEdition: true,
|
68
|
+
isDesktop: false,
|
68
69
|
}));
|
69
70
|
});
|
70
71
|
|
@@ -878,6 +879,7 @@ describe('ChatService', () => {
|
|
878
879
|
vi.doMock('@/const/version', () => ({
|
879
880
|
isServerMode: true,
|
880
881
|
isDeprecatedEdition: false,
|
882
|
+
isDesktop: false,
|
881
883
|
}));
|
882
884
|
|
883
885
|
// 需要在修改模拟后重新导入相关模块
|
@@ -965,6 +967,7 @@ describe('ChatService', () => {
|
|
965
967
|
vi.doMock('@/const/version', () => ({
|
966
968
|
isServerMode: true,
|
967
969
|
isDeprecatedEdition: true,
|
970
|
+
isDesktop: false,
|
968
971
|
}));
|
969
972
|
|
970
973
|
// 需要在修改模拟后重新导入相关模块
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import { isProviderDisableBrowserRequest } from '@/config/modelProviders';
|
2
|
+
import { isDesktop } from '@/const/version';
|
2
3
|
import { UserStore } from '@/store/user';
|
3
4
|
import { GlobalLLMProviderKey } from '@/types/user/settings';
|
4
5
|
|
@@ -19,6 +20,9 @@ const providerWhitelist = new Set(['ollama']);
|
|
19
20
|
const isProviderFetchOnClient = (provider: GlobalLLMProviderKey | string) => (s: UserStore) => {
|
20
21
|
const config = getProviderConfigById(provider)(s);
|
21
22
|
|
23
|
+
// if is desktop, force on Server.
|
24
|
+
if (isDesktop) return false;
|
25
|
+
|
22
26
|
// If the provider already disable browser request in model config, force on Server.
|
23
27
|
if (isProviderDisableBrowserRequest(provider)) return false;
|
24
28
|
|
package/src/styles/global.ts
CHANGED
@@ -1,4 +1,7 @@
|
|
1
1
|
import { Theme, css } from 'antd-style';
|
2
|
+
import { rgba } from 'polished';
|
3
|
+
|
4
|
+
import { isDesktop } from '@/const/version';
|
2
5
|
|
3
6
|
// fix ios input keyboard
|
4
7
|
// overflow: hidden;
|
@@ -22,6 +25,17 @@ export default ({ token }: { prefixCls: string; token: Theme }) => css`
|
|
22
25
|
}
|
23
26
|
}
|
24
27
|
|
28
|
+
html {
|
29
|
+
background: ${isDesktop ? 'none' : token.colorBgLayout};
|
30
|
+
}
|
31
|
+
|
32
|
+
body {
|
33
|
+
/* 提高合成层级,强制硬件加速,否则会有渲染黑边出现 */
|
34
|
+
will-change: opacity;
|
35
|
+
transform: translateZ(0);
|
36
|
+
background: ${isDesktop ? rgba(token.colorBgLayout, 0.66) : token.colorBgLayout};
|
37
|
+
}
|
38
|
+
|
25
39
|
* {
|
26
40
|
scrollbar-color: ${token.colorFill} transparent;
|
27
41
|
scrollbar-width: thin;
|
package/src/types/hotkey.ts
CHANGED
@@ -10,6 +10,7 @@ export const HotkeyEnum = {
|
|
10
10
|
EditMessage: 'editMessage',
|
11
11
|
OpenChatSettings: 'openChatSettings',
|
12
12
|
OpenHotkeyHelper: 'openHotkeyHelper',
|
13
|
+
OpenSettings: 'openSettings',
|
13
14
|
RegenerateMessage: 'regenerateMessage',
|
14
15
|
SaveTopic: 'saveTopic',
|
15
16
|
Search: 'search',
|
package/tsconfig.json
CHANGED
package/src/types/electron.ts
DELETED
@@ -1,10 +0,0 @@
|
|
1
|
-
import { DispatchInvoke } from '@lobechat/electron-client-ipc';
|
2
|
-
|
3
|
-
/**
|
4
|
-
* client 端请求 sketch 端 event 数据的方法
|
5
|
-
*/
|
6
|
-
export const dispatch: DispatchInvoke = async (event, ...data) => {
|
7
|
-
if (!window.electronAPI) throw new Error('electronAPI not found');
|
8
|
-
|
9
|
-
return window.electronAPI.invoke(event, ...data);
|
10
|
-
};
|