clawculator 2.2.1 → 2.2.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
CHANGED
|
@@ -528,13 +528,16 @@ function parseTranscript(jsonlPath) {
|
|
|
528
528
|
|
|
529
529
|
// Only assistant messages with usage blocks have cost data
|
|
530
530
|
if (entry.type !== 'message') continue;
|
|
531
|
-
|
|
531
|
+
|
|
532
|
+
// Usage can be at entry.usage (some formats) or entry.message.usage (standard format)
|
|
533
|
+
const u = entry.usage || entry.message?.usage;
|
|
534
|
+
if (!u) continue;
|
|
532
535
|
|
|
533
536
|
messageCount++;
|
|
534
|
-
const u = entry.usage;
|
|
535
537
|
|
|
536
|
-
//
|
|
537
|
-
|
|
538
|
+
// Model can be at entry.model or entry.message.model
|
|
539
|
+
const entryModel = entry.model || entry.message?.model;
|
|
540
|
+
if (entryModel && !model) model = entryModel;
|
|
538
541
|
|
|
539
542
|
input += u.input || 0;
|
|
540
543
|
output += u.output || 0;
|
package/src/analyzer.js
CHANGED
|
@@ -528,13 +528,16 @@ function parseTranscript(jsonlPath) {
|
|
|
528
528
|
|
|
529
529
|
// Only assistant messages with usage blocks have cost data
|
|
530
530
|
if (entry.type !== 'message') continue;
|
|
531
|
-
|
|
531
|
+
|
|
532
|
+
// Usage can be at entry.usage (some formats) or entry.message.usage (standard format)
|
|
533
|
+
const u = entry.usage || entry.message?.usage;
|
|
534
|
+
if (!u) continue;
|
|
532
535
|
|
|
533
536
|
messageCount++;
|
|
534
|
-
const u = entry.usage;
|
|
535
537
|
|
|
536
|
-
//
|
|
537
|
-
|
|
538
|
+
// Model can be at entry.model or entry.message.model
|
|
539
|
+
const entryModel = entry.model || entry.message?.model;
|
|
540
|
+
if (entryModel && !model) model = entryModel;
|
|
538
541
|
|
|
539
542
|
input += u.input || 0;
|
|
540
543
|
output += u.output || 0;
|