feat(agent): reprise des sessions au redémarrage (B2) — commande + ResumeProjectPanel

- Tauri : commande list_resumable_agents (projectId) + ResumableAgentListDto
  { resumable } / ResumableAgentDto (camelCase, conversationId omis si None),
  câblage state.rs (réutilise stores + ProfileStore, aucun nouveau port).
- Front : gateway listResumableAgents, ResumeProjectPanel monté à l'ouverture
  de projet (opt-in, FR) : Reprendre (launch_agent nodeId+conversationId),
  Nouvelle conversation (setCellConversation(null) puis launch), Ignorer,
  Tout reprendre/ignorer. resumeSupported=false ⇒ « relance à neuf ».
- doc : §15.2 coquille agents→resumable (alignée use case/back/front).

Tests : app-tauri dto 9/9 ; vitest 324 (+10) ; workspace Rust 0 échec. 0 régression.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-09 13:04:41 +02:00
parent b82e3e1a40
commit 7375f706da
15 changed files with 992 additions and 6 deletions

View File

@ -273,6 +273,25 @@ export interface TerminalSession {
assignedConversationId?: string;
}
/**
* An agent that can be resumed when its project is (re)opened (mirror of the
* backend `ResumableAgentDto`, camelCase wire format; ARCHITECTURE §15.2). It is
* a read-only inventory entry computed at open time — never a spawn:
* - `nodeId` is the layout leaf hosting the agent (where to relaunch),
* - `conversationId` is the persisted CLI conversation id; absent ⇒ relaunch fresh,
* - `wasRunning` is `agentWasRunning` frozen at close time (drives the status label),
* - `resumeSupported` reflects whether the agent's profile exposes a usable
* session strategy; when `false`, "Reprendre" relaunches fresh ("relance à neuf").
*/
export interface ResumableAgent {
agentId: string;
name: string;
nodeId: string;
conversationId?: string;
wasRunning: boolean;
resumeSupported: boolean;
}
// ---------------------------------------------------------------------------
// Skills (L12) — mirror of the domain `Skill` / `SkillRef`.
// ---------------------------------------------------------------------------