feat: switch from mcp_core::Role to rmcp::model::Role (#3488)

This commit is contained in:
Alex Hancock
2025-07-18 12:30:23 -04:00
committed by GitHub
parent af872b1794
commit 76da3a9724
42 changed files with 105 additions and 69 deletions
+3 -3
View File
@@ -12,7 +12,7 @@ use crate::message::{Message, MessageContent};
use crate::model::ModelConfig;
use mcp_core::content::TextContent;
use mcp_core::tool::Tool;
use mcp_core::Role;
use rmcp::model::Role;
pub const CLAUDE_CODE_DEFAULT_MODEL: &str = "default";
pub const CLAUDE_CODE_KNOWN_MODELS: &[&str] = &["default"];
@@ -330,7 +330,7 @@ impl ClaudeCodeProvider {
// Extract the first user message text
let description = messages
.iter()
.find(|m| m.role == mcp_core::Role::User)
.find(|m| m.role == rmcp::model::Role::User)
.and_then(|m| {
m.content.iter().find_map(|c| match c {
MessageContent::Text(text_content) => Some(&text_content.text),
@@ -354,7 +354,7 @@ impl ClaudeCodeProvider {
}
let message = Message::new(
mcp_core::Role::Assistant,
rmcp::model::Role::Assistant,
chrono::Utc::now().timestamp(),
vec![MessageContent::Text(mcp_core::content::TextContent {
text: description.clone(),