@magpie-community/opencode-zcode-auth 0.1.4 → 0.1.5
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.
- package/index.mjs +6 -1
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -282,13 +282,18 @@ const isNum = (v) => typeof v === "number" && Number.isFinite(v)
|
|
|
282
282
|
|
|
283
283
|
// limitWindows are /api/monitor/usage/quota/limit's limits as windows: what
|
|
284
284
|
// is used of the whole when both are told (the whole less what remains, or
|
|
285
|
-
// the current value), else the percentage given.
|
|
285
|
+
// the current value), else the percentage given. TIME_LIMIT is the month's
|
|
286
|
+
// MCP tool calls, which ZCode shows but never stops the models on, so it is
|
|
287
|
+
// set aside, as is a limit whose whole is told as 0: no cap (an older
|
|
288
|
+
// plan's), which the vendor may still give as 100% used.
|
|
286
289
|
function limitWindows(d) {
|
|
287
290
|
const out = []
|
|
288
291
|
for (const x of d?.limits ?? []) {
|
|
289
292
|
const span = spanOf(Math.trunc(Number(x?.unit) || 0), x?.number)
|
|
290
293
|
const w = { name: windowName(span), used: 0 }
|
|
294
|
+
if (String(x?.type ?? "").toUpperCase() === "TIME_LIMIT") (w.name = "MCP · Month"), (w.aside = true)
|
|
291
295
|
if (isNum(x?.percentage)) w.used = x.percentage
|
|
296
|
+
if (x?.usage === 0) (w.used = 0), (w.aside = true)
|
|
292
297
|
if (isNum(x?.usage) && x.usage > 0) {
|
|
293
298
|
const total = x.usage
|
|
294
299
|
if (isNum(x.remaining)) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@magpie-community/opencode-zcode-auth",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"description": "OpenCode provider plugin: signs in to Z.ai's or BigModel's (智谱) GLM Coding Plan as ZCode does, including team seats and ZCode's Start Plan",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./index.mjs",
|