@kenhkl/agent-moss 0.12.2 → 0.12.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/dist/cli.js +10 -3
- package/dist/cli.js.map +1 -1
- package/dist/engine/coordinator.js +8 -2
- package/dist/engine/coordinator.js.map +1 -1
- package/dist/server.js +10 -3
- package/dist/server.js.map +1 -1
- package/dist/static/index.html +119 -28
- package/package.json +1 -1
|
@@ -2773,6 +2773,7 @@ var init_heuristic = __esm({
|
|
|
2773
2773
|
var token_stats_exports = {};
|
|
2774
2774
|
__export(token_stats_exports, {
|
|
2775
2775
|
getRecentRecords: () => getRecentRecords,
|
|
2776
|
+
getRecentRecordsCount: () => getRecentRecordsCount,
|
|
2776
2777
|
getTokenStats: () => getTokenStats,
|
|
2777
2778
|
getTokenTrend: () => getTokenTrend,
|
|
2778
2779
|
recordTokenUsage: () => recordTokenUsage,
|
|
@@ -2893,9 +2894,14 @@ function getTokenStats(days = 0, startDate, endDate) {
|
|
|
2893
2894
|
by_date: a.byDate
|
|
2894
2895
|
};
|
|
2895
2896
|
}
|
|
2896
|
-
function getRecentRecords(limit = 20) {
|
|
2897
|
+
function getRecentRecords(limit = 20, offset = 0) {
|
|
2897
2898
|
const records = loadAllRecords(getStatsPath());
|
|
2898
|
-
|
|
2899
|
+
const start = Math.max(0, records.length - offset - limit);
|
|
2900
|
+
const end = records.length - offset;
|
|
2901
|
+
return records.slice(start, end);
|
|
2902
|
+
}
|
|
2903
|
+
function getRecentRecordsCount() {
|
|
2904
|
+
return loadAllRecords(getStatsPath()).length;
|
|
2899
2905
|
}
|
|
2900
2906
|
function getTokenTrend(days = 0, startDate, endDate) {
|
|
2901
2907
|
const records = filterByDate(loadAllRecords(getStatsPath()), days, startDate, endDate);
|