Export sessions to Markdown/JSON for review, replay, and per-session cost summaries.
Install
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:yangyongzhen/dsh-session-export
Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).
README
This plugin publishes its README in Chinese only.
DeepSeek Harness 会话导出与复盘插件:把 agent 会话自动导出为 Markdown 文件,供复盘、写博客、审计使用。
- 监听
session/event事件流,turn 结束并静默debounceMs后自动导出 - 输出
$DSH_HOME/exports/session-<id>.md(默认~/.dsh/exports/) - 进程退出(含 headless 一次性任务)时同步 flush 未导出的会话,不丢记录
- 渲染纯函数模块化导出,其他插件可复用
安装
# 本地 checkout 安装(推荐,免构建)
dsh plugin --profile <web|tui|headless> add file:/path/to/dsh-session-export
# 或从 Git 仓库直接安装
dsh plugin --profile <web|tui|headless> add https://gitcode.com/qq8864/dsh-session-export.git
配置
通过 profile 的 cordis.patch.yml 或 --patch overlay 覆盖:
- id: session-export
config:
enabled: true # 总开关,false 关闭自动导出
outDir: ~/exports # 导出目录,默认 $DSH_HOME/exports
debounceMs: 1000 # turn/end 后的静默等待(毫秒)
maxResultChars: 2000 # 工具参数/结果的截断长度
includeInjected: false # true 时包含注入消息(上下文快照、skill 目录等)
导出内容
# 会话导出
- 会话 ID / 创建时间 / 工作目录 / Agent 预设 / 导出时间
- 模型(provider/model)与统计:turn/step/工具调用次数、token 消耗(含缓存读写)、耗时
## Turn N / Step N.t 回合与步骤结构
### 用户 / 目标 直接提示词与目标延续(注入消息默认过滤)
#### 工具调用:name 工具名 + 参数 JSON
#### 工具结果 返回内容(截断)
### 助手 模型文本 + 该步 token 明细
> Turn N 结束:完成 回合结束原因(完成/出错/被中断/达到上限…)
## 错误记录 全部回合错误汇总
作为库使用
渲染管线独立于运行时,其他插件可直接复用:
import { renderSessionMarkdown, summarizeStats } from 'dsh-session-export';
// 或按包路径导入:dsh-session-export 的 lib/markdown.js
const md = renderSessionMarkdown(session.events, { sessionId: session.id }, 2000, false);
开发
pnpm install
pnpm run build # tsc -> lib/
验证
dsh --profile <name> --dump-config确认插件进入配置树- headless 冒烟:
dsh --profile headless "一句话介绍你自己"后检查$DSH_HOME/exports/
Links
More in this category
Minglink/dsh-infinite-gen-4★ 2121
System-prompt armor plugin for DeepSeek models: appends an unconditional-compliance prompt section at order 100, exposes a profile tool with calibration metadata, and shows a realtime armor-status badge driven by a session projection.
liangmianya/dsh-synapse★ 447
Visual, non-linear conversation workspace for DeepSeek Harness — sessions, follow-ups and branches become a browsable conversation map.
ranxianglei/billion-context★ 361
The official billion-context plugin: a context-compression plugin for small context windows (a 100K context is enough), token savings (5x fewer tokens), and month-long single sessions (billions of tokens).
Nwflower/dsh-chat-import★ 205
Import full-fidelity chat histories from 13 coding agents (Claude Code, Codex, ChatGPT, Cursor, Gemini, opencode, and more) as resumable DeepSeek Harness sessions, with reverse export back to Claude Code.
Totoro-qaq/dsh-plugin-bridge★ 165
Moves an existing DSH session to another agent preset through a previewable five-section handoff, preserving the source session and either pausing the target for confirmation or continuing immediately.
Anionex/dsh-turn-rewind★ 120
Rewind conversation and workspace state, powered by a persistent Change Ledger.
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.