#[non_exhaustive]pub struct CompactionUpdate {
pub compaction_id: CompactionId,
pub status: CompactionStatus,
pub summary: MaybeUndefined<Vec<ContentBlock>>,
pub error: MaybeUndefined<String>,
pub meta: MaybeUndefined<Meta>,
}unstable_protocol_v2 only.Expand description
A context compaction upsert. The first notification fixes the compaction’s timeline position. Later updates with the same ID patch that entity in place.
summary, error, and _meta have patch semantics: omission leaves the
stored value unchanged, null clears it, and a concrete value replaces it.
summary: [] also clears the summary. A concrete _meta object patches the
stored metadata by top-level key instead of replacing it.
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.compaction_id: CompactionIdThe Agent-owned ID of this compaction, unique within the session.
status: CompactionStatusCurrent lifecycle status.
summary: MaybeUndefined<Vec<ContentBlock>>Complete replacement user-displayable summary content for the compaction.
error: MaybeUndefined<String>Human-readable error details for the compaction.
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 CompactionUpdate
impl CompactionUpdate
Sourcepub fn new(
compaction_id: impl Into<CompactionId>,
status: CompactionStatus,
) -> Self
pub fn new( compaction_id: impl Into<CompactionId>, status: CompactionStatus, ) -> Self
Builds a compaction update with optional patch fields omitted.
Sourcepub fn summary(
self,
summary: impl IntoMaybeUndefined<Vec<ContentBlock>>,
) -> Self
pub fn summary( self, summary: impl IntoMaybeUndefined<Vec<ContentBlock>>, ) -> Self
Sets, clears, or omits the complete retained summary patch.
Sourcepub fn error(self, error: impl IntoMaybeUndefined<String>) -> Self
pub fn error(self, error: impl IntoMaybeUndefined<String>) -> Self
Sets, clears, or omits the error details patch.
Sourcepub fn meta(self, meta: impl IntoMaybeUndefined<Meta>) -> Self
pub fn meta(self, meta: impl IntoMaybeUndefined<Meta>) -> Self
Patches, clears, or leaves unchanged compaction metadata.
A concrete object patches stored metadata by top-level key; see
apply_meta_update.
Trait Implementations§
Source§impl Clone for CompactionUpdate
impl Clone for CompactionUpdate
Source§impl Debug for CompactionUpdate
impl Debug for CompactionUpdate
Source§impl<'de> Deserialize<'de> for CompactionUpdate
impl<'de> Deserialize<'de> for CompactionUpdate
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 CompactionUpdate
Source§impl JsonSchema for CompactionUpdate
impl JsonSchema for CompactionUpdate
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 CompactionUpdate
impl PartialEq for CompactionUpdate
Source§impl Serialize for CompactionUpdate
impl Serialize for CompactionUpdate
impl StructuralPartialEq for CompactionUpdate
Auto Trait Implementations§
impl Freeze for CompactionUpdate
impl RefUnwindSafe for CompactionUpdate
impl Send for CompactionUpdate
impl Sync for CompactionUpdate
impl Unpin for CompactionUpdate
impl UnsafeUnpin for CompactionUpdate
impl UnwindSafe for CompactionUpdate
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.