ai-battery 0.1.24 → 0.1.26

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.
package/README.md CHANGED
@@ -1,6 +1,8 @@
1
1
  # AI Battery
2
2
 
3
- 0.1.24: `ai-battery setup`만으로 Claude와 Codex의 사용량 표시를 자동 연결합니다. 원본 Codex 실행 파일과 기존 설정은 보존합니다. `reset settings`는 AI Battery의 변경을 복원하며 npm 패키지 삭제는 별도로 진행합니다.
3
+ 0.1.26: `setup`이 기존 Codex 연동을 해제하던 문제를 수정했습니다. 기존 wrapper·PATH·Codex 상태줄과 tmux 연동을 유지·갱신하며, 실행 중인 셸이 기억하는 경로를 제거하지 않습니다. tmux 미실행 상태를 구분하고 HUD 메뉴의 밝은 테두리를 제거했습니다. 기본 예시는 `ai-battery setup tmux`입니다.
4
+
5
+ 0.1.25: Ubuntu/Linux 패널 HUD를 추가했습니다. macOS와 같은 로고·배터리 바·퍼센트를 표시합니다. 도움말·진단·설정 결과·오류 안내는 간결한 한국어/영어로 표시합니다. 명령 없이 실행하면 도움말을 표시하며 `show` 명령은 제거했습니다. 설정 복원은 `ai-battery reset`으로 실행하고, 이전 `reset settings`·`reset config`도 계속 지원합니다.
4
6
 
5
7
  [한국어](README.md) · [English](docs/i18n/en/) · [日本語](docs/i18n/ja/) · [中文](docs/i18n/zh/) · [Español](docs/i18n/es/)
6
8
 
@@ -19,7 +21,7 @@ Codex와 Claude Code의 남은 사용량을 배터리처럼 확인하는 터미
19
21
 
20
22
  `ai-battery`는 Codex와 Claude Code를 사용하면서 남은 사용량과 리셋 시간을 계속 확인하기 위한 작은 상태 표시 도구입니다.
21
23
 
22
- Codex는 로컬 세션 로그의 `rate_limits` 이벤트를 읽고, Claude Code는 `statusLine` hook이 전달하는 rate-limit payload를 캐시해서 사용합니다. Claude가 실제 429 rate-limit hit를 기록한 경우에는 해당 reset 전까지 그 제한을 0%로 반영합니다. 기본 출력은 한 줄로 작게 유지되며, 실행 중인 도구는 흰색, 실행 중이지 않은 도구는 회색으로 표시합니다. 배터리 바 색상만 잔량에 따라 초록, 주황, 빨강으로 바뀝니다.
24
+ Codex는 로컬 세션 로그의 `rate_limits` 이벤트를 읽고, Claude Code는 `statusLine` hook이 전달하는 rate-limit payload를 캐시해서 사용합니다. Claude가 실제 429 rate-limit hit를 기록한 경우에는 해당 reset 전까지 그 제한을 0%로 반영합니다. 사용량 표시는 한 줄로 작게 유지되며, 실행 중인 도구는 흰색, 실행 중이지 않은 도구는 회색으로 표시합니다. 배터리 바 색상만 잔량에 따라 초록, 주황, 빨강으로 바뀝니다.
23
25
 
24
26
  <img src="docs/terminal-preview.svg" alt="AI Battery terminal preview showing green and red battery bars" width="940">
25
27
 
@@ -44,7 +46,7 @@ Codex 86% │ 5h 18:09 │ 7d 82% ┃ Claude 4% │ 5h 18:10 │ 7d 71%
44
46
  | 색상 기준 | 40% 초과 초록, 21-40% 주황, 20% 이하 빨강으로 배터리만 강조합니다. |
45
47
  | Codex terminal row | Windows에서는 가상 터미널 화면과 배터리 행을 합성하고, WSL/Linux/macOS에서는 PTY wrapper로 별도 사용량 행을 고정합니다. |
46
48
  | Claude statusLine | Claude Code 내장 statusLine hook과 실제 429 hit 로그로 Claude rate limit 상태를 읽습니다. |
47
- | HUD / menu bar | Windows native에서는 terminal-docked/floating HUD, WSL에서는 floating HUD, macOS에서는 menu bar status item을 제공합니다. |
49
+ | HUD / menu bar | Windows/WSL에서는 floating HUD, macOS에서는 menu bar item, Ubuntu/Linux에서는 같은 디자인의 패널 아이콘을 제공합니다. |
48
50
  | npm 실행 | `npm install -g` 또는 `npx`로 실행할 수 있습니다. |
49
51
 
50
52
  ## Platform Support
@@ -55,10 +57,10 @@ Codex 86% │ 5h 18:09 │ 7d 82% ┃ Claude 4% │ 5h 18:10 │ 7d 71%
55
57
  | `ai-battery --watch` | 지원 | 지원 | 지원 | 지원 | 터미널 안에서 주기적으로 갱신합니다. |
56
58
  | Claude statusLine | 지원 | 지원 | 지원 | 지원 | Claude Code `statusLine`에 `node <script>` 명령을 저장합니다. |
57
59
  | Codex fullscreen | 지원 | 지원 | 지원 | 지원 | Windows 기본값은 Fullscreen PTY 화면과 터미널 배터리 행을 합성합니다. WSL/Linux/macOS는 POSIX PTY와 `python3`를 사용합니다. |
58
- | `ai-battery setup codex` | 지원 | 지원 | 지원 | 지원 | 원본 실행 파일을 보존하는 관리형 wrapper로 Codex 사용량을 자동 표시합니다. |
59
- | `ai-battery hud` | 지원 | 지원 | 미지원 | 지원 | Windows/WSL은 PowerShell/WinForms HUD, macOS는 menu bar status item입니다. |
60
+ | `ai-battery setup codex` | 지원 | 지원 | 지원 | 지원 | 기존 연동을 유지·갱신합니다. 새 wrapper나 Codex 설정 변경은 명시적 옵션이 필요합니다. |
61
+ | `ai-battery hud` | 지원 | 지원 | 지원 | 지원 | Ubuntu GNOME는 전용 패널 표시, 다른 Linux 데스크톱은 StatusNotifier 호스트를 사용합니다. |
60
62
 
61
- 실행 중 감지는 Linux/WSL은 `/proc`, macOS는 `ps`, Windows는 PowerShell 프로세스 목록을 사용합니다. 텍스트 출력은 흰색/회색으로, macOS HUD는 실행 중인 항목만 색상 배터리바로 강조하고 비실행 항목은 흐린 회색 계열로 표시합니다.
63
+ 실행 중 감지는 Linux/WSL은 `/proc`, macOS는 `ps`, Windows는 PowerShell 프로세스 목록을 사용합니다. 텍스트 출력은 흰색/회색으로, macOS와 Linux HUD는 실행 중인 항목만 색상 배터리바로 강조하고 비실행 항목은 흐린 회색 계열로 표시합니다.
62
64
 
63
65
  ## Install
64
66
 
@@ -74,6 +76,8 @@ npx ai-battery
74
76
 
75
77
  이전 이름인 `claudex-battery`, `claudex-battery-run`, `claudex-battery-hud` 명령도 호환 alias로 함께 제공됩니다.
76
78
 
79
+ `ai-battery -h`에서 주요 명령을, `ai-battery setup --help`, `ai-battery hud --help`, `ai-battery --watch --help` 등에서 상세 옵션을 확인할 수 있습니다. 도움말, `doctor` 결과, 설정·복원 안내와 오류 메시지는 시스템 언어에 따라 한국어 또는 영어로 표시합니다. 기술 용어·명령·경로와 외부 도구의 오류 원문은 유지합니다. 언어 우선순위는 `LANGUAGE` → `LC_ALL` → `LC_MESSAGES` → `LANG`이며, 다른 언어는 영어로 표시합니다. `LANGUAGE=ko ai-battery -h`로 한국어를 직접 선택할 수도 있습니다.
80
+
77
81
  ## Quick Start
78
82
 
79
83
  1. 패키지를 설치합니다.
@@ -82,40 +86,43 @@ npx ai-battery
82
86
  npm install -g ai-battery
83
87
  ```
84
88
 
85
- 2. Claude statusLine과 Codex 자동 표시를 설정합니다.
89
+ 2. 기존 연동을 갱신하고 Claude statusLine을 설정합니다. Codex wrapper와 tmux를 이미 쓰고 있다면 유지합니다.
86
90
 
87
91
  ```bash
88
92
  ai-battery setup
89
93
  ```
90
94
 
91
- 3. 새 터미널을 열거나 setup이 안내한 셸 갱신 명령을 실행한 뒤, 원래 명령을 그대로 사용합니다.
95
+ 3. 이후에는 원래 명령을 그대로 사용합니다.
92
96
 
93
97
  ```bash
94
98
  claude
95
99
  codex
96
100
  ```
97
101
 
98
- 4. 별도 데스크톱 표시가 필요하면 Windows/WSL/macOS HUD를 실행합니다.
102
+ 4. 터미널 공통 사용량 줄은 tmux에 연결한 뒤 tmux 세션에서 확인합니다. 기존 셸을 종료할 필요는 없습니다.
99
103
 
100
104
  ```bash
101
- ai-battery hud
105
+ ai-battery setup tmux
106
+ tmux
102
107
  ```
103
108
 
109
+ 일반 터미널에서 `codex`를 실행할 때도 사용량 행을 표시하려면 한 번 `ai-battery setup codex --wrap-codex`를 실행하고 안내된 `source` 명령을 현재 셸에 적용하세요. 이후 `setup`과 npm 업데이트에서도 이 선택을 유지합니다. 새로 열린 터미널에는 자동 적용됩니다. 데스크톱 표시는 `ai-battery hud`를 사용합니다.
110
+
104
111
  ## CLI
105
112
 
113
+ `ai-battery`만 실행하면 도움말이 표시됩니다. 사용량은 연동된 상태 표시줄·HUD 또는 `--watch`로 계속 확인합니다.
114
+
106
115
  ```bash
107
- ai-battery
108
- ai-battery --watch 10
109
- ai-battery --json
110
- ai-battery --version
111
- ai-battery --provider codex
112
- ai-battery --provider claude
113
116
  ai-battery setup
114
- ai-battery reset settings
115
- ai-battery doctor
117
+ ai-battery setup tmux
116
118
  ai-battery hud
117
- ai-battery off codex
118
119
  ai-battery on codex
120
+ ai-battery off codex
121
+ ai-battery reset
122
+ ai-battery doctor
123
+ ai-battery --watch 10
124
+ ai-battery --help
125
+ ai-battery --version
119
126
  ```
120
127
 
121
128
  | Option | Description |
@@ -127,25 +134,25 @@ ai-battery on codex
127
134
  | `--show-paths` | 로그 파일 경로와 데이터 관측 시각을 함께 표시합니다. |
128
135
  | `-v`, `--version` | 설치된 `ai-battery` 버전을 출력합니다. |
129
136
 
130
- `doctor`는 설치 상태와 함께 npm latest 버전을 확인합니다. 네트워크가 막혀 있으면 버전 확인만 건너뛰고 나머지 진단은 계속 표시합니다.
137
+ `doctor`는 설치·연동 상태와 npm latest 버전을 간단히 표시합니다. tmux 설정 여부와 현재 세션 안/밖을 구분합니다. 기본 설치에 필요 없는 Codex wrapper와 status_line은 오류로 안내하지 않습니다. 전체 경로·복구 기록 등 상세 정보는 `ai-battery doctor --json`으로 확인합니다. 네트워크가 막혀 있으면 버전 확인만 건너뛰고 나머지 진단은 계속 표시합니다.
131
138
 
132
139
  <a id="uninstall"></a>
133
140
 
134
141
  ## Reset Settings
135
142
 
136
- `ai-battery reset settings`는 AI Battery가 추가한 통합 설정을 원래 값으로 복원하고, 소유권을 확인한 AI Battery 캐시·전용 런타임·생성 파일을 정리합니다. Codex·Claude의 관련 없는 설정과 npm 패키지·실행 명령은 유지합니다. Codex나 Claude의 설정 전체를 기본값으로 초기화하는 명령은 아닙니다.
143
+ `ai-battery reset`은 AI Battery가 추가한 통합 설정을 원래 값으로 복원하고, 소유권을 확인한 AI Battery 캐시·전용 런타임·생성 파일을 정리합니다. Codex·Claude의 관련 없는 설정과 npm 패키지·실행 명령은 유지합니다. Codex나 Claude의 설정 전체를 기본값으로 초기화하는 명령은 아닙니다.
137
144
 
138
145
  ```bash
139
- ai-battery reset settings
146
+ ai-battery reset
140
147
  ```
141
148
 
142
- `ai-battery reset config`도 같은 동작입니다. 일부 통합만 복원하려면 대상을 지정합니다. 대상 지정 시 다른 통합과 공통 캐시는 유지합니다.
149
+ 이전 명령인 `ai-battery reset settings`와 `ai-battery reset config`도 계속 사용할 수 있습니다. 일부 통합만 복원하려면 대상을 지정합니다. 대상 지정 시 다른 통합과 공통 캐시는 유지합니다.
143
150
 
144
151
  ```bash
145
- ai-battery reset settings codex
146
- ai-battery reset settings claude
147
- ai-battery reset settings hud
148
- ai-battery reset settings tmux
152
+ ai-battery reset codex
153
+ ai-battery reset claude
154
+ ai-battery reset hud
155
+ ai-battery reset tmux
149
156
  ```
150
157
 
151
158
  관리 중인 status line이나 설정 블록이 사용자에 의해 변경됐다면 덮어쓰지 않고 복구 기록을 보존하며 종료 코드 1로 알립니다. 관련 없는 Codex·Claude 설정, 사용자 추가 파일, 확인할 수 없는 파일은 보존합니다. 셸·tmux의 사용자 수정도 관리 블록 밖의 내용은 유지합니다. 복구 기록은 해당 항목이 복원되거나 안전하게 제거된 뒤에만 지워집니다.
@@ -153,39 +160,30 @@ ai-battery reset settings tmux
153
160
  패키지까지 삭제하려면 설정 복원이 성공한 다음 npm으로 제거합니다. 로컬 설치는 `npm uninstall ai-battery`, 전역 설치는 아래 명령을 사용합니다. Windows와 WSL, Node 버전별 설치는 각각 진행하세요.
154
161
 
155
162
  ```bash
156
- ai-battery reset settings && npm uninstall -g ai-battery
163
+ ai-battery reset && npm uninstall -g ai-battery
157
164
  hash -r # Bash: 기존 터미널의 삭제된 wrapper 경로 캐시 해제 (zsh: rehash)
158
165
  ```
159
166
 
160
- CLI는 npm 제거를 자동 실행하지 않습니다. `teardown`과 `uninstall`은 호환용 별칭으로 남아 있으며, 동일하게 설정과 생성 파일만 정리합니다. `off`는 표시만 숨깁니다. 이미 npm 패키지를 먼저 지웠다면 다시 설치하고 `reset settings`로 통합부터 복원하세요.
167
+ CLI는 npm 제거를 자동 실행하지 않습니다. `teardown`과 `uninstall`은 호환용 별칭으로 남아 있으며, 동일하게 설정과 생성 파일만 정리합니다. `off`는 표시만 숨깁니다. 이미 npm 패키지를 먼저 지웠다면 다시 설치하고 `reset`으로 통합부터 복원하세요.
161
168
 
162
169
  자식 프로세스인 CLI는 부모 셸의 명령 캐시를 지울 수 없습니다. 새 터미널을 열어도 캐시는 초기화됩니다. 이미 wrapper로 시작한 Codex 세션의 하단 행은 해당 세션을 종료해야 사라집니다.
163
170
 
164
171
  ## Setup
165
172
 
166
- `setup`은 Claude Code의 statusLine hook과 Codex 자동 표시를 한 번에 설정합니다. 이후에는 `claude`, `codex`를 평소처럼 실행하면 됩니다. Codex는 별도 경로의 관리형 wrapper를 사용하며 원본 실행 파일은 교체하지 않습니다. 기존 Codex 설정과 세션 기록도 유지합니다.
173
+ `setup`은 기존 Codex wrapper·PATH·상태줄과 tmux 연동을 유지·갱신하고 Claude statusLine을 설정합니다. 실행 중인 터미널의 경로와 복구용 백업을 제거하지 않습니다. 새 설치에는 Codex wrapper나 Codex 설정을 자동으로 추가하지 않습니다. 연동 해제는 `reset`으로 실행합니다.
167
174
 
168
175
  ```bash
169
176
  ai-battery setup
170
177
  ```
171
178
 
172
- 한 도구만 설정하려면 `ai-battery setup codex` 또는 `ai-battery setup claude`를 사용합니다. 기존 터미널에는 setup 출력의 `source ...` 안내를 적용하고 `hash -r`을 실행하거나, 새 터미널을 여세요. Windows에서는 새 cmd/PowerShell을 엽니다.
179
+ 일부만 설정할 수도 있습니다.
173
180
 
174
- AI Battery 사용량 표시에는 Codex `[tui].status_line` 변경이 필요하지 않습니다. Codex 자체의 모델·디렉터리·브랜치 행도 변경하고 싶을 때만 `--configure-codex-statusline`을 추가합니다. 기존 값은 복원용으로 먼저 기록합니다.
175
-
176
- Codex 자동 연동을 사용하지 않으려면 `ai-battery setup codex --no-wrap-codex`로 해제합니다. 별도 표시에는 `ai-battery --watch 2`나 `ai-battery hud`를, 세션 하나에만 표시하려면 `ai-battery-run -- codex`(POSIX) 또는 `ai-battery-run-win -- codex`(Windows)를 사용합니다.
177
-
178
- Windows와 WSL은 각각 설치한 환경에서 setup을 실행합니다. 아래 Windows runner 설명은 기본 Codex 자동 연동에도 적용됩니다.
179
-
180
- Windows native `cmd`/PowerShell에서는 `codex.cmd` wrapper가 현재 PATH에서 원본 Codex를 매번 찾고, 기본 `composite` runner로 실행합니다. Codex Fullscreen 화면은 `node-pty`의 bundled ConPTY와 `@xterm/headless` 안에서 해석한 뒤, 터미널 최하단의 AI Battery 1행과 합성합니다. Codex의 기본 상태·단축키 행은 본문 스크롤 이동에서 제외하며, 바뀐 화면만 다시 그립니다. 시스템 Node와 Codex 설치는 변경하지 않습니다.
181
-
182
- Windows dock 위치는 `AI_BATTERY_WIN_DOCK_POSITION`으로 선택합니다. 기본값 `bottom`은 터미널 하단에 결합하고, `tabs`는 같은 compact 사용량 행을 상단 탭 바 오른쪽에 고정합니다. PowerShell에서는 `$env:AI_BATTERY_WIN_DOCK_POSITION="tabs"`, cmd에서는 `set AI_BATTERY_WIN_DOCK_POSITION=tabs`를 설정한 뒤 `codex`를 실행합니다. launcher를 직접 확인하려면 `ai-battery hud --dock-console --dock-position tabs`를 사용합니다.
183
-
184
- Windows의 현재 Node가 VT raw 입력을 지원하지 않으면 사용자 데이터 디렉터리의 전용 Node 24.21.0을 사용합니다. 첫 실행에서 공식 Node 배포본을 내려받아 SHA256 검증 후 `node.exe`만 설치하며, PATH는 변경하지 않습니다. 런타임 준비나 PTY 의존성 로드가 실패하면 기존 native HUD로 전환합니다. `AI_BATTERY_RUNTIME_DOWNLOAD=0`은 자동 다운로드를 끕니다. `AI_BATTERY_WIN_LAYOUT=fullscreen` 또는 `hud`는 HUD 방식, `plain`은 추가 표시 없는 직접 실행, `tui`, `reserve`, `overlay`, `inline`은 이전 구현을 확인하기 위한 명시적 모드입니다. `auto`는 기본 `composite`를 선택합니다.
185
-
186
- 기본 compositor 검사는 `npm run smoke:composite`, 실제 Codex Fullscreen 검사는 `npm run smoke:codex-fullscreen-win`, native HUD 경로 검사는 `npm run smoke:fullscreen`으로 실행합니다.
181
+ ```bash
182
+ ai-battery setup tmux
183
+ ai-battery setup codex
184
+ ```
187
185
 
188
- Windows rowpty 문제를 재현할 때는 말로 설명하지 말고 smoke report를 남기는 쪽이 가장 빠릅니다. WSL에서는 `npm run smoke:wsl-win`을 실행하면 새 Windows PowerShell 콘솔을 열어 실제 Windows 콘솔 핸들에서 테스트하고, `rowpty-smoke-report.json`을 repo 루트에 저장합니다. Windows native 터미널에서는 `npm run smoke:win`을 바로 실행하면 됩니다. smoke test는 `cmd.exe` child와 `powershell.exe` child를 모두 rowpty 안에서 실행합니다. report에는 rowpty 사용 여부, overlay/node-pty fallback 여부, 키 입력 없이 delayed output이 화면 버퍼에 나타났는지, status row가 보였는지, `CSI 3J` 이후 scrollback sentinel이 남았는지가 case별로 기록됩니다.
186
+ 기존처럼 `codex` 명령에 wrapper를 연결하려는 경우에만 `ai-battery setup codex --wrap-codex`를 사용합니다. Codex `[tui].status_line` 변경도 별도 옵션인 `--configure-codex-statusline`이 필요합니다. 두 옵션은 실행 경로나 사용자 설정을 변경하므로 기본값에서 제외되어 있습니다. 관리형 변경은 복구 기록을 먼저 저장하고, `reset`에서 해당 변경만 복원합니다.
189
187
 
190
188
  tmux에서는 pane마다 하단 행을 예약하면 같은 전역 배터리가 pane 수만큼 중복 표시됩니다. 대신 tmux의 status bar에 세션당 한 번만 표시할 수 있습니다.
191
189
 
@@ -193,7 +191,7 @@ tmux에서는 pane마다 하단 행을 예약하면 같은 전역 배터리가 p
193
191
  ai-battery setup tmux
194
192
  ```
195
193
 
196
- `~/.tmux.conf`에 관리 블록을 추가해 status-right에 배터리를 표시하고(10초 간격 갱신), 이 tmux 안에서 실행되는 `codex`는 pane별 배터리 행을 생략하고 pane 전체를 사용합니다. Claude statusLine도 같은 환경에서는 배터리 행을 접고 header(모델·디렉터리·브랜치) 1행만 표시합니다 — 배터리는 tmux bar에 이미 있기 때문입니다. 적용하려면 `tmux source-file ~/.tmux.conf` 후 새 pane을 여세요. 이 블록은 기존 `status-right` 설정을 덮어쓰므로 `setup all`에 포함되지 않는 opt-in입니다. 해제는 `ai-battery reset settings tmux`, tmux 안에서도 pane별 행을 유지하려면 `AI_BATTERY_TMUX=row`를 설정합니다.
194
+ `~/.tmux.conf`에 관리 블록을 추가해 status-right에 배터리를 표시하고(10초 간격 갱신), 이 tmux 안에서 실행되는 `codex`는 pane별 배터리 행을 생략하고 pane 전체를 사용합니다. Claude statusLine도 같은 환경에서는 배터리 행을 접고 header(모델·디렉터리·브랜치) 1행만 표시합니다 — 배터리는 tmux bar에 이미 있기 때문입니다. tmux 안에서 설정하면 실행 중인 서버에도 즉시 적용합니다. tmux 밖에서는 `실행: tmux`를 안내하며, tmux에 들어가야 줄이 표시됩니다. 기존 `status-right` 내용은 함께 표시합니다. 새 tmux 연동은 opt-in이며 이미 설정한 연동은 이후 `setup`과 `setup all`에서 갱신합니다. 해제는 `ai-battery reset tmux`, tmux 안에서도 pane별 행을 유지하려면 `AI_BATTERY_TMUX=row`를 설정합니다.
197
195
 
198
196
  Codex 하단 행이 보이지 않으면 진단을 실행합니다.
199
197
 
@@ -216,7 +214,7 @@ ai-battery on all
216
214
 
217
215
  ## Codex Terminal Row
218
216
 
219
- `ai-battery setup` 후에는 평소처럼 `codex`를 실행하면 하단에 AI Battery 사용량 행이 표시됩니다. 기존 셸은 setup의 안내에 따라 갱신하거나 새 터미널을 여세요.
217
+ 기본 `codex`는 AI Battery를 거치지 않고 실행됩니다. 사용량을 독립적으로 보려면 `ai-battery --watch 2` 또는 지원 플랫폼에서 `ai-battery hud`를 실행하세요.
220
218
 
221
219
  세션 하나에 하단 행을 추가하려면 명시적으로 실행합니다.
222
220
 
@@ -233,7 +231,21 @@ ai-battery-run --interval 1 --provider all codex
233
231
 
234
232
  Windows 기본 `composite` 모드와 WSL/Linux/macOS 상태줄은 기본 2초 간격으로 사용량을 백그라운드에서 조회합니다. 조회가 느려져도 터미널 입력과 출력은 계속 전달되며, 각 조회는 최대 10초까지 기다립니다. 실패하면 1초 뒤부터 다시 시도하고, 연속 실패 시 재시도 간격을 늘립니다. 이전 정상 값에는 `[stale]`을 붙여 갱신 실패를 알리고, 다음 조회가 성공하면 새 값으로 바꿉니다. 첫 정상 값을 얻기 전에 조회가 실패하면 `AI Battery unavailable`을 표시합니다.
235
233
 
236
- Codex 사용량 로그가 추가·변경되면 기존 캐시의 유효 시간이 남아 있어도 다음 조회에서 다시 읽습니다. 표시되는 값은 로컬 Codex 로그와 Claude statusLine이 마지막으로 제공한 사용량이며, 서버를 직접 조회하는 실시간 사용량은 아닙니다. 로그나 statusLine 자체가 늦게 갱신되면 표시도 늦어질 수 있습니다. `ai-battery --show-paths`로 데이터 관측 시각과 출처를 확인할 수 있습니다.
234
+ Codex 사용량 로그가 추가·변경되면 기존 캐시의 유효 시간이 남아 있어도 다음 조회에서 다시 읽습니다. 표시되는 값은 로컬 Codex 로그와 Claude statusLine이 마지막으로 제공한 사용량이며, 서버를 직접 조회하는 실시간 사용량은 아닙니다. 로그나 statusLine 자체가 늦게 갱신되면 표시도 늦어질 수 있습니다. `ai-battery --watch --show-paths`로 데이터 관측 시각과 출처를 확인할 수 있습니다.
235
+
236
+ ### Windows runner
237
+
238
+ 다음 Windows runner 설명은 직접 runner를 실행하거나 wrapper를 명시적으로 선택한 경우에 적용됩니다.
239
+
240
+ Windows native `cmd`/PowerShell에서는 `codex.cmd` wrapper가 현재 PATH에서 원본 Codex를 매번 찾고, 기본 `composite` runner로 실행합니다. Codex Fullscreen 화면은 `node-pty`의 bundled ConPTY와 `@xterm/headless` 안에서 해석한 뒤, 터미널 최하단의 AI Battery 1행과 합성합니다. Codex의 기본 상태·단축키 행은 본문 스크롤 이동에서 제외하며, 바뀐 화면만 다시 그립니다. 시스템 Node와 Codex 설치는 변경하지 않습니다.
241
+
242
+ Windows dock 위치는 `AI_BATTERY_WIN_DOCK_POSITION`으로 선택합니다. 기본값 `bottom`은 터미널 하단에 결합하고, `tabs`는 같은 compact 사용량 행을 상단 탭 바 오른쪽에 고정합니다. PowerShell에서는 `$env:AI_BATTERY_WIN_DOCK_POSITION="tabs"`, cmd에서는 `set AI_BATTERY_WIN_DOCK_POSITION=tabs`를 설정한 뒤 `codex`를 실행합니다. launcher를 직접 확인하려면 `ai-battery hud --dock-console --dock-position tabs`를 사용합니다.
243
+
244
+ Windows의 현재 Node가 VT raw 입력을 지원하지 않으면 사용자 데이터 디렉터리의 전용 Node 24.21.0을 사용합니다. 첫 실행에서 공식 Node 배포본을 내려받아 SHA256 검증 후 `node.exe`만 설치하며, PATH는 변경하지 않습니다. 런타임 준비나 PTY 의존성 로드가 실패하면 기존 native HUD로 전환합니다. `AI_BATTERY_RUNTIME_DOWNLOAD=0`은 자동 다운로드를 끕니다. `AI_BATTERY_WIN_LAYOUT=fullscreen` 또는 `hud`는 HUD 방식, `plain`은 추가 표시 없는 직접 실행, `tui`, `reserve`, `overlay`, `inline`은 이전 구현을 확인하기 위한 명시적 모드입니다. `auto`는 기본 `composite`를 선택합니다.
245
+
246
+ 기본 compositor 검사는 `npm run smoke:composite`, 실제 Codex Fullscreen 검사는 `npm run smoke:codex-fullscreen-win`, native HUD 경로 검사는 `npm run smoke:fullscreen`으로 실행합니다.
247
+
248
+ Windows rowpty 문제를 재현할 때는 말로 설명하지 말고 smoke report를 남기는 쪽이 가장 빠릅니다. WSL에서는 `npm run smoke:wsl-win`을 실행하면 새 Windows PowerShell 콘솔을 열어 실제 Windows 콘솔 핸들에서 테스트하고, `rowpty-smoke-report.json`을 repo 루트에 저장합니다. Windows native 터미널에서는 `npm run smoke:win`을 바로 실행하면 됩니다. smoke test는 `cmd.exe` child와 `powershell.exe` child를 모두 rowpty 안에서 실행합니다. report에는 rowpty 사용 여부, overlay/node-pty fallback 여부, 키 입력 없이 delayed output이 화면 버퍼에 나타났는지, status row가 보였는지, `CSI 3J` 이후 scrollback sentinel이 남았는지가 case별로 기록됩니다.
237
249
 
238
250
  ## Claude StatusLine
239
251
 
@@ -269,7 +281,7 @@ ai-battery hud -Mode statusline -Position bottomcenter
269
281
  제거:
270
282
 
271
283
  ```bash
272
- ai-battery reset settings claude
284
+ ai-battery reset claude
273
285
  ```
274
286
 
275
287
  Claude가 한 번 이상 statusLine payload를 전달해야 Claude의 사용량 캐시가 생성됩니다. 그 전에는 Claude 로컬 로그 기반 fallback이 표시됩니다.
@@ -282,7 +294,24 @@ Claude가 한 번 이상 statusLine payload를 전달해야 Claude의 사용량
282
294
  ai-battery hud
283
295
  ```
284
296
 
285
- HUD는 백그라운드에서 실행되고 터미널을 바로 돌려줍니다. Windows HUD는 위치를 드래그로 옮길 수 있으며, 다음 실행 때 저장된 위치를 재사용합니다. macOS menu bar item은 시스템 메뉴바 오른쪽 영역에 표시됩니다.
297
+ HUD는 백그라운드에서 실행되고 터미널을 바로 돌려줍니다. Windows HUD는 위치를 드래그로 옮길 수 있으며, 다음 실행 때 저장된 위치를 재사용합니다. macOS menu bar item은 시스템 메뉴바 오른쪽 영역에, Ubuntu/Linux HUD는 데스크톱 패널에 표시됩니다.
298
+
299
+ ### Ubuntu / Linux
300
+
301
+ Ubuntu GNOME에서는 상단 패널과 클릭 메뉴 모두 macOS와 같은 SVG를 사용합니다. 클릭하면 도구명, 그래픽 배터리 바, 퍼센트, 5h 리셋 시각과 7d 잔량을 같은 크기와 정렬로 표시하며, 아래에 새로고침·종료 메뉴가 있습니다. `ai-battery on/off` 설정도 반영합니다. 화면 잠금이나 패널 재시작 후에는 자동으로 다시 연결됩니다.
302
+
303
+ GNOME 45–50에서는 처음 실행할 때 전용 표시 확장을 `~/.local/share/gnome-shell/extensions/ai-battery@hnode.dev`에 설치하고 활성화합니다. `XDG_DATA_HOME`을 지정한 경우 해당 경로를 사용합니다. 새 확장을 읽으려면 최초 한 번 로그아웃·로그인이 필요합니다. 그 전이나 다른 데스크톱에서는 기본 StatusNotifier 메뉴를 사용합니다. 확장만 비활성화해도 기본 패널 아이콘으로 복귀합니다.
304
+
305
+ GJS, libdbusmenu와 StatusNotifier 호스트가 필요합니다. 현재 Ubuntu 환경에서는 추가 설치 없이 실행됩니다. 구성 요소가 없다면 다음 명령으로 설치하고 Ubuntu AppIndicators 확장을 활성화하세요.
306
+
307
+ ```bash
308
+ sudo apt install gjs gir1.2-dbusmenu-glib-0.4
309
+ ai-battery hud
310
+ ```
311
+
312
+ `ai-battery hud autostart on`은 `~/.config/autostart/ai-battery-hud.desktop`에 로그인 자동 실행을 등록합니다. `XDG_CONFIG_HOME`이 있으면 해당 경로를 사용합니다. 기본 실행은 자동 실행을 등록하지 않습니다. `ai-battery reset hud`는 실행 중인 HUD를 종료하고 AI Battery 소유의 자동 실행 등록과 GNOME 표시 확장을 제거합니다.
313
+
314
+ GNOME 메뉴를 별도 Wayland 세션에서 검증하려면 `npm run smoke:linux`를 실행하세요. 결과와 실제 메뉴 캡처는 `.cache/linux-gnome-menu/`에 저장됩니다.
286
315
 
287
316
  ```text
288
317
  Codex [battery:88] │ 5h 00:47 │ 7d 93%
@@ -291,16 +320,16 @@ Claude [battery:76] │ 5h 00:47 │ 7d 59%
291
320
 
292
321
  | Command | Role |
293
322
  | ------------------------------------------------------------ | ----------------------------------------------------------------------------------------------- |
294
- | `ai-battery hud` / `ai-battery hud start` | Windows floating HUD 또는 macOS menu bar item을 시작합니다. |
323
+ | `ai-battery hud` / `ai-battery hud start` | Windows HUD 또는 macOS/Linux 패널 표시를 시작합니다. |
295
324
  | `ai-battery hud stop` | 실행 중인 HUD/menu bar item을 종료합니다. (`--stop`도 동일) |
296
325
  | `ai-battery hud status` | HUD/menu bar 실행 여부와 autostart 등록 상태를 보여줍니다. |
297
- | `ai-battery hud autostart on` | Windows 로그인 또는 macOS 로그인 시 자동 실행을 등록합니다. |
326
+ | `ai-battery hud autostart on` | 데스크톱 로그인 시 자동 실행을 등록합니다. |
298
327
  | `ai-battery hud autostart off` | 자동 실행 등록을 해제합니다. |
299
328
  | `ai-battery hud autostart status` | 자동 실행 등록 상태만 보여줍니다. |
300
329
  | `ai-battery hud -Foreground` | 디버깅용으로 터미널에 붙여 실행합니다. |
301
330
  | `ai-battery hud -Once` | 콘솔에서 한 번만 출력합니다. |
302
331
  | `ai-battery hud -Interval 2` | 갱신 주기를 바꿉니다. |
303
- | `ai-battery hud -Mode tray` | Windows tray icon 모드로 실행합니다. macOS에서는 menu bar item이 기본입니다. |
332
+ | `ai-battery hud -Mode tray` | Windows tray icon 모드로 실행합니다. macOS/Linux는 패널 표시가 기본입니다. |
304
333
  | `ai-battery hud light` / `ai-battery hud dark` | Windows floating HUD를 밝은 작업표시줄용 검은 글자 또는 어두운 작업표시줄용 흰 글자로 바꿉니다. |
305
334
  | `ai-battery hud black` / `ai-battery hud white` | 글자색을 직접 검은색 또는 흰색으로 바꿉니다. |
306
335
  | `ai-battery hud --backdrop` / `ai-battery hud --no-backdrop` | Windows floating HUD 글자 뒤 어두운 backing을 켜거나 끕니다. |
@@ -343,6 +372,7 @@ Codex는 최근 세션 로그에서 `rate_limits` 이벤트를 찾습니다. Cla
343
372
  | PTY row | Python 3 | Codex 실행용 reserved terminal row |
344
373
  | HUD launcher | Node.js / Bash compatibility wrapper | Windows native/WSL PowerShell HUD와 macOS menu bar 실행 |
345
374
  | HUD UI | PowerShell WinForms / AppleScriptObjC | Windows floating overlay, tray icon, macOS menu bar item |
375
+ | Linux HUD | GJS / StatusNotifierItem / libdbusmenu | macOS와 같은 패널 이미지와 Linux 상세 메뉴 |
346
376
  | Data | JSONL logs, statusLine JSON | Codex/Claude 사용량 소스 |
347
377
 
348
378
  ## Source Environment
@@ -352,7 +382,7 @@ Codex는 최근 세션 로그에서 `rate_limits` 이벤트를 찾습니다. Cla
352
382
  Codex 데이터는 Codex가 실제로 사용하는 `CODEX_HOME`(기본값 `~/.codex`)의 `sessions`를 읽습니다. AI Battery는 `HOME`, `USERPROFILE`, `CODEX_HOME`을 설정하거나 변경하지 않습니다. `CODEX_HOME`을 바꾸면 Codex 자체의 `/resume` 저장소도 바뀌므로 Windows와 WSL의 경로를 합치는 용도로 사용하지 마세요. 쉼표로 여러 경로를 지정하는 방식도 지원하지 않습니다.
353
383
 
354
384
  ```bash
355
- CODEX_HOME=/path/to/codex-home ai-battery --provider codex
385
+ CODEX_HOME=/path/to/codex-home ai-battery --watch --provider codex
356
386
  ```
357
387
 
358
388
  Windows native와 WSL을 함께 쓰면 두 환경의 세션 저장소는 각각 유지되고 `/resume`도 서로 독립적으로 동작합니다. 계정 공통 값인 Codex 5h/7d 사용량만 AI Battery 전용 `codex-account-usage.json`으로 공유하며, 세션 파일 경로, workspace, 승인/샌드박스 모드는 공유하지 않습니다. 공유 상태 위치를 직접 격리해야 할 때만 `AI_BATTERY_SHARED_USAGE_STATE_DIR`을 설정할 수 있습니다.
@@ -364,5 +394,5 @@ Claude의 사용량 표시는 Claude Code statusLine hook을 설치한 뒤부터
364
394
  - 이 도구는 로컬 로그와 Claude statusLine payload를 읽습니다. 서비스의 공식 과금/한도 화면을 대체하지 않습니다.
365
395
  - Codex rate limit 이벤트가 아직 생성되지 않았거나 오래된 경우 최신 상태와 차이가 있을 수 있습니다.
366
396
  - Claude statusLine은 사용률과 reset 시각만 제공하므로, 실제 hit 상태는 Claude가 남긴 429 rate-limit 로그를 함께 읽어 반영합니다.
367
- - HUD는 Windows에서는 PowerShell/WinForms 기반이고, macOS에서는 menu bar status item 기반입니다. WSL에서는 `powershell.exe`와 `wsl.exe`를 함께 사용합니다.
397
+ - HUD는 Windows에서는 PowerShell/WinForms, macOS에서는 menu bar status item, Linux에서는 GJS와 StatusNotifier 패널을 사용합니다. WSL에서는 `powershell.exe`와 `wsl.exe`를 함께 사용합니다.
368
398
  - `ai-battery-run`은 PTY wrapper입니다. 일부 전체 화면 TUI는 화면을 지우는 escape sequence 때문에 status row가 잠시 흔들릴 수 있습니다.
@@ -376,7 +376,7 @@ def main():
376
376
 
377
377
  set_winsize(master_fd, child_rows, cols)
378
378
  old_term = termios.tcgetattr(sys.stdin.fileno())
379
- child_exit = None
379
+ child_exit = 0
380
380
 
381
381
  def on_resize(_signum, _frame):
382
382
  status.resize()
@@ -451,14 +451,6 @@ def main():
451
451
  termios.tcsetattr(sys.stdin.fileno(), termios.TCSADRAIN, old_term)
452
452
  status.clear()
453
453
 
454
- # PTY EOF/EIO can arrive before waitpid(WNOHANG) observes the exit.
455
- # Reap the child in that case so the wrapper preserves its actual status.
456
- if child_exit is None:
457
- _, wait_status = os.waitpid(pid, 0)
458
- if os.WIFEXITED(wait_status):
459
- child_exit = os.WEXITSTATUS(wait_status)
460
- elif os.WIFSIGNALED(wait_status):
461
- child_exit = 128 + os.WTERMSIG(wait_status)
462
454
  raise SystemExit(child_exit)
463
455
 
464
456
 
@@ -3,12 +3,13 @@
3
3
  import { fileURLToPath } from "node:url";
4
4
 
5
5
  import { main, sameFilePath } from "../lib/platforms/windows/codex-runner.js";
6
+ import { errorText } from "../lib/core/cli-messages.js";
6
7
 
7
8
  export * from "../lib/platforms/windows/codex-runner.js";
8
9
 
9
10
  if (process.argv[1] && sameFilePath(fileURLToPath(import.meta.url), process.argv[1])) {
10
11
  main().catch((error) => {
11
- console.error(`ai-battery-run-win: ${error.message}`);
12
+ console.error(`ai-battery-run-win: ${errorText(error)}`);
12
13
  process.exit(1);
13
14
  });
14
15
  }
package/bin/ai-battery.js CHANGED
@@ -3,12 +3,13 @@
3
3
  import { fileURLToPath } from "node:url";
4
4
 
5
5
  import { main, sameFilePath } from "../lib/cli.js";
6
+ import { errorText } from "../lib/core/cli-messages.js";
6
7
 
7
8
  export * from "../lib/cli.js";
8
9
 
9
10
  if (process.argv[1] && sameFilePath(fileURLToPath(import.meta.url), process.argv[1])) {
10
11
  main().catch((error) => {
11
- console.error(`ai-battery: ${error.message}`);
12
+ console.error(`ai-battery: ${errorText(error)}`);
12
13
  process.exit(1);
13
14
  });
14
15
  }
package/docs/RELEASING.md CHANGED
@@ -1,46 +1,61 @@
1
1
  # npm release
2
2
 
3
- The current release candidate is **0.1.24**, based on the 0.1.23 main branch. Preparing this tarball does not publish it to npm.
3
+ The prepared version is **0.1.26**, following the published 0.1.25. Preparing or pushing this release does not publish it to npm.
4
4
 
5
- ## Changes in 0.1.24
5
+ ## Fixes in 0.1.26
6
6
 
7
- - `ai-battery setup` once again configures both the Claude statusLine and automatic Codex usage display. `setup codex` also enables the Codex wrapper without extra flags.
8
- - Codex runs through a separate managed PATH wrapper. The original executable, existing Codex configuration, session history and npm packages are preserved. Repeated setup remains restorable with `reset settings`.
9
- - `--no-wrap-codex` explicitly disables the automatic integration. `--wrap-codex` remains compatible. `--configure-codex-statusline` only controls Codex's optional built-in model/directory/branch row and is not required for usage display.
10
- - The POSIX runner preserves the original command's exit code when PTY EOF arrives before the child exit is observed. Usage polling failure still allows Codex to run.
11
- - Settings restoration remains separate from npm removal. `reset settings` / `reset config`, with `uninstall` / `teardown` compatibility aliases, do not uninstall packages.
7
+ - `setup` no longer invokes Codex teardown. It refreshes previously selected wrappers in place and preserves PATH blocks, built-in status lines, original-command backups and compatibility paths cached by existing shells. Wrapper replacement is atomic so an already-open script keeps its original bytes. Integration removal is explicit through `reset`.
8
+ - POSIX setup persists the shell PATH block even when the current process already has the shim on PATH. A session-only environment no longer makes setup report success while fresh shells lose the integration.
9
+ - A fresh install still leaves Codex independent until `--wrap-codex` or `--configure-codex-statusline` is requested. Setup explains how to enable terminal display instead of implying that standalone configuration creates a terminal row.
10
+ - Previously selected tmux integration is refreshed by default setup, including after npm updates. Fully removed managed blocks can be installed again without discarding current user configuration. Partial/edited blocks and retargeted symlinks remain protected. tmux commands use the stable bin entrypoint and quote paths for the config parser.
11
+ - Setup inside tmux applies owned status options to the running server without sourcing unrelated user configuration. Setup outside tmux reports `configured` and `Start: tmux`; doctor distinguishes configuration from being inside a tmux session.
12
+ - The GNOME HUD popup removes both the content border and box-pointer border. Korean and English main/setup examples use `ai-battery setup tmux`.
12
13
 
13
- ## Validation
14
+ ## Validation and package preparation
14
15
 
15
- Results are saved under `.cache/releases/0.1.24/`. Tests cover plain setup and targeted setup, original executable/config/session preservation, repeated setup and exact restoration, terminal meter rendering, query failures, exit status propagation, and explicit standalone mode. Native Windows checks use isolated profile/data directories and skip writes to the real user PATH. Desktop cleanup tests use a temporary registry key; macOS ownership tests use a filesystem fixture.
16
+ ```text
17
+ npm run check
18
+ npm run smoke:linux
19
+ mkdir -p .cache/releases/0.1.26
20
+ npm pack --dry-run --json
21
+ npm pack --pack-destination .cache/releases/0.1.26 --json
22
+ ```
23
+
24
+ The regression suite includes real PTYs: an already-running wrapped Codex remains interactive during setup, the same Bash command cache launches it again, a fresh shell displays the usage row, and an attached tmux client displays the bar after live setup. An open wrapper reader retains its old bytes, compatibility command paths and recovery backups survive, and user Codex/shell/tmux settings are compared exactly.
25
+
26
+ Also install 0.1.25 into an isolated npm prefix, open the PTY fixture, upgrade that prefix to the exact 0.1.26 tarball, and run default setup while the original terminal remains open. Save the lifecycle report, package manifest, SHA256 checksum, installed-package smoke report and publish dry-run under `.cache/releases/0.1.26/`.
16
27
 
17
- Native macOS and Windows ARM64 are not verified here.
28
+ The Linux GUI smoke test opens the actual popup in an isolated GNOME 50.1 Wayland session, verifies zero border width for the content and box pointer, and saves a screenshot. It also checks shared macOS SVG size, provider visibility, extension fallback/reconnect and shutdown. Native Windows/macOS runtime tests require their respective environments; platform-neutral regressions still run here.
18
29
 
19
- ## Prepare and publish
30
+ Inspect the tarball for runtime modules, stable bin entrypoints and required platform files. Exclude tests, logs, credentials, node_modules and `.cache`. Publish the exact tested tarball.
31
+
32
+ ## Publish manually
20
33
 
21
34
  ```text
22
- npm run check
23
- npm pack --pack-destination .cache/releases/0.1.24
24
- npm publish .cache/releases/0.1.24/ai-battery-0.1.24.tgz --access public --tag latest
35
+ npm whoami
36
+ npm publish .cache/releases/0.1.26/ai-battery-0.1.26.tgz --access public --tag latest
37
+ npm view ai-battery version dist-tags --json
25
38
  ```
26
39
 
27
- Verify the exact tarball in isolated Windows and POSIX prefixes before publishing. Check that packed files match the tested commit and exclude tests, logs, screenshots, caches and credentials. Complete npm authentication/2FA when requested. If this version is already published, increment it and repeat preparation.
40
+ Authenticate with `npm login` if required, and complete npm 2FA when requested. If 0.1.26 is already published, increment the version and repeat verification. Tag the tested commit `v0.1.26` after publication.
28
41
 
29
- ## Setup and removal
30
-
31
- Run in each installation (Windows and WSL are separate):
42
+ ## Update and enable terminal display
32
43
 
33
44
  ```text
34
- npm install -g ai-battery@0.1.24
45
+ npm install -g ai-battery@0.1.26
35
46
  ai-battery setup
47
+ ai-battery setup tmux
48
+ tmux
36
49
  ```
37
50
 
38
- Open a new terminal, or apply the shell reload instructions from setup and clear Bash's command cache with `hash -r` (zsh: `rehash`). Windows users open a new cmd/PowerShell. A child CLI cannot change the PATH or command cache of its parent shell. The existing 0.1.23 installation can enable Codex integration with `ai-battery setup codex --wrap-codex` before this release is published.
51
+ For a Codex usage row outside tmux, enable it once with `ai-battery setup codex --wrap-codex` and run the printed source command in existing shells. New shells load it automatically. Subsequent setup calls preserve that choice. Re-running setup does not require closing running Codex sessions.
52
+
53
+ GNOME caches loaded extension JavaScript. After its display code changes, sign out and back in when convenient, then start the HUD again. The terminal integration does not require a desktop restart.
39
54
 
40
- Reset and remove a global package separately:
55
+ Restore integrations before explicitly removing the npm package:
41
56
 
42
57
  ```text
43
- ai-battery reset settings && npm uninstall -g ai-battery
58
+ ai-battery reset && npm uninstall -g ai-battery
44
59
  ```
45
60
 
46
- For a local package use `npm uninstall ai-battery`. Edited or unrecognized files and unresolved recovery records are preserved and reported. A running wrapped session retains its loaded code until it exits.
61
+ Reset preserves edited/unrecognized files, incomplete recovery records and unrelated provider settings. It never invokes npm uninstall itself. Only explicit reset removes integrations; existing Bash terminals may then need `hash -r` (zsh: `rehash`).
package/lib/README.md ADDED
@@ -0,0 +1,23 @@
1
+ # Internal module layout
2
+
3
+ The bin directory contains stable executable entrypoints only. Runtime
4
+ implementation belongs under lib:
5
+
6
+ - core: provider-independent usage normalization and terminal formatting.
7
+ - hud: desktop HUD dispatch and shared snapshot prefetch.
8
+ - platforms/runtime.js: cross-platform environment detection helpers.
9
+ - platforms/process-scanner.js: Windows, WSL, macOS, and Linux process scans.
10
+ - platforms/macos: macOS menu bar integration.
11
+ - platforms/linux: GJS StatusNotifierItem and native detail menu, sharing the
12
+ macOS panel artwork; GNOME display extension sharing the full-size macOS
13
+ detail image, Node snapshot worker, and owned XDG/extension setup and cleanup.
14
+ - platforms/windows: Windows Codex runner, compositor, PATH integration, and
15
+ HUD launcher.
16
+ - platforms/windows/hud: WinForms modules. dock.ps1 owns terminal attachment
17
+ and AppBar behavior; windowing.ps1 owns desktop placement; snapshot.ps1 owns
18
+ refresh; rendering.ps1 and controls.ps1 own UI drawing and updates;
19
+ native.ps1 contains Win32 interop.
20
+
21
+ Keep public command paths and test imports pointed at bin. Those entrypoints
22
+ re-export implementation APIs so internal modules can move without breaking
23
+ installed commands or downstream imports.