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:
@@ -3,7 +3,7 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from datetime import datetime
|
||||
from typing import Literal
|
||||
from typing import Any, Literal
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
@@ -35,6 +35,39 @@ class TaskStatusResponse(BaseModel):
|
||||
failure_reason: str | None = None
|
||||
|
||||
|
||||
class TaskListItem(BaseModel):
|
||||
id: str
|
||||
status: str
|
||||
goal: str | None = None
|
||||
workflow_definition_id: str | None = None
|
||||
assigned_device_id: str | None = None
|
||||
assigned_host_id: str | None = None
|
||||
attempt_count: int = 0
|
||||
failure_reason: str | None = None
|
||||
created_at: datetime
|
||||
|
||||
|
||||
class TaskListResponse(BaseModel):
|
||||
items: list[TaskListItem]
|
||||
total: int
|
||||
limit: int
|
||||
offset: int
|
||||
|
||||
|
||||
class TaskAttemptResponse(BaseModel):
|
||||
task_id: str
|
||||
attempt: int
|
||||
lease_id: str
|
||||
host_id: str
|
||||
device_id: str
|
||||
status: str
|
||||
lease_expires_at: datetime
|
||||
created_at: datetime
|
||||
completed_at: datetime | None = None
|
||||
failure_reason: str | None = None
|
||||
terminal_result: dict[str, Any] | None = None
|
||||
|
||||
|
||||
class DeviceResponse(BaseModel):
|
||||
device_id: str
|
||||
host_id: str
|
||||
|
||||
Reference in New Issue
Block a user