46 lines
1.8 KiB
JSON
46 lines
1.8 KiB
JSON
{
|
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
"title": "orch cmd adapter protocol",
|
|
"$defs": {
|
|
"Task": {
|
|
"type": "object",
|
|
"required": ["id", "title", "body"],
|
|
"properties": {
|
|
"id": {"type": "string", "minLength": 1},
|
|
"title": {"type": "string"},
|
|
"body": {"type": "string"},
|
|
"repo": {"type": "string", "description": "local clone path"}
|
|
},
|
|
"additionalProperties": true
|
|
},
|
|
"Run": {
|
|
"type": "object",
|
|
"required": ["id", "status", "branch", "repo"],
|
|
"properties": {
|
|
"id": {"type": "string"},
|
|
"status": {"enum": ["queued", "running", "gating", "done", "failed", "needs-human"]},
|
|
"reason": {"type": ["string", "null"]},
|
|
"branch": {"type": "string"},
|
|
"repo": {"type": "string"},
|
|
"worktree": {"type": "string"},
|
|
"attempts": {"type": "integer"},
|
|
"input_tokens": {"type": "integer"},
|
|
"output_tokens": {"type": "integer"},
|
|
"published": {"type": ["string", "null"]}
|
|
}
|
|
}
|
|
},
|
|
"oneOf": [
|
|
{"title": "list: stdin", "type": "object", "maxProperties": 0},
|
|
{"title": "list: stdout", "type": "object", "required": ["tasks"],
|
|
"properties": {"tasks": {"type": "array", "items": {"$ref": "#/$defs/Task"}}}},
|
|
{"title": "claim: stdin", "type": "object", "required": ["task"],
|
|
"properties": {"task": {"$ref": "#/$defs/Task"}}},
|
|
{"title": "claim: stdout", "type": "object", "required": ["claimed"],
|
|
"properties": {"claimed": {"type": "boolean"}}},
|
|
{"title": "report/publish: stdin", "type": "object", "required": ["task", "run"],
|
|
"properties": {"task": {"$ref": "#/$defs/Task"}, "run": {"$ref": "#/$defs/Run"}}},
|
|
{"title": "publish: stdout", "type": "object", "properties": {"url": {"type": "string"}}}
|
|
]
|
|
}
|