Herbert-wang820/dsh-image ↗★ 0
dsh-auto-visual
Plans original images for documents, sites and slides, generates them with a mock or OpenAI-compatible provider, and records each asset's declared usage 适合需要在 DSH 中自动规划并生成插图资产的文档或幻灯片创作者。
インストール
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:Herbert-wang820/dsh-imageドキュメント
README 全文を読む ↗配置页实现要点
设置页用 DSH 客户端插件的 settings.section 槽位注册:
ctx.slots.inject("settings.section", …)→ctx.slots.register({name:"settings.section", id:"auto-visual", order, label, locale, inject}, 组件)inject工厂把configForms.get("auto-visual")结果交给组件,组件经该作用域读写配置,subscribe跟随变更。- Host 半的
Config字段必须带.volatile(),否则 Host 拒绝从设置页写入。 - 入口 id 必须与
cordis.patch.yml里插入的行 id(auto-visual)一致。 - Remote 命名空间必须在挂载后声明依赖。 连接检查服务由本插件自己通过
ctx.remote.$mount()挂载,其 Service 落在兄弟 fiber 上;Cordis 只把ctx.remote.提供给显式声明该名字的插件(否则报cannot get property "remote.autoVisualConnection" without inject)。因此注册顺序固定为: 先await ctx.remote.$mount(...),再ctx.inject(["remote.autoVisualConnection", …], registerSection), 并在该子上下文中读取服务;卸载时先释放 UI fiber,再释放 Remote。 命名空间必须先挂载再声明,写进静态inject会让插件等待自己而永久停等。
连接检查结果区分两类失败:CHECK_UNAVAILABLE 表示 Host 半没加载(服务未挂载),
CHECK_FAILED 表示 RPC 真实失败,并附带网关错误码。
node test/client-harness.mjs 在 Node 里模拟模块加载器 + 最小 hooks 运行时,校验注册、绑定、
渲染、保存、密钥徽标与连接检查分支(无需浏览器)。test/client-remote.test.ts 额外用真实的
浏览器 Typert registry + @deepseek-ai/dsh-api-gateway 客户端 bundle 与真实 Cordis fiber 复现
命名空间可见性,test/gateway.test.ts 在 Host 侧用真实 Gateway 调用同一方法。