DeepSHPlugins
dsh-file-upload 项目预览
GITHUB / COMMUNITY PROJECT

dsh-file-upload

UI 增强TypeScriptMIT

Claude 风格拖拽/回形针文件上传:内容嗅探、文档转 Markdown(微软 MarkItDown,内置 JS 兜底)、文本直插输入框、read_document 工具。

25 StarsHongMing-Huang 更新时间 2026-08-19
访问 GitHub 仓库
dsh-file-upload 项目预览

项目介绍

中文

Claude 风格拖拽/回形针文件上传:内容嗅探、文档转 Markdown(微软 MarkItDown,内置 JS 兜底)、文本直插输入框、read_document 工具。

English

Claude-style drag-and-drop/paperclip file upload with content sniffing, document-to-Markdown via Microsoft MarkItDown (built-in JS fallback), text inlining, and a read_document tool for agents.

项目信息与收录信号

快照 2026-09-11
作者 / 组织
HongMing-Huang
仓库
HongMing-Huang/dsh-file-upload
GitHub Stars
25
Forks
7
开发语言
TypeScript
许可证
MIT
最近推送
2026-08-19
Manifest
数据中检测到声明

公开仓库不自动等于可商用;许可证与当前兼容性以原项目文档为准。Manifest 和数据评分不构成安装安全认证。

数据评分

83/ 100
维护活跃
85
文档与实用信息
100
生态关注度
58
安装便捷信号
80
项目声明信号
100

近 23 天仍在更新;README 含完整安装与使用说明。

评分来自已有数据快照的五维模型,仅作浏览参考,不是实际使用评测或安全检测结论。

安装与使用

所有项目资料与许可均以对应 GitHub 仓库为准。

dsh plugin --profile web add dsh-file-upload

复制命令不会自动执行。请先阅读仓库文档,确认环境要求与许可证。

项目截图

仓库 README

GitHub 原文

已保存的仓库文档快照;文档抓取时间未记录,可能与上方目录介绍处于不同版本。安装前请核对当前仓库说明。

dsh-file-upload

File-message plugin for DeepSeek Harness (dsh). Claude/Codex-style uploads — drag-and-drop (files and folders), paperclip picker, paste-to-attach, multi-file support; content sniffing; fully bundled document → Markdown conversion (MarkItDown engine, 20+ formats, image OCR); Codex-style @relative/path references; automatic image explanations for text-only models; and a read_document tool for agents.

npm CI license Awesome DSH Plugin

English | 中文

Zero-config, install-and-use. Every feature works out of the box with
sensible defaults — no Python, no downloads, no picking backends. Image
explanations auto-discover a vision endpoint (local Ollama → OpenAI-compatible
key from the dsh credentials seam).

Features

  • Upload — composer paperclip button plus a global drag-and-drop overlay ("release to attach"), multi-file support.
  • Attachment cards — color-coded type badges (PDF red / DOC blue / XLS green / TXT gray / ZIP purple / JSON gold) with name and size; removable.
  • Codex-style file references — uploaded files appear in the message as @relative/path references (like OpenAI Codex), never as raw content dumped into the composer; the agent reads the file with read_document (converted to Markdown on demand).
  • Codex-style @ mentions — type @ in the composer to pick any uploaded file by its relative path; the reference inserts as a mention.
  • Document → Markdown, fully bundled — the MarkItDown engine ships inside the plugin (Microsoft MarkItDown TypeScript port, markitdown-node): PDF / DOCX / PPTX / XLSX / HTML / CSV / JSON / XML / RSS / Atom / ZIP / Jupyter / image OCR / audio transcription. No Python, no downloads, no setup.
  • Image explanation for text-only models — upload an image and the plugin automatically generates a description ("讲解图片") through a vision discovery chain, so the DeepSeek API (text-only) can reason about the image: explicit visionEndpoint → local Ollama with a VL model (e.g. DeepSeek-VL2, zero-config) → OpenAI-compatible endpoint with a dsh-credentials key. Multimodal routes / vision bridges keep the official read_image path.
  • read_document tool for agents — line-numbered paging (offset/limit), byte-budgeted LRU cache (invalidated on file change), size pre-checks, reads through ctx.fs (inherits sandbox and fs-observation policy).
  • Security — loopback-only uploads, sanitized file names, session-isolated storage (.dsh-uploads/<sessionId>), sha256 content dedup, bounded concurrency, TTL sweep.

Install

dsh plugin --profile web add dsh-file-upload
# restart dsh web

Usage

  1. Click the paperclip in the composer toolbar, or drag files anywhere over the window;
  2. Small text files land directly in the composer; documents appear as attachment cards and their path is sent with the message;
  3. The agent reads documents with read_document <path> — converted to Markdown on demand, pageable with offset/limit.

MarkItDown (fully bundled — no downloads, no setup)

The MarkItDown capability ships inside the plugin. Works out of the box: no Python, no pip, no downloads, no build-script approval.

  • Bundled engine — the Microsoft MarkItDown TypeScript port (markitdown-node) is a regular dependency covering 20+ formats: PDF, DOCX, PPTX, XLSX, HTML, CSV, JSON, XML, RSS, Atom, ZIP, Jupyter notebooks, images (OCR via Tesseract, 110+ languages), and audio transcription (via LLM, needs model credentials).
  • Images — OCR to text by default through the bundled engine.
  • Offline — all parsing runs locally, no network calls.
Optional upgrade: if an official MarkItDown CLI already exists on your machine (or is set via markitdownBin), the plugin prefers it (adds EPUB and more); without one the bundled engine is always available.
- id: file-upload
  config:
    markitdownBin: /path/to/your/markitdown   # optional; empty = bundled engine only

Startup log (bundled mode):

[dsh-file-upload] Document → Markdown ready: bundled MarkItDown engine (20+ formats, image OCR) — fully packaged, no downloads, no Python.

How images are handled (auto-explained)

The plugin detects your session's model capability at upload time:

Detected routeWhat happens
Multimodal model (declares image input, e.g. GPT-4o / Qwen-VL / Claude / Gemini)imageMode: native — the agent uses the official read_image tool; the image enters model context directly
Vision bridge installed (dsh-vision-proxy and similar)detected automatically (they declare image input on their route) — same native path
Text-only model (the DeepSeek API is text-only)an automatic image description is generated via the vision discovery chain and inserted with the message — the model reasons about the image content immediately

Vision discovery chain (zero-config): ① explicit visionEndpoint/visionModel → ② local Ollama at http://localhost:11434 (picks a VL model such as DeepSeek-VL2 — images never leave the machine) → ③ OpenAI standard endpoint using a key from the dsh credentials seam.

Note: DeepSeek's official API does not offer vision input (the multimodal line — DeepSeek-VL2/Janus — is open-source and self-hostable); deploy DeepSeek-VL2 via Ollama for a fully local "official DeepSeek vision" experience.

The route detection mirrors the official read_image gate (ctx.llm.resolveModelInfo + inputModalities).

Configuration

All fields have sensible defaults — you can install and use the plugin
without touching any of them. Tune only what you need.
FieldDefaultDescription
uploadMaxBytes25165824 (24 MB)Max bytes per uploaded file
allowedExtensions[]Extension allowlist; empty = all allowed
uploadTtlMs604800000 (7 days)Unreferenced upload lifetime
sweepIntervalMs3600000 (1 h)Sweep period; 0 = disabled
maxConcurrentUploads4Concurrent upload limit
inlineTextLimit8192 (8 KB)Text inlined into the composer up to this size
previewTextLimit2048 (2 KB)Preview length for larger text files
maxFileBytes25165824Byte cap for one document read
readLimit2000Max lines returned by one read_document call
sheetRowLimit200Rows kept per XLSX sheet
maxSheets5Sheets read per workbook
cacheEntries16Parse-cache entry count
cacheMaxBytes67108864 (64 MB)Parse-cache byte budget
markitdownBin''Optional MarkItDown CLI path; empty = auto-detect PATH
markitdownTimeoutMs120000Timeout for one CLI invocation
visionEndpoint''Vision endpoint for image explanations; empty = auto (local Ollama → OpenAI standard)
visionModel''Vision model id; empty = auto
visionApiKeyEnvOPENAI_API_KEYCredential reference for the vision key (dsh credentials seam)
visionMaxBytes10485760 (10 MB)Max image bytes sent to the vision endpoint

Development

pnpm install
pnpm build     # tsc (host) + esbuild (client bundle)
pnpm test      # node --test

Architecture

src/
├── index.ts        # entry: apply + Config schema + assembly
├── detect.ts       # content sniffing (never trusts extensions)
├── convert.ts      # MarkItDown engine + optional CLI backend
├── vision.ts       # image explanations (vision discovery chain)
├── upload.ts       # upload route: loopback/session/size/dedup/TTL
├── tool.ts         # read_document: ctx.fs reads + paging + LRU cache
└── client/
    └── index.tsx   # paperclip + drag (files/folders) + paste + cards

Dual-face plugin: dsh.bundle (host) + dsh.client (web UI). No official patches — everything uses official seams (ctx.webServer, ctx.tools, ctx.systemPrompt, ctx.sessions, slash/input-insert-text, slash/input-insert-reference).

Security

  • Uploads are loopback-only and same-origin checked.
  • File names are sanitized (control chars, path separators, dot segments, leading dots stripped).
  • Storage is session-isolated under the session's own workspace; unknown sessions get 403.
  • sha256 content dedup, bounded concurrency (429 on overload), TTL sweep.
  • Text extraction parses bytes, never trusts extensions; binaries are handed to the agent by path only.

License

MIT

使用前核对

安装步骤、兼容版本与授权范围以原项目当前文档为准。Stars 和评分是快照中的导航信号。

安装与排错 · 项目问题反馈

同类项目