nexus-tui 0.1.4__py3-none-any.whl → 0.1.5__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/__init__.py +1 -0
- nexus/app.py +106 -0
- nexus/config.py +197 -0
- nexus/container.py +45 -0
- nexus/logger.py +48 -0
- nexus/models.py +43 -0
- nexus/screens/__init__.py +0 -0
- nexus/screens/create_project.py +115 -0
- nexus/screens/error.py +57 -0
- nexus/screens/help.py +62 -0
- nexus/screens/project_picker.py +250 -0
- nexus/screens/theme_picker.py +101 -0
- nexus/screens/tool_selector.py +482 -0
- nexus/services/__init__.py +0 -0
- nexus/services/executor.py +46 -0
- nexus/services/scanner.py +46 -0
- nexus/state.py +84 -0
- nexus/style.tcss +489 -0
- nexus/widgets/__init__.py +0 -0
- nexus/widgets/tool_list_item.py +194 -0
- {nexus_tui-0.1.4.dist-info → nexus_tui-0.1.5.dist-info}/METADATA +1 -1
- nexus_tui-0.1.5.dist-info/RECORD +26 -0
- nexus_tui-0.1.4.dist-info/RECORD +0 -6
- {nexus_tui-0.1.4.dist-info → nexus_tui-0.1.5.dist-info}/WHEEL +0 -0
- {nexus_tui-0.1.4.dist-info → nexus_tui-0.1.5.dist-info}/entry_points.txt +0 -0
- {nexus_tui-0.1.4.dist-info → nexus_tui-0.1.5.dist-info}/licenses/LICENSE +0 -0
nexus/style.tcss
ADDED
|
@@ -0,0 +1,489 @@
|
|
|
1
|
+
/* Tokyo Night inspired theme base */
|
|
2
|
+
|
|
3
|
+
/* --- STRUCTURE --- */
|
|
4
|
+
|
|
5
|
+
/* App/Screen Layout */
|
|
6
|
+
Screen {
|
|
7
|
+
/* Default fallback */
|
|
8
|
+
background: #101010;
|
|
9
|
+
color: #c0caf5;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/* Header */
|
|
13
|
+
#header {
|
|
14
|
+
height: 4;
|
|
15
|
+
dock: top;
|
|
16
|
+
padding: 0 1;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
#header-left {
|
|
20
|
+
width: auto;
|
|
21
|
+
content-align: left middle;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
#tool-search {
|
|
25
|
+
width: 60%;
|
|
26
|
+
margin-left: 2;
|
|
27
|
+
background: transparent;
|
|
28
|
+
border: none;
|
|
29
|
+
color: #c0caf5;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
#tool-search:focus {
|
|
33
|
+
border: solid #7aa2f7;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
#tool-description {
|
|
37
|
+
height: 1;
|
|
38
|
+
content-align: center middle;
|
|
39
|
+
text-style: bold;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/* Main Container */
|
|
43
|
+
#main-container {
|
|
44
|
+
height: 1fr;
|
|
45
|
+
/* Borders defined in theme */
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/* Panes */
|
|
49
|
+
#left-pane {
|
|
50
|
+
width: 30%;
|
|
51
|
+
height: 100%;
|
|
52
|
+
/* Border defined in theme */
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
#right-pane {
|
|
56
|
+
width: 70%;
|
|
57
|
+
height: 100%;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.pane-header {
|
|
61
|
+
height: 1;
|
|
62
|
+
text-style: underline;
|
|
63
|
+
padding: 0 1;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.pane-header-container {
|
|
67
|
+
height: 1;
|
|
68
|
+
/* Border defined in theme */
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.pane-header-right {
|
|
72
|
+
width: 1fr;
|
|
73
|
+
content-align: right middle;
|
|
74
|
+
padding: 0 1;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/* Lists */
|
|
78
|
+
ListView {
|
|
79
|
+
border: none;
|
|
80
|
+
padding: 0 1;
|
|
81
|
+
height: 1fr;
|
|
82
|
+
scrollbar-gutter: stable;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
ListItem {
|
|
86
|
+
padding: 0 1;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.list-item {
|
|
90
|
+
height: 1;
|
|
91
|
+
padding: 0;
|
|
92
|
+
margin: 0;
|
|
93
|
+
background: transparent;
|
|
94
|
+
border: none;
|
|
95
|
+
transition: background 200ms; /* Smooth hover effect */
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.category-badge {
|
|
99
|
+
text-style: bold;
|
|
100
|
+
padding: 0 1;
|
|
101
|
+
margin-right: 1;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
#custom-footer {
|
|
105
|
+
height: 4;
|
|
106
|
+
dock: bottom;
|
|
107
|
+
padding: 0 1;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
.hidden {
|
|
112
|
+
display: none;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.empty-state {
|
|
116
|
+
text-style: italic;
|
|
117
|
+
color: #565f89;
|
|
118
|
+
content-align: center middle;
|
|
119
|
+
height: 1fr;
|
|
120
|
+
width: 1fr;
|
|
121
|
+
padding: 1;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
/* --- THEMES (SKINS) --- */
|
|
127
|
+
|
|
128
|
+
/* 1. DARK THEME */
|
|
129
|
+
.theme-dark {
|
|
130
|
+
background: #101010;
|
|
131
|
+
color: #c0caf5;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.theme-dark ListView,
|
|
135
|
+
.theme-dark ListItem {
|
|
136
|
+
background: #101010;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.theme-dark #header,
|
|
140
|
+
.theme-dark .pane-header,
|
|
141
|
+
.theme-dark #footer-container {
|
|
142
|
+
background: #101010;
|
|
143
|
+
color: #c0caf5;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.theme-dark #header-right,
|
|
147
|
+
.theme-dark .pane-header-container {
|
|
148
|
+
border-bottom: solid #c0caf5; /* Header-right is fully bordered? checking old code: border: solid */
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.theme-dark #header-right { border: solid #c0caf5; }
|
|
152
|
+
.theme-dark #main-container { border-top: solid #c0caf5; } /* removed bottom border */
|
|
153
|
+
.theme-dark #left-pane { border-right: solid #c0caf5; }
|
|
154
|
+
.theme-dark .pane-header-container { border-bottom: solid #c0caf5; }
|
|
155
|
+
.theme-dark #tool-description { color: #bb9af7; border-top: solid #c0caf5; }
|
|
156
|
+
|
|
157
|
+
/* Highlight - Dark (Only when list has focus OR it is the tool-list) */
|
|
158
|
+
.theme-dark ListView:focus > ListItem.--highlight,
|
|
159
|
+
.theme-dark #tool-list > ListItem.--highlight {
|
|
160
|
+
background: #ffff00;
|
|
161
|
+
color: #000000;
|
|
162
|
+
text-style: bold;
|
|
163
|
+
}
|
|
164
|
+
.theme-dark ListView:focus > ListItem.--highlight Label,
|
|
165
|
+
.theme-dark #tool-list > ListItem.--highlight Label,
|
|
166
|
+
.theme-dark ListView:focus > ListItem.--highlight .list-item,
|
|
167
|
+
.theme-dark #tool-list > ListItem.--highlight .list-item {
|
|
168
|
+
color: #000000;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/* Categories - Dark */
|
|
172
|
+
.theme-dark .category-DEV { color: #7aa2f7; }
|
|
173
|
+
.theme-dark .category-AI { color: #bb9af7; }
|
|
174
|
+
.theme-dark .category-MEDIA { color: #9ccc65; }
|
|
175
|
+
.theme-dark .category-UTIL { color: #ff9e64; }
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
/* 2. STORM THEME */
|
|
179
|
+
.theme-storm {
|
|
180
|
+
background: #24283b;
|
|
181
|
+
color: #c0caf5;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.theme-storm ListView,
|
|
185
|
+
.theme-storm ListItem {
|
|
186
|
+
background: #24283b;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.theme-storm #header,
|
|
190
|
+
.theme-storm .pane-header,
|
|
191
|
+
.theme-storm #footer-container {
|
|
192
|
+
background: #24283b;
|
|
193
|
+
color: #c0caf5;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.theme-storm #header-right { border: solid #c0caf5; }
|
|
197
|
+
.theme-storm #main-container { border-top: solid #c0caf5; } /* removed bottom border */
|
|
198
|
+
.theme-storm #left-pane { border-right: solid #c0caf5; }
|
|
199
|
+
.theme-storm .pane-header-container { border-bottom: solid #c0caf5; }
|
|
200
|
+
.theme-storm #tool-description { color: #bb9af7; border-top: solid #c0caf5; }
|
|
201
|
+
|
|
202
|
+
/* Highlight - Storm (Only when list has focus OR it is the tool-list) */
|
|
203
|
+
.theme-storm ListView:focus > ListItem.--highlight,
|
|
204
|
+
.theme-storm #tool-list > ListItem.--highlight {
|
|
205
|
+
background: #ffff00;
|
|
206
|
+
color: #000000;
|
|
207
|
+
text-style: bold;
|
|
208
|
+
}
|
|
209
|
+
.theme-storm ListView:focus > ListItem.--highlight Label,
|
|
210
|
+
.theme-storm #tool-list > ListItem.--highlight Label,
|
|
211
|
+
.theme-storm ListView:focus > ListItem.--highlight .list-item,
|
|
212
|
+
.theme-storm #tool-list > ListItem.--highlight .list-item {
|
|
213
|
+
color: #000000;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
/* Categories - Storm */
|
|
217
|
+
.theme-storm .category-DEV { color: #7aa2f7; }
|
|
218
|
+
.theme-storm .category-AI { color: #bb9af7; }
|
|
219
|
+
.theme-storm .category-MEDIA { color: #9ccc65; }
|
|
220
|
+
.theme-storm .category-UTIL { color: #ff9e64; }
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
/* 3. LIGHT THEME */
|
|
224
|
+
.theme-light {
|
|
225
|
+
background: #d5d6db;
|
|
226
|
+
color: #343b58;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
.theme-light ListView,
|
|
230
|
+
.theme-light ListItem {
|
|
231
|
+
background: #d5d6db;
|
|
232
|
+
color: #343b58;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
.theme-light #header,
|
|
236
|
+
.theme-light .pane-header,
|
|
237
|
+
.theme-light #footer-container {
|
|
238
|
+
background: #d5d6db;
|
|
239
|
+
color: #343b58;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
.theme-light #header-right { border: solid #343b58; }
|
|
243
|
+
.theme-light #main-container { border-top: solid #343b58; } /* removed bottom border */
|
|
244
|
+
.theme-light #left-pane { border-right: solid #343b58; }
|
|
245
|
+
.theme-light .pane-header-container { border-bottom: solid #343b58; }
|
|
246
|
+
.theme-light #tool-description { color: #8c4351; border-top: solid #343b58; }
|
|
247
|
+
|
|
248
|
+
/* Highlight - Light (Only when list has focus OR it is the tool-list) */
|
|
249
|
+
.theme-light ListView:focus > ListItem.--highlight,
|
|
250
|
+
.theme-light #tool-list > ListItem.--highlight {
|
|
251
|
+
background: #ffff00;
|
|
252
|
+
color: #000000;
|
|
253
|
+
text-style: bold;
|
|
254
|
+
}
|
|
255
|
+
.theme-light ListView:focus > ListItem.--highlight Label,
|
|
256
|
+
.theme-light #tool-list > ListItem.--highlight Label,
|
|
257
|
+
.theme-light ListView:focus > ListItem.--highlight .list-item,
|
|
258
|
+
.theme-light #tool-list > ListItem.--highlight .list-item {
|
|
259
|
+
color: #000000;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
/* Categories - Light */
|
|
263
|
+
.theme-light .category-DEV { color: #3d59a1; }
|
|
264
|
+
.theme-light .category-AI { color: #8c4351; }
|
|
265
|
+
.theme-light .category-MEDIA { color: #487e02; }
|
|
266
|
+
.theme-light .category-UTIL { color: #ff9e64; }
|
|
267
|
+
/* --- THEME PICKER --- */
|
|
268
|
+
ThemePicker {
|
|
269
|
+
align: center middle;
|
|
270
|
+
background: rgba(0,0,0,0.5);
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
#theme-picker-dialog {
|
|
274
|
+
width: 40;
|
|
275
|
+
height: auto;
|
|
276
|
+
border: thick #7aa2f7; /* Blue accent */
|
|
277
|
+
background: #1a1b26; /* Darker surface */
|
|
278
|
+
padding: 1 2;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
#theme-picker-title {
|
|
282
|
+
content-align: center middle;
|
|
283
|
+
text-style: bold;
|
|
284
|
+
width: 100%;
|
|
285
|
+
margin-bottom: 1;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
#theme-list {
|
|
289
|
+
height: 10;
|
|
290
|
+
border: solid #565f89; /* Muted purple/blue */
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
/* --- CREATE PROJECT MODAL --- */
|
|
294
|
+
#create-project-dialog {
|
|
295
|
+
width: 60;
|
|
296
|
+
height: auto;
|
|
297
|
+
border: thick #7aa2f7;
|
|
298
|
+
background: #1a1b26;
|
|
299
|
+
padding: 1 2;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
#create-project-title {
|
|
303
|
+
content-align: center middle;
|
|
304
|
+
text-style: bold;
|
|
305
|
+
width: 100%;
|
|
306
|
+
margin-bottom: 1;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
#create-project-buttons {
|
|
310
|
+
margin-top: 1;
|
|
311
|
+
height: 3;
|
|
312
|
+
align: right middle;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
#btn-cancel {
|
|
316
|
+
margin-right: 1;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
.error-label {
|
|
320
|
+
color: #f7768e; /* Red/Pink error color */
|
|
321
|
+
text-style: bold;
|
|
322
|
+
margin-top: 1;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
.modal-footer {
|
|
326
|
+
width: 100%;
|
|
327
|
+
content-align: center middle;
|
|
328
|
+
margin-top: 1;
|
|
329
|
+
color: #565f89;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
|
|
333
|
+
/* --- NEW FOOTER --- */
|
|
334
|
+
#footer-container {
|
|
335
|
+
height: 3;
|
|
336
|
+
dock: bottom;
|
|
337
|
+
padding: 0 1;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
.footer-col {
|
|
341
|
+
height: 100%;
|
|
342
|
+
width: auto;
|
|
343
|
+
padding-right: 4;
|
|
344
|
+
content-align: center middle;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
.footer-label {
|
|
348
|
+
text-style: bold;
|
|
349
|
+
margin-right: 2;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
.key-badge {
|
|
353
|
+
background: #7aa2f7; /* Accent Blue */
|
|
354
|
+
color: #1a1b26; /* Dark Text */
|
|
355
|
+
padding: 0 1;
|
|
356
|
+
text-style: bold;
|
|
357
|
+
margin-right: 1; /* Add space between badge and desc */
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
.key-desc {
|
|
361
|
+
margin-right: 3; /* Increased space between items */
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
/* Light Theme Overrides for Footer */
|
|
365
|
+
.theme-light .key-badge {
|
|
366
|
+
background: #3d59a1;
|
|
367
|
+
color: #ffffff;
|
|
368
|
+
}
|
|
369
|
+
.theme-light .key-desc,
|
|
370
|
+
.theme-light .footer-label {
|
|
371
|
+
color: #343b58;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
/* --- TOASTS --- */
|
|
375
|
+
|
|
376
|
+
/* Dark Theme Toasts */
|
|
377
|
+
.theme-dark Toast {
|
|
378
|
+
background: #292e42; /* Lighter surface */
|
|
379
|
+
border-left: thick #7aa2f7; /* Blue accent strip */
|
|
380
|
+
color: #c0caf5;
|
|
381
|
+
padding: 1 2;
|
|
382
|
+
}
|
|
383
|
+
.theme-dark ToastTitle {
|
|
384
|
+
text-style: bold;
|
|
385
|
+
color: #7aa2f7;
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
/* Storm Theme Toasts */
|
|
389
|
+
.theme-storm Toast {
|
|
390
|
+
background: #414868; /* Lighter storm surface */
|
|
391
|
+
border-left: thick #bb9af7; /* Purple accent strip */
|
|
392
|
+
color: #c0caf5;
|
|
393
|
+
padding: 1 2;
|
|
394
|
+
}
|
|
395
|
+
.theme-storm ToastTitle {
|
|
396
|
+
text-style: bold;
|
|
397
|
+
color: #bb9af7;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
/* Light Theme Toasts */
|
|
401
|
+
.theme-light Toast {
|
|
402
|
+
background: #ffffff; /* White surface for contrast */
|
|
403
|
+
border-left: thick #343b58; /* Dark accent strip */
|
|
404
|
+
color: #343b58;
|
|
405
|
+
padding: 1 2;
|
|
406
|
+
}
|
|
407
|
+
.theme-light ToastTitle {
|
|
408
|
+
text-style: bold;
|
|
409
|
+
color: #343b58;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
/* --- HELP SCREEN --- */
|
|
413
|
+
#help-dialog {
|
|
414
|
+
width: 60;
|
|
415
|
+
height: auto;
|
|
416
|
+
border: thick #7aa2f7;
|
|
417
|
+
background: #1a1b26;
|
|
418
|
+
padding: 1 2;
|
|
419
|
+
align: center middle;
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
#help-title-container {
|
|
423
|
+
height: 3;
|
|
424
|
+
content-align: center middle;
|
|
425
|
+
border-bottom: solid #565f89;
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
#help-title {
|
|
429
|
+
text-style: bold;
|
|
430
|
+
color: #7aa2f7;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
#help-content {
|
|
434
|
+
margin: 1 0;
|
|
435
|
+
height: auto;
|
|
436
|
+
max-height: 20;
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
#help-footer {
|
|
440
|
+
height: 3;
|
|
441
|
+
align: right middle;
|
|
442
|
+
margin-top: 1;
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
/* --- ERROR SCREEN --- */
|
|
446
|
+
#error-dialog {
|
|
447
|
+
width: 60;
|
|
448
|
+
height: auto;
|
|
449
|
+
border: thick #f7768e; /* Red accent */
|
|
450
|
+
background: #1a1b26;
|
|
451
|
+
padding: 1 2;
|
|
452
|
+
align: center middle;
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
#error-header {
|
|
456
|
+
height: 3;
|
|
457
|
+
content-align: center middle;
|
|
458
|
+
border-bottom: solid #414868;
|
|
459
|
+
color: #f7768e;
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
.error-icon {
|
|
463
|
+
text-style: bold;
|
|
464
|
+
margin-right: 1;
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
#error-title {
|
|
468
|
+
text-style: bold;
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
#error-body {
|
|
472
|
+
margin: 1 0;
|
|
473
|
+
max-height: 20;
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
#error-message {
|
|
477
|
+
padding-bottom: 1;
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
#error-details {
|
|
481
|
+
color: #565f89;
|
|
482
|
+
text-style: italic;
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
#error-footer {
|
|
486
|
+
align: right middle;
|
|
487
|
+
margin-top: 1;
|
|
488
|
+
height: 3;
|
|
489
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
"""Custom list items for the Nexus TUI.
|
|
2
|
+
|
|
3
|
+
Defines the specialized ListItem widgets used to display tools, categories,
|
|
4
|
+
and projects with specific formatting and visual indicators.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from nexus.config import CATEGORY_COLORS, CATEGORY_ICONS, USE_NERD_FONTS
|
|
8
|
+
from nexus.models import Project, Tool
|
|
9
|
+
from typing import Any
|
|
10
|
+
from textual.widgets import ListItem, Static
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class ToolItem(Static):
|
|
14
|
+
"""A widget representing a tool in the list."""
|
|
15
|
+
|
|
16
|
+
def __init__(
|
|
17
|
+
self,
|
|
18
|
+
tool_info: Tool,
|
|
19
|
+
hint: str = "",
|
|
20
|
+
is_favorite: bool = False,
|
|
21
|
+
**kwargs: Any,
|
|
22
|
+
):
|
|
23
|
+
"""Initializes the ToolItem.
|
|
24
|
+
|
|
25
|
+
Args:
|
|
26
|
+
tool_info: The Tool model containing tool details.
|
|
27
|
+
hint: Optional numeric hint (e.g. '1').
|
|
28
|
+
is_favorite: Whether the tool is marked as a favorite.
|
|
29
|
+
**kwargs: Additional arguments passed to the Static widget.
|
|
30
|
+
"""
|
|
31
|
+
super().__init__(**kwargs)
|
|
32
|
+
self.tool_info = tool_info
|
|
33
|
+
self.hint = hint
|
|
34
|
+
self.is_favorite = is_favorite
|
|
35
|
+
self.can_focus = True
|
|
36
|
+
|
|
37
|
+
def render(self) -> str:
|
|
38
|
+
"""Renders the tool item.
|
|
39
|
+
|
|
40
|
+
Returns:
|
|
41
|
+
A string representation of the tool label prefixed with '> '.
|
|
42
|
+
"""
|
|
43
|
+
hint_str = f"[bold magenta]{self.hint}[/] " if self.hint else ""
|
|
44
|
+
fav_str = "[bold yellow]★[/] " if self.is_favorite else ""
|
|
45
|
+
label = self.tool_info.label
|
|
46
|
+
return f"{hint_str}{fav_str}> {label} | [dim]{self.tool_info.description}[/]"
|
|
47
|
+
|
|
48
|
+
def on_mount(self) -> None:
|
|
49
|
+
"""Called when the widget is mounted.
|
|
50
|
+
|
|
51
|
+
Adds specific CSS classes for styling.
|
|
52
|
+
"""
|
|
53
|
+
self.add_class("list-item")
|
|
54
|
+
self.add_class(f"category-{self.tool_info.category}")
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
class ProjectItem(Static):
|
|
58
|
+
"""A widget representing a project in the list."""
|
|
59
|
+
|
|
60
|
+
def __init__(
|
|
61
|
+
self,
|
|
62
|
+
project_name: str,
|
|
63
|
+
is_git: bool = False,
|
|
64
|
+
is_special: bool = False,
|
|
65
|
+
**kwargs: Any,
|
|
66
|
+
):
|
|
67
|
+
"""Initializes the ProjectItem.
|
|
68
|
+
|
|
69
|
+
Args:
|
|
70
|
+
project_name: The name of the project.
|
|
71
|
+
is_git: Whether the project is a git repository.
|
|
72
|
+
is_special: Whether this item is a special action (e.g. Create new).
|
|
73
|
+
**kwargs: Additional arguments passed to the Static widget.
|
|
74
|
+
"""
|
|
75
|
+
super().__init__(**kwargs)
|
|
76
|
+
self.project_name = project_name
|
|
77
|
+
self.is_git = is_git
|
|
78
|
+
self.is_special = is_special
|
|
79
|
+
self.can_focus = True
|
|
80
|
+
|
|
81
|
+
def render(self) -> str:
|
|
82
|
+
"""Renders the project item.
|
|
83
|
+
|
|
84
|
+
Returns:
|
|
85
|
+
A string with an icon (if git repo) and the project name, or a
|
|
86
|
+
styled string for special items.
|
|
87
|
+
"""
|
|
88
|
+
icon = " " if self.is_git else " "
|
|
89
|
+
if self.is_special:
|
|
90
|
+
return f"[bold cyan]{self.project_name}[/]"
|
|
91
|
+
return f"{icon}{self.project_name}"
|
|
92
|
+
|
|
93
|
+
def on_mount(self) -> None:
|
|
94
|
+
"""Called when the widget is mounted."""
|
|
95
|
+
self.add_class("list-item")
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
class ToolListItem(ListItem):
|
|
99
|
+
"""A typed ListItem for tools.
|
|
100
|
+
|
|
101
|
+
Attributes:
|
|
102
|
+
tool_info: The Tool model associated with this item.
|
|
103
|
+
"""
|
|
104
|
+
|
|
105
|
+
def __init__(
|
|
106
|
+
self,
|
|
107
|
+
tool_info: Tool,
|
|
108
|
+
hint: str = "",
|
|
109
|
+
is_favorite: bool = False,
|
|
110
|
+
**kwargs: Any,
|
|
111
|
+
):
|
|
112
|
+
"""Initializes the ToolListItem.
|
|
113
|
+
|
|
114
|
+
Args:
|
|
115
|
+
tool_info: The Tool model.
|
|
116
|
+
hint: Optional numeric hint.
|
|
117
|
+
is_favorite: Whether the tool is a favorite.
|
|
118
|
+
**kwargs: Additional arguments passed to the ListItem.
|
|
119
|
+
"""
|
|
120
|
+
self.tool_info = tool_info
|
|
121
|
+
super().__init__(
|
|
122
|
+
ToolItem(tool_info, hint=hint, is_favorite=is_favorite), **kwargs
|
|
123
|
+
)
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
class ProjectListItem(ListItem):
|
|
127
|
+
"""A typed ListItem for projects.
|
|
128
|
+
|
|
129
|
+
Attributes:
|
|
130
|
+
project_data: The Project model, or None if this is a special item.
|
|
131
|
+
is_create_new: True if this item represents the "Create New Project" action.
|
|
132
|
+
"""
|
|
133
|
+
|
|
134
|
+
def __init__(
|
|
135
|
+
self,
|
|
136
|
+
project_data: Project | None = None,
|
|
137
|
+
is_create_new: bool = False,
|
|
138
|
+
**kwargs: Any,
|
|
139
|
+
):
|
|
140
|
+
"""Initializes the ProjectListItem.
|
|
141
|
+
|
|
142
|
+
Args:
|
|
143
|
+
project_data: The Project model. Required unless is_create_new is True.
|
|
144
|
+
is_create_new: Whether this is a "Create New" action item.
|
|
145
|
+
**kwargs: Additional arguments passed to the ListItem.
|
|
146
|
+
|
|
147
|
+
Raises:
|
|
148
|
+
ValueError: If project_data is None and is_create_new is False.
|
|
149
|
+
"""
|
|
150
|
+
self.project_data = project_data
|
|
151
|
+
self.is_create_new = is_create_new
|
|
152
|
+
|
|
153
|
+
if is_create_new:
|
|
154
|
+
widget = ProjectItem("[ + ] Create New Project", is_special=True)
|
|
155
|
+
else:
|
|
156
|
+
if project_data is None:
|
|
157
|
+
raise ValueError("project_data must be provided if is_create_new is False")
|
|
158
|
+
widget = ProjectItem(project_data.name, is_git=project_data.is_git)
|
|
159
|
+
|
|
160
|
+
super().__init__(widget, **kwargs)
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
class CategoryListItem(ListItem):
|
|
164
|
+
"""A typed ListItem for categories.
|
|
165
|
+
|
|
166
|
+
Attributes:
|
|
167
|
+
category_id: The category identifier string.
|
|
168
|
+
"""
|
|
169
|
+
|
|
170
|
+
def __init__(self, category: str, **kwargs: Any):
|
|
171
|
+
"""Initializes the CategoryListItem.
|
|
172
|
+
|
|
173
|
+
Args:
|
|
174
|
+
category: The category name.
|
|
175
|
+
**kwargs: Additional arguments.
|
|
176
|
+
"""
|
|
177
|
+
self.category_id = category
|
|
178
|
+
super().__init__(**kwargs)
|
|
179
|
+
|
|
180
|
+
def render(self) -> str:
|
|
181
|
+
"""Renders the category item with a colored badge.
|
|
182
|
+
|
|
183
|
+
Returns:
|
|
184
|
+
The formatted string for the category list item.
|
|
185
|
+
"""
|
|
186
|
+
icon = ""
|
|
187
|
+
if USE_NERD_FONTS:
|
|
188
|
+
icon = f"{CATEGORY_ICONS.get(self.category_id, '')} "
|
|
189
|
+
|
|
190
|
+
if self.category_id == "ALL":
|
|
191
|
+
return f"{icon}ALL"
|
|
192
|
+
|
|
193
|
+
color = CATEGORY_COLORS.get(self.category_id, "white")
|
|
194
|
+
return f"[{color}]◼[/] {icon}{self.category_id}"
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
nexus/__init__.py,sha256=bti-BCTw_hFdmSoy8872Cikse7LxK1e0aN5SaabgwIg,37
|
|
2
|
+
nexus/app.py,sha256=7Kp_LVdhihhsPnL_8q_U-WAggKC9hZFqzf5rXljQ37k,3184
|
|
3
|
+
nexus/config.py,sha256=VfLaUuQn31gD_IC6LTkK5FE5b84JzIwOKu0arG0Z8f0,5467
|
|
4
|
+
nexus/container.py,sha256=lQA2WB1WqvW9Y8lbY2QUYkpDTtep1ts00XBD2d3JY70,1152
|
|
5
|
+
nexus/logger.py,sha256=sRhNYYErXzPzZ84uLm7MLH6NJb6EAGKUijRF1AvnfeU,1337
|
|
6
|
+
nexus/models.py,sha256=elqUVjMMxa2RZoETtxKJkTpRrpLuglP43mBOwVSbA0o,1100
|
|
7
|
+
nexus/state.py,sha256=dmBnHpzws2aErG42LaZFLXcse_9EwecmZy2dFgot4Tw,2532
|
|
8
|
+
nexus/style.tcss,sha256=ZthqjY0GeYEulI-LtaUPsDsd0NiLuygfIcj4SpSIAiI,9801
|
|
9
|
+
nexus/tools.toml,sha256=uYfBA7WMLAu6fPDRzB4p5ggk0aVTUpDPrxRrzLnGiMA,740
|
|
10
|
+
nexus/screens/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
11
|
+
nexus/screens/create_project.py,sha256=uVAQioL6C-3mtriQfvuylUD0kX3sYA0KWgM0yWvzF9M,3597
|
|
12
|
+
nexus/screens/error.py,sha256=LQOkb-rLHbcYCRPrBybuusABcf73RbwN9q_f3N2VqmE,1817
|
|
13
|
+
nexus/screens/help.py,sha256=lG6Lkt-t3kPGcbltKZiFfv5S5d57ZiZkU4cc_jfM3Nw,1697
|
|
14
|
+
nexus/screens/project_picker.py,sha256=ghXHKRLd4fxP8LWASi6_C8_BzEZFv266bsD591OSEyQ,9590
|
|
15
|
+
nexus/screens/theme_picker.py,sha256=KZ_L2QYnv95bdJGd3PcQnb0QJe1sgr3EIXm7Vd-tz-8,3479
|
|
16
|
+
nexus/screens/tool_selector.py,sha256=_76k60_Uk_jg2O347mCHwcs1wI8z8UO-lWRaeH8uI2E,18252
|
|
17
|
+
nexus/services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
18
|
+
nexus/services/executor.py,sha256=SqeZa6owOTc04dCvMChiWVsGOWnrO1YW2gUvT5m4Nuk,1494
|
|
19
|
+
nexus/services/scanner.py,sha256=YTx6WQBAvERK3zfdkHfwfj0Ygj9ZL1idhO8JUr_IF4M,1311
|
|
20
|
+
nexus/widgets/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
21
|
+
nexus/widgets/tool_list_item.py,sha256=H0C04ef4OreL9vmyiku3hTA0SAXLoKWoGagIMn73jpI,5880
|
|
22
|
+
nexus_tui-0.1.5.dist-info/METADATA,sha256=1kd_MNKibQMxJfGLFk2T6xtmbUcC_vQHd4rPzefxcoA,3761
|
|
23
|
+
nexus_tui-0.1.5.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
24
|
+
nexus_tui-0.1.5.dist-info/entry_points.txt,sha256=FLWKPqsNYxxaU0JyVfJoKJDTrFtx-LJVPejbvUdnc6o,41
|
|
25
|
+
nexus_tui-0.1.5.dist-info/licenses/LICENSE,sha256=gtmNw2nOOujPlKSYxW0EQC-cg2aSe--mVlMxElz5AmI,1062
|
|
26
|
+
nexus_tui-0.1.5.dist-info/RECORD,,
|