@gajae-code/stats 0.18.11 → 0.18.12

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/package.json +3 -3
  2. package/src/index.ts +6 -4
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@gajae-code/stats",
4
- "version": "0.18.11",
4
+ "version": "0.18.12",
5
5
  "description": "Local observability dashboard for pi AI usage statistics",
6
6
  "homepage": "https://gajae-code.com",
7
7
  "author": "Yeachan-Heo",
@@ -38,8 +38,8 @@
38
38
  "fmt": "biome format --write ."
39
39
  },
40
40
  "dependencies": {
41
- "@gajae-code/ai": "0.18.11",
42
- "@gajae-code/utils": "0.18.11",
41
+ "@gajae-code/ai": "0.18.12",
42
+ "@gajae-code/utils": "0.18.12",
43
43
  "@tailwindcss/node": "^4.2.4",
44
44
  "chart.js": "^4.5.1",
45
45
  "date-fns": "^4.1.0",
package/src/index.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env bun
2
2
 
3
3
  import { parseArgs } from "node:util";
4
- import { formatDuration, formatNumber, formatPercent } from "@gajae-code/utils";
4
+ import { formatDuration, formatNumber, formatPercent, sanitizeDisplayLine } from "@gajae-code/utils";
5
5
  import { getDashboardStats, getTotalMessageCount, syncAllSessions } from "./aggregator";
6
6
  import { closeDb } from "./db";
7
7
  import { startServer } from "./server";
@@ -81,7 +81,7 @@ async function printStats(): Promise<void> {
81
81
  console.log("\nBy Model:");
82
82
  for (const m of byModel.slice(0, 10)) {
83
83
  console.log(
84
- ` ${m.model}: ${formatNumber(m.totalRequests)} reqs, ${formatCost(m.totalCost)}, ${formatPercent(m.cacheRate)} cache`,
84
+ ` ${sanitizeDisplayLine(m.model)}: ${formatNumber(m.totalRequests)} reqs, ${formatCost(m.totalCost)}, ${formatPercent(m.cacheRate)} cache`,
85
85
  );
86
86
  }
87
87
  }
@@ -90,7 +90,7 @@ async function printStats(): Promise<void> {
90
90
  console.log("\nBy Agent Role:");
91
91
  for (const agent of byAgent) {
92
92
  console.log(
93
- ` ${agent.agent}: ${formatNumber(agent.totalRequests)} reqs, ${formatNumber(agent.totalInputTokens)} input / ${formatNumber(agent.totalOutputTokens)} output, ${formatPercent(agent.cacheRate)} cache, ${formatCost(agent.totalCost)}`,
93
+ ` ${sanitizeDisplayLine(agent.agent)}: ${formatNumber(agent.totalRequests)} reqs, ${formatNumber(agent.totalInputTokens)} input / ${formatNumber(agent.totalOutputTokens)} output, ${formatPercent(agent.cacheRate)} cache, ${formatCost(agent.totalCost)}`,
94
94
  );
95
95
  }
96
96
  }
@@ -98,7 +98,9 @@ async function printStats(): Promise<void> {
98
98
  if (byFolder.length > 0) {
99
99
  console.log("\nBy Folder:");
100
100
  for (const f of byFolder.slice(0, 10)) {
101
- console.log(` ${f.folder}: ${formatNumber(f.totalRequests)} reqs, ${formatCost(f.totalCost)}`);
101
+ console.log(
102
+ ` ${sanitizeDisplayLine(f.folder)}: ${formatNumber(f.totalRequests)} reqs, ${formatCost(f.totalCost)}`,
103
+ );
102
104
  }
103
105
  }
104
106