dsh-workspace-nest 0.0.0-stage → 0.1.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 linye
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,60 @@
1
- # Temporary Holding Version
1
+ # dsh-workspace-nest
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ 侧边栏「工作区」区域的多级树:父工作区下可以继续建子工作区,每一级既能直接新建会话,也能再往下建一层;会话可以**置顶到它所属的那一级文件夹**。
4
+
5
+ ![多级工作区树](https://raw.githubusercontent.com/CIBUDAYI3906/dsh-workspace-nest/main/assets/screenshot-1-tree.png)
6
+
7
+ ## 安装
8
+
9
+ ```sh
10
+ dsh plugin --profile web add dsh-workspace-nest
11
+ ```
12
+
13
+ 重启 `dsh web`。侧边栏的工作区区域会换成本插件渲染的多级树;不想用时停用这一行,自带的工作区浏览器立刻回来。
14
+
15
+ ## 它做什么
16
+
17
+ - **多级子工作区**:任意工作区行的悬停菜单里点「新增子工作区」,会在该工作区目录下创建一个子文件夹并把它注册成普通工作区。层级由目录的祖先关系推导,所以想看几层就看几层。
18
+ - **每一级都能开会话**:父工作区既能放会话,也能放下级文件夹;行菜单里的「新建会话」把会话建在当前这一级。
19
+ - **会话置顶**:会话行菜单里的「置顶」把它排到**所属最近一级文件夹**的会话列表最前面,行尾带图钉标记;置顶集合由 Host 持久化,刷新、重启都不丢。
20
+ - **常用行操作**:重命名、删除、归档、分叉、会话搜索都走真实服务,和自带浏览器一致。
21
+
22
+ ## 为什么需要一个 Host 半边
23
+
24
+ 「新增子工作区」要建目录。浏览器侧的 `createDirectory` 走组合进来的目录选择器;很多部署(比如 macOS 原生选择器)只提供 `pick`、不提供 `createDirectory`,于是那条路永远失败。
25
+
26
+ 本插件的 Host 半边用真实文件系统能力补上这一步:一条本地 JSON POST 路由,名字必须是单个路径段,落点必须仍在父工作区目录内;创建的目录里留一个空的 `.dsh-workspace-nest` 标记文件。路由不可达时,客户端会退回浏览器侧的 `createDirectory`。
27
+
28
+ ## 兼容性
29
+
30
+ - 目标:DSH **0.2.x**(Web / 桌面端),声明在 `package.json` 的 `engines.dsh`;
31
+ - 置顶位和置顶动词是 0.2 的 Host 能力;更旧的客户端上整个置顶入口不出现,而不是点了报错;
32
+ - 客户端 bundle 同时兼容两代符号命名(图标与 store 包名),见 `build.mjs` 里的 `requireAny` / `pickIcon`。
33
+
34
+ ## 数据与隐私
35
+
36
+ - Host 半边只在**父工作区目录内**创建子目录,并写一个空标记文件;不删除任何目录。
37
+ - 没有遥测、没有外部网络请求;置顶状态由 DSH 自己的 workspace 注册表保存,插件不另存一份。
38
+ - 卸载后子工作区目录与其中的文件都保留。
39
+
40
+ ## 卸载
41
+
42
+ ```sh
43
+ dsh plugin --profile web remove dsh-workspace-nest
44
+ ```
45
+
46
+ 已创建的子工作区就是普通工作区,会继续出现在自带的工作区浏览器里。
47
+
48
+ ## 开发
49
+
50
+ ```sh
51
+ npm install
52
+ npm run build # client-source.jsx → client.js
53
+ node scripts/preflight.mjs # 发布前检查
54
+ ```
55
+
56
+ 发布流程见 [PUBLISH.md](PUBLISH.md)。
57
+
58
+ ## License
59
+
60
+ MIT