NetworkMachineRoles network.machine-roles@1

Generated at from openvibe-contracts v0.419.0 and openvibe-sdk v0.161.0.

Version
1.0.0
Owner
network
Visibility
public
Status
active
Compatibility
backward
Schema
https://openvibe.network/contracts/network/machine-roles.v1.json

network.machine-roles@1: the catalogue of machine roles (plan L34, step M4). A product declares a role — a name, what it installs on the machine and what the hub shows — and the Link turns it on at its next check-in. The first roles are Codes' worker, Desks' host, AI's local models and Bot's robot. A role outside this catalogue is refused (network.machine-roles-put@1).

Fields

FieldTypeRequiredDescriptionConstraints
rolesnetwork.machine-roleyes
  • minItems 1
  • unique items

Examples

From the contract's own test fixtures: valid ones validate, rejected ones must fail.

Valid: catalogue
{
  "roles": [
    {
      "id": "codes.worker",
      "name": "Codes worker",
      "installs": "Codes worker on the machine",
      "shows": "Runs codes worker for you"
    },
    {
      "id": "desks.host",
      "name": "Desk host",
      "installs": "Desk host on the machine",
      "shows": "Runs desk host for you"
    },
    {
      "id": "ai.host",
      "name": "AI host",
      "installs": "AI host on the machine",
      "shows": "Runs ai host for you"
    },
    {
      "id": "bot.robot",
      "name": "Robot",
      "installs": "Robot on the machine",
      "shows": "Runs robot for you"
    }
  ]
}
Rejected: empty
{
  "roles": []
}
Rejected: not-a-list
{
  "roles": "codes.worker"
}

Validate

const contracts = require('openvibe-contracts');
contracts.validate('network.machine-roles@1', value);   // { valid, errors: [{ path, message }] }