Introduction¶
DeepSeek Harness (DSH) uses a plugin architecture to extend the capabilities of its native Web UI. When working with Typst documents, developers usually need to view rendered results in an external tool. The dsh-typst-preview plugin solves this problem by integrating tinymist real-time preview directly into the DSH right sidebar, providing a tab-switching experience consistent with the built-in Markdown preview.
Installation and Enabling¶
This plugin requires local installation of the tinymist tool. After installing the plugin, restart the DSH application for the configuration to take effect.
dsh plugin --profile web add github:Limbo-137/dsh-typst-preview
Core Features¶
The plugin locally starts a tinymist process to handle rendering and syntax highlighting, without any remote calls or data uploads.
- File Access: Only reads the contents of currently opened
.typfile tabs; operations are read-only and do not modify source files. - Network Behavior: No outbound traffic and no telemetry. All requests are same-origin (
/api/typst-preview/*) or loopback connections. - Command Execution: Directly starts the local
tinymistbinary (forpreviewandlsp); no Shell is used and no remote installation is performed. - Environment Dependencies: Does not read tokens, secrets, or cookies; used only to resolve the
tinymistpath and user home directory.
Usage¶
After installation and restart, open the right sidebar (Files) in the DSH Web UI and click a .typ file to enter preview.
- Preview and Source Switching: After opening a file, the sidebar displays two tabs: Preview and Source.
- Preview: This is the page rendered by
tinymist preview, driven via WebSocket. It updates in real time as you edit the document. The toolbar provides refresh, color mode switching (original / follow system / inverted, state saved inlocalStorage), and open in a new tab. - Source: Displays the file source, using
tinymistsemantic tokens for syntax highlighting (supports headings, keywords, functions, strings, mathematical formulas, labels, comments, and bold/italic markup). Supports line numbers, copy, and a “Load more” button (for large files).
If you need to force .typ files to fall back to the native text viewer, modify typstTabDefinition() in src/client/index.tsx in the source code, set priority to 'fallback', and call openResource(address, { kind: 'typst-preview' }).
Permissions and Limitations¶
The plugin is considered a “high-capability” plugin and therefore must be manually approved in the store, rather than automatically approved.
| Capability Scope | Specific Limitations |
|---|---|
| Files | Only reads .typ files in open tabs; writes no content. |
| Network | No outbound traffic and no telemetry. Requests are same-origin or loopback. |
| Commands | Starts the local tinymist binary; no Shell or remote installation is used. |
| Credentials | Does not read tokens, secrets, or cookies. |
| Lifecycle | No scripts are run during installation or updates (no preinstall/install hooks, etc.). |
External Dependency: tinymist must be installed and added to PATH (or specified via tinymistPath); the verified version is v0.15.0-rc1.
Compatibility and Notes¶
- DeepSeek Harness Version: Requires DSH
>=0.1.5-rc.1(see below for specific compatible version ranges). - Desktop Feature: The desktop application rewrites the WebSocket Origin to an internal application origin by modifying request headers (
onBeforeSendHeaders), enabling loopback connections. - Legacy Plugin: The legacy plugin (mounted on
dsh-better-sidebar) is no longer compatible and has been replaced by this new version.
Compatibility Statement:
The @deepseek-ai/dsh-client-ui-primitives peer dependency range declared in package.json is the part actually enforced by DSH. evaluatePluginCompatibility checks whether the runtime version satisfies the semver.satisfies range.
- DSH version range:
>=0.1.5-rc.1 <0.1.6-0 || >=0.1.7-rc.1 <0.2.0-0 || >=0.2.0-rc.1 <0.3.0-0 - Tested versions:
0.1.5-rc.1,0.1.5-rc.2,0.1.7-rc.2, and0.2.0-rc.1have all been verified.
Summary¶
dsh-typst-preview provides DSH users with native Typst real-time preview capabilities. Through a local compiler and a streamlined permission model, it enables an efficient document development workflow within the sidebar.