feat(FN-984): add agent hierarchy tree view with parent-child relationships
- Add GET /agents/:id/children API endpoint to fetch child agents of a parent - Create fetchAgentChildren API function with tests in dashboard client - Implement useAgentHierarchy hook with recursive tree loading and expand/collapse - Add tree view mode to AgentsView with hierarchical agent display - Enhance AgentDetailView with parent info and expandable children section - Add tree view CSS styles for connection lines and expand/collapse indicators
This commit is contained in:
@@ -1834,6 +1834,15 @@ export function fetchAgentStats(projectId?: string): Promise<AgentStats> {
|
||||
return api<AgentStats>(withProjectId("/agents/stats", projectId));
|
||||
}
|
||||
|
||||
/** Fetch child agents that report to a given parent agent */
|
||||
export function fetchAgentChildren(agentId: string, projectId?: string): Promise<Agent[]> {
|
||||
return api<Agent[]>(withProjectId(`/agents/${encodeURIComponent(agentId)}/children`, projectId)).catch((err: Error) => {
|
||||
// Return empty array for 404 (agent may have been deleted)
|
||||
if (err.message.includes("not found")) return [];
|
||||
throw err;
|
||||
});
|
||||
}
|
||||
|
||||
// ── Agent Generation API ────────────────────────────────────────────────────
|
||||
|
||||
/** Generated agent specification returned by the AI */
|
||||
|
||||
Reference in New Issue
Block a user