import type { TargetAdapter, TargetId } from "../types.ts";
import { claudeCode } from "./claude-code.ts";
import { codex } from "./codex.ts";
import { cursor } from "./cursor.ts";
import { zcode } from "./zcode.ts";
import { agents } from "./agents.ts";
import { antigravity } from "./antigravity.ts";
import { geminiCli } from "./gemini-cli.ts";
import { windsurf } from "./windsurf.ts";
import { copilot } from "./copilot.ts";
import { agentsMd } from "./agents-md.ts";

export const ADAPTERS: TargetAdapter[] = [
  claudeCode,
  codex,
  cursor,
  zcode,
  agents,
  antigravity,
  geminiCli,
  windsurf,
  copilot,
  agentsMd,
];

export function getAdapter(id: TargetId): TargetAdapter {
  const a = ADAPTERS.find((x) => x.id === id);
  if (!a) throw new Error(`알 수 없는 설치 대상: ${id}`);
  return a;
}

export { MARKER, rewriteRefPaths } from "./common.ts";
export {
  claudeCode,
  codex,
  cursor,
  zcode,
  agents,
  antigravity,
  geminiCli,
  windsurf,
  copilot,
  agentsMd,
};
