quotacap 0.0.16 → 0.0.18
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/format/table.js +24 -10
- package/dist/src/format/table.js +24 -10
- package/dist/src/version.js +1 -1
- package/dist/src/webAssets.js +1 -1
- package/dist/src/webHtml.js +1 -1
- package/dist/tests/cli/cli.test.js +1 -1
- package/dist/tests/format/table.test.js +34 -14
- package/dist/tests/mcp/quotas.test.js +1 -1
- package/dist/version.js +1 -1
- package/dist/web/src/App.js +1 -1
- package/dist/webAssets.js +1 -1
- package/dist/webHtml.js +1 -1
- package/package.json +1 -1
- package/web/dist/assets/{index-BBN0J6GO.js → index-Dpiqzcc8.js} +1 -1
- package/web/dist/index.html +1 -1
package/dist/format/table.js
CHANGED
|
@@ -18,25 +18,39 @@ export function renderQuotasTable(quotas, advisories = []) {
|
|
|
18
18
|
const daysLeft = a?.daysLeft != null ? a.daysLeft.toFixed(1) : "—";
|
|
19
19
|
const ideal = a?.idealRate != null ? `${Math.round(a.idealRate)}%/day` : "—";
|
|
20
20
|
const burn = (() => {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
return
|
|
21
|
+
const rate = a?.burnMeasured ? `${a.burnRate.toFixed(1)}%/day`
|
|
22
|
+
: q.periodStart ? (() => {
|
|
23
|
+
const elapsed = (Date.now() - new Date(q.periodStart).getTime()) / 86400000;
|
|
24
|
+
if (elapsed > 0.1)
|
|
25
|
+
return `${((q.usedPct ?? 0) / elapsed).toFixed(1)}%/day avg`;
|
|
26
|
+
return null;
|
|
27
|
+
})()
|
|
28
|
+
: null;
|
|
29
|
+
if (!rate)
|
|
30
|
+
return "—";
|
|
31
|
+
// Verdict against the ideal rate: outside the +-20% band the cell says
|
|
32
|
+
// (fast)/(slow); inside it a single-width check mark.
|
|
33
|
+
const value = a?.burnMeasured ? a.burnRate : q.periodStart ? (q.usedPct ?? 0) / Math.max(0.1, (Date.now() - new Date(q.periodStart).getTime()) / 86400000) : null;
|
|
34
|
+
const ideal = a?.idealRate;
|
|
35
|
+
if (ideal != null && value != null) {
|
|
36
|
+
if (value > ideal * 1.2)
|
|
37
|
+
return `${rate} (fast)`;
|
|
38
|
+
if (value < ideal * 0.8)
|
|
39
|
+
return `${rate} (slow)`;
|
|
40
|
+
return `${rate} ✔`;
|
|
27
41
|
}
|
|
28
|
-
return
|
|
42
|
+
return rate;
|
|
29
43
|
})();
|
|
30
44
|
// Renderers that count emoji as one cell but paint two (Kimi, Claude
|
|
31
45
|
// Code) shift the pipes after a wide glyph by +1; the status glyphs
|
|
32
46
|
// live in the last column so the shift touches only the right border.
|
|
33
47
|
const icon = a?.status === "at risk" ? "⚠️" : a != null ? "✅" : "—";
|
|
34
48
|
const waste = a?.wastePct != null ? `${Math.round(a.wastePct)}%` : "—";
|
|
35
|
-
return `| ${q.provider} | ${used}% | ${100 - used}% | ${resets} | ${daysLeft} | ${ideal} | ${burn} | ${waste}
|
|
49
|
+
return `| ${q.provider} | ${used}% | ${100 - used}% | ${resets} | ${daysLeft} | ${ideal} | ${burn} | ${waste} |`;
|
|
36
50
|
});
|
|
37
51
|
return [
|
|
38
|
-
"| Provider | Used |
|
|
39
|
-
"
|
|
52
|
+
"| Provider | Used | Left | Resets | Days left | Ideal daily burn | Burn rate | Waste if unused |",
|
|
53
|
+
"|---|---|---|---|---|---|---|---|",
|
|
40
54
|
...rows,
|
|
41
55
|
].join("\n");
|
|
42
56
|
}
|
package/dist/src/format/table.js
CHANGED
|
@@ -18,25 +18,39 @@ export function renderQuotasTable(quotas, advisories = []) {
|
|
|
18
18
|
const daysLeft = a?.daysLeft != null ? a.daysLeft.toFixed(1) : "—";
|
|
19
19
|
const ideal = a?.idealRate != null ? `${Math.round(a.idealRate)}%/day` : "—";
|
|
20
20
|
const burn = (() => {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
return
|
|
21
|
+
const rate = a?.burnMeasured ? `${a.burnRate.toFixed(1)}%/day`
|
|
22
|
+
: q.periodStart ? (() => {
|
|
23
|
+
const elapsed = (Date.now() - new Date(q.periodStart).getTime()) / 86400000;
|
|
24
|
+
if (elapsed > 0.1)
|
|
25
|
+
return `${((q.usedPct ?? 0) / elapsed).toFixed(1)}%/day avg`;
|
|
26
|
+
return null;
|
|
27
|
+
})()
|
|
28
|
+
: null;
|
|
29
|
+
if (!rate)
|
|
30
|
+
return "—";
|
|
31
|
+
// Verdict against the ideal rate: outside the +-20% band the cell says
|
|
32
|
+
// (fast)/(slow); inside it a single-width check mark.
|
|
33
|
+
const value = a?.burnMeasured ? a.burnRate : q.periodStart ? (q.usedPct ?? 0) / Math.max(0.1, (Date.now() - new Date(q.periodStart).getTime()) / 86400000) : null;
|
|
34
|
+
const ideal = a?.idealRate;
|
|
35
|
+
if (ideal != null && value != null) {
|
|
36
|
+
if (value > ideal * 1.2)
|
|
37
|
+
return `${rate} (fast)`;
|
|
38
|
+
if (value < ideal * 0.8)
|
|
39
|
+
return `${rate} (slow)`;
|
|
40
|
+
return `${rate} ✔`;
|
|
27
41
|
}
|
|
28
|
-
return
|
|
42
|
+
return rate;
|
|
29
43
|
})();
|
|
30
44
|
// Renderers that count emoji as one cell but paint two (Kimi, Claude
|
|
31
45
|
// Code) shift the pipes after a wide glyph by +1; the status glyphs
|
|
32
46
|
// live in the last column so the shift touches only the right border.
|
|
33
47
|
const icon = a?.status === "at risk" ? "⚠️" : a != null ? "✅" : "—";
|
|
34
48
|
const waste = a?.wastePct != null ? `${Math.round(a.wastePct)}%` : "—";
|
|
35
|
-
return `| ${q.provider} | ${used}% | ${100 - used}% | ${resets} | ${daysLeft} | ${ideal} | ${burn} | ${waste}
|
|
49
|
+
return `| ${q.provider} | ${used}% | ${100 - used}% | ${resets} | ${daysLeft} | ${ideal} | ${burn} | ${waste} |`;
|
|
36
50
|
});
|
|
37
51
|
return [
|
|
38
|
-
"| Provider | Used |
|
|
39
|
-
"
|
|
52
|
+
"| Provider | Used | Left | Resets | Days left | Ideal daily burn | Burn rate | Waste if unused |",
|
|
53
|
+
"|---|---|---|---|---|---|---|---|",
|
|
40
54
|
...rows,
|
|
41
55
|
].join("\n");
|
|
42
56
|
}
|
package/dist/src/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// generated by scripts/build-embed.mjs — do not edit
|
|
2
|
-
export const VERSION = "0.0.
|
|
2
|
+
export const VERSION = "0.0.18";
|