getaimeter 0.1.8 → 0.2.0
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 +5 -2
- package/watcher.js +9 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "getaimeter",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Track your Claude AI usage across CLI, VS Code, and Desktop App. One command to start.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"aimeter": "cli.js"
|
|
@@ -38,5 +38,8 @@
|
|
|
38
38
|
},
|
|
39
39
|
"homepage": "https://getaimeter.com",
|
|
40
40
|
"author": "Alejandro Ceja",
|
|
41
|
-
"preferGlobal": true
|
|
41
|
+
"preferGlobal": true,
|
|
42
|
+
"dependencies": {
|
|
43
|
+
"systray2": "^2.1.4"
|
|
44
|
+
}
|
|
42
45
|
}
|
package/watcher.js
CHANGED
|
@@ -85,6 +85,13 @@ function extractNewUsage(filePath) {
|
|
|
85
85
|
|
|
86
86
|
if (obj.type !== 'assistant' || !obj.message || !obj.message.usage) continue;
|
|
87
87
|
|
|
88
|
+
// Skip synthetic/internal messages
|
|
89
|
+
if (obj.message.model === '<synthetic>') continue;
|
|
90
|
+
|
|
91
|
+
// Skip internal Claude Code background calls (compaction, routing, etc.)
|
|
92
|
+
const model = obj.message.model || '';
|
|
93
|
+
if (model.includes('haiku')) continue;
|
|
94
|
+
|
|
88
95
|
// Check for thinking content blocks (appear in streaming progress messages)
|
|
89
96
|
const contentBlocks = obj.message.content || [];
|
|
90
97
|
for (const block of contentBlocks) {
|
|
@@ -93,12 +100,10 @@ function extractNewUsage(filePath) {
|
|
|
93
100
|
}
|
|
94
101
|
}
|
|
95
102
|
|
|
96
|
-
// Skip streaming progress messages (stop_reason: null = not yet complete)
|
|
97
|
-
|
|
98
|
-
if (obj.message.stop_reason === null || obj.message.stop_reason === undefined) continue;
|
|
103
|
+
// Skip streaming progress messages (stop_reason: null/undefined/missing = not yet complete)
|
|
104
|
+
if (!obj.message.stop_reason) continue;
|
|
99
105
|
|
|
100
106
|
const u = obj.message.usage;
|
|
101
|
-
const model = obj.message.model || 'unknown';
|
|
102
107
|
|
|
103
108
|
// Estimate thinking tokens: ~4 chars per token (conservative estimate)
|
|
104
109
|
// The API doesn't separate thinking_tokens in the JSONL usage field
|