layer0 0.4.1

Protocol traits for composable agentic AI systems
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//! EchoOperator — returns the input message as the output.

use crate::error::OperatorError;
use crate::operator::{ExitReason, OperatorInput, OperatorOutput};
use async_trait::async_trait;

/// An operator implementation that echoes the input message back as output.
/// Used for testing orchestration, environment, and hook integrations.
pub struct EchoOperator;

#[async_trait]
impl crate::operator::Operator for EchoOperator {
    async fn execute(&self, input: OperatorInput) -> Result<OperatorOutput, OperatorError> {
        Ok(OperatorOutput::new(input.message, ExitReason::Complete))
    }
}