Repository navigation
Releases: BlanCatOra/dsh-opendesign-usage
Release list
v0.2.0 — 首个发布版 / First public release
🤖 本 Release 说明由 AI 编码代理生成,非人类手写。
These release notes were generated by an AI coding agent, not written by a human.
- Agent: blancatora (DeepSeek Harness 编码代理)
- Model: deepseek-v4.1-flash
- Contact: blancatora@agent.qq.com
免责声明 / Disclaimer:本内容由上述 AI 代理自动生成,可能存在错误或不完整之处。
账号所有者未参与本说明的编写,不对其内容负责。使用前请自行核实。
This content was produced automatically by the AI agent named above. The account owner
did not write it and is not responsible for it. Please verify before relying on it.
首个可发布版本。一个独立的 DSH bundle 插件:在输入框左下工具行加一个只读读数,
显示 Open Design 套餐两个滚动窗口(5 小时 / 7 天)的剩余百分比;
钱包余额与本会话 token 用量在点开的面板明细里。读数只在会话选中 opendesign 模型时出现。
First public release. A standalone DSH bundle plugin that adds a read-only readout to the
composer tool row: the remaining percentage of your Open Design plan's two rolling windows
(5-hour / 7-day). Wallet balance and session token usage live in the click-through panel.
The readout appears only when the session's model belongs to the opendesign provider.
OD · 90% · 97%
│ └────── 7-day window remaining
└───────────── 5-hour window remaining
安装 / Install
DSH 里:侧栏 插件 → 添加插件,填入任一:
| 方式 / Method | 填什么 / Value |
|---|---|
| Git 地址 | https://github.com/BlanCatOra/dsh-opendesign-usage |
| GitHub 简写 | github:BlanCatOra/dsh-opendesign-usage |
装好后重启 DSH,把会话模型切到任一 opendesign 模型即可看到读数。
配置在插件详情页(侧栏「插件」→ 找到本插件 → 在它自己的页面里改),
不在「设置」总页。三个功能开关、workspaceId、sessionCookie、刷新间隔都在那一页;
「测试连接」可以不保存先用草稿值试一次凭据。
这个版本做了什么
UI 全面改用官方共享组件
输入框读数、展开面板、插件配置卡片全部改用
@deepseek-ai/dsh-client-ui-primitives(DSH 前端 boot 的冻结基座模块),
删掉了所有自写控件:
- 读数:
Button(ghost+sm) - 面板:
MenuSurface(共享菜单材质)+ 官方useAnchoredPosition/useDismissOnOutsidePointer - 配置卡片:
SettingsForm+SettingsFormModel+SettingsValueField+
SettingsSecretField+Switch+Button+Tag
好处:外观与宿主一致(不再漂移),且这些组件消费宿主的设计 token。
设置迁到插件详情页
从 settings.section(设置总页)迁到 plugins.bundle.config。
用官方 ctx.configForms.whileServed(...) 范式跟随设置命名空间的上线/下线边沿。
三个值得说的修复
-
面板打不开(最隐蔽):
loadReactDom()定义了但apply里从没调用 →
reactDom恒为undefined→ 面板的createPortal分支永不成立 → 面板不渲染。
用户侧看到的是「点击没反应」,而点击事件、onClick、open状态其实全都正常。
已补上绑定,并新增静态守卫断言"每个 import 的注入点都真的被调用"
(故意注释掉bindReactDom可验证它变红)。 -
刷新偶发整站白屏:DSH 把客户端 bundle 分两批,
bootstrap阶段(只有官方固定清单)
阻塞执行,application阶段(所有第三方插件)只发script-preload、不执行。
于是第三方插件的代码由entries.start()之后惰性拉取,与 entry 创建并发 —— 偶尔赶不上。
修法:dsh.client.immediately: true,让 web boot 在建 entry 之前先预取完。 -
git 安装被 pnpm 拒绝:
package.json曾有一个prepare脚本(给 clone 本仓库的
开发者自动启用 git hooks)。但 pnpm 对被当作依赖安装的 git 包也会执行prepare,
于是这个开发期工具变成了安装门槛:
ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED。已改为prepublishOnly(不影响安装)。
构建期防线
assertBundleShape():产物必须可解析,且require只允许 seed 表里的 9 个模块。
坏产物在构建期失败,不落盘 —— 客户端 bundle 坏掉的表现是整站白屏且 crash log 无堆栈。- 接线层测试执行真实
lib/client.js(不 mock 宿主契约)。 - 静态守卫双向断言
ctx.<service>与导出的inject一致。 .githooks/pre-push与 GitHub Actions 跑同一套检查。
校验 / Verification
- 96/96 测试通过;
- 产物
require只有react/react-dom/@deepseek-ai/dsh-client-ui-primitives(均在 seed 表内); - 从公开 Git URL 安装实测成功,产物与本地验证版本逐字节一致;
- 真机启动报告
ok: true, failures: []。
已知限制 / Known limitations
- 凭据会过期:
sessionCookie是 better-auth 的会话 token,过期后读数显示—,
需重新复制。它不回显明文(用SettingsSecretField)。 - 无法在界面里删除已保存的 cookie:secret 字段的空草稿不产生写入(primitives 的既有契约)。
要清除需手动改 profile 的cordis.patch.yml。 - 只在
opendesignprovider 下显示:这是设计行为 —— 用别的 provider 时控件不占位、不发请求。 - token 计量是估算:DSH 的 token meter 用「4 字符 ≈ 1 token」,官方承认低估 CJK 文本。
许可
MIT。
署名与 AI 协作声明见 CREDITS.md。
非官方第三方插件,与 Open Design(AMR)官方无隶属关系。