跪拜 Guibai
← All articles
Frontend · AI Programming

Drag Any File into DeepSeek Harness and Let the Agent Read It Directly

By gezg ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

Many desktop AI coding tools still force file uploads through browser attachment channels that strip context and limit tool access. This plugin shows that injecting a local path is often simpler, more private, and gives the agent full read/write capabilities on the file, a pattern that applies to any tool with a file-system agent.

Summary

DeepSeek Harness's web GUI only accepts image uploads via drag-and-drop, blocking common workflows like dropping an Excel file for analysis. The dsh-drag-file plugin sidesteps this entirely: dragging any file into the input box triggers a host-side disk search that resolves the filename to an absolute path, then inserts that path as editable plain text into the draft. The agent receives the path and reads the file using its existing tools, with no upload, no attachment channel, and no data leaving the local machine.

The plugin uses DSH's host/client architecture. The browser side captures the drag event and extracts the filename; the Node.js host side searches the workspace and configurable directories like ~/Downloads to find the full path. Communication runs over DSH's Typert Remote RPC with zod schema validation. A unique match auto-fills the draft; multiple candidates appear as chips for the user to select.

Installation is a single npm command. The plugin works across macOS, Linux, and Windows, and search directories and depth are configurable in YAML. The whole feature plugs into DSH's public extension points—UI slots, input actions, and host RPC—without modifying the framework.

Takeaways
DeepSeek Harness's web input box rejects non-image file drops by default, but the agent already has file-system tools that can read any file given an absolute path.
The plugin resolves a dragged file's filename to an absolute path by searching the workspace and configurable directories on the host machine.
Resolved paths are inserted as plain text into the input draft, visible and editable before sending—no hidden attachment injection.
The host-side search runs in Node.js because browsers never expose absolute file paths from drag events for security reasons.
Communication between the browser client and Node.js host uses DSH's Typert Remote RPC, validated with zod schemas.
Installation is a single CLI command, with YAML-configurable search directories, recursion depth, and result limits.
The plugin works on macOS, Linux, and Windows, recognizing Windows-style paths like C:\Users\...
All integration points—the input box slot, draft-writing actions, and host RPC—are public DSH extension APIs; no framework code was modified.
Conclusions

Browsers' refusal to expose absolute file paths is the right security posture, but it creates a genuine friction for local AI tools that already have filesystem access. A host-side search daemon is the correct architectural split, not a workaround.

The plugin's design choice to inject a plain-text path rather than a hidden attachment is underrated: it keeps the user in control of what gets sent and makes the agent's behavior auditable.

DSH's microkernel plugin model proves itself here—a feature that would require a fork or a feature request in most tools was built entirely against public extension points.

Concepts & terms
Typert Remote
DeepSeek Harness's RPC mechanism for communication between the browser client and the Node.js host process, using zod schemas for type-safe request/response validation.
Cordis
The microkernel framework underlying DeepSeek Harness, where every feature is a plugin that exports an apply(ctx) function and declares its dependencies via inject.
Source: juejin.cn ↗ Google Translate ↗ Backup ↗