import type { RuntimeConfig } from "../../types/system";

const API_BASE_URL = "http://localhost:18450";

export async function fetchRuntimeConfig(): Promise<RuntimeConfig> {
  const response = await fetch(`${API_BASE_URL}/api/system/runtime-config`);

  if (!response.ok) {
    throw new Error("Failed to fetch runtime config.");
  }

  return response.json() as Promise<RuntimeConfig>;
}