import { StepRequest, StepResponse } from './types'; const ENGINE_URL = 'http://localhost:8000/step'; export async function callEngine(request: StepRequest): Promise { const response = await fetch(ENGINE_URL, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(request), }); if (!response.ok) { throw new Error(`Engine returned ${response.status}`); } return response.json() as Promise; }