# 安装 ## 前置 - DSH Desktop(或等价的 DSH profile),Node ≥ 22。 - profile 目录默认 `~/.dsh/profiles/desktop`,插件目录默认 `~/.dsh/plugins/`。 ## 一键安装(推荐) ```bash cd dsh-session-dustbin pnpm install # 仅开发依赖;宿主依赖见 package.json node build-client.mjs # 产出 lib/client.js(仓库已提交,可跳过) node sync-profile.mjs ``` `sync-profile.mjs` 会: 1. 把本目录(去掉 `node_modules` / `.git`)镜像到 `~/.dsh/plugins/dsh-session-dustbin`; 2. 在 profile 的 `package.json` 里补上 `@local/dsh-session-dustbin` 的 `file:` 依赖与 `dsh.profile.bundles` 条目; 3. 在 profile 目录执行 `pnpm install`(`file:` 依赖是**拷贝**,改插件目录后必须重装才会生效); 4. 校验 profile 副本里有 `lib/index.js` + `lib/client.js`。 自定义 profile: ```bash node sync-profile.mjs --profile "C:/Users/<你>/.dsh/profiles/desktop" ``` ## 生效步骤 1. **完整重启 DSH Desktop**(bundle 列表在启动时读取;退出托盘进程后再启动)。 2. 刷新 Web GUI 页面(F5)。 3. 验证: - 任意会话行「⋯」菜单里出现「删除会话」(在「归档会话」下方); - 设置 → 插件 → 可配置 出现「会话纸篓」卡片。 ## 卸载 1. 从 profile 的 `package.json` 删除依赖与 `dsh.profile.bundles` 里的 `@local/dsh-session-dustbin`; 2. `pnpm install`(在 profile 目录); 3. 删除 `~/.dsh/plugins/dsh-session-dustbin`; 4. 重启 DSH Desktop。 已删除的会话不会被恢复(删除是永久操作)。