@general-liquidity/gordon-cli 0.75.13 → 0.75.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +1986 -545
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -14365,6 +14365,15 @@ __export(exports_env, {
14365
14365
  import { existsSync as existsSync2 } from "fs";
14366
14366
  import { mkdir as mkdir2 } from "fs/promises";
14367
14367
  import { join as join3 } from "path";
14368
+ function escapeEnvValue(value) {
14369
+ return value.replace(/'/g, "'\\''");
14370
+ }
14371
+ function unescapeEnvValue(value) {
14372
+ return value.replace(/'\\''/g, "'");
14373
+ }
14374
+ function formatEnvLine(key, value) {
14375
+ return `${key}='${escapeEnvValue(value)}'`;
14376
+ }
14368
14377
  function parseEnvContent(content) {
14369
14378
  const result = {};
14370
14379
  for (const line of content.split(`
@@ -14377,7 +14386,9 @@ function parseEnvContent(content) {
14377
14386
  if (match) {
14378
14387
  const key = match[1]?.trim();
14379
14388
  let value = match[2]?.trim() ?? "";
14380
- if (value.startsWith("'") && value.endsWith("'") || value.startsWith('"') && value.endsWith('"')) {
14389
+ if (value.startsWith("'") && value.endsWith("'")) {
14390
+ value = unescapeEnvValue(value.slice(1, -1));
14391
+ } else if (value.startsWith('"') && value.endsWith('"')) {
14381
14392
  value = value.slice(1, -1);
14382
14393
  }
14383
14394
  if (key) {
@@ -14396,77 +14407,38 @@ function findEnvFilePath() {
14396
14407
  }
14397
14408
  return null;
14398
14409
  }
14399
- async function checkEnvStatus() {
14400
- const envPath = findEnvFilePath();
14401
- const fileExists = envPath !== null;
14402
- if (!fileExists) {
14403
- const keys2 = {
14404
- OPENAI_API_KEY: process.env.OPENAI_API_KEY,
14405
- DEDALUS_API_KEY: process.env.DEDALUS_API_KEY,
14406
- BINANCE_API_KEY: process.env.BINANCE_API_KEY,
14407
- BINANCE_API_SECRET: process.env.BINANCE_API_SECRET,
14408
- BINANCE_US_API_KEY: process.env.BINANCE_US_API_KEY,
14409
- BINANCE_US_API_SECRET: process.env.BINANCE_US_API_SECRET,
14410
- COINBASE_API_KEY: process.env.COINBASE_API_KEY,
14411
- COINBASE_API_SECRET: process.env.COINBASE_API_SECRET,
14412
- COINBASE_PASSPHRASE: process.env.COINBASE_PASSPHRASE,
14413
- KRAKEN_API_KEY: process.env.KRAKEN_API_KEY,
14414
- KRAKEN_API_SECRET: process.env.KRAKEN_API_SECRET,
14415
- BITFINEX_API_KEY: process.env.BITFINEX_API_KEY,
14416
- BITFINEX_API_SECRET: process.env.BITFINEX_API_SECRET,
14417
- HYPERLIQUID_PRIVATE_KEY: process.env.HYPERLIQUID_PRIVATE_KEY,
14418
- UNISWAP_API_KEY: process.env.UNISWAP_API_KEY,
14419
- THEGRAPH_API_KEY: process.env.THEGRAPH_API_KEY
14420
- };
14421
- return {
14422
- fileExists: false,
14423
- hasLLMKey: !!(keys2.OPENAI_API_KEY || keys2.DEDALUS_API_KEY),
14424
- hasBinanceKeys: !!(keys2.BINANCE_API_KEY && keys2.BINANCE_API_SECRET),
14425
- hasBinanceUSKeys: !!(keys2.BINANCE_US_API_KEY && keys2.BINANCE_US_API_SECRET),
14426
- hasCoinbaseKeys: !!(keys2.COINBASE_API_KEY && keys2.COINBASE_API_SECRET),
14427
- hasKrakenKeys: !!(keys2.KRAKEN_API_KEY && keys2.KRAKEN_API_SECRET),
14428
- hasBitfinexKeys: !!(keys2.BITFINEX_API_KEY && keys2.BITFINEX_API_SECRET),
14429
- hasHyperliquidKey: !!keys2.HYPERLIQUID_PRIVATE_KEY,
14430
- hasUniswapKey: !!keys2.UNISWAP_API_KEY,
14431
- hasGraphKey: !!keys2.THEGRAPH_API_KEY,
14432
- keys: keys2
14433
- };
14434
- }
14435
- const file2 = Bun.file(envPath);
14436
- const content = await file2.text();
14437
- const parsed = parseEnvContent(content);
14438
- const keys = {
14439
- OPENAI_API_KEY: parsed.OPENAI_API_KEY || process.env.OPENAI_API_KEY,
14440
- DEDALUS_API_KEY: parsed.DEDALUS_API_KEY || process.env.DEDALUS_API_KEY,
14441
- BINANCE_API_KEY: parsed.BINANCE_API_KEY || process.env.BINANCE_API_KEY,
14442
- BINANCE_API_SECRET: parsed.BINANCE_API_SECRET || process.env.BINANCE_API_SECRET,
14443
- BINANCE_US_API_KEY: parsed.BINANCE_US_API_KEY || process.env.BINANCE_US_API_KEY,
14444
- BINANCE_US_API_SECRET: parsed.BINANCE_US_API_SECRET || process.env.BINANCE_US_API_SECRET,
14445
- COINBASE_API_KEY: parsed.COINBASE_API_KEY || process.env.COINBASE_API_KEY,
14446
- COINBASE_API_SECRET: parsed.COINBASE_API_SECRET || process.env.COINBASE_API_SECRET,
14447
- COINBASE_PASSPHRASE: parsed.COINBASE_PASSPHRASE || process.env.COINBASE_PASSPHRASE,
14448
- KRAKEN_API_KEY: parsed.KRAKEN_API_KEY || process.env.KRAKEN_API_KEY,
14449
- KRAKEN_API_SECRET: parsed.KRAKEN_API_SECRET || process.env.KRAKEN_API_SECRET,
14450
- BITFINEX_API_KEY: parsed.BITFINEX_API_KEY || process.env.BITFINEX_API_KEY,
14451
- BITFINEX_API_SECRET: parsed.BITFINEX_API_SECRET || process.env.BITFINEX_API_SECRET,
14452
- HYPERLIQUID_PRIVATE_KEY: parsed.HYPERLIQUID_PRIVATE_KEY || process.env.HYPERLIQUID_PRIVATE_KEY,
14453
- UNISWAP_API_KEY: parsed.UNISWAP_API_KEY || process.env.UNISWAP_API_KEY,
14454
- THEGRAPH_API_KEY: parsed.THEGRAPH_API_KEY || process.env.THEGRAPH_API_KEY
14455
- };
14456
- return {
14457
- fileExists: true,
14410
+ function buildEnvStatus(keys, fileExists) {
14411
+ return {
14412
+ fileExists,
14458
14413
  hasLLMKey: !!(keys.OPENAI_API_KEY || keys.DEDALUS_API_KEY),
14459
14414
  hasBinanceKeys: !!(keys.BINANCE_API_KEY && keys.BINANCE_API_SECRET),
14460
14415
  hasBinanceUSKeys: !!(keys.BINANCE_US_API_KEY && keys.BINANCE_US_API_SECRET),
14461
- hasCoinbaseKeys: !!(keys.COINBASE_API_KEY && keys.COINBASE_API_SECRET),
14416
+ hasCoinbaseKeys: !!(keys.COINBASE_API_KEY && keys.COINBASE_API_SECRET && keys.COINBASE_PASSPHRASE),
14462
14417
  hasKrakenKeys: !!(keys.KRAKEN_API_KEY && keys.KRAKEN_API_SECRET),
14463
14418
  hasBitfinexKeys: !!(keys.BITFINEX_API_KEY && keys.BITFINEX_API_SECRET),
14464
14419
  hasHyperliquidKey: !!keys.HYPERLIQUID_PRIVATE_KEY,
14465
14420
  hasUniswapKey: !!keys.UNISWAP_API_KEY,
14466
14421
  hasGraphKey: !!keys.THEGRAPH_API_KEY,
14422
+ hasSolanaKey: !!keys.SOLANA_PRIVATE_KEY,
14423
+ hasPolkadotKey: !!(keys.POLKADOT_MNEMONIC || keys.POLKADOT_PRIVATE_KEY),
14424
+ hasChainlinkStreamsKeys: !!(keys.CHAINLINK_API_KEY && keys.CHAINLINK_API_SECRET),
14425
+ hasChainlinkCCIPKey: !!keys.EVM_PRIVATE_KEY,
14426
+ hasCDPKeys: !!(keys.CDP_API_KEY_ID && keys.CDP_API_KEY_SECRET && keys.CDP_WALLET_SECRET),
14427
+ hasBasescanKey: !!keys.BASESCAN_API_KEY,
14428
+ hasSynthDataKey: !!keys.SYNTHDATA_API_KEY,
14467
14429
  keys
14468
14430
  };
14469
14431
  }
14432
+ async function checkEnvStatus() {
14433
+ const envPath = findEnvFilePath();
14434
+ const fileExists = envPath !== null;
14435
+ const parsed = fileExists ? parseEnvContent(await Bun.file(envPath).text()) : {};
14436
+ const keys = {};
14437
+ for (const name of ENV_KEY_NAMES) {
14438
+ keys[name] = parsed[name] || process.env[name];
14439
+ }
14440
+ return buildEnvStatus(keys, fileExists);
14441
+ }
14470
14442
  async function loadEnvFile() {
14471
14443
  const envPath = findEnvFilePath();
14472
14444
  if (envPath) {
@@ -14535,7 +14507,7 @@ async function saveEnvKeys(newKeys) {
14535
14507
  const updatedKeys = { ...existingKeys };
14536
14508
  for (const [key, value] of Object.entries(newKeys)) {
14537
14509
  if (value) {
14538
- updatedKeys[key] = `${key}='${value}'`;
14510
+ updatedKeys[key] = formatEnvLine(key, value);
14539
14511
  process.env[key] = value;
14540
14512
  }
14541
14513
  }
@@ -14578,87 +14550,196 @@ async function createEnvFile(keys) {
14578
14550
  "# LLM Provider (pick one)"
14579
14551
  ];
14580
14552
  if (keys.OPENAI_API_KEY) {
14581
- lines.push(`OPENAI_API_KEY='${keys.OPENAI_API_KEY}'`);
14553
+ lines.push(formatEnvLine("OPENAI_API_KEY", keys.OPENAI_API_KEY));
14582
14554
  } else {
14583
14555
  lines.push("# OPENAI_API_KEY=sk-...");
14584
14556
  }
14585
14557
  if (keys.DEDALUS_API_KEY) {
14586
- lines.push(`DEDALUS_API_KEY='${keys.DEDALUS_API_KEY}'`);
14558
+ lines.push(formatEnvLine("DEDALUS_API_KEY", keys.DEDALUS_API_KEY));
14587
14559
  } else {
14588
14560
  lines.push("# DEDALUS_API_KEY=dd-...");
14589
14561
  }
14590
14562
  lines.push("");
14591
14563
  lines.push("# Binance (required for trading)");
14592
14564
  if (keys.BINANCE_API_KEY) {
14593
- lines.push(`BINANCE_API_KEY='${keys.BINANCE_API_KEY}'`);
14565
+ lines.push(formatEnvLine("BINANCE_API_KEY", keys.BINANCE_API_KEY));
14594
14566
  } else {
14595
14567
  lines.push("# BINANCE_API_KEY=");
14596
14568
  }
14597
14569
  if (keys.BINANCE_API_SECRET) {
14598
- lines.push(`BINANCE_API_SECRET='${keys.BINANCE_API_SECRET}'`);
14570
+ lines.push(formatEnvLine("BINANCE_API_SECRET", keys.BINANCE_API_SECRET));
14599
14571
  } else {
14600
14572
  lines.push("# BINANCE_API_SECRET=");
14601
14573
  }
14602
14574
  lines.push("");
14603
14575
  lines.push("# Binance US (alternative for US users)");
14604
14576
  if (keys.BINANCE_US_API_KEY) {
14605
- lines.push(`BINANCE_US_API_KEY='${keys.BINANCE_US_API_KEY}'`);
14577
+ lines.push(formatEnvLine("BINANCE_US_API_KEY", keys.BINANCE_US_API_KEY));
14606
14578
  } else {
14607
14579
  lines.push("# BINANCE_US_API_KEY=");
14608
14580
  }
14609
14581
  if (keys.BINANCE_US_API_SECRET) {
14610
- lines.push(`BINANCE_US_API_SECRET='${keys.BINANCE_US_API_SECRET}'`);
14582
+ lines.push(formatEnvLine("BINANCE_US_API_SECRET", keys.BINANCE_US_API_SECRET));
14611
14583
  } else {
14612
14584
  lines.push("# BINANCE_US_API_SECRET=");
14613
14585
  }
14614
14586
  lines.push("");
14615
14587
  lines.push("# Coinbase");
14616
14588
  if (keys.COINBASE_API_KEY) {
14617
- lines.push(`COINBASE_API_KEY='${keys.COINBASE_API_KEY}'`);
14589
+ lines.push(formatEnvLine("COINBASE_API_KEY", keys.COINBASE_API_KEY));
14618
14590
  } else {
14619
14591
  lines.push("# COINBASE_API_KEY=");
14620
14592
  }
14621
14593
  if (keys.COINBASE_API_SECRET) {
14622
- lines.push(`COINBASE_API_SECRET='${keys.COINBASE_API_SECRET}'`);
14594
+ lines.push(formatEnvLine("COINBASE_API_SECRET", keys.COINBASE_API_SECRET));
14623
14595
  } else {
14624
14596
  lines.push("# COINBASE_API_SECRET=");
14625
14597
  }
14626
14598
  if (keys.COINBASE_PASSPHRASE) {
14627
- lines.push(`COINBASE_PASSPHRASE='${keys.COINBASE_PASSPHRASE}'`);
14599
+ lines.push(formatEnvLine("COINBASE_PASSPHRASE", keys.COINBASE_PASSPHRASE));
14628
14600
  } else {
14629
14601
  lines.push("# COINBASE_PASSPHRASE=");
14630
14602
  }
14631
14603
  lines.push("");
14632
14604
  lines.push("# Kraken");
14633
14605
  if (keys.KRAKEN_API_KEY) {
14634
- lines.push(`KRAKEN_API_KEY='${keys.KRAKEN_API_KEY}'`);
14606
+ lines.push(formatEnvLine("KRAKEN_API_KEY", keys.KRAKEN_API_KEY));
14635
14607
  } else {
14636
14608
  lines.push("# KRAKEN_API_KEY=");
14637
14609
  }
14638
14610
  if (keys.KRAKEN_API_SECRET) {
14639
- lines.push(`KRAKEN_API_SECRET='${keys.KRAKEN_API_SECRET}'`);
14611
+ lines.push(formatEnvLine("KRAKEN_API_SECRET", keys.KRAKEN_API_SECRET));
14640
14612
  } else {
14641
14613
  lines.push("# KRAKEN_API_SECRET=");
14642
14614
  }
14643
14615
  lines.push("");
14644
14616
  lines.push("# Bitfinex");
14645
14617
  if (keys.BITFINEX_API_KEY) {
14646
- lines.push(`BITFINEX_API_KEY='${keys.BITFINEX_API_KEY}'`);
14618
+ lines.push(formatEnvLine("BITFINEX_API_KEY", keys.BITFINEX_API_KEY));
14647
14619
  } else {
14648
14620
  lines.push("# BITFINEX_API_KEY=");
14649
14621
  }
14650
14622
  if (keys.BITFINEX_API_SECRET) {
14651
- lines.push(`BITFINEX_API_SECRET='${keys.BITFINEX_API_SECRET}'`);
14623
+ lines.push(formatEnvLine("BITFINEX_API_SECRET", keys.BITFINEX_API_SECRET));
14652
14624
  } else {
14653
14625
  lines.push("# BITFINEX_API_SECRET=");
14654
14626
  }
14655
14627
  lines.push("");
14656
14628
  lines.push("# Hyperliquid");
14657
14629
  if (keys.HYPERLIQUID_PRIVATE_KEY) {
14658
- lines.push(`HYPERLIQUID_PRIVATE_KEY='${keys.HYPERLIQUID_PRIVATE_KEY}'`);
14630
+ lines.push(formatEnvLine("HYPERLIQUID_PRIVATE_KEY", keys.HYPERLIQUID_PRIVATE_KEY));
14659
14631
  } else {
14660
14632
  lines.push("# HYPERLIQUID_PRIVATE_KEY=");
14661
14633
  }
14634
+ lines.push("");
14635
+ lines.push("# Uniswap");
14636
+ if (keys.UNISWAP_API_KEY) {
14637
+ lines.push(formatEnvLine("UNISWAP_API_KEY", keys.UNISWAP_API_KEY));
14638
+ } else {
14639
+ lines.push("# UNISWAP_API_KEY=");
14640
+ }
14641
+ lines.push("");
14642
+ lines.push("# The Graph (subgraph queries for DeFi protocols)");
14643
+ if (keys.THEGRAPH_API_KEY) {
14644
+ lines.push(formatEnvLine("THEGRAPH_API_KEY", keys.THEGRAPH_API_KEY));
14645
+ } else {
14646
+ lines.push("# THEGRAPH_API_KEY=");
14647
+ }
14648
+ lines.push("");
14649
+ lines.push("# ---- Blockchain Networks ----");
14650
+ lines.push("");
14651
+ lines.push("# Solana (DeFi, token swaps, staking, lending \u2014 60+ tools)");
14652
+ if (keys.SOLANA_PRIVATE_KEY) {
14653
+ lines.push(formatEnvLine("SOLANA_PRIVATE_KEY", keys.SOLANA_PRIVATE_KEY));
14654
+ } else {
14655
+ lines.push("# SOLANA_PRIVATE_KEY=");
14656
+ }
14657
+ if (keys.SOLANA_RPC_URL) {
14658
+ lines.push(formatEnvLine("SOLANA_RPC_URL", keys.SOLANA_RPC_URL));
14659
+ } else {
14660
+ lines.push("# SOLANA_RPC_URL=https://api.mainnet-beta.solana.com");
14661
+ }
14662
+ lines.push("");
14663
+ lines.push("# Polkadot (cross-chain swaps, staking, governance)");
14664
+ if (keys.POLKADOT_MNEMONIC) {
14665
+ lines.push(formatEnvLine("POLKADOT_MNEMONIC", keys.POLKADOT_MNEMONIC));
14666
+ } else {
14667
+ lines.push("# POLKADOT_MNEMONIC=");
14668
+ }
14669
+ if (keys.POLKADOT_PRIVATE_KEY) {
14670
+ lines.push(formatEnvLine("POLKADOT_PRIVATE_KEY", keys.POLKADOT_PRIVATE_KEY));
14671
+ } else {
14672
+ lines.push("# POLKADOT_PRIVATE_KEY=");
14673
+ }
14674
+ lines.push("");
14675
+ lines.push("# Chainlink Data Streams (real-time institutional-grade price feeds)");
14676
+ if (keys.CHAINLINK_API_KEY) {
14677
+ lines.push(formatEnvLine("CHAINLINK_API_KEY", keys.CHAINLINK_API_KEY));
14678
+ } else {
14679
+ lines.push("# CHAINLINK_API_KEY=");
14680
+ }
14681
+ if (keys.CHAINLINK_API_SECRET) {
14682
+ lines.push(formatEnvLine("CHAINLINK_API_SECRET", keys.CHAINLINK_API_SECRET));
14683
+ } else {
14684
+ lines.push("# CHAINLINK_API_SECRET=");
14685
+ }
14686
+ lines.push("");
14687
+ lines.push("# EVM Private Key (Chainlink CCIP cross-chain bridging)");
14688
+ if (keys.EVM_PRIVATE_KEY) {
14689
+ lines.push(formatEnvLine("EVM_PRIVATE_KEY", keys.EVM_PRIVATE_KEY));
14690
+ } else {
14691
+ lines.push("# EVM_PRIVATE_KEY=0x...");
14692
+ }
14693
+ lines.push("");
14694
+ lines.push("# Coinbase CDP (Base smart wallets, onchain actions)");
14695
+ if (keys.CDP_API_KEY_ID) {
14696
+ lines.push(formatEnvLine("CDP_API_KEY_ID", keys.CDP_API_KEY_ID));
14697
+ } else {
14698
+ lines.push("# CDP_API_KEY_ID=");
14699
+ }
14700
+ if (keys.CDP_API_KEY_SECRET) {
14701
+ lines.push(formatEnvLine("CDP_API_KEY_SECRET", keys.CDP_API_KEY_SECRET));
14702
+ } else {
14703
+ lines.push("# CDP_API_KEY_SECRET=");
14704
+ }
14705
+ if (keys.CDP_WALLET_SECRET) {
14706
+ lines.push(formatEnvLine("CDP_WALLET_SECRET", keys.CDP_WALLET_SECRET));
14707
+ } else {
14708
+ lines.push("# CDP_WALLET_SECRET=");
14709
+ }
14710
+ if (keys.CDP_NETWORK_ID) {
14711
+ lines.push(formatEnvLine("CDP_NETWORK_ID", keys.CDP_NETWORK_ID));
14712
+ } else {
14713
+ lines.push("# CDP_NETWORK_ID=base-mainnet");
14714
+ }
14715
+ lines.push("");
14716
+ lines.push("# Basescan (optional \u2014 enables Base L2 whale detection, holder queries)");
14717
+ if (keys.BASESCAN_API_KEY) {
14718
+ lines.push(formatEnvLine("BASESCAN_API_KEY", keys.BASESCAN_API_KEY));
14719
+ } else {
14720
+ lines.push("# BASESCAN_API_KEY=");
14721
+ }
14722
+ lines.push("");
14723
+ lines.push("# ---- Data Providers ----");
14724
+ lines.push("");
14725
+ lines.push("# SynthData (AI probabilistic predictions, volatility, LP optimization)");
14726
+ if (keys.SYNTHDATA_API_KEY) {
14727
+ lines.push(formatEnvLine("SYNTHDATA_API_KEY", keys.SYNTHDATA_API_KEY));
14728
+ } else {
14729
+ lines.push("# SYNTHDATA_API_KEY=");
14730
+ }
14731
+ lines.push("");
14732
+ lines.push("# ---- Gordon LLM Provider ----");
14733
+ if (keys.GORDON_PROVIDER) {
14734
+ lines.push(formatEnvLine("GORDON_PROVIDER", keys.GORDON_PROVIDER));
14735
+ } else {
14736
+ lines.push("# GORDON_PROVIDER=openai");
14737
+ }
14738
+ if (keys.GORDON_MODEL) {
14739
+ lines.push(formatEnvLine("GORDON_MODEL", keys.GORDON_MODEL));
14740
+ } else {
14741
+ lines.push("# GORDON_MODEL=gpt-4o");
14742
+ }
14662
14743
  await Bun.write(GORDON_ENV_PATH, lines.join(`
14663
14744
  `) + `
14664
14745
  `);
@@ -14698,7 +14779,7 @@ async function isReadyForLLM() {
14698
14779
  }
14699
14780
  return { ready: true };
14700
14781
  }
14701
- var GORDON_ENV_PATH, CWD_ENV_PATH;
14782
+ var GORDON_ENV_PATH, CWD_ENV_PATH, ENV_KEY_NAMES;
14702
14783
  var init_env = __esm(() => {
14703
14784
  init_env_validation();
14704
14785
  init_keyring();
@@ -14706,6 +14787,39 @@ var init_env = __esm(() => {
14706
14787
  init_env_validation();
14707
14788
  GORDON_ENV_PATH = join3(GORDON_DIR, ".env");
14708
14789
  CWD_ENV_PATH = join3(process.cwd(), ".env");
14790
+ ENV_KEY_NAMES = [
14791
+ "OPENAI_API_KEY",
14792
+ "DEDALUS_API_KEY",
14793
+ "BINANCE_API_KEY",
14794
+ "BINANCE_API_SECRET",
14795
+ "BINANCE_US_API_KEY",
14796
+ "BINANCE_US_API_SECRET",
14797
+ "COINBASE_API_KEY",
14798
+ "COINBASE_API_SECRET",
14799
+ "COINBASE_PASSPHRASE",
14800
+ "KRAKEN_API_KEY",
14801
+ "KRAKEN_API_SECRET",
14802
+ "BITFINEX_API_KEY",
14803
+ "BITFINEX_API_SECRET",
14804
+ "HYPERLIQUID_PRIVATE_KEY",
14805
+ "UNISWAP_API_KEY",
14806
+ "THEGRAPH_API_KEY",
14807
+ "GORDON_PROVIDER",
14808
+ "GORDON_MODEL",
14809
+ "SOLANA_PRIVATE_KEY",
14810
+ "SOLANA_RPC_URL",
14811
+ "POLKADOT_MNEMONIC",
14812
+ "POLKADOT_PRIVATE_KEY",
14813
+ "CHAINLINK_API_KEY",
14814
+ "CHAINLINK_API_SECRET",
14815
+ "EVM_PRIVATE_KEY",
14816
+ "CDP_API_KEY_ID",
14817
+ "CDP_API_KEY_SECRET",
14818
+ "CDP_WALLET_SECRET",
14819
+ "CDP_NETWORK_ID",
14820
+ "BASESCAN_API_KEY",
14821
+ "SYNTHDATA_API_KEY"
14822
+ ];
14709
14823
  });
14710
14824
 
14711
14825
  // src/types/config.ts
@@ -299020,6 +299134,48 @@ var init_websocket = __esm(() => {
299020
299134
  }
299021
299135
  };
299022
299136
  });
299137
+
299138
+ // src/infra/exchange/types.ts
299139
+ function resolveExchangeCredentials(config3) {
299140
+ const envMap = config3.type in EXCHANGE_ENV_MAP ? EXCHANGE_ENV_MAP[config3.type] : undefined;
299141
+ const isRedacted = (v) => !v || v === "***";
299142
+ let apiKey = config3.apiKey;
299143
+ let apiSecret = config3.apiSecret;
299144
+ let passphrase = config3.passphrase;
299145
+ let walletPrivateKey = config3.walletPrivateKey;
299146
+ if (envMap) {
299147
+ if (isRedacted(apiKey) && envMap.key)
299148
+ apiKey = process.env[envMap.key] || "";
299149
+ if (isRedacted(apiSecret) && envMap.secret)
299150
+ apiSecret = process.env[envMap.secret] || "";
299151
+ if (isRedacted(passphrase) && envMap.passphrase)
299152
+ passphrase = process.env[envMap.passphrase] || undefined;
299153
+ if (isRedacted(walletPrivateKey) && envMap.wallet)
299154
+ walletPrivateKey = process.env[envMap.wallet] || undefined;
299155
+ }
299156
+ if (isRedacted(apiKey))
299157
+ apiKey = "";
299158
+ if (isRedacted(apiSecret))
299159
+ apiSecret = "";
299160
+ if (isRedacted(passphrase))
299161
+ passphrase = undefined;
299162
+ if (isRedacted(walletPrivateKey))
299163
+ walletPrivateKey = undefined;
299164
+ return { apiKey, apiSecret, passphrase, sandbox: config3.sandbox, walletPrivateKey };
299165
+ }
299166
+ var EXCHANGE_ENV_MAP;
299167
+ var init_types11 = __esm(() => {
299168
+ EXCHANGE_ENV_MAP = {
299169
+ binance: { key: "BINANCE_API_KEY", secret: "BINANCE_API_SECRET" },
299170
+ binance_us: { key: "BINANCE_US_API_KEY", secret: "BINANCE_US_API_SECRET" },
299171
+ coinbase: { key: "COINBASE_API_KEY", secret: "COINBASE_API_SECRET", passphrase: "COINBASE_PASSPHRASE" },
299172
+ kraken: { key: "KRAKEN_API_KEY", secret: "KRAKEN_API_SECRET" },
299173
+ bitfinex: { key: "BITFINEX_API_KEY", secret: "BITFINEX_API_SECRET" },
299174
+ hyperliquid: { wallet: "HYPERLIQUID_PRIVATE_KEY" },
299175
+ uniswap: { key: "UNISWAP_API_KEY" }
299176
+ };
299177
+ });
299178
+
299023
299179
  // src/infra/retry.ts
299024
299180
  class CircuitBreaker {
299025
299181
  state = "CLOSED";
@@ -324843,7 +324999,7 @@ function isUniswapXRouting(routing) {
324843
324999
  return ["DUTCH_V2", "DUTCH_V3", "DUTCH_LIMIT", "PRIORITY"].includes(routing);
324844
325000
  }
324845
325001
  var NATIVE_TOKEN = "0x0000000000000000000000000000000000000000", GAS_BUFFER_PERCENT = 0.15, WRAPPED_NATIVE, USDC_ADDRESSES, SUPPORTED_CHAIN_IDS, CHAIN_NAMES;
324846
- var init_types11 = __esm(() => {
325002
+ var init_types12 = __esm(() => {
324847
325003
  WRAPPED_NATIVE = {
324848
325004
  1: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
324849
325005
  10: "0x4200000000000000000000000000000000000006",
@@ -325006,7 +325162,7 @@ class UniswapTokenList {
325006
325162
  }
325007
325163
  var TOKEN_LIST_URL = "https://tokens.uniswap.org", CACHE_TTL_MS2;
325008
325164
  var init_token_list = __esm(() => {
325009
- init_types11();
325165
+ init_types12();
325010
325166
  CACHE_TTL_MS2 = 24 * 60 * 60 * 1000;
325011
325167
  });
325012
325168
 
@@ -325251,7 +325407,7 @@ class UniswapClient {
325251
325407
  }
325252
325408
  var BASE_URL4 = "https://trade-api.gateway.uniswap.org/v1", MAX_RETRIES2 = 3, BASE_DELAY_MS = 500, QUOTE_MAX_AGE_MS = 30000, RATE_LIMIT_CONFIG6;
325253
325409
  var init_client9 = __esm(() => {
325254
- init_types11();
325410
+ init_types12();
325255
325411
  init_token_list();
325256
325412
  RATE_LIMIT_CONFIG6 = {
325257
325413
  maxRequestsPerMinute: 60,
@@ -326017,7 +326173,7 @@ var init_uniswap = __esm(() => {
326017
326173
  init_token_list();
326018
326174
  init_subgraph();
326019
326175
  init_subgraph_types();
326020
- init_types11();
326176
+ init_types12();
326021
326177
  });
326022
326178
 
326023
326179
  // src/infra/exchange/adapters/uniswap.ts
@@ -326307,7 +326463,7 @@ class UniswapAdapter {
326307
326463
  var init_uniswap2 = __esm(() => {
326308
326464
  init_uniswap();
326309
326465
  init_subgraph();
326310
- init_types11();
326466
+ init_types12();
326311
326467
  });
326312
326468
 
326313
326469
  // src/infra/exchange/factory.ts
@@ -326415,6 +326571,7 @@ var init_exchange = __esm(() => {
326415
326571
  init_bitfinex3();
326416
326572
  init_hyperliquid3();
326417
326573
  init_uniswap2();
326574
+ init_types11();
326418
326575
  });
326419
326576
 
326420
326577
  // src/core/validator.ts
@@ -338701,7 +338858,7 @@ var init_iceberg = __esm(() => {
338701
338858
 
338702
338859
  // src/core/execution/algorithms/types.ts
338703
338860
  var ExecutionAlgorithmSchema, DEFAULT_TWAP_CONFIG, DEFAULT_VWAP_CONFIG, DEFAULT_ICEBERG_CONFIG;
338704
- var init_types12 = __esm(() => {
338861
+ var init_types13 = __esm(() => {
338705
338862
  init_zod();
338706
338863
  ExecutionAlgorithmSchema = exports_external.enum(["TWAP", "VWAP", "ICEBERG"]);
338707
338864
  DEFAULT_TWAP_CONFIG = {
@@ -338842,7 +338999,7 @@ var init_session_manager = __esm(() => {
338842
338999
  init_twap();
338843
339000
  init_vwap();
338844
339001
  init_iceberg();
338845
- init_types12();
339002
+ init_types13();
338846
339003
  logger70 = createModuleLogger("execution-session-manager");
338847
339004
  });
338848
339005
 
@@ -338939,7 +339096,7 @@ function describeIntent(intent2) {
338939
339096
  }
338940
339097
  var DURATION_PATTERNS;
338941
339098
  var init_intent_parser = __esm(() => {
338942
- init_types12();
339099
+ init_types13();
338943
339100
  DURATION_PATTERNS = [
338944
339101
  { pattern: /(\d+)\s*h(?:ours?)?/i, toMs: (m) => parseInt(m[1], 10) * 60 * 60 * 1000 },
338945
339102
  { pattern: /(\d+)\s*m(?:in(?:utes?)?)?/i, toMs: (m) => parseInt(m[1], 10) * 60 * 1000 },
@@ -341123,7 +341280,7 @@ var init_risk_management2 = __esm(() => {
341123
341280
  });
341124
341281
 
341125
341282
  // src/strategies/types.ts
341126
- var init_types13 = () => {};
341283
+ var init_types14 = () => {};
341127
341284
 
341128
341285
  // src/strategies/registry.ts
341129
341286
  class StrategyRegistry {
@@ -349447,7 +349604,7 @@ var init_dsl = __esm(() => {
349447
349604
 
349448
349605
  // src/strategies/index.ts
349449
349606
  var init_strategies = __esm(() => {
349450
- init_types13();
349607
+ init_types14();
349451
349608
  init_registry3();
349452
349609
  init_base_strategy();
349453
349610
  init_ensemble();
@@ -349967,7 +350124,7 @@ var init_strategies2 = __esm(() => {
349967
350124
 
349968
350125
  // src/backtest/types.ts
349969
350126
  var DEFAULT_BACKTEST_CONFIG, DEFAULT_BACKTEST_PARAMS;
349970
- var init_types14 = __esm(() => {
350127
+ var init_types15 = __esm(() => {
349971
350128
  DEFAULT_BACKTEST_CONFIG = {
349972
350129
  timeframe: "4h",
349973
350130
  days: 90,
@@ -350935,7 +351092,7 @@ function runBacktest(strategy, data4, params, strategyParams) {
350935
351092
  return engine.run(strategy, data4, strategyParams);
350936
351093
  }
350937
351094
  var init_engine2 = __esm(() => {
350938
- init_types14();
351095
+ init_types15();
350939
351096
  init_indicators();
350940
351097
  });
350941
351098
 
@@ -353948,7 +354105,7 @@ function standardDeviation(values) {
353948
354105
  }
353949
354106
  var logger78, DEFAULT_WALK_FORWARD_CONFIG;
353950
354107
  var init_walk_forward = __esm(() => {
353951
- init_types14();
354108
+ init_types15();
353952
354109
  init_engine2();
353953
354110
  init_logger2();
353954
354111
  logger78 = createModuleLogger("walk-forward");
@@ -354616,7 +354773,7 @@ var init_backtest = __esm(async () => {
354616
354773
  init_tools();
354617
354774
  init_zod();
354618
354775
  init_strategies();
354619
- init_types14();
354776
+ init_types15();
354620
354777
  init_engine2();
354621
354778
  init_historical();
354622
354779
  init_export();
@@ -358976,7 +359133,7 @@ var init_autonomous = __esm(() => {
358976
359133
 
358977
359134
  // src/infra/base/types.ts
358978
359135
  var BASE_CHAIN_CONFIG, BASE_TOKENS, REGISTRY_API_BASE = "https://base.org/api/registry";
358979
- var init_types15 = __esm(() => {
359136
+ var init_types16 = __esm(() => {
358980
359137
  BASE_CHAIN_CONFIG = {
358981
359138
  mainnet: {
358982
359139
  chainId: 8453,
@@ -359062,7 +359219,7 @@ function formatRegistryEntry(entry) {
359062
359219
  };
359063
359220
  }
359064
359221
  var init_registry4 = __esm(() => {
359065
- init_types15();
359222
+ init_types16();
359066
359223
  });
359067
359224
 
359068
359225
  // src/infra/base/chain.ts
@@ -359131,7 +359288,7 @@ async function getBaseTokenBalance(tokenAddress, walletAddress, decimals = 18, n
359131
359288
  return parseFloat(`${intPart}.${fracPart}`);
359132
359289
  }
359133
359290
  var init_chain2 = __esm(() => {
359134
- init_types15();
359291
+ init_types16();
359135
359292
  });
359136
359293
 
359137
359294
  // src/infra/base/basescan.ts
@@ -359381,7 +359538,7 @@ async function detectNewListings(opts = {}) {
359381
359538
  }
359382
359539
  var init_signals = __esm(() => {
359383
359540
  init_dexscreener();
359384
- init_types15();
359541
+ init_types16();
359385
359542
  });
359386
359543
 
359387
359544
  // src/infra/base/index.ts
@@ -359390,7 +359547,7 @@ var init_base4 = __esm(() => {
359390
359547
  init_chain2();
359391
359548
  init_dexscreener();
359392
359549
  init_signals();
359393
- init_types15();
359550
+ init_types16();
359394
359551
  });
359395
359552
 
359396
359553
  // src/infra/agents/tools/base-onchain.ts
@@ -359625,7 +359782,7 @@ var init_base_onchain = __esm(() => {
359625
359782
 
359626
359783
  // src/infra/agentkit/types.ts
359627
359784
  var CDP_ENV_KEYS;
359628
- var init_types16 = __esm(() => {
359785
+ var init_types17 = __esm(() => {
359629
359786
  CDP_ENV_KEYS = {
359630
359787
  API_KEY_ID: "CDP_API_KEY_ID",
359631
359788
  API_KEY_SECRET: "CDP_API_KEY_SECRET",
@@ -804272,7 +804429,7 @@ var init_client10 = __esm(() => {
804272
804429
  });
804273
804430
 
804274
804431
  // node_modules/@across-protocol/app-sdk/dist/types/index.js
804275
- var init_types17 = () => {};
804432
+ var init_types18 = () => {};
804276
804433
 
804277
804434
  // node_modules/@across-protocol/app-sdk/dist/index.js
804278
804435
  var exports_dist4 = {};
@@ -804340,7 +804497,7 @@ __export(exports_dist4, {
804340
804497
  });
804341
804498
  var init_dist19 = __esm(() => {
804342
804499
  init_client10();
804343
- init_types17();
804500
+ init_types18();
804344
804501
  init_actions();
804345
804502
  init_errors14();
804346
804503
  init_utils12();
@@ -1196061,14 +1196218,14 @@ function getAvailableActionNames() {
1196061
1196218
  }
1196062
1196219
  var import_agentkit, _agentKit = null, _actions = null;
1196063
1196220
  var init_provider3 = __esm(() => {
1196064
- init_types16();
1196221
+ init_types17();
1196065
1196222
  import_agentkit = __toESM(require_dist25(), 1);
1196066
1196223
  });
1196067
1196224
 
1196068
1196225
  // src/infra/agentkit/index.ts
1196069
1196226
  var init_agentkit = __esm(() => {
1196070
1196227
  init_provider3();
1196071
- init_types16();
1196228
+ init_types17();
1196072
1196229
  });
1196073
1196230
 
1196074
1196231
  // src/infra/agents/tools/agentkit-onchain.ts
@@ -1196372,7 +1196529,7 @@ var init_agentkit_defi = __esm(() => {
1196372
1196529
 
1196373
1196530
  // src/infra/polkadotkit/types.ts
1196374
1196531
  var POLKADOT_ENV_KEYS;
1196375
- var init_types18 = __esm(() => {
1196532
+ var init_types19 = __esm(() => {
1196376
1196533
  POLKADOT_ENV_KEYS = {
1196377
1196534
  PRIVATE_KEY: "POLKADOT_PRIVATE_KEY",
1196378
1196535
  MNEMONIC: "POLKADOT_MNEMONIC",
@@ -1199481,7 +1199638,7 @@ var init_multisig = __esm(() => {
1199481
1199638
 
1199482
1199639
  // node_modules/@polkadot-api/substrate-bindings/dist/esm/trie/types.mjs
1199483
1199640
  var TrieNodeHeaders;
1199484
- var init_types19 = __esm(() => {
1199641
+ var init_types20 = __esm(() => {
1199485
1199642
  TrieNodeHeaders = {
1199486
1199643
  Leaf: "Leaf",
1199487
1199644
  Branch: "Branch",
@@ -1199514,7 +1199671,7 @@ var varHex, allHex, hex32, byte, getHeader = (bytes3) => {
1199514
1199671
  var init_node_decoder = __esm(() => {
1199515
1199672
  init_scale_ts();
1199516
1199673
  init_Hex3();
1199517
- init_types19();
1199674
+ init_types20();
1199518
1199675
  varHex = Hex().dec;
1199519
1199676
  allHex = Hex(Infinity).dec;
1199520
1199677
  hex32 = Hex(32).dec;
@@ -1199718,7 +1199875,7 @@ var init_esm12 = __esm(() => {
1199718
1199875
  init_enum();
1199719
1199876
  init_ss58_util();
1199720
1199877
  init_multisig();
1199721
- init_types19();
1199878
+ init_types20();
1199722
1199879
  init_node_decoder();
1199723
1199880
  init_proofs();
1199724
1199881
  });
@@ -1294053,7 +1294210,7 @@ var init_fixed_point_number = __esm(() => {
1294053
1294210
 
1294054
1294211
  // node_modules/@acala-network/sdk-core/dist/esm/types.js
1294055
1294212
  var TokenType;
1294056
- var init_types20 = __esm(() => {
1294213
+ var init_types21 = __esm(() => {
1294057
1294214
  (function(TokenType2) {
1294058
1294215
  TokenType2[TokenType2["BASIC"] = 0] = "BASIC";
1294059
1294216
  TokenType2[TokenType2["DEX_SHARE"] = 1] = "DEX_SHARE";
@@ -1294290,7 +1294447,7 @@ var import_isArray;
1294290
1294447
  var init_converter2 = __esm(() => {
1294291
1294448
  init_errors25();
1294292
1294449
  init_token();
1294293
- init_types20();
1294450
+ init_types21();
1294294
1294451
  import_isArray = __toESM(require_isArray(), 1);
1294295
1294452
  });
1294296
1294453
 
@@ -1294332,7 +1294489,7 @@ function sortTokenByName(a4, b2) {
1294332
1294489
  var TOKEN_TYPE_WEIGHTS, TOKEN_SORT;
1294333
1294490
  var init_sort_token = __esm(() => {
1294334
1294491
  init_converter2();
1294335
- init_types20();
1294492
+ init_types21();
1294336
1294493
  TOKEN_TYPE_WEIGHTS = {
1294337
1294494
  [TokenType.BASIC]: 9,
1294338
1294495
  [TokenType.DEX_SHARE]: 8,
@@ -1294543,7 +1294700,7 @@ class Token {
1294543
1294700
  var STABLE_ASSET_POOLS;
1294544
1294701
  var init_token = __esm(() => {
1294545
1294702
  init_util7();
1294546
- init_types20();
1294703
+ init_types21();
1294547
1294704
  init_converter2();
1294548
1294705
  init_sort_token();
1294549
1294706
  init_fixed_point_number();
@@ -1294665,14 +1294822,14 @@ var init_esm28 = __esm(() => {
1294665
1294822
  init_token_balance();
1294666
1294823
  init_token_pair();
1294667
1294824
  init_events4();
1294668
- init_types20();
1294825
+ init_types21();
1294669
1294826
  init_converter2();
1294670
1294827
  init_utils35();
1294671
1294828
  });
1294672
1294829
 
1294673
1294830
  // node_modules/@acala-network/sdk/dist/esm/types.js
1294674
1294831
  var ChainType;
1294675
- var init_types21 = __esm(() => {
1294832
+ var init_types22 = __esm(() => {
1294676
1294833
  (function(ChainType2) {
1294677
1294834
  ChainType2["ACALA"] = "ACALA";
1294678
1294835
  ChainType2["MANDALA"] = "MANDALA";
@@ -1294707,7 +1294864,7 @@ function getChainType(type2) {
1294707
1294864
  return ChainType.MANDALA;
1294708
1294865
  }
1294709
1294866
  var init_get_chain_type = __esm(() => {
1294710
- init_types21();
1294867
+ init_types22();
1294711
1294868
  });
1294712
1294869
 
1294713
1294870
  // node_modules/@acala-network/sdk/node_modules/lru-cache/index.mjs
@@ -1295805,12 +1295962,12 @@ var init_listener = __esm(() => {
1295805
1295962
  });
1295806
1295963
 
1295807
1295964
  // node_modules/@acala-network/sdk/dist/esm/utils/chain-listener/types.js
1295808
- var init_types22 = () => {};
1295965
+ var init_types23 = () => {};
1295809
1295966
 
1295810
1295967
  // node_modules/@acala-network/sdk/dist/esm/utils/chain-listener/index.js
1295811
1295968
  var init_chain_listener = __esm(() => {
1295812
1295969
  init_listener();
1295813
- init_types22();
1295970
+ init_types23();
1295814
1295971
  });
1295815
1295972
 
1295816
1295973
  // node_modules/@acala-network/sdk/dist/esm/utils/storage/error.js
@@ -1296144,7 +1296301,7 @@ function getAPY(rewardRate, commissionRate, eraFrequency, chain2) {
1296144
1296301
  }
1296145
1296302
  var ESTIMATE_BLOCK_TIME, YEAR;
1296146
1296303
  var init_get_apy = __esm(() => {
1296147
- init_types21();
1296304
+ init_types22();
1296148
1296305
  ESTIMATE_BLOCK_TIME = {
1296149
1296306
  [ChainType.ACALA]: 6 * 1000,
1296150
1296307
  [ChainType.KARURA]: 6 * 1000,
@@ -1297033,7 +1297190,7 @@ var import_rxjs55, import_operators6;
1297033
1297190
  var init_liquidity = __esm(() => {
1297034
1297191
  init_esm28();
1297035
1297192
  init_util7();
1297036
- init_types21();
1297193
+ init_types22();
1297037
1297194
  init_get_chain_type();
1297038
1297195
  init_errors27();
1297039
1297196
  init_storage12();
@@ -1298712,7 +1298869,7 @@ var init_oracle_price_provider = __esm(() => {
1298712
1298869
 
1298713
1298870
  // node_modules/@acala-network/sdk/dist/esm/wallet/price-provider/types.js
1298714
1298871
  var PriceProviderType;
1298715
- var init_types23 = __esm(() => {
1298872
+ var init_types24 = __esm(() => {
1298716
1298873
  (function(PriceProviderType2) {
1298717
1298874
  PriceProviderType2[PriceProviderType2["AGGREGATE"] = 0] = "AGGREGATE";
1298718
1298875
  PriceProviderType2[PriceProviderType2["MARKET"] = 1] = "MARKET";
@@ -1591307,7 +1591464,7 @@ var init_acala3 = __esm(() => {
1591307
1591464
  init_esm28();
1591308
1591465
  init_storage11();
1591309
1591466
  init_create_token_list();
1591310
- init_types21();
1591467
+ init_types22();
1591311
1591468
  init_get_chain_type();
1591312
1591469
  init_errors28();
1591313
1591470
  import_rxjs61 = __toESM(require_cjs10(), 1);
@@ -1606301,7 +1606458,7 @@ var init_lookup3 = () => {};
1606301
1606458
 
1606302
1606459
  // node_modules/@polkadot/types-create/types/types.js
1606303
1606460
  var TypeDefInfo;
1606304
- var init_types24 = __esm(() => {
1606461
+ var init_types25 = __esm(() => {
1606305
1606462
  (function(TypeDefInfo2) {
1606306
1606463
  TypeDefInfo2[TypeDefInfo2["BTreeMap"] = 0] = "BTreeMap";
1606307
1606464
  TypeDefInfo2[TypeDefInfo2["BTreeSet"] = 1] = "BTreeSet";
@@ -1606330,9 +1606487,9 @@ var init_types24 = __esm(() => {
1606330
1606487
  });
1606331
1606488
 
1606332
1606489
  // node_modules/@polkadot/types-create/types/index.js
1606333
- var init_types25 = __esm(() => {
1606490
+ var init_types26 = __esm(() => {
1606334
1606491
  init_lookup3();
1606335
- init_types24();
1606492
+ init_types25();
1606336
1606493
  });
1606337
1606494
 
1606338
1606495
  // node_modules/@polkadot/types-codec/node_modules/@polkadot/util/node_modules/@polkadot/x-global/index.js
@@ -1610964,7 +1611121,7 @@ var KNOWN_INTERNALS, nestedExtraction, wrappedExtraction;
1610964
1611121
  var init_getTypeDef = __esm(() => {
1610965
1611122
  init_types_codec();
1610966
1611123
  init_util13();
1610967
- init_types25();
1611124
+ init_types26();
1610968
1611125
  KNOWN_INTERNALS = ["_alias", "_fallback"];
1610969
1611126
  nestedExtraction = [
1610970
1611127
  ["[", "]", TypeDefInfo.VecFixed, _decodeFixedVec],
@@ -1611062,7 +1611219,7 @@ var infoMapping;
1611062
1611219
  var init_class2 = __esm(() => {
1611063
1611220
  init_types_codec();
1611064
1611221
  init_util13();
1611065
- init_types25();
1611222
+ init_types26();
1611066
1611223
  init_getTypeDef();
1611067
1611224
  infoMapping = {
1611068
1611225
  [TypeDefInfo.BTreeMap]: (_registry2, value2) => createHashMap(BTreeMap, value2),
@@ -1611239,7 +1611396,7 @@ function withTypeString(registry2, typeDef) {
1611239
1611396
  var stringIdentity = (value2) => value2.toString(), INFO_WRAP, encoders;
1611240
1611397
  var init_encodeTypes = __esm(() => {
1611241
1611398
  init_util13();
1611242
- init_types25();
1611399
+ init_types26();
1611243
1611400
  INFO_WRAP = ["BTreeMap", "BTreeSet", "Compact", "HashMap", "Option", "Result", "Vec"];
1611244
1611401
  encoders = {
1611245
1611402
  [TypeDefInfo.BTreeMap]: (registry2, typeDef) => encodeWithParams(registry2, typeDef, "BTreeMap"),
@@ -1611322,7 +1611479,7 @@ var init_exports4 = __esm(() => {
1611322
1611479
 
1611323
1611480
  // node_modules/@polkadot/types-create/bundle.js
1611324
1611481
  var init_bundle15 = __esm(() => {
1611325
- init_types25();
1611482
+ init_types26();
1611326
1611483
  init_exports4();
1611327
1611484
  });
1611328
1611485
 
@@ -1625771,7 +1625928,7 @@ var init_bundle17 = __esm(() => {
1625771
1625928
  });
1625772
1625929
 
1625773
1625930
  // node_modules/@polkadot/types/index.js
1625774
- var init_types26 = __esm(() => {
1625931
+ var init_types27 = __esm(() => {
1625775
1625932
  init_packageDetect15();
1625776
1625933
  init_bundle17();
1625777
1625934
  });
@@ -1626123,7 +1626280,7 @@ class RpcCore {
1626123
1626280
  var import_rxjs65, l10, EMPTY_META, RPC_CORE_DEFAULT_CAPACITY;
1626124
1626281
  var init_bundle18 = __esm(() => {
1626125
1626282
  init_rpc_provider();
1626126
- init_types26();
1626283
+ init_types27();
1626127
1626284
  init_util18();
1626128
1626285
  init_util11();
1626129
1626286
  init_util22();
@@ -1629444,7 +1629601,7 @@ function dispatchQueue(instanceId, api7) {
1629444
1629601
  }
1629445
1629602
  var import_rxjs100, DEMOCRACY_ID;
1629446
1629603
  var init_dispatchQueue = __esm(() => {
1629447
- init_types26();
1629604
+ init_types27();
1629448
1629605
  init_util10();
1629449
1629606
  init_util23();
1629450
1629607
  init_util25();
@@ -1650244,7 +1650401,7 @@ var init_Decorate = __esm(() => {
1650244
1650401
  init_api_derive();
1650245
1650402
  init_rpc_core();
1650246
1650403
  init_rpc_provider();
1650247
- init_types26();
1650404
+ init_types27();
1650248
1650405
  init_types_known();
1650249
1650406
  init_util8();
1650250
1650407
  init_util_crypto3();
@@ -1650800,7 +1650957,7 @@ function textToString(t3) {
1650800
1650957
  }
1650801
1650958
  var import_rxjs151, KEEPALIVE_INTERVAL = 1e4, WITH_VERSION_SHORTCUT = false, SUPPORTED_METADATA_VERSIONS, l13, Init;
1650802
1650959
  var init_Init = __esm(() => {
1650803
- init_types26();
1650960
+ init_types27();
1650804
1650961
  init_constants6();
1650805
1650962
  init_types_known();
1650806
1650963
  init_util8();
@@ -1651734,13 +1651891,13 @@ var init_wallet5 = __esm(() => {
1651734
1651891
  init_util7();
1651735
1651892
  init_esm28();
1651736
1651893
  init_errors24();
1651737
- init_types21();
1651894
+ init_types22();
1651738
1651895
  init_homa();
1651739
1651896
  init_liquidity();
1651740
1651897
  init_get_max_available_balance();
1651741
1651898
  init_market_price_provider();
1651742
1651899
  init_oracle_price_provider();
1651743
- init_types23();
1651900
+ init_types24();
1651744
1651901
  init_storages2();
1651745
1651902
  init_get_chain_type();
1651746
1651903
  init_dex_price_provider();
@@ -1651756,17 +1651913,17 @@ var init_wallet5 = __esm(() => {
1651756
1651913
  });
1651757
1651914
 
1651758
1651915
  // node_modules/@acala-network/sdk/dist/esm/wallet/vesting/types.js
1651759
- var init_types27 = () => {};
1651916
+ var init_types28 = () => {};
1651760
1651917
 
1651761
1651918
  // node_modules/@acala-network/sdk/dist/esm/wallet/types.js
1651762
- var init_types28 = __esm(() => {
1651763
- init_types27();
1651919
+ var init_types29 = __esm(() => {
1651920
+ init_types28();
1651764
1651921
  });
1651765
1651922
 
1651766
1651923
  // node_modules/@acala-network/sdk/dist/esm/wallet/index.js
1651767
1651924
  var init_wallet6 = __esm(() => {
1651768
1651925
  init_wallet5();
1651769
- init_types28();
1651926
+ init_types29();
1651770
1651927
  });
1651771
1651928
 
1651772
1651929
  // node_modules/@acala-network/sdk/node_modules/graphql-request/node_modules/form-data/node_modules/mime-types/node_modules/mime-db/db.json
@@ -1661767,7 +1661924,7 @@ var init_base_history_fetcher = () => {};
1661767
1661924
 
1661768
1661925
  // node_modules/@acala-network/sdk/dist/esm/history/utils/resolve-links.js
1661769
1661926
  var init_resolve_links = __esm(() => {
1661770
- init_types21();
1661927
+ init_types22();
1661771
1661928
  });
1661772
1661929
  // node_modules/@acala-network/sdk/dist/esm/history/fetchers/transfers.js
1661773
1661930
  var import_graphql_request;
@@ -1661887,7 +1662044,7 @@ var init_storages3 = __esm(() => {
1661887
1662044
 
1661888
1662045
  // node_modules/@acala-network/sdk/dist/esm/incentive/types.js
1661889
1662046
  var IncentiveType;
1661890
- var init_types29 = __esm(() => {
1662047
+ var init_types30 = __esm(() => {
1661891
1662048
  (function(IncentiveType2) {
1661892
1662049
  IncentiveType2[IncentiveType2["LOANS"] = 0] = "LOANS";
1661893
1662050
  IncentiveType2[IncentiveType2["DEX"] = 1] = "DEX";
@@ -1662239,7 +1662396,7 @@ var init_incentive = __esm(() => {
1662239
1662396
  init_util7();
1662240
1662397
  init_errors27();
1662241
1662398
  init_storages3();
1662242
- init_types29();
1662399
+ init_types30();
1662243
1662400
  init_get_apr();
1662244
1662401
  init_get_deduction_endtime_configs();
1662245
1662402
  import_rxjs157 = __toESM(require_cjs10(), 1);
@@ -1662247,7 +1662404,7 @@ var init_incentive = __esm(() => {
1662247
1662404
  });
1662248
1662405
 
1662249
1662406
  // node_modules/@acala-network/sdk/dist/esm/auction/types.js
1662250
- var init_types30 = () => {};
1662407
+ var init_types31 = () => {};
1662251
1662408
 
1662252
1662409
  // node_modules/@acala-network/sdk/dist/esm/auction/api.js
1662253
1662410
  var GraphqlRequest;
@@ -1662276,7 +1662433,7 @@ var init_auctions = __esm(() => {
1662276
1662433
 
1662277
1662434
  // node_modules/@acala-network/sdk/dist/esm/auction/index.js
1662278
1662435
  var init_auction2 = __esm(() => {
1662279
- init_types30();
1662436
+ init_types31();
1662280
1662437
  init_auctions();
1662281
1662438
  init_auction();
1662282
1662439
  init_api4();
@@ -1662290,7 +1662447,7 @@ var init_esm32 = __esm(() => {
1662290
1662447
  init_wallet6();
1662291
1662448
  init_liquidity();
1662292
1662449
  init_homa();
1662293
- init_types21();
1662450
+ init_types22();
1662294
1662451
  init_history2();
1662295
1662452
  init_incentive();
1662296
1662453
  init_auction2();
@@ -1818652,7 +1818809,7 @@ var init_lookup4 = () => {};
1818652
1818809
 
1818653
1818810
  // node_modules/@galacticcouncil/sdk/node_modules/@polkadot/types/node_modules/@polkadot/types-create/types/types.js
1818654
1818811
  var TypeDefInfo2;
1818655
- var init_types31 = __esm(() => {
1818812
+ var init_types32 = __esm(() => {
1818656
1818813
  (function(TypeDefInfo3) {
1818657
1818814
  TypeDefInfo3[TypeDefInfo3["BTreeMap"] = 0] = "BTreeMap";
1818658
1818815
  TypeDefInfo3[TypeDefInfo3["BTreeSet"] = 1] = "BTreeSet";
@@ -1818681,9 +1818838,9 @@ var init_types31 = __esm(() => {
1818681
1818838
  });
1818682
1818839
 
1818683
1818840
  // node_modules/@galacticcouncil/sdk/node_modules/@polkadot/types/node_modules/@polkadot/types-create/types/index.js
1818684
- var init_types32 = __esm(() => {
1818841
+ var init_types33 = __esm(() => {
1818685
1818842
  init_lookup4();
1818686
- init_types31();
1818843
+ init_types32();
1818687
1818844
  });
1818688
1818845
 
1818689
1818846
  // node_modules/@galacticcouncil/sdk/node_modules/@polkadot/types/node_modules/@polkadot/types-codec/packageDetect.js
@@ -1822048,7 +1822205,7 @@ var KNOWN_INTERNALS2, nestedExtraction2, wrappedExtraction2;
1822048
1822205
  var init_getTypeDef2 = __esm(() => {
1822049
1822206
  init_types_codec2();
1822050
1822207
  init_util7();
1822051
- init_types32();
1822208
+ init_types33();
1822052
1822209
  KNOWN_INTERNALS2 = ["_alias", "_fallback"];
1822053
1822210
  nestedExtraction2 = [
1822054
1822211
  ["[", "]", TypeDefInfo2.VecFixed, _decodeFixedVec2],
@@ -1822146,7 +1822303,7 @@ var infoMapping2;
1822146
1822303
  var init_class3 = __esm(() => {
1822147
1822304
  init_types_codec2();
1822148
1822305
  init_util7();
1822149
- init_types32();
1822306
+ init_types33();
1822150
1822307
  init_getTypeDef2();
1822151
1822308
  infoMapping2 = {
1822152
1822309
  [TypeDefInfo2.BTreeMap]: (_registry2, value2) => createHashMap2(BTreeMap2, value2),
@@ -1822323,7 +1822480,7 @@ function withTypeString2(registry3, typeDef) {
1822323
1822480
  var stringIdentity2 = (value2) => value2.toString(), INFO_WRAP2, encoders2;
1822324
1822481
  var init_encodeTypes2 = __esm(() => {
1822325
1822482
  init_util7();
1822326
- init_types32();
1822483
+ init_types33();
1822327
1822484
  INFO_WRAP2 = ["BTreeMap", "BTreeSet", "Compact", "HashMap", "Option", "Result", "Vec"];
1822328
1822485
  encoders2 = {
1822329
1822486
  [TypeDefInfo2.BTreeMap]: (registry3, typeDef) => encodeWithParams2(registry3, typeDef, "BTreeMap"),
@@ -1822406,7 +1822563,7 @@ var init_exports5 = __esm(() => {
1822406
1822563
 
1822407
1822564
  // node_modules/@galacticcouncil/sdk/node_modules/@polkadot/types/node_modules/@polkadot/types-create/bundle.js
1822408
1822565
  var init_bundle28 = __esm(() => {
1822409
- init_types32();
1822566
+ init_types33();
1822410
1822567
  init_exports5();
1822411
1822568
  });
1822412
1822569
 
@@ -1832085,7 +1832242,7 @@ var init_bundle29 = __esm(() => {
1832085
1832242
  });
1832086
1832243
 
1832087
1832244
  // node_modules/@galacticcouncil/sdk/node_modules/@polkadot/types/index.js
1832088
- var init_types33 = __esm(() => {
1832245
+ var init_types34 = __esm(() => {
1832089
1832246
  init_packageDetect27();
1832090
1832247
  init_bundle29();
1832091
1832248
  });
@@ -1836576,7 +1836733,7 @@ var init_build9 = __esm(() => {
1836576
1836733
  init_hydradx();
1836577
1836734
  init_basilisk();
1836578
1836735
  init_build3();
1836579
- init_types33();
1836736
+ init_types34();
1836580
1836737
  init_util7();
1836581
1836738
  init_util_crypto4();
1836582
1836739
  init__esm();
@@ -1869691,7 +1869848,7 @@ var handleResult4 = (ctx, result) => {
1869691
1869848
  }, ZodDiscriminatedUnion5, ZodIntersection5, ZodTuple5, ZodRecord5, ZodMap5, ZodSet5, ZodFunction5, ZodLazy5, ZodLiteral5, ZodEnum5, ZodNativeEnum4, ZodPromise5, ZodEffects4, ZodOptional5, ZodNullable5, ZodDefault5, ZodCatch5, ZodNaN5, BRAND4, ZodBranded4, ZodPipeline4, ZodReadonly5, late4, ZodFirstPartyTypeKind5, instanceOfType4 = (cls, params2 = {
1869692
1869849
  message: `Input not instance of ${cls.name}`
1869693
1869850
  }) => custom6((data7) => data7 instanceof cls, params2), stringType4, numberType4, nanType4, bigIntType4, booleanType4, dateType4, symbolType4, undefinedType4, nullType4, anyType4, unknownType4, neverType4, voidType4, arrayType4, objectType4, strictObjectType4, unionType4, discriminatedUnionType4, intersectionType4, tupleType4, recordType4, mapType4, setType4, functionType4, lazyType4, literalType4, enumType4, nativeEnumType4, promiseType4, effectsType4, optionalType4, nullableType4, preprocessType4, pipelineType4, ostring4 = () => stringType4().optional(), onumber4 = () => numberType4().optional(), oboolean4 = () => booleanType4().optional(), coerce4, NEVER6;
1869694
- var init_types34 = __esm(() => {
1869851
+ var init_types35 = __esm(() => {
1869695
1869852
  init_ZodError3();
1869696
1869853
  init_errors33();
1869697
1869854
  init_errorUtil3();
@@ -1872612,7 +1872769,7 @@ var init_external4 = __esm(() => {
1872612
1872769
  init_parseUtil3();
1872613
1872770
  init_typeAliases3();
1872614
1872771
  init_util37();
1872615
- init_types34();
1872772
+ init_types35();
1872616
1872773
  init_ZodError3();
1872617
1872774
  });
1872618
1872775
 
@@ -1872891,7 +1873048,7 @@ var init_format13 = __esm(() => {
1872891
1873048
 
1872892
1873049
  // node_modules/@cfworker/json-schema/dist/esm/types.js
1872893
1873050
  var OutputFormat;
1872894
- var init_types35 = __esm(() => {
1873051
+ var init_types36 = __esm(() => {
1872895
1873052
  (function(OutputFormat2) {
1872896
1873053
  OutputFormat2[OutputFormat2["Flag"] = 1] = "Flag";
1872897
1873054
  OutputFormat2[OutputFormat2["Basic"] = 2] = "Basic";
@@ -1873688,7 +1873845,7 @@ var init_validator3 = () => {};
1873688
1873845
  var init_esm35 = __esm(() => {
1873689
1873846
  init_dereference();
1873690
1873847
  init_format13();
1873691
- init_types35();
1873848
+ init_types36();
1873692
1873849
  init_validate4();
1873693
1873850
  init_validator3();
1873694
1873851
  });
@@ -1892371,7 +1892528,7 @@ var init_base20 = __esm(() => {
1892371
1892528
  });
1892372
1892529
 
1892373
1892530
  // node_modules/@langchain/core/dist/tools/types.js
1892374
- var init_types36 = __esm(() => {
1892531
+ var init_types37 = __esm(() => {
1892375
1892532
  init_base19();
1892376
1892533
  init_zod3();
1892377
1892534
  });
@@ -1892467,7 +1892624,7 @@ var init_tools2 = __esm(() => {
1892467
1892624
  init_utils47();
1892468
1892625
  init_zod3();
1892469
1892626
  init_json_schema3();
1892470
- init_types36();
1892627
+ init_types37();
1892471
1892628
  StructuredTool = class StructuredTool extends BaseLangChain {
1892472
1892629
  get lc_namespace() {
1892473
1892630
  return ["langchain", "tools"];
@@ -1893729,7 +1893886,7 @@ var handleResult5 = (ctx, result) => {
1893729
1893886
  }, ZodDiscriminatedUnion6, ZodIntersection6, ZodTuple6, ZodRecord6, ZodMap6, ZodSet6, ZodFunction6, ZodLazy6, ZodLiteral6, ZodEnum6, ZodNativeEnum5, ZodPromise6, ZodEffects5, ZodOptional6, ZodNullable6, ZodDefault6, ZodCatch6, ZodNaN6, BRAND5, ZodBranded5, ZodPipeline5, ZodReadonly6, late5, ZodFirstPartyTypeKind6, instanceOfType5 = (cls, params2 = {
1893730
1893887
  message: `Input not instance of ${cls.name}`
1893731
1893888
  }) => custom7((data7) => data7 instanceof cls, params2), stringType5, numberType5, nanType5, bigIntType5, booleanType5, dateType5, symbolType5, undefinedType5, nullType5, anyType5, unknownType5, neverType5, voidType5, arrayType5, objectType5, strictObjectType5, unionType5, discriminatedUnionType5, intersectionType5, tupleType5, recordType5, mapType5, setType5, functionType5, lazyType5, literalType5, enumType5, nativeEnumType5, promiseType5, effectsType5, optionalType5, nullableType5, preprocessType5, pipelineType5, ostring5 = () => stringType5().optional(), onumber5 = () => numberType5().optional(), oboolean5 = () => booleanType5().optional(), coerce5, NEVER8;
1893732
- var init_types37 = __esm(() => {
1893889
+ var init_types38 = __esm(() => {
1893733
1893890
  init_ZodError4();
1893734
1893891
  init_errors35();
1893735
1893892
  init_errorUtil4();
@@ -1896650,7 +1896807,7 @@ var init_external5 = __esm(() => {
1896650
1896807
  init_parseUtil4();
1896651
1896808
  init_typeAliases4();
1896652
1896809
  init_util39();
1896653
- init_types37();
1896810
+ init_types38();
1896654
1896811
  init_ZodError4();
1896655
1896812
  });
1896656
1896813
 
@@ -1898692,13 +1898849,13 @@ function getAvailableActionNames2() {
1898692
1898849
  var _agentKit2 = null, _actions2 = null;
1898693
1898850
  var init_provider5 = __esm(() => {
1898694
1898851
  init_dist34();
1898695
- init_types18();
1898852
+ init_types19();
1898696
1898853
  });
1898697
1898854
 
1898698
1898855
  // src/infra/polkadotkit/index.ts
1898699
1898856
  var init_polkadotkit = __esm(() => {
1898700
1898857
  init_provider5();
1898701
- init_types18();
1898858
+ init_types19();
1898702
1898859
  });
1898703
1898860
 
1898704
1898861
  // src/infra/agents/tools/polkadotkit-assets.ts
@@ -1898962,7 +1899119,7 @@ var init_polkadotkit_defi = __esm(() => {
1898962
1899119
 
1898963
1899120
  // src/infra/solanakit/types.ts
1898964
1899121
  var SOLANA_ENV_KEYS;
1898965
- var init_types38 = __esm(() => {
1899122
+ var init_types39 = __esm(() => {
1898966
1899123
  SOLANA_ENV_KEYS = {
1898967
1899124
  PRIVATE_KEY: "SOLANA_PRIVATE_KEY",
1898968
1899125
  RPC_URL: "SOLANA_RPC_URL",
@@ -1901998,7 +1902155,7 @@ var handleResult6 = (ctx, result) => {
1901998
1902155
  }, ZodDiscriminatedUnion7, ZodIntersection7, ZodTuple7, ZodRecord7, ZodMap7, ZodSet7, ZodFunction7, ZodLazy7, ZodLiteral7, ZodEnum7, ZodNativeEnum6, ZodPromise7, ZodEffects6, ZodOptional7, ZodNullable7, ZodDefault7, ZodCatch7, ZodNaN7, BRAND6, ZodBranded6, ZodPipeline6, ZodReadonly7, late6, ZodFirstPartyTypeKind7, instanceOfType6 = (cls, params2 = {
1901999
1902156
  message: `Input not instance of ${cls.name}`
1902000
1902157
  }) => custom8((data7) => data7 instanceof cls, params2), stringType6, numberType6, nanType6, bigIntType6, booleanType6, dateType6, symbolType6, undefinedType6, nullType6, anyType6, unknownType6, neverType6, voidType6, arrayType6, objectType6, strictObjectType6, unionType6, discriminatedUnionType6, intersectionType6, tupleType6, recordType6, mapType6, setType6, functionType6, lazyType6, literalType6, enumType6, nativeEnumType6, promiseType6, effectsType6, optionalType6, nullableType6, preprocessType6, pipelineType6, ostring6 = () => stringType6().optional(), onumber6 = () => numberType6().optional(), oboolean6 = () => booleanType6().optional(), coerce6, NEVER9;
1902001
- var init_types39 = __esm(() => {
1902158
+ var init_types40 = __esm(() => {
1902002
1902159
  init_ZodError5();
1902003
1902160
  init_errors37();
1902004
1902161
  init_errorUtil5();
@@ -1904919,7 +1905076,7 @@ var init_external6 = __esm(() => {
1904919
1905076
  init_parseUtil5();
1904920
1905077
  init_typeAliases5();
1904921
1905078
  init_util40();
1904922
- init_types39();
1905079
+ init_types40();
1904923
1905080
  init_ZodError5();
1904924
1905081
  });
1904925
1905082
 
@@ -1917677,7 +1917834,7 @@ var init_errors38 = __esm(() => {
1917677
1917834
 
1917678
1917835
  // node_modules/@solana/spl-token/lib/esm/instructions/types.js
1917679
1917836
  var TokenInstruction;
1917680
- var init_types40 = __esm(() => {
1917837
+ var init_types41 = __esm(() => {
1917681
1917838
  (function(TokenInstruction2) {
1917682
1917839
  TokenInstruction2[TokenInstruction2["InitializeMint"] = 0] = "InitializeMint";
1917683
1917840
  TokenInstruction2[TokenInstruction2["InitializeAccount"] = 1] = "InitializeAccount";
@@ -1919274,7 +1919431,7 @@ var init_transferChecked = __esm(() => {
1919274
1919431
  init_esm38();
1919275
1919432
  init_constants15();
1919276
1919433
  init_internal();
1919277
- init_types40();
1919434
+ init_types41();
1919278
1919435
  import_buffer_layout28 = __toESM(require_Layout(), 1);
1919279
1919436
  import_web326 = __toESM(require_index_cjs(), 1);
1919280
1919437
  transferCheckedInstructionData = import_buffer_layout28.struct([
@@ -1919904,7 +1920061,7 @@ var import_buffer_layout36, import_web341, closeAccountInstructionData;
1919904
1920061
  var init_closeAccount = __esm(() => {
1919905
1920062
  init_constants15();
1919906
1920063
  init_internal();
1919907
- init_types40();
1920064
+ init_types41();
1919908
1920065
  import_buffer_layout36 = __toESM(require_Layout(), 1);
1919909
1920066
  import_web341 = __toESM(require_index_cjs(), 1);
1919910
1920067
  closeAccountInstructionData = import_buffer_layout36.struct([import_buffer_layout36.u8("instruction")]);
@@ -1919931,7 +1920088,7 @@ function createInitializeAccountInstruction(account6, mint2, owner, programId =
1919931
1920088
  var import_buffer_layout37, import_web343, initializeAccountInstructionData;
1919932
1920089
  var init_initializeAccount = __esm(() => {
1919933
1920090
  init_constants15();
1919934
- init_types40();
1920091
+ init_types41();
1919935
1920092
  import_buffer_layout37 = __toESM(require_Layout(), 1);
1919936
1920093
  import_web343 = __toESM(require_index_cjs(), 1);
1919937
1920094
  initializeAccountInstructionData = import_buffer_layout37.struct([import_buffer_layout37.u8("instruction")]);
@@ -1920045,7 +1920202,7 @@ function createSyncNativeInstruction(account6, programId = TOKEN_PROGRAM_ID) {
1920045
1920202
  var import_buffer_layout41, import_web354, syncNativeInstructionData;
1920046
1920203
  var init_syncNative = __esm(() => {
1920047
1920204
  init_constants15();
1920048
- init_types40();
1920205
+ init_types41();
1920049
1920206
  import_buffer_layout41 = __toESM(require_Layout(), 1);
1920050
1920207
  import_web354 = __toESM(require_index_cjs(), 1);
1920051
1920208
  syncNativeInstructionData = import_buffer_layout41.struct([import_buffer_layout41.u8("instruction")]);
@@ -1920095,7 +1920252,7 @@ var init_mintTo = __esm(() => {
1920095
1920252
  init_esm38();
1920096
1920253
  init_constants15();
1920097
1920254
  init_internal();
1920098
- init_types40();
1920255
+ init_types41();
1920099
1920256
  import_buffer_layout43 = __toESM(require_Layout(), 1);
1920100
1920257
  import_web359 = __toESM(require_index_cjs(), 1);
1920101
1920258
  mintToInstructionData = import_buffer_layout43.struct([import_buffer_layout43.u8("instruction"), u645("amount")]);
@@ -1920165,7 +1920322,7 @@ var import_buffer_layout46, import_web366, AuthorityType, setAuthorityInstructio
1920165
1920322
  var init_setAuthority = __esm(() => {
1920166
1920323
  init_constants15();
1920167
1920324
  init_internal();
1920168
- init_types40();
1920325
+ init_types41();
1920169
1920326
  init_serialization();
1920170
1920327
  import_buffer_layout46 = __toESM(require_Layout(), 1);
1920171
1920328
  import_web366 = __toESM(require_index_cjs(), 1);
@@ -1920239,7 +1920396,7 @@ var init_transfer = __esm(() => {
1920239
1920396
  init_esm38();
1920240
1920397
  init_constants15();
1920241
1920398
  init_internal();
1920242
- init_types40();
1920399
+ init_types41();
1920243
1920400
  import_buffer_layout48 = __toESM(require_Layout(), 1);
1920244
1920401
  import_web371 = __toESM(require_index_cjs(), 1);
1920245
1920402
  transferInstructionData = import_buffer_layout48.struct([import_buffer_layout48.u8("instruction"), u645("amount")]);
@@ -1920380,7 +1920537,7 @@ var import_buffer_layout52, import_web378, initializeMintInstructionData;
1920380
1920537
  var init_initializeMint = __esm(() => {
1920381
1920538
  init_esm38();
1920382
1920539
  init_constants15();
1920383
- init_types40();
1920540
+ init_types41();
1920384
1920541
  init_serialization();
1920385
1920542
  import_buffer_layout52 = __toESM(require_Layout(), 1);
1920386
1920543
  import_web378 = __toESM(require_index_cjs(), 1);
@@ -1920591,7 +1920748,7 @@ var init_initializePermanentDelegate = __esm(() => {
1920591
1920748
  var init_instructions12 = __esm(() => {
1920592
1920749
  init_associatedTokenAccount();
1920593
1920750
  init_decode6();
1920594
- init_types40();
1920751
+ init_types41();
1920595
1920752
  init_initializeMint();
1920596
1920753
  init_initializeAccount();
1920597
1920754
  init_initializeMultisig();
@@ -1921927,7 +1922084,7 @@ var handleResult7 = (ctx, result) => {
1921927
1922084
  }, ZodDiscriminatedUnion8, ZodIntersection8, ZodTuple8, ZodRecord8, ZodMap8, ZodSet8, ZodFunction8, ZodLazy8, ZodLiteral8, ZodEnum8, ZodNativeEnum7, ZodPromise8, ZodEffects7, ZodOptional8, ZodNullable8, ZodDefault8, ZodCatch8, ZodNaN8, BRAND7, ZodBranded7, ZodPipeline7, ZodReadonly8, late7, ZodFirstPartyTypeKind8, instanceOfType7 = (cls, params2 = {
1921928
1922085
  message: `Input not instance of ${cls.name}`
1921929
1922086
  }) => custom9((data7) => data7 instanceof cls, params2), stringType7, numberType7, nanType7, bigIntType7, booleanType7, dateType7, symbolType7, undefinedType7, nullType7, anyType7, unknownType7, neverType7, voidType7, arrayType7, objectType7, strictObjectType7, unionType7, discriminatedUnionType7, intersectionType7, tupleType7, recordType7, mapType7, setType7, functionType7, lazyType7, literalType7, enumType7, nativeEnumType7, promiseType7, effectsType7, optionalType7, nullableType7, preprocessType7, pipelineType7, ostring7 = () => stringType7().optional(), onumber7 = () => numberType7().optional(), oboolean7 = () => booleanType7().optional(), coerce7, NEVER10;
1921930
- var init_types41 = __esm(() => {
1922087
+ var init_types42 = __esm(() => {
1921931
1922088
  init_ZodError6();
1921932
1922089
  init_errors40();
1921933
1922090
  init_errorUtil6();
@@ -1924848,7 +1925005,7 @@ var init_external7 = __esm(() => {
1924848
1925005
  init_parseUtil6();
1924849
1925006
  init_typeAliases6();
1924850
1925007
  init_util41();
1924851
- init_types41();
1925008
+ init_types42();
1924852
1925009
  init_ZodError6();
1924853
1925010
  });
1924854
1925011
 
@@ -1939657,7 +1939814,7 @@ class BorshTypesCoder {
1939657
1939814
  return layout3.decode(data7);
1939658
1939815
  }
1939659
1939816
  }
1939660
- var init_types42 = __esm(() => {
1939817
+ var init_types43 = __esm(() => {
1939661
1939818
  init_idl2();
1939662
1939819
  });
1939663
1939820
 
@@ -1939674,7 +1939831,7 @@ var init_borsh = __esm(() => {
1939674
1939831
  init_instruction2();
1939675
1939832
  init_accounts2();
1939676
1939833
  init_event3();
1939677
- init_types42();
1939834
+ init_types43();
1939678
1939835
  init_instruction2();
1939679
1939836
  init_accounts2();
1939680
1939837
  init_event3();
@@ -1960660,7 +1960817,7 @@ class BorshTypesCoder2 {
1960660
1960817
  return layout3.decode(data7);
1960661
1960818
  }
1960662
1960819
  }
1960663
- var init_types43 = __esm(() => {
1960820
+ var init_types44 = __esm(() => {
1960664
1960821
  init_idl4();
1960665
1960822
  });
1960666
1960823
 
@@ -1960677,7 +1960834,7 @@ var init_borsh2 = __esm(() => {
1960677
1960834
  init_instruction5();
1960678
1960835
  init_accounts4();
1960679
1960836
  init_event5();
1960680
- init_types43();
1960837
+ init_types44();
1960681
1960838
  init_instruction5();
1960682
1960839
  init_accounts4();
1960683
1960840
  init_event5();
@@ -1994943,7 +1995100,7 @@ var handleResult8 = (ctx, result) => {
1994943
1995100
  }, ZodDiscriminatedUnion9, ZodIntersection9, ZodTuple9, ZodRecord9, ZodMap9, ZodSet9, ZodFunction9, ZodLazy9, ZodLiteral9, ZodEnum9, ZodNativeEnum8, ZodPromise9, ZodEffects8, ZodOptional9, ZodNullable9, ZodDefault9, ZodCatch9, ZodNaN9, BRAND8, ZodBranded8, ZodPipeline8, ZodReadonly9, late8, ZodFirstPartyTypeKind9, instanceOfType8 = (cls, params2 = {
1994944
1995101
  message: `Input not instance of ${cls.name}`
1994945
1995102
  }) => custom10((data7) => data7 instanceof cls, params2), stringType8, numberType8, nanType8, bigIntType8, booleanType8, dateType8, symbolType8, undefinedType8, nullType8, anyType8, unknownType8, neverType8, voidType8, arrayType8, objectType8, strictObjectType8, unionType8, discriminatedUnionType8, intersectionType8, tupleType8, recordType8, mapType8, setType8, functionType8, lazyType8, literalType8, enumType8, nativeEnumType8, promiseType8, effectsType8, optionalType8, nullableType8, preprocessType8, pipelineType8, ostring8 = () => stringType8().optional(), onumber8 = () => numberType8().optional(), oboolean8 = () => booleanType8().optional(), coerce10, NEVER11;
1994946
- var init_types44 = __esm(() => {
1995103
+ var init_types45 = __esm(() => {
1994947
1995104
  init_ZodError7();
1994948
1995105
  init_errors41();
1994949
1995106
  init_errorUtil7();
@@ -1997864,7 +1998021,7 @@ var init_external8 = __esm(() => {
1997864
1998021
  init_parseUtil7();
1997865
1998022
  init_typeAliases7();
1997866
1998023
  init_util42();
1997867
- init_types44();
1998024
+ init_types45();
1997868
1998025
  init_ZodError7();
1997869
1998026
  });
1997870
1998027
 
@@ -2087509,7 +2087666,7 @@ var init_RestingOrder = __esm(() => {
2087509
2087666
  });
2087510
2087667
 
2087511
2087668
  // node_modules/@cks-systems/manifest-sdk/dist/esm/manifest/types/index.js
2087512
- var init_types45 = __esm(() => {
2087669
+ var init_types46 = __esm(() => {
2087513
2087670
  init_BatchUpdateParams();
2087514
2087671
  init_CancelOrderParams();
2087515
2087672
  init_ClaimedSeat();
@@ -2089200,7 +2089357,7 @@ var init_manifest = __esm(() => {
2089200
2089357
  init_accounts6();
2089201
2089358
  init_errors42();
2089202
2089359
  init_instructions13();
2089203
- init_types45();
2089360
+ init_types46();
2089204
2089361
  PROGRAM_ID = new import_web3178.PublicKey(PROGRAM_ADDRESS);
2089205
2089362
  });
2089206
2089363
 
@@ -2089680,7 +2089837,7 @@ var init_WrapperWithdrawParams = __esm(() => {
2089680
2089837
  });
2089681
2089838
 
2089682
2089839
  // node_modules/@cks-systems/manifest-sdk/dist/esm/wrapper/types/index.js
2089683
- var init_types46 = __esm(() => {
2089840
+ var init_types47 = __esm(() => {
2089684
2089841
  init_MarketInfo();
2089685
2089842
  init_OrderType2();
2089686
2089843
  init_WrapperBatchUpdateParams();
@@ -2089795,7 +2089952,7 @@ var import_bn96;
2089795
2089952
  var init_wrapperObj = __esm(() => {
2089796
2089953
  init_beet_solana();
2089797
2089954
  init_redBlackTree();
2089798
- init_types46();
2089955
+ init_types47();
2089799
2089956
  init_numbers3();
2089800
2089957
  import_bn96 = __toESM(require_bn(), 1);
2089801
2089958
  });
@@ -2090332,7 +2090489,7 @@ var import_web3181, PROGRAM_ADDRESS2 = "wMNFSTkir3HgyZTsB7uqu3i7FA73grFCptPXgrZj
2090332
2090489
  var init_wrapper3 = __esm(() => {
2090333
2090490
  import_web3181 = __toESM(require_index_cjs(), 1);
2090334
2090491
  init_instructions14();
2090335
- init_types46();
2090492
+ init_types47();
2090336
2090493
  PROGRAM_ID2 = new import_web3181.PublicKey(PROGRAM_ADDRESS2);
2090337
2090494
  });
2090338
2090495
 
@@ -2093861,7 +2094018,7 @@ var init_global2 = __esm(() => {
2093861
2094018
  init_redBlackTree();
2093862
2094019
  init_numbers3();
2093863
2094020
  init_esm40();
2093864
- init_types45();
2094021
+ init_types46();
2093865
2094022
  });
2093866
2094023
 
2093867
2094024
  // node_modules/@cks-systems/manifest-sdk/dist/esm/client.js
@@ -2094927,7 +2095084,7 @@ var import_web3183, marketDiscriminator;
2094927
2095084
  var init_client15 = __esm(() => {
2094928
2095085
  init_esm40();
2094929
2095086
  init_instructions13();
2094930
- init_types45();
2095087
+ init_types46();
2094931
2095088
  init_market4();
2094932
2095089
  init_wrapperObj();
2094933
2095090
  init_manifest();
@@ -2094941,7 +2095098,7 @@ var init_client15 = __esm(() => {
2094941
2095098
  });
2094942
2095099
 
2094943
2095100
  // node_modules/@cks-systems/manifest-sdk/dist/esm/types.js
2094944
- var init_types47 = () => {};
2095101
+ var init_types48 = () => {};
2094945
2095102
  // node_modules/@cks-systems/manifest-sdk/dist/esm/utils/index.js
2094946
2095103
  var init_utils59 = __esm(() => {
2094947
2095104
  init_beet();
@@ -2094957,7 +2095114,7 @@ var init_esm49 = __esm(() => {
2094957
2095114
  init_client15();
2094958
2095115
  init_market4();
2094959
2095116
  init_global2();
2094960
- init_types47();
2095117
+ init_types48();
2094961
2095118
  init_utils59();
2094962
2095119
  init_errors42();
2094963
2095120
  init_accounts6();
@@ -2147012,7 +2147169,7 @@ class BorshTypesCoder3 {
2147012
2147169
  return layout3.decode(data7);
2147013
2147170
  }
2147014
2147171
  }
2147015
- var init_types48 = __esm(() => {
2147172
+ var init_types49 = __esm(() => {
2147016
2147173
  init_idl6();
2147017
2147174
  });
2147018
2147175
 
@@ -2147029,7 +2147186,7 @@ var init_borsh3 = __esm(() => {
2147029
2147186
  init_instruction8();
2147030
2147187
  init_accounts7();
2147031
2147188
  init_event7();
2147032
- init_types48();
2147189
+ init_types49();
2147033
2147190
  init_instruction8();
2147034
2147191
  init_accounts7();
2147035
2147192
  init_event7();
@@ -2174543,7 +2174700,7 @@ class BorshTypesCoder4 {
2174543
2174700
  return layout3.decode(typeData);
2174544
2174701
  }
2174545
2174702
  }
2174546
- var init_types49 = __esm(() => {
2174703
+ var init_types50 = __esm(() => {
2174547
2174704
  init_idl7();
2174548
2174705
  });
2174549
2174706
 
@@ -2174560,7 +2174717,7 @@ var init_borsh4 = __esm(() => {
2174560
2174717
  init_instruction11();
2174561
2174718
  init_accounts9();
2174562
2174719
  init_event9();
2174563
- init_types49();
2174720
+ init_types50();
2174564
2174721
  init_instruction11();
2174565
2174722
  init_accounts9();
2174566
2174723
  init_event9();
@@ -2190245,7 +2190402,7 @@ class BorshTypesCoder5 {
2190245
2190402
  return layout3.decode(typeData);
2190246
2190403
  }
2190247
2190404
  }
2190248
- var init_types50 = __esm(() => {
2190405
+ var init_types51 = __esm(() => {
2190249
2190406
  init_idl10();
2190250
2190407
  });
2190251
2190408
 
@@ -2190262,7 +2190419,7 @@ var init_borsh5 = __esm(() => {
2190262
2190419
  init_instruction14();
2190263
2190420
  init_accounts11();
2190264
2190421
  init_event11();
2190265
- init_types50();
2190422
+ init_types51();
2190266
2190423
  init_instruction14();
2190267
2190424
  init_accounts11();
2190268
2190425
  init_event11();
@@ -2194775,7 +2194932,7 @@ class BorshTypesCoder6 {
2194775
2194932
  return layout3.decode(typeData);
2194776
2194933
  }
2194777
2194934
  }
2194778
- var init_types51 = __esm(() => {
2194935
+ var init_types52 = __esm(() => {
2194779
2194936
  init_idl12();
2194780
2194937
  });
2194781
2194938
 
@@ -2194792,7 +2194949,7 @@ var init_borsh6 = __esm(() => {
2194792
2194949
  init_instruction17();
2194793
2194950
  init_accounts13();
2194794
2194951
  init_event13();
2194795
- init_types51();
2194952
+ init_types52();
2194796
2194953
  init_instruction17();
2194797
2194954
  init_accounts13();
2194798
2194955
  init_event13();
@@ -2205590,7 +2205747,7 @@ var require_invariant2 = __commonJS((exports6, module) => {
2205590
2205747
 
2205591
2205748
  // node_modules/@mercurial-finance/dynamic-amm-sdk/dist/esm/src/amm/types/index.js
2205592
2205749
  var import_borsh3, AccountType2, StakePoolLayout, ClockLayout3, ActivationType;
2205593
- var init_types52 = __esm(() => {
2205750
+ var init_types53 = __esm(() => {
2205594
2205751
  import_borsh3 = __toESM(require_dist66(), 1);
2205595
2205752
  (function(AccountType3) {
2205596
2205753
  AccountType3["APY"] = "apy";
@@ -2402055,7 +2402212,7 @@ var init_stable_swap = __esm(() => {
2402055
2402212
  init_curve10();
2402056
2402213
  init_constants17();
2402057
2402214
  init_marinade_finance();
2402058
- init_types52();
2402215
+ init_types53();
2402059
2402216
  import_web3285 = __toESM(require_index_cjs(), 1);
2402060
2402217
  PRECISION2 = new import_bn118.default(1e6);
2402061
2402218
  BASE_CACHE_EXPIRE = new import_bn118.default(60 * 10);
@@ -2427194,7 +2427351,7 @@ var init_utils66 = __esm(() => {
2427194
2427351
  init_esm40();
2427195
2427352
  init_constants17();
2427196
2427353
  init_curve10();
2427197
- init_types52();
2427354
+ init_types53();
2427198
2427355
  init_idl16();
2427199
2427356
  init_decimal2();
2427200
2427357
  import_web3286 = __toESM(require_index_cjs(), 1);
@@ -2429030,7 +2429187,7 @@ var init_amm = __esm(() => {
2429030
2429187
  init_esm40();
2429031
2429188
  init_esm52();
2429032
2429189
  init_dist45();
2429033
- init_types52();
2429190
+ init_types53();
2429034
2429191
  init_constants17();
2429035
2429192
  init_curve10();
2429036
2429193
  init_constant_product();
@@ -2781656,7 +2781813,7 @@ var init_provider14 = __esm(() => {
2781656
2781813
  init_dist39();
2781657
2781814
  init_dist42();
2781658
2781815
  init_dist46();
2781659
- init_types38();
2781816
+ init_types39();
2781660
2781817
  import_web3376 = __toESM(require_index_cjs(), 1);
2781661
2781818
  import_bs5830 = __toESM(require_bs58(), 1);
2781662
2781819
  });
@@ -2781664,7 +2781821,7 @@ var init_provider14 = __esm(() => {
2781664
2781821
  // src/infra/solanakit/index.ts
2781665
2781822
  var init_solanakit = __esm(() => {
2781666
2781823
  init_provider14();
2781667
- init_types38();
2781824
+ init_types39();
2781668
2781825
  });
2781669
2781826
 
2781670
2781827
  // src/infra/agents/tools/solanakit-wallet.ts
@@ -2783923,7 +2784080,7 @@ function getRpcUrl(chainName) {
2783923
2784080
  return defaultUrl;
2783924
2784081
  }
2783925
2784082
  var CHAINLINK_ENV_KEYS, STREAMS_BASE_URL = "https://api.dataengine.chain.link", STREAMS_FEED_IDS, FEED_SELECTORS, CHAIN_RPCS, FEED_DIRECTORY, CCIP_CHAINS, ERC20_APPROVE_ABI, CCIP_ROUTER_ABI;
2783926
- var init_types53 = __esm(() => {
2784083
+ var init_types54 = __esm(() => {
2783927
2784084
  CHAINLINK_ENV_KEYS = {
2783928
2784085
  API_KEY: "CHAINLINK_API_KEY",
2783929
2784086
  API_SECRET: "CHAINLINK_API_SECRET",
@@ -2786517,7 +2786674,7 @@ function listAvailableFeeds() {
2786517
2786674
  }
2786518
2786675
  var import_data_streams_sdk, _client = null;
2786519
2786676
  var init_streams = __esm(() => {
2786520
- init_types53();
2786677
+ init_types54();
2786521
2786678
  import_data_streams_sdk = __toESM(require_src41(), 1);
2786522
2786679
  });
2786523
2786680
 
@@ -2786610,7 +2786767,7 @@ async function comparePrices(pair, chainName = "ethereum", streamPrice) {
2786610
2786767
  };
2786611
2786768
  }
2786612
2786769
  var init_feeds = __esm(() => {
2786613
- init_types53();
2786770
+ init_types54();
2786614
2786771
  init_streams();
2786615
2786772
  });
2786616
2786773
 
@@ -2786751,12 +2786908,12 @@ async function getCCIPStatus(messageId) {
2786751
2786908
  }
2786752
2786909
  var init_ccip7 = __esm(() => {
2786753
2786910
  init_lib2();
2786754
- init_types53();
2786911
+ init_types54();
2786755
2786912
  });
2786756
2786913
 
2786757
2786914
  // src/infra/chainlink/index.ts
2786758
2786915
  var init_chainlink = __esm(() => {
2786759
- init_types53();
2786916
+ init_types54();
2786760
2786917
  init_streams();
2786761
2786918
  init_feeds();
2786762
2786919
  init_ccip7();
@@ -2787040,6 +2787197,261 @@ var init_chainlink_ccip = __esm(() => {
2787040
2787197
  };
2787041
2787198
  });
2787042
2787199
 
2787200
+ // src/infra/synthdata/types.ts
2787201
+ var SYNTHDATA_ENV_KEYS, SYNTHDATA_BASE_URL = "https://api.synthdata.co", SYNTHDATA_TIMEOUT = 15000, SYNTHDATA_CACHE_TTL = 300000, SYNTHDATA_ASSETS;
2787202
+ var init_types55 = __esm(() => {
2787203
+ SYNTHDATA_ENV_KEYS = {
2787204
+ API_KEY: "SYNTHDATA_API_KEY"
2787205
+ };
2787206
+ SYNTHDATA_ASSETS = [
2787207
+ "BTC",
2787208
+ "ETH",
2787209
+ "SOL",
2787210
+ "XAU",
2787211
+ "SPYX",
2787212
+ "NVDAX",
2787213
+ "TSLAX",
2787214
+ "AAPLX",
2787215
+ "GOOGLX"
2787216
+ ];
2787217
+ });
2787218
+
2787219
+ // src/infra/synthdata/client.ts
2787220
+ function isSynthDataConfigured() {
2787221
+ return Boolean(process.env[SYNTHDATA_ENV_KEYS.API_KEY]);
2787222
+ }
2787223
+ function getHeaders() {
2787224
+ const apiKey = process.env[SYNTHDATA_ENV_KEYS.API_KEY];
2787225
+ if (!apiKey)
2787226
+ throw new Error("SYNTHDATA_API_KEY not configured");
2787227
+ return {
2787228
+ Authorization: `Apikey ${apiKey}`,
2787229
+ Accept: "application/json"
2787230
+ };
2787231
+ }
2787232
+ async function synthGet(path7, params2 = {}, cacheKey4) {
2787233
+ if (cacheKey4) {
2787234
+ const cached3 = cache5.get(cacheKey4);
2787235
+ if (cached3 !== undefined)
2787236
+ return cached3;
2787237
+ }
2787238
+ const url3 = new URL(path7, SYNTHDATA_BASE_URL);
2787239
+ for (const [k2, v18] of Object.entries(params2)) {
2787240
+ if (v18 !== undefined)
2787241
+ url3.searchParams.set(k2, String(v18));
2787242
+ }
2787243
+ const result = await withRetry(async () => {
2787244
+ const resp = await fetch(url3.toString(), {
2787245
+ method: "GET",
2787246
+ headers: getHeaders(),
2787247
+ signal: AbortSignal.timeout(SYNTHDATA_TIMEOUT)
2787248
+ });
2787249
+ if (!resp.ok) {
2787250
+ const body = await resp.text().catch(() => "");
2787251
+ const err2 = new Error(`SynthData API ${resp.status}: ${resp.statusText}${body ? ` \u2014 ${body}` : ""}`);
2787252
+ err2.status = resp.status;
2787253
+ throw err2;
2787254
+ }
2787255
+ return resp.json();
2787256
+ }, { maxRetries: 2, baseDelayMs: 500, maxDelayMs: 5000 });
2787257
+ if (cacheKey4) {
2787258
+ cache5.set(cacheKey4, result);
2787259
+ }
2787260
+ return result;
2787261
+ }
2787262
+ async function getPredictionPercentiles(asset, days = 14, limit2 = 10) {
2787263
+ return synthGet("/insights/prediction-percentiles", { asset, days, limit: limit2 }, `percentiles:${asset}:${days}:${limit2}`);
2787264
+ }
2787265
+ async function getVolatility(asset, days = 14, limit2 = 10) {
2787266
+ return synthGet("/insights/volatility", { asset, days, limit: limit2 }, `volatility:${asset}:${days}:${limit2}`);
2787267
+ }
2787268
+ async function getOptionPricing(asset) {
2787269
+ return synthGet("/insights/option-pricing", { asset }, `options:${asset}`);
2787270
+ }
2787271
+ async function getLiquidation(asset) {
2787272
+ return synthGet("/insights/liquidation", { asset }, `liquidation:${asset}`);
2787273
+ }
2787274
+ async function getLPBounds(asset) {
2787275
+ return synthGet("/insights/lp-bounds", { asset }, `lp-bounds:${asset}`);
2787276
+ }
2787277
+ async function getLPProbabilities(asset) {
2787278
+ return synthGet("/insights/lp-probabilities", { asset }, `lp-probs:${asset}`);
2787279
+ }
2787280
+ async function getLeaderboard(asset, days = 14, limit2 = 10) {
2787281
+ return synthGet("/v2/leaderboard/latest", { asset, days, limit: limit2 }, `leaderboard:${asset}:${days}:${limit2}`);
2787282
+ }
2787283
+ var cache5;
2787284
+ var init_client17 = __esm(() => {
2787285
+ init_retry();
2787286
+ init_types55();
2787287
+ cache5 = new Cache({
2787288
+ defaultTtl: SYNTHDATA_CACHE_TTL,
2787289
+ maxEntries: 200,
2787290
+ updateTtlOnAccess: false
2787291
+ });
2787292
+ });
2787293
+
2787294
+ // src/infra/synthdata/index.ts
2787295
+ var init_synthdata = __esm(() => {
2787296
+ init_types55();
2787297
+ init_client17();
2787298
+ });
2787299
+
2787300
+ // src/infra/agents/tools/synthdata.ts
2787301
+ var ASSET_DESC, NOT_CONFIGURED = "SynthData not configured. Set SYNTHDATA_API_KEY environment variable.", outputSchema7, synthDataPredictionPercentilesTool, synthDataVolatilityTool, synthDataOptionPricingTool, synthDataLiquidationTool, synthDataLPBoundsTool, synthDataLPProbabilitiesTool, synthDataLeaderboardTool, synthDataTools;
2787302
+ var init_synthdata2 = __esm(() => {
2787303
+ init_tools();
2787304
+ init_zod();
2787305
+ init_synthdata();
2787306
+ ASSET_DESC = `Asset symbol. Supported: ${SYNTHDATA_ASSETS.join(", ")}`;
2787307
+ outputSchema7 = exports_external.object({
2787308
+ success: exports_external.boolean(),
2787309
+ data: exports_external.unknown().optional(),
2787310
+ error: exports_external.string().optional()
2787311
+ });
2787312
+ synthDataPredictionPercentilesTool = createTool({
2787313
+ id: "synthdata_prediction_percentiles",
2787314
+ description: "Get SynthData AI probabilistic price predictions \u2014 the cone of likely future prices. " + "Returns 5th, 25th, 50th (median), 75th, and 95th percentile price paths at 5-minute intervals. " + "Use this to understand the probability-weighted range of where price could go. " + "Supports BTC, ETH, SOL, XAU (gold), and tokenized equities (SPYX, NVDAX, TSLAX, AAPLX, GOOGLX).",
2787315
+ inputSchema: exports_external.object({
2787316
+ asset: exports_external.string().describe(ASSET_DESC),
2787317
+ days: exports_external.number().default(14).describe("Lookback window for miner ranking (default 14)"),
2787318
+ limit: exports_external.number().default(10).describe("Number of top miners to aggregate (default 10)")
2787319
+ }),
2787320
+ outputSchema: outputSchema7,
2787321
+ execute: async ({ asset, days, limit: limit2 }) => {
2787322
+ if (!isSynthDataConfigured())
2787323
+ return { success: false, error: NOT_CONFIGURED };
2787324
+ try {
2787325
+ const data7 = await getPredictionPercentiles(asset, days, limit2);
2787326
+ return { success: true, data: data7 };
2787327
+ } catch (error56) {
2787328
+ return { success: false, error: error56.message };
2787329
+ }
2787330
+ }
2787331
+ });
2787332
+ synthDataVolatilityTool = createTool({
2787333
+ id: "synthdata_volatility",
2787334
+ description: "Get SynthData volatility analysis \u2014 forecast vs realized volatility comparison. " + "Shows if current volatility is above or below AI predictions, useful for regime detection, " + "options valuation, and risk adjustment. Returns forecast mean, realized mean, and time series.",
2787335
+ inputSchema: exports_external.object({
2787336
+ asset: exports_external.string().describe(ASSET_DESC),
2787337
+ days: exports_external.number().default(14).describe("Lookback window (default 14)"),
2787338
+ limit: exports_external.number().default(10).describe("Top miners to aggregate (default 10)")
2787339
+ }),
2787340
+ outputSchema: outputSchema7,
2787341
+ execute: async ({ asset, days, limit: limit2 }) => {
2787342
+ if (!isSynthDataConfigured())
2787343
+ return { success: false, error: NOT_CONFIGURED };
2787344
+ try {
2787345
+ const data7 = await getVolatility(asset, days, limit2);
2787346
+ return { success: true, data: data7 };
2787347
+ } catch (error56) {
2787348
+ return { success: false, error: error56.message };
2787349
+ }
2787350
+ }
2787351
+ });
2787352
+ synthDataOptionPricingTool = createTool({
2787353
+ id: "synthdata_option_pricing",
2787354
+ description: "Get SynthData theoretical option prices \u2014 call and put valuations by strike from Monte Carlo simulations. " + "Use for options strategy construction, mispricing detection (compare vs market), and implied sentiment analysis.",
2787355
+ inputSchema: exports_external.object({
2787356
+ asset: exports_external.string().describe(ASSET_DESC)
2787357
+ }),
2787358
+ outputSchema: outputSchema7,
2787359
+ execute: async ({ asset }) => {
2787360
+ if (!isSynthDataConfigured())
2787361
+ return { success: false, error: NOT_CONFIGURED };
2787362
+ try {
2787363
+ const data7 = await getOptionPricing(asset);
2787364
+ return { success: true, data: data7 };
2787365
+ } catch (error56) {
2787366
+ return { success: false, error: error56.message };
2787367
+ }
2787368
+ }
2787369
+ });
2787370
+ synthDataLiquidationTool = createTool({
2787371
+ id: "synthdata_liquidation",
2787372
+ description: "Get SynthData liquidation probability analysis \u2014 probability of long and short liquidations at 24h horizon. " + "Critical for risk assessment of leveraged positions. Shows liquidation probability under various price scenarios.",
2787373
+ inputSchema: exports_external.object({
2787374
+ asset: exports_external.string().describe(ASSET_DESC)
2787375
+ }),
2787376
+ outputSchema: outputSchema7,
2787377
+ execute: async ({ asset }) => {
2787378
+ if (!isSynthDataConfigured())
2787379
+ return { success: false, error: NOT_CONFIGURED };
2787380
+ try {
2787381
+ const data7 = await getLiquidation(asset);
2787382
+ return { success: true, data: data7 };
2787383
+ } catch (error56) {
2787384
+ return { success: false, error: error56.message };
2787385
+ }
2787386
+ }
2787387
+ });
2787388
+ synthDataLPBoundsTool = createTool({
2787389
+ id: "synthdata_lp_bounds",
2787390
+ description: "Get SynthData optimal Uniswap V3 LP ranges \u2014 AI-recommended price bounds with impermanent loss estimates. " + "Shows optimal lower/upper bounds, probability of staying in range, expected duration, and projected IL. " + "Use for DeFi liquidity provision planning and range-setting.",
2787391
+ inputSchema: exports_external.object({
2787392
+ asset: exports_external.string().describe(ASSET_DESC)
2787393
+ }),
2787394
+ outputSchema: outputSchema7,
2787395
+ execute: async ({ asset }) => {
2787396
+ if (!isSynthDataConfigured())
2787397
+ return { success: false, error: NOT_CONFIGURED };
2787398
+ try {
2787399
+ const data7 = await getLPBounds(asset);
2787400
+ return { success: true, data: data7 };
2787401
+ } catch (error56) {
2787402
+ return { success: false, error: error56.message };
2787403
+ }
2787404
+ }
2787405
+ });
2787406
+ synthDataLPProbabilitiesTool = createTool({
2787407
+ id: "synthdata_lp_probabilities",
2787408
+ description: "Get SynthData price level probabilities \u2014 cumulative probability of price being above or below each level within 24h. " + "Use for setting LP range bounds, stop-loss levels, and take-profit targets based on probabilistic analysis.",
2787409
+ inputSchema: exports_external.object({
2787410
+ asset: exports_external.string().describe(ASSET_DESC)
2787411
+ }),
2787412
+ outputSchema: outputSchema7,
2787413
+ execute: async ({ asset }) => {
2787414
+ if (!isSynthDataConfigured())
2787415
+ return { success: false, error: NOT_CONFIGURED };
2787416
+ try {
2787417
+ const data7 = await getLPProbabilities(asset);
2787418
+ return { success: true, data: data7 };
2787419
+ } catch (error56) {
2787420
+ return { success: false, error: error56.message };
2787421
+ }
2787422
+ }
2787423
+ });
2787424
+ synthDataLeaderboardTool = createTool({
2787425
+ id: "synthdata_leaderboard",
2787426
+ description: "Get SynthData AI miner leaderboard \u2014 top-performing prediction models ranked by accuracy (CRPS score). " + "Shows which AI forecasters are currently most accurate for a given asset.",
2787427
+ inputSchema: exports_external.object({
2787428
+ asset: exports_external.string().describe(ASSET_DESC),
2787429
+ days: exports_external.number().default(14).describe("Ranking period in days (default 14)"),
2787430
+ limit: exports_external.number().default(10).describe("Number of top miners to return (default 10)")
2787431
+ }),
2787432
+ outputSchema: outputSchema7,
2787433
+ execute: async ({ asset, days, limit: limit2 }) => {
2787434
+ if (!isSynthDataConfigured())
2787435
+ return { success: false, error: NOT_CONFIGURED };
2787436
+ try {
2787437
+ const data7 = await getLeaderboard(asset, days, limit2);
2787438
+ return { success: true, data: data7 };
2787439
+ } catch (error56) {
2787440
+ return { success: false, error: error56.message };
2787441
+ }
2787442
+ }
2787443
+ });
2787444
+ synthDataTools = {
2787445
+ synthdata_prediction_percentiles: synthDataPredictionPercentilesTool,
2787446
+ synthdata_volatility: synthDataVolatilityTool,
2787447
+ synthdata_option_pricing: synthDataOptionPricingTool,
2787448
+ synthdata_liquidation: synthDataLiquidationTool,
2787449
+ synthdata_lp_bounds: synthDataLPBoundsTool,
2787450
+ synthdata_lp_probabilities: synthDataLPProbabilitiesTool,
2787451
+ synthdata_leaderboard: synthDataLeaderboardTool
2787452
+ };
2787453
+ });
2787454
+
2787043
2787455
  // src/infra/agents/tools/position-tracking.ts
2787044
2787456
  async function getManager() {
2787045
2787457
  return getPositionManager(getEventBus());
@@ -2788448,7 +2788860,7 @@ var init_runtime_tools = __esm(() => {
2788448
2788860
 
2788449
2788861
  // src/core/regime/types.ts
2788450
2788862
  var MarketRegimeSchema, RegimeMetricsSchema, RegimeSignalSchema, RegimeSpanSchema, RegimeHistorySchema, MultiTimeframeRegimeSchema;
2788451
- var init_types54 = __esm(() => {
2788863
+ var init_types56 = __esm(() => {
2788452
2788864
  init_zod();
2788453
2788865
  MarketRegimeSchema = exports_external.enum([
2788454
2788866
  "trending_up",
@@ -2788676,7 +2789088,7 @@ var init_watcher = __esm(() => {
2788676
2789088
 
2788677
2789089
  // src/core/regime/index.ts
2788678
2789090
  var init_regime = __esm(() => {
2788679
- init_types54();
2789091
+ init_types56();
2788680
2789092
  init_classifier();
2788681
2789093
  init_detector();
2788682
2789094
  init_watcher();
@@ -2788688,7 +2789100,7 @@ var init_regime_tools = __esm(() => {
2788688
2789100
  init_tools();
2788689
2789101
  init_zod();
2788690
2789102
  init_regime();
2788691
- init_types54();
2789103
+ init_types56();
2788692
2789104
  init_types9();
2788693
2789105
  init_logger2();
2788694
2789106
  logger112 = createModuleLogger("regime-tools");
@@ -2789365,7 +2789777,7 @@ var init_advanced_tools = __esm(() => {
2789365
2789777
 
2789366
2789778
  // src/core/genome/types.ts
2789367
2789779
  var MutationSchema2, GenomeSchema, ExperimentSchema, MutationSuggestionSchema;
2789368
- var init_types55 = __esm(() => {
2789780
+ var init_types57 = __esm(() => {
2789369
2789781
  init_zod();
2789370
2789782
  MutationSchema2 = exports_external.object({
2789371
2789783
  mutation_id: exports_external.string().uuid(),
@@ -2789892,7 +2790304,7 @@ __export(exports_genome, {
2789892
2790304
  EvolutionLoop: () => EvolutionLoop
2789893
2790305
  });
2789894
2790306
  var init_genome = __esm(() => {
2789895
- init_types55();
2790307
+ init_types57();
2789896
2790308
  init_manager3();
2789897
2790309
  init_mutator();
2789898
2790310
  init_fitness();
@@ -2793414,6 +2793826,7 @@ var init_tools7 = __esm(async () => {
2793414
2793826
  init_chainlink_streams();
2793415
2793827
  init_chainlink_feeds();
2793416
2793828
  init_chainlink_ccip();
2793829
+ init_synthdata2();
2793417
2793830
  init_position_tracking();
2793418
2793831
  init_risk_gate();
2793419
2793832
  init_memory_tools();
@@ -2793480,6 +2793893,7 @@ var init_tools7 = __esm(async () => {
2793480
2793893
  init_chainlink_streams();
2793481
2793894
  init_chainlink_feeds();
2793482
2793895
  init_chainlink_ccip();
2793896
+ init_synthdata2();
2793483
2793897
  init_position_tracking();
2793484
2793898
  init_risk_gate();
2793485
2793899
  init_memory_tools();
@@ -2793550,6 +2793964,7 @@ var init_tools7 = __esm(async () => {
2793550
2793964
  ...chainlinkStreamsTools,
2793551
2793965
  ...chainlinkFeedsTools,
2793552
2793966
  ...chainlinkCCIPTools,
2793967
+ ...synthDataTools,
2793553
2793968
  ...multiModalChartTools,
2793554
2793969
  ...evalTools,
2793555
2793970
  ...positionTrackingTools,
@@ -2793611,6 +2794026,7 @@ var init_tools7 = __esm(async () => {
2793611
2794026
  chainlinkStreams: Object.keys(chainlinkStreamsTools).length,
2793612
2794027
  chainlinkFeeds: Object.keys(chainlinkFeedsTools).length,
2793613
2794028
  chainlinkCCIP: Object.keys(chainlinkCCIPTools).length,
2794029
+ synthData: Object.keys(synthDataTools).length,
2793614
2794030
  multiModalCharts: Object.keys(multiModalChartTools).length,
2793615
2794031
  evals: Object.keys(evalTools).length,
2793616
2794032
  positionTracking: Object.keys(positionTrackingTools).length,
@@ -2795791,30 +2796207,30 @@ var require_dereference = __commonJS((exports6) => {
2795791
2796207
  const isExternalRef = ref_js_1.default.isExternal$Ref($ref);
2795792
2796208
  const shouldResolveOnCwd = isExternalRef && options4?.dereference?.externalReferenceResolution === "root";
2795793
2796209
  const $refPath = url3.resolve(shouldResolveOnCwd ? url3.cwd() : path8, $ref.$ref);
2795794
- const cache5 = dereferencedCache.get($refPath);
2795795
- if (cache5) {
2795796
- if (!cache5.circular) {
2796210
+ const cache6 = dereferencedCache.get($refPath);
2796211
+ if (cache6) {
2796212
+ if (!cache6.circular) {
2795797
2796213
  const refKeys = Object.keys($ref);
2795798
2796214
  if (refKeys.length > 1) {
2795799
2796215
  const extraKeys = {};
2795800
2796216
  for (const key5 of refKeys) {
2795801
- if (key5 !== "$ref" && !(key5 in cache5.value)) {
2796217
+ if (key5 !== "$ref" && !(key5 in cache6.value)) {
2795802
2796218
  extraKeys[key5] = $ref[key5];
2795803
2796219
  }
2795804
2796220
  }
2795805
2796221
  return {
2795806
- circular: cache5.circular,
2795807
- value: Object.assign({}, cache5.value, extraKeys)
2796222
+ circular: cache6.circular,
2796223
+ value: Object.assign({}, cache6.value, extraKeys)
2795808
2796224
  };
2795809
2796225
  }
2795810
- return cache5;
2796226
+ return cache6;
2795811
2796227
  }
2795812
- if (typeof cache5.value === "object" && "$ref" in cache5.value && "$ref" in $ref) {
2795813
- if (cache5.value.$ref === $ref.$ref) {
2795814
- return cache5;
2796228
+ if (typeof cache6.value === "object" && "$ref" in cache6.value && "$ref" in $ref) {
2796229
+ if (cache6.value.$ref === $ref.$ref) {
2796230
+ return cache6;
2795815
2796231
  } else {}
2795816
2796232
  } else {
2795817
- return cache5;
2796233
+ return cache6;
2795818
2796234
  }
2795819
2796235
  }
2795820
2796236
  const pointer2 = $refs._resolve($refPath, path8, options4);
@@ -2796226,7 +2796642,7 @@ var init_zod_compat = __esm(() => {
2796226
2796642
 
2796227
2796643
  // node_modules/@modelcontextprotocol/sdk/dist/esm/types.js
2796228
2796644
  var LATEST_PROTOCOL_VERSION = "2025-11-25", SUPPORTED_PROTOCOL_VERSIONS, RELATED_TASK_META_KEY = "io.modelcontextprotocol/related-task", JSONRPC_VERSION4 = "2.0", AssertObjectSchema, ProgressTokenSchema, CursorSchema, TaskCreationParamsSchema, TaskMetadataSchema, RelatedTaskMetadataSchema, RequestMetaSchema, BaseRequestParamsSchema, TaskAugmentedRequestParamsSchema, isTaskAugmentedRequestParams = (value2) => TaskAugmentedRequestParamsSchema.safeParse(value2).success, RequestSchema4, NotificationsParamsSchema, NotificationSchema, ResultSchema4, RequestIdSchema, JSONRPCRequestSchema4, isJSONRPCRequest = (value2) => JSONRPCRequestSchema4.safeParse(value2).success, JSONRPCNotificationSchema4, isJSONRPCNotification = (value2) => JSONRPCNotificationSchema4.safeParse(value2).success, JSONRPCResultResponseSchema, isJSONRPCResultResponse = (value2) => JSONRPCResultResponseSchema.safeParse(value2).success, ErrorCode, JSONRPCErrorResponseSchema, isJSONRPCErrorResponse = (value2) => JSONRPCErrorResponseSchema.safeParse(value2).success, JSONRPCMessageSchema, JSONRPCResponseSchema4, EmptyResultSchema, CancelledNotificationParamsSchema, CancelledNotificationSchema, IconSchema, IconsSchema, BaseMetadataSchema, ImplementationSchema, FormElicitationCapabilitySchema, ElicitationCapabilitySchema, ClientTasksCapabilitySchema, ServerTasksCapabilitySchema, ClientCapabilitiesSchema, InitializeRequestParamsSchema, InitializeRequestSchema, ServerCapabilitiesSchema4, InitializeResultSchema, InitializedNotificationSchema, isInitializedNotification = (value2) => InitializedNotificationSchema.safeParse(value2).success, PingRequestSchema, ProgressSchema, ProgressNotificationParamsSchema, ProgressNotificationSchema, PaginatedRequestParamsSchema, PaginatedRequestSchema, PaginatedResultSchema4, TaskStatusSchema, TaskSchema, CreateTaskResultSchema, TaskStatusNotificationParamsSchema, TaskStatusNotificationSchema, GetTaskRequestSchema, GetTaskResultSchema, GetTaskPayloadRequestSchema, GetTaskPayloadResultSchema, ListTasksRequestSchema, ListTasksResultSchema, CancelTaskRequestSchema, CancelTaskResultSchema, ResourceContentsSchema4, TextResourceContentsSchema4, Base64Schema, BlobResourceContentsSchema4, RoleSchema, AnnotationsSchema, ResourceSchema, ResourceTemplateSchema, ListResourcesRequestSchema, ListResourcesResultSchema, ListResourceTemplatesRequestSchema, ListResourceTemplatesResultSchema, ResourceRequestParamsSchema, ReadResourceRequestParamsSchema, ReadResourceRequestSchema, ReadResourceResultSchema, ResourceListChangedNotificationSchema, SubscribeRequestParamsSchema, SubscribeRequestSchema, UnsubscribeRequestParamsSchema, UnsubscribeRequestSchema, ResourceUpdatedNotificationParamsSchema, ResourceUpdatedNotificationSchema, PromptArgumentSchema, PromptSchema, ListPromptsRequestSchema, ListPromptsResultSchema, GetPromptRequestParamsSchema, GetPromptRequestSchema, TextContentSchema4, ImageContentSchema4, AudioContentSchema, ToolUseContentSchema, EmbeddedResourceSchema4, ResourceLinkSchema, ContentBlockSchema, PromptMessageSchema, GetPromptResultSchema, PromptListChangedNotificationSchema, ToolAnnotationsSchema, ToolExecutionSchema, ToolSchema4, ListToolsRequestSchema, ListToolsResultSchema, CallToolResultSchema, CompatibilityCallToolResultSchema, CallToolRequestParamsSchema, CallToolRequestSchema, ToolListChangedNotificationSchema, ListChangedOptionsBaseSchema, LoggingLevelSchema, SetLevelRequestParamsSchema, SetLevelRequestSchema, LoggingMessageNotificationParamsSchema, LoggingMessageNotificationSchema, ModelHintSchema, ModelPreferencesSchema, ToolChoiceSchema, ToolResultContentSchema, SamplingContentSchema, SamplingMessageContentBlockSchema, SamplingMessageSchema, CreateMessageRequestParamsSchema, CreateMessageRequestSchema, CreateMessageResultSchema, CreateMessageResultWithToolsSchema, BooleanSchemaSchema, StringSchemaSchema, NumberSchemaSchema, UntitledSingleSelectEnumSchemaSchema, TitledSingleSelectEnumSchemaSchema, LegacyTitledEnumSchemaSchema, SingleSelectEnumSchemaSchema, UntitledMultiSelectEnumSchemaSchema, TitledMultiSelectEnumSchemaSchema, MultiSelectEnumSchemaSchema, EnumSchemaSchema, PrimitiveSchemaDefinitionSchema, ElicitRequestFormParamsSchema, ElicitRequestURLParamsSchema, ElicitRequestParamsSchema, ElicitRequestSchema, ElicitationCompleteNotificationParamsSchema, ElicitationCompleteNotificationSchema, ElicitResultSchema, ResourceTemplateReferenceSchema, PromptReferenceSchema, CompleteRequestParamsSchema, CompleteRequestSchema, CompleteResultSchema, RootSchema, ListRootsRequestSchema, ListRootsResultSchema, RootsListChangedNotificationSchema, ClientRequestSchema, ClientNotificationSchema, ClientResultSchema, ServerRequestSchema, ServerNotificationSchema, ServerResultSchema, McpError, UrlElicitationRequiredError;
2796229
- var init_types56 = __esm(() => {
2796645
+ var init_types58 = __esm(() => {
2796230
2796646
  init_v42();
2796231
2796647
  SUPPORTED_PROTOCOL_VERSIONS = [LATEST_PROTOCOL_VERSION, "2025-06-18", "2025-03-26", "2024-11-05", "2024-10-07"];
2796232
2796648
  AssertObjectSchema = custom((v18) => v18 !== null && (typeof v18 === "object" || typeof v18 === "function"));
@@ -2797902,7 +2798318,7 @@ function mergeCapabilities(base10, additional) {
2797902
2798318
  var DEFAULT_REQUEST_TIMEOUT_MSEC = 60000;
2797903
2798319
  var init_protocol4 = __esm(() => {
2797904
2798320
  init_zod_compat();
2797905
- init_types56();
2798321
+ init_types58();
2797906
2798322
  init_zod_json_schema_compat();
2797907
2798323
  });
2797908
2798324
 
@@ -2804477,8 +2804893,8 @@ class ExperimentalClientTasks {
2804477
2804893
  return this._client.requestStream(request7, resultSchema, options4);
2804478
2804894
  }
2804479
2804895
  }
2804480
- var init_client17 = __esm(() => {
2804481
- init_types56();
2804896
+ var init_client18 = __esm(() => {
2804897
+ init_types58();
2804482
2804898
  });
2804483
2804899
 
2804484
2804900
  // node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/helpers.js
@@ -2804559,12 +2804975,12 @@ function getSupportedElicitationModes(capabilities) {
2804559
2804975
  return { supportsFormMode, supportsUrlMode };
2804560
2804976
  }
2804561
2804977
  var Client3;
2804562
- var init_client18 = __esm(() => {
2804978
+ var init_client19 = __esm(() => {
2804563
2804979
  init_protocol4();
2804564
- init_types56();
2804980
+ init_types58();
2804565
2804981
  init_ajv_provider();
2804566
2804982
  init_zod_compat();
2804567
- init_client17();
2804983
+ init_client18();
2804568
2804984
  Client3 = class Client3 extends Protocol {
2804569
2804985
  constructor(_clientInfo, options4) {
2804570
2804986
  super(options4);
@@ -2805808,7 +2806224,7 @@ async function registerClient(authorizationServerUrl, { metadata: metadata4, cli
2805808
2806224
  var UnauthorizedError2, AUTHORIZATION_CODE_RESPONSE_TYPE = "code", AUTHORIZATION_CODE_CHALLENGE_METHOD = "S256";
2805809
2806225
  var init_auth2 = __esm(() => {
2805810
2806226
  init_index_node10();
2805811
- init_types56();
2806227
+ init_types58();
2805812
2806228
  init_auth();
2805813
2806229
  init_auth();
2805814
2806230
  init_errors43();
@@ -2806001,7 +2806417,7 @@ class SSEClientTransport {
2806001
2806417
  var SseError;
2806002
2806418
  var init_sse = __esm(() => {
2806003
2806419
  init_dist43();
2806004
- init_types56();
2806420
+ init_types58();
2806005
2806421
  init_auth2();
2806006
2806422
  SseError = class SseError extends Error {
2806007
2806423
  constructor(code, message5, event9) {
@@ -2806498,7 +2806914,7 @@ function serializeMessage2(message5) {
2806498
2806914
  `;
2806499
2806915
  }
2806500
2806916
  var init_stdio = __esm(() => {
2806501
- init_types56();
2806917
+ init_types58();
2806502
2806918
  });
2806503
2806919
 
2806504
2806920
  // node_modules/@modelcontextprotocol/sdk/dist/esm/client/stdio.js
@@ -2807007,7 +2807423,7 @@ class StreamableHTTPClientTransport {
2807007
2807423
  }
2807008
2807424
  var DEFAULT_STREAMABLE_HTTP_RECONNECTION_OPTIONS, StreamableHTTPError;
2807009
2807425
  var init_streamableHttp = __esm(() => {
2807010
- init_types56();
2807426
+ init_types58();
2807011
2807427
  init_auth2();
2807012
2807428
  init_stream();
2807013
2807429
  DEFAULT_STREAMABLE_HTTP_RECONNECTION_OPTIONS = {
@@ -2807156,7 +2807572,7 @@ var init_exit_hook = __esm(() => {
2807156
2807572
  // node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js
2807157
2807573
  var init_server = __esm(() => {
2807158
2807574
  init_protocol4();
2807159
- init_types56();
2807575
+ init_types58();
2807160
2807576
  init_ajv_provider();
2807161
2807577
  init_zod_compat();
2807162
2807578
  });
@@ -2811909,7 +2812325,7 @@ var require_content_type = __commonJS((exports6) => {
2811909
2812325
  // node_modules/@modelcontextprotocol/sdk/dist/esm/server/sse.js
2811910
2812326
  var import_raw_body, import_content_type;
2811911
2812327
  var init_sse2 = __esm(() => {
2811912
- init_types56();
2812328
+ init_types58();
2811913
2812329
  import_raw_body = __toESM(require_raw_body(), 1);
2811914
2812330
  import_content_type = __toESM(require_content_type(), 1);
2811915
2812331
  });
@@ -2812080,12 +2812496,12 @@ var init_dist47 = __esm(() => {
2812080
2812496
  }
2812081
2812497
  }
2812082
2812498
  get headers() {
2812083
- const cache5 = this[cacheKey4];
2812084
- if (cache5) {
2812085
- if (!(cache5[2] instanceof Headers)) {
2812086
- cache5[2] = new Headers(cache5[2]);
2812499
+ const cache6 = this[cacheKey4];
2812500
+ if (cache6) {
2812501
+ if (!(cache6[2] instanceof Headers)) {
2812502
+ cache6[2] = new Headers(cache6[2]);
2812087
2812503
  }
2812088
- return cache5[2];
2812504
+ return cache6[2];
2812089
2812505
  }
2812090
2812506
  return this[getResponseCache]().headers;
2812091
2812507
  }
@@ -2812121,7 +2812537,7 @@ var init_dist47 = __esm(() => {
2812121
2812537
 
2812122
2812538
  // node_modules/@modelcontextprotocol/sdk/dist/esm/server/webStandardStreamableHttp.js
2812123
2812539
  var init_webStandardStreamableHttp = __esm(() => {
2812124
- init_types56();
2812540
+ init_types58();
2812125
2812541
  });
2812126
2812542
 
2812127
2812543
  // node_modules/@modelcontextprotocol/sdk/dist/esm/server/streamableHttp.js
@@ -2812275,12 +2812691,12 @@ var init_dist48 = __esm(() => {
2812275
2812691
  init_error();
2812276
2812692
  init_tools();
2812277
2812693
  init_utils();
2812278
- init_client18();
2812694
+ init_client19();
2812279
2812695
  init_sse();
2812280
2812696
  init_stdio2();
2812281
2812697
  init_streamableHttp();
2812282
2812698
  init_protocol4();
2812283
- init_types56();
2812699
+ init_types58();
2812284
2812700
  init_exit_hook();
2812285
2812701
  init_zod();
2812286
2812702
  init_dist6();
@@ -2812667,15 +2813083,15 @@ var init_dist48 = __esm(() => {
2812667
2813083
  });
2812668
2813084
  }
2812669
2813085
  }
2812670
- async convertOutputSchema(outputSchema7) {
2812671
- if (!outputSchema7)
2813086
+ async convertOutputSchema(outputSchema8) {
2813087
+ if (!outputSchema8)
2812672
2813088
  return;
2812673
- if (isZodType3(outputSchema7)) {
2812674
- return outputSchema7;
2813089
+ if (isZodType3(outputSchema8)) {
2813090
+ return outputSchema8;
2812675
2813091
  }
2812676
2813092
  try {
2812677
- await import_json_schema_ref_parser.default.dereference(outputSchema7);
2812678
- const jsonSchemaToConvert = "jsonSchema" in outputSchema7 ? outputSchema7.jsonSchema : outputSchema7;
2813093
+ await import_json_schema_ref_parser.default.dereference(outputSchema8);
2813094
+ const jsonSchemaToConvert = "jsonSchema" in outputSchema8 ? outputSchema8.jsonSchema : outputSchema8;
2812679
2813095
  if ("toJSONSchema" in exports_external) {
2812680
2813096
  return convertJsonSchemaToZod(jsonSchemaToConvert);
2812681
2813097
  } else {
@@ -2812694,7 +2813110,7 @@ var init_dist48 = __esm(() => {
2812694
2813110
  }
2812695
2813111
  this.log("error", "Failed to convert JSON schema to Zod schema using zodFromJsonSchema", {
2812696
2813112
  error: errorDetails,
2812697
- originalJsonSchema: outputSchema7
2813113
+ originalJsonSchema: outputSchema8
2812698
2813114
  });
2812699
2813115
  throw new MastraError({
2812700
2813116
  id: "MCP_TOOL_OUTPUT_SCHEMA_CONVERSION_FAILED",
@@ -2813745,7 +2814161,7 @@ var _resolvedRoutings, _dynamicToolAgentMap, _toolsByAgent, _initialized2 = fals
2813745
2814161
  var init_manager5 = __esm(async () => {
2813746
2814162
  init_installer();
2813747
2814163
  await __promiseAll([
2813748
- init_client19(),
2814164
+ init_client20(),
2813749
2814165
  init_agents()
2813750
2814166
  ]);
2813751
2814167
  _resolvedRoutings = [];
@@ -2813991,7 +2814407,7 @@ function disableMCPHotReload() {
2813991
2814407
  }
2813992
2814408
  }
2813993
2814409
  var _mcpClient = null, _mcpTools = null, _initPromise = null, _hotReloadTimer = null, _lastPluginFingerprint = null;
2813994
- var init_client19 = __esm(async () => {
2814410
+ var init_client20 = __esm(async () => {
2813995
2814411
  init_dist48();
2813996
2814412
  init_installer();
2813997
2814413
  init_credentials();
@@ -2814121,6 +2814537,7 @@ function getScannerAgent() {
2814121
2814537
  solana_rugcheck: instrumentedSolanaKitWalletTools.solana_rugcheck,
2814122
2814538
  chainlink_bulk_prices: instrumentedChainlinkStreamsTools.chainlink_bulk_prices,
2814123
2814539
  chainlink_list_feeds: instrumentedChainlinkStreamsTools.chainlink_list_feeds,
2814540
+ synthdata_leaderboard: instrumentedSynthDataTools.synthdata_leaderboard,
2814124
2814541
  ...getRoutingToolsForAgent("Scanner")
2814125
2814542
  },
2814126
2814543
  memory: createSubAgentMemory(),
@@ -2814213,6 +2814630,9 @@ function getAnalystAgent() {
2814213
2814630
  chainlink_compare_prices: instrumentedChainlinkFeedsTools.chainlink_compare_prices,
2814214
2814631
  chainlink_ccip_supported_chains: instrumentedChainlinkCCIPTools.chainlink_ccip_supported_chains,
2814215
2814632
  chainlink_ccip_get_fee: instrumentedChainlinkCCIPTools.chainlink_ccip_get_fee,
2814633
+ synthdata_prediction_percentiles: instrumentedSynthDataTools.synthdata_prediction_percentiles,
2814634
+ synthdata_volatility: instrumentedSynthDataTools.synthdata_volatility,
2814635
+ synthdata_option_pricing: instrumentedSynthDataTools.synthdata_option_pricing,
2814216
2814636
  ...getRoutingToolsForAgent("Analyst")
2814217
2814637
  },
2814218
2814638
  memory: createSubAgentMemory(),
@@ -2814262,6 +2814682,8 @@ function getPlannerAgent() {
2814262
2814682
  rebalance_portfolio: instrumentedRuntimeTools.rebalance_portfolio,
2814263
2814683
  simulate_order_bundle: instrumentedAdvancedTools.simulate_order_bundle,
2814264
2814684
  generate_circuit_breaker_proof: instrumentedAdvancedTools.generate_circuit_breaker_proof,
2814685
+ synthdata_lp_bounds: instrumentedSynthDataTools.synthdata_lp_bounds,
2814686
+ synthdata_lp_probabilities: instrumentedSynthDataTools.synthdata_lp_probabilities,
2814265
2814687
  ...getRoutingToolsForAgent("Planner")
2814266
2814688
  },
2814267
2814689
  memory: createSubAgentMemory(),
@@ -2814437,6 +2814859,7 @@ function getMonitorAgent() {
2814437
2814859
  solana_sanctum_owned_lst: instrumentedSolanaKitDefiLendingTools.solana_sanctum_owned_lst,
2814438
2814860
  solana_voltr_positions: instrumentedSolanaKitDefiLendingTools.solana_voltr_positions,
2814439
2814861
  chainlink_ccip_status: instrumentedChainlinkCCIPTools.chainlink_ccip_status,
2814862
+ synthdata_liquidation: instrumentedSynthDataTools.synthdata_liquidation,
2814440
2814863
  ...getRoutingToolsForAgent("Monitor")
2814441
2814864
  },
2814442
2814865
  memory: createSubAgentMemory(),
@@ -2814547,7 +2814970,7 @@ function resetAgents() {
2814547
2814970
  _agents = {};
2814548
2814971
  _subAgentMemory = null;
2814549
2814972
  }
2814550
- var gordonInputGuard, gordonOutputSanitizer, DEFAULT_MEMORY_CONFIG, _memoryConfig, instrumentedIndicatorTools, instrumentedExplainTools, instrumentedMarketTools, instrumentedPositionTools, instrumentedSchedulerTools, instrumentedSystemTools, instrumentedEarnTools, instrumentedChartTools, instrumentedOrderbookTools, instrumentedWalletTools, instrumentedDiscoveryTools, instrumentedHistoryTools, instrumentedAccountTools, instrumentedTradingTools, instrumentedMarketAnalysisTools, instrumentedLiquidationIntelligenceTools, instrumentedRiskManagementTools, instrumentedStrategyTools, instrumentedMetricsTools, instrumentedCompositionTools, instrumentedBacktestTools, instrumentedSharedContextTools, instrumentedParallelAnalysisTools, instrumentedStrategyGenerationTools, instrumentedMultiModalChartTools, instrumentedMarketDataTools, instrumentedPairAnalysisTools, instrumentedAutonomousTools, instrumentedBaseOnchainTools, instrumentedAgentKitOnchainTools, instrumentedAgentKitDefiTools, instrumentedPolkadotKitAssetTools, instrumentedPolkadotKitStakingTools, instrumentedPolkadotKitDefiTools, instrumentedSolanaKitWalletTools, instrumentedSolanaKitTradingTools, instrumentedSolanaKitDefiPerpsTools, instrumentedSolanaKitDefiLendingTools, instrumentedSolanaKitDefiPoolsTools, instrumentedSolanaKitDefiBridgeTools, instrumentedChainlinkStreamsTools, instrumentedChainlinkFeedsTools, instrumentedChainlinkCCIPTools, instrumentedBaseSignalTools, instrumentedBaseIndexerTools, instrumentedUniswapDataTools, instrumentedDexSearchTools, instrumentedDefillamaYieldTools, instrumentedEvalTools, instrumentedPositionTrackingTools, instrumentedMemoryTools, instrumentedPlaybookTools, instrumentedPlaybookBacktestTools, instrumentedAuditTools, instrumentedProtocolTools, instrumentedRegimeTools, instrumentedRuntimeTools, instrumentedAdvancedTools, instrumentedCheckRiskTool, WORKING_MEMORY_TEMPLATE = `
2814973
+ var gordonInputGuard, gordonOutputSanitizer, DEFAULT_MEMORY_CONFIG, _memoryConfig, instrumentedIndicatorTools, instrumentedExplainTools, instrumentedMarketTools, instrumentedPositionTools, instrumentedSchedulerTools, instrumentedSystemTools, instrumentedEarnTools, instrumentedChartTools, instrumentedOrderbookTools, instrumentedWalletTools, instrumentedDiscoveryTools, instrumentedHistoryTools, instrumentedAccountTools, instrumentedTradingTools, instrumentedMarketAnalysisTools, instrumentedLiquidationIntelligenceTools, instrumentedRiskManagementTools, instrumentedStrategyTools, instrumentedMetricsTools, instrumentedCompositionTools, instrumentedBacktestTools, instrumentedSharedContextTools, instrumentedParallelAnalysisTools, instrumentedStrategyGenerationTools, instrumentedMultiModalChartTools, instrumentedMarketDataTools, instrumentedPairAnalysisTools, instrumentedAutonomousTools, instrumentedBaseOnchainTools, instrumentedAgentKitOnchainTools, instrumentedAgentKitDefiTools, instrumentedPolkadotKitAssetTools, instrumentedPolkadotKitStakingTools, instrumentedPolkadotKitDefiTools, instrumentedSolanaKitWalletTools, instrumentedSolanaKitTradingTools, instrumentedSolanaKitDefiPerpsTools, instrumentedSolanaKitDefiLendingTools, instrumentedSolanaKitDefiPoolsTools, instrumentedSolanaKitDefiBridgeTools, instrumentedChainlinkStreamsTools, instrumentedChainlinkFeedsTools, instrumentedChainlinkCCIPTools, instrumentedSynthDataTools, instrumentedBaseSignalTools, instrumentedBaseIndexerTools, instrumentedUniswapDataTools, instrumentedDexSearchTools, instrumentedDefillamaYieldTools, instrumentedEvalTools, instrumentedPositionTrackingTools, instrumentedMemoryTools, instrumentedPlaybookTools, instrumentedPlaybookBacktestTools, instrumentedAuditTools, instrumentedProtocolTools, instrumentedRegimeTools, instrumentedRuntimeTools, instrumentedAdvancedTools, instrumentedCheckRiskTool, WORKING_MEMORY_TEMPLATE = `
2814551
2814974
  # Trader Profile
2814552
2814975
 
2814553
2814976
  ## Personal Info
@@ -2815171,7 +2815594,7 @@ var init_agents = __esm(async () => {
2815171
2815594
  init_evals3();
2815172
2815595
  await __promiseAll([
2815173
2815596
  init_tools7(),
2815174
- init_client19(),
2815597
+ init_client20(),
2815175
2815598
  init_manager5()
2815176
2815599
  ]);
2815177
2815600
  gordonInputGuard = new GordonInputGuard;
@@ -2815225,6 +2815648,7 @@ var init_agents = __esm(async () => {
2815225
2815648
  instrumentedChainlinkStreamsTools = withToolsMetrics(chainlinkStreamsTools);
2815226
2815649
  instrumentedChainlinkFeedsTools = withToolsMetrics(chainlinkFeedsTools);
2815227
2815650
  instrumentedChainlinkCCIPTools = withToolsMetrics(chainlinkCCIPTools);
2815651
+ instrumentedSynthDataTools = withToolsMetrics(synthDataTools);
2815228
2815652
  instrumentedBaseSignalTools = withToolsMetrics(baseSignalTools);
2815229
2815653
  instrumentedBaseIndexerTools = withToolsMetrics(baseIndexerTools);
2815230
2815654
  instrumentedUniswapDataTools = withToolsMetrics(uniswapDataTools);
@@ -2817118,7 +2817542,14 @@ var init_orchestrator = __esm(async () => {
2817118
2817542
  chainlink_ccip_supported_chains: "Analyst",
2817119
2817543
  chainlink_ccip_get_fee: "Analyst",
2817120
2817544
  chainlink_ccip_transfer: "Executor",
2817121
- chainlink_ccip_status: "Monitor"
2817545
+ chainlink_ccip_status: "Monitor",
2817546
+ synthdata_prediction_percentiles: "Analyst",
2817547
+ synthdata_volatility: "Analyst",
2817548
+ synthdata_option_pricing: "Analyst",
2817549
+ synthdata_leaderboard: "Scanner",
2817550
+ synthdata_liquidation: "Monitor",
2817551
+ synthdata_lp_bounds: "Planner",
2817552
+ synthdata_lp_probabilities: "Planner"
2817122
2817553
  };
2817123
2817554
  handoffHistory = [];
2817124
2817555
  VALID_HANDOFF_RULES = {
@@ -2820066,7 +2820497,7 @@ async function checkOrphanedOrders(exchange, activeTrades, result) {
2820066
2820497
  }
2820067
2820498
 
2820068
2820499
  // src/gateway/runtime/gateway-runtime.ts
2820069
- await init_client19();
2820500
+ await init_client20();
2820070
2820501
 
2820071
2820502
  // src/gateway/scheduler/local-cron.ts
2820072
2820503
  init_logger2();
@@ -2820931,7 +2821362,7 @@ class ReconciliationLoop {
2820931
2821362
  }
2820932
2821363
  // src/gateway/daemon/process.ts
2820933
2821364
  init_engine();
2820934
- await init_client19();
2821365
+ await init_client20();
2820935
2821366
  var logger135 = createModuleLogger("gateway-daemon");
2820936
2821367
  async function startGatewayDaemonProcess() {
2820937
2821368
  await bootstrapV07();
@@ -2824642,12 +2825073,13 @@ var SLASH_COMMANDS = [
2824642
2825073
  {
2824643
2825074
  name: "earn",
2824644
2825075
  aliases: ["e", "savings"],
2824645
- description: "View earn/staking positions",
2824646
- usage: "/earn",
2825076
+ description: "Earn products \u2014 browse, subscribe, redeem, view positions",
2825077
+ usage: "/earn [positions|products|subscribe|redeem|history]",
2824647
2825078
  category: "account",
2824648
2825079
  level: 2,
2824649
- action: "tool",
2824650
- target: "get_all_earn_positions"
2825080
+ action: "agent",
2825081
+ target: "executor",
2825082
+ whenToUse: "Browse flexible/locked earn products, subscribe, redeem, or view positions and history"
2824651
2825083
  },
2824652
2825084
  {
2824653
2825085
  name: "history",
@@ -2824816,23 +2825248,24 @@ var SLASH_COMMANDS = [
2824816
2825248
  {
2824817
2825249
  name: "experiment",
2824818
2825250
  aliases: ["ab"],
2824819
- description: "View or manage A/B strategy experiments",
2824820
- usage: "/experiment [status|list|start|evaluate]",
2825251
+ description: "A/B strategy experiments \u2014 start, check, promote, rank, lineage",
2825252
+ usage: "/experiment [status|list|start|check|promote|rank|lineage|evaluate]",
2824821
2825253
  category: "strategy",
2824822
2825254
  level: 3,
2824823
2825255
  action: "agent",
2824824
- target: "backtester"
2825256
+ target: "backtester",
2825257
+ whenToUse: "Manage A/B experiments: start tests, check progress, promote winners, rank variants, view lineage"
2824825
2825258
  },
2824826
2825259
  {
2824827
2825260
  name: "audit",
2824828
2825261
  aliases: ["trail", "decisions"],
2824829
- description: "Query the agent decision audit trail",
2824830
- usage: "/audit [recent|agent <name>|position <id>]",
2825262
+ description: "Agent decision audit trail \u2014 entries, paths, activity, stats",
2825263
+ usage: "/audit [recent|agent <name>|position <id>|decision <id>|activity|stats]",
2824831
2825264
  category: "system",
2824832
2825265
  level: 2,
2824833
2825266
  action: "agent",
2824834
2825267
  target: "monitor",
2824835
- whenToUse: "Investigate why a decision was made or review agent activity"
2825268
+ whenToUse: "Investigate decision reasoning, review agent activity summaries, or view audit statistics"
2824836
2825269
  },
2824837
2825270
  {
2824838
2825271
  name: "health",
@@ -2824920,7 +2825353,7 @@ var SLASH_COMMANDS = [
2824920
2825353
  },
2824921
2825354
  {
2824922
2825355
  name: "ensemble",
2824923
- aliases: ["multi", "validate", "strategies"],
2825356
+ aliases: ["multi", "validate"],
2824924
2825357
  description: "Multi-strategy validation (~8-12s, 5 strategies)",
2824925
2825358
  usage: "/ensemble <symbol>",
2824926
2825359
  category: "market",
@@ -2825239,6 +2825672,123 @@ var SLASH_COMMANDS = [
2825239
2825672
  action: "agent",
2825240
2825673
  target: "gordon",
2825241
2825674
  whenToUse: "See latest features and bug fixes"
2825675
+ },
2825676
+ {
2825677
+ name: "chains",
2825678
+ aliases: ["networks", "chain"],
2825679
+ description: "Show configured blockchain networks and available tools",
2825680
+ usage: "/chains",
2825681
+ category: "system",
2825682
+ level: 1,
2825683
+ action: "agent",
2825684
+ target: "gordon",
2825685
+ whenToUse: "See which chain networks are configured and what tools are available"
2825686
+ },
2825687
+ {
2825688
+ name: "bridge",
2825689
+ aliases: ["ccip", "cross-chain"],
2825690
+ description: "Bridge tokens cross-chain via Chainlink CCIP",
2825691
+ usage: "/bridge [amount] [token] from [source] to [dest]",
2825692
+ category: "trading",
2825693
+ level: 1,
2825694
+ action: "agent",
2825695
+ target: "executor",
2825696
+ executionTime: "~10-30s",
2825697
+ whenToUse: "Transfer tokens between EVM chains (Ethereum, Arbitrum, Polygon, etc.)"
2825698
+ },
2825699
+ {
2825700
+ name: "solana",
2825701
+ aliases: ["sol"],
2825702
+ description: "Solana DeFi actions (swap, stake, lend, launch)",
2825703
+ usage: "/solana [swap|stake|lend|launch|balance]",
2825704
+ category: "trading",
2825705
+ level: 2,
2825706
+ action: "agent",
2825707
+ target: "executor",
2825708
+ whenToUse: "Interact with Solana DeFi protocols"
2825709
+ },
2825710
+ {
2825711
+ name: "polkadot",
2825712
+ aliases: ["dot"],
2825713
+ description: "Polkadot ecosystem actions (swap, stake, transfer)",
2825714
+ usage: "/polkadot [swap|stake|transfer|balance]",
2825715
+ category: "trading",
2825716
+ level: 2,
2825717
+ action: "agent",
2825718
+ target: "executor",
2825719
+ whenToUse: "Interact with Polkadot/HydraDX protocols"
2825720
+ },
2825721
+ {
2825722
+ name: "prices",
2825723
+ aliases: ["feeds", "cl-prices"],
2825724
+ description: "Real-time Chainlink Data Streams prices",
2825725
+ usage: "/prices [BTC ETH SOL ...]",
2825726
+ category: "market",
2825727
+ level: 1,
2825728
+ action: "agent",
2825729
+ target: "analyst",
2825730
+ executionTime: "~1-2s",
2825731
+ whenToUse: "Get sub-second institutional-grade price data from Chainlink"
2825732
+ },
2825733
+ {
2825734
+ name: "base",
2825735
+ aliases: ["base-l2"],
2825736
+ description: "Base L2 chain \u2014 trending apps, signals, DEX analytics",
2825737
+ usage: "/base [trending|signals|whales|dex]",
2825738
+ category: "market",
2825739
+ level: 2,
2825740
+ action: "agent",
2825741
+ target: "analyst",
2825742
+ executionTime: "~2-5s",
2825743
+ whenToUse: "Explore Base L2 ecosystem: trending dApps, whale movements, DEX activity"
2825744
+ },
2825745
+ {
2825746
+ name: "synth",
2825747
+ aliases: ["synthdata", "sd"],
2825748
+ description: "SynthData AI predictions \u2014 price forecasts, volatility, options, LP ranges",
2825749
+ usage: "/synth [predict|volatility|options|lp|liquidation|miners] <asset>",
2825750
+ category: "market",
2825751
+ level: 2,
2825752
+ action: "agent",
2825753
+ target: "analyst",
2825754
+ executionTime: "~2-5s",
2825755
+ whenToUse: "AI probabilistic predictions for BTC, ETH, SOL, XAU, SPYX, NVDAX, TSLAX, AAPLX, GOOGLX"
2825756
+ },
2825757
+ {
2825758
+ name: "predict",
2825759
+ aliases: ["forecast", "cone", "pred"],
2825760
+ description: "AI price prediction \u2014 probability cone from 200+ competing models",
2825761
+ usage: "/predict <asset> [days]",
2825762
+ category: "market",
2825763
+ level: 2,
2825764
+ action: "agent",
2825765
+ target: "analyst",
2825766
+ executionTime: "~2-3s",
2825767
+ whenToUse: "Forward-looking price forecast (BTC, ETH, SOL, XAU, SPYX, NVDAX, TSLAX, AAPLX, GOOGLX)"
2825768
+ },
2825769
+ {
2825770
+ name: "liquidation",
2825771
+ aliases: ["liq", "cascade"],
2825772
+ description: "Liquidation intelligence \u2014 cascade risk, pressure, crowding, squeezes",
2825773
+ usage: "/liquidation [cascade|pressure|crowding|squeeze] [symbol]",
2825774
+ category: "trading",
2825775
+ level: 2,
2825776
+ action: "agent",
2825777
+ target: "analyst",
2825778
+ executionTime: "~3-5s",
2825779
+ whenToUse: "Analyze liquidation risks, crowded positions, and short/long squeeze candidates"
2825780
+ },
2825781
+ {
2825782
+ name: "simulate",
2825783
+ aliases: ["sim", "preview"],
2825784
+ description: "Simulate order bundles before live execution",
2825785
+ usage: "/simulate [orders|breaker]",
2825786
+ category: "trading",
2825787
+ level: 3,
2825788
+ action: "agent",
2825789
+ target: "planner",
2825790
+ executionTime: "~2-5s",
2825791
+ whenToUse: "Preview order execution, simulate fills, or verify circuit breaker state"
2825242
2825792
  }
2825243
2825793
  ];
2825244
2825794
  function getCommandsByLevel(maxLevel) {
@@ -2825448,8 +2825998,24 @@ function commandToPrompt(command, args2) {
2825448
2825998
  return "Disarm the system and return to safe mode";
2825449
2825999
  case "portfolio":
2825450
2826000
  return "Show my portfolio";
2825451
- case "earn":
2825452
- return "Show my earn positions";
2826001
+ case "earn": {
2826002
+ const earnSub = args2?.trim().split(/\s+/)[0]?.toLowerCase();
2826003
+ if (earnSub === "products" || earnSub === "browse")
2826004
+ return "Show me available flexible and locked earn products with their APY rates and terms";
2826005
+ if (earnSub === "flexible")
2826006
+ return "Show me available flexible earn products I can subscribe to";
2826007
+ if (earnSub === "locked")
2826008
+ return "Show me available locked earn products with their lock periods and APY rates";
2826009
+ if (earnSub === "subscribe")
2826010
+ return "Help me subscribe to an earn product. Show me available options first.";
2826011
+ if (earnSub === "redeem")
2826012
+ return "Help me redeem from my earn positions. Show my current positions first.";
2826013
+ if (earnSub === "history")
2826014
+ return "Show my earn subscription and redemption history";
2826015
+ if (earnSub === "positions")
2826016
+ return "Show all my current earn/staking positions with current value and rewards";
2826017
+ return "Show all my current earn/staking positions with current value and rewards";
2826018
+ }
2825453
2826019
  case "history":
2825454
2826020
  return args2 ? `Show my trade history for ${args2}` : "Show my recent trade history";
2825455
2826021
  case "help":
@@ -2825850,10 +2826416,11 @@ function commandToPrompt(command, args2) {
2825850
2826416
  return "Show the regime transition history. Which symbol should I look at?";
2825851
2826417
  case "evolve":
2825852
2826418
  return args2 ? `Fork the ${args2} playbook with suggested mutations. Show me what changed and why, and prepare it for A/B testing.` : "Which playbook should I evolve? List available playbooks for mutation.";
2825853
- case "experiment":
2826419
+ case "experiment": {
2825854
2826420
  if (!args2)
2825855
2826421
  return "Show the status of all active A/B experiments.";
2825856
- const experimentSubcmd = args2.split(/\s+/)[0]?.toLowerCase();
2826422
+ const experimentParts = args2.split(/\s+/);
2826423
+ const experimentSubcmd = experimentParts[0]?.toLowerCase();
2825857
2826424
  switch (experimentSubcmd) {
2825858
2826425
  case "status":
2825859
2826426
  return "Show the status of all active A/B experiments with performance comparisons.";
@@ -2825863,9 +2826430,20 @@ function commandToPrompt(command, args2) {
2825863
2826430
  return "Start a new A/B experiment between strategy variants.";
2825864
2826431
  case "evaluate":
2825865
2826432
  return "Evaluate active experiments and recommend winners based on statistical significance.";
2826433
+ case "check":
2826434
+ return experimentParts[1] ? `Check the status and progress of experiment ${experimentParts[1]}. Show performance metrics for each variant.` : "Check the status of the most recent active experiment.";
2826435
+ case "promote":
2826436
+ return experimentParts[1] ? `Promote the winning variant from experiment ${experimentParts[1]} to become the primary strategy.` : "Promote the winner from the most recent completed experiment.";
2826437
+ case "rank":
2826438
+ return "Rank all playbook variants by performance. Show win rate, Sharpe ratio, and recommendation.";
2826439
+ case "lineage":
2826440
+ return experimentParts[1] ? `Show the playbook family tree for ${experimentParts[1]} \u2014 all forks, mutations, and their performance.` : "Show the lineage/family tree of all playbook variants and their evolutionary history.";
2826441
+ case "suggest":
2826442
+ return experimentParts[1] ? `Suggest mutations for the ${experimentParts[1]} playbook based on recent backtest results.` : "Suggest mutations for the most recent playbook based on backtest performance.";
2825866
2826443
  default:
2825867
2826444
  return "Show the status of all active A/B experiments.";
2825868
2826445
  }
2826446
+ }
2825869
2826447
  case "audit":
2825870
2826448
  if (!args2)
2825871
2826449
  return "Show me the most recent decisions from the audit trail.";
@@ -2825878,11 +2826456,153 @@ function commandToPrompt(command, args2) {
2825878
2826456
  return auditParts[1] ? `Show audit trail entries for the ${auditParts[1]} agent.` : "Which agent's decisions should I look up?";
2825879
2826457
  case "position":
2825880
2826458
  return auditParts[1] ? `Show all decisions related to position ${auditParts[1]}.` : "Which position ID should I look up?";
2826459
+ case "decision":
2826460
+ return auditParts[1] ? `Get the full decision path for decision ${auditParts[1]}. Show the complete reasoning chain, inputs, and outcomes.` : "Which decision ID should I trace? Use /audit recent to find decision IDs.";
2826461
+ case "activity":
2826462
+ return auditParts[1] ? `Show agent activity summary for the ${auditParts[1]} agent \u2014 total decisions, success rate, common actions.` : "Show agent activity summary for all agents \u2014 total decisions, success rates, and common actions.";
2826463
+ case "stats":
2826464
+ return "Show audit statistics and trends \u2014 decision volume over time, success rates by agent, common failure reasons.";
2825881
2826465
  default:
2825882
2826466
  return "Show me the most recent decisions from the audit trail.";
2825883
2826467
  }
2825884
2826468
  case "health":
2825885
2826469
  return "Run a portfolio health check. Show risk status, strategy health, and any warnings.";
2826470
+ case "chains":
2826471
+ return "Show me which blockchain networks are configured and available. For each configured chain, show the available tools and capabilities. For unconfigured chains, show what keys are needed.";
2826472
+ case "bridge":
2826473
+ if (args2) {
2826474
+ return `Help me bridge tokens cross-chain using Chainlink CCIP: ${args2}. Show me the fee estimate before executing.`;
2826475
+ }
2826476
+ return "Help me bridge tokens cross-chain using Chainlink CCIP. Show me supported chains and tokens.";
2826477
+ case "solana": {
2826478
+ if (!args2)
2826479
+ return "Show me Solana DeFi options \u2014 what can I do on Solana? Show my Solana balance if configured.";
2826480
+ const solSubcmd = args2.split(/\s+/)[0]?.toLowerCase();
2826481
+ const solArgs = args2.split(/\s+/).slice(1).join(" ");
2826482
+ switch (solSubcmd) {
2826483
+ case "swap":
2826484
+ return solArgs ? `Swap tokens on Solana: ${solArgs}` : "Help me swap tokens on Solana. What pair?";
2826485
+ case "stake":
2826486
+ return solArgs ? `Stake SOL: ${solArgs}` : "Help me stake SOL. Show me staking options.";
2826487
+ case "lend":
2826488
+ return solArgs ? `Lend on Solana: ${solArgs}` : "Show me Solana lending options.";
2826489
+ case "launch":
2826490
+ return solArgs ? `Launch a token on Solana: ${solArgs}` : "Help me launch a token on Solana.";
2826491
+ case "balance":
2826492
+ return "Show my Solana wallet balance and token holdings.";
2826493
+ default:
2826494
+ return `Solana action: ${args2}`;
2826495
+ }
2826496
+ }
2826497
+ case "polkadot": {
2826498
+ if (!args2)
2826499
+ return "Show me Polkadot ecosystem options \u2014 what can I do on Polkadot/HydraDX? Show my balance if configured.";
2826500
+ const dotSubcmd = args2.split(/\s+/)[0]?.toLowerCase();
2826501
+ const dotArgs = args2.split(/\s+/).slice(1).join(" ");
2826502
+ switch (dotSubcmd) {
2826503
+ case "swap":
2826504
+ return dotArgs ? `Swap on HydraDX: ${dotArgs}` : "Help me swap on HydraDX.";
2826505
+ case "stake":
2826506
+ return dotArgs ? `Stake DOT: ${dotArgs}` : "Help me stake DOT. Show staking options.";
2826507
+ case "transfer":
2826508
+ return dotArgs ? `Transfer on Polkadot: ${dotArgs}` : "Help me transfer tokens on Polkadot.";
2826509
+ case "balance":
2826510
+ return "Show my Polkadot wallet balance.";
2826511
+ default:
2826512
+ return `Polkadot action: ${args2}`;
2826513
+ }
2826514
+ }
2826515
+ case "prices":
2826516
+ if (args2) {
2826517
+ const pairs2 = args2.split(/\s+/).map((s2) => s2.toUpperCase());
2826518
+ return `Get real-time Chainlink Data Streams prices for: ${pairs2.join(", ")}. Show bid, ask, and timestamp.`;
2826519
+ }
2826520
+ return "Get real-time Chainlink Data Streams prices for major crypto pairs (BTC, ETH, SOL, LINK, etc.)";
2826521
+ case "base": {
2826522
+ const sub3 = args2?.trim().toLowerCase();
2826523
+ if (sub3 === "trending")
2826524
+ return "Show me trending dApps and featured projects on Base L2 from the Onchain Registry";
2826525
+ if (sub3 === "signals")
2826526
+ return "Detect trading signals on Base: whale transfers, volume spikes, new listings, and DEX pressure";
2826527
+ if (sub3 === "whales")
2826528
+ return "Show recent whale transfers on Base L2 using Basescan data";
2826529
+ if (sub3 === "dex")
2826530
+ return "Show Base DEX analytics: top pairs by volume, new token listings, and boosted tokens from DexScreener";
2826531
+ if (sub3)
2826532
+ return `Explore Base L2: ${args2}`;
2826533
+ return "Show me an overview of the Base L2 ecosystem: trending apps, recent signals, and DEX activity";
2826534
+ }
2826535
+ case "synth": {
2826536
+ if (!args2)
2826537
+ return "Show me SynthData AI prediction capabilities. Supported assets: BTC, ETH, SOL, XAU, SPYX, NVDAX, TSLAX, AAPLX, GOOGLX";
2826538
+ const synthParts = args2.split(/\s+/);
2826539
+ const synthSub = synthParts[0]?.toLowerCase();
2826540
+ const synthAsset = synthParts[1]?.toUpperCase();
2826541
+ switch (synthSub) {
2826542
+ case "predict":
2826543
+ case "prediction":
2826544
+ case "forecast":
2826545
+ return synthAsset ? `Get the AI price prediction percentiles for ${synthAsset} from SynthData. Show the probability cone with 5th to 95th percentile bands.` : "Which asset to predict? Supported: BTC, ETH, SOL, XAU, SPYX, NVDAX, TSLAX, AAPLX, GOOGLX";
2826546
+ case "volatility":
2826547
+ case "vol":
2826548
+ return synthAsset ? `Get the AI volatility forecast for ${synthAsset} from SynthData. Compare predicted vs realized volatility.` : "Which asset? Supported: BTC, ETH, SOL, XAU, SPYX, NVDAX, TSLAX, AAPLX, GOOGLX";
2826549
+ case "options":
2826550
+ case "option":
2826551
+ return synthAsset ? `Get AI-based option pricing for ${synthAsset} from SynthData. Show theoretical call/put values by strike.` : "Which asset? Supported: BTC, ETH, SOL, XAU, SPYX, NVDAX, TSLAX, AAPLX, GOOGLX";
2826552
+ case "lp":
2826553
+ case "lp-range":
2826554
+ return synthAsset ? `Get optimal LP range for ${synthAsset} from SynthData. Show Uniswap V3 bounds, IL estimates, and probability distribution.` : "Which asset? Supported: BTC, ETH, SOL, XAU, SPYX, NVDAX, TSLAX, AAPLX, GOOGLX";
2826555
+ case "liquidation":
2826556
+ case "liq":
2826557
+ return synthAsset ? `Get AI liquidation probability forecast for ${synthAsset} from SynthData. Show long/short liquidation risk over 24h.` : "Which asset? Supported: BTC, ETH, SOL, XAU, SPYX, NVDAX, TSLAX, AAPLX, GOOGLX";
2826558
+ case "miners":
2826559
+ case "leaderboard":
2826560
+ return synthAsset ? `Show the top AI prediction miners for ${synthAsset} from SynthData.` : "Show the top AI prediction miners from SynthData.";
2826561
+ default:
2826562
+ return `Get the AI price prediction percentiles for ${(synthSub ?? "BTC").toUpperCase()} from SynthData. Show the probability cone.`;
2826563
+ }
2826564
+ }
2826565
+ case "predict": {
2826566
+ if (!args2)
2826567
+ return "Which asset to predict? Supported: BTC, ETH, SOL, XAU, SPYX, NVDAX, TSLAX, AAPLX, GOOGLX";
2826568
+ const predParts = args2.split(/\s+/);
2826569
+ const predAsset = predParts[0]?.toUpperCase();
2826570
+ const predDays = predParts[1];
2826571
+ return `Get the AI price prediction cone for ${predAsset} from SynthData${predDays ? ` over ${predDays} days` : ""}. Show the 5th to 95th percentile probability bands.`;
2826572
+ }
2826573
+ case "liquidation": {
2826574
+ if (!args2)
2826575
+ return "Analyze liquidation risks across my open positions. Show cascade risk, liquidation pressure, and any squeeze candidates.";
2826576
+ const liqParts = args2.split(/\s+/);
2826577
+ const liqSub = liqParts[0]?.toLowerCase();
2826578
+ const liqSymbol = liqParts[1]?.toUpperCase();
2826579
+ switch (liqSub) {
2826580
+ case "cascade":
2826581
+ return liqSymbol ? `Analyze cascade liquidation risk for ${liqSymbol}. Show chain reaction scenarios and exposure.` : "Analyze cascade liquidation risk across the market. Show vulnerable positions and chain reaction scenarios.";
2826582
+ case "pressure":
2826583
+ return liqSymbol ? `Measure liquidation pressure on ${liqSymbol}. Show concentration of stop-losses and liquidation levels.` : "Measure liquidation pressure across my positions. Show which are most at risk.";
2826584
+ case "crowding":
2826585
+ return liqSymbol ? `Analyze crowding in ${liqSymbol} positions. Show how many traders are in similar positions.` : "Analyze crowding across positions. Show which trades are in overcrowded territory.";
2826586
+ case "squeeze":
2826587
+ return liqSymbol ? `Analyze squeeze potential for ${liqSymbol}. Is a short or long squeeze likely?` : "Find potential squeeze candidates across the market. Show short and long squeeze probabilities.";
2826588
+ default:
2826589
+ return `Analyze liquidation risks for ${args2}`;
2826590
+ }
2826591
+ }
2826592
+ case "simulate": {
2826593
+ const simSub = args2?.trim().toLowerCase();
2826594
+ if (simSub === "orders" || simSub === "bundle")
2826595
+ return "Simulate my pending order bundle. Show projected fills, slippage, and execution impact before going live.";
2826596
+ if (simSub === "breaker" || simSub === "circuit")
2826597
+ return "Generate a circuit breaker proof for the current state. Verify that safety mechanisms are properly configured.";
2826598
+ if (simSub === "verify")
2826599
+ return "Verify the integrity of a previously generated circuit breaker proof.";
2826600
+ if (simSub === "regime")
2826601
+ return "Query regime-scoped memory context. Show what the system remembers about current market conditions and how it affects decisions.";
2826602
+ if (simSub)
2826603
+ return `Simulate: ${args2}. Show projected outcomes before executing.`;
2826604
+ return "Simulate pending orders before execution. Show projected fills, slippage, and impact analysis.";
2826605
+ }
2825886
2826606
  default:
2825887
2826607
  return args2 || command.description;
2825888
2826608
  }
@@ -2826957,10 +2827677,10 @@ var StatusBar = ({
2826957
2827677
  mode: mode2,
2826958
2827678
  portfolioValue,
2826959
2827679
  connectionStatus = "disconnected",
2826960
- currency = "USDT",
2826961
2827680
  btcPrice,
2826962
2827681
  threadInfo,
2826963
- tickerItems
2827682
+ tickerItems,
2827683
+ chainStatus
2826964
2827684
  }) => {
2826965
2827685
  const formatValue = (value2) => {
2826966
2827686
  if (value2 === undefined)
@@ -2827060,6 +2827780,45 @@ var StatusBar = ({
2827060
2827780
  }, undefined, true, undefined, this)
2827061
2827781
  ]
2827062
2827782
  }, undefined, true, undefined, this),
2827783
+ chainStatus && (chainStatus.solana || chainStatus.polkadot || chainStatus.chainlink || chainStatus.evm || chainStatus.cdp || chainStatus.base) && /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Box_default, {
2827784
+ gap: 1,
2827785
+ children: [
2827786
+ /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Text, {
2827787
+ color: COLORS.DIM,
2827788
+ children: "Chains:"
2827789
+ }, undefined, false, undefined, this),
2827790
+ chainStatus.solana && /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Text, {
2827791
+ color: COLORS.GREEN,
2827792
+ bold: true,
2827793
+ children: "SOL"
2827794
+ }, undefined, false, undefined, this),
2827795
+ chainStatus.polkadot && /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Text, {
2827796
+ color: COLORS.GREEN,
2827797
+ bold: true,
2827798
+ children: "DOT"
2827799
+ }, undefined, false, undefined, this),
2827800
+ chainStatus.chainlink && /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Text, {
2827801
+ color: COLORS.GREEN,
2827802
+ bold: true,
2827803
+ children: "CL"
2827804
+ }, undefined, false, undefined, this),
2827805
+ chainStatus.evm && /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Text, {
2827806
+ color: COLORS.GREEN,
2827807
+ bold: true,
2827808
+ children: "EVM"
2827809
+ }, undefined, false, undefined, this),
2827810
+ chainStatus.cdp && /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Text, {
2827811
+ color: COLORS.GREEN,
2827812
+ bold: true,
2827813
+ children: "CDP"
2827814
+ }, undefined, false, undefined, this),
2827815
+ chainStatus.base && !chainStatus.cdp && /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Text, {
2827816
+ color: COLORS.GREEN,
2827817
+ bold: true,
2827818
+ children: "BASE"
2827819
+ }, undefined, false, undefined, this)
2827820
+ ]
2827821
+ }, undefined, true, undefined, this),
2827063
2827822
  threadInfo && /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Box_default, {
2827064
2827823
  gap: 1,
2827065
2827824
  children: [
@@ -2827111,7 +2827870,7 @@ var import_react64 = __toESM(require_react(), 1);
2827111
2827870
  // package.json
2827112
2827871
  var package_default2 = {
2827113
2827872
  name: "@general-liquidity/gordon-cli",
2827114
- version: "0.75.13",
2827873
+ version: "0.75.15",
2827115
2827874
  description: "The Frontier Trading Agent",
2827116
2827875
  author: "General Liquidity, Inc.",
2827117
2827876
  license: "MIT",
@@ -2827357,6 +2828116,8 @@ var QuickStartMenu = ({
2827357
2828116
  { label: "Deep analysis", value: "analyze" },
2827358
2828117
  { label: "Strategy Dashboard", value: "strategies-live" },
2827359
2828118
  { label: "Market Regime", value: "regime" },
2828119
+ { label: "Bridge tokens (cross-chain)", value: "bridge" },
2828120
+ { label: "Chain networks status", value: "chains" },
2827360
2828121
  { label: "Settings & API keys", value: "setup" },
2827361
2828122
  { label: "Help & commands", value: "help" }
2827362
2828123
  ];
@@ -2827602,88 +2828363,82 @@ var MarkdownText = ({
2827602
2828363
  }, undefined, false, undefined, this);
2827603
2828364
  };
2827604
2828365
  function renderInlineMarkdown(text6, baseColor) {
2828366
+ const TOKEN_RE = /\*\*\*(.+?)\*\*\*|\*\*(.+?)\*\*|\*(.+?)\*|_(.+?)_|`([^`]+)`|\[([^\]]+)\]\([^)]+\)|(\$[\d,]+\.?\d*)|([+-]?\d+\.?\d*%)/g;
2827605
2828367
  const parts = [];
2827606
- let remaining = text6;
2828368
+ let lastIndex = 0;
2827607
2828369
  let keyIndex = 0;
2827608
- while (remaining.length > 0) {
2827609
- const boldMatch = remaining.match(/^\*\*(.+?)\*\*/);
2827610
- if (boldMatch) {
2828370
+ let match;
2828371
+ while ((match = TOKEN_RE.exec(text6)) !== null) {
2828372
+ if (match.index > lastIndex) {
2828373
+ const plain = text6.slice(lastIndex, match.index).replace(/\*/g, "");
2828374
+ if (plain)
2828375
+ parts.push(/* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Text, {
2828376
+ color: baseColor,
2828377
+ children: plain
2828378
+ }, keyIndex++, false, undefined, this));
2828379
+ }
2828380
+ if (match[1] !== undefined) {
2827611
2828381
  parts.push(/* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Text, {
2827612
2828382
  bold: true,
2828383
+ italic: true,
2827613
2828384
  color: baseColor,
2827614
- children: boldMatch[1]
2828385
+ children: match[1]
2827615
2828386
  }, keyIndex++, false, undefined, this));
2827616
- remaining = remaining.slice(boldMatch[0].length);
2827617
- continue;
2827618
- }
2827619
- const italicMatch = remaining.match(/^(\*|_)(.+?)\1/);
2827620
- if (italicMatch && !remaining.startsWith("**")) {
2828387
+ } else if (match[2] !== undefined) {
2828388
+ parts.push(/* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Text, {
2828389
+ bold: true,
2828390
+ color: baseColor,
2828391
+ children: match[2]
2828392
+ }, keyIndex++, false, undefined, this));
2828393
+ } else if (match[3] !== undefined) {
2827621
2828394
  parts.push(/* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Text, {
2827622
2828395
  italic: true,
2827623
2828396
  color: baseColor,
2827624
- children: italicMatch[2]
2828397
+ children: match[3]
2827625
2828398
  }, keyIndex++, false, undefined, this));
2827626
- remaining = remaining.slice(italicMatch[0].length);
2827627
- continue;
2827628
- }
2827629
- const codeMatch = remaining.match(/^`([^`]+)`/);
2827630
- if (codeMatch) {
2828399
+ } else if (match[4] !== undefined) {
2828400
+ parts.push(/* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Text, {
2828401
+ italic: true,
2828402
+ color: baseColor,
2828403
+ children: match[4]
2828404
+ }, keyIndex++, false, undefined, this));
2828405
+ } else if (match[5] !== undefined) {
2827631
2828406
  parts.push(/* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Text, {
2827632
2828407
  color: COLORS.ACCENT,
2827633
- children: codeMatch[1]
2828408
+ children: match[5]
2827634
2828409
  }, keyIndex++, false, undefined, this));
2827635
- remaining = remaining.slice(codeMatch[0].length);
2827636
- continue;
2827637
- }
2827638
- const linkMatch = remaining.match(/^\[([^\]]+)\]\([^)]+\)/);
2827639
- if (linkMatch) {
2828410
+ } else if (match[6] !== undefined) {
2827640
2828411
  parts.push(/* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Text, {
2827641
2828412
  color: COLORS.BLUE,
2827642
2828413
  underline: true,
2827643
- children: linkMatch[1]
2828414
+ children: match[6]
2827644
2828415
  }, keyIndex++, false, undefined, this));
2827645
- remaining = remaining.slice(linkMatch[0].length);
2827646
- continue;
2827647
- }
2827648
- const priceMatch = remaining.match(/^(\$[\d,]+\.?\d*)/);
2827649
- if (priceMatch) {
2828416
+ } else if (match[7] !== undefined) {
2827650
2828417
  parts.push(/* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Text, {
2827651
2828418
  color: COLORS.HIGHLIGHT,
2827652
- children: priceMatch[1]
2828419
+ children: match[7]
2827653
2828420
  }, keyIndex++, false, undefined, this));
2827654
- remaining = remaining.slice(priceMatch[0].length);
2827655
- continue;
2827656
- }
2827657
- const percentMatch = remaining.match(/^([+-]?\d+\.?\d*%)/);
2827658
- if (percentMatch) {
2827659
- const isPositive = percentMatch[1]?.startsWith("+") || !percentMatch[1]?.startsWith("-") && !percentMatch[1]?.startsWith("0");
2828421
+ } else if (match[8] !== undefined) {
2827660
2828422
  parts.push(/* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Text, {
2827661
- color: percentMatch[1]?.startsWith("-") ? COLORS.RED : COLORS.GREEN,
2827662
- children: percentMatch[1]
2828423
+ color: match[8].startsWith("-") ? COLORS.RED : COLORS.GREEN,
2828424
+ children: match[8]
2827663
2828425
  }, keyIndex++, false, undefined, this));
2827664
- remaining = remaining.slice(percentMatch[0].length);
2827665
- continue;
2827666
2828426
  }
2827667
- const nextSpecial = remaining.search(/[\*`\[\$]|[+-]?\d+\.?\d*%/);
2827668
- if (nextSpecial === -1) {
2827669
- parts.push(/* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Text, {
2827670
- color: baseColor,
2827671
- children: remaining
2827672
- }, keyIndex++, false, undefined, this));
2827673
- break;
2827674
- } else if (nextSpecial === 0) {
2827675
- parts.push(/* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Text, {
2827676
- color: baseColor,
2827677
- children: remaining[0]
2827678
- }, keyIndex++, false, undefined, this));
2827679
- remaining = remaining.slice(1);
2827680
- } else {
2828427
+ lastIndex = match.index + match[0].length;
2828428
+ }
2828429
+ if (lastIndex < text6.length) {
2828430
+ const tail = text6.slice(lastIndex).replace(/\*/g, "");
2828431
+ if (tail)
2827681
2828432
  parts.push(/* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Text, {
2827682
2828433
  color: baseColor,
2827683
- children: remaining.slice(0, nextSpecial)
2828434
+ children: tail
2827684
2828435
  }, keyIndex++, false, undefined, this));
2827685
- remaining = remaining.slice(nextSpecial);
2827686
- }
2828436
+ }
2828437
+ if (parts.length === 0) {
2828438
+ return /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Text, {
2828439
+ color: baseColor,
2828440
+ children: text6.replace(/\*/g, "")
2828441
+ }, undefined, false, undefined, this);
2827687
2828442
  }
2827688
2828443
  return /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Text, {
2827689
2828444
  children: parts
@@ -2827970,7 +2828725,7 @@ function HowItWorksStep() {
2827970
2828725
  /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
2827971
2828726
  color: COLORS.HIGHLIGHT,
2827972
2828727
  bold: true,
2827973
- children: "50+ tools"
2828728
+ children: "350+ tools"
2827974
2828729
  }, undefined, false, undefined, this),
2827975
2828730
  " and ",
2827976
2828731
  /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
@@ -2828083,6 +2828838,88 @@ function HowItWorksStep() {
2828083
2828838
  ]
2828084
2828839
  }, undefined, true, undefined, this)
2828085
2828840
  ]
2828841
+ }, undefined, true, undefined, this),
2828842
+ /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Box_default, {
2828843
+ marginTop: 1,
2828844
+ marginBottom: 1,
2828845
+ children: /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
2828846
+ color: COLORS.WHITE,
2828847
+ children: /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
2828848
+ color: COLORS.HIGHLIGHT,
2828849
+ bold: true,
2828850
+ children: "Supported Chains:"
2828851
+ }, undefined, false, undefined, this)
2828852
+ }, undefined, false, undefined, this)
2828853
+ }, undefined, false, undefined, this),
2828854
+ /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Box_default, {
2828855
+ flexDirection: "column",
2828856
+ paddingLeft: 2,
2828857
+ children: [
2828858
+ /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Box_default, {
2828859
+ children: [
2828860
+ /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Box_default, {
2828861
+ width: 12,
2828862
+ children: /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
2828863
+ color: COLORS.WHITE,
2828864
+ bold: true,
2828865
+ children: "Solana"
2828866
+ }, undefined, false, undefined, this)
2828867
+ }, undefined, false, undefined, this),
2828868
+ /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
2828869
+ color: COLORS.DIM,
2828870
+ children: "DeFi, tokens, staking, lending (60+ tools)"
2828871
+ }, undefined, false, undefined, this)
2828872
+ ]
2828873
+ }, undefined, true, undefined, this),
2828874
+ /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Box_default, {
2828875
+ children: [
2828876
+ /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Box_default, {
2828877
+ width: 12,
2828878
+ children: /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
2828879
+ color: COLORS.WHITE,
2828880
+ bold: true,
2828881
+ children: "Polkadot"
2828882
+ }, undefined, false, undefined, this)
2828883
+ }, undefined, false, undefined, this),
2828884
+ /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
2828885
+ color: COLORS.DIM,
2828886
+ children: "Cross-chain swaps, staking, governance"
2828887
+ }, undefined, false, undefined, this)
2828888
+ ]
2828889
+ }, undefined, true, undefined, this),
2828890
+ /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Box_default, {
2828891
+ children: [
2828892
+ /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Box_default, {
2828893
+ width: 12,
2828894
+ children: /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
2828895
+ color: COLORS.WHITE,
2828896
+ bold: true,
2828897
+ children: "EVM"
2828898
+ }, undefined, false, undefined, this)
2828899
+ }, undefined, false, undefined, this),
2828900
+ /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
2828901
+ color: COLORS.DIM,
2828902
+ children: "Bridging via Chainlink CCIP, on-chain price feeds"
2828903
+ }, undefined, false, undefined, this)
2828904
+ ]
2828905
+ }, undefined, true, undefined, this),
2828906
+ /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Box_default, {
2828907
+ children: [
2828908
+ /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Box_default, {
2828909
+ width: 12,
2828910
+ children: /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
2828911
+ color: COLORS.WHITE,
2828912
+ bold: true,
2828913
+ children: "Base"
2828914
+ }, undefined, false, undefined, this)
2828915
+ }, undefined, false, undefined, this),
2828916
+ /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
2828917
+ color: COLORS.DIM,
2828918
+ children: "Smart wallets via Coinbase CDP"
2828919
+ }, undefined, false, undefined, this)
2828920
+ ]
2828921
+ }, undefined, true, undefined, this)
2828922
+ ]
2828086
2828923
  }, undefined, true, undefined, this)
2828087
2828924
  ]
2828088
2828925
  }, undefined, true, undefined, this);
@@ -2828096,7 +2828933,7 @@ function StrategiesStep() {
2828096
2828933
  children: /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
2828097
2828934
  color: COLORS.ACCENT,
2828098
2828935
  bold: true,
2828099
- children: "10 Trading Strategies"
2828936
+ children: "Trading Strategies"
2828100
2828937
  }, undefined, false, undefined, this)
2828101
2828938
  }, undefined, false, undefined, this),
2828102
2828939
  /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Box_default, {
@@ -2828108,7 +2828945,7 @@ function StrategiesStep() {
2828108
2828945
  /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
2828109
2828946
  color: COLORS.HIGHLIGHT,
2828110
2828947
  bold: true,
2828111
- children: "10 battle-tested strategies"
2828948
+ children: "battle-tested strategies"
2828112
2828949
  }, undefined, false, undefined, this),
2828113
2828950
  " for different market conditions:"
2828114
2828951
  ]
@@ -2829244,15 +2830081,24 @@ async function ensureThreadRegistered() {
2829244
2830081
  // src/infra/agents/index.ts
2829245
2830082
  init_memory3();
2829246
2830083
  init_reflection();
2829247
- await init_client19();
2830084
+ await init_client20();
2829248
2830085
 
2829249
2830086
  // src/app/SetupWizard.tsx
2829250
2830087
  init_binance2();
2829251
2830088
  init_exchange();
2830089
+ init_types11();
2829252
2830090
  init_config2();
2829253
2830091
  init_env();
2829254
2830092
  init_theme();
2829255
2830093
  var jsx_dev_runtime21 = __toESM(require_jsx_dev_runtime(), 1);
2830094
+ var CHAIN_OPTIONS = [
2830095
+ { id: "solana", label: "Solana", description: "DeFi swaps, token launches, staking, lending (60+ tools)" },
2830096
+ { id: "polkadot", label: "Polkadot", description: "Cross-chain swaps, staking, governance" },
2830097
+ { id: "chainlink", label: "Chainlink Streams", description: "Real-time institutional-grade price feeds" },
2830098
+ { id: "evm", label: "EVM / CCIP", description: "Cross-chain bridging via Chainlink CCIP" },
2830099
+ { id: "cdp", label: "Coinbase CDP", description: "Base smart wallets, onchain actions" },
2830100
+ { id: "synthdata", label: "SynthData", description: "AI price predictions, volatility, options, LP optimization" }
2830101
+ ];
2829256
2830102
  var SUPPORTED_EXCHANGES2 = ExchangeFactory.getSupportedExchanges();
2829257
2830103
  var EXCHANGE_LABELS = {
2829258
2830104
  binance: "Binance",
@@ -2829327,6 +2830173,9 @@ var EXCHANGE_INSTRUCTIONS = {
2829327
2830173
  "Supports 15+ chains: Ethereum, Base, Arbitrum, Polygon, Optimism, etc."
2829328
2830174
  ]
2829329
2830175
  };
2830176
+ var SOLANA_BASE58_REGEX = /^[1-9A-HJ-NP-Za-km-z]{32,128}$/;
2830177
+ var EVM_HEX_KEY_REGEX = /^0x[0-9a-fA-F]{64}$/;
2830178
+ var POLKADOT_HEX_KEY_REGEX = /^0x[0-9a-fA-F]{64}$/;
2829330
2830179
  function maskSecret(value2) {
2829331
2830180
  if (value2.length === 0)
2829332
2830181
  return "";
@@ -2829375,6 +2830224,21 @@ function SetupWizard({ onComplete }) {
2829375
2830224
  exchangePermissions: null,
2829376
2830225
  exchangeError: null,
2829377
2830226
  exchangeValidated: false,
2830227
+ selectedChains: [],
2830228
+ chainKeys: {
2830229
+ solanaPrivateKey: "",
2830230
+ solanaRpcUrl: "",
2830231
+ polkadotMnemonic: "",
2830232
+ polkadotPrivateKey: "",
2830233
+ chainlinkApiKey: "",
2830234
+ chainlinkApiSecret: "",
2830235
+ evmPrivateKey: "",
2830236
+ cdpApiKeyId: "",
2830237
+ cdpApiKeySecret: "",
2830238
+ cdpWalletSecret: "",
2830239
+ synthDataApiKey: ""
2830240
+ },
2830241
+ chainSetupIndex: 0,
2829378
2830242
  openaiApiKey: "",
2829379
2830243
  dedalusApiKey: "",
2829380
2830244
  preferences: {
@@ -2829432,7 +2830296,7 @@ function SetupWizard({ onComplete }) {
2829432
2830296
  }
2829433
2830297
  setState((prev) => ({
2829434
2830298
  ...prev,
2829435
- step: "llm",
2830299
+ step: "chain-select",
2829436
2830300
  isValidating: false,
2829437
2830301
  exchangePermissions: permissions,
2829438
2830302
  exchangeError: null,
@@ -2829450,7 +2830314,7 @@ function SetupWizard({ onComplete }) {
2829450
2830314
  await exchange.getAccountInfo();
2829451
2830315
  setState((prev) => ({
2829452
2830316
  ...prev,
2829453
- step: "llm",
2830317
+ step: "chain-select",
2829454
2830318
  isValidating: false,
2829455
2830319
  exchangePermissions: null,
2829456
2830320
  exchangeError: null,
@@ -2829475,15 +2830339,61 @@ function SetupWizard({ onComplete }) {
2829475
2830339
  }));
2829476
2830340
  }
2829477
2830341
  }, []);
2829478
- const saveConfiguration = import_react68.useCallback(async () => {
2830342
+ const saveConfiguration = import_react68.useCallback(async (overrides) => {
2829479
2830343
  const currentConfig2 = await loadConfig();
2829480
2830344
  const newConfig = {
2829481
2830345
  ...currentConfig2,
2829482
- preferences: state19.preferences,
2830346
+ preferences: overrides?.preferences ?? state19.preferences,
2829483
2830347
  onboardingComplete: true
2829484
2830348
  };
2829485
2830349
  const isWalletAuth = requiresWalletAuth(state19.exchangeType);
2829486
2830350
  const hasExchangeCredentials = state19.exchangeType && state19.exchangeValidated && (isWalletAuth ? !!state19.walletPrivateKey : !!(state19.exchangeApiKey && state19.exchangeApiSecret));
2830351
+ const envKeys = {};
2830352
+ if (state19.openaiApiKey)
2830353
+ envKeys.OPENAI_API_KEY = state19.openaiApiKey;
2830354
+ if (state19.dedalusApiKey)
2830355
+ envKeys.DEDALUS_API_KEY = state19.dedalusApiKey;
2830356
+ if (state19.exchangeType) {
2830357
+ const envMap = EXCHANGE_ENV_MAP[state19.exchangeType];
2830358
+ if (envMap) {
2830359
+ if (envMap.key && state19.exchangeApiKey)
2830360
+ envKeys[envMap.key] = state19.exchangeApiKey;
2830361
+ if (envMap.secret && state19.exchangeApiSecret)
2830362
+ envKeys[envMap.secret] = state19.exchangeApiSecret;
2830363
+ if (envMap.passphrase && state19.exchangePassphrase)
2830364
+ envKeys[envMap.passphrase] = state19.exchangePassphrase;
2830365
+ if (envMap.wallet && state19.walletPrivateKey)
2830366
+ envKeys[envMap.wallet] = state19.walletPrivateKey;
2830367
+ }
2830368
+ }
2830369
+ if (state19.chainKeys.solanaPrivateKey)
2830370
+ envKeys.SOLANA_PRIVATE_KEY = state19.chainKeys.solanaPrivateKey;
2830371
+ if (state19.chainKeys.solanaRpcUrl)
2830372
+ envKeys.SOLANA_RPC_URL = state19.chainKeys.solanaRpcUrl;
2830373
+ if (state19.chainKeys.polkadotMnemonic)
2830374
+ envKeys.POLKADOT_MNEMONIC = state19.chainKeys.polkadotMnemonic;
2830375
+ if (state19.chainKeys.polkadotPrivateKey)
2830376
+ envKeys.POLKADOT_PRIVATE_KEY = state19.chainKeys.polkadotPrivateKey;
2830377
+ if (state19.chainKeys.chainlinkApiKey)
2830378
+ envKeys.CHAINLINK_API_KEY = state19.chainKeys.chainlinkApiKey;
2830379
+ if (state19.chainKeys.chainlinkApiSecret)
2830380
+ envKeys.CHAINLINK_API_SECRET = state19.chainKeys.chainlinkApiSecret;
2830381
+ if (state19.chainKeys.evmPrivateKey)
2830382
+ envKeys.EVM_PRIVATE_KEY = state19.chainKeys.evmPrivateKey;
2830383
+ if (state19.chainKeys.cdpApiKeyId)
2830384
+ envKeys.CDP_API_KEY_ID = state19.chainKeys.cdpApiKeyId;
2830385
+ if (state19.chainKeys.cdpApiKeySecret)
2830386
+ envKeys.CDP_API_KEY_SECRET = state19.chainKeys.cdpApiKeySecret;
2830387
+ if (state19.chainKeys.cdpWalletSecret)
2830388
+ envKeys.CDP_WALLET_SECRET = state19.chainKeys.cdpWalletSecret;
2830389
+ if (state19.chainKeys.synthDataApiKey)
2830390
+ envKeys.SYNTHDATA_API_KEY = state19.chainKeys.synthDataApiKey;
2830391
+ const envStatus = await checkEnvStatus();
2830392
+ if (envStatus.fileExists) {
2830393
+ await saveEnvKeys(envKeys);
2830394
+ } else {
2830395
+ await createEnvFile(envKeys);
2830396
+ }
2829487
2830397
  if (hasExchangeCredentials) {
2829488
2830398
  const exchanges = currentConfig2.exchanges ? [...currentConfig2.exchanges] : [];
2829489
2830399
  const exchangeType = state19.exchangeType;
@@ -2829491,10 +2830401,10 @@ function SetupWizard({ onComplete }) {
2829491
2830401
  const newExchange = {
2829492
2830402
  id: exchangeId,
2829493
2830403
  type: exchangeType,
2829494
- apiKey: state19.exchangeApiKey,
2829495
- apiSecret: state19.exchangeApiSecret,
2829496
- passphrase: state19.exchangePassphrase || undefined,
2829497
- walletPrivateKey: state19.walletPrivateKey || undefined,
2830404
+ apiKey: "***",
2830405
+ apiSecret: "***",
2830406
+ passphrase: state19.exchangePassphrase ? "***" : undefined,
2830407
+ walletPrivateKey: state19.walletPrivateKey ? "***" : undefined,
2829498
2830408
  sandbox: false,
2829499
2830409
  isDefault: true
2829500
2830410
  };
@@ -2829509,38 +2830419,13 @@ function SetupWizard({ onComplete }) {
2829509
2830419
  if (exchangeType === "binance" && state19.exchangePermissions) {
2829510
2830420
  newConfig.exchange = {
2829511
2830421
  name: "binance",
2829512
- apiKey: state19.exchangeApiKey,
2829513
- apiSecret: state19.exchangeApiSecret,
2830422
+ apiKey: "***",
2830423
+ apiSecret: "***",
2829514
2830424
  permissions: state19.exchangePermissions
2829515
2830425
  };
2829516
2830426
  }
2829517
2830427
  }
2829518
2830428
  await saveConfig(newConfig);
2829519
- const envStatus = await checkEnvStatus();
2829520
- const envKeys = {};
2829521
- if (state19.openaiApiKey) {
2829522
- envKeys.OPENAI_API_KEY = state19.openaiApiKey;
2829523
- }
2829524
- if (state19.dedalusApiKey) {
2829525
- envKeys.DEDALUS_API_KEY = state19.dedalusApiKey;
2829526
- }
2829527
- if (state19.exchangeType === "binance" && state19.exchangeApiKey) {
2829528
- envKeys.BINANCE_API_KEY = state19.exchangeApiKey;
2829529
- }
2829530
- if (state19.exchangeType === "binance" && state19.exchangeApiSecret) {
2829531
- envKeys.BINANCE_API_SECRET = state19.exchangeApiSecret;
2829532
- }
2829533
- if (state19.exchangeType === "binance_us" && state19.exchangeApiKey) {
2829534
- envKeys.BINANCE_US_API_KEY = state19.exchangeApiKey;
2829535
- }
2829536
- if (state19.exchangeType === "binance_us" && state19.exchangeApiSecret) {
2829537
- envKeys.BINANCE_US_API_SECRET = state19.exchangeApiSecret;
2829538
- }
2829539
- if (envStatus.fileExists) {
2829540
- await saveEnvKeys(envKeys);
2829541
- } else {
2829542
- await createEnvFile(envKeys);
2829543
- }
2829544
2830429
  resetAgents();
2829545
2830430
  }, [
2829546
2830431
  state19.exchangeApiKey,
@@ -2829550,10 +2830435,39 @@ function SetupWizard({ onComplete }) {
2829550
2830435
  state19.exchangePermissions,
2829551
2830436
  state19.exchangeType,
2829552
2830437
  state19.exchangeValidated,
2830438
+ state19.chainKeys,
2829553
2830439
  state19.preferences,
2829554
2830440
  state19.openaiApiKey,
2829555
2830441
  state19.dedalusApiKey
2829556
2830442
  ]);
2830443
+ const chainStepMap = {
2830444
+ solana: "chain-solana",
2830445
+ polkadot: "chain-polkadot",
2830446
+ chainlink: "chain-chainlink",
2830447
+ evm: "chain-evm",
2830448
+ cdp: "chain-cdp",
2830449
+ synthdata: "chain-synthdata"
2830450
+ };
2830451
+ const advanceChainStep = import_react68.useCallback((currentIndex, chains5) => {
2830452
+ const nextIndex = currentIndex + 1;
2830453
+ if (nextIndex < chains5.length) {
2830454
+ const nextChain = chains5[nextIndex];
2830455
+ setState((prev) => ({
2830456
+ ...prev,
2830457
+ step: nextChain ? chainStepMap[nextChain] : "llm",
2830458
+ chainSetupIndex: nextIndex,
2830459
+ inputValue: "",
2830460
+ exchangeError: null
2830461
+ }));
2830462
+ } else {
2830463
+ setState((prev) => ({
2830464
+ ...prev,
2830465
+ step: "llm",
2830466
+ inputValue: "",
2830467
+ exchangeError: null
2830468
+ }));
2830469
+ }
2830470
+ }, []);
2829557
2830471
  const handleInputSubmit = import_react68.useCallback(async (value2) => {
2829558
2830472
  const trimmedValue = value2.trim();
2829559
2830473
  switch (state19.step) {
@@ -2829624,6 +2830538,162 @@ function SetupWizard({ onComplete }) {
2829624
2830538
  await validateExchangeCredentials(state19.exchangeType, "", "", undefined, trimmedValue);
2829625
2830539
  }
2829626
2830540
  break;
2830541
+ case "chain-select": {
2830542
+ if (!trimmedValue) {
2830543
+ setState((prev) => ({ ...prev, step: "llm", inputValue: "" }));
2830544
+ break;
2830545
+ }
2830546
+ const parts = trimmedValue.split(",").map((s2) => s2.trim().toLowerCase());
2830547
+ const selected = [];
2830548
+ for (const part of parts) {
2830549
+ const idx = parseInt(part, 10);
2830550
+ if (!isNaN(idx) && idx >= 1 && idx <= CHAIN_OPTIONS.length) {
2830551
+ const opt = CHAIN_OPTIONS[idx - 1];
2830552
+ if (opt)
2830553
+ selected.push(opt.id);
2830554
+ } else {
2830555
+ const match = CHAIN_OPTIONS.find((o4) => o4.id === part || o4.label.toLowerCase() === part);
2830556
+ if (match)
2830557
+ selected.push(match.id);
2830558
+ }
2830559
+ }
2830560
+ const unique2 = [...new Set(selected)];
2830561
+ if (unique2.length === 0) {
2830562
+ setState((prev) => ({ ...prev, step: "llm", inputValue: "" }));
2830563
+ } else {
2830564
+ const firstChain = unique2[0];
2830565
+ setState((prev) => ({
2830566
+ ...prev,
2830567
+ selectedChains: unique2,
2830568
+ chainSetupIndex: 0,
2830569
+ step: chainStepMap[firstChain],
2830570
+ inputValue: ""
2830571
+ }));
2830572
+ }
2830573
+ break;
2830574
+ }
2830575
+ case "chain-solana":
2830576
+ if (trimmedValue) {
2830577
+ if (!SOLANA_BASE58_REGEX.test(trimmedValue)) {
2830578
+ setState((prev) => ({
2830579
+ ...prev,
2830580
+ exchangeError: "Invalid format. Solana private keys are base58-encoded (no 0, O, I, l characters). Check your key and try again."
2830581
+ }));
2830582
+ return;
2830583
+ }
2830584
+ setState((prev) => ({
2830585
+ ...prev,
2830586
+ chainKeys: { ...prev.chainKeys, solanaPrivateKey: trimmedValue },
2830587
+ exchangeError: null,
2830588
+ inputValue: ""
2830589
+ }));
2830590
+ }
2830591
+ advanceChainStep(state19.chainSetupIndex, state19.selectedChains);
2830592
+ break;
2830593
+ case "chain-polkadot":
2830594
+ if (trimmedValue) {
2830595
+ const wordCount = trimmedValue.split(/\s+/).length;
2830596
+ const isHexKey = POLKADOT_HEX_KEY_REGEX.test(trimmedValue);
2830597
+ const isMnemonic = wordCount === 12 || wordCount === 24;
2830598
+ if (!isHexKey && !isMnemonic) {
2830599
+ setState((prev) => ({
2830600
+ ...prev,
2830601
+ exchangeError: `Invalid format. Expected a 12 or 24-word mnemonic phrase, or a 0x-prefixed hex private key (66 chars). Got ${wordCount} word(s).`
2830602
+ }));
2830603
+ return;
2830604
+ }
2830605
+ setState((prev) => ({
2830606
+ ...prev,
2830607
+ chainKeys: {
2830608
+ ...prev.chainKeys,
2830609
+ ...isHexKey ? { polkadotPrivateKey: trimmedValue } : { polkadotMnemonic: trimmedValue }
2830610
+ },
2830611
+ exchangeError: null,
2830612
+ inputValue: ""
2830613
+ }));
2830614
+ }
2830615
+ advanceChainStep(state19.chainSetupIndex, state19.selectedChains);
2830616
+ break;
2830617
+ case "chain-chainlink":
2830618
+ if (trimmedValue) {
2830619
+ const [key5, secret] = trimmedValue.split(",").map((s2) => s2.trim());
2830620
+ if (!key5 || !secret) {
2830621
+ setState((prev) => ({
2830622
+ ...prev,
2830623
+ exchangeError: "Both API Key and API Secret are required. Enter them comma-separated: key,secret"
2830624
+ }));
2830625
+ return;
2830626
+ }
2830627
+ setState((prev) => ({
2830628
+ ...prev,
2830629
+ chainKeys: {
2830630
+ ...prev.chainKeys,
2830631
+ chainlinkApiKey: key5,
2830632
+ chainlinkApiSecret: secret
2830633
+ },
2830634
+ exchangeError: null,
2830635
+ inputValue: ""
2830636
+ }));
2830637
+ }
2830638
+ advanceChainStep(state19.chainSetupIndex, state19.selectedChains);
2830639
+ break;
2830640
+ case "chain-evm":
2830641
+ if (trimmedValue) {
2830642
+ const evmKey = trimmedValue.startsWith("0x") ? trimmedValue : `0x${trimmedValue}`;
2830643
+ if (!EVM_HEX_KEY_REGEX.test(evmKey)) {
2830644
+ setState((prev) => ({
2830645
+ ...prev,
2830646
+ exchangeError: "Invalid EVM private key. Expected 0x followed by 64 hex characters (66 chars total)."
2830647
+ }));
2830648
+ return;
2830649
+ }
2830650
+ setState((prev) => ({
2830651
+ ...prev,
2830652
+ chainKeys: { ...prev.chainKeys, evmPrivateKey: evmKey },
2830653
+ exchangeError: null,
2830654
+ inputValue: ""
2830655
+ }));
2830656
+ }
2830657
+ advanceChainStep(state19.chainSetupIndex, state19.selectedChains);
2830658
+ break;
2830659
+ case "chain-cdp":
2830660
+ if (trimmedValue) {
2830661
+ const parts = trimmedValue.split(",").map((s2) => s2.trim());
2830662
+ if (!parts[0] || !parts[1] || !parts[2]) {
2830663
+ setState((prev) => ({
2830664
+ ...prev,
2830665
+ exchangeError: "All three values are required: API Key ID, API Key Secret, and Wallet Secret. Separate with commas."
2830666
+ }));
2830667
+ return;
2830668
+ }
2830669
+ setState((prev) => ({
2830670
+ ...prev,
2830671
+ chainKeys: {
2830672
+ ...prev.chainKeys,
2830673
+ cdpApiKeyId: parts[0],
2830674
+ cdpApiKeySecret: parts[1],
2830675
+ cdpWalletSecret: parts[2]
2830676
+ },
2830677
+ exchangeError: null,
2830678
+ inputValue: ""
2830679
+ }));
2830680
+ }
2830681
+ advanceChainStep(state19.chainSetupIndex, state19.selectedChains);
2830682
+ break;
2830683
+ case "chain-synthdata":
2830684
+ if (trimmedValue) {
2830685
+ setState((prev) => ({
2830686
+ ...prev,
2830687
+ chainKeys: {
2830688
+ ...prev.chainKeys,
2830689
+ synthDataApiKey: trimmedValue
2830690
+ },
2830691
+ exchangeError: null,
2830692
+ inputValue: ""
2830693
+ }));
2830694
+ }
2830695
+ advanceChainStep(state19.chainSetupIndex, state19.selectedChains);
2830696
+ break;
2829627
2830697
  case "llm":
2829628
2830698
  if (trimmedValue) {
2829629
2830699
  setState((prev) => ({
@@ -2829637,16 +2830707,14 @@ function SetupWizard({ onComplete }) {
2829637
2830707
  case "preferences": {
2829638
2830708
  const percent = parseInt(trimmedValue, 10);
2829639
2830709
  if (!isNaN(percent) && percent >= 0 && percent <= 100) {
2830710
+ const newPreferences = { ...state19.preferences, cashReservePercent: percent / 100 };
2829640
2830711
  setState((prev) => ({
2829641
2830712
  ...prev,
2829642
- preferences: {
2829643
- ...prev.preferences,
2829644
- cashReservePercent: percent / 100
2829645
- },
2830713
+ preferences: newPreferences,
2829646
2830714
  step: "done",
2829647
2830715
  inputValue: ""
2829648
2830716
  }));
2829649
- await saveConfiguration();
2830717
+ await saveConfiguration({ preferences: newPreferences });
2829650
2830718
  }
2829651
2830719
  break;
2829652
2830720
  }
@@ -2829656,8 +2830724,12 @@ function SetupWizard({ onComplete }) {
2829656
2830724
  state19.exchangeType,
2829657
2830725
  state19.exchangeApiKey,
2829658
2830726
  state19.exchangeApiSecret,
2830727
+ state19.chainSetupIndex,
2830728
+ state19.selectedChains,
2830729
+ state19.preferences,
2829659
2830730
  validateExchangeCredentials,
2829660
- saveConfiguration
2830731
+ saveConfiguration,
2830732
+ advanceChainStep
2829661
2830733
  ]);
2829662
2830734
  const handleInputChange = import_react68.useCallback((value2) => {
2829663
2830735
  setState((prev) => ({ ...prev, inputValue: value2 }));
@@ -2829679,10 +2830751,25 @@ function SetupWizard({ onComplete }) {
2829679
2830751
  exchangePermissions: null,
2829680
2830752
  exchangeError: null,
2829681
2830753
  exchangeValidated: false,
2830754
+ step: "chain-select",
2830755
+ inputValue: ""
2830756
+ }));
2830757
+ break;
2830758
+ case "chain-select":
2830759
+ setState((prev) => ({
2830760
+ ...prev,
2829682
2830761
  step: "llm",
2829683
2830762
  inputValue: ""
2829684
2830763
  }));
2829685
2830764
  break;
2830765
+ case "chain-solana":
2830766
+ case "chain-polkadot":
2830767
+ case "chain-chainlink":
2830768
+ case "chain-evm":
2830769
+ case "chain-cdp":
2830770
+ case "chain-synthdata":
2830771
+ advanceChainStep(state19.chainSetupIndex, state19.selectedChains);
2830772
+ break;
2829686
2830773
  case "llm":
2829687
2830774
  setState((prev) => ({
2829688
2830775
  ...prev,
@@ -2829696,10 +2830783,10 @@ function SetupWizard({ onComplete }) {
2829696
2830783
  step: "done",
2829697
2830784
  inputValue: ""
2829698
2830785
  }));
2829699
- await saveConfiguration();
2830786
+ await saveConfiguration({ preferences: state19.preferences });
2829700
2830787
  break;
2829701
2830788
  }
2829702
- }, [state19.step, saveConfiguration]);
2830789
+ }, [state19.step, state19.chainSetupIndex, state19.selectedChains, advanceChainStep, saveConfiguration]);
2829703
2830790
  use_input_default((input, key5) => {
2829704
2830791
  if (state19.step === "welcome" && (input || key5.return)) {
2829705
2830792
  setState((prev) => ({ ...prev, step: "exchange-select" }));
@@ -2829758,6 +2830845,107 @@ function SetupWizard({ onComplete }) {
2829758
2830845
  state19.step === "exchange-validating" && /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(ValidatingStep, {
2829759
2830846
  exchangeLabel
2829760
2830847
  }, undefined, false, undefined, this),
2830848
+ state19.step === "chain-select" && /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(ChainSelectStep, {
2830849
+ inputValue: state19.inputValue,
2830850
+ onInputChange: handleInputChange,
2830851
+ onSubmit: handleInputSubmit
2830852
+ }, undefined, false, undefined, this),
2830853
+ state19.step === "chain-solana" && /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(ChainKeyStep, {
2830854
+ chainLabel: "Solana",
2830855
+ description: "Enables DeFi swaps, token operations, staking, and lending across 60+ tools.",
2830856
+ keyLabel: "Solana Private Key",
2830857
+ placeholder: "Base58 private key...",
2830858
+ instructions: [
2830859
+ "Create a new Solana wallet (e.g., via Phantom or solana-keygen)",
2830860
+ "Export your private key (Base58 encoded)",
2830861
+ "Use a DEDICATED wallet with limited funds for trading"
2830862
+ ],
2830863
+ inputValue: state19.inputValue,
2830864
+ onInputChange: handleInputChange,
2830865
+ onSubmit: handleInputSubmit,
2830866
+ isMasked: true,
2830867
+ error: state19.exchangeError
2830868
+ }, undefined, false, undefined, this),
2830869
+ state19.step === "chain-polkadot" && /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(ChainKeyStep, {
2830870
+ chainLabel: "Polkadot",
2830871
+ description: "Enables cross-chain swaps on HydraDX, staking, governance, and XCM transfers.",
2830872
+ keyLabel: "Polkadot Mnemonic or Private Key",
2830873
+ placeholder: "word1 word2 ... (12/24 words) or 0x...",
2830874
+ instructions: [
2830875
+ "Create a new Polkadot account (e.g., via Polkadot.js extension)",
2830876
+ "Export your mnemonic seed phrase (12 or 24 words) or hex private key",
2830877
+ "Use a DEDICATED wallet with limited funds"
2830878
+ ],
2830879
+ inputValue: state19.inputValue,
2830880
+ onInputChange: handleInputChange,
2830881
+ onSubmit: handleInputSubmit,
2830882
+ isMasked: true,
2830883
+ error: state19.exchangeError
2830884
+ }, undefined, false, undefined, this),
2830885
+ state19.step === "chain-chainlink" && /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(ChainKeyStep, {
2830886
+ chainLabel: "Chainlink Data Streams",
2830887
+ description: "Enables sub-second institutional-grade price feeds for 50+ crypto pairs.",
2830888
+ keyLabel: "API Key, API Secret",
2830889
+ placeholder: "api-key,api-secret",
2830890
+ instructions: [
2830891
+ "Sign up at data.chain.link for Data Streams access",
2830892
+ "Generate an API key and secret from your dashboard",
2830893
+ "Enter both separated by a comma: key,secret"
2830894
+ ],
2830895
+ inputValue: state19.inputValue,
2830896
+ onInputChange: handleInputChange,
2830897
+ onSubmit: handleInputSubmit,
2830898
+ isMasked: true,
2830899
+ error: state19.exchangeError
2830900
+ }, undefined, false, undefined, this),
2830901
+ state19.step === "chain-evm" && /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(ChainKeyStep, {
2830902
+ chainLabel: "EVM / Chainlink CCIP",
2830903
+ description: "Enables cross-chain token bridging between Ethereum, Arbitrum, Optimism, Polygon, Base, and more.",
2830904
+ keyLabel: "EVM Private Key",
2830905
+ placeholder: "0x...",
2830906
+ instructions: [
2830907
+ "Export a private key from MetaMask or another EVM wallet",
2830908
+ "Use a DEDICATED wallet with limited funds",
2830909
+ "Ensure the wallet has ETH/native tokens for gas on source chains"
2830910
+ ],
2830911
+ inputValue: state19.inputValue,
2830912
+ onInputChange: handleInputChange,
2830913
+ onSubmit: handleInputSubmit,
2830914
+ isMasked: true,
2830915
+ error: state19.exchangeError
2830916
+ }, undefined, false, undefined, this),
2830917
+ state19.step === "chain-cdp" && /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(ChainKeyStep, {
2830918
+ chainLabel: "Coinbase CDP",
2830919
+ description: "Enables Base smart wallets, token deployments, and onchain actions via Coinbase Developer Platform.",
2830920
+ keyLabel: "API Key ID, API Key Secret, Wallet Secret",
2830921
+ placeholder: "key-id,key-secret,wallet-secret",
2830922
+ instructions: [
2830923
+ "Go to portal.cdp.coinbase.com and create an API key",
2830924
+ "Copy the API Key ID, API Key Secret, and Wallet Secret",
2830925
+ "Enter all three separated by commas: id,secret,wallet-secret"
2830926
+ ],
2830927
+ inputValue: state19.inputValue,
2830928
+ onInputChange: handleInputChange,
2830929
+ onSubmit: handleInputSubmit,
2830930
+ isMasked: true,
2830931
+ error: state19.exchangeError
2830932
+ }, undefined, false, undefined, this),
2830933
+ state19.step === "chain-synthdata" && /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(ChainKeyStep, {
2830934
+ chainLabel: "SynthData",
2830935
+ description: "AI-powered probabilistic price predictions, volatility forecasts, options pricing, liquidation risk, and LP optimization.",
2830936
+ keyLabel: "API Key",
2830937
+ placeholder: "your-synthdata-api-key",
2830938
+ instructions: [
2830939
+ "Sign up at synthdata.co and subscribe to a plan",
2830940
+ "Generate an API key from your SynthData dashboard",
2830941
+ "Paste your API key below"
2830942
+ ],
2830943
+ inputValue: state19.inputValue,
2830944
+ onInputChange: handleInputChange,
2830945
+ onSubmit: handleInputSubmit,
2830946
+ isMasked: true,
2830947
+ error: state19.exchangeError
2830948
+ }, undefined, false, undefined, this),
2829761
2830949
  state19.step === "llm" && /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(LLMStep, {
2829762
2830950
  exchangeConfigured: state19.exchangeValidated,
2829763
2830951
  exchangeLabel,
@@ -2829774,7 +2830962,8 @@ function SetupWizard({ onComplete }) {
2829774
2830962
  state19.step === "done" && /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(DoneStep, {
2829775
2830963
  exchangeConfigured: state19.exchangeValidated,
2829776
2830964
  exchangeLabel,
2829777
- llmConfigured: !!state19.openaiApiKey
2830965
+ llmConfigured: !!state19.openaiApiKey,
2830966
+ chainKeys: state19.chainKeys
2829778
2830967
  }, undefined, false, undefined, this),
2829779
2830968
  state19.step !== "welcome" && state19.step !== "done" && state19.step !== "exchange-validating" && /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
2829780
2830969
  marginTop: 1,
@@ -2829822,11 +2831011,15 @@ function WelcomeStep2() {
2829822
2831011
  }, undefined, false, undefined, this),
2829823
2831012
  /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
2829824
2831013
  color: COLORS.DIM,
2829825
- children: "2. LLM API key (for AI features)"
2831014
+ children: "2. Blockchain networks (Solana, Polkadot, Chainlink, etc.)"
2829826
2831015
  }, undefined, false, undefined, this),
2829827
2831016
  /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
2829828
2831017
  color: COLORS.DIM,
2829829
- children: "3. Trading preferences"
2831018
+ children: "3. LLM API key (for AI features)"
2831019
+ }, undefined, false, undefined, this),
2831020
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
2831021
+ color: COLORS.DIM,
2831022
+ children: "4. Trading preferences"
2829830
2831023
  }, undefined, false, undefined, this)
2829831
2831024
  ]
2829832
2831025
  }, undefined, true, undefined, this),
@@ -2829980,7 +2831173,8 @@ function ExchangeKeyStep({
2829980
2831173
  value: inputValue,
2829981
2831174
  onChange: onInputChange,
2829982
2831175
  onSubmit,
2829983
- placeholder: "Paste your API key here..."
2831176
+ placeholder: "Paste your API key here...",
2831177
+ mask: "*"
2829984
2831178
  }, undefined, false, undefined, this)
2829985
2831179
  ]
2829986
2831180
  }, undefined, true, undefined, this)
@@ -2830050,7 +2831244,7 @@ function ExchangeSecretStep({
2830050
2831244
  marginTop: 1,
2830051
2831245
  children: /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
2830052
2831246
  color: COLORS.DIM,
2830053
- children: "Your secret is never displayed and is stored locally in ~/.gordon/config.json"
2831247
+ children: "Your secret is never displayed and is stored locally in ~/.gordon/.env"
2830054
2831248
  }, undefined, false, undefined, this)
2830055
2831249
  }, undefined, false, undefined, this)
2830056
2831250
  ]
@@ -2830226,7 +2831420,7 @@ function ExchangeWalletStep({
2830226
2831420
  marginTop: 1,
2830227
2831421
  children: /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
2830228
2831422
  color: COLORS.DIM,
2830229
- children: "Your private key is never displayed and is stored locally in ~/.gordon/config.json"
2831423
+ children: "Your private key is never displayed and is stored locally in ~/.gordon/.env"
2830230
2831424
  }, undefined, false, undefined, this)
2830231
2831425
  }, undefined, false, undefined, this)
2830232
2831426
  ]
@@ -2830272,7 +2831466,7 @@ function LLMStep({
2830272
2831466
  children: /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
2830273
2831467
  color: COLORS.TAN,
2830274
2831468
  bold: true,
2830275
- children: "Step 2: LLM API Key"
2831469
+ children: "Step 3: LLM API Key"
2830276
2831470
  }, undefined, false, undefined, this)
2830277
2831471
  }, undefined, false, undefined, this),
2830278
2831472
  exchangeConfigured && /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
@@ -2830367,7 +2831561,7 @@ function PreferencesStep({ currentPercent, inputValue, onInputChange, onSubmit }
2830367
2831561
  children: /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
2830368
2831562
  color: COLORS.TAN,
2830369
2831563
  bold: true,
2830370
- children: "Step 3: Trading Preferences"
2831564
+ children: "Step 4: Trading Preferences"
2830371
2831565
  }, undefined, false, undefined, this)
2830372
2831566
  }, undefined, false, undefined, this),
2830373
2831567
  /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
@@ -2830420,7 +2831614,204 @@ function PreferencesStep({ currentPercent, inputValue, onInputChange, onSubmit }
2830420
2831614
  ]
2830421
2831615
  }, undefined, true, undefined, this);
2830422
2831616
  }
2830423
- function DoneStep({ exchangeConfigured, exchangeLabel, llmConfigured }) {
2831617
+ function ChainSelectStep({ inputValue, onInputChange, onSubmit }) {
2831618
+ return /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
2831619
+ flexDirection: "column",
2831620
+ children: [
2831621
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
2831622
+ marginBottom: 1,
2831623
+ children: /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
2831624
+ color: COLORS.TAN,
2831625
+ bold: true,
2831626
+ children: "Step 2: Blockchain Networks"
2831627
+ }, undefined, false, undefined, this)
2831628
+ }, undefined, false, undefined, this),
2831629
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
2831630
+ flexDirection: "column",
2831631
+ marginBottom: 1,
2831632
+ children: [
2831633
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
2831634
+ color: COLORS.WHITE,
2831635
+ children: "Configure blockchain network keys to unlock DeFi, bridging, and on-chain tools."
2831636
+ }, undefined, false, undefined, this),
2831637
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
2831638
+ color: COLORS.DIM,
2831639
+ children: "Enter the numbers of the chains you want to configure (comma-separated), or press ESC to skip."
2831640
+ }, undefined, false, undefined, this)
2831641
+ ]
2831642
+ }, undefined, true, undefined, this),
2831643
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
2831644
+ flexDirection: "column",
2831645
+ marginBottom: 1,
2831646
+ children: CHAIN_OPTIONS.map((chain5, index4) => /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
2831647
+ children: [
2831648
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
2831649
+ width: 4,
2831650
+ children: /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
2831651
+ color: COLORS.ACCENT,
2831652
+ children: [
2831653
+ index4 + 1,
2831654
+ "."
2831655
+ ]
2831656
+ }, undefined, true, undefined, this)
2831657
+ }, undefined, false, undefined, this),
2831658
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
2831659
+ width: 22,
2831660
+ children: /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
2831661
+ color: COLORS.WHITE,
2831662
+ bold: true,
2831663
+ children: chain5.label
2831664
+ }, undefined, false, undefined, this)
2831665
+ }, undefined, false, undefined, this),
2831666
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
2831667
+ color: COLORS.DIM,
2831668
+ children: chain5.description
2831669
+ }, undefined, false, undefined, this)
2831670
+ ]
2831671
+ }, chain5.id, true, undefined, this))
2831672
+ }, undefined, false, undefined, this),
2831673
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
2831674
+ marginTop: 1,
2831675
+ children: [
2831676
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
2831677
+ color: COLORS.WHITE,
2831678
+ children: "Select chains (e.g., 1,3 or solana,chainlink): "
2831679
+ }, undefined, false, undefined, this),
2831680
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(build_default, {
2831681
+ value: inputValue,
2831682
+ onChange: onInputChange,
2831683
+ onSubmit,
2831684
+ placeholder: "1,2,3"
2831685
+ }, undefined, false, undefined, this)
2831686
+ ]
2831687
+ }, undefined, true, undefined, this)
2831688
+ ]
2831689
+ }, undefined, true, undefined, this);
2831690
+ }
2831691
+ function ChainKeyStep({
2831692
+ chainLabel,
2831693
+ description,
2831694
+ keyLabel,
2831695
+ placeholder,
2831696
+ instructions: instructions16,
2831697
+ inputValue,
2831698
+ onInputChange,
2831699
+ onSubmit,
2831700
+ isMasked = false,
2831701
+ error: error56
2831702
+ }) {
2831703
+ return /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
2831704
+ flexDirection: "column",
2831705
+ children: [
2831706
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
2831707
+ marginBottom: 1,
2831708
+ children: /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
2831709
+ color: COLORS.TAN,
2831710
+ bold: true,
2831711
+ children: [
2831712
+ "Step 2: ",
2831713
+ chainLabel
2831714
+ ]
2831715
+ }, undefined, true, undefined, this)
2831716
+ }, undefined, false, undefined, this),
2831717
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
2831718
+ flexDirection: "column",
2831719
+ marginBottom: 1,
2831720
+ children: /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
2831721
+ color: COLORS.WHITE,
2831722
+ children: description
2831723
+ }, undefined, false, undefined, this)
2831724
+ }, undefined, false, undefined, this),
2831725
+ error56 && /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
2831726
+ marginBottom: 1,
2831727
+ borderStyle: "single",
2831728
+ borderColor: "red",
2831729
+ paddingX: 1,
2831730
+ children: /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
2831731
+ color: "red",
2831732
+ children: error56
2831733
+ }, undefined, false, undefined, this)
2831734
+ }, undefined, false, undefined, this),
2831735
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
2831736
+ marginBottom: 1,
2831737
+ borderStyle: "single",
2831738
+ borderColor: "yellow",
2831739
+ paddingX: 1,
2831740
+ children: /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
2831741
+ flexDirection: "column",
2831742
+ children: [
2831743
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
2831744
+ color: "yellow",
2831745
+ bold: true,
2831746
+ children: "SECURITY"
2831747
+ }, undefined, false, undefined, this),
2831748
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
2831749
+ color: "yellow",
2831750
+ children: "Use a DEDICATED wallet with limited funds. Never use your primary wallet."
2831751
+ }, undefined, false, undefined, this)
2831752
+ ]
2831753
+ }, undefined, true, undefined, this)
2831754
+ }, undefined, false, undefined, this),
2831755
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
2831756
+ flexDirection: "column",
2831757
+ marginBottom: 1,
2831758
+ children: [
2831759
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
2831760
+ color: COLORS.TAN_DIM,
2831761
+ bold: true,
2831762
+ children: "Setup instructions:"
2831763
+ }, undefined, false, undefined, this),
2831764
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
2831765
+ flexDirection: "column",
2831766
+ marginLeft: 2,
2831767
+ children: instructions16.map((line2, index4) => /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
2831768
+ color: COLORS.DIM,
2831769
+ children: [
2831770
+ index4 + 1,
2831771
+ ". ",
2831772
+ line2
2831773
+ ]
2831774
+ }, `${chainLabel}-${index4}`, true, undefined, this))
2831775
+ }, undefined, false, undefined, this)
2831776
+ ]
2831777
+ }, undefined, true, undefined, this),
2831778
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
2831779
+ marginTop: 1,
2831780
+ children: [
2831781
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
2831782
+ color: COLORS.WHITE,
2831783
+ children: [
2831784
+ keyLabel,
2831785
+ ": "
2831786
+ ]
2831787
+ }, undefined, true, undefined, this),
2831788
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(build_default, {
2831789
+ value: inputValue,
2831790
+ onChange: onInputChange,
2831791
+ onSubmit,
2831792
+ placeholder,
2831793
+ mask: isMasked ? "*" : undefined
2831794
+ }, undefined, false, undefined, this)
2831795
+ ]
2831796
+ }, undefined, true, undefined, this),
2831797
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
2831798
+ marginTop: 1,
2831799
+ children: /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
2831800
+ color: COLORS.DIM,
2831801
+ children: "Keys are stored locally in ~/.gordon/.env"
2831802
+ }, undefined, false, undefined, this)
2831803
+ }, undefined, false, undefined, this)
2831804
+ ]
2831805
+ }, undefined, true, undefined, this);
2831806
+ }
2831807
+ function DoneStep({ exchangeConfigured, exchangeLabel, llmConfigured, chainKeys }) {
2831808
+ const hasSolana = !!chainKeys.solanaPrivateKey;
2831809
+ const hasPolkadot = !!(chainKeys.polkadotMnemonic || chainKeys.polkadotPrivateKey);
2831810
+ const hasChainlink = !!(chainKeys.chainlinkApiKey && chainKeys.chainlinkApiSecret);
2831811
+ const hasEVM = !!chainKeys.evmPrivateKey;
2831812
+ const hasCDP = !!(chainKeys.cdpApiKeyId && chainKeys.cdpApiKeySecret && chainKeys.cdpWalletSecret);
2831813
+ const hasSynthData = !!chainKeys.synthDataApiKey;
2831814
+ const anyChain = hasSolana || hasPolkadot || hasChainlink || hasEVM || hasCDP || hasSynthData;
2830424
2831815
  return /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
2830425
2831816
  flexDirection: "column",
2830426
2831817
  children: [
@@ -2830462,6 +2831853,52 @@ function DoneStep({ exchangeConfigured, exchangeLabel, llmConfigured }) {
2830462
2831853
  }, undefined, false, undefined, this)
2830463
2831854
  ]
2830464
2831855
  }, undefined, true, undefined, this),
2831856
+ anyChain && /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(jsx_dev_runtime21.Fragment, {
2831857
+ children: [
2831858
+ hasSolana && /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
2831859
+ children: /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
2831860
+ color: "green",
2831861
+ children: "[OK] Solana (DeFi, tokens, staking)"
2831862
+ }, undefined, false, undefined, this)
2831863
+ }, undefined, false, undefined, this),
2831864
+ hasPolkadot && /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
2831865
+ children: /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
2831866
+ color: "green",
2831867
+ children: "[OK] Polkadot (swaps, staking, governance)"
2831868
+ }, undefined, false, undefined, this)
2831869
+ }, undefined, false, undefined, this),
2831870
+ hasChainlink && /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
2831871
+ children: /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
2831872
+ color: "green",
2831873
+ children: "[OK] Chainlink Streams (real-time prices)"
2831874
+ }, undefined, false, undefined, this)
2831875
+ }, undefined, false, undefined, this),
2831876
+ hasEVM && /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
2831877
+ children: /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
2831878
+ color: "green",
2831879
+ children: "[OK] EVM / CCIP (cross-chain bridging)"
2831880
+ }, undefined, false, undefined, this)
2831881
+ }, undefined, false, undefined, this),
2831882
+ hasCDP && /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
2831883
+ children: /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
2831884
+ color: "green",
2831885
+ children: "[OK] Coinbase CDP (Base smart wallets)"
2831886
+ }, undefined, false, undefined, this)
2831887
+ }, undefined, false, undefined, this),
2831888
+ hasSynthData && /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
2831889
+ children: /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
2831890
+ color: "green",
2831891
+ children: "[OK] SynthData (AI predictions, LP optimization)"
2831892
+ }, undefined, false, undefined, this)
2831893
+ }, undefined, false, undefined, this)
2831894
+ ]
2831895
+ }, undefined, true, undefined, this),
2831896
+ !anyChain && /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
2831897
+ children: /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
2831898
+ color: COLORS.DIM,
2831899
+ children: "[--] Blockchain networks (not configured)"
2831900
+ }, undefined, false, undefined, this)
2831901
+ }, undefined, false, undefined, this),
2830465
2831902
  /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
2830466
2831903
  children: [
2830467
2831904
  /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
@@ -2830492,6 +2831929,13 @@ function DoneStep({ exchangeConfigured, exchangeLabel, llmConfigured }) {
2830492
2831929
  children: "Note: Without exchange API keys, Gordon runs in demo mode."
2830493
2831930
  }, undefined, false, undefined, this)
2830494
2831931
  }, undefined, false, undefined, this),
2831932
+ !anyChain && /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
2831933
+ marginBottom: 1,
2831934
+ children: /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
2831935
+ color: COLORS.TAN_DIM,
2831936
+ children: "Tip: Configure chains later via Settings or by editing ~/.gordon/.env"
2831937
+ }, undefined, false, undefined, this)
2831938
+ }, undefined, false, undefined, this),
2830495
2831939
  /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
2830496
2831940
  marginTop: 1,
2830497
2831941
  children: /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
@@ -2831163,10 +2832607,11 @@ function useTheme() {
2831163
2832607
  init_llm2();
2831164
2832608
  init_binance2();
2831165
2832609
  init_exchange();
2832610
+ init_types11();
2831166
2832611
  init_monitor();
2831167
2832612
  await __promiseAll([
2831168
2832613
  init_orchestrator(),
2831169
- init_client19(),
2832614
+ init_client20(),
2831170
2832615
  init_manager5()
2831171
2832616
  ]);
2831172
2832617
  init_trades();
@@ -2834795,7 +2836240,8 @@ function AppContent({ onThemeChange }) {
2834795
2836240
  showShortcuts: false,
2834796
2836241
  showStartupHint: true,
2834797
2836242
  session: null,
2834798
- threadStatusInfo: null
2836243
+ threadStatusInfo: null,
2836244
+ chainStatus: null
2834799
2836245
  });
2834800
2836246
  const llmClientRef = import_react72.useRef(null);
2834801
2836247
  const binanceClientRef = import_react72.useRef(null);
@@ -2834830,9 +2836276,7 @@ function AppContent({ onThemeChange }) {
2834830
2836276
  }
2834831
2836277
  }));
2834832
2836278
  }
2834833
- } catch (error56) {
2834834
- console.error("Failed to update thread status:", error56);
2834835
- }
2836279
+ } catch {}
2834836
2836280
  }, []);
2834837
2836281
  const updateLastResultsFromTool = import_react72.useCallback((toolName, toolResult) => {
2834838
2836282
  if (!toolName || !toolResult || typeof toolResult !== "object")
@@ -2834888,21 +2836332,15 @@ function AppContent({ onThemeChange }) {
2834888
2836332
  binanceClientRef.current = null;
2834889
2836333
  return;
2834890
2836334
  }
2834891
- exchangeRef.current = ExchangeFactory.create(active.type, {
2834892
- apiKey: active.apiKey,
2834893
- apiSecret: active.apiSecret,
2834894
- passphrase: active.passphrase,
2834895
- sandbox: active.sandbox
2834896
- });
2834897
- if ((active.type === "binance" || active.type === "binance_us") && active.apiKey && active.apiSecret) {
2836335
+ const creds = resolveExchangeCredentials(active);
2836336
+ exchangeRef.current = ExchangeFactory.create(active.type, creds);
2836337
+ if ((active.type === "binance" || active.type === "binance_us") && creds.apiKey && creds.apiSecret) {
2834898
2836338
  const baseUrl = active.type === "binance_us" ? "https://api.binance.us" : undefined;
2834899
- binanceClientRef.current = new BinanceClient(active.apiKey, active.apiSecret, baseUrl);
2836339
+ binanceClientRef.current = new BinanceClient(creds.apiKey, creds.apiSecret, baseUrl);
2834900
2836340
  } else {
2834901
2836341
  binanceClientRef.current = null;
2834902
2836342
  }
2834903
- } catch (error56) {
2834904
- console.error("Failed to refresh active exchange:", error56);
2834905
- }
2836343
+ } catch {}
2834906
2836344
  }, []);
2834907
2836345
  const formatCommandError = import_react72.useCallback((operation, error56, context11) => {
2834908
2836346
  const err2 = error56 instanceof Error ? error56 : new Error(String(error56));
@@ -2834962,22 +2836400,16 @@ function AppContent({ onThemeChange }) {
2834962
2836400
  const active = config9.exchanges.find((ex) => ex.id === activeId) || config9.exchanges[0];
2834963
2836401
  if (active) {
2834964
2836402
  try {
2834965
- exchangeRef.current = ExchangeFactory.create(active.type, {
2834966
- apiKey: active.apiKey,
2834967
- apiSecret: active.apiSecret,
2834968
- passphrase: active.passphrase,
2834969
- sandbox: active.sandbox
2834970
- });
2836403
+ const creds = resolveExchangeCredentials(active);
2836404
+ exchangeRef.current = ExchangeFactory.create(active.type, creds);
2834971
2836405
  exchangeInitialized = true;
2834972
2836406
  if (active.type === "binance" || active.type === "binance_us") {
2834973
2836407
  const baseUrl = active.type === "binance_us" ? "https://api.binance.us" : undefined;
2834974
- binanceClientRef.current = new BinanceClient(active.apiKey, active.apiSecret, baseUrl);
2836408
+ binanceClientRef.current = new BinanceClient(creds.apiKey, creds.apiSecret, baseUrl);
2834975
2836409
  } else {
2834976
2836410
  binanceClientRef.current = null;
2834977
2836411
  }
2834978
- } catch (error56) {
2834979
- console.error("Failed to initialize configured exchange:", error56);
2834980
- }
2836412
+ } catch {}
2834981
2836413
  }
2834982
2836414
  }
2834983
2836415
  if (!exchangeInitialized && envStatus.hasBinanceKeys && envStatus.keys.BINANCE_API_KEY && envStatus.keys.BINANCE_API_SECRET) {
@@ -2835076,7 +2836508,15 @@ function AppContent({ onThemeChange }) {
2835076
2836508
  mode: config9.mode,
2835077
2836509
  connectionStatus: llmClientRef.current ? "connected" : "disconnected",
2835078
2836510
  session,
2835079
- threadStatusInfo
2836511
+ threadStatusInfo,
2836512
+ chainStatus: {
2836513
+ solana: envStatus.hasSolanaKey,
2836514
+ polkadot: envStatus.hasPolkadotKey,
2836515
+ chainlink: envStatus.hasChainlinkStreamsKeys,
2836516
+ evm: envStatus.hasChainlinkCCIPKey,
2836517
+ cdp: envStatus.hasCDPKeys,
2836518
+ base: envStatus.hasBasescanKey || envStatus.hasCDPKeys
2836519
+ }
2835080
2836520
  }));
2835081
2836521
  }
2835082
2836522
  initialize();
@@ -2836200,6 +2837640,87 @@ To disarm: \`/disarm\``,
2836200
2837640
  refreshActiveExchange,
2836201
2837641
  updateLastResultsFromTool
2836202
2837642
  ]);
2837643
+ const runMenuStream = import_react72.useCallback((prompt, messageTimestamp, errorPrefix) => {
2837644
+ (async () => {
2837645
+ if (!llmClientRef.current)
2837646
+ return;
2837647
+ const context11 = buildAppGordonContext({
2837648
+ binance: binanceClientRef.current,
2837649
+ exchange: exchangeRef.current,
2837650
+ llm: llmClientRef.current,
2837651
+ config: configRef.current,
2837652
+ portfolioValue: state19.portfolioValue ?? 0,
2837653
+ availableCash: state19.availableCash,
2837654
+ userId: state19.session?.resourceId,
2837655
+ threadId: state19.session?.threadId
2837656
+ });
2837657
+ setState((prev) => ({
2837658
+ ...prev,
2837659
+ messages: [...prev.messages, { role: "gordon", content: "", timestamp: messageTimestamp }],
2837660
+ isStreaming: true
2837661
+ }));
2837662
+ const updateMsg = (content, agent) => {
2837663
+ setState((prev) => {
2837664
+ const newMessages = [...prev.messages];
2837665
+ for (let i2 = newMessages.length - 1;i2 >= 0; i2--) {
2837666
+ const msg = newMessages[i2];
2837667
+ if (msg && msg.role === "gordon" && msg.timestamp === messageTimestamp) {
2837668
+ newMessages[i2] = { role: "gordon", content, timestamp: messageTimestamp, agent: agent || msg.agent };
2837669
+ break;
2837670
+ }
2837671
+ }
2837672
+ return { ...prev, messages: newMessages };
2837673
+ });
2837674
+ };
2837675
+ try {
2837676
+ const stream4 = processMessageStream(prompt, context11, state19.session?.threadId, state19.session?.resourceId);
2837677
+ let fullContent = "";
2837678
+ let currentAgent;
2837679
+ for await (const event9 of stream4) {
2837680
+ switch (event9.type) {
2837681
+ case "text_delta":
2837682
+ if (event9.content) {
2837683
+ fullContent += event9.content;
2837684
+ updateMsg(fullContent, currentAgent);
2837685
+ }
2837686
+ break;
2837687
+ case "agent_switch":
2837688
+ if (event9.agentName)
2837689
+ currentAgent = event9.agentName;
2837690
+ break;
2837691
+ case "tool_call_start":
2837692
+ setState((prev) => ({ ...prev, activeToolCall: event9.toolName || "tool" }));
2837693
+ if (event9.agentName)
2837694
+ currentAgent = event9.agentName;
2837695
+ break;
2837696
+ case "tool_call_end":
2837697
+ setState((prev) => ({ ...prev, activeToolCall: null }));
2837698
+ break;
2837699
+ case "done":
2837700
+ if (event9.agentName)
2837701
+ currentAgent = event9.agentName;
2837702
+ updateMsg(fullContent, currentAgent);
2837703
+ setState((prev) => ({ ...prev, isStreaming: false, activeToolCall: null }));
2837704
+ break;
2837705
+ case "error":
2837706
+ updateMsg(fullContent || `${errorPrefix}: ${event9.error}`, currentAgent);
2837707
+ setState((prev) => ({ ...prev, isStreaming: false, activeToolCall: null }));
2837708
+ break;
2837709
+ }
2837710
+ }
2837711
+ } catch (error56) {
2837712
+ setState((prev) => ({
2837713
+ ...prev,
2837714
+ messages: [
2837715
+ ...prev.messages,
2837716
+ { role: "gordon", content: `${errorPrefix}: ${error56 instanceof Error ? error56.message : "Unknown error"}`, timestamp: formatTimestamp() }
2837717
+ ],
2837718
+ isStreaming: false,
2837719
+ activeToolCall: null
2837720
+ }));
2837721
+ }
2837722
+ })();
2837723
+ }, [state19.portfolioValue, state19.availableCash, state19.session?.resourceId, state19.session?.threadId]);
2836203
2837724
  const handleMenuSelect = import_react72.useCallback((option15) => {
2836204
2837725
  switch (option15) {
2836205
2837726
  case "chat":
@@ -2836234,8 +2837755,11 @@ To disarm: \`/disarm\``,
2836234
2837755
  }));
2836235
2837756
  (async () => {
2836236
2837757
  try {
2837758
+ const exchange = exchangeRef.current;
2837759
+ if (!exchange)
2837760
+ return;
2836237
2837761
  const scanStart = Date.now();
2836238
- const scanResult = await scan(exchangeRef.current, {
2837762
+ const scanResult = await scan(exchange, {
2836239
2837763
  topN: configRef.current.preferences.topNCoins,
2836240
2837764
  timeframes: configRef.current.preferences.defaultTimeframes
2836241
2837765
  });
@@ -2836416,137 +2837940,19 @@ To disarm: \`/disarm\``,
2836416
2837940
  ]
2836417
2837941
  }));
2836418
2837942
  break;
2836419
- case "trending":
2837943
+ case "trending": {
2837944
+ const trendingTs = formatTimestamp();
2836420
2837945
  setState((prev) => ({
2836421
2837946
  ...prev,
2836422
2837947
  view: "chat",
2836423
2837948
  messages: [
2836424
2837949
  ...prev.messages,
2836425
- {
2836426
- role: "user",
2836427
- content: "/trending",
2836428
- timestamp: formatTimestamp()
2836429
- },
2836430
- {
2836431
- role: "gordon",
2836432
- content: "Finding today's trending tokens...",
2836433
- timestamp: formatTimestamp()
2836434
- }
2837950
+ { role: "user", content: "/trending", timestamp: trendingTs }
2836435
2837951
  ]
2836436
2837952
  }));
2836437
- (async () => {
2836438
- if (!llmClientRef.current)
2836439
- return;
2836440
- const context11 = buildAppGordonContext({
2836441
- binance: binanceClientRef.current,
2836442
- exchange: exchangeRef.current,
2836443
- llm: llmClientRef.current,
2836444
- config: configRef.current,
2836445
- portfolioValue: state19.portfolioValue ?? 0,
2836446
- availableCash: state19.availableCash,
2836447
- userId: state19.session?.resourceId,
2836448
- threadId: state19.session?.threadId
2836449
- });
2836450
- const trendingTimestamp = formatTimestamp();
2836451
- setState((prev) => ({
2836452
- ...prev,
2836453
- messages: [...prev.messages, {
2836454
- role: "gordon",
2836455
- content: "",
2836456
- timestamp: trendingTimestamp
2836457
- }],
2836458
- isStreaming: true
2836459
- }));
2836460
- try {
2836461
- const stream4 = processMessageStream("Show me what's trending and pumping today", context11, state19.session?.threadId, state19.session?.resourceId);
2836462
- let fullContent = "";
2836463
- let trendingAgent;
2836464
- for await (const event9 of stream4) {
2836465
- if (event9.type === "text_delta" && event9.content) {
2836466
- fullContent += event9.content;
2836467
- setState((prev) => {
2836468
- const newMessages = [...prev.messages];
2836469
- for (let i2 = newMessages.length - 1;i2 >= 0; i2--) {
2836470
- const msg = newMessages[i2];
2836471
- if (msg && msg.role === "gordon" && msg.timestamp === trendingTimestamp) {
2836472
- newMessages[i2] = {
2836473
- role: "gordon",
2836474
- content: fullContent,
2836475
- timestamp: trendingTimestamp,
2836476
- agent: trendingAgent || msg.agent
2836477
- };
2836478
- break;
2836479
- }
2836480
- }
2836481
- return { ...prev, messages: newMessages };
2836482
- });
2836483
- } else if (event9.type === "agent_switch" && event9.agentName) {
2836484
- trendingAgent = event9.agentName;
2836485
- } else if (event9.type === "tool_call_start") {
2836486
- setState((prev) => ({ ...prev, activeToolCall: event9.toolName || "tool" }));
2836487
- if (event9.agentName) {
2836488
- trendingAgent = event9.agentName;
2836489
- }
2836490
- } else if (event9.type === "tool_call_end") {
2836491
- setState((prev) => ({ ...prev, activeToolCall: null }));
2836492
- } else if (event9.type === "done") {
2836493
- if (event9.agentName) {
2836494
- trendingAgent = event9.agentName;
2836495
- }
2836496
- setState((prev) => {
2836497
- const newMessages = [...prev.messages];
2836498
- for (let i2 = newMessages.length - 1;i2 >= 0; i2--) {
2836499
- const msg = newMessages[i2];
2836500
- if (msg && msg.role === "gordon" && msg.timestamp === trendingTimestamp) {
2836501
- newMessages[i2] = {
2836502
- role: "gordon",
2836503
- content: fullContent,
2836504
- timestamp: trendingTimestamp,
2836505
- agent: trendingAgent
2836506
- };
2836507
- break;
2836508
- }
2836509
- }
2836510
- return { ...prev, messages: newMessages, isStreaming: false, activeToolCall: null };
2836511
- });
2836512
- } else if (event9.type === "error") {
2836513
- setState((prev) => {
2836514
- const newMessages = [...prev.messages];
2836515
- for (let i2 = newMessages.length - 1;i2 >= 0; i2--) {
2836516
- const msg = newMessages[i2];
2836517
- if (msg && msg.role === "gordon" && msg.timestamp === trendingTimestamp) {
2836518
- newMessages[i2] = {
2836519
- role: "gordon",
2836520
- content: fullContent || `Failed to get trending: ${event9.error}`,
2836521
- timestamp: trendingTimestamp,
2836522
- agent: trendingAgent
2836523
- };
2836524
- break;
2836525
- }
2836526
- }
2836527
- return { ...prev, messages: newMessages, isStreaming: false, activeToolCall: null };
2836528
- });
2836529
- }
2836530
- }
2836531
- } catch (error56) {
2836532
- setState((prev) => {
2836533
- const newMessages = [...prev.messages];
2836534
- for (let i2 = newMessages.length - 1;i2 >= 0; i2--) {
2836535
- const msg = newMessages[i2];
2836536
- if (msg && msg.role === "gordon" && msg.timestamp === trendingTimestamp) {
2836537
- newMessages[i2] = {
2836538
- role: "gordon",
2836539
- content: `Failed to get trending: ${error56 instanceof Error ? error56.message : "Unknown error"}`,
2836540
- timestamp: trendingTimestamp
2836541
- };
2836542
- break;
2836543
- }
2836544
- }
2836545
- return { ...prev, messages: newMessages, isStreaming: false, activeToolCall: null };
2836546
- });
2836547
- }
2836548
- })();
2837953
+ runMenuStream("Show me what's trending and pumping today", trendingTs, "Failed to get trending");
2836549
2837954
  break;
2837955
+ }
2836550
2837956
  case "analyze":
2836551
2837957
  setState((prev) => ({
2836552
2837958
  ...prev,
@@ -2836589,8 +2837995,42 @@ To disarm: \`/disarm\``,
2836589
2837995
  ]
2836590
2837996
  }));
2836591
2837997
  break;
2837998
+ case "bridge":
2837999
+ setState((prev) => ({
2838000
+ ...prev,
2838001
+ view: "chat",
2838002
+ messages: [
2838003
+ ...prev.messages,
2838004
+ {
2838005
+ role: "user",
2838006
+ content: "/bridge",
2838007
+ timestamp: formatTimestamp()
2838008
+ },
2838009
+ {
2838010
+ role: "gordon",
2838011
+ content: `What would you like to bridge? Tell me the amount, token, source chain, and destination chain.
2838012
+
2838013
+ Example: "Bridge 100 USDC from Ethereum to Arbitrum"`,
2838014
+ timestamp: formatTimestamp()
2838015
+ }
2838016
+ ]
2838017
+ }));
2838018
+ break;
2838019
+ case "chains": {
2838020
+ const chainsTs = formatTimestamp();
2838021
+ setState((prev) => ({
2838022
+ ...prev,
2838023
+ view: "chat",
2838024
+ messages: [
2838025
+ ...prev.messages,
2838026
+ { role: "user", content: "/chains", timestamp: chainsTs }
2838027
+ ]
2838028
+ }));
2838029
+ runMenuStream("Show me which blockchain networks are configured and available. List the tools and capabilities for each configured chain.", chainsTs, "Failed to check chains");
2838030
+ break;
2838031
+ }
2836592
2838032
  }
2836593
- }, [state19.portfolioValue, state19.availableCash, state19.conversationHistory, formatCommandError]);
2838033
+ }, [state19.portfolioValue, state19.availableCash, state19.conversationHistory, formatCommandError, runMenuStream]);
2836594
2838034
  const handleOnboardingComplete = import_react72.useCallback(async (options4) => {
2836595
2838035
  const updatedConfig = {
2836596
2838036
  ...configRef.current,
@@ -2836722,7 +2838162,8 @@ Please check your API keys in the .env file and restart Gordon.`,
2836722
2838162
  connectionStatus: state19.connectionStatus,
2836723
2838163
  btcPrice: state19.btcPrice,
2836724
2838164
  threadInfo: state19.threadStatusInfo || undefined,
2836725
- tickerItems
2838165
+ tickerItems,
2838166
+ chainStatus: state19.chainStatus || undefined
2836726
2838167
  }, undefined, false, undefined, this),
2836727
2838168
  state19.showShortcuts && /* @__PURE__ */ jsx_dev_runtime25.jsxDEV(ShortcutsOverlay, {
2836728
2838169
  onClose: () => setState((prev) => ({ ...prev, showShortcuts: false }))
@@ -2836901,7 +2838342,7 @@ async function checkForUpdates() {
2836901
2838342
 
2836902
2838343
  // src/index.tsx
2836903
2838344
  init_telemetry2();
2836904
- await init_client19();
2838345
+ await init_client20();
2836905
2838346
  var jsx_dev_runtime26 = __toESM(require_jsx_dev_runtime(), 1);
2836906
2838347
  var flags3 = parseFlags();
2836907
2838348
  var command = parseCommand();