function sendMessage(action, files, search, options, replace) {
	const len = workers.length;
	const limit = Math.ceil(files.length / len);
	for (let i = 0; i < len; i++) {
		const worker = workers[i];
		const offset = i * limit;
		const filesForThisWorker = files
			.slice(offset, offset + limit)
			.map((file) => file.toJSON());
		if (!filesForThisWorker.length) break;
		worker.started = true;
		worker.postMessage({
			action: action,
			data: {
				files: filesForThisWorker,
				search,
				replace,
				options,
			},
		});
	}
}
Sends a message to the worker threads to perform a specific action on a subset of files.

@param {string} action - The action to be performed by the worker threads.
@param {Array<Tree>} files - The files to be processed.
@param {string} search - The search query.
@param {object} options - The search options.
@param {string} replace - The replacement text (if applicable).