@staff0rd/assist 0.116.0 → 0.117.0
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 +9 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import { Command } from "commander";
|
|
|
6
6
|
// package.json
|
|
7
7
|
var package_default = {
|
|
8
8
|
name: "@staff0rd/assist",
|
|
9
|
-
version: "0.
|
|
9
|
+
version: "0.117.0",
|
|
10
10
|
type: "module",
|
|
11
11
|
main: "dist/index.js",
|
|
12
12
|
bin: {
|
|
@@ -8267,7 +8267,7 @@ function formatNumber(num) {
|
|
|
8267
8267
|
return num.toLocaleString("en-US");
|
|
8268
8268
|
}
|
|
8269
8269
|
function colorizePercent(pct) {
|
|
8270
|
-
const label2 = `${pct}%`;
|
|
8270
|
+
const label2 = `${Math.round(pct)}%`;
|
|
8271
8271
|
if (pct > 80) return chalk78.red(label2);
|
|
8272
8272
|
if (pct > 40) return chalk78.yellow(label2);
|
|
8273
8273
|
return label2;
|
|
@@ -8281,8 +8281,14 @@ async function statusLine() {
|
|
|
8281
8281
|
const usedPct = data.context_window.used_percentage ?? 0;
|
|
8282
8282
|
const formattedInput = formatNumber(totalInput);
|
|
8283
8283
|
const formattedOutput = formatNumber(totalOutput);
|
|
8284
|
+
const fiveHrPct = data.rate_limits?.five_hour?.used_percentage;
|
|
8285
|
+
const sevenDayPct = data.rate_limits?.seven_day?.used_percentage;
|
|
8286
|
+
let limitsSegment = "";
|
|
8287
|
+
if (fiveHrPct != null && sevenDayPct != null) {
|
|
8288
|
+
limitsSegment = ` | Limits - ${colorizePercent(fiveHrPct)} (5h), ${colorizePercent(sevenDayPct)} (7d)`;
|
|
8289
|
+
}
|
|
8284
8290
|
console.log(
|
|
8285
|
-
`${model} | Tokens - ${formattedOutput} \u2191 : ${formattedInput} \u2193 | Context - ${colorizePercent(usedPct)}`
|
|
8291
|
+
`${model} | Tokens - ${formattedOutput} \u2191 : ${formattedInput} \u2193 | Context - ${colorizePercent(usedPct)}${limitsSegment}`
|
|
8286
8292
|
);
|
|
8287
8293
|
}
|
|
8288
8294
|
|