DeepSeek Harness plugin

dsh-session-manager-dmodysse

bundle: deploy the dsh session manager (host service + settings page) into a dsh web profile.

Jump to install

Source facts

Repository
DM-Odyssey/dsh-session-manager
Latest update
Aug 19, 2026
Category
Plugin Markets & Managers
GitHub stars
0
Format
plugin
Catalog evidence
Upstream dsh.bundle evidence
Evidence path
package.json#dsh.bundle
Checked against
0.1.0-rc.8
Upstream check date
2026-08-20

This evidence comes from the upstream catalog. This site has not installed, run, or security-reviewed the plugin.

Install

Start with a prompt that asks an agent to review the GitHub repository and source. Switch to the command if you want to install it yourself.

Copy this prompt into DSH, Codex, or another agent and ask it to review the GitHub repository and source first.

Do not install or run any commands yet. Read this plugin's GitHub repository, README, and relevant source code. Then answer the questions below clearly and directly so I can decide whether it fits my needs:

1. What is this plugin, and what problem does it solve?
2. Who is it for, and what are its typical use cases?
3. How is it used after installation? Include one minimal example.
4. What known limitations or privacy, security, compatibility, or maintenance risks does it have?
5. Give a clear recommendation: recommend, conditionally recommend, or do not recommend, with reasons.

Distinguish statements documented by the repository, inferences from source code, and unknowns. If evidence is insufficient, say so explicitly. Do not guess or simply repeat the README.

GitHub: https://github.com/DM-Odyssey/dsh-session-manager
Plugin: dsh-session-manager-dmodysse
Author: DM-Odyssey

Check the source files

Read the README and other files from this plugin directory before installing.

File explorer3 files
readme.mdSource · read only

dsh Session Manager(会话管理插件)

DeepSeek Harness 的部署级插件:在 Web 设置的「会话管理」页中,统一管理所有会话 —— 支持恢复归档删除会话按工作区分组多选/全部批量操作。作为部署级插件常驻,进程重启后自动加载。

功能

  • 恢复归档:把已归档会话移回侧边栏(通过平台 host/archived-sessions-changed 帧实时同步所有浏览器)。
  • 删除会话:移除工作区记账 + 归档隐藏 + 删除磁盘日志(冷会话立即删;运行中的会话隐藏后,等它停止自动删除)。
  • 批量删除:多选删除、删除所选、删除全部已归档、全部删除。
  • 批量恢复:恢复全部已归档。
  • 按工作区分组 的清单(含未分组),每行可 归档 / 恢复 / 删除(删除需二次确认)。
  • 状态持久化:已删/待删记录写入 .session-manager-state.json,插件/进程重启后不复活。

界面预览

「会话管理」设置页(按工作区分组、多选、批量操作):

![会话管理界面](image/示例.png)

目录结构

dsh-session-manager/
├── readme.md                      # 本文档
├── LICENSE
├── package.json                   # 项目根元信息(可选)
├── packages/
│   ├── session-manager/           # Host 服务  @deepseek-ai/dsh-session-manager
│   │   ├── src/{index.ts, types.ts}
│   │   ├── tsconfig.json / tsdown.config.ts
│   │   └── scripts/rewrite-remote-zod.mjs   # 构建后处理(见下)
│   └── client-ui-session-manager/ # 浏览器设置页  @deepseek-ai/dsh-client-ui-session-manager
│       ├── src/{index.ts, client/index.ts}
│       └── tsconfig.json / tsdown.config.ts
└── dist/                          # 构建产物(lib/,可被部署直接拷贝安装)
    ├── session-manager-lib/
    └── client-ui-lib/

架构

  • Host 侧SessionManagerService extends TypertRemoteService,通过 @Remote 暴露

list / restore / restoreMany / archive / deleteSession / deleteSessions / deleteAllArchived。 直接操作 workspace 存储域(归档集合 + 工作区记账)、调用持久化层定位并删除会话日志、维护待删队列。 Remote 贡献随包的 ./typerttypert-loader 自动注册。

  • 客户端侧:注册 settings.section 的「会话管理」页,通过 ctx.remote.sessionManager.* 调用 Host。

Remote namespace 由 dsh-api-remotes 统一挂载(平台标准路径)。

构建

前置:Node 18+、pnpm 9+;已在 dsh 仓库工具链内构建(typert 生成、client bundle 依赖其 tsdown 配置)。

# 在 dsh 仓库根目录(含本插件源码的 checkout)执行
pnpm install
pnpm build:lib:host     # Host 构建 + typert(生成 typert.host.js / typert.remote-client.js)
# 然后对 session-manager 的产物执行一次远程层 zod 重写(让浏览器 bundle 内联 zod):
node packages/session-manager/scripts/rewrite-remote-zod.mjs
pnpm build:lib:client   # 客户端 bundle

每次 Host 重建后都需重跑 rewrite-remote-zod.mjs(它把生成的 remote-client 由 import { z } from 'zod' 改写为 zod 具名导入,配合 tsdown 的 zod ESM alias,避免本仓库 rolldown 把 zod 留成外部 require("zod") 导致模块表缺失)。构建产物在 dist/(本项目已含一份当前构建结果)。

安装(拉取下来安装)

当前插件的 Host/Client 依赖 dsh 的运行时与构建环境,且 Remote 跨端挂载依赖平台共享包 dsh-api-remotes(子包尚未发布到 npm registry),因此不支持“从远端一条 dsh plugin add 命令直接装上并立即可用”。正确做法是:先把仓库拉取(clone)到本地,再从本地目录安装 (此路径已验证可用)。

1. 拉取代码

从 GitHub

git clone git@github.com:DM-Odyssey/dsh-session-manager.git
cd dsh-session-manager

2. 本地目录安装到 profile

在 clone 出的项目根目录(package.json 是一个带 dsh.bundle.patch 的 bundle 包)执行:

dsh plugin --profile web add "$PWD"
# 等价于:dsh plugin --profile web add /absolute/path/to/dsh-session-manager

dsh plugin ... add 会在 profile 里 pnpm add 这个 bundle 及其两个子包 (packages/session-managerpackages/client-ui-session-manager,以 file: 本地依赖解析), 并把识别为 bundle 的包自动加入 dsh.profile.bundles;启动时 bundle 自带的 cordis.patch.yml 作为一层补丁挂载 session-managerclient-ui-session-manager 两行。无需手工 patch/symlink。

3. 重启

npx @deepseek-ai/dsh web

重启后打开 设置 → 会话管理 即可使用。

> 备注:若子包后续发布到 npm/GitHub Packages,可把 bundle 的 dependenciesfile: 改为 > registry 版本,并调整 Remote 挂载方(当前依赖 dsh-api-remotes),届时才能真正“远程一下装”。 > 在此之前请使用“拉取下来安装”。

手工方式(备选,与该 bundle 等价)

若不便用 dsh plugin add,也可手工放置:把两个子包的 lib+package.json 拷到 ~/.local/lib/node_modules/@deepseek-ai/dsh/node_modules/@deepseek-ai/<包名>/,写 ~/.dsh/profiles/web/cordis.patch.yml(两行 insert,见下),并确保 profile 的 node_modules/@deepseek-ai/<包名> 是指向全局包的符号链接,重启。

回滚

dsh plugin --profile web remove @dm-odyssey/dsh-session-manager   # 或 pnpm remove
# 或:编辑 ~/.dsh/profiles/web/package.json,把该 bundle 从 dsh.profile.bundles 移出并删除依赖
rm -f ~/.dsh/profiles/web/cordis.patch.yml
# 重启 dsh web

使用

1. 在侧边栏(原生三点菜单)把不需要的会话「归档」; 2. 打开 设置 → 会话管理; 3. 单个:每行 归档 / 恢复 / 删除(删除需二次确认); 4. 批量:全选恢复全部已归档 (N)删除全部已归档 (N)删除所选 (N)全部删除

删除立即在所有页面隐藏会话;磁盘日志冷会话当场删除、运行中的在停止后(刷新页面或 60 秒扫描)自动清除。

数据与安全

  • 删除 = 工作区记账移除 + 归档集合隐藏 + 日志目录删除;日志路径经严格校验(只允许删除以会话 id

命名的 session.jsonl[.zstd] 所在目录)。

  • 「已删除 / 待删」记录写入 <workspace>/.session-manager-state.json;删除该文件即重置记录。
  • 归档集合里的孤立 id(对应日志已不存在的会话)会被当作清除项处理,不再反复出现。

回滚

rm ~/.dsh/profiles/web/cordis.patch.yml
rm -rf ~/.dsh/profiles/node_modules/@deepseek-ai/dsh-session-manager \
       ~/.dsh/profiles/node_modules/@deepseek-ai/dsh-client-ui-session-manager
rm -rf ~/.local/lib/node_modules/@deepseek-ai/dsh/node_modules/@deepseek-ai/dsh-session-manager \
       ~/.local/lib/node_modules/@deepseek-ai/dsh/node_modules/@deepseek-ai/dsh-client-ui-session-manager
# 重启 dsh web

许可

MIT。