The AI Builder
Flowork's AI Builder is an autonomous code generation system that can create entire applications from natural language prompts.
How It Works
1. User opens AI Builder via --ai-builder flag or UI button
2. A separate Electron window loads ai-builder.html
3. User describes what they want to build
4. Mother AI generates code using 67 available tools
5. Files are written via /api/ai-write
6. AI can test, debug, and iterate autonomously
67 Tools
The AI has access to tools across these categories:
- File I/O: write_files, read_files, search_files, rename_file
- Terminal: exec, terminal_start, terminal_status, terminal_input, terminal_kill
- Browser: capture_browser, execute_browser_script, open_ai_tab, list_browsers
- Git: init, status, diff, add, commit, revert, rollback
- Knowledge: save_knowledge, recall_knowledge, list_knowledge
- Code Analysis: analyze_code, dependency_graph, load_project_context
- Workflows: create_workflow, execute_workflow, list_workflows
- System: navigate_flowork, list_installed_apps, open_app, generate_icon
Self-Healing
The AI catches its own crashes:
process.on("uncaughtException", (err) => {
global.broadcastToAi({ type: "CRASH_REPORT", data: err.stack });
});
Crash reports are broadcast via WebSocket to the AI, which can analyze the error and attempt a fix.