A Trae model's rate (and the rate before a discount) now comes from its list entry's display_contact_config: consumption_rate when enabled, the member discount's consumption_rate when that discount is enabled, and an off-peak activity's after/before price by its time_windows in its own time zone, computed when the list is read. A field that throws (an unknown time_zone) costs that model its rate only; the rest of the live list stays. Fixtures are the reporter's literal display_contact_config strings from batch_get_detail_param. Run at the reviewed head f47880ff on mote: - bun test packages/trae: 234 pass, 0 fail. - Broken by hand: making traeRateOf's outer catch rethrow turns "a broken time zone costs that model its rate only, not the list" red (1 fail). - Real samples probed under TZ=UTC and TZ=America/Los_Angeles: deepseek 0.06/was 0.12 at 08:59, 12:30, 18:00 weekdays and all weekend (Asia/Shanghai), 0.12 at 09:00 and 14:00; glm-5.3 0.58/was 0.78; a Bogus/Zone entry gives 0.12; missing, bad JSON, null and arrays give nothing. Not tried: a real Trae account through magpie. The rate is computed when the host reads the list, so it can lag a window edge until the next read.
32 lines
713 B
JSON
32 lines
713 B
JSON
{
|
|
"name": "@magpie-community/opencode-trae-auth",
|
|
"version": "0.2.28",
|
|
"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"
|
|
}
|
|
}
|