agentaudit 3.9.30 → 3.9.31

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.
Files changed (2) hide show
  1. package/cli.mjs +10 -7
  2. package/package.json +1 -1
package/cli.mjs CHANGED
@@ -403,18 +403,21 @@ function getVersion() {
403
403
  } catch { return '0.0.0'; }
404
404
  }
405
405
 
406
- function banner() {
406
+ async function banner() {
407
407
  if (quietMode || jsonMode) return;
408
408
  const creds = loadCredentials();
409
409
  const agentInfo = creds?.agent_name ? ` ${c.dim}·${c.reset} ${c.green}${creds.agent_name}${c.reset}` : '';
410
410
  console.log();
411
411
  console.log(` 🛡 ${c.bold}${c.cyan}AgentAudit${c.reset} ${c.dim}v${getVersion()}${c.reset}${agentInfo}`);
412
- // Show cached stats inline
413
412
  if (creds?.agent_name) {
414
- const cached = loadStatsCache();
415
- if (cached && cached.pts !== undefined) {
413
+ let cached = loadStatsCache();
414
+ // Auto-fetch if no cache or cache older than 1h
415
+ if (!cached || !cached._ts || (Date.now() - cached._ts > 3600000)) {
416
+ cached = await refreshStatsCache(creds.agent_name).catch(() => null) || cached;
417
+ }
418
+ if (cached && cached.rank) {
416
419
  const medal = cached.rank === 1 ? '🥇' : cached.rank === 2 ? '🥈' : cached.rank === 3 ? '🥉' : `#${cached.rank}`;
417
- console.log(` ${c.dim}${medal} · ${cached.pts} pts · ${cached.reports} reports${cached.official ? ` · ${c.green}Official${c.reset}${c.dim}` : ''}${c.reset}`);
420
+ console.log(` ${c.dim}${medal} of ${cached.total} · ${c.reset}${c.cyan}${cached.pts}${c.reset}${c.dim} pts · ${cached.reports} audits${c.reset}`);
418
421
  }
419
422
  } else {
420
423
  console.log(` ${c.dim}Security scanner for AI tools${c.reset}`);
@@ -1876,7 +1879,7 @@ async function main() {
1876
1879
  }
1877
1880
 
1878
1881
  if (args[0] === '--help' || args[0] === '-h') {
1879
- banner();
1882
+ await banner();
1880
1883
  console.log(` ${c.bold}USAGE${c.reset}`);
1881
1884
  console.log(` ${c.cyan}agentaudit${c.reset} <command> [options]`);
1882
1885
  console.log();
@@ -1924,7 +1927,7 @@ async function main() {
1924
1927
  const command = args.length === 0 ? 'discover' : args[0];
1925
1928
  const targets = args.slice(1);
1926
1929
 
1927
- banner();
1930
+ await banner();
1928
1931
 
1929
1932
  if (command === 'setup') {
1930
1933
  await setupCommand();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentaudit",
3
- "version": "3.9.30",
3
+ "version": "3.9.31",
4
4
  "description": "Security scanner for AI packages — MCP server + CLI",
5
5
  "type": "module",
6
6
  "bin": {