import * as core from '@actions/core';
export class GroupManager {
    currentTask = null;
    currentStep = null;
    startTask(name) {
        this.currentTask = name;
        // Start a collapsible group for the task
        core.startGroup(`Task: ${name}`);
    }
    endTask(name, status, duration) {
        core.endGroup();
        // Log summary line with status icon
        const icon = status === 'success' ? '\u2713' : '\u2717';
        const color = status === 'success' ? '\x1b[32m' : '\x1b[31m';
        const reset = '\x1b[0m';
        core.info(`${color}${icon} ${name}${reset} (${duration.toFixed(1)}s)`);
        this.currentTask = null;
    }
    startStep(name) {
        this.currentStep = name;
        // Nested group for step
        core.info(`\u2500\u2500 Step: ${name}`);
    }
    endStep(_name) {
        this.currentStep = null;
    }
    log(message) {
        // Indent output within steps
        const indent = this.currentStep ? '   ' : '';
        for (const line of message.split('\n')) {
            core.info(`${indent}${line}`);
        }
    }
    getCurrentTask() {
        return this.currentTask;
    }
    getCurrentStep() {
        return this.currentStep;
    }
}
//# sourceMappingURL=groups.js.map