/**
 * Tauri adapter for public plugin external-toolchain diagnostics (#126).
 */

import { invoke } from "@tauri-apps/api/core";

import type { PluginToolchainDiagnostic } from "@/domain";
import type {
  PluginToolchainDiagnosticRequest,
  PluginToolchainGateway,
} from "@/ports";

export class TauriPluginToolchainGateway implements PluginToolchainGateway {
  diagnose(input: PluginToolchainDiagnosticRequest): Promise<PluginToolchainDiagnostic> {
    return invoke<PluginToolchainDiagnostic>("plugin_toolchain_diagnose", { input });
  }
}
