diff --git a/ui/src/api/openapi.json b/ui/src/api/openapi.json index 6cd08d82..422a2de5 100644 --- a/ui/src/api/openapi.json +++ b/ui/src/api/openapi.json @@ -91,6 +91,30 @@ "type": "string" } }, + { + "name": "routeId", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "agentId", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "processorType", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, { "name": "offset", "in": "query", @@ -633,6 +657,27 @@ } } }, + "/api/v1/search/stats": { + "get": { + "tags": [ + "Search" + ], + "summary": "Aggregate execution stats (P99 latency, active count)", + "operationId": "stats", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/ExecutionStats" + } + } + } + } + } + } + }, "/api/v1/executions/{executionId}": { "get": { "tags": [ @@ -882,6 +927,15 @@ "textInErrors": { "type": "string" }, + "routeId": { + "type": "string" + }, + "agentId": { + "type": "string" + }, + "processorType": { + "type": "string" + }, "offset": { "type": "integer", "format": "int32" @@ -972,6 +1026,19 @@ } } }, + "ExecutionStats": { + "type": "object", + "properties": { + "p99LatencyMs": { + "type": "integer", + "format": "int64" + }, + "activeCount": { + "type": "integer", + "format": "int64" + } + } + }, "ExecutionDetail": { "type": "object", "properties": { diff --git a/ui/src/api/schema.d.ts b/ui/src/api/schema.d.ts index 6397ef04..ceb406c9 100644 --- a/ui/src/api/schema.d.ts +++ b/ui/src/api/schema.d.ts @@ -198,9 +198,14 @@ export interface ExecutionStats { } export interface AgentInstance { - agentId: string; + id: string; + name: string; group: string; + version: string; + routeIds: string[]; + capabilities: Record; state: 'LIVE' | 'STALE' | 'DEAD'; - lastHeartbeat: string; registeredAt: string; + lastHeartbeat: string; + staleTransitionTime: string | null; } diff --git a/ui/src/components/command-palette/CommandPalette.tsx b/ui/src/components/command-palette/CommandPalette.tsx index 25f58588..5f4b6281 100644 --- a/ui/src/components/command-palette/CommandPalette.tsx +++ b/ui/src/components/command-palette/CommandPalette.tsx @@ -30,7 +30,7 @@ export function CommandPalette() { } else if (result.type === 'agent') { const agent = result.data as AgentInstance; execSearch.setStatus(['COMPLETED', 'FAILED', 'RUNNING']); - execSearch.setAgentId(agent.agentId); + execSearch.setAgentId(agent.id); execSearch.setText(''); execSearch.setRouteId(''); execSearch.setProcessorType(''); diff --git a/ui/src/components/command-palette/ResultItem.tsx b/ui/src/components/command-palette/ResultItem.tsx index f985ea07..94244321 100644 --- a/ui/src/components/command-palette/ResultItem.tsx +++ b/ui/src/components/command-palette/ResultItem.tsx @@ -91,7 +91,7 @@ function AgentResult({ data, query }: { data: AgentInstance; query: string }) {
- + {data.state}
diff --git a/ui/src/components/command-palette/use-palette-search.ts b/ui/src/components/command-palette/use-palette-search.ts index 286f228c..772c003b 100644 --- a/ui/src/components/command-palette/use-palette-search.ts +++ b/ui/src/components/command-palette/use-palette-search.ts @@ -70,12 +70,12 @@ export function usePaletteSearch() { const filteredAgents = (agentsQuery.data ?? []).filter((a) => { if (!debouncedQuery) return true; const q = debouncedQuery.toLowerCase(); - return a.agentId.toLowerCase().includes(q) || a.group.toLowerCase().includes(q); + return a.id.toLowerCase().includes(q) || a.group.toLowerCase().includes(q); }); const agentResults: PaletteResult[] = filteredAgents.slice(0, 10).map((a) => ({ type: 'agent' as const, - id: a.agentId, + id: a.id, data: a, }));