dsh-better-sidebar 0.10.3 → 0.12.0-beta.1

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.
Files changed (88) hide show
  1. package/README.md +52 -24
  2. package/README_EN.md +51 -23
  3. package/lib/client-editor.js +187 -177
  4. package/lib/client-registry.js +1321 -597
  5. package/lib/client-terminal.js +275 -186
  6. package/lib/client.js +1314 -590
  7. package/lib/index.js +16 -23
  8. package/lib/types/bundle-route.d.ts +4 -5
  9. package/lib/types/client/RenderBoundary.d.ts +32 -0
  10. package/lib/types/client/SideCardSection.d.ts +44 -4
  11. package/lib/types/client/TabBar.d.ts +3 -0
  12. package/lib/types/client/add-plugin-modal.d.ts +15 -0
  13. package/lib/types/client/builtins/viewers.d.ts +1 -1
  14. package/lib/types/client/chunk-loader.d.ts +7 -5
  15. package/lib/types/client/icons.d.ts +0 -6
  16. package/lib/types/client/index.d.ts +7 -0
  17. package/lib/types/client/locales.d.ts +22 -11
  18. package/lib/types/client/open-when-sized.d.ts +20 -0
  19. package/lib/types/client/plugins-shared.d.ts +24 -0
  20. package/lib/types/client/plugins-tabs.d.ts +3 -0
  21. package/lib/types/client/plugins-viewers.d.ts +3 -0
  22. package/lib/types/client/prefs.d.ts +2 -2
  23. package/lib/types/client/service.d.ts +166 -18
  24. package/lib/types/client/split-pane.d.ts +1 -0
  25. package/lib/types/client/state.d.ts +18 -3
  26. package/lib/types/client/terminal-font.d.ts +20 -0
  27. package/lib/types/config.d.ts +1 -1
  28. package/lib/types/context-types.d.ts +43 -16
  29. package/lib/types/index.d.ts +2 -2
  30. package/lib/types/prefs-shared.d.ts +27 -0
  31. package/lib/types/wire.d.ts +5 -5
  32. package/package.json +6 -11
  33. package/scripts/install.ps1 +14 -5
  34. package/scripts/install.sh +1 -1
  35. package/src/bundle-route.ts +5 -6
  36. package/src/client/EditorHost.tsx +5 -2
  37. package/src/client/RenderBoundary.tsx +49 -0
  38. package/src/client/SideCardSection.module.css +430 -65
  39. package/src/client/SideCardSection.tsx +505 -123
  40. package/src/client/Sidebar.tsx +69 -16
  41. package/src/client/TabBar.tsx +28 -3
  42. package/src/client/TerminalView.tsx +48 -4
  43. package/src/client/add-plugin-modal.tsx +154 -0
  44. package/src/client/builtins/tabs.tsx +20 -4
  45. package/src/client/builtins/viewers.tsx +21 -47
  46. package/src/client/chunk-loader.ts +7 -5
  47. package/src/client/icons.tsx +0 -27
  48. package/src/client/index.tsx +14 -40
  49. package/src/client/locales.ts +44 -22
  50. package/src/client/open-when-sized.ts +43 -0
  51. package/src/client/plugins-shared.ts +26 -0
  52. package/src/client/plugins-tabs.ts +27 -0
  53. package/src/client/plugins-viewers.ts +23 -0
  54. package/src/client/prefs.ts +26 -1
  55. package/src/client/service.ts +336 -29
  56. package/src/client/sidebar.module.css +32 -145
  57. package/src/client/split-pane.tsx +10 -3
  58. package/src/client/state.ts +63 -6
  59. package/src/client/terminal-font.ts +28 -0
  60. package/src/config.ts +13 -0
  61. package/src/context-types.ts +47 -14
  62. package/src/html-route.ts +10 -1
  63. package/src/index.ts +20 -24
  64. package/src/prefs-shared.ts +34 -0
  65. package/src/wire.ts +8 -6
  66. package/lib/client-docx.js +0 -7649
  67. package/lib/client-pptx.js +0 -63438
  68. package/lib/client-xlsx.js +0 -359755
  69. package/lib/types/client/PptxView.d.ts +0 -6
  70. package/lib/types/client/chunks/docx.d.ts +0 -8
  71. package/lib/types/client/chunks/pptx.d.ts +0 -8
  72. package/lib/types/client/chunks/xlsx.d.ts +0 -9
  73. package/lib/types/client/docx-view.d.ts +0 -8
  74. package/lib/types/client/office-shared.d.ts +0 -33
  75. package/lib/types/client/office-types.d.ts +0 -36
  76. package/lib/types/client/office-view.d.ts +0 -12
  77. package/lib/types/client/xlsx-to-univer.d.ts +0 -33
  78. package/lib/types/client/xlsx-view.d.ts +0 -10
  79. package/src/client/PptxView.tsx +0 -131
  80. package/src/client/chunks/docx.tsx +0 -8
  81. package/src/client/chunks/pptx.tsx +0 -8
  82. package/src/client/chunks/xlsx.tsx +0 -9
  83. package/src/client/docx-view.tsx +0 -113
  84. package/src/client/office-shared.tsx +0 -40
  85. package/src/client/office-types.ts +0 -48
  86. package/src/client/office-view.tsx +0 -12
  87. package/src/client/xlsx-to-univer.ts +0 -260
  88. package/src/client/xlsx-view.tsx +0 -116
package/README.md CHANGED
@@ -16,22 +16,34 @@ 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
+ <small>v0.12.0</small>
22
+
23
+ | 功能 | 说明 | 截图 |
24
+ |---|---|---|
25
+ | 🔌 服务化基座 | 完整类型导出 + `version`/`features` 能力探测、状态订阅(`getSnapshot`/`subscribeState`)、tab 角标、`onOpen`/`onActivate`/`onClose` 生命周期回调、`updateTab`/`activateTab`/`openFile`、定向打开、`meta` 跨刷新持久化、插件自有设置(`pluginToggles`/`render`) | |
26
+ | ➕ 添加插件 | 设置页「推荐插件目录」+ 一键复制安装命令;内置 Office 预览迁至推荐插件 | |
27
+ | 🖱️ 标签页滚轮 | 标签页栏支持鼠标滚轮横向滚动 | |
28
+ | 🐛 修复 | 远程访问 403(信任栅栏改用 `trustedHosts`)、侧边栏崩溃 [#31](https://github.com/omdsh-dev/DSH-better-sidebar/issues/31)、Windows 下 HTML 预览盘符路径 | |
29
+
19
30
  ## ✨ 功能一览
20
31
 
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 命名空间;切换语言无需刷新
32
+ - **🗂️ 资源管理器**:懒加载目录树(根 = 会话 cwd),点击打开、`@文件` 引用、右键复制路径
33
+ - **📝 编辑与预览**:CodeMirror 6 编辑(Ctrl/Cmd+S 原子保存,切 Tab 不丢草稿);图片 / Markdown / HTML / PDF / Word / Excel / PPT 内联预览(HTML 走沙箱 iframe)
34
+ - **⚡ 客户端懒加载**:启动只拉 ~325KB 核心,终端 / 编辑器等重依赖用到才按需拉取(详见 `docs/plans/2026-08-12-lazy-chunks-design.md`)
35
+ - **🌐 浏览器**:多开内嵌网页 tab,后退/前进/刷新;内容运行在沙箱 iframe(无法访问界面数据与本地文件,拒绝本机地址),可临时解锁(红色警示);被站点拒绝嵌入时显示原因;外链默认在侧边栏打开
36
+ - **💻 终端**:xterm.js + node-pty 真实 shell、断线重连回放;可选为模型注入 `terminal_*` 工具;支持自定义字体(字体族 + 9–32px 字号,实时生效)
37
+ - **🌿 Git 面板**:真 diff + VSCode 式 diff tab、历史、右键暂存/提交/还原等
38
+ - **🧩 后台任务页**:主会话 agent 拓扑、点击直达执行记录;同页显示后台任务(类型徽标 + 退出码、实时输出 peek、可强制终止)
39
+ - **🪟 底部面板**:第二个独立工作台,只挤占中间输出区;首次展开自动开终端(可关)
40
+ - **📱 移动端**:窄屏(<768px)自动合并为全宽抽屉,底部面板标签页并入右侧栏;点文件/外链自动展开
41
+ - **🔧 分栏工作台**:拖 Tab 拆分/合并(可跨面板)、分隔线调比例;右上角按钮一键折叠/展开面板
42
+ - **🔁 会话隔离**:布局 / Tab / 面板状态按会话持久化,陈旧状态自动净化;「产出文件」在侧边栏打开
43
+ - **⚙️ 声明式设置**:设置页「侧边卡片」按注册表渲染开关网格,逐项独立开/关;二级设置(自动展开、终端工具、沙箱等)经齿轮弹窗编辑
44
+ - **🔌 服务化(基座)**:暴露 `ctx.betterSidebar`,其他插件可注册 tab 与文件预览器(内置 7 tab + 9 viewer 同走一服务);v0.12.0 起支持角标/生命周期回调/状态订阅/定向打开/插件自有设置(见 [AGENTS.md](./AGENTS.md) 与 [外部插件接入指南](./docs/external-plugin-guide.md))
45
+ - **➕ 添加插件**:设置页「侧边卡片」两个网格(侧边栏内容 / 文件预览)末尾的虚线卡片分别打开 Tab / 预览插件弹窗:声明扩展点、「在 GitHub 上浏览更多插件」按钮、推荐插件目录(「跳转」直达仓库、「复制」安装命令到剪贴板);弹窗不打开终端、无失败路径,不阻塞启动与侧边栏
46
+ - **🌏 多语言**:界面文案跟随 DSH 语言(zh/en)实时切换,无需刷新
35
47
 
36
48
  ## 🚀 安装
37
49
 
@@ -49,17 +61,17 @@ curl -fsSL https://raw.githubusercontent.com/omdsh-dev/DSH-better-sidebar/main/s
49
61
  irm https://raw.githubusercontent.com/omdsh-dev/DSH-better-sidebar/main/scripts/install.ps1 | iex
50
62
  ```
51
63
 
52
- 装完**重启 DSH 并硬刷新**(Cmd/Ctrl+Shift+R)即可看到侧边栏。
64
+ 装完**硬刷新浏览器**(Cmd/Ctrl+Shift+R)即可看到侧边栏(DSH 对 client 改动热加载,无需重启;仅 host 半更新时需要重启)。
53
65
 
54
66
  <details>
55
67
  <summary><b>指定版本 / 装完自动重启(可选)</b></summary>
56
68
 
57
69
  ```sh
58
70
  # macOS / Linux
59
- curl -fsSL https://raw.githubusercontent.com/omdsh-dev/DSH-better-sidebar/main/scripts/install.sh | bash -s 0.10.3 --restart
71
+ curl -fsSL https://raw.githubusercontent.com/omdsh-dev/DSH-better-sidebar/main/scripts/install.sh | bash -s 0.12.0 --restart
60
72
 
61
73
  # Windows PowerShell
62
- & ([scriptblock]::Create((irm 'https://raw.githubusercontent.com/omdsh-dev/DSH-better-sidebar/main/scripts/install.ps1'))) -Version 0.10.3 -Restart
74
+ & ([scriptblock]::Create((irm 'https://raw.githubusercontent.com/omdsh-dev/DSH-better-sidebar/main/scripts/install.ps1'))) -Version 0.12.0 -Restart
63
75
  ```
64
76
 
65
77
  不确定的话,可先加 `--dry-run`(PowerShell 用 `-DryRun`)预览步骤再执行。
@@ -85,7 +97,7 @@ minimumReleaseAgeExclude:
85
97
  - dsh-better-sidebar
86
98
  EOF
87
99
 
88
- # ③ 安装并自动挂载(不带 @版本 = npm 的 latest;固定版本写 dsh-better-sidebar@0.10.3)
100
+ # ③ 安装并自动挂载(不带 @版本 = npm 的 latest;固定版本写 dsh-better-sidebar@0.12.0)
89
101
  npx -y --package @deepseek-ai/dsh dsh plugin --profile web add dsh-better-sidebar
90
102
  ```
91
103
 
@@ -116,7 +128,7 @@ npx -y --package @deepseek-ai/dsh dsh plugin --profile web add dsh-better-sideba
116
128
  3. 执行 `dsh plugin --profile web add dsh-better-sidebar`:登记依赖 → 识别包内 `dsh.bundle.patch` → 自动注册进 `dsh.profile.bundles` 挂载;
117
129
  4. 清理旧版残留的手动挂载行,避免「双挂载」(页面出现两个侧边栏)。
118
130
 
119
- `curl | bash` / `irm | iex` 会执行远程代码——脚本已随仓库开源(`scripts/install.sh` / `scripts/install.ps1`),可先下载审阅。插件以 npm 包 `dsh-better-sidebar@0.10.3` 发布,通过 `dsh.bundle.patch`(随包的 `cordis.patch.yml`)由官方 CLI 自动挂载,**不修改 DSH 源码**。
131
+ `curl | bash` / `irm | iex` 会执行远程代码——脚本已随仓库开源(`scripts/install.sh` / `scripts/install.ps1`),可先下载审阅。插件以 npm 包 `dsh-better-sidebar@0.12.0` 发布,通过 `dsh.bundle.patch`(随包的 `cordis.patch.yml`)由官方 CLI 自动挂载,**不修改 DSH 源码**。
120
132
 
121
133
  </details>
122
134
 
@@ -127,7 +139,7 @@ npx -y --package @deepseek-ai/dsh dsh plugin --profile web add dsh-better-sideba
127
139
  dsh plugin --profile web add dsh-better-sidebar
128
140
  ```
129
141
 
130
- 或重跑一次一键脚本;也可把 `~/.dsh/profiles/web/package.json` 里的版本号改高后 `pnpm install`。改完**重启 DSH 并硬刷新**(Cmd/Ctrl+Shift+R)。
142
+ 或重跑一次一键脚本;也可把 `~/.dsh/profiles/web/package.json` 里的版本号改高后 `pnpm install`。改完**硬刷新浏览器**(Cmd/Ctrl+Shift+R)即可(client 改动无需重启 DSH)。
131
143
 
132
144
  </details>
133
145
 
@@ -159,10 +171,10 @@ dsh plugin --profile web add dsh-better-sidebar
159
171
  - id: better-sidebar
160
172
  name: 'dsh-better-sidebar'
161
173
  4. 在 ~/.dsh/profiles/web 执行 pnpm install
162
- 5. 重启 DSH 并硬刷新
174
+ 5. 硬刷新浏览器(Cmd/Ctrl+Shift+R)即可看到效果(client 改动无需重启 DSH;host 半改动才需重启)
163
175
  ```
164
176
 
165
- 更新:`git pull && pnpm install && pnpm build` → 重启 DSH(仅 client 改动可硬刷新)。切回 npm 通道时,把依赖改回 `"dsh-better-sidebar": "^0.10.3"` 再 `pnpm install`。
177
+ 更新:`git pull && pnpm install && pnpm build` → 硬刷新浏览器即可(client 改动热加载生效,无需重启 DSH;host 半改动才需重启)。切回 npm 通道时,把依赖改回 `"dsh-better-sidebar": "^0.12.0"` 再 `pnpm install`。
166
178
 
167
179
  </details>
168
180
 
@@ -208,7 +220,17 @@ export function apply(ctx: Context) {
208
220
  }
209
221
  ```
210
222
 
211
- 完整接入文档(`TabDescriptor` / `FileViewerDescriptor` 全字段、匹配算法、HMR 陷阱、声明式设置):见 [`AGENTS.md`](./AGENTS.md)。
223
+ v0.12.0 补齐基座能力(完整类型导出、能力探测、状态订阅、tab 角标、生命周期回调、定向打开、插件自有设置等),详见下方接入文档。
224
+
225
+ 完整接入文档:
226
+ - **[`AGENTS.md`](./AGENTS.md)**——仓库内维护的接入文档(全字段、匹配算法、HMR 陷阱、声明式设置、版本探测);
227
+ - **[`docs/external-plugin-guide.md`](./docs/external-plugin-guide.md)**——面向外部插件开发者的接入指南(含完整最小示例)。
228
+
229
+ ### ➕ 添加插件(推荐插件目录)
230
+
231
+ 设置页「侧边卡片」两个网格末尾的**虚线卡片**分别打开 Tab / 预览插件弹窗:声明扩展点、「**在 GitHub 上浏览更多插件**」按钮([GitHub topic `dsh-better-sidebar`](https://github.com/topics/dsh-better-sidebar))、推荐插件目录(名字 / 仓库 / 简介 / 安装脚本),每个条目「**跳转**」直达仓库、「**复制**」把安装命令写入剪贴板。
232
+
233
+ **收录新插件**:向 [`src/client/plugins-tabs.ts`](./src/client/plugins-tabs.ts)(Tab 注册)或 [`src/client/plugins-viewers.ts`](./src/client/plugins-viewers.ts)(文件预览注册)追加一条 `PluginEntry`,并把仓库打上 `dsh-better-sidebar` topic;数据完整性由 `tests/plugin-list.spec.ts` 守护。
212
234
 
213
235
  ## 🛠️ 开发与构建
214
236
 
@@ -232,7 +254,7 @@ pnpm watch # tsdown --watch
232
254
 
233
255
  - Git 无 push/pull/fetch;无文件 watcher(手动刷新);工具行内文件打开按钮不可拦截
234
256
  - 终端 Tab 拖到另一分栏会重挂载(shell 重开)
235
- - `.xlsx` 预览不保留单元格样式(SheetJS 社区版限制);Office/PPTX 预览内联进 client bundle(约 23MB),首次加载较慢
257
+ - Office 三件套预览(.docx/.xlsx/.pptx)已移至「推荐插件」(Office 预览插件,见设置页「添加插件」弹窗);未安装时此类文件走代码/下载查看兜底
236
258
  - 浏览器沙箱无登录态/第三方 Cookie 受限,部分站点登录需走弹窗;被 `X-Frame-Options`/`frame-ancestors` 拒绝嵌入的站点(如 arxiv.org)显示原因面板(含「在浏览器中打开」);iframe 内部跳转不进后退栈
237
259
  - HTML 预览渲染的是已保存文件(不反映未保存草稿)
238
260
  - 移动端(<768px)无底部面板:进入窄屏时其标签页一次性并入右侧栏(迁移后回桌面仍保留在右侧栏),桌面端的底部面板只在宽视口下可用;移动端底部首展自动开终端不触发
@@ -240,3 +262,9 @@ pnpm watch # tsdown --watch
240
262
  ## 🖥️ 平台支持
241
263
 
242
264
  Windows / Linux / macOS 三平台适配(macOS 日常验证;其余经单元测试覆盖);`node-pty` 优先预编译二进制,失败需编译工具链(Windows VS Build Tools / Linux make+g+++python3 / macOS Xcode CLT)。
265
+
266
+ ## 🔗 友情链接
267
+
268
+ - [dsh-tianshu-tui](https://github.com/huiliyi37/dsh-tianshu-tui):DeepSeek Harness 交互式终端 UI 插件(渲染核心由自研 harness agent Tianshu-Tui 演进而来),在官方基础上增加 TDD 与证据门等工作流
269
+ - [dsh-TUI](https://github.com/ccch1mneyyy/dsh-TUI):Claude Code 风格全屏交互终端插件——像素鲸鱼顶栏、实时工作状态行、思考流式展开、双击 Esc 回滚、上下文进度条 + TPS 仪表,npm 一键安装
270
+ - [dshfind 插件超市](https://dshfind.com/zh/plugins):三方插件市场——GitHub topic `dsh-plugin` 下的公开仓库清单,每日同步 star、贡献者与增长数据
package/README_EN.md CHANGED
@@ -16,22 +16,34 @@ 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
+ <small>v0.12.0</small>
22
+
23
+ | Feature | Description | Screenshot |
24
+ |---|---|---|
25
+ | 🔌 Service API base | Complete type exports + `version`/`features` capability detection, state subscription (`getSnapshot`/`subscribeState`), tab `badge`, `onOpen`/`onActivate`/`onClose` lifecycle callbacks, `updateTab`/`activateTab`/`openFile`, targeted open, `meta` persisted across reloads, plugin-owned settings (`pluginToggles`/`render`) | |
26
+ | ➕ Add Plugins | Recommended plugin catalog in settings + one-click copy install command; built-in Office preview moved to the recommended plugin | |
27
+ | 🖱️ Tab-bar scroll | Mouse-wheel horizontal scrolling on the tab bar | |
28
+ | 🐛 Fixes | Remote access 403 (trust fence now uses `trustedHosts`), sidebar crash [#31](https://github.com/omdsh-dev/DSH-better-sidebar/issues/31), Windows HTML-preview drive-path | |
29
+
19
30
  ## ✨ Features
20
31
 
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
32
+ - **🗂️ File Explorer**: lazy-loading directory tree (root = session cwd), click to open, `@file` reference, right-click to copy path
33
+ - **📝 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)
34
+ - **⚡ Client-side Lazy Loading**: only ~325KB core at startup; heavy deps (terminal / editor) load on demand (see `docs/plans/2026-08-12-lazy-chunks-design.md`)
35
+ - **🌐 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
36
+ - **💻 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)
37
+ - **🌿 Git Panel**: real diff + VSCode-style diff tabs, history, right-click to stage/commit/revert etc.
38
+ - **🧩 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)
39
+ - **🪟 Bottom Panel**: an independent second workbench that only squeezes the center output area; auto-opens a terminal on first expand (toggleable)
40
+ - **📱 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
41
+ - **🔧 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
42
+ - **🔁 Session Isolation**: layout / tabs / panel states persisted per session, stale state auto-purged; "produced files" open in the sidebar
43
+ - **⚙️ 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
44
+ - **🔌 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) and the [external plugin guide](./docs/external-plugin-guide.md))
45
+ - **➕ Add Plugins**: dashed cards at the end of both settings grids ("Sidebar content" / "File viewers") open tab / previewer plugin modals: the extension point declaration, a "Browse more plugins on GitHub" BUTTON, and the recommended plugin catalog ("Open" jumps to the repo, "Copy" puts the install command on the clipboard); no terminal is opened, nothing can fail — never blocking startup or the sidebar
46
+ - **🌏 i18n**: UI text follows DSH's language setting (zh/en) with live switching, no refresh needed
35
47
 
36
48
  ## 🚀 Installation
37
49
 
@@ -49,17 +61,17 @@ curl -fsSL https://raw.githubusercontent.com/omdsh-dev/DSH-better-sidebar/main/s
49
61
  irm https://raw.githubusercontent.com/omdsh-dev/DSH-better-sidebar/main/scripts/install.ps1 | iex
50
62
  ```
51
63
 
52
- Then **restart DSH and hard-refresh** (Cmd/Ctrl+Shift+R) to see the sidebar.
64
+ 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
65
 
54
66
  <details>
55
67
  <summary><b>Pin a version / auto-restart (optional)</b></summary>
56
68
 
57
69
  ```sh
58
70
  # macOS / Linux
59
- curl -fsSL https://raw.githubusercontent.com/omdsh-dev/DSH-better-sidebar/main/scripts/install.sh | bash -s 0.10.3 --restart
71
+ curl -fsSL https://raw.githubusercontent.com/omdsh-dev/DSH-better-sidebar/main/scripts/install.sh | bash -s 0.12.0 --restart
60
72
 
61
73
  # Windows PowerShell
62
- & ([scriptblock]::Create((irm 'https://raw.githubusercontent.com/omdsh-dev/DSH-better-sidebar/main/scripts/install.ps1'))) -Version 0.10.3 -Restart
74
+ & ([scriptblock]::Create((irm 'https://raw.githubusercontent.com/omdsh-dev/DSH-better-sidebar/main/scripts/install.ps1'))) -Version 0.12.0 -Restart
63
75
  ```
64
76
 
65
77
  Not sure? Add `--dry-run` (`-DryRun` in PowerShell) to preview before running.
@@ -85,7 +97,7 @@ minimumReleaseAgeExclude:
85
97
  - dsh-better-sidebar
86
98
  EOF
87
99
 
88
- # ③ Install and auto-mount (no @version = npm's latest; pin with dsh-better-sidebar@0.10.3)
100
+ # ③ Install and auto-mount (no @version = npm's latest; pin with dsh-better-sidebar@0.12.0)
89
101
  npx -y --package @deepseek-ai/dsh dsh plugin --profile web add dsh-better-sidebar
90
102
  ```
91
103
 
@@ -116,7 +128,7 @@ The one-click script does four things, all idempotent (safe to re-run):
116
128
  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`;
117
129
  4. Removes any leftover hand-written mount line to avoid double-mounting (two sidebars on the page).
118
130
 
119
- `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.10.3` and mounts via `dsh.bundle.patch` (the shipped `cordis.patch.yml`), so the DSH source is never modified.
131
+ `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.12.0` and mounts via `dsh.bundle.patch` (the shipped `cordis.patch.yml`), so the DSH source is never modified.
120
132
 
121
133
  </details>
122
134
 
@@ -127,7 +139,7 @@ The one-click script does four things, all idempotent (safe to re-run):
127
139
  dsh plugin --profile web add dsh-better-sidebar
128
140
  ```
129
141
 
130
- or re-run the one-click script; or bump the version in `~/.dsh/profiles/web/package.json` (e.g. `"^0.10.3"`) and run `pnpm install`. Then restart DSH and hard-refresh (Cmd/Ctrl+Shift+R).
142
+ or re-run the one-click script; or bump the version in `~/.dsh/profiles/web/package.json` (e.g. `"^0.12.0"`) and run `pnpm install`. Then hard-refresh the browser (Cmd/Ctrl+Shift+R) — client changes do not need a DSH restart.
131
143
 
132
144
  </details>
133
145
 
@@ -162,7 +174,7 @@ To debug local changes or track the dev branch, point the dependency at a local
162
174
  5. Restart DSH and hard-refresh
163
175
  ```
164
176
 
165
- 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.3"` and re-run `pnpm install`.
177
+ 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.12.0"` and re-run `pnpm install`.
166
178
 
167
179
  </details>
168
180
 
@@ -208,7 +220,17 @@ export function apply(ctx: Context) {
208
220
  }
209
221
  ```
210
222
 
211
- Full integration docs (`TabDescriptor` / `FileViewerDescriptor` full fields, matching algorithm, HMR pitfalls, declarative settings): see [`AGENTS.md`](./AGENTS.md).
223
+ v0.12.0+ base capabilities (complete type exports, capability detection, state subscription, tab badge, lifecycle callbacks, targeted open, plugin-owned settings, etc.) — see the integration docs below.
224
+
225
+ Full integration docs:
226
+ - **[`AGENTS.md`](./AGENTS.md)** — the in-repo integration doc (full fields, matching algorithm, HMR pitfalls, declarative settings, version detection);
227
+ - **[`docs/external-plugin-guide.md`](./docs/external-plugin-guide.md)** — the external-plugin guide (with a complete minimal example).
228
+
229
+ ### ➕ Add Plugins (recommended plugin catalog)
230
+
231
+ The dashed cards at the end of the "Sidebar content" / "File viewers" grids in the "Side Cards" settings section open the **Add tab plugins** / **Add preview plugins** modals: each declares its open extension point, offers a "**Browse more plugins on GitHub**" button (the [GitHub topic `dsh-better-sidebar`](https://github.com/topics/dsh-better-sidebar)), and lists the recommended catalog (name / repo / description / install script) — "**Open**" jumps to the repo, "**Copy**" writes the install command to the clipboard.
232
+
233
+ **Curating a new plugin**: append a `PluginEntry` to [`src/client/plugins-tabs.ts`](./src/client/plugins-tabs.ts) (tab registrations) or [`src/client/plugins-viewers.ts`](./src/client/plugins-viewers.ts) (file-previewer registrations) and tag your repo with the `dsh-better-sidebar` topic; data integrity is guarded by `tests/plugin-list.spec.ts`.
212
234
 
213
235
  ## 🛠️ Development & Build
214
236
 
@@ -232,7 +254,7 @@ pnpm watch # tsdown --watch
232
254
 
233
255
  - Git has no push/pull/fetch; no file watcher (manual refresh); tool inline file-open buttons cannot be intercepted
234
256
  - Dragging a terminal tab to another pane remounts it (shell restarts)
235
- - `.xlsx` preview does not preserve cell styles (SheetJS community-edition limitation); Office/PPTX preview is inlined into the client bundle (~23MB), slower on first load
257
+ - Office-suite preview (.docx/.xlsx/.pptx) moved to the recommended office plugin (see the "Add plugins" modals in settings); without it these files fall through to the code/download fallbacks
236
258
  - Browser sandbox has no login state / third-party cookies are restricted; some sites need popup login; sites that refuse embedding via `X-Frame-Options`/`frame-ancestors` (e.g. arxiv.org) show a reason panel (with "Open in browser"); in-iframe navigation does not enter the back stack
237
259
  - HTML preview renders the saved file (not unsaved drafts)
238
260
  - No bottom panel on mobile (<768px): on narrow screens its tabs merge into the right sidebar once (after migrating back to desktop they stay in the right sidebar); the desktop bottom panel is only available on wide viewports; auto-open terminal on first bottom-panel expand does not trigger on mobile
@@ -240,3 +262,9 @@ pnpm watch # tsdown --watch
240
262
  ## 🖥️ Platform Support
241
263
 
242
264
  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).
265
+
266
+ ## 🔗 Friends
267
+
268
+ - [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
269
+ - [dsh-TUI](https://github.com/ccch1mneyyy/dsh-TUI): a Claude Code-style fullscreen interactive TUI plugin — pixel-whale top bar, live working-status row, streaming thought expansion, double-Esc rollback, context progress bar + TPS meter; one-command npm install
270
+ - [dshfind Plugin Market](https://dshfind.com/zh/plugins): a third-party plugin marketplace — a listing of public repos under the GitHub topic `dsh-plugin`, with stars, contributors and growth data synced daily