/** * Resume-conversation popup (T7). Shown for an agent cell whose PTY session is * dead but which carries a persisted `conversationId`, **before** the automatic * Resume launch fires. It lets the user choose between resuming the previous CLI * conversation or starting a fresh one. * * Pure presentation: it receives the status + best-effort details + the two * action callbacks. It never calls a gateway / `invoke()` itself — the parent * (`LayoutGrid`'s `LeafView`) wires it to the {@link AgentGateway} ports. The * status ("en cours" / "clot") is derived **only** from `agentWasRunning` (the * universal close-time flag), never from the inspector — a missing inspector * just hides the enriched topic/token lines (degraded mode). */ import type { ConversationDetails } from "@/ports"; interface ResumeConversationPopupProps { /** * Whether the agent process was running when the cell was last closed * (`agentWasRunning`). `true` ⇒ "en cours"; `false`/absent ⇒ "clot". This is * the universal status; it is NOT derived from the inspector. */ agentWasRunning: boolean; /** * Best-effort enriched details (last topic + token indicator). `null` while * loading; an empty object once loaded with no details available (degraded * mode: only the status + the resume affordance are shown). */ details: ConversationDetails | null; /** Resume the previous conversation (keeps the conversation id ⇒ Resume). */ onResume: () => void; /** Start a fresh conversation (clears the conversation id ⇒ Assign). */ onNewConversation: () => void; } export function ResumeConversationPopup({ agentWasRunning, details, onResume, onNewConversation, }: ResumeConversationPopupProps) { const statusLabel = agentWasRunning ? "en cours" : "clot"; return (

Reprise de conversation

Statut :{" "} {statusLabel}

{details?.lastTopic && (

Dernier sujet : {details.lastTopic}

)} {details?.tokenCount !== undefined && (

Tokens : {details.tokenCount}

)}
); }