Daemon Protocol v1.0
Authoritative WebSocket spec for the Autonoma local daemon. Every official IDE extension (VS Code, JetBrains, Neovim, Emacs, Sublime) conforms to this protocol — third-party clients should too.
Transport
- URL:
ws://localhost:{port}/ws— default port9876, configurable per extension - Encoding: JSON, UTF-8, one message per WebSocket frame
- Connect timeout: 5 seconds
- Request timeout: 30 seconds per request
- Authentication: none — daemon binds to
127.0.0.1only
Message envelopes
Request (extension → daemon)
{
"id": "req_<monotonic_counter>",
"method": "<namespace.action>",
"params": { ... }
}Response (daemon → extension)
{
"id": "req_<matching_id>",
"result": <any>,
"error": "<error_message>" // present ONLY on failure; mutually exclusive with result
}Event (daemon → extension, unsolicited)
{
"type": "<event_name>",
"data": { ... }
}Events have no id. Subscribe by event name.
Methods
agents.list
List available agents.
{}Agent[]
interface Agent {
id: string;
name: string;
description: string;
status: "available" | "busy" | "offline";
}agents.invoke
Invoke an agent with a task. Returns an executionId you can subscribe to via execution.status and the phase.update event.
{
agentType: string;
task: string;
context?: any;
}{ executionId: string }execution.status
Get RIGOR execution status. Includes phases array (5 phases: research, inspect, generate, optimize, review) and any artifacts produced.
{ executionId: string }interface ExecutionResult {
executionId: string;
status: "success" | "failure";
phases: RigorPhase[];
artifacts: Artifact[];
error?: string;
}
interface RigorPhase {
name: "research" | "inspect" | "generate" | "optimize" | "review";
status: "pending" | "running" | "completed" | "failed";
progress: number; // 0-100
duration?: number; // milliseconds
}
interface Artifact {
id: string;
type: string;
path: string;
content: string;
language: string;
}background.list
List all background tasks the daemon is tracking.
{}BackgroundTask[]
interface BackgroundTask {
id: string;
task: string;
agentType: string;
status: "queued" | "running" | "completed" | "failed" | "cancelled";
progress: number;
startedAt: string; // ISO-8601
completedAt?: string;
errorMsg?: string;
}background.launch
Launch a long-running background task. Returns immediately with a taskId; subscribe to task.update events for progress.
{ task: string; agentType: string }{ taskId: string }background.cancel
Cancel a running background task.
{ taskId: string }nullbackground.output
Get accumulated raw log output for a background task.
{ taskId: string }stringartifacts.preview
Preview what applying a set of artifacts would do — returns a per-file action and unified diff. Always call before artifacts.apply for user review.
{ artifacts: Artifact[] }{
files: Array<{
path: string;
action: "create" | "modify" | "skip";
diff?: string; // unified diff format
}>;
}artifacts.apply
Apply artifacts to the workspace. Returns counts and any per-file errors.
{ artifacts: Artifact[] }{
applied: number;
skipped: number;
errors: string[];
}code.explain
Explain a code selection in plain English. Returns a markdown string.
{ code: string; language: string; filePath: string }string // markdowncode.refactor
Refactor code with optional natural-language instructions. Returns artifacts you can preview/apply.
{
code: string;
language: string;
filePath: string;
instructions?: string;
}Artifact[]code.generateTests
Generate tests for a code selection. Returns artifacts (typically one test file per source file).
{ code: string; language: string; filePath: string }Artifact[]code.review
Review code for issues. The reviewType narrows what the reviewer looks for.
{
code: string;
language: string;
filePath: string;
reviewType: "security" | "performance" | "quality" | "all";
}{
issues: Array<{
severity: "error" | "warning" | "info";
message: string;
line?: number;
suggestion?: string;
}>;
summary: string;
}workflows.list
List available workflow templates across all domains. Optional domain filter narrows the result.
{} // or { domain?: string }Array<{
id: string; // "sales:lead_to_close"
name: string;
domain: string;
description: string;
pattern: string; // "supervisor" | "group_chat_maker_checker" | ...
stepCount: number;
agents: string[];
}>Events
connected
Emitted locally by the client when the WebSocket opens. No payload.
disconnected
Emitted locally when the WebSocket closes. No payload.
phase.update
RIGOR phase progress update.
{
executionId: string;
phase: "research" | "inspect" | "generate" | "optimize" | "review";
status: "pending" | "running" | "completed" | "failed";
progress: number;
}task.update
Background task state change.
{
taskId: string;
status: "queued" | "running" | "completed" | "failed" | "cancelled";
progress: number;
}execution.complete
Execution finished — payload is the same shape as execution.status result.
ExecutionResultError handling
- Connection refused: daemon not running — offer to launch
a6s daemonvia embedded terminal. - Connect timeout (5s): daemon unreachable — same as above.
- Request timeout (30s): daemon hung — show error, allow retry.
errorfield in response: server-side error — surface the message to the user.- Invalid JSON frame: log and ignore. Do not crash the client.
Reconnection
Clients should implement auto-reconnect with exponential backoff: 1s → 2s → 4s → 8s → 16s, capped at 5 attempts. After 5 failures, stop and show the user a manual reconnect button.
Conformance
All official IDE extensions and any third-party client claiming Autonoma compatibility MUST:
- Implement every method listed above.
- Handle every event listed above (at minimum: log and no-op for unknown events).
- Respect the 5-second connect and 30-second request timeouts.
- Never bypass the daemon to call the orchestrator directly.
- Never persist API credentials in extension storage.