pub struct WorkspaceContext { /* private fields */ }Expand description
Workspace context builder.
Loads workspace files and builds system prompt sections for injection into agent conversations.
Implementations§
Source§impl WorkspaceContext
impl WorkspaceContext
Sourcepub fn with_config(
workspace_dir: PathBuf,
config: WorkspaceContextConfig,
) -> Self
pub fn with_config( workspace_dir: PathBuf, config: WorkspaceContextConfig, ) -> Self
Create a workspace context with custom config.
Sourcepub fn for_subagent(
workspace_dir: PathBuf,
config: WorkspaceContextConfig,
info: SubagentInfo,
) -> Self
pub fn for_subagent( workspace_dir: PathBuf, config: WorkspaceContextConfig, info: SubagentInfo, ) -> Self
Create a workspace context for a sub-agent session.
Sourcepub fn build_context(&self, session_type: SessionType) -> String
pub fn build_context(&self, session_type: SessionType) -> String
Build system prompt section from workspace files.
Returns a formatted string containing all applicable workspace files for inclusion in the system prompt.
Sourcepub fn audit_files(&self, session_type: SessionType) -> Vec<(String, bool)>
pub fn audit_files(&self, session_type: SessionType) -> Vec<(String, bool)>
Get list of files that should be audited on startup.
Returns a list of (path, exists) tuples for workspace file status.
Sourcepub fn workspace_dir(&self) -> &Path
pub fn workspace_dir(&self) -> &Path
Get the workspace directory.
Auto Trait Implementations§
impl Freeze for WorkspaceContext
impl RefUnwindSafe for WorkspaceContext
impl Send for WorkspaceContext
impl Sync for WorkspaceContext
impl Unpin for WorkspaceContext
impl UnsafeUnpin for WorkspaceContext
impl UnwindSafe for WorkspaceContext
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more