-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathecho.py
More file actions
77 lines (67 loc) · 3.05 KB
/
echo.py
File metadata and controls
77 lines (67 loc) · 3.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
"""
Echo v0.1 — Your AI Professional Clone
Run: python3 echo.py
"""
from __future__ import annotations
import sys
from datetime import datetime
from config import EMAIL_TO
from agents.inbox_agent import InboxAgent
from agents.reply_agent import ReplyAgent
from agents.calendar_agent import CalendarAgent
from agents.briefing_agent import BriefingAgent
from emailer import build_html, send
def run():
print()
print(" ███████╗ ██████╗██╗ ██╗ ██████╗ ")
print(" ██╔════╝██╔════╝██║ ██║██╔═══██╗")
print(" █████╗ ██║ ███████║██║ ██║")
print(" ██╔══╝ ██║ ██╔══██║██║ ██║")
print(" ███████╗╚██████╗██║ ██║╚██████╔╝")
print(" ╚══════╝ ╚═════╝╚═╝ ╚═╝ ╚═════╝ ")
print(" Your AI Professional Clone v0.1")
print()
date_str = datetime.now().strftime("%A, %B %d %Y · %I:%M %p")
print(f" Running briefing for {date_str}")
print()
# Step 1: Inbox
print(" [1/4] Reading Gmail inbox...")
inbox_agent = InboxAgent()
inbox = inbox_agent.fetch_and_categorize(max_emails=20)
urgent_count = len(inbox.get('urgent', []))
reply_count = len(inbox.get('reply_needed', []))
print(f" {inbox.get('total_unread', 0)} unread | {urgent_count} urgent | {reply_count} need reply")
# Step 2: Draft replies for urgent + reply_needed
print(" [2/4] Drafting replies in your voice...")
reply_agent = ReplyAgent()
emails_to_draft = inbox.get('urgent', [])[:3] + inbox.get('reply_needed', [])[:3]
drafts = reply_agent.batch_draft(emails_to_draft)
print(f" {len(drafts)} drafts ready for your review")
# Step 3: Calendar
print(" [3/4] Reading Google Calendar...")
cal_agent = CalendarAgent()
calendar = cal_agent.get_today_summary()
meeting_hours = calendar.get('total_meeting_hours', 0)
focus_blocks = len(calendar.get('focus_blocks', []))
print(f" {meeting_hours}h in meetings | {focus_blocks} focus blocks available")
# Step 4: Generate briefing
print(" [4/4] Generating morning briefing...")
briefing_agent = BriefingAgent()
briefing = briefing_agent.generate(inbox, calendar, drafts)
print()
# Print priorities to terminal
print(" TODAY'S PRIORITIES:")
for i, p in enumerate(briefing.get('top_priorities', []), 1):
print(f" {i}. {p}")
print()
# Build and send email
print(f" Sending briefing to {EMAIL_TO}...")
html = build_html(briefing, inbox, calendar, drafts)
subject = f"Echo Briefing · {datetime.now().strftime('%b %d')} · {urgent_count} urgent · {len(drafts)} drafts ready"
send(html, subject)
print(f" ✓ Briefing sent to {EMAIL_TO}")
print()
print(" Echo has your back. Go build something great.")
print()
if __name__ == "__main__":
run()