@chrysb/alphaclaw 0.6.2-beta.0 → 0.6.2-beta.1

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.
@@ -484,15 +484,18 @@
484
484
  }
485
485
 
486
486
  .cron-runs-trend-segment-ok {
487
- background: rgba(34, 197, 94, 0.75);
487
+ background: rgba(34, 255, 170, 0.82);
488
+ box-shadow: inset 0 0 0 1px rgba(34, 255, 170, 0.28), 0 0 8px rgba(34, 255, 170, 0.24);
488
489
  }
489
490
 
490
491
  .cron-runs-trend-segment-error {
491
- background: rgba(239, 68, 68, 0.78);
492
+ background: rgba(255, 74, 138, 0.84);
493
+ box-shadow: inset 0 0 0 1px rgba(255, 74, 138, 0.32), 0 0 8px rgba(255, 74, 138, 0.24);
492
494
  }
493
495
 
494
496
  .cron-runs-trend-segment-skipped {
495
- background: rgba(250, 204, 21, 0.7);
497
+ background: rgba(255, 214, 64, 0.82);
498
+ box-shadow: inset 0 0 0 1px rgba(255, 214, 64, 0.28), 0 0 8px rgba(255, 214, 64, 0.22);
496
499
  }
497
500
 
498
501
  .cron-runs-trend-label {
@@ -523,13 +526,16 @@
523
526
  }
524
527
 
525
528
  .cron-runs-trend-legend-dot.is-ok {
526
- background: rgba(34, 197, 94, 0.95);
529
+ background: rgba(34, 255, 170, 0.98);
530
+ box-shadow: 0 0 8px rgba(34, 255, 170, 0.6);
527
531
  }
528
532
 
529
533
  .cron-runs-trend-legend-dot.is-error {
530
- background: rgba(239, 68, 68, 0.95);
534
+ background: rgba(255, 74, 138, 0.98);
535
+ box-shadow: 0 0 8px rgba(255, 74, 138, 0.58);
531
536
  }
532
537
 
533
538
  .cron-runs-trend-legend-dot.is-skipped {
534
- background: rgba(250, 204, 21, 0.95);
539
+ background: rgba(255, 214, 64, 0.98);
540
+ box-shadow: 0 0 8px rgba(255, 214, 64, 0.5);
535
541
  }
@@ -50,7 +50,14 @@ const getSessionUsageByKeyPattern = ({ keyPattern = "", sinceMs = 0 } = {}) => {
50
50
  COALESCE(model, '') AS model,
51
51
  COALESCE(provider, '') AS provider,
52
52
  COUNT(*) AS event_count,
53
- COUNT(DISTINCT COALESCE(NULLIF(session_key, ''), NULLIF(session_id, ''))) AS run_count,
53
+ COUNT(
54
+ DISTINCT COALESCE(
55
+ NULLIF(run_id, ''),
56
+ NULLIF(session_key, ''),
57
+ NULLIF(session_id, ''),
58
+ printf('event:%d', id)
59
+ )
60
+ ) AS run_count,
54
61
  SUM(COALESCE(input_tokens, 0)) AS input_tokens,
55
62
  SUM(COALESCE(output_tokens, 0)) AS output_tokens,
56
63
  SUM(COALESCE(cache_read_tokens, 0)) AS cache_read_tokens,
@@ -67,6 +74,28 @@ const getSessionUsageByKeyPattern = ({ keyPattern = "", sinceMs = 0 } = {}) => {
67
74
  $keyPattern: normalizedPattern,
68
75
  $sinceMs: Number.isFinite(Number(sinceMs)) ? Number(sinceMs) : 0,
69
76
  });
77
+ const totalsRow = database
78
+ .prepare(
79
+ `
80
+ SELECT
81
+ COUNT(*) AS event_count,
82
+ COUNT(
83
+ DISTINCT COALESCE(
84
+ NULLIF(run_id, ''),
85
+ NULLIF(session_key, ''),
86
+ NULLIF(session_id, ''),
87
+ printf('event:%d', id)
88
+ )
89
+ ) AS run_count
90
+ FROM usage_events
91
+ WHERE session_key LIKE $keyPattern
92
+ AND ($sinceMs <= 0 OR timestamp >= $sinceMs)
93
+ `,
94
+ )
95
+ .get({
96
+ $keyPattern: normalizedPattern,
97
+ $sinceMs: Number.isFinite(Number(sinceMs)) ? Number(sinceMs) : 0,
98
+ }) || {};
70
99
  const modelBreakdown = rows.map((row) => {
71
100
  const inputTokens = Number(row.input_tokens || 0);
72
101
  const outputTokens = Number(row.output_tokens || 0);
@@ -118,6 +147,8 @@ const getSessionUsageByKeyPattern = ({ keyPattern = "", sinceMs = 0 } = {}) => {
118
147
  runCount: 0,
119
148
  },
120
149
  );
150
+ totals.eventCount = Number(totalsRow.event_count || totals.eventCount || 0);
151
+ totals.runCount = Number(totalsRow.run_count || 0);
121
152
 
122
153
  return { totals, modelBreakdown };
123
154
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chrysb/alphaclaw",
3
- "version": "0.6.2-beta.0",
3
+ "version": "0.6.2-beta.1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },