dsh-auto-visual: DSH Plugin Image Asset Orchestration Tool

Here is the English translation of the technical article:

Below is an introduction to the DeepSeek Harness (DSH) plugin herbert-wang820/dsh-image (also known as dsh-auto-visual). It addresses the image illustration needs of DSH Agents when processing documents, web pages, or presentations. It translates “what images are needed” into a structured plan, delegates generation to a replaceable provider, and then registers where each image is used.

Core Features

The plugin decomposes the image generation task into three independent steps, each with distinct responsibilities:

  1. visual_plan: Analyzes the task and provides a structured list of material requirements (purpose, subject, style, ratio, etc.), returning confirmed prompts and asset IDs.
  2. visual_generate: Calls the configured provider to generate images based on the plan ID and asset ID. Already generated results are reused directly without duplicate calls.
  3. visual_finalize: After the main Agent completes the document or webpage creation, it registers the actual placement location and workspace-relative path for each image.

Installation

Install the plugin via the DSH command line. After installation, restart the Host and refresh the page.

dsh plugin --profile <profile> add github:Herbert-wang820/dsh-image

Configuration

The plugin provides a set of configuration options to control the generation mode, provider, and resource limits. The default factory configuration is safe mode, which produces no calls or costs.

Field Value Meaning
mode off / suggest / auto Disabled / Planning only / Allow generation
provider disabled / mock / openai Disabled / Local test image / OpenAI-compatible API
model Model ID e.g., gpt-image-2; mock only accepts mock-v1
baseURL API Root URL Default https://api.openai.com/v1
apiKey API Key Not echoed after saving; leaving blank does not overwrite existing key
maxAssets 1–100 Asset limit per session, default 3

Default configuration example:

mode: suggest
provider: disabled
model: mock-v1
baseURL: https://api.openai.com/v1
apiKey: ''
maxAssets: 3

Usage Flow:
1. First, set mode to auto and provider to mock to verify the full workflow in a network-free environment.
2. After verification passes, switch provider to openai and fill in the Model ID, Base URL, and API Key.

Usage Examples

In the Agent workflow, tools are typically called in the following order:

  1. Call visual_plan passing the task description and asset list.
  2. Call visual_generate passing the planId and assetId to generate images.
  3. After the main Agent completes document editing, call visual_finalize to fill in the image path and position.

Tool input example:

{
  "task": "Website Homepage Illustration",
  "assets": [{
    "purpose": "website hero illustration",
    "subject": "abstract collaborative research workspace",
    "style": "navy and teal, minimal flat illustration",
    "placement": "right side hero; leave left side clear for text",
    "ratio": "1:1",
    "required": true
  }]
}

Security and Permissions

The plugin has specific requirements for security and permissions:

  • Key Security: API Keys are saved as Host-side role('secret') configuration fields. They are not echoed after writing, not sent back to the browser in configuration descriptions, and do not enter conversations, prompts, or logs.
  • File Permissions: The tool requires write permissions; even read queries acquire a workspace lock.
  • Sandbox Requirements: The sandbox policy must return full enforcement; otherwise, the plugin will refuse to run.
  • Storage Limits: Only supports filesystems mapped to the Host’s local/same-world environment; remote execution worlds are not supported.

Known Limitations

  • Interruption Recovery: Interrupted requests are not automatically retried; state recovery is uncertain.
  • Image Formats: The OpenAI-compatible adapter only supports synchronous return of Base64 PNG with a fixed 1:1 aspect ratio.
  • Mock Limitations: Mock images will not be delivered as real images requested by the user.
  • Validation Scope: PNG validation only covers a specific subset (non-interlaced, 8-bit, max edge 4096, etc.) and does not cover all valid PNGs.
  • Feature Boundaries: Does not provide visual quality judgment, does not rewrite the editor, and does not guarantee that the main Agent will proactively trigger illustration.

License

MIT

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

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

Xiaoye