Skip to main content

LifecycleEvent

Enum LifecycleEvent 

Source
pub enum LifecycleEvent {
    AgentStarted {
        agent_id: String,
        task_description: String,
    },
    AgentCompleted {
        agent_id: String,
        iterations: u32,
        summary: String,
    },
    AgentFailed {
        agent_id: String,
        error: String,
        iterations: u32,
    },
    ToolBeforeExecute {
        agent_id: Option<String>,
        tool_name: String,
        args: Value,
    },
    ToolAfterExecute {
        agent_id: Option<String>,
        tool_name: String,
        success: bool,
        duration_ms: u64,
    },
    ProviderRequest {
        agent_id: Option<String>,
        provider: String,
        model: String,
    },
    ProviderResponse {
        agent_id: Option<String>,
        provider: String,
        model: String,
        input_tokens: u64,
        output_tokens: u64,
        duration_ms: u64,
    },
    ValidationStarted {
        agent_id: String,
        checks: Vec<String>,
    },
    ValidationCompleted {
        agent_id: String,
        passed: bool,
        issues: Vec<String>,
    },
}
Expand description

Events emitted during framework operation.

Variants§

§

AgentStarted

An agent has been created and is about to start.

Fields

§agent_id: String

The agent’s unique identifier.

§task_description: String

Description of the task assigned to the agent.

§

AgentCompleted

An agent completed its task successfully.

Fields

§agent_id: String

The agent’s unique identifier.

§iterations: u32

Number of iterations the agent executed.

§summary: String

Summary of the completed work.

§

AgentFailed

An agent failed to complete its task.

Fields

§agent_id: String

The agent’s unique identifier.

§error: String

Error message describing the failure.

§iterations: u32

Number of iterations before failure.

§

ToolBeforeExecute

A tool is about to be executed.

Fields

§agent_id: Option<String>

The agent invoking the tool, if any.

§tool_name: String

Name of the tool being invoked.

§args: Value

Arguments passed to the tool.

§

ToolAfterExecute

A tool has finished executing.

Fields

§agent_id: Option<String>

The agent that invoked the tool, if any.

§tool_name: String

Name of the tool that was executed.

§success: bool

Whether the tool execution succeeded.

§duration_ms: u64

Duration of the tool execution in milliseconds.

§

ProviderRequest

A request is about to be sent to an AI provider.

Fields

§agent_id: Option<String>

The agent making the request, if any.

§provider: String

Provider name (e.g. “anthropic”, “openai”).

§model: String

Model identifier.

§

ProviderResponse

A response was received from an AI provider.

Fields

§agent_id: Option<String>

The agent that made the request, if any.

§provider: String

Provider name.

§model: String

Model identifier.

§input_tokens: u64

Number of input tokens consumed.

§output_tokens: u64

Number of output tokens generated.

§duration_ms: u64

Duration of the request in milliseconds.

§

ValidationStarted

Validation has started for an agent’s work.

Fields

§agent_id: String

The agent whose work is being validated.

§checks: Vec<String>

Names of the validation checks being run.

§

ValidationCompleted

Validation completed for an agent’s work.

Fields

§agent_id: String

The agent whose work was validated.

§passed: bool

Whether all validation checks passed.

§issues: Vec<String>

List of validation issues found.

Implementations§

Source§

impl LifecycleEvent

Source

pub fn event_type(&self) -> &'static str

Returns the event type name for filtering.

Source

pub fn agent_id(&self) -> Option<&str>

Returns the agent ID associated with this event, if any.

Source

pub fn tool_name(&self) -> Option<&str>

Returns the tool name if this is a tool-related event.

Trait Implementations§

Source§

impl Clone for LifecycleEvent

Source§

fn clone(&self) -> LifecycleEvent

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for LifecycleEvent

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.