@ai4rpg/dsh-tavern-stages
DSH plugin that brings the tavern-cards skill workflows into the standalone @ai4rpg/dsh-stage-switch plugin. The design decision record is docs/DESIGN.md.
English | 中文
Note: this plugin and its stage-switch base are published under
@ai4rpg/*. The tavern content (the agent preset, skills, and personas) ships in a separate GitHub repo, the tavern content repo, outside npm. The@deepseek-ai/*packages appearing in this repo are upstream DSH dependencies (dsh-agent,dsh-fs,dsh-session, etc.), separate from this plugin's namespace.
It covers the three tavern-cards workflows:
tavern-design: narrative/design-spec stagetavern-cards: planning, creation, MVU/EJS/configure, opening messagestavern-ui: status bar / frontend UI work
What ships here, and what ships separately
This package is the plugin: the stage config for dsh-stage-switch, the project-workspace tooling (tavern_forge, focus tracking, the completion predicate), and native mechanical checking.
The agent preset (tavern-standard), the three tavern skill bodies, the main preset's persona text, and the four agent personas ship in the companion tavern content repo (github.com/ai4rpg/tavern-content; clone it to install). It holds the @ai4rpg/dsh-tavern-preset package, whose generator reads upstream tavern-cards personas directly and embeds them in its child declarations. The preset declares tavern-standard and composes this plugin's exports into it; its own READMEs and install guide carry the deployment detail.
What it provides
- Provides
tavernCardsStageConfig/createTavernCardsStageConfig()fordsh-stage-switch. - Registers one composite eligibility predicate reporting whether the current stage is complete.
- Judges completion for the focused project (the focus tracker follows recent
fs/observedwrites), with per-stage content checks;content/uiadditionally require a successfulpack(the pack gate). - Reads
.cardrc.json,design-spec.md,创作规划.yaml, andtavern-cards-state.json. - Exposes the forge CLI to the model as one
tavern_forgetool (pack =command: 'pack') and to humans as/tavern-forge+/tavern-pack;@ai4rpg/tavern-cards-forgestays an external npm dependency. - Retains
loadTavernAgents()/TavernAgentDescriptorfor legacy consumers; the current preset uses its own strict upstream reader instead. - Leaves skill registration to the preset package: the CC BY-NC-SA skill bodies ship there, exposed through the official
skill-filesystemrow.
Usage
import { apply, tavernCardsStageConfig } from '@ai4rpg/dsh-tavern-stages'
import StageController from '@ai4rpg/dsh-stage-switch'
await ctx.plugin(StageController, tavernCardsStageConfig)
await ctx.plugin(apply)
Installation
Tavern context is per-session: it loads only in sessions started on the tavern agent preset. Sessions on any other preset get no route instruction, no goto_stage/tavern_forge tools, and no tavern skills. Preset selection comes with DSH's web UI.
dsh plugin --profile <name> add file:<absolute path to your tavern-content clone>/tavern-preset
This plugin ships on npm; the preset package installs from the cloned content repo by absolute path (dsh plugin accepts absolute specs only). The profile pulls this plugin from npm as the preset's dependency.
Requires dsh 0.2.2-rc.3 or newer on the 0.2 line and Node.js ≥24.9.0: the package declares engines.dsh: ">=0.2.2-rc.3 <0.3.0-0", which dsh's plugin manager checks before loading it.
Preset compatibility: in preset deployments, this release requires the 0.2.0 preset package. The 0.1.0 preset still declares the retired
tavern:*providers andsubagents.enabled; it is not compatible with this plugin. Update or regenerate the preset before switching.
Preset selection, defaults, verification, and the snapshot semantics of an edited preset are deployment concerns of the content repo; its tavern-preset/docs/install-guide.md covers them.
Configuration
Embed programmatically as shown in Usage. In preset deployments, parameters (the stage-switch language, the per-tool agentOptions) are set on the preset's own rows; see the preset package's README (tavern-preset/README.md).
Forge CLI access
The forge CLI arrives as the external @ai4rpg/tavern-cards-forge dependency (published on npm; its bin ships via dist/index.mjs), resolved by pnpm/npm through node_modules.
When @deepseek-ai/dsh-commands is composed, the plugin registers:
/tavern-forge <command> [args]: run any forge command (init,configure,query,patch,pack, ...)/tavern-pack <project>: convenience wrapper fortavern-cards-forge pack
Examples:
/tavern-forge init Demo --mvu
/tavern-forge configure Demo
/tavern-forge pack Demo
/tavern-pack Demo
This keeps packaging available in every stage.
Named subagents
The four agent personas (check-agent, conversion-agent, schema-agent, first-message-agent) originate in upstream tavern-cards (CC BY-NC-SA, separate from this MIT package). This plugin registers no delegation provider and mounts no delegation tool. The preset generator validates an explicit upstream snapshot, then generates:
- one
@deepseek-ai/dsh-tool-subagentrow per agent, bound to dsh's officialspawnprovider (provider: spawn) withagentPreset: tavern-child-<name>, and - one child agent preset per agent (
tavern-child-<name>) whosepersonaprefix is the persona body and whose tool set is declared for that agent's task (the check preset is read-only; only the conversion preset carriesbash).
Each tool hands focused work to a fresh-context child (e.g. "run check-agent on these entries") instead of the model reviewing its own output. Delegation is asynchronous: the tool returns an activation receipt (the child's name) immediately, and the child's final answer arrives as the parent's completion notification. Wait for the notification before continuing with work that depends on the result; the tool result carries no answer. Child sessions are real, resumable sessions: the host can send follow-up messages, and a child's recorded preset id is resolved again on resume. That is why tavern-child-<name> is a stability contract — renaming or deleting one breaks resume for sessions already recorded under it.
The child is an independent composition, not a copy of the parent context: its persona and tool set come from its own preset, which re-declares agent-instructions and the tavern skills (skill-filesystem with the same customSkillDirs, plus tool-skill). When a body references docs by a path relative to a tavern skill directory, the child calls the skill tool once for that skill; the response carries the skill's resource base path, so the child reads its docs from there.
Per-tool models & reasoning effort
Tool children inherit the parent session's model route and, when the route is unchanged, its connection-level reasoning effort; the shipped rows leave agentOptions unset because models differ in the effort values they accept. Route, effort, and maxTokens are native fields on each tool-subagent-* row's agentOptions; the content repo's tavern-preset/README.md shows how to pin them per tool.
Disabling the delegation tools
The plugin has no delegation switch; the four tool-subagent-* rows and their child presets are the whole wiring. Disable or remove those rows in the preset to hide the tools.
Dependencies
@ai4rpg/dsh-stage-switch:^0.2.2, the stage machine this plugin extends. 0.2.2 requires dsh0.2.2-rc.3or newer on the 0.2 line; it reads session stage records through the mandatorysession-projectionseam (composed bydsh-base) and carries thelanguagerow config (endefault,zhfor the Chinese review dialogs).@ai4rpg/tavern-cards-forge:^0.1.0, the external forge CLI whose bin ships indist/index.mjs. Persona sources are not package dependencies. The preset generator readsTAVERN_CARDS_ROOT/agentsand embeds the bodies; ordinary installation does not need that checkout. The retained legacy loader accepts an explicitTAVERN_AGENTS_ROOTor the former source package if a consumer supplies one, but the current preset does not use it.
stage-switch and forge are plain versioned npm dependencies; the profile's pnpm install makes them resolvable to preset rows. DSH profiles set autoInstallPeers: false, so a package that existed only as a peer would not be installed.
License
MIT. The three skill bodies and the embedded agent personas ship in @ai4rpg/dsh-tavern-preset (outside npm); they are CC BY-NC-SA 4.0 (attribution, non-commercial, share-alike), sourced from ai4rpg/tavern-cards. This package is MIT-only.
No comments yet. Be the first to write one.