@oh-my-pi/omp-stats 15.0.1 → 15.0.2
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 +4 -4
- package/src/parser.ts +5 -0
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "@oh-my-pi/omp-stats",
|
|
4
|
-
"version": "15.0.
|
|
4
|
+
"version": "15.0.2",
|
|
5
5
|
"description": "Local observability dashboard for pi AI usage statistics",
|
|
6
|
-
"homepage": "https://
|
|
6
|
+
"homepage": "https://omp.sh",
|
|
7
7
|
"author": "Can Boluk",
|
|
8
8
|
"license": "MIT",
|
|
9
9
|
"repository": {
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
"fmt": "biome format --write ."
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@oh-my-pi/pi-ai": "15.0.
|
|
41
|
-
"@oh-my-pi/pi-utils": "15.0.
|
|
40
|
+
"@oh-my-pi/pi-ai": "15.0.2",
|
|
41
|
+
"@oh-my-pi/pi-utils": "15.0.2",
|
|
42
42
|
"@tailwindcss/node": "^4.2.4",
|
|
43
43
|
"chart.js": "^4.5.1",
|
|
44
44
|
"date-fns": "^4.1.0",
|
package/src/parser.ts
CHANGED
|
@@ -31,6 +31,10 @@ function extractFolderFromPath(sessionPath: string): string {
|
|
|
31
31
|
function isAssistantMessage(entry: SessionEntry): entry is SessionMessageEntry {
|
|
32
32
|
if (entry.type !== "message") return false;
|
|
33
33
|
const msgEntry = entry as SessionMessageEntry;
|
|
34
|
+
// Legacy sessions (pre-id tracking) recorded message entries without an `id`.
|
|
35
|
+
// They're not linkable and would violate the messages.entry_id NOT NULL
|
|
36
|
+
// constraint, so skip them at the parser boundary.
|
|
37
|
+
if (typeof msgEntry.id !== "string" || msgEntry.id.length === 0) return false;
|
|
34
38
|
return msgEntry.message?.role === "assistant";
|
|
35
39
|
}
|
|
36
40
|
|
|
@@ -40,6 +44,7 @@ function isAssistantMessage(entry: SessionEntry): entry is SessionMessageEntry {
|
|
|
40
44
|
function isUserMessage(entry: SessionEntry): entry is SessionMessageEntry {
|
|
41
45
|
if (entry.type !== "message") return false;
|
|
42
46
|
const msgEntry = entry as SessionMessageEntry;
|
|
47
|
+
if (typeof msgEntry.id !== "string" || msgEntry.id.length === 0) return false;
|
|
43
48
|
return msgEntry.message?.role === "user";
|
|
44
49
|
}
|
|
45
50
|
|