1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
//! Rust port of the **parley** protocol core
//! ([@p-vbordei/agent-rooms](https://github.com/p-vbordei/agent-rooms)).
//!
//! This crate ships only the protocol pieces: canonical JSON encoding,
//! Ed25519 keypair / signing / verification, the four signed-payload
//! builders, freshness checks, turn rotation, invite dedup, and an
//! in-memory replay-detection store. **No HTTP server, no database, no
//! MCP integration** — for those, use the Python packages.
//!
//! See [`SPEC.md`](https://github.com/p-vbordei/agent-rooms-rs/blob/main/SPEC.md)
//! for the wire protocol. Conformance vectors copied verbatim from the
//! reference repo live in `vectors/` and are exercised by
//! `tests/conformance.rs`.
//!
//! # Example
//!
//! ```
//! use agent_rooms::{canonical, keys, protocol};
//! use chrono::{TimeZone, Utc};
//!
//! let sk = [1u8; 32];
//! let (sk_arr, pk) = (sk, {
//! use ed25519_dalek::SigningKey;
//! SigningKey::from_bytes(&sk).verifying_key().to_bytes()
//! });
//! let created_at = Utc.timestamp_opt(1_777_000_000, 0).unwrap();
//! let payload = protocol::post_message_payload(
//! "00000000-0000-0000-0000-000000000001",
//! &keys::to_hex(&pk),
//! 1,
//! "hello",
//! &created_at,
//! );
//! let sig = keys::sign(&sk_arr, &payload);
//! assert!(keys::verify(&pk, &payload, &sig));
//! # let _ = canonical::sha256_hex(&serde_json::json!({}));
//! ```
pub use Error;