import { ProviderTemplate, McpConfigEntry } from './templates.js';

interface AgentAction {
    provider: string;
    filename: string;
    filepath: string;
    status: 'create' | 'append' | 'update_clean' | 'update_conflict' | 'up_to_date' | 'no_sentinel';
    oldContent?: string;
    newContent: string;
    diff?: string;
}
interface McpConfigAction {
    tool: string;
    filename: string;
    filepath: string;
    status: 'create' | 'update' | 'merge' | 'up_to_date';
    content: string;
}
declare class AgentGenerator {
    private version;
    constructor();
    getVersion(): string;
    listProviders(): string[];
    getTemplate(provider: string): ProviderTemplate | undefined;
    private substitute;
    plan(providers: string[], options: {
        dir: string;
        mcpPort?: number;
    }): AgentAction[];
    execute(action: AgentAction): void;
    revert(options: {
        dir: string;
    }): void;
    /**
     * Detect which agent tools are present in the project directory.
     * Returns the list of MCP config entries that should be generated.
     */
    detectAgentTools(dir: string): McpConfigEntry[];
    /**
     * List all available MCP config targets.
     */
    listMcpConfigs(): McpConfigEntry[];
    /**
     * Plan and generate MCP config files for detected (or specified) agent tools.
     * For JSON config files that already exist, we merge the mapx entry into them
     * rather than overwriting the entire file.
     */
    generateMcpConfigs(tools: McpConfigEntry[], options: {
        dir: string;
    }): McpConfigAction[];
    /**
     * Execute MCP config actions (write files to disk).
     */
    executeMcpConfig(action: McpConfigAction): void;
    /**
     * Merge the mapx MCP entry into an existing config object without
     * destroying other entries. Handles the different config shapes:
     * - opencode: { mcp: { mapx: ... } }
     * - gemini-cli: { mcpServers: { mapx: ... } }
     * - cursor/vscode: { mcpServers/servers: { mapx: ... } }
     */
    private mergeMapxIntoConfig;
    /**
     * Remove mapx entries from MCP config files during uninit.
     * If the config file has only mapx entries, delete the file entirely.
     */
    revertMcpConfigs(options: {
        dir: string;
    }): void;
    diff(oldStr: string, newStr: string): string;
}

export { type AgentAction, AgentGenerator, type McpConfigAction };
