Enhance tool documentation and add new features

- Added module-level documentation for memory tools (`remember`, `recall`, `forget`) to clarify their purpose.
- Improved documentation in `recall.rs` and `remember.rs` to describe the functionality and flow of memory entry operations.
- Updated `mod.rs` to include descriptions for the tool trait and execution context.
- Enhanced `plan.rs` with detailed comments on plan-mode signaling tools.
- Documented text search tools in `search.rs` to explain their functionality.
- Improved sequential-thinking tool documentation in `seqthink.rs`.
- Added safety filter documentation in `shell_filter` for credential and git operations.
- Enhanced utility tools documentation, including `cd`, `dir_cache_update`, and `todowrite`.
- Improved rendering documentation in view modules (`chat`, `markdown`, `status`, `workflow`) to clarify rendering flows and purposes.
This commit is contained in:
asepharyana
2026-07-12 11:28:39 +07:00
parent 7158d362fd
commit 2efd40ca88
124 changed files with 2379 additions and 19 deletions
+15
View File
@@ -1,6 +1,12 @@
//! Filesystem layout for zesdex's persistent and scratch data directories.
use std::path::PathBuf;
use serde::{Deserialize, Serialize};
/// Resolved paths for all data directories zesdex reads from and writes to.
///
/// Why: centralizing path computation here means every consumer agrees on
/// where memory, scratch, session images, and downloads live.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Store {
pub base_dir: PathBuf,
@@ -11,6 +17,12 @@ pub struct Store {
}
impl Store {
/// Compute the standard set of zesdex data directory paths.
///
/// Flow: OS data dir (or `.local/share` fallback) + "zesdex" → base dir;
/// scratch root comes from the OS temp dir instead, since it's disposable.
///
/// Why: paths are computed, not created — call `ensure_dirs` before use.
pub fn new() -> Self {
let base = dirs::data_dir()
.unwrap_or_else(|| PathBuf::from(".local/share"))
@@ -25,6 +37,9 @@ impl Store {
}
}
/// Create all store directories (base, memory, scratch, session images, downloads) if missing.
///
/// Return: `Err` on the first directory that fails to create.
pub fn ensure_dirs(&self) -> std::io::Result<()> {
std::fs::create_dir_all(&self.base_dir)?;
std::fs::create_dir_all(&self.memory_dir)?;