#[non_exhaustive]pub struct TerminalUpdate {
pub terminal_id: TerminalId,
pub command: MaybeUndefined<String>,
pub cwd: MaybeUndefined<AbsolutePath>,
pub output: MaybeUndefined<TerminalOutput>,
pub exit_status: MaybeUndefined<TerminalExitStatus>,
pub meta: MaybeUndefined<Meta>,
}unstable_protocol_v2 only.Expand description
An upsert for the stored state of an agent-owned terminal.
Only TerminalUpdate::terminal_id is required. Other fields have patch
semantics: omitted fields leave the stored value unchanged, null clears
it, and concrete values replace it. A concrete _meta object instead
patches the stored metadata by top-level key. When the terminal ID is new,
omitted fields start unknown.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.terminal_id: TerminalIdUnique identifier for this terminal within the session.
command: MaybeUndefined<String>The command being run.
cwd: MaybeUndefined<AbsolutePath>The absolute working directory of the command.
output: MaybeUndefined<TerminalOutput>An authoritative replacement snapshot of terminal output bytes.
exit_status: MaybeUndefined<TerminalExitStatus>Exit information. A concrete object marks the terminal as exited.
meta: MaybeUndefined<Meta>The _meta property is reserved by ACP to allow clients and agents to attach additional
metadata to their interactions. Omitted leaves the stored metadata unchanged; null
clears it. An object patches the stored metadata by top-level key: keys it omits are
unchanged, a key set to null is removed, and any other value replaces that key’s
stored value without merging nested objects. Beyond this patch rule, implementations
MUST NOT make assumptions about values at these keys.
See protocol docs: Metadata Patches
Implementations§
Source§impl TerminalUpdate
impl TerminalUpdate
Sourcepub fn new(terminal_id: impl Into<TerminalId>) -> Self
pub fn new(terminal_id: impl Into<TerminalId>) -> Self
Builds a terminal upsert with only its required ID set.
Sourcepub fn command(self, command: impl IntoMaybeUndefined<String>) -> Self
pub fn command(self, command: impl IntoMaybeUndefined<String>) -> Self
Sets, clears, or leaves unchanged the command being run.
Sourcepub fn cwd(self, cwd: impl IntoMaybeUndefined<AbsolutePath>) -> Self
pub fn cwd(self, cwd: impl IntoMaybeUndefined<AbsolutePath>) -> Self
Sets, clears, or leaves unchanged the absolute working directory.
Sourcepub fn output(self, output: impl IntoMaybeUndefined<TerminalOutput>) -> Self
pub fn output(self, output: impl IntoMaybeUndefined<TerminalOutput>) -> Self
Sets, clears, or leaves unchanged the authoritative output snapshot.
Sourcepub fn exit_status(
self,
exit_status: impl IntoMaybeUndefined<TerminalExitStatus>,
) -> Self
pub fn exit_status( self, exit_status: impl IntoMaybeUndefined<TerminalExitStatus>, ) -> Self
Sets, clears, or leaves unchanged the terminal exit information.
Sourcepub fn meta(self, meta: impl IntoMaybeUndefined<Meta>) -> Self
pub fn meta(self, meta: impl IntoMaybeUndefined<Meta>) -> Self
Patches, clears, or leaves unchanged terminal metadata.
A concrete object patches stored metadata by top-level key; see
apply_meta_update.
Sourcepub fn apply_update(&mut self, update: TerminalUpdate)
pub fn apply_update(&mut self, update: TerminalUpdate)
Applies a later terminal patch to this stored terminal state.
Fields set to null remain null so callers can distinguish explicit
clearing from an update that did not mention the field. A concrete
_meta object patches the stored metadata by top-level key, as described
by apply_meta_update.
Trait Implementations§
Source§impl Clone for TerminalUpdate
impl Clone for TerminalUpdate
Source§impl Debug for TerminalUpdate
impl Debug for TerminalUpdate
Source§impl<'de> Deserialize<'de> for TerminalUpdate
impl<'de> Deserialize<'de> for TerminalUpdate
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 TerminalUpdate
Source§impl JsonSchema for TerminalUpdate
impl JsonSchema for TerminalUpdate
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl PartialEq for TerminalUpdate
impl PartialEq for TerminalUpdate
Source§impl Serialize for TerminalUpdate
impl Serialize for TerminalUpdate
impl StructuralPartialEq for TerminalUpdate
Auto Trait Implementations§
impl Freeze for TerminalUpdate
impl RefUnwindSafe for TerminalUpdate
impl Send for TerminalUpdate
impl Sync for TerminalUpdate
impl Unpin for TerminalUpdate
impl UnsafeUnpin for TerminalUpdate
impl UnwindSafe for TerminalUpdate
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
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§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.