CodesTask codes.task@1
Generated at from
openvibe-contracts v0.419.0 and
openvibe-sdk v0.161.0.
codes.task@2.- Version
- 1.1.0
- Owner
- codes
- Visibility
- first-party
- Status
- active
- Compatibility
- backward
- Schema
https://openvibe.network/contracts/codes/task.v1.json
codes.task@1: a coding task on OpenVibe.Codes, as GET /api/v1/tasks/:id answers it (capability codes.task.read) and POST /api/v1/tasks creates it. STATE follows the OpenVibe.Run job that carries it: queued (waiting for one of the person's machines), placed, running, then succeeded, failed, cancelled or expired (no machine of theirs took it in time). URL is the task's page on openvibe.codes, where its owner follows it live. RESULT is present once it has ended: OK says whether the agents finished, SUMMARY what they said, FILES and PATCH the change (the patch at most 256 KiB, PATCH_TRUNCATED when cut), PUSH where it went when asked, COST_USD the model use on the person's own keys, DURATION_MS the time on their machine. ERROR says why a task that never ran ended (Run refused it, or the job failed before a result).
Fields
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
id | string | yes | The Codes task id (tsk_ + ULID). |
|
state | enum | yes |
| |
repo | string | yes |
| |
ref | string | null |
| ||
agent | string | null |
| ||
url | string | yes |
| |
created_at | string | yes |
| |
updated_at | string | yes |
| |
error | string | null |
| ||
result | object |
| ||
result.ok | boolean | yes | ||
result.agents | array of string |
| ||
result.summary | string |
| ||
result.files | array of object |
| ||
result.files[].path | string | yes |
| |
result.files[].added | integer | null |
| ||
result.files[].removed | integer | null |
| ||
result.patch | string |
| ||
result.patch_truncated | boolean | |||
result.push | object |
| ||
result.push.pushed | boolean | yes | ||
result.push.branch | string |
| ||
result.push.branch_url | string |
| ||
result.push.pull_request | string |
| ||
result.push.pull_request_error | string |
| ||
result.push.reason | string |
| ||
result.cost_usd | number |
| ||
result.duration_ms | integer |
| ||
result.error | string |
| ||
actor_ref | object | null | The OpenVibe.Actor task and step that started this coding task, when it came from Actor. |
Examples
From the contract's own test fixtures: valid ones validate, rejected ones must fail.
The fixtures that ship with the package are the current major's.
Validate
const contracts = require('openvibe-contracts');
contracts.validate('codes.task@1', value); // { valid, errors: [{ path, message }] }