Overhaul UI with shadcn components and new pages
Add shadcn/ui components (badge, button, card, input, select,
separator). Add company context provider. New pages: Activity,
Approvals, Companies, Costs, Org chart. Restyle existing pages
(Dashboard, Agents, Issues, Goals, Projects) with shadcn components
and dark theme. Update layout, sidebar navigation, and routing.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 09:07:32 -06:00
|
|
|
import type { Agent, AgentKeyCreated, HeartbeatRun } from "@paperclip/shared";
|
2026-02-16 13:32:04 -06:00
|
|
|
import { api } from "./client";
|
|
|
|
|
|
Overhaul UI with shadcn components and new pages
Add shadcn/ui components (badge, button, card, input, select,
separator). Add company context provider. New pages: Activity,
Approvals, Companies, Costs, Org chart. Restyle existing pages
(Dashboard, Agents, Issues, Goals, Projects) with shadcn components
and dark theme. Update layout, sidebar navigation, and routing.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 09:07:32 -06:00
|
|
|
export interface OrgNode {
|
|
|
|
|
id: string;
|
|
|
|
|
name: string;
|
|
|
|
|
role: string;
|
|
|
|
|
status: string;
|
|
|
|
|
reports: OrgNode[];
|
|
|
|
|
}
|
|
|
|
|
|
2026-02-16 13:32:04 -06:00
|
|
|
export const agentsApi = {
|
Overhaul UI with shadcn components and new pages
Add shadcn/ui components (badge, button, card, input, select,
separator). Add company context provider. New pages: Activity,
Approvals, Companies, Costs, Org chart. Restyle existing pages
(Dashboard, Agents, Issues, Goals, Projects) with shadcn components
and dark theme. Update layout, sidebar navigation, and routing.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 09:07:32 -06:00
|
|
|
list: (companyId: string) => api.get<Agent[]>(`/companies/${companyId}/agents`),
|
|
|
|
|
org: (companyId: string) => api.get<OrgNode[]>(`/companies/${companyId}/org`),
|
2026-02-16 13:32:04 -06:00
|
|
|
get: (id: string) => api.get<Agent>(`/agents/${id}`),
|
Overhaul UI with shadcn components and new pages
Add shadcn/ui components (badge, button, card, input, select,
separator). Add company context provider. New pages: Activity,
Approvals, Companies, Costs, Org chart. Restyle existing pages
(Dashboard, Agents, Issues, Goals, Projects) with shadcn components
and dark theme. Update layout, sidebar navigation, and routing.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 09:07:32 -06:00
|
|
|
create: (companyId: string, data: Record<string, unknown>) =>
|
|
|
|
|
api.post<Agent>(`/companies/${companyId}/agents`, data),
|
|
|
|
|
update: (id: string, data: Record<string, unknown>) => api.patch<Agent>(`/agents/${id}`, data),
|
|
|
|
|
pause: (id: string) => api.post<Agent>(`/agents/${id}/pause`, {}),
|
|
|
|
|
resume: (id: string) => api.post<Agent>(`/agents/${id}/resume`, {}),
|
|
|
|
|
terminate: (id: string) => api.post<Agent>(`/agents/${id}/terminate`, {}),
|
|
|
|
|
createKey: (id: string, name: string) => api.post<AgentKeyCreated>(`/agents/${id}/keys`, { name }),
|
|
|
|
|
invoke: (id: string) => api.post<HeartbeatRun>(`/agents/${id}/heartbeat/invoke`, {}),
|
2026-02-16 13:32:04 -06:00
|
|
|
};
|