# AI Install — 让 AI 帮你安装 dsh-trusted-page > 给 AI 编码代理(DeepSeek / Claude / 其他)的一句话提示词,以及完整可执行步骤。 ## 一句话提示词(AI install) > 请帮我安装 dsh-trusted-page 插件到 DeepSeek Harness 的 web profile:在任意目录执行 > `dsh plugin --profile web add git+https://github.com/liujuntao123/dsh-trusted-page.git`, > 然后重启 `dsh web`(可以 `kill` 进程后按原命令行拉起,注意这会中断正在运行的 > dsh 会话,需要我确认)并强刷浏览器(Ctrl+F5)。最后验证:本机打开 > 设置 → 通用,出现「远程受信域名」一行;添加远程域名后,用该域名打开的 > DSH Web 能正常加载 设置 → 模型 的提供方目录(不再报 > `settings are unavailable in this browser`)。 > 若 `dsh plugin` 不可用,则手动:`cd ~/.dsh/profiles/web && > pnpm add git+https://github.com/liujuntao123/dsh-trusted-page.git`, > 再把 `"dsh-trusted-page"` 加进该目录 `package.json` 的 `dsh.profile.bundles` > 数组后重启。 ## AI 执行时遵循的步骤(详细版) ### 1. 确认环境 - DeepSeek Harness 已安装,命令行 `dsh` 可用; - web profile 存在(`dsh web` 跑起来过,通常在 `~/.dsh/profiles/web`); - `pnpm` 可用(没有则 `npm install -g pnpm`);能访问 github.com。 ### 2. 安装(两种方式任选) **方式 A:`dsh plugin`(推荐,自动写 bundle 列表)** ```bash dsh plugin --profile web add git+https://github.com/liujuntao123/dsh-trusted-page.git ``` DSH 会自动:pnpm 安装(git 依赖)→ 检测到 `dsh.bundle` 声明 → 把 `dsh-trusted-page` 写进 `~/.dsh/profiles/web/package.json` 的 `dsh.profile.bundles`。 **方式 B:手动安装(pnpm add 后必须手动加 bundles)** ```bash cd ~/.dsh/profiles/web pnpm add git+https://github.com/liujuntao123/dsh-trusted-page.git ``` 然后编辑该目录 `package.json`,把 `"dsh-trusted-page"` 加进 `dsh.profile.bundles`: ```jsonc "dsh": { "profile": { "bundles": [ // ...既有条目 "dsh-trusted-page" // ← 必须加,否则不生效 ] } } ``` ### 3. 重启 dsh web 宿主侧插件在进程启动时加载,需要重启(会中断正在运行的会话,先征得同意): ```bash ps aux | grep "dsh web" | grep -v grep # 找到 PID kill && sleep 3 setsid nohup dsh web --no-open --port <原端口> --trusted-host <原有参数> \ >> /tmp/dsh-web.log 2>&1 & ``` > 本插件不要求 `--trusted-host`(列表可在 UI 里维护),但保留原有启动参数 > 最稳妥。 ### 4. 验证 1. 本机打开 DSH Web → 强刷(Ctrl+F5)→ 设置 → 通用:出现 「远程受信域名」行,右侧徽标显示「当前页面:已受信」(本机即回环); 2. 添加一个已路由到本服务的远程域名(如 `dsh.example.com`); 3. 用该域名打开 DSH Web(浏览器会话 Cookie 需有效,一般首次要用启动 token URL 换取),强刷一次; 4. 设置 → 模型:提供方目录正常加载;页面源码可见 `dsh-trusted-page: page trust classification` 注入脚本; 5. 命令行直验(需会话 Cookie): ```bash curl -s -b -X POST https://<域名>/api/settings/describe \ -H 'content-type: application/json' \ -d '{"type":"client-request","rpcId":"v1","method":"settings/describe","payload":{"args":{}}}' ``` 应返回 `"ok":true`,且 `namespaces` 里含 `"ns":"trusted-page"`。 ### 5. 卸载 从 `~/.dsh/profiles/web/package.json` 的 `dsh.profile.bundles` 与 `dependencies` 移除 `dsh-trusted-page`,执行 `pnpm install`,重启 `dsh web`。 已写入 `~/.dsh/settings.yaml` 的 `trusted-page` 段可手动删除或留着无害。