@anastops/cli 1.0.0 → 1.2.0
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.
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +8 -6
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/init.d.ts +17 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +315 -17
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/ranger.d.ts +7 -2
- package/dist/commands/ranger.d.ts.map +1 -1
- package/dist/commands/ranger.js +99 -21
- package/dist/commands/ranger.js.map +1 -1
- package/dist/commands/uninstall.d.ts +16 -0
- package/dist/commands/uninstall.d.ts.map +1 -0
- package/dist/commands/uninstall.js +206 -0
- package/dist/commands/uninstall.js.map +1 -0
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -1
- package/package.json +8 -6
- package/ranger-tui/pyproject.toml +51 -0
- package/ranger-tui/ranger_tui/__init__.py +5 -0
- package/ranger-tui/ranger_tui/__main__.py +16 -0
- package/ranger-tui/ranger_tui/__pycache__/__init__.cpython-314.pyc +0 -0
- package/ranger-tui/ranger_tui/__pycache__/__main__.cpython-314.pyc +0 -0
- package/ranger-tui/ranger_tui/__pycache__/accessibility.cpython-314.pyc +0 -0
- package/ranger-tui/ranger_tui/__pycache__/app.cpython-314.pyc +0 -0
- package/ranger-tui/ranger_tui/__pycache__/config.cpython-314.pyc +0 -0
- package/ranger-tui/ranger_tui/__pycache__/theme.cpython-314.pyc +0 -0
- package/ranger-tui/ranger_tui/accessibility.py +499 -0
- package/ranger-tui/ranger_tui/actions/__init__.py +13 -0
- package/ranger-tui/ranger_tui/actions/agent_actions.py +74 -0
- package/ranger-tui/ranger_tui/actions/session_actions.py +110 -0
- package/ranger-tui/ranger_tui/actions/task_actions.py +107 -0
- package/ranger-tui/ranger_tui/app.py +93 -0
- package/ranger-tui/ranger_tui/assets/ranger_head.png +0 -0
- package/ranger-tui/ranger_tui/config.py +100 -0
- package/ranger-tui/ranger_tui/data/__init__.py +16 -0
- package/ranger-tui/ranger_tui/data/__pycache__/__init__.cpython-314.pyc +0 -0
- package/ranger-tui/ranger_tui/data/__pycache__/client.cpython-314.pyc +0 -0
- package/ranger-tui/ranger_tui/data/__pycache__/models.cpython-314.pyc +0 -0
- package/ranger-tui/ranger_tui/data/client.py +858 -0
- package/ranger-tui/ranger_tui/data/models.py +151 -0
- package/ranger-tui/ranger_tui/screens/__init__.py +16 -0
- package/ranger-tui/ranger_tui/screens/__pycache__/__init__.cpython-314.pyc +0 -0
- package/ranger-tui/ranger_tui/screens/__pycache__/dashboard.cpython-314.pyc +0 -0
- package/ranger-tui/ranger_tui/screens/__pycache__/modals.cpython-314.pyc +0 -0
- package/ranger-tui/ranger_tui/screens/__pycache__/session.cpython-314.pyc +0 -0
- package/ranger-tui/ranger_tui/screens/__pycache__/task.cpython-314.pyc +0 -0
- package/ranger-tui/ranger_tui/screens/command_palette.py +357 -0
- package/ranger-tui/ranger_tui/screens/dashboard.py +232 -0
- package/ranger-tui/ranger_tui/screens/help.py +103 -0
- package/ranger-tui/ranger_tui/screens/modals.py +95 -0
- package/ranger-tui/ranger_tui/screens/session.py +289 -0
- package/ranger-tui/ranger_tui/screens/task.py +187 -0
- package/ranger-tui/ranger_tui/styles/ranger.tcss +254 -0
- package/ranger-tui/ranger_tui/theme.py +93 -0
- package/ranger-tui/ranger_tui/widgets/__init__.py +23 -0
- package/ranger-tui/ranger_tui/widgets/__pycache__/__init__.cpython-314.pyc +0 -0
- package/ranger-tui/ranger_tui/widgets/__pycache__/accessible.cpython-314.pyc +0 -0
- package/ranger-tui/ranger_tui/widgets/__pycache__/logo.cpython-314.pyc +0 -0
- package/ranger-tui/ranger_tui/widgets/__pycache__/logo_assets.cpython-314.pyc +0 -0
- package/ranger-tui/ranger_tui/widgets/__pycache__/ranger_image.cpython-314.pyc +0 -0
- package/ranger-tui/ranger_tui/widgets/__pycache__/sidebar.cpython-314.pyc +0 -0
- package/ranger-tui/ranger_tui/widgets/__pycache__/topbar.cpython-314.pyc +0 -0
- package/ranger-tui/ranger_tui/widgets/accessible.py +176 -0
- package/ranger-tui/ranger_tui/widgets/agents_table.py +151 -0
- package/ranger-tui/ranger_tui/widgets/header.py +141 -0
- package/ranger-tui/ranger_tui/widgets/logo.py +258 -0
- package/ranger-tui/ranger_tui/widgets/logo_assets.py +62 -0
- package/ranger-tui/ranger_tui/widgets/metrics_panel.py +121 -0
- package/ranger-tui/ranger_tui/widgets/ranger_image.py +91 -0
- package/ranger-tui/ranger_tui/widgets/sessions_table.py +191 -0
- package/ranger-tui/ranger_tui/widgets/sidebar.py +91 -0
- package/ranger-tui/ranger_tui/widgets/tasks_table.py +189 -0
- package/ranger-tui/ranger_tui/widgets/topbar.py +168 -0
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
"""
|
|
2
|
+
TopBar widget - App header with title and connection status.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from textual.widget import Widget
|
|
6
|
+
from textual.app import ComposeResult
|
|
7
|
+
from textual.reactive import reactive
|
|
8
|
+
from textual.widgets import Static
|
|
9
|
+
from textual.containers import Horizontal
|
|
10
|
+
|
|
11
|
+
from ranger_tui.widgets.ranger_image import RangerImage
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class TopBar(Widget):
|
|
15
|
+
"""Top bar with logo, title, and connection status indicators."""
|
|
16
|
+
|
|
17
|
+
DEFAULT_CSS = """
|
|
18
|
+
TopBar {
|
|
19
|
+
dock: top;
|
|
20
|
+
height: 6;
|
|
21
|
+
background: $panel;
|
|
22
|
+
layout: horizontal;
|
|
23
|
+
padding: 0 2;
|
|
24
|
+
align: center middle;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.topbar-title-text {
|
|
28
|
+
width: auto;
|
|
29
|
+
height: 100%;
|
|
30
|
+
content-align: center middle;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
#topbar-brand {
|
|
34
|
+
width: auto;
|
|
35
|
+
height: 100%;
|
|
36
|
+
align: center middle;
|
|
37
|
+
margin: 0 1;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
#topbar-view-title {
|
|
41
|
+
width: auto;
|
|
42
|
+
height: 100%;
|
|
43
|
+
content-align: center middle;
|
|
44
|
+
margin-left: 2;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.topbar-spacer {
|
|
48
|
+
width: 1fr;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
#topbar-status-frame {
|
|
52
|
+
width: auto;
|
|
53
|
+
height: auto;
|
|
54
|
+
align: center middle;
|
|
55
|
+
border: round $secondary-darken-2;
|
|
56
|
+
padding: 0 1;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
TopBar > .topbar-status, #topbar-status-frame .topbar-status {
|
|
60
|
+
width: auto;
|
|
61
|
+
height: auto;
|
|
62
|
+
content-align: center middle;
|
|
63
|
+
color: $foreground-muted;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
TopBar .status-ok {
|
|
67
|
+
color: $success;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
TopBar .status-error {
|
|
71
|
+
color: $error;
|
|
72
|
+
}
|
|
73
|
+
"""
|
|
74
|
+
|
|
75
|
+
mongo_ok: reactive[bool] = reactive(False)
|
|
76
|
+
redis_ok: reactive[bool] = reactive(False)
|
|
77
|
+
view_title: reactive[str] = reactive("")
|
|
78
|
+
|
|
79
|
+
def __init__(self, title: str | None = None, view_title: str = "") -> None:
|
|
80
|
+
"""
|
|
81
|
+
Initialize TopBar.
|
|
82
|
+
|
|
83
|
+
Args:
|
|
84
|
+
title: Optional custom title. If None, uses the standard logo.
|
|
85
|
+
view_title: Current view name (e.g., "Sessions", "Tasks")
|
|
86
|
+
"""
|
|
87
|
+
super().__init__()
|
|
88
|
+
self._custom_title = title
|
|
89
|
+
self.view_title = view_title
|
|
90
|
+
|
|
91
|
+
def compose(self) -> ComposeResult:
|
|
92
|
+
# Left spacer (for centering)
|
|
93
|
+
yield Static("", classes="topbar-spacer")
|
|
94
|
+
|
|
95
|
+
# ANASTOPS title
|
|
96
|
+
line1_left = "[bold #00d4ff]▄▀█[/] [bold #00c8ff]█▄[/][bold #00c8ff]█[/] [bold #00bcff]▄▀█[/] [bold #00b0ff]█▀[/] [bold #00a4ff]▀█▀[/] [bold #0098ff]█▀█[/] [bold #008cff]█▀█[/] [bold #0080ff]█▀[/]"
|
|
97
|
+
line2_left = "[bold #00d4ff]█▀█[/] [bold #00c8ff]█[/] [bold #00c8ff]█[/] [bold #00bcff]█▀█[/] [bold #00b0ff]▄█[/] [bold #00a4ff]█[/] [bold #0098ff]█▄█[/] [bold #008cff]█▀▀[/] [bold #0080ff]▄█[/]"
|
|
98
|
+
yield Static(line1_left + "\n" + line2_left, id="topbar-title-left", classes="topbar-title-text", markup=True)
|
|
99
|
+
|
|
100
|
+
# Ranger image in center with circle frame
|
|
101
|
+
with Horizontal(id="topbar-brand"):
|
|
102
|
+
yield RangerImage()
|
|
103
|
+
|
|
104
|
+
# RANGER title
|
|
105
|
+
line1_right = "[bold #ff00ff]█▀█[/] [bold #e600ff]▄▀█[/] [bold #cc00ff]█▄[/][bold #cc00ff]█[/] [bold #b300ff]█▀▀[/] [bold #9900ff]█▀▀[/] [bold #8000ff]█▀█[/]"
|
|
106
|
+
line2_right = "[bold #ff00ff]█▀▄[/] [bold #e600ff]█▀█[/] [bold #cc00ff]█[/] [bold #cc00ff]█[/] [bold #b300ff]█▄█[/] [bold #9900ff]██▄[/] [bold #8000ff]█▀▄[/]"
|
|
107
|
+
yield Static(line1_right + "\n" + line2_right, id="topbar-title-right", classes="topbar-title-text", markup=True)
|
|
108
|
+
|
|
109
|
+
# Right spacer (for centering)
|
|
110
|
+
yield Static("", classes="topbar-spacer")
|
|
111
|
+
|
|
112
|
+
# Status frame on far right
|
|
113
|
+
with Horizontal(id="topbar-status-frame"):
|
|
114
|
+
yield Static("", classes="topbar-status", id="topbar-status", markup=True)
|
|
115
|
+
|
|
116
|
+
def watch_view_title(self, value: str) -> None:
|
|
117
|
+
"""Update view title display."""
|
|
118
|
+
try:
|
|
119
|
+
view_widget = self.query_one("#topbar-view-title", Static)
|
|
120
|
+
if value:
|
|
121
|
+
view_widget.update(f"[bold]{value}[/]")
|
|
122
|
+
else:
|
|
123
|
+
view_widget.update("")
|
|
124
|
+
except Exception:
|
|
125
|
+
pass
|
|
126
|
+
|
|
127
|
+
def set_view_title(self, title: str) -> None:
|
|
128
|
+
"""Set the current view title."""
|
|
129
|
+
self.view_title = title
|
|
130
|
+
|
|
131
|
+
def watch_mongo_ok(self, value: bool) -> None:
|
|
132
|
+
"""Update status when mongo connection changes."""
|
|
133
|
+
self._update_status()
|
|
134
|
+
|
|
135
|
+
def watch_redis_ok(self, value: bool) -> None:
|
|
136
|
+
"""Update status when redis connection changes."""
|
|
137
|
+
self._update_status()
|
|
138
|
+
|
|
139
|
+
def _update_status(self) -> None:
|
|
140
|
+
"""Update the connection status display."""
|
|
141
|
+
try:
|
|
142
|
+
status = self.query_one("#topbar-status", Static)
|
|
143
|
+
mongo = "[bold green]●[/]" if self.mongo_ok else "[bold red]○[/]"
|
|
144
|
+
redis = "[bold green]●[/]" if self.redis_ok else "[bold red]○[/]"
|
|
145
|
+
status.update(f"MongoDB {mongo} Redis {redis}")
|
|
146
|
+
except Exception:
|
|
147
|
+
pass
|
|
148
|
+
|
|
149
|
+
def set_connection_status(self, mongo: bool, redis: bool) -> None:
|
|
150
|
+
"""Set connection status indicators."""
|
|
151
|
+
self.mongo_ok = mongo
|
|
152
|
+
self.redis_ok = redis
|
|
153
|
+
|
|
154
|
+
@property
|
|
155
|
+
def title(self) -> str | None:
|
|
156
|
+
"""Get current title."""
|
|
157
|
+
return self._custom_title
|
|
158
|
+
|
|
159
|
+
@title.setter
|
|
160
|
+
def title(self, value: str | None) -> None:
|
|
161
|
+
"""Set title. Use None or empty string to show the logo."""
|
|
162
|
+
self._custom_title = value
|
|
163
|
+
display_text = value if value else LOGO_COMPACT
|
|
164
|
+
try:
|
|
165
|
+
logo_widget = self.query_one("#topbar-logo", Static)
|
|
166
|
+
logo_widget.update(display_text)
|
|
167
|
+
except Exception:
|
|
168
|
+
pass
|