Repository navigation
feat(zcode-usage-panel): add live usage panel UI plugin - #93
Open
taohouchao-new wants to merge 1 commit into
Open
taohouchao-new wants to merge 1 commit into
taohouchao-new wants to merge 1 commit into
Conversation
Session-sidebar MCP App showing per-tool/MCP/Skill call stats, token shares, TPS sparkline and prompt composition in real time. Read-only access to ~/.zcode/cli/db/db.sqlite; no network, no writes. Bundled payload under payload/dist, built with esbuild; requires Node.js >= 24.
taohouchao-new
requested review from
jacksonliuyn and
panda920
as code owners
October 14, 2026 03:25
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.
Plugin type / 插件类型(必填)
Affected plugin name(s) / 涉及的插件名称:
zcode-usage-panel声明依据:清单声明
ui.surfaces会话侧栏面板(ui://zcode-usage-panel/index.html,availability: session),由插件自带 MCP server(stdio)提供资源与订阅。What / 改动内容
新增社区插件 zcode-usage-panel v0.2.1(
external_plugins/zcode-usage-panel/),并在根marketplace.json注册(category: developer-tools,componentTypes: ["ui"])。解决的用户问题:ZCode 会话中缺少实时用量可见性——用户看不到一次任务里 token 花在哪、哪些工具/MCP 被调用多少次、TPS 表现如何、系统提示词的构成规模。
用户可见行为:
resources/subscribe推送约 1s,无订阅能力回退 2s 轮询测试方式(本地已验证):
npm run typecheck(tsc 严格模式)通过npm run build产物输出payload/dist/(server.mjs 825KB + index.html 610KB,低于宿主 4MiB 上限)NODE_BIN=$(which node) npm run smoke:系统 Node v26 对发布产物跑完整 MCP JSON-RPC 链路(initialize → resources/list/read → subscribe → 确定性 DB 变更通知 → unsubscribe → 子会话统计),全部通过python3 scripts/validate.py:44 plugins OKbuild_dist.py本地未跑完——官方 blender 等 UI 插件的 dist 需要 CI 环境构建(pnpm build),与本次提交无关版本与注册:新插件首发 0.2.1,
plugin.json与marketplace.json的 name/version/description/description_i18n 逐字一致。依赖/权限/副作用:
command: "node"启动,要求 Node.js ≥ 24(内置node:sqlite);运行时零 npm 依赖(产物为自包含 bundle)~/.zcode/cli/db/db.sqlite(mode=ro),不写任何文件、无网络访问、无 Hook、无命令执行第三方材料与许可证:插件代码 MIT(LICENSE 随附);构建期依赖 esbuild/TypeScript/@modelcontextprotocol SDK(MIT/Apache-2.0),不进入安装产物;无第三方素材或服务。
Self-check / 自查清单
external_plugins/<name>/categoryis set independently of publisher ownershipversionbumped in BOTHplugin.jsonandmarketplace.json(new plugin, first release 0.2.1)README.md(EN) andREADME_CN.md(中文) both updated and equivalentdescription_i18nhas bothenandzh-CNpython3 scripts/validate.pypasses locally; plugin zip packaging verified viabuild_dist.pylogic (full run requires CI-built official plugin dists, see note above)