import { TEST_CONFIG } from 'playwright.config'

export async function getBackendMode(): Promise<string> {
  const response = await fetch(`${TEST_CONFIG.apiURL}/test/mode`)
  if (!response.ok) {
    throw new Error('Failed to fetch backend mode')
  }
  const data = await response.json()
  return data.mode // Backend returns { mode: "stateful" | "stateless" }
}
