mirror of
https://github.com/hanzoai/dev.git
synced 2026-10-25 03:32:32 +00:00
3.7 KiB
3.7 KiB
hanzo-dev LLM.md
AI assistant context for the Hanzo Dev workspace.
Overview
This is a Rust workspace containing Hanzo AI development tools, including MCP clients/servers and the ZAP (Zero-copy Agent Protocol) implementation.
Workspace Structure
hanzo-dev/
├── Cargo.toml # Workspace manifest
├── mcp-client/ # MCP client library
├── mcp-server/ # MCP server library
├── mcp-stdio/ # MCP stdio transport
├── mcp-tui/ # MCP terminal UI
├── mcp-types/ # MCP type definitions
├── rustfmt.toml # Formatting config
└── zap/ # ZAP protocol implementation (NEW)
ZAP Crate (zap/)
High-performance Zero-copy Agent Protocol for agentic tool calling.
Key Features
- Zero-copy parsing: Messages read directly from network buffers
- Zero allocations: Buffer pooling eliminates GC pressure
- MCP compatibility: Gateway bridges existing MCP servers
- 10-100x performance: Faster than JSON-RPC for agent workloads
Module Structure
| Module | Purpose |
|---|---|
buffer.rs |
Buffer pool for zero-allocation messaging |
wire.rs |
Binary wire protocol encoding/decoding |
message.rs |
MCP-compatible message types |
transport.rs |
TCP/TLS/Unix socket transport |
client.rs |
ZAP client for tool calling |
gateway.rs |
MCP gateway bridge |
config.rs |
Gateway configuration |
tools.rs |
167 typed tool definitions across 14 categories |
error.rs |
Error types |
Tool Categories (14 total)
- Computer - Window, input, screen, process, filesystem, packaging
- Browser - Navigation, DOM, network, storage, extraction, render
- Vision - Element detection, OCR, layout analysis
- Lsp - Completion, hover, definition, references, rename, symbols
- Vcs - Status, diff, commit, log, blame, branch, merge, PR ops
- Build - Build, test, lint, typecheck, coverage
- Debug - Attach, breakpoints, step, stack, variables, profile
- Container - Docker, compose, Kubernetes
- Cloud - IaC, secrets, deploy, DNS/CDN
- Network - HTTP, gRPC, SSH, SFTP, port scanning
- Data - DB clients, migrations, queries, backup
- Security - Policy, secret scan, SAST/DAST, signing
- Knowledge - Search, docs, embeddings, citations
- Plan - Intent, route, compose, DAG execution, cache, audit
Wire Protocol
+----------+----------+------------------+
| Length | MsgType | Payload |
| (4 bytes)| (1 byte) | (variable) |
| LE u32 | | |
+----------+----------+------------------+
Transport Schemes
| Scheme | Port | Use Case |
|---|---|---|
zap:// |
9999 | Local development |
zaps:// |
9999 | Production (TLS 1.3) |
zap+unix:// |
N/A | Same-host, lowest latency |
Performance
| Metric | JSON-RPC | ZAP | Improvement |
|---|---|---|---|
| Parse latency (10KB) | 420 µs | 0.4 µs | 1,050x |
| Allocations/msg | 47 | 0 | 100% eliminated |
| Typical tool chain (9 calls) | 4.6 ms | 3.1 µs | 1,480x |
Related Specifications
- HIP-007: ZAP Protocol Specification (Hanzo AI)
- LP-120: ZAP Transport Protocol (Lux Network)
- MCP: Model Context Protocol (Anthropic)
Development Commands
# Check ZAP crate
cargo check -p hanzo-zap
# Run tests
cargo test -p hanzo-zap
# Build all
cargo build --workspace
Session History
- 2025-01-25: Created ZAP crate with comprehensive native tool support (14 categories, 167 typed structs). Integrated with workspace. Added HIP-007 implementations section and LP-120 cross-reference.