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

@ -101,6 +101,17 @@ impl CommandBackgroundRunner {
u64::try_from(self.clock.now_millis().max(0)).unwrap_or(0)
}
/// Returns the live PTY handle for a running task, when this runner still
/// owns one.
#[must_use]
pub fn pty_handle_for(&self, task_id: TaskId) -> Option<PtyHandle> {
self.running
.lock()
.expect("runner registry poisoned")
.get(&task_id)
.map(|control| control.pty_handle.clone())
}
/// Detached worker driving one command to its single completion.
#[allow(clippy::too_many_arguments)]
async fn run_to_completion(

View File

@ -25,6 +25,7 @@ pub mod id;
pub mod input;
pub mod inspector;
pub mod issues;
pub mod lock;
pub mod mailbox;
pub mod model_catalogue;
pub mod model_server;
@ -68,6 +69,7 @@ pub use inspector::{
transcript_activity_token, ClaudeTranscriptInspector, ClaudeTranscriptTurnWatcher,
};
pub use issues::{FsIssueNumberAllocator, FsIssueStore};
pub use lock::{acquire_app_data_dir_lock, AppDataDirLock, AppDataDirLockError};
pub use mailbox::InMemoryMailbox;
pub use model_catalogue::{
EmbeddedCompatibilityMatrix, HttpProviderModelCatalogue, ProcessCliVersionReader,