Nagi-ovo/dsh-visualize 预览 preview

Nagi-ovo/dsh-visualize

在DSH对话中生成交互式可视化|在DSH对话中渲染模型生成的交互式卡片

项目介绍Project Overview

dsh-visualize 是一款 DSH Web UI 插件,让模型在对话中直接渲染可交互卡片。当模型调用 visualize 工具并传入 HTML fragment、标题与 mode 时,DSH 会在消息流里展示模拟器、图表、对比面板或 UI mockup,支持 mode:"wide" 并排比较,适合算法演示、数据探索等需要边聊边看的场景。卡片使用沙盒 iframe 与严格 CSP 隔离运行环境,限制网络、表单与跨源资源加载,单 fragment 默认上限 1000000 字节。需注意:仅 Web UI 支持渲染,TUI 与无头客户端回退为普通工具结果,且卡片内按钮暂不能向主对话发送 follow-up。

dsh-visualize is a DSH plugin that lets the model render interactive cards directly inside the Web UI chat. When the model invokes the visualize tool with an HTML fragment, title, and optional mode such as "wide", DSH displays simulators, charts, comparison panels, or UI mockups inline. The cards follow DSH's light/dark theme, and session replay restores them from persisted tool results. Use it when explanations benefit from live, hands-on visuals. Note that rendering works only in the Web UI—TUI and headless clients fall back to plain tool output—and in-card buttons cannot currently send follow-up messages back to the main conversation.

或使用命令行安装(适合开发者)Or use CLI install (for developers)

命令行安装CLI Install

dsh plugin --profile web add github:Nagi-ovo/dsh-visualize

Nagi-ovo/dsh-visualize 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

dsh-visualize

dsh-visualize

简体中文 | English

dsh-visualize 在 dshfind 插件目录上的展示卡

让 DSH 不只回答一段文字。模型调用 visualize 后,Web UI 会在对话里直接出现一张可交互卡片,用来做模拟器、图表、对比面板或 UI mockup。

DSH 对话内生成交互式可视化演示

安装

推荐直接从 GitHub 安装到 DSH 的 web profile:

dsh plugin --profile web add github:Nagi-ovo/dsh-visualize
# 如果 dsh web 正在运行,重启后刷新页面

可以运行 dsh --profile web --dump-config 确认插件已经进入最终配置。需要修改源码时,克隆仓库并在仓库目录运行 dsh plugin --profile web add .;构建产物已经提交,不需要额外构建。使用社区 plugin-registry 的用户也可以从「设置 → 插件」安装。

怎么用

直接告诉模型你想看什么,例如「做一个能调参数的排序算法可视化」。模型会写出一份 HTML fragment,再调用 visualize(path, title?, mode?) 把它放进对话。适合并排比较的内容可以使用 mode: "wide"

卡片会跟随 DSH 的明暗主题和鲸鱼蓝配色。会话重放时,页面从持久化的工具结果恢复,不依赖原始 fragment 文件仍然存在。

安全

卡片运行在不透明来源的 sandboxed iframe 中,不能接触宿主页面。CSP 会阻止网络请求、嵌套页面和表单提交,只允许从固定 CDN 加载静态资源。单个 fragment 默认上限为 1000000 字节,可以通过 maxFragmentBytes 调整。

限制

目前只在 Web UI 中渲染交互卡片,TUI 和 headless 客户端会显示普通工具结果。卡片内的按钮暂时不能向主对话发送 follow-up 消息。

灵感来自 Codex 桌面端的 /visualize;skill 的分层 reference 和 Chart.js 优先路线借鉴了 himself65/finance-skills

上一个 Prev dshfind 下一个 Next dsh-image-gen