import { checkbox } from "@inquirer/prompts";
class NotTtyError extends Error {
  constructor() {
    super("Cannot prompt for agent selection: stdout is not a TTY. Use --agents flag in non-interactive mode.");
    this.name = "NotTtyError";
  }
}
async function selectAgents(detected) {
  if (!process.stdout.isTTY) {
    throw new NotTtyError();
  }
  if (detected.length === 0) {
    return [];
  }
  const choices = detected.map((a) => ({
    name: a.displayName,
    value: a.id,
    checked: a.detected,
    disabled: a.detected ? false : "(not installed)"
  }));
  const selected = await checkbox({
    message: "Select agents to configure (space to toggle, enter to confirm)",
    choices,
    loop: false
  });
  return selected;
}
export {
  NotTtyError,
  selectAgents
};
//# sourceMappingURL=select-agents.js.map