|
16 | 16 |
|
17 | 17 | import argparse |
18 | 18 | import asyncio |
19 | | -from datetime import datetime |
20 | 19 | import json |
21 | 20 | import sys |
22 | 21 | import threading |
| 22 | +from datetime import datetime |
23 | 23 | from pathlib import Path |
24 | 24 | from typing import Optional |
25 | 25 |
|
|
39 | 39 | from vulcanai.console.widget_spinner import SpinnerStatus |
40 | 40 | from vulcanai.core.plan_types import GlobalPlan |
41 | 41 |
|
| 42 | + |
42 | 43 | class TextualLogSink: |
43 | 44 | """A default console that prints to standard output.""" |
44 | 45 |
|
@@ -175,7 +176,7 @@ def __init__( |
175 | 176 | self.suggestion_index_changed = threading.Event() |
176 | 177 | # Log creation files |
177 | 178 | now = datetime.now() |
178 | | - self.execution_time = now.strftime('%Y-%m-%d-%H-%M') |
| 179 | + self.execution_time = now.strftime("%Y-%m-%d-%H-%M") |
179 | 180 |
|
180 | 181 | async def on_mouse_down(self, event: MouseEvent) -> None: |
181 | 182 | """ |
@@ -407,21 +408,23 @@ def save_history_log(self, output_dir: Path | str = None) -> Optional[Path]: |
407 | 408 | # Log tittle |
408 | 409 | log_lines = [ |
409 | 410 | "╔" + "═" * 78 + "╗", |
410 | | - f"║ VulcanAI Console Session History".ljust(79) + "║", |
| 411 | + "║ VulcanAI Console Session History".ljust(79) + "║", |
411 | 412 | f"║ Execution Time: {self.execution_time}".ljust(79) + "║", |
412 | 413 | "╚" + "═" * 78 + "╝", |
413 | | - "" |
| 414 | + "", |
414 | 415 | ] |
415 | 416 |
|
416 | 417 | # Add queries from manager history |
417 | | - if self.manager and hasattr(self.manager, 'history') and self.manager.history: |
| 418 | + if self.manager and hasattr(self.manager, "history") and self.manager.history: |
418 | 419 | log_lines.append(f"Total Queries: {len(self.manager.history)}") |
419 | 420 | log_lines.append("-" * 48) |
420 | 421 | log_lines.append("") |
421 | 422 |
|
422 | 423 | for i, (user_text, plan_summary) in enumerate(self.manager.history, 1): |
423 | 424 | log_lines.append(f"Query #{i}") |
424 | | - log_lines.append(f" User Input: {user_text.split(chr(10))[-1] if chr(10) in user_text else user_text}") |
| 425 | + log_lines.append( |
| 426 | + f" User Input: {user_text.split(chr(10))[-1] if chr(10) in user_text else user_text}" |
| 427 | + ) |
425 | 428 | log_lines.append(f" Plan Summary: {plan_summary}") |
426 | 429 | log_lines.append("") |
427 | 430 | else: |
@@ -467,10 +470,7 @@ def save_plans_to_json(self, output_dir: Path | str = None) -> list[Path]: |
467 | 470 | plan_dict = plan.model_dump() |
468 | 471 |
|
469 | 472 | # Save to file |
470 | | - filepath.write_text( |
471 | | - json.dumps(plan_dict, indent=2), |
472 | | - encoding="utf-8" |
473 | | - ) |
| 473 | + filepath.write_text(json.dumps(plan_dict, indent=2), encoding="utf-8") |
474 | 474 |
|
475 | 475 | saved_files.append(filepath) |
476 | 476 | self.logger.log_console(f"Saved plan {idx} to: {filepath}") |
@@ -503,7 +503,7 @@ def load_and_execute_plan(self, plan_file: Path | str) -> Optional[dict]: |
503 | 503 | plan = GlobalPlan.model_validate(plan_data) |
504 | 504 |
|
505 | 505 | self.logger.log_console(f"Loaded plan from: {plan_file}") |
506 | | - self.logger.log_console(f"Executing plan...") |
| 506 | + self.logger.log_console("Executing plan...") |
507 | 507 |
|
508 | 508 | # Execute the plan using the manager's executor and blackboard |
509 | 509 | result = self.manager.executor.run(plan, self.manager.bb) |
|
0 commit comments