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.
Files changed (25) hide show
  1. {token_tracker-0.3.3 → token_tracker-0.3.4}/PKG-INFO +1 -1
  2. {token_tracker-0.3.3 → token_tracker-0.3.4}/pyproject.toml +1 -1
  3. {token_tracker-0.3.3 → token_tracker-0.3.4}/src/cli.py +42 -4
  4. {token_tracker-0.3.3 → token_tracker-0.3.4}/token_tracker.egg-info/PKG-INFO +1 -1
  5. {token_tracker-0.3.3 → token_tracker-0.3.4}/README.md +0 -0
  6. {token_tracker-0.3.3 → token_tracker-0.3.4}/setup.cfg +0 -0
  7. {token_tracker-0.3.3 → token_tracker-0.3.4}/src/__init__.py +0 -0
  8. {token_tracker-0.3.3 → token_tracker-0.3.4}/src/adapters/__init__.py +0 -0
  9. {token_tracker-0.3.3 → token_tracker-0.3.4}/src/adapters/claude.py +0 -0
  10. {token_tracker-0.3.3 → token_tracker-0.3.4}/src/adapters/codex.py +0 -0
  11. {token_tracker-0.3.3 → token_tracker-0.3.4}/src/adapters/rate_limits.py +0 -0
  12. {token_tracker-0.3.3 → token_tracker-0.3.4}/src/adapters/registry.py +0 -0
  13. {token_tracker-0.3.3 → token_tracker-0.3.4}/src/adapters/types.py +0 -0
  14. {token_tracker-0.3.3 → token_tracker-0.3.4}/src/analyzer/__init__.py +0 -0
  15. {token_tracker-0.3.3 → token_tracker-0.3.4}/src/analyzer/aggregator.py +0 -0
  16. {token_tracker-0.3.3 → token_tracker-0.3.4}/src/analyzer/blocks.py +0 -0
  17. {token_tracker-0.3.3 → token_tracker-0.3.4}/src/analyzer/cost.py +0 -0
  18. {token_tracker-0.3.3 → token_tracker-0.3.4}/src/hooks.py +0 -0
  19. {token_tracker-0.3.3 → token_tracker-0.3.4}/src/ui/__init__.py +0 -0
  20. {token_tracker-0.3.3 → token_tracker-0.3.4}/src/ui/tables.py +0 -0
  21. {token_tracker-0.3.3 → token_tracker-0.3.4}/token_tracker.egg-info/SOURCES.txt +0 -0
  22. {token_tracker-0.3.3 → token_tracker-0.3.4}/token_tracker.egg-info/dependency_links.txt +0 -0
  23. {token_tracker-0.3.3 → token_tracker-0.3.4}/token_tracker.egg-info/entry_points.txt +0 -0
  24. {token_tracker-0.3.3 → token_tracker-0.3.4}/token_tracker.egg-info/requires.txt +0 -0
  25. {token_tracker-0.3.3 → token_tracker-0.3.4}/token_tracker.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: token-tracker
3
- Version: 0.3.3
3
+ Version: 0.3.4
4
4
  Summary: Track token usage across local AI agents (Claude Code, Codex)
5
5
  Requires-Python: >=3.11
6
6
  Requires-Dist: rich>=13.7
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "token-tracker"
7
- version = "0.3.3"
7
+ version = "0.3.4"
8
8
  description = "Track token usage across local AI agents (Claude Code, Codex)"
9
9
  requires-python = ">=3.11"
10
10
  dependencies = [
@@ -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(tty, termios)
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 _read_key(tty, termios):
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")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: token-tracker
3
- Version: 0.3.3
3
+ Version: 0.3.4
4
4
  Summary: Track token usage across local AI agents (Claude Code, Codex)
5
5
  Requires-Python: >=3.11
6
6
  Requires-Dist: rich>=13.7
File without changes
File without changes