@maxbill/dsh-file-explorer 0.0.0-stage → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.en.md +512 -0
- package/README.md +510 -2
- package/assets/icon-180.png +0 -0
- package/assets/icons/archive.svg +5 -0
- package/assets/icons/audio.svg +5 -0
- package/assets/icons/excel.svg +5 -0
- package/assets/icons/file-outline.svg +4 -0
- package/assets/icons/folder.svg +4 -0
- package/assets/icons/image.svg +6 -0
- package/assets/icons/other.svg +5 -0
- package/assets/icons/pdf.svg +5 -0
- package/assets/icons/ppt.svg +5 -0
- package/assets/icons/text.svg +3 -0
- package/assets/icons/video.svg +5 -0
- package/assets/icons/word.svg +5 -0
- package/cordis.patch.yml +7 -0
- package/docs/drag-session.png +0 -0
- package/docs/editor.png +0 -0
- package/docs/grouped.png +0 -0
- package/docs/icon-view.png +0 -0
- package/docs/panel.png +0 -0
- package/docs/preview-sheet.png +0 -0
- package/docs/quick-look.png +0 -0
- package/docs/search.png +0 -0
- package/docs/session-menu.png +0 -0
- package/docs/workspace-menu.png +0 -0
- package/docs/workspace-switch.png +0 -0
- package/icon.svg +5 -0
- package/lib/client.js +5536 -0
- package/lib/index.js +1914 -0
- package/locale/en.json +7 -0
- package/locale/zh.json +7 -0
- package/package.json +65 -4
- package/screenshots.json +10 -0
- package/scripts/export-icons.mjs +85 -0
package/README.en.md
ADDED
|
@@ -0,0 +1,512 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
<img src="icon.svg" width="96" alt="File Explorer icon">
|
|
4
|
+
|
|
5
|
+
<h2>File Explorer · dsh-file-explorer</h2>
|
|
6
|
+
|
|
7
|
+
<p><a href="README.md">简体中文</a> | <a href="README.en.md">English</a></p>
|
|
8
|
+
|
|
9
|
+
<p><b>The local file manager for DeepSeek Harness</b><br>
|
|
10
|
+
Browse · preview · edit · organise — and hand files straight to your agent</p>
|
|
11
|
+
|
|
12
|
+
<p>
|
|
13
|
+
<a href="https://www.npmjs.com/package/@maxbill/dsh-file-explorer"><img src="https://img.shields.io/npm/v/@maxbill/dsh-file-explorer?style=flat-square&label=version&color=3b6cf6" alt="version"></a>
|
|
14
|
+
<a href="LICENSE"><img src="https://img.shields.io/badge/license-Apache--2.0-blue?style=flat-square" alt="license"></a>
|
|
15
|
+
<a href="#6-platform-support"><img src="https://img.shields.io/badge/platform-macOS%20%7C%20Windows%20%7C%20Linux-lightgrey?style=flat-square" alt="platform"></a>
|
|
16
|
+
<a href="https://github.com/MaxBill/dsh-file-explorer"><img src="https://img.shields.io/badge/DeepSeek%20Harness-plugin-6f42c1?style=flat-square" alt="dsh"></a>
|
|
17
|
+
<img src="https://img.shields.io/badge/node-%E2%89%A5%2020-339933?style=flat-square" alt="node">
|
|
18
|
+
</p>
|
|
19
|
+
|
|
20
|
+
<p>
|
|
21
|
+
<a href="#2-install-and-uninstall">Install</a> ·
|
|
22
|
+
<a href="#3-highlights">Highlights</a> ·
|
|
23
|
+
<a href="#4-feature-list">Features</a> ·
|
|
24
|
+
<a href="#5-previewable-file-types">Preview types</a> ·
|
|
25
|
+
<a href="#8-faq">FAQ</a>
|
|
26
|
+
</p>
|
|
27
|
+
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
<p align="center"><img src="docs/panel.png" width="880" alt="File Explorer: the icon view you see right after opening it"></p>
|
|
31
|
+
|
|
32
|
+
<table>
|
|
33
|
+
<tr>
|
|
34
|
+
<td align="center">🗂️<br><b>Three views</b><br><sub>Icons, list or grouped — column widths, sorting and hidden files are remembered</sub></td>
|
|
35
|
+
<td align="center">👀<br><b>Click to preview</b><br><sub>Images, PDF, Office, audio and video, plus a quick look with Space</sub></td>
|
|
36
|
+
<td align="center">✏️<br><b>Edit in place</b><br><sub>Text / Markdown / CSV / JSON; changes made outside the panel are caught</sub></td>
|
|
37
|
+
</tr>
|
|
38
|
+
<tr>
|
|
39
|
+
<td align="center">🔍<br><b>Find anything</b><br><sub>Filter the current folder, search subdirectories, or search file contents</sub></td>
|
|
40
|
+
<td align="center">🤝<br><b>Wired into DSH</b><br><sub>A folder becomes a workspace, a document goes into the conversation</sub></td>
|
|
41
|
+
<td align="center">🖱️<br><b>Drag to organise</b><br><sub>Drag onto a folder to move, drag in from the OS, drag out to save</sub></td>
|
|
42
|
+
</tr>
|
|
43
|
+
</table>
|
|
44
|
+
|
|
45
|
+
> 💡 Most file plugins stop at “you can look at files”. This one goes one step further: once you have found the file, right-click turns it into a DSH workspace or drops it into the current conversation — no Finder detour, no copying paths.
|
|
46
|
+
|
|
47
|
+
**Install in 30 seconds**
|
|
48
|
+
|
|
49
|
+
`dsh plugin --profile desktop add @maxbill/dsh-file-explorer`
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
### Contents
|
|
54
|
+
|
|
55
|
+
[Introduction](#1-introduction) · [Install](#2-install-and-uninstall) · [Highlights](#3-highlights) · [Features](#4-feature-list) · [Preview types](#5-previewable-file-types) · [Platforms](#6-platform-support) · [Security](#7-security-boundaries) · [FAQ](#8-faq) · [Feedback](#9-feedback) · [Development](#10-appendix-development-and-maintenance)
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
### 1. Introduction
|
|
60
|
+
|
|
61
|
+
**What it is** — a file manager that lives inside DeepSeek Harness. Once installed, the left sidebar gains a `File Explorer` entry; opening it fills the main column with a full panel, so browsing, previewing, tidying and transferring files all happen in the browser.
|
|
62
|
+
|
|
63
|
+
**What it solves** — inside DSH you constantly want to “give the agent this directory” or “show the agent this document”. The usual loop is: open Finder → find the file → copy the path → come back to DSH → add a workspace or drag an attachment. This plugin collapses those steps into right-click and drag.
|
|
64
|
+
|
|
65
|
+
**Where it stands**:
|
|
66
|
+
|
|
67
|
+
- **Local first** — it reads and writes the disk of the host machine you are running DSH on. The browse root is the current user's home directory (`$HOME`); no cloud, no remote host.
|
|
68
|
+
- **File management only** — it is not a terminal, an editor or a Git client. Preview and editing exist to “see it clearly” and “change it a little”; anything bigger belongs in a real tool.
|
|
69
|
+
- **Native to DSH** — path resolution, authentication, sessions and workspaces reuse DSH's own services (`ctx.connection`, `ctx.fs`, `ctx.workspaces`), rather than inventing a parallel implementation.
|
|
70
|
+
|
|
71
|
+
**What it deliberately does not do** (so that nothing surprises you after installing):
|
|
72
|
+
|
|
73
|
+
- **It never leaves your home directory.** The browse root is `$HOME`; `/etc`, `/tmp` and other users' home directories are not reachable (attempts return 403). To work elsewhere, put the directory inside your home or symlink it.
|
|
74
|
+
- **It is not a terminal, a code editor or a Git client.** Previews are for looking; editing is for small fixes. Use the proper tool for real changes.
|
|
75
|
+
- **It does not take over file associations.** Double-click still opens files with the system default application; the plugin never changes system settings.
|
|
76
|
+
- **The Windows / Linux branches exist but have not been verified on real machines** (see [section 6](#6-platform-support)).
|
|
77
|
+
|
|
78
|
+
**What it looks like** — a directory tree on the left, a preview / details pane on the right, and the file list in the middle. Three views (icons / list / grouped), live search, drag and drop, and a full context menu.
|
|
79
|
+
|
|
80
|
+
> 🧩 **It does not clash with DSH's built-in file tree.** The built-in tree shows code “by workspace”; this panel manages files “by directory” — it previews, tidies, turns folders into workspaces and documents into attachments. Run both side by side.
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
### 2. Install and uninstall
|
|
85
|
+
|
|
86
|
+
The package is **`@maxbill/dsh-file-explorer`** (`dsh-file-explorer` was already taken on npm, hence the scope). Pick whichever install route suits you.
|
|
87
|
+
|
|
88
|
+
#### ① From GitHub (no npm)
|
|
89
|
+
|
|
90
|
+
```sh
|
|
91
|
+
git clone https://github.com/MaxBill/dsh-file-explorer.git ~/.dsh/plugins/dsh-file-explorer
|
|
92
|
+
dsh plugin --profile desktop add link:$HOME/.dsh/plugins/dsh-file-explorer
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
#### ② From npm
|
|
96
|
+
|
|
97
|
+
Published: [https://www.npmjs.com/package/@maxbill/dsh-file-explorer](https://www.npmjs.com/package/@maxbill/dsh-file-explorer)
|
|
98
|
+
|
|
99
|
+
```sh
|
|
100
|
+
dsh plugin --profile desktop add @maxbill/dsh-file-explorer
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
> If your registry is set to a CNPM mirror, you can still install dependencies from the official registry explicitly:
|
|
104
|
+
> `npm i @maxbill/dsh-file-explorer --registry=https://registry.npmjs.org/`
|
|
105
|
+
|
|
106
|
+
#### ③ Write it into a profile by hand
|
|
107
|
+
|
|
108
|
+
```jsonc
|
|
109
|
+
// ~/.dsh/profiles/<profile>/package.json
|
|
110
|
+
{
|
|
111
|
+
"dependencies": { "@maxbill/dsh-file-explorer": "link:../../plugins/dsh-file-explorer" },
|
|
112
|
+
"dsh": { "profile": { "bundles": [ "@maxbill/dsh-file-explorer" ] } }
|
|
113
|
+
}
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
Then run `pnpm install` in that profile directory and restart DSH.
|
|
117
|
+
|
|
118
|
+
#### How to verify the install
|
|
119
|
+
|
|
120
|
+
- A **File Explorer** entry appears in the left sidebar, and clicking it shows the panel (not a blank tab).
|
|
121
|
+
- The status bar at the bottom shows the entry count of the current directory, and the right-hand toolbar switches views.
|
|
122
|
+
- Client-side changes (`lib/client.js`) need a page reload (**⌘R / Ctrl+R**); host-side changes (`lib/index.js`) need a DSH restart.
|
|
123
|
+
- The Loader entry id is still **`dsh-file-explorer`** (`id:` in `cordis.patch.yml`); only the module name is scoped.
|
|
124
|
+
|
|
125
|
+
#### Upgrading
|
|
126
|
+
|
|
127
|
+
Run the install command again (`dsh plugin --profile desktop add @maxbill/dsh-file-explorer`), or bump the dependency and run `pnpm install`, then restart DSH. The version is shown on [npm](https://www.npmjs.com/package/@maxbill/dsh-file-explorer) and in [Releases](https://github.com/MaxBill/dsh-file-explorer/releases); both use the same tag.
|
|
128
|
+
|
|
129
|
+
#### Uninstalling
|
|
130
|
+
|
|
131
|
+
Remove `@maxbill/dsh-file-explorer` from `dsh.profile.bundles` and `dependencies`, run `pnpm install` again and restart DSH. The plugin leaves no cache or config on disk (UI preferences live in browser localStorage — clearing site data is enough).
|
|
132
|
+
|
|
133
|
+
#### Your first 60 seconds
|
|
134
|
+
|
|
135
|
+
1. **Open the panel** — click *File Explorer* in the sidebar and walk into any project directory.
|
|
136
|
+
2. **Hand a directory to the agent** — right-click a folder → **Add as workspace**. New DSH sessions now read, write, run and search inside it.
|
|
137
|
+
3. **Hand a document to the agent** — right-click a file → **Add to conversation** (contents go into the composer) or **Reference in composer** (inserts just `@path`, saving tokens).
|
|
138
|
+
4. **Take a quick look** — select a file and press `Space` for Quick Look; click *Edit* in the right-hand pane, make a small change and press `⌘S`.
|
|
139
|
+
|
|
140
|
+
Do those four things once and you know the whole plugin.
|
|
141
|
+
|
|
142
|
+
---
|
|
143
|
+
|
|
144
|
+
### 3. Highlights
|
|
145
|
+
|
|
146
|
+
#### 1. Five “keep working” actions that connect to DSH
|
|
147
|
+
|
|
148
|
+
- **Add as workspace** — right-click a folder: it appears in DSH's workspace list immediately, and every new session reads / runs / searches underneath it
|
|
149
|
+
- **Add to conversation** — right-click a file (image / text / PDF / Word / Excel / PPT): its **contents** go into the composer, exactly like dropping an attachment
|
|
150
|
+
- **Reference in composer** — right-click a file: only `@/absolute/path` is inserted, the contents stay **out of context**; the agent reads it when it needs to. Saves tokens, no attachment size limit
|
|
151
|
+
- **Drag into the conversation** — select and drag out of the list: the panel shows “release to add to this conversation”, and files / folders land as an attachment / `@path` respectively
|
|
152
|
+
- **Switch workspaces in one click** — the toolbar drop-down lists every workspace on this machine plus the current one; the last entry adds the current folder as a workspace
|
|
153
|
+
|
|
154
|
+
 
|
|
155
|
+
|
|
156
|
+
*Right-click a folder → Add as workspace · right-click a document → Add to conversation*
|
|
157
|
+
|
|
158
|
+
 
|
|
159
|
+
|
|
160
|
+
*Dragging a file into the conversation · one-click workspace switch*
|
|
161
|
+
|
|
162
|
+
#### 2. Broad preview coverage with no third-party parsers
|
|
163
|
+
|
|
164
|
+
- **XLSX / DOCX are parsed by the host itself** (zip + XML): no third-party library, no network, no format conversion.
|
|
165
|
+
- **Markdown** — headings, bold / italic, inline code, links, lists (including task lists), **tables (with column alignment)**, quotes, fenced code (with language labels), rules and images.
|
|
166
|
+
- **JSON** — a formatted source view: line numbers, branch folding (`[ … ]`), indent guides, and distinct colours for keys / strings / numbers / booleans / null. Toolbar: copy / expand all / collapse all. If parsing fails it falls back to the source and explains why.
|
|
167
|
+
- **Images / PDF / HTML / audio / video** — images stream straight from `/raw` (never base64); PDF uses the browser's own reader; HTML is shown as source only, so a local page never runs inside the preview; audio and video use native players.
|
|
168
|
+
- **Quick Look on Space** — select any entry and press `Space`: a centred overlay shows the content; Space or `Esc` closes it, clicking outside does too.
|
|
169
|
+
|
|
170
|
+

|
|
171
|
+
|
|
172
|
+
*Quick Look: press Space on a file to see it in an overlay; Esc or a click outside closes it*
|
|
173
|
+
|
|
174
|
+

|
|
175
|
+
|
|
176
|
+
*XLSX in the right-hand pane: one tab per worksheet, first row as the header, no Office install needed*
|
|
177
|
+
|
|
178
|
+

|
|
179
|
+
|
|
180
|
+
*Editing in the panel*
|
|
181
|
+
|
|
182
|
+
#### 3. Search: current directory / recursive / content
|
|
183
|
+
|
|
184
|
+
- Two toggles to the right of the search box: **search subdirectories** and **search file contents** (returns `file:line` plus that line's text).
|
|
185
|
+
- Results **reuse the current view**: icon view produces tiles, list view produces rows with type / size / modified, grouped view groups by type — no second set of styles.
|
|
186
|
+
- Matches are highlighted; for content hits a line badge appears on the tile and a monospace snippet in the row; a badge bar above the list shows count / mode / whether the result was truncated and how long the scan took.
|
|
187
|
+
- Budgets: 4000 directory entries, 200 hits, 4 seconds, 512 KB per file; `.git`, `node_modules` and friends are skipped automatically.
|
|
188
|
+
|
|
189
|
+

|
|
190
|
+
|
|
191
|
+
*Content search: line numbers + monospace snippet + highlighting, rendered in the current view*
|
|
192
|
+
|
|
193
|
+
#### 4. Drag and drop in three directions
|
|
194
|
+
|
|
195
|
+
- **Drag a row onto a folder in the panel** — **moves** it (dropping on empty space moves it to the current directory; dropping a folder into its own descendant is refused)
|
|
196
|
+
- **Drag a file from the OS into the panel** — **imports** it into the current directory with progress (works locally too, not just over a remote connection)
|
|
197
|
+
- **Drag a row out of the window** — hands the original file to Finder / Explorer (Chromium's `DownloadURL`; falls back to the path as text when unsupported)
|
|
198
|
+
|
|
199
|
+
#### 5. Live refresh: external changes show up
|
|
200
|
+
|
|
201
|
+
- Every **1.6 s** it compares a cheap fingerprint (directory mtime + entry count, preview file mtime + size); paused while the page is hidden.
|
|
202
|
+
- Directory changed → the list refreshes and keeps the selection; the previewed file changed → a “**changed · reload**” notice appears, and your draft is never overwritten.
|
|
203
|
+
|
|
204
|
+
#### 6. In-panel editing with conflict protection
|
|
205
|
+
|
|
206
|
+
- Text / Markdown / CSV / JSON can be edited in place; `⌘S` saves, a dirty marker flags unsaved work, and the line count sits next to the save button.
|
|
207
|
+
- Writes go through DSH's `ctx.fs` (atomic write + version guard): if the file changed on disk after you opened it, the host returns **409** and the editor offers *reload* or *overwrite* — never a silent overwrite.
|
|
208
|
+
- Binary extensions (zip / images / media …) have no edit button, so bytes that cannot round-trip are never written back.
|
|
209
|
+
|
|
210
|
+
#### 7. Zero dependencies, zero build step
|
|
211
|
+
|
|
212
|
+
- The host side is plain ESM (`lib/index.js`); the browser side is a hand-written `window.__ModuleLoader__` factory module (`lib/client.js`). **There is no bundling step** — change it, reload the page, done.
|
|
213
|
+
- At runtime it only needs React (provided by DSH); XLSX / DOCX / ZIP parsing all happens in the host using Node's standard library.
|
|
214
|
+
|
|
215
|
+
---
|
|
216
|
+
|
|
217
|
+
### 4. Feature list
|
|
218
|
+
|
|
219
|
+
> Browsing and navigation · preview, details and editing · file operations · search · DSH integration · appearance · shortcuts · context menu
|
|
220
|
+
|
|
221
|
+
#### 4.1 Browsing and navigation
|
|
222
|
+
|
|
223
|
+
- **Three views** — icons (104 px grid, names wrap to two lines, CJK counted as double width), list (name / type / size / modified, draggable column widths, double-click to reset), grouped (grouped by type, coloured overview bar + per-group count and total size, collapsible)
|
|
224
|
+
- **Breadcrumbs** — the full path hierarchy; click any level to jump there
|
|
225
|
+
- **Address bar** — double-click the breadcrumbs or press `⌘L` to turn them into an input that accepts absolute paths, relative paths, `~` and `..`; `Esc` cancels; paths outside the home directory are refused
|
|
226
|
+
- **Up / home / refresh** — three toolbar buttons; `Backspace` is the same as *up*
|
|
227
|
+
- **Sorting** — name / type / size / modified, folders always first; **filter** narrows the current directory as you type
|
|
228
|
+
- **Hidden files** — one toggle shows or hides dot-files
|
|
229
|
+
- **Status bar** — entry count, selected count and total size, clipboard contents; on the right, the current view and sort order
|
|
230
|
+
- **Memory** — hidden-file toggle, view, grouping style, right-pane mode, language, animation, column widths and last directory all persist in the browser
|
|
231
|
+
|
|
232
|
+
 
|
|
233
|
+
|
|
234
|
+
*Icon view · grouped view*
|
|
235
|
+
|
|
236
|
+
#### 4.2 Preview, details and editing
|
|
237
|
+
|
|
238
|
+
- **Right pane** — renders by extension (see [section 5](#5-previewable-file-types)); collapsed by default, opened from the rightmost toolbar button
|
|
239
|
+
- **Details mode** — name / type / size / location / created / modified / permissions; folders also report their entry count
|
|
240
|
+
- **Quick Look** — Space opens a centred overlay that reuses the same renderer, so no file is read twice
|
|
241
|
+
- **In-panel editing** — text / Markdown / CSV / JSON; `⌘S` saves; line count and dirty marker; a 409 conflict offers two choices
|
|
242
|
+
- **Open with default app** — macOS `open` / Windows `start` / Linux `xdg-open`; hidden over a remote connection
|
|
243
|
+
- **Reveal in file manager** — macOS `open -R` / Windows `explorer /select,` / Linux FileManager1 (falls back to opening the containing directory when the service is missing)
|
|
244
|
+
|
|
245
|
+
#### 4.3 File operations
|
|
246
|
+
|
|
247
|
+
- **New** — folder / file (empty), with automatic name avoidance on collision
|
|
248
|
+
- **Rename** — `F2`, pre-selecting everything except the extension
|
|
249
|
+
- **Duplicate** — creates “name copy” in the same directory
|
|
250
|
+
- **Cut / copy / paste** — the panel has its own clipboard and works across directories (`⌘C` / `⌘X` / `⌘V`)
|
|
251
|
+
- **Multi-select** — `⌘`-click to toggle, `⇧`-click for a range; batch operations act on the whole selection
|
|
252
|
+
- **Delete** — moves to the system trash after a confirmation, and is recoverable (`Delete` or `⌘⌫`)
|
|
253
|
+
- **Undo** — delete, rename, move and create can all be undone (last 20 steps) with `⌘Z` or **More → Undo**
|
|
254
|
+
- **Download** — the file lands in the browser's download directory
|
|
255
|
+
- **Compress / extract** — *Compress to ZIP* writes a sibling archive; `.zip` files can be *Extract here*; entries that try to escape the target directory are refused; archives are assembled by the host with `zlib`
|
|
256
|
+
- **Upload** — **only appears over a remote connection**; streams to the host disk (never buffered in memory) with progress, up to 512 MB per file
|
|
257
|
+
- **Drag and drop** — move / import / drag out of the window (see highlight 4)
|
|
258
|
+
- **Git badges** — inside a repository, coloured dots for modified / untracked / staged / deleted / conflicted, with a status tooltip. Read-only `git status --porcelain` with `GIT_OPTIONAL_LOCKS=0`; the index is never touched
|
|
259
|
+
- **Live refresh** — external changes appear in the list; a previewed file offers a reload prompt
|
|
260
|
+
|
|
261
|
+
#### 4.4 Search
|
|
262
|
+
|
|
263
|
+
- **Filter the current directory** — filters as you type, no host request
|
|
264
|
+
- **Recursive** — expands to the whole subtree; rows carry `name / parent / size`
|
|
265
|
+
- **Content search** — returns `file:line` plus the line text, with a line badge, a monospace snippet and match highlighting
|
|
266
|
+
- **Results reuse the view** — icons / list / grouped render the results directly; click to select, double-click to jump to the containing directory (a content hit opens the preview)
|
|
267
|
+
- **Budgets and feedback** — count badge, truncation marker, scanned entries and elapsed time; the empty state suggests a different keyword or enabling recursion
|
|
268
|
+
|
|
269
|
+
#### 4.5 DSH integration
|
|
270
|
+
|
|
271
|
+
- **Add as workspace** — right-click a folder, written into DSH's workspace list
|
|
272
|
+
- **Add to conversation** — right-click an image / text / PDF / Word / Excel / PPT file, sent as an attachment into the composer
|
|
273
|
+
- **Reference in composer** — inserts only `@path`, costing no context
|
|
274
|
+
- **Drag into the conversation** — drag the selection out of the list; it lands as an attachment or `@path`
|
|
275
|
+
- **Workspace switching** — the toolbar drop-down reads a live snapshot from `ctx.workspaces`
|
|
276
|
+
|
|
277
|
+
#### 4.6 Appearance and settings
|
|
278
|
+
|
|
279
|
+
- **Transition animations** — slide (default) / fade / zoom / rise / bounce; in-place refreshes only fade; automatically off when the system asks for reduced motion
|
|
280
|
+
- **Languages** — Chinese / English, default *Auto* (follows the system)
|
|
281
|
+
- **Options window** — **More → Options**, with display / view / grouped view / right pane / animation / language, kept in sync with the toolbar
|
|
282
|
+
- **About** — version, author, build date and repository, read straight from `package.json`
|
|
283
|
+
|
|
284
|
+
#### 4.7 Keyboard shortcuts
|
|
285
|
+
|
|
286
|
+
> These work while the **file list has focus**; they do not fire inside inputs or the editor (`⌘S` being the exception — it only works in the editor).
|
|
287
|
+
|
|
288
|
+
- **Views** — `⌘1` / `⌘2` / `⌘3` (Windows: `Ctrl+1` / `2` / `3`)
|
|
289
|
+
- **Address bar** — `⌘L`
|
|
290
|
+
- **Move and open** — `↑` / `↓` to move the selection, `Enter` to open or preview, `Space` for Quick Look, `Backspace` to go up
|
|
291
|
+
- **Selection** — `⌘A` all, `⌘⇧A` none, `⌘⌥A` invert
|
|
292
|
+
- **Clipboard** — `⌘C` / `⌘X` / `⌘V`
|
|
293
|
+
- **Files** — `F2` renames, `Delete` (or `⌘⌫`) moves to the trash
|
|
294
|
+
- **Undo and save** — `⌘Z` undoes the last step, `⌘S` saves in the editor
|
|
295
|
+
- **Dismiss** — `Esc` closes an overlay, a menu, or clears the selection
|
|
296
|
+
|
|
297
|
+
#### 4.8 Context menu
|
|
298
|
+
|
|
299
|
+
| Where | Entries |
|
|
300
|
+
|:--|:--|
|
|
301
|
+
| File / folder | Preview (*Open* for folders), show details, open with default app, reveal in file manager, rename…, duplicate, copy, cut, copy path, copy relative path, copy name, download (files only), compress to ZIP, extract here (`.zip` only), move to trash |
|
|
302
|
+
| Files, extra | **Add to conversation** (image / text / PDF / Word / Excel / PPT), **Reference in composer** |
|
|
303
|
+
| Folders, extra | **Add as workspace** |
|
|
304
|
+
| Empty space | New folder…, new file…, paste, reveal current folder in file manager, refresh |
|
|
305
|
+
|
|
306
|
+
---
|
|
307
|
+
|
|
308
|
+
### 5. Previewable file types
|
|
309
|
+
|
|
310
|
+
| Type | Extensions | How it renders | Limit |
|
|
311
|
+
|:--|:--|:--|:--|
|
|
312
|
+
| Images | `png` `jpg` `jpeg` `gif` `webp` `bmp` `ico` `svg` | `<img>` straight from `/raw`, no base64 | 8 MB |
|
|
313
|
+
| PDF | `pdf` | The browser's built-in reader, page and zoom controls, plus *open in a new window* | Browser-defined |
|
|
314
|
+
| Markdown | `md` `markdown` | Headings / bold-italic / inline code / links / lists (with task lists) / tables (with alignment) / quotes / fenced code (language labels) / rules / images | 512 KB |
|
|
315
|
+
| JSON | `json` | Formatted source view: line numbers, folding, indent guides, syntax colours; copy / expand / collapse all; falls back to source on failure | 512 KB |
|
|
316
|
+
| Tables | `csv` `tsv` | First row as header, quoted commas supported | 200 rows |
|
|
317
|
+
| Excel | `xlsx` `xlsm` | Parsed by the host (zip + XML), one tab per worksheet, first row as header | 500 rows (all worksheet columns) |
|
|
318
|
+
| Word | `docx` `docm` | Parsed by the host: headings / body / bullets / tables in document order, text only | 4000 blocks; tables 200 rows × 40 columns |
|
|
319
|
+
| HTML | `html` `htm` | Shown as source text (editable); the page is never rendered | 512 KB |
|
|
320
|
+
| Audio | `mp3` `wav` `m4a` `flac` `ogg` `opus` `aiff` | Native player | Browser-defined |
|
|
321
|
+
| Video | `mp4` `mov` `webm` `ogv` | Native player | Browser-defined |
|
|
322
|
+
| Text / code | any other text type | Monospace, read-only | 512 KB |
|
|
323
|
+
| Everything else | binaries and unsupported formats | Metadata plus *open with default app* | — |
|
|
324
|
+
|
|
325
|
+
**Editable**: text / Markdown / CSV / JSON (`.txt`, `.md`, `.csv`, `.json` and other text extensions).
|
|
326
|
+
**Not editable**: zip, images, media, XLSX, DOCX and anything else that cannot round-trip byte-for-byte — the button simply is not shown, so files cannot be damaged.
|
|
327
|
+
|
|
328
|
+
---
|
|
329
|
+
|
|
330
|
+
### 6. Platform support
|
|
331
|
+
|
|
332
|
+
| Capability | macOS | Windows | Linux |
|
|
333
|
+
|:--|:--:|:--:|:--:|
|
|
334
|
+
| Browse / preview / edit / upload / download / zip | ✅ verified | ⚠️ not verified on a real machine | ⚠️ not verified on a real machine |
|
|
335
|
+
| Open with default app | ✅ `open` | ✅ `cmd /c start` | ✅ `xdg-open` |
|
|
336
|
+
| Reveal in file manager | ✅ `open -R` | ✅ `explorer /select,` | ✅ FileManager1 (falls back to opening the directory) |
|
|
337
|
+
| Move to trash | ✅ `~/.Trash` | ✅ Recycle Bin via PowerShell, falling back to `~/.Trash` | ✅ freedesktop (`.trashinfo`, restorable) |
|
|
338
|
+
| Address bar paths | ✅ POSIX | ✅ drive letters and UNC | ✅ POSIX |
|
|
339
|
+
| Upload a whole folder | ✅ | ✅ | ✅ `webkitdirectory` (Chrome / Edge / Firefox; Safari degrades to picking files) |
|
|
340
|
+
|
|
341
|
+
> ⚠️ **Windows and Linux have not been verified end to end on real machines.** Both branches follow the platform conventions (Explorer's `/select,`, the PowerShell recycle-bin call, freedesktop's `files` + `info` layout) and are covered by “platform plan” test cases in `npm test` that check command and path construction — but nobody has clicked through them on real hardware.
|
|
342
|
+
|
|
343
|
+
**Requirements**: the DSH desktop app (web UI); no Python; Node ≥ 20 (provided by the DSH runtime); a browser with modern ES and CSS variable support (any Chrome / Edge / Safari from the last two years).
|
|
344
|
+
|
|
345
|
+
**Verified on**: DSH desktop **0.2.2-rc.5** · macOS · Chrome / Safari.
|
|
346
|
+
|
|
347
|
+
#### What changes when you access it remotely
|
|
348
|
+
|
|
349
|
+
When you use DSH from another machine over the LAN or a tunnel, actions that **run on the host and need a desktop session** are hidden automatically and the status bar shows “remote · local actions hidden”:
|
|
350
|
+
|
|
351
|
+
- Reveal in Finder / Explorer (including the empty-space menu and the button in the preview pane)
|
|
352
|
+
- Open with default app
|
|
353
|
+
- Move to trash (along with the *Delete* toolbar button and the `Delete` shortcut)
|
|
354
|
+
|
|
355
|
+
**Upload** is the reverse: it only appears remotely, because it is the channel that sends files *from your machine to the host*. Browsing, previewing, editing, downloading, zip handling, Git badges, add to conversation, reference in composer and add as workspace all stay.
|
|
356
|
+
|
|
357
|
+
The decision is made from the request's origin: a loopback Host counts as local; a browser whose platform differs from the host's OS (common with SSH port forwarding) is treated as remote.
|
|
358
|
+
|
|
359
|
+
---
|
|
360
|
+
|
|
361
|
+
### 7. Security boundaries
|
|
362
|
+
|
|
363
|
+
**Paths**
|
|
364
|
+
|
|
365
|
+
- Every path is `realpath()`-ed and then validated; `..` and symlinks cannot escape the browse root (the user's home directory). Escapes return **403**.
|
|
366
|
+
- Rename and create accept a single path segment only (`basename` validated), so separators are rejected.
|
|
367
|
+
|
|
368
|
+
**Authentication**
|
|
369
|
+
|
|
370
|
+
- All **25 host routes** are registered on DSH's `connection` service (`ctx.connection.fetch.register`). Authentication, Host / Origin checks and the browser session are enforced by the host; the plugin implements no auth of its own.
|
|
371
|
+
|
|
372
|
+
**Writes**
|
|
373
|
+
|
|
374
|
+
- Writes prefer DSH's `ctx.fs` (atomic write + version guard). This panel *is* a file manager and every write is an explicit user action, so the call declares the `danger-full-access` policy and is not limited by the workspace sandbox.
|
|
375
|
+
- If the file changed on disk after opening, the host returns **409** and the editor offers *reload* / *overwrite* instead of silently replacing it.
|
|
376
|
+
- When `ctx.fs` is unavailable or still refuses, it falls back to plain `node:fs`, so “a file you can read is a file you can save”.
|
|
377
|
+
|
|
378
|
+
**Transfer and extraction**
|
|
379
|
+
|
|
380
|
+
- ZIP extraction refuses any entry that tries to leave the target directory (`..`, absolute paths, symlink traversal).
|
|
381
|
+
- Uploads stream to disk (never fully in memory) with a **512 MB** per-file limit; downloads are read-only.
|
|
382
|
+
|
|
383
|
+
**HTML files**
|
|
384
|
+
|
|
385
|
+
- The pane shows the source and lets you edit it; scripts are never executed and nothing the page references is loaded. Use "open with default app" (or download it) to see it rendered in a browser.
|
|
386
|
+
|
|
387
|
+
**Preview and listing limits**
|
|
388
|
+
|
|
389
|
+
- **Directory entries** — 2000 per directory; the footer says when it is capped
|
|
390
|
+
- **Text preview / content search per file** — 512 KB
|
|
391
|
+
- **Image preview** — 8 MB
|
|
392
|
+
- **Excel / Word / CSV** — 500 rows / 4000 blocks (tables 200 rows) / 200 rows
|
|
393
|
+
- **Search** — 4000 entries, 200 hits, 4 seconds
|
|
394
|
+
- **Upload** — 512 MB
|
|
395
|
+
|
|
396
|
+
**Git**
|
|
397
|
+
|
|
398
|
+
- Read-only `git status --porcelain` with `GIT_OPTIONAL_LOCKS=0`; the index is never written and the working tree is never touched.
|
|
399
|
+
|
|
400
|
+
**Where data goes**
|
|
401
|
+
|
|
402
|
+
- The plugin makes no network requests, uploads nothing and calls no external API; every parser (XLSX / DOCX / ZIP) runs inside the host process on Node's standard library.
|
|
403
|
+
- UI preferences are written to browser localStorage only — nothing is stored in your home directory.
|
|
404
|
+
|
|
405
|
+
---
|
|
406
|
+
|
|
407
|
+
### 8. FAQ
|
|
408
|
+
|
|
409
|
+
#### The panel is blank or keeps spinning?
|
|
410
|
+
|
|
411
|
+
Usually the host side is not running, or the versions do not match. Reload the page with `⌘R` first; if that does not help, look for `/api/file-explorer` errors in the DSH host log and check that the plugin version matches your DSH version (see **More → About** in the panel).
|
|
412
|
+
|
|
413
|
+
#### Why can't I see `/etc`, `/tmp` or another user's home directory?
|
|
414
|
+
|
|
415
|
+
The browse root is fixed to the current user's home directory (`$HOME`). That is deliberate: every path is `realpath()`-ed and validated first, and escapes return 403. To work elsewhere, put the directory inside your home or create a symlink to it.
|
|
416
|
+
|
|
417
|
+
#### I changed the plugin code but nothing happened?
|
|
418
|
+
|
|
419
|
+
Client changes (`lib/client.js`): reload the page with `⌘R`. Host changes (`lib/index.js`): restart the DSH process.
|
|
420
|
+
|
|
421
|
+
#### Over a remote connection, “open with default app / reveal in Finder / delete” disappeared?
|
|
422
|
+
|
|
423
|
+
Those three actions run on the host's desktop, so they are hidden when the browser is not on that machine; the status bar shows “remote · local actions hidden”. Conversely, **upload** appears only in that situation (sending files from your machine to the host).
|
|
424
|
+
|
|
425
|
+
#### A file only shows “metadata”, or the preview says it is too large?
|
|
426
|
+
|
|
427
|
+
Check the support list in [section 5](#5-previewable-file-types): binaries and unsupported Office formats only get metadata plus *open with default app*. Text over 512 KB and images over 8 MB are truncated or announced instead of rendered; Excel stops at 500 rows and CSV at 200.
|
|
428
|
+
|
|
429
|
+
#### Where do deleted files go, and can I get them back?
|
|
430
|
+
|
|
431
|
+
They go to the **system trash** (macOS `~/.Trash`, the Windows Recycle Bin, the freedesktop trash on Linux) and can be restored from there. Inside the panel you can also press `⌘Z` to undo that deletion.
|
|
432
|
+
|
|
433
|
+
#### Why is there no “Upload” button when I am on the same machine?
|
|
434
|
+
|
|
435
|
+
The files are already on that disk, so *new file* / *paste* / dragging are more direct. Upload exists for the remote case, so it only appears there.
|
|
436
|
+
|
|
437
|
+
---
|
|
438
|
+
|
|
439
|
+
### 9. Feedback
|
|
440
|
+
|
|
441
|
+
- Repository: [https://github.com/MaxBill/dsh-file-explorer](https://github.com/MaxBill/dsh-file-explorer)
|
|
442
|
+
- Issues: [https://github.com/MaxBill/dsh-file-explorer/issues](https://github.com/MaxBill/dsh-file-explorer/issues)
|
|
443
|
+
|
|
444
|
+
When opening an issue, please include:
|
|
445
|
+
|
|
446
|
+
1. **System** (macOS / Windows / Linux and version) and browser version;
|
|
447
|
+
2. **Plugin version** (see **More → About** in the panel) and DSH version;
|
|
448
|
+
3. **Steps to reproduce** (which step, what you clicked, what you expected, what happened);
|
|
449
|
+
4. **Error output** — red errors in the host log or the browser console (F12 → Console);
|
|
450
|
+
5. **A screenshot** (the frame that shows the problem is best).
|
|
451
|
+
|
|
452
|
+
Known limitations: Windows / Linux are not verified on real machines (see [section 6](#6-platform-support)); DSH's own *file changes* and *checkpoints* features are not part of this plugin. For common questions, start with the [FAQ](#8-faq).
|
|
453
|
+
|
|
454
|
+
> ⭐ **If this plugin saves you a few steps**, a star on [GitHub](https://github.com/MaxBill/dsh-file-explorer) is appreciated — and if something feels awkward, please open an issue.
|
|
455
|
+
|
|
456
|
+
---
|
|
457
|
+
|
|
458
|
+
### 10. Appendix: development and maintenance
|
|
459
|
+
|
|
460
|
+
#### Development
|
|
461
|
+
|
|
462
|
+
```sh
|
|
463
|
+
npm test # host HTTP API tests, run in a temp directory under $HOME and cleaned up afterwards
|
|
464
|
+
```
|
|
465
|
+
|
|
466
|
+
There is no build step: `lib/index.js` is plain ESM and `lib/client.js` is a hand-written `window.__ModuleLoader__` factory module. After changing client code, reload the page with ⌘R.
|
|
467
|
+
|
|
468
|
+
| File | Purpose |
|
|
469
|
+
|:--|:--|
|
|
470
|
+
| `lib/index.js` | Host side: registers the 25 `/api/file-explorer` routes on DSH's `connection` service, with every path `realpath`-ed into `$HOME` |
|
|
471
|
+
| `lib/client.js` | Browser side: registers the sidebar icon and the `main` panel; zero dependencies (only `react`) |
|
|
472
|
+
| `cordis.patch.yml` | Bundle patch that inserts the Loader entry `dsh-file-explorer` |
|
|
473
|
+
| `assets/icons/` | 12 ready-to-use two-tone SVGs (`node scripts/export-icons.mjs` exports them from `SHAPES`) |
|
|
474
|
+
| `test/host-api.test.mjs` | Host API tests (including the three-platform command plans) |
|
|
475
|
+
|
|
476
|
+
#### Publishing to npm (maintainers)
|
|
477
|
+
|
|
478
|
+
A machine's registry is often set to a **CNPM mirror** (`registry.npmmirror.com`) — mirrors only accelerate reads; you cannot register, log in or publish through them. The official registry needs its own login:
|
|
479
|
+
|
|
480
|
+
```sh
|
|
481
|
+
npm login --registry=https://registry.npmjs.org/ # the account needs the @maxbill scope
|
|
482
|
+
npm publish # publishConfig.registry already points at the official registry
|
|
483
|
+
npm view @maxbill/dsh-file-explorer version --registry=https://registry.npmjs.org/
|
|
484
|
+
```
|
|
485
|
+
|
|
486
|
+
`publishConfig` declares both `access: "public"` and the official `registry`, so a mirror configuration cannot be used by accident. Before publishing, make sure `version` matches the GitHub Release tag.
|
|
487
|
+
|
|
488
|
+
#### Branch model
|
|
489
|
+
|
|
490
|
+
- `main` — stable; only merged from `develop` through a pull request (branch protection is on: no force-push, no deletion).
|
|
491
|
+
- `develop` — day-to-day work; merge after the tests pass.
|
|
492
|
+
|
|
493
|
+
```sh
|
|
494
|
+
git switch develop
|
|
495
|
+
# ...change code, commit, run tests...
|
|
496
|
+
git push origin develop
|
|
497
|
+
gh pr create --base main --head develop
|
|
498
|
+
|
|
499
|
+
# after merging, align
|
|
500
|
+
git switch develop && git fetch origin && git reset --hard origin/main
|
|
501
|
+
```
|
|
502
|
+
|
|
503
|
+
#### Author and licence
|
|
504
|
+
|
|
505
|
+
- **Author** — **MaxBill** ([GitHub](https://github.com/MaxBill))
|
|
506
|
+
- **Repository** — [https://github.com/MaxBill/dsh-file-explorer](https://github.com/MaxBill/dsh-file-explorer)
|
|
507
|
+
- **Issues** — [https://github.com/MaxBill/dsh-file-explorer/issues](https://github.com/MaxBill/dsh-file-explorer/issues)
|
|
508
|
+
- **Licence** — [Apache License 2.0](LICENSE) © 2026 MaxBill
|
|
509
|
+
|
|
510
|
+
---
|
|
511
|
+
|
|
512
|
+
<sub>Apache-2.0 © 2026 MaxBill · <a href="https://github.com/MaxBill/dsh-file-explorer">GitHub</a> · <a href="https://github.com/MaxBill/dsh-file-explorer/issues">Issues</a></sub>
|