Spaces:
Build error
Build error
David Prince
fix: add all missing local module stubs (remote_mcp_registry, mcp_auth, mcp_transport, etc)
cce8120 | set -euo pipefail | |
| mkdir -p components/build | |
| cat > components/build/BuildCenter.jsx <<'EOC' | |
| "use client"; | |
| import { useEffect, useState } from "react"; | |
| const API = | |
| process.env.NEXT_PUBLIC_API_URL || | |
| "http://127.0.0.1:8000"; | |
| export default function BuildCenter() { | |
| const [jobs, setJobs] = useState([]); | |
| const [loading, setLoading] = useState(false); | |
| async function refresh() { | |
| setLoading(true); | |
| try { | |
| const r = await fetch(API + "/api/builds"); | |
| const d = await r.json(); | |
| setJobs(Array.isArray(d) ? d : (d.jobs || [])); | |
| } catch { | |
| setJobs([]); | |
| } | |
| setLoading(false); | |
| } | |
| useEffect(() => { | |
| refresh(); | |
| const timer = setInterval(refresh, 5000); | |
| return () => clearInterval(timer); | |
| }, []); | |
| async function build(target) { | |
| await fetch(API + "/api/builds/start", { | |
| method: "POST", | |
| headers: { | |
| "Content-Type": "application/json" | |
| }, | |
| body: JSON.stringify({ | |
| target | |
| }) | |
| }); | |
| refresh(); | |
| } | |
| return ( | |
| <div className="flex flex-col h-full bg-slate-950 text-white"> | |
| <div className="flex gap-2 border-b border-slate-800 p-3"> | |
| <button | |
| onClick={() => build("web")} | |
| className="rounded bg-blue-600 px-4 py-2"> | |
| Build Web | |
| </button> | |
| <button | |
| onClick={() => build("android")} | |
| className="rounded bg-emerald-600 px-4 py-2"> | |
| Build APK | |
| </button> | |
| <button | |
| onClick={refresh} | |
| className="rounded bg-slate-700 px-4 py-2"> | |
| Refresh | |
| </button> | |
| </div> | |
| <div className="flex-1 overflow-auto"> | |
| {loading && ( | |
| <div className="p-4"> | |
| Loading... | |
| </div> | |
| )} | |
| {jobs.map(job => ( | |
| <div | |
| key={job.id} | |
| className="border-b border-slate-800 p-4"> | |
| <div className="font-semibold"> | |
| {job.id} | |
| </div> | |
| <div> | |
| {job.status} | |
| </div> | |
| <div> | |
| {job.target} | |
| </div> | |
| </div> | |
| ))} | |
| </div> | |
| </div> | |
| ); | |
| } | |
| EOC | |
| cat > components/build/index.js <<'EOC' | |
| export { default } from "./BuildCenter"; | |
| EOC | |
| echo "[1/3] Verify..." | |
| test -f components/build/BuildCenter.jsx | |
| test -f components/build/index.js | |
| echo "[2/3] Build Center installed." | |