diff --git a/CHANGELOG.md b/CHANGELOG.md index 0053b47..5ebfcef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ ## [main] 0.0.6 - 修复部分因为服务器名称特殊字符而导致的保存实效的错误 - 插件模式下,左侧管理面板中的「MCP连接(工作区)」视图可以进行增删改查了 -- 新增「MCP连接(全局)」,用于安装全局范围的 mcp server +- 新增「安装的 MCP 服务器」,用于安装全局范围的 mcp server - 增加引导页面 ## [main] 0.0.5 diff --git a/README.md b/README.md index 6d1f556..590d433 100644 --- a/README.md +++ b/README.md @@ -6,11 +6,10 @@ 👉 加入 OpenMCP正式级技术组 -加入 OpenMCP咖啡厅 - -加入 OpenMCP正式级宣传组 + + ## OpenMCP 一款用于 MCP 服务端调试的一体化 vscode/trae 插件。 diff --git a/package.json b/package.json index 746cdfe..aa44c58 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "openmcp", "displayName": "OpenMCP", "description": "An all in one MCP Client/TestTool", - "version": "0.0.5", + "version": "0.0.6", "publisher": "kirigaya", "author": { "name": "kirigaya", @@ -65,6 +65,15 @@ "category": "openmcp", "icon": "$(gear)" }, + { + "command": "openmcp.sidebar.installed-connection.revealWebviewPanel", + "title": "连接", + "category": "openmcp", + "icon": { + "light": "./icons/light/protocol.svg", + "dark": "./icons/dark/protocol.svg" + } + }, { "command": "openmcp.sidebar.installed-connection.deleteConnection", "title": "删除连接", @@ -134,7 +143,7 @@ { "command": "openmcp.sidebar.workspace-connection.revealWebviewPanel", "group": "inline@1", - "when": "view == openmcp.sidebar.workspace-connection || view == openmcp.sidebar.installed-connection", + "when": "view == openmcp.sidebar.workspace-connection", "args": { "view": "${viewItem}" } @@ -147,6 +156,14 @@ "view": "${viewItem}" } }, + { + "command": "openmcp.sidebar.installed-connection.revealWebviewPanel", + "group": "inline@1", + "when": "view == openmcp.sidebar.installed-connection", + "args": { + "view": "${viewItem}" + } + }, { "command": "openmcp.sidebar.installed-connection.deleteConnection", "group": "inline@2", diff --git a/renderer/public/mcp.css b/renderer/public/mcp.css index 10631bf..38374ab 100644 --- a/renderer/public/mcp.css +++ b/renderer/public/mcp.css @@ -205,7 +205,7 @@ a { } .openmcp-image { - background-image: url('./images/openmcp.png'); + background-image: url('https://picx.zhimg.com/80/v2-a0aa51e8a61f86586e374520995b5df5_1440w.png?source=d16d100b'); background-size: contain; background-repeat: no-repeat; background-position: center; diff --git a/renderer/src/components/guide/tour.vue b/renderer/src/components/guide/tour.vue index ddc9c68..d30b87d 100644 --- a/renderer/src/components/guide/tour.vue +++ b/renderer/src/components/guide/tour.vue @@ -232,7 +232,8 @@ 终章?
-
(base)   .openmcp cat KEY
+                
(base)   .openmcp cat KEY
 直面恐惧,创造未来
 Face your fears, create the future
 恐怖に直面し、未来を創り出
@@ -282,4 +283,9 @@ function finishTour() { padding: 5px; margin: 5px 0; } + +.tour-common-text code { + color: unset!important; + background-color: unset!important; +} \ No newline at end of file diff --git a/renderer/src/components/main-panel/chat/index.vue b/renderer/src/components/main-panel/chat/index.vue index 06757de..280042b 100644 --- a/renderer/src/components/main-panel/chat/index.vue +++ b/renderer/src/components/main-panel/chat/index.vue @@ -56,7 +56,7 @@ diff --git a/renderer/src/components/main-panel/chat/message/user.vue b/renderer/src/components/main-panel/chat/message/user.vue index 32944f5..0afd440 100644 --- a/renderer/src/components/main-panel/chat/message/user.vue +++ b/renderer/src/components/main-panel/chat/message/user.vue @@ -9,7 +9,7 @@
@@ -39,6 +39,9 @@ import { ChatStorage, IRenderMessage } from '../chat'; import KCuteTextarea from '@/components/k-cute-textarea/index.vue'; import { ElMessage } from 'element-plus'; +import { useI18n } from 'vue-i18n'; +const { t } = useI18n(); + const props = defineProps({ message: { type: Object as PropType, diff --git a/renderer/src/i18n/ar.json b/renderer/src/i18n/ar.json index c5656df..12a7445 100644 --- a/renderer/src/i18n/ar.json +++ b/renderer/src/i18n/ar.json @@ -146,5 +146,6 @@ "press-and-run": "اكتب سؤالاً لبدء الاختبار", "connect-sigature": "توقيع الاتصال", "finish-refresh": "تم التحديث", - "add-system-prompt.name-placeholder": "عنوان prompt المخصص" + "add-system-prompt.name-placeholder": "عنوان prompt المخصص", + "enter-message-dot": "أدخل الرسالة..." } \ No newline at end of file diff --git a/renderer/src/i18n/de.json b/renderer/src/i18n/de.json index eae497b..15a1e3c 100644 --- a/renderer/src/i18n/de.json +++ b/renderer/src/i18n/de.json @@ -146,5 +146,6 @@ "press-and-run": "Geben Sie eine Frage ein, um den Test zu starten", "connect-sigature": "Verbindungssignatur", "finish-refresh": "Aktualisierung abgeschlossen", - "add-system-prompt.name-placeholder": "Titel für benutzerdefinierte Eingabeaufforderung" + "add-system-prompt.name-placeholder": "Titel für benutzerdefinierte Eingabeaufforderung", + "enter-message-dot": "Nachricht eingeben..." } \ No newline at end of file diff --git a/renderer/src/i18n/en.json b/renderer/src/i18n/en.json index 09c4488..5252960 100644 --- a/renderer/src/i18n/en.json +++ b/renderer/src/i18n/en.json @@ -146,5 +146,6 @@ "press-and-run": "Type a question to start the test", "connect-sigature": "Connection signature", "finish-refresh": "Refresh completed", - "add-system-prompt.name-placeholder": "Title for custom prompt" + "add-system-prompt.name-placeholder": "Title for custom prompt", + "enter-message-dot": "Enter message..." } \ No newline at end of file diff --git a/renderer/src/i18n/fr.json b/renderer/src/i18n/fr.json index be9733f..25e4a04 100644 --- a/renderer/src/i18n/fr.json +++ b/renderer/src/i18n/fr.json @@ -146,5 +146,6 @@ "press-and-run": "Tapez une question pour commencer le test", "connect-sigature": "Signature de connexion", "finish-refresh": "Actualisation terminée", - "add-system-prompt.name-placeholder": "Titre de l'invite personnalisée" + "add-system-prompt.name-placeholder": "Titre de l'invite personnalisée", + "enter-message-dot": "Entrez un message..." } \ No newline at end of file diff --git a/renderer/src/i18n/ja.json b/renderer/src/i18n/ja.json index 8ed46ba..02db8fc 100644 --- a/renderer/src/i18n/ja.json +++ b/renderer/src/i18n/ja.json @@ -146,5 +146,6 @@ "press-and-run": "テストを開始するには質問を入力してください", "connect-sigature": "接続署名", "finish-refresh": "更新が完了しました", - "add-system-prompt.name-placeholder": "カスタムプロンプトのタイトル" + "add-system-prompt.name-placeholder": "カスタムプロンプトのタイトル", + "enter-message-dot": "メッセージを入力..." } \ No newline at end of file diff --git a/renderer/src/i18n/ko.json b/renderer/src/i18n/ko.json index 4eb61eb..601e09b 100644 --- a/renderer/src/i18n/ko.json +++ b/renderer/src/i18n/ko.json @@ -146,5 +146,6 @@ "press-and-run": "테스트를 시작하려면 질문을 입력하세요", "connect-sigature": "연결 서명", "finish-refresh": "새로 고침 완료", - "add-system-prompt.name-placeholder": "사용자 지정 프롬프트 제목" + "add-system-prompt.name-placeholder": "사용자 지정 프롬프트 제목", + "enter-message-dot": "메시지를 입력하세요..." } \ No newline at end of file diff --git a/renderer/src/i18n/ru.json b/renderer/src/i18n/ru.json index 6a087ed..1234304 100644 --- a/renderer/src/i18n/ru.json +++ b/renderer/src/i18n/ru.json @@ -146,5 +146,6 @@ "press-and-run": "Введите вопрос, чтобы начать тест", "connect-sigature": "Подпись соединения", "finish-refresh": "Обновление завершено", - "add-system-prompt.name-placeholder": "Заголовок пользовательского prompt" + "add-system-prompt.name-placeholder": "Заголовок пользовательского prompt", + "enter-message-dot": "Введите сообщение..." } \ No newline at end of file diff --git a/renderer/src/i18n/zh-cn.json b/renderer/src/i18n/zh-cn.json index cc1149d..980d56c 100644 --- a/renderer/src/i18n/zh-cn.json +++ b/renderer/src/i18n/zh-cn.json @@ -146,5 +146,6 @@ "press-and-run": "键入问题以开始测试", "connect-sigature": "连接签名", "finish-refresh": "完成刷新", - "add-system-prompt.name-placeholder": "输入自定义 prompt 的标题" + "add-system-prompt.name-placeholder": "输入自定义 prompt 的标题", + "enter-message-dot": "输入消息..." } \ No newline at end of file diff --git a/renderer/src/i18n/zh-tw.json b/renderer/src/i18n/zh-tw.json index 162744f..ad43897 100644 --- a/renderer/src/i18n/zh-tw.json +++ b/renderer/src/i18n/zh-tw.json @@ -146,5 +146,6 @@ "press-and-run": "輸入問題以開始測試", "connect-sigature": "連接簽名", "finish-refresh": "刷新完成", - "add-system-prompt.name-placeholder": "自定義提示的標題" + "add-system-prompt.name-placeholder": "自定義提示的標題", + "enter-message-dot": "輸入訊息..." } \ No newline at end of file diff --git a/src/common/index.ts b/src/common/index.ts index 7410f88..47f675b 100644 --- a/src/common/index.ts +++ b/src/common/index.ts @@ -5,11 +5,7 @@ export const registerTreeDataProviders = new Map { + // 分割命令字符串 + const parts = command.split(' '); + + // 遍历命令部分,寻找第一个可能是路径的部分 + for (let i = 1; i < parts.length; i++) { + const part = parts[i]; + + // 跳过以 '-' 开头的参数 + if (part.startsWith('-')) continue; + + // 处理相对路径 + let fullPath = part; + if (!fspath.isAbsolute(part)) { + fullPath = fspath.join(cwd, part); + } + + console.log(fullPath); + + if (fs.existsSync(fullPath)) { + return fullPath; + } + } + + return undefined; +} diff --git a/src/sidebar/installed.controller.ts b/src/sidebar/installed.controller.ts index 641f161..3cd2a43 100644 --- a/src/sidebar/installed.controller.ts +++ b/src/sidebar/installed.controller.ts @@ -3,6 +3,7 @@ import { RegisterCommand, RegisterTreeDataProvider } from '../common'; import { ConnectionViewItem } from './common'; import { getConnectionConfig, getInstalledConnectionConfigPath, saveConnectionConfig } from '../global'; import { acquireInstalledConnection, deleteInstalledConnection } from './installed.service'; +import { revealOpenMcpWebviewPanel } from '../webview/webview.service'; @RegisterTreeDataProvider('openmcp.sidebar.installed-connection') export class McpInstalledConnectProvider implements vscode.TreeDataProvider { @@ -29,6 +30,11 @@ export class McpInstalledConnectProvider implements vscode.TreeDataProvider { // 让用户选择连接类型 const connectionType = await vscode.window.showQuickPick(['stdio', 'sse'], { - placeHolder: '请选择连接类型' + placeHolder: '请选择连接类型', + canPickMany: false }); if (!connectionType) { @@ -88,13 +89,16 @@ export async function acquireInstalledConnection(): Promise { + const html = fs.readFileSync(htmlIndexPath, { encoding: 'utf-8' })?.replace(/( { const absLocalPath = fspath.resolve(viewRoot, $2); const webviewUri = panel.webview.asWebviewUri(vscode.Uri.file(absLocalPath)); const replaceHref = $1 + webviewUri?.toString() + '"'; return replaceHref; - }); + }); return html; } @@ -26,6 +26,7 @@ export function getLaunchCWD(context: vscode.ExtensionContext, uri: vscode.Uri) export function revealOpenMcpWebviewPanel( context: vscode.ExtensionContext, + type: 'workspace' | 'installed', panelKey: string, option: IConnectionItem = { type: 'stdio', @@ -92,7 +93,11 @@ export function revealOpenMcpWebviewPanel( break; case 'vscode/update-connection-sigature': - updateWorkspaceConnectionConfig(panelKey, data); + if (type === 'installed') { + updateInstalledConnectionConfig(panelKey, data); + } else { + updateWorkspaceConnectionConfig(panelKey, data); + } break; default: