TABLES IT EXPECTS
agents(id, name, colour, job, endpoint, control, state)
tasks(id, agent_id, project, status, pct, title, summary, steps jsonb)
messages(id, agent_id, role, body, plan jsonb, created_at)
snapshots(id, agent_id, label, config jsonb, created_at)
usage(id, task_id, model, tokens_in, tokens_out, cost, day)