# 磁盘相关意图模板 intents: - intent: check_disk_usage description: 查看主机各分区磁盘使用率 risk_level: READ params: [] implementations: linux: command: "df -h --output=source,size,used,avail,pcent,target" darwin: command: "df -h" windows: command: "Get-PSDrive -PSProvider FileSystem | Select-Object Name,@{N='UsedGB';E={[math]::Round($_.Used/1GB,1)}},@{N='FreeGB';E={[math]::Round($_.Free/1GB,1)}} | ConvertTo-Json" - intent: check_largest_dirs description: 在指定路径下找出占用最大的目录(Top 10) risk_level: READ params: - name: path type: string required: true description: 要扫描的根路径,如 /var implementations: linux: command: "du -h --max-depth=1 {{path}} 2>/dev/null | sort -hr | head -n 10" windows: command: "Get-ChildItem -Path '{{path}}' -Directory | ForEach-Object { [PSCustomObject]@{ Path=$_.FullName; SizeMB=[math]::Round(((Get-ChildItem $_.FullName -Recurse -ErrorAction SilentlyContinue | Measure-Object -Property Length -Sum).Sum)/1MB,1) } } | Sort-Object SizeMB -Descending | Select-Object -First 10 | ConvertTo-Json"