dsh-draw
Unified static-image generation routing for DeepSeek Harness.
One tool, many engines — health-aware fallback, durable results, counted usage.
最近一次核验:DeepSeek Harness dsh-v0.2.3-alpha.1(2026-11-22)。
简体中文 · Español · Português · हिन्दी
🧊 FROZEN since 2026-10-05 — only real breakages are fixed. The ecosystem has converged on a more widely adopted implementation, recorded below.
dsh plugin --profile <name> add dsh-draw
Community plugin, not affiliated with DeepSeek. Canonical repository: https://github.com/PerryLink/dsh-draw (Gitee is a mirror).
Install & uninstall
- git channel (latest
main): dsh plugin --profile web add github:PerryLink/dsh-draw — the prepare script builds with production dependencies only.
- npm channel (published releases):
dsh plugin --profile web add dsh-draw.
- tarball channel:
pnpm pack in this repo, then dsh plugin --profile web add ./dsh-draw-<version>.tgz.
- uninstall:
dsh plugin --profile web remove dsh-draw (or remove the row from the profile patch).
If pnpm reports ERR_PNPM_IGNORED_BUILDS for this package (esbuild's harmless platform-binary validation), add allowBuilds: { esbuild: true } to your pnpm-workspace.yaml — the dsh CLI prints the exact snippet.
⭐ 如果它帮到了你
这个插件是 DSH 插件家族的一员(99 个,全部 Apache-2.0)。如果你在用,给个 star —— 它不会解锁任何功能,但会让下一个人在搜索里更容易找到它。
English: part of a 99 plugin family for DeepSeek Harness. If it is useful, a star helps the next person find it — nothing is gated behind it.
What is dsh-draw?
Unified static-image generation routing for DeepSeek Harness.
One tool, many engines — health-aware fallback, durable results, counted usage.
Structure: the tool and the card's regenerate converge on one drawer — validate → checkQuotaGenerations (before engine spend) → the engine chain with cooldown health → checkQuotaBytes (before storage) → durable attachment refs plus a gated draw/generated event. The dashed return is regenerate re-entering the same path, so it cannot skip quota, routing, storage or audit. The examples below use the real command surface.
Maintenance status: 🧊 FROZEN
Frozen on 2026-10-05. No new features. This package still works, and it is not retired — but it no longer receives feature work. Only a genuine breakage will be fixed.
Maintainers treat this capability as one where the ecosystem has converged on a more widely adopted implementation, so effort has moved elsewhere. The comparison below was measured on 2026-10-05 and is recorded so nobody has to redo it.
|
package |
weekly downloads |
| this package |
dsh-draw |
973 |
| more widely adopted implementation |
dsh-image-gen |
7,216 |
| another alternative |
@goodandready/dsh-image-gen |
4,822 |
Why it is the mainstream choice. dsh-image-gen provides Gemini, OpenAI, Seedream, DashScope and a local ComfyUI in one plugin.
Compatibility. declares no dsh peers, so the compatibility guard never blocks it.
👉 For new work, dsh-image-gen is the mainstream choice. Existing installs keep working unchanged; nothing is being removed.
Full evidence, including the host-version compatibility matrix: dsh-plugin-supersession-review-20261005.md.
Comparison

measured 2026-10-05 · from the README's FROZEN maintenance table (npm weekly downloads)
Compatibility
| Surface |
Status |
| Harness |
DeepSeek Harness dsh-v0.2.2-rc.4 (compat declared for 0.1.5-rc.2) |
| Node |
^22.19.0 || >=24.0.0 |
| Engines |
Any OpenAI-compatible images endpoint; presets for OpenAI Images (gpt-image-1) and Zhipu CogView (cogview-3-flash) |
| Surfaces |
Host image_generate tool + web result card + Plugins settings tab |
The browser half rides the cordis Context and the published client packages (dsh-client-ui-slots, dsh-client-ui-settings, dsh-client-ui-tool, dsh-client-locale, dsh-client-connection); it no longer depends on the removed dsh-client-runtime package (the tool-call block is read through a local structural contract), so the client surface also lines up with 0.1.2-rc.1 hosts.
0.1.2-rc.1 (adapted 2026-09-02): the session envelope keeps its ignorable field for stored-log read compatibility only - Session.append still cannot stamp it, so audit-gate behavior is unchanged. Verified 2026-09-06 against the dsh-v0.1.7-alpha.1 master checkout (full gate chain + profile install smoke).
0.1.6-alpha.2 (adapted 2026-09-18): Session.append's third parameter exists only for surface-eligible event types and is a SurfaceIntent, never an ignorable envelope, so draw/generated (a non-surface type) is still not written on this line — quota is counted in memory per session and resets when the session restarts, exactly as the "Quota durability" note below describes. Verified 2026-09-18 (dual typecheck rulers + the full suite + self-contained/artifacts/readme gates).
0.1.7-rc.2 (adapted 2026-10-04): the client tool.call.toolview contract split its owner into three stages (preparing / start / result), and a keyed card is now dispatched while the arguments are still streaming. The result card therefore also renders the in-flight row for those earlier stages — an occupied keyed slot never reaches the host's own generic row, so answering a prepared stage with nothing blanked the line for the whole streaming window. Nothing else changed: the settled card, the accounting line, and regenerate behave exactly as before. Verified 2026-09-23 (dual typecheck rulers + the full suite + the new host-contract gate).
What you get
dsh-draw gives the harness one unified image_generate tool with standard parameters (prompt/size/count/quality/style/engine) that are translated per engine:
- Multi-engine routing — a config-driven chain (OpenAI Images, Zhipu CogView, or any OpenAI-compatible endpoint) walked top-down with health-aware fallback: consecutive failures push an engine into cooldown, and the next healthy engine serves the call.
- Durable results — generated images are saved as workspace attachments (content-addressed, under the harness's attachment policy) and returned as canonical file references.
- Quota accounting — per-session caps on generation calls and image bytes, folded from the durable session log and enforced before engine spend and before storage.
- Credentials as references — engine API keys are environment-variable names resolved per call through the official
ctx.credentials seam; literal keys are never stored in configuration and never logged.
- Web surfaces — an in-conversation result card (images, engine, quota, one-click regenerate) and a Plugins settings tab (engine chain, credential status, probes, quota limits).
model harness
│ image_generate {prompt, ...} ──▶ validate ──▶ quota check ──▶ router
│ openai ──(fail)──▶ cogview ──▶ images
│ ◀── canonical JSON + image blocks (durable attachment refs)
│ └── draw/generated session event (quota + audit)
Quick start

Animated replay of a real run recorded in this repository.
dsh plugin --profile web add github:PerryLink/dsh-draw
# 1. install the bundle into your profile
dsh plugin --profile web add github:PerryLink/dsh-draw
# or from npm (published releases)
dsh plugin --profile web add dsh-draw
# 2. provide the engine keys as credential references (environment variables)
# OPENAI_API_KEY and/or ZHIPU_API_KEY — never in the profile patch
# 3. restart and verify the row
dsh --profile web --dump-config | grep -A2 'id: dsh-draw'
Then ask the agent to draw:
> Draw a 1536x1024 landscape of a lighthouse at dusk, vivid style.
Examples
These are the plugin's real entry points; install once, then call one.
Detailed example
Command
image_generate
Input
{
"prompt": "a cat"
}
Output
{
"ok": true,
"engine": "openai",
"images": [
{ "attachmentId": "att-1" }
]
}
Observed from plugins/dsh-draw/tests/index.spec.ts:50-66; same fields asserted at plugins/dsh-draw/tests/drawer.spec.ts:59-69
Failure branch
Input
{"prompt":" "}
Output
Error: image_generate: prompt must be a non-empty string
Observed from plugins/dsh-draw/src/drawer.ts:141-147; plugins/dsh-draw/src/tool.ts:137-140; plugins/dsh-draw/tests/drawer.spec.ts:77-82
Brief examples
Configuration
All tunables are Schemastery Config fields (changeable from cordis.yml). An id-targeted override replaces the whole row — restate every key you need. cordis.patch.yml documents each key inline.
| Key |
Default |
Meaning |
engines |
OpenAI + CogView presets |
Ordered engine chain, walked top-down with fallback; each entry: id, baseUrl (no credentials), model, apiKeyRef (env-var name), provider (openai/replicate/fal, default openai), enabled, sizeMap, qualitySupported, styleSupported, responseFormat (b64_json/url), imageMediaType |
defaultEngine |
openai |
Engine id the router prefers; must name a configured engine |
requestTimeoutMs |
120000 |
Per-generation HTTP timeout (1000..600000) |
maxImagesPerCall |
4 |
Cap on images one call may produce (1..10) |
maxPromptLength |
4000 |
Prompt length cap in characters (1..32000) |
maxGenerationsPerSession |
200 |
Per-session generation-call cap (1..100000) |
maxBytesPerSession |
209715200 |
Per-session image-byte cap (1048576..4294967296) |
failureThreshold |
2 |
Consecutive failures before an engine enters cooldown (1..10) |
cooldownMs |
60000 |
Engine cooldown after the threshold trips (1000..3600000) |
Example override in your profile patch:
- insert:
- id: dsh-draw
name: dsh-draw
config:
defaultEngine: cogview
maxImagesPerCall: 2
Tools & surfaces
| Surface |
Notes |
image_generate |
Standard parameters; returns canonical JSON (engine/model/size, image references, quota, fallback flag, attempts) plus image content blocks |
Result card (tool.call.toolview, key image_generate) |
In every stage of the call: an in-flight row while the arguments stream, then images, engine/quota line, and one-click regenerate once it settles (full drawer path: quota + routing + audit) |