pub struct AgentRunEnvelope {Show 17 fields
pub adapter: String,
pub version: String,
pub action: AgentRunAction,
pub run_id: RunId,
pub step_id: StepId,
pub attempt: i32,
pub attestation_ids: Vec<Uuid>,
pub subject_id: Option<String>,
pub material_digests: Option<BTreeMap<String, String>>,
pub policy_decision_id: Option<Uuid>,
pub payload: Option<Value>,
pub checkpoint: Option<Value>,
pub error: Option<Value>,
pub timestamp: DateTime<Utc>,
pub traceparent: Option<String>,
pub capability_token: Option<CapabilityToken>,
pub capability_token_id: Option<String>,
}Expand description
Structured envelope that adapters emit to the runtime.
Fields§
§adapter: String§version: String§action: AgentRunAction§run_id: RunId§step_id: StepId§attempt: i32§attestation_ids: Vec<Uuid>§subject_id: Option<String>§material_digests: Option<BTreeMap<String, String>>§policy_decision_id: Option<Uuid>§payload: Option<Value>§checkpoint: Option<Value>§error: Option<Value>§timestamp: DateTime<Utc>§traceparent: Option<String>§capability_token: Option<CapabilityToken>§capability_token_id: Option<String>Implementations§
Source§impl AgentRunEnvelope
impl AgentRunEnvelope
Sourcepub fn new(
adapter: impl Into<String>,
version: impl Into<String>,
action: AgentRunAction,
ctx: &AgentRunContext,
) -> Self
pub fn new( adapter: impl Into<String>, version: impl Into<String>, action: AgentRunAction, ctx: &AgentRunContext, ) -> Self
Creates a baseline envelope for the supplied action.
Sourcepub fn with_payload(self, payload: Value) -> Self
pub fn with_payload(self, payload: Value) -> Self
Attaches a payload (for emit actions).
Sourcepub fn with_checkpoint(self, state: Value) -> Self
pub fn with_checkpoint(self, state: Value) -> Self
Attaches a checkpoint snapshot (for checkpoint actions).
Sourcepub fn with_error(self, error: Value) -> Self
pub fn with_error(self, error: Value) -> Self
Attaches error metadata (for error actions).
Sourcepub fn with_attestation_ids<I>(self, ids: I) -> Selfwhere
I: IntoIterator<Item = Uuid>,
pub fn with_attestation_ids<I>(self, ids: I) -> Selfwhere
I: IntoIterator<Item = Uuid>,
Registers attestation identifiers associated with this envelope.
Sourcepub fn with_subject_id<S: Into<String>>(self, subject_id: S) -> Self
pub fn with_subject_id<S: Into<String>>(self, subject_id: S) -> Self
Sets the trust subject identifier (run/step/adapter specific).
Sourcepub fn with_material_digests(self, digests: BTreeMap<String, String>) -> Self
pub fn with_material_digests(self, digests: BTreeMap<String, String>) -> Self
Attaches material digests used to derive this step.
Sourcepub fn with_policy_decision_id(self, decision: Uuid) -> Self
pub fn with_policy_decision_id(self, decision: Uuid) -> Self
Associates a policy decision identifier with the envelope.
Sourcepub fn validate(&self) -> Result<(), SchemaValidationError>
pub fn validate(&self) -> Result<(), SchemaValidationError>
Validates the envelope against the embedded AgentRun JSON schema.
Trait Implementations§
Source§impl Clone for AgentRunEnvelope
impl Clone for AgentRunEnvelope
Source§fn clone(&self) -> AgentRunEnvelope
fn clone(&self) -> AgentRunEnvelope
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AgentRunEnvelope
impl Debug for AgentRunEnvelope
Source§impl<'de> Deserialize<'de> for AgentRunEnvelope
impl<'de> Deserialize<'de> for AgentRunEnvelope
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for AgentRunEnvelope
impl RefUnwindSafe for AgentRunEnvelope
impl Send for AgentRunEnvelope
impl Sync for AgentRunEnvelope
impl Unpin for AgentRunEnvelope
impl UnwindSafe for AgentRunEnvelope
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
Converts
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>
Converts
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::RequestSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request