Adds packages/autoclaw, @magpie-community/opencode-autoclaw-auth, for AutoClaw (Zhipu OpenClaw). - Providers autoclaw (oversea, web sign-in through Google or z.ai) and autoclaw-cn (CN, phone SMS). - Reads the credit balance and runs the daily check-in through auth.checkin. Since the 10-08 review, this fixes: - The OAuth callback takes a code only with the state the authorize page handed out (login CSRF). The legacy /callback is gone. - The local server closes after 10 minutes even if magpie never calls callback, so port 18432 isn't held. - The registry entry no longer uses ZCode's icon. - The User-Agent names the real arch. - The check-in row's used is 0. - A 401 or 403 the upstream answers without an envelope marks the sign-in expired. - New tests with a fake fetch cover loader().fetch, refreshTokens and the callback's state check. What was run, at 356fb53 (8a0fd3a plus a merge of origin/main 118cf2e; the merge resolved registry.json, raccoon's entry beside autoclaw's): - HOME=$(mktemp -d) bun test packages/autoclaw: 9 pass, 0 fail. - Whole repo, HOME=$(mktemp -d) bun test: 1584 pass, 0 fail. - bun scripts/check.mjs: all ✓. - Broken by hand, each turning a test red: - Dropping the callback's state comparison: 1 fail. - Dropping the expired mark on a non-envelope 401: 1 fail. - The package isn't on npm yet. magpie serves it from the dist branch until an owner publishes its first version. Not verified: a real AutoClaw account, and the 10-minute server close (read, not tested).
35 lines
1.0 KiB
JSON
35 lines
1.0 KiB
JSON
{
|
|
"name": "@magpie-community/opencode-autoclaw-auth",
|
|
"version": "0.2.0",
|
|
"description": "OpenCode provider plugin for AutoClaw (Zhipu OpenClaw): oversea web sign-in (Google/z.ai) and CN phone SMS, multi-account pool, credit balance and daily check-in",
|
|
"type": "module",
|
|
"main": "./index.mjs",
|
|
"exports": "./index.mjs",
|
|
"files": [
|
|
"index.mjs",
|
|
"README.md"
|
|
],
|
|
"keywords": [
|
|
"opencode",
|
|
"opencode-plugin",
|
|
"magpie",
|
|
"autoclaw",
|
|
"zhipu",
|
|
"glm"
|
|
],
|
|
"license": "MIT",
|
|
"repository": {
|
|
"type": "git",
|
|
"url": "git+https://github.com/magpie-community/plugins.git",
|
|
"directory": "packages/autoclaw"
|
|
},
|
|
"magpie": {
|
|
"icon": "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Ccircle cx='32' cy='32' r='30' fill='%234f6ef7'/%3E%3Ctext x='32' y='42' font-size='28' text-anchor='middle' fill='white' font-family='sans-serif'%3E%E8%9F%B9%3C/text%3E%3C/svg%3E",
|
|
"options": {
|
|
"signin": true,
|
|
"signinHour": null,
|
|
"signinOnUsage": false
|
|
}
|
|
}
|
|
}
|