Skip to main content

CommandMemoryContext

Trait CommandMemoryContext 

Source
pub trait CommandMemoryContext {
Show 13 methods // Required methods fn memory_path(&self) -> PathBuf; fn memory_enabled(&self) -> bool; fn status(&self) -> Result<MemoryStatus, String>; fn path(&self) -> Result<PathBuf, String>; fn workspace_id(&self, workspace: &Path) -> Result<String, String>; fn search( &self, workspace: &Path, query: &str, limit: usize, ) -> Result<Vec<MemoryHit>, String>; fn remember( &self, target: MemoryRememberTarget, note: &str, ) -> Result<MemoryRemembered, String>; fn import(&self) -> Result<MemoryImportOutcome, String>; fn get(&self, workspace: &Path, id: i64) -> Result<MemoryGetOutcome, String>; fn export(&self) -> Result<MemoryExport, String>; fn reindex(&self) -> Result<MemoryReindex, String>; fn delete(&self, scope: MemoryDeleteScope) -> Result<MemoryDelete, String>; fn delete_workspace(&self, workspace: &Path) -> Result<MemoryDelete, String>;
}
Expand description

Host memory data for the memory command group (FEAT-019 D1).

Exposes the resolved user-memory file path, the enablement flag, and one typed method per exposed native-memory operation. All results are contract-owned portable values; implementation errors cross as safe text. Workspace-scoped operations take the borrowed workspace path as their first argument (D8); non-workspace operations never receive workspace authority and the facet never captures or retains workspace state internally.

Required Methods§

Source

fn memory_path(&self) -> PathBuf

The resolved user-memory file path.

Source

fn memory_enabled(&self) -> bool

Whether the [memory] enabled / DEEPSEEK_MEMORY=on flag is set.

Source

fn status(&self) -> Result<MemoryStatus, String>

Native-memory root, global source, and index paths.

Source

fn path(&self) -> Result<PathBuf, String>

The native-memory root path.

Source

fn workspace_id(&self, workspace: &Path) -> Result<String, String>

Workspace identity for the given workspace path.

Source

fn search( &self, workspace: &Path, query: &str, limit: usize, ) -> Result<Vec<MemoryHit>, String>

Workspace-scoped search over the native-memory store.

Source

fn remember( &self, target: MemoryRememberTarget, note: &str, ) -> Result<MemoryRemembered, String>

Append a reviewed note to the typed global or workspace target.

Source

fn import(&self) -> Result<MemoryImportOutcome, String>

Import legacy memory; distinguishes imported from skipped.

Source

fn get(&self, workspace: &Path, id: i64) -> Result<MemoryGetOutcome, String>

Workspace-scoped get by entry id; not-found is a typed outcome.

Source

fn export(&self) -> Result<MemoryExport, String>

Export the native-memory document content.

Source

fn reindex(&self) -> Result<MemoryReindex, String>

Reindex the native-memory store; returns the indexed entry count.

Source

fn delete(&self, scope: MemoryDeleteScope) -> Result<MemoryDelete, String>

Delete all or global scope; never receives workspace authority.

Source

fn delete_workspace(&self, workspace: &Path) -> Result<MemoryDelete, String>

Delete the given workspace scope; workspace path is the first argument.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§