Skip to main content

Crate terraphim_spawner

Crate terraphim_spawner 

Source
Expand description

Agent spawner for Terraphim with health checking and output capture.

This crate provides functionality to spawn external AI agents (Codex, Claude Code, OpenCode) as non-interactive processes with:

  • Configuration validation (CLI installed, API keys, models)
  • Health checking via heartbeat (30s interval)
  • Full output capture with @mention detection
  • Auto-restart on failure

Re-exports§

pub use audit::AuditEvent;
pub use config::AgentConfig;
pub use config::AgentValidator;
pub use config::ResourceLimits;
pub use config::ValidationError;
pub use health::CircuitBreaker;
pub use health::CircuitBreakerConfig;
pub use health::CircuitState;
pub use health::HealthChecker;
pub use health::HealthHistory;
pub use health::HealthStatus;
pub use mention::MentionEvent;
pub use mention::MentionRouter;
pub use output::OutputCapture;
pub use output::OutputEvent;

Modules§

audit
Structured audit events for agent lifecycle tracking.
config
Agent configuration and validation
health
Health checking for spawned agents with circuit breaker and history tracking.
mention
@mention routing for agent coordination
output
Output capture with @mention detection

Structs§

AgentHandle
Handle to a spawned agent process
AgentPool
Pool of reusable agent handles.
AgentSpawner
Spawner for AI agents

Enums§

SpawnerError
Errors that can occur during agent spawning