证据快照复核于 2026-09-16GitHub 数据核对日期: 2026-08-21
证据已验证Plugin Bundle文件与文档default Profile

dsh-file-convert

用于在本机转换、检查和优化常见文件的 DeepSeek Harness 插件。

快速了解

它能做什么

用于在本机转换、检查和优化常见文件的 DeepSeek Harness 插件。

本站提供的是中文说明,不代表该项目或 Plugin 自身提供中文界面;语言支持请以上游文档为准。

使用场景
文件与文档文件自动化数据
适配技术
deepseek-harnessnodejsffmpeglibreofficetesseract
兼容性

default Profile
DeepSeek Harness 0.1.5-rc.2; Node.js ^22.19.0 || >=24.0.0

可信度与状态

证据已验证
核对日期 2026/9/14 UTC 14:07

有代码证据的贡献

它为 DSH 增加什么

七个本地文件转换工具

在 DSH 会话中转换、批量转换、检查、优化文件并检查可用性,覆盖图片、PDF、数据、媒体、办公文档和 OCR 工作流。

机制证据

选择前先看

当你希望智能体在同一台机器上处理文件、而不是上传到在线转换服务时,可以使用这个社区 DSH 插件。它提供七个工具,覆盖图片、PDF、JSON/YAML/CSV、媒体、办公文档、OCR、批量处理、文件检查和体积优化;支持 PNG/JPG/WebP、SVG、PDF、JSON、YAML、CSV、MP4、MOV、WAV 及部分办公格式。

适合谁

需要让 DeepSeek Harness 智能体处理或检查本地工作文件的用户,尤其适合图片、PDF、结构化数据和批量文件处理。

常见任务

  • 将指定 PDF 页面渲染为 PNG、JPG 或文本。
  • 在 JSON、YAML 和 CSV 的支持格式之间转换。
  • 将文件夹中的图片批量转换为 WebP。
  • 在转换前按文件内容检查文件信息。
  • 将图片、PDF 或视频优化到目标体积附近。

权限与数据

该插件设计为本地文件处理,但会读取输入文件并在机器上写入转换结果。

权限
  • 读取被选作转换或检查对象的本地输入文件。
  • 写入输出文件;默认在输入文件旁创建输出。
  • 按需调用本机可用的 FFmpeg、LibreOffice、Ghostscript、Python 或 Tesseract 等可选二进制工具。
数据处理
  • README 声称转换文件留在本机,插件不会上传文件。
  • 可通过 outputRoots 限制显式输出路径,但默认的“输入文件旁输出”不受该限制。
外部服务
  • 常规本地转换未描述需要 API 密钥或转换服务器。
  • 可选媒体设置可能从 npmmirror 下载固定版本的 FFmpeg,并以 GitHub Release 作为后备来源。
  • 可选 OCR 设置会在征得同意后下载 tesseract.js 语言数据。
凭据
  • 未描述需要 API 密钥。

局限

  • 媒体转换需要 FFmpeg;办公文档转 PDF 需要 LibreOffice;PDF 压缩需要 Ghostscript。
  • PDF 转 DOCX 为实验性功能;OCR 和办公文档转 PDF 的结果可能与原始版式或文本存在差异。
  • 项目声明其为非官方社区插件,且 DSH API 可能变动。
  • 它不是操作系统级沙箱;面对不可信的多租户工作负载,应额外使用操作系统隔离。

DSHub 已核对

  • 已采集固定 Git 提交、包清单和 DSH Bundle patch,且结构验证通过。
  • 提供的 README 声明有七个工具、26 种转换,并面向 DeepSeek Harness 0.1.5-rc.2。
  • 清单声明 Node.js ^22.19.0 || >=24.0.0,以及 Cordis 和 dsh-tools peer 依赖。

DSHub 未核对

  • 提供的证据未实际执行安装或运行时行为。
  • 未审计 npm 包的实际内容。
  • 未独立测试转换保真度、仅本地处理、下载校验或工具可用性等声明。

固定版本安装

安装 dsh-file-convert

这个Plugin Bundle没有 DSH Plugin 安装操作,请根据源码文档使用真实交付方式。

访问源码项目

维护者原文

项目 README

查看 commit f8dd9b0 对应的 README
维护者编写的上游内容原文于 2026/9/14README.md 获取,正文和仓库相对媒体固定到 commit f8dd9b04e64b,内容哈希为 be60a866d451。以下是未经 DSHub 翻译的上游原文,语言可能与当前页面不同;第三方托管的 badge 可能独立更新。

dsh-file-convert

Local-first file conversion for DeepSeek Harness.

Convert images, PDFs and data files directly inside your DSH agent sessions — no API keys, no uploads, no servers, no token cost for the conversion itself. Files never leave your machine.

Unofficial community plugin. Not affiliated with or endorsed by DeepSeek.

Compatibility: v0.4.5+ targets DeepSeek Harness 0.1.5-rc.2 and its canonical-output tool API. Node.js ^22.19.0 || >=24.0.0 is required.

Why

Agents constantly need file conversions: "turn this PDF into images", "give me that JSON as YAML", "convert all JPGs in this folder to WebP". Instead of shelling out or pasting data around, dsh-file-convert gives your agent seven purpose-built tools backed by battle-tested local libraries.

  • Local execution — files never leave the machine
  • No API key, no server, no conversion tokens
  • Natural language friendly — the agent calls the tools, you just ask
  • Batch conversions with a compact summary
  • Honest failures — missing dependency, unsupported pair, existing output: every error says exactly why
  • Images, PDF and data need zero external binaries — prebuilt npm packages only. Media needs one tool (ffmpeg), clearly reported when missing

Supported conversions

Source Targets
PNG, JPG, WEBP PNG, JPG, WEBP (any-to-any)
SVG PNG, JPG, WEBP
PDF PNG, JPG, TXT
JSON YAML, CSV
YAML JSON, CSV
DOCX, PPTX, XLSX PDF
PDF PNG, JPG, TXT, DOCX (experimental); TXT supports OCR for scanned PDFs
MP4 GIF, MP3
MOV MP4
WAV MP3
CSV JSON, YAML

26 conversions. Images, PDF and data work out of the box via npm install. Optional tools unlock the rest, each clearly reported by list_conversions when missing:

  • FFmpeg -> media rows. Install it system-wide (preferred for untrusted media), or ask the agent to run install_media_dependencies — it downloads pinned current builds (FFmpeg 6.1.1, ~56 MB total, one time) into the plugin cache, sha256-verified, from the npmmirror binary CDN with the GitHub release as fallback.
  • LibreOffice -> DOCX/PPTX/XLSX to PDF. winget install TheDocumentFoundation.LibreOffice / brew install --cask libreoffice / apt install libreoffice.
  • Ghostscript -> PDF compression in optimize_file.
  • Python + pdf2docx -> the experimental PDF to DOCX row (pip install pdf2docx).
  • Tesseract (optional) -> faster OCR for scanned PDFs; without it the bundled tesseract.js is used and its language data is fetched explicitly via install_ocr_dependencies (winget install UB-Mannheim.TesseractOCR).

Install

Inside a DSH profile — three ways, easiest first:

# 1. from npm (once published)
dsh plugin --profile default add dsh-file-convert

# 2. straight from GitHub (a `prepare` build runs; allow it once)
dsh plugin --profile default add github:zzy-12345678/dsh-file-convert

Git installs may ask you to allow the build step in the profile's pnpm-workspace.yaml:

First-install note: pnpm may also ask you to decide on a build script for tesseract.js (it only shows a donation notice — skipping is safe). Set it in the same file and re-run the install:

allowBuilds:
  tesseract.js: false
allowBuilds:
  dsh-file-convert: true

From a local checkout (e.g. while hacking on it):

git clone https://github.com/zzy-12345678/dsh-file-convert
cd dsh-file-convert && npm install && npm run build
dsh plugin --profile default add /absolute/path/to/dsh-file-convert

Then restart DSH (dsh web or your usual entry point). All seven tools appear automatically.

The seven tools

convert_file

Convert one file.

{ "input": "/tmp/report.pdf", "output_format": "png", "dpi": 200 }
Converted: /tmp/report.pdf (pdf) -> /tmp/report.png (png)
1.2 MB -> 431.0 KB in 1.4s
  • Default output: next to the input file, same base name, new extension.
  • Multi-page PDFs produce <name>-<page>.<ext> for every page; pages: "1-3,5" selects pages (outputs keep their real page numbers, text joins only the selection).
  • Scanned PDFs → TXT: ocr: true (optionally ocr_lang, default chi_sim+eng) recognizes the rendered pages instead of the text layer. Engine priority: a local Tesseract CLI, then the bundled tesseract.js (whose language data is never downloaded implicitly — run install_ocr_dependencies first, about 10-30 MB per language).
  • Existing outputs are refused unless overwrite: true.
  • Options: output, overwrite, quality (1–100), dpi (PDF/SVG rasterization), pages, ocr, ocr_lang.

batch_convert

Convert every matching file in a directory (top level).

{ "input_dir": "/home/me/Pictures", "output_format": "webp" }
Batch convert in /home/me/Pictures -> WEBP
Converted: 18, skipped: 2, failed: 0
Output dir: /home/me/Pictures/output
  • input_format filters by source format; omit it to auto-detect every convertible file.
  • output_dir defaults to <input_dir>/output.
  • Existing outputs are skipped (not overwritten) unless overwrite: true.

inspect_file

Facts before action, detected from file content — not just the extension:

{ "input": "/tmp/scan.pdf" }
{ "kind": "pdf", "pages": 24, "encrypted": false, "likelyScanned": true, "bytes": 13000000 }

optimize_file

Shrink a file toward a target size instead of converting it:

{ "input": "video.mp4", "target_size_mb": 20 }
Optimized: video.mp4 (mp4) -> video-min.mp4
18.3 MB -> 19.7 MB (target 20 MB) in 41.2s
Applied: two-pass x264: video 512k + audio 128k over 185.0s
  • MP4/MOV: two-pass x264, the video bitrate is computed from the target (audio 128k, dropping to 64k for tight targets); output is always MP4. Requires ffmpeg + ffprobe.
  • JPG/WEBP: binary-searches the highest encoder quality that fits; PNG uses palette reduction. No external tools needed.
  • PDF: Ghostscript quality presets (printer/ebook/screen), first preset that fits the target wins; requires Ghostscript.
  • Targets below what the codec can physically reach are refused with the achievable minimum.
  • GIF optimization is not supported yet.

install_media_dependencies

One-call media setup: downloads pinned FFmpeg 6.1.1 static builds (ffmpeg + ffprobe) into the plugin cache (~/.dsh-file-convert/bin), verifies the pinned sha256, and proves the binaries run before reporting success. Served from the npmmirror binary CDN with the GitHub release as a byte-identical fallback. System installs keep priority over the cache. Ask the user for consent first — it is a sizable download.

install_ocr_dependencies

Downloads the tesseract.js language data (about 10-30 MB per language, chi_sim+eng by default) into the plugin cache, so ocr: true works without a local Tesseract. Skips when a local Tesseract CLI is installed or the data is already cached. Ask the user for consent first — conversions never download language data implicitly.

list_conversions

All 26 conversions with their live availability on this machine — unavailable rows name the missing tool and how to install it. Images, PDF and data rows are usable out of the box; media, office and PDF-compression rows depend on the optional tools (media can even be set up by the agent via install_media_dependencies).

Plugin config

Key Default Meaning
quality 85 Default JPEG/WebP quality (1–100)
dpi 150 Default rasterization DPI for PDF inputs
timeoutMs 120000 Cooperative timeout for one conversion
maxInputMb 2048 Refuse inputs above this size (MB)
maxPdfPages 200 Full-document PDF rasterization refuses more pages; use pages for larger documents
maxOutputPixels 16000000 Clamp rasterized pixels per page (width × height) to this budget

Limit coverage: maxInputMb applies to convert, batch, inspect and optimize alike; maxPdfPages applies to PDF rasterization and text extraction (both implicit full-document runs and explicit pages selections); maxOutputPixels applies to PDF rasterization, OCR rendering and SVG rasterization; timeoutMs truly cancels every conversion (the underlying work stops, it is not merely abandoned). | batchMaxFiles | 500 | Max files examined per batch_convert run; beyond it the summary reports what was skipped instead of silently capping | | outputRoots | [] | When non-empty, explicit output paths must resolve inside one of these directories (recommended for shared deployments; the default next-to-input output is always exempt) | | ffmpegPath / ffprobePath | - | Explicit binary paths when ffmpeg is not on PATH (common on Windows) | | sofficePath / ghostscriptPath / pythonPath / tesseractPath | - | Explicit paths for the optional tools, overriding auto-detection |

Architecture

                         DSH
                          │
                    dsh-file-convert
           ┌──────────────┴──────────────┐
     src/index.ts                   src/core/            ← the whole engine,
     (thin DSH glue:                (no DSH imports)       testable standalone
      name/inject/apply,                 │
      Config schema,                ConversionRouter
      7 tool registrations)              │
                       ┌─────────────────┼─────────────────┐
                       ↓                 ↓                 ↓
                 ImageConverter     PdfConverter      DataConverter
                    sharp          pdfjs-dist         js-yaml
                 (libvips npm)   @napi-rs/canvas    csv-parse / stringify
                                                     MediaConverter        OfficeConverter
                                                        ffmpeg (detected)      LibreOffice (detected)
                                                     PdfToDocxConverter    optimize_file/pdf
                                                     python + pdf2docx         Ghostscript (detected)
  • Declarative matrix: every conversion is a data row ({ from, to }) on its converter. Routing, list_conversions and dependency checks are all derived from it.
  • Detection: content first - binary magic (file-type), SVG sniffing, and JSON parsing (plus a YAML document-marker guess for extension-less files) - with the extension as fallback. Conflicts resolve in favor of the content, with a warning.
  • Core is DSH-agnostic: src/core never imports Cordis/DSH, so the engine can be unit-tested, wrapped in a CLI, or served over MCP later. If the DSH developer-preview API shifts, only the glue layer changes.
  • Dependencies: external binaries (FFmpeg, LibreOffice, Poppler) are detected, never auto-installedlist_conversions reports them and prints per-platform install hints. The interface is already in place (BinaryDependency).

Development

npm install
npm run build     # tsc -> lib/
npm test          # vitest, 77 tests (plus environment-gated suites)
npm run smoke     # end-to-end against lib/

Local development pulls the dsh-tools peer closure into devDependencies so typecheck and vitest can load the 0.1.5 tool registry. End users of the published plugin do not install these — the host profile provides them.

Add a conversion = add one capability row + implement it in a converter. Add a backend = implement the Converter interface and register it in createRouter().

Fidelity & safety expectations

  • Lossy by nature: PDF→DOCX (experimental), OCR and office→PDF are reconstructions — expect layout and recognition differences. inspect_file's likelyScanned flag tells you when OCR is the right tool, and results carry warnings.
  • Cached ffmpeg builds: the download convenience installs pinned sha256-verified FFmpeg 6.1.1 static builds. For untrusted media, a current system FFmpeg takes priority — prefer it in security-sensitive setups.
  • Not a sandbox: outputRoots resolves symlinks and resource limits (maxInputMb, maxPdfPages, maxOutputPixels, batchMaxFiles) cap runaway jobs, but the default next-to-input output is intentionally exempt from roots, and an agent that may write files can always write somewhere. For hostile multi-tenant use, add OS-level isolation on top.

Compatibility

Component Verified version
DeepSeek Harness 0.1.5-rc.2
@deepseek-ai/dsh-tools 0.1.5-rc.2
@deepseek-ai/cordis 4.0.2
Node.js ^22.19.0 || >=24.0.0 (CI covers 22)

DSH is a developer preview and its APIs will move - the plugin keeps all DSH imports inside a thin glue layer so adapting stays cheap.

Roadmap

  • V0.2 — Media (FFmpeg) shipped: MP4→GIF/MP3, WAV→MP3, MOV→MP4, plus optimize_file with target-size two-pass encoding.
  • V0.3 — Office + PDF tooling shipped: DOCX/PPTX/XLSX→PDF via LibreOffice, experimental PDF→DOCX via python pdf2docx, PDF compression via Ghostscript; on-demand dependency downloads with an automatic CN mirror.
  • V0.4 — OCR (Tesseract) shipped: PDF→TXT supports ocr: true (optional ocr_lang), local Tesseract CLI first with the bundled tesseract.js as fallback, language data fetched explicitly via install_ocr_dependencies.
  • Later: OCR → DOCX for scanned PDFs, conversion chains (PPTX→PDF→PNG), video downscaling in optimize_file, resize/rotate image options.

License

MIT. dsh-file-convert distributes no external binaries; runtime libraries (sharp, pdfjs-dist, @napi-rs/canvas, js-yaml, csv) are installed from npm under their own licenses.

有意识地管理

安装与管理

前置条件与目标 Profile

目标 default Profile

交付方式 Git Bundle — zzy-12345678/dsh-file-convert#f8dd9b04e64b8b6a5f12714eafee5f3b09f864be

验证、更新与移除

显示生命周期命令
验证
dsh plugin --profile default list

兼容性与访问范围

Targets DeepSeek Harness 0.1.5-rc.2 DeepSeek Harness 0.1.5-rc.2; Node.js ^22.19.0 || >=24.0.0

检查兼容性证据

风险事实

lifecycle-script

Git installation runs the package's prepare build step after approval.

证据
外部下载

Optional media and OCR setup can download FFmpeg binaries or OCR language data after user consent.

证据
file-write

Conversions write output files, and the default output location is next to the input file.

证据
证据与编辑审查Manifest、Bundle patch、分发与新鲜度

不可变证据

审查状态与源码活动

AI 已审查

处理敏感材料前,请审查可选依赖下载操作以及工具的文件写入范围。

AI 审查于 2026/9/14 UTC 14:08GitHub 事实核对日期: 2026/9/14 UTC 14:08

自当前证据基线以来,没有记录到重要源码变化。

下一步

按 Plugin 安装流程操作

订阅重要变化: dsh-file-convert