@jeffreyjyz/opencode-command-code 0.5.11 → 0.5.13
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/dist/index.js +1 -1
- package/dist/tui.js +8 -9
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2414,7 +2414,7 @@ function superRefine(fn) {
|
|
|
2414
2414
|
// package.json
|
|
2415
2415
|
var package_default = {
|
|
2416
2416
|
name: "@jeffreyjyz/opencode-command-code",
|
|
2417
|
-
version: "0.5.
|
|
2417
|
+
version: "0.5.13",
|
|
2418
2418
|
description: "Command Code provider + usage dashboard for opencode: two providers (Anthropic wire for Claude, OpenAI wire for everything else) against api.commandcode.ai, live model list, plan gating, /cmd-usage. Requires the cmduse CLI for usage rendering.",
|
|
2419
2419
|
type: "module",
|
|
2420
2420
|
main: "dist/index.js",
|
package/dist/tui.js
CHANGED
|
@@ -2189,17 +2189,17 @@ function zenWindow(label, spent, limit, share, now, durSecs, resetAt) {
|
|
|
2189
2189
|
exceeded: spent.cost >= cap
|
|
2190
2190
|
}, now, durSecs, spent.requests > 0 ? `${count(spent.requests)} req` : undefined);
|
|
2191
2191
|
}
|
|
2192
|
-
function zenMeterRows(label, meter, now, durSecs,
|
|
2192
|
+
function zenMeterRows(label, meter, now, durSecs, spent) {
|
|
2193
2193
|
const pct = meter.percent;
|
|
2194
2194
|
const pctText = Number.isInteger(pct) ? String(pct) : pct.toFixed(1);
|
|
2195
|
-
const
|
|
2195
|
+
const local = typeof spent === "number" ? ` \xB7 ${money(spent)} model` : "";
|
|
2196
2196
|
return windowRows(label, {
|
|
2197
|
-
cap:
|
|
2198
|
-
used:
|
|
2197
|
+
cap: 100,
|
|
2198
|
+
used: pct,
|
|
2199
2199
|
resetAt: meter.resetsAt,
|
|
2200
2200
|
sharePct: pct,
|
|
2201
2201
|
exceeded: pct >= 100 || meter.status !== "ok"
|
|
2202
|
-
}, now, durSecs, undefined,
|
|
2202
|
+
}, now, durSecs, undefined, () => `${pctText}% of limit${local}`);
|
|
2203
2203
|
}
|
|
2204
2204
|
function zenRows(usage, meta, modelUsage, session, fallbackName, windows) {
|
|
2205
2205
|
if (!usage)
|
|
@@ -2213,12 +2213,11 @@ function zenRows(usage, meta, modelUsage, session, fallbackName, windows) {
|
|
|
2213
2213
|
const mine = usage.models.get(modelKey(fallbackName ?? "")) ?? (meta ? usage.models.get(modelKey(meta.name)) : undefined);
|
|
2214
2214
|
const limit = oc?.allowance ?? mine?.limit;
|
|
2215
2215
|
const cap = mine ? limit : undefined;
|
|
2216
|
-
const documented = (allowance, share) => typeof allowance === "number" && allowance > 0 ? allowance * share : undefined;
|
|
2217
2216
|
const period = monthPeriod(usage);
|
|
2218
2217
|
if (usage.account) {
|
|
2219
|
-
rows.push(...zenMeterRows("5-hour", usage.account.rolling, now, FIVE_HOUR_SECS,
|
|
2220
|
-
rows.push(...zenMeterRows("Weekly", usage.account.weekly, now, WEEKLY_SECS,
|
|
2221
|
-
rows.push(...zenMeterRows("Monthly", usage.account.monthly, now, period?.durSecs ?? 0,
|
|
2218
|
+
rows.push(...zenMeterRows("5-hour", usage.account.rolling, now, FIVE_HOUR_SECS, mine?.fiveHour.cost ?? usage.totals.fiveHour.cost));
|
|
2219
|
+
rows.push(...zenMeterRows("Weekly", usage.account.weekly, now, WEEKLY_SECS, mine?.weekly.cost ?? usage.totals.weekly.cost));
|
|
2220
|
+
rows.push(...zenMeterRows("Monthly", usage.account.monthly, now, period?.durSecs ?? 0, mine?.month.cost ?? usage.totals.month.cost));
|
|
2222
2221
|
} else {
|
|
2223
2222
|
rows.push(...zenWindow("5-hour", mine?.fiveHour ?? usage.totals.fiveHour, cap, GO_WINDOW_SHARE.fiveHour, now, FIVE_HOUR_SECS, rollingReset(windows?.fiveHour, FIVE_HOUR_SECS)));
|
|
2224
2223
|
rows.push(...zenWindow("Weekly", mine?.weekly ?? usage.totals.weekly, cap, GO_WINDOW_SHARE.weekly, now, WEEKLY_SECS, rollingReset(windows?.weekly, WEEKLY_SECS)));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jeffreyjyz/opencode-command-code",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.13",
|
|
4
4
|
"description": "Command Code provider + usage dashboard for opencode: two providers (Anthropic wire for Claude, OpenAI wire for everything else) against api.commandcode.ai, live model list, plan gating, /cmd-usage. Requires the cmduse CLI for usage rendering.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|