# dsh-tavern usage guide [中文](USAGE_zh-CN.md) This guide covers the current orb interaction, frontend display-mode switch, RP workspace admission, character-card create/edit, playthrough lifecycle, imported-record opening bind, external persistent storage, RP secure mode, and delegated child agents inheriting the parent's Tavern selection. Message flow, architecture, and security contracts are in `DSH_MESSAGE_FLOW_en.md`, `ARCHITECTURE_en.md`, and `LOADER_CONTRACT_en.md`. RP block/allow list: [RP_SECURE_MODE_en.md](RP_SECURE_MODE_en.md). ## When an error occurs in RP On the target DSH `0.2.1-rc.2` / `0.2.1-rc.3`, exposed Session errors or the latest turn's terminal failure show: “An error occurred. Switch to the Chat view for more information.” Select DSH's Chat tab for the detailed cause. RP does not switch views automatically or duplicate provider diagnostics. The notice follows Tavern's UI language. A new request in progress hides the previous turn's failure; later success or intentional cancellation supersedes old errors. Automatic retries in progress and recoverable tool errors alone are not terminal failures. ### Workspace and playthrough read problems Open **DT → Diagnostics** for problems in the current RP workspace, in either native or Mowan mode. The sidebar shows one dismissible summary. The `⚠` beside an affected playthrough opens its details, even when the playthrough itself cannot be opened. A readable timeline also receives a warning when none of its sessions are available in the current RP workspace, including archived, moved, or unavailable sessions. Empty playthroughs are checked too; a healthy new empty playthrough is not flagged just for having no messages. Checks wait for the DSH session and workspace lists to finish loading. The panel shows the affected character/playthrough, cause, and recovery advice. Expand **Technical details** for the error code, file path, and any session ID in the error. **Copy diagnostics** copies the displayed list; **Copy this problem** copies one item. Reports include local paths and object IDs; review before sharing. **Recheck** reads the current workspace again. Dismissing the summary does not remove problems. Rechecks, page reloads, and native/Mowan switches in the same browser tab do not re-alert dismissed identical problems. New problems are shown, and a successful check automatically removes resolved ones. Closing the browser tab ends this dismissal preference. The current problem list reflects current reads. Expand **Operation logs** to explicitly load backend persistent logs, filter by operationId, page through older entries and export the displayed page as JSONL. There is no polling or browser telemetry. Storage is bounded to 4 MiB; rotated records are no longer available. Technical details show degraded status and drop counts. An older Host displays log access as unavailable without affecting current problems. Exports omit prompts, conversation/resource bodies and paths, but retain private identifiers; review before sharing. Logs replace neither Prompt Trace nor business history; model request failures remain available through Conversation as described above. See the [API contract](OPERATION_LOGS_en.md) for configuration, limits, correlation and errors. ## Quick Start: shortest RP path Do one full turn in this order the first time. The screenshot version is in the Chinese [README](../README.md#quick-start从角色卡到第一轮-rp-对话). The [English README](../README_en.md) has no images. 1. Left-click the `DT` orb and import an ST JSON or PNG card on the **Character card** page. 2. Return to native DSH and create a workspace that will be used for RP. 3. Right-click `DT` to enter Mowan. On first entry, explicitly choose the RP workspace you just created. 4. In the RP sidebar, click `+` on the target card to create or reuse that character's latest empty playthrough. 5. Choose a greeting and adjust configuration in the independent opening draft; keep the current greeting if there is no alternate. 6. Send the first user message from the draft composer. Once admitted, the real DSH Session opens and subsequent messages use its native composer. This path does not write greeting as history and does not copy a DSH session. Import other resources, display regex, swipe, branch, rollback, imported records, and export after the first turn works. ## 1. Open and switch panels After install and DSH Web restart, the page shows an orb always labeled `DT`: native (Lingzhu) is blue-white, play (Mowan) is red-black. - Drag the orb to move it. Position is remembered in the browser. Ending a drag does not accidentally expand the menu. - Left-click immediately expands or collapses the menu. Rapid repeated clicks repeat that default toggle; double-click has no special effect. Right-click switches frontend display mode. After the server confirms, the divider rotates once and the colors transition. Mode state does not wait for the animation. Rotation is skipped when the system prefers reduced motion. - Menu buttons say **Switch to custom frontend mode** or **Switch to DSH native mode**, and may show **Current: Mowan** or **Current: DSH native**. The tooltip is **Switch frontend display mode**. No marketing copy. - The menu stays mounted. Content fades in after the 220ms expand so the first-row switch button does not flash. After any sidebar opens, the orb remains so you can switch modules. - A glowing green dot next to a resource means the current session has that resource enabled; red means it is not. A world-book green dot means an effective binding exists, not that keywords hit this turn. - The title shows currently enabled content. The in-panel “browse/edit target” can differ from the session binding. Trust the binding state and **Not applied** hints. - If a preset, character card, user, world book, session template, display regex, or imported record fails completely, the UI shows an **Import failed** dialog in addition to the existing inline error. If the resource imported successfully and only has compatibility diagnostics or warnings, only the panel diagnostics stay; no failure dialog. - **UI settings** can switch Simplified Chinese/English, scale Tavern UI from 75%–150%, and choose a default RP workspace from existing DSH workspaces. It also toggles **Follow character into RP** and edits optional `rp:policy` text. The default RP workspace is authoritative via `GET/PUT /v2/workspace` and is not copied into UI settings. Changes affect only the default location of new playthroughs and RP/ordinary session classification. They do not move existing sessions, directories, catalog, or timeline. Language/scale/follow are global; the RP switch itself is per-session. Lock list: [RP secure mode](RP_SECURE_MODE_en.md). - The first time you enter Mowan without an RP workspace, a workspace picker appears instead of an empty RP UI. The page lists only existing DSH workspaces. A single candidate is still not auto-selected. After you click a candidate, wait for write and read-back. If the previous binding is stale or read/write fails, use **Check again** or **Return to DSH mode**. System-disk candidates still require a second confirmation. ## 2. Presets The preset panel can import SillyTavern Chat Completion preset JSON or create a blank preset. After saving edits, use **Export JSON** to download the current resource. Reasoning effort offers inherit, off, low, medium, high, extra high, and maximum (`max`). Other valid provider effort IDs from imported files are preserved and displayed in the selector; editing unrelated fields does not clear them. Choosing inherit clears Tavern's explicit override. Available values still depend on the target model/provider; preserving a value does not mean every model supports it. 1. Choosing a preset from the list only opens it for browse/edit. It does not automatically affect the current session. 2. You can edit the name, append/replace system strategy, DSH-supported sampling parameters, and prompt-block enablement, role, content, and order. 3. Drag the handle left of a prompt to reorder. The dragged source shrinks to a bar; the drop target shows a placeholder. 4. After saving the resource body, click the blue bind/update button to apply it to the current session. Unbinding does not delete the resource. 5. An explicit preset switch is rejected while the agent is running. Retry after the current turn ends. `append` keeps existing DSH system sections. `replace` keeps only the model-visible Tavern profile text. Code Mode, structured output, or tool-prompt reliability may drop, but file sandbox, approval, and tool execution stay on. Open the standalone strategy editor from DSH Plugins → Installed plugins → dsh-prompt-assembler → Configure current session; there is no separate assembly button in the bottom-left footer. When only Tavern is installed, the standalone entry is on the pmp-dsh-tavern detail page under Plugins → Installed plugins. The DT assembly entry still targets the RP session or opening draft. Save rules updates the library only; Save and apply to this session saves edits (including history filtering) before applying them to future requests. The prompt assembly rule list provides **DSH native runtime hints (master)**, **Sandbox policy hints**, and **Approval policy hints**, all enabled by default. The master switch filters only DSH’s `sandbox:policy`, `approval:policy`, and `subagent:delegation`; context from other plugins, world books, and memory, as well as native history, is preserved. Disabling the master retains the child switch selections. Save and apply the strategy to affect subsequent requests. DSH keeps its native context wrapper whenever context remains. These switches control model-visible prompt text only; actual sandbox and approval enforcement is unchanged. ## 3. Character cards The character panel supports SillyTavern V1/V2/V3 JSON and PNG files that contain `chara`/`ccv3` data. Imports read `tags: null` as no tags and report a compatibility warning while preserving the original field. Other invalid types and arrays containing non-string tags still fail validation. 1. After import or create, you can edit name, description, personality, scenario, greeting (including alternates), example dialogue, and similar fields. Saving fields and binding to a session are two steps. The plugin stores one current card document. PNG import also keeps a cover image with card data stripped. PNG export uses a placeholder when there is no cover. There is no “export original file”. 2. Choose a greeting and whether the card system prompt and post-history instructions take priority. If the current card is already bound, changing greeting or policy without binding again shows **not applied**. 3. Click bind/update to apply to the current session. Another session can bind a different character. A delegated subagent freezes the parent session's Tavern selection at that moment (same as **New chat with current settings**). Whether the spawn prompt narrows the task is up to the parent agent / preset author. 4. Unbind only removes the session selection. Delete removes the card document and cover from the plugin library and clears stale session selections. Playthroughs that still reference the card appear under **Missing character cards** in the Mowan sidebar, using the pre-delete name. Re-importing the same file (unique SHA-256 match) or a uniquely same-named card automatically restores the playthrough and all descendant session bindings. If uniqueness cannot be decided, use **Relink** next to the missing card; the UI will not guess from a shared name. Each playthrough's ⋯ menu also has **Relink character card**, which migrates only that playthrough and its branch sessions. If the target is outside the automatic classification rule, a warning appears, but you can still confirm your choice. 5. The Mowan sidebar top can sort cards by **Recently updated**, **Name A–Z**, or **Custom**. **Recently updated** uses DSH session summaries and orders by the newest conversation activity under that card; cards with no session fall back to resource `updatedAt`. Drag is allowed only in Custom. Switching modes does not clear a saved custom order. description, personality, scenario, example dialogue, and similar fields enter the unified Tavern profile through preset markers or a stable fallback. Loader metadata and diagnostics describe greeting placement and provenance; greeting is never forged as an assistant history message that already happened. Greetings expand name macros, then apply assistant display rules in global → current preset → current character order, including variable folds and static status panels. Depth counts the user/assistant messages after the greeting. If the rules clear it entirely, the name-expanded source remains visible so a model-output protocol filter cannot erase the opening. RP, the native opening dock, and static HTML exports share this behavior; JSONL keeps name-expanded greeting sources and alternates without baking in display templates. Static rendering does not write DSH history. Supported variable reads and writes use the separate scoped MVU/card runtime described in [MVU](MVU_en.md), not arbitrary Tavern Helper execution. ### Display regex The display-regex page lists rules from global, current preset, and current character card. Drag the handle left of a rule title to reorder within the same source. The interaction matches preset prompt sorting: the dragged item shrinks to a line and the drop target shows a dashed placeholder. After **Save changes**, global order is written to the workspace regex document; preset/card order is written back to each native `regex_scripts` array. Sources cannot be dragged across each other. Combined order is always global → preset → character. Rules run top to bottom, so interdependent rules such as conditional clears and tag extraction must stay in the intended order. ### Markdown, HTML, and template styles RP messages and greetings support LaTeX math by default: use `$x^2$` or `\(x^2\)` inline, and `$$…$$` or `\[…\]` for display math. Put opening and closing delimiters on separate lines for multiline expressions. Fractions, roots, integrals, matrices and `aligned` use KaTeX syntax. Native MathML requires no downloaded fonts or scripts and survives static HTML export; use a modern browser with MathML support. This is not a full LaTeX document compiler. Unknown commands, invalid or over-limit expressions fall back to source. Each formula is limited to 4096 characters and 200 macro expansions; macro definitions are not shared between formulas. External-resource and HTML-injection commands are not trusted. No extra toggle is required. Single-dollar delimiters cannot have whitespace immediately inside them, and a closing dollar cannot be followed by a digit, preserving common prices such as `$5 and $10` and `$5-$10`. Literal `$x$` is inherently indistinguishable from math syntax: escape it as `\$x\$` or use code to show it literally. Math composes with headings, emphasis, lists, link labels, tables and `
` bodies/summaries. Inline HTML text follows Markdown math rules; HTML attributes, comments, ``/`
`, raw HTML blocks, complete HTML templates and interactive-card interiors are not automatically parsed for math, preserving their existing HTML/code semantics. Pipes inside Markdown tables still require Markdown escaping. Streaming expressions render only after their delimiters close; changing one message does not rebuild unchanged historical formulas. Typesetting only affects Tavern views and static HTML exports, without rewriting DSH messages, prompts or JSONL exports.

Markdown inside `
Title` is parsed without requiring extra blank lines after summary. Nested details, lists, emphasis, and fenced code are supported. A closed unlabeled or `html` fence containing a complete `…` document or `……` pair renders as a static HTML template, with HTML comments and a document declaration allowed. Ordinary HTML fragments, other languages, indented code, and unclosed fences remain literal code. Use a `text` fence to display a complete document's source. Ordinary raw HTML containers retain HTML semantics. Templates can use `