nexus-tui 0.1.14__py3-none-any.whl → 0.1.15__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.
- nexus/config.py +9 -1
- nexus/screens/create_project.py +0 -4
- nexus/screens/help.py +5 -4
- nexus/screens/project_picker.py +24 -3
- nexus/screens/tool_selector.py +113 -371
- nexus/state.py +6 -2
- nexus/style.tcss +69 -20
- nexus/widgets/footer.py +108 -0
- nexus/widgets/tool_browser.py +253 -0
- nexus/widgets/tool_list_item.py +4 -8
- nexus_tui-0.1.15.dist-info/METADATA +200 -0
- nexus_tui-0.1.15.dist-info/RECORD +28 -0
- nexus_tui-0.1.14.dist-info/METADATA +0 -150
- nexus_tui-0.1.14.dist-info/RECORD +0 -26
- {nexus_tui-0.1.14.dist-info → nexus_tui-0.1.15.dist-info}/WHEEL +0 -0
- {nexus_tui-0.1.14.dist-info → nexus_tui-0.1.15.dist-info}/entry_points.txt +0 -0
- {nexus_tui-0.1.14.dist-info → nexus_tui-0.1.15.dist-info}/licenses/LICENSE +0 -0
nexus/config.py
CHANGED
|
@@ -63,8 +63,11 @@ def _load_config_data() -> dict[str, Any]:
|
|
|
63
63
|
if "project_root" in data:
|
|
64
64
|
merged_data["project_root"] = data["project_root"]
|
|
65
65
|
|
|
66
|
-
except
|
|
66
|
+
except (tomllib.TOMLDecodeError, PermissionError) as e:
|
|
67
67
|
CONFIG_ERRORS.append(f"Error in {path.name}: {e}")
|
|
68
|
+
except Exception as e:
|
|
69
|
+
# Catch-all for other unexpected IO errors
|
|
70
|
+
CONFIG_ERRORS.append(f"Unexpected error reading {path.name}: {e}")
|
|
68
71
|
|
|
69
72
|
for path in CONFIG_PATHS:
|
|
70
73
|
merge_from_file(path)
|
|
@@ -109,11 +112,16 @@ def get_tools() -> list[Tool]:
|
|
|
109
112
|
Returns:
|
|
110
113
|
A list of Tool objects.
|
|
111
114
|
"""
|
|
115
|
+
from pydantic import ValidationError
|
|
116
|
+
|
|
112
117
|
tools = []
|
|
113
118
|
config = _load_config_data()
|
|
114
119
|
for t in config.get("tool", []):
|
|
115
120
|
try:
|
|
116
121
|
tools.append(Tool(**t))
|
|
122
|
+
except ValidationError as e:
|
|
123
|
+
# Pydantic validation error
|
|
124
|
+
CONFIG_ERRORS.append(f"Invalid tool definition (Validation): {e}")
|
|
117
125
|
except Exception as e:
|
|
118
126
|
CONFIG_ERRORS.append(f"Invalid tool definition: {e}")
|
|
119
127
|
continue
|
nexus/screens/create_project.py
CHANGED
nexus/screens/help.py
CHANGED
|
@@ -41,10 +41,11 @@ class HelpScreen(ModalScreen[None]):
|
|
|
41
41
|
- Type any character to start searching tools.
|
|
42
42
|
- `Esc` : Clear search or Go Back.
|
|
43
43
|
|
|
44
|
-
**
|
|
45
|
-
- `Ctrl+
|
|
46
|
-
- `Ctrl+
|
|
47
|
-
-
|
|
44
|
+
**Actions**
|
|
45
|
+
- `Ctrl+F` : Toggle Favorite
|
|
46
|
+
- `Ctrl+T` : Open Theme Picker
|
|
47
|
+
- `Ctrl+C` : Quit Application
|
|
48
|
+
- `Ctrl+H` or `?` : Show this Help Screen
|
|
48
49
|
"""
|
|
49
50
|
)
|
|
50
51
|
|
nexus/screens/project_picker.py
CHANGED
|
@@ -10,10 +10,11 @@ from nexus.config import get_project_root
|
|
|
10
10
|
from nexus.models import Project, Tool
|
|
11
11
|
from typing import Any
|
|
12
12
|
from nexus.widgets.tool_list_item import ProjectListItem
|
|
13
|
+
from nexus.widgets.footer import NexusFooter, KeyBadge
|
|
13
14
|
from textual.app import ComposeResult
|
|
14
15
|
from textual.containers import Container
|
|
15
16
|
from textual.screen import Screen
|
|
16
|
-
from textual.widgets import
|
|
17
|
+
from textual.widgets import Header, Input, Label, ListItem, ListView, LoadingIndicator
|
|
17
18
|
from thefuzz import process
|
|
18
19
|
|
|
19
20
|
|
|
@@ -43,6 +44,8 @@ class ProjectPicker(Screen[None]):
|
|
|
43
44
|
("down", "cursor_down", "Next Item"),
|
|
44
45
|
("up", "cursor_up", "Previous Item"),
|
|
45
46
|
("enter", "select_current", "Select"),
|
|
47
|
+
("ctrl+b", "back", "Back"),
|
|
48
|
+
("ctrl+c", "quit", "Quit"),
|
|
46
49
|
]
|
|
47
50
|
|
|
48
51
|
def compose(self) -> ComposeResult:
|
|
@@ -63,7 +66,11 @@ class ProjectPicker(Screen[None]):
|
|
|
63
66
|
yield Label(
|
|
64
67
|
"No projects found", id="projects-empty", classes="empty-state hidden"
|
|
65
68
|
)
|
|
66
|
-
yield
|
|
69
|
+
yield NexusFooter(key_defs=[
|
|
70
|
+
("Enter", "Select", "select_current"),
|
|
71
|
+
("Ctrl+B", "Back", "back"),
|
|
72
|
+
("Ctrl+C", "Quit", "quit"),
|
|
73
|
+
])
|
|
67
74
|
|
|
68
75
|
async def on_mount(self) -> None:
|
|
69
76
|
"""Called when the screen is mounted.
|
|
@@ -247,4 +254,18 @@ class ProjectPicker(Screen[None]):
|
|
|
247
254
|
"""Selects the currently highlighted item."""
|
|
248
255
|
project_list = self.query_one("#project-list", ListView)
|
|
249
256
|
if project_list.index is not None:
|
|
250
|
-
self._select_item(project_list.children[project_list.index])
|
|
257
|
+
self._select_item(project_list.children[project_list.index])
|
|
258
|
+
|
|
259
|
+
def action_back(self) -> None:
|
|
260
|
+
"""Go back to the previous screen."""
|
|
261
|
+
self.app.pop_screen()
|
|
262
|
+
|
|
263
|
+
def on_key_badge_pressed(self, message: KeyBadge.Pressed) -> None:
|
|
264
|
+
"""Handle footer clicks."""
|
|
265
|
+
action = message.action
|
|
266
|
+
if action == "select_current":
|
|
267
|
+
self.action_select_current()
|
|
268
|
+
elif action == "back":
|
|
269
|
+
self.action_back()
|
|
270
|
+
elif action == "quit":
|
|
271
|
+
self.app.exit()
|