dsh-session-share: Export sessions to Markdown or HTML in the DSH sidebar

Introduction

After completing an agent session in DeepSeek Harness (DSH), a common requirement is to preserve the records for colleague review, documentation, or offline archiving. Manually copying sidebar content often leads to loss of formatting, tool calls, and images; screenshots, meanwhile, are unsearchable. The community plugin dsh-session-share (maintainer Nay-1) adds a Share Session option to the “⋯” menu of the sidebar session row. It allows you to select the scope and view a preview within a panel before copying Markdown or exporting files. The plugin is categorized as a client and is currently at version v1.0.0 (MIT License). The DSH ecosystem advocates “everything is a plugin”; the SkillHub directory page is a community site and has no official affiliation with DeepSeek or Hithink RoyalFlush.

What is this

dsh-session-share adds a Share Session item to the DSH sidebar “session row ⋯ menu,” positioned between “Archive Session” and the sibling plugin’s “Delete Session” (menu slot sidebar.workspaces.session.menu.item, order 450). Clicking it opens a panel on the framework overlay shell.overlay (id: session-share.panel), rendered by the primitive Modal.

The design is strictly read-only: aside from writing export files to your chosen directory, it does not modify DSH session data.

Core Features

Operations in the Panel

Below are the four controls and three actions on the panel.

Control Description
Content Scope Full Record: Preserves user/assistant messages, reasoning processes, tool calls, and results step-by-step; Chat Only: Keeps only user and assistant body text, merging step-by-step assistant messages in the same turn into a single paragraph. Switching re-fetches the preview.
Include DSH Auto-injected Context Off by default. When enabled, preserves injected messages such as system-reminder and runtime environment snapshots, marking them as “Auto-injected by DSH”.
Preview The first 8000 characters of the same Markdown used for export, in a fixed 240px height container with scrolling content.
Save Directory Defaults to trying “Downloads”, “Desktop”, and Home directory in order; customizable, with the path stored in localStorage.

Three actions: Copy Markdown, Export .md, Export Single-file HTML. After export, Copy Path, Open containing folder, and Open file may appear (using explorer.exe, open, xdg-open etc. for Windows / macOS / Linux respectively, spawned via host subprocess; the interface only reports “System open requested” and does not falsely report success status).

Export Formats

Markdown

  • When session contains images: Creates a new folder with the same name in the save directory, containing the .md and <filename>.assets/ (attachments, tool result images, and workspace images referenced in the body are copied here, and the body uses relative paths).
  • Pure text (including “images only in fenced code”): Outputs a single .md directly without creating a separate folder.
  • If name conflict occurs: Suffixes with (2), (3), etc.

HTML

  • Single-file self-contained: Styles inline, images mostly as data: URIs, follows system light/dark themes; reasoning and tool calls collapsed using <details>.
  • If total image size exceeds 25 MB: Switches to a同名 .assets/ directory + relative references, with an explanation shown in the panel.

No truncation by default for tool results, reasoning processes, and arguments; to truncate, pass maxToolChars / maxReasoningChars / maxArgumentChars via API, or use --max-chars in CLI.

Images and Boundaries

Image sources include: attachment objects in records (attachmentId), images within tool results, and workspace images referenced by path in the conversation body. The third category is only packaged if the path falls within the cwd (session working directory) in the session header, and the extension and size meet rules; failed references are kept in the body, and the panel prompts grouped by reason. ![](...) inside fenced code blocks and inline code are not counted as references.

Installation and Activation

The installation method provided in the README is as follows (replace the placeholder with the absolute path to the local clone or extracted repository):

dsh plugin --profile desktop add "file:<absolute path to this repository>"

After installation, you must allow DSH to load the bundle. Choose one of the following:

  1. Enable it in the DSH “Plugins” page (writes to dsh.profile.bundles);
  2. Or manually add "dsh-session-share" to the dsh.profile.bundles array in ~/.dsh/profiles/desktop/package.json.

Changes require a DSH restart to take effect (bundles and clients are loaded at startup).

Uninstallation:

dsh plugin --profile desktop remove dsh-session-share

Then remove "dsh-session-share" from dsh.profile.bundles and restart.

Runtime environment requirements (from package.json): Node ^22.15.0 || >=24.0.0, peer dependency cordis >=4.0.0-rc <5.

Typical Usage

Interface

  1. Select Share Session from the row menu of the target session in the sidebar.
  2. Choose Full Record or Chat Only, and toggle “Include DSH Auto-injected Context” as needed.
  3. After viewing the preview, click Copy Markdown, Export .md, or Export HTML.
  4. After export, use Open file or Open containing folder to locate the artifacts.

Command Line (Independent of running DSH)

The repository tools/export.mjs uses a mocked cordis ctx to load the plugin host half; the logic is consistent with the interface. DSH_HOME takes priority, defaulting to ~/.dsh.

node tools/export.mjs --list
node tools/export.mjs <sessionId> --preview
node tools/export.mjs <sessionId> --format html --dir D:/share
node tools/export.mjs <sessionId> --scope chat --format md --reveal
node tools/export.mjs <sessionId> --max-chars 4000
node tools/why-skipped.mjs <sessionId>

Under MSYS/Git Bash, --dir requires an absolute path from the host perspective (e.g., D:/share).

The HTTP API is located at /session-share/api/*. Calls must include the header x-dsh-plugin-call: 1 (see the “HTTP Endpoints” section in the README for details).

Use Cases and Notes

Suitable for: Needing to share DSH sessions fully or concisely with others, writing to Wiki/PRs, or local archiving; needing Markdown folders with images or single-file HTML for offline reading.

Notes:

  • The plugin runs within the DSH desktop host subprocess and possesses permissions to read/write to your specified export directory, read session logs and attachments, and spawn system open commands. Before installing, please read the GitHub Source Code and the MIT License to ensure you accept its behavior.
  • If DSH has spilled super-large tool outputs to temporary files, the session will only retain an omission note. Export cannot recover body text not written to the log—this is unrelated to this plugin.
  • When using file: installation, pnpm performs a copy installation; after modifying source code, you need to manually sync to ~/.dsh/profiles/desktop/node_modules/dsh-session-share as per the README instructions, otherwise it may remain the old copy.

Conclusion

dsh-session-share integrates “Share Session” into the sidebar menu: preview and export share the same source, it is read-only and does not modify sessions, and it handles Markdown/HTML and image packaging. You can learn more about it from the community directory and find installation, API, and CLI details in the repository README.

  • Directory Page: https://www.skillhub.cn/plugins/Nay-1/dsh-session-share
  • GitHub: https://github.com/Nay-1/dsh-session-share
羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye