Phase 4: Vision Protocol — screenshot + Claude vision

- reactor.py: v4.0.0; adds screenshot, vision, sysinfo handlers;
  _dispatch_agent_command() shared helper; FastAPI /screenshots endpoints
- jarvis-agent.py: v3.0; screenshot command handler (scrot/import/fbcat/
  ImageMagick render fallback); sysinfo command returns structured snapshot;
  detect_capabilities() advertises screenshot + sysinfo caps
- chat.php: Tier 0.9c detects screenshot (show screen on X, screenshot X)
  and sysinfo (check status of X) voice/text commands
- arc.php: screenshots, screenshot_get, screenshot_delete actions
- index.html: VISION PROTOCOL lightbox overlay; SCREENSHOT + SYSINFO
  buttons on each online agent card; keyboard Escape to close
- admin/index.php: VISION PROTOCOL tab under ARC REACTOR nav; gallery view
  with image thumbnails + analysis; take screenshot modal; purge action
This commit is contained in:
2026-06-11 04:42:21 +00:00
parent 068aff27b4
commit 56c9e2d914
5 changed files with 576 additions and 3 deletions
+25
View File
@@ -154,6 +154,31 @@ switch ($action) {
echo json_encode(['ok' => true, 'id' => $id, 'action_taken' => $actionTaken]);
break;
// GET /api/arc?action=screenshots&limit=20&agent=hostname
case 'screenshots':
$limit = min((int)($_GET['limit'] ?? 20), 100);
$agent = $_GET['agent'] ?? '';
$url = 'http://127.0.0.1:7474/screenshots?' . http_build_query(array_filter(['limit' => $limit, 'agent' => $agent]));
$ch = curl_init($url);
curl_setopt_array($ch, [CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 5]);
$raw = curl_exec($ch); curl_close($ch);
echo $raw ?: '[]';
break;
// GET /api/arc?action=screenshot_get&id=123
case 'screenshot_get':
$id = (int)($_GET['id'] ?? 0);
if (!$id) { http_response_code(400); echo json_encode(['error' => 'Missing id']); break; }
echo json_encode(arc_request('GET', "/screenshots/{$id}"));
break;
// DELETE /api/arc?action=screenshot_delete&id=123
case 'screenshot_delete':
$id = (int)($_GET['id'] ?? 0);
if (!$id) { http_response_code(400); echo json_encode(['error' => 'Missing id']); break; }
echo json_encode(arc_request('DELETE', "/screenshots/{$id}"));
break;
default:
http_response_code(404);
echo json_encode(['error' => "Unknown arc action: {$action}"]);