import { buildCommandContext } from '../../../app/command-context.js';
import { readGlobalOptions } from '../../shared/shared.utils.js';
import { Command } from 'commander';
const DEFAULT_DEPENDENCIES = {
    buildCommandContext,
};
const DEPRECATION_MESSAGE = 'Execution mode is no longer user-selectable; oat-project-implement is the single execution skill. No changes were made. This command will be removed in a future release.';
async function runSetMode(_modeArg, context) {
    if (context.json) {
        context.logger.json({
            status: 'deprecated',
            command: 'oat project set-mode',
            message: DEPRECATION_MESSAGE,
            noop: true,
        });
        process.exitCode = 0;
        return;
    }
    context.logger.warn("[deprecated] 'oat project set-mode' is a no-op.\n" +
        `${DEPRECATION_MESSAGE}`);
    process.exitCode = 0;
}
export function createProjectSetModeCommand(overrides = {}) {
    const dependencies = {
        ...DEFAULT_DEPENDENCIES,
        ...overrides,
    };
    return new Command('set-mode')
        .description('[deprecated] No-op. Execution mode is no longer selectable.')
        .argument('<mode>', 'Ignored. Execution mode is no longer selectable.')
        .action(async (mode, _options, command) => {
        const context = dependencies.buildCommandContext(readGlobalOptions(command));
        await runSetMode(mode, context);
    });
}
