feat(background-task): rendu live des tâches de fond — subscriber UI + canal IPC (#58)

Câble un canal attachable au flux de sortie d'une tâche de fond (runner
infrastructure + commande app-tauri + port/adaptateurs frontend) et le
panneau ProjectWorkStatePanel s'y abonne pour un rendu live au lieu d'un
état figé au dernier snapshot.

Validations obtenues avant commit :
- cargo test -p infrastructure --test background_task_runner : vert
- cargo check -p backend -p app-tauri : vert
- npx vitest run src/features/workstate/workstate.test.tsx : vert
- npm run typecheck : vert
- verdict QA #58 : vert

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-27 16:48:29 +02:00
parent 6f532d7434
commit b734c237d3
17 changed files with 528 additions and 23 deletions

View File

@ -562,6 +562,20 @@ pub struct ReattachResultDto {
pub scrollback: Vec<u8>,
}
/// Response DTO for `attach_background_task`: the retained bytes to repaint for
/// a background command task before optional live bytes arrive on the channel.
#[derive(Debug, Clone, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct AttachBackgroundTaskResultDto {
/// The task that was attached (echoed back for the frontend).
pub task_id: String,
/// Recent output bytes: PTY scrollback for a live task, persisted tail for a
/// terminal task.
pub scrollback: Vec<u8>,
/// Whether a live PTY subscription was installed for subsequent output.
pub live: bool,
}
/// Request DTO for `write_terminal`.
#[derive(Debug, Clone, Deserialize)]
#[serde(rename_all = "camelCase")]