← DureClaw Home

Developer Reference

Phoenix channel events and the REST API.

→

Channel Events

EVENTDIRECTIONPAYLOAD (key fields)DESCRIPTION
task.assignorch → agentto, task_id, role, instructionsAssigns a task. The target agent runs its AI backend.
task.progressagent → alltask_id, message, output_tailBroadcasts progress every 10 seconds.
task.resultagent → alltask_id, exit_code, artifacts[]Reports task completion. ARTIFACT: lines are parsed automatically.
task.cancelorch → agenttask_idCancels a running task via an AbortController signal.
task.blockedany → alltask_id, reasonCannot proceed. The orchestrator decides whether to reassign.
state.updateany → serverkey: valueUpdates Work Key state (persisted in DETS).
mailbox.postany → targetto, bodyQueued if the target is offline, delivered immediately if online.
agent.helloserver → allagent, role, machineNotifies that an agent joined.
agent.byeserver → allagent, roleNotifies that an agent left.
→

REST API

METHODENDPOINTDESCRIPTION
GET/api/healthServer status · work_key count
GET/api/presenceOnline agents (name, role, machine)
GET/api/work-keysList Work Keys
GET/api/work-keys/latestLatest Work Key (404 if none)
POST/api/work-keysIssue a new Work Key
POST/api/taskDispatch a task { role, to, instructions }
GET/api/task/:idPoll a task result
POST/api/task/:id/resultStore a task result · broadcast to the channel
GET/api/state/:wkRead Work Key state
PATCH/api/state/:wkUpdate Work Key state
GET/api/mailbox/:agentRead an agent mailbox
POST/api/mailbox/:agentSend a message to an agent mailbox