Introduction¶
The core design philosophy of DeepSeek Harness (DSH) is “everything is a plugin.” When debugging agents or generating images and tables using run_code, the output is often presented as text or file paths, making it difficult for users to view it intuitively. The dsh-csv-and-image-preview plugin addresses this pain point by rendering images, SVG files, and CSV/TSV data directly into native browser elements within the conversation flow, eliminating the need to manually open files.
Feature Overview¶
This plugin is maintained by jetecho and is open source (MIT).
- Native Rendering: Uses native
<img>tags to render images and native<table>elements to render tables. - Interactivity: Supports sticky headers and internal scrolling at 320px. Clicking a table header cycles through the sort order (ascending, descending, original).
- Invocation Methods: Supports direct calls, nested calls via
run_code, and the legacymetaformat. - Data Formats: Supports multiple image formats (SVG, PNG, JPEG, GIF, WebP, etc.) and CSV delimiters (automatically detects commas, semicolons, tabs, and pipes).
- History Replay: Supports snapshot saving and historical replay. After refreshing or restarting DSH, the same session still displays the snapshot generated at creation time.
Installation and Configuration¶
The plugin requires DSH 0.1.5-rc.1 or a compatible version. After installation, restart dsh web and refresh the browser.
dsh plugin --profile web add @jetecho/dsh-csv-and-image-preview
Usage¶
When an Agent calls the tool, it must pass arguments in JSON format.
- Preview an Image:
preview_image {"path":"D:/assets/logo.svg","label":"Logo 预览"}
- Preview a CSV File:
preview_csv {"path":"D:/data/sales.csv","label":"销售数据","maxRows":100}
- Preview Inline CSV Content:
preview_csv {"content":"姓名,分数\n张三,90\n李四,85"}
Notes:
* When both path and content are present, path takes precedence.
* Relative paths are resolved against the current session’s working directory.
* Inline SVG content can be passed directly to content.
* Both image and CSV inputs are limited to 8 MiB.
Important Considerations¶
- CSV Encoding: Only UTF-8 CSV files are supported (BOM is supported). Other encodings will trigger a conversion prompt.
- Storage Location: Preview snapshots are stored in
$DSH_HOME/storages/csv-and-image-preview/. IfDSH_HOMEis not set,~/.dsh/storages/csv-and-image-preview/is used. - Call Feedback: The tool returning “预览数据已生成” only indicates that the snapshot was saved successfully; it does not confirm that the browser has decoded and displayed it.
- Workflow Recommendation: The plugin follows a “preview-first” convention. It is recommended that Agents invoke the preview before generating or modifying a file, and write to the target file only after user approval.