# 系统资源与进程相关意图 intents: - intent: check_os_info description: 查看操作系统版本与内核信息(用于 facts 探测和人工核对) risk_level: READ params: [] implementations: linux: command: "uname -a && cat /etc/os-release 2>/dev/null || true" darwin: command: "uname -a && sw_vers" windows: command: "Get-CimInstance Win32_OperatingSystem | Select-Object Caption,Version,BuildNumber,OSArchitecture | ConvertTo-Json" - intent: check_memory description: 查看内存使用情况 risk_level: READ params: [] implementations: linux: command: "free -h" darwin: command: "vm_stat" windows: command: "Get-CimInstance Win32_OperatingSystem | Select-Object @{N='TotalGB';E={[math]::Round($_.TotalVisibleMemorySize/1MB,2)}},@{N='FreeGB';E={[math]::Round($_.FreePhysicalMemory/1MB,2)}} | ConvertTo-Json" - intent: top_cpu_processes description: 查看 CPU 占用最高的 N 个进程 risk_level: READ params: - name: top_n type: integer required: false default: 10 implementations: linux: command: "ps -eo pid,user,%cpu,%mem,comm --sort=-%cpu | head -n {{top_n + 1}}" darwin: command: "ps -eo pid,user,%cpu,%mem,comm -r | head -n {{top_n + 1}}" windows: command: "Get-Process | Sort-Object CPU -Descending | Select-Object -First {{top_n}} Id,ProcessName,CPU,WorkingSet | ConvertTo-Json" - intent: check_uptime description: 查看主机已运行时间 risk_level: READ params: [] implementations: linux: command: "uptime" darwin: command: "uptime" windows: command: "(Get-CimInstance Win32_OperatingSystem).LastBootUpTime"