Introduction¶
When developing or debugging agents in DSH Web, sessions often include sub-agents, tool calls, and reasoning processes. If you need to keep a record offline, hand it to colleagues for review, or view the full trajectory in an offline environment without connecting to the Host, common practices are taking screenshots, copying snippets, or relying on external services to render logs. These two methods either lose structure or make it hard to guarantee “view immediately without server dependency.”
@wtywtykk/dsh-export-viewer (Repository wtywtykk/dsh-export-viewer) adds an export button in the session header, bundling the current conversation and all its sub-agent sessions into a self-contained HTML file. Double-click to open in a browser; the page template and resources are inlined, requiring no additional static server or CDN.
Overview¶
Maintained by wtywtykk. The plugin is positioned for DSH’s export and offline viewing capabilities: reading session events from the Host, folding them into a page model, inlining assets/, and handing the result to the user for download. Directory page: SkillHub - dsh-export-viewer.
Current package version is 0.1.0 (see package.json), license MIT. Requires DSH 0.2.x; session formats v0–v4 are all exportable. The plugin requires no configuration, and there is no Config section in the README.
Core Features¶
UI Entry and Export Process¶
- The button is attached to
conversation.session.header.utilities(right side of the session header, between...and panel buttons). - The icon is a download symbol with a hover tooltip “Export Conversation (HTML)”.
- Upon clicking, the client requests:
api/session.viewer?sessionId=…&includeDescendants=true
- Host-side steps:
- UsesessionQuery.readSessionto read the root session;
- UsesessionQuery.traceSessionto find all descendants and read them one by one;
- Useattachments.readImageto convert images appearing in the session to data URLs;
- Generate the model, inlineassets/, and trigger a download asdsh-session-<id>.html.
During export, the button shows loading; a checkmark briefly appears on success; a red exclamation mark appears on failure, with the error reason in the tooltip.
Export Page Capabilities¶
The reading experience listed in the README includes:
- Round folding, reasoning folding;
- Right-side quick navigation;
- Trajectory view, overview view;
- Light and dark themes.
All rounds are folded by default (including the latest round): by default, only user messages, injected prompts, folded rows, and the final reply are visible; reasoning, tool calls, and intermediate replies require expanding the folded rows, and the reasoning body requires clicking the “Thinking” row again.
Sub-agents: appear in the “Sessions” list on the left side of the export page, indented by delegation depth; jump links are provided in the main session where sub-agents are invoked.
Images: images in user messages, assistant messages, and tool results are inlined as data URLs and displayed in bubbles and expanded tool results; clicking opens the original image in a new tab. Markdown images  are rendered: local paths are read based on the session cwd and converted to data URL (single-page image budget cap 64 MB raw bytes), http(s): / data: are preserved as is; path mapping is placed in the media field of the page data.
Code Structure (for secondary development)¶
dsh-export-viewer/
├─ index.js # Host: /api/session.viewer download route
├─ client.js # Client: session header button (loading / success / failure states)
├─ viewer-model.js # Host: buildViewer / renderViewerHtml
├─ assets/ # page.html, styles.css, app.js, markdown.js (inlined during export)
├─ locale/ # Plugin manager title/description (en / zh)
├─ icon.svg
└─ cordis.patch.yml
assets/ is the sole source for the export page template: the Host reads and inlines it on every export request; changes to the template take effect on the next export, no need to restart DSH.
Installation and Activation¶
Install this bundle via the DSH Plugin Manager. The bundle name is:
@wtywtykk/dsh-export-viewer
During local development, you can add the repository directory to the target profile as a bundle. The specific search and enable steps in the manager depend on your current DSH version interface; the install command depends on the plugin directory and the original README text; do not manually concatenate CLI commands not appearing in the documentation.
It is recommended to browse the GitHub repository source code and the MIT license before installing. The plugin reads sessions and local image paths under the current dsh process permissions; please confirm whether this fits your security policy before installing.
Typical Usage¶
- Open the session to be archived in DSH Web (the dialogue tree including sub-agents).
- Click the download icon on the right side of the session header and wait for the Host to generate the HTML.
- After the browser saves
dsh-session-<id>.html, open it offline by double-clicking; when you need to see the complete tool trajectory, prefer the Trajectory View (README note: the chat view renders based on raw logs,surfaceOp: replacemay list new and old messages side-by-side, the current surface takes Trajectory View as the standard).
No configuration file changes; no extra environment variables.
Template Customization¶
If you need to adjust the export page style or Markdown rendering, directly edit the four files under assets/ in the package, save, and export again to verify. There is no need to reload the plugin bundle (each export re-reads the disk assets/).
Applicable Scenarios and Limitations¶
Suitable: Scenarios where a complete agent session (including sub-agents, reasoning, and tool processes) needs to be packaged for review, archiving, or offline reading; delivery artifacts that are single files without external dependencies.
Notes (excerpt from README):
- Images exceeding the single-page 64 MB raw byte budget will be skipped.
- Regular file attachments are not inlined; only text is retained in messages.
- The entire HTML is generated in the Host’s memory and returned at once; if there are many images or sub-agents (hundreds, totaling hundreds of MB), it will consume significant memory and cause noticeable waiting time before download.
- The community directory SkillHub is an independent site with no official affiliation with DeepSeek / Huafan; the DSH ecosystem philosophy is “everything is a plugin”; this plugin is a community-maintained bundle.
Conclusion¶
dsh-export-viewer converges the “current session + descendant sub-agents” into an offline-openable HTML, inlining templates and images as much as possible into the single page. If you are already using DSH 0.2.x for Web development and debugging, you can install @wtywtykk/dsh-export-viewer via the Plugin Manager and export with one click from the header, then view the trajectory and overview in the browser.
- Directory page: https://www.skillhub.cn/plugins/wtywtykk/dsh-export-viewer
- Source and description: https://github.com/wtywtykk/dsh-export-viewer