agentaudit 3.9.27 โ 3.9.28
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/cli.mjs +23 -1
- package/package.json +1 -1
package/cli.mjs
CHANGED
|
@@ -380,8 +380,10 @@ function getVersion() {
|
|
|
380
380
|
|
|
381
381
|
function banner() {
|
|
382
382
|
if (quietMode || jsonMode) return;
|
|
383
|
+
const creds = loadCredentials();
|
|
384
|
+
const agentInfo = creds?.agent_name ? ` ${c.dim}ยท${c.reset} ${c.green}${creds.agent_name}${c.reset}` : '';
|
|
383
385
|
console.log();
|
|
384
|
-
console.log(` ๐ก ${c.bold}${c.cyan}AgentAudit${c.reset} ${c.dim}v${getVersion()}${c.reset}`);
|
|
386
|
+
console.log(` ๐ก ${c.bold}${c.cyan}AgentAudit${c.reset} ${c.dim}v${getVersion()}${c.reset}${agentInfo}`);
|
|
385
387
|
console.log(` ${c.dim}Security scanner for AI tools${c.reset}`);
|
|
386
388
|
console.log();
|
|
387
389
|
}
|
|
@@ -1964,6 +1966,26 @@ async function main() {
|
|
|
1964
1966
|
if (creds?.api_key) {
|
|
1965
1967
|
const masked = creds.api_key.substring(0, 8) + '...' + creds.api_key.substring(creds.api_key.length - 4);
|
|
1966
1968
|
console.log(` ${c.green}โ${c.reset} AgentAudit ${c.dim}${masked}${c.reset} ${c.dim}(${creds.agent_name || 'unknown'})${c.reset}`);
|
|
1969
|
+
// Fetch agent stats from leaderboard
|
|
1970
|
+
try {
|
|
1971
|
+
const lbRes = await fetch(`${REGISTRY_URL}/api/leaderboard`, { signal: AbortSignal.timeout(5000) });
|
|
1972
|
+
if (lbRes.ok) {
|
|
1973
|
+
const agents = await lbRes.json();
|
|
1974
|
+
const myName = creds.agent_name?.toLowerCase();
|
|
1975
|
+
const idx = Array.isArray(agents) ? agents.findIndex((a) => (a.agent_name || '').toLowerCase() === myName) : -1;
|
|
1976
|
+
if (idx >= 0) {
|
|
1977
|
+
const me = agents[idx];
|
|
1978
|
+
const pts = me.total_points || 0;
|
|
1979
|
+
const reports = me.total_reports || 0;
|
|
1980
|
+
const rank = idx + 1;
|
|
1981
|
+
const medal = rank === 1 ? '๐ฅ' : rank === 2 ? '๐ฅ' : rank === 3 ? '๐ฅ' : ' ';
|
|
1982
|
+
console.log();
|
|
1983
|
+
console.log(` ${c.bold}Your Stats:${c.reset}`);
|
|
1984
|
+
console.log(` ${medal} Rank #${rank} of ${agents.length} ${c.dim}โ${c.reset} ${c.cyan}${pts}${c.reset} points ${c.dim}โ${c.reset} ${reports} reports`);
|
|
1985
|
+
if (me.is_official) console.log(` ${c.green}โ Official Auditor${c.reset}`);
|
|
1986
|
+
}
|
|
1987
|
+
}
|
|
1988
|
+
} catch {}
|
|
1967
1989
|
} else {
|
|
1968
1990
|
console.log(` ${c.dim}โ${c.reset} AgentAudit ${c.dim}not set${c.reset} ${c.dim}(run: agentaudit setup)${c.reset}`);
|
|
1969
1991
|
}
|