BotCommand bot.command@1
Generated at from
openvibe-contracts v0.114.0 and
openvibe-sdk v0.35.1.
- Version
- 1.0.0
- Owner
- bot
- Visibility
- first-party
- Status
- active
- Compatibility
- backward
- Decision
- ADR-043
- Schema
https://openvibe.network/contracts/bot/command.v1.json
bot.command@1: an operator's command frame on OpenVibe.Bot's operator WebSocket (wss://openvibe.bot/control, after join; server/realtime.js onOperatorCommand). id is the operator's idempotency key (at most 64 characters; Bot mints one when it is missing): a repeated id answers with the first result. Bot's gate stamps the robot, the operator and the role, builds the value from the robot profile's commands (clamped by the owner's limits) and sets the deadline; ms asks for a duration within max_command_ms. Answered by one command_result frame (bot.command-result@1). The kinds button (a profile button by name, with an optional state for a hold button) and point (a normalised x, y video click) were added in 0.109.0 (plan T15 R9).
Fields
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
v | const |
| ||
seq | integer |
| ||
ts | integer |
| ||
type | const | yes |
| |
id | string |
| ||
kind | enum | yes |
| |
value | object | |||
ms | integer |
|
Examples
From the contract's own test fixtures: valid ones validate, rejected ones must fail.
Valid: button
{
"v": 1,
"seq": 20,
"ts": 1759600000000,
"type": "command",
"id": "op-8",
"kind": "button",
"value": {
"name": "lights_on"
}
}Valid: drive
{
"v": 1,
"seq": 12,
"ts": 1759600000000,
"type": "command",
"id": "op-7",
"kind": "drive",
"value": {
"throttle": 0.5,
"steer": -0.2
},
"ms": 300
}Valid: halt
{
"type": "command",
"kind": "halt"
}Valid: hold-button
{
"v": 1,
"seq": 21,
"ts": 1759600000000,
"type": "command",
"id": "op-9",
"kind": "button",
"value": {
"name": "horn",
"state": "down"
}
}Valid: point
{
"v": 1,
"seq": 22,
"ts": 1759600000000,
"type": "command",
"id": "op-10",
"kind": "point",
"value": {
"x": 0.25,
"y": 0.75
}
}Rejected: point-out-of-range
{
"v": 1,
"seq": 23,
"ts": 1759600000000,
"type": "command",
"id": "op-11",
"kind": "point",
"value": {
"x": 1.5,
"y": 0.5
}
}Rejected: stamped-operator
{
"type": "command",
"kind": "drive",
"value": {},
"operator": {
"subject": "usr_01J8Z4P7T3W9Y1AC5N8R0S4V6X",
"role": "owner"
}
}Rejected: unknown-kind
{
"type": "command",
"kind": "self_destruct"
}Validate
const contracts = require('openvibe-contracts');
contracts.validate('bot.command@1', value); // { valid, errors: [{ path, message }] }