import { request } from '../client' export interface GatewayStatus { profile: string port: number host: string url: string running: boolean pid?: number } export async function fetchGateways(): Promise { const res = await request<{ gateways: GatewayStatus[] }>('/api/hermes/gateways') return res.gateways } export async function startGateway(name: string): Promise { const res = await request<{ success: boolean; gateway: GatewayStatus }>(`/api/hermes/gateways/${name}/start`, { method: 'POST' }) return res.gateway } export async function stopGateway(name: string): Promise { await request(`/api/hermes/gateways/${name}/stop`, { method: 'POST' }) } export async function checkGatewayHealth(name: string): Promise { const res = await request<{ gateway: GatewayStatus }>(`/api/hermes/gateways/${name}/health`) return res.gateway }