Commit Graph
14 Commits
Author SHA1 Message Date
yetone af4a0b365d mimo 0.1.9: an account with a Token Plan and no app membership gets answers (yetone: 2 个模型中有 2 个没有响应). The app's /route answers such an account 403 membership_required ("未开通会员或会员已到期,请订阅后使用") for every model. The plugin now reads the plan's tp- key and endpoint from the open platform with the same passToken (/tokenPlan/apiKey's openaiBaseUrl, /tokenPlan/apiKey/raw), sends the request there with Bearer <key> and no cookies, mimo-pro/mimo-flash asked as mimo-v2.6-pro/mimo-v2.6-flash, and goes straight to the plan for an hour after. A key the plan turns away (401) is read again next time; no plan or no key passes the app's 403 through as it was. The usage card's Token Plan window is the account's allowance, not an aside, when there is no app plan.
Tested on the owner's real account (Token Plan Lite, no app membership): mimo-pro, mimo-flash (streamed) and mimo-auto answered 200 through the loader's fetch; usage shows Token Plan Lite with the "Token Plan" window. bun test (990 pass) and scripts/check.mjs under a temp HOME; 3 of the new tests fail on 0.1.8.
2026-10-09 01:50:45 +08:00
yetone bf01ffc4d9 mimo 0.1.8: a Token Plan bought at the open platform shows on the card (yetone: 我明明已经订阅了啊为啥说我是 free 账号啊). The card read only the MiMo app's /user/xiaomi/subscription/self, which is empty for an account whose plan is the platform's Token Plan, so it said Free. The same passToken signs on at platform.xiaomimimo.com (401 loginUrl, sid api-platform, through /sts), whose /api/v1/tokenPlan/detail and /usage give the plan, its end (UTC), renewal and credits: the card's plan is the Token Plan when the app has none, and its credits are an aside window (they are spent by the tp- key, not this account's requests). A platform that can't be read leaves the card as it was. Tested against the reporter's real account (Token Plan Lite, 6.81M / 4.1B credits, the second read keeping the platform session); the new tests use its literal replies and 3 of them fail on 0.1.7. 2026-10-07 00:49:43 +08:00
yetone 7711a3714a mimo 0.1.7: the plugin gives its provider MiMo Code's logo (#14) — package.json's magpie.icon is the SVG mimo.mi.com serves (static/mimo-code.a1594b207bbc4bee.svg) as a data:image/svg+xml URI, so the host passes it on with nothing fetched, and OpenCode or a magpie showing the plugin's own picture shows Xiaomi MiMo's mark. Checked: the decoded URI renders as the black Xiaomi MiMo tile, host.js's iconOf test (data:image, under 1.5 MB) takes it, scripts/check.mjs mimo and bun test (20 pass) under a temp HOME. 2026-10-03 22:17:38 +08:00
yetone 7dd0b4e0b4 mimo 0.1.6: magpie renews the sign-in ahead of time through auth.refresh
auth.refresh with refreshLead 10 minutes before the day's session ends:
the account signs on again, once per account (the request path joins it),
and the new session (access, expires) is given. A passToken Xiaomi no
longer takes is signIn "expired"; any other failure throws and is retried.

The check before each request stays for OpenCode, which doesn't call the
hook (magpie 0.1.684+ does). refresh.test.mjs fails without the change;
HOME=$(mktemp -d) bun test passes (396 across the repo).
2026-10-03 12:07:22 +08:00
yetone 8f25b63718 publish from GitHub Actions with npm's trusted publishing, no one-time password [skip ci]
.github/workflows/publish.yml runs the tests (in a throwaway HOME) and
scripts/publish.sh on each package.json change pushed to main, or by hand;
npm's OIDC exchange stands in for a token and an OTP. Every package now
names magpie-community/plugins' publish.yml as its trusted publisher on
npmjs.com, and gets the repository field npm checks it against.
2026-10-03 00:00:23 +08:00
yetone 01aee5da28 all: a usage read says what it means for the sign-in, and a renewal clears the mark whatever follows, as the built-ins did (要保证插件跟内置的所有逻辑都要一模一样) — auth.usage returns signIn on every path: expired where the built-in's quota read marked the account (Zed's /users/me 401, Factory's and MiMo's refused renewals, Qoder's refused job refresh), renewed after a renewal, which took the mark off, kept everywhere else, so magpie no longer guesses from the words 'sign in again' (Kiro's, Devin's and ZCode's usage errors marked accounts their built-ins never did) nor clears on a clean read. A request after a renewal says renewed on any status; one without says kept, as the built-ins cleared only on renewal. Kiro, Cursor, Devin, Command Code, WorkBuddy, Grok and ZCode, whose built-ins never marked an account, say kept on every answer. New tests fail against 85d7dd0's index.mjs. 2026-10-01 04:53:29 +08:00
yetone 85d7dd0d0a all: each plugin fails with its built-in's status and marks the sign-in as it did, through X-Magpie-Sign-In (要保证插件跟内置的所有逻辑都要一模一样) — Factory's and MiMo's refused renewals are the built-ins' 502 marked expired, not 401s; Qoder's vendor 403 is the built-in's 401 kept, its model list's failure a 400, its job refresh refused marked expired; Zed's retried 401 is a 401 kept, not a 403; Kiro's unreachable refresh a 401 kept; Cursor's expired trial a 401 kept; a vendor 401 WorkBuddy, Grok, Devin, Command Code and ZCode passed on no longer marks the account, as their built-ins never did, and Grok and MiMo no longer retry what their built-ins sent once. Messages take the built-ins' words. New tests fail against the previous index.mjs. 2026-10-01 04:47:03 +08:00
yetone aac52c9ce4 mimo 0.1.4: a chat body handed over as bytes is read, so mimo-auto is still asked as mimo-pro; a sign-in Xiaomi no longer takes answers the request with a 401 in the built-in's words (<user>: the Xiaomi MiMo sign-in has expired — sign in again) instead of a thrown fetch 2026-10-01 03:13:34 +08:00
yetone fb82ecd4d2 mimo 0.1.3 2026-10-01 02:45:37 +08:00
yetone d28f9dfa09 mimo 0.1.3: two accounts signing on at once each keep their own session — one renewal was shared by every account, so an account could get another's session and show its plan and allowance 2026-10-01 02:45:10 +08:00
yetone c8f4d448df Parity with magpie's built-ins: a failed sign-in says why, CLI-backed Command Code and Devin accounts follow the CLI's key, Factory's refused renewal is a 401 in the caller's API shape
- every {type:"failed"} carries an error reason magpie shows
- commandcode/devin: accounts taken from the CLI are marked metadata.cli and re-read its credentials on each request, usage and models
- factory: a refused refresh answers 401 authentication_error (Anthropic shape on /llm/a/, OpenAI's elsewhere) instead of throwing; the whoami back-off is per account; 403 hints name the account to sign in again
- versions: factory/devin/commandcode/cursor/kiro/mimo/zed/zcode 0.1.2, workbuddy 0.1.3
2026-10-01 00:55:50 +08:00
yetone 3d1f24219a mimo 0.1.1: usage shows as magpie's built-in did — plan, period, windows and what they count, balancemimo 2026-09-30 23:03:09 +08:00
yetone 5a18bbdac4 Name the scope @magpie-community (the org's name, spelled right) 2026-09-30 17:04:47 +08:00
yetone fd05920836 mimo: Xiaomi MiMo (the MiMo app's Xiaomi account) — Xiaomi sign-in page or QR polled until done, regional servers, session cookies renewed every 24h and on a 401, MiMo Pro and Flash over chat completions 2026-09-30 17:00:13 +08:00