diff --git a/src/channels/mod.rs b/src/channels/mod.rs index a85684c..4d5a7b8 100644 --- a/src/channels/mod.rs +++ b/src/channels/mod.rs @@ -78,7 +78,6 @@ fn spawn_supervised_listener( /// Load OpenClaw format bootstrap files into the prompt. fn load_openclaw_bootstrap_files(prompt: &mut String, workspace_dir: &std::path::Path) { - use std::fmt::Write; prompt.push_str("The following workspace files define your identity, behavior, and context.\n\n"); let bootstrap_files = [ diff --git a/src/integrations/registry.rs b/src/integrations/registry.rs index c85ea49..adbab92 100644 --- a/src/integrations/registry.rs +++ b/src/integrations/registry.rs @@ -55,9 +55,15 @@ pub fn all_integrations() -> Vec { }, IntegrationEntry { name: "WhatsApp", - description: "QR pairing via web bridge", + description: "Meta Cloud API via webhook", category: IntegrationCategory::Chat, - status_fn: |_| IntegrationStatus::ComingSoon, + status_fn: |c| { + if c.channels_config.whatsapp.is_some() { + IntegrationStatus::Active + } else { + IntegrationStatus::Available + } + }, }, IntegrationEntry { name: "Signal", @@ -614,9 +620,15 @@ pub fn all_integrations() -> Vec { }, IntegrationEntry { name: "Email", - description: "Send & read emails", + description: "IMAP/SMTP email channel", category: IntegrationCategory::Social, - status_fn: |_| IntegrationStatus::ComingSoon, + status_fn: |c| { + if c.channels_config.email.is_some() { + IntegrationStatus::Active + } else { + IntegrationStatus::Available + } + }, }, // ── Platforms ─────────────────────────────────────────── IntegrationEntry { @@ -798,7 +810,7 @@ mod tests { fn coming_soon_integrations_stay_coming_soon() { let config = Config::default(); let entries = all_integrations(); - for name in ["WhatsApp", "Signal", "Nostr", "Spotify", "Home Assistant"] { + for name in ["Signal", "Nostr", "Spotify", "Home Assistant"] { let entry = entries.iter().find(|e| e.name == name).unwrap(); assert!( matches!((entry.status_fn)(&config), IntegrationStatus::ComingSoon), @@ -807,6 +819,28 @@ mod tests { } } + #[test] + fn whatsapp_available_when_not_configured() { + let config = Config::default(); + let entries = all_integrations(); + let wa = entries.iter().find(|e| e.name == "WhatsApp").unwrap(); + assert!(matches!( + (wa.status_fn)(&config), + IntegrationStatus::Available + )); + } + + #[test] + fn email_available_when_not_configured() { + let config = Config::default(); + let entries = all_integrations(); + let email = entries.iter().find(|e| e.name == "Email").unwrap(); + assert!(matches!( + (email.status_fn)(&config), + IntegrationStatus::Available + )); + } + #[test] fn shell_and_filesystem_always_active() { let config = Config::default();