Saltar al contenido principal
A

dsh-vellum

avenyq/dsh-vellum

Native cards inside DSH replies: when the model writes a vellum code block, it renders as a theme-following metrics, chart, comparison, checklist, steps, timeline, form, quiz or sortable table card; clicks, submits and answers come back to the conversation as the next message.

Instalar

dsh plugin --profile web add github:avenyq/dsh-vellum

README

Vellum

Vellum 信笺

对话里的原生卡片 · Native cards inside DeepSeek Harness replies

当回复里有「形状」——一组数字、几个方案、一串步骤——模型写一个 ```vellum 代码块,DSH 就把它画成一张跟随主题的卡片。你在卡片上点选、提交、答题,结果会作为下一条消息回到对话。

When a reply has shape — a few numbers, options to compare, steps to follow — the model writes a ```vellum block and DSH renders it as a themed card. Clicks, form submits and quiz answers go back into the conversation as your next message.

12 种卡片 / Card types

type用途
metrics2–4 个关键数字,带变化与迷你趋势
line / bar / donut折线、柱状、环形图,悬停看数值
compare2–4 个方案并排,标出推荐
choice只需要拍板时的一排按钮(任何卡片也能带 choices)
checklist可勾选的清单
steps分步操作,当前步可以点「完成」
timeline里程碑与进度
form小表单,提交后定格成摘要
quiz单选小测,答完给解析
table点表头排序的表格

完整字段写在 index.js 的提示词里——模型看到的就是那一份。

安装 / Install

dsh plugin --profile desktop add github:AvenYQ/dsh-vellum

重启 DSH,新开一个对话。开关在「插件」页:

  • prompt — 让模型知道可以用卡片回答(关掉后已有卡片照常显示)
  • strictTables — 不让模型输出 Markdown 表格,改用表格卡片

怎么做的 / How it works

  • 渲染:挂在 DSH 官方的 conversation.chat.markdown.fence 槽位(和数学公式、diff 同一个位置),只接管 vellum 这一种代码块,不替换整条回复的渲染器,所以能和其他主题、回复类插件共存。
  • 提示词:宿主端用 ctx.systemPrompt.section 注入一段说明:什么时候用卡片、怎么写、不许编数据。
  • 主题:颜色全部来自 DSH 的 --dsw-alias-* 变量,换主题、切日夜都会跟着走。
  • 生命周期:流式中先画骨架;JSON 写完卡片浮现(每张只演一次,翻历史不重演);写坏了退回成一段可读文字,不露代码块。
  • 回传:点选通过会话的 inputActions 发出;拿不到时退回到复制到剪贴板。选过的、提交过的、答过的都记在本机 localStorage,重开对话仍是定格状态。
  • 体积:一个 ~60 KB 的 client.js,零依赖(React 由 DSH 提供),图表是手写 SVG。

要求 / Requirements

DSH ≥ 0.2.2(更早的版本没有 fence 槽位,```vellum 块会显示成普通代码块)。

License

MIT

Plugins relacionados