Skip to main content

Daemon Protocol

Communication protocol between CLI and daemon.

Transport

Unix socket at ~/.owl/owl.sock

Message Format

Length-prefixed JSON:

[4 bytes: length (big-endian)][JSON payload]

Request Types

CHAT

Non-streaming chat request.

{
"type": "chat",
"payload": {
"message": "Hello",
"use_tools": true
}
}

STREAM

Streaming chat request.

{
"type": "stream",
"payload": {
"message": "Hello",
"use_tools": true
}
}

PROJECT

Set/get project.

{
"type": "project",
"payload": {
"action": "set",
"path": "/home/user/project"
}
}

SESSION

Session management.

{
"type": "session",
"payload": {
"action": "new|reset|history",
"limit": 20
}
}

TOOLS

Tool management.

{
"type": "tools",
"payload": {
"action": "status|set_profile|execute",
"profile": "minimal|coding|full",
"tool": "read_file",
"args": {"path": "file.py"}
}
}

STATUS

Get daemon status.

{
"type": "status",
"payload": {}
}

Response Format

{
"success": true,
"data": {...},
"error": null,
"stream": false
}

Stream Chunks

For streaming requests:

{
"content": "Hello",
"tool_call": {"name": "read_file", "args": {...}},
"tool_result": {"name": "read_file", "success": true},
"stage": "thinking|context|model",
"ask_user": {"id": "abc", "question": "...", "options": [...]},
"done": false,
"error": null,
"aborted": false
}

User Answer

Response to ask_user:

{
"type": "user_answer",
"question_id": "abc",
"answer": "Option 1"
}