Files
zesdex/apps/infrastructure/src/tools/memory/forget.rs
T
asepharyana da2ed6da25 feat(tui): add usage overlay and sidebar for displaying usage statistics and tasks
feat(tui): implement status bar with connection and turn state indicators
feat(tui): create workflow panel for agent status and progress visualization
feat(web): introduce web frontend interface with static file serving
feat(ws): add WebSocket interface for real-time communication and session management
2026-07-20 09:04:57 +07:00

40 lines
996 B
Rust

//! Delete a memory by name.
use crate::tools::{Tool, ToolCtx};
use anyhow::Result;
use serde_json::{json, Value};
use zesdex_domain::cms::MemoryRepository;
pub struct Forget;
impl Tool for Forget {
fn name(&self) -> &'static str {
"forget"
}
fn description(&self) -> &'static str {
"Delete a saved memory by name"
}
fn parameters(&self) -> Value {
json!({
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Name of the memory to delete"
}
},
"required": ["name"]
})
}
fn run(&self, ctx: &ToolCtx, args: &Value) -> Result<String> {
let name = crate::tools::arg_str(args, "name")?;
let repo = crate::persistence::cms::memory_repo::MarkdownMemoryRepository::new();
repo.delete(&ctx.memory_dir, &name)?;
Ok(format!("Memory '{}' deleted", name))
}
}