dsh-web
zhu1090093659/dsh-webDeepSeek Harness(DSH)Web 插件聚合生态包 · 一切皆插件,创意工坊分发(dsh-market.com)
English | 中文
Tavern Fengyue (DSH) — an RPG character-card engine running on the dsh host, with direct import of SillyTavern character cards (.png with embedded data, or .json) and Fengyue cards.
This project aims to guide the development paradigm for tavern-style agents in the agent era: tavern-like applications should stand on mainstream agent infrastructure, not on a bespoke DSL stack.
LLM handles reasoning; everything else runs as a script.
The division of labor, layer by layer:
| Layer | What it does |
|---|---|
| LLM | Narrative prose (creative writing) · Semantic updates to changing values (character mood, scene, state) |
Scripts (preset/scripts/*.mjs / preset/tools/*.mjs) | Dice rolls, pathfinding, HTML rendering, panel styling, state machines — all deterministic logic |
SillyTavern raises the learning curve for both players and card authors — players face regex injection, world info, and injection depth; authors need to master multiple bespoke DSLs just to build a card with real functionality. This project folds everything back into traditional scripts:
.mjs scripts; ST's multi-source depth injection (each source re-injecting its own prompt into the same context every turn) becomes a single live postPrompt per turn, paired with dsh's built-in automatic context compression. In the agent era, reuse the agent infrastructure that already works — don't reinvent wheels.systemPrompt (fixed) + compressed history + pure-append dialogue + latest user message + per-turn dynamic postPrompt.runtime/ IS an llm-wiki: a standing root index + detail archives fetched on demand; no vector DB, no RAG, no plugin black boxes — retrieval, long-term memory, and skills all live as scripts and local files.preset/tools/ and run by script instead of being reproduced by the model in prose. Two wins: it strips "computing by the rules" — reasoning the LLM should never carry — out of the model, saving tokens while removing the instability of mechanical logic reproduced by generation; and the model reads the live objective results a tool returns every turn, so with script injection the narrative always has a dynamic objective reference instead of being improvised.Breaking the traditional impossible triangle. "Rich functionality / low comprehension cost / token cost" are at odds in the traditional ST framework. This project collapses every concept into the system framework itself, and all three improve at once:
.png with embedded data, or .json) and Fengyue cards — world info auto-converts to lorebook.mjs, regex to scripts, complex logic translated by the agent with a full report — nothing silently droppedruntime/ so the frontend renders panels directly, without the model burning output tokens repeating static statePrerequisites: Node.js ≥ 22.19 or ≥ 24, pnpm (npm i -g pnpm or corepack enable).
Compatibility: verified against @deepseek-ai/dsh 0.1.7-rc.2 (npm next) — the list lives in config/dsh-compatibility.json, and pnpm bootstrap installs the newest verified version into the profile. The 0.1.7 migration (2026-09-27; six breaking host surfaces adapted, see the decision note) retired 0.1.5 support — the profile no longer assembles on a 0.1.5 host, and the dev tooling asserts the verified list fail-loud. Upstream dsh is in developer preview with breaking changes expected; if a newer dsh breaks the tavern profile, re-run pnpm bootstrap to restore the verified profile, or follow the external-install fallback in docs/release/independence-and-release.zh.md.
This repository is a DSH profile project: it declares the tavern-fengyue profile and its bundle layer in package.json, and every package under packages/ is built from source. Install from source today — the steps directly below.
The same bundle is being prepared for the standard dsh plugin channel (published to npm as dsh-tavern-fengyue plus its three sibling packages, then installed per profile with dsh plugin add). That path has not been rehearsed end to end yet, so this README deliberately does not document it until it is.
In the project directory:
pnpm install # required after cloning — a checkout ships no build output
pnpm build
pnpm bootstrap # registers this checkout as the `tavern-fengyue` profile
pnpm tavern # starts the host; Ctrl-C stops it
The host serves the Web UI at http://127.0.0.1:3081. The tavern profile claims its own
port so it can run alongside dsh web, which defaults to 3080; a longer-running instance
prints its full URL (with a login token) on boot. --port overrides it:
pnpm tavern --port 3099.
pnpm tavern runs the host this repo pins as its own devDependency
(node_modules/@deepseek-ai/dsh), so a globally installed dsh is not required — and no
DSH_HOME in your shell either: the dev orchestrator injects it. The profile lives in its own
harness home (~/.dsh-tavern-fengyue), leaving an existing ~/.dsh untouched; an exported
DSH_HOME wins and relocates the home (re-run pnpm bootstrap after changing it).
Day to day, pnpm tavern from this checkout is all it takes — no env vars needed. Both the
profile's packages and the host come from here (they are link: dependencies), so after a source
edit pnpm build is all it takes — the profile re-applies the bundle layer live.
The separate harness home exists so the host's real ~/.dsh — and any profile you already keep
there — is never touched; the tavern profile can sit alongside the rest of your dsh setups.
The one case where you set DSH_HOME by hand is driving the same profile with a globally
installed dsh: a different host binary, which would otherwise look in its default
~/.dsh and miss the profile — and whose version then has to match the verified line above
(the pinned devDependency is what pnpm tavern guarantees):
DSH_HOME=~/.dsh-tavern-fengyue dsh --profile tavern-fengyue # bash / zsh
$env:DSH_HOME="$HOME\.dsh-tavern-fengyue"; dsh --profile tavern-fengyue # PowerShell
(Or put the profile in the host's default home from the start: DSH_HOME=~/.dsh pnpm bootstrap.)
DEEPSEEK_BASE_URL / DEEPSEEK_API_KEY for a self-hosted / proxied endpoint)Stop: Ctrl-C in the host terminal; pnpm stop under background mode.
Each session creates tavern_workspace/<timestamp>/:
<workspace>/
├── preset/ ← card source (persists across sessions)
│ ├── meta.json card metadata
│ ├── prompt/ systemPrompt / postPrompt / maintenancePrompt
│ ├── setup/ initial-state template
│ ├── scripts/ {{script}} template scripts
│ ├── tools/ main-agent CLI tools
│ └── assets/ media files
├── runtime/ ← live state (tail agent maintains)
└── savings/ ← save snapshots (runtime backups)
Everything that enters the model's context is a local file you can open and audit — this IS the memory system of the whole project.
On import, world info folds into lorebook.mjs; regex, STScript, and community-derived extensions (such as the MVU variable-update convention) land in preset/st-import/ with a translation report — capabilities preserved, concepts consolidated. Full mapping: sillytavern-mechanics-and-import.zh.md.
On MVU: the framework fully supports the MVU paradigm, but we recommend replacing it with a named tool from preset/tools/ — a tool call can narrate, mutate the state, and return the freshly updated value in one turn, weaving state reads/writes naturally into the narrative flow. If you want to keep MVU's "inline variable-update directive written into narrative" paradigm specifically to avoid tool-call interruption, the framework's hook scripts + frontend JS presentation layer fully support that path too.
Deep-dive docs live in docs/ — organized by area, currently Chinese-first; an English pass follows once the set is reorganized. See the docs index for the full map:
docs/notes/ holds dated decision/bug-fix notes plus the chronological devlog — a historical record; on conflict, the code and READMEs win.
PRs welcome — see CONTRIBUTING.md and CODE_OF_CONDUCT.md. pnpm lint, pnpm build, and pnpm test must pass before review (CI runs the same on Ubuntu / macOS / Windows).
MIT for this project's own code — see LICENSE. Upstream DSH packages keep their own licenses; vendored snapshots and the SRD 5.1 corpus (CC-BY 4.0, not MIT) are listed in THIRD_PARTY_NOTICES.md.