npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

dsh-tavern

v3.0.0

Published

All-in-one DeepSeek Harness Tavern suite (formerly dsh-tavern + dsh-muv-engine + dsh-muv-table): character cards, worldbooks, writing presets, personas, unified regex/HUD sandbox, MUV/ERA variable tables, and memory summaries.

Readme

dsh-tavern (v3.0.0 · All-in-One)

DeepSeek Harness 三合一酒馆插件 — 将原 dsh-tavern、dsh-muv-engine 与 dsh-muv-table 三个插件彻底重构并合而为一,采用清晰的 4 层 TypeScript + React 模块架构,全面遵循 DSH 0.2.2-rc.5 原生扩展规范。

三合一说明:状态栏/HUD 渲染(原 dsh-muv-engine)与 MUV/ERA 变量表格(原 dsh-muv-table)已全部内建。安装本包后不需要再安装这两个插件;它们的旧版本已在 npm 标记为归档并指向 v3。

v2 归档:chen731215-dev/dsh-tavern-v2 仓库与 [email protected] 线已封档,仅保留历史版本,后续只维护 v3。

文档:使用指南 · 更新日志 · 工程规范

安装

  • 图形界面(推荐):DSH → 设置 → 插件 → 添加插件,搜索 dsh-tavern 并安装。
  • 命令行:在 DSH 的插件管理中按包名 dsh-tavern 安装(具体子命令以当前 DSH 版本 dsh plugin --help 为准)。

安装后重启 DSH,左侧边栏会出现「酒馆」入口。

快速开始

  1. 左侧边栏「酒馆」→ 工作台,导入角色卡(ST .png / .json)。
  2. (可选)导入世界书、写作预设、玩家人设。
  3. 打开一个聊天,点顶栏「酒馆」胶囊,为本会话绑定素材。
  4. 正常对话;右侧边栏「酒馆状态」实时查看变量、本轮差异与记忆。

未绑定的普通编程会话零注入、零界面装饰。完整说明见 TUTORIAL.md。

为什么重构为三合一(v3.0.0)

旧架构拆分在三个仓库中,存在以下结构性痛点:

  • 10 个并发 DOM 观察器与 4 套正则/渲染管线相互争抢:状态栏叠两层、重渲染死循环、思维链被误美化。
  • 3 套预设/会话决议口径:角色卡与状态栏频繁“串台”。
  • 概念不清、入口分散:面板混杂“DSH Agent 预设”与“写作预设”、遗留大量死开关,且分散在设置页、酒馆按钮、MUV 表格按钮和两个独立 HTML 页面中。
  • 宿主 CSS 污染:旧 dsh-muv-engine 注入的 !important 全局样式会破坏 DSH 侧边栏图标与面板定位。
  • 单文件巨石难维护:旧客户端 bundle 达 13,000+ 行 ES5 字符串拼接,难以审查与迭代。

v3.0.0 彻底解决上述问题:

  • 一个包、一套引擎、一个观察器、一个沙盒:零跨包依赖,零 DOM 战争,零宿主 CSS 污染。
  • 三层清晰作用域:
    1. 全局资源库(左侧栏「酒馆」工作台):角色卡、世界书、写作预设、玩家人设、全局/显示正则。
    2. 当前会话装配(对话顶栏「酒馆胶囊」):单会话独立开关与绑定;未启用的普通编程会话零提示词注入、零 DOM 干预。
    3. 实时状态栏与变量表(DSH 原生右侧边栏「酒馆状态」):实时查看与编辑 MUV/ERA 变量树、本轮变化 before → after 差异、楼层快照回溯、开场白切换与记忆总结。
  • 兼容旧版数据:支持从旧版 ~/.dsh/.agent-presets/ 与 global-regex.json 一键只读迁移,不破坏任何旧文件。

架构分层

src/
├── core/        纯领域引擎(零 Node FS / 零 DOM,100% 纯函数可单测)
│   ├── types.ts            统一领域模型
│   ├── api-contract.ts     Host 与 Client 共享的强类型 HTTP 契约
│   ├── card-parser.ts      统一 PNG (tEXt/zTXt/iTXt, ccv3/chara) + JSON 卡解析与导出
│   ├── worldbook.ts        世界书 v2 规范化与常驻/关键词触发选择
│   ├── preset-converter.ts SillyTavern Chat Completion 预设 → 写作预设转换
│   ├── macro-engine.ts     {{persona}}/{{user}}/{{char}}/{[roll/random/pick]} 与提示词转义
│   ├── regex-engine.ts     唯一 ST 正则引擎(函数式 replace,无 64KB 截断)与渲染方言判定
│   ├── var-engine.ts       统一变量引擎(initvar + ERA + _.set/_.add + RFC-6902 JSONPatch)
│   ├── status-fallback.ts  无皮肤卡 5 级状态栏文本兜底与选项提取
│   └── prompt-builder.ts   唯一系统提示词组装器与 token 统计
├── storage/     统一磁盘存储与旧版迁移(原子写入,绝不改写 DSH 会话日志)
│   ├── paths.ts            DSH_HOME 解析 + 自我定位 profile 目录
│   ├── library-store.ts    全局共享资源库 + 旧版 v2 只读迁移
│   ├── session-store.ts    单会话隔离存储(绑定 / 持久化变量与快照 / 记忆)
│   ├── session-log-reader.ts 只读 DSH 多帧 zstd 会话日志读取器
│   └── preset-bridge.ts    DSH「酒馆模式」Agent 预设声明桥(patch 受管块)
├── host/        极薄 Cordis 宿主插件
│   ├── index.ts            Cordis 插件装配入口
│   ├── session-resolver.ts 唯一权威会话与预设决议(兼容 DSH 0.2.2-rc.5 快照)
│   ├── prompt-hooks.ts     tavern:core + tavern:nsfw 段与 promptOnly 钩子(安全壳隔离)
│   ├── summary-service.ts  基于原生 fetch 的记忆总结服务与写边界净化
│   ├── dsh-connections.ts  读取 DSH 已保存提供商配置(密钥不外泄)
│   └── routes.ts           单一 /api/tavern/ 前缀路由分发器
└── client/      DSH 原生 React 18 TSX 前端(仅使用 --dsw-alias-* 语义令牌)
    ├── index.tsx           极薄入口:按 slot 逐个安全挂载与卸载清理
    ├── api.ts / store.ts   强类型 API 与 useSyncExternalStore 响应式状态
    ├── styles/tavern.css   完全隔离在 .tv3-* 命名空间,零 !important
    ├── components/         轻量原生风格控件与描边图标
    ├── workspace/          左侧栏全屏工作台(角色卡 / 世界书 / 写作预设 / 人设 / 正则与设置)
    ├── session/            顶栏胶囊弹窗 + 空白会话启动卡片 + 原生右侧边栏状态页签
    └── renderer/           单一消息观察器 + 显示管线 + 安全沙盒 HUD(无 allow-same-origin)

开发与验证

pnpm install
npm run typecheck   # TypeScript 严格类型检查
npm run build       # 构建 lib/index.js 与 lib/client.js,并运行安全门禁校验
npm test            # 运行全部单元测试与集成测试
npm run check       # 一键执行 typecheck + build + test

许可协议

PolyForm-Noncommercial-Copyleft-1.0.0(禁止商用),详见 LICENSE。