Skip to main content

systemprompt_agent/
lib.rs

1//! # systemprompt-agent
2//!
3//! Agent-to-Agent (A2A) protocol implementation for systemprompt.io.
4//!
5//! This crate hosts the domain logic for hosting governed AI agents:
6//! - JSON-RPC protocol models in [`models::a2a`]
7//! - Persistence in [`repository`] (tasks, contexts, artifacts, execution
8//!   steps)
9//! - Runtime services in [`services`] (HTTP server, orchestration, MCP
10//!   bridging, skills ingestion, streaming, registry)
11//! - A typed error hierarchy rooted at [`AgentError`]
12//!
13//! ## Feature flags
14//!
15//! This crate currently has no Cargo features beyond defaults. Functionality
16//! is unconditional and the crate compiles a single configuration. The facade
17//! crate `systemprompt` gates inclusion via the `agent`/`full` features.
18//!
19//! ## Layer
20//!
21//! Domain layer. Depends only on `shared/*` and `infra/*` crates plus a small
22//! number of sibling domain crates (declared in `Cargo.toml`).
23
24pub(crate) mod error;
25pub(crate) mod extension;
26pub mod models;
27pub mod repository;
28pub mod services;
29pub(crate) mod state;
30
31pub use extension::AgentExtension;
32
33pub use state::AgentState;
34
35pub use models::a2a::{
36    A2aJsonRpcRequest, A2aRequestParams, A2aResponse, AgentCapabilities, AgentCard, AgentInterface,
37    AgentProvider, AgentSkill, Artifact, DataPart, Message, MessageSendParams, Part,
38    SecurityScheme, Task, TaskIdParams, TaskQueryParams, TaskState, TaskStatus, TextPart,
39    TransportProtocol,
40};
41
42pub use error::{
43    AgentError, AgentResult, ArtifactError, ContextError, ProtocolError, RowParseError, TaskError,
44};
45
46pub const A2A_PROTOCOL_VERSION: &str = "0.3.0";
47
48pub use services::{
49    AgentEvent, AgentEventBus, AgentHandlerState, AgentOrchestrator, AgentServer, AgentStatus,
50    ContextService, SkillService,
51};
52
53pub use repository::content::ArtifactRepository;