{"version":3,"file":"cli.mjs","names":[],"sources":["../src/cli-args.ts","../src/cli.ts"],"sourcesContent":["/** CLI argument normalization — default to 'balance' subcommand */\n\nconst SUBCOMMANDS = [\n  \"balance\",\n  \"tx\",\n  \"utxos\",\n  \"contract\",\n  \"tokens\",\n  \"transfers\",\n  \"gas\",\n  \"block\",\n  \"providers\",\n  \"mcp\",\n];\n\nexport function normalizeMainArgs(argv: readonly string[]): string[] {\n  if (argv.length === 0) return [\"providers\"];\n\n  const first = argv[0]!;\n  // If first arg is already a known subcommand, pass through\n  if (\n    SUBCOMMANDS.includes(first) ||\n    first === \"--help\" ||\n    first === \"-h\" ||\n    first === \"--version\" ||\n    first === \"-v\"\n  ) {\n    return [...argv];\n  }\n\n  // Treat as address — default to 'balance'\n  return [\"balance\", ...argv];\n}\n","/** Explorers CLI — unified block explorer commands */\nimport { defineCommand, runMain } from \"citty\";\nimport { normalizeMainArgs } from \"./cli-args.js\";\nimport { version } from \"./version.js\";\n\nconst main = defineCommand({\n  meta: {\n    name: \"explorers\",\n    version,\n    description: \"Unified multi-chain block explorer CLI\",\n  },\n  subCommands: {\n    balance: () => import(\"./commands/balance.js\").then((m) => m.default),\n    tx: () => import(\"./commands/tx.js\").then((m) => m.default),\n    utxos: () => import(\"./commands/utxos.js\").then((m) => m.default),\n    contract: () => import(\"./commands/contract.js\").then((m) => m.default),\n    tokens: () => import(\"./commands/tokens.js\").then((m) => m.default),\n    transfers: () => import(\"./commands/transfers.js\").then((m) => m.default),\n    gas: () => import(\"./commands/gas.js\").then((m) => m.default),\n    block: () => import(\"./commands/block.js\").then((m) => m.default),\n    providers: () => import(\"./commands/providers.js\").then((m) => m.default),\n    mcp: () => import(\"./commands/mcp.js\").then((m) => m.default),\n  },\n});\n\nvoid runMain(main, { rawArgs: normalizeMainArgs(process.argv.slice(2)) });\n"],"mappings":";;AAEA,MAAM,cAAc;CAClB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAEA,SAAgB,kBAAkB,MAAmC;CACnE,IAAI,KAAK,WAAW,GAAG,OAAO,CAAC,WAAW;CAE1C,MAAM,QAAQ,KAAK;CAEnB,IACE,YAAY,SAAS,KAAK,KAC1B,UAAU,YACV,UAAU,QACV,UAAU,eACV,UAAU,MAEV,OAAO,CAAC,GAAG,IAAI;CAIjB,OAAO,CAAC,WAAW,GAAG,IAAI;AAC5B;AC3BA,MAAM,OAAO,cAAc;CACzB,MAAM;EACJ,MAAM;EACN;EACA,aAAa;CACf;CACA,aAAa;EACX,eAAe,OAAO,wBAAwB,CAAC,MAAM,MAAM,EAAE,OAAO;EACpE,UAAU,OAAO,mBAAmB,CAAC,MAAM,MAAM,EAAE,OAAO;EAC1D,aAAa,OAAO,sBAAsB,CAAC,MAAM,MAAM,EAAE,OAAO;EAChE,gBAAgB,OAAO,yBAAyB,CAAC,MAAM,MAAM,EAAE,OAAO;EACtE,cAAc,OAAO,uBAAuB,CAAC,MAAM,MAAM,EAAE,OAAO;EAClE,iBAAiB,OAAO,0BAA0B,CAAC,MAAM,MAAM,EAAE,OAAO;EACxE,WAAW,OAAO,oBAAoB,CAAC,MAAM,MAAM,EAAE,OAAO;EAC5D,aAAa,OAAO,sBAAsB,CAAC,MAAM,MAAM,EAAE,OAAO;EAChE,iBAAiB,OAAO,0BAA0B,CAAC,MAAM,MAAM,EAAE,OAAO;EACxE,WAAW,OAAO,oBAAoB,CAAC,MAAM,MAAM,EAAE,OAAO;CAC9D;AACF,CAAC;AAEI,QAAQ,MAAM,EAAE,SAAS,kBAAkB,QAAQ,KAAK,MAAM,CAAC,CAAC,EAAE,CAAC"}