pub trait Workspace:
Send
+ Sync
+ Debug {
// Required methods
fn environment<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<EnvironmentInfo, WorkspaceError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn metadata(&self) -> WorkspaceMetadata;
fn invalidate_environment_cache<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn list_files<'life0, 'life1, 'async_trait>(
&'life0 self,
query: Option<&'life1 str>,
max_results: Option<usize>,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>, WorkspaceError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn working_directory(&self) -> &Path;
fn execute_tool<'life0, 'life1, 'async_trait>(
&'life0 self,
tool_call: &'life1 ToolCall,
context: ExecutionContext,
) -> Pin<Box<dyn Future<Output = Result<ToolResult, WorkspaceError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn available_tools<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Vec<ToolSchema>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn requires_approval<'life0, 'life1, 'async_trait>(
&'life0 self,
tool_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<bool, WorkspaceError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
}Expand description
Core workspace abstraction for environment information and file operations
Required Methods§
Sourcefn environment<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<EnvironmentInfo, WorkspaceError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn environment<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<EnvironmentInfo, WorkspaceError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Get environment information for this workspace
Sourcefn metadata(&self) -> WorkspaceMetadata
fn metadata(&self) -> WorkspaceMetadata
Get workspace metadata
Sourcefn invalidate_environment_cache<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn invalidate_environment_cache<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Invalidate cached environment information (force refresh on next call)
Sourcefn list_files<'life0, 'life1, 'async_trait>(
&'life0 self,
query: Option<&'life1 str>,
max_results: Option<usize>,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>, WorkspaceError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn list_files<'life0, 'life1, 'async_trait>(
&'life0 self,
query: Option<&'life1 str>,
max_results: Option<usize>,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>, WorkspaceError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
List files in the workspace for fuzzy finding Returns workspace-relative paths, filtered by optional query
Sourcefn working_directory(&self) -> &Path
fn working_directory(&self) -> &Path
Get the working directory for this workspace
Sourcefn execute_tool<'life0, 'life1, 'async_trait>(
&'life0 self,
tool_call: &'life1 ToolCall,
context: ExecutionContext,
) -> Pin<Box<dyn Future<Output = Result<ToolResult, WorkspaceError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn execute_tool<'life0, 'life1, 'async_trait>(
&'life0 self,
tool_call: &'life1 ToolCall,
context: ExecutionContext,
) -> Pin<Box<dyn Future<Output = Result<ToolResult, WorkspaceError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Execute a tool in this workspace
Sourcefn available_tools<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Vec<ToolSchema>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn available_tools<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Vec<ToolSchema>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Get available tools in this workspace
Sourcefn requires_approval<'life0, 'life1, 'async_trait>(
&'life0 self,
tool_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<bool, WorkspaceError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn requires_approval<'life0, 'life1, 'async_trait>(
&'life0 self,
tool_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<bool, WorkspaceError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Check if a tool requires approval