← Files RivetARCHIVED FILE

node_modules/rivet-design/dist/cli/entry.js

3.42 KB · Nov 7, 2026 · 13:16 UTC

↓ Download file

"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
    var ownKeys = function(o) {
        ownKeys = Object.getOwnPropertyNames || function (o) {
            var ar = [];
            for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
            return ar;
        };
        return ownKeys(o);
    };
    return function (mod) {
        if (mod && mod.__esModule) return mod;
        var result = {};
        if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
        __setModuleDefault(result, mod);
        return result;
    };
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.runControlPlane = void 0;
const commandNames_1 = require("./commandNames");
const pluginContext_1 = require("../hosts/pluginContext");
const runControlPlane = async (args = process.argv.slice(2)) => {
    if (args.includes('--no-telemetry'))
        process.env.RIVET_TELEMETRY_DISABLED = '1';
    const { redirectLogsToStderr } = await Promise.resolve().then(() => __importStar(require('../utils/logger')));
    redirectLogsToStderr();
    if (!(0, commandNames_1.isCliControlCommand)(args[0])) {
        const { main } = await Promise.resolve().then(() => __importStar(require('../index')));
        return main(args);
    }
    if (!(0, pluginContext_1.getPluginName)() &&
        !['__serve', '__hub', 'update', 'stop', 'auth', 'version'].includes(args[0])) {
        const { synchronizeRuntimes } = await Promise.resolve().then(() => __importStar(require('./synchronizeRuntimes')));
        const { processCliIO, emitResult } = await Promise.resolve().then(() => __importStar(require('./io')));
        const { errorResult } = await Promise.resolve().then(() => __importStar(require('./envelope')));
        const runtimes = await synchronizeRuntimes({ args, io: processCliIO });
        if (runtimes.failures.length > 0) {
            const message = 'Rivet could not upgrade all running servers. Retry after resolving the reported runtime failures.';
            if (args[0] === 'mcp')
                throw new Error(`${message} ${runtimes.failures.map((failure) => failure.message).join(' ')}`);
            const exitCode = emitResult(processCliIO, errorResult(args[0], 'SERVER_UNAVAILABLE', message, { runtimes }, { isRecoverable: true }));
            process.stdout.write('', () => process.exit(exitCode));
            return;
        }
    }
    const { runCliControlCommand } = await Promise.resolve().then(() => __importStar(require('./router')));
    const exitCode = await runCliControlCommand(args);
    process.stdout.write('', () => process.exit(exitCode));
};
exports.runControlPlane = runControlPlane;
//# sourceMappingURL=entry.js.map

SHA-256: 8be00b24eb131b2d735f57e159a3cba78c78bf9b7ca1d8e964500b00fdfdc91c