1#![cfg_attr(test, allow(clippy::panic))]
2#[cfg(target_arch = "wasm32")]
7pub mod tokio {
8 pub use tokio_with_wasm::alias::*;
9}
10
11pub mod identity;
12pub mod inbox;
13pub mod inproc;
14pub mod peer_meta;
15pub mod transport;
16pub mod trust;
17pub mod types;
18
19#[cfg(not(target_arch = "wasm32"))]
21pub mod host_acceptor;
22#[cfg(not(target_arch = "wasm32"))]
23pub mod io_task;
24#[cfg(not(target_arch = "wasm32"))]
25pub mod plain_listener;
26
27pub mod agent;
28pub(crate) mod classify;
29pub mod event_injector;
30pub mod mcp;
31pub(crate) mod peer_types;
32pub mod router;
33pub mod runtime;
34
35pub use event_injector::CommsEventInjector;
36#[cfg(not(target_arch = "wasm32"))]
37pub use host_acceptor::{
38 HostAcceptorBounds, HostAcceptorConfig, HostAcceptorError, HostAcceptorHandle,
39 HostAcceptorIdentityRegistry, HostAcceptorIdentityReplacementReservation,
40 HostAcceptorRegistrationMaterial, HostPairingConfig, PairingRateLimit, spawn_host_acceptor,
41};
42pub use identity::{IdentityError, Keypair, PubKey, Signature};
43pub use inbox::{AdmissionOutcome, DropReason, Inbox, InboxError, InboxSender};
44pub use inproc::{
45 InprocPeerInfo, InprocPublicationError, InprocRegistry, InprocSendError, RegistrationOutcome,
46 RegistrationRejection,
47};
48#[cfg(not(target_arch = "wasm32"))]
49pub use io_task::{IoTaskError, handle_connection};
50pub use peer_meta::PeerMeta;
51#[cfg(not(target_arch = "wasm32"))]
52pub use plain_listener::{PlainIngressFault, PlainIngressFaults, handle_plain_connection};
53pub use router::{
54 CommsConfig, DEFAULT_MAX_MESSAGE_BYTES, DeclaredReplyEndpoint, Router, SendError,
55};
56#[cfg(not(target_arch = "wasm32"))]
57pub use transport::codec::{EnvelopeFrame, TransportCodec};
58pub use transport::{PeerAddr, TransportError};
59pub use trust::{TrustEntry, TrustError, TrustResolveError, TrustStore, TrustedPeersView};
60pub use types::{Envelope, InboxItem, MessageKind, SenderContentTaint, Status};
61
62pub use runtime::comms_bootstrap::{
64 CommsAdvertise, CommsBootstrap, CommsBootstrapError, CommsBootstrapMode, ParentCommsContext,
65 PreparedComms,
66};
67pub use runtime::comms_config::CoreCommsConfig;
68#[cfg(not(target_arch = "wasm32"))]
69pub use runtime::comms_config::ResolvedCommsConfig;
70pub use runtime::comms_runtime::{
71 CommsRuntime, CommsRuntimeError, CommsToolMaterial, PeerRequestResponseAuthority,
72 PreparedCommsRuntime,
73};
74#[cfg(not(target_arch = "wasm32"))]
75pub use runtime::comms_runtime::{constant_time_str_eq, validate_pairing_secret};
76
77pub use agent::dispatcher::{
78 CommsToolDispatcher, DynCommsToolDispatcher, NoOpDispatcher, comms_tool_defs,
79};
80pub use mcp::tools::{
81 RuntimeCommsCommandHandle, ToolContext, comms_tool_unavailable_reason, handle_tools_call,
82 handle_tools_call_with_context, tools_list,
83};
84
85inventory::submit! {
87 meerkat_capabilities::CapabilityRegistration {
88 id: meerkat_capabilities::CapabilityId::Comms,
89 description: "Inter-agent communication: send, request, response, list peers + keep-alive",
90 scope: meerkat_capabilities::CapabilityScope::Universal,
91 requires_feature: Some("comms"),
92 prerequisites: &[],
93 status_resolver: Some(|_| {
94 if cfg!(feature = "capability") {
95 meerkat_capabilities::CapabilityStatus::Available
96 } else {
97 meerkat_capabilities::CapabilityStatus::NotCompiled {
98 feature: "comms".into(),
99 }
100 }
101 }),
102 }
103}
104
105inventory::submit! {
107 meerkat_skills::SkillRegistration {
108 id: "multi-agent-comms",
109 name: "Multi-Agent Comms",
110 description: "Setting up keep-alive, peer trust, send vs request/response patterns",
111 scope: meerkat_core::skills::SkillScope::Builtin,
112 requires_capabilities: &["comms"],
113 body: include_str!("../skills/multi-agent-comms/SKILL.md"),
114 extensions: &[],
115 }
116}
117
118inventory::submit! {
119 meerkat_skills::SkillRegistration {
120 id: "mob-communication",
121 name: "Mob Communication",
122 description: "How to communicate with peers in a collaborative mob",
123 scope: meerkat_core::skills::SkillScope::Builtin,
124 requires_capabilities: &["comms"],
125 body: include_str!("../skills/mob-communication/SKILL.md"),
126 extensions: &[],
127 }
128}
129
130#[doc(hidden)]
137pub fn link_embedded_skill_registrations() {}
138
139pub fn validate_keep_alive(requested: bool) -> Result<bool, String> {
151 Ok(requested)
152}