export type AgentStats = { tasks: number last_active: string | null alerts: number } export type Agent = { id: string name: string color: string zone: string role: string icon?: string motto?: string capabilities?: string[] suggested_prompts?: string[] stats?: AgentStats supervisor?: boolean person?: string } export type TopologyLayer = { id: string label: string y: number color: string x?: number } export type TopologyViewData = { id: string label: string subtitle: string layers?: TopologyLayer[] nodes: TopologyNode[] edges: TopologyEdge[] } export type Zone = { id: string; label: string; x: number; color: string } export type FeedEntry = { id: string ts: string agent_id: string message: string level: string } export type CdcChange = { id: string ts: string source: string table: string topic: string op: string summary: string before: Record | null after: Record | null } export type CdcStats = { ok: boolean window_minutes: number total: number by_source: Record by_op: Record by_table: Record buckets: { t: string; n: number }[] connected: boolean consumed: number } export type PiiColumn = { name: string; category: string; masked: boolean; policy_locked?: boolean } export type DataflowNode = { id: string label: string sub: string kind: string x: number y: number level: string metric: string | null url?: string pii?: { key: string has_pii: boolean pii_count: number all_masked: boolean masked_layer: boolean categories: string[] columns: PiiColumn[] } } export type DataflowEdge = { from: string to: string kind: string movement_id?: string state?: string last_rows?: number | null last_duration_s?: number | null active?: boolean } export type DataflowGraph = { ok: boolean nodes: DataflowNode[] edges: DataflowEdge[] flow?: string pii_summary: { datasets?: number; pii_columns?: number; masked_columns?: number; unmasked_columns?: number } cdc: { connected?: boolean; consumed?: number; window_total?: number } streaming?: StreamingStatus | null ts: number } export type StreamingSparkWorker = { id?: string host?: string cores?: number cores_used?: number memory_mb?: number state?: string webui?: string } export type StreamingSparkApp = { id?: string name?: string cores?: number memory_mb?: number submitdate?: string duration_ms?: number user?: string } export type StreamingStatus = { ok?: boolean spark?: { ui_url?: string ui_ok?: boolean status?: string workers?: StreamingSparkWorker[] alive_workers?: number cores?: number cores_used?: number memory_mb?: number memory_used_mb?: number active_apps?: StreamingSparkApp[] completed_apps?: StreamingSparkApp[] } kafka?: { ui_url?: string ui_ok?: boolean connect_ok?: boolean cluster?: { name?: string; status?: string; broker_count?: number; topic_count?: number } topics?: { name?: string; partitions?: number; replicas?: number; messages?: number }[] connectors?: { name: string; state?: string; worker?: string; tasks?: { id?: number; state?: string }[]; type?: string }[] } edges?: Record jobs?: { id: string; label: string; dag_id: string; description?: string; default_conf?: Record }[] ts?: number } export type Movement = { id: string label: string kind: string dag_id: string agent: string from: string to: string last_run?: { state?: string rows?: number | null duration_s?: number | null ended_at?: string started_at?: string } | null } export type PiiDataset = { key: string node_id: string label: string table: string exists: boolean masked_layer: boolean pii_columns: PiiColumn[] pii_count: number has_pii: boolean all_masked: boolean } export type DomainStatus = { level: 'ok' | 'warn' | 'down' | 'unknown' label: string } export type StatusData = { ts: string domains: Record gpu?: GpuStatus } export type GpuDevice = { index: number name: string util_gpu: number memory_used_mib: number memory_total_mib: number temperature_c: number power_w: number } export type GpuStatus = { ok: boolean host: string ui_url: string inference_active?: boolean active_model?: string | null vllm_url?: string | null gpu_count?: number gpus?: GpuDevice[] error?: string } export type AgentState = 'idle' | 'walk' | 'fetch' | 'return' export type AgentAnim = { agentId: string state: AgentState zone?: string } export type Approval = { id: string ts: string agent_id: string action: string reason: string status: string action_type: string target: string payload?: Record decided_by?: string | null decide_note?: string | null decided_at?: string | null priority?: string } export type TerminalLine = { id: string ts: string agent_id: string level: 'info' | 'ok' | 'warn' | 'err' | 'cmd' | 'llm' phase: string text: string prompt_id?: string } export type WorkloadApp = { name: string state: string image: string ports: string[] host?: string } export type WorkloadZone = { id: string label: string x: number color: string level: 'ok' | 'warn' | 'down' | 'unknown' running: number total: number apps: WorkloadApp[] trino_ok?: boolean hdfs_used_gb?: number hdfs_total_gb?: number vm?: string ip?: string bucket?: string } export type NodeLink = { label: string; url: string } export type NodeEndpoint = { name: string; host: string; port: string; proto: string } export type TopologyNode = { id: string label: string vm: string ip: string x: number y: number color: string level: string role: string apps: WorkloadApp[] running: number total: number description?: string agent_id?: string links?: NodeLink[] endpoints?: NodeEndpoint[] commands?: string[] vmid?: number pve?: string bucket?: string port?: string connectors?: string[] trino_ok?: boolean model?: string util?: number hdfs_used_gb?: number hdfs_total_gb?: number consumer_ok?: boolean subtitle?: string metrics?: string[] icon?: string layer?: string } export type NodeDetail = TopologyNode export type TopologyEdge = { id: string from: string to: string label: string kind: 'pipeline' | 'query' | 'parallel' | 'infra' active: boolean } export type WorkloadData = { ts: string zones: WorkloadZone[] topology?: TopologyViewData topologies?: Record gpu: { level: string model?: string | null inference_active?: boolean gpu_count?: number avg_util?: number gpus?: GpuDevice[] } totals: { apps_running: number apps_total: number connectors: number vms?: number pipeline_active?: boolean } } export type ChatMessage = { role: 'user' | 'agent' text: string agent?: string ts?: string } export type PresentationSlide = { id: string title: string subtitle?: string bullets: string[] kind?: string image?: string animation?: string topology?: TopologyViewData zone?: WorkloadZone } export type PresentationData = { ts: string title: string subtitle: string totals: WorkloadData['totals'] pipeline_active?: boolean slides: PresentationSlide[] slide_count: number edited?: boolean override_ts?: string id?: string source?: string workload?: WorkloadData topologies?: Record } export type SparkRunStats = { state?: string nodes?: number total_splits?: number queued_splits?: number running_splits?: number completed_splits?: number processed_rows?: number processed_bytes?: number physical_input_bytes?: number peak_memory_bytes?: number cpu_time_ms?: number wall_time_ms?: number elapsed_ms?: number progress_pct?: number } export type SparkRun = { id: string operation: string label: string sql: string target?: string | null state: string engine_state?: string stats?: SparkRunStats columns?: string[] rows?: unknown[][] row_count?: number | null error?: string | null started_at?: number ended_at?: number | null update_type?: string } export type SparkLive = { ok?: boolean spark?: StreamingStatus['spark'] active_runs?: SparkRun[] recent_runs?: SparkRun[] ts?: number }