// Pipeline Theater - live terminal + animated stage rail + token burn meter + file accumulator import { store } from "../core/state"; import { escapeHtml, formatDuration, fmtNum } from "../core/helpers"; import { icon } from "../design/icons"; import { colors, STAGES, STAGE_HEX, STAGE_SHORT } from "../design/tokens"; import { LiveTerminal } from "../components/terminal"; import { SSEClient } from "../core/sse"; import { renderPipelineSVG } from "../components/charts/pipeline-rail"; import * as api from "../core/api"; import type { FleetState, View, PipelineInfo } from "../types/api"; let terminal: LiveTerminal | null = null; let sseClient: SSEClient | null = null; let selectedIssue: number | null = null; function renderTheater(data: FleetState): void { const container = document.getElementById("panel-pipeline-theater"); if (!container) return; const pipelines = data.pipelines || []; if (pipelines.length === 0 && !selectedIssue) { container.innerHTML = `
No active pipelines to observe
Loading changes...
Pipeline #${selectedIssue} no longer active
Select a pipeline to observe
${escapeHtml(truncatedDiff)}No changes detected (worktree may not exist yet)