Files
plugins/packages/trae/package.json
T
yetone 9c5d284cf0 trae: an enterprise seat signs in on its console's own authorization page (#1328)
Since the 2026-11-18 Doubao/Feishu account upgrade, www.trae.cn/authorization
sends a signed-out browser to accounts.doubao.com ("登录豆包飞书账号 以继续使用
TRAE"), which has no enterprise entry: hide_saas_login is lost on the way,
and a legacy enterprise TRAE account (email/password) can't sign in there at
all (@yalifesign on X; #1328, Jinzhengxu, yjun123).

Each provider now has a second way, "Trae CN enterprise account (browser)" /
"Trae Global enterprise account (browser)". It opens
console.enterprise.trae.cn/authorization (console.enterprise.trae.ai for
Global) with the same parameters as the consumer page. That route is in the
consoles' own page code (CN index-Jt0RvTT_.js, Global index-Cd9NoAem.js): it
takes login_trace_id, device_id, auth_from (trae/solo/...) and an
auth_callback_url on 127.0.0.1, shows the console's login (TRAE account,
Doubao/Feishu, 企业 SSO) when signed out, then calls back with userJwt,
userInfo, refreshToken and host (its Api host) - the fields the plugin
already reads. A callback from the console that names no host takes its
consoleHost, so the seat is still enterprise. The personal way is unchanged.

Run (mote, through mote-run):
- packages/trae: bun test, 293 pass, 0 fail.
- root bun test with a temp HOME: 9101 pass, 0 fail (9121 tests, 638
  files, 573s); bun scripts/check.mjs exit 0. Both at base 140c513b; rebased onto
  e6c45711 (factory, agy-cli, kiro only), packages/trae and check.mjs ran
  again at the pushed head: 293 pass, 0 fail, exit 0.
Broken by hand: pointing the enterprise way back at hosts.web and dropping
the consoleHost fallback turns "the enterprise way opens the console's
authorization page ..." and "a console callback naming no host ..." red
(29 pass, 2 fail in enterprise.test.mjs).

Not tried: a real enterprise seat on either console (none here), and
whether the console's page keeps auth_from=solo through its own SSO
redirect. Global's consumer page was not checked for the same change.
2026-11-19 22:25:07 +08:00

32 lines
713 B
JSON

{
"name": "@magpie-community/opencode-trae-auth",
"version": "0.2.46",
"description": "OpenCode provider plugins for Trae: Trae CN (trae.cn) and Trae Global (trae.ai), free tier included, with Trae's own browser sign-in",
"type": "module",
"main": "./opencode.mjs",
"exports": {
".": "./opencode2.mjs"
},
"files": [
"index.mjs",
"opencode.mjs",
"opencode2.mjs",
"README.md"
],
"keywords": [
"opencode",
"opencode-plugin",
"magpie",
"trae",
"trae-cn",
"trae-global",
"bytedance"
],
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/magpie-community/plugins.git",
"directory": "packages/trae"
}
}