use mcp_service4agent::manifest::{Dependencies, HealthInfo, Links, ServiceManifest, ServiceMeta};
use mcp_service4agent::router::Endpoint as RouteEndpoint;
const SERVICE_DESCRIPTION: &str = "A mailbox for agent sessions: addresses, messages, threads and acknowledgements, over HTTP and MCP. Knows about participants and rooms; nothing about tasks, runs or workspaces.";
const KEY_REF: &str = "~/.mail4agent/operator-key.raw (bootstrap operator only -- every other participant authenticates with its own secret, minted via POST /admin/participant)";
pub fn service_manifest(endpoints: Vec<RouteEndpoint>, port: u16) -> ServiceManifest {
ServiceManifest {
service: ServiceMeta {
name: "mail4agent".to_string(),
kind: "service".to_string(),
display_name: Some("mail4agent".to_string()),
description: Some(SERVICE_DESCRIPTION.to_string()),
version: Some(env!("CARGO_PKG_VERSION").to_string()),
key_ref: Some(KEY_REF.to_string()),
},
links: Links {
public_url: None,
local_url: Some(format!("http://127.0.0.1:{port}")),
admin_url: None,
docs: Some("mail4agent/CLAUDE.md".to_string()),
repo: Some("mail4agent".to_string()),
},
endpoints: endpoints.into_iter().map(Into::into).collect(),
manage_actions: Vec::new(),
dependencies: Dependencies { upstream: Vec::new(), downstream: vec!["gate4agent".to_string()], external: Vec::new() },
health: Some(HealthInfo { endpoint: "/health".to_string(), expected_status: 200, interval_secs: 30 }),
}
}