@lobehub/lobehub 2.0.0-next.96 → 2.0.0-next.98
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/.console-log-whitelist.json +14 -0
- package/.github/workflows/check-console-log.yml +117 -0
- package/.github/workflows/desktop-pr-build.yml +4 -4
- package/.github/workflows/release-desktop-beta.yml +4 -4
- package/.github/workflows/release.yml +1 -1
- package/.github/workflows/test.yml +5 -5
- package/CHANGELOG.md +66 -0
- package/apps/desktop/src/preload/index.ts +2 -2
- package/apps/desktop/src/preload/invoke.ts +1 -1
- package/apps/desktop/src/preload/routeInterceptor.ts +41 -41
- package/changelog/v1.json +21 -0
- package/docs/development/database-schema.dbml +1 -0
- package/e2e/package.json +1 -1
- package/locales/ar/file.json +9 -11
- package/locales/ar/models.json +6 -0
- package/locales/bg-BG/file.json +8 -10
- package/locales/bg-BG/models.json +6 -0
- package/locales/de-DE/file.json +9 -11
- package/locales/de-DE/models.json +6 -0
- package/locales/en-US/file.json +12 -14
- package/locales/en-US/models.json +6 -0
- package/locales/es-ES/file.json +7 -9
- package/locales/es-ES/models.json +6 -0
- package/locales/fa-IR/file.json +9 -11
- package/locales/fa-IR/models.json +6 -0
- package/locales/fr-FR/file.json +6 -8
- package/locales/fr-FR/models.json +6 -0
- package/locales/it-IT/file.json +8 -10
- package/locales/it-IT/models.json +6 -0
- package/locales/ja-JP/file.json +10 -12
- package/locales/ja-JP/models.json +6 -0
- package/locales/ko-KR/file.json +8 -10
- package/locales/ko-KR/models.json +6 -0
- package/locales/nl-NL/file.json +8 -10
- package/locales/nl-NL/models.json +6 -0
- package/locales/pl-PL/file.json +7 -9
- package/locales/pl-PL/models.json +6 -0
- package/locales/pt-BR/file.json +7 -9
- package/locales/pt-BR/models.json +6 -0
- package/locales/ru-RU/file.json +9 -11
- package/locales/ru-RU/models.json +6 -0
- package/locales/tr-TR/file.json +8 -10
- package/locales/tr-TR/models.json +6 -0
- package/locales/vi-VN/file.json +9 -11
- package/locales/vi-VN/models.json +6 -0
- package/locales/zh-CN/file.json +10 -12
- package/locales/zh-CN/models.json +6 -0
- package/locales/zh-TW/file.json +10 -12
- package/locales/zh-TW/models.json +6 -0
- package/package.json +3 -2
- package/packages/database/migrations/0047_add_slug_document.sql +6 -0
- package/packages/database/migrations/meta/0047_snapshot.json +7891 -0
- package/packages/database/migrations/meta/_journal.json +7 -0
- package/packages/database/src/client/db.ts +12 -12
- package/packages/database/src/core/migrations.json +16 -7
- package/packages/database/src/models/document.ts +2 -2
- package/packages/database/src/repositories/dataImporter/index.ts +10 -10
- package/packages/database/src/schemas/file.ts +7 -1
- package/packages/database/src/schemas/topic.ts +1 -1
- package/packages/database/src/server/models/ragEval/evaluation.ts +1 -1
- package/packages/model-bank/src/aiModels/qwen.ts +5 -3
- package/packages/model-runtime/src/core/openaiCompatibleFactory/index.ts +21 -21
- package/packages/obervability-otel/package.json +2 -2
- package/scripts/checkConsoleLog.mts +148 -0
- package/scripts/prebuild.mts +5 -5
- package/src/app/[variants]/(main)/changelog/index.tsx +1 -1
- package/src/app/[variants]/(main)/chat/components/conversation/features/ChatInput/Desktop/ClassicChat.tsx +1 -1
- package/src/app/[variants]/(main)/chat/components/conversation/features/ChatInput/Desktop/GroupChat.tsx +1 -1
- package/src/app/[variants]/(main)/chat/components/conversation/features/ChatList/ChatItem/index.tsx +1 -1
- package/src/app/[variants]/(main)/chat/components/conversation/features/ChatList/Content.tsx +2 -2
- package/src/app/[variants]/(main)/chat/components/conversation/features/ChatList/index.tsx +1 -1
- package/src/app/[variants]/(main)/chat/components/conversation/features/ChatMinimap/index.tsx +1 -1
- package/src/app/[variants]/(main)/settings/_layout/Desktop/index.tsx +20 -16
- package/src/app/[variants]/(main)/settings/provider/(list)/ProviderGrid/Card.tsx +6 -3
- package/src/app/[variants]/(main)/settings/provider/(list)/index.tsx +3 -2
- package/src/app/[variants]/(main)/settings/provider/detail/index.tsx +14 -4
- package/src/app/[variants]/desktopRouter.config.tsx +23 -0
- package/src/app/[variants]/mobileRouter.config.tsx +23 -0
- package/src/components/InvalidAPIKey/APIKeyForm/Bedrock.tsx +1 -1
- package/src/components/InvalidAPIKey/APIKeyForm/ComfyUIForm.tsx +1 -1
- package/src/components/InvalidAPIKey/APIKeyForm/ProviderApiKeyForm.tsx +1 -1
- package/src/components/InvalidAPIKey/APIKeyForm/__tests__/ComfyUIForm.test.tsx +1 -1
- package/src/components/InvalidAPIKey/index.tsx +1 -1
- package/src/features/{Conversation → ChatList}/MarkdownElements/remarkPlugins/getNodeContent.test.ts +1 -2
- package/src/features/{Conversation → ChatList}/Messages/Assistant/Actions/index.tsx +2 -2
- package/src/features/{Conversation → ChatList}/Messages/Assistant/Extra/index.test.tsx +3 -3
- package/src/features/{Conversation → ChatList}/Messages/Assistant/Extra/index.tsx +6 -5
- package/src/features/{Conversation → ChatList}/Messages/Assistant/MessageContent.tsx +1 -1
- package/src/features/{Conversation → ChatList}/Messages/Group/Actions/WithContentId.tsx +2 -2
- package/src/features/{Conversation → ChatList}/Messages/Group/ContentBlock.tsx +2 -2
- package/src/features/{Conversation → ChatList}/Messages/Group/Error/index.tsx +2 -1
- package/src/features/{Conversation → ChatList}/Messages/Group/Group.tsx +1 -1
- package/src/features/{Conversation → ChatList}/Messages/Group/GroupItem.tsx +3 -2
- package/src/features/{Conversation → ChatList}/Messages/Group/Tool/Render/Intervention/ApprovalActions.tsx +1 -1
- package/src/features/{Conversation → ChatList}/Messages/Group/Tool/Render/index.tsx +1 -2
- package/src/features/{Conversation → ChatList}/Messages/Group/index.tsx +1 -1
- package/src/features/{Conversation → ChatList}/Messages/User/Extra.tsx +3 -3
- package/src/features/{Conversation → ChatList}/Messages/User/index.tsx +1 -1
- package/src/features/{Conversation → ChatList}/Messages/index.tsx +1 -1
- package/src/features/{Conversation → ChatList}/components/ShareMessageModal/ShareImage/Preview.tsx +1 -1
- package/src/features/{Conversation → ChatList}/components/SkeletonList.tsx +1 -1
- package/src/features/{Conversation → ChatList}/components/VirtualizedList/index.tsx +1 -1
- package/src/features/KnowledgeManager/DocumentExplorer/NoteEditorModal.tsx +0 -20
- package/src/features/KnowledgeManager/DocumentExplorer/index.tsx +3 -3
- package/src/features/KnowledgeManager/FileExplorer/MasonryFileItem/index.tsx +0 -20
- package/src/features/KnowledgeManager/Header/AddButton.tsx +0 -1
- package/src/features/KnowledgeManager/Header/NewNoteButton.tsx +1 -1
- package/src/features/KnowledgeManager/Header/TogglePanelButton.tsx +2 -2
- package/src/features/KnowledgeManager/Home/UploadEntries.tsx +2 -2
- package/src/features/KnowledgeManager/Home/index.tsx +4 -4
- package/src/features/OllamaSetupGuide/index.tsx +1 -1
- package/src/features/PluginsUI/Render/MCPType/index.tsx +1 -1
- package/src/features/Portal/GroupThread/Body/ThreadChatItem.tsx +1 -1
- package/src/features/Portal/GroupThread/Body/ThreadChatList.tsx +1 -1
- package/src/features/Portal/Thread/Chat/ChatInput/index.tsx +1 -1
- package/src/features/Portal/Thread/Chat/ChatItem.tsx +1 -1
- package/src/features/Portal/Thread/Chat/ChatList.tsx +1 -1
- package/src/features/Portal/Thread/Chat/index.tsx +1 -1
- package/src/features/ShareModal/ShareImage/ChatList/index.tsx +1 -1
- package/src/features/User/UserPanel/useMenu.tsx +7 -3
- package/src/locales/default/file.ts +11 -13
- package/src/services/debug.ts +4 -4
- package/src/services/electron/remoteServer.ts +5 -5
- package/src/services/electron/settings.ts +6 -6
- package/src/services/mcp.ts +18 -18
- package/src/services/models.ts +20 -20
- package/src/store/chat/agents/__tests__/createAgentExecutors/helpers/testExecutor.ts +1 -4
- /package/src/features/{Conversation → ChatList}/Error/AccessCodeForm.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/Error/ChatInvalidApiKey.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/Error/ClerkLogin/index.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/Error/ErrorJsonViewer.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/Error/OAuthForm.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/Error/OllamaBizError/InvalidOllamaModel.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/Error/OllamaBizError/index.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/Error/index.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/Error/style.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/MarkdownElements/LobeArtifact/Render/Icon.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/MarkdownElements/LobeArtifact/Render/index.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/MarkdownElements/LobeArtifact/index.ts +0 -0
- /package/src/features/{Conversation → ChatList}/MarkdownElements/LobeArtifact/rehypePlugin.test.ts +0 -0
- /package/src/features/{Conversation → ChatList}/MarkdownElements/LobeArtifact/rehypePlugin.ts +0 -0
- /package/src/features/{Conversation → ChatList}/MarkdownElements/LobeThinking/Render.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/MarkdownElements/LobeThinking/index.ts +0 -0
- /package/src/features/{Conversation → ChatList}/MarkdownElements/LocalFile/Render/index.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/MarkdownElements/LocalFile/index.ts +0 -0
- /package/src/features/{Conversation → ChatList}/MarkdownElements/Mention/Render.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/MarkdownElements/Mention/index.ts +0 -0
- /package/src/features/{Conversation → ChatList}/MarkdownElements/Thinking/Render.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/MarkdownElements/Thinking/index.ts +0 -0
- /package/src/features/{Conversation → ChatList}/MarkdownElements/index.ts +0 -0
- /package/src/features/{Conversation → ChatList}/MarkdownElements/remarkPlugins/__snapshots__/createRemarkSelfClosingTagPlugin.test.ts.snap +0 -0
- /package/src/features/{Conversation → ChatList}/MarkdownElements/remarkPlugins/createRemarkCustomTagPlugin.ts +0 -0
- /package/src/features/{Conversation → ChatList}/MarkdownElements/remarkPlugins/createRemarkCustomTagWithAttributesPlugin.ts +0 -0
- /package/src/features/{Conversation → ChatList}/MarkdownElements/remarkPlugins/createRemarkSelfClosingTagPlugin.test.ts +0 -0
- /package/src/features/{Conversation → ChatList}/MarkdownElements/remarkPlugins/createRemarkSelfClosingTagPlugin.ts +0 -0
- /package/src/features/{Conversation → ChatList}/MarkdownElements/remarkPlugins/getNodeContent.ts +0 -0
- /package/src/features/{Conversation → ChatList}/MarkdownElements/type.ts +0 -0
- /package/src/features/{Conversation → ChatList}/MarkdownElements/utils.ts +0 -0
- /package/src/features/{Conversation → ChatList}/Messages/Assistant/Actions/Error.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/Messages/Assistant/CollapsedMessage.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/Messages/Assistant/FileChunks/Item/index.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/Messages/Assistant/FileChunks/Item/style.ts +0 -0
- /package/src/features/{Conversation → ChatList}/Messages/Assistant/FileChunks/index.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/Messages/Assistant/IntentUnderstanding.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/Messages/Assistant/Reasoning/index.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/Messages/Assistant/SearchGrounding.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/Messages/Assistant/index.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/Messages/Default.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/Messages/Group/Actions/WithoutContentId.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/Messages/Group/Actions/index.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/Messages/Group/CollapsedMessage.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/Messages/Group/EditState.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/Messages/Group/GroupContext.ts +0 -0
- /package/src/features/{Conversation → ChatList}/Messages/Group/MessageContent.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/Messages/Group/Tool/Inspector/BuiltinPluginTitle.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/Messages/Group/Tool/Inspector/Debug.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/Messages/Group/Tool/Inspector/PluginResult.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/Messages/Group/Tool/Inspector/PluginState.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/Messages/Group/Tool/Inspector/Settings.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/Messages/Group/Tool/Inspector/StatusIndicator.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/Messages/Group/Tool/Inspector/ToolTitle.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/Messages/Group/Tool/Inspector/index.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/Messages/Group/Tool/Render/AbortResponse.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/Messages/Group/Tool/Render/Arguments/ObjectEntity.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/Messages/Group/Tool/Render/Arguments/ValueCell.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/Messages/Group/Tool/Render/Arguments/index.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/Messages/Group/Tool/Render/CustomRender.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/Messages/Group/Tool/Render/ErrorResponse.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/Messages/Group/Tool/Render/Intervention/Fallback.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/Messages/Group/Tool/Render/Intervention/KeyValueEditor.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/Messages/Group/Tool/Render/Intervention/ModeSelector.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/Messages/Group/Tool/Render/Intervention/index.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/Messages/Group/Tool/Render/LoadingPlaceholder/index.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/Messages/Group/Tool/Render/PluginSettings.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/Messages/Group/Tool/Render/RejectedResponse.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/Messages/Group/Tool/index.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/Messages/Group/Tools.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/Messages/Supervisor/TodoList.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/Messages/Supervisor/index.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/Messages/Tool/Inspector/BuiltinPluginTitle.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/Messages/Tool/Inspector/Debug.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/Messages/Tool/Inspector/PluginResult.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/Messages/Tool/Inspector/PluginState.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/Messages/Tool/Inspector/Settings.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/Messages/Tool/Inspector/ToolTitle.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/Messages/Tool/Inspector/index.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/Messages/Tool/Render/Arguments/ObjectEntity.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/Messages/Tool/Render/Arguments/ValueCell.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/Messages/Tool/Render/Arguments/index.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/Messages/Tool/Render/CustomRender.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/Messages/Tool/Render/ErrorResponse.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/Messages/Tool/Render/KeyValueEditor.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/Messages/Tool/Render/PluginSettings.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/Messages/Tool/Render/index.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/Messages/Tool/ToolItem.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/Messages/Tool/index.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/Messages/User/Actions/ActionsBar.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/Messages/User/Actions/MessageBranch.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/Messages/User/Actions/index.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/Messages/User/BelowMessage.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/Messages/User/FileListViewer/Item.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/Messages/User/FileListViewer/index.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/Messages/User/ImageFileListViewer.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/Messages/User/MarkdownRender/ContentPreview.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/Messages/User/MarkdownRender/index.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/Messages/User/MessageContent.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/Messages/User/VideoFileListViewer.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/components/AutoScroll.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/components/BackBottom/index.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/components/BackBottom/style.ts +0 -0
- /package/src/features/{Conversation → ChatList}/components/ChatItem/ShareMessageModal/SharePdf/PdfPreview.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/components/ChatItem/ShareMessageModal/SharePdf/index.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/components/ChatItem/ShareMessageModal/SharePdf/style.ts +0 -0
- /package/src/features/{Conversation → ChatList}/components/ChatItem/ShareMessageModal/SharePdf/template.ts +0 -0
- /package/src/features/{Conversation → ChatList}/components/ChatItem/ShareMessageModal/SharePdf/usePdfGeneration.ts +0 -0
- /package/src/features/{Conversation → ChatList}/components/Extras/ExtraContainer.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/components/Extras/TTS/FilePlayer.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/components/Extras/TTS/InitPlayer.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/components/Extras/TTS/Player.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/components/Extras/TTS/index.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/components/Extras/Translate.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/components/Extras/Usage/UsageDetail/AnimatedNumber.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/components/Extras/Usage/UsageDetail/ModelCard.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/components/Extras/Usage/UsageDetail/TokenProgress.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/components/Extras/Usage/UsageDetail/index.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/components/Extras/Usage/UsageDetail/pricing.ts +0 -0
- /package/src/features/{Conversation → ChatList}/components/Extras/Usage/UsageDetail/tokens.test.ts +0 -0
- /package/src/features/{Conversation → ChatList}/components/Extras/Usage/UsageDetail/tokens.ts +0 -0
- /package/src/features/{Conversation → ChatList}/components/Extras/Usage/index.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/components/History/HistoryDivider.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/components/History/index.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/components/OTPInput.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/components/ShareMessageModal/ShareImage/index.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/components/ShareMessageModal/ShareImage/style.ts +0 -0
- /package/src/features/{Conversation → ChatList}/components/ShareMessageModal/ShareImage/type.ts +0 -0
- /package/src/features/{Conversation → ChatList}/components/ShareMessageModal/ShareText/Preview.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/components/ShareMessageModal/ShareText/index.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/components/ShareMessageModal/ShareText/template.test.ts +0 -0
- /package/src/features/{Conversation → ChatList}/components/ShareMessageModal/ShareText/template.ts +0 -0
- /package/src/features/{Conversation → ChatList}/components/ShareMessageModal/ShareText/type.ts +0 -0
- /package/src/features/{Conversation → ChatList}/components/ShareMessageModal/index.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/components/ShareMessageModal/style.ts +0 -0
- /package/src/features/{Conversation → ChatList}/components/ThreadDivider/index.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/components/VirtualizedList/VirtuosoContext.ts +0 -0
- /package/src/features/{Conversation → ChatList}/components/WideScreenContainer/index.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/context/InPortalThreadContext.ts +0 -0
- /package/src/features/{Conversation → ChatList}/hooks/useChatListActionsBar.tsx +0 -0
- /package/src/features/{Conversation → ChatList}/hooks/useDoubleClickEdit.ts +0 -0
- /package/src/features/{Conversation → ChatList}/index.ts +0 -0
- /package/src/features/{Conversation → ChatList}/types/index.ts +0 -0
- /package/src/features/{Conversation → ChatList}/utils/markdown.test.ts +0 -0
- /package/src/features/{Conversation → ChatList}/utils/markdown.ts +0 -0
|
@@ -177,19 +177,6 @@ const MasonryFileItem = memo<MasonryFileItemProps>(
|
|
|
177
177
|
const isMarkdown = isMarkdownFile(name, fileType);
|
|
178
178
|
const isNote = isCustomNote(fileType);
|
|
179
179
|
|
|
180
|
-
// Debug: Log editorData for notes
|
|
181
|
-
useEffect(() => {
|
|
182
|
-
if (isNote) {
|
|
183
|
-
console.log('[MasonryFileItem] Note item:', {
|
|
184
|
-
editorDataPreview: editorData ? JSON.stringify(editorData).slice(0, 100) : null,
|
|
185
|
-
editorDataType: typeof editorData,
|
|
186
|
-
hasEditorData: !!editorData,
|
|
187
|
-
id,
|
|
188
|
-
name,
|
|
189
|
-
});
|
|
190
|
-
}
|
|
191
|
-
}, [isNote, id, name, editorData]);
|
|
192
|
-
|
|
193
180
|
const cardRef = useRef<HTMLDivElement>(null);
|
|
194
181
|
const [isInView, setIsInView] = useState(false);
|
|
195
182
|
|
|
@@ -288,12 +275,6 @@ const MasonryFileItem = memo<MasonryFileItemProps>(
|
|
|
288
275
|
)}
|
|
289
276
|
onClick={() => {
|
|
290
277
|
if (isNote) {
|
|
291
|
-
console.log('[MasonryFileItem] Opening note modal with:', {
|
|
292
|
-
editorDataType: typeof editorData,
|
|
293
|
-
hasEditorData: !!editorData,
|
|
294
|
-
id,
|
|
295
|
-
name,
|
|
296
|
-
});
|
|
297
278
|
setIsNoteModalOpen(true);
|
|
298
279
|
} else {
|
|
299
280
|
onOpen(id);
|
|
@@ -384,7 +365,6 @@ const MasonryFileItem = memo<MasonryFileItemProps>(
|
|
|
384
365
|
editorData={editorData}
|
|
385
366
|
knowledgeBaseId={knowledgeBaseId}
|
|
386
367
|
onClose={() => {
|
|
387
|
-
console.log('[MasonryFileItem] Closing note modal');
|
|
388
368
|
setIsNoteModalOpen(false);
|
|
389
369
|
}}
|
|
390
370
|
open={isNoteModalOpen}
|
|
@@ -22,7 +22,7 @@ const NewNoteButton = ({ knowledgeBaseId }: { knowledgeBaseId?: string }) => {
|
|
|
22
22
|
return (
|
|
23
23
|
<>
|
|
24
24
|
<Button icon={FilePenLine} onClick={handleOpen} type="primary">
|
|
25
|
-
{t('header.
|
|
25
|
+
{t('header.newPageButton')}
|
|
26
26
|
</Button>
|
|
27
27
|
|
|
28
28
|
<NoteEditorModal knowledgeBaseId={knowledgeBaseId} onClose={handleClose} open={isModalOpen} />
|
|
@@ -17,13 +17,13 @@ export const TOOGLE_PANEL_BUTTON_ID = 'toggle-panel-button';
|
|
|
17
17
|
const TogglePanelButton = memo(() => {
|
|
18
18
|
const hotkey = useUserStore(settingsSelectors.getHotkeyById(HotkeyEnum.ToggleLeftPanel));
|
|
19
19
|
|
|
20
|
-
const { t } = useTranslation(['file'
|
|
20
|
+
const { t } = useTranslation(['file']);
|
|
21
21
|
|
|
22
22
|
const showFilePanel = useGlobalStore(systemStatusSelectors.showFilePanel);
|
|
23
23
|
const updateSystemStatus = useGlobalStore((s) => s.updateSystemStatus);
|
|
24
24
|
|
|
25
25
|
return (
|
|
26
|
-
<Tooltip hotkey={hotkey} title={t('toggleLeftPanel
|
|
26
|
+
<Tooltip hotkey={hotkey} title={t('toggleLeftPanel')}>
|
|
27
27
|
<ActionIcon
|
|
28
28
|
icon={showFilePanel ? PanelLeftClose : PanelLeftOpen}
|
|
29
29
|
id={TOOGLE_PANEL_BUTTON_ID}
|
|
@@ -97,7 +97,7 @@ const UploadEntries = memo<UploadEntriesProps>(({ knowledgeBaseId }) => {
|
|
|
97
97
|
const newDoc = await createDocument({
|
|
98
98
|
content: '',
|
|
99
99
|
knowledgeBaseId,
|
|
100
|
-
title: t('home.uploadEntries.
|
|
100
|
+
title: t('home.uploadEntries.newPage.title'),
|
|
101
101
|
});
|
|
102
102
|
// Navigate to the newly created document
|
|
103
103
|
// The KnowledgeHomePage will automatically set category to 'documents' when it detects the id param
|
|
@@ -137,7 +137,7 @@ const UploadEntries = memo<UploadEntriesProps>(({ knowledgeBaseId }) => {
|
|
|
137
137
|
<div className={styles.grid}>
|
|
138
138
|
{/* Create New Note */}
|
|
139
139
|
<Flexbox className={styles.card} onClick={handleCreateNote} padding={16}>
|
|
140
|
-
<span className={styles.actionTitle}>{t('home.uploadEntries.
|
|
140
|
+
<span className={styles.actionTitle}>{t('home.uploadEntries.newPage.title')}</span>
|
|
141
141
|
<div className={styles.glow} style={{ background: theme.purple }} />
|
|
142
142
|
<FileTypeIcon
|
|
143
143
|
className={styles.icon}
|
|
@@ -165,7 +165,7 @@ const Home = memo<HomeProps>(({ knowledgeBaseId, onOpenFile }) => {
|
|
|
165
165
|
</div>
|
|
166
166
|
)}
|
|
167
167
|
|
|
168
|
-
{/* Recent
|
|
168
|
+
{/* Recent Pages Section */}
|
|
169
169
|
{(isLoading || topRecentDocuments.length > 0) && (
|
|
170
170
|
<div
|
|
171
171
|
className={styles.section}
|
|
@@ -179,7 +179,7 @@ const Home = memo<HomeProps>(({ knowledgeBaseId, onOpenFile }) => {
|
|
|
179
179
|
<div className={styles.sectionTitleWrapper}>
|
|
180
180
|
<Text className={styles.sectionTitle} style={{ marginBottom: 0 }}>
|
|
181
181
|
<FileTextIcon size={18} />
|
|
182
|
-
{t('home.
|
|
182
|
+
{t('home.recentPages')}
|
|
183
183
|
</Text>
|
|
184
184
|
<div
|
|
185
185
|
className={styles.sectionActions}
|
|
@@ -192,9 +192,9 @@ const Home = memo<HomeProps>(({ knowledgeBaseId, onOpenFile }) => {
|
|
|
192
192
|
items: [
|
|
193
193
|
{
|
|
194
194
|
key: 'all-documents',
|
|
195
|
-
label: t('menu.
|
|
195
|
+
label: t('menu.allPages'),
|
|
196
196
|
onClick: () => {
|
|
197
|
-
setActiveKey(FilesTabs.
|
|
197
|
+
setActiveKey(FilesTabs.Pages);
|
|
198
198
|
},
|
|
199
199
|
},
|
|
200
200
|
],
|
|
@@ -2,7 +2,7 @@ import { memo } from 'react';
|
|
|
2
2
|
|
|
3
3
|
import OllamaSetupGuide from '@/components/OllamaSetupGuide';
|
|
4
4
|
import { isDesktop } from '@/const/version';
|
|
5
|
-
import { ErrorActionContainer } from '@/features/
|
|
5
|
+
import { ErrorActionContainer } from '@/features/ChatList/Error/style';
|
|
6
6
|
|
|
7
7
|
import OllamaDesktopSetupGuide from './Desktop';
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@ import { Image, Markdown } from '@lobehub/ui';
|
|
|
2
2
|
import { memo } from 'react';
|
|
3
3
|
import { Flexbox } from 'react-layout-kit';
|
|
4
4
|
|
|
5
|
-
import Arguments from '@/features/
|
|
5
|
+
import Arguments from '@/features/ChatList/Messages/Group/Tool/Render/Arguments';
|
|
6
6
|
import { ToolCallResult } from '@/libs/mcp';
|
|
7
7
|
|
|
8
8
|
export interface MCPTypeProps {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import React, { memo, useCallback } from 'react';
|
|
4
4
|
import { useTranslation } from 'react-i18next';
|
|
5
5
|
|
|
6
|
-
import { SkeletonList, VirtualizedList } from '@/features/
|
|
6
|
+
import { SkeletonList, VirtualizedList } from '@/features/ChatList';
|
|
7
7
|
import { useChatStore } from '@/store/chat';
|
|
8
8
|
import { chatSelectors } from '@/store/chat/selectors';
|
|
9
9
|
import { useChatGroupStore } from '@/store/chatGroup';
|
|
@@ -7,7 +7,7 @@ import { Trans } from 'react-i18next';
|
|
|
7
7
|
import { Flexbox } from 'react-layout-kit';
|
|
8
8
|
|
|
9
9
|
import { type ActionKeys, ChatInputProvider, DesktopChatInput } from '@/features/ChatInput';
|
|
10
|
-
import WideScreenContainer from '@/features/
|
|
10
|
+
import WideScreenContainer from '@/features/ChatList/components/WideScreenContainer';
|
|
11
11
|
import { useChatStore } from '@/store/chat';
|
|
12
12
|
import { useGlobalStore } from '@/store/global';
|
|
13
13
|
import { systemStatusSelectors } from '@/store/global/selectors';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { memo, useMemo } from 'react';
|
|
2
2
|
|
|
3
|
-
import { ChatItem } from '@/features/
|
|
3
|
+
import { ChatItem } from '@/features/ChatList';
|
|
4
4
|
import { useAgentStore } from '@/store/agent';
|
|
5
5
|
import { agentChatConfigSelectors } from '@/store/agent/selectors';
|
|
6
6
|
import { useChatStore } from '@/store/chat';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { memo, useCallback } from 'react';
|
|
2
2
|
import { Flexbox } from 'react-layout-kit';
|
|
3
3
|
|
|
4
|
-
import { SkeletonList, VirtualizedList } from '@/features/
|
|
4
|
+
import { SkeletonList, VirtualizedList } from '@/features/ChatList';
|
|
5
5
|
import { useFetchThreads } from '@/hooks/useFetchThreads';
|
|
6
6
|
import { useChatStore } from '@/store/chat';
|
|
7
7
|
import { threadSelectors } from '@/store/chat/selectors';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Suspense, memo } from 'react';
|
|
2
2
|
import { Flexbox } from 'react-layout-kit';
|
|
3
3
|
|
|
4
|
-
import { SkeletonList } from '@/features/
|
|
4
|
+
import { SkeletonList } from '@/features/ChatList';
|
|
5
5
|
|
|
6
6
|
import ChatInput from './ChatInput';
|
|
7
7
|
import ChatList from './ChatList';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { memo } from 'react';
|
|
2
2
|
import { Flexbox } from 'react-layout-kit';
|
|
3
3
|
|
|
4
|
-
import { ChatItem } from '@/features/
|
|
4
|
+
import { ChatItem } from '@/features/ChatList';
|
|
5
5
|
import { useChatStore } from '@/store/chat';
|
|
6
6
|
import { chatSelectors } from '@/store/chat/selectors';
|
|
7
7
|
|
|
@@ -17,8 +17,8 @@ import {
|
|
|
17
17
|
} from 'lucide-react';
|
|
18
18
|
import { PropsWithChildren, memo } from 'react';
|
|
19
19
|
import { useTranslation } from 'react-i18next';
|
|
20
|
-
import { Link } from 'react-router-dom';
|
|
21
20
|
import { Flexbox } from 'react-layout-kit';
|
|
21
|
+
import { Link } from 'react-router-dom';
|
|
22
22
|
|
|
23
23
|
import type { MenuProps } from '@/components/Menu';
|
|
24
24
|
import { enableAuth } from '@/const/auth';
|
|
@@ -135,7 +135,11 @@ export const useMenu = () => {
|
|
|
135
135
|
icon: <Icon icon={Cloudy} />,
|
|
136
136
|
key: 'cloud',
|
|
137
137
|
label: (
|
|
138
|
-
<a
|
|
138
|
+
<a
|
|
139
|
+
href={`${OFFICIAL_URL}?utm_source=${UTM_SOURCE}`}
|
|
140
|
+
rel="noopener noreferrer"
|
|
141
|
+
target="_blank"
|
|
142
|
+
>
|
|
139
143
|
{t('userPanel.cloud', { name: LOBE_CHAT_CLOUD })}
|
|
140
144
|
</a>
|
|
141
145
|
),
|
|
@@ -148,7 +152,7 @@ export const useMenu = () => {
|
|
|
148
152
|
{t('changelog')}
|
|
149
153
|
</a>
|
|
150
154
|
) : (
|
|
151
|
-
<Link to="/changelog
|
|
155
|
+
<Link to="/changelog">{t('changelog')}</Link>
|
|
152
156
|
),
|
|
153
157
|
},
|
|
154
158
|
{
|
|
@@ -55,11 +55,11 @@ export default {
|
|
|
55
55
|
},
|
|
56
56
|
documentList: {
|
|
57
57
|
copyContent: '复制全文',
|
|
58
|
-
documentCount: '共 {{count}} 个文档',
|
|
59
58
|
duplicate: '创建副本',
|
|
60
|
-
empty: '
|
|
61
|
-
noResults: '
|
|
62
|
-
|
|
59
|
+
empty: '暂无文稿,点击上方按钮创建你的第一篇文稿',
|
|
60
|
+
noResults: '未找到匹配的文稿',
|
|
61
|
+
pageCount: '共 {{count}} 个文稿',
|
|
62
|
+
selectNote: '选择一个文稿开始编辑',
|
|
63
63
|
untitled: '无标题',
|
|
64
64
|
},
|
|
65
65
|
empty: '暂无已上传文件/文件夹',
|
|
@@ -70,7 +70,6 @@ export default {
|
|
|
70
70
|
uploadFile: '上传文件',
|
|
71
71
|
uploadFolder: '上传文件夹',
|
|
72
72
|
},
|
|
73
|
-
newDocumentButton: '新建文档',
|
|
74
73
|
newNoteDialog: {
|
|
75
74
|
cancel: '取消',
|
|
76
75
|
editTitle: '编辑文档',
|
|
@@ -83,14 +82,15 @@ export default {
|
|
|
83
82
|
title: '新建文档',
|
|
84
83
|
updateSuccess: '文档更新成功',
|
|
85
84
|
},
|
|
85
|
+
newPageButton: '新建文稿',
|
|
86
86
|
uploadButton: '上传',
|
|
87
87
|
},
|
|
88
88
|
home: {
|
|
89
89
|
getStarted: '开始使用',
|
|
90
90
|
greeting: '开始',
|
|
91
91
|
quickActions: '快捷操作',
|
|
92
|
-
recentDocuments: '最近文档',
|
|
93
92
|
recentFiles: '最近文件',
|
|
93
|
+
recentPages: '最近文稿',
|
|
94
94
|
subtitle: '欢迎使用知识库,从这里开始管理你的文档和文档',
|
|
95
95
|
uploadEntries: {
|
|
96
96
|
files: {
|
|
@@ -102,8 +102,8 @@ export default {
|
|
|
102
102
|
knowledgeBase: {
|
|
103
103
|
title: '新建知识库',
|
|
104
104
|
},
|
|
105
|
-
|
|
106
|
-
title: '
|
|
105
|
+
newPage: {
|
|
106
|
+
title: '新建文稿',
|
|
107
107
|
},
|
|
108
108
|
},
|
|
109
109
|
},
|
|
@@ -117,8 +117,8 @@ export default {
|
|
|
117
117
|
title: '知识库',
|
|
118
118
|
},
|
|
119
119
|
menu: {
|
|
120
|
-
allDocuments: '全部文档',
|
|
121
120
|
allFiles: '全部文件',
|
|
121
|
+
allPages: '全部文稿',
|
|
122
122
|
},
|
|
123
123
|
networkError: '获取知识库失败,请检测网络连接后重试',
|
|
124
124
|
notSupportGuide: {
|
|
@@ -143,8 +143,8 @@ export default {
|
|
|
143
143
|
downloadFile: '下载文件',
|
|
144
144
|
unsupportedFileAndContact: '此文件格式暂不支持在线预览,如有预览诉求,欢迎<1>反馈给我们</1>',
|
|
145
145
|
},
|
|
146
|
-
searchDocumentPlaceholder: '搜索文档',
|
|
147
146
|
searchFilePlaceholder: '搜索文件',
|
|
147
|
+
searchPagePlaceholder: '搜索文稿',
|
|
148
148
|
tab: {
|
|
149
149
|
all: '全部',
|
|
150
150
|
audios: '语音',
|
|
@@ -157,9 +157,7 @@ export default {
|
|
|
157
157
|
websites: '网页',
|
|
158
158
|
},
|
|
159
159
|
title: '知识库',
|
|
160
|
-
toggleLeftPanel:
|
|
161
|
-
title: '显示/隐藏左侧面板',
|
|
162
|
-
},
|
|
160
|
+
toggleLeftPanel: '显示/隐藏左侧面板',
|
|
163
161
|
uploadDock: {
|
|
164
162
|
body: {
|
|
165
163
|
collapse: '收起',
|
package/src/services/debug.ts
CHANGED
|
@@ -7,7 +7,7 @@ class DebugService {
|
|
|
7
7
|
// topicCount: 200,
|
|
8
8
|
// });
|
|
9
9
|
//
|
|
10
|
-
// console.log('
|
|
10
|
+
// console.log('Inserted 100k');
|
|
11
11
|
//
|
|
12
12
|
// await DEBUG_MODEL.createRandomData({
|
|
13
13
|
// messageCount: 300_000,
|
|
@@ -15,7 +15,7 @@ class DebugService {
|
|
|
15
15
|
// startIndex: 100_001,
|
|
16
16
|
// topicCount: 200,
|
|
17
17
|
// });
|
|
18
|
-
// console.log('
|
|
18
|
+
// console.log('Inserted 400k');
|
|
19
19
|
//
|
|
20
20
|
// await DEBUG_MODEL.createRandomData({
|
|
21
21
|
// messageCount: 300_000,
|
|
@@ -23,7 +23,7 @@ class DebugService {
|
|
|
23
23
|
// startIndex: 400_001,
|
|
24
24
|
// topicCount: 200,
|
|
25
25
|
// });
|
|
26
|
-
// console.log('
|
|
26
|
+
// console.log('Inserted 700k');
|
|
27
27
|
//
|
|
28
28
|
// await DEBUG_MODEL.createRandomData({
|
|
29
29
|
// messageCount: 300_000,
|
|
@@ -31,7 +31,7 @@ class DebugService {
|
|
|
31
31
|
// startIndex: 700_001,
|
|
32
32
|
// topicCount: 200,
|
|
33
33
|
// });
|
|
34
|
-
// console.log('
|
|
34
|
+
// console.log('Inserted 1M');
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
|
|
@@ -2,35 +2,35 @@ import { DataSyncConfig, MarketAuthorizationParams, dispatch } from '@lobechat/e
|
|
|
2
2
|
|
|
3
3
|
class RemoteServerService {
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* Get remote server configuration
|
|
6
6
|
*/
|
|
7
7
|
getRemoteServerConfig = async () => {
|
|
8
8
|
return dispatch('getRemoteServerConfig');
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
12
|
+
* Set remote server configuration
|
|
13
13
|
*/
|
|
14
14
|
setRemoteServerConfig = async (config: DataSyncConfig) => {
|
|
15
15
|
return dispatch('setRemoteServerConfig', config);
|
|
16
16
|
};
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
|
-
*
|
|
19
|
+
* Clear remote server configuration
|
|
20
20
|
*/
|
|
21
21
|
clearRemoteServerConfig = async () => {
|
|
22
22
|
return dispatch('clearRemoteServerConfig');
|
|
23
23
|
};
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
|
-
*
|
|
26
|
+
* Request authorization
|
|
27
27
|
*/
|
|
28
28
|
requestAuthorization = async (config: DataSyncConfig) => {
|
|
29
29
|
return dispatch('requestAuthorization', config);
|
|
30
30
|
};
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
|
-
*
|
|
33
|
+
* Request Market authorization
|
|
34
34
|
*/
|
|
35
35
|
requestMarketAuthorization = async (params: MarketAuthorizationParams) => {
|
|
36
36
|
return dispatch('requestMarketAuthorization', params);
|
|
@@ -6,42 +6,42 @@ import {
|
|
|
6
6
|
|
|
7
7
|
class DesktopSettingsService {
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
9
|
+
* Get proxy settings
|
|
10
10
|
*/
|
|
11
11
|
getProxySettings = async () => {
|
|
12
12
|
return dispatch('getProxySettings');
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
|
-
*
|
|
16
|
+
* Set proxy settings
|
|
17
17
|
*/
|
|
18
18
|
setSettings = async (data: Partial<NetworkProxySettings>) => {
|
|
19
19
|
return dispatch('setProxySettings', data);
|
|
20
20
|
};
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
|
-
*
|
|
23
|
+
* Get desktop hotkey configuration
|
|
24
24
|
*/
|
|
25
25
|
getDesktopHotkeys = async () => {
|
|
26
26
|
return dispatch('getShortcutsConfig');
|
|
27
27
|
};
|
|
28
28
|
|
|
29
29
|
/**
|
|
30
|
-
*
|
|
30
|
+
* Update desktop hotkey configuration
|
|
31
31
|
*/
|
|
32
32
|
updateDesktopHotkey = async (id: string, accelerator: string): Promise<ShortcutUpdateResult> => {
|
|
33
33
|
return dispatch('updateShortcutConfig', { accelerator, id });
|
|
34
34
|
};
|
|
35
35
|
|
|
36
36
|
/**
|
|
37
|
-
*
|
|
37
|
+
* Test proxy connection
|
|
38
38
|
*/
|
|
39
39
|
testProxyConnection = async (url: string) => {
|
|
40
40
|
return dispatch('testProxyConnection', url);
|
|
41
41
|
};
|
|
42
42
|
|
|
43
43
|
/**
|
|
44
|
-
*
|
|
44
|
+
* Test specified proxy configuration
|
|
45
45
|
*/
|
|
46
46
|
testProxyConfig = async (config: NetworkProxySettings, testUrl?: string) => {
|
|
47
47
|
return dispatch('testProxyConfig', { config, testUrl });
|
package/src/services/mcp.ts
CHANGED
|
@@ -10,9 +10,9 @@ import { desktopClient, toolsClient } from '@/libs/trpc/client';
|
|
|
10
10
|
import { discoverService } from './discover';
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
14
|
-
* @param obj
|
|
15
|
-
* @returns
|
|
13
|
+
* Calculate byte size of object
|
|
14
|
+
* @param obj Object to calculate size of
|
|
15
|
+
* @returns Byte size
|
|
16
16
|
*/
|
|
17
17
|
function calculateObjectSizeBytes(obj: any): number {
|
|
18
18
|
try {
|
|
@@ -85,7 +85,7 @@ class MCPService {
|
|
|
85
85
|
|
|
86
86
|
const isStdio = plugin?.customParams?.mcp?.type === 'stdio';
|
|
87
87
|
|
|
88
|
-
//
|
|
88
|
+
// Record call start time
|
|
89
89
|
const callStartTime = Date.now();
|
|
90
90
|
let success = false;
|
|
91
91
|
let errorCode: string | undefined;
|
|
@@ -108,22 +108,22 @@ class MCPService {
|
|
|
108
108
|
errorCode = 'CALL_FAILED';
|
|
109
109
|
errorMessage = err.message;
|
|
110
110
|
|
|
111
|
-
//
|
|
111
|
+
// Rethrow error, maintain original error handling logic
|
|
112
112
|
throw error;
|
|
113
113
|
} finally {
|
|
114
|
-
//
|
|
114
|
+
// Asynchronously report call result without affecting main flow
|
|
115
115
|
const callEndTime = Date.now();
|
|
116
116
|
const callDurationMs = callEndTime - callStartTime;
|
|
117
117
|
|
|
118
|
-
//
|
|
118
|
+
// Calculate request size
|
|
119
119
|
const inputParams = safeParseJSON(args) || args;
|
|
120
120
|
|
|
121
121
|
const requestSizeBytes = calculateObjectSizeBytes(inputParams);
|
|
122
|
-
//
|
|
122
|
+
// Calculate response size
|
|
123
123
|
const responseSizeBytes = success && result ? calculateObjectSizeBytes(result.state) : 0;
|
|
124
124
|
|
|
125
125
|
const isCustomPlugin = !!customPlugin;
|
|
126
|
-
//
|
|
126
|
+
// Construct report data
|
|
127
127
|
const reportData: CallReportRequest = {
|
|
128
128
|
callDurationMs,
|
|
129
129
|
customPluginInfo: isCustomPlugin
|
|
@@ -151,7 +151,7 @@ class MCPService {
|
|
|
151
151
|
version: plugin.manifest!.version || 'unknown',
|
|
152
152
|
};
|
|
153
153
|
|
|
154
|
-
//
|
|
154
|
+
// Asynchronously report without affecting main flow
|
|
155
155
|
discoverService.reportPluginCall(reportData).catch((reportError) => {
|
|
156
156
|
console.warn('Failed to report MCP tool call:', reportError);
|
|
157
157
|
});
|
|
@@ -172,13 +172,13 @@ class MCPService {
|
|
|
172
172
|
},
|
|
173
173
|
signal?: AbortSignal,
|
|
174
174
|
) {
|
|
175
|
-
//
|
|
176
|
-
//
|
|
175
|
+
// If in Desktop mode and URL is local address, use desktopClient
|
|
176
|
+
// This avoids accessing user local services through remote server in production
|
|
177
177
|
if (isDesktop && isLocalOrPrivateUrl(params.url)) {
|
|
178
178
|
return desktopClient.mcp.getStreamableMcpServerManifest.query(params, { signal });
|
|
179
179
|
}
|
|
180
180
|
|
|
181
|
-
//
|
|
181
|
+
// Otherwise use toolsClient (via server relay)
|
|
182
182
|
return toolsClient.mcp.getStreamableMcpServerManifest.query(params, { signal });
|
|
183
183
|
}
|
|
184
184
|
|
|
@@ -199,16 +199,16 @@ class MCPService {
|
|
|
199
199
|
}
|
|
200
200
|
|
|
201
201
|
/**
|
|
202
|
-
*
|
|
203
|
-
* @param manifest MCP
|
|
204
|
-
* @param signal AbortSignal
|
|
205
|
-
* @returns
|
|
202
|
+
* Check MCP plugin installation status
|
|
203
|
+
* @param manifest MCP plugin manifest
|
|
204
|
+
* @param signal AbortSignal for canceling request
|
|
205
|
+
* @returns Installation check result
|
|
206
206
|
*/
|
|
207
207
|
async checkInstallation(
|
|
208
208
|
manifest: PluginManifest,
|
|
209
209
|
signal?: AbortSignal,
|
|
210
210
|
): Promise<CheckMcpInstallResult> {
|
|
211
|
-
//
|
|
211
|
+
// Pass all deployment options to main process for checking
|
|
212
212
|
return desktopClient.mcp.validMcpServerInstallable.mutate(
|
|
213
213
|
{ deploymentOptions: manifest.deploymentOptions as any },
|
|
214
214
|
{ signal },
|