#[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. 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 means no metadata update; null is an
explicit clear signal. Implementations MUST NOT make assumptions about values at these keys.
See protocol docs: Extensibility
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
Sets, clears, or leaves unchanged terminal metadata.
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.
Trait Implementations§
Source§impl Clone for TerminalUpdate
impl Clone for TerminalUpdate
Source§fn clone(&self) -> TerminalUpdate
fn clone(&self) -> TerminalUpdate
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§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>,
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 more