dsh-web
zhu1090093659/dsh-webDeepSeek Harness(DSH)Web 插件聚合生态包 · 一切皆插件,创意工坊分发(dsh-market.com)
Inline image card for DeepSeek Harness conversations: a bottom-left edit button that annotates, erases through a generated RGBA mask, and crops or resizes, then hands the edit back to the agent.
A DeepSeek Harness plugin that shows a generated image inside the conversation, with an 编辑 (Edit) button pinned to the image's bottom-left corner. The button opens an editor with annotate / erase / resize; pressing 生成 writes the result back to disk as real PNG files and returns it to the agent as a new message, so the next turn is an ordinary image-editing request.
It was written alongside a gpt-image-2-5-sunburst skill, but the hand-off is plain text plus file
paths, so any image generation workflow can consume it.
中文说明见 README.zh.md.
| Piece | Registration |
|---|---|
sunburst_image_card tool | Host: ctx.tools.register |
| Image card with the edit button | Client slot tool.call.toolview, key sunburst_image_card |
| Editor overlay | Client slot shell.overlay, id sunburst-image-editor |
GET /dsh-image-studio/image?path=… | Host route: streams the image bytes (no base64 through RPC) |
POST /dsh-image-studio/stage | Host route: writes the editor output, returns the hand-off message |
The agent calls the tool after a generation finishes:
sunburst_image_card(path="<the path the script printed>", prompt="<the prompt used>",
model="gpt-image-2.5-sunburst", size="3840x2160")
The card renders the file through the plugin's own same-origin route, so multi-megabyte 4K PNGs load like any other image on the page.
| Tool | The user does | Output |
|---|---|---|
| 标注 | Draws freehand strokes, rectangles or arrows, with a colour picker, brush width, undo and clear. | <stem>-edit-<stamp>-annotated.png — the original with the marks baked in. |
| 擦除 | Paints over whatever should disappear. | <stem>-edit-<stamp>-mask.png — an RGBA PNG at the original image's size whose transparent pixels are exactly the painted region (opaque black elsewhere). |
| 调整尺寸 | Drags a crop box with aspect presets (free, 1:1, 3:2, 2:3, 16:9, 9:16), four corner handles, and an editable output size. | <stem>-edit-<stamp>-crop.png plus a target WxH. |
The output size is validated against the PackyAPI image rules while the user types: width and height multiples of 16, longest side ≤ 3840, aspect ratio ≤ 3:1, total pixels between 655360 and 8294400.
Press 生成 and the plugin:
dsh plugin --profile web add github:wu81313-lab/dsh-image-studio
dsh plugin --profile <name> … proxies to pnpm inside that profile, and the CLI writes the package
into both dependencies and dsh.profile.bundles of the profile's package.json — that second
half is what makes DSH load it as a plugin bundle, and what makes it show up as installed in the
plugin market.
A bundle's layers are composed at boot, so restart DSH once after installing, and refresh the
browser page so the client bundle is picked up. The plugin's own cordis.patch.yml is what mounts the
entry:
- insert:
- id: sunburst-image-card
name: "dsh-image-studio"
To mount it without a restart, put that same insert in
$DSH_HOME/profiles/<profile>/cordis.patch.yml instead: the web profile reloads that file live
(patchReload: live), the Host half (the tool and the two routes) activates immediately, and a page
refresh loads the client bundle. Do not use both at once — dsh.profile.bundles and a patch-file
insert must not mount the same entry id twice.
react
from the page's module table (declared as an optional peer dependency).ctx.webServer.GET /dsh-image-studio/image serves local files, restricted to image extensions
(.png .jpg .jpeg .webp .gif .bmp .avif). The route answers on the same origin as the GUI.POST /dsh-image-studio/stage accepts a JSON body with data URLs and writes the decoded bytes with
fs.writeFileSync; the body cap is 128 MiB.fs is only used for statSync on the tool's path argument; nothing else is read.MIT — see LICENSE.