feat(cloud-console): task listing, attempt history, CORS, and console SPA
Implements the cloud-console OpenSpec change: adds GET /v1/tasks (filterable,
bounded pagination, tasks:read) and GET /v1/tasks/{id}/attempts (404 on unknown
task) to the platform SDK, with matching CloudClient methods and a closed-by-
default CLOUD_CONSOLE_CORS_ORIGINS allow-list wired through CloudControlConfig.
Ships an independent Vue 3 + Vite SPA at cloud-console/ that authenticates with
an operator-supplied bearer token held in sessionStorage, renders tasks with
attempt history, device pool, host registry, and the plugin registry with a
registration form.
Backend test suite: 438 passed (-m "not integration"); cloud-console typecheck
and production build both succeed. PostgreSQL-backed repository tests and
manual end-to-end verification remain pending external infrastructure.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,70 @@
|
||||
export type TaskStatus =
|
||||
| "queued"
|
||||
| "assigned"
|
||||
| "dispatched"
|
||||
| "done"
|
||||
| "failed";
|
||||
|
||||
export interface TaskListItem {
|
||||
id: string;
|
||||
status: TaskStatus;
|
||||
goal: string | null;
|
||||
workflow_definition_id: string | null;
|
||||
assigned_device_id: string | null;
|
||||
assigned_host_id: string | null;
|
||||
attempt_count: number;
|
||||
failure_reason: string | null;
|
||||
created_at: string;
|
||||
}
|
||||
|
||||
export interface TaskListResponse {
|
||||
items: TaskListItem[];
|
||||
total: number;
|
||||
limit: number;
|
||||
offset: number;
|
||||
}
|
||||
|
||||
export interface TaskAttempt {
|
||||
task_id: string;
|
||||
attempt: number;
|
||||
lease_id: string;
|
||||
host_id: string;
|
||||
device_id: string;
|
||||
status: string;
|
||||
lease_expires_at: string;
|
||||
created_at: string;
|
||||
completed_at: string | null;
|
||||
failure_reason: string | null;
|
||||
terminal_result: Record<string, unknown> | null;
|
||||
}
|
||||
|
||||
export interface DeviceRecord {
|
||||
device_id: string;
|
||||
host_id: string;
|
||||
driver_type: string;
|
||||
status: string;
|
||||
capability_tags: string[];
|
||||
}
|
||||
|
||||
export interface HostRecord {
|
||||
host_id: string;
|
||||
address: string | null;
|
||||
last_seen_at: string;
|
||||
}
|
||||
|
||||
export type PluginEntryPointKind = "driver" | "tool" | "skill";
|
||||
|
||||
export interface PluginRecord {
|
||||
name: string;
|
||||
version: string;
|
||||
entry_point_kind: string;
|
||||
target: string;
|
||||
wired: boolean;
|
||||
}
|
||||
|
||||
export interface PluginRegistrationPayload {
|
||||
name: string;
|
||||
version: string;
|
||||
entry_point_kind: PluginEntryPointKind;
|
||||
target: string;
|
||||
}
|
||||
Reference in New Issue
Block a user