MUV engine for DeepSeek Harness: runs the regex_scripts from a character card against model output, tracks variables, renders a status bar, expands macros and LaTeX, and styles tagged code blocks such as letter, terminal, newspaper and phone. Needs dsh-muv-table installed as well, which is its companion plugin.
Install
# from npm (prebuilt)
dsh plugin --profile web add dsh-muv-engine
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:chen731215-dev/dsh-muv-engine
Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).
README
This plugin publishes its README in Chinese only.
⚙️ dsh-muv-engine
DSH 原生 MUV 引擎 —— 酒馆伴生插件。
🔗 依赖 dsh-muv-table,配合 dsh-tavern-v2 使用。
🆕 v0.3.4 更新内容
本次是一个大修版,修的都是「不报错但结果不对」的静默失败;同时新增了诊断工具。
状态栏渲染
- 行动选项不再整段消失:三级解析器(yaml / free / loose)对选项标记的支持范围
不一致,导致
A.B.C.这种最常用的写法被静默丢弃。现在统一支持A.A、1.1、-•以及无前缀的裸选项。 - 支持任意字段:以前只认
名字/行动/内心/衣着四个字段,卡片实际给出的穿搭/小穴/胸部/肛门/阳具/最近性行为等全部丢失。现在按标签: "值"通用提取, 卡片写什么就渲染什么。 - 条目不再要求从行首开始:
用户列表: - 用户: 名字: "…"这种带前缀的写法以前会 导致整条角色丢失,只剩一个头部条。 - 选项标题兼容英文
Options/Choices/Actions/Select;兼容## 行动选项这类 markdown 装饰;章节标签不再重复渲染;选项挤在一行时也能正确拆分。
消息渲染
- 修复插画不显示、原始标签糊满屏幕:取角色卡时只用 sessionId 定位,三种兜底
全落空时会拿到别人的卡,于是卡里的正则全部静默不执行——
<img>不被替换、 隐藏块不生效。现在优先使用酒馆界面上的当前预设。 - 纯
<choices>回复(没有状态栏、只有剧情+选项)以前会被入口闸门跳过,现在能渲染。 - 变量块:识别
<VariableInsert>/<VariableEdit>/<VariableThink>/<Abstract>, 收进折叠卡片而不是把 JSON 糊在屏幕上。 - 消息定位改用形状匹配 + 块级子节点判定,不再依赖会随 DSH 重建变化的 CSS Modules 哈希,也不会误伤同名的文件类型图标。
新增诊断工具 diag.mjs
一条命令查完:服务器是否加载了新代码、每个预设绑的哪张卡、SillyTavern PNG 卡库、 实时 API 返回,还能把一段消息过一遍渲染管线(报用了哪张卡、正则是否命中、 有无残留标签、外链图片是否可达)。
node diag.mjs # 全量体检
node diag.mjs --tests # 附带跑回归
node diag.mjs --preset <id> --msg-file msg.txt # 测一条消息
回归测试从 46 项增至 84 项(
node test-status-cascade.mjs)。
是什么
替代 MagVarUpdate 的 DSH 原生实现,v0.3.0 起融合了 dsh-visual-render:
🎮 变量与状态
- 正则引擎:执行角色卡
regex_scripts,实时替换 LLM 输出 - 变量追踪:跨对话轮次追踪变量状态,自动提取
<UpdateVariable>块 - 状态栏渲染:提取
<StatusPlaceHolderImpl/>的 HTML,iframe 沙箱渲染
🎲 宏展开
聊天输入框内直接写宏,按 Enter 自动展开后发送给 AI:
{[random::去酒楼::去坊市::去洞府]} → 每次随机选一个
{[pick::宝箱::灵石x50::剑谱::丹药]} → 固定结果,缓存为「宝箱」
{[roll::2d6+3]} → 掷 2d6 加 3 调整值
- 支持调整值:
{[roll::1d20+5]}、{[roll::3d6-1]} - pick 缓存可用
_tavernRerollPick('key')重抽(浏览器控制台) - 控制台调试:
_tavernExpandMacros('...')/_tavernListPicks()
🏷️ 标签渲染
AI 输出自动美化(_tavernRenderTags 钩子),支持转义形态(<标签>):
| 标签 | 效果 |
|---|---|
<speech> |
斜体灰色对白 |
<action> |
绿色斜体动作 |
<thought> / <thinking> |
紫色斜体内心 |
<char> / <character> |
金色粗体角色名 |
<dialogue> |
蓝色左边框 |
<赏令接取> ~ <自由开局> |
独立配色游戏卡片(金/紫/青/蓝/青绿/橙) |
<Drama> |
暗红渐变戏剧卡片(含 .mys 内容区样式) |
<choices> |
选项按钮(按行解析,支持 A、/1./•/无前缀) |
<style> |
自动剥离(世界书模板 CSS 不展示) |
<inventory> / <背包> / <skill> |
折叠列表卡片 |
<quote> / <引用> |
引用块 |
🖼️ visual 代码块渲染(融合 dsh-visual-render)
聊天里 ```visual 代码块自动渲染为沙箱 HTML 界面:
- 信纸 / 终端 / 报纸 / 手机 / 浏览器组件
options代码块 → 可点击剧情选项按钮aside代码块 → 淡色旁白scene代码块 → 场景标题卡- iframe
sandbox隔离,安全运行
🌠 LaTeX 渲染
\(...\) 公式自动渲染(含 array/fcolorbox/colorbox/textcolor/rule 等)。
安装
dsh plugin --profile web add dsh-muv-engine
API 端点
| 端点 | 方法 | 功能 |
|---|---|---|
/api/muv-engine/expand-macros |
POST | 服务端展开宏(random/pick/roll) |
/api/muv-engine/reroll-pick |
POST | 清除 pick 缓存 |
/api/muv-engine/apply-regex |
POST | 对文本执行正则脚本 |
/api/muv-engine/apply-regex-card |
POST | 从卡片 JSON 执行正则(生效脚本集 = 全局先 + 卡级后) |
/api/muv-engine/global-regex |
GET/POST/DELETE | 全局正则脚本库:列出 / 导入(ST 导出件宽容解析)/ 删除 |
/api/muv-engine/state |
GET/POST | 获取/更新变量状态 |
/api/muv-engine/extract |
POST | 提取 <initvar> 并生成 MUV 块 |
/api/muv-engine/generate |
POST | 编辑后生成 MUV 块 |
/api/muv-engine/status-bar |
POST | 提取状态栏 HTML |
协议
PolyForm-Noncommercial-Copyleft-1.0.0 — 详见 LICENSE
Links
More in this category
zhu1090093659/dsh-web#packages/dsh-task-board★ 8597
Task board for the dsh web GUI: a sidebar multi-column kanban whose cards run in real DSH agent sessions and can also be scheduled with cron expressions, executed host-side even with the browser closed.
zhu1090093659/dsh-web#packages/dsh-web-all★ 8597
Plugin and skin collection for the DSH Web UI: task board, Git graph, right-side panel, remote mobile UI, pet, live token stats, and a skin center.
MeteorNOX/DeepSeek-Balance-Whale-Widget★ 4424
A fixed-corner whale widget for the DSH web GUI — balance, today's usage and per-turn cost with peak/off-peak pricing, editable balance-alert and daily-budget bubbles, a module-based custom bubble queue with A/B weighted choices and random lines or images, 30+ vendor templates (OpenAI, OpenRouter, Kimi, SiliconFlow, Ark, Zhipu, MiniMax and more) with per-model balance and subscription quota, plus task-end sound, imported audio, custom roles and a resource manager. Local-only, no telemetry.
ccch1mneyyy/dsh-TUI★ 4268
Claude Code-style full-screen terminal UI: pixel-whale header, live status line, and streaming thought expansion.
omdsh-dev/DSH-better-sidebar★ 4098
Full sidebar workbench with file rendering and editing, terminal, Git, and subagents; third-party plugins can register new tabs.
Devin-AXIS/deepseek-design#deepseek-idesign★ 1445
Visual design studio for websites, app prototypes, posters, cards, reports, and magazines, with templates, direct element editing, selection-aware AI draft handoff, and export.
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.