dsh-remote-vs 0.19.0 → 0.20.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 +6 -6
- package/README.md +6 -6
- package/lib/client.js +670 -23
- package/lib/types/client/vsc/file-icons.d.ts +84 -0
- package/lib/types/client/vsc/kit.d.ts +24 -5
- package/package.json +36 -36
- package/src/client/RemoteExplorer.tsx +10 -6
- package/src/client/i18n.ts +6 -6
- package/src/client/index.tsx +5 -3
- package/src/client/vsc/file-icons.tsx +380 -0
- package/src/client/vsc/kit.tsx +34 -5
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Coloured file-type / folder icons for the remote DIRECTORY TREE
|
|
3
|
+
* (`RemoteExplorer`), so a remote folder looks like the local sidebar's folder.
|
|
4
|
+
*
|
|
5
|
+
* Scope: the tree only. Search hits, SCM rows, commit panes and download rows
|
|
6
|
+
* keep the neutral outline glyphs from `kit.tsx` — this set is deliberately not
|
|
7
|
+
* the fallback of `FileIcon` / `FolderIcon`.
|
|
8
|
+
*
|
|
9
|
+
* Provenance
|
|
10
|
+
* ----------
|
|
11
|
+
* These are a straight port of the local sidebar plugin's artwork (`FileTypeIcon`
|
|
12
|
+
* and its amber `FolderIcon` in dsh-sidebar's `src/client/icons.tsx`, package
|
|
13
|
+
* name `dsh-sidebar`): one paper sheet whose colour and bottom-right mark carry
|
|
14
|
+
* the type — TS blue + `<>`, JS yellow + `<>`, Python blue with a yellow mark,
|
|
15
|
+
* Markdown blue + lines, images purple + a mountain, archives yellow + a zip,
|
|
16
|
+
* `.gitignore` orange + a commit graph.
|
|
17
|
+
*
|
|
18
|
+
* The copy exists on purpose: the client bundle may not import another plugin's
|
|
19
|
+
* values (tsdown's purity gate rejects cross-plugin imports), and dsh-sidebar
|
|
20
|
+
* publishes no `fileIcon` / `folderIcon` service that `kit.tsx` could call.
|
|
21
|
+
* `kit.tsx` still prefers such a service if a host ever provides one (the
|
|
22
|
+
* better-sidebar lineage is where that contract would come from); this set is
|
|
23
|
+
* the fallback that paints a real, typed tree in a dsh-sidebar profile.
|
|
24
|
+
*
|
|
25
|
+
* One deliberate difference from the source: the image mark used
|
|
26
|
+
* `fill="currentColor"`, which in a tree inherits the row's dim text colour —
|
|
27
|
+
* `.rvs-node-icon` sets `color: var(--rvs-fg3)` — so the mountain would render
|
|
28
|
+
* grey on the purple sheet. Here the mark group pins `color` to the type colour
|
|
29
|
+
* and the artwork stays the colour the palette intends.
|
|
30
|
+
*/
|
|
31
|
+
import type { ReactNode } from 'react';
|
|
32
|
+
/** The bottom-right mark that carries the category (drawn in the type colour). */
|
|
33
|
+
type FileMark = 'code' | 'markup' | 'style' | 'data' | 'doc' | 'image' | 'archive' | 'shell' | 'config' | 'git' | 'lock' | 'box' | 'table';
|
|
34
|
+
/** How one file type looks: sheet colour + category mark + optional mark colour. */
|
|
35
|
+
export interface FileLook {
|
|
36
|
+
color: string;
|
|
37
|
+
mark: FileMark;
|
|
38
|
+
/** Mark colour; defaults to the sheet colour (Python = blue sheet + yellow mark). */
|
|
39
|
+
markColor?: string;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* The extension / exact-name tables, exposed read-only for the gate's full-table
|
|
43
|
+
* snapshot: one changed hex or mark must turn `scripts/check-file-icons.mjs`
|
|
44
|
+
* red, instead of shipping a silently different palette.
|
|
45
|
+
*
|
|
46
|
+
* `baseName` stays private on purpose — `kit.tsx` already exports a `baseName`
|
|
47
|
+
* with different semantics (POSIX only, strips a trailing slash), and exporting
|
|
48
|
+
* both invites the wrong import.
|
|
49
|
+
*/
|
|
50
|
+
export declare const FILE_TYPE_LOOKS: Readonly<Record<string, FileLook>>;
|
|
51
|
+
export declare const FILE_NAME_LOOKS: Readonly<Record<string, FileLook>>;
|
|
52
|
+
/** Resolve a path's look from its name / extension. */
|
|
53
|
+
export declare function lookOf(path: string): FileLook;
|
|
54
|
+
/** Props for {@link FileTypeIcon} / {@link FolderGlyph}. */
|
|
55
|
+
export interface FileIconProps {
|
|
56
|
+
/** Workspace-relative path (any separator); only the basename is read. */
|
|
57
|
+
path: string;
|
|
58
|
+
/** Edge length in px, default 16. */
|
|
59
|
+
size?: number;
|
|
60
|
+
className?: string;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Coloured file-type icon: sheet + top-right fold + bottom-right category mark.
|
|
64
|
+
*
|
|
65
|
+
* At 16 px this reads better than two-letter badges and does not depend on font
|
|
66
|
+
* rendering.
|
|
67
|
+
*/
|
|
68
|
+
export declare function FileTypeIcon(props: FileIconProps): ReactNode;
|
|
69
|
+
/** Every extension the file-type icon recognises (reporting / gate). */
|
|
70
|
+
export declare const FILE_TYPE_EXTENSIONS: readonly string[];
|
|
71
|
+
/** Props for the amber folder glyph. */
|
|
72
|
+
export interface FolderGlyphProps {
|
|
73
|
+
/** Expanded: the front flap drops down and reveals the inner sheet (VSCode-like). */
|
|
74
|
+
open?: boolean;
|
|
75
|
+
/** Edge length in px, default 16. */
|
|
76
|
+
size?: number;
|
|
77
|
+
className?: string;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Amber folder icon. The folder colour is content colour, in the same scheme as
|
|
81
|
+
* the file types — it does not follow the skin.
|
|
82
|
+
*/
|
|
83
|
+
export declare function FolderGlyph(props: FolderGlyphProps): ReactNode;
|
|
84
|
+
export {};
|
|
@@ -5,11 +5,17 @@
|
|
|
5
5
|
* ships the same split, and the confirm dialogs are what guard destructive
|
|
6
6
|
* remote git verbs).
|
|
7
7
|
*
|
|
8
|
-
* Icon sourcing
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
8
|
+
* Icon sourcing has two tiers. `FileIcon` / `FolderIcon` paint the plain glyphs
|
|
9
|
+
* below (search hits, SCM rows, commit panes, download rows — list chrome where
|
|
10
|
+
* one neutral outline reads best). `ExplorerFileIcon` / `ExplorerFolderIcon`
|
|
11
|
+
* paint the COLOURED type set ported from dsh-sidebar in `./file-icons.tsx`, so
|
|
12
|
+
* the remote directory tree looks like the local sidebar's tree: one sheet
|
|
13
|
+
* whose colour and mark carry the file type, and an amber folder that opens.
|
|
14
|
+
*
|
|
15
|
+
* Every tier still prefers the host service when one is published (the
|
|
16
|
+
* better-sidebar lineage's `fileIcon` / `folderIcon`: host classifier plus any
|
|
17
|
+
* registered icon theme). dsh-sidebar itself publishes none today, so in a
|
|
18
|
+
* dsh-sidebar profile the SVG sets above are what actually render.
|
|
13
19
|
*/
|
|
14
20
|
import { type ReactNode } from 'react';
|
|
15
21
|
type IconProps = {
|
|
@@ -101,6 +107,19 @@ export declare function FolderIcon(props: {
|
|
|
101
107
|
size?: number;
|
|
102
108
|
className?: string;
|
|
103
109
|
}): ReactNode;
|
|
110
|
+
/** Explorer file row: host glyph when available, else the coloured type icon. */
|
|
111
|
+
export declare function ExplorerFileIcon(props: {
|
|
112
|
+
path: string;
|
|
113
|
+
size?: number;
|
|
114
|
+
className?: string;
|
|
115
|
+
}): ReactNode;
|
|
116
|
+
/** Explorer directory row: host glyph when available, else the amber folder. */
|
|
117
|
+
export declare function ExplorerFolderIcon(props: {
|
|
118
|
+
path: string;
|
|
119
|
+
open: boolean;
|
|
120
|
+
size?: number;
|
|
121
|
+
className?: string;
|
|
122
|
+
}): ReactNode;
|
|
104
123
|
export declare function isImageFile(path: string): boolean;
|
|
105
124
|
export declare function isMarkdownFile(path: string): boolean;
|
|
106
125
|
export declare function isHtmlFile(path: string): boolean;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-remote-vs",
|
|
3
3
|
"description": "VSCode-style remote development for DSH: SSH host manager (key/password), helper deploy pipeline with version check, remote file explorer + editor + terminal in dsh-better-sidebar.",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.20.0",
|
|
5
5
|
"icon": "icon.svg",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"dsh",
|
|
@@ -122,7 +122,7 @@
|
|
|
122
122
|
"@codemirror/view": "^6.43.14",
|
|
123
123
|
"@deepseek-ai/dsh-fs-ssh": "0.2.1-rc.2",
|
|
124
124
|
"@deepseek-ai/dsh-ssh": "0.2.1-rc.2",
|
|
125
|
-
"@deepseek-ai/schemastery": "3.
|
|
125
|
+
"@deepseek-ai/schemastery": "3.19.0",
|
|
126
126
|
"@lezer/highlight": "1.2.3",
|
|
127
127
|
"@xterm/addon-fit": "^0.11.0",
|
|
128
128
|
"@xterm/xterm": "^6.0.0",
|
|
@@ -130,44 +130,44 @@
|
|
|
130
130
|
"zod": "4.4.3"
|
|
131
131
|
},
|
|
132
132
|
"peerDependencies": {
|
|
133
|
-
"@deepseek-ai/cordis": "^4.0
|
|
134
|
-
"@deepseek-ai/dsh-agent-preset": "^0.2.2-
|
|
135
|
-
"@deepseek-ai/dsh-bash-local": "^0.2.2-
|
|
136
|
-
"@deepseek-ai/dsh-file-reference": "^0.2.2-
|
|
137
|
-
"@deepseek-ai/dsh-fs": "^0.2.2-
|
|
138
|
-
"@deepseek-ai/dsh-shell": "^0.2.2-
|
|
139
|
-
"@deepseek-ai/dsh-spill": "^0.2.2-
|
|
140
|
-
"@deepseek-ai/dsh-subprocess": "^0.2.2-
|
|
141
|
-
"@deepseek-ai/dsh-tools": "^0.2.2-
|
|
133
|
+
"@deepseek-ai/cordis": "^4.1.0",
|
|
134
|
+
"@deepseek-ai/dsh-agent-preset": "^0.2.2-rc.1",
|
|
135
|
+
"@deepseek-ai/dsh-bash-local": "^0.2.2-rc.1",
|
|
136
|
+
"@deepseek-ai/dsh-file-reference": "^0.2.2-rc.1",
|
|
137
|
+
"@deepseek-ai/dsh-fs": "^0.2.2-rc.1",
|
|
138
|
+
"@deepseek-ai/dsh-shell": "^0.2.2-rc.1",
|
|
139
|
+
"@deepseek-ai/dsh-spill": "^0.2.2-rc.1",
|
|
140
|
+
"@deepseek-ai/dsh-subprocess": "^0.2.2-rc.1",
|
|
141
|
+
"@deepseek-ai/dsh-tools": "^0.2.2-rc.1",
|
|
142
142
|
"react": "^18.2.0",
|
|
143
143
|
"react-dom": "^18.2.0"
|
|
144
144
|
},
|
|
145
145
|
"devDependencies": {
|
|
146
|
-
"@deepseek-ai/cordis": "^4.0
|
|
147
|
-
"@deepseek-ai/dsh-agent": "0.2.2-
|
|
148
|
-
"@deepseek-ai/dsh-agent-preset-registry": "0.2.2-
|
|
149
|
-
"@deepseek-ai/dsh-api-remotes": "0.2.2-
|
|
150
|
-
"@deepseek-ai/dsh-bash-local": "0.2.2-
|
|
151
|
-
"@deepseek-ai/dsh-client-locale": "0.2.2-
|
|
152
|
-
"@deepseek-ai/dsh-client-ui-renderer": "0.2.2-
|
|
153
|
-
"@deepseek-ai/dsh-client-ui-settings": "0.2.2-
|
|
154
|
-
"@deepseek-ai/dsh-client-ui-sidebar-right": "0.2.2-
|
|
155
|
-
"@deepseek-ai/dsh-client-ui-slots": "0.2.2-
|
|
156
|
-
"@deepseek-ai/dsh-client-ui-workspace": "0.2.2-
|
|
157
|
-
"@deepseek-ai/dsh-file-reference": "0.2.2-
|
|
158
|
-
"@deepseek-ai/dsh-fs": "0.2.2-
|
|
159
|
-
"@deepseek-ai/dsh-host-directory-picker": "0.2.2-
|
|
160
|
-
"@deepseek-ai/dsh-host-webserver": "0.2.2-
|
|
161
|
-
"@deepseek-ai/dsh-llm": "0.2.2-
|
|
162
|
-
"@deepseek-ai/dsh-sandbox": "0.2.2-
|
|
163
|
-
"@deepseek-ai/dsh-session": "0.2.2-
|
|
164
|
-
"@deepseek-ai/dsh-shell": "0.2.2-
|
|
165
|
-
"@deepseek-ai/dsh-spill": "0.2.2-
|
|
166
|
-
"@deepseek-ai/dsh-subprocess": "0.2.2-
|
|
167
|
-
"@deepseek-ai/dsh-system-prompt": "0.2.2-
|
|
168
|
-
"@deepseek-ai/dsh-tools": "0.2.2-
|
|
169
|
-
"@deepseek-ai/dsh-working-directory": "0.2.2-
|
|
170
|
-
"@deepseek-ai/dsh-workspace": "0.2.2-
|
|
146
|
+
"@deepseek-ai/cordis": "^4.1.0",
|
|
147
|
+
"@deepseek-ai/dsh-agent": "0.2.2-rc.1",
|
|
148
|
+
"@deepseek-ai/dsh-agent-preset-registry": "0.2.2-rc.1",
|
|
149
|
+
"@deepseek-ai/dsh-api-remotes": "0.2.2-rc.1",
|
|
150
|
+
"@deepseek-ai/dsh-bash-local": "0.2.2-rc.1",
|
|
151
|
+
"@deepseek-ai/dsh-client-locale": "0.2.2-rc.1",
|
|
152
|
+
"@deepseek-ai/dsh-client-ui-renderer": "0.2.2-rc.1",
|
|
153
|
+
"@deepseek-ai/dsh-client-ui-settings": "0.2.2-rc.1",
|
|
154
|
+
"@deepseek-ai/dsh-client-ui-sidebar-right": "0.2.2-rc.1",
|
|
155
|
+
"@deepseek-ai/dsh-client-ui-slots": "0.2.2-rc.1",
|
|
156
|
+
"@deepseek-ai/dsh-client-ui-workspace": "0.2.2-rc.1",
|
|
157
|
+
"@deepseek-ai/dsh-file-reference": "0.2.2-rc.1",
|
|
158
|
+
"@deepseek-ai/dsh-fs": "0.2.2-rc.1",
|
|
159
|
+
"@deepseek-ai/dsh-host-directory-picker": "0.2.2-rc.1",
|
|
160
|
+
"@deepseek-ai/dsh-host-webserver": "0.2.2-rc.1",
|
|
161
|
+
"@deepseek-ai/dsh-llm": "0.2.2-rc.1",
|
|
162
|
+
"@deepseek-ai/dsh-sandbox": "0.2.2-rc.1",
|
|
163
|
+
"@deepseek-ai/dsh-session": "0.2.2-rc.1",
|
|
164
|
+
"@deepseek-ai/dsh-shell": "0.2.2-rc.1",
|
|
165
|
+
"@deepseek-ai/dsh-spill": "0.2.2-rc.1",
|
|
166
|
+
"@deepseek-ai/dsh-subprocess": "0.2.2-rc.1",
|
|
167
|
+
"@deepseek-ai/dsh-system-prompt": "0.2.2-rc.1",
|
|
168
|
+
"@deepseek-ai/dsh-tools": "0.2.2-rc.1",
|
|
169
|
+
"@deepseek-ai/dsh-working-directory": "0.2.2-rc.1",
|
|
170
|
+
"@deepseek-ai/dsh-workspace": "0.2.2-rc.1",
|
|
171
171
|
"@types/node": "^22.20.0",
|
|
172
172
|
"@types/react": "~18.3.1",
|
|
173
173
|
"@types/react-dom": "^18.3.5",
|
|
@@ -32,8 +32,8 @@ import {
|
|
|
32
32
|
IconRefresh,
|
|
33
33
|
IconUpload,
|
|
34
34
|
ContextMenu,
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
ExplorerFileIcon,
|
|
36
|
+
ExplorerFolderIcon,
|
|
37
37
|
baseName,
|
|
38
38
|
confirmDialog,
|
|
39
39
|
copyText,
|
|
@@ -566,8 +566,8 @@ export const ExplorerRowView = memo(function ExplorerRowView(props: ExplorerRowP
|
|
|
566
566
|
>
|
|
567
567
|
<span className="rvs-node-icon">
|
|
568
568
|
{entry.isDir
|
|
569
|
-
? <
|
|
570
|
-
: <
|
|
569
|
+
? <ExplorerFolderIcon path={entry.path} open={isOpen} size={16} />
|
|
570
|
+
: <ExplorerFileIcon path={entry.path} size={16} />}
|
|
571
571
|
</span>
|
|
572
572
|
{isRenaming
|
|
573
573
|
? (
|
|
@@ -2229,8 +2229,12 @@ export function RemoteExplorer(props: { showHidden: boolean; onToggleHidden: ()
|
|
|
2229
2229
|
kind={row.createKind}
|
|
2230
2230
|
onCommit={(value) => { void doCreate(value) }}
|
|
2231
2231
|
onCancel={() => setCreating(undefined)}
|
|
2232
|
-
|
|
2233
|
-
|
|
2232
|
+
// 16 px to match the tree rows and the local sidebar's tree, and
|
|
2233
|
+
// a nameless sheet for the file: the row has no path yet, so
|
|
2234
|
+
// claiming a type (the old hard-coded `name.ts`) would paint
|
|
2235
|
+
// every "new file" row TS-blue.
|
|
2236
|
+
fileIcon={<ExplorerFileIcon path="untitled" size={16} />}
|
|
2237
|
+
folderIcon={<ExplorerFolderIcon path="name" open={false} size={16} />}
|
|
2234
2238
|
t={t}
|
|
2235
2239
|
/>
|
|
2236
2240
|
)
|
package/src/client/i18n.ts
CHANGED
|
@@ -73,7 +73,7 @@ const zh: Record<string, string> = {
|
|
|
73
73
|
'tab.terminal': '终端',
|
|
74
74
|
'tab.ports': '端口',
|
|
75
75
|
'tab.monitor': '监控',
|
|
76
|
-
'tab.remote': '
|
|
76
|
+
'tab.remote': '远程工作台',
|
|
77
77
|
'tab.remoteDesc': '远端文件、终端与 Git',
|
|
78
78
|
'hosts.title': '远程主机',
|
|
79
79
|
'hosts.empty': '尚未配置主机。点击「新增主机」,或从现有配置导入。',
|
|
@@ -240,8 +240,8 @@ const zh: Record<string, string> = {
|
|
|
240
240
|
'settings.hosts': '远程主机',
|
|
241
241
|
'settings.workspaces': '远程工作区',
|
|
242
242
|
'plugin.version': '插件版本',
|
|
243
|
-
'native.tab': '
|
|
244
|
-
'native.guide.title': '
|
|
243
|
+
'native.tab': '远程工作台',
|
|
244
|
+
'native.guide.title': '远程工作台',
|
|
245
245
|
'native.guide.desc': '远端文件、终端与 Git',
|
|
246
246
|
// ---- VS Code-style explorer (rail, tree, SCM, diff, history, editor)
|
|
247
247
|
'tab.search': '搜索',
|
|
@@ -688,7 +688,7 @@ const en: Record<string, string> = {
|
|
|
688
688
|
'tab.terminal': 'Terminal',
|
|
689
689
|
'tab.ports': 'Ports',
|
|
690
690
|
'tab.monitor': 'Monitor',
|
|
691
|
-
'tab.remote': 'Remote',
|
|
691
|
+
'tab.remote': 'Remote Workspace',
|
|
692
692
|
'tab.remoteDesc': 'Remote files, terminal and Git',
|
|
693
693
|
'hosts.title': 'Remote hosts',
|
|
694
694
|
'hosts.empty': 'No hosts yet. Add one, or import from existing configs.',
|
|
@@ -855,8 +855,8 @@ const en: Record<string, string> = {
|
|
|
855
855
|
'settings.hosts': 'Remote hosts',
|
|
856
856
|
'settings.workspaces': 'Remote workspaces',
|
|
857
857
|
'plugin.version': 'Plugin version',
|
|
858
|
-
'native.tab': 'Remote',
|
|
859
|
-
'native.guide.title': 'Remote',
|
|
858
|
+
'native.tab': 'Remote Workspace',
|
|
859
|
+
'native.guide.title': 'Remote Workspace',
|
|
860
860
|
'native.guide.desc': 'Remote files, terminal and Git',
|
|
861
861
|
// ---- VS Code-style explorer
|
|
862
862
|
'tab.search': 'Search',
|
package/src/client/index.tsx
CHANGED
|
@@ -83,9 +83,11 @@ export function apply(ctx: Context): void {
|
|
|
83
83
|
return false
|
|
84
84
|
}
|
|
85
85
|
if (sidebar === undefined) return false
|
|
86
|
-
//
|
|
87
|
-
//
|
|
88
|
-
//
|
|
86
|
+
// Optional host icon classifier: a better-sidebar release may publish
|
|
87
|
+
// `fileIcon` / `folderIcon` alongside `registerTab`, and then the remote
|
|
88
|
+
// tree follows the user's registered icon theme. dsh-sidebar (the local
|
|
89
|
+
// sidebar this plugin usually runs next to) publishes none, so in practice
|
|
90
|
+
// the built-in colour set in `vsc/file-icons.tsx` is what paints the tree.
|
|
89
91
|
try {
|
|
90
92
|
const candidate = sidebar as unknown as Partial<IconServiceLike>
|
|
91
93
|
if (typeof candidate.fileIcon === 'function' && typeof candidate.folderIcon === 'function') {
|