"""Export the literal production page without importing/startup or network access.""" import ast, json, sys from pathlib import Path root = Path(sys.argv[1]) tree = ast.parse((root / "backend/app/main.py").read_text()) node = next( n for n in tree.body if isinstance(n, ast.AsyncFunctionDef) and n.name == "minerops_agent_control_page" ) html = next( n.value for n in ast.walk(node) if isinstance(n, ast.Constant) and isinstance(n.value, str) and "" in n.value ) Path(sys.argv[2]).write_text(html)