pub trait OutboundReplyTransformer:
Send
+ Sync
+ 'static {
// Required methods
fn id(&self) -> &str;
fn transform<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 OutboundReplyContext,
reply: OutboundReplyKind,
) -> Pin<Box<dyn Future<Output = Result<OutboundReplyKind, TransformError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
Channel-agnostic hook the framework runs before dispatching the agent’s outbound reply. Implementations live in microapps, extensions, or the daemon itself.
Implementations MUST be cheap on the no-op path because every reply pays the chain cost — short-circuit early when the transformer doesn’t apply (e.g. voice-mode disabled for this conversation).
Required Methods§
Sourcefn id(&self) -> &str
fn id(&self) -> &str
Stable identifier surfaced in tracing + error wrapping.
Should be slug-shaped (voice_mode, pii_redactor).
Sourcefn transform<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 OutboundReplyContext,
reply: OutboundReplyKind,
) -> Pin<Box<dyn Future<Output = Result<OutboundReplyKind, TransformError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn transform<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 OutboundReplyContext,
reply: OutboundReplyKind,
) -> Pin<Box<dyn Future<Output = Result<OutboundReplyKind, TransformError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Inspect or rewrite the reply. Returning the input unchanged is the no-op path. The framework hands ownership so impls can mutate-and-return without cloning.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".