/** * Base Adapter Class * * Provides common functionality for all adapters. * Concrete adapters extend this class and implement tool-specific logic. */ import { IAdapter, AdapterOptions, RequirementsResult, AdapterFile, AutomationLevel } from './adapter-interface.js'; import type { SupportedLanguage } from '../core/i18n/types.js'; import type { Plugin } from '../core/types/plugin.js'; export declare abstract class AdapterBase implements IAdapter { abstract name: string; abstract description: string; abstract automationLevel: AutomationLevel; /** * Default detection - override in concrete adapters */ detect(): Promise; /** * Check common requirements (Node.js; never Git, see 1407) * Concrete adapters can override to add tool-specific checks */ checkRequirements(): Promise; /** * Get files to install - must be implemented by concrete adapters */ abstract getFiles(): AdapterFile[]; /** * Install adapter files to project */ install(options: AdapterOptions): Promise; /** * Post-installation actions - can be overridden by concrete adapters */ postInstall(options: AdapterOptions): Promise; /** * Get usage instructions - must be implemented by concrete adapters */ abstract getInstructions(): string; /** * Helper: Check if a command exists in PATH (cross-platform) */ protected commandExists(command: string): Promise; /** * Helper: Check if a file exists */ protected fileExists(filePath: string): Promise; /** * Helper: Read template file and replace variables */ protected readTemplate(templatePath: string, variables: Record): Promise; /** * Check if this adapter supports plugins * Default: No plugin support (override in concrete adapters) */ supportsPlugins(): boolean; /** * Compile and install a plugin * Default: Throw error (override in concrete adapters that support plugins) */ compilePlugin(plugin: Plugin): Promise; /** * Unload a plugin * Default: Throw error (override in concrete adapters that support plugins) */ unloadPlugin(pluginName: string): Promise; /** * Get installed plugins * Default: Return empty array (override in concrete adapters that support plugins) */ getInstalledPlugins(): Promise; /** * Get the tool-specific skills directory path. * Default: '.claude/skills' (override in concrete adapters) */ getSkillsDirectory(): string; /** * Helper: Write plugin skill files to a tool-specific rules directory. * Each skill is written as `/SKILL.md` directly under the rules directory. * No plugin namespace nesting — non-Claude tools require flat structure. */ protected writeSkillFiles(plugin: Plugin, rulesDir: string): Promise; /** * Helper: Remove all skill files for a plugin from a rules directory. * Removes the plugin's subdirectory (`//`). */ protected removeSkillFiles(pluginName: string, rulesDir: string): Promise; /** * Helper: List unique plugin names installed in a rules directory. * Each subdirectory of rulesDir represents one installed plugin. */ protected listInstalledPluginsInDir(rulesDir: string): Promise; /** * Sanitize frontmatter for non-Claude tools: * 1. Ensure `name:` field is present (required for non-Claude) * 2. Strip Claude-specific fields: user-invocable, allowed-tools, model */ protected sanitizeFrontmatter(content: string, skillName: string): string; /** * Inject system prompt for non-English languages */ protected injectSystemPrompt(content: string, language: SupportedLanguage): string; } //# sourceMappingURL=adapter-base.d.ts.map