cc-pets 2.5.0 → 2.6.0-beta.1

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.
Files changed (92) hide show
  1. package/CC_BRIDGE.md +47 -5
  2. package/CC_BRIDGE.zh-CN.md +42 -5
  3. package/CONTRIBUTING.md +1 -1
  4. package/CONTRIBUTING.zh-CN.md +1 -1
  5. package/README.md +48 -19
  6. package/README.zh-CN.md +46 -17
  7. package/Resources/AgentIcons/antigravity.icns +0 -0
  8. package/Resources/zh-Hans.lproj/Localizable.strings +64 -15
  9. package/Sources/CCPets/App/CCPetsAppDelegate+AgentEvents.m +7 -3
  10. package/Sources/CCPets/App/CCPetsAppDelegate+AgentStatus.m +11 -3
  11. package/Sources/CCPets/App/CCPetsAppDelegate+Bridge.m +16 -5
  12. package/Sources/CCPets/App/CCPetsAppDelegate+Private.h +11 -1
  13. package/Sources/CCPets/App/CCPetsAppDelegate+Profiles.m +21 -11
  14. package/Sources/CCPets/App/CCPetsAppDelegate+Quota.m +27 -16
  15. package/Sources/CCPets/App/CCPetsAppDelegate+Settings.m +43 -7
  16. package/Sources/CCPets/App/CCPetsAppDelegate+Speech.m +2 -1
  17. package/Sources/CCPets/App/CCPetsAppDelegate+Update.m +3 -3
  18. package/Sources/CCPets/App/CCPetsAppDelegate+Workbench.m +20 -22
  19. package/Sources/CCPets/App/CCPetsAppDelegate.m +14 -6
  20. package/Sources/CCPets/App/CCPetsVersion.h +4 -0
  21. package/Sources/CCPets/App/CCPetsVersion.m +34 -0
  22. package/Sources/CCPets/App/main.m +11 -0
  23. package/Sources/CCPets/Bridge/CCPetsBridge.m +7 -5
  24. package/Sources/CCPets/Bridge/CCPetsBridgeAntigravityApp.h +4 -0
  25. package/Sources/CCPets/Bridge/CCPetsBridgeAntigravityApp.m +119 -0
  26. package/Sources/CCPets/Bridge/CCPetsBridgeCLI.h +3 -1
  27. package/Sources/CCPets/Bridge/CCPetsBridgeCLI.m +172 -17
  28. package/Sources/CCPets/Bridge/CCPetsBridgeCore.m +25 -7
  29. package/Sources/CCPets/Bridge/CCPetsBridgeSetup.m +17 -0
  30. package/Sources/CCPets/Bridge/CCPetsBridgeStore.h +7 -2
  31. package/Sources/CCPets/Bridge/CCPetsBridgeStore.m +92 -11
  32. package/Sources/CCPets/Bridge/CCPetsBridgeTerminalTitle.h +12 -0
  33. package/Sources/CCPets/Bridge/CCPetsBridgeTerminalTitle.m +105 -0
  34. package/Sources/CCPets/Integrations/CCPetsAntigravityConfig.h +17 -0
  35. package/Sources/CCPets/Integrations/CCPetsAntigravityConfig.m +462 -0
  36. package/Sources/CCPets/Integrations/CCPetsAntigravityEvents.h +5 -0
  37. package/Sources/CCPets/Integrations/CCPetsAntigravityEvents.m +180 -0
  38. package/Sources/CCPets/Integrations/CCPetsBridgeTitleRelay.h +3 -0
  39. package/Sources/CCPets/Integrations/CCPetsBridgeTitleRelay.m +463 -0
  40. package/Sources/CCPets/Integrations/CCPetsIntegrations.h +1 -1
  41. package/Sources/CCPets/Integrations/CCPetsIntegrations.m +37 -7
  42. package/Sources/CCPets/Integrations/CCPetsLaunchPreflight.m +15 -5
  43. package/Sources/CCPets/Integrations/CCPetsProfiles.h +2 -1
  44. package/Sources/CCPets/Integrations/CCPetsProfiles.m +112 -81
  45. package/Sources/CCPets/Integrations/CCPetsTerminalFocus.h +5 -1
  46. package/Sources/CCPets/Integrations/CCPetsTerminalFocus.m +163 -40
  47. package/Sources/CCPets/Pet/CCPetsPreviews.m +16 -8
  48. package/Sources/CCPets/Pet/PetView+Menu.m +56 -5
  49. package/Sources/CCPets/Support/CCPetsDoctor.m +126 -37
  50. package/Sources/CCPets/Support/CCPetsPaths.h +5 -0
  51. package/Sources/CCPets/Support/CCPetsPaths.m +15 -0
  52. package/Sources/CCPets/Support/CCPetsPreferences.h +4 -1
  53. package/Sources/CCPets/Support/CCPetsPreferences.m +18 -0
  54. package/Sources/CCPets/UI/CCPetsMenuBarPanel.m +10 -5
  55. package/Sources/CCPets/UI/CCPetsMenuBarSummary.m +9 -6
  56. package/Sources/CCPets/UI/CCPetsSettingsPage.h +3 -0
  57. package/Sources/CCPets/UI/CCPetsSettingsPage.m +189 -8
  58. package/Sources/CCPets/UI/CCPetsUIStyle.m +3 -1
  59. package/Sources/CCPets/UI/CCPetsUsagePage.h +4 -3
  60. package/Sources/CCPets/UI/CCPetsUsagePage.m +69 -43
  61. package/Sources/CCPets/UI/CCPetsUsageStore.m +11 -1
  62. package/Sources/CCPets/UI/CCPetsWorkbenchPages.m +1 -1
  63. package/Sources/CCPets/Usage/CCPetsAntigravityQuota.m +115 -0
  64. package/Sources/CCPets/Usage/CCPetsNormalizedUsage.h +5 -0
  65. package/Sources/CCPets/Usage/CCPetsNormalizedUsage.m +43 -0
  66. package/Sources/CCPets/Usage/CCPetsProviderRegistry+Testing.h +13 -0
  67. package/Sources/CCPets/Usage/CCPetsProviderRegistry.h +25 -0
  68. package/Sources/CCPets/Usage/CCPetsProviderRegistry.m +94 -0
  69. package/Sources/CCPets/Usage/CCPetsQuotaHistory.h +1 -1
  70. package/Sources/CCPets/Usage/CCPetsQuotaHistory.m +11 -8
  71. package/Sources/CCPets/Usage/CCPetsUsage+Internal.h +2 -0
  72. package/Sources/CCPets/Usage/CCPetsUsage+Models.m +206 -14
  73. package/Sources/CCPets/Usage/CCPetsUsage+TokenTotals.m +4 -4
  74. package/Sources/CCPets/Usage/CCPetsUsage.h +7 -2
  75. package/Sources/CCPets/Usage/CCPetsUsageMode.h +2 -0
  76. package/Sources/CCPets/Usage/CCPetsUsageMode.m +29 -4
  77. package/Sources/CCPets/Usage/CCPetsUsageMonitor.h +4 -4
  78. package/Sources/CCPets/Usage/CCPetsUsageMonitor.m +90 -7
  79. package/Sources/CCPets/Usage/QuotaDashboardView+CompactRow.m +81 -0
  80. package/Sources/CCPets/Usage/QuotaDashboardView+Primitives.m +5 -8
  81. package/Sources/CCPets/Usage/QuotaDashboardView+Private.h +26 -4
  82. package/Sources/CCPets/Usage/QuotaDashboardView+Rendering.m +99 -99
  83. package/Sources/CCPets/Usage/QuotaDashboardView.h +9 -10
  84. package/Sources/CCPets/Usage/QuotaDashboardView.m +232 -79
  85. package/THIRD_PARTY_NOTICES.md +5 -4
  86. package/THIRD_PARTY_NOTICES.zh-CN.md +6 -5
  87. package/bin/agy-with-pet +82 -0
  88. package/bin/cc-pets +1 -1
  89. package/bin/claude-with-pet +15 -0
  90. package/bin/codex-with-pet +17 -2
  91. package/package.json +5 -3
  92. package/scripts/install-shell-integration.sh +5 -0
package/CC_BRIDGE.md CHANGED
@@ -5,15 +5,16 @@ English | [简体中文](./CC_BRIDGE.zh-CN.md)
5
5
  CC Bridge lets Claude Code and Codex terminal sessions running on the same Mac discover
6
6
  each other, exchange messages, and wake each other up. It mirrors Claude Code's native
7
7
  cross-session messaging (`ListAgents` / `SendMessage`) and extends it to
8
- Claude ↔ Codex and Codex ↔ Codex.
8
+ Claude ↔ Codex and Codex ↔ Codex. Antigravity CLI can also exchange messages with
9
+ local sessions. Antigravity App conversations support automatic wake-up when the Sidecar is enabled.
9
10
 
10
- It uses only documented extension points of both CLIs: hooks, MCP, and `codex queue`.
11
+ It uses documented extension points including hooks, MCP, `codex queue`, and Antigravity App Sidecars.
11
12
  It does not use internal protocols, inject keystrokes into terminals, or edit transcripts.
12
13
 
13
14
  ## Enable and disable
14
15
 
15
16
  ```bash
16
- cc-pets bridge enable # Write hooks, register the MCP server, and turn CC Bridge on
17
+ cc-pets bridge enable # Configure registered CLI profiles and turn CC Bridge on
17
18
  cc-pets bridge status # Show the switch, options, online sessions, and recent messages
18
19
  cc-pets bridge disable # Remove every CC Bridge integration and turn it off
19
20
  ```
@@ -27,6 +28,7 @@ After enabling:
27
28
  `cc-pets bridge send <name> '<text>'` (delivered messages include this hint).
28
29
  - Running Codex sessions need a **restart**. Then run `/hooks` to trust the cc-pets bridge hooks;
29
30
  Codex skips untrusted hooks, so that session will not appear in the list.
31
+ - Restart Antigravity CLI to load the hooks and Bridge MCP server. Start sessions with `agy`.
30
32
  - Codex asks for approval on every MCP tool call by default (calls fail outright when the approval
31
33
  policy is `never`), and Claude Code asks according to your permission settings. Opt in as needed;
32
34
  see [Options](#options).
@@ -43,6 +45,7 @@ with the saved options when CC Bridge is enabled.
43
45
  cc-pets bridge configure --approve=view,send # No approval prompts in Codex and Claude
44
46
  cc-pets bridge configure --codex-approve=view # Codex only
45
47
  cc-pets bridge configure --claude-allow= # Clear Claude's allow list
48
+ cc-pets bridge configure --agy-allow=view # Antigravity CLI only
46
49
  cc-pets bridge configure --wake=off # Turn off auto-wake
47
50
  cc-pets bridge configure --edit-guard=off # Turn off the reservation edit guard
48
51
  ```
@@ -50,11 +53,18 @@ cc-pets bridge configure --edit-guard=off # Turn off the reservation edit
50
53
  | Option | Description |
51
54
  | --- | --- |
52
55
  | `--approve` / `--codex-approve` / `--claude-allow` | Tools that skip approval. Use groups `view` (list sessions, list reservations, read inbox), `send`, `reserve` (reserve / release), `name`, or tool names. Codex gets a marked block at the end of `~/.codex/config.toml`; Claude gets entries in `~/.claude/settings.json` `permissions.allow` (only `mcp__cc-bridge__*` entries are touched). `disable` removes both |
53
- | `--wake=on\|off` | Wake idle sessions automatically (default on). When off, messages wait in the inbox until the recipient's next prompt, which saves tokens |
56
+ | `--agy-allow` | Opt in to skipping approval for Antigravity CLI. Use the same groups or tool names. `--agy-allow=` clears the list. `--approve` applies to Codex and Claude |
57
+ | `--agy-app=on\|off` | Enable the Antigravity App Sidecar in the default Gemini root. Defaults to off |
58
+ | `--tab-title=on\|off` | Append the Bridge nickname to CLI terminal tab titles. Defaults to off |
59
+ | `--wake=on\|off` | Wake idle Claude Code, supported Codex, and Sidecar-enabled Antigravity App sessions automatically (default on). When off, messages wait in the inbox until the recipient's next prompt, which saves tokens |
54
60
  | `--edit-guard=on\|off` | Pause the first edit to a file another session reserved (default on) |
55
61
 
56
62
  Claude picks up changes immediately; Codex needs a session restart (and re-trusting in `/hooks` when hooks change).
57
63
 
64
+ To enable tab nicknames, right-click the pet and turn on **CC Bridge → Tab nicknames**. Restart the
65
+ CLI session through the CC Pets shell integration to apply the setting. For example, a tab can show
66
+ `Fix quota polling | cc-pets · robin`.
67
+
58
68
  ## Usage
59
69
 
60
70
  Ask in plain language in any session:
@@ -73,6 +83,36 @@ The agent uses these MCP tools:
73
83
  | `list_reservations` | Lists reservations in the current repository, or who reserved a given file. |
74
84
  | `check_inbox` | Reads the inbox manually. Messages are normally delivered automatically. |
75
85
 
86
+ ### Antigravity CLI
87
+
88
+ Enable CC Bridge and make sure `agy` is on your `PATH`. Run `agy` in the project directory.
89
+ Incoming messages wait in the inbox until the next model invocation. Use `list_agents` in another
90
+ session or run `cc-pets bridge status` to find the session's Bridge name.
91
+
92
+ Antigravity CLI's default Gemini root is `~/.gemini`. For a registered custom root, set
93
+ `CC_PETS_ANTIGRAVITY_HOME` when launching. CC Pets uses `config/hooks.json` for CLI hooks,
94
+ `config/mcp_config.json` for the Bridge MCP server, and `antigravity-cli/settings.json` for
95
+ the tool allow list. `cc-pets doctor` checks the hooks, MCP registration and shell launcher.
96
+
97
+ See [Antigravity CLI authentication](https://antigravity.google/docs/cli/install/) for sign-in options.
98
+
99
+ ### Antigravity App
100
+
101
+ Opt in to App conversations by enabling the Sidecar.
102
+
103
+ ```bash
104
+ cc-pets bridge enable --agy-app=on
105
+ ```
106
+
107
+ Restart the App to load the Sidecar and Bridge MCP server. Start a turn in each conversation you
108
+ want to receive messages in, then use `cc-pets bridge status` or `list_agents` from another session
109
+ to find its Bridge name. Keep the App running so the Sidecar can wake the conversation. When
110
+ auto-wake is on, the Sidecar sends a fixed wake-up prompt to the existing conversation with
111
+ `agentapi`. The hook delivers the peer's message separately as a user message with a Bridge source header.
112
+
113
+ The Sidecar uses the App's default `~/.gemini` root. `cc-pets bridge configure --agy-app=off` removes
114
+ the managed Sidecar and its App setting. [Google Sidecars documentation](https://antigravity.google/docs/sidecars#agentapi)
115
+
76
116
  ### Current session identity
77
117
 
78
118
  Every MCP tool accepts an optional `session_id` identifying the caller. Bridge supplies the current ID
@@ -207,6 +247,8 @@ Just ask: "Reserve src/api before you start the refactor, and release it when yo
207
247
  | --- | --- | --- | --- |
208
248
  | Codex | Woken immediately through `codex queue` | Queued after the current turn | Not delivered; receipt is undeliverable |
209
249
  | Claude Code | Woken by a background `asyncRewake` watcher | Injected into the current turn | Not delivered; receipt is undeliverable |
250
+ | Antigravity CLI (`agy`) | Waits for the next model invocation | Picked up on a subsequent model invocation | Not delivered; receipt is undeliverable |
251
+ | Antigravity App with Sidecar enabled | Starts a new turn in the existing conversation | Waits for the conversation or its next model invocation | Not delivered once the App is offline |
210
252
 
211
253
  The Claude Code watcher arms at session start and at the end of every turn. A new watcher replaces the
212
254
  previous one and restarts the wait, which lasts up to about 55 minutes before it exits. If a Claude session stays idle through that gap, messages stay in its
@@ -277,7 +319,7 @@ tool through `~/.cc-pets/bridge-cli.json`, written on every `cc-pets install`; i
277
319
  - A message is limited to 16 KB. A pair of sessions exchanging more than 20 messages within
278
320
  10 minutes is paused to stop two agents from auto-replying to each other in a loop.
279
321
  - Pet status cards and notifications never show message bodies.
280
- - No background daemon: only hooks, the MCP server, and the watcher inside Claude sessions, all of which exit with the session.
322
+ - Hooks, MCP servers, and Claude watchers follow their sessions. The Antigravity Sidecar runs with the App.
281
323
 
282
324
  ## Identity and delivery guarantees
283
325
 
@@ -4,15 +4,15 @@
4
4
 
5
5
  CC Bridge 让本机同时运行的 Claude Code 与 Codex 终端会话互相发现、发消息、唤醒对方,
6
6
  体验对齐 Claude Code 原生的跨会话消息(`ListAgents` / `SendMessage`),并且支持
7
- Claude ↔ Codex、Codex ↔ Codex。
7
+ Claude ↔ Codex、Codex ↔ Codex。Antigravity CLI 也能与本机会话互发消息,启用 Sidecar 的 Antigravity App 支持自动唤醒。
8
8
 
9
- 它只使用两边官方公开的扩展点:hooks、MCP、`codex queue`。不接入任何内部协议,
9
+ 它使用官方公开的扩展点,包括 hooks、MCP、`codex queue` 和 Antigravity App Sidecar。不接入任何内部协议,
10
10
  不向终端注入按键,不修改会话记录。
11
11
 
12
12
  ## 开启与关闭
13
13
 
14
14
  ```bash
15
- cc-pets bridge enable # 写入 hooks、注册 MCP,并打开开关
15
+ cc-pets bridge enable # 配置已登记的 CLI 账号,并打开开关
16
16
  cc-pets bridge status # 查看开关、选项、在线会话与最近消息
17
17
  cc-pets bridge disable # 移除全部 CC Bridge 集成并关闭
18
18
  ```
@@ -25,6 +25,7 @@ cc-pets bridge disable # 移除全部 CC Bridge 集成并关闭
25
25
  在此之前可以在 Bash 里用 `cc-pets bridge send <名字> '<内容>'` 回复(收到的消息里会附带这条提示)。
26
26
  - 已经在运行的 Codex 会话需要**重启**。启动后执行 `/hooks`,信任 cc-pets bridge 的 hooks;
27
27
  未信任的 hooks 会被 Codex 跳过,对应会话不会出现在列表里。
28
+ - 用 `agy` 重启 Antigravity CLI 会话,以加载 Hooks 与 Bridge MCP。
28
29
  - Codex 默认每次调用 MCP 工具都要审批(审批策略为 `never` 时调用会直接失败);Claude Code 首次调用时也会按你的
29
30
  权限设置询问。可以按需放开,见下方[选项](#选项)。
30
31
 
@@ -38,6 +39,7 @@ cc-pets bridge disable # 移除全部 CC Bridge 集成并关闭
38
39
  cc-pets bridge configure --approve=view,send # Codex 与 Claude 同时免审批
39
40
  cc-pets bridge configure --codex-approve=view # 只设 Codex
40
41
  cc-pets bridge configure --claude-allow= # 清空 Claude 免确认
42
+ cc-pets bridge configure --agy-allow=view # 只设 Antigravity CLI 免确认
41
43
  cc-pets bridge configure --wake=off # 关闭自动唤醒
42
44
  cc-pets bridge configure --edit-guard=off # 关闭编辑前预留拦截
43
45
  ```
@@ -45,7 +47,10 @@ cc-pets bridge configure --edit-guard=off # 关闭编辑前预留拦截
45
47
  | 选项 | 说明 |
46
48
  | --- | --- |
47
49
  | `--approve` / `--codex-approve` / `--claude-allow` | 免审批的工具。可写分组 `view`(列会话、查预留、读信箱)、`send`(发消息)、`reserve`(预留 / 释放)、`name`(改名),或具体工具名。Codex 写入 `~/.codex/config.toml` 末尾的带标记块,Claude 写入 `~/.claude/settings.json` 的 `permissions.allow`(只增删 `mcp__cc-bridge__*` 条目);`disable` 时一并移除 |
48
- | `--wake=on\|off` | 自动唤醒空闲会话,默认开。关闭后消息只进信箱,等对方下次收到你的输入时带入,可省 token |
50
+ | `--agy-allow` | 单独设置 Antigravity CLI 的免审批工具,接受同一组分组或工具名。`--agy-allow=` 清空列表。`--approve` 作用于 Codex 和 Claude |
51
+ | `--agy-app=on\|off` | 在默认 Gemini 根目录启用 Antigravity App Sidecar,默认关闭 |
52
+ | `--tab-title=on\|off` | 在 CLI 终端标签标题末尾追加 Bridge 昵称,默认关闭 |
53
+ | `--wake=on\|off` | 自动唤醒空闲的 Claude Code、支持唤醒的 Codex 和启用了 Sidecar 的 Antigravity App 会话,默认开。关闭后消息只进信箱,等对方下次收到你的输入时带入,可省 token |
49
54
  | `--edit-guard=on\|off` | 编辑他人预留的文件时暂停一次,默认开 |
50
55
 
51
56
  运行中的 watcher 会在轮询时检查关闭状态;关闭自动唤醒后不再主动取信,关闭 Bridge 后 CLI 也拒绝发送、改名和收件。
@@ -54,6 +59,9 @@ cc-pets bridge configure --edit-guard=off # 关闭编辑前预留拦截
54
59
 
55
60
  Claude 侧的改动会被热加载;Codex 侧(审批、hooks)需要重启 Codex 会话,hooks 变化后还要在 `/hooks` 中重新信任。
56
61
 
62
+ 在桌宠右键菜单中打开 **CC Bridge → 标签昵称**,再通过 CC Pets 的终端集成重启 CLI 会话。
63
+ 标签标题可显示为 `修复额度轮询 | cc-pets · 知更鸟`。
64
+
57
65
  ## 使用
58
66
 
59
67
  在任意一个会话里直接用自然语言:
@@ -72,6 +80,33 @@ Agent 会调用这些 MCP 工具:
72
80
  | `list_reservations` | 查看当前仓库的所有预留,或某个文件被谁预留。 |
73
81
  | `check_inbox` | 手动读取信箱。正常情况下消息会自动送达,一般不需要调用。 |
74
82
 
83
+ ### Antigravity CLI
84
+
85
+ 开启 CC Bridge 并确保 `agy` 在 `PATH` 中,然后在项目目录运行 `agy`。收到的消息会先留在信箱,
86
+ 等下一次模型调用时带入。在另一个会话中调用 `list_agents`,或运行 `cc-pets bridge status`,
87
+ 即可查到该会话的 Bridge 名字。
88
+
89
+ Antigravity CLI 默认使用 `~/.gemini` 作为 Gemini 根目录。启动时可通过 `CC_PETS_ANTIGRAVITY_HOME` 选择已登记的自定义根目录。
90
+ CC Pets 在根目录下使用 `config/hooks.json` 配置 CLI Hooks,在 `config/mcp_config.json` 注册 Bridge MCP,
91
+ 在 `antigravity-cli/settings.json` 设置工具免审批列表。`cc-pets doctor` 检查 Hooks、MCP 注册和 shell 启动入口。
92
+
93
+ 登录方式见 [Antigravity CLI 认证文档](https://antigravity.google/docs/cli/install/)。
94
+
95
+ ### Antigravity App
96
+
97
+ 运行下面的命令以启用 App 的 Sidecar。
98
+
99
+ ```bash
100
+ cc-pets bridge enable --agy-app=on
101
+ ```
102
+
103
+ 重启 App 加载 Sidecar 和 Bridge MCP。在每个希望收信的对话中启动一轮,然后用 `cc-pets bridge status`
104
+ 或在另一个会话中调用 `list_agents` 找到它的 Bridge 名称。保持 App 运行,Sidecar 才能唤醒对话。
105
+ 开启自动唤醒后,Sidecar 通过 `agentapi` 向原对话提交固定的唤醒提示。Hook 会将队友的正文另行作为用户消息送入,并附上 Bridge 来源标头。
106
+
107
+ Sidecar 使用 App 默认的 `~/.gemini` 根目录。`cc-pets bridge configure --agy-app=off` 会移除 CC Pets 管理的
108
+ Sidecar 和对应的 App 设置。[Google Sidecars 文档](https://antigravity.google/docs/sidecars#agentapi)
109
+
75
110
  ### 当前会话身份
76
111
 
77
112
  所有 MCP 工具都支持可选的 `session_id` 参数,用来标识调用者。Bridge 在 `SessionStart` 和
@@ -191,6 +226,8 @@ Bridge 优先验证当前进程提供的 `CODEX_THREAD_ID` / `CLAUDE_CODE_SESSIO
191
226
  | --- | --- | --- | --- |
192
227
  | Codex | 通过 `codex queue` 立即唤醒 | 排在当前回合之后处理 | 不投递,回执为 undeliverable |
193
228
  | Claude Code | 后台 watcher 通过 `asyncRewake` 唤醒 | 注入当前回合 | 不投递,回执为 undeliverable |
229
+ | Antigravity CLI(`agy`) | 等下一次模型调用 | 后续模型调用时带入 | 不投递,回执为 undeliverable |
230
+ | 已启用 Sidecar 的 Antigravity App | 在原对话中开始新一轮 | 等待对话空闲或后续模型调用 | App 离线后无法投递 |
194
231
 
195
232
  Claude Code 的 watcher 在会话启动和每轮结束时挂上,新挂上的会取代旧的并重新计时,最多等待约 55 分钟后自动退出。
196
233
  如果 Claude 会话在这段空窗期里一直空闲,消息会留在信箱,等用户下次输入时一并带入;
@@ -251,4 +288,4 @@ hook、watcher 或 `check_inbox` 会恢复未确认消息。在输出已到达
251
288
  所以默认关闭,需要你主动开启。
252
289
  - 单条消息最多 16KB。同一对会话 10 分钟内往来超过 20 条会被暂停,防止两个 Agent 互相自动回复形成循环。
253
290
  - 桌宠的状态卡片与系统通知不会显示消息正文。
254
- - 不引入常驻守护进程:只有 hooks、MCP server,以及 Claude 会话内的 watcher,都随会话结束而退出。
291
+ - Hooks、MCP server 和 Claude watcher 都随各自的会话结束而退出。Antigravity Sidecar 随 App 运行。
package/CONTRIBUTING.md CHANGED
@@ -43,7 +43,7 @@ Install preview builds explicitly; the automatic updater accepts stable versions
43
43
  `main` is reserved for stable releases, including the stable GitHub Release and tag.
44
44
  Complete implementation, documentation, screenshots, and validation on `publish`
45
45
  before submitting to `main`; repeat integration checks there before a stable release.
46
- The latest stable GitHub release is **v2.4.0**, covering exact terminal jumps, optional launch protection, CC Bridge reliability, token accounting, and clearer local version diagnostics.
46
+ The latest stable GitHub release is **v2.5.0**, covering menu bar mode, clearer session status and lifecycle tracking, and CC Bridge identity, file reservation, and message delivery fixes.
47
47
  See [release status](docs/release-status.md) for validation and handoff details.
48
48
 
49
49
  ## Localization
@@ -36,7 +36,7 @@ prerelease,并使用如 `2.2.1-rc.1` 的预发布版本号。`main` 仅负责
36
36
  GitHub Release 和 tag。提交到 `main` 前,代码、文档、截图与验证必须全部完成;
37
37
  在 `main` 完成集成验证后才能发布正式版本。
38
38
  测试版本需显式安装,自动更新器只接受正式版本号。
39
- 当前 GitHub 正式版本为 **v2.4.0**,包含终端精准跳转、可选启动保护、CC Bridge 可靠性改进、Token 统计修正及更清晰的本地版本诊断。
39
+ 当前 GitHub 正式版本为 **v2.5.0**,包含菜单栏模式、更清楚的会话状态与生命周期跟踪,以及 CC Bridge 身份、文件预留和消息投递修复。
40
40
  验证和交接状态见[发布状态](docs/release-status.md)。
41
41
 
42
42
  ## 多语言
package/README.md CHANGED
@@ -6,10 +6,8 @@
6
6
 
7
7
  English | [简体中文](./README.zh-CN.md)
8
8
 
9
- A native macOS desktop pet for Codex CLI and Claude Code CLI that needs neither
10
- desktop app. Launch CC Pets directly, or let it appear automatically when Codex CLI
11
- or Claude Code CLI starts. It reads five-hour and weekly quota data from the official
12
- Codex App Server interface and Claude Code's official status line input.
9
+ A native macOS desktop pet for Codex, Claude Code, and Antigravity CLI. Launch CC Pets
10
+ directly or start a supported CLI to see session activity, quota, and local token usage.
13
11
 
14
12
  > The app and CLI are available in English and Simplified Chinese (see [Language](#language)).
15
13
 
@@ -34,9 +32,9 @@ See the [changelog](./CHANGELOG.md) and [release notes](./docs/release-notes-v2.
34
32
 
35
33
  - Supports English and Simplified Chinese in the app and CLI, with live UI language switching.
36
34
  - Offers Classic and native Liquid Glass panel themes on macOS 26 and later.
37
- - Starts with Codex CLI or Claude Code CLI and closes after the last managed CLI exits, unless Codex desktop is still running.
38
- - Shares one pet across multiple simultaneous Codex and Claude sessions.
39
- - Shows five-hour and weekly remaining quota, reset times, local token totals, and seven-day trends.
35
+ - Starts with Codex, Claude Code, or Antigravity CLI and closes when the last CLI launched through CC Pets exits, unless Codex or Antigravity desktop is still running.
36
+ - Shares one pet across simultaneous sessions from supported CLIs.
37
+ - Shows five-hour and weekly remaining quota, reset times, local token counts, and seven-day trends in the hover panel.
40
38
  - Converts reset times to the Mac's current system time zone.
41
39
  - Responds to thinking, tool, approval, subagent, completion, and failure events.
42
40
  - Displays a redacted glass status card with the active CLI session count.
@@ -61,7 +59,7 @@ See the [changelog](./CHANGELOG.md) and [release notes](./docs/release-notes-v2.
61
59
  - macOS 13 or later
62
60
  - Node.js 18 or later, for npm only: it installs and updates CC Pets, while the app and
63
61
  its `cc-pets` commands, hooks and CC Bridge run natively
64
- - Codex CLI and/or Claude Code CLI installed and signed in
62
+ - A configured copy of Codex, Claude Code, or Antigravity CLI (`agy`)
65
63
  - zsh
66
64
  - Xcode Command Line Tools (`xcode-select --install`)
67
65
 
@@ -75,10 +73,12 @@ npm install -g cc-pets@latest --allow-scripts=cc-pets
75
73
  codex
76
74
  # or
77
75
  claude
76
+ # or
77
+ agy
78
78
  ```
79
79
 
80
80
  The `--allow-scripts=cc-pets` option allows recent npm versions to run the
81
- package's `postinstall`. That step builds the native app, installs both hook
81
+ package's `postinstall`. That step builds the native app, installs the supported hook
82
82
  integrations, configures shell shims, and installs `~/Applications/CC Pets.app`.
83
83
  If npm installed the package without running its scripts, initialize it manually:
84
84
 
@@ -123,10 +123,12 @@ cc-pets install
123
123
  codex
124
124
  # or
125
125
  claude
126
+ # or
127
+ agy
126
128
  ```
127
129
 
128
- CC Pets installs `cc-pets`, `codex-with-pet`, and `claude-with-pet`. It creates
129
- `codex` and `claude` shims under `~/.cc-pets/shims` and adds one marked block to
130
+ CC Pets installs `cc-pets`, `codex-with-pet`, `claude-with-pet`, and `agy-with-pet`. It creates
131
+ `codex`, `claude`, and `agy` shims under `~/.cc-pets/shims` and adds one marked block to
130
132
  `~/.zshrc`; the real CLI binaries are not replaced. The shims also handle casing
131
133
  variants on the default case-insensitive macOS filesystem.
132
134
 
@@ -135,6 +137,7 @@ If a real CLI is not on the current `PATH`, set its absolute path:
135
137
  ```bash
136
138
  export CODEX_REAL_BIN=/absolute/path/to/codex
137
139
  export CLAUDE_REAL_BIN=/absolute/path/to/claude
140
+ export AGY_REAL_BIN=/absolute/path/to/agy
138
141
  ```
139
142
 
140
143
  The wrappers pass the current terminal environment through unchanged. They do not
@@ -142,14 +145,21 @@ load or execute `.env` files.
142
145
 
143
146
  ## Multi-Account
144
147
 
145
- CC Pets automatically detects and integrates the official `~/.claude` and
146
- `~/.codex` Homes. Custom Homes such as `~/.claude-x` or `~/.codex-work` are never
148
+ CC Pets automatically detects and integrates the official `~/.claude`, `~/.codex`, and
149
+ `~/.gemini` Homes for installed CLIs. Custom Homes such as `~/.claude-x` or `~/.codex-work` are never
147
150
  scanned automatically: add them explicitly from **Main menu → Multi-Account**.
148
151
  The folder name is used as the account name by default and is preserved exactly;
149
152
  you can rename an account from its Manage menu on the same page. Each provider has its own
150
153
  circular quota-card carousel, and the Usage page can filter local token history
151
154
  by account.
152
155
 
156
+ An Antigravity Home is the Gemini root that contains `antigravity-cli/`. After adding a custom
157
+ root in Multi-Account, use it when opening a session with `agy`.
158
+
159
+ ```bash
160
+ CC_PETS_ANTIGRAVITY_HOME=/absolute/path/to/gemini-root agy
161
+ ```
162
+
153
163
  Pet Hooks and usage collection are configured when an account is added. If CC
154
164
  Bridge is already enabled, its Hooks, permissions, and MCP registration are also
155
165
  configured immediately; otherwise they are added automatically when CC Bridge is
@@ -162,7 +172,9 @@ Each proxy app has its own preference; Shadowrocket is the first supported optio
162
172
  CC Pets wrappers require a connected Shadowrocket VPN and a valid exit IP / region from
163
173
  the service's HTTPS `/cdn-cgi/trace` endpoint before starting Claude / Codex. Failures
164
174
  print a reason and return a nonzero exit code before registering a session or sending
165
- a starting event. Disabling the option skips all network checks.
175
+ a starting event. Disabling the option skips all network checks. For `agy`, only the
176
+ Shadowrocket connection is checked: Google's service domains have no `/cdn-cgi/trace`
177
+ endpoint, so the exit region can't be verified.
166
178
 
167
179
  Claude defaults to `api.anthropic.com`. Codex uses the current Home's `auth.json` to select
168
180
  `chatgpt.com` for ChatGPT login or `api.openai.com` for API-key login. If the mode is unknown
@@ -195,8 +207,10 @@ configuration, not just its running process. Original CLI binaries and desktop c
195
207
 
196
208
  ## CC Bridge
197
209
 
198
- [CC Bridge](./CC_BRIDGE.md) is optional and off by default. It lets local Claude Code
199
- and Codex sessions exchange messages and reserve files. Session IDs are validated;
210
+ [CC Bridge](./CC_BRIDGE.md) is optional and off by default. It lets local Claude Code,
211
+ Codex, and Antigravity CLI sessions exchange messages and reserve files. Antigravity's native
212
+ `agy` interface reads messages on its next model invocation. [Antigravity App](./CC_BRIDGE.md#antigravity-app)
213
+ supports automatic wake-up when its Sidecar is enabled. Session IDs are validated;
200
214
  PID fallback is accepted only for a unique live session. Ambiguous shared-host identities
201
215
  are rejected rather than guessed. Codex delivery uses the recipient's Home.
202
216
  For Codex sessions sharing an app-server PID, agents pass the current `session_id` from
@@ -243,6 +257,7 @@ cc-pets uninstall-app # Remove only ~/Applications/CC Pets.app.
243
257
 
244
258
  codex-with-pet # Start the pet and enter Codex CLI.
245
259
  claude-with-pet # Start the pet and enter Claude Code CLI.
260
+ agy-with-pet # Start the pet and enter Antigravity CLI.
246
261
  ```
247
262
 
248
263
  `package.json` is the single version source. Use `npm version patch`, `minor`, or
@@ -278,7 +293,7 @@ without a command line tool fall back to **Extensions → ⋯ → Install from V
278
293
  extension, a card only brings the app forward. Remote windows (SSH, WSL, containers) are not
279
294
  supported. See [extension details](plugins/vscode/README.md).
280
295
 
281
- ### Codex and Claude hooks
296
+ ### Agent hooks
282
297
 
283
298
  Status card titles show the session and its state. Generated CC Bridge names use the
284
299
  short `directory.animal` form; custom names are preserved. Without a Bridge name, the
@@ -302,6 +317,13 @@ existing `env`, `model`, `statusLine`, and hook settings. Its quota collector is
302
317
  injected into the existing status line script without changing the configured
303
318
  script path or output.
304
319
 
320
+ The Antigravity CLI integration uses global Gemini hooks for the status card, approval and stall
321
+ reminders, the Main menu, the menu bar and notifications, matching Claude and Codex. Antigravity
322
+ App conversations share the same hooks, appear as "Antigravity App" and focus the App when
323
+ clicked. Approval state is available for the CLI only. Use `agy` to keep the native terminal UI and `agy-with-pet` to
324
+ invoke the launcher explicitly. `cc-pets doctor` checks the launcher, hooks and Bridge MCP
325
+ registration, and `cc-pets paths` lists their configuration files.
326
+
305
327
  Third-party CLI agents can send redacted state events through standard input:
306
328
 
307
329
  ```bash
@@ -349,14 +371,14 @@ cc-pets open general # also: pet, accounts, alerts, diagnostics
349
371
  - **Sessions** — the Agent sessions online right now (sessions waiting for
350
372
  approval first, each with **Go to Terminal**) and CC Bridge traffic: messages waiting in
351
373
  an inbox and recent deliveries. Only who sent what to whom is shown, never the message.
352
- - **Usage** — local Claude Code and Codex token usage for the last 7, 30 or 90 days. The same
374
+ - **Usage** — local Claude Code, Codex, Antigravity CLI, and Antigravity App token usage for the last 7, 30 or 90 days. The All view includes every source, and Antigravity CLI and App each have a separate filter. The same
353
375
  five numbers as the overview lead the page: total usage (input + cache write + output +
354
376
  cached input + background usage), input, output, cached input with its hit rate, and requests. Background usage from local Codex SQLite logs contributes to the total only, without an inferred token breakdown. The daily bar
355
377
  chart stacks models in fixed colors and can switch between those five measures; click a model in the legend or the table to see only that
356
378
  model, and hover a bar for that day's numbers. Everything is counted from local session
357
379
  logs; nothing is sent anywhere. A per-day archive keeps history after Claude Code prunes
358
380
  old transcripts.
359
- - **Multi-Account** — add Claude / Codex Homes, view paths and integration status, and manage repairs, names, relocation and removal of custom Home integrations.
381
+ - **Multi-Account** — add Claude, Codex, or Antigravity CLI Homes, view paths and integration status, and manage repairs, names, relocation and removal of custom Home integrations.
360
382
  - **Pet / Alerts / Settings** — every pet setting, split into three short pages (Pet:
361
383
  picker, deletion of unselected custom pets with confirmation, size, chatter, click reactions and Codex import; Alerts: notifications, the status
362
384
  card and system status; Settings: language, display location, panel appearance and the pet sprites folder), plus finer controls such as the click-reaction thresholds and a
@@ -498,6 +520,13 @@ The persistent app reads `~/.codex` and `~/.claude` by default instead of inheri
498
520
  session-specific `CODEX_HOME` or `CLAUDE_CONFIG_DIR` values. Advanced users can
499
521
  override these with `CC_PETS_CODEX_HOME` and `CC_PETS_CLAUDE_CONFIG_DIR`.
500
522
 
523
+ Antigravity CLI reads local transcripts from `~/.gemini/antigravity-cli/brain`, or from the registered
524
+ CLI Home. Antigravity App reads the separate transcript folder at `~/.gemini/antigravity/brain`.
525
+ CC Pets displays the two sets of Token and request counts separately. The hover panel also shows
526
+ Antigravity alongside Codex and Claude, with its display mode under Hover Panel in Settings. CC Pets reads subscription quota
527
+ for each signed-in account through `agy -p /usage --output-format json` and displays the available
528
+ five-hour and weekly windows once per account. API-key mode displays local usage.
529
+
501
530
  Local seven-day quota history is disabled by default. When enabled, it is stored
502
531
  only at `~/Library/Application Support/CC Pets/quota-history.json`, retains seven
503
532
  days, and records at most once every 15 minutes.
package/README.zh-CN.md CHANGED
@@ -6,8 +6,8 @@
6
6
 
7
7
  [English](./README.md) | 简体中文
8
8
 
9
- 一个不依赖 Codex/Claude 桌面端的 macOS 原生桌宠。直接启动桌面端,或启动 Codex CLI / Claude Code CLI 时自动出现,
10
- 并通过 Codex App Server 官方接口与 Claude Code 官方 status line 数据读取 5 小时额度、周额度和周重置时间。
9
+ 一个支持 Codex、Claude Code 和 Antigravity CLI 的 macOS 原生桌宠。可以独立启动,也会随已接入的 CLI 启动,
10
+ 显示会话状态、额度和本地 Token 用量。
11
11
 
12
12
  ## v2.5.0 新功能
13
13
 
@@ -30,9 +30,9 @@
30
30
 
31
31
  - App 与 CLI 支持英语和简体中文,界面语言可即时切换
32
32
  - macOS 26 及以上可在经典与原生 Liquid Glass 两种面板主题之间切换
33
- - 随 Codex CLI 或 Claude Code CLI 自动启动,无需打开对应桌面版
34
- - 多个 Codex/Claude CLI 共用一个桌宠,最后一个托管 CLI 退出且 Codex 桌面端未运行时,桌宠自动关闭
35
- - 鼠标悬停口袋时展开额度详情面板,用两张卡分别显示 Codex、Claude 的剩余 5 小时额度、周额度和精确到秒的周重置时间
33
+ - 随 Codex、Claude Code 或 Antigravity CLI 自动启动,无需打开对应桌面版
34
+ - 多个支持的 CLI 会话共用一个桌宠。最后一个经 CC Pets 启动的 CLI 退出后,Codex 和 Antigravity 桌面端都未运行时,桌宠自动关闭
35
+ - 鼠标悬停口袋时展开额度详情面板,显示 Codex、Claude 和 Antigravity 的 5 小时额度、周额度与重置时间
36
36
  - reset 时间自动转换为 Mac 当前系统时区,例如 `Jul 22 3pm America/Los_Angeles` 在上海时区显示为 `7/23 06:00:00`
37
37
  - 支持待机、左右拖动、身体两侧感应、头部/脚部悬停和点击反馈动画
38
38
  - 待机呼吸、随机小动作(11 行素材会转头看鼠标)、拖动时的水平滞后与落脚回弹
@@ -78,11 +78,11 @@ cc-pets open general # 还有 pet、accounts、alerts、diagnostics
78
78
  以及 Claude / Codex 的简洁账号卡片:订阅模式展示 5 小时和本周的剩余额度环、重置时间与本周节奏;API 模式展示本月调用、Token 总量,并补充日均调用及输入/输出 Token。数据与悬停面板同源。每个已登记账号独立显示一张卡片,两列排列;「查看诊断」位于名称后,仅在该账号确实有诊断问题时出现。暂未采集到额度不视为配置异常。
79
79
  - **会话**:此刻在线的 Agent 会话(等审批的置顶,每行可「跳到终端」),以及 CC Bridge 的
80
80
  消息往来:卡在信箱里待投递的、最近送达的。仅显示消息交互,无消息正文。
81
- - **用量**:本机 Claude Code / Codex 最近 7、30、90 天的 Token 用量。顶部和概览同一套五格:总用量
81
+ - **用量**统计本机 Claude Code、Codex、Antigravity CLI 和 Antigravity App 最近 7、30、90 天的 Token 用量。「全部」包含所有来源,Antigravity CLI 和 App 各有独立筛选。顶部和概览同一套五格:总用量
82
82
  (输入 + 缓存写 + 输出 + 缓存输入 + 后台用量)、输入、输出、缓存输入(附命中率)、请求数。本机 Codex SQLite 日志补充的后台用量仅计入总量,不推算 Token 明细。每日柱状图按模型分色堆叠,
83
83
  颜色固定跟着模型走,可以在这五项之间切换;点图例或表格里的模型只看它,鼠标移到柱子上看当天各模型的数值。
84
84
  数据全部来自本机会话日志,不会发送到任何地方;按日归档让 Claude Code 清理旧转录之后,历史仍然留得住。
85
- - **多账号**:添加 Claude / Codex Home,查看账号的目录与集成状态,并通过“管理”菜单修复、重命名、重新定位或移除自定义 Home 的集成。
85
+ - **多账号**可添加 Claude、Codex 或 Antigravity CLI Home,查看目录与集成状态,并通过「管理」菜单修复、重命名、重新定位或移除自定义 Home 的集成。
86
86
  - **宠物 / 提醒 / 设置**:桌宠的全部设置拆成三页(宠物:选宠物、确认删除未选中的自定义宠物、大小、碎碎念、点击互动、导入 Codex 素材;提醒:系统通知、桌面状态卡和系统状态;
87
87
  设置:语言、显示位置、面板外观和素材目录),另有更细的项(比如连击阈值、可以连续调节的玻璃压暗,菜单里仍是四档)。
88
88
  右键菜单只留最常用的几项:管理桌宠、宠物大小、显示消息气泡、用量展示模式、面板主题和 CC Bridge,其余都到这里改。改动会立刻作用到桌面上的宠物,在菜单里改的也会同步显示在这里。
@@ -164,6 +164,11 @@ Claude Code Hook 会合并到 `~/.claude/settings.json`,现有的 `env`、`mod
164
164
  通过 npm 安装或升级时会自动重新构建应用、安装或更新两套 Hooks,并配置 shell 集成;如果旧版桌宠正在运行,
165
165
  安装器会自动重启桌宠,使新版本生效。`cc-pets install` 用于手动修复或重新初始化。
166
166
 
167
+ Antigravity CLI 通过 Gemini 全局 Hooks 接入状态卡、审批提醒、卡住提醒、主菜单与菜单栏展示和系统通知,和 Claude / Codex 一致。
168
+ Antigravity App 的对话共用同一份 Hooks,以「Antigravity App」显示,点状态卡回到 App。审批状态只对 CLI 可用。
169
+ 运行 `agy` 保留原生终端界面,也可以显式运行 `agy-with-pet`。`cc-pets doctor` 检查启动入口、Hooks 和 Bridge MCP,
170
+ `cc-pets paths` 列出配置文件的位置。
171
+
167
172
  通过 `codex-with-pet` / `claude-with-pet` 启动时,包装脚本会在 Agent 启动前记录终端身份,
168
173
  这是最精确的来源。直接运行 `codex` / `claude`、或终端窗口早于 shim 安装就已打开的会话,
169
174
  会回退到内核信息:从进程树解析控制终端和承载终端的应用,这些会话的状态卡同样可以点击回跳。
@@ -212,6 +217,7 @@ Hook 状态卡和消息气泡在宠物小于 100% 时同比例缩小,文字、
212
217
  通过 CC Pets 包装器启动 `claude` / `codex` 时,会先确认 Shadowrocket 的系统 VPN
213
218
  状态为已连接,再向对应服务的 `/cdn-cgi/trace` 发起 HTTPS GET,检查出口 IP 和地区;失败会在终端提示原因并返回非零退出码,
214
219
  不会启动 CLI,也不会登记会话或发送启动事件。关闭开关后不进行网络检查。
220
+ `agy` 只检查 Shadowrocket 是否已连接:Google 的服务域名没有 `/cdn-cgi/trace` 这类端点,无法核验出口地区。
215
221
 
216
222
  仅识别 Shadowrocket 的 VPN 配置,不把「应用进程正在运行」当成代理已连接。
217
223
  Claude 默认检查 `api.anthropic.com`;Codex 根据当前 Home 的 `auth.json` 选择:ChatGPT 登录检查
@@ -440,13 +446,14 @@ defaults delete com.universewang.cc-pets CCPetsSpeechCooldown # 交
440
446
  - macOS 13 或更高版本
441
447
  - Node.js 18 或更高版本,仅供 npm 安装与升级使用;桌宠本身以及 `cc-pets` 命令、Hooks、
442
448
  CC Bridge 都是原生程序,运行时不依赖 Node
443
- - 已安装并登录 Codex CLI 和/或 Claude Code CLI
449
+ - 已配置 Codex、Claude Code 或 Antigravity CLI(`agy`)中的至少一种
444
450
  - zsh
445
451
  - Xcode Command Line Tools,可通过 `xcode-select --install` 安装
446
452
 
447
453
  ## CC Bridge
448
454
 
449
- [CC Bridge](./CC_BRIDGE.zh-CN.md) 是默认关闭的可选功能,让本机 Claude Code / Codex 会话互发消息并预留文件。
455
+ [CC Bridge](./CC_BRIDGE.zh-CN.md) 是默认关闭的可选功能,让本机 Claude Code、Codex 和 Antigravity CLI 会话互发消息并预留文件。
456
+ 原生 `agy` 在下一次模型调用时读取等待消息。[Antigravity App](./CC_BRIDGE.zh-CN.md#antigravity-app) 启用 Sidecar 后支持自动唤醒。
450
457
  身份识别优先验证会话 ID;按 PID 回退时只接受唯一在线会话,共享宿主下身份不明确会拒绝操作。
451
458
  Codex 消息使用接收方的 Home 投递。
452
459
  多个 Codex 会话共用 app-server PID 时,Agent 在每次 MCP 调用中传入 Bridge hook 提供的当前 `session_id`。
@@ -470,6 +477,8 @@ npm install -g cc-pets@latest --allow-scripts=cc-pets
470
477
  codex
471
478
  # 或
472
479
  claude
480
+ # 或
481
+ agy
473
482
  ```
474
483
 
475
484
  `--allow-scripts=cc-pets` 用于允许新版 npm 执行 CC Pets 的 `postinstall`,完成原生应用构建、
@@ -506,20 +515,22 @@ cc-pets install
506
515
  codex
507
516
  # 或
508
517
  claude
518
+ # 或
519
+ agy
509
520
  ```
510
521
 
511
522
  npm 12 会把本地目录安装识别为项目范围安装,不接受命令行传入的 `--allow-scripts`。
512
523
  因此本地源码安装显式跳过生命周期脚本,再通过 `cc-pets install` 执行可重复的初始化流程。
513
524
 
514
- 两种方式都会安装 `cc-pets`、`codex-with-pet` 和 `claude-with-pet`。
515
- npm 的安装后脚本会自动构建原生应用、安装两套 Agent Hooks,并在 `~/.cc-pets/shims` 下生成指向包装脚本的
516
- `codex` 与 `claude` 软链,再向 `~/.zshrc` 追加带明确标记的一行把该目录前置到 `PATH`,不会覆盖真实的 CLI 二进制。
525
+ 两种方式都会安装 `cc-pets`、`codex-with-pet`、`claude-with-pet` 和 `agy-with-pet`。
526
+ npm 的安装后脚本会自动构建原生应用、安装已发现账号的 Agent Hooks,并在 `~/.cc-pets/shims` 下生成指向包装脚本的
527
+ `codex`、`claude` 与 `agy` 软链,再向 `~/.zshrc` 追加带标记的配置,把该目录前置到 `PATH`。
517
528
  用 shim 而不是 alias,是因为 alias 名区分大小写而 macOS 文件系统默认不区分:`Claude`、`CODEX` 这类写法
518
529
  匹配不到 alias,会直接命中真二进制,桌宠不会被拉起。shim 让任意大小写写法都落到同一个文件上。
519
530
 
520
531
  ### 多账号
521
532
 
522
- CC Pets 会自动发现并集成官方 `~/.claude` 和 `~/.codex` Home。`~/.claude-x`、
533
+ CC Pets 会自动发现并集成已安装 CLI 的默认 Home,包括 `~/.claude`、`~/.codex` 和 `~/.gemini`。`~/.claude-x`、
523
534
  `~/.codex-work` 等自定义 Home 不会被自动扫描,必须从「主菜单 → 多账号」(位于“宠物”下方)手动添加。
524
535
  默认使用文件夹名作为账号名称并保持原样,也可以在该页的“管理”菜单中重命名。每个 Provider
525
536
  拥有独立的循环额度卡片,用量页也可以按账号筛选本机会话 Token 历史。
@@ -527,6 +538,13 @@ CC Pets 会自动发现并集成官方 `~/.claude` 和 `~/.codex` Home。`~/.cla
527
538
  添加账号时会配置 Pet Hooks 和用量采集。若 CC Bridge 已开启,会同时配置它的 Hooks、
528
539
  权限与 MCP;若尚未开启,之后启用 CC Bridge 时会自动为所有已登记账号补齐。
529
540
 
541
+ Antigravity Home 选择包含 `antigravity-cli/` 子目录的 Gemini 根目录。在多账号页添加自定义根目录后,
542
+ 启动 `agy` 时可以指定对应目录。
543
+
544
+ ```bash
545
+ CC_PETS_ANTIGRAVITY_HOME=/absolute/path/to/gemini-root agy
546
+ ```
547
+
530
548
  首次安装需要新开终端让 `PATH` 生效;以后升级只需执行 npm 命令。
531
549
  同时会将标准 macOS 应用安装到 `~/Applications/CC Pets.app`,可从 Finder 或 Launchpad 启动,
532
550
  不需要管理员权限。npm 升级时会同步更新该应用。
@@ -554,6 +572,8 @@ export CODEX_REAL_BIN=/absolute/path/to/codex
554
572
  export CLAUDE_REAL_BIN=/absolute/path/to/claude
555
573
  ```
556
574
 
575
+ 如果真实 Antigravity CLI 不在当前 `PATH`,设置 `AGY_REAL_BIN=/absolute/path/to/agy`。
576
+
557
577
  ## 命令说明
558
578
 
559
579
  ```bash
@@ -599,7 +619,7 @@ printf '%s' '{"schemaVersion":1,"provider":"MyAgent","state":"thinking"}' \
599
619
  # 手动修复或重新初始化 Hooks、shell 集成,并让已运行桌宠加载当前版本
600
620
  cc-pets install
601
621
 
602
- # CC Bridge(实验性,默认关闭):让本机 Claude Code / Codex 会话互发消息,详见 CC_BRIDGE.zh-CN.md
622
+ # CC Bridge(实验性,默认关闭),详见 CC_BRIDGE.zh-CN.md
603
623
  cc-pets bridge enable
604
624
  cc-pets bridge status
605
625
  cc-pets bridge disable
@@ -621,6 +641,9 @@ codex-with-pet
621
641
 
622
642
  # 启动桌宠后进入 Claude Code CLI
623
643
  claude-with-pet
644
+
645
+ # 启动桌宠后进入原生 Antigravity CLI
646
+ agy-with-pet
624
647
  ```
625
648
 
626
649
  项目版本以 `package.json` 为唯一来源。发布新版本时执行 `npm version patch`、
@@ -650,6 +673,12 @@ Claude 用量来自官方 status line 输入中的 `rate_limits.five_hour` 与
650
673
  `rate_limits.seven_day`。其中的 `used_percentage` 会换算为剩余百分比。该字段仅面向
651
674
  Claude.ai Pro/Max 订阅账号,并在会话完成首次 API 响应后出现;字段尚不可用时显示 `--`。
652
675
 
676
+ Antigravity CLI 从 `~/.gemini/antigravity-cli/brain` 或已登记 CLI Home 的对应目录读取会话转录,
677
+ Antigravity App 从 `~/.gemini/antigravity/brain` 读取。两种来源的 Token 和请求数分别展示。
678
+ Antigravity 的展示模式位于「设置 → 悬停面板显示」,与 Codex 和 Claude 使用同一组设置。
679
+ 订阅额度由 `agy -p /usage --output-format json` 读取,每个已登录账号只显示一份可用的五小时与周额度。
680
+ API key 模式展示本地用量。
681
+
653
682
  Claude Code 本地 Token 来自 `~/.claude/projects` 下的会话转录:
654
683
 
655
684
  - 每条 `type = assistant` 的记录带 `message.usage`,是**单次请求的增量**,与 Codex 的
@@ -678,9 +707,9 @@ Codex 侧同理:桌宠固定只统计 `~/.codex`,不读继承来的 `CODEX_H
678
707
  本地 Token 是 CLI 会话事件的原始计数,不等同于订阅额度。官方额度可能受模型、缓存和
679
708
  请求复杂度等因素影响,应始终以服务端返回的百分比为准。
680
709
 
681
- 额度详情面板使用青色区分 Codex、紫色区分 Claude。标题行显示在线 Agent 数,下方汇总条
682
- 分别展示 Codex、Claude 的「今日」与「最近 7 天」Token,并显示最近刷新时间。统计用的是与订阅无关的
683
- 自然日窗口(今日 = 本机零点至今,最近 7 天 = 含今天在内的 7 个自然日),因为两家的
710
+ 额度详情面板用青色标识 Codex、紫色标识 Claude、蓝色标识 Antigravity。标题行显示在线 Agent 数,下方分别展示
711
+ Codex、Claude、Antigravity CLI 和 Antigravity App 的「今日」与「最近 7 天」Token,并显示最近刷新时间。统计用的是与订阅无关的
712
+ 自然日窗口(今日 = 本机零点至今,最近 7 天 = 含今天在内的 7 个自然日),因为各家的
684
713
  `resets_at` 并不一致,按各自订阅窗口算出的数不在同一区间上,相加没有意义。每个 Agent 卡片按 5 小时和 7 天两列
685
714
  展示官方剩余百分比(主值)、本机 Token 用量和重置时间,右侧是近 7 天额度趋势。右键菜单的
686
715
  “用量展示模式”保留原有切换控件,按已登记账号分别设置,旧的平台设置作为未单独设置账号的默认值。