import type { MetaResponse, RuntimeMode } from "../../shared/api";

import { checkerRegistry } from "../checker/runner";
import { jsonResponse } from "../helpers";

export function handleMeta(mode: RuntimeMode, version: string): Response {
  const response: MetaResponse = {
    checkerTypes: checkerRegistry.supportedTypes,
    version,
  };

  return jsonResponse(response, { mode });
}
