LiveAgentSandboxWorkerResult live.agent-sandbox-worker-result@1

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

Version
1.0.0
Owner
live
Visibility
first-party
Status
active
Compatibility
backward
Schema
https://openvibe.network/contracts/live/agent-sandbox-worker-result.v1.json

live.agent-sandbox-worker-result@1 (Agent Streams S6): the answer to POST /api/streams/agent/:id/plays/worker (capability live.agent_sandbox.register). It carries the worker's state for the stream's owner as Live now holds it: whether a healthy worker is registered, the code and the owner-facing reason when not, when the last check-in was, and how long a check-in counts (a minute). Live never returns an endpoint: there is none to return.

Fields

FieldTypeRequiredDescriptionConstraints
workerobjectyes
  • no other fields
worker.readybooleanyes
worker.codeenumWhy there is no healthy worker; null when ready is true.
  • one of "sandbox_worker_missing", "sandbox_worker_stale", "sandbox_worker_not_isolated", null
worker.reasonstring | nullThe line the owner's page shows; null when ready is true.
  • maxLength 500
worker.last_seen_atinteger | nullThe last check-in, in milliseconds since the epoch; null when the worker never checked in.
  • minimum 0
worker.stale_after_msintegeryes
  • minimum 1000

Examples

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

Valid: ready
{
  "worker": {
    "ready": true,
    "code": null,
    "reason": null,
    "last_seen_at": 1770000000000,
    "stale_after_ms": 60000
  }
}
Valid: stale
{
  "worker": {
    "ready": false,
    "code": "sandbox_worker_stale",
    "reason": "Needs the sandbox worker; coming soon",
    "last_seen_at": 1769999940000,
    "stale_after_ms": 60000
  }
}
Rejected: no-stale-window
{
  "worker": {
    "ready": false,
    "code": "sandbox_worker_missing",
    "reason": "Needs the sandbox worker; coming soon",
    "last_seen_at": null
  }
}
Rejected: unknown-code
{
  "worker": {
    "ready": false,
    "code": "sandbox_worker_offline",
    "reason": "Needs the sandbox worker; coming soon",
    "last_seen_at": null,
    "stale_after_ms": 60000
  }
}

Validate

const contracts = require('openvibe-contracts');
contracts.validate('live.agent-sandbox-worker-result@1', value);   // { valid, errors: [{ path, message }] }