@oh-my-pi/omp-stats 16.2.2 → 16.2.4
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/CHANGELOG.md +6 -0
- package/dist/types/parser.d.ts +4 -3
- package/package.json +4 -4
- package/src/parser.ts +10 -6
package/CHANGELOG.md
CHANGED
package/dist/types/parser.d.ts
CHANGED
|
@@ -4,9 +4,10 @@ import type { AgentType, MessageStats, SessionEntry, UserMessageLink, UserMessag
|
|
|
4
4
|
* directory. Layout: `<sessionsDir>/<project>/<file>.jsonl` is the `main`
|
|
5
5
|
* agent; subagent and advisor transcripts live nested one level deeper inside
|
|
6
6
|
* the session's artifacts dir (`<project>/<session>/<id>.jsonl`,
|
|
7
|
-
* `<project>/<session>/__advisor.jsonl`). Any
|
|
8
|
-
*
|
|
9
|
-
*
|
|
7
|
+
* `<project>/<session>/__advisor.jsonl`). Any advisor transcript
|
|
8
|
+
* (`__advisor.jsonl` or `__advisor.<slug>.jsonl`) — at any depth, including a
|
|
9
|
+
* subagent's own advisor — counts as `advisor`; every other nested transcript
|
|
10
|
+
* is a task `subagent`.
|
|
10
11
|
*/
|
|
11
12
|
export declare function classifyAgentType(sessionPath: string): AgentType;
|
|
12
13
|
/**
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "@oh-my-pi/omp-stats",
|
|
4
|
-
"version": "16.2.
|
|
4
|
+
"version": "16.2.4",
|
|
5
5
|
"description": "Local observability dashboard for pi AI usage statistics",
|
|
6
6
|
"homepage": "https://omp.sh",
|
|
7
7
|
"author": "Can Boluk",
|
|
@@ -39,9 +39,9 @@
|
|
|
39
39
|
"fmt": "biome format --write ."
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@oh-my-pi/pi-ai": "16.2.
|
|
43
|
-
"@oh-my-pi/pi-catalog": "16.2.
|
|
44
|
-
"@oh-my-pi/pi-utils": "16.2.
|
|
42
|
+
"@oh-my-pi/pi-ai": "16.2.4",
|
|
43
|
+
"@oh-my-pi/pi-catalog": "16.2.4",
|
|
44
|
+
"@oh-my-pi/pi-utils": "16.2.4",
|
|
45
45
|
"@tailwindcss/node": "^4.3.0",
|
|
46
46
|
"chart.js": "^4.5.1",
|
|
47
47
|
"date-fns": "^4.4.0",
|
package/src/parser.ts
CHANGED
|
@@ -21,12 +21,16 @@ const ADVISOR_TRANSCRIPT_BASENAME = "__advisor.jsonl";
|
|
|
21
21
|
* directory. Layout: `<sessionsDir>/<project>/<file>.jsonl` is the `main`
|
|
22
22
|
* agent; subagent and advisor transcripts live nested one level deeper inside
|
|
23
23
|
* the session's artifacts dir (`<project>/<session>/<id>.jsonl`,
|
|
24
|
-
* `<project>/<session>/__advisor.jsonl`). Any
|
|
25
|
-
*
|
|
26
|
-
*
|
|
24
|
+
* `<project>/<session>/__advisor.jsonl`). Any advisor transcript
|
|
25
|
+
* (`__advisor.jsonl` or `__advisor.<slug>.jsonl`) — at any depth, including a
|
|
26
|
+
* subagent's own advisor — counts as `advisor`; every other nested transcript
|
|
27
|
+
* is a task `subagent`.
|
|
27
28
|
*/
|
|
28
29
|
export function classifyAgentType(sessionPath: string): AgentType {
|
|
29
|
-
|
|
30
|
+
const base = path.basename(sessionPath);
|
|
31
|
+
if (base === ADVISOR_TRANSCRIPT_BASENAME || (base.startsWith("__advisor.") && base.endsWith(".jsonl"))) {
|
|
32
|
+
return "advisor";
|
|
33
|
+
}
|
|
30
34
|
const rel = path.relative(getSessionsDir(), sessionPath);
|
|
31
35
|
// `<project>/<file>.jsonl` -> 2 segments. Deeper nesting is a subagent.
|
|
32
36
|
return rel.split(path.sep).length <= 2 ? "main" : "subagent";
|
|
@@ -167,8 +171,8 @@ function parseSessionEntriesLenient(bytes: Uint8Array): { entries: SessionEntry[
|
|
|
167
171
|
|
|
168
172
|
while (cursor < bytes.length) {
|
|
169
173
|
const { values, error, read, done } = Bun.JSONL.parseChunk(bytes, cursor, bytes.length);
|
|
170
|
-
|
|
171
|
-
entries.push(
|
|
174
|
+
for (const value of values as SessionEntry[]) {
|
|
175
|
+
entries.push(value);
|
|
172
176
|
}
|
|
173
177
|
|
|
174
178
|
if (error) {
|