mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-10-30 01:10:50 +08:00
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:
@@ -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',
|
||||
|
||||
@@ -799,7 +799,6 @@ export default {
|
||||
languageDesc: '选择界面显示语言',
|
||||
featureVisibility: '功能展示',
|
||||
featureVisibilityDesc: '控制控制台页面显示的功能入口',
|
||||
computerUseAgent: 'Computer Use Agent',
|
||||
pasteText: '粘贴文本',
|
||||
videoSettings: '视频采集',
|
||||
videoSettingsDesc: '选择视频采集设备;输入跟随型设备会自动显示当前输入模式',
|
||||
@@ -982,85 +981,26 @@ export default {
|
||||
loadDevicesFailed: '加载设备列表失败',
|
||||
updateFailed: '更新失败',
|
||||
},
|
||||
computerUse: {
|
||||
title: 'Computer Use',
|
||||
status: {
|
||||
waitingScreenshot: '截屏中',
|
||||
thinking: '思考中',
|
||||
executing: '执行中',
|
||||
completed: '已完成',
|
||||
failed: '失败',
|
||||
stopped: '已停止',
|
||||
idle: '空闲',
|
||||
},
|
||||
connection: {
|
||||
connected: '已连接',
|
||||
disconnected: '未连接',
|
||||
socketFailed: 'Computer Use WebSocket 连接失败',
|
||||
messageFailed: '处理 Computer Use WebSocket 消息失败',
|
||||
},
|
||||
buttons: {
|
||||
settings: '设置',
|
||||
clear: '清空',
|
||||
close: '关闭',
|
||||
send: '发送',
|
||||
stop: '停止',
|
||||
save: '保存',
|
||||
clearKey: '清除 Key',
|
||||
},
|
||||
reasoning: {
|
||||
failed: '思考失败',
|
||||
process: '思考过程',
|
||||
thinking: '思考中',
|
||||
},
|
||||
trace: {
|
||||
screenshot: '截图',
|
||||
screenshotAlt: 'Computer Use 截图',
|
||||
executed: '已执行',
|
||||
},
|
||||
input: {
|
||||
placeholder: '输入任务,按下回车换行,按下 Ctrl+Enter 发送',
|
||||
apiKeyRequired: '请先配置 API Key。',
|
||||
},
|
||||
settings: {
|
||||
title: 'Computer Use 设置',
|
||||
enableAi: '启用 AI 操作',
|
||||
model: '模型',
|
||||
apiUrl: 'API URL',
|
||||
apiKey: 'API Key',
|
||||
configured: '已配置:{source}',
|
||||
sourceEnv: '环境变量',
|
||||
sourceConfig: '配置文件',
|
||||
sourceNone: '未配置',
|
||||
},
|
||||
actions: {
|
||||
click: '点击 ({x}, {y}) {button}',
|
||||
doubleClick: '双击 ({x}, {y}) {button}',
|
||||
move: '移动到 ({x}, {y})',
|
||||
drag: '拖拽 {count} 个点',
|
||||
scroll: '滚动 ({x}, {y}) dx={dx} dy={dy}',
|
||||
typeAscii: '输入 {count} 个 ASCII 字符',
|
||||
keypress: '按键 {keys}',
|
||||
wait: '等待 {ms}ms',
|
||||
screenshot: '请求截图',
|
||||
},
|
||||
mouseButtons: {
|
||||
left: '左键',
|
||||
middle: '中键',
|
||||
right: '右键',
|
||||
},
|
||||
errors: {
|
||||
configLoadFailed: '无法加载 Computer Use 配置',
|
||||
taskFailed: 'Computer Use 任务失败',
|
||||
startFailed: 'Computer Use 启动失败',
|
||||
stopFailed: 'Computer Use 停止失败',
|
||||
captureUnavailable: '当前视频画面尚不可用',
|
||||
screenshotFailed: '截图失败',
|
||||
},
|
||||
success: {
|
||||
configSaved: 'Computer Use 配置已保存',
|
||||
apiKeyCleared: 'API Key 已清除',
|
||||
},
|
||||
mcp: {
|
||||
title: "MCP 服务",
|
||||
description: "让外部 AI 工具查看画面,操作键鼠、电源和虚拟介质。",
|
||||
enabled: "启用 MCP",
|
||||
rate: "全局请求频率(每秒 1–100 次)",
|
||||
endpoint: "服务地址",
|
||||
copyEndpoint: "复制服务地址",
|
||||
copyKey: "复制 API Key",
|
||||
copied: "已复制",
|
||||
copyFailed: "复制失败,请手动选择复制",
|
||||
keyConfigured: "已配置 Key,可重新生成后查看。",
|
||||
keyMissing: "启用时会自动生成 Key。",
|
||||
regenerate: "重新生成 Key",
|
||||
connectHint: "在 AI 工具中填写服务地址,并设置 Authorization: Bearer <API Key>。",
|
||||
save: "保存",
|
||||
saved: "MCP 设置已保存",
|
||||
loadFailed: "无法加载 MCP 设置",
|
||||
saveFailed: "无法保存 MCP 设置",
|
||||
invalidRate: "请求频率必须是 1–100 的整数",
|
||||
retry: "重试",
|
||||
},
|
||||
statusCard: {
|
||||
connectionDetails: '连接详情',
|
||||
|
||||
Reference in New Issue
Block a user