Files
loki/scripts
g-butandClaude Sonnet 4.6 b5d9263b26 feat(control): local→cloud state push — daemon heartbeat keeps Vercel in sync
- Add agentRunning, activeAgents, lockAt columns to project_states schema
- New POST /api/control/runtime-state endpoint (daemon bearer auth)
  accepts per-project runtime patches and upserts to DB
- control/route.ts: use DB agentRunning/activeAgents/currentPrompt
  when isRuntimeAvailable()=false (Vercel sees live fleet state)
- stream/route.ts: DB polling path when !isRuntimeAvailable()
  maps project_states rows → FastProjectState for SSE clients
- cockpit-daemon.sh: _push_loop runs in background every 2s,
  reads /proc + /tmp sentinels + current-prompt files and pushes
  all 7 tab states to the new endpoint

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-15 12:46:34 +02:00
..