Preface¶
In DeepSeek Harness (DSH) conversations, the assistant often returns file paths through tools or mentions files in the message body. These references are usually shown as plain text, which makes them hard to locate or view quickly. The dsh-file-links plugin solves this problem by automatically rendering file paths referenced in the conversation as Codex-style clickable chips. Clicking a chip opens the file in DSH’s built-in preview.
Plugin Introduction¶
dsh-file-links is a plugin in the DeepSeek Harness ecosystem, maintained by developer h1-count. Its core value is to visualize file references in the conversation context and improve the efficiency of file operations.
Core Features¶
-
Automatic Extraction
The plugin deterministically accumulates file paths referenced in each conversation turn from three types of sources:
- Thelocationsfield in tool results (such as diff and edit cards).
- Paths in tool-call arguments.
- Inline code mentions in the reply body. -
Codex-Style Chips
- Rendered as “file reference” tags with rounded pill-shaped chips.
- Icons are automatically colored based on file extensions (such as TS/JS/MD/tables/images, etc.).
- Hover highlighting is supported.
- When there are more than 8 references, they are automatically collapsed into+N. -
Click to Preview
- Uses theopenFile(workspaces.openPath) interface built into the DSH chat view.
- No need to build your own preview feature; it directly reuses the native capability. -
Security and Validation
- Before rendering, paths are validated by the host-sidefs.statcheck.
- Only existing regular files are kept; directories, noisy entries, and non-existent paths are automatically filtered out.
- Absolute paths can be opened directly, while relative paths are resolved based on the sessioncwd, avoiding path-construction errors. -
Theme Adaptation
- Style variables follow DSH theme conventions (--dsw-alias-*).
- Ensures readability under both light and dark themes.
Installation and Activation¶
Install the plugin using the official command:
dsh plugin --profile web add github:<你的账号>/dsh-file-links
After installation, restart DSH for the changes to take effect.
How It Works¶
The plugin works through both a client and a host-side component:
- Client: Registers the conversation.chat.turnTail chain and accumulates paths and renders chips through ConversationNodeDefinition (with kind file-links).
- Host: Registers the /file-links/verify HTTP route and uses fs.stat to verify path existence.
- Data Safety: The plugin only reads path metadata, does not read file contents, does not upload any data, and performs no business write operations.
Usage¶
In a DSH conversation, once the assistant uses tools to return file paths or mentions files in the body, those files are automatically rendered as clickable chips below the reply. Users only need to click the corresponding chip to open the file in DSH’s built-in preview.
Applicable Scenarios and Notes¶
- Applicable Scenarios: Suitable for developers who need to frequently reference and view local code files during conversations, especially when using DSH for code editing, debugging, or documentation generation.
- Notes: The plugin runs with the permissions of the current DSH process. Before installation, it is recommended to review the source code to confirm that it contains no malicious behavior and to verify that the license meets your requirements (MIT License).
Conclusion¶
By converting static file paths into interactive chips, dsh-file-links reduces the effort required for file operations. For more details and the source code, visit the GitHub repository.