Project>project overview from the dashboard endpoint; tools chooser drawn in Board>board; docs for Shell and t

This commit is contained in:
Sam
2026-11-10 21:48:03 +11:00
parent 3d31243317
commit 3e90ca82ab
14 changed files with 1225 additions and 9 deletions

View File

@@ -458,3 +458,44 @@ func (c *Client) AgentRaw(agentID string) (map[string]any, error) {
err := c.do("GET", "/api/agents/"+agentID, nil, &out)
return out, err
}
// Dashboard is the company's own summary: counts, spend and recent run activity.
// One call, 1.8 KB, cheap enough to poll.
type Dashboard struct {
Agents struct {
Active int `json:"active"`
Running int `json:"running"`
Paused int `json:"paused"`
Error int `json:"error"`
} `json:"agents"`
Tasks struct {
Open int `json:"open"`
InProgress int `json:"inProgress"`
Blocked int `json:"blocked"`
Done int `json:"done"`
} `json:"tasks"`
Costs struct {
MonthSpendCents int `json:"monthSpendCents"`
MonthBudgetCents int `json:"monthBudgetCents"`
MonthUtilizationPercent float64 `json:"monthUtilizationPercent"`
} `json:"costs"`
PendingApprovals int `json:"pendingApprovals"`
Budgets struct {
ActiveIncidents int `json:"activeIncidents"`
PausedAgents int `json:"pausedAgents"`
PausedProjects int `json:"pausedProjects"`
} `json:"budgets"`
RunActivity []struct {
Date string `json:"date"`
Total int `json:"total"`
Succeeded int `json:"succeeded"`
Failed int `json:"failed"`
} `json:"runActivity"`
}
// DashboardSummary reads the company's dashboard.
func (c *Client) DashboardSummary() (Dashboard, error) {
var out Dashboard
err := c.do("GET", "/api/companies/"+c.Company+"/dashboard", nil, &out)
return out, err
}