token-tracker 0.3.3__tar.gz → 0.3.4__tar.gz
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.
- {token_tracker-0.3.3 → token_tracker-0.3.4}/PKG-INFO +1 -1
- {token_tracker-0.3.3 → token_tracker-0.3.4}/pyproject.toml +1 -1
- {token_tracker-0.3.3 → token_tracker-0.3.4}/src/cli.py +42 -4
- {token_tracker-0.3.3 → token_tracker-0.3.4}/token_tracker.egg-info/PKG-INFO +1 -1
- {token_tracker-0.3.3 → token_tracker-0.3.4}/README.md +0 -0
- {token_tracker-0.3.3 → token_tracker-0.3.4}/setup.cfg +0 -0
- {token_tracker-0.3.3 → token_tracker-0.3.4}/src/__init__.py +0 -0
- {token_tracker-0.3.3 → token_tracker-0.3.4}/src/adapters/__init__.py +0 -0
- {token_tracker-0.3.3 → token_tracker-0.3.4}/src/adapters/claude.py +0 -0
- {token_tracker-0.3.3 → token_tracker-0.3.4}/src/adapters/codex.py +0 -0
- {token_tracker-0.3.3 → token_tracker-0.3.4}/src/adapters/rate_limits.py +0 -0
- {token_tracker-0.3.3 → token_tracker-0.3.4}/src/adapters/registry.py +0 -0
- {token_tracker-0.3.3 → token_tracker-0.3.4}/src/adapters/types.py +0 -0
- {token_tracker-0.3.3 → token_tracker-0.3.4}/src/analyzer/__init__.py +0 -0
- {token_tracker-0.3.3 → token_tracker-0.3.4}/src/analyzer/aggregator.py +0 -0
- {token_tracker-0.3.3 → token_tracker-0.3.4}/src/analyzer/blocks.py +0 -0
- {token_tracker-0.3.3 → token_tracker-0.3.4}/src/analyzer/cost.py +0 -0
- {token_tracker-0.3.3 → token_tracker-0.3.4}/src/hooks.py +0 -0
- {token_tracker-0.3.3 → token_tracker-0.3.4}/src/ui/__init__.py +0 -0
- {token_tracker-0.3.3 → token_tracker-0.3.4}/src/ui/tables.py +0 -0
- {token_tracker-0.3.3 → token_tracker-0.3.4}/token_tracker.egg-info/SOURCES.txt +0 -0
- {token_tracker-0.3.3 → token_tracker-0.3.4}/token_tracker.egg-info/dependency_links.txt +0 -0
- {token_tracker-0.3.3 → token_tracker-0.3.4}/token_tracker.egg-info/entry_points.txt +0 -0
- {token_tracker-0.3.3 → token_tracker-0.3.4}/token_tracker.egg-info/requires.txt +0 -0
- {token_tracker-0.3.3 → token_tracker-0.3.4}/token_tracker.egg-info/top_level.txt +0 -0
|
@@ -92,8 +92,6 @@ def _fit_screen(text: str, height: int, scroll_offset: int) -> tuple[str, int]:
|
|
|
92
92
|
|
|
93
93
|
|
|
94
94
|
def _show_interactive_dashboard(agents):
|
|
95
|
-
import tty
|
|
96
|
-
import termios
|
|
97
95
|
import shutil
|
|
98
96
|
from io import StringIO
|
|
99
97
|
from rich.console import Console as RichConsole
|
|
@@ -135,7 +133,7 @@ def _show_interactive_dashboard(agents):
|
|
|
135
133
|
sys.stdout.write("\033[2J\033[3J\033[H" + screen)
|
|
136
134
|
sys.stdout.flush()
|
|
137
135
|
|
|
138
|
-
key = _read_key(
|
|
136
|
+
key = _read_key()
|
|
139
137
|
if key == "left":
|
|
140
138
|
current = (current - 1) % len(agents)
|
|
141
139
|
scroll_offset = 0
|
|
@@ -158,9 +156,11 @@ def _show_interactive_dashboard(agents):
|
|
|
158
156
|
_tables.console = orig
|
|
159
157
|
|
|
160
158
|
|
|
161
|
-
def
|
|
159
|
+
def _read_key_unix():
|
|
162
160
|
import os as _os
|
|
163
161
|
import select
|
|
162
|
+
import tty
|
|
163
|
+
import termios
|
|
164
164
|
fd = sys.stdin.fileno()
|
|
165
165
|
old = termios.tcgetattr(fd)
|
|
166
166
|
try:
|
|
@@ -204,6 +204,44 @@ def _read_key(tty, termios):
|
|
|
204
204
|
termios.tcsetattr(fd, termios.TCSADRAIN, old)
|
|
205
205
|
|
|
206
206
|
|
|
207
|
+
def _read_key_win():
|
|
208
|
+
import msvcrt
|
|
209
|
+
ch = msvcrt.getch()
|
|
210
|
+
if ch in (b"\xe0", b"\x00"):
|
|
211
|
+
ch2 = msvcrt.getch()
|
|
212
|
+
if ch2 == b"K":
|
|
213
|
+
return "left"
|
|
214
|
+
if ch2 == b"M":
|
|
215
|
+
return "right"
|
|
216
|
+
if ch2 == b"H":
|
|
217
|
+
return "up"
|
|
218
|
+
if ch2 == b"P":
|
|
219
|
+
return "down"
|
|
220
|
+
if ch2 == b"I":
|
|
221
|
+
return "page_up"
|
|
222
|
+
if ch2 == b"Q":
|
|
223
|
+
return "page_down"
|
|
224
|
+
return "other"
|
|
225
|
+
if ch == b"h":
|
|
226
|
+
return "left"
|
|
227
|
+
if ch == b"l":
|
|
228
|
+
return "right"
|
|
229
|
+
if ch == b"k":
|
|
230
|
+
return "up"
|
|
231
|
+
if ch == b"j":
|
|
232
|
+
return "down"
|
|
233
|
+
if ch == b"b":
|
|
234
|
+
return "page_up"
|
|
235
|
+
if ch == b"f":
|
|
236
|
+
return "page_down"
|
|
237
|
+
if ch in (b"q", b"Q", b"\x03", b"\x1b"):
|
|
238
|
+
return "quit"
|
|
239
|
+
return "other"
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
_read_key = _read_key_win if sys.platform == "win32" else _read_key_unix
|
|
243
|
+
|
|
244
|
+
|
|
207
245
|
def _get_version() -> str:
|
|
208
246
|
from importlib.metadata import version
|
|
209
247
|
return version("token-tracker")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|