feat(mcp): 用 MCP 服务替换内置 AI Agent (#319)

在现有 HTTP 服务挂载 /mcp,让外部 AI 经共享 API Key 调用原分辨率截图、批量键鼠、ATX/WOL 和虚拟介质八个工具。所有调用共用有界 FIFO 和全局限流,复用现有采集管线与硬件控制器。

移除内置模型调用、网页 Agent 面板及旧配置,设置页提供可持续查看的 Key、统一的地址/密钥复制样式。补齐 DEB 的 libudev1 运行依赖。

验证:583 项 Rust 库测试、前端生产构建、ARMv7 设备视觉操作与介质/WOL 实测,以及默认 Release 构建和 DEB 包校验通过。

Refs #319
This commit is contained in:
mofeng-git
2026-10-19 12:12:03 +08:00
parent 3f970ee834
commit 7ea2936436
50 changed files with 2910 additions and 3713 deletions

View File

@@ -800,7 +800,6 @@ export default {
languageDesc: 'Choose the interface display language',
featureVisibility: 'Feature Visibility',
featureVisibilityDesc: 'Control which feature entry points are shown on the console page',
computerUseAgent: 'Computer Use Agent',
pasteText: 'Paste Text',
videoSettings: 'Video Capture',
videoSettingsDesc: 'Select a capture device. Source-following inputs report their active mode automatically.',
@@ -983,85 +982,26 @@ export default {
loadDevicesFailed: 'Failed to load device list',
updateFailed: 'Update failed',
},
computerUse: {
title: 'Computer Use',
status: {
waitingScreenshot: 'Capturing screen',
thinking: 'Thinking',
executing: 'Executing',
completed: 'Completed',
failed: 'Failed',
stopped: 'Stopped',
idle: 'Idle',
},
connection: {
connected: 'Connected',
disconnected: 'Disconnected',
socketFailed: 'Computer Use WebSocket connection failed',
messageFailed: 'Failed to process Computer Use WebSocket message',
},
buttons: {
settings: 'Settings',
clear: 'Clear',
close: 'Close',
send: 'Send',
stop: 'Stop',
save: 'Save',
clearKey: 'Clear Key',
},
reasoning: {
failed: 'Thinking failed',
process: 'Reasoning',
thinking: 'Thinking',
},
trace: {
screenshot: 'Screenshot',
screenshotAlt: 'Computer Use screenshot',
executed: 'Executed',
},
input: {
placeholder: 'Enter a task. Press Enter for a new line; press Ctrl+Enter to send.',
apiKeyRequired: 'Configure an API Key first.',
},
settings: {
title: 'Computer Use Settings',
enableAi: 'Enable AI control',
model: 'Model',
apiUrl: 'API URL',
apiKey: 'API Key',
configured: 'Configured: {source}',
sourceEnv: 'environment variable',
sourceConfig: 'configuration file',
sourceNone: 'not configured',
},
actions: {
click: 'Click ({x}, {y}) {button}',
doubleClick: 'Double-click ({x}, {y}) {button}',
move: 'Move to ({x}, {y})',
drag: 'Drag through {count} points',
scroll: 'Scroll at ({x}, {y}) dx={dx} dy={dy}',
typeAscii: 'Type {count} ASCII characters',
keypress: 'Press {keys}',
wait: 'Wait {ms}ms',
screenshot: 'Request screenshot',
},
mouseButtons: {
left: 'left button',
middle: 'middle button',
right: 'right button',
},
errors: {
configLoadFailed: 'Failed to load Computer Use settings',
taskFailed: 'Computer Use task failed',
startFailed: 'Failed to start Computer Use',
stopFailed: 'Failed to stop Computer Use',
captureUnavailable: 'The current video frame is unavailable',
screenshotFailed: 'Screenshot capture failed',
},
success: {
configSaved: 'Computer Use settings saved',
apiKeyCleared: 'API Key cleared',
},
mcp: {
title: "MCP Service",
description: "Let external AI tools view the screen and control input, power, and virtual media.",
enabled: "Enable MCP",
rate: "Global request rate (1–100 per second)",
endpoint: "Service URL",
copyEndpoint: "Copy service URL",
copyKey: "Copy API key",
copied: "Copied",
copyFailed: "Copy failed. Select and copy the text manually.",
keyConfigured: "A key is configured. Generate a new key to view it.",
keyMissing: "A key is generated automatically when enabled.",
regenerate: "Generate new key",
connectHint: "Configure the service URL and Authorization: Bearer <API Key> in your AI tool.",
save: "Save",
saved: "MCP settings saved",
loadFailed: "Failed to load MCP settings",
saveFailed: "Failed to save MCP settings",
invalidRate: "Request rate must be an integer from 1 to 100",
retry: "Retry",
},
statusCard: {
connectionDetails: 'Connection details',