Introduction

In the DeepSeek Harness (DSH) plugin ecosystem, handling engineering drawing files (DWG/DXF) requires balancing functionality with security. Directly manipulating CAD files carries the risk of modifying source files and lacks fine-grained control over the parsing process. dsh-cad-plugin provides a set of native tools for inspecting, extracting, and exporting CAD drawings without modifying source files.

Plugin Overview

dsh-cad-plugin is a read-only DWG/DXF processing toolset designed specifically for DeepSeek Harness. It is maintained by developer roymina and is released under the MIT license. The plugin encapsulates CAD file processing capabilities through three native tools (cad_inspect, cad_extract, cad_export). Its core value lies in resource isolation and data security.

Installation

Install the plugin through the DSH command line. Replace <your-profile> with the name of the configuration profile you are currently using.

dsh plugin --profile <your-profile> add dsh-cad-plugin

After installation, the three CAD tools are automatically loaded into DSH’s list of available tools.

Tool Overview

The plugin provides three core tools. All of them return results or error information in JSON format:

Tool Name Description
cad_inspect Inspect drawing metadata, units, extents, layers, blocks, and entity statistics.
cad_extract Extract text, layers, blocks, or entities; supports JSON/CSV report output.
cad_export Export an SVG/PNG preview or perform DWG-to-DXF conversion.

Usage

Before use, place the .dwg or .dxf file in the DSH session working directory (Workspace). Then, use a natural language prompt to have the model parse the file path and call the appropriate tool.

Example prompts:

  • Inspect layers and blocks:
    > “Inspect plan.dwg and summarize its layers and blocks.”
  • Extract text to CSV:
    > “Extract all texts from ./drawings/floorplan.dxf to CSV.”
  • Generate a preview:
    > “Render an SVG preview of plan.dwg (Model layout, white background).”

Path notes:
Paths can be absolute (for example, C:\drawings\plan.dwg) or relative to the working directory (for example, plan.dwg or ./plan.dwg).

Note: The attachment button in the DeepSeek Harness Web composer currently supports images only. To process CAD files, reference the file by one of the paths above instead of uploading it directly.

Resource Limits and Configuration

The plugin uses resource protection mechanisms to prevent large or malicious files from causing system crashes. All configuration options are optional. The defaults are:

Option Default Description
outputDir ./cad-output Directory for exported files and reports.
maxFileSizeMB 50 Maximum allowed input file size.
maxEntities 200000 Maximum number of parsed entities.
maxExtractItems 500 Default limit for extracted records.
maxImageDimension 8192 Maximum pixel width/height for PNG export.
maxImagePixels 64000000 Maximum total pixels for PNG export.
maxSvgBytes 20000000 Maximum bytes for SVG output.
maxConcurrent 2 Maximum concurrent CAD tasks.
maxWorkerTimeMs 30000 Hard timeout for a single task (milliseconds).

Data Isolation and Validation

  • Output isolation: All output files are stored in an isolated directory and do not overwrite existing files with the same name.
  • DXF validation: After exporting a DXF file, the plugin reopens the file and compares text content, entity types, and layers. If severe mismatches are found, it returns a CONVERSION_VALIDATION_FAILED error.

References