AutoClaw's weekly campaign credits are swept at their wallet's end, but the routing saw only the 6400 total with no date, so smart never spent them first. gcq909893267 found the date: every ledger entry carries a top-level wallet_expires_at (epoch seconds); the wallets endpoint has none. campaignBreakdown keeps each instance's wallet_expires_at and gives the soonest end of an instance with credits left and not yet past, and what the instances ending then have left. usage() puts that on the 积分余额 window as runsOutAt / runsOut, capped at the total. The reporter suggested a separate 活动积分 window with its own balance; magpie counts every balance window as a pool, so that would have counted 5000 twice. What magpie does with it: routing takes runsOutAt as the window's reset when it is sooner (routing.go:618), so the account counts as renewing tonight. Allowance.Lapsing needs a limit (Of) and skips a balance-only window, so the lapse share sort doesn't apply here. Tests use the reporter's literal credit and expire entries: 5000 lapse at 2026-11-15 23:59:59 +08, a spent earlier instance doesn't count, two ending in one second add up, past the end or without the field nothing is reported, and the usage window carries it with one balance window. Run: on mote, packages/autoclaw bun test 119 pass, check.mjs autoclaw ok. With index.mjs at 0.2.23 both new tests fail. Not tried: a live AutoClaw account.
38 lines
1.1 KiB
JSON
38 lines
1.1 KiB
JSON
{
|
|
"name": "@magpie-community/opencode-autoclaw-auth",
|
|
"version": "0.2.24",
|
|
"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": "./opencode.mjs",
|
|
"exports": { ".": "./opencode2.mjs" },
|
|
"files": [
|
|
"index.mjs",
|
|
"opencode.mjs",
|
|
"opencode2.mjs",
|
|
"README.md",
|
|
"README.en.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
|
|
}
|
|
}
|
|
}
|