bwndlct/dsh-session-export

导出 DeepSeek Harness (DSH) 会话为可移植的 Markdown 和 JSON — dsh 插件

Project Overview项目介绍

This is a community plugin built specifically for DeepSeek Harness (DSH) that enables exporting active DSH sessions to portable, human-readable Markdown and structured JSON files. It pulls event trace logs from the current session to generate a self-contained conversation record that can be archived, shared, diffed, or even fed to another AI agent. The export format uses a stable, versioned schema that is decoupled from DSH’s internal implementation, ensuring compatibility across DSH updates. To install the plugin, you need DSH version 0.1.0-rc.6 or newer, and you can add it via the DSH plugin command line tool before updating your profile’s bundle list and restarting DSH.

The plugin offers two entry points to trigger an export. You can ask the DSH model to run the session_export() tool at any point during your chat to generate the export. Alternatively, you can use the /session-export slash command directly in the DSH Web UI, which triggers the export without consuming any model tokens. The plugin strictly preserves the order of all session events, including user messages, assistant responses with reasoning, tool calls and tool results. It also handles edge cases like unknown event types or very large outputs without crashing, and automatically handles cross-platform file naming conventions and never overwrites existing files.

Exported files are saved to the .dsh/exports/ directory within your current session’s working directory, which is created automatically if it does not exist. Each output file is named with the session ID and UTC timestamp to avoid conflicts. It is important to note that exported conversation records may contain sensitive data such as your source code, file paths, API responses and tool parameters. The plugin does not perform any data desensitization, so you must check the output file for sensitive information before sharing it with others. The plugin is released under the open source MIT license, and it only uses TypeScript and Node.js built-in modules with no additional runtime dependencies.

dsh-session-export 是 DeepSeek Harness(DSH)的原生社区插件,作用是将 DSH 当前会话导出为可移植、人类可读的 Markdown 文件和结构化 JSON 文件。它读取当前会话的事件溯源日志,输出自包含的对话记录文件,可供阅读、归档、分享、对比差异或供给其他 Agent 使用,导出格式采用带版本号的稳定 schema,与 DSH 内部实现解耦。

本插件提供两种触发入口:一是 session_export() 工具,可随时让模型执行导出操作;二是 /session-export 斜杠命令,支持在 Web UI 中一键触发,不消耗模型 token。它会严格按发生顺序还原所有会话事件,能处理未知事件类型、超大结果等异常场景,不会导致导出崩溃,还会自动处理跨平台文件名,绝不覆盖已有文件。

安装本插件需要 DSH 版本不低于 0.1.0-rc.6,可通过 DSH 插件命令直接安装,配置完成后重启 DSH 即可使用。导出文件会保存在当前会话工作目录的 .dsh/exports/ 路径下,目录自动创建。需要注意:导出内容可能包含敏感数据,本插件不做脱敏处理,分享前请自行检查。

Pre-install check安装前体检Compatibility · Security兼容性 · 安全性 1 warning1 项注意
  • Only 3 stars - very few users, little community feedback星标只有 3,几乎没人在用,遇到问题缺少社区反馈
DSH walks through these 9 checksDSH 会逐条核对这 9 项

Compatibility兼容性

  • DSH, Node, OS and profile requirementsDSH 版本 / Node 版本 / 操作系统 / profile 是否满足要求
  • External dependencies and runtimes (Electron / Python / Docker, ...)外部依赖与运行时(Electron / Python / Docker 等)是否齐备
  • Conflicts with installed plugins: command names, skill / tool names, ports, duplicate MCP registration与已装插件是否冲突:命令名、skill / tool 重名、端口占用、重复 MCP 注册

Security安全性

  • Repo matches the facts registered here; archived or abandoned?仓库是否与页面登记一致,是否归档或长期停更
  • Safety of preinstall / install / postinstall and install.sh / setup.ps1preinstall / install / postinstall 与 install.sh、setup.ps1 是否安全
  • curl|bash, download-then-execute, obfuscation, unrelated domains → stop immediatelycurl|bash、下载即执行、混淆代码、无关域名 → 立刻停止
  • Typosquatting or unmaintained packages among the new dependencies新增依赖里有没有 typosquatting 或无人维护的包
  • Requested permissions vs. what the feature actually needs申请了哪些权限、是否超出功能所需(filesystem / network / shell / clipboard)
  • Any sudo / admin requirement, plus uninstall and rollback是否要求 sudo / 管理员权限,以及卸载与回滚方式

Anything uncertain must be marked unknown with a note on how to confirm it. This site's signal screen is a static snapshot, not a security audit.拿不准的必须标「未知」并说明要我怎么确认。本站的信号筛查是静态快照,不能替代安全审计。

Or use CLI install (for developers)或使用命令行安装(适合开发者)

CLI Install命令行安装

dsh plugin --profile web add dsh-session-export

把 bwndlct/dsh-session-export 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

简体中文 | English

dsh-session-export

将 DeepSeek Harness(DSH)会话导出为可移植、人类可读的 Markdown 和结构化 JSON 文件。

dsh-session-export 是 DeepSeek Harness 的社区插件。它读取当前会话的事件溯源日志,输出自包含的对话记录文件——可阅读、归档、分享、diff,或喂给另一个 agent——导出格式采用稳定、带版本号的 schema,与 DSH 内部实现解耦。

特性

  • 两种入口
    • session_export() 工具 — 随时让模型执行导出
    • /session-export [markdown|json|all] 斜杠命令 — Web UI 中一键触发,零模型 token 消耗
  • 忠实还原执行顺序 — 用户消息、助手消息(含推理过程)、工具调用(含解析后的参数)、工具结果(含失败)严格按发生顺序排列
  • 稳定的导出 schema — 每个 JSON 文档都带 schemaVersion,为后续演进留出空间
  • 健壮设计 — 未知的未来事件类型、缺失元数据、恶意代码围栏、超大工具结果、非文本块均不会导致导出崩溃
  • 跨平台安全的文件名 — 处理 Windows 保留名称/字符;已有文件绝不覆盖
  • 零运行时依赖 — 仅 TypeScript + Node 内置模块

安装

需要 dsh >= 0.1.0-rc.6。

dsh plugin --profile web add dsh-session-export

然后将包加入 profile 的 package.json 中的 bundles 列表(插件自带 dsh.bundle patch manifest):

// ~/.dsh/profiles/web/package.json
"dsh": {
  "profile": {
    "bundles": [
      // ...,
      "dsh-session-export"
    ]
  }
}

完成后重启 dsh。如果要从 GitHub 而非 npm 安装:

dsh plugin --profile web add github:<your-org>/dsh-session-export

用法

直接让模型执行:

把当前会话导出成 Markdown
Export this session, json only

或在 Web UI 中直接输入斜杠命令:

/session-export            # 两种格式(默认)
/session-export markdown   # 仅 .md
/session-export json       # 仅 .json
/session-export all        # 两种格式

不想带参数?固定格式别名一个词搞定(UI 命令输入框没有枚举补全,别名最方便):

/export-md       # 仅 Markdown
/export-json     # 仅 JSON

命令在 UI 命令平面中执行——其输出不会进入模型对话历史。

导出格式

Markdown

可读的对话记录:元数据头部 + 按执行顺序排列的会话内容。工具调用将其(解析后的)参数渲染为 JSON;工具结果渲染为围栏 text 代码块——围栏会自动加宽,确保含 ``` 的结果内容不会撑破代码块。超过 8,000 字符的结果会被截断并标记。

JSON

由本插件定义的稳定文档格式(非 DSH 内部结构转储):

{
  "schemaVersion": "1.0",
  "session": {
    "id": "session-e6bb6821-…",
    "createdAt": "2026-08-14T09:52:59.798Z",
    "exportedAt": "2026-08-14T09:53:24.300Z",
    "model": "glm-5.3",
    "provider": "zai-coding-cn",
    "cwd": "/private/tmp/dsh-export-verify",
    "asOfSeq": 137,
    "eventCount": 6,
    "omitted": { "contextMessages": 2 }
  },
  "events": [
    { "type": "user_message", "seq": 6, "timestamp": "…", "content": "…" },
    { "type": "assistant_message", "seq": 9, "timestamp": "…", "content": "…", "reasoning": "…", "provider": "…", "model": "…" },
    { "type": "tool_call", "seq": 10, "timestamp": "…", "callId": "…", "tool": "bash", "arguments": { "command": "echo hi" } },
    { "type": "tool_result", "seq": 11, "timestamp": "…", "callId": "…", "tool": "bash", "success": true, "content": "hi\n" },
    { "type": "unknown_event", "seq": 99, "timestamp": "…", "eventType": "future/thing" }
  ]
}

Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →

← 上一个 Prev 7d7d 下一个 Next dsh-weixin-clawbot →