amainoyo / @oyang/dsh-poster-studio
自然语言驱动的浮动海报设计面板:任意会话里说句话即可改标题、换背景、调色、删层、导出 PNG;面板内也可可视化编辑(官网着色器背景、中英文字体、图层系统、配色库、版本历史)。作者:Oyang
About this plugin
Written by the registry from verified metadata, not from the README.
@oyang/dsh-poster-studio is a DSH plugin published from the amainoyo/Poster-Studio repository.
Capabilities and topics
Poster Studio(海报创作)
作者 Author: Oyang · License: MIT · Requires DSH ≥ 0.2.0
官方模板库 · Official templates
简体中文
DeepSeek Harness 桌面版插件:浮动海报设计面板(可拖动 / 缩放 / 关闭,不占用对话主列), 官网着色器背景 + 中英文字体,全部设计要素可视化编辑,也可在任意会话用自然语言直接驱动。
功能一览
- 画布:5 个预设尺寸(1080×1350 / 1080×1920 / 1920×1080 / 1080×1080 / 1200×628)+ 自定义 WxH(200–4000);「全部尺寸」网格模式带虚线适配预览;同一套文案可按尺寸独立微调位置与字号,各尺寸互不影响
- 图层:文字 / 图片 / 二维码 / 角标四类;锁定、拖拽对齐吸附(画布中线 / 三分线 / 其他图层边缘,容差 6px);旋转(−180°~180°)、水平 / 垂直翻转
- 文字:字号 8–2000,字重 100–900 全连续(中文自动挂思源黑体可变字体),6 款在线中文字体(fonts.loli.net,离线回退系统字体),描边 / 阴影(平方根响应曲线,低档灵敏);渐变填充(双色上下渐变)、彩色辉光、竖排文字
- 背景:着色器 5 色槽 + 调校参数;背景图上传(自动压缩 jpeg ≤2400px,cover 铺满 + 透明度);内置配色方案库 6 套 + 自定义保存
- 工作流:💾 命名版本快照(🕘 面板:缩略图列表、一键回滚、删除——本体与索引同清),可 📌 钉住版本 / 条目豁免滚动淘汰、重启仍保留;AI 文案 / 批量变体;导入 / 导出 JSON 模板(图片全部内嵌,跨机可用);记住上次所在标签页;双击画布文字直达该图层卡片
- 官方模板库:5 款一键套用再改——科技横幅 / 活动竖版 / 节庆红金 / 极简黑白 / 发布会横幅(整版替换配色、着色器与排版)
- 导出:面板「导出图片」支持 PNG / JPG / WebP(后两者可调质量),弹系统另存为;同时自动回流一份到宿主
exports/,供poster_export工具在会话里直接交付 - AI 工具:
poster_design(自然语言改设计)、poster_export(交付最近导出)、poster_preview(把当前画布渲染成图片交给视觉模型亲眼自检、迭代调稿)
自然语言用法(任意会话)
面板由宿主侧 poster_design / poster_export / poster_preview 三个工具驱动,描述含中英触发词,中文会话直接说即可:
- 「把海报换成青绿色调」→ poster_design 改 colors
- 「海报背景换成 D:\某图.jpg」(≤4MB)→ background.image 支持本地路径,宿主自动内嵌
- 「给海报加一个金色 2027 大字层」→ layers 参数增改任意图层(增量:未提及的层不受影响)
- 「不要副标题了」「把二维码删掉」→ remove: ["subtitle", "qr1"] 按图层 id 删除;删背景图用 background.image ""
- 「套用科技横幅模板」→ poster_design 设 size/colors/shader/layers(模板可整版替换)
- 「把海报导出来」→ poster_export 交付最近一次面板导出(PNG / JPG / WebP)
- 「把海报渲染出来看看」→ poster_preview 把当前画布渲染成 PNG 交给视觉模型,边看边改
安装
方式 A(免构建,推荐):从 Releases 下载 oyang-dsh-poster-studio-<version>.tgz 并解包,在 DSH 插件管理执行 install_bundle 指向解包目录,重启 DSH。
方式 B(源码):
git clone https://github.com/amainoyo/Poster-Studio
cd Poster-Studio
npm run build # 产物 client.js 不入库;改过模板/资源必须重建
然后在 DSH 插件管理执行 install_bundle 指向本目录,重启 DSH。
热更语义(开发时):Client 改动(改模板后重新 build)刷新 DSH 窗口即生效;Host 改动(index.js)需重启桌面应用——工具与路由在启动时注册。
运行时数据(~/.dsh/poster-studio/)
| 文件 | 内容 |
|---|---|
| spec.json | 当前设计(宿主内存为准,客户端 3s 轮询同步) |
| versions.json | 历史版本索引(名称 / 时间 / 128px 缩略图,≤50) |
| versions/{id}.json | 版本快照本体(回滚数据源;面板删除按钮会连索引一起清) |
| palettes.json | 自定义配色(≤24 套) |
| exports/ | 面板导出回流的 PNG(≤20 个,poster_export 工具取最新) |
目录结构
index.js Host:poster_design / poster_export 工具、/poster-studio/* 路由、spec/版本/配色持久化
src/client.template.js Client 完整源码(工作台 UI、三层画布着色器渲染器)
build.cjs 构建:内联字体 base64、二维码库、内置预设、vendored React UMD 对
assets/ 内联字体(DM Sans / Montserrat,SIL OFL,见 NOTICE)
presets/ 内置预设(路由不可达时的面板兜底;格式=导出模板格式)
scripts/ 测试脚本(host-api-smoke.mjs 冒烟 / patch-semantics.test.mjs 语义单测)
locale/ 插件界面词条(管理页摘要取 meta.description)
实现要点(改动前必读)
- 渲染为三层画布:WebGL2 着色器 → 背景图 2D 叠加层 → 文字 2D 层(同一画布不能同时取 WebGL 与 2D 上下文);预览 / 导出 PNG / 导出全部尺寸 / AI 变体 / 版本缩略图共用同一合成管线
- 自带 React 18 UMD 渲染对(宿主 React 版本漂移免疫);宿主挂载入口全部 hook-free class 壳 + 多槽位租约
- 路由必须经
ctx.inject(['connection','webServer'], …)延迟挂载(服务未就绪时一次性读取会静默跳过注册) - Electron 中
window.prompt/alert/confirm是 no-op,一律面板内自绘对话框 - 主题变量必须带暗色兜底:
var(--dsw-alias-label-primary, #e8e8ee)(部分 token 运行时缺失) - 工具返回给模型的输出一律有界:图片 dataURL 脱敏、render 摘要给全状态(信息不足模型就会自己去翻源码)
- 回归:
node scripts/host-api-smoke.mjs(临时 profile,ALL PASS)+node scripts/patch-semantics.test.mjs
English
A poster-design plugin for DeepSeek Harness desktop: a floating studio panel (draggable, resizable, never in the way) with the official-site animated shader backdrop and CN/EN typography — every design element is editable visually, or driven in plain language from any chat session.
Highlights
- Canvas: 5 presets (1080×1350 / 1080×1920 / 1920×1080 / 1080×1080 / 1200×628) plus custom W×H (200–4000); an all-sizes grid preview with dashed fit guides; per-size layout — tweak a layer's position/size for one canvas size without affecting the others
- Layers: text / image / QR code / badge; locking and drag-to-snap alignment (centre, thirds, other layers' edges); rotation (−180°~180°) and horizontal / vertical flip
- Typography: sizes 8–2000 px, continuous weight axis 100–900 (Chinese auto-binds the Source Han variable font), 6 online Chinese faces, outline & shadow with perceptual response curves, plus gradient fill (two-colour), coloured glow, and vertical text
- Backgrounds: 5-slot shader palette with full tuning, backdrop image upload (auto-compressed, cover-fit, opacity), 6 built-in palettes + save your own
- Workflow: named version snapshots with thumbnails and one-click rollback; 📌 pin a version to exempt it from rolling eviction (survives restarts); AI copywriting & batch variants; JSON template import/export (images embedded, portable); remembers the last active tab; double-click canvas text to focus its layer card
- Template pack: 5 one-click starter templates (tech banner / event vertical / red-gold festival / minimal mono / launch banner) that set colours, shader and layout in one go
- Export: system Save-As for PNG / JPG / WebP (the latter two with adjustable quality), plus an automatic copy returned to the host so the
poster_exportchat tool can deliver it - AI tools:
poster_design(edit the design in plain language),poster_export(deliver the latest export),poster_preview(render the live canvas to an image so a vision model can see it and iterate)
Natural-language control
Three host tools (poster_design, poster_export, poster_preview) are registered globally; their descriptions carry Chinese and English trigger words. Just say:
- "Retint the poster to teal tones" / 「把海报换成青绿色调」
- "Use D:\photo.jpg as the backdrop" (≤4 MB; local paths are inlined automatically)
- "Add a big golden 2027 headline" (incremental layer patch — other layers untouched)
- "Remove the subtitle and the QR code" (removal by layer id;
background.image: ""drops the backdrop) - "Apply the tech-banner template" / 「套用科技横幅模板」
- "Export the poster" / 「把海报导出来」
- "Render the poster so I can see it" / 「把海报渲染出来看看」(poster_preview hands the live canvas to a vision model to review and refine)
Install
Option A (no build, recommended): download oyang-dsh-poster-studio-<version>.tgz from Releases, extract it, then run install_bundle <extracted directory> in the DSH plugin manager and restart DSH.
Option B (from source):
git clone https://github.com/amainoyo/Poster-Studio
cd Poster-Studio
npm run build
Then install_bundle <this directory> in the plugin manager and restart DSH. During development, client-side changes only need a window refresh after npm run build; host-side changes (index.js) require an app restart because tools and routes register at boot.
Development checks
node scripts/host-api-smoke.mjs # HTTP routes against a throwaway profile — expect ALL PASS
node scripts/patch-semantics.test.mjs # layer-patch semantics unit tests
License
MIT (see LICENSE). Bundled third-party assets keep their own licenses as listed in NOTICE — notably the DM Sans and Montserrat fonts under the SIL Open Font License.
Badge
Listed here? Link back with this badge — paste the snippet into your repository README.
[](https://dsh-plugin.com/plugins/amainoyo/Poster-Studio)