#!/bin/bash
# Start the dashboard/kanban server in background
cd /home/isthekid/.openclaw/workspace
nohup python3 serve.py > /tmp/workspace-server.log 2>&1 &
echo $! > /tmp/workspace-server.pid
sleep 1
if ps -p $(cat /tmp/workspace-server.pid) > /dev/null 2>&1; then
  echo "✓ Server started (PID $(cat /tmp/workspace-server.pid))"
  echo "  Dashboard: http://localhost:8080/dashboard/"
  echo "  Kanban:    http://localhost:8080/kanban/"
  echo "  Logs:      tail -f /tmp/workspace-server.log"
else
  echo "❌ Server failed to start. Check /tmp/workspace-server.log"
  cat /tmp/workspace-server.log
  rm /tmp/workspace-server.pid
  exit 1
fi
