feat(workstate): UI des actions contrôlées (Lot D frontend)

Câble les actions contrôlées dans ProjectWorkStatePanel : port et adaptateur
agent étendus aux nouvelles commandes, adaptateur mock aligné.

Tests verts : workstate + projects (25), agent (8), singletonAgent +
agentAlreadyRunning (9), tsc --noEmit OK.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-20 19:51:52 +02:00
parent 3408c96974
commit 1c6441bb35
8 changed files with 611 additions and 33 deletions

View File

@ -26,6 +26,7 @@ import type {
LiveAgent,
OpenTerminalOptions,
ReattachResult,
StoppedLiveAgent,
TerminalHandle,
} from "@/ports";
import { makeTerminalHandle } from "./terminal";
@ -63,14 +64,14 @@ export class TauriAgentGateway implements AgentGateway {
agentId: string,
nodeId: string,
): Promise<LiveAgent> {
return invoke<LiveAgent[]>("attach_live_agent", {
return invoke<LiveAgent>("attach_live_agent", {
request: { projectId, agentId, nodeId },
}).then((list) => {
const attached = list[0];
if (!attached) {
throw new Error(`running session for agent ${agentId} was not returned`);
}
return attached;
});
}
stopLiveAgent(projectId: string, agentId: string): Promise<StoppedLiveAgent> {
return invoke<StoppedLiveAgent>("stop_live_agent", {
request: { projectId, agentId },
});
}