RunJobStreamEvent run.job-stream-event@1
Generated at from
openvibe-contracts v0.97.0 and
openvibe-sdk v0.26.0.
- Version
- 1.0.0
- Owner
- run
- Visibility
- public
- Status
- planned
- Compatibility
- backward
- Decision
- ADR-034
- Schema
https://openvibe.network/contracts/run/job-stream-event.v1.json
run.job-stream-event@1 (PLANNED; plan T14 R1): the JSON `data` of one server-sent event on GET /api/v1/jobs/{id}/stream (capability run.job.stream). The SSE `event` field is the type and the SSE `id` is `seq`, so a reconnect with Last-Event-ID resumes after it. output: a chunk of the job's stdout (platform.job-frame@1 job_stdout, best effort: a chunk lost on the node's link is never resent, and Run keeps at most the last 1 MiB to replay). state: the job moved to a new state. end: the job reached its end state; the server closes the stream after it. A stream opened on an ended job replays what is kept, then end. Output is never metered and never in an event.
Fields
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
type | enum | yes |
| |
job_id | string | yes |
| |
seq | integer | yes | The job's own stream counter from 1; the SSE id. |
|
at | string | yes |
| |
chunk | string | output only: UTF-8 text. |
| |
state | enum | state and end: the job's state. |
|
Examples
From the contract's own test fixtures: valid ones validate, rejected ones must fail.
Valid: end
{
"type": "end",
"job_id": "job_01JAB2C3D4E5F6G7H8J9K0MNPQ",
"seq": 4,
"at": "2026-10-04T10:00:03.000Z",
"state": "succeeded"
}Valid: output
{
"type": "output",
"job_id": "job_01JAB2C3D4E5F6G7H8J9K0MNPQ",
"seq": 3,
"at": "2026-10-04T10:00:01.000Z",
"chunk": "resized 1 of 1\n"
}Valid: state
{
"type": "state",
"job_id": "job_01JAB2C3D4E5F6G7H8J9K0MNPQ",
"seq": 2,
"at": "2026-10-04T10:00:00.650Z",
"state": "running"
}Rejected: end-while-running
{
"type": "end",
"job_id": "job_01JAB2C3D4E5F6G7H8J9K0MNPQ",
"seq": 4,
"at": "2026-10-04T10:00:03.000Z",
"state": "running"
}Rejected: output-without-chunk
{
"type": "output",
"job_id": "job_01JAB2C3D4E5F6G7H8J9K0MNPQ",
"seq": 3,
"at": "2026-10-04T10:00:01.000Z"
}Validate
const contracts = require('openvibe-contracts');
contracts.validate('run.job-stream-event@1', value); // { valid, errors: [{ path, message }] }