Files
plugins/packages/doubao-work/package.json
T
yetone 89a54951cc doubao-work 0.1.9: the plan's allowance and each model's multiple are read (qhyqhy1s on X)
The plugin had no auth.usage, so the Providers row said 暂无额度数据, and
models carried no rate. Now:

- usage reads POST /alice/commerce/sale/subscription/quota/summary/ through
  the app's own page (cookies sign it; the bare URL answers 200) and maps
  window_limit_section to windows (percent used, named by span when the
  reply has times, resetsAt from end_time; usage_exhausted reads 100%) and
  the plan's short_name. A 401, an empty reply or a failed fetch gives an
  error with signIn kept. An app the plugin never started is not opened.
- the model menu's rows keep their lines under the name, and a multiple
  written there ("2x", "x0.5", "1.5 倍") becomes the model's rate.

Run: bun test packages/doubao-work through mote-run, HOME in a scratch dir:
47 pass. Broke by hand: usage hook renamed and rate dropped, 3 new tests
red, restored, green. The quota reply shape was read from the real app
(a 标准套餐 account via a copy of its profile, bare URL).

Not tried: the multiple. The owner's account shows only auto, 豆包 2.1
Lite and Pro with no multiple, so what the reporter's menu writes next to
DeepSeek/Kimi/GLM was not seen; rateOf reads the common forms and a row
written another way stays without a rate. The window names for a span are
a guess (the one real window has no times, so it is named 额度).
Models cached by 0.1.8 get rates at the next menu read.
2026-11-13 10:31:36 +08:00

31 lines
759 B
JSON

{
"name": "@magpie-community/opencode-doubao-work-auth",
"version": "0.1.9",
"type": "module",
"main": "./opencode.mjs",
"files": [
"index.mjs",
"cdp.mjs",
"doubao.mjs",
"openai.mjs",
"prompt.mjs",
"opencode.mjs",
"opencode2.mjs",
"README.md"
],
"description": "Doubao Work (豆包工作) as a model provider, by driving the 豆包工作 (or 豆包) desktop app the way a person does",
"magpie": {
"maxConcurrency": 1
},
"repository": {
"type": "git",
"url": "git+https://github.com/magpie-community/plugins.git",
"directory": "packages/doubao-work"
},
"keywords": ["magpie", "magpie-plugin", "doubao", "doubao-work"],
"license": "MIT",
"exports": {
".": "./opencode2.mjs"
}
}