cc-pets 2.5.0 → 2.6.0-beta.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/CC_BRIDGE.md +47 -5
- package/CC_BRIDGE.zh-CN.md +42 -5
- package/CONTRIBUTING.md +1 -1
- package/CONTRIBUTING.zh-CN.md +1 -1
- package/README.md +48 -19
- package/README.zh-CN.md +46 -17
- package/Resources/AgentIcons/antigravity.icns +0 -0
- package/Resources/zh-Hans.lproj/Localizable.strings +64 -15
- package/Sources/CCPets/App/CCPetsAppDelegate+AgentEvents.m +7 -3
- package/Sources/CCPets/App/CCPetsAppDelegate+AgentStatus.m +11 -3
- package/Sources/CCPets/App/CCPetsAppDelegate+Bridge.m +16 -5
- package/Sources/CCPets/App/CCPetsAppDelegate+Private.h +11 -1
- package/Sources/CCPets/App/CCPetsAppDelegate+Profiles.m +21 -11
- package/Sources/CCPets/App/CCPetsAppDelegate+Quota.m +27 -16
- package/Sources/CCPets/App/CCPetsAppDelegate+Settings.m +43 -7
- package/Sources/CCPets/App/CCPetsAppDelegate+Speech.m +2 -1
- package/Sources/CCPets/App/CCPetsAppDelegate+Update.m +3 -3
- package/Sources/CCPets/App/CCPetsAppDelegate+Workbench.m +20 -22
- package/Sources/CCPets/App/CCPetsAppDelegate.m +14 -6
- package/Sources/CCPets/App/CCPetsVersion.h +4 -0
- package/Sources/CCPets/App/CCPetsVersion.m +34 -0
- package/Sources/CCPets/App/main.m +11 -0
- package/Sources/CCPets/Bridge/CCPetsBridge.m +7 -5
- package/Sources/CCPets/Bridge/CCPetsBridgeAntigravityApp.h +4 -0
- package/Sources/CCPets/Bridge/CCPetsBridgeAntigravityApp.m +119 -0
- package/Sources/CCPets/Bridge/CCPetsBridgeCLI.h +3 -1
- package/Sources/CCPets/Bridge/CCPetsBridgeCLI.m +172 -17
- package/Sources/CCPets/Bridge/CCPetsBridgeCore.m +25 -7
- package/Sources/CCPets/Bridge/CCPetsBridgeSetup.m +17 -0
- package/Sources/CCPets/Bridge/CCPetsBridgeStore.h +7 -2
- package/Sources/CCPets/Bridge/CCPetsBridgeStore.m +92 -11
- package/Sources/CCPets/Bridge/CCPetsBridgeTerminalTitle.h +12 -0
- package/Sources/CCPets/Bridge/CCPetsBridgeTerminalTitle.m +105 -0
- package/Sources/CCPets/Integrations/CCPetsAntigravityConfig.h +17 -0
- package/Sources/CCPets/Integrations/CCPetsAntigravityConfig.m +462 -0
- package/Sources/CCPets/Integrations/CCPetsAntigravityEvents.h +5 -0
- package/Sources/CCPets/Integrations/CCPetsAntigravityEvents.m +180 -0
- package/Sources/CCPets/Integrations/CCPetsBridgeTitleRelay.h +3 -0
- package/Sources/CCPets/Integrations/CCPetsBridgeTitleRelay.m +463 -0
- package/Sources/CCPets/Integrations/CCPetsIntegrations.h +1 -1
- package/Sources/CCPets/Integrations/CCPetsIntegrations.m +37 -7
- package/Sources/CCPets/Integrations/CCPetsLaunchPreflight.m +15 -5
- package/Sources/CCPets/Integrations/CCPetsProfiles.h +2 -1
- package/Sources/CCPets/Integrations/CCPetsProfiles.m +112 -81
- package/Sources/CCPets/Integrations/CCPetsTerminalFocus.h +5 -1
- package/Sources/CCPets/Integrations/CCPetsTerminalFocus.m +163 -40
- package/Sources/CCPets/Pet/CCPetsPreviews.m +16 -8
- package/Sources/CCPets/Pet/PetView+Menu.m +56 -5
- package/Sources/CCPets/Support/CCPetsDoctor.m +126 -37
- package/Sources/CCPets/Support/CCPetsPaths.h +5 -0
- package/Sources/CCPets/Support/CCPetsPaths.m +15 -0
- package/Sources/CCPets/Support/CCPetsPreferences.h +4 -1
- package/Sources/CCPets/Support/CCPetsPreferences.m +18 -0
- package/Sources/CCPets/UI/CCPetsMenuBarPanel.m +10 -5
- package/Sources/CCPets/UI/CCPetsMenuBarSummary.m +9 -6
- package/Sources/CCPets/UI/CCPetsSettingsPage.h +3 -0
- package/Sources/CCPets/UI/CCPetsSettingsPage.m +189 -8
- package/Sources/CCPets/UI/CCPetsUIStyle.m +3 -1
- package/Sources/CCPets/UI/CCPetsUsagePage.h +4 -3
- package/Sources/CCPets/UI/CCPetsUsagePage.m +69 -43
- package/Sources/CCPets/UI/CCPetsUsageStore.m +11 -1
- package/Sources/CCPets/UI/CCPetsWorkbenchPages.m +1 -1
- package/Sources/CCPets/Usage/CCPetsAntigravityQuota.m +115 -0
- package/Sources/CCPets/Usage/CCPetsNormalizedUsage.h +5 -0
- package/Sources/CCPets/Usage/CCPetsNormalizedUsage.m +43 -0
- package/Sources/CCPets/Usage/CCPetsProviderRegistry+Testing.h +13 -0
- package/Sources/CCPets/Usage/CCPetsProviderRegistry.h +25 -0
- package/Sources/CCPets/Usage/CCPetsProviderRegistry.m +94 -0
- package/Sources/CCPets/Usage/CCPetsQuotaHistory.h +1 -1
- package/Sources/CCPets/Usage/CCPetsQuotaHistory.m +11 -8
- package/Sources/CCPets/Usage/CCPetsUsage+Internal.h +2 -0
- package/Sources/CCPets/Usage/CCPetsUsage+Models.m +206 -14
- package/Sources/CCPets/Usage/CCPetsUsage+TokenTotals.m +4 -4
- package/Sources/CCPets/Usage/CCPetsUsage.h +7 -2
- package/Sources/CCPets/Usage/CCPetsUsageMode.h +2 -0
- package/Sources/CCPets/Usage/CCPetsUsageMode.m +29 -4
- package/Sources/CCPets/Usage/CCPetsUsageMonitor.h +4 -4
- package/Sources/CCPets/Usage/CCPetsUsageMonitor.m +90 -7
- package/Sources/CCPets/Usage/QuotaDashboardView+CompactRow.m +81 -0
- package/Sources/CCPets/Usage/QuotaDashboardView+Primitives.m +5 -8
- package/Sources/CCPets/Usage/QuotaDashboardView+Private.h +26 -4
- package/Sources/CCPets/Usage/QuotaDashboardView+Rendering.m +99 -99
- package/Sources/CCPets/Usage/QuotaDashboardView.h +9 -10
- package/Sources/CCPets/Usage/QuotaDashboardView.m +232 -79
- package/THIRD_PARTY_NOTICES.md +5 -4
- package/THIRD_PARTY_NOTICES.zh-CN.md +6 -5
- package/bin/agy-with-pet +82 -0
- package/bin/cc-pets +1 -1
- package/bin/claude-with-pet +15 -0
- package/bin/codex-with-pet +17 -2
- package/package.json +5 -3
- package/scripts/install-shell-integration.sh +5 -0
|
@@ -195,15 +195,18 @@
|
|
|
195
195
|
"Delete %@" = "删除素材 %@";
|
|
196
196
|
"%@ usage display" = "%@ 用量展示模式";
|
|
197
197
|
"Enable" = "启用";
|
|
198
|
-
"Let local
|
|
198
|
+
"Let local Agent sessions exchange messages, wake supported sessions, and reserve files" = "让本机 Agent 会话互相发消息、唤醒可唤醒的会话并预留文件";
|
|
199
199
|
"\nBelow: online sessions · active file reservations" = "\n下方为在线会话数 · 有效的文件预留数";
|
|
200
200
|
"%lu sessions · %lu reserved" = "%lu 会话 · %lu 预留";
|
|
201
201
|
"Auto-wake" = "自动唤醒";
|
|
202
|
+
"Tab nicknames" = "标签昵称";
|
|
203
|
+
"Append CC Bridge nicknames to terminal tab titles. Restart CLI sessions after turning this on." = "在终端标签标题末尾追加 CC Bridge 昵称。开启后,请重启 CLI 会话。";
|
|
204
|
+
"Bridge nicknames in tab titles: {tabTitle}" = "终端标签昵称:{tabTitle}";
|
|
202
205
|
"Wake idle sessions automatically. When off, messages wait in the inbox until that session's next input, which saves tokens. Codex needs a session restart" = "自动唤醒空闲会话。关闭后消息只进信箱,等对方下次收到你的输入时带入,可省 token;Codex 需重启会话生效";
|
|
203
206
|
"Edit guard" = "编辑拦截";
|
|
204
207
|
"Pause once with an explanation when editing a file another session reserved; retrying goes through. Codex needs a session restart" = "编辑他人预留的文件时先暂停一次并说明原因,重试即放行;Codex 需重启会话生效";
|
|
205
208
|
"Auto-approve" = "免审批";
|
|
206
|
-
"Each group applies to
|
|
209
|
+
"Each group applies to the integrated Agents. Restart sessions to reload tool permissions" = "每组对已集成的 Agent 生效。请重启会话以加载工具权限";
|
|
207
210
|
"Read" = "查看类";
|
|
208
211
|
"Listing sessions, viewing reservations and reading the inbox. Read-only and safe" = "列出会话、查看预留、读取信箱免审批;只读,放开没有风险";
|
|
209
212
|
"Send" = "发消息";
|
|
@@ -365,9 +368,9 @@
|
|
|
365
368
|
"Removed the CC Pets hooks in %@." = "已移除 %@ 中的 CC Pets Hooks。";
|
|
366
369
|
"Removed the CC Pets hooks in %@ and restored the original status line." = "已移除 %@ 中的 CC Pets Hooks,并恢复原 status line。";
|
|
367
370
|
"%1$@ the CC Pets shell integration in %2$@." = "%1$@ %2$@ 中的 CC Pets shell 集成。";
|
|
368
|
-
"%1$@ the codex / claude shims in %2$@." = "%1$@ %2$@ 中的 codex / claude shim。";
|
|
371
|
+
"%1$@ the codex / claude / agy shims in %2$@." = "%1$@ %2$@ 中的 codex / claude / agy shim。";
|
|
369
372
|
"No CC Pets integrations to remove." = "未发现需要移除的 CC Pets 集成。";
|
|
370
|
-
"Usage: cc-pets bridge <command>\n\n enable [options] Turn on CC Bridge:
|
|
373
|
+
"Usage: cc-pets bridge <command>\n\n enable [options] Turn on CC Bridge: install Agent hooks and register MCP\n configure [options] Change options while enabled (doesn't re-register MCP)\n disable Turn off and remove all CC Bridge integrations\n status Show whether it's on and which sessions are online\n list List online sessions\n send <to> <message…> Send as the current session (run inside an Agent session, or use --from)\n name <new-name> Rename the current session (run inside an Agent session, or use --from)\n inbox Read the current session's inbox (for debugging)\n\nOptions (anything omitted keeps its current value):\n --approve=<list> Auto-approve in both Codex and Claude\n --codex-approve=<list> Auto-approve in Codex only\n --claude-allow=<list> Allow without asking in Claude only\n --agy-allow=<list> Allow without asking in Antigravity only\n Use groups view, send, reserve, name, or tool names; pass an empty value to clear\n --agy-app=on|off Enable or disable the Antigravity App Sidecar (off by default)\n --tab-title=on|off Append Bridge nicknames to CLI terminal titles (off by default)\n --wake=on|off Wake supported idle sessions automatically (off saves tokens; messages arrive with the next user input)\n --edit-guard=on|off Pause once when editing a file another session reserved\n\nName a session at launch: CC_BRIDGE_NAME=frontend claude (or codex, or agy)\n\nCC Bridge connects local Claude Code, Codex and Antigravity sessions.\nMessage bodies are stored in a local temp directory readable only by you. Off by default." = "用法: cc-pets bridge <命令>\n\n enable [选项] 开启 CC Bridge:安装 Agent Hooks 并注册 MCP\n configure [选项] 已开启时只修改选项(不重新注册 MCP)\n disable 关闭并移除所有 CC Bridge 集成\n status 查看开关状态与在线会话\n list 列出在线会话\n send <to> <消息…> 以当前会话身份发送(需在 Agent 会话内执行,或用 --from 指定)\n name <新名字> 修改当前会话的名字(需在 Agent 会话内执行,或用 --from 指定)\n inbox 读取当前会话信箱(调试用)\n\n选项(没给的保持原值):\n --approve=<列表> Codex 与 Claude 同时免审批\n --codex-approve=<列表> 只设 Codex 免审批\n --claude-allow=<列表> 只设 Claude 免确认\n --agy-allow=<列表> 只设 Antigravity 免确认\n 列表可写分组 view, send, reserve, name,或具体工具名;传空值表示清空\n --agy-app=on|off 启用或关闭 Antigravity App Sidecar(默认关闭)\n --tab-title=on|off 在 CLI 终端标签标题末尾追加 Bridge 昵称(默认关闭)\n --wake=on|off 自动唤醒支持此功能的空闲会话(关闭可省 token,消息等对方下次收到用户输入时带入)\n --edit-guard=on|off 编辑他人预留的文件时暂停一次\n\n启动时指定会话名:CC_BRIDGE_NAME=frontend claude(也可用 codex 或 agy)\n\nCC Bridge 连接本机的 Claude Code、Codex 和 Antigravity 会话。\n消息正文会保存在本机临时目录(仅当前用户可读),默认关闭。";
|
|
371
374
|
"No sessions online." = "没有在线会话。";
|
|
372
375
|
"pending" = "待投递";
|
|
373
376
|
"[cc-bridge file reservation] This edit is paused once: the files below are reserved by another Agent session on this machine." = "[cc-bridge 文件预留] 这次编辑先暂停一次:以下文件已被本机另一个 Agent 会话预留。";
|
|
@@ -381,13 +384,13 @@
|
|
|
381
384
|
"Users may also call it “pet”, “desktop pet”, “桌宠” or “cc-pets”: “send this to web with pet”, “have the pet tell api”, “pet, who's online?” " = "用户也会把它叫作“pet”“桌宠”“cc-pets”:“用 pet 发给 web”“让桌宠转告 api”“pet 看看谁在线”";
|
|
382
385
|
"and “reserve src/api with pet” all mean this tool. It only counts when it's about messaging other sessions, listing sessions or reserving files; " = "“用 pet 预留 src/api”都指本工具。只有涉及给其他会话发消息、查看会话、预留文件时才算;";
|
|
383
386
|
"“add a field to pet” or “the pet API” refer to a pet in the code, so don't call this tool for those." = "“给 pet 加个字段”“pet 接口”这类说的是业务代码里的 pet,不要调用本工具。";
|
|
384
|
-
"List
|
|
387
|
+
"List other local sessions that can receive CC Bridge messages, including Claude Code, Codex, and Antigravity CLI sessions (" = "列出本机其他可接收 CC Bridge 消息的会话,包括 Claude Code、Codex 和Antigravity CLI(";
|
|
385
388
|
"this is what the user means by “bridge”, “cc-bridge”, “other sessions” or “another terminal”). " = "用户说“bridge”“cc-bridge”“其他会话”“另一个终端”时指的就是它)。";
|
|
386
389
|
"Each line shows: name [ref], CLI, busy/idle, terminal (tty), start time, working directory. " = "每行依次是:名字 [ref]、CLI、忙闲状态、所在终端(tty)、启动时间、工作目录。";
|
|
387
390
|
"The name is the send_message address; append ` [ref]` only when names collide. " = "名字就是 send_message 的地址;只有重名时才需要在名字后加上 ` [ref]`。";
|
|
388
391
|
"When the user describes a target by terminal (e.g. ttys003) or directory, use this to find its name." = "用户用终端(如 ttys003)或目录描述目标时,据此找到对应的名字。";
|
|
389
392
|
"List Agent sessions" = "列出 Agent 会话";
|
|
390
|
-
"Send a message to another
|
|
393
|
+
"Send a message to another CC Bridge session on this machine (what the user means by “message it via bridge” or “send to another session / terminal”). " = "给本机另一个 CC Bridge 会话发消息(用户说“用 bridge 发消息”“发给另一个会话 / 终端”即指此工具)。";
|
|
391
394
|
"An idle recipient is woken; a busy one gets it after its current turn. " = "对方空闲时会被唤醒,忙碌时排在当前回合之后。";
|
|
392
395
|
"Delivery doesn't mean it was read or agreed to; replies arrive as new messages in this session. " = "送达不代表对方已读或同意;对方回复会作为新消息出现在本会话里。";
|
|
393
396
|
"When replying, put the from name from the message header into to." = "回复收到的消息时,把消息头里的 from 名字填到 to。";
|
|
@@ -441,7 +444,7 @@
|
|
|
441
444
|
"File reservations in {root} ({length}):\n" = "{root} 的文件预留({length}):\n";
|
|
442
445
|
"No new messages in the inbox." = "信箱里没有新消息。";
|
|
443
446
|
"Unknown tool: {name}" = "未知工具:{name}";
|
|
444
|
-
"cc-pets CC Bridge: exchange messages with
|
|
447
|
+
"cc-pets CC Bridge: exchange messages with local Claude Code, Codex, and Antigravity CLI sessions. " = "cc-pets CC Bridge:与本机的 Claude Code、Codex 和 Antigravity CLI 会话互发消息。";
|
|
445
448
|
"When the user mentions cc-bridge, bridge, pet, desktop pet, 桌宠, cc-pets, cross-session / cross-terminal messages, " = "当用户提到 cc-bridge、bridge、pet、桌宠、cc-pets、跨会话 / 跨终端消息、";
|
|
446
449
|
"“message another session / terminal / Claude / Codex”, or names a session or tty (e.g. ttys003), " = "“给另一个会话 / 终端 / Claude / Codex 发消息”,或提到某个会话名、tty(如 ttys003)时,";
|
|
447
450
|
"use this server's tools directly; there's no need to look up bridge usage in project files. " = "直接使用本服务器的工具,不需要在项目文件里查找 bridge 的用法。";
|
|
@@ -482,6 +485,8 @@
|
|
|
482
485
|
"[cc-pets idle notice] {target} finished its current turn and is now idle. " = "[cc-pets 空闲通知] {target} 已完成当前回合,现在处于空闲状态。";
|
|
483
486
|
"This is an automatic notice, not an instruction from anyone." = "这是自动通知,不是来自某个人的指令。";
|
|
484
487
|
"Delivered to {name}'s input queue ({status}). Delivery doesn't mean it was read or agreed to." = "已送达 {name} 的输入队列({status})。送达不代表对方已读或同意。";
|
|
488
|
+
"Submitted the message as a prompt to {name}." = "已将消息作为提示词提交给 {name}。";
|
|
489
|
+
"If the cc-bridge MCP server is configured, reply to {name} using that server's send_message tool." = "如果已配置 cc-bridge MCP server,请用该服务的 send_message 工具回复 {name}。";
|
|
485
490
|
"busy; it will be handled after the current turn" = "对方忙碌,将在当前回合结束后处理";
|
|
486
491
|
"idle; it was woken up" = "对方空闲,已被唤醒";
|
|
487
492
|
"Put in {name}'s inbox (auto-wake is off): it will be read with the next user input, or via check_inbox." = "已放入 {name} 的信箱(未开启自动唤醒):对方下次收到用户输入时读到,也可以让对方用 check_inbox 读取。";
|
|
@@ -564,6 +569,7 @@
|
|
|
564
569
|
"{stale} {name} hooks point to cc-pets elsewhere (the package was moved or reinstalled)" = "{name} Hooks 中有 {stale} 条指向其他位置的 cc-pets(包被移动或重装过)";
|
|
565
570
|
"{stale} {name} hook points to cc-pets elsewhere (the package was moved or reinstalled)" = "{name} Hooks 中有 {stale} 条指向其他位置的 cc-pets(包被移动或重装过)";
|
|
566
571
|
"{name} hooks installed ({total} events)" = "{name} Hooks 已安装({total} 个事件)";
|
|
572
|
+
"{name} hooks installed" = "{name} Hooks 已安装";
|
|
567
573
|
"{name} config still has {legacy} old codex-pet hooks" = "{name} 配置里残留 {legacy} 条旧版 codex-pet Hooks";
|
|
568
574
|
"{name} config still has {legacy} old codex-pet hook" = "{name} 配置里残留 {legacy} 条旧版 codex-pet Hooks";
|
|
569
575
|
"Claude status line feeds quota data through the wrapper" = "Claude status line 已通过包装器接入额度采集";
|
|
@@ -578,9 +584,9 @@
|
|
|
578
584
|
"Shims complete: {shimDirectory}" = "shim 完整:{shimDirectory}";
|
|
579
585
|
"Shim problems: {broken}" = "shim 异常:{broken}";
|
|
580
586
|
"source {shellRC}, or open a new terminal" = "source {shellRC},或新开一个终端";
|
|
581
|
-
"This terminal's PATH lacks the shim directory, so
|
|
587
|
+
"This terminal's PATH lacks the shim directory, so the Agent launchers won't start the pet" = "当前终端的 PATH 里没有 shim 目录,直接运行 Agent CLI 时无法拉起桌宠";
|
|
582
588
|
"{shadowing} comes before the shim directory in PATH and bypasses the pet" = "PATH 中 {shadowing} 排在 shim 目录之前,会绕过桌宠";
|
|
583
|
-
"The shim directory comes before the real
|
|
589
|
+
"The shim directory comes before the real Agent binaries in PATH" = "PATH 中 shim 目录优先于真实的 Agent CLI 程序";
|
|
584
590
|
"The shim directory is first in PATH" = "PATH 中 shim 目录排在最前";
|
|
585
591
|
"Found the real {name}: {real}" = "找到真实的 {name}:{real}";
|
|
586
592
|
"The real {name} isn't in PATH, so the shim can't forward to it" = "PATH 中找不到真实的 {name},shim 无法转发";
|
|
@@ -661,6 +667,7 @@
|
|
|
661
667
|
"CC_PETS_SOURCE points to an unknown source \"{DEFAULT_SOURCE}\". Available sources: {SOURCES}" = "CC_PETS_SOURCE 指向未知的源 \"{DEFAULT_SOURCE}\"。可用的源: {SOURCES}";
|
|
662
668
|
"Unknown subcommand: {command}" = "未知子命令: {command}";
|
|
663
669
|
"No executable Codex CLI found. Install codex, or set CODEX_REAL_BIN to its real path." = "未找到可执行的 Codex CLI。请先安装 codex,或通过 CODEX_REAL_BIN 指定真实路径。";
|
|
670
|
+
"No executable Antigravity CLI found. Install agy, or set AGY_REAL_BIN to its real path." = "未找到可执行的 Antigravity CLI。请先安装 agy,或通过 AGY_REAL_BIN 指定真实路径。";
|
|
664
671
|
"No executable Claude Code CLI found. Install claude, or set CLAUDE_REAL_BIN to its real path." = "未找到可执行的 Claude Code CLI。请先安装 claude,或通过 CLAUDE_REAL_BIN 指定真实路径。";
|
|
665
672
|
"Failed to install CC Pets.app; the existing app was kept." = "安装 CC Pets.app 失败,已保留原应用。";
|
|
666
673
|
"App installed: {targetApp}" = "应用已安装: {targetApp}";
|
|
@@ -681,7 +688,7 @@
|
|
|
681
688
|
"Refusing to delete: {targetApp} isn't the CC Pets app (bundle ID mismatch)." = "拒绝删除:{targetApp} 不是 CC Pets 应用(Bundle ID 不匹配)。";
|
|
682
689
|
"App removed: {targetApp}" = "已删除应用: {targetApp}";
|
|
683
690
|
"App not installed: {targetApp}" = "未安装应用: {targetApp}";
|
|
684
|
-
"Usage: cc-pets [command]\n\n cc-pets Start the pet (prefers the copy installed in ~/Applications)\n cc-pets install Install or repair the shell / Claude Code / Codex integrations\n cc-pets uninstall Remove the integrations and restore the status line\n cc-pets uninstall --purge Also delete the app, app data and preferences (asks first; keeps pets and lines in ~/.cc-pets)\n cc-pets uninstall-app Only delete ~/Applications/CC Pets.app\n cc-pets build Rebuild\n cc-pets clean Clear caches (quit the pet first)\n cc-pets doctor Check the installation and integrations, with suggested fixes\n cc-pets open [page] Open the Main menu (pages: overview, sessions, usage, pet, accounts, alerts, general, diagnostics)\n cc-pets paths [--json] List where settings, caches and data live, and their sizes\n cc-pets pet <command> Manage pet sprites; see cc-pets pet help\n cc-pets bridge <command> CC Bridge cross-session messaging; see cc-pets bridge --help\n cc-pets --status Print the current Codex quota\n cc-pets --history Print quota history (JSON)\n cc-pets --foreground Run the pet in the foreground (for debugging)\n cc-pets -v, --version Show the version\n cc-pets -h, --help Show this help\n\ncodex-with-pet / claude-with-pet start the pet along with the CLI." = "用法:cc-pets [命令]\n\n cc-pets 启动桌宠(优先使用 ~/Applications 里安装的版本)\n cc-pets install 安装或修复 shell / Claude Code / Codex 集成\n cc-pets uninstall 移除集成并恢复 status line\n cc-pets uninstall --purge 同时删除 App、应用数据和偏好(会先确认;保留 ~/.cc-pets 的素材与台词)\n cc-pets uninstall-app 只删除 ~/Applications/CC Pets.app\n cc-pets build 重新构建\n cc-pets clean 清理缓存(需先退出桌宠)\n cc-pets doctor 检查安装与各项集成是否正常,并给出修复建议\n cc-pets open [页面] 打开主菜单(页面:overview、sessions、usage、pet、accounts、alerts、general、diagnostics)\n cc-pets paths [--json] 列出配置、缓存与数据的存放位置和大小\n cc-pets pet <命令> 管理桌宠素材,详见 cc-pets pet help\n cc-pets bridge <命令> CC Bridge 跨会话消息,详见 cc-pets bridge --help\n cc-pets --status 输出 Codex 当前额度\n cc-pets --history 输出额度历史(JSON)\n cc-pets --foreground 在前台运行桌宠(调试用)\n cc-pets -v, --version 显示版本\n cc-pets -h, --help 显示本帮助\n\ncodex-with-pet / claude-with-pet 会在启动 CLI 的同时拉起桌宠。";
|
|
691
|
+
"Usage: cc-pets [command]\n\n cc-pets Start the pet (prefers the copy installed in ~/Applications)\n cc-pets install Install or repair the shell / Claude Code / Codex integrations\n cc-pets uninstall Remove the integrations and restore the status line\n cc-pets uninstall --purge Also delete the app, app data and preferences (asks first; keeps pets and lines in ~/.cc-pets)\n cc-pets uninstall-app Only delete ~/Applications/CC Pets.app\n cc-pets build Rebuild\n cc-pets clean Clear caches (quit the pet first)\n cc-pets doctor Check the installation and integrations, with suggested fixes\n cc-pets open [page] Open the Main menu (pages: overview, sessions, usage, pet, accounts, alerts, general, diagnostics)\n cc-pets paths [--json] List where settings, caches and data live, and their sizes\n cc-pets pet <command> Manage pet sprites; see cc-pets pet help\n cc-pets bridge <command> CC Bridge cross-session messaging; see cc-pets bridge --help\n cc-pets --status Print the current Codex quota\n cc-pets --history Print quota history (JSON)\n cc-pets --foreground Run the pet in the foreground (for debugging)\n cc-pets -v, --version Show the version\n cc-pets -h, --help Show this help\n\ncodex-with-pet / claude-with-pet / agy-with-pet start the pet along with the CLI." = "用法:cc-pets [命令]\n\n cc-pets 启动桌宠(优先使用 ~/Applications 里安装的版本)\n cc-pets install 安装或修复 shell / Claude Code / Codex 集成\n cc-pets uninstall 移除集成并恢复 status line\n cc-pets uninstall --purge 同时删除 App、应用数据和偏好(会先确认;保留 ~/.cc-pets 的素材与台词)\n cc-pets uninstall-app 只删除 ~/Applications/CC Pets.app\n cc-pets build 重新构建\n cc-pets clean 清理缓存(需先退出桌宠)\n cc-pets doctor 检查安装与各项集成是否正常,并给出修复建议\n cc-pets open [页面] 打开主菜单(页面:overview、sessions、usage、pet、accounts、alerts、general、diagnostics)\n cc-pets paths [--json] 列出配置、缓存与数据的存放位置和大小\n cc-pets pet <命令> 管理桌宠素材,详见 cc-pets pet help\n cc-pets bridge <命令> CC Bridge 跨会话消息,详见 cc-pets bridge --help\n cc-pets --status 输出 Codex 当前额度\n cc-pets --history 输出额度历史(JSON)\n cc-pets --foreground 在前台运行桌宠(调试用)\n cc-pets -v, --version 显示版本\n cc-pets -h, --help 显示本帮助\n\ncodex-with-pet / claude-with-pet / agy-with-pet 会在启动 CLI 的同时拉起桌宠。";
|
|
685
692
|
"Main menu" = "主菜单";
|
|
686
693
|
"Settings…" = "设置…";
|
|
687
694
|
"Window" = "窗口";
|
|
@@ -812,6 +819,8 @@
|
|
|
812
819
|
"Agent profiles" = "Agent 配置";
|
|
813
820
|
"Add Claude Home…" = "添加 Claude Home…";
|
|
814
821
|
"Add Codex Home…" = "添加 Codex Home…";
|
|
822
|
+
"Add Antigravity Home…" = "添加 Antigravity Home…";
|
|
823
|
+
"Provider must be claude, codex, or antigravity." = "Provider 必须是 claude、codex 或 antigravity。";
|
|
815
824
|
"Repair Integration" = "修复集成";
|
|
816
825
|
"Remove Integration…" = "移除集成…";
|
|
817
826
|
"Agent Profile Setup" = "Agent 配置适配";
|
|
@@ -819,6 +828,7 @@
|
|
|
819
828
|
"Choose Home" = "选择 Home";
|
|
820
829
|
"Choose an existing Claude Home folder, such as ~/.claude-work." = "选择已有的 Claude Home 文件夹,例如 ~/.claude-work。";
|
|
821
830
|
"Choose an existing Codex Home folder, such as ~/.codex-work." = "选择已有的 Codex Home 文件夹,例如 ~/.codex-work。";
|
|
831
|
+
"Choose a Gemini root folder containing the antigravity-cli directory." = "选择包含 antigravity-cli 子目录的 Gemini 根目录。";
|
|
822
832
|
"This folder doesn't look like an Agent Home" = "这个文件夹不像 Agent Home";
|
|
823
833
|
"Choose a folder containing Claude settings, state, or projects." = "请选择包含 Claude 设置、状态或项目数据的文件夹。";
|
|
824
834
|
"Choose a folder containing Codex config, hooks, or sign-in state." = "请选择包含 Codex 配置、Hooks 或登录状态的文件夹。";
|
|
@@ -836,6 +846,7 @@
|
|
|
836
846
|
"Agent Profile Setup Failed" = "Agent 配置适配失败";
|
|
837
847
|
"The Claude Home is integrated. Restart Claude to load newly registered MCP tools." = "Claude Home 已集成。请重启 Claude 以加载新注册的 MCP 工具。";
|
|
838
848
|
"The Codex Home is integrated. Restart Codex, then trust the CC Pets hooks in /hooks." = "Codex Home 已集成。请重启 Codex,然后在 /hooks 中信任 CC Pets Hooks。";
|
|
849
|
+
"The Antigravity CLI Home is integrated. Restart agy to load the updated hooks and tools." = "Antigravity CLI Home 已集成。请重启 agy 以加载更新后的 Hooks 和工具。";
|
|
839
850
|
"Repairing %@" = "正在修复 %@";
|
|
840
851
|
"The Agent profile integration was repaired." = "Agent 配置集成已修复。";
|
|
841
852
|
"Remove integration for %@?" = "移除 %@ 的集成?";
|
|
@@ -843,7 +854,6 @@
|
|
|
843
854
|
"Remove Integration" = "移除集成";
|
|
844
855
|
"Removing %@" = "正在移除 %@";
|
|
845
856
|
"The CC Pets integration was removed. The Agent Home and its data were kept." = "CC Pets 集成已移除,Agent Home 及其数据已保留。";
|
|
846
|
-
"All accounts" = "全部账号";
|
|
847
857
|
"No Agent accounts detected" = "尚未检测到账号";
|
|
848
858
|
"Official Homes appear automatically" = "官方 Home 会自动显示";
|
|
849
859
|
"Add custom Homes from Multi-Account in the Main menu" = "自定义 Home 请从主菜单的“多账号”中添加";
|
|
@@ -861,6 +871,10 @@
|
|
|
861
871
|
"Relocating %@" = "正在重新定位 %@";
|
|
862
872
|
"The Agent Home was relocated and its integration was updated." = "Agent Home 已重新定位,集成也已更新。";
|
|
863
873
|
"Agent profile registry" = "Agent 配置注册表";
|
|
874
|
+
"Agent shims" = "Agent shim 目录";
|
|
875
|
+
"Antigravity CLI hooks" = "Antigravity CLI Hooks";
|
|
876
|
+
"Antigravity CLI MCP config" = "Antigravity CLI MCP 配置";
|
|
877
|
+
"Antigravity CLI settings" = "Antigravity CLI 设置";
|
|
864
878
|
"Agent profile: %@" = "Agent 配置:%@";
|
|
865
879
|
"No registered Agent profiles" = "没有已登记的 Agent 配置";
|
|
866
880
|
"Some registered Agent profiles need repair; open Multi-Account in the Main menu and retry." = "部分已登记的账号需要修复;请打开主菜单的“多账号”后重试。";
|
|
@@ -868,8 +882,11 @@
|
|
|
868
882
|
"No Agent Homes are registered; CC Bridge will be applied when you add one from Multi-Account in the Main menu." = "尚未登记 Agent Home;以后从主菜单的“多账号”添加时会自动接入 CC Bridge。";
|
|
869
883
|
"CC Bridge hooks installed in %@" = "%@ 已安装 CC Bridge Hooks";
|
|
870
884
|
"CC Bridge hooks missing in %@" = "%@ 缺少 CC Bridge Hooks";
|
|
885
|
+
"CC Bridge hooks and MCP installed in %@" = "%@ 已安装 CC Bridge Hooks 和 MCP";
|
|
886
|
+
"CC Bridge hooks or MCP missing in %@" = "%@ 缺少 CC Bridge Hooks 或 MCP";
|
|
887
|
+
"Antigravity CLI reads Bridge messages on its next model invocation." = "Antigravity CLI 会在下次模型调用时读取 Bridge 消息。";
|
|
871
888
|
"Agent usage account cards" = "Agent 用量账号卡片";
|
|
872
|
-
"
|
|
889
|
+
"Use the arrows, page dots, or horizontal swipes to switch usage pages or accounts. Use the button below the cards to show more or fewer." = "点击箭头或页码圆点,或横向滑动,可切换用量页面或账号。点击卡片下方的按钮可展开或收起。";
|
|
873
890
|
|
|
874
891
|
/* 多账号页面。 */
|
|
875
892
|
"Add and manage Claude and Codex Homes." = "添加和管理 Claude、Codex 的 Home。";
|
|
@@ -877,7 +894,7 @@
|
|
|
877
894
|
"Integrated" = "已集成";
|
|
878
895
|
"Home unavailable" = "Home 不可用";
|
|
879
896
|
"Needs repair" = "需要修复";
|
|
880
|
-
"Use the buttons above to add an existing
|
|
897
|
+
"Use the buttons above to add an existing Agent Home." = "使用上方按钮添加已有的 Agent Home。";
|
|
881
898
|
|
|
882
899
|
"The target Codex Home is unknown; send input in that session to refresh its registration." = "无法确定接收方的 Codex Home;请在该会话发送输入以刷新注册信息。";
|
|
883
900
|
|
|
@@ -907,14 +924,17 @@
|
|
|
907
924
|
|
|
908
925
|
/* 启动前代理检查 */
|
|
909
926
|
"Launch Protection" = "启动保护";
|
|
910
|
-
"Block Claude / Codex when Shadowrocket is disconnected or the exit is in an unsupported region" = "Shadowrocket 未连接,或出口为不支持的地区时,阻止启动 Claude / Codex";
|
|
927
|
+
"Block Claude / Codex when Shadowrocket is disconnected or the exit is in an unsupported region. Antigravity only checks the connection." = "Shadowrocket 未连接,或出口为不支持的地区时,阻止启动 Claude / Codex。Antigravity 只检查连接状态。";
|
|
911
928
|
"Off by default. Checks each service's exit IP and region through CC Pets wrappers; does not validate your account or API key." = "默认关闭。通过 CC Pets 包装器分别检查各服务的出口 IP 和地区,不验证账号或 API 密钥。";
|
|
912
929
|
"CC Pets blocked {provider}: {reason}" = "CC Pets 已阻止启动 {provider}:{reason}";
|
|
913
930
|
"Connect Shadowrocket and select an exit outside mainland China / Hong Kong, then check routing and DNS settings. You can turn off this check in Main menu → Settings → Launch Protection." = "请连接 Shadowrocket,选择中国大陆和香港以外的出口,并检查分流及 DNS 设置。可在「主菜单 → 设置 → 启动保护」关闭此检查。";
|
|
931
|
+
"Connect Shadowrocket to continue. You can turn off this check in Main menu → Settings → Launch Protection." = "请连接 Shadowrocket 后继续。可在「主菜单 → 设置 → 启动保护」关闭此检查。";
|
|
914
932
|
"Unable to read the system VPN status." = "无法读取系统 VPN 状态。";
|
|
915
933
|
"Shadowrocket is not connected. Opening the app alone is not enough." = "Shadowrocket 尚未连接,仅打开应用不代表代理已开启。";
|
|
916
934
|
"No Shadowrocket VPN configuration was found." = "未找到 Shadowrocket 的 VPN 配置。";
|
|
917
|
-
"Launch check expects claude or
|
|
935
|
+
"Launch check expects claude, codex or agy." = "启动检查需要指定 claude、codex 或 agy。";
|
|
936
|
+
"CC Pets: checking Shadowrocket ..." = "CC Pets:正在检查 Shadowrocket 连接状态 ...";
|
|
937
|
+
"CC Pets: Shadowrocket is connected." = "CC Pets:Shadowrocket 已连接。";
|
|
918
938
|
"CC Pets: checking Shadowrocket and service exit regions ..." = "CC Pets:正在检查 Shadowrocket 连接状态及服务出口地区 ...";
|
|
919
939
|
"The proxy or service hostname could not be resolved." = "无法解析代理或服务域名。";
|
|
920
940
|
"TLS negotiation or certificate verification failed." = "TLS 握手或证书校验失败。";
|
|
@@ -1038,3 +1058,32 @@
|
|
|
1038
1058
|
"Lowest 5-hour quota left; orange at 20% or below, red at 10%" = "显示最低的 5 小时剩余额度;20% 及以下为橙色,10% 及以下为红色";
|
|
1039
1059
|
"The pet is hidden (menu bar only). Line: %@" = "桌宠已隐藏(仅菜单栏),这句是:%@";
|
|
1040
1060
|
"Click to jump to the session awaiting approval (⌥-click for the panel)" = "点击跳到等待审批的会话(按住 ⌥ 点击打开面板)";
|
|
1061
|
+
"No quota data" = "暂无额度数据";
|
|
1062
|
+
"API · This month %@" = "API · 本月 %@";
|
|
1063
|
+
"Credits · This month %@" = "积分计费 · 本月 %@";
|
|
1064
|
+
|
|
1065
|
+
"Antigravity allow without asking: {agyAllow}" = "Antigravity 免确认:{agyAllow}";
|
|
1066
|
+
"Queued in {name}'s inbox. Antigravity CLI will read it on its next model invocation." = "已放入 {name} 的信箱,Antigravity CLI 会在下次调用模型时读取。";
|
|
1067
|
+
"The supplied session_id differs from the current Antigravity conversation." = "传入的 session_id 与当前 Antigravity 对话不一致。";
|
|
1068
|
+
"Expected a JSON object." = "配置必须是 JSON 对象。";
|
|
1069
|
+
"The Antigravity hook name is already in use." = "Antigravity Hook 名称已被使用。";
|
|
1070
|
+
"Antigravity CLI hooks configured in {path}." = "已在 {path} 配置 Antigravity CLI Hooks。";
|
|
1071
|
+
"The Antigravity MCP server name is already in use." = "Antigravity MCP 服务名称已被使用。";
|
|
1072
|
+
"Expected an Antigravity permissions object with an allow array." = "Antigravity 的 permissions 必须是对象,allow 必须是数组。";
|
|
1073
|
+
"Registered CC Bridge MCP for Antigravity CLI." = "已为 Antigravity CLI 注册 CC Bridge MCP。";
|
|
1074
|
+
"Removed CC Bridge MCP from Antigravity CLI." = "已从 Antigravity CLI 移除 CC Bridge MCP。";
|
|
1075
|
+
|
|
1076
|
+
"Antigravity App integration: {agyApp}" = "Antigravity App 集成:{agyApp}";
|
|
1077
|
+
"Open Antigravity App once before enabling its CC Bridge integration." = "请先打开一次 Antigravity App,再启用它的 CC Bridge 集成。";
|
|
1078
|
+
"CC Bridge is unavailable for this Antigravity host." = "当前 Antigravity 宿主无法使用 CC Bridge。";
|
|
1079
|
+
"Delivered to the Antigravity App conversation {name}." = "已送入 Antigravity App 对话 {name}。";
|
|
1080
|
+
"Queued in {name}'s inbox. Idle Antigravity App conversations are woken by the Sidecar." = "已放入 {name} 的信箱。Sidecar 会唤醒空闲的 Antigravity App 对话。";
|
|
1081
|
+
"Antigravity App Sidecar configured" = "Antigravity App Sidecar 已配置";
|
|
1082
|
+
"Antigravity App Sidecar needs repair" = "Antigravity App Sidecar 需要修复";
|
|
1083
|
+
"The Antigravity sidecar name is already in use." = "Antigravity Sidecar 名称已被使用。";
|
|
1084
|
+
"Antigravity App Sidecar enabled." = "已启用 Antigravity App Sidecar。";
|
|
1085
|
+
"Antigravity App Sidecar disabled." = "已停用 Antigravity App Sidecar。";
|
|
1086
|
+
"Expand all" = "展开全部";
|
|
1087
|
+
"Show less" = "收起";
|
|
1088
|
+
"Quota Card Order" = "额度卡片顺序";
|
|
1089
|
+
"Drag to reorder cards in the hover panel" = "拖动调整悬停面板中的卡片顺序";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// agent 事件流读取与客户端存活检测。
|
|
2
2
|
#import "CCPetsAppDelegate+Private.h"
|
|
3
|
+
#import "CCPetsBridgeStore.h"
|
|
3
4
|
|
|
4
5
|
// 客户端是否真的还在跑。只问 kill(pid, 0) 不够:关掉终端窗口只是销毁 pty,claude /
|
|
5
6
|
// codex(Node 进程)不一定跟着 SIGHUP 退出,会变成脱离控制终端的孤儿继续活着。那样
|
|
@@ -86,15 +87,17 @@ static BOOL ClientProcessAlive(pid_t pid, NSString *recordedTTY) {
|
|
|
86
87
|
if (desktop && !ended && persistent && !persistent.boolValue) continue;
|
|
87
88
|
if (persistent) normalized[@"desktopPersistent"] = persistent;
|
|
88
89
|
BOOL replay = recentOnly && (desktop || [record[@"timestamp"] doubleValue] < cutoff);
|
|
90
|
+
BOOL liveAntigravity = replay && !ended && IsAntigravitySessionRecord(record) &&
|
|
91
|
+
CCBridgeEnabled() && CCBridgeSessionLive(CCBridgeReadSession(record[@"session"]));
|
|
89
92
|
// 只有确认的持久化聊天可以恢复在线列表。应用存活不证明某轮任务仍在运行。
|
|
90
|
-
if (replay && !ended && !(desktop && persistent.boolValue && CodexDesktopFocusTargetIsLive(record[@"terminal"],
|
|
93
|
+
if (replay && !ended && !liveAntigravity && !(desktop && persistent.boolValue && CodexDesktopFocusTargetIsLive(record[@"terminal"],
|
|
91
94
|
[record[@"timestamp"] doubleValue]))) continue;
|
|
92
95
|
NSString *sessionKey = [self agentSessionKeyForRecord:record];
|
|
93
96
|
NSDictionary *previous = sessionKey ? self.agentSessionRecords[sessionKey] : nil;
|
|
94
97
|
// 在记录、审批、动画等所有消费者之前挡住完成后的尾随事件。
|
|
95
98
|
if (!ended && previous && [[self statusIdentityForRecord:previous] isEqual:[self statusIdentityForRecord:record]] &&
|
|
96
99
|
[self isTrailingRecord:record afterState:previous[@"state"]]) continue;
|
|
97
|
-
if (replay && desktop && !ended &&
|
|
100
|
+
if (replay && (desktop || liveAntigravity) && !ended &&
|
|
98
101
|
![@[@"completed", @"failed"] containsObject:record[@"state"] ?: @""]) {
|
|
99
102
|
normalized[@"state"] = @"idle";
|
|
100
103
|
normalized[@"event"] = @"Snapshot";
|
|
@@ -263,6 +266,7 @@ static BOOL ClientProcessAlive(pid_t pid, NSString *recordedTTY) {
|
|
|
263
266
|
// 启动模式在应用生命周期内保持不变。手动启动的桌宠即使后来检测到
|
|
264
267
|
// Codex/Claude 客户端,也不应被转成 CLI 托管模式并随客户端退出。
|
|
265
268
|
// 桌面端不创建 CLI pid 文件;只要桌面应用仍运行,就不能随最后一个终端退出。
|
|
266
|
-
if (liveClients == 0 && self.managedByCLI && !CodexDesktopApplicationIsRunning()
|
|
269
|
+
if (liveClients == 0 && self.managedByCLI && !CodexDesktopApplicationIsRunning() &&
|
|
270
|
+
!AntigravityDesktopApplicationIsRunning()) [NSApp terminate:nil];
|
|
267
271
|
}
|
|
268
272
|
@end
|
|
@@ -206,7 +206,7 @@
|
|
|
206
206
|
if (![state isEqualToString:@"completed"] && ![state isEqualToString:@"failed"]) return NO;
|
|
207
207
|
NSString *event = [record[@"event"] isKindOfClass:NSString.class] ? record[@"event"] : @"";
|
|
208
208
|
return [event isEqualToString:@"SubagentStop"] || [event isEqualToString:@"PostToolUse"] ||
|
|
209
|
-
[event isEqualToString:@"TaskCompleted"];
|
|
209
|
+
[event isEqualToString:@"TaskCompleted"] || [event isEqualToString:@"ApprovalResolved"];
|
|
210
210
|
}
|
|
211
211
|
// 标题优先显示账号名;身份比较使用 profileId 和会话身份,不按显示名合并终端。
|
|
212
212
|
- (NSString *)statusPresentationNameForRecord:(NSDictionary *)record {
|
|
@@ -376,8 +376,12 @@
|
|
|
376
376
|
NSString *tool = [record[@"tool"] isKindOfClass:NSString.class] ? record[@"tool"] : @"";
|
|
377
377
|
NSString *animationEvent = [state isEqualToString:@"auto_review"]
|
|
378
378
|
? @"AutoReviewRequest" : event;
|
|
379
|
-
[
|
|
380
|
-
|
|
379
|
+
if ([event isEqual:@"ApprovalResolved"]) {
|
|
380
|
+
if ([state isEqual:@"idle"]) [self.petView resetAgentToIdle];
|
|
381
|
+
else [self.petView handleAgentEvent:@"UserPromptSubmit" tool:@"" failed:NO];
|
|
382
|
+
} else {
|
|
383
|
+
[self.petView handleAgentEvent:animationEvent tool:tool failed:[record[@"failed"] boolValue]];
|
|
384
|
+
}
|
|
381
385
|
[self showAgentStatusForRecord:record notify:shouldNotify];
|
|
382
386
|
// 说话是事件流的新消费者,不改变事件生产。冷启动重放已被 processAgentEventData
|
|
383
387
|
// 的 recentOnly + 5 秒 cutoff 挡住,再加上预算制和冷却,最坏也只多说一句。
|
|
@@ -463,12 +467,16 @@
|
|
|
463
467
|
}
|
|
464
468
|
return CodexDesktopFocusTargetIsLive(terminal, [record[@"timestamp"] doubleValue]);
|
|
465
469
|
}
|
|
470
|
+
// Antigravity App 没有 pid 文件:App 退出即下线,在运行时按 Bridge 会话或活跃度判断。
|
|
471
|
+
if ([record[@"provider"] isEqual:CCBridgeAntigravityAppProvider] && !AntigravityDesktopApplicationIsRunning()) return NO;
|
|
466
472
|
NSString *onlineKey = [self onlineAgentSessionKeyForRecord:record];
|
|
467
473
|
if (onlineKey.length > 0 && [self.liveAgentSessionKeys containsObject:onlineKey]) return YES;
|
|
468
474
|
// 老版本包装脚本的 pid 文件不带账号,只能按 provider + tty 认领。
|
|
469
475
|
NSString *unscopedKey = OnlineAgentSessionKey(record[@"provider"], nil, terminal[@"tty"]);
|
|
470
476
|
if (unscopedKey.length > 0 && [self.liveAgentSessionKeys containsObject:unscopedKey]) return YES;
|
|
471
477
|
if ([self.managedAgentSessionKeys containsObject:[self statusIdentityForRecord:record]]) return NO;
|
|
478
|
+
if (IsAntigravitySessionRecord(record) && CCBridgeEnabled() &&
|
|
479
|
+
CCBridgeSessionLive(CCBridgeReadSession(record[@"session"]))) return YES;
|
|
472
480
|
return NSDate.date.timeIntervalSince1970 - [record[@"timestamp"] doubleValue]
|
|
473
481
|
< AgentStatusInactivityInterval;
|
|
474
482
|
}
|
|
@@ -71,10 +71,13 @@
|
|
|
71
71
|
if (sender.action == @selector(toggleBridgeEnabled:)) return CCBridgeEnabled();
|
|
72
72
|
if (sender.action == @selector(toggleBridgeWake:)) return [options[@"wake"] boolValue];
|
|
73
73
|
if (sender.action == @selector(toggleBridgeEditGuard:)) return [options[@"editGuard"] boolValue];
|
|
74
|
+
if (sender.action == @selector(toggleBridgeTabTitle:)) return [options[@"tabTitle"] boolValue];
|
|
74
75
|
if (sender.action == @selector(toggleBridgeApproval:)) {
|
|
75
76
|
NSSet *tools = [NSSet setWithArray:CCBridgeToolGroup([self bridgeApprovalGroupForTag:sender.tag])];
|
|
77
|
+
BOOL hasAntigravity = CCPetsProfilesForProvider(CCPetsProfileProviderAntigravity).count > 0;
|
|
76
78
|
return tools.count > 0 && [tools isSubsetOfSet:[NSSet setWithArray:options[@"codexApprove"]]] &&
|
|
77
|
-
[tools isSubsetOfSet:[NSSet setWithArray:options[@"claudeAllow"]]]
|
|
79
|
+
[tools isSubsetOfSet:[NSSet setWithArray:options[@"claudeAllow"]]] &&
|
|
80
|
+
(!hasAntigravity || [tools isSubsetOfSet:[NSSet setWithArray:options[@"antigravityAllow"]]]);
|
|
78
81
|
}
|
|
79
82
|
return NO;
|
|
80
83
|
}
|
|
@@ -99,7 +102,7 @@
|
|
|
99
102
|
? L(@"Enabled. Running Codex sessions need a restart and must be trusted in /hooks; Claude sessions get the cc-bridge tools after a restart.")
|
|
100
103
|
: L(@"Disabled. The related hooks and MCP registrations were removed.")];
|
|
101
104
|
}
|
|
102
|
-
//
|
|
105
|
+
// 菜单上的一个分组同时更新已集成 Agent 各自的工具权限。
|
|
103
106
|
- (void)toggleBridgeApproval:(NSButton *)sender {
|
|
104
107
|
NSArray<NSString *> *tools = CCBridgeToolGroup([self bridgeApprovalGroupForTag:sender.tag]);
|
|
105
108
|
if (tools.count == 0) return;
|
|
@@ -110,10 +113,13 @@
|
|
|
110
113
|
if (allow) [next addObjectsFromArray:tools]; else [next removeObjectsInArray:tools];
|
|
111
114
|
return [next.array componentsJoinedByString:@","];
|
|
112
115
|
};
|
|
113
|
-
|
|
116
|
+
NSMutableArray *command = [@[@"configure",
|
|
114
117
|
[@"--codex-approve=" stringByAppendingString:apply(options[@"codexApprove"])],
|
|
115
|
-
[@"--claude-allow=" stringByAppendingString:apply(options[@"claudeAllow"])]]
|
|
116
|
-
|
|
118
|
+
[@"--claude-allow=" stringByAppendingString:apply(options[@"claudeAllow"])]] mutableCopy];
|
|
119
|
+
if (CCPetsProfilesForProvider(CCPetsProfileProviderAntigravity).count > 0) {
|
|
120
|
+
[command addObject:[@"--agy-allow=" stringByAppendingString:apply(options[@"antigravityAllow"])]];
|
|
121
|
+
}
|
|
122
|
+
[self runBridgeCommand:command sender:sender successMessage:nil];
|
|
117
123
|
}
|
|
118
124
|
- (void)toggleBridgeWake:(NSButton *)sender {
|
|
119
125
|
[self runBridgeCommand:@[@"configure",
|
|
@@ -124,6 +130,11 @@
|
|
|
124
130
|
[self targetBridgeStateForSwitch:sender] ? @"--edit-guard=on" : @"--edit-guard=off"]
|
|
125
131
|
sender:sender successMessage:nil];
|
|
126
132
|
}
|
|
133
|
+
- (void)toggleBridgeTabTitle:(NSButton *)sender {
|
|
134
|
+
[self runBridgeCommand:@[@"configure",
|
|
135
|
+
[self targetBridgeStateForSwitch:sender] ? @"--tab-title=on" : @"--tab-title=off"]
|
|
136
|
+
sender:sender successMessage:nil];
|
|
137
|
+
}
|
|
127
138
|
- (void)toggleBridgeBadge:(NSButton *)sender {
|
|
128
139
|
BOOL enabled = !CCPetsPrefBool(BridgeBadgeEnabledKey);
|
|
129
140
|
[self updateBridgeBadgeEnabled:enabled];
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
#import "MenuChoiceRow.h"
|
|
19
19
|
#import "CCPetsGlassMenu.h"
|
|
20
20
|
#import "CCPetsBridge.h"
|
|
21
|
+
#import "CCPetsBridgeStore.h"
|
|
21
22
|
#import "CCPetsProfiles.h"
|
|
22
23
|
#import "MenuToggleSwitch.h"
|
|
23
24
|
#import "CCPetsStatusItem.h"
|
|
@@ -103,6 +104,11 @@ static NSString *const PetSpeechFrequencyChatty = @"chatty";
|
|
|
103
104
|
// 用控件自己的 fittingSize 量,不要用 sizeWithAttributes:。
|
|
104
105
|
// NSTextField 的 cell 有一点内部留白,纯按字符串量出来的宽度会比控件真正需要的小几个点,
|
|
105
106
|
// 结果就是明明算着"刚好够",显示出来最后一两个字变成省略号。
|
|
107
|
+
// Antigravity CLI 与 App 的会话都登记在 CC Bridge,存活判断可以共用 Bridge 会话表。
|
|
108
|
+
static inline BOOL IsAntigravitySessionRecord(NSDictionary *record) {
|
|
109
|
+
id provider = record[@"provider"];
|
|
110
|
+
return [provider isEqual:CCBridgeAntigravityProvider] || [provider isEqual:CCBridgeAntigravityAppProvider];
|
|
111
|
+
}
|
|
106
112
|
static inline CGFloat PetMeasuredLabelWidth(NSTextField *label) {
|
|
107
113
|
if (label.stringValue.length == 0) return 0;
|
|
108
114
|
return ceil(label.fittingSize.width) + 2;
|
|
@@ -185,6 +191,8 @@ static inline void PetResizeBubblePanel(NSPanel *panel, NSSize logicalSize) {
|
|
|
185
191
|
- (void)setUsageDisplayModeFromControl:(NSButton *)sender;
|
|
186
192
|
- (void)applySystemMetricPreferences;
|
|
187
193
|
- (void)applyUsageDisplayModePreferences;
|
|
194
|
+
- (NSArray<NSString *> *)quotaCardOrderForSettings;
|
|
195
|
+
- (void)updateQuotaCardOrder:(NSArray<NSString *> *)order;
|
|
188
196
|
- (void)showImportedCodexPetsAlert:(NSUInteger)imported;
|
|
189
197
|
- (void)setPanelTheme:(MenuChoiceRowView *)sender;
|
|
190
198
|
- (void)applyBubbleTextStyle;
|
|
@@ -254,6 +262,7 @@ static inline void PetResizeBubblePanel(NSPanel *panel, NSSize logicalSize) {
|
|
|
254
262
|
- (void)toggleBridgeApproval:(NSButton *)sender;
|
|
255
263
|
- (void)toggleBridgeWake:(NSButton *)sender;
|
|
256
264
|
- (void)toggleBridgeEditGuard:(NSButton *)sender;
|
|
265
|
+
- (void)toggleBridgeTabTitle:(NSButton *)sender;
|
|
257
266
|
- (void)toggleBridgeBadge:(NSButton *)sender;
|
|
258
267
|
- (void)updateBridgeBadgeEnabled:(BOOL)enabled;
|
|
259
268
|
- (void)toggleBridgeNotification:(NSButton *)sender;
|
|
@@ -281,6 +290,7 @@ static inline void PetResizeBubblePanel(NSPanel *panel, NSSize logicalSize) {
|
|
|
281
290
|
@interface AppDelegate (Profiles)
|
|
282
291
|
- (void)addClaudeProfile:(id)sender;
|
|
283
292
|
- (void)addCodexProfile:(id)sender;
|
|
293
|
+
- (void)addAntigravityProfile:(id)sender;
|
|
284
294
|
- (void)repairAgentProfile:(NSMenuItem *)sender;
|
|
285
295
|
- (void)renameAgentProfile:(NSMenuItem *)sender;
|
|
286
296
|
- (void)relocateAgentProfile:(NSMenuItem *)sender;
|
|
@@ -326,7 +336,7 @@ static inline void PetResizeBubblePanel(NSPanel *panel, NSSize logicalSize) {
|
|
|
326
336
|
- (void)scheduleQuotaDashboardHide;
|
|
327
337
|
- (void)hideQuotaDashboardIfNeeded;
|
|
328
338
|
- (void)refreshUsage:(id)sender;
|
|
329
|
-
- (void)
|
|
339
|
+
- (void)applyUsageByProvider:(NSDictionary<NSString *, NSDictionary *> *)usageByProvider;
|
|
330
340
|
- (void)rescheduleUsageTimer;
|
|
331
341
|
- (BOOL)shouldRefreshUsageForDashboard;
|
|
332
342
|
- (BOOL)hasEnabledSystemMetric;
|
|
@@ -11,6 +11,10 @@
|
|
|
11
11
|
[self chooseProfileHomeForProvider:CCPetsProfileProviderCodex];
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
+
- (void)addAntigravityProfile:(id)sender {
|
|
15
|
+
[self chooseProfileHomeForProvider:CCPetsProfileProviderAntigravity];
|
|
16
|
+
}
|
|
17
|
+
|
|
14
18
|
// 设置页的按钮在命令执行期间仍可点,被挡下时要告诉用户,不能悄悄什么都不做。
|
|
15
19
|
- (BOOL)rejectWhileProfileCommandRunning {
|
|
16
20
|
if (!self.profileCommandRunning) return NO;
|
|
@@ -20,6 +24,8 @@
|
|
|
20
24
|
|
|
21
25
|
- (void)chooseProfileHomeForProvider:(NSString *)provider {
|
|
22
26
|
if ([self rejectWhileProfileCommandRunning]) return;
|
|
27
|
+
BOOL antigravity = [provider isEqualToString:CCPetsProfileProviderAntigravity];
|
|
28
|
+
BOOL claude = [provider isEqualToString:CCPetsProfileProviderClaude];
|
|
23
29
|
NSOpenPanel *panel = [NSOpenPanel openPanel];
|
|
24
30
|
panel.canChooseDirectories = YES;
|
|
25
31
|
panel.canChooseFiles = NO;
|
|
@@ -27,18 +33,18 @@
|
|
|
27
33
|
panel.canCreateDirectories = NO;
|
|
28
34
|
panel.showsHiddenFiles = YES;
|
|
29
35
|
panel.prompt = L(@"Choose Home");
|
|
30
|
-
panel.message =
|
|
31
|
-
|
|
36
|
+
if (antigravity) panel.message = L(@"Choose a Gemini root folder containing the antigravity-cli directory.");
|
|
37
|
+
else panel.message = claude ? L(@"Choose an existing Claude Home folder, such as ~/.claude-work.")
|
|
32
38
|
: L(@"Choose an existing Codex Home folder, such as ~/.codex-work.");
|
|
33
39
|
panel.directoryURL = [NSURL fileURLWithPath:CCPetsHomeDirectory() isDirectory:YES];
|
|
34
40
|
[NSApp activateIgnoringOtherApps:YES];
|
|
35
41
|
if ([panel runModal] != NSModalResponseOK) return;
|
|
36
42
|
NSString *home = panel.URL.path;
|
|
37
43
|
if (!CCPetsProfileHomeMatchesProvider(provider, home)) {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
44
|
+
NSString *message = antigravity ? L(@"Choose a Gemini root folder containing the antigravity-cli directory.")
|
|
45
|
+
: (claude ? L(@"Choose a folder containing Claude settings, state, or projects.")
|
|
46
|
+
: L(@"Choose a folder containing Codex config, hooks, or sign-in state."));
|
|
47
|
+
[self showAlertWithTitle:L(@"This folder doesn't look like an Agent Home") message:message];
|
|
42
48
|
return;
|
|
43
49
|
}
|
|
44
50
|
NSString *name = CCPetsProfileDefaultDisplayName(provider, home);
|
|
@@ -53,11 +59,12 @@
|
|
|
53
59
|
if ([confirm runModal] != NSAlertFirstButtonReturn) return;
|
|
54
60
|
// 首次名称只是 Home 文件夹名,不算用户自定义;这样以后重新定位 Home 时,
|
|
55
61
|
// 未主动重命名的账号名称仍会跟随新的文件夹名。
|
|
62
|
+
NSString *completionMessage = antigravity ? L(@"The Antigravity CLI Home is integrated. Restart agy to load the updated hooks and tools.")
|
|
63
|
+
: (claude ? L(@"The Claude Home is integrated. Restart Claude to load newly registered MCP tools.")
|
|
64
|
+
: L(@"The Codex Home is integrated. Restart Codex, then trust the CC Pets hooks in /hooks."));
|
|
56
65
|
[self runProfileCommand:@[@"add", @"--provider", provider, @"--home", home]
|
|
57
66
|
title:[NSString stringWithFormat:L(@"Configuring %@"), name]
|
|
58
|
-
completionMessage:
|
|
59
|
-
? L(@"The Claude Home is integrated. Restart Claude to load newly registered MCP tools.")
|
|
60
|
-
: L(@"The Codex Home is integrated. Restart Codex, then trust the CC Pets hooks in /hooks.")];
|
|
67
|
+
completionMessage:completionMessage];
|
|
61
68
|
}
|
|
62
69
|
|
|
63
70
|
- (void)repairAgentProfile:(NSMenuItem *)sender {
|
|
@@ -101,14 +108,17 @@
|
|
|
101
108
|
panel.canCreateDirectories = NO;
|
|
102
109
|
panel.showsHiddenFiles = YES;
|
|
103
110
|
panel.prompt = L(@"Choose Home");
|
|
104
|
-
|
|
111
|
+
BOOL antigravity = [profile[@"provider"] isEqualToString:CCPetsProfileProviderAntigravity];
|
|
112
|
+
panel.message = antigravity ? L(@"Choose a Gemini root folder containing the antigravity-cli directory.")
|
|
113
|
+
: L(@"Choose the new location for this Agent Home.");
|
|
105
114
|
panel.directoryURL = [NSURL fileURLWithPath:profile[@"home"] isDirectory:YES];
|
|
106
115
|
[NSApp activateIgnoringOtherApps:YES];
|
|
107
116
|
if ([panel runModal] != NSModalResponseOK) return;
|
|
108
117
|
NSString *home = panel.URL.path;
|
|
109
118
|
if (!CCPetsProfileHomeMatchesProvider(profile[@"provider"], home)) {
|
|
110
119
|
[self showAlertWithTitle:L(@"This folder doesn't look like an Agent Home")
|
|
111
|
-
message:L(@"Choose a folder containing the
|
|
120
|
+
message:antigravity ? L(@"Choose a Gemini root folder containing the antigravity-cli directory.")
|
|
121
|
+
: L(@"Choose a folder containing the selected Agent's settings or state.")];
|
|
112
122
|
return;
|
|
113
123
|
}
|
|
114
124
|
[self runProfileCommand:@[@"update", @"--id", profileID, @"--home", home]
|