5.6 KiB
5.6 KiB
D-Bus Operational Model
Your world model is the org.ollie.SessionManager D-Bus service on the session bus. Your session ID is ${OLLIE_SESSION_ID}.
Service coordinates:
- Service:
org.ollie.SessionManager - Object:
/org/ollie/SessionManager - Interface:
org.ollie.SessionManager
Data directories (local filesystem, read-only to the agent):
~/.config/ollie/prompts/— Prompt templates~/.config/ollie/skills/— Domain-specific knowledge files~/.config/ollie/tools/— Tool scripts~/.config/ollie/memory/— Persistent memory files~/.config/ollie/agents/— Agent definitions (JSON)
Peer Agent Discovery: Use ListSessions to discover other active sessions:
dbus-send --session --dest=org.ollie.SessionManager --type=method_call --print-reply \
/org/ollie/SessionManager org.ollie.SessionManager.ListSessions
Each entry: id\tstate\tmodel\tagent
Inter-Agent Communication: Use PeerSubmit to send a prompt to another session. Always provide a return path (e.g., [message from $OLLIE_SESSION_ID]).
Session Management (D-Bus)
All session operations go through the D-Bus interface. No filesystem writes for session control.
Methods
| Method | Args | Returns | Purpose |
|---|---|---|---|
CreateSession |
cwd, backend, model, agent | session_id | Create a new session |
ListSessions |
— | array of "id\tstate\tmodel\tagent" | Discover sessions |
KillSession |
session_id | success | Terminate a session |
RenameSession |
session_id, new_name | success | Rename a session |
Submit |
session_id, prompt | success | Submit a prompt to an agent |
Interrupt |
session_id | success | Interrupt current agent turn |
GetState |
session_id | state | Current state: idle, thinking, calling: <tool> |
GetChat |
session_id, offset | text, new_offset | Read chat output |
GetUsage |
session_id | usage | Token usage stats |
GetCost |
session_id | cost | Cost tracking |
GetConfig |
session_id | key=value pairs | Read session config |
SetConfig |
session_id, key, value | success | Change a config setting |
GetContext |
session_id | JSONL messages | Full conversation context |
ListBackends |
— | array of names | Available backends |
ListModels |
session_id | array of names | Models for session's backend |
ListAgents |
— | array of names | Available agent definitions |
PeerAdd |
session_id, peer_id | success | Add peer relationship |
PeerRemove |
session_id, peer_id | success | Remove peer relationship |
PeerList |
session_id | array of peer_ids | List peers |
PeerSubmit |
session_id, peer_id, prompt | success | Send prompt to peer |
Signals
| Signal | Args | Purpose |
|---|---|---|
SessionCreated |
session_id | New session appeared |
SessionKilled |
session_id | Session terminated |
StateChanged |
session_id, new_state | Agent state transition |
ChatUpdated |
session_id, offset, new_text | New output available |
Operations
# Discover sessions
dbus-send --session --dest=org.ollie.SessionManager --type=method_call --print-reply \
/org/ollie/SessionManager org.ollie.SessionManager.ListSessions
# Create a session (returns session_id)
dbus-send --session --dest=org.ollie.SessionManager --type=method_call --print-reply \
/org/ollie/SessionManager org.ollie.SessionManager.CreateSession \
string:"$PWD" string:"" string:"" string:"default"
# Create a named session (backend + model + agent)
dbus-send --session --dest=org.ollie.SessionManager --type=method_call --print-reply \
/org/ollie/SessionManager org.ollie.SessionManager.CreateSession \
string:"$PWD" string:"openrouter" string:"anthropic/claude-sonnet-4" string:"worker"
# Kill a session
dbus-send --session --dest=org.ollie.SessionManager --type=method_call \
/org/ollie/SessionManager org.ollie.SessionManager.KillSession \
string:"SESSION_ID"
# Rename a session
dbus-send --session --dest=org.ollie.SessionManager --type=method_call \
/org/ollie/SessionManager org.ollie.SessionManager.RenameSession \
string:"SESSION_ID" string:"new-name"
# Submit a prompt
dbus-send --session --dest=org.ollie.SessionManager --type=method_call \
/org/ollie/SessionManager org.ollie.SessionManager.Submit \
string:"SESSION_ID" string:"your prompt here"
# Get current state
dbus-send --session --dest=org.ollie.SessionManager --type=method_call --print-reply \
/org/ollie/SessionManager org.ollie.SessionManager.GetState \
string:"SESSION_ID"
# Get chat output (use gdbus for tuple return)
gdbus call --session --dest org.ollie.SessionManager \
--object-path /org/ollie/SessionManager \
--method org.ollie.SessionManager.GetChat "SESSION_ID" 0
# Read session config
dbus-send --session --dest=org.ollie.SessionManager --type=method_call --print-reply \
/org/ollie/SessionManager org.ollie.SessionManager.GetConfig \
string:"SESSION_ID"
# Change config
dbus-send --session --dest=org.ollie.SessionManager --type=method_call \
/org/ollie/SessionManager org.ollie.SessionManager.SetConfig \
string:"SESSION_ID" string:"model" string:"gpt-4o"
# Send prompt to peer
dbus-send --session --dest=org.ollie.SessionManager --type=method_call \
/org/ollie/SessionManager org.ollie.SessionManager.PeerSubmit \
string:"MY_SESSION" string:"PEER_SESSION" string:"your prompt"
# List available backends
dbus-send --session --dest=org.ollie.SessionManager --type=method_call --print-reply \
/org/ollie/SessionManager org.ollie.SessionManager.ListBackends
# List available models
dbus-send --session --dest=org.ollie.SessionManager --type=method_call --print-reply \
/org/ollie/SessionManager org.ollie.SessionManager.ListModels \
string:"SESSION_ID"