Back to marketplace

dsh-plugin-vscode-sidebar

UI & Experience

gameswu/dsh-plugin-vscode-sidebar

Provides a VSCode-style sidebar and bottom panel for the DSH web interface, including file explorer, Monaco editor, Markdown preview, Git panel, terminal, embedded browser, and task management.

  • dsh
  • dsh-plugin
  • dsh-plugins
GitHub Stars
7GitHub
Views
5DSH Plugin Hub
Forks
0GitHub
Open issues
0GitHub Issues
Manifest version
0.2.0dsh-plugin-vscode-sidebar
Latest push
Sep 16, 2026GitHub
License
MITTypeScript
Plugin type
Host + ClientRuns in both Host and Web Client

Verification and compatibility

This section shows evidence collected by the catalog. Undeclared information is labeled as unknown.

Static checked
01Exact source: github · dsh-plugin-vscode-sidebar@0.2.002Validated: Aug 23, 202603Verified Harness: 0.1.0-rc.7
Current-version compatibility
Verified on the catalog Harness version
Declared Harness range
Not declared
Declared platforms
Not declared
Profiles
web
Build approval
Unknown
Permissions
Not declared
External services
Not declared
Telemetry
Unknown
No known risk flags found

This is not a security endorsement. Review source, permissions, and configuration before installing.

View evidence and scope

Verification covers only the named source, version, and Harness environment. It does not guarantee future compatibility.

  • github:gameswu/dsh-plugin-vscode-sidebar#d8a9a9c9d3c25ff26f8380174c55389ef3e30c40
  • The manifest and static structure passed checks; a runtime load check has not completed.

README

View source

dsh-plugin-vscode-sidebar

VSCode 风格的 DSH Web 侧边栏插件(fork 自 dsh-plugin-vscode-sidebar v0.12.1)。

自 v0.5.0 起,插件完整迁移到 DSH 0.1.5-rc.1 的官方右侧栏(ctx.sidebarRightTabs / ctx.documentPreviews / conversation.session.header.utilities):旧的自绘 portal 工作台(浮动面板、分栏、底部面板)已删除,所有页面都是官方右侧栏中的页面类型或资源类型。

自 v0.6.0 起,只读预览交还给官方:普通文件打开(聊天/工具的文件链接、官方 Files 页、资源管理器单击、 产物列表)一律落在官方只读预览(ui-sidebar-documentpreview)的 text 标签页里;插件不再以 extension 档位占用 dsh-resource://file/**,也不再注册任何 documentPreviews 渲染器。 编辑改为显式动作:标签页右键菜单的「在侧栏编辑」、资源管理器文件右键菜单的同一项、产物列表芯片 旁的铅笔按钮,以及已弃用门面的 openFile / openTab({type:'editor'})。

功能

  • 文件浏览器(页面类型 vscode-explorer):懒加载目录树 + vscode-icons 图标;新建文件/文件夹、重命名、删除(删除需确认);目录列举优先走官方 remote.workspaceFiles,不可用时回退到插件自身的 host 路由(两条路径都支持 git 忽略灰显与状态徽章)
  • 编辑器(资源类型 vscode-editor,只认插件自有地址 dsh-resource://vscode-sidebar-edit/**,仅在显式编辑动作中打开):Monaco 编辑、全语言语法高亮、Ctrl+S;标签页右键菜单贡献「在侧栏编辑 / Edit in sidebar editor」,资源管理器文件菜单与产物列表铅笔按钮同样入口;tab 标题显示未保存标记,卸载/关闭时自动保存未保存的草稿(草稿按 (sessionId, contentId) 保存在插件服务里,contentId 就是该文件的编辑地址,因此切换 tab 不丢失)
  • 只读查看由官方 ui-sidebar-documentpreview 负责(Markdown / 代码 / HTML / 图片 / PDF 等):插件不注册任何 ctx.documentPreviews 渲染器,也不与它争抢文件地址
  • 源代码管理(页面类型 git):状态徽章、+a −d 行数、行内 diff、提交、分支切换(含 ahead/behind)、历史轨迹图;子目录仓库探测;差异(资源类型 diff,插件自有协议 vscode-sidebar-diff)按变更地址去重,同一处变更永远聚焦同一个 tab
  • 终端(页面类型 terminal):xterm.js + node-pty 真实 shell;PTY/WebSocket 归属插件服务并以 (sessionId, contentId) 为键,关闭/卸载页面不会杀掉 shell,重新打开会回放缓冲;可选为模型注入 terminal_* 工具
  • 内嵌浏览器(页面类型 browser):沙箱 iframe;聊天区外链可直接在右侧栏打开
  • 任务管理(页面类型 tasks):subagent 拓扑 + 后台任务卡片 + 代理终端流式输出;运行中置顶、历史折叠
  • 会话标题栏启动器:conversation.session.header.utilities 中的一排按钮,一键打开上述任意页面
  • 全部设置接入官方插件配置页(Settings → Plugins),修改后即时生效

界面文案跟随 DSH 语言(zh/en)实时切换。

行为约定(v0.6.0 起)

  • 没有底部面板:旧 portal 的底部工作台已整体退役,终端/任务都以官方页面形式出现;需要第二个终端时请用官方右侧栏的分栏能力。
  • 默认打开 = 官方只读预览:聊天里的文件提及、工具行、官方 Files 页、资源管理器单击、产物列表芯片都走官方 openResource 的普通文件地址(dsh-resource://file/**),由官方 text 预览渲染;插件在 extension 档位只认自己的 dsh-resource://vscode-sidebar-edit/**。
  • 编辑 = 显式动作:编辑器地址由文件地址包装而来(base64url 负载),因此同一文件的 contentId 稳定:重复编辑聚焦同一个标签页,脏草稿按 (sessionId, contentId) 存活于插件服务,切换标签页/重新打开都不丢。行号通过导航参数 params.line 传递,不进入地址(同一文件在不同行打开仍是同一个 tab)。
  • 自动保存 + 脏标记:官方 tab 记录没有关闭否决,因此编辑器在卸载时保存脏草稿;未保存状态显示在 chip 标题上。
  • tab / 布局仅存在于内存:官方 ui-sidebar-right 0.1.5-rc.1 不持久化 tab 记录,刷新页面后不恢复任何 tab(包括编辑器、差异、终端、浏览器);这是官方侧边栏的既定行为,不是本插件的回归。
  • 旧服务已弃用:ctx.vscodeSidebar 仍保留为兼容门面——老插件继续用 registerTab / registerFileViewer 注册,门面会把它们转发到官方 sidebarRightTabs / documentPreviews 并渲染原组件;openTab / openFile / closeTab / activateTab 转发到官方导航(其中 openFile 与 type:'editor' 的 openTab 语义是编辑,因此打开编辑地址;查看请直接用官方 openResource),而 updateTab 与依赖布局的字段(createTab / dedupeKey / available / badge / onOpen / onClose)不再生效,新插件请直接使用官方 API。

DSH 版本兼容性:

  • v0.6.0 起仍要求 DSH ≥ 0.1.5-rc.1,但只读预览交还官方:插件不再占用 dsh-resource://file/**、不再注册任何 ctx.documentPreviews 渲染器,编辑改为显式动作(标签页/资源管理器右键菜单、产物铅笔按钮、门面 openFile);依赖「打开文件即进入插件编辑器」的下游请改用显式入口。
  • v0.5.0 起要求 DSH ≥ 0.1.5-rc.1:插件只通过官方右侧栏贡献内容(页面类型 / 资源类型 / 文档渲染器 / 标题栏启动器),不再自绘面板;缺少这些服务的运行时不会加载任何页面(内部 gate,无用户开关)。
  • v0.4.0 起支持 DSH ≥ 0.1.2-alpha.5:会话事件读取从 Session.events 迁移到 Session.snapshotEvents()/eventAt()(后台任务与终端回放共用同一 helper);Markdown 渲染文案统一为 MarkdownLabels 的 labels.code + labels.footnotes;schema 依赖切换为 @deepseek-ai/schemastery。
  • v0.3.0 起适配 DSH 0.1.2-alpha.2:settings 服务的 settingsNamespace 助手被移除;子代理历史迁移到 Typert session/follow 快照;文件打开漏斗迁移到 session/openWorkspacePath。
  • v0.2.0 起适配 DSH ≥ 0.1.1-rc.2(懒加载 chunk 通过 ctx.modules 解析)。

仓库结构

├── src/
│   ├── index.ts            host 半入口:/sidebar API 路由、挂载、设置
│   ├── git.ts              仓库探测 / 状态 / numstat / check-ignore 等 git 操作
│   ├── fs-tree.ts          目录列举(.git 元数据过滤)
│   ├── bundle-route.ts     /sidebar/bundle 懒加载 chunk 与 /sidebar/icons 图标路由
│   ├── pty-manager.ts / agent-pty.ts / terminal-runs.ts / jobs-routes.ts / ...
│   └── client/
│       ├── index.tsx       client 半入口:设置同步、拦截器、官方贡献注册
│       ├── official/       官方右侧栏集成(门面/注册点)
│       │   ├── index.ts        唯一注册点:编辑器 + 编辑菜单项 + 启动器 + 全部页面/资源类型
│       │   ├── launchers.tsx   会话标题栏启动器(conversation.session.header.utilities)
│       │   ├── explorer-kind.tsx / git-kind.tsx / diff-kind.tsx / diff-protocol.ts
│       │   ├── tasks-kind.tsx / browser-kind.tsx / terminal-kind.tsx
│       │   ├── terminal-sessions.ts  窗口级 PTY 会话注册表(按 contentId 保活)
│       │   ├── edit-protocol.ts / base64url.ts  编辑器自有协议(包装文件地址)与共享 base64url 编解码
│       │   ├── editor-menu.tsx   「在侧栏编辑」标签页菜单项(sidebar.right.tab.menu.item)
│       │   ├── editor-body.tsx / editor-title.tsx / editor-buffers.ts
│       │   ├── legacy-bridge.tsx     已弃用门面的官方侧适配器
│       │   └── settings-bridge.ts / settings-card.tsx / navigation.ts
│       ├── ExplorerView.tsx / GitView.tsx / DiffTab.tsx / DiffView.tsx / EditorHost.tsx / ...
│       ├── SubagentView.tsx / BrowserView.tsx / TerminalView.tsx / 各 viewer
│       ├── state.ts / service.ts   客户端 store(偏好 + 脏标记)与已弃用门面
│       ├── builtins/       内置描述符(设置页清单;不再自绘)
│       ├── locales.ts / sidebar.module.css / ...
│       └── chunks/         终端 / 编辑器懒加载入口
├── assets/vscode-icons/    vscode-icons SVG 图标集(含 LICENSE)
├── tests/                  vitest 单元/组件测试
├── scripts/                check-consumer-types.sh(消费者类型面守卫)
├── cordis.patch.yml        bundle 挂载补丁(dsh.bundle.patch,安装必需)
├── tsdown.config.ts        host/client/chunk 三组构建配置
└── package.json            dsh.bundle.patch 声明 + peer 依赖

安装

本插件是一个自带补丁层的组合包(dsh.bundle + cordis.patch.yml)。用 dsh plugin 安装即可——它把参数转发给 profile 的 pnpm,并自动把包挂载进 dsh.profile.bundles,无需手动编辑任何配置文件:

# 从本地路径安装(<路径>/dsh-plugin-vscode-sidebar 为本仓库目录)
dsh plugin --profile web add <路径>/dsh-plugin-vscode-sidebar

# 或从 GitHub 安装(建议锁定 commit)
dsh plugin --profile web add github:gameswu/dsh-plugin-vscode-sidebar#<sha>

从 GitHub 安装时,pnpm 会在安装后运行本包的 prepare 脚本构建 lib/;pnpm ≥10 默认拒绝执行,首次 add 会失败并提示把包键加入该 profile 的 pnpm-workspace.yaml 后重试:

allowBuilds:
  dsh-plugin-vscode-sidebar: true
  node-pty: true
  protobufjs: true

授权构建意味着安装时会在你的机器上执行本包的构建脚本——请只对可信来源授权。

安装完成后重启 Web 界面(dsh web)即可生效。

卸载:dsh plugin --profile web remove dsh-plugin-vscode-sidebar(插件行随 bundle 一并移除)。

更新与开发

pnpm install        # 安装依赖
pnpm typecheck      # 类型检查
pnpm build          # 打包 → lib/(host/client/chunk 三组构建)
pnpm test           # vitest 单元/组件测试

本地路径安装(pnpm link)会直接使用本仓库的构建产物:host 半改动需重启 dsh web;仅 client 半改动重新构建后硬刷新浏览器(Ctrl+Shift+R)即可。

License

MIT

Comments

0
Newest first