@theaiinc/realm-api
v0.2.0
Published
Fastify HTTP API server for Realm — exposes realm lifecycle, execution, and audit endpoints over REST
Readme
@theaiinc/realm-api
Fastify HTTP API server for the Realm platform.
Exposes realm lifecycle, execution, and audit endpoints over REST. This is the primary entry point for orchestration layers (Pathway, Oasis Cognition) to interact with Realm engines.
Features
- REST API — Full CRUD for realm sessions
- Multi-engine support — Routes to Container, Browser, and Ubuntu engines
- Screenshot endpoint — Capture realm display output
- Interaction endpoints — Click, type, exec, import, export
- Audit logging — Built-in audit trail endpoint
- CORS enabled — Ready for frontend integration
Installation
pnpm add @theaiinc/realm-apiAPI Endpoints
| Method | Path | Description |
|--------|------|-------------|
| GET | /api/v1/health | Health check |
| GET | /api/v1/realms | List all realms |
| POST | /api/v1/realms | Create a realm |
| GET | /api/v1/realms/:id | Get realm details |
| POST | /api/v1/realms/:id/start | Start a realm |
| POST | /api/v1/realms/:id/stop | Stop a realm |
| DELETE | /api/v1/realms/:id | Destroy a realm |
| GET | /api/v1/realms/:id/capture | Capture screenshot |
| POST | /api/v1/realms/:id/click | Click at coordinates |
| POST | /api/v1/realms/:id/type | Type text |
| POST | /api/v1/realms/:id/exec | Execute command |
| POST | /api/v1/realms/:id/import | Import file |
| POST | /api/v1/realms/:id/export | Export file |
| GET | /api/v1/audit | Get audit log |
Quick Start
pnpm realm:apiServer starts on port 8542.
Dependencies
- fastify — HTTP server framework
- @fastify/cors — CORS support
- All Realm engine packages
License
MIT
