dsh-remote-vs 0.26.0 → 0.28.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.
Files changed (75) hide show
  1. package/README.en.md +112 -28
  2. package/README.md +84 -25
  3. package/THIRD-PARTY-NOTICES.md +7 -2
  4. package/lib/client.js +1237 -254
  5. package/lib/index.js +821 -17
  6. package/lib/types/changes/recorder.d.ts +119 -2
  7. package/lib/types/client/CodeEditor.d.ts +29 -0
  8. package/lib/types/client/OutlinePanel.d.ts +22 -0
  9. package/lib/types/client/ProcessesSection.d.ts +19 -0
  10. package/lib/types/client/api.d.ts +22 -2
  11. package/lib/types/client/blame-model.d.ts +77 -0
  12. package/lib/types/client/changes/apply-failure.d.ts +41 -0
  13. package/lib/types/client/changes/block-confirm.d.ts +97 -0
  14. package/lib/types/client/changes/diff-outcome.d.ts +56 -0
  15. package/lib/types/client/changes/freshness.d.ts +51 -0
  16. package/lib/types/client/changes/model.d.ts +19 -1
  17. package/lib/types/client/changes/session-diff.d.ts +100 -0
  18. package/lib/types/client/changes/staleness.d.ts +98 -0
  19. package/lib/types/client/changes/turn-reverted.d.ts +82 -0
  20. package/lib/types/client/changes/turn-view.d.ts +131 -0
  21. package/lib/types/client/changes/undo-affordance.d.ts +44 -10
  22. package/lib/types/client/changes/undo-target.d.ts +12 -0
  23. package/lib/types/client/i18n.d.ts +1 -1
  24. package/lib/types/client/outline-model.d.ts +59 -0
  25. package/lib/types/client/scm/actions.d.ts +12 -1
  26. package/lib/types/client/store.d.ts +109 -1
  27. package/lib/types/client/vsc/blame.d.ts +19 -0
  28. package/lib/types/client/vsc/change-marks.d.ts +21 -0
  29. package/lib/types/client/vsc/kit.d.ts +0 -2
  30. package/lib/types/client/vsc/preview-document.d.ts +46 -0
  31. package/lib/types/client/vsc/preview-model.d.ts +31 -0
  32. package/lib/types/client/vsc/preview-services.d.ts +24 -0
  33. package/lib/types/git-ops.d.ts +18 -0
  34. package/lib/types/processes.d.ts +43 -0
  35. package/lib/types/protocol.d.ts +133 -1
  36. package/package.json +2 -1
  37. package/src/changes/recorder.ts +851 -8
  38. package/src/client/CodeEditor.tsx +86 -4
  39. package/src/client/EditorPane.tsx +581 -41
  40. package/src/client/MonitorView.tsx +16 -5
  41. package/src/client/OutlinePanel.tsx +287 -0
  42. package/src/client/ProcessesSection.tsx +292 -0
  43. package/src/client/api.ts +38 -3
  44. package/src/client/blame-model.ts +242 -0
  45. package/src/client/changes/ChangesDock.tsx +539 -54
  46. package/src/client/changes/apply-failure.ts +73 -0
  47. package/src/client/changes/block-confirm.ts +180 -0
  48. package/src/client/changes/changes.css +45 -0
  49. package/src/client/changes/diff-outcome.ts +97 -0
  50. package/src/client/changes/freshness.ts +68 -0
  51. package/src/client/changes/model.ts +56 -1
  52. package/src/client/changes/session-diff.ts +187 -0
  53. package/src/client/changes/staleness.ts +148 -0
  54. package/src/client/changes/turn-reverted.ts +254 -0
  55. package/src/client/changes/turn-view.ts +195 -0
  56. package/src/client/changes/undo-affordance.ts +295 -63
  57. package/src/client/changes/undo-target.ts +12 -0
  58. package/src/client/i18n.ts +294 -2
  59. package/src/client/index.tsx +4 -0
  60. package/src/client/outline-model.ts +775 -0
  61. package/src/client/scm/DiffView.tsx +32 -13
  62. package/src/client/scm/HistoryPanel.tsx +38 -1
  63. package/src/client/scm/actions.ts +55 -2
  64. package/src/client/store.tsx +446 -21
  65. package/src/client/vsc/blame.ts +147 -0
  66. package/src/client/vsc/change-marks.ts +21 -0
  67. package/src/client/vsc/kit.tsx +3 -11
  68. package/src/client/vsc/preview-document.tsx +326 -0
  69. package/src/client/vsc/preview-model.ts +216 -0
  70. package/src/client/vsc/preview-services.ts +118 -0
  71. package/src/client/vsc/vsc.css +965 -39
  72. package/src/git-ops.ts +34 -0
  73. package/src/processes.ts +177 -0
  74. package/src/protocol.ts +138 -1
  75. package/src/routes.ts +138 -9
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"); with `dsh-better-sidebar` installed
10
- there is an extra standalone "Remote Workspace" tab, otherwise it falls back to a native right-Sidebar "Remote Workspace"
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` and the `0.2.1-rc.2` generation needs `0.9.3`. `--profile web` selects which profile to install into —
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
 
@@ -104,11 +94,11 @@ extra configuration is needed.
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
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**): 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); clicking a file opens it in the remote editor with **line shading plus character-level inline diff**, `n/N ↑↓` jumps between change points, and hovering a changed line offers **Undo this change** (remote `git apply -R`). 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) |
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, Markdown/HTML preview (source vs preview); 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** |
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 |
@@ -129,7 +119,7 @@ extra configuration is needed.
129
119
  | 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) |
130
120
  | Remote terminal | ssh2 PTY + WebSocket, xterm rendering (copy-paste/theme-follow/reconnect-on-refresh; **the selection highlight is a visible blue in the light theme** — `#add6ff` light / `#264f78` dark, plus unfocused variants — no more white-on-white); `Shift+Insert` / `Ctrl+Shift+V` **paste exactly once** (xterm calls the key hook for keyup too, so the gesture used to run twice); **a reattach only takes over, it does not resize** (a page reload no longer shrinks a running shell to 80×24), and no resize frame is sent when rows/columns did not change; an output backlog applies real backpressure to the far end, and output within a short window is **coalesced into one frame** (flushed immediately past 64 KiB, and always before the exit frame) **Ctrl+click a path** reveals its folder in the directory tree (absolute / `~/` / relative tokens containing `/`, validated by stat in cwd → workspace-root → home order); a **"snippets" panel** next to the title stores name+command pairs, a click pastes into the command line **without Enter**, `Ctrl+B` adds one, and rows can be edited, deleted and dragged (Alt+Up/Down too), persisted in localStorage; echo after idle is flushed immediately, the client output path does not wait on xterm render callbacks, a closing socket releases its unsettled backpressure bytes, and the marks are 2 MiB / 512 KiB. so a busy command (`cat` of a large log, `dmesg`) costs far fewer frames and JSON parses; the terminal dials **its own SSH connection** per host (+1 connection, shared one as fallback) so bulk SFTP/git traffic no longer queues ahead of terminal I/O; **frames are capped at 1 MiB**, and pastes past 64 Ki characters are chunked on code points by the client instead of dropping the connection |
131
121
  | Concurrent channels | At most **6** remote channels per host at a time (no longer colliding with the far end's sshd `MaxSessions`); the 7th queues for up to **30 seconds** and then fails with `remote host <alias> is busy` instead of piling on connections |
132
- | Monitor | A sidebar **"Monitor"** page samples one host or every host **only while the panel and the page are visible**, at the configured refresh interval (5 s by default; 5/10/30 s in its settings): CPU, memory, disk, load, network rate, temperature and uptime, with 60-point history curves plus manual refresh and pause. The scope is "current host / a named host / all hosts" and survives a reload. The **first sample reports CPU% and the network rate as unknown** (both are deltas and need a second sample), and a non-Linux host shows unknown instead of 0. The Host caches one sample per alias for 3 seconds and joins concurrent requests, so one sample uses one exec channel and never the port-forward budget. Samples live in memory only — nothing is written to disk |
122
+ | Monitor | A sidebar **"Monitor"** page samples one host or every host **only while the panel and the page are visible**, at the configured refresh interval (5 s by default; 5/10/30 s in its settings): CPU, memory, disk, load, network rate, temperature and uptime, with 60-point history curves plus manual refresh and pause. The scope is "current host / a named host / all hosts" and survives a reload. The **first sample reports CPU% and the network rate as unknown** (both are deltas and need a second sample), and a non-Linux host shows unknown instead of 0. The Host caches one sample per alias for 3 seconds and joins concurrent requests, so one sample uses one exec channel and never the port-forward budget. Samples live in memory only — nothing is written to disk. A **process section** (single host, collapsed by default, sampled only while expanded) shows a `ps` snapshot sorted by CPU/memory/PID, filterable by command/user/PID, with a confirmed **End** action per row; a PID must come from the latest snapshot, and a host without a usable `ps` says it cannot enumerate. |
133
123
  | Timeouts and process cleanup | Ordinary git commands default to 300 s (configurable); the **network verbs (fetch/pull/push/sync) default to 20 minutes with a 30-minute ceiling**. exec runs in its own session (`setsid --wait`); on timeout OR cancel it sends TERM and **escalates to KILL after 3 seconds**, reaping the child processes with it; a host without `setsid --wait` is detected by a one-shot probe and falls back to the old behaviour, with a host-log line saying the timed-out remote command may still be running; **directory / multi-selection archive downloads carry a 600 s server-side budget** (remote `timeout -k 3 600`; a host without GNU `timeout` falls back to the unbudgeted old behaviour) and fail with the real reason when it expires |
134
124
  | Git graph | Remote repo status + branches + SVG commit graph + commit details/contents/diff pane (exec + frontend parsing, zero Host additions) |
135
125
  | 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 …) |
@@ -233,7 +223,7 @@ dsh_remote_vs/
233
223
  ├── vendor/dsh-remote-helpers/ # helper seeds (shipped, seeded into cache at startup, see below)
234
224
  ├── docs/ # local-only working docs (only docs/media/ screenshots ship)
235
225
  │ ├── 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.26.0)
226
+ │ ├── VERSION-HISTORY.md # local-only: per-release change log (0.7.1 → 0.28.0)
237
227
  │ └── GATES.md # local-only: local gate inventory and measured assertion counts
238
228
  ├── locale/ # bilingual plugin metadata
239
229
  └── lib/ # build output (**must be committed**; only .map is ignored; restart after link install)
@@ -317,13 +307,6 @@ when the seat changes.
317
307
  frames and JSON parses for a busy command, always flushed before the exit frame); a session is kept for **10 minutes** after its last socket goes away before the remote shell is
318
308
  closed (it used to be kept forever, so closing the browser left the shell holding an sshd session slot).
319
309
  - **Known limits (stated honestly)**:
320
- - **Occasional terminal hitches have three known sources**: (1) the PTY shares ONE SSH connection with SFTP / git / helper traffic — **now fixed for the PTY: it dials its own connection per host** (falling back to the shared one if the server refuses another), so bulk transfer no longer queues ahead of the terminal;
321
- (2) while output is streaming, the echo of what you type is ordered after the output already produced
322
- (that is every terminal; `Ctrl+C` still works because the input path is not blocked by output
323
- backpressure); (3) heavy agent work blocking the host's event loop slows both directions. This round
324
- fixed what is ours to fix: the client no longer waits on xterm's render callback, the host does not hold
325
- a post-idle echo in the coalescing window, the backpressure marks are 2 MiB / 512 KiB, and a closing
326
- socket releases its unsettled bytes. **The host-side part needs a `dsh web` restart.**
327
310
  - There is **no public API to select the "remote editor" view**; the plugin can only click the shell's
328
311
  own tab by its label and toasts a hint when that fails (`revealEditor()`).
329
312
  - Untracked directories arrive as a **single `dir/` row**; clicking it **expands** the files inside
@@ -358,16 +341,72 @@ with zero change events).
358
341
  right with the composer card; click the header to collapse/expand, `⟳` forces an immediate rescan. With no
359
342
  changes it says "this session has not changed any file yet"; when it cannot compute, it states the
360
343
  **specific reason** (see the limits below) instead of handing you an empty list to guess about.
344
+ - **Scope switch: session total / this turn** (the default is still the session total; nothing changes unless
345
+ you switch). The two small buttons in the header appear only when the host really published a completed
346
+ turn (not before the first turn ends, and not against an older host). In "This turn" the title becomes
347
+ **"Turn #N · HH:MM"** and both the rows and `+a −b` describe the **most recent completed turn** only — a file
348
+ some earlier turn changed but this turn did not is absent. The choice is remembered per browser
349
+ (`rvs.changes.scope`). N is a **completed** turn number: the turn the session is running right now is never
350
+ folded in early.
351
+ - **Opening a row in turn mode** uses the same marks/undo machinery as the cumulative view, but the baseline
352
+ is **what the file looked like when the previous turn closed**: `n/N ↑↓`, the hover "Undo this change"
353
+ (reverse-applies that turn's hunk) and the row's "Revert all changes in this file" (the turn's whole-file
354
+ reverse patch) all undo **this turn's** work only. If the file was modified after the turn closed, the host
355
+ answers "stale" and the panel **says so and switches back to the session-total view** before fetching that
356
+ comparison — it never paints line numbers from a comparison that no longer describes the file. Turn mode
357
+ has no "undo the new file (delete it)" entry (that needs git's index copy, and the turn cache keeps
358
+ patches only); the row menu says to delete it from the session-total view or the Source Control panel.
359
+ - **A successful revert hides the row from the turn list**: the turn view is the delta FROZEN when the
360
+ turn closed, and the host never rewrites it — so "reverted, but the row is still there" is finished by
361
+ the **client presentation layer**. After a single-change revert (that file had exactly one change this
362
+ turn) or the row's "Revert all changes in this file", the row is filtered out and the file count /
363
+ `+a −b` are recomputed from the **visible** rows; the panel says how many were hidden, and when nothing
364
+ is left — and the view is COMPLETE — it says "all changes from this turn have been reverted" (not
365
+ "this turn changed no file"). A partial view or a still-pending scan keeps the "N hidden" sentence:
366
+ the panel does not assert what it cannot prove.
367
+ Records are keyed by `(session, turn, path)` in browser storage (`rvs.changes.reverted.<session>`) and
368
+ survive a page reload. A PARTIAL undo of a multi-hunk file does **not** hide it (the remaining changes
369
+ must stay visible), a failed revert never hides anything, and a browser with storage disabled simply
370
+ does not remember (the list stays as before) — no remote write is ever affected, and the host's frozen
371
+ accounting is unchanged.
361
372
  - **Clicking a file** opens it in the remote editor with change marks: added lines get a **green line
362
373
  background**, deleted characters are drawn as an **inline struck-through chip** (a deleted character does
363
374
  not exist in the new file, so it can only be an inserted widget), and the left gutter carries a change bar.
364
375
  - **Jumping between change points**: the floating `n/N ↑↓` control at the editor's top-right
365
376
  (`Alt+Shift+Cmd/Ctrl+↓/↑`) cycles through them; typing in the editor invalidates the marks and says
366
- "position may be out of date".
367
- - **Undo this change**: hover a changed line and click → remote `git apply -R`. When the context no longer
377
+ "position may be out of date". **The panel's 3-second rescan invalidates open tabs too** (the session or
378
+ the remote side changed the same file again, or the file left the list): the same "positions stale" badge
379
+ appears and clicking that row recomputes against what is there now — an open tab never keeps painting
380
+ marks nobody knows are out of date.
381
+ - **View diff (read-only)**: right-click a row → "View diff" opens the file as a **side-by-side** diff whose
382
+ data comes from the **session ledger** (baseline = session start), not from `git diff` (that compares
383
+ index/HEAD and may include uncommitted edits that predate the session). The before side is reconstructed
384
+ exactly from the served hunks plus the current file, reusing the existing side-by-side renderer. The page
385
+ is read-only: no editing, no per-hunk stage/revert, and reloading still goes through the ledger. Binary and
386
+ oversized rows keep the entry **visible but disabled**, with the reason in its hint (opening it could only
387
+ show an empty or fake view); when the content was withheld at the byte cap — or the "after" read hit the
388
+ 8 MiB cap — the page is **not opened** and says the comparison is incomplete (the two panes would be
389
+ misaligned).
390
+ - **The five outcomes of opening a row are stated**: a diff withheld at the byte cap says "the comparison is
391
+ incomplete (it may count the whole file as changed), so nothing is marked and nothing can be reverted"; an
392
+ oversized file says "no line-level comparison, no undo — open the file to read it"; binary files, files the
393
+ remote cannot read, and files whose change is already gone each get their own sentence instead of a silent
394
+ empty list.
395
+ - **Row-end `⋯` menu**: hovering a changed line puts a small `⋯` at the row's right end (one row tall, its
396
+ vertical centre locked to that row, so the pointer reaches it horizontally without entering another row);
397
+ clicking it opens "Undo this change" and "Keep this change".
398
+ - **Undo this change**: pick undo in that menu → remote `git apply -R`. When the context no longer
368
399
  matches, the far end refuses outright (not one byte of the file changes); a tab with unsaved edits is
369
400
  refused first, so a remote patch can never overwrite your buffer; on success the caret stays where it was
370
- and the marks are re-read (they do not simply vanish because something was undone).
401
+ and the marks are re-read (they do not simply vanish because something was undone). **Failures are
402
+ classified**: surroundings moved / the file is gone from the repository / permission denied / the
403
+ repository has a `dubious ownership` problem (set `safe.directory` or fix ownership) / the patch is corrupt
404
+ — each with the sentence that tells you what to do, plus git's raw wording.
405
+ - **Keep this change (per block, local only)**: the same menu carries a toggle, "Keep this change" —
406
+ "I read this block and agree with it". It **writes nothing, sends nothing, and does not touch the diff
407
+ data**; the state lives in browser storage per session, keyed by a stable block identity (file + the four
408
+ hunk-header numbers), so it survives a page reload. It is a **second level** and does **not** sync with the
409
+ row's ✓: a block note is "I looked at this piece", the ✓ stays a file-level manual mark. No bulk keep.
371
410
  - **Follow the session's workspace**: the sidebar, the editor's dropdown and the file tree all follow the
372
411
  workspace the **current session** lives in; after a manual switch they are not pulled back within that
373
412
  session, and a new session follows again. The capability lives in the store, so it works even when **the
@@ -384,17 +423,62 @@ with zero change events).
384
423
  usually catch up within a second or two); **new files** created in a shell are found by a **slow scan**
385
424
  whose single-run budget is up to **3 minutes**, re-run at a self-tuning interval (at least 5 seconds,
386
425
  naturally longer on a huge checkout). `⟳` forces an immediate rescan.
426
+ - **How fast a manual edit shows up**: with no turn event (you changed a file from a terminal or an editor)
427
+ the panel's self-heal rescans on a window derived from the **last `git status` cost**
428
+ (`clamp(scan × 4, 5s, 30s)`): a small repository (100ms class) → **5 seconds**; an AOSP-class tree
429
+ (1.7s measured) → **6.8 seconds**; the **30-second ceiling only applies once a scan costs ≥ 7.5s**.
430
+ The cost is therefore calculable: on such a tree, with the 3-second poll, roughly **one `git status`
431
+ every ~9 seconds** — about **3×** the old 30-second window (the price of keeping the 4× design, paid
432
+ for surfacing manual edits in ~7s instead of 30s).
433
+ - **Coming back to the page** (tab shown again, or the window regaining focus) asks the host for **one
434
+ immediate rescan**, and it is NOT the same thing as `⟳`: only tracked files are re-scanned
435
+ (`trackedOnly`), the slow walk's cadence is untouched and a written-off `git ls-files --others` is NOT
436
+ re-armed (11s on the reference tree, minutes cold — focus can happen every few seconds). `⟳` is the one
437
+ that re-runs everything. Both are debounced by 5 seconds, skipped while the page is hidden, and skipped
438
+ when a request is already in flight (in-flight for over 60 seconds counts as a failed request, so one
439
+ stuck fetch cannot disable the refresh forever).
440
+ - **Note**: `⟳` and "coming back" only SCHEDULE the rescan — the response still carries the previous
441
+ summary, and the fresh numbers arrive on the next poll (≤ 3 seconds), not with the refresh call itself.
387
442
  - A non-git workspace, or one holding several repositories with no repository directory set, shows the exact
388
443
  reason (`no git repository at the workspace root, and N candidates below it — set the repository directory
389
444
  in Source Control`) rather than an empty list.
390
445
  - Binary and oversized files are marked "binary / too large" on the row and get no character-level diff;
391
446
  **non-UTF-8 text (GBK and friends) is treated as binary** (no counts, no undo) so it cannot produce
392
447
  garbage numbers and an undo that always fails.
448
+ - **Oversized files get no line-level comparison**: the list pins their `+a −b` to `0/0` (not real counts),
449
+ so opening one only opens the file with the sentence "too large, no line-level comparison" — no marks and
450
+ no undo, which also keeps `0/0` from being compared against real line counts and mislabelling the tab
451
+ "positions stale".
452
+ - **The turn view covers the most recent completed turn only** (no per-turn history): at each turn close the
453
+ host records every listed file's text and diffs the next close against it, so the turn the session is
454
+ running right now is never mixed in.
455
+ - **The turn's patches and hunk text have a budget (4 MiB by default)**: it counts whole-file reverse
456
+ patches plus hunk lines only; both full texts and the previous-close snapshot are bounded separately by
457
+ the scan caps (resident cost is roughly 4 MiB + those texts, worst case ≈ 20 MiB per active session).
458
+ Over budget, that session's turn view keeps **the real counts only** — no marks, no undo, the reason
459
+ stated, and the host **stops computing turn views for the rest of the session**. Continuing would
460
+ compare the next turn against a snapshot that was never advanced and attribute old work to it. The
461
+ session-total view is unaffected.
462
+ - **New files are found by the slow scan**: a turn close first uses whatever scan result is cached and the
463
+ list says "still waiting for the new-file scan"; after the slow walk (`git ls-files --others`) lands the
464
+ **same turn is recomputed** and that marker clears. When the walk is written off, the list was cut by the
465
+ file cap, or a PREVIOUS turn never finished its correction, the turn view stays marked partial — and a
466
+ path whose previous side was withheld (binary / too large) is dropped rather than reported as a
467
+ whole-file creation.
468
+ - Binary/oversized files keep "binary / too large" in the turn view too, with no line-level comparison; the
469
+ turn cache does not keep their bytes.
393
470
  - When the untracked scan gives up (e.g. the far end refuses), the panel **states the reason** and keeps the
394
471
  refresh entry point instead of silently listing fewer rows.
395
472
  - Undo carries **provenance** (session / binding / repository directory), so a patch can never be applied to
396
473
  another host after switching sessions or bindings; a file this session created whole is not offered for
397
474
  undo (a reverse patch must never delete an untracked file).
475
+ - Binary/oversized rows show "View diff" **disabled with its reason**; content withheld at the byte cap (or
476
+ an "after" read over 8 MiB) opens no diff at all, because those hunks are a whole-file fake comparison
477
+ that could never be reverted.
478
+ - When a file is back at its session baseline, opening the row says "no diff to show right now" instead of
479
+ claiming the remote cannot read it.
480
+ - "Positions stale" is only a **notice**, never an automatic re-read: that happens when you click the row (or
481
+ after a successful save).
398
482
 
399
483
  ## P2 transparent remote execution (Windows native)
400
484
 
@@ -513,7 +597,7 @@ tsc, to the bundler and to jsdom — this fixture is the only place they reprodu
513
597
  > exactly why "57 call sites" and "55 checks run" differ by 2).
514
598
 
515
599
  The live-host regression is still `npx tsc -p tsconfig.scratch.json && node .spike/build/.spike/p2-router.js`.
516
- Before touching anything for a new DSH release, read the local-only `docs/MAINTENANCE.md` (§2 coupling points, §3 checklist) — it is gitignored, so a clone will not have it. After any change (host half or client half) the mandatory steps are: `pnpm run build` → `node scripts/verify-lib.mjs` (entries present, committed and loadable) → restart `dsh web`; and before committing, run every local gate under `scripts/` (`node scripts/check-*.mjs`, 73 of them at the time of writing, plus `verify-lib.mjs` and the shared TS loader `_ts-hook.mjs`).
600
+ Before touching anything for a new DSH release, read the local-only `docs/MAINTENANCE.md` (§2 coupling points, §3 checklist) — it is gitignored, so a clone will not have it. After any change (host half or client half) the mandatory steps are: `pnpm run build` → `node scripts/verify-lib.mjs` (entries present, committed and loadable) → restart `dsh web`; and before committing, run every local gate under `scripts/` (`node scripts/check-*.mjs`, 77 of them at the time of writing, plus `verify-lib.mjs` and the shared TS loader `_ts-hook.mjs`).
517
601
 
518
602
  ## License
519
603
 
package/README.md CHANGED
@@ -6,8 +6,7 @@
6
6
 
7
7
  Host 进程内的 SSH 主机管理 + helper 推送流水线 + **VS Code 式远端工作台**
8
8
  (资源管理器 / 搜索 / 源代码管理 / 提交图与提交详情面板 / 多标签编辑器 / 悬浮编辑器 / 并排 Diff / 多终端 / 端口转发)。
9
- 主机配在 DSH 设置里(“远程主机”项);装了 `dsh-better-sidebar` 时另有
10
- 独立“远程工作台”tab,没装则退到原生右侧栏“远程工作台”页(同内容,引导页自助开,per-session 实例)。
9
+ 主机配在 DSH 设置里(“远程主机”项);右侧栏“远程工作台”页。
11
10
  **侧栏「远程工作台」的编辑器是默认面**:打开文件即整栏切到编辑器,关闭最后一个文件自动回到目录,
12
11
  外观对齐本地侧边栏插件(VS Code 不透明代码背景、标签条、信息栏、图片预览、查找/换行/字号)。
13
12
  会话视图槽里的**远程编辑器**标签是可选的全宽面 —— 信息栏的展开按钮切过去、收回按钮切回来,两个面共用同一份缓冲区。
@@ -15,15 +14,15 @@ P2 起原生工具在远端工作区里透明跑远端(见下)。
15
14
 
16
15
  ```text
17
16
  ┌─ 本机 DSH Host ─────────────────────────────────┐
18
- │ 本插件 Host 半 │ Client 半(浏览器) │
19
- │ 主机/密钥/推送/路由 │ 设置两节 + 原生入口接管 │
17
+ │ 本插件 Host 半 │ Client 半(浏览器) │
18
+ │ 主机/密钥/推送/路由 │ 设置两节 + 原生入口接管 │
20
19
  │ /api/dsh-remote/* │ 工作台(右侧栏 + 会话视图)│
21
20
  └──────────────────────┴──────────────────────────┘
22
21
  │ ssh2(文件/进程/终端)+ helper RPC(远端 fs)
23
22
  ▼
24
23
  ┌─ 远端 Linux ─────────────────────────────────┐
25
24
  │ ~/.dsh-helpers/<ver>/<arch>/dsh-ssh-helper │
26
- │ 用户指定的远端工作目录 │
25
+ │ 用户指定的远端工作目录 │
27
26
  └──────────────────────────────────────────────┘
28
27
  ```
29
28
 
@@ -36,8 +35,8 @@ dsh plugin --profile web add dsh-remote-vs
36
35
  (从 npm 装,推荐;也可以直接跟仓库装:`dsh plugin --profile web add github:xiray-xia/dsh-remote-vs`。)
37
36
 
38
37
  **需要 DSH `0.2.2-rc.5` 及以上、`0.3.0` 以下**(`engines.dsh` 门到底;已按 rc.5 适配并通过类型检查与本地全量门禁)。
39
- Host 仍是 `0.2.2-rc.4` 的请用插件 `0.23.0`;`0.2.2-rc.2` / `0.2.2-rc.3` 的请用插件 `0.22.0`;`0.2.2-alpha.3` / `0.2.2-rc.1` 的请用 `0.20.1`;`0.2.2-alpha.2` 一代请用 `0.17.0`;`0.2.1-rc.2` 一代请用 `0.9.3`。
40
- `--profile web` 指明装进哪个 profile —— 本插件是 Web 插件,
38
+ Host 仍是 `0.2.2-rc.4` 的请用插件 `0.23.0`;`0.2.2-rc.2` / `0.2.2-rc.3` 的请用插件 `0.22.0`;`0.2.2-alpha.3` / `0.2.2-rc.1` 的请用 `0.20.1`;`0.2.2-alpha.2` 一代请用 `0.17.0`。
39
+ `--profile web` 指明装进哪个 profile,
41
40
  要装进 Web GUI 所用的那个(`web` 是常见命名,以你自己的 profile 名为准);
42
41
  桌面端用的是保留 profile `desktop`,见下面「桌面端」。
43
42
 
@@ -45,12 +44,6 @@ Host 仍是 `0.2.2-rc.4` 的请用插件 `0.23.0`;`0.2.2-rc.2` / `0.2.2-rc.3`
45
44
  > 首次连接该主机时自动重推新 helper(本机缓存里还留有旧版构建即可自动判定;缓存被清理过时,在设置页点一次
46
45
  > 「推送」即可),每台主机首次会多一次约 47 MB 的上传。旧 helper 目录会保留,回滚就是推回旧版本。
47
46
 
48
- **这一条命令就够了,不需要放行任何构建脚本**:包本身没有 `prepare`/`postinstall`,依赖树里也没有任何
49
- 带安装脚本的包(`ssh2` 是**打进产物**的,不是依赖);走仓库安装时还带着构建好的 `lib/`。
50
- 以前需要「在 profile 的 `pnpm-workspace.yaml` 里放行构建脚本后重跑」,那是 pnpm 12 对
51
- 「带安装脚本的依赖」的硬策略门(`ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED` / `ERR_PNPM_IGNORED_BUILDS`),
52
- 依赖侧无法豁免,只能从树里消掉。装完重启 `dsh web`,打开设置 → 远程主机开配。
53
-
54
47
  ### 桌面端(DSH Desktop)
55
48
 
56
49
  桌面端是 Electron 壳 + 完整的 dsh Web 应用,但它跑在**独立的保留 profile `desktop`**
@@ -86,11 +79,11 @@ Host 转发(终端按 `__DSH_TRANSPORT__.streamBaseUrl` 解析地址),无
86
79
  | 搜索 | 两档:**文件名**(远端 `find`)与**内容**(远端 `grep`)。内容档带范围目录、`Aa`(大小写)/`ab_`(全字)/`.*`(正则)、结果按文件分组、命中高亮,点条目跳到该行;**内容档可中止**(改写或清空查询会终止正在跑的远端 `grep`;老 Host 无流式路由时退化为不可取消的一次性查询),成功但远端给了 stderr 警告时在结果上方提示;文件名档里命中**目录**时在树中定位,而不是当文件打开 |
87
80
  | 连接状态与离线只读 | 顶部栏与编辑器信息栏显示当前工作区的 SSH 连接状态(**连接正常 / 连接异常 / 就绪·按需连接**):断线不再静默——已打开的编辑器标签保留缓存内容并切为**只读**(保存被拦截并说明原因),目录树继续显示已缓存目录、后台刷新静默,未缓存目录显示离线提示;连接恢复后自动刷新目录、Git 状态、**未修改的文件标签和只读 diff 标签**(有未保存改动的标签不动并提示)。错误态不会无限重连:每 30 秒最多自动重试 3 次,之后点状态图标手动重试。断线时「撤销这处改动」和 diff 的 hunk 操作同样被拦截;**单次操作的超时(deadline)不当作链路故障**——chip 保持正常,只有该次操作失败并说明原因;断线且该工作区没有缓存时,SCM 面板直接说明无法读取,而不是停在「加载中」。**不做**跨页面刷新的持久化缓存(远端源码不落盘),这是有意的隐私取舍 |
88
81
  | 源代码管理 | **仓库目录选择器**(工作区里的 git 在子目录时用:浏览远端目录、一键跳到工作区内发现的仓库、手输相对/绝对路径,并逐目录提示会落在哪个仓库);变更/暂存/未跟踪/忽略分桶,**未跟踪目录行可点击展开**,逐文件与**逐 hunk** 暂存/还原、丢弃(带确认)、提交;分支/远程/stash 面板,**分支可重命名**、**远程可改 URL**、非仓库目录可直接**初始化仓库**(均需确认);同步(fetch/pull/push),**推送支持自定义 refspec**(如 Gerrit `HEAD:refs/for/<分支>`;留空 = 普通 `git push`,非空值会记住);fetch/pull/push/sync 有**实时输出面板**(SSE 流式显示 git/远端输出、运行计时、**可取消**(杀掉远端进程组)、完成后可复制完整输出;老 Host 无流式路由时自动回退到一次性结果) |
89
- | 会话改动审阅 | 输入框上方的**可收纳**面板,按**会话**列出改了什么(一行一个文件、文件类型图标、右侧 `+a −b`);头部可**只看未审阅**并**跳到下一个未审阅**(回绕、不自动打 ✓);点文件在远程编辑器里打开并画**整行着色 + 行内字符级差异**,右上角 `n/N ↑↓` 跳改动点,悬浮改动行可**撤销**这处改动(远端 `git apply -R`)。详见下文「会话改动审阅」 |
82
+ | 会话改动审阅 | 输入框上方的**可收纳**面板,按**会话**列出改了什么,可一键切到**本轮**(最近一个已完成轮次,默认仍是会话累计);一行一个文件(文件类型图标 + 右侧 `+a −b`);头部可**只看未审阅**并**跳到下一个未审阅**(回绕、不自动打 ✓);点文件在远程编辑器里打开并画**整行着色 + 行内字符级差异**,右上角 `n/N ↑↓` 跳改动点;悬浮改动行时行尾出现 `⋯` 菜单:**撤销**这处改动(远端 `git apply -R`,失败原因分类说明)或**确认保留**(块级、纯本地、与文件级 ✓ 不联动);行右键**查看差异**打开账本基线的**只读并排 diff**;已打开标签页的标记会随面板轮询被标成「位置已过期」。详见下文「会话改动审阅」 |
90
83
  | 并排 Diff | 左右**严格等分** + 中间 gutter 逐 hunk 按钮 + **顶部横向滚动条**(一行很长也不会破坏对称)+ 行号钉在左侧,**只渲染视口内的行**(3000 行文件从 9000 个行容器降到约 174 个,滚动范围与整篇渲染完全一致);可切「变更前 / 变更后」,变更后可编辑并保存(保存写回工作树文件;超过 8MiB 的差异只读,避免把截断内容写回去) |
91
84
  | 提交图 | SVG 分支/合并图;点选提交后,下方**可调高度 / 可全屏**的提交详情面板给出三个视图:**提交详情**(标题、作者、时间、完整哈希+复制、父提交、ref、正文、检出)、**内容**(改动文件按目录分组、可折叠、可过滤,单击看差异、右键或行尾按钮在编辑器中打开)、**差异**(默认只展开前约 1500 行、其余文件折叠;双行号、`+/−` 计数、自动换行、上一/下一个文件、复制文件补丁或整个补丁)。合并提交按**首父**展示(git 对 merge 默认不给文件列表) |
92
85
  | AI 审查 | 单文件 diff 与**整个提交**都能一键把审查请求追加到对话草稿(**只预填,不自动发送**,发送前可自行修改):≤32 KiB 内嵌完整 diff;更大或被 2 MB 静默截断时改为「文件/提交信息 + 变更块头 + 自行 `git show`」的摘要式请求(2 MB diff 约几十万 token,硬塞没有意义);未跟踪/二进制文件只给路径让 AI 自行读取。入口:并排 diff 工具栏、提交详情「差异」工具栏;当前会话不在该远端工作区、或宿主没有可用的对话输入通道时按钮禁用并写明原因 |
93
- | 多标签编辑器 | 打开/保存/重载、脏标记、多文件标签并存;**保存是原子的**(侧文件 + 重命名,写穿符号链接并保留权限位);**保存前校验远端基线**:文件在打开之后被别人(Agent 的透明路由、终端、另一个编辑器)改过时保存被拒绝,并给出「覆盖 / 载入远端版本 / 查看差异」,不再静默覆盖;图片预览、Markdown/HTML 预览(源码/预览切换);**Ctrl+G 转到行**、**Ctrl+D 选中下一个相同文本**;关闭标签、重载、切工作区遇到未保存改动都会**先确认**(切工作区会清空全部标签,所以先问);`Ctrl+S` 全局生效,焦点不在编辑器里也能保存;**刷新页面后自动恢复上次打开的文件标签**(按工作区记,最多 12 个;只存路径不存内容,打不开的会跳过并提示数量;光标与滚动位置不恢复) |
86
+ | 多标签编辑器 | 打开/保存/重载、脏标记、多文件标签并存;**保存是原子的**(侧文件 + 重命名,写穿符号链接并保留权限位);**保存前校验远端基线**:文件在打开之后被别人(Agent 的透明路由、终端、另一个编辑器)改过时保存被拒绝,并给出「覆盖 / 载入远端版本 / 查看差异」,不再静默覆盖;图片预览、**文档预览**(Markdown/HTML、SVG、CSV/TSV 表格、PDF、Office 经宿主 officeKit 转 PDF(失败回退远端 LibreOffice)、音视频;文本源支持源码/预览切换);**Ctrl+G 转到行**、**Ctrl+D 选中下一个相同文本**;关闭标签、重载、切工作区遇到未保存改动都会**先确认**(切工作区会清空全部标签,所以先问);`Ctrl+S` 全局生效,焦点不在编辑器里也能保存;**刷新页面后自动恢复上次打开的文件标签**(按工作区记,最多 12 个;只存路径不存内容,打不开的会跳过并提示数量;光标与滚动位置不恢复);**行内 blame**(默认关闭,信息栏 `B` 开关打开;作者 + 相对时间;点击行号旁格跳到该提交详情)与当前文件的**提交历史**(`git log --follow`,点条目看该版本的 diff);**符号大纲**(`Ctrl+Shift+O`,按语言/缩进生成类、方法、字段列表,点击跳转) |
94
87
  | 悬浮编辑器 | 三个入口:文件树 / 搜索结果 / 源代码管理右键「在悬浮编辑器中打开」,以及**双击会话视图的「远程编辑器」标签**把当前编辑器整体浮出(同一套标签、预览、Diff、查找、改动标记,不是另写一个编辑器)。窗口可拖标题栏移动、拖八个边角缩放、最大化/还原、双击标题栏切换最大化;**最小化成一个可拖动的悬浮球**(球上有未保存脏点,点一下或按 Enter 恢复,拖动可换位置);`Ctrl+滚轮` 缩放编辑器字号;位置、大小、字号和球的位置跨刷新记住 |
95
88
  | 语法高亮 | VS Code **Dark+ / Light+** 配色;覆盖 java/aidl/smali、c/c++、go、rust、js/ts、json、py、yaml、xml、html/css、md、sh、properties/rc/toml、diff 等;**兜底着色器**在语法包没命中时自动接管,不会出现整篇无色。诚实说明:kotlin / gradle / smali 用 Java 语法着色(没有专用语法包),效果是关键字/字符串/注释正确、专有语法不细分 |
96
89
  | 查找 | 编辑器内 `Ctrl+F`(`Aa`/`ab_`/`.*`、`3/17` 计数、↑↓、`F3`/`Shift+F3`、`Esc`);**选中文本按 `Ctrl+F` 直接填入**;查找框钉在右上角,滚动不带走;`n/N` 计数随 `F3`、点击和光标移动刷新 |
@@ -111,7 +104,7 @@ Host 转发(终端按 `__DSH_TRANSPORT__.streamBaseUrl` 解析地址),无
111
104
  | 远端文件 | SFTP 浏览 / 读 / 写 / 新建 / 删除 / 改名。边界已加固:0 字节文件不再卡死,每个 SFTP 操作 60s 超时回收通道;**单个目录列表上限 20000 条**(按"目录在前、其余按名"排序后取前 20000,宿主日志说明——协议里没有"已截断"字段,界面上没有标记);**保存走侧文件 + 重命名**(优先服务端 `posix-rename`,不支持时备份-重命名-失败回滚),**写穿符号链接**(链接本身保留)并**尽力保留权限位**;SCM 状态解析会反解 git 的 C-quote 路径(凡名字含空格都会被加引号) |
112
105
  | 远端终端 | ssh2 PTY + WebSocket,xterm 渲染(复制粘贴/主题跟随/刷新重连;**亮色主题下的选中高亮是可见的蓝底**(亮 `#add6ff` / 暗 `#264f78` + 失焦变体),不再是白底白字);`Shift+Insert` / `Ctrl+Shift+V` **只粘贴一次**(xterm 的按键钩子对 keyup 也会回调,此前同一个手势被处理两遍);**重新挂接只接管、不改尺寸**(刷新页面不会把运行中的 shell 缩成 80×24),行列没变化时不再发 resize 帧;**Ctrl+点击路径**在目录树里定位到该目录(绝对路径/`~/`/带 `/` 的相对路径,先按 shell 上报的 cwd、再按工作区根、最后按 home 逐个 stat 验证;路径不在任何工作区内会明确提示);**「常用指令」**面板(标题旁按钮)保存「指令名 + 指令内容」,点一条只粘贴到命令行**不发送**,`Ctrl+B` 快速新增,支持编辑/删除/拖拽排序(Alt+↑↓ 亦可),存在浏览器 localStorage;输入输出方面:**echo 走即时通道**(空闲后的第一段输出不等合并窗口)、一个短窗口内的输出**合并成一帧**(缓冲超过 64 KiB 立即刷、退出帧前必刷)、客户端输出**不依赖 xterm 的渲染回调**(渲染被节流时不再堵住后续输出)、socket 断开时释放未结算的背压字节(否则通道会被永久暂停),背压高水位 2 MiB / 低水位 512 KiB(在"内存有界"与"echo 延迟有界"之间取更偏交互的一侧);**终端独占一条 SSH 连接**(每主机 +1 条,握手失败回落共享连接),SFTP/git 的大流量不再排在终端输入输出前面;**单帧上限 1 MiB**,超过 64 Ki 字符的粘贴在客户端按码点分块发送,不再撑断连接 |
113
106
  | 并发通道 | 每主机同时最多 **6 条**远端通道(不再撞远端 sshd 的 `MaxSessions`);第 7 个排队最多等 **30 秒**,超时明确报 `remote host <alias> is busy`,而不是无限堆连接 |
114
- | 运行监控 | 侧栏「监控」页:**仅在面板可见且页面在前台时**按刷新设置(默认 5 秒,可改 5/10/30 秒)采样一台/全部主机的 CPU、内存、磁盘、负载、网络速率、温度与运行时长,带 60 点历史曲线、手动刷新与暂停;范围可选「当前主机 / 指定主机 / 全部主机」并跨刷新记住。**首帧 CPU% 与网络速率显示「未知」**(差分需要第二帧),Linux 之外的平台如实显示「未知」而不是 0;Host 侧按 alias 缓存 3 秒并合并并发请求,一次采样只占一条执行通道、不占端口转发预算;样本只在内存,不落盘 |
107
+ | 运行监控 | 侧栏「监控」页:**仅在面板可见且页面在前台时**按刷新设置(默认 5 秒,可改 5/10/30 秒)采样一台/全部主机的 CPU、内存、磁盘、负载、网络速率、温度与运行时长,带 60 点历史曲线、手动刷新与暂停;范围可选「当前主机 / 指定主机 / 全部主机」并跨刷新记住。**首帧 CPU% 与网络速率显示「未知」**(差分需要第二帧),Linux 之外的平台如实显示「未知」而不是 0;Host 侧按 alias 缓存 3 秒并合并并发请求,一次采样只占一条执行通道、不占端口转发预算;样本只在内存,不落盘。**进程分区**(单主机、默认折叠、展开才采样):`ps` 快照按 CPU/内存/PID 排序,可按命令/用户/PID 过滤,行尾「结束」先确认;PID 必须来自最近快照,`ps` 不可用时明确显示无法枚举 |
115
108
  | 超时与进程清理 | 普通 git 命令默认 300s(设置可调);**网络动词(fetch/pull/push/sync)默认 20 分钟、上限 30 分钟**。exec 跑在独立会话里(`setsid --wait`),超时/取消都先发 TERM、**3 秒后升级 KILL**,连同子进程一起收掉;远端没有 `setsid --wait` 时探测一次即知,退回旧行为并在宿主日志里写明"超时可能没停掉远端命令";**目录/多选归档下载有 600 秒服务端预算**(远端 `timeout -k 3 600`;远端没有 GNU `timeout` 时退回无预算的旧行为),超时以真实原因失败 |
116
109
  | Git 图谱 | 远端仓库状态 + 分支 + SVG 提交图 + 提交详情/内容/差异面板(exec + 前端解析,零 Host 增量)|
117
110
  | 导入 | 从 `~/.ssh/config`、从现有 `dsh-ssh.json` 一键导入(只读一次,不耦合);`Host a b` 这类多模式条目会逐个展开,`Include` 如实报告为未展开,被跳过的主机会给出可操作原因(缺 User / 缺 IdentityFile / 端口非法等)|
@@ -215,7 +208,7 @@ dsh_remote_vs/
215
208
  ├── vendor/dsh-remote-helpers/ # helper 种子(随包发布,启动铺缓存,见下)
216
209
  ├── docs/ # 本地工作文档(不推送 GitHub;只有 docs/media/ 的截图随仓库公开)
217
210
  │ ├── MAINTENANCE.md # 本地私有(.gitignore,不入库):升级影响面/检查清单/踩坑/发布流程
218
- │ ├── VERSION-HISTORY.md # 本地私有:逐版本变更纪要(0.7.1 → 0.26.0)
211
+ │ ├── VERSION-HISTORY.md # 本地私有:逐版本变更纪要(0.7.1 → 0.28.0)
219
212
  │ └── GATES.md # 本地私有:本地门禁清单与实跑条数
220
213
  ├── locale/ # 插件元信息双语
221
214
  └── lib/ # 构建产物(**必须入库**,只有 .map 忽略;link 安装后重启即生效)
@@ -281,10 +274,6 @@ dsh_remote_vs/
281
274
  socket 全断开后
282
275
  会话保留 **10 分钟**,超时才关闭远端 shell(以前是永不回收,关掉浏览器后远端 shell 一直占着 sshd 会话槽)。
283
276
  - **已知边界(诚实说明)**:
284
- - **终端的偶发卡顿有三个已知来源**:① ~~同一条 SSH 连接被 SFTP/git/helper 大流量占满~~ —— 已改为**PTY 独占一条 SSH 连接**(每主机一条;被拒绝时回落到共享连接),SFTP/git 的大流量不再排在终端前面;② 正在刷屏时,输入的回显必须排在已产生的输出
285
- 之后(所有终端都如此,`Ctrl+C` 仍有效——输入路径不受输出背压影响);③ 宿主事件循环被 agent 的
286
- 重活占住时,终端的收发会一起变慢。本轮已把可控部分修掉:客户端不再等渲染回调、宿主 echo 不等
287
- 合并窗口、背压水位降到 2 MiB/512 KiB、socket 断开释放未结算字节。**宿主侧改动需重启 `dsh web`**。
288
277
  - 切到「远程编辑器」标签**没有公开 API**,插件只能按标签文字点击外壳自己的 tab,失败时给 toast
289
278
  提示手动切(`revealEditor()`);
290
279
  - 未跟踪目录在状态里是**一行**(`dir/`),点它**展开**该目录里的文件(只发一条限定路径的
@@ -317,13 +306,52 @@ dsh_remote_vs/
317
306
  - **面板**:一行一个文件(文件类型图标 + 相对路径 + 右侧 `+a −b`),宽度与输入卡**左右对齐**;
318
307
  点标题栏折叠/展开,`⟳` 强制立即重扫。没有改动时显示「本会话还没有改动文件。」;统计不出来时显示
319
308
  **具体原因**(见下面的边界),不会丢一个空列表让人猜。
309
+ - **作用域切换:会话累计 / 本轮**(默认仍是会话累计,行为不变)。头部那两个小按钮只在 Host
310
+ 真的给出了一轮时出现(没关闭过轮次、或连的是更老的 Host 时不出现)。切到「本轮」后标题变成
311
+ **「本轮 #N · HH:MM」**,行与 `+a −b` 只算**最近一个已完成轮次**的改动(更早轮次改过、这一轮
312
+ 没碰的文件不会出现在列表里);选择记在浏览器本地(`rvs.changes.scope`)。这里的 N 是**已完成**
313
+ 的轮次编号——会话正在跑下一轮时不会提前把它算进来。
314
+ - **本轮模式下点开一行**与累计视图同一套标记/撤销,但比较的基点是**上一轮关闭时**的内容:
315
+ 行内 `n/N ↑↓`、悬浮「撤销这处改动」(反向应用这一轮的 hunk)、行右键「撤销该文件的全部改动」
316
+ (本轮整文件反向补丁)都只回退**这一轮**的改动。若该文件在本轮关闭之后又被改过,Host 答
317
+ 「已过期」,面板**提示并把视图切回会话累计**再取那份比较——不会拿一份作废的行号去画。
318
+ - **撤销成功后从本轮列表隐藏**:本轮视图是轮次关闭时**冻结**的那份 delta,宿主不会回头改它,
319
+ 所以"撤销了但列表还在"这件事由**客户端呈现层**收尾——单处撤销(该文件本轮只有一处改动)或
320
+ 行菜单「撤销该文件的全部改动」成功后,面板把这一行过滤掉,并按**可见行**重算文件数与
321
+ `+a −b`;隐藏了几行会说明,全部隐藏**且视图完整**时显示「本轮改动已全部撤销」(不是
322
+ 「本轮没有改动文件」),视图不完整或还在等扫描时仍用「已撤销 N 个」——面板不证明它不知道的事。
323
+ 记录按 `(会话, 轮次, 文件)` 存在浏览器本地(`rvs.changes.reverted.<会话>`),刷新页面后仍生效;
324
+ 多 hunk 文件的部分撤销**不隐藏**(剩下的改动还得看得见),撤销失败也不隐藏;浏览器禁用存储时
325
+ 只是不再记住(列表照旧显示),不影响任何远端写。宿主那份冻结算账完全不变。
326
+ 本轮视图没有「撤销新建(删除文件)」这一项(那需要 git 索引里的副本,本轮缓存只给补丁);
327
+ 右键菜单会直接说明去会话累计视图或「源代码管理」面板删。
320
328
  - **点文件**在远程编辑器里打开,并画上改动标记:新增行**绿色行背景**,删除的字符用**行内删除线 chip**
321
329
  表示(被删的字符在新文件里不存在,只能用插入的 widget 画),左侧 gutter 一列改动色条。
322
330
  - **跳改动点**:编辑器右上角悬浮 `n/N ↑↓`(快捷键 `Alt+Shift+Cmd/Ctrl+↓/↑`),在改动点之间循环跳转;
323
- 编辑器里一敲字,标记即作废并提示「位置已过期」。
324
- - **撤销这处改动**:悬浮在改动行上点一下 → 远端 `git apply -R`。上下文对不上时远端直接拒绝(文件一个
331
+ 编辑器里一敲字,标记即作废并提示「位置已过期」;**面板每 3 秒的新统计也会让已打开标签页的标记
332
+ 过期**(远端/会话又改了同一个文件、或文件从列表里消失时),提示同样是「位置已过期」,点该行即可
333
+ 按当前内容重算 —— 不会一直画着一份没人知道已经过时的标记。
334
+ - **查看差异(只读)**:行右键 →「查看差异」,打开该文件**并排两栏**的 diff。数据来自**会话账本**
335
+ (会话起点为基线),不是 `git diff`(后者比的是索引/HEAD,可能还带着会话开始前的未提交改动);
336
+ 改前全文由 Host 给的 hunk 从当前内容精确还原,复用现有的并排 diff 渲染器。这一页只读:不能编辑、
337
+ 也没有 hunk 暂存/撤销,重新载入仍走账本。二进制/超大文件这一项**保留但置灰**并写明原因(点开只会
338
+ 是空视图或假差异);内容被字节上限扣下、或改后一栏的读取撞上 8 MiB 上限时,**不打开**并说明比较
339
+ 不完整(两栏会错位)。
340
+ - **点开一行的五种结局都会说明**:改动内容被字节上限扣下时说明「比较不完整(可能整篇都算改动),
341
+ **不标改动、也不能撤销**」;文件过大时说明「不做行级比较、不能撤销,可打开文件自行查看」;二进制
342
+ 文件、远端读不到的文件、行还在但当前已无差异的文件各有自己的说明,不会只留一片空白让人以为
343
+ "没有改动"。
344
+ - **行尾 `⋯` 菜单**:悬浮在改动行上,行尾出现一枚 `⋯`(只有一行高、纵向锁在那一行上,指针从行内
345
+ 水平移过去就能点到),点开是「撤销这处改动」和「确认保留」两个动作。
346
+ - **撤销这处改动**:点菜单里的撤销 → 远端 `git apply -R`。上下文对不上时远端直接拒绝(文件一个
325
347
  字节都不动);标签页里有未保存内容时先拒绝,绝不会用远端补丁盖掉你的编辑;成功后光标留在原处,
326
- 标记自动重读刷新(不会因为"撤销了"就整片标记消失)。
348
+ 标记自动重读刷新(不会因为"撤销了"就整片标记消失)。**失败原因会分类说清**:上下文已变 / 文件
349
+ 已经不在仓库里 / 权限拒绝 / 仓库所有权不对(git 的 `dubious ownership`,提示配置 `safe.directory`
350
+ 或修所有权)/ 补丁已损坏,给出的都是各自可操作的那一句,git 原话附在后面。
351
+ - **确认保留(块级,纯本地)**:同一个菜单里还有一个切换式项「确认保留」——「这一处我看过了、
352
+ 同意保留」。它**不写远端、不发请求、不动 diff 数据**,状态按会话存在浏览器本地,按块身份
353
+ (文件 + hunk 头四个数字)记忆,刷新页面后仍在。与面板行上的 ✓ 是**两级**语义、**不联动**:
354
+ 块确认是编辑器内"这一处我看过",✓ 仍是文件级人工标记;没有批量确认。
327
355
  - **跟随会话工作区**:侧栏、编辑器下拉、文件树三者跟着**当前会话所在的工作区**走;用户手动切换后同一
328
356
  会话内不再被拉回,换会话重新跟随。跟随能力在 store 层,**侧栏从未打开过也照样跟随**;在改动面板点
329
357
  文件属于"看结果",不算手动切换。
@@ -336,11 +364,42 @@ dsh_remote_vs/
336
364
  - 已跟踪文件的数字随**轮次结束**刷新(面板每 3 秒轮询兜底,通常一两秒内跟上);**新文件**(在 shell 里
337
365
  创建的)靠**慢扫描**发现,单次预算最长约 **3 分钟**,重扫间隔按上次耗时自适应(至少 5 秒,大仓库会
338
366
  自然拉长);点 `⟳` 可强制立即重扫。
367
+ - **手动改动多久能看到**:没有轮次事件时(你在终端/编辑器里改文件),面板靠自愈重扫发现,阈值按
368
+ **上一次 `git status` 耗时自适应**(`clamp(耗时×4, 5s, 30s)`):小仓库(100ms 级)→ **5 秒**;
369
+ AOSP 级(实测 1.7s)→ **6.8 秒**;**30 秒上限只在耗时 ≥ 7.5 秒时才生效**。所以成本是可算的:
370
+ AOSP 树上配合 3 秒轮询,大约 **每 9 秒一次 `git status`**,约为旧 30 秒窗口的 **3 倍**(这是保留 4×
371
+ 设计的代价,换来手动改动 30s→约 7s 的可见性)。
372
+ - **回到页面**(切回标签页、或窗口重新获得焦点)会请求宿主**立即重扫一次**,但它与 `⟳` **不是同一件事**:
373
+ 这里只重扫 tracked 文件(`trackedOnly`),**不重置慢扫描的节流、也不重新武装被写掉的
374
+ `git ls-files --others`**(参考树 11s、冷树分钟级;focus 可能每几秒一次,不能每次都把整棵树的走查
375
+ 重新打开)。`⟳` 才是"连慢扫描一起重来"。两条路径都有 5 秒去抖、隐藏期间不刷、已有请求在飞则跳过
376
+ (在飞超过 60 秒视为那次请求已失败,避免一次挂住的请求让强制刷新永久失效)。
377
+ - **注意**:`⟳` 和"回到页面"都只是**安排**宿主重扫,这次响应里仍是上一次摘要 —— 新数字要等下一轮轮询
378
+ (≤ 3 秒)才回来,不是刷新动作自己把结果带回。
339
379
  - 非 git 工作区、或工作区里有多个仓库而没指定仓库目录时,面板显示明确原因
340
380
  (`no git repository at the workspace root, and N candidates below it — set the repository directory in Source Control`),不显示空列表。
341
381
  - 二进制文件与超大文件只在行尾标「二进制 / 过大」,不给字符级差异;**非 UTF-8(如 GBK)文本按二进制处理**(不给计数、不提供撤销,避免乱码计数和必然失败的 `git apply -R`)。
382
+ - **超大文件不做行级比较**:列表对这类行把增删数字钉成 `0/0`(不是真实行数),点开只打开文件并说明
383
+ 「文件太大、不做行级比较」,不画标记也不提供撤销 —— 避免拿 0/0 与真实行数比较而误报「位置已过期」。
384
+ - **本轮视图只覆盖「最近一个已完成轮次」**(不做多轮历史):每次轮次关闭时 Host 记下当时各文件的
385
+ 文本,下一次关闭时求差;轮次结束后才会更新,所以会话正在跑的下一轮**不会**混进「本轮」。
386
+ - **本轮的补丁与 hunk 文本有预算(默认 4 MiB)**:这个预算只算整文件反向补丁 + hunk 行;两侧
387
+ 全文与上一轮快照按扫描读取上限另计(实际驻留约 4 MiB + 两侧文本,最坏约 20 MiB/活跃会话)。
388
+ 超过预算时,该会话的「本轮」**只
389
+ 保留增删统计**(数字仍真实),不提供块标记与撤销,并写明原因、**本会话后续不再计算**本轮视图——
390
+ 否则下一轮会拿一份没推进的快照去比,把旧改动算到新轮次头上。会话累计视图不受影响。
391
+ - **新文件靠慢扫描发现**:本轮关闭时先用已缓存的扫描结果算一次,此时列表会标「新文件扫描还没
392
+ 落地」;慢扫描(`git ls-files --others`)落地后会**重算同一轮**补上新文件并清掉该标记。扫描被
393
+ 写掉、结果受文件上限截断、或上一轮从未完成校正时,本轮列表会**常驻标成不完整**(不是「没创建
394
+ 文件」,而是「这条路径无法归属,已丢弃」)——上一侧字节被扣下(二进制/过大)的文件同样如此,
395
+ 绝不被算成整份新增。
396
+ - 二进制/超大文件在「本轮」里同样只标「二进制 / 过大」、不给行级比较;本轮缓存不保存它们的字节。
342
397
  - 未跟踪扫描失效(例如远端拒绝)时面板会**说明原因**并保留刷新入口,不再只是静默少一行。
343
398
  - 撤销带 **provenance**:记录这处改动属于哪个会话 / 绑定 / 仓库目录,换会话或换绑定后不会把补丁应用到另一台主机;会话新建的整文件不提供撤销(避免反向补丁删掉未跟踪文件)。
399
+ - 二进制/超大文件的「查看差异」入口**可见但置灰**并写明原因;内容被字节上限扣下(或改后读取超 8 MiB)
400
+ 时不打开两栏 diff,只说明"比较不完整"——那种 diff 的 hunk 是对空文本算出来的整篇假差异,撤销也不可能成立。
401
+ - 文件被改回会话基线后,再点行会得到「现在没有可显示的差异」而不是「读不到这个文件」。
402
+ - 「位置已过期」只是**提示**,不会自动重读:点该行(或保存成功后)才会按当前远端内容重算。
344
403
 
345
404
  ## P2 透明远端执行(Windows 原生)
346
405
 
@@ -450,7 +509,7 @@ node .spike/letter-check.mjs # 状态字母:未跟踪 ? 与冲突 U 不再
450
509
  > 失败时才触发,所以「调用点 57」与「跑出来 55」本来就该差 2)。
451
510
 
452
511
  真机回归仍是 `npx tsc -p tsconfig.scratch.json && node .spike/build/.spike/p2-router.js`。
453
- DSH 发新版时先读本地维护文档 `docs/MAINTENANCE.md`(§2 逐项耦合点 + §3 升级清单)再动手;该文件被 .gitignore,克隆仓库的人看不到。改动后(无论 host 半还是 client 半)的必做动作是:`pnpm run build` → `node scripts/verify-lib.mjs`(核对 `lib/` 齐全、已入库、能加载)→ 重启 `dsh web`,提交前把 `scripts/` 下的本地门禁逐个跑一遍(`node scripts/check-*.mjs`,当前 73 个;另有 `verify-lib.mjs` 与共享 TS 加载器 `_ts-hook.mjs`)。
512
+ DSH 发新版时先读本地维护文档 `docs/MAINTENANCE.md`(§2 逐项耦合点 + §3 升级清单)再动手;该文件被 .gitignore,克隆仓库的人看不到。改动后(无论 host 半还是 client 半)的必做动作是:`pnpm run build` → `node scripts/verify-lib.mjs`(核对 `lib/` 齐全、已入库、能加载)→ 重启 `dsh web`,提交前把 `scripts/` 下的本地门禁逐个跑一遍(`node scripts/check-*.mjs`,当前 77 个;另有 `verify-lib.mjs` 与共享 TS 加载器 `_ts-hook.mjs`)。
454
513
 
455
514
  ## 开源许可
456
515
 
@@ -3,7 +3,7 @@
3
3
  `dsh-remote-vs` 自身以 MIT 许可发布(见 [LICENSE](./LICENSE))。本文件列出**随发行包分发**或**由本包声明依赖**的
4
4
  第三方组件、版权人与许可证,并说明许可证全文的获取位置。
5
5
 
6
- 口径(2026-11-23,插件 `0.25.0`;按 `package.json`、`pnpm-lock.yaml` 与 `node_modules` 实际版本核对):
6
+ 口径(2026-11-25,插件 `0.27.0`;按 `package.json`、`pnpm-lock.yaml` 与 `node_modules` 实际版本核对):
7
7
 
8
8
  - **内联** = 该包的代码被构建进本包产物。宿主半(`lib/index.js`、`lib/p2-*.js`)按 `tsdown.config.ts` 的
9
9
  `noExternal: ['ssh2']` 打包(`cpu-features` 与 `sshcrypto.node` 保持 external,纯 JS 路径才是实际发布形态);
@@ -47,12 +47,17 @@
47
47
  | `@deepseek-ai/dsh-fs-ssh` | 0.2.2-rc.5(精确 pin) | MIT(DSH 项目) | 见 npm 包内 `LICENSE` |
48
48
  | `@deepseek-ai/schemastery` | 3.19.0(精确 pin) | MIT(DSH 项目) | 见 npm 包内 `LICENSE` |
49
49
 
50
- ## 4. 由宿主提供的 peer 依赖(不随本包分发)
50
+ ## 4. 由宿主提供的平台依赖(不随本包分发)
51
51
 
52
52
  `react`、`react-dom`(MIT,`Copyright (c) Facebook, Inc. and its affiliates.`)与其余 `@deepseek-ai/*`
53
53
  (`cordis`、`dsh-*`;DSH 以 MIT 发布)由 DSH 宿主提供,本包只声明 peer、不打包其代码;§3 里的三个
54
54
  `@deepseek-ai/*` 是本包的**运行期依赖**(非 peer),由 npm 随包安装、同样不内联。
55
55
 
56
+ `@deepseek-ai/dsh-client-ui-primitives`(`0.2.2-rc.5`,MIT,`Copyright (c) 2026 DeepSeek`)是
57
+ **客户端平台模块表提供的组件**(Markdown 预览使用其 `MarkdownText`):本包只在 `devDependencies`
58
+ 声明它以便类型检查/构建,客户端构建按 external 解析,不内联、也不随本包安装;运行时由 DSH web shell
59
+ 的模块表提供。
60
+
56
61
  `vendor/` 下的 helper 种子由 DeepSeek Harness 源码(MIT)按 `dsh-v0.2.2-rc.4` tag 用官方脚本构建,并内嵌
57
62
  Node.js 运行时(MIT);构建流程与两处偏离见 README「Helper 自编译」。
58
63