dsh-dafeiyu-emotion 0.3.2 → 0.3.3
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 +21 -0
- package/README.md +12 -1
- package/cordis.patch.yml +25 -20
- package/docs/MARKETPLACE.md +8 -2
- package/docs/RELEASE-0.3.3.md +43 -0
- package/docs/preview.svg +95 -95
- package/lib/client.js +517 -16
- package/package.json +2 -2
- package/src/index.js +517 -17
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.3.3 — 2026-11-07
|
|
4
|
+
|
|
5
|
+
- Added `petReactionEnabled` (default on): while a spoken reply plays, the local `dsh-dafeiyu` pet enters its thinking animation; when playback ends it plays the success celebration. The bridge uses a fake session id on the public session event bus, never mutates the real session, auto-cleans after 2.6 s and has a 60 s safety end.
|
|
6
|
+
- Added `petSayEnabled` (default on): reply text is typed into the pet bubble through the local `dsh-dafeiyu` HelperProcess bridge (`state` THINKING, repeated `task` messages, final `pulse` SUCCESS). The emotion bundle mounts before the pet so a `HelperProcess.start` hook can capture the bridge; old installs need a reinstall/restart. This bypasses the reducer's session selection and multi-task card. It is bubble text, not a new speaking animation — true lip-sync still needs new pet art/animation frames.
|
|
7
|
+
- Pet reaction lifecycle is now idempotent: duplicate `end` is ignored, `end` still works after the feature is disabled, the safety end is 180 s, unmount/session switch sends the end, and host teardown sends IDLE to any active bridge.
|
|
8
|
+
- Fixed `/context?session=` returning another session's last analysis, the 3-sample trend comparing against zero, saving baseline-adjusted energy/pause as the next baseline, emotion-adaptive TTS falling back to neutral after the post-send reset, the global (not per-session) `ttsOnlyAfterVoice` window, bare-command `ttsReady` false positives, and the over-broad privacy cleanup prefix.
|
|
9
|
+
- Added `POST /plugins/dsh-dafeiyu-emotion/pet/reaction` (`start` / `end`) for the client-side TTS lifecycle. `start` may carry the reply text for the local pet bubble; audio is never sent, and `end` sends only the phase/session id.
|
|
10
|
+
- Fixed a stale TTS failure falling back to browser speech after a newer reply started, which could end the newer pet reaction early.
|
|
11
|
+
- Added a per-result emotion evidence card: speech rate, pause ratio, pitch range, energy, text-vs-prosody source, confidence and the low-confidence ask-first note.
|
|
12
|
+
- Added a one-click personal baseline from the evidence card, stored locally and sent with later analyses; the lightweight analyzer now normalizes pitch, energy, pause and pitch variation against that baseline.
|
|
13
|
+
- Added a per-session emotion trend (`更紧绷` / `更放松` / `更积极` / `更低落`) after three analyses, exposed in the analyze response, the evidence card and `/context`.
|
|
14
|
+
- `/context` now accepts `?session=` and returns `history` plus `trend`; `GET /events` also emits `kind: "context"` for other plugins.
|
|
15
|
+
- `buildPrompt` now adds an explicit “do not assert, confirm first” clause when confidence is below 0.4.
|
|
16
|
+
- Added emotion-adaptive TTS (`ttsEmotionAdapt`, default on): the reply voice nudges rate and pitch from the last detected emotion — brighter for happy, slower and lower for sad.
|
|
17
|
+
- Added a privacy-panel cleanup action and `POST /plugins/dsh-dafeiyu-emotion/privacy/cleanup` to remove orphaned plugin temp directories older than ten minutes.
|
|
18
|
+
- Fixed partial configs disabling TTS even though the schema default is `true`; a missing `ttsEnabled` now keeps the documented local-Piper default.
|
|
19
|
+
- Fixed a disabled plugin still broadcasting assistant text to the spoken-reply stream when TTS was left enabled.
|
|
20
|
+
- Fixed assistant events without a session id leaking into every open DSH window; unscoped events are now ignored.
|
|
21
|
+
- Fixed bare `edge-tts` / `piper` commands being reported unavailable by `/health` just because `existsSync()` cannot see PATH.
|
|
22
|
+
- Fixed a host that returns `false` from `submit()` being treated as a successful delivery; the result now offers retry instead of hiding the send button.
|
|
23
|
+
|
|
3
24
|
## 0.3.2
|
|
4
25
|
|
|
5
26
|
- Added `ttsOnlyAfterVoice` (default `true`): spoken replies are limited to assistant messages within two minutes of a voice input, so normal coding chats do not read every answer aloud.
|
package/README.md
CHANGED
|
@@ -73,10 +73,16 @@
|
|
|
73
73
|
- 🎛️ DSH 设置页里的完整设置卡片:启用、语言、增强后端、超时和录音上限;
|
|
74
74
|
- 🧭 安装 Better Sidebar 后,可把「情绪耳朵」固定到右侧边栏;
|
|
75
75
|
- 🎭 共情策略四档:温柔、直接、幽默、简洁;
|
|
76
|
+
- 🧭 情绪证据卡:展开查看语速、停顿、音高、能量和文本线索,置信度低时明确提示“先追问”;
|
|
77
|
+
- 🎯 个人基线:把一次平静说话设为基线,轻量模式按你的个人音高/能量归一化;
|
|
76
78
|
- 📈 多段语音的情绪时间线,可悬停查看每段文本、情绪和置信度;
|
|
79
|
+
- 📈 会话情绪趋势:连续几次语音后给出“更紧绷 / 更放松 / 更积极”等走向;
|
|
77
80
|
- 🔐 设置页内的隐私与运行状态:最近音频大小、模型加载、worker PID、临时文件清理;
|
|
78
|
-
- 🔌 本机 `/context`
|
|
81
|
+
- 🔌 本机 `/context` 接口,其他插件可以读取最近一次情绪上下文、趋势和最近记录;
|
|
79
82
|
- 🔊 大肥鱼回复语音:Piper 本地模型默认朗读,Edge / 浏览器语音可选;
|
|
83
|
+
- 🎚️ 情绪自适应语音:按上一句情绪微调语速和音调,喜悦更亮、低落更慢;
|
|
84
|
+
- 🐋 桌宠回复互动:朗读时让桌面大肥鱼进入思考动画,气泡逐字显示回复,读完后庆祝;需要安装 `dsh-dafeiyu` 0.1.23+;
|
|
85
|
+
- 🧹 隐私面板一键清理:删除 10 分钟前遗留的临时音频目录;
|
|
80
86
|
- 🐋 大肥鱼主题的“鱼耳”入口,和普通对话共用同一个 composer;
|
|
81
87
|
- 🧠 情绪标签:喜悦 / 低落 / 生气 / 紧张 / 惊讶 / 厌烦 / 平静;
|
|
82
88
|
- 📈 额外给出 confidence、valence、arousal 和语气摘要;
|
|
@@ -86,6 +92,8 @@
|
|
|
86
92
|
- 🧩 大肥鱼桌面角色由 `dsh-dafeiyu` 提供,本插件负责“听觉与情绪”;
|
|
87
93
|
- 🛠️ 如果情绪分析失败,会保留明确错误,不会假装成功。
|
|
88
94
|
|
|
95
|
+
> 桌宠互动走 `dsh-dafeiyu` 的 HelperProcess 协议:`state` 思考、`task` 逐字气泡、`pulse` 庆祝。新版 bundle 把情感插件排在 `dsh-dafeiyu` 之前以安装桥接钩子;旧安装需要重装并重启 DSH。嘴型同步仍需要新的角色动画素材。
|
|
96
|
+
|
|
89
97
|
## 安装
|
|
90
98
|
|
|
91
99
|
### 通过 1024Store
|
|
@@ -213,6 +221,9 @@ python -m pip install piper-tts
|
|
|
213
221
|
| `language` | `zh` | 识别语言:`zh` / `en` / `auto` |
|
|
214
222
|
| `empathyStyle` | `gentle` | 共情策略:`gentle` / `direct` / `humorous` / `concise` |
|
|
215
223
|
| `ttsEnabled` | `true` | 是否朗读大肥鱼回复 |
|
|
224
|
+
| `ttsEmotionAdapt` | `true` | 按上一句情绪微调语速和音调 |
|
|
225
|
+
| `petReactionEnabled` | `true` | 朗读时驱动本地大肥鱼思考/庆祝 |
|
|
226
|
+
| `petSayEnabled` | `true` | 朗读时把回复文本逐字显示在大肥鱼气泡里 |
|
|
216
227
|
| `ttsOnlyAfterVoice` | `true` | 只朗读录音后两分钟内的回复 |
|
|
217
228
|
| `ttsEngine` | `piper` | `piper` 本地 / `edge` 在线 / `browser` 系统语音 |
|
|
218
229
|
| `ttsVoice` | `zh-CN-XiaoyiNeural` | Edge TTS 音色 |
|
package/cordis.patch.yml
CHANGED
|
@@ -1,4 +1,29 @@
|
|
|
1
1
|
- insert:
|
|
2
|
+
# Emotion mounts before the pet so its top-level HelperProcess.start hook
|
|
3
|
+
# is in place when dsh-dafeiyu creates the desktop bridge.
|
|
4
|
+
- id: dsh-dafeiyu-emotion
|
|
5
|
+
name: dsh-dafeiyu-emotion
|
|
6
|
+
config:
|
|
7
|
+
enabled: true
|
|
8
|
+
backendRoot: ""
|
|
9
|
+
pythonPath: ""
|
|
10
|
+
language: zh
|
|
11
|
+
empathyStyle: gentle
|
|
12
|
+
ttsEnabled: true
|
|
13
|
+
ttsEmotionAdapt: true
|
|
14
|
+
petReactionEnabled: true
|
|
15
|
+
petSayEnabled: true
|
|
16
|
+
ttsOnlyAfterVoice: true
|
|
17
|
+
ttsEngine: piper
|
|
18
|
+
ttsVoice: zh-CN-XiaoyiNeural
|
|
19
|
+
ttsRate: "+6%"
|
|
20
|
+
ttsPitch: "+12Hz"
|
|
21
|
+
ttsCommand: ""
|
|
22
|
+
ttsPiperModel: ""
|
|
23
|
+
ttsPiperCommand: ""
|
|
24
|
+
maxAudioBytes: 12582912
|
|
25
|
+
startupTimeoutMs: 180000
|
|
26
|
+
requestTimeoutMs: 180000
|
|
2
27
|
- id: dsh-dafeiyu
|
|
3
28
|
name: dsh-dafeiyu
|
|
4
29
|
config:
|
|
@@ -21,23 +46,3 @@
|
|
|
21
46
|
clientTarget: auto
|
|
22
47
|
balanceEnabled: true
|
|
23
48
|
balanceSource: auto
|
|
24
|
-
- id: dsh-dafeiyu-emotion
|
|
25
|
-
name: dsh-dafeiyu-emotion
|
|
26
|
-
config:
|
|
27
|
-
enabled: true
|
|
28
|
-
backendRoot: ""
|
|
29
|
-
pythonPath: ""
|
|
30
|
-
language: zh
|
|
31
|
-
empathyStyle: gentle
|
|
32
|
-
ttsEnabled: true
|
|
33
|
-
ttsOnlyAfterVoice: true
|
|
34
|
-
ttsEngine: piper
|
|
35
|
-
ttsVoice: zh-CN-XiaoyiNeural
|
|
36
|
-
ttsRate: "+6%"
|
|
37
|
-
ttsPitch: "+12Hz"
|
|
38
|
-
ttsCommand: ""
|
|
39
|
-
ttsPiperModel: ""
|
|
40
|
-
ttsPiperCommand: ""
|
|
41
|
-
maxAudioBytes: 12582912
|
|
42
|
-
startupTimeoutMs: 180000
|
|
43
|
-
requestTimeoutMs: 180000
|
package/docs/MARKETPLACE.md
CHANGED
|
@@ -41,9 +41,12 @@ https://github.com/LiDu-china/dsh-dafeiyu-emotion/releases/download/v0.2.3/dsh-d
|
|
|
41
41
|
3. 优先复用 DSH 自带 Voice Input/SenseVoice 做本地转写;
|
|
42
42
|
4. 浏览器提取语速、停顿、基频、音高变化、能量等声学特征;
|
|
43
43
|
5. 可选中英文情绪词表与声学原型融合,输出情绪、置信度、愉悦度、唤醒度;
|
|
44
|
-
6. 生成“先承接情绪、再回答问题”的受控 prompt
|
|
44
|
+
6. 生成“先承接情绪、再回答问题”的受控 prompt;可展开情绪证据卡,置信度低时先追问确认;
|
|
45
45
|
7. 自动填入并发送到当前会话;
|
|
46
|
-
8.
|
|
46
|
+
8. 可用一次平静说话设置个人基线,轻量模式按个人音高/能量归一化;
|
|
47
|
+
9. 连续几次语音后生成会话趋势,并通过 `/context` 与 `kind:"context"` SSE 提供给其他插件;
|
|
48
|
+
10. 朗读回复时通过本地 HelperProcess 协议驱动 `dsh-dafeiyu`:思考 → 逐字气泡 → 庆祝;音频从不发送;
|
|
49
|
+
11. 如果本机部署了 VoiceSense,可切换到 SenseVoice + emotion2vec 增强模式。
|
|
47
50
|
|
|
48
51
|
插件不常驻监听、不读屏幕、不声称读心。音频只进入本机临时目录,分析结束后删除。
|
|
49
52
|
|
|
@@ -65,6 +68,7 @@ https://github.com/LiDu-china/dsh-dafeiyu-emotion/releases/download/v0.2.3/dsh-d
|
|
|
65
68
|
- Microphone permission
|
|
66
69
|
- Lightweight mode: enable DSH Voice Input and prepare its local model
|
|
67
70
|
- Enhanced mode: a local VoiceSense checkout with `.venv-ser` and cached models
|
|
71
|
+
- Optional pet reaction: `dsh-dafeiyu` 0.1.23+ and the emotion plugin mounted first (the bundled patch does this; reinstall/restart old installs)
|
|
68
72
|
|
|
69
73
|
## Install
|
|
70
74
|
|
|
@@ -78,6 +82,8 @@ Published as `dsh-dafeiyu-emotion@0.3.2` on npm. The 1024Store entry refreshes i
|
|
|
78
82
|
|
|
79
83
|
No audio upload. No screen capture. No persistent microphone. Temporary WAV is deleted after analysis.
|
|
80
84
|
|
|
85
|
+
The optional pet reaction sends `start` / `end`, a session id, and (on `start`) the reply text to the local host so the pet can type it into its bubble. Audio is never sent to the pet, and the text is never uploaded to a cloud service.
|
|
86
|
+
|
|
81
87
|
## Maintainer
|
|
82
88
|
|
|
83
89
|
[@LiDu-china](https://github.com/LiDu-china)
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
## 0.3.3
|
|
2
|
+
|
|
3
|
+
大肥鱼互动与情绪上下文修复版。
|
|
4
|
+
|
|
5
|
+
### 大肥鱼气泡互动
|
|
6
|
+
|
|
7
|
+
- 新增 `petSayEnabled`,默认开启:助手语音回复播放时,本地大肥鱼气泡会逐字显示 `正在说:<回复文本>`。
|
|
8
|
+
- 通过 `dsh-dafeiyu` 的 HelperProcess bridge 直接发送 `state` / `task` / `pulse` 协议消息,不再伪造会话,也不会在真实会话里留下多任务卡。
|
|
9
|
+
- 回复开始时大肥鱼进入思考动画,结束时播放成功庆祝和音效。
|
|
10
|
+
- 新增 `petReactionEnabled`,默认开启;可在设置里单独关闭动画或气泡文本。
|
|
11
|
+
- `/health` 新增 `petBridgeReady`,用于确认 HelperProcess bridge 是否已挂上。
|
|
12
|
+
- 情绪插件现在排在 `dsh-dafeiyu` 之前挂载,确保能捕获桌宠启动时创建的 bridge。
|
|
13
|
+
|
|
14
|
+
> 从旧版本升级后必须完全退出并重启 the agent harness,再确认 `/health` 里 `petBridgeReady: true`。当前是思考动画、逐字气泡和结束庆祝,不是嘴型同步;真正的口型动画仍需要新的桌宠帧或协议。
|
|
15
|
+
|
|
16
|
+
### 情绪上下文与稳定性
|
|
17
|
+
|
|
18
|
+
- 修复 `/context?session=` 在未知会话时错误返回其他会话 `lastAnalysis` 的问题。
|
|
19
|
+
- 情绪趋势改为至少 4 个样本才计算,避免 3 个样本拿 0 当基线。
|
|
20
|
+
- 个人基线保存原始 `calibration` 特征,避免下一轮重复归一化。
|
|
21
|
+
- 情绪自适应 TTS 不再在发送后重置为 neutral,会保留最近 120 秒的情绪。
|
|
22
|
+
- `ttsOnlyAfterVoice` 改为按会话独立计时。
|
|
23
|
+
- 裸 `ttsReady` 命令改用 `where` / `which` 探测并缓存,避免 PATH 命令误判。
|
|
24
|
+
- 隐私清理只匹配插件自己的 `dsh-dafeiyu-emotion-*` 和 `dsh-dafeiyu-tts-*` 临时目录。
|
|
25
|
+
- 修复音频 blob URL 在卸载或失败时未释放的问题。
|
|
26
|
+
- 证据卡不再把缺失值显示成 `0`。
|
|
27
|
+
- 修复 TTS 失败回退可能提前结束新回复互动的问题。
|
|
28
|
+
- 桌宠互动 `end` 幂等;关闭功能、切换会话、客户端卸载和宿主 teardown 都会正确收尾。
|
|
29
|
+
|
|
30
|
+
### 验证
|
|
31
|
+
|
|
32
|
+
- `npm test`:11 个测试文件全部通过。
|
|
33
|
+
- `npm run check`:通过。
|
|
34
|
+
- `python -m py_compile backend/voice_worker.py`:通过。
|
|
35
|
+
- `npm pack --dry-run`:发布包不包含测试与演示素材。
|
|
36
|
+
|
|
37
|
+
### 安装 / 升级
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
dsh plugin --profile desktop add dsh-dafeiyu-emotion
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
升级后请完全退出并重新启动 the agent harness。
|