@gajae-code/stats 0.2.3 → 0.2.5
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/package.json +3 -3
- package/src/aggregator.ts +1 -1
- package/src/parser.ts +1 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "@gajae-code/stats",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.5",
|
|
5
5
|
"description": "Local observability dashboard for pi AI usage statistics",
|
|
6
6
|
"homepage": "https://gaebal-gajae.dev",
|
|
7
7
|
"author": "Yeachan-Heo",
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
"fmt": "biome format --write ."
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@gajae-code/ai": "0.2.
|
|
41
|
-
"@gajae-code/utils": "0.2.
|
|
40
|
+
"@gajae-code/ai": "0.2.5",
|
|
41
|
+
"@gajae-code/utils": "0.2.5",
|
|
42
42
|
"@tailwindcss/node": "^4.2.4",
|
|
43
43
|
"chart.js": "^4.5.1",
|
|
44
44
|
"date-fns": "^4.1.0",
|
package/src/aggregator.ts
CHANGED
|
@@ -422,7 +422,7 @@ export async function getRequestDetails(id: number): Promise<RequestDetails | nu
|
|
|
422
422
|
if (!msg) return null;
|
|
423
423
|
|
|
424
424
|
const entry = await getSessionEntry(msg.sessionFile, msg.entryId);
|
|
425
|
-
if (
|
|
425
|
+
if (entry?.type !== "message") return null;
|
|
426
426
|
|
|
427
427
|
// TODO: Get parent/context messages?
|
|
428
428
|
// For now we return the single entry which contains the assistant response.
|
package/src/parser.ts
CHANGED
|
@@ -109,7 +109,7 @@ function extractStats(
|
|
|
109
109
|
currentServiceTier: ServiceTier | undefined,
|
|
110
110
|
): MessageStats | null {
|
|
111
111
|
const msg = entry.message as AssistantMessage;
|
|
112
|
-
if (
|
|
112
|
+
if (msg?.role !== "assistant") return null;
|
|
113
113
|
|
|
114
114
|
// Backfill: when the session recorded `priority` as the active service tier
|
|
115
115
|
// at this point but the AI usage payload was captured before priority
|