export function assertTaskPrefixPair(taskPrefix, taskColorIndex) {
    if ((taskPrefix != null) !== (taskColorIndex != null)) {
        throw new Error('taskPrefix and taskColorIndex must be provided together');
    }
}
export function truncate(value, maxLength) {
    return value.length <= maxLength ? value : value.slice(0, maxLength) + '...';
}
export function formatElapsedTime(startTime, endTime) {
    const elapsedSec = (new Date(endTime).getTime() - new Date(startTime).getTime()) / 1000;
    if (elapsedSec < 60) {
        return `${elapsedSec.toFixed(1)}s`;
    }
    return `${Math.floor(elapsedSec / 60)}m ${Math.floor(elapsedSec % 60)}s`;
}
export function detectStepType(step) {
    if (step.kind === 'workflow_call')
        return 'workflow_call';
    if (step.parallel)
        return 'parallel';
    if (step.arpeggio)
        return 'arpeggio';
    if (step.teamLeader)
        return 'team_leader';
    return 'normal';
}
//# sourceMappingURL=workflowExecutionUtils.js.map