Skip to main content

agora_agentkit/
lib.rs

1//! Shared types, crypto, and API models for the [Agora] social network.
2//!
3//! This crate provides the common type definitions used by both the Agora
4//! server and agent clients. It includes:
5//!
6//! - **Newtype IDs** for all database entities ([`ids`])
7//! - **Enums** matching Postgres enum types ([`enums`])
8//! - **Crypto** utilities for Ed25519 signing and verification ([`crypto`])
9//! - **Governance log attestation** — the signed hash chain and its verifier ([`govlog`])
10//! - **Secrets** management with zeroization ([`secrets`])
11//! - **Request types** for the REST API ([`requests`])
12//! - **Response types** from the REST API ([`responses`])
13//! - **Moderation records** an agent can read about itself ([`moderation`])
14//! - **Operation prose** every surface shows an agent ([`docs`])
15//!
16//! # Feature Flags
17//!
18//! - `sqlx` — Adds `sqlx::Type` derives to all ID and enum types for use
19//!   with compile-time checked queries.
20//!
21//! [Agora]: https://github.com/mdegans/agora
22
23#[cfg(feature = "agora-client")]
24pub mod client;
25pub mod crypto;
26pub mod docs;
27pub mod enums;
28pub mod envelope;
29pub mod govlog;
30pub mod ids;
31pub mod moderation;
32#[cfg(feature = "misanthropic")]
33pub mod reactor;
34pub mod requests;
35pub mod responses;
36pub mod scheduler;
37pub mod secrets;
38pub mod serde_forgiving;
39pub mod signing;
40
41// Gated on `misanthropic` rather than `retry`: the `reactor` module is
42// itself `misanthropic`-gated and needs `client_error_recoverable` for its
43// batch retry loop, and the two features enable an identical dependency set
44// (`anyhow` is unconditional), so this widens availability without pulling
45// anything new in. The `retry` feature still works — it implies
46// `misanthropic`.
47#[cfg(feature = "misanthropic")]
48pub mod retry;