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

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