dsh-fish-pet 0.2.7 → 0.2.9

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 CHANGED
@@ -1,5 +1,16 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.2.9] - 2026-10-31
4
+
5
+ ### Fixed
6
+ - 喂食与对话完全脱节:问"吃了没有"它说没吃。现在把「共喂过几次、上次喂食多久前」写进提示词,鱼知道自己吃没吃过
7
+ - 喂食时间持久化到 `state.json`,重启后仍记得
8
+ ## [0.2.8] - 2026-10-31
9
+
10
+ ### Docs
11
+ - README 新增「一分钟了解」表格与「速览」快速开始,访客 30 秒看懂能做什么
12
+ - 新增 `docs/promote.md`:V2EX / 掘金 / B 站 / 小红书 / 少数派 / awesome 列表的现成传播文案
13
+ - README 增加「分享与传播」入口
3
14
  ## [0.2.7] - 2026-10-31
4
15
 
5
16
  ### Fixed
package/README.md CHANGED
@@ -10,7 +10,44 @@
10
10
  给 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) 养一条住在 Windows 桌面上的蓝鱼。
11
11
  它不是网页贴图:是一个**逐像素透明的置顶窗口**,用 PowerShell + WinForms 逐帧绘制,还能**听你说话、跟你聊天、用中文语音回你**。
12
12
 
13
- > 个人作品,与 DeepSeek 官方无关。
13
+ ## 一分钟了解
14
+
15
+ | 它能做什么 | 说明 |
16
+ | --- | --- |
17
+ | 🐟 **住在桌面上** | 逐像素透明置顶窗口,程序不到 100KB——纯 PowerShell + WinForms 手写逐帧绘制 |
18
+ | 🎤 **听你说话** | WASAPI 连续采集 + 自研 VAD,说完自动识别(硅基流动 Qwen3-ASR) |
19
+ | 💬 **跟你聊天** | 接 DeepSeek,带人设、记得上下文、情绪会写在语气里 |
20
+ | 🔊 **念给你听** | 微软 Edge 免费音色(默认晓晓),中英文自动切换音色 |
21
+ | 😊 **有情绪** | 饥饿值 / 亲密度 / 心情,开心睁眼、委屈半垂带泪、生气压低 |
22
+ | 📝 **记事与提醒** | 说"十分钟后提醒我喝水",到点主动喊你 |
23
+ | 🍚 **能喂** | 点一下就喂白饭,会冒爱心、撒娇 |
24
+
25
+ > 个人作品,与 DeepSeek 官方无关。需要自备两个 API key(对话 + 语音识别),不是免费服务。
26
+
27
+ ## 速览
28
+
29
+ ```powershell
30
+ # 1) 装成 DSH 插件(推荐)
31
+ dsh plugin --profile web add "git+https://gitee.com/adengou/dsh-fish-pet.git"
32
+
33
+ # 2) 配两个 key(各写一行,只放 key 本身)
34
+ mkdir "$env:USERPROFILE\.dsh\fish-pet" -Force
35
+ Set-Content "$env:USERPROFILE\.dsh\fish-pet\deepseek.key" -Value "sk-..." -NoNewline
36
+ Set-Content "$env:USERPROFILE\.dsh\fish-pet\siliconflow.key" -Value "sk-..." -NoNewline
37
+
38
+ # 3) 想要更自然的朗读音色(可选,免费)
39
+ python -m pip install --upgrade edge-tts
40
+
41
+ # 4) 重启 dsh web,鱼就来了
42
+ ```
43
+
44
+ 不装 DSH 也能单独跑:
45
+
46
+ ```powershell
47
+ wscript.exe assets\start-pet.vbs # 桌面鱼
48
+ wscript.exe assets\start-ear.vbs # 语音耳朵(可选)
49
+ ```
50
+
14
51
 
15
52
  ## 特性
16
53
 
@@ -323,3 +360,10 @@ powershell -NoProfile -Command "$e=$null;$t=$null;[void][System.Management.Autom
323
360
  ## 许可
324
361
 
325
362
  MIT,见 [LICENSE](LICENSE)。
363
+
364
+ ## 分享与传播
365
+
366
+ 想帮这个项目被更多人看到?仓库里有现成的素材包:
367
+
368
+ - [docs/promote.md](docs/promote.md) —— V2EX / 掘金 / B 站 / 小红书 / 少数派的**现成文案**,复制即可用
369
+ - 欢迎提 issue、提 PR,也欢迎点个 Star ⭐
@@ -296,7 +296,7 @@ $C_EYEWHITE= '#FFFFFF'
296
296
  $C_PUPIL = '#132A45'
297
297
 
298
298
  # ---------- 读档 ----------
299
- $script:st = @{ x = $null; y = $null; dir = 1; scale = 1.0; feeds = 0; hunger = 30; intimacy = 10; mood = 'normal'; seen = $null }
299
+ $script:st = @{ x = $null; y = $null; dir = 1; scale = 1.0; feeds = 0; hunger = 30; intimacy = 10; mood = 'normal'; seen = $null; lastFeedAt = $null }
300
300
  if (Test-Path $StatePath) {
301
301
  try {
302
302
  $j = Get-Content $StatePath -Raw -Encoding UTF8 | ConvertFrom-Json
@@ -309,6 +309,7 @@ if (Test-Path $StatePath) {
309
309
  if ($null -ne $j.intimacy) { $script:st.intimacy = [double]$j.intimacy }
310
310
  if ($null -ne $j.mood) { $script:st.mood = [string]$j.mood }
311
311
  if ($null -ne $j.seen) { $script:st.seen = [string]$j.seen }
312
+ if ($null -ne $j.lastFeedAt) { $script:st.lastFeedAt = [string]$j.lastFeedAt }
312
313
  } catch { }
313
314
  }
314
315
 
@@ -338,6 +339,7 @@ $script:pulse = 1.0
338
339
  $script:lastPx = -9999; $script:lastPy = -9999
339
340
  $script:satiety = 0.0
340
341
  $script:feeds = [int]$script:st.feeds
342
+ $script:lastFeedAtStr = $script:st.lastFeedAt
341
343
  # ---- 情绪状态:饥饿 / 亲密度 / 心情 ----
342
344
  $script:hunger = [double]$script:st.hunger
343
345
  $script:intimacy = [double]$script:st.intimacy
@@ -659,7 +661,7 @@ function Save-State {
659
661
  x = [int]$script:x; y = [int]$script:y; dir = [int]$script:dir
660
662
  scale = [Math]::Round($script:scale, 3); feeds = [int]$script:feeds
661
663
  hunger = [Math]::Round($script:hunger, 1); intimacy = [Math]::Round($script:intimacy, 1)
662
- mood = [string]$script:mood; seen = (Get-Date).ToString('o')
664
+ mood = [string]$script:mood; seen = (Get-Date).ToString('o'); lastFeedAt = $script:lastFeedAtStr
663
665
  }
664
666
  try { ($obj | ConvertTo-Json -Compress) | Set-Content -Path $StatePath -Encoding UTF8 } catch { }
665
667
  }
@@ -667,6 +669,7 @@ function Save-State {
667
669
  function Invoke-Feed {
668
670
  try {
669
671
  $script:feeds += 1
672
+ $script:lastFeedAtStr = (Get-Date).ToString('o')
670
673
  $script:satiety += 1
671
674
  $script:hunger = [Math]::Max(0, $script:hunger - 30)
672
675
  $script:intimacy = [Math]::Min(100, $script:intimacy + 2)
@@ -1531,6 +1534,17 @@ function Start-Chat([string]$text) {
1531
1534
  Show-Bubble '…'
1532
1535
  $pn = $script:cfg.persona
1533
1536
  $replyLang = Get-ReplyLang $text
1537
+ # 喂食记忆:让鱼知道自己吃没吃过
1538
+ $feedAgoText = ''
1539
+ $feedAgoEn = ''
1540
+ if ($script:lastFeedAtStr) {
1541
+ try {
1542
+ $mins = [Math]::Round(((Get-Date) - [datetime]$script:lastFeedAtStr).TotalMinutes, 0)
1543
+ if ($mins -lt 3) { $feedAgoText = '刚刚'; $feedAgoEn = 'just now' }
1544
+ elseif ($mins -lt 60) { $feedAgoText = ('' + [int]$mins + ' 分钟前'); $feedAgoEn = ('' + [int]$mins + ' minutes ago') }
1545
+ else { $feedAgoText = ('' + [int][Math]::Round($mins / 60, 0) + ' 小时前'); $feedAgoEn = ('' + [int][Math]::Round($mins / 60, 0) + ' hours ago') }
1546
+ } catch { }
1547
+ }
1534
1548
  if ($replyLang -eq 'en') {
1535
1549
  $sys = 'YOU MUST REPLY IN ENGLISH ONLY, NO MATTER WHAT. You are a round, chubby blue fish living on the master''s Windows desktop. Your name is "' + $pn.nameEn + '" (in Chinese it is written 大肥鱼, said as Da Fei Yu). Your dad is Guangguang, your mom is Lili, your birthday is October 30 2026, you were born in Beihai, Guangxi, China. Answer questions about family/birthday/birthplace with these facts and never invent them. In English your name is always this one, never any other name; if earlier messages called you something different, correct them politely.'
1536
1550
  $sys = $sys + ' Reply ONLY in English, max 20 words, playful and a little tsundere, call the user "master", no emoji.'
@@ -1563,9 +1577,11 @@ function Start-Chat([string]$text) {
1563
1577
  } catch { }
1564
1578
  if ($replyLang -eq 'en') {
1565
1579
  $sys = $sys + ' Right now you feel ' + $moodDescEn + ', hunger about ' + [int]$script:hunger + ', closeness to the master about ' + [int]$script:intimacy + '. Let that show naturally, never state the numbers.'
1580
+ if ($feedAgoEn) { $sys = $sys + ' The master has fed you ' + [int]$script:feeds + ' times in total; the last feeding was ' + $feedAgoEn + '. If the master asks whether you have eaten, answer truthfully based on this.' }
1566
1581
  $sys = $sys + "`r`n`r`nIMPORTANT: Answer ONLY in English. Never write Chinese characters - not even your own name. Use your English name and write family names in pinyin (Guangguang, Lili). Everything you output must be English only."
1567
1582
  } else {
1568
1583
  $sys = $sys + ' 你现在的状态:' + $moodDesc + ',饥饿值约' + [int]$script:hunger + ',和主人的亲密度约' + [int]$script:intimacy + '。说话要自然带出这种状态,但不要报具体数字。'
1584
+ if ($feedAgoText) { $sys = $sys + ' 主人一共喂过你 ' + [int]$script:feeds + ' 次白饭,上次喂食是 ' + $feedAgoText + '。主人问起你吃没吃过,就照实说,别乱讲。' }
1569
1585
  }
1570
1586
  if ($replyLang -eq 'en') { Write-Err ('SYS-EN[' + $sys.Length + ']: ' + ($sys -replace "[\r\n]+", ' | ')) }
1571
1587
  $msgs = @(@{ role = 'system'; content = $sys })
@@ -0,0 +1,189 @@
1
+ # 传播素材包 · dsh-fish-pet
2
+
3
+ > 用途:把这个项目分享到各平台时,直接复制对应段落改一改就能发。
4
+ > 原则:**不夸大、不刷量、写清成本**。项目是个人作品,与 DeepSeek 官方无关。
5
+
6
+ ---
7
+
8
+ ## 一、30 秒电梯稿(任何场合都能用)
9
+
10
+ > 给 DeepSeek Harness 养的桌面宠物:一条住在 Windows 桌面上的 AI 蓝鱼。
11
+ > 不是网页贴图,是逐像素透明的置顶窗口,100KB 大小,纯 PowerShell + WinForms 手写绘制。
12
+ > 能听你说话(麦克风)、能回你聊天(DeepSeek)、能用中文语音念出来,还记得你交代过的事。
13
+
14
+ 一句话版:
15
+
16
+ > 「我在电脑桌面上养了条会说话的胖鱼,饿了会瘪嘴。」
17
+
18
+ ---
19
+
20
+ ## 二、各平台文案
21
+
22
+ ### 1. V2EX · 分享创造
23
+
24
+ **标题**:`[分享] 用 PowerShell 写了个桌面 AI 宠物:一条会听会说的鱼`
25
+
26
+ **正文**:
27
+
28
+ ```
29
+ 前阵子折腾 DeepSeek Harness,顺手做了个小玩意:一条住在 Windows 桌面上的 AI 鱼。
30
+
31
+ 技术上有意思的地方:
32
+ - 逐像素透明的置顶窗口(UpdateLayeredWindow + GDI+ 逐帧绘制),不是网页贴图
33
+ - 整个程序 100KB 左右,纯 PowerShell 5.1 + WinForms,没有第三方依赖
34
+ - 语音链路:WASAPI 连续采集 + 自研 VAD → 云端 Qwen3-ASR 识别 → DeepSeek 回复 → Edge TTS 朗读
35
+ - 朗读做了分段流水线:先念第一句,后面边播边合成,开口等待约 2 秒
36
+ - 会记情绪(饥饿/亲密度/心情),表情会跟着变:开心睁眼、委屈半垂带泪、生气压低
37
+ - 中英自动切换:说中文回中文,说英文回英文,音色也跟着换
38
+
39
+ 需要自己配两个 key(DeepSeek + 硅基流动),所以是自备 key 自备钱包,不是免费服务。
40
+
41
+ 仓库:https://gitee.com/adengou/dsh-fish-pet
42
+ GitHub:https://github.com/adengou/dsh-fish-pet
43
+
44
+ 欢迎提 issue 骂我代码烂,但求别骂鱼胖。
45
+ ```
46
+
47
+ **标签建议**:`分享创造` `桌面` `PowerShell` `AI`
48
+
49
+ ---
50
+
51
+ ### 2. 掘金 / 博客园 / 思否 · 技术长文
52
+
53
+ **标题候选**:
54
+ - `用 PowerShell 手写一个 100KB 的桌面 AI 宠物`
55
+ - `桌面宠物怎么做才不假?聊聊分层窗口、VAD 和 TTS 流水线`
56
+ - `从"能跑"到"灵敏":语音桌面宠物的 5 次性能优化`
57
+
58
+ **大纲**:
59
+
60
+ 1. 为什么要用 PowerShell 写桌宠(单文件、无依赖、Win10 自带)
61
+ 2. 逐像素透明窗口:`UpdateLayeredWindow` 怎么用,为什么不能用 `TransparencyKey`
62
+ 3. 绘制:GDI+ 逐帧画圆滚滚的鱼(附参数:身体椭圆、高光、眨眼弧线)
63
+ 4. 语音输入:WASAPI 连续采集 + VAD 判定(踩坑:一次性采集中途无法暂停,导致"自己听自己")
64
+ 5. 语音输出:Edge TTS 免费音色 → 常驻进程复用连接 → 分句流水线(4 秒 → 2 秒)
65
+ 6. 情绪系统:饥饿值/亲密度/心情如何影响语气与表情
66
+ 7. 踩坑清单:UTF-8 BOM、右键菜单闪退、`$g` 插值、泰文乱码
67
+ 8. 打包成 DSH 插件 + 发 npm 的流程
68
+
69
+ **引流技巧**:文末放仓库链接 + 一张动图,标题带"我踩了 X 个坑"这类具体数字。
70
+
71
+ ---
72
+
73
+ ### 3. B 站 · 短视频
74
+
75
+ **标题**:`桌面养了条会说话的鱼,还能自己记事儿`
76
+
77
+ **分镜脚本(45 秒)**:
78
+
79
+ | 时间 | 画面 | 旁白/字幕 |
80
+ | --- | --- | --- |
81
+ | 0-5s | 鱼在桌面游动、眨眼、吐泡泡 | 「我在电脑桌面上养了条鱼」 |
82
+ | 5-12s | 对麦克风说话,气泡出现中文回复,然后鱼开口念出来 | 「它听得懂我说什么」 |
83
+ | 12-20s | 切英文再问一次,鱼用英文回答 | 「说英文它也跟得上,还换成英文的嗓子」 |
84
+ | 20-28s | 右键菜单展开,点「加个提醒」 | 「还能记事儿,到点主动提醒你」 |
85
+ | 28-36s | 连续点几下喂食,鱼冒爱心 + 说「再来一碗嘛」 | 「饿了会瘪嘴,喂它还会撒娇」 |
86
+ | 36-45s | 仓库二维码 + 项目地址 | 「开源,GitHub/Gitee 都能找到」 |
87
+
88
+ **封面**:鱼的特写 + 大字「桌面养鱼」。
89
+
90
+ ---
91
+
92
+ ### 4. 小红书 · 生活向
93
+
94
+ **标题**:`桌面养了只会说话的胖鱼🐟 它饿了会瘪嘴`
95
+
96
+ **正文**:
97
+
98
+ ```
99
+ 本来想找个桌面宠物,结果自己写了一条…
100
+
101
+ 它住在电脑桌面最上层,会游来游去、会眨眼、会吐泡泡
102
+ 我说话它听得懂,还会用软软的声音回答我
103
+ 开心的时候眼睛亮亮的,饿了会瘪嘴,凶它一句就委屈
104
+
105
+ 最上头的是它记事儿——
106
+ 我说"十分钟后提醒我喝水",到点它真的会喊我
107
+
108
+ (自己写的,开源,仓库放评论区)
109
+ ```
110
+
111
+ **关键词**:`#桌面宠物` `#AI桌宠` `#桌面美化` `#程序员日常`
112
+
113
+ ---
114
+
115
+ ### 5. 少数派 / Matrix · 工具测评向
116
+
117
+ **标题**:`我在桌面上养了条 AI 鱼:一个 100KB 的开源桌面宠物`
118
+
119
+ **角度**:不写代码,写"用起来是什么感觉"——
120
+ - 和 Wallpaper Engine 那种静态桌宠的区别(这条会对话)
121
+ - 和网页版 AI 助手的区别(它在你桌面上,抬眼就能看到)
122
+ - 缺点要写:需要自己配 API key、只有 Windows、说话有 2 秒延迟
123
+
124
+ ---
125
+
126
+ ### 6. awesome 列表(长期曝光,适合 GitHub)
127
+
128
+ 可以直接提交的项目:
129
+
130
+ | 列表 | 提交方式 |
131
+ | --- | --- |
132
+ | `awesome-powershell` | PR 加一行到 "Projects" 区 |
133
+ | `awesome-windows` | PR 加一行到 "Desktop enhancements" |
134
+ | `awesome-desktop-apps` | PR 加一行 |
135
+ | `awesome-chatgpt` 系列(AI 应用类) | 视列表规则 |
136
+
137
+ **PR 描述模板**:
138
+
139
+ ```
140
+ Add dsh-fish-pet: a 100KB desktop AI pet for Windows written in PowerShell + WinForms.
141
+ - Translucent always-on-top window rendered with GDI+
142
+ - Voice chat: WASAPI capture + VAD → Qwen3-ASR → DeepSeek → Edge TTS
143
+ - Emotion system and reminders
144
+ Repo: https://github.com/adengou/dsh-fish-pet
145
+ ```
146
+
147
+ ---
148
+
149
+ ## 三、Gitee 站内优化清单
150
+
151
+ - [ ] 仓库简介填一句话:「给 DeepSeek Harness 养的桌面 AI 鱼,能听能说能记事」
152
+ - [ ] 加 Topics:`desktop-pet` `windows` `powershell` `winforms` `ai` `text-to-speech` `voice-assistant` `deepseek` `desktop-pet-windows`
153
+ - [ ] README 顶部放动图(比静图点击率高 2~3 倍)
154
+ - [ ] 申请 Gitee 推荐位 / GVP 评选
155
+ - [ ] 打 tag 发 Release(0.2.7),附件放 tgz 包
156
+
157
+ ---
158
+
159
+ ## 四、发布节奏建议
160
+
161
+ | 时间 | 动作 |
162
+ | --- | --- |
163
+ | 第 1 天 | Gitee 优化完 + 发 V2EX 一帖 |
164
+ | 第 2-3 天 | 掘金发技术长文(文里嵌动图) |
165
+ | 第 4 天 | B 站/小红书发短视频(同一素材剪两版) |
166
+ | 第 2 周 | 向 awesome 列表提 PR |
167
+ | 之后 | 每次发版同步一条动态,别刷屏 |
168
+
169
+ ---
170
+
171
+ ## 五、必须写清楚的三件事(避免招黑)
172
+
173
+ 1. **成本**:每轮对话走 DeepSeek、语音识别走硅基流动,用户要自备 key,不是免费服务
174
+ 2. **平台**:只支持 Windows 10/11
175
+ 3. **延迟**:说完到开口约 2 秒,不是实时
176
+
177
+ ---
178
+
179
+ ## 六、动图录制指引(自己录,5 分钟)
180
+
181
+ 1. 把桌面清空(关掉聊天窗口,只留壁纸)
182
+ 2. 打开鱼,让它游到一个干净的角落
183
+ 3. 用 **ScreenToGif**(免费)或 Windows 自带 `Win+G` 录 8~12 秒
184
+ 4. 录三段素材:
185
+ - 游动 + 眨眼 + 吐泡泡
186
+ - 说一句话 → 气泡出现 → 语音念出
187
+ - 右键菜单展开
188
+ 5. 导出 GIF(宽 600px、10fps、< 3MB)放 `docs/demo.gif`
189
+ 6. README 第一行换成 `![demo](docs/demo.gif)`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-fish-pet",
3
- "version": "0.2.7",
3
+ "version": "0.2.9",
4
4
  "description": "Desktop blue fish pet for DeepSeek Harness: per-pixel transparent WinForms window, text chat, and cloud speech-to-text voice conversation.",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",