@gw/dsh-text-inject: DSH Text Injection Plugin

In the development of DeepSeek Harness (DSH), managing persistent system prompts or project background context can be cumbersome. Directly modifying them on the official configuration page often leads to configuration bloat, while maintaining them in code lacks flexibility. The @gw/dsh-text-inject plugin provides a solution: it adds a “Text Injection” section to the left sidebar of the DSH official settings page, injecting text into system prompts or session context. Content is stored in a separate file, supporting hot loading and history backup.

Core Features

  • Prompt Injection: ## [system] name blocks are appended to the system prompt, taking effect in every conversation turn.
  • Context Injection: ## [context] name blocks are composed as a user message and injected into the session. Deduplication is performed via the kind field, and gating is controlled via trigger keywords (e.g., trigger: project,requirement).
  • File Management: All content is stored in a separate file (default ~/.dsh/text-inject/inject.md), isolated from official configuration.
  • Hot Loading: Changes take effect immediately after saving the file, without requiring a DSH restart.
  • History Backup: Each save automatically backs up to the history/ directory, retaining the most recent 30 backups with one-click recovery support.

Installation and Activation

  1. Copy the plugin directory to the corresponding profile’s node_modules:
    cp -r dsh-text-inject ~/.dsh/profiles/web/node_modules/@gw/
  1. Add the loader entry in the profile’s cordis.patch.yml:
    - insert:
        - id: gw-text-inject
          name: '@gw/dsh-text-inject'
  1. Restart DSH, open the settings page, and the “Text Injection” section will appear in the left sidebar.

Configuration File Format

The plugin automatically creates a default inject.md file on first load. The file content supports Markdown format, with injection types distinguished by block headers:

## [system] My Persistent Rules
order: 40

This will be appended to the system prompt, taking effect in every turn.

## [context] Project Background
kind: gw-project
trigger: project,requirement

When "project" or "requirement" appears in a message, this is injected into the session as a user message.
  • Block Headers: ## [system] name or ## [context] name (case-insensitive).
  • Metadata: Placed immediately after the block header, using a colon. Supports order (sorting), kind (context deduplication), trigger (keyword triggering), enabled (enable/disable).
  • Body: Content following the metadata.

[context] blocks must have a kind (unique, used for deduplication); if trigger is left empty, it injects every turn. enabled: false can temporarily disable a block.

Notes

  • Privacy and Security: The plugin does not access the network, read credentials, or report any data. Read/write operations are limited to the specified data file only.
  • Performance Impact: Injected content enters every request, amplifying prompt size. It is recommended to use [context] blocks with trigger to avoid full persistent residency.
  • Dependency Requirements: Depends on DSH’s systemPrompt and webServer services.
  • Compatibility: Compatible with DSH versions >=0.1.2-rc.1.

Summary

By separating prompt and context management from code or official configuration and shifting to independent Markdown file management, combined with hot loading and backup features, @gw/dsh-text-inject provides DSH users with a more flexible configuration approach. It is suitable for scenarios requiring frequent adjustments to system instructions or management of project context.

Plugin Directory: https://www.skillhub.cn/plugins/1497105876/dsh-text-inject
Source Code: https://github.com/1497105876/dsh-text-inject

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

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

Xiaoye