diff --git a/docs/ecosystem.md b/docs/ecosystem.md new file mode 100644 index 00000000..44c88896 --- /dev/null +++ b/docs/ecosystem.md @@ -0,0 +1,79 @@ +# 🌐 插件生态 + +> 本页从 [README](../README.md#-插件生态) 拆出:插件清单长得快,README 只留接入入口。 +> 注册 API(`registerTab` / `registerFileViewer`)见 [README](../README.md) 与 [external-plugin-guide.md](./external-plugin-guide.md)。 + +GitHub topic [`dsh-better-sidebar`](https://github.com/topics/dsh-better-sidebar) 下已收录 **36 个**生态插件(持续增长中)。 + +**上架你的插件**:给仓库打上 `dsh-better-sidebar` topic 即出现在 [topic 页](https://github.com/topics/dsh-better-sidebar);再向 [`src/client/plugins-tabs.ts`](../src/client/plugins-tabs.ts) / [`src/client/plugins-viewers.ts`](../src/client/plugins-viewers.ts) 提一条 `PluginEntry` PR,即可进入设置页内置推荐目录(数据完整性由 `tests/plugin-list.spec.ts` 守护)。 + +
+ 设置页「添加插件」弹窗:推荐插件目录 + 一键复制安装命令
+ 设置页「侧边卡片」内置「添加插件」弹窗:推荐目录 + 一键复制安装命令 + 直达 GitHub topic +
+ +## 📑 Tab 插件(注册侧边栏页面) + +
+28 个插件(点击展开) + +| 插件 | ⭐ | 简介 | +|---|---|---| +| [ChenRuoT/dsh-sidebar-qa](https://github.com/ChenRuoT/dsh-sidebar-qa) | stars | 划选追问侧边页:类 Codex 侧边提问 / Claude Code `/btw` | +| [fuhefei/dsh-sentinel](https://github.com/fuhefei/dsh-sentinel) | stars | 条件驱动唤醒系统:文件 / 命令 / HTTP / 进程 / Webhook 监视,到点唤醒 agent;dock + 侧栏分支 + 全局仪表盘 | +| [Fisfzy/ego-browser](https://github.com/Fisfzy/ego-browser) | stars | Agent 浏览器:i18n 感知的本机浏览器 Tab(`@dsh-external/ego-browser`,装了 better-sidebar 自动注册侧边栏页,未装回退浮动浮窗观察) | +| [jiuge2467/dsh-studio](https://github.com/jiuge2467/dsh-studio) | stars | 全栈增强工作台:多源 MCP 可视化调试中枢、视觉思考引擎 | +| [Iwctwbh/dsh-flowglass](https://github.com/Iwctwbh/dsh-flowglass) | stars | 流镜 Flowglass:会话流程图实时可视化(消息 / 工具组 / 子代理分支) | +| [FeatherHunter/dsh-mattpocock-skills-deck](https://github.com/FeatherHunter/dsh-mattpocock-skills-deck) | stars | mattpocock/skills 游戏化任务系统:地图拨迷雾、任务栏推进 | +| [GULI-lab/DSH-element-source](https://github.com/GULI-lab/DSH-element-source) | stars | 点击页面任意 UI 元素直达 Vue / React / Svelte / Angular 源码并送入会话 | +| [Lzh3070/dsh-file-review-tab](https://github.com/Lzh3070/dsh-file-review-tab) | stars | 文件改动审查页:行级红绿 diff + 撤销 + chat 行深链 | +| [yq04/dsh-git-remotes](https://github.com/yq04/dsh-git-remotes) | stars | Git 远程页:分支 / 上游 / ahead-behind,fetch 可 prune、ff-only pull、确认后 push | +| [ztyhehe/dsh-better-sidebar-svn](https://github.com/ztyhehe/dsh-better-sidebar-svn) | stars | SVN 源码管理页:status / diff / log / commit / update / revert / 冲突解决,与内置 Git 面板对称 | +| [Melody-max114/dsh-excel-panel](https://github.com/Melody-max114/dsh-excel-panel) | stars | Excel 编辑页:xlsx 预览 / 编辑、公式实时计算、合并单元格、保存回原文件 | +| [v587d/dsh-anysearch-refs](https://github.com/v587d/dsh-anysearch-refs) | stars | AnySearch 搜索结果引用卡片:搜索词、来源摘要、关键词高亮 | +| [Lukeknow0/dsh-markdown-link-preview](https://github.com/Lukeknow0/dsh-markdown-link-preview) | stars | Markdown 产物链接预览:点击聊天中的同源 `.md` 输出文件,直接在侧边栏阅读,不再唤起外部 App | +| [mlosun/dsh-docs-panel](https://github.com/mlosun/dsh-docs-panel) | stars | 全局文档面板:随身 Markdown 笔记,任何工作区随时可读 | +| [tylina/dsh-tylina](https://github.com/tylina/dsh-tylina) | stars | Typst 文档编辑工具:与当前会话共用工作区,WYSIWYG 编辑排版 Typst 文档,可用于编写和排版论文、报告、试卷、简历、图表、海报、乐谱和 PPTX 格式导出的 Slides | +| [lnyuqian/dsh-skill-sidebar](https://github.com/lnyuqian/dsh-skill-sidebar) | stars | 技能面板:扫描本机技能目录,4-6 字功能短语 + 一键复制调用 + 置顶 | +| [g-yixuan/dsh-sidenote](https://github.com/g-yixuan/dsh-sidenote) | stars | Codex 风格侧边对话 + 划选引用注释(轻量消费插件) | +| [OMSociety/dsh-ssh-tunnel](https://github.com/OMSociety/dsh-ssh-tunnel) | stars | 多主机 SSH 隧道 + SSH 管理器页 | +| [OMSociety/dsh-git-forge](https://github.com/OMSociety/dsh-git-forge) | stars | GitHub / Gitea 账号、项目授权与推送策略 | +| [YesSanSan/dsh-conversation-outline](https://github.com/YesSanSan/dsh-conversation-outline) | stars | 对话大纲页:按轮次结构化展示、一键跳转、LLM 一句话标题 | +| [Wulabalabo/dsh-sidebar-Explorer-Plus](https://github.com/Wulabalabo/dsh-sidebar-Explorer-Plus) | stars | 文件管理页:上传 / 移动 / 删除 / 重命名 / 新建文件夹(补全写操作) | +| [yq04/dsh-turn-review](https://github.com/yq04/dsh-turn-review) | stars | 本轮审查:逐回合审查 agent 改动 | +| [Ghz114514/dsh-refpics](https://github.com/Ghz114514/dsh-refpics) | stars | Pinterest 风格参考图搜索:瀑布流、侧栏画板、下载与 Eagle 收藏 | +| [yzlin499/dsh-yzlin499-easy-plugins](https://github.com/yzlin499/dsh-yzlin499-easy-plugins) | stars | 实用小工具集(毛坯房 DSH 友好) | +| [dong-victor/dsh-better-sidebar-starter](https://github.com/dong-victor/dsh-better-sidebar-starter) | stars | 运行配置页:IDEA 式 Run/Debug 配置(npm / springboot / python / custom)——一键启动、历史保存、WebSocket 实时日志(ANSI 彩色)、多实例并行、进程树跨平台杀死 | +| [baosfeng/my-dsh-plugins](https://github.com/baosfeng/my-dsh-plugins) | stars | 个人多插件合集(`dsh-file-activity`):侧边栏文件活动页——记录文件读取 / 新增 / 修改历史与统计,按文件夹平铺,点击用原生预览打开 | +| [Hoemr/dsh-better-overleaf](https://github.com/Hoemr/dsh-better-overleaf) | stars | Overleaf 标签页:直连 CDP 浏览器登录(支持第三方 Chromium)、项目切换、工作区下 overleaf/ 目录本地 git 镜像与双向同步 | +| [Andor-Z/dsh-turn-outline](https://github.com/Andor-Z/dsh-turn-outline) | stars | 轮次轨迹页:按用户轮次折叠会话(输入 + 工具步骤 + 输出),点击任意步骤一键跳回对话原位;零 LLM、只读 | + +
+ +## 🖼️ 预览插件(注册文件预览器) + +
+4 个插件(点击展开) + +| 插件 | ⭐ | 简介 | +|---|---|---| +| [HuanLinOTO/dsh-plugin-better-sidebar-plugin-office](https://github.com/HuanLinOTO/dsh-plugin-better-sidebar-plugin-office) | stars | Office 三件套预览(.docx / .xlsx / .pptx),独立 bundle 瘦身主体(官方推荐目录收录) | +| [HuanLinOTO/dsh-plugin-better-sidebar-plugin-audio](https://github.com/HuanLinOTO/dsh-plugin-better-sidebar-plugin-audio) | stars | 音频预览:可缩放波形播放器(点击/拖动定位、A-B 循环、声道切换、倍速)+ 实时频谱(柱状/折线/瀑布)+ 全曲频谱图,自带 HTTP Range 流式媒体路由,任意大小可拖进度 | +| [zemul/dsh-video-preview](https://github.com/zemul/dsh-video-preview) | stars | 视频内联预览:.mp4 / .webm / .mov / .mkv / .avi,自带 /video 路由支持 HTTP Range 拖进度条 | +| [dong-victor/dsh-better-sidebar-jupyter](https://github.com/dong-victor/dsh-better-sidebar-jupyter) | stars | `.ipynb` 可运行 Notebook 视图:懒启动 Python kernel、流式输出、保存回写 | + +
+ +## 🧰 增强与工具 + +
+4 个插件(点击展开) + +| 插件 | ⭐ | 简介 | +|---|---|---| +| [eg-bole/dsh-better-sidebar-icons](https://github.com/eg-bole/dsh-better-sidebar-icons) | stars | VSCode 风格文件 / 文件夹图标主题:文件树与编辑器 Tab 换上熟悉的开发环境图标(vscode-icons 移植,纯 DOM 覆盖零侵入,安装 / 卸载零残留) | +| [dong-victor/dsh-better-sidebar-terminal-plus](https://github.com/dong-victor/dsh-better-sidebar-terminal-plus) | stars | 终端增强:内嵌 Nerd Font 图标字体、修复 xterm 图标渲染、稳定终端 cwd | +| [Max-Null/dsh-sidebar-preview-select](https://github.com/Max-Null/dsh-sidebar-preview-select) | stars | 预览划选增强:侧边栏预览里划选文本 → 浮动「发送到会话」 | +| [Hoemr/dsh-quicklook](https://github.com/Hoemr/dsh-quicklook) | stars | QuickLook 式空格预览:活动文件标签页按 Space 全尺寸查看图片 / PDF / 文本,Space 或 Esc 关闭 | + +
diff --git a/docs/install-channels.md b/docs/install-channels.md new file mode 100644 index 00000000..727728f7 --- /dev/null +++ b/docs/install-channels.md @@ -0,0 +1,41 @@ +# 🚀 安装通道(可选) + +> 本页从 [README](../README.md#-安装) 拆出:主安装方式只有一条 `dsh plugin --profile web add dsh-better-sidebar@latest`, +> 「从源码安装」与「plugin-registry 通道」属于可选路径,放在这里维护。 + +## 🧰 从源码安装 / 开发 + +调试本地改动或跟随开发分支时,把依赖指向本地克隆并自行构建: + +```text +1. git clone https://github.com/omdsh-dev/DSH-better-sidebar.git ~/Code/DSH-better-sidebar + cd ~/Code/DSH-better-sidebar && pnpm install && pnpm build +2. ~/.dsh/profiles/web/package.json 的 dependencies 写 "dsh-better-sidebar": "link:<克隆目录绝对路径>" +3. ~/.dsh/profiles/web/cordis.patch.yml 追加挂载行(这一行的 config 就是本插件的设置表单,不写则全用 schema 默认值): + - insert: + - id: better-sidebar + name: 'dsh-better-sidebar' + config: + listLimit: 1000 +4. 在 ~/.dsh/profiles/web 执行 pnpm install +5. 硬刷新浏览器(Cmd/Ctrl+Shift+R);client 改动热加载,host 半改动才需重启 +``` + +更新:`git pull && pnpm install && pnpm build` → 硬刷新。切回 npm 通道时把依赖改回版本号(当前线 `^0.26.0`)再 `pnpm install`。 + +--- + +## 📦 通过 plugin-registry 安装(与 npm 通道二选一) + +前置:DSH 已集成 [plugin-registry](https://github.com/dsh-external/plugin-registry)(`dsh registry` 可用)。**同时启用两个通道会双挂载**(Node 半挂两次、页面两个侧边栏)。 + +```sh +git clone https://github.com/omdsh-dev/DSH-better-sidebar.git && cd DSH-better-sidebar +pnpm install && pnpm build +node scripts/package-registry.mjs # 组装 registry/ 暂存(含清单 + 产物 + README,不入库) +dsh registry install ./registry # 安装(默认禁用) +dsh registry enable dsh-external/dsh-better-sidebar +``` + +更新:`git pull && pnpm install && pnpm build` → `node scripts/package-registry.mjs` → `dsh registry uninstall/install/enable`。切换通道前先移除另一通道的挂载。 + diff --git a/src/client/conversation-draft.ts b/src/client/conversation-draft.ts index b048ac31..34e7a475 100644 --- a/src/client/conversation-draft.ts +++ b/src/client/conversation-draft.ts @@ -326,6 +326,12 @@ export function appendToDraft(ctx: Context, sessionId: string, text: string): bo const lead = caret === null ? (draft.trim() === '' || /\s$/.test(draft) ? '' : ' ') : (caret.start === 0 || /\s$/.test(draft.slice(0, caret.start)) ? '' : ' ') + if (snapshot.draftRev === undefined) { + // No revision means no span channel either — the only remaining write + // path (`setDraft`) would flatten every chip, so refuse instead. + console.warn('[dsh-better-sidebar] draft insert skipped: chip draft without a revision') + return false + } const actxEmit = actx as unknown as { emit(name: string, payload: unknown): void } actxEmit.emit('slash/input-insert-text', { text: `${lead}${text}`,