cc-pets 2.1.2 → 2.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.
Files changed (61) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/CHANGELOG.zh-CN.md +17 -0
  3. package/CONTRIBUTING.md +54 -0
  4. package/CONTRIBUTING.zh-CN.md +45 -0
  5. package/README.md +31 -26
  6. package/README.zh-CN.md +22 -16
  7. package/Resources/Info.plist +3 -1
  8. package/Resources/en.lproj/InfoPlist.strings +1 -0
  9. package/Resources/phrases.default.en.txt +182 -0
  10. package/Resources/zh-Hans.lproj/InfoPlist.strings +1 -0
  11. package/Resources/zh-Hans.lproj/Localizable.strings +332 -0
  12. package/Sources/CCPets/CCPetsAppDelegate+AgentStatus.m +28 -28
  13. package/Sources/CCPets/CCPetsAppDelegate+Bridge.m +16 -14
  14. package/Sources/CCPets/CCPetsAppDelegate+Pets.m +7 -9
  15. package/Sources/CCPets/CCPetsAppDelegate+Private.h +3 -0
  16. package/Sources/CCPets/CCPetsAppDelegate+Settings.m +25 -4
  17. package/Sources/CCPets/CCPetsAppDelegate+Speech.m +1 -1
  18. package/Sources/CCPets/CCPetsAppDelegate+Update.m +36 -35
  19. package/Sources/CCPets/CCPetsAppDelegate.m +20 -14
  20. package/Sources/CCPets/CCPetsCleanup.m +9 -6
  21. package/Sources/CCPets/CCPetsEvents.m +4 -3
  22. package/Sources/CCPets/CCPetsL10n.h +55 -0
  23. package/Sources/CCPets/CCPetsL10n.m +219 -0
  24. package/Sources/CCPets/CCPetsPhrases.h +7 -1
  25. package/Sources/CCPets/CCPetsPhrases.m +86 -31
  26. package/Sources/CCPets/CCPetsPhrasesEditor.m +62 -64
  27. package/Sources/CCPets/CCPetsPreviews.m +7 -6
  28. package/Sources/CCPets/CCPetsVersion.h +7 -4
  29. package/Sources/CCPets/CCPetsVersion.m +14 -6
  30. package/Sources/CCPets/MenuToggleSwitch.m +3 -2
  31. package/Sources/CCPets/PetView.m +103 -74
  32. package/Sources/CCPets/QuotaDashboardView.m +122 -85
  33. package/Sources/CCPets/main.m +3 -1
  34. package/bin/cc-pets +21 -22
  35. package/bin/claude-with-pet +2 -1
  36. package/bin/codex-with-pet +2 -1
  37. package/package.json +3 -2
  38. package/scripts/bridge/cli.mjs +39 -38
  39. package/scripts/bridge/core.mjs +27 -26
  40. package/scripts/bridge/hook.mjs +7 -6
  41. package/scripts/bridge/install.mjs +24 -23
  42. package/scripts/bridge/mcp-server.mjs +79 -71
  43. package/scripts/bridge/options.mjs +7 -6
  44. package/scripts/bridge/reservations.mjs +6 -5
  45. package/scripts/bridge/store.mjs +10 -9
  46. package/scripts/build.sh +24 -5
  47. package/scripts/check-l10n.mjs +168 -0
  48. package/scripts/configure-updater.mjs +4 -3
  49. package/scripts/doctor.mjs +93 -79
  50. package/scripts/i18n.mjs +122 -0
  51. package/scripts/i18n.zsh +66 -0
  52. package/scripts/install-app.sh +3 -2
  53. package/scripts/install-claude-hooks.mjs +10 -9
  54. package/scripts/install-codex-hooks.mjs +7 -6
  55. package/scripts/install-shell-integration.sh +6 -5
  56. package/scripts/locales/zh-Hans.json +366 -0
  57. package/scripts/pet-store.mjs +45 -44
  58. package/scripts/uninstall-app.sh +4 -3
  59. package/scripts/uninstall-integrations.mjs +8 -7
  60. package/scripts/uninstall-shell-integration.sh +8 -7
  61. /package/Resources/{phrases.default.txt → phrases.default.zh-Hans.txt} +0 -0
package/CHANGELOG.md CHANGED
@@ -5,6 +5,23 @@ English | [简体中文](./CHANGELOG.zh-CN.md)
5
5
  This project follows Semantic Versioning. `package.json` is the single source of
6
6
  truth for the version.
7
7
 
8
+ ## [2.2.0] - 2026-10-08
9
+
10
+ First English-language release: the app and CLI are available in English and Simplified Chinese.
11
+
12
+ ### Language
13
+
14
+ - The app is now available in English and Simplified Chinese. A new **Language** submenu offers **System Default**, **English** and **简体中文**; System Default follows macOS's preferred languages and falls back to English.
15
+ - `cc-pets` commands, hooks and CC Bridge messages follow the same choice through `~/.cc-pets/language`; `CC_PETS_LANGUAGE` overrides it per command.
16
+ - Added English default lines. An unedited `~/.cc-pets/speech.txt` switches with the language; lines without Chinese, Japanese or Korean text may now be up to 40 characters.
17
+ - The update dialog reads highlights only from the release notes section whose heading exactly matches the UI language; a missing section produces no highlights instead of falling back to other text.
18
+
19
+ ### Interface
20
+
21
+ - Added English screenshots to the English README; the Simplified Chinese README retains Chinese screenshots. Each README displays its two screenshots side by side.
22
+ - Strengthened Today and Last 7 days headings, adjusted label spacing and trend captions, shortened quota window and risk labels, and removed redundant English trend descriptions.
23
+ - Update dialogs identify the installed version with “Current version”.
24
+
8
25
  ## [2.1.2] - 2026-10-04
9
26
 
10
27
  Update prompts through the pet, `cc-pets doctor` and `cc-pets paths`, plus cleanup fixes.
@@ -4,6 +4,23 @@
4
4
 
5
5
  本项目遵循语义化版本号。版本号以 `package.json` 为唯一来源。
6
6
 
7
+ ## [2.2.0] - 2026-10-08
8
+
9
+ 首个英文语言版本:App 与 CLI 支持英语和简体中文。
10
+
11
+ ### 界面语言
12
+
13
+ - 界面支持英文和简体中文。右键菜单新增「语言」,可选「跟随系统」「English」「简体中文」;跟随系统时取 macOS 首选语言,都不匹配时用英文。
14
+ - `cc-pets` 命令、hooks 和 CC Bridge 消息通过 `~/.cc-pets/language` 跟随同一设置;`CC_PETS_LANGUAGE` 可按次覆盖。
15
+ - 新增英文默认台词。没改过的 `~/.cc-pets/speech.txt` 会随语言切换;不含中日韩文字的句子上限放宽到 40 个字符。
16
+ - 更新对话框只读取标题与界面语言完全匹配的 Release 段落;缺少对应段落时不展示要点,不会退回其他文字。
17
+
18
+ ### 界面
19
+
20
+ - 英文 README 展示英文截图,中文 README 保留中文截图,各自两张图并排展示。
21
+ - Today 和 Last 7 days 标题加粗,标签间距与趋势图说明位置调整,窗口标题和风险提示精简,移除英文趋势区域的重复说明。
22
+ - 更新弹窗以「Current version」标识已安装版本。
23
+
7
24
  ## [2.1.2] - 2026-10-04
8
25
 
9
26
  桌宠提示新版本,新增 `cc-pets doctor` 与 `cc-pets paths`,以及清理相关修复。
package/CONTRIBUTING.md CHANGED
@@ -13,6 +13,60 @@ Thank you for contributing to CC Pets. Before submitting a change:
13
13
  For a substantial feature, open a GitHub Issue before sending a Pull Request so the
14
14
  scope can be agreed on first.
15
15
 
16
+ ## Branch and release policy
17
+
18
+ Develop, test, and prepare preview releases on `publish`. Preview releases must be
19
+ marked as GitHub prereleases and use a prerelease version such as `2.2.0-rc.1`.
20
+ Install preview builds explicitly; the automatic updater accepts stable versions only.
21
+ `main` is reserved for stable releases, including the stable GitHub Release and tag.
22
+ Complete implementation, documentation, screenshots, and validation on `publish`
23
+ before submitting to `main`; repeat integration checks there before a stable release.
24
+ The current release candidate is **v2.2.0**, the first English-language release.
25
+ See [release status](docs/release-status.md) for validation and handoff details.
26
+
27
+ ## Localization
28
+
29
+ UI text is written in English in the source, and that text is the key into every
30
+ other language's table:
31
+
32
+ - Objective-C: wrap user-visible strings in `L(@"…")` (`Sources/CCPets/CCPetsL10n.h`).
33
+ Use `%1$@` / `%2$@` when a translation needs a different argument order.
34
+ - Node.js: use `t("…", { name })` from `scripts/i18n.mjs` with `{name}` placeholders.
35
+ - zsh: use `cc_pets_t "…" name="$value"` from `scripts/i18n.zsh`. The text must be a
36
+ literal; put variables in `{name}` placeholders, never directly in the text.
37
+
38
+ When you add or change an English string, update its key in every table.
39
+ `node scripts/check-l10n.mjs` (also part of `npm test`) reports missing, stale and
40
+ mismatched-placeholder entries for each language.
41
+
42
+ ### Adding a language
43
+
44
+ Adding a language only adds files; no code changes are needed. For a language `xx`
45
+ (use the macOS identifier, such as `ja` or `zh-Hant`):
46
+
47
+ 1. `Resources/xx.lproj/Localizable.strings`: copy the `zh-Hans` table and translate
48
+ each value. Set the two metadata entries: `"Language Name"` (the name shown in the
49
+ **Language** menu, written in that language) and `"Release Notes Section"` (the
50
+ heading of that language's section in GitHub release notes; separate alternatives
51
+ with `|`).
52
+ 2. `Resources/xx.lproj/InfoPlist.strings`: translate `NSAppleEventsUsageDescription`.
53
+ 3. `scripts/locales/xx.json`: translate the CLI table, copied from `zh-Hans.json`.
54
+ 4. Optional: `Resources/phrases.default.xx.txt` with default pet lines, translated from
55
+ `phrases.default.en.txt`. Without it the pet falls back to the English lines.
56
+
57
+ `node scripts/check-l10n.mjs --missing xx` lists the keys still to translate. The app
58
+ discovers languages from the `.lproj` directories, `build.sh` writes
59
+ `CFBundleLocalizations` from them, and `package.json` already includes them by pattern.
60
+
61
+ ### GitHub Release notes
62
+
63
+ Every GitHub Release body must keep each language in its own section. Use the exact
64
+ headings `## English` and `## 简体中文`, followed by that language's top-level bullet
65
+ highlights. The updater reads only the section whose heading exactly matches the
66
+ current UI language; it never falls back to the full body or another language. If the
67
+ matching section is missing, the update dialog shows no highlights and does not guess
68
+ from other text. Keep the English and Simplified Chinese bullets semantically aligned.
69
+
16
70
  ## Asset requirements
17
71
 
18
72
  - Use PNG or WebP with a transparent background.
@@ -12,6 +12,51 @@
12
12
 
13
13
  建议先开一个 GitHub Issue 描述较大的功能改动,达成一致后再提交 Pull Request。
14
14
 
15
+ ## 分支与发布规则
16
+
17
+ 在 `publish` 完成开发、修改、测试和测试版本准备。测试版本必须在 GitHub 标记为
18
+ prerelease,并使用如 `2.2.0-rc.1` 的预发布版本号。`main` 仅负责正式版本,包括正式
19
+ GitHub Release 和 tag。提交到 `main` 前,代码、文档、截图与验证必须全部完成;
20
+ 在 `main` 完成集成验证后才能发布正式版本。
21
+ 测试版本需显式安装,自动更新器只接受正式版本号。
22
+ 当前待发布版本为 **v2.2.0**,作为首个英文语言版本。
23
+ 验证和交接状态见[发布状态](docs/release-status.md)。
24
+
25
+ ## 多语言
26
+
27
+ 界面文案在源码里写英文原文,这段原文就是其他各语言表的 key:
28
+
29
+ - Objective-C:用户可见的字符串包在 `L(@"…")` 里(见 `Sources/CCPets/CCPetsL10n.h`)。
30
+ 译文需要调换参数顺序时用 `%1$@` / `%2$@`。
31
+ - Node.js:用 `scripts/i18n.mjs` 的 `t("…", { name })`,参数写成 `{name}` 占位。
32
+ - zsh:用 `scripts/i18n.zsh` 的 `cc_pets_t "…" name="$value"`。原文必须是字面量,
33
+ 变量一律写成 `{name}` 占位,不能直接拼进原文。
34
+
35
+ 新增或修改英文原文时,要同步更新每张表里的 key。`node scripts/check-l10n.mjs`(`npm test`
36
+ 也会跑)会逐个语言报出缺翻译、多余条目和占位符不一致。
37
+
38
+ ### 新增一种语言
39
+
40
+ 新增语言只需要加文件,不用改代码。以语言 `xx` 为例(用 macOS 的语言标识,如 `ja`、`zh-Hant`):
41
+
42
+ 1. `Resources/xx.lproj/Localizable.strings`:复制 `zh-Hans` 那张表,逐条翻译值。
43
+ 填好两条元信息:`"Language Name"`(「语言」菜单里显示的名字,用该语言自己的写法)和
44
+ `"Release Notes Section"`(GitHub Release 说明里该语言段落的标题,多种写法用 `|` 隔开)。
45
+ 2. `Resources/xx.lproj/InfoPlist.strings`:翻译 `NSAppleEventsUsageDescription`。
46
+ 3. `scripts/locales/xx.json`:复制 `zh-Hans.json`,翻译 CLI 文案。
47
+ 4. 可选:`Resources/phrases.default.xx.txt`,从 `phrases.default.en.txt` 翻译默认台词;
48
+ 没有的话桌宠退回英文台词。
49
+
50
+ `node scripts/check-l10n.mjs --missing xx` 会列出还没翻译的 key。App 按 `.lproj` 目录发现语言,
51
+ `build.sh` 据此生成 `CFBundleLocalizations`,`package.json` 已按通配符包含这些文件。
52
+
53
+ ### GitHub Release 说明
54
+
55
+ 每个 GitHub Release 的正文必须按语言分段。使用完全匹配的标题 `## English` 和
56
+ `## 简体中文`,标题下面写对应语言的顶层列表要点。更新器只读取与当前界面语言标题
57
+ 完全匹配的段落,不会退回全文,也不会读取其他语言;缺少匹配段落时,更新对话框不展示
58
+ 要点,不会从其他文字中猜测。英文和简体中文的要点应保持语义对应。
59
+
15
60
  ## 素材规范
16
61
 
17
62
  - 支持 PNG 或 WebP,背景必须透明。
package/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  <p align="center">
2
- <img src="docs/images/cover.png" alt="CC Pets v2.1.1: Liquid Glass theme and multi-terminal jump-back">
2
+ <img src="docs/images/cover.png" alt="CC Pets v2.2.0: Liquid Glass theme and multi-terminal jump-back">
3
3
  </p>
4
4
 
5
5
  # CC Pets
@@ -11,41 +11,33 @@ desktop app. Launch CC Pets directly, or let it appear automatically when Codex
11
11
  or Claude Code CLI starts. It reads five-hour and weekly quota data from the official
12
12
  Codex App Server interface and Claude Code's official status line input.
13
13
 
14
- > The application UI and the screenshots below are currently in Simplified Chinese.
15
- > English UI localization and English screenshots are planned for a future release.
16
-
17
- ## What's new in v2.1.2
18
-
19
- - **Update prompts from the pet** — CC Pets checks npm for a newer version shortly after
20
- launch. When one is available, the pet shows a clickable speech bubble with up to three
21
- highlights from the GitHub Release, and the bubble waits while an agent is busy. A glass
22
- "↑" badge on the pet and an **Update to x.y.z…** item at the top of the right-click menu
23
- open the update dialog. **Check for Updates…** and **About CC Pets** now live under a new
24
- **Help** submenu.
25
- - **`cc-pets doctor`** — read-only checks of versions, Claude Code and Codex hooks, the
26
- status line, shims and `PATH`, the updater and CC Bridge, with a fix for each problem.
27
- The output shows your home directory as `~`, so you can paste it into an issue.
28
- - **`cc-pets paths`** — lists where settings, pet assets, phrases, caches and runtime
29
- state live, how large each is, and what `clean` and `uninstall --purge` remove
30
- (`--json` for machine-readable output).
31
- - **Fixes** — `cc-pets clean` also clears the pet store manifest cache, and CC Bridge now
32
- tells you when the installed Codex lacks `codex queue`, in which case messages to Codex
33
- wait in its inbox.
14
+ > The app and CLI are available in English and Simplified Chinese (see [Language](#language)).
15
+
16
+ ## What's new in v2.2.0
17
+
18
+ - **First English release** — menus, quota panels, status cards, update dialogs, and CLI
19
+ output now support English and Simplified Chinese. Choose **Language → English**,
20
+ **简体中文**, or **System Default** in the right-click menu.
21
+ - **English panel polish** — stronger summary headings, clearer spacing, shorter window
22
+ titles and risk messages, and a compact explanation of quota and token totals.
23
+ - **Language-specific release highlights** — update dialogs read only the matching
24
+ `English` or `简体中文` section of GitHub Release notes. A missing section leaves the
25
+ highlights empty; content from another language is not substituted.
34
26
 
35
27
  See the [changelog](./CHANGELOG.md) for the full list.
36
28
 
37
29
  ## Screenshots
38
30
 
39
- <p align="center">
40
- <img src="docs/images/liquid-glass-panel.png" width="80%" alt="Quota panel, speech bubble and pet in the Liquid Glass theme, current Simplified Chinese UI">
41
- </p>
31
+ English — v2.2.0 quota panel and Language menu:
42
32
 
43
33
  <p align="center">
44
- <img src="docs/images/liquid-glass-menu.png" width="80%" alt="Right-click menu with the Panel theme submenu, current Simplified Chinese UI">
34
+ <img src="docs/images/liquid-glass-panel.en.png" width="45%" alt="English Agent Usage panel in v2.2.0 with quota, tokens, trends, and system status">
35
+ <img src="docs/images/liquid-glass-menu.en.png" width="45%" alt="English right-click menu with English selected in the Language submenu">
45
36
  </p>
46
37
 
47
38
  ## Features
48
39
 
40
+ - Supports English and Simplified Chinese in the app and CLI, with live UI language switching.
49
41
  - Offers Classic and native Liquid Glass panel themes on macOS 26 and later.
50
42
  - Starts with Codex CLI or Claude Code CLI and closes after the last managed CLI exits.
51
43
  - Shares one pet across multiple simultaneous Codex and Claude sessions.
@@ -223,6 +215,18 @@ panel, status card, and speech bubble: Clear (0%), Light (15%), Standard (25%,
223
215
  default), or Legible (45%). Lower levels
224
216
  look more transparent; higher levels keep text readable over light backgrounds.
225
217
 
218
+ ### Language
219
+
220
+ The **Language** submenu offers **System Default** plus every bundled language,
221
+ currently **English** and **简体中文**. System Default follows the first supported
222
+ entry in macOS's preferred languages and falls back to English. Menus and panels switch right away; system
223
+ buttons in dialogs follow after the next launch. The choice is written to
224
+ `~/.cc-pets/language`, so `cc-pets` commands, hooks, and CC Bridge messages use the
225
+ same language; set `CC_PETS_LANGUAGE=en` or `zh-Hans` to override it for one
226
+ command. If you never edited `~/.cc-pets/speech.txt`, it switches to the default
227
+ lines of the new language; edited lines are left alone. To contribute another
228
+ language, see [Adding a language](./CONTRIBUTING.md#adding-a-language).
229
+
226
230
  The pet switcher scans only built-in assets and `~/.cc-pets/pets/`. It does not
227
231
  scan `~/.petdex/pets/` or `~/.codex/pets/`. To use assets installed by Codex,
228
232
  enable **Import Codex pets** in the app's right-click menu; CC Pets copies valid
@@ -276,7 +280,8 @@ days, and records at most once every 15 minutes.
276
280
  The pet's speech comes from `~/.cc-pets/speech.txt`. Open **Speech → Edit lines…**
277
281
  in the right-click menu to edit, validate, preview, or restore it. Lines are grouped
278
282
  under stable situation tags such as `[idle]`, `[done]`, and `[state_thinking]`.
279
- Each spoken line is limited to 30 characters in the current UI.
283
+ Each line is limited to 30 characters if it contains Chinese, Japanese, or Korean
284
+ text, and to 40 characters otherwise.
280
285
 
281
286
  Supported live placeholders are `{quota5h}`, `{resetTime}`, `{toolName}`,
282
287
  `{sessionMin}`, `{failCount}`, and `{hour}`. A line is skipped if one of its values
package/README.zh-CN.md CHANGED
@@ -1,5 +1,5 @@
1
1
  <p align="center">
2
- <img src="docs/images/cover.png" alt="CC Pets v2.1.1:Liquid Glass 主题与多终端回跳">
2
+ <img src="docs/images/cover.png" alt="CC Pets v2.2.0:Liquid Glass 主题与多终端回跳">
3
3
  </p>
4
4
 
5
5
  # CC Pets
@@ -9,32 +9,29 @@
9
9
  一个不依赖 Codex/Claude 桌面端的 macOS 原生桌宠。直接启动桌面端,或启动 Codex CLI / Claude Code CLI 时自动出现,
10
10
  并通过 Codex App Server 官方接口与 Claude Code 官方 status line 数据读取 5 小时额度、周额度和周重置时间。
11
11
 
12
- ## v2.1.2 新功能
12
+ ## v2.2.0 新功能
13
13
 
14
- - **桌宠提示新版本**:启动后不久自动到 npm 检查新版本。有新版本时,桌宠弹出可点击的气泡,附上
15
- GitHub Release 中最多三条要点;Agent 忙碌时气泡会等待。桌宠上的玻璃「↑」角标和右键菜单顶层的
16
- 「更新到 x.y.z…」都能直接打开更新对话框。「检查更新…」与「关于 CC Pets」收进新的「帮助」子菜单。
17
- - **`cc-pets doctor`**:只读检查版本、Claude Code 与 Codex Hooks、status line、shim 与 `PATH`、
18
- 自动更新和 CC Bridge,每个问题都附修复命令;home 目录显示为 `~`,输出可直接贴进 issue。
19
- - **`cc-pets paths`**:列出偏好、桌宠素材、台词、缓存与运行时状态的位置和大小,并注明 `clean`
20
- 与 `uninstall --purge` 各自删除哪些(`--json` 输出机器可读格式)。
21
- - **修复**:`cc-pets clean` 会一并清理素材清单缓存;当前 Codex 不支持 `codex queue` 时,CC Bridge
22
- 会明确提示,发给 Codex 的消息先进信箱。
14
+ - **首个英文版**:菜单、额度面板、状态卡、更新弹窗和 CLI 输出支持英语与简体中文。
15
+ 右键「语言」可选择「English」「简体中文」或「跟随系统」。
16
+ - **英文面板优化**:汇总标题加粗、标签与数字间距调整、窗口标题和风险提示精简,
17
+ 底部说明清楚区分官方剩余额度与本机 Token 用量。
18
+ - **按语言读取更新要点**:更新弹窗只读取 GitHub Release 中对应的 `English` 或
19
+ `简体中文` 段落;缺少对应段落时不展示要点,不会使用其他语言替代。
23
20
 
24
21
  完整改动见 [更新记录](./CHANGELOG.zh-CN.md)。
25
22
 
26
23
  ## 界面预览
27
24
 
28
- <p align="center">
29
- <img src="docs/images/liquid-glass-panel.png" width="80%" alt="Liquid Glass 主题下的额度面板、说话气泡与桌宠">
30
- </p>
25
+ 简体中文:额度面板与右键菜单。
31
26
 
32
27
  <p align="center">
33
- <img src="docs/images/liquid-glass-menu.png" width="80%" alt="右键菜单中的面板主题子菜单">
28
+ <img src="docs/images/liquid-glass-panel.png" width="45%" alt="Liquid Glass 主题下的中文额度面板">
29
+ <img src="docs/images/liquid-glass-menu.png" width="45%" alt="中文右键菜单与面板主题子菜单">
34
30
  </p>
35
31
 
36
32
  ## 功能
37
33
 
34
+ - App 与 CLI 支持英语和简体中文,界面语言可即时切换
38
35
  - macOS 26 及以上可在经典与原生 Liquid Glass 两种面板主题之间切换
39
36
  - 随 Codex CLI 或 Claude Code CLI 自动启动,无需打开对应桌面版
40
37
  - 多个 Codex/Claude CLI 共用一个桌宠,最后一个 CLI 退出后桌宠自动关闭
@@ -115,6 +112,15 @@ JetBrains IDE、Warp、WezTerm、Ghostty 等在不安装扩展的模式下仅激
115
112
  可在通透(0%)、轻度(15%)、标准(25%,默认)、清晰(45%)之间切换,作用于额度面板、状态卡和
116
113
  说话气泡:档位越低越通透,档位越高在浅色背景上越容易看清。
117
114
 
115
+ ### 界面语言
116
+
117
+ 右键菜单「语言」提供「跟随系统」和所有已打包的语言,目前是「English」「简体中文」。
118
+ 跟随系统时,取 macOS 首选语言里第一个支持的语言,都不支持就用英文。菜单和面板立即切换;对话框里的系统按钮在下次启动后跟上。
119
+ 选择会写入 `~/.cc-pets/language`,`cc-pets` 命令、hooks 和 CC Bridge 消息因此使用同一种语言;
120
+ 单次命令可以用 `CC_PETS_LANGUAGE=en` 或 `zh-Hans` 覆盖。如果从没改过 `~/.cc-pets/speech.txt`,
121
+ 它会换成新语言的默认台词;改过的台词保持不动。想贡献其他语言的翻译,
122
+ 见 [新增一种语言](./CONTRIBUTING.zh-CN.md#新增一种语言)。
123
+
118
124
  右键菜单中的“切换桌宠”只扫描 `~/.cc-pets/pets/`(见 [素材管理](#素材管理))和包内素材,
119
125
  **不会**去读 `~/.petdex/pets/` 和 `~/.codex/pets/`——那两个目录由 PetDex CLI 和 Codex 写入,
120
126
  混在一起就找不到自己装的宠物了。要用 Codex 那边的素材,打开右键菜单里的“导入 Codex
@@ -197,7 +203,7 @@ Agent **正在干活**时(思考、调用工具、等待审批、子 Agent 工
197
203
  ```
198
204
 
199
205
  - `[情境]` 起一节,下面一行一句,直接改字、加行、删行
200
- - 每句 30 字以内,超了那一行会被丢掉
206
+ - 含中日韩文字的句子 30 字以内,纯英文等拉丁文字 40 个字符以内,超了那一行会被丢掉
201
207
  - 写错只丢那一行,不会让整个文件失效
202
208
 
203
209
  可以插入这些实时数据(连花括号一起写):`{quota5h}` `{resetTime}` `{toolName}`
@@ -2,6 +2,8 @@
2
2
  <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
3
  <plist version="1.0">
4
4
  <dict>
5
+ <key>CFBundleDevelopmentRegion</key>
6
+ <string>en</string>
5
7
  <key>CFBundleDisplayName</key>
6
8
  <string>CC Pets</string>
7
9
  <key>CFBundleExecutable</key>
@@ -23,6 +25,6 @@
23
25
  <key>NSHighResolutionCapable</key>
24
26
  <true/>
25
27
  <key>NSAppleEventsUsageDescription</key>
26
- <string>用于在点击 Agent 状态气泡时返回对应的终端标签页。</string>
28
+ <string>Used to switch back to the matching terminal tab when you click the Agent status card.</string>
27
29
  </dict>
28
30
  </plist>
@@ -0,0 +1 @@
1
+ "NSAppleEventsUsageDescription" = "Used to switch back to the matching terminal tab when you click the Agent status card.";
@@ -0,0 +1,182 @@
1
+ # Pet chatter. Changes take effect right after you save.
2
+ # One line per sentence: edit, add or delete lines freely. `#` starts a comment.
3
+ # Keep each line within 40 characters (30 if it contains Chinese/Japanese/Korean).
4
+ # Each section can have many lines; an empty section keeps the pet quiet in that situation.
5
+ # Live data you can put in a line (braces included):
6
+ # {quota5h} 5-hour quota left, e.g. 12%
7
+ # {resetTime} when the quota refills, e.g. 18:30
8
+ # {sessionMin} minutes worked this session
9
+ # {failCount} consecutive failures
10
+ # {toolName} tool in use, e.g. Bash
11
+ # {hour} current hour, e.g. 2
12
+ # A line that uses data is skipped whenever that data isn't available.
13
+
14
+ # ============ When it feels like talking ============
15
+
16
+ [idle] # idle
17
+ Just zoning out.
18
+ I'm here!!!
19
+ Call me anytime.
20
+ Quiet day, huh?
21
+ Just looking around.
22
+ Wanna stretch a bit?
23
+ Nothing to do, nothing to lose.
24
+ Hmm…
25
+
26
+ [done] # task done
27
+ Done. Take a breather.
28
+ That went smoothly.
29
+ Another one down. Nice.
30
+ Wrapped up, {toolName} behaved.
31
+ Okay, what's next?
32
+ Solid.
33
+ All done. Drink some water.
34
+ Clean run.
35
+ Nailed it. I was watching.
36
+
37
+ [fail] # repeated failures
38
+ {failCount} fails in a row. Breathe.
39
+ It's fine, try again.
40
+ {toolName} is being flaky.
41
+ Stuck? Let's look together.
42
+ No rush, one step at a time.
43
+ Red again… deep breath.
44
+ Never seen this one before.
45
+ Failures are data too.
46
+ Maybe try another angle?
47
+
48
+ [wake] # back after a long break
49
+ You're back!
50
+ Long time no see.
51
+ Been waiting for you.
52
+ Got work for us?
53
+ Thought you weren't coming.
54
+ I'm up, I'm up.
55
+ Let's get to it.
56
+ Yo.
57
+
58
+ [late_night] # working late at night
59
+ It's {hour} o'clock already.
60
+ Bedtime, maybe?
61
+ Still coding at this hour…
62
+ It can wait till tomorrow.
63
+ It's late. Take care.
64
+ Code at {hour} a.m. is suspect.
65
+ Late-night code gets rewritten.
66
+ I'm sleepy. You do you.
67
+
68
+ [long_session] # long session
69
+ {sessionMin} minutes straight.
70
+ Get up and walk a bit.
71
+ {sessionMin} min. Rest your eyes.
72
+ You've been sitting too long.
73
+ How about a stretch?
74
+ Time to hydrate.
75
+ Five minutes off won't hurt.
76
+ How's your back?
77
+
78
+ [quota_low] # quota running low
79
+ Only {quota5h} quota left.
80
+ Go easy on it.
81
+ Almost out. Refills at {resetTime}.
82
+ Wait for the refill?
83
+ Quota's low. Easy now.
84
+ {quota5h}… cutting it close.
85
+ A few more runs and it's gone.
86
+ {resetTime} is still a while.
87
+
88
+ # ============ Status lines ============
89
+ # What the pet says while the agent works. Keep at least one line in each.
90
+
91
+ [state_starting] # starting
92
+ I'm up, almost ready.
93
+ Putting my shoes on, one sec.
94
+ Starting work.
95
+ Getting up now.
96
+
97
+ [state_idle] # idle
98
+ I'm ready. Go ahead.
99
+ I'm here, ready to go.
100
+ In position. Your call.
101
+ I'm listening.
102
+
103
+ [state_thinking] # thinking
104
+ Thinking. Give me a moment.
105
+ Don't rush me, gears turning.
106
+ Let me think this through.
107
+ Shh, I'm thinking.
108
+
109
+ [state_tool] # using a tool (when unclear which)
110
+ On it.
111
+ Digging through the toolbox.
112
+ Getting busy.
113
+
114
+ [state_tool_bash] # running a command
115
+ Typing commands.
116
+ Busy in the terminal.
117
+ Leave this command to me.
118
+
119
+ [state_tool_edit] # editing files
120
+ Editing a file. Steady hands.
121
+ Pen to paper.
122
+ Tidying up this file.
123
+
124
+ [state_tool_read] # looking things up
125
+ Reading up.
126
+ Looking for clues.
127
+ Let me take a look…
128
+
129
+ [state_tool_done] # step done
130
+ That step's done.
131
+ One down.
132
+ Holding steady.
133
+
134
+ [state_tool_failed] # tool failed
135
+ I tripped on that step.
136
+ The tool's acting up.
137
+ I need another approach...
138
+
139
+ [state_subagent] # subagent working
140
+ Called in a helper.
141
+ Sent a buddy out.
142
+ Delegated this one.
143
+
144
+ [state_approval] # awaiting approval
145
+ Waiting for your OK.
146
+ Stuck. Check the terminal.
147
+ Your call on this one.
148
+ Not touching it till you say so.
149
+
150
+ [state_auto_review] # auto-reviewing
151
+ Running auto-checks.
152
+ I'll review it, carry on.
153
+ I'll check this round.
154
+
155
+ [state_completed] # task completed
156
+ All done. Break time.
157
+ Clocking out!
158
+ Finished this round.
159
+ That's a wrap.
160
+
161
+ [state_failed] # task failed
162
+ I crashed. Check the terminal.
163
+ Didn't work. Take a look.
164
+ I fell flat this time.
165
+
166
+ [state_notification] # needs attention
167
+ Got something to tell you.
168
+ Look up here.
169
+ Something came up.
170
+
171
+
172
+ # ============ Click reactions ============
173
+
174
+ [click_heart] # happy after a few clicks
175
+ Hehe, more pets please~
176
+ Love it!
177
+ Have a happy day~
178
+
179
+ [click_annoyed] # annoyed after too many clicks
180
+ Okay, okay!
181
+ Stop poking!
182
+ I'm getting mad!
@@ -0,0 +1 @@
1
+ "NSAppleEventsUsageDescription" = "用于在点击 Agent 状态气泡时返回对应的终端标签页。";