dsh-better-sidebar 0.10.2 → 0.11.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/README.md CHANGED
@@ -16,58 +16,141 @@ https://github.com/user-attachments/assets/23187822-047e-45cc-b480-fe997bd55b86
16
16
 
17
17
  <img width="2630" height="1794" alt="6c4293e1bec2e935031bf0e986d6ec65" src="https://github.com/user-attachments/assets/dfdb875e-a1a8-4d4b-8340-353736b1708f" />
18
18
 
19
+ ## 🆕 最近更新
20
+
21
+ - **终端自定义字体**:设置页终端卡片新增字体族 + 9–32px 字号设置,实时生效
22
+ - **侧边卡片设置页重构**:分组容器卡片、计数徽标、自定义开关、加宽设置弹窗
23
+ - **修复**:WKWebView 下底部面板展开后终端空白(xterm 零尺寸容器初始化崩溃,[#25](https://github.com/omdsh-dev/DSH-better-sidebar/issues/25))
24
+ - **文档**:client 改动硬刷新即可生效,无需重启 DSH
25
+
19
26
  ## ✨ 功能一览
20
27
 
21
- - **🗂️ 资源管理器**:懒加载目录树(根 = 会话 cwd)、点击在侧边栏打开、行尾 `@文件` 引用到输入框、右键复制路径
22
- - **📝 编辑与预览**:CodeMirror 6 多语言高亮 + Ctrl/Cmd+S 原子保存;图片 / Markdown(预览/编辑切换)/ HTML(沙箱 iframe 预览,相对资源可加载)/ PDF / Word / Excel / PPT 内联预览,切换 Tab 不丢草稿
23
- - **⚡ 客户端懒加载**:Office / 终端 / 代码编辑器等重依赖按需分块加载——启动只拉 ~325KB 核心,打开 .xlsx 才拉 Univer(~20MB)、打开 .docx 只拉 docx 预览器、打开终端才拉 xterm;首次打开短暂 loading 后即用(详见 `docs/plans/2026-08-12-lazy-chunks-design.md`)
24
- - **🌐 浏览器**:内嵌网页浏览 tab(多开),后退/前进/刷新 +「在浏览器中打开」;页面在**沙箱 iframe** 中运行(不透明源:无法访问界面数据与本地文件,拒绝 localhost 等本机地址),界面实时显示沙箱状态、可临时解锁(关闭时红色警示);被站点拒绝嵌入(X-Frame-Options)时显示原因面板;聊天/界面里的 http(s) 外链默认在侧边栏打开(侧边栏折叠时自动展开面板)
25
- - **💻 终端**:xterm.js + node-pty 真实 shell(每会话 3 UI 上限)、Tab 保活重连回放;可选为模型注入 8 个 `terminal_*` 工具
26
- - **🌿 Git 面板**:真 diff + VSCode 式 diff tab、懒加载历史、右键暂存/放弃/提交/还原/捡取
27
- - **🧩 后台任务页**:主会话完整 agent 拓扑、点击直达执行记录、实时工具调用轮询、新子代理自动展开;**同页显示后台任务**(当前树全部后台任务,bash/pwsh 类型徽标 + 退出码,点击查看实时输出——自动跟随底部、非消费 peek,不干扰模型的 `job_output`;两击确认可强制终止)
28
- - **🪟 底部面板**:独立的第二个工作台(与右侧栏同类的标签页),只挤占中间 Agent 输出区、不覆盖左右侧边栏;**首次展开自动开一个新终端**(终端卡片二级设置可关);右上角 x 一键折叠
29
- - **📱 移动端**:视口 < 768px(真正的移动端宽度,不对齐宿主 1024 断点)时只显示右侧栏——进入窄屏时底部面板的标签页**直接并入右侧栏标签条**,右上角只剩一枚开关,面板为全宽抽屉;新会话默认收起,聊天里点文件/外链自动展开,不挤压对话区
30
- - **🔧 分栏工作台**:拖 Tab 拆分/合并分栏(可**跨面板拖 Tab**)、分隔线调比例;右上角持久按钮簇(底栏 + 侧拉 glyph)折叠/展开两个面板;两面板共享拐角双向拖动调节尺寸,拖动 rAF 直写 DOM 保持流畅
31
- - **🔁 会话隔离**:布局/分栏/Tab/两面板状态按会话持久化(localStorage),陈旧状态自动净化;聊天「产出文件」改在侧边栏打开(面板折叠时自动展开)
32
- - **⚙️ 声明式设置**:设置页「侧边卡片」分区按注册表渲染功能清单(小卡片网格,高亮 = 启用),每项可独立开/关;二级设置(子代理自动展开、终端工具、底部面板首展自动开终端、沙箱开关等)经齿轮按钮在原生弹窗中编辑
33
- - **🔌 服务化**:暴露 `ctx.betterSidebar` 服务,其他插件可注册侧边栏 tab 与文件预览器(内置 7 tab + 9 viewer 也走同一服务,详见 [AGENTS.md](./AGENTS.md))
34
- - **🌏 多语言**:界面文案跟随 DSH 的语言设置(zh/en)实时切换——Host 偏好优先于浏览器语言,词典注册进 DSH 的 i18n 命名空间;切换语言无需刷新
28
+ - **🗂️ 资源管理器**:懒加载目录树(根 = 会话 cwd),点击打开、`@文件` 引用、右键复制路径
29
+ - **📝 编辑与预览**:CodeMirror 6 编辑(Ctrl/Cmd+S 原子保存,切 Tab 不丢草稿);图片 / Markdown / HTML / PDF / Word / Excel / PPT 内联预览(HTML 走沙箱 iframe)
30
+ - **⚡ 客户端懒加载**:启动只拉 ~325KB 核心,Office / 终端 / 编辑器等重依赖用到才按需拉取(详见 `docs/plans/2026-08-12-lazy-chunks-design.md`)
31
+ - **🌐 浏览器**:多开内嵌网页 tab,后退/前进/刷新;内容运行在沙箱 iframe(无法访问界面数据与本地文件,拒绝本机地址),可临时解锁(红色警示);被站点拒绝嵌入时显示原因;外链默认在侧边栏打开
32
+ - **💻 终端**:xterm.js + node-pty 真实 shell、断线重连回放;可选为模型注入 `terminal_*` 工具;支持自定义字体(字体族 + 9–32px 字号,实时生效)
33
+ - **🌿 Git 面板**:真 diff + VSCode 式 diff tab、历史、右键暂存/提交/还原等
34
+ - **🧩 后台任务页**:主会话 agent 拓扑、点击直达执行记录;同页显示后台任务(类型徽标 + 退出码、实时输出 peek、可强制终止)
35
+ - **🪟 底部面板**:第二个独立工作台,只挤占中间输出区;首次展开自动开终端(可关)
36
+ - **📱 移动端**:窄屏(<768px)自动合并为全宽抽屉,底部面板标签页并入右侧栏;点文件/外链自动展开
37
+ - **🔧 分栏工作台**:拖 Tab 拆分/合并(可跨面板)、分隔线调比例;右上角按钮一键折叠/展开面板
38
+ - **🔁 会话隔离**:布局 / Tab / 面板状态按会话持久化,陈旧状态自动净化;「产出文件」在侧边栏打开
39
+ - **⚙️ 声明式设置**:设置页「侧边卡片」按注册表渲染开关网格,逐项独立开/关;二级设置(自动展开、终端工具、沙箱等)经齿轮弹窗编辑
40
+ - **🔌 服务化**:暴露 `ctx.betterSidebar`,其他插件可注册 tab 与文件预览器(内置 7 tab + 9 viewer 同走一服务,见 [AGENTS.md](./AGENTS.md))
41
+ - **🌏 多语言**:界面文案跟随 DSH 语言(zh/en)实时切换,无需刷新
35
42
 
36
43
  ## 🚀 安装
37
44
 
38
- 前置:已安装 DSH(`dsh web` 可运行,含 `dsh plugin` 命令),Node.js ≥ 20、pnpm ≥ 10。插件已发布到 npm:**`dsh-better-sidebar@0.10.2`**(`@deepseek-ai/*` peer 依赖对齐宿主实际版本 `^0.1.0-rc.6` / `@deepseek-ai/cordis@^4.0.1`,同版本单实例)。包内声明了 `dsh.bundle.patch`(随包发布的 `cordis.patch.yml`),官方 CLI **一条命令完成安装 + 挂载**,不修改 DSH 源码。
45
+ **前置**:已装好 DSH(`dsh web` 能正常运行),Node.js ≥ 20、pnpm ≥ 10
39
46
 
40
- ### 官方 CLI 安装(推荐)
47
+ **macOS / Linux**(Windows 装了 Git Bash 或 WSL 也可):
41
48
 
42
49
  ```sh
43
- dsh plugin --profile web add dsh-better-sidebar@0.10.2
44
- # 或(本机无 dsh 命令时)
45
- npx -y --package @deepseek-ai/dsh dsh plugin --profile web add dsh-better-sidebar@0.10.2
46
- # 或安装最新发布版
47
- dsh plugin --profile web add dsh-better-sidebar
50
+ curl -fsSL https://raw.githubusercontent.com/omdsh-dev/DSH-better-sidebar/main/scripts/install.sh | bash
48
51
  ```
49
52
 
50
- 命令自动完成:`pnpm add` 登记依赖到 `~/.dsh/profiles/web/package.json` → 识别包内 `dsh.bundle.patch`,把插件自动加进 `dsh.profile.bundles` → 下次启动自动挂载(无需手写 `cordis.patch.yml` 挂载行)。更新同理:`dsh plugin --profile web add dsh-better-sidebar@<新版>`。
53
+ **Windows(PowerShell 5.1+ / pwsh)**:
54
+
55
+ ```powershell
56
+ irm https://raw.githubusercontent.com/omdsh-dev/DSH-better-sidebar/main/scripts/install.ps1 | iex
57
+ ```
51
58
 
52
- > ⚠️ 首次在新 profile 上执行时,pnpm 11 的 `strict-dep-builds` 会拦截 node-pty/protobufjs 的构建脚本,命令会报 `Ignored build scripts`(包仍已安装、node-pty 预编译产物可直接用)。此时在 `~/.dsh/profiles/web` 执行 `pnpm approve-builds --all` 再重跑一次即可;`scripts/install.sh` 会自动处理(预写 allowBuilds + 清理旧挂载行)。
59
+ 装完**硬刷新浏览器**(Cmd/Ctrl+Shift+R)即可看到侧边栏(DSH client 改动热加载,无需重启;仅 host 半更新时需要重启)。
53
60
 
54
- ### 一键脚本(自动处理 allowBuilds / 旧挂载行)
61
+ <details>
62
+ <summary><b>指定版本 / 装完自动重启(可选)</b></summary>
55
63
 
56
64
  ```sh
57
- curl -fsSL https://raw.githubusercontent.com/omdsh-dev/DSH-better-sidebar/main/scripts/install.sh | bash
58
- # 指定版本: curl -fsSL <同上> | bash -s 0.10.2
59
- # 装完自动重启 DSH: curl -fsSL <同上> | bash -s -- --restart
65
+ # macOS / Linux
66
+ curl -fsSL https://raw.githubusercontent.com/omdsh-dev/DSH-better-sidebar/main/scripts/install.sh | bash -s 0.11.0 --restart
67
+
68
+ # Windows PowerShell
69
+ & ([scriptblock]::Create((irm 'https://raw.githubusercontent.com/omdsh-dev/DSH-better-sidebar/main/scripts/install.ps1'))) -Version 0.11.0 -Restart
70
+ ```
71
+
72
+ 不确定的话,可先加 `--dry-run`(PowerShell 用 `-DryRun`)预览步骤再执行。
73
+
74
+ </details>
75
+
76
+ <details>
77
+ <summary><b>手动安装(逐步命令,想看清每一步)</b></summary>
78
+
79
+ 与一键脚本等价。**第 ③ 步可重复执行;①② 只需做一次。**
80
+
81
+ **macOS / Linux(bash)**:
82
+
83
+ ```sh
84
+ cd ~/.dsh/profiles/web
85
+
86
+ # ① 放行 node-pty / protobufjs 的构建脚本(pnpm 11 默认拦截;pnpm 10 可跳过)
87
+ pnpm approve-builds --all
88
+
89
+ # ② 放行「发布不足 24h」的新版本(装老版本可跳过;若已有该键,把下面那行并入其下即可)
90
+ cat >> pnpm-workspace.yaml <<'EOF'
91
+ minimumReleaseAgeExclude:
92
+ - dsh-better-sidebar
93
+ EOF
94
+
95
+ # ③ 安装并自动挂载(不带 @版本 = npm 的 latest;固定版本写 dsh-better-sidebar@0.11.0)
96
+ npx -y --package @deepseek-ai/dsh dsh plugin --profile web add dsh-better-sidebar
97
+ ```
98
+
99
+ **Windows(PowerShell)**:
100
+
101
+ ```powershell
102
+ cd ~\.dsh\profiles\web
103
+
104
+ # ① 放行构建脚本
105
+ pnpm approve-builds --all
106
+
107
+ # ② 放行新版本(一次性;若已有该键,把 - dsh-better-sidebar 并入其下即可)
108
+ Add-Content -Path pnpm-workspace.yaml -Value "`nminimumReleaseAgeExclude:`n - dsh-better-sidebar"
109
+
110
+ # ③ 安装并自动挂载
111
+ npx -y --package @deepseek-ai/dsh dsh plugin --profile web add dsh-better-sidebar
60
112
  ```
61
113
 
62
- ### 更新
114
+ </details>
115
+
116
+ <details>
117
+ <summary><b>脚本内部做了什么(技术细节)</b></summary>
118
+
119
+ 一键脚本自动完成 4 件事(全部幂等,可安全重复执行):
120
+
121
+ 1. 预写 `allowBuilds`(node-pty / protobufjs),规避 pnpm 11 的构建脚本拦截;
122
+ 2. 预写 `minimumReleaseAgeExclude`,放行「发布不足 24 小时」的新版本;
123
+ 3. 执行 `dsh plugin --profile web add dsh-better-sidebar`:登记依赖 → 识别包内 `dsh.bundle.patch` → 自动注册进 `dsh.profile.bundles` 挂载;
124
+ 4. 清理旧版残留的手动挂载行,避免「双挂载」(页面出现两个侧边栏)。
125
+
126
+ `curl | bash` / `irm | iex` 会执行远程代码——脚本已随仓库开源(`scripts/install.sh` / `scripts/install.ps1`),可先下载审阅。插件以 npm 包 `dsh-better-sidebar@0.11.0` 发布,通过 `dsh.bundle.patch`(随包的 `cordis.patch.yml`)由官方 CLI 自动挂载,**不修改 DSH 源码**。
127
+
128
+ </details>
129
+
130
+ <details>
131
+ <summary><b>更新</b></summary>
63
132
 
64
133
  ```sh
65
- dsh plugin --profile web add dsh-better-sidebar@<新版>
134
+ dsh plugin --profile web add dsh-better-sidebar
66
135
  ```
67
136
 
68
- 或手动把 `~/.dsh/profiles/web/package.json` 里版本号改到新版(如 `"^0.10.2"`)后 `pnpm install`。随后重启 DSH 并硬刷新(Cmd/Ctrl+Shift+R)。
137
+ 或重跑一次一键脚本;也可把 `~/.dsh/profiles/web/package.json` 里的版本号改高后 `pnpm install`。改完**硬刷新浏览器**(Cmd/Ctrl+Shift+R)即可(client 改动无需重启 DSH)。
138
+
139
+ </details>
140
+
141
+ <details>
142
+ <summary><b>常见问题</b></summary>
143
+
144
+ | 现象 | 原因与解决 |
145
+ |---|---|
146
+ | 报 `Ignored build scripts` | pnpm 11 拦截构建脚本。跑 `pnpm approve-builds --all`(一键脚本已自动处理)。 |
147
+ | 报 `minimum release age` / 版本不足 24h | 装的版本发布不足 24 小时。等 24h 或重跑一次(pnpm 会自动补 `minimumReleaseAgeExclude`);一键脚本已自动处理。 |
148
+ | 报「找不到 profile 目录」 | 先跑一次 `dsh web`,让它初始化 `~/.dsh/profiles/web`。 |
149
+ | 页面出现**两个侧边栏** | 双挂载:`~/.dsh/profiles/web/cordis.patch.yml` 还留着旧的手动挂载行,删掉那段 `- insert: ... better-sidebar ...`(一键脚本会自动清)。 |
150
+ | Windows 下终端无法使用 | `node-pty` 依赖预编译二进制;若当前 Node 版本没有对应产物,需装编译工具链(VS Build Tools)。主流 Node 版本一般已有预编译。 |
151
+ | Windows 没有 bash / curl | 直接用 PowerShell 一键命令;或安装 Git Bash / WSL 再跑 bash 命令。 |
69
152
 
70
- > 提示:若 pnpm 因 `minimumReleaseAge`(发布 <24h 的新版本)拒绝安装,会自动向 `~/.dsh/profiles/web/pnpm-workspace.yaml` 追加 `minimumReleaseAgeExclude` 条目;也可手动补一行 `dsh-better-sidebar@<版本>`。
153
+ </details>
71
154
 
72
155
  <details>
73
156
  <summary><b>从源码安装 / 开发(可选,替代 npm 方式)</b></summary>
@@ -78,12 +161,15 @@ dsh plugin --profile web add dsh-better-sidebar@<新版>
78
161
  1. git clone https://github.com/omdsh-dev/DSH-better-sidebar.git ~/Code/DSH-better-sidebar
79
162
  cd ~/Code/DSH-better-sidebar && pnpm install && pnpm build
80
163
  2. ~/.dsh/profiles/web/package.json 的 dependencies 写 "dsh-better-sidebar": "link:<克隆目录绝对路径>"
81
- 3. ~/.dsh/profiles/web/cordis.patch.yml 追加挂载行(同上)
164
+ 3. ~/.dsh/profiles/web/cordis.patch.yml 追加挂载行:
165
+ - insert:
166
+ - id: better-sidebar
167
+ name: 'dsh-better-sidebar'
82
168
  4. 在 ~/.dsh/profiles/web 执行 pnpm install
83
- 5. 重启 DSH 并硬刷新
169
+ 5. 硬刷新浏览器(Cmd/Ctrl+Shift+R)即可看到效果(client 改动无需重启 DSH;host 半改动才需重启)
84
170
  ```
85
171
 
86
- 更新:`git pull && pnpm install && pnpm build` → 重启 DSH(仅 client 改动可硬刷新)。切回 npm 通道时,把依赖改回 `"dsh-better-sidebar": "^0.10.2"` 再 `pnpm install`。
172
+ 更新:`git pull && pnpm install && pnpm build` → 硬刷新浏览器即可(client 改动热加载生效,无需重启 DSH;host 半改动才需重启)。切回 npm 通道时,把依赖改回 `"dsh-better-sidebar": "^0.11.0"` 再 `pnpm install`。
87
173
 
88
174
  </details>
89
175
 
@@ -161,3 +247,7 @@ pnpm watch # tsdown --watch
161
247
  ## 🖥️ 平台支持
162
248
 
163
249
  Windows / Linux / macOS 三平台适配(macOS 日常验证;其余经单元测试覆盖);`node-pty` 优先预编译二进制,失败需编译工具链(Windows VS Build Tools / Linux make+g+++python3 / macOS Xcode CLT)。
250
+
251
+ ## 🔗 友情链接
252
+
253
+ - [dsh-tianshu-tui](https://github.com/huiliyi37/dsh-tianshu-tui):DeepSeek Harness 交互式终端 UI 插件(渲染核心由自研 harness agent Tianshu-Tui 演进而来),在官方基础上增加 TDD 与证据门等工作流
package/README_EN.md CHANGED
@@ -16,58 +16,141 @@ https://github.com/user-attachments/assets/23187822-047e-45cc-b480-fe997bd55b86
16
16
 
17
17
  <img width="2630" height="1794" alt="6c4293e1bec2e935031bf0e986d6ec65" src="https://github.com/user-attachments/assets/dfdb875e-a1a8-4d4b-8340-353736b1708f" />
18
18
 
19
+ ## 🆕 Recent Updates
20
+
21
+ - **Custom terminal fonts**: font-family + 9–32px size settings on the terminal card, applied live
22
+ - **Side card settings redesign**: grouped container cards, count badges, custom toggles, wider settings dialog
23
+ - **Fix**: blank terminal after expanding the bottom panel on WKWebView (xterm initialized in a zero-size container, [#25](https://github.com/omdsh-dev/DSH-better-sidebar/issues/25))
24
+ - **Docs**: client changes take effect on a hard refresh — no DSH restart needed
25
+
19
26
  ## ✨ Features
20
27
 
21
- - **🗂️ File Explorer**: lazy-loading directory tree (root = session cwd), click to open in the sidebar, `@file` reference at end of line into the input box, right-click to copy path
22
- - **📝 Edit & Preview**: CodeMirror 6 multi-language highlighting + Ctrl/Cmd+S atomic save; inline preview for images / Markdown (preview/edit toggle) / HTML (sandboxed iframe preview, relative resources loadable) / PDF / Word / Excel / PPT; drafts survive tab switches
23
- - **⚡ Client-side Lazy Loading**: heavy dependencies (Office / terminal / code editor) are chunked and loaded on demand — only ~325KB core is fetched at startup; Univer (~20MB) is fetched only when opening .xlsx, the docx viewer only when opening .docx, xterm only when opening a terminal; brief loading on first open, then instant (see `docs/plans/2026-08-12-lazy-chunks-design.md`)
24
- - **🌐 Browser**: embedded web browsing tabs (multiple), back/forward/refresh + "Open in browser"; pages run in a **sandboxed iframe** (opaque origin: cannot access UI data or local files, rejects localhost and other local addresses); the UI shows sandbox status live and can be temporarily unlocked (red warning when off); sites that refuse embedding (X-Frame-Options) show a reason panel; http(s) links in chat/UI open in the sidebar by default (panel auto-expands when collapsed)
25
- - **💻 Terminal**: xterm.js + node-pty real shell (max 3 UI instances per session), tab keep-alive with reconnect/replay; optionally injects 8 `terminal_*` tools for the model
26
- - **🌿 Git Panel**: real diff + VSCode-style diff tabs, lazy-loaded history, right-click to stage/discard/commit/revert/pick
27
- - **🧩 Background Tasks**: full agent topology of the main session, click-through to execution records, live tool-call polling, auto-expand for new subagents; background tasks shown on the same page (all background tasks in the current tree, bash/pwsh type badges + exit codes, click to view live output — auto-follows the bottom, non-consuming peek that doesn't disturb the model's `job_output`; double-click confirm to force-kill)
28
- - **🪟 Bottom Panel**: an independent second workbench (same kind of tabs as the right sidebar) that only squeezes the middle Agent output area without covering the left/right sidebars; auto-opens a new terminal on first expand (can be disabled in the terminal card's secondary settings); one-click collapse via the top-right x
29
- - **📱 Mobile**: at viewport < 768px (true mobile width, not the host's 1024 breakpoint) only the right sidebar shows — when entering narrow screens, bottom-panel tabs merge directly into the right sidebar's tab bar, leaving a single toggle at top-right and a full-width drawer panel; new sessions start collapsed; files/external links in chat auto-expand without squeezing the conversation area
30
- - **🔧 Split-pane Workbench**: drag tabs to split/merge panes (cross-panel dragging supported), divider to adjust ratios; persistent button cluster at top-right (bottom bar + side pull glyph) to collapse/expand both panels; the two panels share a corner double-direction drag to resize, rAF direct-DOM writes keep it smooth
31
- - **🔁 Session Isolation**: layout/panes/tabs/panel states persisted per session (localStorage), stale state auto-purged; chat "produced files" open in the sidebar (auto-expands panels when collapsed)
32
- - **⚙️ Declarative Settings**: the "Side Cards" section of the settings page renders a registry-driven feature list (small card grid, highlighted = enabled), each toggleable independently; secondary settings (auto-expand subagents, terminal tools, auto-open terminal on first bottom-panel expand, sandbox switches, etc.) are edited in a native dialog via the gear button
33
- - **🔌 Service API**: exposes the `ctx.betterSidebar` service — other plugins can register sidebar tabs and file viewers (the 7 built-in tabs + 9 viewers go through the same service, see [AGENTS.md](./AGENTS.md))
34
- - **🌏 i18n**: UI text follows DSH's language setting (zh/en) with live switching — Host preference takes priority over browser language, dictionaries registered into DSH's i18n namespace; no refresh needed
28
+ - **🗂️ File Explorer**: lazy-loading directory tree (root = session cwd), click to open, `@file` reference, right-click to copy path
29
+ - **📝 Edit & Preview**: CodeMirror 6 editing (Ctrl/Cmd+S atomic save, drafts survive tab switches); inline preview for images / Markdown / HTML / PDF / Word / Excel / PPT (HTML in a sandboxed iframe)
30
+ - **⚡ Client-side Lazy Loading**: only ~325KB core at startup; heavy deps (Office / terminal / editor) load on demand (see `docs/plans/2026-08-12-lazy-chunks-design.md`)
31
+ - **🌐 Browser**: multiple embedded web tabs, back/forward/refresh; pages run in a sandboxed iframe (no access to UI data or local files, rejects local addresses), temporarily unlockable (red warning); sites refusing embedding show a reason panel; external links open in the sidebar by default
32
+ - **💻 Terminal**: xterm.js + node-pty real shell, reconnect with transcript replay; optionally injects `terminal_*` tools for the model; custom font (family + 9–32px size, applied live)
33
+ - **🌿 Git Panel**: real diff + VSCode-style diff tabs, history, right-click to stage/commit/revert etc.
34
+ - **🧩 Background Tasks**: main-session agent topology with click-through to execution records; background tasks on the same page (type badges + exit codes, live-output peek, force-kill)
35
+ - **🪟 Bottom Panel**: an independent second workbench that only squeezes the center output area; auto-opens a terminal on first expand (toggleable)
36
+ - **📱 Mobile**: narrow viewports (<768px) merge into a full-width drawer with the bottom panel's tabs folded into the sidebar; files/links auto-expand the panel
37
+ - **🔧 Split-pane Workbench**: drag tabs to split/merge panes (cross-panel supported), divider to adjust ratios; one-click collapse/expand both panels from the top-right buttons
38
+ - **🔁 Session Isolation**: layout / tabs / panel states persisted per session, stale state auto-purged; "produced files" open in the sidebar
39
+ - **⚙️ Declarative Settings**: the "Side Cards" settings section renders a registry-driven toggle grid, each item independently switchable; secondary settings (auto-expand, terminal tools, sandbox, etc.) edited in a native dialog via the gear button
40
+ - **🔌 Service API**: exposes `ctx.betterSidebar` — other plugins can register tabs and file viewers (the 7 built-in tabs + 9 viewers share the same service, see [AGENTS.md](./AGENTS.md))
41
+ - **🌏 i18n**: UI text follows DSH's language setting (zh/en) with live switching, no refresh needed
35
42
 
36
43
  ## 🚀 Installation
37
44
 
38
- Prerequisites: DSH installed (`dsh web` works, including the `dsh plugin` command), Node.js ≥ 20, pnpm ≥ 10. The plugin is published to npm as **`dsh-better-sidebar@0.10.2`** (`@deepseek-ai/*` peers aligned with the host's actual versions `^0.1.0-rc.6` / `@deepseek-ai/cordis@^4.0.1`, single instance). The package declares `dsh.bundle.patch` (the shipped `cordis.patch.yml`), so the official CLI installs **and mounts in one command** — the DSH source is never modified.
45
+ **Prerequisites**: DSH installed (`dsh web` boots), Node.js ≥ 20, pnpm ≥ 10.
39
46
 
40
- ### Official CLI install (recommended)
47
+ **macOS / Linux** (also works in Git Bash / WSL on Windows):
41
48
 
42
49
  ```sh
43
- dsh plugin --profile web add dsh-better-sidebar@0.10.2
44
- # or (no local dsh command):
45
- npx -y --package @deepseek-ai/dsh dsh plugin --profile web add dsh-better-sidebar@0.10.2
46
- # or install the latest published version:
47
- dsh plugin --profile web add dsh-better-sidebar
50
+ curl -fsSL https://raw.githubusercontent.com/omdsh-dev/DSH-better-sidebar/main/scripts/install.sh | bash
48
51
  ```
49
52
 
50
- The command: runs `pnpm add` to register the dependency in `~/.dsh/profiles/web/package.json`, detects the package's `dsh.bundle.patch`, auto-appends the plugin to `dsh.profile.bundles`, and the next boot mounts it — no hand-written `cordis.patch.yml` mount line. Update the same way: `dsh plugin --profile web add dsh-better-sidebar@<new>`.
53
+ **Windows (PowerShell 5.1+ / pwsh)**:
54
+
55
+ ```powershell
56
+ irm https://raw.githubusercontent.com/omdsh-dev/DSH-better-sidebar/main/scripts/install.ps1 | iex
57
+ ```
51
58
 
52
- > ⚠️ On a fresh profile, pnpm 11's `strict-dep-builds` blocks node-pty/protobufjs build scripts and the command reports `Ignored build scripts` (the package is still installed; node-pty's prebuilds work as-is). Fix: run `pnpm approve-builds --all` in `~/.dsh/profiles/web` and re-run. `scripts/install.sh` handles this automatically (pre-writes allowBuilds + cleans up the old mount line).
59
+ Then **hard-refresh the browser** (Cmd/Ctrl+Shift+R) to see the sidebar (DSH hot-reloads client changes; only host-half updates need a restart).
53
60
 
54
- ### One-click script (handles allowBuilds / old mount line)
61
+ <details>
62
+ <summary><b>Pin a version / auto-restart (optional)</b></summary>
55
63
 
56
64
  ```sh
57
- curl -fsSL https://raw.githubusercontent.com/omdsh-dev/DSH-better-sidebar/main/scripts/install.sh | bash
58
- # Pick a version: curl -fsSL <same URL> | bash -s 0.10.2
59
- # Auto-restart DSH: curl -fsSL <same URL> | bash -s -- --restart
65
+ # macOS / Linux
66
+ curl -fsSL https://raw.githubusercontent.com/omdsh-dev/DSH-better-sidebar/main/scripts/install.sh | bash -s 0.11.0 --restart
67
+
68
+ # Windows PowerShell
69
+ & ([scriptblock]::Create((irm 'https://raw.githubusercontent.com/omdsh-dev/DSH-better-sidebar/main/scripts/install.ps1'))) -Version 0.11.0 -Restart
70
+ ```
71
+
72
+ Not sure? Add `--dry-run` (`-DryRun` in PowerShell) to preview before running.
73
+
74
+ </details>
75
+
76
+ <details>
77
+ <summary><b>Manual install (step by step)</b></summary>
78
+
79
+ Equivalent to the one-click script. **Step ③ is repeatable; ①② only need to run once.**
80
+
81
+ **macOS / Linux (bash)**:
82
+
83
+ ```sh
84
+ cd ~/.dsh/profiles/web
85
+
86
+ # ① Allow node-pty / protobufjs build scripts (pnpm 11 blocks them by default; skip on pnpm 10)
87
+ pnpm approve-builds --all
88
+
89
+ # ② Allow versions published less than 24h ago (skip for older releases; if the key already exists, merge the line under it instead)
90
+ cat >> pnpm-workspace.yaml <<'EOF'
91
+ minimumReleaseAgeExclude:
92
+ - dsh-better-sidebar
93
+ EOF
94
+
95
+ # ③ Install and auto-mount (no @version = npm's latest; pin with dsh-better-sidebar@0.11.0)
96
+ npx -y --package @deepseek-ai/dsh dsh plugin --profile web add dsh-better-sidebar
97
+ ```
98
+
99
+ **Windows (PowerShell)**:
100
+
101
+ ```powershell
102
+ cd ~\.dsh\profiles\web
103
+
104
+ # ① Allow build scripts
105
+ pnpm approve-builds --all
106
+
107
+ # ② Allow fresh releases (once; if the key already exists, merge - dsh-better-sidebar under it instead)
108
+ Add-Content -Path pnpm-workspace.yaml -Value "`nminimumReleaseAgeExclude:`n - dsh-better-sidebar"
109
+
110
+ # ③ Install and auto-mount
111
+ npx -y --package @deepseek-ai/dsh dsh plugin --profile web add dsh-better-sidebar
60
112
  ```
61
113
 
62
- ### Updating
114
+ </details>
115
+
116
+ <details>
117
+ <summary><b>What the script does (technical details)</b></summary>
118
+
119
+ The one-click script does four things, all idempotent (safe to re-run):
120
+
121
+ 1. Pre-writes `allowBuilds` (node-pty / protobufjs) to dodge pnpm 11's build-script block;
122
+ 2. Pre-writes `minimumReleaseAgeExclude` to allow versions younger than 24 hours;
123
+ 3. Runs `dsh plugin --profile web add dsh-better-sidebar`: registers the dependency → detects `dsh.bundle.patch` → auto-appends the plugin to `dsh.profile.bundles`;
124
+ 4. Removes any leftover hand-written mount line to avoid double-mounting (two sidebars on the page).
125
+
126
+ `curl | bash` / `irm | iex` executes remote code — the scripts are open source in the repo (`scripts/install.sh` / `scripts/install.ps1`); download and review them first if you prefer. The plugin ships as npm package `dsh-better-sidebar@0.11.0` and mounts via `dsh.bundle.patch` (the shipped `cordis.patch.yml`), so the DSH source is never modified.
127
+
128
+ </details>
129
+
130
+ <details>
131
+ <summary><b>Updating</b></summary>
63
132
 
64
133
  ```sh
65
- dsh plugin --profile web add dsh-better-sidebar@<new>
134
+ dsh plugin --profile web add dsh-better-sidebar
66
135
  ```
67
136
 
68
- or bump the version range in `~/.dsh/profiles/web/package.json` (e.g. `"^0.10.2"`) and run `pnpm install`. Then restart DSH and hard-refresh (Cmd/Ctrl+Shift+R).
137
+ or re-run the one-click script; or bump the version in `~/.dsh/profiles/web/package.json` (e.g. `"^0.11.0"`) and run `pnpm install`. Then hard-refresh the browser (Cmd/Ctrl+Shift+R) — client changes do not need a DSH restart.
138
+
139
+ </details>
140
+
141
+ <details>
142
+ <summary><b>Troubleshooting</b></summary>
143
+
144
+ | Symptom | Cause & fix |
145
+ |---|---|
146
+ | `Ignored build scripts` | pnpm 11 blocked build scripts. Run `pnpm approve-builds --all` (the one-click script handles it). |
147
+ | `minimum release age` / version `< 24h` | The release is younger than 24 hours. Wait, or re-run once (pnpm auto-adds `minimumReleaseAgeExclude`); the one-click script handles it. |
148
+ | "profile directory not found" | Run `dsh web` once so it initializes `~/.dsh/profiles/web`. |
149
+ | Two sidebars on the page | Double-mount: `~/.dsh/profiles/web/cordis.patch.yml` still has the old hand-written `- insert: ... better-sidebar ...` line — delete it (the one-click script cleans it). |
150
+ | Terminal fails on Windows | `node-pty` relies on prebuilt binaries; if none match your Node version, install a build toolchain (VS Build Tools). Mainstream Node versions are usually covered. |
151
+ | No bash / curl on Windows | Use the PowerShell one-click command, or install Git Bash / WSL and run the bash commands. |
69
152
 
70
- > Note: if pnpm rejects a too-fresh release via `minimumReleaseAge` (<24h old), it auto-appends a `minimumReleaseAgeExclude` entry to `~/.dsh/profiles/web/pnpm-workspace.yaml` — or add `dsh-better-sidebar@<version>` there manually.
153
+ </details>
71
154
 
72
155
  <details>
73
156
  <summary><b>Install from source / develop (optional — alternative to the npm flow)</b></summary>
@@ -78,12 +161,15 @@ To debug local changes or track the dev branch, point the dependency at a local
78
161
  1. git clone https://github.com/omdsh-dev/DSH-better-sidebar.git ~/Code/DSH-better-sidebar
79
162
  cd ~/Code/DSH-better-sidebar && pnpm install && pnpm build
80
163
  2. In ~/.dsh/profiles/web/package.json dependencies write "dsh-better-sidebar": "link:<absolute path of the clone>"
81
- 3. Append the mount line to ~/.dsh/profiles/web/cordis.patch.yml (same as above)
164
+ 3. Append this mount line to ~/.dsh/profiles/web/cordis.patch.yml:
165
+ - insert:
166
+ - id: better-sidebar
167
+ name: 'dsh-better-sidebar'
82
168
  4. Run pnpm install in ~/.dsh/profiles/web
83
169
  5. Restart DSH and hard-refresh
84
170
  ```
85
171
 
86
- Update: `git pull && pnpm install && pnpm build` → restart DSH (client-only changes can just hard-refresh). To switch back to the npm channel, restore `"dsh-better-sidebar": "^0.10.2"` and re-run `pnpm install`.
172
+ Update: `git pull && pnpm install && pnpm build` → just hard-refresh the browser (client changes hot-reload; only host-half changes need a DSH restart). To switch back to the npm channel, restore `"dsh-better-sidebar": "^0.11.0"` and re-run `pnpm install`.
87
173
 
88
174
  </details>
89
175
 
@@ -161,3 +247,7 @@ pnpm watch # tsdown --watch
161
247
  ## 🖥️ Platform Support
162
248
 
163
249
  Windows / Linux / macOS (macOS validated daily; the rest covered by unit tests); `node-pty` prefers prebuilt binaries, otherwise a build toolchain is required (Windows VS Build Tools / Linux make+g+++python3 / macOS Xcode CLT).
250
+
251
+ ## 🔗 Friends
252
+
253
+ - [dsh-tianshu-tui](https://github.com/huiliyi37/dsh-tianshu-tui): an interactive terminal UI plugin for DeepSeek Harness (its rendering core evolved from the self-developed harness agent Tianshu-Tui), adding TDD and evidence-gate workflows on top of the official harness