dsh-better-workspace 0.4.2

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 KannaKuron
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 ADDED
@@ -0,0 +1,118 @@
1
+ # dsh-better-workspace
2
+
3
+ > 给 [DeepSeek Harness (DSH)](https://www.npmjs.com/package/@deepseek-ai/dsh) 的侧边栏「工作区」列表装上一套**文件夹系统**——工作区还是那个工作区(一个目录),但名字里的 `/` 就是层级,让「网页前端」「网页后端」这类工作区可以归到同一个 `web` 分组下。
4
+
5
+ ```
6
+ web/ ← 虚拟分组(不是真实目录,纯命名层级)
7
+ ├─ 前端 ← 工作区「web/前端」
8
+ └─ 后端 ← 工作区「web/后端」
9
+ 测试/
10
+ └─ 两个插件维护 ← 原有的单层工作区照常工作
11
+ ```
12
+
13
+ ## 功能与效果
14
+
15
+ <table>
16
+ <tr>
17
+ <td align="center" width="58%"><img src="docs/screenshots/1-workspace-tree.png" alt="工作区分层树"/></td>
18
+ <td valign="top"><b>层级树</b><br/>工作区名称里的 / 即分组:web/前端、web/后端归到同一个 web 分组下,支持任意多级;不带 / 的工作区照常显示在根层。重命名工作区后树<b>即时重排</b>——分组只是名字的投影,没有第二份需要同步的数据。</td>
19
+ </tr>
20
+ </table>
21
+
22
+ ### 添加工作区:选完文件夹,再选「所属分组」
23
+
24
+ 点「添加工作区」并选完文件夹后,弹出一个小对话框,一行选择工作区所属分组——直接输入(如 `web`)、从下拉里选已有层级(datalist 原生补全),留空就是根分组。确认后插件创建工作区并把分组前缀写进名称,树上自然落位。
25
+
26
+ ### 新建分组
27
+
28
+ 标题栏的「新建分组」按钮可以创建**空分组**(比如先把 `web` 占好位),分组路径支持多级。空分组持久保存在浏览器本地;一旦有工作区落进去,分组就由名称自然派生。
29
+
30
+ ### 会话也吃这套规则
31
+
32
+ 工作区里的会话名称同样用 `/` 分层(如 `测试1/两个插件维护`)。会话分组用**次级配色且无文件夹图标**渲染,和工作区文件夹一眼可辨;会话分组可整组重命名(批量改写成员标题)。
33
+
34
+ <table>
35
+ <tr>
36
+ <td align="center" width="58%"><img src="docs/screenshots/3-appearance-dialog.png" alt="外观自定义弹窗(实时预览)"/></td>
37
+ <td valign="top"><b>外观自定义</b><br/>右键任意一层(工作区分组 / 工作区 / 会话 / 会话分组)→「自定义外观」:颜色(预设色板 + 取色器 + RGB)、发光强度(0..14 拖动条,只作用于文字)、字体粗细、字体阴影开关、图标(与 dsh 图标库同族的 66 个,工作区与工作区分组专属),底部带实时预览。清除自定义一键复原。</td>
38
+ </tr>
39
+ <tr>
40
+ <td align="center" width="58%"><img src="docs/screenshots/2-customized-tree.png" alt="外观自定义效果"/></td>
41
+ <td valign="top"><b>改完即见</b><br/>颜色、文字发光、字体粗细、阴影与图标按行应用,和展开状态一起经 dsh 客户端 store 持久化在当前浏览器。</td>
42
+ </tr>
43
+ </table>
44
+
45
+ <table>
46
+ <tr>
47
+ <td align="center" width="58%"><img src="docs/screenshots/5-context-menu.png" alt="右键菜单"/></td>
48
+ <td valign="top"><b>右键菜单</b><br/>操作都收进右键:工作区行——重命名 / 删除 / 分叉 / 归档 / 自定义外观;工作区分组行——重命名分组(同步更新组内所有工作区名称)/ 删除空分组 / 自定义外观;会话与会话分组行——重命名 / 分叉 / 归档 / 自定义外观。</td>
49
+ </tr>
50
+ </table>
51
+
52
+ <table>
53
+ <tr>
54
+ <td align="center" width="58%"><img src="docs/screenshots/4-settings-card.png" alt="插件设置卡片"/></td>
55
+ <td valign="top"><b>设置卡片</b><br/>设置 → 插件 → 插件配置 里新增「更好的工作区」卡片(官方折叠卡片样式),提供<b>单链分组合并</b>开关(如 测试层1 下只有 AI交易 一个工作区时,合并显示为一行 测试层1/AI交易);展开状态与外观自定义经 dsh 客户端 store 持久化在当前浏览器。</td>
56
+ </tr>
57
+ </table>
58
+
59
+ ### 其余亮点
60
+
61
+ - **文件夹式收起**:点工作区行 = 收起/展开该工作区的全部会话(收起后行上保留会话数角标);会话分组同样可收起;搜索时自动全部展开。
62
+ - **拖拽还原原版能力**:工作区行可拖拽——拖到另一工作区行上/下半即调整顺序(写回宿主 registry 序),拖到分组行则移动进该分组;会话行可拖拽——同工作区拖到另一会话上/下调整顺序,拖到会话子分组即移动进该分组。显示顺序 = 宿主手动序,拖拽结果立即生效。
63
+ - **不丢原生能力**:会话行(打开/重命名/分叉/归档)、每工作区「新会话」、当前会话高亮、官方状态灯(蓝色运行环 / 琥珀待交互 / 绿色完成提醒)、未分组会话兜底、中英双语跟随界面语言。
64
+ - **对话空态页同样生效**:会话空态页的「添加工作区」菜单走的也是本插件的拾取交互,同样带所属分组弹窗。
65
+
66
+ ## 安装
67
+
68
+ ```bash
69
+ dsh plugin --profile web add dsh-better-workspace # npm 公开包
70
+ # 源码与 Release: https://github.com/KannaKuron/dsh-better-workspace
71
+ ```
72
+
73
+ 纯 JS、零构建、零 npm 依赖(只依赖 dsh 客户端基线模块),安装不触发任何构建脚本。装完**重启 DSH** 即生效。
74
+
75
+ <details>
76
+ <summary>手动挂载(不用 CLI 时)</summary>
77
+
78
+ 把包放进 profile 的 `node_modules` 后,在 profile 的 `cordis.patch.yml` 里加:
79
+
80
+ ```yaml
81
+ - insert:
82
+ - id: better-workspace
83
+ name: 'dsh-better-workspace'
84
+ ```
85
+
86
+ </details>
87
+
88
+ ## 工作原理
89
+
90
+ DSH 的侧边栏浏览区是一个公开插槽 `sidebar.workspaces`(single),官方工作区浏览器是它的占用者;本插件以更低优先级注册同一插槽,**整区替换**为层级树版本。数据全部来自插槽标准注入(`useWorkspaces` / `useSessions` 快照钩子),动作(打开会话、重命名/删除工作区、归档等)也走注入的宿主动作——不碰任何私有 API。
91
+
92
+ 「添加工作区」则落在 dsh 专门为第三方设计的一条缝里:`sidebar.workspaces.directoryFlow` 与 `conversation.hero.workspace.directoryFlow` 两个目录流插槽。触发按钮、忙碌语义、错误弹窗全由官方持有;本插件只拥有「触发之后、交付路径之前」的交互——正好用来塞进「选完文件夹 → 弹窗选分组 → 创建 → 改名加前缀」这条链。
93
+
94
+ 视图状态(分组折叠、会话展开、显式空分组)、外观自定义与插件设置都通过 dsh 客户端 store 持久化在浏览器本地(`dsh.betterWorkspace.view.v1`)。注意:该 store 的 hydration 是整值替换、不合并默认值——升级后如果遇到状态字段缺失,重启前的旧状态按旧结构保留,缺的键自动回退默认。
95
+
96
+ ## 与 dsh-better-sidebar 的关系
97
+
98
+ 同属 `dsh-better-*` 家族,但互不重叠:[dsh-better-sidebar](https://github.com/omdsh-dev/DSH-better-sidebar) 是**右侧**的 VSCode 式面板(资源管理器/终端/Git);本插件只接管**左侧**工作区列表。两者可同装。
99
+
100
+ ## 限制与路线图
101
+
102
+ - 会话拖到**另一分组内的会话行**仅做扁平重排(标题分组归属不变);要改分组请拖到分组行或走重命名。
103
+ - 搜索为本地标题过滤;宿主内容搜索(`session.search`)计划接回。
104
+ - 空分组持久在浏览器本地,不同浏览器/设备不共享(路线图:宿主侧分组登记 + 设置页)。
105
+ - flat(平铺)视图未接管,层级树即视图。
106
+
107
+ ## 开发
108
+
109
+ ```bash
110
+ npm test # 冒烟测试:清单一致性 / 基线 require 白名单 / 中英词典对齐 / 语法
111
+ npm pack # 出 tarball 后可本地安装验证
112
+ ```
113
+
114
+ 本地验证:把 `npm pack` 产出的 tarball 装进 web profile 并手动挂载(见上),重启 DSH,验证:层级树渲染、添加工作区弹窗、重命名即时重排、新建分组、卸载后回到原浏览器。
115
+
116
+ ## License
117
+
118
+ [MIT](./LICENSE)
package/README_EN.md ADDED
@@ -0,0 +1,100 @@
1
+ # dsh-better-workspace
2
+
3
+ > A **folder system** for the DeepSeek Harness (DSH) sidebar workspace list — a workspace is still one directory, but every `/` in its name becomes hierarchy, so `web/frontend` and `web/backend` group under one virtual `web` folder.
4
+
5
+ ```
6
+ web/ <- virtual folder (naming only, not a real directory)
7
+ |- frontend <- workspace "web/frontend"
8
+ `- backend <- workspace "web/backend"
9
+ ```
10
+
11
+ ## Features & preview
12
+
13
+ <table>
14
+ <tr>
15
+ <td align="center" width="58%"><img src="docs/screenshots/1-workspace-tree.png" alt="Hierarchical workspace tree"/></td>
16
+ <td valign="top"><b>Hierarchical tree</b><br/>Every `/` in a workspace title creates a virtual folder: web/frontend and web/backend sit under one web group, arbitrarily deep; workspaces without a `/` stay at the root. Renaming a workspace re-derives the tree <b>instantly</b> — folders are a projection of names, there is no second source of truth.</td>
17
+ </tr>
18
+ </table>
19
+
20
+ ### Add flow: pick a folder, then pick a group
21
+
22
+ After you pick a directory for a new workspace, a small dialog asks for the parent group — type one (`web`), pick an existing level from the datalist, or leave it empty for the root. The plugin creates the workspace and writes the prefix into its title, so it lands on the right branch of the tree.
23
+
24
+ ### New-folder button
25
+
26
+ Create explicit empty folders (multi-level paths welcome) that persist in the browser until workspaces live inside them.
27
+
28
+ ### Sessions follow the same rule
29
+
30
+ Session titles nest on `/` too (e.g. `test1/plugin maintenance`). Session groups render in a secondary color without a folder icon, so they are clearly distinct from workspace folders; a session group can be renamed as a whole (rewrites member titles).
31
+
32
+ <table>
33
+ <tr>
34
+ <td align="center" width="58%"><img src="docs/screenshots/3-appearance-dialog.png" alt="Appearance dialog with live preview"/></td>
35
+ <td valign="top"><b>Appearance customization</b><br/>Right-click any row (workspace folder / workspace / session / session group) → Customize: color (swatches + picker + RGB), glow strength (0–14 slider, text only), font weight, font shadow, an icon grid (66 icons from the dsh primitives family, workspace &amp; folder rows only), with a live preview at the bottom. Reset returns to default in one click.</td>
36
+ </tr>
37
+ <tr>
38
+ <td align="center" width="58%"><img src="docs/screenshots/2-customized-tree.png" alt="Custom appearance result"/></td>
39
+ <td valign="top"><b>Applied immediately</b><br/>Color, text glow, font weight, shadow and icon apply per row and persist, together with expansion state, via the dsh client store in the current browser.</td>
40
+ </tr>
41
+ </table>
42
+
43
+ <table>
44
+ <tr>
45
+ <td align="center" width="58%"><img src="docs/screenshots/5-context-menu.png" alt="Context menu"/></td>
46
+ <td valign="top"><b>Context menu everywhere</b><br/>Actions live in the right-click menu: workspace rows — rename / delete / fork / archive / customize; folder rows — rename group (updates all descendant workspaces) / delete empty group / customize; session &amp; session-group rows — rename / fork / archive / customize.</td>
47
+ </tr>
48
+ </table>
49
+
50
+ <table>
51
+ <tr>
52
+ <td align="center" width="58%"><img src="docs/screenshots/4-settings-card.png" alt="Settings card"/></td>
53
+ <td valign="top"><b>Settings card</b><br/>Settings → Plugins → Configuration adds a “Better Workspaces” card (official accordion style) with a <b>single-child-chain merge</b> toggle (e.g. level1 containing only AI trade renders as one row level1/AI trade); expansion state and styling persist via the dsh client store in the browser.</td>
54
+ </tr>
55
+ </table>
56
+
57
+ ### More highlights
58
+
59
+ - **Folder-style collapse**: clicking a workspace row collapses/expands all of its sessions (the row keeps a session counter when collapsed); session groups collapse too; search force-expands everything.
60
+ - **Native drag restored**: drag a workspace row above/below another to reorder (writes back the host registry order) or onto a folder row to move it into that group; drag session rows to reorder within the same workspace or onto a session group to move. Display order = host manual order, drag results are visible immediately.
61
+ - **Native capabilities kept**: open/rename/fork/archive sessions, per-workspace new-session, current-session highlight, official status dots (blue running ring / amber pending / green done), ungrouped-session fallback, zh/en localization.
62
+ - **Conversation hero too**: the empty-state “Add workspace” menu uses the same picking interaction with the same group popup.
63
+
64
+ ## Install
65
+
66
+ ```bash
67
+ dsh plugin --profile web add dsh-better-workspace
68
+ ```
69
+
70
+ Plain JavaScript, zero build, zero npm dependencies (dsh client baseline modules only). Restart DSH after installing.
71
+
72
+ ## How it works
73
+
74
+ The sidebar browsing region is the public `sidebar.workspaces` slot; this plugin registers the same slot with a lower priority and replaces the shipped browser with the tree. All data flows through the slot’s standard snapshot hooks and injected host actions — no private APIs.
75
+
76
+ The add flow lands in the seam dsh designed for third parties: the two `directoryFlow` holes. The trigger, busy semantics, and error dialog stay official; this plugin owns everything between the trigger and the adopted path — exactly enough room for pick → group popup → create → prefixed rename.
77
+
78
+ View state (folder collapse, session expansion, explicit empty folders), custom styling and plugin settings persist browser-side via the dsh client store (`dsh.betterWorkspace.view.v1`).
79
+
80
+ ## Relationship to dsh-better-sidebar
81
+
82
+ Same `dsh-better-*` family, zero overlap: [dsh-better-sidebar](https://github.com/omdsh-dev/DSH-better-sidebar) is the VSCode-like panel on the right; this plugin only takes over the left workspace list. They can be installed together.
83
+
84
+ ## Limitations / roadmap
85
+
86
+ - A session dragged onto a session row **inside another group** only gets reordered in the flat list (its title group stays); drag onto the group row or rename to move it.
87
+ - Search is local title filtering; host content search (`session.search`) is planned.
88
+ - Explicit empty folders persist per-browser (roadmap: host-side folder registry + settings page).
89
+ - The flat view is not taken over; the hierarchical tree is the view.
90
+
91
+ ## Develop
92
+
93
+ ```bash
94
+ npm test # smoke: manifest consistency / baseline require whitelist / dictionary alignment / syntax
95
+ npm pack # tarball for local install verification
96
+ ```
97
+
98
+ ## License
99
+
100
+ [MIT](./LICENSE)
@@ -0,0 +1,22 @@
1
+ # dsh-better-workspace bundle patch.
2
+ #
3
+ # Installed through the official CLI —
4
+ #
5
+ # dsh plugin --profile <name> add dsh-better-workspace
6
+ #
7
+ # — the command reconciles dsh.profile.bundles against installed packages and,
8
+ # seeing this declaration, merges THIS patch exactly like the manual mount
9
+ # line below. No profile file edits needed.
10
+ #
11
+ # Manual mount equivalent (profile cordis.patch.yml):
12
+ #
13
+ # - insert:
14
+ # - id: better-workspace
15
+ # name: 'dsh-better-workspace'
16
+ #
17
+ # Only the Node half loads through this row; the web client half is served
18
+ # through the package's exports["./client"] entry and mounted by the browser
19
+ # boot graph (window.__DSH_BOOT__).
20
+ - insert:
21
+ - id: better-workspace
22
+ name: 'dsh-better-workspace'
@@ -0,0 +1,13 @@
1
+ {
2
+ "id": "dsh-external/dsh-better-workspace",
3
+ "version": "0.4.2",
4
+ "main": "./src/index.js",
5
+ "description": "侧边栏工作区层级树:名称中的 / 即虚拟分组(web/前端 · web/后端),添加工作区的目录流附所属分组弹窗,重命名即时重排层级,可新建空分组。Hierarchy tree for the DSH sidebar workspace list.",
6
+ "engines": {
7
+ "dsh": ">=0.0.1"
8
+ },
9
+ "contributes": {
10
+ "tools": [],
11
+ "skills": []
12
+ }
13
+ }
package/package.json ADDED
@@ -0,0 +1,66 @@
1
+ {
2
+ "name": "dsh-better-workspace",
3
+ "version": "0.4.2",
4
+ "description": "DSH web plugin: a hierarchical workspace tree for the sidebar. Workspace titles containing \"/\" group into virtual folders (web/前端 · web/后端); the add-workspace directory flow gains a parent-group popup; renames re-derive the tree; a new-folder button creates empty levels.",
5
+ "type": "module",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/KannaKuron/dsh-better-workspace.git"
9
+ },
10
+ "publishConfig": {
11
+ "access": "public"
12
+ },
13
+ "main": "src/index.js",
14
+ "exports": {
15
+ ".": "./src/index.js",
16
+ "./client": "./src/client.js"
17
+ },
18
+ "engines": {
19
+ "node": ">=18"
20
+ },
21
+ "dsh": {
22
+ "bundle": {
23
+ "patch": "./cordis.patch.yml"
24
+ },
25
+ "client": {
26
+ "inject": [
27
+ "@deepseek-ai/dsh-client-runtime",
28
+ "@deepseek-ai/dsh-client-locale",
29
+ "@deepseek-ai/dsh-client-ui-slots",
30
+ "@deepseek-ai/dsh-client-ui-conversation",
31
+ "@deepseek-ai/dsh-client-modules"
32
+ ],
33
+ "platform": "web"
34
+ }
35
+ },
36
+ "files": [
37
+ "src/index.js",
38
+ "src/client.js",
39
+ "cordis.patch.yml",
40
+ "dsh.plugin.json",
41
+ "README.md",
42
+ "README_EN.md",
43
+ "LICENSE"
44
+ ],
45
+ "scripts": {
46
+ "test": "node --test tests/smoke.mjs"
47
+ },
48
+ "keywords": [
49
+ "dsh",
50
+ "deepseek-harness",
51
+ "dsh-plugin",
52
+ "sidebar",
53
+ "workspace",
54
+ "dsh-better"
55
+ ],
56
+ "license": "MIT",
57
+ "peerDependencies": {
58
+ "@deepseek-ai/cordis": "^4.0.1",
59
+ "@deepseek-ai/dsh-settings": ">=0.1.0-rc.7",
60
+ "@deepseek-ai/schemastery": "^3.18.1"
61
+ },
62
+ "homepage": "https://github.com/KannaKuron/dsh-better-workspace",
63
+ "bugs": {
64
+ "url": "https://github.com/KannaKuron/dsh-better-workspace/issues"
65
+ }
66
+ }