Files
atc-agents/ui/src/types.ts
T

340 lines
6.2 KiB
TypeScript
Raw Normal View History

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<string, unknown> | null
after: Record<string, unknown> | null
}
export type CdcStats = {
ok: boolean
window_minutes: number
total: number
by_source: Record<string, number>
by_op: Record<string, number>
by_table: Record<string, number>
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[]
pii_summary: { datasets?: number; pii_columns?: number; masked_columns?: number; unmasked_columns?: number }
cdc: { connected?: boolean; consumed?: number; window_total?: number }
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<string, DomainStatus>
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<string, unknown>
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<string, TopologyViewData>
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
workload?: WorkloadData
topologies?: Record<string, TopologyViewData>
}