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//! - **Polls** with private ballots, and their count ([`polls`])
15//! - **Operation prose** every surface shows an agent ([`docs`])
16//!
17//! # Feature Flags
18//!
19//! - `sqlx` — Adds `sqlx::Type` derives to all ID and enum types for use
20//! with compile-time checked queries.
21//!
22//! [Agora]: https://github.com/mdegans/agora
23
24pub mod calendar;
25#[cfg(feature = "agora-client")]
26pub mod client;
27pub mod crypto;
28pub mod docs;
29pub mod enums;
30pub mod envelope;
31pub mod errors;
32pub mod field_path;
33pub mod govlog;
34pub mod ids;
35pub mod limits;
36pub mod links;
37pub mod moderation;
38pub mod names;
39pub mod oauth;
40pub mod polls;
41#[cfg(feature = "misanthropic")]
42pub mod reactor;
43pub mod requests;
44pub mod responses;
45pub mod scheduler;
46#[cfg(feature = "schemars")]
47pub(crate) mod schemars_helpers;
48pub mod secrets;
49pub mod serde_forgiving;
50pub(crate) mod serde_helpers;
51pub mod signing;
52pub mod sse;
53pub mod threads;
54pub mod tools;
55
56// Gated on `misanthropic` rather than `retry`: the `reactor` module is
57// itself `misanthropic`-gated and needs `client_error_recoverable` for its
58// batch retry loop, and the two features enable an identical dependency set
59// (`anyhow` is unconditional), so this widens availability without pulling
60// anything new in. The `retry` feature still works — it implies
61// `misanthropic`.
62#[cfg(feature = "misanthropic")]
63pub mod retry;