@lobehub/lobehub 2.0.0-next.273 → 2.0.0-next.275
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/CHANGELOG.md +59 -0
- package/changelog/v1.json +18 -0
- package/locales/ar/chat.json +7 -0
- package/locales/ar/models.json +2 -3
- package/locales/ar/plugin.json +22 -1
- package/locales/bg-BG/chat.json +7 -0
- package/locales/bg-BG/models.json +3 -3
- package/locales/bg-BG/plugin.json +22 -1
- package/locales/de-DE/chat.json +7 -0
- package/locales/de-DE/models.json +3 -4
- package/locales/de-DE/plugin.json +22 -1
- package/locales/en-US/chat.json +7 -0
- package/locales/en-US/models.json +5 -5
- package/locales/en-US/plugin.json +22 -1
- package/locales/es-ES/chat.json +7 -0
- package/locales/es-ES/models.json +3 -4
- package/locales/es-ES/plugin.json +22 -1
- package/locales/fa-IR/chat.json +7 -0
- package/locales/fa-IR/models.json +3 -4
- package/locales/fa-IR/plugin.json +22 -1
- package/locales/fr-FR/chat.json +7 -0
- package/locales/fr-FR/models.json +50 -3
- package/locales/fr-FR/plugin.json +22 -1
- package/locales/it-IT/chat.json +7 -0
- package/locales/it-IT/models.json +3 -3
- package/locales/it-IT/plugin.json +22 -1
- package/locales/ja-JP/chat.json +7 -0
- package/locales/ja-JP/models.json +43 -4
- package/locales/ja-JP/plugin.json +22 -1
- package/locales/ko-KR/chat.json +7 -0
- package/locales/ko-KR/models.json +3 -4
- package/locales/ko-KR/plugin.json +22 -1
- package/locales/nl-NL/chat.json +7 -0
- package/locales/nl-NL/models.json +51 -3
- package/locales/nl-NL/plugin.json +22 -1
- package/locales/pl-PL/chat.json +7 -0
- package/locales/pl-PL/models.json +3 -3
- package/locales/pl-PL/plugin.json +22 -1
- package/locales/pt-BR/chat.json +7 -0
- package/locales/pt-BR/models.json +3 -4
- package/locales/pt-BR/plugin.json +22 -1
- package/locales/ru-RU/chat.json +7 -0
- package/locales/ru-RU/models.json +3 -4
- package/locales/ru-RU/plugin.json +22 -1
- package/locales/tr-TR/chat.json +7 -0
- package/locales/tr-TR/models.json +3 -4
- package/locales/tr-TR/plugin.json +22 -1
- package/locales/vi-VN/chat.json +7 -0
- package/locales/vi-VN/models.json +3 -3
- package/locales/vi-VN/plugin.json +22 -1
- package/locales/zh-CN/chat.json +7 -0
- package/locales/zh-CN/models.json +54 -4
- package/locales/zh-CN/plugin.json +22 -1
- package/locales/zh-TW/chat.json +7 -0
- package/locales/zh-TW/models.json +43 -4
- package/locales/zh-TW/plugin.json +22 -1
- package/package.json +2 -2
- package/packages/builtin-tool-agent-builder/package.json +1 -0
- package/packages/builtin-tool-agent-builder/src/client/Inspector/GetAvailableModels/index.tsx +66 -0
- package/packages/builtin-tool-agent-builder/src/client/Inspector/InstallPlugin/index.tsx +63 -0
- package/packages/builtin-tool-agent-builder/src/client/Inspector/SearchMarketTools/index.tsx +64 -0
- package/packages/builtin-tool-agent-builder/src/client/Inspector/UpdateConfig/index.tsx +94 -0
- package/packages/builtin-tool-agent-builder/src/client/Inspector/UpdatePrompt/index.tsx +96 -0
- package/packages/builtin-tool-agent-builder/src/client/Inspector/index.ts +29 -0
- package/packages/builtin-tool-agent-builder/src/client/index.ts +13 -0
- package/packages/builtin-tool-agent-builder/src/executor.ts +132 -0
- package/packages/builtin-tool-cloud-sandbox/src/client/Inspector/ExecuteCode/index.tsx +5 -14
- package/packages/builtin-tool-cloud-sandbox/src/client/Inspector/RunCommand/index.tsx +5 -13
- package/packages/builtin-tool-group-agent-builder/package.json +7 -1
- package/packages/builtin-tool-group-agent-builder/src/ExecutionRuntime/index.ts +331 -87
- package/packages/builtin-tool-group-agent-builder/src/client/Inspector/BatchCreateAgents/index.tsx +110 -0
- package/packages/builtin-tool-group-agent-builder/src/client/Inspector/CreateAgent/index.tsx +72 -0
- package/packages/builtin-tool-group-agent-builder/src/client/Inspector/InviteAgent/index.tsx +57 -0
- package/packages/builtin-tool-group-agent-builder/src/client/Inspector/RemoveAgent/index.tsx +57 -0
- package/packages/builtin-tool-group-agent-builder/src/client/Inspector/SearchAgent/index.tsx +66 -0
- package/packages/builtin-tool-group-agent-builder/src/client/Inspector/UpdateAgentPrompt/index.tsx +120 -0
- package/packages/builtin-tool-group-agent-builder/src/client/Inspector/UpdateGroup/index.tsx +87 -0
- package/packages/builtin-tool-group-agent-builder/src/client/Inspector/UpdateGroupPrompt/index.tsx +99 -0
- package/packages/builtin-tool-group-agent-builder/src/client/Inspector/index.ts +52 -0
- package/packages/builtin-tool-group-agent-builder/src/client/Render/BatchCreateAgents.tsx +103 -0
- package/packages/builtin-tool-group-agent-builder/src/client/Render/UpdateAgentPrompt/index.tsx +36 -0
- package/packages/builtin-tool-group-agent-builder/src/client/Render/UpdateGroupPrompt/index.tsx +36 -0
- package/packages/builtin-tool-group-agent-builder/src/client/Render/index.ts +16 -0
- package/packages/builtin-tool-group-agent-builder/src/client/Streaming/BatchCreateAgents/index.tsx +88 -0
- package/packages/builtin-tool-group-agent-builder/src/client/Streaming/UpdateAgentPrompt/index.tsx +37 -0
- package/packages/builtin-tool-group-agent-builder/src/client/Streaming/UpdateGroupPrompt/index.tsx +35 -0
- package/packages/builtin-tool-group-agent-builder/src/client/Streaming/index.ts +22 -0
- package/packages/builtin-tool-group-agent-builder/src/client/index.ts +26 -0
- package/packages/builtin-tool-group-agent-builder/src/executor.ts +284 -0
- package/packages/builtin-tool-group-agent-builder/src/index.ts +1 -14
- package/packages/builtin-tool-group-agent-builder/src/manifest.ts +160 -15
- package/packages/builtin-tool-group-agent-builder/src/systemRole.ts +232 -46
- package/packages/builtin-tool-group-agent-builder/src/types.ts +191 -41
- package/packages/builtin-tool-group-management/src/client/Inspector/Broadcast/index.tsx +2 -2
- package/packages/builtin-tool-group-management/src/manifest.ts +1 -1
- package/packages/builtin-tool-gtd/src/client/Inspector/ClearTodos/index.tsx +5 -11
- package/packages/builtin-tool-gtd/src/client/Inspector/CompleteTodos/index.tsx +3 -9
- package/packages/builtin-tool-gtd/src/client/Inspector/CreatePlan/index.tsx +6 -15
- package/packages/builtin-tool-gtd/src/client/Inspector/CreateTodos/index.tsx +3 -9
- package/packages/builtin-tool-gtd/src/client/Inspector/ExecTask/index.tsx +6 -17
- package/packages/builtin-tool-gtd/src/client/Inspector/RemoveTodos/index.tsx +3 -9
- package/packages/builtin-tool-gtd/src/client/Inspector/UpdatePlan/index.tsx +3 -9
- package/packages/builtin-tool-gtd/src/client/Inspector/UpdateTodos/index.tsx +3 -9
- package/packages/builtin-tool-knowledge-base/src/client/Inspector/ReadKnowledge/index.tsx +4 -16
- package/packages/builtin-tool-knowledge-base/src/client/Inspector/SearchKnowledgeBase/index.tsx +5 -16
- package/packages/builtin-tool-local-system/src/client/Inspector/EditLocalFile/index.tsx +4 -12
- package/packages/builtin-tool-local-system/src/client/Inspector/GlobLocalFiles/index.tsx +5 -13
- package/packages/builtin-tool-local-system/src/client/Inspector/GrepContent/index.tsx +5 -16
- package/packages/builtin-tool-local-system/src/client/Inspector/ListLocalFiles/index.tsx +5 -16
- package/packages/builtin-tool-local-system/src/client/Inspector/ReadLocalFile/index.tsx +5 -16
- package/packages/builtin-tool-local-system/src/client/Inspector/RenameLocalFile/index.tsx +5 -11
- package/packages/builtin-tool-local-system/src/client/Inspector/RunCommand/index.tsx +5 -13
- package/packages/builtin-tool-local-system/src/client/Inspector/SearchLocalFiles/index.tsx +5 -16
- package/packages/builtin-tool-local-system/src/client/Inspector/WriteLocalFile/index.tsx +6 -15
- package/packages/builtin-tool-notebook/src/client/Inspector/CreateDocument/index.tsx +7 -15
- package/packages/builtin-tool-page-agent/src/client/Inspector/EditTitle/index.tsx +5 -14
- package/packages/builtin-tool-page-agent/src/client/Inspector/GetPageContent/index.tsx +7 -8
- package/packages/builtin-tool-page-agent/src/client/Inspector/InitPage/index.tsx +4 -10
- package/packages/builtin-tool-page-agent/src/client/Inspector/ModifyNodes/index.tsx +3 -9
- package/packages/builtin-tool-page-agent/src/client/Inspector/ReplaceText/index.tsx +5 -11
- package/packages/builtin-tool-web-browsing/src/client/Inspector/CrawlMultiPages/index.tsx +6 -15
- package/packages/builtin-tool-web-browsing/src/client/Inspector/CrawlSinglePage/index.tsx +6 -15
- package/packages/builtin-tool-web-browsing/src/client/Inspector/Search/index.tsx +4 -15
- package/packages/database/src/models/chatGroup.ts +1 -1
- package/packages/model-bank/src/aiModels/aihubmix.ts +2 -1
- package/packages/model-bank/src/aiModels/google.ts +2 -1
- package/packages/model-bank/src/aiModels/infiniai.ts +9 -6
- package/packages/model-bank/src/aiModels/minimax.ts +9 -5
- package/packages/model-bank/src/aiModels/ollamacloud.ts +4 -2
- package/packages/model-bank/src/aiModels/vertexai.ts +2 -1
- package/packages/types/src/agentGroup/index.ts +8 -0
- package/patches/@upstash__qstash.patch +13 -1
- package/src/app/[variants]/(main)/agent/_layout/Sidebar/Header/Nav.tsx +1 -1
- package/src/app/[variants]/(main)/agent/cron/[cronId]/index.tsx +4 -3
- package/src/app/[variants]/(main)/agent/profile/features/ProfileEditor/index.tsx +1 -1
- package/src/app/[variants]/(main)/agent/profile/features/store/action.ts +18 -21
- package/src/app/[variants]/(main)/community/(detail)/features/MakedownRender.tsx +8 -6
- package/src/app/[variants]/(main)/group/_layout/GroupIdSync.tsx +6 -1
- package/src/app/[variants]/(main)/group/_layout/Sidebar/GroupConfig/AgentProfilePopup.tsx +29 -21
- package/src/app/[variants]/(main)/group/_layout/Sidebar/GroupConfig/GroupMember.tsx +1 -0
- package/src/app/[variants]/(main)/group/_layout/Sidebar/GroupConfig/GroupMemberItem.tsx +35 -18
- package/src/app/[variants]/(main)/group/_layout/Sidebar/Header/AddTopicButon.tsx +2 -10
- package/src/app/[variants]/(main)/group/_layout/Sidebar/Header/Nav.tsx +10 -2
- package/src/app/[variants]/(main)/group/_layout/Sidebar/Header/index.tsx +1 -2
- package/src/app/[variants]/(main)/group/profile/features/AgentBuilder/AgentBuilderProvider.tsx +1 -0
- package/src/app/[variants]/(main)/group/profile/features/AgentBuilder/TopicSelector.tsx +15 -9
- package/src/app/[variants]/(main)/group/profile/features/AgentBuilder/index.tsx +12 -6
- package/src/app/[variants]/(main)/group/profile/features/{ProfileEditor/AgentHeader.tsx → GroupProfile/GroupHeader.tsx} +22 -29
- package/src/app/[variants]/(main)/group/profile/features/GroupProfile/index.tsx +96 -0
- package/src/app/[variants]/(main)/group/profile/features/Header/AgentBuilderToggle.tsx +3 -4
- package/src/app/[variants]/(main)/group/profile/features/Header/AutoSaveHint.tsx +11 -7
- package/src/app/[variants]/(main)/group/profile/features/Header/ChromeTabs/index.tsx +147 -0
- package/src/app/[variants]/(main)/group/profile/features/Header/index.tsx +104 -13
- package/src/app/[variants]/(main)/group/profile/features/MemberProfile/AgentHeader.tsx +222 -0
- package/src/app/[variants]/(main)/group/profile/features/MemberProfile/index.tsx +155 -0
- package/src/app/[variants]/(main)/group/profile/features/ProfileHydration.tsx +63 -5
- package/src/app/[variants]/(main)/group/profile/index.tsx +34 -37
- package/src/app/[variants]/(main)/settings/proxy/features/ProxyForm.tsx +156 -253
- package/src/app/[variants]/(main)/settings/proxy/index.tsx +1 -3
- package/src/app/[variants]/(mobile)/(home)/_layout/SessionHydration.tsx +1 -1
- package/src/app/[variants]/(mobile)/(home)/features/SessionListContent/List/Item/index.tsx +1 -1
- package/src/features/AgentBuilder/index.tsx +16 -1
- package/src/features/Conversation/Messages/AssistantGroup/Tool/Inspector/StatusIndicator.tsx +3 -2
- package/src/features/Conversation/Messages/User/useMarkdown.tsx +1 -0
- package/src/features/EditorCanvas/EditorCanvas.test.tsx +206 -0
- package/src/features/EditorCanvas/EditorDataMode.tsx +53 -19
- package/src/features/EditorModal/index.tsx +2 -2
- package/src/features/NavPanel/components/SessionHydration.tsx +1 -1
- package/src/features/PageEditor/EditorCanvas/useAskCopilotItem.tsx +10 -6
- package/src/features/PageEditor/Header/index.tsx +12 -10
- package/src/features/PageEditor/Header/useMenu.tsx +45 -48
- package/src/features/RightPanel/ToggleRightPanelButton.tsx +3 -1
- package/src/features/ShareModal/ShareImage/ChatList/index.tsx +1 -1
- package/src/features/ShareModal/SharePdf/index.tsx +1 -1
- package/src/hooks/useBidirectionalQuerySync.ts +112 -0
- package/src/locales/default/chat.ts +10 -0
- package/src/locales/default/plugin.ts +22 -1
- package/src/server/modules/AgentRuntime/RuntimeExecutors.ts +45 -45
- package/src/server/modules/KeyVaultsEncrypt/index.ts +6 -6
- package/src/server/modules/S3/index.ts +1 -1
- package/src/server/routers/lambda/agent.ts +24 -0
- package/src/server/routers/lambda/agentGroup.ts +39 -0
- package/src/services/agent.ts +22 -0
- package/src/services/chatGroup/index.ts +14 -0
- package/src/store/agent/selectors/selectors.ts +3 -0
- package/src/store/agentGroup/initialState.ts +6 -0
- package/src/store/agentGroup/selectors/byId.ts +3 -1
- package/src/store/agentGroup/selectors/current.ts +2 -2
- package/src/store/agentGroup/slices/lifecycle.ts +18 -0
- package/src/store/chat/agents/__tests__/createAgentExecutors/fixtures/mockStore.ts +1 -1
- package/src/store/chat/slices/aiAgent/actions/__tests__/agentGroup.test.ts +4 -1
- package/src/store/chat/slices/aiAgent/actions/agentGroup.ts +1 -1
- package/src/store/chat/slices/aiChat/actions/__tests__/conversationLifecycle.test.ts +65 -0
- package/src/store/chat/slices/aiChat/actions/conversationLifecycle.ts +2 -1
- package/src/store/chat/slices/builtinTool/actions/__tests__/search.test.ts +1 -1
- package/src/store/chat/slices/builtinTool/actions/index.ts +1 -6
- package/src/store/chat/slices/message/action.test.ts +5 -5
- package/src/store/chat/slices/message/actions/publicApi.ts +5 -5
- package/src/store/chat/slices/message/initialState.ts +0 -5
- package/src/store/chat/slices/message/selectors/displayMessage.test.ts +4 -4
- package/src/store/chat/slices/plugin/action.test.ts +54 -19
- package/src/store/chat/slices/plugin/actions/pluginTypes.ts +15 -21
- package/src/store/chat/slices/topic/action.test.ts +74 -24
- package/src/store/chat/slices/topic/action.ts +21 -13
- package/src/store/chat/slices/topic/selectors.test.ts +1 -1
- package/src/store/global/initialState.ts +10 -0
- package/src/store/global/selectors/systemStatus.ts +5 -0
- package/src/store/groupProfile/action.ts +168 -0
- package/src/store/groupProfile/index.ts +16 -0
- package/src/{app/[variants]/(main)/group/profile/features/store → store/groupProfile}/initialState.ts +17 -0
- package/src/store/groupProfile/selectors.ts +13 -0
- package/src/store/tool/slices/builtin/executors/index.ts +4 -0
- package/src/styles/text.ts +16 -0
- package/src/tools/inspectors.ts +13 -0
- package/src/tools/renders.ts +3 -0
- package/src/tools/streamings.ts +8 -0
- package/tests/mocks/lru_map.ts +40 -0
- package/vitest.config.mts +9 -1
- package/src/app/[variants]/(main)/group/profile/features/EditorCanvas/TypoBar.tsx +0 -129
- package/src/app/[variants]/(main)/group/profile/features/EditorCanvas/index.tsx +0 -138
- package/src/app/[variants]/(main)/group/profile/features/EditorCanvas/useSlashItems.tsx +0 -139
- package/src/app/[variants]/(main)/group/profile/features/ProfileEditor/index.tsx +0 -82
- package/src/app/[variants]/(main)/group/profile/features/ProfileProvider.tsx +0 -20
- package/src/app/[variants]/(main)/group/profile/features/StoreUpdater.tsx +0 -24
- package/src/app/[variants]/(main)/group/profile/features/store/action.ts +0 -163
- package/src/app/[variants]/(main)/group/profile/features/store/index.ts +0 -23
- package/src/app/[variants]/(main)/group/profile/features/store/selectors.ts +0 -7
- package/src/features/EditorModal/EditorCanvas.tsx +0 -84
- package/src/features/EditorModal/Typobar.tsx +0 -139
- package/src/store/chat/slices/builtinTool/actions/agentBuilder.ts +0 -192
- package/src/store/chat/slices/builtinTool/actions/groupAgentBuilder.ts +0 -242
- package/src/tools/executionRuntimes.ts +0 -14
- /package/src/app/[variants]/(main)/group/profile/features/{ProfileEditor → MemberProfile}/AgentTool.tsx +0 -0
- /package/src/app/[variants]/(main)/group/profile/features/{ProfileEditor → MemberProfile}/MentionList/MentionDropdown.tsx +0 -0
- /package/src/app/[variants]/(main)/group/profile/features/{ProfileEditor → MemberProfile}/MentionList/index.tsx +0 -0
- /package/src/app/[variants]/(main)/group/profile/features/{ProfileEditor → MemberProfile}/MentionList/types.ts +0 -0
- /package/src/app/[variants]/(main)/group/profile/features/{ProfileEditor → MemberProfile}/MentionList/useMentionItems.tsx +0 -0
|
@@ -5,7 +5,7 @@ import { createStaticStyles, cx } from 'antd-style';
|
|
|
5
5
|
import { memo } from 'react';
|
|
6
6
|
import { useTranslation } from 'react-i18next';
|
|
7
7
|
|
|
8
|
-
import { highlightTextStyles, shinyTextStyles } from '@/styles';
|
|
8
|
+
import { highlightTextStyles, inspectorTextStyles, shinyTextStyles } from '@/styles';
|
|
9
9
|
|
|
10
10
|
import { type ReadKnowledgeArgs, type ReadKnowledgeState } from '../../..';
|
|
11
11
|
|
|
@@ -14,18 +14,6 @@ const styles = createStaticStyles(({ css, cssVar }) => ({
|
|
|
14
14
|
margin-inline-start: 4px;
|
|
15
15
|
color: ${cssVar.colorTextTertiary};
|
|
16
16
|
`,
|
|
17
|
-
root: css`
|
|
18
|
-
overflow: hidden;
|
|
19
|
-
display: -webkit-box;
|
|
20
|
-
-webkit-box-orient: vertical;
|
|
21
|
-
-webkit-line-clamp: 1;
|
|
22
|
-
|
|
23
|
-
color: ${cssVar.colorTextSecondary};
|
|
24
|
-
`,
|
|
25
|
-
statusIcon: css`
|
|
26
|
-
margin-block-end: -2px;
|
|
27
|
-
margin-inline-start: 4px;
|
|
28
|
-
`,
|
|
29
17
|
}));
|
|
30
18
|
|
|
31
19
|
export const ReadKnowledgeInspector = memo<
|
|
@@ -43,13 +31,13 @@ export const ReadKnowledgeInspector = memo<
|
|
|
43
31
|
if (isArgumentsStreaming) {
|
|
44
32
|
if (fileCount === 0)
|
|
45
33
|
return (
|
|
46
|
-
<div className={cx(
|
|
34
|
+
<div className={cx(inspectorTextStyles.root, shinyTextStyles.shinyText)}>
|
|
47
35
|
<span>{t('builtins.lobe-knowledge-base.apiName.readKnowledge')}</span>
|
|
48
36
|
</div>
|
|
49
37
|
);
|
|
50
38
|
|
|
51
39
|
return (
|
|
52
|
-
<div className={cx(
|
|
40
|
+
<div className={cx(inspectorTextStyles.root, shinyTextStyles.shinyText)}>
|
|
53
41
|
<span>{t('builtins.lobe-knowledge-base.apiName.readKnowledge')}: </span>
|
|
54
42
|
<span className={highlightTextStyles.gold}>
|
|
55
43
|
{fileCount} {fileCount === 1 ? 'file' : 'files'}
|
|
@@ -85,7 +73,7 @@ export const ReadKnowledgeInspector = memo<
|
|
|
85
73
|
};
|
|
86
74
|
|
|
87
75
|
return (
|
|
88
|
-
<div className={cx(
|
|
76
|
+
<div className={cx(inspectorTextStyles.root, isLoading && shinyTextStyles.shinyText)}>
|
|
89
77
|
<span style={{ marginInlineStart: 2 }}>
|
|
90
78
|
<span>{t('builtins.lobe-knowledge-base.apiName.readKnowledge')}: </span>
|
|
91
79
|
{renderFileInfo()}
|
package/packages/builtin-tool-knowledge-base/src/client/Inspector/SearchKnowledgeBase/index.tsx
CHANGED
|
@@ -2,25 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
import { type BuiltinInspectorProps } from '@lobechat/types';
|
|
4
4
|
import { Text } from '@lobehub/ui';
|
|
5
|
-
import {
|
|
5
|
+
import { cssVar, cx } from 'antd-style';
|
|
6
6
|
import { memo } from 'react';
|
|
7
7
|
import { useTranslation } from 'react-i18next';
|
|
8
8
|
|
|
9
|
-
import { highlightTextStyles, shinyTextStyles } from '@/styles';
|
|
9
|
+
import { highlightTextStyles, inspectorTextStyles, shinyTextStyles } from '@/styles';
|
|
10
10
|
|
|
11
11
|
import { type SearchKnowledgeBaseArgs, type SearchKnowledgeBaseState } from '../../..';
|
|
12
12
|
|
|
13
|
-
const styles = createStaticStyles(({ css, cssVar }) => ({
|
|
14
|
-
root: css`
|
|
15
|
-
overflow: hidden;
|
|
16
|
-
display: -webkit-box;
|
|
17
|
-
-webkit-box-orient: vertical;
|
|
18
|
-
-webkit-line-clamp: 1;
|
|
19
|
-
|
|
20
|
-
color: ${cssVar.colorTextSecondary};
|
|
21
|
-
`,
|
|
22
|
-
}));
|
|
23
|
-
|
|
24
13
|
export const SearchKnowledgeBaseInspector = memo<
|
|
25
14
|
BuiltinInspectorProps<SearchKnowledgeBaseArgs, SearchKnowledgeBaseState>
|
|
26
15
|
>(({ args, partialArgs, isArgumentsStreaming, isLoading, pluginState }) => {
|
|
@@ -35,13 +24,13 @@ export const SearchKnowledgeBaseInspector = memo<
|
|
|
35
24
|
if (isArgumentsStreaming) {
|
|
36
25
|
if (!query)
|
|
37
26
|
return (
|
|
38
|
-
<div className={cx(
|
|
27
|
+
<div className={cx(inspectorTextStyles.root, shinyTextStyles.shinyText)}>
|
|
39
28
|
<span>{t('builtins.lobe-knowledge-base.apiName.searchKnowledgeBase')}</span>
|
|
40
29
|
</div>
|
|
41
30
|
);
|
|
42
31
|
|
|
43
32
|
return (
|
|
44
|
-
<div className={cx(
|
|
33
|
+
<div className={cx(inspectorTextStyles.root, shinyTextStyles.shinyText)}>
|
|
45
34
|
<span>{t('builtins.lobe-knowledge-base.apiName.searchKnowledgeBase')}: </span>
|
|
46
35
|
<span className={highlightTextStyles.gold}>{query}</span>
|
|
47
36
|
</div>
|
|
@@ -49,7 +38,7 @@ export const SearchKnowledgeBaseInspector = memo<
|
|
|
49
38
|
}
|
|
50
39
|
|
|
51
40
|
return (
|
|
52
|
-
<div className={cx(
|
|
41
|
+
<div className={cx(inspectorTextStyles.root, isLoading && shinyTextStyles.shinyText)}>
|
|
53
42
|
<span style={{ marginInlineStart: 2 }}>
|
|
54
43
|
<span>{t('builtins.lobe-knowledge-base.apiName.searchKnowledgeBase')}: </span>
|
|
55
44
|
{query && <span className={highlightTextStyles.gold}>{query}</span>}
|
|
@@ -8,20 +8,12 @@ import { Minus, Plus } from 'lucide-react';
|
|
|
8
8
|
import { type ReactNode, memo } from 'react';
|
|
9
9
|
import { useTranslation } from 'react-i18next';
|
|
10
10
|
|
|
11
|
-
import { shinyTextStyles } from '@/styles';
|
|
11
|
+
import { inspectorTextStyles, shinyTextStyles } from '@/styles';
|
|
12
12
|
|
|
13
13
|
import { type EditLocalFileState } from '../../../types';
|
|
14
14
|
import { FilePathDisplay } from '../../components/FilePathDisplay';
|
|
15
15
|
|
|
16
16
|
const styles = createStaticStyles(({ css, cssVar }) => ({
|
|
17
|
-
root: css`
|
|
18
|
-
overflow: hidden;
|
|
19
|
-
display: -webkit-box;
|
|
20
|
-
-webkit-box-orient: vertical;
|
|
21
|
-
-webkit-line-clamp: 1;
|
|
22
|
-
|
|
23
|
-
color: ${cssVar.colorTextSecondary};
|
|
24
|
-
`,
|
|
25
17
|
separator: css`
|
|
26
18
|
margin-inline: 2px;
|
|
27
19
|
color: ${cssVar.colorTextQuaternary};
|
|
@@ -39,13 +31,13 @@ export const EditLocalFileInspector = memo<
|
|
|
39
31
|
if (isArgumentsStreaming) {
|
|
40
32
|
if (!filePath)
|
|
41
33
|
return (
|
|
42
|
-
<div className={cx(
|
|
34
|
+
<div className={cx(inspectorTextStyles.root, shinyTextStyles.shinyText)}>
|
|
43
35
|
<span>{t('builtins.lobe-local-system.apiName.editLocalFile')}</span>
|
|
44
36
|
</div>
|
|
45
37
|
);
|
|
46
38
|
|
|
47
39
|
return (
|
|
48
|
-
<div className={cx(
|
|
40
|
+
<div className={cx(inspectorTextStyles.root, shinyTextStyles.shinyText)}>
|
|
49
41
|
<span>{t('builtins.lobe-local-system.apiName.editLocalFile')}: </span>
|
|
50
42
|
<FilePathDisplay filePath={filePath} />
|
|
51
43
|
</div>
|
|
@@ -75,7 +67,7 @@ export const EditLocalFileInspector = memo<
|
|
|
75
67
|
}
|
|
76
68
|
|
|
77
69
|
return (
|
|
78
|
-
<div className={cx(
|
|
70
|
+
<div className={cx(inspectorTextStyles.root, isLoading && shinyTextStyles.shinyText)}>
|
|
79
71
|
<span>{t('builtins.lobe-local-system.apiName.editLocalFile')}: </span>
|
|
80
72
|
<FilePathDisplay filePath={filePath} />
|
|
81
73
|
{!isLoading && statsParts.length > 0 && (
|
|
@@ -7,19 +7,11 @@ import { Check, X } from 'lucide-react';
|
|
|
7
7
|
import { memo } from 'react';
|
|
8
8
|
import { useTranslation } from 'react-i18next';
|
|
9
9
|
|
|
10
|
-
import { highlightTextStyles, shinyTextStyles } from '@/styles';
|
|
10
|
+
import { highlightTextStyles, inspectorTextStyles, shinyTextStyles } from '@/styles';
|
|
11
11
|
|
|
12
12
|
import { type GlobFilesState } from '../../..';
|
|
13
13
|
|
|
14
|
-
const styles = createStaticStyles(({ css
|
|
15
|
-
root: css`
|
|
16
|
-
overflow: hidden;
|
|
17
|
-
display: -webkit-box;
|
|
18
|
-
-webkit-box-orient: vertical;
|
|
19
|
-
-webkit-line-clamp: 1;
|
|
20
|
-
|
|
21
|
-
color: ${cssVar.colorTextSecondary};
|
|
22
|
-
`,
|
|
14
|
+
const styles = createStaticStyles(({ css }) => ({
|
|
23
15
|
statusIcon: css`
|
|
24
16
|
margin-block-end: -2px;
|
|
25
17
|
margin-inline-start: 4px;
|
|
@@ -36,13 +28,13 @@ export const GlobLocalFilesInspector = memo<BuiltinInspectorProps<GlobFilesParam
|
|
|
36
28
|
if (isArgumentsStreaming) {
|
|
37
29
|
if (!pattern)
|
|
38
30
|
return (
|
|
39
|
-
<div className={cx(
|
|
31
|
+
<div className={cx(inspectorTextStyles.root, shinyTextStyles.shinyText)}>
|
|
40
32
|
<span>{t('builtins.lobe-local-system.apiName.globLocalFiles')}</span>
|
|
41
33
|
</div>
|
|
42
34
|
);
|
|
43
35
|
|
|
44
36
|
return (
|
|
45
|
-
<div className={cx(
|
|
37
|
+
<div className={cx(inspectorTextStyles.root, shinyTextStyles.shinyText)}>
|
|
46
38
|
<span>{t('builtins.lobe-local-system.apiName.globLocalFiles')}: </span>
|
|
47
39
|
<span className={highlightTextStyles.primary}>{pattern}</span>
|
|
48
40
|
</div>
|
|
@@ -53,7 +45,7 @@ export const GlobLocalFilesInspector = memo<BuiltinInspectorProps<GlobFilesParam
|
|
|
53
45
|
const isSuccess = pluginState?.result?.success;
|
|
54
46
|
|
|
55
47
|
return (
|
|
56
|
-
<div className={cx(
|
|
48
|
+
<div className={cx(inspectorTextStyles.root, isLoading && shinyTextStyles.shinyText)}>
|
|
57
49
|
<span style={{ marginInlineStart: 2 }}>
|
|
58
50
|
<span>{t('builtins.lobe-local-system.apiName.globLocalFiles')}: </span>
|
|
59
51
|
{pattern && <span className={highlightTextStyles.primary}>{pattern}</span>}
|
|
@@ -3,25 +3,14 @@
|
|
|
3
3
|
import { type GrepContentParams } from '@lobechat/electron-client-ipc';
|
|
4
4
|
import { type BuiltinInspectorProps } from '@lobechat/types';
|
|
5
5
|
import { Text } from '@lobehub/ui';
|
|
6
|
-
import {
|
|
6
|
+
import { cssVar, cx } from 'antd-style';
|
|
7
7
|
import { memo } from 'react';
|
|
8
8
|
import { useTranslation } from 'react-i18next';
|
|
9
9
|
|
|
10
|
-
import { highlightTextStyles, shinyTextStyles } from '@/styles';
|
|
10
|
+
import { highlightTextStyles, inspectorTextStyles, shinyTextStyles } from '@/styles';
|
|
11
11
|
|
|
12
12
|
import { type GrepContentState } from '../../..';
|
|
13
13
|
|
|
14
|
-
const styles = createStaticStyles(({ css, cssVar }) => ({
|
|
15
|
-
root: css`
|
|
16
|
-
overflow: hidden;
|
|
17
|
-
display: -webkit-box;
|
|
18
|
-
-webkit-box-orient: vertical;
|
|
19
|
-
-webkit-line-clamp: 1;
|
|
20
|
-
|
|
21
|
-
color: ${cssVar.colorTextSecondary};
|
|
22
|
-
`,
|
|
23
|
-
}));
|
|
24
|
-
|
|
25
14
|
export const GrepContentInspector = memo<
|
|
26
15
|
BuiltinInspectorProps<GrepContentParams, GrepContentState>
|
|
27
16
|
>(({ args, partialArgs, isArgumentsStreaming, pluginState, isLoading }) => {
|
|
@@ -33,13 +22,13 @@ export const GrepContentInspector = memo<
|
|
|
33
22
|
if (isArgumentsStreaming) {
|
|
34
23
|
if (!pattern)
|
|
35
24
|
return (
|
|
36
|
-
<div className={cx(
|
|
25
|
+
<div className={cx(inspectorTextStyles.root, shinyTextStyles.shinyText)}>
|
|
37
26
|
<span>{t('builtins.lobe-local-system.apiName.grepContent')}</span>
|
|
38
27
|
</div>
|
|
39
28
|
);
|
|
40
29
|
|
|
41
30
|
return (
|
|
42
|
-
<div className={cx(
|
|
31
|
+
<div className={cx(inspectorTextStyles.root, shinyTextStyles.shinyText)}>
|
|
43
32
|
<span>{t('builtins.lobe-local-system.apiName.grepContent')}: </span>
|
|
44
33
|
<span className={highlightTextStyles.primary}>{pattern}</span>
|
|
45
34
|
</div>
|
|
@@ -51,7 +40,7 @@ export const GrepContentInspector = memo<
|
|
|
51
40
|
const hasResults = resultCount > 0;
|
|
52
41
|
|
|
53
42
|
return (
|
|
54
|
-
<div className={cx(
|
|
43
|
+
<div className={cx(inspectorTextStyles.root, isLoading && shinyTextStyles.shinyText)}>
|
|
55
44
|
<span>{t('builtins.lobe-local-system.apiName.grepContent')}: </span>
|
|
56
45
|
{pattern && <span className={highlightTextStyles.primary}>{pattern}</span>}
|
|
57
46
|
{!isLoading &&
|
|
@@ -3,26 +3,15 @@
|
|
|
3
3
|
import { type ListLocalFileParams } from '@lobechat/electron-client-ipc';
|
|
4
4
|
import { type BuiltinInspectorProps } from '@lobechat/types';
|
|
5
5
|
import { Text } from '@lobehub/ui';
|
|
6
|
-
import {
|
|
6
|
+
import { cssVar, cx } from 'antd-style';
|
|
7
7
|
import { memo } from 'react';
|
|
8
8
|
import { useTranslation } from 'react-i18next';
|
|
9
9
|
|
|
10
|
-
import { shinyTextStyles } from '@/styles';
|
|
10
|
+
import { inspectorTextStyles, shinyTextStyles } from '@/styles';
|
|
11
11
|
|
|
12
12
|
import { type LocalFileListState } from '../../..';
|
|
13
13
|
import { FilePathDisplay } from '../../components/FilePathDisplay';
|
|
14
14
|
|
|
15
|
-
const styles = createStaticStyles(({ css, cssVar }) => ({
|
|
16
|
-
root: css`
|
|
17
|
-
overflow: hidden;
|
|
18
|
-
display: -webkit-box;
|
|
19
|
-
-webkit-box-orient: vertical;
|
|
20
|
-
-webkit-line-clamp: 1;
|
|
21
|
-
|
|
22
|
-
color: ${cssVar.colorTextSecondary};
|
|
23
|
-
`,
|
|
24
|
-
}));
|
|
25
|
-
|
|
26
15
|
export const ListLocalFilesInspector = memo<
|
|
27
16
|
BuiltinInspectorProps<ListLocalFileParams, LocalFileListState>
|
|
28
17
|
>(({ args, partialArgs, isArgumentsStreaming, pluginState, isLoading }) => {
|
|
@@ -34,13 +23,13 @@ export const ListLocalFilesInspector = memo<
|
|
|
34
23
|
if (isArgumentsStreaming) {
|
|
35
24
|
if (!path)
|
|
36
25
|
return (
|
|
37
|
-
<div className={cx(
|
|
26
|
+
<div className={cx(inspectorTextStyles.root, shinyTextStyles.shinyText)}>
|
|
38
27
|
<span>{t('builtins.lobe-local-system.apiName.listLocalFiles')}</span>
|
|
39
28
|
</div>
|
|
40
29
|
);
|
|
41
30
|
|
|
42
31
|
return (
|
|
43
|
-
<div className={cx(
|
|
32
|
+
<div className={cx(inspectorTextStyles.root, shinyTextStyles.shinyText)}>
|
|
44
33
|
<span>{t('builtins.lobe-local-system.apiName.listLocalFiles')}: </span>
|
|
45
34
|
<FilePathDisplay filePath={path} isDirectory />
|
|
46
35
|
</div>
|
|
@@ -52,7 +41,7 @@ export const ListLocalFilesInspector = memo<
|
|
|
52
41
|
const hasResults = resultCount > 0;
|
|
53
42
|
|
|
54
43
|
return (
|
|
55
|
-
<div className={cx(
|
|
44
|
+
<div className={cx(inspectorTextStyles.root, isLoading && shinyTextStyles.shinyText)}>
|
|
56
45
|
<span>{t('builtins.lobe-local-system.apiName.listLocalFiles')}: </span>
|
|
57
46
|
<FilePathDisplay filePath={path} isDirectory />
|
|
58
47
|
{!isLoading &&
|
|
@@ -2,26 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
import { type LocalReadFileParams } from '@lobechat/electron-client-ipc';
|
|
4
4
|
import { type BuiltinInspectorProps } from '@lobechat/types';
|
|
5
|
-
import {
|
|
5
|
+
import { cx } from 'antd-style';
|
|
6
6
|
import { memo } from 'react';
|
|
7
7
|
import { useTranslation } from 'react-i18next';
|
|
8
8
|
|
|
9
|
-
import { shinyTextStyles } from '@/styles';
|
|
9
|
+
import { inspectorTextStyles, shinyTextStyles } from '@/styles';
|
|
10
10
|
|
|
11
11
|
import { type LocalReadFileState } from '../../..';
|
|
12
12
|
import { FilePathDisplay } from '../../components/FilePathDisplay';
|
|
13
13
|
|
|
14
|
-
const styles = createStaticStyles(({ css, cssVar }) => ({
|
|
15
|
-
root: css`
|
|
16
|
-
overflow: hidden;
|
|
17
|
-
display: -webkit-box;
|
|
18
|
-
-webkit-box-orient: vertical;
|
|
19
|
-
-webkit-line-clamp: 1;
|
|
20
|
-
|
|
21
|
-
color: ${cssVar.colorTextSecondary};
|
|
22
|
-
`,
|
|
23
|
-
}));
|
|
24
|
-
|
|
25
14
|
export const ReadLocalFileInspector = memo<
|
|
26
15
|
BuiltinInspectorProps<LocalReadFileParams, LocalReadFileState>
|
|
27
16
|
>(({ args, partialArgs, isArgumentsStreaming, isLoading }) => {
|
|
@@ -33,13 +22,13 @@ export const ReadLocalFileInspector = memo<
|
|
|
33
22
|
if (isArgumentsStreaming) {
|
|
34
23
|
if (!filePath)
|
|
35
24
|
return (
|
|
36
|
-
<div className={cx(
|
|
25
|
+
<div className={cx(inspectorTextStyles.root, shinyTextStyles.shinyText)}>
|
|
37
26
|
<span>{t('builtins.lobe-local-system.apiName.readLocalFile')}</span>
|
|
38
27
|
</div>
|
|
39
28
|
);
|
|
40
29
|
|
|
41
30
|
return (
|
|
42
|
-
<div className={cx(
|
|
31
|
+
<div className={cx(inspectorTextStyles.root, shinyTextStyles.shinyText)}>
|
|
43
32
|
<span>{t('builtins.lobe-local-system.apiName.readLocalFile')}: </span>
|
|
44
33
|
<FilePathDisplay filePath={filePath} />
|
|
45
34
|
</div>
|
|
@@ -47,7 +36,7 @@ export const ReadLocalFileInspector = memo<
|
|
|
47
36
|
}
|
|
48
37
|
|
|
49
38
|
return (
|
|
50
|
-
<div className={cx(
|
|
39
|
+
<div className={cx(inspectorTextStyles.root, isLoading && shinyTextStyles.shinyText)}>
|
|
51
40
|
<span>{t('builtins.lobe-local-system.apiName.readLocalFile')}: </span>
|
|
52
41
|
<FilePathDisplay filePath={filePath} />
|
|
53
42
|
</div>
|
|
@@ -8,23 +8,15 @@ import path from 'path-browserify-esm';
|
|
|
8
8
|
import { memo } from 'react';
|
|
9
9
|
import { useTranslation } from 'react-i18next';
|
|
10
10
|
|
|
11
|
-
import { highlightTextStyles, shinyTextStyles } from '@/styles';
|
|
11
|
+
import { highlightTextStyles, inspectorTextStyles, shinyTextStyles } from '@/styles';
|
|
12
12
|
|
|
13
13
|
import { type LocalRenameFileState } from '../../..';
|
|
14
14
|
|
|
15
|
-
const styles = createStaticStyles(({ css
|
|
15
|
+
const styles = createStaticStyles(({ css }) => ({
|
|
16
16
|
icon: css`
|
|
17
17
|
flex-shrink: 0;
|
|
18
18
|
margin-inline-end: 4px;
|
|
19
19
|
`,
|
|
20
|
-
root: css`
|
|
21
|
-
overflow: hidden;
|
|
22
|
-
display: -webkit-box;
|
|
23
|
-
-webkit-box-orient: vertical;
|
|
24
|
-
-webkit-line-clamp: 1;
|
|
25
|
-
|
|
26
|
-
color: ${cssVar.colorTextSecondary};
|
|
27
|
-
`,
|
|
28
20
|
}));
|
|
29
21
|
|
|
30
22
|
export const RenameLocalFileInspector = memo<
|
|
@@ -39,7 +31,9 @@ export const RenameLocalFileInspector = memo<
|
|
|
39
31
|
const oldName = filePath ? path.basename(filePath) : '';
|
|
40
32
|
|
|
41
33
|
return (
|
|
42
|
-
<div
|
|
34
|
+
<div
|
|
35
|
+
className={cx(inspectorTextStyles.root, isArgumentsStreaming && shinyTextStyles.shinyText)}
|
|
36
|
+
>
|
|
43
37
|
{oldName && newName ? (
|
|
44
38
|
<>
|
|
45
39
|
{t('builtins.lobe-local-system.apiName.renameLocalFile')} {oldName} →{' '}
|
|
@@ -7,17 +7,9 @@ import { Check, X } from 'lucide-react';
|
|
|
7
7
|
import { memo } from 'react';
|
|
8
8
|
import { useTranslation } from 'react-i18next';
|
|
9
9
|
|
|
10
|
-
import { highlightTextStyles, shinyTextStyles } from '@/styles';
|
|
10
|
+
import { highlightTextStyles, inspectorTextStyles, shinyTextStyles } from '@/styles';
|
|
11
11
|
|
|
12
|
-
const styles = createStaticStyles(({ css
|
|
13
|
-
root: css`
|
|
14
|
-
overflow: hidden;
|
|
15
|
-
display: -webkit-box;
|
|
16
|
-
-webkit-box-orient: vertical;
|
|
17
|
-
-webkit-line-clamp: 1;
|
|
18
|
-
|
|
19
|
-
color: ${cssVar.colorTextSecondary};
|
|
20
|
-
`,
|
|
12
|
+
const styles = createStaticStyles(({ css }) => ({
|
|
21
13
|
statusIcon: css`
|
|
22
14
|
margin-block-end: -2px;
|
|
23
15
|
margin-inline-start: 4px;
|
|
@@ -40,13 +32,13 @@ export const RunCommandInspector = memo<BuiltinInspectorProps<RunCommandParams,
|
|
|
40
32
|
if (isArgumentsStreaming) {
|
|
41
33
|
if (!description)
|
|
42
34
|
return (
|
|
43
|
-
<div className={cx(
|
|
35
|
+
<div className={cx(inspectorTextStyles.root, shinyTextStyles.shinyText)}>
|
|
44
36
|
<span>{t('builtins.lobe-local-system.apiName.runCommand')}</span>
|
|
45
37
|
</div>
|
|
46
38
|
);
|
|
47
39
|
|
|
48
40
|
return (
|
|
49
|
-
<div className={cx(
|
|
41
|
+
<div className={cx(inspectorTextStyles.root, shinyTextStyles.shinyText)}>
|
|
50
42
|
<span>{t('builtins.lobe-local-system.apiName.runCommand')}: </span>
|
|
51
43
|
<span className={highlightTextStyles.primary}>{description}</span>
|
|
52
44
|
</div>
|
|
@@ -58,7 +50,7 @@ export const RunCommandInspector = memo<BuiltinInspectorProps<RunCommandParams,
|
|
|
58
50
|
const isSuccess = result?.success && result?.exit_code === 0;
|
|
59
51
|
|
|
60
52
|
return (
|
|
61
|
-
<div className={cx(
|
|
53
|
+
<div className={cx(inspectorTextStyles.root, isLoading && shinyTextStyles.shinyText)}>
|
|
62
54
|
<span style={{ marginInlineStart: 2 }}>
|
|
63
55
|
<span>{t('builtins.lobe-local-system.apiName.runCommand')}: </span>
|
|
64
56
|
{description && <span className={highlightTextStyles.primary}>{description}</span>}
|
|
@@ -3,25 +3,14 @@
|
|
|
3
3
|
import { type LocalSearchFilesParams } from '@lobechat/electron-client-ipc';
|
|
4
4
|
import { type BuiltinInspectorProps } from '@lobechat/types';
|
|
5
5
|
import { Text } from '@lobehub/ui';
|
|
6
|
-
import {
|
|
6
|
+
import { cssVar, cx } from 'antd-style';
|
|
7
7
|
import { memo } from 'react';
|
|
8
8
|
import { useTranslation } from 'react-i18next';
|
|
9
9
|
|
|
10
|
-
import { highlightTextStyles, shinyTextStyles } from '@/styles';
|
|
10
|
+
import { highlightTextStyles, inspectorTextStyles, shinyTextStyles } from '@/styles';
|
|
11
11
|
|
|
12
12
|
import { type LocalFileSearchState } from '../../..';
|
|
13
13
|
|
|
14
|
-
const styles = createStaticStyles(({ css, cssVar }) => ({
|
|
15
|
-
root: css`
|
|
16
|
-
overflow: hidden;
|
|
17
|
-
display: -webkit-box;
|
|
18
|
-
-webkit-box-orient: vertical;
|
|
19
|
-
-webkit-line-clamp: 1;
|
|
20
|
-
|
|
21
|
-
color: ${cssVar.colorTextSecondary};
|
|
22
|
-
`,
|
|
23
|
-
}));
|
|
24
|
-
|
|
25
14
|
export const SearchLocalFilesInspector = memo<
|
|
26
15
|
BuiltinInspectorProps<LocalSearchFilesParams, LocalFileSearchState>
|
|
27
16
|
>(({ args, partialArgs, isArgumentsStreaming, pluginState, isLoading }) => {
|
|
@@ -33,13 +22,13 @@ export const SearchLocalFilesInspector = memo<
|
|
|
33
22
|
if (isArgumentsStreaming) {
|
|
34
23
|
if (!keywords)
|
|
35
24
|
return (
|
|
36
|
-
<div className={cx(
|
|
25
|
+
<div className={cx(inspectorTextStyles.root, shinyTextStyles.shinyText)}>
|
|
37
26
|
<span>{t('builtins.lobe-local-system.apiName.searchLocalFiles')}</span>
|
|
38
27
|
</div>
|
|
39
28
|
);
|
|
40
29
|
|
|
41
30
|
return (
|
|
42
|
-
<div className={cx(
|
|
31
|
+
<div className={cx(inspectorTextStyles.root, shinyTextStyles.shinyText)}>
|
|
43
32
|
<span>{t('builtins.lobe-local-system.apiName.searchLocalFiles')}: </span>
|
|
44
33
|
<span className={highlightTextStyles.primary}>{keywords}</span>
|
|
45
34
|
</div>
|
|
@@ -51,7 +40,7 @@ export const SearchLocalFilesInspector = memo<
|
|
|
51
40
|
const hasResults = resultCount > 0;
|
|
52
41
|
|
|
53
42
|
return (
|
|
54
|
-
<div className={cx(
|
|
43
|
+
<div className={cx(inspectorTextStyles.root, isLoading && shinyTextStyles.shinyText)}>
|
|
55
44
|
<span style={{ marginInlineStart: 2 }}>
|
|
56
45
|
<span>{t('builtins.lobe-local-system.apiName.searchLocalFiles')}: </span>
|
|
57
46
|
{keywords && <span className={highlightTextStyles.primary}>{keywords}</span>}
|
|
@@ -3,26 +3,15 @@
|
|
|
3
3
|
import { type WriteLocalFileParams } from '@lobechat/electron-client-ipc';
|
|
4
4
|
import { type BuiltinInspectorProps } from '@lobechat/types';
|
|
5
5
|
import { Icon, Text } from '@lobehub/ui';
|
|
6
|
-
import {
|
|
6
|
+
import { cssVar, cx } from 'antd-style';
|
|
7
7
|
import { Plus } from 'lucide-react';
|
|
8
8
|
import { memo } from 'react';
|
|
9
9
|
import { useTranslation } from 'react-i18next';
|
|
10
10
|
|
|
11
|
-
import { shinyTextStyles } from '@/styles';
|
|
11
|
+
import { inspectorTextStyles, shinyTextStyles } from '@/styles';
|
|
12
12
|
|
|
13
13
|
import { FilePathDisplay } from '../../components/FilePathDisplay';
|
|
14
14
|
|
|
15
|
-
const styles = createStaticStyles(({ css, cssVar }) => ({
|
|
16
|
-
root: css`
|
|
17
|
-
overflow: hidden;
|
|
18
|
-
display: -webkit-box;
|
|
19
|
-
-webkit-box-orient: vertical;
|
|
20
|
-
-webkit-line-clamp: 1;
|
|
21
|
-
|
|
22
|
-
color: ${cssVar.colorTextSecondary};
|
|
23
|
-
`,
|
|
24
|
-
}));
|
|
25
|
-
|
|
26
15
|
export const WriteLocalFileInspector = memo<BuiltinInspectorProps<WriteLocalFileParams>>(
|
|
27
16
|
({ args, partialArgs, isArgumentsStreaming }) => {
|
|
28
17
|
const { t } = useTranslation('plugin');
|
|
@@ -36,14 +25,16 @@ export const WriteLocalFileInspector = memo<BuiltinInspectorProps<WriteLocalFile
|
|
|
36
25
|
// During argument streaming without path
|
|
37
26
|
if (isArgumentsStreaming && !filePath) {
|
|
38
27
|
return (
|
|
39
|
-
<div className={cx(
|
|
28
|
+
<div className={cx(inspectorTextStyles.root, shinyTextStyles.shinyText)}>
|
|
40
29
|
<span>{t('builtins.lobe-local-system.apiName.writeLocalFile')}</span>
|
|
41
30
|
</div>
|
|
42
31
|
);
|
|
43
32
|
}
|
|
44
33
|
|
|
45
34
|
return (
|
|
46
|
-
<div
|
|
35
|
+
<div
|
|
36
|
+
className={cx(inspectorTextStyles.root, isArgumentsStreaming && shinyTextStyles.shinyText)}
|
|
37
|
+
>
|
|
47
38
|
<span>{t('builtins.lobe-local-system.apiName.writeLocalFile')}: </span>
|
|
48
39
|
<FilePathDisplay filePath={filePath} />
|
|
49
40
|
{lines > 0 && (
|
|
@@ -1,25 +1,14 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import type { BuiltinInspectorProps } from '@lobechat/types';
|
|
4
|
-
import {
|
|
4
|
+
import { cx } from 'antd-style';
|
|
5
5
|
import { memo } from 'react';
|
|
6
6
|
import { useTranslation } from 'react-i18next';
|
|
7
7
|
|
|
8
|
-
import { highlightTextStyles, shinyTextStyles } from '@/styles';
|
|
8
|
+
import { highlightTextStyles, inspectorTextStyles, shinyTextStyles } from '@/styles';
|
|
9
9
|
|
|
10
10
|
import type { CreateDocumentArgs, CreateDocumentState } from '../../../types';
|
|
11
11
|
|
|
12
|
-
const styles = createStaticStyles(({ css, cssVar }) => ({
|
|
13
|
-
root: css`
|
|
14
|
-
overflow: hidden;
|
|
15
|
-
display: -webkit-box;
|
|
16
|
-
-webkit-box-orient: vertical;
|
|
17
|
-
-webkit-line-clamp: 1;
|
|
18
|
-
|
|
19
|
-
color: ${cssVar.colorTextSecondary};
|
|
20
|
-
`,
|
|
21
|
-
}));
|
|
22
|
-
|
|
23
12
|
export const CreateDocumentInspector = memo<
|
|
24
13
|
BuiltinInspectorProps<CreateDocumentArgs, CreateDocumentState>
|
|
25
14
|
>(({ args, partialArgs, isArgumentsStreaming, isLoading }) => {
|
|
@@ -30,7 +19,7 @@ export const CreateDocumentInspector = memo<
|
|
|
30
19
|
// During streaming without title, show init
|
|
31
20
|
if (isArgumentsStreaming && !title) {
|
|
32
21
|
return (
|
|
33
|
-
<div className={cx(
|
|
22
|
+
<div className={cx(inspectorTextStyles.root, shinyTextStyles.shinyText)}>
|
|
34
23
|
<span>{t('builtins.lobe-notebook.apiName.createDocument')}</span>
|
|
35
24
|
</div>
|
|
36
25
|
);
|
|
@@ -38,7 +27,10 @@ export const CreateDocumentInspector = memo<
|
|
|
38
27
|
|
|
39
28
|
return (
|
|
40
29
|
<div
|
|
41
|
-
className={cx(
|
|
30
|
+
className={cx(
|
|
31
|
+
inspectorTextStyles.root,
|
|
32
|
+
(isArgumentsStreaming || isLoading) && shinyTextStyles.shinyText,
|
|
33
|
+
)}
|
|
42
34
|
>
|
|
43
35
|
<span>{t('builtins.lobe-notebook.apiName.createDocument')}: </span>
|
|
44
36
|
{title && <span className={highlightTextStyles.primary}>{title}</span>}
|
|
@@ -2,25 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
import type { EditTitleArgs } from '@lobechat/editor-runtime';
|
|
4
4
|
import type { BuiltinInspectorProps } from '@lobechat/types';
|
|
5
|
-
import {
|
|
5
|
+
import { cx } from 'antd-style';
|
|
6
6
|
import { memo } from 'react';
|
|
7
7
|
import { Trans, useTranslation } from 'react-i18next';
|
|
8
8
|
|
|
9
|
-
import { highlightTextStyles, shinyTextStyles } from '@/styles';
|
|
9
|
+
import { highlightTextStyles, inspectorTextStyles, shinyTextStyles } from '@/styles';
|
|
10
10
|
|
|
11
11
|
import type { EditTitleState } from '../../../types';
|
|
12
12
|
|
|
13
|
-
const styles = createStaticStyles(({ css, cssVar }) => ({
|
|
14
|
-
root: css`
|
|
15
|
-
overflow: hidden;
|
|
16
|
-
display: -webkit-box;
|
|
17
|
-
-webkit-box-orient: vertical;
|
|
18
|
-
-webkit-line-clamp: 1;
|
|
19
|
-
|
|
20
|
-
color: ${cssVar.colorTextSecondary};
|
|
21
|
-
`,
|
|
22
|
-
}));
|
|
23
|
-
|
|
24
13
|
export const EditTitleInspector = memo<BuiltinInspectorProps<EditTitleArgs, EditTitleState>>(
|
|
25
14
|
({ args, partialArgs, isArgumentsStreaming }) => {
|
|
26
15
|
const { t } = useTranslation('plugin');
|
|
@@ -28,7 +17,9 @@ export const EditTitleInspector = memo<BuiltinInspectorProps<EditTitleArgs, Edit
|
|
|
28
17
|
const title = args?.title || partialArgs?.title;
|
|
29
18
|
|
|
30
19
|
return (
|
|
31
|
-
<div
|
|
20
|
+
<div
|
|
21
|
+
className={cx(inspectorTextStyles.root, isArgumentsStreaming && shinyTextStyles.shinyText)}
|
|
22
|
+
>
|
|
32
23
|
{title ? (
|
|
33
24
|
<Trans
|
|
34
25
|
components={{ title: <span className={highlightTextStyles.gold} /> }}
|
|
@@ -5,25 +5,24 @@ import { createStaticStyles, cx } from 'antd-style';
|
|
|
5
5
|
import { memo } from 'react';
|
|
6
6
|
import { useTranslation } from 'react-i18next';
|
|
7
7
|
|
|
8
|
-
import { shinyTextStyles } from '@/styles';
|
|
8
|
+
import { oneLineEllipsis, shinyTextStyles } from '@/styles';
|
|
9
9
|
|
|
10
10
|
const styles = createStaticStyles(({ css, cssVar }) => ({
|
|
11
11
|
done: css`
|
|
12
12
|
color: ${cssVar.colorTextDescription};
|
|
13
13
|
`,
|
|
14
|
-
root: css`
|
|
15
|
-
overflow: hidden;
|
|
16
|
-
display: -webkit-box;
|
|
17
|
-
-webkit-box-orient: vertical;
|
|
18
|
-
-webkit-line-clamp: 1;
|
|
19
|
-
`,
|
|
20
14
|
}));
|
|
21
15
|
|
|
22
16
|
export const GetPageContentInspector = memo<BuiltinInspectorProps>(({ isArgumentsStreaming }) => {
|
|
23
17
|
const { t } = useTranslation('plugin');
|
|
24
18
|
|
|
25
19
|
return (
|
|
26
|
-
<div
|
|
20
|
+
<div
|
|
21
|
+
className={cx(
|
|
22
|
+
oneLineEllipsis,
|
|
23
|
+
isArgumentsStreaming ? shinyTextStyles.shinyText : styles.done,
|
|
24
|
+
)}
|
|
25
|
+
>
|
|
27
26
|
<span>{t('builtins.lobe-page-agent.apiName.getPageContent')}</span>
|
|
28
27
|
</div>
|
|
29
28
|
);
|