dsh-plugin-workbench 0.0.7 → 0.0.8

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
@@ -4,6 +4,22 @@
4
4
  格式基于 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.1.0/),
5
5
  版本号遵循 [Semantic Versioning](https://semver.org/lang/zh-CN/)。
6
6
 
7
+ ## [0.0.8] - 2026-08-20
8
+
9
+ ### Fixed
10
+
11
+ - **删除/复制被占用文件夹不再报裸 "permission denied"**:Windows 上文件夹或其
12
+ 内部任一文件被其他程序占用(编辑器、资源管理器、终端 cd 其中、杀毒扫描)时,
13
+ 改名/删除会以 EPERM/EBUSY 失败。host 端 `rename` / `delete` / `copy` 端点
14
+ 现在先做**有界重试**(3 次、150/300ms 间隔),可自动扛过索引器/杀毒的瞬时
15
+ 占用;仍失败时返回可操作的提示「`名称` is in use by another program —
16
+ close any editor/Explorer view of it (or a terminal inside it) and retry」,
17
+ 替代原先无指引的 "permission denied"
18
+ - **树内复制文本不再误触发文件复制**:在树中选中文件/文件夹后,再去选中树内
19
+ 的实际文本(如行内错误提示)按 Ctrl/Cmd+C/X 时,此前会拦截浏览器原生复制、
20
+ 把选中的文件放进插件剪贴板。现改为:存在非空文本选区或焦点在可编辑元素时,
21
+ 快捷键交给浏览器原生处理,复制的是文字而非文件
22
+
7
23
  ## [0.0.7] - 2026-08-19
8
24
 
9
25
  ### Fixed
package/README.md CHANGED
@@ -4,6 +4,7 @@
4
4
  ![License](https://img.shields.io/github/license/Pasumao/dsh-plugin-workbench)
5
5
  ![CI](https://img.shields.io/github/actions/workflow/status/Pasumao/dsh-plugin-workbench/ci.yml?branch=main)
6
6
  ![Stars](https://img.shields.io/github/stars/Pasumao/dsh-plugin-workbench?style=social)
7
+ ![AI Assisted](https://img.shields.io/badge/AI-Assisted-8A2BE2)
7
8
 
8
9
  **能直接改文件的 VS Code 风格工作台**——不是只读预览:文件树 + 可编辑代码预览
9
10
  (语法高亮、标签页、行号栏)+ 右键文件操作(新建 / 重命名 / 删除 / 复制 / 剪切 /
@@ -48,6 +49,15 @@
48
49
  - 磁盘变更:宿主对打开文件做 `fs.watch`(监听父目录,可存活原子重命名),
49
50
  变更经 SSE `/dsh-plugin-files/events` 推送,干净标签自动同步
50
51
 
52
+ ## 配置
53
+
54
+ 无需环境变量或配置文件,安装后打一次布局补丁即可:
55
+
56
+ - **布局补丁**:`node node_modules/dsh-plugin-workbench/scripts/patch-layout.mjs`
57
+ (针对 `dsh-client-ui-layout@0.1.0-rc.6` 编写,DSH 升级覆盖 bundle 后需重跑);
58
+ - **行为偏好**(自动换行、亮暗主题、标签布局、文件树展开状态)按工作区持久化,无需手动配置;
59
+ - **文件操作通道**:经 loopback RPC `/dsh-plugin-files`,写操作显式以 `danger-full-access` 执行,无外部配置项。
60
+
51
61
  ## 安装
52
62
 
53
63
  > 布局补丁针对 `dsh-client-ui-layout@0.1.0-rc.6` 编写,其他版本需更新锚点。
@@ -59,6 +69,16 @@ dsh plugin --profile web add dsh-plugin-workbench
59
69
  dsh plugin --profile web add github:Pasumao/dsh-plugin-workbench
60
70
  ```
61
71
 
72
+ 源码安装(本地开发 / 调试):
73
+
74
+ ```bash
75
+ git clone https://github.com/Pasumao/dsh-plugin-workbench.git
76
+ cd dsh-plugin-workbench
77
+ pnpm install
78
+ pnpm run build # 产出 lib/index.js 与 lib/client.js
79
+ # 以 link: 方式挂载进 profile
80
+ ```
81
+
62
82
  安装后打布局补丁并重启:
63
83
 
64
84
  ```powershell
package/lib/client.js CHANGED
@@ -1649,6 +1649,12 @@ window.__ModuleLoader__.load({
1649
1649
  const onTreeKeyDown = (0, react.useCallback)((e) => {
1650
1650
  const mod = e.ctrlKey || e.metaKey;
1651
1651
  const key = e.key.toLowerCase();
1652
+ if (mod && (key === "c" || key === "x")) {
1653
+ const target = e.target;
1654
+ if (target !== null && (target.tagName === "INPUT" || target.tagName === "TEXTAREA" || target.isContentEditable)) return;
1655
+ const selection = window.getSelection();
1656
+ if (selection !== null && !selection.isCollapsed && selection.toString().length > 0) return;
1657
+ }
1652
1658
  if (mod && key === "c") {
1653
1659
  const items = selectedItems();
1654
1660
  if (items.length === 0) return;