UiAction ui.action@1
Generated at from
openvibe-contracts v0.419.0 and
openvibe-sdk v0.161.0.
- Version
- 1.0.0
- Owner
- contracts
- Visibility
- public
- Status
- active
- Compatibility
- backward
- Schema
https://openvibe.network/contracts/ui/action.v1.json
ui.action@1: one action an Element's recipe may request, from the fixed catalog, with the product that authorises it. An element never has a power of its own: the host asks the product named here, and that product checks the presser's role, the element's declared capability, its cooldown and cost, and its own owner limits before it does anything. kind is also the capability id an element declares in ui.element@1, and product is fixed by kind: bot for robot.drive_pulse, robot.head_preset, robot.headlight, robot.say and robot.macro; chat for chat.message, chat.pin and chat.poll; live for the screen, stream and webhook actions; ai for ai.ask; actor for actor.task; billing for money.tip_goal. A robot action is a request through Bot's existing command path: turns, Stop and owner takeover are never bypassed. Money never moves from an action without Billing's own confirmation.
Fields
This schema has no named fields.
Examples
From the contract's own test fixtures: valid ones validate, rejected ones must fail.
Valid: chat-message
{
"kind": "chat.message",
"product": "chat",
"text": "Nice one!"
}Valid: robot-pulse
{
"kind": "robot.drive_pulse",
"product": "bot",
"direction": "forward",
"ms": 600
}Valid: screen-alert
{
"kind": "screen.alert",
"product": "live",
"title": "Dance!",
"text": "Ada made the robot dance."
}Rejected: missing-text
{
"kind": "robot.say",
"product": "bot"
}Rejected: unknown-kind
{
"kind": "robot.dance",
"product": "bot"
}Rejected: wrong-product
{
"kind": "robot.drive_pulse",
"product": "live",
"direction": "forward",
"ms": 600
}Validate
const contracts = require('openvibe-contracts');
contracts.validate('ui.action@1', value); // { valid, errors: [{ path, message }] }