SeerableOfficial/dsh-anydoc-markdown1

dsh-anydoc-markdown

Converts documents (Word, PowerPoint, Excel, OpenDocument, RTF, EPUB, CSV, PDF) to clean Markdown via the Rust firecrawl-anydoc crate and describes every embedded image with a vision model. Host plugin exposing a `convert_document` tool; the conversion + batched-vision engine is a bundled Python wrapper (`converter/anydoc_vlm.py`).

包名
dsh-anydoc-markdown
版本
0.1.0
许可证
MIT
最近更新
2026年8月31日

安装

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:SeerableOfficial/dsh-anydoc-markdown

Usage

  1. The agent calls the convert_document tool with the path to a document: convert_document(file_path: "report.pptx").
  2. The plugin runs the bundled Python wrapper (converter/anydoc_vlm.py) against anydoc, then describes every embedded image via the VLM in batches.
  3. The tool returns the Markdown (with image descriptions substituted) to the model.

Composer document attach (native drop / multi-file)

Documents attach through the same whole-page drag the harness uses for images: drag any number of documents (.docx .pdf .pptx .xlsx .odt .rtf .epub .csv .txt .md .html) onto the page and release. The harness's own drop overlay (the one that says "Drag images and documents here to add them") invites the drop, and the plugin shows the attached documents as cards in the composer's input dock strip (a line above the composer card). Images dropped at the same time keep using the harness's built-in image attach.

  1. Drag documents onto the page (or drop them) → they stream to the host's attach.upload RPC channel (/dsh-anydoc by default). Each uploaded document is written to attachmentsDir and shown as a card (name + size + remove) in the dock strip. The cards clear automatically once you submit the message — the documents are already saved to disk, so the agent still gets their paths on the next step.
  2. On the next agent step, the plugin hands the model the saved source file path(s) as a model-visible pre-step message ("Use convert_document on each path below"). It never injects the converted Markdown.
  3. The agent calls convert_document(file_path: " ") on each. The tool converts the document, saves the Markdown to markdownOutputDir, and returns the .md file path (savedPath) alongside the Markdown.
  4. Failed/oversized/unsupported files are reported individually and never break the rest of a batch.

Configuration

All fields have sensible defaults — install and use without touching any. Tune only what you need. Every knob is a validated cordis.patch.yml field; none are hardcoded.

FieldDefaultDescription
converterPythonpythonPython interpreter used to run the bundled wrapper.
converterPathconverter/anydoc_vlm.pyPath to the bundled wrapper (in this dir).
maxImagesPerRequest10Max images per vision request. Setup requirement — never lump all images into one request.
maxChars60000Markdown truncation cap returned to the model.
timeoutMs120000Cooperative tool-call timeout budget.
visionEndpoint''OpenAI-compatible vision endpoint; empty = offline metadata descriptions.
visionModel''Vision model id (e.g. gpt-4o); empty = offline metadata descriptions.
visionApiKeyEnvOPENAI_API_KEYEnv var supplying the vision API key.
attachmentChannel/dsh-anydocGeneric RPC channel the composer uses to attach documents.
attachmentsDir/attachmentsDirectory uploaded SOURCE documents are written to; the agent is handed these paths.
markdownOutputDir''Directory where convert_document creates a subfolder named after the Markdown file (e.g. report/) and saves both the .md file and every extracted embedded image (as a PNG) inside it, returning the .md file path (savedPath) plus imageDir/savedImages. Empty = return the Markdown inline and save nothing.
maxFileBytes26214400 (25 MiB)Per-upload byte cap for document attachments (decoded size).
allowedAttachExtensions['.docx','.doc','.pdf','.pptx','.ppt','.xlsx','.xls','.odt','.rtf','.epub','.csv','.txt','.md','.html','.htm']Document extensions the composer accepts.
- id: dsh-anydoc-markdown
  config:
    maxImagesPerRequest: 10
    visionEndpoint: https://api.openai.com/v1
    visionModel: gpt-4o