dsh-plugin-wwrs-image
Verifieddsh-plugin-wwrs-image · v0.1.1 · MIT
Direct-API image generation DSH plugin (open source): GPT-image behind one image_generate facade, dual transport (apidot/openai-compatible). Sole runtime dependency is @deepseek-ai/dsh-tools (defineTool DSL).
Install
dsh plugin add dsh-plugin-wwrs-image Confirm the layer applied with dsh --profile default --dump-config — see the install guide.
Source
- github/ksxh0524/dsh-plugin-wwrs-image 0 0 archived
Tags
Readme
dsh-plugin-wwrs-image
直调图像生成 DSH 插件(开源):GPT-image 收敛到 image_generate 门面之后,双 transport(apidot / openai-compatible)。唯一运行时依赖是 @deepseek-ai/dsh-tools(defineTool DSL,见 ADR-007)。W1 已落地:三个工具由 src/cordis.ts 注册。
工具
| 工具 | 参数 | 语义 |
|---|---|---|
image_generate |
prompt、aspect?(缺省 1:1)、model?(缺省 gpt-image-2,只认 gpt-image-*)、outputPath、overwrite?(缺省 false) |
GPT-image 直连生成,无参考图输入;overwrite: false 且目标已存在即大声失败 |
image_resolve |
prompt、aspect?、model?、references?[{path, name?, url?}] |
仅校验(形态、参考图存在性、所选 transport、凭据是否就绪);不入队、不联网、不写文件 |
image_dimensions |
aspect?(缺省 1:1)、profile?(仅 standard) |
纯函数查表(比例/profile → 宽高) |
需要参考图?走 dsh-plugin-wwrs-comfyui(Z-image/Qwen-edit 属 Comfy 系,不归本包)。
合同
远端图像接口收敛到同一门面之后:双 transport(apidot / openai-compatible,由 GPT_IMAGE_TRANSPORT 选择)。凭据与 transport 只走 env——不进工具参数、不进日志。
配置
工作区(产物一律落其内):config.workspace > WWRS_WORKSPACE 环境变量 > 向上找 .wwrs/workspace.json > 大声失败。绝不静默写到项目之外。
| 键 | 含义 | 缺省 |
|---|---|---|
GPT_IMAGE_TRANSPORT |
apidot 或 openai-compatible |
嗅探 GPT_IMAGE_BASE_URL,再回落 openai-compatible |
GPT_IMAGE_API_KEY |
双 transport 通用 key(优先) | —(缺失即大声失败) |
APIDOT_API_KEY |
apidot key 回落 | — |
OPENAI_API_KEY |
openai-compatible key 回落 | — |
GPT_IMAGE_BASE_URL |
网关覆盖(OPENAI_BASE_URL 亦可) |
https://api.apidot.ai / https://api.openai.com/v1 |
GPT_IMAGE_QUALITY |
low / medium / high / auto |
low |
GPT_IMAGE_RESOLUTION |
1K / 2K / 4K(apidot 路) |
1K |
GPT_IMAGE_TIMEOUT_MS |
单请求/轮询截止 | 1200000(20 分钟) |
GPT_IMAGE_RETRIES |
429/5xx/网络退避重试(4xx 永不重试) | 2 |
缺失即大声失败并给出路;绝不静默降级。
安装
{
"dependencies": {
"dsh-plugin-wwrs-image": "link:/path/to/plugin-wwrs-image"
},
"dsh": { "profile": { "bundles": ["dsh-plugin-wwrs-image"] } }
}
验证
跑 pnpm check(prettier 检查 + tsc --noEmit + node --test tests/*.test.ts;真链路缺 key 即 skip)。
无浏览器半
纯服务端工具——pnpm check 即全部门,无 check:browser 链。
已知边界
- 无参考图输入——参考图引导生成归
dsh-plugin-wwrs-comfyui。 model只认gpt-image-*(缺省gpt-image-2);无静默 fallback 链。overwrite: false且目标已存在即大声失败(不静默覆盖,也不 skip)。
许可
MIT.