openalice-agent-protocol-rs
[Atlas card](https://atlas.blal.pro/repos/openalice-agent-protocol-rs)
Architecture rating
This crate IS the shared substrate — AgentRuntime trait + ConnectorEvent/ToolCall used by every OpenAlice Rust service, mirrored 1:1 with the TS half under same-commit-window discipline; inspector confirms uniform clean code (0 cycles, 0 dead imports, 0 naming violations).
Owns no tables/migrations (correct for a contract crate); core value is the data-shape contract itself, with strong discipline that JSON shape is kept byte-identical to the TS mirror — but no constraint/validation layer or schema-version/compat markers evidenced.
Manifest present+valid with a clear polyglot-pair summary and AGENTS.md present, but README is only an Atlas-card stub, 66 missing docstrings on public contract types, and roadmap scores 30/100 (Atlas-flagged weakest).
Library has no runtime concerns (no shutdown/timeouts/retries expected); code is clean (0 cycles, avg complexity 3.57) but serde round-trip robustness and cross-repo wire compat are unproven without any tests, and 1 duplicate signature + 2 complexity flags (max 23) hint at edge-case fragility.
Pure wire-contract crate with no authn/network/secret surface, but serde-based deserialization of ConnectorEvent/ToolCall has no evidenced validation, size bounds, or fuzz/regression tests against malformed input — graded conservatively for absent input-hardening.
No metrics, tracing, structured logging, or health surface (Atlas probe failed: 'no https endpoint' — expected for a lib); nothing observable is exposed, so graded as absent even though largely N/A for a contract crate.
No tests/ directory and no test presence detected at all — critical gap for a wire contract that must stay byte-identical with its TS mirror, where zero serialization round-trip or cross-repo compat regression tests means drift can ship undetected.
source · auto-grader-2026-06-16
Ecosystem manifest
.atlas-deps.ymlRust half of the polyglot agent-protocol pair (TS half is openalice-agent-protocol). Wire contract for ConnectorEvent / ToolCall + AgentRuntime trait used by every OpenAlice Rust service. JSON shape kept identical with the TS mirror; changes must land in both repos same commit window.
- cargo_crate: openalice-agent-protocol-rs
Code composition
tokei · loc- Rust98.5%
- TOML1.5%
- Rust98.5%
- TOML1.5%
- Rust98.5%· 1,423
- TOML1.5%· 21
| Language | % code | code | comments | blanks | files |
|---|---|---|---|---|---|
| Rust | 98.5% | 1,423 | 52 | 115 | 7 |
| TOML | 1.5% | 21 | 4 | 3 | 1 |
| Markdown | 0.0% | 0 | 50 | 27 | 2 |
Telemetry ribbon · last 90 days
3 eventsagent-protocol-rs/core
1 feature- agent-protocol-rs.core.wire-contractsrc/lib.rs:17Rust mirror of `@openalicelabs/agent-protocol`. Provides all shared types (`ConnectorEvent`, `ToolCall`), the `AgentRuntime` trait, `CooldownMiddleware`, `ProductDispatcher`, and the optional `fetch_agent_config` helper so every Rust service (live-control, social-api, voice, chat-bridge) shares one wire contract with zero translation overhead against the TypeScript twin.
agent-protocol-rs/dispatcher
1 feature- agent-protocol-rs.dispatcher.product-dispatchersrc/dispatcher.rs:31Generic per-broadcast event → action pipeline shared by all OpenAlice products. `dispatch(event)` builds `AgentTurnInput`, calls `AgentRuntime::turn`, applies `CooldownMiddleware` per `(channel_id, tool_name)`, and invokes the product-supplied `ToolHandler` for every allowed call. Returns the count of executed calls for metrics. Products pass their own slug and `ToolHandler` closure; the turn loop, cooldown filtering, and `AgentContext` construction are identical for all products.
agent-protocol-rs/events
1 feature- agent-protocol-rs.events.connector-eventsrc/events.rs:133Inbound event envelope for all connector-originated signals. Six variants: `ChatMessage`, `ChatFeed`, `VoiceUtterance`, `PresenceChange`, `ViewerMetrics`, `System`. The `kind` field is the serde tag discriminator — identical to the TS package so JSON round-trips with no translation between TypeScript connectors and Rust service consumers. [derive(Debug, Clone, Serialize, Deserialize)] [serde(tag = "kind", rename_all = "snake_case")]
agent-protocol-rs/fetch
1 feature- agent-protocol-rs.fetch.fetch-agent-configsrc/fetch.rs:54Canonical single-source fetcher for `auth /internal/users/{id}/agent-config` (behind the `fetch` cargo feature). Replaces identical copies that previously lived in live-control, voice, and social-api. Authenticates via `X-Internal-Secret`, projects the wire shape onto `AgentRuntimeConfig`, and propagates HTTP errors verbatim for operator observability. Gate with `#[cfg(feature = "fetch")]` — consumers that only use types (chat-bridge) do not pull reqwest + uuid.
agent-protocol-rs/runtime
1 feature- agent-protocol-rs.runtime.agent-runtimesrc/runtime.rs:132Core integration contract for all OpenAlice agent backends. Every product (live, social, voice, world) drives the agent through `init → reconfigure → turn*`. `turn` receives the batched `AgentTurnInput` (events + prior tool results) and returns an `AgentTurnOutput` (list of `ToolCall`s to execute). `shutdown` is optional — default impl is a no-op. The trait is `Send + Sync` so a single `Arc<dyn AgentRuntime>` can be shared across `ProductDispatcher` instances. [async_trait]
agent-protocol-rs/tools
1 feature- agent-protocol-rs.tools.tool-callsrc/tools.rs:33Outbound action envelope produced by an `AgentRuntime::turn`. All 15 variants share a `call_id` (for result correlation) and an optional `ToolRouting` (product / platform / channel overrides). The `ToolCall::name()` and `call_id()` helpers are stable for metrics and observability without a match. Wire shape is identical to the TS `@openalicelabs/agent-protocol` package. [derive(Debug, Clone, Serialize, Deserialize)] [serde(tag = "name", rename_all = "snake_case")]