import { r as readAuditLog } from "./audit-log-DNMY9mUZ.js";
//#region src/core/metrics.ts
function computeAuditMetrics(dataDir) {
	const entries = readAuditLog(dataDir);
	const byTool = {};
	const byActor = {};
	const slugs = /* @__PURE__ */ new Set();
	let systemOps = 0;
	for (const e of entries) {
		byTool[e.tool] = (byTool[e.tool] ?? 0) + 1;
		byActor[e.actor] = (byActor[e.actor] ?? 0) + 1;
		if (e.slug) slugs.add(e.slug);
		if (e.actor === "system") systemOps++;
	}
	return {
		totalOperations: entries.length,
		byTool,
		byActor,
		customersTouched: slugs.size,
		automationRate: entries.length > 0 ? systemOps / entries.length : 0
	};
}
//#endregion
export { computeAuditMetrics };

//# sourceMappingURL=metrics-DH8wHvya.js.map