feat: complete Phase 1 MVP - add agent panel, email notifications, and PDF invoicing
Agent Panel UI: - Visual dashboard showing all agents with status (idle/working) - Agent cards with stats: total tasks, completed tasks - Capabilities display for each agent - Execution log showing recent agent activity - Real-time updates (refreshes every 10 seconds) - Click agent to filter execution log - Status indicators: pending, running, completed, failed, pending_approval Email Notifications: - SMTP email service with HTML templates - Task assignment notifications - Agent approval request emails with action details - Agent completion notifications - Configurable via environment variables (SMTP_HOST, SMTP_USER, SMTP_PASSWORD, SMTP_TO) - Integrated with agent executor service PDF Invoice Generation: - Professional PDF invoices using ReportLab - Generate from time entries by project - Client information and company branding - Itemized time entries with hours, rates, amounts - Automatic totals calculation - Download as PDF attachment - API endpoints: /api/opc/invoices/generate - Projects and clients management endpoints Additional Features: - Projects CRUD API - Clients CRUD API - Project time tracking summary - Billable vs non-billable hours tracking Phase 1 MVP 100% Complete: ✅ PostgreSQL database with full schema ✅ Task CRUD API with automatic time tracking ✅ Kanban board with drag-and-drop ✅ Agent executor service with LLM integration ✅ WebSocket real-time updates ✅ 3 core agents (PM, CTO, COO) ✅ Agent panel UI with execution logs ✅ Email notifications (Telegram + Email) ✅ PDF invoice generation All 12 tasks completed!
This commit is contained in:
@@ -7,6 +7,7 @@ from typing import Dict, Any, Optional
|
||||
from datetime import datetime
|
||||
from db import opc_db
|
||||
from services.agents.base_agent import BaseAgent
|
||||
from services import email_service
|
||||
import httpx
|
||||
import os
|
||||
|
||||
@@ -273,8 +274,17 @@ Proposed Actions:
|
||||
|
||||
message += "\nPlease review and approve in the OPC dashboard."
|
||||
|
||||
# Send Telegram
|
||||
await self._send_telegram(message)
|
||||
|
||||
# Send Email
|
||||
await email_service.send_agent_approval_email(
|
||||
agent_name=agent.name,
|
||||
task=task,
|
||||
reasoning=result.get('reasoning', 'No reasoning provided'),
|
||||
actions=result.get('actions', [])
|
||||
)
|
||||
|
||||
async def _send_completion_notification(self, agent: BaseAgent, task: Dict[str, Any], result: Dict[str, Any]):
|
||||
"""Send notification for completed execution"""
|
||||
message = f"""✅ *Agent Task Completed*
|
||||
@@ -284,8 +294,16 @@ Task: {task['title']}
|
||||
|
||||
Actions Executed: {len(result.get('actions', []))}
|
||||
"""
|
||||
# Send Telegram
|
||||
await self._send_telegram(message)
|
||||
|
||||
# Send Email
|
||||
await email_service.send_agent_completion_email(
|
||||
agent_name=agent.name,
|
||||
task=task,
|
||||
actions_count=len(result.get('actions', []))
|
||||
)
|
||||
|
||||
|
||||
# Global executor instance
|
||||
_executor: Optional[AgentExecutor] = None
|
||||
|
||||
Reference in New Issue
Block a user