@lobehub/chat 1.84.1 → 1.84.3

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 (66) hide show
  1. package/.env.desktop +1 -0
  2. package/CHANGELOG.md +52 -0
  3. package/apps/desktop/electron-builder.js +8 -4
  4. package/apps/desktop/package.json +1 -0
  5. package/apps/desktop/src/main/index.ts +3 -0
  6. package/changelog/v1.json +14 -0
  7. package/locales/ar/models.json +6 -6
  8. package/locales/ar/plugin.json +10 -1
  9. package/locales/bg-BG/models.json +6 -6
  10. package/locales/bg-BG/plugin.json +10 -1
  11. package/locales/de-DE/models.json +6 -6
  12. package/locales/de-DE/plugin.json +10 -1
  13. package/locales/en-US/models.json +6 -6
  14. package/locales/en-US/plugin.json +10 -1
  15. package/locales/es-ES/models.json +6 -6
  16. package/locales/es-ES/plugin.json +10 -1
  17. package/locales/fa-IR/models.json +6 -6
  18. package/locales/fa-IR/plugin.json +10 -1
  19. package/locales/fr-FR/models.json +6 -6
  20. package/locales/fr-FR/plugin.json +10 -1
  21. package/locales/it-IT/models.json +6 -6
  22. package/locales/it-IT/plugin.json +10 -1
  23. package/locales/ja-JP/models.json +6 -6
  24. package/locales/ja-JP/plugin.json +10 -1
  25. package/locales/ko-KR/models.json +6 -6
  26. package/locales/ko-KR/plugin.json +10 -1
  27. package/locales/nl-NL/models.json +6 -6
  28. package/locales/nl-NL/plugin.json +10 -1
  29. package/locales/pl-PL/models.json +6 -6
  30. package/locales/pl-PL/plugin.json +10 -1
  31. package/locales/pt-BR/models.json +6 -6
  32. package/locales/pt-BR/plugin.json +10 -1
  33. package/locales/ru-RU/models.json +6 -6
  34. package/locales/ru-RU/plugin.json +10 -1
  35. package/locales/tr-TR/models.json +6 -6
  36. package/locales/tr-TR/plugin.json +10 -1
  37. package/locales/vi-VN/models.json +6 -6
  38. package/locales/vi-VN/plugin.json +10 -1
  39. package/locales/zh-CN/models.json +6 -6
  40. package/locales/zh-CN/plugin.json +10 -1
  41. package/locales/zh-TW/models.json +6 -6
  42. package/locales/zh-TW/plugin.json +10 -1
  43. package/package.json +2 -2
  44. package/src/app/[variants]/(main)/_layout/Desktop/SideBar/index.tsx +15 -5
  45. package/src/app/[variants]/(main)/chat/(workspace)/@conversation/features/ChatInput/Mobile/InputArea/index.tsx +3 -2
  46. package/src/app/[variants]/(main)/chat/_layout/Desktop/RegisterHotkeys.tsx +6 -3
  47. package/src/app/[variants]/(main)/chat/settings/page.tsx +4 -33
  48. package/src/app/[variants]/(main)/settings/_layout/Desktop/Header.tsx +7 -2
  49. package/src/app/[variants]/(main)/settings/_layout/Mobile/Header.tsx +9 -1
  50. package/src/app/[variants]/(main)/settings/agent/_layout/Desktop.tsx +1 -1
  51. package/src/app/[variants]/(main)/settings/agent/_layout/Mobile.tsx +1 -8
  52. package/src/app/[variants]/(main)/settings/agent/index.tsx +34 -14
  53. package/src/app/[variants]/(main)/settings/common/features/Common.tsx +1 -0
  54. package/src/app/[variants]/(main)/settings/provider/features/ModelList/index.tsx +11 -1
  55. package/src/app/[variants]/(main)/settings/storage/Advanced.tsx +3 -0
  56. package/src/features/ChatInput/ActionBar/Params/ParamsControls.tsx +17 -7
  57. package/src/features/ModelSwitchPanel/index.tsx +6 -0
  58. package/src/features/PluginDevModal/MCPManifestForm/EnvEditor.tsx +227 -0
  59. package/src/features/PluginDevModal/MCPManifestForm/index.tsx +14 -0
  60. package/src/hooks/useHotkeys/chatScope.ts +0 -2
  61. package/src/hooks/useHotkeys/filesScope.ts +0 -2
  62. package/src/libs/agent-runtime/openai/index.ts +11 -0
  63. package/src/libs/mcp/client.ts +9 -1
  64. package/src/libs/mcp/types.ts +1 -0
  65. package/src/locales/default/plugin.ts +10 -1
  66. package/src/server/globalConfig/index.ts +3 -0
@@ -21,6 +21,7 @@ import { useToolStore } from '@/store/tool';
21
21
  import { pluginSelectors } from '@/store/tool/selectors';
22
22
 
23
23
  import ArgsInput from './ArgsInput';
24
+ import EnvEditor from './EnvEditor';
24
25
  import MCPTypeSelect from './MCPTypeSelect';
25
26
  import { parseMcpInput } from './utils';
26
27
 
@@ -51,6 +52,7 @@ const STDIO_COMMAND_OPTIONS: {
51
52
  const HTTP_URL_KEY = ['customParams', 'mcp', 'url'];
52
53
  const STDIO_COMMAND = ['customParams', 'mcp', 'command'];
53
54
  const STDIO_ARGS = ['customParams', 'mcp', 'args'];
55
+ const STDIO_ENV = ['customParams', 'mcp', 'env'];
54
56
  const MCP_TYPE = ['customParams', 'mcp', 'type'];
55
57
 
56
58
  const MCPManifestForm = ({ form, isEditMode }: MCPManifestFormProps) => {
@@ -199,6 +201,7 @@ const MCPManifestForm = ({ form, isEditMode }: MCPManifestFormProps) => {
199
201
  },
200
202
  },
201
203
  ]}
204
+ tag={'identifier'}
202
205
  >
203
206
  <Input
204
207
  onChange={handleIdentifierChange}
@@ -215,6 +218,7 @@ const MCPManifestForm = ({ form, isEditMode }: MCPManifestFormProps) => {
215
218
  { message: t('dev.mcp.url.required'), required: true },
216
219
  { message: t('dev.mcp.url.invalid'), type: 'url' },
217
220
  ]}
221
+ tag={'url'}
218
222
  >
219
223
  <Input placeholder="https://mcp.higress.ai/mcp-github/xxxxx" />
220
224
  </FormItem>
@@ -227,6 +231,7 @@ const MCPManifestForm = ({ form, isEditMode }: MCPManifestFormProps) => {
227
231
  label={t('dev.mcp.command.label')}
228
232
  name={STDIO_COMMAND}
229
233
  rules={[{ message: t('dev.mcp.command.required'), required: true }]}
234
+ tag={'command'}
230
235
  >
231
236
  <AutoComplete
232
237
  options={STDIO_COMMAND_OPTIONS.map(({ value, icon: Icon, color }) => ({
@@ -246,9 +251,18 @@ const MCPManifestForm = ({ form, isEditMode }: MCPManifestFormProps) => {
246
251
  label={t('dev.mcp.args.label')}
247
252
  name={STDIO_ARGS}
248
253
  rules={[{ message: t('dev.mcp.args.required'), required: true }]}
254
+ tag={'args'}
249
255
  >
250
256
  <ArgsInput placeholder={t('dev.mcp.args.placeholder')} />
251
257
  </FormItem>
258
+ <FormItem
259
+ extra={t('dev.mcp.env.desc')}
260
+ label={t('dev.mcp.env.label')}
261
+ name={STDIO_ENV}
262
+ tag={'env'}
263
+ >
264
+ <EnvEditor />
265
+ </FormItem>
252
266
  </>
253
267
  )}
254
268
  <FormItem colon={false} label={t('dev.mcp.testConnectionTip')} layout={'horizontal'}>
@@ -107,6 +107,4 @@ export const useRegisterChatHotkeys = () => {
107
107
  enableScope(HotkeyScopeEnum.Chat);
108
108
  return () => disableScope(HotkeyScopeEnum.Chat);
109
109
  }, []);
110
-
111
- return null;
112
110
  };
@@ -32,6 +32,4 @@ export const useRegisterFilesHotkeys = () => {
32
32
  enableScope(HotkeyScopeEnum.Files);
33
33
  return () => disableScope(HotkeyScopeEnum.Files);
34
34
  }, []);
35
-
36
- return null;
37
35
  };
@@ -18,6 +18,17 @@ export const LobeOpenAI = LobeOpenAICompatibleFactory({
18
18
  return pruneReasoningPayload(payload) as any;
19
19
  }
20
20
 
21
+ if (model.includes('-search-')) {
22
+ return {
23
+ ...payload,
24
+ frequency_penalty: undefined,
25
+ presence_penalty: undefined,
26
+ stream: payload.stream ?? true,
27
+ temperature: undefined,
28
+ top_p: undefined,
29
+ };
30
+ }
31
+
21
32
  return { ...payload, stream: payload.stream ?? true };
22
33
  },
23
34
  },
@@ -1,5 +1,8 @@
1
1
  import { Client } from '@modelcontextprotocol/sdk/client/index.js';
2
- import { StdioClientTransport } from '@modelcontextprotocol/sdk/client/stdio.js';
2
+ import {
3
+ StdioClientTransport,
4
+ getDefaultEnvironment,
5
+ } from '@modelcontextprotocol/sdk/client/stdio.js';
3
6
  import { StreamableHTTPClientTransport } from '@modelcontextprotocol/sdk/client/streamableHttp.js';
4
7
  import type { Transport } from '@modelcontextprotocol/sdk/shared/transport.d.ts';
5
8
  import debug from 'debug';
@@ -24,9 +27,14 @@ export class MCPClient {
24
27
  }
25
28
  case 'stdio': {
26
29
  log('Using Stdio transport with command: %s and args: %O', params.command, params.args);
30
+
27
31
  this.transport = new StdioClientTransport({
28
32
  args: params.args,
29
33
  command: params.command,
34
+ env: {
35
+ ...getDefaultEnvironment(),
36
+ ...params.env,
37
+ },
30
38
  });
31
39
  break;
32
40
  }
@@ -20,6 +20,7 @@ interface HttpMCPClientParams {
20
20
  interface StdioMCPParams {
21
21
  args: string[];
22
22
  command: string;
23
+ env?: Record<string, string>;
23
24
  name: string;
24
25
  type: 'stdio';
25
26
  }
@@ -48,7 +48,7 @@ export default {
48
48
  },
49
49
  mcp: {
50
50
  args: {
51
- desc: '传递给 STDIO 命令的参数列表,一般在这里输入 MCP 服务器名称',
51
+ desc: '传递给执行命令的参数列表,一般在这里输入 MCP 服务器名称,或启动脚本路径',
52
52
  label: '命令参数',
53
53
  placeholder: '例如:mcp-hello-world',
54
54
  required: '请输入启动参数',
@@ -63,6 +63,15 @@ export default {
63
63
  desc: '输入你的 MCP Streamable HTTP Server 的地址',
64
64
  label: 'MCP Endpoint URL',
65
65
  },
66
+ env: {
67
+ add: '新增一行',
68
+ desc: '输入你的 MCP Server 所需要的环境变量',
69
+ duplicateKeyError: '字段键必须唯一',
70
+ formValidationFailed: '表单验证失败,请检查参数格式',
71
+ keyRequired: '字段键不能为空',
72
+ label: 'MCP Server 环境变量',
73
+ stringifyError: '无法序列化参数,请检查参数格式',
74
+ },
66
75
  identifier: {
67
76
  desc: '为你的 MCP 插件指定一个名称,需要使用英文字符',
68
77
  invalid: '标识符只能包含字母、数字、连字符和下划线',
@@ -33,6 +33,9 @@ export const getServerGlobalConfig = async () => {
33
33
  enabledKey: 'ENABLED_GITEE_AI',
34
34
  modelListKey: 'GITEE_AI_MODEL_LIST',
35
35
  },
36
+ lmstudio: {
37
+ fetchOnClient: isDesktop ? false : undefined,
38
+ },
36
39
  /* ↓ cloud slot ↓ */
37
40
 
38
41
  /* ↑ cloud slot ↑ */