'use server';
import { resolve } from '../../lib/server-container.js';
import { createDeploymentLogger } from '../../../../../packages/core/src/infrastructure/services/deployment/deployment-logger.js';
const log = createDeploymentLogger('[deployFeature]');
export async function deployFeature(featureId) {
    log.info(`called — featureId="${featureId}"`);
    try {
        const useCase = resolve('StartFeatureDeploymentUseCase');
        const status = await useCase.execute(featureId);
        log.info(`start succeeded — state=${status.state}`);
        return { success: true, state: status.state };
    }
    catch (error) {
        const message = error instanceof Error ? error.message : 'Failed to deploy feature';
        log.error(`error: ${message}`, error);
        return { success: false, error: message };
    }
}
