diff --git a/components/council/AgentModal.tsx b/components/council/AgentModal.tsx index ba87fcb..d991f96 100644 --- a/components/council/AgentModal.tsx +++ b/components/council/AgentModal.tsx @@ -1,15 +1,15 @@ "use client"; -import { useState, useEffect } from "react"; +import { useState, useEffect, useRef } from "react"; -const AGENT_CONFIG: Record = { - horus: { name: "Horus", avatar: "πŸ‘οΈ", color: "#ff7bc0", role: "Master Orchestrator", description: "Command center, delegates tasks, manages all agents" }, - thoth: { name: "Thoth", avatar: "🧠", color: "#8b5cf6", role: "Strategy & Research", description: "SiteMente planning, research, analysis" }, - "thoth-trading": { name: "Thoth Trading", avatar: "πŸ“ˆ", color: "#f59e0b", role: "Market Research", description: "Crypto market analysis and research" }, - ptah: { name: "Ptah", avatar: "πŸ—οΈ", color: "#10b981", role: "Dev & Ops", description: "Development, deployment, technical implementation" }, - seshat: { name: "Seshat", avatar: "πŸ“œ", color: "#ec4899", role: "Content & SEO", description: "Content strategy, SEO, marketing copy" }, - anubis: { name: "Anubis", avatar: "🐺", color: "#6366f1", role: "Outreach & Growth", description: "Lead generation, client acquisition" }, - sekhmet: { name: "Sekhmet", avatar: "βš”οΈ", color: "#ef4444", role: "Risk Management", description: "Trade execution and risk" }, +const AGENT_CONFIG: Record = { + horus: { name: "Horus", avatar: "πŸ‘οΈ", color: "#ff7bc0", role: "Master Orchestrator", description: "Command center, delegates tasks, manages all agents", skills: ["Task delegation", "System orchestration", "Strategic planning"] }, + thoth: { name: "Thoth", avatar: "🧠", color: "#8b5cf6", role: "Strategy & Research", description: "SiteMente planning, research, analysis", skills: ["Market research", "Competitor analysis", "AI trends", "Lead research"] }, + "thoth-trading": { name: "Thoth Trading", avatar: "πŸ“ˆ", color: "#f59e0b", role: "Market Research", description: "Crypto market analysis and research", skills: ["Technical analysis", "Price alerts", "Portfolio tracking"] }, + ptah: { name: "Ptah", avatar: "πŸ—οΈ", color: "#10b981", role: "Dev & Ops", description: "Development, deployment, technical implementation", skills: ["Code review", "Deployments", "Infra management", "Bug fixes"] }, + seshat: { name: "Seshat", avatar: "πŸ“œ", color: "#ec4899", role: "Content & SEO", description: "Content strategy, SEO, marketing copy", skills: ["SEO optimization", "Copywriting", "Blog posts", "Social media"] }, + anubis: { name: "Anubis", avatar: "🐺", color: "#6366f1", role: "Outreach & Growth", description: "Lead generation, client acquisition", skills: ["Lead research", "Cold outreach", "Follow-ups", "Deal closing"] }, + sekhmet: { name: "Sekhmet", avatar: "βš”οΈ", color: "#ef4444", role: "Risk Management", description: "Trade execution and risk", skills: ["Risk assessment", "Trade execution", "Stop-loss management"] }, }; interface AgentModalProps { @@ -18,7 +18,7 @@ interface AgentModalProps { } export default function AgentModal({ agentId, onClose }: AgentModalProps) { - const agent = AGENT_CONFIG[agentId] || { name: agentId, avatar: "πŸ€–", color: "#666", role: "Agent", description: "" }; + const agent = AGENT_CONFIG[agentId] || { name: agentId, avatar: "πŸ€–", color: "#666", role: "Agent", description: "", skills: [] }; const [tasks, setTasks] = useState([]); const [templates, setTemplates] = useState([]); @@ -30,6 +30,12 @@ export default function AgentModal({ agentId, onClose }: AgentModalProps) { const [tokens, setTokens] = useState("0"); const [lastRun, setLastRun] = useState(null); + // Command input + const [command, setCommand] = useState(""); + const [conversation, setConversation] = useState<{role: string, content: string}[]>([]); + const [processing, setProcessing] = useState(false); + const conversationEndRef = useRef(null); + const [expanded, setExpanded] = useState>({ tasks: true, recurring: true, @@ -42,6 +48,10 @@ export default function AgentModal({ agentId, onClose }: AgentModalProps) { fetchAllData(); }, [agentId]); + useEffect(() => { + conversationEndRef.current?.scrollIntoView({ behavior: "smooth" }); + }, [conversation]); + const fetchAllData = async () => { setLoading(true); @@ -139,6 +149,34 @@ export default function AgentModal({ agentId, onClose }: AgentModalProps) { setTimeout(fetchAllData, 2000); }; + const sendCommand = async () => { + if (!command.trim() || processing) return; + + const userCommand = command; + setCommand(""); + setConversation(prev => [...prev, { role: "user", content: userCommand }]); + setProcessing(true); + + // Simulate agent response + setTimeout(() => { + const responses: Record = { + thoth: `I've researched "${userCommand}" for SiteMente. Here are my findings:\n\n1. Market trends show increasing demand for AI chatbots\n2. Local competitors: 3 agencies in MΓ‘laga\n3. Recommended approach: Focus on restaurants first`, + "thoth-trading": `Market analysis for "${userCommand}":\n\nπŸ“Š BTC: $67,234 (+2.3%)\nπŸ“Š ETH: $3,456 (+1.8%)\nπŸ“Š SOL: $145 (+3.1%)\n\nNo significant alerts at this time.`, + ptah: `Running "${userCommand}" on infrastructure...\n\nβœ… Completed: Code reviewed, no critical issues found.\nπŸ’‘ Suggestion: Consider adding unit tests for the new module.`, + seshat: `Creating content for "${userCommand}"...\n\nπŸ“ Blog post outline generated\nπŸ“ 3 social media posts drafted\nπŸ“ SEO keywords optimized`, + anubis: `Searching for leads for "${userCommand}"...\n\nπŸ” Found 12 potential restaurants in BenalmΓ‘dena\nπŸ“‹ Top prospect: Restaurante El Puerto (50 seats, no website)\nπŸ“ž Recommended: Schedule demo call this week`, + sekhmet: `Risk assessment for "${userCommand}":\n\n⚠️ Current drawdown: 3.2%\nβœ… All positions within risk limits\nπŸ’‘ Recommendation: No action needed`, + horus: `I've noted your request: "${userCommand}"\n\nI'll delegate this to the appropriate agent and track progress. You can see updates in the Mission Control dashboard.`, + }; + + setConversation(prev => [...prev, { + role: "agent", + content: responses[agentId] || `Understood: "${userCommand}". I'm processing this request and will update you shortly.` + }]); + setProcessing(false); + }, 1500); + }; + const todoTasks = tasks.filter((t: any) => t.status === "todo"); const inProgressTasks = tasks.filter((t: any) => t.status === "in_progress"); const doneTasks = tasks.filter((t: any) => t.status === "done"); @@ -153,14 +191,14 @@ export default function AgentModal({ agentId, onClose }: AgentModalProps) { }; return ( -
-
+
+
{/* Header */} -
+
{agent.avatar} @@ -174,52 +212,111 @@ export default function AgentModal({ agentId, onClose }: AgentModalProps) {
{/* Status Bar */} -
- {getStatusBadge(agentStatus)} -
- Tokens: {tokens}k {lastRun && Last: {new Date(lastRun).toLocaleTimeString()}} +
+
+ {getStatusBadge(agentStatus)} + Tokens: {tokens}k + {lastRun && Last: {new Date(lastRun).toLocaleTimeString()}} +
+
{agent.project || getAgentProject(agentId)}
+
+ + {/* Skills */} +
+
+ {agent.skills.map((skill, i) => ( + {skill} + ))}
{/* Content - Scrollable */} -
+
+ {/* πŸ’¬ CONVERSATION */} +
+
+ πŸ’¬ Chat with {agent.name} +
+
+ {conversation.length === 0 ? ( +

+ Ask {agent.name} anything about {agent.role}... +

+ ) : ( + conversation.map((msg, i) => ( +
+ + {msg.content} + +
+ )) + )} + {processing && ( +
+ + ⏳ Processing... + +
+ )} +
+
+
+
+ setCommand(e.target.value)} + onKeyDown={(e) => e.key === "Enter" && sendCommand()} + placeholder={`Ask ${agent.name} to...`} + className="flex-1 bg-white/10 border border-white/20 rounded-lg px-3 py-2 text-sm placeholder:text-white/40 focus:outline-none focus:border-brand-pink" + disabled={processing} + /> + +
+
+
+ {/* πŸ“‹ TASKS */}
{expanded.tasks && (
-

To Do

+

To Do ({todoTasks.length})

- {todoTasks.length === 0 ?

β€”

: - todoTasks.slice(0, 3).map((t: any) => ( -
{t.title}
- )) - } + {todoTasks.slice(0, 3).map((t: any) => ( +
{t.title}
+ ))}
-

In Progress

+

In Progress ({inProgressTasks.length})

- {inProgressTasks.length === 0 ?

β€”

: - inProgressTasks.slice(0, 3).map((t: any) => ( -
{t.title}
- )) - } + {inProgressTasks.slice(0, 3).map((t: any) => ( +
{t.title}
+ ))}
-

Done

+

Done ({doneTasks.length})

- {doneTasks.length === 0 ?

β€”

: - doneTasks.slice(0, 3).map((t: any) => ( -
{t.title}
- )) - } + {doneTasks.slice(0, 3).map((t: any) => ( +
{t.title}
+ ))}
@@ -229,7 +326,7 @@ export default function AgentModal({ agentId, onClose }: AgentModalProps) { {/* πŸ”„ RECURRING */}
{expanded.recurring && ( @@ -257,7 +354,7 @@ export default function AgentModal({ agentId, onClose }: AgentModalProps) { {/* πŸ“Š LOGS */}
{expanded.logs && ( @@ -282,7 +379,7 @@ export default function AgentModal({ agentId, onClose }: AgentModalProps) { {/* πŸ“ CHANGE LOG */}
{expanded.changelog && ( @@ -305,7 +402,7 @@ export default function AgentModal({ agentId, onClose }: AgentModalProps) { {/* 🧠 BRAINOWN */}
{expanded.brainown && ( diff --git a/data/execution-logs.json b/data/execution-logs.json index cbed01b..fed76bd 100644 --- a/data/execution-logs.json +++ b/data/execution-logs.json @@ -1,4 +1,31 @@ [ + { + "id": "log-1772214804233", + "templateId": "thoth-trading-market", + "agent": "thoth-trading", + "taskTitle": "Market Scan", + "startedAt": "2026-02-27T17:53:24.233Z", + "status": "running", + "output": "Agent executing..." + }, + { + "id": "log-1772214783836", + "templateId": "ptah-infra-monitor", + "agent": "ptah", + "taskTitle": "Infra Health Check", + "startedAt": "2026-02-27T17:53:03.836Z", + "status": "running", + "output": "Agent executing..." + }, + { + "id": "log-1772214633198", + "templateId": "ptah-infra-monitor", + "agent": "ptah", + "taskTitle": "Infra Health Check", + "startedAt": "2026-02-27T17:50:33.198Z", + "status": "running", + "output": "Agent executing..." + }, { "id": "log-1772210329312", "templateId": "thoth-trading-market", diff --git a/data/recurring-templates.json b/data/recurring-templates.json index 578c583..e999bfb 100644 --- a/data/recurring-templates.json +++ b/data/recurring-templates.json @@ -36,7 +36,8 @@ }, "preInstructions": "Report any issues immediately to Horus", "enabled": false, - "runCount": 0 + "runCount": 2, + "lastRun": "2026-02-27T17:53:03.836Z" }, { "id": "seshat-content-pipeline", @@ -95,9 +96,9 @@ "priority": "medium" }, "preInstructions": "Report significant moves (>5%)", - "enabled": false, - "runCount": 1, - "lastRun": "2026-02-27T16:38:49.312Z" + "enabled": true, + "runCount": 2, + "lastRun": "2026-02-27T17:53:24.233Z" }, { "id": "sekhmet-risk-alerts",