Skip to main content

WorkspaceFs

Struct WorkspaceFs 

Source
pub struct WorkspaceFs { /* private fields */ }
Expand description

Production workspace implementation using the real filesystem.

All file operations are performed relative to the repository root using std::fs.

Implementations§

Source§

impl WorkspaceFs

Source

pub fn new(repo_root: PathBuf) -> Self

Create a new workspace filesystem rooted at the given path.

§Arguments
  • repo_root - The repository root directory (typically discovered via git)

Trait Implementations§

Source§

impl Clone for WorkspaceFs

Source§

fn clone(&self) -> WorkspaceFs

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for WorkspaceFs

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Workspace for WorkspaceFs

Source§

fn root(&self) -> &Path

Get the repository root path.
Source§

fn read(&self, relative: &Path) -> Result<String>

Read a file relative to the repository root.
Source§

fn read_bytes(&self, relative: &Path) -> Result<Vec<u8>>

Read a file as bytes relative to the repository root.
Source§

fn write(&self, relative: &Path, content: &str) -> Result<()>

Write content to a file relative to the repository root. Creates parent directories if they don’t exist.
Source§

fn write_bytes(&self, relative: &Path, content: &[u8]) -> Result<()>

Write bytes to a file relative to the repository root. Creates parent directories if they don’t exist.
Source§

fn append_bytes(&self, relative: &Path, content: &[u8]) -> Result<()>

Append bytes to a file relative to the repository root. Creates the file if it doesn’t exist. Creates parent directories if needed.
Source§

fn exists(&self, relative: &Path) -> bool

Check if a path exists relative to the repository root.
Source§

fn is_file(&self, relative: &Path) -> bool

Check if a path is a file relative to the repository root.
Source§

fn is_dir(&self, relative: &Path) -> bool

Check if a path is a directory relative to the repository root.
Source§

fn remove(&self, relative: &Path) -> Result<()>

Remove a file relative to the repository root.
Source§

fn remove_if_exists(&self, relative: &Path) -> Result<()>

Remove a file if it exists, silently succeeding if it doesn’t.
Source§

fn remove_dir_all(&self, relative: &Path) -> Result<()>

Remove a directory and all its contents relative to the repository root. Read more
Source§

fn remove_dir_all_if_exists(&self, relative: &Path) -> Result<()>

Remove a directory and all its contents if it exists, silently succeeding if it doesn’t.
Source§

fn create_dir_all(&self, relative: &Path) -> Result<()>

Create a directory and all parent directories relative to the repository root.
Source§

fn read_dir(&self, relative: &Path) -> Result<Vec<DirEntry>>

List entries in a directory relative to the repository root. Read more
Source§

fn rename(&self, from: &Path, to: &Path) -> Result<()>

Rename/move a file from one path to another relative to the repository root. Read more
Source§

fn write_atomic(&self, relative: &Path, content: &str) -> Result<()>

Write content to a file atomically using temp file + rename pattern. Read more
Source§

fn set_readonly(&self, relative: &Path) -> Result<()>

Set a file to read-only permissions. Read more
Source§

fn set_writable(&self, relative: &Path) -> Result<()>

Set a file to writable permissions. Read more
Source§

fn absolute(&self, relative: &Path) -> PathBuf

Resolve a relative path to an absolute path.
Source§

fn absolute_str(&self, relative: &str) -> String

Resolve a relative path to an absolute path as a string.
Source§

fn agent_dir(&self) -> PathBuf

Path to the .agent directory.
Source§

fn agent_logs(&self) -> PathBuf

Path to the .agent/logs directory.
Source§

fn agent_tmp(&self) -> PathBuf

Path to the .agent/tmp directory.
Source§

fn plan_md(&self) -> PathBuf

Path to .agent/PLAN.md.
Source§

fn issues_md(&self) -> PathBuf

Path to .agent/ISSUES.md.
Source§

fn status_md(&self) -> PathBuf

Path to .agent/STATUS.md.
Source§

fn notes_md(&self) -> PathBuf

Path to .agent/NOTES.md.
Source§

fn commit_message(&self) -> PathBuf

Path to .agent/commit-message.txt.
Source§

fn checkpoint(&self) -> PathBuf

Path to .agent/checkpoint.json.
Source§

fn start_commit(&self) -> PathBuf

Path to .agent/start_commit.
Source§

fn review_baseline(&self) -> PathBuf

Path to .agent/review_baseline.txt.
Source§

fn prompt_md(&self) -> PathBuf

Path to PROMPT.md in the repository root.
Source§

fn prompt_backup(&self) -> PathBuf

Path to .agent/PROMPT.md.backup.
Source§

fn agent_config(&self) -> PathBuf

Path to .agent/config.toml.
Source§

fn agents_toml(&self) -> PathBuf

Path to .agent/agents.toml.
Source§

fn pipeline_log(&self) -> PathBuf

Path to .agent/logs/pipeline.log.
Source§

fn xsd_path(&self, name: &str) -> PathBuf

Path to an XSD schema file in .agent/tmp/.
Source§

fn xml_path(&self, name: &str) -> PathBuf

Path to an XML file in .agent/tmp/.
Source§

fn log_path(&self, name: &str) -> PathBuf

Path to a log file in .agent/logs/.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.