"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getCurrentMachineId = getCurrentMachineId;
const node_machine_id_1 = require("node-machine-id");
let _cachedMachineId = null;
/**
 * Get the current machine ID, with caching and error handling
 * @returns The machine ID or empty string if unable to retrieve
 */
async function getCurrentMachineId() {
    if (_cachedMachineId === null) {
        try {
            _cachedMachineId = await (0, node_machine_id_1.machineId)();
        }
        catch (e) {
            if (process.env.NX_VERBOSE_LOGGING === 'true') {
                console.log(`Unable to get machineId. Error: ${e.message}`);
            }
            _cachedMachineId = '';
        }
    }
    return _cachedMachineId;
}
