dsh-upload-origin: Restoring the Local Absolute File Path Prior to Drag-and-Drop Upload in DSH

Introduction

When dragging local files into a DeepSeek Harness (DSH) web chat, the browser’s upload component can only pass file bytes and a display name—it cannot expose the original absolute path. DSH stores the upload snapshot at <session cwd>/.dsh-uploads/<sessionId>/<sha256-16>-<name>, but with only that information, the agent has no way to locate the user’s local source file directly. dsh-upload-origin is a DSH host-side plugin that scans the session workspace and common user directories on the host machine, matches files by name, size, and SHA-256 hash, injects the original path into the system prompt, and registers a tool for on-demand lookups.

Plugin Overview

  • Name: dsh-upload-origin
  • Maintainer: firnspiegel
  • Category: Web tools
  • Core value: Restores the original local absolute path of user-dropped files on the DSH host side, enabling the agent to use local paths for subsequent edits or operations.

Key Features

  1. Watches the session’s .dsh-uploads directory and scans uploaded files during each round of prompt assembly.
  2. Retains only upload entries actually referenced by the user’s prompt.
  3. Resolves each referenced file using the following priority order:
    - First, looks up the official workspace file reference index ctx.fileReferences;
    - If not found, performs a bounded filesystem scan across the session workspace, Desktop, Documents, Downloads, OneDrive, and shallow user directories.
  4. Injects the resolution results into the system prompt as a mapping block:
[Uploaded files: original local paths]
- uploaded: .dsh-uploads/session-.../7538541a1efdc6c6-report.docx
  original: C:\Users\Alice\Desktop\report.docx [exact]
  Prefer this original path when the user refers to their local file; the
  .dsh-uploads copy is a snapshot.
  1. Registers the resolve_uploaded_file tool, supporting on-demand lookup of original paths.

Installation & Enablement

Install the pre-built tarball from GitHub Releases:

dsh plugin --profile web add https://github.com/wlc114514/dsh-upload-origin/releases/download/v0.1.0/dsh-upload-origin-0.1.0.tgz

The package declares a dsh.bundle, so it is installed through the standard DSH bundle/profile flow.

Typical Usage

System Prompt Mapping

The plugin automatically injects the original path mapping of uploaded files into the system prompt, allowing the agent to reference them directly.

Tool: resolve_uploaded_file

Query the original path corresponding to an uploaded file on demand via the tool.

Parameters:

Parameter Type Description
file_path string, optional The upload path—can be an absolute path or a path relative to the session workspace
name string, optional When the upload path is unknown, use the original filename to locate the file
search_roots string[], optional Additional absolute directories to include in the scan
max_results integer, optional Maximum number of candidates to return (1–20, default 10)

Return fields: upload path, original filename, size, sha256, best original path, confidence, candidate list, scan roots, and scan metadata.

Confidence levels:

Confidence Meaning
exact Name, size, and SHA-256 all match
name+size Name and size match; SHA-256 unchecked or different
name+size-hash-differs Name and size match, but the content has been modified since upload
name-only-size-differs Same name but different size
name-only Name matches only—manual confirmation required

Configuration

The plugin supports the following optional fields in the bundle patch line:

- id: upload-origin
  name: 'dsh-upload-origin'
  config:
    maxSearchFiles: 250000
    searchTimeoutMs: 9000
    maxDepth: 12
    maxHashChecks: 30
    maxResults: 10
    recentUploadMs: 604800000
    maxRecentUploads: 8
    autoResolveTimeoutMs: 7000
Field Default Description
maxSearchFiles 250000 Maximum number of filesystem entries visited per resolution
searchTimeoutMs 9000 Overall timeout for a single resolution (ms)
maxDepth 12 Scan depth for common root directories
maxHashChecks 30 Maximum number of candidate files to content-hash
maxResults 10 Maximum number of candidates returned by the tool
recentUploadMs 604800000 Only auto-resolve uploads newer than this timestamp (7 days)
maxRecentUploads 8 Maximum number of recent uploads considered per prompt assembly
autoResolveTimeoutMs 7000 Maximum wait time for auto prompt mapping per conversation turn (ms)

Use Cases & Caveats

  • Ideal for DSH scenarios that require editing based on local file paths, performing path operations, or referencing local resources.
  • The plugin runs with the current DSH process privileges. Review the source code and license before installation.
  • The default scan scope is limited; external directories must be passed via search_roots or await a future version that extends root directory configuration.

Summary

dsh-upload-origin restores the original local absolute path of user-dropped files on the DSH host side, injects the mapping into the system prompt, and registers an on-demand lookup tool—enabling the agent to directly use local paths for subsequent edits or operations.

  • Directory page: https://www.skillhub.cn/plugins/firnspiegel/dsh-upload-origin
  • GitHub: https://github.com/firnspiegel/dsh-upload-origin
羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye