dsh-remote-vs 0.27.0 → 0.29.0
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/README.en.md +159 -23
- package/README.md +123 -23
- package/lib/client.js +6906 -6619
- package/lib/index.js +2014 -67
- package/lib/types/changes/recorder.d.ts +119 -2
- package/lib/types/client/CodeEditor.d.ts +15 -0
- package/lib/types/client/HostsView.d.ts +139 -2
- package/lib/types/client/api.d.ts +42 -2
- package/lib/types/client/changes/apply-failure.d.ts +41 -0
- package/lib/types/client/changes/block-confirm.d.ts +97 -0
- package/lib/types/client/changes/diff-outcome.d.ts +56 -0
- package/lib/types/client/changes/freshness.d.ts +51 -0
- package/lib/types/client/changes/model.d.ts +19 -1
- package/lib/types/client/changes/session-diff.d.ts +100 -0
- package/lib/types/client/changes/staleness.d.ts +98 -0
- package/lib/types/client/changes/turn-reverted.d.ts +82 -0
- package/lib/types/client/changes/turn-view.d.ts +131 -0
- package/lib/types/client/changes/undo-affordance.d.ts +44 -10
- package/lib/types/client/changes/undo-target.d.ts +12 -0
- package/lib/types/client/connection.d.ts +28 -1
- package/lib/types/client/i18n.d.ts +1 -1
- package/lib/types/client/store.d.ts +91 -1
- package/lib/types/client/vsc/change-marks.d.ts +21 -0
- package/lib/types/forward.d.ts +11 -1
- package/lib/types/pool.d.ts +95 -1
- package/lib/types/protocol.d.ts +221 -1
- package/lib/types/proxy.d.ts +136 -0
- package/lib/types/store.d.ts +81 -1
- package/lib/types/tools.d.ts +3 -0
- package/package.json +1 -1
- package/src/changes/recorder.ts +851 -8
- package/src/client/CodeEditor.tsx +43 -3
- package/src/client/ConnectionStatus.tsx +19 -5
- package/src/client/EditorPane.tsx +64 -7
- package/src/client/HostsView.tsx +552 -11
- package/src/client/PortsView.tsx +16 -0
- package/src/client/SettingsHosts.tsx +132 -6
- package/src/client/api.ts +60 -3
- package/src/client/changes/ChangesDock.tsx +539 -54
- package/src/client/changes/apply-failure.ts +73 -0
- package/src/client/changes/block-confirm.ts +180 -0
- package/src/client/changes/changes.css +45 -0
- package/src/client/changes/diff-outcome.ts +97 -0
- package/src/client/changes/freshness.ts +68 -0
- package/src/client/changes/model.ts +56 -1
- package/src/client/changes/session-diff.ts +187 -0
- package/src/client/changes/staleness.ts +148 -0
- package/src/client/changes/turn-reverted.ts +254 -0
- package/src/client/changes/turn-view.ts +195 -0
- package/src/client/changes/undo-affordance.ts +295 -63
- package/src/client/changes/undo-target.ts +12 -0
- package/src/client/connection.ts +76 -2
- package/src/client/i18n.ts +204 -4
- package/src/client/scm/DiffView.tsx +32 -13
- package/src/client/store.tsx +392 -16
- package/src/client/vsc/change-marks.ts +21 -0
- package/src/client/vsc/preview-document.tsx +4 -1
- package/src/client/vsc/vsc.css +6747 -6509
- package/src/forward.ts +38 -2
- package/src/importers.ts +125 -13
- package/src/keygen.ts +8 -1
- package/src/pool.ts +422 -27
- package/src/protocol.ts +229 -1
- package/src/proxy.ts +673 -0
- package/src/routes.ts +93 -14
- package/src/store.ts +335 -0
- package/src/tools.ts +47 -2
package/README.en.md
CHANGED
|
@@ -6,9 +6,8 @@
|
|
|
6
6
|
|
|
7
7
|
SSH host management inside the DSH Host process + helper push pipeline + a **VS Code-style remote
|
|
8
8
|
workbench** (explorer / search / source control / commit graph with its commit-details pane / multi-tab editor / floating editor /
|
|
9
|
-
side-by-side diff / multiple terminals / port forwarding). Hosts live in DSH Settings ("Remote hosts");
|
|
10
|
-
|
|
11
|
-
page (same content, self-opened from the guide, per-session instances). **The sidebar's editor is the DEFAULT
|
|
9
|
+
side-by-side diff / multiple terminals / port forwarding). Hosts live in DSH Settings ("Remote hosts");native right-Sidebar "Remote Workspace"
|
|
10
|
+
page. **The sidebar's editor is the DEFAULT
|
|
12
11
|
seat**: opening a file switches the whole column to it (one view at a time, no tree/editor split) and closing
|
|
13
12
|
the last file returns to the directory. The conversation view slot is registered too, but as the OPTIONAL
|
|
14
13
|
full-width seat — the editor's own expand/dock button moves the same buffer between the two. Since P2, native
|
|
@@ -40,8 +39,7 @@ dsh plugin --profile web add dsh-remote-vs
|
|
|
40
39
|
|
|
41
40
|
**Requires DSH `0.2.2-rc.5` or newer and below `0.3.0`** (`engines.dsh` enforces the range;
|
|
42
41
|
**adapted to and typechecked against `0.2.2-rc.5`**). On Host `0.2.2-rc.4` use plugin `0.23.0`; `0.2.2-rc.2` / `0.2.2-rc.3` use plugin `0.22.0`; on `0.2.2-alpha.3` / `0.2.2-rc.1` use `0.20.1`; the
|
|
43
|
-
`0.2.2-alpha.2` generation needs `0.17.0
|
|
44
|
-
this is a Web plugin, so it has to go into the profile your Web GUI runs from (`web` is
|
|
42
|
+
`0.2.2-alpha.2` generation needs `0.17.0`. `--profile web` selects which profile to install, so it has to go into the profile your Web GUI runs from (`web` is
|
|
45
43
|
the common name; use your own profile's name). Desktop uses the reserved `desktop`
|
|
46
44
|
profile instead — see [Desktop](#desktop-dsh-desktop) below.
|
|
47
45
|
|
|
@@ -52,14 +50,6 @@ profile instead — see [Desktop](#desktop-dsh-desktop) below.
|
|
|
52
50
|
> one ~47 MB upload on that first contact. The old helper directory is kept, so rolling back
|
|
53
51
|
> is just pushing the old version again.
|
|
54
52
|
|
|
55
|
-
**That one command is all it takes — no build scripts have to be approved.** The package
|
|
56
|
-
has no `prepare`/`postinstall` and no package in the dependency tree carries an install
|
|
57
|
-
script (`ssh2` is **bundled into the artifact**, not depended on); the repository route
|
|
58
|
-
also ships the built `lib/`. The old "allow the printed build scripts in that profile's
|
|
59
|
-
`pnpm-workspace.yaml` and re-run" step was pnpm 12's hard policy gate for dependencies
|
|
60
|
-
with lifecycle scripts (`ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED` / `ERR_PNPM_IGNORED_BUILDS`);
|
|
61
|
-
it cannot be waived from the dependency side, only removed from the tree. Then restart
|
|
62
|
-
`dsh web` and open Settings → Remote hosts to configure.
|
|
63
53
|
|
|
64
54
|
### Desktop (DSH Desktop)
|
|
65
55
|
|
|
@@ -102,13 +92,13 @@ extra configuration is needed.
|
|
|
102
92
|
| Explorer | Lazy tree + one click expands/collapses a directory + hidden-files toggle; **new: a 150 ms hover prefetches** that folder's listing (the expand paints from cache and revalidates in the background; if the prefetch is still in flight, the click waits for it and shows the loading line like a cold directory). On the Host every browse request shares **one long-lived SFTP session**, cutting a listing from two round trips to one (**the first one after a cold start or after the 2 idle minutes still pays the channel open**); context menu: new / rename / delete / copy / move / paste / find in folder / insert `@` reference / **download to local** (files stream to this machine; a directory **or a multi-selection** is archived on the remote host as one `.tar.gz` and streamed, so nothing is buffered in Host memory; a native **Save as** dialog picks the destination when the browser supports it, otherwise the browser's download folder; a bottom-right **download panel** shows live progress, allows cancel, and reports completion/failure; the search-hit menu offers it too; a download ends in one of three honest states — **saved / handed to the browser / failed** — and a hand-off never reads as "done", nor does a Host failure get saved as a file; the tree's empty area has its own context menu (new / upload / paste) and uploads, pastes and drops are **serialized** (a second transfer is refused with an explanation); the tree is keyboard-operable (`↑↓` move, `←→` collapse/expand, `Enter` open, `Shift+F10` menu) and dialogs trap focus and close on `Esc`); git status colours and folder roll-up marks; **type-coloured file and folder icons** (coloured sheet + category mark, amber folders that open, same set as the local sidebar; the tree only — other lists keep the neutral glyph); **drag-hover expand**: while dragging a row or dropping OS files, resting the pointer on a collapsed directory for ~650 ms opens it (spring-loaded folder, so the drop lands inside the folder you just revealed; cancelling the drag leaves nothing half-open); **multi-select delete** runs as one remote `rm` batch (per-item progress and cancel, no per-file SFTP round trips for a large tree), re-lists only the deleted entries' parents and refreshes git status in the background; **very large directories render only the rows near the viewport** while keeping the full scroll range; a directory's context menu can **open it in a terminal** |
|
|
103
93
|
| Transfer speed | Uploads/downloads use a **256 KiB × 32 in-flight window** over SSH (pipelined SFTP): single-file downloads and drag-and-drop uploads run ~8× faster than one stream, and the helper push (47 MB) uses parallel `fastPut` too; large uploads are no longer killed by a 60 s deadline (progress watchdog instead). A **download above 4 MiB gets a second dedicated SFTP channel** (one SSH channel caps its window at 2 MiB, so each extra channel adds a window): an interleaved same-process A/B measured **about 1.1–1.4×** (medians of 1.08–1.43× across samples, link-dependent; raw read probes 1.6–1.8× — the product opens two channels, not four); small files keep one channel and one less channel slot, and uploads stay single-channel (the remote write path is the bound, extra channels gain nothing) |
|
|
104
94
|
| Search | Two modes: **file names** (remote `find`) and **contents** (remote `grep`). Content mode has a scope folder, `Aa` (case) / `ab_` (whole word) / `.*` (regex), results grouped per file with match highlights, and clicking a hit jumps to that line; **content mode can be aborted** (changing or clearing the query kills the running remote `grep`; an older Host without the streaming route degrades to a one-shot, non-cancellable query), success with stderr warnings is reported above the results, and a **directory** hit in name mode is revealed in the tree instead of being opened as a file |
|
|
105
|
-
| Connection status and offline read-only | The top bar and the editor info bar show the current workspace's SSH link state (**connection OK / connection issue / ready, connects on demand**): a drop is no longer silent — open editor tabs keep their cached content and turn **read-only** (saves are blocked with an explanation), the tree keeps showing cached directories while background refreshes stay quiet, and uncached directories say they are offline. When the link recovers, directories, git status, **unmodified file tabs and read-only diff tabs** refresh automatically (tabs with unsaved edits are left alone and the user is told). An errored link is retried at most three times, 30 s apart, then the chip is a manual retry control. While the link is down, "Undo this change" and the diff's hunk actions are blocked too; **a single operation's deadline is NOT treated as a broken link** — the chip stays ok and only that operation fails, with the real reason; when the link is down and the workspace has no cache, the SCM panel says it cannot read instead of sitting on "loading". **No cross-reload persistent cache** (remote source never lands on disk) — a deliberate privacy trade-off |
|
|
95
|
+
| Connection status and offline read-only | The top bar and the editor info bar show the current workspace's SSH link state (**connection OK / connection issue / ready, connects on demand**); **hovering the connection status** also shows **the egress THIS connection actually took** (`Egress: direct to host:port` / `Egress: via HTTP proxy host:port` / `Egress: via jump host <alias>`; with nothing connected it degrades to `Egress (configured): …`, plus the reason when the configuration cannot be used) — **runtime evidence**, not the "saved decision" the settings page shows: the saved decision says which route the NEXT dial takes and never rewrites a connection that is already up, so the chip wins when the two disagree. A drop is no longer silent — open editor tabs keep their cached content and turn **read-only** (saves are blocked with an explanation), the tree keeps showing cached directories while background refreshes stay quiet, and uncached directories say they are offline. When the link recovers, directories, git status, **unmodified file tabs and read-only diff tabs** refresh automatically (tabs with unsaved edits are left alone and the user is told). An errored link is retried at most three times, 30 s apart, then the chip is a manual retry control. While the link is down, "Undo this change" and the diff's hunk actions are blocked too; **a single operation's deadline is NOT treated as a broken link** — the chip stays ok and only that operation fails, with the real reason; when the link is down and the workspace has no cache, the SCM panel says it cannot read instead of sitting on "loading". **No cross-reload persistent cache** (remote source never lands on disk) — a deliberate privacy trade-off |
|
|
106
96
|
| Source control | **Repository-folder picker** (for workspaces whose git repository lives in a sub-folder: browse the remote tree, one-click jump to any repository discovered inside the workspace, type a relative or absolute path, and see which repository each folder resolves to); changes / staged / untracked / ignored buckets; **untracked directory rows expand on click**; per-file AND **per-hunk** stage / unstage / discard (behind a confirm) / commit; branches, remotes and stash panes; sync (fetch/pull/push), with **push refspec support** (Gerrit style `HEAD:refs/for/<branch>`; empty = plain `git push`, a non-empty value is remembered); fetch/pull/push/sync get a **live output panel** (server-sent events showing git/remote output, a running clock, **cancel** that kills the remote process group, and the full log for copying afterwards; an older Host without the streaming route falls back to the one-shot result); a non-repository workspace can **initialize a repository**, a branch can be **renamed**, and a remote URL can be **edited** (each behind a confirm/validation) |
|
|
107
|
-
| Session change review | The **collapsible** panel above the composer: what THIS SESSION changed (one row per file, file-type icon, `+a −b` on the right
|
|
97
|
+
| Session change review | The **collapsible** panel above the composer: what THIS SESSION changed, with a one-click switch to **this turn** (the most recent completed turn; the default stays the session total) — one row per file, file-type icon, `+a −b` on the right; clicking a file opens it in the remote editor with **line shading plus character-level inline diff**, `n/N ↑↓` jumps between change points; hovering a changed line puts a `⋯` menu at the row end with **Undo this change** (remote `git apply -R`, failures classified) and **Keep this change** (per block, local only, independent of the file-level ✓); a row's right-click opens a **read-only side-by-side diff** of the ledger baseline, and open tabs are marked "positions stale" when the panel's poll sees their row move. See "Session change review" below; the header can **show only unreviewed files** and **jump to the next unreviewed one** (wraps, never marks a file reviewed) |
|
|
108
98
|
| Side-by-side diff | Panes stay **exactly equal** + per-hunk buttons in the middle gutter + a **top horizontal scrollbar** (a very long line can no longer break the symmetry) + pinned line numbers, **rendering only the rows inside the viewport** (a 3000-line file goes from 9000 row containers to ~174, with exactly the same scroll range as a full render); switch between "before / after", and the after side is editable and savable (the save writes the working-tree file back; a diff above 8MiB is read-only, so a truncated prefix can never be written over the real file) |
|
|
109
99
|
| Commit graph | SVG branch/merge graph; selecting a commit opens the **resizable / expandable commit-details pane** below it with three views: **Commit details** (subject, author, time, full hash + copy, parents, refs, message body, checkout), **Contents** (changed files grouped by directory, collapsible and path-filterable; click for the diff, right-click or the row button to open in the editor), **Diff** (only the first ~1500 rows start expanded, later files start folded; both line numbers, `+/−` counts, line wrapping, previous/next-file navigation, and copy of one file's patch or the whole patch). Merge commits are shown against their **first parent** (git lists no files for a merge otherwise) |
|
|
110
100
|
| AI review | A single-file diff OR a **whole commit** can be handed to the conversation with one click — the request is **appended to the composer draft only** (nothing is sent automatically, and you can edit it first): a diff up to 32 KiB is inlined verbatim; a larger one (or one silently truncated at the 2 MB cap) becomes a summary request — file/commit facts + hunk headers + "fetch it yourself with `git show`" (a 2 MB diff is hundreds of thousands of tokens, so inlining it is pointless); an untracked or binary file is passed by path and the model reads it. Entries: the side-by-side diff toolbar and the commit pane's Diff toolbar; the button is disabled with the reason when the current session is not bound to this remote workspace, or the host exposes no conversation input channel |
|
|
111
|
-
| Multi-tab editor | Open/save/reload, dirty marks, several files at once; **saves are atomic** (side file + rename, writing through symlinks and keeping the mode bits); **a save is checked against the remote baseline** — when the file was written by someone else (an agent through the transparent route, a terminal, another editor) since it was opened, the save is refused and offers "overwrite / load remote version / show difference" instead of overwriting silently; image preview, **document previews** (Markdown/HTML, SVG, CSV/TSV tables, PDF, Office converted to PDF by the host officeKit (remote LibreOffice fallback), audio/video; text sources offer source/preview switching); closing a tab, reloading and switching workspace all **ask first** when there are unsaved edits (a workspace switch clears every tab, so it asks); `Ctrl+S` works globally, even when the editor is not focused; **a page reload reopens the file tabs you had** (per workspace, at most 12; paths only, never contents; tabs that no longer open are skipped and counted; caret and scroll position are not restored); **Ctrl+G goes to a line** and **Ctrl+D selects the next occurrence of the selection**; **inline blame** (author + age; click the gutter cell to open that commit's details) and the file's **commit history** (`git log --follow`; click a row for that version's diff); **symbol outline** (`Ctrl+Shift+O`, language/indentation-based list of classes, functions and fields, click to jump) |
|
|
101
|
+
| Multi-tab editor | Open/save/reload, dirty marks, several files at once; **saves are atomic** (side file + rename, writing through symlinks and keeping the mode bits); **a save is checked against the remote baseline** — when the file was written by someone else (an agent through the transparent route, a terminal, another editor) since it was opened, the save is refused and offers "overwrite / load remote version / show difference" instead of overwriting silently; image preview, **document previews** (Markdown/HTML, SVG, CSV/TSV tables, PDF, Office converted to PDF by the host officeKit (remote LibreOffice fallback), audio/video; text sources offer source/preview switching); closing a tab, reloading and switching workspace all **ask first** when there are unsaved edits (a workspace switch clears every tab, so it asks); `Ctrl+S` works globally, even when the editor is not focused; **a page reload reopens the file tabs you had** (per workspace, at most 12; paths only, never contents; tabs that no longer open are skipped and counted; caret and scroll position are not restored); **Ctrl+G goes to a line** and **Ctrl+D selects the next occurrence of the selection**; **inline blame** (off by default; enable it with the `B` toggle in the info bar — author + age; click the gutter cell to open that commit's details) and the file's **commit history** (`git log --follow`; click a row for that version's diff); **symbol outline** (`Ctrl+Shift+O`, language/indentation-based list of classes, functions and fields, click to jump) |
|
|
112
102
|
| Floating editor | Three entries: "Open in floating editor" in the file-tree / search-hit / source-control context menus, plus **double-clicking the "remote editor" tab** to float the editor as it stands (same tabs, previews, diff, find and change marks — not a second, thinner editor). Drag the title bar to move, drag any of the eight edges/corners to resize, maximize/restore (or double-click the title bar); **minimize to a draggable floating ball** (dirty dot on it, click or press Enter to restore, drag to park it anywhere); `Ctrl+wheel` zooms the editor text. Position, size, font size and the ball's spot survive a page refresh |
|
|
113
103
|
| Syntax highlighting | VS Code **Dark+ / Light+** palettes; covers java/aidl/smali, c/c++, go, rust, js/ts, json, py, yaml, xml, html/css, md, sh, properties/rc/toml, diff …; a **fallback colorer** takes over when no grammar matches, so a file is never left monochrome. Honest caveat: kotlin / gradle / smali are coloured by the Java grammar (no dedicated package), which gets keywords, strings and comments right but does not split their own syntax |
|
|
114
104
|
| Find | In-editor `Ctrl+F` (`Aa` / `ab_` / `.*`, `3/17` count, ↑↓, `F3`/`Shift+F3`, `Esc`); **selected text is carried into the box by `Ctrl+F`**; the widget is pinned to the top-right and does not scroll away; the `n/N` count refreshes on `F3`, clicks and caret moves |
|
|
@@ -117,13 +107,14 @@ extra configuration is needed.
|
|
|
117
107
|
| Terminals | Tabbed multi-terminal (`+` to create, `✕`/middle-click to close behind a confirm), across hosts; session ids are persisted so a page refresh reattaches to the running shells, and a session is kept for **10 minutes after its last socket goes away** (enough for a refresh or a browser-tab switch) before the remote shell is closed; **a socket drop (as opposed to a shell exit) keeps the session and offers a one-click reattach** (the same session id reattaches, and the Host still reclaims it after the 10-minute TTL above), and only a real exit clears it; a reattach **replays the recent output**, so switching sessions no longer leaves a blank terminal |
|
|
118
108
|
| Workspaces | Binding list + routing-mode dropdown + the dual-mode (local / remote) new-workspace wizard; **unbinding asks first** (sessions and history stay readable, new remote calls are refused) |
|
|
119
109
|
| View preferences | The two controls at the bottom of Settings → Remote hosts: **open the remote workspace for a new remote session** (off by default; only remote-workspace sessions trigger it, local sessions never do, it is decided once per session per page load, and a panel you close stays closed) and the **remote workspace width share** (45% by default, 20%–70%): when the plugin opens its “Remote Workspace” right-panel page, the column takes that share of the window width, and changing the share applies immediately while the panel is open. Both live host-side (`$DSH_HOME/dsh-remote-view.json`) so every window of the profile agrees |
|
|
120
|
-
| Port forwarding | A sidebar **"Ports"** page: lists the remote host's listening TCP ports (`ss`, falling back to `netstat`) and forwards any of them to a local port in one click, with the local URL for copying/opening. Manual rules ("remote address:port → local port, which may be auto-assigned") are supported too. **The local listener binds `127.0.0.1` only** (`ssh -L` semantics — never exposed to the LAN); each rule has its own channel budget and never consumes one of the six exec/SFTP slots. An SSH drop or the idle eviction does not kill the listener: the next local connection simply re-dials. Rules live in the browser (restored after a reload) and every one can be stopped; disabling the plugin, deleting the host, or unloading it releases the local ports. When the remote has neither `ss` nor `netstat`, or the probe times out or is interrupted, the panel says "cannot enumerate" instead of showing an empty list |
|
|
110
|
+
| Port forwarding | A sidebar **"Ports"** page: lists the remote host's listening TCP ports (`ss`, falling back to `netstat`) and forwards any of them to a local port in one click, with the local URL for copying/opening. Manual rules ("remote address:port → local port, which may be auto-assigned") are supported too. **The local listener binds `127.0.0.1` only** (`ssh -L` semantics — never exposed to the LAN); **each host gets its own dedicated SSH connection for forwarding** (separate from the shared browse/exec one and the PTY one, so forward traffic never queues ahead of `git status`/SFTP channels), with an automatic **fallback to the shared connection** when the server refuses an extra one (the row then says "Shared"), evicted with the connection after 30 idle minutes; each rule has its own channel budget and never consumes one of the six exec/SFTP slots. An SSH drop or the idle eviction does not kill the listener: the next local connection simply re-dials. Rules live in the browser (restored after a reload) and every one can be stopped; disabling the plugin, deleting the host, or unloading it releases the local ports. When the remote has neither `ss` nor `netstat`, or the probe times out or is interrupted, the panel says "cannot enumerate" instead of showing an empty list |
|
|
121
111
|
|
|
122
112
|
### Hosts and transport
|
|
123
113
|
|
|
124
114
|
| Capability | Notes |
|
|
125
115
|
| --- | --- |
|
|
126
116
|
| Host management | CRUD + connectivity test; key / password auth; config in `$DSH_HOME/dsh-remote.json` (0600), independent from `dsh-ssh.json` |
|
|
117
|
+
| Network egress | Every host picks **follow default / direct / proxy (HTTP CONNECT or SOCKS5) / jump host**. The host form's 「network egress」 block is **collapsed by default**: the collapsed row carries a read-only chip that already spells the route out (`direct` / `follow default (direct)` / `follow default (via HTTP proxy 192.0.2.10:3128)` / `via SOCKS5 proxy …` / `via jump host <alias>`), and only expanding it reveals the fields (four mode radios, type/host/port, username/password, jump-host dropdown); the toggle is a real `<button>` with `aria-expanded`, so Enter/Space work. Each host row carries the same chip (a `follow default` row resolves to the route it actually takes; with no known default it says just "follow default" instead of assuming direct); a setting that cannot work turns it **error-coloured** with the reason in `title` (jump host deleted, jump host pointing at itself, invalid endpoint). **Two levels**: Settings → Remote hosts also has a collapsible **default network egress** card (profile-wide, direct by default) — what `follow default` hosts use, overridable per host; that card's chip shows the **stored** value only, so an unsaved edit does not appear there. Proxy passwords are **never echoed**: editing an existing host shows an empty password box with "stored — leave empty to keep", and an empty box keeps the stored secret **for the same endpoint** (a changed `kind`/host/port/username drops it — re-enter it; the `password` field is not sent) |
|
|
127
118
|
| Key bootstrap | One click generates a dedicated keypair on password hosts and deploys `authorized_keys`, key auth from then on |
|
|
128
119
|
| Push pipeline | Remote arch/OS probe → version compare → skip-if-same / else push; the executable channel pushes a self-built helper. A failed deploy no longer retries on every remote file operation: it backs off from **5 seconds up to 5 minutes**, and the Settings "Push" button forces an immediate retry; **an automatic push (first contact or upgrade self-heal) raises a bottom-right toast on success** (`alias: pushed remote helper <version>`), while a manual push stays quiet (Settings already shows its state) |
|
|
129
120
|
| Remote files | SFTP browse / read / write / create / delete / rename. Boundaries hardened: 0-byte files no longer deadlock, and every SFTP operation times out at 60s and releases its channel; **a single directory listing is capped at 20000 entries** (the first 20000 after sorting — directories first, then names — announced in the host log; the protocol carries no "truncated" field, so the UI has no marker); **a save goes through a side file and a rename** (server-side `posix-rename` when available, otherwise backup-rename-rollback), **writes through symlinks** (the link itself survives) and keeps the mode bits **on a best-effort basis**; SCM status parsing unquotes git's C-quoted paths (any name with whitespace is quoted) |
|
|
@@ -135,6 +126,49 @@ extra configuration is needed.
|
|
|
135
126
|
| Import | One-click import from `~/.ssh/config` and from an existing `dsh-ssh.json` (read once, no coupling); `Host a b` multi-pattern entries are expanded one by one, `Include` is reported as not expanded instead of being silently dropped, and every skipped host names an actionable reason (no User / no IdentityFile / invalid port …) |
|
|
136
127
|
| Environment check | An "environment check" per host: one remote command probes OS/kernel, glibc, `git`, `ripgrep`, `tar`, `setsid --wait`, `$HOME` free space, CPU/memory, the deployed helper version and sshd's `MaxSessions`, shown as a three-state table (**available / missing / unknown**). "Could not determine" is reported as **unknown**, never as "missing" (insufficient permission, unparseable output and a dropped link are all unknown); every row keeps the remote's own words, stderr is merged rather than discarded, and the whole report copies in one click |
|
|
137
128
|
|
|
129
|
+
### Network egress (proxy / jump host)
|
|
130
|
+
|
|
131
|
+
For hosts the machine can reach, but only through one more hop out of this network. Four points:
|
|
132
|
+
|
|
133
|
+
- **Two levels**: one profile-wide **default network egress** (Settings → Remote hosts → Default network egress,
|
|
134
|
+
`direct` by default), plus a per-host `follow default / direct / proxy / jump host`. A host without the field
|
|
135
|
+
reads as `follow default`, and the default's own default is direct ⇒ **an upgrade changes nothing**;
|
|
136
|
+
`follow default` stores "no opinion", it does not copy the value of the moment.
|
|
137
|
+
- **Proxy** supports `HTTP CONNECT` and `SOCKS5`, both with optional username/password (Basic /
|
|
138
|
+
SOCKS5 user-pass sub-negotiation).
|
|
139
|
+
- A **jump host** rides another stored host's SSH connection (one `direct-tcpip` hop), and the jump host dials
|
|
140
|
+
through **its own** egress (direct / proxy / follow default). **Multi-hop is refused at parse time**
|
|
141
|
+
(`ProxyJump a,b` is skipped with the reason), and a host that others already jump through cannot be turned into
|
|
142
|
+
a jump host itself (that would make every dependent a two-hop chain). What the row names are the two runtime
|
|
143
|
+
problems — a **chain** (the jump host is itself a jump host) and a **dangling** one (the jump host was deleted) —
|
|
144
|
+
instead of surfacing as "connection failed" at dial time.
|
|
145
|
+
- Failures stay layered: `proxy layer` (unreachable / auth required / tunnel refused / wrong protocol) and
|
|
146
|
+
`target layer` (jump host unusable, endpoint invalid) each get an actionable sentence.
|
|
147
|
+
- It only affects the plugin's own SSH dials (exec / SFTP / terminal / port forwarding share the same resolution);
|
|
148
|
+
system environment variables and DSH's own `HTTP_PROXY` are untouched.
|
|
149
|
+
|
|
150
|
+
Importing `~/.ssh/config` maps `ProxyJump` / `ProxyCommand` too: a single-hop `ProxyJump bastion` **whose jump
|
|
151
|
+
host is imported from the same config** (being visible in that import is enough — **file order does not matter**,
|
|
152
|
+
so `Host target` before `Host bastion` still imports both) becomes a jump host; `ProxyCommand nc -X connect -x
|
|
153
|
+
host:port` → HTTP proxy, `nc -x host:port` → SOCKS5, `ssh -W %h:%p bastion` → jump host. Multi-hop, a third-party
|
|
154
|
+
program (`corkscrew`, …) or a jump host that was not imported is **skipped with a reason**, instead of quietly
|
|
155
|
+
dropping the proxy and leaving a host that can never connect.
|
|
156
|
+
|
|
157
|
+
#### How to confirm the jump host is really used
|
|
158
|
+
|
|
159
|
+
**Start with the connection chip's tooltip**: it states **the egress THIS connection actually took**
|
|
160
|
+
(`Egress: via jump host <alias>` and friends), not what the settings store. The two can disagree — switching a
|
|
161
|
+
host from direct to a jump host leaves an already-open connection serving on the old route until that edit drops
|
|
162
|
+
it (see above). For an independent check, look at three machines:
|
|
163
|
+
|
|
164
|
+
1. **Target host**: `ss -tn state established '( sport = :<port> )'` — the peer should be **the jump host's
|
|
165
|
+
public IP**, not your own.
|
|
166
|
+
2. **Jump host**: `ss -tnp | grep <port>` — the `sshd` process should have an outbound connection to the
|
|
167
|
+
target's `host:port`.
|
|
168
|
+
3. **Your machine**: no direct connection to the target port (empty output is what you want):
|
|
169
|
+
`ss -tn state established '( dport = :<port> )'` on Linux, `Get-NetTCPConnection -RemotePort <port>` on
|
|
170
|
+
Windows, `netstat -an | grep <port>` on macOS.
|
|
171
|
+
|
|
138
172
|
### Agent capabilities
|
|
139
173
|
|
|
140
174
|
| Capability | Notes |
|
|
@@ -159,7 +193,8 @@ dsh_remote_vs/
|
|
|
159
193
|
│ ├── sftp.ts # remote file engine (SFTP windowed reads-writes/tree ops)
|
|
160
194
|
│ ├── keygen.ts # password-host key bootstrap (generate→deploy→flip)
|
|
161
195
|
│ ├── deploy.ts # push pipeline (probe/compare/ship/double-verify/manifest)
|
|
162
|
-
│ ├── importers.ts # ssh_config / dsh-ssh.json parsing importers
|
|
196
|
+
│ ├── importers.ts # ssh_config / dsh-ssh.json parsing importers (ProxyJump/ProxyCommand → egress)
|
|
197
|
+
│ ├── proxy.ts # egress tunnels (HTTP CONNECT / SOCKS5 handshake + pure ProxyJump/ProxyCommand parsing)
|
|
163
198
|
│ ├── routes.ts # /api/dsh-remote/* route table + terminal WebSocket upgrade
|
|
164
199
|
│ ├── terminal.ts # PTY session registry (reconnect-on-refresh/disconnect cleanup)
|
|
165
200
|
│ ├── forward.ts # local port-forward manager (direct-tcpip channels / one listener per rule / budgets)
|
|
@@ -226,14 +261,14 @@ dsh_remote_vs/
|
|
|
226
261
|
│ ├── MonitorView.tsx # monitor panel (one/all hosts, curves, pause/refresh, persisted scope)
|
|
227
262
|
│ ├── metrics-model.ts # monitor model (history window/sparkline geometry/capacity+rate formatting)
|
|
228
263
|
│ ├── HostsView / WorkspacesView / WorkspaceWizard / TerminalView / XTerm / PortsView / Dialog
|
|
229
|
-
│ ├── SettingsHosts.tsx # settings occupants (host mgmt/binding list, self-fetching)
|
|
264
|
+
│ ├── SettingsHosts.tsx # settings occupants (host mgmt/binding list/default egress, self-fetching)
|
|
230
265
|
│ ├── DirectoryFlow.tsx # native entry occupant (local dual-mode/remote wizard)
|
|
231
266
|
│ ├── RemoteDirectoryPicker.tsx# remote directory browser dialog
|
|
232
267
|
│ └── i18n.ts / theme.ts / ui.tsx # bilingual dictionary/theme signal/shared styles
|
|
233
268
|
├── vendor/dsh-remote-helpers/ # helper seeds (shipped, seeded into cache at startup, see below)
|
|
234
269
|
├── docs/ # local-only working docs (only docs/media/ screenshots ship)
|
|
235
270
|
│ ├── MAINTENANCE.md # local-only (.gitignore), not shipped: upgrade impact, checklist, pitfalls, release
|
|
236
|
-
│ ├── VERSION-HISTORY.md # local-only: per-release change log (0.7.1 → 0.
|
|
271
|
+
│ ├── VERSION-HISTORY.md # local-only: per-release change log (0.7.1 → 0.29.0)
|
|
237
272
|
│ └── GATES.md # local-only: local gate inventory and measured assertion counts
|
|
238
273
|
├── locale/ # bilingual plugin metadata
|
|
239
274
|
└── lib/ # build output (**must be committed**; only .map is ignored; restart after link install)
|
|
@@ -351,16 +386,72 @@ with zero change events).
|
|
|
351
386
|
right with the composer card; click the header to collapse/expand, `⟳` forces an immediate rescan. With no
|
|
352
387
|
changes it says "this session has not changed any file yet"; when it cannot compute, it states the
|
|
353
388
|
**specific reason** (see the limits below) instead of handing you an empty list to guess about.
|
|
389
|
+
- **Scope switch: session total / this turn** (the default is still the session total; nothing changes unless
|
|
390
|
+
you switch). The two small buttons in the header appear only when the host really published a completed
|
|
391
|
+
turn (not before the first turn ends, and not against an older host). In "This turn" the title becomes
|
|
392
|
+
**"Turn #N · HH:MM"** and both the rows and `+a −b` describe the **most recent completed turn** only — a file
|
|
393
|
+
some earlier turn changed but this turn did not is absent. The choice is remembered per browser
|
|
394
|
+
(`rvs.changes.scope`). N is a **completed** turn number: the turn the session is running right now is never
|
|
395
|
+
folded in early.
|
|
396
|
+
- **Opening a row in turn mode** uses the same marks/undo machinery as the cumulative view, but the baseline
|
|
397
|
+
is **what the file looked like when the previous turn closed**: `n/N ↑↓`, the hover "Undo this change"
|
|
398
|
+
(reverse-applies that turn's hunk) and the row's "Revert all changes in this file" (the turn's whole-file
|
|
399
|
+
reverse patch) all undo **this turn's** work only. If the file was modified after the turn closed, the host
|
|
400
|
+
answers "stale" and the panel **says so and switches back to the session-total view** before fetching that
|
|
401
|
+
comparison — it never paints line numbers from a comparison that no longer describes the file. Turn mode
|
|
402
|
+
has no "undo the new file (delete it)" entry (that needs git's index copy, and the turn cache keeps
|
|
403
|
+
patches only); the row menu says to delete it from the session-total view or the Source Control panel.
|
|
404
|
+
- **A successful revert hides the row from the turn list**: the turn view is the delta FROZEN when the
|
|
405
|
+
turn closed, and the host never rewrites it — so "reverted, but the row is still there" is finished by
|
|
406
|
+
the **client presentation layer**. After a single-change revert (that file had exactly one change this
|
|
407
|
+
turn) or the row's "Revert all changes in this file", the row is filtered out and the file count /
|
|
408
|
+
`+a −b` are recomputed from the **visible** rows; the panel says how many were hidden, and when nothing
|
|
409
|
+
is left — and the view is COMPLETE — it says "all changes from this turn have been reverted" (not
|
|
410
|
+
"this turn changed no file"). A partial view or a still-pending scan keeps the "N hidden" sentence:
|
|
411
|
+
the panel does not assert what it cannot prove.
|
|
412
|
+
Records are keyed by `(session, turn, path)` in browser storage (`rvs.changes.reverted.<session>`) and
|
|
413
|
+
survive a page reload. A PARTIAL undo of a multi-hunk file does **not** hide it (the remaining changes
|
|
414
|
+
must stay visible), a failed revert never hides anything, and a browser with storage disabled simply
|
|
415
|
+
does not remember (the list stays as before) — no remote write is ever affected, and the host's frozen
|
|
416
|
+
accounting is unchanged.
|
|
354
417
|
- **Clicking a file** opens it in the remote editor with change marks: added lines get a **green line
|
|
355
418
|
background**, deleted characters are drawn as an **inline struck-through chip** (a deleted character does
|
|
356
419
|
not exist in the new file, so it can only be an inserted widget), and the left gutter carries a change bar.
|
|
357
420
|
- **Jumping between change points**: the floating `n/N ↑↓` control at the editor's top-right
|
|
358
421
|
(`Alt+Shift+Cmd/Ctrl+↓/↑`) cycles through them; typing in the editor invalidates the marks and says
|
|
359
|
-
"position may be out of date".
|
|
360
|
-
|
|
422
|
+
"position may be out of date". **The panel's 3-second rescan invalidates open tabs too** (the session or
|
|
423
|
+
the remote side changed the same file again, or the file left the list): the same "positions stale" badge
|
|
424
|
+
appears and clicking that row recomputes against what is there now — an open tab never keeps painting
|
|
425
|
+
marks nobody knows are out of date.
|
|
426
|
+
- **View diff (read-only)**: right-click a row → "View diff" opens the file as a **side-by-side** diff whose
|
|
427
|
+
data comes from the **session ledger** (baseline = session start), not from `git diff` (that compares
|
|
428
|
+
index/HEAD and may include uncommitted edits that predate the session). The before side is reconstructed
|
|
429
|
+
exactly from the served hunks plus the current file, reusing the existing side-by-side renderer. The page
|
|
430
|
+
is read-only: no editing, no per-hunk stage/revert, and reloading still goes through the ledger. Binary and
|
|
431
|
+
oversized rows keep the entry **visible but disabled**, with the reason in its hint (opening it could only
|
|
432
|
+
show an empty or fake view); when the content was withheld at the byte cap — or the "after" read hit the
|
|
433
|
+
8 MiB cap — the page is **not opened** and says the comparison is incomplete (the two panes would be
|
|
434
|
+
misaligned).
|
|
435
|
+
- **The five outcomes of opening a row are stated**: a diff withheld at the byte cap says "the comparison is
|
|
436
|
+
incomplete (it may count the whole file as changed), so nothing is marked and nothing can be reverted"; an
|
|
437
|
+
oversized file says "no line-level comparison, no undo — open the file to read it"; binary files, files the
|
|
438
|
+
remote cannot read, and files whose change is already gone each get their own sentence instead of a silent
|
|
439
|
+
empty list.
|
|
440
|
+
- **Row-end `⋯` menu**: hovering a changed line puts a small `⋯` at the row's right end (one row tall, its
|
|
441
|
+
vertical centre locked to that row, so the pointer reaches it horizontally without entering another row);
|
|
442
|
+
clicking it opens "Undo this change" and "Keep this change".
|
|
443
|
+
- **Undo this change**: pick undo in that menu → remote `git apply -R`. When the context no longer
|
|
361
444
|
matches, the far end refuses outright (not one byte of the file changes); a tab with unsaved edits is
|
|
362
445
|
refused first, so a remote patch can never overwrite your buffer; on success the caret stays where it was
|
|
363
|
-
and the marks are re-read (they do not simply vanish because something was undone).
|
|
446
|
+
and the marks are re-read (they do not simply vanish because something was undone). **Failures are
|
|
447
|
+
classified**: surroundings moved / the file is gone from the repository / permission denied / the
|
|
448
|
+
repository has a `dubious ownership` problem (set `safe.directory` or fix ownership) / the patch is corrupt
|
|
449
|
+
— each with the sentence that tells you what to do, plus git's raw wording.
|
|
450
|
+
- **Keep this change (per block, local only)**: the same menu carries a toggle, "Keep this change" —
|
|
451
|
+
"I read this block and agree with it". It **writes nothing, sends nothing, and does not touch the diff
|
|
452
|
+
data**; the state lives in browser storage per session, keyed by a stable block identity (file + the four
|
|
453
|
+
hunk-header numbers), so it survives a page reload. It is a **second level** and does **not** sync with the
|
|
454
|
+
row's ✓: a block note is "I looked at this piece", the ✓ stays a file-level manual mark. No bulk keep.
|
|
364
455
|
- **Follow the session's workspace**: the sidebar, the editor's dropdown and the file tree all follow the
|
|
365
456
|
workspace the **current session** lives in; after a manual switch they are not pulled back within that
|
|
366
457
|
session, and a new session follows again. The capability lives in the store, so it works even when **the
|
|
@@ -377,17 +468,62 @@ with zero change events).
|
|
|
377
468
|
usually catch up within a second or two); **new files** created in a shell are found by a **slow scan**
|
|
378
469
|
whose single-run budget is up to **3 minutes**, re-run at a self-tuning interval (at least 5 seconds,
|
|
379
470
|
naturally longer on a huge checkout). `⟳` forces an immediate rescan.
|
|
471
|
+
- **How fast a manual edit shows up**: with no turn event (you changed a file from a terminal or an editor)
|
|
472
|
+
the panel's self-heal rescans on a window derived from the **last `git status` cost**
|
|
473
|
+
(`clamp(scan × 4, 5s, 30s)`): a small repository (100ms class) → **5 seconds**; an AOSP-class tree
|
|
474
|
+
(1.7s measured) → **6.8 seconds**; the **30-second ceiling only applies once a scan costs ≥ 7.5s**.
|
|
475
|
+
The cost is therefore calculable: on such a tree, with the 3-second poll, roughly **one `git status`
|
|
476
|
+
every ~9 seconds** — about **3×** the old 30-second window (the price of keeping the 4× design, paid
|
|
477
|
+
for surfacing manual edits in ~7s instead of 30s).
|
|
478
|
+
- **Coming back to the page** (tab shown again, or the window regaining focus) asks the host for **one
|
|
479
|
+
immediate rescan**, and it is NOT the same thing as `⟳`: only tracked files are re-scanned
|
|
480
|
+
(`trackedOnly`), the slow walk's cadence is untouched and a written-off `git ls-files --others` is NOT
|
|
481
|
+
re-armed (11s on the reference tree, minutes cold — focus can happen every few seconds). `⟳` is the one
|
|
482
|
+
that re-runs everything. Both are debounced by 5 seconds, skipped while the page is hidden, and skipped
|
|
483
|
+
when a request is already in flight (in-flight for over 60 seconds counts as a failed request, so one
|
|
484
|
+
stuck fetch cannot disable the refresh forever).
|
|
485
|
+
- **Note**: `⟳` and "coming back" only SCHEDULE the rescan — the response still carries the previous
|
|
486
|
+
summary, and the fresh numbers arrive on the next poll (≤ 3 seconds), not with the refresh call itself.
|
|
380
487
|
- A non-git workspace, or one holding several repositories with no repository directory set, shows the exact
|
|
381
488
|
reason (`no git repository at the workspace root, and N candidates below it — set the repository directory
|
|
382
489
|
in Source Control`) rather than an empty list.
|
|
383
490
|
- Binary and oversized files are marked "binary / too large" on the row and get no character-level diff;
|
|
384
491
|
**non-UTF-8 text (GBK and friends) is treated as binary** (no counts, no undo) so it cannot produce
|
|
385
492
|
garbage numbers and an undo that always fails.
|
|
493
|
+
- **Oversized files get no line-level comparison**: the list pins their `+a −b` to `0/0` (not real counts),
|
|
494
|
+
so opening one only opens the file with the sentence "too large, no line-level comparison" — no marks and
|
|
495
|
+
no undo, which also keeps `0/0` from being compared against real line counts and mislabelling the tab
|
|
496
|
+
"positions stale".
|
|
497
|
+
- **The turn view covers the most recent completed turn only** (no per-turn history): at each turn close the
|
|
498
|
+
host records every listed file's text and diffs the next close against it, so the turn the session is
|
|
499
|
+
running right now is never mixed in.
|
|
500
|
+
- **The turn's patches and hunk text have a budget (4 MiB by default)**: it counts whole-file reverse
|
|
501
|
+
patches plus hunk lines only; both full texts and the previous-close snapshot are bounded separately by
|
|
502
|
+
the scan caps (resident cost is roughly 4 MiB + those texts, worst case ≈ 20 MiB per active session).
|
|
503
|
+
Over budget, that session's turn view keeps **the real counts only** — no marks, no undo, the reason
|
|
504
|
+
stated, and the host **stops computing turn views for the rest of the session**. Continuing would
|
|
505
|
+
compare the next turn against a snapshot that was never advanced and attribute old work to it. The
|
|
506
|
+
session-total view is unaffected.
|
|
507
|
+
- **New files are found by the slow scan**: a turn close first uses whatever scan result is cached and the
|
|
508
|
+
list says "still waiting for the new-file scan"; after the slow walk (`git ls-files --others`) lands the
|
|
509
|
+
**same turn is recomputed** and that marker clears. When the walk is written off, the list was cut by the
|
|
510
|
+
file cap, or a PREVIOUS turn never finished its correction, the turn view stays marked partial — and a
|
|
511
|
+
path whose previous side was withheld (binary / too large) is dropped rather than reported as a
|
|
512
|
+
whole-file creation.
|
|
513
|
+
- Binary/oversized files keep "binary / too large" in the turn view too, with no line-level comparison; the
|
|
514
|
+
turn cache does not keep their bytes.
|
|
386
515
|
- When the untracked scan gives up (e.g. the far end refuses), the panel **states the reason** and keeps the
|
|
387
516
|
refresh entry point instead of silently listing fewer rows.
|
|
388
517
|
- Undo carries **provenance** (session / binding / repository directory), so a patch can never be applied to
|
|
389
518
|
another host after switching sessions or bindings; a file this session created whole is not offered for
|
|
390
519
|
undo (a reverse patch must never delete an untracked file).
|
|
520
|
+
- Binary/oversized rows show "View diff" **disabled with its reason**; content withheld at the byte cap (or
|
|
521
|
+
an "after" read over 8 MiB) opens no diff at all, because those hunks are a whole-file fake comparison
|
|
522
|
+
that could never be reverted.
|
|
523
|
+
- When a file is back at its session baseline, opening the row says "no diff to show right now" instead of
|
|
524
|
+
claiming the remote cannot read it.
|
|
525
|
+
- "Positions stale" is only a **notice**, never an automatic re-read: that happens when you click the row (or
|
|
526
|
+
after a successful save).
|
|
391
527
|
|
|
392
528
|
## P2 transparent remote execution (Windows native)
|
|
393
529
|
|