Add NewAgentDialog for creating agents with adapter config. Expand AgentDetail page with tabbed view (overview, runs, config, logs), run history timeline, and live status. Enhance Agents list page with richer cards and filtering. Update AgentProperties panel, API client, query keys, and utility helpers. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
19 lines
958 B
TypeScript
19 lines
958 B
TypeScript
import type { HeartbeatRun, HeartbeatRunEvent } from "@paperclip/shared";
|
|
import { api } from "./client";
|
|
|
|
export const heartbeatsApi = {
|
|
list: (companyId: string, agentId?: string) => {
|
|
const params = agentId ? `?agentId=${agentId}` : "";
|
|
return api.get<HeartbeatRun[]>(`/companies/${companyId}/heartbeat-runs${params}`);
|
|
},
|
|
events: (runId: string, afterSeq = 0, limit = 200) =>
|
|
api.get<HeartbeatRunEvent[]>(
|
|
`/heartbeat-runs/${runId}/events?afterSeq=${encodeURIComponent(String(afterSeq))}&limit=${encodeURIComponent(String(limit))}`,
|
|
),
|
|
log: (runId: string, offset = 0, limitBytes = 256000) =>
|
|
api.get<{ runId: string; store: string; logRef: string; content: string; nextOffset?: number }>(
|
|
`/heartbeat-runs/${runId}/log?offset=${encodeURIComponent(String(offset))}&limitBytes=${encodeURIComponent(String(limitBytes))}`,
|
|
),
|
|
cancel: (runId: string) => api.post<void>(`/heartbeat-runs/${runId}/cancel`, {}),
|
|
};
|