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.
Files changed (67) hide show
  1. package/README.en.md +159 -23
  2. package/README.md +123 -23
  3. package/lib/client.js +6906 -6619
  4. package/lib/index.js +2014 -67
  5. package/lib/types/changes/recorder.d.ts +119 -2
  6. package/lib/types/client/CodeEditor.d.ts +15 -0
  7. package/lib/types/client/HostsView.d.ts +139 -2
  8. package/lib/types/client/api.d.ts +42 -2
  9. package/lib/types/client/changes/apply-failure.d.ts +41 -0
  10. package/lib/types/client/changes/block-confirm.d.ts +97 -0
  11. package/lib/types/client/changes/diff-outcome.d.ts +56 -0
  12. package/lib/types/client/changes/freshness.d.ts +51 -0
  13. package/lib/types/client/changes/model.d.ts +19 -1
  14. package/lib/types/client/changes/session-diff.d.ts +100 -0
  15. package/lib/types/client/changes/staleness.d.ts +98 -0
  16. package/lib/types/client/changes/turn-reverted.d.ts +82 -0
  17. package/lib/types/client/changes/turn-view.d.ts +131 -0
  18. package/lib/types/client/changes/undo-affordance.d.ts +44 -10
  19. package/lib/types/client/changes/undo-target.d.ts +12 -0
  20. package/lib/types/client/connection.d.ts +28 -1
  21. package/lib/types/client/i18n.d.ts +1 -1
  22. package/lib/types/client/store.d.ts +91 -1
  23. package/lib/types/client/vsc/change-marks.d.ts +21 -0
  24. package/lib/types/forward.d.ts +11 -1
  25. package/lib/types/pool.d.ts +95 -1
  26. package/lib/types/protocol.d.ts +221 -1
  27. package/lib/types/proxy.d.ts +136 -0
  28. package/lib/types/store.d.ts +81 -1
  29. package/lib/types/tools.d.ts +3 -0
  30. package/package.json +1 -1
  31. package/src/changes/recorder.ts +851 -8
  32. package/src/client/CodeEditor.tsx +43 -3
  33. package/src/client/ConnectionStatus.tsx +19 -5
  34. package/src/client/EditorPane.tsx +64 -7
  35. package/src/client/HostsView.tsx +552 -11
  36. package/src/client/PortsView.tsx +16 -0
  37. package/src/client/SettingsHosts.tsx +132 -6
  38. package/src/client/api.ts +60 -3
  39. package/src/client/changes/ChangesDock.tsx +539 -54
  40. package/src/client/changes/apply-failure.ts +73 -0
  41. package/src/client/changes/block-confirm.ts +180 -0
  42. package/src/client/changes/changes.css +45 -0
  43. package/src/client/changes/diff-outcome.ts +97 -0
  44. package/src/client/changes/freshness.ts +68 -0
  45. package/src/client/changes/model.ts +56 -1
  46. package/src/client/changes/session-diff.ts +187 -0
  47. package/src/client/changes/staleness.ts +148 -0
  48. package/src/client/changes/turn-reverted.ts +254 -0
  49. package/src/client/changes/turn-view.ts +195 -0
  50. package/src/client/changes/undo-affordance.ts +295 -63
  51. package/src/client/changes/undo-target.ts +12 -0
  52. package/src/client/connection.ts +76 -2
  53. package/src/client/i18n.ts +204 -4
  54. package/src/client/scm/DiffView.tsx +32 -13
  55. package/src/client/store.tsx +392 -16
  56. package/src/client/vsc/change-marks.ts +21 -0
  57. package/src/client/vsc/preview-document.tsx +4 -1
  58. package/src/client/vsc/vsc.css +6747 -6509
  59. package/src/forward.ts +38 -2
  60. package/src/importers.ts +125 -13
  61. package/src/keygen.ts +8 -1
  62. package/src/pool.ts +422 -27
  63. package/src/protocol.ts +229 -1
  64. package/src/proxy.ts +673 -0
  65. package/src/routes.ts +93 -14
  66. package/src/store.ts +335 -0
  67. package/src/tools.ts +47 -2
@@ -106,6 +106,28 @@ export const DYNAMIC_KEYS = [
106
106
  'editor.imageFailedHint',
107
107
  'editor.imageTooLargeTitle',
108
108
  'editor.imageTooLargeHint',
109
+ // Chosen through the `NOTICE_KEY` table in `changes/diff-outcome.ts`: the
110
+ // panel renders "why this diff has no (or only partial) marks" from a
111
+ // resolved notice value, so the scanner sees no literal t() call to count.
112
+ 'changes.diffTruncated',
113
+ 'changes.diffOversized',
114
+ 'changes.diffBinary',
115
+ 'changes.diffMissing',
116
+ 'changes.diffEmpty',
117
+ // Chosen through `turnOutcomeOf` in `changes/turn-view.ts`: the panel resolves
118
+ // "why this turn row painted nothing / fell back" from a notice value, so the
119
+ // scanner sees no literal t() call for these.
120
+ 'changes.turnStatsOnly',
121
+ 'changes.turnUnavailable',
122
+ 'changes.turnStaleFallback',
123
+ // Chosen through the `FAILURE_KEY` table in `changes/apply-failure.ts`: a
124
+ // revert failure is classified from the stderr text, then translated.
125
+ 'changes.applyContextMoved',
126
+ 'changes.applyPathMissing',
127
+ 'changes.applyPermission',
128
+ 'changes.applyOwnership',
129
+ 'changes.applyCorrupt',
130
+ 'changes.applyOther',
109
131
  ] as const
110
132
 
111
133
  const zh: Record<string, string> = {
@@ -152,6 +174,46 @@ const zh: Record<string, string> = {
152
174
  'form.passphrase': '私钥口令(可选)',
153
175
  'form.password': '密码',
154
176
  'form.description': '备注(可选)',
177
+ // -- 网络出口(主机级覆盖 + profile 级默认)
178
+ 'proxy.title': '网络出口',
179
+ 'proxy.expand': '展开网络出口',
180
+ 'proxy.collapse': '收起网络出口',
181
+ 'proxy.mode': '出网方式',
182
+ 'proxy.mode.inherit': '跟随默认',
183
+ 'proxy.mode.direct': '直连',
184
+ 'proxy.mode.proxy': '代理',
185
+ 'proxy.mode.jump': '跳板',
186
+ 'proxy.kind': '代理类型',
187
+ 'proxy.typeHttp': 'HTTP CONNECT',
188
+ 'proxy.typeSocks5': 'SOCKS5',
189
+ 'proxy.shortHttp': 'HTTP',
190
+ 'proxy.shortSocks5': 'SOCKS5',
191
+ 'proxy.host': '代理主机',
192
+ 'proxy.port': '端口',
193
+ 'proxy.username': '用户名(可选)',
194
+ 'proxy.password': '密码(可选)',
195
+ 'proxy.passwordKeep': '已设置,留空则不修改',
196
+ 'proxy.jumpVia': '跳板主机',
197
+ 'proxy.jumpMissing': '{alias}(主机不存在)',
198
+ 'proxy.jumpNone': '没有其他主机可作跳板',
199
+ 'proxy.jumpHint': '经这台主机的 SSH 连接转发到目标;跳板本身必须能直连或经默认代理。',
200
+ 'proxy.chipInherit': '跟随默认',
201
+ 'proxy.chipProxy': '代理',
202
+ 'proxy.chipJump': '跳板 {alias}',
203
+ 'proxy.chipTitle': '网络出口:{summary}',
204
+ 'proxy.summaryDirect': '直连',
205
+ 'proxy.summaryProxy': '经 {kind} 代理 {host}:{port}',
206
+ 'proxy.summaryInheritDirect': '跟随默认(直连)',
207
+ 'proxy.summaryInheritProxy': '跟随默认(经 {kind} 代理 {host}:{port})',
208
+ 'proxy.summaryJump': '经跳板 {alias}',
209
+ 'proxy.default.title': '默认网络出口',
210
+ 'proxy.default.hint': '设为「跟随默认」的主机走这里;单台主机可以在「远程主机」表单里覆盖。',
211
+ 'proxy.invalidTarget': '代理需要主机名与 1–65535 的端口',
212
+ 'proxy.invalidJump': '请选择跳板主机',
213
+ 'proxy.jumpGone': '跳板主机「{alias}」已不存在,请重新选择',
214
+ 'proxy.save': '保存',
215
+ 'proxy.saving': '保存中…',
216
+ 'proxy.saveFailed': '保存失败:{message}',
155
217
  'deploy.notDeployed': '未推送',
156
218
  'deploy.ok': '已推送',
157
219
  'deploy.skipped': '已是最新(跳过)',
@@ -627,7 +689,7 @@ const zh: Record<string, string> = {
627
689
  'preview.remoteTitle': '远端文件无法预览',
628
690
  'preview.remoteHint': '宿主拒绝了这条字节读取路径。',
629
691
  'preview.officeUnavailableTitle': '远端没有 LibreOffice',
630
- 'preview.officeUnavailableHint': '宿主 officeKit 不可用,远端也没有安装 LibreOffice,因此无法转换这个文档。',
692
+ 'preview.officeUnavailableHint': '宿主 officeKit 不可用,远端也没有安装 LibreOffice,因此无法转换这个文档。可在 Host 安装 LibreOffice Kit:npm install @deepseek-ai/libreoffice-kit@latest;或在远端安装 libreoffice。',
631
693
  'preview.truncated': '文件过大,只预览了已加载的部分。',
632
694
  'preview.tableTruncated': '数据超过 {rows} 行 / {cells} 个单元格,只解析了前面部分。',
633
695
  'preview.tableHiddenRows': '只显示了前 {shown} 行,还有 {rest} 行未显示。',
@@ -752,6 +814,23 @@ const zh: Record<string, string> = {
752
814
  'git.notARepo': '当前远端工作区不是 git 仓库。',
753
815
  // -- session change panel (above the composer)
754
816
  'changes.title': '本次改动',
817
+ 'changes.scopeLabel': '改动范围',
818
+ 'changes.scopeSession': '会话累计',
819
+ 'changes.scopeTurn': '本轮',
820
+ 'changes.scopeSessionHint': '以会话起点为基线,列出这个会话改过的全部文件',
821
+ 'changes.scopeTurnHint': '只看最近一个已完成轮次改了什么(更早的轮次不计入)',
822
+ 'changes.turnTitle': '本轮 #{turn} · {time}',
823
+ 'changes.turnEmpty': '本轮没有改动文件。',
824
+ 'changes.turnStatsOnly': '本轮只有增删统计:改动内容超出 Host 的内存预算,没有块标记也不能撤销(会话累计视图不受影响)。',
825
+ 'changes.turnUnavailable': '本轮没有可显示的改动内容',
826
+ 'changes.turnStaleFallback': '该文件在本轮之后又被修改,已回退为会话累计视图。',
827
+ 'changes.turnMarksStale': '本轮改动内容已过期(文件在本轮之后又被修改),标记已清除。',
828
+ 'changes.turnDiffDisabled': '本轮视图只打开文件;并排差异请切回会话累计',
829
+ 'changes.turnPending': '本轮的新文件扫描还没落地:同一轮会被重新统计,列表可能继续变长。',
830
+ 'changes.turnPartial': '本轮视图不完整:部分文件无法归属(上一轮内容未知、超出文件上限,或上一轮扫描未落定),已略过。',
831
+ 'changes.turnRevertedHidden': '本轮已撤销 {n} 个文件的改动,已从列表隐藏。',
832
+ 'changes.turnRevertedAll': '本轮改动已全部撤销。',
833
+ 'changes.turnRevertNotPossible': '本轮只保留反向补丁,不提供「撤销新建」;要删除这个新文件请在会话累计视图撤销,或到源代码管理面板处理。',
755
834
  'changes.onlyUnreviewed': '只看未审阅',
756
835
  'changes.nextUnreviewed': '下一个未审阅',
757
836
  'changes.allReviewed': '全部已审阅',
@@ -792,7 +871,7 @@ const zh: Record<string, string> = {
792
871
  'changes.navLabel': '改动跳转',
793
872
  'changes.refresh': '重新统计改动',
794
873
  'changes.stale': '位置已过期',
795
- 'changes.staleHint': '编辑器内容已改动,改动位置可能不准。点击列表里的文件重新计算。',
874
+ 'changes.staleHint': '改动列表或编辑器内容已经变了,屏幕上这批标记可能不再准确。点列表里的文件重新计算。',
796
875
  'changes.noWorkspace': '找不到该主机对应的工作区,无法打开文件。',
797
876
  // -- 编辑器 gutter 标记与删除 chip(vsc/change-marks.ts 的 title / aria-label)
798
877
  'changes.markAdd': '新增行',
@@ -809,6 +888,27 @@ const zh: Record<string, string> = {
809
888
  'changes.undoNoContext': '找不到这处改动所属的主机与仓库,无法撤销。',
810
889
  'changes.undoConflict': '这处改动的上下文已经变了,远端拒绝了撤销(文件未被修改)。',
811
890
  'changes.undoMissing': '这处改动没有可用的补丁内容,无法撤销。',
891
+ // -- 撤销失败的原因分类(git apply 的 stderr → 可操作的四种说法)
892
+ 'changes.applyContextMoved': '远端文件的内容已经变了,补丁对不上(文件未被修改)。',
893
+ 'changes.applyPathMissing': '补丁指向的文件在远端不见了(可能已被删除或重命名)。',
894
+ 'changes.applyPermission': '远端拒绝写入(权限不足或只读文件系统)。',
895
+ 'changes.applyOwnership': '远端仓库的所有者与当前用户不一致,git 拒绝操作:请配置 safe.directory 或修正目录所有权。',
896
+ 'changes.applyCorrupt': '补丁内容不完整或已损坏,重新打开该文件取一次改动内容后再试。',
897
+ 'changes.applyOther': '远端拒绝了这次补丁,原因见后面的原始信息。',
898
+ // -- 悬浮栏的第二个动作:块级「确认保留」(纯本地笔记)
899
+ 'changes.actions': '改动操作',
900
+ 'changes.confirmBlock': '确认保留',
901
+ 'changes.confirmedBlock': '已确认保留',
902
+ // -- 点开一行时 diff 的五种可见结论
903
+ 'changes.diffTruncated': '改动内容被远端字节上限扣下,这次比较不完整(可能整篇都算改动),因此不标改动、也不能撤销。',
904
+ 'changes.diffOversized': '文件太大,Host 扣下了内容,不做行级比较(没有改动标记、也不能撤销);可以打开文件自行查看。',
905
+ 'changes.diffBinary': '二进制文件没有可显示的文本差异,编辑器里不会画改动标记。',
906
+ 'changes.diffMissing': '远端读不到这个文件的内容(可能已被删除或无法读取),没有可显示的改动。',
907
+ 'changes.diffEmpty': '这个文件现在没有可显示的差异(改动可能已经被撤销)。',
908
+ // -- 面板直达差异(账本基线的只读并排 diff)
909
+ 'changes.menuViewDiff': '查看差异(只读)',
910
+ 'changes.diffNotPossible': '二进制或过大,没有可显示的差异',
911
+ 'changes.diffTabLabel': '会话改动',
812
912
  // -- 连接状态与断线降级
813
913
  'connection.ok': '连接正常',
814
914
  'connection.error': '连接异常',
@@ -825,6 +925,13 @@ const zh: Record<string, string> = {
825
925
  'connection.errorAt': '上次失败',
826
926
  'connection.detail': '诊断',
827
927
  'connection.actionFailed': '连接已断开,操作未发送;恢复后请重试。',
928
+ 'connection.egress': '出口:{egress}',
929
+ 'connection.egressConfigured': '出口(按配置):{egress}',
930
+ 'connection.egressDirect': '直连 {target}',
931
+ 'connection.egressJump': '经跳板 {jump}',
932
+ 'connection.egressHttp': '经 HTTP 代理 {proxy}',
933
+ 'connection.egressSocks5': '经 SOCKS5 代理 {proxy}',
934
+ 'connection.egressProblem': '(配置有误:{problem})',
828
935
  'files.offline': '连接已断开,且此目录没有缓存',
829
936
  // -- Ctrl+P quick open(远端文件索引 + 模糊匹配)
830
937
  'quickopen.title': '快速打开',
@@ -859,6 +966,10 @@ const zh: Record<string, string> = {
859
966
  'ports.stateListening': '监听中',
860
967
  'ports.stateError': '连接失败',
861
968
  'ports.connections': '{count} 个连接',
969
+ 'ports.transportDedicated': '独立连接',
970
+ 'ports.transportShared': '共享连接',
971
+ 'ports.transportDedicatedHint': '这条转发走该主机自己的 SSH 连接,不与浏览/命令流量挤在一条通道上。',
972
+ 'ports.transportSharedHint': '服务器拒绝了额外的 SSH 连接,这条转发回落到共享连接:仍然可用,只是不再独占通道。',
862
973
  'ports.emptyListen': '远端没有列出监听端口。',
863
974
  'ports.listenUnavailable': '无法枚举远端端口:远端既没有 ss 也没有 netstat。',
864
975
  'ports.listenUnknown': '无法枚举远端端口:探测没有返回结果。',
@@ -982,6 +1093,46 @@ const en: Record<string, string> = {
982
1093
  'form.passphrase': 'Key passphrase (optional)',
983
1094
  'form.password': 'Password',
984
1095
  'form.description': 'Note (optional)',
1096
+ // -- egress: per-host override + the profile-wide default
1097
+ 'proxy.title': 'Network egress',
1098
+ 'proxy.expand': 'Expand network egress',
1099
+ 'proxy.collapse': 'Collapse network egress',
1100
+ 'proxy.mode': 'Egress',
1101
+ 'proxy.mode.inherit': 'Follow default',
1102
+ 'proxy.mode.direct': 'Direct',
1103
+ 'proxy.mode.proxy': 'Proxy',
1104
+ 'proxy.mode.jump': 'Jump host',
1105
+ 'proxy.kind': 'Proxy type',
1106
+ 'proxy.typeHttp': 'HTTP CONNECT',
1107
+ 'proxy.typeSocks5': 'SOCKS5',
1108
+ 'proxy.shortHttp': 'HTTP',
1109
+ 'proxy.shortSocks5': 'SOCKS5',
1110
+ 'proxy.host': 'Proxy host',
1111
+ 'proxy.port': 'Port',
1112
+ 'proxy.username': 'Username (optional)',
1113
+ 'proxy.password': 'Password (optional)',
1114
+ 'proxy.passwordKeep': 'stored — leave empty to keep',
1115
+ 'proxy.jumpVia': 'Jump host',
1116
+ 'proxy.jumpMissing': '{alias} (host is gone)',
1117
+ 'proxy.jumpNone': 'No other host to use as a jump host',
1118
+ 'proxy.jumpHint': 'The SSH connection is forwarded through this host; the jump host itself must be reachable directly or through the default proxy.',
1119
+ 'proxy.chipInherit': 'Follow default',
1120
+ 'proxy.chipProxy': 'Proxy',
1121
+ 'proxy.chipJump': 'Jump {alias}',
1122
+ 'proxy.chipTitle': 'Egress: {summary}',
1123
+ 'proxy.summaryDirect': 'direct',
1124
+ 'proxy.summaryProxy': 'via {kind} proxy {host}:{port}',
1125
+ 'proxy.summaryInheritDirect': 'follow default (direct)',
1126
+ 'proxy.summaryInheritProxy': 'follow default (via {kind} proxy {host}:{port})',
1127
+ 'proxy.summaryJump': 'via jump host {alias}',
1128
+ 'proxy.default.title': 'Default network egress',
1129
+ 'proxy.default.hint': 'Hosts set to "Follow default" use this; a single host can override it in the Remote hosts form.',
1130
+ 'proxy.invalidTarget': 'A proxy needs a host name and a port between 1 and 65535',
1131
+ 'proxy.invalidJump': 'Choose a jump host',
1132
+ 'proxy.jumpGone': 'Jump host "{alias}" no longer exists — pick another',
1133
+ 'proxy.save': 'Save',
1134
+ 'proxy.saving': 'Saving…',
1135
+ 'proxy.saveFailed': 'Save failed: {message}',
985
1136
  'deploy.notDeployed': 'not pushed',
986
1137
  'deploy.ok': 'pushed',
987
1138
  'deploy.skipped': 'up to date (skipped)',
@@ -1457,7 +1608,7 @@ const en: Record<string, string> = {
1457
1608
  'preview.remoteTitle': 'Remote file cannot be previewed',
1458
1609
  'preview.remoteHint': 'The Host refused this byte-read path.',
1459
1610
  'preview.officeUnavailableTitle': 'LibreOffice is not available on the remote host',
1460
- 'preview.officeUnavailableHint': 'The host officeKit is unavailable and the remote host has no LibreOffice, so this document cannot be converted.',
1611
+ 'preview.officeUnavailableHint': 'The host officeKit is unavailable and the remote host has no LibreOffice, so this document cannot be converted. Install the host kit with: npm install @deepseek-ai/libreoffice-kit@latest — or install libreoffice on the remote host.',
1461
1612
  'preview.truncated': 'File is too large; only the loaded part is previewed.',
1462
1613
  'preview.tableTruncated': 'Data exceeds {rows} rows / {cells} cells; only the first part was parsed.',
1463
1614
  'preview.tableHiddenRows': 'Only the first {shown} rows are shown; {rest} more are hidden.',
@@ -1582,6 +1733,23 @@ const en: Record<string, string> = {
1582
1733
  'git.notARepo': 'This remote workspace is not a git repository.',
1583
1734
  // -- session change panel (above the composer)
1584
1735
  'changes.title': 'Changed files',
1736
+ 'changes.scopeLabel': 'Change scope',
1737
+ 'changes.scopeSession': 'Session total',
1738
+ 'changes.scopeTurn': 'This turn',
1739
+ 'changes.scopeSessionHint': 'Everything this session changed, measured from the session baseline',
1740
+ 'changes.scopeTurnHint': 'Only what the most recent completed turn changed (earlier turns are not included)',
1741
+ 'changes.turnTitle': 'Turn #{turn} · {time}',
1742
+ 'changes.turnEmpty': 'This turn changed no file.',
1743
+ 'changes.turnStatsOnly': 'This turn has totals only: its contents exceeded the host memory budget, so there are no change marks and nothing can be reverted (the session-total view is unaffected).',
1744
+ 'changes.turnUnavailable': 'No turn contents to show for this file',
1745
+ 'changes.turnStaleFallback': 'This file was modified after the turn closed, so the session-total view is used instead.',
1746
+ 'changes.turnMarksStale': 'The turn comparison is out of date (the file changed after the turn closed); its marks were cleared.',
1747
+ 'changes.turnDiffDisabled': 'The turn view opens the file only; use the session-total view for the side-by-side diff',
1748
+ 'changes.turnPending': 'This turn is still waiting for its new-file scan: the same turn is recomputed, so the list may still grow.',
1749
+ 'changes.turnPartial': 'This turn view is incomplete: some files could not be attributed (the previous side was unknown, the list exceeded the file cap, or the previous turn\'s scan never landed) and were skipped.',
1750
+ 'changes.turnRevertedHidden': 'Reverted in this turn: {n} file(s), hidden from the list.',
1751
+ 'changes.turnRevertedAll': 'All changes from this turn have been reverted.',
1752
+ 'changes.turnRevertNotPossible': 'The turn view keeps reverse patches only and offers no "undo the new file"; delete it from the session-total view or the Source Control panel.',
1585
1753
  'changes.onlyUnreviewed': 'Only unreviewed',
1586
1754
  'changes.nextUnreviewed': 'Next unreviewed',
1587
1755
  'changes.allReviewed': 'All reviewed',
@@ -1622,7 +1790,7 @@ const en: Record<string, string> = {
1622
1790
  'changes.navLabel': 'Change navigation',
1623
1791
  'changes.refresh': 'Recompute changes',
1624
1792
  'changes.stale': 'positions stale',
1625
- 'changes.staleHint': 'The editor content changed, so the marked positions may be off. Click the file in the list to recompute.',
1793
+ 'changes.staleHint': 'The change list or the editor content moved on, so these marks may be out of date. Click the file in the list to recompute.',
1626
1794
  'changes.noWorkspace': 'No workspace is bound to that host, so the file cannot be opened.',
1627
1795
  // -- editor gutter marks and deleted chips (title / aria-label in vsc/change-marks.ts)
1628
1796
  'changes.markAdd': 'Added line',
@@ -1639,6 +1807,27 @@ const en: Record<string, string> = {
1639
1807
  'changes.undoNoContext': 'The host and repository behind this change are unknown, so nothing was reverted.',
1640
1808
  'changes.undoConflict': 'The surroundings of this change moved, so the host refused the revert (the file was not modified).',
1641
1809
  'changes.undoMissing': 'No patch is available for this change, so nothing was reverted.',
1810
+ // -- why a revert failed (git apply stderr → four actionable readings)
1811
+ 'changes.applyContextMoved': 'The remote file has moved on, so the patch no longer applies (the file was not modified).',
1812
+ 'changes.applyPathMissing': 'The file the patch names is gone on the remote side (deleted or renamed).',
1813
+ 'changes.applyPermission': 'The remote side refused the write (permission denied or a read-only filesystem).',
1814
+ 'changes.applyOwnership': 'The remote repository is owned by a different user, so git refuses: set safe.directory or fix the ownership.',
1815
+ 'changes.applyCorrupt': 'The patch is incomplete or corrupt; reopen the file to fetch the change again, then retry.',
1816
+ 'changes.applyOther': 'The remote side refused this patch; the raw message follows.',
1817
+ // -- the hover bar's second action: a block-level local "keep" note
1818
+ 'changes.actions': 'Change actions',
1819
+ 'changes.confirmBlock': 'Keep this change',
1820
+ 'changes.confirmedBlock': 'Kept',
1821
+ // -- the five visible outcomes when one row's diff is fetched
1822
+ 'changes.diffTruncated': 'The remote withheld this change at its byte cap, so the comparison is incomplete (it may count the whole file as changed): nothing is marked and nothing can be reverted.',
1823
+ 'changes.diffOversized': 'The file is too large and its content was withheld, so there is no line-level comparison (no change marks, no undo); open the file to read it.',
1824
+ 'changes.diffBinary': 'This is a binary file: there is no text diff, so no change marks are drawn.',
1825
+ 'changes.diffMissing': 'The file could not be read on the remote side (deleted or unreadable), so there is no change to show.',
1826
+ 'changes.diffEmpty': 'This file has no diff to show right now (the change may have been reverted).',
1827
+ // -- straight to a diff from the panel (read-only, ledger baseline)
1828
+ 'changes.menuViewDiff': 'View diff (read-only)',
1829
+ 'changes.diffNotPossible': 'Binary or too large: there is no diff to show',
1830
+ 'changes.diffTabLabel': 'Session change',
1642
1831
  // -- connection status + degraded (offline read-only) mode
1643
1832
  'connection.ok': 'Connection OK',
1644
1833
  'connection.error': 'Connection issue',
@@ -1655,6 +1844,13 @@ const en: Record<string, string> = {
1655
1844
  'connection.errorAt': 'Last failure',
1656
1845
  'connection.detail': 'Diagnostics',
1657
1846
  'connection.actionFailed': 'The connection is down, so the action was not sent; try again after it recovers.',
1847
+ 'connection.egress': 'Egress: {egress}',
1848
+ 'connection.egressConfigured': 'Egress (configured): {egress}',
1849
+ 'connection.egressDirect': 'direct to {target}',
1850
+ 'connection.egressJump': 'via jump host {jump}',
1851
+ 'connection.egressHttp': 'via HTTP proxy {proxy}',
1852
+ 'connection.egressSocks5': 'via SOCKS5 proxy {proxy}',
1853
+ 'connection.egressProblem': ' (misconfigured: {problem})',
1658
1854
  'files.offline': 'Connection lost, and this folder has no cached listing',
1659
1855
  // -- Ctrl+P quick open (remote file index + fuzzy matching)
1660
1856
  'quickopen.title': 'Quick open',
@@ -1689,6 +1885,10 @@ const en: Record<string, string> = {
1689
1885
  'ports.stateListening': 'Listening',
1690
1886
  'ports.stateError': 'Connection failed',
1691
1887
  'ports.connections': 'Connections: {count}',
1888
+ 'ports.transportDedicated': 'Dedicated',
1889
+ 'ports.transportShared': 'Shared',
1890
+ 'ports.transportDedicatedHint': 'This forward uses the host\'s own SSH connection, so its traffic never queues behind browse/exec channels.',
1891
+ 'ports.transportSharedHint': 'The server refused an extra SSH connection, so this forward fell back to the shared one: it still works, only without its own channel.',
1692
1892
  'ports.emptyListen': 'The remote host listed no listening ports.',
1693
1893
  'ports.listenUnavailable': 'Cannot enumerate remote ports: neither ss nor netstat is available on the host.',
1694
1894
  'ports.listenUnknown': 'Cannot enumerate remote ports: the probe did not answer.',
@@ -627,7 +627,9 @@ export function DiffView(props: { tab: EditorTab; visible: boolean; offline?: bo
627
627
 
628
628
  // Seed the editable buffer the first time the "变更后" pane is shown.
629
629
  useEffect(() => {
630
- if (mode !== 'after' || tab.staged || tab.text !== '' || tab.loading) return
630
+ // A session diff's "after" side is a read-only pane (§sessionReadOnly): there
631
+ // is no buffer to seed, so no extra read either.
632
+ if (mode !== 'after' || tab.staged || tab.sessionDiff !== undefined || tab.text !== '' || tab.loading) return
631
633
  let cancelled = false
632
634
  void (async () => {
633
635
  try {
@@ -674,7 +676,7 @@ export function DiffView(props: { tab: EditorTab; visible: boolean; offline?: bo
674
676
  */
675
677
  const codeSide = mode === 'before'
676
678
  ? beforeSide
677
- : mode === 'after' && tab.staged
679
+ : mode === 'after' && (tab.staged || tab.sessionDiff !== undefined)
678
680
  ? afterSide
679
681
  : NO_TOKENS
680
682
  const codeWindow = useScrollWindow(codeSide.lineCount, CODE_PAD_TOP)
@@ -847,7 +849,15 @@ export function DiffView(props: { tab: EditorTab; visible: boolean; offline?: bo
847
849
  )
848
850
  }
849
851
 
850
- const editable = mode === 'after' && !tab.staged && props.offline !== true && !tab.truncated
852
+ /**
853
+ * 会话改动面板打开的只读 diff(`EditorTab.sessionDiff`)。
854
+ *
855
+ * 它比较的是**会话账本**(会话起点为基线),两侧都不是"可写的工作区副本":改前
856
+ * 是按 hunk 还原出来的基线,改后是一次独立读取。所以既不能编辑「变更后」,也不能
857
+ * 提供 hunk 的暂存/撤销 —— 那些动作的入参是 `git diff` 的补丁,不是这里的。
858
+ */
859
+ const sessionReadOnly = tab.sessionDiff !== undefined
860
+ const editable = mode === 'after' && !tab.staged && !sessionReadOnly && props.offline !== true && !tab.truncated
851
861
  /**
852
862
  * The gutter hunk buttons obey the same refusal as `runHunk` (see
853
863
  * `hunkBlockReason`), and a disabled button names the REAL reason when it has
@@ -893,13 +903,19 @@ export function DiffView(props: { tab: EditorTab; visible: boolean; offline?: bo
893
903
  the exact reason whenever the binding gate refuses. The glyph is
894
904
  text because the icon set has no "AI" mark — the same precedent as
895
905
  the search options' `Aa` / `.*` glyphs in `kit.tsx`. */}
896
- <IconButton
897
- title={reviewBlocked ?? t('scm.aiReview')}
898
- onClick={reviewWithAi}
899
- disabled={reviewBlocked !== undefined}
900
- >
901
- <span className="rvs-glyph" aria-hidden="true" style={{ fontSize: 12 }}>AI</span>
902
- </IconButton>
906
+ {/* 会话只读 diff 不提供 AI 审查:那条 prompt 写的是"哪个工作区/仓库目录/
907
+ 哪个路径"(`store.alias` + `store.repoRoot`),而这一页的基线是会话账本、
908
+ 路径是面板的显示路径 —— 两者可能不是同一个绑定,指错地方的 prompt 比没有
909
+ 更糟。要审查会话改动,从面板左键打开文件那条路走。 */}
910
+ {!sessionReadOnly && (
911
+ <IconButton
912
+ title={reviewBlocked ?? t('scm.aiReview')}
913
+ onClick={reviewWithAi}
914
+ disabled={reviewBlocked !== undefined}
915
+ >
916
+ <span className="rvs-glyph" aria-hidden="true" style={{ fontSize: 12 }}>AI</span>
917
+ </IconButton>
918
+ )}
903
919
  <IconButton title={t('scm.reloadDiff')} onClick={() => { void reload() }} disabled={busy}>
904
920
  <IconRefresh size={13} />
905
921
  </IconButton>
@@ -957,9 +973,12 @@ export function DiffView(props: { tab: EditorTab; visible: boolean; offline?: bo
957
973
  // index is the lookup — the linear `find` was one scan per row.
958
974
  const hunk = row.hunk >= 0 ? model.hunks[row.hunk] : undefined
959
975
  const startOfHunk = hunk !== undefined && hunk.startRow === row.id
976
+ // 只读的会话 diff 没有 hunk 写动作:整行只留一个色点(指示"这里
977
+ // 有一处改动"),不给暂存/撤销那两个会打到别处的按钮。
978
+ const changed = row.oldDel || row.newAdd
960
979
  return (
961
980
  <div key={row.id} className="rvs-gutter-line">
962
- {startOfHunk && hunk !== undefined && (
981
+ {startOfHunk && hunk !== undefined && !sessionReadOnly && (
963
982
  <span className="rvs-hunk-btns">
964
983
  {hunkBusy === hunk.index
965
984
  ? <MiniSpinner />
@@ -989,7 +1008,7 @@ export function DiffView(props: { tab: EditorTab; visible: boolean; offline?: bo
989
1008
  )}
990
1009
  </span>
991
1010
  )}
992
- {!startOfHunk && (row.oldDel || row.newAdd) && (
1011
+ {(!startOfHunk || sessionReadOnly) && changed && (
993
1012
  <span className="rvs-gutter-dot" style={{ background: row.oldDel ? 'var(--rvs-git-d)' : 'var(--rvs-git-a)' }} />
994
1013
  )}
995
1014
  </div>
@@ -1021,7 +1040,7 @@ export function DiffView(props: { tab: EditorTab; visible: boolean; offline?: bo
1021
1040
  </div>
1022
1041
  )}
1023
1042
  {mode === 'after' && (
1024
- tab.staged
1043
+ tab.staged || sessionReadOnly
1025
1044
  ? (
1026
1045
  <div className="rvs-code rvs-scroll" ref={codeWindow.attach} onScroll={codeWindow.onScroll}>
1027
1046
  <CodeLines tokens={codeSide} range={codeWindow.range} emptyText={t('scm.emptySide')} />