dsh-remote-vs 0.25.0 → 0.27.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 (109) hide show
  1. package/README.en.md +12 -15
  2. package/README.md +11 -12
  3. package/THIRD-PARTY-NOTICES.md +193 -0
  4. package/lib/client.js +7313 -79961
  5. package/lib/index.js +1529 -964
  6. package/lib/p2-router-fs.js +1 -1
  7. package/lib/types/client/CodeEditor.d.ts +22 -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/RemoteExplorer.d.ts +53 -0
  11. package/lib/types/client/api.d.ts +42 -3
  12. package/lib/types/client/blame-model.d.ts +77 -0
  13. package/lib/types/client/changes/review-state.d.ts +19 -0
  14. package/lib/types/client/connection.d.ts +16 -0
  15. package/lib/types/client/i18n.d.ts +1 -1
  16. package/lib/types/client/outline-model.d.ts +59 -0
  17. package/lib/types/client/request-gate.d.ts +110 -0
  18. package/lib/types/client/scm/DiffView.d.ts +45 -7
  19. package/lib/types/client/scm/actions.d.ts +43 -4
  20. package/lib/types/client/store.d.ts +71 -0
  21. package/lib/types/client/vsc/FindWidget.d.ts +6 -0
  22. package/lib/types/client/vsc/blame.d.ts +19 -0
  23. package/lib/types/client/vsc/change-marks.d.ts +16 -6
  24. package/lib/types/client/vsc/editor-keymap.d.ts +35 -1
  25. package/lib/types/client/vsc/kit.d.ts +11 -2
  26. package/lib/types/client/vsc/preview-document.d.ts +46 -0
  27. package/lib/types/client/vsc/preview-model.d.ts +31 -0
  28. package/lib/types/client/vsc/preview-services.d.ts +24 -0
  29. package/lib/types/client/vsc/save-shortcut.d.ts +21 -0
  30. package/lib/types/client/vsc/terminal-theme.d.ts +28 -2
  31. package/lib/types/forward.d.ts +12 -0
  32. package/lib/types/fs-ops.d.ts +42 -0
  33. package/lib/types/git-ops.d.ts +18 -0
  34. package/lib/types/http.d.ts +2 -0
  35. package/lib/types/keygen.d.ts +9 -0
  36. package/lib/types/monitor.d.ts +8 -0
  37. package/lib/types/notices.d.ts +16 -1
  38. package/lib/types/p2/helper-rpc.d.ts +45 -0
  39. package/lib/types/processes.d.ts +43 -0
  40. package/lib/types/protocol.d.ts +34 -0
  41. package/lib/types/routes.d.ts +2 -0
  42. package/lib/types/store.d.ts +7 -0
  43. package/lib/types/terminal.d.ts +8 -0
  44. package/lib/types/view-settings.d.ts +5 -0
  45. package/lib/{worlds-B7gEDBzC.js → worlds-RG8K5eom.js} +113 -15
  46. package/package.json +3 -1
  47. package/src/client/CodeEditor.tsx +194 -9
  48. package/src/client/DirectoryFlow.tsx +16 -0
  49. package/src/client/DoctorPanel.tsx +70 -7
  50. package/src/client/EditorPane.tsx +574 -42
  51. package/src/client/HostsView.tsx +12 -3
  52. package/src/client/MonitorView.tsx +16 -5
  53. package/src/client/OutlinePanel.tsx +287 -0
  54. package/src/client/ProcessesSection.tsx +292 -0
  55. package/src/client/RemoteDirectoryPicker.tsx +12 -0
  56. package/src/client/RemoteExplorer.tsx +929 -40
  57. package/src/client/RemoteRoot.tsx +147 -22
  58. package/src/client/SearchView.tsx +8 -0
  59. package/src/client/TerminalSnippets.tsx +83 -8
  60. package/src/client/api.ts +114 -13
  61. package/src/client/blame-model.ts +242 -0
  62. package/src/client/changes/ChangesDock.tsx +188 -6
  63. package/src/client/changes/changes.css +10 -3
  64. package/src/client/changes/review-state.ts +34 -0
  65. package/src/client/connection.ts +29 -0
  66. package/src/client/downloads.ts +49 -4
  67. package/src/client/i18n.ts +276 -8
  68. package/src/client/index.tsx +4 -0
  69. package/src/client/outline-model.ts +775 -0
  70. package/src/client/request-gate.ts +221 -0
  71. package/src/client/scm/CommitPane.tsx +20 -2
  72. package/src/client/scm/DiffView.tsx +343 -117
  73. package/src/client/scm/HistoryPanel.tsx +61 -3
  74. package/src/client/scm/RepoPicker.tsx +1 -1
  75. package/src/client/scm/ScmPanel.tsx +391 -87
  76. package/src/client/scm/actions.ts +150 -14
  77. package/src/client/store.tsx +426 -14
  78. package/src/client/ui.tsx +4 -0
  79. package/src/client/vsc/FindWidget.tsx +24 -9
  80. package/src/client/vsc/blame.ts +147 -0
  81. package/src/client/vsc/breadcrumb.tsx +91 -3
  82. package/src/client/vsc/change-marks.ts +93 -44
  83. package/src/client/vsc/editor-keymap.ts +59 -1
  84. package/src/client/vsc/file-icons.tsx +17 -3
  85. package/src/client/vsc/kit.tsx +29 -20
  86. package/src/client/vsc/preview-document.tsx +323 -0
  87. package/src/client/vsc/preview-model.ts +216 -0
  88. package/src/client/vsc/preview-services.ts +118 -0
  89. package/src/client/vsc/save-shortcut.ts +47 -1
  90. package/src/client/vsc/terminal-theme.ts +44 -18
  91. package/src/client/vsc/vsc.css +6509 -5458
  92. package/src/forward.ts +47 -9
  93. package/src/fs-ops.ts +124 -4
  94. package/src/git-ops.ts +54 -3
  95. package/src/http.ts +35 -4
  96. package/src/keygen.ts +55 -4
  97. package/src/monitor.ts +13 -0
  98. package/src/notices.ts +23 -1
  99. package/src/p2/helper-rpc.ts +113 -7
  100. package/src/p2/worlds.ts +14 -1
  101. package/src/processes.ts +177 -0
  102. package/src/protocol.ts +37 -0
  103. package/src/routes.ts +330 -43
  104. package/src/sftp.ts +51 -14
  105. package/src/store.ts +10 -0
  106. package/src/terminal.ts +73 -26
  107. package/src/view-settings.ts +50 -10
  108. package/lib/types/client/Dialog.d.ts +0 -14
  109. package/src/client/Dialog.tsx +0 -76
@@ -88,13 +88,55 @@ const listeners = new Set<() => void>()
88
88
  const controllers = new Map<string, AbortController>()
89
89
  let sequence = 0
90
90
 
91
- const notify = (): void => {
91
+ /**
92
+ * Minimum gap between two PROGRESS notifications, in ms.
93
+ *
94
+ * The transfer callbacks fire once per fetched chunk (commonly 64 KiB), so a
95
+ * fast download notified the dock — and re-rendered every row it draws —
96
+ * hundreds of times per second, while the bar moves by less than a pixel.
97
+ * Coalescing on a ~10 Hz cadence keeps the bar visibly live and the task table
98
+ * synchronous: `tasks` is still patched on every chunk, only the "something
99
+ * changed" signal is rate-limited. A terminal status NEVER waits for this timer
100
+ * (see `notify`) — a finished task must appear finished at once.
101
+ */
102
+ const PROGRESS_NOTIFY_MS = 100
103
+
104
+ /** The pending coalesced notification, if one is scheduled. */
105
+ let progressTimer: ReturnType<typeof setTimeout> | undefined
106
+
107
+ const emit = (): void => {
92
108
  for (const listener of [...listeners]) listener()
93
109
  }
94
110
 
95
- const patch = (id: string, next: Partial<DownloadTask>): void => {
111
+ /** Immediate notification: drops any queued progress tick, so final states win. */
112
+ const notify = (): void => {
113
+ if (progressTimer !== undefined) {
114
+ clearTimeout(progressTimer)
115
+ progressTimer = undefined
116
+ }
117
+ emit()
118
+ }
119
+
120
+ /** At most one queued notification per `PROGRESS_NOTIFY_MS` window. */
121
+ const notifyProgress = (): void => {
122
+ if (progressTimer !== undefined) return
123
+ progressTimer = setTimeout(() => {
124
+ progressTimer = undefined
125
+ emit()
126
+ }, PROGRESS_NOTIFY_MS)
127
+ }
128
+
129
+ /**
130
+ * Patch one task and notify.
131
+ *
132
+ * `coalesce` is for the per-chunk progress path only: it updates the snapshot
133
+ * at once (readers/`waitTask` see it) but announces the change on the throttled
134
+ * cadence. Every status transition stays on the immediate path.
135
+ */
136
+ const patch = (id: string, next: Partial<DownloadTask>, coalesce = false): void => {
96
137
  tasks = tasks.map(task => (task.id === id ? { ...task, ...next } : task))
97
- notify()
138
+ if (coalesce) notifyProgress()
139
+ else notify()
98
140
  }
99
141
 
100
142
  /** Store surface: `useSyncExternalStore(subscribe, getSnapshot, getSnapshot)`. */
@@ -129,10 +171,13 @@ const launch = (id: string, controller: AbortController, run: (options: RunnerOp
129
171
  signal: controller.signal,
130
172
  onProgress: (progress) => {
131
173
  if (controller.signal.aborted) return
174
+ // The task table is patched on every chunk; only the dock's repaint is
175
+ // coalesced (see PROGRESS_NOTIFY_MS) — a dropped chunk would make the
176
+ // byte counter lag its own progress bar.
132
177
  patch(id, {
133
178
  loaded: progress.loaded,
134
179
  ...(progress.total === undefined ? {} : { total: progress.total }),
135
- })
180
+ }, true)
136
181
  },
137
182
  })
138
183
  if (outcome === 'handedOff') {
@@ -79,6 +79,28 @@ export const DYNAMIC_KEYS = [
79
79
  'editor.crumbLabel',
80
80
  'editor.crumbUp',
81
81
  'editor.crumbEmpty',
82
+ // Outline kind labels are chosen through a `kind` → key lookup in
83
+ // `OutlinePanel.tsx`, not a literal t() call.
84
+ 'outline.kind.class',
85
+ 'outline.kind.interface',
86
+ 'outline.kind.struct',
87
+ 'outline.kind.enum',
88
+ 'outline.kind.trait',
89
+ 'outline.kind.impl',
90
+ 'outline.kind.namespace',
91
+ 'outline.kind.module',
92
+ 'outline.kind.function',
93
+ 'outline.kind.method',
94
+ 'outline.kind.constructor',
95
+ 'outline.kind.field',
96
+ 'outline.kind.variable',
97
+ 'outline.kind.type',
98
+ 'outline.kind.macro',
99
+ // Chosen by preview kind at runtime in preview-document.tsx.
100
+ 'preview.officeUnavailableTitle',
101
+ 'preview.unavailableTitle',
102
+ 'preview.officeUnavailableHint',
103
+ 'preview.unavailableHint',
82
104
  'editor.imageHint',
83
105
  'editor.imageFitHint',
84
106
  'editor.imageFailedHint',
@@ -210,6 +232,9 @@ const zh: Record<string, string> = {
210
232
  'files.referenceFile': '@文件',
211
233
  'files.addToConversation': '添加到对话',
212
234
  'editor.save': '保存',
235
+ 'editor.gotoLine': '转到行',
236
+ 'editor.gotoLineText': '跳转到行(共 {total} 行):',
237
+ 'editor.gotoLineInvalid': '行号无效',
213
238
  'editor.saving': '保存中…',
214
239
  'editor.saved': '已保存',
215
240
  'editor.unsaved': '● 未保存',
@@ -269,7 +294,7 @@ const zh: Record<string, string> = {
269
294
  'flow.mkdir': '新建文件夹',
270
295
  'flow.mkdirName': '文件夹名',
271
296
  'flow.create': '创建',
272
- 'flow.noHosts': '还没有主机。先去「设置 → 远程主机」配置,再回来添加远端工作区。',
297
+ 'flow.noHosts': '还没有主机。先去「设置 → 远程主机」配置,再回来添加远程工作区。',
273
298
  'flow.retry': '重试',
274
299
  'flow.truncated': '条目过多,仅显示前一部分。',
275
300
  'route.mode': '路由模式',
@@ -299,10 +324,14 @@ const zh: Record<string, string> = {
299
324
  'files.created': '已创建',
300
325
  'files.renamed': '已重命名',
301
326
  'files.deleted': '已删除',
327
+ 'files.openInTerminal': '在终端中打开',
302
328
  'files.items': '个项目',
303
329
  'files.deleteTitle': '删除',
304
330
  'files.delete': '删除',
305
331
  'files.deleteConfirm': '确定删除 {target} 吗?此操作在远端不可撤销。',
332
+ 'files.deleting': '删除中 {done}/{total} · {name}',
333
+ 'files.deleteCancel': '取消删除',
334
+ 'files.deleteCancelled': '已取消删除:已删除 {removed} 项,{left} 项未处理。',
306
335
  'files.open': '打开',
307
336
  'files.openAsText': '以文本打开',
308
337
  'files.openInFloat': '在悬浮编辑器中打开',
@@ -392,7 +421,7 @@ const zh: Record<string, string> = {
392
421
  'scm.commit': '提交',
393
422
  'scm.committing': '提交中',
394
423
  'scm.commitPlaceholder': '提交变更内容(Ctrl+Enter 提交)',
395
- 'scm.commitHint': '先暂存更改,再提交',
424
+ 'scm.commitHint': '先暂存更改,再提交(提交框内按 Ctrl+Enter 可直接提交)',
396
425
  'scm.commitNeedsStage': '还没有暂存的更改 — 先点击 + 暂存文件。',
397
426
  'scm.amend': '修改上次提交信息',
398
427
  'scm.amendTitle': '修改上次提交',
@@ -475,6 +504,17 @@ const zh: Record<string, string> = {
475
504
  'scm.syncText': '将执行 git pull 然后 git push。',
476
505
  'scm.syncDone': '同步完成',
477
506
  'scm.branches': '分支',
507
+ 'scm.initRepo': '初始化仓库',
508
+ 'scm.initRepoText': '将在 {path} 初始化一个 Git 仓库。',
509
+ 'scm.initRepoDone': '仓库已初始化',
510
+ 'scm.renameBranch': '重命名分支',
511
+ 'scm.renameBranchText': '将分支 {branch} 重命名为:',
512
+ 'scm.renameBranchInvalid': '分支名不能为空或与原分支相同',
513
+ 'scm.renameBranchDone': '分支已重命名',
514
+ 'scm.setRemoteUrl': '修改远程 URL',
515
+ 'scm.setRemoteUrlText': '修改远程 {name} 的 URL:',
516
+ 'scm.remoteUrlEmpty': '远程 URL 不能为空',
517
+ 'scm.setRemoteUrlDone': '远程 URL 已更新',
478
518
  'scm.remotes': '远程',
479
519
  'scm.newBranch': '新分支名',
480
520
  'scm.create': '创建',
@@ -574,6 +614,35 @@ const zh: Record<string, string> = {
574
614
  'history.diffToolbar': '补丁工具',
575
615
  'editor.preview': '预览',
576
616
  'editor.source': '源码',
617
+ 'preview.converting': '正在由远端 LibreOffice 转换为 PDF…',
618
+ 'preview.convertingHint': '由宿主 LibreOffice 转换,首次打开通常需要几秒。',
619
+ 'preview.failedTitle': '无法预览这个文件',
620
+ 'preview.failedHint': '文件可能已损坏、格式不受支持,或转换失败。',
621
+ 'preview.tooLargeTitle': '文件过大,无法预览',
622
+ 'preview.tooLargeHint': '超出宿主或插件的读取上限;可以用原生应用打开它。',
623
+ 'preview.unavailableTitle': '当前没有可用的预览服务',
624
+ 'preview.unavailableHint': '宿主没有挂载所需的文件/Office 服务,插件会退回自己的下载通道。',
625
+ 'preview.notFoundTitle': '文件已不在磁盘上',
626
+ 'preview.notFoundHint': '它可能已被删除、改名或移出工作区。',
627
+ 'preview.remoteTitle': '远端文件无法预览',
628
+ 'preview.remoteHint': '宿主拒绝了这条字节读取路径。',
629
+ 'preview.officeUnavailableTitle': '远端没有 LibreOffice',
630
+ 'preview.officeUnavailableHint': '宿主 officeKit 不可用,远端也没有安装 LibreOffice,因此无法转换这个文档。',
631
+ 'preview.truncated': '文件过大,只预览了已加载的部分。',
632
+ 'preview.tableTruncated': '数据超过 {rows} 行 / {cells} 个单元格,只解析了前面部分。',
633
+ 'preview.tableHiddenRows': '只显示了前 {shown} 行,还有 {rest} 行未显示。',
634
+ 'preview.tableHiddenColumns': '只显示了前 {shown} 列,还有 {rest} 列未显示。',
635
+ 'preview.tableEmptyTitle': '空表格',
636
+ 'preview.tableEmptyHint': '这个文件没有可显示的行。',
637
+ 'preview.documentHint': '翻页 / 缩放由浏览器内置阅读器提供',
638
+ 'preview.mediaUnsupported': '浏览器不支持这个容器或编码',
639
+ 'preview.svgFailed': 'SVG 无法渲染',
640
+ 'preview.svgFailedHint': '文件不是合法的 SVG。切到源码可以查看并修正标记。',
641
+ 'preview.svgHint': 'SVG 以图片方式渲染:脚本不会执行。',
642
+ 'preview.copyCode': '复制代码',
643
+ 'preview.copied': '已复制',
644
+ 'preview.footnotes': '脚注',
645
+ 'common.retry': '重试',
577
646
  'editor.imageFailed': '图片读取失败。',
578
647
  'editor.closeDirty': '有未保存的修改',
579
648
  'editor.discardClose': '放弃并关闭',
@@ -604,6 +673,34 @@ const zh: Record<string, string> = {
604
673
  'editor.tabsLabel': '打开的编辑器',
605
674
  'editor.diffSuffix': '(差异)',
606
675
  'editor.wrap': '自动换行',
676
+ 'editor.blameToggle': '行内 blame(作者 + 时间,点击查看提交)',
677
+ 'editor.blameOpenCaret': '打开光标所在行的提交',
678
+ 'editor.fileHistory': '文件历史',
679
+ 'editor.fileHistoryEmpty': '这个文件没有提交历史。',
680
+ 'editor.outline': '大纲',
681
+ 'outline.title': '文件大纲',
682
+ 'outline.placeholder': '筛选符号…',
683
+ 'outline.hint': '↑↓ 选择 · Enter 跳转 · Esc 关闭',
684
+ 'outline.empty': '这个文件里没有可识别的符号。',
685
+ 'outline.noResults': '没有匹配的符号。',
686
+ 'outline.more': '结果已截断,共匹配 {total} 条,只显示前 {count} 条;继续输入可以缩小范围。',
687
+ 'outline.truncated': '文件符号太多,只列出前 {count} 个。',
688
+ 'outline.guessed': '未识别该文件的语言:大纲按缩进与关键字猜测,可能不准确。',
689
+ 'outline.kind.class': '类',
690
+ 'outline.kind.interface': '接口',
691
+ 'outline.kind.struct': '结构',
692
+ 'outline.kind.enum': '枚举',
693
+ 'outline.kind.trait': 'trait',
694
+ 'outline.kind.impl': 'impl',
695
+ 'outline.kind.namespace': '命名空间',
696
+ 'outline.kind.module': '模块',
697
+ 'outline.kind.function': '函数',
698
+ 'outline.kind.method': '方法',
699
+ 'outline.kind.constructor': '构造',
700
+ 'outline.kind.field': '字段',
701
+ 'outline.kind.variable': '变量',
702
+ 'outline.kind.type': '类型',
703
+ 'outline.kind.macro': '宏',
607
704
  'editor.fontSmaller': '减小字号(Ctrl+滚轮)',
608
705
  'editor.fontLarger': '增大字号(Ctrl+滚轮)',
609
706
  'editor.openInCenter': '在会话区全宽打开',
@@ -613,7 +710,7 @@ const zh: Record<string, string> = {
613
710
  'editor.dockEmptyHint': '从资源管理器或搜索结果中打开一个文件',
614
711
  'editor.centerEmptyTitle': '远程编辑器',
615
712
  'editor.centerEmptyHint': '从侧边栏的「资源管理器」或「搜索」打开一个文件,它会在这里全宽显示。',
616
- 'editor.emptyShortcuts': 'Ctrl+S 保存 · Ctrl+F 查找 · Ctrl+滚轮缩放字号',
713
+ 'editor.emptyShortcuts': 'Ctrl+S 保存 · Ctrl+F 查找 · Ctrl+P 快速打开 · Ctrl+滚轮缩放字号',
617
714
  'editor.statusSaving': '保存中…',
618
715
  'editor.statusClean': '已保存',
619
716
  'editor.statusLanguage': '语言',
@@ -643,9 +740,21 @@ const zh: Record<string, string> = {
643
740
  'editor.imageTooLargeTitle': '图片过大',
644
741
  'editor.imageTooLargeHint': '大小 {size} KiB,超出读取上限,不提供预览。',
645
742
  'editor.switchToEdit': '切换为内容编辑(在编辑器里打开这个文件)',
743
+ // -- 编辑器内查找(vsc/FindWidget.tsx:输入框与三个开关/前后跳转/关闭)
744
+ 'find.placeholder': '查找',
745
+ 'find.caseSensitive': '区分大小写(Aa)',
746
+ 'find.wholeWord': '全字匹配(ab_)',
747
+ 'find.regexp': '正则表达式(.*)',
748
+ 'find.noResults': '无结果',
749
+ 'find.prev': '上一个(Shift+Enter)',
750
+ 'find.next': '下一个(Enter)',
751
+ 'find.close': '关闭(Esc)',
646
752
  'git.notARepo': '当前远端工作区不是 git 仓库。',
647
753
  // -- session change panel (above the composer)
648
754
  'changes.title': '本次改动',
755
+ 'changes.onlyUnreviewed': '只看未审阅',
756
+ 'changes.nextUnreviewed': '下一个未审阅',
757
+ 'changes.allReviewed': '全部已审阅',
649
758
  'changes.toggle': '展开或收起本次会话的改动文件',
650
759
  'changes.empty': '本会话还没有改动文件。',
651
760
  'changes.pending': '正在统计…',
@@ -685,6 +794,13 @@ const zh: Record<string, string> = {
685
794
  'changes.stale': '位置已过期',
686
795
  'changes.staleHint': '编辑器内容已改动,改动位置可能不准。点击列表里的文件重新计算。',
687
796
  'changes.noWorkspace': '找不到该主机对应的工作区,无法打开文件。',
797
+ // -- 编辑器 gutter 标记与删除 chip(vsc/change-marks.ts 的 title / aria-label)
798
+ 'changes.markAdd': '新增行',
799
+ 'changes.markMod': '修改行',
800
+ 'changes.markDel': '删除行',
801
+ 'changes.deletedChip': '已删除的内容',
802
+ 'changes.deletedBlock': '已删除的整块内容({count} 行)',
803
+ 'changes.deletedLines': '−{count} 行已删除',
688
804
  // -- 悬浮在改动行上撤销这一处改动
689
805
  'changes.undoAction': '撤销这处改动',
690
806
  'changes.undoActionDelete': '撤销这处删除',
@@ -791,6 +907,35 @@ const zh: Record<string, string> = {
791
907
  'monitor.interval10': '10 秒',
792
908
  'monitor.interval30': '30 秒',
793
909
  'monitor.linuxOnly': '完整指标来自 Linux /proc;其他平台显示为未知。',
910
+ 'proc.title': '进程',
911
+ 'proc.host': '主机',
912
+ 'proc.filter': '过滤命令 / 用户 / PID',
913
+ 'proc.sort': '排序',
914
+ 'proc.sortCpu': '按 CPU(平均值)',
915
+ 'proc.sortMem': '按内存',
916
+ 'proc.sortPid': '按 PID',
917
+ 'proc.refresh': '刷新进程表',
918
+ 'proc.elapsed': '运行时长',
919
+ 'proc.command': '命令',
920
+ 'proc.cpuHint': 'CPU% 是进程生命周期平均值(ps pcpu),不是瞬时值。',
921
+ 'proc.killTitle': '结束进程',
922
+ 'proc.killText': '向主机 {host} 的 PID {pid} 发送 TERM?\n{command}',
923
+ 'proc.kill': '结束',
924
+ 'proc.killSent': '已向 PID {pid} 发送 TERM。',
925
+ 'proc.killForceTitle': '强制结束进程',
926
+ 'proc.killForceText': 'TERM 没有结束主机 {host} 的 PID {pid};发送 KILL(不可捕获,可能丢数据)?\n{command}',
927
+ 'proc.killForce': '强制',
928
+ 'proc.killForceSent': '已向 PID {pid} 发送 KILL。',
929
+ 'proc.unknown': '—',
930
+ 'proc.cannotEnumerate': '无法枚举远端进程(ps 探针没有给出可信结果)。',
931
+ 'proc.noPs': '远端没有可用的 ps,无法枚举进程。',
932
+ 'proc.truncated': '只列出 CPU 最高的前 {count} 个进程。',
933
+ 'proc.noHost': '没有可采样的远端主机。',
934
+ 'proc.empty': '没有匹配的进程。',
935
+ 'proc.hostTooOld': '宿主版本过旧:进程面板需要新版 dsh-remote-vs,请升级插件后刷新。',
936
+ 'proc.expand': '展开进程分区',
937
+ 'proc.collapse': '收起进程分区',
938
+ 'proc.collapsedHint': '展开以查看远端的进程快照(按 CPU 排序)。',
794
939
  }
795
940
 
796
941
  const en: Record<string, string> = {
@@ -822,7 +967,7 @@ const en: Record<string, string> = {
822
967
  'hosts.deleted': '{alias}: deleted',
823
968
  'hosts.saved': '{alias}: saved',
824
969
  'hosts.helperPushed': '{alias}: pushed remote helper {version} automatically',
825
- 'hosts.imported': 'Imported {count} host(s)',
970
+ 'hosts.imported': 'Imported hosts ({count})',
826
971
  'hosts.importedSkipped': '; skipped: {list}',
827
972
  'form.alias': 'Alias',
828
973
  'form.unchanged': 'leave empty to keep',
@@ -917,6 +1062,9 @@ const en: Record<string, string> = {
917
1062
  'files.referenceFile': '@File',
918
1063
  'files.addToConversation': 'Add to conversation',
919
1064
  'editor.save': 'Save',
1065
+ 'editor.gotoLine': 'Go to line',
1066
+ 'editor.gotoLineText': 'Go to line (1–{total}):',
1067
+ 'editor.gotoLineInvalid': 'Invalid line number',
920
1068
  'editor.saving': 'Saving…',
921
1069
  'editor.saved': 'Saved',
922
1070
  'editor.unsaved': '● Unsaved',
@@ -1006,10 +1154,14 @@ const en: Record<string, string> = {
1006
1154
  'files.created': 'Created',
1007
1155
  'files.renamed': 'Renamed',
1008
1156
  'files.deleted': 'Deleted',
1157
+ 'files.openInTerminal': 'Open in Terminal',
1009
1158
  'files.items': 'items',
1010
1159
  'files.deleteTitle': 'Delete',
1011
1160
  'files.delete': 'Delete',
1012
1161
  'files.deleteConfirm': 'Delete {target}? This cannot be undone on the remote host.',
1162
+ 'files.deleting': 'Deleting {done}/{total} · {name}',
1163
+ 'files.deleteCancel': 'Cancel delete',
1164
+ 'files.deleteCancelled': 'Delete cancelled: {removed} removed, {left} untouched.',
1013
1165
  'files.open': 'Open',
1014
1166
  'files.openAsText': 'Open as text',
1015
1167
  'files.openInFloat': 'Open in floating editor',
@@ -1099,7 +1251,7 @@ const en: Record<string, string> = {
1099
1251
  'scm.commit': 'Commit',
1100
1252
  'scm.committing': 'Committing',
1101
1253
  'scm.commitPlaceholder': 'Commit message (Ctrl+Enter to commit)',
1102
- 'scm.commitHint': 'Stage changes, then commit',
1254
+ 'scm.commitHint': 'Stage changes, then commit (Ctrl+Enter in the message box commits)',
1103
1255
  'scm.commitNeedsStage': 'Nothing staged yet — press + on a file first.',
1104
1256
  'scm.amend': 'Edit last commit message',
1105
1257
  'scm.amendTitle': 'Amend last commit',
@@ -1182,6 +1334,17 @@ const en: Record<string, string> = {
1182
1334
  'scm.syncText': 'Runs git pull, then git push.',
1183
1335
  'scm.syncDone': 'Sync finished',
1184
1336
  'scm.branches': 'Branches',
1337
+ 'scm.initRepo': 'Initialize repository',
1338
+ 'scm.initRepoText': 'Initialize a Git repository in {path}.',
1339
+ 'scm.initRepoDone': 'Repository initialized',
1340
+ 'scm.renameBranch': 'Rename branch',
1341
+ 'scm.renameBranchText': 'Rename branch {branch} to:',
1342
+ 'scm.renameBranchInvalid': 'The branch name must be non-empty and different',
1343
+ 'scm.renameBranchDone': 'Branch renamed',
1344
+ 'scm.setRemoteUrl': 'Edit remote URL',
1345
+ 'scm.setRemoteUrlText': 'URL for remote {name}:',
1346
+ 'scm.remoteUrlEmpty': 'The remote URL must not be empty',
1347
+ 'scm.setRemoteUrlDone': 'Remote URL updated',
1185
1348
  'scm.remotes': 'Remotes',
1186
1349
  'scm.newBranch': 'New branch name',
1187
1350
  'scm.create': 'Create',
@@ -1281,6 +1444,35 @@ const en: Record<string, string> = {
1281
1444
  'history.diffToolbar': 'Patch tools',
1282
1445
  'editor.preview': 'Preview',
1283
1446
  'editor.source': 'Source',
1447
+ 'preview.converting': 'Converting with remote LibreOffice…',
1448
+ 'preview.convertingHint': 'Converted by the host LibreOffice; the first open usually takes a few seconds.',
1449
+ 'preview.failedTitle': 'Cannot preview this file',
1450
+ 'preview.failedHint': 'The file may be corrupt, unsupported, or the conversion failed.',
1451
+ 'preview.tooLargeTitle': 'File is too large to preview',
1452
+ 'preview.tooLargeHint': 'It exceeds the Host or plugin read limit; open it with a native app instead.',
1453
+ 'preview.unavailableTitle': 'No preview service is available',
1454
+ 'preview.unavailableHint': 'The Host did not mount the required file/Office services; the plugin falls back to its own download path.',
1455
+ 'preview.notFoundTitle': 'The file is no longer on disk',
1456
+ 'preview.notFoundHint': 'It may have been deleted, renamed or moved out of the workspace.',
1457
+ 'preview.remoteTitle': 'Remote file cannot be previewed',
1458
+ 'preview.remoteHint': 'The Host refused this byte-read path.',
1459
+ '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.',
1461
+ 'preview.truncated': 'File is too large; only the loaded part is previewed.',
1462
+ 'preview.tableTruncated': 'Data exceeds {rows} rows / {cells} cells; only the first part was parsed.',
1463
+ 'preview.tableHiddenRows': 'Only the first {shown} rows are shown; {rest} more are hidden.',
1464
+ 'preview.tableHiddenColumns': 'Only the first {shown} columns are shown; {rest} more are hidden.',
1465
+ 'preview.tableEmptyTitle': 'Empty table',
1466
+ 'preview.tableEmptyHint': 'This file has no rows to show.',
1467
+ 'preview.documentHint': 'Paging / zoom live in the browser’s built-in viewer',
1468
+ 'preview.mediaUnsupported': 'The browser does not support this container or codec',
1469
+ 'preview.svgFailed': 'SVG cannot be rendered',
1470
+ 'preview.svgFailedHint': 'The file is not valid SVG. Switch to source to inspect and fix the markup.',
1471
+ 'preview.svgHint': 'SVG is rendered as an image: scripts do not run.',
1472
+ 'preview.copyCode': 'Copy code',
1473
+ 'preview.copied': 'Copied',
1474
+ 'preview.footnotes': 'Footnotes',
1475
+ 'common.retry': 'Retry',
1284
1476
  'editor.imageFailed': 'Could not read the image.',
1285
1477
  'editor.closeDirty': 'Unsaved changes',
1286
1478
  'editor.discardClose': 'Discard and close',
@@ -1311,6 +1503,34 @@ const en: Record<string, string> = {
1311
1503
  'editor.tabsLabel': 'Open editors',
1312
1504
  'editor.diffSuffix': ' (diff)',
1313
1505
  'editor.wrap': 'Word wrap',
1506
+ 'editor.blameToggle': 'Inline blame (author + age; click a line for its commit)',
1507
+ 'editor.blameOpenCaret': 'Open the commit at the caret',
1508
+ 'editor.fileHistory': 'File history',
1509
+ 'editor.fileHistoryEmpty': 'No commit history for this file.',
1510
+ 'editor.outline': 'Outline',
1511
+ 'outline.title': 'File outline',
1512
+ 'outline.placeholder': 'Filter symbols…',
1513
+ 'outline.hint': '↑↓ select · Enter jump · Esc close',
1514
+ 'outline.empty': 'No recognisable symbols in this file.',
1515
+ 'outline.noResults': 'No matching symbols.',
1516
+ 'outline.more': 'Results truncated: {total} matches, showing the first {count}; keep typing to narrow them down.',
1517
+ 'outline.truncated': 'Too many symbols: only the first {count} are listed.',
1518
+ 'outline.guessed': 'Language not recognised: this outline is guessed from indentation and keywords.',
1519
+ 'outline.kind.class': 'class',
1520
+ 'outline.kind.interface': 'interface',
1521
+ 'outline.kind.struct': 'struct',
1522
+ 'outline.kind.enum': 'enum',
1523
+ 'outline.kind.trait': 'trait',
1524
+ 'outline.kind.impl': 'impl',
1525
+ 'outline.kind.namespace': 'namespace',
1526
+ 'outline.kind.module': 'module',
1527
+ 'outline.kind.function': 'function',
1528
+ 'outline.kind.method': 'method',
1529
+ 'outline.kind.constructor': 'constructor',
1530
+ 'outline.kind.field': 'field',
1531
+ 'outline.kind.variable': 'variable',
1532
+ 'outline.kind.type': 'type',
1533
+ 'outline.kind.macro': 'macro',
1314
1534
  'editor.fontSmaller': 'Smaller font (Ctrl+wheel)',
1315
1535
  'editor.fontLarger': 'Larger font (Ctrl+wheel)',
1316
1536
  'editor.openInCenter': 'Open full width in the conversation view',
@@ -1320,7 +1540,7 @@ const en: Record<string, string> = {
1320
1540
  'editor.dockEmptyHint': 'Open a file from the explorer or the search results',
1321
1541
  'editor.centerEmptyTitle': 'Remote editor',
1322
1542
  'editor.centerEmptyHint': 'Open a file from the sidebar Explorer or Search and it appears here at full width.',
1323
- 'editor.emptyShortcuts': 'Ctrl+S save · Ctrl+F find · Ctrl+wheel zoom',
1543
+ 'editor.emptyShortcuts': 'Ctrl+S save · Ctrl+F find · Ctrl+P quick open · Ctrl+wheel zoom',
1324
1544
  'editor.statusSaving': 'Saving…',
1325
1545
  'editor.statusClean': 'Saved',
1326
1546
  'editor.statusLanguage': 'Language',
@@ -1350,9 +1570,21 @@ const en: Record<string, string> = {
1350
1570
  'editor.imageTooLargeTitle': 'Image too large',
1351
1571
  'editor.imageTooLargeHint': 'Size {size} KiB, above the read cap; no preview is provided.',
1352
1572
  'editor.switchToEdit': 'Switch to content editing (open this file in the editor)',
1573
+ // -- in-editor find (vsc/FindWidget.tsx: the query box, toggles, stepping, close)
1574
+ 'find.placeholder': 'Find',
1575
+ 'find.caseSensitive': 'Match case (Aa)',
1576
+ 'find.wholeWord': 'Match whole word (ab_)',
1577
+ 'find.regexp': 'Use regular expression (.*)',
1578
+ 'find.noResults': 'No results',
1579
+ 'find.prev': 'Previous match (Shift+Enter)',
1580
+ 'find.next': 'Next match (Enter)',
1581
+ 'find.close': 'Close (Esc)',
1353
1582
  'git.notARepo': 'This remote workspace is not a git repository.',
1354
1583
  // -- session change panel (above the composer)
1355
1584
  'changes.title': 'Changed files',
1585
+ 'changes.onlyUnreviewed': 'Only unreviewed',
1586
+ 'changes.nextUnreviewed': 'Next unreviewed',
1587
+ 'changes.allReviewed': 'All reviewed',
1356
1588
  'changes.toggle': 'Show or hide the files this session changed',
1357
1589
  'changes.empty': 'This session has not changed any file yet.',
1358
1590
  'changes.pending': 'Computing…',
@@ -1392,6 +1624,13 @@ const en: Record<string, string> = {
1392
1624
  'changes.stale': 'positions stale',
1393
1625
  'changes.staleHint': 'The editor content changed, so the marked positions may be off. Click the file in the list to recompute.',
1394
1626
  'changes.noWorkspace': 'No workspace is bound to that host, so the file cannot be opened.',
1627
+ // -- editor gutter marks and deleted chips (title / aria-label in vsc/change-marks.ts)
1628
+ 'changes.markAdd': 'Added line',
1629
+ 'changes.markMod': 'Modified line',
1630
+ 'changes.markDel': 'Deleted line',
1631
+ 'changes.deletedChip': 'Deleted content',
1632
+ 'changes.deletedBlock': 'Deleted block ({count} lines)',
1633
+ 'changes.deletedLines': '−{count} lines deleted',
1395
1634
  // -- reverting one change by hovering over its line
1396
1635
  'changes.undoAction': 'Revert this change',
1397
1636
  'changes.undoActionDelete': 'Revert this deletion',
@@ -1449,12 +1688,12 @@ const en: Record<string, string> = {
1449
1688
  'ports.forward': 'Forward to local',
1450
1689
  'ports.stateListening': 'Listening',
1451
1690
  'ports.stateError': 'Connection failed',
1452
- 'ports.connections': '{count} connection(s)',
1691
+ 'ports.connections': 'Connections: {count}',
1453
1692
  'ports.emptyListen': 'The remote host listed no listening ports.',
1454
1693
  'ports.listenUnavailable': 'Cannot enumerate remote ports: neither ss nor netstat is available on the host.',
1455
1694
  'ports.listenUnknown': 'Cannot enumerate remote ports: the probe did not answer.',
1456
1695
  'ports.badPort': 'Port must be an integer between 1 and 65535; leave the local port empty to auto-assign.',
1457
- 'ports.restoreFailed': '{count} saved forward(s) could not be restored — the local port may be taken, or the per-host rule limit reached.',
1696
+ 'ports.restoreFailed': 'Could not restore saved forwards: {count} — the local port may be taken, or the per-host rule limit reached.',
1458
1697
  'ports.forgetFailed': 'Forget these rules',
1459
1698
  'ports.remoteHostHint': 'The target is dialed from the remote host, so it can reach that host’s private network; the local listener binds 127.0.0.1 only.',
1460
1699
  // -- host monitor (sidebar "Monitor" view): full metrics on Linux; 5 s while visible
@@ -1498,6 +1737,35 @@ const en: Record<string, string> = {
1498
1737
  'monitor.interval10': '10 s',
1499
1738
  'monitor.interval30': '30 s',
1500
1739
  'monitor.linuxOnly': 'Full metrics come from Linux /proc; other platforms show unknown.',
1740
+ 'proc.title': 'Processes',
1741
+ 'proc.host': 'Host',
1742
+ 'proc.filter': 'Filter command / user / PID',
1743
+ 'proc.sort': 'Sort',
1744
+ 'proc.sortCpu': 'CPU (average)',
1745
+ 'proc.sortMem': 'Memory',
1746
+ 'proc.sortPid': 'PID',
1747
+ 'proc.refresh': 'Refresh the process table',
1748
+ 'proc.elapsed': 'ELAPSED',
1749
+ 'proc.command': 'COMMAND',
1750
+ 'proc.cpuHint': 'CPU% is the lifetime average (ps pcpu), not an instantaneous value.',
1751
+ 'proc.killTitle': 'End process',
1752
+ 'proc.killText': 'Send TERM to PID {pid} on {host}?\n{command}',
1753
+ 'proc.kill': 'End',
1754
+ 'proc.killSent': 'Sent TERM to PID {pid}.',
1755
+ 'proc.killForceTitle': 'Force-kill process',
1756
+ 'proc.killForceText': 'TERM did not stop PID {pid} on {host}; send KILL (uncatchable, may lose data)?\n{command}',
1757
+ 'proc.killForce': 'Force',
1758
+ 'proc.killForceSent': 'Sent KILL to PID {pid}.',
1759
+ 'proc.unknown': '—',
1760
+ 'proc.cannotEnumerate': 'Cannot enumerate remote processes (the ps probe gave no trustworthy answer).',
1761
+ 'proc.noPs': 'The remote host has no usable ps, so processes cannot be enumerated.',
1762
+ 'proc.truncated': 'Only the top {count} processes by CPU are listed.',
1763
+ 'proc.noHost': 'No remote host to sample.',
1764
+ 'proc.empty': 'No matching processes.',
1765
+ 'proc.hostTooOld': 'Host too old: the process panel needs a newer dsh-remote-vs; upgrade the plugin and refresh.',
1766
+ 'proc.expand': 'Expand processes',
1767
+ 'proc.collapse': 'Collapse processes',
1768
+ 'proc.collapsedHint': 'Expand for the remote process snapshot (sorted by CPU).',
1501
1769
  }
1502
1770
 
1503
1771
  export type Lang = 'zh' | 'en'
@@ -32,6 +32,7 @@ import { SettingsHostsSection, SettingsWorkspacesSection } from './SettingsHosts
32
32
  import { openFloatingEditor, setEditorSurface } from './store.tsx'
33
33
  import { detectLang, makeT } from './i18n.ts'
34
34
  import { DialogHost, setIconService, toast, type IconServiceLike } from './vsc/kit.tsx'
35
+ import { installPreviewServices } from './vsc/preview-services.ts'
35
36
  import { setHostNoticeEmitter } from './notices.ts'
36
37
 
37
38
  /** Services required before mounting (slots/uiWorkspace are core web services). */
@@ -49,6 +50,9 @@ function RemoteIcon({ size }: { size?: number }): React.ReactNode {
49
50
 
50
51
  /** Client plugin body. */
51
52
  export function apply(ctx: Context): void {
53
+ // Document previews soft-read the host's workspaceFiles/officeKit remotes;
54
+ // missing services degrade to the plugin's own /download path.
55
+ ctx.effect(() => installPreviewServices(ctx), 'dsh-remote-vs: preview host services')
52
56
  // Explorer surface, exactly one of two: the better-sidebar tab when that
53
57
  // plugin is installed, else a native right-Sidebar page (same root, guide
54
58
  // entry). No load-order edge exists (client inject metadata is