Files
plugins/packages/workbuddy/package.json
T
yetone 15d16f5ff0 workbuddy 0.1.21: a model free only at night is never said free; a whole-day discount shows the price before it (#121)
WorkBuddy's /v3/config prices a model by its "credits" and by a
modelPromotions list the picker reads for its badges: Hy3 限时免费 (whole
days to 10-31), Step-5-Preview 独家限免 (10-12..10-25), Hy4 preview 夜间免费
(free 23:00–8:00 only), GLM-5.2 and DeepSeek 夜间折扣. The plugin read only
"credits", and magpie keeps a plugin's model list until it next asks, so a
list read at night said Hy4 preview was free all day (#121's screenshot:
免费 in magpie, 0.29x and 夜间免费 in WorkBuddy).

priceOf now reads both. A model under a promotion with daily hours is given
at its full price and never as free (unpriced when the credits read 0 under
a night discount). A running whole-day discount is the price now, with the
credits before it as rateWas, which magpie already shows struck through.

Run:
- bun test across the repo (TMPDIR+HOME in the scratchpad): 1219 pass. The
  new price.test.mjs, built from the promotions copilot.tencent.com gave on
  2026-10-14, fails 3 on the old code.
- The owner's real WorkBuddy and WorkBuddy AI accounts through liveModels
  (17:10 CST): Hy4 preview 0.29, Hy3 and Step-5-Preview free, the rest at
  their credits, matching WorkBuddy's picker.

Not tried: the config as served at night (whether "credits" itself reads
x0.00 then); the unpriced branch covers that case.
2026-10-14 17:16:39 +08:00

13 lines
566 B
JSON

{
"name": "@magpie-community/opencode-workbuddy-auth",
"version": "0.1.21",
"description": "OpenCode provider plugins for WorkBuddy's plans: WorkBuddy (CodeBuddy, copilot.tencent.com) and WorkBuddy AI (www.workbuddy.ai)",
"type": "module",
"main": "./index.mjs",
"exports": "./index.mjs",
"files": ["index.mjs", "README.md"],
"keywords": ["opencode", "opencode-plugin", "workbuddy", "codebuddy"],
"license": "MIT",
"repository": { "type": "git", "url": "git+https://github.com/magpie-community/plugins.git", "directory": "packages/workbuddy" }
}