DEVELOPER DOCUMENTATION · 0.11.0+

Native companion API

Build a native companion for any agent. Your application owns its conversations and model connections; OpenWalkieTalkie supplies a grouped deck roster, voice input, conversation display, questions and session settings. Conol uses this same public interface.

Requires OpenWalkieTalkie app, service and firmware 0.11.0 or newer. This is a local desktop integration over JSON-RPC, with no Conol dependency. Existing CLI hooks remain supported.

Download the Python example · Complete API reference (Markdown) · Documentation home

Try the example

Start OpenWalkieTalkie, connect your deck, download the example, then run:

python3 native_companion.py

Python 3.10+ is sufficient; no packages or credentials are required. Select Example → + New chat and dictate a first message. The new conversation opens on the deck. Say “form” to try a paged single-choice question, multiple selections, dictated text and a final review. Open the session settings to switch between two scripted demo models and their effort options. The example makes no model API calls. Ctrl-C releases its registrations.

The example's Companion.order, Companion.apply_settings and form submission branch are the places to connect your backend. It keeps a small transcript and form drafts in memory; a production app should restore them from its own conversation store. Run one demo at a time, since both copies use the “Example” device heading.

Connect and discover

Connect from your desktop process to the same-user Unix domain socket. Send one UTF-8 JSON-RPC 2.0 object per newline, using a distinct request id. Correlate replies by id; notifications can arrive between replies. Keep heartbeats running while backend work is in progress.

Begin every connection with:

{"jsonrpc":"2.0","id":1,"method":"session.hello","params":{
  "client":{"name":"Example companion","version":"1"},
  "scopes":["agent","observe"],
  "subscribe":["agent.order","agent.answer","focus.changed","session.settings_requested"],
  "snapshot":false
}}

The socket authenticates the local OS user. Request only agent and observe for this integration. Owned events include the content needed to handle your conversations; these scopes do not grant another app's private transcript. No remote API key needs to be sent to the daemon. Keep the socket in your trusted desktop process rather than exposing a raw RPC bridge to web content.

A missing socket means the service is unavailable: show a disconnected status and retry with backoff. A -32601 response to either new method means the daemon lacks native companion support; offer an update instead of silently reporting that the integration connected. The methods, their scopes and their request schemas are in the API reference.

The socket is the one door for connected apps. The service's HTTP and WebSocket door on 127.0.0.1, and the bearer tokens that open it, are off by default. The service keeps the door on only while Claude Code's HTTP hooks from an older OpenWalkieTalkie install still need it, and an explicit [api] tcp setting in its config.toml always wins. Removing the door and its tokens is planned for the next release. Do not build on them.

Register sessions and group them

Register one agent per conversation, plus an optional launcher. Keep a stable, namespaced key for each app/account/conversation. Registration is idempotent for that key on the owning connection.

{"jsonrpc":"2.0","id":2,"method":"agent.register","params":{
  "kind":"other","name":"Plan the release","key":"example:personal:chat-42",
  "caps":{"answer":"push","order":"push","focus":true},"lease_ttl_s":30
}}

Save the returned agent ID; use it in subsequent requests. The examples below use ag_example as a placeholder.

{"jsonrpc":"2.0","id":3,"method":"agent.companion.set","params":{
  "agent":"ag_example","profile":{
    "app_id":"org.example.companion","group_id":"personal",
    "group_label":"Example","role":"session"
  }
}}

app_id is a stable application identifier (1–64 ASCII letters, digits, dots, dashes or underscores). group_id identifies an account or workspace within the app (1–128 UTF-8 bytes). group_label is its visible heading (1–24 UTF-8 bytes). Labels and IDs must be nonempty and contain no control characters. These are public presentation fields: use opaque account IDs, not credentials or private account names. Use distinct labels, such as “Example · Work”, for groups that should have separate device pages: the firmware groups by visible label; desktop grouping and overflow promotion use app/account IDs.

role is session or launcher. profile: null removes the native presentation. kind remains the provider identity in the API; use other for a custom agent. Existing provider kinds also accept a companion profile. Conol's optional robot artwork comes from its kind; neither the artwork nor a new firmware enum is required for another app to integrate.

Native focus is routed to your app through events instead of terminal injection. There are eight shared physical slots. Check the returned slot (null means overflow). Focusing an overflow companion first uses normal slot allocation; if all slots are busy, it can replace an unpinned session from the same owning connection, app and group. That fallback preserves launchers, other accounts and other apps. It does not guarantee a slot when all candidates are protected. Do not register an unbounded history: publish a useful active window and retain the full list in your own app.

Send agent.heartbeat with your owned agent IDs every 10 seconds for a 30-second lease. On sign-out or shutdown, use agent.release. After a socket loss, reconnect and register again. If registration returns ownership conflict -32004, agent.claim {"key":"…"} can reclaim an orphaned or expired registration; it cannot take over an active connection. Republish profile, settings, transcript and the current question after reconnect. Neither leases nor the daemon are your persistent chat database.

Start and activate a new chat

Register a launcher named + New chat with role: "launcher" and the same group as its conversations. Its order capability must be push. The role controls presentation and slot protection; it does not create backend sessions for you.

Handle notifications in this envelope:

{"jsonrpc":"2.0","method":"event","params":{
  "type":"agent.order","rev":123,
  "data":{"agent":"ag_launcher","text":"Help me plan the release","order":"or_12"}
}}
  1. Resolve data.agent to an owned account and launcher. Deduplicate the notification within this connection, using its rev and type.
  2. Create the conversation and first user message through your authenticated backend. Keep its durable ID; serialize concurrent starts for the same launcher.
  3. Register the new conversation with its own stable key and role: "session". Publish actual settings and recent messages.
  4. Select the new conversation in your app, then call agent.focus {"agent":"ag_new"}. The daemon sends slot replacement updates before focus, and the firmware opens the conversation after PTT release. An already open question card stays put.

Handle focus.changed with data.source: "device" by selecting the matching conversation in your app, or opening a blank composer for the launcher. Do not respond with another focus request and create a feedback loop. Events for unknown agent IDs must be ignored.

Never retry an uncertain backend create blindly. Use your backend's idempotency key or reconcile the durable result first. A socket reconnect is not proof that a previous create failed. The sample's local in-memory creation is illustrative; production backends must supply this guarantee.

Keep both transcripts current

For an existing session, agent.order means deliver a follow-up message to that conversation. Use a stable client message ID in your backend, update your app's visible transcript, and resume its response stream. Mirroring only to the deck leaves your desktop UI stale.

Each order dictated or typed for your agent carries an order ID in data.order; a step chosen on one of your Ready cards (ctx: "step") carries none and needs no report. If the message cannot reach your conversation, report it, and the deck shows that the order was not delivered:

{"jsonrpc":"2.0","id":5,"method":"agent.order.result","params":{
  "agent":"ag_example","order":"or_12","ok":false,"reason":"backend_refused"
}}

reason is one word of lowercase letters, digits and underscores, at most 32 bytes. Report each order at most once, within ten minutes; ok: true is accepted and changes nothing. The reply is {rev, shown}, where shown is card, toast or none. A card the daemon puts on your agent for this arrives as a card.set with host: "failure"; your next agent.card.set replaces it. When it took the place of an informational card of yours (one nothing waits on), an agent.card.clear of that card is still answered with {rev}, and the failure card stays. Older daemons send no order and answer -32601: skip the report then. service.info lists order.result in capabilities when the method exists.

Publish public user and assistant messages with stable IDs:

{"jsonrpc":"2.0","id":4,"method":"agent.reply","params":{
  "agent":"ag_example","text":"I can help with the release.","speak":false,
  "message":{"id":"message-42","role":"assistant","streaming":true}
}}

Send the same message ID to replace the text during streaming; finish with streaming: false. Send user messages with role: "user" too. The daemon retains at most 64 messages and 512 KiB per agent; publish a bounded recent window. Keep private reasoning, credentials and internal tool arguments out of the mirrored transcript. Speech is opt-in through speak.

Use agent.update for the conversation name, short title and state (working, question, ready, error or idle). Preserve the actual backend state and surface delivery failures without claiming a message was accepted. When a response finishes, publish its final message (streaming: false) before you set state: ready: the deck reads out the reply on file when the state turns ready, and never a reply published before the conversation last turned working.

Native companions can also publish public tool activity through agent.reply, with message.role: "tool", an explicit activity of running, completed, failed or stopped, and summary: {"label":"Running a command","detail":"cargo test"}. This optional summary requires an updated daemon with ActivitySummary in its schema; firmware 0.11.0 can render the resulting rows. Use a stable call ID, set streaming only while running, and finish or stop the previous call when it disappears. Send only the visible label and preview, keep full tool inputs/results in the owning app, and leave speak: false. Summary content follows the same content-scope redaction as conversation text.

Transcribe with your own speech model

If your app has its own speech recogniser, register with caps.transcribe: "push". The daemon then records each press addressed to that agent and offers it to your connection when the operator releases PTT. Your text becomes the press's final transcript, so the deck's transcript, agent.order and dictated agent.answer carry it. The daemon's own recogniser still runs alongside and supplies the final transcript if you fail, refuse, send empty text, disconnect or take more than 20 seconds. Its words are not shown during the press, because they are not what will be sent. The deck shows a RECORDING waveform that follows its microphone level instead (updated firmware; older firmware shows an empty transcript). Older daemons ignore the field. Check for transcribe.companion in service.info capabilities if you need to know in advance.

{"jsonrpc":"2.0","method":"event","params":{
  "type":"agent.transcribe","rev":124,
  "data":{"agent":"ag_example","transcription":"tr_7","mime":"audio/wav",
    "rate":16000,"ms":4200,"bytes":134444,"page":98304,"locale":"en-US"}
}}

The recording is 16 kHz, 16-bit mono WAV of at most about a minute. Fetch it in pages with agent.transcribe.audio {"transcription":"tr_7","offset":0}, which returns {offset,total,data} with base64 data. Advance offset by the decoded length until it reaches total. Then answer exactly once with agent.transcribe.result {"transcription":"tr_7","text":"…"}, or with "error":"…" if you can't transcribe it. Answer an error immediately rather than staying silent, so the deck doesn't wait out the budget. Only the owning connection can read or answer an offer. Offers are sent only to that connection and never appear on the event bus. Presses that name the deck itself, and presses shorter than 0.3 seconds, are never offered. The audio leaves the daemon only when [voice.stt] companion is on, which is the default, and the operator can turn it off.

Handle complex questions on the deck

The public question primitive is agent.card.set. A card can have up to four choices and optional free text. Build a multi-step form in your application; every rendered step gets a new card ID.

{"jsonrpc":"2.0","id":5,"method":"agent.card.set","params":{
  "agent":"ag_example","type":"q","text":"1/3 Choose a language",
  "choices":[{"label":"Python"},{"label":"Rust"},{"label":"More"},{"label":"Cancel"}],
  "free_text":false,"deliver":"push","origin":{"kind":"custom"}
}}

Save result.card.id. Accept agent.answer only when both data.agent and data.card match the active question. data.choice is a zero-based choice index; data.text carries dictated free text. Never apply a late answer to a replacement question. Clear the previous card with agent.card.clear {"agent":"…","card":17,"delivered":false} before publishing the next step.

If a form cannot be represented within the device limits, offer an explicit “Open in app” choice. The app should focus the relevant question, without pretending the form was completed. The example demonstrates the wizard using a scripted local form; Conol connects the same pattern to AskUser and workflow approvals.

Display and change model / thinking effort

Report settings with agent.session.set for any owned agent. Display-only settings need no catalog:

{"jsonrpc":"2.0","id":6,"method":"agent.session.set","params":{
  "agent":"ag_example","controls":{
    "model":"My model","effort":"High","editable":false,
    "note":"Change these settings in Example."
  }
}}

For deck-editable settings, supply stable model IDs, readable labels and each model's supported effort values. Send the backend's actual selection, not a guessed default.

{"jsonrpc":"2.0","id":7,"method":"agent.session.set","params":{
  "agent":"ag_example","controls":{
    "model":"fast","effort":"low","editable":true,"note":"",
    "models":[
      {"id":"fast","label":"Fast model","efforts":["low","high"],"default_effort":"low"},
      {"id":"simple","label":"Simple model","efforts":[],"default_effort":""}
    ]
  }
}}

model and each model ID/label are limited to 128 UTF-8 bytes; effort strings to 32; note to 256. There may be at most 64 models and 16 efforts per model, with unique model IDs and unique effort values. Control characters are rejected. Editable selections must belong to their catalog; empty effort represents the backend default or no effort setting. A nonempty default_effort must be listed in that model's efforts.

A device selection emits session.settings_requested (underscore before requested):

{"jsonrpc":"2.0","method":"event","params":{
  "type":"session.settings_requested","rev":124,
  "data":{"agent":"ag_example","model":"fast","effort":"high","request_rev":19}
}}

Apply the requested setting in your backend, then call agent.session.set with the actual resulting controls and request_rev: 19. Use data.request_rev, not the envelope's event rev. The device keeps its existing selection pending until confirmation. On failure, confirm the unchanged actual settings with a short explanatory note.

Ordinary refreshes omit request_rev and do not settle pending requests. A mismatched, duplicate or expired confirmation is rejected. Pending changes time out after 45 seconds. Preserve request/agent correlation across asynchronous work, and reconcile the backend if a response is lost. The daemon validates transport and ownership; your application remains responsible for authorizing and applying model changes.

Feed the Omarchy face

The deck's Omarchy face is a window switcher: a row of up to nine workspace chips and up to six window rows. Nothing in it is specific to Omarchy. Any app can fill it with device.ws.set and act on what the operator does there through three events. The Omarchy bridge (host/omarchy/ in the source repository) is the reference client, and CI runs its tests on every pull request.

The face feed is a public interface, and additive-only from now on. device.ws.set and the device.ws, device.key and device.link events may gain fields; none of their fields will be renamed, retyped or removed. Ignore fields you do not know.

Ask for the device scope, which device.ws.set needs, and name the three events. device.key is a high-volume event that "*" does not match, so it must be named.

{"jsonrpc":"2.0","id":1,"method":"session.hello","params":{
  "client":{"name":"Example window switcher","version":"1"},
  "scopes":["device","observe"],
  "subscribe":["device.ws","device.key","device.link"],
  "snapshot":false
}}

Send the whole face whenever it changes. The reply is {"rev":…}.

{"jsonrpc":"2.0","id":2,"method":"device.ws.set","params":{
  "active":2,"count":4,"sel":0,
  "windows":[
    {"tone":"blue","title":"kitty — claude · header refactor"},
    {"title":"firefox — github · pulls"}
  ]
}}

A value out of range is refused with -32009 and data.field naming it; a missing field or a wrong type with -32602. The service keeps the last face you sent and shows it whenever the Omarchy face is on screen, including after the deck links again. It does not keep it across its own restart, so send the face again every time you connect. The face must be on the deck's strip. The operator adds it from the deck's own face manager, or a client with the device scope sends the whole strip, with an omarchy entry in it, through device.faces.set. The service takes only a strip the deck would: agents first and settings last with neither in between, at most eight faces, each with its own id from 1 to 8, at most three macropad and one timer, and a name on every face. It refuses any other with -32009 and data.why naming the rule, and sends nothing. The Mac app's Faces & Keys page does not offer it.

A tap on the face arrives as device.ws, with either go, the workspace number of the chip, or win, the 0-based row of the windows you sent last:

{"jsonrpc":"2.0","method":"event","params":{
  "type":"device.ws","rev":130,"data":{"win":1}
}}

The deck's keys arrive as device.key while the Omarchy face is on screen:

{"jsonrpc":"2.0","method":"event","params":{
  "type":"device.key","rev":131,"data":{"k":"cw","act":2,"shift":false,"f":2}
}}

The deck's link arrives as device.link, whenever the link or its session changes:

{"jsonrpc":"2.0","method":"event","params":{
  "type":"device.link","rev":132,
  "data":{"link":"connected","session":"live","host_online":true,
    "sid":314159,"fw":"0.13.1","boot":false}
}}

link is connected, degraded or offline; session is absent, linked, await_hello, syncing, live or degraded; host_online is true while the deck counts this computer as present. fw, the deck's firmware version, and boot are null while unknown. The event the service sends as it shuts down carries only link, session and host_online. Use the event to show whether the deck is there; you need not send the face again when it links.

The service goes quiet without a deck. With no deck linked for ten minutes it stops collecting from agent sessions: it stops polling Claude Code and Codex, watching transcripts and reading usage, and starts again the moment a deck links. It says so with service.dormancy, which "*" carries; the same object is snapshot.service.dormancy, and service.info carries collecting and dormant_since:

{"jsonrpc":"2.0","method":"event","params":{
  "type":"service.dormancy","rev":140,
  "data":{"window_s":600,"collecting":false,"dormant_since":"2026-11-11T01:51:00.000Z"}
}}

dormant_since is null while it collects, and when no deck was ever linked; a service started without a deck to wait for sends null for the whole object. Your connection, your agents and every method you call work as before while it is quiet. If your app collects from sessions of its own, do the same: the Omarchy bridge stops feeding its face and looking at its sessions after ten minutes of device.link saying no deck, and starts again when it links.

Integration checklist

Before shipping, test a first chat and follow-up on both screens; an order your backend refused, reported with agent.order.result; companion transcription and its local fallback, if you offer it; overflow with another app present; sign-out and reconnect; streamed message replacement; stale question presses; multi-select paging; cancel versus submit; backend submission failure; readonly settings; model changes with different effort catalogs; and an expired settings confirmation.

The runnable example is also checked with a fake backend in tools/tests/test_native_companion.py. The public request schemas and method permissions come from deckd api-doc. Keep these interfaces separate from provider-specific hooks so a custom agent does not need a firmware fork or a Conol account.

Language