* trae: one package, two realms — Trae Global folds into packages/trae The review asked for this and it is the right shape: the two deployments share one implementation. 86 of the 89 top-level names were already the same code; what differed was a table's worth of values (hosts, client, versions, usage page, fallback models, error codes) and two realm-only branches. A separate copy meant every request, stream and tool-call fix had to be made twice, and it had already drifted (the 0.1.15 Max fix came back as a bug there). packages/trae now holds a SITES table with two entries — trae-cn and trae-global — and makePlugin(site) builds a provider from one. Exported as TraeCNAuthPlugin and TraeGlobalAuthPlugin. The CN values are moved verbatim, not re-derived: same hosts, client id, app id, IDE/client versions, plugin version, brand, functions, fallback models, credits page, and its own check-in pages. The international entry carries what only it has: the second (US) deployment and the region that selects it, the dollar billing's entitlements page, its own model names, and its extra lapse/quota codes (20101, 4011). The CN plugin needs the stream fix too (the review's point), so the AbortController the loader now builds per request, openai()'s abort, and sse()'s finally are in this one implementation for both realms — as is the wrong-function retry releasing the read it leaves behind. fake.mjs takes a realm id, defaulting to CN so every test written before the fold is unchanged. The global tests move to global.test.mjs, plus new ones for what only the international realm does: the US/SG routing of a request and of a saved sign-in, its own error codes and error name, the dollar usage page, and its fallback model list. chatModel gains the picker's invisible-entry filter (paygo/auto twins, search agents) and the config hook names the realm's own provider. The acceptance test: packages/trae/*.test.mjs' 48 CN tests are untouched and green — that is the proof the refactor changed no CN behaviour, with its constants verified line by line against HEAD. bun test: 63 pass (48 CN + 15 global); bun scripts/check.mjs trae: ok. registry.json: one entry, providers [trae-cn, trae-global]. README: both realms, each realm's endpoints, usage page and codes; the verification range stated honestly (CN never run live; Global on one Free SG account, no Pro and no US account). * trae: Trae CN's model lists stay whole; only Global hides is_invisible_to_user The fold filtered is_invisible_to_user for both realms, which took 40 of Trae CN's 76 models out of its list. CN is served as before; Global (a site flag, hidesInvisible) keeps the filter. Also: the unsupported-request error names the realm, and two duplicated/merged comments are tidied. --------- Co-authored-by: yetone <yetoneful@gmail.com>
34 lines
5.2 KiB
JSON
34 lines
5.2 KiB
JSON
{
|
||
"version": 1,
|
||
"plugins": [
|
||
{ "package": "@magpie-community/opencode-zcode-auth", "name": "ZCode", "icon": "zcode", "providers": ["zcode"], "community": true, "replaces": "zcode",
|
||
"summary": { "en": "Z.ai and BigModel GLM Coding Plan, team seats and ZCode's free Start Plan.", "zh": "Z.ai 与智谱 GLM Coding Plan,支持团队席位和 ZCode 免费 Start Plan。" } },
|
||
{ "package": "@magpie-community/opencode-qoder-auth", "name": "Qoder", "icon": "qoder", "providers": ["qoder", "qoder-cn"], "community": true, "replaces": "qoder",
|
||
"summary": { "en": "Your Qoder subscription, international (qoder.com) or Qoder CN (qoder.cn), with Qoder's own device sign-in.", "zh": "用 Qoder 自己的设备登录使用 Qoder 订阅:国际版(qoder.com)或 Qoder CN(qoder.cn)。" } },
|
||
{ "package": "@magpie-community/opencode-devin-auth", "name": "Devin", "icon": "devin", "providers": ["devin"], "community": true, "replaces": "devin",
|
||
"summary": { "en": "Devin's models with your Devin account — a browser sign-in or the devin CLI's.", "zh": "用 Devin 账号使用 Devin 的模型:浏览器登录,或沿用 devin CLI 的登录。" } },
|
||
{ "package": "@magpie-community/opencode-zed-auth", "name": "Zed", "icon": "zed", "providers": ["zed"], "community": true, "replaces": "zed",
|
||
"summary": { "en": "Claude, GPT, Gemini and Grok hosted by Zed, on your Zed plan.", "zh": "用 Zed 订阅使用 Zed 托管的 Claude、GPT、Gemini 和 Grok。" } },
|
||
{ "package": "@magpie-community/opencode-factory-auth", "name": "Factory", "icon": "factory", "providers": ["factory"], "community": true, "replaces": "factory",
|
||
"summary": { "en": "Factory's Droid subscription: 30 models from Anthropic, OpenAI, xAI and open labs.", "zh": "Factory Droid 订阅:Anthropic、OpenAI、xAI 及开源模型共 30 个。" } },
|
||
{ "package": "@magpie-community/opencode-grok-auth", "name": "Grok", "icon": "xai", "providers": ["grok"], "community": true, "replaces": "grok",
|
||
"summary": { "en": "SuperGrok and X Premium+, through the Grok Build CLI's sign-in.", "zh": "通过 Grok Build CLI 的登录使用 SuperGrok 和 X Premium+。" } },
|
||
{ "package": "@magpie-community/opencode-commandcode-auth", "name": "Command Code", "icon": "commandcode", "providers": ["commandcode-plan"], "community": true, "replaces": "commandcode-plan",
|
||
"summary": { "en": "Command Code plans — Pro, GOAT, Max, Ultra, Go and Teams.", "zh": "Command Code 各档套餐:Pro、GOAT、Max、Ultra、Go 和 Teams。" } },
|
||
{ "package": "@magpie-community/opencode-mimo-auth", "name": "Xiaomi MiMo", "icon": "mimocode", "providers": ["mimo-app"], "community": true, "replaces": "mimo-app",
|
||
"summary": { "en": "Xiaomi MiMo models with your Xiaomi account.", "zh": "用小米账号使用小米 MiMo 模型。" } },
|
||
{ "package": "@magpie-community/opencode-cursor-auth", "name": "Cursor", "icon": "cursor", "providers": ["cursor"], "community": true, "replaces": "cursor",
|
||
"summary": { "en": "Cursor Pro, Pro+, Ultra and Teams — every model your plan has, with tool calls.", "zh": "Cursor Pro、Pro+、Ultra 与 Teams:套餐里的所有模型,支持工具调用。" } },
|
||
{ "package": "@magpie-community/opencode-kiro-auth", "name": "Kiro", "icon": "kiro-color", "providers": ["kiro"], "community": true, "replaces": "kiro",
|
||
"summary": { "en": "Kiro Free, Pro, Pro+ and Power — Kiro's sign-in, kiro-cli's, or an API key.", "zh": "Kiro Free、Pro、Pro+ 与 Power:Kiro 登录、沿用 kiro-cli 的登录,或 API key。" } },
|
||
{ "package": "@magpie-community/opencode-minimax-auth", "name": "MiniMax Code", "icon": "minimax-color", "providers": ["minimax-code", "minimax-code-global"], "community": true,
|
||
"summary": { "en": "MiniMax Code account credits (daily check-in) and M Plan, with MiniMax Code's own device sign-in.", "zh": "用 MiniMax Code 账号的积分(每日签到)与 M Plan,使用 MiniMax Code 自己的设备登录。" } },
|
||
{ "package": "@magpie-community/opencode-workbuddy-auth", "name": "WorkBuddy", "icon": "workbuddy-color", "providers": ["workbuddy", "workbuddy-ai"], "community": true, "replaces": "workbuddy",
|
||
"summary": { "en": "WorkBuddy's China build (CodeBuddy plan) and its international build.", "zh": "WorkBuddy 国内版(CodeBuddy 套餐)与国际版。" } },
|
||
{ "package": "@magpie-community/opencode-cline-auth", "name": "Cline", "icon": "cline", "providers": ["cline"], "community": true,
|
||
"summary": { "en": "Cline's models on your own Cline account — usage billing, ClinePass and Cline's free models — with Cline's device sign-in or an API key.", "zh": "用自己的 Cline 账号使用 Cline 的模型——用量计费、ClinePass 与免费模型——支持 Cline 设备登录或 API key。" } },
|
||
{ "package": "@magpie-community/opencode-trae-auth", "name": "Trae", "icon": "trae", "providers": ["trae-cn", "trae-global"], "community": true,
|
||
"summary": { "en": "Trae CN (trae.cn) and Trae international (trae.ai) models with your own account, free tier included — Trae's own browser sign-in. Experimental.", "zh": "用 Trae CN(trae.cn)与 Trae 国际版(trae.ai)账号使用各自的模型,含免费版,使用 Trae 自己的浏览器登录。实验性。" } }
|
||
]
|
||
}
|