dsh-plugin-workbench 0.0.13 → 0.0.14

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/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.0.14] - 2026-08-29
4
+
5
+ - 文档:对标生态头部插件优化 README(首屏新增「装完你会看到」;布局补丁话术改为开箱即用);
6
+ - 元数据:npm description 重写(突出可编辑/右键文件操作/@引用),keywords 7 → 15;
7
+ - 新增英文版 README.en.md 与双语切换行。
3
8
  ## [0.0.13] - 2026-08-26
4
9
 
5
10
  ### Fixed
package/README.en.md ADDED
@@ -0,0 +1,180 @@
1
+ [中文](./README.md) | **English**
2
+
3
+ # dsh-plugin-workbench
4
+
5
+ ![npm version](https://img.shields.io/npm/v/dsh-plugin-workbench)
6
+ ![License](https://img.shields.io/github/license/Pasumao/dsh-plugin-workbench)
7
+ ![CI](https://img.shields.io/github/actions/workflow/status/Pasumao/dsh-plugin-workbench/ci.yml?branch=main)
8
+ ![Stars](https://img.shields.io/github/stars/Pasumao/dsh-plugin-workbench?style=social)
9
+ ![AI Assisted](https://img.shields.io/badge/AI-Assisted-8A2BE2)
10
+
11
+ **A VS Code-style workbench that edits files directly** — not a read-only preview: file tree + editable code preview
12
+ (syntax highlighting, tabs, line-number gutter) + right-click file operations (new / rename / delete / copy / cut /
13
+ paste / open in system / reveal in file explorer) + inline image preview, with state saved independently per workspace.
14
+ Once installed, the DSH web GUI becomes a lightweight code editor.
15
+
16
+ > ✅ **Works out of the box**: since 0.0.9 the layout patch is fully automated — it takes effect right after install and
17
+ > restart; if a DSH upgrade overwrites the bundle, the plugin patches it back automatically, with no manual steps
18
+ > required (manual action is only needed if the anchors break, see the "Configuration" section).
19
+
20
+ What you'll see after installing:
21
+
22
+ - A **file tree sidebar** on the left (lazy loading + 2-second auto-refresh, expansion state kept per workspace);
23
+ - `@relative-path` mentions in messages turn into **clickable links** that open a preview in the workbench;
24
+ - **Drag files from the left panel into the chat area** and the path is inserted into the input box automatically.
25
+
26
+ ## Screenshot
27
+
28
+ ![Workbench in the DSH web GUI: file tree + editable preview](docs/workbench-webgui.png)
29
+
30
+ > Real Web GUI screenshot.
31
+
32
+ ## Features
33
+
34
+ - File tree: lazy loading, 2-second auto-refresh, expansion state kept per workspace
35
+ - File icons: colored badges for common code formats / emoji for images, audio & video, archives, etc.; expanded and
36
+ collapsed directories are visually distinguished
37
+ - Editable preview: transparent textarea layered over syntax highlighting, save with `Ctrl+S`/`Cmd+S`;
38
+ Markdown renders a preview by default (one-click switch between source and rendered view); prose formats like
39
+ .txt and very large code files automatically fall back to plain-text editing — fast to load, no UI jank
40
+ - **Disk change sync**: when an open file is modified externally (e.g. saved by an agent or another editor),
41
+ clean tabs reload automatically, while tabs with unsaved edits show a "⟳" badge (click to reload)
42
+ - **Line-number gutter**: logical line numbers along the editor's left edge, locked in alignment with text scrolling
43
+ (works in both plain-text and highlighted modes)
44
+ - **Image preview**: png/jpg/gif/webp/avif/svg and more render inline directly (same-origin byte route, 20MB limit)
45
+ - **Context menu** (VS Code style): right-click on files, folders, **any blank space in the panel, or the panel
46
+ header** — new file, new folder, rename, delete (recursive, with confirmation), copy path, copy / cut / paste,
47
+ refresh, open in system, select all, undo,
48
+ reveal in file explorer (a file is revealed selected in its folder, a folder opens directly;
49
+ Windows `explorer` / macOS `open`, automatically translated under WSL)
50
+ - **Reference files with @ in messages**: the file context-menu item "Reference with @" inserts
51
+ `@workspace-relative-path` into the chat input box; once sent, `@relative-path` mentions in the message render as
52
+ hyperlinks (click to open a preview in the workbench). The syntax is `@` + a workspace-relative path; any other
53
+ `@text` is always displayed as-is and has no special meaning
54
+ - **Drag files into the conversation**: drag a file or a multi-selection from the left panel anywhere into the chat
55
+ area and the path text is inserted at the input box cursor; dropping onto a directory row in the left panel is
56
+ still a move operation
57
+ - **Click anywhere to deselect**: clicking anywhere outside the tree (conversation / other panels / left panel
58
+ header) clears the selection
59
+ - **Copy / cut / paste**: Ctrl/Cmd+C/X/V (or the context menu), with cross-workspace paste support;
60
+ when the target already contains an item with the same name you are asked whether to overwrite, just like the
61
+ system file manager; the clipboard is cleared automatically after a successful cut (move)
62
+ - **Batch operations**: Ctrl/Cmd+click and Ctrl+A multi-select, delete selected items in bulk via the context menu or
63
+ the Delete key, drag the whole group to move it
64
+ - **Undoable operations**: the "↩" button at the top right or Ctrl+Z undoes the most recent operation (kept per
65
+ workspace, up to 30 entries): copy (removes the copy), cut/drag move (moves back to the original place), rename,
66
+ create, delete; deletion is an undoable delete (files are moved instantly into a hidden `.dsh-trash`, no bytes
67
+ copied)
68
+ - **Reveal in file explorer**: a context-menu item (equivalent to VS Code's Reveal in File Explorer) that locates the
69
+ file/folder in the system file manager (Windows Explorer, macOS Finder, etc.), executed via the `reveal` endpoint of
70
+ the loopback RPC
71
+ - Word wrap: one-click soft-wrap toggle in the tab bar (wrapping at the display layer only, file content untouched) or
72
+ horizontal scrolling for long lines; the preference persists
73
+ - Tabs: multiple files, drag to reorder, collapse/pop out; one-click light/dark theme switching
74
+ - Syntax highlighting: highlight.js (JS/TS, Python, JSON, HTML, CSS, Shell, and more;
75
+ Markdown renders a preview by default, switchable to source)
76
+ - Markdown rendering: markdown-it (raw HTML is always escaped, never executed); relative-path images are displayed
77
+ inline via the same-origin route `/dsh-plugin-files/raw/<path>`
78
+ - Disk changes: the host watches open files with `fs.watch` (watching the parent directory, surviving atomic renames);
79
+ changes are pushed over SSE at `/dsh-plugin-files/events`, and clean tabs sync automatically
80
+
81
+ ## Configuration
82
+
83
+ No environment variables or config files needed; the layout patch is fully automated (the plugin automatically detects
84
+ and re-runs `scripts/patch-layout.mjs` at startup — idempotent, non-blocking; written against
85
+ `dsh-client-ui-layout@0.1.0-rc.6`):
86
+ - **Behavior preferences** (word wrap, light/dark theme, tab layout, file tree expansion state) persist per workspace
87
+ and need no manual configuration;
88
+ - **File operation channel**: via the loopback RPC `/dsh-plugin-files`; write operations are executed explicitly under
89
+ `danger-full-access`, with no external configuration options.
90
+
91
+ ## Installation
92
+
93
+ > The layout patch is written against `dsh-client-ui-layout@0.1.0-rc.6`; other versions require updating the anchors.
94
+ > Since 0.0.9 the plugin detects and re-applies the patch automatically at startup (see the "Configuration" section
95
+ > for details).
96
+
97
+ ```powershell
98
+ # npm (recommended)
99
+ dsh plugin --profile web add dsh-plugin-workbench
100
+ # or GitHub
101
+ dsh plugin --profile web add github:Pasumao/dsh-plugin-workbench
102
+ ```
103
+
104
+ Install from source (local development / debugging):
105
+
106
+ ```bash
107
+ git clone https://github.com/Pasumao/dsh-plugin-workbench.git
108
+ cd dsh-plugin-workbench
109
+ pnpm install
110
+ pnpm run build # produces lib/index.js and lib/client.js
111
+ # mount into the profile via link:
112
+ ```
113
+
114
+ After installing, apply the layout patch and restart:
115
+
116
+ ```powershell
117
+ node node_modules/dsh-plugin-workbench/scripts/patch-layout.mjs
118
+ # restart dsh web
119
+ ```
120
+
121
+ > Since 0.0.9 the plugin automatically detects and re-applies the layout patch at startup — no need to run it manually
122
+ > after DSH upgrades; run the command above manually only if the automatic re-patching fails (broken anchors).
123
+
124
+ ## Development
125
+
126
+ ```powershell
127
+ pnpm install
128
+ pnpm run build # produces lib/index.js (host) and lib/client.js (browser)
129
+ pnpm run typecheck
130
+ ```
131
+
132
+ ## Uninstall
133
+
134
+ ```powershell
135
+ dsh plugin --profile web remove dsh-plugin-workbench
136
+ # and restore the layout bundle (patches/layout.backup/client.js.orig → dsh-client-ui-layout/lib/client.js)
137
+ ```
138
+
139
+ ## Notes
140
+
141
+ - The `/dsh-plugin-files` RPC channel is loopback-only; write operations are executed explicitly under
142
+ `danger-full-access`; the context menu's create/rename/delete go through the same channel too (loopback trust,
143
+ same as saving in the editor)
144
+ - Image preview goes through the same-origin route `/dsh-plugin-files/raw/<path>`: it only responds to image
145
+ extensions, resolves the path via `ctx.fs.resolve → stat` first (sandbox-consistent path resolution) before reading
146
+ bytes, with a 20MB limit
147
+ - DSH upgrades overwrite the layout bundle; since 0.0.9 the plugin detects and re-applies the patch automatically at
148
+ startup, so there is no need to re-run it manually; if the anchors break, `scripts/patch-layout.mjs` must be updated
149
+ - This repository does not include DSH build artifacts
150
+
151
+ ## Contributing
152
+
153
+ See [CONTRIBUTING](./CONTRIBUTING.md) and [CODE_OF_CONDUCT](./CODE_OF_CONDUCT.md); the changelog is in
154
+ [CHANGELOG](./CHANGELOG.md).
155
+
156
+ ## Related plugins
157
+
158
+ This plugin is part of **Pasumao's dsh plugin ecosystem**; the published plugins in the same series can be used
159
+ alongside it:
160
+
161
+ | Plugin (npm) | GitHub | Description |
162
+ |---|---|---|
163
+ | [dsh-notify](https://www.npmjs.com/package/dsh-notify) | [GitHub repo](https://github.com/Pasumao/dsh-plugin-notify) | Native Windows notifications + system tray |
164
+ | [dsh-plugin-choice-refresh](https://www.npmjs.com/package/dsh-plugin-choice-refresh) | [GitHub repo](https://github.com/Pasumao/dsh-plugin-choice-refresh) | Choice enhancements: regenerate options / more options |
165
+ | [dsh-plugin-dev-kb](https://www.npmjs.com/package/dsh-plugin-dev-kb) | [GitHub repo](https://github.com/Pasumao/dsh-plugin-dev-kb) | Plugin development knowledge base (full mirror of the official docs + skill) |
166
+ | [dsh-plugin-image-tools](https://www.npmjs.com/package/dsh-plugin-image-tools) | [GitHub repo](https://github.com/Pasumao/dsh-plugin-image-tools) | Image choice cards + inline images in replies + image intake for text-only models |
167
+ | [dsh-plugin-table-zoom](https://www.npmjs.com/package/dsh-plugin-table-zoom) | [GitHub repo](https://github.com/Pasumao/dsh-plugin-table-zoom) | Floating window for long chat tables + one-click Markdown copy |
168
+ | [dsh-plugin-windows-guard](https://www.npmjs.com/package/dsh-plugin-windows-guard) | [GitHub repo](https://github.com/Pasumao/dsh-plugin-windows-guard) | Windows environment safeguards: guideline skills + mojibake detection / dangerous-write interception / encoding diagnosis & repair |
169
+
170
+ > For the remaining plugins in the series, see [Pasumao · dsh plugins](https://github.com/Pasumao); if you find them useful, a ⭐ on GitHub is always welcome.
171
+
172
+ ## AI generation statement
173
+
174
+ Part of the source code and documentation was generated with AI assistance (DeepSeek Harness) and has been
175
+ human-reviewed and verified on a live system; permission-related logic has been re-reviewed against the principle of
176
+ least privilege.
177
+
178
+ ## License
179
+
180
+ [MIT](./LICENSE)
package/README.md CHANGED
@@ -6,13 +6,27 @@
6
6
  ![Stars](https://img.shields.io/github/stars/Pasumao/dsh-plugin-workbench?style=social)
7
7
  ![AI Assisted](https://img.shields.io/badge/AI-Assisted-8A2BE2)
8
8
 
9
+ [**中文**](./README.md) | [English](./README.en.md)
10
+
9
11
  **能直接改文件的 VS Code 风格工作台**——不是只读预览:文件树 + 可编辑代码预览
10
12
  (语法高亮、标签页、行号栏)+ 右键文件操作(新建 / 重命名 / 删除 / 复制 / 剪切 /
11
13
  粘贴 / 在系统中打开 / 在资源管理器打开)+ 图片内联预览,每个工作区独立保存状态。
12
14
  装上之后,DSH 网页就是一个轻量代码编辑器。
13
15
 
14
- > ⚠️ 安装后需打一个布局补丁(见下方安装节);0.0.9 起插件启动时会自动检测并重打,
15
- > DSH 升级覆盖 bundle 后无需再手动跑。
16
+ > **开箱即用**:0.0.9 起布局补丁全自动——装完重启即生效;DSH 升级覆盖 bundle
17
+ > 后插件会自动补回,无需任何手动操作(仅锚点失效时才需手动,见「配置」节)。
18
+
19
+ 装完你会看到:
20
+
21
+ - 左侧多出**文件树侧栏**(懒加载 + 2 秒自动刷新,每工作区独立展开状态);
22
+ - 消息里的 `@相对路径` 变成**可点击链接**,点开直接在工作台预览;
23
+ - 把文件从左栏**拖进聊天区**,路径自动插入输入框。
24
+
25
+ ## 效果图
26
+
27
+ ![workbench 实机截图:DSH 网页内的文件树与可编辑预览](docs/workbench-webgui.png)
28
+
29
+ > 真实 Web GUI 截图。
16
30
 
17
31
  ## 功能
18
32
 
@@ -58,12 +72,9 @@
58
72
 
59
73
  ## 配置
60
74
 
61
- 无需环境变量或配置文件,安装后打一次布局补丁即可:
62
-
63
- - **布局补丁**:插件 host 端启动时自动检测并重跑 `scripts/patch-layout.mjs`
64
- (幂等、非阻塞;针对 `dsh-client-ui-layout@0.1.0-rc.6` 编写)。DSH 升级覆盖
65
- bundle 后插件会自动补回;若自动重打失败(锚点失效),可手动运行
66
- `node node_modules/dsh-plugin-workbench/scripts/patch-layout.mjs`;
75
+ 无需环境变量或配置文件;布局补丁全自动(插件启动时自动检测并重跑
76
+ `scripts/patch-layout.mjs`,幂等、非阻塞;针对 `dsh-client-ui-layout@0.1.0-rc.6`
77
+ 编写):
67
78
  - **行为偏好**(自动换行、亮暗主题、标签布局、文件树展开状态)按工作区持久化,无需手动配置;
68
79
  - **文件操作通道**:经 loopback RPC `/dsh-plugin-files`,写操作显式以 `danger-full-access` 执行,无外部配置项。
69
80
 
@@ -140,7 +151,7 @@ dsh plugin --profile web remove dsh-plugin-workbench
140
151
  | [dsh-plugin-dev-kb](https://www.npmjs.com/package/dsh-plugin-dev-kb) | [GitHub 仓库](https://github.com/Pasumao/dsh-plugin-dev-kb) | 插件开发知识库(官方文档完整镜像 + 技能) |
141
152
  | [dsh-plugin-image-tools](https://www.npmjs.com/package/dsh-plugin-image-tools) | [GitHub 仓库](https://github.com/Pasumao/dsh-plugin-image-tools) | 图片选择卡 + 回复内嵌图片 + 盲模型收图 |
142
153
  | [dsh-plugin-table-zoom](https://www.npmjs.com/package/dsh-plugin-table-zoom) | [GitHub 仓库](https://github.com/Pasumao/dsh-plugin-table-zoom) | 聊天长表格浮窗查看 + 一键复制 Markdown |
143
- | [dsh-plugin-windows-guard](https://www.npmjs.com/package/dsh-plugin-windows-guard) | [GitHub 仓库](https://github.com/Pasumao/dsh-plugin-windows-guard) | Windows 环境防坑守则 skill(编码/转义/路径/进程/乱码预防) |
154
+ | [dsh-plugin-windows-guard](https://www.npmjs.com/package/dsh-plugin-windows-guard) | [GitHub 仓库](https://github.com/Pasumao/dsh-plugin-windows-guard) | Windows 环境防坑:守则技能 + 乱码检测 / 危险写拦截 / 编码诊断修复 |
144
155
 
145
156
  > 本系列其余插件见 [Pasumao · dsh 插件](https://github.com/Pasumao);觉得好用欢迎到 GitHub 点 ⭐。
146
157
 
Binary file
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "dsh-plugin-workbench",
3
- "description": "VS Code-style workspace file explorer + editable preview for the dsh web GUI",
4
- "version": "0.0.13",
3
+ "description": "VS Code-style workspace file explorer for the DeepSeek Harness web GUI — editable preview with syntax highlighting, tabs and line numbers, full right-click file operations (create / rename / delete / copy / cut / paste / reveal in file manager), inline image & markdown preview, @-mention files into chat, drag files into the composer, per-workspace state with undo. Turns the dsh web page into a lightweight code editor.",
4
+ "version": "0.0.14",
5
5
  "type": "module",
6
6
  "packageManager": "pnpm@11.21.0",
7
7
  "engines": {
@@ -41,12 +41,20 @@
41
41
  },
42
42
  "keywords": [
43
43
  "dsh",
44
+ "dsh-plugin",
44
45
  "deepseek-harness",
45
46
  "cordis",
46
47
  "plugin",
47
48
  "file-explorer",
49
+ "file-manager",
50
+ "file-editor",
51
+ "code-editor",
52
+ "web-ide",
48
53
  "vscode",
49
- "workbench"
54
+ "workbench",
55
+ "syntax-highlighting",
56
+ "markdown-preview",
57
+ "image-preview"
50
58
  ],
51
59
  "peerDependencies": {
52
60
  "@deepseek-ai/cordis": "^4.0.1"
@@ -65,9 +73,11 @@
65
73
  "files": [
66
74
  "lib",
67
75
  "scripts",
76
+ "docs",
68
77
  "cordis.patch.yml",
69
78
  "src",
70
79
  "README.md",
80
+ "README.en.md",
71
81
  "CHANGELOG.md",
72
82
  "LICENSE"
73
83
  ]