huskies: merge 858

This commit is contained in:
dave
2026-04-29 10:41:32 +00:00
parent be5db846cc
commit 11d111360d
79 changed files with 265 additions and 0 deletions
@@ -25,6 +25,7 @@ pub struct DiscordTransport {
}
impl DiscordTransport {
/// Creates a new `DiscordTransport` authenticated with the given bot token.
pub fn new(bot_token: String) -> Self {
Self {
bot_token,
+5
View File
@@ -7,10 +7,15 @@
//! receives `MESSAGE_CREATE` events, and dispatches commands.
//! - [`DiscordContext`] — shared context for the bot.
/// Discord bot command handlers — parses and dispatches bot commands from Discord messages.
pub mod commands;
/// Discord message formatter — converts markdown to Discord-compatible markup.
pub mod format;
/// Discord Gateway WebSocket — connects to the Discord Gateway and handles MESSAGE_CREATE events.
pub mod gateway;
/// Discord conversation history — loads prior chat history for context.
pub mod history;
/// DiscordTransport — `ChatTransport` implementation for the Discord Bot API.
pub mod meta;
pub use commands::DiscordContext;
@@ -1,10 +1,17 @@
//! Matrix bot — sub-modules for the Matrix chat bot implementation.
/// Bot context — shared state passed to Matrix bot command handlers.
pub mod context;
/// Matrix message formatter — converts markdown to Matrix HTML.
pub mod format;
/// Conversation history — loads and saves per-room chat history.
pub mod history;
/// Mention detection — identifies messages that mention the bot user.
pub mod mentions;
/// Message handlers — processes incoming Matrix room messages.
pub mod messages;
/// Bot run loop — the main async task that drives the Matrix sync loop.
pub mod run;
/// Device verification — handles Matrix cross-signing and emoji verification flows.
pub mod verification;
// Re-export all public types so existing import paths continue to work.
+9
View File
@@ -15,16 +15,25 @@
//! Multi-room support: configure `room_ids = ["!room1:…", "!room2:…"]` in
//! `bot.toml`. Each room maintains its own independent conversation history.
/// Auto-assign handler — listens for pipeline events and assigns stories to free agents.
pub mod assign;
mod bot;
/// Matrix bot command handlers — parses and routes bot commands from Matrix messages.
pub mod commands;
pub(crate) mod config;
/// Story deletion command — handles `!delete` bot commands to remove work items.
pub mod delete;
/// htop-style agent monitor command — renders a live process table in Matrix.
pub mod htop;
/// Rebuild command — triggers a server rebuild/restart via a bot command.
pub mod rebuild;
/// Reset command — handles `!reset` bot commands to restart the server state.
pub mod reset;
/// rmtree command — handles `!rmtree` bot commands to remove worktrees.
pub mod rmtree;
/// Start command — handles `!start` bot commands to launch agents on stories.
pub mod start;
/// Matrix `ChatTransport` implementation wrapping the Matrix SDK client.
pub mod transport_impl;
pub use bot::{ConversationEntry, ConversationRole, RoomConversation};
@@ -20,6 +20,7 @@ pub struct MatrixTransport {
}
impl MatrixTransport {
/// Creates a new `MatrixTransport` wrapping the given Matrix SDK `Client`.
pub fn new(client: Client) -> Self {
Self { client }
}
+4
View File
@@ -1,5 +1,9 @@
//! Chat transports — pluggable backends (Matrix, Slack, WhatsApp, Discord) for bot messaging.
/// Discord bot transport — sends and receives messages via the Discord REST/Gateway APIs.
pub mod discord;
/// Matrix bot transport — sends messages via the Matrix SDK and runs the sync loop.
pub mod matrix;
/// Slack bot transport — sends messages via the Slack Web API and handles webhook events.
pub mod slack;
/// WhatsApp transport — sends messages via Meta Cloud API and Twilio API.
pub mod whatsapp;
+1
View File
@@ -24,6 +24,7 @@ pub struct SlackTransport {
}
impl SlackTransport {
/// Creates a new `SlackTransport` authenticated with the given bot token.
pub fn new(bot_token: String) -> Self {
Self {
bot_token,
+6
View File
@@ -6,10 +6,15 @@
//! - [`webhook_receive`] — Poem handler for the Slack Events API webhook
//! (POST incoming events including URL verification challenge).
/// Slack bot command handlers — parses and dispatches bot commands from Slack messages.
pub mod commands;
/// Slack message formatter — converts markdown to Slack mrkdwn syntax.
pub mod format;
/// Slack conversation history — loads prior chat history for context.
pub mod history;
/// SlackTransport — `ChatTransport` implementation for the Slack Bot API.
pub mod meta;
/// Slack request signature verification — validates HMAC-SHA256 signatures on incoming webhooks.
pub mod verify;
pub use commands::SlackWebhookContext;
@@ -38,6 +43,7 @@ pub struct SlackEventEnvelope {
pub event: Option<SlackEvent>,
}
/// A single Slack event payload (message, reaction, etc.) nested inside an event callback.
#[derive(Deserialize, Debug)]
pub struct SlackEvent {
pub r#type: Option<String>,
@@ -40,6 +40,7 @@ pub struct WhatsAppTransport {
}
impl WhatsAppTransport {
/// Creates a new `WhatsAppTransport` authenticated with the given Meta Cloud API credentials.
pub fn new(
phone_number_id: String,
access_token: String,
@@ -29,6 +29,7 @@ pub struct TwilioWhatsAppTransport {
}
impl TwilioWhatsAppTransport {
/// Creates a new `TwilioWhatsAppTransport` authenticated with the given Twilio credentials.
pub fn new(account_sid: String, auth_token: String, from_number: String) -> Self {
Self {
account_sid,