BotCommandResult bot.command-result@1
Generated at from
openvibe-contracts v0.454.0 and
openvibe-sdk v0.193.0.
- Version
- 1.1.0
- Owner
- bot
- Visibility
- first-party
- Status
- active
- Compatibility
- backward
- Decision
- ADR-043
- Schema
https://openvibe.network/contracts/bot/command-result.v1.json
bot.command-result@1: the command_result frame OpenVibe.Bot answers a bot.command@1 with on the operator WebSocket (server/realtime.js). result: ack or nack (the device answered; reason is its fault code, latency_ms the round trip), refused (the gate refused it; code is Bot's refusal code such as bot.cooldown or bot.device_offline, and reason says why), expired (no answer before the deadline) or pending (the same id is still in flight). cached is true when a repeated id is answered from the first result. An ack of a computer command (exec, fs, screen) carries its answer in data. delivery says whether the command reached the machine (delivered, not_delivered, uncertain); retry says whether repeating it is safe. Only not_delivered is safe to repeat: a delivered command already ran, and an uncertain one may have. mixed (1.1.0): on a crowd robot a crowd member's drive is an input for the mixer, never a command of its own; steering says how many are steering.
Fields
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
v | const | yes |
| |
seq | integer | yes |
| |
ts | integer | yes |
| |
type | const | yes |
| |
id | string | yes |
| |
result | enum | yes |
| |
reason | string | null | |||
code | string |
| ||
latency_ms | integer |
| ||
cached | boolean | |||
steering | integer | With result mixed: how many people the crowd mixer holds a fresh drive from, this one included. |
| |
data | object | A computer command's answer as the machine gave it (exec: exit_code, stdout, stderr, truncated, timed_out, duration_ms; fs: entries, the stat, content_b64, written, created; screen: format, width, height, content_b64). Present only on an ack of exec, fs or screen. | ||
delivery | enum | Whether the command reached the machine. Both senders and the device report it; absent means unknown. |
| |
retry | object | Whether repeating the command is safe. safe is true only when delivery is not_delivered. |
| |
retry.safe | boolean | yes | ||
retry.reason | string |
|
Examples
From the contract's own test fixtures: valid ones validate, rejected ones must fail.
Valid: ack-with-data
{
"v": 1,
"seq": 14,
"ts": 1759600000120,
"type": "command_result",
"id": "op-30",
"result": "ack",
"reason": null,
"latency_ms": 118,
"data": {
"exit_code": 0,
"stdout": " M index.html\n",
"stderr": "",
"truncated": false,
"timed_out": false,
"duration_ms": 35
}
}Valid: ack
{
"v": 1,
"seq": 13,
"ts": 1759600000013,
"type": "command_result",
"id": "op-7",
"result": "ack",
"reason": null,
"latency_ms": 42
}Valid: cached-pending
{
"v": 1,
"seq": 15,
"ts": 1759600000015,
"type": "command_result",
"id": "op-9",
"result": "pending",
"cached": true
}Valid: delivered-no-retry
{
"v": 1,
"seq": 16,
"ts": 1759600000016,
"type": "command_result",
"id": "op-10",
"result": "ack",
"reason": null,
"latency_ms": 87,
"delivery": "delivered",
"retry": {
"safe": false,
"reason": "the command already ran; repeating it runs it twice"
}
}Valid: mixed
{
"v": 1,
"seq": 21,
"ts": 1759600000021,
"type": "command_result",
"id": "op-12",
"result": "mixed",
"steering": 7
}Valid: not-delivered-retry
{
"v": 1,
"seq": 15,
"ts": 1759600000015,
"type": "command_result",
"id": "op-9",
"result": "expired",
"reason": "no answer before the deadline; the machine never confirmed receipt",
"delivery": "not_delivered",
"retry": {
"safe": true,
"reason": "the command never reached the machine"
}
}Valid: refused
{
"v": 1,
"seq": 14,
"ts": 1759600000014,
"type": "command_result",
"id": "op-8",
"result": "refused",
"code": "bot.device_offline",
"reason": "the robot is offline"
}Rejected: bad-delivery
{
"v": 1,
"seq": 17,
"ts": 1759600000017,
"type": "command_result",
"id": "op-11",
"result": "ack",
"delivery": "maybe",
"retry": {
"safe": true
}
}Rejected: mixed-steering-zero
{
"v": 1,
"seq": 22,
"ts": 1759600000022,
"type": "command_result",
"id": "op-13",
"result": "mixed",
"steering": 0
}Rejected: no-id
{
"v": 1,
"seq": 17,
"ts": 1759600000017,
"type": "command_result",
"result": "ack"
}Rejected: unknown-result
{
"v": 1,
"seq": 16,
"ts": 1759600000016,
"type": "command_result",
"id": "op-7",
"result": "ok"
}Validate
const contracts = require('openvibe-contracts');
contracts.validate('bot.command-result@1', value); // { valid, errors: [{ path, message }] }