devstuff 2.8.0__py3-none-any.whl → 2.9.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.
@@ -21,7 +21,7 @@ def _write_file_preview(args: dict[str, Any], ws: Workspace) -> Panel:
21
21
  except SandboxError:
22
22
  # The sandbox will reject this before it runs; show the raw request rather
23
23
  # than crashing the prompt.
24
- return Panel(str(args.get("path", "")), title="write_file", border_style="yellow")
24
+ return Panel(str(args.get("path", "")), title="write_file", border_style=ui.AMBER)
25
25
 
26
26
  new = args.get("content", "")
27
27
  old = path.read_text(encoding="utf-8", errors="replace") if path.exists() else ""
@@ -29,7 +29,7 @@ def _write_file_preview(args: dict[str, Any], ws: Workspace) -> Panel:
29
29
 
30
30
  if not path.exists():
31
31
  body = Syntax(new, "text", theme="monokai", line_numbers=False, word_wrap=True)
32
- return Panel(body, title=f"create {label}", border_style="green")
32
+ return Panel(body, title=f"create {label}", border_style=ui.GREEN)
33
33
 
34
34
  diff = "".join(
35
35
  difflib.unified_diff(
@@ -41,11 +41,11 @@ def _write_file_preview(args: dict[str, Any], ws: Workspace) -> Panel:
41
41
  )
42
42
  )
43
43
  if not diff:
44
- return Panel("(no change)", title=f"write {label}", border_style="dim")
44
+ return Panel("(no change)", title=f"write {label}", border_style=ui.BORDER)
45
45
  return Panel(
46
46
  Syntax(diff, "diff", theme="monokai", line_numbers=False),
47
47
  title=f"edit {label}",
48
- border_style="yellow",
48
+ border_style=ui.AMBER,
49
49
  )
50
50
 
51
51
 
@@ -59,11 +59,11 @@ def preview(tool: AgentTool, args: dict[str, Any], ws: Workspace) -> Panel:
59
59
  return Panel(
60
60
  Syntax(str(args.get("command", "")), "bash", theme="monokai", line_numbers=False),
61
61
  title=f"run in {ws.display(ws.cwd)}",
62
- border_style="yellow",
62
+ border_style=ui.AMBER,
63
63
  )
64
64
 
65
65
  rendered = "\n".join(f"{k}: {v}" for k, v in args.items()) or "(no arguments)"
66
- return Panel(rendered, title=tool.key, border_style="yellow")
66
+ return Panel(rendered, title=tool.key, border_style=ui.AMBER)
67
67
 
68
68
 
69
69
  class ApprovalPolicy:
dev_setup/agent/loop.py CHANGED
@@ -67,7 +67,8 @@ def execute(session, call: ToolCall) -> ToolOutcome:
67
67
  call.name, False, "the user declined this action. Ask what they would prefer."
68
68
  )
69
69
  else:
70
- ui.dim(f"↳ {call.name}({', '.join(f'{k}={v!r}' for k, v in args.items())[:120]})")
70
+ preview = ", ".join(f"{k}={v!r}" for k, v in args.items())[:120]
71
+ ui.console.print(f" [{ui.CYAN}]▸[/] [{ui.GRAY}]{call.name}({preview})[/]")
71
72
 
72
73
  try:
73
74
  output = _dispatch(session, tool, args)
@@ -122,7 +123,9 @@ def run_turn(session, user_text: str) -> Message | None:
122
123
  }
123
124
  )
124
125
  if not outcome.ok:
125
- ui.dim(f" {outcome.content.splitlines()[0][:120]}")
126
+ ui.console.print(
127
+ f" [{ui.AMBER}]▸[/] [{ui.GRAY}]{outcome.content.splitlines()[0][:120]}[/]"
128
+ )
126
129
 
127
130
  ui.warn(f"Stopped after {session.config.max_iterations} tool calls without a final answer.")
128
131
  ui.dim("Ask again with a narrower request, or /reset to start over.")
@@ -91,16 +91,19 @@ def render(reply: Message | None) -> None:
91
91
  return
92
92
  if reply.content.strip():
93
93
  ui.console.print()
94
- ui.console.print(Markdown(reply.content.strip()))
94
+ ui.console.print(ui.gutter(Markdown(reply.content.strip())))
95
95
  ui.console.print()
96
96
 
97
97
 
98
98
  def _print_banner(session: AgentSession) -> None:
99
99
  ui.section("devstuff agent")
100
- ui.dim(f"model {session.model}")
101
- ui.dim(f"host {session.client.host}")
102
- ui.dim(f"workspace {session.workspace.root}")
103
- ui.dim(f"tools {len(session.tools)} available")
100
+ for key, value in (
101
+ ("model", session.model),
102
+ ("host", session.client.host),
103
+ ("workspace", str(session.workspace.root)),
104
+ ("tools", f"{len(session.tools)} available"),
105
+ ):
106
+ ui.console.print(f" [{ui.PURPLE}]{key:<10}[/] [{ui.GRAY}]{value}[/]")
104
107
  if session.policy.yolo:
105
108
  ui.console.print()
106
109
  ui.warn("--yolo: mutating tools run without confirmation (the denylist still applies).")
@@ -121,7 +124,7 @@ def _print_slash_help() -> None:
121
124
 
122
125
  def _print_tools(session: AgentSession) -> None:
123
126
  for key, tool in sorted(session.tools.items()):
124
- marker = "[yellow]![/]" if tool.mutating else " "
127
+ marker = f"[{ui.AMBER}]![/]" if tool.mutating else " "
125
128
  ui.console.print(f" {marker} [bold cyan]{key:<18}[/] [dim]{tool.description[:70]}[/]")
126
129
  ui.console.print()
127
130
  ui.dim("! = mutating, asks for confirmation before running")
@@ -151,15 +154,15 @@ def _summarise(message: dict[str, Any]) -> str | None:
151
154
  if role == "system":
152
155
  return None
153
156
  if role == "user":
154
- return f"[bold]you[/] {str(message.get('content', ''))[:80]}"
157
+ return f"[{ui.PURPLE} bold]you[/] {str(message.get('content', ''))[:80]}"
155
158
  if role == "tool":
156
159
  first = str(message.get("content", "")).splitlines()[:1]
157
- return f"[dim]tool[/] {message.get('tool_name', '?')} → {(first[0] if first else '')[:60]}"
160
+ return f"[{ui.GRAY}]tool[/] {message.get('tool_name', '?')} → {(first[0] if first else '')[:60]}"
158
161
  calls = message.get("tool_calls") or []
159
162
  if calls:
160
163
  names = ", ".join(c["function"]["name"] for c in calls)
161
- return f"[cyan]agent[/] calls {names}"
162
- return f"[cyan]agent[/] {str(message.get('content', ''))[:80]}"
164
+ return f"[{ui.CYAN}]agent[/] calls {names}"
165
+ return f"[{ui.CYAN}]agent[/] {str(message.get('content', ''))[:80]}"
163
166
 
164
167
 
165
168
  def _print_history(session: AgentSession) -> None:
@@ -282,6 +285,22 @@ def _continuation(width: int, line_number: int, is_soft_wrap: bool) -> str:
282
285
  return " " * max(0, width - 2) + "› "
283
286
 
284
287
 
288
+ def _prompt_style():
289
+ """prompt_toolkit theme: violet prompt glyph, dark-violet completion menu."""
290
+ from prompt_toolkit.styles import Style as PTStyle
291
+
292
+ return PTStyle.from_dict({
293
+ "prompt": f"{ui.PURPLE} bold",
294
+ "completion-menu": "bg:#26223B #DDD6FE",
295
+ "completion-menu.completion": "bg:#26223B #DDD6FE",
296
+ "completion-menu.completion.current": f"bg:{ui.VIOLET} #FFFFFF bold",
297
+ "completion-menu.meta.completion": f"bg:#26223B {ui.GRAY}",
298
+ "completion-menu.meta.completion.current": "bg:#7C3AED #DDD6FE",
299
+ "scrollbar.background": "bg:#26223B",
300
+ "scrollbar.button": "bg:#4B4568",
301
+ })
302
+
303
+
285
304
  def build_prompt_session(session: AgentSession, **overrides):
286
305
  """Split out from run_repl so the input behaviour can be driven by tests with a
287
306
  pipe input rather than only exercised by hand."""
@@ -297,6 +316,7 @@ def build_prompt_session(session: AgentSession, **overrides):
297
316
  "multiline": True,
298
317
  "key_bindings": _key_bindings(),
299
318
  "prompt_continuation": _continuation,
319
+ "style": _prompt_style(),
300
320
  }
301
321
  kwargs.update(overrides)
302
322
  return PromptSession(**kwargs)
@@ -308,9 +328,11 @@ def run_repl(session: AgentSession) -> None:
308
328
 
309
329
  _print_banner(session)
310
330
 
331
+ from prompt_toolkit.formatted_text import HTML
332
+
311
333
  while True:
312
334
  try:
313
- line = prompt_session.prompt("you ❯ ").strip()
335
+ line = prompt_session.prompt(HTML("<prompt>you ❯</prompt> ")).strip()
314
336
  except KeyboardInterrupt:
315
337
  continue # Ctrl-C clears the current line, like a shell
316
338
  except EOFError:
@@ -124,11 +124,11 @@ def add_cmd() -> None:
124
124
  )
125
125
 
126
126
  ui.console.print()
127
- ui.console.print("[bold]Summary[/]")
127
+ ui.heading("Summary")
128
128
  for k, v in kwargs.items():
129
129
  if v:
130
130
  display = _truncate_script(v) if k.endswith("_script") else v
131
- ui.console.print(f" [dim]{k:<18}[/] {display}")
131
+ ui.console.print(f" [{ui.PURPLE}]{k:<18}[/] {display}")
132
132
  ui.console.print()
133
133
 
134
134
  if not ui.confirm("Save this package?"):
@@ -101,11 +101,14 @@ def _is_installed(key: str) -> bool:
101
101
 
102
102
  def _print_list() -> None:
103
103
  ui.console.print()
104
- ui.console.print(" [bold]CONFIGURABLE TOOLS[/]")
105
- width = max(len(s.key) for s in configure.CONFIGURATORS.values()) + 2
104
+ tbl = ui.table(title="[bold]configurable tools[/]")
105
+ tbl.add_column("", width=2, justify="center")
106
+ tbl.add_column("Tool", style="bold cyan", no_wrap=True)
107
+ tbl.add_column("Description", ratio=1)
106
108
  for spec in configure.CONFIGURATORS.values():
107
- mark = "[green]✔[/]" if _is_installed(spec.key) else "[dim]·[/]"
108
- ui.console.print(f" {mark} [bold cyan]{spec.key:<{width}}[/] {spec.description}")
109
+ mark = f"[{ui.GREEN}]●[/]" if _is_installed(spec.key) else f"[{ui.GRAY}]○[/]"
110
+ tbl.add_row(mark, spec.key, spec.description)
111
+ ui.console.print(tbl)
109
112
  ui.console.print()
110
113
  ui.dim(" devstuff configure <tool>")
111
114
  ui.console.print()
@@ -25,7 +25,7 @@ def docs_cmd(package: str) -> None:
25
25
  sys.exit(1)
26
26
 
27
27
  ui.console.print(f"\n [bold]{tool.name}[/] docs")
28
- ui.console.print(f" [cyan]{tool.docs_url}[/]\n")
28
+ ui.console.print(f" [cyan underline link={tool.docs_url}]{tool.docs_url}[/]\n")
29
29
 
30
30
  opened = webbrowser.open(tool.docs_url)
31
31
  if opened:
@@ -7,11 +7,12 @@ import click
7
7
  from dev_setup import doctor, ui
8
8
 
9
9
  _STATUS_ICON = {
10
- doctor.PASS: "[green bold]✔[/]",
11
- doctor.WARN: "[yellow bold]⚠[/]",
12
- doctor.FAIL: "[red bold]✖[/]",
10
+ doctor.PASS: f"[{ui.GREEN} bold]✔[/]",
11
+ doctor.WARN: f"[{ui.AMBER} bold]⚠[/]",
12
+ doctor.FAIL: f"[{ui.RED} bold]✖[/]",
13
13
  }
14
- _STATUS_LABEL = {doctor.PASS: "pass", doctor.WARN: "warn", doctor.FAIL: "FAIL"}
14
+ # pass needs no text label — the icon carries it. warn/fail get one for scanability.
15
+ _STATUS_LABEL = {doctor.WARN: ui.AMBER, doctor.FAIL: ui.RED}
15
16
 
16
17
 
17
18
  @click.command("doctor")
@@ -32,8 +33,11 @@ def doctor_cmd(auto_fix: bool, check_only: bool) -> None:
32
33
  fixable: list[doctor.CheckResult] = []
33
34
  for r in results:
34
35
  icon = _STATUS_ICON.get(r.status, "[dim]?[/]")
35
- label = _STATUS_LABEL.get(r.status, r.status)
36
- ui.console.print(f" {icon} [bold]{r.name}[/] [dim]({label})[/] {r.message}")
36
+ line = f" {icon} [bold]{r.name}[/] {r.message}"
37
+ color = _STATUS_LABEL.get(r.status)
38
+ if color:
39
+ line += f" [{color} bold]{r.status.upper()}[/]"
40
+ ui.console.print(line)
37
41
  if r.detail:
38
42
  ui.dim(f" {r.detail}")
39
43
  if r.status != doctor.PASS and r.fix is not None:
@@ -42,9 +46,19 @@ def doctor_cmd(auto_fix: bool, check_only: bool) -> None:
42
46
  passed = sum(1 for r in results if r.status == doctor.PASS)
43
47
  warned = sum(1 for r in results if r.status == doctor.WARN)
44
48
  failed = sum(1 for r in results if r.status == doctor.FAIL)
49
+
50
+ def _count(n: int, color: str, word: str) -> str:
51
+ style = color if n else ui.GRAY
52
+ return f"[{style}]{n} {word}[/]"
53
+
45
54
  ui.console.print()
46
55
  ui.console.print(
47
- f" [dim]{passed} passed, {warned} warning(s), {failed} failure(s)[/]"
56
+ " "
57
+ + " · ".join([
58
+ _count(passed, ui.GREEN, "passed"),
59
+ _count(warned, ui.AMBER, "warnings"),
60
+ _count(failed, ui.RED, "failed"),
61
+ ])
48
62
  )
49
63
 
50
64
  if check_only or not fixable:
@@ -26,17 +26,21 @@ def list_cmd() -> None:
26
26
  for f in fns:
27
27
  by_cat.setdefault(f.category, []).append(f)
28
28
 
29
- key_width = max((len(f.key) for f in fns), default=12) + 2
30
29
  for cat in sorted(by_cat, key=lambda c: (c == "custom", c)):
31
- ui.console.print(f"\n [bold]{cat.upper()}[/]")
32
- for f in sorted(by_cat[cat], key=lambda f: f.key):
30
+ entries = sorted(by_cat[cat], key=lambda f: f.key)
31
+ tbl = ui.table(
32
+ title=f"[bold]{cat}[/] [{ui.GRAY}]{len(entries)} function(s)[/]"
33
+ )
34
+ tbl.add_column("Function", style="bold cyan", no_wrap=True)
35
+ tbl.add_column("Type", style=ui.CYAN, no_wrap=True)
36
+ tbl.add_column("Args", style=ui.GRAY, no_wrap=True)
37
+ tbl.add_column("Description", ratio=1)
38
+ for f in entries:
33
39
  mode = f.type if f.type == "script" else f"{f.type} ({f.register})"
34
- ui.console.print(
35
- f" [bold cyan]{f.key:<{key_width}}[/] [dim]{mode:<22}[/] {f.description}"
36
- )
37
40
  params = " ".join(f"<{p.name}>" for p in f.params)
38
- if params:
39
- ui.dim(f" args: {params}")
41
+ tbl.add_row(f.key, mode, params, f.description)
42
+ ui.console.print(tbl)
43
+ ui.console.print()
40
44
 
41
45
 
42
46
  @functions_cmd.command("enable")
@@ -1,6 +1,18 @@
1
+ from rich.columns import Columns
2
+ from rich.text import Text
3
+
1
4
  from dev_setup import ui
2
5
  from dev_setup.catalog import USER_CATALOG_PATH
3
6
 
7
+ _CATEGORY_DESC = {
8
+ "core": "Always-installed tools (Docker, NVM, uv)",
9
+ "tools": "Optional utilities (lazygit, htop, bat)",
10
+ "ai-tools": "AI coding agents and assistants",
11
+ "customization": "Prompt and shell customization",
12
+ "languages": "Programming language runtimes",
13
+ "custom": "User-added packages",
14
+ }
15
+
4
16
 
5
17
  def print_help() -> None:
6
18
  ui.print_banner()
@@ -26,10 +38,15 @@ def print_help() -> None:
26
38
  ("agent", "[--setup] [--dir] [--model]", "Chat with a local tool-using model"),
27
39
  ("version", "", "Show version"),
28
40
  ]
41
+ tbl = ui.table(bordered=False, show_header=False)
42
+ tbl.add_column("cmd", style="bold cyan", no_wrap=True)
43
+ tbl.add_column("args", style=ui.GRAY, no_wrap=True)
44
+ tbl.add_column("desc", ratio=1)
29
45
  for cmd, args, desc in rows:
30
- ui.console.print(
31
- f" [bold cyan]{cmd:<10}[/] [dim]{args:<40}[/] {desc}"
32
- )
46
+ # args goes in as Text: strings like "[category]" are valid Rich markup
47
+ # tags and would be silently swallowed from a plain str cell.
48
+ tbl.add_row(f" {cmd}", Text(args), desc)
49
+ ui.console.print(tbl)
33
50
 
34
51
  ui.console.print()
35
52
  ui.console.print("[bold]EXAMPLES[/]")
@@ -58,15 +75,24 @@ def print_help() -> None:
58
75
  'devstuff agent --print "what node tools are available?"',
59
76
  "ssh-agent-key ~/.ssh/id_ed25519",
60
77
  ]
61
- for ex in examples:
62
- ui.console.print(f" [dim]$[/] [green]{ex}[/]")
78
+ items = [
79
+ Text.assemble((" $ ", ui.GRAY), (ex, "green")) for ex in examples
80
+ ]
81
+ ui.console.print(Columns(items, column_first=True, padding=(0, 3)))
82
+
83
+ from dev_setup import registry
63
84
 
64
85
  ui.console.print()
65
86
  ui.console.print("[bold]CATEGORIES[/]")
66
- ui.console.print(" [cyan]core[/] Always-installed tools (Docker, NVM, uv)")
67
- ui.console.print(" [cyan]tools[/] Optional utilities (PHP, Starship, htop)")
68
- ui.console.print(" [cyan]languages[/] Programming language runtimes")
69
- ui.console.print(" [cyan]custom[/] User-added packages\n")
87
+ _ORDER = {"core": 0, "tools": 1, "custom": 999}
88
+ cats = sorted(
89
+ {t.category for t in registry.all_tools()},
90
+ key=lambda c: (_ORDER.get(c, 500), c),
91
+ )
92
+ for cat in cats:
93
+ desc = _CATEGORY_DESC.get(cat, "")
94
+ ui.console.print(f" [cyan]{cat:<14}[/] [{ui.GRAY}]{desc}[/]")
70
95
 
96
+ ui.console.print()
71
97
  ui.console.print("[bold]CONFIG[/]")
72
- ui.console.print(f" User catalog: [dim]{USER_CATALOG_PATH}[/]\n")
98
+ ui.console.print(f" User catalog: [{ui.GRAY}]{USER_CATALOG_PATH}[/]\n")
@@ -106,7 +106,7 @@ def _install_interactive() -> None:
106
106
  else:
107
107
  disabled = None
108
108
  title = [
109
- ("class:check", "✔ " if is_inst else " "),
109
+ ("class:check", "● " if is_inst else " "),
110
110
  ("class:text", f"{t.key:<{key_width}}{desc}"),
111
111
  ]
112
112
  choices.append(questionary.Choice(
@@ -3,7 +3,6 @@ from __future__ import annotations
3
3
  from concurrent.futures import ThreadPoolExecutor
4
4
 
5
5
  import click
6
- from rich.table import Table
7
6
 
8
7
  from dev_setup import registry, ui
9
8
  from dev_setup.base import Tool
@@ -53,24 +52,26 @@ def list_cmd(show_filter: str, category: str) -> None:
53
52
  if not entries:
54
53
  continue
55
54
 
56
- ui.console.print(f" [bold magenta]{cat.upper()}[/]")
57
- ui.divider()
58
-
59
- tbl = Table(box=None, padding=(0, 1), show_header=True, header_style="dim")
60
- tbl.add_column("", width=2)
61
- tbl.add_column("Package", style="bold", min_width=12)
62
- tbl.add_column("Description", min_width=36)
63
- tbl.add_column("Type", style="dim", min_width=8)
64
- tbl.add_column("Version", style="dim")
55
+ n_inst = sum(1 for _, is_inst, _ in entries if is_inst)
56
+ tbl = ui.table(
57
+ title=f"[bold]{cat}[/] [{ui.GRAY}]{n_inst}/{len(entries)} installed[/]"
58
+ )
59
+ tbl.add_column("", width=2, justify="center")
60
+ tbl.add_column("Package", style="bold", no_wrap=True)
61
+ tbl.add_column("Description", ratio=1)
62
+ tbl.add_column("Type", style=ui.CYAN, no_wrap=True)
63
+ tbl.add_column("Version", style=ui.GRAY, no_wrap=True, max_width=28, overflow="ellipsis")
65
64
 
66
65
  for tool, is_inst, version in entries:
67
- missing = registry.missing_requires(tool) if not is_inst else []
68
- icon = "[green bold]✔[/]" if is_inst else "[red bold]✘[/]"
69
- tbl.add_row(icon, tool.key, tool.description, tool.install_type, version)
66
+ icon = f"[{ui.GREEN}]●[/]" if is_inst else f"[{ui.GRAY}]○[/]"
67
+ desc = tool.description
70
68
  if tool.help_cmd:
71
- tbl.add_row("", "", f"[dim cyan] ? {tool.help_cmd}[/]", "", "")
72
- if missing:
73
- tbl.add_row("", "", f"[yellow] ⚠ requires: {', '.join(missing)}[/]", "", "")
69
+ desc += f"\n[{ui.GRAY}] ↳ {tool.help_cmd}[/]"
70
+ if not is_inst:
71
+ missing = registry.missing_requires(tool)
72
+ if missing:
73
+ desc += f"\n[{ui.AMBER}] ⚠ requires: {', '.join(missing)}[/]"
74
+ tbl.add_row(icon, tool.key, desc, tool.install_type, version)
74
75
 
75
76
  ui.console.print(tbl)
76
77
  ui.console.print()
dev_setup/ui.py CHANGED
@@ -5,73 +5,156 @@ from contextlib import contextmanager
5
5
 
6
6
  import questionary
7
7
  from questionary import Style as QStyle
8
- from rich.console import Console
8
+ from rich import box
9
+ from rich.color import Color
10
+ from rich.console import Console, RenderableType
9
11
  from rich.panel import Panel
10
12
  from rich.rule import Rule
13
+ from rich.syntax import Syntax
14
+ from rich.table import Table
11
15
  from rich.text import Text
12
16
 
13
17
  console = Console(highlight=False)
14
18
 
19
+ # ── palette ───────────────────────────────────────────────────────────────────
20
+ # A violet→cyan accent ramp over neutral grays. Everything visible keys off these
21
+ # constants so the theme lives in exactly one place.
22
+ VIOLET = "#7C3AED"
23
+ PURPLE = "#A78BFA"
24
+ CYAN = "#22D3EE"
25
+ GREEN = "#34D399"
26
+ AMBER = "#FBBF24"
27
+ RED = "#F87171"
28
+ GRAY = "#6B7280"
29
+ BORDER = "#4B4568" # muted violet — boxes, rules, table frames
30
+
15
31
  _STYLE = QStyle([
16
- ("qmark", "fg:#7C3AED bold"),
32
+ ("qmark", f"fg:{CYAN} bold"),
17
33
  ("question", "bold"),
18
- ("answer", "fg:#A78BFA bold"),
19
- ("pointer", "fg:#7C3AED bold"),
20
- ("highlighted", "fg:#A78BFA bold"),
21
- ("selected", "fg:#A78BFA"),
22
- ("separator", "fg:#6B7280"),
23
- ("instruction", "fg:#6B7280 italic"),
24
- ("check", "fg:#22C55E bold"),
34
+ ("answer", f"fg:{PURPLE} bold"),
35
+ ("pointer", f"fg:{VIOLET} bold"),
36
+ ("highlighted", f"fg:{PURPLE} bold"),
37
+ ("selected", f"fg:{CYAN}"),
38
+ ("separator", f"fg:{PURPLE}"),
39
+ ("instruction", f"fg:{GRAY} italic"),
40
+ ("check", f"fg:{GREEN} bold"),
41
+ ("disabled", f"fg:{GRAY} italic"),
25
42
  ])
26
43
 
44
+ # Left-edge-only border — the chat-block look (a coloured gutter bar, no frame).
45
+ LEFT_BAR = box.Box(
46
+ " \n"
47
+ "┃ \n"
48
+ "┃ \n"
49
+ "┃ \n"
50
+ "┃ \n"
51
+ "┃ \n"
52
+ "┃ \n"
53
+ " \n"
54
+ )
55
+
56
+ # Rounded outer frame + header underline, no column dividers — the frame carries
57
+ # the structure without turning every row into a grid.
58
+ ROUNDED_OPEN = box.Box(
59
+ "╭──╮\n"
60
+ "│ │\n"
61
+ "├──┤\n"
62
+ "│ │\n"
63
+ "├──┤\n"
64
+ "├──┤\n"
65
+ "│ │\n"
66
+ "╰──╯\n"
67
+ )
68
+
69
+
70
+ def gradient(text: str, start: str = VIOLET, end: str = CYAN) -> Text:
71
+ """Render `text` in bold with a per-character colour ramp from `start` to `end`."""
72
+ c1 = Color.parse(start).triplet
73
+ c2 = Color.parse(end).triplet
74
+ out = Text()
75
+ n = max(len(text) - 1, 1)
76
+ for i, ch in enumerate(text):
77
+ r = round(c1.red + (c2.red - c1.red) * i / n)
78
+ g = round(c1.green + (c2.green - c1.green) * i / n)
79
+ b = round(c1.blue + (c2.blue - c1.blue) * i / n)
80
+ out.append(ch, style=f"bold #{r:02x}{g:02x}{b:02x}")
81
+ return out
82
+
27
83
 
28
84
  def info(msg: str) -> None:
29
- console.print(f" [cyan bold]❯[/] {msg}")
85
+ console.print(f" [{CYAN} bold]❯[/] {msg}")
30
86
 
31
87
 
32
88
  def success(msg: str) -> None:
33
- console.print(f" [green bold]✔[/] {msg}")
89
+ console.print(f" [{GREEN} bold]✔[/] {msg}")
34
90
 
35
91
 
36
92
  def warn(msg: str) -> None:
37
- console.print(f" [yellow bold]⚠[/] {msg}")
93
+ console.print(f" [{AMBER} bold]⚠[/] {msg}")
38
94
 
39
95
 
40
96
  def error(msg: str) -> None:
41
- console.print(f" [red bold]✖[/] {msg}")
97
+ console.print(f" [{RED} bold]✖[/] {msg}")
42
98
 
43
99
 
44
100
  def dim(msg: str) -> None:
45
- console.print(f" [dim]{msg}[/]")
101
+ console.print(f" [{GRAY}]{msg}[/]")
46
102
 
47
103
 
48
104
  def section(title: str) -> None:
49
105
  console.print()
50
- console.print(
51
- Panel(f"[bold]{title}[/]", border_style="bright_magenta", expand=False, padding=(0, 1))
52
- )
106
+ console.print(Panel(gradient(title), border_style=VIOLET, expand=False, padding=(0, 1)))
53
107
  console.print()
54
108
 
55
109
 
110
+ def heading(title: str, note: str = "") -> None:
111
+ """A labelled rule: `── title ────────` with an optional dim annotation."""
112
+ text = f"[bold {PURPLE}]{title}[/]"
113
+ if note:
114
+ text += f" [{GRAY}]{note}[/]"
115
+ console.print(Rule(text, style=BORDER, align="left"))
116
+
117
+
56
118
  def divider() -> None:
57
- console.print(Rule(style="dim"))
119
+ console.print(Rule(style=BORDER))
58
120
 
59
121
 
60
122
  def print_banner() -> None:
61
123
  from dev_setup import __version__
62
- t = Text()
63
- t.append(" dev", style="bold bright_magenta")
64
- t.append("-", style="dim")
65
- t.append("setup", style="bold white")
66
- t.append(f" v{__version__}", style="dim")
124
+ t = gradient("devstuff")
125
+ t.append(f" v{__version__}", style=GRAY)
67
126
  console.print()
68
- console.print(Panel(t, border_style="bright_magenta", padding=(0, 2), expand=False))
127
+ console.print(Panel(t, border_style=VIOLET, padding=(0, 2), expand=False))
69
128
  console.print()
70
129
 
71
130
 
131
+ def table(title: str = "", *, bordered: bool = True, **kwargs) -> Table:
132
+ """The shared table look: rounded muted-violet frame, purple headers.
133
+
134
+ `title` may contain markup and renders left-justified above the frame.
135
+ `bordered=False` drops the frame for contexts (like --help) where a box
136
+ would be chrome for its own sake. Extra kwargs pass through to `Table`.
137
+ """
138
+ return Table(
139
+ box=ROUNDED_OPEN if bordered else None,
140
+ border_style=BORDER,
141
+ title=title or None,
142
+ title_justify="left",
143
+ header_style=f"bold {PURPLE}",
144
+ padding=(0, 1),
145
+ pad_edge=bordered,
146
+ **kwargs,
147
+ )
148
+
149
+
150
+ def gutter(renderable: RenderableType, style: str = VIOLET) -> Panel:
151
+ """Wrap `renderable` in a panel with only a coloured left bar."""
152
+ return Panel(renderable, box=LEFT_BAR, border_style=style, padding=(0, 1))
153
+
154
+
72
155
  @contextmanager
73
156
  def spinner(label: str) -> Generator[None, None, None]:
74
- with console.status(f" [dim]{label}[/]", spinner="dots"):
157
+ with console.status(f" [{GRAY}]{label}[/]", spinner="arc", spinner_style=PURPLE):
75
158
  yield
76
159
 
77
160
 
@@ -131,11 +214,10 @@ def password(prompt: str) -> str:
131
214
 
132
215
  def code_block(code: str, language: str = "bash") -> None:
133
216
  """Print a syntax-highlighted code panel."""
134
- from rich.syntax import Syntax
135
217
  console.print(
136
218
  Panel(
137
219
  Syntax(code, language, theme="monokai", line_numbers=False),
138
- border_style="dim",
220
+ border_style=BORDER,
139
221
  padding=(0, 1),
140
222
  )
141
223
  )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: devstuff
3
- Version: 2.8.0
3
+ Version: 2.9.0
4
4
  Summary: Development environment setup CLI for Linux
5
5
  Project-URL: Repository, https://github.com/thesawdawg/dev-setup-py
6
6
  Author-email: Sawyer <sawyerksu@gmail.com>
@@ -930,7 +930,7 @@ devstuff agent --print "which node tools do I have?" # one-shot, non-interacti
930
930
  ```
931
931
  you ❯ create a python project called xyz-project with a hello world main.py
932
932
 
933
- ↳ run_command(command='mkdir xyz-project')
933
+ ▸ run_command(command='mkdir xyz-project')
934
934
 
935
935
  ╭─ run in ./xyz-project ──────────────────────╮
936
936
  │ mkdir xyz-project │
@@ -18,36 +18,36 @@ dev_setup/links_catalog.py,sha256=Xe7s9oqiCrfQPUwE-X9o6p5VkU7mH9PjY9NMyn6VbHg,46
18
18
  dev_setup/links_registry.py,sha256=xyq49oH1u_CX85UcizKSuxuy_pzurNoDwSRg3YftUMY,2439
19
19
  dev_setup/registry.py,sha256=8lrk6EXCCWk1WNeNnCGLTJ-v8rpCs7-TLYtVXgiuxnA,2243
20
20
  dev_setup/tools.yaml,sha256=m2MEYq_mZuzEU8vCJgPWHdhLuqRjQGNWheqhwQgMXXQ,34234
21
- dev_setup/ui.py,sha256=1xto3lVmc-98oa92yHEoXwpYZfFHKAE8DEOGGwz2h4M,4155
21
+ dev_setup/ui.py,sha256=AFK78bzhWzICnoOkM0h-T6j4DYBA3MEBkBf4j-ExkoE,7009
22
22
  dev_setup/verbose.py,sha256=N3U9JAYOvFwdd8DT6W7Pqq6RCIUfbcQnPsm0O1TnvQY,5003
23
23
  dev_setup/agent/__init__.py,sha256=znrgxUCr_y0Qp-f41S6EaTv-hoTYwoZ9mOMLVge-IJg,226
24
- dev_setup/agent/approval.py,sha256=R2YnbR1fauGtV7-NW5dH1QvWvNHjR3l23DKRTCiqpEE,3625
24
+ dev_setup/agent/approval.py,sha256=DNPV5iM_UpCx39xFzCu8kyr03tjfyfD7iVcTfQMJRwY,3630
25
25
  dev_setup/agent/bridges.py,sha256=RX5coPXJUSkyZApxgUZghz_57ibcPrWHVz3D44S6z2Q,4814
26
26
  dev_setup/agent/catalog.py,sha256=-5SbDxlT_W8PHoFRJA905eJ9aIe6cHtNrAtZJcImwkY,6304
27
27
  dev_setup/agent/completion.py,sha256=BhreXV0MwyMejAFmXe6gX6h64nTH713RIy-Dy0KK-Ig,1854
28
28
  dev_setup/agent/config.py,sha256=a0vagUWyKd1MOBsdJeNGVRlAGZdqfozPRNJyNxXN16Q,5970
29
- dev_setup/agent/loop.py,sha256=xvcpom52ea-dbag3_nVxk375BMvxZCm7Qlb9a9QCPfU,4835
29
+ dev_setup/agent/loop.py,sha256=PKmGokOkKNLcwaSlnZ0v8XhwIx0N4t1Zj6Ia1kSflNM,4982
30
30
  dev_setup/agent/ollama.py,sha256=B1YfJQQzdF5hagd3Q_6rGe82IISwolhP-zMZh_7DN1o,8774
31
31
  dev_setup/agent/preflight.py,sha256=pTaDqrwGI99b5WedU4ujyggTEcrUZmBh4mo8UYrMYd4,3463
32
32
  dev_setup/agent/primitives.py,sha256=g8WuzQZuqLU-Nv_XlLBcsOVsrBku-_5yWRHEXD5i4ZY,3714
33
33
  dev_setup/agent/registry.py,sha256=Glj7VM-L4ttVYK9YtX63jvsrnU6Rr7-GN0RdqsJjaio,5368
34
34
  dev_setup/agent/sandbox.py,sha256=wS_9kwc6r0spKSX8CBJFDkhWSiVG60D8dCKBrKbVnYA,10891
35
- dev_setup/agent/session.py,sha256=KxBBbFFvO5bBbDJ6H94O7tgtrQ2i5kGq6EsXCHaDvPo,11761
35
+ dev_setup/agent/session.py,sha256=1UB0Mxz-cflDHqOfj1PFzufb1yz1ECbcObXIPubZfMU,12654
36
36
  dev_setup/agent/transcript.py,sha256=hJQuSLriAe5hvnD3SCMqOWduuYtblyhmqzZQ3jDco1Y,1868
37
37
  dev_setup/agent/wizard.py,sha256=p0vHiJ-palTMoL6p7zQscL01laBFKw9f5HHY1yemZ4w,4056
38
38
  dev_setup/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
39
- dev_setup/commands/add_cmd.py,sha256=dqgagwBDkeK47RTnIREf0PlXjfLHQpxjdQ0kHJqLqDE,12290
39
+ dev_setup/commands/add_cmd.py,sha256=BEPaSqdhDgP_mev4-WqYhqA31tUfhhfBj-68qG6xoJE,12283
40
40
  dev_setup/commands/agent_cmd.py,sha256=TtsCzNVXgwxS2ACFLFl6ibnjoohEQWXgM2rfWkBnKk0,5128
41
41
  dev_setup/commands/catalog_cmd.py,sha256=dz_0UfZy3v622sbJ4AWiNftZr6yYtsjaBQw1z7UF4Lk,1002
42
- dev_setup/commands/configure_cmd.py,sha256=-6UQhrcdEpf6AecDfGq7otq2G4rqdeRPjJUV1lze2Zg,3738
42
+ dev_setup/commands/configure_cmd.py,sha256=0aAhSraqePKqtmg1t0D4XxLzYFQXDqL3GPW66RMgg7Y,3822
43
43
  dev_setup/commands/delete_cmd.py,sha256=j_-fr2RMaeX3sMhH-7wJP5KC9Yvpgbb9KIeEEyG9ODQ,995
44
- dev_setup/commands/docs_cmd.py,sha256=1PtpwdFO3LrAxG3HyCLFn5SXVnnwqcJ8K_c9cVd8Phc,940
45
- dev_setup/commands/doctor_cmd.py,sha256=8HqQ9sB3aVDKer6jbqN_Eq0XKZDXM2o48L6_vL8JAcE,3161
46
- dev_setup/commands/functions_cmd.py,sha256=D9JRYMRavXbROz0XRGjHRHeFvZY-GKyvRCctJODQDBE,2856
47
- dev_setup/commands/help_cmd.py,sha256=AmX9vv3U7sFb6Zby3crhUUSqkLsW7DekOSn-3iShedk,3482
48
- dev_setup/commands/install_cmd.py,sha256=AGrB0CZPT6hZ0Cnn9AgmlyFkW8F1wZufuXVvwYft_Xo,4610
44
+ dev_setup/commands/docs_cmd.py,sha256=JXhusKUl4dD-U5jG-PLTon_2NCpAWWnaBqsmlFk7vLY,971
45
+ dev_setup/commands/doctor_cmd.py,sha256=sPhxLMVxy1JOxdFklRQHIwCoJeB-nmGWzVs5yeza9a8,3568
46
+ dev_setup/commands/functions_cmd.py,sha256=4HvdLXle9JGk70A1EDVZrlgTo-N-FyAO7ApaL8mcJYI,3023
47
+ dev_setup/commands/help_cmd.py,sha256=YksB8ddy_fR8ZXscs2QU6ODVl6R6V2eeJlpoBVNSH4Y,4352
48
+ dev_setup/commands/install_cmd.py,sha256=0mUEdZQWPgXuK4_5aVhGZOadQYM1JhFZjl-biRHjSf4,4610
49
49
  dev_setup/commands/links_cmd.py,sha256=kvnoBXdM9QWRZRIwWgnmWqVkOYE7AZxywFTQD5_Uwv4,4924
50
- dev_setup/commands/list_cmd.py,sha256=-BAywXxpSm4-VAlysLzlDwIqvmk_zBKhmzEObM8jigo,2847
50
+ dev_setup/commands/list_cmd.py,sha256=Env6bwAmREDek4L-ZB2CIfvLT4PgaKcz5sQKJ1GhL8g,2913
51
51
  dev_setup/commands/remove_cmd.py,sha256=_KqCa2S9fQFngLUs_OpBzjkIkFKgDtKup4gQ5TqLrVI,1239
52
52
  dev_setup/commands/run_cmd.py,sha256=e1xfWt09UALiAe03AxzdvZyYpj0V7WKk2-E_nbk9hIw,2933
53
53
  dev_setup/commands/skills_cmd.py,sha256=j4rleYEW4lt-O2ssDwGyhwmk2Wiip64C4Z7iPT6c3y0,7482
@@ -97,7 +97,7 @@ dev_setup/configure/starship/model.py,sha256=HNkIj69DqBQFAq0VTHqPLNZT2DuBZSfF-5y
97
97
  dev_setup/configure/starship/preview.py,sha256=ZaNhNA3AeHHtPnMqrJbB9XVVXDFbH1R36jm8xyYdt2U,6145
98
98
  dev_setup/configure/starship/render.py,sha256=gDE0hbGZ9oDCR1VAZQRDm5EFYviMjj0-eSmr1EnZfn8,10262
99
99
  dev_setup/configure/starship/wizard.py,sha256=BmWl-U6ttF79gepDhCv8UxT8ZDIMe1SWnhSkA1iIrGQ,15498
100
- devstuff-2.8.0.dist-info/METADATA,sha256=hwvper3UptnHHogbvhnebLKYvtwAZ7LjY_lfw4EbtCM,77775
101
- devstuff-2.8.0.dist-info/WHEEL,sha256=W3fkpkm7-wf9vBI5Z-7s0eWkeM-spu78I8Neb98DeEg,87
102
- devstuff-2.8.0.dist-info/entry_points.txt,sha256=48ITy9ENdXDFrTHwAyVPUpq1MDmgFqcOisOo5mAR6OQ,53
103
- devstuff-2.8.0.dist-info/RECORD,,
100
+ devstuff-2.9.0.dist-info/METADATA,sha256=oQ8bqM-CdbRiJ_Tnwgieb-HZMskubJ6W_rBc9N-W4Ao,77775
101
+ devstuff-2.9.0.dist-info/WHEEL,sha256=W3fkpkm7-wf9vBI5Z-7s0eWkeM-spu78I8Neb98DeEg,87
102
+ devstuff-2.9.0.dist-info/entry_points.txt,sha256=48ITy9ENdXDFrTHwAyVPUpq1MDmgFqcOisOo5mAR6OQ,53
103
+ devstuff-2.9.0.dist-info/RECORD,,