Repository navigation
feat(balance-dashboard): 新增侧边栏余额组件(社区插件) - #190
Open
AwenJackson wants to merge 1 commit into
Open
AwenJackson wants to merge 1 commit into
AwenJackson wants to merge 1 commit into
Conversation
Collaborator
|
✅ Internal validation passed. A ZCode maintainer will review the change next; after acceptance, release checks run separately and this PR is closed automatically. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
插件类型(必填)
ui.surfaces/_meta.ui.resourceUri),组件包括 command(/remove-sidebar-widget)、SessionStart hook、以及由主进程注入器驱动的前端脚本涉及插件:
balance-dashboard(普通插件,非 UI)改动解决的问题
ZCode Desktop 没有任何余额/用量视图:DeepSeek 余额、火山引擎(账户 + Coding Plan)额度、ZCode 套餐占用与本地 token 消耗分散在各家控制台。本插件在左侧边栏提供一个紧凑的余额组件,并附带多维度消耗分析。
用户可见行为与测试方式
python scripts/validate.py通过(OK: 55 plugin(s)),build_zip对本插件单独构建 zip 成功(17 个文件,完整性校验通过)。版本与市场注册
external_plugins/balance-dashboard/.zcode-plugin/plugin.json:version0.3.0;marketplace.json新增条目:name/version/描述与 manifest 一致,categoryutilities;依赖、网络请求、权限和副作用(全部披露)
~/.zcode/balance-dashboard/runtime/,检查resources/app.asar;app.asar:ZCode 插件系统没有左侧边栏挂载点,插件在out/main/index.js末尾追加一行本插件专属的动态import()。安全性措施:重打包前保存原始 offset;替换后对全部条目逐文件重算 SHA-256 + 4MB block hash 并与 header 比对,全部通过才替换;替换前自动备份app.asar.balance-dashboard.bak,替换后再次校验失败自动回滚;每条替换路径(session-start / finalize / post-patch)都先校验 stage;/remove-sidebar-widget命令或scripts/unpatch.mjs可完整还原,且保留其他插件(如 token 用量悬浮条)的注入行。此能力与已收录的zcode-token-usage-statusbar社区插件采用相同机制;~/.zcode/balance-dashboard/runtime/;api.deepseek.com;billing.volces.com/ark.cn-beijing.volces.com签名接口;zcode.z.ai、api.z.ai/bigmodel.cn;node执行插件自带脚本;options.json(明文,与 ZCode 自身plugin-secrets.json同级),仅本机读取,不写日志、不上传;README 与 PR 均已说明;第三方材料来源与许可证
LICENSE);node:sqlite、node:crypto等)与 ZCode 本体;自查清单
validate.py通过;build_zip对本插件单独构建通过(完整build_dist.py在本地浅克隆上因 excalidraw 缺少 pnpm 构建产物无法整体运行,与本 PR 无关)git diff --check通过