/** * MCP Client Adapter - Base Interface & Abstract Class * Defines the contract for all MCP client adapters */ import { MCPClient } from '../utils/paths.js'; import { Platform } from '../utils/os.js'; import { MCPConfig, ContinueConfig } from '../utils/config.js'; export interface ConfigResult { success: boolean; message: string; configPath: string; backupPath?: string | null; isNew?: boolean; alreadyConfigured?: boolean; error?: string; } export interface VerifyResult { success: boolean; hasConfig: boolean; configValid: boolean; message: string; } export interface InstallInfo { installed: boolean; appPath?: string; configExists: boolean; configPath: string; } export interface ConfigureOptions { workspaceId?: string; serverName?: string; force?: boolean; } /** * MCP Client Adapter Interface */ export interface MCPClientAdapter { /** Internal client name */ name: MCPClient | 'custom'; /** Human-readable display name */ displayName: string; /** Check if the client is installed on the system */ isInstalled(): Promise; /** Get the config file path for this client */ getConfigPath(): string; /** Configure APIClaw MCP server for this client */ configure(options?: ConfigureOptions): Promise; /** Verify the current configuration */ verify(): Promise; /** Get detailed installation info */ getInstallInfo(): Promise; /** Remove APIClaw configuration */ unconfigure(serverName?: string): Promise; } /** * Abstract base class for MCP client adapters * Provides common functionality for all adapters */ export declare abstract class BaseAdapter implements MCPClientAdapter { abstract name: MCPClient | 'custom'; abstract displayName: string; protected os: Platform; constructor(); /** * Get the config file path */ getConfigPath(): string; /** * Check if config file exists */ protected configExists(): boolean; /** * Get application paths to check for installation * Override in subclasses for specific clients */ protected abstract getAppPaths(): string[]; /** * Check if the client application is installed */ isInstalled(): Promise; /** * Get detailed installation information */ getInstallInfo(): Promise; /** * Configure APIClaw MCP server */ configure(options?: ConfigureOptions): Promise; /** * Merge APIClaw config into existing config * Override in subclasses for special formats (e.g., Continue) */ protected mergeConfig(config: MCPConfig | ContinueConfig, options: { workspace?: string; serverName?: string; force?: boolean; }): MCPConfig | ContinueConfig; /** * Verify the current configuration */ verify(): Promise; /** * Remove APIClaw configuration */ unconfigure(serverName?: string): Promise; /** * Remove APIClaw from config * Override in subclasses for special formats */ protected removeFromConfig(config: MCPConfig | ContinueConfig, serverName: string): MCPConfig | ContinueConfig; } //# sourceMappingURL=base.d.ts.map