mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat: add app status tracking to the backend (#17163)
This does ~95% of the backend work required to integrate the AI work. Most left to integrate from the tasks branch is just frontend, which will be a lot smaller I believe. The real difference between this branch and that one is the abstraction -- this now attaches statuses to apps, and returns the latest status reported as part of a workspace. This change enables us to have a similar UX to in the tasks branch, but for agents other than Claude Code as well. Any app can report status now.
This commit is contained in:
Generated
+25
@@ -3060,6 +3060,7 @@ export interface Workspace {
|
||||
readonly template_active_version_id: string;
|
||||
readonly template_require_active_version: boolean;
|
||||
readonly latest_build: WorkspaceBuild;
|
||||
readonly latest_app_status: WorkspaceAppStatus | null;
|
||||
readonly outdated: boolean;
|
||||
readonly name: string;
|
||||
readonly autostart_schedule?: string;
|
||||
@@ -3307,6 +3308,7 @@ export interface WorkspaceApp {
|
||||
readonly health: WorkspaceAppHealth;
|
||||
readonly hidden: boolean;
|
||||
readonly open_in: WorkspaceAppOpenIn;
|
||||
readonly statuses: readonly WorkspaceAppStatus[];
|
||||
}
|
||||
|
||||
// From codersdk/workspaceapps.go
|
||||
@@ -3337,6 +3339,29 @@ export const WorkspaceAppSharingLevels: WorkspaceAppSharingLevel[] = [
|
||||
"public",
|
||||
];
|
||||
|
||||
// From codersdk/workspaceapps.go
|
||||
export interface WorkspaceAppStatus {
|
||||
readonly id: string;
|
||||
readonly created_at: string;
|
||||
readonly workspace_id: string;
|
||||
readonly agent_id: string;
|
||||
readonly app_id: string;
|
||||
readonly state: WorkspaceAppStatusState;
|
||||
readonly needs_user_attention: boolean;
|
||||
readonly message: string;
|
||||
readonly uri: string;
|
||||
readonly icon: string;
|
||||
}
|
||||
|
||||
// From codersdk/workspaceapps.go
|
||||
export type WorkspaceAppStatusState = "complete" | "failure" | "working";
|
||||
|
||||
export const WorkspaceAppStatusStates: WorkspaceAppStatusState[] = [
|
||||
"complete",
|
||||
"failure",
|
||||
"working",
|
||||
];
|
||||
|
||||
// From codersdk/workspacebuilds.go
|
||||
export interface WorkspaceBuild {
|
||||
readonly id: string;
|
||||
|
||||
@@ -913,6 +913,7 @@ export const MockWorkspaceApp: TypesGen.WorkspaceApp = {
|
||||
},
|
||||
hidden: false,
|
||||
open_in: "slim-window",
|
||||
statuses: [],
|
||||
};
|
||||
|
||||
export const MockWorkspaceAgentLogSource: TypesGen.WorkspaceAgentLogSource = {
|
||||
@@ -1371,6 +1372,7 @@ export const MockWorkspace: TypesGen.Workspace = {
|
||||
healthy: true,
|
||||
failing_agents: [],
|
||||
},
|
||||
latest_app_status: null,
|
||||
automatic_updates: "never",
|
||||
allow_renames: true,
|
||||
favorite: false,
|
||||
|
||||
Reference in New Issue
Block a user