fix: 修复 M2.1 骨架编译错误 (import/match/AppConfig 字段)

This commit is contained in:
2026-07-04 15:09:11 +08:00
parent a0c4ca2307
commit 1bb044a3d7
4 changed files with 7 additions and 3 deletions

View File

@@ -103,6 +103,9 @@ fn message_label(message: &Message) -> String {
Message::DeviceCommand(_) => "device_command".to_string(), Message::DeviceCommand(_) => "device_command".to_string(),
Message::DeviceResponse(_) => "device_response".to_string(), Message::DeviceResponse(_) => "device_response".to_string(),
Message::DeviceEvent(_) => "device_event".to_string(), Message::DeviceEvent(_) => "device_event".to_string(),
Message::ChatRequest(_) => "chat_request".to_string(),
Message::ChatResponse(_) => "chat_response".to_string(),
Message::AiModelEvent(_) => "ai_model_event".to_string(),
} }
} }

View File

@@ -24,7 +24,7 @@ pub mod model_manager;
pub use chat::{ChatPipeline, SessionContext}; pub use chat::{ChatPipeline, SessionContext};
use crate::core::message::{Message, StateChanged}; use crate::core::message::Message;
use crate::core::plugin::*; use crate::core::plugin::*;
use anyhow::Result; use anyhow::Result;
use std::path::PathBuf; use std::path::PathBuf;
@@ -137,7 +137,6 @@ impl Plugin for AiPlugin {
if new_state == "talk" || old_state == "talk" { if new_state == "talk" || old_state == "talk" {
println!("[AiPlugin] 画面状态: {old_state}{new_state}"); println!("[AiPlugin] 画面状态: {old_state}{new_state}");
} }
let _ = StateChanged { old_state, new_state }; // 抑制未用警告
} }
_ => {} _ => {}
} }

View File

@@ -1,7 +1,7 @@
use super::HttpState; use super::HttpState;
use crate::core::config::{self, AppConfig}; use crate::core::config::{self, AppConfig};
use crate::core::dispatch; use crate::core::dispatch;
use crate::core::message::{ChatInput, ChatRequest, Destination, Envelope, Message, PlayerCommand, WifiCommand}; use crate::core::message::{ChatInput, ChatRequest, ChatResponse, Destination, Envelope, Message, PlayerCommand, WifiCommand};
use bytes::Buf; use bytes::Buf;
use futures_util::{SinkExt, StreamExt, TryStreamExt}; use futures_util::{SinkExt, StreamExt, TryStreamExt};
use serde::de::DeserializeOwned; use serde::de::DeserializeOwned;

View File

@@ -1750,6 +1750,8 @@ mod tests {
port: 8080, port: 8080,
}, },
ble: BleConfig::default(), ble: BleConfig::default(),
character: Default::default(),
ai: Default::default(),
source_path: PathBuf::from("/tmp/config.json"), source_path: PathBuf::from("/tmp/config.json"),
source_dir: PathBuf::from("/tmp"), source_dir: PathBuf::from("/tmp"),
} }