Files
zeekay dd8e16745b feat: ZAP v0.2.1 - Zero-copy Agent Protocol
Initial release of ZAP (Zero-copy Agent Protocol) for high-performance
AI agent communication with post-quantum security.

## Features

### Core Protocol
- Cap'n Proto RPC for zero-copy serialization
- Client/Server/Gateway architecture
- Multi-transport support (TCP, Unix sockets, WebSocket)

### Post-Quantum Cryptography
- ML-KEM-768 key encapsulation (NIST FIPS 203)
- ML-DSA-65 digital signatures (NIST FIPS 204)
- Hybrid X25519 + ML-KEM handshake

### W3C DID Identity
- did:lux - Blockchain-anchored DIDs for Lux network
- did:key - Self-certifying DIDs from ML-DSA-65 keys
- did:web - DNS-based DIDs
- DID Document generation with verification methods

### Agentic Consensus
- Query/Response/Vote model for agent decisions
- Configurable consensus threshold (default 50% majority)
- Stake-weighted voting support
- Finality proofs with post-quantum signatures

### Lux Integration
- LuxConsensusBridge for Quasar finality
- Ringtail threshold signature support
- BLS + Ringtail hybrid signatures

## SDKs

- Rust: Full native implementation with async support
- Python: hanzo-zap package with asyncio
- TypeScript: @hanzo/zap package with full type safety

## Testing

- Rust: 38 tests
- Python: 48 tests
- TypeScript: 60 tests
- CI: GitHub Actions with 80%+ coverage gates
2026-01-23 09:18:37 -08:00

56 lines
1.1 KiB
Rust

//! Error types for ZAP
use thiserror::Error;
/// ZAP error type
#[derive(Error, Debug)]
pub enum Error {
#[error("connection failed: {0}")]
Connection(String),
#[error("transport error: {0}")]
Transport(String),
#[error("protocol error: {0}")]
Protocol(String),
#[error("tool not found: {0}")]
ToolNotFound(String),
#[error("tool call failed: {0}")]
ToolCallFailed(String),
#[error("resource not found: {0}")]
ResourceNotFound(String),
#[error("server error: {0}")]
Server(String),
#[error("config error: {0}")]
Config(String),
#[error("crypto error: {0}")]
Crypto(String),
#[error("identity error: {0}")]
Identity(String),
#[error("consensus error: {0}")]
Consensus(String),
#[error("io error: {0}")]
Io(#[from] std::io::Error),
#[error("capnp error: {0}")]
Capnp(#[from] capnp::Error),
#[error("json error: {0}")]
Json(#[from] serde_json::Error),
#[error("url error: {0}")]
Url(#[from] url::ParseError),
}
/// Result type for ZAP operations
pub type Result<T> = std::result::Result<T, Error>;