Foreword¶
When handling web uploads, sending files via WeChat, or letting desktop software follow the “Open” flow within DSH, the agent is often capable of clicking buttons and typing, but still cannot access the system’s native file picker. Programmatically triggering <input>.click() also fails to pop up that Win32 dialog. dsh-file-handover addresses exactly this gap: after the caller manually triggers the upload/open action, it fills the absolute path into the native dialog, reads it back to verify, and then clicks confirm—leaving a verifiable receipt for every step.
What is this¶
- Repository: 7gzgn/dsh-file-handover
- Maintainer: 7gzgn
- Category: Workflow (Community Directory SkillHub Plugin Page)
- Current Version (package.json): 0.2.1, MIT License
- Positioning: Hand a local file to any program’s file picker — The target path must be explicitly provided; it does not guess dialogs or automatically click “Upload” for you.
The Node side on the host handles parameter validation and spawning subprocesses; the actual GUI operation is performed by lib/handover.ps1 inside the package (UI Automation + EnumWindows). It only supports Windows and only recognizes system-native file dialogs with window class #32770.
Core Features: Five Steps, Readable at Each Step¶
| Step | Action | Description |
|---|---|---|
| ① Wait | Poll for the file dialog to appear | Default timeout 30 seconds to avoid acting before the popup appears |
| ② Identify | Find the dialog with filename controls (automation id 1148) among candidate windows |
Identified by structure, not dependent on window title |
| ③ Fill | Clipboard paste (Select All → Clear → Paste) | Also has Win32 SetWindowText and UIA ValuePattern as backups; avoids Chinese IME turning the path into candidate words |
| ④ Verify | Read back the path and compare character by character | Default up to 3 rounds; retries if inconsistent |
| ⑤ Confirm | Click “Open/Save” (1) or “Cancel” (2) by control ID |
Does not blindly send Enter |
On failure, it returns the candidate windows seen and the actual values read back each time to facilitate troubleshooting. The optional dryRun only probes the structure without filling or clicking; expectTitle can be used to explicitly filter by title (default is not filtered by title).
Multi-selection (since v0.2.0): The paths array supports up to 12 items. They are filled in the format "a" "b" "c" and read back one by one; it fails if even one is missing.
Installation and Activation¶
Once listed in the marketplace, search for dsh-file-handover in DSH to install. Manual installation (excerpt from README):
New-Item -ItemType Junction -Path "$env:USERPROFILE\.dsh\profiles\desktop\node_modules\dsh-file-handover" -Target "D:\dsh\projects\dsh-file-handover"
# Add "dsh-file-handover": "link:D:/dsh/projects/dsh-file-handover" to dependencies in the profile's package.json
# And add "dsh-file-handover" to dsh.profile.bundles (it won't load if omitted) → Restart DSH
Please review the repository source code and MIT license before installing. The plugin runs with the current DSH process permissions, will only operate on the absolute paths you specify, and clicks the confirm button within the already selected dialog.
package.json declares compatibility with DSH 0.2.0-rc.2 and 0.2.1-rc.2; requires Node >=18, with peer dependencies like @deepseek-ai/cordis.
Typical Usage¶
DSH Tools¶
Invoke the tool on the agent side (the dialog needs to be opened by you first):
handover_file path=<absolute path>
handover_file paths=[<absolute path>, <absolute path>, ...]
handover_file path=... [timeoutSec] [dryRun] [expectTitle] [maxAttempts] [click]
Common workflow for web uploads:
- Use browser tools to actually click the “Upload/Select File” button on the page;
- Call
handover_file(usepathfor single files,pathsfor multiple files); - Use browser tools to read back the page to confirm the file name or size.
Command Line¶
dsh-file-handover handover --path "D:\videos\a.mp4"
dsh-file-handover probe --path "D:\videos\a.mp4"
dsh-file-handover handover --path "D:\a.mp4" --expect-title "Open" --no-click
Exit codes: 0 Delivered / 1 Not completed / 2 Usage error.
Use Cases and Notes¶
Suitable for: Any flow where the “system Open/Save box pops up first, then select local file”—web uploads, IM file sending, Photoshop opening, etc., provided you can trigger the dialog first.
Not suitable for: Self-drawn file pickers, non-Windows environments; the plugin is not responsible for the action of opening the dialog for the first time.
Limitations (Known items from README): Each call spawns a PowerShell subprocess (taking hundreds of milliseconds to seconds); only recognizes #32770 native boxes; handover.ps1 is intentionally all-ASCII to avoid Windows PowerShell parsing UTF-8 without BOM as GBK, which causes silent failures in title-based matching.
Local self-test (does not touch real GUI):
node test/smoke.mjs
Conclusion¶
dsh-file-handover fills the gap of “selecting files” in GUI automation: explicit paths, clipboard filling, read-back verification, and on-site error reporting. Please refer to the repository for details and updates.
- Community Directory: https://www.skillhub.cn/plugins/7gzgn/dsh-file-handover
- GitHub: https://github.com/7gzgn/dsh-file-handover