/* HTML Studio → harvis.dev * Runs entirely in the browser. Two APIs, both CORS-open and called directly: * - https://router.huggingface.co/v1 (OpenAI-compatible, needs an HF token) * - https://harvis.dev/api/upload (static hosting, no auth) */ import { oauthLoginUrl, oauthHandleRedirectIfPresent } from "https://esm.sh/@huggingface/hub@2.15.0"; const ROUTER = "https://router.huggingface.co/v1"; const HARVIS = "https://harvis.dev/api/upload"; const LS = { auth: "hs.auth", token: "hs.token", model: "hs.model", site: "hs.site", prompt: "hs.prompt" }; /* Models the router serves that are strong at writing a whole page in one * shot. Anything else on the router is still selectable below this group. */ const RECOMMENDED = [ "Qwen/Qwen3-Coder-Next", "moonshotai/Kimi-K2.7-Code", "zai-org/GLM-5.2", "deepseek-ai/DeepSeek-V4-Flash", "openai/gpt-oss-120b", "Qwen/Qwen3-Coder-30B-A3B-Instruct", "MiniMaxAI/MiniMax-M3", "google/gemma-4-31B-it", ]; const DEFAULT_SYSTEM = `You are an expert front-end engineer with a strong sense of visual design. Return ONE complete, self-contained HTML document and NOTHING else. Rules: - Start with . Include ,
with and a responsive viewport meta,