feat: initial release — ZeroClaw v0.1.0
- 22 AI providers (OpenRouter, Anthropic, OpenAI, Mistral, etc.) - 7 channels (CLI, Telegram, Discord, Slack, iMessage, Matrix, Webhook) - 5-step onboarding wizard with Project Context personalization - OpenClaw-aligned system prompt (SOUL.md, IDENTITY.md, USER.md, AGENTS.md, etc.) - SQLite memory backend with auto-save - Skills system with on-demand loading - Security: autonomy levels, command allowlists, cost limits - 532 tests passing, 0 clippy warnings
This commit is contained in:
commit
05cb353f7f
71 changed files with 15757 additions and 0 deletions
52
src/observability/traits.rs
Normal file
52
src/observability/traits.rs
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
use std::time::Duration;
|
||||
|
||||
/// Events the observer can record
|
||||
#[derive(Debug, Clone)]
|
||||
pub enum ObserverEvent {
|
||||
AgentStart {
|
||||
provider: String,
|
||||
model: String,
|
||||
},
|
||||
AgentEnd {
|
||||
duration: Duration,
|
||||
tokens_used: Option<u64>,
|
||||
},
|
||||
ToolCall {
|
||||
tool: String,
|
||||
duration: Duration,
|
||||
success: bool,
|
||||
},
|
||||
ChannelMessage {
|
||||
channel: String,
|
||||
direction: String,
|
||||
},
|
||||
HeartbeatTick,
|
||||
Error {
|
||||
component: String,
|
||||
message: String,
|
||||
},
|
||||
}
|
||||
|
||||
/// Numeric metrics
|
||||
#[derive(Debug, Clone)]
|
||||
pub enum ObserverMetric {
|
||||
RequestLatency(Duration),
|
||||
TokensUsed(u64),
|
||||
ActiveSessions(u64),
|
||||
QueueDepth(u64),
|
||||
}
|
||||
|
||||
/// Core observability trait — implement for any backend
|
||||
pub trait Observer: Send + Sync {
|
||||
/// Record a discrete event
|
||||
fn record_event(&self, event: &ObserverEvent);
|
||||
|
||||
/// Record a numeric metric
|
||||
fn record_metric(&self, metric: &ObserverMetric);
|
||||
|
||||
/// Flush any buffered data (no-op for most backends)
|
||||
fn flush(&self) {}
|
||||
|
||||
/// Human-readable name of this observer
|
||||
fn name(&self) -> &str;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue