Skip to main content

Crate car_engine

Crate car_engine 

Source
Expand description

Core runtime engine for Common Agent Runtime.

The runtime loop:

  1. Receive a proposal (batch of actions from a model)
  2. Build a DAG from state_dependencies
  3. Execute each level (concurrent if no ABORT actions, sequential otherwise)
  4. Validate, execute with idempotency + timeout + retry, commit
  5. On abort: rollback state to pre-proposal snapshot

Re-exports§

pub use agent_basics::entries as agent_basic_entries;
pub use agent_capability::AgentCapabilityRegistry;
pub use authz::AllowAllPermissions;
pub use authz::AuthzDecision;
pub use authz::AuthzPipeline;
pub use authz::AuthzResult;
pub use authz::AuthzStage;
pub use authz::PermissionHandler;
pub use authz::Restriction;
pub use builtin_agents::agent_metadata;
pub use builtin_agents::format_capability_payload;
pub use builtin_agents::register_builtins;
pub use builtin_agents::BuiltinAgent;
pub use builtin_agents::CapabilityPayloadError;
pub use builtin_agents::BUILTIN_AGENTS;
pub use cache::ResultCache;
pub use capabilities::CapabilitySet;
pub use checkpoint::Checkpoint;
pub use mcp::McpServer;
pub use mcp::McpServerConfig;
pub use mcp::McpToolExecutor;
pub use mcp::McpToolInfo;
pub use rate_limit::RateLimit;
pub use rate_limit::RateLimiter;
pub use registry::ToolEntry;
pub use registry::ToolPermission;
pub use registry::ToolRegistry;
pub use registry::ToolSource;
pub use scope::RuntimeScope;
pub use subprocess::SubprocessTool;
pub use subprocess::SubprocessToolExecutor;
pub use voice_turn::dispatch_voice_turn;
pub use voice_turn::dispatch_voice_turn_sidecar_only;
pub use voice_turn::dispatch_voice_turn_sidecar_only_with_classifier;
pub use voice_turn::dispatch_voice_turn_sidecar_only_with_telemetry;
pub use voice_turn::dispatch_voice_turn_with_telemetry;
pub use voice_turn::DirectDataFetcher;
pub use voice_turn::SidecarResult;
pub use voice_turn::VoiceTelemetry;
pub use voice_turn::VoiceTurnControl;
pub use voice_turn::VoiceTurnError;
pub use voice_turn::VoiceTurnHandle;

Modules§

agent_basics
agent_capability
Agent capability registry — maps capability id → agents that implement it.
authz
Authorization pipeline for tool execution.
builtin_agents
Built-in agent vocabulary — single source of truth across FFI surfaces.
cache
Cross-proposal result cache for tool call results.
capabilities
Per-agent capability permissions for the Common Agent Runtime.
checkpoint
Checkpoint and resume support for the Common Agent Runtime.
mcp
MCP (Model Context Protocol) server integration.
rate_limit
Token bucket rate limiter for tool calls with backpressure support.
registry
Canonical tool registry — single source of truth for tool identity.
scope
RuntimeScope — per-execution caller identity surface for the multi-tenant work tracked in Parslee-ai/car#187.
subprocess
Subprocess tool executor — runs tools as external processes via stdin/stdout JSON-RPC.
voice_turn
Two-track voice turn orchestration.

Structs§

Action
A single unit of agent intent compiled into IR.
ActionProposal
A batch of actions proposed by a model for runtime validation and execution.
AgentOutcome
The outcome of an agent execution loop.
CostBudget
Budget constraints for proposal execution.
EventLog
Append-only event log with optional JSONL journal.
Evidence
Evidence supporting an outcome classification.
FailedActionSummary
Summary of a failed action, included in ReplanContext.
OutcomeMetrics
Execution metrics associated with an outcome.
Planner
Proposal scorer and ranker.
PlannerConfig
Configuration for proposal scoring.
PolicyEngine
Evaluates actions against registered policies.
ProposalResult
The complete result of processing a proposal through the runtime.
ReplanConfig
Configuration for the replan loop.
ReplanContext
Context provided to the replan callback so the model can generate an alternative.
Runtime
Common Agent Runtime — deterministic execution layer.
StateStore
Thread-safe state store with transition logging.
ToolFeedback
Historical tool success rates computed from the trajectory store. Pass to rank_with_feedback() to bias scoring based on past outcomes.
ToolSchema
Rich schema describing a tool’s interface and runtime configuration.
VerifyIssue
A single verification finding.

Enums§

ActionType
What kind of action this is.
EventKind
Event kinds matching the Python EventKind enum.
EvidenceKind
Types of evidence that can support an outcome.
FailureBehavior
What to do when an action fails.
OutcomeStatus
Outcome classification for an agent execution.
SpanStatus
Status of a trace span.

Constants§

CANCELED_PREFIX
Prefix on the error field of an ActionResult that distinguishes “the user pulled the plug” from “earlier abort cascaded.” The ActionStatus itself is Skipped in both cases (introducing a new variant ripples through every IR consumer + FFI binding); the prefix lets callers like the A2A bridge tell the cases apart without string-matching a magic literal.

Traits§

ReplanCallback
Callback trait for replanning failed proposals. Implement this to let the runtime ask the model for an alternative plan when a proposal aborts.
ToolExecutor
Trait for tool execution. Implement this to provide tools to the runtime.

Functions§

format_tool_result
Format a tool result for feeding back to a model.

Type Aliases§

PolicyCheck
Policy check function: (action, state) -> Option<violation_reason>