| import streamlit as st | |
| from utils.run_pipeline_and_save import run_pipeline_and_save | |
| from utils.zip_output import zip_output | |
| st.write("App started — enter prompt and click Generate UI") | |
| import os | |
| os.environ["STREAMLIT_BROWSER_GATHER_USAGE_STATS"] = "false" | |
| def main(): | |
| st.set_page_config(page_title="Multi-Agent UI Generator") | |
| st.title("🛠️ Multi-Agent Collaboration System") | |
| prompt = st.text_area("Enter your product idea prompt", height=200) | |
| if st.button("Generate UI"): | |
| if not prompt.strip(): | |
| st.warning("Please enter a prompt.") | |
| else: | |
| with st.spinner("Running agents..."): | |
| conversation, final_output = run_pipeline_and_save(prompt) | |
| st.subheader("Agent Conversation") | |
| for step in conversation: | |
| for role, msg in step.items(): | |
| st.markdown(f"**{role}:**") | |
| st.code(msg.strip(), language="markdown") | |
| zip_path = zip_output() | |
| with open(zip_path, "rb") as f: | |
| st.download_button("Download UI Files (ZIP)", f, file_name="output_bundle.zip") | |
| with open("output/agent_log.json", "rb") as f: | |
| st.download_button("Download Agent Log", f, file_name="agent_log.json") | |
| if __name__ == "__main__": | |
| main() |