cc-pets 2.2.0 → 2.3.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 (173) hide show
  1. package/CC_BRIDGE.md +5 -2
  2. package/CC_BRIDGE.zh-CN.md +4 -2
  3. package/CHANGELOG.md +85 -0
  4. package/CHANGELOG.zh-CN.md +85 -0
  5. package/CONTRIBUTING.md +28 -11
  6. package/CONTRIBUTING.zh-CN.md +23 -11
  7. package/README.md +127 -27
  8. package/README.zh-CN.md +104 -30
  9. package/Resources/zh-Hans.lproj/Localizable.strings +573 -17
  10. package/Sources/CCPets/{CCPetsAppDelegate+AgentEvents.m → App/CCPetsAppDelegate+AgentEvents.m} +15 -5
  11. package/Sources/CCPets/{CCPetsAppDelegate+AgentStatus.m → App/CCPetsAppDelegate+AgentStatus.m} +89 -31
  12. package/Sources/CCPets/{CCPetsAppDelegate+Bridge.m → App/CCPetsAppDelegate+Bridge.m} +35 -24
  13. package/Sources/CCPets/{CCPetsAppDelegate+Pets.m → App/CCPetsAppDelegate+Pets.m} +18 -4
  14. package/Sources/CCPets/{CCPetsAppDelegate+Private.h → App/CCPetsAppDelegate+Private.h} +90 -21
  15. package/Sources/CCPets/App/CCPetsAppDelegate+Profiles.m +238 -0
  16. package/Sources/CCPets/{CCPetsAppDelegate+Quota.m → App/CCPetsAppDelegate+Quota.m} +47 -32
  17. package/Sources/CCPets/App/CCPetsAppDelegate+Settings.m +269 -0
  18. package/Sources/CCPets/{CCPetsAppDelegate+Speech.m → App/CCPetsAppDelegate+Speech.m} +13 -7
  19. package/Sources/CCPets/{CCPetsAppDelegate+Update.m → App/CCPetsAppDelegate+Update.m} +71 -47
  20. package/Sources/CCPets/App/CCPetsAppDelegate+Workbench.m +139 -0
  21. package/Sources/CCPets/{CCPetsAppDelegate.h → App/CCPetsAppDelegate.h} +16 -2
  22. package/Sources/CCPets/{CCPetsAppDelegate.m → App/CCPetsAppDelegate.m} +110 -12
  23. package/Sources/CCPets/App/CCPetsOpenCommand.h +13 -0
  24. package/Sources/CCPets/App/CCPetsOpenCommand.m +99 -0
  25. package/Sources/CCPets/{main.m → App/main.m} +68 -1
  26. package/Sources/CCPets/{CCPetsBridge.h → Bridge/CCPetsBridge.h} +17 -4
  27. package/Sources/CCPets/{CCPetsBridge.m → Bridge/CCPetsBridge.m} +32 -17
  28. package/Sources/CCPets/Bridge/CCPetsBridgeCLI.h +10 -0
  29. package/Sources/CCPets/Bridge/CCPetsBridgeCLI.m +792 -0
  30. package/Sources/CCPets/Bridge/CCPetsBridgeCore.h +60 -0
  31. package/Sources/CCPets/Bridge/CCPetsBridgeCore.m +558 -0
  32. package/Sources/CCPets/Bridge/CCPetsBridgeSetup.h +24 -0
  33. package/Sources/CCPets/Bridge/CCPetsBridgeSetup.m +501 -0
  34. package/Sources/CCPets/Bridge/CCPetsBridgeStore.h +103 -0
  35. package/Sources/CCPets/Bridge/CCPetsBridgeStore.m +779 -0
  36. package/Sources/CCPets/Integrations/CCPetsCLISupport.h +75 -0
  37. package/Sources/CCPets/Integrations/CCPetsCLISupport.m +342 -0
  38. package/Sources/CCPets/Integrations/CCPetsEvents.h +15 -0
  39. package/Sources/CCPets/{CCPetsEvents.m → Integrations/CCPetsEvents.m} +23 -0
  40. package/Sources/CCPets/Integrations/CCPetsIntegrations.h +51 -0
  41. package/Sources/CCPets/Integrations/CCPetsIntegrations.m +662 -0
  42. package/Sources/CCPets/Integrations/CCPetsProfiles.h +38 -0
  43. package/Sources/CCPets/Integrations/CCPetsProfiles.m +516 -0
  44. package/Sources/CCPets/{CCPetsTerminalFocus.m → Integrations/CCPetsTerminalFocus.m} +42 -12
  45. package/Sources/CCPets/Pet/CCPetsImageLoader.h +5 -0
  46. package/Sources/CCPets/{CCPetsImageLoader.m → Pet/CCPetsImageLoader.m} +10 -2
  47. package/Sources/CCPets/Pet/CCPetsPetSize.h +10 -0
  48. package/Sources/CCPets/Pet/CCPetsPetSize.m +21 -0
  49. package/Sources/CCPets/Pet/CCPetsPetStore.h +12 -0
  50. package/Sources/CCPets/Pet/CCPetsPetStore.m +476 -0
  51. package/Sources/CCPets/{CCPetsPhrases.h → Pet/CCPetsPhrases.h} +18 -2
  52. package/Sources/CCPets/{CCPetsPhrases.m → Pet/CCPetsPhrases.m} +53 -22
  53. package/Sources/CCPets/{CCPetsPhrasesEditor.m → Pet/CCPetsPhrasesEditor.m} +42 -2
  54. package/Sources/CCPets/Pet/PetView+Interaction.m +207 -0
  55. package/Sources/CCPets/Pet/PetView+Menu.m +598 -0
  56. package/Sources/CCPets/Pet/PetView+MicroBehavior.m +234 -0
  57. package/Sources/CCPets/Pet/PetView+Private.h +81 -0
  58. package/Sources/CCPets/{PetView.h → Pet/PetView.h} +3 -5
  59. package/Sources/CCPets/Pet/PetView.m +635 -0
  60. package/Sources/CCPets/Support/CCPetsDoctor.h +25 -0
  61. package/Sources/CCPets/Support/CCPetsDoctor.m +632 -0
  62. package/Sources/CCPets/Support/CCPetsJSON.h +27 -0
  63. package/Sources/CCPets/Support/CCPetsJSON.m +397 -0
  64. package/Sources/CCPets/{CCPetsL10n.h → Support/CCPetsL10n.h} +3 -1
  65. package/Sources/CCPets/{CCPetsL10n.m → Support/CCPetsL10n.m} +30 -1
  66. package/Sources/CCPets/Support/CCPetsPreferences.h +31 -0
  67. package/Sources/CCPets/Support/CCPetsPreferences.m +85 -0
  68. package/Sources/CCPets/UI/CCPetsDiagnosticsPage.h +25 -0
  69. package/Sources/CCPets/UI/CCPetsDiagnosticsPage.m +440 -0
  70. package/Sources/CCPets/UI/CCPetsFormBuilder.h +42 -0
  71. package/Sources/CCPets/UI/CCPetsFormBuilder.m +268 -0
  72. package/Sources/CCPets/{CCPetsGlassView.h → UI/CCPetsGlassView.h} +5 -1
  73. package/Sources/CCPets/{CCPetsGlassView.m → UI/CCPetsGlassView.m} +25 -7
  74. package/Sources/CCPets/UI/CCPetsMainWindow.h +55 -0
  75. package/Sources/CCPets/UI/CCPetsMainWindow.m +730 -0
  76. package/Sources/CCPets/UI/CCPetsSettingsPage.h +62 -0
  77. package/Sources/CCPets/UI/CCPetsSettingsPage.m +917 -0
  78. package/Sources/CCPets/UI/CCPetsUIStyle.h +132 -0
  79. package/Sources/CCPets/UI/CCPetsUIStyle.m +816 -0
  80. package/Sources/CCPets/UI/CCPetsUsageChartView.h +15 -0
  81. package/Sources/CCPets/UI/CCPetsUsageChartView.m +284 -0
  82. package/Sources/CCPets/UI/CCPetsUsagePage.h +32 -0
  83. package/Sources/CCPets/UI/CCPetsUsagePage.m +717 -0
  84. package/Sources/CCPets/UI/CCPetsUsageShared.h +53 -0
  85. package/Sources/CCPets/UI/CCPetsUsageStore.m +120 -0
  86. package/Sources/CCPets/UI/CCPetsUsageWidgets.h +30 -0
  87. package/Sources/CCPets/UI/CCPetsUsageWidgets.m +201 -0
  88. package/Sources/CCPets/UI/CCPetsWorkbench.h +40 -0
  89. package/Sources/CCPets/UI/CCPetsWorkbenchPages.h +13 -0
  90. package/Sources/CCPets/UI/CCPetsWorkbenchPages.m +783 -0
  91. package/Sources/CCPets/{MenuChoiceRow.m → UI/MenuChoiceRow.m} +3 -0
  92. package/Sources/CCPets/UI/MenuPetSizeView.h +5 -0
  93. package/Sources/CCPets/UI/MenuPetSizeView.m +73 -0
  94. package/Sources/CCPets/{MenuToggleSwitch.m → UI/MenuToggleSwitch.m} +1 -0
  95. package/Sources/CCPets/{CCPetsCodexRateLimits.h → Usage/CCPetsCodexRateLimits.h} +1 -0
  96. package/Sources/CCPets/{CCPetsCodexRateLimits.m → Usage/CCPetsCodexRateLimits.m} +10 -3
  97. package/Sources/CCPets/{CCPetsQuotaHistory.h → Usage/CCPetsQuotaHistory.h} +3 -0
  98. package/Sources/CCPets/{CCPetsQuotaHistory.m → Usage/CCPetsQuotaHistory.m} +58 -0
  99. package/Sources/CCPets/Usage/CCPetsUsage+ClaudeReader.m +436 -0
  100. package/Sources/CCPets/Usage/CCPetsUsage+CodexReader.m +392 -0
  101. package/Sources/CCPets/Usage/CCPetsUsage+CodexSessions.m +484 -0
  102. package/Sources/CCPets/Usage/CCPetsUsage+Internal.h +96 -0
  103. package/Sources/CCPets/Usage/CCPetsUsage+Models.m +285 -0
  104. package/Sources/CCPets/Usage/CCPetsUsage+TokenTotals.m +655 -0
  105. package/Sources/CCPets/Usage/CCPetsUsage.h +57 -0
  106. package/Sources/CCPets/Usage/CCPetsUsage.m +225 -0
  107. package/Sources/CCPets/Usage/CCPetsUsageMode.h +10 -0
  108. package/Sources/CCPets/Usage/CCPetsUsageMode.m +163 -0
  109. package/Sources/CCPets/{CCPetsUsageMonitor.h → Usage/CCPetsUsageMonitor.h} +3 -0
  110. package/Sources/CCPets/{CCPetsUsageMonitor.m → Usage/CCPetsUsageMonitor.m} +163 -6
  111. package/Sources/CCPets/Usage/QuotaDashboardView+Primitives.m +328 -0
  112. package/Sources/CCPets/Usage/QuotaDashboardView+Private.h +103 -0
  113. package/Sources/CCPets/Usage/QuotaDashboardView+Rendering.m +616 -0
  114. package/Sources/CCPets/{QuotaDashboardView.h → Usage/QuotaDashboardView.h} +17 -0
  115. package/Sources/CCPets/Usage/QuotaDashboardView.m +587 -0
  116. package/THIRD_PARTY_NOTICES.md +1 -1
  117. package/THIRD_PARTY_NOTICES.zh-CN.md +1 -1
  118. package/bin/cc-pets +8 -6
  119. package/bin/claude-with-pet +10 -2
  120. package/bin/codex-with-pet +13 -5
  121. package/package.json +1 -1
  122. package/scripts/build.sh +7 -3
  123. package/scripts/i18n.zsh +9 -52
  124. package/scripts/install-app.sh +4 -0
  125. package/scripts/install-shell-integration.sh +17 -10
  126. package/scripts/uninstall-shell-integration.sh +6 -1
  127. package/Sources/CCPets/CCPetsAppDelegate+Settings.m +0 -226
  128. package/Sources/CCPets/CCPetsEvents.h +0 -10
  129. package/Sources/CCPets/CCPetsImageLoader.h +0 -4
  130. package/Sources/CCPets/CCPetsUsage.h +0 -36
  131. package/Sources/CCPets/CCPetsUsage.m +0 -2069
  132. package/Sources/CCPets/PetView.m +0 -1806
  133. package/Sources/CCPets/QuotaDashboardView.m +0 -1145
  134. package/scripts/bridge/cli.mjs +0 -237
  135. package/scripts/bridge/core.mjs +0 -228
  136. package/scripts/bridge/hook.mjs +0 -150
  137. package/scripts/bridge/install.mjs +0 -311
  138. package/scripts/bridge/mcp-server.mjs +0 -308
  139. package/scripts/bridge/options.mjs +0 -87
  140. package/scripts/bridge/process.mjs +0 -151
  141. package/scripts/bridge/reservations.mjs +0 -248
  142. package/scripts/bridge/store.mjs +0 -433
  143. package/scripts/bridge/watch.mjs +0 -69
  144. package/scripts/check-l10n.mjs +0 -168
  145. package/scripts/configure-updater.mjs +0 -43
  146. package/scripts/detect-cli.mjs +0 -68
  147. package/scripts/doctor.mjs +0 -470
  148. package/scripts/i18n.mjs +0 -122
  149. package/scripts/install-claude-hooks.mjs +0 -253
  150. package/scripts/install-codex-hooks.mjs +0 -78
  151. package/scripts/integration-markers.mjs +0 -51
  152. package/scripts/locales/zh-Hans.json +0 -366
  153. package/scripts/pet-store.mjs +0 -415
  154. package/scripts/uninstall-integrations.mjs +0 -205
  155. /package/Sources/CCPets/{CCPetsVersion.h → App/CCPetsVersion.h} +0 -0
  156. /package/Sources/CCPets/{CCPetsVersion.m → App/CCPetsVersion.m} +0 -0
  157. /package/Sources/CCPets/{CCPetsTerminalFocus.h → Integrations/CCPetsTerminalFocus.h} +0 -0
  158. /package/Sources/CCPets/{CCPetsPhrasesEditor.h → Pet/CCPetsPhrasesEditor.h} +0 -0
  159. /package/Sources/CCPets/{CCPetsPreviews.h → Pet/CCPetsPreviews.h} +0 -0
  160. /package/Sources/CCPets/{CCPetsPreviews.m → Pet/CCPetsPreviews.m} +0 -0
  161. /package/Sources/CCPets/Resources/{/351/273/230/350/256/244.webp" → ByteMochi.webp} +0 -0
  162. /package/Sources/CCPets/{CCPetsCleanup.h → Support/CCPetsCleanup.h} +0 -0
  163. /package/Sources/CCPets/{CCPetsCleanup.m → Support/CCPetsCleanup.m} +0 -0
  164. /package/Sources/CCPets/{CCPetsPaths.h → Support/CCPetsPaths.h} +0 -0
  165. /package/Sources/CCPets/{CCPetsPaths.m → Support/CCPetsPaths.m} +0 -0
  166. /package/Sources/CCPets/{CCPetsSystemMonitor.h → Support/CCPetsSystemMonitor.h} +0 -0
  167. /package/Sources/CCPets/{CCPetsSystemMonitor.m → Support/CCPetsSystemMonitor.m} +0 -0
  168. /package/Sources/CCPets/{CCPetsGlassMenu.h → UI/CCPetsGlassMenu.h} +0 -0
  169. /package/Sources/CCPets/{CCPetsGlassMenu.m → UI/CCPetsGlassMenu.m} +0 -0
  170. /package/Sources/CCPets/{MenuChoiceRow.h → UI/MenuChoiceRow.h} +0 -0
  171. /package/Sources/CCPets/{MenuHintView.h → UI/MenuHintView.h} +0 -0
  172. /package/Sources/CCPets/{MenuHintView.m → UI/MenuHintView.m} +0 -0
  173. /package/Sources/CCPets/{MenuToggleSwitch.h → UI/MenuToggleSwitch.h} +0 -0
package/CC_BRIDGE.md CHANGED
@@ -59,7 +59,7 @@ Claude picks up changes immediately; Codex needs a session restart (and re-trust
59
59
 
60
60
  Ask in plain language in any session:
61
61
 
62
- > List the other agent sessions on this Mac, then tell codex-my-app-1 that the endpoint is now POST /api/pets.
62
+ > List the other agent sessions on this Mac, then tell codex.my-app.otter that the endpoint is now POST /api/pets.
63
63
 
64
64
  The agent uses these MCP tools:
65
65
 
@@ -75,7 +75,10 @@ The agent uses these MCP tools:
75
75
 
76
76
  ### Session names
77
77
 
78
- Default names look like `<claude|codex>-<project-directory>-<n>`, for example `claude-my-app-1`.
78
+ Default names look like `<account>.<project-directory>.<animal>`, for example `claude.my-app.otter` or
79
+ `claude-x.my-app.panda`. The account part is the name shown on the Multi-Account page (`claude` / `codex` for the
80
+ default accounts), and the animal comes from a list of 100, so online sessions of the same account and project never
81
+ share a name. Names stay within 40 characters; long project directory names are truncated.
79
82
  When several terminals share a directory, give them memorable names:
80
83
 
81
84
  ```bash
@@ -54,7 +54,7 @@ Claude 侧的改动会被热加载;Codex 侧(审批、hooks)需要重启 C
54
54
 
55
55
  在任意一个会话里直接用自然语言:
56
56
 
57
- > 列出本机其他 Agent 会话,然后给 codex-my-app-1 发消息:接口改成了 POST /api/pets,你那边同步一下。
57
+ > 列出本机其他 Agent 会话,然后给 codex.my-app.otter 发消息:接口改成了 POST /api/pets,你那边同步一下。
58
58
 
59
59
  Agent 会调用这些 MCP 工具:
60
60
 
@@ -70,7 +70,9 @@ Agent 会调用这些 MCP 工具:
70
70
 
71
71
  ### 会话名
72
72
 
73
- 默认名字是 `<claude|codex>-<项目目录名>-<序号>`,例如 `claude-my-app-1`。同一目录开多个终端时,
73
+ 默认名字是 `<账号名>.<项目目录名>.<动物>`,例如 `claude.my-app.otter`、`claude-x.my-app.panda`。账号名取多账号页里的名称
74
+ (默认账号就是 `claude` / `codex`),动物从 100 个萌系动物里挑,同账号同项目的在线会话不会重名。总长度不超过 40 个字符,
75
+ 项目目录名过长时会截断。同一目录开多个终端时,
74
76
  可以给它们起好记的名字:
75
77
 
76
78
  ```bash
package/CHANGELOG.md CHANGED
@@ -5,6 +5,91 @@ 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
+ ## [Unreleased]
9
+
10
+ ## [2.3.0] - 2026-10-21
11
+
12
+ ### Installation
13
+
14
+ - Everything CC Pets runs is now native: hook installation and removal, CC Bridge (hooks, watcher, MCP server and `cc-pets bridge`), `cc-pets doctor` / `paths`, `cc-pets pet` and the zsh scripts' translations. Node.js is only needed by npm to install and update the package, and CC Bridge hooks no longer start a Node process on every event.
15
+ - Rewritten `settings.json` / `hooks.json` keep their original key order and formatting, and numeric literals are preserved exactly (large integers no longer lose precision). Uninstalling no longer reformats a config file that had nothing of ours in it.
16
+ - `cc-pets install` re-registers CC Bridge with the native binary; after upgrading, restart running Codex sessions and trust the updated hooks in `/hooks`.
17
+
18
+ ### Multi-Account
19
+
20
+ - Official `~/.claude` and `~/.codex` Homes are detected and integrated automatically, while custom Homes are added explicitly from the Main menu's **Multi-Account** page. Folder names are preserved as account names unless the user renames them.
21
+ - Each provider now has an independent circular quota-card carousel with arrow, page-dot, drag, trackpad and keyboard navigation. Quota history, usage totals, live state and approval state follow the selected account.
22
+ - The Usage page can filter local token history by account and switches to a compact account menu when names or account counts no longer fit in the header.
23
+ - Pet Hooks, usage collection, CC Bridge hooks, permissions and MCP registration are scoped to each Home. Custom Homes added before CC Bridge is enabled are integrated automatically when it is enabled later.
24
+ - Claude and Codex launch wrappers attach the resolved account identity to startup and hook events, so status cards and speech bubbles use the exact account name from the first event.
25
+ - CC Bridge default session names are now `<account>.<project-directory>.<animal>` (for example `claude-x.my-app.otter`), so sessions from different accounts in the same project are easy to tell apart. Already registered sessions keep their names.
26
+ - Claude and Codex accounts now detect API or subscription authentication in the background. Accounts identified as API authentication are fixed to API usage; subscription accounts can still switch between plan quota and API usage. Unknown authentication keeps manual switching available, and missing quota data is not treated as evidence of API authentication. Detection does not retain keys or authentication command output.
27
+ - Account management moved from the **Agent Accounts** submenus (right-click menu and app menu) to a **Multi-Account** page in the Main menu, also reachable from the app menu and `cc-pets open accounts`. It lists Claude and Codex Homes with their paths and integration status (Integrated, Needs repair, Home unavailable); each row's **Manage…** menu offers Repair Integration and Rename, plus Relocate Home and Remove Integration for custom Homes. The status refreshes after account changes, CC Bridge being turned on or off, Diagnostics checks and repairs, and when you return to the app after changing things in a terminal.
28
+ - Usage Display pills in the right-click menu and Settings now apply to each registered account independently, inheriting the previous provider preference until customized. The Settings page updates when accounts are added, removed, renamed or relocated.
29
+
30
+ ### Main menu
31
+
32
+ - Added a regular app window. Open it from the right-click menu (**Main menu**), the app menu or `cc-pets open [page]` (pages: `overview`, `sessions`, `usage`, `pet`, `accounts`, `alerts`, `general`, `diagnostics`; `settings` still works and opens Pet). The Dock icon and menu bar appear only while it is open, and clicking the Dock icon brings a minimized window back; the window is created on open and released on close, and nothing runs while it is closed.
33
+ - The sidebar shows the current pet, animated, with its status, then **Workbench** (Overview, Sessions, Usage, Pet, Multi-Account) and **General** (Alerts, Settings); Diagnostics sits at the bottom with a badge when something needs fixing. The window has its own look: a teal accent, cards on a cool neutral background, status colors used only for status, in light and dark.
34
+ - **Overview** page: the pet and what it is doing, today's total usage with input, output, cached input and requests, a notice when diagnostics found problems, and compact cards for every registered Claude / Codex account, independent of the hover panel's carousel selection. Cards use the hover panel's data and refresh with usage and live-state changes. Plan mode shows 5-hour and weekly quota rings, reset times and weekly pace; API mode shows monthly calls and total tokens, with daily call averages and input/output tokens underneath. Cards form a two-column grid with equal heights across API and plan modes.
35
+ - **Sessions** page: Agent sessions online right now, sessions waiting for approval first, each with **Go to Terminal**; and CC Bridge messages waiting in an inbox or recently delivered. Only who sent what to whom is shown, never the message.
36
+ - **Usage** page: local Claude Code and Codex token usage for the last 7, 30 or 90 days. The same five-cell strip as the overview shows total usage (input + cache write + output + cached input), input, output, cached input with its hit rate, and requests for the chosen source and range. The daily chart stacks models in fixed colors (a color-blind-safe palette; models past the eighth fold into "Other") and switches between total, input, output, cached input and requests; click a model in the legend or the table to see only that model, and hover a bar for that day's per-model numbers and total. The columns are normalised so they never overlap (Codex cached tokens are subtracted from its input). Computed on a background queue from local session logs, with its own caches and a per-day archive that outlives Claude Code's transcript pruning. The hover panel's numbers and caches are unchanged. The first time after upgrading, session summaries are re-read once.
37
+ - **Pet**, **Alerts** and **Settings** pages: every pet setting, split into three short pages (Pet holds the pet picker, size, chatter, click reactions and Codex import; Alerts holds notifications, the status card and system status; Settings holds language, panel appearance and the pet sprites folder), plus finer controls such as click-reaction thresholds. All settings go through one preferences layer, so the desktop pet, the menu and the window stay in sync. Options that rewrite Claude Code / Codex configuration (enabling CC Bridge, auto-approve) remain in the right-click menu.
38
+ - The right-click menu is trimmed to the everyday items: Pets, Pet Size, Show Status Card, Usage Display, Panel Theme, CC Bridge, Help, Main menu and Quit. Import Codex Pets, Notifications, Click Reactions, System Status, Chatter and Language moved to the window's Pet, Alerts and Settings pages.
39
+ - In full screen or when zoomed to fill the screen, the sidebar is 10 pt wider, its content moves 5 pt right, and menu items get more room between icon and title (and between Chinese characters). In full screen the pet card no longer sits against the top edge of the screen.
40
+ - Glass dimming is now continuous (0–45%) with a slider on the Settings page; the right-click menu keeps its four presets and checks the closest one. The quota card scrim follows the value smoothly.
41
+ - The Main menu window has its own System Default / Light / Dark appearance setting, with teal control accents; the pet's panels keep their separate appearance preference.
42
+ - **Diagnostics** page: the same checks as `cc-pets doctor`, problems first with their fix commands and copy buttons, passing checks folded into one line, **Re-check** and **Copy Report**. Registered accounts' Hooks and Claude status line issues now offer **Auto-fix** and **Fix All**. Configuration and affected scripts are backed up before changes, with a manifest of original paths and permissions; checks run again automatically after repair, and the page shows backup locations and any failures. Other issues retain their manual commands. The PATH order check is shown as a hint to run `cc-pets doctor` in a terminal, because the pet's own PATH is not the terminal's.
43
+ - Added `cc-pets doctor --repair-profile <profile-id>` to repair a registered account's Hooks and Claude status line without reinstalling the app or changing shell configuration. Plain `cc-pets doctor` remains read-only.
44
+ - Added `cc-pets open [page]`. If the pet is running it asks it to open the window; otherwise it launches the app and opens the window. Terminals launching Claude Code or Codex never pop the window up.
45
+ - `cc-pets doctor` now also finds the npm package directory when run from the installed app, using a `package-dir` marker that `cc-pets install` leaves in the app data directory. Run `cc-pets install` once after upgrading.
46
+ - Behavior changes: ⌘Q in the lines editor now quits the pet (it did nothing before), and unsaved text in the editor is lost; speech bubbles no longer hide when the app loses focus, matching the pet and status card; chatter frequency accepts only `low`, `normal`, `high` and `chatty`, and any other stored value is normalized to `normal` when written (reading behaves as before).
47
+
48
+ ### Pets
49
+
50
+ - The built-in pet is now named **ByteMochi** (its file was `默认.webp`). Upgrading keeps it selected and moves its pet-specific lines from `builtin-默认.txt` to `builtin-ByteMochi.txt`; an existing `builtin-ByteMochi.txt` is never overwritten.
51
+
52
+ ### Fixes
53
+
54
+ - Fixed clipping in scaled status cards and speech bubbles, including the speech bubble's click bounds.
55
+ - Account-aware terminal focus is preserved, and starting a new session on the same terminal removes stale records left by the previous account instead of leaving a stuck Starting row.
56
+ - CLI messages now fill in placeholders containing underscores; `cc-pets bridge enable` previously printed `{MCP_NAME}` instead of `cc-bridge`.
57
+ - An account without quota data or history no longer falls back to another account's cached data in the hover panel or Overview.
58
+ - On Overview, **Check Diagnostics** now sits after the account name and only appears when that account actually has diagnostic warnings or failures; quota data that hasn't been collected yet no longer triggers it.
59
+ - Repairing, renaming, relocating or removing an account while another account is still being configured now says so, instead of silently doing nothing (Remove previously asked for confirmation and then did nothing).
60
+ - In `cc-pets doctor`, the section shown when no accounts are registered is now titled **Agent profiles** instead of the Main menu page name.
61
+ - Reinstalling or repairing an account now also replaces pet Hooks that point at the executable inside `CC Pets.app` (written when an account was repaired from the app). Previously they were not recognized as ours, so each repair added another copy and every event ran the pet hook several times. `cc-pets doctor` now reports such leftovers as stale; run `cc-pets profile repair --id <profile-id>` (or **Repair Integration** on the Multi-Account page) once to remove them.
62
+ - Adding or relocating an account now validates provider-specific Home files, preventing a Claude Home's `sessions/` directory from being mistaken for a Codex Home and receiving Codex configuration.
63
+ - Monthly token aggregation and its cache now follow each account's effective display mode, so switching an account to API usage refreshes the monthly data instead of reusing a shorter plan-mode window.
64
+ - Usage Display buttons in the right-click menu now align with a shared right margin across account names of different lengths; long names have tooltips, and API accounts' disabled pills have a distinct appearance.
65
+
66
+ ### Development
67
+
68
+ - Grouped native sources into module subdirectories and split the larger pet, usage and quota UI implementations. Build and test scripts discover sources and headers recursively; npm packaging checks cover the new layout.
69
+
70
+ ## [2.2.1] - 2026-10-11
71
+
72
+ ### Pet size and rendering
73
+
74
+ - Added **Pet Size** to the right-click menu with a live 50%–200% slider and **Reset Size** to restore 100%. Scaling keeps the pet's feet in place, refreshes cached animation frames at the new size, and persists across pet changes and restarts.
75
+ - Hook status cards and speech bubbles scale down with the pet below 100%, including text, icons and click targets; at 100% and above they keep their original size.
76
+ - Fix blurry sprites on Retina displays by decoding for at least 2x resolution and the highest connected display scale. The loader accounts for the maximum pet size and retains original images when downsampling is unnecessary.
77
+
78
+ ### Pet speech
79
+
80
+ - Added **Chatter → Line Source → Pet-specific Lines / Default Lines**. Pet-specific lines override shared sections and fall back to shared lines for missing sections; default lines use only the editable `~/.cc-pets/speech.txt`. The global choice applies immediately and persists across pet changes and restarts, with pet-specific lines selected initially.
81
+ - Fix mixed Chinese and English in the lines editor after changing the UI language: window titles, buttons, scope labels and situation descriptions now refresh together, preserving unsaved text and the selected situation.
82
+
83
+ ### Menus
84
+
85
+ - Moved **Frequency** and **Line Source** into separate Chatter submenus and removed the separators from the Chatter menu.
86
+ - Frequency, line source and click-reaction threshold and timing choices now keep the menu open on mouse clicks and update their checkmarks immediately through the shared choice-row component.
87
+ - Shared choice rows size themselves to their labels so longer English titles fit.
88
+
89
+ ### Updates
90
+
91
+ - Read the committed `docs/release-notes-vX.Y.Z.md` from the version tag through raw.githubusercontent.com, then jsDelivr, with the GitHub Release API as a fallback. Release highlights continue to follow the exact UI-language section heading.
92
+
8
93
  ## [2.2.0] - 2026-10-08
9
94
 
10
95
  First English-language release: the app and CLI are available in English and Simplified Chinese.
@@ -4,6 +4,91 @@
4
4
 
5
5
  本项目遵循语义化版本号。版本号以 `package.json` 为唯一来源。
6
6
 
7
+ ## [Unreleased]
8
+
9
+ ## [2.3.0] - 2026-10-21
10
+
11
+ ### 安装
12
+
13
+ - CC Pets 运行时的所有部分都改为原生实现:Hooks 的安装与卸载、CC Bridge(hooks、watcher、MCP server 与 `cc-pets bridge`)、`cc-pets doctor` / `paths`、`cc-pets pet`,以及 zsh 脚本的多语言。Node.js 只剩 npm 安装、升级时需要,CC Bridge 的 hook 也不再每次事件都拉起一个 Node 进程。
14
+ - 回写的 `settings.json` / `hooks.json` 保持原有键顺序与格式,数字按原文保留(大整数不再丢精度);卸载时,里面本来没有我们条目的配置文件不再被重新排版。
15
+ - `cc-pets install` 会用原生程序重新注册 CC Bridge;升级后需重启正在运行的 Codex 会话,并在 `/hooks` 中重新信任更新后的 hooks。
16
+
17
+ ### 多账号
18
+
19
+ - 官方 `~/.claude` 和 `~/.codex` Home 会自动发现并集成;自定义 Home 只能从主菜单的「多账号」页手动添加。除非用户主动重命名,否则文件夹名会原样作为账号名称。
20
+ - 每个 Provider 拥有独立的循环额度卡片轮播,支持箭头、页码圆点、拖动、触控板和键盘切换;额度历史、用量汇总、在线状态与审批状态跟随当前账号。
21
+ - 用量页支持按账号筛选本机 Token 历史;账号数量或名称长度超出页头空间时,会自动切换为紧凑的账号下拉菜单。
22
+ - Pet Hooks、用量采集、CC Bridge Hooks、权限与 MCP 注册均按 Home 隔离。先添加自定义 Home、以后再开启 CC Bridge 时,会自动补齐对应集成。
23
+ - Claude 与 Codex 启动包装器会从第一个事件开始携带解析后的账号身份,因此状态卡和气泡会直接显示准确的账号名称。
24
+ - CC Bridge 默认会话名改为 `<账号名>.<项目目录名>.<动物>`(如 `claude-x.my-app.otter`),多个账号开在同一项目里也能一眼分清;已注册的会话保留原名。
25
+ - Claude 和 Codex 账号会在后台识别 API 或订阅认证。明确识别为 API 的账号固定显示 API 用量;订阅账号仍可切换订阅额度与 API 用量。认证类型不明时保留手动切换,缺少额度数据不作为 API 认证的判断依据。检测不保存密钥或认证命令的输出。
26
+ - 账号管理从右键菜单和应用菜单里的「Agent 账户」子菜单移到主菜单新增的「多账号」页,也可从应用菜单或 `cc-pets open accounts` 打开。页面按 Claude / Codex 列出各 Home 的路径和集成状态(已集成、需要修复、Home 不可用);每行的「管理…」菜单提供修复集成、重命名,自定义 Home 另有重新定位 Home 和移除集成。账号变更、开关 CC Bridge、诊断检查与修复之后,以及在终端改动后回到 App 时,状态都会刷新。
27
+ - 右键菜单和「设置」中的用量展示胶囊改为按已登记账号独立设置;尚未单独设置的账号沿用原有平台偏好。新增、移除、重命名或重新定位账号后,设置页会同步更新。
28
+
29
+ ### 主菜单
30
+
31
+ - 新增普通 App 窗口。可从右键菜单(**主菜单**)、应用菜单或 `cc-pets open [page]` 打开(页面:`overview`、`sessions`、`usage`、`pet`、`accounts`、`alerts`、`general`、`diagnostics`;旧的 `settings` 仍可用,会打开「宠物」页)。Dock 图标和菜单栏只在窗口打开期间出现,窗口最小化后点 Dock 图标可以恢复;窗口打开时才创建、关闭即释放,关着的时候没有任何后台任务。
32
+ - 侧边栏顶部是会动的当前宠物和它的状态,下面分两组:**工作台**(概览、会话、用量、宠物、多账号)和**通用**(提醒、设置);诊断放在最底下,有问题要处理时带角标。窗口有自己的一套视觉:青色强调色、偏冷的中性底色上的卡片,状态色只用来表达状态,深浅色都适配。
33
+ - **概览**页:宠物和它此刻在做什么,今日总用量和输入、输出、缓存输入、请求数,诊断发现问题时的提醒,以及所有已登记 Claude / Codex 账号的简洁卡片,不再只展示悬停面板轮播中选中的账号。卡片与悬停面板使用同一份数据,用量和在线状态变化时同步刷新。订阅模式展示 5 小时和本周的剩余额度环、重置时间与本周节奏;API 模式展示本月调用和 Token 总量,并补充日均调用及输入/输出 Token。卡片按两列排列,API 与订阅卡片统一高度。
34
+ - **会话**页:此刻在线的 Agent 会话,等审批的置顶,每行可「跳到终端」;以及卡在信箱里待投递、最近送达的 CC Bridge 消息。只显示谁发给了谁,不显示正文。
35
+ - **用量**页:本机 Claude Code / Codex 最近 7、30、90 天的 Token 用量。顶部和概览同一套五格指标:所选来源和区间的总用量(输入 + 缓存写 + 输出 + 缓存输入)、输入、输出、缓存输入(附命中率)和请求数。每日柱状图按模型分色堆叠,颜色固定跟着模型走(色盲安全的色板,第 9 个模型起合并为「其他」),可以切换总用量 / 输入 / 输出 / 缓存输入 / 请求;点图例或表格里的模型只看它,鼠标移到柱子上看当天各模型的数值和合计。四栏统一成互不重叠的口径(Codex 的缓存命中已从它的输入里扣除)。在后台队列计算,数据来自本机会话日志,用自己的缓存和按日归档,Claude Code 清理旧转录后历史仍然保留。悬停面板的数字和缓存不受影响。升级后第一次会把会话摘要重读一遍。
36
+ - **宠物**、**提醒**、**设置**三页:桌宠的全部设置拆成三页(宠物页放选宠物、大小、碎碎念、点击互动和导入 Codex 素材;提醒页放系统通知、桌面状态卡和系统状态;设置页放语言、面板外观和素材目录),另有更细的项(比如连击阈值)。所有设置统一走同一层偏好读写,桌面上的宠物、右键菜单和窗口保持同步。会改写 Claude Code / Codex 配置的选项(启用 CC Bridge、免审批)仍留在右键菜单里。
37
+ - 右键菜单精简为最常用的几项:管理桌宠、宠物大小、显示消息气泡、用量展示模式、面板主题、CC Bridge、帮助、主菜单 和退出桌宠。导入 Codex 素材、系统通知、连击互动、系统状态、碎碎念和语言移到主菜单的宠物、提醒、设置页。
38
+ - 全屏或 zoom 铺满屏幕时,侧边栏加宽 10pt、内容右移 5pt,菜单项的图标与文字、中文字与字之间也更宽松;全屏时名片不再贴着屏幕顶边。
39
+ - 玻璃压暗改为 0–45% 连续可调,在「设置」页用滑块调;右键菜单仍是四档,勾选最接近当前值的一档。额度卡片的衬底跟着平滑变化。
40
+ - 主菜单可独立选择跟随系统、浅色或深色外观,控件统一使用青色强调色;桌宠面板继续使用各自的外观偏好。
41
+ - **诊断**页:和 `cc-pets doctor` 同一套检查,要处理的问题置顶并带修复命令和「复制命令」,正常项折叠成一行,另有「重新检查」和「复制报告」。已登记账号的 Hooks 和 Claude status line 问题新增「自动修复」与「全部修复」:修改前备份配置及相关脚本,通过清单记录原路径和权限,完成后自动重新检查,并在页面显示备份位置和失败原因。其他问题仍保留手动修复命令。PATH 顺序那一项在主菜单里只提示去终端运行 `cc-pets doctor`,因为桌宠进程自己的 PATH 不是终端的。
42
+ - 新增 `cc-pets doctor --repair-profile <profile-id>`,仅修复指定已登记账号的 Hooks 和 Claude status line,无需重装 App 或修改 shell 配置。普通 `cc-pets doctor` 仍保持只读。
43
+ - 新增 `cc-pets open [page]`:桌宠在运行时请它开窗,否则启动 App 并开窗。终端里启动 Claude Code / Codex 不会弹出主菜单。
44
+ - 在安装版 App 里运行时,`cc-pets doctor` 也能找到 npm 包目录了:靠 `cc-pets install` 在应用数据目录里留下的 `package-dir` 记号。升级后请运行一次 `cc-pets install`。
45
+ - 行为变化:台词编辑器在前台时 ⌘Q 现在会退出桌宠(以前没有反应),编辑器里未保存的内容会丢失;说话气泡不再随 App 失焦隐藏,与桌宠、状态卡一致;碎碎念频率只接受 `low` / `normal` / `high` / `chatty`,其他值写入时规整为 `normal`(读取效果不变)。
46
+
47
+ ### 宠物
48
+
49
+ - 内置宠物改名为 **ByteMochi**(原文件名 `默认.webp`)。升级后仍保持选中,为它写的专属台词会从 `builtin-默认.txt` 移到 `builtin-ByteMochi.txt`;已存在的 `builtin-ByteMochi.txt` 不会被覆盖。
50
+
51
+ ### 修复
52
+
53
+ - 修复宠物缩放后状态卡与说话气泡的裁剪,并同步说话气泡的点击区域。
54
+ - 保持多账号下的终端聚焦;同一终端启动新会话时会清理前一个账号遗留的记录,避免会话列表残留「正在启动」。
55
+ - CLI 文案中带下划线的占位符现在会被正确替换;此前 `cc-pets bridge enable` 输出的是 `{MCP_NAME}` 而不是 `cc-bridge`。
56
+ - 账号没有额度数据或历史时,悬停面板和概览不再借用其他账号的缓存。
57
+ - 概览中的「查看诊断」移至账号名称后,仅在该账号确实有诊断警告或失败项时显示;暂未采集到额度不再触发提示。
58
+ - 另一个账号仍在适配时,对账号执行修复、重命名、重新定位或移除会给出提示,不再静默无反应(此前移除会先弹确认,确认后却什么也不做)。
59
+ - `cc-pets doctor` 中没有已登记账号时的那一节,标题改为「Agent 配置」,不再沿用主菜单的页面名。
60
+ - 重装或修复账号时,指向 `CC Pets.app` 包内程序的宠物 Hooks(从 App 里修复账号时写入)现在也会被一并替换。此前它们不被识别为自家条目,每修复一次就多一份,每个事件都会重复运行好几次宠物 hook。`cc-pets doctor` 现在会把这类残留标为过期;运行一次 `cc-pets profile repair --id <profile-id>`(或在「多账号」页点「修复集成」)即可清掉。
61
+ - 添加或重新定位账号时,按 Provider 专属文件校验 Home,避免因 Claude Home 也有 `sessions/` 目录而将其误认作 Codex Home、写入 Codex 配置。
62
+ - 月度 Token 聚合及缓存改为跟随每个账号实际生效的展示模式;切换到 API 用量后重新汇总月度数据,不再复用订阅模式较短统计区间的数据。
63
+ - 右键菜单的用量展示按钮统一靠右对齐,不再受账号名称长度影响;长名称可悬停查看,API 账号禁用的胶囊按钮使用单独的视觉状态。
64
+
65
+ ### 开发
66
+
67
+ - 原生源码按模块拆入子目录,并拆分较大的宠物、用量和额度 UI 实现。构建与测试脚本递归发现源码和头文件,npm 打包检查覆盖新的目录结构。
68
+
69
+ ## [2.2.1] - 2026-10-11
70
+
71
+ ### 宠物大小与渲染
72
+
73
+ - 右键菜单新增「宠物大小」,提供实时调整的 50%~200% 滑动条和「恢复默认」按钮,点击后回到 100%。缩放保持脚底位置不变,并按新尺寸刷新动画帧缓存;大小设置在切换宠物和重启后保留。
74
+ - 宠物小于 100% 时,Hook 状态卡和消息气泡的文字、图标与点击区域同比例缩小;宠物达到或超过 100% 时,状态卡和气泡保持原尺寸。
75
+ - 修复 Retina 屏幕上精灵图模糊:解码时至少保留 2x 分辨率,并适配已连接屏幕的最高倍率。加载尺寸覆盖宠物最大缩放比例,无需降采样时保留原图。
76
+
77
+ ### 桌宠台词
78
+
79
+ - 新增「碎碎念 → 台词来源 → 专属台词 / 默认台词」。专属台词按小节优先使用当前宠物词库,缺少的小节沿用通用台词;默认台词只使用可编辑的 `~/.cc-pets/speech.txt`。选择全局生效,立即应用,切换宠物和重启后仍保留;初始选择为专属台词。
80
+ - 修复切换界面语言后台词编辑器中英文混用:窗口标题、按钮、编辑范围标签和情境说明统一刷新,保留未保存的文本及当前情境选择。
81
+
82
+ ### 菜单
83
+
84
+ - 「频率」和「台词来源」分别收进碎碎念子菜单,并移除碎碎念菜单内的分割线。
85
+ - 频率、台词来源、点击互动的次数阈值和连击间隔统一使用公共单选组件;鼠标点击后菜单保持展开,勾选立即更新。
86
+ - 公共单选行根据文案自动撑宽,确保较长的英文标题完整显示。
87
+
88
+ ### 更新
89
+
90
+ - 更新说明改为读取版本 tag 中已提交的 `docs/release-notes-vX.Y.Z.md`,依次尝试 raw.githubusercontent.com、jsDelivr,最后回退到 GitHub Release API;更新要点继续按界面语言标题精确匹配。
91
+
7
92
  ## [2.2.0] - 2026-10-08
8
93
 
9
94
  首个英文语言版本:App 与 CLI 支持英语和简体中文。
package/CONTRIBUTING.md CHANGED
@@ -16,12 +16,12 @@ scope can be agreed on first.
16
16
  ## Branch and release policy
17
17
 
18
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`.
19
+ marked as GitHub prereleases and use a prerelease version such as `2.2.1-rc.1`.
20
20
  Install preview builds explicitly; the automatic updater accepts stable versions only.
21
21
  `main` is reserved for stable releases, including the stable GitHub Release and tag.
22
22
  Complete implementation, documentation, screenshots, and validation on `publish`
23
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.
24
+ The latest stable GitHub release is **v2.3.0**, covering the Main menu, multiple accounts, token usage by model, and the native runtime.
25
25
  See [release status](docs/release-status.md) for validation and handoff details.
26
26
 
27
27
  ## Localization
@@ -29,14 +29,18 @@ See [release status](docs/release-status.md) for validation and handoff details.
29
29
  UI text is written in English in the source, and that text is the key into every
30
30
  other language's table:
31
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.
32
+ - Objective-C: wrap user-visible strings in `L(@"…")` (`Sources/CCPets/Support/CCPetsL10n.h`).
33
+ Use `%1$@` / `%2$@` when a translation needs a different argument order. Command-line
34
+ output can instead use `{name}` placeholders filled by `CCPetsInterpolate(L(@"…"), @{…})`.
35
+ - zsh: use `cc_pets_t "…" name="$value"` from `scripts/i18n.zsh`, which looks the text up
36
+ through the native `cc-pets --localize`. The text must be a literal; put variables in
37
+ `{name}` placeholders, never directly in the text.
38
+
39
+ The app, the command-line tools and the zsh scripts share one table per language:
40
+ `Resources/<language>.lproj/Localizable.strings`.
37
41
 
38
42
  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
43
+ `node tests/check-l10n.mjs` (also part of `npm test`) reports missing, stale and
40
44
  mismatched-placeholder entries for each language.
41
45
 
42
46
  ### Adding a language
@@ -50,11 +54,10 @@ Adding a language only adds files; no code changes are needed. For a language `x
50
54
  heading of that language's section in GitHub release notes; separate alternatives
51
55
  with `|`).
52
56
  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
57
+ 3. Optional: `Resources/phrases.default.xx.txt` with default pet lines, translated from
55
58
  `phrases.default.en.txt`. Without it the pet falls back to the English lines.
56
59
 
57
- `node scripts/check-l10n.mjs --missing xx` lists the keys still to translate. The app
60
+ `node tests/check-l10n.mjs --missing xx` lists the keys still to translate. The app
58
61
  discovers languages from the `.lproj` directories, `build.sh` writes
59
62
  `CFBundleLocalizations` from them, and `package.json` already includes them by pattern.
60
63
 
@@ -67,6 +70,20 @@ current UI language; it never falls back to the full body or another language. I
67
70
  matching section is missing, the update dialog shows no highlights and does not guess
68
71
  from other text. Keep the English and Simplified Chinese bullets semantically aligned.
69
72
 
73
+ Write the body in `docs/release-notes-vX.Y.Z.md`, commit it before creating the tag,
74
+ and publish with `gh release create vX.Y.Z --notes-file docs/release-notes-vX.Y.Z.md`.
75
+ The updater reads this file from the tag (raw.githubusercontent.com, then jsDelivr)
76
+ and only falls back to the rate-limited GitHub Release API, so editing the Release on
77
+ GitHub afterwards does not change the in-app highlights.
78
+
79
+ For every release, update `package.json`, both READMEs, both changelogs, the cover
80
+ version, and `docs/release-status.md` together. Move shipped changes from
81
+ `Unreleased` into the dated version section and preserve historical entries and
82
+ release notes. Keep exactly three top-level highlights per language, each at most
83
+ 50 characters; use prose for additional detail and link to the matching tagged
84
+ changelog. Verify the final body with the app's release-note parser before tagging,
85
+ and publish that committed file without regenerating the body on GitHub.
86
+
70
87
  ## Asset requirements
71
88
 
72
89
  - Use PNG or WebP with a transparent background.
@@ -15,24 +15,26 @@
15
15
  ## 分支与发布规则
16
16
 
17
17
  在 `publish` 完成开发、修改、测试和测试版本准备。测试版本必须在 GitHub 标记为
18
- prerelease,并使用如 `2.2.0-rc.1` 的预发布版本号。`main` 仅负责正式版本,包括正式
18
+ prerelease,并使用如 `2.2.1-rc.1` 的预发布版本号。`main` 仅负责正式版本,包括正式
19
19
  GitHub Release 和 tag。提交到 `main` 前,代码、文档、截图与验证必须全部完成;
20
20
  在 `main` 完成集成验证后才能发布正式版本。
21
21
  测试版本需显式安装,自动更新器只接受正式版本号。
22
- 当前待发布版本为 **v2.2.0**,作为首个英文语言版本。
22
+ 当前 GitHub 正式版本为 **v2.3.0**,包含主菜单、多账号、按模型统计 Token 用量与原生运行时。
23
23
  验证和交接状态见[发布状态](docs/release-status.md)。
24
24
 
25
25
  ## 多语言
26
26
 
27
27
  界面文案在源码里写英文原文,这段原文就是其他各语言表的 key:
28
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}` 占位,不能直接拼进原文。
29
+ - Objective-C:用户可见的字符串包在 `L(@"…")` 里(见 `Sources/CCPets/Support/CCPetsL10n.h`)。
30
+ 译文需要调换参数顺序时用 `%1$@` / `%2$@`;命令行输出也可以写 `{name}` 占位,
31
+ 用 `CCPetsInterpolate(L(@"…"), @{…})` 填参数。
32
+ - zsh:用 `scripts/i18n.zsh` 的 `cc_pets_t "…" name="$value"`,查表交给原生的
33
+ `cc-pets --localize`。原文必须是字面量,变量一律写成 `{name}` 占位,不能直接拼进原文。
34
34
 
35
- 新增或修改英文原文时,要同步更新每张表里的 key。`node scripts/check-l10n.mjs`(`npm test`
35
+ App、命令行工具和 zsh 脚本共用每种语言的一张表:`Resources/<语言>.lproj/Localizable.strings`。
36
+
37
+ 新增或修改英文原文时,要同步更新每张表里的 key。`node tests/check-l10n.mjs`(`npm test`
36
38
  也会跑)会逐个语言报出缺翻译、多余条目和占位符不一致。
37
39
 
38
40
  ### 新增一种语言
@@ -43,11 +45,10 @@ GitHub Release 和 tag。提交到 `main` 前,代码、文档、截图与验
43
45
  填好两条元信息:`"Language Name"`(「语言」菜单里显示的名字,用该语言自己的写法)和
44
46
  `"Release Notes Section"`(GitHub Release 说明里该语言段落的标题,多种写法用 `|` 隔开)。
45
47
  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
+ 3. 可选:`Resources/phrases.default.xx.txt`,从 `phrases.default.en.txt` 翻译默认台词;
48
49
  没有的话桌宠退回英文台词。
49
50
 
50
- `node scripts/check-l10n.mjs --missing xx` 会列出还没翻译的 key。App 按 `.lproj` 目录发现语言,
51
+ `node tests/check-l10n.mjs --missing xx` 会列出还没翻译的 key。App 按 `.lproj` 目录发现语言,
51
52
  `build.sh` 据此生成 `CFBundleLocalizations`,`package.json` 已按通配符包含这些文件。
52
53
 
53
54
  ### GitHub Release 说明
@@ -57,6 +58,17 @@ GitHub Release 和 tag。提交到 `main` 前,代码、文档、截图与验
57
58
  完全匹配的段落,不会退回全文,也不会读取其他语言;缺少匹配段落时,更新对话框不展示
58
59
  要点,不会从其他文字中猜测。英文和简体中文的要点应保持语义对应。
59
60
 
61
+ 正文写在 `docs/release-notes-vX.Y.Z.md`,在打 tag 之前提交,再用
62
+ `gh release create vX.Y.Z --notes-file docs/release-notes-vX.Y.Z.md` 发布。更新器从 tag
63
+ 里读取这个文件(先 raw.githubusercontent.com,再 jsDelivr),最后才退到有限流的
64
+ GitHub Release API,所以发布后在 GitHub 网页上修改 Release 不会改变 App 内的要点。
65
+
66
+ 每次发版须同步更新 `package.json`、双语 README、双语 CHANGELOG、封面版本文字和
67
+ `docs/release-status.md`。将已交付改动从 `Unreleased` 归入带日期的版本小节,保留历史
68
+ 版本记录及 Release Note。每种语言严格保留 3 条顶层要点,每条不超过 50 字符;补充
69
+ 细节使用段落,并链接到对应 tag 的 CHANGELOG。打 tag 前用 App 的真实解析函数校验
70
+ 最终正文,发布时直接使用已提交文件,不在 GitHub 重新生成正文。
71
+
60
72
  ## 素材规范
61
73
 
62
74
  - 支持 PNG 或 WebP,背景必须透明。