dsh-better-sidebar 0.13.0 → 0.14.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 +48 -37
- package/README_EN.md +48 -6
- package/cordis.patch.yml +30 -0
- package/lib/client-editor.js +563 -185
- package/lib/client-mermaid.js +199845 -0
- package/lib/client-registry.js +1077 -589
- package/lib/client-terminal.js +201 -160
- package/lib/client.js +1075 -587
- package/lib/index.js +73 -22
- package/lib/types/agent-pty.d.ts +3 -2
- package/lib/types/bundle-route.d.ts +1 -1
- package/lib/types/client/api.d.ts +5 -0
- package/lib/types/client/builtins/index.d.ts +2 -1
- package/lib/types/client/builtins/tabs.d.ts +6 -1
- package/lib/types/client/chunk-loader.d.ts +57 -9
- package/lib/types/client/chunks/mermaid.d.ts +10 -0
- package/lib/types/client/desktop-env.d.ts +34 -0
- package/lib/types/client/index.d.ts +3 -1
- package/lib/types/client/locales.d.ts +13 -0
- package/lib/types/client/mermaid-blocks.d.ts +41 -0
- package/lib/types/client/mermaid-sanitize.d.ts +2 -0
- package/lib/types/client/mermaid.d.ts +12 -0
- package/lib/types/client/plugins-shared.d.ts +3 -0
- package/lib/types/client/service.d.ts +1 -1
- package/lib/types/config.d.ts +12 -1
- package/lib/types/context-types.d.ts +9 -0
- package/lib/types/prefs-shared.d.ts +15 -0
- package/lib/types/pty-manager.d.ts +13 -3
- package/lib/types/tools.d.ts +4 -1
- package/package.json +33 -34
- package/src/agent-pty.ts +4 -1
- package/src/bundle-route.ts +1 -1
- package/src/client/SideCardSection.module.css +80 -0
- package/src/client/SideCardSection.tsx +9 -0
- package/src/client/Sidebar.tsx +251 -47
- package/src/client/TabBar.tsx +39 -3
- package/src/client/TextEditor.tsx +35 -7
- package/src/client/add-plugin-modal.tsx +86 -41
- package/src/client/api.ts +3 -0
- package/src/client/builtins/index.ts +7 -3
- package/src/client/builtins/tabs.tsx +32 -4
- package/src/client/chunk-loader.ts +172 -19
- package/src/client/chunks/mermaid.tsx +10 -0
- package/src/client/desktop-env.ts +58 -0
- package/src/client/index.tsx +106 -9
- package/src/client/layout.css +23 -15
- package/src/client/locales.ts +26 -0
- package/src/client/mermaid-blocks.ts +110 -0
- package/src/client/mermaid-sanitize.ts +93 -0
- package/src/client/mermaid.tsx +401 -0
- package/src/client/plugins-shared.ts +3 -0
- package/src/client/prefs.ts +6 -0
- package/src/client/service.ts +1 -1
- package/src/client/sidebar.module.css +223 -5
- package/src/config.ts +17 -2
- package/src/context-types.ts +7 -0
- package/src/index.ts +42 -8
- package/src/prefs-shared.ts +18 -1
- package/src/pty-manager.ts +28 -3
- package/src/tools.ts +3 -1
package/README.md
CHANGED
|
@@ -15,13 +15,13 @@
|
|
|
15
15
|
</div>
|
|
16
16
|
|
|
17
17
|
<div align="center">
|
|
18
|
-
<video src="https://github.com/user-attachments/assets/23187822-047e-45cc-b480-fe997bd55b86" muted autoplay loop playsinline controls width="100%"></video>
|
|
19
18
|
<img alt="dsh-better-sidebar 工作台截图" src="https://github.com/user-attachments/assets/dfdb875e-a1a8-4d4b-8340-353736b1708f" />
|
|
19
|
+
<video src="https://github.com/user-attachments/assets/23187822-047e-45cc-b480-fe997bd55b86" muted autoplay loop playsinline controls width="100%"></video>
|
|
20
20
|
</div>
|
|
21
21
|
|
|
22
22
|
## ✨ 功能一览
|
|
23
23
|
|
|
24
|
-
- **🗂️ 文件工作台**:资源管理器(懒加载目录树;软链接按目标类型展示——目录软链接可展开、失效链接标红)+ CodeMirror 编辑器;图片 / Markdown
|
|
24
|
+
- **🗂️ 文件工作台**:资源管理器(懒加载目录树;软链接按目标类型展示——目录软链接可展开、失效链接标红)+ CodeMirror 编辑器;图片 / Markdown(含 Mermaid 图表,strict 安全渲染 + 点击放大)/ HTML / PDF / Office 内联预览
|
|
25
25
|
- **🌐 内嵌浏览器**:多开网页 tab,后退 / 前进 / 刷新;内容运行在沙箱 iframe;外链默认按协议分流——HTTP 在侧边栏打开、HTTPS 走系统浏览器(设置页可分别调整)
|
|
26
26
|
- **💻 真实终端**:xterm.js + node-pty 真实 shell,断线重连回放;可选为模型注入 `terminal_*` 工具
|
|
27
27
|
- **🌿 Git 面板**:真 diff + VSCode 式 diff tab、历史、右键暂存 / 提交 / 还原
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
- **🪟 双工作台**:右侧栏 + 底部面板;拖 Tab 拆分 / 合并分栏(可跨面板),移动端自动合并全宽抽屉
|
|
30
30
|
- **🔁 会话隔离**:布局 / Tab / 面板按会话持久化,陈旧状态自动净化
|
|
31
31
|
- **⚙️ 声明式设置**:设置页「侧边卡片」逐项独立开关,二级设置经齿轮弹窗
|
|
32
|
-
- **⚡ 按需加载**:启动只拉 ~325KB 核心,终端 /
|
|
32
|
+
- **⚡ 按需加载**:启动只拉 ~325KB 核心,终端 / 编辑器 / Mermaid 图表等重依赖用到才按需拉取([设计文档](docs/plans/2026-08-12-lazy-chunks-design.md))
|
|
33
33
|
- **🌏 多语言**:界面文案跟随 DSH 语言(zh / en)实时切换
|
|
34
34
|
|
|
35
35
|
> 🔌 **核心理念**:服务优先——内置的 7 tab + 6 viewer 与第三方插件通过同一套 `ctx.betterSidebar` API 注册,能力完全对等;官方不再内置、可由生态提供的功能,交由生态插件实现。接入文档见下方「🔌 服务化」与 [外部插件接入指南](./docs/external-plugin-guide.md)。
|
|
@@ -37,15 +37,49 @@
|
|
|
37
37
|
## 🆕 最近更新
|
|
38
38
|
|
|
39
39
|
<div align="center">
|
|
40
|
-
<a href="https://github.com/user-attachments/assets/
|
|
41
|
-
<a href="https://github.com/user-attachments/assets/
|
|
40
|
+
<a href="https://github.com/user-attachments/assets/d2aea86b-a776-4f01-a6b8-b26b27314336"><img width="33%" alt="侧边栏" src="https://github.com/user-attachments/assets/d2aea86b-a776-4f01-a6b8-b26b27314336" /></a>
|
|
41
|
+
<a href="https://github.com/user-attachments/assets/946f7028-4967-461e-a750-d1b5056b62d0"><img width="33%" alt="服务化基座截图" src="https://github.com/user-attachments/assets/946f7028-4967-461e-a750-d1b5056b62d0" /></a>
|
|
42
|
+
<a href="https://github.com/user-attachments/assets/d4385b7e-aab4-425d-a5c4-2da5da81a34e"><img width="33%" alt="添加插件截图" src="https://github.com/user-attachments/assets/d4385b7e-aab4-425d-a5c4-2da5da81a34e" /></a>
|
|
42
43
|
</div>
|
|
43
44
|
|
|
45
|
+
### v0.14.0
|
|
46
|
+
|
|
47
|
+
> ⚠️ **本版适配 DSH 0.1.0-rc.8**:全部 `@deepseek-ai/*` peer / devDependencies 升至 `^0.1.0-rc.8`(含传递依赖,lockfile 零 rc.7 残留),`cordis` 同步 `^4.0.0-rc.8`,CI 挂载冒烟钉版 `@deepseek-ai/dsh@0.1.0-rc.8`。**rc.7 及更早的 DSH 环境将无法解析本版依赖,请先升级 DSH**。自 v0.13.1 以来的全部更改:
|
|
48
|
+
|
|
49
|
+
**✨ 新功能**
|
|
50
|
+
|
|
51
|
+
- 🖼️ **统一面板宿主注入重构**([#232](https://github.com/omdsh-dev/DSH-better-sidebar/pull/232)):面板/开关簇迁入 `[data-dsh-panel-host]` 固定含块层(`fixed inset-0 z-40`),免疫桌面套壳中间层 transform 对 fixed 含块的劫持;挂载自检(页面级 transform → `data-dsh-panel-host-degraded` 降级同步,按未修正几何判定、祖先变换消失才退出);推挤锚点改 `#root [data-dsh-frame] > [data-pane="conversation"]` + `#root` calc 宽度防桌面壳加性溢出;chunk 激活重验证(HEAD+ETag 保留未变 chunk,5s 超时兜底 fail-open);桌面信号自动探测(win32 advanced 标题栏兼容 32px 避让,手动 pref 可覆盖);`visualViewport` 键盘 inset + `env(safe-area-inset-*)` 移动端适配
|
|
52
|
+
- 📂 **文件打开方式默认独立**([#232](https://github.com/omdsh-dev/DSH-better-sidebar/pull/232)):`editorExplorer` 默认从「合并」改为「独立」——新会话树点击 / 打开文件按路径**新开**文件 tab,无路径窗口即纯资源管理器;合并模式保留为可选手动开启
|
|
53
|
+
- 🖥️ **终端 shell / shellArgs 设置页可配**([#232](https://github.com/omdsh-dev/DSH-better-sidebar/pull/232)):终端卡齿轮二级页面新增「Shell 路径」「Shell 参数」两行配置(此前只能通过 `cordis.patch.yml` 配置)——设置页写入后对**之后打开的** UI 终端与模型终端(`terminal_create`)即时生效;留空保持 yaml → `$SHELL` / 登录 shell / `powershell.exe` 的既有解析顺序
|
|
54
|
+
- 🏷️ **设置页版本徽标**([#232](https://github.com/omdsh-dev/DSH-better-sidebar/pull/232)):侧边卡片设置页顶部新增 `DSH-better-sidebar v0.14.0` 身份徽标(版本与服务实例同步,由测试守护)
|
|
55
|
+
- 🔍 **添加插件目录搜索 / 分组 / 独立滚动**([#232](https://github.com/omdsh-dev/DSH-better-sidebar/pull/232)):为插件生态增长做准备——目录列表顶部加实时搜索(按名称 / id / 描述过滤),条目支持可选 `category` 分组渲染,列表独立滚动(弹窗不再随条目数无限增长)
|
|
56
|
+
|
|
57
|
+
**🐛 修复**
|
|
58
|
+
|
|
59
|
+
- 🔧 **适配 DSH 0.1.0-rc.8**([#232](https://github.com/omdsh-dev/DSH-better-sidebar/pull/232)):13 个 `@deepseek-ai/*` peer / devDependencies 升至 `^0.1.0-rc.8`(含传递链,lockfile 零 rc.7 残留),`cordis` 同步 `^4.0.0-rc.8`;移除随 rc.8 消失的 `dsh-client-web-react` / `dsh-client-schema-form`(壳模块表不再提供、插件零引用);CI 挂载冒烟钉版 `@deepseek-ai/dsh@0.1.0-rc.8`;pnpm 11.8 supply-chain 校验适配
|
|
60
|
+
- 🧩 **rc.8 模块系统迁移**([#232](https://github.com/omdsh-dev/DSH-better-sidebar/pull/232)):rc.8 不再暴露 `window.__DSH_MODULES__` 页面全局(改由 `ctx.modules` 服务提供),懒加载 chunk 的外部依赖解析全面失效——client 注入 `modules` 服务 + 插件自有全局共享给 chunk 副本(终端 / 编辑器 / Mermaid 恢复正常按需加载)
|
|
61
|
+
- 🧩 **chunk 重验证屏障健壮性**([#232](https://github.com/omdsh-dev/DSH-better-sidebar/pull/232)):HEAD 重验证加 5s 超时兜底(路由挂起时 fail-open 重取,屏障不再可能无限期阻塞懒加载);`resetChunks` 清挂起的重验证屏障
|
|
62
|
+
- 🖱️ **拖拽健壮性**([#232](https://github.com/omdsh-dev/DSH-better-sidebar/pull/232)):快速释放(浏览器合并 / 丢失 pointermove 突发)时提交最后已知拖动位置而非回退;`pointercancel` / 捕获丢失中断同样保留拖动结果;提交后立即重测中心列(消除底栏宽度中间帧抖动);HMR 重激活后中心列重定位兜底(`<html>` 样式观察 + 底栏打开重测),修复热更新后底栏空白 / 输入框位移
|
|
63
|
+
|
|
64
|
+
### v0.13.1
|
|
65
|
+
|
|
66
|
+
**✨ 新功能**
|
|
67
|
+
|
|
68
|
+
- 📊 **Markdown 预览安全渲染 Mermaid 图表**([#164](https://github.com/omdsh-dev/DSH-better-sidebar/pull/164)):预览的 md 含 mermaid fence 时按需下发 `client-mermaid.js` chunk(~7MB,无 mermaid 文件零加载);纵深防御渲染——`securityLevel: 'strict'` + `htmlLabels: false`(节点文字走真实 SVG `<text>`)+ SVG 注入前二次清洗(删 `foreignObject`/`script`/外来 HTML 元素、剥 `@*`/`on*`/`href` 属性);点击图表在弹窗中放大(滚轮以鼠标为中心缩放、拖拽平移、工具栏与快捷键),深浅色跟随重渲、解析失败回退原码
|
|
69
|
+
- 🖥️ **终端 shell 与 shellArgs 可配置**([#125](https://github.com/omdsh-dev/DSH-better-sidebar/pull/125)):`cordis.patch.yml` 的 `better-sidebar.config` 可指定 `shell` / `shellArgs`(`shellArgs` 非空时完全替换默认参数;未配置维持自动解析 `$SHELL` / 登录 shell / `powershell.exe` 原行为),UI 终端与 agent 终端(`terminal_create`)同时生效;终端 tab 标题改用 shell 名(bash / zsh / powershell),内部标识改 UUID,同 shell 可开多个终端
|
|
70
|
+
|
|
71
|
+
**🐛 修复**
|
|
72
|
+
|
|
73
|
+
- 🔗 **聚合双挂载自动退让**([#200](https://github.com/omdsh-dev/DSH-better-sidebar/pull/200)):聚合包(如 dsh-web-ui-all)以独立条目 id 挂载同包时,`cordis.patch.yml` 的守卫表达式自动禁用自身 `better-sidebar` 行,不再重复注册 `/sidebar/api` 导致 `duplicate prefix route` 整个插件树启动失败(`dsh web` 崩溃);独立安装行为不变
|
|
74
|
+
- 🔧 **peer 依赖对齐 DSH 0.1.0-rc.7**([#207](https://github.com/omdsh-dev/DSH-better-sidebar/pull/207),修复 [#206](https://github.com/omdsh-dev/DSH-better-sidebar/issues/206)):全部 `@deepseek-ai/*` peer / devDependencies 从 `^0.1.0-rc.6` 升至 `^0.1.0-rc.7`,CI 挂载冒烟同步钉版——消除主框架升至 rc.7 后 rc.6 / rc.7 混用依赖树导致的 `agent-presets: refusing to compose an unscoped context`(选模型 / 发消息报错)
|
|
75
|
+
|
|
44
76
|
### v0.13.0
|
|
45
77
|
|
|
46
78
|
**✨ 新功能**
|
|
47
79
|
|
|
48
|
-
-
|
|
80
|
+
- 📁 **文件窗口与资源管理器二合一**([#151](https://github.com/omdsh-dev/DSH-better-sidebar/pull/151)):新 `editorExplorer` 设置(编辑器卡齿轮)——文件 tab 增加路径输入框头部 + 可开关的右侧停靠文件树(每 tab 记忆展开/宽度,左缘拖拽调宽 160~480px,全局文件名搜索走 host `fs.search` 路由,预算封顶并跳过 `.git` / 符号链接目录);独立模式(默认)树点击 / 输入框 Enter **按路径新开**文件 tab,合并模式**原地切换**当前 tab;新会话默认 seed 空文件窗口(`Files`)替代 explorer tab,无路径窗口在独立模式为纯资源管理器、合并模式为带 chrome 的空文件窗口;树右键提供「在新 Tab 中打开」「在侧边打开」(split)
|
|
81
|
+
- 🎛️ **声明式设置 select 行**([#151](https://github.com/omdsh-dev/DSH-better-sidebar/pull/151)):设置项新增 `type: 'select'`(`options` 支持 value/title/desc/icon,`multi` 多选存数组);带图标的选项渲染大图标选项卡、收起态同样显示图标;`editorExplorer` 改为图标化下拉(合并 / 独立);能力清单新增 `settingSelect`
|
|
82
|
+
- 🔀 **与 dsh-web-ui 家族右侧面板互斥**([#181](https://github.com/omdsh-dev/DSH-better-sidebar/pull/181)):读取 `aionui-panel` 设置命名空间的提供方选择——当选择「使用 aionui-panel」时,整个 better-sidebar(右侧栏 / 底部面板 / 浮动入口 / 各类接管)不再挂载;选择 DSH-better-sidebar(或未安装 aionui)时正常。设置页保存后实时生效(settings-document 推送),无需刷新
|
|
49
83
|
|
|
50
84
|
### v0.12.3
|
|
51
85
|
|
|
@@ -65,34 +99,6 @@
|
|
|
65
99
|
- 🐛 **node-pty 加载失败不再拖垮 server**([#140](https://github.com/omdsh-dev/DSH-better-sidebar/issues/140)):宿主半改为懒加载 node-pty,缺失时插件照常挂载,终端以修复提示横幅(可复制命令 + 重试按钮)呈现,agent 终端工具自动跳过
|
|
66
100
|
- 🧪 测试工程:单元测试拆分(#141)+ smoke 偶发失败修复
|
|
67
101
|
|
|
68
|
-
**🚀 工程**
|
|
69
|
-
|
|
70
|
-
- 接入 GitHub Release 自动发版 npm(Trusted Publishing,产物带 provenance),本版起打 tag 即自动发布([#148](https://github.com/omdsh-dev/DSH-better-sidebar/pull/148))
|
|
71
|
-
|
|
72
|
-
### v0.12.2
|
|
73
|
-
|
|
74
|
-
- 📐 **位置兼容模式**:设置页新增开关:为 Windows 右上角原生标题栏预留顶部空间,侧边栏按钮与内容整体下移(默认关闭);下移距离可在齿轮弹窗中自定义(0–120px)
|
|
75
|
-
- 🔌 **服务化基座**:完整类型导出 + `version`/`features` 能力探测、状态订阅(`getSnapshot`/`subscribeState`)、tab 角标、`onOpen`/`onActivate`/`onClose` 生命周期回调、`updateTab`/`activateTab`/`openFile`、定向打开、`meta` 跨刷新持久化、插件自有设置(`pluginToggles`/`render`)、外链点击目标认领(`urlTarget`)
|
|
76
|
-
- ➕ **添加插件**:设置页「推荐插件目录」+ 一键复制安装命令;内置 Office 预览迁至推荐插件
|
|
77
|
-
- 🖱️ **标签页滚轮**:标签页栏支持鼠标滚轮横向滚动
|
|
78
|
-
- 🐛 **修复**:远程访问 403(信任栅栏改用 `trustedHosts`)、侧边栏崩溃 [#31](https://github.com/omdsh-dev/DSH-better-sidebar/issues/31)、Windows 下 HTML 预览盘符路径
|
|
79
|
-
|
|
80
|
-
### v0.12.1
|
|
81
|
-
|
|
82
|
-
- 🔌 **服务化基座**:完整类型导出 + `version`/`features` 能力探测、状态订阅(`getSnapshot`/`subscribeState`)、tab 角标、`onOpen`/`onActivate`/`onClose` 生命周期回调、`updateTab`/`activateTab`/`openFile`、定向打开、`meta` 跨刷新持久化、插件自有设置(`pluginToggles`/`render`)
|
|
83
|
-
- ➕ **添加插件**:设置页「推荐插件目录」+ 一键复制安装命令;内置 Office 预览迁至推荐插件
|
|
84
|
-
- 🖱️ **标签页滚轮**:标签页栏支持鼠标滚轮横向滚动
|
|
85
|
-
- 🐛 **修复**:远程访问 403(信任栅栏改用 `trustedHosts`)、侧边栏崩溃 [#31](https://github.com/omdsh-dev/DSH-better-sidebar/issues/31)、Windows 下 HTML 预览盘符路径
|
|
86
|
-
|
|
87
|
-
> 📝 说明:0.12.0 正式版因 npm 判定版本已发布无法复用,正式发布改用 0.12.1,两者内容一致。
|
|
88
|
-
|
|
89
|
-
### v0.12.0
|
|
90
|
-
|
|
91
|
-
- 🔌 **服务化基座**:完整类型导出 + `version`/`features` 能力探测、状态订阅、tab 角标、生命周期回调、定向打开、`meta` 跨刷新持久化、插件自有设置
|
|
92
|
-
- ➕ **添加插件**:设置页「推荐插件目录」+ 一键复制安装命令;内置 Office 预览迁至推荐插件
|
|
93
|
-
- 🖱️ **标签页滚轮**:标签页栏支持鼠标滚轮横向滚动
|
|
94
|
-
- 🐛 **修复**:远程访问 403(信任栅栏改用 `trustedHosts`)、侧边栏崩溃 [#31](https://github.com/omdsh-dev/DSH-better-sidebar/issues/31)、Windows 下 HTML 预览盘符路径
|
|
95
|
-
|
|
96
102
|
## 🚀 安装
|
|
97
103
|
|
|
98
104
|
**前置**:已装好 DSH(`dsh web` 能正常运行),Node.js ≥ 20、pnpm ≥ 10。
|
|
@@ -122,7 +128,7 @@ dsh plugin --profile web add dsh-better-sidebar@latest
|
|
|
122
128
|
| 报 `Ignored build scripts` | pnpm 11 拦截构建脚本。在 profile 目录(`~/.dsh/profiles/web`)跑 `pnpm approve-builds --all`。 |
|
|
123
129
|
| 报 `minimum release age` / 版本不足 24h | 装的版本发布不足 24 小时。等 24h 或重跑一次(pnpm 会自动补 `minimumReleaseAgeExclude`)。 |
|
|
124
130
|
| 报「找不到 profile 目录」 | 先跑一次 `dsh web`,让它初始化 `~/.dsh/profiles/web`。 |
|
|
125
|
-
| 页面出现**两个侧边栏** |
|
|
131
|
+
| 页面出现**两个侧边栏** | 双挂载。旧的手动挂载行:`~/.dsh/profiles/web/cordis.patch.yml` 还留着 `- insert: ... better-sidebar ...`,删掉那段(同 id 重复挂载 loader 会直接报 `duplicate loader entry id`)。聚合包(如 `@linxin666/dsh-web-ui-all`)以**不同 id** 挂载本包时,0.13.x 起插件自身 bundle patch 会自动退让(检测到已有启用中的同包名挂载就不挂自己),无需手动处理;若仍双挂载,先确认聚合包的 bundle 顺序在 `dsh-better-sidebar` 之前。 |
|
|
126
132
|
| Windows 下终端无法使用 | `node-pty` 依赖预编译二进制;若当前 Node 版本没有对应产物,需装编译工具链(VS Build Tools)。主流 Node 版本一般已有预编译。 |
|
|
127
133
|
| 终端提示「node-pty 加载失败」 | `node-pty` 安装缺失/损坏(如 pnpm 拦截了构建脚本)。终端横幅会给出修复命令:复制到 DSH 所在环境的终端/cmd 执行(在 `~/.dsh/profiles/web` 下 `pnpm approve-builds --all && pnpm rebuild node-pty`),完成后重启 DSH 并点重试。插件与 DSH 核心使用同一 `node-pty@^1.1.0`,修复后两者同步恢复。 |
|
|
128
134
|
| 提示 `dsh: command not found` | 先安装 DSH;或直接用 `npx -y --package @deepseek-ai/dsh dsh plugin --profile web add dsh-better-sidebar@latest`。 |
|
|
@@ -138,10 +144,15 @@ dsh plugin --profile web add dsh-better-sidebar@latest
|
|
|
138
144
|
1. git clone https://github.com/omdsh-dev/DSH-better-sidebar.git ~/Code/DSH-better-sidebar
|
|
139
145
|
cd ~/Code/DSH-better-sidebar && pnpm install && pnpm build
|
|
140
146
|
2. ~/.dsh/profiles/web/package.json 的 dependencies 写 "dsh-better-sidebar": "link:<克隆目录绝对路径>"
|
|
141
|
-
3. ~/.dsh/profiles/web/cordis.patch.yml
|
|
147
|
+
3. ~/.dsh/profiles/web/cordis.patch.yml 追加挂载行(需要指定终端 shell 时,在行内加 `config.shell`;`config.shellArgs` 可带参启动,非空时替换默认的 `-l`。不填则自动解析 `$SHELL` / 登录 shell / powershell.exe):
|
|
142
148
|
- insert:
|
|
143
149
|
- id: better-sidebar
|
|
144
150
|
name: 'dsh-better-sidebar'
|
|
151
|
+
config:
|
|
152
|
+
shell: /bin/zsh
|
|
153
|
+
shellArgs:
|
|
154
|
+
- --noprofile
|
|
155
|
+
- --no-rc
|
|
145
156
|
4. 在 ~/.dsh/profiles/web 执行 pnpm install
|
|
146
157
|
5. 硬刷新浏览器(Cmd/Ctrl+Shift+R)即可看到效果(client 改动无需重启 DSH;host 半改动才需重启)
|
|
147
158
|
```
|
|
@@ -207,7 +218,7 @@ v0.12.1 补齐基座能力(完整类型导出、能力探测、状态订阅、
|
|
|
207
218
|
## 🛠️ 开发与构建
|
|
208
219
|
|
|
209
220
|
```sh
|
|
210
|
-
pnpm install # @deepseek-ai/* 已发布到 npm(^0.1.0-rc.
|
|
221
|
+
pnpm install # @deepseek-ai/* 已发布到 npm(^0.1.0-rc.8),直接解析、无需令牌
|
|
211
222
|
pnpm typecheck # tsc --noEmit
|
|
212
223
|
pnpm build # → lib/index.js + lib/invariant.js + lib/client.js + lib/client-registry.js + lib/types
|
|
213
224
|
pnpm test # vitest(含 manifest 一致性守卫,需先 build)
|
package/README_EN.md
CHANGED
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
|
|
22
22
|
## ✨ Features
|
|
23
23
|
|
|
24
|
-
- **🗂️ File Workbench**: file explorer (lazy-loading tree; symlinks show their target kind — directory links expand, dangling links flagged) + CodeMirror editor; inline preview for images / Markdown / HTML / PDF / Office
|
|
24
|
+
- **🗂️ File Workbench**: file explorer (lazy-loading tree; symlinks show their target kind — directory links expand, dangling links flagged) + CodeMirror editor; inline preview for images / Markdown (incl. Mermaid diagrams, strict-mode safe rendering + click-to-zoom) / HTML / PDF / Office
|
|
25
25
|
- **🌐 Embedded Browser**: multiple web tabs with back / forward / refresh; content runs in a sandboxed iframe; external links are routed by protocol by default — HTTP opens in the sidebar, HTTPS goes to the system browser (both adjustable in settings)
|
|
26
26
|
- **💻 Real Terminal**: xterm.js + node-pty real shell, reconnect with transcript replay; optionally injects `terminal_*` tools for the model
|
|
27
27
|
- **🌿 Git Panel**: real diff + VSCode-style diff tabs, history, right-click to stage / commit / revert
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
- **🪟 Dual Workbench**: right sidebar + bottom panel; drag tabs to split / merge panes (cross-panel), mobile auto-merges into a full-width drawer
|
|
30
30
|
- **🔁 Session Isolation**: layout / tabs / panels persisted per session, stale state auto-purged
|
|
31
31
|
- **⚙️ Declarative Settings**: per-item toggles in the "Side Cards" settings section, secondary settings via the gear dialog
|
|
32
|
-
- **⚡ On-demand Loading**: only ~325KB core at startup; heavy deps (terminal / editor) load on demand ([design](docs/plans/2026-08-12-lazy-chunks-design.md))
|
|
32
|
+
- **⚡ On-demand Loading**: only ~325KB core at startup; heavy deps (terminal / editor / mermaid diagrams) load on demand ([design](docs/plans/2026-08-12-lazy-chunks-design.md))
|
|
33
33
|
- **🌏 i18n**: UI text follows DSH's language (zh / en) with live switching
|
|
34
34
|
|
|
35
35
|
> 🔌 **Core principle**: service-first — the 7 built-in tabs + 6 viewers register through the same `ctx.betterSidebar` API as third-party plugins, with fully equal capabilities; anything the ecosystem can provide better is delegated to ecosystem plugins. See the "🔌 Service" section below and the [external plugin guide](./docs/external-plugin-guide.md).
|
|
@@ -41,11 +41,48 @@
|
|
|
41
41
|
<a href="https://github.com/user-attachments/assets/d4385b7e-aab4-425d-a5c4-2da5da81a34e"><img width="45%" alt="Add Plugins screenshot" src="https://github.com/user-attachments/assets/d4385b7e-aab4-425d-a5c4-2da5da81a34e" /></a>
|
|
42
42
|
</div>
|
|
43
43
|
|
|
44
|
+
### v0.14.0
|
|
45
|
+
|
|
46
|
+
> ⚠️ **This release adapts to DSH 0.1.0-rc.8**: every `@deepseek-ai/*` peer/devDependency is raised to `^0.1.0-rc.8` (transitives included — zero rc.7 leftovers in the lockfile), `cordis` to `^4.0.0-rc.8`, and the CI mount lane pins `@deepseek-ai/dsh@0.1.0-rc.8`. **DSH environments on rc.7 or earlier can no longer resolve this release's dependencies — upgrade DSH first.** All changes since v0.13.1:
|
|
47
|
+
|
|
48
|
+
**✨ New features**
|
|
49
|
+
|
|
50
|
+
- 🖼️ **Unified panel-host injection refactor** ([#232](https://github.com/omdsh-dev/DSH-better-sidebar/pull/232)): panels/toggle clusters moved into a `[data-dsh-panel-host]` fixed containing block (`fixed inset-0 z-40`), immune to desktop-shell intermediate transforms hijacking `fixed`; mount self-check (page-level transform → `data-dsh-panel-host-degraded` degraded sync, judged on uncorrected geometry, exits only when the ancestor transform is gone); push anchor switched to `#root [data-dsh-frame] > [data-pane="conversation"]` + `#root` calc width against desktop-shell additive overflow; chunk revalidation on activation (HEAD+ETag keeps unchanged chunks, 5s timeout fails open); desktop signal auto-detection (win32 advanced title-bar compat 32px avoidance, manual pref overrides); `visualViewport` keyboard inset + `env(safe-area-inset-*)` mobile adaptation
|
|
51
|
+
- 📂 **Separate file windows by default** ([#232](https://github.com/omdsh-dev/DSH-better-sidebar/pull/232)): `editorExplorer` now defaults to **separate** — tree clicks / file opens create a new tab per path and the path-less window is a pure file manager; merged mode stays available as an opt-in
|
|
52
|
+
- 🖥️ **Terminal shell / shellArgs configurable from the settings page** ([#232](https://github.com/omdsh-dev/DSH-better-sidebar/pull/232)): the terminal card's gear popup gains "Shell path" and "Shell arguments" rows (previously yaml-only via `cordis.patch.yml`) — saved values take effect immediately for terminals opened afterwards (UI terminals and model `terminal_create` alike); empty keeps the existing yaml → `$SHELL` / login shell / `powershell.exe` resolution order
|
|
53
|
+
- 🏷️ **Version badge on the settings page** ([#232](https://github.com/omdsh-dev/DSH-better-sidebar/pull/232)): the side-card settings section now opens with a `DSH-better-sidebar v0.14.0` identity badge (version synced with the service instance, test-guarded)
|
|
54
|
+
- 🔍 **Add-plugin catalog: search / grouping / independent scroll** ([#232](https://github.com/omdsh-dev/DSH-better-sidebar/pull/232)): built for a growing plugin ecosystem — a live search box (filters by name / id / description), optional `category` grouping for entries, and an independently scrolling list (the modal no longer grows unbounded with catalog size)
|
|
55
|
+
|
|
56
|
+
**🐛 Fixes**
|
|
57
|
+
|
|
58
|
+
- 🔧 **Adapted to DSH 0.1.0-rc.8** ([#232](https://github.com/omdsh-dev/DSH-better-sidebar/pull/232)): all 13 `@deepseek-ai/*` peer/devDependencies raised to `^0.1.0-rc.8` (transitives included; zero rc.7 leftovers in the lockfile), `cordis` to `^4.0.0-rc.8`; `dsh-client-web-react` / `dsh-client-schema-form` removed (no rc.8 publish, no longer in the shell module table, zero plugin references); CI mount lane pins `@deepseek-ai/dsh@0.1.0-rc.8`; pnpm 11.8 supply-chain verification adapted
|
|
59
|
+
- 🧩 **rc.8 module-system migration** ([#232](https://github.com/omdsh-dev/DSH-better-sidebar/pull/232)): rc.8 no longer exposes the `window.__DSH_MODULES__` page global (it moved to the `ctx.modules` service), which broke every lazy chunk's externals resolution — the client now injects the `modules` service and shares it with chunk-bundle copies through a plugin-owned global (terminal / editor / Mermaid on-demand loading restored)
|
|
60
|
+
- 🧩 **Chunk revalidation barrier hardening** ([#232](https://github.com/omdsh-dev/DSH-better-sidebar/pull/232)): HEAD revalidation gains a 5s timeout (fails open on a stuck route so the barrier can never wedge lazy loads); `resetChunks` clears a pending revalidation barrier
|
|
61
|
+
- 🖱️ **Drag robustness** ([#232](https://github.com/omdsh-dev/DSH-better-sidebar/pull/232)): fast releases (browsers merge/lose pointermove bursts) commit the last known dragged position instead of rolling back; `pointercancel` / lost-capture interruptions keep the drag result too; the center column is re-measured right after commit (no mid-frame bottom-panel width jump); HMR re-activation re-locates the center column via an `<html>` style observer plus a retry when the bottom panel opens (fixes the blank bottom panel / shifted input bar after a hot reload)
|
|
62
|
+
|
|
63
|
+
### v0.13.1### v0.13.1
|
|
64
|
+
|
|
65
|
+
**✨ New features**
|
|
66
|
+
|
|
67
|
+
- 📊 **Safe Mermaid rendering in the Markdown preview** ([#164](https://github.com/omdsh-dev/DSH-better-sidebar/pull/164)): when a previewed md file contains mermaid fences, a `client-mermaid.js` chunk (~7MB) is served on demand (zero load without mermaid); defense-in-depth rendering — `securityLevel: 'strict'` + `htmlLabels: false` (node labels use real SVG `<text>`) + a second sanitize pass before SVG injection (foreignObject/script/foreign HTML elements removed, `@*`/`on*`/`href` attributes stripped); click a diagram to zoom in a modal overlay (wheel zoom centered on the cursor, drag pan, toolbar & shortcuts), re-renders with light/dark theme, falls back to the raw code block on parse failure
|
|
68
|
+
- 🖥️ **Configurable terminal shell & shellArgs** ([#125](https://github.com/omdsh-dev/DSH-better-sidebar/pull/125)): `cordis.patch.yml` `better-sidebar.config` can set `shell` / `shellArgs` (a non-empty `shellArgs` fully replaces the defaults; unset keeps the previous auto-resolution of `$SHELL` / login shell / `powershell.exe`), applied to both UI terminals and agent terminals (`terminal_create`); terminal tab titles now show the shell name (bash/zsh/powershell) and internal tab ids use UUIDs so the same shell can open multiple terminals
|
|
69
|
+
|
|
70
|
+
**🐛 Fixes**
|
|
71
|
+
|
|
72
|
+
- 🔗 **Aggregate double-mount auto-yield** ([#200](https://github.com/omdsh-dev/DSH-better-sidebar/pull/200)): when an aggregate package (e.g. dsh-web-ui-all) mounts the same package under its own entry id, the guard expression in `cordis.patch.yml` disables the plugin's own `better-sidebar` row so `/sidebar/api` is no longer registered twice (`duplicate prefix route` crashing the whole plugin tree / `dsh web`); standalone installs behave as before
|
|
73
|
+
- 🔧 **Peer dependencies aligned to DSH 0.1.0-rc.7** ([#207](https://github.com/omdsh-dev/DSH-better-sidebar/pull/207), fixes [#206](https://github.com/omdsh-dev/DSH-better-sidebar/issues/206)): all `@deepseek-ai/*` peer/devDependencies raised from `^0.1.0-rc.6` to `^0.1.0-rc.7`, and the CI mount lane pins the same version — eliminating the mixed rc.6/rc.7 dependency tree (after the main framework moved to rc.7) that surfaced as `agent-presets: refusing to compose an unscoped context` when picking a model / sending a message
|
|
74
|
+
|
|
44
75
|
### v0.13.0
|
|
45
76
|
|
|
46
77
|
**✨ New features**
|
|
47
78
|
|
|
48
|
-
-
|
|
79
|
+
- 📁 **Files window merged with the explorer** ([#151](https://github.com/omdsh-dev/DSH-better-sidebar/pull/151)): new `editorExplorer` setting (editor card gear) — file tabs gain a path-input header plus a toggleable right-docked file tree (per-tab open/width memory, drag-resize 160–480px from the left edge, global filename search via the host `fs.search` route with a hard budget, skipping `.git` and symlink dirs); in separate mode (default) tree clicks / Enter in the path input open each file **in its own new tab**, merged mode switches the current tab **in place**; fresh sessions seed an empty Files window instead of the explorer tab, and a path-less window is a bare file manager in separate mode / a chrome'd empty file window in merged mode; the tree context menu offers "Open in new tab" and "Open to the side" (split)
|
|
80
|
+
- 🎛️ **Select rows for declarative settings** ([#151](https://github.com/omdsh-dev/DSH-better-sidebar/pull/151)): settings rows gain `type: 'select'` (`options` with value/title/desc/icon, `multi` stores the picked values as an array); options with icons render big-icon option cards and keep the icon in the closed anchor; `editorExplorer` became an iconed select (merged vs separate); the capability list gained `settingSelect`
|
|
81
|
+
- 🔀 **Mutual exclusion with the dsh-web-ui family right panel** ([#181](https://github.com/omdsh-dev/DSH-better-sidebar/pull/181)): reads the `aionui-panel` settings namespace's provider choice — when "Use aionui-panel" is selected, the whole better-sidebar (right sidebar / bottom panel / floating entry / all takeovers) does not mount; with DSH-better-sidebar (or no aionui installed) it behaves as before. Takes effect live after a settings save (settings-document push), no reload needed
|
|
82
|
+
|
|
83
|
+
**📝 Other**
|
|
84
|
+
|
|
85
|
+
- Install / update commands unified to `dsh-better-sidebar@latest` (bilingual README sync)
|
|
49
86
|
|
|
50
87
|
### v0.12.3
|
|
51
88
|
|
|
@@ -122,7 +159,7 @@ or bump the version in `~/.dsh/profiles/web/package.json` (e.g. `"^0.13.0"`) and
|
|
|
122
159
|
| `Ignored build scripts` | pnpm 11 blocked build scripts. Run `pnpm approve-builds --all` in the profile directory (`~/.dsh/profiles/web`). |
|
|
123
160
|
| `minimum release age` / version `< 24h` | The release is younger than 24 hours. Wait, or re-run once (pnpm auto-adds `minimumReleaseAgeExclude`). |
|
|
124
161
|
| "profile directory not found" | Run `dsh web` once so it initializes `~/.dsh/profiles/web`. |
|
|
125
|
-
| Two sidebars on the page | Double-mount: `~/.dsh/profiles/web/cordis.patch.yml` still has
|
|
162
|
+
| Two sidebars on the page | Double-mount. Old hand-written line: `~/.dsh/profiles/web/cordis.patch.yml` still has `- insert: ... better-sidebar ...` — delete it (a same-id duplicate mount makes the loader fail loudly with `duplicate loader entry id`). When an aggregate bundle (e.g. `@linxin666/dsh-web-ui-all`) mounts this package under a **different** id, the plugin's own bundle patch backs off automatically since 0.13.x (it detects an already-enabled mount of the same package name and does not mount itself) — no manual fix needed; if it still double-mounts, make sure the aggregate bundle precedes `dsh-better-sidebar` in `dsh.profile.bundles`. |
|
|
126
163
|
| 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. |
|
|
127
164
|
| Terminal shows "node-pty failed to load" | The `node-pty` install is missing or broken (e.g. pnpm skipped its build script). The terminal banner shows a repair command — copy it into a terminal/cmd on the DSH machine and run it (in `~/.dsh/profiles/web`: `pnpm approve-builds --all && pnpm rebuild node-pty`), then restart DSH and click Retry. The plugin and DSH core share the same `node-pty@^1.1.0`, so the repair restores both. |
|
|
128
165
|
| `dsh: command not found` | Install DSH first, or run `npx -y --package @deepseek-ai/dsh dsh plugin --profile web add dsh-better-sidebar@latest`. |
|
|
@@ -138,10 +175,15 @@ To debug local changes or track the dev branch, point the dependency at a local
|
|
|
138
175
|
1. git clone https://github.com/omdsh-dev/DSH-better-sidebar.git ~/Code/DSH-better-sidebar
|
|
139
176
|
cd ~/Code/DSH-better-sidebar && pnpm install && pnpm build
|
|
140
177
|
2. In ~/.dsh/profiles/web/package.json dependencies write "dsh-better-sidebar": "link:<absolute path of the clone>"
|
|
141
|
-
3. Append this mount line to ~/.dsh/profiles/web/cordis.patch.yml:
|
|
178
|
+
3. Append this mount line to ~/.dsh/profiles/web/cordis.patch.yml (to pick the terminal shell, add `config.shell`; `config.shellArgs` starts it with explicit args — when non-empty they replace the default `-l`. When omitted the host resolves `$SHELL` / the login shell / powershell.exe):
|
|
142
179
|
- insert:
|
|
143
180
|
- id: better-sidebar
|
|
144
181
|
name: 'dsh-better-sidebar'
|
|
182
|
+
config:
|
|
183
|
+
shell: /bin/zsh
|
|
184
|
+
shellArgs:
|
|
185
|
+
- --noprofile
|
|
186
|
+
- --no-rc
|
|
145
187
|
4. Run pnpm install in ~/.dsh/profiles/web
|
|
146
188
|
5. Restart DSH and hard-refresh
|
|
147
189
|
```
|
|
@@ -207,7 +249,7 @@ The dashed cards at the end of the "Sidebar content" / "File viewers" grids in t
|
|
|
207
249
|
## 🛠️ Development & Build
|
|
208
250
|
|
|
209
251
|
```sh
|
|
210
|
-
pnpm install # @deepseek-ai/* resolved from npm (^0.1.0-rc.
|
|
252
|
+
pnpm install # @deepseek-ai/* resolved from npm (^0.1.0-rc.8, published) — no token needed
|
|
211
253
|
pnpm typecheck # tsc --noEmit
|
|
212
254
|
pnpm build # → lib/index.js + lib/invariant.js + lib/client.js + lib/client-registry.js + lib/types
|
|
213
255
|
pnpm test # vitest (includes manifest consistency guard; build first)
|
package/cordis.patch.yml
CHANGED
|
@@ -14,6 +14,36 @@
|
|
|
14
14
|
# If the profile still carries the old manual mount line in its own
|
|
15
15
|
# cordis.patch.yml, remove it before switching to the bundle channel to
|
|
16
16
|
# avoid double-mounting (two Node halves, two sidebars).
|
|
17
|
+
#
|
|
18
|
+
# To choose the terminal shell, add `config.shell` to the inserted plugin
|
|
19
|
+
# row (or to the profile's manual cordis.patch.yml mount line). When omitted,
|
|
20
|
+
# the host keeps resolving $SHELL / the login shell / powershell.exe.
|
|
21
|
+
# `config.shellArgs` optionally supplies explicit startup arguments; when
|
|
22
|
+
# non-empty they replace the automatic POSIX `-l` login flag:
|
|
23
|
+
#
|
|
24
|
+
# - insert:
|
|
25
|
+
# - id: better-sidebar
|
|
26
|
+
# name: 'dsh-better-sidebar'
|
|
27
|
+
# config:
|
|
28
|
+
# shell: /bin/zsh
|
|
29
|
+
# shellArgs:
|
|
30
|
+
# - --noprofile
|
|
31
|
+
# - --no-rc
|
|
32
|
+
#
|
|
33
|
+
# Aggregate double-mount guard: aggregate bundles (e.g. @linxin666/dsh-web-ui-all)
|
|
34
|
+
# may already mount this package under their own entry id (e.g.
|
|
35
|
+
# `web-ui-better-sidebar`). Two mounts register /sidebar/api twice and fail the
|
|
36
|
+
# whole plugin tree at boot ("duplicate prefix route"). The `!!js` disabled
|
|
37
|
+
# expression backs THIS row off when another *enabled* entry already mounts
|
|
38
|
+
# `dsh-better-sidebar`; the aggregate instance then owns the sidebar. The
|
|
39
|
+
# loader evaluates it when this row is processed (entry-list order, only rows
|
|
40
|
+
# before this one are visible), so the aggregate bundle must precede this one
|
|
41
|
+
# in `dsh.profile.bundles` — the standard install order, since `dsh plugin add`
|
|
42
|
+
# appends new bundles last. The reverse order (this bundle before the
|
|
43
|
+
# aggregate) is a known limitation: the guard cannot see rows that come after
|
|
44
|
+
# it, and no runtime singleton guard is added. Same-id manual duplicates still
|
|
45
|
+
# fail loudly at the loader as before.
|
|
17
46
|
- insert:
|
|
18
47
|
- id: better-sidebar
|
|
19
48
|
name: 'dsh-better-sidebar'
|
|
49
|
+
disabled: !!js "[...ctx.loader.entries()].some((e) => e.options.name === 'dsh-better-sidebar' && e.options.id !== 'better-sidebar' && !e.disabled)"
|