dsh-prompt-assembler: Assembling DSH Prompts Based on Session Strategy

Introduction

Before sending a message in DSH, the Host combines system instructions, historical messages, and current input into a single LLM request. Relying solely on the Host’s default behavior makes it difficult to select different instruction combinations, source snippets, and arrangement methods for different sessions within the same workspace; writing logic into independent scripts often leads to disconnection from DSH’s durable history.

dsh-prompt-assembler is an independent DSH plugin (Category: Workflow) maintained by Player-MINEPIG. It provides a strategy library, source registration, and request assembly within the Host, supporting policy binding per session. Sources continue to hold their own content and read permissions, and DSH durable history remains the authoritative record of session history; the standard version flow works without installing Tavern or Memory Manager.

What is this

The plugin’s full name is dsh-prompt-assembler, with the version in current documentation being 1.1.1, targeting DSH 0.2.1-rc.2. The README states that new versions only support the standard public interface; advanced extensions are frozen at Assembler 1.1.0 / DSH 0.2.0-rc.2, with no commitment to future DSH adaptation.

In addition to the Host plugin, the same npm package exports a composable assembly library API for registering sources and calling assembleRequestAsync independently in a Node environment.

Core Features

Strategies and Per-Session Application

The plugin manages strategy storage, UI, and “Save and apply to current session” independently. Save rules only update the strategy library; modifications must be re-applied to affect subsequent requests. Installation itself does not apply strategies, nor are there global default strategies.

Source Registration and Assembly

The plugin exposes capabilities such as store, runtime, registry, and strategies via the Host service dshPromptAssembler; the shared source service is dshPromptSources, and the ordering service is dshPromptStrategies. Third parties can use the registry API to register dynamic modules or custom text parsers; unselected sources are not automatically injected.

The standard version uses native events and body references; uninstalling a source does not rewrite DSH native history. Uninstalling the plugin preserves DSH durable history and strategy storage.

Standard Version vs. Optional Advanced

The quick start documentation focuses on the standard version, requiring no Tavern, Memory Manager, or core addon. Advanced capabilities like assembly snapshots require optional addons and a prepared Protocol 1 core; if either is missing, a 409 is returned. See docs/BACKENDS.md in the repository for details.

Composing as a Library

Pure assembly library scenarios require Node >=20. Root export example:

import { createDshRegistry, assembleRequestAsync, BUILTINS } from 'dsh-prompt-assembler'
const registry = createDshRegistry()
const result = await assembleRequestAsync({ registry, preset: BUILTINS[0], nativeMessages, inputIds })

Installation and Enablement

Prepare a runnable DSH 0.2.1-rc.2 Host with Node version ^22.19.0 || >=24. Replace web in the following commands with the profile you are actually using.

  1. Stop the target Host and install the plugin:
dsh plugin --profile web add dsh-prompt-assembler@1.1.1
  1. Restart the Host.

For source installation, use github:Player-MINEPIG/dsh-prompt-assembler#v1.1.1; to follow the development mainline, use #main. The standard bundle uses a pre-built client and does not compile source during installation. See docs/INSTALLATION.md in the repository for detailed boundaries.

Typical Usage (Standard Version)

  1. Open a session (a blank session is fine), go to Plugins → Installed Plugins → dsh-prompt-assembler → Configure Current Session.
  2. In the strategy library, click Create, fill in the name, and select Standard · Official Interface for the integration method. Keep “Official Base Instructions, Native History, Current Input”.
  3. Expand Sources, Text & Delivery Settings, select the “DSH Custom Text” parser, and Add Custom Text (e.g., fill in “Please answer in concise Chinese.”), keeping the role as user.
  4. Open Assembly Result to check the body, roles, and arrangement. The preview does not send requests and does not include content from the input box awaiting sending.
  5. Click Save and apply to current session, confirm that “Currently Applied” displays the strategy, and return to the chat to send a message. To start from a new session, use New session with this strategy and select the workspace.

For complete operations, see docs/USAGE.md in the repository; for trajectory display limits regarding standard history cleanup, see docs/HISTORY_POLICY.md.

Use Cases and Notes

Who it is for: Developers who need to manage prompt snippets via a visual strategy library within DSH, switch assembly schemes per session, or wish to extend sources on the same Host without modifying the assembly core.

Runtime and Security: The plugin runs with the permissions of the current DSH process; before installation, you should read the repository source code and SECURITY.md, and confirm the license (package.json is MIT). Callers composing their own HTTP factories are responsible for authentication and secure fetching.

Ecosystem Note: The DSH community plugin directory (such as SkillHub) is an independent site with no official affiliation with DeepSeek / High-Flyer; GitHub, npm, and public directories are independent distribution channels.

Links

羽毛球分组比赛记分
小程序二维码

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

Xiaoye