token-tracker 0.2.1__tar.gz → 0.2.3__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.2.1 → token_tracker-0.2.3}/PKG-INFO +1 -1
- {token_tracker-0.2.1 → token_tracker-0.2.3}/README.md +1 -0
- {token_tracker-0.2.1 → token_tracker-0.2.3}/pyproject.toml +1 -1
- {token_tracker-0.2.1 → token_tracker-0.2.3}/src/cli.py +13 -5
- {token_tracker-0.2.1 → token_tracker-0.2.3}/token_tracker.egg-info/PKG-INFO +1 -1
- {token_tracker-0.2.1 → token_tracker-0.2.3}/setup.cfg +0 -0
- {token_tracker-0.2.1 → token_tracker-0.2.3}/src/__init__.py +0 -0
- {token_tracker-0.2.1 → token_tracker-0.2.3}/src/adapters/__init__.py +0 -0
- {token_tracker-0.2.1 → token_tracker-0.2.3}/src/adapters/claude.py +0 -0
- {token_tracker-0.2.1 → token_tracker-0.2.3}/src/adapters/codex.py +0 -0
- {token_tracker-0.2.1 → token_tracker-0.2.3}/src/adapters/rate_limits.py +0 -0
- {token_tracker-0.2.1 → token_tracker-0.2.3}/src/adapters/registry.py +0 -0
- {token_tracker-0.2.1 → token_tracker-0.2.3}/src/adapters/types.py +0 -0
- {token_tracker-0.2.1 → token_tracker-0.2.3}/src/analyzer/__init__.py +0 -0
- {token_tracker-0.2.1 → token_tracker-0.2.3}/src/analyzer/aggregator.py +0 -0
- {token_tracker-0.2.1 → token_tracker-0.2.3}/src/analyzer/blocks.py +0 -0
- {token_tracker-0.2.1 → token_tracker-0.2.3}/src/analyzer/cost.py +0 -0
- {token_tracker-0.2.1 → token_tracker-0.2.3}/src/hooks.py +0 -0
- {token_tracker-0.2.1 → token_tracker-0.2.3}/src/ui/__init__.py +0 -0
- {token_tracker-0.2.1 → token_tracker-0.2.3}/src/ui/tables.py +0 -0
- {token_tracker-0.2.1 → token_tracker-0.2.3}/token_tracker.egg-info/SOURCES.txt +0 -0
- {token_tracker-0.2.1 → token_tracker-0.2.3}/token_tracker.egg-info/dependency_links.txt +0 -0
- {token_tracker-0.2.1 → token_tracker-0.2.3}/token_tracker.egg-info/entry_points.txt +0 -0
- {token_tracker-0.2.1 → token_tracker-0.2.3}/token_tracker.egg-info/requires.txt +0 -0
- {token_tracker-0.2.1 → token_tracker-0.2.3}/token_tracker.egg-info/top_level.txt +0 -0
|
@@ -72,14 +72,14 @@ def _show_interactive_dashboard(agents):
|
|
|
72
72
|
import src.ui.tables as _tables
|
|
73
73
|
|
|
74
74
|
agent_names = [a.name for a in agents]
|
|
75
|
-
console.print(f"[dim]加载数据...[/dim]")
|
|
76
|
-
cache = {a.id: _build_agent_data(a.id, a.name) for a in agents}
|
|
77
|
-
|
|
78
75
|
current = 0
|
|
79
76
|
orig = _tables.console
|
|
80
77
|
|
|
81
78
|
sys.stdout.write("\033[?1049h\033[?25l")
|
|
79
|
+
sys.stdout.write("\033[H\033[J\033[2m加载数据...\033[0m")
|
|
82
80
|
sys.stdout.flush()
|
|
81
|
+
cache = {a.id: _build_agent_data(a.id, a.name) for a in agents}
|
|
82
|
+
|
|
83
83
|
try:
|
|
84
84
|
while True:
|
|
85
85
|
buf = StringIO()
|
|
@@ -94,7 +94,7 @@ def _show_interactive_dashboard(agents):
|
|
|
94
94
|
_tables.console.print(f"[yellow]暂无数据[/yellow]")
|
|
95
95
|
_tables.console = orig
|
|
96
96
|
|
|
97
|
-
sys.stdout.write("\033[
|
|
97
|
+
sys.stdout.write("\033[H\033[J" + buf.getvalue())
|
|
98
98
|
sys.stdout.flush()
|
|
99
99
|
|
|
100
100
|
key = _read_key(tty, termios)
|
|
@@ -140,10 +140,18 @@ def _read_key(tty, termios):
|
|
|
140
140
|
termios.tcsetattr(fd, termios.TCSADRAIN, old)
|
|
141
141
|
|
|
142
142
|
|
|
143
|
+
def _get_version() -> str:
|
|
144
|
+
from importlib.metadata import version
|
|
145
|
+
return version("token-tracker")
|
|
146
|
+
|
|
147
|
+
|
|
143
148
|
def main():
|
|
144
149
|
args = sys.argv[1:]
|
|
145
150
|
command = args[0] if args else "dashboard"
|
|
146
151
|
|
|
152
|
+
if command in ("--version", "-v", "-V"):
|
|
153
|
+
print(f"tt {_get_version()}")
|
|
154
|
+
return
|
|
147
155
|
if command == "setup":
|
|
148
156
|
setup()
|
|
149
157
|
return
|
|
@@ -215,7 +223,7 @@ def main():
|
|
|
215
223
|
render_sessions(stats, limit)
|
|
216
224
|
else:
|
|
217
225
|
console.print(f"[red]未知命令: {command}[/red]")
|
|
218
|
-
console.print("[dim]可用命令: dashboard, daily, weekly, monthly, sessions, claude, codex, setup, unsetup[/dim]")
|
|
226
|
+
console.print("[dim]可用命令: dashboard, daily, weekly, monthly, sessions, claude, codex, setup, unsetup, --version[/dim]")
|
|
219
227
|
sys.exit(1)
|
|
220
228
|
|
|
221
229
|
|
|
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
|