pub struct ProcessActionIntent { /* private fields */ }Expand description
Provider-neutral, typed intent for a local process action.
The argv vector is intentionally open and does not enumerate allowed commands. This value is proposal evidence only in SP1; it is not an executor and must not be treated as authorization to spawn a process.
Implementations§
Source§impl ProcessActionIntent
impl ProcessActionIntent
Sourcepub fn new(
argv: Vec<String>,
cwd: Option<String>,
env_policy: ProcessEnvPolicy,
stdin_text: Option<String>,
stdout_limit_bytes: usize,
stderr_limit_bytes: usize,
) -> Result<Self, ProcessActionError>
pub fn new( argv: Vec<String>, cwd: Option<String>, env_policy: ProcessEnvPolicy, stdin_text: Option<String>, stdout_limit_bytes: usize, stderr_limit_bytes: usize, ) -> Result<Self, ProcessActionError>
Creates a validated process action intent.
Sourcepub fn with_background(self, background: bool) -> Self
pub fn with_background(self, background: bool) -> Self
Keeps the process after the tool returns when background is true.
The default waits until the process exits or reaches its wait timeout. A retained background process stays until stopped or the owning session ends.
Sourcepub fn with_timeout_secs(
self,
timeout_secs: Option<u64>,
) -> Result<Self, ProcessActionError>
pub fn with_timeout_secs( self, timeout_secs: Option<u64>, ) -> Result<Self, ProcessActionError>
Sets an optional foreground wait timeout in seconds (1..=MAX_PROCESS_WAIT_TIMEOUT_SECS).
When a foreground command is still running after this timeout, the runner does not kill it; it retains the process in the background and returns its id and partial output so the calling LLM can decide how to proceed.
Sourcepub fn with_display_name(self, display_name: Option<String>) -> Self
pub fn with_display_name(self, display_name: Option<String>) -> Self
Attaches an optional short human-readable label for a retained process.
Sourcepub fn cwd(&self) -> Option<&str>
pub fn cwd(&self) -> Option<&str>
Returns the workspace-relative cwd, or None for the workspace root.
Sourcepub const fn env_policy(&self) -> ProcessEnvPolicy
pub const fn env_policy(&self) -> ProcessEnvPolicy
Returns the typed environment policy.
Sourcepub fn stdin_text(&self) -> Option<&str>
pub fn stdin_text(&self) -> Option<&str>
Returns optional inline stdin text.
Sourcepub const fn background(&self) -> bool
pub const fn background(&self) -> bool
Returns whether the runner should retain the process after the tool returns.
Sourcepub const fn timeout_secs(&self) -> Option<u64>
pub const fn timeout_secs(&self) -> Option<u64>
Returns the explicit foreground wait timeout override in seconds, if set.
Sourcepub const fn effective_wait_timeout_secs(&self) -> u64
pub const fn effective_wait_timeout_secs(&self) -> u64
Returns the effective foreground wait timeout in seconds.
Sourcepub fn display_name(&self) -> Option<&str>
pub fn display_name(&self) -> Option<&str>
Returns the optional human-readable display name for this process.
Sourcepub const fn stdout_limit_bytes(&self) -> usize
pub const fn stdout_limit_bytes(&self) -> usize
Returns the stdout capture limit in bytes.
Sourcepub const fn stderr_limit_bytes(&self) -> usize
pub const fn stderr_limit_bytes(&self) -> usize
Returns the stderr capture limit in bytes.
Trait Implementations§
Source§impl Clone for ProcessActionIntent
impl Clone for ProcessActionIntent
Source§impl Debug for ProcessActionIntent
impl Debug for ProcessActionIntent
Source§impl<'de> Deserialize<'de> for ProcessActionIntent
impl<'de> Deserialize<'de> for ProcessActionIntent
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for ProcessActionIntent
Source§impl PartialEq for ProcessActionIntent
impl PartialEq for ProcessActionIntent
Source§impl Serialize for ProcessActionIntent
impl Serialize for ProcessActionIntent
impl StructuralPartialEq for ProcessActionIntent
Auto Trait Implementations§
impl Forget for ProcessActionIntent
impl Freeze for ProcessActionIntent
impl Move for ProcessActionIntent
impl RefUnwindSafe for ProcessActionIntent
impl Send for ProcessActionIntent
impl Sync for ProcessActionIntent
impl Unpin for ProcessActionIntent
impl UnsafeUnpin for ProcessActionIntent
impl UnwindSafe for ProcessActionIntent
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.