import { ArrowClockwise, FolderOpen, Lightning, ListChecks, WarningCircle, } from "@phosphor-icons/react"; import type { AgentRecord, RunRecord, TaskRecord, WorkspaceRecord } from "@shared/types"; import { formatMoney, formatTime } from "../../lib/formatters"; import { ActionButton, Panel, StatusPill } from "../ui"; import type { TranslationFn } from "../../i18n"; import { isActiveStatus } from "./run-helpers"; import type { RunLogState } from "./run-helpers"; interface RunDetailProps { selectedRun: RunRecord; taskMap: Map; agentMap: Map; workspaceMap: Map; logState: RunLogState; onOpenConsole: (runId: string) => void; onCancelRun: (runId: string) => Promise | void; onOpenLogPath: (path: string) => Promise | void; onReloadLog: () => void; onLoadOlderLogs: () => void; t: TranslationFn; } function DetailRow({ label, children }: { label: string; children: React.ReactNode }) { return (
{label} {children}
); } export function RunDetail({ selectedRun, taskMap, agentMap, logState, onOpenConsole, onCancelRun, onOpenLogPath, onReloadLog, onLoadOlderLogs, t, }: RunDetailProps) { const task = taskMap.get(selectedRun.taskId); const agent = agentMap.get(selectedRun.agentId); return (
onOpenConsole(selectedRun.id)} /> {isActiveStatus(selectedRun.status) ? ( void onCancelRun(selectedRun.id)} /> ) : null}
)} >
{agent?.name ?? selectedRun.agentId} {selectedRun.connectorId} {selectedRun.model ? {selectedRun.model} : null} {formatTime(selectedRun.startedAt)} {selectedRun.finishedAt ? {formatTime(selectedRun.finishedAt)} : null} {formatMoney(selectedRun.costUsd)}
{selectedRun.errorMessage ? (
{selectedRun.errorMessage}
) : null} {selectedRun.logPath ? (
void onOpenLogPath(selectedRun.logPath!)} />
) : null} {logState.offset > 0 ? ( ) : null} )} > {logState.error ? (
{logState.error}
) : null}
{logState.loading ? "Refreshing\u2026" : logState.eof ? "At latest tail" : "Tail window loaded"}
            {logState.content || "No log output captured yet."}
          
); }