use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize)]
pub struct TopicInfo {
pub topic: &'static str,
pub title: &'static str,
pub when_to_use: &'static str,
pub keywords: &'static [&'static str],
pub file: &'static str,
#[serde(skip_serializing)] pub content: &'static str, }
#[derive(Debug, Serialize)]
pub struct TopicSummary {
pub topic: &'static str,
pub title: &'static str,
pub when_to_use: &'static str,
pub keywords: &'static [&'static str],
}
#[derive(Debug, Deserialize)]
pub struct JsonRpcRequest {
#[allow(dead_code)]
pub jsonrpc: String,
pub id: Option<serde_json::Value>,
pub method: String,
#[serde(default)]
pub params: Option<serde_json::Value>,
}
#[derive(Debug, Serialize)]
pub struct JsonRpcResponse {
pub jsonrpc: &'static str,
pub id: Option<serde_json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
pub result: Option<serde_json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
pub error: Option<JsonRpcError>,
}
#[derive(Debug, Serialize)]
pub struct JsonRpcError {
pub code: i32,
pub message: String,
}
#[derive(Debug, Serialize)]
pub struct InitializeResult {
#[serde(rename = "protocolVersion")]
pub protocol_version: &'static str,
pub capabilities: Capabilities,
#[serde(rename = "serverInfo")]
pub server_info: ServerInfo,
}
#[derive(Debug, Serialize)]
pub struct Capabilities {
pub tools: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Serialize)]
pub struct ServerInfo {
pub name: &'static str,
pub version: &'static str,
}
#[derive(Debug, Serialize)]
pub struct ToolSchema {
pub name: &'static str,
pub description: &'static str,
#[serde(rename = "inputSchema")]
pub input_schema: serde_json::Value,
}
#[derive(Debug, Serialize)]
pub struct ToolsListResult {
pub tools: Vec<ToolSchema>,
}
#[derive(Debug, Serialize)]
pub struct ToolResult {
pub content: Vec<ToolContent>,
}
#[derive(Debug, Serialize)]
pub struct ToolContent {
pub r#type: &'static str,
pub text: String,
}
#[derive(Debug, Clone)]
pub(crate) struct DocumentMatch {
pub topic: String,
pub title: String,
pub when_to_use: String,
pub keywords: Vec<String>,
pub file_path: String,
pub matched_keywords: Vec<String>,
pub relevance_score: f32,
}