Commands
For adapter authors
Command envelope
{
"command_id": "cmd_01",
"type": "robotelos.submit_message",
"conversation_id": "conv_…",
"target": {},
"content": {"parts": [{"text": "hello"}]}
}
| Field | Required | Rule |
|---|---|---|
command_id | yes | Unique for the sender and conversation. Generated by the client. |
type | yes | One of the types in the catalog |
conversation_id | per type | Omitted for robotelos.create_conversation |
target | per type | Who or what the command is about |
content | per type | The payload. Limits apply (Base protocol). |
Identity and digest
The server stores each accepted command with a digest: a SHA-256 of a canonical JSON encoding of target and content. The canonical encoding sorts object keys, so the same content always gives the same digest.
A command with the same command_id, sender and conversation is processed by comparing digests:
- Same digest: the command is a retry. The server returns the original receipt and applies nothing.
- Different digest: the server returns
CONFLICT. Nothing changes.
A server MUST NOT apply a command twice. A server MUST return the same receipt for a retry.
Receipts
Every command gets exactly one receipt:
{
"receipt_id": "rcp_…",
"command_id": "cmd_01",
"conversation_id": "conv_…",
"disposition": "ACCEPTED",
"events": ["evt_…"],
"frames": [{"projection_id": "view_conv_…", "sequence": 12}]
}
| Disposition | Meaning | Events |
|---|---|---|
ACCEPTED | Applied | Recorded; events and frames name them |
REJECTED | Refused; the error says why | None |
CONFLICT | The same command_id was used with a different payload | None |
STALE | The command names a version that is no longer current | None |
A receipt is stored with the events, so get_receipt returns it even after a lost response.
Command catalog
robotelos.create_conversation
| Field | Where | Meaning |
|---|---|---|
kind | content | direct or group |
title | content | Optional |
participants | content | Agents to start with: [{"agent_id": "mock"}]. A group may start with none. |
The creator is the owner.
robotelos.submit_message
| Field | Where | Meaning |
|---|---|---|
parts | content | At least one part; each part has exactly one of text, data, url or raw |
mentions | content | Participant IDs the message addresses. In a group, only mentioned agents answer. |
relations | content | Optional, up to max_relations |
The message is accepted if the sender may speak in the conversation. Observers are refused with not_authorized.
robotelos.update_participant
| Field | Where | Meaning |
|---|---|---|
participant_id | target | The participant to act on. Omitted means the sender. |
membership | content | invite, join or leave |
role | content | owner, member, guest or observer |
display | content | A label for an invitee until it joins |
agent_id | content | An agent for an owner to add with join |
Who may send which membership is in Groups and participants. The last owner cannot leave or be demoted.
robotelos.answer_obligation
| Field | Where | Meaning |
|---|---|---|
obligation_id | target | The obligation answered |
expected_version | target | The obligation version the answer is based on |
answer.kind | content | approve |
request_digest | content | The digest of the operation shown to the responder |
The checks and outcomes are in Approvals.
Error codes
Every error has one of these codes. The table names the meaning and whether a retry can succeed.
| Code | Meaning | Retry |
|---|---|---|
not_authenticated | Missing or unknown token | After fixing the token |
not_authorized | The principal may not do this, such as an observer speaking | No |
not_participant | The sender is not in the conversation | No |
invalid_command | Malformed request or command | No |
payload_too_large | A limit was exceeded | No |
limit_exceeded | The principal holds as many connections, or the connection follows as many conversations, as the server allows | No |
rate_limited | The principal sends commands faster than the server allows; retry_after_ms is the wait | Yes |
unsupported_version | No common protocol version | No |
command_conflict | The command_id was used with another payload | No |
unknown_conversation | No such conversation, or the sender is no longer in it | No |
unknown_target | The target (for example an obligation) does not exist | No |
cursor_expired | The cursor is older than the server keeps | Subscribe again |
epoch_changed | The journal was rebuilt; the cursor is invalid | Subscribe again |
expired | An answer came after the obligation’s expiry | No |
internal | The server failed | Yes, with the same command_id |
Next steps
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.