update api, fix tests and examples

This commit is contained in:
Timur Gordon
2025-08-27 10:07:53 +02:00
parent 767c66fb6a
commit ef17d36300
42 changed files with 2984 additions and 781 deletions

View File

@@ -20,9 +20,11 @@ hero-supervisor/
The crate uses Rust's feature system to provide conditional compilation:
- **`default`**: Includes all functionality - supervisor, OpenRPC server, and CLI binary
- **`default`**: Includes CLI functionality
- **`cli`**: Enables the supervisor binary (included in default)
All OpenRPC functionality is now included by default for simplified deployment.
## Architecture
The Hero Supervisor uses a clean, simplified architecture with centralized resource management:
@@ -60,6 +62,9 @@ Simplified runner configuration and management. Contains `Runner` struct with co
#### `src/job.rs`
Job data structures, builder pattern, and Redis key management. Defines `Job` struct with metadata, script content, and status tracking.
#### `src/client.rs`
Client implementation for job management operations. Provides Redis-based job storage, retrieval, status updates, and lifecycle management. Separates job operations from supervisor logic.
#### `src/openrpc.rs`
OpenRPC server implementation that exposes all supervisor functionality over JSON-RPC. Implements RPC trait directly on the supervisor for clean integration.
@@ -148,14 +153,14 @@ curl -X POST -H "Content-Type: application/json" \
### Building
```bash
# Library only
# Build everything (default includes CLI and OpenRPC)
cargo build
# Library only (minimal build)
cargo build --no-default-features
# With CLI
# With CLI (same as default)
cargo build --features cli
# With OpenRPC server
cargo build --features openrpc
```
### Testing