Preface¶
The extension approach of DSH emphasizes breaking down Web GUI capabilities into plugins. dsh-line-select addresses a specific problem: when an agent needs to modify a specific segment of code in DSH Web, providing only the file path might cause the agent to read the entire file; conversely, specifying “lines 10 to 50” requires manually entering the line numbers or original text into the input box.
The approach of dsh-line-select is to provide a line selection panel above the input box, convert the visual line range into a @path:start-end reference, and expand and inject the selected original lines by the Host side before sending. Below is an introduction to its functions, installation method, and typical usage.
What is it¶
dsh-line-select is a line selection plugin for DeepSeek Harness Web. It is used to browse workspace files, preview code with line numbers, visually select line ranges, and write @path:start-end references into the input box, allowing the agent to precisely modify specified lines.
Repository address:
- GitHub: https://github.com/fengmax1997/dsh-line-select
Verified version and license information:
- Version:
package.jsondeclares0.1.1 - License: MIT
Core Functions¶
File Tree Browsing¶
After installation, a “⛶ Line Selection” button appears above the input box. Clicking it opens a panel to browse the current workspace directory, skipping hidden files and prioritizing directories.
Preview with Line Numbers¶
Clicking a file opens a read-only code view. The view is plain text with line numbers and supports dark/light theme adaptation.
Line Range Selection¶
In the code view, click a line number as the start point, then click another line number as the end point. Both directions work; the plugin takes the min-max as the line range and highlights the selection in the view.
Write to Input Box¶
After confirming the line range, you can append a reference like @src/app.ts:10-50 to the current draft. Before sending, the Host side scans for such references in the message, reads the line range, and injects the <workspace-selection> structure, enabling the agent to see the original text of lines 10-50 without having to read the file itself.
The injected structure looks like this:
<workspace-selection path="src/app.ts" start-line="10" end-line="50">
<line n="10">...</line>
<line n="11">...</line>
</workspace-selection>
Whole File Reference¶
There is a “Select File” button at the bottom of the panel. Clicking it writes @src/app.ts to the draft. This method is used to let the agent read the entire file via the read tool, rather than injecting large file content directly into the context.
Manual Reference¶
You can also skip opening the panel and directly type in the input box:
@src/app.ts:10-50: Specify line range.@src/app.ts:10: Single line.@src/app.ts: Entire file.
How it Works¶
- Host side:
lib/index.jsprovides thelineSelectTypert Remote service, responsible for listing directories and reading files with line numbers; in theagent/pre-stepphase, it scans for@path:start-end, reads the line range, and injects<workspace-selection>. - Client side:
lib/client.jsprovides the panel UI and interaction viaconversation.input.dock, and usesinputActions.setDraftto write to the current draft.
Installation and Enabling¶
The installation command is as follows. <本目录或 tarball 路径> in the command is a placeholder and needs to be replaced with the actual path of the local plugin directory or tarball:
dsh plugin --profile web add <本目录或 tarball 路径>
Restart dsh web after installation.
Uninstall command:
dsh plugin --profile web remove dsh-line-select
Regarding dependencies, package.json declares zero third-party runtime dependencies; @deepseek-ai/dsh-typert-protocol and @deepseek-ai/dsh-llm are optional peer dependencies provided by the DSH profile.
Typical Usage¶
- Start
dsh web, find the “⛶ Line Selection” button above the input box. - Open the panel, browse the workspace directory, find the target file, e.g.,
src/app.ts. - Click the file to open the read-only code view.
- Click line 10 as the start, then line 50 as the end, confirming the selection highlight.
- Write
@src/app.ts:10-50to the current draft, add modification requirements, and send. - If you only want the agent to read the entire file, click the “Select File” button at the bottom, write
@src/app.ts, and send.
Scenarios and Notes¶
Suitable for scenarios in DSH Web GUI where you need to precisely specify a few lines of code, avoiding the agent from reading the whole file or repeatedly copying line numbers. For example, letting the agent only modify a function body, a configuration item, or code near an error function.
Pay attention to the following points before use:
- Path restrictions: All paths are forced into the session
cwdbyconfine(), rejecting absolute paths, drive letters, and..traversal. - Read-only behavior: The plugin does not write to disk or execute any file content.
- Content limits: Single file does not exceed 1MB (header only if exceeded); preview does not exceed 800 lines; single injection does not exceed 400 lines.
- Permission boundaries: The plugin runs inside the DSH process and relies on the current session’s workspace scope. It is recommended to check the source code, MIT license, and local DSH environment before installation.
- Installation path: The path placeholder in the installation command must be replaced with the actual local directory or tarball path; verified materials do not provide a command to install directly from a GitHub address.
Conclusion¶
dsh-line-select puts the steps of “seeing which lines, selecting which lines, and giving which lines to the agent” into the DSH Web input box workflow. For plugin workflows that require local code modification, it provides a more explicit line range reference method instead of handing the entire file directly to the agent.
Verified materials provide the GitHub repository address:
- GitHub: https://github.com/fengmax1997/dsh-line-select
- The community directory page address was not provided in the verified materials.