import {
  checkEndpoint
} from "./chunk-DFHVSUHX.js";
import {
  cliRequestSchema
} from "./chunk-WUNL7OYW.js";
import "./chunk-BQRFNAMV.js";
import "./chunk-IKPLMFAK.js";
import {
  RequestMethod
} from "./chunk-LNJIXYCU.js";
import {
  getWalletOrExit
} from "./chunk-QOYH6AOG.js";
import "./chunk-HFEYSQRZ.js";
import "./chunk-NPJV7AMV.js";
import "./chunk-LNQRIXFK.js";
import "./chunk-Y4VZACTC.js";
import "./chunk-EMQMCXIC.js";
import "./chunk-VDBUUHJF.js";
import "./chunk-ITCDZXBZ.js";
import "./chunk-NROPRHIC.js";
import "./chunk-FB5CMO3J.js";
import {
  errorResponse,
  outputAndExit,
  successResponse
} from "./chunk-7EBJ4BCH.js";
import "./chunk-C7KWYVS3.js";

// src/cli/commands/check.ts
import z from "zod";
var SURFACE = "cli:check";
var checkCommand = async (args) => {
  const requestInput = cliRequestSchema.extend({
    method: z.enum(RequestMethod).optional()
  }).safeParse(args);
  if (!requestInput.success) {
    return outputAndExit(
      errorResponse({
        code: "INVALID_INPUT",
        message: requestInput.error.message,
        surface: SURFACE,
        cause: "validation"
      }),
      args
    );
  }
  const wallets = await getWalletOrExit(args);
  const result = await checkEndpoint(SURFACE, requestInput.data, {
    wallets,
    flags: args
  });
  if (!result.found) {
    return outputAndExit(
      successResponse({
        url: args.url,
        results: [],
        error: result.cause,
        message: result.message
      }),
      args
    );
  }
  return outputAndExit(
    successResponse({ url: args.url, results: result.advisories }),
    args
  );
};
export {
  checkCommand
};
//# sourceMappingURL=check-V262JV5M.js.map