dsh-plugin-maoxuan-pet 0.0.0-stage → 0.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 +61 -0
- package/LICENSE +37 -0
- package/NOTICE +29 -0
- package/README.en.md +94 -0
- package/README.md +195 -2
- package/assets/PROVENANCE.md +93 -0
- package/assets/icon-256.png +0 -0
- package/assets/icon.svg +45 -0
- package/assets/pet-blink.png +0 -0
- package/assets/pet-idle.png +0 -0
- package/assets/pet-read.png +0 -0
- package/assets/pet-talk.png +0 -0
- package/client.js +496 -0
- package/cordis.patch.yml +86 -0
- package/corpus/.catalog.json +2634 -0
- package/corpus/README.md +122 -0
- package/corpus/articles/bi-xu-zhu-yi-jing-ji-gong-zuo.md +35 -0
- package/corpus/articles/dang-wei-hui-de-gong-zuo-fang-fa.md +39 -0
- package/corpus/articles/fan-dui-ben-ben-zhu-yi.md +129 -0
- package/corpus/articles/fan-dui-dang-ba-gu.md +105 -0
- package/corpus/articles/fan-dui-zi-you-zhu-yi.md +57 -0
- package/corpus/articles/gai-zao-wo-men-de-xue-xi.md +75 -0
- package/corpus/articles/guan-xin-qun-zhong-sheng-huo-zhu-yi-gong-zuo-fang-fa.md +39 -0
- package/corpus/articles/guan-yu-jiu-zheng-dang-nei-de-cuo-wu-si-xiang.md +155 -0
- package/corpus/articles/guan-yu-ling-dao-fang-fa-de-ruo-gan-wen-ti.md +33 -0
- package/corpus/articles/guan-yu-zheng-que-chu-li-ren-min-nei-bu-mao-dun-de-wen-ti.md +183 -0
- package/corpus/articles/hu-nan-nong-min-yun-dong-kao-cha-bao-gao.md +207 -0
- package/corpus/articles/ji-nian-bai-qiu-en.md +23 -0
- package/corpus/articles/jiang-ge-ming-jin-xing-dao-di.md +43 -0
- package/corpus/articles/kang-ri-zhan-zheng-sheng-li-hou-de-shi-ju-he-wo-men-de-fang-zhen.md +51 -0
- package/corpus/articles/lun-chi-jiu-zhan.md +337 -0
- package/corpus/articles/lun-lian-he-zheng-fu.md +523 -0
- package/corpus/articles/lun-ren-min-min-zhu-zhuan-zheng.md +89 -0
- package/corpus/articles/lun-shi-da-guan-xi.md +195 -0
- package/corpus/articles/mao-dun-lun.md +251 -0
- package/corpus/articles/mei-guo-ji-zhe-an-na-liu-yi-si-si-te-lang-de-tan-hua.md +59 -0
- package/corpus/articles/mu-qian-xing-shi-he-wo-men-de-ren-wu.md +47 -0
- package/corpus/articles/nong-cun-diao-cha-de-xu-yan-he-ba.md +35 -0
- package/corpus/articles/qing-nian-yun-dong-de-fang-xiang.md +31 -0
- package/corpus/articles/shi-jian-lun.md +69 -0
- package/corpus/articles/wei-ren-min-fu-wu.md +25 -0
- package/corpus/articles/wu-si-yun-dong.md +25 -0
- package/corpus/articles/xing-xing-zhi-huo-ke-yi-liao-yuan.md +51 -0
- package/corpus/articles/yu-gong-yi-shan.md +27 -0
- package/corpus/articles/zhan-zheng-he-zhan-lue-wen-ti.md +93 -0
- package/corpus/articles/zheng-dun-dang-de-zuo-feng.md +105 -0
- package/corpus/articles/zhong-guo-de-hong-se-zheng-quan-wei-shi-me-neng-gou-cun-zai.md +45 -0
- package/corpus/articles/zhong-guo-ge-ming-zhan-zheng-de-zhan-lue-wen-ti.md +513 -0
- package/corpus/articles/zhong-guo-she-hui-ge-jie-ji-de-fen-xi.md +33 -0
- package/corpus/index.json +606 -0
- package/docs/API-CONTRACT.md +212 -0
- package/docs/CONTENT-FRAMEWORK.md +91 -0
- package/docs/INSTALL.md +105 -0
- package/docs/RELEASE.md +109 -0
- package/docs/screenshot-hero.png +0 -0
- package/index.js +1078 -0
- package/package.json +80 -4
- package/skill/maoxuan-vademecum/SKILL.md +88 -0
- package/tools/audit-corpus-coverage.mjs +63 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# CHANGELOG
|
|
2
|
+
|
|
3
|
+
## 0.2.1 — 2026-11-01
|
|
4
|
+
|
|
5
|
+
上架插件市场后的首个维护版:图标重做 + 整包瘦身 + 打包门禁补强。
|
|
6
|
+
|
|
7
|
+
### 图标
|
|
8
|
+
- 包内 `assets/icon.svg` 换成「红皮书」造型:米白底、深红书壳、烫金五角星与书名条;按插件面板卡片实际 36px 校过,缩到 36px 仍能读成一本红皮书。
|
|
9
|
+
- 新增 `assets/icon-256.png`(256×256 RGBA,17 KB),给 [awesome-dsh-plugin](https://github.com/awesome-dsh-plugin/awesome-dsh-plugin) 条目的 `icon:` 用——市场只收 GitHub 托管位图,不收 SVG。
|
|
10
|
+
|
|
11
|
+
### 体积
|
|
12
|
+
- 四帧立绘 640×1348 → 256×539(UI 展示高 132px,2x 屏幕足够):4 张合计 **2.96 MB → 603 KB**。
|
|
13
|
+
- `npm pack` 整包 **4.2 MB → 约 1.2 MB**(59 files),安装与首屏都更快;README / 市场条目用的大图 `docs/screenshot-hero.png` 保留。
|
|
14
|
+
|
|
15
|
+
### 打包与发布门禁
|
|
16
|
+
- `scripts/audit-corpus-coverage.mjs` 迁到 `tools/`:`scripts/` 是开发脚本,不该进 npm 包;全局开源契约检查此前因此 1 项 FAIL,现在是 0 FAIL / 1 WARN(WARN 已由下一条解决)。
|
|
17
|
+
- 新增 `prepublishOnly`:发布前自动跑 `verify/smoke.mjs` + `verify/contract.mjs`,防手滑发坏版本。
|
|
18
|
+
- `scripts/post-publish-check.mjs`:市场索引有 3.3 MB,超时从 60s 提到 180s(可用 `MARKET_TIMEOUT_MS` 覆盖),慢网下 `--strict` 不再误红。
|
|
19
|
+
- 仓库根新增 `screenshots.json`(`["docs/screenshot-hero.png"]`),喂给 dsh-market 详情页的 AppStore 式截图;以后换图只需往本仓 push,不用再来提 PR。
|
|
20
|
+
|
|
21
|
+
### 文档
|
|
22
|
+
- 新增英文 README(`README.en.md`),中文 README 顶部加英文入口。
|
|
23
|
+
- README 的资产尺寸、审计脚本路径同步更新;`assets/PROVENANCE.md` 记录交付尺寸与图标改版。
|
|
24
|
+
|
|
25
|
+
## 0.2.0 — 2026-11-01
|
|
26
|
+
|
|
27
|
+
首个公开版本。
|
|
28
|
+
|
|
29
|
+
### 宠物与气泡
|
|
30
|
+
- 悬浮宠物「鲸鱼娘·小毛」:4 帧立绘(idle / talk / blink / read),Web `shell.overlay` 渲染,可拖拽、位置本地记忆。
|
|
31
|
+
- 红皮书气泡:深红封面 + 烫金书脊 + 米白内文;卡片绝对定位在宠物左侧,开合不移动宠物(宠物贴左边缘时自动翻到右侧)。
|
|
32
|
+
- 打开即已读:卡片显示的那一刻才标已读,右上角未读数随之消失;正在读的那条会被钉住,不会被新数据替换。
|
|
33
|
+
- 全部已读后仍停在上一次产出,`‹ ›` 可往回翻历史。
|
|
34
|
+
- 定时生成的新气泡自动弹出;手动关闭后不会自己重开。
|
|
35
|
+
- `收起` / `再督促` 为纯文字按钮;滚动条为烫金滑块 + 深红轨道。
|
|
36
|
+
|
|
37
|
+
### 内容
|
|
38
|
+
- 单条气泡 = 引文 + 一句督促 + 启示,**合计 ≤200 字**(`fitLesson` 保证)。
|
|
39
|
+
- 三种取材模板轮转:`quote` 金句 / `excerpt` 文章节选(逐字整句)/ `summary` 小毛概括;游标 `templateCursor` 落盘,不因历史条数封顶而卡住。
|
|
40
|
+
- 启示落点六选一:客户 / 项目 / 组织 / 现金流 / 决策 / 自律;「人事」已按用户裁决改名为「组织」,旧状态文件读取时自动迁移。
|
|
41
|
+
- 反编造:`quote`/`excerpt` 必须逐字命中语料全文(`isVerbatim`,去空白兜底),否则降级为 `summary`;`summary` 永不回退成篇名。
|
|
42
|
+
- 模型复述原文的 `pua` 会被识别(≥8 字公共串)并整条丢弃。
|
|
43
|
+
- 无凭据 / 超时 / 非 JSON 时降级为本地摘录,UI 在页脚标注「离线摘录」,不冒充模型生成。
|
|
44
|
+
|
|
45
|
+
### Host
|
|
46
|
+
- 5 条同源路由:`state` / `generate` / `dismiss` / `asset` / `corpus`;状态文件原子写(`.tmp` + `rename`)。
|
|
47
|
+
- 每小时生成一次,支持 `quietHours`、`everySeconds`、`maxBubbles`、`headless` 开关与子进程超时;并发手动触发时同步抢占 in-flight 位。
|
|
48
|
+
- 运行时把 `corpus/` 注册为 `maoxuan-vademecum` skill,preset `maoxuan-pet`(毛选创业参谋)= persona + skill + 工具。
|
|
49
|
+
|
|
50
|
+
### 语料与素材
|
|
51
|
+
- 33 篇毛选全文(中文马克思主义文库公开电子文本),`corpus/index.json` 记录 `sourceUrl` 与版本;`verified: true` 的条目才参与轮转。
|
|
52
|
+
- 语料覆盖审计:`node scripts/audit-corpus-coverage.mjs`(金句逐字命中 33/33,节选可用 32/33)。
|
|
53
|
+
|
|
54
|
+
### 验证
|
|
55
|
+
- `verify/smoke.mjs`(24 项)、`verify/contract.mjs`(38 项)、`verify/host.test.mjs`(18 项):不联网、不起子进程、不花模型调用。
|
|
56
|
+
- 真实环境做过 headless 生成 + headless Chrome/CDP 页面断言(宠物坐标不变、卡片在左、chip 暖色、按钮无盒、已读徽标消失、无未读仍有内容)。
|
|
57
|
+
|
|
58
|
+
### 已知限制
|
|
59
|
+
- 只支持 Web 界面(`dsh.client.platform: web`)。
|
|
60
|
+
- 定时器只在 `dsh web` 进程存活时运行,进程停掉不补跑。
|
|
61
|
+
- 每次生成是独立的 headless 会话,不共享上下文;用最近 6 条督促避免重复。
|
package/LICENSE
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 dsh-maoxuan-pet contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
Third-party content notice:
|
|
26
|
+
|
|
27
|
+
`corpus/` bundles public electronic texts of Mao Zedong's writings collected
|
|
28
|
+
from the public archive 中文马克思主义文库 (https://www.marxists.org/chinese/).
|
|
29
|
+
Copyright in those texts belongs to their respective rights holders; they are
|
|
30
|
+
included here only for personal study and research, with source URLs recorded
|
|
31
|
+
in `corpus/index.json` and `corpus/README.md`. This project claims no rights in
|
|
32
|
+
them and does not sell them.
|
|
33
|
+
|
|
34
|
+
The pet artwork in `assets/` is AI-generated fan art of DeepSeek's unofficial
|
|
35
|
+
"whale girl" community mascot, dressed in a period Red Army uniform. It is not
|
|
36
|
+
official DeepSeek material and is not endorsed by DeepSeek. See
|
|
37
|
+
`assets/PROVENANCE.md`.
|
package/NOTICE
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# NOTICE
|
|
2
|
+
|
|
3
|
+
dsh-plugin-maoxuan-pet
|
|
4
|
+
Copyright (c) 2026 Yuna and contributors
|
|
5
|
+
|
|
6
|
+
本文件说明本仓库里**不属于 MIT 许可**的内容。代码本体见 [LICENSE](LICENSE)。
|
|
7
|
+
|
|
8
|
+
## 1. 内置毛选语料(`corpus/`)
|
|
9
|
+
|
|
10
|
+
- 来源:[中文马克思主义文库 · 毛泽东](https://www.marxists.org/chinese/maozedong/index.htm),抓取日期 2026-10-31,共 33 篇(`corpus/index.json` 记录每篇的 `sourceUrl`)。
|
|
11
|
+
- 著作权归原作者及原出版方所有。本项目对正文的收录**仅用于个人学习、研究**,不构成再出版、发行或商业授权。
|
|
12
|
+
- 若需在商业场景公开引用原文,请自行核对正式出版物并取得授权。
|
|
13
|
+
- **权利人若不希望文本随本包分发**:删除 `corpus/articles/` 即可;此时 `quote`/`excerpt` 模板会安全降级为 `summary`(插件不会编造原文),也可运行 `node scripts/fetch-corpus.mjs` 自行重新获取。
|
|
14
|
+
- 语料不参与 `npm` 之外的再分发声明,也不代表本项目对原文主张任何权利。
|
|
15
|
+
|
|
16
|
+
## 2. 立绘与图标(`assets/`)
|
|
17
|
+
|
|
18
|
+
- `pet-idle.png` / `pet-talk.png` / `pet-blink.png` / `pet-read.png`:AI 生成(gpt-image-2,2026-10-31),形象为民间同人设定「鲸鱼娘·小毛」(红军制服、抱《毛泽东选集》)。
|
|
19
|
+
生成过程与 prompt 记录见 [assets/PROVENANCE.md](assets/PROVENANCE.md)。
|
|
20
|
+
- `icon.svg`:手写 SVG(纯几何图形)。
|
|
21
|
+
- 与 DeepSeek 官方无任何隶属或背书关系。
|
|
22
|
+
|
|
23
|
+
## 3. 名称与立场
|
|
24
|
+
|
|
25
|
+
本插件是一个桌宠 / 阅读督促工具,把毛选当作**产品与创业方法论**的文本来源。它不代表 DeepSeek、毛泽东著作出版方或任何政治组织的立场,也不作政治宣传。
|
|
26
|
+
|
|
27
|
+
## 4. 第三方依赖
|
|
28
|
+
|
|
29
|
+
运行时只依赖宿主 `@deepseek-ai/dsh`(peer dependency)与 Node 内置模块;`verify/` 与 `scripts/` 不引入任何第三方包。
|
package/README.en.md
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# dsh-maoxuan-pet · Xiao Mao, the whale-girl desktop pet
|
|
2
|
+
|
|
3
|
+
[](https://github.com/yuna78/dsh-maoxuan-pet/actions/workflows/verify.yml) [](https://www.npmjs.com/package/dsh-plugin-maoxuan-pet)
|
|
4
|
+
|
|
5
|
+
A floating pet living in the DeepSeek Harness (dsh) web shell. Every hour she reads one
|
|
6
|
+
essay from *Selected Works of Mao Zedong*, turns it into **one ≤200-character nudge** for a
|
|
7
|
+
founder — a verbatim quote or excerpt, one line of pressure in her own voice, and one rule
|
|
8
|
+
with a way to verify it — and shows it in a red-book speech bubble.
|
|
9
|
+
|
|
10
|
+

|
|
11
|
+
|
|
12
|
+
> 中文说明见 [README.md](README.md)。
|
|
13
|
+
|
|
14
|
+
## What it does
|
|
15
|
+
|
|
16
|
+
| Piece | Behaviour |
|
|
17
|
+
|---|---|
|
|
18
|
+
| Pet | 4 sprite frames (idle / talk / blink / read), draggable, position remembered |
|
|
19
|
+
| Bubble | dark-red "book cover" with a gold spine; anchored to the **left** of the pet, so the pet never moves; `收起` / `再督促` are text-only buttons |
|
|
20
|
+
| Reading | opening the card marks that bubble read — the unread badge disappears; the bubble you are reading never gets swapped out |
|
|
21
|
+
| History | `‹ ›` walks back through previous bubbles; with nothing unread you still see the last one produced |
|
|
22
|
+
| Timing | one generation per hour (`everySeconds`), quiet hours, `maxBubbles` history cap |
|
|
23
|
+
| Preset | `maoxuan-pet` — a "Selected Works startup advisor" preset with the bundled corpus registered as the `maoxuan-vademecum` skill |
|
|
24
|
+
|
|
25
|
+
## Install
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
dsh plugin --profile web add dsh-plugin-maoxuan-pet
|
|
29
|
+
# restart dsh web (Ctrl+C, then `dsh web` again), reload the page
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Requirements: dsh `>=0.2.1-rc.2 <0.3.0`, Node `^22.19.0 || >=24.0.0`. Web shell only.
|
|
33
|
+
|
|
34
|
+
## How a bubble is produced
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
everySeconds → pick next verified essay → template rotates quote/excerpt/summary
|
|
38
|
+
→ spawn `dsh --profile headless --json "<prompt>"` (60s-ish, one model call)
|
|
39
|
+
→ parse JSON {pua, lesson, axis, gist}
|
|
40
|
+
→ quote/excerpt must match the corpus verbatim, otherwise fall back to summary
|
|
41
|
+
→ fitLesson(): cite + pua + lesson ≤ 200 chars
|
|
42
|
+
→ persist to $DSH_HOME/storages/dsh-maoxuan-pet.json (atomic write)
|
|
43
|
+
→ client polls /api/dsh-maoxuan-pet.state every 20s
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
If the model call fails (no credentials, timeout, non-JSON), the plugin degrades to a **local
|
|
47
|
+
excerpt** and labels it `离线摘录` in the footer — it never invents a quote.
|
|
48
|
+
|
|
49
|
+
- Templates: `quote` (golden line) / `excerpt` (verbatim whole sentences) / `summary` (her own gist).
|
|
50
|
+
- Lesson axes: 客户 customers / 项目 projects / 组织 organisation / 现金流 cash flow / 决策 decisions / 自律 self-discipline.
|
|
51
|
+
- The 200-character cap is a hard invariant, not a suggestion: `fitLesson()` shrinks the lesson,
|
|
52
|
+
never the quote.
|
|
53
|
+
|
|
54
|
+
## Config
|
|
55
|
+
|
|
56
|
+
```yaml
|
|
57
|
+
- id: dsh-maoxuan-pet
|
|
58
|
+
config:
|
|
59
|
+
enabled: true
|
|
60
|
+
everySeconds: 3600 # hourly
|
|
61
|
+
firstDelaySeconds: 90
|
|
62
|
+
quietHours: [2, 8] # no pings between 02:00 and 08:00 local time
|
|
63
|
+
maxBubbles: 40
|
|
64
|
+
headless: true # false = only local excerpts, zero model calls
|
|
65
|
+
profile: headless
|
|
66
|
+
timeoutMs: 180000
|
|
67
|
+
businessContext: "40, indie developer, small-tool SaaS"
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Verification
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
node verify/smoke.mjs # 24 structural checks
|
|
74
|
+
node verify/contract.mjs # 38 pure-function tests
|
|
75
|
+
node verify/host.test.mjs # 18 fake-ctx end-to-end tests (no network, no subprocess)
|
|
76
|
+
node tools/audit-corpus-coverage.mjs # quote must be verbatim in all 33 essays
|
|
77
|
+
npm pack --dry-run # 59 files / 1.3 MB, no .dsh-dev / assets/raw / verify
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
CI runs the same set on Node 22 and 24. See [verify/README.md](verify/README.md).
|
|
81
|
+
|
|
82
|
+
## License and third-party content
|
|
83
|
+
|
|
84
|
+
- **Code**: MIT — see [LICENSE](LICENSE).
|
|
85
|
+
- **Bundled corpus** (`corpus/`, 33 essays): **not MIT.** Texts come from the
|
|
86
|
+
[Chinese Marxist Internet Archive](https://www.marxists.org/chinese/maozedong/index.htm) and
|
|
87
|
+
are bundled for personal study only. See [NOTICE](NOTICE). Delete `corpus/articles/` to drop it;
|
|
88
|
+
quote/excerpt templates then degrade safely to summary.
|
|
89
|
+
- **Sprites**: AI-generated (gpt-image-2), a fan-made "whale girl" character — not affiliated with
|
|
90
|
+
DeepSeek. See [assets/PROVENANCE.md](assets/PROVENANCE.md).
|
|
91
|
+
|
|
92
|
+
This plugin is a reading/nudging tool that treats the essays as a source of product and
|
|
93
|
+
entrepreneurship method. It is not affiliated with DeepSeek or any publisher, and it is not
|
|
94
|
+
political advocacy.
|
package/README.md
CHANGED
|
@@ -1,3 +1,196 @@
|
|
|
1
|
-
#
|
|
1
|
+
# dsh-maoxuan-pet · 鲸鱼娘·小毛
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[English](README.en.md) · 中文
|
|
4
|
+
|
|
5
|
+
[](https://github.com/yuna78/dsh-maoxuan-pet/actions/workflows/verify.yml) [](https://www.npmjs.com/package/dsh-plugin-maoxuan-pet)
|
|
6
|
+
|
|
7
|
+
> 一只穿红军制服、抱着《毛泽东选集》的鲸鱼娘,住在 DSH 的 Web 界面右下角。
|
|
8
|
+
> 每小时读一篇毛选,把它变成一句针对**你的**创业处境的思想 + 一句督促,
|
|
9
|
+
> 并且随时可以开一个新会话问她:根据毛选,我这一步该怎么走。
|
|
10
|
+
|
|
11
|
+
| 需求 | 实现 |
|
|
12
|
+
|---|---|
|
|
13
|
+
| 宠物形态、鲸鱼娘、红军制服、手捧毛选 | `assets/` 里 4 帧 AI 立绘(idle / talk / blink / read,256×539 RGBA,红封面竖排「毛泽东选集」可辨),`client.js` 在 `shell.overlay` 槽位渲染悬浮宠物 |
|
|
14
|
+
| 每小时帮我读毛选 | Host 定时器按小时读 `corpus/` 里的下一篇(轮转、避开刚读过的) |
|
|
15
|
+
| 每小时生成思想 / PUA 我的话,出现在气泡里 | 每次生成 `spawn` 一个 `dsh --profile headless` 对话,拿到结构化 JSON 后推给气泡 |
|
|
16
|
+
| 有个 preset,能直接问「根据毛选我该怎么做」 | `maoxuan-pet`「毛选创业参谋」preset + 运行时注册的 `maoxuan-vademecum` skill 指向内置语料 |
|
|
17
|
+
|
|
18
|
+
## 它到底怎么工作
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
┌─ DSH Web (dsh web) ───────────────────────────────────────────┐
|
|
22
|
+
│ │
|
|
23
|
+
│ index.js (Host) │
|
|
24
|
+
│ ├─ 状态:$DSH_HOME/storages/dsh-maoxuan-pet.json (原子写) │
|
|
25
|
+
│ ├─ 定时器:ctx.timeout 链 → quietHours / dailyLimit 约束 │
|
|
26
|
+
│ ├─ 语料:corpus/index.json → 轮转挑一篇 verified 的 │
|
|
27
|
+
│ ├─ 生成:spawn `dsh --profile headless --json "<prompt>"` │
|
|
28
|
+
│ │ └ 失败/超时/非 JSON → 本地摘录降级(标注“离线摘录”) │
|
|
29
|
+
│ ├─ 路由:/api/dsh-maoxuan-pet.{state,generate,dismiss, │
|
|
30
|
+
│ │ asset,corpus} │
|
|
31
|
+
│ └─ skill:把 corpus/ 注册成 maoxuan-vademecum │
|
|
32
|
+
│ │
|
|
33
|
+
│ client.js (Web) │
|
|
34
|
+
│ └─ shell.overlay → 宠物 + 气泡,20s 轮询 / 生成中 3s 轮询 │
|
|
35
|
+
│ │
|
|
36
|
+
│ cordis.patch.yml │
|
|
37
|
+
│ ├─ 插件行 dsh-maoxuan-pet │
|
|
38
|
+
│ └─ preset-maoxuan-pet「毛选创业参谋」(persona + skill + 工具) │
|
|
39
|
+
└───────────────────────────────────────────────────────────────┘
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
气泡里的每条内容都是**结构化**的,而且**整条不超过 200 字**:
|
|
43
|
+
|
|
44
|
+
| 字段 | 含义 |
|
|
45
|
+
|---|---|
|
|
46
|
+
| `template` | 三种模板轮转:`quote` 金句 / `excerpt` 文章节选 / `summary` 小毛概括 |
|
|
47
|
+
| `cite` | 上面那一句(逐字核对过;`summary` 是小毛的概括,不加引号),带来源链接 |
|
|
48
|
+
| `axis` | 启示落点,六选一:客户 / 项目 / 组织 / 现金流 / 决策 / 自律 |
|
|
49
|
+
| `pua` | 小毛对你说的一句话(≤40 字,第一人称;**模型复述原文时会整条丢弃**,气泡只留引文 + 启示) |
|
|
50
|
+
| `lesson` | 启示:一条硬规则 + 怎么验证(≤100 字,围绕 `axis`) |
|
|
51
|
+
| `chars` | 引文 + pua + 启示的实际字数,Host 保证 ≤200 |
|
|
52
|
+
| `mode` | `headless` = 模型生成;`offline` = 本地摘录降级(UI 会标「离线摘录」) |
|
|
53
|
+
|
|
54
|
+
框架是这样设计的(`template × axis` 矩阵,而不是每次同一套):
|
|
55
|
+
|
|
56
|
+
```
|
|
57
|
+
取材 3 种:原文金句 / 文章节选(逐字取整句)/ 小毛概括(模型自己概括)
|
|
58
|
+
落点 6 种:客户 · 项目 · 组织 · 现金流 · 决策 · 自律
|
|
59
|
+
语气 3 种:sharp 硬话 · calm 冷静 · urgent 催
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
- 模板游标 `templateCursor` 持久化在状态里,按 3 种循环;不会因为历史条数封顶而卡住;
|
|
63
|
+
- `axis` 在 prompt 里指定,并尽量避开上一条的落点;
|
|
64
|
+
- 引文句式/节选都在 `corpus/articles/<id>.md` 里做 `isVerbatim` 逐字校验,校验不过就退到 `summary`,绝不编造;
|
|
65
|
+
- 所有字段最后过一遍 `fitLesson`,把「引文 + pua + 启示」压进 200 字。
|
|
66
|
+
|
|
67
|
+
为什么落点是 6 类名词、而「动作」不单列一类、字数预算怎么分、真实生成样例长什么样,
|
|
68
|
+
见 [docs/CONTENT-FRAMEWORK.md](docs/CONTENT-FRAMEWORK.md)。语料能不能支撑 Quote 模板,跑一条审计就知道:
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
node tools/audit-corpus-coverage.mjs # 33 篇:金句逐字命中 33/33,节选可用 32/33
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### 界面行为(这一版按用户逐条反馈定的)
|
|
75
|
+
|
|
76
|
+
(效果图见下方[「长什么样」](#长什么样))
|
|
77
|
+
|
|
78
|
+
- **红皮书卡片**:深红封面 + 烫金书脊,正文米白;卡片里不出现蓝/紫/绿,落点 chip 用同一族暖金。滚动条也换成烫金滑块 + 深红轨道。
|
|
79
|
+
- **宠物不动**:卡片绝对定位在宠物左侧(宠物被拖到靠左边缘时自动翻到右侧),点开/收起只让气泡出现或消失,宠物坐标不变。
|
|
80
|
+
- **打开即已读**:卡片真正显示的那一刻才把这条标已读,宠物右上角的未读数随之消失;正在读的那条会被"钉住",Host 把 `current` 推进到下一条时,眼前的文字不会跳。
|
|
81
|
+
- **没有未读也有内容**:全部读过后再点开,仍然停在上一次产出的那张卡,`‹ ›` 可以往前翻历史。
|
|
82
|
+
- **定时弹出**:整点生成的新气泡会自己弹出来;手动关掉的那条不会自己再弹,等下一条。
|
|
83
|
+
- **按钮无盒子**:`收起` / `再督促` 是纯文字 + 下划线,没有背景和边框。
|
|
84
|
+
|
|
85
|
+
## 安装
|
|
86
|
+
|
|
87
|
+
从 npm(推荐):
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
dsh plugin --profile web add dsh-plugin-maoxuan-pet
|
|
91
|
+
# 然后 Ctrl+C 停掉 dsh web,再重新 `dsh web`,刷新页面
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
从源码(本目录):
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
node install.mjs --dry-run # 先看要改什么
|
|
98
|
+
node install.mjs # 写入 profile 清单 + pnpm link
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
两种方式装完都要**手动重启** `dsh web`(Ctrl+C 后重新 `dsh web`),刷新页面。
|
|
102
|
+
|
|
103
|
+
完整步骤、回滚、排错见 [docs/INSTALL.md](docs/INSTALL.md);内部接口见 [docs/API-CONTRACT.md](docs/API-CONTRACT.md)。
|
|
104
|
+
|
|
105
|
+
### 长什么样
|
|
106
|
+
|
|
107
|
+

|
|
108
|
+
|
|
109
|
+
深红封面 + 烫金书脊的气泡挂在宠物左侧,宠物自己不动;打开即已读(右上角未读数消失),
|
|
110
|
+
`‹ ›` 可以往回翻历史;定时生成的新气泡会自己弹出来,`收起` / `再督促` 是纯文字按钮。
|
|
111
|
+
|
|
112
|
+
截图由 `scripts/hero-shot.mjs` 生成(需要本地 headless Chrome + 一个 dsh web 实例),
|
|
113
|
+
换版式时重拍即可。
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
## 配置
|
|
117
|
+
|
|
118
|
+
```yaml
|
|
119
|
+
- id: dsh-maoxuan-pet
|
|
120
|
+
config:
|
|
121
|
+
enabled: true
|
|
122
|
+
everySeconds: 3600 # 每小时
|
|
123
|
+
firstDelaySeconds: 90 # 启动后 90s 先来一次
|
|
124
|
+
quietHours: [2, 8] # 本地时间 02:00–08:00 不打扰
|
|
125
|
+
dailyLimit: 24 # 每天最多生成次数(防失控)
|
|
126
|
+
maxBubbles: 40
|
|
127
|
+
headless: true # false = 只用本地摘录,不花模型调用
|
|
128
|
+
dshBin: dsh
|
|
129
|
+
profile: headless
|
|
130
|
+
timeoutMs: 180000
|
|
131
|
+
businessContext: |-
|
|
132
|
+
用户是一位正在创业的独立开发者……
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
## 用 preset 问「根据毛选我应该怎么做」
|
|
136
|
+
|
|
137
|
+
新建会话 → preset 选 **「毛选创业参谋」**(id `maoxuan-pet`)→ 直接问。它会:
|
|
138
|
+
|
|
139
|
+
1. 加载 `maoxuan-vademecum` skill(知道语料在哪、怎么检索);
|
|
140
|
+
2. 用 `read` 打开对应篇目**全文**,取逐字原文;
|
|
141
|
+
3. 按固定结构回答:原文金句(篇名 + 时间)→ 当时的问题与论证 → 方法 → 你的处境 → 今天能做的一步;
|
|
142
|
+
4. 核不到原文就明说,不编造。
|
|
143
|
+
|
|
144
|
+
`maoxuan-vademecum` skill 是运行时由 Host 注册的(内容来自 `skill/maoxuan-vademecum/SKILL.md` + 语料索引),所以它永远指向当前安装目录,不写死路径。
|
|
145
|
+
|
|
146
|
+
## 毛选语料
|
|
147
|
+
|
|
148
|
+
- **33 篇,全部 `verified: true`**,覆盖第一至第五卷(目录页实际解析出 329 篇,按“与创业最相关”白名单取 33 篇全文);
|
|
149
|
+
- 来源:中文马克思主义文库公开电子文本(https://www.marxists.org/chinese/maozedong/index.htm),GB2312 页面按 gb18030 解码,逐篇记录 URL 与抓取时间;
|
|
150
|
+
- 结构:`corpus/index.json` 索引 + `corpus/articles/<id>.md` 全文;每条带 `quote`(逐字核对)、`summary`、`businessAngle`、`verified`;
|
|
151
|
+
- 重新抓取 / 扩充:`npm run corpus`(见 `scripts/fetch-corpus.mjs`);
|
|
152
|
+
- 版权:文本版权归原权利人,此处仅用于个人学习研究,不用于售卖,详见 `corpus/README.md` 与 `LICENSE`。
|
|
153
|
+
|
|
154
|
+
## 开发与验证
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
npm test # node verify/smoke.mjs
|
|
158
|
+
npm run test:contract
|
|
159
|
+
node verify/host.test.mjs # 假 ctx 端到端:路由、状态、降级、原子写
|
|
160
|
+
node --check index.js
|
|
161
|
+
node --check client.js
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
验证边界见 [verify/README.md](verify/README.md):单元与端到端测试不联网、不启动子进程、不花模型调用。
|
|
165
|
+
|
|
166
|
+
真实链路另做过一次隔离启动验证(`DSH_HOME=/tmp/... dsh web --port 3099`,不碰当前 GUI 的 profile):
|
|
167
|
+
|
|
168
|
+
| 验证 | 结果 |
|
|
169
|
+
|---|---|
|
|
170
|
+
| `--dump-config` 组装 | 插件行与 `preset-maoxuan-pet` 都在组合后的配置里 |
|
|
171
|
+
| `GET /api/dsh-maoxuan-pet.state` | 200,`corpus.count=33`,`nextRunAt` 已排定 |
|
|
172
|
+
| `GET /api/dsh-maoxuan-pet.asset?name=idle` | 200,`image/png`,256×539 RGBA |
|
|
173
|
+
| 页面 boot payload | 含 `dsh-plugin-maoxuan-pet/client.js`,实际拉到的 bundle 里含本插件代码且可解析 |
|
|
174
|
+
| `POST /api/dsh-maoxuan-pet.generate`(真实 headless) | 61s,`mode: "headless"`,返回结构化气泡(篇名/金句/思想/启示/督促/动作) |
|
|
175
|
+
| 失败降级 | 无凭据时 5.5s 内降级为 `mode: "offline"` 并写入 `lastError` |
|
|
176
|
+
|
|
177
|
+
### 两个真实踩到的坑(已在 docs/API-CONTRACT.md §6 详述)
|
|
178
|
+
|
|
179
|
+
1. 自定义路由必须显式 `requestBody: 'buffered'`,否则 GET 会被 Host 直接 400、handler 不被调用;
|
|
180
|
+
2. `ctx.timeout()` 必须在 `inject` 里声明 `'timer'`,否则真实 `dsh web` 启动 fatal。
|
|
181
|
+
|
|
182
|
+
## 已知限制
|
|
183
|
+
|
|
184
|
+
- 只支持 Web 界面(`dsh.client.platform: web`),终端/TUI 里没有宠物;
|
|
185
|
+
- 定时器只在这个 `dsh web` 进程活着时走;进程停了不会补跑,重启后按 `nextRunAt` 决定是否补一次;
|
|
186
|
+
- headless 生成每次是一个独立会话(不复用上下文),好处是稳定、坏处是“它不记得昨天说过什么”——所以 prompt 里带了最近 6 条督促用来避免重复;
|
|
187
|
+
- 生图是 AI 生成,中文“毛泽东选集”可能不是逐字可辨,详见 `assets/PROVENANCE.md`;
|
|
188
|
+
- DeepSeek「鲸鱼娘」是民间同人设定,本项目不是官方素材,也不代表 DeepSeek 立场。
|
|
189
|
+
|
|
190
|
+
## License
|
|
191
|
+
|
|
192
|
+
- **代码**:MIT,见 [LICENSE](LICENSE)。
|
|
193
|
+
- **内置毛选语料**(`corpus/`):**不是 MIT**。文本来自[中文马克思主义文库·毛泽东](https://www.marxists.org/chinese/maozedong/index.htm),著作权归原作者与出版方,
|
|
194
|
+
本项目仅作个人学习、研究之用的整理,不构成再出版或商业授权。详见 [NOTICE](NOTICE) 与 [corpus/README.md](corpus/README.md)。
|
|
195
|
+
- **立绘**(`assets/`):AI 生成(gpt-image-2,2026-10-31),民间同人形象「鲸鱼娘·小毛」,与 DeepSeek 官方无关。生成记录见 [assets/PROVENANCE.md](assets/PROVENANCE.md)。
|
|
196
|
+
- 本项目与 DeepSeek、毛泽东著作出版方均无隶属关系;内容用于产品与创业方法论的阅读辅助,不作政治宣传。
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# 素材来源与生成记录(PROVENANCE)
|
|
2
|
+
|
|
3
|
+
**素材性质:DeepSeek 民间同人形象「鲸鱼娘·小毛」——非官方素材,AI 生成。**
|
|
4
|
+
与 DeepSeek 官方无任何关联,仅作本插件(dsh-plugin-maoxuan-pet)的宠物形象使用。
|
|
5
|
+
|
|
6
|
+
- 角色设定(用户原话):「画一个鲸鱼娘(deepseek 的民间 ip)…… 传中国的红军的制服…… 因为要读毛选,手里有毛选的书」。
|
|
7
|
+
- 生成日期:**2026-10-31**(America/New_York)。
|
|
8
|
+
- 生成模型:**gpt-image-2**,通过用户自建的中转线路调用(`POST /v1/images/generations` 文生图、`POST /v1/images/edits` 图生图 / 表情差分,图生图请求带 `background=transparent`)。
|
|
9
|
+
- 生成工具:
|
|
10
|
+
- 文生图:作者本机的一个 `gen_image.py` 脚本(个人 skill 目录,非本仓库代码,未随包分发)。
|
|
11
|
+
- 图生图 / 表情差分:临时 multipart 脚本(仅标准库,未入库),调用同一中转的 `/v1/images/edits`。
|
|
12
|
+
- 凭据处理:base URL / 模型名 / API key 全部经**环境变量**传入,未写入本仓库任何文件、日志或提交。本文件不含任何 key。
|
|
13
|
+
- 后处理:系统自带 `python3` + Pillow(12.1.0)+ numpy,脚本为临时脚本(未入库)。未安装任何新的系统依赖。
|
|
14
|
+
|
|
15
|
+
## 生成流程
|
|
16
|
+
|
|
17
|
+
1. **定角色**:文生图一张 1024×1536 的站姿「抱书微笑」立绘(`assets/raw/idle-v1.png`)。
|
|
18
|
+
2. **定封面文字**:以该立绘为参考做图生图,只改「红封面上的竖排中文」,并直接要求 `background=transparent`,得到带 alpha 的 idle 底帧(`assets/raw/idle-text-v2.png`)。
|
|
19
|
+
3. **做表情/姿势差分**:全部以 idle 底帧为参考做图生图,保持角色、服装、比例、配色、封面题字不变,只改表情或持书方式,输出仍为透明底:
|
|
20
|
+
- talk → `assets/raw/talk-final.png`
|
|
21
|
+
- blink → `assets/raw/blink-final.png`
|
|
22
|
+
- read → `assets/raw/read-v3.png`
|
|
23
|
+
4. **统一画面**:四帧用**同一个裁剪框**(原图 1024×1536 的 `(160, 0, 880, 1516)`)裁切,先把透明区域外扩成相邻像素颜色(避免缩放时白边渗入轮廓),再 Lanczos 等比缩放到 **640×1348** 作为母版;交付版再降到 **256×539**(UI 展示高 132px,2x 屏幕够用,四帧共用同一画布与脚底线,切换帧时身体不跳)。
|
|
24
|
+
5. `assets/icon.svg`:**手写 SVG**(纯几何形状,非 AI 生成),米白底 + 红皮书 + 烫金五角星与书名条,2326 字节;另导出 `assets/icon-256.png`(256×256 RGBA)供市场条目 `icon:` 使用(市场只收 GitHub 托管位图,不收 SVG)。
|
|
25
|
+
|
|
26
|
+
原始中间产物保留在 `assets/raw/`(本仓库 `.gitignore` 已忽略该目录,不随 git 提交;如需瘦身可直接删除)。
|
|
27
|
+
|
|
28
|
+
## 每个文件的 prompt 全文
|
|
29
|
+
|
|
30
|
+
### 1. `assets/pet-idle.png`(站姿抱书微笑)
|
|
31
|
+
|
|
32
|
+
第一步(文生图,1024×1536):
|
|
33
|
+
|
|
34
|
+
> a cute chibi anime girl mascot based on a whale: deep navy-blue short bob hair with two small whale-fin shaped hair ornaments, a small blue whale tail fin peeking behind her back, big round dark-blue eyes, fair skin, cheerful, wearing an authentic 1920s-1930s Chinese Workers and Peasants Red Army uniform: grey-blue coarse cotton tunic with red collar tabs, a red cloth armband on the left upper arm, a grey-blue octagonal cloth cap with a small red five-pointed star on the front, grey-blue cloth trousers with puttees, black cloth shoes, holding a thick hardcover book hugged against her chest with both hands; the book cover is plain solid red with one subtle embossed small five-pointed star, the cover has NO text and NO letters, standing upright facing the viewer, gentle warm smile, mouth closed, clean 2D anime key-visual illustration, flat color with thin crisp lineart and soft cel shading, warm cozy palette, full body, centered, pure solid flat white background #FFFFFF, absolutely no shadow under the feet, no gradient, no frame, no text, no letters, no watermark, no 3D, not photorealistic
|
|
35
|
+
|
|
36
|
+
第二步(图生图表情/题字,`background=transparent`):
|
|
37
|
+
|
|
38
|
+
> Same image, same character, fully transparent background. Only change: on the plain red front cover of the book, write the five Chinese characters 毛泽东选集 in warm off-white printed Chinese type, stacked vertically top to bottom, small, narrow, placed in the UPPER LEFT part of the red cover well above her hand so no character is covered by her hand or arm. Keep EXACTLY the same character, face design, hair, hat with red star, uniform, red armband, palette, lineart style, scale and framing. No shadows. Do not draw any text on the armband or clothing.
|
|
39
|
+
|
|
40
|
+
### 2. `assets/pet-talk.png`(张嘴说话,供气泡同步)
|
|
41
|
+
|
|
42
|
+
> Same character, same pose. Only her expression changes: mouth open mid-sentence speaking warmly, bright friendly eyes, slightly raised chin. Keep EXACTLY the same character, hair, hat with red star, uniform, red armband, the red book with the vertical Chinese title on its cover, palette, lineart style, scale and framing. Fully transparent background, no shadows, no text on clothing.
|
|
43
|
+
|
|
44
|
+
### 3. `assets/pet-blink.png`(闭眼/眨眼,与 idle 交替播放)
|
|
45
|
+
|
|
46
|
+
> Same character, same pose. Only her expression changes: eyes gently closed in a happy relaxed blink (curved eyelashes), mouth closed in a soft smile. Keep EXACTLY the same character, hair, hat with red star, uniform, red armband, the red book with the vertical Chinese title on its cover, palette, lineart style, scale and framing. Fully transparent background, no shadows, no text on clothing.
|
|
47
|
+
|
|
48
|
+
### 4. `assets/pet-read.png`(低头看书)
|
|
49
|
+
|
|
50
|
+
> Same character, same hat, same uniform, same red armband, same art style and scale, fully transparent background. Pose change: she lowers her head and looks DOWN at the red book, which she now holds OPEN in both hands so we can see the warm white printed pages with neat vertical lines of tiny abstract Chinese text; the red cover with the five-pointed star stays visible under the pages; calm focused smile. Keep exactly the same character design, hair, face, hat with red star, palette, lineart. No shadows, no extra text on her clothing.
|
|
51
|
+
|
|
52
|
+
## 实际交付与检查结果(真实执行)
|
|
53
|
+
|
|
54
|
+
| 文件 | 像素 | 色彩/通道 | `file` 输出 | 说明 |
|
|
55
|
+
| --- | --- | --- | --- | --- |
|
|
56
|
+
| `assets/pet-idle.png` | 256×539 | RGBA,带 alpha | PNG image data, 256 x 539, 8-bit/color RGBA, non-interlaced | 站姿抱书微笑,封面竖排「毛泽东选集」可辨 |
|
|
57
|
+
| `assets/pet-talk.png` | 256×539 | RGBA,带 alpha | 同上 | 同姿势张嘴说话,封面题字保留(字号比 idle 略小、略挤) |
|
|
58
|
+
| `assets/pet-blink.png` | 256×539 | RGBA,带 alpha | 同上 | 闭眼微笑,与 idle 仅表情不同 |
|
|
59
|
+
| `assets/pet-read.png` | 256×539 | RGBA,带 alpha | 同上 | 低头看书,书摊开(见下方缺陷第 2 条) |
|
|
60
|
+
| `assets/icon.svg` | viewBox 512×512,2326 字节 | 纯几何矢量 | — | 米白底 + 红皮书 + 烫金五角星 + 书名条,手写;同款导出为 `assets/icon-256.png` |
|
|
61
|
+
|
|
62
|
+
每张 PNG 都用 `read_image` 逐张看过后才采用;另外把四帧合成到棋盘格背景上放大检查轮廓边缘,确认透明通道有效、无白色描边、脚底与发梢没有被裁断。
|
|
63
|
+
|
|
64
|
+
## 缺陷与局限(如实记录)
|
|
65
|
+
|
|
66
|
+
1. **封面中文是模型直接画出来的**,不是后期叠加:
|
|
67
|
+
- idle / blink / talk 三帧的红封面上,竖排「毛泽东选集」五字可辨;其中 talk 帧字号偏小、字距略挤,远看仍可读但不如 idle 干净(单张重试 3 次上限内未再重生成)。
|
|
68
|
+
- **read 帧的书是摊开的**,封面题字被书页遮住,因此该帧封面只保留五角星与米白书页上的抽象竖排小字,**没有可读的「毛泽东选集」字样**。若需要四帧都出现完整书名,需要前端在 read 帧叠加 SVG 文字。
|
|
69
|
+
2. **制服**:帽子形制接近 1930 年代红军软帽/八角帽(正面红五星清晰、灰蓝土布质感),但帽檐比历史实物更挺括、略偏「军帽」感;红领章在 idle/talk/blink 是三角形小领章、在 read 帧是菱形块,帧间不完全一致。没有出现国民政府军、现代迷彩、纳粹/苏联符号。
|
|
70
|
+
3. **手部**:四帧都是双手抱书或持书,手指被简化为四指团块(Q 版常见处理),没有出现多余手指或明显畸形,但也没有逐指分开。
|
|
71
|
+
4. **鞋**:黑色布鞋鞋面上有一块肉色椭圆(脚背),放大看略像「鞋面开孔」,属轻微造型瑕疵。
|
|
72
|
+
5. **帧间一致性**:四帧由同一底图 img2img 派生,构图、比例、配色、服装基本一致,但发梢分叉、鲸尾弯曲、腰带扣、领章形状等有细小差别。**不适合做逐像素动画**,只适合静态帧切换(插件里 idle↔blink 交替、talk 气泡同步、read 展示的用法)。
|
|
73
|
+
6. 生成过程记录:blink 第一次透明底请求(`raw/blink-v2.png`)返回的是不带 alpha 的 RGB,已重新生成(`raw/blink-final.png`);read 第一版(`raw/read-v2.png`)帽形/领章与 idle 差异偏大,改用第二版(`raw/read-v3.png`)。
|
|
74
|
+
7. 全部素材无第三方素材、无水印、无多余文字;`icon.svg` 为手写纯几何图形。
|
|
75
|
+
|
|
76
|
+
## 复现方式(不含任何密钥)
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
export GPT_IMAGE_BASE_URL="<用户自己的 OpenAI 兼容中转地址>"
|
|
80
|
+
export GPT_IMAGE_MODEL="gpt-image-2"
|
|
81
|
+
export GPT_IMAGE_API_KEY="<从用户私有的 key 文件按环境变量注入>"
|
|
82
|
+
|
|
83
|
+
# 1) 文生图底图
|
|
84
|
+
python3 ~/.codex/skills/gpt-image/scripts/gen_image.py --size 1024x1536 \
|
|
85
|
+
--prompt "<见上文 idle 第一步 prompt>" --output assets/raw/idle-v1.png
|
|
86
|
+
|
|
87
|
+
# 2) 表情/姿势差分:POST {GPT_IMAGE_BASE_URL}/images/edits(multipart)
|
|
88
|
+
# image=assets/raw/idle-text-v2.png, background=transparent, size=1024x1536
|
|
89
|
+
# prompt=<见上文各帧 prompt>
|
|
90
|
+
|
|
91
|
+
# 3) 统一裁剪 640×1348 母版、透明区域颜色外扩、Lanczos 缩放(Pillow)
|
|
92
|
+
# 4) 交付版再等比降到 256×539,PNG optimize=True(四帧共 603 KB,0.2.1 起)
|
|
93
|
+
```
|
|
Binary file
|
package/assets/icon.svg
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" width="512" height="512" role="img" aria-label="鲸鱼娘·小毛 图标:米白底上的一本红皮书《毛泽东选集》,封面烫金五角星与书名条">
|
|
2
|
+
<title>鲸鱼娘·小毛</title>
|
|
3
|
+
<!-- 底板:米白圆角方块(深色市场卡片上有边界,浅色界面下不刺眼) -->
|
|
4
|
+
<rect x="0" y="0" width="512" height="512" rx="116" fill="#FFF6E9"/>
|
|
5
|
+
<rect x="14" y="14" width="484" height="484" rx="104" fill="none" stroke="#C1342B" stroke-width="6" stroke-opacity="0.16"/>
|
|
6
|
+
|
|
7
|
+
<!-- 投影:把书从米白底上「抬」起来 -->
|
|
8
|
+
<g filter="url(#softShadow)" opacity="0.22">
|
|
9
|
+
<rect x="132" y="112" width="286" height="308" rx="28" fill="#7A1410"/>
|
|
10
|
+
</g>
|
|
11
|
+
|
|
12
|
+
<g transform="translate(252,256) scale(1.08) translate(-258,-256)">
|
|
13
|
+
<!-- 书页块:右侧露出的米黄页缘 + 两道浅红页线 -->
|
|
14
|
+
<g>
|
|
15
|
+
<path d="M330 118 h78 a14 14 0 0 1 14 14 v248 a14 14 0 0 1 -14 14 h-78 z" fill="#EFDFC4"/>
|
|
16
|
+
<path d="M356 138 v236 M382 138 v236" stroke="#D9C4A2" stroke-width="5" stroke-linecap="round"/>
|
|
17
|
+
</g>
|
|
18
|
+
|
|
19
|
+
<!-- 书壳:深红封面 + 更深一档的书脊 -->
|
|
20
|
+
<g>
|
|
21
|
+
<rect x="120" y="104" width="232" height="304" rx="26" fill="#B3271E"/>
|
|
22
|
+
<rect x="120" y="104" width="46" height="304" rx="22" fill="#8F1E17"/>
|
|
23
|
+
<!-- 书脊烫金线 -->
|
|
24
|
+
<path d="M143 148 v216" stroke="#E8C36A" stroke-width="7" stroke-linecap="round" opacity="0.9"/>
|
|
25
|
+
</g>
|
|
26
|
+
|
|
27
|
+
<!-- 封面烫金细框 -->
|
|
28
|
+
<rect x="192" y="126" width="142" height="260" rx="14" fill="none" stroke="#E8C36A" stroke-width="5" stroke-opacity="0.55"/>
|
|
29
|
+
|
|
30
|
+
<!-- 五角星(10 点纯几何):中心 (263,196),外径 46,内径 17.6 -->
|
|
31
|
+
<polygon fill="#E8C36A" points="263,150 273.32,181.76 306.72,181.76 279.7,201.74 289.02,234.5 263,214.25 236.98,234.5 246.3,201.74 219.28,181.76 252.68,181.76"/>
|
|
32
|
+
|
|
33
|
+
<!-- 书名条:两道烫金横杠,替代小字(36px 下也能读成「书名」) -->
|
|
34
|
+
<g fill="#E8C36A">
|
|
35
|
+
<rect x="215" y="272" width="96" height="16" rx="8"/>
|
|
36
|
+
<rect x="232" y="304" width="62" height="13" rx="6.5" opacity="0.78"/>
|
|
37
|
+
</g>
|
|
38
|
+
</g>
|
|
39
|
+
|
|
40
|
+
<defs>
|
|
41
|
+
<filter id="softShadow" x="-20%" y="-20%" width="140%" height="140%">
|
|
42
|
+
<feGaussianBlur stdDeviation="14"/>
|
|
43
|
+
</filter>
|
|
44
|
+
</defs>
|
|
45
|
+
</svg>
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|