use rmcp::schemars::JsonSchema;
use serde::{Deserialize, Serialize};
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
pub struct StoreMemoryParams {
#[schemars(
description = "The information to remember. Write as a clear, self-contained fact."
)]
pub text: String,
#[schemars(
description = "Optional structured labels like {\"topic\": \"auth\", \"type\": \"decision\"}."
)]
pub metadata: Option<serde_json::Value>,
#[serde(default)]
#[schemars(
description = "Memory type: fact, preference, procedure, guard, observation (default: fact)."
)]
pub memory_type: Option<String>,
#[serde(default)]
#[schemars(description = "Memory status: active, candidate (default: active).")]
pub status: Option<String>,
#[serde(default)]
#[schemars(
description = "ID of memory to supersede (creates new memory, marks old as superseded)."
)]
pub supersedes: Option<String>,
}
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
pub struct SupersedeMemoryParams {
#[schemars(description = "The new text content that replaces the old memory.")]
pub new_text: String,
#[schemars(description = "ID of the memory to supersede.")]
pub old_memory_id: String,
#[serde(default)]
#[schemars(description = "Memory type for the new memory (default: same as old, or fact).")]
pub memory_type: Option<String>,
#[serde(default)]
#[schemars(description = "Optional metadata for the new memory.")]
pub metadata: Option<serde_json::Value>,
}
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
pub struct SearchMemoriesParams {
#[schemars(description = "What to look for in natural language.")]
pub query: String,
#[schemars(description = "Maximum number of results to return (default: 5).")]
pub limit: Option<usize>,
#[schemars(description = "Filter by memory types (e.g., fact, preference, procedure).")]
pub memory_types: Option<Vec<String>>,
#[schemars(description = "Filter by statuses (e.g., active, candidate).")]
pub statuses: Option<Vec<String>>,
#[serde(default)]
#[schemars(description = "Recency weight (0.0-1.0). Default: config value (0.3).")]
pub recency_weight: Option<f64>,
#[serde(default)]
#[schemars(description = "Use hybrid search (semantic + BM25). Default: config value.")]
pub hybrid: Option<bool>,
}
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
pub struct ListMemoriesParams {
#[schemars(description = "Maximum number of memories to list (default: 10).")]
pub limit: Option<usize>,
#[schemars(description = "Filter by memory types (e.g., fact, preference, procedure).")]
pub memory_types: Option<Vec<String>>,
#[schemars(description = "Filter by statuses (e.g., active, candidate).")]
pub statuses: Option<Vec<String>>,
}
#[derive(Debug, Serialize)]
pub struct SuccessResponse {
pub id: String,
pub status: String,
}
#[derive(Debug, Serialize)]
pub struct ConflictMemory {
pub id: String,
pub content: String,
pub similarity: f64,
}