dsh-remote-vs 0.10.0 → 0.11.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 +8 -6
- package/README.md +8 -6
- package/lib/client.js +3313 -1089
- package/lib/index.js +209 -7
- package/lib/types/client/api.d.ts +12 -0
- package/lib/types/client/exec-output.d.ts +58 -0
- package/lib/types/client/i18n.d.ts +1 -1
- package/lib/types/client/scm/CommitPane.d.ts +73 -0
- package/lib/types/client/scm/ExecPanel.d.ts +34 -0
- package/lib/types/client/scm/HistoryPanel.d.ts +12 -4
- package/lib/types/client/scm/actions.d.ts +50 -3
- package/lib/types/client/scm/commit-model.d.ts +119 -0
- package/lib/types/client/store.d.ts +9 -3
- package/lib/types/client/vsc/kit.d.ts +16 -0
- package/lib/types/git-format.d.ts +5 -0
- package/lib/types/git-ops.d.ts +57 -2
- package/lib/types/pool.d.ts +9 -0
- package/lib/types/protocol.d.ts +23 -0
- package/lib/types/timeouts.d.ts +17 -2
- package/package.json +1 -1
- package/src/client/api.ts +61 -0
- package/src/client/exec-output.ts +129 -0
- package/src/client/i18n.ts +131 -2
- package/src/client/scm/CommitPane.tsx +726 -0
- package/src/client/scm/ExecPanel.tsx +124 -0
- package/src/client/scm/HistoryPanel.tsx +483 -104
- package/src/client/scm/ScmPanel.tsx +247 -9
- package/src/client/scm/actions.ts +93 -10
- package/src/client/scm/commit-model.ts +317 -0
- package/src/client/store.tsx +11 -5
- package/src/client/vsc/kit.tsx +71 -0
- package/src/client/vsc/vsc.css +647 -0
- package/src/git-format.ts +7 -3
- package/src/git-ops.ts +83 -7
- package/src/pool.ts +84 -4
- package/src/protocol.ts +14 -0
- package/src/routes.ts +135 -1
- package/src/timeouts.ts +18 -2
package/README.en.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
[中文](./README.md) | English
|
|
6
6
|
|
|
7
7
|
SSH host management inside the DSH Host process + helper push pipeline + a **VS Code-style remote
|
|
8
|
-
workbench** (explorer / search / source control / commit graph / multi-tab editor / floating editor /
|
|
8
|
+
workbench** (explorer / search / source control / commit graph with its commit-details pane / multi-tab editor / floating editor /
|
|
9
9
|
side-by-side diff / multiple terminals). Hosts live in DSH Settings ("Remote hosts"); with `dsh-better-sidebar` installed
|
|
10
10
|
there is an extra standalone "Remote" tab, otherwise it falls back to a native right-Sidebar "Remote"
|
|
11
11
|
page (same content, self-opened from the guide, per-session instances). The editor is ALSO mounted into
|
|
@@ -65,10 +65,10 @@ it cannot be waived from the dependency side, only removed from the tree. Then r
|
|
|
65
65
|
| --- | --- |
|
|
66
66
|
| Explorer | Lazy tree + expand/collapse + hidden-files toggle; context menu: new / rename / delete / copy / move / paste / find in folder / insert `@` reference; git status colours and folder roll-up marks |
|
|
67
67
|
| 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 |
|
|
68
|
-
| 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) |
|
|
68
|
+
| 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) |
|
|
69
69
|
| 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 |
|
|
70
70
|
| 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 |
|
|
71
|
-
| Commit graph | SVG branch/merge graph
|
|
71
|
+
| 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) |
|
|
72
72
|
| Multi-tab editor | Open/save/reload, dirty marks, several files at once; image preview, Markdown/HTML preview (source vs preview) |
|
|
73
73
|
| 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 |
|
|
74
74
|
| 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 |
|
|
@@ -87,8 +87,8 @@ it cannot be waived from the dependency side, only removed from the tree. Then r
|
|
|
87
87
|
| 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) |
|
|
88
88
|
| Remote terminal | ssh2 PTY + WebSocket, xterm rendering (copy-paste/theme-follow/reconnect-on-refresh); **a reattach only takes over, it does not resize** (a page reload no longer shrinks a running shell to 80×24); an output backlog applies real backpressure to the far end; **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 |
|
|
89
89
|
| 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 |
|
|
90
|
-
| Timeouts and process cleanup | exec runs in its own session (`setsid --wait`); on timeout 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 |
|
|
91
|
-
| Git graph | Remote repo status + branches + SVG commit graph + commit details (exec + frontend parsing, zero Host additions) |
|
|
90
|
+
| 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 |
|
|
91
|
+
| Git graph | Remote repo status + branches + SVG commit graph + commit details/contents/diff pane (exec + frontend parsing, zero Host additions) |
|
|
92
92
|
| Import | One-click import from `~/.ssh/config` and from an existing `dsh-ssh.json` (read once, no coupling) |
|
|
93
93
|
|
|
94
94
|
### Agent capabilities
|
|
@@ -151,7 +151,9 @@ dsh_remote_vs/
|
|
|
151
151
|
│ ├── scm/ # ── source control ──
|
|
152
152
|
│ │ ├── ScmPanel.tsx # changes/staged/untracked + per-file and per-hunk actions + commit box
|
|
153
153
|
│ │ ├── DiffView.tsx # side-by-side diff (top scrollbar/hunk buttons/editable after side)
|
|
154
|
-
│ │ ├── HistoryPanel.tsx # SVG commit graph + commit
|
|
154
|
+
│ │ ├── HistoryPanel.tsx # SVG commit graph + resizable/expandable commit-details pane
|
|
155
|
+
│ │ ├── CommitPane.tsx # details/contents/diff tabs + patch toolbar + context menus
|
|
156
|
+
│ │ ├── commit-model.ts # patch blocks/line numbers/counts/directory grouping/file stepping (pure)
|
|
155
157
|
│ │ ├── actions.ts # remote git action layer (over the exec channel)
|
|
156
158
|
│ │ ├── diff-model.ts # unified diff → side-by-side row projection (pure)
|
|
157
159
|
│ │ └── status-map.ts # status bucketing + tree marks (pure)
|
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
中文 | [English](./README.en.md)
|
|
6
6
|
|
|
7
7
|
Host 进程内的 SSH 主机管理 + helper 推送流水线 + **VS Code 式远端工作台**
|
|
8
|
-
(资源管理器 / 搜索 / 源代码管理 /
|
|
8
|
+
(资源管理器 / 搜索 / 源代码管理 / 提交图与提交详情面板 / 多标签编辑器 / 悬浮编辑器 / 并排 Diff / 多终端)。
|
|
9
9
|
主机配在 DSH 设置里(“远程主机”项);装了 `dsh-better-sidebar` 时另有
|
|
10
10
|
独立“远程”tab,没装则退到原生右侧栏“远程”页(同内容,引导页自助开,per-session 实例)。
|
|
11
11
|
编辑器还额外挂到会话视图槽,与“对话 / 轨迹”并列成一个**远程编辑器**标签,
|
|
@@ -56,10 +56,10 @@ dsh plugin --profile web add dsh-remote-vs
|
|
|
56
56
|
| --- | --- |
|
|
57
57
|
| 资源管理器 | 懒加载目录树 + 展开折叠 + 隐藏文件开关;右键菜单:新建/改名/删除/复制/移动/粘贴/在此文件夹查找/插入 `@` 引用;git 状态色与文件夹聚合标记 |
|
|
58
58
|
| 搜索 | 两档:**文件名**(远端 `find`)与**内容**(远端 `grep`)。内容档带范围目录、`Aa`(大小写)/`ab_`(全字)/`.*`(正则)、结果按文件分组、命中高亮,点条目跳到该行 |
|
|
59
|
-
| 源代码管理 | **仓库目录选择器**(工作区里的 git 在子目录时用:浏览远端目录、一键跳到工作区内发现的仓库、手输相对/绝对路径,并逐目录提示会落在哪个仓库);变更/暂存/未跟踪/忽略分桶,**未跟踪目录行可点击展开**,逐文件与**逐 hunk** 暂存/还原、丢弃(带确认)、提交;分支/远程/stash 面板;同步(fetch/pull/push
|
|
59
|
+
| 源代码管理 | **仓库目录选择器**(工作区里的 git 在子目录时用:浏览远端目录、一键跳到工作区内发现的仓库、手输相对/绝对路径,并逐目录提示会落在哪个仓库);变更/暂存/未跟踪/忽略分桶,**未跟踪目录行可点击展开**,逐文件与**逐 hunk** 暂存/还原、丢弃(带确认)、提交;分支/远程/stash 面板;同步(fetch/pull/push),**推送支持自定义 refspec**(如 Gerrit `HEAD:refs/for/<分支>`;留空 = 普通 `git push`,非空值会记住);fetch/pull/push/sync 有**实时输出面板**(SSE 流式显示 git/远端输出、运行计时、**可取消**(杀掉远端进程组)、完成后可复制完整输出;老 Host 无流式路由时自动回退到一次性结果) |
|
|
60
60
|
| 会话改动审阅 | 输入框上方的**可收纳**面板,按**会话**列出改了什么(一行一个文件、文件类型图标、右侧 `+a −b`);点文件在远程编辑器里打开并画**整行着色 + 行内字符级差异**,右上角 `n/N ↑↓` 跳改动点,悬浮改动行可**撤销**这处改动(远端 `git apply -R`)。详见下文「会话改动审阅」 |
|
|
61
61
|
| 并排 Diff | 左右**严格等分** + 中间 gutter 逐 hunk 按钮 + **顶部横向滚动条**(一行很长也不会破坏对称)+ 行号钉在左侧,**只渲染视口内的行**(3000 行文件从 9000 个行容器降到约 174 个,滚动范围与整篇渲染完全一致);可切「变更前 / 变更后」,变更后可编辑并保存 |
|
|
62
|
-
| 提交图 | SVG
|
|
62
|
+
| 提交图 | SVG 分支/合并图;点选提交后,下方**可调高度 / 可全屏**的提交详情面板给出三个视图:**提交详情**(标题、作者、时间、完整哈希+复制、父提交、ref、正文、检出)、**内容**(改动文件按目录分组、可折叠、可过滤,单击看差异、右键或行尾按钮在编辑器中打开)、**差异**(默认只展开前约 1500 行、其余文件折叠;双行号、`+/−` 计数、自动换行、上一/下一个文件、复制文件补丁或整个补丁)。合并提交按**首父**展示(git 对 merge 默认不给文件列表) |
|
|
63
63
|
| 多标签编辑器 | 打开/保存/重载、脏标记、多文件标签并存;图片预览、Markdown/HTML 预览(源码/预览切换) |
|
|
64
64
|
| 悬浮编辑器 | 三个入口:文件树 / 搜索结果 / 源代码管理右键「在悬浮编辑器中打开」,以及**双击会话视图的「远程编辑器」标签**把当前编辑器整体浮出(同一套标签、预览、Diff、查找、改动标记,不是另写一个编辑器)。窗口可拖标题栏移动、拖八个边角缩放、最大化/还原、双击标题栏切换最大化;**最小化成一个可拖动的悬浮球**(球上有未保存脏点,点一下或按 Enter 恢复,拖动可换位置);`Ctrl+滚轮` 缩放编辑器字号;位置、大小、字号和球的位置跨刷新记住 |
|
|
65
65
|
| 语法高亮 | 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 语法着色(没有专用语法包),效果是关键字/字符串/注释正确、专有语法不细分 |
|
|
@@ -78,8 +78,8 @@ dsh plugin --profile web add dsh-remote-vs
|
|
|
78
78
|
| 远端文件 | SFTP 浏览 / 读 / 写 / 新建 / 删除 / 改名。边界已加固:0 字节文件不再卡死,每个 SFTP 操作 60s 超时回收通道;**单个目录列表上限 20000 条**(按"目录在前、其余按名"排序后取前 20000,宿主日志说明——协议里没有"已截断"字段,界面上没有标记) |
|
|
79
79
|
| 远端终端 | ssh2 PTY + WebSocket,xterm 渲染(复制粘贴/主题跟随/刷新重连);**重新挂接只接管、不改尺寸**(刷新页面不会把运行中的 shell 缩成 80×24);输出积压时对远端施加真背压;**单帧上限 1 MiB**,超过 64 Ki 字符的粘贴在客户端按码点分块发送,不再撑断连接 |
|
|
80
80
|
| 并发通道 | 每主机同时最多 **6 条**远端通道(不再撞远端 sshd 的 `MaxSessions`);第 7 个排队最多等 **30 秒**,超时明确报 `remote host <alias> is busy`,而不是无限堆连接 |
|
|
81
|
-
| 超时与进程清理 | exec 跑在独立会话里(`setsid --wait
|
|
82
|
-
| Git 图谱 | 远端仓库状态 + 分支 + SVG 提交图 +
|
|
81
|
+
| 超时与进程清理 | 普通 git 命令默认 300s(设置可调);**网络动词(fetch/pull/push/sync)默认 20 分钟、上限 30 分钟**。exec 跑在独立会话里(`setsid --wait`),超时/取消都先发 TERM、**3 秒后升级 KILL**,连同子进程一起收掉;远端没有 `setsid --wait` 时探测一次即知,退回旧行为并在宿主日志里写明"超时可能没停掉远端命令" |
|
|
82
|
+
| Git 图谱 | 远端仓库状态 + 分支 + SVG 提交图 + 提交详情/内容/差异面板(exec + 前端解析,零 Host 增量)|
|
|
83
83
|
| 导入 | 从 `~/.ssh/config`、从现有 `dsh-ssh.json` 一键导入(只读一次,不耦合)|
|
|
84
84
|
|
|
85
85
|
### Agent 能力
|
|
@@ -142,7 +142,9 @@ dsh_remote_vs/
|
|
|
142
142
|
│ ├── scm/ # ── 源代码管理 ──
|
|
143
143
|
│ │ ├── ScmPanel.tsx # 变更/暂存/未跟踪 + 逐文件逐 hunk 操作 + 提交框
|
|
144
144
|
│ │ ├── DiffView.tsx # 并排 diff(顶部横向滚动条/hunk 按钮/可编辑变更后侧)
|
|
145
|
-
│ │ ├── HistoryPanel.tsx # SVG 提交图 +
|
|
145
|
+
│ │ ├── HistoryPanel.tsx # SVG 提交图 + 可调高度/可全屏的提交详情面板
|
|
146
|
+
│ │ ├── CommitPane.tsx # 提交详情/内容/差异 三标签 + 补丁工具栏 + 右键菜单
|
|
147
|
+
│ │ ├── commit-model.ts # 补丁分块/行号/计数/目录分组/文件步进(纯函数)
|
|
146
148
|
│ │ ├── actions.ts # 远端 git 动作层(exec 通道)
|
|
147
149
|
│ │ ├── diff-model.ts # unified diff → 并排行投影(纯函数)
|
|
148
150
|
│ │ └── status-map.ts # 状态分桶 + 树标记(纯函数)
|