Trait Channel
pub trait Channel:
Send
+ Sync
+ Attributable {
Show 35 methods
// Required methods
fn name(&self) -> &str;
fn send<'life0, 'life1, 'async_trait>(
&'life0 self,
message: &'life1 SendMessage,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn listen<'life0, 'async_trait>(
&'life0 self,
tx: Sender<ChannelMessage>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
// Provided methods
fn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait { ... }
fn send_choice<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
recipient: &'life1 str,
prompt: &'life2 str,
options: &'life3 [(String, String)],
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Self: 'async_trait { ... }
fn start_typing<'life0, 'life1, 'async_trait>(
&'life0 self,
_recipient: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait { ... }
fn stop_typing<'life0, 'life1, 'async_trait>(
&'life0 self,
_recipient: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait { ... }
fn supports_draft_updates(&self) -> bool { ... }
fn supports_outbound_send(&self) -> bool { ... }
fn self_handle(&self) -> Option<String> { ... }
fn self_addressed_mention(&self) -> Option<String> { ... }
fn drop_self_messages(&self, msg: &ChannelMessage) -> bool { ... }
fn forge_request<'life0, 'async_trait>(
&'life0 self,
_request: ForgeApiRequest,
) -> Pin<Box<dyn Future<Output = Result<ForgeApiResponse, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait { ... }
fn is_direct_message(&self, _msg: &ChannelMessage) -> bool { ... }
fn supports_multi_message_streaming(&self) -> bool { ... }
fn multi_message_delay_ms(&self) -> u64 { ... }
fn send_draft<'life0, 'life1, 'async_trait>(
&'life0 self,
_message: &'life1 SendMessage,
) -> Pin<Box<dyn Future<Output = Result<Option<String>, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait { ... }
fn update_draft<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_recipient: &'life1 str,
_message_id: &'life2 str,
_text: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Self: 'async_trait { ... }
fn update_draft_progress<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_recipient: &'life1 str,
_message_id: &'life2 str,
_text: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Self: 'async_trait { ... }
fn finalize_draft<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_recipient: &'life1 str,
_message_id: &'life2 str,
_text: &'life3 str,
_suppress_voice: bool,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Self: 'async_trait { ... }
fn cancel_draft<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_recipient: &'life1 str,
_message_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait { ... }
fn add_reaction<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_channel_id: &'life1 str,
_message_id: &'life2 str,
_emoji: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Self: 'async_trait { ... }
fn remove_reaction<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_channel_id: &'life1 str,
_message_id: &'life2 str,
_emoji: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Self: 'async_trait { ... }
fn pin_message<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_channel_id: &'life1 str,
_message_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait { ... }
fn unpin_message<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_channel_id: &'life1 str,
_message_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait { ... }
fn redact_message<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_channel_id: &'life1 str,
_message_id: &'life2 str,
_reason: Option<String>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait { ... }
fn create_room<'life0, 'life1, 'async_trait>(
&'life0 self,
_options: &'life1 RoomCreationOptions,
) -> Pin<Box<dyn Future<Output = Result<String, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait { ... }
fn invite_user<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_room_id: &'life1 str,
_user_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait { ... }
fn request_approval<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_recipient: &'life1 str,
_request: &'life2 ChannelApprovalRequest,
) -> Pin<Box<dyn Future<Output = Result<Option<ChannelApprovalResponse>, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait { ... }
fn request_approval_attributed<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
recipient: &'life1 str,
request: &'life2 ChannelApprovalRequest,
) -> Pin<Box<dyn Future<Output = Result<Option<AttributedApprovalResponse>, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait { ... }
fn send_gate_prompt<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_recipient: &'life1 str,
_prompt: &'life2 ChannelGatePrompt,
) -> Pin<Box<dyn Future<Output = Result<bool, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait { ... }
fn finalize_gate_prompt<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_reference: &'life1 str,
_outcome: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<bool, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait { ... }
fn request_choice<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_question: &'life1 str,
_choices: &'life2 [String],
_timeout: Duration,
) -> Pin<Box<dyn Future<Output = Result<Option<String>, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait { ... }
fn request_multi_choice<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_question: &'life1 str,
_choices: &'life2 [String],
_min_items: usize,
_max_items: usize,
_timeout: Duration,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<String>>, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait { ... }
fn supports_free_form_ask(&self) -> bool { ... }
}Expand description
Core channel trait — implement for any messaging platform.
Every Channel is Attributable: the orchestrator’s spawn site opens
attribution_span!(&*ch) so log emissions from within listen() /
send() inherit channel = <type>.<alias>.
Required Methods§
Provided Methods§
Sourcefn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Check if channel is healthy
Sourcefn send_choice<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
recipient: &'life1 str,
prompt: &'life2 str,
options: &'life3 [(String, String)],
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Self: 'async_trait,
fn send_choice<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
recipient: &'life1 str,
prompt: &'life2 str,
options: &'life3 [(String, String)],
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Self: 'async_trait,
Send a discrete-choice prompt with options.
Each (callback_id, label) pair represents one choice. Whether
the callback_id round-trips on inbound is channel-specific:
- WhatsApp Cloud preserves the
callback_idexactly — it appears asinteractive.button_reply.id/interactive.list_reply.id, surfaced as[choice]<callback_id>in the inboundChannelMessage.content. - Signal uses native polls. Real signal-cli
pollVotepayloads round-trip selected option indexes, surfaced as[choice-index]Nwith a 1-based index. Some alternatepollAnswerpayloads may include selected titles and surface as[choice]<label>, but callers needing stable callback ids should maintain a side map keyed by poll option index. - Default text fallback (Matrix, SMS, IRC, mock) renders a numbered list with a “reply with name or number” hint and relies on the consumer’s own matcher to resolve the user’s text reply against the option list.
options.is_empty() is treated as “send the prompt as plain
text with no choices” rather than rendering an empty selection
hint; if prompt is also empty the call is a no-op (returns
Ok(())).
prompt is the question / title; rendered ABOVE the options.
Sourcefn start_typing<'life0, 'life1, 'async_trait>(
&'life0 self,
_recipient: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn start_typing<'life0, 'life1, 'async_trait>(
&'life0 self,
_recipient: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Signal that the bot is processing a response (e.g. “typing” indicator).
Sourcefn stop_typing<'life0, 'life1, 'async_trait>(
&'life0 self,
_recipient: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn stop_typing<'life0, 'life1, 'async_trait>(
&'life0 self,
_recipient: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Stop any active typing indicator.
Sourcefn supports_draft_updates(&self) -> bool
fn supports_draft_updates(&self) -> bool
Whether this channel supports progressive message updates via draft edits.
Sourcefn supports_outbound_send(&self) -> bool
fn supports_outbound_send(&self) -> bool
Whether send actually delivers a message OUTBOUND on this channel. Default
true. An INBOUND-ONLY transport (e.g. an AMQP trigger source whose send is a
deliberate no-op that returns Ok) overrides this to false, so a surface that
must genuinely deliver - such as the SOP approval route adapter - can refuse to
route to it (and report the misconfiguration) instead of silently succeeding
without sending anything.
Sourcefn self_handle(&self) -> Option<String>
fn self_handle(&self) -> Option<String>
Self-loop guard for multi-agent runs: the bot’s own handle/identity on
this channel, so the orchestrator can drop inbound events whose
sender matches. A bot must never respond to its own messages, even
if a misconfigured peer group lists the bot’s handle as an external
peer.
Channels that handle inbound traffic must override this. The
default None disables both layers of the self-loop guard
(drop_self_messages here and the agent-loop fallback), leaving the
channel unprotected from looping on its own outbound. Outbound-only
channels can keep the default.
Sourcefn self_addressed_mention(&self) -> Option<String>
fn self_addressed_mention(&self) -> Option<String>
The exact form the bot expects when addressed by users on this channel
(e.g. Discord <@snowflake>, Telegram @bot_username). Returned
verbatim into the per-channel system prompt. Default None for
channels with no inbound mention concept. Channels that override
self_handle should usually override this too.
Sourcefn drop_self_messages(&self, msg: &ChannelMessage) -> bool
fn drop_self_messages(&self, msg: &ChannelMessage) -> bool
Whether the orchestrator should drop an inbound message as
self-authored (multi-agent self-loop guard). Default compares
msg.sender against Self::self_handle case-insensitively after
stripping a leading @ from each side. Override only for platforms
whose identity comparison is non-string.
fn forge_request<'life0, 'async_trait>(
&'life0 self,
_request: ForgeApiRequest,
) -> Pin<Box<dyn Future<Output = Result<ForgeApiResponse, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Sourcefn is_direct_message(&self, _msg: &ChannelMessage) -> bool
fn is_direct_message(&self, _msg: &ChannelMessage) -> bool
Whether an inbound message is a direct one-to-one conversation with
the bot. A DM is definitionally addressed to the bot, so the
orchestrator skips the reply-intent classifier and goes straight to
the tool-capable agent turn. Default false: channels that cannot
prove a one-to-one context keep the classifier precheck.
Sourcefn supports_multi_message_streaming(&self) -> bool
fn supports_multi_message_streaming(&self) -> bool
Whether this channel supports multi-message streaming delivery.
Sourcefn multi_message_delay_ms(&self) -> u64
fn multi_message_delay_ms(&self) -> u64
Minimum delay (ms) between sending each paragraph in multi-message mode.
Sourcefn send_draft<'life0, 'life1, 'async_trait>(
&'life0 self,
_message: &'life1 SendMessage,
) -> Pin<Box<dyn Future<Output = Result<Option<String>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn send_draft<'life0, 'life1, 'async_trait>(
&'life0 self,
_message: &'life1 SendMessage,
) -> Pin<Box<dyn Future<Output = Result<Option<String>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Send an initial draft message. Returns a platform-specific message ID for later edits.
Sourcefn update_draft<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_recipient: &'life1 str,
_message_id: &'life2 str,
_text: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Self: 'async_trait,
fn update_draft<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_recipient: &'life1 str,
_message_id: &'life2 str,
_text: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Self: 'async_trait,
Update a previously sent draft message with new accumulated content.
Sourcefn update_draft_progress<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_recipient: &'life1 str,
_message_id: &'life2 str,
_text: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Self: 'async_trait,
fn update_draft_progress<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_recipient: &'life1 str,
_message_id: &'life2 str,
_text: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Self: 'async_trait,
Show a progress/status update (e.g. tool execution status).
Sourcefn finalize_draft<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_recipient: &'life1 str,
_message_id: &'life2 str,
_text: &'life3 str,
_suppress_voice: bool,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Self: 'async_trait,
fn finalize_draft<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_recipient: &'life1 str,
_message_id: &'life2 str,
_text: &'life3 str,
_suppress_voice: bool,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Self: 'async_trait,
Finalize a draft with the complete response (e.g. apply Markdown formatting).
suppress_voice forces text delivery even on voice-only peers.
Sourcefn cancel_draft<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_recipient: &'life1 str,
_message_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn cancel_draft<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_recipient: &'life1 str,
_message_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Cancel and remove a previously sent draft message if the channel supports it.
Sourcefn add_reaction<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_channel_id: &'life1 str,
_message_id: &'life2 str,
_emoji: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Self: 'async_trait,
fn add_reaction<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_channel_id: &'life1 str,
_message_id: &'life2 str,
_emoji: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Self: 'async_trait,
Add a reaction (emoji) to a message.
Sourcefn remove_reaction<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_channel_id: &'life1 str,
_message_id: &'life2 str,
_emoji: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Self: 'async_trait,
fn remove_reaction<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_channel_id: &'life1 str,
_message_id: &'life2 str,
_emoji: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Self: 'async_trait,
Remove a reaction (emoji) from a message previously added by this bot.
Sourcefn pin_message<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_channel_id: &'life1 str,
_message_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn pin_message<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_channel_id: &'life1 str,
_message_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Pin a message in the channel.
Sourcefn unpin_message<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_channel_id: &'life1 str,
_message_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn unpin_message<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_channel_id: &'life1 str,
_message_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Unpin a previously pinned message.
Sourcefn redact_message<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_channel_id: &'life1 str,
_message_id: &'life2 str,
_reason: Option<String>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn redact_message<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_channel_id: &'life1 str,
_message_id: &'life2 str,
_reason: Option<String>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Redact (delete) a message from the channel.
Sourcefn create_room<'life0, 'life1, 'async_trait>(
&'life0 self,
_options: &'life1 RoomCreationOptions,
) -> Pin<Box<dyn Future<Output = Result<String, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn create_room<'life0, 'life1, 'async_trait>(
&'life0 self,
_options: &'life1 RoomCreationOptions,
) -> Pin<Box<dyn Future<Output = Result<String, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Create a new platform room/conversation when the channel supports it.
Sourcefn invite_user<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_room_id: &'life1 str,
_user_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn invite_user<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_room_id: &'life1 str,
_user_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Invite a user to an existing platform room/conversation.
Sourcefn request_approval<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_recipient: &'life1 str,
_request: &'life2 ChannelApprovalRequest,
) -> Pin<Box<dyn Future<Output = Result<Option<ChannelApprovalResponse>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn request_approval<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_recipient: &'life1 str,
_request: &'life2 ChannelApprovalRequest,
) -> Pin<Box<dyn Future<Output = Result<Option<ChannelApprovalResponse>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Request interactive tool-call approval from the channel operator.
Returns Ok(Some(response)) when the operator answers within the
channel’s configured approval_timeout_secs; timeouts surface as
Deny. Returns Ok(None) only for channels that do not implement
the prompt at all — the caller falls back to its default policy
(typically auto-deny).
Sourcefn request_approval_attributed<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
recipient: &'life1 str,
request: &'life2 ChannelApprovalRequest,
) -> Pin<Box<dyn Future<Output = Result<Option<AttributedApprovalResponse>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn request_approval_attributed<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
recipient: &'life1 str,
request: &'life2 ChannelApprovalRequest,
) -> Pin<Box<dyn Future<Output = Result<Option<AttributedApprovalResponse>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Like Channel::request_approval, but also reports which
back-channel produced the decision when this channel fans the request
out. Default delegates to Channel::request_approval with
decided_by: None; only a fan-out bridge needs to override.
Sourcefn send_gate_prompt<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_recipient: &'life1 str,
_prompt: &'life2 ChannelGatePrompt,
) -> Pin<Box<dyn Future<Output = Result<bool, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn send_gate_prompt<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_recipient: &'life1 str,
_prompt: &'life2 ChannelGatePrompt,
) -> Pin<Box<dyn Future<Output = Result<bool, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Present a long-lived, out-of-band gate prompt (e.g. a parked SOP approval) on this channel, rendered natively — an embed with one button per choice on Discord, an inline keyboard on Telegram, and so on.
UNLIKE Channel::request_approval this does NOT wait for the answer:
the prompt outlives the call (and daemon restarts). The choice comes
back through the channel’s normal INBOUND path — a component click
(stamped with an internal sop.gate: marker by the channel’s own
interaction producer, never derivable from message text) or a plain
<choice> <reference> text reply — which the orchestrator resolves
against the parked gate.
Default Ok(false) = “no native prompt on this channel”; the caller
then falls back to a plain text notice carrying the reply instructions.
Sourcefn finalize_gate_prompt<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_reference: &'life1 str,
_outcome: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<bool, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn finalize_gate_prompt<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_reference: &'life1 str,
_outcome: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<bool, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Mark a previously sent gate prompt as resolved: strip its interactive
controls and replace the body with outcome (e.g. “Approved by @user —
run resumed”), so a decided gate cannot be clicked again and the
decision is visible in place. reference is the same correlation key
the prompt was sent with. Best-effort: Ok(false) when this channel
has nothing to finalize (no native prompt, or the mapping was lost to a
restart) — the gate state itself is never affected.
Sourcefn request_choice<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_question: &'life1 str,
_choices: &'life2 [String],
_timeout: Duration,
) -> Pin<Box<dyn Future<Output = Result<Option<String>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn request_choice<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_question: &'life1 str,
_choices: &'life2 [String],
_timeout: Duration,
) -> Pin<Box<dyn Future<Output = Result<Option<String>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Ask the user a multiple-choice question and return the chosen option’s text.
Returns Ok(Some(answer)) if the channel handled the question natively
(e.g. ACP elicitation/create with a single-select enum schema, or
the legacy session/request_permission fallback for older ACP clients;
Telegram inline keyboard; etc.). Returns Ok(None) to signal the
caller should fall back to the generic send + listen flow.
Default impl returns None.
Free-form (no-choices) questions are not modeled by this method.
Multiple-choice support landed via ACP elicitation/create (see
the ACP elicitation RFD: https://agentclientprotocol.com/rfds/elicitation);
free-form text is tracked under that spec’s Phase 2.
fn request_multi_choice<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_question: &'life1 str,
_choices: &'life2 [String],
_min_items: usize,
_max_items: usize,
_timeout: Duration,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<String>>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Sourcefn supports_free_form_ask(&self) -> bool
fn supports_free_form_ask(&self) -> bool
Whether this channel can answer free-form (no-choices) ask_user
questions via the standard send + listen flow. Channels that only
handle structured choices return false so callers fail fast with a
useful error instead of timing out on listen.
Implementations on Foreign Types§
Source§impl Channel for RpcApprovalChannel
impl Channel for RpcApprovalChannel
Source§fn supports_free_form_ask(&self) -> bool
fn supports_free_form_ask(&self) -> bool
Free-form text elicitation is Phase 2 of the elicitation rollout —
the same answer as AcpChannel. Until that lands, tools like
ask_user (with no choices) and escalate_to_human (with
wait_for_response) fail fast on the Code tab.