/**
 * Agent Configuration Wizard
 *
 * Interactive TUI wizard that guides users through selecting
 * an AI coding agent and configuring authentication.
 */
import { select, password } from '@inquirer/prompts';
import { AgentAuthMethod } from '../../../domain/generated/output.js';
import { createAgentSelectConfig } from '../prompts/agent-select.prompt.js';
import { createAuthMethodConfig } from '../prompts/auth-method.prompt.js';
import { shepTheme } from '../themes/shep.theme.js';
/**
 * Runs the interactive agent configuration wizard.
 *
 * Steps:
 * 1. Select an AI coding agent (only Claude Code is currently enabled)
 * 2. Select an authentication method (session or token)
 * 3. If token auth is selected, prompt for the API key
 *
 * @returns The selected agent configuration
 */
export async function agentConfigWizard() {
    const agentType = await select(createAgentSelectConfig());
    const authMethod = await select(createAuthMethodConfig());
    const result = {
        type: agentType,
        authMethod,
    };
    if (authMethod === AgentAuthMethod.Token) {
        const token = await password({
            message: 'Enter your Anthropic API key',
            mask: '*',
            theme: shepTheme,
        });
        result.token = token;
    }
    return result;
}
