@lobehub/lobehub 2.0.0-next.51 → 2.0.0-next.53

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 (107) hide show
  1. package/CHANGELOG.md +58 -0
  2. package/README.md +8 -8
  3. package/README.zh-CN.md +8 -8
  4. package/apps/desktop/package.json +1 -1
  5. package/apps/desktop/src/main/controllers/LocalFileCtr.ts +25 -5
  6. package/apps/desktop/src/main/controllers/__tests__/LocalFileCtr.test.ts +4 -1
  7. package/apps/desktop/src/main/modules/fileSearch/__tests__/macOS.integration.test.ts +357 -0
  8. package/apps/desktop/src/main/modules/fileSearch/impl/macOS.ts +30 -22
  9. package/changelog/v1.json +21 -0
  10. package/locales/ar/models.json +119 -126
  11. package/locales/ar/plugin.json +1 -1
  12. package/locales/bg-BG/models.json +104 -132
  13. package/locales/bg-BG/plugin.json +1 -1
  14. package/locales/de-DE/models.json +119 -126
  15. package/locales/de-DE/plugin.json +1 -1
  16. package/locales/en-US/models.json +167 -126
  17. package/locales/en-US/plugin.json +1 -1
  18. package/locales/es-ES/models.json +119 -126
  19. package/locales/es-ES/plugin.json +1 -1
  20. package/locales/fa-IR/models.json +119 -126
  21. package/locales/fa-IR/plugin.json +1 -1
  22. package/locales/fr-FR/models.json +119 -126
  23. package/locales/fr-FR/plugin.json +1 -1
  24. package/locales/it-IT/models.json +119 -126
  25. package/locales/it-IT/plugin.json +1 -1
  26. package/locales/ja-JP/models.json +119 -126
  27. package/locales/ja-JP/plugin.json +1 -1
  28. package/locales/ko-KR/models.json +119 -126
  29. package/locales/ko-KR/plugin.json +1 -1
  30. package/locales/nl-NL/models.json +119 -126
  31. package/locales/nl-NL/plugin.json +1 -1
  32. package/locales/pl-PL/models.json +119 -126
  33. package/locales/pl-PL/plugin.json +1 -1
  34. package/locales/pt-BR/models.json +119 -126
  35. package/locales/pt-BR/plugin.json +1 -1
  36. package/locales/ru-RU/models.json +119 -126
  37. package/locales/ru-RU/plugin.json +1 -1
  38. package/locales/tr-TR/models.json +119 -126
  39. package/locales/tr-TR/plugin.json +1 -1
  40. package/locales/vi-VN/models.json +119 -126
  41. package/locales/vi-VN/plugin.json +1 -1
  42. package/locales/zh-CN/models.json +173 -80
  43. package/locales/zh-CN/plugin.json +1 -1
  44. package/locales/zh-TW/models.json +119 -126
  45. package/locales/zh-TW/plugin.json +1 -1
  46. package/package.json +2 -2
  47. package/packages/const/src/models.ts +2 -0
  48. package/packages/electron-client-ipc/src/types/localSystem.ts +26 -2
  49. package/packages/electron-server-ipc/src/ipcClient.ts +31 -31
  50. package/packages/electron-server-ipc/src/ipcServer.ts +15 -15
  51. package/packages/model-bank/src/aiModels/aihubmix.ts +106 -2
  52. package/packages/model-bank/src/aiModels/openai.ts +107 -3
  53. package/packages/model-bank/src/aiModels/qwen.ts +76 -7
  54. package/packages/model-bank/src/types/aiModel.ts +1 -0
  55. package/packages/model-runtime/src/core/contextBuilders/openai.test.ts +58 -0
  56. package/packages/model-runtime/src/core/contextBuilders/openai.ts +24 -10
  57. package/packages/model-runtime/src/core/openaiCompatibleFactory/index.ts +3 -2
  58. package/packages/model-runtime/src/providers/openai/index.test.ts +44 -0
  59. package/packages/types/src/agent/chatConfig.ts +9 -0
  60. package/packages/types/src/tool/builtin.ts +6 -4
  61. package/src/app/[variants]/(main)/chat/components/WorkspaceLayout.tsx +32 -23
  62. package/src/features/ChatInput/ActionBar/Model/ControlsForm.tsx +12 -0
  63. package/src/features/ChatInput/ActionBar/Model/GPT51ReasoningEffortSlider.tsx +58 -0
  64. package/src/features/ChatItem/components/MessageContent.tsx +3 -1
  65. package/src/features/Conversation/Messages/Assistant/Tool/Render/LoadingPlaceholder/index.tsx +3 -3
  66. package/src/features/Conversation/Messages/Group/Tool/Render/Intervention/ApprovalActions.tsx +34 -13
  67. package/src/features/Conversation/Messages/Group/Tool/Render/Intervention/index.tsx +2 -2
  68. package/src/features/Conversation/Messages/Group/Tool/Render/LoadingPlaceholder/index.tsx +3 -3
  69. package/src/features/Conversation/Messages/User/index.tsx +11 -1
  70. package/src/features/PluginsUI/Render/BuiltinType/index.test.tsx +10 -4
  71. package/src/features/PluginsUI/Render/BuiltinType/index.tsx +2 -2
  72. package/src/libs/mcp/__tests__/__snapshots__/index.test.ts.snap +0 -6
  73. package/src/locales/default/chat.ts +2 -0
  74. package/src/locales/default/plugin.ts +1 -1
  75. package/src/services/chat/chat.test.ts +1 -0
  76. package/src/services/chat/index.ts +7 -0
  77. package/src/store/aiInfra/slices/aiProvider/__tests__/selectors.test.ts +62 -0
  78. package/src/store/aiInfra/slices/aiProvider/selectors.ts +1 -1
  79. package/src/store/chat/slices/aiChat/actions/conversationControl.ts +42 -0
  80. package/src/tools/code-interpreter/Render/index.tsx +1 -1
  81. package/src/tools/interventions.ts +28 -4
  82. package/src/tools/local-system/Intervention/RunCommand/index.tsx +4 -5
  83. package/src/tools/local-system/Placeholder/ListFiles.tsx +3 -5
  84. package/src/tools/local-system/Placeholder/SearchFiles.tsx +2 -5
  85. package/src/tools/local-system/Render/ListFiles/index.tsx +16 -21
  86. package/src/tools/local-system/Render/ReadLocalFile/ReadFileView.tsx +2 -1
  87. package/src/tools/local-system/Render/RenameLocalFile/index.tsx +15 -20
  88. package/src/tools/local-system/Render/RunCommand/index.tsx +67 -70
  89. package/src/tools/local-system/Render/SearchFiles/SearchQuery/index.tsx +0 -1
  90. package/src/tools/local-system/Render/SearchFiles/index.tsx +15 -20
  91. package/src/tools/local-system/Render/WriteFile/index.tsx +2 -8
  92. package/src/tools/local-system/index.ts +5 -4
  93. package/src/tools/local-system/systemRole.ts +1 -1
  94. package/src/tools/placeholders.ts +39 -8
  95. package/src/tools/renders.ts +56 -9
  96. package/src/tools/web-browsing/Placeholder/{PageContent.tsx → CrawlMultiPages.tsx} +4 -1
  97. package/src/tools/web-browsing/Placeholder/CrawlSinglePage.tsx +12 -0
  98. package/src/tools/web-browsing/Placeholder/Search.tsx +4 -4
  99. package/src/tools/web-browsing/Render/CrawlMultiPages.tsx +15 -0
  100. package/src/tools/web-browsing/Render/CrawlSinglePage.tsx +15 -0
  101. package/src/tools/web-browsing/Render/Search/index.tsx +39 -44
  102. package/packages/database/migrations/0044_add_tool_intervention.sql +0 -1
  103. package/src/tools/local-system/Intervention/index.tsx +0 -17
  104. package/src/tools/local-system/Placeholder/index.tsx +0 -25
  105. package/src/tools/local-system/Render/index.tsx +0 -42
  106. package/src/tools/web-browsing/Placeholder/index.tsx +0 -40
  107. package/src/tools/web-browsing/Render/index.tsx +0 -57
@@ -1,42 +0,0 @@
1
- import { LocalFileItem } from '@lobechat/electron-client-ipc';
2
- import { BuiltinRenderProps } from '@lobechat/types';
3
- import { memo } from 'react';
4
-
5
- import { LocalSystemApiName } from '@/tools/local-system';
6
-
7
- import ListFiles from './ListFiles';
8
- import ReadLocalFile from './ReadLocalFile';
9
- import RenameLocalFile from './RenameLocalFile';
10
- import RunCommand from './RunCommand';
11
- import SearchFiles from './SearchFiles';
12
- import WriteFile from './WriteFile';
13
-
14
- const RenderMap = {
15
- [LocalSystemApiName.searchLocalFiles]: SearchFiles,
16
- [LocalSystemApiName.listLocalFiles]: ListFiles,
17
- [LocalSystemApiName.readLocalFile]: ReadLocalFile,
18
- [LocalSystemApiName.renameLocalFile]: RenameLocalFile,
19
- [LocalSystemApiName.writeLocalFile]: WriteFile,
20
- [LocalSystemApiName.runCommand]: RunCommand,
21
- };
22
-
23
- const LocalFilesRender = memo<BuiltinRenderProps<LocalFileItem[]>>(
24
- ({ pluginState, apiName, messageId, pluginError, args }) => {
25
- const Render = RenderMap[apiName as any];
26
-
27
- if (!Render) return;
28
-
29
- return (
30
- <Render
31
- args={args}
32
- messageId={messageId}
33
- pluginError={pluginError}
34
- pluginState={pluginState}
35
- />
36
- );
37
- },
38
- );
39
-
40
- LocalFilesRender.displayName = 'LocalFilesRender';
41
-
42
- export default LocalFilesRender;
@@ -1,40 +0,0 @@
1
- import {
2
- BuiltinPlaceholderProps,
3
- CrawlMultiPagesQuery,
4
- CrawlSinglePageQuery,
5
- SearchQuery,
6
- } from '@lobechat/types';
7
- import { Skeleton } from 'antd';
8
- import { memo } from 'react';
9
-
10
- import { WebBrowsingApiName } from '@/tools/web-browsing';
11
-
12
- import PageContent from './PageContent';
13
- import { Search } from './Search';
14
-
15
- const Placeholder = memo<BuiltinPlaceholderProps>(({ apiName, args }) => {
16
- switch (apiName) {
17
- case WebBrowsingApiName.search: {
18
- const { query } = args as SearchQuery;
19
- return <Search query={query} />;
20
- }
21
-
22
- case WebBrowsingApiName.crawlSinglePage: {
23
- const { url } = args as CrawlSinglePageQuery;
24
-
25
- return <PageContent urls={[url]} />;
26
- }
27
-
28
- case WebBrowsingApiName.crawlMultiPages: {
29
- const { urls } = args as CrawlMultiPagesQuery;
30
-
31
- return <PageContent urls={urls} />;
32
- }
33
-
34
- default: {
35
- return <Skeleton.Button />;
36
- }
37
- }
38
- });
39
-
40
- export default Placeholder;
@@ -1,57 +0,0 @@
1
- import {
2
- BuiltinRenderProps,
3
- CrawlMultiPagesQuery,
4
- CrawlPluginState,
5
- CrawlSinglePageQuery,
6
- SearchContent,
7
- SearchQuery,
8
- UniformSearchResponse,
9
- } from '@lobechat/types';
10
- import { memo } from 'react';
11
-
12
- import { WebBrowsingApiName } from '@/tools/web-browsing';
13
- import PageContent from '@/tools/web-browsing/Render/PageContent';
14
-
15
- import Search from './Search';
16
-
17
- const WebBrowsing = memo<BuiltinRenderProps<SearchContent[]>>(
18
- ({ messageId, args, pluginState, pluginError, apiName }) => {
19
- switch (apiName) {
20
- case WebBrowsingApiName.search:
21
- case 'searchWithSearXNG': {
22
- return (
23
- <Search
24
- messageId={messageId}
25
- pluginError={pluginError}
26
- searchQuery={(args as SearchQuery) || {}}
27
- searchResponse={pluginState as UniformSearchResponse}
28
- />
29
- );
30
- }
31
-
32
- case WebBrowsingApiName.crawlSinglePage: {
33
- return (
34
- <PageContent
35
- messageId={messageId}
36
- results={(pluginState as CrawlPluginState)?.results}
37
- urls={[(args as CrawlSinglePageQuery)?.url]}
38
- />
39
- );
40
- }
41
-
42
- case WebBrowsingApiName.crawlMultiPages: {
43
- return (
44
- <PageContent
45
- messageId={messageId}
46
- results={(pluginState as CrawlPluginState)?.results}
47
- urls={(args as CrawlMultiPagesQuery)?.urls}
48
- />
49
- );
50
- }
51
- }
52
- },
53
- );
54
-
55
- WebBrowsing.displayName = 'WebBrowsing';
56
-
57
- export default WebBrowsing;