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

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