/**
 * Settings Defaults Factory
 *
 * Factory function for creating Settings entities with sensible defaults
 * matching the TypeSpec model specification.
 *
 * This factory ensures:
 * - Default model: claude-sonnet-4-6
 * - User profile fields are optional (empty object)
 * - Editor defaults to vscode, shell to bash
 * - Auto-update enabled, log level set to info
 * - Unique IDs and timestamps generated for each instance
 */
import { AgentType, AgentAuthMethod, DefaultHomePage, EditorType, SkillSourceType, TerminalType, } from '../generated/output.js';
/**
 * Default AI model for all SDLC agents.
 * Provides balanced performance and cost for all workflow stages.
 */
const DEFAULT_MODEL = 'claude-sonnet-4-6';
/**
 * Default code editor preference.
 * Most widely used editor in the development community.
 */
const DEFAULT_EDITOR = EditorType.VsCode;
/**
 * Default shell preference.
 * Most common shell across Unix-like systems.
 */
const DEFAULT_SHELL = 'bash';
/**
 * Default terminal emulator preference.
 * Uses the OS default terminal (Terminal.app on macOS, etc.).
 */
const DEFAULT_TERMINAL = TerminalType.System;
/**
 * Default log level for CLI output.
 * Provides informational messages without overwhelming verbosity.
 */
const DEFAULT_LOG_LEVEL = 'info';
/**
 * Default AI coding agent.
 * Claude Code is the only currently supported agent.
 */
const DEFAULT_AGENT_TYPE = AgentType.ClaudeCode;
/**
 * Default agent authentication method.
 * Session auth uses the agent's built-in authentication.
 */
const DEFAULT_AUTH_METHOD = AgentAuthMethod.Session;
/**
 * Creates a Settings entity with sensible defaults.
 *
 * Default values match the TypeSpec model specification:
 * - Default AI model: claude-sonnet-4-6
 * - Editor: vscode
 * - Shell: bash
 * - Auto-update: enabled
 * - Log level: info
 * - User profile: empty (all fields optional)
 * - Agent: Claude Code with session auth
 *
 * @returns Settings entity with default values
 *
 * @example
 * ```typescript
 * const settings = createDefaultSettings();
 * console.log(settings.models.default); // "claude-sonnet-4-6"
 * console.log(settings.environment.defaultEditor); // "vscode"
 * ```
 */
export function createDefaultSettings() {
    const now = new Date();
    const models = {
        default: DEFAULT_MODEL,
    };
    const user = {};
    const environment = {
        defaultEditor: DEFAULT_EDITOR,
        shellPreference: DEFAULT_SHELL,
        terminalPreference: DEFAULT_TERMINAL,
        defaultCloneDirectory: '~/repos',
    };
    const system = {
        autoUpdate: true,
        logLevel: DEFAULT_LOG_LEVEL,
    };
    const agent = {
        type: DEFAULT_AGENT_TYPE,
        authMethod: DEFAULT_AUTH_METHOD,
    };
    const notifications = {
        inApp: { enabled: true },
        browser: { enabled: true },
        desktop: { enabled: false },
        events: {
            agentStarted: true,
            phaseCompleted: true,
            waitingApproval: true,
            agentCompleted: true,
            agentFailed: true,
            prMerged: true,
            prClosed: true,
            prChecksPassed: true,
            prChecksFailed: true,
            prBlocked: true,
            mergeReviewReady: true,
        },
    };
    const approvalGateDefaults = {
        allowPrd: false,
        allowPlan: false,
        allowMerge: false,
        pushOnImplementationComplete: false,
    };
    const skillInjection = {
        enabled: false,
        skills: [
            {
                name: 'architecture-reviewer',
                type: SkillSourceType.Remote,
                source: 'shep-ai/shep',
                remoteSkillName: 'architecture-reviewer',
            },
            {
                name: 'cross-validate-artifacts',
                type: SkillSourceType.Remote,
                source: 'shep-ai/shep',
                remoteSkillName: 'cross-validate-artifacts',
            },
            {
                name: 'mermaid-diagrams',
                type: SkillSourceType.Remote,
                source: 'shep-ai/shep',
                remoteSkillName: 'mermaid-diagrams',
            },
            {
                name: 'react-flow',
                type: SkillSourceType.Remote,
                source: 'shep-ai/shep',
                remoteSkillName: 'react-flow',
            },
            {
                name: 'shadcn-ui',
                type: SkillSourceType.Remote,
                source: 'shep-ai/shep',
                remoteSkillName: 'shadcn-ui',
            },
            {
                name: 'tsp-model',
                type: SkillSourceType.Remote,
                source: 'shep-ai/shep',
                remoteSkillName: 'tsp-model',
            },
            {
                name: 'vercel-react-best-practices',
                type: SkillSourceType.Remote,
                source: 'shep-ai/shep',
                remoteSkillName: 'vercel-react-best-practices',
            },
            {
                name: 'frontend-design',
                type: SkillSourceType.Remote,
                source: 'anthropics/claude-code',
                remoteSkillName: 'frontend-design',
            },
        ],
    };
    const workflow = {
        openPrOnImplementationComplete: false,
        approvalGateDefaults,
        ciWatchEnabled: true,
        enableEvidence: false,
        commitEvidence: false,
        defaultFastMode: true,
        autoArchiveDelayMinutes: 10,
        skillInjection,
    };
    const featureFlags = {
        envDeploy: true,
        debug: false,
        reactFileManager: false,
        projects: false,
        codeReview: false,
        collaboration: false,
        bedrockIntegration: true,
    };
    return {
        id: globalThis.crypto.randomUUID(),
        models,
        user,
        environment,
        system,
        agent,
        notifications,
        workflow,
        featureFlags,
        defaultHomePage: DefaultHomePage.ControlCenter,
        onboardingComplete: false,
        createdAt: now,
        updatedAt: now,
    };
}
