import { defineHandler } from '@kb-labs/sdk';
import { loadLastRun, groupErrors } from '@kb-labs/qa-core';

// src/rest/handlers/error-groups-handler.ts
var error_groups_handler_default = defineHandler({
  async execute(ctx, _input) {
    const lastRun = loadLastRun(ctx.cwd);
    if (!lastRun) {
      return { groups: [], ungrouped: 0 };
    }
    return groupErrors(lastRun.results);
  }
});

export { error_groups_handler_default as default };
//# sourceMappingURL=error-groups-handler.js.map
//# sourceMappingURL=error-groups-handler.js.map