haruri03/dsh-reveal-in-folder ↗★ 0

dsh-reveal-in-folder

在系统文件管理器中定位文件路径 适合需要频繁在本地文件管理器中定位聊天文件、编辑器标签或图片的DSH用户。

包名
dsh-reveal-in-folder
兼容性
待验证
版本
0.1.1
许可证
MIT
最近更新
2026年10月22日

安装

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:haruri03/dsh-reveal-in-folder

dsh-reveal-in-folder

English | 中文

Repository: https://github.com/haruri03/dsh-reveal-in-folder

Right-click a file path, an editor tab, or an image in the DSH Web UI and get the actions that are actually available:

  • Reveal in file manager: chat file references, editor path bars, right-sidebar tabs, local images;
  • Open image in browser: remote or in-page images (for example a host media route);
  • Copy image: inline chat images, the enlarged preview, and sidebar image previews.

Unavailable actions are not shown, and a failed action closes silently.

Image coverage: images the agent posts in chat, the enlarged view, and sidebar image previews. When an image has no DOM path, the client hashes its bytes with SHA-256 and matches the content-addressed attachment object; that enables "Reveal in file manager". Remote images do not get that item.

Text coverage

  • File references in chat replies (the chat renderer stores the path in the element's title, usually relative to the workspace);
  • Editor / document preview path bars (the value of an input, or a path in title);
  • Right-sidebar file tabs (data-dockkit-tab / data-sidebar-right-tab, preferring the dsh-resource address found in React props).

Path resolution

Chat references and path bars often carry relative paths. If they are handed straight to the host, path.resolve resolves them against the process cwd and opens the wrong directory. This plugin resolves paths on the host instead:

  1. The client sends path / name / address / image to GET /reveal-in-folder;
  2. The host uses the live session's header.cwd as the root:
    • relative paths are joined with each root and checked for existence;
    • a bare file name triggers a bounded recursive search under the root (skipping node_modules/.git and similar; at most 20k entries and 8 levels), and multiple matches are returned as a candidate list;
  3. The result is opened with explorer.exe /select, (macOS open -R, Linux xdg-open), without going through a shell.

Add ?dry=1 to resolve without opening:

curl "http://127.0.0.1:
/reveal-in-folder?path=&dry=1"

Client behavior

  • A capture-phase contextmenu listener takes over only when the value looks like a file: a single line with an extension; a value with a separator is treated as a path, a bare name as a tab label.
  • The menu renders in shell.overlay, follows the cursor, and closes on Escape, an outside click, or scroll. Clicking an item closes the menu immediately and runs the action; unavailable actions are not shown, and failures close silently.
  • Host routes use the Node (req, res) signature; DSH webServer routes are not Fetch handlers.
  • Menu labels ship in Chinese and English and follow the host UI language; any other language shows English. Without the host client locale service the plugin reads ``, and anything outside zh* shows English.

Install (manual)

Choose one:

Human: copy this directory to $HOME/.dsh/profiles/ /node_modules/dsh-reveal-in-folder, then append this row to the profile's cordis.patch.yml:

- insert:
    - id: reveal-in-folder
      name: './index.js'

Agent: run plugin_manager install_bundle --target " ".

Install from Git

When the repository root is the package (it contains package.json and dsh.bundle), install it directly from its Git URL:

plugin_manager install_bundle --target "git+https://github.com/haruri03/dsh-reveal-in-folder.git"

The same operation is available to humans through the Web plugin page ("Add plugin") or the CLI:

dsh plugin --profile 
 add "git+https://github.com/haruri03/dsh-reveal-in-folder.git"

npm package names and tarball URLs are also accepted. To update, remove and reinstall, or wait for an upstream release.

After installing or changing the client, refresh the page once (the browser caches client modules).

Known limits

  • Only files (with an extension) are recognized; right-clicking a directory does not open a menu.
  • When a tab exposes only a file name and the repository contains several files with that name, the menu lists the candidates to choose from (sorted by path depth, up to 100 entries, scrollable). Right-sidebar tabs that carry data-sidebar-right-session are searched inside that session's workspace first.
  • Tab-only filenames use a bounded search (20k entries / 8 levels); in very large repositories the action may fail and is then not shown.