Add Workflow tab and run-progress API for workflow runs

This commit is contained in:
Ian Gulliver
2026-10-16 11:01:53 -07:00
parent eb0c80a645
commit ec169583ff
19 changed files with 1285 additions and 209 deletions
+93 -1
View File
@@ -268,6 +268,25 @@ export interface paths {
patch?: never;
trace?: never;
};
"/api/tasks/{taskId}/workflow/run": {
parameters: {
query?: never;
header?: never;
path: {
taskId: string;
};
cookie?: never;
};
/** @description The progress of the workflow run the task belongs to: the definition the task froze, and for each stage its state and every task that attempted it, with the attempts whose outputs each one started from. */
get: operations["getWorkflowRun"];
put?: never;
post?: never;
delete?: never;
options?: never;
head?: never;
patch?: never;
trace?: never;
};
"/api/tasks/{taskId}/unmerged": {
parameters: {
query?: never;
@@ -1011,6 +1030,56 @@ export interface components {
/** @description The WorkflowDefinition as YAML. */
definition: string;
};
WorkflowRun: {
name: string;
run: string;
title: string;
brief: string;
definition: components["schemas"]["WorkflowDefinition"];
/** @description Whether the final stage finished, which ends the run. */
finished: boolean;
/** @description In the definition's order. */
stages: components["schemas"]["WorkflowRunStage"][];
};
WorkflowRunStage: {
name: string;
/** @description The stages it comes after, with the definition's defaults applied. */
after: string[];
/**
* @description waiting: no task yet. Otherwise the state of its latest finished attempt, or of its latest attempt when none has finished.
* @enum {string}
*/
state: "waiting" | "running" | "idle" | "finished" | "merged" | "discarded" | "cleaned_up";
/** @description The after stages with no finished attempt yet. */
waiting_on: string[];
/** @description The tasks that ran the stage (the first, and forks of it), oldest first. */
attempts: components["schemas"]["StageAttempt"][];
};
StageAttempt: {
task_id: string;
title: string;
/**
* @description running: its agent is mid-turn. idle: active, and finish_stage hasn't taken. finished: active, its output recorded. merged. discarded: discarded before finishing. cleaned_up: discarded after finishing, as byre does to the run's other tasks when the final stage finishes.
* @enum {string}
*/
state: "running" | "idle" | "finished" | "merged" | "discarded" | "cleaned_up";
/** @description Whether a Discard was started and the task isn't closed yet. */
discarding: boolean;
/** @description The task this attempt was forked from; absent for the stage's first attempt. */
forked_from?: string;
/** @description The finish_stage output the stages after it get; absent until it finishes. */
output?: string;
/** @description With output: the commit the stage finished at. */
commit?: string;
/** @description discarded and cleaned_up: who discarded it; byre for the cleanup. */
discarded_by?: string;
/** @description The attempts whose outputs it started from, one per after stage; a fork has its source's. */
inputs: components["schemas"]["StageInput"][];
};
StageInput: {
stage: string;
task_id: string;
};
TaskChanges: {
/** @description The commit or tree compared with: the merge-base of the task branch and the default branch, since, or the previous snapshot's tree. */
base: string;
@@ -1288,7 +1357,7 @@ export interface components {
drafting: boolean;
};
/** @enum {string} */
TaskTab: "transcript" | "changes" | "files" | "terminal" | "inbox" | "reviews" | "project";
TaskTab: "transcript" | "changes" | "files" | "terminal" | "inbox" | "reviews" | "workflow" | "project";
TerminalSize: {
cols: number;
rows: number;
@@ -1830,6 +1899,29 @@ export interface operations {
404: components["responses"]["Error"];
};
};
getWorkflowRun: {
parameters: {
query?: never;
header?: never;
path: {
taskId: string;
};
cookie?: never;
};
requestBody?: never;
responses: {
/** @description The run's progress. */
200: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["WorkflowRun"];
};
};
404: components["responses"]["Error"];
};
};
getUnmerged: {
parameters: {
query?: never;