import { join } from "node:path";
import { binaryInPath, dirExists, fileExists, getHome, getCwd } from "./detect-helpers.js";
const claudeCode = {
  id: "claude-code",
  displayName: "Claude Code",
  installType: "cli-command",
  detect: () => binaryInPath("claude") !== null,
  configPath: () => null
};
const cursor = {
  id: "cursor",
  displayName: "Cursor",
  installType: "config-file",
  detect: ({ cwd, home }) => dirExists(join(cwd, ".cursor")) || dirExists(join(home, ".cursor")) || binaryInPath("cursor") !== null,
  configPath: ({ cwd, home }) => {
    if (dirExists(join(cwd, ".cursor"))) return join(cwd, ".cursor", "mcp.json");
    return join(home, ".cursor", "mcp.json");
  }
};
const vscode = {
  id: "vscode",
  displayName: "VS Code (Copilot)",
  installType: "config-file",
  detect: ({ cwd, home }) => dirExists(join(cwd, ".vscode")) || dirExists(join(home, ".vscode")) || binaryInPath("code") !== null,
  configPath: ({ cwd, home }) => {
    if (dirExists(join(cwd, ".vscode"))) return join(cwd, ".vscode", "mcp.json");
    return join(home, ".vscode", "mcp.json");
  }
};
const zed = {
  id: "zed",
  displayName: "Zed",
  installType: "config-file",
  detect: ({ home }) => dirExists(join(home, ".config", "zed")) || binaryInPath("zed") !== null,
  configPath: ({ home }) => join(home, ".config", "zed", "settings.json")
};
const geminiCli = {
  id: "gemini-cli",
  displayName: "Gemini CLI",
  installType: "config-file",
  detect: ({ home }) => binaryInPath("gemini") !== null || dirExists(join(home, ".gemini")),
  configPath: ({ home }) => join(home, ".gemini", "settings.json")
};
const windsurf = {
  id: "windsurf",
  displayName: "Windsurf",
  installType: "config-file",
  detect: ({ home }) => dirExists(join(home, ".codeium", "windsurf")) || dirExists(join(home, ".windsurf")) || binaryInPath("windsurf") !== null,
  configPath: ({ home }) => join(home, ".codeium", "windsurf", "mcp_config.json")
};
const codex = {
  id: "codex",
  displayName: "Codex (OpenAI CLI)",
  installType: "config-toml",
  detect: ({ home }) => binaryInPath("codex") !== null || dirExists(join(home, ".codex")),
  configPath: ({ home }) => join(home, ".codex", "config.toml")
};
const opencode = {
  id: "opencode",
  displayName: "OpenCode",
  installType: "config-file",
  detect: ({ home }) => binaryInPath("opencode") !== null || dirExists(join(home, ".config", "opencode")),
  configPath: ({ home }) => join(home, ".config", "opencode", "config.json")
};
const AGENTS = [
  claudeCode,
  cursor,
  vscode,
  zed,
  geminiCli,
  windsurf,
  codex,
  opencode
];
function detectAgents(opts = {}) {
  const env = {
    cwd: opts.cwd ?? getCwd(),
    home: opts.home ?? getHome()
  };
  return AGENTS.map((d) => ({
    id: d.id,
    displayName: d.displayName,
    detected: d.detect(env),
    configPath: d.configPath(env),
    installType: d.installType
  }));
}
export {
  AGENTS,
  detectAgents,
  fileExists
};
//# sourceMappingURL=agents.js.map