@f5-sales-demo/xcsh-stats 20.2.4 → 20.2.7

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/db.ts +4 -4
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@f5-sales-demo/xcsh-stats",
4
- "version": "20.2.4",
4
+ "version": "20.2.7",
5
5
  "description": "Local observability dashboard for pi AI usage statistics",
6
6
  "homepage": "https://github.com/f5-sales-demo/xcsh",
7
7
  "author": "Can Boluk",
@@ -38,8 +38,8 @@
38
38
  "fmt": "biome format --write ."
39
39
  },
40
40
  "dependencies": {
41
- "@f5-sales-demo/pi-ai": "20.2.4",
42
- "@f5-sales-demo/pi-utils": "20.2.4",
41
+ "@f5-sales-demo/pi-ai": "20.2.7",
42
+ "@f5-sales-demo/pi-utils": "20.2.7",
43
43
  "@tailwindcss/node": "^4.2",
44
44
  "chart.js": "^4.5",
45
45
  "date-fns": "~4.4.0",
package/src/db.ts CHANGED
@@ -456,8 +456,8 @@ function rowToMessageStats(row: any): MessageStats {
456
456
  export function getRecentRequests(limit = 100): MessageStats[] {
457
457
  if (!db) return [];
458
458
  const stmt = db.prepare(`
459
- SELECT * FROM messages
460
- ORDER BY timestamp DESC
459
+ SELECT * FROM messages
460
+ ORDER BY timestamp DESC
461
461
  LIMIT ?
462
462
  `);
463
463
  return (stmt.all(limit) as any[]).map(rowToMessageStats);
@@ -466,9 +466,9 @@ export function getRecentRequests(limit = 100): MessageStats[] {
466
466
  export function getRecentErrors(limit = 100): MessageStats[] {
467
467
  if (!db) return [];
468
468
  const stmt = db.prepare(`
469
- SELECT * FROM messages
469
+ SELECT * FROM messages
470
470
  WHERE stop_reason = 'error'
471
- ORDER BY timestamp DESC
471
+ ORDER BY timestamp DESC
472
472
  LIMIT ?
473
473
  `);
474
474
  return (stmt.all(limit) as any[]).map(rowToMessageStats);