mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-10-28 08:20:49 +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:
@@ -165,6 +165,7 @@ impl StreamerState {
|
||||
pub struct Streamer {
|
||||
config: RwLock<StreamerConfig>,
|
||||
mjpeg_handler: Arc<MjpegStreamHandler>,
|
||||
pub(crate) snapshot_slot: super::snapshot::SnapshotSlot,
|
||||
current_device: RwLock<Option<VideoDeviceInfo>>,
|
||||
state: RwLock<StreamerState>,
|
||||
start_lock: tokio::sync::Mutex<()>,
|
||||
@@ -197,6 +198,7 @@ impl Streamer {
|
||||
Arc::new(Self {
|
||||
config: RwLock::new(StreamerConfig::default()),
|
||||
mjpeg_handler: Arc::new(MjpegStreamHandler::new()),
|
||||
snapshot_slot: Default::default(),
|
||||
current_device: RwLock::new(None),
|
||||
state: RwLock::new(StreamerState::Uninitialized),
|
||||
start_lock: tokio::sync::Mutex::new(()),
|
||||
@@ -221,6 +223,7 @@ impl Streamer {
|
||||
Arc::new(Self {
|
||||
config: RwLock::new(config),
|
||||
mjpeg_handler: Arc::new(MjpegStreamHandler::new()),
|
||||
snapshot_slot: Default::default(),
|
||||
current_device: RwLock::new(None),
|
||||
state: RwLock::new(StreamerState::Uninitialized),
|
||||
start_lock: tokio::sync::Mutex::new(()),
|
||||
@@ -1236,6 +1239,7 @@ impl Streamer {
|
||||
});
|
||||
}
|
||||
|
||||
self.snapshot_slot.publish(&frame);
|
||||
self.mjpeg_handler.update_frame(frame);
|
||||
|
||||
fps_frame_count += 1;
|
||||
@@ -1534,6 +1538,7 @@ impl Default for Streamer {
|
||||
Self {
|
||||
config: RwLock::new(StreamerConfig::default()),
|
||||
mjpeg_handler: Arc::new(MjpegStreamHandler::new()),
|
||||
snapshot_slot: Default::default(),
|
||||
current_device: RwLock::new(None),
|
||||
state: RwLock::new(StreamerState::Uninitialized),
|
||||
start_lock: tokio::sync::Mutex::new(()),
|
||||
|
||||
Reference in New Issue
Block a user