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

dsh-file-mention

UI 增强JavaScriptMIT

输入框内 session 范围的 @文件/@文件夹提及:Git 感知索引、拖放与粘贴受管上传、经校验的路径标记。

3 StarstipoLi5890 更新时间 2026-08-19
访问 GitHub 仓库
dsh-file-mention 项目预览
dsh-file-mention 界面截图dsh-file-mention 界面截图dsh-file-mention 界面截图dsh-file-mention 界面截图dsh-file-mention 界面截图

项目介绍

中文

输入框内 session 范围的 @文件/@文件夹提及:Git 感知索引、拖放与粘贴受管上传、经校验的路径标记。

English

Session-scoped @file/@folder mentions in the composer with Git-aware indexing, drag-drop and paste managed uploads, and validated path markers.

项目信息与收录信号

快照 2026-09-11
作者 / 组织
tipoLi5890
仓库
tipoLi5890/dsh-file-mention
GitHub Stars
3
Forks
0
开发语言
JavaScript
许可证
MIT
最近推送
2026-08-19
Manifest
数据中检测到声明

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

数据评分

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

近 23 天仍在更新;README 含完整安装与使用说明;关注度尚低(3)。

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

安装与使用

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

dsh plugin --profile web add github:tipoLi5890/dsh-file-mention

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

项目截图

仓库 README

GitHub 原文

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

dsh-file-mention

Awesome DSH Plugin

Traditional Chinese: README.zh.md

Secure, session-scoped @ file/folder mentions and drag-and-drop file intake for the DeepSeek Harness (DSH) Web composer.

The plugin inserts lightweight path references. It does not attach or inject file content: immediately before an agent step, the Host validates each path and adds a path-only <workspace-reference> marker. The agent then decides whether and how to inspect the target with its own tools.

Features

  • Files and folders — bare @ opens a workspace list; continue typing to

filter by basename or path.

  • Git-aware index — tracked files plus untracked non-ignored files; deleted

tracked paths are removed. Non-Git workspaces use a bounded filesystem walk.

  • Controllable index — nested .aiinclude rules can add required ignored

files with last-match-wins semantics; dirty/mtime metadata, monotonic indexVersion, and workspace invalidation keep changed files current.

  • Fast typing — one per-session index request, warm() prefetch,

single-flight loading, 30-second stale-while-revalidate, local ranking, and optional recent-path prioritization.

  • Unambiguous references — picks retain the full relative path. Paths with

spaces use @"quoted path" syntax.

  • Validated markers — agent/pre-step checks workspace confinement,

symlink-resolved location, existence, and file/directory kind without reading content.

  • Keyboard completion — arrows + Enter or Tab through the input-trigger

controller.

  • Managed drag-and-drop — streaming temp files, atomic no-clobber finalize,

per-file/session/global quotas, retention cleanup, progress, and cancellation.

  • Paste-to-upload — pasting non-image files routes them through the same

managed pipeline instead of failing in the built-in image intake; pure rail-image pastes still reach the image rail.

  • Caret-preserving insertion — uploaded @ paths insert at the caret

recorded before the upload through the frozen slash/input-insert-text contract (draftRev CAS with caret remap), falling back to append.

  • Reference tray — compact file/folder cards below the composer support copy,

reveal, single removal, and batch clear without altering surrounding text.

  • Control Center — Overview, Index, Uploads, and Output tabs expose live index

diagnostics, storage meters, ignore presets, index rebuild, and expired-upload cleanup instead of a flat settings form.

  • Candidate context — optional changed-file status labels and browser-local

recent-path history improve repeated navigation without sending history to the Host.

  • Official UI slots — the tray, Control Center, and optional Host-validated

assistant output path companion use supported DSH integration points.

  • Zero build — hand-written Host ESM and lazy-CJS browser bundle; React is

supplied by the DSH Client runtime.

Screenshots

Browse workspace files and folders

Browsing workspace files and folders from the at-mention menu

Filter and select a file

Filtering README files from the at-mention menu

Configure file mentions

File mention settings page

Drag a local file into the composer

Dragging a local file into the DSH Web composer

Use a managed upload from the Reference Tray

A managed upload shown in the Reference Tray and inserted as an at-path reference

Installation

Requires a compatible DSH Web profile with the client input-trigger, runtime, and locale services.

dsh plugin --profile web add github:tipoLi5890/dsh-file-mention

For local development:

dsh plugin --profile web add link:/absolute/path/to/dsh-file-mention
dsh --profile web --dump-config

Restart DSH Web after install/update.

Usage

ActionResult
@Opens a shallow, ranked workspace file/folder list
@readmeFinds basename matches such as README.md
@src/maSearches the full relative path
Pick src/main.jsInserts @src/main.js
Pick docs/file with spaces.mdInserts @"docs/file with spaces.md"
Pick docs/Inserts @docs/
Arrow keys + TabAccepts the highlighted files candidate
Drop a non-image fileCopies it to managed uploads and inserts its path at the caret
Paste a non-image fileUploads it the same way and inserts its path at the caret

Outside-root browsing through @/, @~/, or @../ is intentionally not part of the picker. The Host index root always comes from the addressed session.

How it works

Host

POST /api/file-mention/index accepts { "sessionId": "..." }. The Host derives cwd from session state, builds/caches a Git or fallback index, and returns relative file/folder paths only.

POST /api/file-mention/upload?sessionId=&name= streams one raw body to a temp file, checks configured per-file/session/global quotas, atomically finalizes it under <DSH_HOME>/uploads/<sessionId>/, and returns its managed absolute path.

POST /api/file-mention/settings owns durable plugin settings. POST /api/file-mention/status returns path-free index/storage aggregates for the Control Center. POST /api/file-mention/maintenance rebuilds the addressed session index or removes uploads past their configured retention period. POST /api/file-mention/path-action validates and reveals only current-workspace or managed-upload paths via structured execFile argument arrays.

At agent/pre-step, direct user mentions are revalidated. Relative paths must remain inside session.cwd; absolute paths are marked only when they resolve inside the managed upload root. The resulting marker looks like:

<workspace-reference path="src/main.js" kind="file" />

Browser

The browser registers an @/files input source. It fetches the complete bounded index once per session, ranks locally on every keystroke, optionally uses browser-local recent-path counts as a tie-breaker, and returns a plain-text insertion outcome. Connection reset clears all index state.

Capture-phase drag handlers claim drags containing non-image files. XHR exposes progress/cancel while the official conversation.input.dock draft action appends the returned references; no textarea DOM mutation fallback is used.

Limits

LimitValue
Index entries20,000
Non-Git traversal depth32
Client menu rows40
Host/Client index freshness30 seconds
Dropped file50 MiB each
.aiinclude files50
JSON request body256 KiB
Session upload quota250 MiB (configurable)
Global upload quota2 GiB (configurable)
Upload retention7 days (configurable)

Git repositories honor .gitignore. The non-Git fallback skips hidden entries, symlinks, VCS metadata, dependencies, caches, and common build outputs.

Development

npm run check

No dependency installation or build step is required. See:

License

MIT © 2026 dsh-file-mention contributors

使用前核对

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

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

同类项目