Overview
Routa’s ACP Runtime Manager automatically downloads and manages Node.js and Python (uv) runtimes required by ACP agents. This ensures agents can run even when runtimes are not installed on the host system.Runtime Types
The runtime manager supports four runtime types:| Runtime | Description | Default Version |
|---|---|---|
node | Node.js binary | 22.12.0 |
npx | Node package executor | (bundled with Node.js) |
uv | Python package manager | 0.5.11 |
uvx | Python package executor | (bundled with uv) |
Platform Support
Runtimes are automatically downloaded for the detected platform:darwin-aarch64- macOS Apple Silicondarwin-x86_64- macOS Intellinux-aarch64- Linux ARM64linux-x86_64- Linux x86_64windows-aarch64- Windows ARM64windows-x86_64- Windows x86_64
Installation Paths
Managed runtimes are stored in:Runtime Resolution
The runtime manager follows this priority order:- Managed runtime - Check
~/.local/share/acp-agents/.runtimes/ - System runtime - Search system PATH
- Auto-download - Download and cache if neither is available
API Reference
AcpRuntimeManager
Getting Started
Check Runtime Availability
Get Runtime Path
Ensure Runtime is Available
Automatically download if not present:Get Runtime Version
Get All Runtime Status
Download Behavior
Concurrent Download Protection
The runtime manager uses in-process locking to prevent concurrent downloads of the same runtime:Archive Extraction
Runtimes are downloaded as archives and automatically extracted:- Node.js:
.tar.gz(Unix) or.zip(Windows) - uv:
.tar.gz(Unix) or.zip(Windows)
Cleanup
Download archives are removed after successful extraction to save disk space.Usage in ACP Agents
The runtime manager is used internally when spawning ACP agents:Platform Detection
Error Handling
The runtime manager handles common failure scenarios:Download Failures
Missing Executables
If a runtime download completes but the binary is not found:Extraction Failures
If archive extraction fails:Best Practices
- Use ensureRuntime() for critical operations - It handles both detection and installation
- Cache RuntimeInfo results - Avoid repeated PATH searches
- Check isRuntimeAvailable() before spawning agents - Validate dependencies early
- Use system runtimes when available - They’re faster to resolve than managed ones