Back to home@jh1016248

dsh-save-session

DSH plugin: export the current session as filtered Markdown or rendered HTML (with TOC) via one-click buttons in the session header

Stars
0
Language
JavaScript
Created
Sep 9, 2026
Updated
Sep 9, 2026
GitHub repo

Introduction

dsh-save-session

Listed on dsh-plugin.org

一个 DeepSeek Harness (DSH) 插件:在会话头部提供两个一键下载按钮,把当前会话导出为 Markdown 或渲染后的 HTML。

功能

  • ⬇ 保存 MD — 下载 session-<时间戳>.md
  • ⬇ 保存 HTML — 下载 session-<时间戳>.html
    • Markdown 已渲染(标题 / 代码块 / 列表 / 引用 / 链接 / GFM 表格 / 行内代码 / 粗斜体)
    • 左侧目录面板:每条消息一行(角色 + 单行预览),点击跳转;窄屏自动隐藏
  • 同时注册模型工具 save_session_md:对话中说"保存当前会话为 md"即可,可选 path 参数, 默认写入会话工作目录

内容规则

导出只包含用户消息与助手正文。以下内容一律过滤:

  • 模型思考过程(reasoning)
  • 工具调用与工具结果
  • 注入的上下文 / 子代理报告

安装

dsh plugin --profile web add dsh-save-session

然后重启 profile(dsh web),按钮出现在会话标题栏右侧操作行。

工作原理

  • Host:sessionQuery.readSurface 读取会话消息 → 过滤 → 生成 md / html; webServer 注册 GET /plugins/dsh-save-session/download?session=<id>&format=md|html 按需生成并作为附件下发;tools 注册 save_session_md
  • Client:在 conversation.session.header.actions 槽位注册两个纯 <a download> 链接, 无需 RPC。

License

MIT