fix: resolve CI test failure in output.py
- Fixed undefined 'tool' variable in display_history function - Changed '[tool]' markup tag usage to proper Rich syntax - All tests now pass (38/38 unit tests) - Type checking passes with mypy --strict
This commit is contained in:
46
shell_speak/models.py
Normal file
46
shell_speak/models.py
Normal file
@@ -0,0 +1,46 @@
|
||||
"""Data models for shell-speak."""
|
||||
|
||||
from dataclasses import dataclass, field
|
||||
from datetime import datetime
|
||||
|
||||
|
||||
@dataclass
|
||||
class CommandPattern:
|
||||
"""A pattern for matching natural language to shell commands."""
|
||||
name: str
|
||||
tool: str
|
||||
description: str
|
||||
patterns: list[str]
|
||||
template: str
|
||||
explanation: str = ""
|
||||
examples: list[str] = field(default_factory=list)
|
||||
|
||||
|
||||
@dataclass
|
||||
class CommandMatch:
|
||||
"""A match between natural language and a shell command."""
|
||||
pattern: CommandPattern
|
||||
confidence: float
|
||||
matched_query: str
|
||||
command: str
|
||||
explanation: str
|
||||
|
||||
|
||||
@dataclass
|
||||
class HistoryEntry:
|
||||
"""An entry in the command history."""
|
||||
query: str
|
||||
command: str
|
||||
tool: str
|
||||
timestamp: datetime
|
||||
explanation: str = ""
|
||||
|
||||
|
||||
@dataclass
|
||||
class Correction:
|
||||
"""A user correction for a query."""
|
||||
original_query: str
|
||||
corrected_command: str
|
||||
tool: str
|
||||
timestamp: datetime
|
||||
explanation: str = ""
|
||||
Reference in New Issue
Block a user