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

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