tuofangzhe/dsh-plugin-image-gen0

@dopilot/dsh-plugin-image-gen

OpenAI-compatible image generation tool for DeepSeek Harness

包名
@dopilot/dsh-plugin-image-gen
版本
0.1.0
许可证
MIT
最近更新
2026年8月27日

安装

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:tuofangzhe/dsh-plugin-image-gen

Configuration

In the target profile's cordis.patch.yml, override the bundle row by id:

- id: dopilot-image-gen
  config:
    providers:
      openai:
        baseURL: https://api.openai.com/v1
        apiKeyEnv: OPENAI_IMAGE_API_KEY
        defaultModel: gpt-image-1
        models: [gpt-image-1]
        responseFormat: png
        timeoutMs: 120000
      gateway:
        baseURL: https://images.example.com/openai/v1
        apiKeyEnv: CUSTOM_IMAGE_API_KEY
        defaultModel: organization/image-model
        responseFormat: webp
        timeoutMs: 180000
    defaultProvider: openai
    maxImagesPerCall: 4
    outputDir: generated-images
    maxResponseBytes: 134217728
    maxImageBytes: 20971520
    maxTotalImageBytes: 83886080
    maxErrorChars: 500
    toolTimeoutGraceMs: 30000

apiKeyEnv is a credential reference name, not a secret value. It is resolved through the DSH credentials service for every call and is never cached. Omit it for a gateway that needs no Authorization header.

FieldMeaning and default
providersOptional route map. Missing or empty keeps the plugin dormant and registers no tool.
providers.*.baseURLAbsolute HTTP(S) URL without credentials, query, or fragment. Trailing slashes are removed.
providers.*.apiKeyEnvOptional credential reference using POSIX shell-identifier syntax.
providers.*.defaultModelRequired non-empty default image model.
providers.*.modelsOptional model allowlist; omitted or empty means unrestricted.
providers.*.responseFormatActual returned encoding: png (default), jpeg, or webp. The plugin does not transcode provider output.
providers.*.timeoutMsProvider request deadline; default 120000.
defaultProviderRequired with multiple providers; inferred with exactly one.
maxImagesPerCall110; default 4.
outputDirSafe normalized relative path; default generated-images.
maxResponseBytesStreaming HTTP body limit; default 128 MiB.
maxImageBytesPer decoded image limit; default 20 MiB.
maxTotalImageBytesPer-call decoded-image limit; default 80 MiB.
maxErrorCharsProvider/attachment error excerpt, 64–4000 Unicode code points; default 500.
toolTimeoutGraceMsCooperative tool deadline margin above the slowest provider; default 30000 ms.

Missing or empty providers is an intentional dormant state: DSH starts normally, the plugin logs how to configure the profile, and generate_image is not registered. Once providers is non-empty, invalid values fail during plugin loading. The combined slowest provider timeout and tool grace may not exceed 2_147_483_647 ms. Byte limits must satisfy maxImageBytes <= maxTotalImageBytes <= maxResponseBytes.