aics / agent /coder.py
akborana4's picture
Create agent/coder.py
06a2cae verified
raw
history blame contribute delete
493 Bytes
from agent.file_ops import write
def coder(plan, ws):
write(f"{ws}/index.html",
"""<!doctype html>
<div id="root"></div>
<script type="module" src="/src/main.jsx"></script>
""")
write(f"{ws}/src/main.jsx",
"""import React from "react";
import { createRoot } from "react-dom/client";
import App from "./App";
createRoot(document.getElementById("root")).render(<App />);
""")
write(f"{ws}/src/App.jsx",
f"""export default function App() {{
return <h1>{plan['goal']}</h1>
}}
""")