use serde::{Deserialize, Serialize}; use crate::ids::{AgentId, UserId}; /// Which humans may use an agent (spec §7.7 "Other people" toggle). #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] #[serde(tag = "mode", content = "ids", rename_all = "snake_case")] pub enum HumanScope { EntireTeam, Specific(Vec), } /// Which other agents may message an agent (spec §7.7 "Other Claws" toggle). #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] #[serde(tag = "mode", content = "ids", rename_all = "snake_case")] pub enum AgentScope { Any, Specific(Vec), } /// Per-agent access policy (spec §14 AccessPolicy). #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] pub struct AccessPolicy { pub humans: HumanScope, pub agents: AgentScope, } impl Default for AccessPolicy { /// New agents are shared with the whole team and reachable by any claw, /// matching the wizard's defaults (spec §9 step 2). fn default() -> Self { AccessPolicy { humans: HumanScope::EntireTeam, agents: AgentScope::Any, } } }