@phnx-labs/agents-cli 1.23.47 → 1.23.48
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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.23.48
|
|
4
|
+
|
|
5
|
+
- **`agents accounts usage --json` reports the rules it applied.** A new `thresholds` object carries the target share, the coverage needed before a seat count (`minCoverage`, `minMeasured`), the weeks each account needs before accounts are named (`weeksNeeded`) and the limit percent, so the AGI Menu Accounts tab can show why it recommends what it does. Source: `cli/src/lib/accounting/advise.ts`.
|
|
6
|
+
|
|
7
|
+
- **AGI Menu 1.21.0: the Accounts tab draws its answer.** The `menubar` helper floor rises to 1.21.0. The tab shows a verdict card with a confidence chip, weekly demand against the seats you would keep, a heat strip of weekly peaks per account, and the rules behind the advice with your numbers. You can filter by harness, 4/8/12 weeks and a 70/80/90% target, and Pause/Resume now works, with an inline confirm. Source: `cli/src/lib/helper-versions.ts`.
|
|
8
|
+
|
|
3
9
|
## 1.23.47
|
|
4
10
|
|
|
5
11
|
- **`agents accounts usage` no longer recommends a seat count from a few accounts.** With fewer than
|
|
@@ -29,6 +29,13 @@ export interface AccountsAdvice {
|
|
|
29
29
|
measured: number;
|
|
30
30
|
total: number;
|
|
31
31
|
};
|
|
32
|
+
thresholds: {
|
|
33
|
+
target: number;
|
|
34
|
+
minCoverage: number;
|
|
35
|
+
minMeasured: number;
|
|
36
|
+
weeksNeeded: number;
|
|
37
|
+
limitPercent: number;
|
|
38
|
+
};
|
|
32
39
|
advice: {
|
|
33
40
|
keep: number;
|
|
34
41
|
pause: string[];
|
|
@@ -46,6 +53,7 @@ export interface AdviseOptions {
|
|
|
46
53
|
export declare const DEFAULT_ADVISE_WEEKS = 4;
|
|
47
54
|
export declare const DEFAULT_ADVISE_TARGET = 0.8;
|
|
48
55
|
export declare const MIN_ADVISE_COVERAGE = 0.75;
|
|
56
|
+
export declare const LIMIT_PERCENT = 100;
|
|
49
57
|
export declare function weekStartUtc(ms: number): number;
|
|
50
58
|
export declare function adviseAccounts(accounts: readonly AdviseAccountInput[], peaks: readonly UsagePeak[], options?: AdviseOptions): AccountsAdvice;
|
|
51
59
|
export interface CollectAdviceOptions extends AdviseOptions {
|
|
@@ -7,6 +7,7 @@ import { getUsageHistoryPath, mergeUsagePeaks, parseUsagePeaks, peaksFromCacheRo
|
|
|
7
7
|
export const DEFAULT_ADVISE_WEEKS = 4;
|
|
8
8
|
export const DEFAULT_ADVISE_TARGET = 0.8;
|
|
9
9
|
export const MIN_ADVISE_COVERAGE = 0.75;
|
|
10
|
+
export const LIMIT_PERCENT = 100;
|
|
10
11
|
const DAY_MS = 24 * 60 * 60 * 1000;
|
|
11
12
|
const WEEK_MS = 7 * DAY_MS;
|
|
12
13
|
export function weekStartUtc(ms) {
|
|
@@ -41,7 +42,7 @@ export function adviseAccounts(accounts, peaks, options = {}) {
|
|
|
41
42
|
let pace = null;
|
|
42
43
|
let limitedWeeks = 0;
|
|
43
44
|
for (const p of byKey.get(account.usageKey) ?? []) {
|
|
44
|
-
if (p.peak >=
|
|
45
|
+
if (p.peak >= LIMIT_PERCENT)
|
|
45
46
|
limitedWeeks += 1;
|
|
46
47
|
if (Date.parse(p.resetsAt) > now.getTime()) {
|
|
47
48
|
thisWeek = Math.max(thisWeek ?? 0, p.peak);
|
|
@@ -89,6 +90,8 @@ export function adviseAccounts(accounts, peaks, options = {}) {
|
|
|
89
90
|
const coverage = { measured, total: active.length };
|
|
90
91
|
const weeksLabel = weekStarts.map((w) => new Date(w).toISOString().slice(0, 10));
|
|
91
92
|
const minMeasured = Math.ceil(active.length * MIN_ADVISE_COVERAGE);
|
|
93
|
+
const weeksNeeded = Math.min(3, weekCount);
|
|
94
|
+
const thresholds = { target, minCoverage: MIN_ADVISE_COVERAGE, minMeasured, weeksNeeded, limitPercent: LIMIT_PERCENT };
|
|
92
95
|
if (peakDemand === null || measured < minMeasured) {
|
|
93
96
|
const unmeasured = active.filter((r) => !hasReading(r)).map((r) => r.name);
|
|
94
97
|
const reason = peakDemand === null
|
|
@@ -96,7 +99,7 @@ export function adviseAccounts(accounts, peaks, options = {}) {
|
|
|
96
99
|
: `Only ${measured} of ${active.length} active accounts have a weekly reading; a seat count needs ${minMeasured}. `
|
|
97
100
|
+ `No reading for ${unmeasured.join(', ')}.`;
|
|
98
101
|
return {
|
|
99
|
-
weeks: weeksLabel, rows, demand, currentDemand, peakDemand, target, coverage,
|
|
102
|
+
weeks: weeksLabel, rows, demand, currentDemand, peakDemand, target, coverage, thresholds,
|
|
100
103
|
advice: { keep: active.length, pause: [], resume: [], add: 0, confidence: 'none', reason },
|
|
101
104
|
};
|
|
102
105
|
}
|
|
@@ -123,7 +126,6 @@ export function adviseAccounts(accounts, peaks, options = {}) {
|
|
|
123
126
|
.map((r) => r.name);
|
|
124
127
|
add = short - resume.length;
|
|
125
128
|
}
|
|
126
|
-
const weeksNeeded = Math.min(3, weekCount);
|
|
127
129
|
const thinHistory = active.filter((r) => r.peaks.filter((v) => v !== null).length < weeksNeeded).map((r) => r.name);
|
|
128
130
|
const confidence = thinHistory.length === 0 ? 'high' : 'low';
|
|
129
131
|
if (confidence === 'low') {
|
|
@@ -144,7 +146,7 @@ export function adviseAccounts(accounts, peaks, options = {}) {
|
|
|
144
146
|
parts.push(`Accounts to ${need < active.length ? 'pause' : 'resume'} are named once every active account has readings in ${weeksNeeded} of the last ${weekCount} weeks.`);
|
|
145
147
|
}
|
|
146
148
|
return {
|
|
147
|
-
weeks: weeksLabel, rows, demand, currentDemand, peakDemand, target, coverage,
|
|
149
|
+
weeks: weeksLabel, rows, demand, currentDemand, peakDemand, target, coverage, thresholds,
|
|
148
150
|
advice: { keep: need, pause, resume, add, confidence, reason: parts.join(' ') },
|
|
149
151
|
};
|
|
150
152
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@phnx-labs/agents-cli",
|
|
3
|
-
"version": "1.23.
|
|
3
|
+
"version": "1.23.48",
|
|
4
4
|
"description": "One CLI for all your AI coding agents - versions, config, cloud dispatch, sessions, and teams (now with first-class Grok Build CLI support)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|