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

export const ADAPTERS: TargetAdapter[] = [claudeCode, codex, cursor, windsurf, 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, windsurf, agentsMd };
