/**
 * Amazon Q Adapter
 */
import * as path from 'path';
import * as fs from '../../utils/fs-native.js';
import { AdapterBase } from '../adapter-base.js';
export class AmazonQAdapter extends AdapterBase {
    constructor() {
        super(...arguments);
        this.name = 'amazonq';
        this.description = 'Amazon Q adapter — skills installed in .amazonq/skills/';
        this.automationLevel = 'semi';
    }
    async detect() {
        return await this.fileExists('.amazonq') || await this.commandExists('q');
    }
    getFiles() {
        return [];
    }
    async install(options) {
        console.log('\n📦 Installing Amazon Q Adapter\n');
        await fs.ensureDir(path.join(options.projectPath, '.amazonq/skills'));
        console.log('\n✨ Amazon Q adapter installed!');
        console.log('   Run `specweave refresh-plugins` to install skills.');
    }
    supportsPlugins() {
        return true;
    }
    getSkillsDirectory() {
        return '.amazonq/skills';
    }
    async compilePlugin(plugin) {
        const skillsDir = '.amazonq/skills';
        console.log(`\n📦 Installing plugin skills for Amazon Q: ${plugin.manifest.name}`);
        await this.writeSkillFiles(plugin, skillsDir);
        console.log(`   ✓ ${plugin.skills.length} skill(s) written to ${skillsDir}/`);
        console.log(`\n✅ Plugin ${plugin.manifest.name} installed for Amazon Q!`);
    }
    async unloadPlugin(pluginName) {
        console.log(`\n🗑️  Unloading plugin from Amazon Q: ${pluginName}`);
        await this.removeSkillFiles(pluginName, '.amazonq/skills');
        console.log(`   ✓ Removed from .amazonq/skills/`);
        console.log(`\n✅ Plugin ${pluginName} unloaded!`);
    }
    async getInstalledPlugins() {
        return await this.listInstalledPluginsInDir('.amazonq/skills');
    }
    async postInstall(options) {
        console.log(this.getInstructions());
    }
    getInstructions() {
        return `
Amazon Q Adapter

Skills installed in .amazonq/skills/.
Run: specweave refresh-plugins
    `;
    }
}
//# sourceMappingURL=adapter.js.map