cc-pets 2.2.0 → 2.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +25 -0
- package/CHANGELOG.zh-CN.md +25 -0
- package/CONTRIBUTING.md +16 -2
- package/CONTRIBUTING.zh-CN.md +13 -2
- package/README.md +25 -14
- package/README.zh-CN.md +25 -12
- package/Resources/zh-Hans.lproj/Localizable.strings +5 -0
- package/Sources/CCPets/CCPetsAppDelegate+AgentStatus.m +7 -8
- package/Sources/CCPets/CCPetsAppDelegate+Pets.m +1 -1
- package/Sources/CCPets/CCPetsAppDelegate+Private.h +30 -9
- package/Sources/CCPets/CCPetsAppDelegate+Settings.m +59 -4
- package/Sources/CCPets/CCPetsAppDelegate+Speech.m +6 -4
- package/Sources/CCPets/CCPetsAppDelegate+Update.m +71 -47
- package/Sources/CCPets/CCPetsAppDelegate.h +1 -2
- package/Sources/CCPets/CCPetsAppDelegate.m +3 -1
- package/Sources/CCPets/CCPetsImageLoader.h +2 -1
- package/Sources/CCPets/CCPetsImageLoader.m +10 -2
- package/Sources/CCPets/CCPetsPetSize.h +10 -0
- package/Sources/CCPets/CCPetsPetSize.m +21 -0
- package/Sources/CCPets/CCPetsPhrases.h +7 -0
- package/Sources/CCPets/CCPetsPhrases.m +35 -21
- package/Sources/CCPets/CCPetsPhrasesEditor.m +38 -1
- package/Sources/CCPets/MenuChoiceRow.m +3 -0
- package/Sources/CCPets/MenuPetSizeView.h +5 -0
- package/Sources/CCPets/MenuPetSizeView.m +73 -0
- package/Sources/CCPets/PetView.m +54 -21
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,31 @@ 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.2.1] - 2026-10-11
|
|
11
|
+
|
|
12
|
+
### Pet size and rendering
|
|
13
|
+
|
|
14
|
+
- 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.
|
|
15
|
+
- 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.
|
|
16
|
+
- 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.
|
|
17
|
+
|
|
18
|
+
### Pet speech
|
|
19
|
+
|
|
20
|
+
- 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.
|
|
21
|
+
- 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.
|
|
22
|
+
|
|
23
|
+
### Menus
|
|
24
|
+
|
|
25
|
+
- Moved **Frequency** and **Line Source** into separate Chatter submenus and removed the separators from the Chatter menu.
|
|
26
|
+
- 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.
|
|
27
|
+
- Shared choice rows size themselves to their labels so longer English titles fit.
|
|
28
|
+
|
|
29
|
+
### Updates
|
|
30
|
+
|
|
31
|
+
- 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.
|
|
32
|
+
|
|
8
33
|
## [2.2.0] - 2026-10-08
|
|
9
34
|
|
|
10
35
|
First English-language release: the app and CLI are available in English and Simplified Chinese.
|
package/CHANGELOG.zh-CN.md
CHANGED
|
@@ -4,6 +4,31 @@
|
|
|
4
4
|
|
|
5
5
|
本项目遵循语义化版本号。版本号以 `package.json` 为唯一来源。
|
|
6
6
|
|
|
7
|
+
## [Unreleased]
|
|
8
|
+
|
|
9
|
+
## [2.2.1] - 2026-10-11
|
|
10
|
+
|
|
11
|
+
### 宠物大小与渲染
|
|
12
|
+
|
|
13
|
+
- 右键菜单新增「宠物大小」,提供实时调整的 50%~200% 滑动条和「恢复默认」按钮,点击后回到 100%。缩放保持脚底位置不变,并按新尺寸刷新动画帧缓存;大小设置在切换宠物和重启后保留。
|
|
14
|
+
- 宠物小于 100% 时,Hook 状态卡和消息气泡的文字、图标与点击区域同比例缩小;宠物达到或超过 100% 时,状态卡和气泡保持原尺寸。
|
|
15
|
+
- 修复 Retina 屏幕上精灵图模糊:解码时至少保留 2x 分辨率,并适配已连接屏幕的最高倍率。加载尺寸覆盖宠物最大缩放比例,无需降采样时保留原图。
|
|
16
|
+
|
|
17
|
+
### 桌宠台词
|
|
18
|
+
|
|
19
|
+
- 新增「碎碎念 → 台词来源 → 专属台词 / 默认台词」。专属台词按小节优先使用当前宠物词库,缺少的小节沿用通用台词;默认台词只使用可编辑的 `~/.cc-pets/speech.txt`。选择全局生效,立即应用,切换宠物和重启后仍保留;初始选择为专属台词。
|
|
20
|
+
- 修复切换界面语言后台词编辑器中英文混用:窗口标题、按钮、编辑范围标签和情境说明统一刷新,保留未保存的文本及当前情境选择。
|
|
21
|
+
|
|
22
|
+
### 菜单
|
|
23
|
+
|
|
24
|
+
- 「频率」和「台词来源」分别收进碎碎念子菜单,并移除碎碎念菜单内的分割线。
|
|
25
|
+
- 频率、台词来源、点击互动的次数阈值和连击间隔统一使用公共单选组件;鼠标点击后菜单保持展开,勾选立即更新。
|
|
26
|
+
- 公共单选行根据文案自动撑宽,确保较长的英文标题完整显示。
|
|
27
|
+
|
|
28
|
+
### 更新
|
|
29
|
+
|
|
30
|
+
- 更新说明改为读取版本 tag 中已提交的 `docs/release-notes-vX.Y.Z.md`,依次尝试 raw.githubusercontent.com、jsDelivr,最后回退到 GitHub Release API;更新要点继续按界面语言标题精确匹配。
|
|
31
|
+
|
|
7
32
|
## [2.2.0] - 2026-10-08
|
|
8
33
|
|
|
9
34
|
首个英文语言版本: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.
|
|
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
|
|
24
|
+
The latest stable GitHub release is **v2.2.1**, covering pet size, speech sources, and menu fixes.
|
|
25
25
|
See [release status](docs/release-status.md) for validation and handoff details.
|
|
26
26
|
|
|
27
27
|
## Localization
|
|
@@ -67,6 +67,20 @@ current UI language; it never falls back to the full body or another language. I
|
|
|
67
67
|
matching section is missing, the update dialog shows no highlights and does not guess
|
|
68
68
|
from other text. Keep the English and Simplified Chinese bullets semantically aligned.
|
|
69
69
|
|
|
70
|
+
Write the body in `docs/release-notes-vX.Y.Z.md`, commit it before creating the tag,
|
|
71
|
+
and publish with `gh release create vX.Y.Z --notes-file docs/release-notes-vX.Y.Z.md`.
|
|
72
|
+
The updater reads this file from the tag (raw.githubusercontent.com, then jsDelivr)
|
|
73
|
+
and only falls back to the rate-limited GitHub Release API, so editing the Release on
|
|
74
|
+
GitHub afterwards does not change the in-app highlights.
|
|
75
|
+
|
|
76
|
+
For every release, update `package.json`, both READMEs, both changelogs, the cover
|
|
77
|
+
version, and `docs/release-status.md` together. Move shipped changes from
|
|
78
|
+
`Unreleased` into the dated version section and preserve historical entries and
|
|
79
|
+
release notes. Keep exactly three top-level highlights per language, each at most
|
|
80
|
+
50 characters; use prose for additional detail and link to the matching tagged
|
|
81
|
+
changelog. Verify the final body with the app's release-note parser before tagging,
|
|
82
|
+
and publish that committed file without regenerating the body on GitHub.
|
|
83
|
+
|
|
70
84
|
## Asset requirements
|
|
71
85
|
|
|
72
86
|
- Use PNG or WebP with a transparent background.
|
package/CONTRIBUTING.zh-CN.md
CHANGED
|
@@ -15,11 +15,11 @@
|
|
|
15
15
|
## 分支与发布规则
|
|
16
16
|
|
|
17
17
|
在 `publish` 完成开发、修改、测试和测试版本准备。测试版本必须在 GitHub 标记为
|
|
18
|
-
prerelease,并使用如 `2.2.
|
|
18
|
+
prerelease,并使用如 `2.2.1-rc.1` 的预发布版本号。`main` 仅负责正式版本,包括正式
|
|
19
19
|
GitHub Release 和 tag。提交到 `main` 前,代码、文档、截图与验证必须全部完成;
|
|
20
20
|
在 `main` 完成集成验证后才能发布正式版本。
|
|
21
21
|
测试版本需显式安装,自动更新器只接受正式版本号。
|
|
22
|
-
|
|
22
|
+
当前 GitHub 正式版本为 **v2.2.1**,包含宠物大小、台词来源与菜单修复。
|
|
23
23
|
验证和交接状态见[发布状态](docs/release-status.md)。
|
|
24
24
|
|
|
25
25
|
## 多语言
|
|
@@ -57,6 +57,17 @@ GitHub Release 和 tag。提交到 `main` 前,代码、文档、截图与验
|
|
|
57
57
|
完全匹配的段落,不会退回全文,也不会读取其他语言;缺少匹配段落时,更新对话框不展示
|
|
58
58
|
要点,不会从其他文字中猜测。英文和简体中文的要点应保持语义对应。
|
|
59
59
|
|
|
60
|
+
正文写在 `docs/release-notes-vX.Y.Z.md`,在打 tag 之前提交,再用
|
|
61
|
+
`gh release create vX.Y.Z --notes-file docs/release-notes-vX.Y.Z.md` 发布。更新器从 tag
|
|
62
|
+
里读取这个文件(先 raw.githubusercontent.com,再 jsDelivr),最后才退到有限流的
|
|
63
|
+
GitHub Release API,所以发布后在 GitHub 网页上修改 Release 不会改变 App 内的要点。
|
|
64
|
+
|
|
65
|
+
每次发版须同步更新 `package.json`、双语 README、双语 CHANGELOG、封面版本文字和
|
|
66
|
+
`docs/release-status.md`。将已交付改动从 `Unreleased` 归入带日期的版本小节,保留历史
|
|
67
|
+
版本记录及 Release Note。每种语言严格保留 3 条顶层要点,每条不超过 50 字符;补充
|
|
68
|
+
细节使用段落,并链接到对应 tag 的 CHANGELOG。打 tag 前用 App 的真实解析函数校验
|
|
69
|
+
最终正文,发布时直接使用已提交文件,不在 GitHub 重新生成正文。
|
|
70
|
+
|
|
60
71
|
## 素材规范
|
|
61
72
|
|
|
62
73
|
- 支持 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.2.
|
|
2
|
+
<img src="docs/images/cover.png" alt="CC Pets v2.2.1: adjustable pet size and selectable speech sources">
|
|
3
3
|
</p>
|
|
4
4
|
|
|
5
5
|
# CC Pets
|
|
@@ -13,18 +13,17 @@ Codex App Server interface and Claude Code's official status line input.
|
|
|
13
13
|
|
|
14
14
|
> The app and CLI are available in English and Simplified Chinese (see [Language](#language)).
|
|
15
15
|
|
|
16
|
-
## What's new in v2.2.
|
|
16
|
+
## What's new in v2.2.1
|
|
17
17
|
|
|
18
|
-
- **
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
- **
|
|
22
|
-
|
|
23
|
-
- **
|
|
24
|
-
|
|
25
|
-
highlights empty; content from another language is not substituted.
|
|
18
|
+
- **Adjustable pet size** — use **Pet Size** in the right-click menu for live 50%–200%
|
|
19
|
+
scaling. The setting persists, smaller pets get proportionally smaller status cards
|
|
20
|
+
and bubbles, and sprites stay sharper on Retina displays.
|
|
21
|
+
- **Selectable speech sources** — choose **Chatter → Line Source → Pet-specific Lines**
|
|
22
|
+
or **Default Lines**. The choice applies immediately and survives pet changes and restarts.
|
|
23
|
+
- **Menu and editor fixes** — choice menus stay open and update their checkmarks,
|
|
24
|
+
longer English labels fit, and the lines editor refreshes its language without losing edits.
|
|
26
25
|
|
|
27
|
-
See the [changelog](./CHANGELOG.md) for the full list.
|
|
26
|
+
See the [changelog](./CHANGELOG.md) and [release notes](./docs/release-notes-v2.2.1.md) for the full list.
|
|
28
27
|
|
|
29
28
|
## Screenshots
|
|
30
29
|
|
|
@@ -53,6 +52,9 @@ English — v2.2.0 quota panel and Language menu:
|
|
|
53
52
|
- Supports optional local quota history and macOS notifications.
|
|
54
53
|
- Supports third-party CLI agents through a provider event protocol.
|
|
55
54
|
- Includes editable global and per-pet speech.
|
|
55
|
+
- Offers **Chatter → Line Source → Pet-specific Lines / Default Lines**. Pet-specific lines
|
|
56
|
+
override shared sections; default lines use only the editable shared speech file. The
|
|
57
|
+
selection persists across pet changes and restarts, with pet-specific lines selected initially.
|
|
56
58
|
- Includes one original pet and can download compatible assets from PetDex.
|
|
57
59
|
- Uses native AppKit with no Electron runtime.
|
|
58
60
|
|
|
@@ -171,7 +173,10 @@ claude-with-pet # Start the pet and enter Claude Code CLI.
|
|
|
171
173
|
|
|
172
174
|
`package.json` is the single version source. Use `npm version patch`, `minor`, or
|
|
173
175
|
`major` for a future release; npm runs the test suite and the build writes the
|
|
174
|
-
version into the generated app's `Info.plist`.
|
|
176
|
+
version into the generated app's `Info.plist`. Every release also updates both
|
|
177
|
+
READMEs, both changelogs, the cover version, and [release status](./docs/release-status.md).
|
|
178
|
+
Commit the bilingual `docs/release-notes-vX.Y.Z.md` before tagging; follow the
|
|
179
|
+
[Release notes rules](./CONTRIBUTING.md#github-release-notes).
|
|
175
180
|
|
|
176
181
|
## Agent integration
|
|
177
182
|
|
|
@@ -204,7 +209,13 @@ prompts, command text, file contents, or model output.
|
|
|
204
209
|
| Hover on either body side | Directional interaction animation |
|
|
205
210
|
| Click | Playful response animation |
|
|
206
211
|
| Drag left or right | Directional drag animation |
|
|
207
|
-
| Right-click | Pet, notification, Help (update check and About), and exit menu |
|
|
212
|
+
| Right-click | Pet, size, notification, Help (update check and About), and exit menu |
|
|
213
|
+
|
|
214
|
+
**Pet Size** in the right-click menu offers a 50%–200% slider with a live percentage
|
|
215
|
+
and **Reset Size** to return to 100%. The pet scales around its feet, and its size
|
|
216
|
+
persists across pet changes and restarts.
|
|
217
|
+
Hook status cards and speech bubbles shrink with the pet below 100%, including
|
|
218
|
+
their text, icons, and click targets. At 100% and above they keep their original size.
|
|
208
219
|
|
|
209
220
|
The **Panel theme** submenu offers **Classic** and **Liquid Glass**. Classic is the
|
|
210
221
|
default. Changes apply immediately to the quota panel, status card, and speech
|
|
@@ -358,7 +369,7 @@ external assets.
|
|
|
358
369
|
- Local quota history is disabled by default and retains seven days when enabled.
|
|
359
370
|
- Status cards and notifications show only provider, state, and redacted tool category.
|
|
360
371
|
- CC Pets contains no telemetry and uploads no conversations, quotas, credentials, or usage statistics.
|
|
361
|
-
- On launch, and when a CLI reopens the running pet, CC Pets asks the npm registry for the latest version (at most once every 10 minutes per run); only when a newer version exists does it read that version's release notes from the GitHub API. These requests carry no account or usage data.
|
|
372
|
+
- On launch, and when a CLI reopens the running pet, CC Pets asks the npm registry for the latest version (at most once every 10 minutes per run); only when a newer version exists does it read that version's committed release notes from the tag through raw.githubusercontent.com, then jsDelivr, with the GitHub Release API as a fallback. These requests carry no account or usage data.
|
|
362
373
|
- Exiting the pet or running `cc-pets uninstall` leaves no background daemon running.
|
|
363
374
|
- [CC Bridge](./CC_BRIDGE.md) is off by default. When enabled, messages between sessions are stored
|
|
364
375
|
in the current user's temporary directory (owner-only, 24-hour expiry); it is the only feature
|
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.2.
|
|
2
|
+
<img src="docs/images/cover.png" alt="CC Pets v2.2.1:宠物大小调整与台词来源选择">
|
|
3
3
|
</p>
|
|
4
4
|
|
|
5
5
|
# CC Pets
|
|
@@ -9,16 +9,16 @@
|
|
|
9
9
|
一个不依赖 Codex/Claude 桌面端的 macOS 原生桌宠。直接启动桌面端,或启动 Codex CLI / Claude Code CLI 时自动出现,
|
|
10
10
|
并通过 Codex App Server 官方接口与 Claude Code 官方 status line 数据读取 5 小时额度、周额度和周重置时间。
|
|
11
11
|
|
|
12
|
-
## v2.2.
|
|
12
|
+
## v2.2.1 新功能
|
|
13
13
|
|
|
14
|
-
-
|
|
15
|
-
|
|
16
|
-
-
|
|
17
|
-
|
|
18
|
-
-
|
|
19
|
-
|
|
14
|
+
- **宠物大小调整**:右键「宠物大小」可实时缩放至 50%~200%,设置自动保存;
|
|
15
|
+
小尺寸宠物的状态卡与气泡同比例缩小,并修复 Retina 屏幕上的精灵图模糊。
|
|
16
|
+
- **台词来源选择**:「碎碎念 → 台词来源」可选择「专属台词」或「默认台词」,
|
|
17
|
+
立即生效,切换宠物和重启后仍保留。
|
|
18
|
+
- **菜单与编辑器修复**:单选后菜单保持展开、勾选即时更新,长英文标题完整显示;
|
|
19
|
+
台词编辑器切换语言时统一刷新文案,并保留未保存的编辑。
|
|
20
20
|
|
|
21
|
-
完整改动见 [更新记录](./CHANGELOG.zh-CN.md)。
|
|
21
|
+
完整改动见 [更新记录](./CHANGELOG.zh-CN.md) 和 [Release Note](./docs/release-notes-v2.2.1.md)。
|
|
22
22
|
|
|
23
23
|
## 界面预览
|
|
24
24
|
|
|
@@ -106,6 +106,11 @@ JetBrains IDE、Warp、WezTerm、Ghostty 等在不安装扩展的模式下仅激
|
|
|
106
106
|
| 鼠标移开或拖动结束 | 恢复默认待机动画 |
|
|
107
107
|
| 右键桌宠 | 切换桌宠、设置历史/通知、在「帮助」中检查更新或查看关于、退出 |
|
|
108
108
|
|
|
109
|
+
右键菜单「宠物大小」提供 50%~200% 的滑动条,拖动时实时缩放并显示百分比,
|
|
110
|
+
点击「恢复默认」回到 100%。大小会自动保存,切换桌宠或重启后保留;缩放时脚底位置固定。
|
|
111
|
+
Hook 状态卡和消息气泡在宠物小于 100% 时同比例缩小,文字、图标和点击区域一起缩放;
|
|
112
|
+
宠物放大到 100% 以上时,状态卡与气泡保持原尺寸。
|
|
113
|
+
|
|
109
114
|
右键菜单「面板主题」提供「经典」和「Liquid Glass」,默认使用经典样式。
|
|
110
115
|
选择后立即应用于额度面板、状态条和说话气泡,并在重启后保留。Liquid Glass 使用系统原生玻璃,
|
|
111
116
|
仅在 macOS 26 及以上可选;构建原生玻璃支持需要 macOS 26 或更新的 SDK。同一子菜单里的「玻璃压暗」
|
|
@@ -169,7 +174,12 @@ Provider、脱敏状态和通用说明,不提供消息输入,也不会显示
|
|
|
169
174
|
## 碎碎念
|
|
170
175
|
|
|
171
176
|
桌宠会以自己的口吻讲话:Agent 干活时讲的话直接写在状态卡副行上,闲着的时候单独冒气泡。
|
|
172
|
-
|
|
177
|
+
右键菜单「碎碎念」里可以整体开关、调频率、选择台词来源、改台词。
|
|
178
|
+
|
|
179
|
+
「台词来源」里可单选 **专属台词** 或 **默认台词**:专属台词优先使用当前宠物的
|
|
180
|
+
词库,缺少的小节沿用通用词库;默认台词只使用 `~/.cc-pets/speech.txt` 中的通用台词,
|
|
181
|
+
包括你对这份词库的修改。初始选择为专属台词,保持原有行为;选择全局生效,切换宠物和
|
|
182
|
+
重启后仍保留,不会覆盖任何台词文件。
|
|
173
183
|
|
|
174
184
|
### 频率
|
|
175
185
|
|
|
@@ -459,7 +469,10 @@ claude-with-pet
|
|
|
459
469
|
|
|
460
470
|
项目版本以 `package.json` 为唯一来源。发布新版本时执行 `npm version patch`、
|
|
461
471
|
`npm version minor` 或 `npm version major`;npm 会自动运行完整测试,构建过程会将新版本写入
|
|
462
|
-
生成的 App `Info.plist`,无需手动修改 `Resources/Info.plist
|
|
472
|
+
生成的 App `Info.plist`,无需手动修改 `Resources/Info.plist`。每次发版同时更新双语 README、
|
|
473
|
+
双语 CHANGELOG、封面版本文字与[发布状态](./docs/release-status.md)。双语正文
|
|
474
|
+
`docs/release-notes-vX.Y.Z.md` 须先提交再打 tag,遵循
|
|
475
|
+
[Release Note 规则](./CONTRIBUTING.zh-CN.md#github-release-说明)。
|
|
463
476
|
|
|
464
477
|
## 用量数据
|
|
465
478
|
|
|
@@ -645,7 +658,7 @@ PetDex 官方 CLI(`npx petdex install <slug>`)会把素材放在 `~/.petdex/
|
|
|
645
658
|
- 额度历史默认关闭;启用后只在本机保留最近 7 天的剩余比例快照。
|
|
646
659
|
- 状态气泡和通知只显示 Provider、状态及脱敏工具类别,不显示会话正文。
|
|
647
660
|
- 项目不上传会话内容、额度、凭据或使用统计,也不包含遥测服务。
|
|
648
|
-
- 桌宠启动时及 CLI 再次唤起桌宠时会向 npm Registry 查询最新版本号(同一次运行内最多每 10
|
|
661
|
+
- 桌宠启动时及 CLI 再次唤起桌宠时会向 npm Registry 查询最新版本号(同一次运行内最多每 10 分钟一次);仅在有新版本时再读取该版本 tag 中已提交的 Release Note,依次尝试 raw.githubusercontent.com、jsDelivr,最后回退到 GitHub Release API。请求不携带任何账号或使用数据。
|
|
649
662
|
- 右键“退出桌宠”或执行 `cc-pets uninstall` 后,不会继续运行后台守护进程。
|
|
650
663
|
- [CC Bridge](./CC_BRIDGE.zh-CN.md) 默认关闭;开启后,会话之间的消息正文会保存在当前用户的临时目录
|
|
651
664
|
(仅本人可读,24 小时过期),这是本项目唯一会保存正文的功能。
|
|
@@ -251,6 +251,9 @@
|
|
|
251
251
|
"Normal" = "正常";
|
|
252
252
|
"Often" = "较多";
|
|
253
253
|
"Chatty" = "话痨";
|
|
254
|
+
"Line Source" = "台词来源";
|
|
255
|
+
"Pet-specific Lines" = "专属台词";
|
|
256
|
+
"Default Lines" = "默认台词";
|
|
254
257
|
"Edit Lines…" = "编辑台词…";
|
|
255
258
|
"Update to %@…" = "更新到 %@…";
|
|
256
259
|
"Language" = "语言";
|
|
@@ -330,3 +333,5 @@
|
|
|
330
333
|
"ⓘ % = share of official plan quota left; tokens = locally counted usage (input incl. cache reads/writes). They measure different things" = "ⓘ 百分比 = 官方订阅额度的剩余比例;Token = 本机统计的已用量(输入含缓存读写),两者口径不同";
|
|
331
334
|
"Today" = "今日用量";
|
|
332
335
|
"Unknown argument: %@\nRun cc-pets --help for usage." = "未知参数:%@\n运行 cc-pets --help 查看用法。";
|
|
336
|
+
"Pet Size" = "宠物大小";
|
|
337
|
+
"Reset Size" = "恢复默认";
|
|
@@ -597,6 +597,7 @@
|
|
|
597
597
|
}
|
|
598
598
|
// 状态卡:左内边距 20 + 文字 + 间隙 8 + 图标 34 + 右内边距 14。
|
|
599
599
|
- (void)resizeStatusCardToFitText {
|
|
600
|
+
if (!self.statusPanel) return;
|
|
600
601
|
const CGFloat leading = 20, gap = 8, iconWidth = 34, trailing = 14;
|
|
601
602
|
// 副行没内容时收成单行,而不是留一块空白。
|
|
602
603
|
//
|
|
@@ -611,13 +612,9 @@
|
|
|
611
612
|
}
|
|
612
613
|
CGFloat glassWidth = leading + textWidth + gap + iconWidth + trailing;
|
|
613
614
|
glassWidth = fmax(210.0, fmin(glassWidth, 420.0));
|
|
614
|
-
// 高度也要参与早退判断,否则单行/双行之间切换时尺寸不会更新。
|
|
615
|
-
if (fabs(NSWidth(self.statusGlass.frame) - glassWidth) < 0.5 &&
|
|
616
|
-
fabs(NSHeight(self.statusGlass.frame) - height) < 0.5) return;
|
|
617
|
-
|
|
618
615
|
NSSize panelSize = NSMakeSize(glassWidth + 12, height + 12);
|
|
619
|
-
|
|
620
|
-
self.statusPanel
|
|
616
|
+
// 文字未变化时也重新应用比例,滑动条缩放不能被原来的尺寸早退跳过。
|
|
617
|
+
PetResizeBubblePanel(self.statusPanel, panelSize);
|
|
621
618
|
self.statusGlass.frame = NSMakeRect(6, 6, glassWidth, height);
|
|
622
619
|
self.statusGlass.cornerRadius = height / 2.0;
|
|
623
620
|
self.statusShadowView.frame = NSMakeRect(6, 6, glassWidth, height);
|
|
@@ -639,6 +636,7 @@
|
|
|
639
636
|
self.statusIconButton.frame = NSMakeRect(glassWidth - trailing - iconWidth,
|
|
640
637
|
(height - iconWidth) / 2.0, iconWidth, iconWidth);
|
|
641
638
|
self.statusClickButton.frame = NSMakeRect(6, 6, glassWidth - 56, height);
|
|
639
|
+
[self layoutApprovalBadge];
|
|
642
640
|
}
|
|
643
641
|
// 面板底边到"最小那颗圆点底边"的距离。定位要拿它反推面板该放多高,
|
|
644
642
|
// 才能让圆点正好落在宠物头顶而不是悬在空中。
|
|
@@ -647,8 +645,9 @@
|
|
|
647
645
|
NSRect visible = (self.panel.screen ?: NSScreen.mainScreen).visibleFrame;
|
|
648
646
|
NSSize size = self.statusPanel.frame.size;
|
|
649
647
|
CGFloat x = NSMidX(petFrame) - size.width / 2.0;
|
|
650
|
-
CGFloat
|
|
651
|
-
CGFloat
|
|
648
|
+
CGFloat gap = 8 * CCPetsBubbleScalePreference();
|
|
649
|
+
CGFloat aboveY = NSMaxY(petFrame) + gap;
|
|
650
|
+
CGFloat belowY = NSMinY(petFrame) - size.height - gap;
|
|
652
651
|
BOOL aboveFits = aboveY + size.height <= NSMaxY(visible) - 10;
|
|
653
652
|
BOOL belowFits = belowY >= NSMinY(visible) + 10;
|
|
654
653
|
self.statusBubbleAbove = aboveFits || !belowFits;
|
|
@@ -143,7 +143,7 @@
|
|
|
143
143
|
NSDictionary *option = [self petOptionWithID:petID inOptions:options];
|
|
144
144
|
if (!option) return;
|
|
145
145
|
NSInteger spriteRowCount = [option[@"spriteRowCount"] integerValue] ?: 9;
|
|
146
|
-
NSImage *image = LoadPetSpriteImage(option[@"path"],
|
|
146
|
+
NSImage *image = LoadPetSpriteImage(option[@"path"], CCPetsPetDecodeCellSize(), spriteRowCount);
|
|
147
147
|
if (!image) return;
|
|
148
148
|
[self.petView applySheet:image petID:petID rowCount:spriteRowCount];
|
|
149
149
|
PetPhrasesSetCurrentPetID(petID);
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
#import "CCPetsEvents.h"
|
|
8
8
|
#import "CCPetsQuotaHistory.h"
|
|
9
9
|
#import "CCPetsImageLoader.h"
|
|
10
|
+
#import "CCPetsPetSize.h"
|
|
10
11
|
#import "CCPetsPhrases.h"
|
|
11
12
|
#import "CCPetsPhrasesEditor.h"
|
|
12
13
|
#import "CCPetsUsage.h"
|
|
@@ -102,6 +103,22 @@ static inline CGFloat PetMeasuredLabelWidth(NSTextField *label) {
|
|
|
102
103
|
return ceil(label.fittingSize.width) + 2;
|
|
103
104
|
}
|
|
104
105
|
|
|
106
|
+
// 文案、玻璃与按钮仍使用原来的逻辑坐标,只缩小窗口与根视图的 frame。
|
|
107
|
+
// bounds 保留原尺寸,AppKit 会同步转换绘制和命中坐标,避免文字被小外壳裁掉。
|
|
108
|
+
static inline void PetResizeBubblePanel(NSPanel *panel, NSSize logicalSize) {
|
|
109
|
+
if (!panel) return;
|
|
110
|
+
CGFloat scale = CCPetsBubbleScalePreference();
|
|
111
|
+
NSSize size = NSMakeSize(logicalSize.width * scale, logicalSize.height * scale);
|
|
112
|
+
NSView *root = panel.contentView;
|
|
113
|
+
BOOL autoresizes = root.autoresizesSubviews;
|
|
114
|
+
root.autoresizesSubviews = NO;
|
|
115
|
+
[panel setContentSize:size];
|
|
116
|
+
root.frame = NSMakeRect(0, 0, size.width, size.height);
|
|
117
|
+
root.bounds = NSMakeRect(0, 0, logicalSize.width, logicalSize.height);
|
|
118
|
+
root.autoresizesSubviews = autoresizes;
|
|
119
|
+
root.needsDisplay = YES;
|
|
120
|
+
}
|
|
121
|
+
|
|
105
122
|
@interface CCPetsStatusClickButton : NSButton
|
|
106
123
|
@end
|
|
107
124
|
|
|
@@ -128,6 +145,8 @@ static inline CGFloat PetMeasuredLabelWidth(NSTextField *label) {
|
|
|
128
145
|
|
|
129
146
|
// 右键菜单里的各项设置开关
|
|
130
147
|
@interface AppDelegate (Settings)
|
|
148
|
+
- (void)applyPetSizePreference;
|
|
149
|
+
- (void)setPetSizeFromSlider:(NSSlider *)sender;
|
|
131
150
|
- (void)toggleSystemMetric:(NSButton *)sender;
|
|
132
151
|
- (void)setUsageDisplayModeFromControl:(NSButton *)sender;
|
|
133
152
|
- (NSString *)systemMetricKeyForTag:(NSInteger)tag;
|
|
@@ -141,10 +160,11 @@ static inline CGFloat PetMeasuredLabelWidth(NSTextField *label) {
|
|
|
141
160
|
- (void)setGlassDimLevel:(MenuChoiceRowView *)sender;
|
|
142
161
|
- (void)toggleSpeech:(NSButton *)sender;
|
|
143
162
|
- (void)togglePetInteraction:(NSButton *)sender;
|
|
144
|
-
- (void)setPetInteractionHeartThreshold:(
|
|
145
|
-
- (void)setPetInteractionAnnoyedThreshold:(
|
|
146
|
-
- (void)setPetInteractionInterval:(
|
|
147
|
-
- (void)setSpeechFrequency:(
|
|
163
|
+
- (void)setPetInteractionHeartThreshold:(MenuChoiceRowView *)sender;
|
|
164
|
+
- (void)setPetInteractionAnnoyedThreshold:(MenuChoiceRowView *)sender;
|
|
165
|
+
- (void)setPetInteractionInterval:(MenuChoiceRowView *)sender;
|
|
166
|
+
- (void)setSpeechFrequency:(MenuChoiceRowView *)sender;
|
|
167
|
+
- (void)setPhrasesSource:(MenuChoiceRowView *)sender;
|
|
148
168
|
- (void)editPhrasesFile:(id)sender;
|
|
149
169
|
- (void)setLanguagePreferenceFromMenu:(NSMenuItem *)sender;
|
|
150
170
|
- (void)languageDidChange:(NSNotification *)notification;
|
|
@@ -305,16 +325,17 @@ static inline CGFloat PetMeasuredLabelWidth(NSTextField *label) {
|
|
|
305
325
|
- (void)retryUpdate:(NSArray *)context;
|
|
306
326
|
- (void)startUpdateToVersion:(NSString *)version attempt:(NSInteger)attempt;
|
|
307
327
|
- (void)showAboutPanel:(id)sender;
|
|
308
|
-
- (void)fetchLatestReleaseWithCompletion:(void (^)(NSString *version,
|
|
309
|
-
|
|
328
|
+
- (void)fetchLatestReleaseWithCompletion:(void (^)(NSString *version, NSString *notes,
|
|
329
|
+
NSString *errorMessage))completion;
|
|
330
|
+
- (void)fetchReleaseNotesForVersion:(NSString *)version sourceIndex:(NSUInteger)index
|
|
331
|
+
completion:(void (^)(NSString *body))completion;
|
|
310
332
|
- (void)checkForUpdates:(id)sender;
|
|
311
333
|
- (void)showPendingUpdate:(id)sender;
|
|
312
334
|
- (void)silentCheckForUpdate;
|
|
313
|
-
- (void)rememberPendingUpdate:(NSString *)version
|
|
314
|
-
truncated:(BOOL)truncated;
|
|
335
|
+
- (void)rememberPendingUpdate:(NSString *)version notes:(NSString *)notes;
|
|
315
336
|
- (void)refreshUpdateBadge;
|
|
316
337
|
- (void)clearPendingUpdate;
|
|
317
|
-
- (NSView *)updateHighlightsAccessoryView;
|
|
338
|
+
- (NSView *)updateHighlightsAccessoryView:(NSArray<NSString *> *)highlights truncated:(BOOL)truncated;
|
|
318
339
|
- (void)showUpdateDialog;
|
|
319
340
|
- (BOOL)validateMenuItem:(NSMenuItem *)menuItem;
|
|
320
341
|
- (void)applyUpdateBadgeStyle;
|
|
@@ -1,7 +1,38 @@
|
|
|
1
1
|
// 右键菜单里的各项设置开关。
|
|
2
2
|
#import "CCPetsAppDelegate+Private.h"
|
|
3
|
+
#import <math.h>
|
|
3
4
|
|
|
4
5
|
@implementation AppDelegate (Settings)
|
|
6
|
+
- (void)setPetSizeFromSlider:(NSSlider *)sender {
|
|
7
|
+
double scale = round(sender.doubleValue * 100) / 100;
|
|
8
|
+
if (!isfinite(scale)) return;
|
|
9
|
+
scale = MAX(CCPetsPetMinimumScale, MIN(CCPetsPetMaximumScale, scale));
|
|
10
|
+
sender.doubleValue = scale;
|
|
11
|
+
[NSUserDefaults.standardUserDefaults setDouble:scale forKey:CCPetsPetScaleKey];
|
|
12
|
+
[self applyPetSizePreference];
|
|
13
|
+
}
|
|
14
|
+
- (void)applyPetSizePreference {
|
|
15
|
+
if (!self.petView || !self.panel) return;
|
|
16
|
+
CGFloat scale = CCPetsPetScalePreference();
|
|
17
|
+
NSRect oldPet = [self.panel convertRectToScreen:self.petView.frame];
|
|
18
|
+
NSSize petSize = NSMakeSize(140 * scale + 4, 150 * scale);
|
|
19
|
+
NSSize panelSize = NSMakeSize(MAX(230, petSize.width + 86), petSize.height + 20);
|
|
20
|
+
// 脚底中心的屏幕坐标保持不变;透明余量继续留给拖动滞后和呼吸动画。
|
|
21
|
+
NSRect panelFrame = NSMakeRect(NSMidX(oldPet) - panelSize.width / 2,
|
|
22
|
+
NSMinY(oldPet), panelSize.width, panelSize.height);
|
|
23
|
+
[self.panel setFrame:panelFrame display:NO];
|
|
24
|
+
self.petView.frame = NSMakeRect((panelSize.width - petSize.width) / 2,
|
|
25
|
+
0, petSize.width, petSize.height);
|
|
26
|
+
[self.petView displayIfNeeded];
|
|
27
|
+
[self.updateBadgeView setFrameOrigin:NSMakePoint(NSMaxX(self.petView.frame) - 30,
|
|
28
|
+
NSMaxY(self.petView.frame) - 28)];
|
|
29
|
+
// 只更新已创建的气泡;独立消息气泡仍在首次播报时按需创建。
|
|
30
|
+
[self resizeStatusCardToFitText];
|
|
31
|
+
[self resizeSpeechBubbleToFitText];
|
|
32
|
+
[self.statusPanel.contentView displayIfNeeded];
|
|
33
|
+
[self.speechPanel.contentView displayIfNeeded];
|
|
34
|
+
[self petWindowDidMove:nil];
|
|
35
|
+
}
|
|
5
36
|
- (NSString *)systemMetricKeyForTag:(NSInteger)tag {
|
|
6
37
|
if (tag == 1) return SystemCPUEnabledKey;
|
|
7
38
|
if (tag == 2) return SystemTemperatureEnabledKey;
|
|
@@ -135,13 +166,13 @@
|
|
|
135
166
|
[defaults setBool:enabled forKey:PetInteractionEnabledKey];
|
|
136
167
|
sender.state = enabled ? NSControlStateValueOn : NSControlStateValueOff;
|
|
137
168
|
}
|
|
138
|
-
- (void)setPetInteractionHeartThreshold:(
|
|
169
|
+
- (void)setPetInteractionHeartThreshold:(MenuChoiceRowView *)sender {
|
|
139
170
|
NSNumber *value = [sender.representedObject isKindOfClass:NSNumber.class] ?
|
|
140
171
|
sender.representedObject : @3;
|
|
141
172
|
[NSUserDefaults.standardUserDefaults setInteger:MAX((NSInteger)2, value.integerValue)
|
|
142
173
|
forKey:PetInteractionHeartThresholdKey];
|
|
143
174
|
}
|
|
144
|
-
- (void)setPetInteractionAnnoyedThreshold:(
|
|
175
|
+
- (void)setPetInteractionAnnoyedThreshold:(MenuChoiceRowView *)sender {
|
|
145
176
|
NSNumber *value = [sender.representedObject isKindOfClass:NSNumber.class] ?
|
|
146
177
|
sender.representedObject : @10;
|
|
147
178
|
NSInteger heart = MAX((NSInteger)2, [NSUserDefaults.standardUserDefaults
|
|
@@ -149,7 +180,7 @@
|
|
|
149
180
|
[NSUserDefaults.standardUserDefaults setInteger:MAX(heart + 1, value.integerValue)
|
|
150
181
|
forKey:PetInteractionAnnoyedThresholdKey];
|
|
151
182
|
}
|
|
152
|
-
- (void)setPetInteractionInterval:(
|
|
183
|
+
- (void)setPetInteractionInterval:(MenuChoiceRowView *)sender {
|
|
153
184
|
NSNumber *value = [sender.representedObject isKindOfClass:NSNumber.class] ?
|
|
154
185
|
sender.representedObject : @1.2;
|
|
155
186
|
[NSUserDefaults.standardUserDefaults setDouble:MAX(0.4, MIN(3.0, value.doubleValue))
|
|
@@ -157,13 +188,37 @@
|
|
|
157
188
|
}
|
|
158
189
|
// 频率档位。改完立刻生效——四道闸都是现读的,不缓存。
|
|
159
190
|
// 顺手把冷却清掉,否则刚调高档位还要等完上一档的冷却才见效,会让人以为没生效。
|
|
160
|
-
- (void)setSpeechFrequency:(
|
|
191
|
+
- (void)setSpeechFrequency:(MenuChoiceRowView *)sender {
|
|
161
192
|
NSString *value = [sender.representedObject isKindOfClass:NSString.class] ?
|
|
162
193
|
sender.representedObject : PetSpeechFrequencyNormal;
|
|
163
194
|
[NSUserDefaults.standardUserDefaults setObject:value forKey:PetSpeechFrequencyKey];
|
|
164
195
|
self.speechCooldownUntil = 0;
|
|
165
196
|
self.lastIdleSpeechCheck = 0;
|
|
166
197
|
}
|
|
198
|
+
- (void)setPhrasesSource:(MenuChoiceRowView *)sender {
|
|
199
|
+
NSString *source = sender.representedObject;
|
|
200
|
+
if (![@[PetPhrasesSourcePet, PetPhrasesSourceDefault] containsObject:source] ||
|
|
201
|
+
[source isEqualToString:PetPhrasesSource()]) return;
|
|
202
|
+
PetPhrasesSetSource(source);
|
|
203
|
+
NSString *tag = self.lastPetVoiceTag;
|
|
204
|
+
self.lastPetVoiceTag = nil;
|
|
205
|
+
self.lastPetVoiceText = nil;
|
|
206
|
+
// 收起旧来源的碎碎念,状态卡副行也立即换成新来源。
|
|
207
|
+
if (!self.updateBubbleVisible) [self hideSpeechBubble];
|
|
208
|
+
if (self.hasAgentStatus && self.lastStatusState.length > 0) {
|
|
209
|
+
[NSObject cancelPreviousPerformRequestsWithTarget:self
|
|
210
|
+
selector:@selector(restoreStatusDetail) object:nil];
|
|
211
|
+
// 保留当前工具对应的小节,不把执行命令、编辑文件等状态退成通用工具态。
|
|
212
|
+
tag = tag ?: [self petVoiceTagForState:self.lastStatusState tool:@""];
|
|
213
|
+
NSString *text = PetPhraseForTag(tag, [self speechSlots]);
|
|
214
|
+
self.lastPetVoiceTag = tag;
|
|
215
|
+
self.lastPetVoiceText = text;
|
|
216
|
+
self.statusDetailLabel.stringValue = text ?: @"";
|
|
217
|
+
[self resizeStatusCardToFitText];
|
|
218
|
+
[self positionAgentStatus];
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
|
|
167
222
|
// 台词交给内置编辑器,不再 openURL: 丢给"文本编辑"。
|
|
168
223
|
//
|
|
169
224
|
// 换掉的理由是反馈:系统编辑器保存完什么都不会说,小节名拼错、句子超 30 字、槽位
|
|
@@ -189,9 +189,10 @@ NSString *const PetSpeechFrequencyKey = @"CCPetsSpeechFrequency";
|
|
|
189
189
|
NSSize size = self.speechPanel.frame.size;
|
|
190
190
|
CGFloat x = NSMidX(petFrame) - size.width / 2.0;
|
|
191
191
|
// 头顶放不下就翻到脚下,尾巴跟着改朝向长在顶边。
|
|
192
|
-
CGFloat
|
|
192
|
+
CGFloat inset = 6 * CCPetsBubbleScalePreference();
|
|
193
|
+
CGFloat aboveY = NSMaxY(petFrame) - inset;
|
|
193
194
|
BOOL fitsAbove = aboveY + size.height <= NSMaxY(visible) - 10;
|
|
194
|
-
CGFloat y = fitsAbove ? aboveY : NSMinY(petFrame) - size.height +
|
|
195
|
+
CGFloat y = fitsAbove ? aboveY : NSMinY(petFrame) - size.height + inset;
|
|
195
196
|
x = fmax(NSMinX(visible) + 10, fmin(x, NSMaxX(visible) - size.width - 10));
|
|
196
197
|
y = fmax(NSMinY(visible) + 10, fmin(y, NSMaxY(visible) - size.height - 10));
|
|
197
198
|
[self.speechPanel setFrameOrigin:NSMakePoint(x, y)];
|
|
@@ -379,14 +380,15 @@ NSString *const PetSpeechFrequencyKey = @"CCPetsSpeechFrequency";
|
|
|
379
380
|
}
|
|
380
381
|
// 独立气泡:左右各 16 内边距,没有图标。
|
|
381
382
|
- (void)resizeSpeechBubbleToFitText {
|
|
383
|
+
if (!self.speechPanel) return;
|
|
382
384
|
const CGFloat padding = 16;
|
|
383
385
|
CGFloat width = padding * 2 + PetMeasuredLabelWidth(self.speechLabel);
|
|
384
386
|
width = fmax(96.0, fmin(width, 300.0));
|
|
385
387
|
NSSize panelSize = NSMakeSize(width + 12, PetSpeechBodyHeight + 12);
|
|
386
|
-
|
|
387
|
-
self.speechPanel.contentView.frame = NSMakeRect(0, 0, panelSize.width, panelSize.height);
|
|
388
|
+
PetResizeBubblePanel(self.speechPanel, panelSize);
|
|
388
389
|
self.speechGlass.frame = NSMakeRect(6, 6, width, PetSpeechBodyHeight);
|
|
389
390
|
self.speechGlass.cornerRadius = PetSpeechBodyHeight / 2.0;
|
|
390
391
|
self.speechLabel.frame = NSMakeRect(padding, 10, width - padding * 2, 18);
|
|
392
|
+
self.speechClickButton.frame = self.speechPanel.contentView.bounds;
|
|
391
393
|
}
|
|
392
394
|
@end
|