Revert "feat: 新增 Skills Usage 监控统计与图表 (#668)" (#670)

This reverts commit ce08d2b05a.
This commit is contained in:
ekko
2026-05-13 07:51:29 +08:00
committed by GitHub
parent ce08d2b05a
commit 91de3b12a1
19 changed files with 3 additions and 1662 deletions
@@ -6,7 +6,6 @@ import {
safeReadFile, extractDescription, listFilesRecursive, getHermesDir,
} from '../../services/config-helpers'
import { pinSkill } from '../../services/hermes/hermes-cli'
import { getSkillUsageStatsFromDb } from '../../db/hermes/sessions-db'
/** Read bundled manifest as a name→hash map from ~/.hermes/skills/.bundled_manifest */
function readBundledManifest(manifestContent: string | null): Map<string, string> {
@@ -240,18 +239,6 @@ export async function list(ctx: any) {
}
}
export async function usageStats(ctx: any) {
const rawDays = parseInt(String(ctx.query?.days ?? '7'), 10)
const days = Number.isFinite(rawDays) && rawDays > 0 ? Math.min(rawDays, 365) : 7
try {
ctx.body = await getSkillUsageStatsFromDb(days)
} catch (err: any) {
ctx.status = 500
ctx.body = { error: `Failed to read skill usage stats: ${err.message}` }
}
}
export async function toggle(ctx: any) {
const { name, enabled } = ctx.request.body as { name?: string; enabled?: boolean }
if (!name || typeof enabled !== 'boolean') {