package ai.decompile.engine.controller;

import ai.decompile.engine.model.dto.EngineResponse;
import ai.decompile.engine.service.EngineDiscoveryService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import java.util.List;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@Tag(name = "Engine", description = "Static analysis engine discovery")
@RestController
@RequiredArgsConstructor
public class EngineController {
  private final EngineDiscoveryService engineDiscoveryService;

  @Operation(
      summary = "List available analysis engines",
      description =
          "Retrieve all registered static analysis engines with their availability status.",
      tags = {"Engine"},
      operationId = "listEngines")
  @GetMapping("/engines")
  public List<EngineResponse> listEngines() {
    return engineDiscoveryService.listEngines();
  }
}
