import { logger } from "../../utils/logger.js";
/**
 * Send a project_added message to the gateway when a project is registered via CLI.
 * Returns true if the message was sent, false if not connected.
 */
export function sendProjectAdded(client, project) {
    if (!client.connected) {
        logger.debug("Cannot send project_added: gateway not connected");
        return false;
    }
    const message = {
        type: "project_added",
        payload: {
            projectId: project.projectId,
            name: project.name,
            path: project.path,
        },
    };
    client.send(message);
    logger.info(`Sent project_added for ${project.name} (${project.projectId})`);
    return true;
}
/**
 * Send a project_removed message to the gateway when a project is unregistered via CLI.
 * Returns true if the message was sent, false if not connected.
 */
export function sendProjectRemoved(client, projectId) {
    if (!client.connected) {
        logger.debug("Cannot send project_removed: gateway not connected");
        return false;
    }
    const message = {
        type: "project_removed",
        payload: {
            projectId,
        },
    };
    client.send(message);
    logger.info(`Sent project_removed for ${projectId}`);
    return true;
}
//# sourceMappingURL=project-sync.js.map