// Generated from openapi/openapi.json. Do not edit by hand.

export interface ClientOptions { baseUrl?: string; fetch?: typeof globalThis.fetch; headers?: HeadersInit; }

export async function checkBrowserSupport(body: {
  "brands": Array<{
  "brand": string;
  "version": string;
}>;
  "full_version_list": Array<{
  "brand": string;
  "version": string;
}>;
  "platform": string;
}, options: ClientOptions = {}): Promise<{
  "app_version": string;
  "browser": {
  "brand": "Google Chrome" | "Microsoft Edge";
  "major": number;
};
  "status": "supported";
  "supported_browsers": Array<{
  "brand": "Google Chrome" | "Microsoft Edge";
  "major": number;
}>;
}> {
  const request = options.fetch ?? globalThis.fetch;
  const headers = new Headers(options.headers);
  headers.set("Content-Type", "application/json");
  const response = await request(`${options.baseUrl ?? ""}/api/v1/support/check`, { body: JSON.stringify(body), method: "POST", headers });
  if (!response.ok) throw new Error(`HTTP ${response.status}`);
  return response.json() as Promise<{
  "app_version": string;
  "browser": {
  "brand": "Google Chrome" | "Microsoft Edge";
  "major": number;
};
  "status": "supported";
  "supported_browsers": Array<{
  "brand": "Google Chrome" | "Microsoft Edge";
  "major": number;
}>;
}>;
}

export async function getBootstrap(options: ClientOptions = {}): Promise<{
  "app_version": string;
  "dependencies": Array<{
  "service_id": string;
  "status": "available" | "paused" | "degraded" | "unavailable";
}>;
  "model_summary": {
  "config_set_version": number | null;
  "configured_default_model_id": string | null;
  "recommended_model_id": string | null;
  "runtime_availability_version": number | null;
};
  "public_features": Array<{
  "feature_id": string;
  "status": "enabled" | "disabled" | "paused";
}>;
}> {
  const request = options.fetch ?? globalThis.fetch;
  const response = await request(`${options.baseUrl ?? ""}/api/v1/bootstrap`, { method: "GET", headers: options.headers ?? {} });
  if (!response.ok) throw new Error(`HTTP ${response.status}`);
  return response.json() as Promise<{
  "app_version": string;
  "dependencies": Array<{
  "service_id": string;
  "status": "available" | "paused" | "degraded" | "unavailable";
}>;
  "model_summary": {
  "config_set_version": number | null;
  "configured_default_model_id": string | null;
  "recommended_model_id": string | null;
  "runtime_availability_version": number | null;
};
  "public_features": Array<{
  "feature_id": string;
  "status": "enabled" | "disabled" | "paused";
}>;
}>;
}

export function getEvents(options: Pick<ClientOptions, "baseUrl"> = {}): string {
  return `${options.baseUrl ?? ""}/api/v1/events`;
}
