fleetdeck 0.3.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.
Files changed (44) hide show
  1. fleetdeck/__init__.py +3 -0
  2. fleetdeck/__main__.py +232 -0
  3. fleetdeck/accounts.py +115 -0
  4. fleetdeck/adapters/__init__.py +0 -0
  5. fleetdeck/adapters/base.py +71 -0
  6. fleetdeck/adapters/claude_cli.py +187 -0
  7. fleetdeck/adapters/codex_cli.py +362 -0
  8. fleetdeck/adapters/demo.py +331 -0
  9. fleetdeck/config.py +323 -0
  10. fleetdeck/db.py +511 -0
  11. fleetdeck/gitinfo.py +169 -0
  12. fleetdeck/models.py +178 -0
  13. fleetdeck/paths.py +64 -0
  14. fleetdeck/proc.py +92 -0
  15. fleetdeck/redact.py +51 -0
  16. fleetdeck/services/__init__.py +0 -0
  17. fleetdeck/services/dispatcher.py +382 -0
  18. fleetdeck/services/fleet.py +65 -0
  19. fleetdeck/services/monitor.py +253 -0
  20. fleetdeck/services/notifier.py +71 -0
  21. fleetdeck/status.py +97 -0
  22. fleetdeck/terminal.py +235 -0
  23. fleetdeck/termrender.py +129 -0
  24. fleetdeck/ui/__init__.py +0 -0
  25. fleetdeck/ui/app.py +1295 -0
  26. fleetdeck/ui/app.tcss +263 -0
  27. fleetdeck/ui/commands.py +63 -0
  28. fleetdeck/ui/screens/__init__.py +0 -0
  29. fleetdeck/ui/screens/modals.py +623 -0
  30. fleetdeck/ui/style.py +150 -0
  31. fleetdeck/ui/views.py +230 -0
  32. fleetdeck/ui/widgets/__init__.py +0 -0
  33. fleetdeck/ui/widgets/agent_table.py +185 -0
  34. fleetdeck/ui/widgets/bottom.py +27 -0
  35. fleetdeck/ui/widgets/details.py +295 -0
  36. fleetdeck/ui/widgets/header.py +87 -0
  37. fleetdeck/ui/widgets/sidebar.py +227 -0
  38. fleetdeck/ui/widgets/splitter.py +66 -0
  39. fleetdeck/ui/widgets/terminal.py +119 -0
  40. fleetdeck-0.3.0.dist-info/METADATA +245 -0
  41. fleetdeck-0.3.0.dist-info/RECORD +44 -0
  42. fleetdeck-0.3.0.dist-info/WHEEL +4 -0
  43. fleetdeck-0.3.0.dist-info/entry_points.txt +2 -0
  44. fleetdeck-0.3.0.dist-info/licenses/LICENSE +21 -0
fleetdeck/ui/app.tcss ADDED
@@ -0,0 +1,263 @@
1
+ /* FleetDeck — layout & look. Colours come from the active Textual
2
+ theme ($primary, $surface, …) so every theme stays coherent. */
3
+
4
+ Screen {
5
+ background: $background;
6
+ layout: vertical;
7
+ }
8
+
9
+ #header {
10
+ height: 1;
11
+ background: $panel;
12
+ color: $foreground;
13
+ }
14
+
15
+ #views {
16
+ height: 1fr;
17
+ }
18
+
19
+ /* Panels: rounded borders with titles; the focused panel lights up. */
20
+ #sidebar, #center, #details, ProjectsView, SessionsView, TasksView, SettingsView {
21
+ border-title-color: $text-muted;
22
+ border-title-style: bold;
23
+ border-subtitle-color: $text-muted;
24
+ border-title-align: left;
25
+ border-subtitle-align: right;
26
+ }
27
+ #sidebar:focus-within, #center:focus-within, #details:focus-within {
28
+ border-title-color: $primary;
29
+ }
30
+
31
+ /* ----------------------------------------------------------- dashboard */
32
+ #dashboard {
33
+ height: 1fr;
34
+ }
35
+
36
+ #sidebar {
37
+ width: 28;
38
+ min-width: 22;
39
+ border: round $panel-lighten-2;
40
+ border-title-color: $text-muted;
41
+ padding: 0;
42
+ }
43
+ #sidebar:focus-within {
44
+ border: round $primary;
45
+ }
46
+ #project-search {
47
+ border: none;
48
+ height: 1;
49
+ padding: 0 1;
50
+ background: $surface;
51
+ margin-bottom: 1;
52
+ }
53
+ #project-tree {
54
+ background: transparent;
55
+ overflow-x: hidden;
56
+ padding: 0 1;
57
+ scrollbar-size-vertical: 1;
58
+ }
59
+
60
+ #center {
61
+ width: 1fr;
62
+ min-width: 50;
63
+ border: round $panel-lighten-2;
64
+ }
65
+ #center:focus-within {
66
+ border: round $primary;
67
+ }
68
+ #agent-filter {
69
+ border: none;
70
+ height: 1;
71
+ padding: 0 1;
72
+ background: $surface;
73
+ margin-bottom: 1;
74
+ }
75
+ #agents {
76
+ height: 1fr;
77
+ background: transparent;
78
+ scrollbar-size-vertical: 1;
79
+ }
80
+
81
+ #details {
82
+ width: 36%;
83
+ min-width: 40;
84
+ max-width: 64;
85
+ border: round $panel-lighten-2;
86
+ }
87
+ #details:focus-within {
88
+ border: round $primary;
89
+ }
90
+ #details-title {
91
+ height: 2;
92
+ background: $surface;
93
+ padding: 0 0;
94
+ }
95
+ #details-tabs Tabs {
96
+ margin-top: 0;
97
+ }
98
+ #details-tabs Underline > .underline--bar {
99
+ color: $primary;
100
+ }
101
+ #term-bar {
102
+ height: 1;
103
+ background: $surface;
104
+ margin-bottom: 0;
105
+ }
106
+ #tab-terminal {
107
+ padding: 0;
108
+ }
109
+ #terminal {
110
+ padding: 0;
111
+ }
112
+ #details-tabs {
113
+ height: 1fr;
114
+ }
115
+ #details-tabs TabPane {
116
+ padding: 0 1;
117
+ }
118
+ #log-view {
119
+ background: transparent;
120
+ scrollbar-size-vertical: 1;
121
+ }
122
+
123
+ /* Narrow terminals: details panel collapses first, then the sidebar. */
124
+ Screen.-narrow #details, Screen.-narrow #split-right { display: none; }
125
+ Screen.-very-narrow #sidebar, Screen.-very-narrow #split-left { display: none; }
126
+
127
+ /* ----------------------------------------------------------- data tables */
128
+ DataTable {
129
+ background: transparent;
130
+ scrollbar-size-horizontal: 1;
131
+ }
132
+ DataTable > .datatable--header {
133
+ background: $surface;
134
+ color: $text-muted;
135
+ text-style: bold;
136
+ }
137
+ DataTable > .datatable--cursor {
138
+ background: $primary 30%;
139
+ color: $foreground;
140
+ text-style: none;
141
+ }
142
+ DataTable:blur > .datatable--cursor {
143
+ background: $primary 12%;
144
+ }
145
+
146
+ /* ----------------------------------------------------------- other views */
147
+ ProjectsView, SessionsView, TasksView {
148
+ border: round $panel-lighten-2;
149
+ height: 1fr;
150
+ }
151
+ .view-title {
152
+ height: 1;
153
+ background: $surface;
154
+ text-style: bold;
155
+ margin-bottom: 1;
156
+ }
157
+ SettingsView {
158
+ border: round $panel-lighten-2;
159
+ padding: 0 1;
160
+ }
161
+ .settings-form {
162
+ height: auto;
163
+ max-width: 90;
164
+ padding: 1 0;
165
+ }
166
+ .setting-row {
167
+ height: auto;
168
+ margin-bottom: 1;
169
+ }
170
+ .setting-label {
171
+ width: 36;
172
+ padding: 1 0 0 0;
173
+ color: $text-muted;
174
+ }
175
+ .setting-row Input, .setting-row Select {
176
+ width: 40;
177
+ }
178
+
179
+ /* ----------------------------------------------------------- bottom */
180
+ #activity {
181
+ height: 6;
182
+ border-top: round $panel-lighten-2;
183
+ border-title-color: $text-muted;
184
+ border-title-style: bold;
185
+ background: $background;
186
+ padding: 0 1;
187
+ scrollbar-size-vertical: 1;
188
+ }
189
+
190
+ Footer {
191
+ background: $panel;
192
+ }
193
+
194
+ /* ----------------------------------------------------------- dialogs */
195
+ ModalScreen {
196
+ align: center middle;
197
+ background: $background 60%;
198
+ }
199
+ .dialog {
200
+ width: 96;
201
+ max-width: 95%;
202
+ height: auto;
203
+ max-height: 92%;
204
+ border: round $primary;
205
+ background: $surface;
206
+ padding: 1 2;
207
+ }
208
+ .dialog.small { width: 64; }
209
+ .dialog.wide { width: 110; height: 90%; }
210
+ .dialog-title {
211
+ text-style: bold;
212
+ color: $primary;
213
+ margin-bottom: 1;
214
+ width: 100%;
215
+ }
216
+ .dialog-body { margin-bottom: 1; }
217
+ .dialog-buttons {
218
+ height: auto;
219
+ align-horizontal: right;
220
+ margin-top: 1;
221
+ }
222
+ .dialog-buttons Button { margin-left: 1; }
223
+ .field-label {
224
+ color: $text-muted;
225
+ margin-top: 1;
226
+ }
227
+ .row { height: auto; }
228
+ .row > Vertical { height: auto; width: 1fr; margin-right: 1; }
229
+ .row > Vertical.narrow { width: 24; }
230
+ .row Checkbox { width: auto; margin-right: 2; }
231
+ .dialog TextArea { height: 8; }
232
+ .error-text { color: $error; height: auto; }
233
+ .hint { color: $text-muted; height: 1; }
234
+
235
+ .viewer {
236
+ width: 95%;
237
+ height: 92%;
238
+ border: round $primary;
239
+ background: $surface;
240
+ padding: 0 1;
241
+ }
242
+ #viewer-log { height: 1fr; background: $background; }
243
+
244
+ .tpl-list { width: 30; height: 1fr; border-right: solid $panel-lighten-2; }
245
+ TemplatesModal .dialog TextArea { height: 1fr; }
246
+
247
+ /* ----------------------------------------------------------- accounts */
248
+ #account-list {
249
+ height: auto;
250
+ max-height: 24;
251
+ background: transparent;
252
+ margin: 1 0;
253
+ }
254
+ #account-list > ListItem {
255
+ padding: 0 1;
256
+ background: transparent;
257
+ }
258
+ #account-list > ListItem.-highlight {
259
+ background: $primary 18%;
260
+ }
261
+ #account-dialog .hint {
262
+ height: auto;
263
+ }
@@ -0,0 +1,63 @@
1
+ """Command palette (Ctrl+P): every action, plus jump-to project / agent."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from functools import partial
6
+ from typing import TYPE_CHECKING
7
+
8
+ from textual.command import DiscoveryHit, Hit, Hits, Provider
9
+
10
+ if TYPE_CHECKING:
11
+ from .app import CommandCenterApp
12
+
13
+ ACTIONS = [
14
+ ("New agent", "Launch a background agent in a project", "new_agent"),
15
+ ("Queue task", "Add a task to a project's queue", "new_task"),
16
+ ("Add project", "Register a project directory", "add_project"),
17
+ ("Attach to agent", "Open the selected session in this terminal", "attach"),
18
+ ("Follow up", "Send a new prompt to the selected finished agent", "follow_up"),
19
+ ("Terminal", "Open a shell in the selected agent's directory", "terminal"),
20
+ ("View logs", "Full-screen live logs for the selected agent", "logs"),
21
+ ("View git diff", "Diff of the selected agent's directory", "diff"),
22
+ ("Stop agent", "Stop the selected agent (confirmation)", "stop"),
23
+ ("Restart agent", "claude respawn the selected agent", "restart"),
24
+ ("Remove session", "claude rm the selected finished session", "remove_session"),
25
+ ("Run tests", "Run the project's test command", "run_tests"),
26
+ ("Pause / resume dispatch", "Toggle automatic task dispatch", "toggle_dispatch"),
27
+ ("Pin / unpin project", "Toggle pin on the selected project", "pin"),
28
+ ("Edit project", "Rename / configure the selected project", "edit_project"),
29
+ ("Remove project", "Unregister the selected project", "remove_project"),
30
+ ("Prompt templates", "Create and edit reusable prompts", "templates"),
31
+ ("Refresh", "Poll Claude Code now", "refresh"),
32
+ ("Go to dashboard", "", "view_dashboard"),
33
+ ("Go to projects", "", "view_projects"),
34
+ ("Go to agent sessions", "", "view_sessions"),
35
+ ("Go to task queues", "", "view_tasks"),
36
+ ("Go to settings", "", "view_settings"),
37
+ ("Help", "Keyboard shortcuts", "help"),
38
+ ("Quit", "Exit the dashboard (agents keep running)", "quit"),
39
+ ]
40
+
41
+
42
+ class CenterCommands(Provider):
43
+ def _commands(self):
44
+ app: CommandCenterApp = self.app # type: ignore[assignment] # always our app
45
+ for title, help_text, action in ACTIONS:
46
+ yield title, help_text, partial(app.run_action, action)
47
+ for p in app.projects:
48
+ yield (f"Project: {p.name}", p.path, partial(app.focus_project, p.id))
49
+ for a in app.snapshot.agents:
50
+ yield (f"Agent: {a.display_name}", f"{a.status.label} · {a.project_name or a.cwd}",
51
+ partial(app.focus_agent, a.key))
52
+
53
+ async def discover(self) -> Hits:
54
+ for title, help_text, cb in self._commands():
55
+ if not title.startswith(("Project:", "Agent:")):
56
+ yield DiscoveryHit(title, cb, help=help_text)
57
+
58
+ async def search(self, query: str) -> Hits:
59
+ matcher = self.matcher(query)
60
+ for title, help_text, cb in self._commands():
61
+ score = matcher.match(title)
62
+ if score > 0:
63
+ yield Hit(score, matcher.highlight(title), cb, help=help_text)
File without changes