dsh-dot-life 0.10.16 → 0.10.17

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.
Files changed (39) hide show
  1. package/README.md +145 -145
  2. package/cordis.patch.yml +118 -118
  3. package/docs/COMPUTER-DESIGN.md +88 -88
  4. package/docs/DESIGN.md +191 -191
  5. package/docs/INTERLUDE-DESIGN.md +102 -102
  6. package/docs/ROADMAP.md +96 -96
  7. package/docs/computer.md +213 -213
  8. package/docs/interlude.md +142 -142
  9. package/docs/memory.md +67 -67
  10. package/docs/phone.md +68 -68
  11. package/docs/qq.md +105 -105
  12. package/examples/canon.minase-style.json +30 -30
  13. package/lib/client.js +669 -669
  14. package/package.json +88 -88
  15. package/scripts/check-mac-aio.sh +73 -73
  16. package/scripts/check-mac.sh +116 -116
  17. package/scripts/check-windows.ps1 +226 -226
  18. package/src/computer/audit.js +29 -29
  19. package/src/computer/backends/docker.js +92 -92
  20. package/src/computer/backends/microsandbox.js +242 -242
  21. package/src/computer/backends/proxy.js +25 -25
  22. package/src/computer/docker.js +45 -45
  23. package/src/computer/gate.js +124 -124
  24. package/src/computer/key.js +47 -47
  25. package/src/computer/live-view.js +157 -157
  26. package/src/computer/subprocess.js +102 -102
  27. package/src/computer/ui-host.js +3 -3
  28. package/src/computer/vm.js +349 -349
  29. package/src/dot/core.js +590 -590
  30. package/src/dot/panel.js +153 -153
  31. package/src/interlude/core.js +958 -958
  32. package/src/memory/memory.js +615 -615
  33. package/src/memory/store.js +490 -490
  34. package/src/phone/live-view.js +133 -133
  35. package/src/phone/notifications.js +124 -124
  36. package/src/phone/phone.js +593 -570
  37. package/src/qq/qq.js +1029 -1029
  38. package/src/tool-prefixes.js +11 -11
  39. package/src/web-auth.js +32 -32
package/README.md CHANGED
@@ -1,145 +1,145 @@
1
- # dsh-dot
2
-
3
- **English** | [中文](#中文说明)
4
-
5
- A character who lives on her own phone, for [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (dsh). She has her own Android phone (this plugin installs and runs it), her own accounts, her own days: between your conversations she keeps living — writes what happened, goes to look at things she is curious about on her phone, and sometimes has a real reason to message you. You are one of her contacts on QQ / WeChat / Feishu…; dsh-im carries the chat. If you also want her to *work* — shell, scripts, a desktop browser, scheduled jobs — give her the optional computer.
6
-
7
- One plugin, six components (living next to other dsh plugins: see 「与其他插件共存」 in the Chinese section):
8
-
9
- | Component | What it is | Needs |
10
- |---|---|---|
11
- | **`dsh-dot/phone`** | Her phone: an Android emulator the plugin downloads (emulator + platform-tools + one system image, ~2 GB, after you accept the SDK license), boots, keeps alive and exposes as `mcp__dot-phone__*` ([mobile-mcp](https://github.com/mobile-next/mobile-mcp) over adb). The emulator window is the live view; her apps and logins live in the AVD and survive restarts. `DSH_DOT_PHONE=off` turns it off. [Details](docs/phone.md) | hardware virtualization (Apple silicon or Intel Mac, Linux with KVM, Windows with WHPX) |
12
- | **`dsh-dot/interlude`** | 幕间, after [HDS-Interlude](https://github.com/REcklessNOLOve117/HDS-Interlude): the Canon (persona; HDSI presets by share code) as a prompt section; a life between conversations — script, continuity, intents; going to look at things on her phone or in her browser (read-only, no approvals); optional proactive contact. `DSH_DOT_INTERLUDE=off` turns it off. [Details](docs/interlude.md) | — |
13
- | **`dsh-dot/qq`** | Her QQ on her computer: [NapCat](https://github.com/NapNeko/NapCatQQ) or [SnowLuma](https://github.com/SnowLuma/SnowLuma) (OneBot 11, `/qq backend`) inside the computer VM, the same account as the QQ app on her phone; messages wake her the moment they arrive, she answers with `qq_send`. `DSH_DOT_QQ=off` turns it off. [Details](docs/qq.md) | the computer component |
14
- | **`dsh-dot/memory`** | What she remembers: you, her own notes, the people she meets, what happened; hands her conversation over to a fresh session past 150k tokens. `DSH_DOT_MEMORY=off` turns it off. [Details](docs/memory.md) | — |
15
- | **`dsh-dot/dot`** | The contact layer: scheduled results → IM unless the reply is `DOT_SILENT`, approval and device notices on IM, working rules as a prompt section. `DSH_DOT_CONTACT=off` turns it off | [dsh-im](https://github.com/xmanrui/dsh-im) for IM; dsh's built-in schedule service |
16
- | **`dsh-dot/computer`** (optional) | A bundled microVM (no Docker needed) with shell, browser, desktop, live view, approval gates and an audit log — the isolation boundary for work. `DSH_DOT_COMPUTER=off` turns it off. [Details](docs/computer.md) | [microsandbox](https://github.com/zerocore-ai/microsandbox) (bundled) or Docker |
17
-
18
- ```bash
19
- dsh plugin --profile desktop add dsh-dot-life @xmanrui/dsh-im # npm; or github:Kevinwu901113/dsh-dot for the source
20
- # then, in dsh: /phone accept (Android SDK license → the phone installs itself)
21
- # /interlude preset 6QA0-1PD6 (a persona from the HDSI hub; pick your own on typ0.space)
22
- ```
23
-
24
- History: `dsh-computer` (v0.1–0.5) and `dsh-interlude` were separate plugins; since dsh-dot v0.3/v0.4 they are components here with their git history merged. Nothing user-facing changed for them.
25
-
26
- ---
27
-
28
- <a id="中文说明"></a>
29
-
30
- ## 中文说明
31
-
32
- dsh-dot 让 dsh 里住进一个**在自己手机上过日子的角色**。她有自己的安卓手机(插件自己装、自己开)、自己的账号、自己的作息:你们不聊天的时候她也在过日子——把发生的事写下来、拿起手机去看她好奇的东西、偶尔有个真实的理由找你说句话。你是她 QQ / 微信 / 飞书里的一个联系人(dsh-im 负责通道)。想让她也能干活——shell、脚本、桌面浏览器、定时任务——再给她那台可选的电脑。
33
-
34
- ### 一、组成:一个插件、六个组件
35
-
36
- | 组件 | 是什么 | 依赖 |
37
- |---|---|---|
38
- | **`dsh-dot/phone`** 她的手机 | Android 模拟器。插件自己从 Google 仓库下载模拟器、platform-tools 和一个系统镜像(约 2 GB,先要你接受 SDK 许可),自己写 AVD(不需要 Java / Android Studio),开机、保活,以 `mcp__dot-phone__*` 暴露给模型([mobile-mcp](https://github.com/mobile-next/mobile-mcp) 走 adb)。模拟器窗口就是实时画面;App 和登录态在 AVD 里,重启不丢。`DSH_DOT_PHONE=off` 关掉。详见 [docs/phone.md](docs/phone.md) | 硬件虚拟化:Apple silicon / Intel Mac,Linux 要 KVM,Windows 要 WHPX |
39
- | **`dsh-dot/interlude`** 幕间 | 按 [HDS-Interlude](https://github.com/REcklessNOLOve117/HDS-Interlude):Canon(人设,HDSI 分享码导入)作为系统提示的一段;两次对话之间的生活——剧本、连续性、打算;想看什么就拿手机(或电脑浏览器)去看,只读、无审批;可选的主动联系。`DSH_DOT_INTERLUDE=off` 关掉。详见 [docs/interlude.md](docs/interlude.md) | — |
40
- | **`dsh-dot/qq`** 她电脑上的 QQ | [NapCat](https://github.com/NapNeko/NapCatQQ) 或 [SnowLuma](https://github.com/SnowLuma/SnowLuma)(OneBot 11,`/qq backend` 切换)跑在她的电脑 VM 里,和手机上的 QQ 同一个账号;消息到的瞬间叫醒她,她用 `qq_send` 秒回;dot 的提醒和她的主动联系也走这里,官方机器人退为后备。`DSH_DOT_QQ=off` 关掉(电脑关了它也关)。详见 [docs/qq.md](docs/qq.md) | 电脑组件 |
41
- | **`dsh-dot/memory`** 她记得的 | 关于你的画像和她自己的笔记(按 Hermes 的做法,有字数上限,她自己能改),她在各个 App 里遇到的人(每人一张卡:互动次数由代码根据真实事件记,印象和事由模型写;只在帖子里互动过的人只记次数和一句印象;关于别人的事先进待核实区),发生过的事(按 dsh-whale-inurqq:碎片带重要度、被说起几次、会老化)。她的对话到 15 万 token 就交班换一个新会话,远早于 dsh 自己在 80% 窗口时的压缩。`DSH_DOT_MEMORY=off` 关掉。详见 [docs/memory.md](docs/memory.md) | — |
42
- | **`dsh-dot/dot`** 联系人层 | 定时任务的结果推到 IM(回复只是 `DOT_SILENT` 就不发)、审批和设备状况的提醒、工作规则作为系统提示的一段。`DSH_DOT_CONTACT=off` 关掉 | IM 用 [dsh-im](https://github.com/xmanrui/dsh-im);定时用 dsh 内置的定时服务 |
43
- | **`dsh-dot/computer`**(可选)她的电脑 | 自带 microVM(不需要 Docker),里面有 shell、浏览器、桌面;实时画面、审批闸门、审计日志。干活时的隔离边界。`DSH_DOT_COMPUTER=off` 关掉。详见 [docs/computer.md](docs/computer.md) | [microsandbox](https://github.com/zerocore-ai/microsandbox)(自带)或 Docker |
44
-
45
- v0.2 之前"电脑"(dsh-computer)和"幕间"(dsh-interlude)是独立插件;v0.3 / v0.4 起并进来做组件,git 历史一起并了。对外没变:`dshComputer`、`~/.dsh/dsh-computer*`、`~/dot/interlude/`、`/dot` `/interlude`。已经装了它们的,先 `dsh plugin --profile desktop remove dsh-computer dsh-interlude` 再装新版 dsh-dot。**v0.9 起 npm 包名是 `dsh-dot-life`**(`dsh-dot` 在 npm 上被占位包占着;v0.8.x 曾叫 `@kevinwu901113/dsh-dot`,已标记 deprecated):之前装过旧名的,先 `dsh plugin --profile desktop remove @kevinwu901113/dsh-dot`(或 `dsh-dot`)再装;`~/dot`、`~/.dsh/phone`、虚拟机都不用动。**v0.9.2 起 MCP 工具名带了命名空间**:`mcp__vm__*` → `mcp__dot-vm__*`,`mcp__phone__*` → `mcp__dot-phone__*`(见下文「与其他插件共存」);自己写过这些工具名的规则或提示要跟着改。
46
-
47
- ### 二、安装
48
-
49
- 需要 dsh ≥ 0.2.1。先退出 dsh 桌面版,再用一条命令装齐:
50
-
51
- ```bash
52
- # macOS
53
- "/Applications/DeepSeek Harness.app/Contents/Resources/runtime/cli/bin/dsh" plugin --profile desktop add \
54
- dsh-dot-life @xmanrui/dsh-im
55
- open -a "DeepSeek Harness"
56
- ```
57
-
58
- ```powershell
59
- # Windows(PowerShell;需要开启 Windows 虚拟机监控程序平台 WHPX,手机才能跑)
60
- & "$env:LOCALAPPDATA\Programs\DeepSeek Harness\resources\runtime\cli\bin\dsh.cmd" plugin --profile desktop add `
61
- dsh-dot-life @xmanrui/dsh-im
62
- ```
63
-
64
- Web 版:`dsh plugin --profile web add dsh-dot-life`。从源码装:把包名换成 `github:Kevinwu901113/dsh-dot`。
65
-
66
- ### 三、第一次设置
67
-
68
- 1. **手机**:在 dsh 里发 `/phone accept`——接受 [Android SDK 许可](https://developer.android.com/studio/terms)后插件开始下载(约 2 GB,进度在 `~/.dsh/dsh-phone.log`),装完自动开机,桌面上出现一个手机窗口。`/phone` 看状态。
69
- 2. **装 App、登录**:在手机窗口里像用真手机一样操作:从官网下 APK 用 `adb install`(`~/.dsh/phone/platform-tools/adb`),或者让她自己装(`mobile_install_app` 会弹审批)。登录、验证码、人脸都由你在窗口里亲手过——她遇到会停下来叫你。**用小号。** 各平台的条款都不允许自动化,封了就封了。
70
- 3. **人设**:`/interlude preset <分享码>` 从 [typ0.space](https://typ0.space) 导入一份 HDSI 预设,或者把 `examples/canon.minase-style.json` 放到 `~/dot/interlude/canon.json`。
71
- 4. **她在手机上看什么**:profile 的 `cordis.patch.yml` 里给 `dot-interlude` 加 `phoneApps: { xiaoheihe.cn: com.max.xiaoheihe, bilibili.com: tv.danmaku.bili }`——这些站她永远用手机上的 App 去看,只读、无审批、每天有上限。
72
- 5. **她的 QQ**:`/qq install` → `/qq account <小号>` → `/qq start` → `/qq qr`,在「手机」标签页里用她手机上的 QQ 扫一扫(码会出现在她的摄像头画面里)确认电脑登录(详见 [docs/qq.md](docs/qq.md))。之后你在 QQ 里给她发消息,1–2 秒叫醒她,她用 `qq_send` 回。不想用协议端的,按 dsh-im 的说明接一个官方机器人也行。
73
- 6. **电脑(可选)**:默认装上并启动;不想要就在环境里设 `DSH_DOT_COMPUTER=off`。要公网实时画面按 [docs/computer.md](docs/computer.md) 用 `tailscale serve`。
74
-
75
- ### 四、她一天是怎么过的
76
-
77
- - 你们聊天:dsh 自己跑对话,dsh-im 接 IM;她的人设(Canon)和工作规则是系统提示里的两段,不需要 `AGENTS.md`。
78
- - 聊天安静下来 `idleMinutes` 后、或每 `advanceEveryMinutes` 一次(只在 `activeHours` 内)、或某个打算到了时间:**幕间一轮**——一次模型调用,她写下这段时间过的日子、更新连续性快照、记下打算,顺便说她想去看点什么(`browserIntents`)。
79
- - **去看**:有 App 的站用手机(`phoneApps`),登录过的网站用电脑浏览器(`vmSites`),其他先走 dsh 的 `web` 服务;被挡了就自己去看。实现是往她最近的会话里追加一条"[幕间观察]"消息,她用 `mcp__dot-phone__*` / `mcp__dot-vm__browser_*` 自己看,最后那段回复作为 `webContext` 进入之后的幕间。这一轮不算幕,**也没有审批**——只读工具直接放行,输入、安装、下单一类直接拒绝。
80
- - **跑腿会话**:拿起手机、App 通知、幕间的「去看」和「玩」都在她的另一个会话「dot · 跑腿」里跑,截图和屏幕元素不进你们的对话;跑腿有结果时,只在她的对话里留一句「[刚才拿起手机看了一眼] …」(不叫醒她,下一轮她就知道)。跑腿会话超过 6 万 token 自动换新。QQ / 微信的消息和你的话照常直接叫醒她的对话。
81
- - **拿起手机**:手机没响她也会隔一阵拿起来看一眼(`phoneCheckEveryMinutes`,默认 30,最近没被叫醒过时):有没回的消息就回,App 里有新动态就看,没事 `DOT_SILENT` 回桌面。`/dot check` 立刻来一次。
82
- - **手机响了**:任何 App 的新通知(QQ 消息、小黑盒的更新、以后她自己装的任何 App)都会叫醒她:`[手机通知] QQ · 宽:在吗`,她自己去 App 里回,或者不理。按 App 静音:`/phone notify mute <包名>`。
83
- - **玩**(默认开,`DSH_DOT_PLAY=off` 关):幕间里她想"给那篇点个赞 / 评论一句 / 关注他",就变成一条 `[想玩会儿手机]`,她用手机去做——只在她自己装了的 App 里。玩多少不是配额,是她自己的习惯(记忆 self 栏里她自己记下的);发帖 / 私信 / 花钱不在允许的动作里。守则是 [Moltbook](https://www.moltbook.com/heartbeat.md) 给 agent 定的:参与 > 创造,真有话说才发。
84
- - **找你**:`speak: true` 时,幕间里 `contact` 过四道闸(活跃时段、意愿值、每日上限、有投递目标)才通过 dsh-im 发出去。
85
- - **干活**(装了电脑时):你说"每天早上看看 X 有没有更新",她建定时任务;到点在电脑里查,有新内容推到 IM,没有就 `DOT_SILENT`;危险操作弹审批卡,附实时画面链接。
86
-
87
- ### 五、文件和命令
88
-
89
- | | |
90
- |---|---|
91
- | `~/dot/interlude/` | 人设 `canon.json`、剧本 `script.md`、连续性 `state.json`、打算 `intents.json`、看到的东西 `web-context.jsonl`、每轮原始回复和 token 用量 `calls.jsonl` |
92
- | `~/dot/memory/` | `memory.md`(给你看的:关于你、她的笔记、认识的人、待核实、碎片)、`diary.md`(她每天 23:30 写的日记)、`memory.json`、真实发生过的对话 `transcript.jsonl`、交班记录 `handoffs.jsonl`、每次整理的原始回复 `calls.jsonl` |
93
- | `~/.dsh/phone/` | 模拟器、platform-tools、系统镜像、AVD(`avd/dot.avd/`);`~/.dsh/dsh-phone.log` 日志、`dsh-phone-audit.jsonl` 审计、`dsh-phone.json` 设置 |
94
- | `~/.dsh/dsh-computer*` | 电脑的日志、审计、状态 |
95
- | `/phone [accept\|restart\|screenshot]` · `/interlude [now\|advance\|seed\|preset <code>\|canon]` · `/dot [test\|check]` · `/dot memory [now\|diary\|handoff]` · `/dot people [approve <id>\|drop <id>\|forget <名字>]` | 各组件的状态和操作 |
96
- | 右侧栏 **dot** 标签页(会话顶部 ◎ 按钮) | 一页看全:手机 / 电脑 QQ / 电脑 状态、她的对话交班进度、她此刻在做什么和打算、今天的轮数 / 玩 / 去看 / 叫醒 / token、记忆用量、日记、最近两段剧本。只读,3 秒刷新;页面由 `dsh-dot/dot` 挂在 dsh 自己的 web server 上(`/dsh-dot/panel/`),不开新端口 |
97
- | 安全边界 | 手机实时画面与控制(`/dsh-dot/phone/`)和 dot 面板都挂在 dsh 的 web server 上,每个请求先过 dsh 的 `connection` 服务(dsh 登录态 + Host/Origin 围栏,不信任任何转发头)——插件不自带鉴权、不开自己的端口。电脑的实时桌面同样挂在 dsh 的 web server 上(`/dsh-dot/computer/`,含 VNC 的 WebSocket),由插件带密钥中继给虚拟机网关;网关端口(`127.0.0.1:18080`)只绑本机回环且要求密钥(`SANDBOX_API_KEY`,每台机器自动生成在 `~/.dsh/dsh-computer.key`),只有插件内部持有。若要从外面看,请暴露 dsh 本身而不是这个端口 |
98
-
99
- dot 的通知相关:`notifyBatchMs`(1 秒内的通知合成一次叫醒)、`notifyHours`(可选的静音时段,默认不设:任何时候来通知都叫醒她);她正在跑一轮时来的通知会攒到那轮结束,同一个对话的多条按顺序列出,一次叫醒。每个组件的配置项见各自的文档:[phone](docs/phone.md)、[interlude](docs/interlude.md)、[computer](docs/computer.md);dot 自己只有 `home`、`scope`、`imBot` / `imTarget`、`autoUnblockDaily`。
100
-
101
- ### 六、原则
102
-
103
- - **不重复造轮子**:手机用 Google 官方模拟器和 mobile-mcp,电脑用 microsandbox,IM 用 dsh-im,定时用 dsh 内置的,人设用 HDSI 社区的预设,幕间的提示词按 HDSI 原文。
104
- - **她只能看,不能瞒着你动**:幕间的"去看"是只读的;有后果的动作(装 App、输密码、付款、给没找过她的人发消息、把她设备上的文件发出去、碰钥匙和登录态文件)走审批,或者根本不给。
105
- - **"你"只有一个来源**:电脑端 QQ 里 `/qq owner` 指定的号。手机通知上的昵称、微信名谁都能改,所以它们永远不算你的指令。
106
- - **可审计**:她看到什么、为什么没出声、哪次工具被拒了,`calls.jsonl` 和两份审计日志里都有。
107
- - **用小号**。
108
-
109
- ### 七、与其他插件共存
110
-
111
- dsh-dot 尽量不占公共名字,但有几处是全局的,装别的插件前先看一眼:
112
-
113
- - **电脑组件开着时会改全局设置**(`cordis.patch.yml` 顶部三段):本机 subprocess provider 换成虚拟机里的那个(`dot-subprocess`),`sandbox-policy` 设成 `danger-full-access`(虚拟机才是隔离边界),权限预设整套改写成 `computer` / `computer-auto`。所以**不要同时装别的沙箱、subprocess 或权限预设插件**;要用它们,就 `DSH_DOT_COMPUTER=off`,这三处恢复 dsh 默认。
114
- - **MCP 工具名有命名空间**:虚拟机的工具是 `mcp__dot-vm__*`,手机是 `mcp__dot-phone__*`(serverName `dot-vm` / `dot-phone`;dsh 规范化工具名时 `-` 合法、原样保留)。别的插件挂一个叫 `vm` 或 `phone` 的 MCP 不会再撞名。前缀定义在 `src/tool-prefixes.js`,改名只改一处。
115
- - **每个组件都能单独关**,在启动 dsh 的环境里设:
116
-
117
- | 组件 | 关掉 |
118
- |---|---|
119
- | computer(连带 qq) | `DSH_DOT_COMPUTER=off` |
120
- | phone | `DSH_DOT_PHONE=off` |
121
- | qq | `DSH_DOT_QQ=off` |
122
- | memory | `DSH_DOT_MEMORY=off` |
123
- | interlude | `DSH_DOT_INTERLUDE=off` |
124
- | dot(联系人层) | `DSH_DOT_CONTACT=off` |
125
-
126
- 组件之间只通过 `ctx.get(...)?.` 找彼此,缺了哪个其余的照常跑(比如关了 dot,记忆不再自动交班;关了 memory,通知里不带人物卡)。
127
- - **记忆共存模式**:`dot-memory` 的 `coexist`(环境变量 `DSH_DOT_MEMORY_COEXIST`),默认 `auto`——发现另一个记忆服务(`otherMemoryServices`,默认 `hermesMemory`、`autoMemory`、`dshMemory`、`memoryBank`;不含过于通用的 `memory`,遇到别的名字自己加;cordis 没有公开的服务枚举,所以是名单)就打一行 info 日志,切到 `people-only`:人物卡、碎片、日记照旧,但**关于他 / 她自己记下的**两栏不再写进系统提示,整理时也不再改这两栏,免得两个插件一起"讲记忆"。`full` 强制全开,`people-only` 强制只留人物。
128
- - **一个 QQ 号只能有一个应答者**:她电脑上的 NapCat 已经用这个号收发消息,不要再在同一个号上跑 qq-bridge 或别的 OneBot 机器人,否则两边都会回。
129
- - **上下文压缩插件**:dsh-dot 注入会话的消息带固定的 `source`,压缩时请保留(或至少别把它们当成用户原话):
130
- - `{ kind: 'dsh-dot', form: 'phone-notification' }` 手机通知叫醒她
131
- - `{ kind: 'dsh-dot', form: 'phone-check' }` 定时看一眼手机
132
- - `{ kind: 'dsh-dot', form: 'errand-note' }` 跑腿会话做完的事回写到主对话
133
- - `{ kind: 'dsh-interlude', form: 'observation' }` 幕间观察
134
- - `{ kind: 'dsh-interlude', form: 'play' }` 幕间「玩」
135
- - `{ kind: 'handoff', generation }` 记忆交班时注入新会话的交接
136
- - 来自她 QQ 上主人的消息是 `{ kind: 'user', rpcId: 'qq-…' }`,即普通用户消息。
137
- - **`bash` 也过 dsh-dot 的电脑闸门**(`dot-gate` 的 `shellTools` 含 `bash`),别的插件再给 `bash` 加审批,同一条命令会弹两次审批。
138
-
139
- ### 八、路线
140
-
141
- 现状、分期和待定的决定见 [docs/ROADMAP.md](docs/ROADMAP.md)。
142
-
143
- ### 九、许可证
144
-
145
- AGPL-3.0-only。幕间组件按原文使用 HDS-Interlude(AGPL-3.0)的提示词,所以整个包按 AGPL 发布;v0.3 之前以 MIT 发布的 computer / dot 代码,那些版本仍按 MIT 可用。
1
+ # dsh-dot
2
+
3
+ **English** | [中文](#中文说明)
4
+
5
+ A character who lives on her own phone, for [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (dsh). She has her own Android phone (this plugin installs and runs it), her own accounts, her own days: between your conversations she keeps living — writes what happened, goes to look at things she is curious about on her phone, and sometimes has a real reason to message you. You are one of her contacts on QQ / WeChat / Feishu…; dsh-im carries the chat. If you also want her to *work* — shell, scripts, a desktop browser, scheduled jobs — give her the optional computer.
6
+
7
+ One plugin, six components (living next to other dsh plugins: see 「与其他插件共存」 in the Chinese section):
8
+
9
+ | Component | What it is | Needs |
10
+ |---|---|---|
11
+ | **`dsh-dot/phone`** | Her phone: an Android emulator the plugin downloads (emulator + platform-tools + one system image, ~2 GB, after you accept the SDK license), boots, keeps alive and exposes as `mcp__dot-phone__*` ([mobile-mcp](https://github.com/mobile-next/mobile-mcp) over adb). The emulator window is the live view; her apps and logins live in the AVD and survive restarts. `DSH_DOT_PHONE=off` turns it off. [Details](docs/phone.md) | hardware virtualization (Apple silicon or Intel Mac, Linux with KVM, Windows with WHPX) |
12
+ | **`dsh-dot/interlude`** | 幕间, after [HDS-Interlude](https://github.com/REcklessNOLOve117/HDS-Interlude): the Canon (persona; HDSI presets by share code) as a prompt section; a life between conversations — script, continuity, intents; going to look at things on her phone or in her browser (read-only, no approvals); optional proactive contact. `DSH_DOT_INTERLUDE=off` turns it off. [Details](docs/interlude.md) | — |
13
+ | **`dsh-dot/qq`** | Her QQ on her computer: [NapCat](https://github.com/NapNeko/NapCatQQ) or [SnowLuma](https://github.com/SnowLuma/SnowLuma) (OneBot 11, `/qq backend`) inside the computer VM, the same account as the QQ app on her phone; messages wake her the moment they arrive, she answers with `qq_send`. `DSH_DOT_QQ=off` turns it off. [Details](docs/qq.md) | the computer component |
14
+ | **`dsh-dot/memory`** | What she remembers: you, her own notes, the people she meets, what happened; hands her conversation over to a fresh session past 150k tokens. `DSH_DOT_MEMORY=off` turns it off. [Details](docs/memory.md) | — |
15
+ | **`dsh-dot/dot`** | The contact layer: scheduled results → IM unless the reply is `DOT_SILENT`, approval and device notices on IM, working rules as a prompt section. `DSH_DOT_CONTACT=off` turns it off | [dsh-im](https://github.com/xmanrui/dsh-im) for IM; dsh's built-in schedule service |
16
+ | **`dsh-dot/computer`** (optional) | A bundled microVM (no Docker needed) with shell, browser, desktop, live view, approval gates and an audit log — the isolation boundary for work. `DSH_DOT_COMPUTER=off` turns it off. [Details](docs/computer.md) | [microsandbox](https://github.com/zerocore-ai/microsandbox) (bundled) or Docker |
17
+
18
+ ```bash
19
+ dsh plugin --profile desktop add dsh-dot-life @xmanrui/dsh-im # npm; or github:Kevinwu901113/dsh-dot for the source
20
+ # then, in dsh: /phone accept (Android SDK license → the phone installs itself)
21
+ # /interlude preset 6QA0-1PD6 (a persona from the HDSI hub; pick your own on typ0.space)
22
+ ```
23
+
24
+ History: `dsh-computer` (v0.1–0.5) and `dsh-interlude` were separate plugins; since dsh-dot v0.3/v0.4 they are components here with their git history merged. Nothing user-facing changed for them.
25
+
26
+ ---
27
+
28
+ <a id="中文说明"></a>
29
+
30
+ ## 中文说明
31
+
32
+ dsh-dot 让 dsh 里住进一个**在自己手机上过日子的角色**。她有自己的安卓手机(插件自己装、自己开)、自己的账号、自己的作息:你们不聊天的时候她也在过日子——把发生的事写下来、拿起手机去看她好奇的东西、偶尔有个真实的理由找你说句话。你是她 QQ / 微信 / 飞书里的一个联系人(dsh-im 负责通道)。想让她也能干活——shell、脚本、桌面浏览器、定时任务——再给她那台可选的电脑。
33
+
34
+ ### 一、组成:一个插件、六个组件
35
+
36
+ | 组件 | 是什么 | 依赖 |
37
+ |---|---|---|
38
+ | **`dsh-dot/phone`** 她的手机 | Android 模拟器。插件自己从 Google 仓库下载模拟器、platform-tools 和一个系统镜像(约 2 GB,先要你接受 SDK 许可),自己写 AVD(不需要 Java / Android Studio),开机、保活,以 `mcp__dot-phone__*` 暴露给模型([mobile-mcp](https://github.com/mobile-next/mobile-mcp) 走 adb)。模拟器窗口就是实时画面;App 和登录态在 AVD 里,重启不丢。`DSH_DOT_PHONE=off` 关掉。详见 [docs/phone.md](docs/phone.md) | 硬件虚拟化:Apple silicon / Intel Mac,Linux 要 KVM,Windows 要 WHPX |
39
+ | **`dsh-dot/interlude`** 幕间 | 按 [HDS-Interlude](https://github.com/REcklessNOLOve117/HDS-Interlude):Canon(人设,HDSI 分享码导入)作为系统提示的一段;两次对话之间的生活——剧本、连续性、打算;想看什么就拿手机(或电脑浏览器)去看,只读、无审批;可选的主动联系。`DSH_DOT_INTERLUDE=off` 关掉。详见 [docs/interlude.md](docs/interlude.md) | — |
40
+ | **`dsh-dot/qq`** 她电脑上的 QQ | [NapCat](https://github.com/NapNeko/NapCatQQ) 或 [SnowLuma](https://github.com/SnowLuma/SnowLuma)(OneBot 11,`/qq backend` 切换)跑在她的电脑 VM 里,和手机上的 QQ 同一个账号;消息到的瞬间叫醒她,她用 `qq_send` 秒回;dot 的提醒和她的主动联系也走这里,官方机器人退为后备。`DSH_DOT_QQ=off` 关掉(电脑关了它也关)。详见 [docs/qq.md](docs/qq.md) | 电脑组件 |
41
+ | **`dsh-dot/memory`** 她记得的 | 关于你的画像和她自己的笔记(按 Hermes 的做法,有字数上限,她自己能改),她在各个 App 里遇到的人(每人一张卡:互动次数由代码根据真实事件记,印象和事由模型写;只在帖子里互动过的人只记次数和一句印象;关于别人的事先进待核实区),发生过的事(按 dsh-whale-inurqq:碎片带重要度、被说起几次、会老化)。她的对话到 15 万 token 就交班换一个新会话,远早于 dsh 自己在 80% 窗口时的压缩。`DSH_DOT_MEMORY=off` 关掉。详见 [docs/memory.md](docs/memory.md) | — |
42
+ | **`dsh-dot/dot`** 联系人层 | 定时任务的结果推到 IM(回复只是 `DOT_SILENT` 就不发)、审批和设备状况的提醒、工作规则作为系统提示的一段。`DSH_DOT_CONTACT=off` 关掉 | IM 用 [dsh-im](https://github.com/xmanrui/dsh-im);定时用 dsh 内置的定时服务 |
43
+ | **`dsh-dot/computer`**(可选)她的电脑 | 自带 microVM(不需要 Docker),里面有 shell、浏览器、桌面;实时画面、审批闸门、审计日志。干活时的隔离边界。`DSH_DOT_COMPUTER=off` 关掉。详见 [docs/computer.md](docs/computer.md) | [microsandbox](https://github.com/zerocore-ai/microsandbox)(自带)或 Docker |
44
+
45
+ v0.2 之前"电脑"(dsh-computer)和"幕间"(dsh-interlude)是独立插件;v0.3 / v0.4 起并进来做组件,git 历史一起并了。对外没变:`dshComputer`、`~/.dsh/dsh-computer*`、`~/dot/interlude/`、`/dot` `/interlude`。已经装了它们的,先 `dsh plugin --profile desktop remove dsh-computer dsh-interlude` 再装新版 dsh-dot。**v0.9 起 npm 包名是 `dsh-dot-life`**(`dsh-dot` 在 npm 上被占位包占着;v0.8.x 曾叫 `@kevinwu901113/dsh-dot`,已标记 deprecated):之前装过旧名的,先 `dsh plugin --profile desktop remove @kevinwu901113/dsh-dot`(或 `dsh-dot`)再装;`~/dot`、`~/.dsh/phone`、虚拟机都不用动。**v0.9.2 起 MCP 工具名带了命名空间**:`mcp__vm__*` → `mcp__dot-vm__*`,`mcp__phone__*` → `mcp__dot-phone__*`(见下文「与其他插件共存」);自己写过这些工具名的规则或提示要跟着改。
46
+
47
+ ### 二、安装
48
+
49
+ 需要 dsh ≥ 0.2.1。先退出 dsh 桌面版,再用一条命令装齐:
50
+
51
+ ```bash
52
+ # macOS
53
+ "/Applications/DeepSeek Harness.app/Contents/Resources/runtime/cli/bin/dsh" plugin --profile desktop add \
54
+ dsh-dot-life @xmanrui/dsh-im
55
+ open -a "DeepSeek Harness"
56
+ ```
57
+
58
+ ```powershell
59
+ # Windows(PowerShell;需要开启 Windows 虚拟机监控程序平台 WHPX,手机才能跑)
60
+ & "$env:LOCALAPPDATA\Programs\DeepSeek Harness\resources\runtime\cli\bin\dsh.cmd" plugin --profile desktop add `
61
+ dsh-dot-life @xmanrui/dsh-im
62
+ ```
63
+
64
+ Web 版:`dsh plugin --profile web add dsh-dot-life`。从源码装:把包名换成 `github:Kevinwu901113/dsh-dot`。
65
+
66
+ ### 三、第一次设置
67
+
68
+ 1. **手机**:在 dsh 里发 `/phone accept`——接受 [Android SDK 许可](https://developer.android.com/studio/terms)后插件开始下载(约 2 GB,进度在 `~/.dsh/dsh-phone.log`),装完自动开机,桌面上出现一个手机窗口。`/phone` 看状态。
69
+ 2. **装 App、登录**:在手机窗口里像用真手机一样操作:从官网下 APK 用 `adb install`(`~/.dsh/phone/platform-tools/adb`),或者让她自己装(`mobile_install_app` 会弹审批)。登录、验证码、人脸都由你在窗口里亲手过——她遇到会停下来叫你。**用小号。** 各平台的条款都不允许自动化,封了就封了。
70
+ 3. **人设**:`/interlude preset <分享码>` 从 [typ0.space](https://typ0.space) 导入一份 HDSI 预设,或者把 `examples/canon.minase-style.json` 放到 `~/dot/interlude/canon.json`。
71
+ 4. **她在手机上看什么**:profile 的 `cordis.patch.yml` 里给 `dot-interlude` 加 `phoneApps: { xiaoheihe.cn: com.max.xiaoheihe, bilibili.com: tv.danmaku.bili }`——这些站她永远用手机上的 App 去看,只读、无审批、每天有上限。
72
+ 5. **她的 QQ**:`/qq install` → `/qq account <小号>` → `/qq start` → `/qq qr`,在「手机」标签页里用她手机上的 QQ 扫一扫(码会出现在她的摄像头画面里)确认电脑登录(详见 [docs/qq.md](docs/qq.md))。之后你在 QQ 里给她发消息,1–2 秒叫醒她,她用 `qq_send` 回。不想用协议端的,按 dsh-im 的说明接一个官方机器人也行。
73
+ 6. **电脑(可选)**:默认装上并启动;不想要就在环境里设 `DSH_DOT_COMPUTER=off`。要公网实时画面按 [docs/computer.md](docs/computer.md) 用 `tailscale serve`。
74
+
75
+ ### 四、她一天是怎么过的
76
+
77
+ - 你们聊天:dsh 自己跑对话,dsh-im 接 IM;她的人设(Canon)和工作规则是系统提示里的两段,不需要 `AGENTS.md`。
78
+ - 聊天安静下来 `idleMinutes` 后、或每 `advanceEveryMinutes` 一次(只在 `activeHours` 内)、或某个打算到了时间:**幕间一轮**——一次模型调用,她写下这段时间过的日子、更新连续性快照、记下打算,顺便说她想去看点什么(`browserIntents`)。
79
+ - **去看**:有 App 的站用手机(`phoneApps`),登录过的网站用电脑浏览器(`vmSites`),其他先走 dsh 的 `web` 服务;被挡了就自己去看。实现是往她最近的会话里追加一条"[幕间观察]"消息,她用 `mcp__dot-phone__*` / `mcp__dot-vm__browser_*` 自己看,最后那段回复作为 `webContext` 进入之后的幕间。这一轮不算幕,**也没有审批**——只读工具直接放行,输入、安装、下单一类直接拒绝。
80
+ - **跑腿会话**:拿起手机、App 通知、幕间的「去看」和「玩」都在她的另一个会话「dot · 跑腿」里跑,截图和屏幕元素不进你们的对话;跑腿有结果时,只在她的对话里留一句「[刚才拿起手机看了一眼] …」(不叫醒她,下一轮她就知道)。跑腿会话超过 6 万 token 自动换新。QQ / 微信的消息和你的话照常直接叫醒她的对话。
81
+ - **拿起手机**:手机没响她也会隔一阵拿起来看一眼(`phoneCheckEveryMinutes`,默认 30,最近没被叫醒过时):有没回的消息就回,App 里有新动态就看,没事 `DOT_SILENT` 回桌面。`/dot check` 立刻来一次。
82
+ - **手机响了**:任何 App 的新通知(QQ 消息、小黑盒的更新、以后她自己装的任何 App)都会叫醒她:`[手机通知] QQ · 宽:在吗`,她自己去 App 里回,或者不理。按 App 静音:`/phone notify mute <包名>`。
83
+ - **玩**(默认开,`DSH_DOT_PLAY=off` 关):幕间里她想"给那篇点个赞 / 评论一句 / 关注他",就变成一条 `[想玩会儿手机]`,她用手机去做——只在她自己装了的 App 里。玩多少不是配额,是她自己的习惯(记忆 self 栏里她自己记下的);发帖 / 私信 / 花钱不在允许的动作里。守则是 [Moltbook](https://www.moltbook.com/heartbeat.md) 给 agent 定的:参与 > 创造,真有话说才发。
84
+ - **找你**:`speak: true` 时,幕间里 `contact` 过四道闸(活跃时段、意愿值、每日上限、有投递目标)才通过 dsh-im 发出去。
85
+ - **干活**(装了电脑时):你说"每天早上看看 X 有没有更新",她建定时任务;到点在电脑里查,有新内容推到 IM,没有就 `DOT_SILENT`;危险操作弹审批卡,附实时画面链接。
86
+
87
+ ### 五、文件和命令
88
+
89
+ | | |
90
+ |---|---|
91
+ | `~/dot/interlude/` | 人设 `canon.json`、剧本 `script.md`、连续性 `state.json`、打算 `intents.json`、看到的东西 `web-context.jsonl`、每轮原始回复和 token 用量 `calls.jsonl` |
92
+ | `~/dot/memory/` | `memory.md`(给你看的:关于你、她的笔记、认识的人、待核实、碎片)、`diary.md`(她每天 23:30 写的日记)、`memory.json`、真实发生过的对话 `transcript.jsonl`、交班记录 `handoffs.jsonl`、每次整理的原始回复 `calls.jsonl` |
93
+ | `~/.dsh/phone/` | 模拟器、platform-tools、系统镜像、AVD(`avd/dot.avd/`);`~/.dsh/dsh-phone.log` 日志、`dsh-phone-audit.jsonl` 审计、`dsh-phone.json` 设置 |
94
+ | `~/.dsh/dsh-computer*` | 电脑的日志、审计、状态 |
95
+ | `/phone [accept\|restart\|screenshot]` · `/interlude [now\|advance\|seed\|preset <code>\|canon]` · `/dot [test\|check]` · `/dot memory [now\|diary\|handoff]` · `/dot people [approve <id>\|drop <id>\|forget <名字>]` | 各组件的状态和操作 |
96
+ | 右侧栏 **dot** 标签页(会话顶部 ◎ 按钮) | 一页看全:手机 / 电脑 QQ / 电脑 状态、她的对话交班进度、她此刻在做什么和打算、今天的轮数 / 玩 / 去看 / 叫醒 / token、记忆用量、日记、最近两段剧本。只读,3 秒刷新;页面由 `dsh-dot/dot` 挂在 dsh 自己的 web server 上(`/dsh-dot/panel/`),不开新端口 |
97
+ | 安全边界 | 手机实时画面与控制(`/dsh-dot/phone/`)和 dot 面板都挂在 dsh 的 web server 上,每个请求先过 dsh 的 `connection` 服务(dsh 登录态 + Host/Origin 围栏,不信任任何转发头)——插件不自带鉴权、不开自己的端口。电脑的实时桌面同样挂在 dsh 的 web server 上(`/dsh-dot/computer/`,含 VNC 的 WebSocket),由插件带密钥中继给虚拟机网关;网关端口(`127.0.0.1:18080`)只绑本机回环且要求密钥(`SANDBOX_API_KEY`,每台机器自动生成在 `~/.dsh/dsh-computer.key`),只有插件内部持有。若要从外面看,请暴露 dsh 本身而不是这个端口 |
98
+
99
+ dot 的通知相关:`notifyBatchMs`(1 秒内的通知合成一次叫醒)、`notifyHours`(可选的静音时段,默认不设:任何时候来通知都叫醒她);她正在跑一轮时来的通知会攒到那轮结束,同一个对话的多条按顺序列出,一次叫醒。每个组件的配置项见各自的文档:[phone](docs/phone.md)、[interlude](docs/interlude.md)、[computer](docs/computer.md);dot 自己只有 `home`、`scope`、`imBot` / `imTarget`、`autoUnblockDaily`。
100
+
101
+ ### 六、原则
102
+
103
+ - **不重复造轮子**:手机用 Google 官方模拟器和 mobile-mcp,电脑用 microsandbox,IM 用 dsh-im,定时用 dsh 内置的,人设用 HDSI 社区的预设,幕间的提示词按 HDSI 原文。
104
+ - **她只能看,不能瞒着你动**:幕间的"去看"是只读的;有后果的动作(装 App、输密码、付款、给没找过她的人发消息、把她设备上的文件发出去、碰钥匙和登录态文件)走审批,或者根本不给。
105
+ - **"你"只有一个来源**:电脑端 QQ 里 `/qq owner` 指定的号。手机通知上的昵称、微信名谁都能改,所以它们永远不算你的指令。
106
+ - **可审计**:她看到什么、为什么没出声、哪次工具被拒了,`calls.jsonl` 和两份审计日志里都有。
107
+ - **用小号**。
108
+
109
+ ### 七、与其他插件共存
110
+
111
+ dsh-dot 尽量不占公共名字,但有几处是全局的,装别的插件前先看一眼:
112
+
113
+ - **电脑组件开着时会改全局设置**(`cordis.patch.yml` 顶部三段):本机 subprocess provider 换成虚拟机里的那个(`dot-subprocess`),`sandbox-policy` 设成 `danger-full-access`(虚拟机才是隔离边界),权限预设整套改写成 `computer` / `computer-auto`。所以**不要同时装别的沙箱、subprocess 或权限预设插件**;要用它们,就 `DSH_DOT_COMPUTER=off`,这三处恢复 dsh 默认。
114
+ - **MCP 工具名有命名空间**:虚拟机的工具是 `mcp__dot-vm__*`,手机是 `mcp__dot-phone__*`(serverName `dot-vm` / `dot-phone`;dsh 规范化工具名时 `-` 合法、原样保留)。别的插件挂一个叫 `vm` 或 `phone` 的 MCP 不会再撞名。前缀定义在 `src/tool-prefixes.js`,改名只改一处。
115
+ - **每个组件都能单独关**,在启动 dsh 的环境里设:
116
+
117
+ | 组件 | 关掉 |
118
+ |---|---|
119
+ | computer(连带 qq) | `DSH_DOT_COMPUTER=off` |
120
+ | phone | `DSH_DOT_PHONE=off` |
121
+ | qq | `DSH_DOT_QQ=off` |
122
+ | memory | `DSH_DOT_MEMORY=off` |
123
+ | interlude | `DSH_DOT_INTERLUDE=off` |
124
+ | dot(联系人层) | `DSH_DOT_CONTACT=off` |
125
+
126
+ 组件之间只通过 `ctx.get(...)?.` 找彼此,缺了哪个其余的照常跑(比如关了 dot,记忆不再自动交班;关了 memory,通知里不带人物卡)。
127
+ - **记忆共存模式**:`dot-memory` 的 `coexist`(环境变量 `DSH_DOT_MEMORY_COEXIST`),默认 `auto`——发现另一个记忆服务(`otherMemoryServices`,默认 `hermesMemory`、`autoMemory`、`dshMemory`、`memoryBank`;不含过于通用的 `memory`,遇到别的名字自己加;cordis 没有公开的服务枚举,所以是名单)就打一行 info 日志,切到 `people-only`:人物卡、碎片、日记照旧,但**关于他 / 她自己记下的**两栏不再写进系统提示,整理时也不再改这两栏,免得两个插件一起"讲记忆"。`full` 强制全开,`people-only` 强制只留人物。
128
+ - **一个 QQ 号只能有一个应答者**:她电脑上的 NapCat 已经用这个号收发消息,不要再在同一个号上跑 qq-bridge 或别的 OneBot 机器人,否则两边都会回。
129
+ - **上下文压缩插件**:dsh-dot 注入会话的消息带固定的 `source`,压缩时请保留(或至少别把它们当成用户原话):
130
+ - `{ kind: 'dsh-dot', form: 'phone-notification' }` 手机通知叫醒她
131
+ - `{ kind: 'dsh-dot', form: 'phone-check' }` 定时看一眼手机
132
+ - `{ kind: 'dsh-dot', form: 'errand-note' }` 跑腿会话做完的事回写到主对话
133
+ - `{ kind: 'dsh-interlude', form: 'observation' }` 幕间观察
134
+ - `{ kind: 'dsh-interlude', form: 'play' }` 幕间「玩」
135
+ - `{ kind: 'handoff', generation }` 记忆交班时注入新会话的交接
136
+ - 来自她 QQ 上主人的消息是 `{ kind: 'user', rpcId: 'qq-…' }`,即普通用户消息。
137
+ - **`bash` 也过 dsh-dot 的电脑闸门**(`dot-gate` 的 `shellTools` 含 `bash`),别的插件再给 `bash` 加审批,同一条命令会弹两次审批。
138
+
139
+ ### 八、路线
140
+
141
+ 现状、分期和待定的决定见 [docs/ROADMAP.md](docs/ROADMAP.md)。
142
+
143
+ ### 九、许可证
144
+
145
+ AGPL-3.0-only。幕间组件按原文使用 HDS-Interlude(AGPL-3.0)的提示词,所以整个包按 AGPL 发布;v0.3 之前以 MIT 发布的 computer / dot 代码,那些版本仍按 MIT 可用。
package/cordis.patch.yml CHANGED
@@ -1,118 +1,118 @@
1
- # dsh-dot: one plugin, five components. The character lives on her own devices.
2
- # phone — her phone: an Android emulator this plugin installs, boots and keeps alive;
3
- # tools mcp__dot-phone__* (mobile-mcp over adb). The emulator window is the live view.
4
- # DSH_DOT_PHONE=off turns it off.
5
- # computer — optional: a microVM (microsandbox, bundled; Docker as fallback) with shell, browser,
6
- # desktop, live view, approval gates, audit log. The VM is the isolation boundary.
7
- # DSH_DOT_COMPUTER=off turns it off (the host subprocess/sandbox settings stay stock).
8
- # qq — her QQ on her computer: NapCat (OneBot 11) inside the VM, same account as the phone
9
- # app. Messages wake her instantly; she answers with qq_send. Needs the computer.
10
- # DSH_DOT_QQ=off turns it off.
11
- # dot — the always-on glue: scheduled runs → IM, silence protocol, approval cards with the
12
- # live view, working rules as a prompt section. Needs dsh-im and the official
13
- # schedule bundle (see README). DSH_DOT_CONTACT=off turns it off.
14
- # memory — what she remembers (people, fragments, diary, owner/self banks). DSH_DOT_MEMORY=off.
15
- # interlude — 幕间, after HDS-Interlude: the Canon (persona, HDSI presets by share code) as a
16
- # prompt section, and a life between conversations — script, continuity, intents,
17
- # going to look at things on her phone / in her browser (read-only), optional
18
- # proactive contact over dsh-im. DSH_DOT_INTERLUDE=off turns it off.
19
- # Every component tolerates a sibling being off (services are looked up with ctx.get(...)?.).
20
-
21
- # 1. Replace the host subprocess provider with the VM-backed one.
22
- - id: subprocess
23
- name: '@deepseek-ai/dsh-subprocess-local'
24
- disabled: !!js "process.env.DSH_DOT_COMPUTER !== 'off'"
25
-
26
- # 2. The VM is the boundary, so host landlock/bwrap wrapping is off; approvals stay on.
27
- - id: sandbox-policy
28
- name: '@deepseek-ai/dsh-sandbox-policy'
29
- config:
30
- mode: !!js "process.env.DSH_DOT_COMPUTER === 'off' ? (process.env.DSH_PERMISSION_MODE ?? 'workspace-write') : 'danger-full-access'"
31
- workspaceRoot: !!js process.cwd()
32
- - id: permission
33
- name: '@deepseek-ai/dsh-permission-presets'
34
- config:
35
- presets: !!js "process.env.DSH_DOT_COMPUTER === 'off' ? { 'read-only': { sandbox: 'read-only', approval: 'ask' }, 'workspace-write': { sandbox: 'workspace-write', approval: 'ask' }, 'danger-full-access': { sandbox: 'danger-full-access', approval: 'never' } } : { 'computer': { sandbox: 'danger-full-access', approval: 'ask' }, 'computer-auto': { sandbox: 'danger-full-access', approval: 'never' } }"
36
- defaultPreset: !!js "process.env.DSH_DOT_COMPUTER === 'off' ? 'workspace-write' : (process.env.DSH_COMPUTER_PRESET ?? 'computer')"
37
-
38
- - insert:
39
- - id: dot-computer
40
- disabled: !!js "process.env.DSH_DOT_COMPUTER === 'off'"
41
- name: 'dsh-dot-life/computer'
42
- config:
43
- backend: !!js "process.env.DSH_COMPUTER_BACKEND ?? ''"
44
- port: !!js "Number(process.env.DSH_COMPUTER_PORT ?? 18080)"
45
- image: !!js "process.env.DSH_COMPUTER_IMAGE ?? ''"
46
- # Public origin of this dsh (your own exposure, e.g. `tailscale serve`); the live view is served there
47
- # behind dsh's login. Never the VM gateway port: it is keyed and answers only to dsh-dot.
48
- publicUrl: !!js "process.env.DSH_COMPUTER_PUBLIC_URL ?? ''"
49
- # Folders shared with the VM at the same path (':' separated; ';' on Windows). Default: each session's workspace, shared on first use (see README).
50
- mounts: !!js "process.env.DSH_COMPUTER_MOUNTS ? process.env.DSH_COMPUTER_MOUNTS.split(process.platform === 'win32' ? ';' : ':').filter(Boolean) : []"
51
- - id: dot-subprocess
52
- disabled: !!js "process.env.DSH_DOT_COMPUTER === 'off'"
53
- name: 'dsh-dot-life/subprocess'
54
- - id: dot-gate
55
- disabled: !!js "process.env.DSH_DOT_COMPUTER === 'off'"
56
- name: 'dsh-dot-life/gate'
57
- config:
58
- mode: !!js "process.env.DSH_COMPUTER_GATE ?? 'risky'"
59
- # 3. Browser + desktop tools served from inside the VM (tool names: mcp__dot-vm__*) are mounted by the
60
- # computer component itself, so the MCP client carries the gateway key (see docs/computer.md).
61
- # 4. Desktop/Web UI: right-Sidebar "Computer" tab (live view) and a header toggle.
62
- - id: dot-ui
63
- disabled: !!js "process.env.DSH_DOT_COMPUTER === 'off'"
64
- name: 'dsh-dot-life'
65
- # 5. Her phone (see src/phone/phone.js). First start downloads ~2 GB from Google's repository once
66
- # the SDK license is accepted (`/phone accept`, or acceptLicense: true here).
67
- - id: dot-phone
68
- name: 'dsh-dot-life/phone'
69
- disabled: !!js "process.env.DSH_DOT_PHONE === 'off'"
70
- config:
71
- window: !!js "process.env.DSH_DOT_PHONE_WINDOW !== 'off'"
72
- acceptLicense: !!js "process.env.DSH_DOT_PHONE_ACCEPT_LICENSE === 'yes' ? true : undefined"
73
- # Live view + controls at <dsh>/dsh-dot/phone/, behind dsh's own login (no port of its own).
74
- # publicUrl: the public origin of this dsh if you expose it (tailscale serve, remote access).
75
- publicUrl: !!js "process.env.DSH_DOT_PUBLIC_URL ?? process.env.DSH_COMPUTER_PUBLIC_URL ?? ''"
76
- # 6. The always-on glue (was the standalone dsh-dot plugin).
77
- - id: dot
78
- name: 'dsh-dot-life/dot'
79
- disabled: !!js "process.env.DSH_DOT_CONTACT === 'off'"
80
- config:
81
- # dot's home: its working files live here and sessions started here are dot's.
82
- home: !!js "process.env.DSH_DOT_HOME ?? ''"
83
- # 6b. What she remembers (after Hermes and dsh-whale-inurqq): you, her own notes, the people she
84
- # meets in her apps, what happened. Her conversation is handed over to a fresh session past
85
- # handoffTokens (long before dsh's own compaction at 80% of the window). Files: <home>/memory/.
86
- - id: dot-memory
87
- name: 'dsh-dot-life/memory'
88
- disabled: !!js "process.env.DSH_DOT_MEMORY === 'off'"
89
- config:
90
- home: !!js "process.env.DSH_DOT_HOME ?? ''"
91
- # Next to another memory plugin: auto (people-only when one is found) · full · people-only.
92
- coexist: !!js "process.env.DSH_DOT_MEMORY_COEXIST ?? 'auto'"
93
- # handoffTokens: 150000
94
- # 7. 幕间 (was the standalone dsh-interlude plugin). Shares dot's home: <home>/interlude/.
95
- - id: dot-interlude
96
- name: 'dsh-dot-life/interlude'
97
- disabled: !!js "process.env.DSH_DOT_INTERLUDE === 'off'"
98
- config:
99
- home: !!js "process.env.DSH_INTERLUDE_HOME ?? process.env.DSH_DOT_HOME ?? ''"
100
- # Going to look (HDSI browserIntent): auto = web first; a host listed below is always
101
- # looked at by her — in the app on her phone (phoneApps, host → package) or in her own VM
102
- # browser (vmSites) — read-only, no approvals. Add the sites she is logged into.
103
- # browser: auto
104
- # Her phone's apps she looks things up in (host → package). Only apps she has installed herself are ever used.
105
- phoneApps: { xiaoheihe.cn: com.max.xiaoheihe, bilibili.com: tv.danmaku.bili }
106
- # vmSites: [x.com]
107
- # vmDailyCap: 2
108
- # 玩: small social actions on her own accounts (like / comment / follow). How often is her own
109
- # habit (her self notes), not a quota; DSH_DOT_PLAY=off turns it off.
110
- play: !!js "process.env.DSH_DOT_PLAY !== 'off'"
111
- playApps: { 小黑盒: com.max.xiaoheihe, B站: tv.danmaku.bili }
112
- # 8. Her QQ on the computer (NapCat in the VM). /qq install once, /qq account <number>, /qq qr to log in.
113
- - id: dot-qq
114
- name: 'dsh-dot-life/qq'
115
- disabled: !!js "process.env.DSH_DOT_QQ === 'off' || process.env.DSH_DOT_COMPUTER === 'off'"
116
- config:
117
- qq: !!js "process.env.DSH_DOT_QQ_ACCOUNT ?? ''"
118
- githubProxy: !!js "process.env.DSH_DOT_GITHUB_PROXY ?? ''"
1
+ # dsh-dot: one plugin, five components. The character lives on her own devices.
2
+ # phone — her phone: an Android emulator this plugin installs, boots and keeps alive;
3
+ # tools mcp__dot-phone__* (mobile-mcp over adb). The emulator window is the live view.
4
+ # DSH_DOT_PHONE=off turns it off.
5
+ # computer — optional: a microVM (microsandbox, bundled; Docker as fallback) with shell, browser,
6
+ # desktop, live view, approval gates, audit log. The VM is the isolation boundary.
7
+ # DSH_DOT_COMPUTER=off turns it off (the host subprocess/sandbox settings stay stock).
8
+ # qq — her QQ on her computer: NapCat (OneBot 11) inside the VM, same account as the phone
9
+ # app. Messages wake her instantly; she answers with qq_send. Needs the computer.
10
+ # DSH_DOT_QQ=off turns it off.
11
+ # dot — the always-on glue: scheduled runs → IM, silence protocol, approval cards with the
12
+ # live view, working rules as a prompt section. Needs dsh-im and the official
13
+ # schedule bundle (see README). DSH_DOT_CONTACT=off turns it off.
14
+ # memory — what she remembers (people, fragments, diary, owner/self banks). DSH_DOT_MEMORY=off.
15
+ # interlude — 幕间, after HDS-Interlude: the Canon (persona, HDSI presets by share code) as a
16
+ # prompt section, and a life between conversations — script, continuity, intents,
17
+ # going to look at things on her phone / in her browser (read-only), optional
18
+ # proactive contact over dsh-im. DSH_DOT_INTERLUDE=off turns it off.
19
+ # Every component tolerates a sibling being off (services are looked up with ctx.get(...)?.).
20
+
21
+ # 1. Replace the host subprocess provider with the VM-backed one.
22
+ - id: subprocess
23
+ name: '@deepseek-ai/dsh-subprocess-local'
24
+ disabled: !!js "process.env.DSH_DOT_COMPUTER !== 'off'"
25
+
26
+ # 2. The VM is the boundary, so host landlock/bwrap wrapping is off; approvals stay on.
27
+ - id: sandbox-policy
28
+ name: '@deepseek-ai/dsh-sandbox-policy'
29
+ config:
30
+ mode: !!js "process.env.DSH_DOT_COMPUTER === 'off' ? (process.env.DSH_PERMISSION_MODE ?? 'workspace-write') : 'danger-full-access'"
31
+ workspaceRoot: !!js process.cwd()
32
+ - id: permission
33
+ name: '@deepseek-ai/dsh-permission-presets'
34
+ config:
35
+ presets: !!js "process.env.DSH_DOT_COMPUTER === 'off' ? { 'read-only': { sandbox: 'read-only', approval: 'ask' }, 'workspace-write': { sandbox: 'workspace-write', approval: 'ask' }, 'danger-full-access': { sandbox: 'danger-full-access', approval: 'never' } } : { 'computer': { sandbox: 'danger-full-access', approval: 'ask' }, 'computer-auto': { sandbox: 'danger-full-access', approval: 'never' } }"
36
+ defaultPreset: !!js "process.env.DSH_DOT_COMPUTER === 'off' ? 'workspace-write' : (process.env.DSH_COMPUTER_PRESET ?? 'computer')"
37
+
38
+ - insert:
39
+ - id: dot-computer
40
+ disabled: !!js "process.env.DSH_DOT_COMPUTER === 'off'"
41
+ name: 'dsh-dot-life/computer'
42
+ config:
43
+ backend: !!js "process.env.DSH_COMPUTER_BACKEND ?? ''"
44
+ port: !!js "Number(process.env.DSH_COMPUTER_PORT ?? 18080)"
45
+ image: !!js "process.env.DSH_COMPUTER_IMAGE ?? ''"
46
+ # Public origin of this dsh (your own exposure, e.g. `tailscale serve`); the live view is served there
47
+ # behind dsh's login. Never the VM gateway port: it is keyed and answers only to dsh-dot.
48
+ publicUrl: !!js "process.env.DSH_COMPUTER_PUBLIC_URL ?? ''"
49
+ # Folders shared with the VM at the same path (':' separated; ';' on Windows). Default: each session's workspace, shared on first use (see README).
50
+ mounts: !!js "process.env.DSH_COMPUTER_MOUNTS ? process.env.DSH_COMPUTER_MOUNTS.split(process.platform === 'win32' ? ';' : ':').filter(Boolean) : []"
51
+ - id: dot-subprocess
52
+ disabled: !!js "process.env.DSH_DOT_COMPUTER === 'off'"
53
+ name: 'dsh-dot-life/subprocess'
54
+ - id: dot-gate
55
+ disabled: !!js "process.env.DSH_DOT_COMPUTER === 'off'"
56
+ name: 'dsh-dot-life/gate'
57
+ config:
58
+ mode: !!js "process.env.DSH_COMPUTER_GATE ?? 'risky'"
59
+ # 3. Browser + desktop tools served from inside the VM (tool names: mcp__dot-vm__*) are mounted by the
60
+ # computer component itself, so the MCP client carries the gateway key (see docs/computer.md).
61
+ # 4. Desktop/Web UI: right-Sidebar "Computer" tab (live view) and a header toggle.
62
+ - id: dot-ui
63
+ disabled: !!js "process.env.DSH_DOT_COMPUTER === 'off'"
64
+ name: 'dsh-dot-life'
65
+ # 5. Her phone (see src/phone/phone.js). First start downloads ~2 GB from Google's repository once
66
+ # the SDK license is accepted (`/phone accept`, or acceptLicense: true here).
67
+ - id: dot-phone
68
+ name: 'dsh-dot-life/phone'
69
+ disabled: !!js "process.env.DSH_DOT_PHONE === 'off'"
70
+ config:
71
+ window: !!js "process.env.DSH_DOT_PHONE_WINDOW !== 'off'"
72
+ acceptLicense: !!js "process.env.DSH_DOT_PHONE_ACCEPT_LICENSE === 'yes' ? true : undefined"
73
+ # Live view + controls at <dsh>/dsh-dot/phone/, behind dsh's own login (no port of its own).
74
+ # publicUrl: the public origin of this dsh if you expose it (tailscale serve, remote access).
75
+ publicUrl: !!js "process.env.DSH_DOT_PUBLIC_URL ?? process.env.DSH_COMPUTER_PUBLIC_URL ?? ''"
76
+ # 6. The always-on glue (was the standalone dsh-dot plugin).
77
+ - id: dot
78
+ name: 'dsh-dot-life/dot'
79
+ disabled: !!js "process.env.DSH_DOT_CONTACT === 'off'"
80
+ config:
81
+ # dot's home: its working files live here and sessions started here are dot's.
82
+ home: !!js "process.env.DSH_DOT_HOME ?? ''"
83
+ # 6b. What she remembers (after Hermes and dsh-whale-inurqq): you, her own notes, the people she
84
+ # meets in her apps, what happened. Her conversation is handed over to a fresh session past
85
+ # handoffTokens (long before dsh's own compaction at 80% of the window). Files: <home>/memory/.
86
+ - id: dot-memory
87
+ name: 'dsh-dot-life/memory'
88
+ disabled: !!js "process.env.DSH_DOT_MEMORY === 'off'"
89
+ config:
90
+ home: !!js "process.env.DSH_DOT_HOME ?? ''"
91
+ # Next to another memory plugin: auto (people-only when one is found) · full · people-only.
92
+ coexist: !!js "process.env.DSH_DOT_MEMORY_COEXIST ?? 'auto'"
93
+ # handoffTokens: 150000
94
+ # 7. 幕间 (was the standalone dsh-interlude plugin). Shares dot's home: <home>/interlude/.
95
+ - id: dot-interlude
96
+ name: 'dsh-dot-life/interlude'
97
+ disabled: !!js "process.env.DSH_DOT_INTERLUDE === 'off'"
98
+ config:
99
+ home: !!js "process.env.DSH_INTERLUDE_HOME ?? process.env.DSH_DOT_HOME ?? ''"
100
+ # Going to look (HDSI browserIntent): auto = web first; a host listed below is always
101
+ # looked at by her — in the app on her phone (phoneApps, host → package) or in her own VM
102
+ # browser (vmSites) — read-only, no approvals. Add the sites she is logged into.
103
+ # browser: auto
104
+ # Her phone's apps she looks things up in (host → package). Only apps she has installed herself are ever used.
105
+ phoneApps: { xiaoheihe.cn: com.max.xiaoheihe, bilibili.com: tv.danmaku.bili }
106
+ # vmSites: [x.com]
107
+ # vmDailyCap: 2
108
+ # 玩: small social actions on her own accounts (like / comment / follow). How often is her own
109
+ # habit (her self notes), not a quota; DSH_DOT_PLAY=off turns it off.
110
+ play: !!js "process.env.DSH_DOT_PLAY !== 'off'"
111
+ playApps: { 小黑盒: com.max.xiaoheihe, B站: tv.danmaku.bili }
112
+ # 8. Her QQ on the computer (NapCat in the VM). /qq install once, /qq account <number>, /qq qr to log in.
113
+ - id: dot-qq
114
+ name: 'dsh-dot-life/qq'
115
+ disabled: !!js "process.env.DSH_DOT_QQ === 'off' || process.env.DSH_DOT_COMPUTER === 'off'"
116
+ config:
117
+ qq: !!js "process.env.DSH_DOT_QQ_ACCOUNT ?? ''"
118
+ githubProxy: !!js "process.env.DSH_DOT_GITHUB_PROXY ?? ''"