#!/usr/bin/env node

// src/index.ts
import { fileURLToPath } from "url";
import { dirname, join } from "path";
import { existsSync } from "fs";
var __filename = fileURLToPath(import.meta.url);
var __dirname = dirname(__filename);
var args = process.argv.slice(2);
if (args.length === 0) {
  const isLocal = existsSync(join(__dirname, "../../mcp-server/dist/index.js"));
  if (isLocal) {
    const { startMcpServer } = await import("./dist-ARC6LWFF.js");
    await startMcpServer();
  } else {
    const mcpServerModule = "@codemcp/workflows-server";
    const { startMcpServer } = await import(mcpServerModule);
    await startMcpServer();
  }
} else {
  const { runCli } = await import("./cli-RLPVHRTE.js");
  await runCli();
}
