pub struct FilesystemWorkspace { /* private fields */ }Expand description
A safe headless adapter rooted at one canonical workspace directory.
Implementations§
Source§impl FilesystemWorkspace
impl FilesystemWorkspace
Sourcepub async fn new<I>(
root: impl AsRef<Path>,
allowed_roots: I,
mutations_allowed: bool,
) -> Result<Self>where
I: IntoIterator<Item = PathBuf>,
pub async fn new<I>(
root: impl AsRef<Path>,
allowed_roots: I,
mutations_allowed: bool,
) -> Result<Self>where
I: IntoIterator<Item = PathBuf>,
Construct an adapter. The current adapter exposes one canonical root; an empty allowlist means only the supplied root is visible.
Sourcepub fn with_limits(self, limits: FilesystemLimits) -> Self
pub fn with_limits(self, limits: FilesystemLimits) -> Self
Replace the default workspace limits.
Sourcepub fn with_allowed_commands<I, S>(self, commands: I) -> Self
pub fn with_allowed_commands<I, S>(self, commands: I) -> Self
Replace the allowlisted check executables.
Sourcepub fn with_checks_allowed(self, checks_allowed: bool) -> Self
pub fn with_checks_allowed(self, checks_allowed: bool) -> Self
Configure whether the runtime may execute the allowlisted checks.
Sourcepub async fn proposal_for_turn(
&self,
proposal_id: &str,
) -> Result<PatchProposal>
pub async fn proposal_for_turn( &self, proposal_id: &str, ) -> Result<PatchProposal>
Return a still-current proposal for an active runtime turn handoff.
Rechecking the snapshots here prevents a browser proposal from being handed to the agent after an external edit occurred between proposal creation and turn submission.
Trait Implementations§
Source§impl Clone for FilesystemWorkspace
impl Clone for FilesystemWorkspace
Source§fn clone(&self) -> FilesystemWorkspace
fn clone(&self) -> FilesystemWorkspace
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FilesystemWorkspace
impl Debug for FilesystemWorkspace
Source§impl RuntimeAdapter for FilesystemWorkspace
impl RuntimeAdapter for FilesystemWorkspace
Source§fn status<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<RuntimeStatus>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn status<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<RuntimeStatus>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Return current workspace and permission state.
Source§fn list_files<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<WorkspaceFile>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_files<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<WorkspaceFile>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
List files visible to the session.
Source§fn read_file<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<FileSnapshot>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn read_file<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<FileSnapshot>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Read one visible file.
Source§fn propose_changes<'life0, 'async_trait>(
&'life0 self,
changes: Vec<FileChange>,
) -> Pin<Box<dyn Future<Output = Result<PatchProposal>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn propose_changes<'life0, 'async_trait>(
&'life0 self,
changes: Vec<FileChange>,
) -> Pin<Box<dyn Future<Output = Result<PatchProposal>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Validate and stage a proposal without mutating the workspace.
Source§fn apply_proposal<'life0, 'life1, 'async_trait>(
&'life0 self,
proposal_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<AppliedChange>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn apply_proposal<'life0, 'life1, 'async_trait>(
&'life0 self,
proposal_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<AppliedChange>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Apply a proposal through the runtime’s approval authority.
Source§fn run_checks<'life0, 'life1, 'async_trait>(
&'life0 self,
command: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<CheckResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn run_checks<'life0, 'life1, 'async_trait>(
&'life0 self,
command: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<CheckResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Run a runtime-approved check command.
Source§fn revert_last_change<'life0, 'life1, 'async_trait>(
&'life0 self,
change_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<AppliedChange>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn revert_last_change<'life0, 'life1, 'async_trait>(
&'life0 self,
change_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<AppliedChange>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Revert a still-current last change.
Source§fn request_turn<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
prompt: &'life1 str,
_proposal_id: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<TurnResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn request_turn<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
prompt: &'life1 str,
_proposal_id: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<TurnResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Submit a prompt and optional validated proposal to the active runtime.
Auto Trait Implementations§
impl !RefUnwindSafe for FilesystemWorkspace
impl !UnwindSafe for FilesystemWorkspace
impl Freeze for FilesystemWorkspace
impl Send for FilesystemWorkspace
impl Sync for FilesystemWorkspace
impl Unpin for FilesystemWorkspace
impl UnsafeUnpin for FilesystemWorkspace
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