dsh-script-cards: Grid and Two-Level Branch Canvas of Script Cards in DSH

Introduction

When writing long-form scripts or branching narratives in DeepSeek Harness (DSH), characters, settings, pending questions, chapters, and plots are often scattered across many small Markdown files. It is difficult to grasp the full picture at a glance across multiple sessions. The common practice is to flip through directories in the editor manually; the structure (canvas coordinates, connections, chapter affiliations) is either memorized or kept in a separate JSON file, easily becoming disconnected from the card content.

dsh-script-cards is a client-side plugin released by maintainer tokai-teiodh: it manages archive-type cards using a “square grid” and chapters/plots using a “two-level branch canvas” within the project directory. Changes made in the browser are written directly back to card files; the canvas structure resides in 分支.json (Branch.json), which can be committed to git just like the text content. Below is an introduction to what it does, how to install it, directory and card conventions, and the optional cards.py helper tool.

What is this

The full plugin name is dsh-script-cards (the npm package name matches the GitHub repository name), and the version in current documentation is 0.2.1 (MIT License). It targets the DSH Web client: once installed, a “Script Archive” (剧本档案) button appears in the session header, a dockable page appears in the right sidebar (side-by-side with the conversation), and there is also a full-screen entry in the left sidebar.

In short: Two views, two families of cards—the Grid view (squares) collects archive-family cards, and the Branch view collects branch-family cards; they are not mixed. Editing results are written back to Markdown and JSON on disk, rather than existing only in the browser.

View Card type (from source)
Grid (Square) project character setting scene beat dialogue open decision reference
Branch chapter node condition result

Community directory page: skillhub.cn plugin page. Source code and documentation: GitHub tokai-teiodh/dsh-script-cards. The DSH ecosystem is “everything is a plugin”; directory sites like SkillHub have no official affiliation with DeepSeek or HF (High-Flyer). Please check the source code and license yourself before installing.

Core Features

Grid Page: Overview and Archive

The Grid page is an adaptive grid of rounded squares, grouped by type; tags scroll horizontally (drag the tag bar left/right to scroll; text selection is difficult in the left card area, but possible in the right details panel). It supports starring/favorites and pinning; click to view the body. You can right-click a character card to set a “Character Color,” which writes to the color field in the card’s frontmatter. In the document, the dialogue names of that character will change color accordingly.

Branch Page: Chapters → Plots, Two-Level Canvas

The upper level arranges Chapters, and the lower level arranges Plots within that chapter; it features browser-like navigation (Back / Forward / Up to parent / Refresh + Breadcrumbs). Double-click a chapter card to enter the lower level.

Canvas interactions (key points from the source):

  • Zoom and Pan: Mouse wheel zooms in fixed steps (25%~200%) centered on the pointer; left-click drag on empty space pans the canvas; middle-click and Alt+Left Click also pan.
  • Connections: Drag from the dots on card edges to create Bezier curves; release to connect. Connections follow cards in real-time when dragging. Lines can be clicked to name them, and right-click allows rename or delete.
  • Marquee Selection & Batch: Right-click drag a dashed box on the canvas to multi-select; Delete removes from canvas, Ctrl+A selects all on the current layer; supports grouping, coloring, auto-arrange (vertical/horizontal), etc.
  • Reference Cards: Dragging from the “Archive Card” drawer onto the canvas creates a reference, not a file copy. The position is recorded in the refs section of 分支.json; details are read-only with dashed borders. To modify content, return to the Grid page.
  • Text Boxes and Rectangles: Independent objects recorded in the objects section of 分支.json; they do not participate in connections or the auto-arrange semantics applied to cards.
  • Expanded Cards: Default to floating windows (can be pinned or fullscreen); Chapters/Nodes have separate “Fields | Document” tabs. The Document is an independent file located at <Archive Directory>/文档/<Same name as card>.md.

Document Page: Long-form Text and Dialogue Entry

Available only on Chapter and Node cards, separating the document from card body fields like ## Characters. The document input box supports Ctrl+S to save; empty documents are not written to disk. Right-clicking in the document brings up a character menu (derived from the title rules of type: character in the Grid page) to enter dialogue/narration, with Enter / Shift+Enter line-start marker rules. Unsaved drafts are stored locally in the browser (not written to the project directory); if writing fails, the input box becomes read-only with an explanation.

Detailed operation instructions are in the repository’s 操作指南.md (Operation Guide) (linked in README).

Installation and Activation

This package is not published to npm; it must be placed into the DSH profile’s node_modules as source code and registered in the profile’s bundle list. You must restart DSH after changing bundles—the client manifest and Typert manifest are assembled at boot; they will not take effect without a restart.

The installation steps from the source (Windows PowerShell example paths; for Linux/macOS, replace $env:DSH_HOME with the corresponding environment variable):

# 1) Clone into the profile's node_modules
git clone https://github.com/tokai-teiodh/dsh-script-cards "$env:DSH_HOME\profiles\desktop\node_modules\dsh-script-cards"

# 2) Add the package name to this profile's dsh.profile.bundles (see profiles/<profile>/package.json)
#    "dsh": { "profile": { "bundles": [ ..., "dsh-script-cards" ] } }

# 3) Restart DSH

Runtime environment: package.json requires Node >= 20; peer dependency includes @deepseek-ai/cordis ^4.0.2.

Directory Conventions and Card Format

The default directory is under the project root (the name can be changed per project in the panel “Settings”, stored in the browser locally):

<Project Root>/
  剧本档案/ (Script Archive)
    卡片/*.md        ← One card per file
    归档/*.md        ← Session summaries
    文档/*.md        ← Independent documents for Chapter/Node cards (same name as card file)
    分支.json        ← Chapter affiliation, canvas coordinates, connections, coloring, reference positions, etc.

Content is in card .md files, structure is in 分支.json; documents are a third independent file. Frontmatter field whitelist (consistent with cards.py): id / type / title / code / chapter / mode / when / order / summary / tags / color / created / updated / source.

Node example (from source):

---
id: node-n1
type: node
title: Shrine Training
when: Day 4
order: 10
summary: One-line intro (the line at the bottom of the panel card)
tags: Daily, Side Quest
---

## Characters
- A

## Scene
- Somewhere

## Content
- What happened
  • code: Chapter sequence number, e.g., G1.1.
  • chapter: Key of the parent chapter card, formatted as card/<filename without .md>.
  • mode: branch: Drawn as a branching node (with option list and multiple exits).

Typical Usage: cards.py (Optional)

The repository includes a zero-dependency Python tool cards.py for initializing the archive, adding/deleting cards, archiving sessions, rebuilding indexes, etc. Execute in the project root, for example:

python cards.py init    --root .
python cards.py add     --spec card.json --root .      # Add card (--force to overwrite)
python cards.py archive --spec summary.json --root .   # Archive a session
python cards.py index   --root .                       # Rebuild index

Daily editing is primarily done via the panel; the CLI is suitable for batch card creation or integration with automation scripts. Refer to the repository README and script help for specific subcommands and JSON specs.

Use Cases and Notes

Who it is for: Teams or individuals maintaining game scripts, interactive fiction, or branching plot designs in DSH long-term, who want “files as the source of truth, git-diffable.”

Permissions and Security: The plugin runs with the current DSH process and can read/write the project directory you opened. You should read the source code and MIT license before installing to ensure the bundle source is trusted. Do not blindly add bundles in unaudited third-party profiles.

Dependencies and Platform: Classified as a client (Web); lack of npm release means upgrades require manually pulling the repository or replacing the node_modules directory and restarting.

Conclusion

dsh-script-cards consolidates “scattered Markdown cards” and “branching structures” into a unified set of DSH panels: the Grid for settings and assets, the Canvas for chapters and connections, with changes written back to files. If you are doing branching narratives in Harness, you can install it into your profile following the steps above and agree on the 剧本档案 (Script Archive) directory convention.

  • Directory Page: https://www.skillhub.cn/plugins/tokai-teiodh/dsh-script-cards
  • GitHub: https://github.com/tokai-teiodh/dsh-script-cards
羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye