Bug
When running aimgr list <pattern> --format=json and no installed resources match the pattern, aimgr returns a plain text message instead of valid JSON.
Steps to Reproduce
aimgr list agent --format=json
Actual Output
No installed resources match pattern 'agent'.
Expected Output
Impact
Any tooling that calls aimgr list --format=json and parses the output as JSON will crash with:
Unexpected token 'N', "No resourc"... is not valid JSON
This breaks setup wizards and scripts that use the JSON output to drive further logic (e.g. package installation flows).
Fix
When --format=json is specified, always return valid JSON — use [] for empty results instead of a human-readable text message.