const MAX_ACTIVITY = 100;
export class HookActivityTracker {
    records = [];
    record(event, params) {
        this.records.unshift({
            timestamp: Date.now(),
            path: event.path,
            specific: event.specific,
            pattern: params.pattern,
            hookName: params.hookName ?? '(unnamed)',
            hookType: params.hookType,
            ok: params.result.ok,
            decision: params.result.decision,
            error: params.result.error,
            durationMs: params.durationMs,
            async: params.async,
        });
        if (this.records.length > MAX_ACTIVITY) {
            this.records.length = MAX_ACTIVITY;
        }
    }
    listRecent(limit = 20) {
        return this.records.slice(0, limit);
    }
    clear() {
        this.records.length = 0;
    }
}
