easy-claude 1.0.3 → 1.2.0
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/CHANGELOG.md +17 -0
- package/README.md +26 -9
- package/README.zh-CN.md +28 -13
- package/bin/easy-claude.js +5 -2
- package/native/Overlay.swift +353 -35
- package/native/build/EasyClaudeOverlay.app/Contents/Info.plist +1 -1
- package/native/build/EasyClaudeOverlay.app/Contents/MacOS/EasyClaudeOverlay +0 -0
- package/package.json +3 -1
- package/src/ip-guard/gateway.js +57 -0
- package/src/ip-guard/guard.js +136 -0
- package/src/ip-guard/launcher.js +51 -0
- package/src/ip-guard/service.js +108 -0
- package/src/overlay-guard.js +6 -0
- package/src/overlay-proxy.js +10 -0
- package/src/proxy-config.js +184 -0
- package/src/public-ip.js +10 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# 更新记录
|
|
2
2
|
|
|
3
|
+
## 1.2.0
|
|
4
|
+
|
|
5
|
+
- Add Start Claude proxy (green) and Stop Claude proxy (yellow) below the local proxy address. Save and restore previous proxy fields; require explicit default restoration for legacy settings without a saved baseline. Never restart Claude automatically.
|
|
6
|
+
|
|
7
|
+
- Raise the minimum IP check interval to 60 seconds, including manual/network-triggered checks; migrate saved 30-second settings.
|
|
8
|
+
- Add ipify fallback for IP checks, preserve ipinfo as primary, and cool down rate-limited protection sources for ten minutes.
|
|
9
|
+
- Keep forwarding blocked while revalidation waits; never use fallback to override a valid but non-allowlisted primary IP. IP-only fallback does not fabricate a city/time zone.
|
|
10
|
+
|
|
11
|
+
## 1.1.0
|
|
12
|
+
|
|
13
|
+
- Use a fixed local proxy for normal Claude startup; withdraw the outer desktop sandbox after nested-sandbox helper crashes. Fail closed when the switch is off or IP verification is invalid. Official proxy coverage exceptions remain documented.
|
|
14
|
+
|
|
15
|
+
- Add the exit IP protection switch, local gateway and protected Claude Code launch entry (development; real Claude acceptance pending).
|
|
16
|
+
- Add Launch Claude immediately before Quit; never close an existing desktop automatically.
|
|
17
|
+
- Add a persistent automatic usage refresh switch, off by default; retain manual refresh and HTTP 429 cooldowns.
|
|
18
|
+
- Group Network & protection; synchronize the displayed exit with protection checks and hide stale IPs on failure. Collapse configuration into More settings.
|
|
19
|
+
|
|
3
20
|
## 1.0.3
|
|
4
21
|
|
|
5
22
|
- Refresh usage every five minutes; keep one-minute online confirmation when a reset or availability alert is due.
|
package/README.md
CHANGED
|
@@ -4,15 +4,28 @@
|
|
|
4
4
|
|
|
5
5
|
A lightweight companion for Claude: read CLI account usage, show transparent usage rings and a world clock, and manage them from a native macOS menu bar panel. No model calls or changes to the official application.
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## Exit IP protection (application proxy)
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
- Keep usage valid between polls with a ten-minute stale-data threshold; errors and expired windows remain explicit.
|
|
11
|
-
- HTTP 429 pauses queries for 10 minutes, then up to 15 minutes; success restores normal polling. Manual and reminder queries obey the same cooldown.
|
|
12
|
-
- Keep the half-size AM/PM or Chinese day period beside the floating time, with the city below.
|
|
13
|
-
- Verify background quota refresh with isolated continuous-typing and marked-text checks; do not activate the official application.
|
|
9
|
+
Automatic usage refresh is off by default. Enable it for five-minute refreshes and one-minute confirmation after resets or due alerts; disable it for manual refresh only. Both modes obey rate-limit cooldowns. IP checks and the clock run independently.
|
|
14
10
|
|
|
15
|
-
|
|
11
|
+
Claude Desktop and Claude Code can use the same fixed local proxy: **http://127.0.0.1:18197**. Desktop uses the official `egressProxyUrl` policy; terminal Code uses proxy variables in `~/.claude/settings.json`. Normal Dock, Spotlight and terminal startup stays unchanged. No outer sandbox or application patching is used: the earlier sandboxed desktop launcher conflicted with Chromium's own sandbox and was withdrawn.
|
|
12
|
+
|
|
13
|
+
Enable Exit IP protection and enter the IPv4 allowlist. Only a successful current IP check permits forwarding. Service absent, protection off, unknown/expired/failed check or mismatched IP blocks proxy traffic and closes existing tunnels. Opening easy-claude starts the proxy even while the switch is off; the switch must be on and verification successful to forward. The Launch Claude button before Quit opens the official app normally, only when clicked.
|
|
14
|
+
|
|
15
|
+
Configuration changes require manually reopening Claude; the tool does not restart it. This is application proxy control, not an OS firewall: native updates, external browsers and programs that ignore proxy settings are not fully covered. IPv4 HTTPS CONNECT on port 443 is supported; IPv6 and other target ports are refused by this proxy. Protection covers configured proxy connections and does not guarantee control of every Claude-related network request.
|
|
16
|
+
|
|
17
|
+
Below Local proxy, click green Start Claude proxy to back up and configure Desktop and Code. Desktop changes require administrator approval. Yellow Stop Claude proxy restores saved proxy fields while preserving unrelated later edits; legacy settings without a baseline require confirmation before restoring defaults. Reopen Claude manually after configuration changes.
|
|
18
|
+
|
|
19
|
+
[Setup, proxy configuration and removal](docs/exit-ip-protection.md) · [Development verification](docs/版本/出口IP保护开发管理.md)
|
|
20
|
+
|
|
21
|
+
## v1.2.0 release notes
|
|
22
|
+
|
|
23
|
+
- Add green Start Claude proxy and yellow Stop Claude proxy buttons; save and restore original proxy fields. Legacy settings require confirmation before restoring defaults.
|
|
24
|
+
- Enforce a 60-second minimum IP check interval, including manual/network triggers; migrate saved 30-second settings.
|
|
25
|
+
- Fall back from ipinfo to ipify on lookup failure or rate limiting, with a ten-minute protection-source cooldown for HTTP 429.
|
|
26
|
+
- Keep protection heartbeats alive during menus and confirmations. Updates only inspect settings; they never silently configure proxies or restart Claude.
|
|
27
|
+
|
|
28
|
+
[Release history](CHANGELOG.md) · [1.2.0 development and release](docs/版本/1.2.0开发管理.md)
|
|
16
29
|
|
|
17
30
|
## Install and run
|
|
18
31
|
|
|
@@ -35,13 +48,13 @@ claude auth login
|
|
|
35
48
|
|
|
36
49
|
CLI and desktop login are separate. This tool cannot verify that their accounts match. Missing or stale data is never treated as full or zero usage. API key balances and current conversation context are outside its scope.
|
|
37
50
|
|
|
38
|
-
|
|
51
|
+
Automatic usage refresh is an explicit persistent switch, off by default (300 seconds normally, 60 seconds after resets or due alerts). HTTP 429 still pauses manual requests for 10 minutes, then up to 15 minutes. Successful queries clear the cooldown; failures never imply availability. The published v1.0.3 behavior is described in its release notes above.
|
|
39
52
|
|
|
40
53
|
## Usage rings and recovery
|
|
41
54
|
|
|
42
55
|
The outer thick ring shows weekly usage; the inner thin ring shows the five-hour window. Only windows returned by the service are shown. The center defaults to the five-hour percentage, falling back to weekly; select a quota row to change it. The center has no percent sign. Green means more than 50% remains, orange 20–50%, and red less than 20%.
|
|
43
56
|
|
|
44
|
-
Multiple exhausted windows wait for the latest reset among them. Reaching that time
|
|
57
|
+
Multiple exhausted windows wait for the latest reset among them. Reaching that time waits for automatic confirmation if enabled, or a manual refresh if disabled; it does not assume the account is available. Weekly countdowns use the largest remaining unit, while five-hour countdowns show hours and minutes. Absolute reset times use the system time zone and its 12/24-hour format.
|
|
45
58
|
|
|
46
59
|
## Clock and time zones
|
|
47
60
|
|
|
@@ -102,3 +115,7 @@ A matching `v<version>` tag triggers GitHub Actions validation, universal build
|
|
|
102
115
|
## Known limits
|
|
103
116
|
|
|
104
117
|
CLI login can expire while the desktop remains signed in. Official service responses and network access determine availability. Notification sound, real logout/reboot and cross-machine multi-monitor behavior need separate acceptance; simulated UI tests do not prove those paths.
|
|
118
|
+
|
|
119
|
+
[Version management](https://github.com/UnionSchool/easy-claude/blob/main/docs/版本/README.md)
|
|
120
|
+
|
|
121
|
+
The Network & protection section groups the current exit, allowlist and protection status. With protection on, the displayed exit follows the protection check immediately; failures show unknown instead of an old IP. Expand More settings to edit the allowlist and interval.
|
package/README.zh-CN.md
CHANGED
|
@@ -6,15 +6,28 @@
|
|
|
6
6
|
|
|
7
7
|
需要 Node.js 22+ 与 Claude Code 订阅登录;不支持把 API Key 账单余额当作订阅额度。
|
|
8
8
|
|
|
9
|
-
##
|
|
9
|
+
## 出口 IP 保护(应用代理)
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
- 展示数据有效期为10分钟,避免正常刷新间隔内提前显示未知;查询错误和过期窗口仍明确标记。
|
|
13
|
-
- 遇到429先暂停10分钟,随后最长15分钟;成功后恢复正常频率,手动和提醒查询共用冷却。
|
|
14
|
-
- 浮窗保持时段在时间右侧、字号减半,城市在下方。
|
|
15
|
-
- 隔离测试验证后台额度刷新期间的连续输入及组字保持,不主动激活官方应用。
|
|
11
|
+
“额度自动刷新”默认关闭,关闭时仅手动刷新;开启后每5分钟查询,重置或提醒到点后每分钟确认。手动刷新始终保留,自动和手动均遵守限流冷却。IP复查与时钟独立运行。
|
|
16
12
|
|
|
17
|
-
|
|
13
|
+
Claude App 与 Claude Code CLI 共用固定本机代理 **http://127.0.0.1:18197**。桌面使用官方 `egressProxyUrl` 配置,终端Code使用 `~/.claude/settings.json` 的代理环境变量。保持Dock、Spotlight及终端正常启动,不添加外层沙箱或修改官方程序。此前外层沙箱与Chromium自身沙箱冲突,桌面受保护启动方案已撤回。
|
|
14
|
+
|
|
15
|
+
在“更多设置”中填写IPv4白名单,再打开“出口 IP 保护”。只有本轮IP验证成功且匹配白名单才转发。easy-claude未运行、开关关闭、验证失败/过期/未知或IP不匹配时,代理拒绝新请求并关闭已有隧道。打开工具会启动代理,开关关闭时也保持阻断。“退出”前的“启动 Claude”仅在点击时正常打开官方应用。
|
|
16
|
+
|
|
17
|
+
修改代理后需要用户自行重新打开Claude,不自动重启。此方案是应用代理控制,不是系统防火墙:官方更新器、外部浏览器及忽略代理变量的程序不一定受控。当前代理只支持IPv4 HTTPS CONNECT 443,拒绝IPv6与其他目标端口;尚不能宣称所有Claude相关流量均受保护。
|
|
18
|
+
|
|
19
|
+
在本机代理地址下点击绿色“启动Claude代理”,会先备份再配置Claude App和CLI;桌面部分需要管理员授权。黄色“停止Claude代理”恢复本工具保存的原字段,保留其他新设置;旧版/手动配置无记录时,先确认是否恢复默认网络。配置变更需手动重开Claude。
|
|
20
|
+
|
|
21
|
+
[安装、代理配置、关闭与卸载](docs/出口IP保护.md) · [开发验证记录](docs/版本/出口IP保护开发管理.md)
|
|
22
|
+
|
|
23
|
+
## v1.2.0 更新说明
|
|
24
|
+
|
|
25
|
+
- 新增绿色“启动Claude代理”与黄色“停止Claude代理”,用户点击后配置两端代理或按原记录恢复;旧版无记录时须确认恢复默认。
|
|
26
|
+
- IP最低复查间隔改为60秒,原30秒设置自动迁移;网络变化仍先阻断,等间隔到点再验证。
|
|
27
|
+
- ipinfo失败或限流时使用ipify备用;保护查询源429冷却10分钟,双源失败保持阻断。
|
|
28
|
+
- 菜单或确认框期间保持保护心跳。安装/更新只检查代理,不静默配置、不自动重开Claude。
|
|
29
|
+
|
|
30
|
+
历史版本见[CHANGELOG](CHANGELOG.md),本版见[开发与发布记录](docs/版本/1.2.0开发管理.md)。
|
|
18
31
|
|
|
19
32
|
## 安装与使用
|
|
20
33
|
|
|
@@ -31,7 +44,7 @@ easy-claude show
|
|
|
31
44
|
- macOS 14+;跟随 Claude 桌面应用窗口,前台显示,后台隐藏。默认左下角账户栏右侧,32×32,透明背景,无底板和阴影。
|
|
32
45
|
- 显示剩余百分比:大于 50% 为绿色、20%–50% 橙色、低于 20% 红色;未知或过期为灰色,不伪装满额。
|
|
33
46
|
- 按返回的真实额度自适应:只有周额度时显示单周环和周剩余数字,不显示5小时项;只有5小时则显示单5小时环,两项都有时双环同时显示:周额度为外侧粗实线环,5 小时额度为内侧细实线环(外环未使用部分为淡色虚线底轨),中心数字默认显示 5 小时剩余百分比(环内省略 %,菜单保留),可在菜单点击“5小时”或“周”切换并记住选择;两环独立配色和判断过期。右键查看“5小时 · 剩余百分比 · 重置时间”和“周 · 剩余百分比 · 重置时间”(重置使用电脑本地时区)、刷新、恢复位置或退出,双击刷新,拖动校准。
|
|
34
|
-
-
|
|
47
|
+
- 开启额度自动刷新后每5分钟查询,关闭后仅手动刷新;冷却期间暂停请求;超过有效期或已到重置时间的数据标为过期;接口错误会立即标记未知。
|
|
35
48
|
- 不显示“7天”等底部文字,详情在悬停提示和菜单。状态栏显示产品图标和剩余额度或恢复倒计时。
|
|
36
49
|
- 基于窗口边界定位,不识别头像,不读取桌面聊天或截图;无法自动核对桌面账号与 CLI 账号一致。
|
|
37
50
|
|
|
@@ -90,9 +103,9 @@ npm run build:overlay
|
|
|
90
103
|
|
|
91
104
|
在状态栏图标 或浮窗右键菜单开启“额度可用提醒”。首次开启需允许系统通知。仅在额度耗尽且重置时间有效时启用;当前已可用或数据未知时提示刷新后重试。
|
|
92
105
|
|
|
93
|
-
只有5
|
|
106
|
+
只有5小时或只有周额度时等待对应恢复;两项都耗尽时等待较晚时间,仍有剩余的窗口不参与等待。到点后按额度自动刷新开关自动或手动确认,所有已知窗口均有剩余,才发送一次系统通知和提示音,然后自动关闭开关。若等待期间再次耗尽,会继续等到有效恢复。
|
|
94
107
|
|
|
95
|
-
|
|
108
|
+
开启状态跨更新/重启保存;关闭可取消。提醒遵循额度自动刷新开关;关闭时需手动刷新确认,失败时保留提醒。工具完全退出期间不能提醒,重启后遵循原额度自动刷新开关;系统通知权限、专注模式和声音设置可能影响通知展示或声音。不调用模型、不消耗对话额度。
|
|
96
109
|
|
|
97
110
|
## 公网IP与城市
|
|
98
111
|
|
|
@@ -105,7 +118,7 @@ IP地理库的城市与时区可能存在偏差或互相不一致;显示接口
|
|
|
105
118
|
|
|
106
119
|
## 跟随IP时区
|
|
107
120
|
|
|
108
|
-
菜单开启“跟随IP
|
|
121
|
+
菜单开启“跟随IP时区:ipinfo.io”后,时钟按地理接口返回的IANA时区显示当地时间,自动处理夏令时,继续跟随系统12/24小时制;时钟下方显示IP返回的城市名称,宽度不超过时间文字,手动时区选择隐藏。地理信息每5分钟刷新;关闭保护时点击IP菜单也可刷新。保护开启时该菜单触发保护重新检测,地址同步更新,地理信息仍独立查询。
|
|
109
122
|
|
|
110
123
|
关闭后恢复之前手动选择的城市和时区,并重新显示选择菜单。取不到IP或有效时区时,时钟回退到手动设置的时区,菜单提示“IP时区不可用,显示自定义时间”;开关仍开启,获取成功后继续跟随。开关和手动设置跨重启/更新保存,不保存IP历史。IP地理数据可能不准确,跟随的是出口时区,不修改电脑系统时区。
|
|
111
124
|
|
|
@@ -125,7 +138,7 @@ IP地理库的城市与时区可能存在偏差或互相不一致;显示接口
|
|
|
125
138
|
|
|
126
139
|
未登录显示登录指引;点击复制只写入登录命令到剪贴板,不自动打开终端或运行命令。登录过期、查询失败分别显示,不会因为错误文字含“检查登录”就判为未登录。登录应与官方桌面使用同一账号;本工具无法替用户证明两边账号一致。时间、IP与设置不依赖订阅登录。
|
|
127
140
|
|
|
128
|
-
操作面板采用原生AppKit/SwiftUI,额度查询不调用模型,不新增Node
|
|
141
|
+
操作面板采用原生AppKit/SwiftUI,额度查询不调用模型,不新增Node第三方依赖。状态栏持续更新本地显示,额度按自动刷新开关或手动查询;浮窗仍仅跟随官方应用前台窗口显示。开机启动、提醒和自动更新的原设置继续保留。
|
|
129
142
|
|
|
130
143
|
## 中英文界面
|
|
131
144
|
|
|
@@ -135,4 +148,6 @@ IP地理库的城市与时区可能存在偏差或互相不一致;显示接口
|
|
|
135
148
|
|
|
136
149
|
- 时间浮窗:12小时制显示“10:09 上午”,时间在前,时段在右且字号为数字的一半;城市在下方。英文为“10:09 AM”,24小时制不显示时段。Claude适用;Codex时段放在时间上方,保持各自浮窗边界。
|
|
137
150
|
|
|
138
|
-
|
|
151
|
+
额度自动刷新默认关闭,开启后每5分钟查询,重置/提醒到点每分钟确认,关闭后仅手动。服务返回429后先等待10分钟、后最长15分钟,手动刷新遵守冷却,成功后清零。网络与保护合为一个分区,保护开启时当前出口与保护检测同步更新;失败显示未知,白名单和复查周期在更多设置中修改。关闭保护时IP/城市查询每5分钟刷新。
|
|
152
|
+
|
|
153
|
+
[版本管理](https://github.com/UnionSchool/easy-claude/blob/main/docs/版本/README.md)
|
package/bin/easy-claude.js
CHANGED
|
@@ -6,7 +6,7 @@ import { readUsage, formatUsage } from '../src/usage.js';
|
|
|
6
6
|
|
|
7
7
|
const args = process.argv.slice(2);
|
|
8
8
|
if (args.length === 1 && ['--help', '-h'].includes(args[0])) {
|
|
9
|
-
console.log(L('用法:easy-claude [usage|show|overlay|update]\n显示已登录 Claude 账号的剩余百分比和重置时间。需要 Claude Code 订阅登录。', 'Usage: easy-claude [usage|show|overlay|update]\nShow remaining usage and reset times. Requires Claude Code subscription login.'));
|
|
9
|
+
console.log(L('用法:easy-claude [usage|show|overlay|update|protected]\n显示已登录 Claude 账号的剩余百分比和重置时间。需要 Claude Code 订阅登录。', 'Usage: easy-claude [usage|show|overlay|update|protected]\nShow remaining usage and reset times. Requires Claude Code subscription login.'));
|
|
10
10
|
} else if (args.length === 1 && ['--version', '-v', '-V'].includes(args[0])) {
|
|
11
11
|
console.log(version);
|
|
12
12
|
} else if (args.length === 1 && ['show', 'overlay'].includes(args[0])) {
|
|
@@ -15,10 +15,13 @@ if (args.length === 1 && ['--help', '-h'].includes(args[0])) {
|
|
|
15
15
|
} else if (args.length === 1 && args[0] === 'update') {
|
|
16
16
|
try { const { updateAndShow } = await import('../src/overlay-update.js'); await updateAndShow(); }
|
|
17
17
|
catch (error) { console.error(`easy-claude: ${error.message}`); process.exitCode = 1; }
|
|
18
|
+
} else if (args[0] === 'protected') {
|
|
19
|
+
try { const { runProtectedCode } = await import('../src/ip-guard/launcher.js'); process.exitCode = await runProtectedCode(args.slice(1)); }
|
|
20
|
+
catch (error) { console.error(`easy-claude: ${error.message}`); process.exitCode = 1; }
|
|
18
21
|
} else if (args.length === 0 || (args.length === 1 && args[0] === 'usage')) {
|
|
19
22
|
try { console.log(formatUsage(await readUsage())); }
|
|
20
23
|
catch (error) { console.error(`easy-claude: ${error.message}`); process.exitCode = 1; }
|
|
21
24
|
} else {
|
|
22
|
-
console.error(L('未知参数。用法:easy-claude [usage|show|overlay|update],或 easy-claude --help', 'Unknown argument. Usage: easy-claude [usage|show|overlay|update]; or easy-claude --help'));
|
|
25
|
+
console.error(L('未知参数。用法:easy-claude [usage|show|overlay|update|protected],或 easy-claude --help', 'Unknown argument. Usage: easy-claude [usage|show|overlay|update|protected]; or easy-claude --help'));
|
|
23
26
|
process.exitCode = 1;
|
|
24
27
|
}
|