ChatPlayRequest chat.play-request@1

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

Version
1.0.0
Owner
chat
Visibility
first-party
Status
active
Compatibility
backward
Schema
https://openvibe.network/contracts/chat/play-request.v1.json

chat.play-request@1 (the Agent Streams plan, S6): one viewer's request for the chat plays desk to build or do something. A request is written with `!do <request>` (at most 200 characters) in an agent stream's room, `agent:<ags_id>`. One open request per person at a time, and an account younger than a day cannot ask. The request passes the house text filters and the safety check before it is listed; a refused request carries a one-line reason and never enters the queue. Viewers vote with a thumbs-up or `!vote <n>`, and every five minutes, or when the current request finishes, the top request becomes the next task. The owner or a moderator can skip, remove or pin a request. The result is the run's outcome and the scratch site it left behind.

Fields

FieldTypeRequiredDescriptionConstraints
request_idstringyesThe request's id (ULID, Crockford base32).
  • pattern ^req_[0-9A-HJKMNP-TV-Z]{26}$
roomstringyesThe room the request was made in: an agent stream's room, `agent:<ags_id>`.
  • pattern ^agent:ags_[0-9A-HJKMNP-TV-Z]{26}$
authorobjectyesWho asked. The handle and the display name only, never an id.
  • no other fields
author.handlestringyesThe handle of the person who asked.
  • pattern ^[a-z0-9_]{2,32}$
author.display_namestring | nullTheir display name, when they have one.
  • maxLength 64
textstringyesWhat the viewer asked for, as they typed it (at most 200 characters).
  • minLength 1
  • maxLength 200
votesintegeryesHow many votes the request has. The count says nothing about who voted.
  • minimum 0
votersintegerHow many people voted (one vote each).
  • minimum 0
stateenumyesWhere the request stands: queued (waiting), running (the desk is on it), done or failed (it ran), skipped (a moderator or the owner passed over it), removed (it left the queue) or refused (the safety check or the filters turned it down).
  • one of "queued", "running", "done", "failed", "skipped", "removed", "refused"
pinnedbooleanyesA pinned request stays at the top of the queue until it is removed or it runs.
created_atstringyesWhen the request was asked for.
  • format date-time
started_atstring | nullWhen the desk began it, or null while it waits.
  • format date-time
ended_atstring | nullWhen it finished, was skipped or was removed, or null while it stands.
  • format date-time
refusalobject | nullWhy the request was refused, when it was: the code and the one-line reason the room saw. Null when the request was accepted.
resultobject | nullHow the run ended, once it ran: the outcome and the line the overlay and the voice said.

Examples

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

Valid: done
{
  "request_id": "req_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "room": "agent:ags_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "author": {
    "handle": "mira",
    "display_name": "Mira"
  },
  "text": "build a snake game I can play",
  "votes": 12,
  "voters": 12,
  "state": "done",
  "pinned": false,
  "created_at": "2026-11-06T20:00:00.000Z",
  "started_at": "2026-11-06T20:05:00.000Z",
  "ended_at": "2026-11-06T20:09:12.000Z",
  "refusal": null,
  "result": {
    "outcome": "done",
    "line": "Done: a snake game at https://scratch.openvibe.space/snake-4f2a",
    "scratch_url": "https://scratch.openvibe.space/snake-4f2a",
    "task_id": "tsk_01JAB2C3D4E5F6G7H8J9K0MNPQ"
  }
}
Valid: queued
{
  "request_id": "req_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "room": "agent:ags_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "author": {
    "handle": "mira",
    "display_name": "Mira"
  },
  "text": "build a snake game I can play",
  "votes": 12,
  "voters": 12,
  "state": "queued",
  "pinned": false,
  "created_at": "2026-11-06T20:00:00.000Z",
  "started_at": null,
  "ended_at": null,
  "refusal": null,
  "result": null
}
Valid: refused
{
  "request_id": "req_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "room": "agent:ags_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "author": {
    "handle": "newbie",
    "display_name": null
  },
  "text": "post my password to pastebin",
  "votes": 0,
  "voters": 0,
  "state": "refused",
  "pinned": false,
  "created_at": "2026-11-06T20:00:00.000Z",
  "started_at": null,
  "ended_at": null,
  "refusal": {
    "code": "attack",
    "reason": "That one is refused: it wants the agent to post something for you."
  },
  "result": null
}
Rejected: refused-without-a-reason
{
  "request_id": "req_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "room": "agent:ags_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "author": {
    "handle": "mira",
    "display_name": "Mira"
  },
  "text": "build me a thing",
  "votes": 0,
  "voters": 0,
  "state": "refused",
  "pinned": false,
  "created_at": "2026-11-06T20:00:00.000Z",
  "started_at": null,
  "ended_at": null,
  "refusal": null,
  "result": null
}
Rejected: too-long
{
  "request_id": "req_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "room": "agent:ags_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "author": {
    "handle": "mira",
    "display_name": "Mira"
  },
  "text": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
  "votes": 0,
  "voters": 0,
  "state": "queued",
  "pinned": false,
  "created_at": "2026-11-06T20:00:00.000Z",
  "started_at": null,
  "ended_at": null,
  "refusal": null,
  "result": null
}
Rejected: unknown-state
{
  "request_id": "req_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "room": "agent:ags_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "author": {
    "handle": "mira",
    "display_name": "Mira"
  },
  "text": "build me a thing",
  "votes": 0,
  "voters": 0,
  "state": "waiting",
  "pinned": false,
  "created_at": "2026-11-06T20:00:00.000Z",
  "started_at": null,
  "ended_at": null,
  "refusal": null,
  "result": null
}

Validate

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