adk-surface 3.0.0

Agent surfaces for ADK-Rust: one engine that turns a kernel's sessions, decisions and activity into plain words for every surface, and the surfaces that show them
Documentation
//! Chat channels (spec 3.3 §5.3, §6.1; feature `channels`): the doorbell and the
//! conversation, through someone else's servers.
//!
//! A chat adapter moves messages; the kernel's channel contract
//! ([`adk_kernel::channels`], §10 K1) owns every rule. The adapter turns the platform's
//! updates into [`ChannelInbound`](adk_kernel::channels::ChannelInbound) values for
//! [`ChannelGateway::receive`](adk_kernel::channels::ChannelGateway::receive), and renders
//! what the gateway sends through [`ChannelSink`](adk_kernel::channels::ChannelSink).
//!
//! | Rule | Where it is kept |
//! |---|---|
//! | Only paired accounts reach an agent; a stranger gets a pairing code and starts nothing (S-I6) | The gateway |
//! | A card carries the agent, a short summary with every argument value masked, and the risk, never the call's arguments (S-I5) | The gateway's `DecisionCard`. The adapter adds the time it was asked and a link to the home; with the approval service at hand it heads the card with the tool's name in plain words ("Send email"), and keeps the kernel's summary under it only when an approval route wrote one |
//! | Chat answers **Allow once** or **Deny**, at low and medium risk, never money or high risk (§7.2, §7.4) | The gateway sets a card's answers and refuses any other; the adapter offers a card's answers as buttons and no others |
//! | An answer carries the version the card showed; a second answer is shown, never retried (S-I2) | The gateway, through `ApprovalService::decide` |
//! | "stop all" stops everything; resuming happens only in the home (S-I10) | The gateway; the adapter lists `/stop` among the bot's commands |
//! | A stranger's messages never hold up a paired person's, "stop all" and answers included (S-I6, S-I10) | The adapter: a paired account's updates are handed over first, a failed update is read again only when it is a paired account's and the failure may clear, and nothing sent to a stranger waits out a rate limit |
//! | Typed text never answers a decision (S-I4) | The adapter: only a pressed button becomes an answer |
//! | Text from a model, a tool or a person is escaped before display (S-I9) | The adapter |
//! | A person's words are only what they saw (S-I6) | The adapter drops the characters Telegram shows as nothing from typed text: controls, zero-width characters, variation selectors and the tag block |
//!
//! | Platform | Adapter | Transport |
//! |---|---|---|
//! | Telegram | [`TelegramAdapter`] | Bot API long polling (`getUpdates`): no inbound port, so the home stays on loopback (§13 decision 10) |
//! | WhatsApp (`whatsapp`) | `WhatsAppAdapter` | The official WhatsApp Business Cloud API only: a webhook the host mounts on a public HTTPS address, every body's `X-Hub-Signature-256` checked before it is read; the Graph API out, and outside the 24-hour window only an approved template (spec 3.5 §10 X12) |
//! | Slack (`slack`) | `SlackAdapter` | Socket Mode, a WebSocket the adapter opens, every envelope acknowledged; the Web API with Block Kit out; no inbound port |
//! | Discord (`discord`) | `DiscordAdapter` | The Gateway WebSocket with heartbeat, resume and reconnect; REST with button components out, `allowed_mentions: {"parse": []}`; no inbound port |
//! | Matrix (`matrix`) | `MatrixAdapter` | `/sync` long polling with the `since` token; `m.room.message` out. No buttons: a card's answers are reaction keys, and only the paired account's reaction on that card answers it; unencrypted direct chats only; no inbound port |
//! | Microsoft Teams (`teams`) | `TeamsAdapter` | A bot registered with Azure Bot Service: the Bot Framework's activity webhook the host serves on a public HTTPS address, every request's Bot Connector JWT checked against the connector's OpenID keys before it is read; the Bot Connector REST API out with a Microsoft Entra ID token; a card as an Adaptive Card whose `Action.Execute` buttons carry the decision and version; one-on-one chats only |

#[cfg(feature = "discord")]
mod discord;
#[cfg(feature = "matrix")]
mod matrix;
mod media;
#[cfg(any(
    feature = "whatsapp",
    feature = "slack",
    feature = "discord",
    feature = "matrix",
    feature = "teams"
))]
mod shared;
#[cfg(feature = "slack")]
mod slack;
#[cfg(feature = "teams")]
mod teams;
mod telegram;
#[cfg(feature = "whatsapp")]
mod whatsapp;

#[cfg(feature = "discord")]
pub use discord::{
    DISCORD, DISCORD_CHANNEL, DiscordAdapter, DiscordAdapterBuilder, DiscordConnection,
    DiscordError,
};
#[cfg(feature = "matrix")]
pub use matrix::{
    MATRIX, MATRIX_CHANNEL, MatrixAdapter, MatrixAdapterBuilder, MatrixError, MatrixSync,
};
#[cfg(any(
    feature = "whatsapp",
    feature = "slack",
    feature = "discord",
    feature = "matrix",
    feature = "teams"
))]
pub use shared::ChannelConnection;
#[cfg(feature = "slack")]
pub use slack::{
    SLACK, SLACK_CHANNEL, SlackAdapter, SlackAdapterBuilder, SlackConnection, SlackError,
};
#[cfg(feature = "teams")]
pub use teams::{
    TEAMS, TEAMS_CHANNEL, TeamsAdapter, TeamsAdapterBuilder, TeamsError, TeamsWebhook,
};
pub use telegram::{
    TELEGRAM, TELEGRAM_CHANNEL, TelegramAdapter, TelegramAdapterBuilder, TelegramError,
    TelegramPolling,
};
#[cfg(feature = "whatsapp")]
pub use whatsapp::{
    WHATSAPP, WHATSAPP_CHANNEL, WhatsAppAdapter, WhatsAppAdapterBuilder, WhatsAppError,
    WhatsAppWebhook,
};