This system provides a real-time task tree visualization with WebSocket communication between a Python backend and Next.js frontend.
- Next.js 13+ application with React components
- WebSocket client that connects to the Python backend
- Real-time visualization of hierarchical task trees
- Interactive UI with collapsible task details
- Python WebSocket server for broadcasting task updates
- AI-powered task decomposition using DeepSeek API
- Real-time task execution with status updates
- Enhanced task attributes (atomic, commands, human instructions)
# Run the demo with sample data
.\start_demo.ps1This will:
- Start the Next.js frontend on
http://localhost:3000 - Start the WebSocket server on
ws://localhost:8000with sample data - Simulate task execution with status updates
# Terminal 1: Start the frontend
cd task-tree-visualizer
npm install
npm run dev
# Terminal 2: Start the AI daemon
cd v0x1
python 0x1daemon.pyEach task now supports:
chatresponse: AI-generated comments about the taskatomic: Boolean indicating if task is executablecommand: Shell command for atomic taskssubtasks: List of subtask descriptionshuman_needed: Boolean for human intervention requirementshuman_instructions: List of instructions for human users
- Collapsible details: Atomic tasks can be expanded to show commands and responses
- Visual indicators: Color-coded status for execution states
- Human intervention alerts: Special highlighting for tasks requiring human input
- Real-time updates: Live WebSocket connection for instant status updates
task-tree-visualizer/ # Next.js Frontend
├── src/app/page.tsx # Main visualization component
├── package.json # Frontend dependencies
└── ...
v0x1/ # Python Backend
├── 0x1daemon.py # Main AI daemon with WebSocket
├── websocketserver.py # Standalone WebSocket server
├── test_websocket.py # Demo script with sample data
├── task.txt # Input task description
└── ...
start_demo.ps1 # Quick start script
{
"task": "Task name",
"parent": true/false,
"leaf": true/false,
"level": 0,
"executionStarted": true/false,
"executionSuccess": true/false,
"subTasks": [...],
"chatresponse": "AI response",
"atomic": true/false,
"command": "shell command",
"subtasks": ["sub1", "sub2"],
"human_needed": true/false,
"human_instructions": ["instruction1", "instruction2"]
}- URL:
ws://localhost:8000/ws - Protocol: JSON messages
- Updates: Real-time tree state broadcasts
Edit v0x1/task.txt:
Create a simple HTML website with a contact form
Build a REST API with authentication, database integration, and documentation
Set up a React application with TypeScript, routing, and testing framework
- Ensure Node.js is installed:
node --version - Install dependencies:
npm install - Check port 3000 is available
- Install Python dependencies:
pip install websockets openai python-dotenv - Set DeepSeek API key in
.envfile - Check port 8000 is available
- Verify WebSocket server is running on port 8000
- Check browser console for connection errors
- Ensure firewall allows localhost connections
- Update the
Nodeclass in both0x1daemon.pyandwebsocketserver.py - Modify the
to_dict()method to include new attributes - Update the frontend
Nodeinterface inpage.tsx - Add visualization for new attributes in the
TaskNodecomponent
- Edit
systemPrompt.pyto modify AI behavior - Adjust the JSON response format in
getSubTaskList() - Update task classification logic in
fillTreeWithTasks()
Create a .env file in the v0x1/ directory:
DEEPSEEK_API_KEY=your_api_key_here
Get your API key from DeepSeek Platform.