Introduction¶
The design philosophy of DeepSeek Harness (DSH) is “everything is pluggable.” During use, developers commonly face three concrete pain points: not being able to intuitively see the monetary cost of each conversation round, and having to write manual scripts to process documents or manage complex build and runtime environments. dsh-light-tool (DLT) is a permanent DSH plugin maintained by LLYlab. It addresses the above issues through six core modules: CNY cost tracking and account balance display, direct reading and preview tools for PDF / Word / Excel, and management of build/runtime environment tables with direct program execution.
Core Features¶
DLT includes the following six main modules, each of which can be enabled or disabled independently:
- CNY Cost: Displays the cost of the current round next to the usage capsule after a conversation ends, and supports clicking to view token details and session cumulative usage.
- Account Balance: Permanently displays the DeepSeek account balance in the bottom-right corner, supporting dragging and clicking to force a refresh.
- Document Tools: Allows the model to directly read and write PDF / Word / Excel / CSV files without extra scripts; supports PDF round-trip chains (convert to Word, edit, then convert back).
- Right Pane Preview: Clicking a workspace document opens it directly in the right pane for preview; PDFs are rendered by the renderer built into DSH.
- Environment Table: Manages toolchain paths (VS install root / Python / Office / Edge), supports automatic detection and system prompt injection, avoiding the model from probing on its own.
- Direct Execution: Provides the
dlt_runanddlt_buildtools, supporting direct program execution or project building in a specified environment.
Installation and Enablement¶
DLT declares dsh.bundle.patch in package.json. After installation, it is automatically merged into the bundle layer of the current profile, without manually modifying configuration files.
Installation via npm is recommended:
dsh plugin --profile web add dsh-light-tool
After installation is complete, restart DSH. The plugin will appear in “Settings → Plugin List”.
Runtime Toggles¶
DLT provides a runtime toggle manager, located on the settings page.
- Instant Effect: Modifying the master toggle or individual module toggles on the settings page takes effect immediately without a restart; the plugin will immediately unload/load the corresponding model tools (such as
dlt_run) and UI components. - Persistence: Toggle states are written to
<DSH_HOME>/dlt/switch.json(default path) and persist after restart. If the file is corrupted, it falls back to the default values from the configuration file. - Configuration Priority: The
configfield incordis.patch.ymlonly provides defaults for the first run; once toggles have been modified on the settings page,switch.jsontakes precedence thereafter.
Typical Usage¶
DLT provides the following model tool functions:
-
dlt_run(env, program, args, cwd, timeoutMs, stdin)
Executes a program in a specified environment and returns stdout/stderr and the exit code. For example,env=msvc-x64automatically injects vcvarsall, making theclandlinkcommands available. -
dlt_build(target?, configuration?, platform?, rebuild?)
Invokes MSBuild to build a project, supporting specification of target, configuration, platform, and rebuild options. -
dlt_doc_read(path, mode?, pages?, sheets?, range?, formulas?, maxRows?)
Reads document content. Supports PDF (page-by-page text), Word (paragraphs + tables), Excel (row/column data), and CSV. -
dlt_doc_write(path, action?, ops?, spec?, out?, chain?, replacements?)
Writes or modifies documents. Write operations automatically create a backup in the same directory as.bak-YYYYmmdd-HHMMSS.<ext>. Supports PDF round-trip chains (chain=word) and various document format conversions. -
dlt_doc_convert(path, to, ...)
Performs format conversion. For example,to=docx|html(from PDF),to=pdf(from Word/Excel), andto=png(export a PDF page as an image).
Dependencies and System Requirements¶
DLT depends on software and the Python environment installed on the local machine:
- Python: Python 3.12 must be installed.
- Python Libraries:
pymupdf,pypdf,python-docx,openpyxl,pdf2docx, andpywin32must be installed. - Office and Edge: Document export and HTML→PDF conversion rely on locally installed Office COM components and Microsoft Edge.
Configuration¶
DLT applies configuration as a whole-block replacement (not a deep merge) through the config field in cordis.patch.yml. The main configuration items include:
- Toggles:
enabled(master toggle),cost,balance,documents,preview,environment,run(default values for each module). - Environment:
pythonEnv(interpreter path),environments(environment table path override). - Cache:
cacheDir(pricing and balance snapshot directory),balanceCacheMs(balance cache duration). - Execution:
docTimeoutMs,runTimeoutMs,maxOutputBytes(output limit),defaultSolution,defaultConfiguration,defaultPlatform.
Conclusion¶
DLT is a feature-complete permanent DSH plugin that covers core needs for cost monitoring, document processing, and development environment management. Through runtime toggles and configuration override mechanisms, it can flexibly adapt to different workflows. More implementation details and test cases can be found in its GitHub repository.
- Repository: https://github.com/LLYlab/DLT
- Catalog page: https://www.skillhub.cn/plugins/LLYlab/DLT