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; the
22//! cross-domain seams it needs (managed skills, the MCP tool-execution ledger,
23//! webhook delivery) arrive as shared-layer traits injected at the
24//! composition root.
25//!
26//! Copyright (c) systemprompt.io — Business Source License 1.1.
27//! See <https://systemprompt.io> for licensing details.
28
29pub(crate) mod error;
30pub(crate) mod extension;
31pub mod models;
32pub mod repository;
33pub mod services;
34pub(crate) mod state;
35
36pub use extension::AgentExtension;
37
38pub use state::AgentState;
39
40pub use models::a2a::{
41    A2aJsonRpcRequest, A2aRequestParams, A2aResponse, AgentCapabilities, AgentCard, AgentInterface,
42    AgentProvider, AgentSkill, Artifact, DataPart, Message, MessageSendParams, Part,
43    SecurityScheme, Task, TaskIdParams, TaskQueryParams, TaskState, TaskStatus, TextPart,
44    TransportProtocol,
45};
46
47pub use error::{
48    AgentError, AgentResult, ArtifactError, ContextError, ProtocolError, RowParseError, TaskError,
49};
50
51pub const A2A_PROTOCOL_VERSION: &str = "0.3.0";
52
53pub use services::{
54    AgentEvent, AgentEventBus, AgentHandlerState, AgentOrchestrator, AgentServer, AgentStatus,
55    ContextService, SkillService,
56};
57
58pub use repository::content::ArtifactRepository;