{
  "workflow_id": "system-diagnostics",
  "description": "Performs system port probe check, checks for active AI servers, and outputs a diagnostic brief.",
  "tasks": [
    {
      "id": "probe_ports",
      "trigger": "manual",
      "action_type": "http_request",
      "target": "http://localhost:8990/vibra/discovery",
      "payload": {
        "method": "GET"
      },
      "next": "ai_diagnose_system"
    },
    {
      "id": "ai_diagnose_system",
      "trigger": "after:probe_ports",
      "action_type": "ai_call",
      "target": "local",
      "payload": {
        "model": "llama3.2:3b",
        "system": "You are a systems engineer. Look at the local discovery JSON payload and summarize active systems and client integrations in plain English.",
        "prompt": "Here is the local system discovery scan data:\n\n{{prev_output}}\n\nCheck if local servers like Ollama or LM Studio are online. Check which IDE integrations are active. Write a 1-page health report in markdown."
      },
      "next": "save_health_report"
    },
    {
      "id": "save_health_report",
      "trigger": "after:ai_diagnose_system",
      "action_type": "file_op",
      "target": "{{desktop_dir}}\\system_diagnostic_brief.md",
      "payload": {
        "operation": "write",
        "content": "# \ud83d\udee0\ufe0f Local AI Environment Diagnostics\n*Generated by Vibe Engine System Scanner*\n\n{{prev_output}}"
      },
      "next": "notify_done"
    },
    {
      "id": "notify_done",
      "trigger": "after:save_health_report",
      "action_type": "notify",
      "target": "stdout",
      "payload": {
        "message": "\u2713 System Diagnostics Brief saved to Desktop: system_diagnostic_brief.md"
      }
    }
  ]
}
