@yishiguji/tokenarena 0.14.1 → 0.14.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/dist/index.js +11 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2481,6 +2481,9 @@ function getPathLeaf6(value) {
|
|
|
2481
2481
|
const leaf = normalized.split("/").filter(Boolean).pop();
|
|
2482
2482
|
return leaf || "unknown";
|
|
2483
2483
|
}
|
|
2484
|
+
function isModelPlaceholder(value) {
|
|
2485
|
+
return !value || /^__[^_]+(?:_[^_]+)*__$/.test(value);
|
|
2486
|
+
}
|
|
2484
2487
|
function findWireFiles(baseDir) {
|
|
2485
2488
|
const results = [];
|
|
2486
2489
|
if (!existsSync14(baseDir)) return results;
|
|
@@ -2595,6 +2598,12 @@ var KimiCodeParser = class {
|
|
|
2595
2598
|
} catch {
|
|
2596
2599
|
continue;
|
|
2597
2600
|
}
|
|
2601
|
+
if (obj.type === "llm.request" || obj.type === "model.bind") {
|
|
2602
|
+
if (obj.model && !isModelPlaceholder(obj.model)) {
|
|
2603
|
+
currentModel = obj.model;
|
|
2604
|
+
}
|
|
2605
|
+
continue;
|
|
2606
|
+
}
|
|
2598
2607
|
if (obj.type === "usage.record") {
|
|
2599
2608
|
const timestampValue2 = obj.time;
|
|
2600
2609
|
const timestamp2 = timestampValue2 ? new Date(timestampValue2) : null;
|
|
@@ -2618,10 +2627,11 @@ var KimiCodeParser = class {
|
|
|
2618
2627
|
timestamp: timestamp2,
|
|
2619
2628
|
role: "assistant"
|
|
2620
2629
|
});
|
|
2630
|
+
const model = obj.model && !isModelPlaceholder(obj.model) ? obj.model : currentModel;
|
|
2621
2631
|
entries.push({
|
|
2622
2632
|
sessionId,
|
|
2623
2633
|
source: TOOL_ID9,
|
|
2624
|
-
model
|
|
2634
|
+
model,
|
|
2625
2635
|
project,
|
|
2626
2636
|
timestamp: timestamp2,
|
|
2627
2637
|
inputTokens: inputTokens2,
|