diff --git a/crates/zclaw-kernel/Cargo.toml b/crates/zclaw-kernel/Cargo.toml index 8b273b1..e8fa997 100644 --- a/crates/zclaw-kernel/Cargo.toml +++ b/crates/zclaw-kernel/Cargo.toml @@ -8,7 +8,7 @@ rust-version.workspace = true description = "ZCLAW kernel - central coordinator for all subsystems" [features] -default = [] +default = ["multi-agent"] # Enable multi-agent orchestration (Director, A2A protocol) multi-agent = ["zclaw-protocols/a2a"] diff --git a/crates/zclaw-kernel/src/kernel/a2a.rs b/crates/zclaw-kernel/src/kernel/a2a.rs index c35659e..8679432 100644 --- a/crates/zclaw-kernel/src/kernel/a2a.rs +++ b/crates/zclaw-kernel/src/kernel/a2a.rs @@ -1,16 +1,10 @@ //! A2A (Agent-to-Agent) messaging -//! -//! All items in this module are gated by the `multi-agent` feature flag. -#[cfg(feature = "multi-agent")] use zclaw_types::{AgentId, Capability, Event, Result}; -#[cfg(feature = "multi-agent")] use zclaw_protocols::{A2aAgentProfile, A2aCapability, A2aEnvelope, A2aMessageType, A2aRecipient}; -#[cfg(feature = "multi-agent")] use super::Kernel; -#[cfg(feature = "multi-agent")] impl Kernel { // ============================================================ // A2A (Agent-to-Agent) Messaging diff --git a/crates/zclaw-kernel/src/kernel/adapters.rs b/crates/zclaw-kernel/src/kernel/adapters.rs index f761514..9686718 100644 --- a/crates/zclaw-kernel/src/kernel/adapters.rs +++ b/crates/zclaw-kernel/src/kernel/adapters.rs @@ -106,13 +106,11 @@ impl SkillExecutor for KernelSkillExecutor { /// Inbox wrapper for A2A message receivers that supports re-queuing /// non-matching messages instead of dropping them. -#[cfg(feature = "multi-agent")] pub(crate) struct AgentInbox { pub(crate) rx: tokio::sync::mpsc::Receiver, pub(crate) pending: std::collections::VecDeque, } -#[cfg(feature = "multi-agent")] impl AgentInbox { pub(crate) fn new(rx: tokio::sync::mpsc::Receiver) -> Self { Self { rx, pending: std::collections::VecDeque::new() } diff --git a/crates/zclaw-kernel/src/kernel/agents.rs b/crates/zclaw-kernel/src/kernel/agents.rs index 7fcb859..bfb1e16 100644 --- a/crates/zclaw-kernel/src/kernel/agents.rs +++ b/crates/zclaw-kernel/src/kernel/agents.rs @@ -2,11 +2,8 @@ use zclaw_types::{AgentConfig, AgentId, AgentInfo, Event, Result}; -#[cfg(feature = "multi-agent")] use std::sync::Arc; -#[cfg(feature = "multi-agent")] use tokio::sync::Mutex; -#[cfg(feature = "multi-agent")] use super::adapters::AgentInbox; use super::Kernel; @@ -23,7 +20,6 @@ impl Kernel { self.memory.save_agent(&config).await?; // Register with A2A router for multi-agent messaging (before config is moved) - #[cfg(feature = "multi-agent")] { let profile = Self::agent_config_to_a2a_profile(&config); let rx = self.a2a_router.register_agent(profile).await; @@ -52,7 +48,6 @@ impl Kernel { self.memory.delete_agent(id).await?; // Unregister from A2A router - #[cfg(feature = "multi-agent")] { self.a2a_router.unregister_agent(id).await; self.a2a_inboxes.remove(id); diff --git a/crates/zclaw-kernel/src/kernel/mod.rs b/crates/zclaw-kernel/src/kernel/mod.rs index b804f12..488f188 100644 --- a/crates/zclaw-kernel/src/kernel/mod.rs +++ b/crates/zclaw-kernel/src/kernel/mod.rs @@ -8,16 +8,13 @@ mod hands; mod triggers; mod approvals; mod orchestration; -#[cfg(feature = "multi-agent")] mod a2a; use std::sync::Arc; use tokio::sync::{broadcast, Mutex}; use zclaw_types::{Event, Result, AgentState}; -#[cfg(feature = "multi-agent")] use zclaw_types::AgentId; -#[cfg(feature = "multi-agent")] use zclaw_protocols::A2aRouter; use crate::registry::AgentRegistry; @@ -56,11 +53,9 @@ pub struct Kernel { mcp_adapters: Arc>>, /// Dynamic industry keyword configs — shared with Tauri frontend, loaded from SaaS industry_keywords: Arc>>, - /// A2A router for inter-agent messaging (gated by multi-agent feature) - #[cfg(feature = "multi-agent")] + /// A2A router for inter-agent messaging a2a_router: Arc, /// Per-agent A2A inbox receivers (supports re-queuing non-matching messages) - #[cfg(feature = "multi-agent")] a2a_inboxes: Arc>>>, } @@ -135,7 +130,6 @@ impl Kernel { } // Initialize A2A router for multi-agent support - #[cfg(feature = "multi-agent")] let a2a_router = { let kernel_agent_id = AgentId::new(); Arc::new(A2aRouter::new(kernel_agent_id)) @@ -159,9 +153,7 @@ impl Kernel { extraction_driver: None, mcp_adapters: Arc::new(std::sync::RwLock::new(Vec::new())), industry_keywords: Arc::new(tokio::sync::RwLock::new(Vec::new())), - #[cfg(feature = "multi-agent")] a2a_router, - #[cfg(feature = "multi-agent")] a2a_inboxes: Arc::new(dashmap::DashMap::new()), }) } diff --git a/crates/zclaw-kernel/src/lib.rs b/crates/zclaw-kernel/src/lib.rs index b5c69d3..5cb5e26 100644 --- a/crates/zclaw-kernel/src/lib.rs +++ b/crates/zclaw-kernel/src/lib.rs @@ -10,7 +10,6 @@ pub mod trigger_manager; pub mod config; pub mod scheduler; pub mod skill_router; -#[cfg(feature = "multi-agent")] pub mod director; pub mod generation; pub mod export; @@ -21,13 +20,11 @@ pub use capabilities::*; pub use events::*; pub use config::*; pub use trigger_manager::{TriggerManager, TriggerEntry, TriggerUpdateRequest, TriggerManagerConfig}; -#[cfg(feature = "multi-agent")] pub use director::{ Director, DirectorConfig, DirectorBuilder, DirectorAgent, ConversationState, ScheduleStrategy, // Note: AgentRole is intentionally NOT re-exported here — use generation::AgentRole instead }; -#[cfg(feature = "multi-agent")] pub use zclaw_protocols::{ A2aRouter, A2aAgentProfile, A2aCapability, A2aEnvelope, A2aMessageType, A2aRecipient, A2aReceiver, diff --git a/desktop/src-tauri/src/kernel_commands/a2a.rs b/desktop/src-tauri/src/kernel_commands/a2a.rs index 8532797..b2416e1 100644 --- a/desktop/src-tauri/src/kernel_commands/a2a.rs +++ b/desktop/src-tauri/src/kernel_commands/a2a.rs @@ -1,4 +1,4 @@ -//! A2A (Agent-to-Agent) commands — gated behind `multi-agent` feature +//! A2A (Agent-to-Agent) commands use serde_json; use tauri::State; @@ -7,10 +7,9 @@ use zclaw_types::AgentId; use super::KernelState; // ============================================================ -// A2A (Agent-to-Agent) Commands — gated behind multi-agent feature +// A2A (Agent-to-Agent) Commands // ============================================================ -#[cfg(feature = "multi-agent")] /// Send a direct A2A message from one agent to another // @connected #[tauri::command] @@ -44,7 +43,6 @@ pub async fn agent_a2a_send( } /// Broadcast a message from one agent to all other agents -#[cfg(feature = "multi-agent")] // @connected #[tauri::command] pub async fn agent_a2a_broadcast( @@ -66,7 +64,6 @@ pub async fn agent_a2a_broadcast( } /// Discover agents with a specific capability -#[cfg(feature = "multi-agent")] // @connected #[tauri::command] pub async fn agent_a2a_discover( @@ -88,7 +85,6 @@ pub async fn agent_a2a_discover( } /// Delegate a task to another agent and wait for response -#[cfg(feature = "multi-agent")] // @connected #[tauri::command] pub async fn agent_a2a_delegate_task( @@ -116,11 +112,10 @@ pub async fn agent_a2a_delegate_task( } // ============================================================ -// Butler Delegation Command — multi-agent feature +// Butler Delegation Command // ============================================================ /// Butler delegates a user request to expert agents via the Director. -#[cfg(feature = "multi-agent")] // @reserved: butler multi-agent delegation // @connected #[tauri::command] diff --git a/desktop/src-tauri/src/kernel_commands/mod.rs b/desktop/src-tauri/src/kernel_commands/mod.rs index 88535ea..6075abc 100644 --- a/desktop/src-tauri/src/kernel_commands/mod.rs +++ b/desktop/src-tauri/src/kernel_commands/mod.rs @@ -19,7 +19,6 @@ pub mod skill; pub mod trigger; pub mod workspace; -#[cfg(feature = "multi-agent")] pub mod a2a; // --------------------------------------------------------------------------- diff --git a/desktop/src-tauri/src/lib.rs b/desktop/src-tauri/src/lib.rs index ea0361b..8f9837f 100644 --- a/desktop/src-tauri/src/lib.rs +++ b/desktop/src-tauri/src/lib.rs @@ -255,16 +255,11 @@ pub fn run() { kernel_commands::scheduled_task::scheduled_task_create, kernel_commands::scheduled_task::scheduled_task_list, - // A2A commands gated behind multi-agent feature - #[cfg(feature = "multi-agent")] + // A2A commands kernel_commands::a2a::agent_a2a_send, - #[cfg(feature = "multi-agent")] kernel_commands::a2a::agent_a2a_broadcast, - #[cfg(feature = "multi-agent")] kernel_commands::a2a::agent_a2a_discover, - #[cfg(feature = "multi-agent")] kernel_commands::a2a::agent_a2a_delegate_task, - #[cfg(feature = "multi-agent")] kernel_commands::a2a::butler_delegate_task, // Pipeline commands (DSL-based workflows)