dsh-vscode-workbench 0.1.8 → 0.1.9
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 +102 -35
- package/README.md +102 -36
- package/lib/client.js +15 -9
- package/lib/client.js.map +1 -1
- package/lib/index.js +41 -58
- package/lib/index.js.map +1 -1
- package/lib/types/client/Workbench.d.ts +3 -2
- package/lib/types/client/index.d.ts +1 -11
- package/lib/types/client/session.d.ts +3 -0
- package/lib/types/context.d.ts +8 -8
- package/lib/types/wire.d.ts +3 -1
- package/package.json +28 -16
- package/src/client/DshConversationPanel.tsx +2 -2
- package/src/client/Workbench.tsx +2 -3
- package/src/client/index.tsx +8 -4
- package/src/client/session.ts +7 -0
- package/src/context.ts +5 -3
- package/src/host.ts +3 -2
- package/src/index.ts +12 -10
- package/src/terminal.ts +6 -3
- package/src/wire.ts +8 -10
package/README.en.md
CHANGED
|
@@ -1,48 +1,50 @@
|
|
|
1
1
|
<h1 align="center">DSH VS Code Workbench</h1>
|
|
2
2
|
|
|
3
|
+
<p align="center">
|
|
4
|
+
<img src="https://raw.githubusercontent.com/tingfeng347/dsh-vscode-workbench/main/assets/dsh-neon-workbench-core.svg" width="220" alt="DSH VS Code Workbench Logo">
|
|
5
|
+
</p>
|
|
6
|
+
|
|
3
7
|
<p align="center">A VS Code-style local development workbench for DeepSeek Harness.</p>
|
|
8
|
+
|
|
9
|
+
<p align="center">
|
|
10
|
+
<a href="https://www.npmjs.com/package/dsh-vscode-workbench"><img src="https://img.shields.io/npm/v/dsh-vscode-workbench?logo=npm&label=npm" alt="npm version"></a>
|
|
11
|
+
<a href="https://www.npmjs.com/package/dsh-vscode-workbench"><img src="https://img.shields.io/npm/dm/dsh-vscode-workbench?label=downloads" alt="npm downloads"></a>
|
|
12
|
+
<a href="https://github.com/tingfeng347/dsh-vscode-workbench/stargazers"><img src="https://img.shields.io/github/stars/tingfeng347/dsh-vscode-workbench?logo=github&label=Stars" alt="GitHub stars"></a>
|
|
13
|
+
<a href="https://github.com/tingfeng347/dsh-vscode-workbench/commits/main"><img src="https://img.shields.io/github/last-commit/tingfeng347/dsh-vscode-workbench?label=last%20commit" alt="Last commit"></a>
|
|
14
|
+
<a href="https://github.com/tingfeng347/dsh-vscode-workbench/blob/main/LICENSE"><img src="https://img.shields.io/github/license/tingfeng347/dsh-vscode-workbench?label=license" alt="MIT license"></a>
|
|
15
|
+
<br>
|
|
16
|
+
<a href="https://awesome-dsh-plugin.com/p/tingfeng347/dsh-vscode-workbench/"><img src="https://awesome-dsh-plugin.com/badge.svg" alt="awesome · DSH plugin"></a>
|
|
17
|
+
<a href="https://dshpluginhub.ai/plugins/dsh-vscode-workbench"><img src="https://dshpluginhub.ai/badges/plugins/dsh-vscode-workbench.svg" alt="Listed on DSH Plugin Hub"></a>
|
|
18
|
+
<a href="https://dshmarket.com/p/tingfeng347/dsh-vscode-workbench/"><img src="https://img.shields.io/badge/dsh--market-Listed-5b7cfa?style=flat" alt="Listed on dsh-market"></a>
|
|
19
|
+
<a href="https://dshmk.com/plugins/1343926987"><img src="https://img.shields.io/badge/DSH%20Plugin%20Market-Listed-0ea5e9?style=flat" alt="Listed on DSH Plugin Market"></a>
|
|
20
|
+
<a href="https://dsh-ai.org/p/tingfeng347/dsh-vscode-workbench"><img src="https://img.shields.io/badge/dsh--ai.org-Listed-8b5cf6?style=flat" alt="Listed on dsh-ai.org"></a>
|
|
21
|
+
<a href="https://duink.com/plugins/1343926987/"><img src="https://img.shields.io/badge/DSH%20Universe-Listed-14b8a6?style=flat" alt="Listed on DSH Universe"></a>
|
|
22
|
+
<a href="https://deepseekplugin.org/en/plugins/tingfeng347-dsh-vscode-workbench"><img src="https://img.shields.io/badge/DeepseekPlugin-Listed-2563eb?style=flat" alt="Listed on DeepseekPlugin"></a>
|
|
23
|
+
</p>
|
|
24
|
+
|
|
4
25
|
<p align="center"><a href="README.md">中文</a> · <b>English</b></p>
|
|
5
26
|
|
|
6
27
|
## Highlights
|
|
7
28
|
|
|
8
|
-
- **
|
|
9
|
-
- **
|
|
10
|
-
- **
|
|
11
|
-
- **
|
|
12
|
-
- **
|
|
29
|
+
- **One local workbench**: explorer, Monaco editor, search, Git, terminal, and DSH conversation in one VS Code-style interface.
|
|
30
|
+
- **Complete file experience**: open text, Markdown, images, PDF, and Word files directly; the tree supports drag-and-drop uploads and common file operations.
|
|
31
|
+
- **Reliable and live**: atomic saves and revision checks prevent silent overwrites, while WebSocket updates flag external workspace changes.
|
|
32
|
+
- **Visual Git workflow**: status, staging, commits, branches, diffs, commit files, and a swimlane commit graph.
|
|
33
|
+
- **Persistent workspace context**: restore tabs, tree, views, panels, and widths per workspace; terminals support multiple sessions, splits, and rename.
|
|
34
|
+
- **Built for DSH**: reuse the DSH conversation surface on the right and manage theme and layout from workbench settings.
|
|
13
35
|
|
|
14
36
|
## Features
|
|
15
37
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
### Preview
|
|
23
|
-
Markdown rendered by default with source and outline modes; workspace-relative links, image and common file previews.
|
|
24
|
-
|
|
25
|
-
### Search
|
|
26
|
-
`@vscode/ripgrep` full-text search with case, whole-word, regex, and include / exclude controls.
|
|
27
|
-
|
|
28
|
-
### Git
|
|
29
|
-
Grouped status, stage, unstage, discard, commit, branch switching, inline / side-by-side diffs, and a commit graph.
|
|
30
|
-
|
|
31
|
-
### Layout
|
|
32
|
-
Resizable and collapsible primary view, an extensible bottom panel, and a status bar; theme and widths centralized in settings.
|
|
33
|
-
|
|
34
|
-
### DSH conversation
|
|
35
|
-
Reuses the official conversation UI with messages, coding tools, models, attachments, and permissions.
|
|
36
|
-
|
|
37
|
-
### Terminal
|
|
38
|
-
The workbench includes an interactive local terminal powered by `node-pty` and xterm. Use the terminal icon in the left activity bar to open the bottom panel; it supports multiple terminals, renaming, resize, ANSI output, and Ctrl+C.
|
|
39
|
-
|
|
40
|
-
### Restore
|
|
41
|
-
Persists the active view, tabs, widths, and panel state per workspace across reloads.
|
|
38
|
+
- **Files and editor**: lazy explorer with create, upload, drag-and-drop, rename, delete, and Git markers; Monaco tabs provide dirty state, atomic saves, and conflict notices.
|
|
39
|
+
- **Preview**: Markdown source, outline, relative links, and images; built-in PDF paging and zoom plus DOCX rendering, with DOC/ODT download support.
|
|
40
|
+
- **Search and Git**: `@vscode/ripgrep` supports case, whole-word, regex, and path filters; Git covers stage, unstage, discard, commit, branches, diffs, commit files, and the graph.
|
|
41
|
+
- **Terminal**: `node-pty` and xterm with up to eight sessions, rename, a right-side switcher, splits, ANSI output, and Ctrl+C.
|
|
42
|
+
- **Layout and DSH**: the primary view, terminal panel, and DSH conversation sidebar can be shown and resized independently; settings manage theme and widths.
|
|
43
|
+
- **Sync and restore**: workspace file changes stream to the UI, while reload restores views, tabs, expanded directories, panels, and layout.
|
|
42
44
|
|
|
43
45
|
The workbench mounts through the official `sidebar.footer.action` and `shell.overlay` extension points. It does not replace or disable `ui-layout`.
|
|
44
46
|
|
|
45
|
-
##
|
|
47
|
+
## Demo
|
|
46
48
|
|
|
47
49
|
<p align="center">
|
|
48
50
|
<img src="https://raw.githubusercontent.com/tingfeng347/dsh-vscode-workbench/main/assets/screenshots/explorer.png" width="800" alt="Explorer and Monaco editor">
|
|
@@ -54,21 +56,86 @@ The workbench mounts through the official `sidebar.footer.action` and `shell.ove
|
|
|
54
56
|
<br><em>Source control and commit graph</em>
|
|
55
57
|
</p>
|
|
56
58
|
|
|
57
|
-
|
|
59
|
+
<p align="center">
|
|
60
|
+
<img src="https://pic1.imgdb.cn/i/034GkZFU8ULHsWgFio93Lw.png" width="800" alt="terminal">
|
|
61
|
+
<br><em>terminal</em>
|
|
62
|
+
</p>
|
|
63
|
+
|
|
58
64
|
|
|
59
65
|
## Installation
|
|
60
66
|
|
|
67
|
+
Plugin 0.1.9 targets DeepSeek Harness `0.2.1-alpha.3` (Cordis `4.0.5-alpha.2`). Update Harness before installing; plugin 0.1.8 targets Harness `0.1.1-rc.2`.
|
|
68
|
+
|
|
61
69
|
```bash
|
|
62
70
|
dsh plugin --profile web add dsh-vscode-workbench
|
|
63
71
|
```
|
|
64
72
|
|
|
65
|
-
|
|
73
|
+
### First terminal installation
|
|
74
|
+
|
|
75
|
+
The terminal uses `node-pty`. If installation reports a blocked build script, merge the following into `~/.dsh/profiles/web/pnpm-workspace.yaml` on the DSH host, preserving existing settings:
|
|
66
76
|
|
|
67
77
|
```yaml
|
|
68
78
|
allowBuilds:
|
|
69
79
|
node-pty: true
|
|
70
80
|
```
|
|
71
81
|
|
|
82
|
+
Newer Harness releases may roll back failed installations, so run the install command again after configuring builds. If the plugin is installed but `node-pty` still cannot load, run:
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
cd ~/.dsh/profiles/web
|
|
86
|
+
pnpm rebuild node-pty
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
pnpm can also delay versions published less than 24 hours ago. Retry after the waiting period, or use DSH's "Update now" action when it is offered.
|
|
90
|
+
|
|
91
|
+
### Upgrading an existing installation
|
|
92
|
+
|
|
93
|
+
The running plugin manager rejects installing over an existing package when HMR is active. Remove the old plugin before installing the new version. With the CLI:
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
dsh plugin --profile web remove dsh-vscode-workbench
|
|
97
|
+
dsh plugin --profile web add dsh-vscode-workbench
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Reopen the workbench afterwards; restart `dsh web` and refresh the page if needed.
|
|
101
|
+
|
|
102
|
+
### Install fails: incompatible Harness
|
|
103
|
+
|
|
104
|
+
If the install ends with only this line, Harness refused the plugin before installing anything — pnpm never ran and no file was written:
|
|
105
|
+
|
|
106
|
+
```
|
|
107
|
+
dsh: plugin command failed; diagnostics: ~/.dsh/profiles/<profile>/.plugin-manager/logs/operation-*/pnpm.log
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
Harness runs a compatibility preflight first: it compares the plugin's `@deepseek-ai/dsh*` peerDependencies with the running Harness version and aborts on a mismatch. The diagnostic log holds the actual verdict:
|
|
111
|
+
|
|
112
|
+
```
|
|
113
|
+
dsh: installation rejected: Plugin dsh-vscode-workbench@<plugin version> is incompatible with dsh <Harness version>: peerDependencies {...}
|
|
114
|
+
dsh: nothing was installed.
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
The plugin marketplace files this under the generic `plugin-side install failure`, so the auto-submitted issue body keeps only the `pnpm.log` path instead of that line.
|
|
118
|
+
|
|
119
|
+
| Plugin version | Required Harness |
|
|
120
|
+
| --- | --- |
|
|
121
|
+
| 0.1.9 | `0.2.1-alpha.3` or newer (Cordis `4.0.5-alpha.2`) |
|
|
122
|
+
| 0.1.8 | `0.1.1-rc.2` |
|
|
123
|
+
|
|
124
|
+
No plugin version runs on Harness `0.2.0-rc.2`: 0.1.9 needs the `workingDirectory` service that first shipped in Harness `0.2.1-alpha.2`, while 0.1.8 only targets `0.1.1-rc.2`. Update Harness to `0.2.1-alpha.3` or newer before installing, for example with a global npm install:
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
npm i -g @deepseek-ai/dsh@0.2.1-alpha.4
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
`dsh plugin allow-version` only bypasses the version gate; it does not supply the missing host services, so the plugin still fails to load on `0.2.0-rc.2`. Update Harness instead.
|
|
131
|
+
|
|
132
|
+
### Harness architecture integration
|
|
133
|
+
|
|
134
|
+
- Client contributions use `ui-renderer` slots and select the current session through `ui-session`'s `mainView` retain count, replacing the removed `dsh-client-runtime`.
|
|
135
|
+
- Files, search, Git and new terminals use `workingDirectory.get(session)`. Workspace selection follows the working-directory projection; missing sessions return 404.
|
|
136
|
+
- HTTP and WebSocket routes share Harness authentication and Host/Origin checks through `connection.requestRejection()`. Terminals also require loopback access.
|
|
137
|
+
- The conversation panel locates the official `data-phase` container across the new `conversation.content` layout.
|
|
138
|
+
|
|
72
139
|
## Shortcuts
|
|
73
140
|
|
|
74
141
|
| Shortcut | Action |
|
|
@@ -83,7 +150,7 @@ allowBuilds:
|
|
|
83
150
|
|
|
84
151
|
## Security
|
|
85
152
|
|
|
86
|
-
The host accepts only paths relative to the active DSH session workspace and rejects traversal and symlink escape. Saves use revision checks and atomic replacement. Git and ripgrep run with argument arrays rather than shell-concatenated commands. The terminal accepts same-origin loopback requests only,
|
|
153
|
+
All plugin routes require Harness authentication. The host accepts only paths relative to the active DSH session workspace and rejects traversal and symlink escape. Saves use revision checks and atomic replacement. Git and ripgrep run with argument arrays rather than shell-concatenated commands. The terminal accepts same-origin loopback requests only, stays in the session workspace selected at creation, and removes API keys, tokens, secrets, and similar environment variables.
|
|
87
154
|
|
|
88
155
|
## Development
|
|
89
156
|
|
package/README.md
CHANGED
|
@@ -1,49 +1,50 @@
|
|
|
1
1
|
<h1 align="center">DSH VS Code Workbench</h1>
|
|
2
2
|
|
|
3
|
+
<p align="center">
|
|
4
|
+
<img src="https://raw.githubusercontent.com/tingfeng347/dsh-vscode-workbench/main/assets/dsh-neon-workbench-core.svg" width="220" alt="DSH VS Code Workbench Logo">
|
|
5
|
+
</p>
|
|
6
|
+
|
|
3
7
|
<p align="center">在 DeepSeek Harness 中叠加 VS Code 风格的本地开发工作台。</p>
|
|
4
8
|
|
|
9
|
+
<p align="center">
|
|
10
|
+
<a href="https://www.npmjs.com/package/dsh-vscode-workbench"><img src="https://img.shields.io/npm/v/dsh-vscode-workbench?logo=npm&label=npm" alt="npm 版本"></a>
|
|
11
|
+
<a href="https://www.npmjs.com/package/dsh-vscode-workbench"><img src="https://img.shields.io/npm/dm/dsh-vscode-workbench?label=downloads" alt="npm 月下载量"></a>
|
|
12
|
+
<a href="https://github.com/tingfeng347/dsh-vscode-workbench/stargazers"><img src="https://img.shields.io/github/stars/tingfeng347/dsh-vscode-workbench?logo=github&label=Stars" alt="GitHub Stars"></a>
|
|
13
|
+
<a href="https://github.com/tingfeng347/dsh-vscode-workbench/commits/main"><img src="https://img.shields.io/github/last-commit/tingfeng347/dsh-vscode-workbench?label=last%20commit" alt="最近提交"></a>
|
|
14
|
+
<a href="https://github.com/tingfeng347/dsh-vscode-workbench/blob/main/LICENSE"><img src="https://img.shields.io/github/license/tingfeng347/dsh-vscode-workbench?label=license" alt="MIT 许可证"></a>
|
|
15
|
+
<br>
|
|
16
|
+
<a href="https://awesome-dsh-plugin.com/p/tingfeng347/dsh-vscode-workbench/"><img src="https://awesome-dsh-plugin.com/badge.svg" alt="awesome · DSH plugin"></a>
|
|
17
|
+
<a href="https://dshpluginhub.ai/plugins/dsh-vscode-workbench"><img src="https://dshpluginhub.ai/badges/plugins/dsh-vscode-workbench.svg" alt="DSH Plugin Hub 已收录"></a>
|
|
18
|
+
<a href="https://dshmarket.com/p/tingfeng347/dsh-vscode-workbench/"><img src="https://img.shields.io/badge/dsh--market-已收录-5b7cfa?style=flat" alt="dsh-market 已收录"></a>
|
|
19
|
+
<a href="https://dshmk.com/plugins/1343926987"><img src="https://img.shields.io/badge/DSH%20插件市场-已收录-0ea5e9?style=flat" alt="DSH 插件市场已收录"></a>
|
|
20
|
+
<a href="https://dsh-ai.org/p/tingfeng347/dsh-vscode-workbench"><img src="https://img.shields.io/badge/dsh--ai.org-已收录-8b5cf6?style=flat" alt="dsh-ai.org 已收录"></a>
|
|
21
|
+
<a href="https://duink.com/plugins/1343926987/"><img src="https://img.shields.io/badge/DSH%20Universe-已收录-14b8a6?style=flat" alt="DSH Universe 已收录"></a>
|
|
22
|
+
<a href="https://deepseekplugin.org/plugins/tingfeng347-dsh-vscode-workbench"><img src="https://img.shields.io/badge/DeepseekPlugin-已收录-2563eb?style=flat" alt="DeepseekPlugin 已收录"></a>
|
|
23
|
+
</p>
|
|
24
|
+
|
|
5
25
|
<p align="center"><b>中文</b> · <a href="README.en.md">English</a></p>
|
|
6
26
|
|
|
7
27
|
## 亮点
|
|
8
28
|
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
29
|
+
- **一体化本地工作台**:资源管理器、Monaco 编辑器、搜索、Git、终端和 DSH 对话集中在一个 VS Code 风格界面。
|
|
30
|
+
- **完整文件体验**:文本、Markdown、图片、PDF 和 Word 文档均可直接打开;目录支持拖放上传和常用文件操作。
|
|
31
|
+
- **可靠且实时**:原子保存与版本校验避免静默覆盖,WebSocket 会及时标记工作区的外部变更。
|
|
32
|
+
- **可视化 Git 工作流**:覆盖状态、暂存、提交、分支、差异、提交文件与泳道式提交图。
|
|
33
|
+
- **可持续的工作上下文**:按工作区恢复标签、目录、视图、面板与栏宽;终端支持多会话、分屏与重命名。
|
|
34
|
+
- **贴合 DSH**:右侧直接复用 DSH 对话能力,主题与布局集中在工作台设置中管理。
|
|
14
35
|
|
|
15
36
|
## 功能
|
|
16
37
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
### 预览
|
|
24
|
-
Markdown 默认渲染,可切换源码与大纲;支持工作区相对链接、图片与常见图片文件预览。
|
|
25
|
-
|
|
26
|
-
### 搜索
|
|
27
|
-
基于 `@vscode/ripgrep` 的全文搜索,支持大小写、全词、正则与包含 / 排除规则。
|
|
28
|
-
|
|
29
|
-
### Git
|
|
30
|
-
状态分组、暂存、撤销暂存、丢弃、提交、分支切换、内联 / 并排差异与提交图表。
|
|
31
|
-
|
|
32
|
-
### 布局
|
|
33
|
-
可调节与折叠的左侧视图、可扩展的底部面板与状态栏;设置统一管理主题与栏宽。
|
|
34
|
-
|
|
35
|
-
### DSH 对话
|
|
36
|
-
右侧复用官方会话界面,保留消息、编程工具、模型、附件与权限能力。
|
|
37
|
-
|
|
38
|
-
### 终端
|
|
39
|
-
内置由 `node-pty` 与 xterm 驱动的本地交互终端。点击左侧活动栏终端图标打开底部面板,支持多终端、重命名、尺寸自适应、ANSI 输出与 Ctrl+C。
|
|
40
|
-
|
|
41
|
-
### 状态恢复
|
|
42
|
-
按工作区保存活动视图、标签、栏宽与面板状态,刷新后继续工作。
|
|
38
|
+
- **文件与编辑器**:懒加载目录树、创建、上传、拖放、重命名、删除和 Git 状态;Monaco 多标签编辑支持脏状态、原子保存与冲突提示。
|
|
39
|
+
- **预览**:Markdown 支持源码、大纲、相对链接和图片;内置 PDF 翻页缩放与 DOCX 渲染,DOC/ODT 可直接下载打开。
|
|
40
|
+
- **搜索与 Git**:`@vscode/ripgrep` 支持大小写、全词、正则和路径筛选;Git 提供暂存、撤销、丢弃、提交、分支、差异、提交文件和提交图表。
|
|
41
|
+
- **终端**:基于 `node-pty` 与 xterm,支持最多 8 个会话、会话重命名、右侧切换、分屏、ANSI 输出和 Ctrl+C。
|
|
42
|
+
- **布局与 DSH**:左侧视图、终端面板和右侧 DSH 对话栏可独立显示和调整;设置面板管理主题与各栏宽度。
|
|
43
|
+
- **同步与恢复**:工作区文件变化实时推送;刷新后恢复活动视图、标签、目录展开、面板和布局。
|
|
43
44
|
|
|
44
45
|
工作台通过官方 `sidebar.footer.action` 与 `shell.overlay` 扩展点挂载,不替换或卸载 `ui-layout`。
|
|
45
46
|
|
|
46
|
-
##
|
|
47
|
+
## 演示
|
|
47
48
|
|
|
48
49
|
<p align="center">
|
|
49
50
|
<img src="https://raw.githubusercontent.com/tingfeng347/dsh-vscode-workbench/main/assets/screenshots/explorer.png" width="800" alt="资源管理器与 Monaco 编辑器">
|
|
@@ -55,21 +56,86 @@ Markdown 默认渲染,可切换源码与大纲;支持工作区相对链接
|
|
|
55
56
|
<br><em>源代码管理与提交图表</em>
|
|
56
57
|
</p>
|
|
57
58
|
|
|
58
|
-
|
|
59
|
+
<p align="center">
|
|
60
|
+
<img src="https://pic1.imgdb.cn/i/034GkZFU8ULHsWgFio93Lw.png" width="800" alt="终端">
|
|
61
|
+
<br><em>终端</em>
|
|
62
|
+
</p>
|
|
63
|
+
|
|
59
64
|
|
|
60
65
|
## 安装
|
|
61
66
|
|
|
67
|
+
插件 0.1.9 适配 DeepSeek Harness `0.2.1-alpha.3`(Cordis `4.0.5-alpha.2`)。请先更新 Harness,再安装插件;Harness `0.1.1-rc.2` 对应插件 0.1.8。
|
|
68
|
+
|
|
62
69
|
```bash
|
|
63
70
|
dsh plugin --profile web add dsh-vscode-workbench
|
|
64
71
|
```
|
|
65
72
|
|
|
66
|
-
|
|
73
|
+
### 首次安装终端支持
|
|
74
|
+
|
|
75
|
+
终端使用 `node-pty`。如果安装日志提示其构建脚本被阻止,在 DSH 所在机器的 `~/.dsh/profiles/web/pnpm-workspace.yaml` 中合并以下配置,保留已有设置:
|
|
67
76
|
|
|
68
77
|
```yaml
|
|
69
78
|
allowBuilds:
|
|
70
79
|
node-pty: true
|
|
71
80
|
```
|
|
72
81
|
|
|
82
|
+
新版 Harness 可能回滚失败的安装,配置后应重新执行安装命令。若插件已安装但终端仍提示 `node-pty` 加载失败,可执行:
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
cd ~/.dsh/profiles/web
|
|
86
|
+
pnpm rebuild node-pty
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
刚发布不足 24 小时的版本可能被 pnpm 的安全等待期拦截。等待后重试即可;DSH 提供“立即更新”时可直接选择它。
|
|
90
|
+
|
|
91
|
+
### 从旧版升级
|
|
92
|
+
|
|
93
|
+
运行中的插件管理器启用 HMR 时,不允许覆盖安装同名包。先在插件管理器中移除旧版,再安装新版;CLI 可使用:
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
dsh plugin --profile web remove dsh-vscode-workbench
|
|
97
|
+
dsh plugin --profile web add dsh-vscode-workbench
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
完成后重新打开工作台,必要时重启 `dsh web` 并刷新页面。
|
|
101
|
+
|
|
102
|
+
### 安装失败:Harness 版本不兼容
|
|
103
|
+
|
|
104
|
+
如果安装只以这一行结束,说明 DSH 在安装前就拒绝了插件,pnpm 没有执行、也没有任何文件被写入:
|
|
105
|
+
|
|
106
|
+
```
|
|
107
|
+
dsh: plugin command failed; diagnostics: ~/.dsh/profiles/<profile>/.plugin-manager/logs/operation-*/pnpm.log
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
原因是 Harness 的兼容性预检:它用插件的 `@deepseek-ai/dsh*` peerDependencies 比对当前 Harness 版本,不匹配就中止安装。诊断日志里能看到真正的结论:
|
|
111
|
+
|
|
112
|
+
```
|
|
113
|
+
dsh: installation rejected: Plugin dsh-vscode-workbench@<插件版本> is incompatible with dsh <Harness 版本>: peerDependencies {...}
|
|
114
|
+
dsh: nothing was installed.
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
插件市场把这类失败归入通用的 `plugin-side install failure`,所以自动提交的 Issue 里不会带上上面这行,正文只剩 `pnpm.log` 的路径。
|
|
118
|
+
|
|
119
|
+
| 插件版本 | 需要的 Harness |
|
|
120
|
+
| --- | --- |
|
|
121
|
+
| 0.1.9 | `0.2.1-alpha.3` 及以上(Cordis `4.0.5-alpha.2`) |
|
|
122
|
+
| 0.1.8 | `0.1.1-rc.2` |
|
|
123
|
+
|
|
124
|
+
Harness `0.2.0-rc.2` 上没有可用的插件版本:0.1.9 依赖 Harness `0.2.1-alpha.2` 才引入的 `workingDirectory` 服务,0.1.8 又只适配 `0.1.1-rc.2`。请先把 Harness 升级到 `0.2.1-alpha.3` 及以上再安装,例如 npm 全局安装时:
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
npm i -g @deepseek-ai/dsh@0.2.1-alpha.4
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
`dsh plugin allow-version` 只跳过版本闸门,不会补上缺失的宿主服务,在 `0.2.0-rc.2` 上插件仍然加载不起来;请优先升级 Harness。
|
|
131
|
+
|
|
132
|
+
### 新版架构适配
|
|
133
|
+
|
|
134
|
+
- 客户端通过 `ui-renderer` 提供的槽位服务注册界面,使用 `ui-session` 的 `mainView` 引用选择当前会话;不再依赖已移除的 `dsh-client-runtime`。
|
|
135
|
+
- 文件、搜索、Git 和新建终端通过 `workingDirectory.get(session)` 使用会话当前目录,跟随工作目录投影切换;失效会话返回 404。
|
|
136
|
+
- HTTP 与 WebSocket 接口使用 `connection.requestRejection()`,共享 Harness 登录认证及 Host/Origin 校验;终端额外保留 loopback 限制。
|
|
137
|
+
- 对话栏按官方 `data-phase` 容器定位,支持新版 `conversation.content` 布局。
|
|
138
|
+
|
|
73
139
|
## 快捷键
|
|
74
140
|
|
|
75
141
|
| 快捷键 | 操作 |
|
|
@@ -82,11 +148,11 @@ allowBuilds:
|
|
|
82
148
|
| `Ctrl+\`` | 显示或隐藏终端 |
|
|
83
149
|
| `Ctrl+Shift+\`` | 新建终端 |
|
|
84
150
|
|
|
85
|
-
|
|
151
|
+
左侧活动栏的终端按钮可切换显示或隐藏终端面板。
|
|
86
152
|
|
|
87
153
|
## 安全
|
|
88
154
|
|
|
89
|
-
Host 只接受当前 DSH 会话工作目录内的相对路径,并阻止目录穿越与符号链接越界。保存使用版本校验与原子替换;Git 与 ripgrep 使用参数数组启动,不拼接 Shell 命令。终端只接受同源 loopback
|
|
155
|
+
所有插件接口要求 Harness 登录认证。Host 只接受当前 DSH 会话工作目录内的相对路径,并阻止目录穿越与符号链接越界。保存使用版本校验与原子替换;Git 与 ripgrep 使用参数数组启动,不拼接 Shell 命令。终端只接受同源 loopback 请求,固定在创建时的会话工作目录启动,并移除 API key、token、secret 等敏感环境变量。
|
|
90
156
|
|
|
91
157
|
## 开发
|
|
92
158
|
|
package/lib/client.js
CHANGED
|
@@ -12066,7 +12066,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
12066
12066
|
//#region src/client/DshConversationPanel.tsx
|
|
12067
12067
|
/** Locate the resident DSH conversation without depending on generated CSS module names. */
|
|
12068
12068
|
function findDshConversationRoot(documentRoot = document) {
|
|
12069
|
-
const root = documentRoot.querySelector("[data-conversation-scroll]")?.
|
|
12069
|
+
const root = documentRoot.querySelector("[data-phase] [data-conversation-scroll]")?.closest("[data-phase]");
|
|
12070
12070
|
return root instanceof HTMLElement && root.dataset.phase !== void 0 ? root : null;
|
|
12071
12071
|
}
|
|
12072
12072
|
/** Keep the official conversation mounted while presenting it in the workbench's right column. */
|
|
@@ -47493,15 +47493,13 @@ section.${c}>footer { z-index: 1; }
|
|
|
47493
47493
|
children: "VS Code 工作台"
|
|
47494
47494
|
});
|
|
47495
47495
|
}
|
|
47496
|
-
function Workbench({ service,
|
|
47496
|
+
function Workbench({ service, sessionId, cwd }) {
|
|
47497
47497
|
const [snapshot, setSnapshot] = (0, react.useState)(() => service.getSnapshot());
|
|
47498
47498
|
const [panels, setPanels] = (0, react.useState)(() => service.getPanels());
|
|
47499
47499
|
(0, react.useEffect)(() => service.subscribe(() => {
|
|
47500
47500
|
setSnapshot(service.getSnapshot());
|
|
47501
47501
|
setPanels(service.getPanels());
|
|
47502
47502
|
}), [service]);
|
|
47503
|
-
const sessionId = useSessions((state) => state.current);
|
|
47504
|
-
const cwd = useSessions((state) => sessionId === void 0 ? void 0 : state.byId[sessionId]?.cwd);
|
|
47505
47503
|
const [workspace, setWorkspace] = (0, react.useState)();
|
|
47506
47504
|
const [tabs, setTabs] = (0, react.useState)([]);
|
|
47507
47505
|
const [active, setActive] = (0, react.useState)();
|
|
@@ -48226,9 +48224,9 @@ section.${c}>footer { z-index: 1; }
|
|
|
48226
48224
|
}),
|
|
48227
48225
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
48228
48226
|
className: "dvw-bottom-body",
|
|
48229
|
-
children: Panel &&
|
|
48227
|
+
children: Panel && workspace && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Panel, {
|
|
48230
48228
|
sessionId,
|
|
48231
|
-
cwd,
|
|
48229
|
+
cwd: workspace.cwd,
|
|
48232
48230
|
visible: true,
|
|
48233
48231
|
colorScheme
|
|
48234
48232
|
})
|
|
@@ -48333,13 +48331,21 @@ body[data-ds-dark-theme] .dvw-overlay,.dvw-overlay[data-dvw-theme=dark]{color-sc
|
|
|
48333
48331
|
};
|
|
48334
48332
|
}
|
|
48335
48333
|
//#endregion
|
|
48334
|
+
//#region src/client/session.ts
|
|
48335
|
+
/** Background retains do not select the workspace shown in the main conversation. */
|
|
48336
|
+
function mainViewSession(state) {
|
|
48337
|
+
return Object.values(state.byId).find((session) => (session.retainedBy.mainView ?? 0) > 0);
|
|
48338
|
+
}
|
|
48339
|
+
//#endregion
|
|
48336
48340
|
//#region src/client/index.tsx
|
|
48337
48341
|
const Overlay = ({ service, useSessions }) => {
|
|
48338
|
-
const
|
|
48342
|
+
const session = useSessions(mainViewSession);
|
|
48343
|
+
const cwd = session?.projectionValues?.workingDirectory ?? session?.cwd;
|
|
48339
48344
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Workbench, {
|
|
48340
48345
|
service,
|
|
48341
|
-
|
|
48342
|
-
|
|
48346
|
+
sessionId: session?.id,
|
|
48347
|
+
cwd
|
|
48348
|
+
}, `${session?.id ?? "no-session"}:${cwd ?? ""}`);
|
|
48343
48349
|
};
|
|
48344
48350
|
const Footer = ({ service }) => {
|
|
48345
48351
|
const [target, setTarget] = (0, react.useState)();
|