Skip to content

Commit

Permalink
fix: tweak the style
Browse files Browse the repository at this point in the history
  • Loading branch information
baxen committed Oct 3, 2024
1 parent 4b84c8b commit 4f436ed
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/goose/toolkit/developer.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
from rich.text import Text
from rich.rule import Rule

RULESTYLE = "bold"
RULEPREFIX = f"[{RULESTYLE}]───[/] "


def keep_unsafe_command_prompt(command: str) -> bool:
command_text = Text(command, style="bold red")
Expand Down Expand Up @@ -123,7 +126,7 @@ def patch_file(self, path: str, before: str, after: str) -> str:
{after}
```
"""
self.notifier.log(Rule(path, style="bold black"))
self.notifier.log(Rule(RULEPREFIX + path, style=RULESTYLE, align="left"))
self.notifier.log(Markdown(output))
return "Succesfully replaced before with after."

Expand Down Expand Up @@ -155,7 +158,7 @@ def shell(self, command: str) -> str:
if you need to run more than one at a time
"""
# Log the command being executed in a visually structured format (Markdown).
self.notifier.log(Rule("shell", style="bold black"))
self.notifier.log(Rule(RULEPREFIX + "shell", style=RULESTYLE, align="left"))
self.notifier.log(Markdown(f"```bash\n{command}\n```"))

if is_dangerous_command(command):
Expand Down Expand Up @@ -263,7 +266,7 @@ def write_file(self, path: str, content: str) -> str:
# Log the content that will be written to the file
# .log` method is used here to log the command execution in the application's UX
# this method is dynamically attached to functions in the Goose framework
self.notifier.log(Rule(path, style="bold black"))
self.notifier.log(Rule(RULEPREFIX + path, style=RULESTYLE, align="left"))
self.notifier.log(Markdown(md))

_path = Path(path)
Expand Down

0 comments on commit 4f436ed

Please sign in to comment.