# AI Install — 让 AI 帮你安装 dsh-mobile-keys > 给 AI 编码代理(DeepSeek / Claude / 其他)的一句话提示词,以及完整可执行步骤。 > 你也可以把本文件路径直接发给 AI: > `https://github.com/liujuntao123/dsh-mobile-keys/blob/main/AI_INSTALL.md` ## 一句话提示词(AI install) > 请帮我安装 dsh-mobile-keys 插件到 DeepSeek Harness 的 web profile:在任意目录执行 > `dsh plugin --profile web add git+https://github.com/liujuntao123/dsh-mobile-keys.git`, > 然后重启 `dsh web`(可以 `kill` 进程后按原命令行拉起,注意这会中断正在运行的 dsh 会话, > 需要我确认)并强刷浏览器(Ctrl+F5)。最后验证:浏览器控制台执行 > `window.__dshMobileKeys.getStatus()` 确认返回 `{ mode, detected, effective, bindings }`; > 输入框输入 `/mobilekeys` 确认菜单能弹出;设置面板 → 通用里确认出现「移动端热键模式」开关。 > 若 `dsh plugin` 不可用,则手动:`cd ~/.dsh/profiles/web && pnpm add git+https://github.com/liujuntao123/dsh-mobile-keys.git`, > 再把 `"dsh-mobile-keys"` 加进该目录 `package.json` 的 `dsh.profile.bundles` 数组后重启。 ## AI 执行时遵循的步骤(详细版) ### 1. 确认环境 - DeepSeek Harness 已安装,命令行 `dsh` 可用; - web profile 存在(`dsh web` 跑起来过,通常在 `~/.dsh/profiles/web`); - `pnpm` 可用(没有则 `npm install -g pnpm`); - 能访问 github.com(git 依赖需要)。 ### 2. 安装(两种方式任选) **方式 A:`dsh plugin`(推荐,自动写 bundle 列表)** ```bash dsh plugin --profile web add git+https://github.com/liujuntao123/dsh-mobile-keys.git ``` DSH 会自动:pnpm 安装(git 依赖)→ 检测到 `dsh.bundle` 声明 → 把 `dsh-mobile-keys` 写进 `~/.dsh/profiles/web/package.json` 的 `dsh.profile.bundles`。 **方式 B:手动安装(pnpm add 后必须手动加 bundles)** ```bash cd ~/.dsh/profiles/web # Windows PowerShell: cd $env:USERPROFILE\.dsh\profiles\web pnpm add git+https://github.com/liujuntao123/dsh-mobile-keys.git ``` 然后编辑该目录 `package.json`,把 `"dsh-mobile-keys"` 加进 `dsh.profile.bundles`: ```jsonc "dsh": { "profile": { "bundles": [ "@deepseek-ai/dsh-base", "@deepseek-ai/dsh-web-app", "dsh-mobile-keys" // ← 必须加,否则不生效 ] } } ``` ### 3. 重启 dsh web ⚠️ **先告知用户**:所有 dsh 会话(含正在运行的 agent)都由 `dsh web` 进程承载, 重启会中断它们,确认没有正在执行的任务再继续。 ```bash # 找到进程(示例) pgrep -af 'dsh web' # 停止后按原命令行重启(把 <原始命令行> 换成上一步看到的完整命令) kill && sleep 3 (setsid nohup <原始命令行> >> /tmp/dsh-web.log 2>&1 &) # 健康检查 curl -s -o /dev/null -w '%{http_code}\n' http://127.0.0.1:3080/ ``` ### 4. 验证(装完必做) 1. 浏览器 **Ctrl+F5** 强刷; 2. 控制台执行 `window.__dshMobileKeys.getStatus()` → 应返回 `{ mode: 'auto', detected: , effective: , bindings: { send, newline } }`; 3. 输入框输入 `/mobilekeys` → 应弹出 自动检测 / 开启 / 关闭 菜单; 4. 设置面板 → 通用 → 应出现「移动端热键模式」开关行; 5. (可选)`/mobilekeys` 选「开启」后:`Enter` 在输入框插入换行、`Ctrl+Enter` 发送; 选「关闭」后恢复 `Enter` 发送 / `Shift+Enter` 换行。 ### 5. 排查 | 现象 | 处理 | | --- | --- | | 控制台 `window.__dshMobileKeys` 为 undefined | 检查 `~/.dsh/profiles/web/package.json` 的 `dsh.profile.bundles` 是否含 `dsh-mobile-keys`;`dsh web` 是否重启过;浏览器是否强刷 | | `dsh web` 启动日志报插件加载错误 | 查看 `/tmp/dsh-web.log`(或你的日志路径);确认 node_modules 里 `dsh-mobile-keys/lib/client.js` 存在 | | 设置面板没有开关行 | 强刷;确认 slots 服务正常(其他插件如 dsh-web-mobile 是否工作) | | 移动端仍不能换行 | `/mobilekeys` 先手动「开启」排除检测问题;检查是否聚焦在提问卡输入框(那里不受影响) | ### 6. 卸载 ```bash cd ~/.dsh/profiles/web pnpm remove dsh-mobile-keys # 并从 package.json 的 dsh.profile.bundles 数组中删除 "dsh-mobile-keys" # 然后重启 dsh web + 强刷浏览器 ```