From 9857b027c10e3816ca21cf634f3802ca7a10460f Mon Sep 17 00:00:00 2001 From: admin-valentin Date: Sun, 2 Aug 2026 12:58:12 +0000 Subject: [PATCH] feat(CC-079): add Agent Center page (8 agent templates with tool mapping + Hermes architecture) --- src/app/dashboard/agents/page.tsx | 178 ++++++++++++++++++++++++++++++ 1 file changed, 178 insertions(+) create mode 100644 src/app/dashboard/agents/page.tsx diff --git a/src/app/dashboard/agents/page.tsx b/src/app/dashboard/agents/page.tsx new file mode 100644 index 0000000..6d61e20 --- /dev/null +++ b/src/app/dashboard/agents/page.tsx @@ -0,0 +1,178 @@ +'use client'; + +import { useState } from 'react'; +import { useQuery } from '@tanstack/react-query'; +import Link from 'next/link'; +import { apiFetch } from '../../../lib/api'; +import { useSession } from '../../../components/session-provider'; + +interface DataSource { id: string; name: string; type: string; status: string; } + +interface AgentTemplate { + id: string; name: string; description: string; icon: string; + tools: string[]; category: string; endpoint: string | null; status: 'active' | 'planned'; +} + +const AGENTS: AgentTemplate[] = [ + { + id: 'research', name: 'Research Agent', description: 'Caută și sintetizează informații despre companii, persoane sau subiecte.', + icon: '🔍', tools: ['AnythingLLM', 'ClickHouse', 'OpenRouter'], category: 'Intelligence', + endpoint: '/v1/intelligence/companies/search', status: 'active', + }, + { + id: 'document', name: 'Document Analyst', description: 'Analizează documente, extrage entități, clasifică și rezumă.', + icon: '📄', tools: ['Hermes', 'AnythingLLM'], category: 'Documents', + endpoint: null, status: 'planned', + }, + { + id: 'financial', name: 'Financial Advisor', description: 'Analizează tranzacții, detectează anomalii, proiectează cashflow.', + icon: '💰', tools: ['ClickHouse', 'Hermes', 'OpenRouter'], category: 'Finance', + endpoint: null, status: 'planned', + }, + { + id: 'crm', name: 'CRM Intelligence', description: 'Sugerează urmăriri, detectează relații reci, prioritizează contacte.', + icon: '🤝', tools: ['Hermes', 'ClickHouse'], category: 'CRM', + endpoint: null, status: 'planned', + }, + { + id: 'compliance', name: 'Compliance Monitor', description: 'Verifică GDPR, detectează inconsistențe în clasificarea datelor, alertează.', + icon: '🛡️', tools: ['ClickHouse', 'Hermes'], category: 'Privacy', + endpoint: null, status: 'planned', + }, + { + id: 'scheduler', name: 'Action Scheduler', description: 'Propune, programează și monitorizează acțiuni AI cu aprobare umană.', + icon: '🤖', tools: ['Hermes', 'n8n', 'CEO OS API'], category: 'Automation', + endpoint: '/v1/approvals', status: 'active', + }, + { + id: 'email', name: 'Email Drafter', description: 'Redactează emailuri pe baza contextului din CRM, documente și conversații.', + icon: '✉️', tools: ['Hermes', 'OpenRouter'], category: 'Communication', + endpoint: null, status: 'planned', + }, + { + id: 'opportunity', name: 'Opportunity Scout', description: 'Scanează surse externe, identifică oportunități relevante pentru profilul utilizatorului.', + icon: '🎯', tools: ['Hermes', 'AnythingLLM', 'ClickHouse'], category: 'Growth', + endpoint: null, status: 'planned', + }, +]; + +const CATEGORIES = ['all', 'Intelligence', 'Documents', 'Finance', 'CRM', 'Privacy', 'Automation', 'Communication', 'Growth']; + +export default function AgentCenterPage() { + const { activeTenant } = useSession(); + const tenantId = activeTenant?.tenantId ?? ''; + const [category, setCategory] = useState('all'); + const [selected, setSelected] = useState(null); + + const { data: dataSources = [] } = useQuery({ + queryKey: ['agent-sources', tenantId], + queryFn: () => apiFetch('/v1/data-sources', { tenantId }), + enabled: Boolean(tenantId), staleTime: 120_000, + }); + + const filtered = AGENTS.filter((a) => category === 'all' || a.category === category); + const active = AGENTS.filter((a) => a.status === 'active').length; + + return ( +
+
+

Agent Center

+

+ {active} agenți activi · {AGENTS.length - active} planificați · Rutați prin Hermes +

+
+ + {/* Architecture note */} +
+

Arhitectură CEO OS AI

+

+ Toate cererile AI sunt rutate prin Hermes (152.53.112.35) pentru real-time learning și customizare per client. + Hermes orchestrează OpenRouter → Gemini / NVIDIA ca fallback. +

+
+ {['Hermes', 'OpenRouter', 'AnythingLLM', 'ClickHouse', 'n8n'].map((tool) => ( + {tool} + ))} +
+
+ + {/* Category filter */} +
+ {CATEGORIES.map((c) => ( + + ))} +
+ +
+
+ {filtered.map((agent) => ( + + ))} +
+ +
+ {selected ? ( +
+
+ {selected.icon} +
+

{selected.name}

+

{selected.category}

+
+
+

{selected.description}

+
+

Instrumente

+ {selected.tools.map((t) => ( +
+ ds.name.toLowerCase().includes(t.toLowerCase())) ? 'bg-signal-ok' : 'bg-border'}`} /> + {t} +
+ ))} +
+ {selected.endpoint && ( +
+

Endpoint activ

+ {selected.endpoint} +
+ )} + {selected.status === 'active' ? ( + + Deschide → + + ) : ( +
+ În planificare — A4 +
+ )} +
+ ) : ( +
+

🤖

+

Selectează un agent.

+
+ )} +
+
+
+ ); +}