feat(frontend): surface UI des tâches de fond (F1-F4)

Expose les tâches de fond côté front : modèle domaine et
normalisation du work state, panneau ProjectWorkStatePanel,
intégration dans LayoutGrid et ProjectsView, et abonnement aux
événements backgroundTaskChanged / agentInboxChanged /
agentWakeChanged pour rafraîchir l'état. npm run build + npm test
(449) verts.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-02 21:33:51 +02:00
parent e05edc6863
commit 5d88c952ec
6 changed files with 450 additions and 9 deletions

View File

@ -20,6 +20,26 @@ export type DomainEvent =
| { type: "agentExited"; agentId: string; code: number }
| { type: "agentProfileChanged"; agentId: string; profileId: string }
| { type: "agentBusyChanged"; agentId: string; busy: boolean }
| {
type: "backgroundTaskChanged";
projectId: string;
taskId: string;
agentId: string;
state: string;
}
| {
type: "agentInboxChanged";
agentId: string;
depth: number;
action: string;
}
| {
type: "agentWakeChanged";
projectId: string;
agentId: string;
action: string;
reason?: string;
}
| {
/**
* A delegation is ready to be injected into the agent's native terminal
@ -170,6 +190,31 @@ export interface AgentTicketState {
taskLen: number;
}
/** One first-class background task visible in the work-state read-model. */
export interface BackgroundCompletion {
taskId: string;
ownerAgentId: string;
projectId: string;
kind: string;
status: "running" | "completed" | "failed" | "cancelled" | "pending" | "delivered";
exitCode: number | null;
stdoutTail: string | null;
stderrTail: string | null;
finishedAtMs: number | null;
}
/** One item currently pending in an agent's inbox. */
export interface InboxItem {
id: string;
agentId: string;
source: string;
kind: string;
body: string;
createdAtMs: number;
correlationId?: string;
priority: number;
}
/** Availability of a compact conversation summary in the work-state read-model. */
export type ConversationPreviewStatus =
| "ready"
@ -205,6 +250,9 @@ export interface AgentWorkState {
live?: LiveWorkSession;
busy: WorkBusyState;
tickets: AgentTicketState[];
inboxDepth?: number;
inbox?: InboxItem[];
backgroundTasks?: BackgroundCompletion[];
}
/** Minimal read-only live-state surface for a project. */