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

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