bizy-ai 1.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- agent/__init__.py +5 -0
- agent/cli.py +228 -0
- agent/core.py +205 -0
- agent/models.py +216 -0
- agent/planner.py +363 -0
- agent/research.py +199 -0
- agent/tasks.py +251 -0
- bizy_ai-1.0.0.dist-info/METADATA +471 -0
- bizy_ai-1.0.0.dist-info/RECORD +18 -0
- bizy_ai-1.0.0.dist-info/WHEEL +5 -0
- bizy_ai-1.0.0.dist-info/entry_points.txt +2 -0
- bizy_ai-1.0.0.dist-info/licenses/LICENSE +21 -0
- bizy_ai-1.0.0.dist-info/top_level.txt +2 -0
- scripts/agent_cli.py +232 -0
- scripts/evening_review.py +148 -0
- scripts/init_db.py +91 -0
- scripts/morning_brief.py +132 -0
- scripts/weekly_review.py +72 -0
@@ -0,0 +1,18 @@
|
|
1
|
+
agent/__init__.py,sha256=pHeIDi-ibuwZqaNqxdIDRvzedWtPywssbaYIDawMcvQ,88
|
2
|
+
agent/cli.py,sha256=5Qyw7QYDHf-xN6OHcdhBay90RCdgk3gMd7WK97oLs78,6806
|
3
|
+
agent/core.py,sha256=UILN_DjsSr91KN3YyQaD_cZgF9vW8m827-W0pZMTUnM,6561
|
4
|
+
agent/models.py,sha256=6bDSLXRxztF50J0AoTi5PX3ckf74oPhyQXfOccfVGdk,7937
|
5
|
+
agent/planner.py,sha256=-KlyZ-2jMQTUy0QVZCH_NuubENU-UrPXVhat3ju54ew,13114
|
6
|
+
agent/research.py,sha256=HvqGHENQ0v1lJadGYNuf3eb6fZoR6qzzIPzqcsnhFSE,6429
|
7
|
+
agent/tasks.py,sha256=PaQzRcnzp5HPWVlQKG3KLwdNBNqHTsqCuoGmRwRh8dA,9041
|
8
|
+
bizy_ai-1.0.0.dist-info/licenses/LICENSE,sha256=__BSNgmbeWQ1IA57XKyGhQajUNcF-pZjvBAY268fCWM,1069
|
9
|
+
scripts/agent_cli.py,sha256=sG-iRmFZCzm5SkqDtVV1KzZ293SEtvFpY8A1_b69dJU,6971
|
10
|
+
scripts/evening_review.py,sha256=Y4d-t62zfaufM8mnSvkhBBZ0wMw1R8jtj4cN8r30t4E,4929
|
11
|
+
scripts/init_db.py,sha256=lF1rJAuaeOX19dYQKURzePYWmjkjLPH_4L0D2OiRgQA,3376
|
12
|
+
scripts/morning_brief.py,sha256=zcu4nUOnIQtoZTiK1XlEjuudiUAABrps3PvAwt2Avmk,4732
|
13
|
+
scripts/weekly_review.py,sha256=ljwy0Aq6yFE_gs8TQjJKCO9Ob59fXsu8L_gDPiRQdmc,2298
|
14
|
+
bizy_ai-1.0.0.dist-info/METADATA,sha256=DXC7mKFwGoVbqnTZr9DNztsdcGc9T3_KZH9O2kSIbpg,12184
|
15
|
+
bizy_ai-1.0.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
16
|
+
bizy_ai-1.0.0.dist-info/entry_points.txt,sha256=yDZc2xFUlCOPuHtAaNissB16AZFzOnOL8xeStkDujAg,39
|
17
|
+
bizy_ai-1.0.0.dist-info/top_level.txt,sha256=k5ce4bNe_tK9tse1lxY4b8nPSipbtgoA28GHmM2ojwk,14
|
18
|
+
bizy_ai-1.0.0.dist-info/RECORD,,
|
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2025 Reid Chatham
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
scripts/agent_cli.py
ADDED
@@ -0,0 +1,232 @@
|
|
1
|
+
#!/usr/bin/env python3
|
2
|
+
"""Business Agent CLI Tool"""
|
3
|
+
|
4
|
+
import sys
|
5
|
+
import os
|
6
|
+
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
|
7
|
+
|
8
|
+
import click
|
9
|
+
from agent.tasks import TaskManager
|
10
|
+
from agent.planner import BusinessPlanner
|
11
|
+
from agent.research import ResearchAgent
|
12
|
+
from rich.console import Console
|
13
|
+
from rich.table import Table
|
14
|
+
from rich.panel import Panel
|
15
|
+
from rich.markdown import Markdown
|
16
|
+
from datetime import datetime, timedelta
|
17
|
+
from dotenv import load_dotenv
|
18
|
+
|
19
|
+
load_dotenv()
|
20
|
+
console = Console()
|
21
|
+
|
22
|
+
@click.group()
|
23
|
+
def cli():
|
24
|
+
"""Business Agent CLI - Manage your business from the command line"""
|
25
|
+
pass
|
26
|
+
|
27
|
+
# TASK COMMANDS
|
28
|
+
@cli.group()
|
29
|
+
def task():
|
30
|
+
"""Manage tasks"""
|
31
|
+
pass
|
32
|
+
|
33
|
+
@task.command()
|
34
|
+
@click.argument('title')
|
35
|
+
@click.option('--description', '-d', help='Task description')
|
36
|
+
@click.option('--priority', '-p', type=int, default=3)
|
37
|
+
@click.option('--category', '-c', help='Task category')
|
38
|
+
@click.option('--hours', '-h', type=float, help='Estimated hours')
|
39
|
+
def add(title, description, priority, category, hours):
|
40
|
+
"""Add a new task"""
|
41
|
+
task_mgr = TaskManager()
|
42
|
+
task = task_mgr.create_task(
|
43
|
+
title=title,
|
44
|
+
description=description,
|
45
|
+
priority=priority,
|
46
|
+
category=category,
|
47
|
+
estimated_hours=hours
|
48
|
+
)
|
49
|
+
console.print(f"[green]✓[/green] Task created: {task.title} (ID: {task.id})")
|
50
|
+
task_mgr.close()
|
51
|
+
|
52
|
+
@task.command()
|
53
|
+
def list():
|
54
|
+
"""List all pending tasks"""
|
55
|
+
task_mgr = TaskManager()
|
56
|
+
tasks = task_mgr.get_tasks_for_today()
|
57
|
+
|
58
|
+
if not tasks:
|
59
|
+
console.print("[yellow]No pending tasks[/yellow]")
|
60
|
+
return
|
61
|
+
|
62
|
+
table = Table(title="📋 Your Tasks", show_header=True, header_style="bold cyan")
|
63
|
+
table.add_column("ID", style="dim")
|
64
|
+
table.add_column("Priority", justify="center")
|
65
|
+
table.add_column("Title")
|
66
|
+
table.add_column("Category", style="cyan")
|
67
|
+
|
68
|
+
for task in tasks:
|
69
|
+
priority_str = "🔴" if task.priority == 1 else "🟡" if task.priority == 3 else "🟢"
|
70
|
+
table.add_row(
|
71
|
+
str(task.id),
|
72
|
+
priority_str,
|
73
|
+
task.title[:50],
|
74
|
+
task.category or "-"
|
75
|
+
)
|
76
|
+
|
77
|
+
console.print(table)
|
78
|
+
task_mgr.close()
|
79
|
+
|
80
|
+
@task.command()
|
81
|
+
@click.argument('task_id', type=int)
|
82
|
+
def complete(task_id):
|
83
|
+
"""Mark a task as complete"""
|
84
|
+
task_mgr = TaskManager()
|
85
|
+
task = task_mgr.complete_task(task_id)
|
86
|
+
if task:
|
87
|
+
console.print(f"[green]✓[/green] Completed: {task.title}")
|
88
|
+
else:
|
89
|
+
console.print(f"[red]✗[/red] Task {task_id} not found")
|
90
|
+
task_mgr.close()
|
91
|
+
|
92
|
+
# GOAL COMMANDS
|
93
|
+
@cli.group()
|
94
|
+
def goal():
|
95
|
+
"""Manage goals"""
|
96
|
+
pass
|
97
|
+
|
98
|
+
@goal.command()
|
99
|
+
@click.argument('title')
|
100
|
+
@click.option('--description', '-d', help='Goal description')
|
101
|
+
@click.option('--horizon', '-h', type=click.Choice(['weekly', 'monthly', 'quarterly', 'yearly']), default='monthly')
|
102
|
+
@click.option('--target', '-t', help='Target date (YYYY-MM-DD)')
|
103
|
+
def add(title, description, horizon, target):
|
104
|
+
"""Add a new goal"""
|
105
|
+
planner = BusinessPlanner()
|
106
|
+
target_date = None
|
107
|
+
if target:
|
108
|
+
target_date = datetime.strptime(target, '%Y-%m-%d')
|
109
|
+
|
110
|
+
goal = planner.create_goal(
|
111
|
+
title=title,
|
112
|
+
description=description,
|
113
|
+
horizon=horizon,
|
114
|
+
target_date=target_date
|
115
|
+
)
|
116
|
+
console.print(f"[green]✓[/green] Goal created: {goal.title} (ID: {goal.id})")
|
117
|
+
planner.close()
|
118
|
+
|
119
|
+
@goal.command()
|
120
|
+
def list():
|
121
|
+
"""List all active goals"""
|
122
|
+
planner = BusinessPlanner()
|
123
|
+
goals = planner.get_active_goals()
|
124
|
+
|
125
|
+
if not goals:
|
126
|
+
console.print("[yellow]No active goals[/yellow]")
|
127
|
+
return
|
128
|
+
|
129
|
+
table = Table(title="🎯 Your Goals", show_header=True, header_style="bold cyan")
|
130
|
+
table.add_column("ID", style="dim")
|
131
|
+
table.add_column("Title")
|
132
|
+
table.add_column("Horizon", style="cyan")
|
133
|
+
table.add_column("Progress", justify="right")
|
134
|
+
|
135
|
+
for goal in goals:
|
136
|
+
progress_bar = "█" * int(goal.progress_percentage / 10) + "░" * (10 - int(goal.progress_percentage / 10))
|
137
|
+
table.add_row(
|
138
|
+
str(goal.id),
|
139
|
+
goal.title[:40],
|
140
|
+
goal.horizon,
|
141
|
+
f"{progress_bar} {goal.progress_percentage:.0f}%"
|
142
|
+
)
|
143
|
+
|
144
|
+
console.print(table)
|
145
|
+
planner.close()
|
146
|
+
|
147
|
+
@goal.command()
|
148
|
+
@click.argument('goal_id', type=int)
|
149
|
+
def breakdown(goal_id):
|
150
|
+
"""Break down a goal into tasks using AI"""
|
151
|
+
planner = BusinessPlanner()
|
152
|
+
console.print(f"[cyan]Breaking down goal {goal_id}...[/cyan]")
|
153
|
+
tasks = planner.break_down_goal(goal_id)
|
154
|
+
|
155
|
+
if tasks:
|
156
|
+
console.print(f"[green]✓[/green] Created {len(tasks)} tasks")
|
157
|
+
for task in tasks:
|
158
|
+
console.print(f" • {task.title}")
|
159
|
+
else:
|
160
|
+
console.print("[red]✗[/red] Failed to break down goal")
|
161
|
+
planner.close()
|
162
|
+
|
163
|
+
# RESEARCH COMMANDS
|
164
|
+
@cli.group()
|
165
|
+
def research():
|
166
|
+
"""Conduct research"""
|
167
|
+
pass
|
168
|
+
|
169
|
+
@research.command()
|
170
|
+
@click.argument('topic')
|
171
|
+
@click.option('--goal', '-g', help='Business goal')
|
172
|
+
def topic(topic, goal):
|
173
|
+
"""Research a topic"""
|
174
|
+
researcher = ResearchAgent()
|
175
|
+
console.print(f"[cyan]Researching: {topic}...[/cyan]\n")
|
176
|
+
|
177
|
+
result = researcher.research_topic(
|
178
|
+
topic=topic,
|
179
|
+
business_goal=goal or "General research",
|
180
|
+
depth="standard"
|
181
|
+
)
|
182
|
+
|
183
|
+
if 'error' in result:
|
184
|
+
console.print(f"[red]✗ Error:[/red] {result['error']}")
|
185
|
+
else:
|
186
|
+
console.print(Panel(
|
187
|
+
Markdown(result['findings']),
|
188
|
+
title=f"🔍 Research: {topic}",
|
189
|
+
border_style="blue"
|
190
|
+
))
|
191
|
+
console.print(f"\n[dim]Saved as research ID: {result['research_id']}[/dim]")
|
192
|
+
researcher.close()
|
193
|
+
|
194
|
+
@research.command()
|
195
|
+
@click.argument('domain')
|
196
|
+
@click.argument('offering')
|
197
|
+
def competitors(domain, offering):
|
198
|
+
"""Research competitors"""
|
199
|
+
researcher = ResearchAgent()
|
200
|
+
console.print(f"[cyan]Analyzing competitive landscape...[/cyan]\n")
|
201
|
+
|
202
|
+
result = researcher.research_competitors(domain, offering)
|
203
|
+
|
204
|
+
if 'error' in result:
|
205
|
+
console.print(f"[red]✗ Error:[/red] {result['error']}")
|
206
|
+
else:
|
207
|
+
console.print(Panel(
|
208
|
+
Markdown(result['findings']),
|
209
|
+
title="🏆 Competitive Analysis",
|
210
|
+
border_style="blue"
|
211
|
+
))
|
212
|
+
researcher.close()
|
213
|
+
|
214
|
+
# STATS COMMAND
|
215
|
+
@cli.command()
|
216
|
+
def stats():
|
217
|
+
"""Show statistics"""
|
218
|
+
task_mgr = TaskManager()
|
219
|
+
weekly_stats = task_mgr.get_weekly_stats()
|
220
|
+
velocity = task_mgr.get_task_velocity()
|
221
|
+
today_tasks = task_mgr.get_tasks_for_today()
|
222
|
+
|
223
|
+
console.print("\n[bold cyan]📊 Your Statistics[/bold cyan]\n")
|
224
|
+
console.print("[bold]This Week:[/bold]")
|
225
|
+
console.print(f" • Tasks Completed: {weekly_stats['total_tasks_completed']}")
|
226
|
+
console.print(f" • Completion Rate: {weekly_stats['average_completion_rate']:.0%}")
|
227
|
+
console.print(f"\n[bold]Velocity:[/bold] {velocity:.1f} tasks/day")
|
228
|
+
console.print(f"\n[bold]Today:[/bold] {len(today_tasks)} tasks scheduled\n")
|
229
|
+
task_mgr.close()
|
230
|
+
|
231
|
+
if __name__ == "__main__":
|
232
|
+
cli()
|
@@ -0,0 +1,148 @@
|
|
1
|
+
#!/usr/bin/env python3
|
2
|
+
"""
|
3
|
+
Evening Review Script
|
4
|
+
Interactive end-of-day review and reflection
|
5
|
+
"""
|
6
|
+
|
7
|
+
import sys
|
8
|
+
import os
|
9
|
+
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
|
10
|
+
|
11
|
+
from agent.core import BusinessAgent
|
12
|
+
from agent.tasks import TaskManager
|
13
|
+
from rich.console import Console
|
14
|
+
from rich.panel import Panel
|
15
|
+
from rich.prompt import Prompt
|
16
|
+
from rich.markdown import Markdown
|
17
|
+
from datetime import datetime
|
18
|
+
from dotenv import load_dotenv
|
19
|
+
|
20
|
+
load_dotenv()
|
21
|
+
|
22
|
+
console = Console()
|
23
|
+
|
24
|
+
def display_banner():
|
25
|
+
"""Display evening banner"""
|
26
|
+
now = datetime.now()
|
27
|
+
console.print()
|
28
|
+
console.print(f"[bold magenta]{'='*70}[/bold magenta]")
|
29
|
+
console.print(f"[bold magenta] 🌙 EVENING REVIEW - {now.strftime('%A, %B %d, %Y')}[/bold magenta]")
|
30
|
+
console.print(f"[bold magenta]{'='*70}[/bold magenta]")
|
31
|
+
console.print()
|
32
|
+
|
33
|
+
def run_evening_review():
|
34
|
+
"""Main function for evening review"""
|
35
|
+
try:
|
36
|
+
display_banner()
|
37
|
+
|
38
|
+
# Initialize
|
39
|
+
agent = BusinessAgent()
|
40
|
+
task_mgr = TaskManager()
|
41
|
+
|
42
|
+
# Get today's tasks
|
43
|
+
today_tasks = task_mgr.get_tasks_for_today()
|
44
|
+
completed_tasks = [t for t in today_tasks if t.status == 'completed']
|
45
|
+
pending_tasks = [t for t in today_tasks if t.status in ['pending', 'in_progress', 'blocked']]
|
46
|
+
|
47
|
+
# Display today's stats
|
48
|
+
completion_rate = len(completed_tasks) / len(today_tasks) if today_tasks else 0
|
49
|
+
|
50
|
+
console.print("[bold]📊 Today's Summary:[/bold]")
|
51
|
+
console.print(f" • Tasks completed: {len(completed_tasks)}/{len(today_tasks)} ({completion_rate:.0%})")
|
52
|
+
console.print()
|
53
|
+
|
54
|
+
if completed_tasks:
|
55
|
+
console.print("[bold green]✅ Completed:[/bold green]")
|
56
|
+
for task in completed_tasks:
|
57
|
+
console.print(f" • {task.title}")
|
58
|
+
console.print()
|
59
|
+
|
60
|
+
if pending_tasks:
|
61
|
+
console.print("[bold yellow]⏳ Not Completed:[/bold yellow]")
|
62
|
+
for task in pending_tasks[:5]:
|
63
|
+
status_emoji = {"pending": "⏳", "in_progress": "🔄", "blocked": "🚧"}.get(task.status, "")
|
64
|
+
console.print(f" • {status_emoji} {task.title}")
|
65
|
+
console.print()
|
66
|
+
|
67
|
+
# Interactive reflection
|
68
|
+
console.print("[bold cyan]📝 Daily Reflection[/bold cyan]")
|
69
|
+
console.print("[dim]Take a moment to reflect on your day...[/dim]")
|
70
|
+
console.print()
|
71
|
+
|
72
|
+
wins = Prompt.ask("💪 [bold]What were your wins today?[/bold] (biggest accomplishments)")
|
73
|
+
console.print()
|
74
|
+
|
75
|
+
blockers = Prompt.ask("🚧 [bold]Any blockers or challenges?[/bold] (what slowed you down)")
|
76
|
+
console.print()
|
77
|
+
|
78
|
+
learnings = Prompt.ask("💡 [bold]What did you learn?[/bold] (insights or discoveries)")
|
79
|
+
console.print()
|
80
|
+
|
81
|
+
energy_choices = ["high", "medium", "low"]
|
82
|
+
energy = Prompt.ask(
|
83
|
+
"⚡ [bold]Energy level[/bold]",
|
84
|
+
choices=energy_choices,
|
85
|
+
default="medium"
|
86
|
+
)
|
87
|
+
console.print()
|
88
|
+
|
89
|
+
mood_choices = ["great", "good", "okay", "tough"]
|
90
|
+
mood = Prompt.ask(
|
91
|
+
"😊 [bold]Overall mood[/bold]",
|
92
|
+
choices=mood_choices,
|
93
|
+
default="good"
|
94
|
+
)
|
95
|
+
console.print()
|
96
|
+
|
97
|
+
# Log the day
|
98
|
+
console.print("[dim]Saving your reflections...[/dim]")
|
99
|
+
task_mgr.create_daily_log(
|
100
|
+
date=datetime.now(),
|
101
|
+
tasks_completed=len(completed_tasks),
|
102
|
+
tasks_planned=len(today_tasks),
|
103
|
+
wins=wins,
|
104
|
+
blockers=blockers,
|
105
|
+
learnings=learnings,
|
106
|
+
energy_level=energy,
|
107
|
+
mood=mood
|
108
|
+
)
|
109
|
+
|
110
|
+
# Get AI insights
|
111
|
+
console.print("[dim]Analyzing your day...[/dim]")
|
112
|
+
console.print()
|
113
|
+
|
114
|
+
insights = agent.evening_review_analysis(
|
115
|
+
completed_tasks=completed_tasks,
|
116
|
+
planned_tasks=today_tasks,
|
117
|
+
wins=wins,
|
118
|
+
blockers=blockers,
|
119
|
+
learnings=learnings,
|
120
|
+
energy_level=energy
|
121
|
+
)
|
122
|
+
|
123
|
+
# Display insights
|
124
|
+
console.print(Panel(
|
125
|
+
Markdown(insights),
|
126
|
+
title="🤖 AI Insights",
|
127
|
+
border_style="green",
|
128
|
+
padding=(1, 2)
|
129
|
+
))
|
130
|
+
|
131
|
+
console.print()
|
132
|
+
console.print("[bold cyan]💤 Great work today! Rest well and see you tomorrow morning.[/bold cyan]")
|
133
|
+
console.print()
|
134
|
+
|
135
|
+
# Cleanup
|
136
|
+
task_mgr.close()
|
137
|
+
|
138
|
+
except KeyboardInterrupt:
|
139
|
+
console.print("\n[yellow]Review cancelled. Your data has been saved.[/yellow]")
|
140
|
+
sys.exit(0)
|
141
|
+
except Exception as e:
|
142
|
+
console.print(f"[bold red]❌ Error:[/bold red] {e}")
|
143
|
+
import traceback
|
144
|
+
console.print(traceback.format_exc())
|
145
|
+
sys.exit(1)
|
146
|
+
|
147
|
+
if __name__ == "__main__":
|
148
|
+
run_evening_review()
|
scripts/init_db.py
ADDED
@@ -0,0 +1,91 @@
|
|
1
|
+
#!/usr/bin/env python3
|
2
|
+
"""Database Initialization Script"""
|
3
|
+
|
4
|
+
import sys
|
5
|
+
import os
|
6
|
+
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
|
7
|
+
|
8
|
+
from agent.models import init_database
|
9
|
+
from rich.console import Console
|
10
|
+
from rich.prompt import Confirm
|
11
|
+
|
12
|
+
console = Console()
|
13
|
+
|
14
|
+
def main():
|
15
|
+
console.print("[bold cyan]Business Agent Database Setup[/bold cyan]")
|
16
|
+
console.print()
|
17
|
+
|
18
|
+
console.print("Initializing database...")
|
19
|
+
try:
|
20
|
+
engine = init_database()
|
21
|
+
console.print("[green]✓[/green] Database initialized successfully!")
|
22
|
+
console.print(f"[dim]Location: data/tasks.db[/dim]")
|
23
|
+
console.print()
|
24
|
+
|
25
|
+
if Confirm.ask("Would you like to create sample tasks and goals?"):
|
26
|
+
from agent.tasks import TaskManager
|
27
|
+
from agent.planner import BusinessPlanner
|
28
|
+
from datetime import datetime, timedelta
|
29
|
+
|
30
|
+
task_mgr = TaskManager()
|
31
|
+
planner = BusinessPlanner()
|
32
|
+
|
33
|
+
console.print()
|
34
|
+
console.print("Creating sample data...")
|
35
|
+
|
36
|
+
# Create a sample yearly goal
|
37
|
+
yearly_goal = planner.create_goal(
|
38
|
+
title="Launch MVP Product",
|
39
|
+
description="Build and launch the minimum viable product for our business agent",
|
40
|
+
horizon="yearly",
|
41
|
+
target_date=datetime.now() + timedelta(days=365),
|
42
|
+
success_criteria="10 paying customers using the product daily"
|
43
|
+
)
|
44
|
+
console.print("[green]✓[/green] Created yearly goal")
|
45
|
+
|
46
|
+
# Create sample tasks
|
47
|
+
sample_tasks = [
|
48
|
+
{
|
49
|
+
"title": "Set up development environment",
|
50
|
+
"description": "Install dependencies and configure the project",
|
51
|
+
"priority": 1,
|
52
|
+
"category": "development",
|
53
|
+
"estimated_hours": 2.0,
|
54
|
+
"due_date": datetime.now() + timedelta(days=1)
|
55
|
+
},
|
56
|
+
{
|
57
|
+
"title": "Define business plan",
|
58
|
+
"description": "Fill out the business plan template",
|
59
|
+
"priority": 1,
|
60
|
+
"category": "planning",
|
61
|
+
"estimated_hours": 3.0,
|
62
|
+
"due_date": datetime.now() + timedelta(days=2)
|
63
|
+
}
|
64
|
+
]
|
65
|
+
|
66
|
+
for task_data in sample_tasks:
|
67
|
+
task_mgr.create_task(parent_goal_id=yearly_goal.id, **task_data)
|
68
|
+
|
69
|
+
console.print(f"[green]✓[/green] Created {len(sample_tasks)} sample tasks")
|
70
|
+
console.print()
|
71
|
+
|
72
|
+
task_mgr.close()
|
73
|
+
planner.close()
|
74
|
+
|
75
|
+
console.print()
|
76
|
+
console.print("[bold green]Setup complete![/bold green]")
|
77
|
+
console.print()
|
78
|
+
console.print("Next steps:")
|
79
|
+
console.print("1. Copy .env.example to .env and add your ANTHROPIC_API_KEY")
|
80
|
+
console.print("2. Fill out templates/business_plan_template.yaml")
|
81
|
+
console.print("3. Run: python scripts/morning_brief.py")
|
82
|
+
console.print()
|
83
|
+
|
84
|
+
except Exception as e:
|
85
|
+
console.print(f"[bold red]Error:[/bold red] {e}")
|
86
|
+
import traceback
|
87
|
+
console.print(traceback.format_exc())
|
88
|
+
sys.exit(1)
|
89
|
+
|
90
|
+
if __name__ == "__main__":
|
91
|
+
main()
|
scripts/morning_brief.py
ADDED
@@ -0,0 +1,132 @@
|
|
1
|
+
#!/usr/bin/env python3
|
2
|
+
"""
|
3
|
+
Morning Briefing Script
|
4
|
+
Generates and displays the daily morning briefing
|
5
|
+
"""
|
6
|
+
|
7
|
+
import sys
|
8
|
+
import os
|
9
|
+
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
|
10
|
+
|
11
|
+
from agent.core import BusinessAgent
|
12
|
+
from agent.tasks import TaskManager
|
13
|
+
from agent.planner import BusinessPlanner
|
14
|
+
from rich.console import Console
|
15
|
+
from rich.panel import Panel
|
16
|
+
from rich.markdown import Markdown
|
17
|
+
from datetime import datetime
|
18
|
+
from dotenv import load_dotenv
|
19
|
+
|
20
|
+
load_dotenv()
|
21
|
+
|
22
|
+
console = Console()
|
23
|
+
|
24
|
+
def display_banner():
|
25
|
+
"""Display welcome banner"""
|
26
|
+
now = datetime.now()
|
27
|
+
console.print()
|
28
|
+
console.print(f"[bold cyan]{'='*70}[/bold cyan]")
|
29
|
+
console.print(f"[bold cyan] ☀️ MORNING BRIEFING - {now.strftime('%A, %B %d, %Y')}[/bold cyan]")
|
30
|
+
console.print(f"[bold cyan]{'='*70}[/bold cyan]")
|
31
|
+
console.print()
|
32
|
+
|
33
|
+
def run_morning_briefing():
|
34
|
+
"""Main function to run morning briefing"""
|
35
|
+
try:
|
36
|
+
display_banner()
|
37
|
+
|
38
|
+
# Initialize components
|
39
|
+
console.print("[dim]Initializing business agent...[/dim]")
|
40
|
+
agent = BusinessAgent()
|
41
|
+
task_mgr = TaskManager()
|
42
|
+
planner = BusinessPlanner()
|
43
|
+
|
44
|
+
# Get yesterday's summary
|
45
|
+
console.print("[dim]Analyzing yesterday's performance...[/dim]")
|
46
|
+
yesterday_summary = task_mgr.get_yesterday_summary()
|
47
|
+
|
48
|
+
# Get today's tasks
|
49
|
+
console.print("[dim]Loading today's tasks...[/dim]")
|
50
|
+
today_tasks = task_mgr.get_tasks_for_today()
|
51
|
+
|
52
|
+
# Get active goals
|
53
|
+
console.print("[dim]Checking goal progress...[/dim]")
|
54
|
+
active_goals = planner.get_active_goals()
|
55
|
+
|
56
|
+
# Get overdue tasks
|
57
|
+
overdue_tasks = task_mgr.get_overdue_tasks()
|
58
|
+
|
59
|
+
console.print()
|
60
|
+
|
61
|
+
# Display quick stats
|
62
|
+
console.print("[bold]📊 Quick Stats:[/bold]")
|
63
|
+
console.print(f" • Yesterday: {yesterday_summary['tasks_completed']}/{yesterday_summary['tasks_due']} tasks completed ({yesterday_summary['completion_rate']:.0%})")
|
64
|
+
console.print(f" • Today: {len(today_tasks)} tasks scheduled")
|
65
|
+
console.print(f" • Active goals: {len(active_goals)}")
|
66
|
+
if overdue_tasks:
|
67
|
+
console.print(f" • [yellow]⚠️ {len(overdue_tasks)} overdue tasks[/yellow]")
|
68
|
+
console.print()
|
69
|
+
|
70
|
+
# Generate AI briefing
|
71
|
+
console.print("[dim]Generating personalized briefing...[/dim]")
|
72
|
+
briefing = agent.morning_briefing(
|
73
|
+
tasks_today=today_tasks,
|
74
|
+
yesterday_summary=yesterday_summary,
|
75
|
+
business_context="See active goals below",
|
76
|
+
goals=active_goals
|
77
|
+
)
|
78
|
+
|
79
|
+
# Display the briefing
|
80
|
+
console.print(Panel(
|
81
|
+
Markdown(briefing),
|
82
|
+
title="🤖 Your Daily Briefing",
|
83
|
+
border_style="blue",
|
84
|
+
padding=(1, 2)
|
85
|
+
))
|
86
|
+
|
87
|
+
# Display today's task list
|
88
|
+
if today_tasks:
|
89
|
+
console.print()
|
90
|
+
console.print("[bold]📋 Today's Task List:[/bold]")
|
91
|
+
console.print()
|
92
|
+
|
93
|
+
# Sort by priority
|
94
|
+
sorted_tasks = sorted(today_tasks, key=lambda t: t.priority)
|
95
|
+
|
96
|
+
for i, task in enumerate(sorted_tasks[:10], 1):
|
97
|
+
priority_emoji = {1: "🔴", 2: "🟠", 3: "🟡", 4: "🟢", 5: "🔵"}.get(task.priority, "⚪")
|
98
|
+
status_emoji = {"pending": "⏳", "in_progress": "🔄", "blocked": "🚧"}.get(task.status, "❓")
|
99
|
+
|
100
|
+
task_line = f"{i}. {priority_emoji} {status_emoji} {task.title}"
|
101
|
+
|
102
|
+
if task.estimated_hours:
|
103
|
+
task_line += f" [dim]({task.estimated_hours}h)[/dim]"
|
104
|
+
|
105
|
+
if task.category:
|
106
|
+
task_line += f" [dim italic]#{task.category}[/dim italic]"
|
107
|
+
|
108
|
+
console.print(f" {task_line}")
|
109
|
+
|
110
|
+
# Display overdue tasks if any
|
111
|
+
if overdue_tasks:
|
112
|
+
console.print()
|
113
|
+
console.print("[bold yellow]⚠️ Overdue Tasks:[/bold yellow]")
|
114
|
+
for task in overdue_tasks[:5]:
|
115
|
+
console.print(f" • {task.title} [dim](Due: {task.due_date.strftime('%m/%d')})[/dim]")
|
116
|
+
|
117
|
+
console.print()
|
118
|
+
console.print("[bold green]✨ Have a productive day! ✨[/bold green]")
|
119
|
+
console.print()
|
120
|
+
|
121
|
+
# Cleanup
|
122
|
+
task_mgr.close()
|
123
|
+
planner.close()
|
124
|
+
|
125
|
+
except Exception as e:
|
126
|
+
console.print(f"[bold red]❌ Error generating briefing:[/bold red] {e}")
|
127
|
+
import traceback
|
128
|
+
console.print(traceback.format_exc())
|
129
|
+
sys.exit(1)
|
130
|
+
|
131
|
+
if __name__ == "__main__":
|
132
|
+
run_morning_briefing()
|