Repository navigation
Conversation
State up front what this build adds (five plugin OAuth entries + plugin quota cards), that upstream is followed automatically under the same tag, and that the UI part is an interim drop-in for the unmerged upstream PR router-for-me#337.
…mport/export The bundled cpa-multi-plugins providers (workbuddy / trae / qoder / zcode / mimo) keep their own quota numbers. The core cannot be asked for them: no credential carries supports_quota/quota_provider, all five plugins report supports_quota: false, and POST /v0/management/quota/fetch answers 501 "no quota provider available for credential". - management_endpoint(): pass v0/ paths through. Plugin panel routes and the plugin quota API only exist on the v0 mux, so the client could not reach them while the prefix was hardcoded to /v8/management. - quotaService: a `plugin` quota provider resolved through POST /v0/management/plugins/<id>/refresh. The payload is shared by the bundled providers; each credential is matched back to its own account so a card shows that account's packages rather than the pool total, with the pool total kept as a trailing row. - QuotaPage: a Plugins group for those rows. - OAuth page: WorkBuddy / Trae / Qoder / ZCode / MiMo entry cards, plus the credential icon map so unknown providers stop falling back to the Gemini icon. - Credentials: per-card export (save dialog), and the import handler now accepts third-party exports - a JSON array of flat snake_case accounts is split and reshaped into one nested credential per account. Single CPA-format files take the previous path unchanged. - i18n: quota.plugin.* and authFiles.export* in zh-CN / en / ja. Additive: the six existing quota providers are untouched.
98f752a to
efc113f
Compare
|
Updated the branch (same PR, force-pushed) with three changes: 1. Per-account quota (bug fix for my own first version). Measured with 7 WorkBuddy CN accounts: pool 2. Credential export. 3. Import compatibility.
|
What this adds
OAuth entry cards and quota cards for the plugin providers bundled by
cpa-multi-plugins —
workbuddy/trae/qoder/zcode/mimo.providers stop falling back to the Gemini icon.
Pluginsgroup rendering package quota and sign-in credits.management_endpoint(): paths that already start withv0/are passedthrough. Plugin panel routes and the plugin quota API only exist on the v0 mux,
while the prefix was hardcoded to
/v8/management— the client could not reachthem at all.
Why this does not use the core plugin-quota API (re: #331)
#331 is the right shape long-term, but on the shipped build it cannot render
anything. Measured on GUI v0.3.12 / core v8.0.6 (==
main@ 90364e9) withcpa-multi-plugins v0.12.110:
GET /v8/management/credentialsquota: {"signals": {}}only — nosupports_quota/quota_providerGET /v8/management/plugins"supports_quota": falsePOST /v8/management/credentials/quota/fetch(the call #331 adds)POST /v0/management/credentials/quota/fetchPOST /v0/management/quota/fetch{"error":"no quota provider available for credential"}POST /v0/management/quota/reset{"error":"no quota provider available for credential to reset"}Three consequences:
providerForFile()in feat(quota): show quota for plugin providers such as WorkBuddy #331 keys offsupports_quota/quota_provider,which no shipped credential sets, so its plugin branch is never taken.
/quota/fetch, and onlyon the v0 mux.
capability does not. What is missing is on the plugin side — the plugins
never implemented the core's quota provider interface, and their numbers are
reachable only through their own panel API.
So #331 would produce an error row for these credentials rather than quota. It is
worth revisiting once the plugins declare the capability; this PR is the interim
path until then.
What it does instead
POST /v0/management/plugins/<id>/refresh, whose payload is already identicalacross the bundled providers:
summary.total_remain/summary.total_size/summary.pack_count→ packagequota row
summary.<region>_sizepairs → per-region rows, only when more than one regionholds quota
accounts[].checkin→ sign-in credit rowVerified live against core 8.0.6 + cpa-multi-plugins v0.12.110 (WorkBuddy CN:
29 package, 4949 / 5050 remaining, 300 check-in credits).
Compatibility and risk
claude/codex/kimi/xai/antigravity/devinareuntouched;
pluginis one more member of theQuotaProviderunion.those fields the rows stop rendering; the plugin panel
(
/v0/resource/plugins/<id>/panel) stays authoritative.trae/qoder/zcode/mimocurrently expose no account, or no panel atall (
mimohas none), so they simply produce no rows.workbuddy.pngandzcode.pngalready exist in this repository;the
trae/qoder/mimo/pluginSVGs are placeholder glyphs, notofficial marks — happy to drop or replace them.
Testing
tsc --noEmitandvite buildare clean on this branch, and the quota rows wereverified against a live core.
If you would rather not carry plugin-specific code in this repository, the
alternative is a core-side capability plus the plugin-side implementation, and
this PR can be closed in favour of #331 once that lands.
简体中文
本 PR 为 cpa-multi-plugins 打包的五个插件补齐 OAuth 入口卡片与额度卡片。
关于 #331 的问题:它在 GUI v0.3.12 / core v8.0.6 上渲染不出任何额度,原因有三——
① 凭据上没有
supports_quota/quota_provider,只有quota: {"signals": {}};② 五个插件全部
supports_quota: false;③ 它调用的
POST /credentials/quota/fetch实测 404(v8 与 v0 均无此路径),真实路由是
/v0/management/quota/fetch,且返回 501no quota provider available for credential(/quota/reset同样 501)。也就是说内核路由在、插件能力不在——缺的是插件侧实现,因此合入后只会显示错误行,
而不是额度。
本 PR 改为读取插件自己的面板接口
POST /v0/management/plugins/<id>/refresh,其 payload 在几个插件之间已经同构(
summary总分与分区 +accounts[].checkin签到积分),因此不需要为每个插件单独写解析器。
顺带修掉一个既有缺陷:未知 provider 的凭据图标会回落成 Gemini 图标。
对现有六个 provider 无影响;插件面板接口非文档化契约,插件升级改字段时需要跟着调整,
插件面板本身仍是权威视图。