@magpie-community/opencode-workbuddy-auth 0.1.24 → 0.1.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +35 -0
  2. package/index.mjs +1 -1
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -164,6 +164,39 @@ credits are read from the enterprise meter
164
164
  page reads: the cycle's credits used of its limit, and when the cycle
165
165
  resets (magpie #1904).
166
166
 
167
+ ## When free models work but a credit model does not
168
+
169
+ Check the failing account and model separately before concluding that the
170
+ wallet is empty:
171
+
172
+ - Use the exact API id from the account's model list. For example,
173
+ `glm-5.3-flash` is the id; `GLM-5.3-Flash` is its display name. A route
174
+ copied from another provider need not be a valid WorkBuddy model id.
175
+ - The WorkBuddy 5.6+ encrypted-desktop message means this sign-in cannot
176
+ be read, not that the account has zero credits. Use **Account (browser)**
177
+ for the same build/region. Keep the old entry until the new identity and
178
+ model list are confirmed. The desktop file is not decrypted or changed.
179
+ - An account restricted by WorkBuddy is a different failure. Code 11140
180
+ with its unusual-activity message calls for **Submit feedback** in
181
+ WorkBuddy; signing in repeatedly or changing the model does not lift it.
182
+ See [magpie#1849](https://github.com/yetone/magpie/issues/1849).
183
+ - Inspect each attempted provider/account in magpie's routing details.
184
+ A ZCode trial quota failure, another provider's insufficient credits, or
185
+ one account's restriction is not the balance of every WorkBuddy account.
186
+
187
+ A model response confirms that the selected account can answer. It does
188
+ not, without a matching vendor usage record, prove how many credits that
189
+ request deducted. A usage-read error means the balance is unknown.
190
+
191
+ The encrypted-desktop result can be reproduced without an account using
192
+ `packages/workbuddy/usage.test.mjs` in an isolated temporary HOME (and
193
+ USERPROFILE on Windows). It covers sign-in, usage and chat against a
194
+ synthetic sealed desktop file, and checks that the file stays unchanged.
195
+ A successful browser authorization alone is not a migration: compare the
196
+ returned identity with the intended desktop account before replacing its
197
+ entry. An already signed-in browser can simply renew another saved account.
198
+
199
+
167
200
  ## Not here
168
201
 
169
202
  magpie's built-in WorkBuddy does more than this package:
@@ -172,3 +205,5 @@ magpie's built-in WorkBuddy does more than this package:
172
205
  - several accounts under one provider.
173
206
 
174
207
  OpenCode's plugin API has no place for these.
208
+
209
+ Credit multipliers accept the international catalog's `x0.34 credits` text as well as `x0.34`. An empty credits value (for example Auto) stays unknown, never free.
package/index.mjs CHANGED
@@ -1403,7 +1403,7 @@ function modelOf(site, provider, m) {
1403
1403
  // rated. The same rule as magpie's built-in (wbCredits).
1404
1404
  function creditsOf(c) {
1405
1405
  if (c == null || c === "") return undefined
1406
- const s = String(c).trim().toLowerCase().replace(/^x/, "")
1406
+ const s = String(c).trim().toLowerCase().replace(/\s+credits?$/, "").replace(/^x/, "")
1407
1407
  const n = Number(s)
1408
1408
  return s !== "" && Number.isFinite(n) && n >= 0 ? n : undefined
1409
1409
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@magpie-community/opencode-workbuddy-auth",
3
- "version": "0.1.24",
3
+ "version": "0.1.25",
4
4
  "description": "OpenCode provider plugins for WorkBuddy's plans: WorkBuddy (CodeBuddy, copilot.tencent.com) and WorkBuddy AI (www.workbuddy.ai)",
5
5
  "type": "module",
6
6
  "main": "./index.mjs",