"""Run: python3 check-native-plugins.py <isolated profile directory>.
Copy only synthetic plugin fixtures into an isolated CLI home and print public names.
"""
import json, os, shutil, subprocess, sys, tempfile
with tempfile.TemporaryDirectory() as home:
    shutil.copytree(os.path.join(sys.argv[1], 'config', 'plugins'), os.path.join(home, '.gemini', 'config', 'plugins'))
    result = subprocess.run(['agy', 'plugin', 'list', '--json'], env={**os.environ, 'HOME': home}, capture_output=True, text=True, check=True)
    print('agy ' + subprocess.check_output(['agy', '--version'], text=True).strip())
    for plugin in json.loads(result.stdout):
        print(json.dumps({key: plugin[key] for key in ['name','enabled','skills'] if key in plugin}))
