Tools & Capabilities

dsh-prompt-inject

h1a3x/dsh-prompt-inject · ★ 1

h1a3x

System prompt injection template manager for the DeepSeek Harness web UI.

License
MIT
Added
2026-08-23
Maintenance
active
Install kind
github
npm
dsh-prompt-inject

No manifest check is available; listing does not imply compatibility or security review.

安装

dsh plugin --profile web add github:h1a3x/dsh-prompt-inject

GitHub 源码安装:首次需按提示配置 allowBuilds 构建授权后重试

For install and environment setup, plus plugin development tutorials, see DSH community docs ↗

README

Source README · body: en · Read Chinese README

Table of contents
  1. Features
  2. Install
  3. From source
  4. Options
  5. Usage
  6. How it works
  7. Uninstall
  8. Development
  9. License
  10. Links

简体中文 | English

A system-prompt template injection manager for the DeepSeek Harness web GUI.

npm license

Maintain named prompt templates under Settings → Plugins → Prompt Template Injection, and inject the selected template into the system prompt of every session. One global default plus an independent template per workspace — selection is all it takes (no separate on/off switch), and a change applies to the very next message.

Features

  • 🗂️ Named templates: add, edit, delete, and preview any number of prompt templates
  • 🌐 Global + per-workspace: one global default; each workspace can independently choose Inherit global / No injection / a specific template
  • ⚡ Instant effect: the template variable is resolved at every assembly, so a mid-session switch applies to the next message and new sessions pick it up automatically
  • 🧩 System-prompt injection: order 50 (after the deployment persona, before tool guidance)
  • 🌍 Bilingual UI: card copy follows the Harness UI locale (zh / en)
  • 🎨 Theme-aware: UI uses Harness theme CSS variables (light / dark)

Install

npx dsh-prompt-inject install

The installer is idempotent and performs two steps:

  1. Installs the package to $DSH_HOME/profiles/node_modules/dsh-prompt-inject (the dsh plugin resolution root)
  2. Writes the composition row into $DSH_HOME/profiles/<profile>/cordis.patch.yml

Then restart dsh and refresh the browser. The restart is the only manual step — the host module and composition are cached in-process.

From source

git clone https://github.com/H1a3x/dsh-prompt-inject.git
cd dsh-prompt-inject
node scripts/install.js --from . --force

Options

Option Meaning
--profile <name> Target profile (default web)
--force Overwrite an already-installed package
--from <path> Install from a specific directory (defaults to the package root)

Usage

After installing and restarting, open Settings → Plugins → Prompt Template Injection:

  1. Click Add template and enter a name and prompt text
  2. Pick a Global active template (used by any workspace without an override)
  3. In Per-workspace overrides, assign a workspace its own template, or choose No injection
  4. Each template row has a Preview button to inspect its text

Selection is all it takes — there is no separate switch. A change applies to the next message, and new sessions inherit it automatically.

Workspace matching keys on the host-side realpath-canonical path, which is the same source as an agent session's cwd, so they correspond one-to-one.

How it works

lib/index.js       host half: settings namespace + systemPrompt variable/section + /prompt-inject routes
lib/client.js      browser half: settings card (shell module-table format, no build step)
scripts/install.js one-shot installer

Injection uses systemPrompt.variable() + systemPrompt.section(): the section text is fixed at {{dsh_prompt_inject_text}}, and the variable provider reads the current settings plus the agent's workspace at every assembly, returning the template text that workspace should receive.

Plugin loading contract:

  • package.json declares dsh.client.platform = "web" and inject dependencies; the host scanner builds a window.__DSH_BOOT__ graph row and serves /plugins/<id>/client.js
  • The browser half is bundled in the shell module-table format; its factory returns { apply, inject }
  • The UI registers through ctx.slots.inject('settings.plugin.item', …)
  • Hot-reload boundary: lib/client.js changes take effect on page refresh; dsh.client declaration changes need a dsh restart

Uninstall

Delete $DSH_HOME/profiles/node_modules/dsh-prompt-inject and remove the following lines from cordis.patch.yml, then restart dsh:

- insert:
    - id: prompt-inject
      name: dsh-prompt-inject

You can also keep the row and disable the plugin from the Harness settings plugin inventory.

Development

npm run check           # syntax check
npm run install:local   # local install verification

License

MIT © H1a3x