dbagent-cli 0.8.4__tar.gz → 0.8.6__tar.gz
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.
- {dbagent_cli-0.8.4 → dbagent_cli-0.8.6}/PKG-INFO +1 -1
- {dbagent_cli-0.8.4 → dbagent_cli-0.8.6}/dbagent/__init__.py +1 -1
- {dbagent_cli-0.8.4 → dbagent_cli-0.8.6}/dbagent/cli.py +5 -0
- {dbagent_cli-0.8.4 → dbagent_cli-0.8.6}/dbagent/ui/chat_screen.py +16 -17
- {dbagent_cli-0.8.4 → dbagent_cli-0.8.6}/dbagent/ui/console.py +1 -1
- {dbagent_cli-0.8.4 → dbagent_cli-0.8.6}/dbagent_cli.egg-info/PKG-INFO +1 -1
- {dbagent_cli-0.8.4 → dbagent_cli-0.8.6}/pyproject.toml +1 -1
- {dbagent_cli-0.8.4 → dbagent_cli-0.8.6}/README.md +0 -0
- {dbagent_cli-0.8.4 → dbagent_cli-0.8.6}/dbagent/agent/confidence.py +0 -0
- {dbagent_cli-0.8.4 → dbagent_cli-0.8.6}/dbagent/agent/conversation.py +0 -0
- {dbagent_cli-0.8.4 → dbagent_cli-0.8.6}/dbagent/agent/doctor.py +0 -0
- {dbagent_cli-0.8.4 → dbagent_cli-0.8.6}/dbagent/agent/error_classifier.py +0 -0
- {dbagent_cli-0.8.4 → dbagent_cli-0.8.6}/dbagent/agent/generator.py +0 -0
- {dbagent_cli-0.8.4 → dbagent_cli-0.8.6}/dbagent/agent/pipeline.py +0 -0
- {dbagent_cli-0.8.4 → dbagent_cli-0.8.6}/dbagent/agent/recommender.py +0 -0
- {dbagent_cli-0.8.4 → dbagent_cli-0.8.6}/dbagent/agent/validator.py +0 -0
- {dbagent_cli-0.8.4 → dbagent_cli-0.8.6}/dbagent/config.py +0 -0
- {dbagent_cli-0.8.4 → dbagent_cli-0.8.6}/dbagent/connectors/base.py +0 -0
- {dbagent_cli-0.8.4 → dbagent_cli-0.8.6}/dbagent/connectors/factory.py +0 -0
- {dbagent_cli-0.8.4 → dbagent_cli-0.8.6}/dbagent/connectors/mongo.py +0 -0
- {dbagent_cli-0.8.4 → dbagent_cli-0.8.6}/dbagent/connectors/relational.py +0 -0
- {dbagent_cli-0.8.4 → dbagent_cli-0.8.6}/dbagent/execution/__init__.py +0 -0
- {dbagent_cli-0.8.4 → dbagent_cli-0.8.6}/dbagent/execution/cache.py +0 -0
- {dbagent_cli-0.8.4 → dbagent_cli-0.8.6}/dbagent/execution/changeset.py +0 -0
- {dbagent_cli-0.8.4 → dbagent_cli-0.8.6}/dbagent/execution/cost.py +0 -0
- {dbagent_cli-0.8.4 → dbagent_cli-0.8.6}/dbagent/execution/recovery.py +0 -0
- {dbagent_cli-0.8.4 → dbagent_cli-0.8.6}/dbagent/execution/sandbox.py +0 -0
- {dbagent_cli-0.8.4 → dbagent_cli-0.8.6}/dbagent/execution/streaming.py +0 -0
- {dbagent_cli-0.8.4 → dbagent_cli-0.8.6}/dbagent/llm/anthropic_provider.py +0 -0
- {dbagent_cli-0.8.4 → dbagent_cli-0.8.6}/dbagent/llm/auto_setup.py +0 -0
- {dbagent_cli-0.8.4 → dbagent_cli-0.8.6}/dbagent/llm/base.py +0 -0
- {dbagent_cli-0.8.4 → dbagent_cli-0.8.6}/dbagent/llm/deepseek_provider.py +0 -0
- {dbagent_cli-0.8.4 → dbagent_cli-0.8.6}/dbagent/llm/factory.py +0 -0
- {dbagent_cli-0.8.4 → dbagent_cli-0.8.6}/dbagent/llm/gemini_provider.py +0 -0
- {dbagent_cli-0.8.4 → dbagent_cli-0.8.6}/dbagent/llm/groq_provider.py +0 -0
- {dbagent_cli-0.8.4 → dbagent_cli-0.8.6}/dbagent/llm/mistral_provider.py +0 -0
- {dbagent_cli-0.8.4 → dbagent_cli-0.8.6}/dbagent/llm/mock_provider.py +0 -0
- {dbagent_cli-0.8.4 → dbagent_cli-0.8.6}/dbagent/llm/ollama_provider.py +0 -0
- {dbagent_cli-0.8.4 → dbagent_cli-0.8.6}/dbagent/llm/openai_provider.py +0 -0
- {dbagent_cli-0.8.4 → dbagent_cli-0.8.6}/dbagent/llm/openrouter_provider.py +0 -0
- {dbagent_cli-0.8.4 → dbagent_cli-0.8.6}/dbagent/schema/cache.py +0 -0
- {dbagent_cli-0.8.4 → dbagent_cli-0.8.6}/dbagent/schema/formatter.py +0 -0
- {dbagent_cli-0.8.4 → dbagent_cli-0.8.6}/dbagent/schema/graph.py +0 -0
- {dbagent_cli-0.8.4 → dbagent_cli-0.8.6}/dbagent/schema/models.py +0 -0
- {dbagent_cli-0.8.4 → dbagent_cli-0.8.6}/dbagent/schema/retriever.py +0 -0
- {dbagent_cli-0.8.4 → dbagent_cli-0.8.6}/dbagent/schema/selector.py +0 -0
- {dbagent_cli-0.8.4 → dbagent_cli-0.8.6}/dbagent/security/__init__.py +0 -0
- {dbagent_cli-0.8.4 → dbagent_cli-0.8.6}/dbagent/security/audit.py +0 -0
- {dbagent_cli-0.8.4 → dbagent_cli-0.8.6}/dbagent/security/environment.py +0 -0
- {dbagent_cli-0.8.4 → dbagent_cli-0.8.6}/dbagent/security/masking.py +0 -0
- {dbagent_cli-0.8.4 → dbagent_cli-0.8.6}/dbagent/security/modes.py +0 -0
- {dbagent_cli-0.8.4 → dbagent_cli-0.8.6}/dbagent/security/rbac.py +0 -0
- {dbagent_cli-0.8.4 → dbagent_cli-0.8.6}/dbagent/semantic/__init__.py +0 -0
- {dbagent_cli-0.8.4 → dbagent_cli-0.8.6}/dbagent/semantic/dictionary.py +0 -0
- {dbagent_cli-0.8.4 → dbagent_cli-0.8.6}/dbagent/semantic/templates.py +0 -0
- {dbagent_cli-0.8.4 → dbagent_cli-0.8.6}/dbagent/sql/__init__.py +0 -0
- {dbagent_cli-0.8.4 → dbagent_cli-0.8.6}/dbagent/sql/optimizer.py +0 -0
- {dbagent_cli-0.8.4 → dbagent_cli-0.8.6}/dbagent/sql/validator.py +0 -0
- {dbagent_cli-0.8.4 → dbagent_cli-0.8.6}/dbagent/ui/grid_window.py +0 -0
- {dbagent_cli-0.8.4 → dbagent_cli-0.8.6}/dbagent/ui/viewer.py +0 -0
- {dbagent_cli-0.8.4 → dbagent_cli-0.8.6}/dbagent/ui/visualizer.py +0 -0
- {dbagent_cli-0.8.4 → dbagent_cli-0.8.6}/dbagent_cli.egg-info/SOURCES.txt +0 -0
- {dbagent_cli-0.8.4 → dbagent_cli-0.8.6}/dbagent_cli.egg-info/dependency_links.txt +0 -0
- {dbagent_cli-0.8.4 → dbagent_cli-0.8.6}/dbagent_cli.egg-info/entry_points.txt +0 -0
- {dbagent_cli-0.8.4 → dbagent_cli-0.8.6}/dbagent_cli.egg-info/requires.txt +0 -0
- {dbagent_cli-0.8.4 → dbagent_cli-0.8.6}/dbagent_cli.egg-info/top_level.txt +0 -0
- {dbagent_cli-0.8.4 → dbagent_cli-0.8.6}/setup.cfg +0 -0
- {dbagent_cli-0.8.4 → dbagent_cli-0.8.6}/tests/test_cache.py +0 -0
- {dbagent_cli-0.8.4 → dbagent_cli-0.8.6}/tests/test_cli.py +0 -0
- {dbagent_cli-0.8.4 → dbagent_cli-0.8.6}/tests/test_connectors.py +0 -0
- {dbagent_cli-0.8.4 → dbagent_cli-0.8.6}/tests/test_direct_sql.py +0 -0
- {dbagent_cli-0.8.4 → dbagent_cli-0.8.6}/tests/test_doctor_and_viz.py +0 -0
- {dbagent_cli-0.8.4 → dbagent_cli-0.8.6}/tests/test_generator.py +0 -0
- {dbagent_cli-0.8.4 → dbagent_cli-0.8.6}/tests/test_graph.py +0 -0
- {dbagent_cli-0.8.4 → dbagent_cli-0.8.6}/tests/test_providers.py +0 -0
- {dbagent_cli-0.8.4 → dbagent_cli-0.8.6}/tests/test_recovery.py +0 -0
- {dbagent_cli-0.8.4 → dbagent_cli-0.8.6}/tests/test_safety.py +0 -0
- {dbagent_cli-0.8.4 → dbagent_cli-0.8.6}/tests/test_sandbox.py +0 -0
- {dbagent_cli-0.8.4 → dbagent_cli-0.8.6}/tests/test_schema.py +0 -0
- {dbagent_cli-0.8.4 → dbagent_cli-0.8.6}/tests/test_security.py +0 -0
- {dbagent_cli-0.8.4 → dbagent_cli-0.8.6}/tests/test_semantic.py +0 -0
|
@@ -525,7 +525,10 @@ def chat_command(
|
|
|
525
525
|
|
|
526
526
|
def _get_bottom_toolbar():
|
|
527
527
|
curr_model = model or getattr(llm, "default_model", "default")
|
|
528
|
+
width = min(console.width or 100, 120)
|
|
529
|
+
rule = "─" * (width - 1)
|
|
528
530
|
return HTML(
|
|
531
|
+
f"<ansidarkgray>{rule}</ansidarkgray>\n"
|
|
529
532
|
f" <style class='bottom-toolbar.green'>● Connected:</style> <b>{db_name}</b> <i>({dialect} • {len(table_names)} tables)</i> │ "
|
|
530
533
|
f"<style class='bottom-toolbar.cyan'>🤖 AI:</style> <b>{curr_model}</b> │ "
|
|
531
534
|
f"<style class='bottom-toolbar.yellow'>🛡️ {current_mode.value}</style> │ "
|
|
@@ -534,6 +537,8 @@ def chat_command(
|
|
|
534
537
|
|
|
535
538
|
while True:
|
|
536
539
|
try:
|
|
540
|
+
width = min(console.width or 100, 120)
|
|
541
|
+
console.print(f"[dim cyan]{'─' * (width - 1)}[/dim cyan]")
|
|
537
542
|
user_input = session.prompt(
|
|
538
543
|
HTML("<ansicyan><b>❯</b></ansicyan> "),
|
|
539
544
|
bottom_toolbar=_get_bottom_toolbar,
|
|
@@ -91,13 +91,12 @@ def render_chat_header(
|
|
|
91
91
|
|
|
92
92
|
|
|
93
93
|
def render_user_turn(user_prompt: str) -> None:
|
|
94
|
-
"""Render a user
|
|
95
|
-
user_text = Text()
|
|
96
|
-
user_text.append("💬 You: ", style="bold blue")
|
|
97
|
-
user_text.append(user_prompt, style="bold white")
|
|
94
|
+
"""Render a clean highlighted user prompt bar like Claude Code."""
|
|
98
95
|
console.print("")
|
|
99
|
-
|
|
100
|
-
|
|
96
|
+
prompt_text = Text()
|
|
97
|
+
prompt_text.append("❯ ", style="bold cyan")
|
|
98
|
+
prompt_text.append(f"{user_prompt}", style="bold white")
|
|
99
|
+
console.print(Panel(prompt_text, box=None, style="on grey15", padding=(0, 1)))
|
|
101
100
|
|
|
102
101
|
|
|
103
102
|
def render_assistant_turn(
|
|
@@ -107,38 +106,38 @@ def render_assistant_turn(
|
|
|
107
106
|
ai_model: Optional[str] = None,
|
|
108
107
|
) -> None:
|
|
109
108
|
"""Render the assistant response card with SQL, data grid, and execution timing."""
|
|
109
|
+
timing_str = f"⚡ {result.execution_time_ms / 1000:.2f}s" if result.execution_time_ms > 0 else ""
|
|
110
|
+
|
|
110
111
|
if result.is_direct_sql and result.retries == 0:
|
|
111
|
-
agent_title = "[bold cyan]
|
|
112
|
+
agent_title = f"[bold cyan]● DB-Agent[/bold cyan] [dim](Direct SQL • 0 tokens · {timing_str})[/dim]"
|
|
112
113
|
else:
|
|
113
114
|
model_display = f" ({ai_model})" if ai_model else ""
|
|
114
|
-
agent_title = f"[bold cyan]
|
|
115
|
-
|
|
116
|
-
timing_str = f"⚡ {result.execution_time_ms / 1000:.2f}s" if result.execution_time_ms > 0 else ""
|
|
115
|
+
agent_title = f"[bold cyan]● DB-Agent{model_display}[/bold cyan] [dim]{timing_str}[/dim]"
|
|
117
116
|
|
|
118
117
|
# Conversational Chat Response
|
|
119
118
|
if result.is_chat and result.message:
|
|
120
|
-
console.print(f"\n{agent_title}
|
|
119
|
+
console.print(f"\n{agent_title}")
|
|
121
120
|
console.print(Markdown(result.message))
|
|
122
121
|
console.print("")
|
|
123
122
|
return
|
|
124
123
|
|
|
125
124
|
# Error Response
|
|
126
125
|
if result.error:
|
|
127
|
-
console.print(f"\n[bold red]
|
|
126
|
+
console.print(f"\n[bold red]● DB-Agent (Error)[/bold red] [dim]{timing_str}[/dim]")
|
|
128
127
|
if result.friendly_error:
|
|
129
|
-
|
|
128
|
+
console.print(f" [dim]└[/dim] [bold yellow]{result.friendly_error}[/bold yellow]")
|
|
130
129
|
else:
|
|
131
|
-
|
|
130
|
+
console.print(f" [dim]└[/dim] [bold red]{result.error}[/bold red]")
|
|
132
131
|
|
|
133
132
|
if result.error_suggestions:
|
|
134
|
-
console.print(f"[dim]Did you mean: {', '.join(result.error_suggestions)}[/dim]")
|
|
133
|
+
console.print(f" [dim]└ Did you mean: {', '.join(result.error_suggestions)}[/dim]")
|
|
135
134
|
|
|
136
135
|
if result.sql:
|
|
137
|
-
console.print("[dim]Generated SQL:[/dim]")
|
|
136
|
+
console.print(" [dim]Generated SQL:[/dim]")
|
|
138
137
|
syntax = Syntax(result.sql.strip(), "sql", theme="monokai", line_numbers=False)
|
|
139
138
|
console.print(Panel(syntax, border_style="red", padding=(0, 1)))
|
|
140
139
|
if result.retries > 0:
|
|
141
|
-
console.print(f"[dim](Retried {result.retries} time(s))[/dim]")
|
|
140
|
+
console.print(f" [dim]└ (Retried {result.retries} time(s))[/dim]")
|
|
142
141
|
console.print("")
|
|
143
142
|
return
|
|
144
143
|
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "dbagent-cli"
|
|
7
|
-
version = "0.8.
|
|
7
|
+
version = "0.8.6"
|
|
8
8
|
description = "Enterprise AI Database Copilot, Schema Graph Introspector & Autonomous Recovery Agent (CLI)"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.9"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|