bizy-ai 1.0.1__py3-none-any.whl → 1.1.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/cli.py +208 -12
- agent/models.py +23 -8
- agent/plan_manager.py +320 -0
- agent/tasks.py +98 -13
- agent/weekly_review.py +10 -10
- {bizy_ai-1.0.1.dist-info → bizy_ai-1.1.0.dist-info}/METADATA +52 -2
- bizy_ai-1.1.0.dist-info/RECORD +21 -0
- scripts/load_business_plan.py +110 -0
- scripts/migrate_db.py +40 -0
- scripts/scheduler.py +94 -0
- bizy_ai-1.0.1.dist-info/RECORD +0 -18
- scripts/agent_cli.py +0 -232
- {bizy_ai-1.0.1.dist-info → bizy_ai-1.1.0.dist-info}/WHEEL +0 -0
- {bizy_ai-1.0.1.dist-info → bizy_ai-1.1.0.dist-info}/entry_points.txt +0 -0
- {bizy_ai-1.0.1.dist-info → bizy_ai-1.1.0.dist-info}/licenses/LICENSE +0 -0
- {bizy_ai-1.0.1.dist-info → bizy_ai-1.1.0.dist-info}/top_level.txt +0 -0
scripts/agent_cli.py
DELETED
@@ -1,232 +0,0 @@
|
|
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()
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|