{"version":3,"file":"cli.mjs","names":[],"sources":["../src/mcp/print-result.ts","../src/cli.ts"],"sourcesContent":["export interface McpTextResult {\n  content?: Array<{ type: string; text?: string }>\n  isError?: boolean\n}\n\n/**\n * Prints the text blocks of an MCP tool result to stdout. When the result is\n * flagged `isError`, throws with the tool's error text instead — MCP `callTool`\n * returns tool errors as ordinary results (it does not reject), so callers must\n * surface them as failures (non-zero exit) rather than printing to stdout and\n * exiting 0.\n */\nexport function printMcpTextContent(result: McpTextResult): void {\n  const texts = (result.content ?? [])\n    .filter((item) => item.type === 'text')\n    .map((item) => item.text ?? '')\n\n  if (result.isError) {\n    throw new Error(texts.join('\\n').trim() || 'MCP tool returned an error')\n  }\n\n  for (const text of texts) console.log(text)\n}\n","import { Command, Option } from 'commander'\nimport { execFileSync } from 'node:child_process'\nimport { fileURLToPath } from 'node:url'\nimport path from 'node:path'\nimport { PACKAGE_INFO, PACKAGE_VERSION } from './version.js'\nimport { printMcpTextContent } from './mcp/print-result.js'\n\n// Resolve bin/install.cjs relative to this file's location in dist/\nconst __dirname = path.dirname(fileURLToPath(import.meta.url))\nconst installerPath = path.resolve(__dirname, '..', 'bin', 'install.cjs')\n\nconst program = new Command()\n\nprogram\n  .name('chain-insights')\n  .description('AML investigation toolkit for blockchain analysis')\n  .version(PACKAGE_INFO.version)\n  .option('--claude', 'Install Claude Code skills globally to ~/.claude/skills/')\n  .option('--codex', 'Install Codex skills globally to ~/.codex/skills/ and register MCP')\n  .option('--hermes', 'Install Hermes skills globally to ~/.hermes/skills/chain-insights/ and register MCP')\n\n// Handle installer flags when invoked with no subcommand (bare `chain-insights --claude`)\nconst rawArgs = process.argv.slice(2)\nconst installerFlags = rawArgs.filter(a => a === '--claude' || a === '--codex' || a === '--hermes')\n// A help/version request must never trigger a global install side effect — let\n// commander handle it and print help/version instead.\nconst wantsHelpOrVersion = rawArgs.some(a => a === '--help' || a === '-h' || a === '--version' || a === '-V')\nif (installerFlags.length > 0 && !wantsHelpOrVersion && !rawArgs.some(a => !a.startsWith('-'))) {\n  try {\n    execFileSync(process.execPath, [installerPath, ...installerFlags], { stdio: 'inherit' })\n  } catch (err) {\n    console.error('Installation failed:', (err as Error).message)\n    process.exit(1)\n  }\n  process.exit(0)\n}\n\nif (rawArgs[0] === 'mcp' && ['trace-funds', 'track-funds'].includes(rawArgs[1] ?? '')) {\n  console.error(`error: unknown command '${rawArgs[1]}'`)\n  process.exit(1)\n}\n\nfunction runInstaller(flag: '--claude' | '--codex' | '--hermes'): void {\n  try {\n    execFileSync(process.execPath, [installerPath, flag], { stdio: 'inherit' })\n  } catch (err) {\n    console.error('Installation failed:', (err as Error).message)\n    process.exit(1)\n  }\n}\n\nfunction optionalNumber(value: string | undefined): number | undefined {\n  if (value === undefined) return undefined\n  const parsed = Number(value)\n  if (!Number.isFinite(parsed)) throw new Error(`Invalid number: ${value}`)\n  return parsed\n}\n\nfunction optionalNumberArg(value: unknown, name: string): number | undefined {\n  if (value === undefined) return undefined\n  if (typeof value === 'number' && Number.isFinite(value)) return value\n  if (typeof value === 'string') return optionalNumber(value)\n  throw new Error(`Invalid number for ${name}: ${String(value)}`)\n}\n\nconst TOPOLOGY_SCOPE_VALUES = ['live_topology', 'archive_topology'] as const\n\nfunction resolveTopologyScopeOption(value: string | undefined): 'live_topology' | 'archive_topology' | undefined {\n  if (value === undefined) return undefined\n  if (!(TOPOLOGY_SCOPE_VALUES as readonly string[]).includes(value)) {\n    throw new Error(`Invalid --topology-scope: ${value}. Allowed values: ${TOPOLOGY_SCOPE_VALUES.join(', ')}.`)\n  }\n  return value as 'live_topology' | 'archive_topology'\n}\n\nasync function withGraphMcpClient<T>(name: string, fn: (client: import('@modelcontextprotocol/sdk/client/index.js').Client, config: Awaited<ReturnType<typeof import('./config/index.js').loadConfig>>) => Promise<T>): Promise<T> {\n  const { loadConfig } = await import('./config/index.js')\n  const config = await loadConfig()\n  const { createConfiguredGraphMcpFetch, resolveGraphMcpEndpoint } = await import('./mcp/client.js')\n  const paymentFetch = await createConfiguredGraphMcpFetch(config)\n  const { Client } = await import('@modelcontextprotocol/sdk/client/index.js')\n  const { StreamableHTTPClientTransport } = await import('@modelcontextprotocol/sdk/client/streamableHttp.js')\n  const client = new Client({ name, version: PACKAGE_VERSION })\n  await client.connect(new StreamableHTTPClientTransport(new URL(resolveGraphMcpEndpoint(config)), { fetch: paymentFetch }))\n  try {\n    return await fn(client, config)\n  } finally {\n    await client.close()\n  }\n}\n\nasync function printNetworkCapabilities(opts: { json?: boolean }): Promise<void> {\n  const { loadConfig } = await import('./config/index.js')\n  const { fetchNetworkCapabilities, formatNetworkCapabilities } = await import('./mcp/capabilities.js')\n  const document = await fetchNetworkCapabilities(await loadConfig())\n  if (opts.json) {\n    console.log(JSON.stringify(document, null, 2))\n  } else {\n    console.log(formatNetworkCapabilities(document))\n  }\n}\n\nprogram\n  .command('networks')\n  .alias('network')\n  .description('List supported graph networks, capability layers, and available tools')\n  .option('--json', 'Print raw capability JSON')\n  .action(async (opts: { json?: boolean }) => {\n    try {\n      await printNetworkCapabilities(opts)\n    } catch (err) {\n      console.error((err as Error).message)\n      process.exit(1)\n    }\n  })\n\nprogram\n  .command('serve')\n  .description('Start local visualization server')\n  .option('-p, --port <number>', 'Port to bind (defaults to the configured serverPort)')\n  .action(async (opts: { port?: string }) => {\n    try {\n      const { requireWorkspaceRoot } = await import('./workspace/output-root.js')\n      const workspaceRoot = requireWorkspaceRoot()\n      const { loadConfig } = await import('./config/index.js')\n      const { resolveServerPort } = await import('./server/resolve-port.js')\n      const config = await loadConfig()\n      const port = resolveServerPort(opts.port, config.serverPort)\n      const { startServer } = await import('./server/index.js')\n      console.log(`Workspace: ${workspaceRoot}`)\n      startServer(port)\n    } catch (err) {\n      console.error((err as Error).message)\n      process.exit(1)\n    }\n  })\n\nprogram\n  .command('status')\n  .description('Show toolkit status and configuration')\n  .action(async () => {\n    const { loadConfig } = await import('./config/index.js')\n    const { findActiveWorkspace, activeDataDir } = await import('./workspace/active.js')\n    const config = await loadConfig()\n    const workspace = findActiveWorkspace()\n    const graphMcpStatus = config.graphMcpMode === 'debug' && config.graphMcpAuthToken?.trim()\n      ? 'bearer access mode'\n      : `${config.graphMcpMode} mode`\n    console.log('Config: ', activeDataDir(config.dataDir))\n    if (workspace) console.log('Workspace:', workspace.root)\n    console.log('Server: ', `http://127.0.0.1:${config.serverPort}`)\n    console.log('Chain Insights Graph:', graphMcpStatus)\n    console.log('Graph endpoint:', config.graphMcpEndpoint)\n  })\n\nprogram\n  .command('update')\n  .description('Check npmjs for a newer Chain Insights release and update this CLI')\n  .option('--check', 'Only check for a newer release')\n  .option('--dry-run', 'Print the update command without running it')\n  .action(async (opts: { check?: boolean; dryRun?: boolean }) => {\n    try {\n      const { checkForUpdate, runPackageUpdate } = await import('./update.js')\n      const result = await checkForUpdate()\n      if (result.error) {\n        throw new Error(`Could not check npmjs for updates: ${result.error}`)\n      }\n      if (!result.updateAvailable || !result.latestVersion) {\n        console.log(`Chain Insights is up to date (${result.currentVersion}).`)\n        return\n      }\n\n      console.log(`Chain Insights ${result.latestVersion} is available (current ${result.currentVersion}).`)\n      if (opts.check) {\n        console.log(`Run: ${result.updateCommand}`)\n        return\n      }\n      if (opts.dryRun) {\n        console.log(`Would run: ${result.updateCommand}`)\n        return\n      }\n\n      console.log(`Running: ${result.updateCommand}`)\n      runPackageUpdate(result.packageName)\n    } catch (err) {\n      console.error((err as Error).message)\n      process.exit(1)\n    }\n  })\n\nprogram\n  .command('debug')\n  .description('Configure Chain Insights Graph debug mode')\n  .addCommand(\n    new Command('on')\n      .description('Enable Chain Insights Graph debug mode without x402 payments')\n      .requiredOption('--token <token>', 'Debug bearer token')\n      .option('--endpoint <url>', 'Chain Insights Graph endpoint')\n      .action(async (opts: { token: string; endpoint?: string }) => {\n        try {\n          const { saveConfig } = await import('./config/index.js')\n          await saveConfig({\n            graphMcpMode: 'debug',\n            graphMcpAuthToken: opts.token,\n            ...(opts.endpoint ? { graphMcpEndpoint: opts.endpoint } : {}),\n          })\n          console.log('Chain Insights Graph debug mode enabled')\n          if (opts.endpoint) console.log(`Graph endpoint: ${opts.endpoint}`)\n          console.log('Payments: disabled for Chain Insights Graph calls')\n        } catch (err) {\n          console.error((err as Error).message)\n          process.exit(1)\n        }\n      })\n  )\n  .addCommand(\n    new Command('off')\n      .description('Disable Chain Insights Graph debug mode and use paid x402 calls')\n      .action(async () => {\n        try {\n          const { saveConfig } = await import('./config/index.js')\n          await saveConfig({ graphMcpMode: 'paid', graphMcpAuthToken: '' })\n          console.log('Chain Insights Graph debug mode disabled')\n          console.log('Payments: enabled for Chain Insights Graph calls')\n        } catch (err) {\n          console.error((err as Error).message)\n          process.exit(1)\n        }\n      })\n  )\n  .addCommand(\n    new Command('status')\n      .description('Show Chain Insights Graph payment/debug mode')\n      .action(async () => {\n        try {\n          const { loadConfig } = await import('./config/index.js')\n          const config = await loadConfig()\n          console.log(`Chain Insights Graph mode: ${config.graphMcpMode}`)\n          console.log(`Graph endpoint: ${config.graphMcpEndpoint}`)\n          console.log(`Debug token:    ${config.graphMcpAuthToken?.trim() ? 'configured' : 'not configured'}`)\n          console.log(`Payments:       ${config.graphMcpMode === 'debug' ? 'disabled' : 'enabled'}`)\n        } catch (err) {\n          console.error((err as Error).message)\n          process.exit(1)\n        }\n      })\n  )\n\nprogram\n  .command('access-key')\n  .description('Configure Chain Insights Graph test access key mode')\n  .addCommand(\n    new Command('set')\n      .description('Use a Chain Insights Graph test access key without x402 payments')\n      .argument('<key>', 'Test access key')\n      .option('--endpoint <url>', 'Chain Insights Graph endpoint')\n      .action(async (key: string, opts: { endpoint?: string }) => {\n        try {\n          const normalizedKey = key.trim()\n          if (!normalizedKey) throw new Error('Test access key is required')\n          const { saveConfig } = await import('./config/index.js')\n          await saveConfig({\n            graphMcpMode: 'debug',\n            graphMcpAuthToken: normalizedKey,\n            ...(opts.endpoint ? { graphMcpEndpoint: opts.endpoint } : {}),\n          })\n          console.log('Chain Insights Graph test access key configured')\n          if (opts.endpoint) console.log(`Graph endpoint: ${opts.endpoint}`)\n          console.log('Payments: disabled when the server accepts this key')\n        } catch (err) {\n          console.error((err as Error).message)\n          process.exit(1)\n        }\n      })\n  )\n  .addCommand(\n    new Command('clear')\n      .description('Remove the Chain Insights Graph test access key and use paid x402 calls')\n      .action(async () => {\n        try {\n          const { saveConfig } = await import('./config/index.js')\n          await saveConfig({ graphMcpMode: 'paid', graphMcpAuthToken: '' })\n          console.log('Chain Insights Graph test access key cleared')\n          console.log('Payments: enabled for Chain Insights Graph calls')\n        } catch (err) {\n          console.error((err as Error).message)\n          process.exit(1)\n        }\n      })\n  )\n  .addCommand(\n    new Command('status')\n      .description('Show Chain Insights Graph test access key status')\n      .action(async () => {\n        try {\n          const { loadConfig } = await import('./config/index.js')\n          const config = await loadConfig()\n          console.log(`Graph endpoint: ${config.graphMcpEndpoint}`)\n          console.log(`Access key:     ${config.graphMcpAuthToken?.trim() ? 'configured' : 'not configured'}`)\n          console.log(`Payments:       ${config.graphMcpAuthToken?.trim() ? 'disabled when accepted by server' : 'enabled'}`)\n        } catch (err) {\n          console.error((err as Error).message)\n          process.exit(1)\n        }\n      })\n  )\n\nprogram\n  .command('init')\n  .description('Initialize an investigation workspace')\n  .argument('[dir]', 'Workspace directory to initialize', '.')\n  .option('--force', 'Overwrite existing workspace files')\n  .action(async (dir: string, opts: { force?: boolean }) => {\n    try {\n      const { initWorkspace } = await import('./workspace/init.js')\n      const result = await initWorkspace({ targetDir: dir, force: opts.force })\n      console.log(`Workspace initialized: ${result.workspaceRoot}`)\n      console.log(`Files written: ${result.filesWritten.length}`)\n      const { maybePromptForUpdate } = await import('./update.js')\n      await maybePromptForUpdate()\n    } catch (err) {\n      console.error((err as Error).message)\n      process.exit(1)\n    }\n  })\n\nprogram\n  .command('setup')\n  .description('Configure external MCP clients')\n  .addCommand(\n    new Command('claude-code')\n      .alias('claude')\n      .description('Install Claude Code skills and register the MCP proxy')\n      .action(() => {\n        runInstaller('--claude')\n      })\n  )\n  .addCommand(\n    new Command('codex')\n      .description('Install Codex skills and register the MCP proxy')\n      .action(() => {\n        runInstaller('--codex')\n      })\n  )\n  .addCommand(\n    new Command('hermes')\n      .description('Install Hermes skills and register the MCP proxy')\n      .action(() => {\n        runInstaller('--hermes')\n      })\n  )\n\nprogram\n  .command('config')\n  .description('Read or write configuration values')\n  .addCommand(\n    new Command('get')\n      .argument('<key>', 'Config key to read')\n      .action(async (key: string) => {\n        const { loadConfig } = await import('./config/index.js')\n        const { CONFIG_KEYS } = await import('./config/schema.js')\n        if (!CONFIG_KEYS.includes(key as typeof CONFIG_KEYS[number])) {\n          console.error(`Unknown config key: ${key}`)\n          process.exit(1)\n        }\n        const config = await loadConfig()\n        const value = (config as Record<string, unknown>)[key]\n        console.log(value ?? '')\n      })\n  )\n  .addCommand(\n    new Command('set')\n      .argument('<key>', 'Config key to write')\n      .argument('<value>', 'Value to set')\n      .action(async (key: string, value: string) => {\n        // D-01: walletPrivateKey is intercepted before saveConfig — the raw private key\n        // must NEVER be written to config.json.\n        if (key === 'walletPrivateKey') {\n          try {\n            const { setWalletPrivateKey } = await import('./wallet/index.js')\n            const address = await setWalletPrivateKey(value)\n            console.log('Wallet private key encrypted and stored in ~/.chain-insights/wallet.json')\n            console.log(`Wallet address: ${address}`)\n          } catch (err) {\n            console.error((err as Error).message)\n            process.exit(1)\n          }\n          return // MUST return — walletPrivateKey must never reach saveConfig or config.json\n        }\n        const { loadConfig, saveConfig } = await import('./config/index.js')\n        const { CONFIG_KEYS, DEFAULT_CONFIG } = await import('./config/schema.js')\n        const current = await loadConfig()\n        if (!CONFIG_KEYS.includes(key as typeof CONFIG_KEYS[number])) {\n          console.error(`Unknown config key: ${key}`)\n          process.exit(1)\n        }\n        const existing = (current as Record<string, unknown>)[key]\n        const defaultValue = (DEFAULT_CONFIG as Record<string, unknown>)[key]\n        const coerced = typeof existing === 'number' || typeof defaultValue === 'number' ? Number(value) : value\n        await saveConfig({ [key]: coerced } as Parameters<typeof saveConfig>[0])\n        const displayed = key.toLowerCase().includes('token') ? '[redacted]' : coerced\n        console.log(`Set ${key} = ${displayed}`)\n      })\n  )\n\nprogram\n  .command('wallet')\n  .description('Manage the local Base USDC payment wallet')\n  .addCommand(\n    new Command('import')\n      .description('Import a Base payment wallet')\n      .argument('<private-key>', '0x-prefixed EVM private key')\n      .option('--force', 'Replace an existing wallet (the previous key is backed up next to wallet.json)')\n      .action(async (privateKey: string, opts: { force?: boolean }) => {\n        try {\n          const { setWalletPrivateKey, isWalletConfigured } = await import('./wallet/index.js')\n          const replacing = opts.force === true && await isWalletConfigured()\n          const address = await setWalletPrivateKey(privateKey, { force: opts.force })\n          if (replacing) {\n            console.log('Previous wallet key backed up next to ~/.chain-insights/wallet.json')\n          }\n          console.log(`Wallet imported: ${address}`)\n          console.log('Next: run `chain-insights wallet ready`')\n        } catch (err) {\n          console.error((err as Error).message)\n          process.exit(1)\n        }\n      })\n  )\n  .addCommand(\n    new Command('address')\n      .description('Print the local payment wallet address')\n      .action(async () => {\n        try {\n          const { getWalletAccount } = await import('./wallet/tools.js')\n          const account = await getWalletAccount()\n          console.log(account.address)\n        } catch (err) {\n          console.error((err as Error).message)\n          process.exit(1)\n        }\n      })\n  )\n  .addCommand(\n    new Command('balance')\n      .description('Show the local payment wallet Base USDC balance')\n      .action(async () => {\n        try {\n          const { getWalletBalanceText } = await import('./wallet/tools.js')\n          console.log(await getWalletBalanceText())\n        } catch (err) {\n          console.error((err as Error).message)\n          process.exit(1)\n        }\n      })\n  )\n  .addCommand(\n    new Command('ready')\n      .description('Check and prepare the wallet for paid Chain Insights Graph calls')\n      .option('--check-only', 'Only check readiness; do not submit the one-time payment setup')\n      .addOption(new Option('--no-approve', 'Deprecated alias for --check-only').hideHelp())\n      .option('--payment-usdc <amount>', 'USDC setup cap to prepare for paid calls', '1')\n      .addOption(new Option('--approval-usdc <amount>', 'Deprecated alias for --payment-usdc').hideHelp())\n      .option('--json', 'Print machine-readable readiness metadata')\n      .action(async (opts: { checkOnly?: boolean; approve?: boolean; paymentUsdc?: string; approvalUsdc?: string; json?: boolean }) => {\n        try {\n          const { formatWalletReadiness, parsePaymentApprovalUnits, prepareWalletForPaidCalls } = await import('./wallet/tools.js')\n          const minimumApprovalUnits = parsePaymentApprovalUnits(opts.paymentUsdc ?? opts.approvalUsdc ?? '1')\n          const result = await prepareWalletForPaidCalls({\n            minimumApprovalUnits,\n            approve: opts.checkOnly ? false : opts.approve !== false,\n          })\n\n          if (opts.json) {\n            console.log(JSON.stringify(result, (_key, value) => (\n              typeof value === 'bigint' ? value.toString() : value\n            ), 2))\n            return\n          }\n\n          console.log(formatWalletReadiness(result.readiness, result.approval))\n        } catch (err) {\n          console.error((err as Error).message)\n          process.exit(1)\n        }\n      })\n  )\n  .addCommand(\n    new Command('topup')\n      .description('Open a local browser page to top up the payment wallet')\n      .option('--no-open', 'Print the top-up URL without opening a browser')\n      .option('--json', 'Print machine-readable top-up metadata')\n      .action(async (opts: { open?: boolean; json?: boolean }) => {\n        try {\n          const { buildTopupInfo, getWalletAccount } = await import('./wallet/tools.js')\n          const { startTopupServer } = await import('./wallet/topup-server.js')\n          const account = await getWalletAccount()\n          const url = await startTopupServer(account)\n          const info = buildTopupInfo(account.address, url)\n\n          if (opts.json) {\n            console.log(JSON.stringify(info, null, 2))\n          } else {\n            console.log(`Top-up URL: ${url}`)\n            console.log(`Wallet:     ${account.address}`)\n            console.log('Network:    Base')\n            console.log('Token:      USDC')\n            console.log('Press Ctrl+C to stop the top-up server.')\n          }\n\n          if (opts.open !== false) {\n            const open = (await import('open')).default\n            await open(url)\n          }\n        } catch (err) {\n          console.error((err as Error).message)\n          process.exit(1)\n        }\n      })\n  )\n\nprogram\n  .command('mcp')\n  .description('Interact with the Chain Insights MCP endpoint')\n  .allowExcessArguments(false)\n  .addCommand(\n    new Command('networks')\n      .description('List supported graph networks, capability layers, dataset coverage, and available tools')\n      .option('--json', 'Print raw capability JSON')\n      .action(async (opts: { json?: boolean }) => {\n        try {\n          await printNetworkCapabilities(opts)\n        } catch (err) {\n          console.error((err as Error).message)\n          process.exit(1)\n        }\n      })\n  )\n  .addCommand(\n    new Command('tools')\n      .description('List available MCP tools (cached 24h)')\n      .option('--refresh', 'Force refresh schema cache')\n      .action(async (opts: { refresh?: boolean }) => {\n        try {\n          const { loadSchema, saveSchema } = await import('./mcp/schema-cache.js')\n          const { formatToolsTable } = await import('./mcp/format.js')\n          const { visibleRemoteTools } = await import('./mcp/tool-visibility.js')\n          const { loadConfig } = await import('./config/index.js')\n          const { createConfiguredGraphMcpFetch, resolveGraphMcpEndpoint } = await import('./mcp/client.js')\n          const config = await loadConfig()\n          const graphMcpEndpoint = resolveGraphMcpEndpoint(config)\n          let tools = opts.refresh ? null : await loadSchema(graphMcpEndpoint)\n          if (!tools) {\n            const paymentFetch = await createConfiguredGraphMcpFetch(config)\n            const { Client } = await import('@modelcontextprotocol/sdk/client/index.js')\n            const { StreamableHTTPClientTransport } = await import('@modelcontextprotocol/sdk/client/streamableHttp.js')\n            const client = new Client({ name: 'chain-insights-cli', version: PACKAGE_VERSION })\n            await client.connect(new StreamableHTTPClientTransport(new URL(graphMcpEndpoint), { fetch: paymentFetch }))\n            try {\n              const result = await client.listTools()\n              tools = result.tools as Array<{ name: string; description?: string }>\n              await saveSchema(tools, graphMcpEndpoint)\n            } finally {\n              await client.close()\n            }\n          }\n          console.log(formatToolsTable(visibleRemoteTools(tools)))\n        } catch (err) {\n          console.error((err as Error).message)\n          process.exit(1)\n        }\n      })\n  )\n  .addCommand(\n    new Command('aml-address-risk')\n      .description('Screen an address for AML risk, exchange behavior, and optional comparison with another address')\n      .requiredOption('--address <address>', 'Full blockchain address to screen')\n      .requiredOption('--network <network>', 'Network to query. Run `cia mcp networks` for supported networks.')\n      .option('--compare-address <address>', 'Optional second address to compare against the screened address')\n      .option('--topology-scope <scope>', 'Which topology graph to query: live_topology (default) or archive_topology (full history)')\n      .action(async (opts: { address: string; network: string; compareAddress?: string; topologyScope?: string }) => {\n        try {\n          const topologyScope = resolveTopologyScopeOption(opts.topologyScope)\n          await withGraphMcpClient('chain-insights-cli-aml-address-risk', async (client) => {\n            const { addressRisk } = await import('./investigation/public-tools.js')\n            const result = await addressRisk(client, {\n              address: opts.address,\n              network: opts.network,\n              compareAddress: opts.compareAddress,\n              topologyScope,\n            })\n            console.log(result.summaryText)\n          })\n        } catch (err) {\n          console.error((err as Error).message)\n          process.exit(1)\n        }\n      })\n  )\n  .addCommand(\n    new Command('aml-trace-victim-funds')\n      .description('Trace victim/source addresses forward to exchange deposit candidates')\n      .requiredOption('--victim-addresses <addresses>', 'Comma-separated full victim/source addresses, max 5')\n      .requiredOption('--network <network>', 'Network to query. Run `cia mcp networks` for supported networks.')\n      .option('--known-suspect-addresses <addresses>', 'Optional known suspect addresses for context only, max 5')\n      .option('--incident-timestamp-ms <milliseconds>', 'Optional incident timestamp in milliseconds')\n      .option('--max-hops <number>', 'Maximum trace hops, 1-5')\n      .option('--per-address-limit <number>', 'Maximum exchange paths/results per address, 1-10')\n      .option('--min-amount-sum <number>', 'Minimum USD amount (amount_usd_sum) for traced edges')\n      .option('--topology-scope <scope>', 'Which topology graph to query: live_topology (default) or archive_topology (full history)')\n      .action(async (opts: {\n        victimAddresses: string\n        network: string\n        knownSuspectAddresses?: string\n        incidentTimestampMs?: string\n        maxHops?: string\n        perAddressLimit?: string\n        minAmountSum?: string\n        topologyScope?: string\n      }) => {\n        try {\n          const topologyScope = resolveTopologyScopeOption(opts.topologyScope)\n          const { requireWorkspaceRoot } = await import('./workspace/output-root.js')\n          requireWorkspaceRoot()\n          await withGraphMcpClient('chain-insights-cli-aml-trace-victim-funds', async (client, config) => {\n            const { traceVictimFunds } = await import('./investigation/public-tools.js')\n            const result = await traceVictimFunds(client, config, {\n              victimAddresses: opts.victimAddresses,\n              knownSuspectAddresses: opts.knownSuspectAddresses,\n              network: opts.network,\n              incidentTimestampMs: optionalNumber(opts.incidentTimestampMs),\n              maxHops: optionalNumber(opts.maxHops),\n              perAddressLimit: optionalNumber(opts.perAddressLimit),\n              minAmountSum: optionalNumber(opts.minAmountSum),\n              topologyScope,\n            })\n            console.log(result.summaryText)\n            console.log(JSON.stringify(result.structuredContent, null, 2))\n          })\n        } catch (err) {\n          console.error((err as Error).message)\n          process.exit(1)\n        }\n      })\n  )\n  .addCommand(\n    new Command('aml-trace-suspect-funds')\n      .description('Trace suspected scammer, mule, operator, or laundering-ring addresses forward to cashout topology')\n      .requiredOption('--network <network>', 'Network to query. Run `cia mcp networks` for supported networks.')\n      .requiredOption('--suspect-addresses <addresses>', 'Comma-separated full suspect-controlled addresses, max 5')\n      .option('--incident-timestamp-ms <milliseconds>', 'Optional incident timestamp in milliseconds')\n      .option('--max-hops <number>', 'Maximum trace hops, default 3, max 5')\n      .option('--per-address-limit <number>', 'Maximum exchange paths/results per address, 1-10')\n      .option('--min-amount-sum <number>', 'Minimum USD amount (amount_usd_sum) for traced edges')\n      .option('--topology-scope <scope>', 'Which topology graph to query: live_topology (default) or archive_topology (full history)')\n      .action(async (opts: {\n        network: string\n        suspectAddresses: string\n        incidentTimestampMs?: string\n        maxHops?: string\n        perAddressLimit?: string\n        minAmountSum?: string\n        topologyScope?: string\n      }) => {\n        try {\n          const topologyScope = resolveTopologyScopeOption(opts.topologyScope)\n          const { requireWorkspaceRoot } = await import('./workspace/output-root.js')\n          requireWorkspaceRoot()\n          await withGraphMcpClient('chain-insights-cli-aml-trace-suspect-funds', async (client, config) => {\n            const { traceSuspectFunds } = await import('./investigation/public-tools.js')\n            const result = await traceSuspectFunds(client, config, {\n              suspectAddresses: opts.suspectAddresses,\n              network: opts.network,\n              maxHops: optionalNumber(opts.maxHops),\n              perAddressLimit: optionalNumber(opts.perAddressLimit),\n              minAmountSum: optionalNumber(opts.minAmountSum),\n              incidentTimestampMs: optionalNumber(opts.incidentTimestampMs),\n              topologyScope,\n            })\n            console.log(result.summaryText)\n            console.log(JSON.stringify(result.structuredContent, null, 2))\n          })\n        } catch (err) {\n          console.error((err as Error).message)\n          process.exit(1)\n        }\n      })\n  )\n  .addCommand(\n    new Command('aml-trace-deposit-sources')\n      .description('Trace backward from suspected deposit/cashout addresses to upstream sources and convergence')\n      .requiredOption('--network <network>', 'Network to query. Run `cia mcp networks` for supported networks.')\n      .requiredOption('--deposit-addresses <addresses>', 'Comma-separated full suspected deposit/cashout addresses, max 5')\n      .option('--max-hops <number>', 'Maximum reverse traceback hops, default 2, max 5')\n      .option('--topology-scope <scope>', 'Which topology graph to query: live_topology (default) or archive_topology (full history)')\n      .action(async (opts: {\n        network: string\n        depositAddresses: string\n        maxHops?: string\n        topologyScope?: string\n      }) => {\n        try {\n          const topologyScope = resolveTopologyScopeOption(opts.topologyScope)\n          const { requireWorkspaceRoot } = await import('./workspace/output-root.js')\n          requireWorkspaceRoot()\n          await withGraphMcpClient('chain-insights-cli-aml-trace-deposit-sources', async (client, config) => {\n            const { traceDepositSources } = await import('./investigation/public-tools.js')\n            const result = await traceDepositSources(client, config, {\n              depositAddresses: opts.depositAddresses,\n              network: opts.network,\n              maxHops: optionalNumber(opts.maxHops),\n              topologyScope,\n            })\n            console.log(result.summaryText)\n            console.log(JSON.stringify(result.structuredContent, null, 2))\n          })\n        } catch (err) {\n          console.error((err as Error).message)\n          process.exit(1)\n        }\n      })\n  )\n  .addCommand(\n    new Command('call')\n      .description('Call an MCP tool directly (debug)')\n      .argument('<tool>', 'Tool name to call')\n      .argument('[args...]', 'Key=value arguments (e.g. address=5Seed network=bittensor)')\n      .action(async (tool: string, rawArgs: string[]) => {\n        try {\n          const { parseMcpCallArgs } = await import('./mcp/call-args.js')\n          const { assertPublicMcpToolName, validatePublicMcpToolArguments } = await import('./mcp/tool-visibility.js')\n          const args = parseMcpCallArgs(rawArgs)\n          assertPublicMcpToolName(tool)\n          validatePublicMcpToolArguments(tool, args)\n\n          if (tool === 'wallet_balance') {\n            const { getWalletBalanceText } = await import('./wallet/tools.js')\n            console.log(await getWalletBalanceText())\n            return\n          }\n\n          if (tool === 'meta_network_capabilities') {\n            await printNetworkCapabilities({ json: true })\n            return\n          }\n\n          if (tool === 'meta_help') {\n            console.log('Chain Insights tools: aml_*, graph_query, graph_query_batch, meta_*, and wallet_balance.')\n            return\n          }\n\n          await withGraphMcpClient('chain-insights-cli-call', async (client, config) => {\n            if (tool === 'meta_usage_status') {\n              try {\n                const result = await client.callTool({ name: 'usage_status', arguments: {} })\n                printMcpTextContent(result as { content?: Array<{ type: string; text?: string }> })\n              } catch (err) {\n                const { isMissingUsageStatusToolError, primitiveBackendUsageStatus, usageStatusText } = await import('./mcp/usage-status.js')\n                if (!isMissingUsageStatusToolError(err)) throw err\n                const { resolveGraphMcpEndpoint } = await import('./mcp/client.js')\n                console.log(usageStatusText(primitiveBackendUsageStatus(resolveGraphMcpEndpoint(config))))\n              }\n              return\n            }\n            if (tool === 'aml_address_risk') {\n              const { addressRisk } = await import('./investigation/public-tools.js')\n              const result = await addressRisk(client, {\n                address: String(args['address'] ?? ''),\n                network: String(args['network'] ?? ''),\n                compareAddress: args['compare_address'] === undefined ? undefined : String(args['compare_address']),\n                topologyScope: args['topology_scope'] as 'live_topology' | 'archive_topology' | undefined,\n              })\n              console.log(result.summaryText)\n              return\n            }\n            if (tool === 'aml_trace_victim_funds') {\n              const { traceVictimFunds } = await import('./investigation/public-tools.js')\n              const result = await traceVictimFunds(client, config, {\n                victimAddresses: args['victim_addresses'] as string | string[] | undefined ?? '',\n                knownSuspectAddresses: args['known_suspect_addresses'] as string | string[] | undefined,\n                network: String(args['network'] ?? ''),\n                incidentTimestampMs: optionalNumberArg(args['incident_timestamp_ms'], 'incident_timestamp_ms'),\n                maxHops: typeof args['max_hops'] === 'number' ? args['max_hops'] : undefined,\n                topologyScope: args['topology_scope'] as 'live_topology' | 'archive_topology' | undefined,\n              })\n              console.log(result.summaryText)\n              console.log(JSON.stringify(result.structuredContent, null, 2))\n              return\n            }\n            if (tool === 'aml_trace_suspect_funds') {\n              const { traceSuspectFunds } = await import('./investigation/public-tools.js')\n              const result = await traceSuspectFunds(client, config, {\n                suspectAddresses: args['suspect_addresses'] as string | string[] | undefined ?? '',\n                network: String(args['network'] ?? ''),\n                maxHops: typeof args['max_hops'] === 'number' ? args['max_hops'] : undefined,\n                incidentTimestampMs: optionalNumberArg(args['incident_timestamp_ms'], 'incident_timestamp_ms'),\n                topologyScope: args['topology_scope'] as 'live_topology' | 'archive_topology' | undefined,\n              })\n              console.log(result.summaryText)\n              console.log(JSON.stringify(result.structuredContent, null, 2))\n              return\n            }\n            if (tool === 'aml_trace_deposit_sources') {\n              const { traceDepositSources } = await import('./investigation/public-tools.js')\n              const result = await traceDepositSources(client, config, {\n                depositAddresses: args['deposit_addresses'] as string | string[] | undefined ?? '',\n                network: String(args['network'] ?? ''),\n                maxHops: typeof args['max_hops'] === 'number' ? args['max_hops'] : undefined,\n                topologyScope: args['topology_scope'] as 'live_topology' | 'archive_topology' | undefined,\n              })\n              console.log(result.summaryText)\n              console.log(JSON.stringify(result.structuredContent, null, 2))\n              return\n            }\n            const result = await client.callTool({ name: tool, arguments: args })\n            printMcpTextContent(result as { content?: Array<{ type: string; text?: string }> })\n          })\n        } catch (err) {\n          console.error((err as Error).message)\n          process.exit(1)\n        }\n      })\n  )\n\n\n\nprogram\n  .command('viz')\n  .description('Generate a workspace visualization')\n  .argument('[source-id]', 'Workspace graph report ID to render')\n  .option('--data <file>', 'Raw transaction JSON file for ad-hoc visualization')\n  .option('-p, --port <number>', 'Server port (defaults to the configured serverPort)')\n  .action(async (sourceId: string | undefined, opts: { data?: string; port?: string }) => {\n    try {\n      if (!sourceId && !opts.data) {\n        console.error('Provide either a visualization source ID or --data <file.json>')\n        process.exit(1)\n      }\n      const { loadConfig } = await import('./config/index.js')\n      const { resolveServerPort } = await import('./server/resolve-port.js')\n      const config = await loadConfig()\n      const port = resolveServerPort(opts.port, config.serverPort)\n      const { generateVisualization } = await import('./viz/index.js')\n      const result = await generateVisualization({ sourceId, dataFile: opts.data })\n      const { startServer } = await import('./server/index.js')\n      startServer(port)\n      const url = `http://127.0.0.1:${port}/viz/${result.vizId}`\n      console.log(`Visualization: ${url}`)\n      const open = (await import('open')).default\n      await open(url)\n    } catch (err) {\n      console.error((err as Error).message)\n      process.exit(1)\n    }\n  })\n\n// parseAsync (not parse) so a rejected async action surfaces as a clean\n// one-line error and a non-zero exit, instead of an unhandled-rejection stack\n// trace. Commands with their own try/catch still exit(1) before this fires.\nprogram.parseAsync(process.argv).catch((err) => {\n  console.error((err as Error).message)\n  process.exit(1)\n})\n"],"mappings":";;;;;;;;;;;;;AAYA,SAAgB,oBAAoB,QAA6B;CAC/D,MAAM,SAAS,OAAO,WAAW,CAAC,EAAA,CAC/B,QAAQ,SAAS,KAAK,SAAS,MAAM,CAAC,CACtC,KAAK,SAAS,KAAK,QAAQ,EAAE;CAEhC,IAAI,OAAO,SACT,MAAM,IAAI,MAAM,MAAM,KAAK,IAAI,CAAC,CAAC,KAAK,KAAK,4BAA4B;CAGzE,KAAK,MAAM,QAAQ,OAAO,QAAQ,IAAI,IAAI;AAC5C;;;ACdA,MAAM,YAAY,KAAK,QAAQ,cAAc,OAAO,KAAK,GAAG,CAAC;AAC7D,MAAM,gBAAgB,KAAK,QAAQ,WAAW,MAAM,OAAO,aAAa;AAExE,MAAM,UAAU,IAAI,QAAQ;AAE5B,QACG,KAAK,gBAAgB,CAAC,CACtB,YAAY,mDAAmD,CAAC,CAChE,QAAQ,aAAa,OAAO,CAAC,CAC7B,OAAO,YAAY,0DAA0D,CAAC,CAC9E,OAAO,WAAW,oEAAoE,CAAC,CACvF,OAAO,YAAY,qFAAqF;AAG3G,MAAM,UAAU,QAAQ,KAAK,MAAM,CAAC;AACpC,MAAM,iBAAiB,QAAQ,QAAO,MAAK,MAAM,cAAc,MAAM,aAAa,MAAM,UAAU;AAGlG,MAAM,qBAAqB,QAAQ,MAAK,MAAK,MAAM,YAAY,MAAM,QAAQ,MAAM,eAAe,MAAM,IAAI;AAC5G,IAAI,eAAe,SAAS,KAAK,CAAC,sBAAsB,CAAC,QAAQ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