// @bun
import {
  ensureJsonOnlyFormat
} from "./chunk-5zqmmchg.js";
import {
  resolveCommandContext
} from "./chunk-2jcqy5j6.js";
import"./chunk-6fad0ts7.js";
import {
  createCliLogger
} from "./chunk-t993tmz7.js";
import"./chunk-px7fts59.js";
import"./chunk-7krp2mgz.js";
import"./chunk-np5wcwfv.js";
import"./chunk-je8v6rhj.js";
import"./chunk-6w0knnta.js";
import"./chunk-w15xmtkn.js";
import"./chunk-3sd5p4qp.js";
import"./chunk-nh2akp42.js";
import"./chunk-kat1bv74.js";
import"./chunk-2a5b6azq.js";
import {
  Cognitive
} from "./chunk-s8cp3qe6.js";
import"./chunk-fv5teh9w.js";
import"./chunk-8ab2w9a1.js";
import"./chunk-3xrpxgq4.js";
import"./chunk-w346ejn9.js";
import"./chunk-n8gath4k.js";
import"./chunk-v3ens42y.js";
import"./chunk-8839jtgk.js";
import"./chunk-s2akeqpw.js";
import"./chunk-6771vrjp.js";
import"./chunk-g8mm42v1.js";
import"./chunk-0q5d80bn.js";
import"./chunk-300xaact.js";
import"./chunk-b8c41yvb.js";
import"./chunk-jsqe5am4.js";
import"./chunk-m4c14gcg.js";
import"./chunk-gspjbr79.js";
import"./chunk-wesykvkp.js";
import"./chunk-gzj56z73.js";
import"./chunk-dhs2bg35.js";

// src/commands/adk-models.ts
var INDENT = "  ";
async function adkModels(opts) {
  ensureJsonOnlyFormat(opts.format);
  const logger = createCliLogger({ format: opts.format });
  const context = await resolveCommandContext({
    target: "dev",
    require: ["project", "credentials", "workspace", "bot"]
  });
  const cognitive = new Cognitive({ client: context.client, __experimental_beta: true });
  const models = await cognitive.fetchRemoteModels();
  const list = Array.from(models.values()).map((m) => ({
    ref: m.ref,
    name: m.name,
    integration: m.integration,
    tags: m.tags
  }));
  if (models.size === 0) {
    logger.warn("No models available. Check that your bot has model integrations installed.").result(list);
    return;
  }
  const byIntegration = new Map;
  for (const model of models.values()) {
    const group = byIntegration.get(model.integration) ?? [];
    group.push({ ref: model.ref, name: model.name, tags: model.tags });
    byIntegration.set(model.integration, group);
  }
  logger.newline();
  logger.info(`${INDENT}Available Models (${models.size} total)`);
  logger.newline();
  logger.info(`${INDENT}Aliases`);
  logger.info(`${INDENT}  fast`, "cyan");
  logger.info(`${INDENT}    \u2014 fastest available model`, "gray");
  logger.info(`${INDENT}  best`, "cyan");
  logger.info(`${INDENT}    \u2014 most capable available model`, "gray");
  logger.newline();
  for (const [integration, group] of byIntegration) {
    logger.info(`${INDENT}${integration}`);
    for (const model of group) {
      const tags = model.tags.length > 0 ? ` [${model.tags.join(", ")}]` : "";
      logger.info(`${INDENT}  ${model.ref}${tags}`, "cyan");
    }
    logger.newline();
  }
  logger.info(`${INDENT}Use these refs with --judge-model, evals.judgeModel, or models in agent.config.ts`, "gray").result(list);
  logger.newline();
}
export {
  adkModels
};
