usage-cli 0.29.32__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.
- adapters/__init__.py +5 -0
- adapters/agy.py +68 -0
- adapters/claude.py +215 -0
- adapters/codex.py +209 -0
- adapters/rate_limits.py +76 -0
- adapters/registry.py +17 -0
- adapters/types.py +139 -0
- agy_disk_cache.py +135 -0
- agy_loader.py +416 -0
- agy_quota_probe.py +748 -0
- agy_window_keeper.py +185 -0
- analyzer/__init__.py +5 -0
- analyzer/aggregator.py +139 -0
- analyzer/blocks.py +80 -0
- analyzer/diagnoser.py +638 -0
- analyzer/insights.py +277 -0
- analyzer/persona_loader.py +199 -0
- analyzer/reporter.py +989 -0
- analyzer/subscription.py +108 -0
- burn_rate.py +75 -0
- cache_quarantine.py +50 -0
- codex_disk_cache.py +227 -0
- codex_events.py +136 -0
- codex_fork_replay.py +111 -0
- codex_loader.py +1426 -0
- codex_paths.py +20 -0
- critter_frames.py +26 -0
- discussion_bridge.py +1196 -0
- discussion_cli.py +844 -0
- discussion_session.py +622 -0
- discussion_usage.py +13 -0
- discussion_window.py +955 -0
- disk_cache_common.py +132 -0
- disk_cache_lifecycle.py +39 -0
- doctor.py +452 -0
- fsevents_watch.py +207 -0
- history_disk_cache.py +110 -0
- history_loader.py +416 -0
- i18n.py +88 -0
- jsonl_limits.py +17 -0
- jsonl_utils.py +40 -0
- login_item.py +154 -0
- main.py +387 -0
- menubar.py +1201 -0
- menubar_actions.py +204 -0
- menubar_agy.py +193 -0
- menubar_chrome.py +156 -0
- menubar_menu.py +169 -0
- menubar_notify.py +102 -0
- menubar_popover.py +233 -0
- menubar_prefs.py +118 -0
- menubar_refresh.py +285 -0
- menubar_state.py +1200 -0
- menubar_title.py +157 -0
- menubar_update.py +123 -0
- panel_window.py +78 -0
- panel_window_state.py +159 -0
- panels/__init__.py +186 -0
- panels/base.py +83 -0
- panels/dynamic_height.py +140 -0
- panels/payload.py +178 -0
- panels/web_panel.py +513 -0
- panels/window_drag.py +56 -0
- prefs.py +44 -0
- pricing.py +452 -0
- project_resolver.py +112 -0
- service_status.py +383 -0
- session_hooks.py +1154 -0
- setup_app.py +171 -0
- setup_hook.py +1011 -0
- statusline_settings.py +160 -0
- talent_market_bridge.py +243 -0
- time_utils.py +24 -0
- tui.py +288 -0
- tui_sprite.py +206 -0
- ui/__init__.py +5 -0
- ui/html_report.py +923 -0
- ui/report_scripts.py +251 -0
- ui/report_styles.py +370 -0
- ui/tables.py +888 -0
- update_checker.py +156 -0
- update_gate.py +66 -0
- update_release_notes.py +49 -0
- usage_cli-0.29.32.data/data/share/usage/i18n.json +2427 -0
- usage_cli-0.29.32.dist-info/METADATA +223 -0
- usage_cli-0.29.32.dist-info/RECORD +109 -0
- usage_cli-0.29.32.dist-info/WHEEL +5 -0
- usage_cli-0.29.32.dist-info/entry_points.txt +3 -0
- usage_cli-0.29.32.dist-info/licenses/LICENSE +663 -0
- usage_cli-0.29.32.dist-info/top_level.txt +80 -0
- usage_cli.py +827 -0
- usage_client.py +487 -0
- usage_diagnosis_snapshot.py +143 -0
- usage_dir_sweeper.py +100 -0
- usage_lang.py +79 -0
- usage_logging.py +75 -0
- usage_notifications.py +96 -0
- usage_rate.py +97 -0
- usage_session_resume.py +913 -0
- usage_statusline.py +810 -0
- usage_statusline_agy.py +397 -0
- usage_statusline_forwarder.py +88 -0
- usage_terse_mode.py +223 -0
- usage_terse_reminder.py +151 -0
- win_login_item.py +53 -0
- window_keeper.py +264 -0
- windows_watch.py +443 -0
- wintray.py +2014 -0
- wintray_menu.py +136 -0
setup_app.py
ADDED
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
# SPDX-License-Identifier: AGPL-3.0-only
|
|
2
|
+
# Copyright (C) 2026 lollapalooza <https://github.com/aqua5230>
|
|
3
|
+
#
|
|
4
|
+
# Part of "usage". Free software licensed under the GNU Affero General Public
|
|
5
|
+
# License v3.0 only; see the LICENSE file for full terms and the warranty disclaimer.
|
|
6
|
+
|
|
7
|
+
from __future__ import annotations
|
|
8
|
+
|
|
9
|
+
import importlib
|
|
10
|
+
import tomllib
|
|
11
|
+
from pathlib import Path
|
|
12
|
+
from typing import Any, cast
|
|
13
|
+
|
|
14
|
+
from setuptools import setup # type: ignore[import-untyped]
|
|
15
|
+
from setuptools.dist import Distribution # type: ignore[import-untyped]
|
|
16
|
+
|
|
17
|
+
APP = ["main.py"]
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def _version() -> str:
|
|
21
|
+
pyproject = Path(__file__).with_name("pyproject.toml")
|
|
22
|
+
with pyproject.open("rb") as file:
|
|
23
|
+
data = tomllib.load(file)
|
|
24
|
+
return str(data["project"]["version"])
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class Py2AppDistribution(Distribution): # type: ignore[misc]
|
|
28
|
+
def __init__(self, attrs: dict[str, object] | None = None) -> None:
|
|
29
|
+
super().__init__(attrs)
|
|
30
|
+
self.install_requires: list[str] = []
|
|
31
|
+
|
|
32
|
+
def finalize_options(self) -> None:
|
|
33
|
+
super().finalize_options()
|
|
34
|
+
self.install_requires = []
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def _py2app_command() -> type[Any]:
|
|
38
|
+
py2app_module: Any = importlib.import_module("py2app.build_app")
|
|
39
|
+
py2app_base = py2app_module.py2app
|
|
40
|
+
|
|
41
|
+
class Py2AppCommand(py2app_base): # type: ignore[misc, valid-type]
|
|
42
|
+
def finalize_options(self) -> None:
|
|
43
|
+
self.distribution.install_requires = []
|
|
44
|
+
super().finalize_options()
|
|
45
|
+
|
|
46
|
+
return Py2AppCommand
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
if __name__ == "__main__":
|
|
50
|
+
version = _version()
|
|
51
|
+
OPTIONS = {
|
|
52
|
+
"argv_emulation": False,
|
|
53
|
+
"iconfile": "assets/usage.icns",
|
|
54
|
+
"resources": [
|
|
55
|
+
"assets/claude.webp",
|
|
56
|
+
"assets/claude_color_menubar.png",
|
|
57
|
+
"assets/codex.webp",
|
|
58
|
+
"assets/codex_color_menubar.png",
|
|
59
|
+
"assets/agy_color_menubar.png",
|
|
60
|
+
"assets/critters",
|
|
61
|
+
"assets/panels",
|
|
62
|
+
"assets/windows",
|
|
63
|
+
"i18n.json",
|
|
64
|
+
"pyproject.toml",
|
|
65
|
+
"usage_statusline.py",
|
|
66
|
+
"usage_statusline_agy.py",
|
|
67
|
+
"usage_statusline_forwarder.py",
|
|
68
|
+
"usage_session_resume.py",
|
|
69
|
+
"usage_terse_mode.py",
|
|
70
|
+
"usage_terse_reminder.py",
|
|
71
|
+
],
|
|
72
|
+
"includes": [
|
|
73
|
+
"AppKit",
|
|
74
|
+
"Foundation",
|
|
75
|
+
"Quartz",
|
|
76
|
+
"WebKit",
|
|
77
|
+
"UserNotifications",
|
|
78
|
+
"objc",
|
|
79
|
+
"menubar",
|
|
80
|
+
"usage_notifications",
|
|
81
|
+
"tui",
|
|
82
|
+
"tui_sprite",
|
|
83
|
+
"usage_client",
|
|
84
|
+
"usage_rate",
|
|
85
|
+
"critter_frames",
|
|
86
|
+
"codex_loader",
|
|
87
|
+
"history_loader",
|
|
88
|
+
"pricing",
|
|
89
|
+
"setup_hook",
|
|
90
|
+
"session_hooks",
|
|
91
|
+
"update_checker",
|
|
92
|
+
"i18n",
|
|
93
|
+
"usage_cli",
|
|
94
|
+
"talent_market_bridge",
|
|
95
|
+
# discussion_window is lazy-imported inside menubar.toggleDiscussion_,
|
|
96
|
+
# so py2app's dependency graph can't reach it (or the three core
|
|
97
|
+
# modules it pulls in) from main.py — list them explicitly.
|
|
98
|
+
"discussion_session",
|
|
99
|
+
"discussion_cli",
|
|
100
|
+
"discussion_bridge",
|
|
101
|
+
"discussion_window",
|
|
102
|
+
"rich",
|
|
103
|
+
"rich.align",
|
|
104
|
+
"rich.console",
|
|
105
|
+
"rich.live",
|
|
106
|
+
"rich.panel",
|
|
107
|
+
"rich.style",
|
|
108
|
+
"rich.table",
|
|
109
|
+
"rich.text",
|
|
110
|
+
],
|
|
111
|
+
"packages": [
|
|
112
|
+
"WebKit",
|
|
113
|
+
"UserNotifications",
|
|
114
|
+
# Unzipped to Resources/lib/python3.13/ instead of python313.zip so the
|
|
115
|
+
# report pipeline never loads through zipimport — that is where a
|
|
116
|
+
# corrupted local file header surfaces as "bad local file header".
|
|
117
|
+
"adapters",
|
|
118
|
+
"analyzer",
|
|
119
|
+
"ui",
|
|
120
|
+
],
|
|
121
|
+
"excludes": [
|
|
122
|
+
# Test suites and build tooling that py2app's module graph drags in
|
|
123
|
+
# but the shipped app never runs. Keeping them out shrinks
|
|
124
|
+
# python313.zip (was ~1665 entries: 426 CPython test, 69 _pytest)
|
|
125
|
+
# and cuts the surface for a corrupt zip entry.
|
|
126
|
+
"test",
|
|
127
|
+
"tests",
|
|
128
|
+
"pytest",
|
|
129
|
+
"_pytest",
|
|
130
|
+
"py2app",
|
|
131
|
+
"modulegraph",
|
|
132
|
+
"altgraph",
|
|
133
|
+
"macholib",
|
|
134
|
+
"pip",
|
|
135
|
+
"wheel",
|
|
136
|
+
"mypy",
|
|
137
|
+
"ruff",
|
|
138
|
+
],
|
|
139
|
+
"plist": {
|
|
140
|
+
"CFBundleIdentifier": "com.lollapalooza.usage",
|
|
141
|
+
"CFBundleName": "usage",
|
|
142
|
+
"CFBundleDisplayName": "usage",
|
|
143
|
+
"CFBundleShortVersionString": version,
|
|
144
|
+
"CFBundleVersion": version,
|
|
145
|
+
"LSUIElement": True,
|
|
146
|
+
"LSMinimumSystemVersion": "12.0",
|
|
147
|
+
"NSHumanReadableCopyright": (
|
|
148
|
+
"Copyright © 2025-2026 lollapalooza. Licensed under AGPL-3.0-only."
|
|
149
|
+
),
|
|
150
|
+
},
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
# Conditionally bundle the compiled instate-cli (built from the separate
|
|
154
|
+
# ~/Developer/instate project) so the talent-market panel works in the
|
|
155
|
+
# shipped .app. Appended at runtime — not in the literal list above — so the
|
|
156
|
+
# packaged-resources test (which parses the literal) stays clean on machines
|
|
157
|
+
# where vendor/instate-cli does not exist. py2app flattens a single-file
|
|
158
|
+
# resource to Resources/<basename> (Resources/instate-cli), which the bridge
|
|
159
|
+
# finds via NSBundle.pathForResource:ofType:.
|
|
160
|
+
_instate_cli = Path(__file__).with_name("vendor") / "instate-cli"
|
|
161
|
+
if _instate_cli.exists():
|
|
162
|
+
cast(list[Any], OPTIONS["resources"]).append("vendor/instate-cli")
|
|
163
|
+
|
|
164
|
+
setup(
|
|
165
|
+
app=APP,
|
|
166
|
+
cmdclass={"py2app": _py2app_command()},
|
|
167
|
+
distclass=Py2AppDistribution,
|
|
168
|
+
options={"py2app": OPTIONS},
|
|
169
|
+
setup_requires=["py2app"],
|
|
170
|
+
install_requires=[],
|
|
171
|
+
)
|