pub enum ShellOutcome {
Exit(i32),
Blocked,
Background(BackgroundShellOutcome),
BackgroundLookupError(BackgroundLookupError),
}Expand description
Outcome of a shell execution, carried alongside the rendered text so the
MCP dispatch layer can surface failures in protocol metadata instead of
only as an [exit:N] text footer (GitHub #389: clients had no programmatic
way to detect ctx_shell failures and resorted to fragile regex matching).
Variants§
Exit(i32)
The command ran; carries its real exit code (0 = success).
Blocked
The command never ran (allowlist/validation rejection, or a precondition failure such as an unreadable/oversized input file).
Background(BackgroundShellOutcome)
A managed background job status. Unlike a foreground Exit(1), a
terminal failed job is never reclassified as grep-like result data.
BackgroundLookupError(BackgroundLookupError)
The requested background job is unknown or its retained verdict expired.
Implementations§
Source§impl ShellOutcome
impl ShellOutcome
Sourcepub fn is_error(&self) -> bool
pub fn is_error(&self) -> bool
Whether this outcome must be reported as a tool error (isError: true).
Sourcepub fn structured(&self) -> Option<Value>
pub fn structured(&self) -> Option<Value>
Structured payload for CallToolResult.structuredContent, so guards
can read state/exit/archive data instead of parsing output text.
Ordinary foreground success (exit 0) stays token-neutral; background
status always remains structured because clients may filter its text.
Sourcepub fn is_background_status(&self) -> bool
pub fn is_background_status(&self) -> bool
Whether this is a status body that the common pipeline must secure, archive and render before delivery.
pub fn is_terminal_background_status(&self) -> bool
Trait Implementations§
Source§impl Clone for ShellOutcome
impl Clone for ShellOutcome
Source§impl Debug for ShellOutcome
impl Debug for ShellOutcome
impl Eq for ShellOutcome
Source§impl PartialEq for ShellOutcome
impl PartialEq for ShellOutcome
impl StructuralPartialEq for ShellOutcome
Auto Trait Implementations§
impl Forget for ShellOutcome
impl Freeze for ShellOutcome
impl Move for ShellOutcome
impl RefUnwindSafe for ShellOutcome
impl Send for ShellOutcome
impl Sync for ShellOutcome
impl Unpin for ShellOutcome
impl UnsafeUnpin for ShellOutcome
impl UnwindSafe for ShellOutcome
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,
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.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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