import {
  demo
} from "./chunk-SFJZ7MCA.js";
import {
  base_command_default
} from "./chunk-AYF3ZRJK.js";
import {
  outputInfo,
  readFile,
  renderAutocompletePrompt
} from "./chunk-BGM7BTJW.js";
import {
  joinPath
} from "./chunk-T2GATXSP.js";
import {
  init_cjs_shims
} from "./chunk-POZ5MGPT.js";

// src/cli/commands/demo/catalog.ts
init_cjs_shims();
import { fileURLToPath } from "url";
var Catalog = class extends base_command_default {
  static {
    this.description = "Browse the catalog for steps";
  }
  static {
    this.hidden = !0;
  }
  async run() {
    let catalogFile = joinPath(fileURLToPath(import.meta.url), "../../../../../assets/demo-catalog.json"), { steps } = JSON.parse(await readFile(catalogFile)), stepSelection = await renderAutocompletePrompt({
      message: "Step to display",
      choices: steps.map(({ title, type }) => ({
        label: title,
        value: title,
        group: type
      }))
    }), selectedStep = steps.find(({ title }) => title === stepSelection);
    outputInfo("The step looks like this:"), await demo({ steps: [selectedStep] }), outputInfo("JSON for this step:"), outputInfo(JSON.stringify(selectedStep, null, 2));
  }
};

export {
  Catalog
};
//# sourceMappingURL=chunk-3ZPWNOVZ.js.map
