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
wintray_menu.py
ADDED
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
# SPDX-License-Identifier: AGPL-3.0-only
|
|
2
|
+
# Copyright (C) 2026 lollapalooza <https://github.com/aqua5230>
|
|
3
|
+
|
|
4
|
+
"""Shared menu descriptors for the Windows panel and recovery tray menu."""
|
|
5
|
+
|
|
6
|
+
from __future__ import annotations
|
|
7
|
+
|
|
8
|
+
from dataclasses import dataclass
|
|
9
|
+
from typing import Literal
|
|
10
|
+
|
|
11
|
+
type MenuSurface = Literal["panel", "tray"]
|
|
12
|
+
type CheckKey = Literal[
|
|
13
|
+
"active_panel",
|
|
14
|
+
"hide_claude",
|
|
15
|
+
"hide_codex",
|
|
16
|
+
"hide_agy",
|
|
17
|
+
"launch_at_login",
|
|
18
|
+
"quota_notifications",
|
|
19
|
+
"window_keeper",
|
|
20
|
+
"session_resume",
|
|
21
|
+
"terse_mode",
|
|
22
|
+
]
|
|
23
|
+
|
|
24
|
+
PANEL: MenuSurface = "panel"
|
|
25
|
+
TRAY: MenuSurface = "tray"
|
|
26
|
+
_PANEL_ONLY = frozenset({PANEL})
|
|
27
|
+
_TRAY_ONLY = frozenset({TRAY})
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
@dataclass(frozen=True, slots=True)
|
|
31
|
+
class MenuCommand:
|
|
32
|
+
i18n_key: str
|
|
33
|
+
action: str
|
|
34
|
+
surfaces: frozenset[MenuSurface] = _PANEL_ONLY
|
|
35
|
+
checked_by: CheckKey | None = None
|
|
36
|
+
argument_name: str | None = None
|
|
37
|
+
argument_value: str | None = None
|
|
38
|
+
radio: bool = False
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
@dataclass(frozen=True, slots=True)
|
|
42
|
+
class MenuGroup:
|
|
43
|
+
i18n_key: str
|
|
44
|
+
children: tuple[MenuEntry, ...]
|
|
45
|
+
surfaces: frozenset[MenuSurface] = _PANEL_ONLY
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
@dataclass(frozen=True, slots=True)
|
|
49
|
+
class MenuSeparator:
|
|
50
|
+
surfaces: frozenset[MenuSurface]
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
type MenuEntry = MenuCommand | MenuGroup | MenuSeparator
|
|
54
|
+
type Panel = tuple[str, str, str]
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
def windows_menu_model(panels: tuple[Panel, ...]) -> tuple[MenuEntry, ...]:
|
|
58
|
+
"""Describe both Windows menus once; renderers select their own surface."""
|
|
59
|
+
panel_choices: tuple[MenuEntry, ...] = tuple(
|
|
60
|
+
MenuCommand(
|
|
61
|
+
i18n_key,
|
|
62
|
+
"switch_panel",
|
|
63
|
+
checked_by="active_panel",
|
|
64
|
+
argument_name="panelId",
|
|
65
|
+
argument_value=panel_id,
|
|
66
|
+
radio=True,
|
|
67
|
+
)
|
|
68
|
+
for panel_id, i18n_key, _filename in panels
|
|
69
|
+
)
|
|
70
|
+
hidden_sections: tuple[MenuEntry, ...] = (
|
|
71
|
+
MenuCommand(
|
|
72
|
+
"claude_name",
|
|
73
|
+
"toggle_hide_section",
|
|
74
|
+
checked_by="hide_claude",
|
|
75
|
+
argument_name="preferenceKey",
|
|
76
|
+
argument_value="hide_claude_section",
|
|
77
|
+
),
|
|
78
|
+
MenuCommand(
|
|
79
|
+
"codex_name",
|
|
80
|
+
"toggle_hide_section",
|
|
81
|
+
checked_by="hide_codex",
|
|
82
|
+
argument_name="preferenceKey",
|
|
83
|
+
argument_value="hide_codex_section",
|
|
84
|
+
),
|
|
85
|
+
MenuCommand(
|
|
86
|
+
"agy_name",
|
|
87
|
+
"toggle_hide_section",
|
|
88
|
+
checked_by="hide_agy",
|
|
89
|
+
argument_name="preferenceKey",
|
|
90
|
+
argument_value="hide_agy_section",
|
|
91
|
+
),
|
|
92
|
+
)
|
|
93
|
+
return (
|
|
94
|
+
MenuCommand("panel_ai_daily", "open_ai_daily"),
|
|
95
|
+
MenuSeparator(_PANEL_ONLY),
|
|
96
|
+
MenuGroup("switch_panel", panel_choices),
|
|
97
|
+
MenuGroup("hide_sections_menu", hidden_sections),
|
|
98
|
+
MenuSeparator(_PANEL_ONLY),
|
|
99
|
+
MenuCommand("launch_at_login", "toggle_login", checked_by="launch_at_login"),
|
|
100
|
+
MenuCommand(
|
|
101
|
+
"quota_notifications_menu",
|
|
102
|
+
"toggle_quota_notifications",
|
|
103
|
+
checked_by="quota_notifications",
|
|
104
|
+
),
|
|
105
|
+
MenuCommand("window_keeper_menu", "toggle_window_keeper", checked_by="window_keeper"),
|
|
106
|
+
# Grouped with the plain switches above it — a separate section here just
|
|
107
|
+
# added a divider with no real category difference (matches macOS f74bbe0).
|
|
108
|
+
MenuCommand("project_butler", "toggle_session_resume", checked_by="session_resume"),
|
|
109
|
+
MenuCommand("terse_mode_menu", "toggle_terse_mode", checked_by="terse_mode"),
|
|
110
|
+
MenuSeparator(_PANEL_ONLY),
|
|
111
|
+
MenuCommand("check_update", "check_update"),
|
|
112
|
+
MenuCommand(
|
|
113
|
+
"reset_panel_position",
|
|
114
|
+
"reset_panel_position",
|
|
115
|
+
surfaces=_TRAY_ONLY,
|
|
116
|
+
),
|
|
117
|
+
MenuSeparator(_TRAY_ONLY),
|
|
118
|
+
MenuCommand("quit", "quit", surfaces=_TRAY_ONLY),
|
|
119
|
+
)
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
def entries_for_surface(
|
|
123
|
+
entries: tuple[MenuEntry, ...], surface: MenuSurface
|
|
124
|
+
) -> tuple[MenuEntry, ...]:
|
|
125
|
+
"""Select one renderer's entries while keeping separators well formed."""
|
|
126
|
+
selected = [entry for entry in entries if surface in entry.surfaces]
|
|
127
|
+
normalized: list[MenuEntry] = []
|
|
128
|
+
for entry in selected:
|
|
129
|
+
if isinstance(entry, MenuSeparator) and (
|
|
130
|
+
not normalized or isinstance(normalized[-1], MenuSeparator)
|
|
131
|
+
):
|
|
132
|
+
continue
|
|
133
|
+
normalized.append(entry)
|
|
134
|
+
if normalized and isinstance(normalized[-1], MenuSeparator):
|
|
135
|
+
normalized.pop()
|
|
136
|
+
return tuple(normalized)
|