dsh-her 0.0.1 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +113 -0
- package/cordis.patch.yml +5 -0
- package/examples/workshop/README.md +20 -0
- package/lib/client.js +1602 -0
- package/lib/core/character.js +50 -0
- package/lib/core/cues.js +62 -0
- package/lib/core/echo.js +27 -0
- package/lib/core/index.js +10 -0
- package/lib/core/paths.js +14 -0
- package/lib/core/prompt.js +63 -0
- package/lib/core/sentences.js +115 -0
- package/lib/core/speakable.js +26 -0
- package/lib/core/voices.js +43 -0
- package/lib/core/wav.js +71 -0
- package/lib/core/workshop.js +330 -0
- package/lib/dsh/api.js +156 -0
- package/lib/dsh/body-install.js +137 -0
- package/lib/dsh/body-launcher.js +48 -0
- package/lib/dsh/config.js +27 -0
- package/lib/dsh/her-session.js +282 -0
- package/lib/dsh/import-status.js +6 -0
- package/lib/dsh/plugin.js +1010 -0
- package/lib/dsh/workshop.js +222 -0
- package/lib/index.js +11 -0
- package/lib/memory/digest.js +119 -0
- package/lib/memory/search.js +52 -0
- package/lib/memory/store.js +267 -0
- package/lib/protocol/index.js +39 -0
- package/lib/server/brain-server.js +219 -0
- package/lib/types/core/character.d.ts +32 -0
- package/lib/types/core/cues.d.ts +20 -0
- package/lib/types/core/echo.d.ts +10 -0
- package/lib/types/core/index.d.ts +10 -0
- package/lib/types/core/paths.d.ts +11 -0
- package/lib/types/core/prompt.d.ts +39 -0
- package/lib/types/core/sentences.d.ts +40 -0
- package/lib/types/core/speakable.d.ts +6 -0
- package/lib/types/core/voices.d.ts +23 -0
- package/lib/types/core/wav.d.ts +9 -0
- package/lib/types/core/workshop.d.ts +156 -0
- package/lib/types/dsh/api.d.ts +163 -0
- package/lib/types/dsh/body-install.d.ts +58 -0
- package/lib/types/dsh/body-launcher.d.ts +28 -0
- package/lib/types/dsh/config.d.ts +34 -0
- package/lib/types/dsh/her-session.d.ts +215 -0
- package/lib/types/dsh/import-status.d.ts +17 -0
- package/lib/types/dsh/plugin.d.ts +34 -0
- package/lib/types/dsh/workshop.d.ts +94 -0
- package/lib/types/index.d.ts +11 -0
- package/lib/types/memory/digest.d.ts +33 -0
- package/lib/types/memory/search.d.ts +17 -0
- package/lib/types/memory/store.d.ts +132 -0
- package/lib/types/protocol/index.d.ts +434 -0
- package/lib/types/server/brain-server.d.ts +71 -0
- package/lib/types/voice/cloud-key.d.ts +10 -0
- package/lib/types/voice/cosyvoice.d.ts +47 -0
- package/lib/types/voice/edge.d.ts +52 -0
- package/lib/types/voice/engine.d.ts +30 -0
- package/lib/types/voice/models.d.ts +21 -0
- package/lib/types/voice/speech-queue.d.ts +55 -0
- package/lib/types/voice/voice.d.ts +75 -0
- package/lib/types/voice/worker.d.ts +37 -0
- package/lib/voice/cloud-key.js +23 -0
- package/lib/voice/cosyvoice.js +194 -0
- package/lib/voice/edge.js +199 -0
- package/lib/voice/engine.js +101 -0
- package/lib/voice/models.js +69 -0
- package/lib/voice/speech-queue.js +118 -0
- package/lib/voice/voice.js +171 -0
- package/lib/voice/worker.js +47 -0
- package/package.json +61 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 AIcivilization
|
|
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.
|
package/README.md
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
# dsh-her
|
|
2
|
+
|
|
3
|
+
**DSH 桌面女友,[DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness)(dsh)插件。** 她住在你真正的桌面上(浮在所有窗口上面,或者住在壁纸里),能聊天、记得你。支持 macOS / Windows。
|
|
4
|
+
|
|
5
|
+
> 开发中(P1)。设计和计划见 [docs/](docs/),从 [docs/P1开发计划.md](docs/P1开发计划.md) 看起。
|
|
6
|
+
|
|
7
|
+
## 进度
|
|
8
|
+
|
|
9
|
+
| 里程碑 | 状态 |
|
|
10
|
+
|---|---|
|
|
11
|
+
| M0 风险验证 | ✅ mac 通过([记录](docs/M0验证记录.md));Windows 待测 |
|
|
12
|
+
| M1 大脑与身体打通(文字) | ✅ mac 通过([记录](docs/M1记录.md));休息模式 CPU 2.2% |
|
|
13
|
+
| M2 语音 | ✅ mac 通过([记录](docs/M2记录.md));说完到她开口中位数约 2.5 秒;云端克隆音色待接 |
|
|
14
|
+
| M3 外形包与姿势图 | ✅ mac 通过([记录](docs/M3记录.md));用合成测试包验证,"想看 JK" 全流程跑通;待真实素材校准 |
|
|
15
|
+
| M4 内置记忆 | ✅ mac 通过([记录](docs/M4记录.md));换全新会话仍记得,删掉的事不再提 |
|
|
16
|
+
| M5 向导与管理页 | ✅ mac 通过([记录](docs/M5记录.md));dsh 侧栏"她":7 步向导 + 管理页。身体的下载安装挪到 M6 |
|
|
17
|
+
| M6 打磨与发布 | 进行中([记录](docs/M6记录.md)):mac 身体打包、一键下载安装和自动更新、Edge 声音不再依赖系统 Python;签名公证、Windows、省电待做 |
|
|
18
|
+
|
|
19
|
+
## 组成
|
|
20
|
+
|
|
21
|
+
- **大脑**(本包,dsh 插件):她在 dsh 里的专属会话"她 · 名字"、语音(本地识别 + 云端合成)、身体协议服务(`ws://127.0.0.1:38100` 起)。
|
|
22
|
+
- **身体**([body/](body/),Electron 桌面程序):她的形象、字幕气泡、输入框、三种窗口模式。
|
|
23
|
+
|
|
24
|
+
两者之间的协议见 [docs/身体协议.md](docs/身体协议.md)。
|
|
25
|
+
|
|
26
|
+
## 怎么和她说话
|
|
27
|
+
|
|
28
|
+
- **说话**:按 **⌃⌥空格**(Windows:**Ctrl+Alt+空格**)说一句,说完自动发出;她说话时你开口就能打断她。菜单里可以勾"一直在听"。
|
|
29
|
+
- **打字**:双击她(或菜单"打字和她说")打开输入框,回车发送,Esc 关闭。
|
|
30
|
+
- 在 dsh 里打开"她 · 名字"会话直接打字,或在任意会话里用 `/her 想说的话`:她都会在桌面上回答。
|
|
31
|
+
- 在她身上按住可以拖动;右键她(或点菜单栏的"她")可以切换"浮在最上层 / 住在壁纸里 / 普通窗口",或退出。
|
|
32
|
+
- **形象**:一个形象可以有好几个场景(窗边、书桌、卧室……),按时间和你在不在自动换,也可以跟她说"去卧室吧"。「她」页面的**形象工坊**带你做自己的形象:选好她的样子和场景,它把每张图、每段视频的提示词写进「文稿 / dsh-her 素材」里的文件夹,生成好再一键导入。见 [docs/形象工坊与多场景.md](docs/形象工坊与多场景.md)。
|
|
33
|
+
- **她记得的事**:她会自己记、自己查,每天整理一次写日记。`/her 记忆` 查看,`/her 忘掉 f3` 删除,`/her 导出记忆` 导出。也可以直接跟她说"把那件事忘掉"。文件都在 `~/.dsh-her/characters/<角色>/memory/`。
|
|
34
|
+
|
|
35
|
+
## 开发
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
npm install
|
|
39
|
+
npm test
|
|
40
|
+
npm run build
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
身体:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
cd body
|
|
47
|
+
npm install
|
|
48
|
+
npm run build
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
打成一个可以分发的身体程序(mac;输出到 `release/`:zip 和 `body-latest.json`,传到 GitHub Release 后,插件会从 `body.releases` 下载安装、自动更新):
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
cd body
|
|
55
|
+
npm run package
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
在一个单独的测试 profile 里运行(数据放在 `~/.dsh-her-dev`,不碰正式的 `~/.dsh-her`):
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
dsh plugin --profile her-dev add link:/path/to/dsh-her
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
profile 的 `cordis.patch.yml`:
|
|
65
|
+
|
|
66
|
+
```yaml
|
|
67
|
+
- id: dsh-her
|
|
68
|
+
name: dsh-her
|
|
69
|
+
config:
|
|
70
|
+
home: ~/.dsh-her-dev
|
|
71
|
+
body:
|
|
72
|
+
launch: auto # dsh 启动 3 秒后若没有身体连上,就拉起 body/
|
|
73
|
+
pack: '' # 外形包目录;空 = 身体默认(~/dsh-her-dev-assets/bg2-stacked)
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
dsh --profile her-dev --no-open --port 3191
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
她的声音默认用微软 Edge 的声音(通过开源工具 edge-tts,免费,要联网);找不到已装好的 edge-tts 时会自动装进 `$DSH_HER_HOME/edge-tts`。也可以在"她"页面里换成阿里云百炼 CosyVoice 的声音,key 放进 mac 钥匙串(或环境变量 `DASHSCOPE_API_KEY`):
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
security add-generic-password -a dsh-her -s dsh-her-dashscope -w
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
本地语音识别模型(约 170 MB,下载到 `$DSH_HER_HOME/models`),以及测速和各音色试听样本:
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
DSH_HER_HOME=~/.dsh-her-dev npm run voice:models
|
|
90
|
+
DSH_HER_HOME=~/.dsh-her-dev npm run voice:bench
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
导入外形包(按 [docs/素材生成提示词.md](docs/素材生成提示词.md) 命名的一个文件夹):
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
node body/scripts/import-pack.ts ~/我的角色 --packs ~/.dsh-her/packs --name 名字
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
合成测试包(色块小人,绿幕;加 `--scene` 是带空场景图的房间):
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
node body/scripts/make-test-pack.mjs ~/dsh-her-dev-assets/test-doll-src
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
开发用素材都放在 `~/dsh-her-dev-assets/`,**不进仓库**。第三方演示素材由 `body/scripts/make-dev-pack.mjs` 转换。
|
|
106
|
+
|
|
107
|
+
## 隐私
|
|
108
|
+
|
|
109
|
+
不收集任何使用数据。身体只连本机 `127.0.0.1`,需要令牌(`<home>/token`,权限 600)。
|
|
110
|
+
|
|
111
|
+
## 许可
|
|
112
|
+
|
|
113
|
+
MIT
|
package/cordis.patch.yml
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# 形象工坊的示例
|
|
2
|
+
|
|
3
|
+
「她」页面 → 形象工坊里每一张卡片都有"示例",从这个文件夹读。文件还没放的时候,卡片上显示一个占位框,写着要放哪个文件。
|
|
4
|
+
|
|
5
|
+
样板间的素材做好后,挑出下面这些文件放进来(名字要一样):
|
|
6
|
+
|
|
7
|
+
| 文件 | 在哪张卡片 | 放什么 |
|
|
8
|
+
|---|---|---|
|
|
9
|
+
| `look.png` | 1. 她长什么样 | 做好的她,让人一眼看到角色卡填出来是什么样 |
|
|
10
|
+
| `reference.png` | 2. 参考图 | 参考图:纯色背景、全身、正面站立 |
|
|
11
|
+
| `desk.mp4` | 3. 桌宠 | 一段桌宠片段(绿幕原片,几秒就行) |
|
|
12
|
+
| `desk-keyed.png` | 3. 桌宠 | 抠好后浮在桌面上的截图 |
|
|
13
|
+
| `scene-plate.png` | 4. 场景 | 一个场景的全屏照片 |
|
|
14
|
+
| `scene-crop.png` | 4. 场景 | 这个场景框好的人物区(crop.png) |
|
|
15
|
+
| `scene.mp4` | 4. 场景 | 这个场景的一段片段 |
|
|
16
|
+
| `result.png` | 5. 生成、导入 | 导入后桌面上的样子 |
|
|
17
|
+
|
|
18
|
+
图片用 PNG(文件名照上表),视频用 MP4(H.264),每个文件尽量在 5MB 以内。
|
|
19
|
+
|
|
20
|
+
**仓库只放代码**:这些图片和视频不进 git(`.gitignore` 挡掉了),放在本机的 `~/.dsh-her/examples/workshop/`(同名文件优先用那里的)。正式发布时,它们和身体程序一样作为 Release 的附件发出去,由插件下载到这个文件夹(还没做)。
|